[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*.{py,c,cpp,h,rst,md,yml}]\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nindent_style = space\n\n[*.{py,c,cpp,h}]\nindent_size = 4\n\n[*.yml]\nindent_size = 2\n"
  },
  {
    "path": ".gitattributes",
    "content": "* -text\n"
  },
  {
    "path": ".githooks/pre-commit",
    "content": "#!/bin/sh\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#\n# An example hook script to verify what is about to be committed.\n# Called by \"git commit\" with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\nif git rev-parse --verify HEAD >/dev/null 2>&1; then\n    against=HEAD\nelse\n    # Initial commit: diff against an empty tree object\n    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\n# Redirect output to stderr.\nexec 1>&2\n\nfiles=$(git diff --cached --name-only $against)\n\nif [ -z \"$files\" ]; then\n    exit 0\nfi\n\n# Autoformat the files.\nif [ \"$COMMIT_UNCHECKED\" != \"1\" ]; then\n    exec ./bin/autoformat-nuitka-source --from-commit\nfi\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "custom: ['https://nuitka.net/pages/donations.html']\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "Before submitting an Issue, please review the\n[Issue Guidelines](https://github.com/Nuitka/Nuitka/blob/develop/CONTRIBUTING.md#submitting-an-issue).\n\n- Please check whether the bug was already reported or fixed.\n\n- Please check out if the develop version of Nuitka works better for you.\n\n  Download source, packages [from here](https://nuitka.net/doc/download.html) where you will also\n  find instructions how to do it via pip or git.\n\nIf you want to post a problem/bug, to help us understand and resolve your issue please check that\nyou have provided at least the information below, and discard up to here:\n\n- Nuitka version, full Python version, flavor, OS, etc. as output by *this exact* command.\n\n  > python -m nuitka --version\n\n  If you are not providing the full output. The issue cannot be solved and will be considered\n  `invalid`. The command outputs more than you think, and we are adding more all the time. We do not\n  want to left guessing or trying things out to reproduce your issue.\n\n- How did you install Nuitka and Python\n\n  Did you use pip, anaconda, deb, rpm, from source, git clone, then install into a virtualenv or\n  not, this is very important usually and one thing, the above command does not tell us (yet).\n\n- The specific PyPI names and versions\n\n  It should be taken from this output if there specific packages involved, e.g. `numpy`, you are\n  expected to shorten this to the relevant ones.\n\n  > python -m pip freeze\n\n- Many times when you get an error from Nuitka, your setup may be special\n\n  Then even a `print(\"hello world\")` program will not work, please try that and report that error\n  instead. We do not need a report that says \"Tensorflow does not work\" when nothing actually works\n  for you. You ought to also read the User Manual and check that your setup is actually supported\n  already.\n\n- Also supply a Short, Self Contained, Correct, Example\n\n  That demonstrates the issue i.e a small piece of code which reproduces the issue and can be run\n  with out any other (or as few as possible) external dependencies. Issues without this may will\n  likely be rejected without much consideration. Often this can be as simple as importing a package,\n  if this is a packaging issue, try that first.\n\n  Pointers to repositories with usage of `pipenv` are very welcome, archives with examples are too,\n  e.g. if a certain package structure is needed. This must be only source code, binaries are not\n  used ever by us. But beware, that e.g. we cannot click around and stuff. Still do an effort to\n  make the usage obvious. Having a compile script in the repo is perfect.\n\n  But this cannot be much code for non-commercial users, since that causes too much effort. We\n  cannot just compile your code, run it and have it download a control and command center.\n\n- Provide in your issue the Nuitka options used\n\n  Ideally use the `# nuitka-project:` options feature in the code, so options and example code go\n  along. Alternatively state the command line.\n\n  [Nuitka Options in the code](https://nuitka.net/doc/user-manual.html#nuitka-options-in-the-code)\n\n- Avoid unnecessary options\n\n  Do not use `--onefile` if the issue also happens with `--standalone`. Minimize the use of options\n  as far as you can, please. Do not disable outputs with `--quiet` and do not disable warnings.\n\n- Note if this is a regression\n\n  If it used to work in an earlier version of Nuitka, please note what you know about that. Since\n  git bisect is a thing for which we do a lot of error to make it usable, this will help\n  dramatically to isolate the issue.\n\n- Consider getting commercial support\n\n  [Nuitka commercial](https://nuitka.net/doc/commercial.html) offers subscriptions and priority\n  support. This will accelerate your problem solution and helps to sustain Nuitka development. Also\n  you then have a chance to provide source code of your project to us, which might simplify things,\n  or pay for time to solve your issues in your environment.\n\nSome things are not welcome, please consider it.\n\n- Do *not* post screenshots\n\n  These are not welcome unless absolutely necessary, e.g. because of Qt display problem, instead\n  capture the output of programs, so things are searchable and copy&paste will work. I just plainly\n  don't want to manually copy strings and hope they match.\n\n- Do *not* close the issue yourself, we will close things on stable releases\n\n  We close issues only when they are released as a stable version, e.g. in a hotfix or a new\n  release, before that it will be \"Done\" in planning and go through `factory` and `develop` tags to\n  indicate they are solved there.\n\n  Of course, if you find out your issue is invalid, please do close it, and we then attach the\n  `invalid` tag.\n\n- Do *not* report against factory version\n\n  Unless you were asked to test it there, it is frequently very broken, and there is only noise to\n  be had. Telling me about it on Discord would be a better idea.\n\n- Do *not* let this template remain part of the issue, it's noise.\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "Thank your for contributing to Nuitka!\n\n!! Please check that you select the **develop branch** (details see below link) !!\n\nBefore submitting a PR, please review the guidelines:\n[Contributing Guidelines](https://github.com/Nuitka/Nuitka/blob/develop/CONTRIBUTING.md)\n\n# What does this PR do?\n\n# Why was it initiated? Any relevant Issues?\n\n# PR Checklist\n\n- [ ] Correct base branch selected? Should be `develop` branch.\n- [ ] Enabled commit hook or executed `./bin/autoformat-nuitka-source`.\n- [ ] All tests still pass. Check the Developer Manual about `Running the Tests`. There are GitHub\n  Actions tests that cover the most important things however, and you are welcome to rely on those,\n  but they might not cover enough.\n- [ ] Ideally new features or fixed regressions ought to be covered via new tests.\n- [ ] Ideally new or changed features have documentation updates.\n"
  },
  {
    "path": ".github/workflows/testing.yml",
    "content": "name: Nuitka tests\n# makes little sense, spell-checker: disable\non:\n  pull_request:\n    branches:\n      - develop\n  push:\n    branches:\n      - main\n      - develop\n      - factory\n      - release/**\n      - hotfix/**\n\npermissions:\n  contents: read\n\njobs:\n  linux:\n    runs-on: ubuntu-22.04\n    strategy:\n      matrix:\n        python_version:\n            - '3.7'\n            - '3.8'\n            - '3.9'\n            - '3.10'\n            - '3.11'\n    name: Ubuntu Python ${{ matrix.python_version }}\n    steps:\n      - name: 🛎️ Checkout\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n\n      - name: 🐍 Use Python ${{ matrix.python_version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python_version }}\n\n      - name: 🧳 Install Nuitka and dependencies\n        run: |\n          sudo apt-get update\n          sudo apt-get install patchelf gdb ccache libfuse2\n          python -m pip install --no-python-version-warning --disable-pip-version-check -r requirements-devel.txt\n          python -m pip install --no-python-version-warning --disable-pip-version-check .\n\n      - name: Verbose scons output in compilation\n        run: |\n          python -m nuitka --module --show-scons --run --report=compilation-report-module.xml --experimental=debug-report-traceback tests/basics/EmptyModuleTest.py\n          python -m nuitka --show-scons --run --report=compilation-report-exe.xml --experimental=debug-report-traceback tests/basics/EmptyModuleTest.py\n\n      - name: Archive compilation reports for empty modules\n        uses: actions/upload-artifact@v3\n        with:\n          name: compilation-reports\n          path: |\n            *.xml\n\n      # This can be used to ssh into GitHub actions if debugging is needed.\n      # - uses: actions/checkout@v2\n      # - name: Setup upterm session\n      #   uses: lhotari/action-upterm@v1\n      #   with:\n      #     ## limits ssh access and adds the ssh public keys of the listed GitHub users\n      #     limit-access-to-users: kayhayen\n\n      - name: Run Nuitka test suite\n        run: |\n          python -m nuitka --version\n          env | sort\n          python ./tests/run-tests --no-other-python --skip-reflection-test --skip-all-cpython-tests --assume-yes-for-downloads\n\n      - name: PyLint on Nuitka source code\n        run: |\n          python ./bin/check-nuitka-with-pylint\n        if: matrix.python_version == '3.9'\n\n      - name: RestLint on Nuitka source code\n        run: |\n          python ./bin/check-nuitka-with-restlint\n        if: matrix.python_version == '3.9'\n\n      - name: YamlLint on Nuitka source code\n        run: |\n          python ./bin/check-nuitka-with-yamllint\n        if: matrix.python_version == '3.9'\n\n      - name: Codespell on Nuitka source code\n        run: |\n          python ./bin/check-nuitka-with-codespell\n        if: matrix.python_version == '3.9'\n\n      - name: Auto-format check on Nuitka source code\n        run: |\n          # Install clang-format that matches what we use in VS code.\n          wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -\n          sudo apt-get install software-properties-common\n          sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main'\n          sudo apt-get update\n          sudo apt-get install clang-format-19\n\n          python ./bin/autoformat-nuitka-source --check-only\n        if: matrix.python_version == '3.9'\n\n  mac-python3:\n    runs-on: macos-latest\n    strategy:\n      matrix:\n        python_version:\n            - '3.7'\n            - '3.8'\n            - '3.9'\n            - '3.10'\n            - '3.11'\n    name: macOS Python ${{ matrix.python_version }}\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Use Python ${{ matrix.python_version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python_version }}\n\n      - name: Verbose installation output for Python\n        run: |\n          set -x\n          which python\n          otool -L $(which python)\n          otool -l $(which python)\n          ls -lR $(dirname $(dirname $(which python)))\n\n      - name: 🧳 Install Nuitka and dependencies\n        run: |\n          pip install --no-python-version-warning --disable-pip-version-check -r requirements-devel.txt\n          pip install --no-python-version-warning --disable-pip-version-check .\n\n      - name: Verbose scons output in compilation\n        run: |\n          python -m nuitka --module --show-scons --run --assume-yes-for-downloads tests/basics/EmptyModuleTest.py\n          python -m nuitka --show-scons --run --assume-yes-for-downloads tests/basics/EmptyModuleTest.py\n\n      - name: Run Nuitka test suite\n        run: |\n          python -m nuitka --version\n          env | sort\n          python ./tests/run-tests --no-other-python --skip-reflection-test --skip-all-cpython-tests\n\n  windows:\n    runs-on: windows-latest\n    strategy:\n      matrix:\n        python_version:\n            - '3.7'\n            - '3.8'\n            - '3.9'\n            - '3.10'\n            - '3.11'\n    name: Windows Python ${{ matrix.python_version }}\n    steps:\n      - uses: actions/checkout@v3\n\n      - uses: ilammy/msvc-dev-cmd@v1\n\n      - name: Use Python ${{ matrix.python_version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python_version }}\n\n      - name: 🧳 Install Nuitka and dependencies\n        run: |\n          pip install --no-python-version-warning --disable-pip-version-check -r requirements-devel.txt\n          pip install --no-python-version-warning --disable-pip-version-check .\n\n      - name: Verbose scons output in compilation\n        run: |\n          python -m nuitka --module --show-scons --run --assume-yes-for-downloads tests\\basics\\EmptyModuleTest.py\n          python -m nuitka --show-scons --run tests\\basics\\EmptyModuleTest.py\n\n      - name: Run Nuitka test suite\n        run: |\n          Get-ChildItem env:\n          python -m nuitka --version\n          python .\\tests\\run-tests --no-other-python --no-debug --skip-reflection-test --skip-all-cpython-tests --assume-yes-for-downloads\n"
  },
  {
    "path": ".gitignore",
    "content": "*~\n*.DS_Store\n*.e4t\n*.e4q\n*.e4s\n*.pyc\n__pycache__/\n*.pyo\n*.swp\n*.swo\n*.o\n*.os\n*.so\n*.pyd\n*.pyi\n*.exe\n*.exe.away\n*.cmd\n*.bin\n*.build\n*.onefile-build\n*.dist\n*.app\n*.key\n*.xml\n*.optimization.log\n*.inclusion.log\n*.strace\n*.dtruss\n*.nuitka-pgo\n.mypy_cache\n*.egg-info\ntests/reflected/nuitka/\ntests/reflected/tests/\ntests/reflected/nuitka.py\ntests/reflected/nuitka-runner.py\ntests/basics/BigConstants.py\ntests/generated/*.py\n!tests/generated/run_all.py\ntests/PyPI-pytest/venv_*\n*.dblite\n*.pdb\nreleases/\nhtml\nman/\nhtmlcov/\nMini.py\npython??.dll\npython??_d.dll\nbuild\n!nuitka/build\ndist\nMANIFEST\nREADME.pdf\nREADME.html\nDeveloper_Manual.pdf\nDeveloper_Manual.html\nChangelog.pdf\nChangelog.html\ndoc/man-*.html\ndoxygen-warnings.log\nvenv_cpython/\nvenv_nuitka/\n.pytest_cache\ndoxygen_*\ndoxygen-*\n.coverage*\n*.tmp\n*.dat\n.vscode/ipch\n.vscode/tags\n.vscode/.ropeproject\nNuitka-*\nnuitka/tools/podman/containers/requirements-devel.txt\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"tests/CPython26\"]\n    path = tests/CPython26\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython26\n[submodule \"tests/CPython27\"]\n    path = tests/CPython27\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython27\n[submodule \"tests/CPython32\"]\n    path = tests/CPython32\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython32\n[submodule \"tests/CPython33\"]\n    path = tests/CPython33\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython33\n[submodule \"tests/CPython34\"]\n    path = tests/CPython34\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython34\n[submodule \"tests/CPython35\"]\n    path = tests/CPython35\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython35\n[submodule \"tests/CPython36\"]\n    path = tests/CPython36\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython36\n[submodule \"tests/CPython37\"]\n    path = tests/CPython37\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython37\n[submodule \"tests/CPython38\"]\n    path = tests/CPython38\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython38\n[submodule \"tests/CPython39\"]\n    path = tests/CPython39\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython39\n[submodule \"tests/CPython310\"]\n    path = tests/CPython310\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython310\n[submodule \"tests/CPython311\"]\n    path = tests/CPython311\n    url = https://github.com/Nuitka/Nuitka-CPython-tests.git\n    branch = CPython311\n"
  },
  {
    "path": ".sourcery.yaml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\nignore:\n  - \"tests\"\n  - \"nuitka/build/inline_copy\"\n\nrefactor:\n  python_version: '2.6'\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": ".vscode/c_cpp_properties.json",
    "content": "{\n    \"env\": {\n        \"myDefaultIncludePath\": [\n            \"${workspaceFolder}/nuitka/build/include\",\n            \"${workspaceFolder}/nuitka/build/static_src\",\n            \"${workspaceFolder}/nuitka/build/inline_copy/zstd\",\n            \"${workspaceFolder}/nuitka/build/inline_copy/zlib\",\n            \"${workspaceFolder}/nuitka/build/inline_copy/libbacktrace\"\n        ]\n    },\n    \"configurations\": [\n        {\n            \"name\": \"Win32\",\n            \"includePath\": [\n                \"${myDefaultIncludePath}\",\n                \"C:\\\\Python311\\\\Include\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3b0\"\n            ],\n            \"windowsSdkVersion\": \"10.0.19041.0\",\n            \"compilerPath\": \"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"msvc-x64\"\n        },\n        {\n            \"name\": \"Win32-Py312\",\n            \"includePath\": [\n                \"${myDefaultIncludePath}\",\n                \"C:\\\\Python312\\\\Include\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3c0\"\n            ],\n            \"windowsSdkVersion\": \"10.0.19041.0\",\n            \"compilerPath\": \"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"msvc-x64\"\n        },\n        {\n            \"name\": \"Win32-Py310\",\n            \"includePath\": [\n                \"${myDefaultIncludePath}\",\n                \"C:\\\\Python310\\\\Include\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3a0\"\n            ],\n            \"windowsSdkVersion\": \"10.0.19041.0\",\n            \"compilerPath\": \"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"msvc-x64\"\n        },\n        {\n            \"name\": \"Win32-Py27\",\n            \"includePath\": [\n                \"${myDefaultIncludePath}\",\n                \"C:\\\\Python27\\\\Include\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x270\"\n            ],\n            \"windowsSdkVersion\": \"10.0.19041.0\",\n            \"compilerPath\": \"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"msvc-x64\"\n        },\n        {\n            \"name\": \"Linux-Python3.9\",\n            \"includePath\": [\n                \"/usr/include\",\n                \"${myDefaultIncludePath}\",\n                \"/usr/include/python3.9\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x390\"\n            ],\n            \"compilerPath\": \"/usr/bin/gcc\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"${default}\"\n        },\n        {\n            \"name\": \"Linux-Python3.10\",\n            \"includePath\": [\n                \"/usr/include\",\n                \"${myDefaultIncludePath}\",\n                \"/usr/include/python3.10\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3a0\"\n            ],\n            \"compilerPath\": \"/usr/bin/gcc\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"${default}\"\n        },\n        {\n            \"name\": \"Linux-Python3.11\",\n            \"includePath\": [\n                \"/usr/include\",\n                \"${myDefaultIncludePath}\",\n                \"/usr/include/python3.11\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3B0\"\n            ],\n            \"compilerPath\": \"/usr/bin/gcc\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"${default}\"\n        },\n        {\n            \"name\": \"Linux-Python2.7\",\n            \"includePath\": [\n                \"/usr/include\",\n                \"${myDefaultIncludePath}\",\n                \"/usr/include/python2.7\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x270\"\n            ],\n            \"compilerPath\": \"/usr/bin/gcc\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"${default}\"\n        },\n        {\n            \"name\": \"Mac\",\n            \"includePath\": [\n                \"${myDefaultIncludePath}\",\n                \"/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n            ],\n            \"defines\": [\n                \"_DEBUG\",\n                \"UNICODE\",\n                \"_UNICODE\",\n                \"__IDE_ONLY__\",\n                \"PYTHON_VERSION=0x3B0\"\n            ],\n            \"compilerPath\": \"/usr/bin/gcc\",\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\",\n            \"intelliSenseMode\": \"${default}\"\n        }\n    ],\n    \"version\": 4\n}\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.\n    // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp\n\n    // List of extensions which should be recommended for users of this workspace.\n    \"recommendations\": [\n        \"ms-python.python\",\n        \"lextudio.restructuredtext\",\n        \"foxundermoon.shell-format\",\n        \"troelsdamgaard.reflow-paragraph\",\n        \"ms-vscode.cpptools\",\n        \"mervin.markdown-formatter\",\n        \"stkb.rewrap\",\n        \"trond-snekvik.simple-rst\",\n        \"redhat.vscode-yaml\",\n        \"dawidd6.debian-vscode\",\n        \"streetsidesoftware.code-spell-checker\",\n        \"samuelcolvin.jinjahtml\",\n        \"tamasfe.even-better-toml\"\n    ],\n    // List of extensions recommended by VS Code that should not be recommended for users of this workspace.\n    \"unwantedRecommendations\": [\n\n    ]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    \"files.trimTrailingWhitespace\": true,\n    \"files.trimFinalNewlines\": true,\n    \"C_Cpp.dimInactiveRegions\": false,\n    \"files.exclude\": {\n        \"**/*.onefile-build\": true,\n        \"**/*.build\": true,\n        \"**/*.dist\": true,\n        \"**/*.exe\": true,\n        \"**/*.exe.away\": true,\n        \"**/*.bin\": true,\n        \"**/*.pyc\": true,\n        \"**/__pycache__\": true,\n        \"**/*.orig\": true,\n        \"**/*.tmp\": true,\n        \"tests/reflected/nuitka\": true,\n        \"tests/distutils/venv_*\": true,\n        \"build\": true,\n    },\n    \"files.associations\": {\n        \"*.tac\": \"python\",\n        \"*.inc\": \"restructuredtext\",\n        \"*.scons\": \"python\",\n        \"*.sco\": \"python\",\n        \"*.h\": \"c\",\n        \"*.c\": \"c\",\n        \"typeinfo\": \"c\",\n        \"cstring\": \"c\",\n        \"optional\": \"c\",\n        \"istream\": \"c\",\n        \"ostream\": \"c\",\n        \"system_error\": \"c\",\n        \"array\": \"c\",\n        \"functional\": \"c\",\n        \"tuple\": \"c\",\n        \"type_traits\": \"c\",\n        \"utility\": \"c\",\n        \"memory\": \"c\",\n        \"onefilesplashscreen.cpp\": \"cpp\",\n        \"compare\": \"c\",\n        \"string_view\": \"c\",\n        \"initializer_list\": \"c\",\n        \"ranges\": \"c\",\n        \"chrono\": \"c\",\n        \"ratio\": \"c\",\n        \"__hash_table\": \"c\",\n        \"__split_buffer\": \"c\",\n        \"bitset\": \"c\",\n        \"string\": \"c\",\n        \"unordered_map\": \"c\",\n        \"vector\": \"c\",\n        \"xtr1common\": \"c\",\n        \"__locale\": \"c\",\n        \"atomic\": \"c\",\n        \"__functional_base\": \"c\",\n        \"__functional_base_03\": \"c\",\n        \"__tuple\": \"c\",\n        \"algorithm\": \"c\",\n        \"limits\": \"c\",\n        \"random\": \"c\",\n        \"__bit_reference\": \"c\",\n        \"__node_handle\": \"c\",\n        \"deque\": \"c\",\n        \"__memory\": \"c\",\n        \"iterator\": \"c\",\n        \"locale\": \"c\"\n    },\n    \"python.analysis.autoSearchPaths\": false,\n    \"python.analysis.extraPaths\": [\n        \"nuitka/build/inline_copy/lib/scons-3.1.2\",\n        \"nuitka/build/inline_copy/clcache\"\n    ],\n    \"python.analysis.diagnosticSeverityOverrides\": {\n        \"reportMissingImports\": \"none\"\n    },\n    \"cSpell.words\": [\n        \"__abstractmethods__\",\n        \"__aenter__\",\n        \"__aexit__\",\n        \"__cplusplus\",\n        \"__newobj__\",\n        \"__warningregistry__\",\n        \"_NUITKA_WINMAIN_ENTRY_POINT\",\n        \"_Py_DEC_REFTOTAL\",\n        \"_Py_DecodeUTF8_surrogateescape\",\n        \"_PyDict_NewPresized\",\n        \"_wtoi\",\n        \"_XOPEN_SOURCE\",\n        \"abiflags\",\n        \"abspath\",\n        \"abstractmethod\",\n        \"abstractproperty\",\n        \"appdirs\",\n        \"asyncgen\",\n        \"backslashreplace\",\n        \"basenames\",\n        \"basestring\",\n        \"binaryfunc\",\n        \"bitor\",\n        \"Buildbot\",\n        \"bytearray\",\n        \"bytecode\",\n        \"bytecodes\",\n        \"CAPI\",\n        \"CBOOL\",\n        \"ccache\",\n        \"CFLOAT\",\n        \"cframe\",\n        \"clangcl\",\n        \"clcache\",\n        \"CLONG\",\n        \"clonglong\",\n        \"closefd\",\n        \"co_argcount\",\n        \"co_firstlineno\",\n        \"co_freevars\",\n        \"co_has_stardict\",\n        \"co_has_starlist\",\n        \"co_kwonlyargcount\",\n        \"co_nconsts\",\n        \"CO_NEWLOCALS\",\n        \"CO_NOFREE\",\n        \"co_posonlyargcount\",\n        \"CO_VARKEYWORDS\",\n        \"co_varnames\",\n        \"codesign\",\n        \"codespell\",\n        \"compactify\",\n        \"conda\",\n        \"condition-evals-to-constant\",\n        \"containerfile\",\n        \"CORO_CLOSED\",\n        \"CORO_CREATED\",\n        \"CORO_RUNNING\",\n        \"CORO_SUSPENDED\",\n        \"cpython\",\n        \"ctypes\",\n        \"curexc_traceback\",\n        \"curexc_type\",\n        \"curexc_value\",\n        \"Cython\",\n        \"deepcopy\",\n        \"Dejong\",\n        \"descrgetfunc\",\n        \"descrsetfunc\",\n        \"devel\",\n        \"devnull\",\n        \"diffable\",\n        \"distutils\",\n        \"Doxygen\",\n        \"dpkg\",\n        \"dtrace\",\n        \"dtruss\",\n        \"dunder\",\n        \"DYLD\",\n        \"dylib\",\n        \"elif\",\n        \"embeddable\",\n        \"EPEL\",\n        \"finalizer\",\n        \"FLUFL\",\n        \"fromlist\",\n        \"frozenset\",\n        \"fstrings\",\n        \"genericalias\",\n        \"genexpr\",\n        \"getpreferredencoding\",\n        \"gettotalrefcount\",\n        \"girepository\",\n        \"Gitter\",\n        \"hasattr\",\n        \"hashable\",\n        \"haskey\",\n        \"Hayen\",\n        \"HEDLEY\",\n        \"hotfixes\",\n        \"ibitand\",\n        \"ibitor\",\n        \"ibitxor\",\n        \"idna\",\n        \"imatmult\",\n        \"importlib\",\n        \"imult\",\n        \"incbin\",\n        \"inplace\",\n        \"iolddiv\",\n        \"ipython\",\n        \"isabs\",\n        \"isdir\",\n        \"isfile\",\n        \"isgen\",\n        \"isgenerator\",\n        \"isort\",\n        \"iterdir\",\n        \"iteritems\",\n        \"iterkeys\",\n        \"iternextfunc\",\n        \"itervalues\",\n        \"joinpath\",\n        \"jsonschema\",\n        \"Kivy\",\n        \"kwargs\",\n        \"kwds\",\n        \"lasti\",\n        \"ldconfig\",\n        \"libc\",\n        \"libpython\",\n        \"lintian\",\n        \"listdir\",\n        \"lldb\",\n        \"longlong\",\n        \"LPWSTR\",\n        \"lxml\",\n        \"manylinux\",\n        \"Matmult\",\n        \"mdef\",\n        \"metaclass\",\n        \"metaclasses\",\n        \"metapath\",\n        \"METH_NOARGS\",\n        \"METH_VARARGS\",\n        \"MSVC\",\n        \"msys\",\n        \"Mult\",\n        \"multidist\",\n        \"namedtuples\",\n        \"Namify\",\n        \"NBOOL\",\n        \"no_docstrings\",\n        \"noelf\",\n        \"nofollow\",\n        \"noinclude\",\n        \"nosite\",\n        \"nowarn\",\n        \"Nuitka\",\n        \"Numba\",\n        \"numberize\",\n        \"numpy\",\n        \"ob_sval\",\n        \"olddiv\",\n        \"onefile\",\n        \"optipng\",\n        \"organisation\",\n        \"Organisational\",\n        \"otool\",\n        \"pacman\",\n        \"patchelf\",\n        \"pathlib\",\n        \"pbuilder\",\n        \"Pickler\",\n        \"pipenv\",\n        \"pkglib\",\n        \"Podman\",\n        \"POSIX\",\n        \"Py_DECREF\",\n        \"Py_INCREF\",\n        \"PY_NOGIL\",\n        \"Py_REFCNT\",\n        \"Py_ssize_t\",\n        \"Py_TPFLAGS\",\n        \"Py_TPFLAGS_HAVE_WEAKREFS\",\n        \"Py_TPFLAGS_HEAPTYPE\",\n        \"Py_XDECREF\",\n        \"Py_XINCREF\",\n        \"PYCORE\",\n        \"PyCoro_Type\",\n        \"pyenv\",\n        \"PyErr_WriteUnraisable\",\n        \"pygsheets\",\n        \"pylint\",\n        \"pyproject\",\n        \"pyqt\",\n        \"pyside\",\n        \"PYSTATE\",\n        \"pystone\",\n        \"PYTHONHASHSEED\",\n        \"PYTHONHOME\",\n        \"PYTHONIOENCODING\",\n        \"PYTHONPATH\",\n        \"pythonw\",\n        \"Qualname\",\n        \"redist\",\n        \"reexecute\",\n        \"repr\",\n        \"reprfunc\",\n        \"richcmpfunc\",\n        \"roadmap\",\n        \"rpartition\",\n        \"RPATH\",\n        \"rpaths\",\n        \"RT_RCDATA\",\n        \"Scons\",\n        \"setattrofunc\",\n        \"Setuptools\",\n        \"sourcery\",\n        \"ssizeargfunc\",\n        \"startswith\",\n        \"staticmethod\",\n        \"stdlib\",\n        \"strchr\",\n        \"subclasscheck\",\n        \"sysexit\",\n        \"sysflag\",\n        \"Termux\",\n        \"ternaryfunc\",\n        \"Themida\",\n        \"Tkinter\",\n        \"tp_alloc\",\n        \"tp_basicsize\",\n        \"tp_dealloc\",\n        \"tp_descr_get\",\n        \"tp_descr_set\",\n        \"tp_dictoffset\",\n        \"tp_getattro\",\n        \"tp_getset\",\n        \"tp_itemsize\",\n        \"tp_iternext\",\n        \"tp_richcompare\",\n        \"tp_setattro\",\n        \"tp_vectorcall_offset\",\n        \"tp_weaklist\",\n        \"tp_weaklistoffset\",\n        \"traceback\",\n        \"tracebacks\",\n        \"traverseproc\",\n        \"truediv\",\n        \"tshape\",\n        \"tstate\",\n        \"ucrt\",\n        \"uncompiled\",\n        \"unoptimized\",\n        \"unorderable\",\n        \"unstripped\",\n        \"Valgrind\",\n        \"vectorcall\",\n        \"vectorcallfunc\",\n        \"viewitems\",\n        \"viewkeys\",\n        \"viewvalues\",\n        \"virtualenv\",\n        \"visitproc\",\n        \"vmprof\",\n        \"vshape\",\n        \"wargv\",\n        \"wcsicmp\",\n        \"winlibs\",\n        \"wmain\",\n        \"zstandard\",\n        \"zstd\"\n    ],\n    \"esbonio.server.enabled\": true,\n    \"esbonio.sphinx.confDir\": \"\",\n    \"cSpell.spellCheckOnlyWorkspaceFiles\": true,\n    \"cSpell.ignorePaths\": [\n        \".git\",\n        \".vscode\",\n        \"Mini*.py\",\n    ],\n    \"yaml.schemas\": {\n        \"misc/nuitka-package-config-schema.json\": [\n            \"*.nuitka-package.config.yml\",\n            \"*.nuitka-package.config.yaml\",\n        ]\n    },\n    \"yaml.maxItemsComputed\": 10000,\n    \"[python]\": {\n        \"editor.defaultFormatter\": \"ms-python.black-formatter\"\n    }\n}\n"
  },
  {
    "path": "CODE_OF_CONDUCT.rst",
    "content": "######################################\n Contributor Covenant Code of Conduct\n######################################\n\n************\n Our Pledge\n************\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our\nproject and our community a harassment-free experience for everyone,\nregardless of age, body size, disability, ethnicity, sex\ncharacteristics, gender identity and expression, level of experience,\neducation, socio-economic status, nationality, personal appearance,\nrace, religion, or sexual identity and orientation.\n\n***************\n Our Standards\n***************\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n-  Using welcoming and inclusive language\n\n-  Being respectful of differing viewpoints and experiences\n\n-  Gracefully accepting constructive criticism\n\n-  Focusing on what is best for the community\n\n-  Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n-  The use of sexualized language or imagery and unwelcome sexual\n   attention or advances\n\n-  Trolling, insulting/derogatory comments, and personal or political\n   attacks\n\n-  Public or private harassment\n\n-  Publishing other's private information, such as a physical or\n   electronic address, without explicit permission\n\n-  Other conduct which could reasonably be considered inappropriate in a\n   professional setting\n\n**********************\n Our Responsibilities\n**********************\n\nMaintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action\nin response to any instances of unacceptable behavior.\n\nMaintainers have the right and responsibility to remove, edit, or reject\ncomments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem\ninappropriate, threatening, offensive, or harmful.\n\n*******\n Scope\n*******\n\nThis Code of Conduct applies both within project spaces and in public\nspaces when an individual is representing the project or its community.\nExamples of representing a project or community include using an\nofficial project e-mail address, posting via an official social media\naccount, or acting as an appointed representative at an online or\noffline event. Representation of a project may be further defined and\nclarified by project maintainers.\n\n*************\n Enforcement\n*************\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may\nbe reported by contacting the Nuitka Organisation admins via email to\n\"kay@nuitka.net\". Use \"COD complaint:\" in your email subject. All\ncomplaints will be reviewed and investigated and will result in a\nresponse that is deemed necessary and appropriate to the circumstances.\nThe Code of Conduct Committee is obligated to maintain confidentiality\nwith regard to the reporter of an incident. Further details of specific\nenforcement policies may be posted separately.\n\n*************\n Attribution\n*************\n\nThis Code of Conduct is adapted from the Contributor Covenant, version\n1.4, available at\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html\nand the Linux kernel team changes as available under\nhttps://docs.kernel.org/_sources/process/code-of-conduct.rst.txt\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Nuitka\n\n## First things\n\nWelcome on board. Nuitka is an ambitious project. We are friendly. Join it now.\n\nThis document aims to give an overview of how to contribute to Nuitka. It tries\nto answer commonly asked questions regarding that, and to provide some insight on how to do it properly.\n\n- If you plan on submitting an issue\n\n  Please follow this [template](https://github.com/Nuitka/Nuitka/blob/develop/.github/ISSUE_TEMPLATE.md).\n\n- If you want to open a pull request\n\n  Make sure to read the information on further down this page but also have a\n  look at our [pull request\n  template](https://github.com/Nuitka/Nuitka/blob/develop/.github/PULL_REQUEST_TEMPLATE.md).\n\n## Getting Started\n\n- Read the [Nuitka User Manual](https://nuitka.net/doc/user-manual.html)\n- Read the [Nuitka Developer Manual](https://nuitka.net/doc/developer-manual.html)\n- Checkout the [git repo of Nuitka](https://github.com/Nuitka/Nuitka) additional docs and sources\n- Join the [Discord Server](https://discord.gg/nZ9hr9tUck)\n\n## Submitting a Pull Request\n\nPull requests are great. Here's a quick guide:\n\n1. Fork the repo on github.\n\n2. Install the `pre-commit` git hook\n\n   That is going to automatically format your code as described in the\n   Developer Manual. For that you have to execute this:\n\n   python misc/install-git-hooks.py\n\n3. Make a new branch and base your new branch on `develop`.\n\n4. Ideally add a test specific for your change to demonstrate it.\n\n   Due to Nuitka testing being basically to compile the whole world, it's ok to\n   not have one. But obviously if you fix something, it wasn't observed by that,\n   it would be good to provide a reproducer.\n\n5. Make the tests pass.\n\n6. Push to your fork and submit a pull request against `nuitka:develop`\n\n7. Wait for review\n\n   Suggestions for improvements or alternative ideas may happen. Keep in mind that\n   PR checklist items can be met after the pull request has been opened by adding\n   more commits to the branch. Indicate work in progress with a `WIP:` prefix in your PR title.\n\nAll the submitted pieces including potential data must be compatible with the\nApache License 2, which already says that once you are sending modified source,\ne.g. via pull request, you automatically license it as that too.\n\n## Submitting a Question\n\nIf you want to ask a question about a specific Nuitka aspect, please be kind\nand first of all..\n\n- Search for existing issues\n\n  Consider [GitHub issues tagged as \"question\"](https://github.com/Nuitka/Nuitka/issues?q=label%3Aquestion)\n\n- If not asked yet, ask it there.\n\n## Submitting Issues\n\nThe issue template contains the guidance on how to properly support issues. If you ignore it, likely the issue will be closed as invalid. We cannot really make guesses.\n"
  },
  {
    "path": "Changelog.rst",
    "content": "##################\n Nuitka Changelog\n##################\n\nIn this document, we track the per version changes and comments. This is\nnow maintained separately at https://nuitka.net/changelog/Changelog.html please\ncheck it out from there.\n"
  },
  {
    "path": "Developer_Manual.rst",
    "content": "#########################\n Nuitka Developer Manual\n#########################\n\nThe purpose of this Developer Manual is to present the current design of\nNuitka, the project rules, and the motivations for choices made. It is\nintended to be a guide to the source code, and to give explanations that\ndon't fit into the source code in comments form.\n\nIt should be used as a reference for the process of planning and\ndocumenting decisions we made. Therefore we are e.g. presenting here the\ntype inference plans before implementing them. And we update them as we\nproceed.\n\nIt grows out of discussions and presentations made at conferences as\nwell as private conversations or issue tracker.\n\n************\n Milestones\n************\n\n#. Feature parity with CPython, understand all the language construct\n   and behave absolutely compatible.\n\n   Feature parity has been reached for CPython 2.6 and 2.7. We do not\n   target any older CPython release. For CPython 3.3 up to 3.8 it also\n   has been reached. We do not target the older and practically unused\n   CPython 3.0 to 3.2 releases.\n\n   This milestone was reached. Dropping support for Python 2.6 and 3.3\n   is an option, should this prove to be any benefit. Currently it is\n   not, as it extends the test coverage only.\n\n#. Create the most efficient native code from this. This means to be\n   fast with the basic Python object handling.\n\n   This milestone was reached, although of course, micro optimizations\n   to this are happening all the time.\n\n#. Then do constant propagation, determine as many values and useful\n   constraints as possible at compile time and create more efficient\n   code.\n\n   This milestone is considered almost reached. We continue to discover\n   new things, but the infrastructure is there, and these are easy to\n   add.\n\n#. Type inference, detect and special case the handling of strings,\n   integers, lists in the program.\n\n   This milestone is considered in progress.\n\n#. Add interfacing to C code, so Nuitka can turn a ``ctypes`` binding\n   into an efficient binding as written with C.\n\n   This milestone is planned only.\n\n#. Add hints module with a useful Python implementation that the\n   compiler can use to learn about types from the programmer.\n\n   This milestone is planned only.\n\n*****************\n Version Numbers\n*****************\n\nFor Nuitka we use semantic versioning, initially with a leading zero\nstill, once we pass release ``1.9``, the scheme will indicate the ``10``\nthrough using ``2.0``.\n\n***************\n Current State\n***************\n\nNuitka top level works like this:\n\n-  ``nuitka.tree.Building`` outputs node tree\n\n-  ``nuitka.optimization`` enhances it as best as it can\n\n-  ``nuitka.finalization`` prepares the tree for code generation\n\n-  ``nuitka.code_generation.CodeGeneration`` orchestrates the creation\n   of code snippets\n\n-  ``nuitka.code_generation.*Codes`` knows how specific code kinds are\n   created\n\n-  ``nuitka.MainControl`` keeps it all together\n\nThis design is intended to last.\n\nRegarding types, the state is:\n\n-  Types are always ``PyObject *``, and only a few C types, e.g.\n   ``nuitka_bool`` and ``nuitka_void`` and more are coming. Even for\n   objects, often it's know that things are e.g. really a\n   ``PyTupleObject **``, but no C type is available for that yet.\n\n-  There are a some specific use of types beyond \"compile time\n   constant\", that are encoded in type and value shapes, which can be\n   used to predict some operations, conditions, etc. if they raise, and\n   result types they give.\n\n-  In code generation, the supported C types are used, and sometimes we\n   have specialized code generation, e.g. a binary operation that takes\n   an ``int`` and a ``float`` and produces a ``float`` value. There will\n   be fallbacks to less specific types.\n\nThe expansion with more C types is currently in progress, and there will\nalso be alternative C types, where e.g. ``PyObject *`` and ``C long``\nare in an enum that indicates which value is valid, and where special\ncode will be available that can avoid creating the ``PyObject **``\nunless the later overflows.\n\n***************************************************\n Setting up the Development Environment for Nuitka\n***************************************************\n\nCurrently there are very different kinds of files that we need support\nfor. This is best addressed with an IDE. We cover here how to setup the\nmost common one.\n\nVisual Studio Code\n==================\n\nDownload Visual Studio Code from here:\nhttps://code.visualstudio.com/download\n\nAt this time, this is the recommended IDE for Linux and Windows. This is\ngoing to cover the plugins to install. Configuration is part of the\n``.vscode`` in your Nuitka checkout. If you are not familiar with\nEclipse, this is Free Software IDE,designed to be universally extended,\nand it truly is. There are plugins available for nearly everything.\n\nThe extensions to be installed are part of the Visual Code\nrecommendations in ``.vscode/extensions.json`` and you will be prompted\nabout that and ought to install these.\n\nEclipse / PyCharm\n=================\n\nDon't use these anymore, we consider Visual Studio Code to be far\nsuperior for delivering a nice out of the box environment.\n\n*************************\n Commit and Code Hygiene\n*************************\n\nIn Nuitka we have tools to auto format code, you can execute them\nmanually, but it's probably best to execute them at commit time, to make\nsure when we share code, it's already well format, and to avoid noise\ndoing cleanups.\n\nThe kinds of changes also often cause unnecessary merge conflicts, while\nthe auto format is designed to format code also in a way that it avoids\nmerge conflicts in the normal case, e.g. by doing imports one item per\nline.\n\nIn order to set up hooks, you need to execute these commands:\n\n.. code:: bash\n\n   # Where python is the one you use with Nuitka, this then gets all\n   # development requirements, can be full PATH.\n   python -m pip install -r requirements-devel.txt\n   python ./misc/install-git-hooks.py\n\nThese commands will make sure that the ``autoformat-nuitka-source`` is\nrun on every staged file content at the time you do the commit. For C\nfiles, it may complain unavailability of ``clang-format``, follow it's\nadvice. You may call the above tool at all times, without arguments to\nformat call Nuitka source code.\n\nShould you encounter problems with applying the changes to the checked\nout file, you can always execute it with ``COMMIT_UNCHECKED=1``\nenvironment set.\n\n*********************\n Coding Rules Python\n*********************\n\nThese rules should generally be adhered when working on Nuitka code.\nIt's not library code and it's optimized for readability, and avoids all\nperformance optimization for itself.\n\nTool to format\n==============\n\nThere is a tool ``bin/autoformat-nuitka-source`` which is to apply\nautomatic formatting to code as much as possible. It uses ``black``\n(internally) for consistent code formatting. The imports are sorted with\n``isort`` for proper order.\n\nThe tool (mostly ``black`` and ``isort``) encodes all formatting rules,\nand makes the decisions for us. The idea being that we can focus on\nactual code and do not have to care as much about other things. It also\ndeals with Windows new lines, trailing space, etc. and even sorts PyLint\ndisable statements.\n\nIdentifiers\n===========\n\nClasses\n-------\n\nClasses are camel case with leading upper case. Functions and methods\nare with leading verb in lower case, but also camel case. Variables and\narguments are lower case with ``_`` as a separator.\n\n.. code:: python\n\n   class SomeClass:\n       def doSomething(some_parameter):\n           some_var = (\"foo\", \"bar\")\n\nBase classes that are abstract have their name end with ``Base``, so\nthat a meta class can use that convention, and readers immediately know,\nthat it will not be instantiated like that.\n\nFunctions\n---------\n\nFunction calls use keyword argument preferably. These are slower in\nCPython, but more readable:\n\n.. code:: python\n\n   getSequenceCreationCode(\n       sequence_kind=sequence_kind, element_identifiers=identifiers, context=context\n   )\n\nWhen the names don't add much value, sequential calls can be done:\n\n.. code:: python\n\n   context.setLoopContinueTarget(handler_start_target)\n\nHere, ``setLoopContinueTarget`` will be so well known that the reader is\nexpected to know the argument names and their meaning, but it would be\nstill better to add them. But in this instance, the variable name\nalready indicates that it is.\n\nModule/Package Names\n--------------------\n\nNormal modules are named in camel case with leading upper case, because\nof their role as singleton classes. The difference between a module and\na class is small enough and in the source code they are also used\nsimilarly.\n\nFor the packages, no real code is allowed in their ``__init__.py`` and\nthey must be lower case, like e.g. ``nuitka`` or ``codegen``. This is to\ndistinguish them from the modules.\n\nPackages shall only be used to group things. In\n``nuitka.code_generation`` the code generation packages are located,\nwhile the main interface is ``nuitka.code_generation.CodeGeneration``\nand may then use most of the entries as local imports.\n\nThere is no code in packages themselves. For programs, we use\n``__main__`` package to carry the actual code.\n\nNames of modules should be plurals if they contain classes. Example is\nthat a ``Nodes`` module that contains a ``Node`` class.\n\nContext Managers\n----------------\n\nNames for context manages start with ``with``\n\nIn order to easily recognize that something is to be used as a context\nmanager, we follow a pattern of naming them ``withSomething``, to make\nthat easily recognized.\n\n.. code:: python\n\n   with withEnvironmentPathAdded(os.path.join(sys.prefix, \"bin\")):\n       with withDirectoryChange(self.qt_datadir):\n           ...\n\nThis makes these easy to recognize even in their definition.\n\nPrefer list contractions over built-ins\n=======================================\n\nThis concerns ``map``, ``filter``, and ``apply``. Usage of these\nbuilt-ins is highly discouraged within Nuitka source code. Using them is\nconsidered worth a warning by \"PyLint\" e.g. \"Used built-in function\n'map'\". We should use list contractions instead, because they are more\nreadable.\n\nList contractions are a generalization for all of them. We love\nreadability and with Nuitka as a compiler, there won't be any\nperformance difference at all.\n\nThere are cases where a list contraction is faster because you can avoid\nto make a function call. And there may be cases, where map is faster, if\na function must be called. These calls can be very expensive in CPython,\nand if you introduce a function, just for ``map``, then it might be\nslower.\n\nBut of course, Nuitka is the project to free us from what is faster and\nto allow us to use what is more readable, so whatever is faster, we\ndon't care. We make all options equally fast and let people choose.\n\nFor Nuitka the choice is list contractions as these are more easily\nchanged and readable.\n\nLook at this code examples from Python:\n\n.. code:: python\n\n   class A:\n       def getX(self):\n           return 1\n\n       x = property(getX)\n\n\n   class B(A):\n       def getX(self):\n           return 2\n\n\n   A().x == 1  # True\n   B().x == 1  # True (!)\n\nThis pretty much is what makes properties bad. One would hope ``B().x``\nto be ``2``, but instead it's not changed. Because of the way properties\ntake the functions and not members, and because they then are not part\nof the class, they cannot be overloaded without re-declaring them.\n\nOverloading is then not at all obvious anymore. Now imagine having a\nsetter and only overloading the getter. How to update the property\neasily?\n\nSo, that's not likable about them. And then we are also for clarity in\nthese internal APIs too. Properties try and hide the fact that code\nneeds to run and may do things. So let's not use them.\n\nFor an external API you may exactly want to hide things, but internally\nthat has no use, and in Nuitka, every API is internal API. One exception\nmay be the ``hints`` module, which will gladly use such tricks for an\neasier write syntax.\n\n****************\n Coding Rules C\n****************\n\nFor the static C parts, e.g. compiled types, helper codes, the\n``clang-format`` from LLVM project is used, the tool\n``autoformat-nuitka-source`` does this for us.\n\nWe always have blocks for conditional statements to avoid typical\nmistakes made by adding a statement to a branch, forgetting to make it a\nblock.\n\n**********************\n The \"git flow\" model\n**********************\n\n-  The flow is used for releases and occasionally subsequent hot fixes.\n\n   A few feature branches were used so far. It allows for quick delivery\n   of fixes to both the stable and the development version, supported by\n   a git plug-in, that can be installed via \"apt-get install git-flow\".\n\n-  Stable (``main`` branch)\n\n   The stable version, is expected to pass all the tests at all times\n   and is fully supported. As soon as bugs are discovered, they are\n   fixed as hot fixes, and then merged to develop by the \"git flow\"\n   automatically.\n\n-  Development (``develop`` branch)\n\n   The future release, supposedly in almost ready for release state at\n   nearly all times, but this is less strict. It is not officially\n   supported, and may have problems and at times inconsistencies.\n   Normally this branch is supposed to not be rebased. For severe\n   problems it may be done though.\n\n-  Factory (default feature branch)\n\n   Code under construction. We publish commits there, that may not hold\n   up in testing, and before it enters develop branch. Factory may have\n   severe regressions frequently, and commits become **rebased all the\n   time**, so do not base your patches on it, please prefer the\n   ``develop`` branch for that, unless of course, it's about factory\n   code itself.\n\n-  Personal branches (jorj, orsiris, others as well)\n\n   We are currently not using this, but it's an option.\n\n-  Feature Branches\n\n   We are not currently using these. They could be used for long lived\n   changes that extend for multiple release cycles and are not ready\n   yet. Currently we perform all changes in steps that can be included\n   in releases or delay making those changes.\n\n******************************\n Nuitka \"git/github\" Workflow\n******************************\n\n-  Forking and cloning\n\n   You need to have git installed and GitHub account. Goto Nuitka\n   repository <https://github.com/Nuitka/Nuitka> and fork the\n   repository.\n\n   To clone it to your local machine execute the following your git\n   bash:\n\n   .. code:: bash\n\n      git clone https://github.com/your-user-name/Nuitka.git\n      cd Nuitka\n      git remote add upstream https://github.com/Nuitka/Nuitka.git\n\n-  Create a Branch\n\n   .. code:: bash\n\n      git checkout develop\n      git pull --rebase upstream\n      git checkout -b feature_branch\n\n   If you are having merge conflicts while doing the previous step, then\n   check out (DON'T FORGET TO SAVE YOUR CHANGES FIRST IF ANY):\n   <https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files>\n\n-  In case you have an existing branch rebase it to develop\n\n   .. code:: bash\n\n      git fetch upstream\n      git rebase upstream/develop\n\n   Fix the merge conflicts if any and continue or skip commit if it is\n   not your. Sometimes for important bug fixes, develop history gets\n   rewritten. In that case, old and new commits will conflict during\n   your rebase, and skipping is the best way to go.\n\n   .. code:: bash\n\n      git rebase --continue\n      # not your commit:\n      git rebase --skip\n\n   If anything goes wrong while rebasing:\n\n   .. code:: bash\n\n      git rebase --abort\n\n-  Making changes\n\n   .. code:: bash\n\n      git commit -a -m \"Commit Message\"\n      git push -u origin # once, later always:\n      git push\n\n**********************************\n API Documentation and Guidelines\n**********************************\n\nThere is API documentation generated with ``doxygen``, available at\n`this location <https://nuitka.net/apidoc>`__ .\n\nTo ensure meaningful ``doxygen`` output, the following guidelines must\nbe observed when creating or updating Python source:\n\nUse of Standard Python ``__doc__`` Strings\n==========================================\n\nEvery class and every method should be documented via the standard\nPython delimiters (``\"\"\" ... \"\"\"``) in the usual way.\n\nSpecial ``doxygen`` Anatomy of ``__doc__``\n==========================================\n\n.. note::\n\n   We are replacing Doxygen with sphinx, this is all obsolete\n\n-  Immediately after the leading ``\"\"\"``, and after 1 space on the same\n   line, enter a brief description or title of the class or method. This\n   must be 1 line and be followed by at least 1 empty line.\n\n-  Depending on the item, choose from the following \"sections\" to\n   describe what the item is and does.\n\n   Each section name is coded on its own line, aligned with the leading\n   ``\"\"\"`` and followed by a colon \":\". Anything following the section,\n   must start on a new line and be indented by 4 spaces relative to the\n   section. Except for the first section (``Notes:``) after the title,\n   sections need not be preceded by empty lines -- but it is good\n   practice to still do that.\n\n   -  ``Notes:`` detailed description of the item, any length.\n\n      May contain line breaks with each new line starting aligned with\n      previous one. The text will automatically be joined across line\n      breaks and be reformatted in the browser.\n\n      If you describe details for a class, you can do so **without**\n      using this section header and all formatting will still work fine.\n      If you however omit the ``Notes:`` for methods, then the text will\n      be interpreted **as code**, be shown in an ugly monospaced font,\n      and no automatic line breaks will occur in the browser.\n\n   -  ``Args:`` positional arguments.\n\n      Each argument then follows, starting on a new line and indented by\n      4 spaces. The argument name must be followed by a colon ``:`` or\n      double hash ``--``, followed by a description of arbitrary length.\n\n      The description can be separated by line breaks.\n\n   -  ``Kwargs:`` keyword arguments. Same rules as for args.\n\n   -  ``Returns:`` description of what will be returned if applicable\n      (any length).\n\n   -  ``Yields:`` synonymous for ``Returns:``.\n\n   -  ``Raises:`` name any exceptions that may be raised.\n\n   -  ``Examples:`` specify any example code.\n\n.. code:: python\n\n   def foo(p1, p2, kw1=None, kw2=None):\n       \"\"\"This is an example method.\n\n       Notes:\n           It does one or the other indispensable things based on some parameters\n           and proudly returns a dictionary.\n\n       Args:\n           p1: parameter one\n           p2: parameter two\n\n       Kwargs:\n           kw1: keyword one\n           kw2: keyword two\n\n       Returns:\n           A dictionary calculated from the input.\n\n       Raises:\n           ValueError, IndexError\n\n       Examples:\n           >>> foo(1, 2, kw1=3, kw2=4)\n           {'a': 4, 'b': 6}\n       \"\"\"\n\n*********************\n Checking the Source\n*********************\n\nThe static checking for errors is currently done with ``PyLint``. In the\nfuture, Nuitka itself will gain the ability to present its findings in a\nsimilar way, but this is not a priority, and we are not there yet.\n\nSo, we currently use ``PyLint`` with options defined in a script.\n\n.. code:: bash\n\n   ./bin/check-nuitka-with-pylint\n\nThe above command is expected to give no warnings. It is also run on our\nCI and we will not merge branches that do not pass.\n\n*******************\n Running the Tests\n*******************\n\nThis section describes how to run Nuitka tests.\n\nRunning all Tests\n=================\n\nThe top level access to the tests is as simple as this:\n\n.. code:: bash\n\n   ./tests/run-tests\n\nFor fine grained control, it has the following options:\n\n.. code::\n\n   --skip-basic-tests    The basic tests, execute these to check if Nuitka is\n                         healthy. Default is True.\n   --skip-syntax-tests   The syntax tests, execute these to check if Nuitka\n                         handles Syntax errors fine. Default is True.\n   --skip-program-tests  The programs tests, execute these to check if Nuitka\n                         handles programs, e.g. import recursions, etc. fine.\n                         Default is True.\n   --skip-package-tests  The packages tests, execute these to check if Nuitka\n                         handles packages, e.g. import recursions, etc. fine.\n                         Default is True.\n   --skip-optimizations-tests\n                         The optimization tests, execute these to check if\n                         Nuitka does optimize certain constructs fully away.\n                         Default is True.\n   --skip-standalone-tests\n                         The standalone tests, execute these to check if Nuitka\n                         standalone mode, e.g. not referring to outside,\n                         important 3rd library packages like PyQt fine. Default\n                         is True.\n   --skip-reflection-test\n                         The reflection test compiles Nuitka with Nuitka, and\n                         then Nuitka with the compile Nuitka and compares the\n                         outputs. Default is True.\n   --skip-cpython26-tests\n                         The standard CPython2.6 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.7 this\n                         covers exception behavior quite well. Default is True.\n   --skip-cpython27-tests\n                         The standard CPython2.7 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.6 these\n                         are not run. Default is True.\n   --skip-cpython32-tests\n                         The standard CPython3.2 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.6 these\n                         are not run. Default is True.\n   --skip-cpython33-tests\n                         The standard CPython3.3 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython34-tests\n                         The standard CPython3.4 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython35-tests\n                         The standard CPython3.5 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython36-tests\n                         The standard CPython3.6 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython37-tests\n                         The standard CPython3.7 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython38-tests\n                         The standard CPython3.8 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython39-tests\n                         The standard CPython3.9 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython310-tests\n                         The standard CPython3.10 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --skip-cpython311-tests\n                         The standard CPython3.11 test suite. Execute this for\n                         all corner cases to be covered. With Python 2.x these\n                         are not run. Default is True.\n   --no-python2.6        Do not use Python 2.6 even if available on the system.\n                         Default is False.\n   --no-python2.7        Do not use Python 2.7 even if available on the system.\n                         Default is False.\n   --no-python3.3        Do not use Python 3.3 even if available on the system.\n                         Default is False.\n   --no-python3.4        Do not use Python 3.4 even if available on the system.\n                         Default is False.\n   --no-python3.5        Do not use Python 3.5 even if available on the system.\n                         Default is False.\n   --no-python3.6        Do not use Python 3.6 even if available on the system.\n                         Default is False.\n   --no-python3.7        Do not use Python 3.7 even if available on the system.\n                         Default is False.\n   --no-python3.8        Do not use Python 3.8 even if available on the system.\n                         Default is False.\n   --no-python3.9        Do not use Python 3.9 even if available on the system.\n                         Default is False.\n   --no-python3.10       Do not use Python 3.10 even if available on the system.\n                         Default is False.\n   --no-python3.11       Do not use Python 3.11 even if available on the system.\n                         Default is False.\n   --coverage            Make a coverage analysis, that does not really check.\n                         Default is False.\n\nYou will only run the CPython test suites, if you have the submodules of\nthe Nuitka git repository checked out. Otherwise, these will be skipped\nwith a warning that they are not available.\n\nThe policy is generally, that ``./test/run-tests`` running and passing\nall the tests on Linux and Windows shall be considered sufficient for a\nrelease, but of course, depending on changes going on, that might have\nto be expanded.\n\nBasic Tests\n===========\n\nYou can run the \"basic\" tests like this:\n\n.. code:: bash\n\n   ./tests/basics/run_all.py search\n\nThese tests normally give sufficient coverage to assume that a change is\ncorrect, if these \"basic\" tests pass. The most important constructs and\nbuilt-ins are exercised.\n\nTo control the Python version used for testing, you can set the\n``PYTHON`` environment variable to e.g. ``python3.5`` (can also be full\npath), or simply execute the ``run_all.py`` script directly with the\nintended version, as it is portable across all supported Python\nversions, and defaults testing with the Python version is run with.\n\nSyntax Tests\n============\n\nThen there are \"syntax\" tests, i.e. language constructs that need to\ngive a syntax error.\n\nIt sometimes so happens that Nuitka must do this itself, because the\n``ast.parse`` doesn't see the problem and raises no ``SyntaxError`` of\nits own. These cases are then covered by tests to make sure they work as\nexpected.\n\nUsing the ``global`` statement on a function argument is an example of\nthis. These tests make sure that the errors of Nuitka and CPython are\ntotally the same for this:\n\n.. code:: bash\n\n   ./tests/syntax/run_all.py search\n\nProgram Tests\n=============\n\nThen there are small \"programs\" tests, that e.g. exercise many kinds of\nimport tricks and are designed to reveal problems with inter-module\nbehavior. These can be run like this:\n\n.. code:: bash\n\n   ./tests/programs/run_all.py search\n\nGenerated Tests\n===============\n\nThere are tests, which are generated from Jinja2 templates. They aim at\ne.g. combining at types with operations, in-place or not, or large\nconstants. These can be run like this:\n\n.. code:: bash\n\n   ./tests/generated/run_all.py search\n\nCompile Nuitka with Nuitka\n==========================\n\nAnd there is the \"compile itself\" or \"reflected\" test. This test makes\nNuitka compile itself and compare the resulting C++ when running\ncompiled to non-compiled, which helps to find in-determinism.\n\nThe test compiles every module of Nuitka into an extension module and\nall of Nuitka into a single binary.\n\nThat test case also gives good coverage of the ``import`` mechanisms,\nbecause Nuitka uses a lot of packages and imports between them.\n\n.. code:: bash\n\n   ./tests/reflected/compile_itself.py\n\n*********************\n Internal/Plugin API\n*********************\n\nThe documentation from the source code for both the Python and the C\nparts are published as `Nuitka API <https://nuitka.net/apidoc>`__ and\narguably in a relatively bad shape as we started generating those with\nDoxygen only relatively late.\n\n.. code:: bash\n\n   doxygen ./doc/Doxyfile\n   xdg-open html\n\nImprovements have already been implemented for plugins: The plugin base\nclass defined in ``PluginBase.py`` (which is used as a template for all\nplugins) is fully documented in Doxygen now. The same is true for the\nrecently added standard plugins ``NumpyPlugin.py`` and\n``TkinterPlugin.py``. These will be uploaded very soon.\n\nGoing forward, this will also happen for the remaining standard plugins.\n\nPlease find `here\n<https://github.com/Nuitka/Nuitka/blob/develop/UserPlugin-Creation.rst>`__\na detailed description of how to write your own plugin.\n\nTo learn about plugin option specification consult `this document\n<https://github.com/Nuitka/Nuitka/blob/develop/Using-Plugin-Options.rst>`__.\n\n*********************************\n Working with the CPython suites\n*********************************\n\nResetting CPython suites\n========================\n\nThe CPython test suites are different branches of the same submodule.\nWhen you update your git checkout, they will frequently become detached.\nIn this case, simply execute this command:\n\n.. code:: bash\n\n   git submodule foreach 'git fetch && git checkout $(basename $(pwd)) && \\\n   git reset --hard origin/$(basename $(pwd))'\n\nAdded new CPython suites\n========================\n\nWhen adding a test suite, for a new version, proceed like this, of\ncourse while adapting of course the names. These are the commands used\nfor adding CPython311 based on the CPython310 branch.\n\n.. code:: bash\n\n   # Switch to a new branch.\n   git checkout CPython310\n   git branch CPython311\n   git checkout CPython311\n\n   # Delete all but root commit\n   git reset --hard `git log --root --oneline --reverse | head -1 | cut -d' ' -f1`\n\n   # Switch test data to upstream ones.\n   rm -rf test\n   cp -r ~/repos/Nuitka-references/final/Python-3.11.0/Lib/test test\n   git add test\n\n   # Update commit message to mention proper Python version.\n   git commit --amend -m \"Initial commit of Python tests as in 3.11.0\"\n\n   # Push to github, setting upstream for branch.\n   git push -u\n\n   # Cherry pick the removal commits from previous branches.\n   git log origin/CPython310 --reverse --oneline | grep ' Removed' | cut -d' ' -f1 | xargs git cherry-pick\n   # When being prompted for merge conflicts with the deleted files:\n   git status | sed -n 's/deleted by them://p' | xargs git rm --ignore-unmatch x ; git cherry-pick --continue\n\n   # Push to github, this is useful.\n   git push\n\n   # Cherry pick the first commit of 'run_all.py', the copy it from the last state, and amend the commits.\n   git log --reverse origin/CPython310 --oneline -- run_all.py | head -1 | cut -d' ' -f1 | xargs git cherry-pick\n   git checkout origin/CPython310 -- run_all.py\n   chmod +x run_all.py\n   sed -i -e 's#python3.10#python3.11#' run_all.py\n   git commit --amend --no-edit run_all.py\n\n   # Same for 'update_doctest_generated.py'\n   git log --reverse origin/CPython310 --oneline -- update_doctest_generated.py | head -1 | cut -d' ' -f1 | xargs git cherry-pick\n   git checkout origin/CPython310 -- update_doctest_generated.py\n   chmod +x update_doctest_generated.py\n   sed -i -e 's#python3.10#python3.11#' update_doctest_generated.py\n   git commit --amend --no-edit update_doctest_generated.py\n\n   # Same for .gitignore\n   git log --reverse origin/CPython310 --oneline -- .gitignore | head -1 | cut -d' ' -f1 | xargs git cherry-pick\n   git checkout origin/CPython310 -- .gitignore\n   git commit --amend --no-edit .gitignore\n\n   # Now cherry-pick all commits of test support, these disable network, audio, GUI, random filenames and more\n   # and are crucial for deterministic outputs and non-reliance on outside stuff.\n   git log --reverse origin/CPython310 --oneline -- test/support/__init__.py | tail -n +2 | cut -d' ' -f1 | xargs git cherry-pick\n\n   git push\n\n*********************\n Design Descriptions\n*********************\n\nThese should be a lot more and contain graphics from presentations\ngiven. It will be filled in, but not now.\n\nNuitka Logo\n===========\n\nThe logo was submitted by \"dr. Equivalent\". It's source is contained in\n``doc/Logo`` where 3 variants of the logo in SVG are placed.\n\n-  Symbol only (symbol)\n\n.. code:: rest\n\n   .. image:: doc/images/Nuitka-Logo-Symbol.png\n      :alt: Nuitka Logo\n\n-  Text next to symbol (horizontal)\n\n.. code:: rest\n\n   .. image:: doc/images/Nuitka-Logo-Horizontal.png\n      :alt: Nuitka Logo\n\n-  Text beneath symbol (vertical)\n\n.. code:: rest\n\n   .. image:: doc/images/Nuitka-Logo-Vertical.png\n      :alt: Nuitka Logo\n\nFrom these logos, PNG images, and \"favicons\", and are derived.\n\nThe exact ImageMagick commands are in\n``nuitka/tools/release/Documentation``, but are not executed each time,\nthe commands are also replicated here:\n\n.. code:: bash\n\n   convert -background none doc/Logo/Nuitka-Logo-Symbol.svg doc/images/Nuitka-Logo-Symbol.png\n   convert -background none doc/Logo/Nuitka-Logo-Vertical.svg doc/images/Nuitka-Logo-Vertical.png\n   convert -background none doc/Logo/Nuitka-Logo-Horizontal.svg doc/images/Nuitka-Logo-Horizontal.png\n\nChoice of the Target Language\n=============================\n\n-  Choosing the target language was important decision. factors were:\n\n   -  The portability of Nuitka is decided here\n   -  How difficult is it to generate the code?\n   -  Does the Python C-API have bindings?\n   -  Is that language known?\n   -  Does the language aid to find bugs?\n\nThe *decision for C11* is ultimately one for portability, general\nknowledge of the language and for control over created code, e.g. being\nable to edit and try that quickly.\n\nThe current status is to use pure C11. All code compiles as C11, and\nalso in terms of workaround to missing compiler support as C++03. This\nis mostly needed, because MSVC does not support C. Naturally we are not\nusing any C++ features, just the allowances of C++ features that made it\ninto C11, which is e.g. allowing late definitions of variables.\n\nUse of Scons internally\n=======================\n\nNuitka does not involve Scons in its user interface at all; Scons is\npurely used internally. Nuitka itself, being pure Python, will run\nwithout any build process just fine.\n\nNuitka simply prepares ``<program>.build`` folders with lots of files\nand tasks scons to execute the final build, after which Nuitka again\nwill take control and do more work as necessary.\n\n.. note::\n\n   When we speak of \"standalone\" mode, this is handled outside of Scons,\n   and after it, creating the \".dist\" folder. This is done in\n   ``nuitka.MainControl`` module.\n\nFor interfacing to Scons, there is the module\n``nuitka.build.SconsInterface`` that will support calling ``scons`` -\npotentially from one of two inline copies (one for before / one for\nPython 3.5 or later). These are mainly used on Windows or when using\nsource releases - and passing arguments to it. These arguments are\npassed as ``key=value``, and decoded in the scons file of Nuitka.\n\nThe scons file is named ``SingleExe.scons`` for lack of better name.\nIt's really wrong now, but we have yet to find a better name. It once\nexpressed the intention to be used to create executables, but the same\nworks for modules too, as in terms of building, and to Scons, things\nreally are the same.\n\nThe scons file supports operation in multiple modes for many things, and\nmodules is just one of them. It runs outside of Nuitka process scope,\neven with a different Python version potentially, so all the information\nmust be passed on the command line.\n\nWhat follows is the (lengthy) list of arguments that the scons file\nprocesses:\n\n-  ``source_dir``\n\n   Where is the generated C source code. Scons will just compile\n   everything it finds there. No list of files is passed, but instead\n   this directory is being scanned.\n\n-  ``nuitka_src``\n\n   Where do the include files and static C parts of Nuitka live. These\n   provide e.g. the implementation of compiled function, generators, and\n   other helper codes, this will point to where ``nuitka.build`` package\n   lives normally.\n\n-  ``module_mode``\n\n   Build a module instead of a program.\n\n-  ``result_base``\n\n   This is not a full name, merely the basename for the result to be\n   produced, but with path included, and the suffix comes from module or\n   executable mode.\n\n-  ``debug_mode``\n\n   Enable debug mode, which is a mode, where Nuitka tries to help\n   identify errors in itself, and will generate less optimal code. This\n   also asks for warnings, and makes the build fail if there are any.\n   Scons will pass different compiler options in this case.\n\n-  ``python_debug``\n\n   Compile and link against Python debug mode, which does assertions and\n   extra checks, to identify errors, mostly related to reference\n   counting. May make the build fail, if no debug build library of\n   CPython is available. On Windows it is possible to install it for\n   CPython3.5 or higher.\n\n-  ``full_compat_mode``\n\n   Full compatibility, even where it's stupid, i.e. do not provide\n   information, even if available, in order to assert maximum\n   compatibility. Intended to control the level of compatibility to\n   absurd.\n\n-  ``experimental_mode``\n\n   Do things that are not yet accepted to be safe.\n\n-  ``lto_mode``\n\n   Make use of link time optimization of gcc compiler if available and\n   known good with the compiler in question. So far, this was not found\n   to make major differences.\n\n-  ``disable_console``\n\n   Windows subsystem mode: Disable console for windows builds.\n\n-  ``unstripped_mode``\n\n   Unstripped mode: Do not remove debug symbols.\n\n-  ``clang_mode``\n\n   Clang compiler mode, default on macOS X and FreeBSD, optional on\n   Linux.\n\n-  ``mingw_mode``\n\n   MinGW compiler mode, optional and useful on Windows only.\n\n-  ``standalone_mode``\n\n   Building a standalone distribution for the binary.\n\n-  ``show_scons``\n\n   Show scons mode, output information about Scons operation. This will\n   e.g. also output the actual compiler used, output from compilation\n   process, and generally debug information relating to be build\n   process.\n\n-  ``python_prefix``\n\n   Home of Python to be compiled against, used to locate headers and\n   libraries.\n\n-  ``target_arch``\n\n   Target architecture to build. Only meaningful on Windows.\n\n-  ``python_version``\n\n   The major version of Python built against.\n\n-  ``abiflags``\n\n   The flags needed for the Python ABI chosen. Might be necessary to\n   find the folders for Python installations on some systems.\n\n-  ``icon_path``\n\n   The icon to use for Windows programs if given.\n\nLocating Modules and Packages\n=============================\n\nThe search for modules used is driven by ``nuitka.importing.Importing``\nmodule.\n\n-  Quoting the ``nuitka.importing.Importing`` documentation:\n\n   Locating modules and package source on disk.\n\n   The actual import of a module would already execute code that changes\n   things. Imagine a module that does ``os.system()``, it would be done\n   during compilation. People often connect to databases, and these kind\n   of things, at import time.\n\n   Therefore CPython exhibits the interfaces in an ``imp`` module in\n   standard library, which one can use those to know ahead of time, what\n   file import would load. For us unfortunately there is nothing in\n   CPython that is easily accessible and gives us this functionality for\n   packages and search paths exactly like CPython does, so we implement\n   here a multi step search process that is compatible.\n\n   This approach is much safer of course and there is no loss. To\n   determine if it's from the standard library, one can abuse the\n   attribute ``__file__`` of the ``os`` module like it's done in\n   ``isStandardLibraryPath`` of this module.\n\n   End quoting the ``nuitka.importing.Importing`` documentation.\n\n-  Role\n\n   This module serves the recursion into modules and analysis if a\n   module is a known one. It will give warnings for modules attempted to\n   be located, but not found. These warnings are controlled by a while\n   list inside the module.\n\nThe decision making and caching are located in the ``nuitka.tree``\npackage, in modules ``nuitka.tree.Recursion`` and\n``nuitka.tree.ImportCache``. Each module is only considered once (then\ncached), and we need to obey lots of user choices, e.g. to compile a\nstandard library or not.\n\nHooking for module ``import`` process\n=====================================\n\nCurrently, in generated code, for every ``import`` a normal\n``__import__()`` built-in call is executed. The\n``nuitka/build/static_src/MetaPathBasedLoader.c`` file provides the\nimplementation of a ``sys.meta_path`` hook.\n\nThis meta path based importer allows us to have the Nuitka provided\nmodule imported even when imported by non-compiled code.\n\n.. note::\n\n   Of course, it would make sense to compile time detect which module it\n   is that is being imported and then to make it directly. At this time,\n   we don't have this inter-module optimization yet, mid-term it should\n   become easy to add.\n\nSupporting ``__class__`` of Python3\n===================================\n\nIn Python3 the handling of ``__class__`` and ``super`` is different from\nPython2. It used to be a normal variable, and now the following things\nhave changed.\n\n-  The use of the ``super`` variable name triggers the addition of a\n   closure variable ``__class__``, as can be witnessed by the following\n   code:\n\n   .. code:: python\n\n      class X:\n          def f1(self):\n              print(locals())\n\n          def f2(self):\n              print(locals())\n              super  # Just using the name, not even calling it.\n\n\n      x = X()\n      x.f1()\n      x.f2()\n\n   Output is:\n\n   .. code::\n\n      {'self': <__main__.X object at 0x7f1773762390>''} {'self':\n      <__main__.X object at 0x7f1773762390>, '__class__': <class\n      '__main__.X'>}\n\n-  This value of ``__class__`` is also available in the child functions.\n\n-  The parser marks up code objects usage of \"super\". It doesn't have to\n   be a call, it can also be a local variable. If the ``super`` built-in\n   is assigned to another name and that is used without arguments, it\n   won't work unless ``__class__`` is taken as a closure variable.\n\n-  As can be seen in the CPython3 code, the closure value is added after\n   the class creation is performed.\n\n-  It appears, that only functions locally defined to the class are\n   affected and take the closure.\n\nThis left Nuitka with the strange problem, of how to emulate that.\n\nThe solution is this:\n\n-  Under Python3, usage of ``__class__`` as a reference in a child\n   function body is mandatory. It remains that way until all variable\n   names have been resolved.\n\n-  When recognizing calls to ``super`` without arguments, make the arguments\n      into variable reference to ``__class__`` and potentially ``self``\n      (actually first argument name).\n\n-  After all variables have been known, and no suspicious unresolved\n   calls to anything named ``super`` are down, then unused references\n   are optimized away by the normal unused closure variable.\n\n-  Class dictionary definitions are added.\n\n   These are special direct function calls, ready to propagate also\n   \"bases\" and \"metaclass\" values, which need to be calculated outside.\n\n   The function bodies used for classes will automatically store\n   ``__class__`` as a shared local variable, if anything uses it. And if\n   it's not assigned by user code, it doesn't show up in the \"locals()\"\n   used for dictionary creation.\n\n   Existing ``__class__`` local variable values are in fact provided as\n   closure, and overridden with the built class , but they should be\n   used for the closure giving, before the class is finished.\n\n   So ``__class__`` will be local variable of the class body, until the\n   class is built, then it will be the ``__class__`` itself.\n\nFrame Stack\n===========\n\nIn Python, every function, class, and module has a frame. It is created\nwhen the scope is entered, and there is a stack of these at run time,\nwhich becomes visible in tracebacks in case of exceptions.\n\nThe choice of Nuitka is to make this an explicit element of the node\ntree, that are as such subject to optimization. In cases, where they are\nnot needed, they may be removed.\n\nConsider the following code.\n\n.. code:: python\n\n   def f():\n       if someNotRaisingCall():\n           return somePotentiallyRaisingCall()\n       else:\n           return None\n\nIn this example, the frame is not needed for all the code, because the\ncondition checked wouldn't possibly raise at all. The idea is the make\nthe frame guard explicit and then to reduce its scope whenever possible.\n\nSo we start out with code like this one:\n\n.. code:: python\n\n   def f():\n       with frame_guard(\"f\"):\n           if someNotRaisingCall():\n               return somePotentiallyRaisingCall()\n           else:\n               return None\n\nThis is to be optimized into:\n\n.. code:: python\n\n   def f():\n       if someNotRaisingCall():\n           with frame_guard(\"f\"):\n               return somePotentiallyRaisingCall()\n       else:\n           return None\n\nNotice how the frame guard taking is limited and may be avoided, or in\nbest cases, it might be removed completely. Also this will play a role\nwhen in-lining function. The frame stack entry will then be\nautomatically preserved without extra care.\n\n.. note::\n\n   In the actual code, ``nuitka.nodes.FrameNodes.StatementsFrame`` is\n   represents this as a set of statements to be guarded by a frame\n   presence.\n\nParameter Parsing\n=================\n\nThe parsing of parameters is very convoluted in Python, and doing it in\na compatible way is not that easy. This is a description of the required\nprocess, for an easier overview.\n\nInput\n-----\n\nThe input is an argument ``tuple`` (the type is fixed), which contains\nthe positional arguments, and potentially an argument ``dict`` (type is\nfixed as well, but could also be ``NULL``, indicating that there are no\nkeyword arguments.\n\nKeyword dictionary\n------------------\n\nThe keyword argument dictionary is checked first. Anything in there,\nthat cannot be associated, either raise an error, or is added to a\npotentially given star dict argument. So there are two major cases.\n\n-  No star dict argument: Iterate over dictionary, and assign or raise\n   errors.\n\n   This check covers extra arguments given.\n\n-  With star dict argument: Iterate over dictionary, and assign or raise\n   errors.\n\n   Interesting case for optimization are no positional arguments, then\n   no check is needed, and the keyword argument dictionary could be used\n   as the star argument. Should it change, a copy is needed though.\n\nWhat's noteworthy here, is that in comparison to the keywords, we can\nhope that they are the same value as we use. The interning of strings\nincreases chances for non-compiled code to do that, esp. for short\nnames.\n\nWe then can do a simple ``is`` comparison and only fall back to real\nstring ``==`` comparisons, after all of these failed. That means more\ncode, but also a lot faster code in the positive case.\n\nArgument tuple\n--------------\n\nAfter this completed, the argument tuple is up for processing. The first\nthing it needs to do is to check if it's too many of them, and then to\ncomplain.\n\nFor arguments in Python2, there is the possibility of them being nested,\nin which case they cannot be provided in the keyword dictionary, and\nmerely should get picked from the argument tuple.\n\nOtherwise, the length of the argument tuple should be checked against\nits position and if possible, values should be taken from there. If it's\nalready set (from the keyword dictionary), raise an error instead.\n\nSSA form for Nuitka\n===================\n\nThe SSA form is critical to how optimization works. The so called trace\ncollections builds up traces. These are facts about how this works:\n\n-  Assignments draw from a counter unique for the variable, which\n   becomes the variable version. This happens during tree building\n   phase.\n\n-  References are associated with the version of the variable active.\n\n   This can be a merge of branches. Trace collection does do that and\n   provides nodes with the currently active trace for a variable.\n\nThe data structures used for trace collection need to be relatively\ncompact as the trace information can become easily much more data than\nthe program itself.\n\nEvery trace collection has these:\n\n-  variable_actives\n\n   Dictionary, where per \"variable\" the currently used version is. Used\n   to track situations changes in branches. This is the main input for\n   merge process.\n\n-  variable_traces\n\n   Dictionary, where \"variable\" and \"version\" form the key. The values\n   are objects with or without an assignment, and a list of usages,\n   which starts out empty.\n\n   These objects have usages appended to them. In \"onVariableSet\", a new\n   version is allocated, which gives a new object for the dictionary,\n   with an empty usages list, because each write starts a new version.\n   In \"onVariableUsage\" the version is detected from the current\n   version. It may be not set yet, which means, it's a read of an\n   undefined value (local variable, not a parameter name), or unknown in\n   case of global variable.\n\n   These objects may be told that their value has escaped. This should\n   influence the value friend they attached to the initial assignment.\n   Each usage may have a current value friend state that is different.\n\nWhen merging branches of conditional statements, the merge shall apply\nas follows:\n\n-  Branches have their own collection\n\n   Thee have potentially deviating sets of ``variable_actives``. These\n   are children of an outer collections.\n\n-  Case a) One branch only.\n\n   For that branch a collection is performed. As usual new assignments\n   generate a new version making it \"active\", references then related to\n   these \"active\" versions.\n\n   Then, when the branch is merged, for all \"active\" variables, it is\n   considered, if that is a change related to before the branch. If it's\n   not the same, a merge trace with the branch condition is created with\n   the one active in the collection before that statement.\n\n-  Case b) Two branches.\n\n   When there are two branches, they both as are treated as above,\n   except for the merge.\n\n   When merging, a difference in active variables between the two\n   branches creates the merge trace.\n\n.. note::\n\n   For conditional expressions, there are always only two branches. Even\n   if you think you have more than one branch, you do not. It's always\n   nested branches, already when it comes out of the ``ast`` parser.\n\nTrace structure, there are different kinds of traces.\n\n-  Initial write of the version\n\n   There may be an initial write for each version. It can only occur at\n   the start of the scope, but not later, and there is only one. This\n   might be known to be \"initialized\" (parameter variables of functions\n   are like that) or \"uninitialized\", or \"unknown\".\n\n-  Merge of other one or two other versions\n\n   This combines two or more previous versions. In cases of loop exits\n   or entries, there are multiple branches to combine potentially. These\n   branches can have vastly different properties.\n\n-  Becoming unknown.\n\n   When control flow escapes, e.g. for a module variable, any write can\n   occur to it, and it's value cannot be trusted to be unchanged. These\n   are then traced as unknown.\n\nAll traces have a base class ``ValueTraceBase`` which provides the\ninterface to query facts about the state of a variable in that trace.\nIt's e.g. of some interest, if a variable must have a value or must not.\nThis allows to e.g. omit checks, know what exceptions might raise.\n\nLoop SSA\n========\n\nFor loops we have the addition difficulty that we need would need to\nlook ahead what types a variable has at loop exit, but that is a cyclic\ndependency.\n\nOur solution is to consider the variable types at loop entry. When these\nchange, we drop all gained information from inside the loop. We may e.g.\nthink that a variable is a ``int`` or ``float``, but later recognize\nthat it can only be a float. Derivations from ``int`` must be discarded,\nand the loop analysis restarted.\n\nThen during the loop, we assign an incomplete loop trace shape to the\nvariable, which e.g. says it was an ``int`` initially and additional\ntype shapes, e.g. ``int or long`` are then derived. If at the end of the\nloop, a type produced no new types, we know we are finished and mark the\ntrace as a complete loop trace.\n\nIf it is not, and next time, we have the same initial types, we add the\nones derived from this to the starting values, and see if this gives\nmore types.\n\nPython Slots in Optimization\n============================\n\nBasic Slot Idea\n---------------\n\nFor almost all the operations in Python, a form of overloading is\navailable. That is what makes it so powerful.\n\nSo when you write an expression like this one:\n\n.. code:: python\n\n   1.0 + something\n\nThis something will not just blindly work when it's a float, but go\nthrough a slot mechanism, which then can be overloaded.\n\n.. code:: python\n\n   class SomeStrangeFloat:\n       def __float__(self):\n           return 3.14\n\n\n   something = SomeStrangeFloat()\n   # ...\n   1.0 + float(something) // 4.140000000000001\n\nHere it is the case, that this is used by user code, but more often this\nis used internally. Not all types have all slots, e.g. ``list`` does not\nhave ``__float__`` and therefore will refuse an addition to a ``float``\nvalue, based on that.\n\nAnother slot is working here, that we didn't mention yet, and that is\n``__add__`` which for some times will be these kinds of conversions or\nit will not do that kind of thing, e.g. something do hard checks, which\nis why this fails to work:\n\n.. code:: python\n\n   [] + ()\n\nAs a deliberate choice, there is no ``__list__`` slot used. The Python\ndesigners are aiming at solving many things with slots, but they also\naccept limitations.\n\nThere are many slots that are frequently used, most often behind your\nback (``__iter__``, ``__next__``, ``__lt__``, etc.). The list is large,\nand tends to grow with Python releases, but it is not endless.\n\nRepresentation in Nuitka\n------------------------\n\nSo a slot in Nuitka typically has an owning node. We use ``__len__`` as\nan example here. In the ``computeExpression`` the ``len`` node named\n``ExpressionBuiltinLen`` has to defer the decision what it computes to\nits argument.\n\n.. code:: python\n\n   def computeExpression(self, trace_collection):\n       return self.subnode_value.computeExpressionLen(\n           len_node=self, trace_collection=trace_collection\n       )\n\nThat decision then, in the absence of any type knowledge, must be done\nabsolutely carefully and conservative, as could see anything executing\nhere.\n\nThat examples this code in ``ExpressionBase`` which every expression by\ndefault uses:\n\n.. code:: python\n\n   def computeExpressionLen(self, len_node, trace_collection):\n       shape = self.getValueShape()\n\n       has_len = shape.hasShapeSlotLen()\n\n       if has_len is False:\n           return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n               template=\"object of type '%s' has no len()\",\n               operation=\"len\",\n               original_node=len_node,\n               value_node=self,\n           )\n       elif has_len is True:\n           iter_length = self.getIterationLength()\n\n           if iter_length is not None:\n               from .ConstantRefNodes import makeConstantRefNode\n\n               result = makeConstantRefNode(\n                   constant=int(iter_length),  # make sure to downcast long\n                   source_ref=len_node.getSourceReference(),\n               )\n\n               result = wrapExpressionWithNodeSideEffects(new_node=result, old_node=self)\n\n               return (\n                   result,\n                   \"new_constant\",\n                   \"Predicted 'len' result from value shape.\",\n               )\n\n       self.onContentEscapes(trace_collection)\n\n       # Any code could be run, note that.\n       trace_collection.onControlFlowEscape(self)\n\n       # Any exception may be raised.\n       trace_collection.onExceptionRaiseExit(BaseException)\n\n       return len_node, None, None\n\nNotice how by default, known ``__len__`` but unpredictable or even\nunknown if a ``__len__`` slot is there, the code indicates that its\ncontents and the control flow escapes (could change things behind out\nback) and any exception could happen.\n\nOther expressions can know better, e.g. for compile time constants we\ncan be a whole lot more certain:\n\n.. code:: python\n\n   def computeExpressionLen(self, len_node, trace_collection):\n       return trace_collection.getCompileTimeComputationResult(\n           node=len_node,\n           computation=lambda: len(self.getCompileTimeConstant()),\n           description=\"\"\"Compile time constant len value pre-computed.\"\"\",\n       )\n\nIn this case, we are using a function that will produce a concrete value\nor the exception that the ``computation`` function raised. In this case,\nwe can let the Python interpreter that runs Nuitka do all the hard work.\nThis lives in ``CompileTimeConstantExpressionBase`` and is the base for\nall kinds of constant values, or even built-in references like the name\n``len`` itself and would be used in case of doing ``len(len)`` which\nobviously gives an exception.\n\nOther overloads do not currently exist in Nuitka, but through the\niteration length, most cases could be addressed, e.g. ``list`` nodes\ntypical know their element counts.\n\nThe C side\n==========\n\nWhen a slot is not optimized away at compile time however, we need to\ngenerate actual code for it. We figure out what this could be by looking\nat the original CPython implementation.\n\n.. code:: C\n\n   PyObject *builtin_len(PyObject *self, PyObject *v) {\n       Py_ssize_t res;\n\n       res = PyObject_Size(v);\n       if (res < 0 && PyErr_Occurred())\n           return NULL;\n       return PyInt_FromSsize_t(res);\n   }\n\nWe find a pointer to ``PyObject_Size`` which is a generic Python C/API\nfunction used in the ``builtin_len`` implementation:\n\n.. code:: C\n\n   Py_ssize_t PyObject_Size(PyObject *o) {\n       PySequenceMethods *m;\n\n       if (o == NULL) {\n           null_error();\n           return -1;\n       }\n\n       m = o->ob_type->tp_as_sequence;\n       if (m && m->sq_length)\n           return m->sq_length(o);\n\n       return PyMapping_Size(o);\n   }\n\nOn the C level, every Python object (the ``PyObject *``) as a type named\n``ob_type`` and most of its elements are slots. Sometimes they form a\ngroup, here ``tp_as_sequence`` and then it may or may not contain a\nfunction. This one is tried in preference. Then, if that fails, next up\nthe mapping size is tried.\n\n.. code:: C\n\n   Py_ssize_t PyMapping_Size(PyObject *o) {\n       PyMappingMethods *m;\n\n       if (o == NULL) {\n           null_error();\n           return -1;\n       }\n\n       m = o->ob_type->tp_as_mapping;\n       if (m && m->mp_length)\n           return m->mp_length(o);\n\n       type_error(\"object of type '%.200s' has no len()\", o);\n       return -1;\n   }\n\nThis is the same principle, except with ``tp_as_mapping`` and\n``mp_length`` used.\n\nSo from this, we can tell how ``len`` gets at what could be a Python\nclass ``__len__`` or other built-in types.\n\nIn principle, every slot needs to be dealt with in Nuitka, and it is\nassumed that currently all slots are supported on at least a very\ndefensive level, to avoid unnoticed escapes of control flow.\n\nBuilt-in call optimization\n==========================\n\nFor calls to built-in names, there is typically a function in Python\nthat delegates to the type constructor (e.g. when we talk about ``int``\nthat just creates an object passing the arguments of the call) or its\nown special implementation as we saw with the ``len``.\n\nFor each built-in called, we have a specialized node, that presents to\noptimization the actions of the built-in. What are the impact, what are\nthe results. We have seen the resulting example for ``len`` above, but\nhow do we get there.\n\nIn Python, built-in names are used only if there is no module level\nvariable of the name, and of course no local variable of that name.\n\nTherefore, optimization of a built-in name is only done if it turns out\nthe actually assigned in other code, and then when the call comes,\narguments are checked and a relatively static node is created.\n\nCode Generation towards C\n=========================\n\nCurrently, Nuitka uses Pure C and no C++ patterns at all. The use of C11\nrequires on some platforms to compile the C11 using a C++ compiler,\nwhich works relatively well, but also limits the amount of C11 that can\nbe used.\n\nExceptions\n----------\n\nTo handle and work with exceptions, every construct that can raise has\neither a ``bool`` or ``int`` return code or ``PyObject *`` with ``NULL``\nreturn value. This is very much in line with that the Python C-API does.\n\nEvery helper function that contains code that might raise needs these\nvariables. After a failed call, our variant of ``PyErr_Fetch`` called\n``FETCH_ERROR_OCCURRED_STATE`` must be used to catch the defined error,\nunless some quick exception cases apply. The quick exception means,\n``NULL`` return from C-API without a set exception means e.g.\n``StopIteration``.\n\nAs an optimization, functions that raise exceptions, but are known not\nto do so, for whatever reason, could only be asserted to not do so.\n\nStatement Temporary Variables\n-----------------------------\n\nFor statements and larger constructs the context object track temporary\nvalues, that represent references. For some, these should be released at\nthe end of the statement, or they represent a leak.\n\nThe larger scope temporary variables, are tracked in the function or\nmodule context, where they are supposed to have explicit ``del`` to\nrelease their references.\n\nLocal Variables Storage\n-----------------------\n\nClosure variables taken are to be released when the function object is\nlater destroyed. For in-lined calls, variables are just passed, and it\ndoes not become an issue to release anything.\n\nFor function exit, owned variables, local or shared to other functions,\nmust be released. This cannot be a ``del`` operation, as it also\ninvolves setting a value, which would be wrong for shared variables (and\nwasteful to local variables, as that would be its last usage). Therefore\nwe need a special operation that simply releases the reference to the\ncell or object variable.\n\nExit Targets\n------------\n\nEach error or other exit releases statement temporary values and then\nexecutes a ``goto`` to the exit target. These targets need to be setup.\nThe ``try``/``except`` will e.g. catch error exits.\n\nOther exits are ``continue``, ``break``, and ``return`` exits. They all\nwork alike.\n\nGenerally, the exits stack of with constructs that need to register\nthemselves for some exit types. A loop e.g. registers the ``continue``\nexit, and a contained ``try``/``finally`` too, so it can execute the\nfinal code should it be needed.\n\nFrames\n------\n\nFrames are containers for variable declarations and cleanups. As such,\nframes provide error exits and success exits, which remove the frame\nfrom the frame stack, and then proceed to the parent exit.\n\nWith the use of non ``PyObject **`` C types, but frame exception exits,\nthe need to convert those types becomes apparent. Exceptions should\nstill resolve the C version. When using different C types at frame\nexception exits, there is a need to trace the active type, so it can be\nused in the correct form.\n\nAbortive Statements\n-------------------\n\nThe way ``try``/``finally`` is handled, copies of the ``finally`` block\nare made, and optimized independently for each abort method. The ones\nthere are of course, ``return``, ``continue``, and ``break``, but also\nimplicit and explicit ``raise`` of an exception.\n\nCode trailing an abortive statement can be discarded, and the control\nflow will follow these \"exits\".\n\nConstant Preparation\n====================\n\nEarly versions of Nuitka, created all constants for the whole program\nfor ready access to generated code, before the program launches. It did\nso in a single file, but that approach didn't scale well.\n\nProblems were\n\n-  Even unused code contributed to start-up time, this can become a lot\n   for large programs, especially in standalone mode.\n\n-  The massive amount of constant creation codes gave backend C\n   compilers a much harder time than necessary to analyse it all at\n   once.\n\nThe current approach is as follows. Code generation detects constants\nused in only one module, and declared ``static`` there, if the module is\nthe only user, or ``extern`` if it is not. Some values are forced to be\nglobal, as they are used pre-main or in helpers.\n\nThese ``extern`` values are globally created before anything is used.\nThe ``static`` values are created when the module is loaded, i.e.\nsomething did import it.\n\nWe trace used constants per module, and for nested ones, we also\nassociate them. The global constants code is special in that it can only\nuse ``static`` for nested values it exclusively uses, and has to export\nvalues that others use.\n\nLanguage Conversions to make things simpler\n===========================================\n\nThere are some cases, where the Python language has things that can in\nfact be expressed in a simpler or more general way, and where we choose\nto do that at either tree building or optimization time.\n\nThe ``assert`` statement\n------------------------\n\nThe ``assert`` statement is a special statement in Python, allowed by\nthe syntax. It has two forms, with and without a second argument. The\nlater is probably less known, as is the fact that raise statements can\nhave multiple arguments too.\n\nThe handling in Nuitka is:\n\n.. code:: python\n\n   assert value\n   # Absolutely the same as:\n   if not value:\n       raise AssertionError\n\n.. code:: python\n\n   assert value, raise_arg\n   # Absolutely the same as:\n   if not value:\n       raise AssertionError(raise_arg)\n\nThis makes assertions absolutely the same as a raise exception in a\nconditional statement.\n\nThis transformation is performed at tree building already, so Nuitka\nnever knows about ``assert`` as an element and standard optimizations\napply. If e.g. the truth value of the assertion can be predicted, the\nconditional statement will have the branch statically executed or\nremoved.\n\nThe \"comparison chain\" expressions\n----------------------------------\n\nIn Nuitka we have the concept of an outline, and therefore we can make\nthe following re-formulation instead:\n\n.. code:: python\n\n   a < b() > c < d\n\n\n   def _comparison_chain():  # So called \"outline\" function\n       tmp_a = a\n       tmp_b = b()\n\n       tmp = tmp_a < tmp_b\n\n       if not tmp:\n           return tmp\n\n       del tmp_a\n       tmp_c = c\n\n       tmp = tmp_b > tmp_c\n\n       if not tmp:\n           return tmp\n\n       del tmp_b\n\n       return tmp_c < d\n\n\n   _comparison_chain()\n\nThis transformation is performed at tree building already. The temporary\nvariables keep the value for the use of the same expression. Only the\nlast expression needs no temporary variable to keep it.\n\nWhat we got from this, is making the checks of the comparison chain\nexplicit and comparisons in Nuitka to be internally always about two\noperands only.\n\nThe ``execfile`` built-in\n-------------------------\n\nHandling is:\n\n.. code:: python\n\n   execfile(filename)\n   # Basically the same as:\n   exec(compile(open(filename).read()), filename, \"exec\")\n\n.. note::\n\n   This allows optimizations to discover the file opening nature easily\n   and apply file embedding or whatever we will have there one day.\n\nThis transformation is performed when the ``execfile`` built-in is\ndetected as such during optimization.\n\nGenerator expressions with ``yield``\n------------------------------------\n\nThese are converted at tree building time into a generator function body\nthat yields from the iterator given, which is the put into a for loop to\niterate, created a lambda function of and then called with the first\niterator.\n\nThat eliminates the generator expression for this case. It's a bizarre\nconstruct and with this trick needs no special code generation.\n\nThis is a complex example, demonstrating multiple cases of yield in\nunexpected cases:\n\n.. code:: python\n\n   x = ((yield i) for i in (1, 2) if not (yield))\n   # Basically the same as:\n   def x():\n       for i in (1, 2):\n           if not (yield):\n               yield (yield i)\n\nFunction Decorators\n-------------------\n\nWhen one learns about decorators, you see that:\n\n.. code:: python\n\n   @decorator\n   def function():\n       pass\n\n\n   # Is basically the same as:\n   def function():\n       pass\n\n\n   function = decorator(function)\n\nThe only difference is the assignment to function. In the ``@decorator``\ncase, if the decorator fails with an exception, the name ``function`` is\nnot assigned yet, but kept in a temporary variable.\n\nTherefore in Nuitka this assignment is more similar to that of a lambda\nexpression, where the assignment to the name is only at the end, which\nalso has the extra benefit of not treating real function and lambda\nfunctions any different.\n\nThis removes the need for optimization and code generation to support\ndecorators at all. And it should make the two variants optimize equally\nwell.\n\nFunctions nested arguments\n--------------------------\n\nNested arguments are a Python2 only feature supported by Nuitka.\nConsider this example:\n\n.. code:: python\n\n   def function(a, (b, c)):\n       return a, b, c\n\nWe solve this, by kind of wrapping the function with another function\nthat does the unpacking and gives the errors that come from this:\n\n.. code:: python\n\n   def function(a, _1):\n       def _tmp(a, b, c):\n           return a, b, c\n\n       a, b = _1\n       return _tmp(a, b, c)\n\nThe ``.1`` is the variable name used by CPython internally, and actually\nworks if you use keyword arguments via star dictionary. So this is very\ncompatible and actually the right kind of re-formulation, but it removes\nthe need from the code that does parameter parsing to deal with these.\n\nObviously, there is no frame for ``_tmp``, just one for ``function`` and\nwe do not use local variables, but temporary functions.\n\nIn-place Assignments\n--------------------\n\nIn-place assignments are re-formulated to an expression using temporary\nvariables.\n\nThese are not as much a reformulation of ``+=`` to ``+``, but instead\none which makes it explicit that the assign target may change its value.\n\n.. code:: python\n\n   a += b\n\n.. code:: python\n\n   _tmp = a.__iadd__(b)\n\n   if a is not _tmp:\n       a = _tmp\n\nUsing ``__iadd__`` here to express that for the ``+``, the in-place\nvariant ``iadd`` is used instead. The ``is`` check may be optimized away\ndepending on type and value knowledge later on.\n\nComplex Assignments\n-------------------\n\nComplex assignments are defined as those with multiple targets to assign\nfrom a single source and are re-formulated to such using a temporary\nvariable and multiple simple assignments instead.\n\n.. code:: python\n\n   a = b = c\n\n.. code:: python\n\n   _tmp = c\n   a = _tmp\n   b = _tmp\n   del _tmp\n\nThis is possible, because in Python, if one assignment fails, it can\njust be interrupted, so in fact, they are sequential, and all that is\nrequired is to not calculate ``c`` twice, which the temporary variable\ntakes care of. Were ``b`` a more complex expression, e.g.\n``b.some_attribute`` that might raise an exception, ``a`` would still be\nassigned.\n\nUnpacking Assignments\n---------------------\n\nUnpacking assignments are re-formulated to use temporary variables as\nwell.\n\n.. code:: python\n\n   a, b.attr, c[ind] = d = e, f, g = h()\n\nBecomes this:\n\n.. code:: python\n\n   _tmp = h()\n\n   _iter1 = iter(_tmp)\n   _tmp1 = unpack(_iter1, 3)\n   _tmp2 = unpack(_iter1, 3)\n   _tmp3 = unpack(_iter1, 3)\n   unpack_check(_iter1)\n   a = _tmp1\n   b.attr = _tmp2\n   c[ind] = _tmp3\n   d = _tmp\n   _iter2 = iter(_tmp)\n   _tmp4 = unpack(_iter2, 3)\n   _tmp5 = unpack(_iter2, 3)\n   _tmp6 = unpack(_iter2, 3)\n   unpack_check(_iter1)\n   e = _tmp4\n   f = _tmp5\n   g = _tmp6\n\nThat way, the unpacking is decomposed into multiple simple statements.\nIt will be the job of optimizations to try and remove unnecessary\nunpacking, in case e.g. the source is a known tuple or list creation.\n\n.. note::\n\n   The ``unpack`` is a special node which is a form of ``next`` that\n   will raise a ``ValueError`` when it cannot get the next value, rather\n   than a ``StopIteration``. The message text contains the number of\n   values to unpack, therefore the integer argument.\n\n.. note::\n\n   The ``unpack_check`` is a special node that raises a ``ValueError``\n   exception if the iterator is not finished, i.e. there are more values\n   to unpack. Again the number of values to unpack is provided to\n   construct the error message.\n\nWith Statements\n---------------\n\nThe ``with`` statements are re-formulated to use temporary variables as\nwell. The taking and calling of ``__enter__`` and ``__exit__`` with\narguments, is presented with standard operations instead. The promise to\ncall ``__exit__`` is fulfilled by ``try``/``except`` clause instead.\n\n.. code:: python\n\n   with some_context as x:\n       something(x)\n\n.. code:: python\n\n   tmp_source = some_context\n\n   # Actually it needs to be \"special look-up\" for Python2.7, so attribute\n   # look-up won't be exactly what is there.\n   tmp_exit = tmp_source.__exit__\n\n   # This one must be held for the whole with statement, it may be assigned\n   # or not, in our example it is. If an exception occurs when calling\n   # ``__enter__``, the ``__exit__`` should not be called.\n   tmp_enter_result = tmp_source.__enter__()\n\n   # Indicator variable to know if \"tmp_exit\" has been called.\n   tmp_indicator = False\n\n   try:\n       # Now the assignment is to be done, if there is any name for the\n       # manager given, this may become multiple assignment statements and\n       # even unpacking ones.\n       x = tmp_enter_result\n\n       # Then the code of the \"with\" block.\n       something(x)\n   except Exception:\n       # Note: This part of the code must not set line numbers, which we\n       # indicate with special source code references, which we call \"internal\".\n       # Otherwise the line of the frame would get corrupted.\n\n       tmp_indicator = True\n\n       if not tmp_exit(*sys.exc_info()):\n           raise\n   finally:\n       if not tmp_indicator:\n           # Call the exit if no exception occurred with all arguments\n           # as \"None\".\n           tmp_exit(None, None, None)\n\n.. note::\n\n   We don't refer really to ``sys.exc_info()`` at all, instead, we have\n   fast references to the current exception type, value and trace, taken\n   directly from the caught exception object on the C level.\n\n   If we had the ability to optimize ``sys.exc_info()`` to do that, we\n   could use the same transformation, but right now we don't have it.\n\nFor Loops\n---------\n\nThe ``for`` loops use normal assignments and handle the iterator that is\nimplicit in the code explicitly.\n\n.. code:: python\n\n   for x, y in iterable:\n       if something(x):\n           break\n   else:\n       otherwise()\n\nThis is roughly equivalent to the following code:\n\n.. code:: python\n\n   _iter = iter(iterable)\n   _no_break_indicator = False\n\n   while 1:\n       try:\n           _tmp_value = next(_iter)\n       except StopIteration:\n           # Set the indicator that the else branch may be executed.\n           _no_break_indicator = True\n\n           # Optimization should be able to tell that the else branch is run\n           # only once.\n           break\n\n       # Normal assignment re-formulation applies to this assignment of course.\n       x, y = _tmp_value\n       del _tmp_value\n\n       if something(x):\n           break\n\n   if _no_break_indicator:\n       otherwise()\n\n.. note::\n\n   The ``_iter`` temporary variable is of course also in a\n   ``try/finally`` construct, to make sure it releases after its used.\n   The ``x, y`` assignment is of course subject to unpacking\n   re-formulation.\n\n   The ``try``/``except`` is detected to allow to use a variant of\n   ``next`` that does not raise an exception, but to be fast check about\n   the ``NULL`` return from ``next`` built-in. So no actual exception\n   handling is happening in this case.\n\nWhile Loops\n-----------\n\nQuoting the ``nuitka.tree.ReformulationWhileLoopStatements``\ndocumentation:\n\nReformulation of while loop statements.\n\nLoops in Nuitka have no condition attached anymore, so while loops are\nre-formulated like this:\n\n.. code:: python\n\n   while condition:\n       something()\n\n.. code:: python\n\n   while 1:\n       if not condition:\n           break\n\n       something()\n\nThis is to totally remove the specialization of loops, with the\ncondition moved to the loop body in an initial conditional statement,\nwhich contains a ``break`` statement.\n\nThat achieves, that only ``break`` statements exit the loop, and allow\nfor optimization to remove always true loop conditions, without\nconcerning code generation about it, and to detect such a situation,\nconsider e.g. endless loops.\n\n.. note::\n\n   Loop analysis (not yet done) can then work on a reduced problem\n   (which ``break`` statements are executed under what conditions) and\n   is then automatically very general.\n\n   The fact that the loop body may not be entered at all, is still\n   optimized, but also in the general sense. Explicit breaks at the loop\n   start and loop conditions are the same.\n\nEnd quoting the ``nuitka.tree.ReformulationWhileLoopStatements``\ndocumentation:\n\nException Handlers\n------------------\n\nException handlers in Python may assign the caught exception value to a\nvariable in the handler definition. And the different handlers are\nrepresented as conditional checks on the result of comparison\noperations.\n\n.. code:: python\n\n   try:\n       block()\n   except A as e:\n       handlerA(e)\n   except B as e:\n       handlerB(e)\n   else:\n       handlerElse()\n\n.. code:: python\n\n   try:\n       block()\n   except:\n       # These are special nodes that access the exception, and don't really\n       # use the \"sys\" module.\n       tmp_exc_type = sys.exc_info()[0]\n       tmp_exc_value = sys.exc_info()[1]\n\n       # exception_matches is a comparison operation, also a special node.\n       if exception_matches(tmp_exc_type, (A,)):\n           e = tmp_exc_value\n           handlerA(e)\n       elif exception_matches(tmp_exc_type, (B,)):\n           e = tmp_exc_value\n           handlerB(e)\n       else:\n           handlerElse()\n\nFor Python3, the assigned ``e`` variables get deleted at the end of the\nhandler block. Should that value be already deleted, that ``del`` does\nnot raise, therefore it's tolerant. This has to be done in any case, so\nfor Python3 it is even more complex.\n\n.. code:: python\n\n   try:\n       block()\n   except:\n       # These are special nodes that access the exception, and don't really\n       # use the \"sys\" module.\n       tmp_exc_type = sys.exc_info()[0]\n       tmp_exc_value = sys.exc_info()[1]\n\n       # exception_matches is a comparison operation, also a special node.\n       if exception_matches(tmp_exc_type, (A,)):\n           try:\n               e = tmp_exc_value\n               handlerA(e)\n           finally:\n               del e\n       elif exception_matches(tmp_exc_type, (B,)):\n           try:\n               e = tmp_exc_value\n               handlerB(e)\n           finally:\n               del e\n       else:\n           handlerElse()\n\nShould there be no ``else:`` branch, a default re-raise statement is\nused instead.\n\nAnd of course, the values of the current exception type and value, both\nuse special references, that access the C++ and don't go via\n``sys.exc_info`` at all, nodes called ``CaughtExceptionTypeRef`` and\n``CaughtExceptionValueRef``.\n\nThis means, that the different handlers and their catching run time\nbehavior are all explicit and reduced the branches.\n\nStatement ``try``/``except`` with ``else``\n------------------------------------------\n\nMuch like ``else`` branches of loops, an indicator variable is used to\nindicate the entry into any of the exception handlers.\n\nTherefore, the ``else`` becomes a real conditional statement in the node\ntree, checking the indicator variable and guarding the execution of the\n``else`` branch.\n\nClass Creation (Python2)\n------------------------\n\nClasses in Python2 have a body that only serves to build the class\ndictionary and is a normal function otherwise. This is expressed with\nthe following re-formulation:\n\n.. code:: python\n\n   # in module \"SomeModule\"\n   # ...\n\n\n   class SomeClass(SomeBase, AnotherBase):\n       \"\"\" This is the class documentation. \"\"\"\n\n       some_member = 3\n\n.. code:: python\n\n   def _makeSomeClass():\n       # The module name becomes a normal local variable too.\n       __module__ = \"SomeModule\"\n\n       # The doc string becomes a normal local variable.\n       __doc__ = \"\"\" This is the class documentation. \"\"\"\n\n       some_member = 3\n\n       return locals()\n\n       # force locals to be a writable dictionary, will be optimized away, but\n       # that property will stick. This is only to express, that locals(), where\n       # used will be writable to.\n       exec(\"\")\n\n\n   SomeClass = make_class(\"SomeClass\", (SomeBase, AnotherBase), _makeSomeClass())\n\nThat is roughly the same, except that ``_makeSomeClass`` is *not*\nvisible to its child functions when it comes to closure taking, which we\ncannot express in Python language at all.\n\nTherefore, class bodies are just special function bodies that create a\ndictionary for use in class creation. They don't really appear after the\ntree building stage anymore. The type inference will of course have to\nbecome able to understand ``make_class`` quite well, so it can recognize\nthe created class again.\n\nClass Creation (Python3)\n------------------------\n\nIn Python3, classes are a complicated way to write a function call, that\ncan interact with its body. The body starts with a dictionary provided\nby the metaclass, so that is different, because it can ``__prepare__`` a\nnon-empty locals for it, which is hidden away in \"prepare_class_dict\"\nbelow.\n\nWhat's noteworthy, is that this dictionary, could e.g. be an\n``OrderDict``. I am not sure, what ``__prepare__`` is allowed to return.\n\n.. code:: python3\n\n   # in module \"SomeModule\"\n   # ...\n\n   class SomeClass(SomeBase, AnotherBase, metaclass = SomeMetaClass):\n       \"\"\" This is the class documentation. \"\"\"\n\n       some_member = 3\n\n.. code:: python\n\n   # Non-keyword arguments, need to be evaluated first.\n   tmp_bases = (SomeBase, AnotherBase)\n\n   # Keyword arguments go next, __metaclass__ is just one of them. In principle\n   # we need to forward the others as well, but this is ignored for the sake of\n   # brevity.\n   tmp_metaclass = select_metaclass(tmp_bases, SomeMetaClass)\n\n   tmp_prepared = tmp_metaclass.__prepare__(\"SomeClass\", tmp_bases)\n\n   # The function that creates the class dictionary. Receives temporary variables\n   # to work with.\n   def _makeSomeClass():\n       # This has effect, currently I don't know how to express that in Python3\n       # syntax, but we will have a node that does that.\n       locals().replace(tmp_prepared)\n\n       # The module name becomes a normal local variable too.\n       __module__ = \"SomeModule\"\n\n       # The doc string becomes a normal local variable.\n       __doc__ = \"\"\" This is the class documentation. \"\"\"\n\n       some_member = 3\n\n       # Create the class, share the potential closure variable \"__class__\"\n       # with others.\n       __class__ = tmp_metaclass(\"SomeClass\", tmp_bases, locals())\n\n       return __class__\n\n\n   # Build and assign the class.\n   SomeClass = _makeSomeClass()\n\nGenerator Expressions\n---------------------\n\nThere are re-formulated as functions.\n\nGenerally they are turned into calls of function bodies with\n(potentially nested) for loops:\n\n.. code:: python\n\n   gen = (x * 2 for x in range(8) if cond())\n\n.. code:: python\n\n   def _gen_helper(__iterator):\n       for x in __iterator:\n           if cond():\n               yield x * 2\n\n\n   gen = _gen_helper(range(8))\n\nList Contractions\n-----------------\n\nThe list contractions of Python2 are different from those of Python3, in\nthat they don't actually do any closure variable taking, and that no\nfunction object ever exists.\n\n.. code:: python\n\n   list_value = [x * 2 for x in range(8) if cond()]\n\n.. code:: python\n\n   def _listcontr_helper(__iterator):\n       result = []\n\n       for x in __iterator:\n           if cond():\n               result.append(x * 2)\n\n       return result\n\n\n   list_value = _listcontr_helper(range(8))\n\nThe difference is that with Python3, the function \"_listcontr_helper\" is\nreally there and named ``<listcontraction>`` (or ``<listcomp>`` as of\nPython3.7 or higher), whereas with Python2 the function is only an\noutline, so it can readily access the containing name space.\n\nSet Contractions\n----------------\n\nThe set contractions of Python2.7 are like list contractions in Python3,\nin that they produce an actual helper function:\n\n.. code:: python\n\n   set_value = {x * 2 for x in range(8) if cond()}\n\n.. code:: python\n\n   def _setcontr_helper(__iterator):\n       result = set()\n\n       for x in __iterator:\n           if cond():\n               result.add(x * 2)\n\n       return result\n\n\n   set_value = _setcontr_helper(range(8))\n\nDictionary Contractions\n-----------------------\n\nThe dictionary contractions of are like list contractions in Python3, in\nthat they produce an actual helper function:\n\n.. code:: python\n\n   dict_value = {x: x * 2 for x in range(8) if cond()}\n\n.. code:: python\n\n   def _dictcontr_helper(__iterator):\n       result = {}\n\n       for x in __iterator:\n           if cond():\n               result[x] = x * 2\n\n       return result\n\n\n   set_value = _dictcontr_helper(range(8))\n\nBoolean expressions ``and`` and ``or``\n--------------------------------------\n\nThe short circuit operators ``or`` and ``and`` tend to be only less\ngeneral that the ``if``/``else`` expressions, but have dedicated nodes.\nWe used to have a re-formulation towards those, but we now do these via\ndedicated nodes too.\n\nThese new nodes, present the evaluation of the left value, checking for\nits truth value, and depending on it, to pick it, or use the right\nvalue.\n\nSimple Calls\n------------\n\nAs seen below, even complex calls are simple calls. In simple calls of\nPython there is still some hidden semantic going on, that we expose.\n\n.. code:: python\n\n   func(arg1, arg2, named1=arg3, named2=arg4)\n\nOn the C-API level there is a tuple and dictionary built. This one is\nexposed:\n\n.. code:: python\n\n   func(*(arg1, arg2), **{\"named1\": arg3, \"named2\": arg4})\n\nA called function will access this tuple and the dictionary to parse the\narguments, once that is also re-formulated (argument parsing), it can\nthen lead to simple in-lining. This way calls only have 2 arguments with\nconstant semantics, that fits perfectly with the C-API where it is the\nsame, so it is actually easier for code generation.\n\nAlthough the above looks like a complex call, it actually is not. No\nchecks are needed for the types of the star arguments and it's directly\ntranslated to ``PyObject_Call``.\n\nComplex Calls\n-------------\n\nThe call operator in Python allows to provide arguments in 4 forms.\n\n-  Positional (or normal) arguments\n\n-  Named (or keyword) arguments\n\n-  Star list arguments\n\n-  Star dictionary arguments\n\nThe evaluation order is precisely that. An example would be:\n\n.. code:: python\n\n   something(pos1, pos2, name1=named1, name2=named2, *star_list, **star_dict)\n\nThe task here is that first all the arguments are evaluated, left to\nright, and then they are merged into only two, that is positional and\nnamed arguments only. for this, the star list argument and the star\ndictionary arguments, are merged with the positional and named\narguments.\n\nWhat's peculiar, is that if both the star list and dictionary arguments\nare present, the merging is first done for star dictionary, and only\nafter that for the star list argument. This makes a difference, because\nin case of an error, the star argument raises first.\n\n.. code:: python\n\n   something(*1, **2)\n\nThis raises \"TypeError: something() argument after ** must be a mapping,\nnot int\" as opposed to a possibly more expected \"TypeError: something()\nargument after * must be a sequence, not int.\"\n\nThat doesn't matter much though, because the value is to be evaluated\nfirst anyway, and the check is only performed afterwards. If the star\nlist argument calculation gives an error, this one is raised before\nchecking the star dictionary argument.\n\nSo, what we do, is we convert complex calls by the way of special\nfunctions, which handle the dirty work for us. The optimization is then\ntasked to do the difficult stuff. Our example becomes this:\n\n.. code:: python\n\n   def _complex_call(called, pos, kw, star_list_arg, star_dict_arg):\n       # Raises errors in case of duplicate arguments or tmp_star_dict not\n       # being a mapping.\n       tmp_merged_dict = merge_star_dict_arguments(\n           called, tmp_named, mapping_check(called, tmp_star_dict)\n       )\n\n       # Raises an error if tmp_star_list is not a sequence.\n       tmp_pos_merged = merge_pos_arguments(called, tmp_pos, tmp_star_list)\n\n       # On the C-API level, this is what it looks like.\n       return called(*tmp_pos_merged, **tmp_merged_dict)\n\n\n   returned = _complex_call(\n       called=something,\n       pos=(pos1, pos2),\n       named={\"name1\": named1, \"name2\": named2},\n       star_list_arg=star_list,\n       star_dict_arg=star_dict,\n   )\n\nThe call to ``_complex_call`` is be a direct function call with no\nparameter parsing overhead. And the call in its end, is a special call\noperation, which relates to the ``PyObject_Call`` C-API.\n\nAssignment Expressions\n----------------------\n\nIn Python 3.8 or higher, you assign inside expressions.\n\n.. code:: python\n\n   if (x := cond()):\n      do_something()\n\nthis is the same as:\n\n.. code:: python\n\n   # Doesn't exist with that name, and it is not really taking closure variables,\n   # it just shares the execution context.\n   def _outline_func():\n      nonlocal x\n      x = cond()\n\n      return x\n\n   if (_outline_func()):\n      do_something\n\nWhen we use this outline function, we are allowed statements, even\nassignments, in expressions. For optimization, they of course pose a\nchallenge to be removed ever, only happens when it becomes only a return\nstatement, but they do not cause much difficulties for code generation,\nsince they are transparent.\n\nMatch Statements\n----------------\n\nIn Python 3.10 or higher, you can write so called ``match`` statements\nlike this:\n\n.. code:: python\n\n   match something():\n       case [x] if x:\n           z = 2\n       case _ as y if y == x and y:\n           z = 1\n       case 0:\n           z = 0\n\nThis is the same as\n\n.. code:: python\n\n   tmp_match_subject = something()\n\n   # Indicator variable, once true, all matching stops.\n   tmp_handled = False\n\n   # First branch\n   x = tmp_match_subject\n\n   if sequence_check(x)\n      if x:\n         z = 2\n         tmp_handled = True\n\n   if tmp_handled is False:\n      y = tmp_match_subject\n\n      if x == y and y:\n         z = 1\n         tmp_handled = True\n\n   if tmp_handled is False:\n      z = 0\n\nPrint Statements\n----------------\n\nThe ``print`` statement exists only in Python2. It implicitly converts\nits arguments to strings before printing them. In order to make this\naccessible and compile time optimized, this is made visible in the node\ntree.\n\n.. code:: python\n\n   print arg1, \"1\", 1\n\nThis is in Nuitka converted so that the code generation for ``print``\ndoesn't do any conversions itself anymore and relies on the string\nnature of its input.\n\n.. code:: python\n\n   print str(arg1), \"1\", str(1)\n\nOnly string objects are spared from the ``str`` built-in wrapper,\nbecause that would only cause noise in optimization stage. Later\noptimization can then find it unnecessary for certain arguments.\n\nAdditionally, each ``print`` may have a target, and multiple arguments,\nwhich we break down as well for dumber code generation. The target is\nevaluated first and should be a file, kept referenced throughout the\nwhole print statement.\n\n.. code:: python\n\n   print >> target_file, str(arg1), \"1\", str(1)\n\nThis is being reformulated to:\n\n.. code:: python\n\n   try:\n      tmp_target = target_file\n\n      print >>tmp_target, str(arg1), print >>tmp_target, \"1\", print\n      >>tmp_target, str(1), print >>tmp_target\n\n   finally:\n      del tmp_target\n\nThis allows code generation to not deal with arbitrary amount of\narguments to ``print``. It also separates the newline indicator from the\nrest of things, which makes sense too, having it as a special node, as\nit's behavior with regards to soft-space is different of course.\n\nAnd finally, for ``print`` without a target, we still assume that a\ntarget was given, which would be ``sys.stdout`` in a rather hard-coded\nway (no variable look-ups involved).\n\nReformulations during Optimization\n==================================\n\nBuiltin ``zip`` for Python2\n---------------------------\n\n.. code:: python\n\n   def _zip(a, b, c):  # Potentially more arguments.\n      # First assign, to preserve the order of execution, the arguments might be\n      # complex expressions with side effects.\n      tmp_arg1 = a\n      tmp_arg2 = b\n      tmp_arg3 = c\n      # could be more\n      ...\n\n      # Creation of iterators goes first.\n      try:\n         tmp_iter_1 = iter(tmp_arg1)\n      except TypeError:\n         raise TypeError(\"zip argument #1 must support iteration\")\n      try:\n         tmp_iter_2 = iter(tmp_arg2)\n      except TypeError:\n         raise TypeError(\"zip argument #2 must support iteration\")\n      try:\n         tmp_iter_3 = iter(tmp_arg3)\n      except TypeError:\n         raise TypeError(\"zip argument #3 must support iteration\")\n\n      # could be more\n      ...\n\n      tmp_result = []\n      try:\n         while 1:\n            tmp_result.append(\n                  (\n                     next(tmp_iter_1),\n                     next(tmp_iter_2),\n                     next(tmp_iter_3),\n                     # more arguments here ...\n                  )\n            )\n      except StopIteration:\n         pass\n\n      return tmp_result\n\nBuiltin ``zip`` for Python3\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n   for x, y, z in zip(a, b, c):\n       ...\n\n.. code:: python\n\n   def _zip_gen_object(a, b, c, ...):\n       ...\n       # See Python2\n       ...\n\n      # could be more\n      ...\n      while 1:\n           yield (\n               next(tmp_iter_1),\n               next(tmp_iter_2),\n               next(tmp_iter_3),\n               ...\n           )\n       except StopIteration:\n           break\n\n   for x, y, z in _zip_gen_object(a, b, c):\n       ...\n\nBuiltin ``map`` for Python2\n---------------------------\n\n.. code:: python\n\n   def _map():\n       # TODO: Not done yet.\n       pass\n\nBuiltin ``min``\n---------------\n\n.. code:: python\n\n   # TODO: keyfunc (Python2/3), defaults (Python3)\n   def _min(a, b, c):  # Potentially more arguments.\n       tmp_arg1 = a\n       tmp_arg2 = b\n       tmp_arg3 = c\n       # more arguments here ...\n\n       result = tmp_arg1\n       if keyfunc is None:  # can be decided during re-formulation\n           tmp_key_result = keyfunc(result)\n           tmp_key_candidate = keyfunc(tmp_arg2)\n           if tmp_key_candidate < tmp_key_result:\n               result = tmp_arg2\n               tmp_key_result = tmp_key_candidate\n           tmp_key_candidate = keyfunc(tmp_arg3)\n           if tmp_key_candidate < tmp_key_result:\n               result = tmp_arg3\n               tmp_key_result = tmp_key_candidate\n           # more arguments here ...\n       else:\n           if tmp_arg2 < result:\n               result = tmp_arg2\n           if tmp_arg3 < result:\n               result = tmp_arg3\n           # more arguments here ...\n\n       return result\n\nBuiltin ``max``\n---------------\n\nSee ``min`` just with ``>`` instead of ``<``.\n\nCall to ``dir`` without arguments\n---------------------------------\n\nThis expression is reformulated to ``locals().keys()`` for Python2, and\n``list(locals.keys())`` for Python3.\n\nCalls to functions with known signatures\n----------------------------------------\n\nAs a necessary step for inlining function calls, we need to change calls\nto variable references to function references.\n\n.. code:: python\n\n   def f(arg1, arg2):\n       return some_op(arg1, arg2)\n\n\n   # ... other code\n\n   x = f(a, b + c)\n\nIn the optimization it is turned into\n\n.. code:: python\n\n   # ... other code\n\n   x = lambda arg1, arg2: some_op(arg1, arg2)(a, b + c)\n\n.. note::\n\n   The ``lambda`` stands here for a reference to the function, rather\n   than a variable reference, this is the normal forward propagation of\n   values, and does not imply duplicating or moving any code at all.\n\nAt this point, we still have not resolved the actual call arguments to\nthe variable names, still a Python level function is created, and\ncalled, and arguments are parsed to a tuple, and from a tuple. For\nsimplicity sake, we have left out keyword arguments out of the equation\nfor now, but they are even more costly.\n\nSo now, what we want to do, is to re-formulate the call into what we\ncall an outline body, which is a inline function, and that does the\nparameter parsing already and contains the function code too. In this\ninlining, there still is a function, but it's technically not a Python\nfunction anymore, just something that is an expression whose value is\ndetermined by control flow and the function call.\n\n.. code:: python\n\n   # ... other code\n\n\n   def _f():\n       tmp_arg1 = arg1\n       tmp_arg2 = b + c\n       return tmp_arg1 + tmp_arg2\n\n\n   x = _f()\n\nWith this, a function is considered inlined, because it becomes part of\nthe abstract execution, and the actual code is duplicated.\n\nThe point is, that matching the signature of the function to the actual\narguments given, is pretty straight forward in many cases, but there are\ntwo forms of complications that can happen. One is default values,\nbecause they need to assigned or not, and the other is keyword\narguments, because they allow to reorder arguments.\n\nLet's consider an example with default values first.\n\n.. code:: python\n\n   def f(arg1, arg2=some_default()):\n       return some_op(arg1, arg2)\n\n\n   # ... other code\n\n   x = f(a, b + c)\n\nSince the point, at which defaults are taken, we must execute them at\nthat point and make them available.\n\n.. code:: python\n\n   tmp_defaults = (some_default,)  # that was f.__defaults__\n\n   # ... other code\n\n\n   def _f():\n       tmp_arg1 = arg1\n       tmp_arg2 = tmp_defaults[0]\n       return tmp_arg1 + tmp_arg2\n\n\n   x = _f()\n\nNow, one where keyword arguments are ordered the other way.\n\n.. code:: python\n\n   def f(arg1, arg2):\n       return some_op(arg1, arg2)\n\n\n   # ... other code\n\n   x = f(arg2=b + c, arg1=a)  # \"b+c\" is evaluated before \"a\"\n\nThe solution is an extra level of temporary variables. We remember the\nargument order by names and then assign parameters from it:\n\n.. code:: python\n\n   # ... other code\n\n\n   def _f():\n       tmp_given_value1 = b + c\n       tmp_given_value2 = a\n       tmp_arg1 = tmp_given_value2\n       tmp_arg2 = tmp_given_value1\n       return tmp_arg1 + tmp_arg2\n\n\n   x = _f()\n\nObviously, optimization of Nuitka can decide, that e.g. should ``a`` or\n``b+c`` not have side effects, to optimize these with standard variable\ntracing away.\n\nNodes that serve special purposes\n=================================\n\nTry statements\n--------------\n\nIn Python, there is ``try``/``except`` and ``try``/``finally``. In\nNuitka there is only a ``try``, which then has blocks to handle\nexceptions, ``continue``, or ``break``, or ``return``. There is no\n``else`` to this node type.\n\nThis is more low level and universal. Code for the different handlers\ncan be different. User provided ``finally`` blocks become copied into\nthe different handlers.\n\nReleases\n--------\n\nWhen a function exits, the local variables are to be released. The same\napplies to temporary variables used in re-formulations. These releases\ncause a reference to the object to the released, but no value change.\nThey are typically the last use of the object in the function.\n\nThe are similar to ``del``, but make no value change. For shared\nvariables this effect is most visible.\n\nSide Effects\n------------\n\nWhen an exception is bound to occur, and this can be determined at\ncompile time, Nuitka will not generate the code the leads to the\nexception, but directly just raise it. But not in all cases, this is the\nfull thing.\n\nConsider this code:\n\n.. code:: python\n\n   f(a(), 1 / 0)\n\nThe second argument will create a ``ZeroDivisionError`` exception, but\nbefore that ``a()`` must be executed, but the call to ``f`` will never\nhappen and no code is needed for that, but the name look-up must still\nsucceed. This then leads to code that is internally like this:\n\n.. code:: python\n\n   f(a(), raise_ZeroDivisionError())\n\nwhich is then modeled as:\n\n.. code:: python\n\n   side_effect(a(), f, raise_ZeroDivisionError())\n\nwhere we can consider ``side_effect`` to be a function that returns the\nlast expression. Of course, if this is not part of another expression,\nbut close to statement level, side effects, can be converted to multiple\nstatements simply.\n\nAnother use case, is that the value of an expression can be predicted,\nbut that the language still requires things to happen, consider this:\n\n.. code:: python\n\n   a = len((f(), g()))\n\nWe can tell that ``a`` will be 2, but the call to ``f`` and ``g`` must\nstill be performed, so it becomes:\n\n.. code:: python\n\n   a = side_effects(f(), g(), 2)\n\nModelling side effects explicitly has the advantage of recognizing them\neasily and allowing to drop the call to the tuple building and checking\nits length, only to release it.\n\nCaught Exception Type/Value References\n--------------------------------------\n\nWhen catching an exception, these are not directly put to\n``sys.exc_info()``, but remain as mere C variables. From there, they can\nbe accessed with these nodes, or if published then from the thread\nstate.\n\nHard Module Imports\n-------------------\n\nThese are module look-ups that don't depend on any local variable for\nthe module to be looked up, but with hard-coded names. These may be the\nresult of optimization gaining such level of certainty.\n\nCurrently they are used to represent ``sys.stdout`` usage for ``print``\nstatements, but other usages will follow.\n\nLocals Dict Update Statement\n----------------------------\n\nFor the ``exec`` re-formulation, we apply an explicit sync back to\nlocals as an explicit node. It helps us to tell the affected local\nvariable traces that they might be affected. It represents the bit of\n``exec`` in Python2, that treats ``None`` as the locals argument as an\nindication to copy back.\n\nOptimizing Attribute Lookups into Method Calls for Built-ins types\n==================================================================\n\nThe attribute lookup node ``ExpressionAttributeLookup`` represents\nlooking up an attribute name, that is known to be a string. That's\nalready a bit more special, than say what ``ExpressionBuiltinGetattr``\ndoes for ``getattr``, where it could be any object being looked up. From\nthe Python syntax however, these are what gets created, as it's not\nallowed in any other way. So, this is where this starts.\n\nThen, when we are creating an attribute node with a *fixed* name, we\ndispatch it to generated node classes, e.g.\n``ExpressionAttributeLookupFixedAppend``. This will be the same, except\nthat the attribute name is hardcoded.\n\nThere are generated, such that they can have code that is special for\n``.append`` lookups. In their case, it makes sense to ask the source, if\nthey are a ``list`` object exactly. It doesn't make sense to do this\ncheck for names that the ``list`` does not contain. So at that stage, we\nare saving both a bit of memory and time.\n\nShould this question succeed, i.e. the expression the attribute values\nis looked up upon, is known to be a ``list`` exactly, we persist this\nknowledge in the also generated nodes that represent ``list.append`` and\njust that. It is called ``ExpressionAttributeLookupListAppend`` and only\nrepresents the knowledge gained so far.\n\nWe do not consider if ``ExpressionAttributeLookupFixedAppend`` is\ncalled, or not, passed as an argument, assigned somewhere, it doesn't\nmatter yet, but for ``ExpressionAttributeLookupListAppend`` we know a\nhell of a lot more. We know its type, we know attributes for it, say\n``__name__``, as it is a compile time constant, therefore much\noptimization can follow for them, and code generation can specialize\nthem too (not yet done).\n\nShould these nodes then, and say this happens later after some inlining\nhappens be seen as called, we can then turn them into method call nodes,\nchecking the arguments and such, this is then\n``ExpressionListOperationAppend`` and at this point, will raising errors\nwith wrong argument counts.\n\nAnd then we have this ``ExpressionListOperationAppend`` which will\ninfluence the tracing of ``list`` contents, i.e. it will be able to tell\nthe ``list`` in question is no more empty after this ``append``, and it\nwill be able to at least predict the last element value, truth value of\nthe list, etc.\n\n******************************\n Plan to add \"ctypes\" support\n******************************\n\nAdd interfacing to C code, so Nuitka can turn a ``ctypes`` binding into\nan efficient binding as if it were written manually with Python C-API or\nbetter.\n\nGoals/Allowances to the task\n============================\n\n#. Goal: Must not directly use any pre-existing C/C++ language file\n   headers, only generate declarations in generated C code ourselves. We\n   would rather write or use tools that turn an existing a C header to\n   some ``ctypes`` declarations if it needs to be, but not mix and use\n   declarations from existing header code.\n\n   .. note::\n\n      The \"cffi\" interface maybe won't have the issue, but it's not\n      something we need to write or test the code for.\n\n#. Allowance: May use ``ctypes`` module at compile time to ask things\n   about ``ctypes`` and its types.\n\n#. Goal: Should make use of ``ctypes``, to e.g. not hard code in Nuitka\n   what ``ctypes.c_int()`` gives on the current platform, unless there\n   is a specific benefit.\n\n#. Allowance: Not all ``ctypes`` usages must be supported immediately.\n\n#. Goal: Try and be as general as possible.\n\n   For the compiler, ``ctypes`` support should be hidden behind a\n   generic interface of some sort. Supporting ``math`` module should be\n   the same thing.\n\nType Inference - The Discussion\n===============================\n\nMain initial goal is to forward value knowledge. When you have ``a =\nb``, that means that a and b now \"alias\". And if you know the value of\n``b`` you can assume to know the value of ``a``. This is called\n\"aliasing\".\n\nWhen assigning ``a`` to something new, that won't change ``b`` at all.\nBut when an attribute is set, a method called of it, that might impact\nthe actual value, referenced by both. We need to understand mutable vs.\nimmutable though, as some things are not affected by aliasing in any\nway.\n\n.. code:: python\n\n   a = 3\n   b = a\n\n   b += 4  # a is not changed\n\n   a = [3]\n   b = a\n\n   b += [4]  # a is changed indeed\n\nIf we cannot tell, we must assume that ``a`` might be changed. It's\neither ``b`` or what ``a`` was before. If the type is not mutable, we\ncan assume the aliasing to be broken up, and if it is, we can assume\nboth to be the same value still.\n\nWhen that value is a compile time constant, we will want to push it\nforward, and we do that with \"(Constant) Value Propagation\", which is\nimplemented already. We avoid too large constants, and we properly trace\nvalue assignments, but not yet aliases.\n\nIn order to fully benefit from type knowledge, the new type system must\nbe able to be fully friends with existing built-in types, but for\nclasses to also work with it, it should not be tied to them. The\nbehavior of a type ``long``, ``str``, etc. ought to be implemented as\nfar as possible with the built-in ``long``, ``str`` at compiled time as\nwell.\n\n.. note::\n\n   This \"use the real thing\" concept extends beyond builtin types, e.g.\n   ``ctypes.c_int()`` should also be used, but we must be aware of\n   platform dependencies. The maximum size of ``ctypes.c_int`` values\n   would be an example of that. Of course that may not be possible for\n   everything.\n\n   This approach has well proven itself with built-in functions already,\n   where we use real built-ins where possible to make computations. We\n   have the problem though that built-ins may have problems to execute\n   everything with reasonable compile time cost.\n\nAnother example, consider the following code:\n\n.. code:: python\n\n   len(\"a\" * 1000000000000)\n\nTo predict this code, calculating it at compile time using constant\noperations, while feasible, puts an unacceptable burden on the\ncompilation.\n\nEsp. we wouldn't want to produce such a huge constant and stream it, the\nC++ code would become too huge. So, we need to stop the ``*`` operator\nfrom being used at compile time and cope with reduced knowledge, already\nhere:\n\n.. code:: python\n\n   \"a\" * 10000000000000\n\nInstead, we would probably say that for this expression:\n\n-  The result is a ``str`` or a C level ``PyStringObject *``.\n\n-  We know its length exactly, it's ``10000000000000``.\n\n-  Can predict every of its elements when sub-scripted, sliced, etc., if\n   need be, with a function we may create.\n\nSimilar is true for this horrible (in Python2) thing:\n\n.. code:: python\n\n   range(10000000000000)\n\nSo it's a rather general problem, this time we know:\n\n-  The result is a ``list`` or C level ``PyListObject *``.\n\n-  We know its length exactly, ``10000000000000``.\n\n-  Can predict every of its elements when index, sliced, etc., if need\n   be, with a function.\n\nAgain, we wouldn't want to create the list. Therefore Nuitka avoids\nexecuting these calculation, when they result in constants larger than a\nthreshold of e.g. 256 elements. This concept has to be also applied to\nlarge integers and more CPU and memory traps.\n\nNow lets look at a more complete use case:\n\n.. code:: python\n\n   for x in range(10000000000000):\n       doSomething()\n\nLooking at this example, one traditional way to look at it, would be to\nturn ``range`` into ``xrange``, and to note that ``x`` is unused. That\nwould already perform better. But really better is to notice that\n``range()`` generated values are not used at all, but only the length of\nthe expression matters.\n\nAnd even if ``x`` were used, only the ability to predict the value from\na function would be interesting, so we would use that computation\nfunction instead of having an iteration source. Being able to predict\nfrom a function could mean to have Python code to do it, as well as C\ncode to do it. Then code for the loop can be generated without any\nCPython library usage at all.\n\n.. note::\n\n   Of course, it would only make sense where such calculations are\n   \"O(1)\" complexity, i.e. do not require recursion like \"n!\" does.\n\nThe other thing is that CPython appears to at - run time - take length\nhints from objects for some operations, and there it would help too, to\ntrack length of objects, and provide it, to outside code.\n\nBack to the original example:\n\n.. code:: python\n\n   len(\"a\" * 1000000000000)\n\nThe theme here, is that when we can't compute all intermediate\nexpressions, and we sure can't do it in the general case. But we can\nstill, predict some of properties of an expression result, more or less.\n\nHere we have ``len`` to look at an argument that we know the size of.\nGreat. We need to ask if there are any side effects, and if there are,\nwe need to maintain them of course. This is already done by existing\noptimization if an operation generates an exception.\n\n.. note::\n\n   The optimization of ``len`` has been implemented and works for all\n   kinds of container creation and ranges.\n\nApplying this to \"ctypes\"\n=========================\n\nThe *not so specific* problem to be solved to understand ``ctypes``\ndeclarations is maybe as follows:\n\n.. code:: python\n\n   import ctypes\n\nThis leads to Nuitka in its tree to have an assignment from a\n``__import__`` expression to the variable ``ctypes``. It can be\npredicted by default to be a module object, and even better, it can be\nknown as ``ctypes`` from standard library with more or less certainty.\nSee the section about \"Importing\".\n\nSo that part is \"easy\", and it's what will happen. During optimization,\nwhen the module ``__import__`` expression is examined, it should say:\n\n-  ``ctypes`` is a module\n\n-  ``ctypes`` is from standard library (if it is, might not be true)\n\n-  ``ctypes`` then has code behind it, called ``ModuleFriend`` that\n   knows things about it attributes, that should be asked.\n\nThe later is the generic interface, and the optimization should connect\nthe two, of course via package and module full names. It will need a\n``ModuleFriendRegistry``, from which it can be pulled. It would be nice\nif we can avoid ``ctypes`` to be loaded into Nuitka unless necessary, so\nthese need to be more like a plug-in, loaded only if necessary, i.e. the\nuser code actually uses ``ctypes``.\n\nComing back to the original expression, it also contains an assignment\nexpression, because it re-formulated to be more like this:\n\n.. code:: python\n\n   ctypes = __import__(\"ctypes\")\n\nThe assigned to object, simply gets the type inferred propagated as part\nof an SSA form. Ideally, we could be sure that nothing in the program\nchanges the variable, and therefore have only one version of that\nvariable.\n\nFor module variables, when the execution leaves the module to unknown\ncode, or unclear code, it might change the variable. Therefore, likely\nwe will often only assume that it could still be ``ctypes``, but also\nsomething else.\n\nDepending on how well we control module variable assignment, we can\ndecide this more of less quickly. With \"compiled modules\" types, the\nexpectation is that it's merely a quick C ``==`` comparison check. The\nmodule friend should offer code to allow a check if it applies, for\nuncertain cases.\n\nThen when we come to uses of it:\n\n.. code:: python\n\n   ctypes.c_int()\n\nAt this point, using SSA, we are more of less sure, that ``ctypes`` is\nat that point the module, and that we know what it's ``c_int`` attribute\nis, at compile time, and what it's call result is. We will use the\nmodule friend to help with that. It will attach knowledge about the\nresult of that expression during the SSA collection process.\n\nThis is more like a value forward propagation than anything else. In\nfact, constant propagation should only be the special case of it, and\none design goal of Nuitka was always to cover these two cases with the\nsame code.\n\nExcursion to Functions\n======================\n\nIn order to decide what this means to functions and their call\nboundaries, if we propagate forward, how to handle this:\n\n.. code:: python\n\n   def my_append(a, b):\n       a.append(b)\n\n       return a\n\nWe annotate that ``a`` is first a \"unknown but defined parameter\nobject\", then later on something that definitely has an ``append``\nattribute, when returned, as otherwise an exception occurs.\n\nThe type of ``a`` changes to that after ``a.append`` look-up succeeds.\nIt might be many kinds of an object, but e.g. it could have a higher\nprobability of being a ``PyListObject``. And we would know it cannot be\na ``PyStringObject``, as that one has no ``append`` method, and would\nhave raised an exception therefore.\n\n.. note::\n\n   If classes, i.e. other types in the program, have an ``append``\n   attribute, it should play a role too, there needs to be a way to\n   plug-in to this decisions.\n\n.. note::\n\n   On the other hand, types without ``append`` attribute can be\n   eliminated.\n\nTherefore, functions through SSA provide an automatic analysis on their\nreturn state, or return value types, or a quick way to predict return\nvalue properties, based on input value knowledge.\n\nSo this could work:\n\n.. code:: python\n\n   b = my_append([], 3)\n\n   assert b == [3]  # Could be decided now\n\nGoal: The structure we use makes it easy to tell what ``my_append`` may\nbe. So, there should be a means to ask it about call results with given\ntype/value information. We need to be able to tell, if evaluating\n``my_append`` makes sense with given parameters or not, if it does\nimpact the return value.\n\nWe should e.g. be able to make ``my_append`` tell, one or more of these:\n\n-  Returns the first parameter value as return value (unless it raises\n   an exception).\n\n-  The return value has the same type as ``a`` (unless it raises an\n   exception).\n\n-  The return value has an ``append`` attribute.\n\n-  The return value might be a ``list`` object.\n\n-  The return value may not be a ``str`` object.\n\n-  The function will raise if first argument has no ``append``\n   attribute.\n\nThe exactness of statements may vary. But some things may be more\ninteresting. If e.g. the aliasing of a parameter value to the return\nvalue is known exactly, then information about it need to all be given\nup, but some can survive.\n\nIt would be nice, if ``my_append`` had sufficient information, so we\ncould specialize with ``list`` and ``int`` from the parameters, and then\ne.g. know at least some things that it does in that case. Such\nspecialization would have to be decided if it makes sense. In the\nalternative, it could be done for each variant anyway, as there won't be\nthat many of them.\n\nDoing this \"forward\" analysis appears to be best suited for functions\nand therefore long term. We will try it that way.\n\nExcursion to Loops\n==================\n\n.. code:: python\n\n   a = 1\n\n   while 1:  # think loop: here\n       b = a + 1\n       a = b\n\n       if cond():\n           break\n\n   print(a)\n\nThe handling of loops (both ``for`` and ``while`` are re-formulated to\nthis kind of loops with ``break`` statements) has its own problem. The\nloop start and may have an assumption from before it started, that ``a``\nis constant, but that is only true for the first iteration. So, we can't\npass knowledge from outside loop forward directly into the for loop\nbody.\n\nSo the collection for loops needs to be two pass for loops. First, to\ncollect assignments, and merge these into the start state, before\nentering the loop body. The need to make two passes is special to loops.\n\nFor a start, it is done like this. At loop entry, all pre-existing, but\nwritten traces, are turned into loop merges. Knowledge is not completely\nremoved about everything assigned or changed in the loop, but then it's\nnot trusted anymore.\n\nFrom that basis, the ``break`` exits are analysed, and merged, building\nup the post loop state, and ``continue`` exits of the loop replacing the\nunknown part of the loop entry state. The loop end is considered a\n``continue`` for this purpose.\n\nExcursion to Conditions\n=======================\n\n.. code:: python\n\n   if cond:\n       x = 1\n   else:\n       x = 2\n\n   b = x < 3\n\nThe above code contains a condition, and these have the problem, that\nwhen exiting the conditional block, a merge must be done, of the ``x``\nversions. It could be either one. The merge may trace the condition\nunder which a choice is taken. That way, we could decide pairs of traces\nunder the same condition.\n\nThese merges of SSA variable \"versions\", represent alternative values.\nThey pose difficulties, and might have to be reduced to commonality. In\nthe above example, the ``<`` operator will have to check for each\nversion, and then to decide that both indeed give the same result.\n\nThe trace collection tracks variable changes in conditional branches,\nand then merges the existing state at conditional statement exits.\n\n.. note::\n\n   A branch is considered \"exiting\" if it is not abortive. Should it end\n   in a ``raise``, ``break``, ``continue``, or ``return``, there is no\n   need to merge that branch, as execution of that branch is terminated.\n\n   Should both branches be abortive, that makes things really simple, as\n   there is no need to even continue.\n\n   Should only one branch exist, but be abortive, then no merge is\n   needed, and the collection can assume after the conditional\n   statement, that the branch was not taken, and continue.\n\nWhen exiting both the branches, these branches must both be merged, with\ntheir new information.\n\nIn the above case:\n\n-  The \"yes\" branch knows variable ``x`` is an ``int`` of constant value\n   ``1``\n\n-  The \"no\" branch knows variable ``x`` is an ``int`` of constant value\n   ``2``\n\nThat might be collapsed to:\n\n-  The variable ``x`` is an integer of value in ``(1,2)``\n\nGiven this, we then should be able to pre-compute the value of this:\n\n.. code:: python\n\n   b = x < 3\n\nThe comparison operator can therefore decide and tell:\n\n-  The variable ``b`` is a boolean of constant value ``True``.\n\nWere it unable to decide, it would still be able to say:\n\n-  The variable ``b`` is a boolean.\n\nFor conditional statements optimization, it's also noteworthy, that the\ncondition is known to pass or not pass the truth check, inside branches,\nand in the case of non-exiting single branches, after the statement it's\nnot true.\n\nWe may want to take advantage of it. Consider e.g.\n\n.. code:: python\n\n   if type(a) is list:\n       a.append(x)\n   else:\n       a += (x,)\n\nIn this case, the knowledge that ``a`` is a list, could be used to\ngenerate better code and with the definite knowledge that ``a`` is of\ntype list. With that knowledge the ``append`` attribute call will become\nthe ``list`` built-in type operation.\n\nExcursion to ``return`` statements\n==================================\n\nThe ``return`` statement (like ``break``, ``continue``, ``raise``) is\n\"aborting\" to control flow. It is always the last statement of inspected\nblock. When there statements to follow it, optimization will remove it\nas \"dead code\".\n\nIf all branches of a conditional statement are \"aborting\", the statement\nis decided \"aborting\" too. If a loop doesn't abort with a break, it\nshould be considered \"aborting\" too.\n\nExcursion to ``yield`` expressions\n==================================\n\nThe ``yield`` expression can be treated like a normal function call, and\nas such invalidates some known constraints just as much as they do. It\nexecutes outside code for an unknown amount of time, and then returns,\nwith little about the outside world known anymore, if it's accessible\nfrom there.\n\nMixed Types\n===========\n\nConsider the following inside a function or module:\n\n.. code:: python\n\n   if cond is not None:\n       a = [x for x in something() if cond(x)]\n   else:\n       a = ()\n\nA programmer will often not make a difference between ``list`` and\n``tuple``. In fact, using a ``tuple`` is a good way to express that\nsomething won't be changed later, as these are mutable.\n\n.. note::\n\n   Better programming style, would be to use this:\n\n   .. code:: python\n\n      if cond is not None:\n          a = tuple(x for x in something() if cond(x))\n      else:\n          a = ()\n\n   People don't do it, because they dislike the performance hit\n   encountered by the generator expression being used to initialize the\n   tuple. But it would be more consistent, and so Nuitka is using it,\n   and of course one day Nuitka ought to be able to make no difference\n   in performance for it.\n\nTo Nuitka though this means, that if ``cond`` is not predictable, after\nthe conditional statement we may either have a ``tuple`` or a ``list``\ntype object in ``a``. In order to represent that without resorting to \"I\nknow nothing about it\", we need a kind of ``min``/``max`` operating\nmechanism that is capable of say what is common with multiple\nalternative values.\n\n.. note::\n\n   At this time, we don't really have that mechanism to find the\n   commonality between values.\n\nBack to \"ctypes\"\n================\n\n.. code:: python\n\n   v = ctypes.c_int()\n\nComing back to this example, we needed to propagate ``ctypes``, then we\ncan propagate \"something\" from ``ctypes.int`` and then known what this\ngives with a call and no arguments, so the walk of the nodes, and\ndiverse operations should be addressed by a module friend.\n\nIn case a module friend doesn't know what to do, it needs to say so by\ndefault. This should be enforced by a base class and give a warning or\nnote.\n\nNow to the interface\n====================\n\nThe following is the intended interface:\n\n-  Iteration with node methods ``computeStatement`` and\n   ``computeExpression``.\n\n   These traverse modules and functions (i.e. scopes) and visit\n   everything in the order that Python executes it. The visiting object\n   is ``TraceCollection`` and pass forward. Some node types, e.g.\n   ``StatementConditional`` new create branch trace collections and\n   handle the SSA merging at exit.\n\n-  Replacing nodes during the visit.\n\n   Both ``computeStatement`` and ``computeExpression`` are tasked to\n   return potential replacements of themselves, together with \"tags\"\n   (meaningless now), and a \"message\", used for verbose tracing.\n\n   The replacement node of ``+`` operator, may e.g. be the pre-computed\n   constant result, wrapped in side effects of the node, or the\n   expression raised, again wrapped in side effects.\n\n-  Assignments and references affect SSA.\n\n   The SSA tree is initialized every time a scope is visited. Then\n   during traversal, traces are built up. Every assignment and merge\n   starts a new trace for that matter. References to a given variable\n   version are traced that way.\n\n-  Value escapes are traced too.\n\n   When an operation hands over a value to outside code, it indicates so\n   to the trace collection. This is for it to know, when e.g. a constant\n   value, might be mutated meanwhile.\n\n-  Nodes can be queried about their properties.\n\n   There is a type shape and a value shape that each node can be asked\n   about. The type shape offers methods that allow to check if certain\n   operations are at all supported or not. These can always return\n   ``True`` (yes), ``False`` (no), and ``None`` (cannot decide). In the\n   case of the later, optimizations may not be able do much about it.\n   Lets call these values \"tri-state\".\n\n   There is also the value shape of a node. This can go deeper, and be\n   more specific to a given node.\n\n   The default implementation will be very pessimistic. Specific node\n   types and shapes may then declare, that they e.g. have no side\n   effects, will not raise for certain operations, have a known truth\n   value, have a known iteration length, can predict their iteration\n   values, etc.\n\n-  Nodes are linked to certain states.\n\n   During the collect, a variable reference, is linked to a certain\n   trace state, and that can be used by parent operations.\n\n   .. code:: python\n\n      a = 1\n      b = a + a\n\n   In this example, the references to ``a``, can look-up the ``1`` in\n   the trace, and base value shape response to ``+`` on it. For compile\n   time evaluation, it may also ask ``isCompileTimeConstant()`` and if\n   both nodes will respond ``True``, then \"getCompileTimeConstant()\"\n   will return ``1``, which will be be used in computation.\n\n   Then ``extractSideEffects()`` for the ``a`` reference will return\n   ``()`` and therefore, the result ``2`` will not be wrapped.\n\n   An alternative approach would be ``hasTypeSlotAdd()`` on the both\n   nodes, and they both do, to see if the selection mechanism used by\n   CPython can be used to find which types ``+`` should be used.\n\n-  Class for module import expression ``ExpressionImportModule``.\n\n   This one just knows that something is imported, but not how or what\n   it is assigned to. It will be able in a recursive compile, to provide\n   the module as an assignment source, or the module variables or\n   submodules as an attribute source when referenced from a variable\n   trace or in an expression.\n\n-  Base class for module friend ``ModuleFriendBase``.\n\n   This is intended to provide something to overload, which e.g. can\n   handle ``math`` in a better way.\n\n-  Module ``ModuleFriendRegistry``\n\n   Provides a register function with ``name`` and instances of\n   ``ValueFriendModuleBase`` to be registered. Recursed to modules\n   should integrate with that too. The registry could well be done with\n   a metaclass approach.\n\n-  The module friends should each live in a module of their own.\n\n   With a naming policy to be determined. These modules should add\n   themselves via above mechanism to ``ModuleFriendRegistry`` and all\n   shall be imported and register. Importing of e.g. ``ctypes`` should\n   be delayed to when the friend is actually used. A meta class should\n   aid this task.\n\n   The delay will avoid unnecessary blot of the compiler at run time, if\n   no such module is used. For \"qt\" and other complex stuff, this will\n   be a must.\n\n-  The walk should initially be single pass, and not maintain history.\n\n   Instead optimization that needs to look at multiple things, e.g.\n   \"unused assignment\", will look at the whole SSA collection\n   afterwards.\n\nDiscussing with examples\n========================\n\nThe following examples:\n\n.. code:: python\n\n   # Assignment, the source decides the type of the assigned expression\n   a = b\n\n   # Operator \"attribute look-up\", the looked up expression \"ctypes\" decides\n   # via its trace.\n   ctypes.c_int\n\n   # Call operator, the called expressions decides with help of arguments,\n   # which have been walked, before the call itself.\n   called_expression_of_any_complexity()\n\n   # import gives a module any case, and the \"ModuleRegistry\" may say more.\n   import ctypes\n\n   # From import need not give module, \"x\" decides what it is.\n   from x import y\n\n   # Operations are decided by arguments, and CPython operator rules between\n   # argument states.\n   a + b\n\nThe optimization is mostly performed by walking of the tree and\nperforming trace collection. When it encounters assignments and\nreferences to them, it considers current state of traces and uses it for\n``computeExpression``.\n\n.. note::\n\n   Assignments to attributes, indexes, slices, etc. will also need to\n   follow the flow of ``append``, so it cannot escape attention that a\n   list may be modified. Usages of ``append`` that we cannot be sure\n   about, must be traced to exist, and disallow the list to be\n   considered known value again.\n\nCode Generation Impact\n======================\n\nRight now, code generation assumes that everything is a ``PyObject *``,\ni.e. a Python object, and does not take knowledge of ``int`` or other\ntypes into consideration at all, and it should remain like that for some\ntime to come.\n\nInstead, ``ctypes`` value friend will be asked give ``Identifiers``,\nlike other codes do too. And these need to be able to convert themselves\nto objects to work with the other things.\n\nBut Code Generation should no longer require that operations must be\nperformed on that level. Imagine e.g. the following calls:\n\n.. code:: python\n\n   c_call(other_c_call())\n\nValue returned by \"other_c_call()\" of say ``c_int`` type, should be\npossible to be fed directly into another call. That should be easy by\nhaving a ``asIntC()`` in the identifier classes, which the ``ctypes``\nIdentifiers handle without conversions.\n\nCode Generation should one day also become able to tell that all uses of\na variable have only ``c_int`` value, and use ``int`` instead of\n``PyObjectLocalVariable`` more or less directly. We could consider\n``PyIntLocalVariable`` of similar complexity as ``int`` after the C++\ncompiler performed its in-lining.\n\nSuch decisions would be prepared by finalization, which then would track\nthe history of values throughout a function or part of it.\n\nInitial Implementation\n======================\n\nThe basic interface will be added to *all* expressions and a node may\noverride it, potentially using trace collection state, as attached\nduring ``computeExpression``.\n\nGoal 1 (Reached)\n----------------\n\nInitially most things will only be able to give up on about anything.\nAnd it will be little more than a tool to do simple look-ups in a\ngeneral form. It will then be the first goal to turn the following code\ninto better performing one:\n\n.. code:: python\n\n   a = 3\n   b = 7\n   c = a / b\n   print(c)\n\nto:\n\n.. code:: python\n\n   a = 3\n   b = 7\n   c = 3 / 7\n   print(c)\n\nand then:\n\n.. code:: python\n\n   a = 3\n   b = 7\n   c = 0\n   print(c)\n\nand then:\n\n.. code:: python\n\n   a = 3\n   b = 7\n   c = 0\n   print(0)\n\nThis depends on SSA form to be able to tell us the values of ``a``,\n``b``, and ``c`` to be written to by constants, which can be forward\npropagated at no cost.\n\nGoal 2 (Reached)\n----------------\n\nThe assignments to ``a``, ``b``, and ``c`` shall all become prey to\n\"unused\" assignment analysis in the next step. They are all only\nassigned to, and the assignment source has no effect, so they can be\nsimply dropped.\n\n.. code:: python\n\n   print(0)\n\nIn the SSA form, these are then assignments without references. These\nassignments, can be removed if the assignment source has no side effect.\nOr at least they could be made \"anonymous\", i.e. use a temporary\nvariable instead of the named one. That would have to take into account\nthough, that the old version still needs a release.\n\nThe most general form would first merely remove assignments that have no\nimpact, and leave the value as a side effect, so we arrive at this\nfirst:\n\n.. code:: python\n\n   3\n   7\n   0\n   print(0)\n\nWhen applying the removal of expression only statements without effect,\nthis gives us:\n\n.. code:: python\n\n   print(0)\n\nwhich is the perfect result. Doing it in one step would only be an\noptimization at the cost of generalization.\n\nIn order to be able to manipulate nodes related to a variable trace, we\nneed to attach the nodes that did it. Consider this:\n\n.. code:: python\n\n   if cond():\n       x = 1\n   elif other():\n       x = 3\n\n   # Not using \"x\".\n   print(0)\n\nIn the above case, the merge of the value traces, should say that ``x``\nmay be undefined, or one of ``1`` or ``3``, but since ``x`` is not used,\napply the \"dead value\" trick to each branch.\n\nThe removal of the \"merge\" of the 3 ``x`` versions, should exhibit that\nthe other versions are also only assigned to, and can be removed. These\nmerges of course appear as usages of the ``x`` versions.\n\nGoal 3\n------\n\nThen third goal is to understand all of this:\n\n.. code:: python\n\n   def f():\n       a = []\n\n       print(a)\n\n       for i in range(1000):\n           print(a)\n\n           a.append(i)\n\n       return len(a)\n\n.. note::\n\n   There are many operations in this, and all of them should be properly\n   handled, or at least ignored in safe way.\n\nThe first goal code gave us that the ``list`` has an annotation from the\nassignment of ``[]`` and that it will be copied to ``a`` until the for\nloop in encountered. Then it must be removed, because the ``for`` loop\nsomehow says so.\n\nThe ``a`` may change its value, due to the unknown attribute look-up of\nit already, not even the call. The for loop must be able to say \"may\nchange value\" due to that, of course also due to the call of that\nattribute too.\n\nThe code should therefore become equivalent to:\n\n.. code:: python\n\n   def f():\n       a = []\n\n       print([])\n\n       for i in range(1000):\n           print(a)\n\n           a.append(i)\n\n       return len(a)\n\nBut no other changes must occur, especially not to the ``return``\nstatement, it must not assume ``a`` to be constant \"[]\" but an unknown\n``a`` instead.\n\nWith that, we would handle this code correctly and have some form\nconstant value propagation in place, handle loops at least correctly,\nand while it is not much, it is important demonstration of the concept.\n\nGoal 4\n------\n\nThe fourth goal is to understand the following:\n\n.. code:: python\n\n   def f(cond):\n       y = 3\n\n       if cond:\n           x = 1\n       else:\n           x = 2\n\n       return x < y\n\nIn this we have a branch, and we will be required to keep track of both\nthe branches separately, and then to merge with the original knowledge.\nAfter the conditional statement we will know that \"x\" is an \"int\" with\npossible values in ``(1,2)``, which can be used to predict that the\nreturn value is always ``True``.\n\nThe fourth goal will therefore be that the \"ValueFriendConstantList\"\nknows that append changes ``a`` value, but it remains a list, and that\nthe size increases by one. It should provide an other value friend\n\"ValueFriendList\" for \"a\" due to that.\n\nIn order to do that, such code must be considered:\n\n.. code:: python\n\n   a = []\n\n   a.append(1)\n   a.append(2)\n\n   print(len(a))\n\nIt will be good, if ``len`` still knows that ``a`` is a list object, but\nnot the constant list anymore.\n\nFrom here, work should be done to demonstrate the correctness of it with\nthe basic tests applied to discover undetected issues.\n\nFifth and optional goal: Extra bonus points for being able to track and\npredict ``append`` to update the constant list in a known way. Using\n``list.append`` that should be done and lead to a constant result of\n``len`` being used.\n\nThe sixth and challenging goal will be to make the code generation be\nimpacted by the value friends types. It should have a knowledge that\n``PyList_Append`` does the job of append and use ``PyList_Size`` for\n``len``. The \"ValueFriends\" should aid the code generation too.\n\nLast and right now optional goal will be to make ``range`` have a value\nfriend, that can interact with iteration of the for loop, and ``append``\nof the ``list`` value friend, so it knows it's possible to iterate 5000\ntimes, and that \"a\" has then after the \"loop\" this size, so ``len(a)``\ncould be predicted. For during the loop, about a the range of its length\nshould be known to be less than 5000. That would make the code of goal 2\ncompletely analyzed at compile time.\n\nLimitations for now\n===================\n\n-  Aim only for limited examples. For ``ctypes`` that means to compile\n   time evaluate:\n\n   .. code:: python\n\n      print(ctypes.c_int(17) + ctypes.c_long(19))\n\n   Later then call to \"libc\" or something else universally available,\n   e.g. \"strlen()\" or \"strcmp()\" from full blown declarations of the\n   callable.\n\n-  We won't have the ability to test that optimization are actually\n   performed, we will check the generated code by hand.\n\n   With time, we will add XML based checks with \"xpath\" queries,\n   expressed as hints, but that is some work that will be based on this\n   work here. The \"hints\" fits into the \"ValueFriends\" concept nicely or\n   so the hope is.\n\n-  No inter-function optimization functions yet\n\n   Of course, once in place, it will make the ``ctypes`` annotation even\n   more usable. Using ``ctypes`` objects inside functions, while\n   creating them on the module level, is therefore not immediately going\n   to work.\n\n-  No loops yet\n\n   Loops break value propagation. For the ``ctypes`` use case, this\n   won't be much of a difficulty. Due to the strangeness of the task, it\n   should be tackled later on at a higher priority.\n\n-  Not too much.\n\n   Try and get simple things to work now. We shall see, what kinds of\n   constraints really make the most sense. Understanding ``list``\n   subscript/slice values e.g. is not strictly useful for much code and\n   should not block us.\n\n.. note::\n\n   This design is not likely to be the final one.\n\n***********************************\n How to make Features Experimental\n***********************************\n\nEvery experimental feature needs a name. We have a rule to pick a name\nwith lower case and ``_`` as separators. An example of with would be the\nname ``jinja_generated_add`` that has been used in the past.\n\nCommand Line\n============\n\nExperimental features are enabled with the command line argument\n\n.. code:: bash\n\n   nuitka --experimental=jinja_generated_add ...\n\nIn C code\n=========\n\nIn Scons, all experimental features automatically are converted into C\ndefines, and can be used like this:\n\n.. code:: C\n\n   #ifdef _NUITKA_EXPERIMENTAL_JINJA_GENERATED_ADD\n   #include \"HelpersOperationGeneratedBinaryAdd.c\"\n   #else\n   #include \"HelpersOperationBinaryAdd.c\"\n   #endif\n\nThe C pre-processor is the only thing that makes an experimental feature\nusable.\n\nIn Python\n=========\n\nYou can query experimental features using ``Options.isExperimental()``\nwith e.g. code like this:\n\n.. code:: python\n\n   if Options.isExperimental(\"use_feature\"):\n       experimental_code()\n   else:\n       standard_code()\n\nWhen to use it\n==============\n\nOften we need to keep feature in parallel because they are not finished,\nor need to be tested after merge and should not break. Then we can do\ncode changes that will not make a difference except when the\nexperimental flag is given on the command line to Nuitka.\n\nThe testing of Nuitka is very heavy weight when e.g. all Python code is\ncompiled, and very often, it is interesting to compare behavior with and\nwithout a change.\n\nWhen to remove it\n=================\n\nWhen a feature becomes default, we might choose to keep the old variant\naround, but normally we do not. Then we remove the ``if`` and ``#if``\nchecks and drop the old code.\n\nAt this time, large scale testing will have demonstrated the viability\nof the code.\n\n*******************************\n Adding dependencies to Nuitka\n*******************************\n\nFirst of all, there is an important distinction to make, run time or\ndevelopment time. The first kind of dependency is used when Nuitka is\nexecuting.\n\nAdding a Run Time Dependency\n============================\n\nThis is the kind of dependency that is the most scrutinized. As we want\nNuitka to run on latest greatest Python as well as relatively old ones,\nwe have to be very careful with these ones.\n\nThere is also a distinction of optional dependencies. Right now e.g. the\n``lxml`` package is relatively optional, and Nuitka can work without it\nbeing installed, because e.g. on some platforms it will not be easy to\ndo so. That bar has lifted somewhat, but it means e.g. that XML based\noptimization tests are not run with all Python versions.\n\nThe list of run time dependencies is in ``requirements.txt`` and it is\nfor those the case, that they are not really required to be installed by\nthe user, consider this snippet:\n\n.. code:: python\n\n   # Folders to use for cache files.\n   appdirs\n\n   # Scons is the backend building tool to turn C files to binaries.\n   scons\n\nFor both these dependencies, there is either an inline copy (Scons) that\nwe handle to use in case, if Scons is not available (in fact we have a\nversion that works with Python 2.6 and 2.7 still), and also the same for\nappdirs and every dependency.\n\nBut since inline copies are against the rules on some platforms that\nstill do not contain the package, we often even have our own wrapper\nwhich provides a minimal fallback or exposes a sane interface for the\nsubset of functionality that we use.\n\n.. note::\n\n   Therefore, please if you consider adding one of these, get in touch\n   with ``@Nuitka-pushers`` first and get a green light.\n\nAdding a Development Dependency\n===============================\n\nA typical example of a development dependency is ``black`` which is used\nby our autoformat tool, and then in turn by the git pre-commit hook. It\nis used to format source code, and doesn't have a role at run time of\nthe actual compiler code of Nuitka.\n\nMuch less strict rules apply to these in comparison to runtime\ndependencies. Generally please take care that the tool must be well\nmaintained an available on newer Pythons. Then we can use it, no problem\nnormally. But if it's really big, say all of SciPy, we might want to\njustify it a bit better.\n\nThe list of development dependencies is in ``requirements-devel.txt``\nand it is for example like this:\n\n.. code:: python\n\n   # Autoformat needs this\n   rstfmt == 0.0.10 ; python_version >= '3.7'\n\nWe always add the version, so that when tests run on as old versions as\nPython 2.6, the installation would fail with that version, so we need to\nmake a version requirement. Sometimes we use older versions for Python2\nthan for Python3, ``Jinaj2`` being a notable candidate, but generally we\nought to avoid that. For many tools only being available for currently\n3.7 or higher is good enough, esp. if they are run as development tools,\nlike ``autoformat-nuitka-source`` is.\n\n**********\n Idea Bin\n**********\n\nThis an area where to drop random ideas on our minds, to later sort it\nout, and out it into action, which could be code changes, plan changes,\nissues created, etc.\n\n-  Make \"SELECT_METACLASS\" meta class selection transparent.\n\n   Looking at the \"SELECT_METACLASS\" it should become an anonymous\n   helper function. In that way, the optimization process can remove\n   choices at compile time, and e.g. in-line the effect of a meta class,\n   if it is known.\n\n   This of course makes most sense, if we have the optimizations in\n   place that will allow this to actually happen.\n\n-  Keeping track of iterations\n\n   The trace collection trace should become the place, where variables\n   or values track their use state. The iterator should keep track of\n   the \"next()\" calls made to it, so it can tell which value to given in\n   that case.\n\n   That would solve the \"iteration of constants\" as a side effect and it\n   would allow to tell that they can be removed.\n\n   That would mean to go back in the tree and modify it long after.\n\n   .. code:: python\n\n      a = iter((2, 3))\n      b = next(a)\n      c = next(a)\n      del a\n\n   It would be sweet if we could recognize that as:\n\n   .. code:: python\n\n      a = iter((2, 3))\n      b = side_effect(next(a), 2)\n      c = side_effect(next(a), 3)\n      del a\n\n   That trivially becomes:\n\n   .. code:: python\n\n      a = iter((2, 3))\n      next(a)\n      b = 2\n      next(a)\n      c = 3\n      del a\n\n   When the ``del a`` is examined at the end of scope, or due to another\n   assignment to the same variable, ending the trace, we would have to\n   consider of the ``next`` uses, and retrofit the information that they\n   had no effect.\n\n   .. code:: python\n\n      a = iter((2, 3))\n      b = 2\n      b = 3\n      del a\n\n-  Aliasing\n\n   Each time an assignment is made, an alias is created. A value may\n   have different names.\n\n   .. code:: python\n\n      a = iter(range(9))\n      b = a\n      c = next(b)\n      d = next(a)\n\n   If we fail to detect the aliasing nature, we will calculate ``d``\n   wrongly. We may incref and decref values to trace it.\n\n   Aliasing is automatically traced already in SSA form. The ``b`` is\n   assigned to version of ``a``. So, that should allow to replace it\n   with this:\n\n   .. code:: python\n\n      a = iter(range(9))\n      c = next(a)\n      d = next(a)\n\n   Which then will be properly handled.\n\n-  Tail recursion optimization.\n\n   Functions that return the results of calls, can be optimized. The\n   Stackless Python does it already.\n\n-  Integrate with \"upx\" compression.\n\n   Calling \"upx\" on the created binaries, would be easy.\n\n-  In-lining constant \"exec\" and \"eval\".\n\n   It should be possible to re-formulate at least cases without \"locals\"\n   or \"globals\" given.\n\n   .. code:: python\n\n      def f():\n          a = 1\n          b = 2\n\n          exec(\"\"\"a+=b;c=1\"\"\")\n\n          return a, c\n\n   Should become this here:\n\n   .. code:: python\n\n      def f():\n          a = 1\n          b = 2\n\n          a += b  #\n          c = 1  # MaybeLocalVariables for everything except known local ones.\n\n          return a, c\n\n   If this holds up, inlining ``exec`` should be relatively easy.\n\n-  Original and overloaded built-ins\n\n   This is about making things visible in the node tree. In Nuitka\n   things that are not visible in the node tree tend to be wrong. We\n   already pushed around information to the node tree a lot.\n\n   Later versions, Nuitka will become able to determine it has to be the\n   original built-in at compile time, then a condition that checks will\n   be optimized away, together with the slow path. Or the other path, if\n   it won't be. Then it will be optimized away, or if doubt exists, it\n   will be correct. That is the goal.\n\n   Right now, the change would mean to effectively disable all built-in\n   call optimization, which is why we don't immediately do it.\n\n   Making the compatible version, will also require a full listing of\n   all built-ins, which is typing work merely, but not needed now. And a\n   way to stop built-in optimization from optimizing built-in calls that\n   it used in a wrap. Probably just some flag to indicate it when it\n   visits it to skip it. That's for later.\n\n   But should we have that both, I figure, we could not raise a\n   ``RuntimeError`` error, but just do the correct thing, in all cases.\n   An earlier step may raise ``RuntimeError`` error, when built-in\n   module values are written to, that we don't support.\n\n******************\n Prongs of Action\n******************\n\nIn this chapter, we keep track of prongs of action currently ongoing.\nThis can get detailed and shows things we strive for.\n\nBuiltin optimization\n====================\n\nDefinitely want to get built-in names under full control, so that\nvariable references to module variables do not have a twofold role.\nCurrently they reference the module variable and also the potential\nbuilt-in as a fallback.\n\nIn terms of generated code size and complexity for modules with many\nvariables and uses of them that is horrible. But ``some_var`` (normally)\ncannot be a built-in and therefore needs no code to check for that each\ntime.\n\nThis is also critical to getting to whole program optimization. Being\ncertain what is what there on module level, will enable more definitely\nknowledge about data flows and module interfaces.\n\nClass Creation Overhead Reduction\n=================================\n\nThis is more of a meta goal. Some work for the metaclass has already\nbeen done, but that is Python2 only currently. Being able to to decide\nbuilt-ins and to distinguish between global only variables, and\nbuilt-ins more clearly will help this a lot.\n\nIn the end, empty classes should be able to be statically converted to\ncalls to ``type`` with static dictionaries. The inlining of class\ncreation function is also needed for this, but on Python3 cannot happen\nyet.\n\nMemory Usage at Compile Time\n============================\n\nWe will need to store more and more information in the future. Getting\nthe tree to be tight shaped is therefore an effort, where we will be\nspending time too.\n\nThe mix-ins prevent slots usage, so lets try and get rid of those. The\n\"children having\" should become more simple and faster code. I am even\nthinking of even generating code in the meta class, so it's both optimal\nand doesn't need that mix-in any more. This is going to be ugly then.\n\nCoverage Testing\n================\n\nAnd then there is coverage, it should be taken and merged from all\nPython versions and OSes, but I never managed to merge between Windows\nand Linux for unknown reasons.\n\nPython3 Performance\n===================\n\nThe Python3 lock for thread state is making it slower by a lot. I have\nonly experimental code that just ignores the lock, but it likely only\nworks on Linux, and I wonder why there is that lock in the first place.\n\nIgnoring the locks cannot be good. But what updates that thread state\npointer ever without a thread change, and is this what ABI flags are\nabout in this context, are there some that allow us to ignore the locks.\n\nAn important bit would be to use a thread state once acquired for as\nmuch as possible, currently exception helpers do not accept it as an\nargument, but that ought to become an option, that way saving and\nrestoring an exception will be much faster, not to mention checking and\ndropping non interesting, or rewriting exceptions.\n\nCaching of Python level compilation\n===================================\n\nWhile the C compilation result is already cached with `ccache` and\nfriends now, we need to also cover our bases and save the resulting node\ntree of potential expensive optimization on the module level.\n\n*************************\n Updates for this Manual\n*************************\n\nThis document is written in REST. That is an ASCII format which is\nreadable to human, but easily used to generate PDF or HTML documents.\n\nYou will find the current source under:\nhttps://github.com/Nuitka/Nuitka/blob/develop/Developer_Manual.rst\n\nAnd the current PDF under: https://nuitka.net/doc/Developer_Manual.pdf\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright © 2010-2019 Kay Hayen\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "# Spell checking makes no sense, spell-checker: disable\n\ninclude LICENSE.txt\ninclude MANIFEST.in\ninclude README.rst\ninclude Changelog.rst\ninclude Developer_Manual.rst\ninclude doc/nuitka.1\ninclude doc/nuitka-run.1\n\ninclude bin/compare_with_cpython\ninclude bin/compare_with_xml\ninclude bin/check-nuitka-with-pylint\ninclude bin/autoformat-nuitka-source\ninclude bin/measure-construct-performance\n\n# Runners, mainly for source distribution.\ninclude bin/nuitka\ninclude bin/nuitka-run\n\ninclude misc/*.bat\ninclude tests/run-tests\n\ninclude nuitka/plugins/standard/*.yml\n\n# Logo with source\ninclude doc/Logo/Nuitka-Logo-Symbol.svg\ninclude doc/Logo/Nuitka-Logo-Vertical.svg\ninclude doc/Logo/Nuitka-Logo-Horizontal.svg\ninclude doc/images/Nuitka-Logo-Symbol.png\ninclude doc/images/Nuitka-Logo-Vertical.png\ninclude doc/images/Nuitka-Logo-Horizontal.png\n\nrecursive-include lib *.py\n\n# Core tests are included along with Nuitka itself.\nrecursive-include tests/basics *.py\nrecursive-include tests/syntax *.py\nrecursive-include tests/packages *.py\nrecursive-include tests/programs *.py\ninclude tests/programs/pkgutil_usage/package/DATA_FILE*.txt\ninclude tests/programs/resource_reader37/some_package/DATA_FILE*.txt\nrecursive-include tests/optimizations *.py\nrecursive-include tests/standalone *.py\nrecursive-include tests/onefile *.py\nrecursive-include tests/reflected *.py\nrecursive-include tests/plugins *.py\nrecursive-include tests/plugins *.yml\ninclude tests/plugins/data_files/data_files_package/*.txt\ninclude tests/plugins/data_files/data_files_package/sub_dir/*.txt\n\n# C templates for code generation.\nrecursive-include nuitka/code_generation/templates_c *.j2\n\n# Report templates\nrecursive-include nuitka/reports *.j2\n"
  },
  {
    "path": "README.rst",
    "content": "####################\n Nuitka User Manual\n####################\n\nThis document is the recommended first read when you start using\n**Nuitka**. On this page, you will learn more about **Nuitka**\nfundamentals, such as license type, use cases, requirements, and\ncredits.\n\n.. contents:: Table of Contents\n   :depth: 1\n   :local:\n   :class: page-toc\n\nNuitka is **the** Python compiler. It is written in Python. It is a\nseamless replacement or extension to the Python interpreter and compiles\n**every** construct that Python 2 (2.6, 2.7) and Python 3 (3.4 - 3.11)\nhave, when itself run with that Python version.\n\nIt then executes uncompiled code and compiled code together in an\nextremely compatible manner.\n\nYou can use all Python library modules and all extension modules freely.\n\nNuitka translates the Python modules into a C level program that then\nuses ``libpython`` and static C files of its own to execute in the same\nway as CPython does.\n\nAll optimization is aimed at avoiding overhead, where it's unnecessary.\nNone is aimed at removing compatibility, although slight improvements\nwill occasionally be done, where not every bug of standard Python is\nemulated, e.g. more complete error messages are given, but there is a\nfull compatibility mode to disable even that.\n\n**************\n Requirements\n**************\n\nTo ensure smooth operation of **Nuitka**, make sure to follow system\nrequirements, that include the following components:\n\n.. contents::\n   :depth: 1\n   :local:\n\nC Compiler\n==========\n\nYou need a C compiler with support for C11 or alternatively a C++\ncompiler for C++03 [#]_.\n\nCurrently, this means, you need to use one of these compilers:\n\n-  The MinGW64 C11 compiler, on Windows, must be based on gcc 11.2 or\n   higher. It will be *automatically* downloaded if no usable C compiler\n   is found, which is the recommended way of installing it, as Nuitka\n   will also upgrade it for you.\n\n-  Visual Studio 2022 or higher on Windows [#]_. English language pack\n   for best results (Nuitka filters away garbage outputs, but only for\n   English language). It will be used by default if installed.\n\n-  On all other platforms, the ``gcc`` compiler of at least version 5.1,\n   and below that the ``g++`` compiler of at least version 4.4 as an\n   alternative.\n\n-  The ``clang`` compiler on macOS X and most FreeBSD architectures.\n\n-  On Windows, the ``clang-cl`` compiler on Windows can be used if\n   provided by the Visual Studio installer.\n\n.. [#]\n\n   Support for this C11 is given with gcc 5.x or higher or any clang\n   version.\n\n   The older MSVC compilers don't do it yet. But as a workaround, with\n   Python 3.10 or older, the C++03 language standard is significantly\n   overlapping with C11, it is then used instead.\n\n.. [#]\n\n   Download for free from\n   https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx\n   (the community editions work just fine).\n\n   The latest version is recommended, but not required. On the other hand,\n   there is no need to except to support pre-Windows 10 versions, and they\n   might work for you, but support of these configurations is only\n   available to commercial users.\n\nPython\n======\n\n**Python 2** (2.6, 2.7) and **Python 3** (3.4 — 3.11) are supported. If\nat any moment, there is a stable Python release that is not in this\nlist, rest assured it is being worked on and will be added.\n\n.. important::\n\n   For Python 3.4 and *only* that version, we need other Python version\n   as a *compile time* dependency.\n\n   Nuitka itself is fully compatible with all listed versions, but Scons\n   as an internally used tool is not.\n\n   For these versions, you *need* a Python2 or Python 3.5 or higher\n   installed as well, but only during the compile time. That is for use\n   with Scons (which orchestrates the C compilation), which does not\n   support the same Python versions as Nuitka.\n\n   In addition, on Windows, Python2 cannot be used because ``clcache``\n   does not work with it, there a Python 3.5 or higher needs to be\n   installed.\n\n   Nuitka finds these needed Python versions (e.g. on Windows via\n   registry) and you shouldn't notice it as long as they are installed.\n\n   Increasingly, other functionality is available when another Python\n   has a certain package installed. For example, onefile compression\n   will work for a Python 2.x when another Python is found that has the\n   ``zstandard`` package installed.\n\n.. admonition:: Moving binaries to other machines\n\n   The created binaries can be made executable independent of the Python\n   installation, with ``--standalone`` and ``--onefile`` options.\n\n.. admonition:: Binary filename suffix\n\n   The created binaries have an ``.exe`` suffix on Windows. On other\n   platforms they have no suffix for standalone mode, or ``.bin``\n   suffix, that you are free to remove or change, or specify with the\n   ``-o`` option.\n\n   The suffix for acceleration mode is added just to be sure that the\n   original script name and the binary name do not ever collide, so we\n   can safely overwrite the binary without destroying the original\n   source file.\n\n.. admonition:: It **has to** be CPython, Anaconda Python, or Homebrew\n\n   You need the standard Python implementation, called \"CPython\", to\n   execute Nuitka because it is closely tied to implementation details\n   of it.\n\n.. admonition:: It **cannot be** from the Windows app store\n\n   It is known that Windows app store Python definitely does not work,\n   it's checked against.\n\n.. admonition:: It **cannot be** pyenv on macOS\n\n   It is known that macOS \"pyenv\" does **not** work. Use Homebrew\n   instead for self compiled Python installations. But note that\n   standalone mode will be worse on these platforms and not be as\n   backward compatible with older macOS versions.\n\nOperating System\n================\n\nSupported Operating Systems: Linux, FreeBSD, NetBSD, macOS, and Windows\n(32 bits/64 bits/ARM).\n\nOthers will work as well. The portability is expected to be generally\ngood, but the e.g. Nuitka's internal Scons usage may have to be adapted\nor need flags passed. Make sure to match Python and C compiler\narchitecture, or else you will get cryptic error messages.\n\nArchitecture\n============\n\nSupported Architectures are x86, x86_64 (amd64), and arm, likely many,\nmany more.\n\nOther architectures are expected to also work, out of the box, as Nuitka\nis generally not using any hardware specifics. These are just the ones\ntested and known to be good. Feedback is welcome. Generally, the\narchitectures that Debian supports can be considered good and tested,\ntoo.\n\n*******\n Usage\n*******\n\nCommand Line\n============\n\nThe recommended way of executing Nuitka is ``<the_right_python> -m\nnuitka`` to be absolutely certain which Python interpreter you are\nusing, so it is easier to match with what Nuitka has.\n\nThe next best way of executing Nuitka bare that is from a source\ncheckout or archive, with no environment variable changes, most\nnoteworthy, you do not have to mess with ``PYTHONPATH`` at all for\nNuitka. You just execute the ``nuitka`` and ``nuitka-run`` scripts\ndirectly without any changes to the environment. You may want to add the\n``bin`` directory to your ``PATH`` for your convenience, but that step\nis optional.\n\nMoreover, if you want to execute with the right interpreter, in that\ncase, be sure to execute ``<the_right_python> bin/nuitka`` and be good.\n\n.. admonition:: Pick the right Interpreter\n\n   If you encounter a ``SyntaxError`` you absolutely most certainly have\n   picked the wrong interpreter for the program you are compiling.\n\nNuitka has a ``--help`` option to output what it can do:\n\n.. code:: bash\n\n   nuitka --help\n\nThe ``nuitka-run`` command is the same as ``nuitka``, but with a\ndifferent default. It tries to compile *and* directly execute a Python\nscript:\n\n.. code:: bash\n\n   nuitka-run --help\n\nThis option that is different is ``--run``, and passing on arguments\nafter the first non-option to the created binary, so it is somewhat more\nsimilar to what plain ``python`` will do.\n\nInstallation\n============\n\nFor most systems, there will be packages on the `download page\n<https://nuitka.net/doc/download.html>`__ of Nuitka. But you can also\ninstall it from source code as described above, but also like any other\nPython program it can be installed via the normal ``python setup.py\ninstall`` routine.\n\nNotice for integration with GitHub workflows there is this\n`Nuitka-Action <https://github.com/Nuitka/Nuitka-Action>`__ that you\nshould use that makes it really easy to integrate. You ought to start\nwith a local compilation though, but this will be easiest for cross\nplatform compilation with Nuitka.\n\nLicense\n=======\n\nNuitka is licensed under the Apache License, Version 2.0; you may not\nuse it except in compliance with the License.\n\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n*************************************\n Tutorial Setup and build on Windows\n*************************************\n\nThis is basic steps if you have nothing installed, of course if you have\nany of the parts, just skip it.\n\nSetup\n=====\n\nInstall Python\n--------------\n\n-  Download and install Python from\n   https://www.python.org/downloads/windows\n\n-  Select one of ``Windows x86-64 web-based installer`` (64 bits Python,\n   recommended) or ``x86 executable`` (32 bits Python) installer.\n\n-  Verify it's working using command ``python --version``.\n\nInstall Nuitka\n--------------\n\n-  ``python -m pip install nuitka``\n\n-  Verify using command ``python -m nuitka --version``\n\nWrite some code and test\n========================\n\nCreate a folder for the Python code\n-----------------------------------\n\n-  ``mkdir`` HelloWorld\n\n-  make a python file named **hello.py**\n\n.. code:: python\n\n   def talk(message):\n       return \"Talk \" + message\n\n\n   def main():\n       print(talk(\"Hello World\"))\n\n\n   if __name__ == \"__main__\":\n       main()\n\nTest your program\n-----------------\n\nDo as you normally would. Running Nuitka on code that works incorrectly\nis not easier to debug.\n\n.. code:: bash\n\n   python hello.py\n\n----\n\nBuild it using\n--------------\n\n.. code:: bash\n\n   python -m nuitka hello.py\n\n.. note::\n\n   This will prompt you to download a C caching tool (to speed up\n   repeated compilation of generated C code) and a MinGW64 based C\n   compiler, unless you have a suitable MSVC installed. Say ``yes`` to\n   both those questions.\n\nRun it\n------\n\nExecute the ``hello.exe`` created near ``hello.py``.\n\nDistribute\n----------\n\nTo distribute, build with ``--standalone`` option, which will not output\na single executable, but a whole folder. Copy the resulting\n``hello.dist`` folder to the other machine and run it.\n\nYou may also try ``--onefile`` which does create a single file, but make\nsure that the mere standalone is working, before turning to it, as it\nwill make the debugging only harder, e.g. in case of missing data files.\n\n***********\n Use Cases\n***********\n\nUse Case 1 — Program compilation with all modules embedded\n==========================================================\n\nIf you want to compile a whole program recursively, and not only the\nsingle file that is the main program, do it like this:\n\n.. code:: bash\n\n   python -m nuitka --follow-imports program.py\n\n.. note::\n\n   There are more fine-grained controls than ``--follow-imports``\n   available. Consider the output of ``nuitka --help``. Including fewer\n   modules into the compilation, but instead using normal Python for it,\n   will make it faster to compile.\n\nIn case you have a source directory with dynamically loaded files, i.e.\none which cannot be found by recursing after normal import statements\nvia the ``PYTHONPATH`` (which would be the recommended way), you can\nalways require that a given directory shall also be included in the\nexecutable:\n\n.. code:: bash\n\n   python -m nuitka --follow-imports --include-plugin-directory=plugin_dir program.py\n\n.. note::\n\n   If you don't do any dynamic imports, simply setting your\n   ``PYTHONPATH`` at compilation time is what you should do.\n\n   Use ``--include-plugin-directory`` only if you make ``__import__()``\n   calls that Nuitka cannot predict, and that come from a directory, for\n   everything from your Python installation, use ``--include-module`` or\n   ``--include-package``.\n\n.. note::\n\n   The resulting filename will be ``program.exe`` on Windows,\n   ``program.bin`` on other platforms, but ``--output-filename`` allows\n   changing that.\n\n.. note::\n\n   The resulting binary still depends on CPython and used C extension\n   modules being installed.\n\n   If you want to be able to copy it to another machine, use\n   ``--standalone`` and copy the created ``program.dist`` directory and\n   execute the ``program.exe`` (Windows) or ``program`` (other\n   platforms) put inside.\n\nUse Case 2 — Extension Module compilation\n=========================================\n\nIf you want to compile a single extension module, all you have to do is\nthis:\n\n.. code:: bash\n\n   python -m nuitka --module some_module.py\n\nThe resulting file ``some_module.so`` can then be used instead of\n``some_module.py``.\n\n.. important::\n\n   The filename of the produced extension module must not be changed as\n   Python insists on a module name derived function as an entry point,\n   in this case ``PyInit_some_module`` and renaming the file will not\n   change that. Match the filename of the source code to what the binary\n   name should be.\n\n.. note::\n\n   If both the extension module and the source code of it are in the\n   same directory, the extension module is loaded. Changes to the source\n   code only have effect once you recompile.\n\n.. note::\n\n   The option ``--follow-import-to`` works as well, but the included\n   modules will only become importable *after* you imported the\n   ``some_module`` name. If these kinds of imports are invisible to\n   Nuitka, e.g. dynamically created, you can use ``--include-module`` or\n   ``--include-package`` in that case, but for static imports it should\n   not be needed.\n\n.. note::\n\n   An extension module can never include other extension modules. You\n   will have to create a wheel for this to be doable.\n\n.. note::\n\n   The resulting extension module can only be loaded into a CPython of\n   the same version and doesn't include other extension modules.\n\nUse Case 3 — Package compilation\n================================\n\nIf you need to compile a whole package and embed all modules, that is\nalso feasible, use Nuitka like this:\n\n.. code:: bash\n\n   python -m nuitka --module some_package --include-package=some_package\n\n.. note::\n\n   The inclusion of the package contents needs to be provided manually;\n   otherwise, the package is mostly empty. You can be more specific if\n   you like, and only include part of it, or exclude part of it, e.g.\n   with ``--nofollow-import-to='*.tests'`` you would not include the\n   unused test part of your code.\n\n.. note::\n\n   Data files located inside the package will not be embedded by this\n   process, you need to copy them yourself with this approach.\n   Alternatively, you can use the `file embedding of Nuitka commercial\n   <https://nuitka.net/doc/commercial/protect-data-files.html>`__.\n\nUse Case 4 — Program Distribution\n=================================\n\nFor distribution to other systems, there is the standalone mode, which\nproduces a folder for which you can specify ``--standalone``.\n\n.. code:: bash\n\n   python -m nuitka --standalone program.py\n\nFollowing all imports is default in this mode. You can selectively\nexclude modules by specifically saying ``--nofollow-import-to``, but\nthen an ``ImportError`` will be raised when import of it is attempted at\nprogram run time. This may cause different behavior, but it may also\nimprove your compile time if done wisely.\n\nFor data files to be included, use the option\n``--include-data-files=<source>=<target>`` where the source is a file\nsystem path, but the target has to be specified relative. For the\nstandalone mode, you can also copy them manually, but this can do extra\nchecks, and for the onefile mode, there is no manual copying possible.\n\nTo copy some or all file in a directory, use the option\n``--include-data-files=/etc/*.txt=etc/`` where you get to specify shell\npatterns for the files, and a subdirectory where to put them, indicated\nby the trailing slash.\n\n.. important::\n\n   Nuitka does not consider data files code, do not include DLLs, or\n   Python files as data files, and expect them to work, they will not,\n   unless you really know what you are doing.\n\nIn the following, non-code data files are all files, not matching on of\nthese criterions.\n\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| Suffix     | Rationale                                                                              | Solution                                                                                               |\n+============+========================================================================================+========================================================================================================+\n| ``.py``    | Nuitka trims even the stdlib modules to be included. If it doesn't see Python code,    | Use ``--include-module`` on them instead                                                               |\n|            | there is no dependencies analyzed, and as a result it will just not work.              |                                                                                                        |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.pyc``   | Same as ``.py``.                                                                       | Use ``--include-module`` on them from their source code instead.                                       |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.pyo``   | Same as ``.pyc``.                                                                      | Use ``--include-module`` on them from their source code instead.                                       |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.pyw``   | Same as ``.py``.                                                                       | For including multiple programs, use multiple ``--main`` arguments instead.                            |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.pyi``   | These are ignored, because they are code-like and not needed at run time. For the      | Raise an issue if 3rd part software needs it.                                                          |\n|            | ``lazy`` package that actually would depend on them, we made a compile time solution   |                                                                                                        |\n|            | that removes the need.                                                                 |                                                                                                        |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.pyx``   | These are ignored, because they are Cython source code not used at run time            |                                                                                                        |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.dll``   | These are ignored, since they **usually** are not data files. For the cases where 3rd  | Create Nuitka Package configuration for those, with ``dll`` section for the package that uses them.    |\n|            | party packages do actually used them as data, e.g. ``.NET`` packages, we solve that in | For rare cases, data-files section with special configuration might be the correct thing to do.        |\n|            | package configuration for it.                                                          |                                                                                                        |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.dylib`` | These are ignored, since they macOS extension modules or DLLs.                         | Need to add configuration with ``dll`` section or ``depends`` that are missing                         |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.so``    | These are ignored, since they Linux, BSD, etc. extension modules or DLLs.              | Need to add configuration with ``dll`` section or ``depends`` that are missing                         |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.exe``   | The are binaries to Windows.                                                           | You can add Nuitka Package configuration to include those as DLLs and mark them as ``executable: yes`` |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n| ``.bin``   | The are binaries to non-Windows, otherwise same as ``.exe``.                           |                                                                                                        |\n+------------+----------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+\n\nAlso folders are ignored, these are ``site-packages``, ``dist-packages``\nand ``vendor-packages`` which would otherwise include a full virtualenv,\nwhich is never a good thing to happen. And the ``__pycache__`` folder is\nalso always ignored. On non-MacOS the file ``.DS_Store`` is ignored too,\nand ``py.typed`` folders have only meaning to IDEs, and are ignored like\n``.pyi`` files .\n\nTo copy a whole folder with all non-code files, you can use\n``--include-data-dir=/path/to/images=images`` which will place those in\nthe destination, and if you want to use the ``--noinclude-data-files``\noption to remove them. Code files are as detailed above DLLs,\nexecutables, Python files, etc. and will be ignored. For those you can\nuse the ``--include-data-files=/binaries/*.exe=binary/`` form to force\nthem, but that is not recommended and known to cause issues at run-time.\n\nFor package data, there is a better way, namely using\n``--include-package-data``, which detects all non-code data files of\npackages automatically and copies them over. It even accepts patterns in\na shell style. It spares you the need to find the package directory\nyourself and should be preferred whenever available. Functionally it's\nvery similar to ``--include-data-dir`` but it has the benefit to locate\nthe correct folder for you.\n\nWith data files, you are largely on your own. Nuitka keeps track of ones\nthat are needed by popular packages, but it might be incomplete. Raise\nissues if you encounter something in these. Even better, raise PRs with\nenhancements to the Nuitka package configuration. With want 3rd party\nsoftware to just work out of the box.\n\nWhen that is working, you can use the onefile mode if you so desire.\n\n.. code:: bash\n\n   python -m nuitka --onefile program.py\n\nThis will create a single binary, that extracts itself on the target,\nbefore running the program. But notice, that accessing files relative to\nyour program is impacted, make sure to read the section `Onefile:\nFinding files`_ as well.\n\n.. code:: bash\n\n   # Create a binary that unpacks into a temporary folder\n   python -m nuitka --onefile program.py\n\n.. note::\n\n   There are more platform-specific options, e.g. related to icons,\n   splash screen, and version information, consider the ``--help``\n   output for the details of these and check the section Tweaks_.\n\nFor the unpacking, by default a unique user temporary path one is used,\nand then deleted, however this default\n``--onefile-tempdir-spec=\"{TEMP}/onefile_{PID}_{TIME}\"`` can be\noverridden with a path specification that is using then using a cached\npath, avoiding repeated unpacking, e.g. with\n``--onefile-tempdir-spec=\"{CACHE_DIR}/{COMPANY}/{PRODUCT}/{VERSION}\"``\nwhich uses version information, and user-specific cache directory.\n\n.. note::\n\n   Using cached paths will be relevant, e.g. when Windows Firewall comes\n   into play because otherwise, the binary will be a different one to it\n   each time it is run.\n\nCurrently, these expanded tokens are available:\n\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| Token          | What this Expands to                                      | Example                               |\n+================+===========================================================+=======================================+\n| {TEMP}         | User temporary file directory                             | C:\\\\Users\\\\...\\\\AppData\\\\Locals\\\\Temp |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {PID}          | Process ID                                                | 2772                                  |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {TIME}         | Time in seconds since the epoch.                          | 1299852985                            |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {PROGRAM}      | Full program run-time filename of executable.             | C:\\\\SomeWhere\\\\YourOnefile.exe        |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {PROGRAM_BASE} | No-suffix of run-time filename of executable.             | C:\\\\SomeWhere\\\\YourOnefile            |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {CACHE_DIR}    | Cache directory for the user.                             | C:\\\\Users\\\\SomeBody\\\\AppData\\\\Local   |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {COMPANY}      | Value given as ``--company-name``                         | YourCompanyName                       |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {PRODUCT}      | Value given as ``--product-name``                         | YourProductName                       |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {VERSION}      | Combination of ``--file-version`` & ``--product-version`` | 3.0.0.0-1.0.0.0                       |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {HOME}         | Home directory for the user.                              | /home/somebody                        |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {NONE}         | When provided for file outputs, ``None`` is used          | see notice below                      |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n| {NULL}         | When provided for file outputs, ``os.devnull`` is used    | see notice below                      |\n+----------------+-----------------------------------------------------------+---------------------------------------+\n\n.. important::\n\n   It is your responsibility to make the path provided unique, on\n   Windows a running program will be locked, and while using a fixed\n   folder name is possible, it can cause locking issues in that case,\n   where the program gets restarted.\n\n   Usually, you need to use ``{TIME}`` or at least ``{PID}`` to make a\n   path unique, and this is mainly intended for use cases, where e.g.\n   you want things to reside in a place you choose or abide your naming\n   conventions.\n\n.. important::\n\n   For disabling output and stderr with ``--force-stdout-spec`` and\n   ``--force-stderr-spec`` the values ``{NONE}`` and ``{NULL}`` achieve\n   it, but with different effect. With ``{NONE}``, the corresponding\n   handle becomes ``None``. As a result, e.g. ``sys.stdout`` will be\n   ``None``, which is different from ``{NULL}`` where it will be backed\n   by a file pointing to ``os.devnull``, i.e. you can write to it.\n\n   With ``{NONE}``, you may e.g. get ``RuntimeError: lost sys.stdout``\n   in case it does get used; with ``{NULL}`` that never happens.\n   However, some libraries handle this as input for their logging\n   mechanism, and on Windows this is how you are compatible with\n   ``pythonw.exe`` which is behaving like ``{NONE}``.\n\nUse Case 5 — Setuptools Wheels\n==============================\n\nIf you have a ``setup.py``, ``setup.cfg`` or ``pyproject.toml`` driven\ncreation of wheels for your software in place, putting Nuitka to use is\nextremely easy.\n\nLet's start with the most common ``setuptools`` approach, you can,\nhaving Nuitka installed of course, simply execute the target\n``bdist_nuitka`` rather than the ``bdist_wheel``. It takes all the\noptions and allows you to specify some more, that are specific to\nNuitka.\n\n.. code:: python\n\n   # For setup.py if you don't use other build systems:\n   setup(\n      # Data files are to be handled by setuptools and not Nuitka\n      package_data={\"some_package\": [\"some_file.txt\"]},\n      ...,\n      # This is to pass Nuitka options.\n      command_options={\n         'nuitka': {\n            # boolean option, e.g. if you cared for C compilation commands\n            '--show-scons': True,\n            # options without value, e.g. enforce using Clang\n            '--clang': None,\n            # options with single values, e.g. enable a plugin of Nuitka\n            '--enable-plugin': \"pyside2\",\n            # options with several values, e.g. avoiding including modules\n            '--nofollow-import-to' : [\"*.tests\", \"*.distutils\"],\n         },\n      },\n   )\n\n   # For setup.py with other build systems:\n   # The tuple nature of the arguments is required by the dark nature of\n   # \"setuptools\" and plugins to it, that insist on full compatibility,\n   # e.g. \"setuptools_rust\"\n\n   setup(\n      # Data files are to be handled by setuptools and not Nuitka\n      package_data={\"some_package\": [\"some_file.txt\"]},\n      ...,\n      # This is to pass Nuitka options.\n      ...,\n      command_options={\n         'nuitka': {\n            # boolean option, e.g. if you cared for C compilation commands\n            '--show-scons': (\"setup.py\", True),\n            # options without value, e.g. enforce using Clang\n            '--clang': (\"setup.py\", None),\n            # options with single values, e.g. enable a plugin of Nuitka\n            '--enable-plugin': (\"setup.py\", \"pyside2\"),\n            # options with several values, e.g. avoiding including modules\n            '--nofollow-import-to' : (\"setup.py\", [\"*.tests\", \"*.distutils\"]),\n         }\n      },\n   )\n\nIf for some reason, you cannot or do not want to change the target, you\ncan add this to your ``setup.py``.\n\n.. code:: python\n\n   # For setup.py\n   setup(\n      ...,\n      build_with_nuitka=True\n   )\n\n.. note::\n\n   To temporarily disable the compilation, you could the remove above\n   line, or edit the value to ``False`` by or take its value from an\n   environment variable if you so choose, e.g.\n   ``bool(os.getenv(\"USE_NUITKA\", \"True\"))``. This is up to you.\n\nOr you could put it in your ``setup.cfg``\n\n.. code:: toml\n\n   [metadata]\n   build_with_nuitka = true\n\nAnd last, but not least, Nuitka also supports the new ``build`` meta, so\nwhen you have a ``pyproject.toml`` already, simple replace or add this\nvalue:\n\n.. code:: toml\n\n   [build-system]\n   requires = [\"setuptools>=42\", \"wheel\", \"nuitka\", \"toml\"]\n   build-backend = \"nuitka.distutils.Build\"\n\n   # Data files are to be handled by setuptools and not Nuitka\n   [tool.setuptools.package-data]\n   some_package = ['data_file.txt']\n\n   [tool.nuitka]\n   # These are not recommended, but they make it obvious to have effect.\n\n   # boolean option, e.g. if you cared for C compilation commands, leading\n   # dashes are omitted\n   show-scons = true\n\n   # options with single values, e.g. enable a plugin of Nuitka\n   enable-plugin = \"pyside2\"\n\n   # options with several values, e.g. avoiding including modules, accepts\n   # list argument.\n   nofollow-import-to = [\"*.tests\", \"*.distutils\"]\n\n.. note::\n\n   For the ``nuitka`` requirement above absolute paths like\n   ``C:\\Users\\...\\Nuitka`` will also work on Linux, use an absolute path\n   with *two* leading slashes, e.g. ``//home/.../Nuitka``.\n\n.. note::\n\n   Whatever approach you take, data files in these wheels are not\n   handled by Nuitka at all, but by setuptools. You can, however, use\n   the data file embedding of Nuitka commercial. In that case, you\n   actually would embed the files inside the extension module itself,\n   and not as a file in the wheel.\n\nUse Case 6 — Multidist\n======================\n\nIf you have multiple programs, that each should be executable, in the\npast you had to compile multiple times, and deploy all of these. With\nstandalone mode, this, of course, meant that you were fairly wasteful,\nas sharing the folders could be done, but wasn't really supported by\nNuitka.\n\nEnter ``Multidist``. There is an option ``--main`` that replaces or adds\nto the positional argument given. And it can be given multiple times.\nWhen given multiple times, Nuitka will create a binary that contains the\ncode of all the programs given, but sharing modules used in them. They\ntherefore do not have to be distributed multiple times.\n\nLet's call the basename of the main path, and entry point. The names of\nthese must, of course, be different. Then the created binary can execute\neither entry point, and will react to what ``sys.argv[0]`` appears to\nit. So if executed in the right way (with something like ``subprocess``\nor OS API you can control this name), or by renaming or copying the\nbinary, or symlinking to it, you can then achieve the miracle.\n\nThis allows to combine very different programs into one.\n\n.. note::\n\n   This feature is still experimental. Use with care and report your\n   findings should you encounter anything that is undesirable behavior\n\nThis mode works with standalone, onefile, and mere acceleration. It does\nnot work with module mode.\n\nUse Case 7 — Building with GitHub Workflows\n===========================================\n\nFor integration with GitHub workflows there is this `Nuitka-Action\n<https://github.com/Nuitka/Nuitka-Action>`__ that you should use that\nmakes it really easy to integrate. You ought to start with a local\ncompilation though, but this will be easiest for cross platform\ncompilation with Nuitka.\n\nThis is an example workflow that builds on all 3 OSes\n\n.. code:: yaml\n\n   jobs:\n   build:\n      strategy:\n         matrix:\n         os: [macos-latest, ubuntu-latest, windows-latest]\n\n      runs-on: ${{ matrix.os }}\n\n      steps:\n         - name: Check-out repository\n         uses: actions/checkout@v3\n\n         - name: Setup Python\n         uses: actions/setup-python@v4\n         with:\n            python-version: '3.10'\n            cache: 'pip'\n            cache-dependency-path: |\n               **/requirements*.txt\n\n         - name: Install your Dependencies\n         run: |\n            pip install -r requirements.txt -r requirements-dev.txt\n\n         - name: Build Executable with Nuitka\n         uses: Nuitka/Nuitka-Action@main\n         with:\n            nuitka-version: main\n            script-name: your_main_program.py\n            # many more Nuitka options available, see action doc, but it's best\n            # to use nuitka-project: options in your code, so e.g. you can make\n            # a difference for macOS and create an app bundle there.\n            onefile: true\n\n         - name: Upload Artifacts\n         uses: actions/upload-artifact@v3\n         with:\n            name: ${{ runner.os }} Build\n            path: | # match what's created for the 3 OSes\n               build/*.exe\n               build/*.bin\n               build/*.app/**/*\n\nIf you app is a GUI, e.g. ``your_main_program.py`` should contain these\ncomments as explained in `Nuitka Options in the code`_ since on macOS\nthis should then be a bundle.\n\n.. code:: python\n\n   # Compilation mode, standalone everywhere, except on macOS there app bundle\n   # nuitka-project-if: {OS} in (\"Windows\", \"Linux\", \"FreeBSD\"):\n   #    nuitka-project: --onefile\n   # nuitka-project-if: {OS} == \"Darwin\":\n   #    nuitka-project: --standalone\n   #    nuitka-project: --macos-create-app-bundle\n   #\n   # Debugging options, controlled via environment variable at compile time.\n   # nuitka-project-if: os.getenv(\"DEBUG_COMPILATION\", \"no\") == \"yes\"\n   #     nuitka-project: --enable-console\n   # nuitka-project-else:\n   #     nuitka-project: --disable-console\n\n********\n Tweaks\n********\n\nIcons\n=====\n\nFor good looks, you may specify icons. On Windows, you can provide an\nicon file, a template executable, or a PNG file. All of these will work\nand may even be combined:\n\n.. code:: bash\n\n   # These create binaries with icons on Windows\n   python -m nuitka --onefile --windows-icon-from-ico=your-icon.png program.py\n   python -m nuitka --onefile --windows-icon-from-ico=your-icon.ico program.py\n   python -m nuitka --onefile --windows-icon-template-exe=your-icon.ico program.py\n\n   # These create application bundles with icons on macOS\n   python -m nuitka --macos-create-app-bundle --macos-app-icon=your-icon.png program.py\n   python -m nuitka --macos-create-app-bundle --macos-app-icon=your-icon.icns program.py\n\n.. note::\n\n   With Nuitka, you do not have to create platform-specific icons, but\n   instead it will convert e.g. PNG, but also other formats on the fly\n   during the build.\n\nMacOS Entitlements\n==================\n\nEntitlements for an macOS application bundle can be added with the\noption, ``--macos-app-protected-resource``, all values are listed on\n`this page from Apple\n<https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources>`__\n\nAn example value would be\n``--macos-app-protected-resource=NSMicrophoneUsageDescription:Microphone\naccess`` for requesting access to a Microphone. After the colon, the\ndescriptive text is to be given.\n\n.. note::\n\n   Beware that in the likely case of using spaces in the description\n   part, you need to quote it for your shell to get through to Nuitka\n   and not be interpreted as Nuitka arguments.\n\nConsole Window\n==============\n\nOn Windows, the console is opened by programs unless you say so. Nuitka\ndefaults to this, effectively being only good for terminal programs, or\nprograms where the output is requested to be seen. There is a difference\nin ``pythonw.exe`` and ``python.exe`` along those lines. This is\nreplicated in Nuitka with the option ``--disable-console``. Nuitka\nrecommends you to consider this in case you are using ``PySide6`` e.g.\nand other GUI packages, e.g. ``wx``, but it leaves the decision up to\nyou. In case, you know your program is console application, just using\n``--enable-console`` which will get rid of these kinds of outputs from\nNuitka.\n\n.. note::\n\n   The ``pythonw.exe`` is never good to be used with Nuitka, as you\n   cannot see its output.\n\nSplash screen\n=============\n\nSplash screens are useful when program startup is slow. Onefile startup\nitself is not slow, but your program may be, and you cannot really know\nhow fast the computer used will be, so it might be a good idea to have\nthem. Luckily, with Nuitka, they are easy to add for Windows.\n\nFor the splash screen, you need to specify it as a PNG file, and then\nmake sure to disable the splash screen when your program is ready, e.g.\nhas completed the imports, prepared the window, connected to the\ndatabase, and wants the splash screen to go away. Here we are using the\nproject syntax to combine the code with the creation, compile this:\n\n.. code:: python\n\n   # nuitka-project: --onefile\n   # nuitka-project: --onefile-windows-splash-screen-image={MAIN_DIRECTORY}/Splash-Screen.png\n\n   # Whatever this is, obviously\n   print(\"Delaying startup by 10s...\")\n   import time, tempfile, os\n   time.sleep(10)\n\n   # Use this code to signal the splash screen removal.\n   if \"NUITKA_ONEFILE_PARENT\" in os.environ:\n      splash_filename = os.path.join(\n         tempfile.gettempdir(),\n         \"onefile_%d_splash_feedback.tmp\" % int(os.environ[\"NUITKA_ONEFILE_PARENT\"]),\n      )\n\n      if os.path.exists(splash_filename):\n         os.unlink(splash_filename)\n\n   print(\"Done... splash should be gone.\")\n   ...\n\n   # Rest of your program goes here.\n\nReports\n=======\n\nFor analysis of your program and Nuitka packaging, there is the\n`Compilation Report`_ available. You can also make custom reports by\nproviding your template, with a few of them built-in to Nuitka. These\nreports carry all the detail information, e.g. when a module was\nattempted to be imported, but not found, you can see where that happens.\nFor bug reporting, it is very much recommended to provide the report.\n\nVersion Information\n===================\n\nYou can attach copyright and trademark information, company name,\nproduct name, and so on to your compilation. This is then used in\nversion information for the created binary on Windows, or application\nbundle on macOS. If you find something that is lacking, please let us\nknow.\n\n******************\n Typical Problems\n******************\n\nDeployment Mode\n===============\n\nBy default, Nuitka compiles without ``--deployment`` which leaves a set\nof safe guards and helpers on, that are aimed at debugging wrong uses of\nNuitka.\n\nThis is a new feature, and implements a bunch of protections and\nhelpers, that are documented here.\n\nFork bombs (self-execution)\n---------------------------\n\nSo after compilation, ``sys.executable`` is the compiled binary. In case\nof packages like ``multiprocessing``, ``joblib``, or ``loky`` what these\ntypically do is to expect to run from a full ``python`` with\n``sys.executable`` and then to be able to use its options like ``-c\ncommand`` or ``-m module_name`` and then be able to launch other code\ntemporarily or permanently as a service daemon.\n\nWith Nuitka however, this executes your program again, and puts these\narguments, in ``sys.argv`` where you maybe ignore them, and then you\nfork yourself again to launch the helper daemons. Sometimes this ends up\nspawning CPU count processes that spawn CPU count processes that... this\nis called a fork bomb, and with almost all systems, that freezes them\neasily to death.\n\nThat is why e.g. this happens with default Nuitka:\n\n.. code::\n\n   ./hello.dist/hello.bin -l fooL -m fooM -n fooN -o fooO -p\n   Error, the program tried to call itself with '-m' argument. Disable with '--no-deployment-flag=self-execution'.\n\nYour program may well have its own command line parsing, and not use an\nunsupported package that does attempt to re-execute. In this case, you\nneed at *compile time* to use ``--no-deployment-flag=self-execution``\nwhich disables this specific guard.\n\nMisleading Messages\n-------------------\n\nSome packages output what they think is helpful information about what\nthe reason of a failed import might mean. With compiled programs there\nare very often just plain wrong. We try and repair those in\nnon-deployment mode. Here is an example, where we change a message that\nasks to pip install (which is not the issue) to point the user to the\ninclude command that makes an ``imageio`` plugin work.\n\n.. code:: yaml\n\n   - module-name: 'imageio.core.imopen'\n     anti-bloat:\n       - replacements_plain:\n           '`pip install imageio[{config.install_name}]` to install it': '`--include-module={config.module_name}` with Nuitka to include it'\n           'err_type = ImportError': 'err_type = RuntimeError'\n         when: 'not deployment'\n\nAnd much more\n-------------\n\nThe deployment mode is relatively new and has constantly more features\nadded, e.g. something for ``FileNotFoundError`` should be coming soon.\n\nDisabling All\n-------------\n\nAll these helpers can of course be disabled at once with\n``--deployment`` but keep in mind that for debugging, you may want to\nre-enable it. You might want to use Nuitka Project options and an\nenvironment variable to make this conditional.\n\nShould you disable them all?\n\nWe believe, disabling should only happen selectively, but with PyPI\nupgrades, your code changes, all of these issues can sneak back in. The\nspace saving of deployment mode is currently negligible, so attempt to\nnot do it, but review what exists, and if you know that it cannot affect\nyou, or if it does, you will not need it. Some of the future ones, will\nclearly be geared at beginner level usage.\n\nWindows Virus scanners\n======================\n\nBinaries compiled on Windows with default settings of Nuitka and no\nfurther actions taken might be recognized by some AV vendors as malware.\nThis is avoidable, but only in Nuitka commercial there is actual support\nand instructions for how to do it, seeing this as a typical commercial\nonly need. https://nuitka.net/doc/commercial.html\n\nLinux Standalone\n================\n\nFor Linux standalone it is pretty difficult to build a binary that works\non other Linux versions. This is mainly because on Linux, much software\nis built specifically targeted to concrete DLLs. Things like glibc used,\nare then encoded into the binary built, and it will not run with an\nolder glibc, just to give one critical example.\n\nThe solution is to build on the oldest OS that you want to see\nsupported. Picking that and setting it up can be tedious, so can be\nlogin, and keeping it secure, as it's something you put your source code\non.\n\nTo aid that, Nuitka commercial has container based builds, that you can\nuse. This uses dedicated optimized Python builds, targets CentOS 7 and\nsupports even newest Pythons and very old OSes that way using recent C\ncompiler chains all turn key solution. The effort needs to be\ncompensated to support Nuitka development for Linux, there you need to\npurchase it https://nuitka.net/doc/commercial.html but even a sponsor\nlicense will be cheaper than doing it yourself.\n\nProgram crashes system (fork bombs)\n===================================\n\nA fork bomb is a program that starts itself over and over. This can\neasily happen, since ``sys.executable`` for compiled programs is not a\nPython interpreter, and packages that try to do multiprocessing in a\nbetter way, often relaunch themselves through this, and Nuitka needs and\ndoes have handling for these with known packages. However, you may\nencounter a situation where the detection of this fails. See deployment\noption above that is needed to disable this protection.\n\nWhen this fork bomb happens easily all memory, all CPU of the system\nthat is available to the user is being used, and even the most powerful\nbuild system will go down in flames sometimes needing a hard reboot.\n\nFor fork bombs, we can use ``--experimental=debug-self-forking`` and see\nwhat it does, and we have a trick, that prevents fork bombs from having\nany actual success in their bombing. Put this at the start of your\nprogram.\n\n.. code:: python\n\n   import os, sys\n\n   if \"NUITKA_LAUNCH_TOKEN\" not in os.environ:\n      sys.exit(\"Error, need launch token or else fork bomb suspected.\")\n   else:\n      del os.environ[\"NUITKA_LAUNCH_TOKEN\"]\n\nActually Nuitka is trying to get ahold of them without the deployment\noption already, finding \"-c\" and \"-m\" options, but it may not be perfect\nor not work well with a package (anymore).\n\nMemory issues and compiler bugs\n===============================\n\nIn some cases, the C compilers will crash saying they cannot allocate\nmemory or that some input was truncated, or similar error messages,\nclearly from it. These are example error messages, that are a sure sign\nof too low memory, there is no end to them.\n\n.. code::\n\n   # gcc\n   fatal error: error writing to -: Invalid argument\n   Killed signal terminated program\n   # MSVC\n   fatal error C1002: compiler is out of heap space in pass 2\n   fatal error C1001: Internal compiler error\n\nThere are several options you can explore here.\n\nAsk Nuitka to use less memory\n-----------------------------\n\nThere is a dedicated option ``--low-memory`` which influences decisions\nof Nuitka, such that it avoids high usage of memory during compilation\nat the cost of increased compile time.\n\nAvoid 32 bit C compiler/assembler memory limits\n-----------------------------------------------\n\nDo not use a 32 bit compiler, but a 64 bit one. If you are using Python\nwith 32 bits on Windows, you most definitely ought to use MSVC as the C\ncompiler, and not MinGW64. The MSVC is a cross-compiler, and can use\nmore memory than gcc on that platform. If you are not on Windows, that\nis not an option, of course. Also, using the 64 bit Python will work.\n\nUse a minimal virtualenv\n------------------------\n\nWhen you compile from a living installation, that may well have many\noptional dependencies of your software installed. Some software will\nthen have imports on these, and Nuitka will compile them as well. Not\nonly may these be just the troublemakers, they also require more memory,\nso get rid of that. Of course, you do have to check that your program\nhas all the needed dependencies before you attempt to compile, or else\nthe compiled program will equally not run.\n\nUse LTO compilation or not\n--------------------------\n\nWith ``--lto=yes`` or ``--lto=no`` you can switch the C compilation to\nonly produce bytecode, and not assembler code and machine code directly,\nbut make a whole program optimization at the end. This will change the\nmemory usage pretty dramatically, and if your error is coming from the\nassembler, using LTO will most definitely avoid that.\n\nSwitch the C compiler to clang\n------------------------------\n\nPeople have reported that programs that fail to compile with gcc due to\nits bugs or memory usage work fine with clang on Linux. On Windows, this\ncould still be an option, but it needs to be implemented first for the\nautomatic downloaded gcc, that would contain it. Since MSVC is known to\nbe more memory effective anyway, you should go there, and if you want to\nuse Clang, there is support for the one contained in MSVC.\n\nAdd a larger swap file to your embedded Linux\n---------------------------------------------\n\nOn systems with not enough RAM, you need to use swap space. Running out\nof it is possibly a cause, and adding more swap space, or one at all,\nmight solve the issue, but beware that it will make things extremely\nslow when the compilers swap back and forth, so consider the next tip\nfirst or on top of it.\n\nLimit the amount of compilation jobs\n------------------------------------\n\nWith the ``--jobs`` option of Nuitka, it will not start many C compiler\ninstances at once, each competing for the scarce resource of RAM. By\npicking a value of one, only one C compiler instance will be running,\nand on an 8 core system, that reduces the amount of memory by factor 8,\nso that's a natural choice right there.\n\nDynamic ``sys.path``\n====================\n\nIf your script modifies ``sys.path``, e.g. inserts directories with\nsource code relative to it, Nuitka will not be able to see those.\nHowever, if you set the ``PYTHONPATH`` to the resulting value, it will\nbe able to compile it and find the used modules from these paths as\nwell.\n\nManual Python File Loading\n==========================\n\nA very frequent pattern with private code is that it scans plugin\ndirectories of some kind, and e.g. uses ``os.listdir``, then considers\nPython filenames, and then opens a file and does ``exec`` on them. This\napproach works for Python code, but for compiled code, you should use\nthis much cleaner approach, that works for pure Python code and is a lot\nless vulnerable.\n\n.. code:: python\n\n   # Using a package name, to locate the plugins. This is also a sane\n   # way to organize them into a directory.\n   scan_path = scan_package.__path__\n\n   for item in pkgutil.iter_modules(scan_path):\n      importlib.import_module(scan_package.__name__ + \".\" + item.name)\n\n      # You may want to do it recursively, but we don't do this here in\n      # this example. If you'd like to, handle that in this kind of branch.\n      if item.ispkg:\n         ...\n\nMissing data files in standalone\n================================\n\nIf your program fails to find data file, it can cause all kinds of\ndifferent behavior, e.g. a package might complain it is not the right\nversion because a ``VERSION`` file check defaulted to an unknown. The\nabsence of icon files or help texts, may raise strange errors.\n\nOften the error paths for files not being present are even buggy and\nwill reveal programming errors like unbound local variables. Please look\ncarefully at these exceptions, keeping in mind that this can be the\ncause. If your program works without standalone, chances are data files\nmight be the cause.\n\nThe most common error indicating file absence is of course an uncaught\n``FileNotFoundError`` with a filename. You should figure out what\npackage is missing files and then use ``--include-package-data``\n(preferably), or ``--include-data-dir``/``--include-data-files`` to\ninclude them.\n\nMissing DLLs/EXEs in standalone\n===============================\n\nNuitka has plugins that deal with copying DLLs. For NumPy, SciPy,\nTkinter, etc.\n\nThese need special treatment to be able to run on other systems.\nManually copying them is not enough and will give strange errors.\nSometimes newer version of packages, esp. NumPy can be unsupported. In\nthis case, you will have to raise an issue, and use the older one.\n\nIf you want to manually add a DLL or an EXE because it is your project\nonly, you will have to use user Yaml files describing where they can be\nfound. This is described in detail with examples in the `Nuitka Package\nConfiguration <https://nuitka.net/doc/nuitka-package-config.html>`__\npage.\n\nDependency creep in standalone\n==============================\n\nSome packages are a single import, but to Nuitka mean that more than a\nthousand packages (literally) are to be included. The prime example of\nPandas, which does want to plug and use just about everything you can\nimagine. Multiple frameworks for syntax highlighting everything\nimaginable take time.\n\nNuitka will have to learn effective caching to deal with this in the\nfuture. Presently, you will have to deal with huge compilation times for\nthese.\n\nA major weapon in fighting dependency creep should be applied, namely\nthe ``anti-bloat`` plugin, which offers interesting abilities, that can\nbe put to use and block unneeded imports, giving an error for where they\noccur. Use it e.g. like this ``--noinclude-pytest-mode=nofollow\n--noinclude-setuptools-mode=nofollow`` and e.g. also\n``--noinclude-custom-mode=setuptools:error`` to get the compiler to\nerror out for a specific package. Make sure to check its help output. It\ncan take for each module of your choice, e.g. forcing also that e.g.\n``PyQt5`` is considered uninstalled for standalone mode.\n\nIt's also driven by a configuration file, ``anti-bloat.yml`` that you\ncan contribute to, removing typical bloat from packages. Please don't\nhesitate to enhance it and make PRs towards Nuitka with it.\n\nStandalone: Finding files\n=========================\n\nThe standard code that normally works, also works, you should refer to\n``os.path.dirname(__file__)`` or use all the packages like ``pkgutil``,\n``pkg_resources``, ``importlib.resources`` to locate data files near the\nstandalone binary.\n\n.. important::\n\n   What you should **not** do, is use the current directory\n   ``os.getcwd``, or assume that this is the script directory, e.g. with\n   paths like ``data/``.\n\n   If you did that, it was never good code. Links, to a program,\n   launching from another directory, etc. will all fail in bad ways. Do\n   not make assumptions about the directory your program is started\n   from.\n\nIn case you mean to refer to the location of the ``.dist`` folder for\nfiles that are to reside near the binary, there is\n``__compiled__.containing_dir`` that also abstracts all differences with\n``--macos-create-app-bundle`` and the ``.app`` folder a having more\nnested structure.\n\n.. code:: python\n\n   # This will find a file *near* your app or dist folder\n   try:\n      open(os.path.join(__compiled__.containing_dir, \"user-provided-file.txt\"))\n   except NameError:\n      open(os.path.join(os.path.dirname(sys.argv[0]), \"user-provided-file.txt\"))\n\nOnefile: Finding files\n======================\n\nThere is a difference between ``sys.argv[0]`` and ``__file__`` of the\nmain module for the onefile mode, that is caused by using a bootstrap to\na temporary location. The first one will be the original executable\npath, whereas the second one will be the temporary or permanent path the\nbootstrap executable unpacks to. Data files will be in the later\nlocation, your original environment files will be in the former\nlocation.\n\nGiven 2 files, one which you expect to be near your executable, and one\nwhich you expect to be inside the onefile binary, access them like this.\n\n.. code:: python\n\n   # This will find a file *near* your onefile.exe\n   open(os.path.join(os.path.dirname(sys.argv[0]), \"user-provided-file.txt\"))\n   # This will find a file *inside* your onefile.exe\n   open(os.path.join(os.path.dirname(__file__), \"user-provided-file.txt\"))\n\n   # This will find a file *near* your onefile binary and work for standalone too\n   try:\n      open(os.path.join(__compiled__.containing_dir, \"user-provided-file.txt\"))\n   except NameError:\n      open(os.path.join(os.path.dirname(sys.argv[0]), \"user-provided-file.txt\"))\n\nWindows Programs without console give no errors\n===============================================\n\nFor debugging purposes, remove ``--disable-console`` or use the options\n``--force-stdout-spec`` and ``--force-stderr-spec`` with paths as\ndocumented for ``--onefile-tempdir-spec`` above. These can be relative\nto the program or absolute, so you can see the outputs given.\n\nDeep copying uncompiled functions\n=================================\n\nSometimes people use this kind of code, which for packages on PyPI, we\ndeal with by doing source code patches on the fly. If this is in your\nown code, here is what you can do:\n\n.. code:: python\n\n   def binder(func, name):\n      result = types.FunctionType(func.__code__, func.__globals__, name=func.__name__, argdefs=func.__defaults__, closure=func.__closure__)\n      result = functools.update_wrapper(result, func)\n      result.__kwdefaults__ = func.__kwdefaults__\n      result.__name__ = name\n      return result\n\nCompiled functions cannot be used to create uncompiled ones from, so the\nabove code will not work. However, there is a dedicated ``clone``\nmethod, that is specific to them, so use this instead.\n\n.. code:: python\n\n   def binder(func, name):\n      try:\n         result = func.clone()\n      except AttributeError:\n         result = types.FunctionType(func.__code__, func.__globals__, name=func.__name__, argdefs=func.__defaults__, closure=func.__closure__)\n         result = functools.update_wrapper(result, func)\n         result.__kwdefaults__ = func.__kwdefaults__\n\n      result.__name__ = name\n      return result\n\nModules: Extension modules are not executable directly\n======================================================\n\nA package can be compiled with Nuitka, no problem, but when it comes to\nexecuting it, ``python -m compiled_module`` is not going to work and\ngive the error ``No code object available for AssertsTest`` because the\ncompiled module is not source code, and Python will not just load it.\nThe closest would be ``python -c \"import compile_module\"`` and you might\nhave to call the main function yourself.\n\nTo support this, the CPython ``runpy`` and/or ``ExtensionFileLoader``\nwould need improving such that Nuitka could supply its compiled module\nobject for Python to use.\n\n******\n Tips\n******\n\nNuitka Options in the code\n==========================\n\nOne clean way of providing options to Nuitka, that you will always use\nfor your program, is to put them into the main file you compile. There\nis even support for conditional options, and options using pre-defined\nvariables, this is an example:\n\n.. code:: python\n\n   # Compilation mode, support OS-specific options\n   # nuitka-project-if: {OS} in (\"Windows\", \"Linux\", \"Darwin\", \"FreeBSD\"):\n   #    nuitka-project: --onefile\n   # nuitka-project-else:\n   #    nuitka-project: --standalone\n\n   # The PySide2 plugin covers qt-plugins\n   # nuitka-project: --enable-plugin=pyside2\n   # nuitka-project: --include-qt-plugins=qml\n\nThe comments must be at the start of lines, and indentation inside of\nthem is to be used, to end a conditional block, much like in Python.\nThere are currently no other keywords than the used ones demonstrated\nabove.\n\nYou can put arbitrary Python expressions there, and if you wanted to\ne.g. access a version information of a package, you could simply use\n``__import__(\"module_name\").__version__`` if that would be required to\ne.g. enable or disable certain Nuitka settings. The only thing Nuitka\ndoes that makes this not Python expressions, is expanding ``{variable}``\nfor a pre-defined set of variables:\n\nTable with supported variables:\n\n+------------------+--------------------------------+------------------------------------------+\n| Variable         | What this Expands to           | Example                                  |\n+==================+================================+==========================================+\n| {OS}             | Name of the OS used            | Linux, Windows, Darwin, FreeBSD, OpenBSD |\n+------------------+--------------------------------+------------------------------------------+\n| {Version}        | Version of Nuitka              | e.g. (1, 6, 0)                           |\n+------------------+--------------------------------+------------------------------------------+\n| {Commercial}     | Version of Nuitka Commercial   | e.g. (2, 1, 0)                           |\n+------------------+--------------------------------+------------------------------------------+\n| {Arch}           | Architecture used              | x86_64, arm64, etc.                      |\n+------------------+--------------------------------+------------------------------------------+\n| {MAIN_DIRECTORY} | Directory of the compiled file | some_dir/maybe_relative                  |\n+------------------+--------------------------------+------------------------------------------+\n| {Flavor}         | Variant of Python              | e.g. Debian Python, Anaconda Python      |\n+------------------+--------------------------------+------------------------------------------+\n\nThe use of ``{MAIN_DIRECTORY}`` is recommended when you want to specify\na filename relative to the main script, e.g. for use in data file\noptions or user package configuration yaml files,\n\n.. code:: python\n\n   # nuitka-project: --include-data-files={MAIN_DIRECTORY}/my_icon.png=my_icon.png\n   # nuitka-project: --user-package-configuration-file={MAIN_DIRECTORY}/user.nuitka-package.config.yml\n\nPython command line flags\n=========================\n\nFor passing things like ``-O`` or ``-S`` to Python, to your compiled\nprogram, there is a command line option name ``--python-flag=`` which\nmakes Nuitka emulate these options.\n\nThe most important ones are supported, more can certainly be added.\n\nCaching compilation results\n===========================\n\nThe C compiler, when invoked with the same input files, will take a long\ntime and much CPU to compile over and over. Make sure you are having\n``ccache`` installed and configured when using gcc (even on Windows). It\nwill make repeated compilations much faster, even if things are not yet\nnot perfect, i.e. changes to the program can cause many C files to\nchange, requiring a new compilation instead of using the cached result.\n\nOn Windows, with gcc Nuitka supports using ``ccache.exe`` which it will\noffer to download from an official source and it automatically. This is\nthe recommended way of using it on Windows, as other versions can e.g.\nhang.\n\nNuitka will pick up ``ccache`` if it's found in system ``PATH``, and it\nwill also be possible to provide if by setting ``NUITKA_CCACHE_BINARY``\nto the full path of the binary, this is for use in CI systems where\nthings might be non-standard.\n\nFor the MSVC compilers and ClangCL setups, using the ``clcache`` is\nautomatic and included in Nuitka.\n\nOn macOS and Intel, there is an automatic download of a ``ccache``\nbinary from our site, for arm64 arches, it's recommended to use this\nsetup, which installs Homebrew and ccache in there. Nuitka picks that\none up automatically if it on that kind of machine. You need and should\nnot use Homebrew with Nuitka otherwise, it's not the best for standalone\ndeployments, but we can take ``ccache`` from there.\n\n.. code:: bash\n\n   export HOMEBREW_INSTALL_FROM_API=1\n   /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)\"\n   eval $(/opt/homebrew/bin/brew shellenv)\n   brew install ccache\n\nControl where Caches live\n=========================\n\nThe storage for cache results of all kinds, downloads, cached\ncompilation results from C and Nuitka, is done in a platform dependent\ndirectory as determined by the ``appdirs`` package. However, you can\noverride it with setting the environment variable ``NUITKA_CACHE_DIR``\nto a base directory. This is for use in environments where the home\ndirectory is not persisted, but other paths are.\n\nThere is also per cache control of these caches, here is a table of\nenvironment variables that you can set before starting the compilation,\nto make Nuitka store some of these caches in an entirely separate space.\n\n+------------------+-----------------------------------+----------------------------------------+\n| Cache name       | Environment Variable              | Data Put there                         |\n+==================+===================================+========================================+\n| downloads        | NUITKA_CACHE_DIR_DOWNLOADS        | Downloads made, e.g. dependency walker |\n+------------------+-----------------------------------+----------------------------------------+\n| ccache           | NUITKA_CACHE_DIR_CCACHE           | Object files created by gcc            |\n+------------------+-----------------------------------+----------------------------------------+\n| clcache          | NUITKA_CACHE_DIR_CLCACHE          | Object files created by MSVC           |\n+------------------+-----------------------------------+----------------------------------------+\n| bytecode         | NUITKA_CACHE_DIR_BYTECODE         | Bytecode of demoted modules            |\n+------------------+-----------------------------------+----------------------------------------+\n| dll-dependencies | NUITKA_CACHE_DIR_DLL_DEPENDENCIES | DLL dependencies                       |\n+------------------+-----------------------------------+----------------------------------------+\n\nRunners\n=======\n\nAvoid running the ``nuitka`` binary, doing ``python -m nuitka`` will\nmake a 100% sure you are using what you think you are. Using the wrong\nPython will make it give you ``SyntaxError`` for good code or\n``ImportError`` for installed modules. That is happening, when you run\nNuitka with Python2 on Python3 code and vice versa. By explicitly\ncalling the same Python interpreter binary, you avoid that issue\nentirely.\n\nFastest C Compilers\n===================\n\nThe fastest binaries of ``pystone.exe`` on Windows with 64 bits Python\nproved to be significantly faster with MinGW64, roughly 20% better\nscore. So it is recommended for use over MSVC. Using ``clang-cl.exe`` of\nClang7 was faster than MSVC, but still significantly slower than\nMinGW64, and it will be harder to use, so it is not recommended.\n\nOn Linux, for ``pystone.bin``, the binary produced by ``clang6`` was\nfaster than ``gcc-6.3``, but not by a significant margin. Since gcc is\nmore often already installed, that is recommended to use for now.\n\nDifferences in C compilation times have not yet been examined.\n\nUnexpected Slowdowns\n====================\n\nUsing the Python DLL, like standard CPython does, can lead to unexpected\nslowdowns, e.g. in uncompiled code that works with Unicode strings. This\nis because calling to the DLL rather than residing in the DLL causes\noverhead, and this even happens to the DLL with itself, being slower,\nthan a Python all contained in one binary.\n\nSo if feasible, aim at static linking, which is currently only possible\nwith Anaconda Python on non-Windows, Debian Python2, self compiled\nPythons (do not activate ``--enable-shared``, not needed), and installs\ncreated with ``pyenv``.\n\n.. note::\n\n   On Anaconda, you may need to execute ``conda install\n   libpython-static``\n\nStandalone executables and dependencies\n=======================================\n\nThe process of making standalone executables for Windows traditionally\ninvolves using an external dependency walker to copy necessary libraries\nalong with the compiled executables to the distribution folder.\n\nThere are plenty of ways to find that something is missing. Do not\nmanually copy things into the folder, esp. not DLLs, as that's not going\nto work. Instead, make bug reports to get these handled by Nuitka\nproperly.\n\nWindows errors with resources\n=============================\n\nOn Windows, the Windows Defender tool and the Windows Indexing Service\nboth scan the freshly created binaries, while Nuitka wants to work with\nit, e.g. adding more resources, and then preventing operations randomly\ndue to holding locks. Make sure to exclude your compilation stage from\nthese services.\n\nWindows standalone program redistribution\n=========================================\n\nWhether compiling with MingW or MSVC, the standalone programs have\nexternal dependencies to Visual C Runtime libraries. Nuitka tries to\nship those dependent DLLs by copying them from your system.\n\nBeginning with Microsoft Windows 10, Microsoft ships ``ucrt.dll``\n(Universal C Runtime libraries) which handles calls to\n``api-ms-crt-*.dll``.\n\nWith earlier Windows platforms (and wine/ReactOS), you should consider\ninstalling Visual C runtime libraries before executing a Nuitka\nstandalone compiled program.\n\nDepending on the used C compiler, you'll need the following redist\nversions on the target machines. However, notice that compilation using\nthe 14.3 based version is always recommended, working and best\nsupported, unless you want to target Windows 7.\n\n+------------------+-------------+----------+\n| Visual C version | Redist Year | CPython  |\n+==================+=============+==========+\n| 14.3             | 2022        | 3.11     |\n+------------------+-------------+----------+\n| 14.2             | 2019        | 3.5-3.10 |\n+------------------+-------------+----------+\n| 14.1             | 2017        | 3.5-3.8  |\n+------------------+-------------+----------+\n| 14.0             | 2015        | 3.5-3.8  |\n+------------------+-------------+----------+\n| 10.0             | 2010        | 3.4      |\n+------------------+-------------+----------+\n| 9.0              | 2008        | 2.6, 2.7 |\n+------------------+-------------+----------+\n\nWhen using MingGW64 as downloaded by Nuitka, you'll need the following\nredist versions:\n\n+----------------------------+-------------+---------------------+\n| MingGW64 version           | Redist Year | CPython             |\n+============================+=============+=====================+\n| WinLibs automatic download | 2015        | 2.6, 2.7, 3.4- 3.11 |\n+----------------------------+-------------+---------------------+\n\nOnce the corresponding runtime libraries are installed on the target\nsystem, you may remove all ``api-ms-crt-*.dll`` files from your Nuitka\ncompiled dist folder.\n\nDetecting Nuitka at run time\n============================\n\nNuitka does *not* ``sys.frozen`` unlike other tools because it usually\ntriggers inferior code for no reason. For Nuitka, we have the module\nattribute ``__compiled__`` to test if a specific module was compiled,\nand the function attribute ``__compiled__`` to test if a specific\nfunction was compiled.\n\nProviding extra Options to Nuitka C compilation\n===============================================\n\nNuitka will apply values from the environment variables ``CCFLAGS``,\n``LDFLAGS`` during the compilation on top of what it determines to be\nnecessary. Beware, of course, that is this is only useful if you know\nwhat you are doing, so should this pose issues, raise them only with\nperfect information.\n\nProducing a 32 bit binary on a 64 bit Windows system\n====================================================\n\nNuitka will automatically target the architecture of the Python you are\nusing. If this is 64 bit, it will create a 64 bit binary, if it is 32\nbit, it will create a 32 bit binary. You have the option to select the\nbits when you download the Python. In the output of ``python -m nuitka\n--version`` there is a line for the architecture. It's ``Arch: x86_64``\nfor 64 bits, and just ``Arch: x86`` for 32 bits.\n\nThe C compiler will be picked to match that more or less automatically.\nIf you specify it explicitly, and it mismatches, you will get a warning\nabout the mismatch and informed that your compiler choice was rejected.\n\n********************\n Compilation Report\n********************\n\nWhen you use ``--report=compilation-report.xml`` Nuitka will create an\nXML file with detailed information about the compilation and packaging\nprocess. This is growing in completeness with every release and exposes\nmodule usage attempts, timings of the compilation, plugin influences,\ndata file paths, DLLs, and reasons why things are included or not.\n\nAt this time, the report contains absolute paths in some places, with\nyour private information. The goal is to make this blended out by\ndefault because we also want to become able to compare compilation\nreports from different setups, e.g. with updated packages, and see the\nchanges to Nuitka. The report is, however, recommended for your bug\nreporting.\n\nAlso, another form is available, where the report is free form and\naccording to a Jinja2 template of yours, and one that is included in\nNuitka. The same information as used to produce the XML file is\naccessible. However, right now, this is not yet documented, but we plan\nto add a table with the data. For a reader of the source code that is\nfamiliar with Jinja2, however, it will be easy to do it now already.\n\nIf you have a template, you can use it like this\n``--report-template=your_template.rst.j2:your_report.rst`` and of\ncourse, the usage of restructured text, is only an example. You can use\nMarkdown, your own XML, or whatever you see fit. Nuitka will just expand\nthe template with the compilation report data.\n\nCurrently, the following reports are included in Nuitka. You just use\nthe name as a filename, and Nuitka will pick that one instead.\n\n+---------------+--------------+--------------------------------------------------------+\n| Report Name   | Status       | Purpose                                                |\n+===============+==============+========================================================+\n| LicenseReport | experimental | Distributions used in a compilation with license texts |\n+---------------+--------------+--------------------------------------------------------+\n\n.. note::\n\n   The community can and should contribute more report types and help\n   enhancing the existing ones for good looks.\n\n*************\n Performance\n*************\n\nThis chapter gives an overview, of what to currently expect in terms of\nperformance from Nuitka. It's a work in progress and is updated as we\ngo. The current focus for performance measurements is Python 2.7, but\n3.x is going to follow later.\n\npystone results\n===============\n\nThe results are the top value from this kind of output, running pystone\n1000 times and taking the minimal value. The idea is that the fastest\nrun is most meaningful, and eliminates usage spikes.\n\n.. code:: bash\n\n   echo \"Uncompiled Python2\"\n   for i in {1..100}; do BENCH=1 python2 tests/benchmarks/pystone.py ; done | sort -rn | head -n 1\n   python2 -m nuitka --lto=yes --pgo tests/benchmarks/pystone.py\n   echo \"Compiled Python2\"\n   for i in {1..100}; do BENCH=1 ./pystone.bin ; done | sort -n | head -rn 1\n\n   echo \"Uncompiled Python3\"\n   for i in {1..100}; do BENCH=1 python3 tests/benchmarks/pystone3.py ; done | sort -rn | head -n 1\n   python3 -m nuitka --lto=yes --pgo tests/benchmarks/pystone3.py\n   echo \"Compiled Python3\"\n   for i in {1..100}; do BENCH=1 ./pystone3.bin ; done | sort -rn | head -n 1\n\n+-------------------+-------------------+----------------------+---------------------+\n| Python            | Uncompiled        | Compiled LTO         | Compiled PGO        |\n+===================+===================+======================+=====================+\n| Debian Python 2.7 | 137497.87 (1.000) | 460995.20 (3.353)    | 503681.91 (3.663)   |\n+-------------------+-------------------+----------------------+---------------------+\n| Nuitka Python 2.7 | 144074.78 (1.048) | 479271.51 (3.486)    | 511247.44 (3.718)   |\n+-------------------+-------------------+----------------------+---------------------+\n\nReport issues or bugs\n=====================\n\nShould you encounter any issues, bugs, or ideas, please visit the\n`Nuitka bug tracker <https://github.com/Nuitka/Nuitka/issues>`__ and\nreport them.\n\nBest practices for reporting bugs:\n\n-  Please always include the following information in your report, for\n   the underlying Python version. You can easily copy&paste this into\n   your report. It does contain more information than you think. Do not\n   write something manually. You may always add, of course,\n\n   .. code:: bash\n\n      python -m nuitka --version\n\n-  Try to make your example minimal. That is, try to remove code that\n   does not contribute to the issue as much as possible. Ideally, come\n   up with a small reproducing program that illustrates the issue, using\n   ``print`` with different results when the program runs compiled or\n   native.\n\n-  If the problem occurs spuriously (i.e. not each time), try to set the\n   environment variable ``PYTHONHASHSEED`` to ``0``, disabling hash\n   randomization. If that makes the problem go away, try increasing in\n   steps of 1 to a hash seed value that makes it happen every time,\n   include it in your report.\n\n-  Do not include the created code in your report. Given proper input,\n   it's redundant, and it's not likely that I will look at it without\n   the ability to change the Python or Nuitka source and re-run it.\n\n-  Do not send screenshots of text, that is bad and lazy. Instead,\n   capture text outputs from the console.\n\n***************************\n Unsupported functionality\n***************************\n\nThe ``co_code`` attribute of code objects\n=========================================\n\nThe code objects are empty for native compiled functions. There is no\nbytecode with Nuitka's compiled function objects, so there is no way to\nprovide it.\n\nPDB\n===\n\nThere is no tracing of compiled functions to attach a debugger to.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n## Supported Versions\n\nThere are no LTS supported versions of Nuitka, but mostly the stable version is\nhot-fixed, and would be for security issues. If possible, git rebases would be\ndone just as they are for corruption bugs, which would then allow to use these,\nbut usually newer Nuitka is the expected to use version, with main always being\nas bug free as possible.\n\n| Version | Supported          |\n| ------- | ------------------ |\n| main    | :white_check_mark: |\n| develop | :white_check_mark: |\n\n## Reporting a Vulnerability\n\nWhen you email me at `kay.hayen@gmail.com` with a well defined report, I\nguarantee a reaction within 72h, and correction as soon as possible. Generally\nprivate emails are not acceptable for questions, there I would point to GitHub,\nbut for sensitive information only, it's great.\n"
  },
  {
    "path": "Standard-Plugins-Documentation.rst",
    "content": "#######################################\n Nuitka Standard Plugins Documentation\n#######################################\n\n.. |ups| replace::\n\n   user plugins\n\n.. |sps| replace::\n\n   standard plugins\n\n.. |ops| replace::\n\n   optional standard plugins\n\n****************************\n Background: Nuitka Plugins\n****************************\n\nPlugins are a feature to modify the way how Nuitka compiles Python\nprograms in extremely flexible ways.\n\nPlugins can automatically include data files and additional shared\nlibraries, import modules which are not detectable by source code\nanalysis, modify or extend the to-be-compiled source code, gather\nstatistics, change Nuitka's parameter defaults and much more.\n\nAny number of plugins may be used in each compilation.\n\nPlugins come in two variants: **standard** plugins and **user** plugins.\n\nUser plugins are not part of the Nuitka package: they must be provided\notherwise. To use them in a compilation, Nuitka must be able to find\nthem using their path / filename. If |ups| are specified, Nuitka will\nactivate them **before** it activates any of its standard plugins.\n\nStandard plugins are part of the Nuitka package and thus always\navailable.\n\nNuitka also differentiates between \"mandatory\" and \"optional\" |sps|.\n\n**Mandatory** |sps| are always enabled and \"invisible\" to the user.\nTheir behaviour cannot be influenced other than by modifying them.\n\n**Optional** |sps| must be enabled via the command line parameter\n``--enable-plugin=name``, with an identifying string ``name``. Even when\nnot enabled however, |ops| can detect, whether their use might have been\n\"forgotten\" and issue an appropriate warning.\n\nWhere appropriate, the behaviour of optional |sps| (like with |ups|) can\nbe controlled via *options* (see \"Using Plugin Options\").\n\n*******************\n A Word of Caution\n*******************\n\nAlmost all |ops| are relevant for standalone mode only. Specifying all\nthe right plugins is up to the user and critical for success: For\nexample, if you are using package *numpy* and forget to activate that\nplugin, then your compile will\n\n-  end with no error, but a warning about missing numpy support,\n\n-  not generate a working binary.\n\nAlso:\n\n-  |ups| are able to programmatically enable |ops|, the **reverse is not\n   possible**. The user must know the requirements of his script and\n   specify all appropriate |ops|, including any required *options* (see\n   below).\n\n-  There is currently no way to automatically react to\n   interdependencies. For example, when compiling a script using the\n   *tensorflow* package in standalone mode, you must enable (at least)\n   **both**, the ``tensorflow`` **and** the ``numpy`` plugin.\n\n-  Like every compiler, Nuitka cannot always decide, whether a script\n   will **actually execute** an *import* statement. This knowledge must\n   be provided by you, e.g. with PGO information that is going to be\n   supported.\n\n***********************************\n List of Optional Standard Plugins\n***********************************\n\nCreate a list of available optional |sps| giving their identifier\ntogether with a short description via ``--plugin-list``:\n\nThe following optional standard plugins are available in Nuitka:\n\n.. code::\n\n   anti-bloat            Patch stupid imports out of widely used library modules source codes.\n   data-files\n   data-hiding           Commercial: Hide program constant Python data from offline inspection of created binaries.\n   datafile-inclusion-ng Commercial: Load file trusted file contents at compile time.\n   dill-compat\n   enum-compat\n   ethereum              Commercial: Required for ethereum packages in standalone mode\n   eventlet              Support for including 'eventlet' dependencies and its need for 'dns' package monkey patching\n   gevent                Required by the gevent package\n   gi                    Support for GI dependencies\n   glfw                  Required for glfw in standalone mode\n   implicit-imports\n   multiprocessing       Required by Python's multiprocessing module\n   numpy                 Required for numpy, scipy, pandas, matplotlib, etc.\n   pbr-compat\n   pkg-resources         Resolve version numbers at compile time.\n   pmw-freezer           Required by the Pmw package\n   pylint-warnings       Support PyLint / PyDev linting source markers\n   pyqt5                 Required by the PyQt5 package.\n   pyside2               Required by the PySide2 package.\n   pyside6               Required by the PySide6 package for standalone mode.\n   pyzmq                 Required for pyzmq in standalone mode\n   tensorflow            Required by the tensorflow package\n   tk-inter              Required by Python's Tk modules\n   torch                 Required by the torch / torchvision packages\n   traceback-encryption  Commercial: Encrypt tracebacks (de-Jong-Stacks).\n   windows-service       Commercial: Create Windows Service files\n\n.. note::\n\n   This list is continuously growing and most likely out of date.\n\n*****************************************\n Optional Standard Plugins Documentation\n*****************************************\n\ndill-compat\n===========\n\n-  Required by the *dill* module. Dill extends Python's pickle module\n   for serializing and de-serializing objects.\n\n-  Options: none.\n\neventlet\n========\n\n-  Required by the *eventlet* package. Eventlet is a concurrent\n   networking library.\n\n-  Options: none.\n\ngevent\n======\n\n-  Required by the *gevent* package. Gevent is a coroutine-based Python\n   networking library that uses greenlet to provide a high-level\n   synchronous API.\n\n-  Options: none.\n\npmw-freezer\n===========\n\n-  Required by the *Pmw* package. Pmw is a toolkit for building\n   high-level compound widgets.\n\n-  Options: none.\n\npylint-warnings\n===============\n\n-  Support *PyLint* / *PyDev* linting source markers. Python static code\n   analysis tools which help enforcing a coding standard.\n\n-  Options: none\n\npyside2, pyside6, pyqt5, pyqt6\n==============================\n\n-  Required by the *PySide* and *PyQt* and GUI packages, only one can be\n   activated at a time.\n\n-  Options: With ``--include-qt-plugins`` you can select which Qt\n   plugins to include. By default a relatively small set, called\n   ``sensible`` that is defined in the code is include, but you can add\n   more, and even ``all``, which will add a terrible amount of\n   dependencies though. But without the proper Qt plugins, functionality\n   of Qt might be broken, crashes can occur, or appearance can be\n   inferior.\n\n-  These plugins also inhibit other GUI frameworks from being included\n   in standalone distributions.\n\ntk-inter\n========\n\n-  Required by Python's Tk modules.\n\n-  Options: Can override the automatic detection of Tcl and Tk\n   directories with ``--tk-library-dir`` and ``--tcl-library-dir`` but\n   that should not be needed.\n"
  },
  {
    "path": "UserPlugin-Creation.rst",
    "content": "#############################\n How To Create a User Plugin\n#############################\n\n**********************************************\n Background: Nuitka Standard and User Plugins\n**********************************************\n\nUser plugins are technically built and structured in the same way as\nNuitka's own *standard* plugins are. There also is no difference with\nrespect to what they can do. Both types are invoked via parameters in\nNuitka's command line. The difference is the invocation format:\n\n-  A standard plugin is invoked by ``--enable-plugin=<plugin_name>``.\n   The string ``<plugin_name>`` is a unique identifier by which Nuitka\n   identifies it. As soon as Nuitka has found the corresponding plugin,\n   it will call its initialization method. Nuitka also has some standard\n   plugins which are always activated. A standard plugin is represented\n   by a Python script living in ``nuitka/plugins/standard``. Standard\n   plugins also internally have an object which can issue warnings when\n   it encounters situations looking like it is required.\n\n-  A user plugin is invoked by ``--user-plugin=</path/to/script.py>``.\n   Nuitka will import the script and call its initialization method just\n   like for a standard plugin. The plugin must have a non-empty string\n   specified in its variable ``plugin_name``. It must also not equal one\n   of the de-activated standard plugin strings. Best practice is filling\n   it with the filename, e.g. ``plugin_name == __file__``, because this\n   allows providing it with options. User plugins are always activated\n   once successfully loaded. They therefore have no mechanism to warn if\n   not being used.\n\n*********************\n Example User Plugin\n*********************\n\nThis is a simple demo user plugin. It will display source code lines of\nthe main program if they contain calls to the ``math`` module, if an\noption named \"trace\" is active:\n\n.. code:: python\n\n   import os\n   import sys\n\n   from nuitka import Options\n   from nuitka.plugins.PluginBase import NuitkaPluginBase\n\n   class NuitkaPluginMine(NuitkaPluginBase):\n       # Derive from filename, but can and should also be explicit.\n       plugin_name = __name__.split(\".\")[-1]\n\n       def __init__(self, trace_my_plugin):\n           # demo only: extract and display my options list\n           # check whether some specific option is set\n\n           self.check = trace_my_plugin\n           self.info(\" 'trace' is set to '%s'\" % self.check)\n\n           # do more init work here ...\n\n       @classmethod\n       def addPluginCommandLineOptions(cls, group):\n           group.add_option(\n               \"--trace-my-plugin\",\n               action=\"store_true\",\n               dest=\"trace_my_plugin\",\n               default=False,\n               help=\"This is show in help output.\"\n           )\n\n       def onModuleSourceCode(self, module_name, source_filename, source_code):\n           # if this is the main script and tracing should be done ...\n           if module_name == \"__main__\" and self.check:\n               self.info(\"\")\n               self.info(\" Calls to 'math' module:\")\n               for i, l in enumerate(source_code.splitlines()):\n                   if \"math.\" in l:\n                       self.info(\" %i: %s\" % (i+1, l))\n               self.info(\"\")\n           return source_code\n\nSample invocation line and output:\n\n.. code:: bash\n\n   python -m nuitka --standalone --user-plugin=user_plugin.py=trace script.py\n\n.. code::\n\n   Nuitka:INFO: 'user_plugin.py' options: ['trace']\n   Nuitka:INFO: 'trace' is set to True\n   Nuitka:INFO:User plugin 'user_plugin.py' loaded.\n   Nuitka:INFO:\n   Nuitka:INFO: Calls to 'math' module:\n   Nuitka:INFO: 125: print(math.sqrt(2))\n   Nuitka:INFO:\n\n*************************\n Nuitka Options Overview\n*************************\n\nAbout 60 methods are available to access option information for the\ncurrent Nuitka execution. Import the ``Options`` module (``from nuitka\nimport Options``) and use one of the following.\n\nPlease note that ``str`` results may return ``None``. Except very few,\nthe methods have no argument.\n\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| **Method**                           | **Description**                                                                   |\n+======================================+===================================================================================+\n| assumeYesForDownloads                | *bool* = ``--assume-yes-for-downloads``                                           |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isExperimental                       | *bool*, check for items of ``--experimental=``                                    |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getFileReferenceMode                 | *str*, one of ``runtime``, ``original`` or ``frozen`` (``--file-reference-mode``) |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getWindowsIconPaths                  | *list*, values of Windows icon options                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getLinuxIconPaths                    | *list*, values of Linux icon options                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getMacOSIconPaths                    | *list*, values of macOS icon options                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getJobLimit                          | *int*, value of ``--jobs`` / ``-j`` or number of CPU kernels                      |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getMainArgs                          | *tuple*, arguments following the optional arguments                               |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getMsvcVersion                       | *str*, value of ``--msvc``                                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getMustIncludeModules                | *list*, items of ``--include-module=``                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getMustIncludePackages               | *list*, items of ``--include-package=``                                           |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getOutputDir                         | *str*, value of ``--output-dir``                                                  |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getOutputFilename                    | *str*, value of ``-o``                                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getOutputPath(path)                  | *str*, os.path.join(getOutputDir(), path)                                         |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPluginsDisabled                   | *tuple*, items of ``--disable-plugin=``                                           |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPluginsEnabled                    | *tuple*, enabled plugins (including user plugins)                                 |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPluginOptions(plugin_name)        | *list*, options for specified plugin                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPositionalArgs                    | *tuple*, command line positional arguments                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPythonFlags                       | *list*, value of ``--python-flag``                                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getPythonPathForScons                | *str*, value of ``--python-for-scons``                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getShallFollowExtra                  | *list*, items of ``--include-plugin-directory=``                                  |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getShallFollowExtraFilePatterns      | *list*, items of ``--include-plugin-files=``                                      |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getShallFollowInNoCase               | *list*, items of ``--nofollow-import-to=``                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getShallFollowModules                | *list*, items of ``--follow-import-to=``                                          |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| getUserPlugins                       | *tuple*, items of ``--user-plugin=``                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isAllowedToReexecute                 | *bool* = **not** ``--must-not-re-execute``                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isClang                              | *bool* = ``--clang``                                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isDebug                              | *bool* = ``--debug`` or ``--debugger``                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isExperimental(\"feature\")            | *bool* = ``--experimental=feature``                                               |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isFullCompat                         | *bool* = ``--full-compat``                                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isLto                                | *bool* = ``--lto``                                                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isMingw64                            | *bool* = ``--mingw64``                                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isProfile                            | *bool* = ``--profile``                                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallUsePythonDebug                  | *bool* = ``--python-debug`` or ``sys.flags.debug``                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isRemoveBuildDir                     | *bool* = ``--remove-output``                                                      |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isShowInclusion                      | *bool* = ``--show-modules``                                                       |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isShowMemory                         | *bool* = ``--show-memory``                                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isShowProgress                       | *bool* = ``--show-progress``                                                      |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isShowScons                          | *bool* = ``--show-scons``                                                         |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isStandaloneMode                     | *bool* = ``--standalone``                                                         |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isUnstripped                         | *bool* = ``--unstripped`` or ``--profile``                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| isVerbose                            | *bool* = ``--verbose``                                                            |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallCreatePyiFile                   | *bool* = **not** ``--no-pyi-file``                                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallDetectMissingPlugins            | *bool* = **not** ``--plugin-no-detection``                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallDisableConsoleWindow            | *bool* = ``--win-disable-console``                                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallExecuteImmediately              | *bool* = ``--run``                                                                |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallExplainImports                  | *bool* = ``--explain-imports``                                                    |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallFollowAllImports                | *bool* = ``--follow-imports``                                                     |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallFollowNoImports                 | *bool* = ``--nofollow-imports``                                                   |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallListPlugins                     | *bool* = ``--plugin-list``                                                        |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallMakeModule                      | *bool* = ``--module``                                                             |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallNotDoExecCCompilerCall          | *bool* = ``--generate-c-only``                                                    |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallNotStoreDependsExeCachedResults | *bool* = ``--disable-dll-dependency-cache``                                       |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallNotUseDependsExeCachedResults   | *bool* = ``--disable-dll-dependency-cache`` or                                    |\n|                                      | ``--force-dll-dependency-cache-update``                                           |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallOnlyExecCCompilerCall           | *bool* = ``--recompile-c-only``                                                   |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallRunInDebugger                   | *bool* = ``--debug``                                                              |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallTraceExecution                  | *bool* = ``--trace-execution``                                                    |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallWarnImplicitRaises              | *bool* = ``--warn-implicit-exceptions``                                           |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n| shallWarnUnusualCode                 | *bool* = ``--warn-unusual-code``                                                  |\n+--------------------------------------+-----------------------------------------------------------------------------------+\n"
  },
  {
    "path": "Using-Plugin-Options.rst",
    "content": "###########################\n How To Use Plugin Options\n###########################\n\n****************************\n Background: Nuitka Plugins\n****************************\n\nPlugins are a feature to modify the way how Nuitka compiles Python\nprograms in extremely flexible ways.\n\nPlugins can automatically include data files and additional shared\nlibraries, import modules not detectable by source code examination,\nmodify or extend the to-be-compiled source code, gather statistics,\nchange Nuitka's parameter defaults and much more.\n\nAny number of plugins may be used in each compilation.\n\nA **whole new dimension of flexibility** can be added by using\n**options** to control a plugin's functioning.\n\n**********************\n Option Specification\n**********************\n\n**Standard plugins** are activated by the command line parameter\n``--enable-plugin=<plugin_name>``. The parameter ``plugin_name`` must\nequal the plugin's variable with the same name, so that Nuitka can\nidentify it.\n\n**User plugins** are activated by the command line parameter\n``--user-plugin=<script.py>``, where the parameter is a filename (-path)\nof a Python script implementing the plugin protocol, i.e. it must be a\nclass that inherits ``nuitka.plugins.PluginBase.UserPluginBase`` just\nlike every Nuitka plugin.\n\nPlugin options can be added by overloading the method\n\n.. code:: python\n\n   @classmethod\n   def addPluginCommandLineOptions(cls, group):\n       ...  # add options to \"group\" here.\n\nHere you extend the optparser group with any amount of options you\nchoose. Be careful with the ``dest`` names, try to make names that will\nnot collide with other plugins, as we have no per plugin namespace here.\n\n*********\n Example\n*********\n\nTo see a working example for a user plugin with options, consult `this\n<https://github.com/Nuitka/Nuitka/blob/develop/UserPlugin-Creation.rst>`__\ndocument.\n"
  },
  {
    "path": "bin/autoformat-nuitka-source",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for autoformat tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.auto_format.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/check-nuitka-with-codespell",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for codespell checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.codespell.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/check-nuitka-with-pylint",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for pylint checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.pylint.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/check-nuitka-with-restlint",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for rest lint checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.restlint.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/check-nuitka-with-yamllint",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for yamllint checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.yamllint.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/check-reference-counts",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for reference count checking tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.testing.check_reference_counts.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/compare_with_cpython",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for output comparison tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.testing.compare_with_cpython.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/compare_with_xml",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tool to compare XML outputs of two Nuitka versions.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport difflib\n\nfrom nuitka.tools.testing.Common import my_print\nfrom nuitka.utils.Execution import executeProcess\n\nnuitka1 = sys.argv[1]\nnuitka2 = sys.argv[2]\nfilename = sys.argv[3]\n\nmy_print(\n    \"\"\"\\\nComparing output of '{filename}' using '{nuitka1}' <-> '{nuitka2}' ...\"\"\".format(\n        filename=filename, nuitka1=nuitka1, nuitka2=nuitka2\n    )\n)\n\nextra_options = os.getenv(\"NUITKA_EXTRA_OPTIONS\", \"\")\n\nnuitka1_cmd = \"{nuitka1} --xml {filename}\".format(nuitka1=nuitka1, filename=filename)\nnuitka2_cmd = \"{nuitka2} --xml {filename}\".format(nuitka2=nuitka2, filename=filename)\n\nstdout_nuitka1, stderr_nuitka1, exit_nuitka1 = executeProcess(nuitka1_cmd, shell=True)\nstdout_nuitka2, stderr_nuitka2, exit_nuitka2 = executeProcess(nuitka2_cmd, shell=True)\n\n\ndef makeDiffable(output):\n    result = []\n\n    for line in output.split(b\"\\n\"):\n        line = str(line)\n        result.append(line)\n\n    return result\n\n\ndef compareOutput(kind, out1, out2):\n    diff = difflib.unified_diff(\n        makeDiffable(out1),\n        makeDiffable(out2),\n        \"{program} ({detail})\".format(program=\"nuitka1 \" + filename, detail=kind),\n        \"{program} ({detail})\".format(program=\"nuitka2 \" + filename, detail=kind),\n        None,\n        None,\n        n=3,\n    )\n\n    result = list(diff)\n\n    if result:\n        for line in result:\n            my_print(line, end=\"\\n\" if not line.startswith(\"---\") else \"\")\n        return 1\n    else:\n        return 0\n\n\nexit_code_stdout = compareOutput(\"stdout\", stdout_nuitka1, stdout_nuitka2)\nexit_code_return = exit_nuitka1 != exit_nuitka2\n\nif exit_code_return:\n    my_print(\n        \"\"\"\\\nExit codes {exit_nuitka1:d} ({nuitka1}) != {exit_nuitka2:d} ({nuitka2})\"\"\".format(\n            exit_nuitka1=exit_nuitka1,\n            nuitka1=nuitka1,\n            exit_nuitka2=exit_nuitka2,\n            nuitka2=nuitka2,\n        )\n    )\n\nexit_code = exit_code_stdout or exit_code_return\n\nif exit_code:\n    sys.exit(\"Error, outputs differed.\")\n\nmy_print(\"OK, same outputs.\")\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/find_sxs_modules",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for reporting SxS using extension modules.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.testing.find_sxs_modules.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/generate-specialized-c-code",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for static C code generation tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.specialize.SpecializeC import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/generate-specialized-python-code",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for static Python code generation tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.specialize.SpecializePython import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/measure-construct-performance",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for construct performance tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.testing.measure_construct_performance.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/nuitka",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Nuitka the compiler itself.\n\n\"\"\"\n\n# Import as little as possible initially, because we might be re-executing\n# soon.\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport nuitka.__main__  # false alarm, pylint: disable=I0021,no-name-in-module\n\n# Remove the nuitka package directory again, it might contain other stuff that we\n# do not want added automatically.\ndel sys.path[0]\n\n# The bin folder of the runner can't be that helpful, but got added automatically,\n# so attempt to remove it.\nsys.path = [\n    path_element\n    for path_element in sys.path\n    if os.path.dirname(os.path.abspath(__file__)) != path_element\n]\n\n# Now execute Nuitka in a clean environment.\nnuitka.__main__.main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/nuitka-run",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Nuitka the compiler itself.\n\n\"\"\"\n\n# Import as little as possible initially, because we might be re-executing\n# soon.\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport nuitka.__main__  # false alarm, pylint: disable=I0021,no-name-in-module\n\n# Remove the nuitka package directory again, it might contain other stuff that we\n# do not want added automatically.\ndel sys.path[0]\n\n# The bin folder of the runner can't be that helpful, but got added automatically,\n# so attempt to remove it.\nsys.path = [\n    path_element\n    for path_element in sys.path\n    if os.path.dirname(os.path.abspath(__file__)) != path_element\n]\n\n# Now execute Nuitka in a clean environment.\nnuitka.__main__.main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/nuitka-watch",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Nuitka watch tool.\n\nFor the \"Nuitka-Watch\" repository, this is intended to scan it and execute\ntest cases for detecting PyPI updates that cause regressions, or changes in\nNuitka that do.\n\n\"\"\"\n\n\n# Import as little as possible initially, because we might be re-executing\n# soon.\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.watch.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/nuitka3",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Nuitka the compiler itself.\n\n\"\"\"\n\n# Import as little as possible initially, because we might be re-executing\n# soon.\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport nuitka.__main__\n\nnuitka.__main__.main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/nuitka3-run",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Nuitka the compiler itself.\n\n\"\"\"\n\n# Import as little as possible initially, because we might be re-executing\n# soon.\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport nuitka.__main__\n\nnuitka.__main__.main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "bin/run-inside-nuitka-container",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for running a script inside a container\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought to be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.podman.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "debian/README.source",
    "content": "\nThe source used to build Nuitka has modifications compared to normal releases:\n\n- The benchmark programs are not included. They are not really useful and can\n  be used from other sources in a better way.\n\n- The inline copy of scons and appdirs are removed. It is not needed as the\n  dependency on scons leads to an installed scons in the system. The\n  original package uses the installed scons in preference, so the inline\n  copy would (at best) only be dead code.\n"
  },
  {
    "path": "debian/changelog",
    "content": "nuitka (2.2~rc4+ds-1) unstable; urgency=medium\n\n  * New upstream pre-release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 06 Apr 2024 15:37:16 +0200\n\nnuitka (2.1.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 06 Apr 2024 13:02:40 +0200\n\nnuitka (2.1.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 27 Mar 2024 01:02:54 +0100\n\nnuitka (2.1.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 21 Mar 2024 11:07:28 +0100\n\nnuitka (2.1.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 14 Mar 2024 10:05:02 +0100\n\nnuitka (2.1.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 11 Mar 2024 18:02:57 +0100\n\nnuitka (2.1+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 04 Mar 2024 10:14:00 +0100\n\nnuitka (2.0.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 01 Mar 2024 13:27:15 +0100\n\nnuitka (2.0.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 26 Feb 2024 16:39:28 +0100\n\nnuitka (2.0.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 25 Feb 2024 11:23:55 +0100\n\nnuitka (2.0.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 18 Feb 2024 10:37:35 +0100\n\nnuitka (2.0.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 09 Feb 2024 12:18:45 +0100\n\nnuitka (2.0.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 02 Feb 2024 16:21:39 +0100\n\nnuitka (2.0+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 26 Jan 2024 12:44:50 +0100\n\nnuitka (1.9.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 07 Jan 2024 06:26:44 +0100\n\nnuitka (1.9.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 29 Dec 2023 14:52:54 +0100\n\nnuitka (1.9.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 14 Dec 2023 13:50:11 +0100\n\nnuitka (1.9.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 06 Dec 2023 21:58:31 +0100\n\nnuitka (1.9.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 01 Dec 2023 14:35:43 +0100\n\nnuitka (1.9.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 27 Nov 2023 04:42:21 +0100\n\nnuitka (1.9.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 24 Nov 2023 12:45:23 +0100\n\nnuitka (1.9+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 21 Nov 2023 07:05:50 +0100\n\nnuitka (1.8.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 11 Nov 2023 12:02:30 +0100\n\nnuitka (1.8.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 27 Oct 2023 12:46:19 +0200\n\nnuitka (1.8.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 08 Oct 2023 12:01:03 +0200\n\nnuitka (1.8.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 28 Sep 2023 15:30:04 +0200\n\nnuitka (1.8.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 19 Sep 2023 05:39:14 +0200\n\nnuitka (1.8.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 10 Sep 2023 11:03:41 +0200\n\nnuitka (1.8+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 31 Aug 2023 01:32:29 +0200\n\nnuitka (1.7.10+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 11 Aug 2023 12:06:42 +0200\n\nnuitka (1.7.9+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 03 Aug 2023 19:53:32 +0200\n\nnuitka (1.7.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 01 Aug 2023 13:48:24 +0200\n\nnuitka (1.7.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 27 Jul 2023 11:57:01 +0200\n\nnuitka (1.7.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 22 Jul 2023 11:47:47 +0200\n\nnuitka (1.7.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 14 Jul 2023 04:09:33 +0200\n\nnuitka (1.7.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 11 Jul 2023 14:54:05 +0200\n\nnuitka (1.7.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 09 Jul 2023 18:53:35 +0200\n\nnuitka (1.7.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 07 Jul 2023 09:40:11 +0200\n\nnuitka (1.7.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 05 Jul 2023 16:29:43 +0200\n\nnuitka (1.7+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 03 Jul 2023 10:57:55 +0200\n\nnuitka (1.6.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 22 Jun 2023 04:01:33 +0200\n\nnuitka (1.6.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 19 Jun 2023 15:31:28 +0200\n\nnuitka (1.6.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 10 Jun 2023 09:34:49 +0200\n\nnuitka (1.6.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 09 Jun 2023 12:00:01 +0200\n\nnuitka (1.6.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 05 Jun 2023 11:35:18 +0200\n\nnuitka (1.6+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 28 May 2023 21:05:53 +0200\n\nnuitka (1.5.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 15 May 2023 10:19:45 +0200\n\nnuitka (1.5.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 24 Apr 2023 16:45:23 +0200\n\nnuitka (1.5.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 15 May 2023 10:19:45 +0200\n\nnuitka (1.5.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 24 Apr 2023 16:45:23 +0200\n\nnuitka (1.5.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 11 Apr 2023 10:09:53 +0200\n\nnuitka (1.5.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 04 Apr 2023 08:43:30 +0200\n\nnuitka (1.5.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 26 Mar 2023 10:24:29 +0200\n\nnuitka (1.5.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 16 Mar 2023 20:51:55 +0100\n\nnuitka (1.5.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 16 Mar 2023 13:44:56 +0100\n\nnuitka (1.5.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 13 Mar 2023 15:52:36 +0100\n\nnuitka (1.5+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 11 Mar 2023 15:55:37 +0100\n\nnuitka (1.4.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 21 Feb 2023 09:18:59 +0100\n\nnuitka (1.4.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 13 Feb 2023 14:38:57 +0100\n\nnuitka (1.4.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 12 Feb 2023 19:11:46 +0100\n\nnuitka (1.4.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 10 Feb 2023 07:36:27 +0100\n\nnuitka (1.4.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 07 Feb 2023 19:03:45 +0100\n\nnuitka (1.4.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 04 Feb 2023 07:24:47 +0100\n\nnuitka (1.4.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 31 Jan 2023 07:17:15 +0100\n\nnuitka (1.4.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 29 Jan 2023 23:21:23 +0100\n\nnuitka (1.4+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 26 Jan 2023 14:56:48 +0100\n\nnuitka (1.3.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 16 Jan 2023 11:05:41 +0100\n\nnuitka (1.3.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 09 Jan 2023 16:51:14 +0100\n\nnuitka (1.3.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 06 Jan 2023 09:10:31 +0100\n\nnuitka (1.3.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 01 Jan 2023 09:39:39 +0100\n\nnuitka (1.3.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 28 Dec 2022 21:20:25 +0100\n\nnuitka (1.3.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 26 Dec 2022 10:39:49 +0100\n\nnuitka (1.3.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 23 Dec 2022 08:19:05 +0100\n\nnuitka (1.3.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 21 Dec 2022 19:14:46 +0100\n\nnuitka (1.3+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 21 Dec 2022 13:14:49 +0100\n\nnuitka (1.2.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 13 Dec 2022 11:16:23 +0100\n\nnuitka (1.2.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 08 Dec 2022 07:18:44 +0100\n\nnuitka (1.2.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 07 Dec 2022 15:57:44 +0100\n\nnuitka (1.2.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 03 Dec 2022 13:45:31 +0100\n\nnuitka (1.2.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 26 Nov 2022 11:07:57 +0100\n\nnuitka (1.2.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 19 Nov 2022 17:05:08 +0100\n\nnuitka (1.2.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 16 Nov 2022 17:15:00 +0100\n\nnuitka (1.2+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 08 Nov 2022 09:42:28 +0100\n\nnuitka (1.1.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n  * Handle Debian sid change in release number (Closes: #1022400)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 26 Oct 2022 14:46:14 +0200\n\nnuitka (1.1.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 19 Oct 2022 18:36:12 +0200\n\nnuitka (1.1.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 14 Oct 2022 08:19:39 +0200\n\nnuitka (1.1.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 14 Oct 2022 08:19:33 +0200\n\nnuitka (1.1.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 08 Oct 2022 17:40:59 +0200\n\nnuitka (1.1.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 04 Oct 2022 14:39:39 +0200\n\nnuitka (1.1.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 02 Oct 2022 11:10:07 +0200\n\nnuitka (1.1+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 25 Sep 2022 18:58:01 +0200\n\nnuitka (1.0.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 19 Sep 2022 08:18:45 +0200\n\nnuitka (1.0.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 11 Sep 2022 10:34:06 +0200\n\nnuitka (1.0.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 23 Aug 2022 20:07:27 +0200\n\nnuitka (1.0.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 21 Aug 2022 08:24:28 +0200\n\nnuitka (1.0.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 13 Aug 2022 16:13:29 +0200\n\nnuitka (1.0.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 10 Aug 2022 13:16:19 +0200\n\nnuitka (1.0.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 08 Aug 2022 08:13:46 +0200\n\nnuitka (1.0.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 04 Aug 2022 16:55:17 +0200\n\nnuitka (1.0+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 30 Jul 2022 16:16:40 +0200\n\nnuitka (0.9.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 17 Jul 2022 18:40:22 +0200\n\nnuitka (0.9.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 15 Jul 2022 13:59:28 +0200\n\nnuitka (0.9.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 07 Jul 2022 09:24:53 +0200\n\nnuitka (0.9.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 02 Jul 2022 18:49:29 +0200\n\nnuitka (0.9.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 30 Jun 2022 08:40:14 +0200\n\nnuitka (0.9.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 26 Jun 2022 10:41:06 +0200\n\nnuitka (0.9+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n  * Python 3.10 is now compatible again. (Closes: #1006051)\n\n  * Solved CVE-2022-2054 (Closes: #1012762)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 23 Jun 2022 08:36:25 +0200\n\nnuitka (0.8.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 07 Jun 2022 17:21:39 +0200\n\nnuitka (0.8.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 28 May 2022 14:59:01 +0200\n\nnuitka (0.8.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 26 May 2022 08:23:28 +0200\n\nnuitka (0.8.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 23 May 2022 08:31:51 +0200\n\nnuitka (0.8+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 19 May 2022 14:24:06 +0200\n\nnuitka (0.7.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 01 Apr 2022 12:01:36 +0200\n\nnuitka (0.7.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 19 Mar 2022 13:44:59 +0100\n\nnuitka (0.7.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 14 Mar 2022 18:55:11 +0100\n\nnuitka (0.7.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 12 Mar 2022 13:50:50 +0100\n\nnuitka (0.7.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 27 Feb 2022 13:58:34 +0100\n\nnuitka (0.7.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 26 Feb 2022 16:54:03 +0100\n\nnuitka (0.7.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 24 Feb 2022 13:22:40 +0100\n\nnuitka (0.7+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 20 Feb 2022 09:09:50 +0100\n\nnuitka (0.6.19.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 11 Feb 2022 14:37:34 +0100\n\nnuitka (0.6.19.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 03 Feb 2022 10:30:39 +0100\n\nnuitka (0.6.19.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 01 Feb 2022 18:53:20 +0100\n\nnuitka (0.6.19.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 19 Jan 2022 10:02:04 +0100\n\nnuitka (0.6.19.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 16 Jan 2022 11:32:51 +0100\n\nnuitka (0.6.19.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 14 Jan 2022 11:03:16 +0100\n\nnuitka (0.6.19.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 11 Jan 2022 07:59:24 +0100\n\nnuitka (0.6.19+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 09 Jan 2022 13:14:29 +0100\n\nnuitka (0.6.18.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 29 Dec 2021 19:42:43 +0100\n\nnuitka (0.6.18.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 20 Dec 2021 13:41:00 +0100\n\nnuitka (0.6.18.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 16 Dec 2021 08:31:41 +0100\n\nnuitka (0.6.18.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 10 Dec 2021 17:49:19 +0100\n\nnuitka (0.6.18.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 09 Dec 2021 14:52:56 +0100\n\nnuitka (0.6.18.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 04 Dec 2021 18:39:19 +0100\n\nnuitka (0.6.18+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 02 Dec 2021 17:33:56 +0100\n\nnuitka (0.6.17.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 15 Nov 2021 14:33:27 +0100\n\nnuitka (0.6.17.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 08 Nov 2021 14:07:11 +0100\n\nnuitka (0.6.17.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 28 Oct 2021 11:52:02 +0200\n\nnuitka (0.6.17.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 21 Oct 2021 13:03:34 +0200\n\nnuitka (0.6.17.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 14 Oct 2021 10:32:17 +0200\n\nnuitka (0.6.17.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 05 Oct 2021 17:21:29 +0200\n\nnuitka (0.6.17.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 29 Sep 2021 12:28:39 +0200\n\nnuitka (0.6.17+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 27 Sep 2021 13:38:42 +0200\n\nnuitka (0.6.16.5+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 06 Sep 2021 10:46:40 +0200\n\nnuitka (0.6.16.4+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 25 Aug 2021 11:51:44 +0200\n\nnuitka (0.6.16.3+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 07 Aug 2021 18:14:58 +0200\n\nnuitka (0.6.16.2+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 02 Jul 2021 10:40:08 +0200\n\nnuitka (0.6.16.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 25 Jun 2021 16:45:43 +0200\n\nnuitka (0.6.16+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 24 Jun 2021 11:52:37 +0200\n\nnuitka (0.6.15.3+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 06 Jun 2021 12:18:06 +0200\n\nnuitka (0.6.15.2+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 03 Jun 2021 11:41:07 +0200\n\nnuitka (0.6.15.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 31 May 2021 17:12:04 +0200\n\nnuitka (0.6.15+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 24 May 2021 12:26:59 +0200\n\nnuitka (0.6.14.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 10 May 2021 16:25:14 +0200\n\nnuitka (0.6.14.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 03 May 2021 07:57:04 +0200\n\nnuitka (0.6.14.5+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 22 Apr 2021 08:51:05 +0200\n\nnuitka (0.6.14.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 18 Apr 2021 16:13:42 +0200\n\nnuitka (0.6.14.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 18 Apr 2021 10:29:07 +0200\n\nnuitka (0.6.14.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 17 Apr 2021 11:03:23 +0200\n\nnuitka (0.6.14.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 16 Apr 2021 07:49:30 +0200\n\nnuitka (0.6.14+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 15 Apr 2021 11:09:55 +0200\n\nnuitka (0.6.13.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 04 Apr 2021 11:11:56 +0200\n\nnuitka (0.6.13.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 27 Mar 2021 19:44:51 +0100\n\nnuitka (0.6.13.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 26 Mar 2021 14:28:02 +0100\n\nnuitka (0.6.13+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 17 Mar 2021 08:58:23 +0100\n\nnuitka (0.6.12.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 11 Mar 2021 12:16:01 +0100\n\nnuitka (0.6.12.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 21 Feb 2021 06:04:51 +0100\n\nnuitka (0.6.12.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 14 Feb 2021 14:25:06 +0100\n\nnuitka (0.6.12.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 10 Feb 2021 00:23:11 +0100\n\nnuitka (0.6.12+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 09 Feb 2021 11:08:35 +0100\n\nnuitka (0.6.11.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 07 Feb 2021 19:59:48 +0100\n\nnuitka (0.6.11.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 01 Feb 2021 12:17:21 +0100\n\nnuitka (0.6.11.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 27 Jan 2021 17:09:48 +0100\n\nnuitka (0.6.11.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 26 Jan 2021 11:16:07 +0100\n\nnuitka (0.6.11.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 25 Jan 2021 20:14:39 +0100\n\nnuitka (0.6.11.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 24 Jan 2021 17:55:22 +0100\n\nnuitka (0.6.11+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 23 Jan 2021 10:01:54 +0100\n\nnuitka (0.6.10.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 07 Jan 2021 11:04:59 +0100\n\nnuitka (0.6.10.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 29 Dec 2020 16:17:44 +0100\n\nnuitka (0.6.10.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 24 Dec 2020 16:30:17 +0100\n\nnuitka (0.6.10.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 20 Dec 2020 10:56:00 +0100\n\nnuitka (0.6.10.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 13 Dec 2020 19:47:53 +0100\n\nnuitka (0.6.10+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 07 Dec 2020 12:44:03 +0100\n\nnuitka (0.6.9.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 16 Nov 2020 11:20:22 +0100\n\nnuitka (0.6.9.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 04 Nov 2020 08:32:22 +0100\n\nnuitka (0.6.9.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 30 Oct 2020 13:49:19 +0100\n\nnuitka (0.6.9.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 19 Oct 2020 10:55:17 +0200\n\nnuitka (0.6.9.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 12 Oct 2020 17:17:10 +0200\n\nnuitka (0.6.9.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 04 Oct 2020 12:47:36 +0200\n\nnuitka (0.6.9.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 19 Sep 2020 14:38:08 +0200\n\nnuitka (0.6.9+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 14 Sep 2020 15:40:36 +0200\n\nnuitka (0.6.8.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n  * Source only upload. (Closes: #961896)\n\n  * Updated VCS URLs. (Closes: #961895)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 06 Jun 2020 09:58:32 +0200\n\nnuitka (0.6.8.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 23 May 2020 13:56:13 +0200\n\nnuitka (0.6.8.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 21 May 2020 15:04:13 +0200\n\nnuitka (0.6.8.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n  * Corrected copyright file format to not have emails.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 15 May 2020 08:32:39 +0200\n\nnuitka (0.6.8+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n  * Changed dependencies to prefer Debian 11 packages.\n    (Closes: #937166).\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 11 May 2020 16:41:34 +0200\n\nnuitka (0.6.7+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n  * The rst2pdf dependency is finally fixed\n    (Closes: #943645) (Closes: #947573).\n\n  * Enabled package build without Python2 (Closes: #937166)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 23 Jan 2020 12:34:10 +0100\n\nnuitka (0.6.6+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 27 Dec 2019 08:47:38 +0100\n\nnuitka (0.6.6~rc7+ds-1) unstable; urgency=medium\n\n  * New upstream pre-release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 24 Sep 2019 08:49:41 +0200\n\nnuitka (0.6.5+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 27 Jul 2019 12:07:20 +0200\n\nnuitka (0.6.4+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 07 Jun 2019 23:30:22 +0200\n\nnuitka (0.6.3.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 25 Apr 2019 22:08:36 +0200\n\nnuitka (0.6.3+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 04 Apr 2019 06:12:30 +0200\n\nnuitka (0.6.2+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 16 Feb 2019 08:48:51 +0100\n\nnuitka (0.6.1.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 24 Jan 2019 09:13:53 +0100\n\nnuitka (0.6.1+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n  * Depend on python-pil over python-imaging (Closes: #917694).\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 05 Jan 2019 12:41:57 +0100\n\nnuitka (0.6.0.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 31 Oct 2018 09:03:57 +0100\n\nnuitka (0.6.0.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 18 Oct 2018 23:11:34 +0200\n\nnuitka (0.6.0.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 14 Oct 2018 08:26:48 +0200\n\nnuitka (0.6.0.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 06 Oct 2018 10:43:33 +0200\n\nnuitka (0.6.0.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 03 Oct 2018 10:41:52 +0200\n\nnuitka (0.6.0.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 27 Sep 2018 09:57:05 +0200\n\nnuitka (0.6.0+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 26 Sep 2018 07:00:04 +0200\n\nnuitka (0.5.33+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 13 Sep 2018 19:01:48 +0200\n\nnuitka (0.5.32.8+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 04 Sep 2018 14:58:47 +0200\n\nnuitka (0.5.32.7+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 23 Aug 2018 22:06:00 +0200\n\nnuitka (0.5.32.6+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 23 Aug 2018 20:05:18 +0200\n\nnuitka (0.5.32.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 15 Aug 2018 19:06:01 +0200\n\nnuitka (0.5.32.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 10 Aug 2018 12:06:44 +0200\n\nnuitka (0.5.32.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 04 Aug 2018 10:40:31 +0200\n\nnuitka (0.5.32.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 01 Aug 2018 17:38:43 +0200\n\nnuitka (0.5.32.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 28 Jul 2018 20:16:29 +0200\n\nnuitka (0.5.32+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 28 Jul 2018 15:07:21 +0200\n\nnuitka (0.5.31+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 09 Jul 2018 08:23:02 +0200\n\nnuitka (0.5.30+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 30 Apr 2018 09:50:54 +0200\n\nnuitka (0.5.29.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 25 Apr 2018 09:33:55 +0200\n\nnuitka (0.5.29.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 09 Apr 2018 20:22:37 +0200\n\nnuitka (0.5.29.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 31 Mar 2018 16:12:25 +0200\n\nnuitka (0.5.29.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 29 Mar 2018 10:19:24 +0200\n\nnuitka (0.5.29.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 27 Mar 2018 18:22:54 +0200\n\nnuitka (0.5.29+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 26 Mar 2018 20:13:44 +0200\n\nnuitka (0.5.28.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 29 Nov 2017 15:09:28 +0100\n\nnuitka (0.5.28.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Also ignore sbuild non-existent directory (Closes: #871125).\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 22 Oct 2017 10:44:31 +0200\n\nnuitka (0.5.28+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 17 Oct 2017 10:03:56 +0200\n\nnuitka (0.5.27+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 22 Jul 2017 16:21:37 +0200\n\nnuitka (0.5.26.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Recommend actual PyQT package (Closes: #866540).\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 03 Jul 2017 08:59:37 +0200\n\nnuitka (0.5.26.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 22 Jun 2017 08:08:53 +0200\n\nnuitka (0.5.26.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 17 Jun 2017 11:37:12 +0200\n\nnuitka (0.5.26.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 10 Jun 2017 13:09:51 +0200\n\nnuitka (0.5.26+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 07 Jun 2017 08:15:19 +0200\n\nnuitka (0.5.25+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 24 Jan 2017 06:13:46 +0100\n\nnuitka (0.5.24.4+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Better detection of acceptable shared library loads from\n    system paths for standalone tests (Closes: #844902).\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 10 Dec 2016 12:25:35 +0100\n\nnuitka (0.5.24.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 09 Dec 2016 06:50:55 +0100\n\nnuitka (0.5.24.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 30 Nov 2016 09:32:03 +0100\n\nnuitka (0.5.24.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 16 Nov 2016 08:16:53 +0100\n\nnuitka (0.5.24+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 14 Nov 2016 09:41:31 +0100\n\nnuitka (0.5.23.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 07 Nov 2016 07:55:11 +0100\n\nnuitka (0.5.23.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Use of C11 compiler instead of C++ compiler, so we drop the\n    versioned dependencies. (Closes: #835954)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 16 Oct 2016 10:40:59 +0200\n\nnuitka (0.5.23+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 02 Oct 2016 18:14:41 +0200\n\nnuitka (0.5.22+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 16 Aug 2016 11:22:16 +0200\n\nnuitka (0.5.21.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 26 May 2016 14:51:39 +0200\n\nnuitka (0.5.21.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 14 May 2016 14:43:28 +0200\n\nnuitka (0.5.21.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n  * Depends on g++-5 now.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 30 Apr 2016 07:59:57 +0200\n\nnuitka (0.5.21+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 24 Apr 2016 14:06:29 +0200\n\nnuitka (0.5.20+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 20 Mar 2016 08:11:16 +0100\n\nnuitka (0.5.19.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 15 Mar 2016 09:11:57 +0100\n\nnuitka (0.5.19+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 01 Feb 2016 07:53:08 +0100\n\nnuitka (0.5.18.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 24 Jan 2016 07:52:03 +0100\n\nnuitka (0.5.18+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 15 Jan 2016 07:48:41 +0100\n\nnuitka (0.5.17.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 14 Jan 2016 23:21:51 +0100\n\nnuitka (0.5.17+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 27 Dec 2015 15:18:39 +0100\n\nnuitka (0.5.16.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 03 Dec 2015 07:04:12 +0100\n\nnuitka (0.5.16+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 09 Nov 2015 18:30:07 +0100\n\nnuitka (0.5.15+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 12 Oct 2015 08:57:03 +0200\n\nnuitka (0.5.14.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 13 Sep 2015 12:26:59 +0200\n\nnuitka (0.5.14.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 07 Sep 2015 00:30:11 +0200\n\nnuitka (0.5.14.1+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 06 Sep 2015 22:37:22 +0200\n\nnuitka (0.5.14+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 27 Aug 2015 06:24:11 +0200\n\nnuitka (0.5.13.8+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 20 Aug 2015 11:55:53 +0200\n\nnuitka (0.5.13.7+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 18 Aug 2015 21:55:08 +0200\n\nnuitka (0.5.13.6+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 16 Aug 2015 14:38:46 +0200\n\nnuitka (0.5.13.5+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 16 Aug 2015 13:42:02 +0200\n\nnuitka (0.5.13.4+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 31 Jul 2015 17:24:40 +0200\n\nnuitka (0.5.13.3+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 29 Jul 2015 10:54:05 +0200\n\nnuitka (0.5.13.2+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 16 Jun 2015 10:29:12 +0200\n\nnuitka (0.5.13.1+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 04 May 2015 09:27:19 +0200\n\nnuitka (0.5.13+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 01 May 2015 10:44:27 +0200\n\nnuitka (0.5.12.2+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 26 Apr 2015 08:51:37 +0200\n\nnuitka (0.5.12.1+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 18 Apr 2015 09:35:06 +0200\n\nnuitka (0.5.12+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 06 Apr 2015 17:20:44 +0200\n\nnuitka (0.5.11.2+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 26 Mar 2015 20:09:06 +0100\n\nnuitka (0.5.11.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 23 Mar 2015 10:34:17 +0100\n\nnuitka (0.5.11+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Wed, 18 Mar 2015 08:38:39 +0100\n\nnuitka (0.5.10.2+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 10 Mar 2015 07:46:24 +0100\n\nnuitka (0.5.10.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 08 Mar 2015 11:56:55 +0100\n\nnuitka (0.5.10+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 05 Mar 2015 07:43:43 +0100\n\nnuitka (0.5.9+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 29 Jan 2015 08:18:06 +0100\n\nnuitka (0.5.8+ds-1) experimental; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 15 Jan 2015 04:11:03 +0100\n\nnuitka (0.5.7.1+ds-1) experimental; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 09 Jan 2015 13:52:15 +0100\n\nnuitka (0.5.7+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 01 Jan 2015 10:52:03 +0100\n\nnuitka (0.5.6.1+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 21 Dec 2014 08:32:58 +0100\n\nnuitka (0.5.6+ds-1) UNRELEASED; urgency=medium\n\n  * New upstream release.\n  * Added support for hardening-wrapper to be installed.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 19 Dec 2014 08:39:17 +0100\n\nnuitka (0.5.5.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Added support for armhf architecture.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 24 Oct 2014 17:33:59 +0200\n\nnuitka (0.5.5.2+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n  * Bump to Standards Version 3.9.6, no changes needed.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 17 Oct 2014 07:56:05 +0200\n\nnuitka (0.5.5+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sun, 05 Oct 2014 19:28:20 +0200\n\nnuitka (0.5.4.3+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 21 Aug 2014 09:41:37 +0200\n\nnuitka (0.5.3.5+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 18 Jul 2014 07:28:17 +0200\n\nnuitka (0.5.3.3+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n  * Original version didn't build for all versions due to error message\n    changes, this release adapts to.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Sat, 12 Jul 2014 20:50:01 +0200\n\nnuitka (0.5.2+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n  * Permit building using cowbuilder, eatmydata (Closes: #749518)\n  * Do not require gcc in build-depends\n    (Closes: #747984) (Closes: #748005) (Closes: #751325)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 23 Jun 2014 08:17:57 +0200\n\nnuitka (0.5.1.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 06 Mar 2014 10:44:28 +0100\n\nnuitka (0.5.1+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Thu, 06 Mar 2014 09:33:51 +0100\n\nnuitka (0.5.0.1+ds-1) unstable; urgency=medium\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 13 Jan 2014 23:37:37 +0100\n\nnuitka (0.5.0+ds-1) unstable; urgency=medium\n\n  * New upstream release.\n  * Added missing build dependency to process PNG images.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Fri, 03 Jan 2014 19:18:18 +0100\n\nnuitka (0.4.7.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kay.hayen@gmail.com>  Tue, 03 Dec 2013 08:44:31 +0100\n\nnuitka (0.4.7+ds-1) UNRELEASED; urgency=low\n\n  * New upstream release.\n  * Handle unknown encoding error message change of CPython 2.7.6\n    that was backported to CPython 2.7.5+ as well.\n    (Closes: #730956)\n\n -- Kay Hayen <kay.hayen@gmail.com>  Mon, 02 Dec 2013 09:15:12 +0100\n\nnuitka (0.4.6.2+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Fri, 01 Nov 2013 19:07:42 +0100\n\nnuitka (0.4.6+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 27 Oct 2013 21:29:26 +0100\n\nnuitka (0.4.5.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#106.\n\n -- Kay Hayen <kayhayen@gmx.de>  Wed, 25 Sep 2013 14:29:55 +0200\n\nnuitka (0.4.5+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 18 Aug 2013 09:06:29 +0200\n\nnuitka (0.4.4.2+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#98.\n  * Corrects upstream Issue#100.\n  * Corrects upstream Issue#101.\n  * Corrects upstream Issue#102.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 20 Jul 2013 09:08:29 +0200\n\nnuitka (0.4.4.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#95.\n  * Corrects upstream Issue#96.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 13 Jul 2013 11:56:21 +0200\n\nnuitka (0.4.4+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Upstream now supports Python3.3 and threads.\n  * Bump to Standards Version 3.9.4, no changes needed.\n  * Fix support for modules and Python3 was broken (Closes: #711459)\n  * Fix encoding error changes  Python 2.7.5 (Closes: #713531)\n\n -- Kay Hayen <kayhayen@gmx.de>  Tue, 25 Jun 2013 10:46:40 +0200\n\nnuitka (0.4.3+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 18 May 2013 10:16:25 +0200\n\nnuitka (0.4.2+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Fri, 29 Mar 2013 11:05:08 +0100\n\nnuitka (0.4.1+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Tue, 05 Mar 2013 08:15:41 +0100\n\nnuitka (0.4.0+ds-1) UNRELEASED; urgency=low\n\n  * New upstream release.\n  * Changes so the Debian package can be backported to Squeeze as well.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 09 Feb 2013 10:08:15 +0100\n\nnuitka (0.3.25+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Register the User Manual with \"doc-base\".\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 11 Nov 2012 13:57:32 +0100\n\nnuitka (0.3.24.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#46.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 08 Sep 2012 22:30:11 +0000\n\nnuitka (0.3.24+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Detect the absence of \"g++\" and gracefully fallback to the\n    compiler depended on. (Closes: #682146)\n  * Changed usage of \"temp\" files in developer scripts to be\n    secure. (Closes: #682145)\n  * Added support for \"DEB_BUILD_OPTIONS=nocheck\" to skip the\n    test runs. (Closes: #683090)\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 18 Aug 2012 21:19:17 +0200\n\nnuitka (0.3.23.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#40, Issue#41, and Issue#42.\n\n -- Kay Hayen <kayhayen@gmx.de>  Mon, 16 Jul 2012 07:25:41 +0200\n\nnuitka (0.3.23+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * License for Nuitka is now Apache License 2.0, no more GPLv3.\n  * Corrects upstream Issue#37 and Issue#38.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 01 Jul 2012 00:00:57 +0200\n\nnuitka (0.3.22.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrected copyright file syntax error found by new lintian\n    version.\n  * Corrects upstream Issue#19.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 16 Jun 2012 08:58:30 +0200\n\nnuitka (0.3.22+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 13 May 2012 12:51:16 +0200\n\nnuitka (0.3.21+ds-1) unstable; urgency=low\n\n  * New upstream release.\n\n -- Kay Hayen <kayhayen@gmx.de>  Thu, 12 Apr 2012 20:24:01 +0200\n\nnuitka (0.3.20.2+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#35.\n  * Bump to Standards Version 3.9.3, no changes needed.\n  * In the alternative build dependencies, designed to make the\n    Python3 build dependency optional, put option that is going\n    to work on \"unstable\" first. (Closes: #665021)\n\n -- Kay Hayen <kayhayen@gmx.de>  Tue, 03 Apr 2012 22:31:36 +0200\n\nnuitka (0.3.20.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#34.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 03 Mar 2012 10:18:30 +0100\n\nnuitka (0.3.20+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Added upstream \"Changelog.rst\" as \"changelog\"\n\n -- Kay Hayen <kayhayen@gmx.de>  Mon, 27 Feb 2012 09:32:10 +0100\n\nnuitka (0.3.19.2+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#32.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 12 Feb 2012 20:33:30 +0100\n\nnuitka (0.3.19.1+ds-1) unstable; urgency=low\n\n  * New upstream hotfix release.\n  * Corrects upstream Issue#30 and Issue#31.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sat, 28 Jan 2012 07:27:38 +0100\n\nnuitka (0.3.19+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Improvements to option groups layout in manpages, and broken\n    whitespace for \"--recurse-to\" option. (Closes: #655910)\n  * Documented new option \"--recurse-directory\" in man page with\n    example.\n  * Made the \"debian/watch\" file ignore upstream pre-releases,\n    these shall not be considered for this package.\n  * Aligned depended version with build depended versions.\n  * Depend on \"python-dev\" as well, needed to compile against\n    \"libpython\".\n  * Build depend on \"python-dev-all\" and \"python-dbg-all\" to\n    execute tests with both all supported Python versions.\n  * Build depend on \"python3.2-dev-all\" and \"python3-dbg-all\"\n    to execute tests with Python3 as well. It is currently not\n    supported by upstream, this is only preparatory.\n  * Added suggestion of \"ccache\", can speed up the compilation\n    process.\n\n -- Kay Hayen <kayhayen@gmx.de>  Tue, 17 Jan 2012 10:29:45 +0100\n\nnuitka (0.3.18+ds-1) unstable; urgency=low\n\n  * New upstream release.\n  * Lowered dependencies so that a backport to Ubuntu Natty and\n    higher is now feasible. A \"scons >=2.0.0\" is good enough,\n    and so is \"g++-4.5\" as well.\n  * Don't require the PDF generation to be successful on older\n    Ubuntu versions as it crashes due to old \"rst2pdf\" bugs.\n\n -- Kay Hayen <kayhayen@gmx.de>  Thu, 12 Jan 2012 19:55:43 +0100\n\nnuitka (0.3.18~pre2+ds-1) unstable; urgency=low\n\n  * New upstream pre-release.\n  * First upload to unstable, many thanks to my reviewer and\n    sponsor Yaroslav Halchenko <debian@onerussian.com>\n  * New maintainer (Closes: #648489)\n  * Added Developer Manual to the generated PDF documentation.\n  * Added python-dbg to Build-Depends to also execute reference\n    count tests.\n  * Changed copyright file to reference Apache license via its\n    standard Debian location as well.\n\n -- Kay Hayen <kayhayen@gmx.de>  Tue, 10 Jan 2012 22:21:56 +0100\n\nnuitka (0.3.17+ds-1) UNRELEASED; urgency=low\n\n  * New upstream release.\n  * Updated man page to use new \"--recurse-*\" options in examples\n    over removed \"--deep*\" options.\n  * Completed copyright file according to \"licensecheck\" findings\n    and updated files accordingly. Put the included tests owned\n    by upstream into public domain.\n  * Use a \"+ds\" file as orig source with inline copy of Scons\n    already removed instead of doing it as a patch.\n  * Also removed the benchmark tests from \"+ds\" file, not useful\n    to be provided with Nuitka.\n  * Added syntax tests, these were omitted by mistake previously.\n  * Run the test suite at package build time, it checks the basic\n    tests, syntax error tests, program tests, and the compile\n    itself test.\n  * Added run time dependencies also as build time dependencies\n    to be able to execute the tests.\n  * Corrected handling of upstream pre-release names in the watch\n    file.\n  * Changed contributor notice to only require \"Apache License 2.0\"\n    for the new parts.\n  * Put Debian packaging and owned tests under \"Apache License 2.0\"\n    as well.\n\n -- Kay Hayen <kayhayen@gmx.de>  Mon, 09 Jan 2012 09:02:19 +0100\n\nnuitka (0.3.16-1) UNRELEASED; urgency=low\n\n  * New upstream release.\n  * Updated debian/copyright URI to match the latest one.\n  * Updated debian/copyright to DEP5 changes.\n  * Added Nuitka homepage to debian/control.\n  * Added watch file, so uscan works.\n  * Added git pointers to git repository and gitweb to the\n    package control file.\n  * Corrected examples section in man page to correctly escape \"-\".\n  * Added meaningful \"what is\" to manpages.\n  * Bump to Standards Version 3.9.2, no changes needed.\n  * Added extended description to address lintian warning.\n\n -- Kay Hayen <kayhayen@gmx.de>  Sun, 18 Dec 2011 13:01:10 +0100\n\nnuitka (0.3.15-1) UNRELEASED; urgency=low\n\n  * New upstream release.\n  * Renamed \"/usr/bin/Python\" to \"/usr/bin/nuitka-python\".\n  * Added man pages for \"nuitka\" and \"nuitka-python\", the first\n    with an examples section that shows the most important uses\n    of the \"nuitka\" binary.\n  * Removed foreign code for Windows generators, removed from\n    debian/copyright.\n  * Lowered dependency for Scons to what Ubuntu Oneiric has and\n    what we have as an inline copy, (scons >=2.0.1) should be\n    sufficient.\n  * Recommend python-lxml, as it's used by Nuitka to dump XML\n    representation.\n  * Recommend python-qt4, as it may be used to display the node\n    tree in a window.\n  * Removed inline copy of Scons from the binary package.\n  * Added patch to remove the setting nuitka package in sys.path,\n    not needed in Debian.\n\n -- Kay Hayen <kayhayen@gmx.de>  Thu, 01 Dec 2011 22:43:33 +0100\n\nnuitka (0.3.15pre2-1) UNRELEASED; urgency=low\n\n  * Initial Debian package.\n\n -- Kay Hayen <kayhayen@gmx.de>  Fri, 11 Nov 2011 20:58:55 +0100\n"
  },
  {
    "path": "debian/compat",
    "content": "9\n"
  },
  {
    "path": "debian/control",
    "content": "Source: nuitka\nMaintainer: Kay Hayen <kay.hayen@gmail.com>\nSection: python\nPriority: optional\nBuild-Depends: debhelper (>= 9),\n               lsb-release,\n               dh-python | base-files (<< 9.6),\n               base-files (>= 11) | python (>= 2.6.6-2),\n               base-files (>= 11) | python-all-dbg (>= 2.6.6-2),\n               base-files (>= 11) | python-all-dev (>= 2.6.6-2),\n               base-files (>= 11) | python-setuptools,\n               base-files (>= 11) | python-jinja2,\n               base-files (>= 11) | python-yaml,\n               base-files (>= 11) | base-files (<< 9.10) | python-glob2,\n               scons,\n               python3-all-dev (>= 3.3),\n               python3-all-dbg (>= 3.3),\n               python3-setuptools,\n               python3-jinja2,\n               python3-yaml,\n               zlib1g-dev,\n               base-files (>= 11) | python-appdirs,\n               python3-appdirs | base-files (<< 7.2),\n               python3-glob2 | base-files (<< 9.10),\n               rst2pdf,\n               fontconfig,\n               base-files (>= 11) | python-pil | python-imaging,\n               python3-pil | base-files (<< 11),\n               ccache,\n               strace,\n               patchelf,\n               libzstd-dev | base-files (<= 9),\n               gdb | lldb\nRules-Requires-Root: no\nVcs-Git: https://github.com/Nuitka/Nuitka.git\nVcs-Browser: https://github.com/Nuitka/Nuitka\nHomepage: https://nuitka.net\nStandards-Version: 4.4.1\nX-Python-Version: >= 2.6\nX-Python3-Version: >= 3.3\n\nPackage: nuitka\nArchitecture: all\nDepends: gcc (>= 5.0) | g++ (>= 4.4) | clang (>= 3.0),\n         scons (>= 2.0.0),\n         python3-jinja2,\n         python3-appdirs | base-files (<< 7.2),\n         python3-glob2 | base-files (<< 9.10),\n         python3-dev,\n         base-files (>= 11) | python-jinja2,\n         base-files (>= 11) | python-yaml,\n         base-files (>= 11) | base-files (<< 9.10) | python-glob2,\n         zlib1g-dev,\n         libzstd-dev | base-files (<= 9),\n         ccache,\n         patchelf,\n         ${misc:Depends},\n         ${python:Depends},\n         ${python3:Depends}\nRecommends: python3-lxml,\n            python3-tqdm,\n            strace,\n            libfuse2,\n            gdb | lldb\nDescription: Python compiler with full language support and CPython compatibility\n This Python compiler achieves full language compatibility and compiles Python\n code into compiled objects that are not second class at all. Instead they can\n be used in the same way as pure Python objects.\n"
  },
  {
    "path": "debian/copyright",
    "content": "Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166\nUpstream-Name: nuitka\nUpstream-Contact: Kay Hayen <kay.hayen@gmail.com>\nSource: https://nuitka.net/\n\n# No spell checking for this file, spell-checker: disable\n\nFiles: *\nCopyright: 2024 Kay Hayen\n           2020 Batakrishna Sahu\n           2020 Jan Teske\n           2020 Jorj McKie\n           2020 Paweł Kierzkowski\n           2020 Tommy Li\nLicense: Apache+Nuitka_comment\n Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n integrates with CPython, but also works on its own.\n .\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n .\n    http://www.apache.org/licenses/LICENSE-2.0\n .\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n .\n On Debian GNU/Linux systems, the complete text of the Apache 2.0 license\n can be found in `/usr/share/common-licenses/Apache-2.0'.\n\nFiles:\n   tests/basics\n   tests/programs\n   tests/reflected\n   tests/type_inference\nCopyright: 2024 Kay Hayen <kay.hayen@gmail.com>\nLicense: Apache+Nuitka_test_origin\n Python tests originally created or extracted from other peoples work. The\n parts were too small to be protected.\n .\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n .\n    http://www.apache.org/licenses/LICENSE-2.0\n .\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n .\n On Debian GNU/Linux systems, the complete text of the Apache 2.0 license\n can be found in `/usr/share/common-licenses/Apache-2.0'.\n\nFiles: nuitka/containers/OrderedDicts.py\nCopyright: 2008 by Armin Ronacher and PEP 273 authors\nLicense: BSD-3-clause\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n     * Redistributions of source code must retain the above copyright\n       notice, this list of conditions and the following disclaimer.\n     * Redistributions in binary form must reproduce the above copyright\n       notice, this list of conditions and the following disclaimer in the\n       documentation and/or other materials provided with the distribution.\n     * Neither the name of the organizations nor the\n       names of its contributors may be used to endorse or promote products\n       derived from this software without specific prior written permission.\n .\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nFiles: nuitka/containers/OrderedSetsFallback.py\nCopyright: 2009 Raymond Hettinger\nLicense: MIT+Hettinger\n Permission is hereby granted, free of charge, to any person obtaining\n a copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, modify, merge, publish,\n distribute, sublicense, and/or sell copies of the Software, and to\n permit persons to whom the Software is furnished to do so, subject to\n the following conditions:\n .\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n .\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\nFiles: nuitka/build/include/nuitka/hedley.h\nCopyright: 2020 Evan Nemerson <evan@nemerson.com>\nLicense: public-domain\n To the extent possible under law, the author(s) have dedicated all\n copyright and related and neighboring rights to this software to\n the public domain worldwide. This software is distributed without\n any warranty.\n .\n For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.\n SPDX-License-Identifier: CC0-1.0\n\nFiles: nuitka/build/include/nuitka/incbin.h\nCopyright: 2020 Dale Weiler <weilercdale@gmail.com>\nLicense: public-domain\n This is free and unencumbered software released into the public domain.\n .\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n .\n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n .\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n .\n For more information, please refer to <http://unlicense.org/>\n SPDX-License-Identifier: CC0-1.0\n\nFiles:\n  debian\nCopyright: 2024 Kay Hayen <kay.hayen@gmail.com>\nLicense: Apache\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n .\n    http://www.apache.org/licenses/LICENSE-2.0\n .\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n .\n On Debian GNU/Linux systems, the complete text of the Apache 2.0 license\n can be found in `/usr/share/common-licenses/Apache-2.0'.\n"
  },
  {
    "path": "debian/nuitka.docs",
    "content": "changelog\n"
  },
  {
    "path": "debian/nuitka.manpages",
    "content": "doc/nuitka.1\ndoc/nuitka-run.1\n"
  },
  {
    "path": "debian/pbuilder-hookdir/B92test-installed-nuitka",
    "content": "#!/bin/bash\n\n# Make sure we error exit if something goes wrong.\nset -e\n\necho \"Checking package installation and running some tests with it too.\"\n\n# The current directory is the top of the source-tree.\ncd /tmp/buildd/*/debian/..\n\necho \"Removing unneeded stuff (build, binaries of nuitka, nuitka package, debian directory):\"\nrm -rf build bin/nuitka* nuitka debian\n\necho \"Installing the Debian package.\"\n\n# Install the single package, and then the dependencies. Idea taken from \"B92test-pkg\"\n\ndpkg -i /tmp/buildd/*.deb || true\napt-get install -y -f \"${APTGETOPT[@]}\"\n\n\n# Remove tests that only work in checkouts.\nrm tests/basics/Referencing*.py\n\n# Run the basic tests with default options and installed nuitka.\nexport NUITKA=/usr/bin/nuitka\nif [ -f \"$NUITKA\" ]\nthen\n    $(head -n1 $NUITKA | cut -d'!' -f2) ./tests/basics/run_all.py search\nfi\nexport NUITKA=/usr/bin/nuitka3\n$(head -n1 $NUITKA | cut -d'!' -f2) ./tests/basics/run_all.py search\n\necho \"Thanks passed the tests with installed package it seems.\"\n"
  },
  {
    "path": "debian/rules",
    "content": "#!/usr/bin/make -f\n\nexport DH_VERBOSE = 1\nexport PYBUILD_NAME = nuitka\n\n# This disables the building with debug Python, not sure why we need to\n# set PYBUILD_VERSIONS too, but it seemed that way.\nexport PYBUILD_INTERPRETERS = python{version}\n\n# Do not use Python2 for Debian 11 or higher, need to find a way for Ubuntu\n# to cover, Debian 11 inheritance.\nDEB_VENDOR=$(shell dpkg-vendor --query vendor)\nifeq ($(DEB_VENDOR), Debian)\nBUILD_ONLY_PYTHON3 := $(shell [ `lsb_release -r -s | sed -e s/unstable/11/ -e 's/n\\/a/11/' -e s/testing/11/ -e s/buildd-// -e 's/\\..*//'` -ge 11 ] && echo true)\nelse ifeq ($(DEB_VENDOR), Ubuntu)\nBUILD_ONLY_PYTHON3 := $(shell [ `lsb_release -r -s | sed -e 's/\\.//' ` -ge 2004 ] && echo true)\nelse\nBUILD_ONLY_PYTHON3 := false\nendif\nexport BUILD_ONLY_PYTHON3\n\nifeq ($(BUILD_ONLY_PYTHON3),true)\nexport PYBUILD_VERSIONS = $(shell py3versions -vr)\nexport BUILD_WITH_ARGUMENT = \"python3\"\nexport RUN_TEST_OPTIONS = --no-python2.7 --no-python2.6\nexport RUN_TEST_PYTHON = python3\nelse\nexport PYBUILD_VERSIONS = $(shell pyversions -vr) $(shell py3versions -vr)\nexport BUILD_WITH_ARGUMENT = \"python2,python3\"\nexport RUN_TEST_OPTIONS =\nexport RUN_TEST_PYTHON = python2\nendif\n\n%:\n\tset -x\n\tdh $@ --with $(BUILD_WITH_ARGUMENT) --buildsystem=pybuild\n\noverride_dh_auto_build:\n\tcp Changelog.rst changelog\n\tcp Developer_Manual.rst Developer_Manual.txt\n\noverride_dh_auto_test:\n\t# The RUN_TEST_PYTHON is not the one to execute tests, just the for the\n\t# test runner.\n\t$(RUN_TEST_PYTHON) ./tests/run-tests --skip-reflection-test $(RUN_TEST_OPTIONS)\n"
  },
  {
    "path": "debian/source/format",
    "content": "3.0 (quilt)\n"
  },
  {
    "path": "debian/source/lintian-overrides",
    "content": "# The build dependency on python-dev stems from the running of tests which\n# will build extensions or programs that embed CPython. Only the builder\n# arch needs to be installed.\nnuitka source: build-depends-on-python-dev-with-no-arch-any\n\n# I am doing test builds on Debian stable, while the upload target is\n# unstable. For these, ignore the too new standards version.\nnuitka source: newer-standards-version\n\n# We continue to support very old distributions and therefore allow\n# the relatively ancient Python releases.\nnuitka source: ancient-python-version-field\n\n# We have generated code with sometimes bizarre length of identifiers\nnuitka source: very-long-line-length-in-source-file\n\n# We are really working with compat level up to what we say, but we\n# want to build with distributions that don't have it.\nnuitka source: package-needs-versioned-debhelper-build-depends\n\n# Our include directory for C is named after the project.\nnuitka: repeated-path-segment nuitka usr/lib/python3/dist-packages/nuitka/build/include/nuitka/\n"
  },
  {
    "path": "debian/upstream-signing-key.pgp",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: GnuPG v1.4.15 (GNU/Linux)\n\nmQINBFJ/+gwBEADG5uZfKLmI3gg2BoWd3K2C63cPMeVVVDvQtCKZHqnJ6x+ERDCt\n6kASBqpvFIkBLUF28cV+PhNRosNBsYn05WcIz2b5+QbxfTukhG8hXfr6HWL2lwiP\nLJcSwU1GhDvnFps6DgDZUhSDJ9VuOjShWdxPaJ917C3bs054bmZdSYrw2i3NjUrX\nq6tb/kh7/yFW4UT6O/V3XHeD81yA7hKUsf25hKiVEcPxE3LFXJP4qJB7XH7hn650\nLOuznQ4dXL8wPM0FpeDo1K//3S2xaTLuYtokUu3755NuLVSZj/f0324QUzdzOE4L\nHS7pdOVAUqHWlS5V97XsJBayRthGEC5n834p7Mtqt7kMkaWThMwKwXUqrNGbZ7FK\nX+D1MA78LAxVARybdnyElAhSbB8QMoW2sMjNAzd39PAYikMnkjtEaxOSM7UF8Itq\n3rgHE2Zi0pCSR0kO3aEP9fQxznJ20kMcfkC10VSg7ucufqklfNJo1CMY+VVB5d35\norhL6odoMBGBwf10W+In3VwQ1oOiY84IwaYKNJuO9q+QOdwDVQX1+RacGKKtnFKS\nPYQV3UtqYyqdydB5rk2Dg1CgF9Z6m7VtN6Dp9DOzs5vwCRa65u/77l8J4DEx3DYd\nQVYQzRwhvjD0+H34vlARpWUeWT6IEF5yYl0C+dp824lpP95kOVGuFhN4iQARAQAB\ntB9LYXkgSGF5ZW4gPGtheS5oYXllbkBnbWFpbC5jb20+iQI+BBMBAgAoBQJSf/oM\nAhsDBQkDwmcABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAb/DN1KRK5nMsa\nD/4kheo2e1ce0+LU6UXhIYSwTV7O1Zc8FelWj0tFX2YaNR8S6m9Ad6jmNVyFSyth\nDyKCx6tzdTyXKf+Rog8LFC6V+IStktnCV/MdRBJGZvBr3rPVcKEfQErhHdAA8UvN\nArkAGErqLGiOsaMLmEcEyD0cU3w+nu12fEdRW1S7Q8R1X+DoT+plhs/xfgtP4M3/\nGk1mGNQ+p4wMK52tfz7rV/IHX/5DxH8OGb/aZliYSPB9Dnn1WD4KS1F4VWZsDJBe\nN8XT6+qyhK0S6waXHAL3Qkfcl4fp//QTI4+P+yzMtLk2m37fDk4GRUKR6oyHN+8Z\nEeXQ0cykxL6P83ui4HztlQOEb2PSjC0ZSoN7IZcwwhS97BorpAs2/OV8FBuCTNXQ\noEzDH8fNwgDk840PNPk1GmsQl3yhIiKOdoYyFRQUvVV6objyMhDThe667hYHcaES\n6tlW066gLQLuUyX5zTPncxvrc+Ow8kEnYzv+ODrIKGS4rTyCu964yas72de2bT9S\nH7aYarnN7dgT4pmpFic9jMG9O415838eBzQcBuRejIJUuS+lGwaqishkPW8j1v63\nWriU4ane58v9buqC9camUYS14bIEp6qpDvnLR39WOLwjRq2u3ga5gLOgC2oLyKxr\nDieTM5YKRUnbwY67KAAla06uoClKE4jMKXYTPdPX6F4lubkCDQRSf/oMARAAkef8\nrQLhgajKazmlcnb7pp7+2sP/NXn23U6GCtaAA6EgYP5tcSHAlfKmYR2xlHUTU+9G\nmfNXWOzaCqpeQZi7o+pkDwroB9IiGTfxRZJfBWTxLpgBRFV8NWc0atlhk9pjcIuD\nha0Dt0acNW7/SKQHouKPbtKuX46GOL/szPhVWp1Ph+t8CHKhF9g7mJcnDdCrnmsx\n1wI6Dcrmikj7STW3jnPyX3SsV9fHOp6CJwUQLVQNCoUS/n7Cx1UC+vDmxiewcBgo\nXXTRszmZZvM/7Uo7lrmPoP2KrImrcjypRyZ2rqVdf2Ac4TIFx+ySyB5puKtA4O0U\nhdRtotEK5fpeLt/etcLVs3Gk4Eol8fQiwjYEIfrT9+vcPthA691aTdMBFsKaWuCX\nT8m5c2LOP/dBjYdiLz7YByLPt0V4y8meit2emSmLHwsXLHZEU7BlKxc5xpnGGZ65\n3Jgpps9FqhDHoHiboSeLwpuiB+9VSQWJL9xpgNeXZWjWu7UC3mdGe+Iq2LSm+S4F\ne2hzHzO4dNQI+LttvTqS7V9pYLsG49VztTm/xIoAMs7bCsIFYGUl9VlmR0dZOZle\n8bCBoNdYelT/e/8xvestLSjNnQl5e9YRoVy1TybxXz6n/d65Klw1mfHUl/GqgdXc\nDZBxBDrJvXyMuIyspj6zZMJ9QOwB3Xn9zGukxCcAEQEAAYkCJQQYAQIADwUCUn/6\nDAIbDAUJA8JnAAAKCRAb/DN1KRK5nErDD/wNc7827lo+2q3KeCMiFngMw/WQ6mlp\nytzQjXHW4p7Fs13X0ebP/j6rIT/LUqeHPVoUpns98yyAFgo5G3Q0GqC8EP9n4mbE\n6QA2ctdCPoNX+rdM9yBq4PoZSzz0vpITfToa7cdo0nrlbmiaEYnhlSM+416Nw8c/\nyqFcHt65Lh71GgDhpT7Q5q7C2cT21cS3O/N4xul2n5SJkGm97W+sPo9uOscTRLbI\nye959Z1EffKfB+izItxYqSlTyIqIgf+1yffjo5+pPh4ZsxtNYTohZiiPhbvlbwnM\n5u540366XoJHBmHgyPAYkVUQAJZwGdXI23DXmyg45avzeEO8mIrZ4aU++5UZ/+h8\nHCM4vfOpRTg8+IfIq7vArjlMoSDeqCSVJVlJxLppreCld2f1VHg9PEEcpPv2siPh\nlhzU5M6KcJYgTiDoHMfeO8qlKjG62/aA0rBXzZanL580eldCEr96rpEFhdaOMyWv\nTJ58LULfdHXsif8yq2mI4+6MrnC9IYDSLZHyR1aCgbXCKhI5r+g/DYvGxjFObf9m\nXoRhS0dCVNZHT4y0Bu6YBuvUUELXnNa0CDveBH4wj10fRR5+q/GUlQygGfnFhrgG\nBn3HOx+kxz441CBIcaGtmCYhH6CFo5hcMKNHF7yG1AlWW97Zu629uT1nqK45JQqq\nqI5vOLPGcTsOVQ==\n=uGbZ\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "debian/watch",
    "content": "version=3\nopts=dversionmangle=s/\\+ds$//,uversionmangle=s/pre/~pre/,pgpsigurlmangle=s/$/.sig/ \\\n   https://nuitka.net/releases/Nuitka-([\\d\\.]+).tar.gz debian uupdate\n"
  },
  {
    "path": "doc/Doxyfile.template",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n# Doxyfile 1.8.12\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file\n# that follow. The default is UTF-8 which is also the encoding used for all text\n# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\n# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\n# for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = \"Nuitka\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"The Python compiler\"\n\n# With the PROJECT_LOGO tag one can specify a logo or an icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy\n# the logo to the output directory.\n\nPROJECT_LOGO           = doc/images/Nuitka-Logo-Symbol.png\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       =\n\n# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII\n# characters to appear in the names of generated files. If set to NO, non-ASCII\n# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode\n# U+3044.\n# The default value is: NO.\n\nALLOW_UNICODE_NAMES    = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,\n# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),\n# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,\n# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),\n# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,\n# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,\n# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,\n# Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = YES\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new\n# page for each member. If set to NO, the documentation of a member will be part\n# of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines.\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:\n# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:\n# Fortran. In the later case the parser tries to guess whether the code is fixed\n# or free formatted code, this is the default for Fortran type files), VHDL. For\n# instance to make doxygen treat .inc files as Fortran files (default is PHP),\n# and .f files as C (default is Fortran), use: inc=Fortran f=C.\n#\n# Note: For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See http://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up\n# to that level are automatically included in the table of contents, even if\n# they do not have an id attribute.\n# Note: This feature currently applies only to Markdown headings.\n# Minimum value: 0, maximum value: 99, default value: 0.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nTOC_INCLUDE_HEADINGS   = 0\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by putting a % sign in front of the word or\n# globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# If one adds a struct or class to a group and this option is enabled, then also\n# any nested class or struct is added to the same group. By default this option\n# is disabled and one has to add nested compounds explicitly via \\ingroup.\n# The default value is: NO.\n\nGROUP_NESTED_COMPOUNDS = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = NO\n\n# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = NO\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO,\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. If set to YES, local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO, only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO, these classes will be included in the various overviews. This option\n# has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO, these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO, these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES, upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES, the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will\n# append additional text to a page's title, such as Class Reference. If set to\n# YES the compound reference will be hidden.\n# The default value is: NO.\n\nHIDE_COMPOUND_REFERENCE= NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\n# grouped member an include statement to the documentation, telling the reader\n# which file to include in order to use the member.\n# The default value is: NO.\n\nSHOW_GROUPED_MEMB_INC  = NO\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order. Note that\n# this will also influence the order of the classes in the class list.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo\n# list. This list is created by putting \\todo commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test\n# list. This list is created by putting \\test commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES, the\n# list will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. See also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO, doxygen will only warn about wrong or incomplete\n# parameter documentation, but not about the absence of documentation.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when\n# a warning is encountered.\n# The default value is: NO.\n\nWARN_AS_ERROR          = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           = doxygen-warnings.log\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING\n# Note: If this tag is empty the current directory is searched.\n\nINPUT  = .\nINPUT += nuitka\nINPUT += nuitka/nodes\nINPUT += nuitka/nodes/shapes\nINPUT += nuitka/tree\nINPUT += nuitka/code_generation\nINPUT += nuitka/code_generation/templates/\nINPUT += nuitka/containers\nINPUT += nuitka/finalizations\nINPUT += nuitka/optimizations\nINPUT += nuitka/utils\nINPUT += nuitka/importing\nINPUT += nuitka/freezer\nINPUT += nuitka/plugins\nINPUT += nuitka/plugins/standard\nINPUT += nuitka/build\n\nINPUT += nuitka/build/include\nINPUT += nuitka/build/include/nuitka\nINPUT += nuitka/build/include/nuitka/helper\nINPUT += nuitka/build/static_src\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: http://www.gnu.org/software/libiconv) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# read by doxygen.\n#\n# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,\n# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,\n# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,\n# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,\n# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.idl \\\n                         *.ddl \\\n                         *.odl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.cs \\\n                         *.d \\\n                         *.php \\\n                         *.php4 \\\n                         *.php5 \\\n                         *.phtml \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.pyw \\\n                         *.f90 \\\n                         *.f95 \\\n                         *.f03 \\\n                         *.f08 \\\n                         *.f \\\n                         *.for \\\n                         *.tcl \\\n                         *.vhd \\\n                         *.vhdl \\\n                         *.ucf \\\n                         *.qsf\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = NO\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                =\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = YES\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = Mini*.py\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nFILTER_PATTERNS        = *.py=%DOXYPYPY%\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE =\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\n# TODO: Enable later\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\n# TODO: Enable later\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# function all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see http://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the\n# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the\n# cost of reduced performance. This can be particularly helpful with template\n# rich C++ code for which doxygen's built-in parser lacks the necessary type\n# information.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse-libclang=ON option for CMake.\n# The default value is: NO.\n\nCLANG_ASSISTED_PARSING = NO\n\n# If clang assisted parsing is enabled you can provide the compiler with command\n# line options that you would normally use when invoking the compiler. Note that\n# the include paths will already be set by doxygen for the files and directories\n# specified with INPUT and INCLUDE_PATH.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_OPTIONS          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# cascading style sheets that are included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefore more robust against future updates.\n# Doxygen will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list). For an example see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  = doc/custom.css\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the style sheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to YES can help to show when doxygen was last run and thus if the\n# documentation is up to date.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = NO\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: http://developer.apple.com/tools/xcode/), introduced with\n# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\n# for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler (hhc.exe). If non-empty,\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated\n# (YES) or that it should be included in the master .chm file (NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated\n# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it\n# enables the Previous and Next buttons.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANSPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# http://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from http://www.mathjax.org before deployment.\n# The default value is: http://cdn.mathjax.org/mathjax/latest.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavors of web server based searching depending on the EXTERNAL_SEARCH\n# setting. When disabled, doxygen will generate a PHP script for searching and\n# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing\n# and searching needs to be provided by external tools. See the section\n# \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when enabling USE_PDFLATEX this option is only used for generating\n# bitmaps for formulas in the HTML output, but not in the Makefile that is\n# written to the output directory.\n# The default file is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. The package can be specified just\n# by its name or with the correct syntax as to be used with the LaTeX\n# \\usepackage command. To get the times font for instance you can specify :\n# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}\n# To use the option intlimits with the amsmath package you can specify:\n# EXTRA_PACKAGES=[intlimits]{amsmath}\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber,\n# $projectbrief, $projectlogo. Doxygen will replace $title with the empty\n# string, for the replacement values of the other commands the user is referred\n# to HTML_HEADER.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer. See\n# LATEX_HEADER for more information on how to generate a default footer and what\n# special commands can be used inside the footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# LaTeX style sheets that are included after the standard style sheets created\n# by doxygen. Using this option one can overrule certain style aspects. Doxygen\n# will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_STYLESHEET =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES, to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# http://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_TIMESTAMP        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's config\n# file, i.e. a series of assignments. You only have to provide replacements,\n# missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's config file. A template extensions file can be generated\n# using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code\n# with syntax highlighting in the RTF output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_SOURCE_CODE        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# The MAN_SUBDIR tag determines the name of the directory created within\n# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by\n# MAN_EXTENSION with the initial . removed.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_SUBDIR             =\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the\n# program listings (including syntax highlighting and cross-referencing\n# information) to the DOCBOOK output. Note that enabling this will significantly\n# increase the size of the DOCBOOK output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_PROGRAMLISTING = NO\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an\n# AutoGen Definitions (see http://autogen.sf.net) file that captures the\n# structure of the code including all documentation. Note that this feature is\n# still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO, the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names\n# in the source code. If set to NO, only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES, the include files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             =\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all references to function-like macros that are alone on a line, have\n# an all uppercase name, and do not end with a semicolon. Such function macros\n# are typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have a unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES, all external class will be listed in\n# the class index. If set to NO, only the inherited external classes will be\n# listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed\n# in the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# You can include diagrams made with dia in doxygen documentation. Doxygen will\n# then run dia to produce the diagram and insert it in the documentation. The\n# DIA_PATH tag allows you to specify the directory where the dia binary resides.\n# If left empty dia is assumed to be found in the default search path.\n\nDIA_PATH               =\n\n# If set to YES the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: YES.\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font in the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command. Disabling a call graph can be\n# accomplished by means of the command \\hidecallgraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command. Disabling a caller graph can be\n# accomplished by means of the command \\hidecallergraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot. For an explanation of the image formats see the section\n# output formats in the documentation of the dot tool (Graphviz (see:\n# http://www.graphviz.org/)).\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,\n# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,\n# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,\n# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and\n# png:gdiplus:gdiplus.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = svg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = YES\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DIAFILE_DIRS tag can be used to specify one or more directories that\n# contain dia files that are included in the documentation (see the \\diafile\n# command).\n\nDIAFILE_DIRS           =\n\n# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the\n# path where java can find the plantuml.jar file. If left blank, it is assumed\n# PlantUML is not used or called during a preprocessing step. Doxygen will\n# generate a warning when it encounters a \\startuml command in this case and\n# will not generate output for the diagram.\n\nPLANTUML_JAR_PATH      =\n\n# When using plantuml, the specified paths are searched for files specified by\n# the !include statement in a plantuml block.\n\nPLANTUML_INCLUDE_PATH  =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = YES\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "doc/custom.css",
    "content": "/**********************************************************************\n    Copyright 2024, Batakrishna Sahu, mailto:<Batakrishna.Sahu@suiit.ac.in> find license text at end of file\n/**********************************************************************\n\n/* Override Nuitka logo size */\n#projectlogo img {\n    max-width: 50px;\n    padding: 5px;\n}\n\n/**********************************************************************\n    Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n    integrates with CPython, but also works on its own.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n/**********************************************************************\n"
  },
  {
    "path": "doc/nuitka-man-include.txt",
    "content": "[EXAMPLES]\n\nCompile a Python file \"some_module.py\" to a module \"some_module.so\":\n.IP\n\\f(CW$ nuitka \\-\\-module some_module.py\\fR\n.PP\nCompile a Python program \"some_program.py\" to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the package \"some_package\" it\nuses to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-follow\\-import-\\-to=some_package some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and all the modules it uses to an executable \"some_program.exe\". Then execute it immediately when ready:\n.IP\n\\f(CW$ nuitka \\-\\-run \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses (even standard library) to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-recurse\\-all \\-\\-follow\\-stdlib some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Keep the debug information, so valgrind, gdb, etc. work\nnicely.\n\nNote: This will *not* degrade performance:\n.IP\n\\f(CW$ nuitka \\-\\-unstripped \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks. Also use the debug Python library, which does its own checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-python-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\n"
  },
  {
    "path": "doc/nuitka-run.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.49.1.\n.TH NUITKA-RUN \"1\" \"2024\" \"nuitka-run 2.2\" \"User Commands\"\n.SH NAME\nnuitka-run \\- the Python compiler\n.SH SYNOPSIS\n.B nuitka-run\n[\\fI\\,options\\/\\fR] \\fI\\,main_module.py\\/\\fR\n.SH OPTIONS\n.TP\n\\fB\\-\\-help\\fR\nshow this help message and exit\n.TP\n\\fB\\-\\-version\\fR\nShow version information and important details for bug\nreports, then exit. Defaults to off.\n.TP\n\\fB\\-\\-module\\fR\nCreate an importable binary extension module\nexecutable instead of a program. Defaults to off.\n.TP\n\\fB\\-\\-standalone\\fR\nEnable standalone mode for output. This allows you to\ntransfer the created binary to other machines without\nit using an existing Python installation. This also\nmeans it will become big. It implies these option: \"\\-\\-\nfollow\\-imports\" and \"\\-\\-python\\-flag=no_site\". Defaults\nto off.\n.TP\n\\fB\\-\\-onefile\\fR\nOn top of standalone mode, enable onefile mode. This\nmeans not a folder, but a compressed executable is\ncreated and used. Defaults to off.\n.TP\n\\fB\\-\\-python\\-flag\\fR=\\fI\\,FLAG\\/\\fR\nPython flags to use. Default is what you are using to\nrun Nuitka, this enforces a specific mode. These are\noptions that also exist to standard Python executable.\nCurrently supported: \"\\-S\" (alias \"no_site\"),\n\"static_hashes\" (do not use hash randomization),\n\"no_warnings\" (do not give Python run time warnings),\n\"\\-O\" (alias \"no_asserts\"), \"no_docstrings\" (do not use\ndoc strings), \"\\-u\" (alias \"unbuffered\"), \"isolated\"\n(do not load outside code) and \"\\-m\" (package mode,\ncompile as \"package.__main__\"). Default empty.\n.TP\n\\fB\\-\\-python\\-debug\\fR\nUse debug version or not. Default uses what you are\nusing to run Nuitka, most likely a non\\-debug version.\nOnly for debugging and testing purposes.\n.TP\n\\fB\\-\\-python\\-for\\-scons\\fR=\\fI\\,PATH\\/\\fR\nWhen compiling with Python 3.4 provide the path of a\nPython binary to use for Scons. Otherwise Nuitka can\nuse what you run Nuitka with, or find Python\ninstallation, e.g. from Windows registry. On Windows,\na Python 3.5 or higher is needed. On non\\-Windows, a\nPython 2.6 or 2.7 will do as well.\n.TP\n\\fB\\-\\-main\\fR=\\fI\\,PATH\\/\\fR\nIf specified once, this takes the place of the\npositional argument, i.e. the filename to compile.\nWhen given multiple times, it enables \"multidist\" (see\nUser Manual) it allows you to create binaries that\ndepending on file name or invocation name.\n.IP\nControl the inclusion of modules and packages in result:\n.TP\n\\fB\\-\\-include\\-package\\fR=\\fI\\,PACKAGE\\/\\fR\nInclude a whole package. Give as a Python namespace,\ne.g. \"some_package.sub_package\" and Nuitka will then\nfind it and include it and all the modules found below\nthat disk location in the binary or extension module\nit creates, and make it available for import by the\ncode. To avoid unwanted sub packages, e.g. tests you\ncan e.g. do this \"\\-\\-nofollow\\-import\\-to=*.tests\".\nDefault empty.\n.TP\n\\fB\\-\\-include\\-module\\fR=\\fI\\,MODULE\\/\\fR\nInclude a single module. Give as a Python namespace,\ne.g. \"some_package.some_module\" and Nuitka will then\nfind it and include it in the binary or extension\nmodule it creates, and make it available for import by\nthe code. Default empty.\n.TP\n\\fB\\-\\-include\\-plugin\\-directory\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nInclude also the code found in that directory,\nconsidering as if they are each given as a main file.\nOverrides all other inclusion options. You ought to\nprefer other inclusion options, that go by names,\nrather than filenames, those find things through being\nin \"sys.path\". This option is for very special use\ncases only. Can be given multiple times. Default\nempty.\n.TP\n\\fB\\-\\-include\\-plugin\\-files\\fR=\\fI\\,PATTERN\\/\\fR\nInclude into files matching the PATTERN. Overrides all\nother follow options. Can be given multiple times.\nDefault empty.\n.TP\n\\fB\\-\\-prefer\\-source\\-code\\fR\nFor already compiled extension modules, where there is\nboth a source file and an extension module, normally\nthe extension module is used, but it should be better\nto compile the module from available source code for\nbest performance. If not desired, there is \\fB\\-\\-noprefer\\-source\\-code\\fR to disable warnings about it.\nDefault off.\n.IP\nControl the following into imported modules:\n.TP\n\\fB\\-\\-follow\\-imports\\fR\nDescend into all imported modules. Defaults to on in\nstandalone mode, otherwise off.\n.TP\n\\fB\\-\\-follow\\-import\\-to\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nFollow to that module if used, or if a package, to the\nwhole package. Can be given multiple times. Default\nempty.\n.TP\n\\fB\\-\\-nofollow\\-import\\-to\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nDo not follow to that module name even if used, or if\na package name, to the whole package in any case,\noverrides all other options. Can be given multiple\ntimes. Default empty.\n.TP\n\\fB\\-\\-nofollow\\-imports\\fR\nDo not descend into any imported modules at all,\noverrides all other inclusion options and not usable\nfor standalone mode. Defaults to off.\n.TP\n\\fB\\-\\-follow\\-stdlib\\fR\nAlso descend into imported modules from standard\nlibrary. This will increase the compilation time by a\nlot and is also not well tested at this time and\nsometimes won't work. Defaults to off.\n.IP\nOnefile options:\n.TP\n\\fB\\-\\-onefile\\-tempdir\\-spec\\fR=\\fI\\,ONEFILE_TEMPDIR_SPEC\\/\\fR\nUse this as a folder to unpack to in onefile mode.\nDefaults to '{TEMP}/onefile_{PID}_{TIME}', i.e. user\ntemporary directory and being non\\-static it's removed.\nUse e.g. a string like\n\\&'{CACHE_DIR}/{COMPANY}/{PRODUCT}/{VERSION}' which is a\ngood static cache path, this will then not be removed.\n.TP\n\\fB\\-\\-onefile\\-child\\-grace\\-time\\fR=\\fI\\,GRACE_TIME_MS\\/\\fR\nWhen stopping the child, e.g. due to CTRL\\-C or\nshutdown, etc. the Python code gets a\n\"KeyboardInterrupt\", that it may handle e.g. to flush\ndata. This is the amount of time in ms, before the\nchild it killed in the hard way. Unit is ms, and\ndefault 5000.\n.TP\n\\fB\\-\\-onefile\\-no\\-compression\\fR\nWhen creating the onefile, disable compression of the\npayload. This is mostly for debug purposes, or to save\ntime. Default is off.\n.TP\n\\fB\\-\\-onefile\\-as\\-archive\\fR\nWhen creating the onefile, use an archive format, that\ncan be unpacked with \"nuitka\\-onefile\\-unpack\" rather\nthan a stream that only the onefile program itself\nunpacks. Default is off.\n.IP\nData files:\n.TP\n\\fB\\-\\-include\\-package\\-data\\fR=\\fI\\,PACKAGE\\/\\fR\nInclude data files for the given package name. DLLs\nand extension modules are not data files and never\nincluded like this. Can use patterns the filenames as\nindicated below. Data files of packages are not\nincluded by default, but package configuration can do\nit. This will only include non\\-DLL, non\\-extension\nmodules, i.e. actual data files. After a \":\"\noptionally a filename pattern can be given as well,\nselecting only matching files. Examples: \"\\-\\-includepackage\\-data=package_name\" (all files) \"\\-\\-includepackage\\-data=package_name=*.txt\" (only certain type) \"\n\\fB\\-\\-include\\-package\\-data\\fR=\\fI\\,package_name=some_filename\\/\\fR.dat\n(concrete file) Default empty.\n.TP\n\\fB\\-\\-include\\-data\\-files\\fR=\\fI\\,DESC\\/\\fR\nInclude data files by filenames in the distribution.\nThere are many allowed forms. With '\\-\\-include\\-datafiles=/path/to/file/*.txt=folder_name/some.txt' it\nwill copy a single file and complain if it's multiple.\nWith '\\-\\-include\\-datafiles=/path/to/files/*.txt=folder_name/' it will put\nall matching files into that folder. For recursive\ncopy there is a form with 3 values that '\\-\\-includedata\\-files=/path/to/scan=folder_name=**/*.txt' that\nwill preserve directory structure. Default empty.\n.TP\n\\fB\\-\\-include\\-data\\-dir\\fR=\\fI\\,DIRECTORY\\/\\fR\nInclude data files from complete directory in the\ndistribution. This is recursive. Check '\\-\\-includedata\\-files' with patterns if you want non\\-recursive\ninclusion. An example would be '\\-\\-include\\-datadir=/path/some_dir=data/some_dir' for plain copy, of\nthe whole directory. All non\\-code files are copied, if\nyou want to use '\\-\\-noinclude\\-data\\-files' option to\nremove them. Default empty.\n.TP\n\\fB\\-\\-noinclude\\-data\\-files\\fR=\\fI\\,PATTERN\\/\\fR\nDo not include data files matching the filename\npattern given. This is against the target filename,\nnot source paths. So to ignore a file pattern from\npackage data for 'package_name' should be matched as\n\\&'package_name/*.txt'. Or for the whole directory\nsimply use 'package_name'. Default empty.\n.TP\n\\fB\\-\\-include\\-onefile\\-external\\-data\\fR=\\fI\\,PATTERN\\/\\fR\nInclude the specified data file patterns outside of\nthe onefile binary, rather than on the inside. Makes\nonly sense in case of '\\-\\-onefile' compilation. First\nfiles have to be specified as included somehow, then\nthis refers to target paths. Default empty.\n.TP\n\\fB\\-\\-list\\-package\\-data\\fR=\\fI\\,LIST_PACKAGE_DATA\\/\\fR\nOutput the data files found for a given package name.\nDefault not done.\n.IP\nMetadata support:\n.TP\n\\fB\\-\\-include\\-distribution\\-metadata\\fR=\\fI\\,DISTRIBUTION\\/\\fR\nInclude metadata information for the given\ndistribution name. Some packages check metadata for\npresence, version, entry points, etc. and without this\noption given, it only works when it's recognized at\ncompile time which is not always happening. This of\ncourse only makes sense for packages that are included\nin the compilation. Default empty.\n.IP\nDLL files:\n.TP\n\\fB\\-\\-noinclude\\-dlls\\fR=\\fI\\,PATTERN\\/\\fR\nDo not include DLL files matching the filename pattern\ngiven. This is against the target filename, not source\npaths. So ignore a DLL 'someDLL' contained in the\npackage 'package_name' it should be matched as\n\\&'package_name/someDLL.*'. Default empty.\n.TP\n\\fB\\-\\-list\\-package\\-dlls\\fR=\\fI\\,LIST_PACKAGE_DLLS\\/\\fR\nOutput the DLLs found for a given package name.\nDefault not done.\n.IP\nControl the warnings to be given by Nuitka:\n.TP\n\\fB\\-\\-warn\\-implicit\\-exceptions\\fR\nEnable warnings for implicit exceptions detected at\ncompile time.\n.TP\n\\fB\\-\\-warn\\-unusual\\-code\\fR\nEnable warnings for unusual code detected at compile\ntime.\n.TP\n\\fB\\-\\-assume\\-yes\\-for\\-downloads\\fR\nAllow Nuitka to download external code if necessary,\ne.g. dependency walker, ccache, and even gcc on\nWindows. To disable, redirect input from nul device,\ne.g. \"</dev/null\" or \"<NUL:\". Default is to prompt.\n.TP\n\\fB\\-\\-nowarn\\-mnemonic\\fR=\\fI\\,MNEMONIC\\/\\fR\nDisable warning for a given mnemonic. These are given\nto make sure you are aware of certain topics, and\ntypically point to the Nuitka website. The mnemonic is\nthe part of the URL at the end, without the HTML\nsuffix. Can be given multiple times and accepts shell\npattern. Default empty.\n.IP\nImmediate execution after compilation:\n.TP\n\\fB\\-\\-run\\fR\nExecute immediately the created binary (or import the\ncompiled module). Defaults to on.\n.TP\n\\fB\\-\\-debugger\\fR\nExecute inside a debugger, e.g. \"gdb\" or \"lldb\" to\nautomatically get a stack trace. Defaults to off.\n.IP\nCompilation choices:\n.TP\n\\fB\\-\\-user\\-package\\-configuration\\-file\\fR=\\fI\\,YAML_FILENAME\\/\\fR\nUser provided Yaml file with package configuration.\nYou can include DLLs, remove bloat, add hidden\ndependencies. Check the Nuitka Package Configuration\nManual for a complete description of the format to\nuse. Can be given multiple times. Defaults to empty.\n.TP\n\\fB\\-\\-full\\-compat\\fR\nEnforce absolute compatibility with CPython. Do not\neven allow minor deviations from CPython behavior,\ne.g. not having better tracebacks or exception\nmessages which are not really incompatible, but only\ndifferent or worse. This is intended for tests only\nand should *not* be used.\n.TP\n\\fB\\-\\-file\\-reference\\-choice\\fR=\\fI\\,MODE\\/\\fR\nSelect what value \"__file__\" is going to be. With\n\"runtime\" (default for standalone binary mode and\nmodule mode), the created binaries and modules, use\nthe location of themselves to deduct the value of\n\"__file__\". Included packages pretend to be in\ndirectories below that location. This allows you to\ninclude data files in deployments. If you merely seek\nacceleration, it's better for you to use the\n\"original\" value, where the source files location will\nbe used. With \"frozen\" a notation \"<frozen\nmodule_name>\" is used. For compatibility reasons, the\n\"__file__\" value will always have \".py\" suffix\nindependent of what it really is.\n.TP\n\\fB\\-\\-module\\-name\\-choice\\fR=\\fI\\,MODE\\/\\fR\nSelect what value \"__name__\" and \"__package__\" are\ngoing to be. With \"runtime\" (default for module mode),\nthe created module uses the parent package to deduce\nthe value of \"__package__\", to be fully compatible.\nThe value \"original\" (default for other modes) allows\nfor more static optimization to happen, but is\nincompatible for modules that normally can be loaded\ninto any package.\n.IP\nOutput choices:\n.TP\n\\fB\\-\\-output\\-filename\\fR=\\fI\\,FILENAME\\/\\fR\nSpecify how the executable should be named. For\nextension modules there is no choice, also not for\nstandalone mode and using it will be an error. This\nmay include path information that needs to exist\nthough. Defaults to '<program_name>.bin' on this\nplatform.\n.TP\n\\fB\\-\\-output\\-dir\\fR=\\fI\\,DIRECTORY\\/\\fR\nSpecify where intermediate and final output files\nshould be put. The DIRECTORY will be populated with\nbuild folder, dist folder, binaries, etc. Defaults to\ncurrent directory.\n.TP\n\\fB\\-\\-remove\\-output\\fR\nRemoves the build directory after producing the module\nor exe file. Defaults to off.\n.TP\n\\fB\\-\\-no\\-pyi\\-file\\fR\nDo not create a '.pyi' file for extension modules\ncreated by Nuitka. This is used to detect implicit\nimports. Defaults to off.\n.IP\nDeployment control:\n.TP\n\\fB\\-\\-deployment\\fR\nDisable code aimed at making finding compatibility\nissues easier. This will e.g. prevent execution with\n\"\\-c\" argument, which is often used by code that\nattempts run a module, and causes a program to start\nitself over and over potentially. Disable once you\ndeploy to end users, for finding typical issues, this\nis very helpful during development. Default off.\n.TP\n\\fB\\-\\-no\\-deployment\\-flag\\fR=\\fI\\,FLAG\\/\\fR\nKeep deployment mode, but disable selectively parts of\nit. Errors from deployment mode will output these\nidentifiers. Default empty.\n.IP\nEnvironment control:\n.TP\n\\fB\\-\\-force\\-runtime\\-environment\\-variable\\fR=\\fI\\,VARIABLE_SPEC\\/\\fR\nForce an environment variables to a given value.\nDefault empty.\n.IP\nDebug features:\n.TP\n\\fB\\-\\-debug\\fR\nExecuting all self checks possible to find errors in\nNuitka, do not use for production. Defaults to off.\n.TP\n\\fB\\-\\-unstripped\\fR\nKeep debug info in the resulting object file for\nbetter debugger interaction. Defaults to off.\n.TP\n\\fB\\-\\-profile\\fR\nEnable vmprof based profiling of time spent. Not\nworking currently. Defaults to off.\n.TP\n\\fB\\-\\-internal\\-graph\\fR\nCreate graph of optimization process internals, do not\nuse for whole programs, but only for small test cases.\nDefaults to off.\n.TP\n\\fB\\-\\-trace\\-execution\\fR\nTraced execution output, output the line of code\nbefore executing it. Defaults to off.\n.TP\n\\fB\\-\\-recompile\\-c\\-only\\fR\nThis is not incremental compilation, but for Nuitka\ndevelopment only. Takes existing files and simply\ncompile them as C again. Allows compiling edited C\nfiles for quick debugging changes to the generated\nsource, e.g. to see if code is passed by, values\noutput, etc, Defaults to off. Depends on compiling\nPython source to determine which files it should look\nat.\n.TP\n\\fB\\-\\-xml\\fR=\\fI\\,XML_FILENAME\\/\\fR\nWrite the internal program structure, result of\noptimization in XML form to given filename.\n.TP\n\\fB\\-\\-experimental\\fR=\\fI\\,FLAG\\/\\fR\nUse features declared as 'experimental'. May have no\neffect if no experimental features are present in the\ncode. Uses secret tags (check source) per experimented\nfeature.\n.TP\n\\fB\\-\\-low\\-memory\\fR\nAttempt to use less memory, by forking less C\ncompilation jobs and using options that use less\nmemory. For use on embedded machines. Use this in case\nof out of memory problems. Defaults to off.\n.TP\n\\fB\\-\\-create\\-environment\\-from\\-report\\fR=\\fI\\,CREATE_ENVIRONMENT_FROM_REPORT\\/\\fR\nCreate a new virtualenv in that non\\-existing path from\nthe report file given with e.g. '\\-\\-report=compilationreport.xml'. Default not done.\n.TP\n\\fB\\-\\-generate\\-c\\-only\\fR\nGenerate only C source code, and do not compile it to\nbinary or module. This is for debugging and code\ncoverage analysis that doesn't waste CPU. Defaults to\noff. Do not think you can use this directly.\n.IP\nBackend C compiler choice:\n.TP\n\\fB\\-\\-clang\\fR\nEnforce the use of clang. On Windows this requires a\nworking Visual Studio version to piggy back on.\nDefaults to off.\n.TP\n\\fB\\-\\-mingw64\\fR\nEnforce the use of MinGW64 on Windows. Defaults to off\nunless MSYS2 with MinGW Python is used.\n.TP\n\\fB\\-\\-msvc\\fR=\\fI\\,MSVC_VERSION\\/\\fR\nEnforce the use of specific MSVC version on Windows.\nAllowed values are e.g. \"14.3\" (MSVC 2022) and other\nMSVC version numbers, specify \"list\" for a list of\ninstalled compilers, or use \"latest\".  Defaults to\nlatest MSVC being used if installed, otherwise MinGW64\nis used.\n.TP\n\\fB\\-\\-jobs\\fR=\\fI\\,N\\/\\fR\nSpecify the allowed number of parallel C compiler\njobs. Defaults to the system CPU count.\n.TP\n\\fB\\-\\-lto\\fR=\\fI\\,choice\\/\\fR\nUse link time optimizations (MSVC, gcc, clang).\nAllowed values are \"yes\", \"no\", and \"auto\" (when it's\nknown to work). Defaults to \"auto\".\n.TP\n\\fB\\-\\-static\\-libpython\\fR=\\fI\\,choice\\/\\fR\nUse static link library of Python. Allowed values are\n\"yes\", \"no\", and \"auto\" (when it's known to work).\nDefaults to \"auto\".\n.TP\n\\fB\\-\\-cf\\-protection\\fR=\\fI\\,PROTECTION_MODE\\/\\fR\nThis option is gcc specific. For the gcc compiler,\nselect the \"cf\\-protection\" mode. Default \"auto\" is to\nuse the gcc default value, but you can override it,\ne.g. to disable it with \"none\" value. Refer to gcc\ndocumentation for \"\\-fcf\\-protection\" for the details.\n.IP\nCache Control:\n.TP\n\\fB\\-\\-disable\\-cache\\fR=\\fI\\,DISABLED_CACHES\\/\\fR\nDisable selected caches, specify \"all\" for all cached.\nCurrently allowed values are:\n\"all\",\"ccache\",\"bytecode\",\"compression\". can be given\nmultiple times or with comma separated values. Default\nnone.\n.TP\n\\fB\\-\\-clean\\-cache\\fR=\\fI\\,CLEAN_CACHES\\/\\fR\nClean the given caches before executing, specify \"all\"\nfor all cached. Currently allowed values are:\n\"all\",\"ccache\",\"bytecode\",\"compression\". can be given\nmultiple times or with comma separated values. Default\nnone.\n.TP\n\\fB\\-\\-disable\\-bytecode\\-cache\\fR\nDo not reuse dependency analysis results for modules,\nesp. from standard library, that are included as\nbytecode. Same as \\fB\\-\\-disable\\-cache\\fR=\\fI\\,bytecode\\/\\fR.\n.TP\n\\fB\\-\\-disable\\-ccache\\fR\nDo not attempt to use ccache (gcc, clang, etc.) or\nclcache (MSVC, clangcl). Same as \\fB\\-\\-disablecache\\fR=\\fI\\,ccache\\/\\fR.\n.IP\nPGO compilation choices:\n.TP\n\\fB\\-\\-pgo\\fR\nEnables C level profile guided optimization (PGO), by\nexecuting a dedicated build first for a profiling run,\nand then using the result to feedback into the C\ncompilation. Note: This is experimental and not\nworking with standalone modes of Nuitka yet. Defaults\nto off.\n.TP\n\\fB\\-\\-pgo\\-args\\fR=\\fI\\,PGO_ARGS\\/\\fR\nArguments to be passed in case of profile guided\noptimization. These are passed to the special built\nexecutable during the PGO profiling run. Default\nempty.\n.TP\n\\fB\\-\\-pgo\\-executable\\fR=\\fI\\,PGO_EXECUTABLE\\/\\fR\nCommand to execute when collecting profile\ninformation. Use this only, if you need to launch it\nthrough a script that prepares it to run. Default use\ncreated program.\n.IP\nTracing features:\n.TP\n\\fB\\-\\-report\\fR=\\fI\\,REPORT_FILENAME\\/\\fR\nReport module, data files, compilation, plugin, etc.\ndetails in an XML output file. This is also super\nuseful for issue reporting. These reports can e.g. be\nused to re\\-create the environment easily using it with\n\\&'\\-\\-create\\-environment\\-from\\-report', but contain a lot\nof information. Default is off.\n.TP\n\\fB\\-\\-report\\-diffable\\fR\nReport data in diffable form, i.e. no timing or memory\nusage values that vary from run to run. Default is\noff.\n.TP\n\\fB\\-\\-report\\-user\\-provided\\fR=\\fI\\,KEY_VALUE\\/\\fR\nReport data from you. This can be given multiple times\nand be anything in 'key=value' form, where key should\nbe an identifier, e.g. use '\\-\\-report\\-userprovided=pipenv\\-lock\\-hash=64a5e4' to track some input\nvalues. Default is empty.\n.TP\n\\fB\\-\\-report\\-template\\fR=\\fI\\,REPORT_DESC\\/\\fR\nReport via template. Provide template and output\nfilename 'template.rst.j2:output.rst'. For built\\-in\ntemplates, check the User Manual for what these are.\nCan be given multiple times. Default is empty.\n.TP\n\\fB\\-\\-quiet\\fR\nDisable all information outputs, but show warnings.\nDefaults to off.\n.TP\n\\fB\\-\\-show\\-scons\\fR\nRun the C building backend Scons with verbose\ninformation, showing the executed commands, detected\ncompilers. Defaults to off.\n.TP\n\\fB\\-\\-no\\-progressbar\\fR\nDisable progress bars. Defaults to off.\n.TP\n\\fB\\-\\-show\\-progress\\fR\nObsolete: Provide progress information and statistics.\nDisables normal progress bar. Defaults to off.\n.TP\n\\fB\\-\\-show\\-memory\\fR\nProvide memory information and statistics. Defaults to\noff.\n.TP\n\\fB\\-\\-show\\-modules\\fR\nProvide information for included modules and DLLs\nObsolete: You should use '\\-\\-report' file instead.\nDefaults to off.\n.TP\n\\fB\\-\\-show\\-modules\\-output\\fR=\\fI\\,PATH\\/\\fR\nWhere to output '\\-\\-show\\-modules', should be a\nfilename. Default is standard output.\n.TP\n\\fB\\-\\-verbose\\fR\nOutput details of actions taken, esp. in\noptimizations. Can become a lot. Defaults to off.\n.TP\n\\fB\\-\\-verbose\\-output\\fR=\\fI\\,PATH\\/\\fR\nWhere to output from '\\-\\-verbose', should be a\nfilename. Default is standard output.\n.IP\nGeneral OS controls:\n.TP\n\\fB\\-\\-disable\\-console\\fR\nWhen compiling for Windows or macOS, disable the\nconsole window and create a GUI application. Defaults\nto off.\n.TP\n\\fB\\-\\-enable\\-console\\fR\nWhen compiling for Windows or macOS, enable the\nconsole window and create a console application. This\ndisables hints from certain modules, e.g. \"PySide\"\nthat suggest to disable it. Defaults to true.\n.TP\n\\fB\\-\\-force\\-stdout\\-spec\\fR=\\fI\\,FORCE_STDOUT_SPEC\\/\\fR\nForce standard output of the program to go to this\nlocation. Useful for programs with disabled console\nand programs using the Windows Services Plugin of\nNuitka commercial. Defaults to not active, use e.g.\n\\&'{PROGRAM_BASE}.out.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\n.TP\n\\fB\\-\\-force\\-stderr\\-spec\\fR=\\fI\\,FORCE_STDERR_SPEC\\/\\fR\nForce standard error of the program to go to this\nlocation. Useful for programs with disabled console\nand programs using the Windows Services Plugin of\nNuitka commercial. Defaults to not active, use e.g.\n\\&'{PROGRAM_BASE}.err.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\n.IP\nWindows specific controls:\n.TP\n\\fB\\-\\-windows\\-icon\\-from\\-ico\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd executable icon. Can be given multiple times for\ndifferent resolutions or files with multiple icons\ninside. In the later case, you may also suffix with\n#<n> where n is an integer index starting from 1,\nspecifying a specific icon to be included, and all\nothers to be ignored.\n.TP\n\\fB\\-\\-windows\\-icon\\-from\\-exe\\fR=\\fI\\,ICON_EXE_PATH\\/\\fR\nCopy executable icons from this existing executable\n(Windows only).\n.TP\n\\fB\\-\\-onefile\\-windows\\-splash\\-screen\\-image\\fR=\\fI\\,SPLASH_SCREEN_IMAGE\\/\\fR\nWhen compiling for Windows and onefile, show this\nwhile loading the application. Defaults to off.\n.TP\n\\fB\\-\\-windows\\-uac\\-admin\\fR\nRequest Windows User Control, to grant admin rights on\nexecution. (Windows only). Defaults to off.\n.TP\n\\fB\\-\\-windows\\-uac\\-uiaccess\\fR\nRequest Windows User Control, to enforce running from\na few folders only, remote desktop access. (Windows\nonly). Defaults to off.\n.IP\nmacOS specific controls:\n.TP\n\\fB\\-\\-macos\\-create\\-app\\-bundle\\fR\nWhen compiling for macOS, create a bundle rather than\na plain binary application. This is the only way to\nunlock the disabling of console, get high DPI\ngraphics, etc. and implies standalone mode. Defaults\nto off.\n.TP\n\\fB\\-\\-macos\\-target\\-arch\\fR=\\fI\\,MACOS_TARGET_ARCH\\/\\fR\nWhat architectures is this to supposed to run on.\nDefault and limit is what the running Python allows\nfor. Default is \"native\" which is the architecture the\nPython is run with.\n.TP\n\\fB\\-\\-macos\\-app\\-icon\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd icon for the application bundle to use. Can be\ngiven only one time. Defaults to Python icon if\navailable.\n.TP\n\\fB\\-\\-macos\\-signed\\-app\\-name\\fR=\\fI\\,MACOS_SIGNED_APP_NAME\\/\\fR\nName of the application to use for macOS signing.\nFollow \"com.YourCompany.AppName\" naming results for\nbest results, as these have to be globally unique, and\nwill potentially grant protected API accesses.\n.TP\n\\fB\\-\\-macos\\-app\\-name\\fR=\\fI\\,MACOS_APP_NAME\\/\\fR\nName of the product to use in macOS bundle\ninformation. Defaults to base filename of the binary.\n.TP\n\\fB\\-\\-macos\\-app\\-mode\\fR=\\fI\\,MODE\\/\\fR\nMode of application for the application bundle. When\nlaunching a Window, and appearing in Docker is\ndesired, default value \"gui\" is a good fit. Without a\nWindow ever, the application is a \"background\"\napplication. For UI elements that get to display\nlater, \"ui\\-element\" is in\\-between. The application\nwill not appear in dock, but get full access to\ndesktop when it does open a Window later.\n.TP\n\\fB\\-\\-macos\\-sign\\-identity\\fR=\\fI\\,MACOS_APP_VERSION\\/\\fR\nWhen signing on macOS, by default an ad\\-hoc identify\nwill be used, but with this option your get to specify\nanother identity to use. The signing of code is now\nmandatory on macOS and cannot be disabled. Use \"auto\"\nto detect your only identity installed. Default \"adhoc\" if not given.\n.TP\n\\fB\\-\\-macos\\-sign\\-notarization\\fR\nWhen signing for notarization, using a proper TeamID\nidentity from Apple, use the required runtime signing\noption, such that it can be accepted.\n.TP\n\\fB\\-\\-macos\\-app\\-version\\fR=\\fI\\,MACOS_APP_VERSION\\/\\fR\nProduct version to use in macOS bundle information.\nDefaults to \"1.0\" if not given.\n.TP\n\\fB\\-\\-macos\\-app\\-protected\\-resource\\fR=\\fI\\,RESOURCE_DESC\\/\\fR\nRequest an entitlement for access to a macOS protected\nresources, e.g.\n\"NSMicrophoneUsageDescription:Microphone access for\nrecording audio.\" requests access to the microphone\nand provides an informative text for the user, why\nthat is needed. Before the colon, is an OS identifier\nfor an access right, then the informative text. Legal\nvalues can be found on https://developer.apple.com/doc\numentation/bundleresources/information_property_list/p\nrotected_resources and the option can be specified\nmultiple times. Default empty.\n.IP\nLinux specific controls:\n.TP\n\\fB\\-\\-linux\\-icon\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd executable icon for onefile binary to use. Can be\ngiven only one time. Defaults to Python icon if\navailable.\n.IP\nBinary Version Information:\n.TP\n\\fB\\-\\-company\\-name\\fR=\\fI\\,COMPANY_NAME\\/\\fR\nName of the company to use in version information.\nDefaults to unused.\n.TP\n\\fB\\-\\-product\\-name\\fR=\\fI\\,PRODUCT_NAME\\/\\fR\nName of the product to use in version information.\nDefaults to base filename of the binary.\n.TP\n\\fB\\-\\-file\\-version\\fR=\\fI\\,FILE_VERSION\\/\\fR\nFile version to use in version information. Must be a\nsequence of up to 4 numbers, e.g. 1.0 or 1.0.0.0, no\nmore digits are allowed, no strings are allowed.\nDefaults to unused.\n.TP\n\\fB\\-\\-product\\-version\\fR=\\fI\\,PRODUCT_VERSION\\/\\fR\nProduct version to use in version information. Same\nrules as for file version. Defaults to unused.\n.TP\n\\fB\\-\\-file\\-description\\fR=\\fI\\,FILE_DESCRIPTION\\/\\fR\nDescription of the file used in version information.\nWindows only at this time. Defaults to binary\nfilename.\n.TP\n\\fB\\-\\-copyright\\fR=\\fI\\,COPYRIGHT_TEXT\\/\\fR\nCopyright used in version information. Windows/macOS\nonly at this time. Defaults to not present.\n.TP\n\\fB\\-\\-trademarks\\fR=\\fI\\,TRADEMARK_TEXT\\/\\fR\nTrademark used in version information. Windows/macOS\nonly at this time. Defaults to not present.\n.IP\nPlugin control:\n.TP\n\\fB\\-\\-enable\\-plugins\\fR=\\fI\\,PLUGIN_NAME\\/\\fR\nEnabled plugins. Must be plug\\-in names. Use '\\-\\-pluginlist' to query the full list and exit. Default empty.\n.TP\n\\fB\\-\\-disable\\-plugins\\fR=\\fI\\,PLUGIN_NAME\\/\\fR\nDisabled plugins. Must be plug\\-in names. Use '\\-\\-\nplugin\\-list' to query the full list and exit. Most\nstandard plugins are not a good idea to disable.\nDefault empty.\n.TP\n\\fB\\-\\-user\\-plugin\\fR=\\fI\\,PATH\\/\\fR\nThe file name of user plugin. Can be given multiple\ntimes. Default empty.\n.TP\n\\fB\\-\\-plugin\\-list\\fR\nShow list of all available plugins and exit. Defaults\nto off.\n.TP\n\\fB\\-\\-plugin\\-no\\-detection\\fR\nPlugins can detect if they might be used, and the you\ncan disable the warning via \"\\-\\-disable\\-plugin=pluginthat\\-warned\", or you can use this option to disable\nthe mechanism entirely, which also speeds up\ncompilation slightly of course as this detection code\nis run in vain once you are certain of which plugins\nto use. Defaults to off.\n.TP\n\\fB\\-\\-module\\-parameter\\fR=\\fI\\,MODULE_PARAMETERS\\/\\fR\nProvide a module parameter. You are asked by some\npackages to provide extra decisions. Format is\ncurrently \\fB\\-\\-module\\-parameter\\fR=\\fI\\,module\\/\\fR.name\\-optionname=value Default empty.\n.TP\n\\fB\\-\\-show\\-source\\-changes\\fR=\\fI\\,SHOW_SOURCE_CHANGES\\/\\fR\nShow source changes to original Python file content\nbefore compilation. Mostly intended for developing\nplugins and Nuitka package configuration. Use e.g. '\\-\\-\nshow\\-source\\-changes=numpy.**' to see all changes below\na given namespace or use '*' to see everything which\ncan get a lot. Default empty.\n.IP\nPlugin options of 'anti\\-bloat':\n.TP\n\\fB\\-\\-show\\-anti\\-bloat\\-changes\\fR\nAnnotate what changes are by the plugin done.\n.TP\n\\fB\\-\\-noinclude\\-setuptools\\-mode\\fR=\\fI\\,NOINCLUDE_SETUPTOOLS_MODE\\/\\fR\nWhat to do if a 'setuptools' or import is encountered.\nThis package can be big with dependencies, and should\ndefinitely be avoided. Also handles 'setuptools_scm'.\n.TP\n\\fB\\-\\-noinclude\\-pytest\\-mode\\fR=\\fI\\,NOINCLUDE_PYTEST_MODE\\/\\fR\nWhat to do if a 'pytest' import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided. Also handles 'nose' imports.\n.TP\n\\fB\\-\\-noinclude\\-unittest\\-mode\\fR=\\fI\\,NOINCLUDE_UNITTEST_MODE\\/\\fR\nWhat to do if a unittest import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-IPython\\-mode\\fR=\\fI\\,NOINCLUDE_IPYTHON_MODE\\/\\fR\nWhat to do if a IPython import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-dask\\-mode\\fR=\\fI\\,NOINCLUDE_DASK_MODE\\/\\fR\nWhat to do if a 'dask' import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-numba\\-mode\\fR=\\fI\\,NOINCLUDE_NUMBA_MODE\\/\\fR\nWhat to do if a 'numba' import is encountered. This\npackage can be big with dependencies, and is currently\nnot working for standalone. This package is big with\ndependencies, and should definitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-default\\-mode\\fR=\\fI\\,NOINCLUDE_DEFAULT_MODE\\/\\fR\nThis actually provides the default \"warning\" value for\nabove options, and can be used to turn all of these\non.\n.TP\n\\fB\\-\\-noinclude\\-custom\\-mode\\fR=\\fI\\,CUSTOM_CHOICES\\/\\fR\nWhat to do if a specific import is encountered. Format\nis module name, which can and should be a top level\npackage and then one choice, \"error\", \"warning\",\n\"nofollow\", e.g. PyQt5:error.\n.IP\nPlugin options of 'datafile\\-inclusion\\-ng':\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-compile\\-time\\-pattern\\fR=\\fI\\,EMBED_COMPILE_TIME_PATTERN\\/\\fR\nPattern of data files to embed for use during compile\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-run\\-time\\-pattern\\fR=\\fI\\,EMBED_RUN_TIME_PATTERN\\/\\fR\nPattern of data files to embed for use during run\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-qt\\-resource\\-pattern\\fR=\\fI\\,EMBED_QT_RESOURCE_PATTERN\\/\\fR\nPattern of data files to embed for use with Qt at run\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-debug\\-qt\\-resources\\fR\nFor debugging purposes, print out information for Qt\nresources not found.\n.PP\n.SH EXAMPLES\n\nCompile a Python file \"some_module.py\" to a module \"some_module.so\":\n.IP\n\\f(CW$ nuitka \\-\\-module some_module.py\\fR\n.PP\nCompile a Python program \"some_program.py\" to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the package \"some_package\" it\nuses to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-follow\\-import-\\-to=some_package some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and all the modules it uses to an executable \"some_program.exe\". Then execute it immediately when ready:\n.IP\n\\f(CW$ nuitka \\-\\-run \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses (even standard library) to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-recurse\\-all \\-\\-follow\\-stdlib some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Keep the debug information, so valgrind, gdb, etc. work\nnicely.\n\nNote: This will *not* degrade performance:\n.IP\n\\f(CW$ nuitka \\-\\-unstripped \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks. Also use the debug Python library, which does its own checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-python-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\n"
  },
  {
    "path": "doc/nuitka.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.49.1.\n.TH NUITKA \"1\" \"2024\" \"nuitka 2.2\" \"User Commands\"\n.SH NAME\nnuitka \\- the Python compiler\n.SH SYNOPSIS\n.B nuitka\n[\\fI\\,--module\\/\\fR] [\\fI\\,--run\\/\\fR] [\\fI\\,options\\/\\fR] \\fI\\,main_module.py\\/\\fR\n.SH OPTIONS\n.TP\n\\fB\\-\\-help\\fR\nshow this help message and exit\n.TP\n\\fB\\-\\-version\\fR\nShow version information and important details for bug\nreports, then exit. Defaults to off.\n.TP\n\\fB\\-\\-module\\fR\nCreate an importable binary extension module\nexecutable instead of a program. Defaults to off.\n.TP\n\\fB\\-\\-standalone\\fR\nEnable standalone mode for output. This allows you to\ntransfer the created binary to other machines without\nit using an existing Python installation. This also\nmeans it will become big. It implies these option: \"\\-\\-\nfollow\\-imports\" and \"\\-\\-python\\-flag=no_site\". Defaults\nto off.\n.TP\n\\fB\\-\\-onefile\\fR\nOn top of standalone mode, enable onefile mode. This\nmeans not a folder, but a compressed executable is\ncreated and used. Defaults to off.\n.TP\n\\fB\\-\\-python\\-flag\\fR=\\fI\\,FLAG\\/\\fR\nPython flags to use. Default is what you are using to\nrun Nuitka, this enforces a specific mode. These are\noptions that also exist to standard Python executable.\nCurrently supported: \"\\-S\" (alias \"no_site\"),\n\"static_hashes\" (do not use hash randomization),\n\"no_warnings\" (do not give Python run time warnings),\n\"\\-O\" (alias \"no_asserts\"), \"no_docstrings\" (do not use\ndoc strings), \"\\-u\" (alias \"unbuffered\"), \"isolated\"\n(do not load outside code) and \"\\-m\" (package mode,\ncompile as \"package.__main__\"). Default empty.\n.TP\n\\fB\\-\\-python\\-debug\\fR\nUse debug version or not. Default uses what you are\nusing to run Nuitka, most likely a non\\-debug version.\nOnly for debugging and testing purposes.\n.TP\n\\fB\\-\\-python\\-for\\-scons\\fR=\\fI\\,PATH\\/\\fR\nWhen compiling with Python 3.4 provide the path of a\nPython binary to use for Scons. Otherwise Nuitka can\nuse what you run Nuitka with, or find Python\ninstallation, e.g. from Windows registry. On Windows,\na Python 3.5 or higher is needed. On non\\-Windows, a\nPython 2.6 or 2.7 will do as well.\n.TP\n\\fB\\-\\-main\\fR=\\fI\\,PATH\\/\\fR\nIf specified once, this takes the place of the\npositional argument, i.e. the filename to compile.\nWhen given multiple times, it enables \"multidist\" (see\nUser Manual) it allows you to create binaries that\ndepending on file name or invocation name.\n.IP\nControl the inclusion of modules and packages in result:\n.TP\n\\fB\\-\\-include\\-package\\fR=\\fI\\,PACKAGE\\/\\fR\nInclude a whole package. Give as a Python namespace,\ne.g. \"some_package.sub_package\" and Nuitka will then\nfind it and include it and all the modules found below\nthat disk location in the binary or extension module\nit creates, and make it available for import by the\ncode. To avoid unwanted sub packages, e.g. tests you\ncan e.g. do this \"\\-\\-nofollow\\-import\\-to=*.tests\".\nDefault empty.\n.TP\n\\fB\\-\\-include\\-module\\fR=\\fI\\,MODULE\\/\\fR\nInclude a single module. Give as a Python namespace,\ne.g. \"some_package.some_module\" and Nuitka will then\nfind it and include it in the binary or extension\nmodule it creates, and make it available for import by\nthe code. Default empty.\n.TP\n\\fB\\-\\-include\\-plugin\\-directory\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nInclude also the code found in that directory,\nconsidering as if they are each given as a main file.\nOverrides all other inclusion options. You ought to\nprefer other inclusion options, that go by names,\nrather than filenames, those find things through being\nin \"sys.path\". This option is for very special use\ncases only. Can be given multiple times. Default\nempty.\n.TP\n\\fB\\-\\-include\\-plugin\\-files\\fR=\\fI\\,PATTERN\\/\\fR\nInclude into files matching the PATTERN. Overrides all\nother follow options. Can be given multiple times.\nDefault empty.\n.TP\n\\fB\\-\\-prefer\\-source\\-code\\fR\nFor already compiled extension modules, where there is\nboth a source file and an extension module, normally\nthe extension module is used, but it should be better\nto compile the module from available source code for\nbest performance. If not desired, there is \\fB\\-\\-noprefer\\-source\\-code\\fR to disable warnings about it.\nDefault off.\n.IP\nControl the following into imported modules:\n.TP\n\\fB\\-\\-follow\\-imports\\fR\nDescend into all imported modules. Defaults to on in\nstandalone mode, otherwise off.\n.TP\n\\fB\\-\\-follow\\-import\\-to\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nFollow to that module if used, or if a package, to the\nwhole package. Can be given multiple times. Default\nempty.\n.TP\n\\fB\\-\\-nofollow\\-import\\-to\\fR=\\fI\\,MODULE\\/\\fR/PACKAGE\nDo not follow to that module name even if used, or if\na package name, to the whole package in any case,\noverrides all other options. Can be given multiple\ntimes. Default empty.\n.TP\n\\fB\\-\\-nofollow\\-imports\\fR\nDo not descend into any imported modules at all,\noverrides all other inclusion options and not usable\nfor standalone mode. Defaults to off.\n.TP\n\\fB\\-\\-follow\\-stdlib\\fR\nAlso descend into imported modules from standard\nlibrary. This will increase the compilation time by a\nlot and is also not well tested at this time and\nsometimes won't work. Defaults to off.\n.IP\nOnefile options:\n.TP\n\\fB\\-\\-onefile\\-tempdir\\-spec\\fR=\\fI\\,ONEFILE_TEMPDIR_SPEC\\/\\fR\nUse this as a folder to unpack to in onefile mode.\nDefaults to '{TEMP}/onefile_{PID}_{TIME}', i.e. user\ntemporary directory and being non\\-static it's removed.\nUse e.g. a string like\n\\&'{CACHE_DIR}/{COMPANY}/{PRODUCT}/{VERSION}' which is a\ngood static cache path, this will then not be removed.\n.TP\n\\fB\\-\\-onefile\\-child\\-grace\\-time\\fR=\\fI\\,GRACE_TIME_MS\\/\\fR\nWhen stopping the child, e.g. due to CTRL\\-C or\nshutdown, etc. the Python code gets a\n\"KeyboardInterrupt\", that it may handle e.g. to flush\ndata. This is the amount of time in ms, before the\nchild it killed in the hard way. Unit is ms, and\ndefault 5000.\n.TP\n\\fB\\-\\-onefile\\-no\\-compression\\fR\nWhen creating the onefile, disable compression of the\npayload. This is mostly for debug purposes, or to save\ntime. Default is off.\n.TP\n\\fB\\-\\-onefile\\-as\\-archive\\fR\nWhen creating the onefile, use an archive format, that\ncan be unpacked with \"nuitka\\-onefile\\-unpack\" rather\nthan a stream that only the onefile program itself\nunpacks. Default is off.\n.IP\nData files:\n.TP\n\\fB\\-\\-include\\-package\\-data\\fR=\\fI\\,PACKAGE\\/\\fR\nInclude data files for the given package name. DLLs\nand extension modules are not data files and never\nincluded like this. Can use patterns the filenames as\nindicated below. Data files of packages are not\nincluded by default, but package configuration can do\nit. This will only include non\\-DLL, non\\-extension\nmodules, i.e. actual data files. After a \":\"\noptionally a filename pattern can be given as well,\nselecting only matching files. Examples: \"\\-\\-includepackage\\-data=package_name\" (all files) \"\\-\\-includepackage\\-data=package_name=*.txt\" (only certain type) \"\n\\fB\\-\\-include\\-package\\-data\\fR=\\fI\\,package_name=some_filename\\/\\fR.dat\n(concrete file) Default empty.\n.TP\n\\fB\\-\\-include\\-data\\-files\\fR=\\fI\\,DESC\\/\\fR\nInclude data files by filenames in the distribution.\nThere are many allowed forms. With '\\-\\-include\\-datafiles=/path/to/file/*.txt=folder_name/some.txt' it\nwill copy a single file and complain if it's multiple.\nWith '\\-\\-include\\-datafiles=/path/to/files/*.txt=folder_name/' it will put\nall matching files into that folder. For recursive\ncopy there is a form with 3 values that '\\-\\-includedata\\-files=/path/to/scan=folder_name=**/*.txt' that\nwill preserve directory structure. Default empty.\n.TP\n\\fB\\-\\-include\\-data\\-dir\\fR=\\fI\\,DIRECTORY\\/\\fR\nInclude data files from complete directory in the\ndistribution. This is recursive. Check '\\-\\-includedata\\-files' with patterns if you want non\\-recursive\ninclusion. An example would be '\\-\\-include\\-datadir=/path/some_dir=data/some_dir' for plain copy, of\nthe whole directory. All non\\-code files are copied, if\nyou want to use '\\-\\-noinclude\\-data\\-files' option to\nremove them. Default empty.\n.TP\n\\fB\\-\\-noinclude\\-data\\-files\\fR=\\fI\\,PATTERN\\/\\fR\nDo not include data files matching the filename\npattern given. This is against the target filename,\nnot source paths. So to ignore a file pattern from\npackage data for 'package_name' should be matched as\n\\&'package_name/*.txt'. Or for the whole directory\nsimply use 'package_name'. Default empty.\n.TP\n\\fB\\-\\-include\\-onefile\\-external\\-data\\fR=\\fI\\,PATTERN\\/\\fR\nInclude the specified data file patterns outside of\nthe onefile binary, rather than on the inside. Makes\nonly sense in case of '\\-\\-onefile' compilation. First\nfiles have to be specified as included somehow, then\nthis refers to target paths. Default empty.\n.TP\n\\fB\\-\\-list\\-package\\-data\\fR=\\fI\\,LIST_PACKAGE_DATA\\/\\fR\nOutput the data files found for a given package name.\nDefault not done.\n.IP\nMetadata support:\n.TP\n\\fB\\-\\-include\\-distribution\\-metadata\\fR=\\fI\\,DISTRIBUTION\\/\\fR\nInclude metadata information for the given\ndistribution name. Some packages check metadata for\npresence, version, entry points, etc. and without this\noption given, it only works when it's recognized at\ncompile time which is not always happening. This of\ncourse only makes sense for packages that are included\nin the compilation. Default empty.\n.IP\nDLL files:\n.TP\n\\fB\\-\\-noinclude\\-dlls\\fR=\\fI\\,PATTERN\\/\\fR\nDo not include DLL files matching the filename pattern\ngiven. This is against the target filename, not source\npaths. So ignore a DLL 'someDLL' contained in the\npackage 'package_name' it should be matched as\n\\&'package_name/someDLL.*'. Default empty.\n.TP\n\\fB\\-\\-list\\-package\\-dlls\\fR=\\fI\\,LIST_PACKAGE_DLLS\\/\\fR\nOutput the DLLs found for a given package name.\nDefault not done.\n.IP\nControl the warnings to be given by Nuitka:\n.TP\n\\fB\\-\\-warn\\-implicit\\-exceptions\\fR\nEnable warnings for implicit exceptions detected at\ncompile time.\n.TP\n\\fB\\-\\-warn\\-unusual\\-code\\fR\nEnable warnings for unusual code detected at compile\ntime.\n.TP\n\\fB\\-\\-assume\\-yes\\-for\\-downloads\\fR\nAllow Nuitka to download external code if necessary,\ne.g. dependency walker, ccache, and even gcc on\nWindows. To disable, redirect input from nul device,\ne.g. \"</dev/null\" or \"<NUL:\". Default is to prompt.\n.TP\n\\fB\\-\\-nowarn\\-mnemonic\\fR=\\fI\\,MNEMONIC\\/\\fR\nDisable warning for a given mnemonic. These are given\nto make sure you are aware of certain topics, and\ntypically point to the Nuitka website. The mnemonic is\nthe part of the URL at the end, without the HTML\nsuffix. Can be given multiple times and accepts shell\npattern. Default empty.\n.IP\nImmediate execution after compilation:\n.TP\n\\fB\\-\\-run\\fR\nExecute immediately the created binary (or import the\ncompiled module). Defaults to off.\n.TP\n\\fB\\-\\-debugger\\fR\nExecute inside a debugger, e.g. \"gdb\" or \"lldb\" to\nautomatically get a stack trace. Defaults to off.\n.IP\nCompilation choices:\n.TP\n\\fB\\-\\-user\\-package\\-configuration\\-file\\fR=\\fI\\,YAML_FILENAME\\/\\fR\nUser provided Yaml file with package configuration.\nYou can include DLLs, remove bloat, add hidden\ndependencies. Check the Nuitka Package Configuration\nManual for a complete description of the format to\nuse. Can be given multiple times. Defaults to empty.\n.TP\n\\fB\\-\\-full\\-compat\\fR\nEnforce absolute compatibility with CPython. Do not\neven allow minor deviations from CPython behavior,\ne.g. not having better tracebacks or exception\nmessages which are not really incompatible, but only\ndifferent or worse. This is intended for tests only\nand should *not* be used.\n.TP\n\\fB\\-\\-file\\-reference\\-choice\\fR=\\fI\\,MODE\\/\\fR\nSelect what value \"__file__\" is going to be. With\n\"runtime\" (default for standalone binary mode and\nmodule mode), the created binaries and modules, use\nthe location of themselves to deduct the value of\n\"__file__\". Included packages pretend to be in\ndirectories below that location. This allows you to\ninclude data files in deployments. If you merely seek\nacceleration, it's better for you to use the\n\"original\" value, where the source files location will\nbe used. With \"frozen\" a notation \"<frozen\nmodule_name>\" is used. For compatibility reasons, the\n\"__file__\" value will always have \".py\" suffix\nindependent of what it really is.\n.TP\n\\fB\\-\\-module\\-name\\-choice\\fR=\\fI\\,MODE\\/\\fR\nSelect what value \"__name__\" and \"__package__\" are\ngoing to be. With \"runtime\" (default for module mode),\nthe created module uses the parent package to deduce\nthe value of \"__package__\", to be fully compatible.\nThe value \"original\" (default for other modes) allows\nfor more static optimization to happen, but is\nincompatible for modules that normally can be loaded\ninto any package.\n.IP\nOutput choices:\n.TP\n\\fB\\-\\-output\\-filename\\fR=\\fI\\,FILENAME\\/\\fR\nSpecify how the executable should be named. For\nextension modules there is no choice, also not for\nstandalone mode and using it will be an error. This\nmay include path information that needs to exist\nthough. Defaults to '<program_name>.bin' on this\nplatform.\n.TP\n\\fB\\-\\-output\\-dir\\fR=\\fI\\,DIRECTORY\\/\\fR\nSpecify where intermediate and final output files\nshould be put. The DIRECTORY will be populated with\nbuild folder, dist folder, binaries, etc. Defaults to\ncurrent directory.\n.TP\n\\fB\\-\\-remove\\-output\\fR\nRemoves the build directory after producing the module\nor exe file. Defaults to off.\n.TP\n\\fB\\-\\-no\\-pyi\\-file\\fR\nDo not create a '.pyi' file for extension modules\ncreated by Nuitka. This is used to detect implicit\nimports. Defaults to off.\n.IP\nDeployment control:\n.TP\n\\fB\\-\\-deployment\\fR\nDisable code aimed at making finding compatibility\nissues easier. This will e.g. prevent execution with\n\"\\-c\" argument, which is often used by code that\nattempts run a module, and causes a program to start\nitself over and over potentially. Disable once you\ndeploy to end users, for finding typical issues, this\nis very helpful during development. Default off.\n.TP\n\\fB\\-\\-no\\-deployment\\-flag\\fR=\\fI\\,FLAG\\/\\fR\nKeep deployment mode, but disable selectively parts of\nit. Errors from deployment mode will output these\nidentifiers. Default empty.\n.IP\nEnvironment control:\n.TP\n\\fB\\-\\-force\\-runtime\\-environment\\-variable\\fR=\\fI\\,VARIABLE_SPEC\\/\\fR\nForce an environment variables to a given value.\nDefault empty.\n.IP\nDebug features:\n.TP\n\\fB\\-\\-debug\\fR\nExecuting all self checks possible to find errors in\nNuitka, do not use for production. Defaults to off.\n.TP\n\\fB\\-\\-unstripped\\fR\nKeep debug info in the resulting object file for\nbetter debugger interaction. Defaults to off.\n.TP\n\\fB\\-\\-profile\\fR\nEnable vmprof based profiling of time spent. Not\nworking currently. Defaults to off.\n.TP\n\\fB\\-\\-internal\\-graph\\fR\nCreate graph of optimization process internals, do not\nuse for whole programs, but only for small test cases.\nDefaults to off.\n.TP\n\\fB\\-\\-trace\\-execution\\fR\nTraced execution output, output the line of code\nbefore executing it. Defaults to off.\n.TP\n\\fB\\-\\-recompile\\-c\\-only\\fR\nThis is not incremental compilation, but for Nuitka\ndevelopment only. Takes existing files and simply\ncompile them as C again. Allows compiling edited C\nfiles for quick debugging changes to the generated\nsource, e.g. to see if code is passed by, values\noutput, etc, Defaults to off. Depends on compiling\nPython source to determine which files it should look\nat.\n.TP\n\\fB\\-\\-xml\\fR=\\fI\\,XML_FILENAME\\/\\fR\nWrite the internal program structure, result of\noptimization in XML form to given filename.\n.TP\n\\fB\\-\\-experimental\\fR=\\fI\\,FLAG\\/\\fR\nUse features declared as 'experimental'. May have no\neffect if no experimental features are present in the\ncode. Uses secret tags (check source) per experimented\nfeature.\n.TP\n\\fB\\-\\-low\\-memory\\fR\nAttempt to use less memory, by forking less C\ncompilation jobs and using options that use less\nmemory. For use on embedded machines. Use this in case\nof out of memory problems. Defaults to off.\n.TP\n\\fB\\-\\-create\\-environment\\-from\\-report\\fR=\\fI\\,CREATE_ENVIRONMENT_FROM_REPORT\\/\\fR\nCreate a new virtualenv in that non\\-existing path from\nthe report file given with e.g. '\\-\\-report=compilationreport.xml'. Default not done.\n.TP\n\\fB\\-\\-generate\\-c\\-only\\fR\nGenerate only C source code, and do not compile it to\nbinary or module. This is for debugging and code\ncoverage analysis that doesn't waste CPU. Defaults to\noff. Do not think you can use this directly.\n.IP\nBackend C compiler choice:\n.TP\n\\fB\\-\\-clang\\fR\nEnforce the use of clang. On Windows this requires a\nworking Visual Studio version to piggy back on.\nDefaults to off.\n.TP\n\\fB\\-\\-mingw64\\fR\nEnforce the use of MinGW64 on Windows. Defaults to off\nunless MSYS2 with MinGW Python is used.\n.TP\n\\fB\\-\\-msvc\\fR=\\fI\\,MSVC_VERSION\\/\\fR\nEnforce the use of specific MSVC version on Windows.\nAllowed values are e.g. \"14.3\" (MSVC 2022) and other\nMSVC version numbers, specify \"list\" for a list of\ninstalled compilers, or use \"latest\".  Defaults to\nlatest MSVC being used if installed, otherwise MinGW64\nis used.\n.TP\n\\fB\\-\\-jobs\\fR=\\fI\\,N\\/\\fR\nSpecify the allowed number of parallel C compiler\njobs. Defaults to the system CPU count.\n.TP\n\\fB\\-\\-lto\\fR=\\fI\\,choice\\/\\fR\nUse link time optimizations (MSVC, gcc, clang).\nAllowed values are \"yes\", \"no\", and \"auto\" (when it's\nknown to work). Defaults to \"auto\".\n.TP\n\\fB\\-\\-static\\-libpython\\fR=\\fI\\,choice\\/\\fR\nUse static link library of Python. Allowed values are\n\"yes\", \"no\", and \"auto\" (when it's known to work).\nDefaults to \"auto\".\n.TP\n\\fB\\-\\-cf\\-protection\\fR=\\fI\\,PROTECTION_MODE\\/\\fR\nThis option is gcc specific. For the gcc compiler,\nselect the \"cf\\-protection\" mode. Default \"auto\" is to\nuse the gcc default value, but you can override it,\ne.g. to disable it with \"none\" value. Refer to gcc\ndocumentation for \"\\-fcf\\-protection\" for the details.\n.IP\nCache Control:\n.TP\n\\fB\\-\\-disable\\-cache\\fR=\\fI\\,DISABLED_CACHES\\/\\fR\nDisable selected caches, specify \"all\" for all cached.\nCurrently allowed values are:\n\"all\",\"ccache\",\"bytecode\",\"compression\". can be given\nmultiple times or with comma separated values. Default\nnone.\n.TP\n\\fB\\-\\-clean\\-cache\\fR=\\fI\\,CLEAN_CACHES\\/\\fR\nClean the given caches before executing, specify \"all\"\nfor all cached. Currently allowed values are:\n\"all\",\"ccache\",\"bytecode\",\"compression\". can be given\nmultiple times or with comma separated values. Default\nnone.\n.TP\n\\fB\\-\\-disable\\-bytecode\\-cache\\fR\nDo not reuse dependency analysis results for modules,\nesp. from standard library, that are included as\nbytecode. Same as \\fB\\-\\-disable\\-cache\\fR=\\fI\\,bytecode\\/\\fR.\n.TP\n\\fB\\-\\-disable\\-ccache\\fR\nDo not attempt to use ccache (gcc, clang, etc.) or\nclcache (MSVC, clangcl). Same as \\fB\\-\\-disablecache\\fR=\\fI\\,ccache\\/\\fR.\n.IP\nPGO compilation choices:\n.TP\n\\fB\\-\\-pgo\\fR\nEnables C level profile guided optimization (PGO), by\nexecuting a dedicated build first for a profiling run,\nand then using the result to feedback into the C\ncompilation. Note: This is experimental and not\nworking with standalone modes of Nuitka yet. Defaults\nto off.\n.TP\n\\fB\\-\\-pgo\\-args\\fR=\\fI\\,PGO_ARGS\\/\\fR\nArguments to be passed in case of profile guided\noptimization. These are passed to the special built\nexecutable during the PGO profiling run. Default\nempty.\n.TP\n\\fB\\-\\-pgo\\-executable\\fR=\\fI\\,PGO_EXECUTABLE\\/\\fR\nCommand to execute when collecting profile\ninformation. Use this only, if you need to launch it\nthrough a script that prepares it to run. Default use\ncreated program.\n.IP\nTracing features:\n.TP\n\\fB\\-\\-report\\fR=\\fI\\,REPORT_FILENAME\\/\\fR\nReport module, data files, compilation, plugin, etc.\ndetails in an XML output file. This is also super\nuseful for issue reporting. These reports can e.g. be\nused to re\\-create the environment easily using it with\n\\&'\\-\\-create\\-environment\\-from\\-report', but contain a lot\nof information. Default is off.\n.TP\n\\fB\\-\\-report\\-diffable\\fR\nReport data in diffable form, i.e. no timing or memory\nusage values that vary from run to run. Default is\noff.\n.TP\n\\fB\\-\\-report\\-user\\-provided\\fR=\\fI\\,KEY_VALUE\\/\\fR\nReport data from you. This can be given multiple times\nand be anything in 'key=value' form, where key should\nbe an identifier, e.g. use '\\-\\-report\\-userprovided=pipenv\\-lock\\-hash=64a5e4' to track some input\nvalues. Default is empty.\n.TP\n\\fB\\-\\-report\\-template\\fR=\\fI\\,REPORT_DESC\\/\\fR\nReport via template. Provide template and output\nfilename 'template.rst.j2:output.rst'. For built\\-in\ntemplates, check the User Manual for what these are.\nCan be given multiple times. Default is empty.\n.TP\n\\fB\\-\\-quiet\\fR\nDisable all information outputs, but show warnings.\nDefaults to off.\n.TP\n\\fB\\-\\-show\\-scons\\fR\nRun the C building backend Scons with verbose\ninformation, showing the executed commands, detected\ncompilers. Defaults to off.\n.TP\n\\fB\\-\\-no\\-progressbar\\fR\nDisable progress bars. Defaults to off.\n.TP\n\\fB\\-\\-show\\-progress\\fR\nObsolete: Provide progress information and statistics.\nDisables normal progress bar. Defaults to off.\n.TP\n\\fB\\-\\-show\\-memory\\fR\nProvide memory information and statistics. Defaults to\noff.\n.TP\n\\fB\\-\\-show\\-modules\\fR\nProvide information for included modules and DLLs\nObsolete: You should use '\\-\\-report' file instead.\nDefaults to off.\n.TP\n\\fB\\-\\-show\\-modules\\-output\\fR=\\fI\\,PATH\\/\\fR\nWhere to output '\\-\\-show\\-modules', should be a\nfilename. Default is standard output.\n.TP\n\\fB\\-\\-verbose\\fR\nOutput details of actions taken, esp. in\noptimizations. Can become a lot. Defaults to off.\n.TP\n\\fB\\-\\-verbose\\-output\\fR=\\fI\\,PATH\\/\\fR\nWhere to output from '\\-\\-verbose', should be a\nfilename. Default is standard output.\n.IP\nGeneral OS controls:\n.TP\n\\fB\\-\\-disable\\-console\\fR\nWhen compiling for Windows or macOS, disable the\nconsole window and create a GUI application. Defaults\nto off.\n.TP\n\\fB\\-\\-enable\\-console\\fR\nWhen compiling for Windows or macOS, enable the\nconsole window and create a console application. This\ndisables hints from certain modules, e.g. \"PySide\"\nthat suggest to disable it. Defaults to true.\n.TP\n\\fB\\-\\-force\\-stdout\\-spec\\fR=\\fI\\,FORCE_STDOUT_SPEC\\/\\fR\nForce standard output of the program to go to this\nlocation. Useful for programs with disabled console\nand programs using the Windows Services Plugin of\nNuitka commercial. Defaults to not active, use e.g.\n\\&'{PROGRAM_BASE}.out.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\n.TP\n\\fB\\-\\-force\\-stderr\\-spec\\fR=\\fI\\,FORCE_STDERR_SPEC\\/\\fR\nForce standard error of the program to go to this\nlocation. Useful for programs with disabled console\nand programs using the Windows Services Plugin of\nNuitka commercial. Defaults to not active, use e.g.\n\\&'{PROGRAM_BASE}.err.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\n.IP\nWindows specific controls:\n.TP\n\\fB\\-\\-windows\\-icon\\-from\\-ico\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd executable icon. Can be given multiple times for\ndifferent resolutions or files with multiple icons\ninside. In the later case, you may also suffix with\n#<n> where n is an integer index starting from 1,\nspecifying a specific icon to be included, and all\nothers to be ignored.\n.TP\n\\fB\\-\\-windows\\-icon\\-from\\-exe\\fR=\\fI\\,ICON_EXE_PATH\\/\\fR\nCopy executable icons from this existing executable\n(Windows only).\n.TP\n\\fB\\-\\-onefile\\-windows\\-splash\\-screen\\-image\\fR=\\fI\\,SPLASH_SCREEN_IMAGE\\/\\fR\nWhen compiling for Windows and onefile, show this\nwhile loading the application. Defaults to off.\n.TP\n\\fB\\-\\-windows\\-uac\\-admin\\fR\nRequest Windows User Control, to grant admin rights on\nexecution. (Windows only). Defaults to off.\n.TP\n\\fB\\-\\-windows\\-uac\\-uiaccess\\fR\nRequest Windows User Control, to enforce running from\na few folders only, remote desktop access. (Windows\nonly). Defaults to off.\n.IP\nmacOS specific controls:\n.TP\n\\fB\\-\\-macos\\-create\\-app\\-bundle\\fR\nWhen compiling for macOS, create a bundle rather than\na plain binary application. This is the only way to\nunlock the disabling of console, get high DPI\ngraphics, etc. and implies standalone mode. Defaults\nto off.\n.TP\n\\fB\\-\\-macos\\-target\\-arch\\fR=\\fI\\,MACOS_TARGET_ARCH\\/\\fR\nWhat architectures is this to supposed to run on.\nDefault and limit is what the running Python allows\nfor. Default is \"native\" which is the architecture the\nPython is run with.\n.TP\n\\fB\\-\\-macos\\-app\\-icon\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd icon for the application bundle to use. Can be\ngiven only one time. Defaults to Python icon if\navailable.\n.TP\n\\fB\\-\\-macos\\-signed\\-app\\-name\\fR=\\fI\\,MACOS_SIGNED_APP_NAME\\/\\fR\nName of the application to use for macOS signing.\nFollow \"com.YourCompany.AppName\" naming results for\nbest results, as these have to be globally unique, and\nwill potentially grant protected API accesses.\n.TP\n\\fB\\-\\-macos\\-app\\-name\\fR=\\fI\\,MACOS_APP_NAME\\/\\fR\nName of the product to use in macOS bundle\ninformation. Defaults to base filename of the binary.\n.TP\n\\fB\\-\\-macos\\-app\\-mode\\fR=\\fI\\,MODE\\/\\fR\nMode of application for the application bundle. When\nlaunching a Window, and appearing in Docker is\ndesired, default value \"gui\" is a good fit. Without a\nWindow ever, the application is a \"background\"\napplication. For UI elements that get to display\nlater, \"ui\\-element\" is in\\-between. The application\nwill not appear in dock, but get full access to\ndesktop when it does open a Window later.\n.TP\n\\fB\\-\\-macos\\-sign\\-identity\\fR=\\fI\\,MACOS_APP_VERSION\\/\\fR\nWhen signing on macOS, by default an ad\\-hoc identify\nwill be used, but with this option your get to specify\nanother identity to use. The signing of code is now\nmandatory on macOS and cannot be disabled. Use \"auto\"\nto detect your only identity installed. Default \"adhoc\" if not given.\n.TP\n\\fB\\-\\-macos\\-sign\\-notarization\\fR\nWhen signing for notarization, using a proper TeamID\nidentity from Apple, use the required runtime signing\noption, such that it can be accepted.\n.TP\n\\fB\\-\\-macos\\-app\\-version\\fR=\\fI\\,MACOS_APP_VERSION\\/\\fR\nProduct version to use in macOS bundle information.\nDefaults to \"1.0\" if not given.\n.TP\n\\fB\\-\\-macos\\-app\\-protected\\-resource\\fR=\\fI\\,RESOURCE_DESC\\/\\fR\nRequest an entitlement for access to a macOS protected\nresources, e.g.\n\"NSMicrophoneUsageDescription:Microphone access for\nrecording audio.\" requests access to the microphone\nand provides an informative text for the user, why\nthat is needed. Before the colon, is an OS identifier\nfor an access right, then the informative text. Legal\nvalues can be found on https://developer.apple.com/doc\numentation/bundleresources/information_property_list/p\nrotected_resources and the option can be specified\nmultiple times. Default empty.\n.IP\nLinux specific controls:\n.TP\n\\fB\\-\\-linux\\-icon\\fR=\\fI\\,ICON_PATH\\/\\fR\nAdd executable icon for onefile binary to use. Can be\ngiven only one time. Defaults to Python icon if\navailable.\n.IP\nBinary Version Information:\n.TP\n\\fB\\-\\-company\\-name\\fR=\\fI\\,COMPANY_NAME\\/\\fR\nName of the company to use in version information.\nDefaults to unused.\n.TP\n\\fB\\-\\-product\\-name\\fR=\\fI\\,PRODUCT_NAME\\/\\fR\nName of the product to use in version information.\nDefaults to base filename of the binary.\n.TP\n\\fB\\-\\-file\\-version\\fR=\\fI\\,FILE_VERSION\\/\\fR\nFile version to use in version information. Must be a\nsequence of up to 4 numbers, e.g. 1.0 or 1.0.0.0, no\nmore digits are allowed, no strings are allowed.\nDefaults to unused.\n.TP\n\\fB\\-\\-product\\-version\\fR=\\fI\\,PRODUCT_VERSION\\/\\fR\nProduct version to use in version information. Same\nrules as for file version. Defaults to unused.\n.TP\n\\fB\\-\\-file\\-description\\fR=\\fI\\,FILE_DESCRIPTION\\/\\fR\nDescription of the file used in version information.\nWindows only at this time. Defaults to binary\nfilename.\n.TP\n\\fB\\-\\-copyright\\fR=\\fI\\,COPYRIGHT_TEXT\\/\\fR\nCopyright used in version information. Windows/macOS\nonly at this time. Defaults to not present.\n.TP\n\\fB\\-\\-trademarks\\fR=\\fI\\,TRADEMARK_TEXT\\/\\fR\nTrademark used in version information. Windows/macOS\nonly at this time. Defaults to not present.\n.IP\nPlugin control:\n.TP\n\\fB\\-\\-enable\\-plugins\\fR=\\fI\\,PLUGIN_NAME\\/\\fR\nEnabled plugins. Must be plug\\-in names. Use '\\-\\-pluginlist' to query the full list and exit. Default empty.\n.TP\n\\fB\\-\\-disable\\-plugins\\fR=\\fI\\,PLUGIN_NAME\\/\\fR\nDisabled plugins. Must be plug\\-in names. Use '\\-\\-\nplugin\\-list' to query the full list and exit. Most\nstandard plugins are not a good idea to disable.\nDefault empty.\n.TP\n\\fB\\-\\-user\\-plugin\\fR=\\fI\\,PATH\\/\\fR\nThe file name of user plugin. Can be given multiple\ntimes. Default empty.\n.TP\n\\fB\\-\\-plugin\\-list\\fR\nShow list of all available plugins and exit. Defaults\nto off.\n.TP\n\\fB\\-\\-plugin\\-no\\-detection\\fR\nPlugins can detect if they might be used, and the you\ncan disable the warning via \"\\-\\-disable\\-plugin=pluginthat\\-warned\", or you can use this option to disable\nthe mechanism entirely, which also speeds up\ncompilation slightly of course as this detection code\nis run in vain once you are certain of which plugins\nto use. Defaults to off.\n.TP\n\\fB\\-\\-module\\-parameter\\fR=\\fI\\,MODULE_PARAMETERS\\/\\fR\nProvide a module parameter. You are asked by some\npackages to provide extra decisions. Format is\ncurrently \\fB\\-\\-module\\-parameter\\fR=\\fI\\,module\\/\\fR.name\\-optionname=value Default empty.\n.TP\n\\fB\\-\\-show\\-source\\-changes\\fR=\\fI\\,SHOW_SOURCE_CHANGES\\/\\fR\nShow source changes to original Python file content\nbefore compilation. Mostly intended for developing\nplugins and Nuitka package configuration. Use e.g. '\\-\\-\nshow\\-source\\-changes=numpy.**' to see all changes below\na given namespace or use '*' to see everything which\ncan get a lot. Default empty.\n.IP\nPlugin options of 'anti\\-bloat':\n.TP\n\\fB\\-\\-show\\-anti\\-bloat\\-changes\\fR\nAnnotate what changes are by the plugin done.\n.TP\n\\fB\\-\\-noinclude\\-setuptools\\-mode\\fR=\\fI\\,NOINCLUDE_SETUPTOOLS_MODE\\/\\fR\nWhat to do if a 'setuptools' or import is encountered.\nThis package can be big with dependencies, and should\ndefinitely be avoided. Also handles 'setuptools_scm'.\n.TP\n\\fB\\-\\-noinclude\\-pytest\\-mode\\fR=\\fI\\,NOINCLUDE_PYTEST_MODE\\/\\fR\nWhat to do if a 'pytest' import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided. Also handles 'nose' imports.\n.TP\n\\fB\\-\\-noinclude\\-unittest\\-mode\\fR=\\fI\\,NOINCLUDE_UNITTEST_MODE\\/\\fR\nWhat to do if a unittest import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-IPython\\-mode\\fR=\\fI\\,NOINCLUDE_IPYTHON_MODE\\/\\fR\nWhat to do if a IPython import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-dask\\-mode\\fR=\\fI\\,NOINCLUDE_DASK_MODE\\/\\fR\nWhat to do if a 'dask' import is encountered. This\npackage can be big with dependencies, and should\ndefinitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-numba\\-mode\\fR=\\fI\\,NOINCLUDE_NUMBA_MODE\\/\\fR\nWhat to do if a 'numba' import is encountered. This\npackage can be big with dependencies, and is currently\nnot working for standalone. This package is big with\ndependencies, and should definitely be avoided.\n.TP\n\\fB\\-\\-noinclude\\-default\\-mode\\fR=\\fI\\,NOINCLUDE_DEFAULT_MODE\\/\\fR\nThis actually provides the default \"warning\" value for\nabove options, and can be used to turn all of these\non.\n.TP\n\\fB\\-\\-noinclude\\-custom\\-mode\\fR=\\fI\\,CUSTOM_CHOICES\\/\\fR\nWhat to do if a specific import is encountered. Format\nis module name, which can and should be a top level\npackage and then one choice, \"error\", \"warning\",\n\"nofollow\", e.g. PyQt5:error.\n.IP\nPlugin options of 'datafile\\-inclusion\\-ng':\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-compile\\-time\\-pattern\\fR=\\fI\\,EMBED_COMPILE_TIME_PATTERN\\/\\fR\nPattern of data files to embed for use during compile\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-run\\-time\\-pattern\\fR=\\fI\\,EMBED_RUN_TIME_PATTERN\\/\\fR\nPattern of data files to embed for use during run\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-data\\-files\\-qt\\-resource\\-pattern\\fR=\\fI\\,EMBED_QT_RESOURCE_PATTERN\\/\\fR\nPattern of data files to embed for use with Qt at run\ntime. These should match target filenames.\n.TP\n\\fB\\-\\-embed\\-debug\\-qt\\-resources\\fR\nFor debugging purposes, print out information for Qt\nresources not found.\n.PP\n.SH EXAMPLES\n\nCompile a Python file \"some_module.py\" to a module \"some_module.so\":\n.IP\n\\f(CW$ nuitka \\-\\-module some_module.py\\fR\n.PP\nCompile a Python program \"some_program.py\" to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the package \"some_package\" it\nuses to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-follow\\-import-\\-to=some_package some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and all the modules it uses to an executable \"some_program.exe\". Then execute it immediately when ready:\n.IP\n\\f(CW$ nuitka \\-\\-run \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses (even standard library) to an executable \"some_program.exe\":\n.IP\n\\f(CW$ nuitka \\-\\-recurse\\-all \\-\\-follow\\-stdlib some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Keep the debug information, so valgrind, gdb, etc. work\nnicely.\n\nNote: This will *not* degrade performance:\n.IP\n\\f(CW$ nuitka \\-\\-unstripped \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\nCompile a Python program \"some_program.py\" and the modules it uses to an executable \"some_program.exe\". Perform all kinds of checks about correctness of the generated\nC and run\\-time checks. Also use the debug Python library, which does its own checks.\n\nNote: This will degrade performance and should only be used to debug Nuitka:\n.IP\n\\f(CW$ nuitka \\-\\-debug \\-\\-python-debug \\-\\-follow\\-imports some_program.py\\fR\n.PP\n"
  },
  {
    "path": "doc/uml/standalone-overview.plantuml",
    "content": "@startuml\n!theme spacelab\n\nrectangle \"Python Installation\" as Python {\n    rectangle \"site-packages\" as sp {\n\n        Rectangle certifi {\n            (ca.cert)\n            (__init__.py)\n            (__main__.py)\n            (core.py)\n\n        }\n        Rectangle (requests {\n            (__init__.py)\n\n        }\n\n    }\n\n    (python binary) --> (python core dll)\n    (python binary) --> (python stdlib)\n    (python binary) --> sp\n}\n\nrectangle \"Standalone Distribution\" as Standalone {\n    Rectangle \"main.exe\" as main {\n        (compiled Python code)\n        (stdlib bytecode)\n    }\n\n    (\"main exe\") --> (DLLs on disk)\n    (\"main exe\") --> (extension modules on disk)\n    (\"main exe\") --> (data files on disk)\n\n    (certifi/ca.cert) --> \"is\" (data files)\n}\n\nPython -d-^ \"compilation\" Standalone\n\n\n@enduml"
  },
  {
    "path": "doc/uml/use-cases.plantuml",
    "content": "@startuml\n!theme spacelab\n\nactor user\n\nrectangle company {\n\nrectangle development {\n    rectangle team {\n        actor deployer\n        actor developer\n        actor tester\n    }\n    rectangle artifacts {\n        (report)\n        (binaries)\n\n    }\n    developer \"changes\" ^--^ (source code)\n    deployer \"compiles\" ^-- (source code)\n    deployer \"uses\" --^ (nuitka)\n    (source code) --^ (nuitka)\n    tester \"runs from\" ^-- (binaries)\n    deployer \"releases\" --^ (binaries)\n    deployer \"checks\" ^-- (report)\n    (nuitka) \"produces\" --^ (binaries)\n    (report) \"produces\" ^-- (nuitka)\n    (binaries) -u-^ \"deployes\"  server\n}\n\n\nrectangle server {\n    (downloads)\n    user \"downloads\" -d- (downloads)\n}\n\n}\n@enduml"
  },
  {
    "path": "lib/hints.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" The hints module should contain functions to call in your code.\n\nIn reality, right now it does only contain an import tracing mechanism\nthat helps us with debugging.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport traceback\n\ntry:\n    import __builtin__ as builtins\nexcept ImportError:\n    import builtins\n\n\noriginal_import = __import__\n\n_indentation = 0\n\n\ndef _normalizePath(path):\n    path = os.path.abspath(path)\n\n    best = None\n\n    paths = list(sys.path)\n\n    # Nuitka standalone mode.\n    try:\n        paths.append(__nuitka_binary_dir)\n        paths.append(os.getcwd())\n    except NameError:\n        pass\n\n    for path_entry in paths:\n        path_entry = os.path.normcase(path_entry)\n\n        if os.path.normcase(path).startswith(path_entry):\n            if best is None or len(path_entry) > len(best):\n                best = path_entry\n\n    if best is not None:\n        path = \"$PYTHONPATH\" + path[len(best) :]\n\n    return path\n\n\ndef _moduleRepr(module):\n    try:\n        module_filename = module.__file__\n        module_filename = module_filename.replace(\".pyc\", \".py\")\n\n        if module_filename.endswith(\".so\"):\n            module_filename = os.path.join(\n                os.path.dirname(module_filename),\n                os.path.basename(module_filename).split(\".\")[0] + \".so\",\n            )\n\n        file_desc = \"file \" + _normalizePath(module_filename).replace(\".pyc\", \".py\")\n    except AttributeError:\n        file_desc = \"built-in\"\n\n    return \"<module %s %s>\" % (module.__name__, file_desc)\n\n\ndo_normalize_paths = None\ndo_show_source = None\n\n\ndef _ourimport(\n    name,\n    globals=None,  # pylint: disable=redefined-builtin\n    locals=None,  # pylint: disable=redefined-builtin\n    fromlist=None,\n    level=-1 if sys.version_info[0] < 3 else 0,\n):\n    builtins.__import__ = original_import\n\n    # Singleton, pylint: disable=global-statement\n    global _indentation\n    try:\n        _indentation += 1\n\n        print(\n            _indentation * \" \"\n            + \"called with: name=%r level=%d fromlist=%s\" % (name, level, fromlist)\n        )\n\n        for entry in traceback.extract_stack()[:-1]:\n            if entry[2] == \"_ourimport\":\n                print(_indentation * \" \" + \"by __import__\")\n            else:\n                entry = list(entry)\n\n                if not do_show_source:\n                    del entry[-1]\n                    del entry[-1]\n\n                if do_normalize_paths:\n                    entry[0] = _normalizePath(entry[0])\n\n                if entry[0].startswith(\"<frozen importlib._bootstrap\"):\n                    continue\n\n                print(_indentation * \" \" + \"by \" + \"|\".join(str(s) for s in entry))\n\n        print(_indentation * \" \" + \"*\" * 40)\n\n        builtins.__import__ = _ourimport\n        try:\n            result = original_import(name, globals, locals, fromlist, level)\n        except ImportError as e:\n            print(_indentation * \" \" + \"EXCEPTION:\", e)\n            raise\n        finally:\n            builtins.__import__ = original_import\n\n        print(_indentation * \" \" + \"RESULT:\", _moduleRepr(result))\n        print(_indentation * \" \" + \"*\" * 40)\n\n        builtins.__import__ = _ourimport\n\n        return result\n    finally:\n        _indentation -= 1\n\n\n_ourimport_reference = None\n\n\ndef enableImportTracing(normalize_paths=True, show_source=False):\n    # Remember these settings for the import replacement, pylint: disable=global-statement\n    global do_normalize_paths, do_show_source\n\n    do_normalize_paths = normalize_paths\n    do_show_source = show_source\n\n    builtins.__import__ = _ourimport\n\n    # Since we swap this around, prevent it from releasing by giving it a global\n    # name too, not only a local one, pylint: disable=global-statement\n    global _ourimport_reference\n    _ourimport_reference = _ourimport\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/codespell-ignore.txt",
    "content": "# kind of besides the point, spell-checker: disable\nasend\ncompiletime\n# Changelog mentions of package names\nconnexion\n"
  },
  {
    "path": "misc/create-pbuilder-image.py",
    "content": "#!/usr/bin/python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Small tool to create a pbuilder image for Nuitka private CI mainly. \"\"\"\n\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\n\ndebian, codename, output = sys.argv[1:]\n\nif \"-\" in codename:\n    codename, arch = codename.split(\"-\")\nelse:\n    arch = subprocess.check_output(\"dpkg-architecture -q DEB_HOST_ARCH\".split()).strip()\n\n    if str is not bytes:\n        arch = arch.decode(\"utf8\")\n\nstart_dir = os.getcwd()\n\nstage = tempfile.mkdtemp()\n\ntry:\n    os.chdir(stage)\n\n    if debian == \"debian\":\n        mirror = \"https://ftp.us.debian.org/debian\"\n        components = \"main\"\n    elif debian == \"ubuntu\":\n        mirror = \"http://de.archive.ubuntu.com/ubuntu\"\n        components = \"main,universe\"\n    else:\n        assert False, debian\n\n    subprocess.check_call(\n        [\n            \"debootstrap\",\n            \"--include=ccache\",\n            \"--include=dpkg-dev\",\n            \"--arch=\" + arch,\n            \"--components=\" + components,\n            codename,\n            \"chroot\",\n            mirror,\n        ]\n    )\n\n    subprocess.check_output([\"rm\", \"-rf\", \"chroot/var/cache/apt/archives\"])\n\n    os.makedirs(\"chroot/var/cache/apt/archives\")\n\n    os.makedirs(\"chroot/etc/apt.conf.d\")\n    with open(\"chroot/etc/apt.conf.d/75mine\", \"w\") as output_file:\n        output_file.write('Acquire::Languages \"none\";\\n')\n\n    target_filename = codename + \".tgz\"\n    subprocess.check_call([\"tar\", \"czf\", target_filename, \"-C\", \"chroot\", \".\"])\n\n    shutil.copy(target_filename, os.path.join(start_dir, output))\nfinally:\n    os.chdir(start_dir)\n    shutil.rmtree(stage)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/dump-config-options.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sysconfig\n\nprint(sysconfig.get_config_var(\"CONFIG_ARGS\"))\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/install-git-hooks.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for git hook installer tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport stat\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.Execution import getExecutablePath\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    getWindowsShortPathName,\n)\n\n\ndef main():\n    goHome()\n\n    if os.name == \"nt\":\n        git_path = getExecutablePath(\"git\")\n\n        if git_path is None:\n            git_path = r\"C:\\Program Files\\Git\\bin\\sh.exe\"\n\n            if not os.path.exists(git_path):\n                git_path = None\n\n        if git_path is None:\n            tools_logger.sysexit(\n                \"\"\"\\\nError, cannot locate 'git.exe' which we need to install git hooks. Add it to\nPATH while executing this will be sufficient.\"\"\"\n            )\n\n        for candidate in (\n            \"sh.exe\",\n            os.path.join(\"..\", \"bin\", \"sh.exe\"),\n            os.path.join(\"..\", \"..\", \"bin\", \"sh.exe\"),\n        ):\n            sh_path = os.path.normpath(\n                os.path.join(os.path.dirname(git_path), candidate)\n            )\n\n            if os.path.exists(sh_path):\n                break\n        else:\n            tools_logger.sysexit(\n                \"\"\"\\\nError, cannot locate 'sh.exe' near 'git.exe' which we need to install git hooks,\nplease improve this script.\"\"\"\n            )\n\n        # For MinGW and #! we will need a path without spaces, so use this\n        # code to find the short name, that won't have it.\n        sh_path = getWindowsShortPathName(sh_path)\n\n    for hook in os.listdir(\".githooks\"):\n        full_path = os.path.join(\".githooks\", hook)\n\n        hook_contents = getFileContents(full_path)\n\n        if hook_contents.startswith(\"#!/bin/sh\"):\n            if os.name == \"nt\":\n                # Correct shebang for Windows git to work.\n                hook_contents = \"#!%s\\n%s\" % (\n                    sh_path.replace(\"\\\\\", \"/\").replace(\" \", r\"\\ \"),\n                    hook_contents[10:],\n                )\n\n            # Also use \"sys.executable\" to make sure we find auto-format tool.\n            hook_contents = hook_contents.replace(\n                \"./bin/autoformat-nuitka-source\",\n                \"'%s' ./bin/autoformat-nuitka-source\" % sys.executable,\n            )\n        else:\n            sys.exit(\"Error, unknown hook contents.\")\n\n        hook_target = os.path.join(\".git/hooks/\", hook)\n        with open(hook_target, \"wb\") as out_file:\n            out_file.write(hook_contents.encode(\"utf8\"))\n\n        st = os.stat(hook_target)\n        os.chmod(hook_target, st.st_mode | stat.S_IEXEC)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-apidoc.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for API doc upload tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.quality.apidoc.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-coverage-rendering.py",
    "content": "#!/usr/bin/python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport os\nimport shutil\nimport subprocess\nimport sys\n\n\ndef main():\n    # Set the stage.\n    os.chdir(os.path.dirname(__file__))\n    shutil.rmtree(\"coverage\", ignore_errors=True)\n\n    print(\"Fetching coverage files:\")\n\n    subprocess.call(\n        [\"rsync\", \"-az\", \"--delete\", \"%s/\" % os.environ[\"COVERAGE_DIR\"], \"coverage/\"]\n    )\n\n    print(\"Combining coverage files:\")\n    os.chdir(\"coverage\")\n\n    print(\"Detect coverage file roots:\")\n    # Now detect where the files were collected from:\n\n    paths = [os.path.abspath(os.path.join(os.curdir, \"..\", \"..\"))]\n\n    for filename in os.listdir(\".\"):\n        if not filename.startswith(\"meta.coverage\"):\n            continue\n\n        values = {}\n        exec(open(filename).read(), values)\n        if \"__builtins__\" in values:\n            del values[\"__builtins__\"]\n\n        paths.append(values[\"NUITKA_SOURCE_DIR\"])\n\n    coverage_path = os.path.abspath(\".coveragerc\")\n\n    with open(coverage_path, \"w\") as coverage_rcfile:\n        coverage_rcfile.write(\"[paths]\\n\")\n        coverage_rcfile.write(\"source = \\n\")\n\n        for path in paths:\n            coverage_rcfile.write(\"   \" + path + \"\\n\")\n\n    subprocess.call(\n        [sys.executable, \"-m\", \"coverage\", \"combine\", \"--rcfile\", coverage_path]\n    )\n\n    assert os.path.exists(coverage_path)\n\n    subprocess.call(\n        [sys.executable, \"-m\", \"coverage\", \"html\", \"--rcfile\", coverage_path]\n    )\n\n    # Clean up after ourselves again.\n    # shutil.rmtree(\"coverage\", ignore_errors = True)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-deb-mentors-release.py",
    "content": "#!/usr/bin/python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Debian mentors upload tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.debian_mentors.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-deb-release.py",
    "content": "#!/usr/bin/python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for Debian package release tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.debian.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-pypi-upload.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for PyPI release tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.pypi.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-release.py",
    "content": "#!/usr/bin/python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Release script for manual usage.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nimport shutil\nfrom optparse import OptionParser\n\nfrom nuitka.tools.release.Debian import checkChangeLog\nfrom nuitka.tools.release.Documentation import checkReleaseDocumentation\nfrom nuitka.tools.release.Release import checkAtHome, checkBranchName\nfrom nuitka.Version import getNuitkaVersion\n\nparser = OptionParser()\n\noptions, positional_args = parser.parse_args()\n\nassert not positional_args, positional_args\n\ncheckAtHome()\n\nnuitka_version = getNuitkaVersion()\n\nbranch_name = checkBranchName()\n\n\nif (\n    branch_name.startswith(\"release\")\n    or branch_name == \"main\"\n    or branch_name.startswith(\"hotfix/\")\n):\n    if nuitka_version.count(\".\") == 1:\n        assert checkChangeLog(\"New upstream release.\")\n    else:\n        assert checkChangeLog(\"New upstream hotfix release.\")\n\nelse:\n    assert checkChangeLog(\"New upstream pre-release.\"), branch_name\n\nshutil.rmtree(\"dist\", ignore_errors=True)\nshutil.rmtree(\"build\", ignore_errors=True)\n\ncheckReleaseDocumentation()\nassert os.system(\"%s setup.py sdist --formats=bztar,gztar,zip\" % sys.executable) == 0\n\ncheckAtHome()\n\n# Sign the result files. The Debian binary package was copied here.\nfor filename in os.listdir(\"dist\"):\n    if os.path.isfile(\"dist/\" + filename):\n        assert os.system(\"chmod 644 dist/\" + filename) == 0\n        assert (\n            os.system(\"gpg --local-user 2912B99C --detach-sign dist/\" + filename) == 0\n        )\n\n# Cleanup the build directory, not needed.\nshutil.rmtree(\"build\", ignore_errors=True)\n\nprint(\"Finished.\")\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-upload.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Upload the packaging results and/or push branches.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.Release import checkAtHome, checkBranchName\nfrom nuitka.utils.Execution import check_output\n\ncheckAtHome()\n\nnuitka_version = check_output(\n    \"%s ./bin/nuitka --version\" % sys.executable, shell=True\n).strip()\n\nbranch_name = checkBranchName()\n\nif branch_name == \"factory\":\n    for remote in \"origin\", \"github\":\n        assert (\n            os.system(\n                \"git push --recurse-submodules=no --force-with-lease %s factory\"\n                % remote\n            )\n            == 0\n        ), remote\n\n    sys.exit(0)\n\nassert (\n    os.system(\n        \"rsync -rvlpt --exclude=deb_dist dist/ root@ssh.nuitka.net:/var/www/releases/\"\n    )\n    == 0\n)\n\n# Upload only stable and develop releases to OpenSUSE Build Service:\nif branch_name.startswith(\"release\") or branch_name == \"main\":\n    pass\nelif branch_name == \"develop\":\n    for remote in \"origin\", \"github\":\n        assert (\n            os.system(\n                \"git push --recurse-submodules=no --tags --force-with-lease %s develop\"\n                % remote\n            )\n            == 0\n        )\n        assert os.system(\"git push %s main\" % remote) == 0, remote\nelse:\n    sys.stdout.write(\"Skipping for branch '%s'\" % branch_name)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/make-version-bump.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for version bump release tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.bump.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/nuitka-package-config-schema.json",
    "content": "{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"additionalProperties\": false,\n        \"properties\": {\n            \"module-name\": {\n                \"type\": \"string\",\n                \"pattern\": \"^[A-Za-z0-9\\\\.\\\\_\\\\-]+$\"\n            },\n            \"parameters\": {\n                \"type\": \"array\",\n                \"items\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"properties\": {\n                        \"name\": {\n                            \"type\": \"string\"\n                        },\n                        \"values\": {\n                            \"type\": \"string\"\n                        },\n                        \"default\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"required\": [\n                        \"name\",\n                        \"values\"\n                    ]\n                }\n            },\n            \"constants\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                    \"declarations\": {\n                        \"type\": \"object\",\n                        \"additionalProperties\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            },\n            \"variables\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                    \"setup_code\": {\n                        \"type\": \"string\"\n                    },\n                    \"declarations\": {\n                        \"type\": \"object\",\n                        \"additionalProperties\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            },\n            \"data-files\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                    \"dest_path\": {\n                        \"type\": \"string\"\n                    },\n                    \"dirs\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"patterns\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"empty_dirs\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"empty_dir_structures\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"include-pyi-file\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"yes\",\n                            \"no\"\n                        ]\n                    },\n                    \"include-metadata\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        }\n                    },\n                    \"when\": {\n                        \"type\": \"string\"\n                    }\n                }\n            },\n            \"dlls\": {\n                \"type\": \"array\",\n                \"items\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"properties\": {\n                        \"from_filenames\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": false,\n                            \"properties\": {\n                                \"relative_path\": {\n                                    \"type\": \"string\"\n                                },\n                                \"prefixes\": {\n                                    \"type\": \"array\"\n                                },\n                                \"suffixes\": {\n                                    \"type\": \"array\",\n                                    \"items\": {\n                                        \"type\": \"string\",\n                                        \"pattern\": \"^[^.]\\\\w*$\"\n                                    }\n                                },\n                                \"executable\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"yes\",\n                                        \"no\"\n                                    ]\n                                }\n                            },\n                            \"required\": [\n                                \"prefixes\"\n                            ]\n                        },\n                        \"by_code\": {\n                            \"additionalProperties\": false,\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"setup_code\": {\n                                    \"type\": \"string\"\n                                },\n                                \"filename_code\": {\n                                    \"type\": \"string\"\n                                },\n                                \"executable\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"yes\",\n                                        \"no\"\n                                    ]\n                                }\n                            }\n                        },\n                        \"dest_path\": {\n                            \"type\": \"string\"\n                        },\n                        \"when\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            },\n            \"anti-bloat\": {\n                \"type\": \"array\",\n                \"items\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"properties\": {\n                        \"description\": {\n                            \"type\": \"string\"\n                        },\n                        \"context\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"module_code\": {\n                            \"type\": \"string\"\n                        },\n                        \"replacements_plain\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"replacements_re\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"replacements\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"change_class\": {\n                            \"type\": \"object\"\n                        },\n                        \"change_function\": {\n                            \"type\": \"object\"\n                        },\n                        \"append_result\": {\n                            \"type\": \"string\"\n                        },\n                        \"append_plain\": {\n                            \"type\": \"string\"\n                        },\n                        \"no-follow\": {\n                            \"type\": \"object\"\n                        },\n                        \"no-auto-follow\": {\n                            \"type\": \"object\"\n                        },\n                        \"bloat-mode-overrides\": {\n                            \"type\": \"object\"\n                        },\n                        \"when\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            },\n            \"implicit-imports\": {\n                \"type\": \"array\",\n                \"items\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"properties\": {\n                        \"depends\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"pre-import-code\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"post-import-code\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"when\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            },\n            \"options\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                    \"checks\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": false,\n                            \"properties\": {\n                                \"description\": {\n                                    \"type\": \"string\"\n                                },\n                                \"console\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"yes\",\n                                        \"no\",\n                                        \"recommend\"\n                                    ]\n                                },\n                                \"macos_bundle\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"yes\",\n                                        \"no\",\n                                        \"recommend\"\n                                    ]\n                                },\n                                \"macos_bundle_as_onefile\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"yes\",\n                                        \"no\"\n                                    ]\n                                },\n                                \"support_info\": {\n                                    \"type\": \"string\",\n                                    \"enum\": [\n                                        \"error\",\n                                        \"warning\",\n                                        \"info\",\n                                        \"parameter\",\n                                        \"plugin\"\n                                    ]\n                                },\n                                \"when\": {\n                                    \"type\": \"string\"\n                                }\n                            }\n                        }\n                    }\n                }\n            },\n            \"import-hacks\": {\n                \"type\": \"array\",\n                \"items\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"properties\": {\n                        \"overridden-environment-variables\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"force-environment-variables\": {\n                            \"type\": \"object\",\n                            \"additionalProperties\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"package-paths\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"package-dirs\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"find-dlls-near-module\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"acceptable-missing-dlls\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"global-sys-path\": {\n                            \"type\": \"array\",\n                            \"items\": {\n                                \"type\": \"string\"\n                            }\n                        },\n                        \"package-system-dlls\": {\n                            \"type\": \"string\",\n                            \"enum\": [\n                                \"yes\",\n                                \"no\"\n                            ]\n                        },\n                        \"when\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "misc/nuitka-run.bat",
    "content": "@echo off\r\nrem     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\r\n\n\r\nsetlocal\r\n\r\n\"%~dp0nuitka.bat --run %*\"\r\n\r\nendlocal\r\n\nrem     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\r\nrem     integrates with CPython, but also works on its own.\r\nrem \r\nrem     Licensed under the Apache License, Version 2.0 (the \"License\");\r\nrem     you may not use this file except in compliance with the License.\r\nrem     You may obtain a copy of the License at\r\nrem \r\nrem        http://www.apache.org/licenses/LICENSE-2.0\r\nrem \r\nrem     Unless required by applicable law or agreed to in writing, software\r\nrem     distributed under the License is distributed on an \"AS IS\" BASIS,\r\nrem     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nrem     See the License for the specific language governing permissions and\r\nrem     limitations under the License.\r\n"
  },
  {
    "path": "misc/nuitka.bat",
    "content": "@echo off\r\nrem     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\r\n\n\r\nsetlocal\r\n\r\nif exist \"%~dp0..\\python.exe\" (\r\n\"%~dp0..\\python\" -m nuitka %*\r\n) else if exist \"%~dp0python.exe\" (\r\n\"%~dp0python\" -m nuitka %*\r\n) else (\r\n\"python\" -m nuitka %*\r\n)\r\n\r\nendlocal\r\n\nrem     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\r\nrem     integrates with CPython, but also works on its own.\r\nrem \r\nrem     Licensed under the Apache License, Version 2.0 (the \"License\");\r\nrem     you may not use this file except in compliance with the License.\r\nrem     You may obtain a copy of the License at\r\nrem \r\nrem        http://www.apache.org/licenses/LICENSE-2.0\r\nrem \r\nrem     Unless required by applicable law or agreed to in writing, software\r\nrem     distributed under the License is distributed on an \"AS IS\" BASIS,\r\nrem     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nrem     See the License for the specific language governing permissions and\r\nrem     limitations under the License.\r\n"
  },
  {
    "path": "misc/run-valgrind.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Run code with Nuitka compiled and put that through Valgrind.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0, os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\"))\n)\n\n# isort:start\n\nimport shutil\n\nfrom nuitka.tools.testing.Common import getTempDir\nfrom nuitka.tools.testing.Valgrind import getBinarySizes, runValgrind\n\ninput_file = sys.argv[1]\n\nnuitka_binary = os.getenv(\n    \"NUITKA_BINARY\", os.path.join(os.path.dirname(__file__), \"../bin/nuitka\")\n)\nnuitka_binary = os.path.normpath(nuitka_binary)\n\nbasename = os.path.basename(input_file)\n\ntempdir = getTempDir()\n\noutput_binary = os.path.join(\n    tempdir, (basename[:-3] if input_file.endswith(\".py\") else basename) + \".bin\"\n)\n\nos.environ[\"PYTHONHASHSEED\"] = \"0\"\n\n# To make that python run well despite the \"-S\" flag for things that need site\n# to expand sys.path.\nos.environ[\"PYTHONPATH\"] = os.pathsep.join(sys.path)\n\nos.system(\n    \"%s %s --python-flag=-S --no-progressbar --output-dir=%s %s %s %s %s\"\n    % (\n        sys.executable,\n        nuitka_binary,\n        tempdir,\n        \"--unstriped\",\n        \"--quiet\",\n        os.getenv(\"NUITKA_EXTRA_OPTIONS\", \"\"),\n        input_file,\n    )\n)\n\nif not os.path.exists(output_binary):\n    sys.exit(\"Seeming failure of Nuitka to compile, no %r.\" % output_binary)\n\nlog_base = basename[:-3] if input_file.endswith(\".py\") else basename\n\nif \"number\" in sys.argv or \"numbers\" in sys.argv:\n    log_file = log_base + \".log\"\nelse:\n    log_file = None\n\nlog_file = log_base + \".log\"\n\nsys.stdout.flush()\n\n\nticks = runValgrind(\n    None, \"callgrind\", [output_binary], include_startup=False, save_logfilename=log_file\n)\n\nif \"number\" in sys.argv or \"numbers\" in sys.argv:\n    sizes = getBinarySizes(output_binary)\n\n    print(\"SIZE=%d\" % (sizes[0] + sizes[1]))\n    print(\"TICKS=%s\" % ticks)\n    print(\"BINARY=%s\" % nuitka_binary)\n\n    max_mem = runValgrind(None, \"massif\", [output_binary], include_startup=True)\n\n    print(\"MEM=%s\" % max_mem)\n\n    shutil.rmtree(tempdir)\nelse:\n    os.system(\"kcachegrind 2>/dev/null 1>/dev/null %s &\" % log_file)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "misc/update-doc.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for doc/code sync release tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.sync_doc.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Builtins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-ins module. Information about built-ins of the running Python.\n\n\"\"\"\n\nimport sys\nfrom types import BuiltinFunctionType, FunctionType, GeneratorType, ModuleType\n\nfrom nuitka.__past__ import GenericAlias, builtins\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.PythonVersions import python_version\n\n\ndef _getBuiltinExceptionNames():\n    def isExceptionName(builtin_name):\n        if builtin_name.endswith(\"Error\") or builtin_name.endswith(\"Exception\"):\n            return True\n        elif builtin_name in (\n            \"StopIteration\",\n            \"GeneratorExit\",\n            \"SystemExit\",\n            \"NotImplemented\",\n            \"KeyboardInterrupt\",\n            \"StopAsyncIteration\",\n        ):\n            return True\n        else:\n            return False\n\n    exceptions = OrderedDict()\n\n    # Hide Python3 changes for built-in exception names\n    if python_version < 0x300:\n        import exceptions as builtin_exceptions  # python2 code, pylint: disable=import-error\n\n        for key in sorted(dir(builtin_exceptions)):\n            name = str(key)\n\n            if isExceptionName(name):\n                exceptions[name] = getattr(builtin_exceptions, key)\n\n        for key in sorted(dir(builtins)):\n            name = str(key)\n\n            if isExceptionName(name):\n                exceptions[name] = getattr(builtins, key)\n    else:\n        for key in sorted(dir(builtins)):\n            if isExceptionName(key):\n                exceptions[key] = getattr(builtins, key)\n\n    return list(exceptions.keys()), exceptions\n\n\nbuiltin_exception_names, builtin_exception_values = _getBuiltinExceptionNames()\nbuiltin_exception_values_list = tuple(builtin_exception_values.values())\n\n\n# Just to make sure it's covering these cases correctly.\nassert \"TypeError\" in builtin_exception_names\nassert \"ValueError\" in builtin_exception_names\nassert \"StopIteration\" in builtin_exception_names\nassert \"GeneratorExit\" in builtin_exception_names\nassert \"AssertionError\" in builtin_exception_names\nassert \"BaseException\" in builtin_exception_names\nassert \"Exception\" in builtin_exception_names\nassert \"NotImplemented\" in builtin_exception_names\n\nassert \"StopAsyncIteration\" in builtin_exception_names or python_version < 0x350\n\n\ndef _getBuiltinNames():\n    names = [str(x) for x in dir(builtins)]\n    names.sort()\n\n    for builtin_exception_name in builtin_exception_names:\n        if builtin_exception_name in names:\n            names.remove(builtin_exception_name)\n\n    names.remove(\"__doc__\")\n    names.remove(\"__name__\")\n    names.remove(\"__package__\")\n\n    if \"__loader__\" in names:\n        names.remove(\"__loader__\")\n\n    if \"__spec__\" in names:\n        names.remove(\"__spec__\")\n\n    warnings = []\n\n    for builtin_name in names:\n        if builtin_name.endswith(\"Warning\"):\n            warnings.append(builtin_name)\n\n    for builtin_name in warnings:\n        names.remove(builtin_name)\n\n    return names, warnings\n\n\nbuiltin_names, builtin_warnings = _getBuiltinNames()\nbuiltin_named_values = dict((getattr(builtins, x), x) for x in builtin_names)\nbuiltin_named_values_list = tuple(builtin_named_values)\n\nassert type in builtin_named_values\n\nassert \"__import__\" in builtin_names\nassert \"int\" in builtin_names\nassert \"type\" in builtin_names\n\nassert \"__doc__\" not in builtin_names\nassert \"sys\" not in builtin_names\n\nbuiltin_all_names = builtin_names + builtin_exception_names + builtin_warnings\n\n\ndef getBuiltinTypeNames():\n    result = []\n\n    for builtin_name in builtin_names:\n        if isinstance(getattr(builtins, builtin_name), type):\n            result.append(builtin_name)\n\n    return tuple(sorted(result))\n\n\nbuiltin_type_names = getBuiltinTypeNames()\n\n\ndef _getAnonBuiltins():\n    # We use the order when encoding in the constants blob. Therefore it is imported\n    # to not reorder these values, the C side uses the absolute indexes.\n    anon_names = OrderedDict()\n    anon_codes = OrderedDict()\n\n    # Strangely these are not in Python3 types module\n    anon_names[\"NoneType\"] = type(None)\n    anon_codes[\"NoneType\"] = \"Py_TYPE(Py_None)\"\n\n    anon_names[\"ellipsis\"] = type(Ellipsis)  # see above\n    anon_codes[\"ellipsis\"] = \"&PyEllipsis_Type\"\n\n    anon_names[\"NotImplementedType\"] = type(NotImplemented)\n    anon_codes[\"NotImplementedType\"] = \"Py_TYPE(Py_NotImplemented)\"\n\n    anon_names[\"function\"] = FunctionType\n    anon_codes[\"function\"] = \"&PyFunction_Type\"\n\n    anon_names[\"generator\"] = GeneratorType\n    anon_codes[\"generator\"] = \"&PyGenerator_Type\"\n\n    anon_names[\"builtin_function_or_method\"] = BuiltinFunctionType\n    anon_codes[\"builtin_function_or_method\"] = \"&PyCFunction_Type\"\n\n    # Can't really have it until we have __nuitka__\n    # \"compiled_function\"          : BuiltinFunctionType,\n    # \"compiled_generator\"         : GeneratorType, # see above\n    # anon_codes[\"compiled_function\"] =  \"&Nuitka_Function_Type\"\n    # anon_codes[\"compiled_generator\"] =  \"&Nuitka_Generator_Type\"\n\n    anon_names[\"code\"] = type(_getAnonBuiltins.__code__)\n    anon_codes[\"code\"] = \"&PyCode_Type\"\n\n    anon_names[\"module\"] = ModuleType\n    anon_codes[\"module\"] = \"&PyModule_Type\"\n\n    if python_version < 0x300:\n        # There are only there for Python2,\n        # pylint: disable=I0021,no-name-in-module\n        from types import ClassType, InstanceType, MethodType\n\n        # We can to be sure of the type here, so use open without encoding, pylint: disable=unspecified-encoding\n        with open(sys.executable) as any_file:\n            anon_names[\"file\"] = type(any_file)\n        anon_codes[\"file\"] = \"&PyFile_Type\"\n\n        anon_names[\"classobj\"] = ClassType\n        anon_codes[\"classobj\"] = \"&PyClass_Type\"\n\n        anon_names[\"instance\"] = InstanceType\n        anon_codes[\"instance\"] = \"&PyInstance_Type\"\n\n        anon_names[\"instancemethod\"] = MethodType\n        anon_codes[\"instancemethod\"] = \"&PyMethod_Type\"\n\n    if python_version >= 0x270:\n        anon_names[\"version_info\"] = type(sys.version_info)\n        anon_codes[\"version_info\"] = 'Py_TYPE(Nuitka_SysGetObject(\"version_info\"))'\n\n    if python_version >= 0x390:\n        assert GenericAlias is not None\n\n        anon_names[\"GenericAlias\"] = GenericAlias\n        anon_codes[\"GenericAlias\"] = \"&Py_GenericAliasType\"\n\n    if python_version >= 0x3A0:\n        # 3.10 only code, pylint: disable=I0021,unsupported-binary-operation\n\n        anon_names[\"UnionType\"] = type(int | str)\n        anon_codes[\"UnionType\"] = \"Nuitka_PyUnion_Type\"\n\n    return anon_names, anon_codes\n\n\nbuiltin_anon_names, builtin_anon_codes = _getAnonBuiltins()\nbuiltin_anon_values = OrderedDict((b, a) for a, b in builtin_anon_names.items())\n\n# For being able to check if it's not hashable, we need something not using\n# a hash.\nbuiltin_anon_value_list = tuple(builtin_anon_values)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/BytecodeCaching.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Caching of compiled code.\n\nInitially this deals with preserving compiled module state after bytecode demotion\nsuch that it allows to restore it directly.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.Importing import locateModule, makeModuleUsageAttempt\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import makePath\nfrom nuitka.utils.Hashing import Hash, getStringHash\nfrom nuitka.utils.Json import loadJsonFromFilename, writeJsonToFilename\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.Version import version_string\n\n\ndef getBytecodeCacheDir():\n    return getCacheDir(\"module-cache\")\n\n\ndef _getCacheFilename(module_name, extension):\n    return os.path.join(getBytecodeCacheDir(), \"%s.%s\" % (module_name, extension))\n\n\ndef makeCacheName(module_name, source_code):\n    module_config_hash = _getModuleConfigHash(module_name)\n\n    return (\n        module_name.asString()\n        + \"@\"\n        + module_config_hash\n        + \"@\"\n        + getStringHash(source_code)\n    )\n\n\ndef hasCachedImportedModuleUsageAttempts(module_name, source_code, source_ref):\n    result = getCachedImportedModuleUsageAttempts(\n        module_name=module_name, source_code=source_code, source_ref=source_ref\n    )\n\n    return result is not None\n\n\n# Bump this is format is changed or enhanced implementation might different ones.\n_cache_format_version = 6\n\n\ndef getCachedImportedModuleUsageAttempts(module_name, source_code, source_ref):\n    cache_name = makeCacheName(module_name, source_code)\n    cache_filename = _getCacheFilename(cache_name, \"json\")\n\n    if not os.path.exists(cache_filename):\n        return None\n\n    data = loadJsonFromFilename(cache_filename)\n\n    if data is None:\n        return None\n\n    if data.get(\"file_format_version\") != _cache_format_version:\n        return None\n\n    if data[\"module_name\"] != module_name:\n        return None\n\n    result = OrderedSet()\n\n    for module_used in data[\"modules_used\"]:\n        used_module_name = ModuleName(module_used[\"module_name\"])\n\n        # Retry the module scan to see if it still gives same result\n        if module_used[\"finding\"] == \"relative\":\n            _used_module_name, filename, module_kind, finding = locateModule(\n                module_name=used_module_name.getBasename(),\n                parent_package=used_module_name.getPackageName(),\n                level=1,\n            )\n        else:\n            _used_module_name, filename, module_kind, finding = locateModule(\n                module_name=used_module_name, parent_package=None, level=0\n            )\n\n        if (\n            finding != module_used[\"finding\"]\n            or module_kind != module_used[\"module_kind\"]\n        ):\n            assert module_name != \"email._header_value_parser\", (\n                finding,\n                module_used[\"finding\"],\n            )\n\n            return None\n\n        result.add(\n            makeModuleUsageAttempt(\n                module_name=used_module_name,\n                filename=filename,\n                finding=module_used[\"finding\"],\n                module_kind=module_used[\"module_kind\"],\n                # TODO: Level might have to be dropped.\n                level=0,\n                # We store only the line number, so this cheats it to at full one.\n                source_ref=source_ref.atLineNumber(module_used[\"source_ref_line\"]),\n                reason=module_used[\"reason\"],\n            )\n        )\n\n    for module_used in data[\"distribution_names\"]:\n        # TODO: Consider distributions found and not found and return None if\n        # something changed there.\n        pass\n\n    return result\n\n\ndef writeImportedModulesNamesToCache(\n    module_name, source_code, used_modules, distribution_names\n):\n    cache_name = makeCacheName(module_name, source_code)\n    cache_filename = _getCacheFilename(cache_name, \"json\")\n\n    used_modules = [module.asDict() for module in used_modules]\n    for module in used_modules:\n        module[\"source_ref_line\"] = module[\"source_ref\"].getLineNumber()\n        del module[\"source_ref\"]\n\n    data = {\n        \"file_format_version\": _cache_format_version,\n        \"module_name\": module_name.asString(),\n        # We use a tuple, so preserve the order.\n        \"modules_used\": used_modules,\n        \"distribution_names\": distribution_names,\n    }\n\n    makePath(os.path.dirname(cache_filename))\n    writeJsonToFilename(filename=cache_filename, contents=data)\n\n\ndef _getModuleConfigHash(full_name):\n    \"\"\"Calculate hash value for package packages importable for a module of this name.\"\"\"\n    hash_value = Hash()\n\n    # Plugins may change their influence.\n    hash_value.updateFromValues(*Plugins.getCacheContributionValues(full_name))\n\n    # Take Nuitka and Python version into account as well, ought to catch code changes.\n    hash_value.updateFromValues(version_string, sys.version)\n\n    return hash_value.asHexDigest()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Bytecodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Handle bytecode and compile source code to bytecode. \"\"\"\n\nimport ast\n\nfrom nuitka.Options import hasPythonFlagNoAsserts, hasPythonFlagNoDocStrings\nfrom nuitka.tree.TreeHelpers import getKind\n\ndoc_having = tuple(\n    getattr(ast, candidate)\n    for candidate in (\"FunctionDef\", \"ClassDef\", \"AsyncFunctionDef\")\n    if hasattr(ast, candidate)\n)\n\n\ndef _removeDocFromBody(node):\n    if node.body and getKind(node.body[0]) == \"Expr\":\n        if getKind(node.body[0].value) == \"Str\":  # python3.7 or earlier\n            node.body[0].value.s = \"\"\n        elif getKind(node.body[0].value) == \"Constant\":  # python3.8\n            node.body[0].value.value = \"\"\n\n\ndef compileSourceToBytecode(source_code, filename):\n    \"\"\"Compile given source code into bytecode.\"\"\"\n\n    # Prepare compile call with AST tree.\n    tree = ast.parse(source_code, filename)\n\n    # Do we need to remove doc strings.\n    remove_doc_strings_from_tree = hasPythonFlagNoDocStrings()\n\n    # For Python2, we need to do this manually.\n    remove_asserts_from_tree = hasPythonFlagNoAsserts() and str is bytes\n\n    if remove_doc_strings_from_tree or remove_asserts_from_tree:\n        # Module level docstring.\n        if remove_doc_strings_from_tree:\n            _removeDocFromBody(tree)\n\n        for node in ast.walk(tree):\n            if remove_asserts_from_tree:\n                node_type = type(node)\n\n                if node_type is ast.Name:\n                    if node.id == \"__debug__\":\n                        node.id = \"False\"\n\n                elif node_type is ast.Assert:\n                    # Cannot really remove the assertion node easily, lets just replace it with\n                    # \"assert 1\" and remove the assert msg. Probably not worth more effort for\n                    # Python2 at this time.\n                    node.test = ast.Num()\n                    node.test.n = 1\n                    node.test.lineno = node.lineno\n                    node.test.col_offset = node.col_offset\n                    node.msg = None\n\n            # Check if it's a docstring having node type.\n            if remove_doc_strings_from_tree and isinstance(node, doc_having):\n                _removeDocFromBody(node)\n\n    if str is bytes:\n        bytecode = compile(\n            tree,\n            filename=filename,\n            mode=\"exec\",\n            dont_inherit=True,\n        )\n    else:\n        # Let the handling of __debug__ happen within compile built-in.\n        optimize = 0\n        if hasPythonFlagNoAsserts():\n            optimize = 1\n\n        bytecode = compile(\n            tree, filename=filename, mode=\"exec\", dont_inherit=True, optimize=optimize\n        )\n\n    return bytecode\n\n\ndef loadCodeObjectData(bytecode_filename):\n    \"\"\"Load bytecode from a file.\"\"\"\n\n    # Ignoring magic numbers, etc. which we don't have to care for much as\n    # CPython already checked them (would have rejected it otherwise).\n    with open(bytecode_filename, \"rb\") as f:\n        return f.read()[8 if str is bytes else 16 :]\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/CacheCleanup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Cleanup of caches for Nuitka.\n\nThis is triggered by \"--clean-cache=\" usage, and can cleanup all kinds of\ncaches and is supposed to run before or instead of Nuitka compilation.\n\"\"\"\n\nimport os\n\nfrom nuitka.BytecodeCaching import getBytecodeCacheDir\nfrom nuitka.Tracing import cache_logger\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import removeDirectory\n\n\ndef _cleanCacheDirectory(cache_name, cache_dir):\n    from nuitka.Options import shallCleanCache\n\n    if shallCleanCache(cache_name) and os.path.exists(cache_dir):\n        cache_logger.info(\n            \"Cleaning cache '%s' directory '%s'.\" % (cache_name, cache_dir)\n        )\n        removeDirectory(cache_dir, ignore_errors=False)\n        cache_logger.info(\"Done.\")\n\n\ndef cleanCaches():\n    _cleanCacheDirectory(\"ccache\", getCacheDir(\"ccache\"))\n    _cleanCacheDirectory(\"clcache\", getCacheDir(\"clcache\"))\n    _cleanCacheDirectory(\"bytecode\", getBytecodeCacheDir())\n    _cleanCacheDirectory(\"dll-dependencies\", getCacheDir(\"library_dependencies\"))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Constants.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module for constants in Nuitka.\n\nThis contains tools to compare, classify and test constants.\n\"\"\"\n\nimport math\nimport sys\nfrom types import BuiltinFunctionType\n\nfrom nuitka.Builtins import builtin_type_names\nfrom nuitka.PythonVersions import python_version\n\nfrom .__past__ import GenericAlias, UnionType, iterItems, long, unicode, xrange\nfrom .Builtins import (\n    builtin_anon_names,\n    builtin_anon_value_list,\n    builtin_exception_values_list,\n    builtin_named_values_list,\n)\n\nNoneType = type(None)\n\nEllipsisType = type(Ellipsis)\n\n\ndef compareConstants(a, b):\n    # Many many cases to deal with, pylint: disable=too-many-branches,too-many-return-statements\n\n    # Supposed fast path for comparison.\n    if type(a) is not type(b):\n        return False\n\n    # Now it's either not the same, or it is a container that contains NaN or it\n    # is a complex or float that is NaN, the other cases can use == at the end.\n    if type(a) is complex:\n        return compareConstants(a.imag, b.imag) and compareConstants(a.real, b.real)\n\n    if type(a) is float:\n        # Check sign first, -0.0 is not 0.0, or -nan is not nan, it has a\n        # different sign for a start.\n        if math.copysign(1.0, a) != math.copysign(1.0, b):\n            return False\n\n        if math.isnan(a) and math.isnan(b):\n            return True\n\n        return a == b\n\n    if type(a) in (tuple, list):\n        if len(a) != len(b):\n            return False\n\n        for ea, eb in zip(a, b):\n            if not compareConstants(ea, eb):\n                return False\n        return True\n\n    if type(a) is dict:\n        if len(a) != len(b):\n            return False\n\n        for ea1, ea2 in iterItems(a):\n            for eb1, eb2 in iterItems(b):\n                if compareConstants(ea1, eb1) and compareConstants(ea2, eb2):\n                    break\n            else:\n                return False\n        return True\n\n    if type(a) in (frozenset, set):\n        if len(a) != len(b):\n            return False\n\n        for ea in a:\n            if ea not in b:\n                # Due to NaN values, we need to compare each set element with\n                # all the other set to be really sure.\n                for eb in b:\n                    if compareConstants(ea, eb):\n                        break\n                else:\n                    return False\n        return True\n\n    if type(a) is xrange:\n        return str(a) == str(b)\n\n    # The NaN values of float and complex may let this fail, even if the\n    # constants are built in the same way, therefore above checks.\n    return a == b\n\n\n# These built-in type references are kind of constant too. The list should be\n# complete.\nconstant_builtin_types = (\n    int,\n    str,\n    float,\n    list,\n    tuple,\n    set,\n    dict,\n    slice,\n    complex,\n    xrange,\n    NoneType,\n)\n\nif python_version >= 0x300:\n    constant_builtin_types += (bytes,)\nelse:\n    constant_builtin_types += (\n        unicode,\n        long,\n        # This has no name in Python, but the natural one in C-API.\n        builtin_anon_names[\"instance\"],\n    )\n\n\ndef isConstant(constant):\n    # Too many cases and all return, that is how we do it here,\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    constant_type = type(constant)\n\n    if constant_type is dict:\n        for key, value in iterItems(constant):\n            if not isConstant(key):\n                return False\n            if not isConstant(value):\n                return False\n        return True\n    elif constant_type in (tuple, list):\n        for element_value in constant:\n            if not isConstant(element_value):\n                return False\n        return True\n    elif constant_type is slice:\n        if (\n            not isConstant(constant.start)\n            or not isConstant(constant.stop)\n            or not isConstant(constant.step)\n        ):\n            return False\n\n        return True\n    elif constant_type in (\n        str,\n        unicode,\n        complex,\n        int,\n        long,\n        bool,\n        float,\n        NoneType,\n        range,\n        bytes,\n        set,\n        frozenset,\n        xrange,\n        bytearray,\n        EllipsisType,\n    ):\n        return True\n    elif constant in (NoneType, NotImplemented):\n        return True\n    elif constant in builtin_anon_value_list:\n        return True\n    elif constant_type is type:\n        # Maybe pre-build this as a set for quicker testing.\n        return (\n            constant.__name__ in builtin_type_names\n            or constant in builtin_exception_values_list\n        )\n    elif constant_type is BuiltinFunctionType and constant in builtin_named_values_list:\n        # TODO: Some others could also be usable and even interesting, but\n        # then probably should go into other node types, e.g. str.join is\n        # a candidate.\n        return True\n    elif constant_type is GenericAlias:\n        return True\n    elif constant_type is UnionType:\n        return True\n    elif constant is sys.version_info:\n        return True\n    else:\n        return False\n\n\ndef isMutable(constant):\n    \"\"\"Is a constant mutable\n\n    That means a user of a reference to it, can modify it. Strings are\n    a prime example of immutable, dictionaries are mutable.\n    \"\"\"\n    # Many cases and all return, that is how we do it here,\n    # pylint: disable=too-many-return-statements\n\n    constant_type = type(constant)\n\n    if constant_type in (\n        str,\n        unicode,\n        complex,\n        int,\n        long,\n        bool,\n        float,\n        NoneType,\n        range,\n        bytes,\n        slice,\n        xrange,\n        type,\n        frozenset,\n        BuiltinFunctionType,\n        EllipsisType,\n    ):\n        return False\n    elif constant_type in (dict, list, set, bytearray):\n        return True\n    elif constant_type is tuple:\n        for value in constant:\n            if isMutable(value):\n                return True\n        return False\n    elif constant is NotImplemented:\n        return False\n    elif constant_type is GenericAlias:\n        return isMutable(constant.__origin__) or isMutable(constant.__args__)\n    elif constant_type is UnionType:\n        return False\n    elif constant is sys.version_info:\n        return False\n    else:\n        assert False, repr(constant)\n\n\ndef isHashable(constant):\n    \"\"\"Is a constant hashable\n\n    That means a user of a reference to it, can use it for dicts and set\n    keys. This is distinct from mutable, there is one types that is not\n    mutable, and still not hashable: slices.\n    \"\"\"\n    # Many cases and all return, that is how we do it here,\n\n    constant_type = type(constant)\n\n    if constant_type in (\n        str,\n        unicode,\n        complex,\n        int,\n        long,\n        bool,\n        float,\n        NoneType,\n        xrange,\n        bytes,\n        type,\n        frozenset,\n        BuiltinFunctionType,\n        EllipsisType,\n    ):\n        return True\n    elif constant_type in (dict, list, set, slice, bytearray):\n        return False\n    elif constant_type is tuple:\n        for value in constant:\n            if not isHashable(value):\n                return False\n        return True\n    else:\n        assert False, constant_type\n\n\ndef getUnhashableConstant(constant):\n    \"\"\"Get one unhashable part of a constant.\"\"\"\n\n    constant_type = type(constant)\n\n    if constant_type in (\n        str,\n        unicode,\n        complex,\n        int,\n        long,\n        bool,\n        float,\n        NoneType,\n        xrange,\n        bytes,\n        type,\n        slice,\n        BuiltinFunctionType,\n        EllipsisType,\n    ):\n        return None\n    elif constant_type in (dict, list, set):\n        return constant\n    elif constant_type is tuple:\n        for value in constant:\n            res = getUnhashableConstant(value)\n            if res is not None:\n                return res\n        return None\n    elif constant in constant_builtin_types:\n        return None\n    else:\n        assert False, constant_type\n\n\ndef createConstantDict(keys, values):\n    # Create it proper size immediately.\n    constant_value = dict.fromkeys(keys, None)\n\n    for key, value in zip(keys, values):\n        constant_value[key] = value\n\n    return constant_value\n\n\ndef isCompileTimeConstantValue(value):\n    \"\"\"Determine if a value will be usable at compile time.\"\"\"\n    # This needs to match code in makeCompileTimeConstantReplacementNode\n    if isConstant(value):\n        return True\n    elif type(value) is type:\n        return True\n    else:\n        return False\n\n\n# Shared empty values, it would cost time to create them locally.\nthe_empty_dict = {}\nthe_empty_list = []\nthe_empty_set = set()\nthe_empty_bytearray = bytearray()\n\nthe_empty_tuple = ()\nthe_empty_frozenset = frozenset()\nthe_empty_slice = slice(None)\n\nthe_empty_unicode = unicode()  # black doesn't let us write u\"\" anymore.\n\n\ndef getConstantValueGuide(constant, elements_only):\n    # Many cases and all return, that is how we do it here,\n    # pylint: disable=too-many-return-statements\n    constant_type = type(constant)\n\n    if constant_type in (\n        str,\n        unicode,\n        complex,\n        int,\n        long,\n        bool,\n        float,\n        NoneType,\n        range,\n        bytes,\n        slice,\n        xrange,\n        type,\n        frozenset,\n        BuiltinFunctionType,\n        EllipsisType,\n    ):\n        return \"i\"\n    elif constant_type is list:\n        for element in constant:\n            if isMutable(element):\n                return (\"%s\" if elements_only else \"L%s\") % (\n                    \"\".join(\n                        getConstantValueGuide(element, elements_only=False)\n                        for element in constant\n                    ),\n                )\n\n        return \"l\"\n\n    elif constant_type is tuple:\n        # Empty tuples need no deep copy, not even a copy.\n        if not constant:\n            return \"i\"\n\n        return (\"%s\" if elements_only else \"T%s\") % (\n            \"\".join(\n                getConstantValueGuide(element, elements_only=False)\n                for element in constant\n            ),\n        )\n    elif constant_type is set:\n        return \"S\"\n    elif constant_type is bytearray:\n        return \"B\"\n    elif constant_type is dict:\n        for value in iterItems(constant):\n            if isMutable(value):\n                return \"D\"\n\n        return \"d\"\n    else:\n        return \"?\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Errors.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" For enhanced bug reporting, these exceptions should be used.\n\nThey ideally should point out what it ought to take for reproducing the\nissue when output.\n\n\"\"\"\n\n\nclass NuitkaErrorBase(Exception):\n    pass\n\n\nclass NuitkaNodeError(NuitkaErrorBase):\n    # Try to output more information about nodes passed.\n    def __str__(self):\n        try:\n            from nuitka.code_generation.Indentation import indented\n\n            parts = [\"\"]\n\n            for arg in self.args:  # false alarm, pylint: disable=I0021,not-an-iterable\n                if hasattr(arg, \"asXmlText\"):\n                    parts.append(indented(\"\\n%s\\n\" % arg.asXmlText()))\n                else:\n                    parts.append(str(arg))\n\n            parts.append(\"\")\n            parts.append(\"The above information should be included in a bug report.\")\n\n            return \"\\n\".join(parts)\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            return \"<NuitkaNodeError failed with %r>\" % e\n\n\nclass NuitkaOptimizationError(NuitkaNodeError):\n    pass\n\n\nclass NuitkaAssumptionError(AssertionError):\n    pass\n\n\nclass NuitkaCodeDeficit(NuitkaErrorBase):\n    pass\n\n\nclass NuitkaNodeDesignError(Exception):\n    pass\n\n\nclass NuitkaForbiddenImportEncounter(Exception):\n    \"\"\"This import was an error to attempt and include it.\"\"\"\n\n\nclass CodeTooComplexCode(Exception):\n    \"\"\"The code of the module is too complex.\n\n    It cannot be compiled, with recursive code, and therefore the bytecode\n    should be used instead.\n\n    Example of this is \"idnadata\".\n    \"\"\"\n\n\nclass NuitkaForbiddenDLLEncounter(Exception):\n    \"\"\"This DLL is not allowed to be included.\"\"\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/HardImportRegistry.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Registry for hard import data.\n\nPart of it is static, but modules can get at during scan by plugins that\nknow how to handle these.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.nodes.ConstantRefNodes import ExpressionConstantSysVersionInfoRef\nfrom nuitka.PythonVersions import (\n    getFutureModuleKeys,\n    getImportlibSubPackages,\n    python_version,\n)\nfrom nuitka.utils.Utils import isWin32Windows\n\n# These module are supported in code generation to be imported the hard way.\nhard_modules = set(\n    (\n        \"os\",\n        \"ntpath\",\n        \"posixpath\",\n        # TODO: Add mac path package too\n        \"sys\",\n        \"types\",\n        \"typing\",\n        \"__future__\",\n        \"importlib\",\n        \"importlib.resources\",\n        \"importlib.metadata\",\n        \"_frozen_importlib\",\n        \"_frozen_importlib_external\",\n        \"pkgutil\",\n        \"functools\",\n        \"sysconfig\",\n        \"unittest\",\n        \"unittest.mock\",\n        # \"cStringIO\",\n        \"io\",\n        \"_io\",\n        \"ctypes\",\n        \"ctypes.wintypes\",\n        \"ctypes.macholib\",\n        # TODO: Once generation of nodes for functions exists.\n        # \"platform\",\n        \"builtins\",\n    )\n)\n\nhard_modules_aliases = {\n    \"os.path\": os.path.__name__,\n}\n\n# Lets put here, hard modules that are kind of backports only.\nhard_modules_stdlib = hard_modules\nhard_modules_non_stdlib = set(\n    (\n        \"site\",\n        \"pkg_resources\",\n        \"importlib_metadata\",\n        \"importlib_resources\",\n        \"tensorflow\",\n    )\n)\n\nhard_modules = hard_modules | hard_modules_non_stdlib\n\nhard_modules_version = {\n    \"cStringIO\": (None, 0x300, None),\n    \"typing\": (0x350, None, None),\n    \"_frozen_importlib\": (0x300, None, None),\n    \"_frozen_importlib_external\": (0x350, None, None),\n    \"importlib.resources\": (0x370, None, None),\n    \"importlib.metadata\": (0x380, None, None),\n    \"ctypes.wintypes\": (None, None, \"win32\"),\n    \"builtin\": (0x300, None, None),\n    \"unittest.mock\": (0x300, None, None),\n}\n\nhard_modules_limited = (\"importlib.metadata\", \"ctypes.wintypes\", \"importlib_metadata\")\n\n\n# The modules were added during compile time, no helper code available.\nhard_modules_dynamic = set()\n\n\ndef isHardModule(module_name):\n    if module_name not in hard_modules:\n        return False\n\n    min_version, max_version, os_limit = hard_modules_version.get(\n        module_name, (None, None, None)\n    )\n\n    if min_version is not None and python_version < min_version:\n        return False\n\n    if max_version is not None and python_version >= max_version:\n        return False\n\n    if os_limit is not None:\n        if os_limit == \"win32\":\n            return isWin32Windows()\n\n    return True\n\n\n# These modules can cause issues if imported during compile time.\nhard_modules_trust_with_side_effects = set([\"site\", \"tensorflow\"])\nif not isWin32Windows():\n    # Crashing on anything but Windows.\n    hard_modules_trust_with_side_effects.add(\"ctypes.wintypes\")\n\n\ndef isHardModuleWithoutSideEffect(module_name):\n    return (\n        module_name in hard_modules\n        and module_name not in hard_modules_trust_with_side_effects\n    )\n\n\ntrust_undefined = 0\ntrust_constant = 1\ntrust_exist = 2\ntrust_module = trust_exist\ntrust_future = trust_exist\ntrust_importable = 3\ntrust_node = 4\ntrust_may_exist = 5\ntrust_not_exist = 6\ntrust_node_factory = {}\n\nmodule_importlib_trust = dict(\n    (key, trust_importable) for key in getImportlibSubPackages()\n)\n\nif \"metadata\" not in module_importlib_trust:\n    module_importlib_trust[\"metadata\"] = trust_undefined\nif \"resources\" not in module_importlib_trust:\n    module_importlib_trust[\"resources\"] = trust_undefined\n\nmodule_sys_trust = {\n    \"version\": trust_constant,\n    \"hexversion\": trust_constant,  # spell-checker: ignore hexversion\n    \"platform\": trust_constant,\n    \"maxsize\": trust_constant,\n    \"byteorder\": trust_constant,\n    \"builtin_module_names\": trust_constant,\n    \"stdout\": trust_exist,\n    \"stderr\": trust_exist,\n    \"exit\": trust_node,\n}\n\nif python_version < 0x270:\n    module_sys_trust[\"version_info\"] = trust_constant\nelse:\n    module_sys_trust[\"version_info\"] = trust_node\n    trust_node_factory[(\"sys\", \"version_info\")] = ExpressionConstantSysVersionInfoRef\n\nmodule_builtins_trust = {}\nif python_version >= 0x300:\n    module_builtins_trust[\"open\"] = trust_node\n\nif python_version < 0x300:\n    module_sys_trust[\"exc_type\"] = trust_may_exist\n    module_sys_trust[\"exc_value\"] = trust_may_exist\n    module_sys_trust[\"exc_traceback\"] = trust_may_exist\n\n    module_sys_trust[\"maxint\"] = trust_constant\n    module_sys_trust[\"subversion\"] = trust_constant\nelse:\n    module_sys_trust[\"exc_type\"] = trust_not_exist\n    module_sys_trust[\"exc_value\"] = trust_not_exist\n    module_sys_trust[\"exc_traceback\"] = trust_not_exist\n\nmodule_typing_trust = {\n    \"TYPE_CHECKING\": trust_constant,\n}\n\nmodule_os_trust = {\n    \"name\": trust_constant,\n    \"listdir\": trust_node,\n    \"curdir\": trust_constant,\n    \"pardir\": trust_constant,\n    \"sep\": trust_constant,\n    \"extsep\": trust_constant,\n    \"altsep\": trust_constant,\n    \"pathsep\": trust_constant,\n    \"linesep\": trust_constant,\n}\n\nmodule_os_path_trust = {\n    \"exists\": trust_node,\n    \"isfile\": trust_node,\n    \"isdir\": trust_node,\n    \"basename\": trust_node,\n    \"dirname\": trust_node,\n    \"abspath\": trust_node,\n}\n\n\nmodule_ctypes_trust = {\n    \"CDLL\": trust_node,\n}\n\n# module_platform_trust = {\"python_implementation\": trust_function}\n\nhard_modules_trust = {\n    \"os\": module_os_trust,\n    \"ntpath\": module_os_path_trust if os.path.__name__ == \"ntpath\" else {},\n    \"posixpath\": module_os_path_trust if os.path.__name__ == \"posixpath\" else {},\n    \"sys\": module_sys_trust,\n    #     \"platform\": module_platform_trust,\n    \"types\": {},\n    \"typing\": module_typing_trust,\n    \"__future__\": dict((key, trust_future) for key in getFutureModuleKeys()),\n    \"importlib\": module_importlib_trust,\n    \"importlib.metadata\": {\n        \"version\": trust_node,\n        \"distribution\": trust_node,\n        \"metadata\": trust_node,\n        \"entry_points\": trust_node,\n        \"PackageNotFoundError\": trust_exist,\n    },\n    \"importlib_metadata\": {\n        \"version\": trust_node,\n        \"distribution\": trust_node,\n        \"metadata\": trust_node,\n        \"entry_points\": trust_node,\n        \"PackageNotFoundError\": trust_exist,\n    },\n    \"_frozen_importlib\": {},\n    \"_frozen_importlib_external\": {},\n    \"pkgutil\": {\"get_data\": trust_node},\n    \"functools\": {\"partial\": trust_exist},\n    \"sysconfig\": {},\n    \"unittest\": {\"mock\": trust_module, \"main\": trust_exist},\n    \"unittest.mock\": {},\n    \"io\": {\"BytesIO\": trust_exist, \"StringIO\": trust_exist},\n    \"_io\": {\"BytesIO\": trust_exist, \"StringIO\": trust_exist},\n    # \"cStringIO\": {\"StringIO\": trust_exist},\n    \"pkg_resources\": {\n        \"require\": trust_node,\n        \"get_distribution\": trust_node,\n        \"iter_entry_points\": trust_node,\n        \"resource_string\": trust_node,\n        \"resource_stream\": trust_node,\n    },\n    \"importlib.resources\": {\n        \"read_binary\": trust_node,\n        \"read_text\": trust_node,\n        \"files\": trust_node,\n    },\n    \"importlib_resources\": {\n        \"read_binary\": trust_node,\n        \"read_text\": trust_node,\n        \"files\": trust_node,\n    },\n    \"ctypes\": module_ctypes_trust,\n    \"site\": {},\n    \"ctypes.wintypes\": {},\n    \"ctypes.macholib\": {},\n    \"builtins\": module_builtins_trust,\n    \"tensorflow\": {\"function\": trust_node},\n}\n\n\ndef _addHardImportNodeClasses():\n    from nuitka.nodes.HardImportNodesGenerated import hard_import_node_classes\n\n    for hard_import_node_class, spec in hard_import_node_classes.items():\n        module_name, function_name = spec.name.rsplit(\".\", 1)\n\n        if module_name in hard_modules_aliases:\n            module_name = hard_modules_aliases.get(module_name)\n\n        trust_node_factory[(module_name, function_name)] = hard_import_node_class\n\n        # hard_modules_trust[module_name][function_name] = trust_node\n\n\n_addHardImportNodeClasses()\n\n# Remove this one again, not available on Windows, but the node generation does\n# not know that.\nif isWin32Windows():\n    module_os_trust[\"uname\"] = trust_not_exist\n\n\ndef _checkHardModules():\n    for module_name in hard_modules:\n        assert module_name in hard_modules_trust, module_name\n\n    for module_name, trust in hard_modules_trust.items():\n        assert module_name in hard_modules, module_name\n\n        for attribute_name, trust_value in trust.items():\n            if trust_value is trust_node:\n                assert (\n                    module_name,\n                    attribute_name,\n                ) in trust_node_factory or os.path.basename(sys.argv[0]).startswith(\n                    \"generate-\"\n                ), (\n                    module_name,\n                    attribute_name,\n                )\n\n\n_checkHardModules()\n\n\ndef addModuleTrust(module_name, attribute_name, trust_value):\n    hard_modules_trust[module_name][attribute_name] = trust_value\n\n\ndef addModuleSingleAttributeNodeFactory(module_name, attribute_name, node_class):\n    hard_modules_trust[module_name][attribute_name] = trust_node\n    trust_node_factory[(module_name, attribute_name)] = node_class\n\n\ndef addModuleAttributeFactory(module_name, attribute_name, node_class):\n    trust_node_factory[(module_name, attribute_name)] = node_class\n\n\ndef addModuleDynamicHard(module_name):\n    hard_modules.add(module_name)\n    hard_modules_dynamic.add(module_name)\n    hard_modules_non_stdlib.add(module_name)\n\n    if module_name not in hard_modules_trust:\n        hard_modules_trust[module_name] = {}\n\n\ndef isHardModuleDynamic(module_name):\n    return module_name in hard_modules_dynamic\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/MainControl.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This is the main actions of Nuitka.\n\nThis can do all the steps to translate one module to a target language using\nthe Python C/API, to compile it to either an executable or an extension\nmodule, potentially with bytecode included and used library copied into\na distribution folder.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.build.DataComposerInterface import runDataComposer\nfrom nuitka.build.SconsUtils import (\n    getSconsReportValue,\n    readSconsErrorReport,\n    readSconsReport,\n)\nfrom nuitka.code_generation.ConstantCodes import (\n    addDistributionMetadataValue,\n    getDistributionMetadataValues,\n)\nfrom nuitka.freezer.IncludedDataFiles import (\n    addIncludedDataFilesFromFileOptions,\n    addIncludedDataFilesFromPackageOptions,\n    addIncludedDataFilesFromPlugins,\n    copyDataFiles,\n)\nfrom nuitka.freezer.IncludedEntryPoints import (\n    addExtensionModuleEntryPoint,\n    addIncludedEntryPoints,\n    getStandaloneEntryPoints,\n    setMainEntryPoint,\n)\nfrom nuitka.importing import Importing, Recursion\nfrom nuitka.Options import (\n    getPythonPgoInput,\n    hasPythonFlagIsolated,\n    hasPythonFlagNoAnnotations,\n    hasPythonFlagNoAsserts,\n    hasPythonFlagNoDocStrings,\n    hasPythonFlagNoWarnings,\n    hasPythonFlagUnbuffered,\n    isExperimental,\n)\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PostProcessing import executePostProcessing\nfrom nuitka.Progress import (\n    closeProgressBar,\n    reportProgressBar,\n    setupProgressBar,\n)\nfrom nuitka.PythonFlavors import (\n    isApplePython,\n    isArchPackagePython,\n    isDebianPackagePython,\n    isFedoraPackagePython,\n    isNuitkaPython,\n    isPyenvPython,\n)\nfrom nuitka.PythonVersions import (\n    getModuleLinkerLibs,\n    getPythonABI,\n    getSupportedPythonVersions,\n    python_version,\n    python_version_str,\n)\nfrom nuitka.Serialization import ConstantAccessor\nfrom nuitka.Tracing import general, inclusion_logger\nfrom nuitka.tree import SyntaxErrors\nfrom nuitka.tree.ReformulationMultidist import createMultidistMainSourceCode\nfrom nuitka.utils import InstanceCounters\nfrom nuitka.utils.Distributions import getDistribution\nfrom nuitka.utils.Execution import (\n    callProcess,\n    withEnvironmentVarOverridden,\n    wrapCommandForDebuggerForExec,\n)\nfrom nuitka.utils.FileOperations import (\n    changeFilenameExtension,\n    deleteFile,\n    getExternalUsePath,\n    openTextFile,\n    removeDirectory,\n    resetDirectory,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\nfrom nuitka.utils.MemoryUsage import reportMemoryUsage, showMemoryTrace\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.ReExecute import callExecProcess, reExecuteNuitka\nfrom nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath\nfrom nuitka.utils.Utils import getArchitecture, isMacOS, isWin32Windows\nfrom nuitka.Version import getCommercialVersion, getNuitkaVersion\n\nfrom . import ModuleRegistry, Options, OutputDirectories\nfrom .build.SconsInterface import (\n    asBoolStr,\n    cleanSconsDirectory,\n    runScons,\n    setCommonSconsOptions,\n)\nfrom .code_generation import CodeGeneration, LoaderCodes, Reports\nfrom .finalizations import Finalization\nfrom .freezer.Onefile import getCompressorPython, packDistFolderToOnefile\nfrom .freezer.Standalone import (\n    checkFreezingModuleSet,\n    copyDllsUsed,\n    detectUsedDLLs,\n)\nfrom .optimizations.Optimization import optimizeModules\nfrom .pgo.PGO import readPGOInputFile\nfrom .reports.Reports import writeCompilationReports\nfrom .tree.Building import buildMainModuleTree\nfrom .tree.SourceHandling import writeSourceCode\nfrom .TreeXML import dumpTreeXMLToFile\n\n\ndef _createMainModule():\n    \"\"\"Create a node tree.\n\n    Turn that source code into a node tree structure. If following into\n    imported modules is allowed, more trees will be available during\n    optimization, or even immediately through forcefully included\n    directory paths.\n\n    \"\"\"\n    # Many cases and details to deal with, pylint: disable=too-many-branches,too-many-locals\n\n    Plugins.onBeforeCodeParsing()\n\n    main_filenames = Options.getMainEntryPointFilenames()\n\n    # First, build the raw node tree from the source code.\n    if len(main_filenames) > 1:\n        assert not Options.shallMakeModule()\n\n        main_module = buildMainModuleTree(\n            # TODO: Should not be given.\n            filename=main_filenames[0],\n            source_code=createMultidistMainSourceCode(main_filenames),\n        )\n    else:\n        main_module = buildMainModuleTree(\n            filename=main_filenames[0],\n            source_code=None,\n        )\n\n    OutputDirectories.setMainModule(main_module)\n\n    for distribution_name in Options.getShallIncludeDistributionMetadata():\n        distribution = getDistribution(distribution_name)\n\n        if distribution is None:\n            general.sysexit(\n                \"Error, could not find distribution '%s' for which metadata was asked to be included.\"\n                % distribution_name\n            )\n\n        addDistributionMetadataValue(distribution_name, distribution)\n\n    # First remove old object files and old generated files, old binary or\n    # module, and standalone mode program directory if any, they can only do\n    # harm.\n    source_dir = OutputDirectories.getSourceDirectoryPath()\n\n    if not Options.shallOnlyExecCCompilerCall():\n        cleanSconsDirectory(source_dir)\n\n    # Prepare the \".dist\" directory, throwing away what was there before.\n    if Options.isStandaloneMode():\n        standalone_dir = OutputDirectories.getStandaloneDirectoryPath(bundle=False)\n        resetDirectory(path=standalone_dir, ignore_errors=True)\n\n        if Options.shallCreateAppBundle():\n            resetDirectory(\n                path=changeFilenameExtension(standalone_dir, \".app\"), ignore_errors=True\n            )\n\n    # Delete result file, to avoid confusion with previous build and to\n    # avoid locking issues after the build.\n    deleteFile(\n        path=OutputDirectories.getResultFullpath(onefile=False), must_exist=False\n    )\n    if Options.isOnefileMode():\n        deleteFile(\n            path=OutputDirectories.getResultFullpath(onefile=True), must_exist=False\n        )\n\n        # Also make sure we inform the user in case the compression is not possible.\n        getCompressorPython()\n\n    # Second, do it for the directories given.\n    for plugin_filename in Options.getShallFollowExtra():\n        Recursion.checkPluginPath(plugin_filename=plugin_filename, module_package=None)\n\n    for pattern in Options.getShallFollowExtraFilePatterns():\n        Recursion.checkPluginFilenamePattern(pattern=pattern)\n\n    for package_name in Options.getMustIncludePackages():\n        package_name, package_directory, _module_kind, finding = Importing.locateModule(\n            module_name=ModuleName(package_name),\n            parent_package=None,\n            level=0,\n        )\n\n        if finding != \"absolute\":\n            inclusion_logger.sysexit(\n                \"Error, failed to locate package '%s' you asked to include.\"\n                % package_name\n            )\n\n        Recursion.checkPluginPath(\n            plugin_filename=package_directory,\n            module_package=package_name.getPackageName(),\n        )\n\n    for module_name in Options.getMustIncludeModules():\n        module_name, module_filename, _module_kind, finding = Importing.locateModule(\n            module_name=ModuleName(module_name),\n            parent_package=None,\n            level=0,\n        )\n\n        if finding != \"absolute\":\n            inclusion_logger.sysexit(\n                \"Error, failed to locate module '%s' you asked to include.\"\n                % module_name.asString()\n            )\n\n        Recursion.checkPluginSinglePath(\n            plugin_filename=module_filename,\n            module_package=module_name.getPackageName(),\n            package_only=True,\n        )\n\n    # Allow plugins to add more modules based on the initial set being complete.\n    Plugins.onModuleInitialSet()\n\n    # Then optimize the tree and potentially recursed modules.\n    # TODO: The passed filename is really something that should come from\n    # a command line option, it's a filename for the graph, which might not\n    # need a default at all.\n    optimizeModules(main_module.getOutputFilename())\n\n    # Freezer may have concerns for some modules.\n    if Options.isStandaloneMode():\n        checkFreezingModuleSet()\n\n    # Check if distribution meta data is included, that cannot be used.\n    for distribution_name, (\n        package_name,\n        _metadata,\n        _entry_points,\n    ) in getDistributionMetadataValues():\n        if not ModuleRegistry.hasDoneModule(package_name):\n            inclusion_logger.sysexit(\n                \"Error, including metadata for distribution '%s' without including related package '%s'.\"\n                % (distribution_name, package_name)\n            )\n\n    # Allow plugins to comment on final module set.\n    Plugins.onModuleCompleteSet()\n\n    if Options.isExperimental(\"check_xml_persistence\"):\n        for module in ModuleRegistry.getRootModules():\n            if module.isMainModule():\n                return module\n\n        assert False\n    else:\n        # Main module might change behind our back, look it up again.\n        return main_module\n\n\ndef dumpTreeXML():\n    filename = Options.getXMLDumpOutputFilename()\n\n    if filename is not None:\n        with openTextFile(filename, \"wb\") as output_file:\n            # XML output only.\n            for module in ModuleRegistry.getDoneModules():\n                dumpTreeXMLToFile(tree=module.asXml(), output_file=output_file)\n\n        general.info(\"XML dump of node state written to file '%s'.\" % filename)\n\n\ndef pickSourceFilenames(source_dir, modules):\n    \"\"\"Pick the names for the C files of each module.\n\n    Args:\n        source_dir - the directory to put the module sources will be put into\n        modules    - all the modules to build.\n\n    Returns:\n        Dictionary mapping modules to filenames in source_dir.\n\n    Notes:\n        These filenames can collide, due to e.g. mixed case usage, or there\n        being duplicate copies, e.g. a package named the same as the main\n        binary.\n\n        Conflicts are resolved by appending @<number> with a count in the\n        list of sorted modules. We try to be reproducible here, so we get\n        still good caching for external tools.\n    \"\"\"\n\n    collision_filenames = set()\n\n    def _getModuleFilenames(module):\n        base_filename = os.path.join(source_dir, \"module.\" + module.getFullName())\n\n        # Note: Could detect if the file system is cases sensitive in source_dir\n        # or not, but that's probably not worth the effort. False positives do\n        # no harm at all. We cannot use normcase, as macOS is not using one that\n        # will tell us the truth.\n        collision_filename = base_filename.lower()\n\n        return base_filename, collision_filename\n\n    seen_filenames = set()\n\n    # First pass, check for collisions.\n    for module in modules:\n        if module.isPythonExtensionModule():\n            continue\n\n        _base_filename, collision_filename = _getModuleFilenames(module)\n\n        if collision_filename in seen_filenames:\n            collision_filenames.add(collision_filename)\n\n        seen_filenames.add(collision_filename)\n\n    # Our output.\n    module_filenames = {}\n\n    # Count up for colliding filenames as we go.\n    collision_counts = {}\n\n    # Second pass, this time sorted, so we get deterministic results. We will\n    # apply an \"@1\"/\"@2\",... to disambiguate the filenames.\n    for module in sorted(modules, key=lambda x: x.getFullName()):\n        if module.isPythonExtensionModule():\n            continue\n\n        base_filename, collision_filename = _getModuleFilenames(module)\n\n        if collision_filename in collision_filenames:\n            collision_counts[collision_filename] = (\n                collision_counts.get(collision_filename, 0) + 1\n            )\n            base_filename += \"@%d\" % collision_counts[collision_filename]\n\n        module_filenames[module] = base_filename + \".c\"\n\n    return module_filenames\n\n\ndef makeSourceDirectory():\n    \"\"\"Get the full list of modules imported, create code for all of them.\"\"\"\n    # We deal with a lot of details here, but rather one by one, and split makes\n    # no sense, pylint: disable=too-many-branches\n\n    # assert main_module in ModuleRegistry.getDoneModules()\n\n    # Lets check if the asked modules are actually present, and warn the\n    # user if one of those was not found.\n    for any_case_module in Options.getShallFollowModules():\n        if \"*\" in any_case_module or \"{\" in any_case_module:\n            continue\n\n        if not ModuleRegistry.hasDoneModule(\n            any_case_module\n        ) and not ModuleRegistry.hasRootModule(any_case_module):\n            general.warning(\n                \"Did not follow import to unused '%s', consider include options.\"\n                % any_case_module\n            )\n\n    # Prepare code generation, i.e. execute finalization for it.\n    for module in ModuleRegistry.getDoneModules():\n        if module.isCompiledPythonModule():\n            Finalization.prepareCodeGeneration(module)\n\n    # Do some reporting and determine compiled module to work on\n    compiled_modules = []\n\n    for module in ModuleRegistry.getDoneModules():\n        if module.isCompiledPythonModule():\n            compiled_modules.append(module)\n\n            if Options.isShowInclusion():\n                inclusion_logger.info(\n                    \"Included compiled module '%s'.\" % module.getFullName()\n                )\n        elif module.isPythonExtensionModule():\n            addExtensionModuleEntryPoint(module)\n\n            if Options.isShowInclusion():\n                inclusion_logger.info(\n                    \"Included extension module '%s'.\" % module.getFullName()\n                )\n        elif module.isUncompiledPythonModule():\n            if Options.isShowInclusion():\n                inclusion_logger.info(\n                    \"Included uncompiled module '%s'.\" % module.getFullName()\n                )\n        else:\n            assert False, module\n\n    # Pick filenames.\n    source_dir = OutputDirectories.getSourceDirectoryPath()\n\n    module_filenames = pickSourceFilenames(\n        source_dir=source_dir, modules=compiled_modules\n    )\n\n    setupProgressBar(\n        stage=\"C Source Generation\",\n        unit=\"module\",\n        total=len(compiled_modules),\n    )\n\n    # Generate code for compiled modules, this can be slow, so do it separately\n    # with a progress bar.\n    for module in compiled_modules:\n        c_filename = module_filenames[module]\n\n        reportProgressBar(\n            item=module.getFullName(),\n        )\n\n        source_code = CodeGeneration.generateModuleCode(\n            module=module,\n            data_filename=os.path.basename(c_filename[:-2] + \".const\"),\n        )\n\n        writeSourceCode(filename=c_filename, source_code=source_code)\n\n    closeProgressBar()\n\n    (\n        helper_decl_code,\n        helper_impl_code,\n        constants_header_code,\n        constants_body_code,\n    ) = CodeGeneration.generateHelpersCode()\n\n    writeSourceCode(\n        filename=os.path.join(source_dir, \"__helpers.h\"), source_code=helper_decl_code\n    )\n\n    writeSourceCode(\n        filename=os.path.join(source_dir, \"__helpers.c\"), source_code=helper_impl_code\n    )\n\n    writeSourceCode(\n        filename=os.path.join(source_dir, \"__constants.h\"),\n        source_code=constants_header_code,\n    )\n\n    writeSourceCode(\n        filename=os.path.join(source_dir, \"__constants.c\"),\n        source_code=constants_body_code,\n    )\n\n\ndef _runPgoBinary():\n    pgo_executable = OutputDirectories.getPgoRunExecutable()\n\n    if not os.path.isfile(pgo_executable):\n        general.sysexit(\"Error, failed to produce PGO binary '%s'\" % pgo_executable)\n\n    return callProcess(\n        [getExternalUsePath(pgo_executable)] + Options.getPgoArgs(),\n        shell=False,\n    )\n\n\ndef _wasMsvcMode():\n    if not isWin32Windows():\n        return False\n\n    return (\n        getSconsReportValue(\n            source_dir=OutputDirectories.getSourceDirectoryPath(), key=\"msvc_mode\"\n        )\n        == \"True\"\n    )\n\n\ndef _deleteMsvcPGOFiles(pgo_mode):\n    assert _wasMsvcMode()\n\n    msvc_pgc_filename = OutputDirectories.getResultBasePath(onefile=False) + \"!1.pgc\"\n    deleteFile(msvc_pgc_filename, must_exist=False)\n\n    if pgo_mode == \"use\":\n        msvc_pgd_filename = OutputDirectories.getResultBasePath(onefile=False) + \".pgd\"\n        deleteFile(msvc_pgd_filename, must_exist=False)\n\n    return msvc_pgc_filename\n\n\ndef _runCPgoBinary():\n    # Note: For exit codes, we do not insist on anything yet, maybe we could point it out\n    # or ask people to make scripts that buffer these kinds of errors, and take an error\n    # instead as a serious failure.\n\n    general.info(\n        \"Running created binary to produce C level PGO information:\", style=\"blue\"\n    )\n\n    if _wasMsvcMode():\n        msvc_pgc_filename = _deleteMsvcPGOFiles(pgo_mode=\"generate\")\n\n        with withEnvironmentVarOverridden(\n            \"PATH\",\n            getSconsReportValue(\n                source_dir=OutputDirectories.getSourceDirectoryPath(), key=\"PATH\"\n            ),\n        ):\n            _exit_code = _runPgoBinary()\n\n        pgo_data_collected = os.path.exists(msvc_pgc_filename)\n    else:\n        _exit_code = _runPgoBinary()\n\n        # gcc file suffix, spell-checker: ignore gcda\n        gcc_constants_pgo_filename = os.path.join(\n            OutputDirectories.getSourceDirectoryPath(), \"__constants.gcda\"\n        )\n\n        pgo_data_collected = os.path.exists(gcc_constants_pgo_filename)\n\n    if not pgo_data_collected:\n        general.sysexit(\n            \"Error, no PGO information produced, did the created binary run at all?\"\n        )\n\n    general.info(\"Successfully collected C level PGO information.\", style=\"blue\")\n\n\ndef _runPythonPgoBinary():\n    # Note: For exit codes, we do not insist on anything yet, maybe we could point it out\n    # or ask people to make scripts that buffer these kinds of errors, and take an error\n    # instead as a serious failure.\n\n    pgo_filename = OutputDirectories.getPgoRunInputFilename()\n\n    with withEnvironmentVarOverridden(\"NUITKA_PGO_OUTPUT\", pgo_filename):\n        exit_code = _runPgoBinary()\n\n    if not os.path.exists(pgo_filename):\n        general.sysexit(\n            \"Error, no Python PGO information produced, did the created binary run (exit code %d) as expected?\"\n            % exit_code\n        )\n\n    return pgo_filename\n\n\ndef runSconsBackend():\n    # Scons gets transported many details, that we express as variables, and\n    # have checks for them, leading to many branches and statements,\n    # pylint: disable=too-many-branches,too-many-statements\n\n    options = {\n        \"result_name\": OutputDirectories.getResultBasePath(onefile=False),\n        \"source_dir\": OutputDirectories.getSourceDirectoryPath(),\n        \"nuitka_python\": asBoolStr(isNuitkaPython()),\n        \"debug_mode\": asBoolStr(Options.is_debug),\n        \"debugger_mode\": asBoolStr(Options.shallRunInDebugger()),\n        \"python_debug\": asBoolStr(Options.shallUsePythonDebug()),\n        \"module_mode\": asBoolStr(Options.shallMakeModule()),\n        \"full_compat\": asBoolStr(Options.is_full_compat),\n        \"experimental\": \",\".join(Options.getExperimentalIndications()),\n        \"trace_mode\": asBoolStr(Options.shallTraceExecution()),\n        \"file_reference_mode\": Options.getFileReferenceMode(),\n        \"module_count\": \"%d\" % len(ModuleRegistry.getDoneModules()),\n    }\n\n    if Options.isLowMemory():\n        options[\"low_memory\"] = asBoolStr(True)\n\n    if not Options.shallMakeModule():\n        options[\"result_exe\"] = OutputDirectories.getResultFullpath(onefile=False)\n\n        main_module = ModuleRegistry.getRootTopModule()\n        assert main_module.isMainModule()\n\n        main_module_name = main_module.getFullName()\n        if main_module_name != \"__main__\":\n            options[\"main_module_name\"] = main_module_name\n\n    if Options.shallUseStaticLibPython():\n        options[\"static_libpython\"] = getSystemStaticLibPythonPath()\n\n    if isDebianPackagePython():\n        options[\"debian_python\"] = asBoolStr(True)\n    if isFedoraPackagePython():\n        options[\"fedora_python\"] = asBoolStr(True)\n    if isArchPackagePython():\n        options[\"arch_python\"] = asBoolStr(True)\n    if isApplePython():\n        options[\"apple_python\"] = asBoolStr(True)\n    if isPyenvPython():\n        options[\"pyenv_python\"] = asBoolStr(True)\n\n    if Options.isStandaloneMode():\n        options[\"standalone_mode\"] = asBoolStr(True)\n\n    if Options.isOnefileMode():\n        options[\"onefile_mode\"] = asBoolStr(True)\n\n        if Options.isOnefileTempDirMode():\n            options[\"onefile_temp_mode\"] = asBoolStr(True)\n\n    if Options.shallCreateAppBundle():\n        options[\"macos_bundle_mode\"] = asBoolStr(True)\n\n    if Options.getForcedStdoutPath():\n        options[\"forced_stdout_path\"] = Options.getForcedStdoutPath()\n\n    if Options.getForcedStderrPath():\n        options[\"forced_stderr_path\"] = Options.getForcedStderrPath()\n\n    if Options.shallTreatUninstalledPython():\n        options[\"uninstalled_python\"] = asBoolStr(True)\n\n    if ModuleRegistry.getUncompiledTechnicalModules():\n        options[\"frozen_modules\"] = str(\n            len(ModuleRegistry.getUncompiledTechnicalModules())\n        )\n\n    if Options.isProfile():\n        options[\"profile_mode\"] = asBoolStr(True)\n\n    if hasPythonFlagNoWarnings():\n        options[\"no_python_warnings\"] = asBoolStr(True)\n\n    if hasPythonFlagNoAsserts():\n        options[\"python_sysflag_optimize\"] = str(\n            2 if hasPythonFlagNoDocStrings() else 1\n        )\n\n        options[\"python_flag_no_asserts\"] = asBoolStr(True)\n\n    if hasPythonFlagNoDocStrings():\n        options[\"python_flag_no_docstrings\"] = asBoolStr(True)\n\n    if hasPythonFlagNoAnnotations():\n        options[\"python_flag_no_annotations\"] = asBoolStr(True)\n\n    if python_version < 0x300 and sys.flags.py3k_warning:\n        options[\"python_sysflag_py3k_warning\"] = asBoolStr(True)\n\n    if python_version < 0x300 and (\n        sys.flags.division_warning or sys.flags.py3k_warning\n    ):\n        options[\"python_sysflag_division_warning\"] = asBoolStr(True)\n\n    if sys.flags.bytes_warning:\n        options[\"python_sysflag_bytes_warning\"] = asBoolStr(True)\n\n    if int(os.getenv(\"NUITKA_NOSITE_FLAG\", Options.hasPythonFlagNoSite())):\n        options[\"python_sysflag_no_site\"] = asBoolStr(True)\n\n    if Options.hasPythonFlagTraceImports():\n        options[\"python_sysflag_verbose\"] = asBoolStr(True)\n\n    if Options.hasPythonFlagNoRandomization():\n        options[\"python_sysflag_no_randomization\"] = asBoolStr(True)\n\n    if python_version < 0x300 and sys.flags.unicode:\n        options[\"python_sysflag_unicode\"] = asBoolStr(True)\n\n    if python_version >= 0x370 and sys.flags.utf8_mode:\n        options[\"python_sysflag_utf8\"] = asBoolStr(True)\n\n    if hasPythonFlagUnbuffered():\n        options[\"python_sysflag_unbuffered\"] = asBoolStr(True)\n\n    if hasPythonFlagIsolated():\n        options[\"python_sysflag_isolated\"] = asBoolStr(True)\n\n    abiflags = getPythonABI()\n    if abiflags:\n        options[\"abiflags\"] = abiflags\n\n    if Options.shallMakeModule():\n        options[\"module_suffix\"] = getSharedLibrarySuffix(preferred=True)\n\n    link_module_libs = getModuleLinkerLibs()\n    if link_module_libs:\n        options[\"link_module_libs\"] = \",\".join(link_module_libs)\n\n    env_values = setCommonSconsOptions(options)\n\n    # Allow plugins to build definitions.\n    env_values.update(Plugins.getBuildDefinitions())\n\n    if Options.shallCreatePgoInput():\n        options[\"pgo_mode\"] = \"python\"\n\n        result = runScons(\n            options=options,\n            env_values=env_values,\n            scons_filename=\"Backend.scons\",\n        )\n\n        if not result:\n            return result, options\n\n        # Need to make it usable before executing it.\n        executePostProcessing()\n        _runPythonPgoBinary()\n\n        return True, options\n\n        # Need to restart compilation from scratch here.\n    if Options.isPgoMode():\n        # For C level PGO, we have a 2 pass system. TODO: Make it more global for onefile\n        # and standalone mode proper support, which might need data files to be\n        # there, which currently are not yet there, so it won't run.\n        if Options.isPgoMode():\n            options[\"pgo_mode\"] = \"generate\"\n\n            result = runScons(\n                options=options,\n                env_values=env_values,\n                scons_filename=\"Backend.scons\",\n            )\n\n            if not result:\n                return result, options\n\n            # Need to make it usable before executing it.\n            executePostProcessing()\n            _runCPgoBinary()\n            options[\"pgo_mode\"] = \"use\"\n\n    result = (\n        runScons(\n            options=options,\n            env_values=env_values,\n            scons_filename=\"Backend.scons\",\n        ),\n        options,\n    )\n\n    # Delete PGO files if asked to do that.\n    if options.get(\"pgo_mode\") == \"use\" and _wasMsvcMode():\n        _deleteMsvcPGOFiles(pgo_mode=\"use\")\n\n    return result\n\n\ndef callExecPython(args, add_path):\n    if add_path:\n        if \"PYTHONPATH\" in os.environ:\n            os.environ[\"PYTHONPATH\"] += \":\" + Options.getOutputDir()\n        else:\n            os.environ[\"PYTHONPATH\"] = Options.getOutputDir()\n\n    # Add the main arguments, previous separated.\n    args += Options.getPositionalArgs()[1:] + Options.getMainArgs()\n\n    callExecProcess(args)\n\n\ndef _executeMain(binary_filename):\n    # Wrap in debugger, unless the CMD file contains that call already.\n    if Options.shallRunInDebugger() and not Options.shallCreateCmdFileForExecution():\n        args = wrapCommandForDebuggerForExec(binary_filename)\n    else:\n        args = (binary_filename, binary_filename)\n\n    callExecPython(add_path=False, args=args)\n\n\ndef _executeModule(tree):\n    \"\"\"Execute the extension module just created.\"\"\"\n\n    if python_version < 0x340:\n        python_command_template = \"\"\"\\\nimport os, imp;\\\nassert os.path.normcase(os.path.abspath(os.path.normpath(\\\nimp.find_module('%(module_name)s')[1]))) == %(expected_filename)r,\\\n'Error, cannot launch extension module %(module_name)s, original package is in the way.'\"\"\"\n    else:\n        python_command_template = \"\"\"\\\nimport os, importlib.util;\\\nassert os.path.normcase(os.path.abspath(os.path.normpath(\\\nimportlib.util.find_spec('%(module_name)s').origin))) == %(expected_filename)r,\\\n'Error, cannot launch extension module %(module_name)s, original package is in the way.'\"\"\"\n\n    output_dir = os.path.normpath(Options.getOutputDir())\n    if output_dir != \".\":\n        python_command_template = (\n            \"\"\"\\\nimport sys; sys.path.insert(0, %(output_dir)r)\n\"\"\"\n            + python_command_template\n        )\n\n    python_command_template += \";__import__('%(module_name)s')\"\n\n    python_command = python_command_template % {\n        \"module_name\": tree.getName(),\n        \"expected_filename\": os.path.normcase(\n            os.path.abspath(\n                os.path.normpath(OutputDirectories.getResultFullpath(onefile=False))\n            )\n        ),\n        \"output_dir\": output_dir,\n    }\n\n    if Options.shallRunInDebugger():\n        args = wrapCommandForDebuggerForExec(sys.executable, \"-c\", python_command)\n    else:\n        args = (sys.executable, \"python\", \"-c\", python_command)\n\n    callExecPython(add_path=True, args=args)\n\n\ndef compileTree():\n    source_dir = OutputDirectories.getSourceDirectoryPath()\n\n    general.info(\"Completed Python level compilation and optimization.\")\n\n    if not Options.shallOnlyExecCCompilerCall():\n        general.info(\"Generating source code for C backend compiler.\")\n\n        reportMemoryUsage(\n            \"before_c_code_generation\",\n            (\n                \"Total memory usage before generating C code:\"\n                if Options.isShowProgress() or Options.isShowMemory()\n                else None\n            ),\n        )\n\n        # Now build the target language code for the whole tree.\n        makeSourceDirectory()\n\n        bytecode_accessor = ConstantAccessor(\n            data_filename=\"__bytecode.const\", top_level_name=\"bytecode_data\"\n        )\n\n        # This should take all bytecode values, even ones needed for frozen or\n        # not produce anything.\n        loader_code = LoaderCodes.getMetaPathLoaderBodyCode(bytecode_accessor)\n\n        writeSourceCode(\n            filename=os.path.join(source_dir, \"__loader.c\"), source_code=loader_code\n        )\n\n    else:\n        source_dir = OutputDirectories.getSourceDirectoryPath()\n\n        if not os.path.isfile(os.path.join(source_dir, \"__helpers.h\")):\n            general.sysexit(\"Error, no previous build directory exists.\")\n\n    reportMemoryUsage(\n        \"before_running_scons\",\n        (\n            \"Total memory usage before running scons\"\n            if Options.isShowProgress() or Options.isShowMemory()\n            else None\n        ),\n    )\n\n    if Options.isShowMemory():\n        InstanceCounters.printStats()\n\n    if Options.is_debug:\n        Reports.doMissingOptimizationReport()\n\n    if Options.shallNotDoExecCCompilerCall():\n        return True, {}\n\n    general.info(\"Running data composer tool for optimal constant value handling.\")\n\n    runDataComposer(source_dir)\n\n    Plugins.writeExtraCodeFiles(onefile=False)\n\n    general.info(\"Running C compilation via Scons.\")\n\n    # Run the Scons to build things.\n    result, scons_options = runSconsBackend()\n\n    return result, scons_options\n\n\ndef handleSyntaxError(e):\n    # Syntax or indentation errors, output them to the user and abort. If\n    # we are not in full compat, and user has not specified the Python\n    # versions he wants, tell him about the potential version problem.\n    error_message = SyntaxErrors.formatOutput(e)\n\n    if not Options.is_full_compat:\n        suggested_python_version_str = getSupportedPythonVersions()[-1]\n\n        error_message += \"\"\"\n\nNuitka is very syntax compatible with standard Python. It is currently running\nwith Python version '%s', you might want to specify more clearly with the use\nof the precise Python interpreter binary and '-m nuitka', e.g. use this\n'python%s -m nuitka' option, if that's not the one the program expects.\n\"\"\" % (\n            python_version_str,\n            suggested_python_version_str,\n        )\n\n    # Important to have the same error\n    sys.exit(error_message)\n\n\ndef _main():\n    \"\"\"Main program flow of Nuitka\n\n    At this point, options will be parsed already, Nuitka will be executing\n    in the desired version of Python with desired flags, and we just get\n    to execute the task assigned.\n\n    We might be asked to only re-compile generated C, dump only an XML\n    representation of the internal node tree after optimization, etc.\n    \"\"\"\n\n    # Main has to fulfill many options, leading to many branches and statements\n    # to deal with them.  pylint: disable=too-many-branches,too-many-statements\n\n    # In case we are in a PGO run, we read its information first, so it becomes\n    # available for later parts.\n    pgo_filename = getPythonPgoInput()\n    if pgo_filename is not None:\n        readPGOInputFile(pgo_filename)\n\n    general.info(\n        \"Starting Python compilation with Nuitka %r on Python %r commercial grade %r.\"\n        % (\n            getNuitkaVersion(),\n            python_version_str,\n            getCommercialVersion() or \"not installed\",\n        )\n    )\n\n    reportMemoryUsage(\n        \"after_launch\",\n        (\n            \"Total memory usage before processing:\"\n            if Options.isShowProgress() or Options.isShowMemory()\n            else None\n        ),\n    )\n\n    # Initialize the importing layer from options, main filenames, debugging\n    # options, etc.\n    Importing.setupImportingFromOptions()\n\n    addIncludedDataFilesFromFileOptions()\n    addIncludedDataFilesFromPackageOptions()\n\n    # Turn that source code into a node tree structure.\n    try:\n        main_module = _createMainModule()\n    except (SyntaxError, IndentationError) as e:\n        handleSyntaxError(e)\n\n    addIncludedDataFilesFromPlugins()\n\n    dumpTreeXML()\n\n    # Make the actual compilation.\n    result, scons_options = compileTree()\n\n    # Exit if compilation failed.\n    if not result:\n        general.sysexit(\n            message=\"Failed unexpectedly in Scons C backend compilation.\",\n            mnemonic=\"scons-backend-failure\",\n            reporting=True,\n        )\n\n    # Relaunch in case of Python PGO input to be produced.\n    if Options.shallCreatePgoInput():\n        # Will not return.\n        pgo_filename = OutputDirectories.getPgoRunInputFilename()\n        general.info(\n            \"Restarting compilation using collected information from '%s'.\"\n            % pgo_filename\n        )\n        reExecuteNuitka(pgo_filename=pgo_filename)\n\n    if Options.shallNotDoExecCCompilerCall():\n        if Options.isShowMemory():\n            showMemoryTrace()\n\n        sys.exit(0)\n\n    executePostProcessing()\n\n    if Options.isStandaloneMode():\n        binary_filename = scons_options[\"result_exe\"]\n\n        setMainEntryPoint(binary_filename)\n\n        for module in ModuleRegistry.getDoneModules():\n            addIncludedEntryPoints(Plugins.considerExtraDlls(module))\n\n        detectUsedDLLs(\n            standalone_entry_points=getStandaloneEntryPoints(),\n            source_dir=OutputDirectories.getSourceDirectoryPath(),\n        )\n\n        dist_dir = OutputDirectories.getStandaloneDirectoryPath()\n\n        copyDllsUsed(\n            dist_dir=dist_dir,\n            standalone_entry_points=getStandaloneEntryPoints(),\n        )\n\n    copyDataFiles(standalone_entry_points=getStandaloneEntryPoints())\n\n    if Options.isStandaloneMode():\n\n        Plugins.onStandaloneDistributionFinished(dist_dir)\n\n        if Options.isOnefileMode():\n            packDistFolderToOnefile(dist_dir)\n\n            if Options.isRemoveBuildDir():\n                general.info(\"Removing dist folder '%s'.\" % dist_dir)\n\n                removeDirectory(path=dist_dir, ignore_errors=False)\n            else:\n                general.info(\n                    \"Keeping dist folder '%s' for inspection, no need to use it.\"\n                    % dist_dir\n                )\n\n    # Remove the source directory (now build directory too) if asked to.\n    source_dir = OutputDirectories.getSourceDirectoryPath()\n\n    if Options.isRemoveBuildDir():\n        general.info(\"Removing build directory '%s'.\" % source_dir)\n\n        # Make sure the scons report is cached before deleting it.\n        readSconsReport(source_dir)\n        readSconsErrorReport(source_dir)\n\n        removeDirectory(path=source_dir, ignore_errors=False)\n        assert not os.path.exists(source_dir)\n    else:\n        general.info(\"Keeping build directory '%s'.\" % source_dir)\n\n    final_filename = OutputDirectories.getResultFullpath(\n        onefile=Options.isOnefileMode()\n    )\n\n    if Options.isStandaloneMode() and isMacOS():\n        general.info(\n            \"Created binary that runs on macOS %s (%s) or higher.\"\n            % (scons_options[\"macos_min_version\"], scons_options[\"macos_target_arch\"])\n        )\n\n        if scons_options[\"macos_target_arch\"] != getArchitecture():\n            general.warning(\n                \"It will only work as well as 'arch -%s %s %s' does.\"\n                % (\n                    scons_options[\"macos_target_arch\"],\n                    sys.executable,\n                    Options.getMainEntryPointFilenames()[0],\n                ),\n                mnemonic=\"macos-cross-compile\",\n            )\n\n    Plugins.onFinalResult(final_filename)\n\n    if Options.shallMakeModule():\n        base_path = OutputDirectories.getResultBasePath(onefile=False)\n\n        if os.path.isdir(base_path) and os.path.isfile(\n            os.path.join(base_path, \"__init__.py\")\n        ):\n            general.warning(\n                \"\"\"\\\nThe compilation result is hidden by package directory '%s'. Importing will \\\nnot use compiled code while it exists.\"\"\"\n                % base_path\n            )\n\n    general.info(\"Successfully created '%s'.\" % final_filename)\n\n    writeCompilationReports(aborted=False)\n\n    run_filename = OutputDirectories.getResultRunFilename(\n        onefile=Options.isOnefileMode()\n    )\n\n    # Execute the module immediately if option was given.\n    if Options.shallExecuteImmediately():\n        general.info(\"Launching '%s'.\" % run_filename)\n\n        if Options.shallMakeModule():\n            _executeModule(tree=main_module)\n        else:\n            _executeMain(run_filename)\n    else:\n        if run_filename != final_filename:\n            general.info(\n                \"Execute it by launching '%s', the batch file needs to set environment.\"\n                % run_filename\n            )\n\n\ndef main():\n    try:\n        _main()\n    except BaseException:\n        try:\n            writeCompilationReports(aborted=True)\n        except BaseException as e:  # Catch all the things, pylint: disable=broad-except\n            general.warning(\n                \"\"\"\\\nReport writing was prevented by exception %r, use option \\\n'--experimental=debug-report-traceback' for full traceback.\"\"\"\n                % e\n            )\n\n            if isExperimental(\"debug-report-traceback\"):\n                raise\n\n        raise\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/ModuleRegistry.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This to keep track of used modules.\n\n    There is a set of root modules, which are user specified, and must be\n    processed. As they go, they add more modules to active modules list\n    and move done modules out of it.\n\n    That process can be restarted and modules will be fetched back from\n    the existing set of modules.\n\"\"\"\n\nimport collections\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonVersions import python_version\n\n# One or more root modules, i.e. entry points that must be there.\nroot_modules = OrderedSet()\n\n# To be traversed modules\nactive_modules = OrderedSet()\n\n# Information about why a module became active.\nactive_modules_info = {}\n\nActiveModuleInfo = collections.namedtuple(\n    \"ActiveModuleInfo\", (\"using_module\", \"usage_tag\", \"reason\", \"source_ref\")\n)\n\n# Already traversed modules\ndone_modules = set()\n\n\ndef addRootModule(module):\n    root_modules.add(module)\n\n\ndef getRootModules():\n    return root_modules\n\n\ndef getRootTopModule():\n    top_module = next(iter(root_modules))\n\n    assert top_module.isTopModule(), top_module\n\n    return top_module\n\n\ndef hasRootModule(module_name):\n    for module in root_modules:\n        if module.getFullName() == module_name:\n            return True\n\n    return False\n\n\ndef replaceRootModule(old, new):\n    # Using global here, as this is really a singleton, in the form of a module,\n    # pylint: disable=global-statement\n    global root_modules\n    new_root_modules = OrderedSet()\n\n    for module in root_modules:\n        new_root_modules.add(module if module is not old else new)\n\n    assert len(root_modules) == len(new_root_modules)\n\n    root_modules = new_root_modules\n\n\ndef getUncompiledModules():\n    result = set()\n\n    for module in getDoneModules():\n        if module.isUncompiledPythonModule():\n            result.add(module)\n\n    return tuple(sorted(result, key=lambda module: module.getFullName()))\n\n\ndef getUncompiledTechnicalModules():\n    result = set()\n\n    for module in getDoneModules():\n        if module.isUncompiledPythonModule() and module.isTechnical():\n            result.add(module)\n\n    return tuple(sorted(result, key=lambda module: module.getFullName()))\n\n\ndef getUncompiledNonTechnicalModules():\n    result = set()\n\n    for module in getDoneModules():\n        if module.isUncompiledPythonModule():\n            result.add(module)\n\n    return tuple(sorted(result, key=lambda module: module.getFullName()))\n\n\ndef _normalizeModuleFilename(filename):\n    if python_version >= 0x300:\n        filename = filename.replace(\"__pycache__\", \"\")\n\n        suffix = \".cpython-%d.pyc\" % (python_version // 10)\n\n        if filename.endswith(suffix):\n            filename = filename[: -len(suffix)] + \".py\"\n    else:\n        if filename.endswith(\".pyc\"):\n            filename = filename[:-3] + \".py\"\n\n    if os.path.basename(filename) == \"__init__.py\":\n        filename = os.path.dirname(filename)\n\n    return filename\n\n\ndef startTraversal():\n    # Using global here, as this is really a singleton, in the form of a module,\n    # pylint: disable=global-statement\n    global active_modules, done_modules, active_modules_info\n\n    active_modules = OrderedSet(root_modules)\n\n    active_modules_info = {}\n    for root_module in root_modules:\n        active_modules_info[root_module] = ActiveModuleInfo(\n            using_module=None,\n            usage_tag=\"root_module\",\n            reason=\"Root module\",\n            source_ref=None,\n        )\n    done_modules = set()\n\n    for active_module in active_modules:\n        active_module.startTraversal()\n\n\ndef addUsedModule(module, using_module, usage_tag, reason, source_ref):\n    if module not in done_modules and module not in active_modules:\n        active_modules.add(module)\n\n        active_modules_info[module] = ActiveModuleInfo(\n            using_module=using_module,\n            usage_tag=usage_tag,\n            reason=reason,\n            source_ref=source_ref,\n        )\n\n        module.startTraversal()\n\n\ndef nextModule():\n    if active_modules:\n        result = active_modules.pop()\n        done_modules.add(result)\n\n        return result\n    else:\n        return None\n\n\ndef getRemainingModulesCount():\n    return len(active_modules)\n\n\ndef getDoneModulesCount():\n    return len(done_modules)\n\n\ndef getDoneModules():\n    return sorted(done_modules, key=lambda module: (module.getFullName(), module.kind))\n\n\ndef hasDoneModule(module_name):\n    return any(module.getFullName() == module_name for module in done_modules)\n\n\ndef getModuleInclusionInfoByName(module_name):\n    for module, info in active_modules_info.items():\n        if module.getFullName() == module_name:\n            return info\n\n    return None\n\n\ndef getModuleFromCodeName(code_name):\n    # TODO: We need something to just load modules.\n    for module in root_modules:\n        if module.getCodeName() == code_name:\n            return module\n\n    assert False, code_name\n\n\ndef getOwnerFromCodeName(code_name):\n    if \"$$$\" in code_name:\n        module_code_name, _function_code_name = code_name.split(\"$$$\", 1)\n\n        module = getModuleFromCodeName(module_code_name)\n        return module.getFunctionFromCodeName(code_name)\n    else:\n        return getModuleFromCodeName(code_name)\n\n\ndef getModuleByName(module_name):\n    for module in active_modules:\n        if module.getFullName() == module_name:\n            return module\n\n    for module in done_modules:\n        if module.getFullName() == module_name:\n            return module\n\n    return None\n\n\nmodule_influencing_plugins = {}\n\n\ndef addModuleInfluencingCondition(\n    module_name, plugin_name, condition, control_tags, result\n):\n    if module_name not in module_influencing_plugins:\n        module_influencing_plugins[module_name] = OrderedSet()\n    module_influencing_plugins[module_name].add(\n        (plugin_name, \"condition-used\", (condition, tuple(control_tags), result))\n    )\n\n\ndef addModuleInfluencingVariable(\n    module_name, plugin_name, variable_name, control_tags, result\n):\n    if module_name not in module_influencing_plugins:\n        module_influencing_plugins[module_name] = OrderedSet()\n    module_influencing_plugins[module_name].add(\n        (\n            plugin_name,\n            \"variable-used\",\n            (variable_name, tuple(control_tags), repr(result)),\n        )\n    )\n\n\ndef addModuleInfluencingParameter(\n    module_name, plugin_name, parameter_name, condition_tags_used, result\n):\n    if module_name not in module_influencing_plugins:\n        module_influencing_plugins[module_name] = OrderedSet()\n    module_influencing_plugins[module_name].add(\n        (\n            plugin_name,\n            \"parameter-used\",\n            (parameter_name, tuple(condition_tags_used), result),\n        )\n    )\n\n\ndef addModuleInfluencingDetection(\n    module_name, plugin_name, detection_name, detection_value\n):\n    if module_name not in module_influencing_plugins:\n        module_influencing_plugins[module_name] = OrderedSet()\n    module_influencing_plugins[module_name].add(\n        (plugin_name, \"detection\", (detection_name, detection_value))\n    )\n\n\ndef getModuleInfluences(module_name):\n    return module_influencing_plugins.get(module_name, ())\n\n\n# Information about how long the optimization took.\nmodule_timing_infos = {}\n\nModuleOptimizationTimingInfo = collections.namedtuple(\n    \"ModuleOptimizationTimingInfo\", (\"pass_number\", \"time_used\")\n)\n\n\ndef addModuleOptimizationTimeInformation(module_name, pass_number, time_used):\n    module_timing_info = list(module_timing_infos.get(module_name, []))\n    module_timing_info.append(\n        ModuleOptimizationTimingInfo(pass_number=pass_number, time_used=time_used)\n    )\n    module_timing_infos[module_name] = tuple(module_timing_info)\n\n\ndef getModuleOptimizationTimingInfos(module_name):\n    return module_timing_infos.get(module_name, ())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/OptionParsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Command line options of Nuitka.\n\nThese provide only the optparse options to use, and the mechanic to actually\ndo it, but updating and checking module \"nuitka.Options\" values is not in\nthe scope, to make sure it can be used without.\n\nNote: This is using \"optparse\", because \"argparse\" is only Python 2.7 and\nhigher, and we still support Python 2.6 due to the RHELs still being used,\nand despite the long deprecation, it's in every later release, and actually\npretty good.\n\"\"\"\n\nimport os\nimport re\nimport sys\nfrom string import Formatter\n\nfrom nuitka.PythonFlavors import getPythonFlavorName\nfrom nuitka.utils.CommandLineOptions import SUPPRESS_HELP, makeOptionsParser\nfrom nuitka.utils.FileOperations import getFileContentByLine\nfrom nuitka.utils.Utils import (\n    getArchitecture,\n    getLinuxDistribution,\n    getOS,\n    getWindowsRelease,\n    isLinux,\n    isMacOS,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n    withNoSyntaxWarning,\n)\nfrom nuitka.Version import getCommercialVersion, getNuitkaVersion\n\n# Indicator if we were called as \"nuitka-run\" in which case we assume some\n# other defaults and work a bit different with parameters.\n_nuitka_binary_name = os.path.basename(sys.argv[0])\nif _nuitka_binary_name == \"__main__.py\":\n    _nuitka_binary_name = \"%s -m nuitka\" % os.path.basename(sys.executable)\nis_nuitka_run = _nuitka_binary_name.lower().endswith(\"-run\")\n\nif not is_nuitka_run:\n    usage_template = \"usage: %s [--module] [--run] [options] main_module.py\"\nelse:\n    usage_template = \"usage: %s [options] main_module.py\"\n\n\nparser = makeOptionsParser(usage=usage_template % _nuitka_binary_name)\n\nparser.add_option(\n    \"--version\",\n    dest=\"version\",\n    action=\"store_true\",\n    default=False,\n    require_compiling=False,\n    help=\"\"\"\\\nShow version information and important details for bug reports, then exit. Defaults to off.\"\"\",\n)\n\nparser.add_option(\n    \"--module\",\n    action=\"store_true\",\n    dest=\"module_mode\",\n    default=False,\n    help=\"\"\"\\\nCreate an importable binary extension module executable instead of a program. Defaults to off.\"\"\",\n)\n\nparser.add_option(\n    \"--standalone\",\n    action=\"store_true\",\n    dest=\"is_standalone\",\n    default=False,\n    help=\"\"\"\\\nEnable standalone mode for output. This allows you to transfer the created binary\nto other machines without it using an existing Python installation. This also\nmeans it will become big. It implies these option: \"--follow-imports\" and\n\"--python-flag=no_site\". Defaults to off.\"\"\",\n)\n\nparser.add_option(\n    \"--no-standalone\",\n    action=\"store_false\",\n    dest=\"is_standalone\",\n    default=False,\n    help=SUPPRESS_HELP,\n)\n\n\nparser.add_option(\n    \"--onefile\",\n    action=\"store_true\",\n    dest=\"is_onefile\",\n    default=False,\n    github_action_default=True,\n    help=\"\"\"\\\nOn top of standalone mode, enable onefile mode. This means not a folder,\nbut a compressed executable is created and used. Defaults to off.\"\"\",\n)\n\nparser.add_option(\n    \"--no-onefile\",\n    action=\"store_false\",\n    dest=\"is_onefile\",\n    default=False,\n    help=SUPPRESS_HELP,\n)\n\nparser.add_option(\n    \"--python-flag\",\n    action=\"append\",\n    dest=\"python_flags\",\n    metavar=\"FLAG\",\n    default=[],\n    help=\"\"\"\\\nPython flags to use. Default is what you are using to run Nuitka, this\nenforces a specific mode. These are options that also exist to standard\nPython executable. Currently supported: \"-S\" (alias \"no_site\"),\n\"static_hashes\" (do not use hash randomization), \"no_warnings\" (do not\ngive Python run time warnings), \"-O\" (alias \"no_asserts\"), \"no_docstrings\"\n(do not use doc strings), \"-u\" (alias \"unbuffered\"), \"isolated\" (do not\nload outside code) and \"-m\" (package mode, compile as \"package.__main__\").\nDefault empty.\"\"\",\n)\n\nparser.add_option(\n    \"--python-debug\",\n    action=\"store_true\",\n    dest=\"python_debug\",\n    default=None,\n    help=\"\"\"\\\nUse debug version or not. Default uses what you are using to run Nuitka, most\nlikely a non-debug version. Only for debugging and testing purposes.\"\"\",\n)\n\nparser.add_option(\n    \"--python-for-scons\",\n    action=\"store\",\n    dest=\"python_scons\",\n    metavar=\"PATH\",\n    default=None,\n    github_action=False,\n    help=\"\"\"\\\nWhen compiling with Python 3.4 provide the path of a\nPython binary to use for Scons. Otherwise Nuitka can\nuse what you run Nuitka with, or find Python installation,\ne.g. from Windows registry. On Windows, a Python 3.5 or\nhigher is needed. On non-Windows, a Python 2.6 or 2.7\nwill do as well.\"\"\",\n)\n\nparser.add_option(\n    \"--main\",\n    \"--script-name\",\n    action=\"append\",\n    dest=\"mains\",\n    metavar=\"PATH\",\n    default=[],\n    help=\"\"\"\\\nIf specified once, this takes the place of the\npositional argument, i.e. the filename to compile.\nWhen given multiple times, it enables \"multidist\"\n(see User Manual) it allows you to create binaries\nthat depending on file name or invocation name.\n\"\"\",\n)\n\n# Option for use with GitHub action workflow, where options are read\n# from the environment variable with the input values given there.\nparser.add_option(\n    \"--github-workflow-options\",\n    action=\"store_true\",\n    dest=\"github_workflow_options\",\n    default=False,\n    github_action=False,\n    help=SUPPRESS_HELP,\n)\n\ninclude_group = parser.add_option_group(\n    \"Control the inclusion of modules and packages in result\"\n)\n\ninclude_group.add_option(\n    \"--include-package\",\n    action=\"append\",\n    dest=\"include_packages\",\n    metavar=\"PACKAGE\",\n    default=[],\n    help=\"\"\"\\\nInclude a whole package. Give as a Python namespace, e.g. \"some_package.sub_package\"\nand Nuitka will then find it and include it and all the modules found below that\ndisk location in the binary or extension module it creates, and make it available\nfor import by the code. To avoid unwanted sub packages, e.g. tests you can e.g. do\nthis \"--nofollow-import-to=*.tests\". Default empty.\"\"\",\n)\n\ninclude_group.add_option(\n    \"--include-module\",\n    action=\"append\",\n    dest=\"include_modules\",\n    metavar=\"MODULE\",\n    default=[],\n    help=\"\"\"\\\nInclude a single module. Give as a Python namespace, e.g. \"some_package.some_module\"\nand Nuitka will then find it and include it in the binary or extension module\nit creates, and make it available for import by the code. Default empty.\"\"\",\n)\n\ninclude_group.add_option(\n    \"--include-plugin-directory\",\n    action=\"append\",\n    dest=\"include_extra\",\n    metavar=\"MODULE/PACKAGE\",\n    default=[],\n    help=\"\"\"\\\nInclude also the code found in that directory, considering as if\nthey are each given as a main file. Overrides all other inclusion\noptions. You ought to prefer other inclusion options, that go by\nnames, rather than filenames, those find things through being in\n\"sys.path\". This option is for very special use cases only. Can\nbe given multiple times. Default empty.\"\"\",\n)\n\ninclude_group.add_option(\n    \"--include-plugin-files\",\n    action=\"append\",\n    dest=\"include_extra_files\",\n    metavar=\"PATTERN\",\n    default=[],\n    help=\"\"\"\\\nInclude into files matching the PATTERN. Overrides all other follow options.\nCan be given multiple times. Default empty.\"\"\",\n)\n\ninclude_group.add_option(\n    \"--prefer-source-code\",\n    action=\"store_true\",\n    dest=\"prefer_source_code\",\n    default=None,\n    help=\"\"\"\\\nFor already compiled extension modules, where there is both a source file and an\nextension module, normally the extension module is used, but it should be better\nto compile the module from available source code for best performance. If not\ndesired, there is --no-prefer-source-code to disable warnings about it. Default\noff.\"\"\",\n)\ninclude_group.add_option(\n    \"--no-prefer-source-code\",\n    action=\"store_false\",\n    dest=\"prefer_source_code\",\n    default=None,\n    help=SUPPRESS_HELP,\n)\n\ndel include_group\n\n\nfollow_group = parser.add_option_group(\"Control the following into imported modules\")\n\nfollow_group.add_option(\n    \"--follow-imports\",\n    action=\"store_true\",\n    dest=\"follow_all\",\n    default=None,\n    help=\"\"\"\\\nDescend into all imported modules. Defaults to on in standalone mode, otherwise off.\"\"\",\n)\n\nfollow_group.add_option(\n    \"--follow-import-to\",\n    action=\"append\",\n    dest=\"follow_modules\",\n    metavar=\"MODULE/PACKAGE\",\n    default=[],\n    help=\"\"\"\\\nFollow to that module if used, or if a package, to the whole package. Can be given\nmultiple times. Default empty.\"\"\",\n)\n\nfollow_group.add_option(\n    \"--nofollow-import-to\",\n    action=\"append\",\n    dest=\"follow_not_modules\",\n    metavar=\"MODULE/PACKAGE\",\n    default=[],\n    help=\"\"\"\\\nDo not follow to that module name even if used, or if a package name, to the\nwhole package in any case, overrides all other options. Can be given multiple\ntimes. Default empty.\"\"\",\n)\n\nfollow_group.add_option(\n    \"--nofollow-imports\",\n    action=\"store_false\",\n    dest=\"follow_all\",\n    default=None,\n    help=\"\"\"\\\nDo not descend into any imported modules at all, overrides all other inclusion\noptions and not usable for standalone mode. Defaults to off.\"\"\",\n)\n\nfollow_group.add_option(\n    \"--follow-stdlib\",\n    action=\"store_true\",\n    dest=\"follow_stdlib\",\n    default=False,\n    help=\"\"\"\\\nAlso descend into imported modules from standard library. This will increase\nthe compilation time by a lot and is also not well tested at this time and\nsometimes won't work. Defaults to off.\"\"\",\n)\n\ndel follow_group\n\nonefile_group = parser.add_option_group(\"Onefile options\")\n\nonefile_group.add_option(\n    \"--onefile-tempdir-spec\",\n    action=\"store\",\n    dest=\"onefile_tempdir_spec\",\n    metavar=\"ONEFILE_TEMPDIR_SPEC\",\n    default=None,\n    help=\"\"\"\\\nUse this as a folder to unpack to in onefile mode. Defaults to\n'{TEMP}/onefile_{PID}_{TIME}', i.e. user temporary directory\nand being non-static it's removed. Use e.g. a string like\n'{CACHE_DIR}/{COMPANY}/{PRODUCT}/{VERSION}' which is a good\nstatic cache path, this will then not be removed.\"\"\",\n)\n\nonefile_group.add_option(\n    \"--onefile-child-grace-time\",\n    action=\"store\",\n    dest=\"onefile_child_grace_time\",\n    metavar=\"GRACE_TIME_MS\",\n    default=None,\n    help=\"\"\"\\\nWhen stopping the child, e.g. due to CTRL-C or shutdown, etc. the\nPython code gets a \"KeyboardInterrupt\", that it may handle e.g. to\nflush data. This is the amount of time in ms, before the child it\nkilled in the hard way. Unit is ms, and default 5000.\"\"\",\n)\n\nonefile_group.add_option(\n    \"--onefile-no-compression\",\n    action=\"store_true\",\n    dest=\"onefile_no_compression\",\n    default=False,\n    help=\"\"\"\\\nWhen creating the onefile, disable compression of the payload. This is\nmostly for debug purposes, or to save time. Default is off.\"\"\",\n)\n\nonefile_group.add_option(\n    \"--onefile-as-archive\",\n    action=\"store_true\",\n    dest=\"onefile_as_archive\",\n    default=False,\n    help=\"\"\"\\\nWhen creating the onefile, use an archive format, that can be unpacked\nwith \"nuitka-onefile-unpack\" rather than a stream that only the onefile\nprogram itself unpacks. Default is off.\"\"\",\n)\n\ndel onefile_group\n\ndata_group = parser.add_option_group(\"Data files\")\n\ndata_group.add_option(\n    \"--include-package-data\",\n    action=\"append\",\n    dest=\"package_data\",\n    metavar=\"PACKAGE\",\n    default=[],\n    help=\"\"\"\\\nInclude data files for the given package name. DLLs and extension modules\nare not data files and never included like this. Can use patterns the\nfilenames as indicated below. Data files of packages are not included\nby default, but package configuration can do it.\nThis will only include non-DLL, non-extension modules, i.e. actual data\nfiles. After a \":\" optionally a filename pattern can be given as\nwell, selecting only matching files. Examples:\n\"--include-package-data=package_name\" (all files)\n\"--include-package-data=package_name=*.txt\" (only certain type)\n\"--include-package-data=package_name=some_filename.dat (concrete file)\nDefault empty.\"\"\",\n)\n\ndata_group.add_option(\n    \"--include-data-files\",\n    action=\"append\",\n    dest=\"data_files\",\n    metavar=\"DESC\",\n    default=[],\n    help=\"\"\"\\\nInclude data files by filenames in the distribution. There are many\nallowed forms. With '--include-data-files=/path/to/file/*.txt=folder_name/some.txt' it\nwill copy a single file and complain if it's multiple. With\n'--include-data-files=/path/to/files/*.txt=folder_name/' it will put\nall matching files into that folder. For recursive copy there is a\nform with 3 values that '--include-data-files=/path/to/scan=folder_name=**/*.txt'\nthat will preserve directory structure. Default empty.\"\"\",\n)\n\ndata_group.add_option(\n    \"--include-data-dir\",\n    action=\"append\",\n    dest=\"data_dirs\",\n    metavar=\"DIRECTORY\",\n    default=[],\n    help=\"\"\"\\\nInclude data files from complete directory in the distribution. This is\nrecursive. Check '--include-data-files' with patterns if you want non-recursive\ninclusion. An example would be '--include-data-dir=/path/some_dir=data/some_dir'\nfor plain copy, of the whole directory. All non-code files are copied, if you\nwant to use '--noinclude-data-files' option to remove them. Default empty.\"\"\",\n)\n\ndata_group.add_option(\n    \"--noinclude-data-files\",\n    action=\"append\",\n    dest=\"data_files_inhibited\",\n    metavar=\"PATTERN\",\n    default=[],\n    help=\"\"\"\\\nDo not include data files matching the filename pattern given. This is against\nthe target filename, not source paths. So to ignore a file pattern from package\ndata for 'package_name' should be matched as 'package_name/*.txt'. Or for the\nwhole directory simply use 'package_name'. Default empty.\"\"\",\n)\n\ndata_group.add_option(\n    \"--include-onefile-external-data\",\n    action=\"append\",\n    dest=\"data_files_external\",\n    metavar=\"PATTERN\",\n    default=[],\n    help=\"\"\"\\\nInclude the specified data file patterns outside of the onefile binary,\nrather than on the inside. Makes only sense in case of '--onefile'\ncompilation. First files have to be specified as included somehow,\nthen this refers to target paths. Default empty.\"\"\",\n)\n\ndata_group.add_option(\n    \"--list-package-data\",\n    action=\"store\",\n    dest=\"list_package_data\",\n    default=\"\",\n    require_compiling=False,\n    help=\"\"\"\\\nOutput the data files found for a given package name. Default not done.\"\"\",\n)\n\n\ndel data_group\n\nmetadata_group = parser.add_option_group(\"Metadata support\")\n\nmetadata_group.add_option(\n    \"--include-distribution-metadata\",\n    action=\"append\",\n    dest=\"include_distribution_metadata\",\n    metavar=\"DISTRIBUTION\",\n    default=[],\n    help=\"\"\"\\\nInclude metadata information for the given distribution name. Some packages\ncheck metadata for presence, version, entry points, etc. and without this\noption given, it only works when it's recognized at compile time which is\nnot always happening. This of course only makes sense for packages that are\nincluded in the compilation. Default empty.\"\"\",\n)\n\ndel metadata_group\n\ndll_group = parser.add_option_group(\"DLL files\")\n\ndll_group.add_option(\n    \"--noinclude-dlls\",\n    action=\"append\",\n    dest=\"dll_files_inhibited\",\n    metavar=\"PATTERN\",\n    default=[],\n    help=\"\"\"\\\nDo not include DLL files matching the filename pattern given. This is against\nthe target filename, not source paths. So ignore a DLL 'someDLL' contained in\nthe package 'package_name' it should be matched as 'package_name/someDLL.*'.\nDefault empty.\"\"\",\n)\n\n\ndll_group.add_option(\n    \"--list-package-dlls\",\n    action=\"store\",\n    dest=\"list_package_dlls\",\n    default=\"\",\n    require_compiling=False,\n    help=\"\"\"\\\nOutput the DLLs found for a given package name. Default not done.\"\"\",\n)\n\ndel dll_group\n\nwarnings_group = parser.add_option_group(\"Control the warnings to be given by Nuitka\")\n\n\nwarnings_group.add_option(\n    \"--warn-implicit-exceptions\",\n    action=\"store_true\",\n    dest=\"warn_implicit_exceptions\",\n    default=False,\n    help=\"\"\"\\\nEnable warnings for implicit exceptions detected at compile time.\"\"\",\n)\n\nwarnings_group.add_option(\n    \"--warn-unusual-code\",\n    action=\"store_true\",\n    dest=\"warn_unusual_code\",\n    default=False,\n    help=\"\"\"\\\nEnable warnings for unusual code detected at compile time.\"\"\",\n)\n\nwarnings_group.add_option(\n    \"--assume-yes-for-downloads\",\n    action=\"store_true\",\n    dest=\"assume_yes_for_downloads\",\n    default=False,\n    github_action_default=True,\n    help=\"\"\"\\\nAllow Nuitka to download external code if necessary, e.g. dependency\nwalker, ccache, and even gcc on Windows. To disable, redirect input\nfrom nul device, e.g. \"</dev/null\" or \"<NUL:\". Default is to prompt.\"\"\",\n)\n\n\nwarnings_group.add_option(\n    \"--nowarn-mnemonic\",\n    action=\"append\",\n    dest=\"nowarn_mnemonics\",\n    metavar=\"MNEMONIC\",\n    default=[],\n    help=\"\"\"\\\nDisable warning for a given mnemonic. These are given to make sure you are aware of\ncertain topics, and typically point to the Nuitka website. The mnemonic is the part\nof the URL at the end, without the HTML suffix. Can be given multiple times and\naccepts shell pattern. Default empty.\"\"\",\n)\n\ndel warnings_group\n\n\nexecute_group = parser.add_option_group(\"Immediate execution after compilation\")\n\nexecute_group.add_option(\n    \"--run\",\n    action=\"store_true\",\n    dest=\"immediate_execution\",\n    default=is_nuitka_run,\n    help=\"\"\"\\\nExecute immediately the created binary (or import the compiled module).\nDefaults to %s.\"\"\"\n    % (\"on\" if is_nuitka_run else \"off\"),\n)\n\nexecute_group.add_option(\n    \"--debugger\",\n    \"--gdb\",\n    action=\"store_true\",\n    dest=\"debugger\",\n    default=False,\n    help=\"\"\"\\\nExecute inside a debugger, e.g. \"gdb\" or \"lldb\" to automatically get a stack trace.\nDefaults to off.\"\"\",\n)\n\ndel execute_group\n\n\ncompilation_group = parser.add_option_group(\"Compilation choices\")\n\ncompilation_group.add_option(\n    \"--user-package-configuration-file\",\n    action=\"append\",\n    dest=\"user_yaml_files\",\n    default=[],\n    metavar=\"YAML_FILENAME\",\n    help=\"\"\"\\\nUser provided Yaml file with package configuration. You can include DLLs,\nremove bloat, add hidden dependencies. Check the Nuitka Package Configuration\nManual for a complete description of the format to use. Can be given\nmultiple times. Defaults to empty.\"\"\",\n)\n\ncompilation_group.add_option(\n    \"--full-compat\",\n    action=\"store_false\",\n    dest=\"improved\",\n    default=True,\n    help=\"\"\"\\\nEnforce absolute compatibility with CPython. Do not even allow minor\ndeviations from CPython behavior, e.g. not having better tracebacks\nor exception messages which are not really incompatible, but only\ndifferent or worse. This is intended for tests only and should *not*\nbe used.\"\"\",\n)\n\ncompilation_group.add_option(\n    \"--file-reference-choice\",\n    action=\"store\",\n    dest=\"file_reference_mode\",\n    metavar=\"MODE\",\n    choices=(\"original\", \"runtime\", \"frozen\"),\n    default=None,\n    help=\"\"\"\\\nSelect what value \"__file__\" is going to be. With \"runtime\" (default for\nstandalone binary mode and module mode), the created binaries and modules,\nuse the location of themselves to deduct the value of \"__file__\". Included\npackages pretend to be in directories below that location. This allows you\nto include data files in deployments. If you merely seek acceleration, it's\nbetter for you to use the \"original\" value, where the source files location\nwill be used. With \"frozen\" a notation \"<frozen module_name>\" is used. For\ncompatibility reasons, the \"__file__\" value will always have \".py\" suffix\nindependent of what it really is.\"\"\",\n)\n\ncompilation_group.add_option(\n    \"--module-name-choice\",\n    action=\"store\",\n    dest=\"module_name_mode\",\n    metavar=\"MODE\",\n    choices=(\"original\", \"runtime\"),\n    default=None,\n    help=\"\"\"\\\nSelect what value \"__name__\" and \"__package__\" are going to be. With \"runtime\"\n(default for module mode), the created module uses the parent package to\ndeduce the value of \"__package__\", to be fully compatible. The value \"original\"\n(default for other modes) allows for more static optimization to happen, but\nis incompatible for modules that normally can be loaded into any package.\"\"\",\n)\n\n\ndel compilation_group\n\noutput_group = parser.add_option_group(\"Output choices\")\n\noutput_group.add_option(\n    \"--output-filename\",\n    \"-o\",\n    action=\"store\",\n    dest=\"output_filename\",\n    metavar=\"FILENAME\",\n    default=None,\n    help=\"\"\"\\\nSpecify how the executable should be named. For extension modules there is no\nchoice, also not for standalone mode and using it will be an error. This may\ninclude path information that needs to exist though. Defaults to '%s' on this\nplatform.\n\"\"\"\n    % (\"<program_name>\" + (\".exe\" if isWin32OrPosixWindows() else \".bin\")),\n)\n\noutput_group.add_option(\n    \"--output-dir\",\n    action=\"store\",\n    dest=\"output_dir\",\n    metavar=\"DIRECTORY\",\n    default=\"\",\n    help=\"\"\"\\\nSpecify where intermediate and final output files should be put. The DIRECTORY\nwill be populated with build folder, dist folder, binaries, etc.\nDefaults to current directory.\n\"\"\",\n)\n\noutput_group.add_option(\n    \"--remove-output\",\n    action=\"store_true\",\n    dest=\"remove_build\",\n    default=False,\n    help=\"\"\"\\\nRemoves the build directory after producing the module or exe file.\nDefaults to off.\"\"\",\n)\n\noutput_group.add_option(\n    \"--no-pyi-file\",\n    action=\"store_false\",\n    dest=\"pyi_file\",\n    default=True,\n    help=\"\"\"\\\nDo not create a '.pyi' file for extension modules created by Nuitka. This is\nused to detect implicit imports.\nDefaults to off.\"\"\",\n)\n\ndel output_group\n\ndeployment_group = parser.add_option_group(\"Deployment control\")\n\ndeployment_group.add_option(\n    \"--deployment\",\n    action=\"store_true\",\n    dest=\"is_deployment\",\n    default=False,\n    help=\"\"\"\\\nDisable code aimed at making finding compatibility issues easier. This\nwill e.g. prevent execution with \"-c\" argument, which is often used by\ncode that attempts run a module, and causes a program to start itself\nover and over potentially. Disable once you deploy to end users, for\nfinding typical issues, this is very helpful during development. Default\noff.\"\"\",\n)\n\ndeployment_group.add_option(\n    \"--no-deployment-flag\",\n    action=\"append\",\n    dest=\"no_deployment_flags\",\n    metavar=\"FLAG\",\n    default=[],\n    help=\"\"\"\\\nKeep deployment mode, but disable selectively parts of it. Errors from\ndeployment mode will output these identifiers. Default empty.\"\"\",\n)\n\nenvironment_group = parser.add_option_group(\"Environment control\")\n\nenvironment_group.add_option(\n    \"--force-runtime-environment-variable\",\n    action=\"append\",\n    dest=\"forced_runtime_env_variables\",\n    metavar=\"VARIABLE_SPEC\",\n    default=[],\n    help=\"\"\"\\\nForce an environment variables to a given value. Default empty.\"\"\",\n)\n\ndel environment_group\n\ndebug_group = parser.add_option_group(\"Debug features\")\n\ndebug_group.add_option(\n    \"--debug\",\n    action=\"store_true\",\n    dest=\"debug\",\n    default=False,\n    help=\"\"\"\\\nExecuting all self checks possible to find errors in Nuitka, do not use for\nproduction. Defaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--unstripped\",\n    \"--unstriped\",\n    action=\"store_true\",\n    dest=\"unstripped\",\n    default=False,\n    help=\"\"\"\\\nKeep debug info in the resulting object file for better debugger interaction.\nDefaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--profile\",\n    action=\"store_true\",\n    dest=\"profile\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nEnable vmprof based profiling of time spent. Not working currently. Defaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--internal-graph\",\n    action=\"store_true\",\n    dest=\"internal_graph\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nCreate graph of optimization process internals, do not use for whole programs, but only\nfor small test cases. Defaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--trace-execution\",\n    action=\"store_true\",\n    dest=\"trace_execution\",\n    default=False,\n    help=\"\"\"\\\nTraced execution output, output the line of code before executing it.\nDefaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--recompile-c-only\",\n    action=\"store_true\",\n    dest=\"recompile_c_only\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nThis is not incremental compilation, but for Nuitka development only. Takes\nexisting files and simply compile them as C again. Allows compiling edited\nC files for quick debugging changes to the generated source, e.g. to see if\ncode is passed by, values output, etc, Defaults to off. Depends on compiling\nPython source to determine which files it should look at.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--xml\",\n    action=\"store\",\n    dest=\"xml_output\",\n    metavar=\"XML_FILENAME\",\n    default=None,\n    help=\"Write the internal program structure, result of optimization in XML form to given filename.\",\n)\n\ndebug_group.add_option(\n    \"--experimental\",\n    action=\"append\",\n    dest=\"experimental\",\n    metavar=\"FLAG\",\n    default=[],\n    help=\"\"\"\\\nUse features declared as 'experimental'. May have no effect if no experimental\nfeatures are present in the code. Uses secret tags (check source) per\nexperimented feature.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--explain-imports\",\n    action=\"store_true\",\n    dest=\"explain_imports\",\n    default=False,\n    help=SUPPRESS_HELP,\n)\n\ndebug_group.add_option(\n    \"--low-memory\",\n    action=\"store_true\",\n    dest=\"low_memory\",\n    default=False,\n    help=\"\"\"\\\nAttempt to use less memory, by forking less C compilation jobs and using\noptions that use less memory. For use on embedded machines. Use this in\ncase of out of memory problems. Defaults to off.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--create-environment-from-report\",\n    action=\"store\",\n    dest=\"create_environment_from_report\",\n    default=\"\",\n    require_compiling=False,\n    help=\"\"\"\\\nCreate a new virtualenv in that non-existing path from the report file given with\ne.g. '--report=compilation-report.xml'. Default not done.\"\"\",\n)\n\ndebug_group.add_option(\n    \"--generate-c-only\",\n    action=\"store_true\",\n    dest=\"generate_c_only\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nGenerate only C source code, and do not compile it to binary or module. This\nis for debugging and code coverage analysis that doesn't waste CPU. Defaults to\noff. Do not think you can use this directly.\"\"\",\n)\n\n\ndel debug_group\n\n# This is for testing framework, \"coverage.py\" hates to loose the process. And\n# we can use it to make sure it's not done unknowingly.\nparser.add_option(\n    \"--must-not-re-execute\",\n    action=\"store_false\",\n    dest=\"allow_reexecute\",\n    default=True,\n    github_action=False,\n    help=SUPPRESS_HELP,\n)\n\n# Not sure where to put this yet, intended to helps me edit code faster, will\n# make it public if it becomes useful.\nparser.add_option(\n    \"--edit-module-code\",\n    action=\"store\",\n    dest=\"edit_module_code\",\n    default=None,\n    require_compiling=False,\n    help=SUPPRESS_HELP,\n)\n\n\nc_compiler_group = parser.add_option_group(\"Backend C compiler choice\")\n\nc_compiler_group.add_option(\n    \"--clang\",\n    action=\"store_true\",\n    dest=\"clang\",\n    default=False,\n    help=\"\"\"\\\nEnforce the use of clang. On Windows this requires a working Visual\nStudio version to piggy back on. Defaults to off.\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--mingw64\",\n    action=\"store_true\",\n    dest=\"mingw64\",\n    default=False,\n    help=\"\"\"\\\nEnforce the use of MinGW64 on Windows. Defaults to off unless MSYS2 with MinGW Python is used.\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--msvc\",\n    action=\"store\",\n    dest=\"msvc_version\",\n    default=None,\n    help=\"\"\"\\\nEnforce the use of specific MSVC version on Windows. Allowed values\nare e.g. \"14.3\" (MSVC 2022) and other MSVC version numbers, specify\n\"list\" for a list of installed compilers, or use \"latest\".\n\nDefaults to latest MSVC being used if installed, otherwise MinGW64\nis used.\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--jobs\",\n    \"-j\",\n    action=\"store\",\n    dest=\"jobs\",\n    metavar=\"N\",\n    default=None,\n    help=\"\"\"\\\nSpecify the allowed number of parallel C compiler jobs. Defaults to the\nsystem CPU count.\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--lto\",\n    action=\"store\",\n    dest=\"lto\",\n    metavar=\"choice\",\n    default=\"auto\",\n    choices=(\"yes\", \"no\", \"auto\"),\n    help=\"\"\"\\\nUse link time optimizations (MSVC, gcc, clang). Allowed values are\n\"yes\", \"no\", and \"auto\" (when it's known to work). Defaults to\n\"auto\".\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--static-libpython\",\n    action=\"store\",\n    dest=\"static_libpython\",\n    metavar=\"choice\",\n    default=\"auto\",\n    choices=(\"yes\", \"no\", \"auto\"),\n    help=\"\"\"\\\nUse static link library of Python. Allowed values are \"yes\", \"no\",\nand \"auto\" (when it's known to work). Defaults to \"auto\".\"\"\",\n)\n\nc_compiler_group.add_option(\n    \"--cf-protection\",\n    action=\"store\",\n    dest=\"cf_protection\",\n    metavar=\"PROTECTION_MODE\",\n    default=\"auto\",\n    choices=(\"auto\", \"full\", \"branch\", \"return\", \"none\", \"check\"),\n    help=\"\"\"\\\nThis option is gcc specific. For the gcc compiler, select the\n\"cf-protection\" mode. Default \"auto\" is to use the gcc default\nvalue, but you can override it, e.g. to disable it with \"none\"\nvalue. Refer to gcc documentation for \"-fcf-protection\" for the\ndetails.\"\"\",\n)\n\ndel c_compiler_group\n\ncaching_group = parser.add_option_group(\"Cache Control\")\n\n_cache_names = (\"all\", \"ccache\", \"bytecode\", \"compression\")\n\nif isWin32Windows():\n    _cache_names += (\"dll-dependencies\",)\n\ncaching_group.add_option(\n    \"--disable-cache\",\n    action=\"append\",\n    dest=\"disabled_caches\",\n    choices=_cache_names,\n    default=[],\n    help=\"\"\"\\\nDisable selected caches, specify \"all\" for all cached. Currently allowed\nvalues are: %s. can be given multiple times or with comma separated values.\nDefault none.\"\"\"\n    % (\",\".join('\"%s\"' % cache_name for cache_name in _cache_names)),\n)\n\ncaching_group.add_option(\n    \"--clean-cache\",\n    action=\"append\",\n    dest=\"clean_caches\",\n    choices=_cache_names,\n    default=[],\n    require_compiling=False,\n    help=\"\"\"\\\nClean the given caches before executing, specify \"all\" for all cached. Currently\nallowed values are: %s. can be given multiple times or with comma separated\nvalues. Default none.\"\"\"\n    % (\",\".join('\"%s\"' % cache_name for cache_name in _cache_names)),\n)\n\ncaching_group.add_option(\n    \"--disable-bytecode-cache\",\n    action=\"store_true\",\n    dest=\"disable_bytecode_cache\",\n    default=False,\n    help=\"\"\"\\\nDo not reuse dependency analysis results for modules, esp. from standard library,\nthat are included as bytecode. Same as --disable-cache=bytecode.\"\"\",\n)\n\ncaching_group.add_option(\n    \"--disable-ccache\",\n    action=\"store_true\",\n    dest=\"disable_ccache\",\n    default=False,\n    help=\"\"\"\\\nDo not attempt to use ccache (gcc, clang, etc.) or clcache (MSVC, clangcl).\nSame as --disable-cache=ccache.\"\"\",\n)\n\nif isWin32Windows():\n    caching_group.add_option(\n        \"--disable-dll-dependency-cache\",\n        action=\"store_true\",\n        dest=\"disable_dll_dependency_cache\",\n        default=False,\n        help=\"\"\"\\\nDisable the dependency walker cache. Will result in much longer times to create\nthe distribution folder, but might be used in case the cache is suspect to cause\nerrors. Same as --disable-cache=dll-dependencies.\"\"\",\n    )\n\n    caching_group.add_option(\n        \"--force-dll-dependency-cache-update\",\n        action=\"store_true\",\n        dest=\"update_dependency_cache\",\n        default=False,\n        help=\"\"\"\\\nFor an update of the dependency walker cache. Will result in much longer times\nto create the distribution folder, but might be used in case the cache is suspect\nto cause errors or known to need an update.\n\"\"\",\n    )\n\n\ndel caching_group\n\npgo_group = parser.add_option_group(\"PGO compilation choices\")\n\npgo_group.add_option(\n    \"--pgo\",\n    action=\"store_true\",\n    dest=\"is_c_pgo\",\n    default=False,\n    help=\"\"\"\\\nEnables C level profile guided optimization (PGO), by executing a dedicated build first\nfor a profiling run, and then using the result to feedback into the C compilation.\nNote: This is experimental and not working with standalone modes of Nuitka yet.\nDefaults to off.\"\"\",\n)\n\npgo_group.add_option(\n    \"--pgo-python\",\n    action=\"store_true\",\n    dest=\"is_python_pgo\",\n    default=False,\n    help=SUPPRESS_HELP,\n)\n\npgo_group.add_option(\n    \"--pgo-python-input\",\n    action=\"store\",\n    dest=\"python_pgo_input\",\n    default=None,\n    help=SUPPRESS_HELP,\n)\n\npgo_group.add_option(\n    \"--pgo-python-policy-unused-module\",\n    action=\"store\",\n    dest=\"python_pgo_policy_unused_module\",\n    choices=(\"include\", \"exclude\", \"bytecode\"),\n    default=\"include\",\n    help=SUPPRESS_HELP,\n)\n\npgo_group.add_option(\n    \"--pgo-args\",\n    action=\"store\",\n    dest=\"pgo_args\",\n    default=\"\",\n    help=\"\"\"\\\nArguments to be passed in case of profile guided optimization. These are passed to the special\nbuilt executable during the PGO profiling run. Default empty.\"\"\",\n)\n\npgo_group.add_option(\n    \"--pgo-executable\",\n    action=\"store\",\n    dest=\"pgo_executable\",\n    default=None,\n    help=\"\"\"\\\nCommand to execute when collecting profile information. Use this only, if you need to\nlaunch it through a script that prepares it to run. Default use created program.\"\"\",\n)\n\n\ndel pgo_group\n\n\ntracing_group = parser.add_option_group(\"Tracing features\")\n\ntracing_group.add_option(\n    \"--report\",\n    action=\"store\",\n    dest=\"compilation_report_filename\",\n    metavar=\"REPORT_FILENAME\",\n    default=None,\n    help=\"\"\"\\\nReport module, data files, compilation, plugin, etc. details in an XML output file. This\nis also super useful for issue reporting. These reports can e.g. be used to re-create\nthe environment easily using it with '--create-environment-from-report', but contain a\nlot of information. Default is off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--report-diffable\",\n    action=\"store_true\",\n    dest=\"compilation_report_diffable\",\n    metavar=\"REPORT_DIFFABLE\",\n    default=False,\n    help=\"\"\"\\\nReport data in diffable form, i.e. no timing or memory usage values that vary from run\nto run. Default is off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--report-user-provided\",\n    action=\"append\",\n    dest=\"compilation_report_user_data\",\n    metavar=\"KEY_VALUE\",\n    default=[],\n    help=\"\"\"\\\nReport data from you. This can be given multiple times and be\nanything in 'key=value' form, where key should be an identifier, e.g. use\n'--report-user-provided=pipenv-lock-hash=64a5e4' to track some input values.\nDefault is empty.\"\"\",\n)\n\n\ntracing_group.add_option(\n    \"--report-template\",\n    action=\"append\",\n    dest=\"compilation_report_templates\",\n    metavar=\"REPORT_DESC\",\n    default=[],\n    help=\"\"\"\\\nReport via template. Provide template and output filename 'template.rst.j2:output.rst'. For\nbuilt-in templates, check the User Manual for what these are. Can be given multiple times.\nDefault is empty.\"\"\",\n)\n\n\ntracing_group.add_option(\n    \"--quiet\",\n    action=\"store_true\",\n    dest=\"quiet\",\n    default=False,\n    help=\"\"\"\\\nDisable all information outputs, but show warnings.\nDefaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--show-scons\",\n    action=\"store_true\",\n    dest=\"show_scons\",\n    default=False,\n    help=\"\"\"\\\nRun the C building backend Scons with verbose information, showing the executed commands,\ndetected compilers. Defaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--no-progressbar\",\n    \"--no-progress-bar\",\n    action=\"store_false\",\n    dest=\"progress_bar\",\n    default=True,\n    github_action=False,\n    help=\"\"\"Disable progress bars. Defaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--show-progress\",\n    action=\"store_true\",\n    dest=\"show_progress\",\n    default=False,\n    github_action=False,\n    help=\"\"\"Obsolete: Provide progress information and statistics.\nDisables normal progress bar. Defaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--show-memory\",\n    action=\"store_true\",\n    dest=\"show_memory\",\n    default=False,\n    help=\"\"\"Provide memory information and statistics.\nDefaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--show-modules\",\n    action=\"store_true\",\n    dest=\"show_inclusion\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nProvide information for included modules and DLLs\nObsolete: You should use '--report' file instead. Defaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--show-modules-output\",\n    action=\"store\",\n    dest=\"show_inclusion_output\",\n    metavar=\"PATH\",\n    default=None,\n    github_action=False,\n    help=\"\"\"\\\nWhere to output '--show-modules', should be a filename. Default is standard output.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--verbose\",\n    action=\"store_true\",\n    dest=\"verbose\",\n    default=False,\n    github_action=False,\n    help=\"\"\"\\\nOutput details of actions taken, esp. in optimizations. Can become a lot.\nDefaults to off.\"\"\",\n)\n\ntracing_group.add_option(\n    \"--verbose-output\",\n    action=\"store\",\n    dest=\"verbose_output\",\n    metavar=\"PATH\",\n    default=None,\n    github_action=False,\n    help=\"\"\"\\\nWhere to output from '--verbose', should be a filename. Default is standard output.\"\"\",\n)\n\ndel tracing_group\n\n\nos_group = parser.add_option_group(\"General OS controls\")\n\nos_group.add_option(\n    \"--disable-console\",\n    \"--macos-disable-console\",\n    \"--windows-disable-console\",\n    action=\"store_true\",\n    dest=\"disable_console\",\n    default=None,\n    help=\"\"\"\\\nWhen compiling for Windows or macOS, disable the console window and create a GUI\napplication. Defaults to off.\"\"\",\n)\n\nos_group.add_option(\n    \"--enable-console\",\n    action=\"store_false\",\n    dest=\"disable_console\",\n    default=None,\n    help=\"\"\"\\\nWhen compiling for Windows or macOS, enable the console window and create a console\napplication. This disables hints from certain modules, e.g. \"PySide\" that suggest\nto disable it. Defaults to true.\"\"\",\n)\n\nos_group.add_option(\n    \"--force-stdout-spec\",\n    \"--windows-force-stdout-spec\",\n    action=\"store\",\n    dest=\"force_stdout_spec\",\n    metavar=\"FORCE_STDOUT_SPEC\",\n    default=None,\n    help=\"\"\"\\\nForce standard output of the program to go to this location. Useful for programs with\ndisabled console and programs using the Windows Services Plugin of Nuitka commercial.\nDefaults to not active, use e.g. '{PROGRAM_BASE}.out.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\"\"\",\n)\n\nos_group.add_option(\n    \"--force-stderr-spec\",\n    \"--windows-force-stderr-spec\",\n    action=\"store\",\n    dest=\"force_stderr_spec\",\n    metavar=\"FORCE_STDERR_SPEC\",\n    default=None,\n    help=\"\"\"\\\nForce standard error of the program to go to this location. Useful for programs with\ndisabled console and programs using the Windows Services Plugin of Nuitka commercial.\nDefaults to not active, use e.g. '{PROGRAM_BASE}.err.txt', i.e. file near your program,\ncheck User Manual for full list of available values.\"\"\",\n)\n\ndel os_group\n\n\nwindows_group = parser.add_option_group(\"Windows specific controls\")\n\nwindows_group.add_option(\n    \"--windows-dependency-tool\",\n    action=\"store\",\n    dest=\"dependency_tool\",\n    default=None,\n    help=SUPPRESS_HELP,\n)\n\nwindows_group.add_option(\n    \"--windows-icon-from-ico\",\n    action=\"append\",\n    dest=\"windows_icon_path\",\n    metavar=\"ICON_PATH\",\n    default=[],\n    help=\"\"\"\\\nAdd executable icon. Can be given multiple times for different resolutions\nor files with multiple icons inside. In the later case, you may also suffix\nwith #<n> where n is an integer index starting from 1, specifying a specific\nicon to be included, and all others to be ignored.\"\"\",\n)\n\nwindows_group.add_option(\n    \"--windows-icon-from-exe\",\n    action=\"store\",\n    dest=\"icon_exe_path\",\n    metavar=\"ICON_EXE_PATH\",\n    default=None,\n    help=\"Copy executable icons from this existing executable (Windows only).\",\n)\n\nwindows_group.add_option(\n    \"--onefile-windows-splash-screen-image\",\n    action=\"store\",\n    dest=\"splash_screen_image\",\n    default=None,\n    help=\"\"\"\\\nWhen compiling for Windows and onefile, show this while loading the application. Defaults to off.\"\"\",\n)\n\nwindows_group.add_option(\n    \"--windows-uac-admin\",\n    action=\"store_true\",\n    dest=\"windows_uac_admin\",\n    metavar=\"WINDOWS_UAC_ADMIN\",\n    default=False,\n    help=\"Request Windows User Control, to grant admin rights on execution. (Windows only). Defaults to off.\",\n)\n\nwindows_group.add_option(\n    \"--windows-uac-uiaccess\",  # spell-checker: ignore uiaccess\n    action=\"store_true\",\n    dest=\"windows_uac_uiaccess\",\n    metavar=\"WINDOWS_UAC_UIACCESS\",\n    default=False,\n    help=\"\"\"\\\nRequest Windows User Control, to enforce running from a few folders only, remote\ndesktop access. (Windows only). Defaults to off.\"\"\",\n)\n\ndel windows_group\n\n\nmacos_group = parser.add_option_group(\"macOS specific controls\")\n\nmacos_group.add_option(\n    \"--macos-create-app-bundle\",\n    action=\"store_true\",\n    dest=\"macos_create_bundle\",\n    default=False,\n    help=\"\"\"\\\nWhen compiling for macOS, create a bundle rather than a plain binary\napplication. This is the only way to unlock the disabling of console,\nget high DPI graphics, etc. and implies standalone mode. Defaults to\noff.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-target-arch\",\n    action=\"store\",\n    dest=\"macos_target_arch\",\n    choices=(\"universal\", \"arm64\", \"x86_64\"),\n    metavar=\"MACOS_TARGET_ARCH\",\n    default=None,\n    help=\"\"\"\\\nWhat architectures is this to supposed to run on. Default and limit\nis what the running Python allows for. Default is \"native\" which is\nthe architecture the Python is run with.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-app-icon\",\n    action=\"append\",\n    dest=\"macos_icon_path\",\n    metavar=\"ICON_PATH\",\n    default=[],\n    help=\"Add icon for the application bundle to use. Can be given only one time. Defaults to Python icon if available.\",\n)\n\n\nmacos_group.add_option(\n    \"--macos-signed-app-name\",\n    action=\"store\",\n    dest=\"macos_signed_app_name\",\n    metavar=\"MACOS_SIGNED_APP_NAME\",\n    default=None,\n    help=\"\"\"\\\nName of the application to use for macOS signing. Follow \"com.YourCompany.AppName\"\nnaming results for best results, as these have to be globally unique, and will\npotentially grant protected API accesses.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-app-name\",\n    action=\"store\",\n    dest=\"macos_app_name\",\n    metavar=\"MACOS_APP_NAME\",\n    default=None,\n    help=\"\"\"\\\nName of the product to use in macOS bundle information. Defaults to base\nfilename of the binary.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-app-mode\",\n    action=\"store\",\n    dest=\"macos_app_mode\",\n    metavar=\"MODE\",\n    choices=(\"gui\", \"background\", \"ui-element\"),\n    default=\"gui\",\n    help=\"\"\"\\\nMode of application for the application bundle. When launching a Window, and appearing\nin Docker is desired, default value \"gui\" is a good fit. Without a Window ever, the\napplication is a \"background\" application. For UI elements that get to display later,\n\"ui-element\" is in-between. The application will not appear in dock, but get full\naccess to desktop when it does open a Window later.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-sign-identity\",\n    action=\"store\",\n    dest=\"macos_sign_identity\",\n    metavar=\"MACOS_APP_VERSION\",\n    default=\"ad-hoc\",\n    help=\"\"\"\\\nWhen signing on macOS, by default an ad-hoc identify will be used, but with this\noption your get to specify another identity to use. The signing of code is now\nmandatory on macOS and cannot be disabled. Use \"auto\" to detect your only identity\ninstalled. Default \"ad-hoc\" if not given.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-sign-notarization\",\n    action=\"store_true\",\n    dest=\"macos_sign_notarization\",\n    default=False,\n    help=\"\"\"\\\nWhen signing for notarization, using a proper TeamID identity from Apple, use\nthe required runtime signing option, such that it can be accepted.\"\"\",\n)\n\n\nmacos_group.add_option(\n    \"--macos-app-version\",\n    action=\"store\",\n    dest=\"macos_app_version\",\n    metavar=\"MACOS_APP_VERSION\",\n    default=None,\n    help=\"\"\"\\\nProduct version to use in macOS bundle information. Defaults to \"1.0\" if\nnot given.\"\"\",\n)\n\nmacos_group.add_option(\n    \"--macos-app-protected-resource\",\n    action=\"append\",\n    dest=\"macos_protected_resources\",\n    metavar=\"RESOURCE_DESC\",\n    default=[],\n    help=\"\"\"\\\nRequest an entitlement for access to a macOS protected resources, e.g.\n\"NSMicrophoneUsageDescription:Microphone access for recording audio.\"\nrequests access to the microphone and provides an informative text for\nthe user, why that is needed. Before the colon, is an OS identifier for\nan access right, then the informative text. Legal values can be found on\nhttps://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources and\nthe option can be specified multiple times. Default empty.\"\"\",\n)\n\n\ndel macos_group\n\n\nlinux_group = parser.add_option_group(\"Linux specific controls\")\n\nlinux_group.add_option(\n    \"--linux-icon\",\n    \"--linux-onefile-icon\",\n    action=\"append\",\n    dest=\"linux_icon_path\",\n    metavar=\"ICON_PATH\",\n    default=[],\n    help=\"Add executable icon for onefile binary to use. Can be given only one time. Defaults to Python icon if available.\",\n)\n\ndel linux_group\n\nversion_group = parser.add_option_group(\"Binary Version Information\")\n\nversion_group.add_option(\n    \"--company-name\",\n    \"--windows-company-name\",\n    action=\"store\",\n    dest=\"company_name\",\n    metavar=\"COMPANY_NAME\",\n    default=None,\n    help=\"Name of the company to use in version information. Defaults to unused.\",\n)\n\nversion_group.add_option(\n    \"--product-name\",\n    \"--windows-product-name\",\n    action=\"store\",\n    dest=\"product_name\",\n    metavar=\"PRODUCT_NAME\",\n    default=None,\n    help=\"\"\"\\\nName of the product to use in version information. Defaults to base filename of the binary.\"\"\",\n)\n\nversion_group.add_option(\n    \"--file-version\",\n    \"--windows-file-version\",\n    action=\"store\",\n    dest=\"file_version\",\n    metavar=\"FILE_VERSION\",\n    default=None,\n    help=\"\"\"\\\nFile version to use in version information. Must be a sequence of up to 4\nnumbers, e.g. 1.0 or 1.0.0.0, no more digits are allowed, no strings are\nallowed. Defaults to unused.\"\"\",\n)\n\nversion_group.add_option(\n    \"--product-version\",\n    \"--windows-product-version\",\n    action=\"store\",\n    dest=\"product_version\",\n    metavar=\"PRODUCT_VERSION\",\n    default=None,\n    help=\"\"\"\\\nProduct version to use in version information. Same rules as for file version.\nDefaults to unused.\"\"\",\n)\n\nversion_group.add_option(\n    \"--file-description\",\n    \"--windows-file-description\",\n    action=\"store\",\n    dest=\"file_description\",\n    metavar=\"FILE_DESCRIPTION\",\n    default=None,\n    help=\"\"\"\\\nDescription of the file used in version information. Windows only at this time. Defaults to binary filename.\"\"\",\n)\n\nversion_group.add_option(\n    \"--copyright\",\n    action=\"store\",\n    dest=\"legal_copyright\",\n    metavar=\"COPYRIGHT_TEXT\",\n    default=None,\n    help=\"\"\"\\\nCopyright used in version information. Windows/macOS only at this time. Defaults to not present.\"\"\",\n)\n\nversion_group.add_option(\n    \"--trademarks\",\n    action=\"store\",\n    dest=\"legal_trademarks\",\n    metavar=\"TRADEMARK_TEXT\",\n    default=None,\n    help=\"\"\"\\\nTrademark used in version information. Windows/macOS only at this time. Defaults to not present.\"\"\",\n)\n\n\ndel version_group\n\nplugin_group = parser.add_option_group(\"Plugin control\")\n\nplugin_group.add_option(\n    \"--enable-plugins\",\n    \"--plugin-enable\",\n    action=\"append\",\n    dest=\"plugins_enabled\",\n    metavar=\"PLUGIN_NAME\",\n    default=[],\n    help=\"\"\"\\\nEnabled plugins. Must be plug-in names. Use '--plugin-list' to query the\nfull list and exit. Default empty.\"\"\",\n)\n\nplugin_group.add_option(\n    \"--disable-plugins\",\n    \"--plugin-disable\",\n    action=\"append\",\n    dest=\"plugins_disabled\",\n    metavar=\"PLUGIN_NAME\",\n    default=[],\n    github_action=False,\n    help=\"\"\"\\\nDisabled plugins. Must be plug-in names. Use '--plugin-list' to query the\nfull list and exit. Most standard plugins are not a good idea to disable.\nDefault empty.\"\"\",\n)\n\nplugin_group.add_option(\n    \"--user-plugin\",\n    action=\"append\",\n    dest=\"user_plugins\",\n    metavar=\"PATH\",\n    default=[],\n    help=\"The file name of user plugin. Can be given multiple times. Default empty.\",\n)\n\nplugin_group.add_option(\n    \"--plugin-list\",\n    action=\"store_true\",\n    dest=\"plugin_list\",\n    default=False,\n    require_compiling=False,\n    github_action=False,\n    help=\"\"\"\\\nShow list of all available plugins and exit. Defaults to off.\"\"\",\n)\n\nplugin_group.add_option(\n    \"--plugin-no-detection\",\n    action=\"store_false\",\n    dest=\"detect_missing_plugins\",\n    default=True,\n    help=\"\"\"\\\nPlugins can detect if they might be used, and the you can disable the warning\nvia \"--disable-plugin=plugin-that-warned\", or you can use this option to disable\nthe mechanism entirely, which also speeds up compilation slightly of course as\nthis detection code is run in vain once you are certain of which plugins to\nuse. Defaults to off.\"\"\",\n)\n\nplugin_group.add_option(\n    \"--module-parameter\",\n    action=\"append\",\n    dest=\"module_parameters\",\n    default=[],\n    help=\"\"\"\\\nProvide a module parameter. You are asked by some packages\nto provide extra decisions. Format is currently\n--module-parameter=module.name-option-name=value\nDefault empty.\"\"\",\n)\n\nplugin_group.add_option(\n    \"--show-source-changes\",\n    action=\"append\",\n    dest=\"show_source_changes\",\n    default=[],\n    github_action=False,\n    help=\"\"\"\\\nShow source changes to original Python file content before compilation. Mostly\nintended for developing plugins and Nuitka package configuration. Use e.g.\n'--show-source-changes=numpy.**' to see all changes below a given namespace\nor use '*' to see everything which can get a lot.\nDefault empty.\"\"\",\n)\n\ndel plugin_group\n\n\ndef _considerPluginOptions(logger):\n    # Cyclic dependency on plugins during parsing of command line.\n    from nuitka.plugins.Plugins import (\n        addPluginCommandLineOptions,\n        addStandardPluginCommandLineOptions,\n        addUserPluginCommandLineOptions,\n    )\n\n    addStandardPluginCommandLineOptions(parser=parser)\n\n    for arg in sys.argv[1:]:\n        if arg.startswith(\n            (\"--enable-plugin=\", \"--enable-plugins=\", \"--plugin-enable=\")\n        ):\n            plugin_names = arg.split(\"=\", 1)[1]\n            if \"=\" in plugin_names:\n                logger.sysexit(\n                    \"Error, plugin options format changed. Use '--enable-plugin=%s --help' to know new options.\"\n                    % plugin_names.split(\"=\", 1)[0]\n                )\n\n            addPluginCommandLineOptions(\n                parser=parser,\n                plugin_names=plugin_names.split(\",\"),\n            )\n\n        if arg.startswith(\"--user-plugin=\"):\n            plugin_name = arg[14:]\n            if \"=\" in plugin_name:\n                logger.sysexit(\n                    \"Error, plugin options format changed. Use '--user-plugin=%s --help' to know new options.\"\n                    % plugin_name.split(\"=\", 1)[0]\n                )\n\n            addUserPluginCommandLineOptions(parser=parser, filename=plugin_name)\n\n\nrun_time_variable_names = (\n    \"TEMP\",\n    \"PID\",\n    \"TIME\",\n    \"PROGRAM\",\n    \"PROGRAM_BASE\",\n    \"CACHE_DIR\",\n    \"COMPANY\",\n    \"PRODUCT\",\n    \"VERSION\",\n    \"HOME\",\n    \"NONE\",\n    \"NULL\",\n)\n\n\nclass _RetainingFormatter(Formatter):\n    def get_value(self, key, args, kwargs):\n        if isinstance(key, str):\n            try:\n                return kwargs[key]\n            except KeyError:\n                return \"{%s}\" % key\n        else:\n            return Formatter.get_value(self, key, args, kwargs)\n\n\ndef _expandProjectArg(arg, filename_arg, for_eval):\n    def wrap(value):\n        if for_eval:\n            return repr(value)\n        else:\n            return value\n\n    values = {\n        \"OS\": wrap(getOS()),\n        \"Arch\": wrap(getArchitecture()),\n        \"Flavor\": wrap(getPythonFlavorName()),\n        \"Version\": getNuitkaVersion(),\n        \"Commercial\": wrap(getCommercialVersion()),\n        \"MAIN_DIRECTORY\": wrap(os.path.dirname(filename_arg) or \".\"),\n    }\n\n    if isLinux():\n        dist_info = getLinuxDistribution()\n    else:\n        dist_info = \"N/A\", \"N/A\", \"0\"\n\n    values[\"Linux_Distribution_Name\"] = dist_info[0]\n    values[\"Linux_Distribution_Base\"] = dist_info[1] or dist_info[0]\n    values[\"Linux_Distribution_Version\"] = dist_info[2]\n\n    if isWin32OrPosixWindows():\n        values[\"WindowsRelease\"] = getWindowsRelease()\n\n    values.update(\n        (\n            (run_time_variable_name, \"{%s}\" % run_time_variable_name)\n            for run_time_variable_name in run_time_variable_names\n        )\n    )\n\n    arg = _RetainingFormatter().format(arg, **values)\n\n    return arg\n\n\ndef getNuitkaProjectOptions(logger, filename_arg, module_mode):\n    \"\"\"Extract the Nuitka project options.\n\n    Note: This is used by Nuitka project and test tools as well.\n    \"\"\"\n\n    # Complex stuff, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    if os.path.isdir(filename_arg):\n        if module_mode:\n            filename_arg = os.path.join(filename_arg, \"__init__.py\")\n        else:\n            filename_arg = os.path.join(filename_arg, \"__main__.py\")\n\n    # The file specified may not exist, let the later parts of Nuitka handle this.\n    try:\n        contents_by_line = getFileContentByLine(filename_arg, \"rb\")\n    except (OSError, IOError):\n        return\n\n    def sysexit(count, message):\n        logger.sysexit(\"%s:%d %s\" % (filename_arg, count + 1, message))\n\n    execute_block = True\n    expect_block = False\n\n    cond_level = -1\n\n    for line_number, line in enumerate(contents_by_line):\n        match = re.match(b\"^\\\\s*#(\\\\s*)nuitka-project(.*?):(.*)\", line)\n\n        if match:\n            level, command, arg = match.groups()\n            level = len(level)\n            arg = arg.rstrip()\n\n            # Check for empty conditional blocks.\n            if expect_block and level <= cond_level:\n                sysexit(\n                    line_number,\n                    \"Error, 'nuitka-project-if|else' is expected to be followed by block start.\",\n                )\n\n            expect_block = False\n\n            if level == cond_level and command == b\"-else\":\n                execute_block = not execute_block\n            elif level <= cond_level:\n                execute_block = True\n\n            if level > cond_level and not execute_block:\n                continue\n\n            if str is not bytes:\n                command = command.decode(\"utf8\")\n                arg = arg.decode(\"utf8\")\n\n            if command == \"-if\":\n                if not arg.endswith(\":\"):\n                    sysexit(\n                        line_number,\n                        \"Error, 'nuitka-project-if' needs to start a block with a colon at line end.\",\n                    )\n\n                arg = arg[:-1].strip()\n\n                expanded = _expandProjectArg(arg, filename_arg, for_eval=True)\n\n                with withNoSyntaxWarning():\n                    r = eval(  # We allow the user to run any code, pylint: disable=eval-used\n                        expanded\n                    )\n\n                # Likely mistakes, e.g. with \"in\" tests.\n                if r is not True and r is not False:\n                    sys.exit(\n                        \"Error, 'nuitka-project-if' condition %r (expanded to %r) does not yield boolean result %r\"\n                        % (arg, expanded, r)\n                    )\n\n                execute_block = r\n                expect_block = True\n                cond_level = level\n            elif command == \"-else\":\n                if arg:\n                    sysexit(\n                        line_number,\n                        \"Error, 'nuitka-project-else' cannot have argument.\",\n                    )\n\n                if cond_level != level:\n                    sysexit(\n                        line_number,\n                        \"Error, 'nuitka-project-else' not currently allowed after nested nuitka-project-if.\",\n                    )\n\n                expect_block = True\n                cond_level = level\n            elif command == \"\":\n                arg = re.sub(r\"\"\"^([\\w-]*=)(['\"])(.*)\\2$\"\"\", r\"\\1\\3\", arg.lstrip())\n\n                if not arg:\n                    continue\n\n                yield _expandProjectArg(arg, filename_arg, for_eval=False)\n            else:\n                assert False, (command, line)\n\n\ndef _considerGithubWorkflowOptions(phase):\n    try:\n        github_option_index = sys.argv.index(\"--github-workflow-options\")\n    except ValueError:\n        return\n\n    import json\n\n    early_names = (\n        \"main\",\n        \"script-name\",\n        \"enable-plugin\",\n        \"enable-plugins\",\n        \"disable-plugin\",\n        \"disable-plugins\",\n        \"user-plugin\",\n    )\n\n    def filterByName(key):\n        # Not for Nuitka at all.\n        if key in (\n            \"nuitka-version\",\n            \"working-directory\",\n            \"access-token\",\n            \"disable-cache\",\n        ):\n            return False\n\n        # Ignore platform specific options.\n        if key.startswith(\"macos-\") and not isMacOS():\n            return False\n        if (key.startswith(\"windows-\") or key == \"mingw64\") and not isWin32Windows():\n            return False\n        if key.startswith(\"linux-\") and not isLinux():\n            return False\n\n        if phase == \"early\":\n            return key in early_names\n        else:\n            return key not in early_names\n\n    options_added = []\n\n    for key, value in json.loads(os.environ[\"NUITKA_WORKFLOW_INPUTS\"]).items():\n        if not value:\n            continue\n\n        if not filterByName(key):\n            continue\n\n        option_name = \"--%s\" % key\n\n        if parser.isBooleanOption(option_name):\n            if value == \"false\":\n                continue\n\n            options_added.append(option_name)\n        elif parser.isListOption(option_name):\n            for value in value.split(\"\\n\"):\n                if not value.strip():\n                    continue\n\n                options_added.append(\"%s=%s\" % (option_name, value))\n        else:\n            # Boolean disabled options from inactive plugins that default to off.\n            if value == \"false\":\n                continue\n\n            options_added.append(\"%s=%s\" % (option_name, value))\n\n    sys.argv = (\n        sys.argv[: github_option_index + (1 if phase == \"early\" else 0)]\n        + options_added\n        + sys.argv[github_option_index + 1 :]\n    )\n\n\ndef parseOptions(logger):\n    # Pretty complex code, having a small options parser and many details as\n    # well as integrating with plugins and run modes. pylint: disable=too-many-branches\n\n    # First, isolate the first non-option arguments.\n    extra_args = []\n\n    if is_nuitka_run:\n        count = 0\n\n        for count, arg in enumerate(sys.argv):\n            if count == 0:\n                continue\n\n            if arg[0] != \"-\":\n                break\n\n            # Treat \"--\" as a terminator.\n            if arg == \"--\":\n                count += 1\n                break\n\n        if count > 0:\n            extra_args = sys.argv[count + 1 :]\n            sys.argv = sys.argv[0 : count + 1]\n\n    filename_args = []\n    module_mode = False\n\n    # Options may be coming from GitHub workflow configuration as well.\n    _considerGithubWorkflowOptions(phase=\"early\")\n\n    for count, arg in enumerate(sys.argv):\n        if count == 0:\n            continue\n\n        if arg.startswith((\"--main=\", \"--script-name=\")):\n            filename_args.append(arg.split(\"=\", 1)[1])\n\n        if arg == \"--module\":\n            module_mode = True\n\n        if arg[0] != \"-\":\n            filename_args.append(arg)\n            break\n\n    for filename in filename_args:\n        sys.argv = (\n            [sys.argv[0]]\n            + list(getNuitkaProjectOptions(logger, filename, module_mode))\n            + sys.argv[1:]\n        )\n\n    # Next, lets activate plugins early, so they can inject more options to the parser.\n    _considerPluginOptions(logger)\n\n    # Options may be coming from GitHub workflow configuration as well.\n    _considerGithubWorkflowOptions(phase=\"late\")\n\n    options, positional_args = parser.parse_args()\n\n    if (\n        not positional_args\n        and not options.mains\n        and not parser.hasNonCompilingAction(options)\n    ):\n        parser.print_help()\n\n        logger.sysexit(\n            \"\"\"\nError, need filename argument with python module or main program.\"\"\"\n        )\n\n    if not options.immediate_execution and len(positional_args) > 1:\n        parser.print_help()\n\n        logger.sysexit(\n            \"\"\"\nError, specify only one positional argument unless \"--run\" is specified to\npass them to the compiled program execution.\"\"\"\n        )\n\n    return is_nuitka_run, options, positional_args, extra_args\n\n\ndef runSpecialCommandsFromOptions(options):\n    if options.plugin_list:\n        from nuitka.plugins.Plugins import listPlugins\n\n        listPlugins()\n        sys.exit(0)\n\n    if options.list_package_dlls:\n        from nuitka.tools.scanning.DisplayPackageDLLs import displayDLLs\n\n        displayDLLs(options.list_package_dlls)\n        sys.exit(0)\n\n    if options.list_package_data:\n        from nuitka.tools.scanning.DisplayPackageData import displayPackageData\n\n        displayPackageData(options.list_package_data)\n        sys.exit(0)\n\n    if options.edit_module_code:\n        from nuitka.tools.general.find_module.FindModuleCode import (\n            editModuleCode,\n        )\n\n        editModuleCode(options.edit_module_code)\n        sys.exit(0)\n\n    if options.create_environment_from_report:\n        from nuitka.tools.environments.CreateEnvironment import (\n            createEnvironmentFromReport,\n        )\n\n        createEnvironmentFromReport(\n            environment_folder=os.path.expanduser(\n                options.create_environment_from_report\n            ),\n            report_filename=os.path.expanduser(options.compilation_report_filename),\n        )\n        sys.exit(0)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Options.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Options module\n\nThis exposes the choices made by the user. Defaults will be applied here, and\nsome handling of defaults.\n\n\"\"\"\n\n# These are for use in option values.\n# spell-checker: ignore uiaccess,noannotations,reexecution,etherium\n# spell-checker: ignore nodocstrings,noasserts,nowarnings,norandomization\n\nimport fnmatch\nimport os\nimport re\nimport shlex\nimport sys\n\nfrom nuitka import Progress, Tracing\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.StandardLibrary import isStandardLibraryPath\nfrom nuitka.OptionParsing import (\n    parseOptions,\n    run_time_variable_names,\n    runSpecialCommandsFromOptions,\n)\nfrom nuitka.PythonFlavors import (\n    getPythonFlavorName,\n    isAnacondaPython,\n    isApplePython,\n    isArchPackagePython,\n    isCPythonOfficialPackage,\n    isDebianPackagePython,\n    isHomebrewPython,\n    isManyLinuxPython,\n    isMSYS2MingwPython,\n    isNuitkaPython,\n    isPyenvPython,\n    isTermuxPython,\n    isUninstalledPython,\n)\nfrom nuitka.PythonVersions import (\n    getNotYetSupportedPythonVersions,\n    getSupportedPythonVersions,\n    isDebugPython,\n    python_version,\n    python_version_str,\n)\nfrom nuitka.utils.Execution import getExecutablePath\nfrom nuitka.utils.FileOperations import (\n    isPathExecutable,\n    openTextFile,\n    resolveShellPatternToFilenames,\n)\nfrom nuitka.utils.Images import checkIconUsage\nfrom nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath\nfrom nuitka.utils.Utils import (\n    getArchitecture,\n    getCPUCoreCount,\n    getLinuxDistribution,\n    getMacOSRelease,\n    getOS,\n    getWindowsRelease,\n    hasOnefileSupportedOS,\n    hasStandaloneSupportedOS,\n    isDebianBasedLinux,\n    isFreeBSD,\n    isLinux,\n    isMacOS,\n    isOpenBSD,\n    isPosixWindows,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n)\nfrom nuitka.Version import getCommercialVersion, getNuitkaVersion\n\noptions = None\npositional_args = None\nextra_args = []\nis_nuitka_run = None\nis_debug = None\nis_non_debug = None\nis_full_compat = None\nis_report_missing = None\nis_verbose = None\n\n\ndef _convertOldStylePathSpecQuotes(value):\n    quote = None\n\n    result = \"\"\n    for c in value:\n        if c == \"%\":\n            if quote is None:\n                quote = \"{\"\n                result += quote\n            elif quote == \"{\":\n                result += \"}\"\n                quote = None\n        else:\n            result += c\n\n    return result\n\n\ndef checkPathSpec(value, arg_name, allow_disable):\n    # There are never enough checks here, pylint: disable=too-many-branches\n    old = value\n    value = _convertOldStylePathSpecQuotes(value)\n    if old != value:\n        Tracing.options_logger.warning(\n            \"Adapted '%s' option value from legacy quoting style to '%s' -> '%s'\"\n            % (arg_name, old, value)\n        )\n\n    if \"\\n\" in value or \"\\r\" in value:\n        Tracing.options_logger.sysexit(\n            \"Using a new line in value '%s=%r' value is not allowed.\"\n            % (arg_name, value)\n        )\n\n    if \"{NONE}\" in value:\n        if not allow_disable:\n            Tracing.options_logger.sysexit(\n                \"Using value '{NONE}' in '%s=%s' value is not allowed.\"\n                % (arg_name, value)\n            )\n\n        if value != \"{NONE}\":\n            Tracing.options_logger.sysexit(\n                \"Using value '{NONE}' in '%s=%s' value does not allow anything else used too.\"\n                % (arg_name, value)\n            )\n\n    if \"{NULL}\" in value:\n        if not allow_disable:\n            Tracing.options_logger.sysexit(\n                \"Using value '{NULL}' in '%s=%s' value is not allowed.\"\n                % (arg_name, value)\n            )\n\n        if value != \"{NULL}\":\n            Tracing.options_logger.sysexit(\n                \"Using value '{NULL}' in '%s=%s' value does not allow anything else used too.\"\n                % (arg_name, value)\n            )\n\n    if \"{COMPANY}\" in value and not getCompanyName():\n        Tracing.options_logger.sysexit(\n            \"Using value '{COMPANY}' in '%s=%s' value without being specified.\"\n            % (arg_name, value)\n        )\n\n    if \"{PRODUCT}\" in value and not getProductName():\n        Tracing.options_logger.sysexit(\n            \"Using value '{PRODUCT}' in '%s=%s' value without being specified.\"\n            % (arg_name, value)\n        )\n\n    if \"{VERSION}\" in value and not (getFileVersionTuple() or getProductVersionTuple()):\n        Tracing.options_logger.sysexit(\n            \"Using value '{VERSION}' in '%s=%s' value without being specified.\"\n            % (arg_name, value)\n        )\n\n    if value.count(\"{\") != value.count(\"}\"):\n        Tracing.options_logger.sysexit(\n            \"\"\"Unmatched '{}' is wrong for '%s=%s' and may \\\ndefinitely not do what you want it to do.\"\"\"\n            % (arg_name, value)\n        )\n\n    # Catch nested or illegal variable names.\n    var_name = None\n    for c in value:\n        if c in \"{\":\n            if var_name is not None:\n                Tracing.options_logger.sysexit(\n                    \"\"\"Nested '{' is wrong for '%s=%s'.\"\"\" % (arg_name, value)\n                )\n            var_name = \"\"\n        elif c == \"}\":\n            if var_name is None:\n                Tracing.options_logger.sysexit(\n                    \"\"\"Stray '}' is wrong for '%s=%s'.\"\"\" % (arg_name, value)\n                )\n\n            if var_name not in run_time_variable_names:\n                Tracing.onefile_logger.sysexit(\n                    \"Found unknown variable name '%s' in for '%s=%s'.\"\n                    \"\" % (var_name, arg_name, value)\n                )\n\n            var_name = None\n        else:\n            if var_name is not None:\n                var_name += c\n\n    for candidate in (\n        \"{PROGRAM}\",\n        \"{PROGRAM_BASE}\",\n        \"{CACHE_DIR}\",\n        \"{HOME}\",\n        \"{TEMP}\",\n    ):\n        if candidate in value[1:]:\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nAbsolute run time paths of '%s' can only be at the start of \\\n'%s=%s', using it in the middle of it is not allowed.\"\"\"\n                % (candidate, arg_name, value)\n            )\n\n        if candidate == value:\n            Tracing.options_logger.sysexit(\n                \"\"\"Cannot use general system folder %s, may only be the \\\nstart of '%s=%s', using that alone is not allowed.\"\"\"\n                % (candidate, arg_name, value)\n            )\n\n    return value\n\n\ndef _checkOnefileTargetSpec():\n    options.onefile_tempdir_spec = checkPathSpec(\n        options.onefile_tempdir_spec,\n        arg_name=\"--onefile-tempdir-spec\",\n        allow_disable=False,\n    )\n\n    if os.path.normpath(options.onefile_tempdir_spec) == \".\":\n        Tracing.options_logger.sysexit(\n            \"\"\"\\\nError, using '.' as a value for '--onefile-tempdir-spec' is not supported,\nyou cannot unpack the onefile payload into the same directory as the binary,\nas that would overwrite it and cause locking issues as well.\"\"\"\n        )\n\n    if options.onefile_tempdir_spec.count(\"{\") == 0:\n        Tracing.options_logger.warning(\n            \"\"\"Not using any variables for '--onefile-tempdir-spec' should only be \\\ndone if your program absolutely needs to be in the same path always: '%s'\"\"\"\n            % options.onefile_tempdir_spec\n        )\n\n    if os.path.isabs(options.onefile_tempdir_spec):\n        Tracing.options_logger.warning(\n            \"\"\"\\\nUsing an absolute path should be avoided unless you are targeting a \\\nvery well known environment: anchoring it with e.g. '{TEMP}', \\\n'{CACHE_DIR}' is recommended: You seemingly gave the value '%s'\"\"\"\n            % options.onefile_tempdir_spec\n        )\n    elif not options.onefile_tempdir_spec.startswith(\n        (\"{TEMP}\", \"{HOME}\", \"{CACHE_DIR}\")\n    ):\n        Tracing.options_logger.warning(\n            \"\"\"\\\nUsing a relative to the onefile executable should be avoided \\\nunless you are targeting a very well known environment, anchoring \\\nit with e.g. '{TEMP}', '{CACHE_DIR}' is recommended: '%s'\"\"\"\n            % options.onefile_tempdir_spec\n        )\n\n\ndef _getVersionInformationValues():\n    # TODO: Might be nice if we could delay version information computation\n    # until it's actually used.\n    yield getNuitkaVersion()\n    yield \"Commercial: %s\" % getCommercialVersion()\n    yield \"Python: %s\" % sys.version.split(\"\\n\", 1)[0]\n    yield \"Flavor: %s\" % getPythonFlavorName()\n    yield \"Executable: %s\" % sys.executable\n    yield \"OS: %s\" % getOS()\n    yield \"Arch: %s\" % getArchitecture()\n\n    if isLinux():\n        dist_name, dist_base, dist_version = getLinuxDistribution()\n\n        if dist_base is not None:\n            yield \"Distribution: %s (based on %s) %s\" % (\n                dist_name,\n                dist_base,\n                dist_version,\n            )\n        else:\n            yield \"Distribution: %s %s\" % (dist_name, dist_version)\n\n    if isWin32OrPosixWindows():\n        yield \"WindowsRelease: %s\" % getWindowsRelease()\n\n    if isMacOS():\n        yield \"macOSRelease: %s\" % getMacOSRelease()\n\n\ndef printVersionInformation():\n    print(\"\\n\".join(_getVersionInformationValues()))\n\n    from nuitka.build.SconsInterface import (\n        asBoolStr,\n        runScons,\n        setCommonSconsOptions,\n    )\n\n    scons_options = {\"compiler_version_mode\": asBoolStr(\"true\")}\n    env_values = setCommonSconsOptions(options=scons_options)\n\n    runScons(\n        options=scons_options,\n        env_values=env_values,\n        scons_filename=\"CCompilerVersion.scons\",\n    )\n\n\ndef _warnOnefileOnlyOption(option_name):\n    if not options.is_onefile:\n        Tracing.options_logger.warning(\n            \"\"\"\\\nUsing onefile specific option '%s' has no effect \\\nwhen '--onefile' is not specified.\"\"\"\n            % option_name\n        )\n\n\ndef parseArgs():\n    \"\"\"Parse the command line arguments\n\n    :meta private:\n    \"\"\"\n    # singleton with many cases checking the options right away.\n    # pylint: disable=global-statement,too-many-branches,too-many-locals,too-many-statements\n    global is_nuitka_run, options, positional_args, extra_args, is_debug, is_non_debug\n    global is_full_compat, is_report_missing, is_verbose\n\n    if os.name == \"nt\":\n        # Windows store Python's don't allow looking at the python, catch that.\n        try:\n            with openTextFile(sys.executable, \"rb\"):\n                pass\n        except OSError:\n            Tracing.general.sysexit(\n                \"\"\"\\\nError, the Python from Windows app store is not supported.\"\"\",\n                mnemonic=\"unsupported-windows-app-store-python\",\n            )\n\n    is_nuitka_run, options, positional_args, extra_args = parseOptions(\n        logger=Tracing.options_logger\n    )\n\n    is_debug = _isDebug()\n    is_non_debug = not is_debug\n    is_full_compat = _isFullCompat()\n\n    if hasattr(options, \"experimental\"):\n        _experimental.update(options.experimental)\n\n    # Dedicated option for caches, ccache and bytecode\n    if options.disable_ccache:\n        options.disabled_caches.append(\"ccache\")\n    if options.disable_bytecode_cache:\n        options.disabled_caches.append(\"bytecode\")\n    if getattr(options, \"disable_dll_dependency_cache\", False):\n        options.disabled_caches.append(\"dll-dependencies\")\n\n    # TODO: Have dedicated option for it.\n    is_report_missing = is_debug\n\n    if options.quiet or int(os.getenv(\"NUITKA_QUIET\", \"0\")):\n        Tracing.setQuiet()\n\n    def _quoteArg(arg):\n        if \" \" in arg:\n            if \"=\" in arg and arg.startswith(\"--\"):\n                arg_name, value = arg.split(\"=\", 1)\n\n                return '%s=\"%s\"' % (arg_name, value)\n            else:\n                return '\"%s\"' % arg\n        else:\n            return arg\n\n    # This will not return if a non-compiling command is given.\n    runSpecialCommandsFromOptions(options)\n\n    if not options.version:\n        Tracing.options_logger.info(\n            \"Used command line options: %s\"\n            % \" \".join(_quoteArg(arg) for arg in sys.argv[1:])\n        )\n\n    if os.getenv(\"NUITKA_REEXECUTION\") and not isAllowedToReexecute():\n        Tracing.general.sysexit(\n            \"Error, not allowed to re-execute, but that has happened.\"\n        )\n\n    if options.progress_bar:\n        Progress.enableProgressBar()\n\n    if options.verbose_output:\n        Tracing.optimization_logger.setFileHandle(\n            # Can only have unbuffered binary IO in Python3, therefore not disabling buffering here.\n            openTextFile(options.verbose_output, \"w\", encoding=\"utf8\")\n        )\n\n        options.verbose = True\n\n    is_verbose = options.verbose\n\n    Tracing.optimization_logger.is_quiet = not options.verbose\n\n    if options.version:\n        printVersionInformation()\n        sys.exit(0)\n\n    if options.clean_caches:\n        from nuitka.CacheCleanup import cleanCaches\n\n        cleanCaches()\n\n        if not positional_args:\n            sys.exit(0)\n\n    if options.show_inclusion_output:\n        Tracing.inclusion_logger.setFileHandle(\n            # Can only have unbuffered binary IO in Python3, therefore not disabling buffering here.\n            openTextFile(options.show_inclusion_output, \"w\", encoding=\"utf8\")\n        )\n\n        options.show_inclusion = True\n\n    Tracing.progress_logger.is_quiet = not options.show_progress\n\n    # Onefile implies standalone build.\n    if options.is_onefile:\n        options.is_standalone = True\n\n    # macOS bundle implies standalone build.\n    if shallCreateAppBundle():\n        options.is_standalone = True\n\n    if isMacOS():\n        macos_target_arch = getMacOSTargetArch()\n\n        if macos_target_arch == \"universal\":\n            Tracing.options_logger.sysexit(\n                \"Cannot create universal macOS binaries (yet), please pick an arch and create two binaries.\"\n            )\n\n        if (options.macos_target_arch or \"native\") != \"native\":\n            from nuitka.utils.SharedLibraries import (\n                hasUniversalOrMatchingMacOSArchitecture,\n            )\n\n            if not hasUniversalOrMatchingMacOSArchitecture(\n                os.path.realpath(sys.executable)\n            ):\n                Tracing.options_logger.sysexit(\n                    \"\"\"\\\nCannot cross compile to other arch, using non-universal Python binaries \\\nfor macOS. Please install the \"universal\" Python package as offered on \\\nthe Python download page.\"\"\"\n                )\n\n    # Standalone implies no_site build unless overridden, therefore put it\n    # at start of flags, so \"site\" can override it.\n    if options.is_standalone:\n        options.python_flags.insert(0, \"no_site\")\n\n    # Check onefile tempdir spec.\n    if options.onefile_tempdir_spec:\n        _checkOnefileTargetSpec()\n\n        _warnOnefileOnlyOption(\"--onefile-tempdir-spec\")\n\n    # Check onefile splash image\n    if options.splash_screen_image:\n        if not os.path.exists(options.splash_screen_image):\n            Tracing.options_logger.sysexit(\n                \"Error, splash screen image path '%s' does not exist.\"\n                % options.splash_screen_image\n            )\n\n        _warnOnefileOnlyOption(\"--onefile-windows-splash-screen-image\")\n\n    if options.onefile_child_grace_time is not None:\n        if not options.onefile_child_grace_time.isdigit():\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, the value given for '--onefile-child-grace-time' must be integer.\"\"\"\n            )\n\n        _warnOnefileOnlyOption(\"--onefile-child-grace-time\")\n\n    if getShallIncludeExternallyDataFilePatterns():\n        _warnOnefileOnlyOption(\"--include-onefile-external-data\")\n\n    if options.force_stdout_spec:\n        options.force_stdout_spec = checkPathSpec(\n            options.force_stdout_spec, \"--force-stdout-spec\", allow_disable=True\n        )\n\n    if options.force_stderr_spec:\n        options.force_stderr_spec = checkPathSpec(\n            options.force_stderr_spec, \"--force-stderr-spec\", allow_disable=True\n        )\n\n    # Provide a tempdir spec implies onefile tempdir, even on Linux.\n    # Standalone mode implies an executable, not importing \"site\" module, which is\n    # only for this machine, recursing to all modules, and even including the\n    # standard library.\n    if options.is_standalone:\n        if options.module_mode:\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, conflicting options, cannot make standalone module, only executable.\n\nModules are supposed to be imported to an existing Python installation, therefore it\nmakes no sense to include a Python runtime.\"\"\"\n            )\n\n    for any_case_module in getShallFollowModules():\n        if any_case_module.startswith(\".\"):\n            bad = True\n        else:\n            for char in \"/\\\\:\":\n                if char in any_case_module:\n                    bad = True\n                    break\n            else:\n                bad = False\n\n        if bad:\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, '--follow-import-to' takes only module names or patterns, not directory path '%s'.\"\"\"\n                % any_case_module\n            )\n\n    for no_case_module in getShallFollowInNoCase():\n        if no_case_module.startswith(\".\"):\n            bad = True\n        else:\n            for char in \"/\\\\:\":\n                if char in no_case_module:\n                    bad = True\n                    break\n            else:\n                bad = False\n\n        if bad:\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, '--nofollow-import-to' takes only module names or patterns, not directory path '%s'.\"\"\"\n                % no_case_module\n            )\n\n    scons_python = getPythonPathForScons()\n\n    if scons_python is not None and not os.path.isfile(scons_python):\n        Tracing.options_logger.sysexit(\n            \"Error, no such Python binary '%s', should be full path.\" % scons_python\n        )\n\n    output_filename = getOutputFilename()\n\n    if output_filename is not None:\n        if shallMakeModule():\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, may not module mode where filenames and modules matching are\nmandatory.\"\"\"\n            )\n        elif (\n            isStandaloneMode() and os.path.basename(output_filename) != output_filename\n        ):\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, output filename for standalone cannot contain a directory part.\"\"\"\n            )\n\n        output_dir = os.path.dirname(output_filename) or \".\"\n\n        if not os.path.isdir(output_dir):\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, specified output directory does not exist, you have to create\nit before using it: '%s' (from --output-filename='%s').\"\"\"\n                % (\n                    output_dir,\n                    output_filename,\n                )\n            )\n\n    if isLinux():\n        if len(getLinuxIconPaths()) > 1:\n            Tracing.options_logger.sysexit(\n                \"Error, can only use one icon file on Linux.\"\n            )\n\n    if isMacOS():\n        if len(getMacOSIconPaths()) > 1:\n            Tracing.options_logger.sysexit(\n                \"Error, can only use one icon file on macOS.\"\n            )\n\n    for icon_path in getWindowsIconPaths():\n        if \"#\" in icon_path and isWin32Windows():\n            icon_path, icon_index = icon_path.rsplit(\"#\", 1)\n\n            if not icon_index.isdigit() or int(icon_index) < 0:\n                Tracing.options_logger.sysexit(\n                    \"Error, icon number in '%s#%s' not valid.\"\n                    % (icon_path + \"#\" + icon_index)\n                )\n\n        if getWindowsIconExecutablePath():\n            Tracing.options_logger.sysexit(\n                \"Error, can only use icons from template executable or from icon files, but not both.\"\n            )\n\n    icon_exe_path = getWindowsIconExecutablePath()\n    if icon_exe_path is not None and not os.path.exists(icon_exe_path):\n        Tracing.options_logger.sysexit(\n            \"Error, icon path executable '%s' does not exist.\" % icon_exe_path\n        )\n\n    if isMacOS() and not shallCreateAppBundle() and shallDisableConsoleWindow():\n        Tracing.options_logger.sysexit(\n            \"Error, cannot disable console unless also using '--macos-create-app-bundle'.\"\n        )\n\n    try:\n        file_version = getFileVersionTuple()\n    # Catch all the things, don't want any interface, pylint: disable=broad-except\n    except Exception:\n        Tracing.options_logger.sysexit(\n            \"Error, file version must be a tuple of up to 4 integer values.\"\n        )\n\n    try:\n        product_version = getProductVersionTuple()\n    # Catch all the things, don't want any interface, pylint: disable=broad-except\n    except Exception:\n        Tracing.options_logger.sysexit(\n            \"Error, product version must be a tuple of up to 4 integer values.\"\n        )\n\n    if getCompanyName() == \"\":\n        Tracing.options_logger.sysexit(\n            \"\"\"Error, empty string is not an acceptable company name.\"\"\"\n        )\n\n    if getProductName() == \"\":\n        Tracing.options_logger.sysexit(\n            \"\"\"Error, empty string is not an acceptable product name.\"\"\"\n        )\n\n    splash_screen_filename = getWindowsSplashScreen()\n\n    if splash_screen_filename is not None:\n        if not os.path.isfile(splash_screen_filename):\n            Tracing.options_logger.sysexit(\n                \"Error, specified splash screen image '%s' does not exist.\"\n                % splash_screen_filename\n            )\n\n    if (\n        file_version\n        or product_version\n        or getWindowsVersionInfoStrings()\n        and isWin32Windows()\n    ):\n        if not (file_version or product_version) and getCompanyName():\n            Tracing.options_logger.sysexit(\n                \"Error, company name and file or product version need to be given when any version information is given.\"\n            )\n\n    if isOnefileMode() and not hasOnefileSupportedOS():\n        Tracing.options_logger.sysexit(\n            \"Error, unsupported OS for onefile '%s'.\" % getOS()\n        )\n\n    for module_pattern, _filename_pattern in getShallIncludePackageData():\n        if (\n            module_pattern.startswith(\"-\")\n            or \"/\" in module_pattern\n            or \"\\\\\" in module_pattern\n        ):\n            Tracing.options_logger.sysexit(\n                \"Error, '--include-package-data' needs module name or pattern as an argument, not '%s'.\"\n                % module_pattern\n            )\n\n    for module_pattern in getShallFollowModules():\n        if (\n            module_pattern.startswith(\"-\")\n            or \"/\" in module_pattern\n            or \"\\\\\" in module_pattern\n        ):\n            Tracing.options_logger.sysexit(\n                \"Error, '--follow-import-to' options needs module name or pattern as an argument, not '%s'.\"\n                % module_pattern\n            )\n    for module_pattern in getShallFollowInNoCase():\n        if (\n            module_pattern.startswith(\"-\")\n            or \"/\" in module_pattern\n            or \"\\\\\" in module_pattern\n        ):\n            Tracing.options_logger.sysexit(\n                \"Error, '--nofollow-import-to' options needs module name or pattern as an argument, not '%s'.\"\n                % module_pattern\n            )\n\n    for data_file_desc in options.data_files:\n        if \"=\" not in data_file_desc:\n            Tracing.options_logger.sysexit(\n                \"Error, malformed data file description, must specify relative target path separated with '='.\"\n            )\n\n        if data_file_desc.count(\"=\") == 1:\n            src, dst = data_file_desc.split(\"=\", 1)\n            src = os.path.expanduser(src)\n            src_pattern = src\n        else:\n            src, dst, pattern = data_file_desc.split(\"=\", 2)\n            src = os.path.expanduser(src)\n            src_pattern = os.path.join(src, pattern)\n\n        filenames = resolveShellPatternToFilenames(src_pattern)\n\n        if len(filenames) > 1 and not dst.endswith((\"/\", os.path.sep)):\n            Tracing.options_logger.sysexit(\n                \"Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory.\"\n                % src\n            )\n\n        if not filenames:\n            Tracing.options_logger.sysexit(\n                \"Error, '%s' does not match any files.\" % src\n            )\n\n        if os.path.isabs(dst):\n            Tracing.options_logger.sysexit(\n                \"Error, must specify relative target path for data file, not absolute path '%s'.\"\n                % data_file_desc\n            )\n\n    for data_dir in options.data_dirs:\n        if \"=\" not in data_dir:\n            Tracing.options_logger.sysexit(\n                \"Error, malformed data dir description, must specify relative target path with '=' separating it.\"\n            )\n\n        src, dst = data_dir.split(\"=\", 1)\n\n        if os.path.isabs(dst):\n            Tracing.options_logger.sysexit(\n                \"Error, must specify relative target path for data dir, not '%s' as in '%s'.\"\n                % (dst, data_dir)\n            )\n\n        if not os.path.isdir(src):\n            Tracing.options_logger.sysexit(\n                \"Error, must specify existing source data directory, not '%s' as in '%s'.\"\n                % (dst, data_dir)\n            )\n\n    for pattern in getShallFollowExtraFilePatterns():\n        if os.path.isdir(pattern):\n            Tracing.options_logger.sysexit(\n                \"Error, pattern '%s' given to '--include-plugin-files' cannot be a directory name.\"\n                % pattern\n            )\n\n    for directory_name in getShallFollowExtra():\n        if not os.path.isdir(directory_name):\n            Tracing.options_logger.sysexit(\n                \"Error, value '%s' given to '--include-plugin-directory' must be a directory name.\"\n                % directory_name\n            )\n\n        if isStandardLibraryPath(directory_name):\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, directory '%s' given to '--include-plugin-directory' must not be a \\\nstandard library path. Use '--include-module' or '--include-package' \\\noptions instead.\"\"\"\n                % pattern\n            )\n\n    if options.static_libpython == \"yes\" and getSystemStaticLibPythonPath() is None:\n        Tracing.options_logger.sysexit(\n            \"Error, static libpython is not found or not supported for this Python installation.\"\n        )\n\n    if shallUseStaticLibPython() and getSystemStaticLibPythonPath() is None:\n        Tracing.options_logger.sysexit(\n            \"\"\"Error, usable static libpython is not found for this Python installation. You \\\nmight be missing required packages. Disable with --static-libpython=no\" if you don't \\\nwant to install it.\"\"\"\n        )\n\n    if isApplePython():\n        if isStandaloneMode():\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, on macOS, for standalone mode, Apple Python is not supported \\\ndue to being tied to specific OS releases, use e.g. CPython instead \\\nwhich is available from https://www.python.org/downloads/macos/ for \\\ndownload. With that, your program will work on macOS 10.9 or higher.\"\"\"\n            )\n\n        if str is bytes:\n            Tracing.options_logger.sysexit(\n                \"Error, Apple Python 2.7 from macOS is not usable as per Apple decision, use e.g. CPython 2.7 instead.\"\n            )\n\n    if isStandaloneMode() and isLinux() and getExecutablePath(\"patchelf\") is None:\n        Tracing.options_logger.sysexit(\n            \"Error, standalone mode on Linux requires 'patchelf' to be installed. Use 'apt/dnf/yum install patchelf' first.\"\n        )\n\n    pgo_executable = getPgoExecutable()\n    if pgo_executable and not isPathExecutable(pgo_executable):\n        Tracing.options_logger.sysexit(\n            \"Error, path '%s' to binary to use for PGO is not executable.\"\n            % pgo_executable\n        )\n\n    if (\n        isOnefileMode()\n        and isTermuxPython()\n        and getExecutablePath(\"termux-elf-cleaner\") is None\n    ):\n        Tracing.options_logger.sysexit(\n            \"\"\"\\\nError, onefile mode on Termux requires 'termux-elf-cleaner' to be installed, \\\nuse 'pkg install termux-elf-cleaner' to use it.\"\"\"\n        )\n\n    for user_yaml_filename in getUserProvidedYamlFiles():\n        if not os.path.exists(user_yaml_filename):\n            Tracing.options_logger.sysexit(\n                \"\"\"\\\nError, cannot find user provider yaml file '%s'.\"\"\"\n                % user_yaml_filename\n            )\n\n    # This triggers checks inside that code\n    getCompilationReportUserData()\n\n\ndef commentArgs():\n    \"\"\"Comment on options, where we know something is not having the intended effect.\n\n    :meta private:\n\n    \"\"\"\n    # A ton of cases to consider, pylint: disable=too-many-branches,too-many-statements\n\n    # Check files to exist or be suitable first before giving other warnings.\n    for filename in getMainEntryPointFilenames():\n        if not os.path.exists(filename):\n            Tracing.general.sysexit(\"Error, file '%s' is not found.\" % filename)\n\n        if (\n            shallMakeModule()\n            and os.path.normcase(os.path.basename(filename)) == \"__init__.py\"\n        ):\n            Tracing.general.sysexit(\n                \"\"\"\\\nError, to compile a package, specify its directory but, not the '__init__.py'.\"\"\"\n            )\n\n    # Inform the user about potential issues with the running version. e.g. unsupported\n    # version.\n    if python_version_str not in getSupportedPythonVersions():\n        # Do not disturb run of automatic tests with, detected from the presence of\n        # that environment variable.\n        if \"PYTHON\" not in os.environ:\n            Tracing.general.warning(\n                \"\"\"\\\nThe Python version '%s' is only experimentally supported by Nuitka '%s', \\\nbut an upcoming release will change that. In the mean time use Python \\\nversion '%s' instead or newer Nuitka.\"\"\"\n                % (\n                    python_version_str,\n                    getNuitkaVersion(),\n                    getSupportedPythonVersions()[-1],\n                )\n            )\n\n    if python_version_str in getNotYetSupportedPythonVersions():\n        if not isExperimental(\"python\" + python_version_str):\n            Tracing.general.sysexit(\n                \"\"\"\\\nThe Python version '%s' is not supported by Nuitka '%s', but an upcoming \\\nrelease will add it. In the mean time use '%s' instead.\"\"\"\n                % (\n                    python_version_str,\n                    getNuitkaVersion(),\n                    getSupportedPythonVersions()[-1],\n                )\n            )\n\n    default_reference_mode = (\n        \"runtime\" if shallMakeModule() or isStandaloneMode() else \"original\"\n    )\n\n    if getFileReferenceMode() is None:\n        options.file_reference_mode = default_reference_mode\n    else:\n        if options.file_reference_mode != default_reference_mode:\n            Tracing.options_logger.warning(\n                \"Using non-default file reference mode '%s' rather than '%s' may cause run time issues.\"\n                % (getFileReferenceMode(), default_reference_mode)\n            )\n        else:\n            Tracing.options_logger.info(\n                \"Using default file reference mode '%s' need not be specified.\"\n                % default_reference_mode\n            )\n\n    default_mode_name_mode = \"runtime\" if shallMakeModule() else \"original\"\n\n    if getModuleNameMode() is None:\n        options.module_name_mode = default_mode_name_mode\n    elif getModuleNameMode() == default_mode_name_mode:\n        Tracing.options_logger.info(\n            \"Using module name mode '%s' need not be specified.\"\n            % default_mode_name_mode\n        )\n\n    # TODO: Not all of these are usable with MSYS2 really, split those off.\n    if not isWin32OrPosixWindows():\n        # Too many Windows specific options clearly\n        if (\n            getWindowsIconExecutablePath()\n            or shallAskForWindowsAdminRights()\n            or shallAskForWindowsUIAccessRights()\n            or getWindowsSplashScreen()\n        ):\n            Tracing.options_logger.warning(\n                \"Using Windows specific options has no effect on other platforms.\"\n            )\n\n        if options.mingw64 or options.msvc_version:\n            Tracing.options_logger.warning(\n                \"Requesting Windows specific compilers has no effect on other platforms.\"\n            )\n\n    if options.msvc_version:\n        if isMSYS2MingwPython() or isPosixWindows():\n            Tracing.options_logger.sysexit(\"Requesting MSVC on MSYS2 is not allowed.\")\n\n        if isMingw64():\n            Tracing.options_logger.sysexit(\n                \"Requesting both Windows specific compilers makes no sense.\"\n            )\n\n    if getMsvcVersion() and getMsvcVersion() not in (\"list\", \"latest\"):\n        if getMsvcVersion().count(\".\") != 1 or not all(\n            x.isdigit() for x in getMsvcVersion().split(\".\")\n        ):\n            Tracing.options_logger.sysexit(\n                \"For --msvc only values 'latest', 'info', and 'X.Y' values are allowed, but not '%s'.\"\n                % getMsvcVersion()\n            )\n\n    try:\n        getJobLimit()\n    except ValueError:\n        Tracing.options_logger.sysexit(\n            \"For --jobs value, use positive integer values only, not, but not '%s'.\"\n            % options.jobs\n        )\n\n    if isOnefileMode():\n        standalone_mode = \"onefile\"\n    elif isStandaloneMode():\n        standalone_mode = \"standalone\"\n    else:\n        standalone_mode = None\n\n    if standalone_mode and not hasStandaloneSupportedOS():\n        Tracing.options_logger.warning(\n            \"Standalone mode on %s is not known to be supported, might fail to work.\"\n            % getOS()\n        )\n\n    if options.follow_all is True and shallMakeModule():\n        Tracing.optimization_logger.sysexit(\n            \"\"\"\\\nIn module mode you must follow modules more selectively, and e.g. should \\\nnot include standard library or all foreign modules or else it will fail \\\nto work. You need to instead selectively add them with \\\n'--follow-import-to=name' though.\"\"\"\n        )\n\n    if options.follow_all is True and standalone_mode:\n        Tracing.options_logger.info(\n            \"Following all imports is the default for %s mode and need not be specified.\"\n            % standalone_mode\n        )\n\n    if options.follow_all is False and standalone_mode:\n        Tracing.options_logger.warning(\n            \"Following no imports is unlikely to work for %s mode and should not be specified.\"\n            % standalone_mode\n        )\n\n    if options.follow_stdlib:\n        if standalone_mode:\n            Tracing.options_logger.warning(\n                \"Following imports to stdlib is the default in standalone mode..\"\n            )\n        else:\n            Tracing.options_logger.warning(\n                \"Following imports to stdlib not well tested and should not be specified.\"\n            )\n\n    if (\n        not standalone_mode\n        and options.follow_all is None\n        and not options.follow_modules\n        and not options.follow_stdlib\n        and not options.include_modules\n        and not options.include_packages\n        and not options.include_extra\n        and not options.follow_not_modules\n    ):\n        Tracing.options_logger.warning(\n            \"\"\"You did not specify to follow or include anything but main %s. Check options and \\\nmake sure that is intended.\"\"\"\n            % (\"module\" if shallMakeModule() else \"program\")\n        )\n\n    if options.dependency_tool:\n        Tracing.options_logger.warning(\n            \"Using removed option '--windows-dependency-tool' is deprecated and has no impact anymore.\"\n        )\n\n    if shallMakeModule() and options.static_libpython == \"yes\":\n        Tracing.options_logger.warning(\n            \"In module mode, providing '--static-libpython' has no effect, it's not used.\"\n        )\n\n        options.static_libpython = \"no\"\n\n    if (\n        not isPgoMode()\n        and not isPythonPgoMode()\n        and (getPgoArgs() or getPgoExecutable())\n    ):\n        Tracing.optimization_logger.warning(\n            \"Providing PGO arguments without enabling PGO mode has no effect.\"\n        )\n\n    if isPgoMode():\n        if isStandaloneMode():\n            Tracing.optimization_logger.warning(\n                \"Using PGO with standalone/onefile mode is not currently working. Expect errors.\"\n            )\n\n        if shallMakeModule():\n            Tracing.optimization_logger.warning(\n                \"Using PGO with module mode is not currently working. Expect errors.\"\n            )\n\n    if (\n        options.static_libpython == \"auto\"\n        and not shallMakeModule()\n        and not shallUseStaticLibPython()\n        and getSystemStaticLibPythonPath() is not None\n        and not shallUsePythonDebug()\n    ):\n        Tracing.options_logger.info(\n            \"\"\"Detected static libpython to exist, consider '--static-libpython=yes' for better performance, \\\nbut errors may happen.\"\"\"\n        )\n\n    if not shallExecuteImmediately():\n        if shallRunInDebugger():\n            Tracing.options_logger.warning(\n                \"The '--debugger' option has no effect outside of '--debug' without '--run' option.\"\n            )\n\n    # Check if the fallback is used, except for Python2 on Windows, where we cannot\n    # have it.\n    if hasattr(OrderedSet, \"is_fallback\") and not (\n        isWin32Windows() and python_version < 0x360\n    ):\n        # spell-checker: ignore orderedset\n        Tracing.general.warning(\n            \"\"\"\\\nUsing very slow fallback for ordered sets, please install '%s' \\\nPyPI package for best Python compile time performance.\"\"\"\n            % (\"ordered-set\" if python_version >= 0x370 else \"orderedset\")\n        )\n\n    if shallUsePythonDebug() and not isDebugPython():\n        Tracing.general.sysexit(\n            \"\"\"\\\nError, for using the debug Python version, you need to run it will that version\nand not with the non-debug version.\n\"\"\"\n        )\n\n    if (\n        isMacOS()\n        and shallCreateAppBundle()\n        and shallDisableConsoleWindow()\n        and not getMacOSIconPaths()\n    ):\n        Tracing.general.warning(\n            \"\"\"\\\nFor GUI applications, you ought to specify an icon with '--macos-app-icon'.\", \\\notherwise a dock icon may not be present.\"\"\"\n        )\n\n    if (\n        isMacOS()\n        and shallUseSigningForNotarization()\n        and getMacOSSigningIdentity() == \"-\"\n    ):\n        Tracing.general.sysexit(\n            \"\"\"\\\nError, need to provide signing identity with '--macos-sign-identity' for \\\nnotarization capable signature, the default identify 'ad-hoc' is not going \\\nto work.\"\"\"\n        )\n\n    if (\n        isWin32Windows()\n        and 0x340 <= python_version < 0x380\n        and not shallDisableConsoleWindow()\n    ):\n        Tracing.general.warning(\n            \"\"\"\\\nOn Windows, support for input/output on the console Windows, does \\\nnot work on non-UTF8 systems, unless Python 3.8 or higher is used \\\nbut this is %s, so please consider upgrading, or disabling the \\\nconsole window for deployment.\n\"\"\"\n            % python_version_str,\n            mnemonic=\"old-python-windows-console\",\n        )\n\n\ndef isVerbose():\n    \"\"\":returns: bool derived from ``--verbose``\"\"\"\n    return options is not None and options.verbose\n\n\ndef shallTraceExecution():\n    \"\"\":returns: bool derived from ``--trace-execution``\"\"\"\n    return options.trace_execution\n\n\ndef shallExecuteImmediately():\n    \"\"\":returns: bool derived from ``--run``\"\"\"\n    return options.immediate_execution\n\n\ndef shallRunInDebugger():\n    \"\"\":returns: bool derived from ``--debug``\"\"\"\n    return options.debugger\n\n\ndef getXMLDumpOutputFilename():\n    \"\"\":returns: str derived from ``--xml``\"\"\"\n    return options.xml_output\n\n\ndef shallOnlyExecCCompilerCall():\n    \"\"\":returns: bool derived from ``--recompile-c-only``\"\"\"\n    return options.recompile_c_only\n\n\ndef shallNotDoExecCCompilerCall():\n    \"\"\":returns: bool derived from ``--generate-c-only``\"\"\"\n    return options.generate_c_only\n\n\ndef getFileReferenceMode():\n    \"\"\"*str*, one of \"runtime\", \"original\", \"frozen\", coming from ``--file-reference-choice``\n\n    Notes:\n        Defaults to runtime for modules and packages, as well as standalone binaries,\n        otherwise original is kept.\n    \"\"\"\n\n    return options.file_reference_mode\n\n\ndef getModuleNameMode():\n    \"\"\"*str*, one of \"runtime\", \"original\", coming from ``--module-name-choice``\n\n    Notes:\n        Defaults to runtime for modules and packages, otherwise original is kept.\n    \"\"\"\n\n    return options.module_name_mode\n\n\ndef shallMakeModule():\n    \"\"\":returns: bool derived from ``--module``\"\"\"\n    return options.module_mode\n\n\ndef shallCreatePyiFile():\n    \"\"\"*bool* = **not** ``--no-pyi-file``\"\"\"\n    return options.pyi_file\n\n\ndef isAllowedToReexecute():\n    \"\"\"*bool* = **not** ``--must-not-re-execute``\"\"\"\n    return options.allow_reexecute\n\n\ndef shallFollowStandardLibrary():\n    \"\"\":returns: bool derived from ``--follow-stdlib``\"\"\"\n    return options.follow_stdlib\n\n\ndef shallFollowNoImports():\n    \"\"\":returns: bool derived from ``--nofollow-imports``\"\"\"\n    return options.follow_all is False\n\n\ndef shallFollowAllImports():\n    \"\"\":returns: bool derived from ``--follow-imports``\"\"\"\n    return options.is_standalone or options.follow_all is True\n\n\ndef _splitShellPattern(value):\n    return value.split(\",\") if \"{\" not in value else [value]\n\n\ndef getShallFollowInNoCase():\n    \"\"\"*list*, items of ``--nofollow-import-to=``\"\"\"\n    return sum([_splitShellPattern(x) for x in options.follow_not_modules], [])\n\n\ndef getShallFollowModules():\n    \"\"\"*list*, items of ``--follow-import-to=`` amended with what ``--include-module`` and ``--include-package`` got\"\"\"\n    return sum(\n        [\n            _splitShellPattern(x)\n            for x in options.follow_modules\n            + options.include_modules\n            + options.include_packages\n        ],\n        [],\n    )\n\n\ndef getShallFollowExtra():\n    \"\"\"*list*, items of ``--include-plugin-directory=``\"\"\"\n    return sum([_splitShellPattern(x) for x in options.include_extra], [])\n\n\ndef getShallFollowExtraFilePatterns():\n    \"\"\"*list*, items of ``--include-plugin-files=``\"\"\"\n    return sum([_splitShellPattern(x) for x in options.include_extra_files], [])\n\n\ndef getMustIncludeModules():\n    \"\"\"*list*, items of ``--include-module=``\"\"\"\n    return sum([_splitShellPattern(x) for x in options.include_modules], [])\n\n\ndef getMustIncludePackages():\n    \"\"\"*list*, items of ``--include-package=``\"\"\"\n    return sum([_splitShellPattern(x) for x in options.include_packages], [])\n\n\ndef getShallIncludeDistributionMetadata():\n    \"\"\"*list*, items of ``--include-distribution-metadata=``\"\"\"\n    return sum(\n        [_splitShellPattern(x) for x in options.include_distribution_metadata], []\n    )\n\n\ndef getShallIncludePackageData():\n    \"\"\"*iterable of (module name, filename pattern)*, derived from ``--include-package-data=``\n\n    The filename pattern can be None if not given. Empty values give None too.\n    \"\"\"\n    for package_data_pattern in sum(\n        [_splitShellPattern(x) for x in options.package_data], []\n    ):\n        if \":\" in package_data_pattern:\n            module_pattern, filename_pattern = package_data_pattern.split(\":\", 1)\n            # Empty equals None.\n            filename_pattern = filename_pattern or None\n        else:\n            module_pattern = package_data_pattern\n            filename_pattern = None\n\n        yield module_pattern, filename_pattern\n\n\ndef getShallIncludeDataFiles():\n    \"\"\"*list*, items of ``--include-data-files=``\"\"\"\n    for data_file_desc in options.data_files:\n        if data_file_desc.count(\"=\") == 1:\n            src, dest = data_file_desc.split(\"=\", 1)\n\n            for pattern in _splitShellPattern(src):\n                pattern = os.path.expanduser(pattern)\n\n                yield pattern, None, dest, data_file_desc\n        else:\n            src, dest, pattern = data_file_desc.split(\"=\", 2)\n\n            for pattern in _splitShellPattern(pattern):\n                pattern = os.path.expanduser(pattern)\n\n                yield os.path.join(src, pattern), src, dest, data_file_desc\n\n\ndef getShallIncludeDataDirs():\n    \"\"\"*list*, items of ``--include-data-dir=``\"\"\"\n    for data_file in options.data_dirs:\n        src, dest = data_file.split(\"=\", 1)\n\n        yield src, dest\n\n\ndef getShallNotIncludeDataFilePatterns():\n    \"\"\"*list*, items of ``--noinclude-data-files=``\"\"\"\n\n    return options.data_files_inhibited\n\n\ndef getShallIncludeExternallyDataFilePatterns():\n    \"\"\"*list*, items of ``--include-onefile-external-data=``\"\"\"\n\n    return options.data_files_external\n\n\ndef getShallNotIncludeDllFilePatterns():\n    \"\"\"*list*, items of ``--noinclude-dlls=``\"\"\"\n\n    return options.dll_files_inhibited\n\n\ndef shallWarnImplicitRaises():\n    \"\"\":returns: bool derived from ``--warn-implicit-exceptions``\"\"\"\n    return options.warn_implicit_exceptions\n\n\ndef shallWarnUnusualCode():\n    \"\"\":returns: bool derived from ``--warn-unusual-code``\"\"\"\n    return options.warn_unusual_code\n\n\ndef assumeYesForDownloads():\n    \"\"\":returns: bool derived from ``--assume-yes-for-downloads``\"\"\"\n    return options is not None and options.assume_yes_for_downloads\n\n\ndef _isDebug():\n    \"\"\":returns: bool derived from ``--debug`` or ``--debugger``\"\"\"\n    return options is not None and (options.debug or options.debugger)\n\n\ndef shallUsePythonDebug():\n    \"\"\":returns: bool derived from ``--python-debug`` or ``sys.flags.debug``\n\n    Passed to Scons as ``python_debug`` so it can consider it when picking\n    link libraries to choose the correct variant. Also enables the define\n    ``Py_DEBUG`` for C headers. Reference counting checks and other debug\n    asserts of Python will happen in this mode.\n\n    \"\"\"\n    return options.python_debug or sys.flags.debug\n\n\ndef isUnstripped():\n    \"\"\":returns: bool derived from ``--unstripped`` or ``--profile``\n\n    A binary is called stripped when debug information is not present, an\n    unstripped when it is present. For profiling and debugging it will be\n    necessary, but it doesn't enable debug checks like ``--debug`` does.\n\n    Passed to Scons as ``unstripped_mode`` to it can ask the linker to\n    include symbol information.\n    \"\"\"\n    return options.unstripped or options.profile or is_debug\n\n\ndef isProfile():\n    \"\"\":returns: bool derived from ``--profile``\"\"\"\n    return options.profile\n\n\ndef shallCreateGraph():\n    \"\"\":returns: bool derived from ``--internal-graph``\"\"\"\n    return options.internal_graph\n\n\ndef getOutputFilename():\n    \"\"\"*str*, value of \"-o\" \"\"\"\n    return options.output_filename\n\n\ndef getOutputPath(path):\n    \"\"\"Return output pathname of a given path (filename).\"\"\"\n    if options.output_dir:\n        return os.path.normpath(os.path.join(options.output_dir, path))\n    else:\n        return path\n\n\ndef getOutputDir():\n    \"\"\"*str*, value of ``--output-dir`` or \".\" \"\"\"\n    return options.output_dir if options.output_dir else \".\"\n\n\ndef getPositionalArgs():\n    \"\"\"*tuple*, command line positional arguments\"\"\"\n    return tuple(positional_args)\n\n\ndef getMainArgs():\n    \"\"\"*tuple*, arguments following the optional arguments\"\"\"\n    return tuple(extra_args)\n\n\ndef getMainEntryPointFilenames():\n    \"\"\"*tuple*, main programs, none, one or more\"\"\"\n    if options.mains:\n        if len(options.mains) == 1:\n            assert not positional_args\n\n        result = tuple(options.mains)\n    else:\n        result = (positional_args[0],)\n\n    return tuple(os.path.normpath(r).rstrip(os.path.sep) for r in result)\n\n\ndef shallOptimizeStringExec():\n    \"\"\"Inactive yet\"\"\"\n    return False\n\n\n_shall_use_static_lib_python = None\n\n\ndef _shallUseStaticLibPython():\n    # return driven, pylint: disable=too-many-return-statements\n\n    if shallMakeModule():\n        return False, \"not used in module mode\"\n\n    if options.static_libpython == \"auto\":\n        # Nuitka-Python is good to to static linking.\n        if isNuitkaPython():\n            return True, \"Nuitka-Python is unexpectedly broken.\"\n\n        if isHomebrewPython():\n            return True, \"Homebrew Python is unexpectedly broken.\"\n\n        # Debian packages with are usable if the OS is new enough\n        from nuitka.utils.StaticLibraries import (\n            isDebianSuitableForStaticLinking,\n        )\n\n        if (\n            isDebianBasedLinux()\n            and isDebianPackagePython()\n            and isDebianSuitableForStaticLinking()\n            and not shallUsePythonDebug()\n        ):\n            return True, \"Nuitka on Debian-Python needs package '%s' installed.\" % (\n                \"python2-dev\" if str is bytes else \"python3-dev\"\n            )\n\n        if isMSYS2MingwPython():\n            return True, \"Nuitka on MSYS2 needs package 'python-devel' installed.\"\n\n        # For Anaconda default to trying static lib python library, which\n        # normally is just not available or if it is even unusable.\n        if isAnacondaPython() and not isMacOS() and not isWin32Windows():\n            return (\n                True,\n                \"Nuitka on Anaconda needs package for static libpython installed. Execute 'conda install libpython-static'.\",\n            )\n\n        if isPyenvPython():\n            return True, \"Nuitka on pyenv should not use '--enable-shared'.\"\n\n        if isManyLinuxPython():\n            return (\n                True,\n                \"\"\"\\\nNuitka on 'manylinux' has no shared libraries. Use container with \\\nthe command 'RUN cd /opt/_internal && tar xf static-libs-for-embedding-only.tar.xz' \\\nadded to provide the static link library.\"\"\",\n            )\n\n        if isMacOS() and isCPythonOfficialPackage():\n            return True, None\n\n        if isArchPackagePython():\n            return True, None\n\n    return options.static_libpython == \"yes\", None\n\n\ndef shallUseStaticLibPython():\n    \"\"\":returns: bool derived from ``--static-libpython=yes|auto`` and not module mode\n\n    Notes:\n        Currently only Anaconda on non-Windows can do this and MSYS2.\n    \"\"\"\n\n    global _shall_use_static_lib_python  # singleton, pylint: disable=global-statement\n\n    if _shall_use_static_lib_python is None:\n        _shall_use_static_lib_python, reason = _shallUseStaticLibPython()\n\n        if _shall_use_static_lib_python and reason:\n            static_libpython = getSystemStaticLibPythonPath()\n\n            if not static_libpython:\n                Tracing.options_logger.sysexit(\n                    \"\"\"\\\nAutomatic detection of static libpython failed. %s Disable with '--static-libpython=no' if you don't \\\nwant to install it.\"\"\"\n                    % reason\n                )\n\n    return _shall_use_static_lib_python\n\n\ndef shallTreatUninstalledPython():\n    \"\"\"*bool* = derived from Python installation and modes\n\n    Notes:\n        Not done for standalone mode obviously. The Python DLL will\n        be a dependency of the executable and treated that way.\n\n        Also not done for extension modules, they are loaded with\n        a Python runtime available.\n\n        Most often uninstalled Python versions are self compiled or\n        from Anaconda.\n    \"\"\"\n\n    if shallMakeModule() or isStandaloneMode():\n        return False\n\n    return isUninstalledPython()\n\n\ndef shallCreateCmdFileForExecution():\n    \"\"\"*bool* = derived from Python installation and modes\n\n    Notes: Mostly for accelerated mode on Windows with uninstalled python, to\n    make sure they find their Python DLL.\n    \"\"\"\n    return isWin32Windows() and shallTreatUninstalledPython()\n\n\ndef isShowScons():\n    \"\"\":returns: bool derived from ``--show-scons``\"\"\"\n    return options.show_scons\n\n\ndef getJobLimit():\n    \"\"\"*int*, value of ``--jobs`` / \"-j\" or number of CPU kernels\"\"\"\n    if options.jobs is None:\n        if isLowMemory():\n            return 1\n        else:\n            return getCPUCoreCount()\n\n    result = int(options.jobs)\n\n    if result <= 0:\n        raise ValueError(result)\n\n    return result\n\n\ndef getLtoMode():\n    \"\"\":returns: bool derived from ``--lto`` or ``--pgo``\"\"\"\n    return options.lto\n\n\ndef isClang():\n    \"\"\":returns: bool derived from ``--clang`` or enforced by platform, e.g. macOS or FreeBSD some targets.\"\"\"\n\n    return (\n        options.clang\n        or isMacOS()\n        or isOpenBSD()\n        or (isFreeBSD() and getArchitecture() != \"powerpc\")\n        or isTermuxPython()\n    )\n\n\ndef isMingw64():\n    \"\"\":returns: bool derived from ``--mingw64``, available only on Windows, otherwise false\"\"\"\n    if isWin32Windows():\n        return options.mingw64 or isMSYS2MingwPython()\n    else:\n        return None\n\n\ndef getMsvcVersion():\n    \"\"\":returns: str derived from ``--msvc`` on Windows, otherwise None\"\"\"\n    if isWin32Windows():\n        return options.msvc_version\n    else:\n        return None\n\n\ndef shallCleanCache(cache_name):\n    \"\"\":returns: bool derived from ``--clean-cache``\"\"\"\n\n    if cache_name == \"clcache\":\n        cache_name = \"ccache\"\n\n    return \"all\" in options.clean_caches or cache_name in options.clean_caches\n\n\ndef shallDisableCacheUsage(cache_name):\n    \"\"\":returns: bool derived from ``--disable-cache``\"\"\"\n    if options is None:\n        return False\n\n    return \"all\" in options.disabled_caches or cache_name in options.disabled_caches\n\n\ndef shallDisableCCacheUsage():\n    \"\"\":returns: bool derived from ``--disable-ccache`` or ``--disable--cache=ccache``\"\"\"\n    return shallDisableCacheUsage(\"ccache\")\n\n\ndef shallDisableBytecodeCacheUsage():\n    \"\"\":returns: bool derived from ``--disable-bytecode-cache``\"\"\"\n    return shallDisableCacheUsage(\"bytecode\")\n\n\ndef shallDisableCompressionCacheUsage():\n    \"\"\":returns: bool derived from ``--disable-cache=compression``\"\"\"\n    return shallDisableCacheUsage(\"compression\")\n\n\ndef shallDisableConsoleWindow():\n    \"\"\":returns: None (not given), False, or True derived from ``--disable-console or ``--enable-console``\"\"\"\n    return options.disable_console\n\n\ndef mayDisableConsoleWindow():\n    \"\"\":returns: bool derived from platform support of disabling the console,\"\"\"\n\n    # TODO: What about MSYS2?\n    return isWin32Windows() or isMacOS()\n\n\ndef _isFullCompat():\n    \"\"\":returns: bool derived from ``--full-compat``\n\n    Notes:\n        Code should should use \"Options.is_full_compat\" instead, this\n        is only used to initialize that value.\n    \"\"\"\n    return options is not None and not options.improved\n\n\ndef isShowProgress():\n    \"\"\":returns: bool derived from ``--show-progress``\"\"\"\n    return options is not None and options.show_progress\n\n\ndef isShowMemory():\n    \"\"\":returns: bool derived from ``--show-memory``\"\"\"\n    return options is not None and options.show_memory\n\n\ndef isShowInclusion():\n    \"\"\":returns: bool derived from ``--show-modules``\"\"\"\n    return options.show_inclusion\n\n\ndef isRemoveBuildDir():\n    \"\"\":returns: bool derived from ``--remove-output``\"\"\"\n    return options.remove_build and not options.generate_c_only\n\n\ndef isDeploymentMode():\n    \"\"\":returns: bool derived from ``--deployment``\"\"\"\n    return options.is_deployment\n\n\ndef getNoDeploymentIndications():\n    \"\"\":returns: list derived from ``--no-deployment-flag``\"\"\"\n    return options.no_deployment_flags\n\n\n_experimental = set()\n\n\ndef isExperimental(indication):\n    \"\"\"Check whether a given experimental feature is enabled.\n\n    Args:\n        indication: (str) feature name\n    Returns:\n        bool\n    \"\"\"\n    return indication in _experimental\n\n\ndef enableExperimental(indication):\n    _experimental.add(indication)\n\n\ndef getExperimentalIndications():\n    \"\"\"*tuple*, items of ``--experimental=``\"\"\"\n    if hasattr(options, \"experimental\"):\n        return options.experimental\n    else:\n        return ()\n\n\ndef shallExplainImports():\n    \"\"\":returns: bool derived from ``--explain-imports``\"\"\"\n    return options is not None and options.explain_imports\n\n\ndef isStandaloneMode():\n    \"\"\":returns: bool derived from ``--standalone``\"\"\"\n    return options.is_standalone\n\n\ndef isOnefileMode():\n    \"\"\":returns: bool derived from ``--onefile``\"\"\"\n    return options.is_onefile\n\n\ndef isAcceleratedMode():\n    \"\"\":returns: bool derived from ``--standalone`` and `--module`\"\"\"\n    return not isStandaloneMode() and not shallMakeModule()\n\n\ndef isOnefileTempDirMode():\n    \"\"\":returns: bool derived from ``--onefile-tempdir-spec``\n\n    Notes:\n        Using cached onefile execution when the spec doesn't contain\n        volatile things.\n    \"\"\"\n    spec = getOnefileTempDirSpec()\n\n    for candidate in (\n        \"{PID}\",\n        \"{TIME}\",\n        \"{PROGRAM}\",\n        \"{PROGRAM_BASE}\",\n    ):\n        if candidate in spec:\n            return True\n\n    return False\n\n\ndef isPgoMode():\n    \"\"\":returns: bool derived from ``--pgo``\"\"\"\n    return options.is_c_pgo\n\n\ndef isPythonPgoMode():\n    \"\"\":returns: bool derived from ``--pgo-python``\"\"\"\n    return options.is_python_pgo\n\n\ndef getPythonPgoInput():\n    \"\"\":returns: str derived from ``--pgo-python-input``\"\"\"\n    return options.python_pgo_input\n\n\ndef shallCreatePgoInput():\n    return isPythonPgoMode() and getPythonPgoInput() is None\n\n\ndef getPgoArgs():\n    \"\"\"*list* = ``--pgo-args``\"\"\"\n    return shlex.split(options.pgo_args)\n\n\ndef getPgoExecutable():\n    \"\"\"*str* = ``--pgo-args``\"\"\"\n\n    if options.pgo_executable and os.path.exists(options.pgo_executable):\n        if not os.path.isabs(options.pgo_executable):\n            options.pgo_executable = os.path.join(\".\", options.pgo_executable)\n\n    return options.pgo_executable\n\n\ndef getPythonPgoUnseenModulePolicy():\n    \"\"\"*str* = ``--python-pgo-unused-module-policy``\"\"\"\n    return options.python_pgo_policy_unused_module\n\n\ndef getOnefileTempDirSpec():\n    \"\"\"*str* = ``--onefile-tempdir-spec``\"\"\"\n    result = (\n        options.onefile_tempdir_spec or \"{TEMP}\" + os.path.sep + \"onefile_{PID}_{TIME}\"\n    )\n\n    # This changes the '/' to '\\' on Windows at least.\n    return os.path.normpath(result)\n\n\ndef getOnefileChildGraceTime():\n    \"\"\"*int* = ``--onefile-child-grace-time``\"\"\"\n    return (\n        int(options.onefile_child_grace_time)\n        if options.onefile_child_grace_time is not None\n        else 5000\n    )\n\n\ndef shallNotCompressOnefile():\n    \"\"\"*bool* = ``--onefile-no-compression``\"\"\"\n    return options.onefile_no_compression\n\n\ndef shallOnefileAsArchive():\n    \"\"\"*bool* = ``--onefile-as-archive``\"\"\"\n    return options.onefile_as_archive\n\n\ndef _checkIconPaths(icon_paths):\n    for icon_path in icon_paths:\n        if not os.path.exists(icon_path):\n            Tracing.options_logger.sysexit(\n                \"Error, icon path '%s' does not exist.\" % icon_path\n            )\n\n        checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)\n\n    return icon_paths\n\n\ndef getWindowsIconPaths():\n    \"\"\"*list of str*, values of ``--windows-icon-from-ico``\"\"\"\n    return _checkIconPaths(options.windows_icon_path)\n\n\ndef getLinuxIconPaths():\n    \"\"\"*list of str*, values of ``--linux-icon``\"\"\"\n    result = options.linux_icon_path\n\n    # Check if Linux icon requirement is met.\n    if isLinux() and not result and isOnefileMode():\n        # spell-checker: ignore pixmaps\n        default_icons = (\n            \"/usr/share/pixmaps/python%s.xpm\" % python_version_str,\n            \"/usr/share/pixmaps/python%s.xpm\" % sys.version_info[0],\n            \"/usr/share/pixmaps/python.xpm\",\n        )\n\n        for icon in default_icons:\n            if os.path.exists(icon):\n                result.append(icon)\n                break\n\n    return _checkIconPaths(result)\n\n\ndef getMacOSIconPaths():\n    \"\"\"*list of str*, values of ``--macos-app-icon``\"\"\"\n    return _checkIconPaths(options.macos_icon_path)\n\n\ndef getWindowsIconExecutablePath():\n    \"\"\"*str* or *None* if not given, value of ``--windows-icon-from-exe``\"\"\"\n    return options.icon_exe_path\n\n\ndef shallAskForWindowsAdminRights():\n    \"\"\"*bool*, value of ``--windows-uac-admin`` or ``--windows-uac-uiaccess``\"\"\"\n    return options.windows_uac_admin\n\n\ndef shallAskForWindowsUIAccessRights():\n    \"\"\"*bool*, value of ``--windows-uac-uiaccess``\"\"\"\n    return options.windows_uac_uiaccess\n\n\ndef getLegalCopyright():\n    \"\"\"*str* name of the product to use derived from ``--copyright``\"\"\"\n    return options.legal_copyright\n\n\ndef getLegalTrademarks():\n    \"\"\"*str* name of the product to use derived from ``--trademarks``\"\"\"\n    return options.legal_trademarks\n\n\ndef getLegalInformation():\n    result = options.legal_copyright\n\n    if options.legal_trademarks:\n        if result is not None:\n            result += \"\\nTrademark information:\" + options.legal_trademarks\n        else:\n            result = options.legal_trademarks\n\n    return result\n\n\ndef getWindowsVersionInfoStrings():\n    \"\"\"*dict of str*, values of .\"\"\"\n\n    result = {}\n\n    company_name = getCompanyName()\n    if company_name:\n        result[\"CompanyName\"] = company_name\n\n    product_name = getProductName()\n    if product_name:\n        result[\"ProductName\"] = product_name\n\n    if options.file_description:\n        result[\"FileDescription\"] = options.file_description\n\n    if options.legal_copyright:\n        result[\"LegalCopyright\"] = options.legal_copyright\n\n    if options.legal_trademarks:\n        result[\"LegalTrademarks\"] = options.legal_trademarks\n\n    return result\n\n\ndef _parseVersionNumber(value):\n    if value:\n        parts = value.split(\".\")\n\n        assert len(parts) <= 4\n\n        while len(parts) < 4:\n            parts.append(\"0\")\n\n        r = tuple(int(d) for d in parts)\n        assert min(r) >= 0\n        assert max(r) < 2**16\n        return r\n    else:\n        return None\n\n\ndef getProductVersion():\n    \"\"\":returns: str, derived from ``--product-version``\"\"\"\n    return options.product_version\n\n\ndef getProductVersionTuple():\n    \"\"\":returns: tuple of 4 ints or None, derived from ``--product-version``\"\"\"\n    return _parseVersionNumber(options.product_version)\n\n\ndef getFileVersion():\n    \"\"\":returns str, derived from ``--file-version``\"\"\"\n    return options.file_version\n\n\ndef getFileVersionTuple():\n    \"\"\":returns tuple of 4 ints or None, derived from ``--file-version``\"\"\"\n    return _parseVersionNumber(options.file_version)\n\n\ndef getWindowsSplashScreen():\n    \"\"\":returns: bool derived from ``--onefile-windows-splash-screen-image``\"\"\"\n    return options.splash_screen_image\n\n\ndef getCompanyName():\n    \"\"\"*str* name of the company to use derived from ``--company-name``\"\"\"\n    return options.company_name\n\n\ndef getProductName():\n    \"\"\"*str* name of the product to use derived from ``--product-name``\"\"\"\n    return options.product_name\n\n\ndef getMacOSTargetArch():\n    \"\"\":returns: str enum (\"universal\", \"arm64\", \"x86_64\") derived from ``--macos-target-arch`` value\"\"\"\n    macos_target_arch = options.macos_target_arch or \"native\"\n\n    if macos_target_arch == \"native\":\n        macos_target_arch = getArchitecture()\n\n    return macos_target_arch\n\n\ndef shallCreateAppBundle():\n    \"\"\"*bool* shall create an application bundle, derived from ``--macos-create-app-bundle`` value\"\"\"\n    return options.macos_create_bundle and isMacOS()\n\n\ndef getMacOSSigningIdentity():\n    \"\"\"*str* value to use as identity for codesign, derived from ``--macos-sign-identity`` value\"\"\"\n    result = options.macos_sign_identity\n\n    if result == \"ad-hoc\":\n        result = \"-\"\n\n    return result\n\n\ndef shallUseSigningForNotarization():\n    \"\"\"*bool* flag to use for codesign, derived from ``--macos-sign-notarization`` value\"\"\"\n    return options.macos_sign_notarization\n\n\ndef getMacOSAppName():\n    \"\"\"*str* name of the app to use bundle\"\"\"\n    return options.macos_app_name\n\n\ndef getMacOSSignedAppName():\n    \"\"\"*str* name of the app to use during signing\"\"\"\n    return options.macos_signed_app_name\n\n\ndef getMacOSAppVersion():\n    \"\"\"*str* version of the app to use for bundle\"\"\"\n    return options.macos_app_version\n\n\ndef getMacOSAppProtectedResourcesAccesses():\n    \"\"\"*list* key, value for protected resources of the app to use for bundle\"\"\"\n    for macos_protected_resource in options.macos_protected_resources:\n        yield macos_protected_resource.split(\":\", 1)\n\n\ndef isMacOSBackgroundApp():\n    \"\"\"*bool*, derived from ``--macos-app-mode``\"\"\"\n    return options.macos_app_mode == \"background\"\n\n\ndef isMacOSUiElementApp():\n    \"\"\"*bool*, derived from ``--macos-app-mode``\"\"\"\n    return options.macos_app_mode == \"ui-element\"\n\n\n_python_flags = None\n\n\ndef _getPythonFlags():\n    \"\"\"*list*, values of ``--python-flag``\"\"\"\n    # There is many flags, pylint: disable=too-many-branches\n\n    # singleton, pylint: disable=global-statement\n    global _python_flags\n\n    if _python_flags is None:\n        _python_flags = set()\n\n        for parts in options.python_flags:\n            for part in parts.split(\",\"):\n                if part in (\"-S\", \"nosite\", \"no_site\"):\n                    _python_flags.add(\"no_site\")\n                elif part in (\"site\",):\n                    if \"no_site\" in _python_flags:\n                        _python_flags.remove(\"no_site\")\n                elif part in (\n                    \"-R\",\n                    \"static_hashes\",\n                    \"norandomization\",\n                    \"no_randomization\",\n                ):\n                    _python_flags.add(\"no_randomization\")\n                elif part in (\"-v\", \"trace_imports\", \"trace_import\"):\n                    _python_flags.add(\"trace_imports\")\n                elif part in (\"no_warnings\", \"nowarnings\"):\n                    _python_flags.add(\"no_warnings\")\n                elif part in (\"-O\", \"no_asserts\", \"noasserts\"):\n                    _python_flags.add(\"no_asserts\")\n                elif part in (\"no_docstrings\", \"nodocstrings\"):\n                    _python_flags.add(\"no_docstrings\")\n                elif part in (\"-OO\",):\n                    _python_flags.add(\"no_docstrings\")\n                    _python_flags.add(\"no_asserts\")\n                elif part in (\"no_annotations\", \"noannotations\"):\n                    _python_flags.add(\"no_annotations\")\n                elif part in (\"unbuffered\", \"-u\"):\n                    _python_flags.add(\"unbuffered\")\n                elif part in (\"-m\", \"package_mode\"):\n                    _python_flags.add(\"package_mode\")\n                elif part in (\"-I\", \"isolated\"):\n                    _python_flags.add(\"isolated\")\n                else:\n                    Tracing.options_logger.sysexit(\n                        \"Unsupported python flag '%s'.\" % part\n                    )\n\n    return _python_flags\n\n\ndef hasPythonFlagNoSite():\n    \"\"\"*bool* = \"no_site\" in python flags given\"\"\"\n\n    return \"no_site\" in _getPythonFlags()\n\n\ndef hasPythonFlagNoAnnotations():\n    \"\"\"*bool* = \"no_annotations\" in python flags given\"\"\"\n\n    return \"no_annotations\" in _getPythonFlags()\n\n\ndef hasPythonFlagNoAsserts():\n    \"\"\"*bool* = \"no_asserts\" in python flags given\"\"\"\n\n    return \"no_asserts\" in _getPythonFlags()\n\n\ndef hasPythonFlagNoDocStrings():\n    \"\"\"*bool* = \"no_docstrings\" in python flags given\"\"\"\n\n    return \"no_docstrings\" in _getPythonFlags()\n\n\ndef hasPythonFlagNoWarnings():\n    \"\"\"*bool* = \"no_warnings\" in python flags given\"\"\"\n\n    return \"no_warnings\" in _getPythonFlags()\n\n\ndef hasPythonFlagIsolated():\n    \"\"\"*bool* = \"isolated\" in python flags given\"\"\"\n\n    return \"isolated\" in _getPythonFlags()\n\n\ndef hasPythonFlagTraceImports():\n    \"\"\"*bool* = \"trace_imports\", \"-v\" in python flags given\"\"\"\n\n    return \"trace_imports\" in _getPythonFlags()\n\n\ndef hasPythonFlagNoRandomization():\n    \"\"\"*bool* = \"no_randomization\", \"-R\", \"static_hashes\" in python flags given\"\"\"\n\n    return \"no_randomization\" in _getPythonFlags()\n\n\ndef hasPythonFlagUnbuffered():\n    \"\"\"*bool* = \"package_mode\", \"-m\" in python flags given\"\"\"\n\n    return \"unbuffered\" in _getPythonFlags()\n\n\ndef hasPythonFlagPackageMode():\n    \"\"\"*bool* = \"package_mode\", \"-m\" in python flags given\"\"\"\n\n    return \"package_mode\" in _getPythonFlags()\n\n\ndef shallNotUseDependsExeCachedResults():\n    \"\"\":returns: bool derived from ``--disable-dll-dependency-cache`` or ``--force-dll-dependency-cache-update``\"\"\"\n    return shallNotStoreDependsExeCachedResults() or getattr(\n        options, \"update_dependency_cache\", False\n    )\n\n\ndef shallNotStoreDependsExeCachedResults():\n    \"\"\":returns: bool derived from ``--disable-dll-dependency-cache``\"\"\"\n    return shallDisableCacheUsage(\"dll-dependencies\")\n\n\ndef getPluginNameConsideringRenames(plugin_name):\n    \"\"\"Name of the plugin with renames considered.\"\"\"\n\n    # spell-checker: ignore delvewheel,pyzmq\n\n    if plugin_name == \"etherium\":\n        return \"ethereum\"\n    if plugin_name == \"pyzmq\":\n        return \"delvewheel\"\n\n    return plugin_name\n\n\ndef getPluginsEnabled():\n    \"\"\"*tuple*, user enabled (standard) plugins (not including user plugins)\n\n    Note:\n        Do not use this outside of main binary, as plugins are allowed\n        to activate plugins themselves and that will not be visible here.\n    \"\"\"\n    result = OrderedSet()\n\n    if options:\n        for plugin_enabled in options.plugins_enabled:\n            result.update(\n                getPluginNameConsideringRenames(plugin_name)\n                for plugin_name in plugin_enabled.split(\",\")\n            )\n\n    return tuple(result)\n\n\ndef getPluginsDisabled():\n    \"\"\"*tuple*, user disabled (standard) plugins.\n\n    Note:\n        Do not use this outside of main binary, as other plugins, e.g.\n        hinted compilation will activate plugins themselves and this\n        will not be visible here.\n    \"\"\"\n    result = OrderedSet()\n\n    if options:\n        for plugin_disabled in options.plugins_disabled:\n            result.update(\n                getPluginNameConsideringRenames(plugin_name)\n                for plugin_name in plugin_disabled.split(\",\")\n            )\n\n    return tuple(result)\n\n\ndef getUserPlugins():\n    \"\"\"*tuple*, items user provided of ``--user-plugin=``\"\"\"\n    if not options:\n        return ()\n\n    return tuple(set(options.user_plugins))\n\n\ndef shallDetectMissingPlugins():\n    \"\"\"*bool* = **not** ``--plugin-no-detection``\"\"\"\n    return options is not None and options.detect_missing_plugins\n\n\ndef getPythonPathForScons():\n    \"\"\"*str*, value of ``--python-for-scons``\"\"\"\n    return options.python_scons\n\n\ndef shallCompileWithoutBuildDirectory():\n    \"\"\"*bool* currently hard coded, not when using debugger.\n\n    When this is used, compilation is executed in a fashion that it runs\n    inside the build folder, hiding it, attempting to make results more\n    reproducible across builds of different programs.\n\n    TODO: Make this not hardcoded, but possible to disable via an\n    options.\n    \"\"\"\n    return not shallRunInDebugger()\n\n\ndef shallPreferSourceCodeOverExtensionModules():\n    \"\"\"*bool* prefer source code over extension modules if both are there\"\"\"\n    return options is not None and options.prefer_source_code\n\n\ndef shallUseProgressBar():\n    \"\"\"*bool* prefer source code over extension modules if both are there\"\"\"\n    return options.progress_bar\n\n\ndef getForcedStdoutPath():\n    \"\"\"*str* force program stdout output into that filename\"\"\"\n    result = options.force_stdout_spec\n\n    if result is not None:\n        result = os.path.normpath(result)\n\n    return result\n\n\ndef getForcedStderrPath():\n    \"\"\"*str* force program stderr output into that filename\"\"\"\n    result = options.force_stderr_spec\n\n    if result is not None:\n        result = os.path.normpath(result)\n\n    return result\n\n\ndef shallShowSourceModifications(module_name):\n    \"\"\"*bool* display plugin source changes derived from --show-source-changes\"\"\"\n    if options is None:\n        return False\n\n    result, _reason = module_name.matchesToShellPatterns(options.show_source_changes)\n\n    return result\n\n\ndef isLowMemory():\n    \"\"\"*bool* low memory usage requested\"\"\"\n    return options.low_memory\n\n\ndef getCompilationReportFilename():\n    \"\"\"*str* filename to write XML report of compilation to\"\"\"\n    return options.compilation_report_filename\n\n\ndef getCompilationReportTemplates():\n    \"\"\"*tuple of str,str* template and output filenames to write reports to\"\"\"\n    result = []\n    for value in options.compilation_report_templates:\n        result.append(value.split(\":\", 1))\n\n    return tuple(result)\n\n\ndef getCompilationReportUserData():\n    result = OrderedDict()\n\n    for desc in options.compilation_report_user_data:\n        if \"=\" not in desc:\n            Tracing.options_logger.sysexit(\n                \"Error, user report data must be of key=value form not '%s'.\" % desc\n            )\n\n        key, value = desc.split(\"=\", 1)\n\n        if key in result and value != result[key]:\n            Tracing.options_logger.sysexit(\n                \"Error, user report data key '%s' has been given conflicting values '%s' and '%s'.\"\n                % (\n                    key,\n                    result[key],\n                    value,\n                )\n            )\n\n        if not re.match(\n            r\"^([_a-z][\\w]?|[a-w_yz][\\w]{2,}|[_a-z][a-l_n-z\\d][\\w]+|[_a-z][\\w][a-k_m-z\\d][\\w]*)$\",\n            key,\n        ):\n            Tracing.options_logger.sysexit(\n                \"Error, user report data key '%s' is not valid as an XML tag, and therefore cannot be used.\"\n                % key\n            )\n\n        result[key] = value\n\n    return result\n\n\ndef shallCreateDiffableCompilationReport():\n    \"\"\"*bool*\" derived from --report-diffable\"\"\"\n    return options.compilation_report_diffable\n\n\ndef getUserProvidedYamlFiles():\n    \"\"\"*list* files with user provided Yaml files\"\"\"\n    return options.user_yaml_files\n\n\ndef _getWarningMnemonicsDisabled():\n    return sum([_splitShellPattern(x) for x in options.nowarn_mnemonics], [])\n\n\ndef shallDisplayWarningMnemonic(mnemonic):\n    \"\"\"*bool*\" derived from --nowarn-mnemonic\"\"\"\n    for pattern in _getWarningMnemonicsDisabled():\n        if fnmatch.fnmatch(mnemonic, pattern):\n            return False\n\n    return True\n\n\ndef shallShowExecutedCommands():\n    return isExperimental(\"show-commands\")\n\n\ndef getFcfProtectionMode():\n    \"\"\":returns: string derived from ``--fcf-protection``\"\"\"\n    return options.cf_protection\n\n\ndef getModuleParameter(module_name, parameter_name):\n    \"\"\":returns: string derived from ``--module-parameter``\"\"\"\n    option_name = module_name.asString() + \"-\" + parameter_name\n\n    for module_option in options.module_parameters:\n        module_option_name, module_option_value = module_option.split(\"=\", 1)\n\n        if option_name == module_option_name:\n            return module_option_value\n\n    return None\n\n\ndef getForcedRuntimeEnvironmentVariableValues():\n    \"--force-runtime-environment-variable\"\n\n    for forced_runtime_env_variables_spec in options.forced_runtime_env_variables:\n        name, value = forced_runtime_env_variables_spec.split(\"=\", 1)\n\n        yield (name, value)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/OutputDirectories.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Directories and paths to for output of Nuitka.\n\nThere are two major outputs, the build directory *.build and for\nstandalone mode, the *.dist folder.\n\nA bunch of functions here are supposed to get path resolution from\nthis.\n\"\"\"\n\nimport os\n\nfrom nuitka import Options\nfrom nuitka.utils.FileOperations import (\n    addFilenameExtension,\n    makePath,\n    putTextFileContents,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\nfrom nuitka.utils.Utils import isWin32OrPosixWindows, isWin32Windows\n\n_main_module = None\n\n\ndef setMainModule(main_module):\n    \"\"\"Call this before using other methods of this module.\"\"\"\n    # Technically required.\n    assert main_module.isCompiledPythonModule()\n\n    # Singleton and to avoid passing this one all the time, pylint: disable=global-statement\n    global _main_module\n    _main_module = main_module\n\n\ndef getSourceDirectoryPath(onefile=False):\n    \"\"\"Return path inside the build directory.\"\"\"\n\n    # Distinct build folders for oneline mode.\n    if onefile:\n        suffix = \".onefile-build\"\n    else:\n        suffix = \".build\"\n\n    result = Options.getOutputPath(\n        path=os.path.basename(getTreeFilenameWithSuffix(_main_module, suffix))\n    )\n\n    makePath(result)\n\n    git_ignore_filename = os.path.join(result, \".gitignore\")\n\n    if not os.path.exists(git_ignore_filename):\n        putTextFileContents(filename=git_ignore_filename, contents=\"*\")\n\n    return result\n\n\ndef _getStandaloneDistSuffix(bundle):\n    \"\"\"Suffix to use for standalone distribution folder.\"\"\"\n\n    if bundle and Options.shallCreateAppBundle() and not Options.isOnefileMode():\n        return \".app\"\n    else:\n        return \".dist\"\n\n\ndef getStandaloneDirectoryPath(bundle=True):\n    assert Options.isStandaloneMode()\n\n    result = Options.getOutputPath(\n        path=os.path.basename(\n            getTreeFilenameWithSuffix(_main_module, _getStandaloneDistSuffix(bundle))\n        )\n    )\n\n    if bundle and Options.shallCreateAppBundle() and not Options.isOnefileMode():\n        result = os.path.join(result, \"Contents\", \"MacOS\")\n\n    return result\n\n\ndef getResultBasePath(onefile=False):\n    if Options.isOnefileMode() and onefile:\n        file_path = os.path.basename(getTreeFilenameWithSuffix(_main_module, \"\"))\n\n        if Options.shallCreateAppBundle():\n            file_path = os.path.join(file_path + \".app\", \"Contents\", \"MacOS\", file_path)\n\n        return Options.getOutputPath(path=file_path)\n    elif Options.isStandaloneMode() and not onefile:\n        return os.path.join(\n            getStandaloneDirectoryPath(),\n            os.path.basename(getTreeFilenameWithSuffix(_main_module, \"\")),\n        )\n    else:\n        return Options.getOutputPath(\n            path=os.path.basename(getTreeFilenameWithSuffix(_main_module, \"\"))\n        )\n\n\ndef getResultFullpath(onefile):\n    \"\"\"Get the final output binary result full path.\"\"\"\n\n    result = getResultBasePath(onefile=onefile)\n\n    if Options.shallMakeModule():\n        result += getSharedLibrarySuffix(preferred=True)\n    else:\n        output_filename = Options.getOutputFilename()\n\n        if Options.isOnefileMode() and output_filename is not None:\n            if onefile:\n                result = Options.getOutputPath(output_filename)\n            else:\n                result = os.path.join(\n                    getStandaloneDirectoryPath(),\n                    os.path.basename(output_filename),\n                )\n        elif Options.isStandaloneMode() and output_filename is not None:\n            result = os.path.join(\n                getStandaloneDirectoryPath(),\n                os.path.basename(output_filename),\n            )\n        elif output_filename is not None:\n            result = output_filename\n        elif not isWin32OrPosixWindows() and not Options.shallCreateAppBundle():\n            result = addFilenameExtension(result, \".bin\")\n\n        if isWin32OrPosixWindows():\n            result = addFilenameExtension(result, \".exe\")\n\n        if not isWin32OrPosixWindows() and Options.isOnefileMode() and not onefile:\n            result = addFilenameExtension(result, \".bin\")\n\n    return result\n\n\ndef getResultRunFilename(onefile):\n    result = getResultFullpath(onefile=onefile)\n\n    if isWin32Windows() and Options.shallTreatUninstalledPython():\n        result = getResultBasePath(onefile=onefile) + \".cmd\"\n\n    return result\n\n\ndef getTreeFilenameWithSuffix(module, suffix):\n    return module.getOutputFilename() + suffix\n\n\ndef getPgoRunExecutable():\n    return Options.getPgoExecutable() or getResultRunFilename(onefile=False)\n\n\ndef getPgoRunInputFilename():\n    return getPgoRunExecutable() + \".nuitka-pgo\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/PostProcessing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Postprocessing tasks for create binaries or modules.\n\n\"\"\"\n\nimport ctypes\nimport os\nimport sys\n\nfrom nuitka import Options, OutputDirectories\nfrom nuitka.build.DataComposerInterface import getConstantBlobFilename\nfrom nuitka.finalizations.FinalizeMarkups import getImportedNames\nfrom nuitka.PythonVersions import (\n    getPythonABI,\n    getTargetPythonDLLPath,\n    python_version,\n    python_version_str,\n)\nfrom nuitka.Tracing import postprocessing_logger\nfrom nuitka.utils.Execution import wrapCommandForDebuggerForExec\nfrom nuitka.utils.FileOperations import (\n    getExternalUsePath,\n    getFileContents,\n    getFileSize,\n    hasFilenameExtension,\n    makePath,\n    putTextFileContents,\n    removeFileExecutablePermission,\n)\nfrom nuitka.utils.Images import convertImageToIconFormat\nfrom nuitka.utils.MacOSApp import createPlistInfoFile\nfrom nuitka.utils.SharedLibraries import (\n    callInstallNameTool,\n    cleanupHeaderForAndroid,\n)\nfrom nuitka.utils.Utils import isAndroidBasedLinux, isMacOS, isWin32Windows\nfrom nuitka.utils.WindowsResources import (\n    RT_GROUP_ICON,\n    RT_ICON,\n    RT_RCDATA,\n    addResourceToFile,\n    addVersionInfoResource,\n    convertStructureToBytes,\n    copyResourcesFromFileToFile,\n    getDefaultWindowsExecutableManifest,\n    getWindowsExecutableManifest,\n)\n\n\nclass IconDirectoryHeader(ctypes.Structure):\n    _fields_ = [\n        (\"reserved\", ctypes.c_short),\n        (\"type\", ctypes.c_short),\n        (\"count\", ctypes.c_short),\n    ]\n\n\nclass IconDirectoryEntry(ctypes.Structure):\n    _fields_ = [\n        (\"width\", ctypes.c_char),\n        (\"height\", ctypes.c_char),\n        (\"colors\", ctypes.c_char),\n        (\"reserved\", ctypes.c_char),\n        (\"planes\", ctypes.c_short),\n        (\"bit_count\", ctypes.c_short),\n        (\"image_size\", ctypes.c_int),\n        (\"image_offset\", ctypes.c_int),\n    ]\n\n\nclass IconGroupDirectoryEntry(ctypes.Structure):\n    # Make sure the don't have padding issues.\n    _pack_ = 2\n\n    _fields_ = (\n        (\"width\", ctypes.c_char),\n        (\"height\", ctypes.c_char),\n        (\"colors\", ctypes.c_char),\n        (\"reserved\", ctypes.c_char),\n        (\"planes\", ctypes.c_short),\n        (\"bit_count\", ctypes.c_short),\n        (\"image_size\", ctypes.c_int),\n        (\"id\", ctypes.c_short),\n    )\n\n\ndef readFromFile(readable, c_struct):\n    \"\"\"Read ctypes structures from input.\"\"\"\n\n    result = c_struct()\n    chunk = readable.read(ctypes.sizeof(result))\n    ctypes.memmove(ctypes.byref(result), chunk, ctypes.sizeof(result))\n    return result\n\n\ndef _addWindowsIconFromIcons(onefile):\n    # Relatively detailed handling, pylint: disable=too-many-locals\n\n    icon_group = 1\n    image_id = 1\n    images = []\n\n    result_filename = OutputDirectories.getResultFullpath(onefile=onefile)\n\n    for icon_spec in Options.getWindowsIconPaths():\n        if \"#\" in icon_spec:\n            icon_path, icon_index = icon_spec.rsplit(\"#\", 1)\n            icon_index = int(icon_index)\n        else:\n            icon_path = icon_spec\n            icon_index = None\n\n        if not hasFilenameExtension(icon_path, \".ico\"):\n            postprocessing_logger.info(\n                \"File '%s' is not in Windows icon format, converting to it.\" % icon_path\n            )\n\n            if icon_index is not None:\n                postprocessing_logger.sysexit(\n                    \"Cannot specify indexes with non-ico format files in '%s'.\"\n                    % icon_spec\n                )\n\n            icon_build_path = os.path.join(\n                OutputDirectories.getSourceDirectoryPath(onefile=onefile),\n                \"icons\",\n            )\n            makePath(icon_build_path)\n            converted_icon_path = os.path.join(\n                icon_build_path,\n                \"icon-%d.ico\" % image_id,\n            )\n\n            convertImageToIconFormat(\n                logger=postprocessing_logger,\n                image_filename=icon_spec,\n                converted_icon_filename=converted_icon_path,\n            )\n\n            icon_path = converted_icon_path\n\n        with open(icon_path, \"rb\") as icon_file:\n            # Read header and icon entries.\n            header = readFromFile(icon_file, IconDirectoryHeader)\n            icons = [\n                readFromFile(icon_file, IconDirectoryEntry)\n                for _i in range(header.count)\n            ]\n\n            if icon_index is not None:\n                if icon_index > len(icons):\n                    postprocessing_logger.sysexit(\n                        \"Error, referenced icon index %d in file '%s' with only %d icons.\"\n                        % (icon_index, icon_path, len(icons))\n                    )\n\n                icons[:] = icons[icon_index : icon_index + 1]\n\n            postprocessing_logger.info(\n                \"Adding %d icon(s) from icon file '%s'.\" % (len(icons), icon_spec)\n            )\n\n            # Image data are to be scanned from places specified icon entries\n            for icon in icons:\n                icon_file.seek(icon.image_offset, 0)\n                images.append(icon_file.read(icon.image_size))\n\n        parts = [convertStructureToBytes(header)]\n\n        for icon in icons:\n            parts.append(\n                convertStructureToBytes(\n                    IconGroupDirectoryEntry(\n                        width=icon.width,\n                        height=icon.height,\n                        colors=icon.colors,\n                        reserved=icon.reserved,\n                        planes=icon.planes,\n                        bit_count=icon.bit_count,\n                        image_size=icon.image_size,\n                        id=image_id,\n                    )\n                )\n            )\n\n            image_id += 1\n\n        addResourceToFile(\n            target_filename=result_filename,\n            data=b\"\".join(parts),\n            resource_kind=RT_GROUP_ICON,\n            lang_id=0,\n            res_name=icon_group,\n            logger=postprocessing_logger,\n        )\n\n    for count, image in enumerate(images, 1):\n        addResourceToFile(\n            target_filename=result_filename,\n            data=image,\n            resource_kind=RT_ICON,\n            lang_id=0,\n            res_name=count,\n            logger=postprocessing_logger,\n        )\n\n\ndef executePostProcessingResources(manifest, onefile):\n    \"\"\"Adding Windows resources to the binary.\n\n    Used for both onefile and not onefile binary, potentially two times.\n    \"\"\"\n    result_filename = OutputDirectories.getResultFullpath(onefile=onefile)\n\n    if manifest is None:\n        manifest = getDefaultWindowsExecutableManifest()\n\n    if Options.shallAskForWindowsAdminRights():\n        manifest.addUacAdmin()\n\n    if Options.shallAskForWindowsUIAccessRights():\n        manifest.addUacUiAccess()\n\n    manifest.addResourceToFile(result_filename, logger=postprocessing_logger)\n\n    if (\n        Options.getWindowsVersionInfoStrings()\n        or Options.getProductVersionTuple()\n        or Options.getFileVersionTuple()\n    ):\n        addVersionInfoResource(\n            string_values=Options.getWindowsVersionInfoStrings(),\n            product_version=Options.getProductVersionTuple(),\n            file_version=Options.getFileVersionTuple(),\n            file_date=(0, 0),\n            is_exe=not Options.shallMakeModule(),\n            result_filename=result_filename,\n            logger=postprocessing_logger,\n        )\n\n    # Attach icons from template file if given.\n    template_exe = Options.getWindowsIconExecutablePath()\n    if template_exe is not None:\n        res_copied = copyResourcesFromFileToFile(\n            template_exe,\n            target_filename=result_filename,\n            resource_kinds=(RT_ICON, RT_GROUP_ICON),\n        )\n\n        if res_copied == 0:\n            postprocessing_logger.warning(\n                \"The specified icon template executable '%s' didn't contain anything to copy.\"\n                % template_exe\n            )\n        else:\n            postprocessing_logger.warning(\n                \"Copied %d icon resources from '%s'.\" % (res_copied, template_exe)\n            )\n    else:\n        _addWindowsIconFromIcons(onefile=onefile)\n\n    splash_screen_filename = Options.getWindowsSplashScreen()\n    if splash_screen_filename is not None:\n        splash_data = getFileContents(splash_screen_filename, mode=\"rb\")\n\n        addResourceToFile(\n            target_filename=result_filename,\n            data=splash_data,\n            resource_kind=RT_RCDATA,\n            lang_id=0,\n            res_name=28,\n            logger=postprocessing_logger,\n        )\n\n\ndef executePostProcessing():\n    \"\"\"Postprocessing of the resulting binary.\n\n    These are in part required steps, not usable after failure.\n    \"\"\"\n\n    # Lots of cases to deal with, pylint: disable=too-many-branches\n\n    result_filename = OutputDirectories.getResultFullpath(onefile=False)\n\n    if not os.path.exists(result_filename):\n        postprocessing_logger.sysexit(\n            \"Error, scons failed to create the expected file %r. \" % result_filename\n        )\n\n    if isWin32Windows():\n        if not Options.shallMakeModule():\n            if python_version < 0x300:\n                # Copy the Windows manifest from the CPython binary to the created\n                # executable, so it finds \"MSCRT.DLL\". This is needed for Python2\n                # only, for Python3 newer MSVC doesn't hide the C runtime.\n                manifest = getWindowsExecutableManifest(sys.executable)\n            else:\n                manifest = None\n\n            executePostProcessingResources(manifest=manifest, onefile=False)\n\n        source_dir = OutputDirectories.getSourceDirectoryPath()\n\n        # Attach the binary blob as a Windows resource.\n        addResourceToFile(\n            target_filename=result_filename,\n            data=getFileContents(getConstantBlobFilename(source_dir), mode=\"rb\"),\n            resource_kind=RT_RCDATA,\n            res_name=3,\n            lang_id=0,\n            logger=postprocessing_logger,\n        )\n\n    # On macOS, we update the executable path for searching the \"libpython\"\n    # library.\n    if (\n        isMacOS()\n        and not Options.shallMakeModule()\n        and not Options.shallUseStaticLibPython()\n    ):\n        python_abi_version = python_version_str + getPythonABI()\n        python_dll_filename = \"libpython\" + python_abi_version + \".dylib\"\n        python_lib_path = os.path.join(sys.prefix, \"lib\")\n        python_dll_path = os.path.join(python_lib_path, python_dll_filename)\n\n        # Note: For CPython, and potentially others, the rpath for the Python\n        # library needs to be set, so it will be detected as a dependency\n        # without tricks.\n        callInstallNameTool(\n            filename=result_filename,\n            mapping=(\n                (\n                    python_dll_filename,\n                    python_dll_path,\n                ),\n                (\n                    \"@rpath/Python3.framework/Versions/%s/Python3\" % python_version_str,\n                    python_dll_path,\n                ),\n            ),\n            id_path=None,\n            rpath=python_lib_path,\n        )\n\n    if Options.shallCreateAppBundle():\n        createPlistInfoFile(logger=postprocessing_logger, onefile=False)\n\n    # Modules should not be executable, but Scons creates them like it, fix\n    # it up here.\n    if not isWin32Windows() and Options.shallMakeModule():\n        removeFileExecutablePermission(result_filename)\n\n    if isWin32Windows() and Options.shallMakeModule():\n        candidate = os.path.join(\n            os.path.dirname(result_filename),\n            \"lib\" + os.path.basename(result_filename)[:-4] + \".a\",\n        )\n\n        if os.path.exists(candidate):\n            os.unlink(candidate)\n\n    if isAndroidBasedLinux():\n        cleanupHeaderForAndroid(result_filename)\n\n    # Might have to create a CMD file, potentially with debugger run.\n    if Options.shallCreateCmdFileForExecution():\n        dll_directory = getExternalUsePath(os.path.dirname(getTargetPythonDLLPath()))\n\n        cmd_filename = OutputDirectories.getResultRunFilename(onefile=False)\n\n        cmd_contents = \"\"\"\n@echo off\nrem This script was created by Nuitka to execute '%(exe_filename)s' with Python DLL being found.\nset PATH=%(dll_directory)s;%%PATH%%\nset PYTHONHOME=%(python_home)s\nset NUITKA_PYTHONPATH=%(python_path)s\n%(debugger_call)s\"%%~dp0%(exe_filename)s\" %%*\n\"\"\" % {\n            \"debugger_call\": (\n                (\" \".join(wrapCommandForDebuggerForExec()) + \" \")\n                if Options.shallRunInDebugger()\n                else \"\"\n            ),\n            \"dll_directory\": dll_directory,\n            \"python_home\": sys.prefix,\n            \"python_path\": \";\".join(sys.path),\n            \"exe_filename\": os.path.basename(result_filename),\n        }\n\n        putTextFileContents(cmd_filename, cmd_contents)\n\n    # Create a \".pyi\" file for created modules\n    if Options.shallMakeModule() and Options.shallCreatePyiFile():\n        pyi_filename = OutputDirectories.getResultBasePath() + \".pyi\"\n\n        putTextFileContents(\n            filename=pyi_filename,\n            contents=\"\"\"\\\n# This file was generated by Nuitka and describes the types of the\n# created shared library.\n\n# At this time it lists only the imports made and can be used by the\n# tools that bundle libraries, including Nuitka itself. For instance\n# standalone mode usage of the created library will need it.\n\n# In the future, this will also contain type information for values\n# in the module, so IDEs will use this. Therefore please include it\n# when you make software releases of the extension module that it\n# describes.\n\n%(imports)s\n\n# This is not Python source even if it looks so. Make it clear for\n# now. This was decided by PEP 484 designers.\n__name__ = ...\n\n\"\"\"\n            % {\n                \"imports\": \"\\n\".join(\n                    \"import %s\" % module_name for module_name in getImportedNames()\n                )\n            },\n            encoding=\"utf-8\",\n        )\n\n    if isWin32Windows() and getFileSize(result_filename) > 2**30 * 1.8:\n        postprocessing_logger.warning(\n            \"\"\"\\\nThe created compiled binary is larger than 1.8GB and therefore may not be\nexecutable by Windows due to its limitations.\"\"\"\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Progress.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Progress bars in Nuitka.\n\nThis is responsible for wrapping the rendering of progress bar and emitting tracing\nto the user while it's being displayed.\n\n\"\"\"\n\nfrom contextlib import contextmanager\n\nfrom nuitka import Tracing\nfrom nuitka.Tracing import general\nfrom nuitka.utils.Importing import importFromInlineCopy\nfrom nuitka.utils.ThreadedExecutor import RLock\nfrom nuitka.utils.Utils import isWin32Windows\n\n# spell-checker: ignore tqdm,ncols\n\n# Late import and optional to be there.\nuse_progress_bar = False\ntqdm = None\ncolorama = None\n\n\nclass NuitkaProgressBar(object):\n    def __init__(self, iterable, stage, total, min_total, unit):\n        self.total = total\n\n        # The minimum may not be provided, then default to 0.\n        self.min_total = min_total\n\n        # No item under work yet.\n        self.item = None\n\n        # No progress yet.\n        self.progress = 0\n\n        # Render immediately with 0 progress, and setting disable=None enables tty detection.\n        self.tqdm = tqdm(\n            iterable=iterable,\n            initial=self.progress,\n            total=(\n                max(self.total, self.min_total) if self.min_total is not None else None\n            ),\n            unit=unit,\n            disable=None,\n            leave=False,\n            dynamic_ncols=True,\n            bar_format=\"{desc}{percentage:3.1f}%|{bar:25}| {n_fmt}/{total_fmt}{postfix}\",\n        )\n\n        self.tqdm.set_description(stage)\n        self.setCurrent(self.item)\n\n    def __iter__(self):\n        return iter(self.tqdm)\n\n    def updateTotal(self, total):\n        if total != self.total:\n            self.total = total\n            self.tqdm.total = max(total, self.min_total)\n\n    def setCurrent(self, item):\n        if item != self.item:\n            self.item = item\n\n            if item is not None:\n                self.tqdm.set_postfix_str(item)\n            else:\n                self.tqdm.set_postfix()\n\n    def update(self):\n        self.progress += 1\n        self.tqdm.update(1)\n\n    def clear(self):\n        self.tqdm.clear()\n\n    def close(self):\n        self.tqdm.close()\n\n    @contextmanager\n    def withExternalWritingPause(self):\n        with self.tqdm.external_write_mode():\n            yield\n\n\ndef _getTqdmModule():\n    global tqdm  # singleton, pylint: disable=global-statement\n\n    if tqdm:\n        return tqdm\n    elif tqdm is False:\n        return None\n    else:\n        tqdm = importFromInlineCopy(\"tqdm\", must_exist=False, delete_module=True)\n\n        if tqdm is None:\n            try:\n                # Cannot use import tqdm due to pylint bug.\n                import tqdm as tqdm_installed  # pylint: disable=I0021,import-error\n\n                tqdm = tqdm_installed\n            except ImportError:\n                # We handle the case without inline copy too, but it may be removed, e.g. on\n                # Debian it's only a recommended install, and not included that way.\n                pass\n\n        if tqdm is None:\n            tqdm = False\n            return None\n\n        tqdm = tqdm.tqdm\n\n        # Tolerate the absence ignore the progress bar\n        tqdm.set_lock(RLock())\n\n        return tqdm\n\n\ndef enableProgressBar():\n    global use_progress_bar  # singleton, pylint: disable=global-statement\n    global colorama  # singleton, pylint: disable=global-statement\n\n    if _getTqdmModule() is not None:\n        use_progress_bar = True\n\n        if isWin32Windows():\n            if colorama is None:\n                colorama = importFromInlineCopy(\n                    \"colorama\", must_exist=True, delete_module=True\n                )\n\n            colorama.init()\n\n\ndef setupProgressBar(stage, unit, total, min_total=0):\n    # Make sure the other was closed.\n    assert Tracing.progress is None\n\n    if use_progress_bar:\n        Tracing.progress = NuitkaProgressBar(\n            iterable=None,\n            stage=stage,\n            total=total,\n            min_total=min_total,\n            unit=unit,\n        )\n\n\ndef reportProgressBar(item, total=None, update=True):\n    if Tracing.progress is not None:\n        try:\n            if total is not None:\n                Tracing.progress.updateTotal(total)\n\n            Tracing.progress.setCurrent(item)\n\n            if update:\n                Tracing.progress.update()\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            # We disable the progress bar now, because it's causing issues.\n            general.warning(\"Progress bar disabled due to bug: %s\" % (str(e)))\n            closeProgressBar()\n\n\ndef closeProgressBar():\n    \"\"\"Close the active progress bar.\n\n    Returns: int or None - if displayed, the total used last time.\n    \"\"\"\n\n    if Tracing.progress is not None:\n        # Retrieve that previous total, for repeated progress bars, it\n        # can be used as a new minimum.\n        result = Tracing.progress.total\n\n        Tracing.progress.close()\n        Tracing.progress = None\n\n        return result\n\n\ndef wrapWithProgressBar(iterable, stage, unit):\n    if tqdm is None:\n        return iterable\n    else:\n        result = NuitkaProgressBar(\n            iterable=iterable, unit=unit, stage=stage, total=None, min_total=None\n        )\n\n        Tracing.progress = result\n\n        return result\n\n\n@contextmanager\ndef withNuitkaDownloadProgressBar(*args, **kwargs):\n    if not use_progress_bar or _getTqdmModule() is None:\n        yield\n    else:\n\n        class NuitkaDownloadProgressBar(tqdm):\n            # spell-checker: ignore bsize, tsize\n            def onProgress(self, b=1, bsize=1, tsize=None):\n                if tsize is not None:\n                    self.total = tsize\n                self.update(b * bsize - self.n)\n\n        kwargs.update(\n            disable=None,\n            leave=False,\n            dynamic_ncols=True,\n            bar_format=\"{desc} {percentage:3.1f}%|{bar:25}| {n_fmt}/{total_fmt}{postfix}\",\n        )\n\n        with NuitkaDownloadProgressBar(*args, **kwargs) as progress_bar:\n            yield progress_bar.onProgress\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/PythonFlavors.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Python flavors specifics.\n\nThis abstracts the Python variants from different people. There is not just\nCPython, but Anaconda, Debian, pyenv, Apple, lots of people who make Python\nin a way the requires technical differences, e.g. static linking, LTO, or\nDLL presence, link paths, etc.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    isFilenameBelowPath,\n    isFilenameSameAsOrBelowPath,\n)\nfrom nuitka.utils.Utils import (\n    isAlpineLinux,\n    isAndroidBasedLinux,\n    isArchBasedLinux,\n    isFedoraBasedLinux,\n    isLinux,\n    isMacOS,\n    isPosixWindows,\n    isWin32Windows,\n    withNoDeprecationWarning,\n)\n\nfrom .PythonVersions import (\n    getInstalledPythonRegistryPaths,\n    getRunningPythonDLLPath,\n    getSystemPrefixPath,\n    isStaticallyLinkedPython,\n    python_version,\n    python_version_str,\n)\n\n\ndef isNuitkaPython():\n    \"\"\"Is this our own fork of CPython named Nuitka-Python.\"\"\"\n\n    # spell-checker: ignore nuitkapython\n\n    if python_version >= 0x300:\n        return sys.implementation.name == \"nuitkapython\"\n    else:\n        return sys.subversion[0] == \"nuitkapython\"\n\n\n_is_anaconda = None\n\n\ndef isAnacondaPython():\n    \"\"\"Detect if Python variant Anaconda\"\"\"\n\n    # singleton, pylint: disable=global-statement\n    global _is_anaconda\n\n    if _is_anaconda is None:\n        _is_anaconda = os.path.exists(os.path.join(sys.prefix, \"conda-meta\"))\n\n    return _is_anaconda\n\n\ndef isApplePython():\n    if not isMacOS():\n        return False\n\n    # Python2 on 10.15 or higher\n    if \"+internal-os\" in sys.version:\n        return True\n\n    # Older macOS had that\n    if isFilenameSameAsOrBelowPath(path=\"/usr/bin/\", filename=getSystemPrefixPath()):\n        return True\n    # Newer macOS has that\n    if isFilenameSameAsOrBelowPath(\n        path=\"/Library/Developer/CommandLineTools/\", filename=getSystemPrefixPath()\n    ):\n        return True\n\n    # Xcode has that on macOS, we consider it an Apple Python for now, it might\n    # be more usable than Apple Python, we but we delay that.\n    if isFilenameSameAsOrBelowPath(\n        path=\"/Applications/Xcode.app/Contents/Developer/\",\n        filename=getSystemPrefixPath(),\n    ):\n        return True\n\n    return False\n\n\ndef isHomebrewPython():\n    # spell-checker: ignore sitecustomize\n    if not isMacOS():\n        return False\n\n    candidate = os.path.join(\n        getSystemPrefixPath(), \"lib\", \"python\" + python_version_str, \"sitecustomize.py\"\n    )\n\n    if os.path.exists(candidate):\n        with open(candidate, \"rb\") as site_file:\n            line = site_file.readline()\n\n        if b\"Homebrew\" in line:\n            return True\n\n    return False\n\n\ndef isPyenvPython():\n    if isWin32Windows():\n        return False\n\n    return os.getenv(\"PYENV_ROOT\") and isFilenameSameAsOrBelowPath(\n        path=os.getenv(\"PYENV_ROOT\"), filename=getSystemPrefixPath()\n    )\n\n\ndef isMSYS2MingwPython():\n    \"\"\"MSYS2 the MinGW64 variant that is more Win32 compatible.\"\"\"\n    if not isWin32Windows() or \"GCC\" not in sys.version:\n        return False\n\n    import sysconfig\n\n    if python_version >= 0x3B0:\n        return \"-mingw_\" in sysconfig.get_config_var(\"EXT_SUFFIX\")\n    else:\n        return \"-mingw_\" in sysconfig.get_config_var(\"SO\")\n\n\ndef isTermuxPython():\n    \"\"\"Is this Termux Android Python.\"\"\"\n    # spell-checker: ignore termux\n\n    if not isAndroidBasedLinux():\n        return False\n\n    return \"com.termux\" in getSystemPrefixPath().split(\"/\")\n\n\ndef isUninstalledPython():\n    # Debian package.\n    if isDebianPackagePython():\n        return False\n\n    if isStaticallyLinkedPython():\n        return False\n\n    if os.name == \"nt\":\n        import ctypes.wintypes\n\n        GetSystemDirectory = ctypes.windll.kernel32.GetSystemDirectoryW\n        GetSystemDirectory.argtypes = (ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD)\n        GetSystemDirectory.restype = ctypes.wintypes.DWORD\n\n        MAX_PATH = 4096\n        buf = ctypes.create_unicode_buffer(MAX_PATH)\n\n        res = GetSystemDirectory(buf, MAX_PATH)\n        assert res != 0\n\n        system_path = buf.value\n        return not isFilenameBelowPath(\n            path=system_path, filename=getRunningPythonDLLPath()\n        )\n\n    return isAnacondaPython() or \"WinPython\" in sys.version\n\n\n_is_win_python = None\n\n\ndef isWinPython():\n    \"\"\"Is this Python from WinPython.\"\"\"\n    if \"WinPython\" in sys.version:\n        return True\n\n    # singleton, pylint: disable=global-statement\n    global _is_win_python\n\n    if _is_win_python is None:\n        for element in sys.path:\n            if os.path.basename(element) == \"site-packages\":\n                if os.path.exists(os.path.join(element, \"WinPython\")):\n                    _is_win_python = True\n                    break\n        else:\n            _is_win_python = False\n\n    return _is_win_python\n\n\ndef isDebianPackagePython():\n    \"\"\"Is this Python from a debian package.\"\"\"\n\n    # spell-checker: ignore multiarch\n\n    if not isLinux():\n        return False\n\n    if python_version < 0x300:\n        return hasattr(sys, \"_multiarch\")\n    else:\n        with withNoDeprecationWarning():\n            try:\n                from distutils.dir_util import _multiarch\n            except ImportError:\n                return False\n            else:\n                return True\n\n\ndef isFedoraPackagePython():\n    \"\"\"Is the Python from a Fedora package.\"\"\"\n    if not isFedoraBasedLinux():\n        return False\n\n    system_prefix_path = getSystemPrefixPath()\n\n    return system_prefix_path == \"/usr\"\n\n\ndef isAlpinePackagePython():\n    \"\"\"Is the Python from a Alpine package.\"\"\"\n    if not isAlpineLinux():\n        return False\n\n    system_prefix_path = getSystemPrefixPath()\n\n    return system_prefix_path == \"/usr\"\n\n\ndef isArchPackagePython():\n    \"\"\"Is the Python from a Fedora package.\"\"\"\n    if not isArchBasedLinux():\n        return False\n\n    system_prefix_path = getSystemPrefixPath()\n\n    return system_prefix_path == \"/usr\"\n\n\ndef isCPythonOfficialPackage():\n    \"\"\"Official CPython download, kind of hard to detect since self-compiled doesn't change much.\"\"\"\n\n    sys_prefix = getSystemPrefixPath()\n\n    # For macOS however, it's very knowable.\n    if isMacOS() and isFilenameBelowPath(\n        path=\"/Library/Frameworks/Python.framework/Versions/\", filename=sys_prefix\n    ):\n        return True\n\n    # For Windows, we check registry.\n    if isWin32Windows():\n        for registry_python_exe in getInstalledPythonRegistryPaths(python_version_str):\n            if areSamePaths(sys_prefix, os.path.dirname(registry_python_exe)):\n                return True\n\n    return False\n\n\n_is_self_compiled_python = None\n\n\ndef isSelfCompiledPythonUninstalled():\n    # singleton, pylint: disable=global-statement\n    global _is_self_compiled_python\n\n    if _is_self_compiled_python is None:\n        sys_prefix = getSystemPrefixPath()\n\n        _is_self_compiled_python = os.path.isdir(os.path.join(sys_prefix, \"PCbuild\"))\n\n    return _is_self_compiled_python\n\n\n_is_manylinux_python = None\n\n\ndef isManyLinuxPython():\n    if not isLinux():\n        return False\n\n    # singleton, pylint: disable=global-statement\n    global _is_manylinux_python\n\n    sys_prefix = getSystemPrefixPath()\n\n    if _is_manylinux_python is None:\n        _is_manylinux_python = os.path.isfile(\n            os.path.join(sys_prefix, \"..\", \"static-libs-for-embedding-only.tar.xz\")\n        )\n\n    return _is_manylinux_python\n\n\ndef isGithubActionsPython():\n    # spell-checker: ignore hostedtoolcache\n\n    return os.getenv(\"GITHUB_ACTIONS\") == \"true\" and getSystemPrefixPath().startswith(\n        \"/opt/hostedtoolcache/Python\"\n    )\n\n\ndef getPythonFlavorName():\n    \"\"\"For output to the user only.\"\"\"\n    # return driven, pylint: disable=too-many-branches,too-many-return-statements\n\n    if isNuitkaPython():\n        return \"Nuitka Python\"\n    elif isAnacondaPython():\n        return \"Anaconda Python\"\n    elif isWinPython():\n        return \"WinPython\"\n    elif isDebianPackagePython():\n        return \"Debian Python\"\n    elif isFedoraPackagePython():\n        return \"Fedora Python\"\n    elif isArchPackagePython():\n        return \"Arch Python\"\n    elif isAlpinePackagePython():\n        return \"Alpine Python\"\n    elif isHomebrewPython():\n        return \"Homebrew Python\"\n    elif isApplePython():\n        return \"Apple Python\"\n    elif isPyenvPython():\n        return \"pyenv\"\n    elif isPosixWindows():\n        return \"MSYS2 Posix\"\n    elif isMSYS2MingwPython():\n        return \"MSYS2 MinGW\"\n    elif isTermuxPython():\n        return \"Android Termux\"\n    elif isCPythonOfficialPackage():\n        return \"CPython Official\"\n    elif isSelfCompiledPythonUninstalled():\n        return \"Self Compiled Uninstalled\"\n    elif isGithubActionsPython():\n        return \"GitHub Actions Python\"\n    elif isManyLinuxPython():\n        return \"Manylinux Python\"\n    else:\n        return \"Unknown\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/PythonOperators.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Python operator tables\n\nThese are mostly used to resolve the operator in the module operator and to know the list\nof operations allowed.\n\n\"\"\"\n\nimport operator\n\nfrom nuitka.PythonVersions import python_version\n\nbinary_operator_functions = {\n    \"Add\": operator.add,\n    \"Sub\": operator.sub,\n    \"Pow\": operator.pow,\n    \"Mult\": operator.mul,\n    \"FloorDiv\": operator.floordiv,\n    \"TrueDiv\": operator.truediv,\n    \"Mod\": operator.mod,\n    \"LShift\": operator.lshift,\n    \"RShift\": operator.rshift,\n    \"BitAnd\": operator.and_,\n    \"BitOr\": operator.or_,\n    \"BitXor\": operator.xor,\n    \"Divmod\": divmod,\n    \"IAdd\": operator.iadd,\n    \"ISub\": operator.isub,\n    \"IPow\": operator.ipow,\n    \"IMult\": operator.imul,\n    \"IFloorDiv\": operator.ifloordiv,\n    \"ITrueDiv\": operator.itruediv,\n    \"IMod\": operator.imod,\n    \"ILShift\": operator.ilshift,\n    \"IRShift\": operator.irshift,\n    \"IBitAnd\": operator.iand,\n    \"IBitOr\": operator.ior,\n    \"IBitXor\": operator.ixor,\n}\n\n# Python 2 only operator\nif python_version < 0x300:\n    binary_operator_functions[\"OldDiv\"] = operator.div\n    binary_operator_functions[\"IOldDiv\"] = operator.idiv\n\n# Python 3.5 only operator\nif python_version >= 0x350:\n    binary_operator_functions[\"MatMult\"] = operator.matmul\n    binary_operator_functions[\"IMatMult\"] = operator.imatmul\n\nunary_operator_functions = {\n    \"UAdd\": operator.pos,\n    \"USub\": operator.neg,\n    \"Invert\": operator.invert,\n    \"Repr\": repr,\n    # Boolean not is treated an unary operator.\n    \"Not\": operator.not_,\n    \"Abs\": operator.abs,\n}\n\n\nrich_comparison_functions = {\n    \"Lt\": operator.lt,\n    \"LtE\": operator.le,\n    \"Eq\": operator.eq,\n    \"NotEq\": operator.ne,\n    \"Gt\": operator.gt,\n    \"GtE\": operator.ge,\n}\n\nother_comparison_functions = {\n    \"Is\": operator.is_,\n    \"IsNot\": operator.is_not,\n    \"In\": lambda value1, value2: value1 in value2,\n    \"NotIn\": lambda value1, value2: value1 not in value2,\n}\n\ncomparison_inversions = {\n    \"Is\": \"IsNot\",\n    \"IsNot\": \"Is\",\n    \"In\": \"NotIn\",\n    \"NotIn\": \"In\",\n    \"Lt\": \"GtE\",\n    \"GtE\": \"Lt\",\n    \"Eq\": \"NotEq\",\n    \"NotEq\": \"Eq\",\n    \"Gt\": \"LtE\",\n    \"LtE\": \"Gt\",\n    \"exception_match\": \"exception_mismatch\",\n    \"exception_mismatch\": \"exception_match\",\n}\n\n# Comparator change when swapping arguments of comparisons.\nrich_comparison_arg_swaps = {\n    \"Lt\": \"Gt\",\n    \"GtE\": \"LtE\",\n    \"Eq\": \"Eq\",\n    \"NotEq\": \"NotEq\",\n    \"Gt\": \"Lt\",\n    \"LtE\": \"GtE\",\n}\n\n\nall_comparison_functions = dict(rich_comparison_functions)\nall_comparison_functions.update(other_comparison_functions)\n\n\ndef matchException(left, right):\n    # This doesn't yet work, make it error exit and silence PyLint for now.\n    # pylint: disable=unused-argument\n\n    if python_version >= 0x300:\n        if type(right) is tuple:\n            for element in right:\n                if not isinstance(BaseException, element):\n                    raise TypeError(\n                        \"catching classes that do not inherit from BaseException is not allowed\"\n                    )\n        elif not isinstance(BaseException, right):\n            raise TypeError(\n                \"catching classes that do not inherit from BaseException is not allowed\"\n            )\n\n    import os\n\n    os._exit(16)\n\n\nall_comparison_functions[\"exception_match\"] = matchException\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/PythonVersions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Python version specifics.\n\nThis abstracts the Python version decisions. This makes decisions based on\nthe numbers, and attempts to give them meaningful names. Where possible it\nshould attempt to make run time detections.\n\n\"\"\"\n\nimport __future__\n\nimport ctypes\nimport os\nimport re\nimport sys\n\n\ndef getSupportedPythonVersions():\n    \"\"\"Officially supported Python versions for Nuitka.\"\"\"\n\n    return (\n        \"2.6\",\n        \"2.7\",\n        \"3.4\",\n        \"3.5\",\n        \"3.6\",\n        \"3.7\",\n        \"3.8\",\n        \"3.9\",\n        \"3.10\",\n        \"3.11\",\n    )\n\n\ndef getNotYetSupportedPythonVersions():\n    \"\"\"Versions known to not work at all (yet).\"\"\"\n    return (\"3.12\",)\n\n\ndef getPartiallySupportedPythonVersions():\n    \"\"\"Partially supported Python versions for Nuitka.\"\"\"\n\n    return ()\n\n\ndef getZstandardSupportingVersions():\n    result = getSupportedPythonVersions() + getPartiallySupportedPythonVersions()\n\n    # This will crash if we remove versions, but it is more likely to work\n    # with newly supported versions, and to list the ones not supported by\n    # zstandard.\n    result = tuple(\n        version for version in result if version not in (\"2.6\", \"2.7\", \"3.3\", \"3.4\")\n    )\n\n    return result\n\n\ndef getTestExecutionPythonVersions():\n    return (\n        getSupportedPythonVersions()\n        + getPartiallySupportedPythonVersions()\n        + getNotYetSupportedPythonVersions()\n    )\n\n\n# Make somewhat sure we keep these ones consistent\nassert len(\n    set(\n        getPartiallySupportedPythonVersions()\n        + getNotYetSupportedPythonVersions()\n        + getSupportedPythonVersions()\n    )\n) == len(\n    getPartiallySupportedPythonVersions()\n    + getNotYetSupportedPythonVersions()\n    + getSupportedPythonVersions()\n)\n\n\ndef getSupportedPythonVersionStr():\n    supported_python_versions = getSupportedPythonVersions()\n\n    supported_python_versions_str = repr(supported_python_versions)[1:-1]\n    supported_python_versions_str = re.sub(\n        r\"(.*),(.*)$\", r\"\\1, or\\2\", supported_python_versions_str\n    )\n\n    return supported_python_versions_str\n\n\ndef _getPythonVersion():\n    big, major, minor = sys.version_info[0:3]\n\n    return big * 256 + major * 16 + min(15, minor)\n\n\npython_version = _getPythonVersion()\n\npython_version_full_str = \".\".join(str(s) for s in sys.version_info[0:3])\npython_version_str = \".\".join(str(s) for s in sys.version_info[0:2])\n\n\ndef getErrorMessageExecWithNestedFunction():\n    \"\"\"Error message of the concrete Python in case an exec occurs in a\n    function that takes a closure variable.\n    \"\"\"\n\n    assert python_version < 0x300\n\n    # Need to use \"exec\" to detect the syntax error, pylint: disable=W0122\n\n    try:\n        exec(\n            \"\"\"\ndef f():\n   exec \"\"\n   def nested():\n      return closure\"\"\"\n        )\n    except SyntaxError as e:\n        return e.message.replace(\"'f'\", \"'%s'\")\n\n\ndef getComplexCallSequenceErrorTemplate():\n    if not hasattr(getComplexCallSequenceErrorTemplate, \"result\"):\n        try:\n            # We are doing this on purpose, to get the exception.\n            # pylint: disable=not-an-iterable,not-callable\n            f = None\n            f(*None)\n        except TypeError as e:\n            result = (\n                e.args[0]\n                .replace(\"NoneType object\", \"%s\")\n                .replace(\"NoneType\", \"%s\")\n                .replace(\"None \", \"%s \")\n            )\n            getComplexCallSequenceErrorTemplate.result = result\n        else:\n            sys.exit(\"Error, cannot detect expected error message.\")\n\n    return getComplexCallSequenceErrorTemplate.result\n\n\ndef getUnboundLocalErrorErrorTemplate():\n    if not hasattr(getUnboundLocalErrorErrorTemplate, \"result\"):\n        try:\n            # We are doing this on purpose, to get the exception.\n            # pylint: disable=undefined-variable\n            del _f\n        except UnboundLocalError as e:\n            result = e.args[0].replace(\"_f\", \"%s\")\n            getUnboundLocalErrorErrorTemplate.result = result\n        else:\n            sys.exit(\"Error, cannot detect expected error message.\")\n\n    return getUnboundLocalErrorErrorTemplate.result\n\n\n_needs_set_literal_reverse_insertion = None\n\n\ndef needsSetLiteralReverseInsertion():\n    \"\"\"For Python3, until Python3.5 ca. the order of set literals was reversed.\"\"\"\n    # Cached result, pylint: disable=global-statement\n    global _needs_set_literal_reverse_insertion\n\n    if _needs_set_literal_reverse_insertion is None:\n        try:\n            value = eval(\"{1,1.0}.pop()\")  # pylint: disable=eval-used\n        except SyntaxError:\n            _needs_set_literal_reverse_insertion = False\n        else:\n            _needs_set_literal_reverse_insertion = type(value) is float\n\n    return _needs_set_literal_reverse_insertion\n\n\ndef needsDuplicateArgumentColOffset():\n    if python_version < 0x353:\n        return False\n    else:\n        return True\n\n\ndef getRunningPythonDLLPath():\n    from nuitka.utils.SharedLibraries import (\n        getWindowsRunningProcessModuleFilename,\n    )\n\n    # We trust ctypes internals here, pylint: disable=protected-access\n    # spell-checker: ignore pythonapi\n    return getWindowsRunningProcessModuleFilename(ctypes.pythonapi._handle)\n\n\ndef getTargetPythonDLLPath():\n    dll_path = getRunningPythonDLLPath()\n\n    from nuitka.Options import shallUsePythonDebug\n\n    if dll_path.endswith(\"_d.dll\"):\n        if not shallUsePythonDebug():\n            dll_path = dll_path[:-6] + \".dll\"\n\n        if not os.path.exists(dll_path):\n            sys.exit(\"Error, cannot switch to non-debug Python, not installed.\")\n\n    else:\n        if shallUsePythonDebug():\n            dll_path = dll_path[:-4] + \"_d.dll\"\n\n        if not os.path.exists(dll_path):\n            sys.exit(\"Error, cannot switch to debug Python, not installed.\")\n\n    return dll_path\n\n\ndef isStaticallyLinkedPython():\n    # On Windows, there is no way to detect this from sysconfig.\n    if os.name == \"nt\":\n        return ctypes.pythonapi is None\n\n    try:\n        import sysconfig\n    except ImportError:\n        # Cannot detect this properly for Python 2.6, but we don't care much\n        # about that anyway.\n        return False\n\n    result = sysconfig.get_config_var(\"Py_ENABLE_SHARED\") == 0\n\n    return result\n\n\ndef getPythonABI():\n    if hasattr(sys, \"abiflags\"):\n        abiflags = sys.abiflags\n\n        # Cyclic dependency here.\n        from nuitka.Options import shallUsePythonDebug\n\n        # spell-checker: ignore getobjects\n        if shallUsePythonDebug() or hasattr(sys, \"getobjects\"):\n            if not abiflags.startswith(\"d\"):\n                abiflags = \"d\" + abiflags\n    else:\n        abiflags = \"\"\n\n    return abiflags\n\n\n_the_sys_prefix = None\n\n\ndef getSystemPrefixPath():\n    \"\"\"Return real sys.prefix as an absolute path breaking out of virtualenv.\n\n    Note:\n\n        For Nuitka, it often is OK to break out of the virtualenv, and use the\n        original install. Mind you, this is not about executing anything, this is\n        about building, and finding the headers to compile against that Python, we\n        do not care about any site packages, and so on.\n\n    Returns:\n        str - path to system prefix\n    \"\"\"\n\n    global _the_sys_prefix  # Cached result, pylint: disable=global-statement\n    if _the_sys_prefix is None:\n        sys_prefix = getattr(\n            sys, \"real_prefix\", getattr(sys, \"base_prefix\", sys.prefix)\n        )\n        sys_prefix = os.path.abspath(sys_prefix)\n\n        # Some virtualenv contain the \"orig-prefix.txt\" as a textual link to the\n        # target, this is often on Windows with virtualenv. There are two places to\n        # look for.\n        for candidate in (\n            \"Lib/orig-prefix.txt\",\n            \"lib/python%s/orig-prefix.txt\" % python_version_str,\n        ):\n            candidate = os.path.join(sys_prefix, candidate)\n            if os.path.exists(candidate):\n                # Cannot use FileOperations.getFileContents() here, because of circular dependency.\n                # pylint: disable=unspecified-encoding\n                with open(candidate) as f:\n                    sys_prefix = f.read()\n\n                # Trailing spaces in the python prefix, please not.\n                assert sys_prefix == sys_prefix.strip()\n\n        # This is another for of virtualenv references:\n        if os.name != \"nt\" and os.path.islink(os.path.join(sys_prefix, \".Python\")):\n            sys_prefix = os.path.normpath(\n                os.path.join(os.readlink(os.path.join(sys_prefix, \".Python\")), \"..\")\n            )\n\n        # Some virtualenv created by \"venv\" seem to have a different structure, where\n        # library and include files are outside of it.\n        if (\n            os.name != \"nt\"\n            and python_version >= 0x330\n            and os.path.exists(os.path.join(sys_prefix, \"bin/activate\"))\n        ):\n            python_binary = os.path.join(sys_prefix, \"bin\", \"python\")\n            python_binary = os.path.realpath(python_binary)\n\n            sys_prefix = os.path.normpath(os.path.join(python_binary, \"..\", \"..\"))\n\n        # Resolve symlinks on Windows manually.\n        if os.name == \"nt\":\n            from nuitka.utils.FileOperations import getDirectoryRealPath\n\n            sys_prefix = getDirectoryRealPath(sys_prefix)\n\n        # Self-compiled Python version in source tree\n        if os.path.isdir(\n            os.path.join(os.path.dirname(os.path.realpath(sys.executable)), \"PCbuild\")\n        ):\n            sys_prefix = os.path.dirname(os.path.realpath(sys.executable))\n\n        _the_sys_prefix = sys_prefix\n\n    return _the_sys_prefix\n\n\ndef getFutureModuleKeys():\n    result = [\n        \"unicode_literals\",\n        \"absolute_import\",\n        \"division\",\n        \"print_function\",\n        \"generator_stop\",\n        \"nested_scopes\",\n        \"generators\",\n        \"with_statement\",\n    ]\n\n    if hasattr(__future__, \"barry_as_FLUFL\"):\n        result.append(\"barry_as_FLUFL\")\n    if hasattr(__future__, \"annotations\"):\n        result.append(\"annotations\")\n\n    return result\n\n\ndef getImportlibSubPackages():\n    result = []\n    if python_version >= 0x270:\n        import importlib\n        import pkgutil\n\n        for module_info in pkgutil.walk_packages(importlib.__path__):\n            result.append(module_info[1])\n\n    return result\n\n\ndef isDebugPython():\n    \"\"\"Is this a debug build of Python.\"\"\"\n    return hasattr(sys, \"gettotalrefcount\")\n\n\ndef _getFloatDigitBoundaryValue():\n    if python_version < 0x270:\n        bits_per_digit = 15\n    elif python_version < 0x300:\n        bits_per_digit = sys.long_info.bits_per_digit\n    else:\n        bits_per_digit = sys.int_info.bits_per_digit\n\n    return (2**bits_per_digit) - 1\n\n\n_float_digit_boundary = _getFloatDigitBoundaryValue()\n\n\ndef isPythonValidDigitValue(value):\n    \"\"\"Does the given value fit into a float digit.\n\n    Note: Digits in long objects do not use 2-complement, but a boolean sign.\n    \"\"\"\n\n    return -_float_digit_boundary <= value <= _float_digit_boundary\n\n\nsizeof_clong = ctypes.sizeof(ctypes.c_long)\n\n# TODO: We could be more aggressive here, there are issues with using full\n# values, in some contexts, but that can probably be sorted out.\n_max_signed_long = 2 ** (sizeof_clong * 7) - 1\n_min_signed_long = -(2 ** (sizeof_clong * 7))\n\n# Used by data composer to write Python long values.\nsizeof_clonglong = ctypes.sizeof(ctypes.c_longlong)\n\n_max_signed_longlong = 2 ** (sizeof_clonglong * 8 - 1) - 1\n_min_signed_longlong = -(2 ** (sizeof_clonglong * 8 - 1))\n\n\ndef isPythonValidCLongValue(value):\n    return _min_signed_long <= value <= _max_signed_long\n\n\ndef isPythonValidCLongLongValue(value):\n    return _min_signed_longlong <= value <= _max_signed_longlong\n\n\ndef getInstalledPythonRegistryPaths(version):\n    \"\"\"Yield all Pythons as found in the Windows registry.\"\"\"\n    # Windows only code,\n    # pylint: disable=I0021,import-error,redefined-builtin\n    from nuitka.__past__ import WindowsError\n\n    if str is bytes:\n        import _winreg as winreg  # pylint: disable=I0021,import-error,no-name-in-module\n    else:\n        import winreg  # pylint: disable=I0021,import-error,no-name-in-module\n\n    for hkey_branch in (winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER):\n        for arch_key in (0, winreg.KEY_WOW64_32KEY, winreg.KEY_WOW64_64KEY):\n            for suffix in \"\", \"-32\", \"-arm64\":\n                try:\n                    key = winreg.OpenKey(\n                        hkey_branch,\n                        r\"SOFTWARE\\Python\\PythonCore\\%s%s\\InstallPath\"\n                        % (version, suffix),\n                        0,\n                        winreg.KEY_READ | arch_key,\n                    )\n\n                    install_dir = os.path.normpath(winreg.QueryValue(key, \"\"))\n                except WindowsError:\n                    pass\n                else:\n                    candidate = os.path.normpath(\n                        os.path.join(install_dir, \"python.exe\")\n                    )\n\n                    if os.path.exists(candidate):\n                        yield candidate\n\n\ndef getTkInterVersion():\n    \"\"\"Get the tk-inter version or None if not installed.\"\"\"\n    try:\n        if str is bytes:\n            return str(__import__(\"TkInter\").TkVersion)\n        else:\n            return str(__import__(\"tkinter\").TkVersion)\n    except ImportError:\n        # This should lead to no action taken ideally.\n        return None\n\n\ndef getModuleLinkerLibs():\n    \"\"\"Get static link libraries needed.\"\"\"\n    try:\n        import sysconfig\n    except ImportError:\n        return []\n    else:\n        # static link libraries might be there, spell-checker: ignore modlibs\n        result = sysconfig.get_config_var(\"MODLIBS\") or \"\"\n        result = [entry[2:] for entry in result.split() if entry.startswith(\"-l:\")]\n\n        return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Serialization.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Write and read constants data files and provide identifiers.\n\n\"\"\"\n\nimport os\nimport pickle\nimport sys\n\nfrom nuitka import OutputDirectories\nfrom nuitka.__past__ import (  # pylint: disable=I0021,redefined-builtin\n    BaseExceptionGroup,\n    ExceptionGroup,\n    GenericAlias,\n    UnionType,\n    basestring,\n    to_byte,\n    xrange,\n)\nfrom nuitka.Builtins import (\n    builtin_anon_codes,\n    builtin_anon_values,\n    builtin_exception_values_list,\n)\n\n# TODO: Move to constants\nfrom nuitka.code_generation.Namify import namifyConstant\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.FileOperations import openPickleFile\n\n\nclass BuiltinAnonValue(object):\n    \"\"\"Used to pickle anonymous values.\"\"\"\n\n    # Python3 values has no index, turn into a tuple.\n    anon_values = tuple(builtin_anon_values.values())\n\n    def __init__(self, anon_name):\n        self.anon_name = anon_name\n\n    def getStreamValueByte(self):\n        \"\"\"Return byte value, encoding the anon built-in value.\"\"\"\n\n        return to_byte(self.anon_values.index(self.anon_name))\n\n\nclass BuiltinGenericAliasValue(object):\n    \"\"\"For transporting GenericAlias values through pickler.\"\"\"\n\n    def __init__(self, origin, args):\n        self.origin = origin\n        self.args = args\n\n\nclass BuiltinUnionTypeValue(object):\n    \"\"\"For transporting UnionType values through pickler.\"\"\"\n\n    def __init__(self, args):\n        self.args = args\n\n\nclass BuiltinSpecialValue(object):\n    \"\"\"Used to pickle special values.\"\"\"\n\n    def __init__(self, value):\n        self.value = value\n\n    def getStreamValueByte(self):\n        \"\"\"Return byte value, encoding the special built-in value.\"\"\"\n\n        # Currently the only ones.\n        if self.value == \"Ellipsis\":\n            return to_byte(0)\n        elif self.value == \"NotImplemented\":\n            return to_byte(1)\n        elif self.value == \"Py_SysVersionInfo\":\n            return to_byte(2)\n        else:\n            assert False, self.value\n\n\nclass BlobData(object):\n    \"\"\"Used to pickle bytes to become raw pointers.\"\"\"\n\n    __slots__ = (\"data\", \"name\")\n\n    def __init__(self, data, name):\n        self.data = data\n        self.name = name\n\n    def getData(self):\n        return self.data\n\n    def __repr__(self):\n        return \"<nuitka.Serialization.BlobData %s>\" % self.name\n\n\ndef _pickleAnonValues(pickler, value):\n    if value in builtin_anon_values:\n        pickler.save(BuiltinAnonValue(builtin_anon_values[value]))\n    elif value is Ellipsis:\n        pickler.save(BuiltinSpecialValue(\"Ellipsis\"))\n    elif value is NotImplemented:\n        pickler.save(BuiltinSpecialValue(\"NotImplemented\"))\n    elif value is sys.version_info:\n        pickler.save(BuiltinSpecialValue(\"Py_SysVersionInfo\"))\n    else:\n        pickler.save_global(value)\n\n\ndef _pickleGenericAlias(pickler, value):\n    pickler.save(BuiltinGenericAliasValue(origin=value.__origin__, args=value.__args__))\n\n\ndef _pickleUnionType(pickler, value):\n    pickler.save(BuiltinUnionTypeValue(args=value.__args__))\n\n\nclass ConstantStreamWriter(object):\n    \"\"\"Write constants to a stream and return numbers for them.\"\"\"\n\n    def __init__(self, filename):\n        self.count = 0\n\n        filename = os.path.join(OutputDirectories.getSourceDirectoryPath(), filename)\n        self.file, self.pickle = openPickleFile(filename, \"wb\")\n\n        self.pickle.dispatch[type] = _pickleAnonValues\n        self.pickle.dispatch[type(Ellipsis)] = _pickleAnonValues\n        self.pickle.dispatch[type(NotImplemented)] = _pickleAnonValues\n\n        if type(sys.version_info) is not tuple:\n            self.pickle.dispatch[type(sys.version_info)] = _pickleAnonValues\n\n        # Standard pickling doesn't work with our necessary wrappers.\n        if python_version >= 0x390:\n            self.pickle.dispatch[GenericAlias] = _pickleGenericAlias\n\n        if python_version >= 0x3A0:\n            self.pickle.dispatch[UnionType] = _pickleUnionType\n\n    def addConstantValue(self, constant_value):\n        self.pickle.dump(constant_value)\n        self.count += 1\n\n    def addBlobData(self, data, name):\n        self.pickle.dump(BlobData(data, name))\n        self.count += 1\n\n    def close(self):\n        self.file.close()\n\n\nclass ConstantStreamReader(object):\n    def __init__(self, const_file):\n        self.count = 0\n        self.pickle = pickle.Unpickler(const_file)\n\n    def readConstantValue(self):\n        return self.pickle.load()\n\n\nclass ConstantAccessor(object):\n    def __init__(self, data_filename, top_level_name):\n        self.constants = OrderedSet()\n\n        self.constants_writer = ConstantStreamWriter(data_filename)\n        self.top_level_name = top_level_name\n\n    def getConstantCode(self, constant):\n        # Use in user code, or for constants building code itself, many\n        # constant types get special code immediately.\n        # pylint: disable=too-many-branches,too-many-statements\n        if constant is None:\n            key = \"Py_None\"\n        elif constant is True:\n            key = \"Py_True\"\n        elif constant is False:\n            key = \"Py_False\"\n        elif constant is Ellipsis:\n            key = \"Py_Ellipsis\"\n        elif constant is NotImplemented:\n            key = \"Py_NotImplemented\"\n        elif constant is sys.version_info:\n            key = \"Py_SysVersionInfo\"\n        elif type(constant) is type:\n            # TODO: Maybe make this a mapping in nuitka.Builtins\n\n            if constant is None:\n                key = \"(PyObject *)Py_TYPE(Py_None)\"\n            elif constant is object:\n                key = \"(PyObject *)&PyBaseObject_Type\"\n            elif constant is staticmethod:\n                key = \"(PyObject *)&PyStaticMethod_Type\"\n            elif constant is classmethod:\n                key = \"(PyObject *)&PyClassMethod_Type\"\n            elif constant is bytearray:\n                key = \"(PyObject *)&PyByteArray_Type\"\n            elif constant is enumerate:\n                key = \"(PyObject *)&PyEnum_Type\"\n            elif constant is frozenset:\n                key = \"(PyObject *)&PyFrozenSet_Type\"\n            elif python_version >= 0x270 and constant is memoryview:\n                key = \"(PyObject *)&PyMemoryView_Type\"\n            elif python_version < 0x300 and constant is basestring:\n                key = \"(PyObject *)&PyBaseString_Type\"\n            elif python_version < 0x300 and constant is xrange:\n                key = \"(PyObject *)&PyRange_Type\"\n            elif constant in builtin_anon_values:\n                key = \"(PyObject *)\" + builtin_anon_codes[builtin_anon_values[constant]]\n            elif constant in builtin_exception_values_list:\n                key = \"(PyObject *)PyExc_%s\" % constant.__name__\n            elif constant is ExceptionGroup:\n                key = \"(PyObject *)_PyInterpreterState_GET()->exc_state.PyExc_ExceptionGroup\"\n            elif constant is BaseExceptionGroup:\n                key = \"(PyObject *)PyExc_BaseExceptionGroup\"\n            else:\n                type_name = constant.__name__\n\n                if constant is int and python_version >= 0x300:\n                    type_name = \"long\"\n                elif constant is str:\n                    type_name = \"string\" if python_version < 0x300 else \"unicode\"\n\n                key = \"(PyObject *)&Py%s_Type\" % type_name.capitalize()\n        else:\n            key = \"const_\" + namifyConstant(constant)\n\n            if key not in self.constants:\n                self.constants.add(key)\n                self.constants_writer.addConstantValue(constant)\n\n            key = \"%s[%d]\" % (self.top_level_name, self.constants.index(key))\n\n        # TODO: Make it returning, more clear.\n        return key\n\n    def getBlobDataCode(self, data, name):\n        key = \"blob_\" + namifyConstant(data)\n\n        if key not in self.constants:\n            self.constants.add(key)\n            self.constants_writer.addBlobData(data=data, name=name)\n\n        key = \"%s[%d]\" % (self.top_level_name, self.constants.index(key))\n\n        return key\n\n    def getConstantsCount(self):\n        # Make sure to add no more after asking this.\n        self.constants_writer.close()\n\n        return len(self.constants)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/SourceCodeReferences.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Source code reference record.\n\nAll the information to lookup line and file of a code location, together with\nthe future flags in use there.\n\"\"\"\n\nfrom nuitka.__past__ import total_ordering\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\n\n\n@total_ordering\nclass SourceCodeReference(object):\n    __slots__ = [\"filename\", \"line\", \"column\"]\n\n    @classmethod\n    def fromFilenameAndLine(cls, filename, line):\n        result = cls()\n\n        result.filename = filename\n        result.line = line\n\n        return result\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    @counted_init\n    def __init__(self):\n        self.filename = None\n        self.line = None\n        self.column = None\n\n    def __repr__(self):\n        return \"<%s to %s:%s>\" % (self.__class__.__name__, self.filename, self.line)\n\n    def __hash__(self):\n        return hash((self.filename, self.line, self.column))\n\n    def __lt__(self, other):\n        # Many cases decide early, pylint: disable=too-many-return-statements\n        if other is None:\n            return True\n\n        if other is self:\n            return False\n\n        assert isinstance(other, SourceCodeReference), other\n\n        if self.filename < other.filename:\n            return True\n        elif self.filename > other.filename:\n            return False\n        else:\n            if self.line < other.line:\n                return True\n            elif self.line > other.line:\n                return False\n            else:\n                if self.column < other.column:\n                    return True\n                elif self.column > other.column:\n                    return False\n                else:\n                    return self.isInternal() < other.isInternal()\n\n    def __eq__(self, other):\n        if other is None:\n            return False\n\n        if other is self:\n            return True\n\n        assert isinstance(other, SourceCodeReference), other\n\n        if self.filename != other.filename:\n            return False\n\n        if self.line != other.line:\n            return False\n\n        if self.column != other.column:\n            return False\n\n        return self.isInternal() is other.isInternal()\n\n    def _clone(self, line):\n        \"\"\"Make a copy it itself.\"\"\"\n        return self.fromFilenameAndLine(filename=self.filename, line=line)\n\n    def atInternal(self):\n        \"\"\"Make a copy it itself but mark as internal code.\n\n        Avoids useless copies, by returning an internal object again if\n        it is already internal.\n        \"\"\"\n        if not self.isInternal():\n            result = self._clone(self.line)\n\n            return result\n        else:\n            return self\n\n    def atLineNumber(self, line):\n        \"\"\"Make a reference to the same file, but different line.\n\n        Avoids useless copies, by returning same object if the line is\n        the same.\n        \"\"\"\n\n        assert type(line) is int, line\n\n        if self.line != line:\n            return self._clone(line)\n        else:\n            return self\n\n    def atColumnNumber(self, column):\n        assert type(column) is int, column\n\n        if self.column != column:\n            result = self._clone(self.line)\n            result.column = column\n            return result\n        else:\n            return self\n\n    def getLineNumber(self):\n        return self.line\n\n    def getColumnNumber(self):\n        return self.column\n\n    def getFilename(self):\n        return self.filename\n\n    def getAsString(self):\n        return \"%s:%s\" % (self.filename, self.line)\n\n    @staticmethod\n    def isInternal():\n        return False\n\n\nclass SourceCodeReferenceInternal(SourceCodeReference):\n    __slots__ = ()\n\n    @staticmethod\n    def isInternal():\n        return True\n\n\ndef fromFilename(filename):\n    return SourceCodeReference.fromFilenameAndLine(filename=filename, line=1)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Tracing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Outputs to the user.\n\nPrinting with intends or plain, mostly a compensation for the print strangeness.\n\nWe want to avoid \"from __future__ import print_function\" in every file out\nthere, which makes adding another debug print rather tedious. This should\ncover all calls/uses of \"print\" we have to do, and the make it easy to simply\nto \"print for_debug\" without much hassle (braces).\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport struct\nimport sys\nimport textwrap\nimport traceback\n\nfrom nuitka.utils.Utils import isWin32Windows\n\n# Written by Options module.\nis_quiet = False\n\n# We have to interact with displayed progress bars when doing out trace outputs.\nprogress = None\n\n\ndef setQuiet():\n    # singleton, pylint: disable=global-statement\n    global is_quiet\n    is_quiet = True\n\n\ndef printIndented(level, *what):\n    print(\"    \" * level, *what)\n\n\ndef printSeparator(level=0):\n    print(\"    \" * level, \"*\" * 10)\n\n\ndef printLine(*what, **kwargs):\n    is_atty = sys.stdout.isatty()\n\n    if progress and is_atty:\n        progress.close()\n\n    print(*what, **kwargs)\n\n\ndef printError(message):\n    my_print(message, file=sys.stderr)\n\n\ndef flushStandardOutputs():\n    sys.stdout.flush()\n    sys.stderr.flush()\n\n\ndef _getEnableStyleCode(style):\n    style = _aliasStyle(style)\n\n    if style == \"pink\":\n        style = \"\\033[95m\"\n    elif style == \"blue\":\n        style = \"\\033[94m\"\n    elif style == \"green\":\n        style = \"\\033[92m\"\n    elif style == \"yellow\":\n        style = \"\\033[93m\"\n    elif style == \"red\":\n        style = \"\\033[91m\"\n    elif style == \"bold\":\n        style = \"\\033[1m\"\n    elif style == \"underline\":\n        style = \"\\033[4m\"\n    else:\n        style = None\n\n    return style\n\n\n_enabled_ansi = False\n\n\ndef _enableAnsi():\n    # singleton, pylint: disable=global-statement\n    global _enabled_ansi\n    if not _enabled_ansi:\n        # Only necessary on Windows, as a side effect of this, ANSI colors get enabled\n        # for the terminal and never deactivated, so we are free to use them after\n        # this.\n        if os.name == \"nt\":\n            os.system(\"\")\n\n        _enabled_ansi = True\n\n\ndef _getDisableStyleCode():\n    return \"\\033[0m\"\n\n\ndef _getIoctlGWINSZ(fd):\n    # On non-Windows, this might work, # spell-checker: ignore GWINSZ,TIOCGWINSZ\n    try:\n        # pylint: disable=I0021,import-error\n        import fcntl\n        import termios\n\n        return struct.unpack(\"hh\", fcntl.ioctl(fd, termios.TIOCGWINSZ, \"1234\"))\n    except BaseException:  # Catch all the things, pylint: disable=broad-except\n        return None\n\n\ndef _getTerminalSizeWin32():\n    try:\n        from ctypes import create_string_buffer, windll\n\n        # handles are -10 to -12\n        h = windll.kernel32.GetStdHandle(-12)\n        buffer = create_string_buffer(22)\n\n        res = windll.kernel32.GetConsoleScreenBufferInfo(h, buffer)\n        if res:\n            # TODO: Could also define the C structure\n            (\n                _,\n                _,\n                _,\n                _,\n                _,\n                left,\n                top,\n                right,\n                bottom,\n                _,\n                _,\n            ) = struct.unpack(\"hhhhHhhhhhh\", buffer.raw)\n\n            columns = right - left + 1\n            lines = bottom - top + 1\n\n            return lines, columns\n    except BaseException:  # Catch all the things, pylint: disable=broad-except\n        return None\n\n\ndef _getTerminalSize():\n    # For Python2, we get to do it ourselves.\n\n    if str is bytes:\n        if isWin32Windows():\n            columns = _getTerminalSizeWin32()\n        else:\n            # Try all file handles.\n            columns = _getIoctlGWINSZ(0) or _getIoctlGWINSZ(1) or _getIoctlGWINSZ(2)\n\n        if columns:\n            return columns[1]\n\n        try:\n            return int(os.getenv(\"COLUMNS\", \"1000\"))\n        except ValueError:\n            return 1000\n    else:\n        try:\n            return os.get_terminal_size()[0]\n        except OSError:\n            return 1000\n\n\ndef _aliasStyle(style):\n    \"\"\"Map named styles to concrete colors.\"\"\"\n\n    # return driven, pylint: disable=too-many-return-statements\n\n    if style == \"test-prepare\":\n        return \"pink\"\n    if style == \"test-progress\":\n        return \"blue\"\n    if style == \"test-debug\":\n        return \"bold\"\n    if style == \"link\":\n        return \"blue\"\n    if style == \"warning\":\n        return \"yellow\"\n    if style == \"scons-unexpected\":\n        return \"yellow\"\n    if style == \"error\":\n        return \"red\"\n    else:\n        return style\n\n\ndef _my_print(file_output, is_atty, args, kwargs):\n    if \"style\" in kwargs:\n        style = kwargs[\"style\"]\n        del kwargs[\"style\"]\n\n        if \"end\" in kwargs:\n            end = kwargs[\"end\"]\n            del kwargs[\"end\"]\n        else:\n            end = \"\\n\"\n\n        if style is not None and is_atty:\n            enable_style = _getEnableStyleCode(style)\n\n            if enable_style is None:\n                raise ValueError(\n                    \"%r is an invalid value for keyword argument style\" % style\n                )\n\n            _enableAnsi()\n\n            print(enable_style, end=\"\", **kwargs)\n\n        print(*args, end=end, **kwargs)\n\n        if style is not None and is_atty:\n            print(_getDisableStyleCode(), end=\"\", **kwargs)\n    else:\n        print(*args, **kwargs)\n\n    # Flush the output.\n    file_output.flush()\n\n\ndef my_print(*args, **kwargs):\n    \"\"\"Make sure we flush after every print.\n\n    Not even the \"-u\" option does more than that and this is easy enough.\n\n    Use kwarg style=[option] to print in a style listed below\n    \"\"\"\n\n    file_output = kwargs.get(\"file\", sys.stdout)\n    is_atty = file_output.isatty()\n\n    if progress and is_atty:\n        with progress.withExternalWritingPause():\n            _my_print(file_output, is_atty, args, kwargs)\n    else:\n        _my_print(file_output, is_atty, args, kwargs)\n\n\nclass ReportingSystemExit(SystemExit):\n    \"\"\"Our own system exit, after which a report should be written.\"\"\"\n\n    def __init__(self, exit_code, exit_message):\n        SystemExit.__init__(self, exit_code)\n\n        self.exit_message = exit_message\n\n\nclass OurLogger(object):\n    def __init__(self, name, quiet=False, base_style=None):\n        self.name = name\n        self.base_style = base_style\n        self.is_quiet = quiet\n\n    def my_print(self, message, **kwargs):\n        # For overload, pylint: disable=no-self-use\n        my_print(message, **kwargs)\n\n    @staticmethod\n    def _warnMnemonic(mnemonic, style, output_function):\n        if mnemonic.startswith(\"http\"):\n            url = mnemonic\n            extra_prefix = \"\"\n        else:\n            url = \"https://nuitka.net/info/%s.html\" % mnemonic\n            extra_prefix = \"Complex topic! \"\n\n        output_function(\n            \"\"\"    %sMore information can be found at %s%s\"\"\"\n            % (extra_prefix, _getEnableStyleCode(\"link\"), url),\n            style=style,\n        )\n\n    def _printFormatted(self, prefix, message, style, keep_format):\n        style = style or self.base_style\n\n        if sys.stderr.isatty() and not keep_format:\n            width = _getTerminalSize() or 10000\n        else:\n            width = 10000\n\n        formatted_message = textwrap.fill(\n            message,\n            width=width,\n            initial_indent=prefix,\n            subsequent_indent=prefix,\n            break_on_hyphens=False,\n            break_long_words=False,\n            expand_tabs=False,\n            replace_whitespace=False,\n        )\n        self.my_print(formatted_message, style=style, file=sys.stderr)\n\n    def warning(self, message, style=\"yellow\", mnemonic=None, keep_format=False):\n        if mnemonic is not None:\n            from .Options import shallDisplayWarningMnemonic\n\n            if not shallDisplayWarningMnemonic(mnemonic):\n                return\n\n        if self.name:\n            prefix = \"%s:WARNING: \" % self.name\n        else:\n            prefix = \"WARNING: \"\n\n        self._printFormatted(\n            prefix=prefix, message=message, style=style, keep_format=keep_format\n        )\n\n        if mnemonic is not None:\n            self._warnMnemonic(mnemonic, style=style, output_function=self.warning)\n\n    def sysexit(\n        self, message=\"\", style=None, mnemonic=None, exit_code=1, reporting=False\n    ):\n        from nuitka.Progress import closeProgressBar\n\n        closeProgressBar()\n\n        if exit_code != 0 and style is None:\n            style = \"red\"\n\n        if message:\n            if exit_code != 0:\n                self.my_print(\n                    \"FATAL: %s\" % message,\n                    style=style,\n                    file=sys.stderr,\n                )\n            else:\n                self.my_print(\n                    message,\n                    style=style,\n                    file=sys.stderr,\n                )\n\n        if mnemonic is not None:\n            self._warnMnemonic(mnemonic, style=style, output_function=self.warning)\n\n        if reporting:\n            raise ReportingSystemExit(exit_code=exit_code, exit_message=message)\n\n        sys.exit(exit_code)\n\n    def sysexit_exception(self, message, exception, exit_code=1):\n        self.my_print(\"FATAL: %s\" % message, style=\"red\", file=sys.stderr)\n\n        traceback.print_exc()\n        self.sysexit(\"FATAL:\" + repr(exception), exit_code=exit_code, reporting=True)\n\n    def isQuiet(self):\n        return is_quiet or self.is_quiet\n\n    def info(self, message, style=None, mnemonic=None, prefix=None, keep_format=False):\n        if not self.isQuiet():\n            self._printFormatted(\n                prefix=(\n                    \"%s: \" % self.name\n                    if prefix is None\n                    else \"%s:%s: \" % (self.name, prefix)\n                ),\n                message=message,\n                style=style,\n                keep_format=keep_format,\n            )\n\n            if mnemonic is not None:\n                self._warnMnemonic(mnemonic, style=style, output_function=self.info)\n\n\nclass FileLogger(OurLogger):\n    def __init__(self, name, quiet=False, base_style=None, file_handle=None):\n        OurLogger.__init__(self, name=name, quiet=quiet, base_style=base_style)\n\n        self.file_handle = file_handle\n\n    def my_print(self, message, **kwargs):\n        if \"file\" not in kwargs:\n            kwargs[\"file\"] = self.file_handle or sys.stdout\n\n        my_print(message, **kwargs)\n        kwargs[\"file\"].flush()\n\n    def setFileHandle(self, file_handle):\n        self.file_handle = file_handle\n\n    def isFileOutput(self):\n        return self.file_handle is not None\n\n    def info(self, message, style=None, mnemonic=None):\n        if not self.isQuiet() or self.file_handle:\n            message = \"%s: %s\" % (self.name, message)\n\n            style = style or self.base_style\n            self.my_print(message, style=style)\n\n            if mnemonic is not None:\n                self._warnMnemonic(mnemonic, style=style, output_function=self.my_print)\n\n    def debug(self, message, style=None):\n        if self.file_handle:\n            message = \"%s:DEBUG: %s\" % (self.name, message)\n\n            style = style or self.base_style\n            self.my_print(message, style=style)\n\n    def info_to_file_only(self, message, style=None):\n        if self.file_handle:\n            self.info(message, style=style)\n\n    def info_if_file(self, message, other_logger, style=None):\n        if self.file_handle:\n            self.info(message, style=style)\n        else:\n            other_logger.info(message, style=style)\n\n\ngeneral = OurLogger(\"Nuitka\")\nplugins_logger = OurLogger(\"Nuitka-Plugins\")\nrecursion_logger = OurLogger(\"Nuitka-Inclusion\")\nprogress_logger = OurLogger(\"Nuitka-Progress\", quiet=True)\nmemory_logger = OurLogger(\"Nuitka-Memory\")\nmetadata_logger = OurLogger(\"Nuitka-Metadata\")\noptimization_logger = FileLogger(\"Nuitka-Optimization\")\npgo_logger = FileLogger(\"Nuitka-PGO\")\ncode_generation_logger = OurLogger(\"Nuitka-CodeGen\")\ninclusion_logger = FileLogger(\"Nuitka-Inclusion\")\nscons_logger = OurLogger(\"Nuitka-Scons\")\nscons_details_logger = OurLogger(\"Nuitka-Scons\")\npostprocessing_logger = OurLogger(\"Nuitka-Postprocessing\")\noptions_logger = OurLogger(\"Nuitka-Options\")\nunusual_logger = OurLogger(\"Nuitka-Unusual\")\ndata_composer_logger = OurLogger(\"Nuitka-DataComposer\")\nonefile_logger = OurLogger(\"Nuitka-Onefile\")\ntools_logger = OurLogger(\"Nuitka-Tools\")\nwheel_logger = OurLogger(\"Nuitka-Wheel\", base_style=\"blue\")\ncache_logger = OurLogger(\"Nuitka-Cache\")\nreports_logger = OurLogger(\"Nuitka-Reports\")\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/TreeXML.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" XML node tree handling\n\nMeans to create XML elements from Nuitka tree nodes and to convert the\nXML tree to ASCII or output it.\n\"\"\"\n\nfrom nuitka.__past__ import StringIO\n\n\ndef _indent(elem, level=0, more_sibs=False):\n    i = \"\\n\"\n    if level:\n        i += (level - 1) * \"  \"\n    num_kids = len(elem)\n    if num_kids:\n        if not elem.text or not elem.text.strip():\n            elem.text = i + \"  \"\n            if level:\n                elem.text += \"  \"\n        count = 0\n        for kid in elem:\n            _indent(kid, level + 1, count < num_kids - 1)\n            count += 1\n        if not elem.tail or not elem.tail.strip():\n            elem.tail = i\n            if more_sibs:\n                elem.tail += \"  \"\n    else:\n        if level and (not elem.tail or not elem.tail.strip()):\n            elem.tail = i\n            if more_sibs:\n                elem.tail += \"  \"\n\n    return elem\n\n\ndef _dedent(elem, level=0):\n    if not elem.text or not elem.text.strip():\n        elem.text = \"\"\n\n    for child in elem:\n        _dedent(child, level + 1)\n\n    if not elem.tail or not elem.tail.strip():\n        elem.tail = \"\"\n\n    return elem\n\n\ntry:\n    import xml.etree.ElementTree\n\n    xml_module = xml.etree.ElementTree\n\n    Element = xml.etree.ElementTree.Element\n\n    def xml_tostring(tree, indent=True, encoding=None):\n        if indent:\n            _indent(tree)\n        elif not indent:\n            _dedent(tree)\n\n        return xml_module.tostring(tree, encoding=encoding)\n\nexcept ImportError:\n    xml_module = None\n    Element = None\n    xml_tostring = None\n\n# TODO: Use the writer to create the XML we output. That should be more\n# scalable and/or faster.\n# try:\n#     from lxml import (\n#         xmlfile as xml_writer,  # pylint: disable=I0021,import-error,unused-import\n#     )\n# except ImportError:\n#     xml_writer = None\n\n\ndef toBytes(tree, indent=True, encoding=None):\n    return xml_tostring(tree, indent=indent, encoding=encoding)\n\n\ndef toString(tree):\n    result = toBytes(tree, encoding=\"utf8\")\n\n    if str is not bytes:\n        result = result.decode(\"utf8\")\n\n    return result\n\n\ndef fromString(text):\n    return fromFile(StringIO(text))\n\n\ndef fromFile(file_handle, use_lxml=False):\n    if use_lxml:\n        from lxml import etree  # pylint: disable=I0021,import-error\n\n        return etree.parse(file_handle).getroot()\n    else:\n        return xml_module.parse(file_handle).getroot()\n\n\ndef appendTreeElement(parent, *args, **kwargs):\n    element = Element(*args, **kwargs)\n\n    parent.append(element)\n\n    return element\n\n\ndef dumpTreeXMLToFile(tree, output_file):\n    \"\"\"Write an XML node tree to a file.\"\"\"\n\n    value = toBytes(tree).rstrip()\n    output_file.write(value)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Variables.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Variables link the storage and use of a Python variable together.\n\nDifferent kinds of variables represent different scopes and owners types,\nand their links between each other, i.e. references as in closure or\nmodule variable references.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.__past__ import iterItems\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import tshape_dict\nfrom nuitka.nodes.shapes.StandardShapes import tshape_unknown\nfrom nuitka.utils import Utils\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\n\ncomplete = False\n\n\nclass Variable(getMetaClassBase(\"Variable\", require_slots=True)):\n    # We will need all of these attributes, since we track the global\n    # state and cache some decisions as attributes. TODO: But in some\n    # cases, part of the these might be moved to the outside.\n    __slots__ = (\n        \"variable_name\",\n        \"owner\",\n        \"version_number\",\n        \"shared_users\",\n        \"traces\",\n        \"users\",\n        \"writers\",\n    )\n\n    @counted_init\n    def __init__(self, owner, variable_name):\n        assert type(variable_name) is str, variable_name\n        assert type(owner) not in (tuple, list), owner\n\n        self.variable_name = variable_name\n        self.owner = owner\n\n        self.version_number = 0\n\n        self.shared_users = False\n\n        self.traces = set()\n\n        # Derived from all traces.\n        self.users = None\n        self.writers = None\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def finalize(self):\n        del self.users\n        del self.writers\n        del self.traces\n        del self.owner\n\n    def __repr__(self):\n        return \"<%s '%s' of '%s'>\" % (\n            self.__class__.__name__,\n            self.variable_name,\n            self.owner.getName(),\n        )\n\n    @abstractmethod\n    def getVariableType(self):\n        pass\n\n    def getDescription(self):\n        return \"variable '%s'\" % self.variable_name\n\n    def getName(self):\n        return self.variable_name\n\n    def getOwner(self):\n        return self.owner\n\n    def getEntryPoint(self):\n        return self.owner.getEntryPoint()\n\n    def getCodeName(self):\n        var_name = self.variable_name\n        var_name = var_name.replace(\".\", \"$\")\n        var_name = Utils.encodeNonAscii(var_name)\n\n        return var_name\n\n    def allocateTargetNumber(self):\n        self.version_number += 1\n\n        return self.version_number\n\n    @staticmethod\n    def isLocalVariable():\n        return False\n\n    @staticmethod\n    def isParameterVariable():\n        return False\n\n    @staticmethod\n    def isModuleVariable():\n        return False\n\n    @staticmethod\n    def isIncompleteModuleVariable():\n        return False\n\n    @staticmethod\n    def isTempVariable():\n        return False\n\n    @staticmethod\n    def isTempVariableBool():\n        return False\n\n    @staticmethod\n    def isLocalsDictVariable():\n        return False\n\n    def addVariableUser(self, user):\n        # Update the shared scopes flag.\n        if user is not self.owner:\n            self.shared_users = True\n\n            # These are not really scopes, just shared uses.\n            if (\n                user.isExpressionGeneratorObjectBody()\n                or user.isExpressionCoroutineObjectBody()\n                or user.isExpressionAsyncgenObjectBody()\n            ):\n                if self.owner is user.getParentVariableProvider():\n                    return\n\n            _variables_in_shared_scopes.add(self)\n\n    def isSharedTechnically(self):\n        if not self.shared_users:\n            return False\n\n        if not self.users:\n            return False\n\n        owner = self.owner.getEntryPoint()\n\n        for user in self.users:\n            user = user.getEntryPoint()\n\n            while user is not owner and (\n                (user.isExpressionFunctionBody() and not user.needsCreation())\n                or user.isExpressionClassBodyBase()\n            ):\n                user = user.getParentVariableProvider()\n\n            if user is not owner:\n                return True\n\n        return False\n\n    def addTrace(self, variable_trace):\n        self.traces.add(variable_trace)\n\n    def removeTrace(self, variable_trace):\n        self.traces.remove(variable_trace)\n\n    def getTraces(self):\n        \"\"\"For debugging only\"\"\"\n        return self.traces\n\n    def updateUsageState(self):\n        writers = set()\n        users = set()\n\n        for trace in self.traces:\n            owner = trace.owner\n            users.add(owner)\n\n            if trace.isAssignTrace():\n                writers.add(owner)\n            elif trace.isDeletedTrace() and owner is not self.owner:\n                writers.add(owner)\n\n        self.writers = writers\n        self.users = users\n\n    def hasAccessesOutsideOf(self, provider):\n        if not self.owner.locals_scope.complete:\n            return None\n        elif self.users is None:\n            return False\n        elif provider in self.users:\n            return len(self.users) > 1\n        else:\n            return bool(self.users)\n\n    def hasWritersOutsideOf(self, provider):\n        if not self.owner.locals_scope.complete:\n            # TODO: Maybe this doesn't have to be limited to these types.\n            if not self.shared_users and (\n                self.isLocalVariable() or self.isTempVariable()\n            ):\n                return False\n            return None\n        elif self.writers is None:\n            return False\n        elif provider in self.writers:\n            return len(self.writers) > 1\n        else:\n            return bool(self.writers)\n\n    def getMatchingAssignTrace(self, assign_node):\n        for trace in self.traces:\n            if trace.isAssignTrace() and trace.getAssignNode() is assign_node:\n                return trace\n\n        return None\n\n    def getMatchingUnescapedAssignTrace(self, assign_node):\n        found = None\n        for trace in self.traces:\n            if trace.isAssignTrace() and trace.getAssignNode() is assign_node:\n                found = trace\n            if trace.isEscapeTrace():\n                return None\n\n        return found\n\n    def getMatchingDelTrace(self, del_node):\n        for trace in self.traces:\n            if trace.isDeletedTrace() and trace.getDelNode() is del_node:\n                return trace\n\n        return None\n\n    def getTypeShapes(self):\n        result = set()\n\n        for trace in self.traces:\n            if trace.isAssignTrace():\n                result.add(trace.getAssignNode().getTypeShape())\n            elif trace.isUnknownTrace():\n                result.add(tshape_unknown)\n            elif trace.isEscapeTrace():\n                result.add(tshape_unknown)\n            elif trace.isInitTrace():\n                result.add(tshape_unknown)\n            elif trace.isUnassignedTrace():\n                pass\n            elif trace.isMergeTrace():\n                pass\n            # TODO: Remove this and be not unknown.\n            elif trace.isLoopTrace():\n                trace.getTypeShape().emitAlternatives(result.add)\n            else:\n                assert False, trace\n\n        return result\n\n    @staticmethod\n    def onControlFlowEscape(trace_collection):\n        \"\"\"Mark the variable as escaped or unknown, or keep it depending on variable type.\"\"\"\n\n    def removeKnowledge(self, trace_collection):\n        \"\"\"Remove knowledge for the variable marking as unknown or escaped.\"\"\"\n        trace_collection.markActiveVariableAsEscaped(self)\n\n    def removeAllKnowledge(self, trace_collection):\n        \"\"\"Remove all knowledge for the variable marking as unknown, or keep it depending on variable type.\"\"\"\n        trace_collection.markActiveVariableAsUnknown(self)\n\n\nclass LocalVariable(Variable):\n    __slots__ = ()\n\n    def __init__(self, owner, variable_name):\n        Variable.__init__(self, owner=owner, variable_name=variable_name)\n\n    @staticmethod\n    def isLocalVariable():\n        return True\n\n    def initVariable(self, trace_collection):\n        \"\"\"Initialize variable in trace collection state.\"\"\"\n        return trace_collection.initVariableUninitialized(self)\n\n    if str is not bytes:\n\n        def onControlFlowEscape(self, trace_collection):\n            if self.hasWritersOutsideOf(trace_collection.owner) is not False:\n                trace_collection.markClosureVariableAsUnknown(self)\n            elif self.hasAccessesOutsideOf(trace_collection.owner) is not False:\n                trace_collection.markActiveVariableAsEscaped(self)\n\n    else:\n\n        def onControlFlowEscape(self, trace_collection):\n            if self.hasAccessesOutsideOf(trace_collection.owner) is not False:\n                trace_collection.markActiveVariableAsEscaped(self)\n\n    @staticmethod\n    def getVariableType():\n        return \"object\"\n\n\nclass ParameterVariable(LocalVariable):\n    __slots__ = ()\n\n    def __init__(self, owner, parameter_name):\n        LocalVariable.__init__(self, owner=owner, variable_name=parameter_name)\n\n    def getDescription(self):\n        return \"parameter variable '%s'\" % self.variable_name\n\n    @staticmethod\n    def isParameterVariable():\n        return True\n\n    def initVariable(self, trace_collection):\n        \"\"\"Initialize variable in trace collection state.\"\"\"\n        return trace_collection.initVariableInit(self)\n\n\nclass ModuleVariable(Variable):\n    __slots__ = ()\n\n    def __init__(self, module, variable_name):\n        assert type(variable_name) is str, repr(variable_name)\n        assert module.isCompiledPythonModule()\n\n        Variable.__init__(self, owner=module, variable_name=variable_name)\n\n    def __repr__(self):\n        return \"<ModuleVariable '%s' of '%s'>\" % (\n            self.variable_name,\n            self.owner.getFullName(),\n        )\n\n    def getDescription(self):\n        return \"global variable '%s'\" % self.variable_name\n\n    @staticmethod\n    def isModuleVariable():\n        return True\n\n    def initVariable(self, trace_collection):\n        \"\"\"Initialize variable in trace collection state.\"\"\"\n        return trace_collection.initVariableModule(self)\n\n    def onControlFlowEscape(self, trace_collection):\n        trace_collection.markActiveVariableAsUnknown(self)\n\n    def removeKnowledge(self, trace_collection):\n        \"\"\"Remove knowledge for the variable marking as unknown or escaped.\"\"\"\n        trace_collection.markActiveVariableAsUnknown(self)\n\n    def isIncompleteModuleVariable(self):\n        return not self.owner.locals_scope.complete\n\n    def hasDefiniteWrites(self):\n        if not self.owner.locals_scope.complete:\n            return None\n        else:\n            return bool(self.writers)\n\n    def getModule(self):\n        return self.owner\n\n    @staticmethod\n    def getVariableType():\n        return \"object\"\n\n\nclass TempVariable(Variable):\n    __slots__ = (\"variable_type\",)\n\n    def __init__(self, owner, variable_name, variable_type):\n        Variable.__init__(self, owner=owner, variable_name=variable_name)\n\n        # TODO: Push this later down to Variable itself.\n        self.variable_type = variable_type\n\n    @staticmethod\n    def isTempVariable():\n        return True\n\n    def getVariableType(self):\n        return self.variable_type\n\n    def isTempVariableBool(self):\n        return self.variable_type == \"bool\"\n\n    def getDescription(self):\n        return \"temp variable '%s'\" % self.variable_name\n\n    def initVariable(self, trace_collection):\n        \"\"\"Initialize variable in trace collection state.\"\"\"\n        return trace_collection.initVariableUninitialized(self)\n\n    @staticmethod\n    def removeAllKnowledge(trace_collection):\n        \"\"\"Remove all knowledge for the variable marking as unknown, or keep it depending on variable type.\"\"\"\n        # For temporary variables, the knowledge is not by name, so never gets\n        # lost to outside star imports or exec/eval uses.\n\n\nclass LocalsDictVariable(Variable):\n    __slots__ = ()\n\n    def __init__(self, owner, variable_name):\n        Variable.__init__(self, owner=owner, variable_name=variable_name)\n\n    @staticmethod\n    def isLocalsDictVariable():\n        return True\n\n    @staticmethod\n    def getVariableType():\n        return \"object\"\n\n    def initVariable(self, trace_collection):\n        \"\"\"Initialize variable in trace collection state.\"\"\"\n        if self.owner.getTypeShape() is tshape_dict:\n            return trace_collection.initVariableUninitialized(self)\n        else:\n            return trace_collection.initVariableUnknown(self)\n\n\ndef updateVariablesFromCollection(old_collection, new_collection, source_ref):\n    # After removing/adding traces, we need to pre-compute the users state\n    # information.\n    touched_variables = set()\n    loop_trace_removal = set()\n\n    if old_collection is not None:\n        for (variable, _version), variable_trace in iterItems(\n            old_collection.getVariableTracesAll()\n        ):\n            variable.removeTrace(variable_trace)\n            touched_variables.add(variable)\n\n            if variable_trace.isLoopTrace():\n                loop_trace_removal.add(variable)\n\n    if new_collection is not None:\n        for (variable, _version), variable_trace in iterItems(\n            new_collection.getVariableTracesAll()\n        ):\n            variable.addTrace(variable_trace)\n            touched_variables.add(variable)\n\n            if variable_trace.isLoopTrace():\n                if variable in loop_trace_removal:\n                    loop_trace_removal.remove(variable)\n\n        # Release the memory, and prevent the \"active\" state from being ever\n        # inspected, it's useless now.\n        new_collection.variable_actives.clear()\n        del new_collection.variable_actives\n\n    for variable in touched_variables:\n        variable.updateUsageState()\n\n    if loop_trace_removal:\n        if new_collection is not None:\n            new_collection.signalChange(\n                \"var_usage\",\n                source_ref,\n                lambda: \"Loop variable '%s' usage ceased.\"\n                % \",\".join(variable.getName() for variable in loop_trace_removal),\n            )\n\n\n# To detect the Python2 shared variable deletion, that would be a syntax\n# error\n_variables_in_shared_scopes = set()\n\n\ndef isSharedAmongScopes(variable):\n    return variable in _variables_in_shared_scopes\n\n\ndef releaseSharedScopeInformation(tree):\n    # Singleton, pylint: disable=global-statement\n\n    assert tree.isCompiledPythonModule()\n\n    global _variables_in_shared_scopes\n    _variables_in_shared_scopes = set(\n        variable\n        for variable in _variables_in_shared_scopes\n        if variable.getOwner().getParentModule() is not tree\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/Version.py",
    "content": "#     Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n#\n\"\"\" Nuitka version related stuff.\n\n\"\"\"\n\nversion_string = \"\"\"\\\nNuitka V2.2rc4\nCopyright (C) 2024 Kay Hayen.\"\"\"\n\n\ndef getNuitkaVersion():\n    \"\"\"Return Nuitka version as a string.\n\n    This should not be used for >= comparisons directly.\n    \"\"\"\n    return version_string.split()[1][1:]\n\n\n# Sanity check.\nassert getNuitkaVersion()[-1].isdigit(), getNuitkaVersion()\n\n\ndef parseNuitkaVersionToTuple(version):\n    \"\"\"Return Nuitka version as a tuple.\n\n    This can also not be used for precise comparisons, even with rc versions,\n    but it's not actually a version.\n    \"\"\"\n\n    if \"rc\" in version:\n        rc_number = int(version[version.find(\"rc\") + 2 :] or \"0\")\n        version = version[: version.find(\"rc\")]\n\n        is_final = False\n    else:\n        rc_number = 0\n        is_final = True\n\n    result = version.split(\".\")\n    if len(result) == 2:\n        result.append(\"0\")\n\n    result = [int(digit) for digit in result]\n    result.extend((is_final, rc_number))\n    return tuple(result)\n\n\ndef getNuitkaVersionTuple():\n    \"\"\"Return Nuitka version as a tuple.\n\n    This can also not be used for precise comparisons, even with rc versions,\n    but it's not actually a version. The format is used what is used for\n    \"__compiled__\" values.\n    \"\"\"\n\n    return parseNuitkaVersionToTuple(version=getNuitkaVersion())\n\n\ndef getNuitkaVersionYear():\n    \"\"\"The year of Nuitka copyright for use in generations.\"\"\"\n\n    return int(version_string.split()[4])\n\n\ndef getCommercialVersion():\n    \"\"\"Return Nuitka commercial version if installed.\"\"\"\n    try:\n        from nuitka.tools.commercial import Version\n    except ImportError:\n        return None\n    else:\n        return Version.__version__\n"
  },
  {
    "path": "nuitka/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nThis is the main program of Nuitka, it checks the options and then translates\none or more modules to a C source code using Python C/API in a \"*.build\"\ndirectory and then compiles that to either an executable or an extension module\nor package, that can contain all used modules too.\n\"\"\"\n\n# Note: This avoids imports at all costs, such that initial startup doesn't do more\n# than necessary, until re-execution has been decided.\n\nimport os\nimport sys\n\n\ndef main():\n    # PyLint for Python3 thinks we import from ourselves if we really\n    # import from package, pylint: disable=I0021,no-name-in-module\n\n    # Also high complexity.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n    if (\n        os.name == \"nt\"\n        and os.path.normcase(os.path.basename(sys.executable)) == \"pythonw.exe\"\n    ):\n        import ctypes\n\n        ctypes.windll.user32.MessageBoxW(\n            None,\n            \"You have to use the 'python.exe' and not a 'pythonw.exe' to run Nuitka\",\n            \"Error\",\n            0x1000,  # MB_SYSTEMMODAL\n        )\n        sys.exit(1)\n\n    if \"NUITKA_BINARY_NAME\" in os.environ:\n        sys.argv[0] = os.environ[\"NUITKA_BINARY_NAME\"]\n\n    if \"NUITKA_PYTHONPATH_AST\" in os.environ:\n        # Restore the PYTHONPATH gained from the site module, that we chose not\n        # to have imported during compilation. For loading \"ast\" module, we need\n        # one element, that is not necessarily in our current path, but we use\n        # that to evaluate the current path.\n        sys.path = [os.environ[\"NUITKA_PYTHONPATH_AST\"]]\n        import ast\n\n        del os.environ[\"NUITKA_PYTHONPATH_AST\"]\n\n        sys.path = ast.literal_eval(os.environ[\"NUITKA_PYTHONPATH\"])\n        del os.environ[\"NUITKA_PYTHONPATH\"]\n    else:\n        # Remove path element added for being called via \"__main__.py\", this can\n        # only lead to trouble, having e.g. a \"distutils\" in sys.path that comes\n        # from \"nuitka.distutils\". Also ignore path elements that do not really\n        # exist.\n        sys.path = [\n            path_element\n            for path_element in sys.path\n            if os.path.dirname(os.path.abspath(__file__)) != path_element\n            if os.path.exists(path_element)\n        ]\n\n    # We will run with the Python configuration as specified by the user, if it does\n    # not match, we restart ourselves with matching configuration.\n    needs_re_execution = False\n\n    if sys.flags.no_site == 0:\n        needs_re_execution = True\n\n    # The hash randomization totally changes the created source code created,\n    # changing it every single time Nuitka is run. This kills any attempt at\n    # caching it, and comparing generated source code. While the created binary\n    # actually may still use it, during compilation we don't want to. So lets\n    # disable it.\n    if os.getenv(\"PYTHONHASHSEED\", \"-1\") != \"0\":\n        needs_re_execution = True\n\n    # The frozen stdlib modules of Python 3.11 are less compatible than the ones\n    # of Nuitka, so prefer those.\n    if sys.version_info >= (3, 11):\n        from _imp import _frozen_module_names\n\n        if \"os\" in _frozen_module_names():\n            needs_re_execution = True\n\n    # Avoid doing it when running in Visual Code.\n    if needs_re_execution and \"debugpy\" in sys.modules:\n        needs_re_execution = False\n\n    # In case we need to re-execute.\n    if needs_re_execution:\n        from nuitka.utils.ReExecute import reExecuteNuitka  # isort:skip\n\n        # Does not return\n        reExecuteNuitka(pgo_filename=None)\n\n    # We don't care about deprecations in any version, and these are triggered\n    # by run time calculations of \"range\" and others, while on python2.7 they\n    # are disabled by default.\n    import warnings\n\n    warnings.simplefilter(\"ignore\", DeprecationWarning)\n\n    from nuitka import Options  # isort:skip\n\n    Options.parseArgs()\n\n    Options.commentArgs()\n\n    # Load plugins after we know, we don't execute again.\n    from nuitka.plugins.Plugins import activatePlugins\n\n    activatePlugins()\n\n    if Options.isShowMemory():\n        from nuitka.utils import MemoryUsage\n\n        MemoryUsage.startMemoryTracing()\n\n    if \"NUITKA_NAMESPACES\" in os.environ:\n        # Restore the detected name space packages, that were force loaded in\n        # site.py, and will need a free pass later on\n        from nuitka.importing.PreloadedPackages import setPreloadedPackagePaths\n\n        setPreloadedPackagePaths(ast.literal_eval(os.environ[\"NUITKA_NAMESPACES\"]))\n        del os.environ[\"NUITKA_NAMESPACES\"]\n\n    if \"NUITKA_PTH_IMPORTED\" in os.environ:\n        # Restore the packages that the \".pth\" files asked to import.\n        from nuitka.importing.PreloadedPackages import setPthImportedPackages\n\n        setPthImportedPackages(ast.literal_eval(os.environ[\"NUITKA_PTH_IMPORTED\"]))\n        del os.environ[\"NUITKA_PTH_IMPORTED\"]\n\n    if \"NUITKA_USER_SITE\" in os.environ:\n        from nuitka.utils.Distributions import setUserSiteDirectory\n\n        setUserSiteDirectory(ast.literal_eval(os.environ[\"NUITKA_USER_SITE\"]))\n\n        del os.environ[\"NUITKA_USER_SITE\"]\n\n    # Now the real main program of Nuitka can take over.\n    from nuitka import MainControl  # isort:skip\n\n    MainControl.main()\n\n    if Options.isShowMemory():\n        MemoryUsage.showMemoryTrace()\n\n\nif __name__ == \"__main__\":\n    if \"NUITKA_PACKAGE_HOME\" in os.environ:\n        sys.path.insert(0, os.environ[\"NUITKA_PACKAGE_HOME\"])\n\n        import nuitka  # just to have it loaded from there, pylint: disable=unused-import\n\n        del sys.path[0]\n\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/__past__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nModule like __future__ for things that are changed between Python2 and Python3.\n\nThese are here to provide compatible fall-backs. This is required to run the\nsame code easily with both CPython2 and CPython3. Sometimes, we do not care\nabout the actual types, or API, but would rather just check for something to\nbe a \"in (str, unicode)\" rather than making useless version checks.\n\n\"\"\"\n\nimport pkgutil\nimport sys\nfrom hashlib import md5 as _md5\n\n# pylint: disable=invalid-name,self-assigning-variable\n\nif str is bytes:\n    import __builtin__ as builtins  # Python2 code, pylint: disable=import-error\nelse:\n    import builtins\n\n# Work around for CPython 3.x renaming \"long\" to \"int\".\nif str is bytes:\n    long = long  # Python2 code, pylint: disable=undefined-variable\nelse:\n    long = int\n\n# Work around for CPython 3.x renaming \"unicode\" to \"str\".\nif str is bytes:\n    unicode = unicode  # Python2 code, pylint: disable=undefined-variable\nelse:\n    unicode = str\n\n\nif str is bytes:\n\n    def iterItems(d):\n        return d.iteritems()\n\nelse:\n\n    def iterItems(d):\n        return d.items()\n\n\nif str is not bytes:\n    raw_input = input\n    xrange = range\n    basestring = str\nelse:\n    raw_input = raw_input\n    xrange = xrange\n    basestring = basestring\n\n\nif str is bytes:\n    from urllib import (  # pylint: disable=I0021,import-error,no-name-in-module\n        urlretrieve,\n    )\nelse:\n    from urllib.request import urlretrieve\n\nif str is bytes:\n    from cStringIO import StringIO  # Python2 code, pylint: disable=import-error\nelse:\n    from io import StringIO\n\nif str is bytes:\n    BytesIO = StringIO\nelse:\n    from io import BytesIO\n\ntry:\n    from functools import total_ordering\nexcept ImportError:\n    # Lame replacement for functools.total_ordering, which does not exist on\n    # Python2.6, this requires \"<\" and \"=\" and adds all other operations.\n    def total_ordering(cls):\n        cls.__ne__ = lambda self, other: not self == other\n        cls.__le__ = lambda self, other: self == other or self < other\n        cls.__gt__ = lambda self, other: self != other and not self < other\n        cls.__ge__ = lambda self, other: self == other and not self < other\n\n        return cls\n\n\nif str is bytes:\n    # Python2 only code, pylint: disable=deprecated-class,no-name-in-module\n    from collections import Iterable, MutableSet\nelse:\n    from collections.abc import Iterable, MutableSet\n\nif str is bytes:\n    intern = intern  # Python2 code, pylint: disable=undefined-variable\nelse:\n    intern = sys.intern\n\nif str is bytes:\n    to_byte = chr\n    from_byte = ord\nelse:\n\n    def to_byte(value):\n        assert type(value) is int and 0 <= value < 256, value\n        return bytes((value,))\n\n    def from_byte(value):\n        assert type(value) is bytes and len(value) == 1, value\n        return value[0]\n\n\ntry:\n    from typing import GenericAlias\nexcept ImportError:\n    GenericAlias = None\n\ntry:\n    from types import UnionType\nexcept ImportError:\n    UnionType = None\n\n\nif str is bytes:\n    try:\n        import subprocess32 as subprocess\n    except ImportError:\n        import subprocess\nelse:\n    import subprocess\n\n# Just to make this not Windows-specific.\nWindowsError = OSError  # pylint: disable=I0021,redefined-builtin\n\n# Make it available for Python2 as well\nPermissionError = (  # pylint: disable=redefined-builtin\n    PermissionError if str is not bytes else OSError\n)\n\n# Make it available for Python2 as well\nFileNotFoundError = (  # pylint: disable=redefined-builtin\n    FileNotFoundError if str is not bytes else IOError\n)\n\nif not hasattr(pkgutil, \"ModuleInfo\"):\n    # Python3.5 or lower do not return namedtuple, but it's nicer to read code with it.\n    from collections import namedtuple\n\n    ModuleInfo = namedtuple(\"ModuleInfo\", \"module_finder name ispkg\")\n\n    def iter_modules(path=None, prefix=\"\"):\n        for item in pkgutil.iter_modules(path, prefix):\n            yield ModuleInfo(*item)\n\nelse:\n    iter_modules = pkgutil.iter_modules\n\n\ntry:\n    ExceptionGroup = ExceptionGroup  # pylint: disable=I0021,redefined-builtin\nexcept NameError:\n    ExceptionGroup = None\n\ntry:\n    BaseExceptionGroup = BaseExceptionGroup  # pylint: disable=I0021,redefined-builtin\nexcept NameError:\n    BaseExceptionGroup = None\n\ntry:\n    _md5()\nexcept ValueError:\n    # On FIPS compliant systems, checks might be enabled that require\n    # this parameter to be set.\n    def md5(value=b\"\"):\n        return _md5(value, usedforsecurity=False)\n\nelse:\n    md5 = _md5\n\n# For PyLint to be happy.\nassert long\nassert unicode\nassert urlretrieve\nassert StringIO\nassert BytesIO\nassert type(xrange) is type, xrange\nassert total_ordering\nassert intern\nassert builtins\nassert Iterable\nassert MutableSet\nassert subprocess\nassert GenericAlias or intern\nassert UnionType or intern\nassert FileNotFoundError\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/Backend.scons",
    "content": "# -*- python -*-\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nThe Nuitka scons file. If you have Scons or platform knowledge, please be\nespecially invited and contribute improvements.\n\nThis file is used to build an executable or shared library. Nuitka needs no\nbuild process for itself, although it can be compiled using the same method.\n\"\"\"\n\n# Make nuitka package importable from calling installation\n\nimport sys\nimport os\nimport types\n\nsys.modules[\"nuitka\"] = types.ModuleType(\"nuitka\")\nsys.modules[\"nuitka\"].__path__ = [os.environ[\"NUITKA_PACKAGE_DIR\"]]\n\n# We are in the build.build package really.\nimport nuitka.build  # pylint: disable=unused-import\n\n__package__ = \"nuitka.build\"  # pylint: disable=redefined-builtin\n\n# isort:start\n\nfrom SCons.Script import (  # pylint: disable=I0021,import-error\n    ARGUMENTS,\n    Environment,\n    GetOption,\n)\n\nfrom nuitka.Tracing import (\n    my_print,\n    scons_details_logger,\n    scons_logger,\n    setQuiet,\n)\nfrom nuitka.utils.Execution import check_output\nfrom nuitka.utils.FileOperations import getExternalUsePath\nfrom nuitka.utils.Json import loadJsonFromFilename\nfrom nuitka.utils.Utils import (\n    isDebianBasedLinux,\n    isFedoraBasedLinux,\n    isMacOS,\n    isNetBSD,\n)\n\nfrom .DataComposerInterface import getConstantBlobFilename\nfrom .SconsCaching import enableCcache, enableClcache\nfrom .SconsCompilerSettings import (\n    addConstantBlobFile,\n    checkWindowsCompilerFound,\n    decideConstantsBlobResourceMode,\n    enableWindowsStackSize,\n    importEnvironmentVariableSettings,\n    reportCCompiler,\n    setupCCompiler,\n    switchFromGccToGpp,\n)\nfrom .SconsHacks import getEnhancedToolDetect, makeGccUseLinkerFile\nfrom .SconsProgress import enableSconsProgressBar, setSconsProgressBarTotal\nfrom .SconsSpawn import enableSpawnMonitoring\nfrom .SconsUtils import (\n    addClangClPathFromMSVC,\n    changeKeyboardInterruptToErrorExit,\n    createDefinitionsFile,\n    createEnvironment,\n    getArgumentBool,\n    getArgumentDefaulted,\n    getArgumentInt,\n    getArgumentList,\n    getArgumentRequired,\n    getExecutablePath,\n    getMsvcVersionString,\n    initScons,\n    isClangName,\n    isGccName,\n    prepareEnvironment,\n    provideStaticSourceFile,\n    raiseNoCompilerFoundErrorExit,\n    scanSourceDir,\n    setArguments,\n    setupScons,\n    writeSconsReport,\n)\n\n# spell-checker: ignore ccversion,ccflags,werror,cppdefines,cpppath,linkflags,libpath\n\n# Set the arguments.\nsetArguments(ARGUMENTS)\n\n# Set up the basic stuff.\ninitScons()\n\n# The directory containing the C files generated by Nuitka to be built using\n# scons. They are referred to as sources from here on.\nsource_dir = getArgumentRequired(\"source_dir\")\n\n# The directory containing Nuitka provided C files to be built and where it\n# should be used.\nnuitka_src = getArgumentRequired(\"nuitka_src\")\nstatic_src = os.path.join(source_dir, \"static\")\n\n# The name of executable or extension module that we produce.\nresult_base_path = getArgumentRequired(\"result_name\")\n\n# The name of executable that we produce (in executable mode).\nresult_exe = getArgumentDefaulted(\"result_exe\", None)\n\n# Name of the main program (in executable mode, typically __main__ but can be in a package too.)\nmain_module_name = getArgumentDefaulted(\"main_module_name\", \"__main__\")\n\n# The suffix for an extension module (in module mode).\nmodule_suffix = getArgumentDefaulted(\"module_suffix\", None)\n\n# Full names shall be used, no remapping for cacheable filenames.\nfull_names = getArgumentBool(\"full_names\", False)\n\n# Module mode: Create a Python extension module, create an executable otherwise.\nmodule_mode = getArgumentBool(\"module_mode\", False)\n\n# Debug mode: Less optimizations, debug information in the resulting binary.\ndebug_mode = getArgumentBool(\"debug_mode\", False)\n\n# Debugger mode: Debug information in the resulting binary and intention to run\n# in debugger.\ndebugger_mode = getArgumentBool(\"debugger_mode\", False)\n\n# Profiling mode: Outputs vmprof based information from program run.\nprofile_mode = getArgumentBool(\"profile_mode\", False)\n\n# Python version to target.\npython_version_str = getArgumentRequired(\"python_version\")\npython_version = tuple(int(d) for d in python_version_str.split(\".\"))\n\n# The ABI flags to target.\nabiflags = getArgumentDefaulted(\"abiflags\", \"\")\npython_abi_version = python_version_str + abiflags\n\n# Python debug mode: reference count checking, assertions in CPython core.\npython_debug = getArgumentBool(\"python_debug\", False)\n\n# Full compatibility, even where it's stupid, i.e. do not provide information,\n# even if available, in order to assert maximum compatibility. Intended to\n# control level of compatibility to absurd.\nfull_compat_mode = getArgumentBool(\"full_compat\", False)\n\n# Experimental indications. Do things that are not yet safe to do.\nexperimental = getArgumentList(\"experimental\", \"\")\n\n# Deployment mode\ndeployment_mode = getArgumentBool(\"deployment\", False)\n\n# Experimental indications. Do things that are not yet safe to do.\nno_deployment = getArgumentList(\"no_deployment\", \"\")\n\n# Tracing mode. Output program progress.\ntrace_mode = getArgumentBool(\"trace_mode\", False)\n\n# LTO mode: Use link time optimizations of C compiler if available and known\n# good with the compiler in question.\nlto_mode = getArgumentDefaulted(\"lto_mode\", \"auto\")\n\n# PGO mode: Use profile guided optimization of C compiler if available.\npgo_mode = getArgumentDefaulted(\"pgo_mode\", \"no\")\n\n# Windows subsystem mode: Disable console for windows builds.\ndisable_console = getArgumentBool(\"disable_console\", False)\n\n# Windows might be running a Python whose DLL we have to use.\nuninstalled_python = getArgumentBool(\"uninstalled_python\", False)\n\n# Unstripped mode: Do not remove debug symbols.\nunstripped_mode = getArgumentBool(\"unstripped_mode\", False)\n\n# Target arch, uses for compiler choice and quick linking of constants binary\n# data.\ntarget_arch = getArgumentRequired(\"target_arch\")\n\n# MinGW compiler mode, optional and interesting to Windows only.\nmingw_mode = getArgumentBool(\"mingw_mode\", False)\n\n# Clang compiler mode, forced on macOS and FreeBSD (excluding PowerPC), optional on Linux.\nclang_mode = getArgumentBool(\"clang_mode\", False)\n\n# Clang on Windows with no requirement to use MinGW64 or using MSYS2 MinGW flavor,\n# is changed to ClangCL from Visual Studio.\nclangcl_mode = False\nif os.name == \"nt\" and not mingw_mode and clang_mode:\n    clang_mode = False\n    clangcl_mode = True\n\n# Frozen modules count, determines the need for the bytecode frozen\n# modules loader.\nfrozen_modules = getArgumentInt(\"frozen_modules\", 0)\n\n# Standalone mode\nstandalone_mode = getArgumentBool(\"standalone_mode\", False)\n\n# Onefile mode\nonefile_mode = getArgumentBool(\"onefile_mode\", False)\n\n# MacOS bundle\nmacos_bundle_mode = getArgumentBool(\"macos_bundle_mode\", False)\n\n# Onefile temp mode\nonefile_temp_mode = getArgumentBool(\"onefile_temp_mode\", False)\n\nforced_stdout_path = getArgumentDefaulted(\"forced_stdout_path\", None)\nforced_stderr_path = getArgumentDefaulted(\"forced_stderr_path\", None)\n\n# Show scons mode, output information about Scons operation\nshow_scons_mode = getArgumentBool(\"show_scons\", False)\nscons_details_logger.is_quiet = not show_scons_mode\n\nif int(os.getenv(\"NUITKA_QUIET\", \"0\")):\n    setQuiet()\n\n# Home of Python to be compiled against, used to find include files and\n# libraries to link against.\npython_prefix = getArgumentRequired(\"python_prefix\")\n\npython_prefix_external = getExternalUsePath(python_prefix)\n\n# Forced MSVC version (windows-only)\nmsvc_version = getArgumentDefaulted(\"msvc_version\", None)\n\n# Disable ccache/clcache usage if that is requested\ndisable_ccache = getArgumentBool(\"disable_ccache\", False)\n\nno_python_warnings = getArgumentBool(\"no_python_warnings\", False)\n\n# sys.flags values to pass along\n# python_sysflag_py3k_warning\npython_sysflag_py3k_warning = getArgumentBool(\"python_sysflag_py3k_warning\", False)\n# python_sysflag_division_warning\npython_sysflag_division_warning = getArgumentBool(\n    \"python_sysflag_division_warning\", False\n)\n# python_sysflag_division_warning\npython_sysflag_bytes_warning = getArgumentBool(\"python_sysflag_bytes_warning\", False)\n# python_sysflag_no_site\npython_sysflag_no_site = getArgumentBool(\"python_sysflag_no_site\", False)\n# python_sysflag_verbose\npython_sysflag_verbose = getArgumentBool(\"python_sysflag_verbose\", False)\n# python_sysflag_unicode\npython_sysflag_unicode = getArgumentBool(\"python_sysflag_unicode\", False)\n# python_sysflag_utf8\npython_sysflag_utf8 = getArgumentBool(\"python_sysflag_utf8\", False)\n# python_sysflag_optimize\npython_sysflag_optimize = getArgumentInt(\"python_sysflag_optimize\", 0)\n# python_flag_no_asserts\npython_flag_no_asserts = getArgumentBool(\"python_flag_no_asserts\", False)\n# python_flag_no_docstrings\npython_flag_no_docstrings = getArgumentBool(\"python_flag_no_docstrings\", False)\n# python_flag_no_annotations\npython_flag_no_annotations = getArgumentBool(\"python_flag_no_annotations\", False)\n# python_sysflag_no_randomization\npython_sysflag_no_randomization = getArgumentBool(\n    \"python_sysflag_no_randomization\", False\n)\n\n# python_sysflag_unbuffered\npython_sysflag_unbuffered = getArgumentBool(\"python_sysflag_unbuffered\", False)\n\n# python_sysflag_isolated\npython_sysflag_isolated = getArgumentBool(\"python_sysflag_isolated\", False)\n\n# file reference mode\nfile_reference_mode = getArgumentRequired(\"file_reference_mode\")\n\n# Preprocessor defines from plugins\ncpp_defines = getArgumentList(\"cpp_defines\", \"\")\ncpp_include_dirs = getArgumentList(\"cpp_include_dirs\", \"\")\nlink_dirs = getArgumentList(\"link_dirs\", \"\")\nlink_libraries = getArgumentList(\"link_libraries\", \"\")\n\n# From statically compiled modules of the Python\nlink_module_libs = getArgumentList(\"link_module_libs\", \"\")\n\n# Allow automatic downloads for ccache, etc.\nassume_yes_for_downloads = getArgumentBool(\"assume_yes_for_downloads\", False)\n\n# Low memory mode, compile using less memory if possible.\nlow_memory = getArgumentBool(\"low_memory\", False)\n\n# Minimum version required on macOS.\nmacos_min_version = getArgumentDefaulted(\"macos_min_version\", \"\")\n\n# Target arch for macOS.\nmacos_target_arch = getArgumentDefaulted(\"macos_target_arch\", \"\")\n\n# gcc compiler cf_protection option\ncf_protection = getArgumentDefaulted(\"cf_protection\", \"auto\")\n\nif getArgumentBool(\"progress_bar\", True) and not show_scons_mode:\n    enableSconsProgressBar()\n\n# Amount of jobs to use.\njob_count = GetOption(\"num_jobs\")\n\n# Prepare environment for compiler detection.\nmingw_mode = prepareEnvironment(mingw_mode=mingw_mode)\n\n# Patch the compiler detection.\nEnvironment.Detect = getEnhancedToolDetect()\n\n# Create Scons environment, the main control tool. Don't include \"mingw\" on\n# Windows immediately, we will default to MSVC if available.\nenv = createEnvironment(\n    mingw_mode=mingw_mode,\n    msvc_version=msvc_version,\n    target_arch=target_arch,\n    experimental=experimental,\n    no_deployment=no_deployment,\n)\n\nscons_details_logger.info(\"Initial CC: %r\" % env.get(\"CC\"))\nscons_details_logger.info(\n    \"Initial CCVERSION: %r\" % (env.get(\"CCVERSION\"),),\n)\n\nif \"CC\" in os.environ:\n    # If the environment variable CC is set, use that.\n    env[\"CC\"] = os.environ[\"CC\"]\n    env[\"CCVERSION\"] = None\n\n    scons_details_logger.info(\"Overridden with environment CC: %r\" % env[\"CC\"])\nelif clangcl_mode:\n    # If possible, add Clang directory from MSVC if available.\n    addClangClPathFromMSVC(env=env)\nelif clang_mode and not mingw_mode:\n    # If requested by the user, use the clang compiler, overriding what was\n    # said in environment.\n\n    env[\"CC\"] = \"clang\"\n    env[\"CCVERSION\"] = None\n\n# On Windows, in case MSVC was not found and not previously forced, use the\n# winlibs MinGW64 as a download, and use it as a fallback.\nenv = checkWindowsCompilerFound(\n    env=env,\n    target_arch=target_arch,\n    clang_mode=clang_mode,\n    msvc_version=msvc_version,\n    assume_yes_for_downloads=assume_yes_for_downloads,\n)\n\nenv.the_compiler = env[\"CC\"]\nenv.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))\nenv.standalone_mode = standalone_mode\nenv.debug_mode = debug_mode\nenv.unstripped_mode = unstripped_mode\nenv.disable_console = disable_console\nenv.source_dir = source_dir\nenv.nuitka_src = nuitka_src\nenv.low_memory = low_memory\nenv.macos_min_version = macos_min_version\nenv.macos_target_arch = macos_target_arch\n\n# Requested or user provided, detect if it's clang even from environment\nif isClangName(env.the_cc_name):\n    clang_mode = True\n    env[\"CCVERSION\"] = None\n\n# We consider clang to be a form of gcc for the most things, they strive to\n# be compatible.\nenv.gcc_mode = isGccName(env.the_cc_name) or clang_mode\nenv.clang_mode = clang_mode\n\n# Only use MSVC if not already clear, we are using MinGW.\nenv.msvc_mode = os.name == \"nt\" and not env.gcc_mode\nenv.mingw_mode = os.name == \"nt\" and env.gcc_mode\nenv.clangcl_mode = clangcl_mode\n\n# gcc compiler cf_protection option\nenv.cf_protection = cf_protection\n\n# Consider switching from gcc to its g++ compiler as a workaround that makes us work without C11.\nswitchFromGccToGpp(\n    env=env,\n)\n\nif env.the_compiler is None or getExecutablePath(env.the_compiler, env=env) is None:\n    raiseNoCompilerFoundErrorExit()\n\nno_import_lib = False\n\nif show_scons_mode:\n    my_print(\"Scons: Compiler used\", end=\" \")\n    my_print(getExecutablePath(env.the_compiler, env=env), end=\" \")\n\n    if os.name == \"nt\" and env.msvc_mode:\n        my_print(\"(MSVC %s)\" % getMsvcVersionString(env))\n\n    my_print()\n\n# Set build directory and scons general settings.\nsetupScons(env, source_dir)\n\n# Report the C compiler used.\nreportCCompiler(env, \"Backend\", scons_logger.info)\n\n# Set up C compiler settings.\nsetupCCompiler(\n    env=env,\n    lto_mode=lto_mode,\n    pgo_mode=pgo_mode,\n    job_count=job_count,\n    onefile_compile=False,\n)\n\n\n# Avoid them as appearing to be different files. TODO: Find out which\n# clang version has this, clang-8 does not.\nif env.gcc_mode and not env.clang_mode and env.gcc_version >= (8,):\n    if source_dir != \".\" and not full_names:\n        # TODO: This also lies for modules codes.\n        env.Append(\n            CCFLAGS=[\n                \"--file-prefix-map=%s=%s\" % (os.path.normpath(source_dir), \".\"),\n                \"--file-prefix-map=%s=%s\"\n                % (\n                    os.path.normpath(os.path.join(env.source_dir, \"static_src\")),\n                    os.path.normpath(os.path.join(env.nuitka_src, \"static_src\")),\n                ),\n            ]\n        )\n\nif env.msvc_mode:\n    # With Clang on Windows, there is also an linker to use. spell-checker: ignore bigobj\n    env.Append(\n        CCFLAGS=[\n            \"/EHsc\",  # No C++ exception handling code.\n            \"/J\",  # default char type is unsigned.\n            \"/Gd\",  # Use C calling convention by default.\n            \"/bigobj\",  # Product object files with larger internal limits.\n        ]\n    )\n\n    # No incremental linking.\n    env.Append(LINKFLAGS=[\"/INCREMENTAL:NO\"])\n\n    if module_mode:\n        # Make sure we handle import library on our own and put it into the\n        # build directory, spell-checker: ignore IMPLIB\n\n        no_import_lib = True\n        env.Append(\n            LINKFLAGS=[\n                \"/INCREMENTAL:NO\",\n                \"/IMPLIB:%s\" % os.path.join(source_dir, \"import.lib\"),\n            ]\n        )\n\nif not module_mode:\n    enableWindowsStackSize(env=env, target_arch=target_arch)\nif env.debug_mode:\n    if env.gcc_mode:\n        # Allow gcc/clang to point out all kinds of inconsistency to us by\n        # raising an error.\n\n        if \"allow-c-warnings\" not in env.experimental_flags and not debugger_mode:\n            env.Append(\n                CCFLAGS=[\n                    \"-Wall\",\n                    \"-Werror\",\n                ]\n            )\n\n        env.Append(\n            CCFLAGS=[\n                # Unfortunately Py_INCREF(Py_False) triggers aliasing warnings,\n                # which are unfounded, so disable them.\n                \"-Wno-error=strict-aliasing\",\n                \"-Wno-strict-aliasing\",\n                # At least for self-compiled Python3.2, and MinGW this happens\n                # and has little use anyway.\n                \"-Wno-error=format\",\n                \"-Wno-format\",\n            ]\n        )\n\n    elif env.msvc_mode:\n        # Disable warnings that system headers already show.\n        env.Append(\n            CCFLAGS=[\n                \"/W4\",\n                \"/wd4505\",\n                \"/wd4127\",\n                \"/wd4100\",\n                \"/wd4702\",\n                \"/wd4189\",\n                \"/wd4211\",\n                \"/wd4115\",\n                \"/WX\",\n            ]\n        )\n\n        # Disable warnings, that CPython headers already show.\n        if python_version >= (3, 4):\n            env.Append(CCFLAGS=[\"/wd4512\", \"/wd4510\", \"/wd4610\"])\n\n        # We use null arrays in our structure Python declarations, which C11 does\n        # not really allow, but should work.\n        env.Append(CCFLAGS=[\"/wd4200\"])\n\n        # Do not show deprecation warnings, we will use methods for as long\n        # as they work.\n        env.Append(CCFLAGS=[\"/wd4996\"])\n\nif full_compat_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_FULL_COMPAT\"])\n\nif profile_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_PROFILE\"])\n\nif trace_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_TRACE\"])\n\nif env.standalone_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_STANDALONE\"])\n\nif macos_bundle_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_MACOS_BUNDLE\"])\n\nif onefile_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_ONEFILE_MODE\"])\n\nif onefile_temp_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_ONEFILE_TEMP_BOOL\"])\n\nif deployment_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_DEPLOYMENT_MODE\"])\n\n# We need \"dl\" in accelerated mode.\nif \"linux\" in sys.platform:\n    env.Append(LIBS=[\"dl\"])\n\nif not env.msvc_mode:\n    env.Append(LIBS=[\"m\"])\n\nif python_debug:\n    env.Append(CPPDEFINES=[\"Py_DEBUG\"])\n\nif env.static_libpython:\n    env.Append(CPPDEFINES=[\"Py_NO_ENABLE_SHARED\"])\n\n\ndef detectHostMultiArch():\n    stdout = check_output(\"dpkg-architecture\")\n\n    for line in stdout.splitlines():\n        line = line.strip()\n\n        if line.startswith(b\"DEB_HOST_MULTI_ARCH=\"):\n            return line.split(\"=\", 1)[1].decode(\"utf8\")\n\n    return None\n\n\nif env.gcc_mode and env.debian_python:\n    # TODO: Seems rather meaningless nowadays and hard codes this to not be\n    # self compiled or so.\n    if python_version == (3, 3):\n        host_multi_arch = detectHostMultiArch()\n\n        if host_multi_arch is not None:\n            env.Append(\n                CCFLAGS=[\n                    \"-I\"\n                    + os.path.join(\n                        \"/usr/include/\", host_multi_arch, \"python\" + python_abi_version\n                    )\n                ]\n            )\n\n\ndef _detectPythonHeaderPath():\n    if os.name == \"nt\":\n        # On Windows, the CPython installation layout is relatively fixed, but on MSYS2\n        # compiled for mingw64, it's more standard.\n\n        candidates = [\n            os.path.join(python_prefix_external, \"include\"),\n            # On MSYS2 with MinGW64 Python, it is also the other form.\n            os.path.join(\n                python_prefix_external, \"include\", \"python\" + python_abi_version\n            ),\n        ]\n    else:\n        # The python header path is a combination of python version and debug\n        # indication, we make sure the headers are found by adding it to the C\n        # include path.\n\n        candidates = [\n            os.path.join(\n                python_prefix_external, \"include\", \"python\" + python_abi_version\n            ),\n            # CPython source code checkout\n            os.path.join(python_prefix_external, \"Include\"),\n            # Haiku specific paths:\n            os.path.join(\n                python_prefix_external, \"develop/headers\", \"python\" + python_abi_version\n            ),\n        ]\n\n        # Not all Python versions, have the ABI version to use for the debug version.\n        if python_debug and \"d\" in python_abi_version:\n            candidates.append(\n                os.path.join(\n                    python_prefix_external,\n                    \"include\",\n                    \"python\" + python_abi_version.replace(\"d\", \"\"),\n                )\n            )\n\n    for candidate in candidates:\n        if os.path.exists(os.path.join(candidate, \"Python.h\")):\n            yield candidate\n            break\n    else:\n        if os.name == \"nt\":\n            scons_logger.sysexit(\n                \"\"\"\\\nError, you seem to be using the unsupported embeddable CPython distribution \\\nuse a full Python instead.\"\"\"\n            )\n        else:\n            scons_logger.sysexit(\n                \"\"\"\\\nError, no 'Python.h' %s headers can be found at '%s', dependency \\\nnot satisfied!\"\"\"\n                % (\"debug\" if python_debug else \"development\", candidates)\n            )\n\n    if env.self_compiled_python_uninstalled:\n        yield python_prefix_external\n\n\nenv.Append(CPPPATH=list(_detectPythonHeaderPath()))\n\n# To support self-built Python on Windows, need to also add the \"PC\" directory,\n# that a normal install won't have.\nif os.name == \"nt\":\n    python_header_path = os.path.join(python_prefix_external, \"PC\")\n\n    if os.path.exists(python_header_path):\n        env.Append(CPPPATH=[python_header_path])\n\nif env.nuitka_python:\n    env.Append(CPPDEFINES=[\"_NUITKA_PYTHON\"])\n\nif env.static_libpython:\n    env.Append(CPPDEFINES=[\"_NUITKA_STATIC_LIBPYTHON\"])\n\n# TODO: This ought to be decided outside of scons and per flavor maybe.\nif env.static_libpython and (\n    (not os.name == \"nt\" and not isMacOS()) or env.nuitka_python\n):\n    env.Append(CPPDEFINES=[\"_NUITKA_USE_UNEXPOSED_API\"])\n\nif os.name == \"nt\":\n    if env.nuitka_python:\n        env.Append(\n            LINKFLAGS=[\n                \"/LTCG\",\n                \"/USEPROFILE:PGD=\" + os.path.join(python_prefix_external, \"python.pgd\"),\n            ]\n        )\n\n        link_data = loadJsonFromFilename(\n            os.path.join(python_prefix_external, \"link.json\")\n        )\n        env.Append(LIBS=link_data[\"libraries\"])\n        env.Append(LIBPATH=link_data[\"library_dirs\"])\n        for define, value in link_data[\"macros\"]:\n            if value:\n                env.Append(CPPDEFINES=[define + \"=\" + value])\n            else:\n                env.Append(CPPDEFINES=[define])\n\n        if \"link_flags\" in link_data:\n            env.Append(LINKFLAGS=link_data[\"link_flags\"])\n        if \"compile_flags\" in link_data:\n            env.Append(CFLAGS=link_data[\"compile_flags\"])\n    elif env.gcc_mode and env.static_libpython:\n        env.Append(LIBS=[env.File(env.static_libpython)])\n    else:\n        # Some non CPython flavors on Windows have this.\n        def addWinLib():\n            # Make sure to locate the Python link library from multiple potential\n            # locations (installed vs. self-built).\n            if python_debug:\n                win_lib_name = \"python\" + python_abi_version.replace(\".\", \"\") + \"_d\"\n            else:\n                win_lib_name = \"python\" + python_abi_version.replace(\".\", \"\")\n\n            if python_version >= (3,):\n                pc_build_dir = (\n                    \"PCBuild/amd64\" if target_arch == \"x86_64\" else \"PCBuild/win32\"\n                )\n            else:\n                pc_build_dir = \"PCBuild\"\n\n            for candidate in (\"libs\", pc_build_dir):\n                win_lib_path = os.path.join(python_prefix_external, candidate)\n\n                if os.path.exists(os.path.join(win_lib_path, win_lib_name + \".lib\")):\n                    break\n            else:\n                scons_logger.sysexit(\"Error, cannot find '%s.lib' file.\" % win_lib_name)\n\n            env.Append(LIBPATH=[win_lib_path])\n            env.Append(LIBS=[win_lib_name])\n\n        if not env.msys2_mingw_python:\n            addWinLib()\nelif not module_mode:\n    # Add the python library path to the library path\n    python_lib_path = os.path.join(python_prefix_external, \"lib\")\n    env.Append(LIBPATH=[python_lib_path])\n\n    # Any module libs that are for self-compiled Python to be static.\n    env.Append(_LIBFLAGS=[\"-l\" + lib_desc for lib_desc in link_module_libs])\n\n    if env.nuitka_python:\n        link_data = loadJsonFromFilename(\n            os.path.join(python_prefix_external, \"link.json\")\n        )\n        for lib in link_data[\"libraries\"]:\n            # Need to prevent Scons from stripping .a from the passed in libs.\n            if lib.startswith(\":\") and lib.endswith(\".a\"):\n                env.Append(_LIBFLAGS=[\"-l\" + lib])\n            elif os.path.isfile(lib):\n                env.Append(_LIBFLAGS=[lib])\n            else:\n                env.Append(LIBS=[lib])\n        env.Append(LIBPATH=link_data[\"library_dirs\"])\n        for define, value in link_data[\"macros\"]:\n            if value:\n                env.Append(CPPDEFINES=[define + \"=\" + value])\n            else:\n                env.Append(CPPDEFINES=[define])\n\n        if \"link_flags\" in link_data:\n            env.Append(LINKFLAGS=link_data[\"link_flags\"])\n        if \"compile_flags\" in link_data:\n            env.Append(CFLAGS=link_data[\"compile_flags\"])\n    elif env.static_libpython:\n        env.Append(LIBS=[env.File(env.static_libpython)])\n\n        # The linker won't succeed in searching for those for system Python of Debian\n        # compiled Pythons. Help that. For self-compiled,\n        if python_prefix_external == \"/usr\" and isDebianBasedLinux():\n            env.Append(LIBS=[\"z\", \"m\", \"util\", \"pthread\"])\n\n            if python_version >= (3,):\n                env.Append(LIBS=[\"expat\"])\n\n            env.Append(LINKFLAGS=[\"-Xlinker\", \"-export-dynamic\", \"-rdynamic\"])\n\n        if env.arch_python:\n            env.Append(LINKFLAGS=[\"-rdynamic\"])\n    else:\n        # Fedora, Debian and Ubuntu distinguish the system libraries like this.\n        if (\n            python_debug\n            and python_prefix_external == \"/usr\"\n            and python_version < (3,)\n            and (isDebianBasedLinux() or isFedoraBasedLinux())\n        ):\n            env.Append(LIBS=[\"python\" + python_abi_version + \"_d\"])\n        else:\n            env.Append(LIBS=[\"python\" + python_abi_version])\n\n    if python_prefix_external != \"/usr\" and \"linux\" in sys.platform:\n        env.Append(LIBS=[\"dl\", \"pthread\", \"util\", \"rt\", \"m\"])\n\n        if env.gcc_mode:\n            if clang_mode:\n                env.Append(LINKFLAGS=[\"-Wl,--export-dynamic\"])\n            else:\n                env.Append(LINKFLAGS=[\"-export-dynamic\"])\n\n    # For NetBSD the rpath is required, on FreeBSD it's warned as unused.\n    if isNetBSD():\n        env.Append(LINKFLAGS=[\"-rpath=\" + python_lib_path])\n\nif isMacOS():\n    if module_mode:\n        # Dynamic lookup needed for extension modules.\n        env.Append(LINKFLAGS=[\"-undefined\", \"dynamic_lookup\"])\n    else:\n        # For macOS we need to make sure install_name_tool can do its work\n        env.Append(LINKFLAGS=[\"-headerpad_max_install_names\"])\n\n# The static include files reside in Nuitka installation, which may be where\n# the \"nuitka.build\" package lives.\nnuitka_include = os.path.join(env.nuitka_src, \"include\")\n\nif not os.path.exists(os.path.join(nuitka_include, \"nuitka\", \"prelude.h\")):\n    scons_logger.sysexit(\n        \"Error, cannot locate Nuitka includes at '%s', this is a broken Nuitka installation.\"\n        % nuitka_include\n    )\n\n# We have include files in the build directory and the static include directory\n# that is located inside Nuitka installation.\nenv.Append(\n    CPPPATH=[\n        source_dir,\n        nuitka_include,\n        os.path.join(env.nuitka_src, \"static_src\"),\n        os.path.join(env.nuitka_src, \"inline_copy\", \"libbacktrace\"),\n    ]\n)\n\n# Set load libpython from binary directory default\nif env.gcc_mode and not isMacOS() and not os.name == \"nt\" and not module_mode:\n    if env.standalone_mode:\n        rpath = \"$$ORIGIN\"\n    else:\n        rpath = python_lib_path\n\n    env.Append(LINKFLAGS=[\"-Wl,-R,'%s'\" % rpath])\n\n    # The rpath is no longer used unless we do this on modern Linux. The\n    # option name is not very revealing, but basically without this, the\n    # rpath in the binary will be ignored by the loader.\n    if \"linux\" in sys.platform:\n        env.Append(LINKFLAGS=[\"-Wl,--disable-new-dtags\"])\n\n\naddConstantBlobFile(\n    env=env,\n    resource_desc=decideConstantsBlobResourceMode(env=env, module_mode=module_mode),\n    blob_filename=getConstantBlobFilename(env.source_dir),\n    target_arch=target_arch,\n)\n\nenv.Append(CPPDEFINES=[\"_NUITKA_FROZEN=%d\" % frozen_modules])\n\n# Tell compiler to create a shared library or program.\nif module_mode:\n    if isGccName(env.the_cc_name):\n        env.Append(CCFLAGS=[\"-shared\"])\n    elif env.clang_mode:\n        pass\n    elif env.msvc_mode:\n        env.Append(CCFLAGS=[\"/LD\"])  # Create a DLL.\n    else:\n        assert False, env.the_cc_name\nelse:\n    if env.msvc_mode:\n        # For complete outputs, we have to match the C runtime of the Python DLL, if any,\n        # for Nuitka-Python there is of course none.\n        if not env.nuitka_python and (\n            forced_stdout_path not in (\"{NONE}\", \"{NULL}\", None)\n            or forced_stderr_path not in (\"{NONE}\", \"{NULL}\", None)\n        ):\n            env.Append(CCFLAGS=[\"/MD\"])  # Multithreaded, dynamic version of C run time.\n        else:\n            env.Append(CCFLAGS=[\"/MT\"])  # Multithreaded, static version of C run time.\n\nif module_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_MODULE\"])\nelse:\n    env.Append(CPPDEFINES=[\"_NUITKA_EXE\"])\n\n\ndef discoverSourceFiles():\n    result = []\n\n    # Scan for Nuitka created source files, and add them too.\n    result.extend(scanSourceDir(env=env, dirname=source_dir, plugins=False))\n    result.extend(\n        scanSourceDir(\n            env=env,\n            dirname=os.path.join(source_dir, \"plugins\"),\n            plugins=True,\n        )\n    )\n\n    static_src_filenames = []\n\n    # Main program, unless of course it's a Python module/package we build.\n    if not module_mode:\n        static_src_filenames.append(\"MainProgram.c\")\n\n    # Compiled types.\n    static_src_filenames.append(\"CompiledFunctionType.c\")\n\n    result += [\n        provideStaticSourceFile(\n            env=env,\n            sub_path=filename,\n            c11_mode=env.c11_mode,\n        )\n        for filename in static_src_filenames\n    ]\n\n    return result\n\n\nsource_files = discoverSourceFiles()\n\nif module_mode:\n    # For Python modules, the standard shared library extension is not what\n    # gets used. spell-checker: ignore SHLIBSUFFIX\n    env[\"SHLIBSUFFIX\"] = module_suffix\n\n    target = env.SharedLibrary(\n        result_base_path, source_files, no_import_lib=no_import_lib\n    )\nelse:\n    target = env.Program(result_exe, source_files)\n\n# Use compiler/linker flags provided via environment variables\nimportEnvironmentVariableSettings(env)\n\n# Remove the target file to avoid cases where it falsely doesn't get rebuild\n# and then lingers from previous builds,\nif os.path.exists(target[0].abspath):\n    os.unlink(target[0].abspath)\n\nif job_count:\n    scons_details_logger.info(\"Told to run compilation on %d CPUs.\" % job_count)\n\n\ndef createBuildDefinitionsFile():\n    build_definitions = {}\n\n    if uninstalled_python and not env.static_libpython:\n        # Use the non-external one, so it's not a short path.\n        build_definitions[\"PYTHON_HOME_PATH\"] = python_prefix\n\n    build_definitions[\"NO_PYTHON_WARNINGS\"] = 1 if no_python_warnings else 0\n\n    if python_version < (3,):\n        build_definitions[\"SYSFLAG_PY3K_WARNING\"] = (\n            1 if python_sysflag_py3k_warning else 0\n        )\n\n        build_definitions[\"SYSFLAG_DIVISION_WARNING\"] = (\n            1 if python_sysflag_division_warning else 0\n        )\n\n        build_definitions[\"SYSFLAG_UNICODE\"] = 1 if python_sysflag_unicode else 0\n\n    build_definitions[\"SYSFLAG_BYTES_WARNING\"] = (\n        1 if python_sysflag_bytes_warning else 0\n    )\n\n    build_definitions[\"SYSFLAG_NO_SITE\"] = 1 if python_sysflag_no_site else 0\n\n    build_definitions[\"SYSFLAG_VERBOSE\"] = 1 if python_sysflag_verbose else 0\n\n    build_definitions[\"SYSFLAG_UTF8\"] = 1 if python_sysflag_utf8 else 0\n\n    build_definitions[\"SYSFLAG_OPTIMIZE\"] = python_sysflag_optimize\n\n    build_definitions[\"_NUITKA_NO_ASSERTS\"] = 1 if python_flag_no_asserts else 0\n\n    build_definitions[\"_NUITKA_NO_DOCSTRINGS\"] = 1 if python_flag_no_docstrings else 0\n\n    build_definitions[\"_NUITKA_NO_ANNOTATIONS\"] = 1 if python_flag_no_annotations else 0\n\n    build_definitions[\"SYSFLAG_NO_RANDOMIZATION\"] = (\n        1 if python_sysflag_no_randomization else 0\n    )\n\n    build_definitions[\"SYSFLAG_UNBUFFERED\"] = 1 if python_sysflag_unbuffered else 0\n\n    build_definitions[\"SYSFLAG_ISOLATED\"] = 1 if python_sysflag_isolated else 0\n\n    if forced_stdout_path:\n        if forced_stdout_path == \"{NONE}\":\n            build_definitions[\"NUITKA_FORCED_STDOUT_NONE_BOOL\"] = 1\n        elif forced_stdout_path == \"{NULL}\":\n            build_definitions[\"NUITKA_FORCED_STDOUT_NULL_BOOL\"] = 1\n        else:\n            build_definitions[\"NUITKA_FORCED_STDOUT_PATH\"] = forced_stdout_path\n\n    if forced_stderr_path:\n        if forced_stderr_path == \"{NONE}\":\n            build_definitions[\"NUITKA_FORCED_STDERR_NONE_BOOL\"] = 1\n        elif forced_stderr_path == \"{NULL}\":\n            build_definitions[\"NUITKA_FORCED_STDERR_NULL_BOOL\"] = 1\n        else:\n            build_definitions[\"NUITKA_FORCED_STDERR_PATH\"] = forced_stderr_path\n\n    build_definitions[\"NUITKA_MAIN_MODULE_NAME\"] = main_module_name\n    build_definitions[\"NUITKA_MAIN_IS_PACKAGE_BOOL\"] = main_module_name != \"__main__\"\n\n    createDefinitionsFile(source_dir, \"build_definitions.h\", build_definitions)\n\n\nif forced_stderr_path and not forced_stdout_path:\n    env.Append(CPPDEFINES=[\"NUITKA_STDERR_NOT_VISIBLE\"])\n\nif file_reference_mode == \"original\":\n    env.Append(CPPDEFINES=[\"_NUITKA_FILE_REFERENCE_ORIGINAL_MODE\"])\n\n\ncreateBuildDefinitionsFile()\n\n# The meta path based loader might want to respect that, so it does verbose traces in module\n# mode, mostly for debugging purposes only.\nif module_mode and python_sysflag_verbose:\n    env.Append(CPPDEFINES=[\"_NUITKA_SYSFLAG_VERBOSE=1\"])\n\n# Hack to make Scons use tempfile for gcc linking, to avoid line length limits,\n# which can make linking fail with many modules otherwise. Most needed on Windows,\n# but useful on other platforms too.\nif env.gcc_mode:\n    makeGccUseLinkerFile(\n        source_files=source_files,\n        module_mode=module_mode,\n        env=env,\n    )\n\n# Plugin contributed C defines should be used too.\nenv.Append(CPPDEFINES=cpp_defines)\n# Plugin contributed C include directories should be used too.\nenv.Append(CPPPATH=cpp_include_dirs)\n# Plugin contributed link dirs should be used too.\nenv.Append(LIBPATH=link_dirs)\n# Plugin contributed link libraries should be used too.\nenv.Append(LIBS=link_libraries)\n\n# Work around windows bugs and use watchdogs to track progress of compilation.\nenableSpawnMonitoring(\n    env=env,\n    module_mode=module_mode,\n    source_files=source_files,\n)\n\n# Before we go, also lets turn KeyboardInterrupt into a mere error exit as the\n# scons traceback is not going to be very interesting to us.\nchangeKeyboardInterruptToErrorExit()\n\n# Check if ccache is installed, and complain if it is not.\nif env.gcc_mode:\n    enableCcache(\n        env=env,\n        source_dir=source_dir,\n        python_prefix=python_prefix_external,\n        assume_yes_for_downloads=assume_yes_for_downloads,\n        disable_ccache=disable_ccache,\n    )\n\nif env.msvc_mode and not disable_ccache:\n    enableClcache(\n        env=env,\n        source_dir=source_dir,\n    )\n\nwriteSconsReport(env)\n\nsetSconsProgressBarTotal(name=env.progressbar_name, total=len(source_files))\n\nscons_details_logger.info(\"Launching Scons target: %s\" % target)\nenv.Default(target)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/CCompilerVersion.scons",
    "content": "# -*- python -*-\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nThe CCompileVersion scons file is for version output of the C compiler used with\ngiven flags only. Check out Backend.scons for where the actual compiled binaries\nare build.\n\nThis is supposed to output compiler related information and then quit. It should\nactually compile anything.\n\n\"\"\"\n\n# Make nuitka package importable from calling installation\n\nimport sys\nimport os\nimport types\n\nsys.modules[\"nuitka\"] = types.ModuleType(\"nuitka\")\nsys.modules[\"nuitka\"].__path__ = [os.environ[\"NUITKA_PACKAGE_DIR\"]]\n\n# We are in the build.build package really.\nimport nuitka.build  # pylint: disable=unused-import\n\n__package__ = \"nuitka.build\"  # pylint: disable=redefined-builtin\n\n# isort:start\n\nfrom SCons.Script import (  # pylint: disable=I0021,import-error\n    ARGUMENTS,\n    Environment,\n    GetOption,\n)\n\nfrom nuitka.Tracing import (\n    my_print,\n    scons_details_logger,\n    scons_logger,\n    setQuiet,\n)\n\nfrom .SconsCompilerSettings import (\n    checkWindowsCompilerFound,\n    reportCCompiler,\n    setupCCompiler,\n    switchFromGccToGpp,\n)\nfrom .SconsHacks import getEnhancedToolDetect\nfrom .SconsUtils import (\n    addClangClPathFromMSVC,\n    createEnvironment,\n    getArgumentBool,\n    getArgumentDefaulted,\n    getArgumentList,\n    getArgumentRequired,\n    getExecutablePath,\n    initScons,\n    isClangName,\n    isGccName,\n    prepareEnvironment,\n    setArguments,\n)\n\n# spell-checker: ignore ccversion,ccflags,werror,cppdefines,cpppath,cppflags\n# spell-checker: ignore cxxflags,ldflags,libpath,linkflags\n\n# Set the arguments.\nsetArguments(ARGUMENTS)\n\n# Set up the basic stuff.\ninitScons()\n\nnuitka_src = getArgumentRequired(\"nuitka_src\")\n\n# Module mode: Create a Python extension module, create an executable otherwise.\nmodule_mode = getArgumentBool(\"module_mode\", False)\n\n# Debug mode: Less optimizations, debug information in the resulting binary.\ndebug_mode = getArgumentBool(\"debug_mode\", False)\n\n# Experimental indications. Do things that are not yet safe to do.\nexperimental = getArgumentList(\"experimental\", \"\")\n\n# LTO mode: Use link time optimizations of C compiler if available and known\n# good with the compiler in question.\nlto_mode = getArgumentDefaulted(\"lto_mode\", \"auto\")\n\n# Windows subsystem mode: Disable console for windows builds.\ndisable_console = getArgumentBool(\"disable_console\", False)\n\n# Unstripped mode: Do not remove debug symbols.\nunstripped_mode = getArgumentBool(\"unstripped_mode\", False)\n\n# Target arch, uses for compiler choice and quick linking of constants binary\n# data.\ntarget_arch = ARGUMENTS[\"target_arch\"]\n\n# MinGW compiler mode, optional and interesting to Windows only.\nmingw_mode = getArgumentBool(\"mingw_mode\", False)\n\n# Clang compiler mode, forced on macOS and FreeBSD (excluding PowerPC), optional on Linux.\nclang_mode = getArgumentBool(\"clang_mode\", False)\n\n# Clang on Windows with no requirement to use MinGW64 or using MSYS2 MinGW flavor,\n# is changed to ClangCL from Visual Studio.\nclangcl_mode = False\nif os.name == \"nt\" and not mingw_mode and clang_mode:\n    clang_mode = False\n    clangcl_mode = True\n\n# Show scons mode, output information about Scons operation\nshow_scons_mode = getArgumentBool(\"show_scons\", False)\nscons_details_logger.is_quiet = not show_scons_mode\n\nif int(os.getenv(\"NUITKA_QUIET\", \"0\")):\n    setQuiet()\n\n# Forced MSVC version (windows-only)\nmsvc_version = getArgumentDefaulted(\"msvc_version\", None)\n\n# Disable ccache/clcache usage if that is requested\ndisable_ccache = getArgumentBool(\"disable_ccache\", False)\n\n# Allow automatic downloads for ccache, etc.\nassume_yes_for_downloads = getArgumentBool(\"assume_yes_for_downloads\", False)\n\n# Minimum version required on macOS.\nmacos_min_version = getArgumentDefaulted(\"macos_min_version\", \"\")\n\n# Target arch for macOS.\nmacos_target_arch = getArgumentDefaulted(\"macos_target_arch\", \"\")\n\n# gcc compiler cf_protection option\ncf_protection = getArgumentDefaulted(\"cf_protection\", \"auto\")\n\n# Amount of jobs to use.\njob_count = GetOption(\"num_jobs\")\n\n# Prepare environment for compiler detection.\nmingw_mode = prepareEnvironment(mingw_mode=mingw_mode)\n\n# TODO: Merge to prepareEnvironment as well.\nif \"CXX\" in os.environ:\n    os.environ[\"CXX\"] = os.path.normpath(os.environ[\"CXX\"])\n\n    if os.path.isdir(os.environ[\"CXX\"]):\n        sys.exit(\"Error, the CXX variable must point to file, not directory.\")\n\n    cxx_dirname = os.path.dirname(os.environ[\"CXX\"])\n\n    if os.name == \"nt\" and isGccName(os.path.basename(os.environ[\"CXX\"])):\n        if show_scons_mode:\n            my_print(\"Scons: Environment CXX seems to be a gcc, enable mingw_mode.\")\n        mingw_mode = True\n\n    if os.path.isdir(cxx_dirname):\n        os.environ[\"PATH\"] = os.pathsep.join(\n            [cxx_dirname] + os.environ[\"PATH\"].split(os.pathsep)\n        )\n\n# Patch the compiler detection.\nEnvironment.Detect = getEnhancedToolDetect()\n\n# Create Scons environment, the main control tool. Don't include \"mingw\" on\n# Windows immediately, we will default to MSVC if available.\nenv = createEnvironment(\n    mingw_mode=mingw_mode,\n    msvc_version=msvc_version,\n    target_arch=target_arch,\n    experimental=experimental,\n    no_deployment=(),\n)\n\nscons_details_logger.info(\"Initial CC: %r\" % env.get(\"CC\"))\nscons_details_logger.info(\n    \"Initial CCVERSION: %r\" % (env.get(\"CCVERSION\"),),\n)\n\nif \"CC\" in os.environ:\n    # If the environment variable CC is set, use that.\n    env[\"CCVERSION\"] = None\n\n    scons_details_logger.info(\"Overridden with environment CC: %r\" % env[\"CC\"])\nelif clangcl_mode:\n    # If possible, add Clang directory from MSVC if available.\n    addClangClPathFromMSVC(env=env)\nelif clang_mode and not mingw_mode:\n    # If requested by the user, use the clang compiler, overriding what was\n    # said in environment.\n\n    env[\"CC\"] = \"clang\"\n    env[\"CCVERSION\"] = None\n\n# On Windows, in case MSVC was not found and not previously forced, use the\n# winlibs MinGW64 as a download, and use it as a fallback.\nenv = checkWindowsCompilerFound(\n    env=env,\n    target_arch=target_arch,\n    clang_mode=clang_mode,\n    msvc_version=msvc_version,\n    assume_yes_for_downloads=assume_yes_for_downloads,\n)\n\nenv.the_compiler = env[\"CC\"] or env[\"CXX\"]\nenv.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))\nenv.debug_mode = debug_mode\nenv.unstripped_mode = unstripped_mode\nenv.disable_console = disable_console\nenv.nuitka_src = nuitka_src\nenv.low_memory = False\nenv.macos_min_version = macos_min_version\nenv.macos_target_arch = macos_target_arch\n\n# Requested or user provided, detect if it's clang even from environment\nif isClangName(env.the_cc_name):\n    clang_mode = True\n    env[\"CCVERSION\"] = None\n\n# We consider clang to be a form of gcc for the most things, they strive to\n# be compatible.\nenv.gcc_mode = isGccName(env.the_cc_name) or clang_mode\nenv.clang_mode = clang_mode\n\n# Only use MSVC if not already clear, we are using MinGW.\nenv.msvc_mode = os.name == \"nt\" and not env.gcc_mode\nenv.mingw_mode = os.name == \"nt\" and env.gcc_mode\nenv.clangcl_mode = clangcl_mode\n\n# gcc compiler cf_protection option\nenv.cf_protection = cf_protection\n\n# Consider switching from gcc to its g++ compiler as a workaround that makes us work without C11.\nswitchFromGccToGpp(\n    env=env,\n)\n\nif env.the_compiler is None or getExecutablePath(env.the_compiler, env=env) is None:\n    scons_logger.sysexit(\"No usable C compiler detected\")\n\nenv.the_compiler = getExecutablePath(env.the_compiler, env=env)\n\n# Report the C compiler used.\nreportCCompiler(env, \"Version\", my_print)\n\n# Set up C compiler settings, we would use that mode mode outputs.\nsetupCCompiler(\n    env=env,\n    lto_mode=lto_mode,\n    pgo_mode=\"no\",  # TODO: Have this here too, decompression might benefit.\n    job_count=job_count,\n    onefile_compile=False,\n)\n\n# TODO: Report modes.\n\nsys.exit(0)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/DataComposerInterface.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Interface to data composer\n\n\"\"\"\n\nimport os\nimport subprocess\nimport sys\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Options import isExperimental\nfrom nuitka.Tracing import data_composer_logger\nfrom nuitka.utils.Execution import withEnvironmentVarsOverridden\nfrom nuitka.utils.FileOperations import changeFilenameExtension, getFileSize\nfrom nuitka.utils.Json import loadJsonFromFilename\n\n# Indicate not done with -1\n_data_composer_size = None\n_data_composer_stats = None\n\n\ndef getDataComposerReportValues():\n    return OrderedDict(blob_size=_data_composer_size, stats=_data_composer_stats)\n\n\ndef runDataComposer(source_dir):\n    from nuitka.plugins.Plugins import Plugins\n\n    # This module is a singleton, pylint: disable=global-statement\n    global _data_composer_stats\n\n    Plugins.onDataComposerRun()\n    blob_filename, _data_composer_stats = _runDataComposer(source_dir=source_dir)\n    Plugins.onDataComposerResult(blob_filename)\n\n    global _data_composer_size\n    _data_composer_size = getFileSize(blob_filename)\n\n\ndef _runDataComposer(source_dir):\n    data_composer_path = os.path.normpath(\n        os.path.join(os.path.dirname(__file__), \"..\", \"tools\", \"data_composer\")\n    )\n\n    mapping = {\n        \"NUITKA_PACKAGE_HOME\": os.path.dirname(\n            os.path.abspath(sys.modules[\"nuitka\"].__path__[0])\n        )\n    }\n\n    if isExperimental(\"debug-constants\"):\n        mapping[\"NUITKA_DATA_COMPOSER_VERBOSE\"] = \"1\"\n\n    blob_filename = getConstantBlobFilename(source_dir)\n\n    stats_filename = changeFilenameExtension(blob_filename, \".txt\")\n\n    with withEnvironmentVarsOverridden(mapping):\n        try:\n            subprocess.check_call(\n                [\n                    sys.executable,\n                    data_composer_path,\n                    source_dir,\n                    blob_filename,\n                    stats_filename,\n                ],\n                shell=False,\n            )\n        except subprocess.CalledProcessError:\n            data_composer_logger.sysexit(\n                \"Error executing data composer, please report the above exception.\"\n            )\n\n    return blob_filename, loadJsonFromFilename(stats_filename)\n\n\ndef getConstantBlobFilename(source_dir):\n    return os.path.join(source_dir, \"__constants.bin\")\n\n\ndef deriveModuleConstantsBlobName(filename):\n    assert filename.endswith(\".const\")\n\n    basename = filename[:-6]\n\n    if basename == \"__constants\":\n        return \"\"\n    elif basename == \"__bytecode\":\n        return \".bytecode\"\n    elif basename == \"__files\":\n        return \".files\"\n    else:\n        # Strip \"module.\" prefix\"\n        basename = basename[7:]\n\n        return basename\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/Onefile.scons",
    "content": "# -*- python -*-\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nThe Onefile scons file for the bootstrap binary, check out Backend.scons for\nwhere the actual compiled binaries are build. If you have Scons or Windows\nplatform knowledge, please be especially invited and contribute improvements.\n\nThis file is used to build a bootstrap binary that only unpacks the distribution\ncontents to have a launch it.\n\"\"\"\n\n# Make nuitka package importable from calling installation\n\nimport sys\nimport os\nimport types\n\nsys.modules[\"nuitka\"] = types.ModuleType(\"nuitka\")\nsys.modules[\"nuitka\"].__path__ = [os.environ[\"NUITKA_PACKAGE_DIR\"]]\n\n# We are in the build.build package really.\nimport nuitka.build  # pylint: disable=unused-import\n\n__package__ = \"nuitka.build\"  # pylint: disable=redefined-builtin\n\n# isort:start\n\nfrom SCons.Script import (  # pylint: disable=I0021,import-error\n    ARGUMENTS,\n    Environment,\n    GetOption,\n)\n\nfrom nuitka.Tracing import (\n    my_print,\n    scons_details_logger,\n    scons_logger,\n    setQuiet,\n)\nfrom nuitka.utils.FileOperations import getExternalUsePath\nfrom nuitka.utils.Utils import isMacOS\n\nfrom .SconsCaching import enableCcache, enableClcache\nfrom .SconsCompilerSettings import (\n    addConstantBlobFile,\n    checkWindowsCompilerFound,\n    importEnvironmentVariableSettings,\n    reportCCompiler,\n    setupCCompiler,\n    switchFromGccToGpp,\n)\nfrom .SconsHacks import getEnhancedToolDetect, makeGccUseLinkerFile\nfrom .SconsProgress import enableSconsProgressBar, setSconsProgressBarTotal\nfrom .SconsSpawn import enableSpawnMonitoring\nfrom .SconsUtils import (\n    addClangClPathFromMSVC,\n    changeKeyboardInterruptToErrorExit,\n    createDefinitionsFile,\n    createEnvironment,\n    getArgumentBool,\n    getArgumentDefaulted,\n    getArgumentList,\n    getArgumentRequired,\n    getExecutablePath,\n    getMsvcVersionString,\n    initScons,\n    isClangName,\n    isGccName,\n    prepareEnvironment,\n    provideStaticSourceFile,\n    raiseNoCompilerFoundErrorExit,\n    scanSourceDir,\n    setArguments,\n    setupScons,\n    writeSconsReport,\n)\n\n# spell-checker: ignore ccversion,ccflags,werror,cppdefines,cpppath,cppflags\n# spell-checker: ignore cxxflags,ldflags,libpath,linkflags\n\n# Set the arguments.\nsetArguments(ARGUMENTS)\n\n# Set up the basic stuff.\ninitScons()\n\n# The directory containing the C files generated by Nuitka to be built using\n# scons. They are referred to as sources from here on.\nsource_dir = getArgumentRequired(\"source_dir\")\n\n# The directory containing Nuitka provided C files to be built and where it\n# should be used.\nnuitka_src = getArgumentRequired(\"nuitka_src\")\nstatic_src = os.path.join(source_dir, \"static\")\n\n# The name of executable that we produce\nresult_exe = getArgumentDefaulted(\"result_exe\", None)\n\n# The suffix for an extension module (in module mode).\nmodule_suffix = getArgumentDefaulted(\"module_suffix\", None)\n\n# Full names shall be used, no remapping for cacheable filenames.\nfull_names = getArgumentBool(\"full_names\", False)\n\n# Module mode: Create a Python extension module, create an executable otherwise.\nmodule_mode = getArgumentBool(\"module_mode\", False)\n\n# Debug mode: Less optimizations, debug information in the resulting binary.\ndebug_mode = getArgumentBool(\"debug_mode\", False)\n\n# Deployment mode\ndeployment_mode = getArgumentBool(\"deployment\", False)\n\n# Experimental indications. Do things that are not yet safe to do.\nno_deployment = getArgumentList(\"no_deployment\", \"\")\n\n# Experimental indications. Do things that are not yet safe to do.\nexperimental = getArgumentList(\"experimental\", \"\")\n\n# Tracing mode. Output program progress.\ntrace_mode = getArgumentBool(\"trace_mode\", False)\n\n# LTO mode: Use link time optimizations of C compiler if available and known\n# good with the compiler in question.\nlto_mode = getArgumentDefaulted(\"lto_mode\", \"auto\")\n\n# Windows subsystem mode: Disable console for windows builds.\ndisable_console = getArgumentBool(\"disable_console\", False)\n\n# Unstripped mode: Do not remove debug symbols.\nunstripped_mode = getArgumentBool(\"unstripped_mode\", False)\n\n# Target arch, uses for compiler choice and quick linking of constants binary\n# data.\ntarget_arch = ARGUMENTS[\"target_arch\"]\n\n# MinGW compiler mode, optional and interesting to Windows only.\nmingw_mode = getArgumentBool(\"mingw_mode\", False)\n\n# Clang compiler mode, forced on macOS and FreeBSD (excluding PowerPC), optional on Linux.\nclang_mode = getArgumentBool(\"clang_mode\", False)\n\n# Clang on Windows with no requirement to use MinGW64 or using MSYS2 MinGW flavor,\n# is changed to ClangCL from Visual Studio.\nclangcl_mode = False\nif clang_mode and os.name == \"nt\" and not mingw_mode:\n    clang_mode = False\n    clangcl_mode = True\n\n# Show scons mode, output information about Scons operation\nshow_scons_mode = getArgumentBool(\"show_scons\", False)\nscons_details_logger.is_quiet = not show_scons_mode\n\nif int(os.getenv(\"NUITKA_QUIET\", \"0\")):\n    setQuiet()\n\n# Home of Python to be compiled against, used to find tools like clcache and\n# ccache, no linking against Python is needed here.\npython_prefix = getArgumentRequired(\"python_prefix\")\n\npython_prefix_external = getExternalUsePath(python_prefix)\n\n# Forced MSVC version (windows-only)\nmsvc_version = getArgumentDefaulted(\"msvc_version\", None)\n\n# Disable ccache/clcache usage if that is requested\ndisable_ccache = getArgumentBool(\"disable_ccache\", False)\n\n# Preprocessor defines and link libraries from plugins\ncpp_defines = getArgumentList(\"cpp_defines\", \"\")\ncpp_include_dirs = getArgumentList(\"cpp_include_dirs\", \"\")\nlink_dirs = getArgumentList(\"link_dirs\", \"\")\nlink_libraries = getArgumentList(\"link_libraries\", \"\")\n\n# Allow automatic downloads for ccache, etc.\nassume_yes_for_downloads = getArgumentBool(\"assume_yes_for_downloads\", False)\n\n# Onefile bootstrap is optional.\nonefile_splash_screen = getArgumentBool(\"onefile_splash_screen\", False)\n\n# Minimum version required on macOS.\nmacos_min_version = getArgumentDefaulted(\"macos_min_version\", \"\")\n\n# Target arch for macOS.\nmacos_target_arch = getArgumentDefaulted(\"macos_target_arch\", \"\")\n\n# gcc compiler cf_protection option\ncf_protection = getArgumentDefaulted(\"cf_protection\", \"auto\")\n\nif getArgumentBool(\"progress_bar\", True) and not show_scons_mode:\n    enableSconsProgressBar()\n\n# Amount of jobs to use.\njob_count = GetOption(\"num_jobs\")\n\n# Prepare environment for compiler detection.\nmingw_mode = prepareEnvironment(mingw_mode=mingw_mode)\n\n# TODO: Merge to prepareEnvironment as well.\nif \"CXX\" in os.environ:\n    os.environ[\"CXX\"] = os.path.normpath(os.environ[\"CXX\"])\n\n    if os.path.isdir(os.environ[\"CXX\"]):\n        sys.exit(\"Error, the CXX variable must point to file, not directory.\")\n\n    cxx_dirname = os.path.dirname(os.environ[\"CXX\"])\n\n    if os.name == \"nt\" and isGccName(os.path.basename(os.environ[\"CXX\"])):\n        if show_scons_mode:\n            my_print(\"Scons: Environment CXX seems to be a gcc, enable mingw_mode.\")\n        mingw_mode = True\n\n    if os.path.isdir(cxx_dirname):\n        os.environ[\"PATH\"] = os.pathsep.join(\n            [cxx_dirname] + os.environ[\"PATH\"].split(os.pathsep)\n        )\n\n# Patch the compiler detection.\nEnvironment.Detect = getEnhancedToolDetect()\n\n# Create Scons environment, the main control tool. Don't include \"mingw\" on\n# Windows immediately, we will default to MSVC if available.\nenv = createEnvironment(\n    mingw_mode=mingw_mode,\n    msvc_version=msvc_version,\n    target_arch=target_arch,\n    experimental=experimental,\n    no_deployment=no_deployment,\n)\n\nscons_details_logger.info(\"Initial CC: %r\" % env.get(\"CC\"))\nscons_details_logger.info(\n    \"Initial CCVERSION: %r\" % (env.get(\"CCVERSION\"),),\n)\n\nif \"CC\" in os.environ:\n    # If the environment variable CC is set, use that.\n    env[\"CCVERSION\"] = None\n\n    scons_details_logger.info(\"Overridden with environment CC: %r\" % env[\"CC\"])\nelif clangcl_mode:\n    # If possible, add Clang directory from MSVC if available.\n    addClangClPathFromMSVC(env=env)\nelif clang_mode and not mingw_mode:\n    # If requested by the user, use the clang compiler, overriding what was\n    # said in environment.\n\n    env[\"CC\"] = \"clang\"\n    env[\"CCVERSION\"] = None\n\n# On Windows, in case MSVC was not found and not previously forced, use the\n# winlibs MinGW64 as a download, and use it as a fallback.\nenv = checkWindowsCompilerFound(\n    env=env,\n    target_arch=target_arch,\n    clang_mode=clang_mode,\n    msvc_version=msvc_version,\n    assume_yes_for_downloads=assume_yes_for_downloads,\n)\n\nenv.the_compiler = env[\"CC\"] or env[\"CXX\"]\nenv.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))\nenv.standalone_mode = True  # We are only used in this case.\nenv.debug_mode = debug_mode\nenv.unstripped_mode = unstripped_mode\nenv.disable_console = disable_console\nenv.source_dir = source_dir\nenv.nuitka_src = nuitka_src\nenv.low_memory = False  # Never a concern in this case.\nenv.macos_min_version = macos_min_version\nenv.macos_target_arch = macos_target_arch\n\n# Requested or user provided, detect if it's clang even from environment\nif isClangName(env.the_cc_name):\n    clang_mode = True\n    env[\"CCVERSION\"] = None\n\n# We consider clang to be a form of gcc for the most things, they strive to\n# be compatible.\nenv.gcc_mode = isGccName(env.the_cc_name) or clang_mode\nenv.clang_mode = clang_mode\n\n# Only use MSVC if not already clear, we are using MinGW.\nenv.msvc_mode = os.name == \"nt\" and not env.gcc_mode\nenv.mingw_mode = os.name == \"nt\" and env.gcc_mode\nenv.clangcl_mode = clangcl_mode\n\n# gcc compiler cf_protection option\nenv.cf_protection = cf_protection\n\n# Consider switching from gcc to its g++ compiler as a workaround that makes us work without C11.\nswitchFromGccToGpp(\n    env=env,\n)\n\nif env.the_compiler is None or getExecutablePath(env.the_compiler, env=env) is None:\n    raiseNoCompilerFoundErrorExit()\n\nif show_scons_mode:\n    my_print(\"Scons: Compiler used\", end=\" \")\n    my_print(getExecutablePath(env.the_compiler, env=env), end=\" \")\n\n    if os.name == \"nt\" and env.msvc_mode:\n        my_print(\"(MSVC %s)\" % getMsvcVersionString(env))\n\n    my_print()\n\n# Set build directory and scons general settings.\nsetupScons(env, source_dir)\n\n# Report the C compiler used.\nreportCCompiler(env, \"Onefile\", output_func=scons_logger.info)\n\n\n# Set up C compiler settings.\nsetupCCompiler(\n    env=env,\n    lto_mode=lto_mode,\n    pgo_mode=\"no\",  # TODO: Have this here too, decompression might benefit.\n    job_count=job_count,\n    onefile_compile=True,\n)\n\n# Avoid them as appearing to be different files. TODO: Find out which\n# clang version has this, clang-8 does not.\nif env.gcc_mode and not env.clang_mode and env.gcc_version >= (8,):\n    if source_dir != \".\" and not full_names:\n        # TODO: This also lies for modules codes.\n        env.Append(\n            CCFLAGS=[\n                \"--file-prefix-map=%s=%s\" % (os.path.normpath(source_dir), \".\"),\n                \"--file-prefix-map=%s=%s\"\n                % (\n                    os.path.normpath(os.path.join(source_dir, \"static_src\")),\n                    os.path.normpath(os.path.join(nuitka_src, \"static_src\")),\n                ),\n            ]\n        )\n\nif env.msvc_mode:\n    # With Clang on Windows, there is also an linker to use.\n    env.Append(\n        CCFLAGS=[\n            \"/EHsc\",  # No C++ exception handling code.\n            \"/J\",  # default char type is unsigned.\n            \"/Gd\",  # Use C calling convention by default.\n            \"/bigobj\",  # Product object files with larger internal limits.\n        ]\n    )\n\n    # No incremental linking.\n    env.Append(LINKFLAGS=[\"/INCREMENTAL:NO\"])\n\nif debug_mode:\n    if env.gcc_mode:\n        # Allow gcc/clang to point out all kinds of inconsistency to us by\n        # raising an error.\n        env.Append(\n            CCFLAGS=[\n                \"-Wall\",\n                \"-Werror\",\n            ]\n        )\n\n    elif env.msvc_mode:\n        # Disable warnings that system headers already show.\n        env.Append(\n            CCFLAGS=[\n                \"/W4\",\n                \"/wd4505\",\n                \"/wd4127\",\n                \"/wd4100\",\n                \"/wd4702\",\n                \"/wd4189\",\n                \"/wd4211\",\n                \"/WX\",\n            ]\n        )\n\n        # Disable warnings, the first 3 are for Python headers, maybe not needed.\n        env.Append(CCFLAGS=[\"/wd4512\", \"/wd4510\", \"/wd4610\", \"/wd4996\"])\n\nif trace_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_TRACE\"])\n\nif deployment_mode:\n    env.Append(CPPDEFINES=[\"_NUITKA_DEPLOYMENT_MODE\"])\n\nenv.Append(CPPDEFINES=[\"_NUITKA_ONEFILE_MODE\"])\n\n# The static include files reside in Nuitka installation, which may be where\n# the \"nuitka.build\" package lives.\nnuitka_include = os.path.join(nuitka_src, \"include\")\n\nif not os.path.exists(os.path.join(nuitka_include, \"nuitka\", \"prelude.h\")):\n    sys.exit(\n        \"Error, cannot locate Nuitka includes at '%s', broken installation.\"\n        % nuitka_include\n    )\n\n# We have include files in the build directory and the static include directory\n# that is located inside Nuitka installation, as well as an inline copy of zstd\n# that should be found.\nenv.Append(\n    CPPPATH=[\n        source_dir,\n        nuitka_include,\n        os.path.join(env.nuitka_src, \"static_src\"),\n        os.path.join(env.nuitka_src, \"inline_copy\", \"zstd\"),\n    ],\n)\n\n# Tell compiler to create a program.\nif env.msvc_mode:\n    env.Append(CCFLAGS=[\"/MT\"])  # Multithreaded, static version of C run time.\n\nif isMacOS():\n    addConstantBlobFile(\n        env=env,\n        blob_filename=os.path.join(source_dir, \"__payload.bin\"),\n        resource_desc=(\"mac_section\", \"default on macOS\"),\n        target_arch=target_arch,\n    )\n\n\ndef discoverSourceFiles():\n    result = []\n\n    # Scan for Nuitka created source files, and add them too.\n    result.extend(scanSourceDir(env=env, dirname=source_dir, plugins=False))\n    result.extend(\n        scanSourceDir(\n            env=env,\n            dirname=os.path.join(source_dir, \"plugins\"),\n            plugins=True,\n        )\n    )\n\n    # Main onefile bootstrap program\n    result.append(\n        provideStaticSourceFile(\n            env=env,\n            sub_path=\"OnefileBootstrap.c\",\n            c11_mode=env.c11_mode,\n        )\n    )\n\n    if onefile_splash_screen:\n        result.append(\n            provideStaticSourceFile(\n                env=env,\n                sub_path=\"OnefileSplashScreen.cpp\",\n                c11_mode=False,\n            )\n        )\n\n    return result\n\n\nsource_files = discoverSourceFiles()\n\ntarget = env.Program(result_exe, source_files)\n\n# Use compiler/linker flags provided via environment variables\nimportEnvironmentVariableSettings(env)\n\n# Remove the target file to avoid cases where it falsely doesn't get rebuild\n# and then lingers from previous builds,\nif os.path.exists(target[0].abspath):\n    os.unlink(target[0].abspath)\n\nif job_count:\n    scons_details_logger.info(\"Told to run compilation on %d CPUs.\" % job_count)\n\n# Plugin contributed C defines should be used too.\nenv.Append(CPPDEFINES=cpp_defines)\n# Plugin contributed C include directories should be used too.\nenv.Append(CPPPATH=cpp_include_dirs)\n# Plugin contributed link dirs should be used too.\nenv.Append(LIBPATH=link_dirs)\n# Plugin contributed link libraries should be used too.\nenv.Append(LIBS=link_libraries)\n\n# Work around windows bugs and use watchdogs to track progress of compilation.\nenableSpawnMonitoring(\n    env=env,\n    module_mode=module_mode,\n    source_files=source_files,\n)\n\n# Before we go, also lets turn KeyboardInterrupt into a mere error exit as the\n# scons traceback is not going to be very interesting to us.\nchangeKeyboardInterruptToErrorExit()\n\n# Check if ccache is installed, and complain if it is not.\nif env.gcc_mode:\n    enableCcache(\n        env=env,\n        source_dir=source_dir,\n        python_prefix=python_prefix_external,\n        assume_yes_for_downloads=assume_yes_for_downloads,\n        disable_ccache=disable_ccache,\n    )\n\nif env.msvc_mode and not disable_ccache:\n    enableClcache(\n        env=env,\n        source_dir=source_dir,\n    )\n\n\ndef createBuildDefinitionsFile():\n    onefile_definitions = {}\n\n    # TODO: Do this via a plugin too, so it can provide these externally.\n    if onefile_splash_screen:\n        onefile_definitions[\"_NUITKA_ONEFILE_SPLASH_SCREEN\"] = 1\n\n        # spell-checker: ignore Windowscodecs,Shlwapi\n        env.Append(LIBS=[\"Ole32\", \"Windowscodecs\", \"User32\", \"Gdi32\", \"Shlwapi\"])\n\n    createDefinitionsFile(source_dir, \"onefile_definitions.h\", onefile_definitions)\n\n\ncreateBuildDefinitionsFile()\n\n# Hack to make Scons use tempfile for gcc linking, to avoid line length limits,\n# which can make linking fail with many modules otherwise. Most needed on Windows,\n# but useful on other platforms too.\nif env.gcc_mode:\n    makeGccUseLinkerFile(\n        source_files=source_files,\n        module_mode=module_mode,\n        env=env,\n    )\n\nwriteSconsReport(env)\n\nsetSconsProgressBarTotal(name=\"Onefile\", total=len(source_files))\n\nscons_details_logger.info(\"Launching Scons target: %s\" % target)\nenv.Default(target)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsCaching.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Caching of C compiler output.\n\n\"\"\"\n\nimport ast\nimport os\nimport platform\nimport re\nimport sys\nfrom collections import defaultdict\n\nfrom nuitka.Tracing import scons_details_logger, scons_logger\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.Download import getCachedDownload\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getExternalUsePath,\n    getFileContentByLine,\n    getFileContents,\n    getLinkTarget,\n    makePath,\n)\nfrom nuitka.utils.Importing import importFromInlineCopy\nfrom nuitka.utils.Utils import hasMacOSIntelSupport, isMacOS\n\nfrom .SconsProgress import updateSconsProgressBar\nfrom .SconsUtils import (\n    getExecutablePath,\n    getSconsReportValue,\n    isZigName,\n    setEnvironmentVariable,\n)\n\n\ndef _getPythonDirCandidates(python_prefix):\n    result = [python_prefix]\n\n    for python_dir in (\n        sys.prefix,\n        os.getenv(\"CONDA_PREFIX\"),\n        os.getenv(\"CONDA\"),\n    ):\n        if python_dir and python_dir not in result:\n            result.append(python_dir)\n\n    return result\n\n\ndef _getCcacheGuessedPaths(python_prefix):\n    if isMacOS():\n        # For macOS, we might find Homebrew ccache installed but not in PATH.\n        for python_dir in _getPythonDirCandidates(python_prefix):\n            yield os.path.join(python_dir, \"bin\", \"ccache\")\n\n        yield \"/usr/local/opt/ccache\"\n        yield \"/opt/homebrew/bin/ccache\"\n\n\ndef _injectCcache(env, cc_path, python_prefix, assume_yes_for_downloads):\n    ccache_binary = os.getenv(\"NUITKA_CCACHE_BINARY\")\n\n    # If not provided, search it in PATH and guessed directories.\n    if ccache_binary is None:\n        ccache_binary = getExecutablePath(\"ccache\", env=env)\n\n        if ccache_binary is None:\n            for candidate in _getCcacheGuessedPaths(python_prefix):\n                scons_details_logger.info(\n                    \"Checking if ccache is at '%s' guessed path.\" % candidate\n                )\n\n                if os.path.exists(candidate):\n                    ccache_binary = candidate\n\n                    scons_details_logger.info(\n                        \"Using ccache '%s' from guessed path.\" % ccache_binary\n                    )\n\n                    break\n\n        if ccache_binary is None:\n            if hasMacOSIntelSupport():\n                # The 10.14 is the minimum we managed to compile ccache for.\n                if tuple(int(d) for d in platform.release().split(\".\")) >= (18, 2):\n                    url = \"https://nuitka.net/ccache/v4.2.1/ccache-4.2.1.zip\"\n\n                    ccache_binary = getCachedDownload(\n                        name=\"ccache\",\n                        url=url,\n                        is_arch_specific=False,\n                        specificity=url.rsplit(\"/\", 2)[1],\n                        flatten=True,\n                        binary=\"ccache\",\n                        message=\"Nuitka will make use of ccache to speed up repeated compilation.\",\n                        reject=None,\n                        assume_yes_for_downloads=assume_yes_for_downloads,\n                    )\n\n    else:\n        scons_details_logger.info(\n            \"Using ccache '%s' from 'NUITKA_CCACHE_BINARY' environment variable.\"\n            % ccache_binary\n        )\n\n    if ccache_binary is not None and os.path.exists(ccache_binary):\n        # In case we are on Windows, make sure the Anaconda form runs outside of Anaconda\n        # environment, by adding DLL folder to PATH.\n        assert areSamePaths(\n            getExecutablePath(os.path.basename(env.the_compiler), env=env), cc_path\n        )\n\n        # Spare ccache the detection of the compiler, seems it will also misbehave when it's\n        # prefixed with \"ccache\" on old gcc versions in terms of detecting need for C++ linkage.\n        env[\"LINK\"] = '\"%s\"' % cc_path\n\n        scons_details_logger.info(\n            \"Found ccache '%s' to cache C compilation result.\" % ccache_binary\n        )\n        scons_details_logger.info(\n            \"Providing real CC path '%s' via PATH extension.\" % cc_path\n        )\n\n        values = [ccache_binary, cc_path]\n\n        if isZigName(env.the_cc_name):\n            values.append(\"c++\" if env.c11_mode else \"cc\")\n\n        # We use absolute paths for CC, pass it like this, as ccache does not like absolute.\n        env[\"CXX\"] = env[\"CC\"] = \" \".join('\"%s\"' % value for value in values)\n\n        return True\n\n    return False\n\n\ndef enableCcache(\n    env, source_dir, python_prefix, assume_yes_for_downloads, disable_ccache\n):\n    inject_ccache = not disable_ccache\n\n    if inject_ccache:\n        # The ccache needs absolute path, otherwise it will not work.\n        ccache_logfile = os.path.abspath(\n            os.path.join(source_dir, \"ccache-%d.txt\" % os.getpid())\n        )\n\n        setEnvironmentVariable(env, \"CCACHE_LOGFILE\", ccache_logfile)\n        env[\"CCACHE_LOGFILE\"] = ccache_logfile\n\n        # Unless asked to do otherwise, store ccache files in our own directory.\n        if \"CCACHE_DIR\" not in os.environ:\n            ccache_dir = getCacheDir(\"ccache\")\n            makePath(ccache_dir)\n            ccache_dir = getExternalUsePath(ccache_dir)\n            setEnvironmentVariable(env, \"CCACHE_DIR\", ccache_dir)\n            env[\"CCACHE_DIR\"] = ccache_dir\n\n        if \"CLCACHE_MEMCACHED\" in os.environ:\n            scons_logger.warning(\n                \"The setting of 'CLCACHE_MEMCACHED' environment is not supported with clcache.\"\n            )\n            setEnvironmentVariable(env, \"CLCACHE_MEMCACHED\", None)\n\n        # We know the include files we created are safe to use.\n        setEnvironmentVariable(\n            env, \"CCACHE_SLOPPINESS\", \"include_file_ctime,include_file_mtime\"\n        )\n\n        # First check if it's not already supposed to be a ccache, then do nothing.\n        cc_path = getExecutablePath(env.the_compiler, env=env)\n\n        cc_is_link, cc_link_path = getLinkTarget(cc_path)\n        if cc_is_link and os.path.basename(cc_link_path) == \"ccache\":\n            scons_details_logger.info(\n                \"Chosen compiler %s is pointing to ccache %s already.\"\n                % (cc_path, cc_link_path)\n            )\n\n            inject_ccache = False\n\n    if inject_ccache:\n        inject_ccache = _injectCcache(\n            env=env,\n            cc_path=cc_path,\n            python_prefix=python_prefix,\n            assume_yes_for_downloads=assume_yes_for_downloads,\n        )\n\n    # If we failed to inject zig argument into ccache command line, we need to\n    # do it now.\n    if isZigName(env.the_cc_name) and inject_ccache is False:\n        env[\"CXX\"] = env[\"CC\"] = '\"%s\" \"%s\"' % (\n            cc_path,\n            \"cc\" if env.c11_mode else \"c++\",\n        )\n\n\ndef enableClcache(env, source_dir):\n    # We allow using Python2 still\n    if sys.version_info < (3, 5):\n        return\n\n    # spell-checker: ignore atomicwrites\n    importFromInlineCopy(\"atomicwrites\", must_exist=True)\n    importFromInlineCopy(\"clcache\", must_exist=True)\n\n    # Avoid importing this in threads, triggers CPython 3.9 importing bugs at least,\n    # do it now, so it's not a race issue.\n    import concurrent.futures.thread  # pylint: disable=I0021,unused-import,unused-variable\n\n    cl_binary = getExecutablePath(env.the_compiler, env)\n\n    # The compiler is passed via environment.\n    setEnvironmentVariable(env, \"CLCACHE_CL\", cl_binary)\n    env[\"CXX\"] = env[\"CC\"] = \"<clcache>\"\n\n    setEnvironmentVariable(env, \"CLCACHE_HIDE_OUTPUTS\", \"1\")\n\n    # Use the mode of \"clcache\" that is not dependent on MSVC filenames output\n    # spell-checker: ignore CLCACHE_NODIRECT\n    if \"CLCACHE_NODIRECT\" not in os.environ:\n        setEnvironmentVariable(env, \"CLCACHE_NODIRECT\", \"1\")\n\n    # The clcache stats filename needs absolute path, otherwise it will not work.\n    clcache_stats_filename = os.path.abspath(\n        os.path.join(source_dir, \"clcache-stats.%d.txt\" % os.getpid())\n    )\n\n    setEnvironmentVariable(env, \"CLCACHE_STATS\", clcache_stats_filename)\n    env[\"CLCACHE_STATS\"] = clcache_stats_filename\n\n    # Unless asked to do otherwise, store ccache files in our own directory.\n    if \"CLCACHE_DIR\" not in os.environ:\n        clcache_dir = getCacheDir(\"clcache\")\n        makePath(clcache_dir)\n        clcache_dir = getExternalUsePath(clcache_dir)\n        setEnvironmentVariable(env, \"CLCACHE_DIR\", clcache_dir)\n        env[\"CLCACHE_DIR\"] = clcache_dir\n\n    scons_details_logger.info(\n        \"Using inline copy of clcache with '%s' cl binary.\" % cl_binary\n    )\n\n    import atexit\n\n    atexit.register(_writeClcacheStatistics)\n\n\ndef _writeClcacheStatistics():\n    try:\n        # pylint: disable=I0021,import-error,no-name-in-module,redefined-outer-name\n        from clcache.caching import stats\n\n        if stats is not None:\n            stats.save()\n\n    except IOError:\n        raise\n    except Exception:  # Catch all the things, pylint: disable=broad-except\n        # This is run in \"atexit\" even without the module being loaded, or\n        # the stats being begun or usable.\n        pass\n\n\ndef _getCcacheStatistics(ccache_logfile):\n    data = {}\n\n    if os.path.exists(ccache_logfile):\n        re_command = re.compile(r\"\\[.*? (\\d+) *\\] Command line: (.*)$\")\n        re_result = re.compile(r\"\\[.*? (\\d+) *\\] Result: (.*)$\")\n        re_anything = re.compile(r\"\\[.*? (\\d+) *\\] (.*)$\")\n\n        # Remember command from the pid, so later decision logged against pid\n        # can be matched against it.\n        commands = {}\n\n        for line in getFileContentByLine(ccache_logfile):\n            match = re_command.match(line)\n\n            if match:\n                pid, command = match.groups()\n                commands[pid] = command\n\n            match = re_result.match(line)\n            if match:\n                pid, result = match.groups()\n                result = result.strip()\n\n                try:\n                    command = data[commands[pid]]\n                except KeyError:\n                    # It seems writing to the file can be lossy, so we can have results for\n                    # unknown commands, but we don't use the command yet anyway, so just\n                    # be unique.\n                    command = \"unknown command leading to \" + line\n\n                # Older ccache on e.g. RHEL6 wasn't explicit about linking.\n                if result == \"unsupported compiler option\":\n                    if \" -o \" in command or \"unknown command\" in command:\n                        result = \"called for link\"\n\n                # But still try to catch this with log output if it happens.\n                if result == \"unsupported compiler option\":\n                    scons_logger.warning(\n                        \"Encountered unsupported compiler option for ccache in '%s'.\"\n                        % command\n                    )\n\n                    all_text = []\n\n                    for line2 in getFileContentByLine(ccache_logfile):\n                        match = re_anything.match(line2)\n\n                        if match:\n                            pid2, result = match.groups()\n                            if pid == pid2:\n                                all_text.append(result)\n\n                    scons_logger.warning(\"Full scons output: %s\" % all_text)\n\n                if result != \"called for link\":\n                    data[command] = result\n\n    return data\n\n\ndef checkCachingSuccess(source_dir):\n    ccache_logfile = getSconsReportValue(source_dir=source_dir, key=\"CCACHE_LOGFILE\")\n\n    if ccache_logfile is not None:\n        stats = _getCcacheStatistics(ccache_logfile)\n\n        if not stats:\n            scons_logger.warning(\n                \"\"\"\\\nYou are not using ccache, re-compilation of identical code \\\nwill be slower than necessary. Use your OS package manager \\\nto install it.\"\"\"\n            )\n        else:\n            counts = defaultdict(int)\n\n            for _command, result in stats.items():\n                # These are not important to our users, time based decisions differentiate these.\n                if result in (\n                    \"cache hit (direct)\",\n                    \"cache hit (preprocessed)\",\n                    \"local_storage_hit\",\n                    \"primary_storage_hit\",\n                ):\n                    result = \"cache hit\"\n                elif result == \"cache_miss\":\n                    result = \"cache miss\"\n\n                # Newer ccache has these, but they duplicate:\n                if result in (\n                    \"direct_cache_hit\",\n                    \"direct_cache_miss\",\n                    \"preprocessed_cache_hit\",\n                    \"preprocessed_cache_miss\",\n                    \"primary_storage_miss\",\n                    \"called_for_link\",\n                    \"local_storage_read_hit\",\n                    \"local_storage_read_miss\",\n                    \"local_storage_write\",\n                    \"local_storage_miss\",\n                    # Usage of incbin causes this for the constants blob integration.\n                    \"unsupported code directive\",\n                    \"disabled\",\n                ):\n                    continue\n\n                counts[result] += 1\n\n            scons_logger.info(\n                \"Compiled %d C files using ccache.\" % sum(counts.values())\n            )\n            for result, count in sorted(counts.items()):\n                scons_logger.info(\n                    \"Cached C files (using ccache) with result '%s': %d\"\n                    % (result, count)\n                )\n\n    if os.name == \"nt\":\n        clcache_stats_filename = getSconsReportValue(\n            source_dir=source_dir, key=\"CLCACHE_STATS\"\n        )\n\n        if clcache_stats_filename is not None and os.path.exists(\n            clcache_stats_filename\n        ):\n            stats = ast.literal_eval(getFileContents(clcache_stats_filename))\n\n            clcache_hit = stats[\"CacheHits\"]\n            clcache_miss = stats[\"CacheMisses\"]\n\n            scons_logger.info(\n                \"Compiled %d C files using clcache with %d cache hits and %d cache misses.\"\n                % (clcache_hit + clcache_miss, clcache_hit, clcache_miss)\n            )\n\n\ndef runClCache(args, env):\n    # pylint: disable=I0021,import-error,no-name-in-module,redefined-outer-name\n    from clcache.caching import runClCache\n\n    # No Python2 compatibility\n    if str is bytes:\n        scons_logger.sysexit(\"Error, cannot use Python2 for scons when using MSVC.\")\n\n    # The first argument is \"<clcache>\" and should not be used.\n    result = runClCache(\n        os.environ[\"CLCACHE_CL\"], [arg.strip('\"') for arg in args[1:]], env\n    )\n\n    updateSconsProgressBar()\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsCompilerSettings.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This contains the tuning of the compilers towards defined goals.\n\n\"\"\"\n\nimport os\nimport re\n\nfrom nuitka.Tracing import scons_details_logger, scons_logger\nfrom nuitka.utils.Download import getCachedDownloadedMinGW64\nfrom nuitka.utils.FileOperations import (\n    getReportPath,\n    openTextFile,\n    putTextFileContents,\n)\nfrom nuitka.utils.Utils import (\n    isFedoraBasedLinux,\n    isMacOS,\n    isPosixWindows,\n    isWin32Windows,\n)\n\nfrom .SconsHacks import myDetectVersion\nfrom .SconsUtils import (\n    addBinaryBlobSection,\n    addToPATH,\n    createEnvironment,\n    decideArchMismatch,\n    getExecutablePath,\n    getLinkerArch,\n    getMsvcVersion,\n    getMsvcVersionString,\n    isClangName,\n    isGccName,\n    isZigName,\n    raiseNoCompilerFoundErrorExit,\n    setEnvironmentVariable,\n)\n\n# spell-checker: ignore LIBPATH,CPPDEFINES,CPPPATH,CXXVERSION,CCFLAGS,LINKFLAGS,CXXFLAGS\n# spell-checker: ignore -flto,-fpartial-inlining,-freorder-functions,-defsym,-fprofile\n# spell-checker: ignore -fwrapv,-Wunused,fcompare,-ftrack,-fvisibility,-municode,\n# spell-checker: ignore -feliminate,noexecstack,implib\n# spell-checker: ignore LTCG,GENPROFILE,USEPROFILE,CGTHREADS\n\n\ndef _detectWindowsSDK(env):\n    # Caching\n    if hasattr(env, \"windows_sdk_version\"):\n        return env.windows_sdk_version\n\n    # Check if there is a Windows SDK installed.\n    if \"WindowsSDKVersion\" not in env:\n        if \"WindowsSDKVersion\" in os.environ:\n            windows_sdk_version = os.environ[\"WindowsSDKVersion\"].rstrip(\"\\\\\")\n        else:\n            windows_sdk_version = None\n    else:\n        windows_sdk_version = env[\"WindowsSDKVersion\"]\n\n    if windows_sdk_version:\n        scons_details_logger.info(\"Using Windows SDK '%s'.\" % windows_sdk_version)\n\n        env.windows_sdk_version = tuple(int(x) for x in windows_sdk_version.split(\".\"))\n    else:\n        scons_logger.warning(\n            \"\"\"\\\nWindows SDK must be installed in Visual Studio for it to \\\nbe usable with Nuitka. Use the Visual Studio installer for \\\nadding it.\"\"\"\n        )\n\n        env.windows_sdk_version = None\n\n    return env.windows_sdk_version\n\n\n_windows_sdk_c11_mode_min_version = (10, 0, 19041, 0)\n\n\ndef _enableC11Settings(env):\n    \"\"\"Decide if C11 mode can be used and enable the C compile flags for it.\n\n    Args:\n        env - scons environment with compiler information\n\n    Returns:\n        bool - c11_mode flag\n    \"\"\"\n\n    if env.clangcl_mode:\n        c11_mode = True\n    elif (\n        env.msvc_mode\n        and env.windows_sdk_version >= _windows_sdk_c11_mode_min_version\n        and getMsvcVersion(env) >= (14, 3)\n    ):\n        c11_mode = True\n    elif env.clang_mode:\n        c11_mode = True\n\n        # For now, zig doesn't support C11 mode in the form needed by Nuitka\n        if isZigName(env.the_cc_name):\n            c11_mode = False\n    elif env.gcc_mode and env.gcc_version >= (5,):\n        c11_mode = True\n    else:\n        c11_mode = False\n\n    if c11_mode:\n        if env.gcc_mode:\n            env.Append(CCFLAGS=[\"-std=c11\"])\n        elif env.msvc_mode:\n            env.Append(CCFLAGS=[\"/std:c11\"])\n\n    if env.msvc_mode and c11_mode:\n        # Windows SDK shows this even in non-debug mode in C11 mode.\n        env.Append(CCFLAGS=[\"/wd5105\"])\n\n    if not c11_mode:\n        env.Append(CPPDEFINES=[\"_NUITKA_NON_C11_MODE\"])\n\n    scons_details_logger.info(\"Using C11 mode: %s\" % c11_mode)\n\n    env.c11_mode = c11_mode\n\n\ndef _enableLtoSettings(\n    env,\n    lto_mode,\n    pgo_mode,\n    job_count,\n):\n    # This is driven by branches on purpose and pylint: disable=too-many-branches,too-many-statements\n\n    orig_lto_mode = lto_mode\n\n    if lto_mode == \"no\":\n        lto_mode = False\n        reason = \"disabled\"\n    elif lto_mode == \"yes\":\n        lto_mode = True\n        reason = \"enabled\"\n    elif pgo_mode in (\"use\", \"generate\"):\n        lto_mode = True\n        reason = \"PGO implies LTO\"\n    elif env.msvc_mode and getMsvcVersion(env) >= (14,):\n        lto_mode = True\n        reason = \"known to be supported\"\n    elif env.nuitka_python:\n        lto_mode = True\n        reason = \"known to be supported (Nuitka-Python)\"\n    elif env.fedora_python:\n        lto_mode = True\n        reason = \"known to be supported (Fedora Python)\"\n    elif env.arch_python:\n        lto_mode = True\n        reason = \"known to be supported (Arch Python)\"\n    elif (\n        env.debian_python\n        and env.gcc_mode\n        and not env.clang_mode\n        and env.gcc_version >= (6,)\n    ):\n        lto_mode = True\n        reason = \"known to be supported (Debian)\"\n    elif env.gcc_mode and \"gnu-cc\" in env.the_cc_name and env.anaconda_python:\n        lto_mode = False\n        reason = \"known to be not supported (CondaCC)\"\n    elif isMacOS() and env.gcc_mode and env.clang_mode:\n        lto_mode = True\n        reason = \"known to be supported (macOS clang)\"\n    elif env.mingw_mode and env.clang_mode:\n        lto_mode = False\n        reason = \"known to not be supported (new MinGW64 Clang)\"\n    elif env.gcc_mode and env.mingw_mode and env.gcc_version >= (11, 2):\n        lto_mode = True\n        reason = \"known to be supported (new MinGW64)\"\n    else:\n        lto_mode = False\n        reason = \"not known to be supported\"\n\n    # Do not default to LTO for large compilations, unless asked for it.\n    module_count_threshold = 250\n    if (\n        orig_lto_mode == \"auto\"\n        and lto_mode\n        and env.module_count > module_count_threshold\n        and not env.nuitka_python\n    ):\n        lto_mode = False\n        reason = \"might to be too slow %s (>= %d threshold), force with --lto=yes\" % (\n            env.module_count,\n            module_count_threshold,\n        )\n\n    if lto_mode and env.gcc_mode and not env.clang_mode and env.gcc_version < (4, 6):\n        scons_logger.warning(\n            \"\"\"\\\nThe gcc compiler %s (version %s) doesn't have the sufficient \\\nversion for lto mode (>= 4.6). Disabled.\"\"\"\n            % (env[\"CXX\"], env[\"CXXVERSION\"])\n        )\n\n        lto_mode = False\n        reason = \"gcc 4.6 is doesn't have good enough LTO support\"\n\n    if env.gcc_mode and lto_mode:\n        if env.clang_mode:\n            env.Append(CCFLAGS=[\"-flto\"])\n            env.Append(LINKFLAGS=[\"-flto\"])\n        else:\n            env.Append(CCFLAGS=[\"-flto=%d\" % job_count])\n            env.Append(LINKFLAGS=[\"-flto=%d\" % job_count])\n\n            env.Append(CCFLAGS=[\"-fuse-linker-plugin\", \"-fno-fat-lto-objects\"])\n            env.Append(LINKFLAGS=[\"-fuse-linker-plugin\"])\n\n            # Need to tell the linker these things are OK.\n            env.Append(LINKFLAGS=[\"-fpartial-inlining\", \"-freorder-functions\"])\n\n            if env.mingw_mode and \"MAKE\" not in os.environ:\n                setEnvironmentVariable(env, \"MAKE\", \"mingw32-make.exe\")\n\n    # Tell compiler to use link time optimization for MSVC\n    if env.msvc_mode and lto_mode:\n        env.Append(CCFLAGS=[\"/GL\"])\n\n        if not env.clangcl_mode:\n            env.Append(LINKFLAGS=[\"/LTCG\"])\n\n            if getMsvcVersion(env) >= (14, 3):\n                env.Append(LINKFLAGS=[\"/CGTHREADS:%d\" % job_count])\n\n    if orig_lto_mode == \"auto\":\n        scons_details_logger.info(\n            \"LTO mode auto was resolved to mode: '%s' (%s).\"\n            % (\"yes\" if lto_mode else \"no\", reason)\n        )\n\n    env.lto_mode = lto_mode\n    env.orig_lto_mode = orig_lto_mode\n\n    # PGO configuration\n    _enablePgoSettings(env, pgo_mode)\n\n\n_python311_min_msvc_version = (14, 3)\n\n\ndef checkWindowsCompilerFound(\n    env, target_arch, clang_mode, msvc_version, assume_yes_for_downloads\n):\n    \"\"\"Remove compiler of wrong arch or too old gcc and replace with downloaded winlibs gcc.\"\"\"\n    # Many cases to deal with, pylint: disable=too-many-branches,too-many-statements\n\n    if os.name == \"nt\":\n        # On Windows, in case MSVC was not found and not previously forced, use the\n        # winlibs MinGW64 as a download, and use it as a fallback.\n        compiler_path = getExecutablePath(env[\"CC\"], env=env)\n\n        scons_details_logger.info(\n            \"Checking usability of binary '%s' from environment '%s'.\"\n            % (compiler_path, env[\"CC\"])\n        )\n\n        # On MSYS2, cannot use the POSIX compiler, drop that even before we check arches, since that\n        # will of course still match.\n        if env.msys2_mingw_python and compiler_path.endswith(\"/usr/bin/gcc.exe\"):\n            compiler_path = None\n\n        if compiler_path is not None:\n            the_cc_name = os.path.basename(compiler_path)\n\n            # The MSVC can only be used with an Windows SDK installed, and for 3.11 we need it\n            # to be a least a minimum version.\n            if (\n                not isGccName(the_cc_name)\n                and not isClangName(the_cc_name)\n                and (\n                    _detectWindowsSDK(env) is None\n                    or (\n                        env.python_version is not None\n                        and env.python_version >= (3, 11)\n                        and _detectWindowsSDK(env) < _windows_sdk_c11_mode_min_version\n                    )\n                )\n            ):\n                # This will trigger using it to use our own gcc in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        if compiler_path is not None:\n            the_cc_name = os.path.basename(compiler_path)\n\n            if clang_mode and not isClangName(the_cc_name):\n                # This will trigger using it to use our own clang in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        # Drop wrong arch compiler, most often found by scans. There might be wrong gcc or cl on the PATH.\n        if compiler_path is not None:\n            the_cc_name = os.path.basename(compiler_path)\n\n            decision, linker_arch, compiler_arch = decideArchMismatch(\n                target_arch=target_arch,\n                the_cc_name=the_cc_name,\n                compiler_path=compiler_path,\n            )\n\n            if decision:\n                scons_logger.info(\n                    \"\"\"\\\nMismatch between Python binary ('%s' -> '%s') and \\\nC compiler ('%s' -> '%s') arches, that compiler is ignored!\"\"\"\n                    % (\n                        os.environ[\"NUITKA_PYTHON_EXE_PATH\"],\n                        linker_arch,\n                        compiler_path,\n                        compiler_arch,\n                    )\n                )\n\n                # This will trigger using it to use our own gcc in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        if compiler_path is not None and msvc_version is not None:\n            if msvc_version == \"latest\":\n                scons_logger.info(\n                    \"MSVC version resolved to %s.\" % getMsvcVersionString(env)\n                )\n            # Requested a specific MSVC version, check if that worked.\n            elif msvc_version != getMsvcVersionString(env):\n                scons_logger.info(\n                    \"Failed to find requested MSVC version ('%s' != '%s').\"\n                    % (msvc_version, getMsvcVersionString(env))\n                )\n\n                # This will trigger error exit in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        # For Python3.11\n        if compiler_path is not None:\n            the_cc_name = os.path.basename(compiler_path)\n\n            # The MSVC can only be used with an Windows SDK installed, and for 3.11 we need it\n            # to be a least a minimum version.\n            if (\n                # This is actually OK to use like this, pylint: disable=bad-chained-comparison\n                not isGccName(the_cc_name)\n                and None is not env.python_version >= (3, 11)\n                and getMsvcVersion(env) < _python311_min_msvc_version\n            ):\n                scons_logger.info(\n                    \"\"\"\\\nFor Python version %s MSVC %s or later is required, not %s which is too old.\"\"\"\n                    % (\n                        \".\".join(str(d) for d in env.python_version),\n                        \".\".join(str(d) for d in _python311_min_msvc_version),\n                        getMsvcVersionString(env),\n                    )\n                )\n\n                # This will trigger error exit in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        if compiler_path is not None:\n            the_cc_name = os.path.basename(compiler_path)\n\n            if isGccName(the_cc_name):\n                if \"force-accept-windows-gcc\" not in env.experimental_flags:\n                    scons_logger.info(\n                        \"Non downloaded winlibs-gcc '%s' is being ignored, Nuitka is very dependent on the precise one.\"\n                        % (compiler_path,)\n                    )\n\n                # This also will trigger using it to use our own gcc in branch below.\n                compiler_path = None\n                env[\"CC\"] = None\n\n        if compiler_path is None and msvc_version is None:\n            scons_details_logger.info(\n                \"No usable C compiler, attempt fallback to winlibs gcc or clang.\"\n            )\n\n            # This will download \"gcc.exe\" (and \"clang.exe\") when all others have been\n            # rejected and MSVC is not enforced.\n            compiler_path = getCachedDownloadedMinGW64(\n                target_arch=target_arch,\n                assume_yes_for_downloads=assume_yes_for_downloads,\n            )\n\n            if compiler_path is not None:\n                addToPATH(env, os.path.dirname(compiler_path), prefix=True)\n\n                env = createEnvironment(\n                    mingw_mode=True,\n                    msvc_version=None,\n                    target_arch=target_arch,\n                    experimental=env.experimental_flags,\n                    no_deployment=env.no_deployment_flags,\n                )\n\n                if clang_mode:\n                    env[\"CC\"] = os.path.join(\n                        os.path.dirname(compiler_path), \"clang.exe\"\n                    )\n\n        if env[\"CC\"] is None:\n            raiseNoCompilerFoundErrorExit()\n\n    return env\n\n\ndef decideConstantsBlobResourceMode(env, module_mode):\n    if \"NUITKA_RESOURCE_MODE\" in os.environ:\n        resource_mode = os.environ[\"NUITKA_RESOURCE_MODE\"]\n        reason = \"user provided\"\n    elif isWin32Windows():\n        resource_mode = \"win_resource\"\n        reason = \"default for Windows\"\n    elif isPosixWindows():\n        resource_mode = \"linker\"\n        reason = \"default MSYS2 Posix\"\n    elif isMacOS():\n        resource_mode = \"mac_section\"\n        reason = \"default for macOS\"\n    elif env.lto_mode and env.gcc_mode and not env.clang_mode:\n        if module_mode:\n            resource_mode = \"code\"\n        else:\n            resource_mode = \"linker\"\n\n        reason = \"default for lto gcc with --lto bugs for incbin\"\n    else:\n        # All is done already, this is for most platforms.\n        resource_mode = \"incbin\"\n        reason = \"default\"\n\n    return resource_mode, reason\n\n\ndef addConstantBlobFile(env, blob_filename, resource_desc, target_arch):\n    resource_mode, reason = resource_desc\n\n    assert blob_filename.endswith(\".bin\"), blob_filename\n\n    scons_details_logger.info(\n        \"Using resource mode: '%s' (%s).\" % (resource_mode, reason)\n    )\n\n    if resource_mode == \"win_resource\":\n        # On Windows constants can be accessed as a resource by Nuitka at run time afterwards.\n        env.Append(CPPDEFINES=[\"_NUITKA_CONSTANTS_FROM_RESOURCE\"])\n    elif resource_mode == \"mac_section\":\n        env.Append(CPPDEFINES=[\"_NUITKA_CONSTANTS_FROM_MACOS_SECTION\"])\n\n        addBinaryBlobSection(\n            env=env,\n            blob_filename=blob_filename,\n            section_name=os.path.basename(blob_filename)[:-4].lstrip(\"_\"),\n        )\n    elif resource_mode == \"incbin\":\n        env.Append(CPPDEFINES=[\"_NUITKA_CONSTANTS_FROM_INCBIN\"])\n\n        constants_generated_filename = os.path.join(\n            env.source_dir, \"__constants_data.c\"\n        )\n\n        putTextFileContents(\n            constants_generated_filename,\n            contents=r\"\"\"\n#define INCBIN_PREFIX\n#define INCBIN_STYLE INCBIN_STYLE_SNAKE\n#define INCBIN_LOCAL\n#ifdef _NUITKA_EXPERIMENTAL_WRITEABLE_CONSTANTS\n#define INCBIN_OUTPUT_SECTION \".data\"\n#endif\n\n#include \"nuitka/incbin.h\"\n\nINCBIN(constant_bin, \"%(blob_filename)s\");\n\nunsigned char const *getConstantsBlobData(void) {\n    return constant_bin_data;\n}\n\"\"\"\n            % {\"blob_filename\": blob_filename},\n        )\n\n    elif resource_mode == \"linker\":\n        # Indicate \"linker\" resource mode.\n        env.Append(CPPDEFINES=[\"_NUITKA_CONSTANTS_FROM_LINKER\"])\n\n        # For MinGW the symbol name to be used is more low level.\n        constant_bin_link_name = \"constant_bin_data\"\n        if env.mingw_mode:\n            constant_bin_link_name = \"_\" + constant_bin_link_name\n\n        env.Append(\n            LINKFLAGS=[\n                \"-Wl,-b\",\n                \"-Wl,binary\",\n                \"-Wl,%s\" % blob_filename,\n                \"-Wl,-b\",\n                \"-Wl,%s\"\n                % getLinkerArch(\n                    target_arch=target_arch,\n                    mingw_mode=env.mingw_mode or isPosixWindows(),\n                ),\n                \"-Wl,-defsym\",\n                \"-Wl,%s=_binary_%s___constants_bin_start\"\n                % (\n                    constant_bin_link_name,\n                    \"\".join(re.sub(\"[^a-zA-Z0-9_]\", \"_\", c) for c in env.source_dir),\n                ),\n            ]\n        )\n    elif resource_mode == \"code\":\n        # Indicate \"code\" resource mode.\n        env.Append(CPPDEFINES=[\"_NUITKA_CONSTANTS_FROM_CODE\"])\n\n        constants_generated_filename = os.path.join(\n            env.source_dir, \"__constants_data.c\"\n        )\n\n        def writeConstantsDataSource():\n            with openTextFile(constants_generated_filename, \"w\") as output:\n                if not env.c11_mode:\n                    output.write('extern \"C\" {')\n\n                output.write(\n                    \"\"\"\n// Constant data for the program.\n#if !defined(_NUITKA_EXPERIMENTAL_WRITEABLE_CONSTANTS)\nconst\n#endif\nunsigned char constant_bin_data[] =\\n{\\n\n\"\"\"\n                )\n\n                with open(blob_filename, \"rb\") as f:\n                    content = f.read()\n                for count, stream_byte in enumerate(content):\n                    if count % 16 == 0:\n                        if count > 0:\n                            output.write(\"\\n\")\n\n                        output.write(\"   \")\n\n                    if str is bytes:\n                        stream_byte = ord(stream_byte)\n\n                    output.write(\" 0x%02x,\" % stream_byte)\n\n                output.write(\"\\n};\\n\")\n\n                if not env.c11_mode:\n                    output.write(\"}\")\n\n        writeConstantsDataSource()\n    else:\n        scons_logger.sysexit(\n            \"Error, illegal resource mode '%s' specified\" % resource_mode\n        )\n\n\ndef enableWindowsStackSize(env, target_arch):\n    # Stack size 4MB or 8MB, we might need more than the default 1MB.\n    if target_arch == \"x86_64\":\n        stack_size = 1024 * 1204 * 8\n    else:\n        stack_size = 1024 * 1204 * 4\n\n    if env.msvc_mode:\n        env.Append(LINKFLAGS=[\"/STACK:%d\" % stack_size])\n\n    if env.mingw_mode:\n        env.Append(LINKFLAGS=[\"-Wl,--stack,%d\" % stack_size])\n\n\ndef setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):\n    # This is driven by many branches on purpose and has a lot of things\n    # to deal with for LTO checks and flags, pylint: disable=too-many-branches,too-many-statements\n\n    # Enable LTO for compiler.\n    _enableLtoSettings(\n        env=env,\n        lto_mode=lto_mode,\n        pgo_mode=pgo_mode,\n        job_count=job_count,\n    )\n\n    _enableC11Settings(env)\n\n    if env.gcc_mode:\n        # Support for gcc and clang, restricting visibility as much as possible.\n        env.Append(CCFLAGS=[\"-fvisibility=hidden\"])\n\n        if not env.c11_mode:\n            env.Append(CXXFLAGS=[\"-fvisibility-inlines-hidden\"])\n\n        if isWin32Windows() and hasattr(env, \"source_dir\"):\n            # On Windows, exporting to DLL need to be controlled.\n            env.Append(LINKFLAGS=[\"-Wl,--exclude-all-symbols\"])\n\n            # Make sure we handle import library on our own and put it into the\n            # build directory.\n            env.Append(\n                LINKFLAGS=[\n                    \"-Wl,--out-implib,%s\" % os.path.join(env.source_dir, \"import.lib\")\n                ]\n            )\n\n        # Make it clear how to handle integer overflows, namely by wrapping around\n        # to negative values.\n        env.Append(CCFLAGS=[\"-fwrapv\"])\n\n        if not env.low_memory:\n            # Avoid IO for compilation as much as possible, this should make the\n            # compilation more memory hungry, but also faster.\n            env.Append(CCFLAGS=\"-pipe\")\n\n        # gcc compiler cf_protection option\n        if env.cf_protection != \"auto\":\n            env.Append(CCFLAGS=[\"-fcf-protection=%s\" % env.cf_protection])\n    # Support for clang.\n    if \"clang\" in env.the_cc_name:\n        env.Append(CCFLAGS=[\"-w\"])\n        env.Append(CPPDEFINES=[\"_XOPEN_SOURCE\"])\n\n        # Don't export anything by default, this should create smaller executables.\n        env.Append(CCFLAGS=[\"-fvisibility=hidden\", \"-fvisibility-inlines-hidden\"])\n\n        if env.debug_mode:\n            env.Append(CCFLAGS=[\"-Wunused-but-set-variable\"])\n\n    # Support for macOS standalone to run on older OS versions.\n    if isMacOS():\n        setEnvironmentVariable(env, \"MACOSX_DEPLOYMENT_TARGET\", env.macos_min_version)\n\n        target_flag = \"--target=%s-macos%s\" % (\n            env.macos_target_arch,\n            env.macos_min_version,\n        )\n\n        env.Append(CCFLAGS=[target_flag])\n        env.Append(LINKFLAGS=[target_flag])\n\n    # The 32 bits MinGW does not default for API level properly, so help it.\n    if env.mingw_mode:\n        # Windows XP\n        env.Append(CPPDEFINES=[\"_WIN32_WINNT=0x0501\"])\n\n    # Unicode entry points for programs.\n    if env.mingw_mode:\n        env.Append(LINKFLAGS=[\"-municode\"])\n\n    # Detect the gcc version\n    if env.gcc_version is None and env.gcc_mode and not env.clang_mode:\n        env.gcc_version = myDetectVersion(env, env.the_compiler)\n\n    # Older g++ complains about aliasing with Py_True and Py_False, but we don't\n    # care.\n    if env.gcc_mode and not env.clang_mode and env.gcc_version < (4, 5):\n        env.Append(CCFLAGS=[\"-fno-strict-aliasing\"])\n\n    # For gcc 4.6 or higher, there are some new interesting functions.\n    if env.gcc_mode and not env.clang_mode and env.gcc_version >= (4, 6):\n        env.Append(CCFLAGS=[\"-fpartial-inlining\"])\n\n        if env.debug_mode:\n            env.Append(CCFLAGS=[\"-Wunused-but-set-variable\"])\n\n    # Save some memory for gcc by not tracing macro code locations at all.\n    if (\n        not env.debug_mode\n        and env.gcc_mode\n        and not env.clang_mode\n        and env.gcc_version >= (5,)\n    ):\n        env.Append(CCFLAGS=[\"-ftrack-macro-expansion=0\"])\n\n    # We don't care about deprecations.\n    if env.gcc_mode and not env.clang_mode:\n        env.Append(CCFLAGS=[\"-Wno-deprecated-declarations\"])\n\n    # The var-tracking does not scale, disable it. Should we really need it, we\n    # can enable it. TODO: Does this cause a performance loss?\n    if env.gcc_mode and not env.clang_mode:\n        env.Append(CCFLAGS=[\"-fno-var-tracking\"])\n\n    # For large files, these can issue warnings about disabling\n    # itself, while we do not need it really.\n    if env.gcc_mode and not env.clang_mode and env.gcc_version >= (6,):\n        env.Append(CCFLAGS=[\"-Wno-misleading-indentation\"])\n\n    # Disable output of notes, e.g. on struct alignment layout changes for\n    # some arches, we don't care.\n    if env.gcc_mode and not env.clang_mode:\n        env.Append(CCFLAGS=[\"-fcompare-debug-second\"])\n\n    # Prevent using LTO when told not to use it, causes errors with some\n    # static link libraries.\n    if (\n        env.gcc_mode\n        and not env.clang_mode\n        and env.static_libpython\n        and not env.lto_mode\n    ):\n        env.Append(CCFLAGS=[\"-fno-lto\"])\n        env.Append(LINKFLAGS=[\"-fno-lto\"])\n\n    # Set optimization level for gcc and clang in LTO mode\n    if env.gcc_mode and env.lto_mode:\n        if env.debug_mode:\n            env.Append(LINKFLAGS=[\"-Og\"])\n        else:\n            # For LTO with static libpython combined, there are crashes with Python core\n            # being inlined, so we must refrain from that. On Windows there is no such\n            # thing, and Nuitka-Python is not affected.\n            env.Append(\n                LINKFLAGS=[\n                    (\n                        \"-O3\"\n                        if env.nuitka_python\n                        or os.name == \"nt\"\n                        or not env.static_libpython\n                        else \"-O2\"\n                    )\n                ]\n            )\n\n    # When debugging, optimize less than when optimizing, when not remove\n    # assertions.\n    if env.debug_mode:\n        if env.clang_mode or (env.gcc_mode and env.gcc_version >= (4, 8)):\n            env.Append(CCFLAGS=[\"-Og\"])\n        elif env.gcc_mode:\n            env.Append(CCFLAGS=[\"-O1\"])\n        elif env.msvc_mode:\n            env.Append(CCFLAGS=[\"-O2\"])\n    else:\n        if env.gcc_mode:\n            env.Append(\n                CCFLAGS=[\n                    (\n                        \"-O3\"\n                        if env.nuitka_python\n                        or os.name == \"nt\"\n                        or not env.static_libpython\n                        else \"-O2\"\n                    )\n                ]\n            )\n        elif env.msvc_mode:\n            env.Append(\n                CCFLAGS=[\n                    \"/Ox\",  # Enable most speed optimization\n                    \"/GF\",  # Eliminate duplicate strings.\n                    \"/Gy\",  # Function level object storage, to allow removing unused ones\n                ]\n            )\n\n        env.Append(CPPDEFINES=[\"__NUITKA_NO_ASSERT__\"])\n\n    _enableDebugSystemSettings(env, job_count=job_count)\n\n    if env.gcc_mode and not env.noelf_mode:\n        env.Append(LINKFLAGS=[\"-z\", \"noexecstack\"])\n\n    # For MinGW64 we need to tell the subsystem to target as well as to\n    # automatically import everything used.\n    if env.mingw_mode:\n        if not env.clang_mode:\n            env.Append(LINKFLAGS=[\"-Wl,--enable-auto-import\"])\n\n        if env.disable_console:\n            env.Append(LINKFLAGS=[\"-Wl,--subsystem,windows\"])\n\n    if env.mingw_mode or env.msvc_mode:\n        if env.disable_console:\n            env.Append(CPPDEFINES=[\"_NUITKA_WINMAIN_ENTRY_POINT\"])\n\n    # Avoid dependency on MinGW libraries, spell-checker: ignore libgcc\n    if env.mingw_mode and not env.clang_mode:\n        env.Append(LINKFLAGS=[\"-static-libgcc\"])\n\n    # MinGW64 for 64 bits needs this due to CPython bugs.\n    if env.mingw_mode and env.target_arch == \"x86_64\" and env.python_version < (3, 12):\n        env.Append(CPPDEFINES=[\"MS_WIN64\"])\n\n    # For shell API usage to lookup app folders we need this. Note that on Windows ARM\n    # we didn't manage to have a \"shell32.lib\" that is not considered corrupt, so we\n    # have to do this.\n    if env.msvc_mode and env.target_arch != \"arm64\":\n        env.Append(LIBS=[\"Shell32\"])\n\n    # Since Fedora 36, the system Python will not link otherwise.\n    if isFedoraBasedLinux():\n        env.Append(CCFLAGS=[\"-fPIC\"])\n\n    # We use zlib for crc32 functionality\n    zlib_inline_copy_dir = os.path.join(env.nuitka_src, \"inline_copy\", \"zlib\")\n    if os.path.exists(os.path.join(zlib_inline_copy_dir, \"crc32.c\")):\n        env.Append(\n            CPPPATH=[\n                zlib_inline_copy_dir,\n            ],\n        )\n    else:\n        # TODO: Should only happen for official Debian packages, and there we\n        # can use the zlib static linking maybe, but for onefile it's not easy\n        # to get it, so just use slow checksum for now.\n        if onefile_compile:\n            env.Append(CPPDEFINES=[\"_NUITKA_USE_OWN_CRC32\"])\n        else:\n            env.Append(CPPDEFINES=[\"_NUITKA_USE_SYSTEM_CRC32\"])\n            env.Append(LIBS=\"z\")\n\n\ndef _enablePgoSettings(env, pgo_mode):\n    if pgo_mode == \"no\":\n        env.progressbar_name = \"Backend\"\n    elif pgo_mode == \"python\":\n        env.progressbar_name = \"Python Profile\"\n        env.Append(CPPDEFINES=[\"_NUITKA_PGO_PYTHON\"])\n    elif pgo_mode == \"generate\":\n        env.progressbar_name = \"Profile\"\n        env.Append(CPPDEFINES=[\"_NUITKA_PGO_GENERATE\"])\n\n        if env.gcc_mode:\n            env.Append(CCFLAGS=[\"-fprofile-generate\"])\n            env.Append(LINKFLAGS=[\"-fprofile-generate\"])\n        elif env.msvc_mode:\n            env.Append(CCFLAGS=[\"/GL\"])\n            env.Append(LINKFLAGS=[\"/GENPROFILE:EXACT\"])\n            if not env.clangcl_mode:\n                env.Append(LINKFLAGS=[\"/LTCG\"])\n\n        else:\n            scons_logger.sysexit(\n                \"Error, PGO not supported for '%s' compiler.\" % env.the_cc_name\n            )\n    elif pgo_mode == \"use\":\n        env.progressbar_name = \"Backend\"\n\n        env.Append(CPPDEFINES=[\"_NUITKA_PGO_USE\"])\n\n        if env.gcc_mode:\n            env.Append(CCFLAGS=[\"-fprofile-use\"])\n            env.Append(LINKFLAGS=[\"-fprofile-use\"])\n        elif env.msvc_mode:\n            env.Append(CCFLAGS=[\"/GL\"])\n            env.Append(\n                LINKFLAGS=[\n                    \"/USEPROFILE\",\n                ]\n            )\n        else:\n            scons_logger.sysexit(\n                \"Error, PGO not supported for '%s' compiler.\" % env.the_cc_name\n            )\n    else:\n        assert False, env.pgo_mode\n\n    env.pgo_mode = pgo_mode\n\n\ndef _enableDebugSystemSettings(env, job_count):\n    if env.unstripped_mode:\n        # Use debug format, so we get good tracebacks from it.\n        if env.gcc_mode:\n            env.Append(LINKFLAGS=[\"-g\"])\n            env.Append(CCFLAGS=[\"-g\"])\n\n            if not env.clang_mode:\n                env.Append(CCFLAGS=[\"-feliminate-unused-debug-types\"])\n        elif env.msvc_mode:\n            env.Append(CCFLAGS=[\"/Z7\"])\n\n            # Higher MSVC versions need this for parallel compilation\n            if job_count > 1 and getMsvcVersion(env) >= (11,):\n                env.Append(CCFLAGS=[\"/FS\"])\n\n            env.Append(LINKFLAGS=[\"/DEBUG\"])\n    else:\n        if env.gcc_mode:\n            if isMacOS():\n                env.Append(LINKFLAGS=[\"-Wno-deprecated-declarations\"])\n            elif not env.clang_mode:\n                env.Append(LINKFLAGS=[\"-s\"])\n\n\ndef switchFromGccToGpp(env):\n    if not env.gcc_mode or env.clang_mode:\n        env.gcc_version = None\n        return\n\n    the_compiler = getExecutablePath(env.the_compiler, env)\n\n    if the_compiler is None:\n        return\n\n    env.gcc_version = myDetectVersion(env, the_compiler)\n\n    if env.gcc_version is None:\n        scons_logger.sysexit(\n            \"\"\"\\\nError, failed to detect gcc version of backend compiler '%s'.\n\"\"\"\n            % env.the_compiler\n        )\n\n    if \"++\" in env.the_cc_name:\n        scons_logger.sysexit(\n            \"\"\"\\\nError, compiler %s is apparently a C++ compiler, specify a C compiler instead.\n\"\"\"\n            % env.the_cc_name\n        )\n\n    # Enforce the minimum version, selecting a potentially existing g++-4.5\n    # binary if it's not high enough. This is esp. useful under Debian which\n    # allows all compiler to exist next to each other and where g++ might not be\n    # good enough, but g++-4.5 would be.\n    if env.gcc_version < (4, 4):\n        scons_logger.sysexit(\n            \"\"\"\\\nThe gcc compiler %s (version %s) doesn't have the sufficient \\\nversion (>= 4.4).\"\"\"\n            % (env.the_compiler, env.gcc_version)\n        )\n\n    # CondaCC or newer.\n    if env.mingw_mode and env.gcc_version < (5, 3):\n        scons_logger.sysexit(\n            \"\"\"\\\nThe MinGW64 compiler %s (version %s) doesn't have the sufficient \\\nversion (>= 5.3).\"\"\"\n            % (env.the_compiler, env.gcc_version)\n        )\n\n    if env.gcc_version < (5,):\n        if env.python_version < (3, 11):\n            scons_logger.info(\n                \"The provided gcc is too old, switching to its g++ instead.\",\n                mnemonic=\"too-old-gcc\",\n            )\n\n            # Switch to g++ from gcc then if possible, when C11 mode is false.\n            the_gpp_compiler = os.path.join(\n                os.path.dirname(env.the_compiler),\n                os.path.basename(env.the_compiler).replace(\"gcc\", \"g++\"),\n            )\n\n            if getExecutablePath(the_gpp_compiler, env=env):\n                env.the_compiler = the_gpp_compiler\n                env.the_cc_name = env.the_cc_name.replace(\"gcc\", \"g++\")\n            else:\n                scons_logger.sysexit(\n                    \"Error, your gcc is too old for C11 support, and no related g++ to workaround that is found.\"\n                )\n        else:\n            scons_logger.sysexit(\n                \"Error, your gcc is too old for C11 support, install a newer one.\",\n                mnemonic=\"too-old-gcc\",\n            )\n\n\ndef reportCCompiler(env, context, output_func):\n    cc_output = env.the_cc_name\n\n    if env.the_cc_name == \"cl\":\n        cc_output = \"%s %s\" % (env.the_cc_name, getMsvcVersionString(env))\n    elif isGccName(env.the_cc_name):\n        cc_output = \"%s %s\" % (\n            env.the_cc_name,\n            \".\".join(str(d) for d in env.gcc_version),\n        )\n    elif isClangName(env.the_cc_name):\n        cc_output = \"%s %s\" % (\n            env.the_cc_name,\n            \".\".join(str(d) for d in myDetectVersion(env, env.the_cc_name)),\n        )\n    else:\n        cc_output = env.the_cc_name\n\n    output_func(\n        \"%s C compiler: %s (%s).\"\n        % (context, getReportPath(env.the_compiler), cc_output)\n    )\n\n\ndef importEnvironmentVariableSettings(env):\n    \"\"\"Import typical environment variables that compilation should use.\"\"\"\n    # spell-checker: ignore cppflags,cflags,ccflags,cxxflags,ldflags\n\n    # Outside compiler settings are respected.\n    if \"CPPFLAGS\" in os.environ:\n        scons_logger.info(\n            \"Scons: Inherited CPPFLAGS='%s' variable.\" % os.environ[\"CPPFLAGS\"]\n        )\n        env.Append(CPPFLAGS=os.environ[\"CPPFLAGS\"].split())\n    if \"CFLAGS\" in os.environ:\n        scons_logger.info(\"Inherited CFLAGS='%s' variable.\" % os.environ[\"CFLAGS\"])\n        env.Append(CCFLAGS=os.environ[\"CFLAGS\"].split())\n    if \"CCFLAGS\" in os.environ:\n        scons_logger.info(\"Inherited CCFLAGS='%s' variable.\" % os.environ[\"CCFLAGS\"])\n        env.Append(CCFLAGS=os.environ[\"CCFLAGS\"].split())\n    if \"CXXFLAGS\" in os.environ:\n        scons_logger.info(\n            \"Scons: Inherited CXXFLAGS='%s' variable.\" % os.environ[\"CXXFLAGS\"]\n        )\n        env.Append(CXXFLAGS=os.environ[\"CXXFLAGS\"].split())\n\n    # Outside linker flags are respected.\n    if \"LDFLAGS\" in os.environ:\n        scons_logger.info(\n            \"Scons: Inherited LDFLAGS='%s' variable.\" % os.environ[\"LDFLAGS\"]\n        )\n        env.Append(LINKFLAGS=os.environ[\"LDFLAGS\"].split())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsHacks.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Hacks for scons that we apply.\n\nWe block some tools from the standard scan, there is e.g. no need to ask\nwhat fortran version we have installed to compile with Nuitka.\n\nAlso we hack the gcc version detection to fix some bugs in it, and to avoid\nscanning for g++ when we have a gcc installer, but only if that is not too\nversion.\n\n\"\"\"\n\nimport os\nimport re\n\nimport SCons.Tool.gcc  # pylint: disable=I0021,import-error\nfrom SCons.Script import Environment  # pylint: disable=I0021,import-error\n\nfrom nuitka.Tracing import scons_details_logger\nfrom nuitka.utils.Execution import executeProcess\nfrom nuitka.utils.FileOperations import openTextFile\nfrom nuitka.utils.Utils import isLinux, isMacOS\n\nfrom .SconsUtils import decodeData, getExecutablePath, isGccName\n\n# Cache for detected versions.\nv_cache = {}\n\n# Prevent these programs from being found, avoiding the burden of tool init.\n_blocked_tools = (\n    # TODO: Where the fallback is needed, g++ needs to scanned or else it\n    # cannot be used.\n    #    \"g++\",\n    \"c++\",\n    \"f95\",\n    \"f90\",\n    \"f77\",\n    \"gfortran\",\n    \"ifort\",\n    \"javah\",\n    \"tar\",\n    \"dmd\",\n    \"gdc\",\n    \"flex\",\n    \"bison\",\n    \"ranlib\",\n    \"ar\",\n    \"ldc2\",\n    \"pdflatex\",\n    \"pdftex\",\n    \"latex\",\n    \"tex\",\n    \"dvipdf\",\n    \"dvips\",\n    \"gs\",\n    \"swig\",\n    \"ifl\",\n    \"rpcgen\",\n    \"rpmbuild\",\n    \"bk\",\n    \"p4\",\n    \"m4\",\n    \"ml\",\n    \"icc\",\n    \"sccs\",\n    \"rcs\",\n    \"cvs\",\n    \"as\",\n    \"gas\",\n    \"nasm\",\n)\n\n\ndef _myDetectVersion(cc):\n    if isGccName(cc) or \"clang\" in cc:\n        command = (\n            cc,\n            \"-dumpversion\",\n            \"-dumpfullversion\",\n        )\n    else:\n        command = (\n            cc,\n            \"--version\",\n        )\n\n    stdout, stderr, exit_code = executeProcess(command)\n\n    if exit_code != 0:\n        scons_details_logger.info(\n            \"Error, error exit from '%s' (%d) gave %r.\" % (command, exit_code, stderr)\n        )\n        return None\n\n    line = stdout.splitlines()[0]\n\n    if str is not bytes and type(line) is bytes:\n        line = decodeData(line)\n\n    line = line.strip()\n\n    match = re.findall(r\"[0-9]+(?:\\.[0-9]+)+\", line)\n    if match:\n        version = match[0]\n    else:\n        # gcc 8 or higher\n        version = line.strip()\n\n    version = tuple(int(part) for part in version.split(\".\"))\n\n    return version\n\n\ndef myDetectVersion(env, cc):\n    \"\"\"Return the version of the GNU compiler, or None if it is not a GNU compiler.\"\"\"\n    cc = env.subst(cc)\n    if not cc:\n        return None\n    if \"++\" in os.path.basename(cc):\n        return None\n\n    # Make path absolute, to improve cache hit rate.\n    cc = getExecutablePath(cc, env)\n    if cc is None:\n        return None\n\n    if cc not in v_cache:\n        v_cache[cc] = _myDetectVersion(cc)\n\n        scons_details_logger.info(\"CC '%s' version check gives %r\" % (cc, v_cache[cc]))\n\n    return v_cache[cc]\n\n\ndef myDetect(self, progs):\n    # Don't consider Fortran, tar, D, c++, we don't need it. We do manual\n    # fallback\n    for blocked_tool in _blocked_tools:\n        if blocked_tool in progs:\n            return None\n\n    # Note: Actually, with our inline copy, this is maybe not supposed to\n    # happen at all\n\n    return orig_detect(self, progs)\n\n\n# The original value will be used in our form.\norig_detect = Environment.Detect\n\n\ndef getEnhancedToolDetect():\n    SCons.Tool.gcc.detect_version = myDetectVersion\n\n    # Allow CondaCC to be detected if it is in PATH.\n    if isLinux():\n        SCons.Tool.gcc.compilers.insert(0, \"x86_64-conda-linux-gnu-gcc\")\n\n    if isMacOS() and \"CONDA_TOOLCHAIN_BUILD\" in os.environ:\n        SCons.Tool.gcc.compilers.insert(\n            0, \"%s-clang\" % os.environ[\"CONDA_TOOLCHAIN_BUILD\"]\n        )\n\n    return myDetect\n\n\ndef makeGccUseLinkerFile(source_files, module_mode, env):\n    tmp_linker_filename = os.path.join(env.source_dir, \"@link_input.txt\")\n\n    # Note: For Windows, it's done in mingw.py because of its use of\n    # a class rather than a string here, that is not working for the\n    # monkey patching.\n    if type(env[\"SHLINKCOM\"]) is str:\n        env[\"SHLINKCOM\"] = env[\"SHLINKCOM\"].replace(\n            \"$SOURCES\", \"@%s\" % env.get(\"ESCAPE\", lambda x: x)(tmp_linker_filename)\n        )\n\n    env[\"LINKCOM\"] = env[\"LINKCOM\"].replace(\n        \"$SOURCES\", \"@%s\" % env.get(\"ESCAPE\", lambda x: x)(tmp_linker_filename)\n    )\n\n    with openTextFile(tmp_linker_filename, \"w\") as tmpfile:\n        for filename in source_files:\n            filename = \".\".join(filename.split(\".\")[:-1]) + (\n                \".os\" if module_mode and os.name != \"nt\" else \".o\"\n            )\n\n            if os.name == \"nt\":\n                filename = filename.replace(os.path.sep, \"/\")\n\n            tmpfile.write('\"%s\"\\n' % filename)\n\n        tmpfile.write(env.subst(\"$SOURCES\"))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsInterface.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Scons interface.\n\nInteraction with scons. Find the binary, and run it with a set of given\noptions.\n\n\"\"\"\n\nimport contextlib\nimport copy\nimport os\nimport subprocess\nimport sys\n\nfrom nuitka import Options, Tracing\nfrom nuitka.__past__ import unicode\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Options import getOnefileChildGraceTime, isOnefileMode\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonFlavors import (\n    isAnacondaPython,\n    isMSYS2MingwPython,\n    isNuitkaPython,\n    isSelfCompiledPythonUninstalled,\n)\nfrom nuitka.PythonVersions import (\n    getSystemPrefixPath,\n    python_version,\n    python_version_str,\n)\nfrom nuitka.utils.AppDirs import getCacheDirEnvironmentVariableName\nfrom nuitka.utils.Download import getDownloadCacheDir, getDownloadCacheName\nfrom nuitka.utils.Execution import (\n    getExecutablePath,\n    withEnvironmentVarsOverridden,\n)\nfrom nuitka.utils.FileOperations import (\n    changeFilenameExtension,\n    deleteFile,\n    getDirectoryRealPath,\n    getExternalUsePath,\n    getWindowsShortPathName,\n    hasFilenameExtension,\n    listDir,\n    makePath,\n    putTextFileContents,\n    withDirectoryChange,\n)\nfrom nuitka.utils.InstalledPythons import findInstalledPython\nfrom nuitka.utils.SharedLibraries import detectBinaryMinMacOS\nfrom nuitka.utils.Utils import (\n    getArchitecture,\n    isMacOS,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n)\n\nfrom .SconsCaching import checkCachingSuccess\nfrom .SconsUtils import flushSconsReports\n\n\ndef getSconsDataPath():\n    \"\"\"Return path to where data for scons lives, e.g. static C source files.\"\"\"\n\n    return os.path.dirname(__file__)\n\n\ndef _getSconsInlinePath():\n    \"\"\"Return path to inline copy of scons.\"\"\"\n\n    return os.path.join(getSconsDataPath(), \"inline_copy\")\n\n\ndef _getSconsBinaryCall():\n    \"\"\"Return a way to execute Scons.\n\n    Using potentially in-line copy if no system Scons is available\n    or if we are on Windows, there it is mandatory.\n    \"\"\"\n\n    inline_path = os.path.join(_getSconsInlinePath(), \"bin\", \"scons.py\")\n\n    if os.path.exists(inline_path):\n        return [\n            _getPythonForSconsExePath(),\n            \"-W\",\n            \"ignore\",  # Disable Python warnings in case of debug Python.\n            getExternalUsePath(inline_path),\n        ]\n    else:\n        scons_path = getExecutablePath(\"scons\")\n\n        if scons_path is not None:\n            return [scons_path]\n        else:\n            Tracing.scons_logger.sysexit(\n                \"Error, the inline copy of scons is not present, nor a scons binary in the PATH.\"\n            )\n\n\ndef _getPythonForSconsExePath():\n    \"\"\"Find a way to call any Python that works for Scons.\n\n    Scons needs it as it doesn't support all Python versions.\n    \"\"\"\n    python_exe = Options.getPythonPathForScons()\n\n    if python_exe is not None:\n        return python_exe\n\n    scons_supported_pythons = (\"3.5\", \"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\")\n    if not isWin32Windows():\n        scons_supported_pythons += (\"2.7\", \"2.6\")\n\n    # Our inline copy needs no other module, just the right version of Python is needed.\n    python_for_scons = findInstalledPython(\n        python_versions=scons_supported_pythons, module_name=None, module_version=None\n    )\n\n    if python_for_scons is None:\n        if isWin32Windows():\n            scons_python_requirement = \"Python 3.5 or higher\"\n        else:\n            scons_python_requirement = \"Python 2.6, 2.7 or Python >= 3.5\"\n\n        Tracing.scons_logger.sysexit(\n            \"\"\"\\\nError, while Nuitka works with older Python, Scons does not, and therefore\nNuitka needs to find a %s executable, so please install\nit.\n\nYou may provide it using option \"--python-for-scons=path_to_python.exe\"\nin case it is not visible in registry, e.g. due to using uninstalled\nAnaconda Python.\n\"\"\"\n            % scons_python_requirement\n        )\n\n    return python_for_scons.getPythonExe()\n\n\n@contextlib.contextmanager\ndef _setupSconsEnvironment2():\n    os.environ[\"NUITKA_PYTHON_EXE_PATH\"] = sys.executable\n\n    # Remove environment variables that can only harm if we have to switch\n    # major Python versions, these cannot help Python2 to execute scons, this\n    # is a bit of noise, but helpful.\n    old_pythonpath = None\n    old_pythonhome = None\n\n    if python_version >= 0x300:\n        if \"PYTHONPATH\" in os.environ:\n            old_pythonpath = os.environ[\"PYTHONPATH\"]\n            del os.environ[\"PYTHONPATH\"]\n\n        if \"PYTHONHOME\" in os.environ:\n            old_pythonhome = os.environ[\"PYTHONHOME\"]\n            del os.environ[\"PYTHONHOME\"]\n\n    import nuitka\n\n    os.environ[\"NUITKA_PACKAGE_DIR\"] = os.path.abspath(nuitka.__path__[0])\n\n    # When downloading in Scons, use the external path.\n    if isWin32Windows():\n        download_cache_dir = getDownloadCacheDir()\n        makePath(download_cache_dir)\n        os.environ[getCacheDirEnvironmentVariableName(getDownloadCacheName())] = (\n            getExternalUsePath(download_cache_dir)\n        )\n\n    yield\n\n    if old_pythonpath is not None:\n        os.environ[\"PYTHONPATH\"] = old_pythonpath\n\n    if old_pythonhome is not None:\n        os.environ[\"PYTHONHOME\"] = old_pythonhome\n\n    del os.environ[\"NUITKA_PYTHON_EXE_PATH\"]\n\n    del os.environ[\"NUITKA_PACKAGE_DIR\"]\n\n\n@contextlib.contextmanager\ndef _setupSconsEnvironment():\n    \"\"\"Setup the scons execution environment.\n\n    For the target Python we provide \"NUITKA_PYTHON_DLL_PATH\" to see where the\n    Python DLL lives, in case it needs to be copied, and then also the\n    \"NUITKA_PYTHON_EXE_PATH\" to find the Python binary itself.\n\n    We also need to preserve \"PYTHONPATH\" and \"PYTHONHOME\", but remove it\n    potentially as well, so not to confuse the other Python binary used to run\n    scons.\n    \"\"\"\n\n    # For Python2, and bad Python3 setups, avoid unicode working directory.\n    if isWin32Windows():\n        change_dir = getWindowsShortPathName(os.getcwd())\n    else:\n        change_dir = None\n\n    with withDirectoryChange(change_dir, allow_none=True):\n        with _setupSconsEnvironment2():\n            yield\n\n\ndef _buildSconsCommand(options, scons_filename):\n    \"\"\"Build the scons command to run.\n\n    The options are a dictionary to be passed to scons as a command line,\n    and other scons stuff is set.\n    \"\"\"\n\n    scons_command = _getSconsBinaryCall()\n\n    if not Options.isShowScons():\n        scons_command.append(\"--quiet\")\n\n    scons_command += [\n        # The scons file\n        \"-f\",\n        getExternalUsePath(os.path.join(getSconsDataPath(), scons_filename)),\n        # Parallel compilation.\n        \"--jobs\",\n        str(Options.getJobLimit()),\n        # Do not warn about deprecation from Scons\n        \"--warn=no-deprecated\",\n        # Don't load \"site_scons\" at all.\n        \"--no-site-dir\",\n    ]\n\n    if Options.isShowScons():\n        scons_command.append(\"--debug=stacktrace\")\n\n    # Python2, encoding unicode values\n    def encode(value):\n        if str is bytes and type(value) is unicode:\n            return value.encode(\"utf8\")\n        else:\n            return value\n\n    # Option values to provide to scons. Find these in the caller.\n    for key, value in options.items():\n        if value is None:\n            Tracing.scons_logger.sysexit(\n                \"Error, failure to provide argument for '%s', please report bug.\" % key\n            )\n\n        scons_command.append(key + \"=\" + encode(value))\n\n    # Python2, make argument encoding recognizable.\n    if str is bytes:\n        scons_command.append(\"arg_encoding=utf8\")\n\n    return scons_command\n\n\ndef _createSconsDebugScript(source_dir, scons_command):\n    # we wrote debug shell script only if build process called, not \"--version\" call.\n    scons_debug_python_name = \"scons-debug.py\"\n\n    putTextFileContents(\n        filename=os.path.join(source_dir, scons_debug_python_name),\n        contents=\"\"\"\\\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport subprocess\n\nexit_code = subprocess.call(\n    %(scons_command)r,\n    env=%(env)r,\n    shell=False\n)\"\"\"\n        % {\"scons_command\": scons_command, \"env\": dict(os.environ)},\n        encoding=\"utf8\",\n    )\n\n    if isWin32Windows():\n        script_extension = \".bat\"\n\n        script_prelude = \"\"\"\\\ncd \"%~dp0\"\n                    \"\"\"\n    else:\n        script_extension = \".sh\"\n\n        script_prelude = \"\"\"\\\n#!/bin/bash\ncd \"${0%/*}\"\n\"\"\"\n\n    putTextFileContents(\n        filename=os.path.join(\n            source_dir,\n            changeFilenameExtension(scons_debug_python_name, script_extension),\n        ),\n        contents=\"\"\"\\\n%(script_prelude)s\n\n'%(scons_python)s' '%(scons_debug_script_name)s'\n\"\"\"\n        % {\n            \"script_prelude\": script_prelude,\n            \"scons_python\": scons_command[0],\n            \"scons_debug_script_name\": scons_debug_python_name,\n        },\n        encoding=\"utf8\",\n    )\n\n\ndef runScons(options, env_values, scons_filename):\n    with _setupSconsEnvironment():\n        env_values[\"_NUITKA_BUILD_DEFINITIONS_CATALOG\"] = \",\".join(env_values.keys())\n\n        if \"source_dir\" in options and Options.shallCompileWithoutBuildDirectory():\n            # Make sure we become non-local, by changing all paths to be\n            # absolute, but ones that can be resolved by any program\n            # externally, as the Python of Scons may not be good at unicode.\n\n            options = copy.deepcopy(options)\n            source_dir = options[\"source_dir\"]\n            options[\"source_dir\"] = \".\"\n            options[\"result_name\"] = getExternalUsePath(\n                options[\"result_name\"], only_dirname=True\n            )\n            options[\"nuitka_src\"] = getExternalUsePath(options[\"nuitka_src\"])\n            if \"result_exe\" in options:\n                options[\"result_exe\"] = getExternalUsePath(\n                    options[\"result_exe\"], only_dirname=True\n                )\n\n        else:\n            source_dir = None\n\n        env_values = OrderedDict(env_values)\n        env_values[\"_NUITKA_BUILD_DEFINITIONS_CATALOG\"] = \",\".join(env_values.keys())\n\n        # Pass quiet setting to scons via environment variable.\n        env_values[\"NUITKA_QUIET\"] = \"1\" if Tracing.is_quiet else \"0\"\n\n        scons_command = _buildSconsCommand(\n            options=options, scons_filename=scons_filename\n        )\n\n        if Options.isShowScons():\n            Tracing.scons_logger.info(\"Scons command: %s\" % \" \".join(scons_command))\n\n        Tracing.flushStandardOutputs()\n\n        with withEnvironmentVarsOverridden(env_values):\n            # Create debug script to quickly re-run this step only.\n            if source_dir is not None:\n                _createSconsDebugScript(\n                    source_dir=source_dir, scons_command=scons_command\n                )\n\n            try:\n                result = subprocess.call(scons_command, shell=False, cwd=source_dir)\n            except KeyboardInterrupt:\n                Tracing.scons_logger.sysexit(\"User interrupted scons build.\")\n\n        # TODO: Actually this should only flush one of these, namely the one for\n        # current source_dir.\n        flushSconsReports()\n\n        if \"source_dir\" in options and result == 0:\n            checkCachingSuccess(source_dir or options[\"source_dir\"])\n\n        return result == 0\n\n\ndef asBoolStr(value):\n    \"\"\"Encode booleans for transfer via command line.\"\"\"\n\n    return \"true\" if value else \"false\"\n\n\ndef cleanSconsDirectory(source_dir):\n    \"\"\"Clean scons build directory.\"\"\"\n\n    # spell-checker: ignore gcda\n    extensions = (\n        \".bin\",\n        \".c\",\n        \".cpp\",\n        \".exp\",\n        \".h\",\n        \".lib\",\n        \".manifest\",\n        \".o\",\n        \".obj\",\n        \".os\",\n        \".rc\",\n        \".res\",\n        \".S\",\n        \".txt\",\n        \".const\",\n        \".gcda\",\n        \".pgd\",\n        \".pgc\",\n    )\n\n    def check(path):\n        if hasFilenameExtension(path, extensions):\n            deleteFile(path, must_exist=True)\n\n    if os.path.isdir(source_dir):\n        for path, _filename in listDir(source_dir):\n            check(path)\n\n        static_dir = os.path.join(source_dir, \"static_src\")\n\n        if os.path.exists(static_dir):\n            for path, _filename in listDir(static_dir):\n                check(path)\n\n        plugins_dir = os.path.join(source_dir, \"plugins\")\n\n        if os.path.exists(plugins_dir):\n            for path, _filename in listDir(plugins_dir):\n                check(path)\n\n\ndef setCommonSconsOptions(options):\n    # Scons gets transported many details, that we express as variables, and\n    # have checks for them, leading to many branches and statements,\n    # pylint: disable=too-many-branches,too-many-statements\n    options[\"nuitka_src\"] = getSconsDataPath()\n\n    options[\"python_version\"] = python_version_str\n\n    options[\"python_prefix\"] = getDirectoryRealPath(getSystemPrefixPath())\n\n    options[\"experimental\"] = \",\".join(Options.getExperimentalIndications())\n\n    options[\"no_deployment\"] = \",\".join(Options.getNoDeploymentIndications())\n\n    if Options.shallRunInDebugger():\n        options[\"full_names\"] = asBoolStr(True)\n\n    if Options.assumeYesForDownloads():\n        options[\"assume_yes_for_downloads\"] = asBoolStr(True)\n\n    if not Options.shallUseProgressBar():\n        options[\"progress_bar\"] = asBoolStr(False)\n\n    if Options.isClang():\n        options[\"clang_mode\"] = asBoolStr(True)\n\n    if Options.isShowScons():\n        options[\"show_scons\"] = asBoolStr(True)\n\n    if Options.isMingw64():\n        options[\"mingw_mode\"] = asBoolStr(True)\n\n    if Options.getMsvcVersion():\n        options[\"msvc_version\"] = Options.getMsvcVersion()\n\n    if Options.shallDisableCCacheUsage():\n        options[\"disable_ccache\"] = asBoolStr(True)\n\n    if Options.shallDisableConsoleWindow() and Options.mayDisableConsoleWindow():\n        options[\"disable_console\"] = asBoolStr(True)\n\n    if Options.getLtoMode() != \"auto\":\n        options[\"lto_mode\"] = Options.getLtoMode()\n\n    if isWin32OrPosixWindows() or isMacOS():\n        options[\"noelf_mode\"] = asBoolStr(True)\n\n    if Options.isUnstripped():\n        options[\"unstripped_mode\"] = asBoolStr(True)\n\n    if isAnacondaPython():\n        options[\"anaconda_python\"] = asBoolStr(True)\n\n    if isMSYS2MingwPython():\n        options[\"msys2_mingw_python\"] = asBoolStr(True)\n\n    if isSelfCompiledPythonUninstalled():\n        options[\"self_compiled_python_uninstalled\"] = asBoolStr(True)\n\n    cpp_defines = Plugins.getPreprocessorSymbols()\n    if cpp_defines:\n        options[\"cpp_defines\"] = \",\".join(\n            \"%s%s%s\" % (key, \"=\" if value else \"\", value or \"\")\n            for key, value in cpp_defines.items()\n        )\n\n    cpp_include_dirs = Plugins.getExtraIncludeDirectories()\n    if cpp_include_dirs:\n        options[\"cpp_include_dirs\"] = \",\".join(cpp_include_dirs)\n\n    link_dirs = Plugins.getExtraLinkDirectories()\n    if link_dirs:\n        options[\"link_dirs\"] = \",\".join(link_dirs)\n\n    link_libraries = Plugins.getExtraLinkLibraries()\n    if link_libraries:\n        options[\"link_libraries\"] = \",\".join(link_libraries)\n\n    if isMacOS():\n        macos_min_version = detectBinaryMinMacOS(sys.executable)\n\n        if macos_min_version is None:\n            Tracing.general.sysexit(\n                \"Could not detect minimum macOS version for '%s'.\" % sys.executable\n            )\n\n        options[\"macos_min_version\"] = macos_min_version\n\n        options[\"macos_target_arch\"] = Options.getMacOSTargetArch()\n\n    options[\"target_arch\"] = getArchitecture()\n\n    if Options.getFcfProtectionMode() != \"auto\":\n        options[\"cf_protection\"] = Options.getFcfProtectionMode()\n\n    env_values = OrderedDict()\n\n    string_values = Options.getWindowsVersionInfoStrings()\n    if \"CompanyName\" in string_values:\n        env_values[\"NUITKA_COMPANY_NAME\"] = string_values[\"CompanyName\"]\n    if \"ProductName\" in string_values:\n        env_values[\"NUITKA_PRODUCT_NAME\"] = string_values[\"ProductName\"]\n\n    # Merge version information if possible, to avoid collisions, or deep nesting\n    # in file system.\n    product_version = Options.getProductVersion()\n    file_version = Options.getFileVersion()\n\n    if product_version is None:\n        product_version = file_version\n    if file_version is None:\n        file_version = product_version\n\n    if product_version != file_version:\n        effective_version = \"%s-%s\" % (\n            product_version,\n            file_version,\n        )\n    else:\n        effective_version = file_version\n\n    if effective_version:\n        env_values[\"NUITKA_VERSION_COMBINED\"] = effective_version\n\n    if isNuitkaPython() and not isWin32OrPosixWindows():\n        # Override environment CC and CXX to match build compiler.\n        import sysconfig\n\n        env_values[\"CC\"] = sysconfig.get_config_var(\"CC\").split()[0]\n        env_values[\"CXX\"] = sysconfig.get_config_var(\"CXX\").split()[0]\n\n    # Onefile grace time is shared, because client will also suicide based on\n    # it.\n    if isOnefileMode():\n        env_values[\"_NUITKA_ONEFILE_CHILD_GRACE_TIME_INT\"] = str(\n            getOnefileChildGraceTime()\n        )\n\n    return env_values\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsProgress.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Progress bar for Scons compilation part.\n\nThis does only the interfacing with tracing and collection of information.\n\n\"\"\"\n\nfrom nuitka.Progress import (\n    closeProgressBar,\n    enableProgressBar,\n    reportProgressBar,\n    setupProgressBar,\n)\nfrom nuitka.Tracing import scons_logger\n\n\ndef enableSconsProgressBar():\n    enableProgressBar()\n\n    import atexit\n\n    atexit.register(closeSconsProgressBar)\n\n\n_total = None\n_current = 0\n_stage = None\n\n\ndef setSconsProgressBarTotal(name, total):\n    # keep track of how many files there are to know when link comes, pylint: disable=global-statement\n    global _total, _stage\n    _total = total\n    _stage = name\n\n    setupProgressBar(stage=\"%s C\" % name, unit=\"file\", total=total)\n\n\ndef updateSconsProgressBar():\n    # Check if link is next, pylint: disable=global-statement\n    global _current\n    _current += 1\n\n    reportProgressBar(item=None, update=True)\n\n    if _current == _total:\n        closeSconsProgressBar()\n\n        scons_logger.info(\n            \"%s linking program with %d files (no progress information available for this stage).\"\n            % (_stage, _total)\n        )\n\n\ndef closeSconsProgressBar():\n    closeProgressBar()\n\n\ndef reportSlowCompilation(env, cmd, delta_time):\n    # TODO: for linking, we ought to apply a different timer maybe and attempt to extra\n    # the source file that is causing the issues: pylint: disable=unused-argument\n    if _current != _total:\n        scons_logger.info(\n            \"\"\"\\\nSlow C compilation detected, used %.0fs so far, scalability problem.\"\"\"\n            % delta_time\n        )\n    else:\n        if env.orig_lto_mode == \"auto\" and env.lto_mode:\n            scons_logger.info(\n                \"\"\"\\\nSlow C linking detected, used %.0fs so far, consider using '--lto=no' \\\nfor faster linking, or '--lto=yes\"' to disable this message. \"\"\"\n                % delta_time\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsSpawn.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Spawning processes.\n\nThis is to replace the standard spawn implementation with one that tracks the\nprogress, and gives warnings about things taking very long.\n\"\"\"\n\nimport os\nimport sys\nimport threading\n\nfrom nuitka.Tracing import my_print, scons_logger\nfrom nuitka.utils.Execution import executeProcess\nfrom nuitka.utils.FileOperations import getReportPath\nfrom nuitka.utils.Timing import TimerReport\n\nfrom .SconsCaching import runClCache\nfrom .SconsProgress import (\n    closeSconsProgressBar,\n    reportSlowCompilation,\n    updateSconsProgressBar,\n)\nfrom .SconsUtils import decodeData, reportSconsUnexpectedOutput\n\n\n# Thread class to run a command\nclass SubprocessThread(threading.Thread):\n    def __init__(self, cmdline, env):\n        threading.Thread.__init__(self)\n\n        self.cmdline = cmdline\n        self.env = env\n\n        self.data = None\n        self.err = None\n        self.exit_code = None\n        self.exception = None\n\n        self.timer_report = TimerReport(\n            message=\"Running %s took %%.2f seconds\"\n            % repr(self.cmdline).replace(\"%\", \"%%\"),\n            min_report_time=360,\n            logger=scons_logger,\n        )\n\n    def run(self):\n        try:\n            # execute the command, queue the result\n            with self.timer_report:\n                self.data, self.err, self.exit_code = executeProcess(\n                    command=self.cmdline, env=self.env\n                )\n\n        except Exception as e:  # will rethrow all, pylint: disable=broad-except\n            self.exception = e\n\n    def getProcessResult(self):\n        return self.data, self.err, self.exit_code, self.exception\n\n\ndef _runProcessMonitored(env, cmdline, os_env):\n    thread = SubprocessThread(cmdline, os_env)\n    thread.start()\n\n    # Allow 6 minutes before warning for long compile time.\n    thread.join(360)\n\n    if thread.is_alive():\n        reportSlowCompilation(env, cmdline, thread.timer_report.getTimer().getDelta())\n\n    thread.join()\n\n    updateSconsProgressBar()\n\n    return thread.getProcessResult()\n\n\ndef _filterMsvcLinkOutput(env, module_mode, data, exit_code):\n    # Training newline in some cases, esp. LTO it seems.\n    data = data.rstrip()\n\n    if module_mode:\n        data = b\"\\r\\n\".join(\n            line\n            for line in data.split(b\"\\r\\n\")\n            if b\"   Creating library\" not in line\n            # On localized compilers, the message to ignore is not as clear.\n            if not (module_mode and b\".exp\" in line)\n        )\n\n    # The linker will say generating code at the end, due to localization\n    # we don't know.\n    if env.lto_mode and exit_code == 0:\n        if len(data.split(b\"\\r\\n\")) == 2:\n            data = b\"\"\n\n    if env.pgo_mode == \"use\" and exit_code == 0:\n        # Very noisy, partially in native language for PGO link.\n        data = b\"\"\n\n    return data\n\n\ndef _raiseCorruptedObjectFilesExit(cache_name):\n    \"\"\"Error exit due to corrupt object files and point to cache cleanup.\"\"\"\n    scons_logger.sysexit(\n        \"\"\"\\\nError, the C linker reported a corrupt object file. You may need to run\nNuitka with '--clean-cache=%s' once to repair it, or else will\nsurely happen again.\"\"\"\n        % cache_name\n    )\n\n\ndef _getNoSuchCommandErrorMessage():\n    import ctypes\n\n    return ctypes.WinError(3).args[1]\n\n\n# To work around Windows not supporting command lines of greater than 10K by\n# default:\ndef _getWindowsSpawnFunction(env, module_mode, source_files):\n    # Too much error handling error, pylint: disable=too-many-branches\n\n    def spawnWindowsCommand(\n        sh, escape, cmd, args, os_env\n    ):  # pylint: disable=unused-argument\n        \"\"\"Our own spawn implementation for use on Windows.\"\"\"\n\n        # The \"del\" appears to not work reliably, but is used with large amounts of\n        # files to link. So, lets do this ourselves, plus it avoids a process\n        # spawn.\n        if cmd == \"del\":\n            assert len(args) == 2\n\n            os.unlink(args[1])\n            return 0\n\n        # For quoted arguments that end in a backslash, things don't work well\n        # this is a workaround for it.\n        def removeTrailingSlashQuote(arg):\n            if arg.endswith(r\"\\\"\"):\n                return arg[:-1] + '\\\\\"'\n            else:\n                return arg\n\n        new_args = \" \".join(removeTrailingSlashQuote(arg) for arg in args[1:])\n        cmdline = cmd + \" \" + new_args\n\n        # Special hook for clcache inline copy\n        if cmd == \"<clcache>\":\n            data, err, rv = runClCache(args, os_env)\n        else:\n            data, err, rv, exception = _runProcessMonitored(env, cmdline, os_env)\n\n            if exception:\n                closeSconsProgressBar()\n                raise exception\n\n        if rv != 0:\n            closeSconsProgressBar()\n\n        if cmd == \"link\":\n            data = _filterMsvcLinkOutput(\n                env=env, module_mode=module_mode, data=data, exit_code=rv\n            )\n        elif cmd in (\"cl\", \"<clcache>\"):\n            # Skip forced output from cl.exe\n            data = data[data.find(b\"\\r\\n\") + 2 :]\n\n            source_base_names = [\n                os.path.basename(source_file) for source_file in source_files\n            ]\n\n            def check(line):\n                return line in (b\"\", b\"Generating Code...\") or line in source_base_names\n\n            data = (\n                b\"\\r\\n\".join(line for line in data.split(b\"\\r\\n\") if not check(line))\n                + b\"\\r\\n\"\n            )\n\n        if data is not None and data.rstrip():\n            my_print(\"Unexpected output from this command:\", style=\"scons-unexpected\")\n            my_print(cmdline, style=\"scons-unexpected\")\n\n            if str is not bytes:\n                data = decodeData(data)\n\n            my_print(\n                data, style=\"scons-unexpected\", end=\"\" if data.endswith(\"\\n\") else \"\\n\"\n            )\n\n            reportSconsUnexpectedOutput(env, cmdline, stdout=data, stderr=None)\n\n        if err:\n            if str is not bytes:\n                err = decodeData(err)\n\n            err = \"\\r\\n\".join(\n                line\n                for line in err.split(\"\\r\\n\")\n                if not isIgnoredError(line)\n                if not (\n                    env.mingw_mode\n                    and env.lto_mode\n                    and line == _getNoSuchCommandErrorMessage()\n                )\n            )\n\n            if err:\n                if \"corrupt file\" in err:\n                    _raiseCorruptedObjectFilesExit(cache_name=\"clcache\")\n                if \"Bad magic value\" in err:\n                    _raiseCorruptedObjectFilesExit(cache_name=\"ccache\")\n\n                err += \"\\r\\n\"\n                my_print(err, style=\"scons-unexpected\", end=\"\")\n\n                reportSconsUnexpectedOutput(env, cmdline, stdout=None, stderr=err)\n\n        return rv\n\n    return spawnWindowsCommand\n\n\ndef _formatForOutput(arg):\n    # Undo the damage that scons did to pass it to \"sh\"\n    arg = arg.strip('\"')\n\n    slash = \"\\\\\"\n    special = '\"$()'\n\n    arg = arg.replace(slash + slash, slash)\n    for c in special:\n        arg = arg.replace(slash + c, c)\n\n    if arg.startswith(\"-I\"):\n        prefix = \"-I\"\n        arg = arg[2:]\n    else:\n        prefix = \"\"\n\n    return prefix + getReportPath(arg)\n\n\ndef isIgnoredError(line):\n    # Many cases and return driven, pylint: disable=too-many-branches,too-many-return-statements\n\n    # spell-checker: ignore tmpnam,tempnam,structseq,bytearrayobject\n\n    # Debian Python2 static libpython lto warnings:\n    if \"function `posix_tmpnam':\" in line:\n        return True\n    if \"function `posix_tempnam':\" in line:\n        return True\n\n    # Self compiled Python2 static libpython lot warnings:\n    if \"the use of `tmpnam_r' is dangerous\" in line:\n        return True\n    if \"the use of `tempnam' is dangerous\" in line:\n        return True\n    if line.startswith((\"Objects/structseq.c:\", \"Python/import.c:\")):\n        return True\n    if line == \"In function 'load_next',\":\n        return True\n    if \"at Python/import.c\" in line:\n        return True\n\n    # Debian Bullseye when compiling in directory with spaces:\n    if \"overriding recipe for target\" in line:\n        return True\n    if \"ignoring old recipe for target\" in line:\n        return True\n    if \"Error 1 (ignored)\" in line:\n        return True\n\n    # Trusty has buggy toolchain that does this with LTO.\n    if (\n        line\n        == \"\"\"\\\nbytearrayobject.o (symbol from plugin): warning: memset used with constant zero \\\nlength parameter; this could be due to transposed parameters\"\"\"\n    ):\n        return True\n\n    # The gcc LTO with debug information is deeply buggy with many messages:\n    if \"Dwarf Error:\" in line:\n        return True\n\n    # gcc from MinGW64 12.1 gives these, that seem non-consequential.\n    if line.startswith(\"mingw32-make:\") and line.endswith(\"Error 1 (ignored)\"):\n        return True\n\n    return False\n\n\ndef subprocess_spawn(env, args):\n    sh, _cmd, args, os_env = args\n\n    _stdout, stderr, exit_code = executeProcess(\n        command=[sh, \"-c\", \" \".join(args)], env=os_env\n    )\n\n    if str is not bytes:\n        stderr = decodeData(stderr)\n\n    ignore_next = False\n    for line in stderr.splitlines():\n        if ignore_next:\n            ignore_next = False\n            continue\n\n        # Corrupt object files, probably from ccache being interrupted at the wrong time.\n        if \"Bad magic value\" in line:\n            _raiseCorruptedObjectFilesExit(cache_name=\"ccache\")\n\n        if isIgnoredError(line):\n            ignore_next = True\n            continue\n\n        if exit_code != 0 and \"terminated with signal 11\" in line:\n            exit_code = -11\n\n        my_print(line, style=\"scons-unexpected\", file=sys.stderr)\n\n        reportSconsUnexpectedOutput(env, args, stdout=None, stderr=line)\n\n    return exit_code\n\n\nclass SpawnThread(threading.Thread):\n    def __init__(self, env, *args):\n        threading.Thread.__init__(self)\n\n        self.env = env\n        self.args = args\n\n        self.timer_report = TimerReport(\n            message=\"Running %s took %%.2f seconds\"\n            % (\n                \" \".join(_formatForOutput(arg) for arg in self.args[2]).replace(\n                    \"%\", \"%%\"\n                ),\n            ),\n            min_report_time=360,\n            logger=scons_logger,\n        )\n\n        self.result = None\n        self.exception = None\n\n    def run(self):\n        try:\n            # execute the command, queue the result\n            with self.timer_report:\n                self.result = subprocess_spawn(env=self.env, args=self.args)\n        except Exception as e:  # will rethrow all, pylint: disable=broad-except\n            self.exception = e\n\n    def getSpawnResult(self):\n        return self.result, self.exception\n\n\ndef _runSpawnMonitored(env, sh, cmd, args, os_env):\n    thread = SpawnThread(env, sh, cmd, args, os_env)\n    thread.start()\n\n    # Allow 6 minutes before warning for long compile time.\n    thread.join(360)\n\n    if thread.is_alive():\n        reportSlowCompilation(env, cmd, thread.timer_report.getTimer().getDelta())\n\n    thread.join()\n\n    updateSconsProgressBar()\n\n    return thread.getSpawnResult()\n\n\ndef _getWrappedSpawnFunction(env):\n    def spawnCommand(sh, escape, cmd, args, os_env):\n        # signature needed towards Scons core, pylint: disable=unused-argument\n\n        # Avoid using ccache on binary constants blob, not useful and not working\n        # with old ccache.\n        if '\"__constants_data.o\"' in args or '\"__constants_data.os\"' in args:\n            os_env = dict(os_env)\n            os_env[\"CCACHE_DISABLE\"] = \"1\"\n\n        result, exception = _runSpawnMonitored(env, sh, cmd, args, os_env)\n\n        if exception:\n            closeSconsProgressBar()\n            raise exception\n\n        if result != 0:\n            closeSconsProgressBar()\n\n        # Segmentation fault should give a clear error.\n        if result == -11:\n            scons_logger.sysexit(\n                \"\"\"\\\nError, the C compiler '%s' crashed with segfault. Consider upgrading \\\nit or using '--clang' option.\"\"\"\n                % env.the_compiler\n            )\n\n        return result\n\n    return spawnCommand\n\n\ndef enableSpawnMonitoring(env, module_mode, source_files):\n    if os.name == \"nt\":\n        env[\"SPAWN\"] = _getWindowsSpawnFunction(\n            env=env, module_mode=module_mode, source_files=source_files\n        )\n    else:\n        env[\"SPAWN\"] = _getWrappedSpawnFunction(env=env)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/SconsUtils.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Helper functions for the scons file.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport pickle\nimport shutil\nimport signal\nimport sys\n\nfrom nuitka.__past__ import basestring, unicode\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Tracing import scons_details_logger, scons_logger\nfrom nuitka.utils.Execution import executeProcess\nfrom nuitka.utils.FileOperations import (\n    getFileContentByLine,\n    getWindowsShortPathName,\n    hasFilenameExtension,\n    isFilesystemEncodable,\n    openPickleFile,\n    openTextFile,\n    withFileLock,\n)\nfrom nuitka.utils.Utils import isLinux, isMacOS, isPosixWindows, isWin32Windows\n\n\ndef initScons():\n    # Avoid localized outputs.\n    os.environ[\"LANG\"] = \"C\"\n\n    def no_sync(self):\n        # That's a noop, pylint: disable=unused-argument\n        pass\n\n    # Avoid scons writing the scons database at all, spell-checker: ignore dblite\n    import SCons.dblite  # pylint: disable=I0021,import-error\n\n    SCons.dblite.dblite.sync = no_sync\n\n\ndef setupScons(env, source_dir):\n    env[\"BUILD_DIR\"] = source_dir\n\n    # Store the file signatures database with the rest of the source files and\n    # make it version dependent on the Python version of running Scons, as its\n    # pickle is being used, spell-checker: ignore sconsign\n    sconsign_filename = os.path.abspath(\n        os.path.join(\n            source_dir, \".sconsign-%d%s\" % (sys.version_info[0], sys.version_info[1])\n        )\n    )\n\n    env.SConsignFile(sconsign_filename)\n\n\nscons_arguments = {}\n\n\ndef setArguments(arguments):\n    \"\"\"Decode command line arguments.\"\"\"\n\n    arg_encoding = arguments.get(\"argument_encoding\")\n\n    for key, value in arguments.items():\n        if arg_encoding is not None:\n            value = decodeData(value)\n        scons_arguments[key] = value\n\n\ndef getArgumentRequired(name):\n    \"\"\"Helper for string options without default value.\"\"\"\n    return scons_arguments[name]\n\n\ndef getArgumentDefaulted(name, default):\n    \"\"\"Helper for string options with default value.\"\"\"\n    return scons_arguments.get(name, default)\n\n\ndef getArgumentInt(option_name, default=None):\n    \"\"\"Small helper for boolean mode flags.\"\"\"\n    if default is None:\n        value = scons_arguments[option_name]\n    else:\n        value = int(scons_arguments.get(option_name, default))\n\n    return value\n\n\ndef getArgumentBool(option_name, default=None):\n    \"\"\"Small helper for boolean mode flags.\"\"\"\n    if default is None:\n        value = scons_arguments[option_name]\n    else:\n        value = scons_arguments.get(option_name, \"True\" if default else \"False\")\n\n    return value.lower() in (\"yes\", \"true\", \"1\")\n\n\ndef getArgumentList(option_name, default=None):\n    \"\"\"Small helper for list mode options, default should be command separated str.\"\"\"\n    if default is None:\n        value = scons_arguments[option_name]\n    else:\n        value = scons_arguments.get(option_name, default)\n\n    if value:\n        return value.split(\",\")\n    else:\n        return []\n\n\ndef _enableFlagSettings(env, name, experimental_flags):\n    for flag_name in experimental_flags:\n        if not flag_name:\n            continue\n\n        flag_name = \"%s-%s\" % (name, flag_name)\n\n        if \"=\" in flag_name:\n            flag_name, value = flag_name.split(\"=\", 1)\n        else:\n            value = None\n\n        # Allowing for nice names on command line, but using identifiers for C.\n        flag_name = flag_name.upper().replace(\"-\", \"_\").replace(\".\", \"_\")\n\n        # Experimental without a value is done as mere define, otherwise\n        # the value is passed. spell-checker: ignore cppdefines\n        if value:\n            env.Append(CPPDEFINES=[(\"_NUITKA_%s\" % flag_name, value)])\n        else:\n            env.Append(CPPDEFINES=[\"_NUITKA_%s\" % flag_name])\n\n\ndef prepareEnvironment(mingw_mode):\n    # Add environment specified compilers to the PATH variable.\n    if \"CC\" in os.environ:\n        scons_details_logger.info(\"CC='%s'\" % os.environ[\"CC\"])\n\n        os.environ[\"CC\"] = os.path.normpath(os.path.expanduser(os.environ[\"CC\"]))\n\n        if os.path.isdir(os.environ[\"CC\"]):\n            scons_logger.sysexit(\n                \"Error, the 'CC' variable must point to file, not directory.\"\n            )\n\n        if os.path.sep in os.environ[\"CC\"]:\n            cc_dirname = os.path.dirname(os.environ[\"CC\"])\n            if os.path.isdir(cc_dirname):\n                addToPATH(None, cc_dirname, prefix=True)\n\n        if os.name == \"nt\" and isGccName(os.path.basename(os.environ[\"CC\"])):\n            scons_details_logger.info(\n                \"Environment CC seems to be a gcc, enabling mingw_mode.\"\n            )\n            mingw_mode = True\n    else:\n        anaconda_python = getArgumentBool(\"anaconda_python\", False)\n\n        if isLinux() and anaconda_python:\n            python_prefix = getArgumentRequired(\"python_prefix\")\n            addToPATH(None, os.path.join(python_prefix, \"bin\"), prefix=True)\n\n    return mingw_mode\n\n\ndef createEnvironment(\n    mingw_mode, msvc_version, target_arch, experimental, no_deployment\n):\n    from SCons.Script import Environment  # pylint: disable=I0021,import-error\n\n    args = {}\n\n    if msvc_version == \"list\":\n        import SCons.Tool.MSCommon.vc  # pylint: disable=I0021,import-error\n\n        scons_logger.sysexit(\n            \"Installed MSVC versions are %s.\"\n            % \",\".join(repr(v) for v in SCons.Tool.MSCommon.vc.get_installed_vcs()),\n        )\n\n    # If we are on Windows, and MinGW is not enforced, lets see if we can\n    # find \"cl.exe\", and if we do, disable automatic scan.\n    if (\n        os.name == \"nt\"\n        and not mingw_mode\n        and msvc_version is None\n        and msvc_version != \"latest\"\n        and (getExecutablePath(\"cl\", env=None) is not None)\n    ):\n        args[\"MSVC_USE_SCRIPT\"] = False\n\n    if mingw_mode or isPosixWindows():\n        # Force usage of MinGW64, not using MSVC tools.\n        tools = [\"mingw\"]\n\n        # This code would be running anyway, make it do not thing by monkey patching.\n        import SCons.Tool.MSCommon.vc  # pylint: disable=I0021,import-error\n        import SCons.Tool.msvc  # pylint: disable=I0021,import-error\n\n        SCons.Tool.MSCommon.vc.msvc_setup_env = lambda *args: None\n        SCons.Tool.msvc.msvc_exists = SCons.Tool.MSCommon.vc.msvc_exists = (\n            lambda *args: False\n        )\n    else:\n        # Everything else should use default, that is MSVC tools, but not MinGW64.\n        tools = [\"default\"]\n\n    env = Environment(\n        # We want the outside environment to be passed through.\n        ENV=os.environ,\n        # Extra tools configuration for scons.\n        tools=tools,\n        # The shared libraries should not be named \"lib...\", because CPython\n        # requires the filename \"module_name.so/pyd\" to load it, with no\n        # prefix at all, spell-checker: ignore SHLIBPREFIX\n        SHLIBPREFIX=\"\",\n        # Under windows, specify the target architecture is needed for Scons\n        # to pick up MSVC.\n        TARGET_ARCH=target_arch,\n        # The MSVC version might be fixed by the user.\n        MSVC_VERSION=msvc_version if msvc_version != \"latest\" else None,\n        **args\n    )\n\n    # Various flavors could influence builds.\n    env.nuitka_python = getArgumentBool(\"nuitka_python\", False)\n    env.debian_python = getArgumentBool(\"debian_python\", False)\n    env.fedora_python = getArgumentBool(\"fedora_python\", False)\n    env.arch_python = getArgumentBool(\"arch_python\", False)\n    env.msys2_mingw_python = getArgumentBool(\"msys2_mingw_python\", False)\n    env.anaconda_python = getArgumentBool(\"anaconda_python\", False)\n    env.pyenv_python = getArgumentBool(\"pyenv_python\", False)\n    env.apple_python = getArgumentBool(\"apple_python\", False)\n    env.self_compiled_python_uninstalled = getArgumentBool(\n        \"self_compiled_python_uninstalled\", False\n    )\n\n    # Non-elf binary, important for linker settings.\n    env.noelf_mode = getArgumentBool(\"noelf_mode\", False)\n\n    # Python specific modes have to influence some decisions.\n    env.static_libpython = getArgumentDefaulted(\"static_libpython\", \"\")\n    if env.static_libpython:\n        assert os.path.exists(env.static_libpython), env.static_libpython\n\n    # Python version we are working on.\n    python_version_str = getArgumentDefaulted(\"python_version\", None)\n    if python_version_str is not None:\n        env.python_version = tuple(int(d) for d in python_version_str.split(\".\"))\n    else:\n        env.python_version = None\n\n    # Modules count, determines if this is a large compilation.\n    env.module_count = getArgumentInt(\"module_count\", 0)\n\n    # Target arch for some decisions\n    env.target_arch = target_arch\n\n    _enableFlagSettings(env, \"no_deployment\", no_deployment)\n    env.no_deployment_flags = no_deployment\n\n    _enableFlagSettings(env, \"experimental\", experimental)\n    env.experimental_flags = experimental\n\n    return env\n\n\ndef decodeData(data):\n    \"\"\"Our own decode tries to workaround MSVC misbehavior.\"\"\"\n    try:\n        return data.decode(sys.stdout.encoding)\n    except UnicodeDecodeError:\n        import locale\n\n        try:\n            return data.decode(locale.getpreferredencoding())\n        except UnicodeDecodeError:\n            return data.decode(\"utf8\", \"backslashreplace\")\n\n\ndef getExecutablePath(filename, env):\n    \"\"\"Find an execute in either normal PATH, or Scons detected PATH.\"\"\"\n\n    if os.path.exists(filename):\n        return filename\n\n    # Variable substitution from environment is needed, because this can contain\n    # \"$CC\" which should be looked up too.\n    while filename.startswith(\"$\"):\n        filename = env[filename[1:]]\n\n    # Append \".exe\" suffix  on Windows if not already present.\n    if os.name == \"nt\" and not filename.lower().endswith(\".exe\"):\n        filename += \".exe\"\n\n    # Either look at the initial \"PATH\" as given from the outside or look at the\n    # current environment.\n    if env is None:\n        search_path = os.environ[\"PATH\"]\n    else:\n        search_path = env._dict[\"ENV\"][\"PATH\"]  # pylint: disable=protected-access\n\n    # Now check in each path element, much like the shell will.\n    path_elements = search_path.split(os.pathsep)\n\n    for path_element in path_elements:\n        path_element = path_element.strip('\"')\n\n        full = os.path.normpath(os.path.join(path_element, filename))\n\n        if os.path.exists(full):\n            return full\n\n    return None\n\n\ndef changeKeyboardInterruptToErrorExit():\n    def signalHandler(\n        signal, frame\n    ):  # pylint: disable=redefined-outer-name,unused-argument\n        sys.exit(2)\n\n    signal.signal(signal.SIGINT, signalHandler)\n\n\ndef setEnvironmentVariable(env, key, value):\n    if value is None:\n        del os.environ[key]\n    elif key in os.environ:\n        os.environ[key] = value\n\n    if env is not None:\n        # pylint: disable=protected-access\n        if value is None:\n            del env._dict[\"ENV\"][key]\n        else:\n            env._dict[\"ENV\"][key] = value\n\n\ndef addToPATH(env, dirname, prefix):\n    # Otherwise subprocess will complain in Python2\n    if str is bytes and type(dirname) is unicode:\n        dirname = dirname.encode(\"utf8\")\n\n    path_value = os.environ[\"PATH\"].split(os.pathsep)\n\n    if prefix:\n        path_value.insert(0, dirname)\n    else:\n        path_value.append(dirname)\n\n    setEnvironmentVariable(env, \"PATH\", os.pathsep.join(path_value))\n\n\ndef writeSconsReport(env):\n    with openTextFile(\n        _getSconsReportFilename(env.source_dir), \"w\", encoding=\"utf8\"\n    ) as report_file:\n        # We are friends to get at this debug info, pylint: disable=protected-access\n        for key, value in sorted(env._dict.items()):\n            if type(value) is list and all(isinstance(v, basestring) for v in value):\n                value = repr(value)\n\n            if not isinstance(value, basestring):\n                continue\n\n            if key.startswith((\"_\", \"CONFIGURE\")):\n                continue\n\n            # Ignore problematic and useless values\n            # spell-checker: ignore MSVSSCONS,IDLSUFFIXES,DSUFFIXES\n            if key in (\"MSVSSCONS\", \"BUILD_DIR\", \"IDLSUFFIXES\", \"DSUFFIXES\"):\n                continue\n\n            # TODO: For these kinds of prints, maybe have our own method of doing them\n            # rather than print, or maybe just json or something similar.\n            print(key + \"=\" + value, file=report_file)\n\n        print(\"gcc_mode=%s\" % env.gcc_mode, file=report_file)\n        print(\"clang_mode=%s\" % env.clang_mode, file=report_file)\n        print(\"msvc_mode=%s\" % env.msvc_mode, file=report_file)\n        print(\"mingw_mode=%s\" % env.mingw_mode, file=report_file)\n        print(\"clangcl_mode=%s\" % env.clangcl_mode, file=report_file)\n\n        print(\"PATH=%s\" % os.environ[\"PATH\"], file=report_file)\n\n\ndef reportSconsUnexpectedOutput(env, cmdline, stdout, stderr):\n    with withFileLock(\"writing scons error report\"):\n        file_handle, pickler = openPickleFile(\n            _getSconsErrorReportFilename(env.source_dir), \"ab\", protocol=2\n        )\n        pickler.dump((cmdline, stdout, stderr))\n        file_handle.close()\n\n\n_scons_reports = {}\n_scons_error_reports = {}\n\n\ndef flushSconsReports():\n    _scons_reports.clear()\n    _scons_error_reports.clear()\n\n\ndef _getSconsReportFilename(source_dir):\n    return os.path.join(source_dir, \"scons-report.txt\")\n\n\ndef _getSconsErrorReportFilename(source_dir):\n    return os.path.join(source_dir, \"scons-error-report.txt\")\n\n\ndef readSconsReport(source_dir):\n    if source_dir not in _scons_reports:\n        scons_report = OrderedDict()\n\n        for line in getFileContentByLine(\n            _getSconsReportFilename(source_dir), encoding=\"utf8\"\n        ):\n            if \"=\" not in line:\n                continue\n\n            key, value = line.strip().split(\"=\", 1)\n\n            scons_report[key] = value\n\n        _scons_reports[source_dir] = scons_report\n\n    return _scons_reports[source_dir]\n\n\ndef getSconsReportValue(source_dir, key):\n    return readSconsReport(source_dir).get(key)\n\n\ndef readSconsErrorReport(source_dir):\n    if source_dir not in _scons_error_reports:\n        scons_error_report = OrderedDict()\n\n        scons_error_report_filename = _getSconsErrorReportFilename(source_dir)\n        if os.path.exists(scons_error_report_filename):\n            file_handle = openTextFile(scons_error_report_filename, \"rb\")\n            try:\n                while True:\n                    try:\n                        cmd, stdout, stderr = pickle.load(file_handle)\n                    except EOFError:\n                        break\n\n                    if type(cmd) in (tuple, list):\n                        cmd = \" \".join(cmd)\n\n                    if cmd not in scons_error_report:\n                        scons_error_report[cmd] = [\"\", \"\"]\n\n                    if type(stdout) in (tuple, list):\n                        stdout = \"\\n\".join(stdout)\n\n                    if type(stderr) in (tuple, list):\n                        stderr = \"\\n\".join(stderr)\n\n                    if stdout:\n                        stdout = stdout.replace(\"\\n\\r\", \"\\n\")\n                        scons_error_report[cmd][0] += stdout\n                    if stderr:\n                        stderr = stderr.replace(\"\\n\\r\", \"\\n\")\n                        scons_error_report[cmd][1] += stderr\n\n            finally:\n                file_handle.close()\n\n        _scons_error_reports[source_dir] = scons_error_report\n\n    return _scons_error_reports[source_dir]\n\n\ndef addClangClPathFromMSVC(env):\n    cl_exe = getExecutablePath(\"cl\", env=env)\n\n    if cl_exe is None:\n        scons_logger.sysexit(\n            \"Error, Visual Studio required for using ClangCL on Windows.\"\n        )\n\n    clang_dir = os.path.join(cl_exe[: cl_exe.lower().rfind(\"msvc\")], \"Llvm\")\n\n    if (\n        getCompilerArch(\n            mingw_mode=False, msvc_mode=True, the_cc_name=\"cl.exe\", compiler_path=cl_exe\n        )\n        == \"pei-x86-64\"\n    ):\n        clang_dir = os.path.join(clang_dir, \"x64\", \"bin\")\n    else:\n        clang_dir = os.path.join(clang_dir, \"bin\")\n\n    if not os.path.exists(clang_dir):\n        scons_details_logger.sysexit(\n            \"Visual Studio has no Clang component found at '%s'.\" % clang_dir\n        )\n\n    scons_details_logger.info(\n        \"Adding Visual Studio directory '%s' for Clang to PATH.\" % clang_dir\n    )\n\n    addToPATH(env, clang_dir, prefix=True)\n\n    clangcl_path = getExecutablePath(\"clang-cl\", env=env)\n\n    if clangcl_path is None:\n        scons_details_logger.sysexit(\n            \"Visual Studio has no Clang component found at '%s'.\" % clang_dir\n        )\n\n    env[\"CC\"] = \"clang-cl\"\n    env[\"LINK\"] = \"lld-link\"\n\n    # Version information is outdated now, spell-checker: ignore ccversion\n    env[\"CCVERSION\"] = None\n\n\ndef isGccName(cc_name):\n    return (\n        \"gcc\" in cc_name\n        or \"g++\" in cc_name\n        or \"gnu-cc\" in cc_name\n        or \"gnu-gcc\" in cc_name\n    )\n\n\ndef isClangName(cc_name):\n    return (\"clang\" in cc_name and \"-cl\" not in cc_name) or isZigName(cc_name)\n\n\ndef isZigName(cc_name):\n    return \"zig\" in cc_name\n\n\ndef cheapCopyFile(src, dst):\n    dirname = os.path.dirname(dst)\n    if not os.path.exists(dirname):\n        os.makedirs(dirname)\n\n    if os.name == \"nt\":\n        # Windows has symlinks these days, but they do not integrate well\n        # with Python2 at least. So make a copy in any case.\n        if os.path.exists(dst):\n            os.unlink(dst)\n        shutil.copy(src, dst)\n    else:\n        # Relative paths work badly for links. Creating them relative is\n        # not worth the effort.\n        src = os.path.abspath(src)\n\n        try:\n            link_target = os.readlink(dst)\n\n            # If it's already a proper link, do nothing then.\n            if link_target == src:\n                return\n\n            os.unlink(dst)\n        except OSError as _e:\n            # Broken links work like that, remove them, so we can replace\n            # them.\n            try:\n                os.unlink(dst)\n            except OSError:\n                pass\n\n        try:\n            os.symlink(src, dst)\n        except OSError:\n            shutil.copy(src, dst)\n\n\ndef provideStaticSourceFile(env, sub_path, c11_mode):\n    source_filename = os.path.join(env.nuitka_src, \"static_src\", sub_path)\n    target_filename = os.path.join(\n        env.source_dir, \"static_src\", os.path.basename(sub_path)\n    )\n\n    if hasFilenameExtension(target_filename, \".c\") and not c11_mode:\n        target_filename += \"pp\"  # .cpp suffix then.\n\n    cheapCopyFile(source_filename, target_filename)\n\n    return target_filename\n\n\ndef scanSourceDir(env, dirname, plugins):\n    if not os.path.exists(dirname):\n        return\n\n    # If we use C11 capable compiler, all good. Otherwise use C++, which Scons\n    # needs to derive from filenames, so make copies (or links) with a different\n    # name.\n    added_path = False\n\n    for filename_base in sorted(os.listdir(dirname)):\n        if filename_base.endswith(\".h\") and plugins and not added_path:\n            # Adding path for source paths on the fly, spell-checker: ignore cpppath\n            env.Append(CPPPATH=[dirname])\n            added_path = True\n\n        # Only C files are of interest here.\n        if not hasFilenameExtension(\n            filename_base, (\".c\", \".cpp\")\n        ) or not filename_base.startswith((\"module.\", \"__\", \"plugin.\")):\n            continue\n\n        filename = os.path.join(dirname, filename_base)\n\n        target_filename = filename\n\n        if isWin32Windows() and not isFilesystemEncodable(filename_base):\n            target_filename = getWindowsShortPathName(target_filename)\n\n        # We pretend to use C++ if no C11 compiler is present.\n        if env.c11_mode:\n            yield target_filename\n        else:\n            if hasFilenameExtension(filename, \".c\"):\n                target_filename += \"pp\"  # .cpp\" suffix then\n\n                os.rename(filename, target_filename)\n\n            yield target_filename\n\n\ndef makeCLiteral(value):\n    value = value.replace(\"\\\\\", r\"\\\\\")\n    value = value.replace('\"', r\"\\\"\")\n\n    return '\"' + value + '\"'\n\n\ndef createDefinitionsFile(source_dir, filename, definitions):\n    for env_name in os.environ[\"_NUITKA_BUILD_DEFINITIONS_CATALOG\"].split(\",\"):\n        definitions[env_name] = os.environ[env_name]\n\n    build_definitions_filename = os.path.join(source_dir, filename)\n\n    with openTextFile(build_definitions_filename, \"w\", encoding=\"utf8\") as f:\n        for key, value in sorted(definitions.items()):\n            if key == \"_NUITKA_BUILD_DEFINITIONS_CATALOG\":\n                continue\n\n            if type(value) is int or key.endswith((\"_BOOL\", \"_INT\")):\n                if type(value) is bool:\n                    value = int(value)\n                f.write(\"#define %s %s\\n\" % (key, value))\n            elif type(value) in (str, unicode) and key.endswith(\"_WIDE_STRING\"):\n                f.write(\"#define %s L%s\\n\" % (key, makeCLiteral(value)))\n            else:\n                f.write(\"#define %s %s\\n\" % (key, makeCLiteral(value)))\n\n\ndef getMsvcVersionString(env):\n    import SCons.Tool.MSCommon.vc  # pylint: disable=I0021,import-error\n\n    return SCons.Tool.MSCommon.vc.get_default_version(env)\n\n\ndef getMsvcVersion(env):\n    value = getMsvcVersionString(env)\n\n    # TODO: Workaround for prompt being used.\n    if value is None:\n        value = os.getenv(\"VCToolsVersion\", \"14.3\").rsplit(\".\", 1)[0]\n\n    value = value.replace(\"exp\", \"\")\n    return tuple((int(d) for d in value.split(\".\")))\n\n\ndef _getBinaryArch(binary, mingw_mode):\n    if \"linux\" in sys.platform or mingw_mode:\n        assert os.path.exists(binary), binary\n\n        # Binutils binary name, spell-checker: ignore objdump,binutils\n        command = [\"objdump\", \"-f\", binary]\n\n        try:\n            data, _err, rv = executeProcess(command)\n        except OSError:\n            command[0] = \"llvm-objdump\"\n\n            try:\n                data, _err, rv = executeProcess(command)\n            except OSError:\n                return None\n\n        if rv != 0:\n            return None\n\n        if str is not bytes:\n            data = decodeData(data)\n\n        found = None\n\n        for line in data.splitlines():\n            if \" file format \" in line:\n                found = line.split(\" file format \")[-1]\n            if \"\\tfile format \" in line:\n                found = line.split(\"\\tfile format \")[-1]\n\n        if os.name == \"nt\" and found == \"coff-x86-64\":\n            found = \"pei-x86-64\"\n\n        return found\n    else:\n        # TODO: Missing for macOS, FreeBSD, other Linux\n        return None\n\n\n_linker_arch_determined = False\n_linker_arch = None\n\n\ndef getLinkerArch(target_arch, mingw_mode):\n    # Singleton, pylint: disable=global-statement\n    global _linker_arch_determined, _linker_arch\n\n    if not _linker_arch_determined:\n        if os.name == \"nt\":\n            if target_arch == \"x86_64\":\n                _linker_arch = \"pei-x86-64\"\n            elif target_arch == \"arm64\":\n                _linker_arch = \"pei-arm64\"\n            else:\n                _linker_arch = \"pei-i386\"\n        else:\n            _linker_arch = _getBinaryArch(\n                binary=os.environ[\"NUITKA_PYTHON_EXE_PATH\"], mingw_mode=mingw_mode\n            )\n\n        _linker_arch_determined = True\n\n    return _linker_arch\n\n\n_compiler_arch = {}\n\n\ndef getCompilerArch(mingw_mode, msvc_mode, the_cc_name, compiler_path):\n    assert not mingw_mode or not msvc_mode\n\n    if compiler_path not in _compiler_arch:\n        if mingw_mode:\n            _compiler_arch[compiler_path] = _getBinaryArch(\n                binary=compiler_path, mingw_mode=mingw_mode\n            )\n        elif msvc_mode:\n            cmdline = [compiler_path]\n\n            if \"-cl\" in the_cc_name:\n                cmdline.append(\"--version\")\n\n            # The cl.exe without further args will give error\n            stdout, stderr, _rv = executeProcess(\n                command=cmdline,\n            )\n\n            # The MSVC will output on error, while clang outputs in stdout and they\n            # use different names for arches.\n            if b\"x64\" in stderr or b\"x86_64\" in stdout:\n                _compiler_arch[compiler_path] = \"pei-x86-64\"\n            elif b\"x86\" in stderr or b\"i686\" in stdout:\n                _compiler_arch[compiler_path] = \"pei-i386\"\n            elif b\"ARM64\" in stderr:\n                # TODO: The ARM64 output for Clang is not known yet.\n                _compiler_arch[compiler_path] = \"pei-arm64\"\n            else:\n                assert False, (stdout, stderr)\n        else:\n            assert False, compiler_path\n\n    return _compiler_arch[compiler_path]\n\n\ndef decideArchMismatch(target_arch, the_cc_name, compiler_path):\n    mingw_mode = isGccName(the_cc_name) or isClangName(the_cc_name)\n    msvc_mode = not mingw_mode\n\n    linker_arch = getLinkerArch(target_arch=target_arch, mingw_mode=mingw_mode)\n    compiler_arch = getCompilerArch(\n        mingw_mode=mingw_mode,\n        msvc_mode=msvc_mode,\n        the_cc_name=the_cc_name,\n        compiler_path=compiler_path,\n    )\n\n    return linker_arch != compiler_arch, linker_arch, compiler_arch\n\n\ndef raiseNoCompilerFoundErrorExit():\n    if os.name == \"nt\":\n        scons_logger.sysexit(\n            \"\"\"\\\nError, cannot locate suitable C compiler. You have the following options:\n\na) If a suitable Visual Studio version is installed (check above trace\n   outputs for rejection messages), it will be located automatically via\n   registry. But not if you activate the wrong prompt.\n\nb) Using \"--mingw64\" lets Nuitka download MinGW64 for you. Note: MinGW64\n   is the project name, it does *not* mean 64 bits, just a gcc with better\n   Windows compatibility, it is available for 32 and 64 bits. Cygwin based\n   gcc e.g. do not work.\n\"\"\"\n        )\n    else:\n        scons_logger.sysexit(\"Error, cannot locate suitable C compiler.\")\n\n\ndef addBinaryBlobSection(env, blob_filename, section_name):\n    # spell-checker: ignore linkflags, sectcreate\n\n    if isMacOS():\n        env.Append(\n            LINKFLAGS=[\n                \"-Wl,-sectcreate,%(section_name)s,%(section_name)s,%(blob_filename)s\"\n                % {\n                    \"section_name\": section_name,\n                    \"blob_filename\": blob_filename,\n                }\n            ]\n        )\n    else:\n        assert False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/allocator.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_ALLOCATOR_H__\n#define __NUITKA_ALLOCATOR_H__\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// For Python2.6, these assertions cannot be done easily, just disable them with dummy code.\n#if PYTHON_VERSION < 0x270 && !defined(__NUITKA_NO_ASSERT__)\n#define _PyObject_GC_IS_TRACKED(obj) (1)\n#endif\n\n#if PYTHON_VERSION >= 0x380\n// Need to make Py_DECREF a macro again that doesn't call an API\nstatic inline void _Nuitka_Py_DECREF(PyObject *ob) {\n    assert(ob != NULL && ob->ob_refcnt >= 0);\n\n    // Non-limited C API and limited C API for Python 3.9 and older access\n    // directly PyObject.ob_refcnt.\n#ifdef Py_REF_DEBUG\n    _Py_RefTotal--;\n#endif\n    if (--ob->ob_refcnt == 0) {\n        destructor dealloc = Py_TYPE(ob)->tp_dealloc;\n#ifdef Py_TRACE_REFS\n        _Py_ForgetReference(ob);\n#endif\n        (*dealloc)(ob);\n    }\n}\n\n#undef Py_DECREF\n#define Py_DECREF(ob) _Nuitka_Py_DECREF((PyObject *)(ob))\n\n// Need to make Py_XDECREF a macro again that doesn't call an API\nstatic inline void _Nuitka_Py_XDECREF(PyObject *ob) {\n    if (ob != NULL) {\n        assert(ob->ob_refcnt >= 0);\n\n        // Non-limited C API and limited C API for Python 3.9 and older access\n        // directly PyObject.ob_refcnt.\n#ifdef Py_REF_DEBUG\n        _Py_RefTotal--;\n#endif\n        if (--ob->ob_refcnt == 0) {\n            destructor dealloc = Py_TYPE(ob)->tp_dealloc;\n#ifdef Py_TRACE_REFS\n            _Py_ForgetReference(ob);\n#endif\n            (*dealloc)(ob);\n        }\n    }\n}\n\n#undef Py_XDECREF\n#define Py_XDECREF(ob) _Nuitka_Py_XDECREF((PyObject *)(ob))\n\n// Need to make Py_XDECREF a macro again that uses our Py_DECREF\n#undef Py_CLEAR\n#define Py_CLEAR(op)                                                                                                   \\\n    do {                                                                                                               \\\n        PyObject *_py_tmp = (PyObject *)(op);                                                                          \\\n        if (_py_tmp != NULL) {                                                                                         \\\n            (op) = NULL;                                                                                               \\\n            Py_DECREF(_py_tmp);                                                                                        \\\n        }                                                                                                              \\\n    } while (0)\n\n#endif\n\n// Macro introduced with Python3.9 or higher, make it generally available.\n#ifndef Py_SET_TYPE\nstatic inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) { ob->ob_type = type; }\n#define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject *)(ob), type)\n#endif\n\n// After Python 3.9 this was moved into the DLL potentially, making\n// it expensive to call.\n#if PYTHON_VERSION >= 0x390\nstatic void Nuitka_Py_NewReference(PyObject *op) {\n#ifdef Py_REF_DEBUG\n    _Py_RefTotal++;\n#endif\n    Py_SET_REFCNT(op, 1);\n}\n#else\n#define Nuitka_Py_NewReference(op) _Py_NewReference(op)\n#endif\n\nstatic inline int Nuitka_PyType_HasFeature(PyTypeObject *type, unsigned long feature) {\n    return ((type->tp_flags & feature) != 0);\n}\n\n#if PYTHON_VERSION >= 0x3b0\n\nstatic inline size_t Nuitka_PyType_PreHeaderSize(PyTypeObject *tp) {\n    return _PyType_IS_GC(tp) * sizeof(PyGC_Head) +\n           Nuitka_PyType_HasFeature(tp, Py_TPFLAGS_MANAGED_DICT) * 2 * sizeof(PyObject *);\n}\n\nextern void Nuitka_PyObject_GC_Link(PyObject *op);\n\nstatic PyObject *Nuitka_PyType_AllocNoTrackVar(PyTypeObject *type, Py_ssize_t nitems) {\n    // There is always a sentinel now, therefore add one\n    const size_t size = _PyObject_VAR_SIZE(type, nitems + 1);\n\n    // TODO: This ought to be static for all our types, so remove it as a call.\n    const size_t pre_size = Nuitka_PyType_PreHeaderSize(type);\n    assert(pre_size == sizeof(PyGC_Head));\n\n    char *alloc = (char *)PyObject_Malloc(size + pre_size);\n    assert(alloc);\n    PyObject *obj = (PyObject *)(alloc + pre_size);\n\n    assert(pre_size);\n    if (pre_size) {\n        ((PyObject **)alloc)[0] = NULL;\n        ((PyObject **)alloc)[1] = NULL;\n\n        Nuitka_PyObject_GC_Link(obj);\n    }\n\n    // We might be able to avoid this, but it's unclear what e.g. the sentinel\n    // is supposed to be.\n    memset(obj, 0, size);\n\n    // This is the \"var\" branch, we already know we are variable size here.\n    assert(type->tp_itemsize != 0);\n    Py_SET_SIZE((PyVarObject *)obj, nitems);\n\n    // Initialize the object references.\n    Py_SET_TYPE(obj, type);\n    if (Nuitka_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {\n        Py_INCREF(type);\n    }\n\n    Nuitka_Py_NewReference(obj);\n\n    return obj;\n}\n\nstatic PyObject *Nuitka_PyType_AllocNoTrack(PyTypeObject *type) {\n    // TODO: This ought to be static for all our types, so remove it as a call.\n    const size_t pre_size = Nuitka_PyType_PreHeaderSize(type);\n\n    char *alloc = (char *)PyObject_Malloc(_PyObject_SIZE(type) + pre_size);\n    assert(alloc);\n    PyObject *obj = (PyObject *)(alloc + pre_size);\n\n    assert(pre_size);\n    ((PyObject **)alloc)[0] = NULL;\n    ((PyObject **)alloc)[1] = NULL;\n\n    Nuitka_PyObject_GC_Link(obj);\n\n    // Initialize the object references.\n    Py_SET_TYPE(obj, type);\n\n    if (Nuitka_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {\n        Py_INCREF(type);\n    }\n\n    Nuitka_Py_NewReference(obj);\n\n    return obj;\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static void *Nuitka_GC_NewVar(PyTypeObject *type, Py_ssize_t nitems) {\n    assert(nitems >= 0);\n\n#if PYTHON_VERSION < 0x3b0\n    size_t size = _PyObject_VAR_SIZE(type, nitems);\n    PyVarObject *op = (PyVarObject *)_PyObject_GC_Malloc(size);\n    assert(op != NULL);\n\n    Py_SIZE(op) = nitems;\n    Py_SET_TYPE(op, type);\n\n#if PYTHON_VERSION >= 0x380\n    // TODO: Might have two variants, or more sure this is also false for all of our types,\n    // we are just wasting time for compiled times here.\n    if (Nuitka_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {\n        Py_INCREF(type);\n    }\n#endif\n\n    Nuitka_Py_NewReference((PyObject *)op);\n\n    return op;\n#else\n    // TODO: We ought to inline this probably too, no point as a separate function.\n    PyObject *op = Nuitka_PyType_AllocNoTrackVar(type, nitems);\n#endif\n    assert(Py_SIZE(op) == nitems);\n    return op;\n}\n\nNUITKA_MAY_BE_UNUSED static void *Nuitka_GC_New(PyTypeObject *type) {\n#if PYTHON_VERSION < 0x3b0\n    size_t size = _PyObject_SIZE(type);\n\n    PyVarObject *op = (PyVarObject *)_PyObject_GC_Malloc(size);\n    assert(op != NULL);\n\n    Py_SET_TYPE(op, type);\n\n#if PYTHON_VERSION >= 0x380\n    // TODO: Might have two variants, or more sure this is also false for all of our types,\n    // we are just wasting time for compiled times here.\n    if (Nuitka_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {\n        Py_INCREF(type);\n    }\n#endif\n\n    Nuitka_Py_NewReference((PyObject *)op);\n#else\n    // TODO: We ought to inline this probably too, no point as a separate function.\n    PyObject *op = Nuitka_PyType_AllocNoTrack(type);\n#endif\n    return op;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/builtins.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_BUILTINS_H__\n#define __NUITKA_BUILTINS_H__\n\nextern PyModuleObject *builtin_module;\nextern PyDictObject *dict_builtin;\n\n#include \"nuitka/calling.h\"\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_BUILTIN(PyObject *name) {\n    CHECK_OBJECT(dict_builtin);\n    CHECK_OBJECT(name);\n    assert(Nuitka_String_CheckExact(name));\n\n    PyObject *result = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)name);\n\n    // This is assumed to not fail, abort if it does.\n    if (unlikely(result == NULL)) {\n        PyErr_PrintEx(0);\n        Py_Exit(1);\n    }\n\n    CHECK_OBJECT(result);\n\n    return result;\n}\n\n// Returns a reference.\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_BUILTIN_STR(char const *name) {\n    CHECK_OBJECT(dict_builtin);\n\n    PyObject *result = PyDict_GetItemString((PyObject *)dict_builtin, name);\n\n    // This is assumed to not fail, abort if it does.\n    if (unlikely(result == NULL)) {\n        PyErr_PrintEx(0);\n        Py_Exit(1);\n    }\n\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nextern void _initBuiltinModule(void);\n\n#define NUITKA_DECLARE_BUILTIN(name) extern PyObject *_python_original_builtin_value_##name;\n#define NUITKA_DEFINE_BUILTIN(name) PyObject *_python_original_builtin_value_##name = NULL;\n#define NUITKA_ASSIGN_BUILTIN(name)                                                                                    \\\n    if (_python_original_builtin_value_##name == NULL)                                                                 \\\n        _python_original_builtin_value_##name = LOOKUP_BUILTIN_STR(#name);\n#define NUITKA_UPDATE_BUILTIN(name, value) _python_original_builtin_value_##name = value;\n#define NUITKA_ACCESS_BUILTIN(name) (_python_original_builtin_value_##name)\n\n#ifdef _NUITKA_EXE\n// Original builtin values, currently only used for assertions.\nNUITKA_DECLARE_BUILTIN(type);\nNUITKA_DECLARE_BUILTIN(len);\nNUITKA_DECLARE_BUILTIN(range);\nNUITKA_DECLARE_BUILTIN(repr);\nNUITKA_DECLARE_BUILTIN(int);\nNUITKA_DECLARE_BUILTIN(iter);\n#if PYTHON_VERSION < 0x300\nNUITKA_DECLARE_BUILTIN(long);\n#endif\n\nextern void _initBuiltinOriginalValues(void);\n#endif\n\n// Avoid the casts needed for older Python, as it's easily forgotten and\n// potentially have our own better implementation later. Gives no reference.\n// TODO: Can do it ourselves once DICT_GET_ITEM_WITH_ERROR becomes available.\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_SysGetObject(char const *name) { return PySys_GetObject((char *)name); }\n\nNUITKA_MAY_BE_UNUSED static void Nuitka_SysSetObject(char const *name, PyObject *value) {\n    // TODO: Check error in debug mode at least.\n    PySys_SetObject((char *)name, value);\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/calling.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_CALLING_H__\n#define __NUITKA_CALLING_H__\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// For exception test formatting and call code mostly.\nextern char const *GET_CALLABLE_NAME(PyObject *object);\nextern char const *GET_CALLABLE_DESC(PyObject *object);\nextern char const *GET_CLASS_NAME(PyObject *klass);\nextern char const *GET_INSTANCE_CLASS_NAME(PyThreadState *tstate, PyObject *instance);\n\n// Also used in generated helper code.\nNUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_CheckFunctionResult(PyThreadState *tstate, PyObject *callable,\n                                                                        PyObject *result) {\n    if (result == NULL) {\n        if (unlikely(!HAS_ERROR_OCCURRED(tstate))) {\n#if PYTHON_VERSION < 0x3b0\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_SystemError, \"NULL result without error from call\");\n#else\n            PyErr_Format(PyExc_SystemError, \"%R returned NULL without setting an exception\", callable);\n#endif\n        }\n\n        return NULL;\n    } else {\n        // Some buggy C functions do this, and Nuitka inner workings can get\n        // upset from it.\n        if (unlikely(DROP_ERROR_OCCURRED(tstate))) {\n            Py_DECREF(result);\n\n#if PYTHON_VERSION < 0x3a0\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_SystemError, \"result with error set from call\");\n#elif PYTHON_VERSION < 0x3b0\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_SystemError, \"result with exception set from call\");\n#else\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_SystemError, \"%s() returned a result with an exception set\",\n                                                GET_CALLABLE_NAME(callable));\n#endif\n            return NULL;\n        }\n\n        return result;\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION(PyThreadState *tstate, PyObject *function_object,\n                                                    PyObject *positional_args, PyObject *named_args) {\n    // Not allowed to enter with an error set. This often catches leaked errors from\n    // elsewhere.\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    CHECK_OBJECT(function_object);\n    CHECK_OBJECT(positional_args);\n    assert(named_args == NULL || Py_REFCNT(named_args) > 0);\n\n    ternaryfunc call_slot = Py_TYPE(function_object)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", function_object);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *result = (*call_slot)(function_object, positional_args, named_args);\n\n    Py_LeaveRecursiveCall();\n\n    return Nuitka_CheckFunctionResult(tstate, function_object, result);\n}\n\n// Function call variant with no arguments provided at all.\nextern PyObject *CALL_FUNCTION_NO_ARGS(PyThreadState *tstate, PyObject *called);\n\n// Function call variants with positional arguments tuple.\nNUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION_WITH_POSARGS(PyThreadState *tstate, PyObject *function_object,\n                                                                 PyObject *positional_args) {\n    return CALL_FUNCTION(tstate, function_object, positional_args, NULL);\n}\n\n// Method call variants with positional arguments tuple.\nextern PyObject *CALL_METHOD_WITH_POSARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                          PyObject *positional_args);\n\n// TODO: Specialize in template too.\nNUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION_WITH_KEYARGS(PyThreadState *tstate, PyObject *function_object,\n                                                                 PyObject *named_args) {\n    return CALL_FUNCTION(tstate, function_object, const_tuple_empty, named_args);\n}\n\n// Call built-in functions with using defaulted values.\nextern PyObject *CALL_BUILTIN_KW_ARGS(PyThreadState *tstate, PyObject *callable, PyObject **args,\n                                      char const **arg_names, int max_args);\n\n// For abstract class instantiation error message, during call.\nextern void formatCannotInstantiateAbstractClass(PyThreadState *tstate, PyTypeObject *type);\n\n#include \"nuitka/helper/calling_generated.h\"\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/checkers.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_CHECKERS_H__\n#define __NUITKA_CHECKERS_H__\n\n// Helper to check that an object is valid and has positive reference count.\n#define CHECK_OBJECT(value) (assert((value) != NULL), assert(Py_REFCNT(value) > 0))\n#define CHECK_OBJECT_X(value) (assert((value) == NULL || Py_REFCNT(value) > 0))\n\n// Helper to check an array of objects with CHECK_OBJECT\n#ifndef __NUITKA_NO_ASSERT__\n#define CHECK_OBJECTS(values, count)                                                                                   \\\n    {                                                                                                                  \\\n        for (int i = 0; i < count; i++) {                                                                              \\\n            CHECK_OBJECT((values)[i]);                                                                                 \\\n        }                                                                                                              \\\n    }\n#else\n#define CHECK_OBJECTS(values, count)\n#endif\n\nextern void CHECK_OBJECT_DEEP(PyObject *value);\nextern void CHECK_OBJECTS_DEEP(PyObject *const *values, Py_ssize_t size);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/checksum_tools.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_CHECKSUM_TOOLS_H__\n#define __NUITKA_CHECKSUM_TOOLS_H__\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nextern uint32_t calcCRC32(unsigned char const *message, uint32_t size);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_asyncgen.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_ASYNCGEN_H__\n#define __NUITKA_COMPILED_ASYNCGEN_H__\n\n// Compiled async generator type, asyncgen in short.\n\n// Another cornerstone of the integration into CPython. Try to behave as well as\n// normal asyncgen objects do or even better.\n\n#if PYTHON_VERSION >= 0x360\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// The Nuitka_AsyncgenObject is the storage associated with a compiled\n// async generator object instance of which there can be many for each code.\nstruct Nuitka_AsyncgenObject {\n    /* Python object folklore: */\n    PyObject_VAR_HEAD\n\n        PyObject *m_name;\n\n    // TODO: Only to make traceback for non-started throw\n    PyObject *m_module;\n\n    PyObject *m_qualname;\n    PyObject *m_yield_from;\n\n    // Weak references are supported for asyncgen objects in CPython.\n    PyObject *m_weakrefs;\n\n    int m_running;\n\n    // When an asyncgen is awaiting, this flag is set.\n    int m_awaiting;\n\n#if PYTHON_VERSION >= 0x380\n    // When an asyncgen is running, this is set\n    int m_running_async;\n#endif\n\n    void *m_code;\n\n    // The parent frame of the asyncgen, if created.\n    struct Nuitka_FrameObject *m_frame;\n\n    PyCodeObject *m_code_object;\n\n    // While yielding, this was the frame currently active, restore when\n    // resuming.\n    Nuitka_ThreadStateFrameType *m_resume_frame;\n\n    // Was it ever used, is it still running, or already finished.\n    Generator_Status m_status;\n\n#if PYTHON_VERSION >= 0x370\n    struct Nuitka_ExceptionStackItem m_exc_state;\n#endif\n\n    // The label index to resume after yield.\n    int m_yield_return_index;\n\n    // The finalizer associated through a hook\n    PyObject *m_finalizer;\n\n    // The hooks were initialized\n    bool m_hooks_init_done;\n\n    // It is closed, and cannot be closed again.\n    bool m_closed;\n\n    // A kind of uuid for the generator object, used in comparisons.\n    long m_counter;\n\n    /* The heap of generator objects at run time. */\n    void *m_heap_storage;\n\n    /* Closure variables given, if any, we reference cells here. The last\n     * part is dynamically allocated, the array size differs per asyncgen\n     * and includes the heap storage.\n     */\n    Py_ssize_t m_closure_given;\n    struct Nuitka_CellObject *m_closure[1];\n};\n\nextern PyTypeObject Nuitka_Asyncgen_Type;\n\ntypedef PyObject *(*asyncgen_code)(PyThreadState *tstate, struct Nuitka_AsyncgenObject *, PyObject *);\n\nextern PyObject *Nuitka_Asyncgen_New(asyncgen_code code, PyObject *module, PyObject *name, PyObject *qualname,\n                                     PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                                     Py_ssize_t closure_given, Py_ssize_t heap_storage_size);\n\nstatic inline bool Nuitka_Asyncgen_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Asyncgen_Type; }\n\nstatic inline void SAVE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen) {\n    /* Before Python3.7: When yielding from an exception handler in Python3,\n     * the exception preserved to the frame is restored, while the current one\n     * is put as there.\n     *\n     * Python3.7: The exception is preserved in the asyncgen object itself\n     * which has a new \"m_exc_state\" structure just for that.\n     */\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SAVE_ASYNCGEN_EXCEPTION: Enter\\n\");\n    PRINT_EXCEPTION(saved_exception_type, saved_exception_value, saved_exception_traceback);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = asyncgen->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = asyncgen->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, asyncgen->m_exc_state.exception_tb);\n#endif\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SAVE_ASYNCGEN_EXCEPTION: Leave\\n\");\n    PRINT_EXCEPTION(EXC_TYPE(tstate), EXC_VALUE(tstate), EXC_TRACEBACK(tstate));\n#endif\n\n#if PYTHON_VERSION < 0x370\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    asyncgen->m_exc_state.exception_type = saved_exception_type;\n#endif\n    asyncgen->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    asyncgen->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n}\n\nstatic inline void RESTORE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen) {\n    // When returning from yield, the exception of the frame is preserved, and\n    // the one that enters should be there.\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"RESTORE_ASYNCGEN_EXCEPTION: Enter\\n\");\n    PRINT_EXCEPTION(saved_exception_type, saved_exception_value, saved_exception_traceback);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = asyncgen->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = asyncgen->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, asyncgen->m_exc_state.exception_tb);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    asyncgen->m_exc_state.exception_type = saved_exception_type;\n#endif\n    asyncgen->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    asyncgen->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"RESTORE_ASYNCGEN_EXCEPTION: Leave\\n\");\n    PRINT_EXCEPTION(EXC_TYPE(tstate), EXC_VALUE(tstate), EXC_TRACEBACK(tstate));\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(EXC_TYPE(tstate));\n#endif\n    CHECK_OBJECT_X(EXC_VALUE(tstate));\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(EXC_TRACEBACK(tstate));\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static void STORE_ASYNCGEN_EXCEPTION(PyThreadState *tstate,\n                                                          struct Nuitka_AsyncgenObject *asyncgen) {\n\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE_F(asyncgen) = EXC_TYPE(tstate);\n    if (EXC_TYPE_F(asyncgen) == Py_None)\n        EXC_TYPE_F(asyncgen) = NULL;\n    Py_XINCREF(EXC_TYPE_F(asyncgen));\n#endif\n    EXC_VALUE_F(asyncgen) = EXC_VALUE(tstate);\n    Py_XINCREF(EXC_VALUE_F(asyncgen));\n#if PYTHON_VERSION < 0x3b0\n    ASSIGN_EXC_TRACEBACK_F(asyncgen, EXC_TRACEBACK(tstate));\n    Py_XINCREF(EXC_TRACEBACK_F(asyncgen));\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static void DROP_ASYNCGEN_EXCEPTION(struct Nuitka_AsyncgenObject *asyncgen) {\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TYPE_F(asyncgen));\n#endif\n    Py_CLEAR(EXC_VALUE_F(asyncgen));\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TRACEBACK_F(asyncgen));\n#endif\n}\n\n// For reference count debugging.\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Asyncgen_Type;\nextern int count_allocated_Nuitka_Asyncgen_Type;\nextern int count_released_Nuitka_Asyncgen_Type;\n\nextern int count_active_Nuitka_AsyncgenValueWrapper_Type;\nextern int count_allocated_Nuitka_AsyncgenValueWrapper_Type;\nextern int count_released_Nuitka_AsyncgenValueWrapper_Type;\n\nextern int count_active_Nuitka_AsyncgenAsend_Type;\nextern int count_allocated_Nuitka_AsyncgenAsend_Type;\nextern int count_released_Nuitka_AsyncgenAsend_Type;\n\nextern int count_active_Nuitka_AsyncgenAthrow_Type;\nextern int count_allocated_Nuitka_AsyncgenAthrow_Type;\nextern int count_released_Nuitka_AsyncgenAthrow_Type;\n\n#endif\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_cell.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_CELL_H__\n#define __NUITKA_COMPILED_CELL_H__\n\n/* This is a clone of the normal PyCell structure. We should keep it binary\n * compatible, just in case somebody crazy insists on it.\n */\n\nextern PyTypeObject Nuitka_Cell_Type;\n\nstatic inline bool Nuitka_Cell_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Cell_Type; }\n\nstruct Nuitka_CellObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        /* Content of the cell or NULL when empty */\n        PyObject *ob_ref;\n};\n\n// Create cell with out value, and with or without reference given.\nextern struct Nuitka_CellObject *Nuitka_Cell_NewEmpty(void);\nextern struct Nuitka_CellObject *Nuitka_Cell_New0(PyObject *value);\nextern struct Nuitka_CellObject *Nuitka_Cell_New1(PyObject *value);\n\n// Check stuff while accessing a compile cell in debug mode.\n#ifdef __NUITKA_NO_ASSERT__\n#define Nuitka_Cell_GET(cell) (((struct Nuitka_CellObject *)(cell))->ob_ref)\n#else\n#define Nuitka_Cell_GET(cell)                                                                                          \\\n    (CHECK_OBJECT(cell), assert(Nuitka_Cell_Check((PyObject *)cell)), (((struct Nuitka_CellObject *)(cell))->ob_ref))\n#endif\n\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Cell_Type;\nextern int count_allocated_Nuitka_Cell_Type;\nextern int count_released_Nuitka_Cell_Type;\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_coroutine.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_COROUTINE_H__\n#define __NUITKA_COMPILED_COROUTINE_H__\n\n// Compiled coroutine type.\n\n// Another cornerstone of the integration into CPython. Try to behave as well as\n// normal coroutine objects do or even better.\n\n#if PYTHON_VERSION >= 0x350\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// The Nuitka_CoroutineObject is the storage associated with a compiled\n// coroutine object instance of which there can be many for each code.\nstruct Nuitka_CoroutineObject {\n    /* Python object folklore: */\n    PyObject_VAR_HEAD\n\n        PyObject *m_name;\n\n    // TODO: Only to make traceback for non-started throw\n    PyObject *m_module;\n\n    PyObject *m_qualname;\n    PyObject *m_yield_from;\n\n    // Weak references are supported for coroutine objects in CPython.\n    PyObject *m_weakrefs;\n\n    int m_running;\n\n    // When a coroutine is awaiting, this flag is set.\n    int m_awaiting;\n\n    void *m_code;\n\n    // The parent frame of the coroutine, if created.\n    struct Nuitka_FrameObject *m_frame;\n\n    PyCodeObject *m_code_object;\n\n    // While yielding, this was the frame currently active, restore when\n    // resuming.\n    Nuitka_ThreadStateFrameType *m_resume_frame;\n\n    // Was it ever used, is it still running, or already finished.\n    Generator_Status m_status;\n\n#if PYTHON_VERSION >= 0x370\n    struct Nuitka_ExceptionStackItem m_exc_state;\n\n    // The cr_origin attribute.\n    PyObject *m_origin;\n#endif\n\n    // The label index to resume after yield.\n    int m_yield_return_index;\n\n    // Returned value if yielded value is NULL, is\n    // NULL if not a return\n    PyObject *m_returned;\n\n    // A kind of uuid for the coroutine object, used in comparisons.\n    long m_counter;\n\n    /* The heap of coroutine objects at run time. */\n    void *m_heap_storage;\n\n    /* Closure variables given, if any, we reference cells here. The last\n     * part is dynamically allocated, the array size differs per coroutine\n     * and includes the heap storage.\n     */\n    Py_ssize_t m_closure_given;\n    struct Nuitka_CellObject *m_closure[1];\n};\n\nextern PyTypeObject Nuitka_Coroutine_Type;\n\ntypedef PyObject *(*coroutine_code)(PyThreadState *tstate, struct Nuitka_CoroutineObject *, PyObject *);\n\nextern PyObject *Nuitka_Coroutine_New(PyThreadState *tstate, coroutine_code code, PyObject *module, PyObject *name,\n                                      PyObject *qualname, PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                                      Py_ssize_t closure_given, Py_ssize_t heap_storage_size);\n\nstatic inline bool Nuitka_Coroutine_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Coroutine_Type; }\n\nstruct Nuitka_CoroutineWrapperObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        struct Nuitka_CoroutineObject *m_coroutine;\n};\n\nextern PyTypeObject Nuitka_CoroutineWrapper_Type;\n\nstatic inline bool Nuitka_CoroutineWrapper_Check(PyObject *object) {\n    return Py_TYPE(object) == &Nuitka_CoroutineWrapper_Type;\n}\n\nstatic inline void SAVE_COROUTINE_EXCEPTION(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine) {\n    /* Before Python3.7: When yielding from an exception handler in Python3,\n     * the exception preserved to the frame is restored, while the current one\n     * is put as there.\n     *\n     * Python3.7: The exception is preserved in the coroutine object itself\n     * which has a new \"m_exc_state\" structure just for that.\n     */\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = coroutine->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = coroutine->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, coroutine->m_exc_state.exception_tb);\n#endif\n#endif\n\n#if PYTHON_VERSION < 0x370\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    coroutine->m_exc_state.exception_type = saved_exception_type;\n#endif\n    coroutine->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    coroutine->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n}\n\nstatic inline void RESTORE_COROUTINE_EXCEPTION(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine) {\n    // When returning from yield, the exception of the frame is preserved, and\n    // the one that enters should be there.\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = coroutine->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = coroutine->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, coroutine->m_exc_state.exception_tb);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    coroutine->m_exc_state.exception_type = saved_exception_type;\n#endif\n    coroutine->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    coroutine->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n}\n\n#ifdef __cplusplus\nenum Await_Kind {\n    await_normal, // user provided \"await\"\n    await_enter,  // async with statement \"__enter__\"\n    await_exit    // async with statement \"__enter__\"\n};\n#else\ntypedef int Generator_Status;\nstatic const int await_normal = 0;\nstatic const int await_enter = 1;\nstatic const int await_exit = 2;\n#endif\n\n// Create the object to await for async for \"iter\".\nextern PyObject *ASYNC_MAKE_ITERATOR(PyThreadState *tstate, PyObject *value);\n\n// Create the object to await for async for \"next\".\nextern PyObject *ASYNC_ITERATOR_NEXT(PyThreadState *tstate, PyObject *value);\n\n// Create the object for plain \"await\".\nextern PyObject *ASYNC_AWAIT(PyThreadState *tstate, PyObject *awaitable, int await_kind);\n\nNUITKA_MAY_BE_UNUSED static void STORE_COROUTINE_EXCEPTION(PyThreadState *tstate,\n                                                           struct Nuitka_CoroutineObject *coroutine) {\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE_F(coroutine) = EXC_TYPE(tstate);\n    if (EXC_TYPE_F(coroutine) == Py_None)\n        EXC_TYPE_F(coroutine) = NULL;\n    Py_XINCREF(EXC_TYPE_F(coroutine));\n#endif\n    EXC_VALUE_F(coroutine) = EXC_VALUE(tstate);\n    Py_XINCREF(EXC_VALUE_F(coroutine));\n#if PYTHON_VERSION < 0x3b0\n    ASSIGN_EXC_TRACEBACK_F(coroutine, EXC_TRACEBACK(tstate));\n    Py_XINCREF(EXC_TRACEBACK_F(coroutine));\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static void DROP_COROUTINE_EXCEPTION(struct Nuitka_CoroutineObject *coroutine) {\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TYPE_F(coroutine));\n#endif\n    Py_CLEAR(EXC_VALUE_F(coroutine));\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TRACEBACK_F(coroutine));\n#endif\n}\n\n// For reference count debugging.\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Coroutine_Type;\nextern int count_allocated_Nuitka_Coroutine_Type;\nextern int count_released_Nuitka_Coroutine_Type;\n\nextern int count_active_Nuitka_CoroutineWrapper_Type;\nextern int count_allocated_Nuitka_CoroutineWrapper_Type;\nextern int count_released_Nuitka_CoroutineWrapper_Type;\n\nextern int count_active_Nuitka_AIterWrapper_Type;\nextern int count_allocated_Nuitka_AIterWrapper_Type;\nextern int count_released_Nuitka_AIterWrapper_Type;\n#endif\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_frame.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_FRAME_H__\n#define __NUITKA_COMPILED_FRAME_H__\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Removed flag in 3.11, but we keep code compatible for now. We do not use old\n// value, but 0 because it might get re-used. TODO: Probably better to #ifdef\n// usages of it away.\n#if PYTHON_VERSION >= 0x3b0\n#define CO_NOFREE 0\n#endif\n\n// With Python 3.11 or higher, a lightweight object needs to be put into thread\n// state, rather than the full blown frame, that is more similar to current\n// Nuitka frames.\n#if PYTHON_VERSION < 0x3b0\ntypedef PyFrameObject Nuitka_ThreadStateFrameType;\n#else\ntypedef _PyInterpreterFrame Nuitka_ThreadStateFrameType;\n#endif\n\n// Print a description of given frame objects in frame debug mode\n#if _DEBUG_FRAME\nextern void PRINT_TOP_FRAME(char const *prefix);\nextern void PRINT_PYTHON_FRAME(char const *prefix, PyFrameObject *frame);\nextern void PRINT_COMPILED_FRAME(char const *prefix, struct Nuitka_FrameObject *frame);\nextern void PRINT_INTERPRETER_FRAME(char const *prefix, Nuitka_ThreadStateFrameType *frame);\n#else\n#define PRINT_TOP_FRAME(prefix)\n#define PRINT_PYTHON_FRAME(prefix, frame)\n#define PRINT_COMPILED_FRAME(prefix, frame)\n#define PRINT_INTERPRETER_FRAME(prefix, frame)\n#endif\n\n// Create a frame object for the given code object, frame or module.\nextern struct Nuitka_FrameObject *MAKE_MODULE_FRAME(PyCodeObject *code, PyObject *module);\nextern struct Nuitka_FrameObject *MAKE_FUNCTION_FRAME(PyThreadState *tstate, PyCodeObject *code, PyObject *module,\n                                                      Py_ssize_t locals_size);\nextern struct Nuitka_FrameObject *MAKE_CLASS_FRAME(PyThreadState *tstate, PyCodeObject *code, PyObject *module,\n                                                   PyObject *f_locals, Py_ssize_t locals_size);\n\n// Create a code object for the given filename and function name\n\n#if PYTHON_VERSION < 0x300\n#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count,       \\\n                         kw_only_count, pos_only_count)                                                                \\\n    makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count)\nextern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,\n                                    PyObject *argnames, PyObject *freevars, int arg_count);\n#elif PYTHON_VERSION < 0x380\n#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count,       \\\n                         kw_only_count, pos_only_count)                                                                \\\n    makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count, kw_only_count)\nextern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,\n                                    PyObject *argnames, PyObject *freevars, int arg_count, int kw_only_count);\n#elif PYTHON_VERSION < 0x3b0\n#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count,       \\\n                         kw_only_count, pos_only_count)                                                                \\\n    makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count, kw_only_count, pos_only_count)\nextern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,\n                                    PyObject *argnames, PyObject *freevars, int arg_count, int kw_only_count,\n                                    int pos_only_count);\n#else\n#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count,       \\\n                         kw_only_count, pos_only_count)                                                                \\\n    makeCodeObject(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count,             \\\n                   kw_only_count, pos_only_count)\nextern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,\n                                    PyObject *function_qualname, PyObject *argnames, PyObject *freevars, int arg_count,\n                                    int kw_only_count, int pos_only_count);\n#endif\n\nNUITKA_MAY_BE_UNUSED static inline bool isFakeCodeObject(PyCodeObject *code) {\n#if PYTHON_VERSION < 0x300\n    return code->co_code == const_str_empty;\n#elif PYTHON_VERSION < 0x3b0\n    return code->co_code == const_str_empty;\n#elif PYTHON_VERSION < 0x3c0\n    return _PyCode_CODE(code)[0] == 0;\n#else\n    _Py_CODEUNIT *code_unit = _PyCode_CODE(code);\n    return code_unit->op.code == 0;\n#endif\n}\n\nextern PyTypeObject Nuitka_Frame_Type;\n\nstatic inline bool Nuitka_Frame_Check(PyObject *object) {\n    CHECK_OBJECT(object);\n    return Py_TYPE(object) == &Nuitka_Frame_Type;\n}\n\nstruct Nuitka_FrameObject {\n    PyFrameObject m_frame;\n\n#if PYTHON_VERSION >= 0x3b0\n    PyObject *m_generator;\n    PyFrameState m_frame_state;\n    _PyInterpreterFrame m_interpreter_frame;\n\n    // In Python 3.11, the frame object is no longer variable size, and as such\n    // we inherit the wrong kind of header, not PyVarObject, leading to f_back\n    // the PyFrameObject and and ob_size aliasing, which is not good, but we\n    // want to expose the same binary interface, while still being variable size,\n    // so what we do is to preserve the size in this field instead.\n    Py_ssize_t m_ob_size;\n\n#endif\n\n    // Our own extra stuff, attached variables.\n    char const *m_type_description;\n    char m_locals_storage[1];\n};\n\ninline static void CHECK_CODE_OBJECT(PyCodeObject *code_object) { CHECK_OBJECT(code_object); }\n\nNUITKA_MAY_BE_UNUSED static inline bool isFrameUnusable(struct Nuitka_FrameObject *frame_object) {\n    CHECK_OBJECT_X(frame_object);\n\n    bool result =\n        // Never used.\n        frame_object == NULL ||\n        // Still in use\n        Py_REFCNT(frame_object) > 1 ||\n#if PYTHON_VERSION < 0x340\n        // Last used by another thread (TODO: Could just set it when re-using)\n        frame_object->m_frame.f_tstate != PyThreadState_GET() ||\n#endif\n        // Not currently linked.\n        frame_object->m_frame.f_back != NULL;\n\n#if _DEBUG_REFRAME\n    if (result && frame_object != NULL) {\n        PRINT_COMPILED_FRAME(\"NOT REUSING FRAME:\", frame_object);\n    }\n#endif\n\n    return result;\n}\n\n#if _DEBUG_REFCOUNTS\nextern int count_active_frame_cache_instances;\nextern int count_allocated_frame_cache_instances;\nextern int count_released_frame_cache_instances;\nextern int count_hit_frame_cache_instances;\n#endif\n\n#if _DEBUG_FRAME\nextern void dumpFrameStack(void);\n#endif\n\ninline static PyCodeObject *Nuitka_Frame_GetCodeObject(PyFrameObject *frame) {\n#if PYTHON_VERSION >= 0x3b0\n    assert(frame->f_frame);\n    return frame->f_frame->f_code;\n#else\n    return frame->f_code;\n#endif\n}\n\ninline static void assertPythonFrameObject(PyFrameObject *frame_object) {\n\n    // TODO: Need to do this manually, as this is making frame caching code\n    // vulnerable to mistakes, but so far the compiled frame type is private\n    // assert(PyObject_IsInstance((PyObject *)frame_object, (PyObject *)&PyFrame_Type));\n\n    CHECK_CODE_OBJECT(Nuitka_Frame_GetCodeObject(frame_object));\n}\n\ninline static void assertFrameObject(struct Nuitka_FrameObject *frame_object) {\n    CHECK_OBJECT(frame_object);\n\n    // TODO: Need to do this manually, as this is making frame caching code\n    // vulnerable to mistakes, but so far the compiled frame type is private\n    // assert(PyObject_IsInstance((PyObject *)frame_object, (PyObject *)&PyFrame_Type));\n\n    assertPythonFrameObject(&frame_object->m_frame);\n}\n\ninline static void assertThreadFrameObject(Nuitka_ThreadStateFrameType *frame) {\n#if PYTHON_VERSION < 0x3b0\n    assertPythonFrameObject(frame);\n#else\n    // For uncompiled frames of Python 3.11 these often do not exist. TODO: Figure\n    // out what to check or how to know it's a compiled one.\n    if (frame->frame_obj) {\n        assertPythonFrameObject(frame->frame_obj);\n    }\n#endif\n}\n\n// Mark frame as currently executed. Starting with Python 3.4 that means it\n// can or cannot be cleared, or should lead to a generator close. For Python2\n// this is a no-op. Using a define to spare the compile from inlining an empty\n// function.\n#if PYTHON_VERSION >= 0x340\n\n#if PYTHON_VERSION < 0x3b0\n\nstatic inline void Nuitka_PythonFrame_MarkAsExecuting(PyFrameObject *frame) {\n#if PYTHON_VERSION >= 0x3a0\n    frame->f_state = FRAME_EXECUTING;\n#else\n    frame->f_executing = 1;\n#endif\n}\n\n#endif\n\nstatic inline void Nuitka_Frame_MarkAsExecuting(struct Nuitka_FrameObject *frame) {\n    CHECK_OBJECT(frame);\n#if PYTHON_VERSION >= 0x3b0\n    frame->m_frame_state = FRAME_EXECUTING;\n#elif PYTHON_VERSION >= 0x3a0\n    frame->m_frame.f_state = FRAME_EXECUTING;\n#else\n    frame->m_frame.f_executing = 1;\n#endif\n}\n#else\n#define Nuitka_Frame_MarkAsExecuting(frame) ;\n#endif\n\n#if PYTHON_VERSION >= 0x340\nstatic inline void Nuitka_Frame_MarkAsNotExecuting(struct Nuitka_FrameObject *frame) {\n    CHECK_OBJECT(frame);\n#if PYTHON_VERSION >= 0x3b0\n    frame->m_frame_state = FRAME_SUSPENDED;\n#elif PYTHON_VERSION >= 0x3a0\n    frame->m_frame.f_state = FRAME_SUSPENDED;\n#else\n    frame->m_frame.f_executing = 0;\n#endif\n}\n#else\n#define Nuitka_Frame_MarkAsNotExecuting(frame) ;\n#define Nuitka_PythonFrame_MarkAsExecuting(frame) ;\n#endif\n\n#if PYTHON_VERSION >= 0x340\nstatic inline bool Nuitka_Frame_IsExecuting(struct Nuitka_FrameObject *frame) {\n    CHECK_OBJECT(frame);\n#if PYTHON_VERSION >= 0x3b0\n    return frame->m_frame_state == FRAME_EXECUTING;\n#elif PYTHON_VERSION >= 0x3a0\n    return frame->m_frame.f_state == FRAME_EXECUTING;\n#else\n    return frame->m_frame.f_executing == 1;\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\nNUITKA_MAY_BE_UNUSED inline static void pushFrameStackInterpreterFrame(PyThreadState *tstate,\n                                                                       _PyInterpreterFrame *interpreter_frame) {\n    _PyInterpreterFrame *old = tstate->cframe->current_frame;\n    interpreter_frame->previous = old;\n    tstate->cframe->current_frame = interpreter_frame;\n\n    if (old != NULL && interpreter_frame->frame_obj) {\n        interpreter_frame->frame_obj->f_back = old->frame_obj;\n        Py_XINCREF(old->frame_obj);\n    }\n}\n#else\n// Put frame at the top of the frame stack and mark as executing.\nNUITKA_MAY_BE_UNUSED inline static void pushFrameStackPythonFrame(PyThreadState *tstate, PyFrameObject *frame_object) {\n    PRINT_TOP_FRAME(\"Normal push entry top frame:\");\n    PRINT_COMPILED_FRAME(\"Pushing:\", frame_object);\n\n    // Make sure it's healthy.\n    assertPythonFrameObject(frame_object);\n\n    PyFrameObject *old = tstate->frame;\n    CHECK_OBJECT_X(old);\n\n    if (old) {\n        assertPythonFrameObject(old);\n        CHECK_CODE_OBJECT(old->f_code);\n    }\n\n    // No recursion with identical frames allowed, assert against it.\n    assert(old != frame_object);\n\n    // Push the new frame as the currently active one.\n    tstate->frame = frame_object;\n\n    // Transfer ownership of old frame.\n    if (old != NULL) {\n\n        frame_object->f_back = old;\n    }\n\n    Nuitka_PythonFrame_MarkAsExecuting(frame_object);\n    Py_INCREF(frame_object);\n\n    PRINT_TOP_FRAME(\"Normal push exit top frame:\");\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED inline static void pushFrameStackCompiledFrame(PyThreadState *tstate,\n                                                                    struct Nuitka_FrameObject *frame_object) {\n#if PYTHON_VERSION < 0x3b0\n    pushFrameStackPythonFrame(tstate, &frame_object->m_frame);\n#else\n    pushFrameStackInterpreterFrame(tstate, &frame_object->m_interpreter_frame);\n\n    Nuitka_Frame_MarkAsExecuting(frame_object);\n    Py_INCREF(frame_object);\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED inline static void popFrameStack(PyThreadState *tstate) {\n#if _DEBUG_FRAME\n    PRINT_TOP_FRAME(\"Normal pop entry top frame:\");\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    struct Nuitka_FrameObject *frame_object = (struct Nuitka_FrameObject *)(tstate->frame);\n    CHECK_OBJECT(frame_object);\n\n#if _DEBUG_FRAME\n    printf(\"Taking off frame %s %s\\n\", Nuitka_String_AsString(PyObject_Str((PyObject *)frame_object)),\n           Nuitka_String_AsString(PyObject_Repr((PyObject *)Nuitka_Frame_GetCodeObject(&frame_object->m_frame))));\n#endif\n\n    // Put previous frame on top.\n    tstate->frame = frame_object->m_frame.f_back;\n    frame_object->m_frame.f_back = NULL;\n\n    Nuitka_Frame_MarkAsNotExecuting(frame_object);\n    Py_DECREF(frame_object);\n#else\n    assert(tstate->cframe);\n    assert(tstate->cframe->current_frame);\n\n    struct Nuitka_FrameObject *frame_object = (struct Nuitka_FrameObject *)tstate->cframe->current_frame->frame_obj;\n    CHECK_OBJECT(frame_object);\n\n    tstate->cframe->current_frame = tstate->cframe->current_frame->previous;\n\n    Nuitka_Frame_MarkAsNotExecuting(frame_object);\n\n    CHECK_OBJECT_X(frame_object->m_frame.f_back);\n    Py_CLEAR(frame_object->m_frame.f_back);\n\n    Py_DECREF(frame_object);\n\n    frame_object->m_interpreter_frame.previous = NULL;\n#endif\n\n#if _DEBUG_FRAME\n    PRINT_TOP_FRAME(\"Normal pop exit top frame:\");\n#endif\n}\n\n// TODO: These can be moved to private code, once all C library is included by\n// compiled code helpers, but generators are currently not.\n#if PYTHON_VERSION >= 0x340\nNUITKA_MAY_BE_UNUSED static void Nuitka_SetFrameGenerator(struct Nuitka_FrameObject *nuitka_frame,\n                                                          PyObject *generator) {\n#if PYTHON_VERSION < 0x3b0\n    nuitka_frame->m_frame.f_gen = generator;\n#else\n    nuitka_frame->m_generator = generator;\n#endif\n\n    // Mark the frame as executing\n    if (generator) {\n        Nuitka_Frame_MarkAsExecuting(nuitka_frame);\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_GetFrameGenerator(struct Nuitka_FrameObject *nuitka_frame) {\n#if PYTHON_VERSION < 0x3b0\n    return nuitka_frame->m_frame.f_gen;\n#else\n    return nuitka_frame->m_generator;\n#endif\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyCodeObject *Nuitka_GetFrameCodeObject(struct Nuitka_FrameObject *nuitka_frame) {\n#if PYTHON_VERSION < 0x3b0\n    return nuitka_frame->m_frame.f_code;\n#else\n    return nuitka_frame->m_interpreter_frame.f_code;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static int Nuitka_GetFrameLineNumber(struct Nuitka_FrameObject *nuitka_frame) {\n    return nuitka_frame->m_frame.f_lineno;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject **Nuitka_GetCodeVarNames(PyCodeObject *code_object) {\n#if PYTHON_VERSION < 0x3b0\n    return &PyTuple_GET_ITEM(code_object->co_varnames, 0);\n#else\n    // TODO: Might get away with co_names which will be much faster, that functions\n    // that build a new tuple, that we would have to keep around, but it might be\n    // merged with closure variable names, etc. as as such might become wrong.\n    return &PyTuple_GET_ITEM(code_object->co_localsplusnames, 0);\n#endif\n}\n\n// Attach locals to a frame object. TODO: Upper case, this is for generated code only.\nextern void Nuitka_Frame_AttachLocals(struct Nuitka_FrameObject *frame, char const *type_description, ...);\n\nNUITKA_MAY_BE_UNUSED static Nuitka_ThreadStateFrameType *_Nuitka_GetThreadStateFrame(PyThreadState *tstate) {\n#if PYTHON_VERSION < 0x3b0\n    return tstate->frame;\n#else\n    return tstate->cframe->current_frame;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED inline static void pushFrameStackGenerator(PyThreadState *tstate,\n                                                                Nuitka_ThreadStateFrameType *frame_object) {\n#if PYTHON_VERSION < 0x3b0\n    Nuitka_ThreadStateFrameType *return_frame = _Nuitka_GetThreadStateFrame(tstate);\n\n    Py_XINCREF(return_frame);\n    // Put the generator back on the frame stack.\n    pushFrameStackPythonFrame(tstate, frame_object);\n    Py_DECREF(frame_object);\n#else\n    pushFrameStackInterpreterFrame(tstate, frame_object);\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED inline static void pushFrameStackGeneratorCompiledFrame(PyThreadState *tstate,\n                                                                             struct Nuitka_FrameObject *frame_object) {\n#if PYTHON_VERSION < 0x3b0\n    pushFrameStackGenerator(tstate, &frame_object->m_frame);\n#else\n    pushFrameStackGenerator(tstate, &frame_object->m_interpreter_frame);\n#endif\n}\n\n// Codes used for type_description.\n#define NUITKA_TYPE_DESCRIPTION_NULL 'N'\n#define NUITKA_TYPE_DESCRIPTION_CELL 'c'\n#define NUITKA_TYPE_DESCRIPTION_OBJECT 'o'\n#define NUITKA_TYPE_DESCRIPTION_OBJECT_PTR 'O'\n#define NUITKA_TYPE_DESCRIPTION_BOOL 'b'\n\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Frame_Type;\nextern int count_allocated_Nuitka_Frame_Type;\nextern int count_released_Nuitka_Frame_Type;\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_function.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_FUNCTION_H__\n#define __NUITKA_COMPILED_FUNCTION_H__\n\n#ifdef __IDE_ONLY__\n#include <Python.h>\n#include <frameobject.h>\n#endif\n\n// Compiled function type.\n\n// The backbone of the integration into CPython. Try to behave as well as normal\n// functions and built-in functions, or even better.\n\nstruct Nuitka_FunctionObject;\n\n// The actual function code with arguments as an array.\ntypedef PyObject *(*function_impl_code)(PyThreadState *tstate, struct Nuitka_FunctionObject const *, PyObject **);\n\n// The Nuitka_FunctionObject is the storage associated with a compiled function\n// instance of which there can be many for each code.\nstruct Nuitka_FunctionObject {\n    /* Python object folklore: */\n    PyObject_VAR_HEAD\n\n        PyObject *m_name;\n\n    PyObject *m_module;\n    PyObject *m_doc;\n\n    PyCodeObject *m_code_object;\n    Py_ssize_t m_args_overall_count;\n    Py_ssize_t m_args_positional_count;\n    Py_ssize_t m_args_keywords_count;\n    bool m_args_simple;\n    Py_ssize_t m_args_star_list_index;\n    Py_ssize_t m_args_star_dict_index;\n\n#if PYTHON_VERSION >= 0x380\n    Py_ssize_t m_args_pos_only_count;\n#endif\n\n    // Same as code_object->co_varnames\n    PyObject **m_varnames;\n\n    // C implementation of the function\n    function_impl_code m_c_code;\n\n#if PYTHON_VERSION >= 0x380\n    vectorcallfunc m_vectorcall;\n#endif\n\n    PyObject *m_dict;\n    PyObject *m_weakrefs;\n\n    // Tuple of defaults, for use in __defaults__ and parameter parsing.\n    PyObject *m_defaults;\n    Py_ssize_t m_defaults_given;\n\n#if PYTHON_VERSION >= 0x300\n    // List of keyword only defaults, for use in __kwdefaults__ and parameter\n    // parsing.\n    PyObject *m_kwdefaults;\n\n    // Annotations to the function arguments and return value.\n    PyObject *m_annotations;\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    PyObject *m_qualname;\n#endif\n\n    // Constant return value to use.\n    PyObject *m_constant_return_value;\n\n    // A kind of uuid for the function object, used in comparisons.\n    long m_counter;\n\n    // Closure taken objects, for use in __closure__ and for accessing it.\n    Py_ssize_t m_closure_given;\n    struct Nuitka_CellObject *m_closure[1];\n};\n\nextern PyTypeObject Nuitka_Function_Type;\n\n// Make a function with context.\n#if PYTHON_VERSION < 0x300\nextern struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name,\n                                                         PyCodeObject *code_object, PyObject *defaults,\n                                                         PyObject *module, PyObject *doc,\n                                                         struct Nuitka_CellObject **closure, Py_ssize_t closure_given);\n#else\nextern struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyObject *qualname,\n                                                         PyCodeObject *code_object, PyObject *defaults,\n                                                         PyObject *kw_defaults, PyObject *annotations, PyObject *module,\n                                                         PyObject *doc, struct Nuitka_CellObject **closure,\n                                                         Py_ssize_t closure_given);\n#endif\n\nextern void Nuitka_Function_EnableConstReturnTrue(struct Nuitka_FunctionObject *function);\n\nextern void Nuitka_Function_EnableConstReturnFalse(struct Nuitka_FunctionObject *function);\n\nextern void Nuitka_Function_EnableConstReturnGeneric(struct Nuitka_FunctionObject *function, PyObject *value);\n\n#ifdef _NUITKA_PLUGIN_DILL_ENABLED\nextern int Nuitka_Function_GetFunctionCodeIndex(struct Nuitka_FunctionObject *function,\n                                                function_impl_code const *function_table);\nextern struct Nuitka_FunctionObject *\nNuitka_Function_CreateFunctionViaCodeIndex(PyObject *module, PyObject *function_qualname, PyObject *function_index,\n                                           PyObject *code_object_desc, PyObject *constant_return_value,\n                                           PyObject *defaults, PyObject *kw_defaults, PyObject *doc, PyObject *closure,\n                                           function_impl_code const *function_table, int function_table_size);\n#endif\n\nstatic inline bool Nuitka_Function_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Function_Type; }\n\nstatic inline PyObject *Nuitka_Function_GetName(PyObject *object) {\n    return ((struct Nuitka_FunctionObject *)object)->m_name;\n}\n\nPyObject *Nuitka_CallFunctionNoArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function);\n\nPyObject *Nuitka_CallFunctionPosArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                     PyObject *const *args, Py_ssize_t args_size);\n\nPyObject *Nuitka_CallFunctionVectorcall(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                        PyObject *const *args, Py_ssize_t args_size, PyObject *const *kw_names,\n                                        Py_ssize_t kw_size);\nPyObject *Nuitka_CallFunctionPosArgsKwArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject *const *args, Py_ssize_t args_size, PyObject *kw);\nPyObject *Nuitka_CallFunctionPosArgsKwSplit(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                            PyObject *const *args, Py_ssize_t args_size, PyObject *const *kw_values,\n                                            PyObject *kw_names);\n\nPyObject *Nuitka_CallMethodFunctionNoArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                          PyObject *object);\nPyObject *Nuitka_CallMethodFunctionPosArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject *object, PyObject *const *args, Py_ssize_t args_size);\nPyObject *Nuitka_CallMethodFunctionPosArgsKwArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                 PyObject *object, PyObject *const *args, Py_ssize_t args_size,\n                                                 PyObject *kw);\n\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Function_Type;\nextern int count_allocated_Nuitka_Function_Type;\nextern int count_released_Nuitka_Function_Type;\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_generator.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_GENERATOR_H__\n#define __NUITKA_COMPILED_GENERATOR_H__\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Compiled generator function type.\n\n// Another cornerstone of the integration into CPython. Try to behave as well as\n// normal generator objects do or even better.\n\n// Status of the generator object.\n#ifdef __cplusplus\nenum Generator_Status {\n    status_Unused,  // Not used so far\n    status_Running, // Running, used but didn't stop yet\n    status_Finished // Stopped, no more values to come\n};\n#else\ntypedef int Generator_Status;\nstatic const int status_Unused = 0;\nstatic const int status_Running = 1;\nstatic const int status_Finished = 2;\n#endif\n\n// We use this even before Python3.10\n#if PYTHON_VERSION < 0x3a0\ntypedef enum {\n    PYGEN_RETURN = 0,\n    PYGEN_ERROR = -1,\n    PYGEN_NEXT = 1,\n} PySendResult;\n#endif\n\n// The Nuitka_GeneratorObject is the storage associated with a compiled\n// generator object instance of which there can be many for each code.\nstruct Nuitka_GeneratorObject {\n    /* Python object folklore: */\n    PyObject_VAR_HEAD\n\n        PyObject *m_name;\n\n    // TODO: Only to make traceback for non-started throw\n    PyObject *m_module;\n\n#if PYTHON_VERSION >= 0x350\n    PyObject *m_qualname;\n#endif\n#if PYTHON_VERSION >= 0x300\n    // The value currently yielded from.\n    PyObject *m_yield_from;\n#endif\n\n    // Weak references are supported for generator objects in CPython.\n    PyObject *m_weakrefs;\n\n    int m_running;\n\n    void *m_code;\n\n    struct Nuitka_FrameObject *m_frame;\n    PyCodeObject *m_code_object;\n\n    // Was it ever used, is it still running, or already finished.\n    Generator_Status m_status;\n\n#if PYTHON_VERSION >= 0x370\n    struct Nuitka_ExceptionStackItem m_exc_state;\n#endif\n\n    // The label index to resume after yield.\n    int m_yield_return_index;\n\n    // Returned value if yielded value is NULL, is\n    // NULL if not a return\n#if PYTHON_VERSION >= 0x300\n    PyObject *m_returned;\n#endif\n\n    // A kind of uuid for the generator object, used in comparisons.\n    long m_counter;\n\n    /* The heap of generator objects at run time. */\n    void *m_heap_storage;\n\n    /* Closure variables given, if any, we reference cells here. The last\n     * part is dynamically allocated, the array size differs per generator\n     * and includes the heap storage.\n     */\n    Py_ssize_t m_closure_given;\n    struct Nuitka_CellObject *m_closure[1];\n};\n\nextern PyTypeObject Nuitka_Generator_Type;\n\ntypedef PyObject *(*generator_code)(PyThreadState *tstate, struct Nuitka_GeneratorObject *, PyObject *);\n\nextern PyObject *Nuitka_Generator_New(generator_code code, PyObject *module, PyObject *name,\n#if PYTHON_VERSION >= 0x350\n                                      PyObject *qualname,\n#endif\n                                      PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                                      Py_ssize_t closure_given, Py_ssize_t heap_storage_size);\n\nextern PyObject *Nuitka_Generator_NewEmpty(PyObject *module, PyObject *name,\n#if PYTHON_VERSION >= 0x350\n                                           PyObject *qualname,\n#endif\n                                           PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                                           Py_ssize_t closure_given);\n\nextern PyObject *Nuitka_Generator_qiter(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                        bool *finished);\n\nstatic inline bool Nuitka_Generator_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Generator_Type; }\n\nstatic inline PyObject *Nuitka_Generator_GetName(PyObject *object) {\n    return ((struct Nuitka_GeneratorObject *)object)->m_name;\n}\n\nstatic inline void SAVE_GENERATOR_EXCEPTION(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator) {\n    /* Before Python3.7: When yielding from an exception handler in Python3,\n     * the exception preserved to the frame is restored, while the current one\n     * is put as there.\n     *\n     * Python3.7: The exception is preserved in the generator object itself\n     * which has a new \"m_exc_state\" structure just for that.\n     */\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = generator->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = generator->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, generator->m_exc_state.exception_tb);\n#endif\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"YIELD exit:\\n\");\n    PRINT_PUBLISHED_EXCEPTION();\n#endif\n\n#if PYTHON_VERSION < 0x370\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    generator->m_exc_state.exception_type = saved_exception_type;\n#endif\n    generator->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    generator->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n}\n\nstatic inline void RESTORE_GENERATOR_EXCEPTION(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator) {\n    // When returning from yield, the exception of the frame is preserved, and\n    // the one that enters should be there.\n#if PYTHON_VERSION < 0x3b0\n    PyObject *saved_exception_type = EXC_TYPE(tstate);\n#endif\n    PyObject *saved_exception_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);\n#endif\n\n#if PYTHON_VERSION < 0x370\n    EXC_TYPE(tstate) = tstate->frame->f_exc_type;\n    EXC_VALUE(tstate) = tstate->frame->f_exc_value;\n    SET_EXC_TRACEBACK(tstate, tstate->frame->f_exc_traceback);\n\n    tstate->frame->f_exc_type = saved_exception_type;\n    tstate->frame->f_exc_value = saved_exception_value;\n    tstate->frame->f_exc_traceback = (PyObject *)saved_exception_traceback;\n#else\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = generator->m_exc_state.exception_type;\n#endif\n    EXC_VALUE(tstate) = generator->m_exc_state.exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, generator->m_exc_state.exception_tb);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    generator->m_exc_state.exception_type = saved_exception_type;\n#endif\n    generator->m_exc_state.exception_value = saved_exception_value;\n#if PYTHON_VERSION < 0x3b0\n    generator->m_exc_state.exception_tb = (PyTracebackObject *)saved_exception_traceback;\n#endif\n#endif\n}\n\n// Functions to preserver and restore from heap area temporary values during\n// yield/yield from/await exits of generator functions.\nextern void Nuitka_PreserveHeap(void *dest, ...);\nextern void Nuitka_RestoreHeap(void *source, ...);\n\nNUITKA_MAY_BE_UNUSED static void STORE_GENERATOR_EXCEPTION(PyThreadState *tstate,\n                                                           struct Nuitka_GeneratorObject *generator) {\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE_F(generator) = EXC_TYPE(tstate);\n    if (EXC_TYPE_F(generator) == Py_None)\n        EXC_TYPE_F(generator) = NULL;\n    Py_XINCREF(EXC_TYPE_F(generator));\n#endif\n    EXC_VALUE_F(generator) = EXC_VALUE(tstate);\n    Py_XINCREF(EXC_VALUE_F(generator));\n#if PYTHON_VERSION < 0x3b0\n    ASSIGN_EXC_TRACEBACK_F(generator, EXC_TRACEBACK(tstate));\n    Py_XINCREF(EXC_TRACEBACK_F(generator));\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static void DROP_GENERATOR_EXCEPTION(struct Nuitka_GeneratorObject *generator) {\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TYPE_F(generator));\n#endif\n    Py_CLEAR(EXC_VALUE_F(generator));\n#if PYTHON_VERSION < 0x3b0\n    Py_CLEAR(EXC_TRACEBACK_F(generator));\n#endif\n}\n\n#if _DEBUG_REFCOUNTS\nextern int count_active_Nuitka_Generator_Type;\nextern int count_allocated_Nuitka_Generator_Type;\nextern int count_released_Nuitka_Generator_Type;\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/compiled_method.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_COMPILED_METHOD_H__\n#define __NUITKA_COMPILED_METHOD_H__\n\n// Compiled function and compile generator types may be referenced.\n#include \"compiled_function.h\"\n#include \"compiled_generator.h\"\n\n// The backbone of the integration into CPython. Try to behave as well as normal\n// method objects, or even better.\n\n// The Nuitka_MethodObject is the storage associated with a compiled method\n// instance of which there can be many for each code.\n\nstruct Nuitka_MethodObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        struct Nuitka_FunctionObject *m_function;\n\n    PyObject *m_weakrefs;\n\n    PyObject *m_object;\n    PyObject *m_class;\n\n#if PYTHON_VERSION >= 0x380\n    vectorcallfunc m_vectorcall;\n#endif\n};\n\nextern PyTypeObject Nuitka_Method_Type;\n\n// Make a method out of a function.\nextern PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *klass);\n\nstatic inline bool Nuitka_Method_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Method_Type; }\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/constants.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_CONSTANTS_H__\n#define __NUITKA_CONSTANTS_H__\n\n// Generated.\n// TODO: Move generated ones to separate file.\n#ifdef __IDE_ONLY__\nextern PyObject **global_constants;\n// ()\n#define const_tuple_empty global_constants[1]\n// {}\n#define const_dict_empty global_constants[2]\n// 0\n#define const_int_0 global_constants[3]\n// 1\n#define const_int_pos_1 global_constants[4]\n// -1\n#define const_int_neg_1 global_constants[5]\n// 0.0\n#define const_float_0_0 global_constants[6]\n// -0.0\n#define const_float_minus_0_0 global_constants[7]\n// 1.0\n#define const_float_1_0 global_constants[8]\n// -1.0\n#define const_float_minus_1_0 global_constants[9]\n// ''\n#define const_str_empty global_constants[10]\n// b''\n#define const_bytes_empty global_constants[10]\n// '__module__'\n#define const_str_plain___module__ global_constants[11]\n// '__nuitka__'\n#define const_str_plain___nuitka__ global_constants[11]\n// '__class__'\n#define const_str_plain___class__ global_constants[12]\n// '__class_getitem__'\n#define const_str_plain___class_getitem__ global_constants[12]\n// '__name__'\n#define const_str_plain___name__ global_constants[13]\n// '__main__'\n#define const_str_plain___main__ global_constants[13]\n// '__package__'\n#define const_str_plain___package__ global_constants[14]\n// '__metaclass__'\n#define const_str_plain___metaclass__ global_constants[15]\n// '__abstractmethods__'\n#define const_str_plain___abstractmethods__ global_constants[15]\n// '__dict__'\n#define const_str_plain___dict__ global_constants[16]\n// '__doc__'\n#define const_str_plain___doc__ global_constants[17]\n// '__file__'\n#define const_str_plain___file__ global_constants[18]\n// '__path__'\n#define const_str_plain___path__ global_constants[19]\n// '__enter__'\n#define const_str_plain___enter__ global_constants[20]\n// '__aenter__'\n#define const_str_plain___aenter__ global_constants[20]\n// '__exit__'\n#define const_str_plain___exit__ global_constants[21]\n// '__aexit__'\n#define const_str_plain___aexit__ global_constants[21]\n// '__builtins__'\n#define const_str_plain___builtins__ global_constants[22]\n// '__all__'\n#define const_str_plain___all__ global_constants[23]\n// '__cmp__'\n#define const_str_plain___cmp__ global_constants[24]\n// '__init__'\n#define const_str_plain___init__ global_constants[24]\n// '__iter__'\n#define const_str_plain___iter__ global_constants[25]\n// '__subclasscheck__'\n#define const_str_plain___subclasscheck__ global_constants[25]\n// '__compiled__'\n#define const_str_plain___compiled__ global_constants[26]\n// 'inspect'\n#define const_str_plain_inspect global_constants[27]\n// 'compile'\n#define const_str_plain_compile global_constants[28]\n// 'getattr'\n#define const_str_plain_getattr global_constants[28]\n// 'range'\n#define const_str_plain_range global_constants[29]\n// 'rb'\n#define const_str_plain_rb global_constants[29]\n// 'open'\n#define const_str_plain_open global_constants[30]\n// 'keys'\n#define const_str_plain_keys global_constants[30]\n// 'as_file'\n#define const_str_plain_as_file global_constants[30]\n// 'register'\n#define const_str_plain_register global_constants[30]\n// 'close'\n#define const_str_plain_close global_constants[30]\n// 'throw'\n#define const_str_plain_throw global_constants[30]\n// 'send'\n#define const_str_plain_send global_constants[30]\n// 'sum'\n#define const_str_plain_sum global_constants[31]\n// 'format'\n#define const_str_plain_format global_constants[32]\n// '__import__'\n#define const_str_plain___import__ global_constants[33]\n// 'bytearray'\n#define const_str_plain_bytearray global_constants[34]\n// 'staticmethod'\n#define const_str_plain_staticmethod global_constants[35]\n// 'classmethod'\n#define const_str_plain_classmethod global_constants[36]\n// 'name'\n#define const_str_plain_name global_constants[37]\n// 'globals'\n#define const_str_plain_globals global_constants[38]\n// 'locals'\n#define const_str_plain_locals global_constants[39]\n// 'fromlist'\n#define const_str_plain_fromlist global_constants[40]\n// 'level'\n#define const_str_plain_level global_constants[41]\n// 'read'\n#define const_str_plain_read global_constants[42]\n// 'exists'\n#define const_str_plain_exists global_constants[42]\n// 'isdir'\n#define const_str_plain_isdir global_constants[42]\n// 'isfile'\n#define const_str_plain_isfile global_constants[42]\n// 'listdir'\n#define const_str_plain_listdir global_constants[42]\n// 'basename'\n#define const_str_plain_basename global_constants[42]\n// 'dirname'\n#define const_str_plain_dirname global_constants[42]\n// 'abspath'\n#define const_str_plain_abspath global_constants[42]\n// 'isabs'\n#define const_str_plain_isabs global_constants[42]\n// 'path'\n#define const_str_plain_path global_constants[42]\n// '__newobj__'\n#define const_str_plain___newobj__ global_constants[44]\n// '.'\n#define const_str_dot global_constants[45]\n// '_'\n#define const_str_underscore global_constants[45]\n// '__getattr__'\n#define const_str_plain___getattr__ global_constants[46]\n// '__setattr__'\n#define const_str_plain___setattr__ global_constants[47]\n// '__delattr__'\n#define const_str_plain___delattr__ global_constants[48]\n// 'exc_type'\n#define const_str_plain_exc_type global_constants[49]\n// 'exc_value'\n#define const_str_plain_exc_value global_constants[50]\n// 'exc_traceback'\n#define const_str_plain_exc_traceback global_constants[51]\n// 'xrange'\n#define const_str_plain_xrange global_constants[52]\n// 'site'\n#define const_str_plain_site global_constants[53]\n// 'type'\n#define const_str_plain_type global_constants[54]\n// 'len'\n#define const_str_plain_len global_constants[55]\n// 'range'\n#define const_str_plain_range global_constants[29]\n// 'repr'\n#define const_str_plain_repr global_constants[56]\n// 'int'\n#define const_str_plain_int global_constants[57]\n// 'iter'\n#define const_str_plain_iter global_constants[58]\n// 'long'\n#define const_str_plain_long global_constants[59]\n// 'end'\n#define const_str_plain_end global_constants[60]\n// 'file'\n#define const_str_plain_file global_constants[61]\n// 'print'\n#define const_str_plain_print global_constants[62]\n// 'super'\n#define const_str_plain_super global_constants[62]\n// '__spec__'\n#define const_str_plain___spec__ global_constants[63]\n// '_initializing'\n#define const_str_plain__initializing global_constants[64]\n// parent\n#define const_str_plain_parent global_constants[65]\n// types\n#define const_str_plain_types global_constants[66]\n// '__loader__'\n#define const_str_plain___loader__ global_constants[67]\n// '__match_args__'\n#define const_str_plain___match_args__ global_constants[67]\n// '__args__'\n#define const_str_plain___args__ global_constants[67]\n// 'fileno'\n#define const_str_plain_fileno global_constants[67]\n// '/'\n#define const_str_slash global_constants[67]\n// '\\\\'\n#define const_str_backslash global_constants[67]\n\n#define _NUITKA_CONSTANTS_SIZE 27\n#define _NUITKA_CONSTANTS_HASH 0x27272727\n#else\n#include \"__constants.h\"\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/constants_blob.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_CONSTANTS_BLOB_H__\n#define __NUITKA_CONSTANTS_BLOB_H__\n\n/** Declaration of the constants binary blob.\n *\n * There are multiple ways, the constants binary is accessed, and its\n * definition depends on how that is done.\n *\n * It could be a Windows resource, then it must be a pointer. If it's defined\n * externally in a C file, or at link time with \"ld\", it must be an array. This\n * hides these facts.\n *\n */\n\nextern void loadConstantsBlob(PyThreadState *tstate, PyObject **, char const *name);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/environment_variables.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_ENVIRONMENT_VARIABLES_H__\n#define __NUITKA_ENVIRONMENT_VARIABLES_H__\n\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"nuitka/environment_variables_system.h\"\n\nextern void undoEnvironmentVariable(PyThreadState *tstate, char const *variable_name,\n                                    environment_char_t const *old_value);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/environment_variables_system.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_ENVIRONMENT_VARIABLES_SYSTEM_H__\n#define __NUITKA_ENVIRONMENT_VARIABLES_SYSTEM_H__\n\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"nuitka/filesystem_paths.h\"\n\n// Helpers for working with environment variables in a portable way. This mainly\n// abstracts the string type differences between Win32 and non-Win32 environment\n// variables.\n#if defined(_WIN32)\n#define environment_char_t wchar_t\n#define compareEnvironmentString(a, b) wcscmp(a, b)\n#define makeEnvironmentLiteral(x) L##x\n#else\n#define environment_char_t char\n#define compareEnvironmentString(a, b) strcmp(a, b)\n#define makeEnvironmentLiteral(x) x\n#endif\n\nextern environment_char_t const *getEnvironmentVariable(char const *name);\nextern void setEnvironmentVariable(char const *name, environment_char_t const *value);\nextern void setEnvironmentVariableFromLong(char const *name, long value);\nextern void setEnvironmentVariableFromFilename(char const *name, filename_char_t const *value);\nextern void unsetEnvironmentVariable(char const *name);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/exception_groups.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_EXCEPTION_GROUPS_H__\n#define __NUITKA_EXCEPTION_GROUPS_H__\n\n// Exception group helpers for generated code and compiled code helpers.\n\n#if PYTHON_VERSION >= 0x3b0\n\nNUITKA_MAY_BE_UNUSED static void FORMAT_CLASS_CATCH_ERROR(PyThreadState *tstate) {\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                    \"catching classes that do not inherit from BaseException is not allowed\");\n}\n\nNUITKA_MAY_BE_UNUSED static int CHECK_EXCEPTION_TYPE_VALID(PyThreadState *tstate, PyObject *right) {\n    if (PyTuple_Check(right)) {\n        Py_ssize_t length = PyTuple_GET_SIZE(right);\n\n        for (Py_ssize_t i = 0; i < length; i++) {\n            PyObject *exc = PyTuple_GET_ITEM(right, i);\n\n            if (!PyExceptionClass_Check(exc)) {\n                FORMAT_CLASS_CATCH_ERROR(tstate);\n                return -1;\n            }\n        }\n    } else {\n        if (!PyExceptionClass_Check(right)) {\n            FORMAT_CLASS_CATCH_ERROR(tstate);\n            return -1;\n        }\n    }\n    return 0;\n}\n\nNUITKA_MAY_BE_UNUSED static int CHECK_EXCEPTION_STAR_VALID(PyThreadState *tstate, PyObject *right) {\n    if (CHECK_EXCEPTION_TYPE_VALID(tstate, right) < 0) {\n        return -1;\n    }\n\n    // TODO: Wants to reject except *ExceptionGroup, but we would be able to\n    // statically tell that often, and then this wouldn't have to be done,\n    // but it might be code.\n    int is_subclass = 0;\n\n    if (PyTuple_Check(right)) {\n        Py_ssize_t length = PyTuple_GET_SIZE(right);\n\n        for (Py_ssize_t i = 0; i < length; i++) {\n            PyObject *exc = PyTuple_GET_ITEM(right, i);\n            is_subclass = PyObject_IsSubclass(exc, PyExc_BaseExceptionGroup);\n\n            if (is_subclass < 0) {\n                return -1;\n            }\n\n            if (is_subclass) {\n                break;\n            }\n        }\n    } else {\n        is_subclass = PyObject_IsSubclass(right, PyExc_BaseExceptionGroup);\n\n        if (is_subclass < 0) {\n            return -1;\n        }\n    }\n\n    if (is_subclass) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"catching ExceptionGroup with except* is not allowed. Use except instead.\");\n        return -1;\n    }\n\n    return 0;\n}\n\nextern PyObject *const_str_plain_split;\n\nNUITKA_MAY_BE_UNUSED static int EXCEPTION_GROUP_MATCH(PyThreadState *tstate, PyObject *exc_value, PyObject *match_type,\n                                                      PyObject **match, PyObject **rest) {\n    // TODO: Avoid this from happening, we should not call it then.\n    if (exc_value == Py_None) {\n        *match = Py_None;\n        Py_INCREF(*match);\n        *rest = Py_None;\n        Py_INCREF(*rest);\n\n        return 0;\n    }\n\n    // If not none, must be an instance at this point.\n    assert(PyExceptionInstance_Check(exc_value));\n\n    if (PyErr_GivenExceptionMatches(exc_value, match_type)) {\n        bool is_exception_group = _PyBaseExceptionGroup_Check(exc_value);\n\n        if (is_exception_group) {\n            *match = exc_value;\n            Py_INCREF(*match);\n        } else {\n            // Old style plain exception, put it into an exception group.\n            PyObject *exception_tuple = MAKE_TUPLE1_0(exc_value);\n            PyObject *wrapped = _PyExc_CreateExceptionGroup(\"\", exception_tuple);\n            Py_DECREF(exception_tuple);\n\n            if (unlikely(wrapped == NULL)) {\n                return -1;\n            }\n\n            *match = wrapped;\n        }\n\n        *rest = Py_None;\n        Py_INCREF(*rest);\n\n        return 0;\n    }\n\n    // exc_value does not match match_type completely, need to check for partial\n    // match if it's an exception group.\n    if (_PyBaseExceptionGroup_Check(exc_value)) {\n        PyObject *pair = CALL_METHOD_WITH_SINGLE_ARG(tstate, exc_value, const_str_plain_split, match_type);\n\n        if (pair == NULL) {\n            return -1;\n        }\n\n        // TODO: What is that split method going to be, can we then inline it. CPython\n        // asserts these, so maybe it's not free to do what it wants.\n        assert(PyTuple_CheckExact(pair));\n        assert(PyTuple_GET_SIZE(pair) == 2);\n\n        *match = PyTuple_GET_ITEM(pair, 0);\n        Py_INCREF(*match);\n\n        *rest = PyTuple_GET_ITEM(pair, 1);\n        Py_INCREF(*rest);\n\n        Py_DECREF(pair);\n        return 0;\n    }\n\n    *match = Py_None;\n    Py_INCREF(*match);\n\n    *rest = Py_None;\n    Py_INCREF(*rest);\n\n    return 0;\n}\n\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/exceptions.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_EXCEPTIONS_H__\n#define __NUITKA_EXCEPTIONS_H__\n\n// Exception helpers for generated code and compiled code helpers.\n\n// Fundamental, because we use it for print style debugging in everything.\n#include \"nuitka/checkers.h\"\n#include \"nuitka/constants.h\"\n#include \"nuitka/printing.h\"\n\n// Did an error occur.\nNUITKA_MAY_BE_UNUSED static inline bool HAS_ERROR_OCCURRED(PyThreadState *tstate) {\n#if PYTHON_VERSION < 0x3c0\n    return tstate->curexc_type != NULL;\n#else\n    return tstate->current_exception != NULL;\n#endif\n}\n\n// Get the error type occurred.\nNUITKA_MAY_BE_UNUSED static inline PyObject *GET_ERROR_OCCURRED(PyThreadState *tstate) {\n#if PYTHON_VERSION < 0x3c0\n    return tstate->curexc_type;\n#else\n    return (PyObject *)Py_TYPE(tstate->current_exception);\n#endif\n}\n\n// Clear error, which likely set, similar to _PyErr_Clear(tstate)\nNUITKA_MAY_BE_UNUSED static inline void CLEAR_ERROR_OCCURRED(PyThreadState *tstate) {\n#if PYTHON_VERSION < 0x3c0\n    PyObject *old_type = tstate->curexc_type;\n    PyObject *old_value = tstate->curexc_value;\n    PyObject *old_tb = tstate->curexc_traceback;\n\n    tstate->curexc_type = NULL;\n    tstate->curexc_value = NULL;\n    tstate->curexc_traceback = NULL;\n\n    Py_XDECREF(old_type);\n    Py_XDECREF(old_value);\n    Py_XDECREF(old_tb);\n#else\n    PyObject *old_exception = tstate->current_exception;\n    tstate->current_exception = NULL;\n    Py_XDECREF(old_exception);\n#endif\n}\n\n// Clear error, which is not likely set, use CLEAR_ERROR_OCCURRED not sure there is an error.\nNUITKA_MAY_BE_UNUSED static inline bool DROP_ERROR_OCCURRED(PyThreadState *tstate) {\n\n#if PYTHON_VERSION < 0x3c0\n    if (unlikely(tstate->curexc_type != NULL)) {\n        PyObject *old_type = tstate->curexc_type;\n        PyObject *old_value = tstate->curexc_value;\n        PyObject *old_tb = tstate->curexc_traceback;\n\n        tstate->curexc_type = NULL;\n        tstate->curexc_value = NULL;\n        tstate->curexc_traceback = NULL;\n\n        Py_DECREF(old_type);\n        Py_XDECREF(old_value);\n        Py_XDECREF(old_tb);\n\n        return true;\n    }\n#else\n    if (unlikely(tstate->current_exception != NULL)) {\n        PyObject *old_exception = tstate->current_exception;\n\n        tstate->current_exception = NULL;\n\n        Py_DECREF(old_exception);\n\n        return true;\n    }\n#endif\n    return false;\n}\n\n#if PYTHON_VERSION < 0x3c0\n// Fetch the current error into object variables.\nNUITKA_MAY_BE_UNUSED static void FETCH_ERROR_OCCURRED(PyThreadState *tstate, PyObject **exception_type,\n                                                      PyObject **exception_value,\n                                                      PyTracebackObject **exception_traceback) {\n    *exception_type = tstate->curexc_type;\n    *exception_value = tstate->curexc_value;\n    *exception_traceback = (PyTracebackObject *)tstate->curexc_traceback;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"FETCH_ERROR_OCCURRED:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    tstate->curexc_type = NULL;\n    tstate->curexc_value = NULL;\n    tstate->curexc_traceback = NULL;\n}\n\n// Fetch the current error into object variables.\nNUITKA_MAY_BE_UNUSED static void FETCH_ERROR_OCCURRED_UNTRACED(PyThreadState *tstate, PyObject **exception_type,\n                                                               PyObject **exception_value,\n                                                               PyTracebackObject **exception_traceback) {\n    *exception_type = tstate->curexc_type;\n    *exception_value = tstate->curexc_value;\n    *exception_traceback = (PyTracebackObject *)tstate->curexc_traceback;\n\n    tstate->curexc_type = NULL;\n    tstate->curexc_value = NULL;\n    tstate->curexc_traceback = NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static void RESTORE_ERROR_OCCURRED(PyThreadState *tstate, PyObject *exception_type,\n                                                        PyObject *exception_value,\n                                                        PyTracebackObject *exception_traceback) {\n    PyObject *old_exception_type = tstate->curexc_type;\n    PyObject *old_exception_value = tstate->curexc_value;\n    PyObject *old_exception_traceback = tstate->curexc_traceback;\n\n    tstate->curexc_type = exception_type;\n    tstate->curexc_value = exception_value;\n    tstate->curexc_traceback = (PyObject *)exception_traceback;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"RESTORE_ERROR_OCCURRED:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception_type);\n    Py_XDECREF(old_exception_value);\n    Py_XDECREF(old_exception_traceback);\n}\n\nNUITKA_MAY_BE_UNUSED static void RESTORE_ERROR_OCCURRED_UNTRACED(PyThreadState *tstate, PyObject *exception_type,\n                                                                 PyObject *exception_value,\n                                                                 PyTracebackObject *exception_traceback) {\n    PyObject *old_exception_type = tstate->curexc_type;\n    PyObject *old_exception_value = tstate->curexc_value;\n    PyObject *old_exception_traceback = tstate->curexc_traceback;\n\n    tstate->curexc_type = exception_type;\n    tstate->curexc_value = exception_value;\n    tstate->curexc_traceback = (PyObject *)exception_traceback;\n\n    Py_XDECREF(old_exception_type);\n    Py_XDECREF(old_exception_value);\n    Py_XDECREF(old_exception_traceback);\n}\n#endif\n\nstruct Nuitka_FrameObject;\n\nextern PyTracebackObject *MAKE_TRACEBACK(struct Nuitka_FrameObject *frame, int lineno);\n\n// Add a frame to an existing exception trace-back.\nNUITKA_MAY_BE_UNUSED static PyTracebackObject *ADD_TRACEBACK(PyTracebackObject *exception_tb,\n                                                             struct Nuitka_FrameObject *frame, int lineno) {\n    CHECK_OBJECT(exception_tb);\n    CHECK_OBJECT(frame);\n\n    PyTracebackObject *traceback_new = MAKE_TRACEBACK(frame, lineno);\n    traceback_new->tb_next = exception_tb;\n    return traceback_new;\n}\n\n// Need some wrapper functions for accessing exception type, value, and traceback\n// due to changes in Python 3.7\n\n#if PYTHON_VERSION < 0x370\n#define EXC_TYPE(x) (x->exc_type)\n#define EXC_VALUE(x) (x->exc_value)\n#define EXC_TRACEBACK(x) ((PyTracebackObject *)(x->exc_traceback))\n#define EXC_TRACEBACK_PTR(x) ((PyTracebackObject **)(&x->exc_traceback))\n#define SET_EXC_TRACEBACK(x, tb) x->exc_traceback = (PyObject *)tb\n#elif PYTHON_VERSION < 0x3b0\n#define EXC_TYPE(x) (x->exc_state.exc_type)\n#define EXC_VALUE(x) (x->exc_state.exc_value)\n#define EXC_TRACEBACK(x) ((PyTracebackObject *)(x->exc_state.exc_traceback))\n#define EXC_TRACEBACK_PTR(x) ((PyTracebackObject **)(&x->exc_state.exc_traceback))\n#define SET_EXC_TRACEBACK(x, tb) x->exc_state.exc_traceback = (PyObject *)tb\n#else\n#define EXC_TYPE(x) ((PyObject *)Py_TYPE(x->exc_state.exc_value))\n#define EXC_VALUE(x) (x->exc_state.exc_value)\n#endif\n\n#if PYTHON_VERSION < 0x370\n#define EXC_TYPE_F(x) (x->m_frame->m_frame.f_exc_type)\n#define EXC_VALUE_F(x) (x->m_frame->m_frame.f_exc_value)\n#define EXC_TRACEBACK_F(x) (x->m_frame->m_frame.f_exc_traceback)\n#define ASSIGN_EXC_TRACEBACK_F(x, tb) x->m_frame->m_frame.f_exc_traceback = (PyObject *)(tb)\n#elif PYTHON_VERSION < 0x3b0\n#define EXC_TYPE_F(x) (x->m_exc_state.exception_type)\n#define EXC_VALUE_F(x) (x->m_exc_state.exception_value)\n#define EXC_TRACEBACK_F(x) (x->m_exc_state.exception_tb)\n#define ASSIGN_EXC_TRACEBACK_F(x, tb) x->m_exc_state.exception_tb = (PyTracebackObject *)(tb)\n#else\n#define EXC_VALUE_F(x) (x->m_exc_state.exception_value)\n#endif\n\n#if PYTHON_VERSION < 0x3b0\nstruct Nuitka_ExceptionStackItem {\n    PyObject *exception_type;\n    PyObject *exception_value;\n    PyTracebackObject *exception_tb;\n};\n\n#if defined(__cplusplus)\nstatic const struct Nuitka_ExceptionStackItem Nuitka_ExceptionStackItem_Empty = {NULL, NULL, NULL};\n#else\n#define Nuitka_ExceptionStackItem_Empty                                                                                \\\n    (struct Nuitka_ExceptionStackItem) { .exception_type = NULL, .exception_value = NULL, .exception_tb = NULL }\n#endif\n#else\nstruct Nuitka_ExceptionStackItem {\n    PyObject *exception_value;\n};\n\n#if defined(__cplusplus)\nstatic const struct Nuitka_ExceptionStackItem Nuitka_ExceptionStackItem_Empty = {NULL};\n#else\n#define Nuitka_ExceptionStackItem_Empty                                                                                \\\n    (struct Nuitka_ExceptionStackItem) { .exception_value = NULL }\n#endif\n\n#endif\n\n// Helper that gets the current thread exception, for use in exception handlers\nNUITKA_MAY_BE_UNUSED inline static struct Nuitka_ExceptionStackItem GET_CURRENT_EXCEPTION(PyThreadState *tstate) {\n    struct Nuitka_ExceptionStackItem result;\n#if PYTHON_VERSION < 0x3b0\n    result.exception_type = EXC_TYPE(tstate);\n    Py_XINCREF(result.exception_type);\n#endif\n    result.exception_value = EXC_VALUE(tstate);\n    Py_XINCREF(result.exception_value);\n#if PYTHON_VERSION < 0x3b0\n    result.exception_tb = (PyTracebackObject *)EXC_TRACEBACK(tstate);\n    Py_XINCREF(result.exception_tb);\n#endif\n\n    return result;\n};\n\n#if PYTHON_VERSION < 0x300 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_SYS_EXC_VARS)\n#define _NUITKA_MAINTAIN_SYS_EXC_VARS 1\n#endif\n\n// Helper that sets the current thread exception, releasing the current one, for\n// use in this file only.\nNUITKA_MAY_BE_UNUSED inline static void SET_CURRENT_EXCEPTION(PyThreadState *tstate,\n                                                              struct Nuitka_ExceptionStackItem *exc_state) {\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(exc_state->exception_type);\n#endif\n    CHECK_OBJECT_X(exc_state->exception_value);\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(exc_state->exception_tb);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    PyObject *old_type = EXC_TYPE(tstate);\n#endif\n    PyObject *old_value = EXC_VALUE(tstate);\n#if PYTHON_VERSION < 0x3b0\n    PyTracebackObject *old_tb = EXC_TRACEBACK(tstate);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(old_type);\n#endif\n    CHECK_OBJECT_X(old_value);\n#if PYTHON_VERSION < 0x3b0\n    CHECK_OBJECT_X(old_tb);\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    EXC_TYPE(tstate) = exc_state->exception_type;\n#endif\n    EXC_VALUE(tstate) = exc_state->exception_value;\n#if PYTHON_VERSION < 0x3b0\n    SET_EXC_TRACEBACK(tstate, exc_state->exception_tb);\n#endif\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION:\\n\");\n    PRINT_PUBLISHED_EXCEPTION();\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    Py_XDECREF(old_type);\n#endif\n    Py_XDECREF(old_value);\n#if PYTHON_VERSION < 0x3b0\n    Py_XDECREF(old_tb);\n#endif\n\n#if _NUITKA_MAINTAIN_SYS_EXC_VARS\n    // Set sys attributes in the fastest possible way, spell-checker: ignore sysdict\n    PyObject *sys_dict = tstate->interp->sysdict;\n    CHECK_OBJECT(sys_dict);\n\n    PyDict_SetItem(sys_dict, const_str_plain_exc_type, exc_state->exception_type ? exc_state->exception_type : Py_None);\n    PyDict_SetItem(sys_dict, const_str_plain_exc_value,\n                   exc_state->exception_value ? exc_state->exception_value : Py_None);\n    PyDict_SetItem(sys_dict, const_str_plain_exc_traceback,\n                   exc_state->exception_tb ? (PyObject *)exc_state->exception_tb : Py_None);\n\n    if (exc_state->exception_type) {\n        assert(Py_REFCNT(exc_state->exception_type) >= 2);\n    }\n    if (exc_state->exception_value) {\n        assert(Py_REFCNT(exc_state->exception_value) >= 2);\n    }\n    if (exc_state->exception_tb) {\n        assert(Py_REFCNT(exc_state->exception_tb) >= 2);\n    }\n#endif\n}\n\n// Helper that sets the current thread exception, and has no reference passed.\n// Similar to \"PyErr_SetNone\".\nNUITKA_MAY_BE_UNUSED inline static void SET_CURRENT_EXCEPTION_TYPE0(PyThreadState *tstate, PyObject *exception_type) {\n    CHECK_OBJECT(exception_type);\n\n#if PYTHON_VERSION < 0x3c0\n    PyObject *old_exception_type = tstate->curexc_type;\n    PyObject *old_exception_value = tstate->curexc_value;\n    PyObject *old_exception_traceback = tstate->curexc_traceback;\n\n    tstate->curexc_type = exception_type;\n    Py_INCREF(exception_type);\n    tstate->curexc_value = NULL;\n    tstate->curexc_traceback = NULL;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE0:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception_type);\n    Py_XDECREF(old_exception_value);\n    Py_XDECREF(old_exception_traceback);\n#else\n    PyObject *old_exception = tstate->current_exception;\n\n    tstate->current_exception = exception_type;\n    Py_INCREF(exception_type);\n\n    // TODO: Might have to immediately normalize, and maybe we can use different\n    // functions for where that is necessary or not.\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE0:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception);\n#endif\n}\n\n// Same as \"PyErr_SetObject\" CPython API, use this instead.\nNUITKA_MAY_BE_UNUSED inline static void\nSET_CURRENT_EXCEPTION_TYPE0_VALUE0(PyThreadState *tstate, PyObject *exception_type, PyObject *exception_value) {\n#if PYTHON_VERSION < 0x3c0\n    PyObject *old_exception_type = tstate->curexc_type;\n    PyObject *old_exception_value = tstate->curexc_value;\n    PyObject *old_exception_traceback = tstate->curexc_traceback;\n\n    tstate->curexc_type = exception_type;\n    Py_INCREF(exception_type);\n    tstate->curexc_value = exception_value;\n    Py_INCREF(exception_value);\n    tstate->curexc_traceback = NULL;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE0_VALUE0:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception_type);\n    Py_XDECREF(old_exception_value);\n    Py_XDECREF(old_exception_traceback);\n#else\n    PyObject *old_exception = tstate->current_exception;\n\n    tstate->current_exception = exception_value;\n    Py_INCREF(exception_value);\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE_0VALUE0:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception);\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED inline static void\nSET_CURRENT_EXCEPTION_TYPE0_VALUE1(PyThreadState *tstate, PyObject *exception_type, PyObject *exception_value) {\n#if PYTHON_VERSION < 0x3c0\n    PyObject *old_exception_type = tstate->curexc_type;\n    PyObject *old_exception_value = tstate->curexc_value;\n    PyObject *old_exception_traceback = tstate->curexc_traceback;\n\n    tstate->curexc_type = exception_type;\n    Py_INCREF(exception_type);\n    tstate->curexc_value = exception_value;\n    tstate->curexc_traceback = NULL;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE0_VALUE1:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception_type);\n    Py_XDECREF(old_exception_value);\n    Py_XDECREF(old_exception_traceback);\n#else\n    PyObject *old_exception = tstate->current_exception;\n\n    tstate->current_exception = exception_value;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"SET_CURRENT_EXCEPTION_TYPE0_VALUE1:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception);\n#endif\n}\n\n// Helper that sets the current thread exception, and has no reference passed.\n// Same as CPython API PyErr_SetString\n\nNUITKA_MAY_BE_UNUSED inline static void SET_CURRENT_EXCEPTION_TYPE0_STR(PyThreadState *tstate, PyObject *exception_type,\n                                                                        char const *value) {\n    PyObject *exception_value = Nuitka_String_FromString(value);\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, exception_type, exception_value);\n}\n\n// Helper that sets the current thread exception with format of one or two arg, and has no reference passed.\nextern void SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyObject *exception_type, char const *format, char const *value);\nextern void SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyObject *exception_type, char const *format, char const *value1,\n                                                char const *value2);\nextern void SET_CURRENT_EXCEPTION_TYPE0_FORMAT3(PyObject *exception_type, char const *format, char const *value1,\n                                                char const *value2, char const *value3);\n\nextern void SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(char const *format, PyObject *mistyped);\nextern void SET_CURRENT_EXCEPTION_TYPE_COMPLAINT_NICE(char const *format, PyObject *mistyped);\n\n#if PYTHON_VERSION < 0x300\n\n// Preserve the current exception as the frame to restore.\nNUITKA_MAY_BE_UNUSED static inline void PRESERVE_FRAME_EXCEPTION(PyThreadState *tstate,\n                                                                 struct Nuitka_FrameObject *frame_object) {\n    PyFrameObject *frame = (PyFrameObject *)frame_object;\n\n    // Setting exception for frame if not already done.\n    if (frame->f_exc_type == NULL) {\n        if (tstate->exc_type != NULL && tstate->exc_type != Py_None) {\n#if _DEBUG_EXCEPTIONS\n            PRINT_STRING(\"PRESERVE_FRAME_EXCEPTION: preserve thread exception\\n\");\n#endif\n            frame->f_exc_type = tstate->exc_type;\n            Py_INCREF(frame->f_exc_type);\n            frame->f_exc_value = tstate->exc_value;\n            Py_XINCREF(frame->f_exc_value);\n            frame->f_exc_traceback = tstate->exc_traceback;\n            Py_XINCREF(frame->f_exc_traceback);\n        } else {\n#if _DEBUG_EXCEPTIONS\n            PRINT_STRING(\"PRESERVE_FRAME_EXCEPTION: no exception to preserve\\n\");\n#endif\n            frame->f_exc_type = Py_None;\n            Py_INCREF(frame->f_exc_type);\n            frame->f_exc_value = NULL;\n            frame->f_exc_traceback = NULL;\n        }\n    }\n#if _DEBUG_EXCEPTIONS\n    else {\n        PRINT_STRING(\"PRESERVE_FRAME_EXCEPTION: already preserving\\n\");\n    }\n\n    PRINT_ITEM((PyObject *)frame_object);\n    PRINT_NEW_LINE();\n    PRINT_EXCEPTION(frame->f_exc_type, frame->f_exc_value, (PyTracebackObject *)frame->f_exc_traceback);\n#endif\n}\n\n// Restore a previously preserved exception to the frame.\nNUITKA_MAY_BE_UNUSED static inline void RESTORE_FRAME_EXCEPTION(PyThreadState *tstate,\n                                                                struct Nuitka_FrameObject *frame_object) {\n    PyFrameObject *frame = (PyFrameObject *)frame_object;\n\n    if (frame->f_exc_type) {\n#if _DEBUG_EXCEPTIONS\n        PRINT_STRING(\"RESTORE_FRAME_EXCEPTION: restoring preserved\\n\");\n        PRINT_ITEM((PyObject *)frame_object);\n        PRINT_NEW_LINE();\n#endif\n\n        struct Nuitka_ExceptionStackItem exc_state;\n\n        exc_state.exception_type = frame->f_exc_type;\n        exc_state.exception_value = frame->f_exc_value;\n        exc_state.exception_tb = (PyTracebackObject *)frame->f_exc_traceback;\n\n        SET_CURRENT_EXCEPTION(tstate, &exc_state);\n\n        frame->f_exc_type = NULL;\n        frame->f_exc_value = NULL;\n        frame->f_exc_traceback = NULL;\n    }\n#if _DEBUG_EXCEPTIONS\n    else {\n        PRINT_STRING(\"RESTORE_FRAME_EXCEPTION: nothing to restore\\n\");\n        PRINT_ITEM((PyObject *)frame_object);\n        PRINT_NEW_LINE();\n    }\n#endif\n}\n\n#endif\n\n// Similar to PyException_SetTraceback, only done for Python3.\n#if PYTHON_VERSION < 0x300\n#define ATTACH_TRACEBACK_TO_EXCEPTION_VALUE(exception_value, exception_tb) ;\n#else\nNUITKA_MAY_BE_UNUSED static inline void ATTACH_TRACEBACK_TO_EXCEPTION_VALUE(PyObject *exception_value,\n                                                                            PyTracebackObject *exception_tb) {\n    CHECK_OBJECT(exception_value);\n    CHECK_OBJECT(exception_tb);\n\n    if (exception_tb == (PyTracebackObject *)Py_None || exception_tb == NULL) {\n        return;\n    }\n\n    assert(PyExceptionInstance_Check(exception_value));\n    assert(PyTraceBack_Check(exception_tb));\n\n    PyBaseExceptionObject *e = (PyBaseExceptionObject *)exception_value;\n\n    PyObject *old = e->traceback;\n    Py_INCREF(exception_tb);\n    e->traceback = (PyObject *)exception_tb;\n    Py_XDECREF(old);\n}\n\n// Much like \"PyException_GetTraceback\", but does not give a reference.\nNUITKA_MAY_BE_UNUSED static inline PyTracebackObject *GET_EXCEPTION_TRACEBACK(PyObject *exception_value) {\n    assert(PyExceptionInstance_Check(exception_value));\n\n    PyBaseExceptionObject *exc_object = (PyBaseExceptionObject *)(exception_value);\n    return (PyTracebackObject *)exc_object->traceback;\n}\n#endif\n\nextern void Nuitka_Err_NormalizeException(PyThreadState *tstate, PyObject **exc, PyObject **val,\n                                          PyTracebackObject **tb);\n\n// Normalize an exception.\nNUITKA_MAY_BE_UNUSED static inline void NORMALIZE_EXCEPTION(PyThreadState *tstate, PyObject **exception_type,\n                                                            PyObject **exception_value,\n                                                            PyTracebackObject **exception_tb) {\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"NORMALIZE_EXCEPTION: Enter\\n\");\n    PRINT_EXCEPTION(*exception_type, *exception_value, *exception_tb);\n#endif\n    CHECK_OBJECT_X(*exception_type);\n    CHECK_OBJECT_X(*exception_value);\n    if (exception_tb) {\n        CHECK_OBJECT_X(*exception_tb);\n    }\n\n    // TODO: Often we already know this to be true.\n    if (*exception_type != Py_None && *exception_type != NULL) {\n        Nuitka_Err_NormalizeException(tstate, exception_type, exception_value, exception_tb);\n    }\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"NORMALIZE_EXCEPTION: Leave\\n\");\n    PRINT_EXCEPTION(*exception_type, *exception_value, exception_tb ? *exception_tb : NULL);\n#endif\n}\n\n// Publish an exception, erasing the values of the variables.\nNUITKA_MAY_BE_UNUSED static inline void PUBLISH_CURRENT_EXCEPTION(PyThreadState *tstate, PyObject **exception_type,\n                                                                  PyObject **exception_value,\n                                                                  PyTracebackObject **exception_tb) {\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"PUBLISH_CURRENT_EXCEPTION:\\n\");\n#endif\n    NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n    ATTACH_TRACEBACK_TO_EXCEPTION_VALUE(*exception_value, *exception_tb);\n\n    struct Nuitka_ExceptionStackItem exc_state;\n\n#if PYTHON_VERSION < 0x3b0\n    exc_state.exception_type = *exception_type;\n#endif\n    exc_state.exception_value = *exception_value;\n#if PYTHON_VERSION < 0x3b0\n    exc_state.exception_tb = *exception_tb;\n#endif\n\n    SET_CURRENT_EXCEPTION(tstate, &exc_state);\n\n#if PYTHON_VERSION >= 0x3b0\n    // TODO: We shouldn't get these in the first place, we don't transfer the\n    // type anymore and the exception tb could come in already attached.\n    Py_DECREF(*exception_type);\n    Py_XDECREF(*exception_tb);\n#endif\n\n    *exception_type = NULL;\n    *exception_value = NULL;\n    *exception_tb = NULL;\n}\n\n#if PYTHON_VERSION >= 0x300\n// Attach the exception context if necessary.\nNUITKA_MAY_BE_UNUSED static inline void ADD_EXCEPTION_CONTEXT(PyThreadState *tstate, PyObject **exception_type,\n                                                              PyObject **exception_value) {\n    PyObject *context = EXC_VALUE(tstate);\n\n    if (context != NULL) {\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, NULL);\n\n        Py_INCREF(context);\n        PyException_SetContext(*exception_value, context);\n    }\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static bool EXCEPTION_MATCH_BOOL_SINGLE(PyThreadState *tstate, PyObject *exception_value,\n                                                             PyObject *exception_checked);\n\nNUITKA_MAY_BE_UNUSED static bool _CHECK_AND_CLEAR_EXCEPTION_OCCURRED(PyThreadState *tstate, PyObject *exception_type) {\n#if PYTHON_VERSION < 0x3c0\n    PyObject *exception_current = tstate->curexc_type;\n#else\n    PyObject *exception_current = tstate->current_exception;\n\n#endif\n    if (exception_current == NULL) {\n        return true;\n    } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_current, exception_type)) {\n        // Clear the exception first, we believe we know it doesn't have side effects.\n        Py_DECREF(exception_current);\n\n#if PYTHON_VERSION < 0x3c0\n        tstate->curexc_type = NULL;\n\n        PyObject *old_value = tstate->curexc_value;\n        PyObject *old_tb = tstate->curexc_traceback;\n\n        tstate->curexc_value = NULL;\n        tstate->curexc_traceback = NULL;\n\n        Py_XDECREF(old_value);\n        Py_XDECREF(old_tb);\n#else\n        tstate->current_exception = NULL;\n#endif\n\n        return true;\n    } else {\n        return false;\n    }\n}\n\n/* Special helper that checks for StopIteration and if so clears it, only\n   indicating if it was set in the return value.\n\n   Equivalent to if(PyErr_ExceptionMatches(PyExc_StopIteration) PyErr_Clear();\n\n   If error is raised by built-in function next() and an iterator’s __next__()\n   method to signal that there are no further items produced by the iterator then\n   it resets the TSTATE to NULL and returns True else return False\n\n*/\nNUITKA_MAY_BE_UNUSED static bool CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(PyThreadState *tstate) {\n    return _CHECK_AND_CLEAR_EXCEPTION_OCCURRED(tstate, PyExc_StopIteration);\n}\n\n/* Special helper that checks for KeyError and if so clears it, only\n   indicating if it was set in the return value.\n\n   Equivalent to if(PyErr_ExceptionMatches(PyExc_KeyError) PyErr_Clear();\n\n*/\nNUITKA_MAY_BE_UNUSED static bool CHECK_AND_CLEAR_KEY_ERROR_OCCURRED(PyThreadState *tstate) {\n    return _CHECK_AND_CLEAR_EXCEPTION_OCCURRED(tstate, PyExc_KeyError);\n}\n\nNUITKA_MAY_BE_UNUSED static bool CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(PyThreadState *tstate) {\n    return _CHECK_AND_CLEAR_EXCEPTION_OCCURRED(tstate, PyExc_AttributeError);\n}\n\n// Format a NameError exception for a variable name, chains with existing exception.\nextern void SET_CURRENT_EXCEPTION_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name);\n\n#if PYTHON_VERSION < 0x340\n// Same as SET_CURRENT_EXCEPTION_NAME_ERROR with different wording, sometimes for Python2.\nextern void SET_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name);\n#endif\n\n// Format a UnboundLocalError exception for a variable name.\nextern void FORMAT_UNBOUND_LOCAL_ERROR(PyObject **exception_type, PyObject **exception_value, PyObject *variable_name);\n\nextern void FORMAT_UNBOUND_CLOSURE_ERROR(PyObject **exception_type, PyObject **exception_value,\n                                         PyObject *variable_name);\n\n#if PYTHON_VERSION >= 0x3c0\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE1(PyObject *element1);\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_EXCEPTION_FROM_TYPE_ARG0(PyThreadState *tstate, PyObject *type,\n                                                                    PyObject *arg) {\n    PyBaseExceptionObject *self;\n\n    PyTypeObject *type_object = (PyTypeObject *)type;\n\n    self = (PyBaseExceptionObject *)(type_object->tp_alloc(type_object, 0));\n\n    self->dict = NULL;\n    self->notes = NULL;\n    self->traceback = self->cause = self->context = NULL;\n    self->suppress_context = 0;\n\n    assert(arg != NULL);\n\n    if (!PyTuple_Check(arg)) {\n        self->args = MAKE_TUPLE1(arg);\n    } else {\n        self->args = Py_NewRef(arg);\n    }\n\n    return (PyObject *)self;\n}\n#else\n\nextern PyObject *CALL_FUNCTION_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg);\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_EXCEPTION_FROM_TYPE_ARG0(PyThreadState *tstate, PyObject *type,\n                                                                    PyObject *arg) {\n    return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, type, arg);\n}\n\n#endif\n\n#if PYTHON_VERSION < 0x3c0\nstruct Nuitka_ExceptionPreservationItem {\n    PyObject *exception_type;\n    PyObject *exception_value;\n    PyTracebackObject *exception_tb;\n};\n\nNUITKA_MAY_BE_UNUSED static void FETCH_ERROR_OCCURRED_STATE(PyThreadState *tstate,\n                                                            struct Nuitka_ExceptionPreservationItem *exception_state) {\n    FETCH_ERROR_OCCURRED(tstate, &exception_state->exception_type, &exception_state->exception_value,\n                         &exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRESTORE_ERROR_OCCURRED_STATE(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    RESTORE_ERROR_OCCURRED(tstate, exception_state->exception_type, exception_state->exception_value,\n                           exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nFETCH_ERROR_OCCURRED_STATE_UNTRACED(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    FETCH_ERROR_OCCURRED_UNTRACED(tstate, &exception_state->exception_type, &exception_state->exception_value,\n                                  &exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRESTORE_ERROR_OCCURRED_STATE_UNTRACED(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    RESTORE_ERROR_OCCURRED_UNTRACED(tstate, exception_state->exception_type, exception_state->exception_value,\n                                    exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSERT_SAME_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state1,\n                            struct Nuitka_ExceptionPreservationItem *exception_state2) {\n    assert(exception_state1->exception_type == exception_state2->exception_type);\n    assert(exception_state1->exception_value == exception_state2->exception_value);\n    assert(exception_state1->exception_tb == exception_state2->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSERT_EMPTY_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem const *exception_state) {\n    assert(exception_state->exception_type == NULL);\n    assert(exception_state->exception_value == NULL);\n    assert(exception_state->exception_tb == NULL);\n}\n\nNUITKA_MAY_BE_UNUSED static void INIT_ERROR_OCCURRED_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    exception_state->exception_type = NULL;\n    exception_state->exception_value = NULL;\n    exception_state->exception_tb = NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRELEASE_ERROR_OCCURRED_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    Py_DECREF(exception_state->exception_type);\n    Py_XDECREF(exception_state->exception_value);\n    Py_XDECREF(exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRELEASE_ERROR_OCCURRED_STATE_X(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    Py_XDECREF(exception_state->exception_type);\n    Py_XDECREF(exception_state->exception_value);\n    Py_XDECREF(exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nSET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                           PyObject *exception_type, PyObject *exception_value,\n                                           PyTracebackObject *exception_tb) {\n    Py_INCREF(exception_type);\n    Py_XINCREF(exception_value);\n    Py_XINCREF(exception_tb);\n\n    exception_state->exception_type = exception_type;\n    exception_state->exception_value = exception_value;\n    exception_state->exception_tb = exception_tb;\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSIGN_ARGS_FROM_EXCEPTION_PRESERVATION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                              PyObject **exception_type, PyObject **exception_value,\n                                              PyTracebackObject **exception_tb) {\n\n    *exception_type = exception_state->exception_type;\n    Py_INCREF(*exception_type);\n    *exception_value = exception_state->exception_value;\n    Py_XINCREF(*exception_value);\n    *exception_tb = exception_state->exception_tb;\n    Py_XINCREF(*exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static PyTracebackObject *\nGET_EXCEPTION_STATE_TRACEBACK(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    return exception_state->exception_tb;\n}\n\nNUITKA_MAY_BE_UNUSED static void SET_EXCEPTION_STATE_TRACEBACK(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                                               PyTracebackObject *exception_tb) {\n    Py_XDECREF(exception_state->exception_tb);\n\n    exception_state->exception_tb = exception_tb;\n}\n\nNUITKA_MAY_BE_UNUSED static bool HAS_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    return exception_state->exception_type != NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static bool\nEXCEPTION_STATE_MATCH_BOOL_SINGLE(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state,\n                                  PyObject *exception_checked) {\n    return EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_state->exception_type, exception_checked);\n}\n\nNUITKA_MAY_BE_UNUSED inline static void\nCHECK_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT(exception_state->exception_type);\n    CHECK_OBJECT_X(exception_state->exception_value);\n    CHECK_OBJECT_X(exception_state->exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED inline static void\nCHECK_EXCEPTION_STATE_X(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT_X(exception_state->exception_type);\n    CHECK_OBJECT_X(exception_state->exception_value);\n    CHECK_OBJECT_X(exception_state->exception_tb);\n}\n\n#else\nstruct Nuitka_ExceptionPreservationItem {\n    PyObject *exception_value;\n};\n\nNUITKA_MAY_BE_UNUSED static void FETCH_ERROR_OCCURRED_STATE(PyThreadState *tstate,\n                                                            struct Nuitka_ExceptionPreservationItem *exception_state) {\n    exception_state->exception_value = tstate->current_exception;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"FETCH_ERROR_OCCURRED_STATE:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    tstate->current_exception = NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static void\nFETCH_ERROR_OCCURRED_STATE_UNTRACED(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    exception_state->exception_value = tstate->current_exception;\n    tstate->current_exception = NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRESTORE_ERROR_OCCURRED_STATE(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    PyObject *old_exception_value = tstate->current_exception;\n    tstate->current_exception = exception_state->exception_value;\n\n#if _DEBUG_EXCEPTIONS\n    PRINT_STRING(\"RESTORE_ERROR_OCCURRED:\\n\");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    Py_XDECREF(old_exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRESTORE_ERROR_OCCURRED_STATE_UNTRACED(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    PyObject *old_exception_value = tstate->current_exception;\n    tstate->current_exception = exception_state->exception_value;\n\n    Py_XDECREF(old_exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSERT_SAME_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state1,\n                            struct Nuitka_ExceptionPreservationItem *exception_state2) {\n    assert(exception_state1->exception_value == exception_state2->exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSERT_EMPTY_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem const *exception_state) {\n    assert(exception_state->exception_value == NULL);\n}\n\nNUITKA_MAY_BE_UNUSED static void INIT_ERROR_OCCURRED_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    exception_state->exception_value = NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRELEASE_ERROR_OCCURRED_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    Py_DECREF(exception_state->exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nRELEASE_ERROR_OCCURRED_STATE_X(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    Py_XDECREF(exception_state->exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nSET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                           PyObject *exception_type, PyObject *exception_value,\n                                           PyTracebackObject *exception_tb) {\n    // TODO: Python 3.12 conversion of args into single value object.\n    assert(false);\n}\n\nNUITKA_MAY_BE_UNUSED static void\nASSIGN_ARGS_FROM_EXCEPTION_PRESERVATION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                              PyObject **exception_type, PyObject **exception_value,\n                                              PyTracebackObject **exception_tb) {\n\n    assert(false);\n}\n\nNUITKA_MAY_BE_UNUSED static PyTracebackObject *\nGET_EXCEPTION_STATE_TRACEBACK(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    return GET_EXCEPTION_TRACEBACK(exception_state->exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static void SET_EXCEPTION_STATE_TRACEBACK(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                                               PyTracebackObject *exception_tb) {\n    ATTACH_TRACEBACK_TO_EXCEPTION_VALUE(exception_state->exception_value, exception_tb);\n}\n\nNUITKA_MAY_BE_UNUSED static bool HAS_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    return exception_state->exception_value != NULL;\n}\n\nNUITKA_MAY_BE_UNUSED static bool\nEXCEPTION_STATE_MATCH_BOOL_SINGLE(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state,\n                                  PyObject *exception_checked) {\n    return EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_state->exception_value, exception_checked);\n}\n\nNUITKA_MAY_BE_UNUSED inline static void\nCHECK_EXCEPTION_STATE(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT(exception_state->exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED inline static void\nCHECK_EXCEPTION_STATE_X(struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT_X(exception_state->exception_value);\n}\n\n#endif\n\nNUITKA_MAY_BE_UNUSED inline static void\nSET_EXCEPTION_PRESERVATION_STATE_FROM_TYPE0_STR(struct Nuitka_ExceptionPreservationItem *exception_state,\n                                                PyObject *exception_type, char const *value) {\n    PyObject *exception_value = Nuitka_String_FromString(value);\n\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(exception_state, exception_type, exception_value, NULL);\n    Py_DECREF(exception_value);\n}\n\nNUITKA_MAY_BE_UNUSED static bool EXCEPTION_MATCH_GENERATOR(PyThreadState *tstate, PyObject *exception_value) {\n    CHECK_OBJECT(exception_value);\n\n    // We need to check the class.\n    if (PyExceptionInstance_Check(exception_value)) {\n        exception_value = PyExceptionInstance_Class(exception_value);\n    }\n\n    // Lets be optimistic. If it matches, we would be wasting our time.\n    if (exception_value == PyExc_GeneratorExit || exception_value == PyExc_StopIteration) {\n        return true;\n    }\n\n    if (PyExceptionClass_Check(exception_value)) {\n        // Save the current exception, if any, we must preserve it.\n        struct Nuitka_ExceptionPreservationItem saved_exception_state;\n        FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        int res = PyObject_IsSubclass(exception_value, PyExc_GeneratorExit);\n\n        // This function must not fail, so print the error here */\n        if (unlikely(res == -1)) {\n            PyErr_WriteUnraisable(exception_value);\n        }\n\n        if (res == 1) {\n            return true;\n        }\n\n        res = PyObject_IsSubclass(exception_value, PyExc_StopIteration);\n\n        // This function must not fail, so print the error here */\n        if (unlikely(res == -1)) {\n            PyErr_WriteUnraisable(exception_value);\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        return res == 1;\n    }\n\n    return false;\n}\n\nNUITKA_MAY_BE_UNUSED static bool EXCEPTION_MATCH_BOOL_SINGLE(PyThreadState *tstate, PyObject *exception_value,\n                                                             PyObject *exception_checked) {\n    CHECK_OBJECT(exception_value);\n    CHECK_OBJECT(exception_checked);\n\n    // We need to check the class.\n    if (PyExceptionInstance_Check(exception_value)) {\n        exception_value = PyExceptionInstance_Class(exception_value);\n    }\n\n    // Lets be optimistic. If it matches, we would be wasting our time.\n    if (exception_value == exception_checked) {\n        return true;\n    }\n\n    if (PyExceptionClass_Check(exception_value)) {\n        // Save the current exception, if any, we must preserve it.\n        struct Nuitka_ExceptionPreservationItem saved_exception_state;\n        FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        int res = PyObject_IsSubclass(exception_value, exception_checked);\n\n        // This function must not fail, so print the error here */\n        if (unlikely(res == -1)) {\n            PyErr_WriteUnraisable(exception_value);\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        return res == 1;\n    }\n\n    return false;\n}\n\nNUITKA_MAY_BE_UNUSED static inline int _EXCEPTION_MATCH_BOOL(PyThreadState *tstate, PyObject *exception_value,\n                                                             PyObject *exception_checked) {\n    CHECK_OBJECT(exception_value);\n    CHECK_OBJECT(exception_checked);\n\n    // Reduce to exception class actually. TODO: Can this not be an instance from called code?!\n    PyObject *exception_class;\n    if (PyExceptionInstance_Check(exception_value)) {\n        exception_class = PyExceptionInstance_Class(exception_value);\n    } else {\n        exception_class = exception_value;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (PyExceptionClass_Check(exception_class) && PyExceptionClass_Check(exception_checked)) {\n        // Save the current exception, if any, we must preserve it.\n        struct Nuitka_ExceptionPreservationItem saved_exception_state;\n        FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        // Avoid recursion limit being exceeded just then\n        int recursion_limit = Py_GetRecursionLimit();\n        if (recursion_limit < (1 << 30)) {\n            Py_SetRecursionLimit(recursion_limit + 5);\n        }\n\n        int res = PyObject_IsSubclass(exception_class, exception_checked);\n\n        Py_SetRecursionLimit(recursion_limit);\n\n        // This function must not fail, so print the error here */\n        if (unlikely(res == -1)) {\n            PyErr_WriteUnraisable(exception_value);\n            res = 0;\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        return res;\n    } else {\n        return exception_class == exception_checked;\n    }\n#else\n    if (PyExceptionClass_Check(exception_class) && PyExceptionClass_Check(exception_checked)) {\n        return Nuitka_Type_IsSubtype((PyTypeObject *)exception_class, (PyTypeObject *)exception_checked);\n    } else {\n        return exception_class == exception_checked;\n    }\n#endif\n}\n\n// This is for the actual comparison operation that is being done in the\n// node tree, no other code should use it. TODO: Then it's probably not\n// properly located here.\nNUITKA_MAY_BE_UNUSED static inline int EXCEPTION_MATCH_BOOL(PyThreadState *tstate, PyObject *exception_value,\n                                                            PyObject *exception_checked) {\n    CHECK_OBJECT(exception_value);\n    CHECK_OBJECT(exception_checked);\n\n#if PYTHON_VERSION >= 0x300\n    /* Note: Exact matching tuples seems to needed, despite using GET_ITEM later\n       on, this probably cannot be overloaded that deep. */\n    if (PyTuple_Check(exception_checked)) {\n        Py_ssize_t length = PyTuple_GET_SIZE(exception_checked);\n\n        for (Py_ssize_t i = 0; i < length; i += 1) {\n            PyObject *element = PyTuple_GET_ITEM(exception_checked, i);\n\n            if (unlikely(!PyExceptionClass_Check(element))) {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(\n                    tstate, PyExc_TypeError, \"catching classes that do not inherit from BaseException is not allowed\");\n                return -1;\n            }\n        }\n    } else if (unlikely(!PyExceptionClass_Check(exception_checked))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"catching classes that do not inherit from BaseException is not allowed\");\n        return -1;\n    }\n#endif\n\n    if (PyTuple_Check(exception_checked)) {\n        Py_ssize_t length = PyTuple_GET_SIZE(exception_checked);\n\n        for (Py_ssize_t i = 0; i < length; i += 1) {\n            PyObject *element = PyTuple_GET_ITEM(exception_checked, i);\n\n            int res = EXCEPTION_MATCH_BOOL(tstate, exception_value, element);\n\n            if (res != 0) {\n                return res;\n            }\n        }\n\n        return 0;\n    } else {\n        return _EXCEPTION_MATCH_BOOL(tstate, exception_value, exception_checked);\n    }\n}\n\n#if PYTHON_VERSION >= 0x3c0\n\n// Python3.12: TODO: Must get rid of those by generating code with exception_state\nNUITKA_MAY_BE_UNUSED static void FETCH_ERROR_OCCURRED(PyThreadState *tstate, PyObject **exception_type,\n                                                      PyObject **exception_value,\n                                                      PyTracebackObject **exception_traceback) {\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &exception_state);\n    ASSIGN_ARGS_FROM_EXCEPTION_PRESERVATION_STATE(&exception_state, exception_type, exception_value,\n                                                  exception_traceback);\n}\n\nNUITKA_MAY_BE_UNUSED static void RESTORE_ERROR_OCCURRED(PyThreadState *tstate, PyObject *exception_type,\n                                                        PyObject *exception_value,\n                                                        PyTracebackObject *exception_traceback) {\n    NORMALIZE_EXCEPTION(tstate, &exception_type, &exception_value, &exception_traceback);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, exception_type, exception_value, exception_traceback);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &exception_state);\n}\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/filesystem_paths.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_FILESYSTEM_PATH_OPS_H__\n#define __NUITKA_FILESYSTEM_PATH_OPS_H__\n\n#include \"nuitka/safe_string_ops.h\"\n\n// Have a type for filename type different on Linux and Win32.\n#if defined(_WIN32)\n#define filename_char_t wchar_t\n#define FILENAME_EMPTY_STR L\"\"\n#define FILENAME_SEP_STR L\"\\\\\"\n#define FILENAME_SEP_CHAR L'\\\\'\n#define FILENAME_FORMAT_STR \"%ls\"\n#define appendStringSafeFilename appendWStringSafeW\n#define appendCharSafeFilename appendWCharSafeW\n#define FILENAME_TMP_STR L\".tmp\"\n#define FILENAME_AWAY_STR L\".away\"\n#define expandTemplatePathFilename expandTemplatePathW\n#define strlenFilename wcslen\n#define strcmpFilename wcscmp\n#define strdupFilename wcsdup\n#define scanFilename swscanf\n#define Nuitka_String_FromFilename(filename) NuitkaUnicode_FromWideChar(filename, -1)\n#else\n#define filename_char_t char\n#define FILENAME_EMPTY_STR \"\"\n#define FILENAME_SEP_STR \"/\"\n#define FILENAME_SEP_CHAR '/'\n#define FILENAME_FORMAT_STR \"%s\"\n#define appendStringSafeFilename appendStringSafe\n#define appendCharSafeFilename appendCharSafe\n#define FILENAME_TMP_STR \".tmp\"\n#define FILENAME_AWAY_STR \".away\"\n#define expandTemplatePathFilename expandTemplatePath\n#define strlenFilename strlen\n#define strcmpFilename strcmp\n#define strdupFilename strdup\n#define scanFilename sscanf\n#define Nuitka_String_FromFilename Nuitka_String_FromString\n#endif\n\n#if defined(_WIN32)\n#include <windows.h>\n#endif\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <wchar.h>\n\n// Have a type for file type different on Linux and Win32.\n#if defined(_WIN32)\n#define FILE_HANDLE HANDLE\n#define FILE_HANDLE_NULL INVALID_HANDLE_VALUE\n#else\n#define FILE_HANDLE FILE *\n#define FILE_HANDLE_NULL NULL\n#endif\n\n// Defined by Python headers, for onefile we do it ourselves.\n#ifndef MAXPATHLEN\n#define MAXPATHLEN 4096\n#endif\n\n// Get path of the running binary.\nextern filename_char_t *getBinaryPath(void);\n\nextern FILE_HANDLE openFileForReading(filename_char_t const *filename);\nextern FILE_HANDLE createFileForWriting(filename_char_t const *filename);\nextern int64_t getFileSize(FILE_HANDLE file_handle);\nextern bool readFileChunk(FILE_HANDLE file_handle, void *buffer, size_t size);\nextern bool writeFileChunk(FILE_HANDLE file_handle, void const *buffer, size_t size);\nextern bool closeFile(FILE_HANDLE target_file);\nextern error_code_t getLastErrorCode(void);\n\nextern int getFileMode(filename_char_t const *filename);\nextern bool copyFile(filename_char_t const *source, filename_char_t const *dest, int mode);\nextern bool deleteFile(filename_char_t const *filename);\nextern bool renameFile(filename_char_t const *source, filename_char_t const *dest);\n\nextern uint32_t getFileCRC32(filename_char_t const *filename);\n\n// Expand symbolic paths, containing {TEMP}, {PID} without overflowing.\nextern bool expandTemplatePathW(wchar_t *target, wchar_t const *source, size_t buffer_size);\nextern bool expandTemplatePath(char *target, char const *source, size_t buffer_size);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/freelists.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_FREELISTS_H__\n#define __NUITKA_FREELISTS_H__\n\n#ifndef __cplusplus\n#include \"stdbool.h\"\n#endif\n\n#ifdef _NUITKA_EXPERIMENTAL_DISABLE_FREELIST_ALL\nstatic const bool use_freelists = false;\n#else\nstatic const bool use_freelists = true;\n#endif\n\n#define allocateFromFreeList(free_list, object_type, type_type, size)                                                  \\\n    if (free_list != NULL) {                                                                                           \\\n        result = free_list;                                                                                            \\\n        free_list = *((object_type **)free_list);                                                                      \\\n        free_list##_count -= 1;                                                                                        \\\n        assert(free_list##_count >= 0);                                                                                \\\n                                                                                                                       \\\n        if (Py_SIZE(result) < size) {                                                                                  \\\n            result = PyObject_GC_Resize(object_type, result, size);                                                    \\\n            assert(result != NULL);                                                                                    \\\n        }                                                                                                              \\\n                                                                                                                       \\\n        Nuitka_Py_NewReference((PyObject *)result);                                                                    \\\n    } else {                                                                                                           \\\n        result = (object_type *)Nuitka_GC_NewVar(&type_type, size);                                                    \\\n    }                                                                                                                  \\\n    CHECK_OBJECT(result);\n\n#define allocateFromFreeListFixed(free_list, object_type, type_type)                                                   \\\n    if (free_list != NULL) {                                                                                           \\\n        result = free_list;                                                                                            \\\n        free_list = *((object_type **)free_list);                                                                      \\\n        free_list##_count -= 1;                                                                                        \\\n        assert(free_list##_count >= 0);                                                                                \\\n                                                                                                                       \\\n        Nuitka_Py_NewReference((PyObject *)result);                                                                    \\\n    } else {                                                                                                           \\\n        result = (object_type *)Nuitka_GC_New(&type_type);                                                             \\\n    }                                                                                                                  \\\n    CHECK_OBJECT(result);\n\n#define releaseToFreeList(free_list, object, max_free_list_count)                                                      \\\n    if (free_list != NULL || max_free_list_count == 0 || use_freelists == false) {                                     \\\n        if (free_list##_count >= max_free_list_count) {                                                                \\\n            PyObject_GC_Del(object);                                                                                   \\\n        } else {                                                                                                       \\\n            *((void **)object) = (void *)free_list;                                                                    \\\n            free_list = object;                                                                                        \\\n                                                                                                                       \\\n            free_list##_count += 1;                                                                                    \\\n        }                                                                                                              \\\n    } else {                                                                                                           \\\n        free_list = object;                                                                                            \\\n        *((void **)object) = NULL;                                                                                     \\\n                                                                                                                       \\\n        assert(free_list##_count == 0);                                                                                \\\n                                                                                                                       \\\n        free_list##_count += 1;                                                                                        \\\n    }\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/hedley.h",
    "content": "/* Hedley - https://nemequ.github.io/hedley\n * Created by Evan Nemerson <evan@nemerson.com>\n *\n * To the extent possible under law, the author(s) have dedicated all\n * copyright and related and neighboring rights to this software to\n * the public domain worldwide. This software is distributed without\n * any warranty.\n *\n * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.\n * SPDX-License-Identifier: CC0-1.0\n */\n\n#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 14)\n#if defined(HEDLEY_VERSION)\n#undef HEDLEY_VERSION\n#endif\n#define HEDLEY_VERSION 14\n\n#if defined(HEDLEY_STRINGIFY_EX)\n#undef HEDLEY_STRINGIFY_EX\n#endif\n#define HEDLEY_STRINGIFY_EX(x) #x\n\n#if defined(HEDLEY_STRINGIFY)\n#undef HEDLEY_STRINGIFY\n#endif\n#define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x)\n\n#if defined(HEDLEY_CONCAT_EX)\n#undef HEDLEY_CONCAT_EX\n#endif\n#define HEDLEY_CONCAT_EX(a, b) a##b\n\n#if defined(HEDLEY_CONCAT)\n#undef HEDLEY_CONCAT\n#endif\n#define HEDLEY_CONCAT(a, b) HEDLEY_CONCAT_EX(a, b)\n\n#if defined(HEDLEY_CONCAT3_EX)\n#undef HEDLEY_CONCAT3_EX\n#endif\n#define HEDLEY_CONCAT3_EX(a, b, c) a##b##c\n\n#if defined(HEDLEY_CONCAT3)\n#undef HEDLEY_CONCAT3\n#endif\n#define HEDLEY_CONCAT3(a, b, c) HEDLEY_CONCAT3_EX(a, b, c)\n\n#if defined(HEDLEY_VERSION_ENCODE)\n#undef HEDLEY_VERSION_ENCODE\n#endif\n#define HEDLEY_VERSION_ENCODE(major, minor, revision) (((major)*1000000) + ((minor)*1000) + (revision))\n\n#if defined(HEDLEY_VERSION_DECODE_MAJOR)\n#undef HEDLEY_VERSION_DECODE_MAJOR\n#endif\n#define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000)\n\n#if defined(HEDLEY_VERSION_DECODE_MINOR)\n#undef HEDLEY_VERSION_DECODE_MINOR\n#endif\n#define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)\n\n#if defined(HEDLEY_VERSION_DECODE_REVISION)\n#undef HEDLEY_VERSION_DECODE_REVISION\n#endif\n#define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000)\n\n#if defined(HEDLEY_GNUC_VERSION)\n#undef HEDLEY_GNUC_VERSION\n#endif\n#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)\n#define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)\n#elif defined(__GNUC__)\n#define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)\n#endif\n\n#if defined(HEDLEY_GNUC_VERSION_CHECK)\n#undef HEDLEY_GNUC_VERSION_CHECK\n#endif\n#if defined(HEDLEY_GNUC_VERSION)\n#define HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)                                                                 \\\n    (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_MSVC_VERSION)\n#undef HEDLEY_MSVC_VERSION\n#endif\n#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)\n#define HEDLEY_MSVC_VERSION                                                                                            \\\n    HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100)\n#elif defined(_MSC_FULL_VER) && !defined(__ICL)\n#define HEDLEY_MSVC_VERSION                                                                                            \\\n    HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10)\n#elif defined(_MSC_VER) && !defined(__ICL)\n#define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)\n#endif\n\n#if defined(HEDLEY_MSVC_VERSION_CHECK)\n#undef HEDLEY_MSVC_VERSION_CHECK\n#endif\n#if !defined(HEDLEY_MSVC_VERSION)\n#define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) (0)\n#elif defined(_MSC_VER) && (_MSC_VER >= 1400)\n#define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch)                                                                 \\\n    (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))\n#elif defined(_MSC_VER) && (_MSC_VER >= 1200)\n#define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch)                                                                 \\\n    (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))\n#else\n#define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) (_MSC_VER >= ((major * 100) + (minor)))\n#endif\n\n#if defined(HEDLEY_INTEL_VERSION)\n#undef HEDLEY_INTEL_VERSION\n#endif\n#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL)\n#define HEDLEY_INTEL_VERSION                                                                                           \\\n    HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE)\n#elif defined(__INTEL_COMPILER) && !defined(__ICL)\n#define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)\n#endif\n\n#if defined(HEDLEY_INTEL_VERSION_CHECK)\n#undef HEDLEY_INTEL_VERSION_CHECK\n#endif\n#if defined(HEDLEY_INTEL_VERSION)\n#define HEDLEY_INTEL_VERSION_CHECK(major, minor, patch)                                                                \\\n    (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_INTEL_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_INTEL_CL_VERSION)\n#undef HEDLEY_INTEL_CL_VERSION\n#endif\n#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL)\n#define HEDLEY_INTEL_CL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0)\n#endif\n\n#if defined(HEDLEY_INTEL_CL_VERSION_CHECK)\n#undef HEDLEY_INTEL_CL_VERSION_CHECK\n#endif\n#if defined(HEDLEY_INTEL_CL_VERSION)\n#define HEDLEY_INTEL_CL_VERSION_CHECK(major, minor, patch)                                                             \\\n    (HEDLEY_INTEL_CL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_INTEL_CL_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_PGI_VERSION)\n#undef HEDLEY_PGI_VERSION\n#endif\n#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)\n#define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)\n#endif\n\n#if defined(HEDLEY_PGI_VERSION_CHECK)\n#undef HEDLEY_PGI_VERSION_CHECK\n#endif\n#if defined(HEDLEY_PGI_VERSION)\n#define HEDLEY_PGI_VERSION_CHECK(major, minor, patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_PGI_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_SUNPRO_VERSION)\n#undef HEDLEY_SUNPRO_VERSION\n#endif\n#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)\n#define HEDLEY_SUNPRO_VERSION                                                                                          \\\n    HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf),                              \\\n                          (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10)\n#elif defined(__SUNPRO_C)\n#define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C)&0xf)\n#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)\n#define HEDLEY_SUNPRO_VERSION                                                                                          \\\n    HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf),                            \\\n                          (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10)\n#elif defined(__SUNPRO_CC)\n#define HEDLEY_SUNPRO_VERSION                                                                                          \\\n    HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC)&0xf)\n#endif\n\n#if defined(HEDLEY_SUNPRO_VERSION_CHECK)\n#undef HEDLEY_SUNPRO_VERSION_CHECK\n#endif\n#if defined(HEDLEY_SUNPRO_VERSION)\n#define HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch)                                                               \\\n    (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_EMSCRIPTEN_VERSION)\n#undef HEDLEY_EMSCRIPTEN_VERSION\n#endif\n#if defined(__EMSCRIPTEN__)\n#define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__)\n#endif\n\n#if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK)\n#undef HEDLEY_EMSCRIPTEN_VERSION_CHECK\n#endif\n#if defined(HEDLEY_EMSCRIPTEN_VERSION)\n#define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch)                                                           \\\n    (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_ARM_VERSION)\n#undef HEDLEY_ARM_VERSION\n#endif\n#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)\n#define HEDLEY_ARM_VERSION                                                                                             \\\n    HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000,                  \\\n                          (__ARMCOMPILER_VERSION % 10000) / 100)\n#elif defined(__CC_ARM) && defined(__ARMCC_VERSION)\n#define HEDLEY_ARM_VERSION                                                                                             \\\n    HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000,                              \\\n                          (__ARMCC_VERSION % 10000) / 100)\n#endif\n\n#if defined(HEDLEY_ARM_VERSION_CHECK)\n#undef HEDLEY_ARM_VERSION_CHECK\n#endif\n#if defined(HEDLEY_ARM_VERSION)\n#define HEDLEY_ARM_VERSION_CHECK(major, minor, patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_ARM_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_IBM_VERSION)\n#undef HEDLEY_IBM_VERSION\n#endif\n#if defined(__ibmxl__)\n#define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__)\n#elif defined(__xlC__) && defined(__xlC_ver__)\n#define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff)\n#elif defined(__xlC__)\n#define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0)\n#endif\n\n#if defined(HEDLEY_IBM_VERSION_CHECK)\n#undef HEDLEY_IBM_VERSION_CHECK\n#endif\n#if defined(HEDLEY_IBM_VERSION)\n#define HEDLEY_IBM_VERSION_CHECK(major, minor, patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_IBM_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_VERSION)\n#undef HEDLEY_TI_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) &&                                                                                \\\n    (defined(__TMS470__) || defined(__TI_ARM__) || defined(__MSP430__) || defined(__TMS320C2000__))\n#if (__TI_COMPILER_VERSION__ >= 16000000)\n#define HEDLEY_TI_VERSION                                                                                              \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n#endif\n\n#if defined(HEDLEY_TI_VERSION_CHECK)\n#undef HEDLEY_TI_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_VERSION)\n#define HEDLEY_TI_VERSION_CHECK(major, minor, patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_CL2000_VERSION)\n#undef HEDLEY_TI_CL2000_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)\n#define HEDLEY_TI_CL2000_VERSION                                                                                       \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_CL2000_VERSION_CHECK)\n#undef HEDLEY_TI_CL2000_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_CL2000_VERSION)\n#define HEDLEY_TI_CL2000_VERSION_CHECK(major, minor, patch)                                                            \\\n    (HEDLEY_TI_CL2000_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_CL2000_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_CL430_VERSION)\n#undef HEDLEY_TI_CL430_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)\n#define HEDLEY_TI_CL430_VERSION                                                                                        \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_CL430_VERSION_CHECK)\n#undef HEDLEY_TI_CL430_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_CL430_VERSION)\n#define HEDLEY_TI_CL430_VERSION_CHECK(major, minor, patch)                                                             \\\n    (HEDLEY_TI_CL430_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_CL430_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_ARMCL_VERSION)\n#undef HEDLEY_TI_ARMCL_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__))\n#define HEDLEY_TI_ARMCL_VERSION                                                                                        \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_ARMCL_VERSION_CHECK)\n#undef HEDLEY_TI_ARMCL_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_ARMCL_VERSION)\n#define HEDLEY_TI_ARMCL_VERSION_CHECK(major, minor, patch)                                                             \\\n    (HEDLEY_TI_ARMCL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_ARMCL_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_CL6X_VERSION)\n#undef HEDLEY_TI_CL6X_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)\n#define HEDLEY_TI_CL6X_VERSION                                                                                         \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_CL6X_VERSION_CHECK)\n#undef HEDLEY_TI_CL6X_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_CL6X_VERSION)\n#define HEDLEY_TI_CL6X_VERSION_CHECK(major, minor, patch)                                                              \\\n    (HEDLEY_TI_CL6X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_CL6X_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_CL7X_VERSION)\n#undef HEDLEY_TI_CL7X_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)\n#define HEDLEY_TI_CL7X_VERSION                                                                                         \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_CL7X_VERSION_CHECK)\n#undef HEDLEY_TI_CL7X_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_CL7X_VERSION)\n#define HEDLEY_TI_CL7X_VERSION_CHECK(major, minor, patch)                                                              \\\n    (HEDLEY_TI_CL7X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_CL7X_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TI_CLPRU_VERSION)\n#undef HEDLEY_TI_CLPRU_VERSION\n#endif\n#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)\n#define HEDLEY_TI_CLPRU_VERSION                                                                                        \\\n    HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000,               \\\n                          (__TI_COMPILER_VERSION__ % 1000))\n#endif\n\n#if defined(HEDLEY_TI_CLPRU_VERSION_CHECK)\n#undef HEDLEY_TI_CLPRU_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TI_CLPRU_VERSION)\n#define HEDLEY_TI_CLPRU_VERSION_CHECK(major, minor, patch)                                                             \\\n    (HEDLEY_TI_CLPRU_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TI_CLPRU_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_CRAY_VERSION)\n#undef HEDLEY_CRAY_VERSION\n#endif\n#if defined(_CRAYC)\n#if defined(_RELEASE_PATCHLEVEL)\n#define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL)\n#else\n#define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0)\n#endif\n#endif\n\n#if defined(HEDLEY_CRAY_VERSION_CHECK)\n#undef HEDLEY_CRAY_VERSION_CHECK\n#endif\n#if defined(HEDLEY_CRAY_VERSION)\n#define HEDLEY_CRAY_VERSION_CHECK(major, minor, patch)                                                                 \\\n    (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_CRAY_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_IAR_VERSION)\n#undef HEDLEY_IAR_VERSION\n#endif\n#if defined(__IAR_SYSTEMS_ICC__)\n#if __VER__ > 1000\n#define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000))\n#else\n#define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0)\n#endif\n#endif\n\n#if defined(HEDLEY_IAR_VERSION_CHECK)\n#undef HEDLEY_IAR_VERSION_CHECK\n#endif\n#if defined(HEDLEY_IAR_VERSION)\n#define HEDLEY_IAR_VERSION_CHECK(major, minor, patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_IAR_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_TINYC_VERSION)\n#undef HEDLEY_TINYC_VERSION\n#endif\n#if defined(__TINYC__)\n#define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100)\n#endif\n\n#if defined(HEDLEY_TINYC_VERSION_CHECK)\n#undef HEDLEY_TINYC_VERSION_CHECK\n#endif\n#if defined(HEDLEY_TINYC_VERSION)\n#define HEDLEY_TINYC_VERSION_CHECK(major, minor, patch)                                                                \\\n    (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_TINYC_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_DMC_VERSION)\n#undef HEDLEY_DMC_VERSION\n#endif\n#if defined(__DMC__)\n#define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf)\n#endif\n\n#if defined(HEDLEY_DMC_VERSION_CHECK)\n#undef HEDLEY_DMC_VERSION_CHECK\n#endif\n#if defined(HEDLEY_DMC_VERSION)\n#define HEDLEY_DMC_VERSION_CHECK(major, minor, patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_DMC_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_COMPCERT_VERSION)\n#undef HEDLEY_COMPCERT_VERSION\n#endif\n#if defined(__COMPCERT_VERSION__)\n#define HEDLEY_COMPCERT_VERSION                                                                                        \\\n    HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100)\n#endif\n\n#if defined(HEDLEY_COMPCERT_VERSION_CHECK)\n#undef HEDLEY_COMPCERT_VERSION_CHECK\n#endif\n#if defined(HEDLEY_COMPCERT_VERSION)\n#define HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch)                                                             \\\n    (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_PELLES_VERSION)\n#undef HEDLEY_PELLES_VERSION\n#endif\n#if defined(__POCC__)\n#define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0)\n#endif\n\n#if defined(HEDLEY_PELLES_VERSION_CHECK)\n#undef HEDLEY_PELLES_VERSION_CHECK\n#endif\n#if defined(HEDLEY_PELLES_VERSION)\n#define HEDLEY_PELLES_VERSION_CHECK(major, minor, patch)                                                               \\\n    (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_PELLES_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_GCC_VERSION)\n#undef HEDLEY_GCC_VERSION\n#endif\n#if defined(HEDLEY_GNUC_VERSION) && !defined(__clang__) && !defined(HEDLEY_INTEL_VERSION) &&                           \\\n    !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_ARM_VERSION) && !defined(HEDLEY_TI_VERSION) &&                     \\\n    !defined(HEDLEY_TI_ARMCL_VERSION) && !defined(HEDLEY_TI_CL430_VERSION) && !defined(HEDLEY_TI_CL2000_VERSION) &&    \\\n    !defined(HEDLEY_TI_CL6X_VERSION) && !defined(HEDLEY_TI_CL7X_VERSION) && !defined(HEDLEY_TI_CLPRU_VERSION) &&       \\\n    !defined(__COMPCERT__)\n#define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION\n#endif\n\n#if defined(HEDLEY_GCC_VERSION_CHECK)\n#undef HEDLEY_GCC_VERSION_CHECK\n#endif\n#if defined(HEDLEY_GCC_VERSION)\n#define HEDLEY_GCC_VERSION_CHECK(major, minor, patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))\n#else\n#define HEDLEY_GCC_VERSION_CHECK(major, minor, patch) (0)\n#endif\n\n#if defined(HEDLEY_HAS_ATTRIBUTE)\n#undef HEDLEY_HAS_ATTRIBUTE\n#endif\n#if defined(__has_attribute)\n#define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)\n#else\n#define HEDLEY_HAS_ATTRIBUTE(attribute) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_ATTRIBUTE)\n#undef HEDLEY_GNUC_HAS_ATTRIBUTE\n#endif\n#if defined(__has_attribute)\n#define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) __has_attribute(attribute)\n#else\n#define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_ATTRIBUTE)\n#undef HEDLEY_GCC_HAS_ATTRIBUTE\n#endif\n#if defined(__has_attribute)\n#define HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) __has_attribute(attribute)\n#else\n#define HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_CPP_ATTRIBUTE)\n#undef HEDLEY_HAS_CPP_ATTRIBUTE\n#endif\n#if defined(__has_cpp_attribute) && defined(__cplusplus) &&                                                            \\\n    (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0))\n#define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)\n#else\n#define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)\n#endif\n\n#if defined(HEDLEY_HAS_CPP_ATTRIBUTE_NS)\n#undef HEDLEY_HAS_CPP_ATTRIBUTE_NS\n#endif\n#if !defined(__cplusplus) || !defined(__has_cpp_attribute)\n#define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) (0)\n#elif !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_IAR_VERSION) &&                                                  \\\n    (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0)) &&                                      \\\n    (!defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19, 20, 0))\n#define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)\n#else\n#define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)\n#undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE\n#endif\n#if defined(__has_cpp_attribute) && defined(__cplusplus)\n#define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) __has_cpp_attribute(attribute)\n#else\n#define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE)\n#undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE\n#endif\n#if defined(__has_cpp_attribute) && defined(__cplusplus)\n#define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) __has_cpp_attribute(attribute)\n#else\n#define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_BUILTIN)\n#undef HEDLEY_HAS_BUILTIN\n#endif\n#if defined(__has_builtin)\n#define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)\n#else\n#define HEDLEY_HAS_BUILTIN(builtin) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_BUILTIN)\n#undef HEDLEY_GNUC_HAS_BUILTIN\n#endif\n#if defined(__has_builtin)\n#define HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) __has_builtin(builtin)\n#else\n#define HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_BUILTIN)\n#undef HEDLEY_GCC_HAS_BUILTIN\n#endif\n#if defined(__has_builtin)\n#define HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) __has_builtin(builtin)\n#else\n#define HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_FEATURE)\n#undef HEDLEY_HAS_FEATURE\n#endif\n#if defined(__has_feature)\n#define HEDLEY_HAS_FEATURE(feature) __has_feature(feature)\n#else\n#define HEDLEY_HAS_FEATURE(feature) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_FEATURE)\n#undef HEDLEY_GNUC_HAS_FEATURE\n#endif\n#if defined(__has_feature)\n#define HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) __has_feature(feature)\n#else\n#define HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_FEATURE)\n#undef HEDLEY_GCC_HAS_FEATURE\n#endif\n#if defined(__has_feature)\n#define HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) __has_feature(feature)\n#else\n#define HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_EXTENSION)\n#undef HEDLEY_HAS_EXTENSION\n#endif\n#if defined(__has_extension)\n#define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)\n#else\n#define HEDLEY_HAS_EXTENSION(extension) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_EXTENSION)\n#undef HEDLEY_GNUC_HAS_EXTENSION\n#endif\n#if defined(__has_extension)\n#define HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) __has_extension(extension)\n#else\n#define HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_EXTENSION)\n#undef HEDLEY_GCC_HAS_EXTENSION\n#endif\n#if defined(__has_extension)\n#define HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) __has_extension(extension)\n#else\n#define HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE)\n#undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE\n#endif\n#if defined(__has_declspec_attribute)\n#define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute)\n#else\n#define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)\n#undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE\n#endif\n#if defined(__has_declspec_attribute)\n#define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) __has_declspec_attribute(attribute)\n#else\n#define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch)                                             \\\n    HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)\n#undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE\n#endif\n#if defined(__has_declspec_attribute)\n#define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) __has_declspec_attribute(attribute)\n#else\n#define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_HAS_WARNING)\n#undef HEDLEY_HAS_WARNING\n#endif\n#if defined(__has_warning)\n#define HEDLEY_HAS_WARNING(warning) __has_warning(warning)\n#else\n#define HEDLEY_HAS_WARNING(warning) (0)\n#endif\n\n#if defined(HEDLEY_GNUC_HAS_WARNING)\n#undef HEDLEY_GNUC_HAS_WARNING\n#endif\n#if defined(__has_warning)\n#define HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) __has_warning(warning)\n#else\n#define HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_GCC_HAS_WARNING)\n#undef HEDLEY_GCC_HAS_WARNING\n#endif\n#if defined(__has_warning)\n#define HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) __has_warning(warning)\n#else\n#define HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__clang__) ||                              \\\n    HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_IAR_VERSION_CHECK(8, 0, 0) ||  \\\n    HEDLEY_PGI_VERSION_CHECK(18, 4, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||   \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(4, 7, 0) || HEDLEY_TI_CL430_VERSION_CHECK(2, 0, 1) ||                                \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 1, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(7, 0, 0) ||                                \\\n    HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) ||                                 \\\n    HEDLEY_CRAY_VERSION_CHECK(5, 0, 0) || HEDLEY_TINYC_VERSION_CHECK(0, 9, 17) ||                                      \\\n    HEDLEY_SUNPRO_VERSION_CHECK(8, 0, 0) || (HEDLEY_IBM_VERSION_CHECK(10, 1, 0) && defined(__C99_PRAGMA_OPERATOR))\n#define HEDLEY_PRAGMA(value) _Pragma(#value)\n#elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)\n#define HEDLEY_PRAGMA(value) __pragma(value)\n#else\n#define HEDLEY_PRAGMA(value)\n#endif\n\n#if defined(HEDLEY_DIAGNOSTIC_PUSH)\n#undef HEDLEY_DIAGNOSTIC_PUSH\n#endif\n#if defined(HEDLEY_DIAGNOSTIC_POP)\n#undef HEDLEY_DIAGNOSTIC_POP\n#endif\n#if defined(__clang__)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"clang diagnostic push\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"clang diagnostic pop\")\n#elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"warning(push)\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"warning(pop)\")\n#elif HEDLEY_GCC_VERSION_CHECK(4, 6, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"GCC diagnostic push\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"GCC diagnostic pop\")\n#elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push))\n#define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop))\n#elif HEDLEY_ARM_VERSION_CHECK(5, 6, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"push\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"pop\")\n#elif HEDLEY_TI_VERSION_CHECK(15, 12, 0) || HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                  \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 4, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(8, 1, 0) ||                                 \\\n    HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"diag_push\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"diag_pop\")\n#elif HEDLEY_PELLES_VERSION_CHECK(2, 90, 0)\n#define HEDLEY_DIAGNOSTIC_PUSH _Pragma(\"warning(push)\")\n#define HEDLEY_DIAGNOSTIC_POP _Pragma(\"warning(pop)\")\n#else\n#define HEDLEY_DIAGNOSTIC_PUSH\n#define HEDLEY_DIAGNOSTIC_POP\n#endif\n\n/* HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for\n   HEDLEY INTERNAL USE ONLY.  API subject to change without notice. */\n#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)\n#undef HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_\n#endif\n#if defined(__cplusplus)\n#if HEDLEY_HAS_WARNING(\"-Wc++98-compat\")\n#if HEDLEY_HAS_WARNING(\"-Wc++17-extensions\")\n#if HEDLEY_HAS_WARNING(\"-Wc++1z-extensions\")\n#define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr)                                                              \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wc++98-compat\\\"\") _Pragma(\"clang diagnostic ignored \\\"-Wc++17-extensions\\\"\")  \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wc++1z-extensions\\\"\") xpr HEDLEY_DIAGNOSTIC_POP\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr)                                                              \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wc++98-compat\\\"\") _Pragma(\"clang diagnostic ignored \\\"-Wc++17-extensions\\\"\")  \\\n        xpr HEDLEY_DIAGNOSTIC_POP\n#endif\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr)                                                              \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wc++98-compat\\\"\") xpr HEDLEY_DIAGNOSTIC_POP\n#endif\n#endif\n#endif\n#if !defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)\n#define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x\n#endif\n\n#if defined(HEDLEY_CONST_CAST)\n#undef HEDLEY_CONST_CAST\n#endif\n#if defined(__cplusplus)\n#define HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))\n#elif HEDLEY_HAS_WARNING(\"-Wcast-qual\") || HEDLEY_GCC_VERSION_CHECK(4, 6, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_CONST_CAST(T, expr)                                                                                     \\\n    (__extension__({                                                                                                   \\\n        HEDLEY_DIAGNOSTIC_PUSH                                                                                         \\\n        HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL((T)(expr));                                                                \\\n        HEDLEY_DIAGNOSTIC_POP                                                                                          \\\n    }))\n#else\n#define HEDLEY_CONST_CAST(T, expr) ((T)(expr))\n#endif\n\n#if defined(HEDLEY_REINTERPRET_CAST)\n#undef HEDLEY_REINTERPRET_CAST\n#endif\n#if defined(__cplusplus)\n#define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))\n#else\n#define HEDLEY_REINTERPRET_CAST(T, expr) ((T)(expr))\n#endif\n\n#if defined(HEDLEY_STATIC_CAST)\n#undef HEDLEY_STATIC_CAST\n#endif\n#if defined(__cplusplus)\n#define HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))\n#else\n#define HEDLEY_STATIC_CAST(T, expr) ((T)(expr))\n#endif\n\n#if defined(HEDLEY_CPP_CAST)\n#undef HEDLEY_CPP_CAST\n#endif\n#if defined(__cplusplus)\n#if HEDLEY_HAS_WARNING(\"-Wold-style-cast\")\n#define HEDLEY_CPP_CAST(T, expr)                                                                                       \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wold-style-cast\\\"\")((T)(expr)) HEDLEY_DIAGNOSTIC_POP\n#elif HEDLEY_IAR_VERSION_CHECK(8, 3, 0)\n#define HEDLEY_CPP_CAST(T, expr)                                                                                       \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"diag_suppress=Pe137\") HEDLEY_DIAGNOSTIC_POP\n#else\n#define HEDLEY_CPP_CAST(T, expr) ((T)(expr))\n#endif\n#else\n#define HEDLEY_CPP_CAST(T, expr) (expr)\n#endif\n\n#if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)\n#undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wdeprecated-declarations\")\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"clang diagnostic ignored \\\"-Wdeprecated-declarations\\\"\")\n#elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"warning(disable:1478 1786)\")\n#elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable : 1478 1786))\n#elif HEDLEY_PGI_VERSION_CHECK(20, 7, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"diag_suppress 1215,1216,1444,1445\")\n#elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"diag_suppress 1215,1444\")\n#elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"GCC diagnostic ignored \\\"-Wdeprecated-declarations\\\"\")\n#elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable : 4996))\n#elif HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                                                            \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"diag_suppress 1291,1718\")\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && !defined(__cplusplus)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)\")\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && defined(__cplusplus)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"error_messages(off,symdeprecated,symdeprecated2)\")\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"diag_suppress=Pe1444,Pe1215\")\n#elif HEDLEY_PELLES_VERSION_CHECK(2, 90, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma(\"warn(disable:2241)\")\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED\n#endif\n\n#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)\n#undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wunknown-pragmas\")\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"clang diagnostic ignored \\\"-Wunknown-pragmas\\\"\")\n#elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"warning(disable:161)\")\n#elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable : 161))\n#elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"diag_suppress 1675\")\n#elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"GCC diagnostic ignored \\\"-Wunknown-pragmas\\\"\")\n#elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable : 4068))\n#elif HEDLEY_TI_VERSION_CHECK(16, 9, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0) ||                                    \\\n    HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || HEDLEY_TI_CLPRU_VERSION_CHECK(2, 3, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"diag_suppress 163\")\n#elif HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"diag_suppress 163\")\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma(\"diag_suppress=Pe161\")\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS\n#endif\n\n#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)\n#undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wunknown-attributes\")\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"clang diagnostic ignored \\\"-Wunknown-attributes\\\"\")\n#elif HEDLEY_GCC_VERSION_CHECK(4, 6, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"GCC diagnostic ignored \\\"-Wdeprecated-declarations\\\"\")\n#elif HEDLEY_INTEL_VERSION_CHECK(17, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"warning(disable:1292)\")\n#elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable : 1292))\n#elif HEDLEY_MSVC_VERSION_CHECK(19, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable : 5030))\n#elif HEDLEY_PGI_VERSION_CHECK(20, 7, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"diag_suppress 1097,1098\")\n#elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"diag_suppress 1097\")\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"error_messages(off,attrskipunsup)\")\n#elif HEDLEY_TI_VERSION_CHECK(18, 1, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(8, 3, 0) ||                                    \\\n    HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"diag_suppress 1173\")\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma(\"diag_suppress=Pe1097\")\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES\n#endif\n\n#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)\n#undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wcast-qual\")\n#define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma(\"clang diagnostic ignored \\\"-Wcast-qual\\\"\")\n#elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma(\"warning(disable:2203 2331)\")\n#elif HEDLEY_GCC_VERSION_CHECK(3, 0, 0)\n#define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma(\"GCC diagnostic ignored \\\"-Wcast-qual\\\"\")\n#else\n#define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL\n#endif\n\n#if defined(HEDLEY_DEPRECATED)\n#undef HEDLEY_DEPRECATED\n#endif\n#if defined(HEDLEY_DEPRECATED_FOR)\n#undef HEDLEY_DEPRECATED_FOR\n#endif\n#if HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DEPRECATED(since) __declspec(deprecated(\"Since \" #since))\n#define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated(\"Since \" #since \"; use \" #replacement))\n#elif HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || HEDLEY_GCC_VERSION_CHECK(4, 5, 0) ||                  \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_ARM_VERSION_CHECK(5, 6, 0) ||                                       \\\n    HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) || HEDLEY_PGI_VERSION_CHECK(17, 10, 0) ||                                    \\\n    HEDLEY_TI_VERSION_CHECK(18, 1, 0) || HEDLEY_TI_ARMCL_VERSION_CHECK(18, 1, 0) ||                                    \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(8, 3, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 3, 0)\n#define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__(\"Since \" #since)))\n#define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__(\"Since \" #since \"; use \" #replacement)))\n#elif defined(__cplusplus) && (__cplusplus >= 201402L)\n#define HEDLEY_DEPRECATED(since) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated(\"Since \" #since)]])\n#define HEDLEY_DEPRECATED_FOR(since, replacement)                                                                      \\\n    HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated(\"Since \" #since \"; use \" #replacement)]])\n#elif HEDLEY_HAS_ATTRIBUTE(deprecated) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||    \\\n    HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                                                              \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))\n#define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))\n#elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || HEDLEY_PELLES_VERSION_CHECK(6, 50, 0) ||                                 \\\n    HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_DEPRECATED(since) __declspec(deprecated)\n#define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated)\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_DEPRECATED(since) _Pragma(\"deprecated\")\n#define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma(\"deprecated\")\n#else\n#define HEDLEY_DEPRECATED(since)\n#define HEDLEY_DEPRECATED_FOR(since, replacement)\n#endif\n\n#if defined(HEDLEY_UNAVAILABLE)\n#undef HEDLEY_UNAVAILABLE\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(warning) || HEDLEY_GCC_VERSION_CHECK(4, 3, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__(\"Not available until \" #available_since)))\n#else\n#define HEDLEY_UNAVAILABLE(available_since)\n#endif\n\n#if defined(HEDLEY_WARN_UNUSED_RESULT)\n#undef HEDLEY_WARN_UNUSED_RESULT\n#endif\n#if defined(HEDLEY_WARN_UNUSED_RESULT_MSG)\n#undef HEDLEY_WARN_UNUSED_RESULT_MSG\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || HEDLEY_GCC_VERSION_CHECK(3, 4, 0) ||                                   \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                      \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || (HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) ||       \\\n    HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))\n#define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__))\n#elif (HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)\n#define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])\n#define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])\n#elif HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)\n#define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])\n#define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])\n#elif defined(_Check_return_) /* SAL */\n#define HEDLEY_WARN_UNUSED_RESULT _Check_return_\n#define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_\n#else\n#define HEDLEY_WARN_UNUSED_RESULT\n#define HEDLEY_WARN_UNUSED_RESULT_MSG(msg)\n#endif\n\n#if defined(HEDLEY_SENTINEL)\n#undef HEDLEY_SENTINEL\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(sentinel) || HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||     \\\n    HEDLEY_ARM_VERSION_CHECK(5, 4, 0)\n#define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))\n#else\n#define HEDLEY_SENTINEL(position)\n#endif\n\n#if defined(HEDLEY_NO_RETURN)\n#undef HEDLEY_NO_RETURN\n#endif\n#if HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_NO_RETURN __noreturn\n#elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_NO_RETURN __attribute__((__noreturn__))\n#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n#define HEDLEY_NO_RETURN _Noreturn\n#elif defined(__cplusplus) && (__cplusplus >= 201103L)\n#define HEDLEY_NO_RETURN HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])\n#elif HEDLEY_HAS_ATTRIBUTE(noreturn) || HEDLEY_GCC_VERSION_CHECK(3, 2, 0) || HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) ||  \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||   \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_NO_RETURN __attribute__((__noreturn__))\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)\n#define HEDLEY_NO_RETURN _Pragma(\"does_not_return\")\n#elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_NO_RETURN __declspec(noreturn)\n#elif HEDLEY_TI_CL6X_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)\n#define HEDLEY_NO_RETURN _Pragma(\"FUNC_NEVER_RETURNS;\")\n#elif HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0)\n#define HEDLEY_NO_RETURN __attribute((noreturn))\n#elif HEDLEY_PELLES_VERSION_CHECK(9, 0, 0)\n#define HEDLEY_NO_RETURN __declspec(noreturn)\n#else\n#define HEDLEY_NO_RETURN\n#endif\n\n#if defined(HEDLEY_NO_ESCAPE)\n#undef HEDLEY_NO_ESCAPE\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(noescape)\n#define HEDLEY_NO_ESCAPE __attribute__((__noescape__))\n#else\n#define HEDLEY_NO_ESCAPE\n#endif\n\n#if defined(HEDLEY_UNREACHABLE)\n#undef HEDLEY_UNREACHABLE\n#endif\n#if defined(HEDLEY_UNREACHABLE_RETURN)\n#undef HEDLEY_UNREACHABLE_RETURN\n#endif\n#if defined(HEDLEY_ASSUME)\n#undef HEDLEY_ASSUME\n#endif\n#if HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||                                    \\\n    HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_ASSUME(expr) __assume(expr)\n#elif HEDLEY_HAS_BUILTIN(__builtin_assume)\n#define HEDLEY_ASSUME(expr) __builtin_assume(expr)\n#elif HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0)\n#if defined(__cplusplus)\n#define HEDLEY_ASSUME(expr) std::_nassert(expr)\n#else\n#define HEDLEY_ASSUME(expr) _nassert(expr)\n#endif\n#endif\n#if (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) ||                                   \\\n    HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || HEDLEY_PGI_VERSION_CHECK(18, 10, 0) ||                                        \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_IBM_VERSION_CHECK(13, 1, 5)\n#define HEDLEY_UNREACHABLE() __builtin_unreachable()\n#elif defined(HEDLEY_ASSUME)\n#define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)\n#endif\n#if !defined(HEDLEY_ASSUME)\n#if defined(HEDLEY_UNREACHABLE)\n#define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (HEDLEY_UNREACHABLE(), 1)))\n#else\n#define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, expr)\n#endif\n#endif\n#if defined(HEDLEY_UNREACHABLE)\n#if HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0)\n#define HEDLEY_UNREACHABLE_RETURN(value) return (HEDLEY_STATIC_CAST(void, HEDLEY_ASSUME(0)), (value))\n#else\n#define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE()\n#endif\n#else\n#define HEDLEY_UNREACHABLE_RETURN(value) return (value)\n#endif\n#if !defined(HEDLEY_UNREACHABLE)\n#define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)\n#endif\n\nHEDLEY_DIAGNOSTIC_PUSH\n#if HEDLEY_HAS_WARNING(\"-Wpedantic\")\n#pragma clang diagnostic ignored \"-Wpedantic\"\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wc++98-compat-pedantic\") && defined(__cplusplus)\n#pragma clang diagnostic ignored \"-Wc++98-compat-pedantic\"\n#endif\n#if HEDLEY_GCC_HAS_WARNING(\"-Wvariadic-macros\", 4, 0, 0)\n#if defined(__clang__)\n#pragma clang diagnostic ignored \"-Wvariadic-macros\"\n#elif defined(HEDLEY_GCC_VERSION)\n#pragma GCC diagnostic ignored \"-Wvariadic-macros\"\n#endif\n#endif\n#if defined(HEDLEY_NON_NULL)\n#undef HEDLEY_NON_NULL\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(nonnull) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||      \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0)\n#define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))\n#else\n#define HEDLEY_NON_NULL(...)\n#endif\nHEDLEY_DIAGNOSTIC_POP\n\n#if defined(HEDLEY_PRINTF_FORMAT)\n#undef HEDLEY_PRINTF_FORMAT\n#endif\n#if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && !defined(__USE_MINGW_ANSI_STDIO)\n#define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check)                                                               \\\n    __attribute__((__format__(ms_printf, string_idx, first_to_check)))\n#elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && defined(__USE_MINGW_ANSI_STDIO)\n#define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check)                                                               \\\n    __attribute__((__format__(gnu_printf, string_idx, first_to_check)))\n#elif HEDLEY_HAS_ATTRIBUTE(format) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||     \\\n    HEDLEY_ARM_VERSION_CHECK(5, 6, 0) || HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||   \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check)                                                               \\\n    __attribute__((__format__(__printf__, string_idx, first_to_check)))\n#elif HEDLEY_PELLES_VERSION_CHECK(6, 0, 0)\n#define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) __declspec(vaformat(printf, string_idx, first_to_check))\n#else\n#define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check)\n#endif\n\n#if defined(HEDLEY_CONSTEXPR)\n#undef HEDLEY_CONSTEXPR\n#endif\n#if defined(__cplusplus)\n#if __cplusplus >= 201103L\n#define HEDLEY_CONSTEXPR HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)\n#endif\n#endif\n#if !defined(HEDLEY_CONSTEXPR)\n#define HEDLEY_CONSTEXPR\n#endif\n\n#if defined(HEDLEY_PREDICT)\n#undef HEDLEY_PREDICT\n#endif\n#if defined(HEDLEY_LIKELY)\n#undef HEDLEY_LIKELY\n#endif\n#if defined(HEDLEY_UNLIKELY)\n#undef HEDLEY_UNLIKELY\n#endif\n#if defined(HEDLEY_UNPREDICTABLE)\n#undef HEDLEY_UNPREDICTABLE\n#endif\n#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable)\n#define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))\n#endif\n#if (HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(HEDLEY_PGI_VERSION)) ||                         \\\n    HEDLEY_GCC_VERSION_CHECK(9, 0, 0)\n#define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability((expr), (value), (probability))\n#define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, (probability))\n#define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, (probability))\n#define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)\n#define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)\n#elif (HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(HEDLEY_INTEL_CL_VERSION)) ||                                   \\\n    HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||                                       \\\n    (HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||            \\\n    HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                        \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(4, 7, 0) || HEDLEY_TI_CL430_VERSION_CHECK(3, 1, 0) ||                                \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 1, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) ||                                \\\n    HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) ||                                 \\\n    HEDLEY_TINYC_VERSION_CHECK(0, 9, 27) || HEDLEY_CRAY_VERSION_CHECK(8, 1, 0)\n#define HEDLEY_PREDICT(expr, expected, probability)                                                                    \\\n    (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (HEDLEY_STATIC_CAST(void, expected), (expr)))\n#define HEDLEY_PREDICT_TRUE(expr, probability)                                                                         \\\n    (__extension__({                                                                                                   \\\n        double hedley_probability_ = (probability);                                                                    \\\n        ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1)                                                  \\\n                                      : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr)));    \\\n    }))\n#define HEDLEY_PREDICT_FALSE(expr, probability)                                                                        \\\n    (__extension__({                                                                                                   \\\n        double hedley_probability_ = (probability);                                                                    \\\n        ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0)                                                  \\\n                                      : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr)));    \\\n    }))\n#define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)\n#define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)\n#else\n#define HEDLEY_PREDICT(expr, expected, probability) (HEDLEY_STATIC_CAST(void, expected), (expr))\n#define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))\n#define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))\n#define HEDLEY_LIKELY(expr) (!!(expr))\n#define HEDLEY_UNLIKELY(expr) (!!(expr))\n#endif\n#if !defined(HEDLEY_UNPREDICTABLE)\n#define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5)\n#endif\n\n#if defined(HEDLEY_MALLOC)\n#undef HEDLEY_MALLOC\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(malloc) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||       \\\n    HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||                                      \\\n    HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                        \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_MALLOC __attribute__((__malloc__))\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)\n#define HEDLEY_MALLOC _Pragma(\"returns_new_memory\")\n#elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_MALLOC __declspec(restrict)\n#else\n#define HEDLEY_MALLOC\n#endif\n\n#if defined(HEDLEY_PURE)\n#undef HEDLEY_PURE\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(pure) || HEDLEY_GCC_VERSION_CHECK(2, 96, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||        \\\n    HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||                                      \\\n    HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                        \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_PURE __attribute__((__pure__))\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)\n#define HEDLEY_PURE _Pragma(\"does_not_write_global_data\")\n#elif defined(__cplusplus) && (HEDLEY_TI_CL430_VERSION_CHECK(2, 0, 1) || HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0) ||      \\\n                               HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0))\n#define HEDLEY_PURE _Pragma(\"FUNC_IS_PURE;\")\n#else\n#define HEDLEY_PURE\n#endif\n\n#if defined(HEDLEY_CONST)\n#undef HEDLEY_CONST\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(const) || HEDLEY_GCC_VERSION_CHECK(2, 5, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||        \\\n    HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||                                      \\\n    HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                        \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || HEDLEY_PGI_VERSION_CHECK(17, 10, 0)\n#define HEDLEY_CONST __attribute__((__const__))\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)\n#define HEDLEY_CONST _Pragma(\"no_side_effect\")\n#else\n#define HEDLEY_CONST HEDLEY_PURE\n#endif\n\n#if defined(HEDLEY_RESTRICT)\n#undef HEDLEY_RESTRICT\n#endif\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)\n#define HEDLEY_RESTRICT restrict\n#elif HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) ||                                      \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) ||                               \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_PGI_VERSION_CHECK(17, 10, 0) ||  \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 4) ||                               \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(8, 1, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    (HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)) || HEDLEY_IAR_VERSION_CHECK(8, 0, 0) ||            \\\n    defined(__clang__)\n#define HEDLEY_RESTRICT __restrict\n#elif HEDLEY_SUNPRO_VERSION_CHECK(5, 3, 0) && !defined(__cplusplus)\n#define HEDLEY_RESTRICT _Restrict\n#else\n#define HEDLEY_RESTRICT\n#endif\n\n#if defined(HEDLEY_INLINE)\n#undef HEDLEY_INLINE\n#endif\n#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(__cplusplus) && (__cplusplus >= 199711L))\n#define HEDLEY_INLINE inline\n#elif defined(HEDLEY_GCC_VERSION) || HEDLEY_ARM_VERSION_CHECK(6, 2, 0)\n#define HEDLEY_INLINE __inline__\n#elif HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) ||                              \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_TI_ARMCL_VERSION_CHECK(5, 1, 0) ||                                     \\\n    HEDLEY_TI_CL430_VERSION_CHECK(3, 1, 0) || HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) ||                               \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_INLINE __inline\n#else\n#define HEDLEY_INLINE\n#endif\n\n#if defined(HEDLEY_ALWAYS_INLINE)\n#undef HEDLEY_ALWAYS_INLINE\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(always_inline) || HEDLEY_GCC_VERSION_CHECK(4, 0, 0) ||                                        \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) ||                                   \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||   \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE\n#elif HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_ALWAYS_INLINE __forceinline\n#elif defined(__cplusplus) && (HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||     \\\n                               HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) ||     \\\n                               HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0))\n#define HEDLEY_ALWAYS_INLINE _Pragma(\"FUNC_ALWAYS_INLINE;\")\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_ALWAYS_INLINE _Pragma(\"inline=forced\")\n#else\n#define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE\n#endif\n\n#if defined(HEDLEY_NEVER_INLINE)\n#undef HEDLEY_NEVER_INLINE\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(noinline) || HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) ||     \\\n    HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) ||                                      \\\n    HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || HEDLEY_TI_VERSION_CHECK(15, 12, 0) ||                                        \\\n    (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) ||                                                                          \\\n    (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                              \\\n    HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) ||                                                                         \\\n    (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                               \\\n    HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) ||                                                                          \\\n    (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||                                \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) ||                                  \\\n    HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)\n#define HEDLEY_NEVER_INLINE __attribute__((__noinline__))\n#elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_NEVER_INLINE __declspec(noinline)\n#elif HEDLEY_PGI_VERSION_CHECK(10, 2, 0)\n#define HEDLEY_NEVER_INLINE _Pragma(\"noinline\")\n#elif HEDLEY_TI_CL6X_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)\n#define HEDLEY_NEVER_INLINE _Pragma(\"FUNC_CANNOT_INLINE;\")\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_NEVER_INLINE _Pragma(\"inline=never\")\n#elif HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0)\n#define HEDLEY_NEVER_INLINE __attribute((noinline))\n#elif HEDLEY_PELLES_VERSION_CHECK(9, 0, 0)\n#define HEDLEY_NEVER_INLINE __declspec(noinline)\n#else\n#define HEDLEY_NEVER_INLINE\n#endif\n\n#if defined(HEDLEY_PRIVATE)\n#undef HEDLEY_PRIVATE\n#endif\n#if defined(HEDLEY_PUBLIC)\n#undef HEDLEY_PUBLIC\n#endif\n#if defined(HEDLEY_IMPORT)\n#undef HEDLEY_IMPORT\n#endif\n#if defined(_WIN32) || defined(__CYGWIN__)\n#define HEDLEY_PRIVATE\n#define HEDLEY_PUBLIC __declspec(dllexport)\n#define HEDLEY_IMPORT __declspec(dllimport)\n#else\n#if HEDLEY_HAS_ATTRIBUTE(visibility) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) ||  \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \\\n    (defined(__TI_EABI__) && ((HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) ||      \\\n                              HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0)))\n#define HEDLEY_PRIVATE __attribute__((__visibility__(\"hidden\")))\n#define HEDLEY_PUBLIC __attribute__((__visibility__(\"default\")))\n#else\n#define HEDLEY_PRIVATE\n#define HEDLEY_PUBLIC\n#endif\n#define HEDLEY_IMPORT extern\n#endif\n\n#if defined(HEDLEY_NO_THROW)\n#undef HEDLEY_NO_THROW\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(nothrow) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_NO_THROW __attribute__((__nothrow__))\n#elif HEDLEY_MSVC_VERSION_CHECK(13, 1, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) ||                              \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0)\n#define HEDLEY_NO_THROW __declspec(nothrow)\n#else\n#define HEDLEY_NO_THROW\n#endif\n\n#if defined(HEDLEY_FALL_THROUGH)\n#undef HEDLEY_FALL_THROUGH\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(fallthrough) || HEDLEY_GCC_VERSION_CHECK(7, 0, 0)\n#define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))\n#elif HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang, fallthrough)\n#define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])\n#elif HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)\n#define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])\n#elif defined(__fallthrough) /* SAL */\n#define HEDLEY_FALL_THROUGH __fallthrough\n#else\n#define HEDLEY_FALL_THROUGH\n#endif\n\n#if defined(HEDLEY_RETURNS_NON_NULL)\n#undef HEDLEY_RETURNS_NON_NULL\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || HEDLEY_GCC_VERSION_CHECK(4, 9, 0)\n#define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))\n#elif defined(_Ret_notnull_) /* SAL */\n#define HEDLEY_RETURNS_NON_NULL _Ret_notnull_\n#else\n#define HEDLEY_RETURNS_NON_NULL\n#endif\n\n#if defined(HEDLEY_ARRAY_PARAM)\n#undef HEDLEY_ARRAY_PARAM\n#endif\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__STDC_NO_VLA__) &&                         \\\n    !defined(__cplusplus) && !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_TINYC_VERSION)\n#define HEDLEY_ARRAY_PARAM(name) (name)\n#else\n#define HEDLEY_ARRAY_PARAM(name)\n#endif\n\n#if defined(HEDLEY_IS_CONSTANT)\n#undef HEDLEY_IS_CONSTANT\n#endif\n#if defined(HEDLEY_REQUIRE_CONSTEXPR)\n#undef HEDLEY_REQUIRE_CONSTEXPR\n#endif\n/* HEDLEY_IS_CONSTEXPR_ is for\n   HEDLEY INTERNAL USE ONLY.  API subject to change without notice. */\n#if defined(HEDLEY_IS_CONSTEXPR_)\n#undef HEDLEY_IS_CONSTEXPR_\n#endif\n#if HEDLEY_HAS_BUILTIN(__builtin_constant_p) || HEDLEY_GCC_VERSION_CHECK(3, 4, 0) ||                                   \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_TINYC_VERSION_CHECK(0, 9, 19) ||                                    \\\n    HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || HEDLEY_IBM_VERSION_CHECK(13, 1, 0) ||                                         \\\n    HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) || (HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0) && !defined(__cplusplus)) ||       \\\n    HEDLEY_CRAY_VERSION_CHECK(8, 1, 0)\n#define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)\n#endif\n#if !defined(__cplusplus)\n#if HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || HEDLEY_GCC_VERSION_CHECK(3, 4, 0) ||                           \\\n    HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || HEDLEY_IBM_VERSION_CHECK(13, 1, 0) ||                                      \\\n    HEDLEY_CRAY_VERSION_CHECK(8, 1, 0) || HEDLEY_ARM_VERSION_CHECK(5, 4, 0) || HEDLEY_TINYC_VERSION_CHECK(0, 9, 24)\n#if defined(__INTPTR_TYPE__)\n#define HEDLEY_IS_CONSTEXPR_(expr)                                                                                     \\\n    __builtin_types_compatible_p(__typeof__((1 ? (void *)((__INTPTR_TYPE__)((expr)*0)) : (int *)0)), int *)\n#else\n#include <stdint.h>\n#define HEDLEY_IS_CONSTEXPR_(expr)                                                                                     \\\n    __builtin_types_compatible_p(__typeof__((1 ? (void *)((intptr_t)((expr)*0)) : (int *)0)), int *)\n#endif\n#elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) &&                \\\n       !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_IAR_VERSION)) ||                                                \\\n    HEDLEY_HAS_EXTENSION(c_generic_selections) || HEDLEY_GCC_VERSION_CHECK(4, 9, 0) ||                                 \\\n    HEDLEY_INTEL_VERSION_CHECK(17, 0, 0) || HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || HEDLEY_ARM_VERSION_CHECK(5, 3, 0)\n#if defined(__INTPTR_TYPE__)\n#define HEDLEY_IS_CONSTEXPR_(expr)                                                                                     \\\n    _Generic((1 ? (void *)((__INTPTR_TYPE__)((expr)*0)) : (int *)0), int * : 1, void * : 0)\n#else\n#include <stdint.h>\n#define HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void *)((intptr_t)*0) : (int *)0), int * : 1, void * : 0)\n#endif\n#elif defined(HEDLEY_GCC_VERSION) || defined(HEDLEY_INTEL_VERSION) || defined(HEDLEY_TINYC_VERSION) ||                 \\\n    defined(HEDLEY_TI_ARMCL_VERSION) || HEDLEY_TI_CL430_VERSION_CHECK(18, 12, 0) ||                                    \\\n    defined(HEDLEY_TI_CL2000_VERSION) || defined(HEDLEY_TI_CL6X_VERSION) || defined(HEDLEY_TI_CL7X_VERSION) ||         \\\n    defined(HEDLEY_TI_CLPRU_VERSION) || defined(__clang__)\n#define HEDLEY_IS_CONSTEXPR_(expr)                                                                                     \\\n    (sizeof(void) != sizeof(*(1 ? ((void *)((expr)*0L)) : ((struct { char v[sizeof(void) * 2]; } *)1))))\n#endif\n#endif\n#if defined(HEDLEY_IS_CONSTEXPR_)\n#if !defined(HEDLEY_IS_CONSTANT)\n#define HEDLEY_IS_CONSTANT(expr) HEDLEY_IS_CONSTEXPR_(expr)\n#endif\n#define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))\n#else\n#if !defined(HEDLEY_IS_CONSTANT)\n#define HEDLEY_IS_CONSTANT(expr) (0)\n#endif\n#define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)\n#endif\n\n#if defined(HEDLEY_BEGIN_C_DECLS)\n#undef HEDLEY_BEGIN_C_DECLS\n#endif\n#if defined(HEDLEY_END_C_DECLS)\n#undef HEDLEY_END_C_DECLS\n#endif\n#if defined(HEDLEY_C_DECL)\n#undef HEDLEY_C_DECL\n#endif\n#if defined(__cplusplus)\n#define HEDLEY_BEGIN_C_DECLS extern \"C\" {\n#define HEDLEY_END_C_DECLS }\n#define HEDLEY_C_DECL extern \"C\"\n#else\n#define HEDLEY_BEGIN_C_DECLS\n#define HEDLEY_END_C_DECLS\n#define HEDLEY_C_DECL\n#endif\n\n#if defined(HEDLEY_STATIC_ASSERT)\n#undef HEDLEY_STATIC_ASSERT\n#endif\n#if !defined(__cplusplus) &&                                                                                           \\\n    ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) ||                                                   \\\n     (HEDLEY_HAS_FEATURE(c_static_assert) && !defined(HEDLEY_INTEL_CL_VERSION)) ||                                     \\\n     HEDLEY_GCC_VERSION_CHECK(6, 0, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || defined(_Static_assert))\n#define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)\n#elif (defined(__cplusplus) && (__cplusplus >= 201103L)) || HEDLEY_MSVC_VERSION_CHECK(16, 0, 0) ||                     \\\n    HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_STATIC_ASSERT(expr, message) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))\n#else\n#define HEDLEY_STATIC_ASSERT(expr, message)\n#endif\n\n#if defined(HEDLEY_NULL)\n#undef HEDLEY_NULL\n#endif\n#if defined(__cplusplus)\n#if __cplusplus >= 201103L\n#define HEDLEY_NULL HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)\n#elif defined(NULL)\n#define HEDLEY_NULL NULL\n#else\n#define HEDLEY_NULL HEDLEY_STATIC_CAST(void *, 0)\n#endif\n#elif defined(NULL)\n#define HEDLEY_NULL NULL\n#else\n#define HEDLEY_NULL ((void *)0)\n#endif\n\n#if defined(HEDLEY_MESSAGE)\n#undef HEDLEY_MESSAGE\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wunknown-pragmas\")\n#define HEDLEY_MESSAGE(msg)                                                                                            \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS                                                                          \\\n    HEDLEY_PRAGMA(message msg)                                                                                         \\\n    HEDLEY_DIAGNOSTIC_POP\n#elif HEDLEY_GCC_VERSION_CHECK(4, 4, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg)\n#elif HEDLEY_CRAY_VERSION_CHECK(5, 0, 0)\n#define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg)\n#elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)\n#define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg))\n#elif HEDLEY_PELLES_VERSION_CHECK(2, 0, 0)\n#define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg))\n#else\n#define HEDLEY_MESSAGE(msg)\n#endif\n\n#if defined(HEDLEY_WARNING)\n#undef HEDLEY_WARNING\n#endif\n#if HEDLEY_HAS_WARNING(\"-Wunknown-pragmas\")\n#define HEDLEY_WARNING(msg)                                                                                            \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS                                                                          \\\n    HEDLEY_PRAGMA(clang warning msg)                                                                                   \\\n    HEDLEY_DIAGNOSTIC_POP\n#elif HEDLEY_GCC_VERSION_CHECK(4, 8, 0) || HEDLEY_PGI_VERSION_CHECK(18, 4, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)\n#define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg)\n#elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) || HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg))\n#else\n#define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg)\n#endif\n\n#if defined(HEDLEY_REQUIRE)\n#undef HEDLEY_REQUIRE\n#endif\n#if defined(HEDLEY_REQUIRE_MSG)\n#undef HEDLEY_REQUIRE_MSG\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(diagnose_if)\n#if HEDLEY_HAS_WARNING(\"-Wgcc-compat\")\n#define HEDLEY_REQUIRE(expr)                                                                                           \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wgcc-compat\\\"\") __attribute__((diagnose_if(!(expr), #expr, \"error\")))         \\\n        HEDLEY_DIAGNOSTIC_POP\n#define HEDLEY_REQUIRE_MSG(expr, msg)                                                                                  \\\n    HEDLEY_DIAGNOSTIC_PUSH                                                                                             \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wgcc-compat\\\"\") __attribute__((diagnose_if(!(expr), msg, \"error\")))           \\\n        HEDLEY_DIAGNOSTIC_POP\n#else\n#define HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, \"error\")))\n#define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((diagnose_if(!(expr), msg, \"error\")))\n#endif\n#else\n#define HEDLEY_REQUIRE(expr)\n#define HEDLEY_REQUIRE_MSG(expr, msg)\n#endif\n\n#if defined(HEDLEY_FLAGS)\n#undef HEDLEY_FLAGS\n#endif\n#if HEDLEY_HAS_ATTRIBUTE(flag_enum)\n#define HEDLEY_FLAGS __attribute__((__flag_enum__))\n#else\n#define HEDLEY_FLAGS\n#endif\n\n#if defined(HEDLEY_FLAGS_CAST)\n#undef HEDLEY_FLAGS_CAST\n#endif\n#if HEDLEY_INTEL_VERSION_CHECK(19, 0, 0)\n#define HEDLEY_FLAGS_CAST(T, expr)                                                                                     \\\n    (__extension__({                                                                                                   \\\n        HEDLEY_DIAGNOSTIC_PUSH                                                                                         \\\n        _Pragma(\"warning(disable:188)\")((T)(expr));                                                                    \\\n        HEDLEY_DIAGNOSTIC_POP                                                                                          \\\n    }))\n#else\n#define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr)\n#endif\n\n#if defined(HEDLEY_EMPTY_BASES)\n#undef HEDLEY_EMPTY_BASES\n#endif\n#if (HEDLEY_MSVC_VERSION_CHECK(19, 0, 23918) && !HEDLEY_MSVC_VERSION_CHECK(20, 0, 0)) ||                               \\\n    HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)\n#define HEDLEY_EMPTY_BASES __declspec(empty_bases)\n#else\n#define HEDLEY_EMPTY_BASES\n#endif\n\n/* Remaining macros are deprecated. */\n\n#if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)\n#undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK\n#endif\n#if defined(__clang__)\n#define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) (0)\n#else\n#define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) HEDLEY_GCC_VERSION_CHECK(major, minor, patch)\n#endif\n\n#if defined(HEDLEY_CLANG_HAS_ATTRIBUTE)\n#undef HEDLEY_CLANG_HAS_ATTRIBUTE\n#endif\n#define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute)\n\n#if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)\n#undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE\n#endif\n#define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute)\n\n#if defined(HEDLEY_CLANG_HAS_BUILTIN)\n#undef HEDLEY_CLANG_HAS_BUILTIN\n#endif\n#define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin)\n\n#if defined(HEDLEY_CLANG_HAS_FEATURE)\n#undef HEDLEY_CLANG_HAS_FEATURE\n#endif\n#define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature)\n\n#if defined(HEDLEY_CLANG_HAS_EXTENSION)\n#undef HEDLEY_CLANG_HAS_EXTENSION\n#endif\n#define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension)\n\n#if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)\n#undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE\n#endif\n#define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)\n\n#if defined(HEDLEY_CLANG_HAS_WARNING)\n#undef HEDLEY_CLANG_HAS_WARNING\n#endif\n#define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning)\n\n#endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/attributes.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_ATTRIBUTES_H__\n#define __NUITKA_HELPER_ATTRIBUTES_H__\n\n// Attribute lookup except special slots below.\nextern PyObject *LOOKUP_ATTRIBUTE(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\n\n// Attribute lookup of attribute slot \"__dict__\".\nextern PyObject *LOOKUP_ATTRIBUTE_DICT_SLOT(PyThreadState *tstate, PyObject *source);\n\n// Attribute lookup of attribute slot \"__class__\".\nextern PyObject *LOOKUP_ATTRIBUTE_CLASS_SLOT(PyThreadState *tstate, PyObject *source);\n\n// For built-in \"hasattr\" functionality.\nextern int BUILTIN_HASATTR_BOOL(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\n\n// Check for an attribute, cannot raise an exception.\nextern bool HAS_ATTR_BOOL(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\n\n// Check for an attribute, can raise an exception.\nextern int HAS_ATTR_BOOL2(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\n\n// Set an attribute except for attribute slots below.\nextern bool SET_ATTRIBUTE(PyThreadState *tstate, PyObject *target, PyObject *attr_name, PyObject *value);\n\n// Set the \"__dict__\" special attribute slot.\nextern bool SET_ATTRIBUTE_DICT_SLOT(PyThreadState *tstate, PyObject *target, PyObject *value);\n\n// Set the \"__class__\" special attribute slot.\nextern bool SET_ATTRIBUTE_CLASS_SLOT(PyThreadState *tstate, PyObject *target, PyObject *value);\n\n// Special attribute lookups, e.g. \"__enter__\".\nextern PyObject *LOOKUP_SPECIAL(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\n\n// Find an attribute in a class, Python2 only.\n#if PYTHON_VERSION < 0x300\nextern PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *klass, PyObject *attr_name);\n#endif\n\nextern PyObject *LOOKUP_MODULE_VALUE(PyDictObject *module_dict, PyObject *var_name);\nextern PyObject *GET_MODULE_VARIABLE_VALUE_FALLBACK(PyThreadState *tstate, PyObject *variable_name);\n#if PYTHON_VERSION < 0x340\nextern PyObject *GET_MODULE_VARIABLE_VALUE_FALLBACK_IN_FUNCTION(PyThreadState *tstate, PyObject *variable_name);\n#endif\n\n// In case of DLL usage, this avoids looking up the symbol from it.\nextern getattrofunc PyObject_GenericGetAttr_resolved;\n\n// Avoid repeated code, this checks if a type has the standard implementation, then\n// we can just try and do the same in slightly faster ways.\nstatic inline bool hasTypeGenericGetAttr(PyTypeObject *type) {\n#if PYTHON_VERSION >= 0x3b0\n    // TODO: Big performance loss here\n    return false;\n#else\n    return type->tp_getattro == PyObject_GenericGetAttr_resolved;\n#endif\n}\n\n// In case of DLL usage, this avoids looking up the symbol from it.\nextern setattrofunc PyObject_GenericSetAttr_resolved;\n\nstatic inline bool hasTypeGenericSetAttr(PyTypeObject *type) {\n#if PYTHON_VERSION >= 0x3b0\n    // TODO: Big performance loss here\n    return false;\n#else\n    return type->tp_setattro == PyObject_GenericSetAttr_resolved;\n#endif\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/boolean.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_BOOLEAN_H__\n#define __NUITKA_HELPER_BOOLEAN_H__\n\n// The slot in Python3 got renamed, compensate it like this.\n#if PYTHON_VERSION >= 0x300\n#define nb_nonzero nb_bool\n#endif\n\nNUITKA_MAY_BE_UNUSED static int CHECK_IF_TRUE(PyObject *object) {\n    CHECK_OBJECT(object);\n\n    if (object == Py_True) {\n        return 1;\n    } else if (object == Py_False || object == Py_None) {\n        return 0;\n    } else {\n        Py_ssize_t result;\n\n        if (Py_TYPE(object)->tp_as_number != NULL && Py_TYPE(object)->tp_as_number->nb_nonzero != NULL) {\n            result = (*Py_TYPE(object)->tp_as_number->nb_nonzero)(object);\n        } else if (Py_TYPE(object)->tp_as_mapping != NULL && Py_TYPE(object)->tp_as_mapping->mp_length != NULL) {\n            result = (*Py_TYPE(object)->tp_as_mapping->mp_length)(object);\n        } else if (Py_TYPE(object)->tp_as_sequence != NULL && Py_TYPE(object)->tp_as_sequence->sq_length != NULL) {\n            result = (*Py_TYPE(object)->tp_as_sequence->sq_length)(object);\n        } else {\n            return 1;\n        }\n\n        if (result > 0) {\n            return 1;\n        } else if (result == 0) {\n            return 0;\n        } else {\n            return -1;\n        }\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static int CHECK_IF_FALSE(PyObject *object) {\n    int result = CHECK_IF_TRUE(object);\n\n    if (result == 0) {\n        return 1;\n    }\n    if (result == 1) {\n        return 0;\n    }\n    return -1;\n}\n\nNUITKA_MAY_BE_UNUSED static inline PyObject *BOOL_FROM(bool value) {\n    CHECK_OBJECT(Py_True);\n    CHECK_OBJECT(Py_False);\n\n    return value ? Py_True : Py_False;\n}\n\n#undef nb_nonzero\n\ntypedef enum {\n    NUITKA_BOOL_FALSE = 0,\n    NUITKA_BOOL_TRUE = 1,\n    NUITKA_BOOL_UNASSIGNED = 2,\n    NUITKA_BOOL_EXCEPTION = -1\n} nuitka_bool;\n\ntypedef enum { NUITKA_VOID_OK = 0, NUITKA_VOID_EXCEPTION = 1 } nuitka_void;\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/bytearrays.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_BYTEARRAYS_H__\n#define __NUITKA_HELPER_BYTEARRAYS_H__\n\nNUITKA_MAY_BE_UNUSED static PyObject *BYTEARRAY_COPY(PyThreadState *tstate, PyObject *bytearray) {\n    CHECK_OBJECT(bytearray);\n    assert(PyByteArray_CheckExact(bytearray));\n\n    PyObject *result = PyByteArray_FromObject(bytearray);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/bytes.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_BYTES_H__\n#define __NUITKA_HELPER_BYTES_H__\n\n#if PYTHON_VERSION >= 0x3a0\n#define NUITKA_BYTES_HAS_FREELIST 1\nextern PyObject *Nuitka_Bytes_FromStringAndSize(const char *data, Py_ssize_t size);\n#else\n#define NUITKA_BYTES_HAS_FREELIST 0\n#define Nuitka_Bytes_FromStringAndSize PyBytes_FromStringAndSize\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/calling_generated.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template CodeTemplateCallsPositional.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nextern PyObject *CALL_FUNCTION_NO_ARGS(PyThreadState *tstate, PyObject *called);\nextern PyObject *CALL_FUNCTION_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS1(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS2(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS2(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS3(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS4(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS4(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS5(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS5(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS6(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS6(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS7(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS7(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS8(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS8(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS9(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS9(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS10(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS10(PyThreadState *tstate, PyObject *called, PyObject *pos_args);\nextern PyObject *CALL_FUNCTION_WITH_NO_ARGS_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *kw_values,\n                                                    PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS1_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS1_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS1_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS2_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS2_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS2_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS3_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS3_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS3_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS4_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS4_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS4_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS5_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS5_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS5_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS6_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS6_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS6_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS7_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS7_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS7_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS8_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS8_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS8_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS9_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                     PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS9_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                  PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS9_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                     PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS10_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                      PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_ARGS10_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                                   PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_FUNCTION_WITH_POSARGS10_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                                      PyObject *const *kw_values, PyObject *kw_names);\nextern PyObject *CALL_METHODDESCR_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg);\nextern PyObject *CALL_METHODDESCR_WITH_ARGS2(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_METHODDESCR_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_METHODDESCR_WITH_ARGS4(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_METHOD_NO_ARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name);\nextern PyObject *CALL_METHOD_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                             PyObject *arg);\nextern PyObject *CALL_METHOD_WITH_ARGS2(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS3(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS4(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS5(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS6(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS7(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS8(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS9(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                        PyObject *const *args);\nextern PyObject *CALL_METHOD_WITH_ARGS10(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                         PyObject *const *args);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_eq.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"==\" (EQ) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern bool RICH_COMPARE_EQ_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern bool RICH_COMPARE_EQ_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern bool RICH_COMPARE_EQ_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_EQ_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool RICH_COMPARE_EQ_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool RICH_COMPARE_EQ_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_EQ_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_EQ_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_EQ_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_EQ_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_EQ_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_ge.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">=\" (GE) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_GE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_GE_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_GE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_GE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_gt.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">\" (GT) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_GT_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_GT_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_GT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_GT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_le.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<=\" (LE) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern bool RICH_COMPARE_LE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern bool RICH_COMPARE_LE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern bool RICH_COMPARE_LE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_LE_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool RICH_COMPARE_LE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool RICH_COMPARE_LE_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_LE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_LE_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_LE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_LE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_lt.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<\" (LT) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern bool RICH_COMPARE_LT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern bool RICH_COMPARE_LT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern bool RICH_COMPARE_LT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_LT_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool RICH_COMPARE_LT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool RICH_COMPARE_LT_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_LT_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_LT_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_LT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_LT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/comparisons_ne.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"!=\" (NE) comparisons */\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool RICH_COMPARE_NE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool RICH_COMPARE_NE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool RICH_COMPARE_NE_CBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool RICH_COMPARE_NE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *RICH_COMPARE_NE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool RICH_COMPARE_NE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/complex.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_COMPLEX_H__\n#define __NUITKA_HELPER_COMPLEX_H__\n\nNUITKA_MAY_BE_UNUSED static PyObject *BUILTIN_COMPLEX1(PyThreadState *tstate, PyObject *real) {\n    CHECK_OBJECT(real);\n\n    // TODO: Very lazy here, we should create the values ourselves, surely a\n    // a lot of optimization can be had that way. At least use PyComplex_RealAsDouble\n    // where possible.\n    return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, (PyObject *)&PyComplex_Type, real);\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *BUILTIN_COMPLEX2(PyThreadState *tstate, PyObject *real, PyObject *imag) {\n    if (real == NULL) {\n        assert(imag != NULL);\n\n        real = const_int_0;\n    }\n\n    CHECK_OBJECT(real);\n    CHECK_OBJECT(imag);\n\n    // TODO: Very lazy here, we should create the values ourselves, surely a\n    // a lot of optimization can be had that way. At least use PyComplex_FromDoubles\n    PyObject *args[] = {real, imag};\n    return CALL_FUNCTION_WITH_ARGS2(tstate, (PyObject *)&PyComplex_Type, args);\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/dictionaries.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_DICTIONARIES_H__\n#define __NUITKA_DICTIONARIES_H__\n\nstatic inline Py_ssize_t DICT_SIZE(PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    return ((PyDictObject *)dict)->ma_used;\n}\n\nstatic inline PyDictObject *MODULE_DICT(PyObject *module) {\n    CHECK_OBJECT(module);\n\n    PyDictObject *dict = (PyDictObject *)(((PyModuleObject *)module)->md_dict);\n\n    return dict;\n}\n\n#if PYTHON_VERSION < 0x300\n// Quick dictionary lookup for a string value.\n\ntypedef PyDictEntry *Nuitka_DictEntryHandle;\n\nstatic PyDictEntry *GET_STRING_DICT_ENTRY(PyDictObject *dict, Nuitka_StringObject *key) {\n    assert(PyDict_CheckExact(dict));\n    assert(Nuitka_String_CheckExact(key));\n\n    Py_hash_t hash = key->ob_shash;\n\n    // Only improvement would be to identify how to ensure that the hash is\n    // computed already. Calling hash early on could do that potentially.\n    if (hash == -1) {\n        hash = PyString_Type.tp_hash((PyObject *)key);\n        key->ob_shash = hash;\n    }\n\n    PyDictEntry *entry = dict->ma_lookup(dict, (PyObject *)key, hash);\n\n    // The \"entry\" cannot be NULL, it can only be empty for a string dict\n    // lookup, but at least assert it.\n    assert(entry != NULL);\n\n    return entry;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *GET_DICT_ENTRY_VALUE(Nuitka_DictEntryHandle handle) { return handle->me_value; }\n\nNUITKA_MAY_BE_UNUSED static void SET_DICT_ENTRY_VALUE(Nuitka_DictEntryHandle handle, PyObject *value) {\n    handle->me_value = value;\n}\n\nstatic PyObject *GET_STRING_DICT_VALUE(PyDictObject *dict, Nuitka_StringObject *key) {\n    return GET_STRING_DICT_ENTRY(dict, key)->me_value;\n}\n\n#else\n\n// Python 3.3 or higher.\n\n// Quick dictionary lookup for a string value.\n\n#if PYTHON_VERSION < 0x3b0\ntypedef struct {\n    /* Cached hash code of me_key. */\n    Py_hash_t me_hash;\n    PyObject *me_key;\n    PyObject *me_value; /* This field is only meaningful for combined tables */\n} PyDictKeyEntry;\n#endif\n\n#if PYTHON_VERSION < 0x360\ntypedef PyDictKeyEntry *(*dict_lookup_func)(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr);\n#elif PYTHON_VERSION < 0x370\ntypedef Py_ssize_t (*dict_lookup_func)(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr,\n                                       Py_ssize_t *hashpos);\n#else\ntypedef Py_ssize_t (*dict_lookup_func)(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);\n#endif\n\n// Taken from CPython3.3 \"Objects/dictobject.c\", lives in \"Objects/dict-common.h\" later\n\n#if PYTHON_VERSION < 0x3b0\n\n#define DK_SIZE(dk) ((dk)->dk_size)\nstruct _dictkeysobject {\n    Py_ssize_t dk_refcnt;\n    Py_ssize_t dk_size;\n    dict_lookup_func dk_lookup;\n    Py_ssize_t dk_usable;\n#if PYTHON_VERSION < 0x360\n    PyDictKeyEntry dk_entries[1];\n#else\n    Py_ssize_t dk_nentries;\n#if PYTHON_VERSION < 0x370\n    union {\n        int8_t as_1[8];\n        int16_t as_2[4];\n        int32_t as_4[2];\n#if SIZEOF_VOID_P > 4\n        int64_t as_8[1];\n#endif\n    } dk_indices;\n#else\n    char dk_indices[];\n#endif\n#endif\n};\n\n#endif\n\n// Taken from Objects/dictobject.c of CPython 3.6\n#if PYTHON_VERSION >= 0x360\n\n#if PYTHON_VERSION < 0x3b0\n#if SIZEOF_VOID_P > 4\n#define DK_IXSIZE(dk)                                                                                                  \\\n    (DK_SIZE(dk) <= 0xff ? 1 : DK_SIZE(dk) <= 0xffff ? 2 : DK_SIZE(dk) <= 0xffffffff ? 4 : sizeof(int64_t))\n#else\n#define DK_IXSIZE(dk) (DK_SIZE(dk) <= 0xff ? 1 : DK_SIZE(dk) <= 0xffff ? 2 : sizeof(int32_t))\n#endif\n\n#if PYTHON_VERSION < 0x370\n#define DK_ENTRIES(dk) ((PyDictKeyEntry *)(&(dk)->dk_indices.as_1[DK_SIZE(dk) * DK_IXSIZE(dk)]))\n#else\n#define DK_ENTRIES(dk) ((PyDictKeyEntry *)(&((int8_t *)((dk)->dk_indices))[DK_SIZE(dk) * DK_IXSIZE(dk)]))\n#endif\n\n#endif\n\n#else\n#define DK_ENTRIES(dk) (dk->dk_entries)\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n#define DK_VALUE(dk, i) dk->ma_values[i]\n#else\n#define DK_VALUE(dk, i) dk->ma_values->values[i]\n#endif\n\n#define DK_MASK(dk) (DK_SIZE(dk) - 1)\n\ntypedef PyObject **Nuitka_DictEntryHandle;\n\n#if PYTHON_VERSION >= 0x3b0\nextern Py_ssize_t Nuitka_PyDictLookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr);\nextern Py_ssize_t Nuitka_PyDictLookupStr(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr);\n#endif\n\nstatic Nuitka_DictEntryHandle GET_STRING_DICT_ENTRY(PyDictObject *dict, Nuitka_StringObject *key) {\n    assert(PyDict_CheckExact(dict));\n    assert(Nuitka_String_CheckExact(key));\n\n    Py_hash_t hash = key->_base._base.hash;\n\n    // Only improvement would be to identify how to ensure that the hash is computed\n    // already. Calling hash early on could do that potentially.\n    if (hash == -1) {\n        hash = PyUnicode_Type.tp_hash((PyObject *)key);\n        key->_base._base.hash = hash;\n    }\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n\n    PyDictKeyEntry *entry = dict->ma_keys->dk_lookup(dict, (PyObject *)key, hash, &value_addr);\n\n    // The \"entry\" cannot be NULL, it can only be empty for a string dict lookup, but at\n    // least assert it.\n    assert(entry != NULL);\n\n    return value_addr;\n\n#elif PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n\n    // TODO: Find out what the returned Py_ssize_t \"ix\" might be good for.\n    dict->ma_keys->dk_lookup(dict, (PyObject *)key, hash, &value_addr,\n                             NULL // hashpos, TODO: Find out what we could use it for.\n    );\n\n    return value_addr;\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *value;\n\n    Py_ssize_t ix = dict->ma_keys->dk_lookup(dict, (PyObject *)key, hash, &value);\n\n    if (value == NULL) {\n        return NULL;\n#ifndef PY_NOGIL\n    } else if (_PyDict_HasSplitTable(dict)) {\n        return &dict->ma_values[ix];\n#endif\n    } else {\n        return &DK_ENTRIES(dict->ma_keys)[ix].me_value;\n    }\n\n#else\n    // Will be written by Nuitka_PyDictLookupStr in all cases.\n    PyObject **value;\n    NUITKA_MAY_BE_UNUSED Py_ssize_t found = Nuitka_PyDictLookupStr(dict, (PyObject *)key, hash, &value);\n    assert(found != DKIX_ERROR);\n\n    return value;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *GET_DICT_ENTRY_VALUE(Nuitka_DictEntryHandle handle) { return *handle; }\n\nNUITKA_MAY_BE_UNUSED static void SET_DICT_ENTRY_VALUE(Nuitka_DictEntryHandle handle, PyObject *value) {\n    *handle = value;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *GET_STRING_DICT_VALUE(PyDictObject *dict, Nuitka_StringObject *key) {\n    Nuitka_DictEntryHandle handle = GET_STRING_DICT_ENTRY(dict, key);\n\n#if PYTHON_VERSION >= 0x360\n    if (handle == NULL) {\n        return NULL;\n    }\n#endif\n\n    return GET_DICT_ENTRY_VALUE(handle);\n}\n\n#endif\n\nNUITKA_MAY_BE_UNUSED static bool DICT_SET_ITEM(PyObject *dict, PyObject *key, PyObject *value) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n    CHECK_OBJECT(key);\n    CHECK_OBJECT(value);\n\n    int status = PyDict_SetItem(dict, key, value);\n\n    if (unlikely(status != 0)) {\n        return false;\n    }\n\n    return true;\n}\n\nNUITKA_MAY_BE_UNUSED static bool DICT_REMOVE_ITEM(PyObject *dict, PyObject *key) {\n    int status = PyDict_DelItem(dict, key);\n\n    if (unlikely(status == -1)) {\n        return false;\n    }\n\n    return true;\n}\n\n// Get dict lookup for a key, similar to PyDict_GetItemWithError, ref returned\nextern PyObject *DICT_GET_ITEM_WITH_ERROR(PyThreadState *tstate, PyObject *dict, PyObject *key);\n\n// Get dict lookup for a key, with only hash error, does not create KeyError, 1=ref returned, 0=not\nextern PyObject *DICT_GET_ITEM_WITH_HASH_ERROR1(PyThreadState *tstate, PyObject *dict, PyObject *key);\nextern PyObject *DICT_GET_ITEM_WITH_HASH_ERROR0(PyThreadState *tstate, PyObject *dict, PyObject *key);\n\n// Get dict lookup for a key, similar to PyDict_GetItem, 1=ref returned, 0=not\nextern PyObject *DICT_GET_ITEM1(PyThreadState *tstate, PyObject *dict, PyObject *key);\nextern PyObject *DICT_GET_ITEM0(PyThreadState *tstate, PyObject *dict, PyObject *key);\n\n// Get dict lookup for a key, similar to PyDict_Contains\nextern int DICT_HAS_ITEM(PyThreadState *tstate, PyObject *dict, PyObject *key);\n\n// Convert to dictionary, helper for built-in \"dict\" mainly.\nextern PyObject *TO_DICT(PyThreadState *tstate, PyObject *seq_obj, PyObject *dict_obj);\n\nNUITKA_MAY_BE_UNUSED static void UPDATE_STRING_DICT0(PyDictObject *dict, Nuitka_StringObject *key, PyObject *value) {\n    CHECK_OBJECT(value);\n\n    Nuitka_DictEntryHandle entry = GET_STRING_DICT_ENTRY(dict, key);\n\n#if PYTHON_VERSION >= 0x360\n    if (entry == NULL) {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n        return;\n    }\n#endif\n\n    PyObject *old = GET_DICT_ENTRY_VALUE(entry);\n\n    // Values are more likely (more often) set than not set, in that case\n    // speculatively try the quickest access method.\n    if (likely(old != NULL)) {\n        Py_INCREF(value);\n        SET_DICT_ENTRY_VALUE(entry, value);\n\n        CHECK_OBJECT(old);\n\n        Py_DECREF(old);\n    } else {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static void UPDATE_STRING_DICT_INPLACE(PyDictObject *dict, Nuitka_StringObject *key,\n                                                            PyObject *value) {\n    CHECK_OBJECT(value);\n\n    Nuitka_DictEntryHandle entry = GET_STRING_DICT_ENTRY(dict, key);\n\n#if PYTHON_VERSION >= 0x360\n    if (entry == NULL) {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n\n        Py_DECREF(value);\n        CHECK_OBJECT(value);\n\n        return;\n    }\n#endif\n\n    PyObject *old = GET_DICT_ENTRY_VALUE(entry);\n\n    // Values are more likely (more often) set than not set, in that case\n    // speculatively try the quickest access method.\n    if (likely(old != NULL)) {\n        SET_DICT_ENTRY_VALUE(entry, value);\n    } else {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n        Py_DECREF(value);\n\n        CHECK_OBJECT(value);\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static void UPDATE_STRING_DICT1(PyDictObject *dict, Nuitka_StringObject *key, PyObject *value) {\n    CHECK_OBJECT(key);\n    CHECK_OBJECT(value);\n\n    Nuitka_DictEntryHandle entry = GET_STRING_DICT_ENTRY(dict, key);\n\n#if PYTHON_VERSION >= 0x360\n    if (entry == NULL) {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n\n        Py_DECREF(value);\n        CHECK_OBJECT(value);\n\n        return;\n    }\n#endif\n\n    PyObject *old = GET_DICT_ENTRY_VALUE(entry);\n\n    // Values are more likely (more often) set than not set, in that case\n    // speculatively try the quickest access method.\n    if (likely(old != NULL)) {\n        SET_DICT_ENTRY_VALUE(entry, value);\n\n        Py_DECREF(old);\n    } else {\n        DICT_SET_ITEM((PyObject *)dict, (PyObject *)key, value);\n\n        Py_DECREF(value);\n        CHECK_OBJECT(value);\n    }\n}\n\n#if PYTHON_VERSION < 0x300\n// Python2 dictionary keys, return a list of keys\nextern PyObject *DICT_KEYS(PyObject *dict);\n// Python2 dictionary items, return a list of values\nextern PyObject *DICT_VALUES(PyObject *dict);\n// Python2 dictionary items, return a list of key/value tuples\nextern PyObject *DICT_ITEMS(PyObject *dict);\n#endif\n\n// Python3 dictionary keys, Python2 iterkeys returns dictionary keys iterator\nextern PyObject *DICT_ITERKEYS(PyObject *dict);\n\n// Python3 dictionary values, Python2 itervalues returns dictionary values iterator\nextern PyObject *DICT_ITERVALUES(PyObject *dict);\n\n// Python3 dictionary items, Python2 iteritems returns dictionary items iterator\nextern PyObject *DICT_ITERITEMS(PyObject *dict);\n\n// Python dictionary keys view\nextern PyObject *DICT_VIEWKEYS(PyObject *dict);\n\n// Python dictionary values view\nextern PyObject *DICT_VIEWVALUES(PyObject *dict);\n\n// Python dictionary items view\nextern PyObject *DICT_VIEWITEMS(PyObject *dict);\n\n// Python dictionary copy, return a shallow copy of a dictionary.\nextern PyObject *DICT_COPY(PyObject *dict);\n\n// Python dictionary clear, empties the dictionary.\nextern void DICT_CLEAR(PyObject *dict);\n\n// Replacement for PyDict_Next that is faster (to call).\nextern bool Nuitka_DictNext(PyObject *dict, Py_ssize_t *pos, PyObject **key_ptr, PyObject **value_ptr);\n\n#if PYTHON_VERSION >= 0x3a0\n#define NUITKA_DICT_HAS_FREELIST 1\n\n// Replacement for PyDict_New that is faster\nextern PyObject *MAKE_DICT_EMPTY(void);\n#else\n#define NUITKA_DICT_HAS_FREELIST 0\n#define MAKE_DICT_EMPTY PyDict_New\n#endif\n\n// Create a dictionary from key/value pairs.\nextern PyObject *MAKE_DICT(PyObject **pairs, Py_ssize_t size);\n// Create a dictionary from key/value pairs (NULL value means skip)\nextern PyObject *MAKE_DICT_X(PyObject **pairs, Py_ssize_t size);\n// Create a dictionary from key/value pairs (NULL value means skip) where keys are C strings.\nextern PyObject *MAKE_DICT_X_CSTR(char const **keys, PyObject **values, Py_ssize_t size);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/floats.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_FLOATS_H__\n#define __NUITKA_HELPER_FLOATS_H__\n\n#if PYTHON_VERSION >= 0x3a0\n#define NUITKA_FLOAT_HAS_FREELIST 1\n\n// Replacement for PyFloat_FromDouble that is faster\nextern PyObject *MAKE_FLOAT_FROM_DOUBLE(double value);\n#else\n#define NUITKA_FLOAT_HAS_FREELIST 0\n#define MAKE_FLOAT_FROM_DOUBLE(value) PyFloat_FromDouble(value)\n#endif\n\nextern PyObject *TO_FLOAT(PyObject *value);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/import_hard.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperImportHard.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helper for hard import of module \"__future__\" import. */\nextern PyObject *IMPORT_HARD___FUTURE__(void);\n\n/* C helper for hard import of module \"_frozen_importlib\" import. */\n#if PYTHON_VERSION >= 0x300\nextern PyObject *IMPORT_HARD__FROZEN_IMPORTLIB(void);\n#endif\n\n/* C helper for hard import of module \"_frozen_importlib_external\" import. */\n#if PYTHON_VERSION >= 0x350\nextern PyObject *IMPORT_HARD__FROZEN_IMPORTLIB_EXTERNAL(void);\n#endif\n\n/* C helper for hard import of module \"_io\" import. */\nextern PyObject *IMPORT_HARD__IO(void);\n\n/* C helper for hard import of module \"builtins\" import. */\nextern PyObject *IMPORT_HARD_BUILTINS(void);\n\n/* C helper for hard import of module \"ctypes\" import. */\nextern PyObject *IMPORT_HARD_CTYPES(void);\n\n/* C helper for hard import of module \"ctypes.macholib\" import. */\nextern PyObject *IMPORT_HARD_CTYPES__MACHOLIB(void);\n\n/* C helper for hard import of module \"ctypes.wintypes\" import. */\n#if defined(_WIN32)\nextern PyObject *IMPORT_HARD_CTYPES__WINTYPES(void);\n#endif\n\n/* C helper for hard import of module \"functools\" import. */\nextern PyObject *IMPORT_HARD_FUNCTOOLS(void);\n\n/* C helper for hard import of module \"importlib\" import. */\nextern PyObject *IMPORT_HARD_IMPORTLIB(void);\n\n/* C helper for hard import of module \"importlib.metadata\" import. */\n#if PYTHON_VERSION >= 0x380\nextern PyObject *IMPORT_HARD_IMPORTLIB__METADATA(void);\n#endif\n\n/* C helper for hard import of module \"importlib.resources\" import. */\n#if PYTHON_VERSION >= 0x370\nextern PyObject *IMPORT_HARD_IMPORTLIB__RESOURCES(void);\n#endif\n\n/* C helper for hard import of module \"importlib_metadata\" import. */\nextern PyObject *IMPORT_HARD_IMPORTLIB_METADATA(void);\n\n/* C helper for hard import of module \"importlib_resources\" import. */\nextern PyObject *IMPORT_HARD_IMPORTLIB_RESOURCES(void);\n\n/* C helper for hard import of module \"io\" import. */\nextern PyObject *IMPORT_HARD_IO(void);\n\n/* C helper for hard import of module \"ntpath\" import. */\nextern PyObject *IMPORT_HARD_NTPATH(void);\n\n/* C helper for hard import of module \"os\" import. */\nextern PyObject *IMPORT_HARD_OS(void);\n\n/* C helper for hard import of module \"pkg_resources\" import. */\nextern PyObject *IMPORT_HARD_PKG_RESOURCES(void);\n\n/* C helper for hard import of module \"pkgutil\" import. */\nextern PyObject *IMPORT_HARD_PKGUTIL(void);\n\n/* C helper for hard import of module \"posixpath\" import. */\nextern PyObject *IMPORT_HARD_POSIXPATH(void);\n\n/* C helper for hard import of module \"site\" import. */\nextern PyObject *IMPORT_HARD_SITE(void);\n\n/* C helper for hard import of module \"sys\" import. */\nextern PyObject *IMPORT_HARD_SYS(void);\n\n/* C helper for hard import of module \"sysconfig\" import. */\nextern PyObject *IMPORT_HARD_SYSCONFIG(void);\n\n/* C helper for hard import of module \"tensorflow\" import. */\nextern PyObject *IMPORT_HARD_TENSORFLOW(void);\n\n/* C helper for hard import of module \"types\" import. */\nextern PyObject *IMPORT_HARD_TYPES(void);\n\n/* C helper for hard import of module \"typing\" import. */\n#if PYTHON_VERSION >= 0x350\nextern PyObject *IMPORT_HARD_TYPING(void);\n#endif\n\n/* C helper for hard import of module \"unittest\" import. */\nextern PyObject *IMPORT_HARD_UNITTEST(void);\n\n/* C helper for hard import of module \"unittest.mock\" import. */\n#if PYTHON_VERSION >= 0x300\nextern PyObject *IMPORT_HARD_UNITTEST__MOCK(void);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/indexes.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_INDEXES_H__\n#define __NUITKA_HELPER_INDEXES_H__\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Avoid the API version of \"PyIndex_Check\" with this.\n#if PYTHON_VERSION >= 0x380\nstatic inline bool Nuitka_Index_Check(PyObject *obj) {\n    PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number;\n\n    return (tp_as_number != NULL && tp_as_number->nb_index != NULL);\n}\n#else\n#define Nuitka_Index_Check(obj) PyIndex_Check(obj)\n#endif\n\n// Similar to \"PyNumber_Index\" but \"Nuitka_Number_IndexAsLong\" could be more relevant\nextern PyObject *Nuitka_Number_Index(PyObject *item);\n\n// In Python 3.10 or higher, the conversion to long is forced, but sometimes we\n// do not care at all, or it should not be done.\n#if PYTHON_VERSION >= 0x3a0\nextern PyObject *Nuitka_Number_IndexAsLong(PyObject *item);\n#else\n#define Nuitka_Number_IndexAsLong(item) Nuitka_Number_Index(item)\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/ints.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_INTS_H__\n#define __NUITKA_HELPER_INTS_H__\n\ntypedef enum {\n    NUITKA_INT_UNASSIGNED = 0,\n    NUITKA_INT_OBJECT_VALID = 1,\n    NUITKA_INT_VALUE_VALID = 2,\n    NUITKA_INT_BOTH_VALID = 3\n} nuitka_int_validity;\n\ntypedef struct {\n    nuitka_int_validity validity;\n\n    PyObject *int_object;\n    long int_value;\n} nuitka_int;\n\ntypedef enum {\n    NUITKA_LONG_UNASSIGNED = 0,\n    NUITKA_LONG_OBJECT_VALID = 1,\n    NUITKA_LONG_VALUE_VALID = 2,\n    NUITKA_LONG_BOTH_VALID = 3 // NUITKA_LONG_VALUE_VALID | NUITKA_LONG_OBJECT_VALID\n} nuitka_long_validity;\n\ntypedef struct {\n    nuitka_long_validity validity;\n\n    PyObject *long_object;\n    long long_value;\n} nuitka_long;\n\n#if PYTHON_VERSION < 0x300\ntypedef enum {\n    NUITKA_ILONG_UNASSIGNED = 0,\n    NUITKA_ILONG_OBJECT_VALID = 1,\n    NUITKA_ILONG_VALUE_VALID = 2,\n    NUITKA_ILONG_BOTH_VALID = 3\n} nuitka_ilong_validity;\n\ntypedef struct {\n    nuitka_ilong_validity validity;\n\n    PyObject *ilong_object;\n    long ilong_value;\n} nuitka_ilong;\n\nNUITKA_MAY_BE_UNUSED static void ENFORCE_ILONG_OBJECT_VALUE(nuitka_ilong *value) {\n    assert(value->validity != NUITKA_ILONG_UNASSIGNED);\n\n    if ((value->validity & NUITKA_ILONG_OBJECT_VALID) == 0) {\n        value->ilong_object = PyLong_FromLong(value->ilong_value);\n\n        value->validity = NUITKA_ILONG_BOTH_VALID;\n    }\n}\n\n#endif\n\n// TODO: Use this from header files, although they have changed.\n#define NUITKA_STATIC_SMALLINT_VALUE_MIN -5\n#define NUITKA_STATIC_SMALLINT_VALUE_MAX 257\n\n#define NUITKA_TO_SMALL_VALUE_OFFSET(value) (value - NUITKA_STATIC_SMALLINT_VALUE_MIN)\n\n#if PYTHON_VERSION < 0x3b0\n\n#if PYTHON_VERSION >= 0x300\n\n#if PYTHON_VERSION >= 0x390\nextern PyObject **Nuitka_Long_SmallValues;\n#else\nextern PyObject *Nuitka_Long_SmallValues[NUITKA_STATIC_SMALLINT_VALUE_MAX - NUITKA_STATIC_SMALLINT_VALUE_MIN + 1];\n#endif\n\nNUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_Long_GetSmallValue(int ival) {\n    return Nuitka_Long_SmallValues[NUITKA_TO_SMALL_VALUE_OFFSET(ival)];\n}\n\n#endif\n\n#else\nNUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_Long_GetSmallValue(int ival) {\n    return (PyObject *)&_PyLong_SMALL_INTS[NUITKA_TO_SMALL_VALUE_OFFSET(ival)];\n}\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/iterators.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_ITERATORS_H__\n#define __NUITKA_HELPER_ITERATORS_H__\n\n#if PYTHON_VERSION >= 0x270\n// Initialize value for \"tp_iternext\" to compare with, needed by HAS_ITERNEXT\n// which emulates \"PyCheck_Iter\" but is bug free.\nextern iternextfunc default_iternext;\nextern void _initSlotIterNext(void);\n#endif\n\n// This is like \"PyIter_Check\" but without bugs due to shared library pointers.\nNUITKA_MAY_BE_UNUSED static inline bool HAS_ITERNEXT(PyObject *value) {\n#if PYTHON_VERSION < 0x300\n    if (!PyType_HasFeature(Py_TYPE(value), Py_TPFLAGS_HAVE_ITER)) {\n        return false;\n    }\n#endif\n\n    iternextfunc tp_iternext = Py_TYPE(value)->tp_iternext;\n\n    if (tp_iternext == NULL) {\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x270\n    return tp_iternext != default_iternext;\n#else\n    return true;\n#endif\n}\n\n// Taken from CPython implementation, so we can access and create it, needs to match\n// their definition exactly.\ntypedef struct {\n    PyObject_HEAD\n#if PYTHON_VERSION < 0x340\n        long it_index;\n#else\n        Py_ssize_t it_index;\n#endif\n    PyObject *it_seq;\n} seqiterobject;\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_ITERATOR_INFALLIBLE(PyObject *iterated) {\n    CHECK_OBJECT(iterated);\n\n#if PYTHON_VERSION < 0x300\n    getiterfunc tp_iter = NULL;\n    if (PyType_HasFeature(Py_TYPE(iterated), Py_TPFLAGS_HAVE_ITER)) {\n        tp_iter = Py_TYPE(iterated)->tp_iter;\n    }\n#else\n    getiterfunc tp_iter = Py_TYPE(iterated)->tp_iter;\n#endif\n    if (tp_iter) {\n        PyObject *result = (*tp_iter)(iterated);\n        CHECK_OBJECT(result);\n        assert(HAS_ITERNEXT(result));\n\n        return result;\n    } else {\n        assert(PySequence_Check(iterated));\n\n        seqiterobject *result = (seqiterobject *)Nuitka_GC_New(&PySeqIter_Type);\n        assert(result);\n\n        result->it_index = 0;\n        Py_INCREF(iterated);\n        result->it_seq = iterated;\n\n        Nuitka_GC_Track(result);\n\n        return (PyObject *)result;\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_ITERATOR(PyThreadState *tstate, PyObject *iterated) {\n    CHECK_OBJECT(iterated);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ITERATOR_OPT\n    return PyObject_GetIter(iterated);\n#else\n\n#if PYTHON_VERSION < 0x300\n    getiterfunc tp_iter = NULL;\n    if (PyType_HasFeature(Py_TYPE(iterated), Py_TPFLAGS_HAVE_ITER)) {\n        tp_iter = Py_TYPE(iterated)->tp_iter;\n    }\n#else\n    getiterfunc tp_iter = Py_TYPE(iterated)->tp_iter;\n#endif\n\n    if (tp_iter) {\n        PyObject *result = (*tp_iter)(iterated);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        } else if (unlikely(!HAS_ITERNEXT(result))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"iter() returned non-iterator of type '%s'\", result);\n\n            Py_DECREF(result);\n\n            return NULL;\n        } else {\n            return result;\n        }\n    } else if (PySequence_Check(iterated)) {\n        seqiterobject *result = (seqiterobject *)Nuitka_GC_New(&PySeqIter_Type);\n        assert(result);\n\n        result->it_index = 0;\n        Py_INCREF(iterated);\n        result->it_seq = iterated;\n\n        Nuitka_GC_Track(result);\n\n        return (PyObject *)result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not iterable\", iterated);\n\n        return NULL;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x370\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_UNPACK_ITERATOR(PyObject *iterated) {\n    CHECK_OBJECT(iterated);\n\n    getiterfunc tp_iter = Py_TYPE(iterated)->tp_iter;\n\n    if (tp_iter) {\n        PyObject *result = (*tp_iter)(iterated);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        } else if (unlikely(!HAS_ITERNEXT(result))) {\n            PyErr_Format(PyExc_TypeError, \"iter() returned non-iterator of type '%s'\", Py_TYPE(result)->tp_name);\n\n            Py_DECREF(result);\n\n            return NULL;\n        } else {\n            return result;\n        }\n    } else if (PySequence_Check(iterated)) {\n        seqiterobject *result = (seqiterobject *)Nuitka_GC_New(&PySeqIter_Type);\n        assert(result);\n\n        result->it_index = 0;\n        Py_INCREF(iterated);\n        result->it_seq = iterated;\n\n        Nuitka_GC_Track(result);\n\n        return (PyObject *)result;\n    } else {\n        PyErr_Format(PyExc_TypeError, \"cannot unpack non-iterable %s object\", Py_TYPE(iterated)->tp_name);\n\n        return NULL;\n    }\n}\n\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyObject *ITERATOR_NEXT(PyObject *iterator) {\n    CHECK_OBJECT(iterator);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ITERATOR_OPT\n    return PyIter_Next(iterator);\n#else\n    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;\n\n    if (unlikely(iternext == NULL)) {\n        PyErr_Format(PyExc_TypeError,\n#if PYTHON_VERSION < 0x300 && defined(_NUITKA_FULL_COMPAT)\n                     \"%s object is not an iterator\",\n#else\n                     \"'%s' object is not an iterator\",\n#endif\n                     Py_TYPE(iterator)->tp_name);\n\n        return NULL;\n    }\n\n    PyObject *result = (*iternext)(iterator);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *BUILTIN_NEXT2(PyThreadState *tstate, PyObject *iterator,\n                                                    PyObject *default_value) {\n    CHECK_OBJECT(iterator);\n    CHECK_OBJECT(default_value);\n\n    PyObject *result = (*Py_TYPE(iterator)->tp_iternext)(iterator);\n\n    if (unlikely(result == NULL)) {\n        bool stop_iteration_error = CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate);\n\n        if (unlikely(stop_iteration_error == false)) {\n            return NULL;\n        }\n\n        Py_INCREF(default_value);\n        return default_value;\n    }\n\n    CHECK_OBJECT(result);\n    return result;\n}\n\n// For cases, where no exception raising is needed, because we know it at compile time.\nNUITKA_MAY_BE_UNUSED static PyObject *UNPACK_NEXT_INFALLIBLE(PyObject *iterator) {\n    CHECK_OBJECT(iterator);\n    assert(HAS_ITERNEXT(iterator));\n\n    PyObject *result = (*Py_TYPE(iterator)->tp_iternext)(iterator);\n    CHECK_OBJECT(result);\n    return result;\n}\n\n#if PYTHON_VERSION < 0x350\nNUITKA_MAY_BE_UNUSED static PyObject *UNPACK_NEXT(PyThreadState *tstate, PyObject *iterator, int seq_size_so_far)\n#else\nNUITKA_MAY_BE_UNUSED static PyObject *UNPACK_NEXT(PyThreadState *tstate, PyObject *iterator, int seq_size_so_far,\n                                                  int expected)\n#endif\n{\n    CHECK_OBJECT(iterator);\n    assert(HAS_ITERNEXT(iterator));\n\n    PyObject *result = (*Py_TYPE(iterator)->tp_iternext)(iterator);\n\n    if (unlikely(result == NULL)) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n#if PYTHON_VERSION < 0x300\n        if (unlikely(error == NULL))\n#else\n        if (unlikely((error == NULL) || EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration)))\n#endif\n        {\n#if PYTHON_VERSION < 0x350\n            if (seq_size_so_far == 1) {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"need more than 1 value to unpack\");\n            } else {\n                PyErr_Format(PyExc_ValueError, \"need more than %d values to unpack\", seq_size_so_far);\n            }\n#else\n            PyErr_Format(PyExc_ValueError, \"not enough values to unpack (expected %d, got %d)\", expected,\n                         seq_size_so_far);\n#endif\n        }\n\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x350\n// Different error message for starred unpacks\nNUITKA_MAY_BE_UNUSED static PyObject *UNPACK_NEXT_STARRED(PyThreadState *tstate, PyObject *iterator,\n                                                          int seq_size_so_far, int expected) {\n    CHECK_OBJECT(iterator);\n    assert(HAS_ITERNEXT(iterator));\n\n    PyObject *result = (*Py_TYPE(iterator)->tp_iternext)(iterator);\n\n    if (unlikely(result == NULL)) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n        if (unlikely((error == NULL) || EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration))) {\n            PyErr_Format(PyExc_ValueError, \"not enough values to unpack (expected at least %d, got %d)\", expected,\n                         seq_size_so_far);\n        }\n\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n\n    return result;\n}\n#endif\n\n// TODO: How come this is unused code.\nNUITKA_MAY_BE_UNUSED static bool UNPACK_ITERATOR_CHECK(PyThreadState *tstate, PyObject *iterator) {\n    CHECK_OBJECT(iterator);\n    assert(HAS_ITERNEXT(iterator));\n\n    PyObject *attempt = (*Py_TYPE(iterator)->tp_iternext)(iterator);\n\n    if (likely(attempt == NULL)) {\n        return CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate);\n    } else {\n        Py_DECREF(attempt);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"too many values to unpack\");\n        return false;\n    }\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/lists.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_LISTS_H__\n#define __NUITKA_HELPER_LISTS_H__\n\n// Like PyList_SET_ITEM but takes a reference to the item.\n#define PyList_SET_ITEM0(tuple, index, value)                                                                          \\\n    {                                                                                                                  \\\n        PyObject *tmp = value;                                                                                         \\\n        Py_INCREF(tmp);                                                                                                \\\n        PyList_SET_ITEM(tuple, index, tmp);                                                                            \\\n    }\n\n#ifndef _PyList_ITEMS\n#define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item)\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\n#define NUITKA_LIST_HAS_FREELIST 1\nextern PyObject *MAKE_LIST_EMPTY(Py_ssize_t size);\n#else\n#define NUITKA_LIST_HAS_FREELIST 0\n\n#define MAKE_LIST_EMPTY(size) PyList_New(size)\n#endif\n\nextern bool LIST_EXTEND_FROM_ITERABLE(PyThreadState *tstate, PyObject *list, PyObject *other);\nextern bool LIST_EXTEND_FOR_UNPACK(PyThreadState *tstate, PyObject *list, PyObject *other);\n\n// Like \"PyList_Append\", but we get to specify the transfer of refcount ownership.\nextern bool LIST_APPEND1(PyObject *target, PyObject *item);\nextern bool LIST_APPEND0(PyObject *target, PyObject *item);\n\n// Like \"list.remove\"\nbool LIST_REMOVE(PyObject *target, PyObject *item);\n\n// Like list.clear\nextern void LIST_CLEAR(PyObject *target);\n\n// Like list.reverse\nextern void LIST_REVERSE(PyObject *list);\n\n// Like list.copy\nextern PyObject *LIST_COPY(PyObject *list);\n\n// Like list.count\nextern PyObject *LIST_COUNT(PyObject *list, PyObject *item);\n\n// Like list.index\nextern PyObject *LIST_INDEX2(PyThreadState *tstate, PyObject *list, PyObject *item);\nextern PyObject *LIST_INDEX3(PyThreadState *tstate, PyObject *list, PyObject *item, PyObject *start);\nextern PyObject *LIST_INDEX4(PyThreadState *tstate, PyObject *list, PyObject *item, PyObject *start, PyObject *stop);\n\n// Like list.index\nextern bool LIST_INSERT(PyThreadState *tstate, PyObject *list, PyObject *index, PyObject *item);\n// Like PyList_Insert\nextern void LIST_INSERT_CONST(PyObject *list, Py_ssize_t index, PyObject *item);\n\nextern PyObject *MAKE_LIST(PyThreadState *tstate, PyObject *iterable);\n\nextern bool LIST_EXTEND_FROM_LIST(PyObject *list, PyObject *other);\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_LIST_REPEATED(Py_ssize_t size, PyObject *element) {\n    PyObject *result = MAKE_LIST_EMPTY(size);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        Py_INCREF(element);\n        PyList_SET_ITEM(result, i, element);\n    }\n\n    return result;\n}\n\n#include \"lists_generated.h\"\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/lists_generated.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template CodeTemplateMakeListSmall.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nextern PyObject *MAKE_LIST1(PyObject *arg0);\nextern PyObject *MAKE_LIST2(PyObject *arg0, PyObject *arg1);\nextern PyObject *MAKE_LIST3(PyObject *arg0, PyObject *arg1, PyObject *arg2);\nextern PyObject *MAKE_LIST4(PyObject *list);\nextern PyObject *MAKE_LIST5(PyObject *list);\nextern PyObject *MAKE_LIST6(PyObject *list);\nextern PyObject *MAKE_LIST7(PyObject *list);\nextern PyObject *MAKE_LIST8(PyObject *list);\nextern PyObject *MAKE_LIST9(PyObject *list);\nextern PyObject *MAKE_LIST10(PyObject *list);\nextern PyObject *MAKE_LIST11(PyObject *list);\nextern PyObject *MAKE_LIST12(PyObject *list);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/mappings.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_MAPPINGS_H__\n#define __NUITKA_MAPPINGS_H__\n\nextern Py_ssize_t Nuitka_PyMapping_Size(PyObject *mapping);\n\nNUITKA_MAY_BE_UNUSED static int MAPPING_HAS_ITEM(PyThreadState *tstate, PyObject *mapping, PyObject *key) {\n    PyObject *result = PyObject_GetItem(mapping, key);\n\n    if (result == NULL) {\n        bool had_key_error = CHECK_AND_CLEAR_KEY_ERROR_OCCURRED(tstate);\n\n        if (had_key_error) {\n            return 0;\n        } else {\n            return -1;\n        }\n    } else {\n        Py_DECREF(result);\n        return 1;\n    }\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_OPERATIONS_H__\n#define __NUITKA_OPERATIONS_H__\n\n#if PYTHON_VERSION >= 0x300\nextern PyObject *UNICODE_CONCAT(PyThreadState *tstate, PyObject *left, PyObject *right);\nextern bool UNICODE_APPEND(PyThreadState *tstate, PyObject **p_left, PyObject *right);\n#else\n// TODO: Specialize for Python2 too.\nNUITKA_MAY_BE_UNUSED static PyObject *UNICODE_CONCAT(PyThreadState *tstate, PyObject *left, PyObject *right) {\n    return PyUnicode_Concat(left, right);\n}\n#endif\n\n// This macro is necessary for Python2 to determine if the \"coerce\" slot\n// will have to be considered or not, and if in-place operations are\n// allowed to be there or not.\n#if PYTHON_VERSION < 0x300\n#define NEW_STYLE_NUMBER(o) PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_CHECKTYPES)\n#define NEW_STYLE_NUMBER_TYPE(t) PyType_HasFeature(t, Py_TPFLAGS_CHECKTYPES)\n#define CAN_HAVE_INPLACE(t) PyType_HasFeature(t, Py_TPFLAGS_HAVE_INPLACEOPS)\n#else\n#define NEW_STYLE_NUMBER(o) (true)\n#define NEW_STYLE_NUMBER_TYPE(t) (true)\n#define CAN_HAVE_INPLACE(t) (true)\n#endif\n\ntypedef PyObject *(unary_api)(PyObject *);\n\nNUITKA_MAY_BE_UNUSED static PyObject *UNARY_OPERATION(unary_api api, PyObject *operand) {\n    CHECK_OBJECT(operand);\n    PyObject *result = api(operand);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n\n    return result;\n}\n\n// Generated helpers to execute operations on fully or partially known types.\n#include \"nuitka/helper/operations_binary_add.h\"\n#include \"nuitka/helper/operations_binary_bitand.h\"\n#include \"nuitka/helper/operations_binary_bitor.h\"\n#include \"nuitka/helper/operations_binary_bitxor.h\"\n#include \"nuitka/helper/operations_binary_divmod.h\"\n#include \"nuitka/helper/operations_binary_floordiv.h\"\n#include \"nuitka/helper/operations_binary_lshift.h\"\n#include \"nuitka/helper/operations_binary_mod.h\"\n#include \"nuitka/helper/operations_binary_mult.h\"\n#include \"nuitka/helper/operations_binary_pow.h\"\n#include \"nuitka/helper/operations_binary_rshift.h\"\n#include \"nuitka/helper/operations_binary_sub.h\"\n#include \"nuitka/helper/operations_binary_truediv.h\"\n\n#include \"nuitka/helper/operations_inplace_add.h\"\n#include \"nuitka/helper/operations_inplace_bitand.h\"\n#include \"nuitka/helper/operations_inplace_bitor.h\"\n#include \"nuitka/helper/operations_inplace_bitxor.h\"\n#include \"nuitka/helper/operations_inplace_floordiv.h\"\n#include \"nuitka/helper/operations_inplace_lshift.h\"\n#include \"nuitka/helper/operations_inplace_mod.h\"\n#include \"nuitka/helper/operations_inplace_mult.h\"\n#include \"nuitka/helper/operations_inplace_pow.h\"\n#include \"nuitka/helper/operations_inplace_rshift.h\"\n#include \"nuitka/helper/operations_inplace_sub.h\"\n#include \"nuitka/helper/operations_inplace_truediv.h\"\n\n#if PYTHON_VERSION < 0x300\n// Classical division is Python2 only.\n#include \"nuitka/helper/operations_binary_olddiv.h\"\n#include \"nuitka/helper/operations_inplace_olddiv.h\"\n#endif\n#if PYTHON_VERSION >= 0x350\n// Matrix multiplication is Python3.5 or higher only.\n#include \"nuitka/helper/operations_binary_matmult.h\"\n#include \"nuitka/helper/operations_inplace_matmult.h\"\n#endif\n\n// TODO: Get rid of the need for these, we should inline the abstract\n// algorithms, for now we have them for easier templating.\n#define PyNumber_InPlaceSub PyNumber_InPlaceSubtract\n#define PyNumber_InPlaceMult PyNumber_InPlaceMultiply\n#define PyNumber_InPlaceOlddiv PyNumber_InPlaceDivide\n#define PyNumber_InPlacePow(a, b) PyNumber_InPlacePower(a, b, Py_None)\n#define PyNumber_InPlaceMod PyNumber_InPlaceRemainder\n#define PyNumber_InPlaceBitor PyNumber_InPlaceOr\n#define PyNumber_InPlaceBitxor PyNumber_InPlaceXor\n#define PyNumber_InPlaceBitand PyNumber_InPlaceAnd\n#define PyNumber_InPlaceTruediv PyNumber_InPlaceTrueDivide\n#define PyNumber_InPlaceFloordiv PyNumber_InPlaceFloorDivide\n#define PyNumber_InPlaceMatmult PyNumber_InPlaceMatrixMultiply\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_add.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"+\" (ADD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_UNICODE_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_STR_UNICODE(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_bitand.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"&\" (BITAND) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_bitor.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"|\" (BITOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_bitxor.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"^\" (BITXOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_divmod.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"divmod\" (DIVMOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_floordiv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"//\" (FLOORDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_lshift.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<<\" (LSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_matmult.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"@\" (MATMULT) operations */\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_mod.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"%\" (MOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"DICT\" to Python 'dict'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"DICT\" to Python 'dict'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"DICT\" to Python 'dict'. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_mult.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"*\" (MULT) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_INT_LIST(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"UNICODE\" to Python2 'unicode', Python3\n * 'str'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LIST(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_olddiv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"/\" (OLDDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_pow.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"**\" (POW) operations */\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_POW_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_rshift.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">>\" (RSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern nuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_sub.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"-\" (SUB) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2);\n\n/* Code referring to \"DIGIT\" corresponds to C platform digit value for long Python objects and \"LONG\" to Python2 'long',\n * Python3 'int'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(long operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_binary_truediv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"/\" (TRUEDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_builtin_types.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperBuiltinMethodOperation.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION < 0x300\nextern PyObject *str_builtin_format;\n#endif\nextern PyObject *unicode_builtin_format;\nextern PyObject *dict_builtin_fromkeys;\nextern PyObject *DICT_POP2(PyThreadState *tstate, PyObject *dict, PyObject *key);\nextern PyObject *DICT_POP3(PyThreadState *tstate, PyObject *dict, PyObject *key, PyObject *default_value);\nextern PyObject *DICT_POPITEM(PyThreadState *tstate, PyObject *dict);\nextern PyObject *DICT_SETDEFAULT2(PyThreadState *tstate, PyObject *dict, PyObject *key);\nextern PyObject *DICT_SETDEFAULT3(PyThreadState *tstate, PyObject *dict, PyObject *key, PyObject *default_value);\nextern PyObject *LIST_POP1(PyThreadState *tstate, PyObject *list);\nextern PyObject *LIST_POP2(PyThreadState *tstate, PyObject *list, PyObject *index);\n#if PYTHON_VERSION < 0x300\nextern PyObject *STR_CAPITALIZE(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_CENTER2(PyThreadState *tstate, PyObject *str, PyObject *width);\nextern PyObject *STR_CENTER3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar);\nextern PyObject *STR_COUNT2(PyThreadState *tstate, PyObject *str, PyObject *sub);\nextern PyObject *STR_COUNT3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start);\nextern PyObject *STR_COUNT4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *STR_DECODE1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_DECODE2(PyThreadState *tstate, PyObject *str, PyObject *encoding);\nextern PyObject *STR_DECODE3(PyThreadState *tstate, PyObject *str, PyObject *encoding, PyObject *errors);\nextern PyObject *STR_ENCODE1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ENCODE2(PyThreadState *tstate, PyObject *str, PyObject *encoding);\nextern PyObject *STR_ENCODE3(PyThreadState *tstate, PyObject *str, PyObject *encoding, PyObject *errors);\nextern PyObject *STR_ENDSWITH2(PyThreadState *tstate, PyObject *str, PyObject *suffix);\nextern PyObject *STR_ENDSWITH3(PyThreadState *tstate, PyObject *str, PyObject *suffix, PyObject *start);\nextern PyObject *STR_ENDSWITH4(PyThreadState *tstate, PyObject *str, PyObject *suffix, PyObject *start, PyObject *end);\nextern PyObject *STR_EXPANDTABS1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_EXPANDTABS2(PyThreadState *tstate, PyObject *str, PyObject *tabsize);\nextern PyObject *STR_FIND2(PyThreadState *tstate, PyObject *str, PyObject *sub);\nextern PyObject *STR_FIND3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start);\nextern PyObject *STR_FIND4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *STR_INDEX2(PyThreadState *tstate, PyObject *str, PyObject *sub);\nextern PyObject *STR_INDEX3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start);\nextern PyObject *STR_INDEX4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *STR_ISALNUM(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISALPHA(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISDIGIT(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISLOWER(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISSPACE(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISTITLE(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ISUPPER(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_LJUST2(PyThreadState *tstate, PyObject *str, PyObject *width);\nextern PyObject *STR_LJUST3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar);\nextern PyObject *STR_LOWER(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_LSTRIP1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_LSTRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars);\nextern PyObject *STR_PARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep);\nextern PyObject *STR_REPLACE3(PyThreadState *tstate, PyObject *str, PyObject *old, PyObject *new_value);\nextern PyObject *STR_REPLACE4(PyThreadState *tstate, PyObject *str, PyObject *old, PyObject *new_value,\n                              PyObject *count);\nextern PyObject *STR_RFIND2(PyThreadState *tstate, PyObject *str, PyObject *sub);\nextern PyObject *STR_RFIND3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start);\nextern PyObject *STR_RFIND4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *STR_RINDEX2(PyThreadState *tstate, PyObject *str, PyObject *sub);\nextern PyObject *STR_RINDEX3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start);\nextern PyObject *STR_RINDEX4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *STR_RJUST2(PyThreadState *tstate, PyObject *str, PyObject *width);\nextern PyObject *STR_RJUST3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar);\nextern PyObject *STR_RPARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep);\nextern PyObject *STR_RSPLIT1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_RSPLIT2(PyThreadState *tstate, PyObject *str, PyObject *sep);\nextern PyObject *STR_RSPLIT3(PyThreadState *tstate, PyObject *str, PyObject *sep, PyObject *maxsplit);\nextern PyObject *STR_RSTRIP1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_RSTRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars);\nextern PyObject *STR_SPLIT1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_SPLIT2(PyThreadState *tstate, PyObject *str, PyObject *sep);\nextern PyObject *STR_SPLIT3(PyThreadState *tstate, PyObject *str, PyObject *sep, PyObject *maxsplit);\nextern PyObject *STR_SPLITLINES1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_SPLITLINES2(PyThreadState *tstate, PyObject *str, PyObject *keepends);\nextern PyObject *STR_STARTSWITH2(PyThreadState *tstate, PyObject *str, PyObject *prefix);\nextern PyObject *STR_STARTSWITH3(PyThreadState *tstate, PyObject *str, PyObject *prefix, PyObject *start);\nextern PyObject *STR_STARTSWITH4(PyThreadState *tstate, PyObject *str, PyObject *prefix, PyObject *start,\n                                 PyObject *end);\nextern PyObject *STR_STRIP1(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_STRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars);\nextern PyObject *STR_SWAPCASE(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_TITLE(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_TRANSLATE(PyThreadState *tstate, PyObject *str, PyObject *table);\nextern PyObject *STR_UPPER(PyThreadState *tstate, PyObject *str);\nextern PyObject *STR_ZFILL(PyThreadState *tstate, PyObject *str, PyObject *width);\n#endif\nextern PyObject *UNICODE_CAPITALIZE(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_CENTER2(PyThreadState *tstate, PyObject *unicode, PyObject *width);\nextern PyObject *UNICODE_CENTER3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar);\nextern PyObject *UNICODE_COUNT2(PyThreadState *tstate, PyObject *unicode, PyObject *sub);\nextern PyObject *UNICODE_COUNT3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start);\nextern PyObject *UNICODE_COUNT4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start,\n                                PyObject *end);\nextern PyObject *UNICODE_ENCODE1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ENCODE2(PyThreadState *tstate, PyObject *unicode, PyObject *encoding);\nextern PyObject *UNICODE_ENCODE3(PyThreadState *tstate, PyObject *unicode, PyObject *encoding, PyObject *errors);\nextern PyObject *UNICODE_ENDSWITH2(PyThreadState *tstate, PyObject *unicode, PyObject *suffix);\nextern PyObject *UNICODE_ENDSWITH3(PyThreadState *tstate, PyObject *unicode, PyObject *suffix, PyObject *start);\nextern PyObject *UNICODE_ENDSWITH4(PyThreadState *tstate, PyObject *unicode, PyObject *suffix, PyObject *start,\n                                   PyObject *end);\nextern PyObject *UNICODE_EXPANDTABS1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_EXPANDTABS2(PyThreadState *tstate, PyObject *unicode, PyObject *tabsize);\nextern PyObject *UNICODE_FIND2(PyThreadState *tstate, PyObject *unicode, PyObject *sub);\nextern PyObject *UNICODE_FIND3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start);\nextern PyObject *UNICODE_FIND4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *UNICODE_INDEX2(PyThreadState *tstate, PyObject *unicode, PyObject *sub);\nextern PyObject *UNICODE_INDEX3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start);\nextern PyObject *UNICODE_INDEX4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start,\n                                PyObject *end);\nextern PyObject *UNICODE_ISALNUM(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISALPHA(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISDIGIT(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISLOWER(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISSPACE(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISTITLE(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ISUPPER(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_LJUST2(PyThreadState *tstate, PyObject *unicode, PyObject *width);\nextern PyObject *UNICODE_LJUST3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar);\nextern PyObject *UNICODE_LOWER(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_LSTRIP1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_LSTRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars);\nextern PyObject *UNICODE_REPLACE3(PyThreadState *tstate, PyObject *unicode, PyObject *old, PyObject *new_value);\nextern PyObject *UNICODE_REPLACE4(PyThreadState *tstate, PyObject *unicode, PyObject *old, PyObject *new_value,\n                                  PyObject *count);\nextern PyObject *UNICODE_RFIND2(PyThreadState *tstate, PyObject *unicode, PyObject *sub);\nextern PyObject *UNICODE_RFIND3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start);\nextern PyObject *UNICODE_RFIND4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start,\n                                PyObject *end);\nextern PyObject *UNICODE_RINDEX2(PyThreadState *tstate, PyObject *unicode, PyObject *sub);\nextern PyObject *UNICODE_RINDEX3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start);\nextern PyObject *UNICODE_RINDEX4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start,\n                                 PyObject *end);\nextern PyObject *UNICODE_RJUST2(PyThreadState *tstate, PyObject *unicode, PyObject *width);\nextern PyObject *UNICODE_RJUST3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar);\nextern PyObject *UNICODE_RSPLIT1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_RSPLIT2(PyThreadState *tstate, PyObject *unicode, PyObject *sep);\nextern PyObject *UNICODE_RSPLIT3(PyThreadState *tstate, PyObject *unicode, PyObject *sep, PyObject *maxsplit);\nextern PyObject *UNICODE_RSTRIP1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_RSTRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars);\nextern PyObject *UNICODE_SPLIT1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_SPLIT2(PyThreadState *tstate, PyObject *unicode, PyObject *sep);\nextern PyObject *UNICODE_SPLIT3(PyThreadState *tstate, PyObject *unicode, PyObject *sep, PyObject *maxsplit);\nextern PyObject *UNICODE_SPLITLINES1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_SPLITLINES2(PyThreadState *tstate, PyObject *unicode, PyObject *keepends);\nextern PyObject *UNICODE_STARTSWITH2(PyThreadState *tstate, PyObject *unicode, PyObject *prefix);\nextern PyObject *UNICODE_STARTSWITH3(PyThreadState *tstate, PyObject *unicode, PyObject *prefix, PyObject *start);\nextern PyObject *UNICODE_STARTSWITH4(PyThreadState *tstate, PyObject *unicode, PyObject *prefix, PyObject *start,\n                                     PyObject *end);\nextern PyObject *UNICODE_STRIP1(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_STRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars);\nextern PyObject *UNICODE_SWAPCASE(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_TITLE(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_TRANSLATE(PyThreadState *tstate, PyObject *unicode, PyObject *table);\nextern PyObject *UNICODE_UPPER(PyThreadState *tstate, PyObject *unicode);\nextern PyObject *UNICODE_ZFILL(PyThreadState *tstate, PyObject *unicode, PyObject *width);\n#if PYTHON_VERSION >= 0x300\nextern PyObject *BYTES_CAPITALIZE(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_CENTER2(PyThreadState *tstate, PyObject *bytes, PyObject *width);\nextern PyObject *BYTES_CENTER3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar);\nextern PyObject *BYTES_COUNT2(PyThreadState *tstate, PyObject *bytes, PyObject *sub);\nextern PyObject *BYTES_COUNT3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start);\nextern PyObject *BYTES_COUNT4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *BYTES_DECODE1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_DECODE2(PyThreadState *tstate, PyObject *bytes, PyObject *encoding);\nextern PyObject *BYTES_DECODE3(PyThreadState *tstate, PyObject *bytes, PyObject *encoding, PyObject *errors);\nextern PyObject *BYTES_ENDSWITH2(PyThreadState *tstate, PyObject *bytes, PyObject *suffix);\nextern PyObject *BYTES_ENDSWITH3(PyThreadState *tstate, PyObject *bytes, PyObject *suffix, PyObject *start);\nextern PyObject *BYTES_ENDSWITH4(PyThreadState *tstate, PyObject *bytes, PyObject *suffix, PyObject *start,\n                                 PyObject *end);\nextern PyObject *BYTES_EXPANDTABS1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_EXPANDTABS2(PyThreadState *tstate, PyObject *bytes, PyObject *tabsize);\nextern PyObject *BYTES_FIND2(PyThreadState *tstate, PyObject *bytes, PyObject *sub);\nextern PyObject *BYTES_FIND3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start);\nextern PyObject *BYTES_FIND4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *BYTES_INDEX2(PyThreadState *tstate, PyObject *bytes, PyObject *sub);\nextern PyObject *BYTES_INDEX3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start);\nextern PyObject *BYTES_INDEX4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *BYTES_ISALNUM(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISALPHA(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISDIGIT(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISLOWER(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISSPACE(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISTITLE(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ISUPPER(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_JOIN(PyThreadState *tstate, PyObject *bytes, PyObject *iterable);\nextern PyObject *BYTES_LJUST2(PyThreadState *tstate, PyObject *bytes, PyObject *width);\nextern PyObject *BYTES_LJUST3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar);\nextern PyObject *BYTES_LOWER(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_LSTRIP1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_LSTRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars);\nextern PyObject *BYTES_PARTITION(PyThreadState *tstate, PyObject *bytes, PyObject *sep);\nextern PyObject *BYTES_REPLACE3(PyThreadState *tstate, PyObject *bytes, PyObject *old, PyObject *new_value);\nextern PyObject *BYTES_REPLACE4(PyThreadState *tstate, PyObject *bytes, PyObject *old, PyObject *new_value,\n                                PyObject *count);\nextern PyObject *BYTES_RFIND2(PyThreadState *tstate, PyObject *bytes, PyObject *sub);\nextern PyObject *BYTES_RFIND3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start);\nextern PyObject *BYTES_RFIND4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *BYTES_RINDEX2(PyThreadState *tstate, PyObject *bytes, PyObject *sub);\nextern PyObject *BYTES_RINDEX3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start);\nextern PyObject *BYTES_RINDEX4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end);\nextern PyObject *BYTES_RJUST2(PyThreadState *tstate, PyObject *bytes, PyObject *width);\nextern PyObject *BYTES_RJUST3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar);\nextern PyObject *BYTES_RPARTITION(PyThreadState *tstate, PyObject *bytes, PyObject *sep);\nextern PyObject *BYTES_RSPLIT1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_RSPLIT2(PyThreadState *tstate, PyObject *bytes, PyObject *sep);\nextern PyObject *BYTES_RSPLIT3(PyThreadState *tstate, PyObject *bytes, PyObject *sep, PyObject *maxsplit);\nextern PyObject *BYTES_RSTRIP1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_RSTRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars);\nextern PyObject *BYTES_SPLIT1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_SPLIT2(PyThreadState *tstate, PyObject *bytes, PyObject *sep);\nextern PyObject *BYTES_SPLIT3(PyThreadState *tstate, PyObject *bytes, PyObject *sep, PyObject *maxsplit);\nextern PyObject *BYTES_SPLITLINES1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_SPLITLINES2(PyThreadState *tstate, PyObject *bytes, PyObject *keepends);\nextern PyObject *BYTES_STARTSWITH2(PyThreadState *tstate, PyObject *bytes, PyObject *prefix);\nextern PyObject *BYTES_STARTSWITH3(PyThreadState *tstate, PyObject *bytes, PyObject *prefix, PyObject *start);\nextern PyObject *BYTES_STARTSWITH4(PyThreadState *tstate, PyObject *bytes, PyObject *prefix, PyObject *start,\n                                   PyObject *end);\nextern PyObject *BYTES_STRIP1(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_STRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars);\nextern PyObject *BYTES_SWAPCASE(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_TITLE(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_TRANSLATE2(PyThreadState *tstate, PyObject *bytes, PyObject *table);\nextern PyObject *BYTES_TRANSLATE3(PyThreadState *tstate, PyObject *bytes, PyObject *table, PyObject *delete_value);\nextern PyObject *BYTES_UPPER(PyThreadState *tstate, PyObject *bytes);\nextern PyObject *BYTES_ZFILL(PyThreadState *tstate, PyObject *bytes, PyObject *width);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_add.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"+\" (ADD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_ADD_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_ADD_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_ADD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_ADD_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_ADD_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_ADD_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_ADD_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_ADD_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_ADD_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_ADD_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool INPLACE_OPERATION_ADD_LONG_DIGIT(PyObject **operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_ADD_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_ADD_STR_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_STR_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern bool INPLACE_OPERATION_ADD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_UNICODE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern bool INPLACE_OPERATION_ADD_BYTES_BYTES(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_BYTES(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_ADD_TUPLE_TUPLE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_TUPLE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_ADD_LIST_LIST(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_LIST(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_LIST_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_ADD_UNICODE_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern bool INPLACE_OPERATION_ADD_STR_UNICODE(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_ADD_LIST_TUPLE(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_bitand.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"&\" (BITAND) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITAND_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITAND_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_BITAND_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITAND_SET_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_bitor.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"|\" (BITOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITOR_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITOR_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITOR_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITOR_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_BITOR_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITOR_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITOR_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITOR_SET_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITOR_OBJECT_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITOR_SET_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"^\" (BITXOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITXOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITXOR_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_BITXOR_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_BITXOR_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITXOR_SET_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nextern bool INPLACE_OPERATION_BITXOR_OBJECT_SET(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITXOR_SET_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_BITXOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"//\" (FLOORDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_FLOORDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_FLOORDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_FLOORDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_FLOORDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_FLOORDIV_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_FLOORDIV_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_FLOORDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_FLOORDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_lshift.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"<<\" (LSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_LSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_LSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_LSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_LSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_matmult.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"@\" (MATMULT) operations */\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MATMULT_LONG_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MATMULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MATMULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MATMULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MATMULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MATMULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MATMULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_mod.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"%\" (MOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_MOD_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_MOD_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_STR_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_STR_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_STR_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_MOD_STR_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern bool INPLACE_OPERATION_MOD_STR_UNICODE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_MOD_STR_TUPLE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_MOD_STR_LIST(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"DICT\" to Python 'dict'. */\nextern bool INPLACE_OPERATION_MOD_STR_DICT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_STR_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"BYTES\" to Python3 'bytes'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_BYTES(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_TUPLE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_LIST(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"DICT\" to Python 'dict'. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_DICT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_BYTES(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_UNICODE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_TUPLE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_LIST(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"DICT\" to Python 'dict'. */\nextern bool INPLACE_OPERATION_MOD_BYTES_DICT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MOD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_mult.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"*\" (MULT) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MULT_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_MULT_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_MULT_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_MULT_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_STR_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"STR\" to Python2 'str'. */\nextern bool INPLACE_OPERATION_MULT_INT_STR(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_UNICODE_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nextern bool INPLACE_OPERATION_MULT_INT_UNICODE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_TUPLE_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_MULT_INT_TUPLE(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_MULT_LIST_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_MULT_INT_LIST(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nextern bool INPLACE_OPERATION_MULT_UNICODE_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"UNICODE\" to Python2 'unicode', Python3\n * 'str'. */\nextern bool INPLACE_OPERATION_MULT_LONG_UNICODE(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_BYTES_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"BYTES\" to Python3 'bytes'. */\nextern bool INPLACE_OPERATION_MULT_LONG_BYTES(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_TUPLE_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"TUPLE\" to Python 'tuple'. */\nextern bool INPLACE_OPERATION_MULT_LONG_TUPLE(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_MULT_LIST_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LIST\" to Python 'list'. */\nextern bool INPLACE_OPERATION_MULT_LONG_LIST(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_STR_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_BYTES_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_LIST_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_MULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"/\" (OLDDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_OLDDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_LONG_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_OLDDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_OLDDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_OLDDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_OLDDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_OLDDIV_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_OLDDIV_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_OLDDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_OLDDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_pow.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"**\" (POW) operations */\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_POW_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_POW_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_POW_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_POW_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_POW_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_POW_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_POW_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_POW_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_POW_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_POW_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_POW_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_POW_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_POW_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_POW_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_POW_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_POW_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_rshift.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \">>\" (RSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_RSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_RSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_RSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_RSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_sub.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"-\" (SUB) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_SUB_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_SUB_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_SUB_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_SUB_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_SUB_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_SUB_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_SUB_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_SUB_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_SUB_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_SUB_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nextern bool INPLACE_OPERATION_SUB_LONG_DIGIT(PyObject **operand1, long operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_SUB_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_SUB_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/operations_inplace_truediv.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"/\" (TRUEDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_INT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_TRUEDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2);\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_LONG_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_TRUEDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2);\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_TRUEDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2);\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nextern bool INPLACE_OPERATION_TRUEDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_LONG_INT(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nextern bool INPLACE_OPERATION_TRUEDIV_INT_LONG(PyObject **operand1, PyObject *operand2);\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nextern bool INPLACE_OPERATION_TRUEDIV_INT_CLONG(PyObject **operand1, long operand2);\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nextern bool INPLACE_OPERATION_TRUEDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2);\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nextern bool INPLACE_OPERATION_TRUEDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2);\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/raising.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_RAISING_H__\n#define __NUITKA_HELPER_RAISING_H__\n\n#if PYTHON_VERSION >= 0x300\nNUITKA_MAY_BE_UNUSED static void CHAIN_EXCEPTION(PyThreadState *tstate, PyObject *exception_value) {\n    // Implicit chain of exception already existing.\n\n    // Normalize existing exception first.\n#if PYTHON_VERSION < 0x3b0\n    NORMALIZE_EXCEPTION(tstate, &EXC_TYPE(tstate), &EXC_VALUE(tstate), EXC_TRACEBACK_PTR(tstate));\n#endif\n\n    PyObject *old_exc_value = EXC_VALUE(tstate);\n\n    if (old_exc_value != NULL && old_exc_value != Py_None && old_exc_value != exception_value) {\n        PyObject *current = old_exc_value;\n        while (true) {\n            PyObject *context = PyException_GetContext(current);\n            if (context == NULL) {\n                break;\n            }\n\n            CHECK_OBJECT(context);\n            Py_DECREF(context);\n            CHECK_OBJECT(context);\n\n            if (context == exception_value) {\n                PyException_SetContext(current, NULL);\n                break;\n            }\n\n            current = context;\n        }\n\n        CHECK_OBJECT(old_exc_value);\n        Py_INCREF(old_exc_value);\n        PyException_SetContext(exception_value, old_exc_value);\n\n#if PYTHON_VERSION < 0x3b0\n        CHECK_OBJECT(EXC_TRACEBACK(tstate));\n        ATTACH_TRACEBACK_TO_EXCEPTION_VALUE(old_exc_value, (PyTracebackObject *)EXC_TRACEBACK(tstate));\n#endif\n    }\n}\n#endif\n\nextern void RAISE_EXCEPTION_WITH_TYPE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                      PyTracebackObject **exception_tb);\n\n#if PYTHON_VERSION >= 0x300\nextern void RAISE_EXCEPTION_WITH_CAUSE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                       PyTracebackObject **exception_tb, PyObject *exception_cause);\n#endif\n\nextern void RAISE_EXCEPTION_WITH_VALUE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                       PyTracebackObject **exception_tb);\n\nextern void RAISE_EXCEPTION_IMPLICIT(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                     PyTracebackObject **exception_tb);\n\nextern void RAISE_EXCEPTION_WITH_TRACEBACK(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                           PyTracebackObject **exception_tb);\n\nextern bool RERAISE_EXCEPTION(PyObject **exception_type, PyObject **exception_value, PyTracebackObject **exception_tb);\n\nextern void RAISE_CURRENT_EXCEPTION_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name,\n                                               PyObject **exception_type, PyObject **exception_value);\n\n#if PYTHON_VERSION < 0x340\nextern void RAISE_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name,\n                                                      PyObject **exception_type, PyObject **exception_value);\n#endif\n\nextern void RAISE_EXCEPTION_WITH_CAUSE_STATE(PyThreadState *tstate,\n                                             struct Nuitka_ExceptionPreservationItem *exception_state,\n                                             PyObject *exception_cause);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/rangeobjects.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_RANGEOBJECTS_H__\n#define __NUITKA_HELPER_RANGEOBJECTS_H__\n\n/* For built-in built-in range() functionality. */\n\nextern PyObject *BUILTIN_RANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, PyObject *step);\nextern PyObject *BUILTIN_RANGE2(PyThreadState *tstate, PyObject *low, PyObject *high);\nextern PyObject *BUILTIN_RANGE(PyThreadState *tstate, PyObject *boundary);\n\n/* For built-in built-in xrange() functionality. */\nextern PyObject *BUILTIN_XRANGE1(PyThreadState *tstate, PyObject *high);\nextern PyObject *BUILTIN_XRANGE2(PyThreadState *tstate, PyObject *low, PyObject *high);\nextern PyObject *BUILTIN_XRANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, PyObject *step);\n\n#if PYTHON_VERSION >= 0x300\n\n/* Python3 range objects */\nstruct _rangeobject3 {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *start;\n    PyObject *stop;\n    PyObject *step;\n    PyObject *length;\n};\n\nNUITKA_MAY_BE_UNUSED static PyObject *PyRange_Start(PyObject *range) { return ((struct _rangeobject3 *)range)->start; }\n\nNUITKA_MAY_BE_UNUSED static PyObject *PyRange_Stop(PyObject *range) { return ((struct _rangeobject3 *)range)->stop; }\n\nNUITKA_MAY_BE_UNUSED static PyObject *PyRange_Step(PyObject *range) { return ((struct _rangeobject3 *)range)->step; }\n\n#else\n\nstruct _rangeobject2 {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        long start;\n    long step;\n    long len;\n};\n\nextern PyObject *MAKE_XRANGE(PyThreadState *tstate, long start, long stop, long step);\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/richcomparisons.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_RICHCOMPARISONS_H__\n#define __NUITKA_HELPER_RICHCOMPARISONS_H__\n\n#include \"nuitka/helper/comparisons_eq.h\"\n#include \"nuitka/helper/comparisons_ge.h\"\n#include \"nuitka/helper/comparisons_gt.h\"\n#include \"nuitka/helper/comparisons_le.h\"\n#include \"nuitka/helper/comparisons_lt.h\"\n#include \"nuitka/helper/comparisons_ne.h\"\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/sequences.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_SEQUENCES_H__\n#define __NUITKA_HELPER_SEQUENCES_H__\n\n// TODO: Provide enhanced form of PySequence_Contains with less overhead as well.\n\nextern bool SEQUENCE_SET_ITEM(PyObject *sequence, Py_ssize_t index, PyObject *value);\n\nextern Py_ssize_t Nuitka_PyObject_Size(PyObject *sequence);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/sets.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_SETS_H__\n#define __NUITKA_SETS_H__\n\n// This is not Python headers before 3.10, but we use it in our assertions.\n#if PYTHON_VERSION < 0x3a0\n#define PySet_CheckExact(op) (Py_TYPE(op) == &PySet_Type)\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/slices.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_SLICES_H__\n#define __NUITKA_HELPER_SLICES_H__\n\n#if PYTHON_VERSION >= 0x3a0\nextern PyObject *Nuitka_Slice_New(PyObject *start, PyObject *stop, PyObject *step);\n#else\n#define Nuitka_Slice_New PySlice_New\n#endif\n\n// Note: Cannot these cannot fail, PySlice_New does not return errors.\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_SLICE_OBJECT3(PyObject *start, PyObject *stop, PyObject *step) {\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(stop);\n    CHECK_OBJECT(step);\n\n    return Nuitka_Slice_New(start, stop, step);\n}\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_SLICE_OBJECT2(PyObject *start, PyObject *stop) {\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(stop);\n\n    return Nuitka_Slice_New(start, stop, Py_None);\n}\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_SLICE_OBJECT1(PyObject *stop) {\n    CHECK_OBJECT(stop);\n\n    return Nuitka_Slice_New(Py_None, stop, Py_None);\n}\n\n#if PYTHON_VERSION < 0x300\n// Note: It appears that Python3 has no index slicing operations anymore, but\n// uses slice objects all the time. That's fine and make sure we adhere to it by\n// guarding the presence of the helpers.\n\nstatic inline bool IS_INDEXABLE(PyObject *value) {\n    return value == Py_None ||\n#if PYTHON_VERSION < 0x300\n           PyInt_Check(value) ||\n#endif\n           PyLong_Check(value) || Nuitka_Index_Check(value);\n}\n\nstatic Py_ssize_t CONVERT_TO_INDEX(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n    if (PyInt_Check(value)) {\n        return PyInt_AS_LONG(value);\n    } else if (Nuitka_Index_Check(value)) {\n        return PyNumber_AsSsize_t(value, NULL);\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"slice indices must be integers or None or have an __index__ method\");\n        return -1;\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_SLICE(PyThreadState *tstate, PyObject *source, PyObject *lower,\n                                                   PyObject *upper) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(lower);\n    CHECK_OBJECT(upper);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(source)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_slice && IS_INDEXABLE(lower) && IS_INDEXABLE(upper)) {\n        Py_ssize_t ilow = 0;\n\n        if (lower != Py_None) {\n            ilow = CONVERT_TO_INDEX(tstate, lower);\n\n            if (ilow == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return NULL;\n            }\n        }\n\n        Py_ssize_t ihigh = PY_SSIZE_T_MAX;\n\n        if (upper != Py_None) {\n            ihigh = CONVERT_TO_INDEX(tstate, upper);\n\n            if (ihigh == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return NULL;\n            }\n        }\n\n        PyObject *result = PySequence_GetSlice(source, ilow, ihigh);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        return result;\n    } else {\n        PyObject *slice = PySlice_New(lower, upper, NULL);\n\n        if (unlikely(slice == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = PyObject_GetItem(source, slice);\n        Py_DECREF(slice);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        return result;\n    }\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_INDEX_SLICE(PyObject *source, Py_ssize_t lower, Py_ssize_t upper) {\n    CHECK_OBJECT(source);\n\n    PyObject *result = PySequence_GetSlice(source, lower, upper);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static bool SET_SLICE(PyThreadState *tstate, PyObject *target, PyObject *lower, PyObject *upper,\n                                           PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(lower);\n    CHECK_OBJECT(upper);\n    CHECK_OBJECT(value);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(target)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_ass_slice && IS_INDEXABLE(lower) && IS_INDEXABLE(upper)) {\n        Py_ssize_t lower_int = 0;\n\n        if (lower != Py_None) {\n            lower_int = CONVERT_TO_INDEX(tstate, lower);\n\n            if (lower_int == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return false;\n            }\n        }\n\n        Py_ssize_t upper_int = PY_SSIZE_T_MAX;\n\n        if (upper != Py_None) {\n            upper_int = CONVERT_TO_INDEX(tstate, upper);\n\n            if (upper_int == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return false;\n            }\n        }\n\n        int status = PySequence_SetSlice(target, lower_int, upper_int, value);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    } else {\n        PyObject *slice = PySlice_New(lower, upper, NULL);\n\n        if (unlikely(slice == NULL)) {\n            return false;\n        }\n\n        int status = PyObject_SetItem(target, slice, value);\n        Py_DECREF(slice);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nNUITKA_MAY_BE_UNUSED static bool SET_INDEX_SLICE(PyObject *target, Py_ssize_t lower, Py_ssize_t upper,\n                                                 PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(value);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(target)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_ass_slice) {\n        int status = PySequence_SetSlice(target, lower, upper, value);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    } else {\n        PyObject *slice = _PySlice_FromIndices(lower, upper);\n\n        if (unlikely(slice == NULL)) {\n            return false;\n        }\n\n        int status = PyObject_SetItem(target, slice, value);\n\n        Py_DECREF(slice);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nNUITKA_MAY_BE_UNUSED static bool DEL_SLICE(PyThreadState *tstate, PyObject *target, PyObject *lower, PyObject *upper) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(lower);\n    CHECK_OBJECT(upper);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(target)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_ass_slice && IS_INDEXABLE(lower) && IS_INDEXABLE(upper)) {\n        Py_ssize_t lower_int = 0;\n\n        if (lower != Py_None) {\n            lower_int = CONVERT_TO_INDEX(tstate, lower);\n\n            if (lower_int == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return false;\n            }\n        }\n\n        Py_ssize_t upper_int = PY_SSIZE_T_MAX;\n\n        if (upper != Py_None) {\n            upper_int = CONVERT_TO_INDEX(tstate, upper);\n\n            if (upper_int == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return false;\n            }\n        }\n\n        int status = PySequence_DelSlice(target, lower_int, upper_int);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    } else {\n        PyObject *slice = PySlice_New(lower, upper, NULL);\n\n        if (unlikely(slice == NULL)) {\n            return false;\n        }\n\n        int status = PyObject_DelItem(target, slice);\n        Py_DECREF(slice);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nNUITKA_MAY_BE_UNUSED static bool DEL_INDEX_SLICE(PyObject *target, Py_ssize_t lower, Py_ssize_t upper) {\n    CHECK_OBJECT(target);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(target)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_ass_slice) {\n        int status = PySequence_DelSlice(target, lower, upper);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    } else {\n        PyObject *slice = _PySlice_FromIndices(lower, upper);\n\n        if (unlikely(slice == NULL)) {\n            return false;\n        }\n\n        int status = PyObject_DelItem(target, slice);\n\n        Py_DECREF(slice);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/strings.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_STRINGS_H__\n#define __NUITKA_STRINGS_H__\n\n#if PYTHON_VERSION < 0x300\nextern PyObject *STR_JOIN(PyThreadState *tstate, PyObject *str, PyObject *iterable);\n#endif\n\nextern PyObject *UNICODE_JOIN(PyThreadState *tstate, PyObject *str, PyObject *iterable);\nextern PyObject *UNICODE_PARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep);\nextern PyObject *UNICODE_RPARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep);\n\nextern PyObject *NuitkaUnicode_FromWideChar(wchar_t const *str, Py_ssize_t size);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/subscripts.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_SUBSCRIPTS_H__\n#define __NUITKA_HELPER_SUBSCRIPTS_H__\n\nextern PyObject *STRING_FROM_CHAR(unsigned char c);\n\n#if PYTHON_VERSION >= 0x3b0\nstatic void formatNotSubscriptableTypeError(PyObject *type) {\n    SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"type '%s' is not subscriptable\",\n                                        ((PyTypeObject *)type)->tp_name);\n}\n#endif\n\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT)\nstatic void formatNotSubscriptableError(PyObject *source) {\n    SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\n#if PYTHON_VERSION < 0x270\n        \"'%s' object is unsubscriptable\",\n#elif PYTHON_VERSION <= 0x272\n        \"'%s' object is not subscriptable\",\n#elif PYTHON_VERSION < 0x300\n        \"'%s' object has no attribute '__getitem__'\",\n#else\n        \"'%s' object is not subscriptable\",\n#endif\n        source);\n}\n#endif\n\n#if PYTHON_VERSION < 0x370\n#define HAS_SEQUENCE_ITEM_SLOT(type) (type->tp_as_sequence != NULL)\n#else\n#define HAS_SEQUENCE_ITEM_SLOT(type) (type->tp_as_sequence != NULL && type->tp_as_sequence->sq_item)\n#endif\n\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT)\nstatic PyObject *SEQUENCE_GET_ITEM_CONST(PyObject *sequence, Py_ssize_t int_subscript) {\n    PySequenceMethods *tp_as_sequence = Py_TYPE(sequence)->tp_as_sequence;\n    assert(tp_as_sequence != NULL);\n\n#if PYTHON_VERSION < 0x370\n    if (unlikely(tp_as_sequence->sq_item == NULL)) {\n        PyErr_Format(PyExc_TypeError, \"'%s' object does not support indexing\", Py_TYPE(sequence)->tp_name);\n        return NULL;\n    }\n#endif\n\n    if (int_subscript < 0) {\n        if (tp_as_sequence->sq_length) {\n            Py_ssize_t length = (*tp_as_sequence->sq_length)(sequence);\n            if (length < 0) {\n                return NULL;\n            }\n\n            int_subscript += length;\n        }\n    }\n\n    PyObject *res = tp_as_sequence->sq_item(sequence, int_subscript);\n    return res;\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_SUBSCRIPT_CONST(PyThreadState *tstate, PyObject *source,\n                                                             PyObject *const_subscript, Py_ssize_t int_subscript) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(const_subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    return PyObject_GetItem(source, const_subscript);\n#else\n    PyTypeObject *type = Py_TYPE(source);\n    PyMappingMethods *tp_as_mapping = type->tp_as_mapping;\n\n    PyObject *result;\n\n    if (tp_as_mapping && tp_as_mapping->mp_subscript) {\n        if (PyList_CheckExact(source)) {\n            Py_ssize_t list_size = PyList_GET_SIZE(source);\n\n            if (int_subscript < 0) {\n                if (-int_subscript > list_size) {\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_IndexError, \"list index out of range\");\n                    return NULL;\n                }\n\n                int_subscript += list_size;\n            } else {\n                if (int_subscript >= list_size) {\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_IndexError, \"list index out of range\");\n                    return NULL;\n                }\n            }\n\n            result = ((PyListObject *)source)->ob_item[int_subscript];\n\n            Py_INCREF(result);\n            return result;\n        }\n#if PYTHON_VERSION < 0x300\n        else if (PyString_CheckExact(source)) {\n            Py_ssize_t string_size = PyString_GET_SIZE(source);\n\n            if (int_subscript < 0) {\n                if (-int_subscript > string_size) {\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_IndexError, \"string index out of range\");\n                    return NULL;\n                }\n\n                int_subscript += string_size;\n            } else {\n                if (int_subscript >= string_size) {\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_IndexError, \"string index out of range\");\n                    return NULL;\n                }\n            }\n\n            unsigned char c = ((PyStringObject *)source)->ob_sval[int_subscript];\n            return STRING_FROM_CHAR(c);\n        }\n#else\n        else if (PyUnicode_CheckExact(source)) {\n            if (int_subscript < 0) {\n                int_subscript += PyUnicode_GET_LENGTH(source);\n            }\n\n            result = type->tp_as_sequence->sq_item(source, int_subscript);\n        }\n#endif\n        else {\n            result = tp_as_mapping->mp_subscript(source, const_subscript);\n        }\n    } else if (HAS_SEQUENCE_ITEM_SLOT(type)) {\n        result = SEQUENCE_GET_ITEM_CONST(source, int_subscript);\n    } else {\n#if PYTHON_VERSION >= 0x370\n        if (PyType_Check(source)) {\n#if PYTHON_VERSION >= 0x390\n            if (source == (PyObject *)&PyType_Type) {\n                PyObject *subscript = PyLong_FromSsize_t(int_subscript);\n                result = Py_GenericAlias(source, subscript);\n                Py_DECREF(subscript);\n\n                return result;\n            }\n#endif\n\n            PyObject *meth = LOOKUP_ATTRIBUTE(tstate, source, const_str_plain___class_getitem__);\n\n            if (meth) {\n                PyObject *subscript = PyLong_FromSsize_t(int_subscript);\n                result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, meth, subscript);\n                Py_DECREF(meth);\n                Py_DECREF(subscript);\n\n                return result;\n            }\n\n            // Different error against types for Python3.11+\n#if PYTHON_VERSION >= 0x3b0\n            formatNotSubscriptableTypeError(source);\n            return NULL;\n#endif\n        }\n#endif\n\n        formatNotSubscriptableError(source);\n        return NULL;\n    }\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_SUBSCRIPT(PyThreadState *tstate, PyObject *source, PyObject *subscript) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    return PyObject_GetItem(source, subscript);\n#else\n    PyTypeObject *type = Py_TYPE(source);\n    PyMappingMethods *tp_as_mapping = type->tp_as_mapping;\n\n    if (tp_as_mapping != NULL && tp_as_mapping->mp_subscript != NULL) {\n        return tp_as_mapping->mp_subscript(source, subscript);\n    } else if (HAS_SEQUENCE_ITEM_SLOT(type)) {\n        if (Nuitka_Index_Check(subscript)) {\n            Py_ssize_t index = PyNumber_AsSsize_t(subscript, NULL);\n\n            if (index == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return NULL;\n            }\n\n            return SEQUENCE_GET_ITEM_CONST(source, index);\n        } else if (type->tp_as_sequence->sq_item) {\n            PyErr_Format(PyExc_TypeError, \"sequence index must be integer, not '%s'\", Py_TYPE(subscript)->tp_name);\n            return NULL;\n#if PYTHON_VERSION < 0x370\n        } else {\n            formatNotSubscriptableError(source);\n            return NULL;\n#endif\n        }\n    }\n\n#if PYTHON_VERSION >= 0x370\n    if (PyType_Check(source)) {\n#if PYTHON_VERSION >= 0x390\n        if (source == (PyObject *)&PyType_Type) {\n            return Py_GenericAlias(source, subscript);\n        }\n#endif\n\n        PyObject *meth = LOOKUP_ATTRIBUTE(tstate, source, const_str_plain___class_getitem__);\n\n        if (meth) {\n            PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, meth, subscript);\n            Py_DECREF(meth);\n            return result;\n        }\n\n        // Different error against types for Python3.11+\n#if PYTHON_VERSION >= 0x3b0\n        formatNotSubscriptableTypeError(source);\n        return NULL;\n#endif\n    }\n#endif\n\n    formatNotSubscriptableError(source);\n    return NULL;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static bool HAS_SUBSCRIPT_CONST(PyThreadState *tstate, PyObject *source, PyObject *const_subscript,\n                                                     Py_ssize_t int_subscript) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(const_subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    PyObject *item = PyObject_GetItem(source, const_subscript);\n\n    if (item) {\n        Py_DECREF(item);\n        return true;\n    } else {\n        return false;\n    }\n#else\n    PyTypeObject *type = Py_TYPE(source);\n    PyMappingMethods *tp_as_mapping = type->tp_as_mapping;\n\n    if (tp_as_mapping && tp_as_mapping->mp_subscript) {\n        if (PyList_CheckExact(source)) {\n            Py_ssize_t list_size = PyList_GET_SIZE(source);\n\n            if (int_subscript < 0) {\n                if (-int_subscript > list_size) {\n                    return false;\n                }\n\n                int_subscript += list_size;\n            } else {\n                if (int_subscript >= list_size) {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n#if PYTHON_VERSION < 0x300\n        else if (PyString_CheckExact(source)) {\n            Py_ssize_t string_size = PyString_GET_SIZE(source);\n\n            if (int_subscript < 0) {\n                if (-int_subscript > string_size) {\n                    return false;\n                }\n\n                int_subscript += string_size;\n            } else {\n                if (int_subscript >= string_size) {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n#else\n        else if (PyUnicode_CheckExact(source)) {\n            if (int_subscript < 0) {\n                int_subscript += PyUnicode_GET_LENGTH(source);\n            }\n\n            PyObject *result = type->tp_as_sequence->sq_item(source, int_subscript);\n\n            bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n            Py_XDECREF(result);\n            return bool_result;\n        }\n#endif\n        else {\n            PyObject *result = tp_as_mapping->mp_subscript(source, const_subscript);\n\n            bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n            Py_XDECREF(result);\n\n            return bool_result;\n        }\n    } else if (type->tp_as_sequence) {\n        PyObject *result = SEQUENCE_GET_ITEM_CONST(source, int_subscript);\n\n        bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n        Py_XDECREF(result);\n        return bool_result;\n    } else {\n#if PYTHON_VERSION >= 0x370\n        if (PyType_Check(source)) {\n#if PYTHON_VERSION >= 0x390\n            if (source == (PyObject *)&PyType_Type) {\n                return true;\n            }\n#endif\n\n            PyObject *meth = LOOKUP_ATTRIBUTE(tstate, source, const_str_plain___class_getitem__);\n\n            if (meth) {\n                PyObject *subscript = PyLong_FromSsize_t(int_subscript);\n                PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, meth, subscript);\n                Py_DECREF(meth);\n                Py_DECREF(subscript);\n\n                bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n                Py_XDECREF(result);\n                return bool_result;\n            }\n        }\n#endif\n\n        return false;\n    }\n\n    return false;\n\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static bool HAS_SUBSCRIPT(PyThreadState *tstate, PyObject *source, PyObject *subscript) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    PyObject *item = PyObject_GetItem(source, subscript);\n\n    if (item) {\n        Py_DECREF(item);\n        return true;\n    } else {\n        return false;\n    }\n#else\n    PyTypeObject *type = Py_TYPE(source);\n    PyMappingMethods *tp_as_mapping = type->tp_as_mapping;\n\n    if (tp_as_mapping != NULL && tp_as_mapping->mp_subscript != NULL) {\n        PyObject *result = tp_as_mapping->mp_subscript(source, subscript);\n        bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n        Py_XDECREF(result);\n        return bool_result;\n    } else if (type->tp_as_sequence != NULL) {\n        if (Nuitka_Index_Check(subscript)) {\n            Py_ssize_t index = PyNumber_AsSsize_t(subscript, NULL);\n\n            if (index == -1 && HAS_ERROR_OCCURRED(tstate)) {\n                return false;\n            }\n\n            PyObject *result = SEQUENCE_GET_ITEM_CONST(source, index);\n            bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n            Py_XDECREF(result);\n            return bool_result;\n        } else if (type->tp_as_sequence->sq_item) {\n            return false;\n#if PYTHON_VERSION < 0x370\n        } else {\n            return false;\n#endif\n        }\n    }\n\n#if PYTHON_VERSION >= 0x370\n    if (PyType_Check(source)) {\n#if PYTHON_VERSION >= 0x390\n        if (source == (PyObject *)&PyType_Type) {\n            return true;\n        }\n#endif\n        PyObject *meth = LOOKUP_ATTRIBUTE(tstate, source, const_str_plain___class_getitem__);\n\n        if (meth) {\n            PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, meth, subscript);\n            bool bool_result = !DROP_ERROR_OCCURRED(tstate);\n\n            Py_XDECREF(result);\n            return bool_result;\n        }\n    }\n#endif\n\n    return false;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static bool SET_SUBSCRIPT_CONST(PyThreadState *tstate, PyObject *target, PyObject *subscript,\n                                                     Py_ssize_t int_subscript, PyObject *value) {\n    CHECK_OBJECT(value);\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    int res = PyObject_SetItem(target, subscript, value);\n    return res == 0;\n#else\n    PyMappingMethods *tp_as_mapping = Py_TYPE(target)->tp_as_mapping;\n\n    if (tp_as_mapping != NULL && tp_as_mapping->mp_ass_subscript) {\n        if (PyList_CheckExact(target)) {\n            Py_ssize_t list_size = PyList_GET_SIZE(target);\n\n            if (int_subscript < 0) {\n                if (-int_subscript > list_size) {\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_IndexError, \"list assignment index out of range\");\n\n                    return false;\n                }\n\n                int_subscript += list_size;\n            }\n\n            PyListObject *target_list = (PyListObject *)target;\n\n            PyObject *old_value = target_list->ob_item[int_subscript];\n            Py_INCREF(value);\n            target_list->ob_item[int_subscript] = value;\n            Py_DECREF(old_value);\n\n            return true;\n        } else {\n            int res = tp_as_mapping->mp_ass_subscript(target, subscript, value);\n\n            if (unlikely(res == -1)) {\n                return false;\n            }\n\n            return true;\n        }\n    } else if (Py_TYPE(target)->tp_as_sequence) {\n        if (Nuitka_Index_Check(subscript)) {\n            Py_ssize_t key_value = PyNumber_AsSsize_t(subscript, PyExc_IndexError);\n\n            if (key_value == -1) {\n                if (HAS_ERROR_OCCURRED(tstate)) {\n                    return false;\n                }\n            }\n\n            return SEQUENCE_SET_ITEM(target, key_value, value);\n        } else if (Py_TYPE(target)->tp_as_sequence->sq_ass_item) {\n            PyErr_Format(PyExc_TypeError, \"sequence index must be integer, not '%s'\", Py_TYPE(subscript)->tp_name);\n\n            return false;\n        } else {\n            PyErr_Format(PyExc_TypeError, \"'%s' object does not support item assignment\", Py_TYPE(target)->tp_name);\n\n            return false;\n        }\n    } else {\n        PyErr_Format(PyExc_TypeError, \"'%s' object does not support item assignment\", Py_TYPE(target)->tp_name);\n\n        return false;\n    }\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static bool SET_SUBSCRIPT(PyThreadState *tstate, PyObject *target, PyObject *subscript,\n                                               PyObject *value) {\n    CHECK_OBJECT(value);\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(subscript);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_SUBSCRIPT_OPT\n    int res = PyObject_SetItem(target, subscript, value);\n    return res == 0;\n#else\n    PyMappingMethods *tp_as_mapping = Py_TYPE(target)->tp_as_mapping;\n\n    if (tp_as_mapping != NULL && tp_as_mapping->mp_ass_subscript) {\n        int res = tp_as_mapping->mp_ass_subscript(target, subscript, value);\n\n        if (unlikely(res == -1)) {\n            return false;\n        }\n    } else if (Py_TYPE(target)->tp_as_sequence) {\n        if (Nuitka_Index_Check(subscript)) {\n            Py_ssize_t key_value = PyNumber_AsSsize_t(subscript, PyExc_IndexError);\n\n            if (key_value == -1) {\n                if (HAS_ERROR_OCCURRED(tstate)) {\n                    return false;\n                }\n            }\n\n            return SEQUENCE_SET_ITEM(target, key_value, value);\n        } else if (Py_TYPE(target)->tp_as_sequence->sq_ass_item) {\n            PyErr_Format(PyExc_TypeError, \"sequence index must be integer, not '%s'\", Py_TYPE(subscript)->tp_name);\n\n            return false;\n        } else {\n            PyErr_Format(PyExc_TypeError, \"'%s' object does not support item assignment\", Py_TYPE(target)->tp_name);\n\n            return false;\n        }\n    } else {\n        PyErr_Format(PyExc_TypeError, \"'%s' object does not support item assignment\", Py_TYPE(target)->tp_name);\n\n        return false;\n    }\n\n    return true;\n#endif\n}\n\nNUITKA_MAY_BE_UNUSED static bool DEL_SUBSCRIPT(PyObject *target, PyObject *subscript) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(subscript);\n\n    int status = PyObject_DelItem(target, subscript);\n\n    if (unlikely(status == -1)) {\n        return false;\n    }\n\n    return true;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helper/tuples.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPER_TUPLES_H__\n#define __NUITKA_HELPER_TUPLES_H__\n\n// Like PyTuple_SET_ITEM but takes a reference to the item.\n#define PyTuple_SET_ITEM0(tuple, index, value)                                                                         \\\n    {                                                                                                                  \\\n        PyObject *tmp = value;                                                                                         \\\n        Py_INCREF(tmp);                                                                                                \\\n        PyTuple_SET_ITEM(tuple, index, tmp);                                                                           \\\n    }\n\n#if PYTHON_VERSION >= 0x3a0\n#define NUITKA_TUPLE_HAS_FREELIST 1\nextern PyObject *MAKE_TUPLE_EMPTY(Py_ssize_t size);\nextern PyObject *MAKE_TUPLE_EMPTY_VAR(Py_ssize_t size);\n#else\n#define NUITKA_TUPLE_HAS_FREELIST 0\n\n#define MAKE_TUPLE_EMPTY(size) PyTuple_New(size)\n#define MAKE_TUPLE_EMPTY_VAR(size) PyTuple_New(size)\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE(PyObject *const *elements, Py_ssize_t size) {\n    PyObject *result = MAKE_TUPLE_EMPTY(size);\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyTuple_SET_ITEM0(result, i, elements[i]);\n    }\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE1(PyObject *element1) {\n    PyObject *result = MAKE_TUPLE_EMPTY(1);\n\n    PyTuple_SET_ITEM0(result, 0, element1);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE1_0(PyObject *element1) {\n    PyObject *result = MAKE_TUPLE_EMPTY(1);\n\n    PyTuple_SET_ITEM(result, 0, element1);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE2(PyObject *element1, PyObject *element2) {\n    PyObject *result = MAKE_TUPLE_EMPTY(2);\n\n    PyTuple_SET_ITEM0(result, 0, element1);\n    PyTuple_SET_ITEM0(result, 1, element2);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE2_0(PyObject *element1, PyObject *element2) {\n    PyObject *result = MAKE_TUPLE_EMPTY(2);\n\n    PyTuple_SET_ITEM(result, 0, element1);\n    PyTuple_SET_ITEM(result, 1, element2);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE3(PyObject *element1, PyObject *element2, PyObject *element3) {\n    PyObject *result = MAKE_TUPLE_EMPTY(3);\n\n    PyTuple_SET_ITEM0(result, 0, element1);\n    PyTuple_SET_ITEM0(result, 1, element2);\n    PyTuple_SET_ITEM0(result, 2, element3);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE3_0(PyObject *element1, PyObject *element2, PyObject *element3) {\n    PyObject *result = MAKE_TUPLE_EMPTY(3);\n\n    PyTuple_SET_ITEM(result, 0, element1);\n    PyTuple_SET_ITEM(result, 1, element2);\n    PyTuple_SET_ITEM(result, 2, element3);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE4(PyObject *element1, PyObject *element2, PyObject *element3,\n                                                  PyObject *element4) {\n    PyObject *result = MAKE_TUPLE_EMPTY(4);\n\n    PyTuple_SET_ITEM0(result, 0, element1);\n    PyTuple_SET_ITEM0(result, 1, element2);\n    PyTuple_SET_ITEM0(result, 2, element3);\n    PyTuple_SET_ITEM0(result, 3, element4);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE4_0(PyObject *element1, PyObject *element2, PyObject *element3,\n                                                    PyObject *element4) {\n    PyObject *result = MAKE_TUPLE_EMPTY(4);\n\n    PyTuple_SET_ITEM(result, 0, element1);\n    PyTuple_SET_ITEM(result, 1, element2);\n    PyTuple_SET_ITEM(result, 2, element3);\n    PyTuple_SET_ITEM(result, 3, element4);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE5(PyObject *element1, PyObject *element2, PyObject *element3,\n                                                  PyObject *element4, PyObject *element5) {\n    PyObject *result = MAKE_TUPLE_EMPTY(5);\n\n    PyTuple_SET_ITEM0(result, 0, element1);\n    PyTuple_SET_ITEM0(result, 1, element2);\n    PyTuple_SET_ITEM0(result, 2, element3);\n    PyTuple_SET_ITEM0(result, 3, element4);\n    PyTuple_SET_ITEM0(result, 4, element5);\n\n    return result;\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE5_0(PyObject *element1, PyObject *element2, PyObject *element3,\n                                                    PyObject *element4, PyObject *element5) {\n    PyObject *result = MAKE_TUPLE_EMPTY(5);\n\n    PyTuple_SET_ITEM(result, 0, element1);\n    PyTuple_SET_ITEM(result, 1, element2);\n    PyTuple_SET_ITEM(result, 2, element3);\n    PyTuple_SET_ITEM(result, 3, element4);\n    PyTuple_SET_ITEM(result, 4, element5);\n\n    return result;\n}\n\n// Make this new macro available for older Python too.\n#ifndef _PyTuple_ITEMS\n#define _PyTuple_ITEMS(op) (((PyTupleObject *)(op))->ob_item)\n#endif\n\nextern PyObject *TUPLE_CONCAT(PyObject *tuple1, PyObject *tuple2);\n\nextern PyObject *TUPLE_COPY(PyObject *tuple);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/helpers.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_HELPERS_H__\n#define __NUITKA_HELPERS_H__\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_FRAME\n#define _DEBUG_FRAME 1\n#else\n#define _DEBUG_FRAME 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_REFRAME\n#define _DEBUG_REFRAME 1\n#else\n#define _DEBUG_REFRAME 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_EXCEPTIONS\n#define _DEBUG_EXCEPTIONS 1\n#else\n#define _DEBUG_EXCEPTIONS 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_GENERATOR\n#define _DEBUG_GENERATOR 1\n#else\n#define _DEBUG_GENERATOR 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_COROUTINE\n#define _DEBUG_COROUTINE 1\n#else\n#define _DEBUG_COROUTINE 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ASYNCGEN\n#define _DEBUG_ASYNCGEN 1\n#else\n#define _DEBUG_ASYNCGEN 0\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CLASSES\n#define _DEBUG_CLASSES 1\n#else\n#define _DEBUG_CLASSES 0\n#endif\n\n#ifdef _NUITKA_EXPERIMENTAL_REPORT_REFCOUNTS\n#define _DEBUG_REFCOUNTS 1\n#else\n#define _DEBUG_REFCOUNTS 0\n#endif\n\n// From CPython, to allow us quick access to the dictionary of an module, the\n// structure is normally private, but we need it for quick access to the module\n// dictionary.\n#if PYTHON_VERSION < 0x3c0\ntypedef struct {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *md_dict;\n} PyModuleObject;\n#endif\n\n// Generated code helpers, used in static helper codes:\nextern PyObject *CALL_FUNCTION_WITH_ARGS2(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS4(PyThreadState *tstate, PyObject *called, PyObject *const *args);\nextern PyObject *CALL_FUNCTION_WITH_ARGS5(PyThreadState *tstate, PyObject *called, PyObject *const *args);\n\n// For use with \"--trace-execution\", code can make outputs. Otherwise they\n// are just like comments.\n#include \"nuitka/tracing.h\"\n\n// For checking values if they changed or not.\n#ifndef __NUITKA_NO_ASSERT__\nextern Py_hash_t DEEP_HASH(PyThreadState *tstate, PyObject *value);\n#endif\n\n// For profiling of Nuitka compiled binaries\n#if _NUITKA_PROFILE\nextern void startProfiling(void);\nextern void stopProfiling(void);\n#endif\n\n#include \"nuitka/helper/boolean.h\"\n#include \"nuitka/helper/dictionaries.h\"\n#include \"nuitka/helper/indexes.h\"\n#include \"nuitka/helper/mappings.h\"\n#include \"nuitka/helper/operations_builtin_types.h\"\n#include \"nuitka/helper/sets.h\"\n#include \"nuitka/helper/strings.h\"\n\n#include \"nuitka/helper/raising.h\"\n\n#include \"nuitka/helper/richcomparisons.h\"\n#include \"nuitka/helper/sequences.h\"\n\nstatic inline bool Nuitka_Function_Check(PyObject *object);\nstatic inline PyObject *Nuitka_Function_GetName(PyObject *object);\n\nstatic inline bool Nuitka_Generator_Check(PyObject *object);\nstatic inline PyObject *Nuitka_Generator_GetName(PyObject *object);\n\n#include \"nuitka/calling.h\"\n#include \"nuitka/helper/bytes.h\"\n#include \"nuitka/helper/complex.h\"\n#include \"nuitka/helper/floats.h\"\n#include \"nuitka/helper/ints.h\"\n\nNUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_VARS(PyThreadState *tstate, PyObject *source) {\n    CHECK_OBJECT(source);\n\n    PyObject *result = PyObject_GetAttr(source, const_str_plain___dict__);\n\n    if (unlikely(result == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"vars() argument must have __dict__ attribute\");\n\n        return NULL;\n    }\n\n    return result;\n}\n\n#include \"nuitka/helper/attributes.h\"\n#include \"nuitka/helper/bytearrays.h\"\n#include \"nuitka/helper/iterators.h\"\n#include \"nuitka/helper/lists.h\"\n#include \"nuitka/helper/rangeobjects.h\"\n#include \"nuitka/helper/slices.h\"\n#include \"nuitka/helper/subscripts.h\"\n#include \"nuitka/helper/tuples.h\"\n\n#include \"nuitka/builtins.h\"\n\n#include \"helper/operations.h\"\n\n// Compile source code given, pretending the file name was given.\n#if PYTHON_VERSION < 0x300\nextern PyObject *COMPILE_CODE(PyThreadState *tstate, PyObject *source_code, PyObject *file_name, PyObject *mode,\n                              PyObject *flags, PyObject *dont_inherit);\n#else\nextern PyObject *COMPILE_CODE(PyThreadState *tstate, PyObject *source_code, PyObject *file_name, PyObject *mode,\n                              PyObject *flags, PyObject *dont_inherit, PyObject *optimize);\n#endif\n\n#if PYTHON_VERSION < 0x300\nextern bool EXEC_FILE_ARG_HANDLING(PyThreadState *tstate, PyObject **prog, PyObject **name);\n#endif\n\n// For quicker built-in str() functionality, Python2 str\nextern PyObject *BUILTIN_STR(PyObject *value);\n\n// For quicker built-in unicode() functionality, Python3 str or Python2 unicode\nextern PyObject *BUILTIN_UNICODE1(PyObject *value);\nextern PyObject *BUILTIN_UNICODE3(PyObject *value, PyObject *encoding, PyObject *errors);\n\n// For quicker built-in open() functionality.\n#if PYTHON_VERSION < 0x300\nextern PyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObject *mode, PyObject *buffering);\n#else\nextern PyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObject *mode, PyObject *buffering,\n                              PyObject *encoding, PyObject *errors, PyObject *newline, PyObject *closefd,\n                              PyObject *opener);\n#endif\n\n// Small helper to open files with few arguments in C.\nextern PyObject *BUILTIN_OPEN_BINARY_READ_SIMPLE(PyThreadState *tstate, PyObject *filename);\nextern PyObject *BUILTIN_OPEN_SIMPLE(PyThreadState *tstate, PyObject *filename, char const *mode, bool buffering,\n                                     PyObject *encoding);\n\n// Small helper to read file contents with few arguments in C.\nextern PyObject *GET_FILE_BYTES(PyThreadState *tstate, PyObject *filename);\n\n// Small helpers to check file attributes\nextern PyObject *OS_PATH_FILE_EXISTS(PyThreadState *tstate, PyObject *filename);\nextern PyObject *OS_PATH_FILE_ISFILE(PyThreadState *tstate, PyObject *filename);\nextern PyObject *OS_PATH_FILE_ISDIR(PyThreadState *tstate, PyObject *filename);\n\n// Small helper to list a directory.\nextern PyObject *OS_LISTDIR(PyThreadState *tstate, PyObject *path);\n\n// Platform standard slash for filenames\n#if defined(_WIN32)\n#define const_platform_sep const_str_backslash\n#else\n#define const_platform_sep const_str_slash\n#endif\n\n// Small helpers to work with filenames from \"os.path\" module\nextern PyObject *OS_PATH_BASENAME(PyThreadState *tstate, PyObject *filename);\nextern PyObject *OS_PATH_DIRNAME(PyThreadState *tstate, PyObject *filename);\nextern PyObject *OS_PATH_ABSPATH(PyThreadState *tstate, PyObject *filename);\nextern PyObject *OS_PATH_ISABS(PyThreadState *tstate, PyObject *filename);\n\n// Compare two paths if they are the same.\nnuitka_bool compareFilePaths(PyThreadState *tstate, PyObject *filename_a, PyObject *filename_b);\n\n// For quicker built-in chr() functionality.\nextern PyObject *BUILTIN_CHR(PyThreadState *tstate, PyObject *value);\n\n// For quicker built-in ord() functionality.\nextern PyObject *BUILTIN_ORD(PyObject *value);\n\n// For quicker built-in bin() functionality.\nextern PyObject *BUILTIN_BIN(PyObject *value);\n\n// For quicker built-in oct() functionality.\nextern PyObject *BUILTIN_OCT(PyThreadState *tstate, PyObject *value);\n\n// For quicker built-in hex() functionality.\nextern PyObject *BUILTIN_HEX(PyThreadState *tstate, PyObject *value);\n\n// For quicker callable() functionality.\nextern PyObject *BUILTIN_CALLABLE(PyObject *value);\n\n// For quicker iter() functionality if 2 arguments arg given.\nextern PyObject *BUILTIN_ITER2(PyObject *callable, PyObject *sentinel);\n\n// For quicker type() functionality if 1 argument is given.\nextern PyObject *BUILTIN_TYPE1(PyObject *arg);\n\n// For quicker type() functionality if 3 arguments are given (to build a new\n// type).\nextern PyObject *BUILTIN_TYPE3(PyThreadState *tstate, PyObject *module_name, PyObject *name, PyObject *bases,\n                               PyObject *dict);\n\n// For built-in built-in len() functionality.\nextern PyObject *BUILTIN_LEN(PyThreadState *tstate, PyObject *boundary);\n\n// For built-in built-in any() functionality.\nextern PyObject *BUILTIN_ANY(PyThreadState *tstate, PyObject *value);\n\n// For built-in built-in super() no args and 2 user args functionality.\nextern PyObject *BUILTIN_SUPER2(PyThreadState *tstate, PyDictObject *module_dict, PyObject *type, PyObject *object);\nextern PyObject *BUILTIN_SUPER0(PyThreadState *tstate, PyDictObject *module_dict, PyObject *type, PyObject *object);\n\n// For built-in built-in all() functionality.\nextern PyObject *BUILTIN_ALL(PyThreadState *tstate, PyObject *value);\n\n// For built-in getattr() functionality.\nextern PyObject *BUILTIN_GETATTR(PyThreadState *tstate, PyObject *object, PyObject *attribute, PyObject *default_value);\n\n// For built-in setattr() functionality.\nextern PyObject *BUILTIN_SETATTR(PyObject *object, PyObject *attribute, PyObject *value);\n\n// For built-in bytearray() functionality.\nextern PyObject *BUILTIN_BYTEARRAY1(PyObject *value);\nextern PyObject *BUILTIN_BYTEARRAY3(PyThreadState *tstate, PyObject *string, PyObject *encoding, PyObject *errors);\n\n// For built-in hash() functionality.\nextern PyObject *BUILTIN_HASH(PyThreadState *tstate, PyObject *value);\nextern Py_hash_t HASH_VALUE_WITHOUT_ERROR(PyThreadState *tstate, PyObject *value);\nextern Py_hash_t HASH_VALUE_WITH_ERROR(PyThreadState *tstate, PyObject *value);\n\n// For built-in sum() functionality.\nextern PyObject *BUILTIN_SUM1(PyThreadState *tstate, PyObject *sequence);\nextern PyObject *BUILTIN_SUM2(PyThreadState *tstate, PyObject *sequence, PyObject *start);\n\n// For built-in built-in abs() functionality.\nextern PyObject *BUILTIN_ABS(PyObject *o);\n\n// For built-in bytes() functionality.\n#if PYTHON_VERSION >= 0x300\nextern PyObject *BUILTIN_BYTES1(PyThreadState *tstate, PyObject *value);\nextern PyObject *BUILTIN_BYTES3(PyThreadState *tstate, PyObject *value, PyObject *encoding, PyObject *errors);\n#endif\n\n// For built-in eval() functionality, works on byte compiled code already.\nextern PyObject *EVAL_CODE(PyThreadState *tstate, PyObject *code, PyObject *globals, PyObject *locals,\n                           PyObject *closure);\n\n// For built-in format() functionality.\nextern PyObject *BUILTIN_FORMAT(PyThreadState *tstate, PyObject *value, PyObject *format_spec);\n\n// For built-in staticmethod() functionality.\nextern PyObject *BUILTIN_STATICMETHOD(PyThreadState *tstate, PyObject *function);\n\n// For built-in classmethod() functionality.\nextern PyObject *BUILTIN_CLASSMETHOD(PyThreadState *tstate, PyObject *function);\n\n// For built-in input() functionality, prompt can be NULL.\nextern PyObject *BUILTIN_INPUT(PyThreadState *tstate, PyObject *prompt);\n\n// For built-in \"int()\" functionality with 2 arguments.\nextern PyObject *BUILTIN_INT2(PyThreadState *tstate, PyObject *value, PyObject *base);\n\n#if PYTHON_VERSION < 0x300\n// For built-in \"long()\" functionality with 2 arguments.\nextern PyObject *BUILTIN_LONG2(PyThreadState *tstate, PyObject *value, PyObject *base);\n#endif\n\n#include \"nuitka/importing.h\"\n\n// Hard imports have their own helpers.\n#include \"nuitka/helper/import_hard.h\"\n\n// For the constant loading:\n\n// Call this to initialize all common constants pre-main.\nextern void createGlobalConstants(PyThreadState *tstate);\n\n// Call this to check of common constants are still intact.\n#ifndef __NUITKA_NO_ASSERT__\nextern void checkGlobalConstants(void);\n#ifdef _NUITKA_EXE\nextern void checkModuleConstants___main__(PyThreadState *tstate);\n#endif\n#endif\n\n// Call this to initialize \"__main__\" constants in non-standard processes.\n#ifdef _NUITKA_EXE\nextern void createMainModuleConstants(PyThreadState *tstate);\n#endif\n\n// Deserialize constants from a blob.\n#include \"nuitka/constants_blob.h\"\n\n// Performance enhancements to Python types.\nextern void enhancePythonTypes(void);\n\n// Setup meta path based loader if any.\nextern void setupMetaPathBasedLoader(PyThreadState *tstate);\n\n/* Replace inspect functions with ones that handle compiles types too. */\n#if PYTHON_VERSION >= 0x300\nextern void patchInspectModule(PyThreadState *tstate);\n#endif\n\n// Replace type comparison with one that accepts compiled types too, will work\n// for \"==\" and \"!=\", but not for \"is\" checks.\nextern void patchTypeComparison(void);\n\n// Patch the CPython type for tracebacks and make it use a free list mechanism\n// to be slightly faster for exception control flows.\nextern void patchTracebackDealloc(void);\n\n// Initialize value for \"tp_compare\" and \"tp_init\" defaults.\nextern void _initSlotCompare(void);\n\n// Default __init__ slot wrapper.\nextern python_initproc default_tp_init_wrapper;\n\n#if PYTHON_VERSION >= 0x300\n// Select the metaclass from specified one and given bases.\nextern PyObject *SELECT_METACLASS(PyThreadState *tstate, PyObject *metaclass, PyObject *bases);\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\nextern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, Py_ssize_t max_allowed);\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyObject *MODULE_NAME1(PyThreadState *tstate, PyObject *module) {\n    assert(PyModule_Check(module));\n    PyObject *module_dict = ((PyModuleObject *)module)->md_dict;\n\n    return DICT_GET_ITEM1(tstate, module_dict, const_str_plain___name__);\n}\n\nNUITKA_MAY_BE_UNUSED static PyObject *MODULE_NAME0(PyThreadState *tstate, PyObject *module) {\n    assert(PyModule_Check(module));\n    PyObject *module_dict = ((PyModuleObject *)module)->md_dict;\n\n    return DICT_GET_ITEM0(tstate, module_dict, const_str_plain___name__);\n}\n\n// Get the binary directory as wide characters.\nextern wchar_t const *getBinaryDirectoryWideChars(bool resolve_symlinks);\n\n// Get the binary directory, translated to ANSI/native path\nextern char const *getBinaryDirectoryHostEncoded(bool resolve_symlinks);\n\n// Get the containing directory as an object with symlinks resolved or not.\nextern PyObject *getContainingDirectoryObject(bool resolve_symlinks);\n\n#ifdef _NUITKA_STANDALONE\nextern void setEarlyFrozenModulesFileAttribute(PyThreadState *tstate);\n#endif\n\n/* For making paths relative to where we got loaded from. Do not provide any\n * absolute paths as relative value, this is not as capable as \"os.path.join\",\n * instead just works on strings.\n */\nextern PyObject *MAKE_RELATIVE_PATH(PyObject *relative);\n\n/* For concatenating two elements path, typically a dirname and a filename.\n\n   We do this in a lot of helper code, and this is shared functionality.\n*/\nextern PyObject *JOIN_PATH2(PyObject *dirname, PyObject *filename);\n\n#include <nuitka/threading.h>\n\n// Make a deep copy of an object of general or specific type.\nextern PyObject *DEEP_COPY(PyThreadState *tstate, PyObject *value);\nextern PyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value);\nextern PyObject *DEEP_COPY_LIST(PyThreadState *tstate, PyObject *value);\nextern PyObject *DEEP_COPY_TUPLE(PyThreadState *tstate, PyObject *value);\nextern PyObject *DEEP_COPY_SET(PyThreadState *tstate, PyObject *value);\n\n// Constants deep copies are guided by value type descriptions.\nextern PyObject *DEEP_COPY_LIST_GUIDED(PyThreadState *tstate, PyObject *value, char const *guide);\nextern PyObject *DEEP_COPY_TUPLE_GUIDED(PyThreadState *tstate, PyObject *value, char const *guide);\n\n// UnionType, normally not accessible\nextern PyTypeObject *Nuitka_PyUnion_Type;\n\n// Force a garbage collection, for debugging purposes.\nNUITKA_MAY_BE_UNUSED static void forceGC(void) {\n    PyObject_CallObject(PyObject_GetAttrString(PyImport_ImportModule(\"gc\"), \"collect\"), NULL);\n}\n\n// We provide the sys.version info shortcut as a global value here for ease of use.\nextern PyObject *Py_SysVersionInfo;\n\n#include \"nuitka/python_pgo.h\"\n\nextern PyObject *MAKE_UNION_TYPE(PyObject *args);\n\nextern void Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool generic_get_attr, bool generic_set_attr,\n                                bool self_iter, bool await_self_iter, bool self_aiter);\n\n#if PYTHON_VERSION >= 0x3b0\n#include \"nuitka/exception_groups.h\"\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/importing.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_IMPORTING_H__\n#define __NUITKA_IMPORTING_H__\n\n/* These are for the built-in import.\n *\n * They call the real thing with varying amount of arguments. For keyword\n * calls using default values, the _KW helper is used.\n *\n */\nextern PyObject *IMPORT_MODULE1(PyThreadState *tstate, PyObject *module_name);\nextern PyObject *IMPORT_MODULE2(PyThreadState *tstate, PyObject *module_name, PyObject *globals);\nextern PyObject *IMPORT_MODULE3(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals);\nextern PyObject *IMPORT_MODULE4(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                                PyObject *import_items);\nextern PyObject *IMPORT_MODULE5(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                                PyObject *import_items, PyObject *level);\n\nextern PyObject *IMPORT_MODULE_KW(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                                  PyObject *import_items, PyObject *level);\n\nextern bool IMPORT_MODULE_STAR(PyThreadState *tstate, PyObject *target, bool is_module, PyObject *module);\n\n// Fixed import name to be imported and used by value name.\nextern PyObject *IMPORT_MODULE_FIXED(PyThreadState *tstate, PyObject *module_name, PyObject *value_name);\n\n// Import an embedded module directly.\nextern PyObject *IMPORT_EMBEDDED_MODULE(PyThreadState *tstate, char const *name);\n\n// Execute a module, the module object is prepared empty, but with __name__.\nextern PyObject *EXECUTE_EMBEDDED_MODULE(PyThreadState *tstate, PyObject *module);\n\n// Import a name from a module.\nextern PyObject *IMPORT_NAME_FROM_MODULE(PyThreadState *tstate, PyObject *module, PyObject *import_name);\n\n// import a name from a module, potentially making an import of it if necessary.\n#if PYTHON_VERSION >= 0x350\nextern PyObject *IMPORT_NAME_OR_MODULE(PyThreadState *tstate, PyObject *module, PyObject *globals,\n                                       PyObject *import_name, PyObject *level);\n#endif\n\n#if PYTHON_VERSION >= 0x300\nextern PyObject *getImportLibBootstrapModule(void);\n#endif\n\n// Replacement for \"PyImport_GetModuleDict\"\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_GetSysModules(void) {\n#if PYTHON_VERSION < 0x390\n    return PyThreadState_GET()->interp->modules;\n#elif PYTHON_VERSION < 0x3c0\n    return _PyInterpreterState_GET()->modules;\n#else\n    return _PyInterpreterState_GET()->imports.modules;\n#endif\n}\n\n// Replacement for \"PyImport_GetModule\" working across all versions and less checks.\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_GetModule(PyThreadState *tstate, PyObject *module_name) {\n    return DICT_GET_ITEM1(tstate, Nuitka_GetSysModules(), module_name);\n}\n\n// Replacement for PyImport_GetModule working across all versions and less checks.\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_GetModuleString(PyThreadState *tstate, char const *module_name) {\n    PyObject *module_name_object = Nuitka_String_FromString(module_name);\n    PyObject *result = Nuitka_GetModule(tstate, module_name_object);\n    Py_DECREF(module_name_object);\n\n    return result;\n}\n\n// Add a module to the modules dictionary from name object\nNUITKA_MAY_BE_UNUSED static bool Nuitka_SetModule(PyObject *module_name, PyObject *module) {\n    CHECK_OBJECT(module_name);\n    CHECK_OBJECT(module);\n    assert(PyModule_Check(module));\n\n    return DICT_SET_ITEM(Nuitka_GetSysModules(), module_name, module);\n}\n\n// Add a module to the modules dictionary from name C string\nNUITKA_MAY_BE_UNUSED static bool Nuitka_SetModuleString(char const *module_name, PyObject *module) {\n    PyObject *module_name_object = Nuitka_String_FromString(module_name);\n    bool result = Nuitka_SetModule(module_name_object, module);\n    Py_DECREF(module_name_object);\n\n    return result;\n}\n\n// Remove a module to the modules dictionary from name object\nNUITKA_MAY_BE_UNUSED static bool Nuitka_DelModule(PyThreadState *tstate, PyObject *module_name) {\n    CHECK_OBJECT(module_name);\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    bool result = DICT_REMOVE_ITEM(PyImport_GetModuleDict(), module_name);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    return result;\n}\n\n// Remove a module to the modules dictionary from name C string\nNUITKA_MAY_BE_UNUSED static bool Nuitka_DelModuleString(PyThreadState *tstate, char const *module_name) {\n    PyObject *module_name_object = Nuitka_String_FromString(module_name);\n    bool result = Nuitka_DelModule(tstate, module_name_object);\n    Py_DECREF(module_name_object);\n\n    return result;\n}\n\n// Wrapper for PyModule_GetFilenameObject that has no error.\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_GetFilenameObject(PyThreadState *tstate, PyObject *module) {\n#if PYTHON_VERSION < 0x300\n    PyObject *filename = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__);\n#else\n    PyObject *filename = PyModule_GetFilenameObject(module);\n#endif\n\n    if (unlikely(filename == NULL)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n        filename = PyUnicode_FromString(\"unknown location\");\n    }\n\n    return filename;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/incbin.h",
    "content": "/**\n\nThis is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to <http://unlicense.org/>\n\n * @file incbin.h\n * @author Dale Weiler\n * @brief Utility for including binary files\n *\n * Facilities for including binary files into the current translation unit and\n * making use from them externally in other translation units.\n */\n#ifndef INCBIN_HDR\n#define INCBIN_HDR\n#include <limits.h>\n#if   defined(__AVX512BW__) || \\\n      defined(__AVX512CD__) || \\\n      defined(__AVX512DQ__) || \\\n      defined(__AVX512ER__) || \\\n      defined(__AVX512PF__) || \\\n      defined(__AVX512VL__) || \\\n      defined(__AVX512F__)\n# define INCBIN_ALIGNMENT_INDEX 6\n#elif defined(__AVX__)      || \\\n      defined(__AVX2__)\n# define INCBIN_ALIGNMENT_INDEX 5\n#elif defined(__SSE__)      || \\\n      defined(__SSE2__)     || \\\n      defined(__SSE3__)     || \\\n      defined(__SSSE3__)    || \\\n      defined(__SSE4_1__)   || \\\n      defined(__SSE4_2__)   || \\\n      defined(__neon__)\n# define INCBIN_ALIGNMENT_INDEX 4\n#elif ULONG_MAX != 0xffffffffu\n# define INCBIN_ALIGNMENT_INDEX 3\n# else\n# define INCBIN_ALIGNMENT_INDEX 2\n#endif\n\n/* Lookup table of (1 << n) where `n' is `INCBIN_ALIGNMENT_INDEX' */\n#define INCBIN_ALIGN_SHIFT_0 1\n#define INCBIN_ALIGN_SHIFT_1 2\n#define INCBIN_ALIGN_SHIFT_2 4\n#define INCBIN_ALIGN_SHIFT_3 8\n#define INCBIN_ALIGN_SHIFT_4 16\n#define INCBIN_ALIGN_SHIFT_5 32\n#define INCBIN_ALIGN_SHIFT_6 64\n\n/* Actual alignment value */\n#define INCBIN_ALIGNMENT \\\n    INCBIN_CONCATENATE( \\\n        INCBIN_CONCATENATE(INCBIN_ALIGN_SHIFT, _), \\\n        INCBIN_ALIGNMENT_INDEX)\n\n/* Stringize */\n#define INCBIN_STR(X) \\\n    #X\n#define INCBIN_STRINGIZE(X) \\\n    INCBIN_STR(X)\n/* Concatenate */\n#define INCBIN_CAT(X, Y) \\\n    X ## Y\n#define INCBIN_CONCATENATE(X, Y) \\\n    INCBIN_CAT(X, Y)\n/* Deferred macro expansion */\n#define INCBIN_EVAL(X) \\\n    X\n#define INCBIN_INVOKE(N, ...) \\\n    INCBIN_EVAL(N(__VA_ARGS__))\n\n/* Green Hills uses a different directive for including binary data */\n#if defined(__ghs__)\n#  if (__ghs_asm == 2)\n#    define INCBIN_MACRO \".file\"\n/* Or consider the \".myrawdata\" entry in the ld file */\n#  else\n#    define INCBIN_MACRO \"\\tINCBIN\"\n#  endif\n#else\n#  define INCBIN_MACRO \".incbin\"\n#endif\n\n#ifndef _MSC_VER\n#  define INCBIN_ALIGN \\\n    __attribute__((aligned(INCBIN_ALIGNMENT)))\n#else\n#  define INCBIN_ALIGN __declspec(align(INCBIN_ALIGNMENT))\n#endif\n\n#if defined(__arm__) || /* GNU C and RealView */ \\\n    defined(__arm) || /* Diab */ \\\n    defined(_ARM) /* ImageCraft */\n#  define INCBIN_ARM\n#endif\n\n#ifdef __GNUC__\n/* Utilize .balign where supported */\n#  define INCBIN_ALIGN_HOST \".balign \" INCBIN_STRINGIZE(INCBIN_ALIGNMENT) \"\\n\"\n#  define INCBIN_ALIGN_BYTE \".balign 1\\n\"\n#elif defined(INCBIN_ARM)\n/*\n * On arm assemblers, the alignment value is calculated as (1 << n) where `n' is\n * the shift count. This is the value passed to `.align'\n */\n#  define INCBIN_ALIGN_HOST \".align \" INCBIN_STRINGIZE(INCBIN_ALIGNMENT_INDEX) \"\\n\"\n#  define INCBIN_ALIGN_BYTE \".align 0\\n\"\n#else\n/* We assume other inline assembler's treat `.align' as `.balign' */\n#  define INCBIN_ALIGN_HOST \".align \" INCBIN_STRINGIZE(INCBIN_ALIGNMENT) \"\\n\"\n#  define INCBIN_ALIGN_BYTE \".align 1\\n\"\n#endif\n\n/* INCBIN_CONST is used by incbin.c generated files */\n#if defined(__cplusplus)\n#  define INCBIN_EXTERNAL extern \"C\"\n#  define INCBIN_CONST    extern const\n#else\n#  define INCBIN_EXTERNAL extern\n#  define INCBIN_CONST    const\n#endif\n\n/**\n * @brief Optionally override the linker section into which data is emitted.\n *\n * @warning If you use this facility, you'll have to deal with platform-specific linker output\n * section naming on your own\n *\n * Overriding the default linker output section, e.g for esp8266/Arduino:\n * @code\n * #define INCBIN_OUTPUT_SECTION \".irom.text\"\n * #include \"incbin.h\"\n * INCBIN(Foo, \"foo.txt\");\n * // Data is emitted into program memory that never gets copied to RAM\n * @endcode\n */\n#if !defined(INCBIN_OUTPUT_SECTION)\n#  if defined(__APPLE__)\n#    define INCBIN_OUTPUT_SECTION         \".const_data\"\n#  else\n#    define INCBIN_OUTPUT_SECTION         \".rodata\"\n#  endif\n#endif\n\n#if defined(__APPLE__)\n/* The directives are different for Apple branded compilers */\n#  define INCBIN_SECTION         INCBIN_OUTPUT_SECTION \"\\n\"\n#  ifndef INCBIN_LOCAL\n#    define INCBIN_GLOBAL(NAME)    \".globl \" INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME \"\\n\"\n#  else\n#    define INCBIN_GLOBAL(NAME)\n#  endif\n#  define INCBIN_INT             \".long \"\n#  define INCBIN_MANGLE          \"_\"\n#  define INCBIN_BYTE            \".byte \"\n#  define INCBIN_TYPE(...)\n#else\n#  define INCBIN_SECTION         \".section \" INCBIN_OUTPUT_SECTION \"\\n\"\n#  ifndef INCBIN_LOCAL\n#    define INCBIN_GLOBAL(NAME)    \".global \" INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME \"\\n\"\n#  else\n#    define INCBIN_GLOBAL(NAME)\n#  endif\n#  if defined(__ghs__)\n#    define INCBIN_INT           \".word \"\n#  else\n#    define INCBIN_INT           \".int \"\n#  endif\n#  if defined(__USER_LABEL_PREFIX__)\n#    define INCBIN_MANGLE        INCBIN_STRINGIZE(__USER_LABEL_PREFIX__)\n#  else\n#    define INCBIN_MANGLE        \"\"\n#  endif\n#  if defined(INCBIN_ARM)\n/* On arm assemblers, `@' is used as a line comment token */\n#    define INCBIN_TYPE(NAME)    \".type \" INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME \", %object\\n\"\n#  elif defined(__MINGW32__) || defined(__MINGW64__)\n/* Mingw doesn't support this directive either */\n#    define INCBIN_TYPE(NAME)\n#  else\n/* It's safe to use `@' on other architectures */\n#    define INCBIN_TYPE(NAME)    \".type \" INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME \", @object\\n\"\n#  endif\n#  define INCBIN_BYTE            \".byte \"\n#endif\n\n/* List of style types used for symbol names */\n#define INCBIN_STYLE_CAMEL 0\n#define INCBIN_STYLE_SNAKE 1\n\n/**\n * @brief Specify the prefix to use for symbol names.\n *\n * By default this is `g', producing symbols of the form:\n * @code\n * #include \"incbin.h\"\n * INCBIN(Foo, \"foo.txt\");\n *\n * // Now you have the following symbols:\n * // const unsigned char gFooData[];\n * // const unsigned char *const gFooEnd;\n * // const unsigned int gFooSize;\n * @endcode\n *\n * If however you specify a prefix before including: e.g:\n * @code\n * #define INCBIN_PREFIX incbin\n * #include \"incbin.h\"\n * INCBIN(Foo, \"foo.txt\");\n *\n * // Now you have the following symbols instead:\n * // const unsigned char incbinFooData[];\n * // const unsigned char *const incbinFooEnd;\n * // const unsigned int incbinFooSize;\n * @endcode\n */\n#if !defined(INCBIN_PREFIX)\n#  define INCBIN_PREFIX g\n#endif\n\n/**\n * @brief Specify the style used for symbol names.\n *\n * Possible options are\n * - INCBIN_STYLE_CAMEL \"CamelCase\"\n * - INCBIN_STYLE_SNAKE \"snake_case\"\n *\n * Default option is *INCBIN_STYLE_CAMEL* producing symbols of the form:\n * @code\n * #include \"incbin.h\"\n * INCBIN(Foo, \"foo.txt\");\n *\n * // Now you have the following symbols:\n * // const unsigned char <prefix>FooData[];\n * // const unsigned char *const <prefix>FooEnd;\n * // const unsigned int <prefix>FooSize;\n * @endcode\n *\n * If however you specify a style before including: e.g:\n * @code\n * #define INCBIN_STYLE INCBIN_STYLE_SNAKE\n * #include \"incbin.h\"\n * INCBIN(foo, \"foo.txt\");\n *\n * // Now you have the following symbols:\n * // const unsigned char <prefix>foo_data[];\n * // const unsigned char *const <prefix>foo_end;\n * // const unsigned int <prefix>foo_size;\n * @endcode\n */\n#if !defined(INCBIN_STYLE)\n#  define INCBIN_STYLE INCBIN_STYLE_CAMEL\n#endif\n\n/* Style lookup tables */\n#define INCBIN_STYLE_0_DATA Data\n#define INCBIN_STYLE_0_END End\n#define INCBIN_STYLE_0_SIZE Size\n#define INCBIN_STYLE_1_DATA _data\n#define INCBIN_STYLE_1_END _end\n#define INCBIN_STYLE_1_SIZE _size\n\n/* Style lookup: returning identifier */\n#define INCBIN_STYLE_IDENT(TYPE) \\\n    INCBIN_CONCATENATE( \\\n        INCBIN_STYLE_, \\\n        INCBIN_CONCATENATE( \\\n            INCBIN_EVAL(INCBIN_STYLE), \\\n            INCBIN_CONCATENATE(_, TYPE)))\n\n/* Style lookup: returning string literal */\n#define INCBIN_STYLE_STRING(TYPE) \\\n    INCBIN_STRINGIZE( \\\n        INCBIN_STYLE_IDENT(TYPE)) \\\n\n/* Generate the global labels by indirectly invoking the macro with our style\n * type and concatenating the name against them. */\n#define INCBIN_GLOBAL_LABELS(NAME, TYPE) \\\n    INCBIN_INVOKE( \\\n        INCBIN_GLOBAL, \\\n        INCBIN_CONCATENATE( \\\n            NAME, \\\n            INCBIN_INVOKE( \\\n                INCBIN_STYLE_IDENT, \\\n                TYPE))) \\\n    INCBIN_INVOKE( \\\n        INCBIN_TYPE, \\\n        INCBIN_CONCATENATE( \\\n            NAME, \\\n            INCBIN_INVOKE( \\\n                INCBIN_STYLE_IDENT, \\\n                TYPE)))\n\n/**\n * @brief Externally reference binary data included in another translation unit.\n *\n * Produces three external symbols that reference the binary data included in\n * another translation unit.\n *\n * The symbol names are a concatenation of `INCBIN_PREFIX' before *NAME*; with\n * \"Data\", as well as \"End\" and \"Size\" after. An example is provided below.\n *\n * @param NAME The name given for the binary data\n *\n * @code\n * INCBIN_EXTERN(Foo);\n *\n * // Now you have the following symbols:\n * // extern const unsigned char <prefix>FooData[];\n * // extern const unsigned char *const <prefix>FooEnd;\n * // extern const unsigned int <prefix>FooSize;\n * @endcode\n */\n#define INCBIN_EXTERN(NAME) \\\n    INCBIN_EXTERNAL const INCBIN_ALIGN unsigned char \\\n        INCBIN_CONCATENATE( \\\n            INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \\\n            INCBIN_STYLE_IDENT(DATA))[]; \\\n    INCBIN_EXTERNAL const INCBIN_ALIGN unsigned char *const \\\n    INCBIN_CONCATENATE( \\\n        INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \\\n        INCBIN_STYLE_IDENT(END)); \\\n    INCBIN_EXTERNAL const unsigned int \\\n        INCBIN_CONCATENATE( \\\n            INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \\\n            INCBIN_STYLE_IDENT(SIZE))\n\n/**\n * @brief Include a binary file into the current translation unit.\n *\n * Includes a binary file into the current translation unit, producing three symbols\n * for objects that encode the data and size respectively.\n *\n * The symbol names are a concatenation of `INCBIN_PREFIX' before *NAME*; with\n * \"Data\", as well as \"End\" and \"Size\" after. An example is provided below.\n *\n * @param NAME The name to associate with this binary data (as an identifier.)\n * @param FILENAME The file to include (as a string literal.)\n *\n * @code\n * INCBIN(Icon, \"icon.png\");\n *\n * // Now you have the following symbols:\n * // const unsigned char <prefix>IconData[];\n * // const unsigned char *const <prefix>IconEnd;\n * // const unsigned int <prefix>IconSize;\n * @endcode\n *\n * @warning This must be used in global scope\n * @warning The identifiers may be different if INCBIN_STYLE is not default\n *\n * To externally reference the data included by this in another translation unit\n * please @see INCBIN_EXTERN.\n */\n#ifdef _MSC_VER\n#define INCBIN(NAME, FILENAME) \\\n    INCBIN_EXTERN(NAME)\n#else\n#define INCBIN(NAME, FILENAME) \\\n    __asm__(INCBIN_SECTION \\\n            INCBIN_GLOBAL_LABELS(NAME, DATA) \\\n            INCBIN_ALIGN_HOST \\\n            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) \":\\n\" \\\n            INCBIN_MACRO \" \\\"\" FILENAME \"\\\"\\n\" \\\n            INCBIN_GLOBAL_LABELS(NAME, END) \\\n            INCBIN_ALIGN_BYTE \\\n            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) \":\\n\" \\\n                INCBIN_BYTE \"1\\n\" \\\n            INCBIN_GLOBAL_LABELS(NAME, SIZE) \\\n            INCBIN_ALIGN_HOST \\\n            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(SIZE) \":\\n\" \\\n                INCBIN_INT INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) \" - \" \\\n                           INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) \"\\n\" \\\n            INCBIN_ALIGN_HOST \\\n            \".text\\n\" \\\n    ); \\\n    INCBIN_EXTERN(NAME)\n\n#endif\n#endif\n"
  },
  {
    "path": "nuitka/build/include/nuitka/jit_sources.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_JIT_SOURCES_H__\n#define __NUITKA_JIT_SOURCES_H__\n\n// Helpers for making source available at run-time for JIT systems\n// outside of Nuitka that want it.\n\nextern void SET_UNCOMPILED_FUNCTION_SOURCE_DICT(PyObject *name, PyObject *source);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/prelude.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_PRELUDE_H__\n#define __NUITKA_PRELUDE_H__\n\n#ifdef __NUITKA_NO_ASSERT__\n#undef NDEBUG\n#define NDEBUG\n#endif\n\n#if defined(_WIN32)\n// Note: Keep this separate line, must be included before other Windows headers.\n#include <windows.h>\n#endif\n\n/* Include the CPython version numbers, and define our own take of what version\n * numbers should be.\n */\n#include \"patchlevel.h\"\n\n/* Use a hex version of our own to compare for versions. We do not care about pre-releases */\n#if PY_MICRO_VERSION < 16\n#define PYTHON_VERSION (PY_MAJOR_VERSION * 256 + PY_MINOR_VERSION * 16 + PY_MICRO_VERSION)\n#else\n#define PYTHON_VERSION (PY_MAJOR_VERSION * 256 + PY_MINOR_VERSION * 16 + 15)\n#endif\n\n/* This is needed or else we can't create modules name \"proc\" or \"func\". For\n * Python3, the name collision can't happen, so we can limit it to Python2.\n */\n#define initproc python_initproc\n#define initfunc python_initfunc\n#define initstate python_initstate\n\n// Python 3.11 headers give these warnings\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4200)\n#pragma warning(disable : 4244)\n#endif\n\n/* Include the relevant Python C-API header files. */\n#include <Python.h>\n#include <frameobject.h>\n#include <marshal.h>\n#include <methodobject.h>\n#include <osdefs.h>\n#include <structseq.h>\n\n#if PYTHON_VERSION < 0x3a0\n#include \"pydebug.h\"\n#endif\n\n/* A way to not give warnings about things that are declared, but might not\n * be used like in-line helper functions in headers or static per module\n * variables from headers.\n */\n#ifdef __GNUC__\n#define NUITKA_MAY_BE_UNUSED __attribute__((__unused__))\n#else\n#define NUITKA_MAY_BE_UNUSED\n#endif\n\n// We are not following the 3.10 change to an inline function. At least\n// not immediately.\n#if PYTHON_VERSION >= 0x3a0\n#undef Py_REFCNT\n#define Py_REFCNT(ob) (_PyObject_CAST(ob)->ob_refcnt)\n#endif\n\n// We are using this new macro on old code too.\n#ifndef Py_SET_REFCNT\n#define Py_SET_REFCNT(ob, refcnt) Py_REFCNT(ob) = refcnt\n#endif\n\n#if defined(_WIN32)\n// Windows is too difficult for API redefines.\n#define MIN_PYCORE_PYTHON_VERSION 0x380\n#else\n#define MIN_PYCORE_PYTHON_VERSION 0x371\n#endif\n\n#if PYTHON_VERSION >= MIN_PYCORE_PYTHON_VERSION\n#define NUITKA_USE_PYCORE_THREAD_STATE\n#endif\n\n#ifdef NUITKA_USE_PYCORE_THREAD_STATE\n#undef Py_BUILD_CORE\n#define Py_BUILD_CORE\n#undef _PyGC_FINALIZED\n\n#if PYTHON_VERSION < 0x380\n#undef Py_ATOMIC_H\n#include \"pyatomic.h\"\n#undef Py_INTERNAL_PYSTATE_H\n#include \"internal/pystate.h\"\n#undef Py_STATE_H\n#include \"pystate.h\"\n\nextern _PyRuntimeState _PyRuntime;\n#else\n\n#if PYTHON_VERSION >= 0x3c0\n#include \"internal/pycore_runtime.h\"\n\nstatic inline size_t Nuitka_static_builtin_index_get(PyTypeObject *self) { return (size_t)self->tp_subclasses - 1; }\n\nstatic inline static_builtin_state *Nuitka_static_builtin_state_get(PyInterpreterState *interp, PyTypeObject *self) {\n    return &(interp->types.builtins[Nuitka_static_builtin_index_get(self)]);\n}\n\nNUITKA_MAY_BE_UNUSED static inline static_builtin_state *Nuitka_PyStaticType_GetState(PyInterpreterState *interp,\n                                                                                      PyTypeObject *self) {\n    assert(self->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN);\n    return Nuitka_static_builtin_state_get(interp, self);\n}\n\n#define _PyStaticType_GetState(interp, self) Nuitka_PyStaticType_GetState(interp, self)\n#endif\n\n#include \"internal/pycore_pystate.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x390\n#include <internal/pycore_ceval.h>\n#include <internal/pycore_interp.h>\n#include <internal/pycore_runtime.h>\n#endif\n\n#if PYTHON_VERSION >= 0x380\n#include <cpython/initconfig.h>\n#include <internal/pycore_initconfig.h>\n#include <internal/pycore_pathconfig.h>\n#include <internal/pycore_pyerrors.h>\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\n#include <internal/pycore_long.h>\n#include <internal/pycore_unionobject.h>\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\n#include <internal/pycore_dict.h>\n#include <internal/pycore_frame.h>\n#include <internal/pycore_gc.h>\n#endif\n\n// Uncompiled generator integration requires these.\n#if PYTHON_VERSION >= 0x3b0\n#include <internal/pycore_opcode.h>\n// Clashes with our helper names.\n#undef CALL_FUNCTION\n#endif\n\n#if PYTHON_VERSION >= 0x3c0\n#include <cpython/code.h>\n#endif\n\n#if !defined(PY_NOGIL) && PYTHON_VERSION < 0x3c0\n#undef PyThreadState_GET\n#define _PyThreadState_Current _PyRuntime.gilstate.tstate_current\n#define PyThreadState_GET() ((PyThreadState *)_Py_atomic_load_relaxed(&_PyThreadState_Current))\n#endif\n\n#if PYTHON_VERSION >= 0x380\n#undef _PyObject_LookupSpecial\n#include <internal/pycore_object.h>\n#else\n#include <objimpl.h>\n#endif\n\n#undef Py_BUILD_CORE\n\n#endif\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n/* See above. */\n#if PYTHON_VERSION < 0x300\n#undef initproc\n#undef initfunc\n#undef initstate\n#endif\n\n/* Type bool */\n#ifndef __cplusplus\n#include \"stdbool.h\"\n#endif\n\n/* Include the C header files most often used. */\n#include <stdio.h>\n\n#include \"hedley.h\"\n\n/* Use annotations for branch prediction. They still make sense as the L1\n * cache space is saved.\n */\n\n#define likely(x) HEDLEY_LIKELY(x)\n#define unlikely(x) HEDLEY_UNLIKELY(x)\n\n/* A way to indicate that a specific function won't return, so the C compiler\n * can create better code.\n */\n\n#define NUITKA_NO_RETURN HEDLEY_NO_RETURN\n\n/* This is used to indicate code control flows we know cannot happen. */\n#ifndef __NUITKA_NO_ASSERT__\n#define NUITKA_CANNOT_GET_HERE(NAME)                                                                                   \\\n    PRINT_FORMAT(\"%s : %s\\n\", __FUNCTION__, #NAME);                                                                    \\\n    assert(false);                                                                                                     \\\n    abort();\n#else\n#define NUITKA_CANNOT_GET_HERE(NAME) abort();\n#endif\n\n#ifdef _MSC_VER\n/* Using \"_alloca\" extension due to MSVC restrictions for array variables\n * on the local stack.\n */\n#include <malloc.h>\n#define NUITKA_DYNAMIC_ARRAY_DECL(VARIABLE_NAME, ELEMENT_TYPE, COUNT)                                                  \\\n    ELEMENT_TYPE *VARIABLE_NAME = (ELEMENT_TYPE *)_alloca(sizeof(ELEMENT_TYPE) * (COUNT));\n#else\n#define NUITKA_DYNAMIC_ARRAY_DECL(VARIABLE_NAME, ELEMENT_TYPE, COUNT) ELEMENT_TYPE VARIABLE_NAME[COUNT];\n#endif\n\n// Stringizing, to make strings out of defines use XSTRINGIZED(SOME_DEFINE) needs\n// to level of defines to work.\n#define _STRINGIZED(ARG) #ARG\n#define STRINGIZED(ARG) _STRINGIZED(ARG)\n\n/* Python3 removed PyInt instead of renaming PyLong, and PyObject_Str instead\n * of renaming PyObject_Unicode. Define this to be easily portable.\n */\n#if PYTHON_VERSION >= 0x300\n#define PyInt_FromLong PyLong_FromLong\n#define PyInt_AsLong PyLong_AsLong\n#define PyInt_FromSsize_t PyLong_FromSsize_t\n\n#define PyNumber_Int PyNumber_Long\n\n#define PyObject_Unicode PyObject_Str\n\n#endif\n\n/* String handling that uses the proper version of strings for Python3 or not,\n * which makes it easier to write portable code.\n */\n#if PYTHON_VERSION < 0x300\n#define Nuitka_String_AsString PyString_AsString\n#define Nuitka_String_AsString_Unchecked PyString_AS_STRING\n#define Nuitka_String_Check PyString_Check\n#define Nuitka_String_CheckExact PyString_CheckExact\nNUITKA_MAY_BE_UNUSED static inline bool Nuitka_StringOrUnicode_CheckExact(PyObject *value) {\n    return PyString_CheckExact(value) || PyUnicode_CheckExact(value);\n}\n#define Nuitka_StringObject PyStringObject\n#define Nuitka_String_FromString PyString_FromString\n#define Nuitka_String_FromStringAndSize PyString_FromStringAndSize\n#define Nuitka_String_FromFormat PyString_FromFormat\n#define PyUnicode_CHECK_INTERNED (0)\n#else\n#define Nuitka_String_AsString _PyUnicode_AsString\n\n/* Note: This is from unicodeobject.c */\n#define _PyUnicode_UTF8(op) (((PyCompactUnicodeObject *)(op))->utf8)\n#define PyUnicode_UTF8(op)                                                                                             \\\n    (assert(PyUnicode_IS_READY(op)),                                                                                   \\\n     PyUnicode_IS_COMPACT_ASCII(op) ? ((char *)((PyASCIIObject *)(op) + 1)) : _PyUnicode_UTF8(op))\n#define Nuitka_String_AsString_Unchecked PyUnicode_UTF8\n\n#define Nuitka_String_Check PyUnicode_Check\n#define Nuitka_String_CheckExact PyUnicode_CheckExact\n#define Nuitka_StringOrUnicode_CheckExact PyUnicode_CheckExact\n#define Nuitka_StringObject PyUnicodeObject\n#define Nuitka_String_FromString PyUnicode_FromString\n#define Nuitka_String_FromStringAndSize PyUnicode_FromStringAndSize\n#define Nuitka_String_FromFormat PyUnicode_FromFormat\n#endif\n\n#if PYTHON_VERSION < 0x300\n#define PyUnicode_GET_LENGTH(x) (PyUnicode_GET_SIZE(x))\n#endif\n\n// Wrap the type lookup for debug mode, to identify errors, and potentially\n// to make our own enhancement later on. For now only verify it is not being\n// called with an error set, which 3.9 asserts against in core code.\n#ifdef __NUITKA_NO_ASSERT__\n#define Nuitka_TypeLookup(x, y) _PyType_Lookup(x, y)\n#else\nNUITKA_MAY_BE_UNUSED static PyObject *Nuitka_TypeLookup(PyTypeObject *type, PyObject *name) {\n    return _PyType_Lookup(type, name);\n}\n\n#endif\n\n/* With the idea to reduce the amount of exported symbols in the DLLs, make it\n * clear that the module \"init\" function should of course be exported, but not\n * for executable, where we call it ourselves from the main code.\n */\n\n#if PYTHON_VERSION < 0x300\n#define NUITKA_MODULE_ENTRY_FUNCTION void\n#else\n#define NUITKA_MODULE_ENTRY_FUNCTION PyObject *\n#endif\n\n/* Avoid gcc warnings about using an integer as a bool. This is a cherry-pick.\n *\n * This might apply to more versions. I am seeing this on 3.3.2, and it was\n * fixed for Python 2.x only later. We could include more versions. This is\n * only a problem with debug mode and therefore not too important maybe.\n */\n#if PYTHON_VERSION >= 0x300 && PYTHON_VERSION < 0x340\n\n#undef PyMem_MALLOC\n#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL : malloc(((n) != 0) ? (n) : 1))\n\n#undef PyMem_REALLOC\n#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL : realloc((p), ((n) != 0) ? (n) : 1))\n\n#endif\n\n#if PYTHON_VERSION < 0x300\ntypedef long Py_hash_t;\n#endif\n\n/* These two express if a directly called function should be exported (C level)\n * or if it can be local to the file.\n */\n#define NUITKA_CROSS_MODULE\n#define NUITKA_LOCAL_MODULE static\n\n/* Due to ABI issues, it seems that on Windows the symbols used by\n * \"_PyObject_GC_TRACK\" were not exported before 3.8 and we need to use a\n * function that does it instead.\n *\n * The Python 3.7.0 release on at Linux doesn't work this way either, was\n * a bad CPython release apparently and between 3.7.3 and 3.7.4 these have\n * become runtime incompatible.\n */\n#if (defined(_WIN32) || defined(__MSYS__)) && PYTHON_VERSION < 0x380\n#define Nuitka_GC_Track PyObject_GC_Track\n#define Nuitka_GC_UnTrack PyObject_GC_UnTrack\n#undef _PyObject_GC_TRACK\n#undef _PyObject_GC_UNTRACK\n#elif PYTHON_VERSION == 0x370\n#define Nuitka_GC_Track PyObject_GC_Track\n#define Nuitka_GC_UnTrack PyObject_GC_UnTrack\n#undef _PyObject_GC_TRACK\n#undef _PyObject_GC_UNTRACK\n#elif defined(_NUITKA_MODULE) && PYTHON_VERSION >= 0x370 && PYTHON_VERSION < 0x380\n#define Nuitka_GC_Track PyObject_GC_Track\n#define Nuitka_GC_UnTrack PyObject_GC_UnTrack\n#undef _PyObject_GC_TRACK\n#undef _PyObject_GC_UNTRACK\n#undef PyThreadState_GET\n#define PyThreadState_GET PyThreadState_Get\n#else\n#define Nuitka_GC_Track _PyObject_GC_TRACK\n#define Nuitka_GC_UnTrack _PyObject_GC_UNTRACK\n#endif\n\n#if _NUITKA_EXPERIMENTAL_FAST_THREAD_GET && PYTHON_VERSION >= 0x300 && PYTHON_VERSION < 0x370\n// We are careful, access without locking under the assumption that we hold\n// the GIL over uses of this or the same thread continues to execute code of\n// ours.\n#undef PyThreadState_GET\nextern PyThreadState *_PyThreadState_Current;\n#define PyThreadState_GET() (_PyThreadState_Current)\n#endif\n\n#ifndef _NUITKA_FULL_COMPAT\n// Remove useless recursion control guards, except for testing mode, we do not\n// want them and we have no need for them as we are achieving deeper recursion\n// anyway.\n#undef Py_EnterRecursiveCall\n#define Py_EnterRecursiveCall(arg) (0)\n#undef Py_LeaveRecursiveCall\n#define Py_LeaveRecursiveCall()\n#endif\n\n#if PYTHON_VERSION < 0x300\n#define RICHCOMPARE(t) (PyType_HasFeature((t), Py_TPFLAGS_HAVE_RICHCOMPARE) ? (t)->tp_richcompare : NULL)\n#else\n#define RICHCOMPARE(t) ((t)->tp_richcompare)\n#endif\n\n// For older Python we need to define this ourselves.\n#ifndef Py_ABS\n#define Py_ABS(x) ((x) < 0 ? -(x) : (x))\n#endif\n\n#ifndef Py_MIN\n#define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))\n#endif\n\n#ifndef Py_MAX\n#define Py_MAX(x, y) (((x) > (y)) ? (x) : (y))\n#endif\n\n#ifndef Py_SET_SIZE\n#define Py_SET_SIZE(op, size) ((PyVarObject *)(op))->ob_size = size\n#endif\n\n#ifndef PyFloat_SET_DOUBLE\n#define PyFloat_SET_DOUBLE(op, value) ((PyFloatObject *)(op))->ob_fval = value\n#endif\n\n// For older Python, we don't have a feature \"CLASS\" anymore, that's implied now.\n#if PYTHON_VERSION < 0x300\n#define NuitkaType_HasFeatureClass(descr) (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))\n#else\n#define NuitkaType_HasFeatureClass(descr) (1)\n#endif\n\n// For newer Python, this API was moved to global state\n#if PYTHON_VERSION >= 0x3c0\n#define _Py_PackageContext (_PyRuntime.imports.pkgcontext)\n#endif\n\n// Our replacement for \"PyType_IsSubtype\"\nextern bool Nuitka_Type_IsSubtype(PyTypeObject *a, PyTypeObject *b);\n\n#include \"nuitka/allocator.h\"\n#include \"nuitka/exceptions.h\"\n\n// The digit types\n#if PYTHON_VERSION < 0x300\n#include <longintrepr.h>\n\n#if PYTHON_VERSION < 0x270\n// Not present in Python2.6 yet\ntypedef signed int sdigit;\n#endif\n#endif\n\n// A long value that represents a signed digit on the helper interface.\ntypedef long nuitka_digit;\n\n#include \"nuitka/helpers.h\"\n\n#include \"nuitka/compiled_frame.h\"\n\n#include \"nuitka/compiled_cell.h\"\n\n#include \"nuitka/compiled_function.h\"\n\n/* Sentinel PyObject to be used for all our call iterator endings. */\nextern PyObject *_sentinel_value;\n\n/* Value to use for __compiled__ value of all modules. */\nextern PyObject *Nuitka_dunder_compiled_value;\n\n#include \"nuitka/compiled_generator.h\"\n\n#include \"nuitka/compiled_method.h\"\n\n#if PYTHON_VERSION >= 0x350\n#include \"nuitka/compiled_coroutine.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x360\n#include \"nuitka/compiled_asyncgen.h\"\n#endif\n\n#include \"nuitka/filesystem_paths.h\"\n#include \"nuitka/safe_string_ops.h\"\n\n#include \"nuitka/jit_sources.h\"\n\n#if _NUITKA_EXPERIMENTAL_WRITEABLE_CONSTANTS\n#include \"nuitka_data_decoder.h\"\n#else\n#define DECODE(x) assert(x)\n#define UNTRANSLATE(x) (x)\n#endif\n\n#if _NUITKA_EXPERIMENTAL_FILE_TRACING\n#include \"nuitka_file_tracer.h\"\n#else\n#if PYTHON_VERSION < 0x300\n#define TRACE_FILE_OPEN(tstate, x, y, z, r) (false)\n#else\n#define TRACE_FILE_OPEN(tstate, x, y, z, a, b, c, d, e, r) (false)\n#endif\n#define TRACE_FILE_READ(tstate, x, y) (false)\n\n#define TRACE_FILE_EXISTS(tstate, x, y) (false)\n#define TRACE_FILE_ISFILE(tstate, x, y) (false)\n#define TRACE_FILE_ISDIR(tstate, x, y) (false)\n\n#define TRACE_FILE_LISTDIR(tstate, x, y) (false)\n\n#endif\n\n#if _NUITKA_EXPERIMENTAL_INIT_PROGRAM\n#include \"nuitka_init_program.h\"\n#else\n#define NUITKA_INIT_PROGRAM_EARLY(argc, argv)\n#define NUITKA_INIT_PROGRAM_LATE(module_name)\n#endif\n\n#if _NUITKA_EXPERIMENTAL_EXIT_PROGRAM\n#include \"nuitka_exit_program.h\"\n#else\n#define NUITKA_FINALIZE_PROGRAM(tstate)\n#endif\n\n// Only Python3.9+ has a more precise check, while making the old one slow.\n#ifndef PyCFunction_CheckExact\n#define PyCFunction_CheckExact PyCFunction_Check\n#endif\n\n#ifdef _NUITKA_EXPERIMENTAL_DUMP_C_TRACEBACKS\nextern void INIT_C_BACKTRACES(void);\nextern void DUMP_C_BACKTRACE(void);\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/printing.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_PRINTING_H__\n#define __NUITKA_PRINTING_H__\n\n// Helper functions for print. Need to play nice with Python softspace\n// behavior.\n\nextern bool PRINT_NEW_LINE(void);\nextern bool PRINT_ITEM(PyObject *object);\nextern bool PRINT_STRING(char const *str);\nextern bool PRINT_FORMAT(char const *fmt, ...);\nextern bool PRINT_ITEM_TO(PyObject *file, PyObject *object);\nextern bool PRINT_NEW_LINE_TO(PyObject *file);\n\nextern PyObject *GET_STDOUT(void);\nextern PyObject *GET_STDERR(void);\n\n// -----------------------------------------------------------------------\n// Helper functions to debug the run time operation of the compiled binary\n// manually or in debug modes.\n\n// Print the reference count of the object.\nextern void PRINT_REFCOUNT(PyObject *object);\n\n// Print the full traceback stack.\n// TODO: Could be ported, the \"printf\" stuff would need to be split. On Python3\n// the normal C print output gets lost.\n#if PYTHON_VERSION < 0x300\nextern void PRINT_TRACEBACK(PyTracebackObject *traceback);\n#endif\n\n// Print the exception state, including NULL values.\n#if PYTHON_VERSION < 0x3b0\n#define PRINT_EXCEPTION(exception_type, exception_value, exception_tb)                                                 \\\n    _PRINT_EXCEPTION(exception_type, exception_value, exception_tb)\n#define PRINT_EXCEPTION_STATE(exception_state)                                                                         \\\n    _PRINT_EXCEPTION(exception_state->exception_type, exception_state->exception_value, exception_state->exception_tb)\nextern void _PRINT_EXCEPTION(PyObject *exception_type, PyObject *exception_value, PyTracebackObject *exception_tb);\n#else\n#define PRINT_EXCEPTION(exception_type, exception_value, exception_tb) _PRINT_EXCEPTION(exception_value)\n#define PRINT_EXCEPTION_STATE(exception_state) _PRINT_EXCEPTION(exception_state->exception_value)\nextern void _PRINT_EXCEPTION(PyObject *exception_value);\n#endif\n\n// Print the current exception state, including NULL values.\nextern void PRINT_CURRENT_EXCEPTION(void);\n\n// Print the current exception state, including NULL values.\nextern void PRINT_PUBLISHED_EXCEPTION(void);\n\n// Print the representation of the object, or \"<NULL>\" if it's not set.\nextern bool PRINT_REPR(PyObject *object);\n\n// Print the word <NULL>, as an alternative to pointers.\nextern bool PRINT_NULL(void);\n\n// Print the type of an object.\nextern bool PRINT_TYPE(PyObject *object);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/python_pgo.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_PYTHON_PGO_H__\n#define __NUITKA_PYTHON_PGO_H__\n\n// In Visual Code, evaluate the code for PGO so we see errors of it sooner.\n#ifdef __IDE_ONLY__\n#define _NUITKA_PGO_PYTHON 1\n#include \"nuitka/prelude.h\"\n#endif\n\n#if _NUITKA_PGO_PYTHON\n\n#include <stdint.h>\n\n// Initialize PGO data collection.\nextern void PGO_Initialize(void);\n\n// At end of program, write tables.\nextern void PGO_Finalize(void);\n\n// When a module is entered.\nextern void PGO_onModuleEntered(char const *module_name);\n// When a module is exited.\nextern void PGO_onModuleExit(char const *module_name, bool had_error);\n\nextern void PGO_onProbePassed(char const *module_name, char const *probe_id, uint32_t probe_arg);\n\nextern void PGO_onTechnicalModule(char const *module_name);\n\n#else\n\n#define PGO_Initialize()\n#define PGO_Finalize()\n\n#define PGO_onModuleEntered(module_name) ;\n#define PGO_onModuleExit(module_name, had_error) ;\n\n#define PGO_onProbePassed(module_name, probe_id, probe_arg) ;\n\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/safe_string_ops.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_SAFE_STRING_OPS_H__\n#define __NUITKA_SAFE_STRING_OPS_H__\n\n#include <errno.h>\n#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n\n/* Safe to use function to copy a string, will abort program for overflow. */\nextern void copyStringSafe(char *buffer, char const *source, size_t buffer_size);\nextern void copyStringSafeN(char *buffer, char const *source, size_t n, size_t buffer_size);\nextern void copyStringSafeW(wchar_t *buffer, wchar_t const *source, size_t buffer_size);\n\n/* Safe to use function to append a string, will abort program for overflow. */\nextern void appendCharSafe(char *target, char c, size_t buffer_size);\nextern void appendStringSafe(char *target, char const *source, size_t buffer_size);\n\n/* Safe to use functions to append a wide char string, will abort program for overflow. */\nextern void appendCharSafeW(wchar_t *target, char c, size_t buffer_size);\nextern void appendStringSafeW(wchar_t *target, char const *source, size_t buffer_size);\nextern void appendWStringSafeW(wchar_t *target, wchar_t const *source, size_t buffer_size);\n\n/* Get OS error code and print it to stderr. */\n#ifdef _WIN32\ntypedef DWORD error_code_t;\n#define ERROR_CODE_FORMAT_STR \"%ld\"\nstatic inline error_code_t getCurrentErrorCode(void) { return GetLastError(); }\n#else\ntypedef int error_code_t;\n#define ERROR_CODE_FORMAT_STR \"%d\"\nstatic inline error_code_t getCurrentErrorCode(void) { return errno; }\n#endif\nextern void printOSErrorMessage(char const *message, error_code_t error_code);\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/threading.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_THREADING_H__\n#define __NUITKA_THREADING_H__\n\n#if PYTHON_VERSION < 0x300\n// We share this with CPython bytecode main loop.\nPyAPI_DATA(volatile int) _Py_Ticker;\n#else\nextern volatile int _Py_Ticker;\n#define _Py_CheckInterval 20\n#endif\n\n#ifdef NUITKA_USE_PYCORE_THREAD_STATE\n\n#if PYTHON_VERSION < 0x380\n// Signals pending got their own indicator only in 3.8, covered by calls to do before.\n#define HAS_WORK_TO_DO(ceval, ceval2) (ceval2->pending.calls_to_do._value)\n#else\n#define HAS_WORK_TO_DO(ceval, ceval2) (ceval->signals_pending._value || ceval2->pending.calls_to_do._value)\n#endif\n\nNUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate) {\n#if PYTHON_VERSION >= 0x390\n    _PyRuntimeState *const runtime = tstate->interp->runtime;\n#else\n    _PyRuntimeState *const runtime = &_PyRuntime;\n#endif\n\n    // This was split in 2 parts in 3.9 or higher.\n    struct _ceval_runtime_state *ceval = &runtime->ceval;\n#if PYTHON_VERSION >= 0x390\n    struct _ceval_state *ceval2 = &tstate->interp->ceval;\n#else\n    struct _ceval_runtime_state *ceval2 = ceval;\n#endif\n\n    // Pending signals or calls to do\n    if (HAS_WORK_TO_DO(ceval, ceval2)) {\n        int res = Py_MakePendingCalls();\n\n        if (unlikely(res < 0 && HAS_ERROR_OCCURRED(tstate))) {\n            return false;\n        }\n    }\n\n#ifdef PY_NOGIL\n    /* load eval breaker */\n    uintptr_t b = _Py_atomic_load_uintptr(&tstate->eval_breaker);\n\n    /* GIL drop request */\n    if ((b & EVAL_PENDING_SIGNALS) != 0) {\n#else\n    /* GIL drop request */\n    if (ceval2->gil_drop_request._value) {\n#endif\n        /* Give another thread a chance */\n        PyEval_SaveThread();\n        PyEval_AcquireThread(tstate);\n    }\n\n    if (unlikely(tstate->async_exc != NULL)) {\n        PyObject *async_exc = tstate->async_exc;\n        tstate->async_exc = NULL;\n\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, async_exc);\n\n        return false;\n    }\n\n    return true;\n}\n\n#else\n\nNUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate) {\n    // Decrease ticker\n    if (--_Py_Ticker < 0) {\n        _Py_Ticker = _Py_CheckInterval;\n\n        int res = Py_MakePendingCalls();\n\n        if (unlikely(res < 0 && HAS_ERROR_OCCURRED(tstate))) {\n            return false;\n        }\n\n        if (PyEval_ThreadsInitialized()) {\n            // Release and acquire the GIL, it's very inefficient, because we\n            // don't even know if it makes sense to do it. A controlling thread\n            // should be used to determine if it's needed at all.\n            PyEval_SaveThread();\n            PyEval_AcquireThread(tstate);\n        }\n\n        if (unlikely(tstate->async_exc != NULL)) {\n            PyObject *async_exc = tstate->async_exc;\n            tstate->async_exc = NULL;\n\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, async_exc);\n\n            return false;\n        }\n    }\n\n    return true;\n}\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/tracing.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_TRACING_H__\n#define __NUITKA_TRACING_H__\n\n/* Stupid tracing, intended to help where debugging is not an option\n * and to give kind of progress record of startup and the running of\n * the program.\n */\n\n#ifdef _NUITKA_TRACE\n\n#define NUITKA_PRINT_TRACE(value)                                                                                      \\\n    {                                                                                                                  \\\n        puts(value);                                                                                                   \\\n        fflush(stdout);                                                                                                \\\n    }\n#define NUITKA_PRINTF_TRACE(...)                                                                                       \\\n    {                                                                                                                  \\\n        printf(__VA_ARGS__);                                                                                           \\\n        fflush(stdout);                                                                                                \\\n    }\n\n#else\n#define NUITKA_PRINT_TRACE(value)\n#define NUITKA_PRINTF_TRACE(...)\n\n#endif\n\n#if defined(_NUITKA_EXPERIMENTAL_SHOW_STARTUP_TIME)\n\n#if defined(_WIN32)\n\n#include <windows.h>\nstatic void inline PRINT_TIME_STAMP(void) {\n    SYSTEMTIME t;\n    GetSystemTime(&t); // or GetLocalTime(&t)\n    printf(\"%02d:%02d:%02d.%03d:\", t.wHour, t.wMinute, t.wSecond, t.wMilliseconds);\n}\n#else\nstatic void inline PRINT_TIME_STAMP(void) {\n    struct timeval tv;\n    gettimeofday(&tv, NULL);\n\n    time_t now_time = tv.tv_sec;\n    struct tm *now_tm = localtime(&now_time);\n\n    char tm_buf[64];\n    strftime(tm_buf, sizeof(tm_buf), \"%Y-%m-%d %H:%M:%S\", now_tm);\n    printf(\"%s.%03ld \", tm_buf, tv.tv_usec / 1000);\n}\n#endif\n\n#define NUITKA_PRINT_TIMING(value)                                                                                     \\\n    {                                                                                                                  \\\n        PRINT_TIME_STAMP();                                                                                            \\\n        puts(value);                                                                                                   \\\n        fflush(stdout);                                                                                                \\\n    }\n\n#else\n\n#define NUITKA_PRINT_TIMING(value) NUITKA_PRINT_TRACE(value)\n\n#endif\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/include/nuitka/unfreezing.h",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifndef __NUITKA_UNFREEZING_H__\n#define __NUITKA_UNFREEZING_H__\n\n#include <stdbool.h>\n\n/* Modes for loading modules, can be compiled, external shared library, or\n * bytecode. */\n#define NUITKA_COMPILED_MODULE 0\n#define NUITKA_EXTENSION_MODULE_FLAG 1\n#define NUITKA_PACKAGE_FLAG 2\n#define NUITKA_BYTECODE_FLAG 4\n\n#define NUITKA_ABORT_MODULE_FLAG 8\n\n#define NUITKA_TRANSLATED_FLAG 16\n\nstruct Nuitka_MetaPathBasedLoaderEntry;\n\ntypedef PyObject *(*module_initfunc)(PyThreadState *tstate, PyObject *module,\n                                     struct Nuitka_MetaPathBasedLoaderEntry const *loader_entry);\n\n#if PYTHON_VERSION >= 0x370 && defined(_NUITKA_EXE) && !defined(_NUITKA_STANDALONE) &&                                 \\\n    defined(_NUITKA_FILE_REFERENCE_ORIGINAL_MODE)\n#define _NUITKA_FREEZER_HAS_FILE_PATH\n#endif\n\nstruct Nuitka_MetaPathBasedLoaderEntry {\n    // Full module name, including package name.\n    char const *name;\n\n    // Entry function if compiled module, otherwise NULL.\n    module_initfunc python_initfunc;\n\n    // For bytecode modules, start and size inside the constants blob.\n    int bytecode_index;\n    int bytecode_size;\n\n    // Flags: Indicators if this is compiled, bytecode or shared library.\n    int flags;\n\n    // For accelerated mode, we need to be able to tell where the module \"__file__\"\n    // lives, so we can resolve resource reader paths, not relative to the binary\n    // but to code location without loading it.\n#if defined(_NUITKA_FREEZER_HAS_FILE_PATH)\n#if defined _WIN32\n    wchar_t const *file_path;\n#else\n    char const *file_path;\n#endif\n#endif\n};\n\n/* For embedded modules, register the meta path based loader. Used by main\n * program/package only.\n */\nextern void registerMetaPathBasedUnfreezer(struct Nuitka_MetaPathBasedLoaderEntry *loader_entries,\n                                           unsigned char **bytecode_data);\n\n/* Create a loader object responsible for a package. */\nextern PyObject *Nuitka_Loader_New(struct Nuitka_MetaPathBasedLoaderEntry const *entry);\n\n// Create a distribution object from the given metadata.\nextern PyObject *Nuitka_Distribution_New(PyThreadState *tstate, PyObject *name);\n\n// Check if we provide a distribution object ourselves.\nextern bool Nuitka_DistributionNext(Py_ssize_t *pos, PyObject **distribution_name_ptr);\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/inline_copy/appdirs/LICENSE.txt",
    "content": "# This is the MIT license\n\nCopyright (c) 2010 ActiveState Software Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/appdirs/appdirs.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2005-2010 ActiveState Software Inc.\n# Copyright (c) 2013 Eddy Petrișor\n\n\"\"\"Utilities for determining application-specific dirs.\n\nSee <http://github.com/ActiveState/appdirs> for details and usage.\n\"\"\"\n# Dev Notes:\n# - MSDN on where to store app data files:\n#   http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120\n# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html\n# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\n\n__version__ = \"1.4.4\"\n__version_info__ = tuple(int(segment) for segment in __version__.split(\".\"))\n\n\nimport sys\nimport os\n\nPY3 = sys.version_info[0] == 3\n\nif PY3:\n    unicode = str\n\nif sys.platform.startswith('java'):\n    import platform\n    os_name = platform.java_ver()[3][0]\n    if os_name.startswith('Windows'): # \"Windows XP\", \"Windows 7\", etc.\n        system = 'win32'\n    elif os_name.startswith('Mac'): # \"Mac OS X\", etc.\n        system = 'darwin'\n    else: # \"Linux\", \"SunOS\", \"FreeBSD\", etc.\n        # Setting this to \"linux2\" is not ideal, but only Windows or Mac\n        # are actually checked for and the rest of the module expects\n        # *sys.platform* style strings.\n        system = 'linux2'\nelse:\n    system = sys.platform\n\n\n\ndef user_data_dir(appname=None, appauthor=None, version=None, roaming=False):\n    r\"\"\"Return full path to the user-specific data dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"roaming\" (boolean, default False) can be set True to use the Windows\n            roaming appdata directory. That means that for users on a Windows\n            network setup for roaming profiles, this user data will be\n            sync'd on login. See\n            <http://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>\n            for a discussion of issues.\n\n    Typical user data directories are:\n        Mac OS X:               ~/Library/Application Support/<AppName>\n        Unix:                   ~/.local/share/<AppName>    # or in $XDG_DATA_HOME, if defined\n        Win XP (not roaming):   C:\\Documents and Settings\\<username>\\Application Data\\<AppAuthor>\\<AppName>\n        Win XP (roaming):       C:\\Documents and Settings\\<username>\\Local Settings\\Application Data\\<AppAuthor>\\<AppName>\n        Win 7  (not roaming):   C:\\Users\\<username>\\AppData\\Local\\<AppAuthor>\\<AppName>\n        Win 7  (roaming):       C:\\Users\\<username>\\AppData\\Roaming\\<AppAuthor>\\<AppName>\n\n    For Unix, we follow the XDG spec and support $XDG_DATA_HOME.\n    That means, by default \"~/.local/share/<AppName>\".\n    \"\"\"\n    if system == \"win32\":\n        if appauthor is None:\n            appauthor = appname\n        const = roaming and \"CSIDL_APPDATA\" or \"CSIDL_LOCAL_APPDATA\"\n        path = os.path.normpath(_get_win_folder(const))\n        if appname:\n            if appauthor is not False:\n                path = os.path.join(path, appauthor, appname)\n            else:\n                path = os.path.join(path, appname)\n    elif system == 'darwin':\n        path = os.path.expanduser('~/Library/Application Support/')\n        if appname:\n            path = os.path.join(path, appname)\n    else:\n        path = os.getenv('XDG_DATA_HOME', os.path.expanduser(\"~/.local/share\"))\n        if appname:\n            path = os.path.join(path, appname)\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\ndef site_data_dir(appname=None, appauthor=None, version=None, multipath=False):\n    r\"\"\"Return full path to the user-shared data dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"multipath\" is an optional parameter only applicable to *nix\n            which indicates that the entire list of data dirs should be\n            returned. By default, the first item from XDG_DATA_DIRS is\n            returned, or '/usr/local/share/<AppName>',\n            if XDG_DATA_DIRS is not set\n\n    Typical site data directories are:\n        Mac OS X:   /Library/Application Support/<AppName>\n        Unix:       /usr/local/share/<AppName> or /usr/share/<AppName>\n        Win XP:     C:\\Documents and Settings\\All Users\\Application Data\\<AppAuthor>\\<AppName>\n        Vista:      (Fail! \"C:\\ProgramData\" is a hidden *system* directory on Vista.)\n        Win 7:      C:\\ProgramData\\<AppAuthor>\\<AppName>   # Hidden, but writeable on Win 7.\n\n    For Unix, this is using the $XDG_DATA_DIRS[0] default.\n\n    WARNING: Do not use this on Windows. See the Vista-Fail note above for why.\n    \"\"\"\n    if system == \"win32\":\n        if appauthor is None:\n            appauthor = appname\n        path = os.path.normpath(_get_win_folder(\"CSIDL_COMMON_APPDATA\"))\n        if appname:\n            if appauthor is not False:\n                path = os.path.join(path, appauthor, appname)\n            else:\n                path = os.path.join(path, appname)\n    elif system == 'darwin':\n        path = os.path.expanduser('/Library/Application Support')\n        if appname:\n            path = os.path.join(path, appname)\n    else:\n        # XDG default for $XDG_DATA_DIRS\n        # only first, if multipath is False\n        path = os.getenv('XDG_DATA_DIRS',\n                         os.pathsep.join(['/usr/local/share', '/usr/share']))\n        pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)]\n        if appname:\n            if version:\n                appname = os.path.join(appname, version)\n            pathlist = [os.sep.join([x, appname]) for x in pathlist]\n\n        if multipath:\n            path = os.pathsep.join(pathlist)\n        else:\n            path = pathlist[0]\n        return path\n\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\ndef user_config_dir(appname=None, appauthor=None, version=None, roaming=False):\n    r\"\"\"Return full path to the user-specific config dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"roaming\" (boolean, default False) can be set True to use the Windows\n            roaming appdata directory. That means that for users on a Windows\n            network setup for roaming profiles, this user data will be\n            sync'd on login. See\n            <http://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>\n            for a discussion of issues.\n\n    Typical user config directories are:\n        Mac OS X:               same as user_data_dir\n        Unix:                   ~/.config/<AppName>     # or in $XDG_CONFIG_HOME, if defined\n        Win *:                  same as user_data_dir\n\n    For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME.\n    That means, by default \"~/.config/<AppName>\".\n    \"\"\"\n    if system in [\"win32\", \"darwin\"]:\n        path = user_data_dir(appname, appauthor, None, roaming)\n    else:\n        path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser(\"~/.config\"))\n        if appname:\n            path = os.path.join(path, appname)\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\ndef site_config_dir(appname=None, appauthor=None, version=None, multipath=False):\n    r\"\"\"Return full path to the user-shared data dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"multipath\" is an optional parameter only applicable to *nix\n            which indicates that the entire list of config dirs should be\n            returned. By default, the first item from XDG_CONFIG_DIRS is\n            returned, or '/etc/xdg/<AppName>', if XDG_CONFIG_DIRS is not set\n\n    Typical site config directories are:\n        Mac OS X:   same as site_data_dir\n        Unix:       /etc/xdg/<AppName> or $XDG_CONFIG_DIRS[i]/<AppName> for each value in\n                    $XDG_CONFIG_DIRS\n        Win *:      same as site_data_dir\n        Vista:      (Fail! \"C:\\ProgramData\" is a hidden *system* directory on Vista.)\n\n    For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False\n\n    WARNING: Do not use this on Windows. See the Vista-Fail note above for why.\n    \"\"\"\n    if system in [\"win32\", \"darwin\"]:\n        path = site_data_dir(appname, appauthor)\n        if appname and version:\n            path = os.path.join(path, version)\n    else:\n        # XDG default for $XDG_CONFIG_DIRS\n        # only first, if multipath is False\n        path = os.getenv('XDG_CONFIG_DIRS', '/etc/xdg')\n        pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)]\n        if appname:\n            if version:\n                appname = os.path.join(appname, version)\n            pathlist = [os.sep.join([x, appname]) for x in pathlist]\n\n        if multipath:\n            path = os.pathsep.join(pathlist)\n        else:\n            path = pathlist[0]\n    return path\n\n\ndef user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):\n    r\"\"\"Return full path to the user-specific cache dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"opinion\" (boolean) can be False to disable the appending of\n            \"Cache\" to the base app data dir for Windows. See\n            discussion below.\n\n    Typical user cache directories are:\n        Mac OS X:   ~/Library/Caches/<AppName>\n        Unix:       ~/.cache/<AppName> (XDG default)\n        Win XP:     C:\\Documents and Settings\\<username>\\Local Settings\\Application Data\\<AppAuthor>\\<AppName>\\Cache\n        Vista:      C:\\Users\\<username>\\AppData\\Local\\<AppAuthor>\\<AppName>\\Cache\n\n    On Windows the only suggestion in the MSDN docs is that local settings go in\n    the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming\n    app data dir (the default returned by `user_data_dir` above). Apps typically\n    put cache data somewhere *under* the given dir here. Some examples:\n        ...\\Mozilla\\Firefox\\Profiles\\<ProfileName>\\Cache\n        ...\\Acme\\SuperApp\\Cache\\1.0\n    OPINION: This function appends \"Cache\" to the `CSIDL_LOCAL_APPDATA` value.\n    This can be disabled with the `opinion=False` option.\n    \"\"\"\n    if system == \"win32\":\n        if appauthor is None:\n            appauthor = appname\n        path = os.path.normpath(_get_win_folder(\"CSIDL_LOCAL_APPDATA\"))\n        if appname:\n            if appauthor is not False:\n                path = os.path.join(path, appauthor, appname)\n            else:\n                path = os.path.join(path, appname)\n            if opinion:\n                path = os.path.join(path, \"Cache\")\n    elif system == 'darwin':\n        path = os.path.expanduser('~/Library/Caches')\n        if appname:\n            path = os.path.join(path, appname)\n    else:\n        path = os.getenv('XDG_CACHE_HOME', os.path.expanduser('~/.cache'))\n        if appname:\n            path = os.path.join(path, appname)\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\ndef user_state_dir(appname=None, appauthor=None, version=None, roaming=False):\n    r\"\"\"Return full path to the user-specific state dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"roaming\" (boolean, default False) can be set True to use the Windows\n            roaming appdata directory. That means that for users on a Windows\n            network setup for roaming profiles, this user data will be\n            sync'd on login. See\n            <http://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>\n            for a discussion of issues.\n\n    Typical user state directories are:\n        Mac OS X:  same as user_data_dir\n        Unix:      ~/.local/state/<AppName>   # or in $XDG_STATE_HOME, if defined\n        Win *:     same as user_data_dir\n\n    For Unix, we follow this Debian proposal <https://wiki.debian.org/XDGBaseDirectorySpecification#state>\n    to extend the XDG spec and support $XDG_STATE_HOME.\n\n    That means, by default \"~/.local/state/<AppName>\".\n    \"\"\"\n    if system in [\"win32\", \"darwin\"]:\n        path = user_data_dir(appname, appauthor, None, roaming)\n    else:\n        path = os.getenv('XDG_STATE_HOME', os.path.expanduser(\"~/.local/state\"))\n        if appname:\n            path = os.path.join(path, appname)\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\ndef user_log_dir(appname=None, appauthor=None, version=None, opinion=True):\n    r\"\"\"Return full path to the user-specific log dir for this application.\n\n        \"appname\" is the name of application.\n            If None, just the system directory is returned.\n        \"appauthor\" (only used on Windows) is the name of the\n            appauthor or distributing body for this application. Typically\n            it is the owning company name. This falls back to appname. You may\n            pass False to disable it.\n        \"version\" is an optional version path element to append to the\n            path. You might want to use this if you want multiple versions\n            of your app to be able to run independently. If used, this\n            would typically be \"<major>.<minor>\".\n            Only applied when appname is present.\n        \"opinion\" (boolean) can be False to disable the appending of\n            \"Logs\" to the base app data dir for Windows, and \"log\" to the\n            base cache dir for Unix. See discussion below.\n\n    Typical user log directories are:\n        Mac OS X:   ~/Library/Logs/<AppName>\n        Unix:       ~/.cache/<AppName>/log  # or under $XDG_CACHE_HOME if defined\n        Win XP:     C:\\Documents and Settings\\<username>\\Local Settings\\Application Data\\<AppAuthor>\\<AppName>\\Logs\n        Vista:      C:\\Users\\<username>\\AppData\\Local\\<AppAuthor>\\<AppName>\\Logs\n\n    On Windows the only suggestion in the MSDN docs is that local settings\n    go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in\n    examples of what some windows apps use for a logs dir.)\n\n    OPINION: This function appends \"Logs\" to the `CSIDL_LOCAL_APPDATA`\n    value for Windows and appends \"log\" to the user cache dir for Unix.\n    This can be disabled with the `opinion=False` option.\n    \"\"\"\n    if system == \"darwin\":\n        path = os.path.join(\n            os.path.expanduser('~/Library/Logs'),\n            appname)\n    elif system == \"win32\":\n        path = user_data_dir(appname, appauthor, version)\n        version = False\n        if opinion:\n            path = os.path.join(path, \"Logs\")\n    else:\n        path = user_cache_dir(appname, appauthor, version)\n        version = False\n        if opinion:\n            path = os.path.join(path, \"log\")\n    if appname and version:\n        path = os.path.join(path, version)\n    return path\n\n\nclass AppDirs(object):\n    \"\"\"Convenience wrapper for getting application dirs.\"\"\"\n    def __init__(self, appname=None, appauthor=None, version=None,\n            roaming=False, multipath=False):\n        self.appname = appname\n        self.appauthor = appauthor\n        self.version = version\n        self.roaming = roaming\n        self.multipath = multipath\n\n    @property\n    def user_data_dir(self):\n        return user_data_dir(self.appname, self.appauthor,\n                             version=self.version, roaming=self.roaming)\n\n    @property\n    def site_data_dir(self):\n        return site_data_dir(self.appname, self.appauthor,\n                             version=self.version, multipath=self.multipath)\n\n    @property\n    def user_config_dir(self):\n        return user_config_dir(self.appname, self.appauthor,\n                               version=self.version, roaming=self.roaming)\n\n    @property\n    def site_config_dir(self):\n        return site_config_dir(self.appname, self.appauthor,\n                             version=self.version, multipath=self.multipath)\n\n    @property\n    def user_cache_dir(self):\n        return user_cache_dir(self.appname, self.appauthor,\n                              version=self.version)\n\n    @property\n    def user_state_dir(self):\n        return user_state_dir(self.appname, self.appauthor,\n                              version=self.version)\n\n    @property\n    def user_log_dir(self):\n        return user_log_dir(self.appname, self.appauthor,\n                            version=self.version)\n\n\n#---- internal support stuff\n\ndef _get_win_folder_from_registry(csidl_name):\n    \"\"\"This is a fallback technique at best. I'm not sure if using the\n    registry for this guarantees us the correct answer for all CSIDL_*\n    names.\n    \"\"\"\n    if PY3:\n      import winreg as _winreg\n    else:\n      import _winreg\n\n    shell_folder_name = {\n        \"CSIDL_APPDATA\": \"AppData\",\n        \"CSIDL_COMMON_APPDATA\": \"Common AppData\",\n        \"CSIDL_LOCAL_APPDATA\": \"Local AppData\",\n    }[csidl_name]\n\n    key = _winreg.OpenKey(\n        _winreg.HKEY_CURRENT_USER,\n        r\"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\"\n    )\n    dir, type = _winreg.QueryValueEx(key, shell_folder_name)\n    return dir\n\n\ndef _get_win_folder_with_pywin32(csidl_name):\n    from win32com.shell import shellcon, shell\n    dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)\n    # Try to make this a unicode path because SHGetFolderPath does\n    # not return unicode strings when there is unicode data in the\n    # path.\n    try:\n        dir = unicode(dir)\n\n        # Downgrade to short path name if have highbit chars. See\n        # <http://bugs.activestate.com/show_bug.cgi?id=85099>.\n        has_high_char = False\n        for c in dir:\n            if ord(c) > 255:\n                has_high_char = True\n                break\n        if has_high_char:\n            try:\n                import win32api\n                dir = win32api.GetShortPathName(dir)\n            except ImportError:\n                pass\n    except UnicodeError:\n        pass\n    return dir\n\n\ndef _get_win_folder_with_ctypes(csidl_name):\n    import ctypes\n\n    csidl_const = {\n        \"CSIDL_APPDATA\": 26,\n        \"CSIDL_COMMON_APPDATA\": 35,\n        \"CSIDL_LOCAL_APPDATA\": 28,\n    }[csidl_name]\n\n    buf = ctypes.create_unicode_buffer(1024)\n    ctypes.windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf)\n\n    # Downgrade to short path name if have highbit chars. See\n    # <http://bugs.activestate.com/show_bug.cgi?id=85099>.\n    has_high_char = False\n    for c in buf:\n        if ord(c) > 255:\n            has_high_char = True\n            break\n    if has_high_char:\n        buf2 = ctypes.create_unicode_buffer(1024)\n        if ctypes.windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024):\n            buf = buf2\n\n    return buf.value\n\ndef _get_win_folder_with_jna(csidl_name):\n    import array\n    from com.sun import jna\n    from com.sun.jna.platform import win32\n\n    buf_size = win32.WinDef.MAX_PATH * 2\n    buf = array.zeros('c', buf_size)\n    shell = win32.Shell32.INSTANCE\n    shell.SHGetFolderPath(None, getattr(win32.ShlObj, csidl_name), None, win32.ShlObj.SHGFP_TYPE_CURRENT, buf)\n    dir = jna.Native.toString(buf.tostring()).rstrip(\"\\0\")\n\n    # Downgrade to short path name if have highbit chars. See\n    # <http://bugs.activestate.com/show_bug.cgi?id=85099>.\n    has_high_char = False\n    for c in dir:\n        if ord(c) > 255:\n            has_high_char = True\n            break\n    if has_high_char:\n        buf = array.zeros('c', buf_size)\n        kernel = win32.Kernel32.INSTANCE\n        if kernel.GetShortPathName(dir, buf, buf_size):\n            dir = jna.Native.toString(buf.tostring()).rstrip(\"\\0\")\n\n    return dir\n\nif system == \"win32\":\n    try:\n        # Nuitka: Lets not use pywin32, ctypes will do for us more reliable.\n        raise ImportError\n\n        import win32com.shell\n        _get_win_folder = _get_win_folder_with_pywin32\n    except ImportError:\n        try:\n            from ctypes import windll\n            _get_win_folder = _get_win_folder_with_ctypes\n        except ImportError:\n            try:\n                import com.sun.jna\n                _get_win_folder = _get_win_folder_with_jna\n            except ImportError:\n                _get_win_folder = _get_win_folder_from_registry\n\n\n#---- self test code\n\nif __name__ == \"__main__\":\n    appname = \"MyApp\"\n    appauthor = \"MyCompany\"\n\n    props = (\"user_data_dir\",\n             \"user_config_dir\",\n             \"user_cache_dir\",\n             \"user_state_dir\",\n             \"user_log_dir\",\n             \"site_data_dir\",\n             \"site_config_dir\")\n\n    print(\"-- app dirs %s --\" % __version__)\n\n    print(\"-- app dirs (with optional 'version')\")\n    dirs = AppDirs(appname, appauthor, version=\"1.0\")\n    for prop in props:\n        print(\"%s: %s\" % (prop, getattr(dirs, prop)))\n\n    print(\"\\n-- app dirs (without optional 'version')\")\n    dirs = AppDirs(appname, appauthor)\n    for prop in props:\n        print(\"%s: %s\" % (prop, getattr(dirs, prop)))\n\n    print(\"\\n-- app dirs (without optional 'appauthor')\")\n    dirs = AppDirs(appname)\n    for prop in props:\n        print(\"%s: %s\" % (prop, getattr(dirs, prop)))\n\n    print(\"\\n-- app dirs (with disabled 'appauthor')\")\n    dirs = AppDirs(appname, appauthor=False)\n    for prop in props:\n        print(\"%s: %s\" % (prop, getattr(dirs, prop)))\n"
  },
  {
    "path": "nuitka/build/inline_copy/atomicwrites/LICENSE",
    "content": "Copyright (c) 2015-2016 Markus Unterwaditzer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/atomicwrites/atomicwrites.py",
    "content": "import contextlib\nimport io\nimport os\nimport sys\nimport tempfile\n\ntry:\n    import fcntl\nexcept ImportError:\n    fcntl = None\n\n# `fspath` was added in Python 3.6\ntry:\n    from os import fspath\nexcept ImportError:\n    fspath = None\n\n__version__ = '1.4.0'\n\n\nPY2 = sys.version_info[0] == 2\n\ntext_type = unicode if PY2 else str  # noqa\n\n\ndef _path_to_unicode(x):\n    if not isinstance(x, text_type):\n        return x.decode(sys.getfilesystemencoding())\n    return x\n\n\nDEFAULT_MODE = \"wb\" if PY2 else \"w\"\n\n\n_proper_fsync = os.fsync\n\n\nif sys.platform != 'win32':\n    if hasattr(fcntl, 'F_FULLFSYNC'):\n        def _proper_fsync(fd):\n            # https://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072.html\n            # https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/fsync.2.html\n            # https://github.com/untitaker/python-atomicwrites/issues/6\n            fcntl.fcntl(fd, fcntl.F_FULLFSYNC)\n\n    def _sync_directory(directory):\n        # Ensure that filenames are written to disk\n        fd = os.open(directory, 0)\n        try:\n            _proper_fsync(fd)\n        finally:\n            os.close(fd)\n\n    def _replace_atomic(src, dst):\n        os.rename(src, dst)\n        _sync_directory(os.path.normpath(os.path.dirname(dst)))\n\n    def _move_atomic(src, dst):\n        os.link(src, dst)\n        os.unlink(src)\n\n        src_dir = os.path.normpath(os.path.dirname(src))\n        dst_dir = os.path.normpath(os.path.dirname(dst))\n        _sync_directory(dst_dir)\n        if src_dir != dst_dir:\n            _sync_directory(src_dir)\nelse:\n    from ctypes import windll, WinError\n\n    _MOVEFILE_REPLACE_EXISTING = 0x1\n    _MOVEFILE_WRITE_THROUGH = 0x8\n    _windows_default_flags = _MOVEFILE_WRITE_THROUGH\n\n    def _handle_errors(rv):\n        if not rv:\n            raise WinError()\n\n    def _replace_atomic(src, dst):\n        _handle_errors(windll.kernel32.MoveFileExW(\n            _path_to_unicode(src), _path_to_unicode(dst),\n            _windows_default_flags | _MOVEFILE_REPLACE_EXISTING\n        ))\n\n    def _move_atomic(src, dst):\n        _handle_errors(windll.kernel32.MoveFileExW(\n            _path_to_unicode(src), _path_to_unicode(dst),\n            _windows_default_flags\n        ))\n\n\ndef replace_atomic(src, dst):\n    '''\n    Move ``src`` to ``dst``. If ``dst`` exists, it will be silently\n    overwritten.\n\n    Both paths must reside on the same filesystem for the operation to be\n    atomic.\n    '''\n    return _replace_atomic(src, dst)\n\n\ndef move_atomic(src, dst):\n    '''\n    Move ``src`` to ``dst``. There might a timewindow where both filesystem\n    entries exist. If ``dst`` already exists, :py:exc:`FileExistsError` will be\n    raised.\n\n    Both paths must reside on the same filesystem for the operation to be\n    atomic.\n    '''\n    return _move_atomic(src, dst)\n\n\nclass AtomicWriter(object):\n    '''\n    A helper class for performing atomic writes. Usage::\n\n        with AtomicWriter(path).open() as f:\n            f.write(...)\n\n    :param path: The destination filepath. May or may not exist.\n    :param mode: The filemode for the temporary file. This defaults to `wb` in\n        Python 2 and `w` in Python 3.\n    :param overwrite: If set to false, an error is raised if ``path`` exists.\n        Errors are only raised after the file has been written to.  Either way,\n        the operation is atomic.\n\n    If you need further control over the exact behavior, you are encouraged to\n    subclass.\n    '''\n\n    def __init__(self, path, mode=DEFAULT_MODE, overwrite=False,\n                 **open_kwargs):\n        if 'a' in mode:\n            raise ValueError(\n                'Appending to an existing file is not supported, because that '\n                'would involve an expensive `copy`-operation to a temporary '\n                'file. Open the file in normal `w`-mode and copy explicitly '\n                'if that\\'s what you\\'re after.'\n            )\n        if 'x' in mode:\n            raise ValueError('Use the `overwrite`-parameter instead.')\n        if 'w' not in mode:\n            raise ValueError('AtomicWriters can only be written to.')\n\n        # Attempt to convert `path` to `str` or `bytes`\n        if fspath is not None:\n            path = fspath(path)\n\n        self._path = path\n        self._mode = mode\n        self._overwrite = overwrite\n        self._open_kwargs = open_kwargs\n\n    def open(self):\n        '''\n        Open the temporary file.\n        '''\n        return self._open(self.get_fileobject)\n\n    @contextlib.contextmanager\n    def _open(self, get_fileobject):\n        f = None  # make sure f exists even if get_fileobject() fails\n        try:\n            success = False\n            with get_fileobject(**self._open_kwargs) as f:\n                yield f\n                self.sync(f)\n            self.commit(f)\n            success = True\n        finally:\n            if not success:\n                try:\n                    self.rollback(f)\n                except Exception:\n                    pass\n\n    def get_fileobject(self, suffix=\"\", prefix=tempfile.gettempprefix(),\n                       dir=None, **kwargs):\n        '''Return the temporary file to use.'''\n        if dir is None:\n            dir = os.path.normpath(os.path.dirname(self._path))\n        descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,\n                                            dir=dir)\n        # io.open() will take either the descriptor or the name, but we need\n        # the name later for commit()/replace_atomic() and couldn't find a way\n        # to get the filename from the descriptor.\n        os.close(descriptor)\n        kwargs['mode'] = self._mode\n        kwargs['file'] = name\n        return io.open(**kwargs)\n\n    def sync(self, f):\n        '''responsible for clearing as many file caches as possible before\n        commit'''\n        f.flush()\n        _proper_fsync(f.fileno())\n\n    def commit(self, f):\n        '''Move the temporary file to the target location.'''\n        if self._overwrite:\n            replace_atomic(f.name, self._path)\n        else:\n            move_atomic(f.name, self._path)\n\n    def rollback(self, f):\n        '''Clean up all temporary resources.'''\n        os.unlink(f.name)\n\n\ndef atomic_write(path, writer_cls=AtomicWriter, **cls_kwargs):\n    '''\n    Simple atomic writes. This wraps :py:class:`AtomicWriter`::\n\n        with atomic_write(path) as f:\n            f.write(...)\n\n    :param path: The target path to write to.\n    :param writer_cls: The writer class to use. This parameter is useful if you\n        subclassed :py:class:`AtomicWriter` to change some behavior and want to\n        use that new subclass.\n\n    Additional keyword arguments are passed to the writer class. See\n    :py:class:`AtomicWriter`.\n    '''\n    return writer_cls(path, **cls_kwargs).open()\n"
  },
  {
    "path": "nuitka/build/inline_copy/bin/scons.py",
    "content": "#!/usr/bin/env python\n\n\"\"\" This is our runner for the inline copy of scons.\n\nIt dispatches based on the Python version it is running in, with 2.6 using a\nvery old version. Once scons stops supporting Python2.7 as well, we might have\nto add another one.\n\n\"\"\"\n\nif __name__ == \"__main__\":\n    import hashlib\n    import os\n    import sys\n\n    if sys.version_info >= (3, 0) and sys.version_info < (3, 5):\n        sys.exit(\"Error, scons must not be run with Python3 older than 3.5.\")\n\n    if sys.version_info < (2, 7):\n        # Non-Windows, Python 2.6, mostly older RHEL\n        scons_version = \"scons-2.3.2\"\n    elif os.name == \"nt\" and sys.version_info >= (3, 5):\n        # Windows can use latest, supported MSVC 2022 this way\n        scons_version = \"scons-4.3.0\"\n    else:\n        # Everything else 2.7 or higher works with this.\n        scons_version = \"scons-3.1.2\"\n\n    sys.path.insert(\n        0,\n        os.path.abspath(\n            os.path.normpath(\n                os.path.join(os.path.dirname(__file__), \"..\", \"lib\", scons_version),\n            )\n        ),\n    )\n\n    # On Windows this Scons variable must be set by us.\n    os.environ[\"SCONS_LIB_DIR\"] = sys.path[0]\n\n    # Workaround for FIPS enabled systems.\n    try:\n        hashlib.md5()\n    except ValueError:\n        # On FIPS compliant systems, checks might be enabled that require this\n        # parameter to be set.\n        _md5 = hashlib.md5\n\n        def md5(value=b\"\"):\n            return _md5(value, usedforsecurity=False)\n\n        hashlib.md5 = md5\n\n    import SCons.Script  # pylint: disable=import-error\n\n    # this does all the work, and calls sys.exit\n    # with the proper exit status when done.\n    SCons.Script.main()\n"
  },
  {
    "path": "nuitka/build/inline_copy/clcache/clcache/LICENSE",
    "content": "Copyright (c)\n  2010, 2011, 2012, 2013, 2016 froglogic GmbH <raabe@froglogic.com>\n  2016 Simon Warta (Kullo GmbH)\n  2016 Tim Blechmann\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/clcache/clcache/__init__.py",
    "content": "\"\"\" clcache package \"\"\"\n\nfrom __future__ import absolute_import\nfrom .caching import VERSION\n"
  },
  {
    "path": "nuitka/build/inline_copy/clcache/clcache/caching.py",
    "content": "\"\"\" Clcache module with core caching functionality. \"\"\"\n\n# This file is part of the clcache project.\n#\n# The contents of this file are subject to the BSD 3-Clause License, the\n# full text of which is available in the accompanying LICENSE file at the\n# root directory of this project.\n#\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nimport codecs\nimport concurrent.futures\nimport contextlib\nimport errno\nimport gzip\nimport hashlib\nimport json\nimport multiprocessing\nimport os\nimport pickle\nimport re\nimport subprocess\nimport sys\nimport threading\nfrom collections import defaultdict, namedtuple\nfrom copy import copy\nfrom ctypes import windll, wintypes\nfrom shutil import copyfile, copyfileobj, rmtree\nfrom tempfile import TemporaryFile\n\nfrom atomicwrites import atomic_write\nfrom io import open\n\nfrom nuitka.utils.Utils import decoratorRetries\nfrom nuitka.Tracing import general\n\nVERSION = \"5.0.0-dev\"\n\nHashAlgorithm = hashlib.md5\n\nOUTPUT_LOCK = threading.Lock()\n\n# try to use os.scandir or scandir.scandir\n# fall back to os.listdir if not found\n# same for scandir.walk\ntry:\n    import scandir\n\n    WALK = scandir.walk\n    LIST = scandir.scandir\nexcept ImportError:\n    WALK = os.walk\n    try:\n        LIST = os.scandir  # type: ignore # pylint: disable=I0021,no-name-in-module\n    except AttributeError:\n        LIST = os.listdir\n\n# The codec that is used by clcache to store compiler STDOUR and STDERR in\n# output.txt and stderr.txt.\n# This codec is up to us and only used for clcache internal storage.\n# For possible values see https://docs.python.org/2/library/codecs.html\nCACHE_COMPILER_OUTPUT_STORAGE_CODEC = \"utf-8\"\n\n# The cl default codec\nCL_DEFAULT_CODEC = \"mbcs\"\n\n# Manifest file will have at most this number of hash lists in it. Need to avoi\n# manifests grow too large.\nMAX_MANIFEST_HASHES = 100\n\n# String, by which BASE_DIR will be replaced in paths, stored in manifests.\n# ? is invalid character for file name, so it seems ok\n# to use it as mark for relative path.\nBASEDIR_REPLACEMENT = \"?\"\n\n# Define some Win32 API constants here to avoid dependency on win32pipe\nNMPWAIT_WAIT_FOREVER = wintypes.DWORD(0xFFFFFFFF)\nERROR_PIPE_BUSY = 231\n\n# ManifestEntry: an entry in a manifest file\n# `includeFiles`: list of paths to include files, which this source file uses\n# `includesContentsHash`: hash of the contents of the includeFiles\n# `objectHash`: hash of the object in cache\nManifestEntry = namedtuple(\n    \"ManifestEntry\", [\"includeFiles\", \"includesContentHash\", \"objectHash\"]\n)\n\nCompilerArtifacts = namedtuple(\n    \"CompilerArtifacts\", [\"objectFilePath\", \"stdout\", \"stderr\"]\n)\n\n\ndef printBinary(stream, rawData):\n    with OUTPUT_LOCK:\n        stream.buffer.write(rawData)\n        stream.flush()\n\n\ndef basenameWithoutExtension(path):\n    basename = os.path.basename(path)\n    return os.path.splitext(basename)[0]\n\n\ndef filesBeneath(baseDir):\n    for path, _, filenames in WALK(baseDir):\n        for filename in filenames:\n            yield os.path.join(path, filename)\n\n\ndef childDirectories(path, absolute=True):\n    supportsScandir = LIST != os.listdir  # pylint: disable=comparison-with-callable\n    for entry in LIST(path):\n        if supportsScandir:\n            if entry.is_dir():\n                yield entry.path if absolute else entry.name\n        else:\n            absPath = os.path.join(path, entry)\n            if os.path.isdir(absPath):\n                yield absPath if absolute else entry\n\n\ndef normalizeBaseDir(baseDir):\n    if baseDir:\n        baseDir = os.path.normcase(baseDir)\n        if baseDir.endswith(os.path.sep):\n            baseDir = baseDir[0:-1]\n        return baseDir\n    else:\n        # Converts empty string to None\n        return None\n\n\ndef getCachedCompilerConsoleOutput(path):\n    try:\n        with open(path, \"rb\") as f:\n            return f.read().decode(CACHE_COMPILER_OUTPUT_STORAGE_CODEC)\n    except IOError:\n        return \"\"\n\n\ndef setCachedCompilerConsoleOutput(path, output):\n    with open(path, \"wb\") as f:\n        f.write(output.encode(CACHE_COMPILER_OUTPUT_STORAGE_CODEC))\n\n\nclass IncludeNotFoundException(Exception):\n    pass\n\n\nclass CacheLockException(Exception):\n    pass\n\n\nclass CompilerFailedException(Exception):\n    def __init__(self, exitCode, msgErr, msgOut=\"\"):\n        Exception.__init__(self, msgErr)\n        self.exitCode = exitCode\n        self.msgOut = msgOut\n        self.msgErr = msgErr\n\n    def getReturnTuple(self):\n        return self.exitCode, self.msgErr, self.msgOut, False\n\n\nclass Manifest(object):\n    def __init__(self, entries=None):\n        if entries is None:\n            entries = []\n        self._entries = copy(entries)\n\n    def entries(self):\n        return self._entries\n\n    def addEntry(self, entry):\n        \"\"\"Adds entry at the top of the entries\"\"\"\n        self._entries.insert(0, entry)\n\n    def touchEntry(self, objectHash):\n        \"\"\"Moves entry in entryIndex position to the top of entries()\"\"\"\n        entryIndex = next(\n            (i for i, e in enumerate(self.entries()) if e.objectHash == objectHash), 0\n        )\n        self._entries.insert(0, self._entries.pop(entryIndex))\n\n\nclass ManifestSection(object):\n    def __init__(self, manifestSectionDir):\n        self.manifestSectionDir = manifestSectionDir\n        self.lock = CacheLock.forPath(self.manifestSectionDir)\n\n    def manifestPath(self, manifestHash):\n        return os.path.join(self.manifestSectionDir, manifestHash + \".json\")\n\n    def manifestFiles(self):\n        return filesBeneath(self.manifestSectionDir)\n\n    def setManifest(self, manifestHash, manifest):\n        manifestPath = self.manifestPath(manifestHash)\n        printTraceStatement(\n            \"Writing manifest with manifestHash = {} to {}\".format(\n                manifestHash, manifestPath\n            )\n        )\n        ensureDirectoryExists(self.manifestSectionDir)\n        with atomic_write(manifestPath, overwrite=True) as outFile:\n            # Converting namedtuple to JSON via OrderedDict preserves key names and keys order\n            entries = [e._asdict() for e in manifest.entries()]\n            jsonobject = {\"entries\": entries}\n            json.dump(jsonobject, outFile, sort_keys=True, indent=2)\n\n    def getManifest(self, manifestHash):\n        fileName = self.manifestPath(manifestHash)\n        if not os.path.exists(fileName):\n            return None\n        try:\n            with open(fileName, \"r\") as inFile:\n                doc = json.load(inFile)\n                return Manifest(\n                    [\n                        ManifestEntry(\n                            e[\"includeFiles\"], e[\"includesContentHash\"], e[\"objectHash\"]\n                        )\n                        for e in doc[\"entries\"]\n                    ]\n                )\n        except IOError:\n            return None\n        except ValueError:\n            printErrStr(\"clcache: manifest file %s was broken\" % fileName)\n            return None\n\n\n@contextlib.contextmanager\ndef allSectionsLocked(repository):\n    sections = list(repository.sections())\n    for section in sections:\n        section.lock.acquire()\n    try:\n        yield\n    finally:\n        for section in sections:\n            section.lock.release()\n\n\nclass ManifestRepository(object):\n    # Bump this counter whenever the current manifest file format changes.\n    # E.g. changing the file format from {'oldkey': ...} to {'newkey': ...} requires\n    # invalidation, such that a manifest that was stored using the old format is not\n    # interpreted using the new format. Instead the old file will not be touched\n    # again due to a new manifest hash and is cleaned away after some time.\n    MANIFEST_FILE_FORMAT_VERSION = 6\n\n    def __init__(self, manifestsRootDir):\n        self._manifestsRootDir = manifestsRootDir\n\n    def section(self, manifestHash):\n        return ManifestSection(os.path.join(self._manifestsRootDir, manifestHash[:3]))\n\n    def sections(self):\n        return (\n            ManifestSection(path) for path in childDirectories(self._manifestsRootDir)\n        )\n\n    def clean(self, maxManifestsSize):\n        manifestFileInfos = []\n        for section in self.sections():\n            for filePath in section.manifestFiles():\n                try:\n                    manifestFileInfos.append((os.stat(filePath), filePath))\n                except OSError:\n                    pass\n\n        manifestFileInfos.sort(key=lambda t: t[0].st_atime, reverse=True)\n\n        remainingObjectsSize = 0\n        for stat, filepath in manifestFileInfos:\n            if remainingObjectsSize + stat.st_size <= maxManifestsSize:\n                remainingObjectsSize += stat.st_size\n            else:\n                os.remove(filepath)\n        return remainingObjectsSize\n\n    @staticmethod\n    def getManifestHash(compilerBinary, commandLine, sourceFile):\n        compilerHash = getCompilerHash(compilerBinary)\n\n        # NOTE: We intentionally do not normalize command line to include\n        # preprocessor options.  In direct mode we do not perform preprocessing\n        # before cache lookup, so all parameters are important.  One of the few\n        # exceptions to this rule is the /MP switch, which only defines how many\n        # compiler processes are running simultaneously.  Arguments that specify\n        # the compiler where to find the source files are parsed to replace\n        # occurrences of CLCACHE_BASEDIR by a placeholder.\n        arguments, inputFiles = CommandLineAnalyzer.parseArgumentsAndInputFiles(\n            commandLine\n        )\n        collapseBasedirInCmdPath = lambda path: collapseBasedirToPlaceholder(\n            os.path.normcase(os.path.abspath(path))\n        )\n\n        commandLine = []\n        argumentsWithPaths = (\"AI\", \"I\", \"FU\")\n        for k in sorted(arguments.keys()):\n            if k in argumentsWithPaths:\n                commandLine.extend(\n                    [\"/\" + k + collapseBasedirInCmdPath(arg) for arg in arguments[k]]\n                )\n            else:\n                commandLine.extend([\"/\" + k + arg for arg in arguments[k]])\n\n        commandLine.extend(collapseBasedirInCmdPath(arg) for arg in inputFiles)\n\n        additionalData = \"{}|{}|{}\".format(\n            compilerHash, commandLine, ManifestRepository.MANIFEST_FILE_FORMAT_VERSION\n        )\n        return getFileHash(sourceFile, additionalData)\n\n    @staticmethod\n    def getIncludesContentHashForFiles(includes):\n        try:\n            listOfHashes = getFileHashes(includes)\n        except FileNotFoundError:\n            raise IncludeNotFoundException\n        return ManifestRepository.getIncludesContentHashForHashes(listOfHashes)\n\n    @staticmethod\n    def getIncludesContentHashForHashes(listOfHashes):\n        return HashAlgorithm(\",\".join(listOfHashes).encode()).hexdigest()\n\n\n# Lets be inefficient and have just one lock for all things, won't be a big deal\n# if it's only used for stats.\nfrom threading import RLock\ncache_lock = RLock()\n\nclass CacheLock2(object):\n    \"\"\"Implement a lock inside the process only. \"\"\"\n\n    def __init__(self):\n        self._rlock = None\n\n    def __enter__(self):\n        cache_lock.acquire()\n\n    def __exit__(self, typ, value, traceback):\n        cache_lock.release()\n\n    @staticmethod\n    def forPath(path):\n        return CacheLock2()\n\nclass CacheLock(object):\n    \"\"\"Implements a lock for the object cache which\n    can be used in 'with' statements.\"\"\"\n\n    INFINITE = 0xFFFFFFFF\n    WAIT_ABANDONED_CODE = 0x00000080\n    WAIT_TIMEOUT_CODE = 0x00000102\n\n    def __init__(self, mutexName, timeoutMs):\n        self._mutexName = u\"Local\\\\\" + mutexName\n        self._mutex = None\n        self._timeoutMs = timeoutMs\n\n    def createMutex(self):\n        with CacheLock2():\n            self._mutex = windll.kernel32.CreateMutexW(\n                None, wintypes.BOOL(False), self._mutexName\n            )\n            assert self._mutex\n\n    def __enter__(self):\n        self.acquire()\n\n    def __exit__(self, typ, value, traceback):\n        self.release()\n\n    def __del__(self):\n        if self._mutex:\n            windll.kernel32.CloseHandle(self._mutex)\n\n    def acquire(self):\n        if not self._mutex:\n            self.createMutex()\n        result = windll.kernel32.WaitForSingleObject(\n            self._mutex, wintypes.INT(self._timeoutMs)\n        )\n\n\n        if result not in [0, self.WAIT_ABANDONED_CODE]:\n            # Nuitka: Just give up\n            return\n\n            if result == self.WAIT_TIMEOUT_CODE:\n                errorString = (\n                    \"Failed to acquire lock {} after {}ms; \"\n                    \"try setting CLCACHE_OBJECT_CACHE_TIMEOUT_MS environment variable to a larger value.\".format(\n                        self._mutexName, self._timeoutMs\n                    )\n                )\n            else:\n                errorString = \"Error! WaitForSingleObject returns {result}, last error {error}\".format(\n                    result=result, error=windll.kernel32.GetLastError()\n                )\n            raise CacheLockException(errorString)\n\n    def release(self):\n        windll.kernel32.ReleaseMutex(self._mutex)\n\n    @staticmethod\n    def forPath(path):\n        timeoutMs = int(os.environ.get(\"CLCACHE_OBJECT_CACHE_TIMEOUT_MS\", 10 * 1000))\n        lockName = path.replace(\":\", \"-\").replace(\"\\\\\", \"-\")\n        return CacheLock(lockName, timeoutMs)\n\n\nclass CompilerArtifactsSection(object):\n    OBJECT_FILE = \"object\"\n    STDOUT_FILE = \"output.txt\"\n    STDERR_FILE = \"stderr.txt\"\n\n    def __init__(self, compilerArtifactsSectionDir):\n        self.compilerArtifactsSectionDir = compilerArtifactsSectionDir\n        self.lock = CacheLock.forPath(self.compilerArtifactsSectionDir)\n\n    def cacheEntryDir(self, key):\n        return os.path.join(self.compilerArtifactsSectionDir, key)\n\n    def cacheEntries(self):\n        return childDirectories(self.compilerArtifactsSectionDir, absolute=False)\n\n    def cachedObjectName(self, key):\n        return os.path.join(\n            self.cacheEntryDir(key), CompilerArtifactsSection.OBJECT_FILE\n        )\n\n    def hasEntry(self, key):\n        return os.path.exists(self.cacheEntryDir(key))\n\n    def setEntry(self, key, artifacts):\n        cacheEntryDir = self.cacheEntryDir(key)\n        # Write new files to a temporary directory\n        tempEntryDir = cacheEntryDir + \".new\"\n        # Remove any possible left-over in tempEntryDir from previous executions\n        rmtree(tempEntryDir, ignore_errors=True)\n        ensureDirectoryExists(tempEntryDir)\n        if artifacts.objectFilePath is not None:\n            dstFilePath = os.path.join(\n                tempEntryDir, CompilerArtifactsSection.OBJECT_FILE\n            )\n            copyOrLink(artifacts.objectFilePath, dstFilePath, True)\n            size = os.path.getsize(dstFilePath)\n        setCachedCompilerConsoleOutput(\n            os.path.join(tempEntryDir, CompilerArtifactsSection.STDOUT_FILE),\n            artifacts.stdout,\n        )\n        if artifacts.stderr != \"\":\n            setCachedCompilerConsoleOutput(\n                os.path.join(tempEntryDir, CompilerArtifactsSection.STDERR_FILE),\n                artifacts.stderr,\n            )\n        # Replace the full cache entry atomically\n        @decoratorRetries(\n            logger=general,\n            purpose=\"replace %r with %r\" % (cacheEntryDir, tempEntryDir),\n            consequence=\"aborting\",\n        )\n        def _replaceEntry():\n            os.replace(tempEntryDir, cacheEntryDir)\n\n        _replaceEntry()\n        return size\n\n    def getEntry(self, key):\n        assert self.hasEntry(key)\n        cacheEntryDir = self.cacheEntryDir(key)\n        return CompilerArtifacts(\n            os.path.join(cacheEntryDir, CompilerArtifactsSection.OBJECT_FILE),\n            getCachedCompilerConsoleOutput(\n                os.path.join(cacheEntryDir, CompilerArtifactsSection.STDOUT_FILE)\n            ),\n            getCachedCompilerConsoleOutput(\n                os.path.join(cacheEntryDir, CompilerArtifactsSection.STDERR_FILE)\n            ),\n        )\n\n\nclass CompilerArtifactsRepository(object):\n    def __init__(self, compilerArtifactsRootDir):\n        self._compilerArtifactsRootDir = compilerArtifactsRootDir\n\n    def section(self, key):\n        return CompilerArtifactsSection(\n            os.path.join(self._compilerArtifactsRootDir, key[:3])\n        )\n\n    def sections(self):\n        return (\n            CompilerArtifactsSection(path)\n            for path in childDirectories(self._compilerArtifactsRootDir)\n        )\n\n    def removeEntry(self, keyToBeRemoved):\n        compilerArtifactsDir = self.section(keyToBeRemoved).cacheEntryDir(\n            keyToBeRemoved\n        )\n        rmtree(compilerArtifactsDir, ignore_errors=True)\n\n    def clean(self, maxCompilerArtifactsSize):\n        objectInfos = []\n        for section in self.sections():\n            for cachekey in section.cacheEntries():\n                try:\n                    objectStat = os.stat(section.cachedObjectName(cachekey))\n                    objectInfos.append((objectStat, cachekey))\n                except OSError:\n                    pass\n\n        objectInfos.sort(key=lambda t: t[0].st_atime)\n\n        # compute real current size to fix up the stored cacheSize\n        currentSizeObjects = sum(x[0].st_size for x in objectInfos)\n\n        removedItems = 0\n        for stat, cachekey in objectInfos:\n            self.removeEntry(cachekey)\n            removedItems += 1\n            currentSizeObjects -= stat.st_size\n            if currentSizeObjects < maxCompilerArtifactsSize:\n                break\n\n        return len(objectInfos) - removedItems, currentSizeObjects\n\n    @staticmethod\n    def computeKeyDirect(manifestHash, includesContentHash):\n        # We must take into account manifestHash to avoid\n        # collisions when different source files use the same\n        # set of includes.\n        return getStringHash(manifestHash + includesContentHash)\n\n    @staticmethod\n    def computeKeyNodirect(compilerBinary, commandLine, environment):\n        ppcmd = [\"/EP\"] + [arg for arg in commandLine if arg not in (\"-c\", \"/c\")]\n\n        returnCode, preprocessedSourceCode, ppStderrBinary = invokeRealCompiler(\n            compilerBinary,\n            ppcmd,\n            captureOutput=True,\n            outputAsString=False,\n            environment=environment,\n        )\n\n        if returnCode != 0:\n            errMsg = (\n                ppStderrBinary.decode(CL_DEFAULT_CODEC)\n                + \"\\nclcache: preprocessor failed\"\n            )\n            raise CompilerFailedException(returnCode, errMsg)\n\n        compilerHash = getCompilerHash(compilerBinary)\n        normalizedCmdLine = CompilerArtifactsRepository._normalizedCommandLine(\n            commandLine\n        )\n\n        h = HashAlgorithm()\n        h.update(compilerHash.encode(\"UTF-8\"))\n        h.update(\" \".join(normalizedCmdLine).encode(\"UTF-8\"))\n        h.update(preprocessedSourceCode)\n        return h.hexdigest()\n\n    @staticmethod\n    def _normalizedCommandLine(cmdline):\n        # Remove all arguments from the command line which only influence the\n        # preprocessor; the preprocessor's output is already included into the\n        # hash sum so we don't have to care about these switches in the\n        # command line as well.\n        argsToStrip = (\n            \"AI\",\n            \"C\",\n            \"E\",\n            \"P\",\n            \"FI\",\n            \"u\",\n            \"X\",\n            \"FU\",\n            \"D\",\n            \"EP\",\n            \"Fx\",\n            \"U\",\n            \"I\",\n        )\n\n        # Also remove the switch for specifying the output file name; we don't\n        # want two invocations which are identical except for the output file\n        # name to be treated differently.\n        argsToStrip += (\"Fo\",)\n\n        # Also strip the switch for specifying the number of parallel compiler\n        # processes to use (when specifying multiple source files on the\n        # command line).\n        argsToStrip += (\"MP\",)\n\n        return [\n            arg\n            for arg in cmdline\n            if not (arg[0] in \"/-\" and arg[1:].startswith(argsToStrip))\n        ]\n\n\nclass CacheFileStrategy(object):\n    def __init__(self, cacheDirectory=None):\n        self.dir = cacheDirectory\n        if not self.dir:\n            try:\n                self.dir = os.environ[\"CLCACHE_DIR\"]\n            except KeyError:\n                self.dir = os.path.join(os.path.expanduser(\"~\"), \"clcache\")\n\n        manifestsRootDir = os.path.join(self.dir, \"manifests\")\n        ensureDirectoryExists(manifestsRootDir)\n        self.manifestRepository = ManifestRepository(manifestsRootDir)\n\n        compilerArtifactsRootDir = os.path.join(self.dir, \"objects\")\n        ensureDirectoryExists(compilerArtifactsRootDir)\n        self.compilerArtifactsRepository = CompilerArtifactsRepository(\n            compilerArtifactsRootDir\n        )\n\n        self.configuration = Configuration(os.path.join(self.dir, \"config.txt\"))\n\n        stats_filename = os.environ.get(\n            \"CLCACHE_STATS\", os.path.join(self.dir, \"stats.txt\")\n        )\n        self.statistics = Statistics(stats_filename)\n\n    def __str__(self):\n        return \"Disk cache at {}\".format(self.dir)\n\n    @property  # type: ignore\n    @contextlib.contextmanager\n    def lock(self):\n        with allSectionsLocked(self.manifestRepository), allSectionsLocked(\n            self.compilerArtifactsRepository\n        ):\n            yield\n\n    def lockFor(self, key):\n        assert isinstance(self.compilerArtifactsRepository.section(key).lock, CacheLock)\n        return self.compilerArtifactsRepository.section(key).lock\n\n    def manifestLockFor(self, key):\n        return self.manifestRepository.section(key).lock\n\n    def getEntry(self, key):\n        return self.compilerArtifactsRepository.section(key).getEntry(key)\n\n    def setEntry(self, key, value):\n        return self.compilerArtifactsRepository.section(key).setEntry(key, value)\n\n    def pathForObject(self, key):\n        return self.compilerArtifactsRepository.section(key).cachedObjectName(key)\n\n    def directoryForCache(self, key):\n        return self.compilerArtifactsRepository.section(key).cacheEntryDir(key)\n\n    def deserializeCacheEntry(self, key, objectData):\n        path = self.pathForObject(key)\n        ensureDirectoryExists(self.directoryForCache(key))\n        with open(path, \"wb\") as f:\n            f.write(objectData)\n        return path\n\n    def hasEntry(self, cachekey):\n        return self.compilerArtifactsRepository.section(cachekey).hasEntry(cachekey)\n\n    def setManifest(self, manifestHash, manifest):\n        self.manifestRepository.section(manifestHash).setManifest(\n            manifestHash, manifest\n        )\n\n    def getManifest(self, manifestHash):\n        return self.manifestRepository.section(manifestHash).getManifest(manifestHash)\n\n    def clean(self, stats, maximumSize):\n        currentSize = stats.currentCacheSize()\n        if currentSize < maximumSize:\n            return\n\n        # Free at least 10% to avoid cleaning up too often which\n        # is a big performance hit with large caches.\n        effectiveMaximumSizeOverall = maximumSize * 0.9\n\n        # Split limit in manifests (10 %) and objects (90 %)\n        effectiveMaximumSizeManifests = effectiveMaximumSizeOverall * 0.1\n        effectiveMaximumSizeObjects = (\n            effectiveMaximumSizeOverall - effectiveMaximumSizeManifests\n        )\n\n        # Clean manifests\n        currentSizeManifests = self.manifestRepository.clean(\n            effectiveMaximumSizeManifests\n        )\n\n        # Clean artifacts\n        (\n            currentCompilerArtifactsCount,\n            currentCompilerArtifactsSize,\n        ) = self.compilerArtifactsRepository.clean(effectiveMaximumSizeObjects)\n\n        stats.setCacheSize(currentCompilerArtifactsSize + currentSizeManifests)\n        stats.setNumCacheEntries(currentCompilerArtifactsCount)\n\n\nclass Cache(object):\n    def __init__(self, cacheDirectory=None):\n        if os.environ.get(\"CLCACHE_MEMCACHED\"):\n            from .storage import CacheFileWithMemcacheFallbackStrategy\n\n            self.strategy = CacheFileWithMemcacheFallbackStrategy(\n                os.environ.get(\"CLCACHE_MEMCACHED\"), cacheDirectory=cacheDirectory\n            )\n        else:\n            self.strategy = CacheFileStrategy(cacheDirectory=cacheDirectory)\n\n    def __str__(self):\n        return str(self.strategy)\n\n    @property\n    def lock(self):\n        return self.strategy.lock\n\n    @contextlib.contextmanager\n    def manifestLockFor(self, key):\n        with self.strategy.manifestLockFor(key):\n            yield\n\n    @property\n    def configuration(self):\n        return self.strategy.configuration\n\n    @property\n    def statistics(self):\n        return self.strategy.statistics\n\n    def clean(self, stats, maximumSize):\n        return self.strategy.clean(stats, maximumSize)\n\n    @contextlib.contextmanager\n    def lockFor(self, key):\n        with self.strategy.lockFor(key):\n            yield\n\n    def getEntry(self, key):\n        return self.strategy.getEntry(key)\n\n    def setEntry(self, key, value):\n        return self.strategy.setEntry(key, value)\n\n    def hasEntry(self, cachekey):\n        return self.strategy.hasEntry(cachekey)\n\n    def setManifest(self, manifestHash, manifest):\n        self.strategy.setManifest(manifestHash, manifest)\n\n    def getManifest(self, manifestHash):\n        return self.strategy.getManifest(manifestHash)\n\n\nclass PersistentJSONDict(object):\n    def __init__(self, fileName):\n        self._dirty = False\n        self._dict = {}\n        self._fileName = fileName\n        try:\n            with open(self._fileName, \"r\") as f:\n                self._dict = json.load(f)\n        except IOError:\n            pass\n        except ValueError:\n            printErrStr(\"clcache: persistent json file %s was broken\" % fileName)\n\n    def save(self):\n        if self._dirty:\n            with atomic_write(self._fileName, overwrite=True) as f:\n                json.dump(self._dict, f, sort_keys=True, indent=4)\n\n    def __setitem__(self, key, value):\n        self._dict[key] = value\n        self._dirty = True\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __contains__(self, key):\n        return key in self._dict\n\n    def __eq__(self, other):\n        return type(self) is type(other) and self.__dict__ == other.__dict__\n\n\nclass Configuration(object):\n    _defaultValues = {\"MaximumCacheSize\": 1073741824}  # 1 GiB\n\n    def __init__(self, configurationFile):\n        self._configurationFile = configurationFile\n        self._cfg = None\n\n    def __enter__(self):\n        self._cfg = PersistentJSONDict(self._configurationFile)\n        for setting, defaultValue in self._defaultValues.items():\n            if setting not in self._cfg:\n                self._cfg[setting] = defaultValue\n        return self\n\n    def __exit__(self, typ, value, traceback):\n        # Does not write to disc when unchanged\n        self._cfg.save()\n\n    def maximumCacheSize(self):\n        return self._cfg[\"MaximumCacheSize\"]\n\n    def setMaximumCacheSize(self, size):\n        self._cfg[\"MaximumCacheSize\"] = size\n\nstats = None\n\nclass Statistics(object):\n    CALLS_WITH_INVALID_ARGUMENT = \"CallsWithInvalidArgument\"\n    CALLS_WITHOUT_SOURCE_FILE = \"CallsWithoutSourceFile\"\n    CALLS_WITH_MULTIPLE_SOURCE_FILES = \"CallsWithMultipleSourceFiles\"\n    CALLS_WITH_PCH = \"CallsWithPch\"\n    CALLS_FOR_LINKING = \"CallsForLinking\"\n    CALLS_FOR_EXTERNAL_DEBUG_INFO = \"CallsForExternalDebugInfo\"\n    CALLS_FOR_PREPROCESSING = \"CallsForPreprocessing\"\n    CACHE_HITS = \"CacheHits\"\n    CACHE_MISSES = \"CacheMisses\"\n    EVICTED_MISSES = \"EvictedMisses\"\n    HEADER_CHANGED_MISSES = \"HeaderChangedMisses\"\n    SOURCE_CHANGED_MISSES = \"SourceChangedMisses\"\n    CACHE_ENTRIES = \"CacheEntries\"\n    CACHE_SIZE = \"CacheSize\"\n\n    RESETTABLE_KEYS = {\n        CALLS_WITH_INVALID_ARGUMENT,\n        CALLS_WITHOUT_SOURCE_FILE,\n        CALLS_WITH_MULTIPLE_SOURCE_FILES,\n        CALLS_WITH_PCH,\n        CALLS_FOR_LINKING,\n        CALLS_FOR_EXTERNAL_DEBUG_INFO,\n        CALLS_FOR_PREPROCESSING,\n        CACHE_HITS,\n        CACHE_MISSES,\n        EVICTED_MISSES,\n        HEADER_CHANGED_MISSES,\n        SOURCE_CHANGED_MISSES,\n    }\n    NON_RESETTABLE_KEYS = {\n        CACHE_ENTRIES,\n        CACHE_SIZE,\n    }\n\n    def __init__(self, statsFile):\n        self._statsFile = statsFile\n\n        global stats\n        if stats is None:\n            stats = PersistentJSONDict(self._statsFile)\n\n        self._stats = stats\n\n    def __enter__(self):\n        for k in Statistics.RESETTABLE_KEYS | Statistics.NON_RESETTABLE_KEYS:\n            if k not in self._stats:\n                self._stats[k] = 0\n        return self\n\n    def __exit__(self, typ, value, traceback):\n        # Does not write to disc when unchanged\n        # Nuitka: Only write at the end.\n        # self._stats.save()\n        pass\n\n    def __eq__(self, other):\n        return type(self) is type(other) and self.__dict__ == other.__dict__\n\n    def numCallsWithInvalidArgument(self):\n        return self._stats[Statistics.CALLS_WITH_INVALID_ARGUMENT]\n\n    def registerCallWithInvalidArgument(self):\n        self._stats[Statistics.CALLS_WITH_INVALID_ARGUMENT] += 1\n\n    def numCallsWithoutSourceFile(self):\n        return self._stats[Statistics.CALLS_WITHOUT_SOURCE_FILE]\n\n    def registerCallWithoutSourceFile(self):\n        self._stats[Statistics.CALLS_WITHOUT_SOURCE_FILE] += 1\n\n    def numCallsWithMultipleSourceFiles(self):\n        return self._stats[Statistics.CALLS_WITH_MULTIPLE_SOURCE_FILES]\n\n    def registerCallWithMultipleSourceFiles(self):\n        self._stats[Statistics.CALLS_WITH_MULTIPLE_SOURCE_FILES] += 1\n\n    def numCallsWithPch(self):\n        return self._stats[Statistics.CALLS_WITH_PCH]\n\n    def registerCallWithPch(self):\n        self._stats[Statistics.CALLS_WITH_PCH] += 1\n\n    def numCallsForLinking(self):\n        return self._stats[Statistics.CALLS_FOR_LINKING]\n\n    def registerCallForLinking(self):\n        self._stats[Statistics.CALLS_FOR_LINKING] += 1\n\n    def numCallsForExternalDebugInfo(self):\n        return self._stats[Statistics.CALLS_FOR_EXTERNAL_DEBUG_INFO]\n\n    def registerCallForExternalDebugInfo(self):\n        self._stats[Statistics.CALLS_FOR_EXTERNAL_DEBUG_INFO] += 1\n\n    def numEvictedMisses(self):\n        return self._stats[Statistics.EVICTED_MISSES]\n\n    def registerEvictedMiss(self):\n        self.registerCacheMiss()\n        self._stats[Statistics.EVICTED_MISSES] += 1\n\n    def numHeaderChangedMisses(self):\n        return self._stats[Statistics.HEADER_CHANGED_MISSES]\n\n    def registerHeaderChangedMiss(self):\n        self.registerCacheMiss()\n        self._stats[Statistics.HEADER_CHANGED_MISSES] += 1\n\n    def numSourceChangedMisses(self):\n        return self._stats[Statistics.SOURCE_CHANGED_MISSES]\n\n    def registerSourceChangedMiss(self):\n        self.registerCacheMiss()\n        self._stats[Statistics.SOURCE_CHANGED_MISSES] += 1\n\n    def numCacheEntries(self):\n        return self._stats[Statistics.CACHE_ENTRIES]\n\n    def setNumCacheEntries(self, number):\n        self._stats[Statistics.CACHE_ENTRIES] = number\n\n    def registerCacheEntry(self, size):\n        self._stats[Statistics.CACHE_ENTRIES] += 1\n        self._stats[Statistics.CACHE_SIZE] += size\n\n    def unregisterCacheEntry(self, size):\n        self._stats[Statistics.CACHE_ENTRIES] -= 1\n        self._stats[Statistics.CACHE_SIZE] -= size\n\n    def currentCacheSize(self):\n        return self._stats[Statistics.CACHE_SIZE]\n\n    def setCacheSize(self, size):\n        self._stats[Statistics.CACHE_SIZE] = size\n\n    def numCacheHits(self):\n        return self._stats[Statistics.CACHE_HITS]\n\n    def registerCacheHit(self):\n        self._stats[Statistics.CACHE_HITS] += 1\n\n    def numCacheMisses(self):\n        return self._stats[Statistics.CACHE_MISSES]\n\n    def registerCacheMiss(self):\n        self._stats[Statistics.CACHE_MISSES] += 1\n\n    def numCallsForPreprocessing(self):\n        return self._stats[Statistics.CALLS_FOR_PREPROCESSING]\n\n    def registerCallForPreprocessing(self):\n        self._stats[Statistics.CALLS_FOR_PREPROCESSING] += 1\n\n    def resetCounters(self):\n        for k in Statistics.RESETTABLE_KEYS:\n            self._stats[k] = 0\n\n\nclass AnalysisError(Exception):\n    pass\n\n\nclass NoSourceFileError(AnalysisError):\n    pass\n\n\nclass MultipleSourceFilesComplexError(AnalysisError):\n    pass\n\n\nclass CalledForLinkError(AnalysisError):\n    pass\n\n\nclass CalledWithPchError(AnalysisError):\n    pass\n\n\nclass ExternalDebugInfoError(AnalysisError):\n    pass\n\n\nclass CalledForPreprocessingError(AnalysisError):\n    pass\n\n\nclass InvalidArgumentError(AnalysisError):\n    pass\n\n\ndef getCompilerHash(compilerBinary):\n    stat = os.stat(compilerBinary)\n    data = \"|\".join(\n        [\n            str(stat.st_mtime),\n            str(stat.st_size),\n            VERSION,\n        ]\n    )\n    hasher = HashAlgorithm()\n    hasher.update(data.encode(\"UTF-8\"))\n    return hasher.hexdigest()\n\n\ndef getFileHashes(filePaths):\n    if \"CLCACHE_SERVER\" in os.environ:\n        pipeName = r\"\\\\.\\pipe\\clcache_srv\"\n        while True:\n            try:\n                with open(pipeName, \"w+b\") as f:\n                    f.write(\"\\n\".join(filePaths).encode(\"utf8\"))\n                    f.write(b\"\\x00\")\n                    response = f.read()\n                    if response.startswith(b\"!\"):\n                        raise pickle.loads(response[1:-1])\n                    return response[:-1].decode(\"utf8\").splitlines()\n            except OSError as e:\n                if (\n                    e.errno == errno.EINVAL\n                    and windll.kernel32.GetLastError() == ERROR_PIPE_BUSY\n                ):\n                    windll.kernel32.WaitNamedPipeW(pipeName, NMPWAIT_WAIT_FOREVER)\n                else:\n                    raise\n    else:\n        return [getFileHash(filePath) for filePath in filePaths]\n\n\n_hash_cache = {}\n\ndef getFileHash(filePath, additionalData=None):\n    key = (filePath, additionalData)\n\n    if key in _hash_cache:\n        return _hash_cache[key]\n\n    hasher = HashAlgorithm()\n    with open(filePath, \"rb\") as inFile:\n        hasher.update(inFile.read())\n    if additionalData is not None:\n        # Encoding of this additional data does not really matter\n        # as long as we keep it fixed, otherwise hashes change.\n        # The string should fit into ASCII, so UTF8 should not change anything\n        hasher.update(additionalData.encode(\"UTF-8\"))\n\n    _hash_cache[key] = hasher.hexdigest()\n    return _hash_cache[key]\n\n\ndef getStringHash(dataString):\n    hasher = HashAlgorithm()\n    hasher.update(dataString.encode(\"UTF-8\"))\n    return hasher.hexdigest()\n\n\ndef expandBasedirPlaceholder(path):\n    baseDir = normalizeBaseDir(os.environ.get(\"CLCACHE_BASEDIR\"))\n    if path.startswith(BASEDIR_REPLACEMENT):\n        if not baseDir:\n            print(\n                \"No CLCACHE_BASEDIR set, but found relative path \" + path,\n                file=sys.stderr,\n            )\n            sys.exit(1)\n        return path.replace(BASEDIR_REPLACEMENT, baseDir, 1)\n    else:\n        return path\n\n\ndef collapseBasedirToPlaceholder(path):\n    baseDir = normalizeBaseDir(os.environ.get(\"CLCACHE_BASEDIR\"))\n    if baseDir is None:\n        return path\n    else:\n        assert path == os.path.normcase(path)\n        assert baseDir == os.path.normcase(baseDir)\n        if path.startswith(baseDir):\n            return path.replace(baseDir, BASEDIR_REPLACEMENT, 1)\n        else:\n            return path\n\n\ndef ensureDirectoryExists(path):\n    try:\n        os.makedirs(path)\n    except OSError as e:\n        if e.errno != errno.EEXIST:\n            raise\n\n\ndef copyOrLink(srcFilePath, dstFilePath, writeCache=False):\n    ensureDirectoryExists(os.path.dirname(os.path.abspath(dstFilePath)))\n\n    if \"CLCACHE_HARDLINK\" in os.environ:\n        ret = windll.kernel32.CreateHardLinkW(str(dstFilePath), str(srcFilePath), None)\n        if ret != 0:\n            # Touch the time stamp of the new link so that the build system\n            # doesn't confused by a potentially old time on the file. The\n            # hard link gets the same timestamp as the cached file.\n            # Note that touching the time stamp of the link also touches\n            # the time stamp on the cache (and hence on all over hard\n            # links). This shouldn't be a problem though.\n            os.utime(dstFilePath, None)\n            return\n\n    # If hardlinking fails for some reason (or it's not enabled), just\n    # fall back to moving bytes around. Always to a temporary path first to\n    # lower the chances of corrupting it.\n    tempDst = dstFilePath + \".tmp\"\n\n    if \"CLCACHE_COMPRESS\" in os.environ:\n        if \"CLCACHE_COMPRESSLEVEL\" in os.environ:\n            compress = int(os.environ[\"CLCACHE_COMPRESSLEVEL\"])\n        else:\n            compress = 6\n\n        if writeCache is True:\n            with open(srcFilePath, \"rb\") as fileIn, gzip.open(\n                tempDst, \"wb\", compress\n            ) as fileOut:\n                copyfileobj(fileIn, fileOut)\n        else:\n            with gzip.open(srcFilePath, \"rb\", compress) as fileIn, open(\n                tempDst, \"wb\"\n            ) as fileOut:\n                copyfileobj(fileIn, fileOut)\n    else:\n        copyfile(srcFilePath, tempDst)\n    os.replace(tempDst, dstFilePath)\n\n\ndef printTraceStatement(msg):\n    if \"CLCACHE_LOG\" in os.environ:\n        scriptDir = os.path.realpath(os.path.dirname(sys.argv[0]))\n        with OUTPUT_LOCK:\n            print(os.path.join(scriptDir, \"clcache.py\") + \" \" + msg)\n\n\nclass CommandLineTokenizer(object):\n    def __init__(self, content):\n        self.argv = []\n        self._content = content\n        self._pos = 0\n        self._token = \"\"\n        self._parser = self._initialState\n\n        while self._pos < len(self._content):\n            self._parser = self._parser(self._content[self._pos])\n            self._pos += 1\n\n        if self._token:\n            self.argv.append(self._token)\n\n    def _initialState(self, currentChar):\n        if currentChar.isspace():\n            return self._initialState\n\n        if currentChar == '\"':\n            return self._quotedState\n\n        if currentChar == \"\\\\\":\n            self._parseBackslash()\n            return self._unquotedState\n\n        self._token += currentChar\n        return self._unquotedState\n\n    def _unquotedState(self, currentChar):\n        if currentChar.isspace():\n            self.argv.append(self._token)\n            self._token = \"\"\n            return self._initialState\n\n        if currentChar == '\"':\n            return self._quotedState\n\n        if currentChar == \"\\\\\":\n            self._parseBackslash()\n            return self._unquotedState\n\n        self._token += currentChar\n        return self._unquotedState\n\n    def _quotedState(self, currentChar):\n        if currentChar == '\"':\n            return self._unquotedState\n\n        if currentChar == \"\\\\\":\n            self._parseBackslash()\n            return self._quotedState\n\n        self._token += currentChar\n        return self._quotedState\n\n    def _parseBackslash(self):\n        numBackslashes = 0\n        while self._pos < len(self._content) and self._content[self._pos] == \"\\\\\":\n            self._pos += 1\n            numBackslashes += 1\n\n        followedByDoubleQuote = (\n            self._pos < len(self._content) and self._content[self._pos] == '\"'\n        )\n        if followedByDoubleQuote:\n            self._token += \"\\\\\" * (numBackslashes // 2)\n            if numBackslashes % 2 == 0:\n                self._pos -= 1\n            else:\n                self._token += '\"'\n        else:\n            self._token += \"\\\\\" * numBackslashes\n            self._pos -= 1\n\n\ndef splitCommandsFile(content):\n    return CommandLineTokenizer(content).argv\n\n\ndef expandCommandLine(cmdline):\n    ret = []\n\n    for arg in cmdline:\n        if arg[0] == \"@\":\n            includeFile = arg[1:]\n            with open(includeFile, \"rb\") as f:\n                rawBytes = f.read()\n\n            encoding = None\n\n            bomToEncoding = {\n                codecs.BOM_UTF32_BE: \"utf-32-be\",\n                codecs.BOM_UTF32_LE: \"utf-32-le\",\n                codecs.BOM_UTF16_BE: \"utf-16-be\",\n                codecs.BOM_UTF16_LE: \"utf-16-le\",\n            }\n\n            for bom, enc in bomToEncoding.items():\n                if rawBytes.startswith(bom):\n                    encoding = enc\n                    rawBytes = rawBytes[len(bom) :]\n                    break\n\n            if encoding:\n                includeFileContents = rawBytes.decode(encoding)\n            else:\n                includeFileContents = rawBytes.decode(\"UTF-8\")\n\n            ret.extend(\n                expandCommandLine(splitCommandsFile(includeFileContents.strip()))\n            )\n        else:\n            ret.append(arg)\n\n    return ret\n\n\ndef extendCommandLineFromEnvironment(cmdLine, environment):\n    remainingEnvironment = environment.copy()\n\n    prependCmdLineString = remainingEnvironment.pop(\"CL\", None)\n    if prependCmdLineString is not None:\n        cmdLine = splitCommandsFile(prependCmdLineString.strip()) + cmdLine\n\n    appendCmdLineString = remainingEnvironment.pop(\"_CL_\", None)\n    if appendCmdLineString is not None:\n        cmdLine = cmdLine + splitCommandsFile(appendCmdLineString.strip())\n\n    return cmdLine, remainingEnvironment\n\n\nclass Argument(object):\n    def __init__(self, name):\n        self.name = name\n\n    def __len__(self):\n        return len(self.name)\n\n    def __str__(self):\n        return \"/\" + self.name\n\n    def __eq__(self, other):\n        return type(self) == type(other) and self.name == other.name\n\n    def __hash__(self):\n        key = (type(self), self.name)\n        return hash(key)\n\n\n# /NAMEparameter (no space, required parameter).\nclass ArgumentT1(Argument):\n    pass\n\n\n# /NAME[parameter] (no space, optional parameter)\nclass ArgumentT2(Argument):\n    pass\n\n\n# /NAME[ ]parameter (optional space)\nclass ArgumentT3(Argument):\n    pass\n\n\n# /NAME parameter (required space)\nclass ArgumentT4(Argument):\n    pass\n\n\nclass CommandLineAnalyzer(object):\n    argumentsWithParameter = {\n        # /NAMEparameter\n        ArgumentT1(\"Ob\"),\n        ArgumentT1(\"Yl\"),\n        ArgumentT1(\"Zm\"),\n        # /NAME[parameter]\n        ArgumentT2(\"doc\"),\n        ArgumentT2(\"FA\"),\n        ArgumentT2(\"FR\"),\n        ArgumentT2(\"Fr\"),\n        ArgumentT2(\"Gs\"),\n        ArgumentT2(\"MP\"),\n        ArgumentT2(\"Yc\"),\n        ArgumentT2(\"Yu\"),\n        ArgumentT2(\"Zp\"),\n        ArgumentT2(\"Fa\"),\n        ArgumentT2(\"Fd\"),\n        ArgumentT2(\"Fe\"),\n        ArgumentT2(\"Fi\"),\n        ArgumentT2(\"Fm\"),\n        ArgumentT2(\"Fo\"),\n        ArgumentT2(\"Fp\"),\n        ArgumentT2(\"Wv\"),\n        # /NAME[ ]parameter\n        ArgumentT3(\"AI\"),\n        ArgumentT3(\"D\"),\n        ArgumentT3(\"Tc\"),\n        ArgumentT3(\"Tp\"),\n        ArgumentT3(\"FI\"),\n        ArgumentT3(\"U\"),\n        ArgumentT3(\"I\"),\n        ArgumentT3(\"F\"),\n        ArgumentT3(\"FU\"),\n        ArgumentT3(\"w1\"),\n        ArgumentT3(\"w2\"),\n        ArgumentT3(\"w3\"),\n        ArgumentT3(\"w4\"),\n        ArgumentT3(\"wd\"),\n        ArgumentT3(\"we\"),\n        ArgumentT3(\"wo\"),\n        ArgumentT3(\"V\"),\n        ArgumentT3(\"imsvc\"),\n        # /NAME parameter\n        ArgumentT4(\"Xclang\"),\n    }\n    argumentsWithParameterSorted = sorted(argumentsWithParameter, key=len, reverse=True)\n\n    @staticmethod\n    def _getParameterizedArgumentType(cmdLineArgument):\n        # Sort by length to handle prefixes\n        for arg in CommandLineAnalyzer.argumentsWithParameterSorted:\n            if cmdLineArgument.startswith(arg.name, 1):\n                return arg\n        return None\n\n    @staticmethod\n    def parseArgumentsAndInputFiles(cmdline):\n        arguments = defaultdict(list)\n        inputFiles = []\n        i = 0\n        while i < len(cmdline):\n            cmdLineArgument = cmdline[i]\n\n            # Plain arguments starting with / or -\n            if cmdLineArgument.startswith(\"/\") or cmdLineArgument.startswith(\"-\"):\n                arg = CommandLineAnalyzer._getParameterizedArgumentType(cmdLineArgument)\n                if arg is not None:\n                    if isinstance(arg, ArgumentT1):\n                        value = cmdLineArgument[len(arg) + 1 :]\n                        if not value:\n                            raise InvalidArgumentError(\n                                \"Parameter for {} must not be empty\".format(arg)\n                            )\n                    elif isinstance(arg, ArgumentT2):\n                        value = cmdLineArgument[len(arg) + 1 :]\n                    elif isinstance(arg, ArgumentT3):\n                        value = cmdLineArgument[len(arg) + 1 :]\n                        if not value:\n                            value = cmdline[i + 1]\n                            i += 1\n                    elif isinstance(arg, ArgumentT4):\n                        value = cmdline[i + 1]\n                        i += 1\n                    else:\n                        raise AssertionError(\"Unsupported argument type.\")\n\n                    arguments[arg.name].append(value)\n                else:\n                    argumentName = cmdLineArgument[\n                        1:\n                    ]  # name not followed by parameter in this case\n                    arguments[argumentName].append(\"\")\n\n            # Response file\n            elif cmdLineArgument[0] == \"@\":\n                raise AssertionError(\n                    \"No response file arguments (starting with @) must be left here.\"\n                )\n\n            # Source file arguments\n            else:\n                inputFiles.append(cmdLineArgument)\n\n            i += 1\n\n        return dict(arguments), inputFiles\n\n    @staticmethod\n    def analyze(cmdline):\n        options, inputFiles = CommandLineAnalyzer.parseArgumentsAndInputFiles(cmdline)\n        # Use an override pattern to shadow input files that have\n        # already been specified in the function above\n        inputFiles = {inputFile: \"\" for inputFile in inputFiles}\n        compl = False\n        if \"Tp\" in options:\n            inputFiles.update({inputFile: \"/Tp\" for inputFile in options[\"Tp\"]})\n            compl = True\n        if \"Tc\" in options:\n            inputFiles.update({inputFile: \"/Tc\" for inputFile in options[\"Tc\"]})\n            compl = True\n\n        # Now collect the inputFiles into the return format\n        inputFiles = list(inputFiles.items())\n        if not inputFiles:\n            raise NoSourceFileError()\n\n        for opt in [\"E\", \"EP\", \"P\"]:\n            if opt in options:\n                raise CalledForPreprocessingError()\n\n        # Technically, it would be possible to support /Zi: we'd just need to\n        # copy the generated .pdb files into/out of the cache.\n        if \"Zi\" in options:\n            raise ExternalDebugInfoError()\n\n        if \"Yc\" in options or \"Yu\" in options:\n            raise CalledWithPchError()\n\n        if \"link\" in options or \"c\" not in options:\n            raise CalledForLinkError()\n\n        if len(inputFiles) > 1 and compl:\n            raise MultipleSourceFilesComplexError()\n\n        objectFiles = None\n        prefix = \"\"\n        if \"Fo\" in options and options[\"Fo\"][0]:\n            # Handle user input\n            tmp = os.path.normpath(options[\"Fo\"][0])\n            if os.path.isdir(tmp):\n                prefix = tmp\n            elif len(inputFiles) == 1:\n                objectFiles = [tmp]\n        if objectFiles is None:\n            # Generate from .c/.cpp filenames\n            objectFiles = [\n                os.path.join(prefix, basenameWithoutExtension(f)) + \".obj\"\n                for f, _ in inputFiles\n            ]\n\n        printTraceStatement(\"Compiler source files: {}\".format(inputFiles))\n        printTraceStatement(\"Compiler object file: {}\".format(objectFiles))\n        return inputFiles, objectFiles\n\n\ndef invokeRealCompiler(\n    compilerBinary, cmdLine, captureOutput=False, outputAsString=True, environment=None\n):\n    realCmdline = [compilerBinary] + cmdLine\n    printTraceStatement(\"Invoking real compiler as {}\".format(realCmdline))\n\n    environment = environment or os.environ\n\n    # Environment variable set by the Visual Studio IDE to make cl.exe write\n    # Unicode output to named pipes instead of stdout. Unset it to make sure\n    # we can catch stdout output.\n    environment.pop(\"VS_UNICODE_OUTPUT\", None)\n\n    returnCode = None\n    stdout = b\"\"\n    stderr = b\"\"\n    if captureOutput:\n        # Don't use subprocess.communicate() here, it's slow due to internal\n        # threading.\n        with TemporaryFile() as stdoutFile, TemporaryFile() as stderrFile:\n            compilerProcess = subprocess.Popen(\n                realCmdline, stdout=stdoutFile, stderr=stderrFile, env=environment\n            )\n            returnCode = compilerProcess.wait()\n            stdoutFile.seek(0)\n            stdout = stdoutFile.read()\n            stderrFile.seek(0)\n            stderr = stderrFile.read()\n    else:\n        returnCode = subprocess.call(realCmdline, env=environment)\n\n    printTraceStatement(\"Real compiler returned code {0:d}\".format(returnCode))\n\n    if outputAsString:\n        stdoutString = stdout.decode(CL_DEFAULT_CODEC)\n        stderrString = stderr.decode(CL_DEFAULT_CODEC)\n        return returnCode, stdoutString, stderrString\n\n    return returnCode, stdout, stderr\n\n\n# Returns the amount of jobs which should be run in parallel when\n# invoked in batch mode as determined by the /MP argument\ndef jobCount(cmdLine):\n    mpSwitches = [arg for arg in cmdLine if re.match(r\"^/MP(\\d+)?$\", arg)]\n    if not mpSwitches:\n        return 1\n\n    # the last instance of /MP takes precedence\n    mpSwitch = mpSwitches.pop()\n\n    count = mpSwitch[3:]\n    if count != \"\":\n        return int(count)\n\n    # /MP, but no count specified; use CPU count\n    try:\n        return multiprocessing.cpu_count()\n    except NotImplementedError:\n        # not expected to happen\n        return 2\n\n\ndef printStatistics(cache):\n    template = \"\"\"\nclcache statistics:\n  current cache dir         : {}\n  cache size                : {:,} bytes\n  maximum cache size        : {:,} bytes\n  cache entries             : {}\n  cache hits                : {}\n  cache misses\n    total                      : {}\n    evicted                    : {}\n    header changed             : {}\n    source changed             : {}\n  passed to real compiler\n    called w/ invalid argument : {}\n    called for preprocessing   : {}\n    called for linking         : {}\n    called for external debug  : {}\n    called w/o source          : {}\n    called w/ multiple sources : {}\n    called w/ PCH              : {}\"\"\".strip()\n\n    with cache.statistics as stats, cache.configuration as cfg:\n        print(\n            template.format(\n                str(cache),\n                stats.currentCacheSize(),\n                cfg.maximumCacheSize(),\n                stats.numCacheEntries(),\n                stats.numCacheHits(),\n                stats.numCacheMisses(),\n                stats.numEvictedMisses(),\n                stats.numHeaderChangedMisses(),\n                stats.numSourceChangedMisses(),\n                stats.numCallsWithInvalidArgument(),\n                stats.numCallsForPreprocessing(),\n                stats.numCallsForLinking(),\n                stats.numCallsForExternalDebugInfo(),\n                stats.numCallsWithoutSourceFile(),\n                stats.numCallsWithMultipleSourceFiles(),\n                stats.numCallsWithPch(),\n            )\n        )\n\n\ndef resetStatistics(cache):\n    with cache.statistics as stats:\n        stats.resetCounters()\n\n\ndef cleanCache(cache):\n    with cache.lock, cache.statistics as stats, cache.configuration as cfg:\n        cache.clean(stats, cfg.maximumCacheSize())\n\n\ndef clearCache(cache):\n    with cache.lock, cache.statistics as stats:\n        cache.clean(stats, 0)\n\n\n# Returns pair:\n#   1. set of include filepaths\n#   2. new compiler output\n# Output changes if strip is True in that case all lines with include\n# directives are stripped from it\ndef parseIncludesSet(compilerOutput, sourceFile, strip):\n    newOutput = []\n    includesSet = set()\n\n    # Example lines\n    # Note: including file:         C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\INCLUDE\\limits.h\n    # Hinweis: Einlesen der Datei:   C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\INCLUDE\\iterator\n    #\n    # So we match\n    # - one word (translation of \"note\")\n    # - colon\n    # - space\n    # - a phrase containing characters and spaces (translation of \"including file\")\n    # - colon\n    # - one or more spaces\n    # - the file path, starting with a non-whitespace character\n    reFilePath = re.compile(r\"^(\\w+): ([ \\w]+):( +)(?P<file_path>\\S.*)$\")\n\n    absSourceFile = os.path.normcase(os.path.abspath(sourceFile))\n    for line in compilerOutput.splitlines(True):\n        match = reFilePath.match(line.rstrip(\"\\r\\n\"))\n        if match is not None:\n            filePath = match.group(\"file_path\")\n            filePath = os.path.normcase(os.path.abspath(filePath))\n            if filePath != absSourceFile:\n                includesSet.add(filePath)\n        elif strip:\n            newOutput.append(line)\n    if strip:\n        return includesSet, \"\".join(newOutput)\n    else:\n        return includesSet, compilerOutput\n\n\ndef addObjectToCache(stats, cache, cachekey, artifacts):\n    # This function asserts that the caller locked 'section' and 'stats'\n    # already and also saves them\n    printTraceStatement(\n        \"Adding file {} to cache using key {}\".format(\n            artifacts.objectFilePath, cachekey\n        )\n    )\n\n    size = cache.setEntry(cachekey, artifacts)\n    if size is None:\n        size = os.path.getsize(artifacts.objectFilePath)\n    stats.registerCacheEntry(size)\n\n    with cache.configuration as cfg:\n        return stats.currentCacheSize() >= cfg.maximumCacheSize()\n\n\ndef processCacheHit(cache, objectFile, cachekey):\n    printTraceStatement(\n        \"Reusing cached object for key {} for object file {}\".format(\n            cachekey, objectFile\n        )\n    )\n\n    with cache.lockFor(cachekey):\n        with cache.statistics as stats:\n            stats.registerCacheHit()\n\n        if os.path.exists(objectFile):\n            os.remove(objectFile)\n\n        cachedArtifacts = cache.getEntry(cachekey)\n        copyOrLink(cachedArtifacts.objectFilePath, objectFile)\n        printTraceStatement(\"Finished. Exit code 0\")\n        return 0, cachedArtifacts.stdout, cachedArtifacts.stderr, False\n\n\ndef createManifestEntry(manifestHash, includePaths):\n    sortedIncludePaths = sorted(set(includePaths))\n    includeHashes = getFileHashes(sortedIncludePaths)\n\n    safeIncludes = [collapseBasedirToPlaceholder(path) for path in sortedIncludePaths]\n    includesContentHash = ManifestRepository.getIncludesContentHashForHashes(\n        includeHashes\n    )\n    cachekey = CompilerArtifactsRepository.computeKeyDirect(\n        manifestHash, includesContentHash\n    )\n\n    return ManifestEntry(safeIncludes, includesContentHash, cachekey)\n\n\ndef run(cache, compiler, compiler_args, env):\n    printTraceStatement(\"Found real compiler binary at '{0!s}'\".format(compiler))\n\n    if \"CLCACHE_DISABLE\" in os.environ:\n        exit_code, out, err = invokeRealCompiler(compiler, compiler_args, env)\n        return exit_code, [out], [err]\n    else:\n        return processCompileRequest(cache, compiler, compiler_args, env)\n\n\ncache = None\n\n\ndef runClCache(compiler, compiler_args, env):\n    \"\"\" Entry point, designed to be used by external tools like Nuitka's scons. \"\"\"\n    global cache  # This is a singleton if this is called multiple times, pylint: disable=global-statement\n\n    if cache is None:\n        cache = Cache()\n\n    exit_code, out, err = run(cache, compiler, compiler_args, env)\n\n    assert len(out) == 1 == len(err)\n\n    # Preferred order in Nuitka scons is output, error, exit_code and we expect\n    # bytes.\n    return out[0].encode(CL_DEFAULT_CODEC), err[0].encode(CL_DEFAULT_CODEC), exit_code\n\n\ndef updateCacheStatistics(cache, method):\n    with cache.statistics as stats:\n        method(stats)\n\n\ndef printOutAndErr(out, err):\n    if \"CLCACHE_HIDE_OUTPUTS\" not in os.environ:\n        printBinary(sys.stdout, out.encode(CL_DEFAULT_CODEC))\n        printBinary(sys.stderr, err.encode(CL_DEFAULT_CODEC))\n\n\ndef printErrStr(message):\n    with OUTPUT_LOCK:\n        print(message, file=sys.stderr)\n\n\ndef processCompileRequest(cache, compiler, args, env):\n    printTraceStatement(\"Parsing given commandline '{0!s}'\".format(args))\n\n    cmdLine, environment = extendCommandLineFromEnvironment(args, env)\n    cmdLine = expandCommandLine(cmdLine)\n    printTraceStatement(\"Expanded commandline '{0!s}'\".format(cmdLine))\n\n    try:\n        sourceFiles, objectFiles = CommandLineAnalyzer.analyze(cmdLine)\n        return scheduleJobs(\n            cache, compiler, cmdLine, environment, sourceFiles, objectFiles\n        )\n    except InvalidArgumentError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: invalid argument\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallWithInvalidArgument)\n    except NoSourceFileError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: no source file found\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallWithoutSourceFile)\n    except MultipleSourceFilesComplexError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: multiple source files found\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallWithMultipleSourceFiles)\n    except CalledWithPchError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: precompiled headers in use\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallWithPch)\n    except CalledForLinkError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: called for linking\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallForLinking)\n    except ExternalDebugInfoError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: external debug information (/Zi) is not supported\".format(\n                cmdLine\n            )\n        )\n        updateCacheStatistics(cache, Statistics.registerCallForExternalDebugInfo)\n    except CalledForPreprocessingError:\n        printTraceStatement(\n            \"Cannot cache invocation as {}: called for preprocessing\".format(cmdLine)\n        )\n        updateCacheStatistics(cache, Statistics.registerCallForPreprocessing)\n\n    exitCode, out, err = invokeRealCompiler(compiler, args, env)\n    printOutAndErr(out, err)\n    return exitCode, [out], [err]\n\n\ndef filterSourceFiles(\n    cmdLine, sourceFiles\n):\n    setOfSources = set(sourceFile for sourceFile, _ in sourceFiles)\n    skippedArgs = (\"/Tc\", \"/Tp\", \"-Tp\", \"-Tc\")\n    return (\n        arg\n        for arg in cmdLine\n        if not (arg in setOfSources or arg.startswith(skippedArgs))\n    )\n\n\ndef scheduleJobs(\n    cache,\n    compiler,\n    cmdLine,\n    environment,\n    sourceFiles,\n    objectFiles,\n):\n    result_out = []\n    result_err = []\n\n    # Filter out all source files from the command line to form baseCmdLine\n    baseCmdLine = [\n        arg\n        for arg in filterSourceFiles(cmdLine, sourceFiles)\n        if not arg.startswith(\"/MP\")\n    ]\n\n    exitCode = 0\n    cleanupRequired = False\n    with concurrent.futures.ThreadPoolExecutor(\n        max_workers=jobCount(cmdLine)\n    ) as executor:\n        jobs = []\n        for (srcFile, srcLanguage), objFile in zip(sourceFiles, objectFiles):\n            jobCmdLine = baseCmdLine + [srcLanguage + srcFile]\n            jobs.append(\n                executor.submit(\n                    processSingleSource,\n                    compiler,\n                    jobCmdLine,\n                    srcFile,\n                    objFile,\n                    environment,\n                )\n            )\n        for future in concurrent.futures.as_completed(jobs):\n            exitCode, out, err, doCleanup = future.result()\n            printTraceStatement(\"Finished. Exit code {0:d}\".format(exitCode))\n            cleanupRequired |= doCleanup\n            printOutAndErr(out, err)\n\n            result_out.append(out)\n            result_err.append(err)\n\n            if exitCode != 0:\n                break\n\n    if cleanupRequired:\n        cleanCache(cache)\n\n    return exitCode, result_out, result_err\n\n\ndef processSingleSource(compiler, cmdLine, sourceFile, objectFile, environment):\n    try:\n        assert objectFile is not None\n        cache = Cache()\n\n        if \"CLCACHE_NODIRECT\" in os.environ and os.environ[\"CLCACHE_NODIRECT\"] != \"0\":\n            return processNoDirect(cache, objectFile, compiler, cmdLine, environment)\n        else:\n            return processDirect(\n                cache, objectFile, compiler, cmdLine, sourceFile, environment\n            )\n\n    except IncludeNotFoundException:\n        return invokeRealCompiler(compiler, cmdLine, environment=environment), False\n    except CompilerFailedException as e:\n        return e.getReturnTuple()\n\n\ndef processDirect(cache, objectFile, compiler, cmdLine, sourceFile, env):\n    manifestHash = ManifestRepository.getManifestHash(compiler, cmdLine, sourceFile)\n    manifestHit = None\n    with cache.manifestLockFor(manifestHash):\n        manifest = cache.getManifest(manifestHash)\n        if manifest:\n            for entryIndex, entry in enumerate(manifest.entries()):\n                # NOTE: command line options already included in hash for manifest name\n                try:\n                    includesContentHash = (\n                        ManifestRepository.getIncludesContentHashForFiles(\n                            [\n                                expandBasedirPlaceholder(path)\n                                for path in entry.includeFiles\n                            ]\n                        )\n                    )\n\n                    if entry.includesContentHash == includesContentHash:\n                        cachekey = entry.objectHash\n                        assert cachekey is not None\n                        if entryIndex > 0:\n                            # Move manifest entry to the top of the entries in the manifest\n                            manifest.touchEntry(cachekey)\n                            cache.setManifest(manifestHash, manifest)\n\n                        manifestHit = True\n                        with cache.lockFor(cachekey):\n                            if cache.hasEntry(cachekey):\n                                return processCacheHit(cache, objectFile, cachekey)\n\n                except IncludeNotFoundException:\n                    pass\n\n            unusableManifestMissReason = Statistics.registerHeaderChangedMiss\n        else:\n            unusableManifestMissReason = Statistics.registerSourceChangedMiss\n\n    if manifestHit is None:\n        stripIncludes = False\n        if \"/showIncludes\" not in cmdLine:\n            cmdLine = list(cmdLine)\n            cmdLine.insert(0, \"/showIncludes\")\n            stripIncludes = True\n    compilerResult = invokeRealCompiler(\n        compiler, cmdLine, captureOutput=True, environment=env\n    )\n    if manifestHit is None:\n        includePaths, compilerOutput = parseIncludesSet(\n            compilerResult[1], sourceFile, stripIncludes\n        )\n        compilerResult = (compilerResult[0], compilerOutput, compilerResult[2])\n\n    with cache.manifestLockFor(manifestHash):\n        if manifestHit is not None:\n            return ensureArtifactsExist(\n                cache, cachekey, unusableManifestMissReason, objectFile, compilerResult\n            )\n\n        entry = createManifestEntry(manifestHash, includePaths)\n        cachekey = entry.objectHash\n\n        def addManifest():\n            manifest = cache.getManifest(manifestHash) or Manifest()\n            manifest.addEntry(entry)\n            cache.setManifest(manifestHash, manifest)\n\n        return ensureArtifactsExist(\n            cache,\n            cachekey,\n            unusableManifestMissReason,\n            objectFile,\n            compilerResult,\n            addManifest,\n        )\n\n\ndef processNoDirect(cache, objectFile, compiler, cmdLine, environment):\n    cachekey = CompilerArtifactsRepository.computeKeyNodirect(\n        compiler, cmdLine, environment\n    )\n    with cache.lockFor(cachekey):\n        if cache.hasEntry(cachekey):\n            return processCacheHit(cache, objectFile, cachekey)\n\n    compilerResult = invokeRealCompiler(\n        compiler, cmdLine, captureOutput=True, environment=environment\n    )\n\n    return ensureArtifactsExist(\n        cache, cachekey, Statistics.registerCacheMiss, objectFile, compilerResult\n    )\n\n\ndef ensureArtifactsExist(\n    cache, cachekey, reason, objectFile, compilerResult, extraCallable=None\n):\n    cleanupRequired = False\n    returnCode, compilerOutput, compilerStderr = compilerResult\n    correctCompiliation = returnCode == 0 and os.path.exists(objectFile)\n    with cache.lockFor(cachekey):\n        if not cache.hasEntry(cachekey):\n            with cache.statistics as stats:\n                reason(stats)\n                if correctCompiliation:\n                    artifacts = CompilerArtifacts(\n                        objectFile, compilerOutput, compilerStderr\n                    )\n                    cleanupRequired = addObjectToCache(\n                        stats, cache, cachekey, artifacts\n                    )\n            if extraCallable and correctCompiliation:\n                extraCallable()\n    return returnCode, compilerOutput, compilerStderr, cleanupRequired\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/LICENSE.txt",
    "content": "Copyright (c) 2010 Jonathan Hartley\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of the copyright holders, nor those of its contributors\n  may be used to endorse or promote products derived from this software without\n  specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/__init__.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\nfrom .initialise import init, deinit, reinit, colorama_text\nfrom .ansi import Fore, Back, Style, Cursor\nfrom .ansitowin32 import AnsiToWin32\n\n__version__ = '0.4.5-pre'\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/ansi.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\n'''\nThis module generates ANSI character codes to printing colors to terminals.\nSee: http://en.wikipedia.org/wiki/ANSI_escape_code\n'''\n\nCSI = '\\033['\nOSC = '\\033]'\nBEL = '\\a'\n\n\ndef code_to_chars(code):\n    return CSI + str(code) + 'm'\n\ndef set_title(title):\n    return OSC + '2;' + title + BEL\n\ndef clear_screen(mode=2):\n    return CSI + str(mode) + 'J'\n\ndef clear_line(mode=2):\n    return CSI + str(mode) + 'K'\n\n\nclass AnsiCodes(object):\n    def __init__(self):\n        # the subclasses declare class attributes which are numbers.\n        # Upon instantiation we define instance attributes, which are the same\n        # as the class attributes but wrapped with the ANSI escape sequence\n        for name in dir(self):\n            if not name.startswith('_'):\n                value = getattr(self, name)\n                setattr(self, name, code_to_chars(value))\n\n\nclass AnsiCursor(object):\n    def UP(self, n=1):\n        return CSI + str(n) + 'A'\n    def DOWN(self, n=1):\n        return CSI + str(n) + 'B'\n    def FORWARD(self, n=1):\n        return CSI + str(n) + 'C'\n    def BACK(self, n=1):\n        return CSI + str(n) + 'D'\n    def POS(self, x=1, y=1):\n        return CSI + str(y) + ';' + str(x) + 'H'\n\n\nclass AnsiFore(AnsiCodes):\n    BLACK           = 30\n    RED             = 31\n    GREEN           = 32\n    YELLOW          = 33\n    BLUE            = 34\n    MAGENTA         = 35\n    CYAN            = 36\n    WHITE           = 37\n    RESET           = 39\n\n    # These are fairly well supported, but not part of the standard.\n    LIGHTBLACK_EX   = 90\n    LIGHTRED_EX     = 91\n    LIGHTGREEN_EX   = 92\n    LIGHTYELLOW_EX  = 93\n    LIGHTBLUE_EX    = 94\n    LIGHTMAGENTA_EX = 95\n    LIGHTCYAN_EX    = 96\n    LIGHTWHITE_EX   = 97\n\n\nclass AnsiBack(AnsiCodes):\n    BLACK           = 40\n    RED             = 41\n    GREEN           = 42\n    YELLOW          = 43\n    BLUE            = 44\n    MAGENTA         = 45\n    CYAN            = 46\n    WHITE           = 47\n    RESET           = 49\n\n    # These are fairly well supported, but not part of the standard.\n    LIGHTBLACK_EX   = 100\n    LIGHTRED_EX     = 101\n    LIGHTGREEN_EX   = 102\n    LIGHTYELLOW_EX  = 103\n    LIGHTBLUE_EX    = 104\n    LIGHTMAGENTA_EX = 105\n    LIGHTCYAN_EX    = 106\n    LIGHTWHITE_EX   = 107\n\n\nclass AnsiStyle(AnsiCodes):\n    BRIGHT    = 1\n    DIM       = 2\n    NORMAL    = 22\n    RESET_ALL = 0\n\nFore   = AnsiFore()\nBack   = AnsiBack()\nStyle  = AnsiStyle()\nCursor = AnsiCursor()\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/ansitowin32.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\nimport re\nimport sys\nimport os\n\nfrom .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL\nfrom .winterm import WinTerm, WinColor, WinStyle\nfrom .win32 import windll, winapi_test\n\n\nwinterm = None\nif windll is not None:\n    winterm = WinTerm()\n\n\nclass StreamWrapper(object):\n    '''\n    Wraps a stream (such as stdout), acting as a transparent proxy for all\n    attribute access apart from method 'write()', which is delegated to our\n    Converter instance.\n    '''\n    def __init__(self, wrapped, converter):\n        # double-underscore everything to prevent clashes with names of\n        # attributes on the wrapped stream object.\n        self.__wrapped = wrapped\n        self.__convertor = converter\n\n    def __getattr__(self, name):\n        return getattr(self.__wrapped, name)\n\n    def __enter__(self, *args, **kwargs):\n        # special method lookup bypasses __getattr__/__getattribute__, see\n        # https://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit\n        # thus, contextlib magic methods are not proxied via __getattr__\n        return self.__wrapped.__enter__(*args, **kwargs)\n\n    def __exit__(self, *args, **kwargs):\n        return self.__wrapped.__exit__(*args, **kwargs)\n\n    def write(self, text):\n        self.__convertor.write(text)\n\n    def isatty(self):\n        stream = self.__wrapped\n        if 'PYCHARM_HOSTED' in os.environ:\n            if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__):\n                return True\n        try:\n            stream_isatty = stream.isatty\n        except AttributeError:\n            return False\n        else:\n            return stream_isatty()\n\n    @property\n    def closed(self):\n        stream = self.__wrapped\n        try:\n            return stream.closed\n        except AttributeError:\n            return True\n\n\nclass AnsiToWin32(object):\n    '''\n    Implements a 'write()' method which, on Windows, will strip ANSI character\n    sequences from the text, and if outputting to a tty, will convert them into\n    win32 function calls.\n    '''\n    ANSI_CSI_RE = re.compile('\\001?\\033\\\\[((?:\\\\d|;)*)([a-zA-Z])\\002?')   # Control Sequence Introducer\n    ANSI_OSC_RE = re.compile('\\001?\\033\\\\]([^\\a]*)(\\a)\\002?')             # Operating System Command\n\n    def __init__(self, wrapped, convert=None, strip=None, autoreset=False):\n        # The wrapped stream (normally sys.stdout or sys.stderr)\n        self.wrapped = wrapped\n\n        # should we reset colors to defaults after every .write()\n        self.autoreset = autoreset\n\n        # create the proxy wrapping our output stream\n        self.stream = StreamWrapper(wrapped, self)\n\n        on_windows = os.name == 'nt'\n        # We test if the WinAPI works, because even if we are on Windows\n        # we may be using a terminal that doesn't support the WinAPI\n        # (e.g. Cygwin Terminal). In this case it's up to the terminal\n        # to support the ANSI codes.\n        conversion_supported = on_windows and winapi_test()\n\n        # should we strip ANSI sequences from our output?\n        if strip is None:\n            strip = conversion_supported or (not self.stream.closed and not self.stream.isatty())\n        self.strip = strip\n\n        # should we should convert ANSI sequences into win32 calls?\n        if convert is None:\n            convert = conversion_supported and not self.stream.closed and self.stream.isatty()\n        self.convert = convert\n\n        # dict of ansi codes to win32 functions and parameters\n        self.win32_calls = self.get_win32_calls()\n\n        # are we wrapping stderr?\n        self.on_stderr = self.wrapped is sys.stderr\n\n    def should_wrap(self):\n        '''\n        True if this class is actually needed. If false, then the output\n        stream will not be affected, nor will win32 calls be issued, so\n        wrapping stdout is not actually required. This will generally be\n        False on non-Windows platforms, unless optional functionality like\n        autoreset has been requested using kwargs to init()\n        '''\n        return self.convert or self.strip or self.autoreset\n\n    def get_win32_calls(self):\n        if self.convert and winterm:\n            return {\n                AnsiStyle.RESET_ALL: (winterm.reset_all, ),\n                AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT),\n                AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL),\n                AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL),\n                AnsiFore.BLACK: (winterm.fore, WinColor.BLACK),\n                AnsiFore.RED: (winterm.fore, WinColor.RED),\n                AnsiFore.GREEN: (winterm.fore, WinColor.GREEN),\n                AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW),\n                AnsiFore.BLUE: (winterm.fore, WinColor.BLUE),\n                AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA),\n                AnsiFore.CYAN: (winterm.fore, WinColor.CYAN),\n                AnsiFore.WHITE: (winterm.fore, WinColor.GREY),\n                AnsiFore.RESET: (winterm.fore, ),\n                AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True),\n                AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True),\n                AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True),\n                AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True),\n                AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True),\n                AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True),\n                AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True),\n                AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True),\n                AnsiBack.BLACK: (winterm.back, WinColor.BLACK),\n                AnsiBack.RED: (winterm.back, WinColor.RED),\n                AnsiBack.GREEN: (winterm.back, WinColor.GREEN),\n                AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW),\n                AnsiBack.BLUE: (winterm.back, WinColor.BLUE),\n                AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA),\n                AnsiBack.CYAN: (winterm.back, WinColor.CYAN),\n                AnsiBack.WHITE: (winterm.back, WinColor.GREY),\n                AnsiBack.RESET: (winterm.back, ),\n                AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True),\n                AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True),\n                AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True),\n                AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True),\n                AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True),\n                AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True),\n                AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True),\n                AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True),\n            }\n        return dict()\n\n    def write(self, text):\n        if self.strip or self.convert:\n            self.write_and_convert(text)\n        else:\n            self.wrapped.write(text)\n            self.wrapped.flush()\n        if self.autoreset:\n            self.reset_all()\n\n\n    def reset_all(self):\n        if self.convert:\n            self.call_win32('m', (0,))\n        elif not self.strip and not self.stream.closed:\n            self.wrapped.write(Style.RESET_ALL)\n\n\n    def write_and_convert(self, text):\n        '''\n        Write the given text to our wrapped stream, stripping any ANSI\n        sequences from the text, and optionally converting them into win32\n        calls.\n        '''\n        cursor = 0\n        text = self.convert_osc(text)\n        for match in self.ANSI_CSI_RE.finditer(text):\n            start, end = match.span()\n            self.write_plain_text(text, cursor, start)\n            self.convert_ansi(*match.groups())\n            cursor = end\n        self.write_plain_text(text, cursor, len(text))\n\n\n    def write_plain_text(self, text, start, end):\n        if start < end:\n            self.wrapped.write(text[start:end])\n            self.wrapped.flush()\n\n\n    def convert_ansi(self, paramstring, command):\n        if self.convert:\n            params = self.extract_params(command, paramstring)\n            self.call_win32(command, params)\n\n\n    def extract_params(self, command, paramstring):\n        if command in 'Hf':\n            params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';'))\n            while len(params) < 2:\n                # defaults:\n                params = params + (1,)\n        else:\n            params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0)\n            if len(params) == 0:\n                # defaults:\n                if command in 'JKm':\n                    params = (0,)\n                elif command in 'ABCD':\n                    params = (1,)\n\n        return params\n\n\n    def call_win32(self, command, params):\n        if command == 'm':\n            for param in params:\n                if param in self.win32_calls:\n                    func_args = self.win32_calls[param]\n                    func = func_args[0]\n                    args = func_args[1:]\n                    kwargs = dict(on_stderr=self.on_stderr)\n                    func(*args, **kwargs)\n        elif command in 'J':\n            winterm.erase_screen(params[0], on_stderr=self.on_stderr)\n        elif command in 'K':\n            winterm.erase_line(params[0], on_stderr=self.on_stderr)\n        elif command in 'Hf':     # cursor position - absolute\n            winterm.set_cursor_position(params, on_stderr=self.on_stderr)\n        elif command in 'ABCD':   # cursor position - relative\n            n = params[0]\n            # A - up, B - down, C - forward, D - back\n            x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command]\n            winterm.cursor_adjust(x, y, on_stderr=self.on_stderr)\n\n\n    def convert_osc(self, text):\n        for match in self.ANSI_OSC_RE.finditer(text):\n            start, end = match.span()\n            text = text[:start] + text[end:]\n            paramstring, command = match.groups()\n            if command == BEL:\n                if paramstring.count(\";\") == 1:\n                    params = paramstring.split(\";\")\n                    # 0 - change title and icon (we will only change title)\n                    # 1 - change icon (we don't support this)\n                    # 2 - change title\n                    if params[0] in '02':\n                        winterm.set_title(params[1])\n        return text\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/initialise.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\nimport atexit\nimport contextlib\nimport sys\n\nfrom .ansitowin32 import AnsiToWin32\n\n\norig_stdout = None\norig_stderr = None\n\nwrapped_stdout = None\nwrapped_stderr = None\n\natexit_done = False\n\n\ndef reset_all():\n    if AnsiToWin32 is not None:    # Issue #74: objects might become None at exit\n        AnsiToWin32(orig_stdout).reset_all()\n\n\ndef init(autoreset=False, convert=None, strip=None, wrap=True):\n\n    if not wrap and any([autoreset, convert, strip]):\n        raise ValueError('wrap=False conflicts with any other arg=True')\n\n    global wrapped_stdout, wrapped_stderr\n    global orig_stdout, orig_stderr\n\n    orig_stdout = sys.stdout\n    orig_stderr = sys.stderr\n\n    if sys.stdout is None:\n        wrapped_stdout = None\n    else:\n        sys.stdout = wrapped_stdout = \\\n            wrap_stream(orig_stdout, convert, strip, autoreset, wrap)\n    if sys.stderr is None:\n        wrapped_stderr = None\n    else:\n        sys.stderr = wrapped_stderr = \\\n            wrap_stream(orig_stderr, convert, strip, autoreset, wrap)\n\n    global atexit_done\n    if not atexit_done:\n        atexit.register(reset_all)\n        atexit_done = True\n\n\ndef deinit():\n    if orig_stdout is not None:\n        sys.stdout = orig_stdout\n    if orig_stderr is not None:\n        sys.stderr = orig_stderr\n\n\n@contextlib.contextmanager\ndef colorama_text(*args, **kwargs):\n    init(*args, **kwargs)\n    try:\n        yield\n    finally:\n        deinit()\n\n\ndef reinit():\n    if wrapped_stdout is not None:\n        sys.stdout = wrapped_stdout\n    if wrapped_stderr is not None:\n        sys.stderr = wrapped_stderr\n\n\ndef wrap_stream(stream, convert, strip, autoreset, wrap):\n    if wrap:\n        wrapper = AnsiToWin32(stream,\n            convert=convert, strip=strip, autoreset=autoreset)\n        if wrapper.should_wrap():\n            stream = wrapper.stream\n    return stream\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/win32.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\n\n# from winbase.h\nSTDOUT = -11\nSTDERR = -12\n\ntry:\n    import ctypes\n    from ctypes import LibraryLoader\n    windll = LibraryLoader(ctypes.WinDLL)\n    from ctypes import wintypes\nexcept (AttributeError, ImportError):\n    windll = None\n    SetConsoleTextAttribute = lambda *_: None\n    winapi_test = lambda *_: None\nelse:\n    from ctypes import byref, Structure, c_char, POINTER\n\n    COORD = wintypes._COORD\n\n    class CONSOLE_SCREEN_BUFFER_INFO(Structure):\n        \"\"\"struct in wincon.h.\"\"\"\n        _fields_ = [\n            (\"dwSize\", COORD),\n            (\"dwCursorPosition\", COORD),\n            (\"wAttributes\", wintypes.WORD),\n            (\"srWindow\", wintypes.SMALL_RECT),\n            (\"dwMaximumWindowSize\", COORD),\n        ]\n        def __str__(self):\n            return '(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)' % (\n                self.dwSize.Y, self.dwSize.X\n                , self.dwCursorPosition.Y, self.dwCursorPosition.X\n                , self.wAttributes\n                , self.srWindow.Top, self.srWindow.Left, self.srWindow.Bottom, self.srWindow.Right\n                , self.dwMaximumWindowSize.Y, self.dwMaximumWindowSize.X\n            )\n\n    _GetStdHandle = windll.kernel32.GetStdHandle\n    _GetStdHandle.argtypes = [\n        wintypes.DWORD,\n    ]\n    _GetStdHandle.restype = wintypes.HANDLE\n\n    _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo\n    _GetConsoleScreenBufferInfo.argtypes = [\n        wintypes.HANDLE,\n        POINTER(CONSOLE_SCREEN_BUFFER_INFO),\n    ]\n    _GetConsoleScreenBufferInfo.restype = wintypes.BOOL\n\n    _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute\n    _SetConsoleTextAttribute.argtypes = [\n        wintypes.HANDLE,\n        wintypes.WORD,\n    ]\n    _SetConsoleTextAttribute.restype = wintypes.BOOL\n\n    _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition\n    _SetConsoleCursorPosition.argtypes = [\n        wintypes.HANDLE,\n        COORD,\n    ]\n    _SetConsoleCursorPosition.restype = wintypes.BOOL\n\n    _FillConsoleOutputCharacterA = windll.kernel32.FillConsoleOutputCharacterA\n    _FillConsoleOutputCharacterA.argtypes = [\n        wintypes.HANDLE,\n        c_char,\n        wintypes.DWORD,\n        COORD,\n        POINTER(wintypes.DWORD),\n    ]\n    _FillConsoleOutputCharacterA.restype = wintypes.BOOL\n\n    _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute\n    _FillConsoleOutputAttribute.argtypes = [\n        wintypes.HANDLE,\n        wintypes.WORD,\n        wintypes.DWORD,\n        COORD,\n        POINTER(wintypes.DWORD),\n    ]\n    _FillConsoleOutputAttribute.restype = wintypes.BOOL\n\n    _SetConsoleTitleW = windll.kernel32.SetConsoleTitleW\n    _SetConsoleTitleW.argtypes = [\n        wintypes.LPCWSTR\n    ]\n    _SetConsoleTitleW.restype = wintypes.BOOL\n\n    def _winapi_test(handle):\n        csbi = CONSOLE_SCREEN_BUFFER_INFO()\n        success = _GetConsoleScreenBufferInfo(\n            handle, byref(csbi))\n        return bool(success)\n\n    def winapi_test():\n        return any(_winapi_test(h) for h in\n                   (_GetStdHandle(STDOUT), _GetStdHandle(STDERR)))\n\n    def GetConsoleScreenBufferInfo(stream_id=STDOUT):\n        handle = _GetStdHandle(stream_id)\n        csbi = CONSOLE_SCREEN_BUFFER_INFO()\n        success = _GetConsoleScreenBufferInfo(\n            handle, byref(csbi))\n        return csbi\n\n    def SetConsoleTextAttribute(stream_id, attrs):\n        handle = _GetStdHandle(stream_id)\n        return _SetConsoleTextAttribute(handle, attrs)\n\n    def SetConsoleCursorPosition(stream_id, position, adjust=True):\n        position = COORD(*position)\n        # If the position is out of range, do nothing.\n        if position.Y <= 0 or position.X <= 0:\n            return\n        # Adjust for Windows' SetConsoleCursorPosition:\n        #    1. being 0-based, while ANSI is 1-based.\n        #    2. expecting (x,y), while ANSI uses (y,x).\n        adjusted_position = COORD(position.Y - 1, position.X - 1)\n        if adjust:\n            # Adjust for viewport's scroll position\n            sr = GetConsoleScreenBufferInfo(STDOUT).srWindow\n            adjusted_position.Y += sr.Top\n            adjusted_position.X += sr.Left\n        # Resume normal processing\n        handle = _GetStdHandle(stream_id)\n        return _SetConsoleCursorPosition(handle, adjusted_position)\n\n    def FillConsoleOutputCharacter(stream_id, char, length, start):\n        handle = _GetStdHandle(stream_id)\n        char = c_char(char.encode())\n        length = wintypes.DWORD(length)\n        num_written = wintypes.DWORD(0)\n        # Note that this is hard-coded for ANSI (vs wide) bytes.\n        success = _FillConsoleOutputCharacterA(\n            handle, char, length, start, byref(num_written))\n        return num_written.value\n\n    def FillConsoleOutputAttribute(stream_id, attr, length, start):\n        ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )'''\n        handle = _GetStdHandle(stream_id)\n        attribute = wintypes.WORD(attr)\n        length = wintypes.DWORD(length)\n        num_written = wintypes.DWORD(0)\n        # Note that this is hard-coded for ANSI (vs wide) bytes.\n        return _FillConsoleOutputAttribute(\n            handle, attribute, length, start, byref(num_written))\n\n    def SetConsoleTitle(title):\n        return _SetConsoleTitleW(title)\n"
  },
  {
    "path": "nuitka/build/inline_copy/colorama/colorama/winterm.py",
    "content": "# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.\nfrom . import win32\n\n\n# from wincon.h\nclass WinColor(object):\n    BLACK   = 0\n    BLUE    = 1\n    GREEN   = 2\n    CYAN    = 3\n    RED     = 4\n    MAGENTA = 5\n    YELLOW  = 6\n    GREY    = 7\n\n# from wincon.h\nclass WinStyle(object):\n    NORMAL              = 0x00 # dim text, dim background\n    BRIGHT              = 0x08 # bright text, dim background\n    BRIGHT_BACKGROUND   = 0x80 # dim text, bright background\n\nclass WinTerm(object):\n\n    def __init__(self):\n        self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes\n        self.set_attrs(self._default)\n        self._default_fore = self._fore\n        self._default_back = self._back\n        self._default_style = self._style\n        # In order to emulate LIGHT_EX in windows, we borrow the BRIGHT style.\n        # So that LIGHT_EX colors and BRIGHT style do not clobber each other,\n        # we track them separately, since LIGHT_EX is overwritten by Fore/Back\n        # and BRIGHT is overwritten by Style codes.\n        self._light = 0\n\n    def get_attrs(self):\n        return self._fore + self._back * 16 + (self._style | self._light)\n\n    def set_attrs(self, value):\n        self._fore = value & 7\n        self._back = (value >> 4) & 7\n        self._style = value & (WinStyle.BRIGHT | WinStyle.BRIGHT_BACKGROUND)\n\n    def reset_all(self, on_stderr=None):\n        self.set_attrs(self._default)\n        self.set_console(attrs=self._default)\n        self._light = 0\n\n    def fore(self, fore=None, light=False, on_stderr=False):\n        if fore is None:\n            fore = self._default_fore\n        self._fore = fore\n        # Emulate LIGHT_EX with BRIGHT Style\n        if light:\n            self._light |= WinStyle.BRIGHT\n        else:\n            self._light &= ~WinStyle.BRIGHT\n        self.set_console(on_stderr=on_stderr)\n\n    def back(self, back=None, light=False, on_stderr=False):\n        if back is None:\n            back = self._default_back\n        self._back = back\n        # Emulate LIGHT_EX with BRIGHT_BACKGROUND Style\n        if light:\n            self._light |= WinStyle.BRIGHT_BACKGROUND\n        else:\n            self._light &= ~WinStyle.BRIGHT_BACKGROUND\n        self.set_console(on_stderr=on_stderr)\n\n    def style(self, style=None, on_stderr=False):\n        if style is None:\n            style = self._default_style\n        self._style = style\n        self.set_console(on_stderr=on_stderr)\n\n    def set_console(self, attrs=None, on_stderr=False):\n        if attrs is None:\n            attrs = self.get_attrs()\n        handle = win32.STDOUT\n        if on_stderr:\n            handle = win32.STDERR\n        win32.SetConsoleTextAttribute(handle, attrs)\n\n    def get_position(self, handle):\n        position = win32.GetConsoleScreenBufferInfo(handle).dwCursorPosition\n        # Because Windows coordinates are 0-based,\n        # and win32.SetConsoleCursorPosition expects 1-based.\n        position.X += 1\n        position.Y += 1\n        return position\n\n    def set_cursor_position(self, position=None, on_stderr=False):\n        if position is None:\n            # I'm not currently tracking the position, so there is no default.\n            # position = self.get_position()\n            return\n        handle = win32.STDOUT\n        if on_stderr:\n            handle = win32.STDERR\n        win32.SetConsoleCursorPosition(handle, position)\n\n    def cursor_adjust(self, x, y, on_stderr=False):\n        handle = win32.STDOUT\n        if on_stderr:\n            handle = win32.STDERR\n        position = self.get_position(handle)\n        adjusted_position = (position.Y + y, position.X + x)\n        win32.SetConsoleCursorPosition(handle, adjusted_position, adjust=False)\n\n    def erase_screen(self, mode=0, on_stderr=False):\n        # 0 should clear from the cursor to the end of the screen.\n        # 1 should clear from the cursor to the beginning of the screen.\n        # 2 should clear the entire screen, and move cursor to (1,1)\n        handle = win32.STDOUT\n        if on_stderr:\n            handle = win32.STDERR\n        csbi = win32.GetConsoleScreenBufferInfo(handle)\n        # get the number of character cells in the current buffer\n        cells_in_screen = csbi.dwSize.X * csbi.dwSize.Y\n        # get number of character cells before current cursor position\n        cells_before_cursor = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X\n        if mode == 0:\n            from_coord = csbi.dwCursorPosition\n            cells_to_erase = cells_in_screen - cells_before_cursor\n        elif mode == 1:\n            from_coord = win32.COORD(0, 0)\n            cells_to_erase = cells_before_cursor\n        elif mode == 2:\n            from_coord = win32.COORD(0, 0)\n            cells_to_erase = cells_in_screen\n        else:\n            # invalid mode\n            return\n        # fill the entire screen with blanks\n        win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord)\n        # now set the buffer's attributes accordingly\n        win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord)\n        if mode == 2:\n            # put the cursor where needed\n            win32.SetConsoleCursorPosition(handle, (1, 1))\n\n    def erase_line(self, mode=0, on_stderr=False):\n        # 0 should clear from the cursor to the end of the line.\n        # 1 should clear from the cursor to the beginning of the line.\n        # 2 should clear the entire line.\n        handle = win32.STDOUT\n        if on_stderr:\n            handle = win32.STDERR\n        csbi = win32.GetConsoleScreenBufferInfo(handle)\n        if mode == 0:\n            from_coord = csbi.dwCursorPosition\n            cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X\n        elif mode == 1:\n            from_coord = win32.COORD(0, csbi.dwCursorPosition.Y)\n            cells_to_erase = csbi.dwCursorPosition.X\n        elif mode == 2:\n            from_coord = win32.COORD(0, csbi.dwCursorPosition.Y)\n            cells_to_erase = csbi.dwSize.X\n        else:\n            # invalid mode\n            return\n        # fill the entire screen with blanks\n        win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord)\n        # now set the buffer's attributes accordingly\n        win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord)\n\n    def set_title(self, title):\n        win32.SetConsoleTitle(title)\n"
  },
  {
    "path": "nuitka/build/inline_copy/glob2/LICENSE",
    "content": "﻿Copyright (c) 2008, Michael Elsdörfer <http://elsdoerfer.name>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n    1. Redistributions of source code must retain the above copyright\n       notice, this list of conditions and the following disclaimer.\n\n    2. Redistributions in binary form must reproduce the above\n       copyright notice, this list of conditions and the following\n       disclaimer in the documentation and/or other materials\n       provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\nFOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\nCOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "nuitka/build/inline_copy/glob2/glob2/__init__.py",
    "content": "from __future__ import absolute_import\nfrom .impl import *\n\n\n__version__ = (0, 7)\n"
  },
  {
    "path": "nuitka/build/inline_copy/glob2/glob2/compat.py",
    "content": "# Back-port functools.lru_cache to Python 2 (and <= 3.2)\n# {{{ http://code.activestate.com/recipes/578078/ (r6)\n\nfrom collections import namedtuple\nfrom functools import update_wrapper\nfrom threading import RLock\n\n_CacheInfo = namedtuple(\"CacheInfo\", [\"hits\", \"misses\", \"maxsize\", \"currsize\"])\n\nclass _HashedSeq(list):\n    __slots__ = 'hashvalue'\n\n    def __init__(self, tup, hash=hash):\n        self[:] = tup\n        self.hashvalue = hash(tup)\n\n    def __hash__(self):\n        return self.hashvalue\n\ndef _make_key(args, kwds, typed,\n             kwd_mark = (object(),),\n             fasttypes = set((int, str, frozenset, type(None))),\n             sorted=sorted, tuple=tuple, type=type, len=len):\n    'Make a cache key from optionally typed positional and keyword arguments'\n    key = args\n    if kwds:\n        sorted_items = sorted(kwds.items())\n        key += kwd_mark\n        for item in sorted_items:\n            key += item\n    if typed:\n        key += tuple(type(v) for v in args)\n        if kwds:\n            key += tuple(type(v) for k, v in sorted_items)\n    elif len(key) == 1 and type(key[0]) in fasttypes:\n        return key[0]\n    return _HashedSeq(key)\n\ndef lru_cache(maxsize=100, typed=False):\n    \"\"\"Least-recently-used cache decorator.\n\n    If *maxsize* is set to None, the LRU features are disabled and the cache\n    can grow without bound.\n\n    If *typed* is True, arguments of different types will be cached separately.\n    For example, f(3.0) and f(3) will be treated as distinct calls with\n    distinct results.\n\n    Arguments to the cached function must be hashable.\n\n    View the cache statistics named tuple (hits, misses, maxsize, currsize) with\n    f.cache_info().  Clear the cache and statistics with f.cache_clear().\n    Access the underlying function with f.__wrapped__.\n\n    See:  http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used\n\n    \"\"\"\n\n    # Users should only access the lru_cache through its public API:\n    #       cache_info, cache_clear, and f.__wrapped__\n    # The internals of the lru_cache are encapsulated for thread safety and\n    # to allow the implementation to change (including a possible C version).\n\n    def decorating_function(user_function):\n\n        cache = dict()\n        stats = [0, 0]                  # make statistics updateable non-locally\n        HITS, MISSES = 0, 1             # names for the stats fields\n        make_key = _make_key\n        cache_get = cache.get           # bound method to lookup key or return None\n        _len = len                      # localize the global len() function\n        lock = RLock()                  # because linkedlist updates aren't threadsafe\n        root = []                       # root of the circular doubly linked list\n        root[:] = [root, root, None, None]      # initialize by pointing to self\n        nonlocal_root = [root]                  # make updateable non-locally\n        PREV, NEXT, KEY, RESULT = 0, 1, 2, 3    # names for the link fields\n\n        if maxsize == 0:\n\n            def wrapper(*args, **kwds):\n                # no caching, just do a statistics update after a successful call\n                result = user_function(*args, **kwds)\n                stats[MISSES] += 1\n                return result\n\n        elif maxsize is None:\n\n            def wrapper(*args, **kwds):\n                # simple caching without ordering or size limit\n                key = make_key(args, kwds, typed)\n                result = cache_get(key, root)   # root used here as a unique not-found sentinel\n                if result is not root:\n                    stats[HITS] += 1\n                    return result\n                result = user_function(*args, **kwds)\n                cache[key] = result\n                stats[MISSES] += 1\n                return result\n\n        else:\n\n            def wrapper(*args, **kwds):\n                # size limited caching that tracks accesses by recency\n                key = make_key(args, kwds, typed) if kwds or typed else args\n                with lock:\n                    link = cache_get(key)\n                    if link is not None:\n                        # record recent use of the key by moving it to the front of the list\n                        root, = nonlocal_root\n                        link_prev, link_next, key, result = link\n                        link_prev[NEXT] = link_next\n                        link_next[PREV] = link_prev\n                        last = root[PREV]\n                        last[NEXT] = root[PREV] = link\n                        link[PREV] = last\n                        link[NEXT] = root\n                        stats[HITS] += 1\n                        return result\n                result = user_function(*args, **kwds)\n                with lock:\n                    root, = nonlocal_root\n                    if key in cache:\n                        # getting here means that this same key was added to the\n                        # cache while the lock was released.  since the link\n                        # update is already done, we need only return the\n                        # computed result and update the count of misses.\n                        pass\n                    elif _len(cache) >= maxsize:\n                        # use the old root to store the new key and result\n                        oldroot = root\n                        oldroot[KEY] = key\n                        oldroot[RESULT] = result\n                        # empty the oldest link and make it the new root\n                        root = nonlocal_root[0] = oldroot[NEXT]\n                        oldkey = root[KEY]\n                        oldvalue = root[RESULT]\n                        root[KEY] = root[RESULT] = None\n                        # now update the cache dictionary for the new links\n                        del cache[oldkey]\n                        cache[key] = oldroot\n                    else:\n                        # put result in a new link at the front of the list\n                        last = root[PREV]\n                        link = [last, root, key, result]\n                        last[NEXT] = root[PREV] = cache[key] = link\n                    stats[MISSES] += 1\n                return result\n\n        def cache_info():\n            \"\"\"Report cache statistics\"\"\"\n            with lock:\n                return _CacheInfo(stats[HITS], stats[MISSES], maxsize, len(cache))\n\n        def cache_clear():\n            \"\"\"Clear the cache and cache statistics\"\"\"\n            with lock:\n                cache.clear()\n                root = nonlocal_root[0]\n                root[:] = [root, root, None, None]\n                stats[:] = [0, 0]\n\n        wrapper.__wrapped__ = user_function\n        wrapper.cache_info = cache_info\n        wrapper.cache_clear = cache_clear\n        return update_wrapper(wrapper, user_function)\n\n    return decorating_function"
  },
  {
    "path": "nuitka/build/inline_copy/glob2/glob2/fnmatch.py",
    "content": "\"\"\"Filename matching with shell patterns.\n\nfnmatch(FILENAME, PATTERN) matches according to the local convention.\nfnmatchcase(FILENAME, PATTERN) always takes case in account.\n\nThe functions operate by translating the pattern into a regular\nexpression.  They cache the compiled regular expressions for speed.\n\nThe function translate(PATTERN) returns a regular expression\ncorresponding to PATTERN.  (It does not compile it.)\n\"\"\"\nimport os\nimport re\ntry:\n    from functools import lru_cache\nexcept ImportError:\n    from .compat import lru_cache\n\n__all__ = [\"filter\", \"fnmatch\", \"fnmatchcase\", \"translate\"]\n\n\ndef _norm_paths(path, norm_paths, sep):\n    if norm_paths is None:\n        path = re.sub(r'\\/', sep or os.sep, path)  # cached internally\n    elif norm_paths:\n        path = os.path.normcase(path)\n    return path\n\n\ndef fnmatch(name, pat, norm_paths=True, case_sensitive=True, sep=None):\n    \"\"\"Test whether FILENAME matches PATTERN.\n\n    Patterns are Unix shell style:\n\n    *       matches everything\n    ?       matches any single character\n    [seq]   matches any character in seq\n    [!seq]  matches any char not in seq\n\n    An initial period in FILENAME is not special.\n    Both FILENAME and PATTERN are first case-normalized\n    if the operating system requires it.\n    If you don't want this, use fnmatchcase(FILENAME, PATTERN).\n\n    :param slashes:\n    :param norm_paths:\n        A tri-state boolean:\n        when true, invokes `os.path,.normcase()` on both paths,\n        when `None`, just equalize slashes/backslashes to `os.sep`,\n        when false, does not touch paths at all.\n\n        Note that a side-effect of `normcase()` on *Windows* is that\n        it converts to lower-case all matches of `?glob()` functions.\n    :param case_sensitive:\n        defines the case-sensitiviness of regex doing the matches\n    :param sep:\n        in case only slahes replaced, what sep-char to substitute with;\n        if false, `os.sep` is used.\n\n    Notice that by default, `normcase()` causes insensitive matching\n    on *Windows*, regardless of `case_insensitive` param.\n    Set ``norm_paths=None, case_sensitive=False`` to preserve\n    verbatim mathces.\n    \"\"\"\n    name, pat = [_norm_paths(p, norm_paths, sep)\n                 for p in (name, pat)]\n\n    return fnmatchcase(name, pat, case_sensitive=case_sensitive)\n\n\n@lru_cache(maxsize=256, typed=True)\ndef _compile_pattern(pat, case_sensitive):\n    if isinstance(pat, bytes):\n        pat_str = pat.decode('ISO-8859-1')\n        res_str = translate(pat_str)\n        res = res_str.encode('ISO-8859-1')\n    else:\n        res = translate(pat)\n    flags = 0 if case_sensitive else re.IGNORECASE\n    return re.compile(res, flags).match\n\n\ndef filter(names, pat, norm_paths=True, case_sensitive=True, sep=None):\n    \"\"\"Return the subset of the list NAMES that match PAT.\"\"\"\n    result = []\n    pat = _norm_paths(pat, norm_paths, sep)\n    match = _compile_pattern(pat, case_sensitive)\n    for name in names:\n        m = match(_norm_paths(name, norm_paths, sep))\n        if m:\n            result.append((name,\n                           tuple(_norm_paths(p, norm_paths, sep) for p in m.groups())))\n    return result\n\n\ndef fnmatchcase(name, pat, case_sensitive=True):\n    \"\"\"Test whether FILENAME matches PATTERN, including case.\n\n    This is a version of fnmatch() which doesn't case-normalize\n    its arguments.\n    \"\"\"\n    match = _compile_pattern(pat, case_sensitive)\n    return match(name) is not None\n\n\ndef translate(pat):\n    \"\"\"Translate a shell PATTERN to a regular expression.\n\n    There is no way to quote meta-characters.\n    \"\"\"\n\n    i, n = 0, len(pat)\n    res = ''\n    while i < n:\n        c = pat[i]\n        i = i+1\n        if c == '*':\n            res = res + '(.*)'\n        elif c == '?':\n            res = res + '(.)'\n        elif c == '[':\n            j = i\n            if j < n and pat[j] == '!':\n                j = j+1\n            if j < n and pat[j] == ']':\n                j = j+1\n            while j < n and pat[j] != ']':\n                j = j+1\n            if j >= n:\n                res = res + '\\\\['\n            else:\n                stuff = pat[i:j].replace('\\\\','\\\\\\\\')\n                i = j+1\n                if stuff[0] == '!':\n                    stuff = '^' + stuff[1:]\n                elif stuff[0] == '^':\n                    stuff = '\\\\' + stuff\n                res = '%s([%s])' % (res, stuff)\n        else:\n            res = res + re.escape(c)\n    return '(?ms)' + res + '\\Z'\n"
  },
  {
    "path": "nuitka/build/inline_copy/glob2/glob2/impl.py",
    "content": "\"\"\"Filename globbing utility.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport sys\nimport os\nimport re\nfrom os.path import join\nfrom . import fnmatch\n\ntry:\n    from itertools import imap\nexcept ImportError:\n    imap = map\n\n\nclass Globber(object):\n\n    listdir = staticmethod(os.listdir)\n    isdir = staticmethod(os.path.isdir)\n    islink = staticmethod(os.path.islink)\n    exists = staticmethod(os.path.lexists)\n\n    def walk(self, top, followlinks=False, sep=None):\n        \"\"\"A simplified version of os.walk (code copied) that uses\n        ``self.listdir``, and the other local filesystem methods.\n\n        Because we don't care about file/directory distinctions, only\n        a single list is returned.\n        \"\"\"\n        try:\n            names = self.listdir(top)\n        except os.error as err:\n            return\n\n        items = []\n        for name in names:\n            items.append(name)\n\n        yield top, items\n\n        for name in items:\n            new_path = _join_paths([top, name], sep=sep)\n            if followlinks or not self.islink(new_path):\n                for x in self.walk(new_path, followlinks):\n                    yield x\n\n    def glob(self, pathname, with_matches=False, include_hidden=False, recursive=True,\n             norm_paths=True, case_sensitive=True, sep=None):\n        \"\"\"Return a list of paths matching a pathname pattern.\n\n        The pattern may contain simple shell-style wildcards a la\n        fnmatch. However, unlike fnmatch, filenames starting with a\n        dot are special cases that are not matched by '*' and '?'\n        patterns.\n\n        If ``include_hidden`` is True, then files and folders starting with\n        a dot are also returned.\n        \"\"\"\n        return list(self.iglob(pathname, with_matches, include_hidden,\n                               norm_paths, case_sensitive, sep))\n\n    def iglob(self, pathname, with_matches=False, include_hidden=False, recursive=True,\n              norm_paths=True, case_sensitive=True, sep=None):\n        \"\"\"Return an iterator which yields the paths matching a pathname\n        pattern.\n\n        The pattern may contain simple shell-style wildcards a la\n        fnmatch. However, unlike fnmatch, filenames starting with a\n        dot are special cases that are not matched by '*' and '?'\n        patterns.\n\n        If ``with_matches`` is True, then for each matching path\n        a 2-tuple will be returned; the second element if the tuple\n        will be a list of the parts of the path that matched the individual\n        wildcards.\n\n        If ``include_hidden`` is True, then files and folders starting with\n        a dot are also returned.\n        \"\"\"\n        result = self._iglob(pathname, True, include_hidden,\n                             norm_paths, case_sensitive, sep)\n        if with_matches:\n            return result\n        return imap(lambda s: s[0], result)\n\n    def _iglob(self, pathname, rootcall, include_hidden,\n               norm_paths, case_sensitive, sep):\n        \"\"\"Internal implementation that backs :meth:`iglob`.\n\n        ``rootcall`` is required to differentiate between the user's call to\n        iglob(), and subsequent recursive calls, for the purposes of resolving\n        certain special cases of ** wildcards. Specifically, \"**\" is supposed\n        to include the current directory for purposes of globbing, but the\n        directory itself should never be returned. So if ** is the lastmost\n        part of the ``pathname`` given the user to the root call, we want to\n        ignore the current directory. For this, we need to know which the root\n        call is.\n        \"\"\"\n\n        # Short-circuit if no glob magic\n        if not has_magic(pathname):\n            if self.exists(pathname):\n                yield pathname, ()\n            return\n\n        # If no directory part is left, assume the working directory\n        dirname, basename = os.path.split(pathname)\n\n        # If the directory is globbed, recurse to resolve.\n        # If at this point there is no directory part left, we simply\n        # continue with dirname=\"\", which will search the current dir.\n        # `os.path.split()` returns the argument itself as a dirname if it is a\n        # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path\n        # contains magic characters (i.e. r'\\\\?\\C:').\n        if dirname != pathname and has_magic(dirname):\n            # Note that this may return files, which will be ignored\n            # later when we try to use them as directories.\n            # Prefiltering them here would only require more IO ops.\n            dirs = self._iglob(dirname, False, include_hidden,\n                               norm_paths, case_sensitive, sep)\n        else:\n            dirs = [(dirname, ())]\n\n        # Resolve ``basename`` expr for every directory found\n        for dirname, dir_groups in dirs:\n            for name, groups in self.resolve_pattern(dirname, basename,\n                                                     not rootcall, include_hidden,\n                                                     norm_paths, case_sensitive, sep):\n                yield _join_paths([dirname, name], sep=sep), dir_groups + groups\n\n    def resolve_pattern(self, dirname, pattern, globstar_with_root, include_hidden,\n                        norm_paths, case_sensitive, sep):\n        \"\"\"Apply ``pattern`` (contains no path elements) to the\n        literal directory in ``dirname``.\n\n        If pattern=='', this will filter for directories. This is\n        a special case that happens when the user's glob expression ends\n        with a slash (in which case we only want directories). It simpler\n        and faster to filter here than in :meth:`_iglob`.\n        \"\"\"\n\n        if sys.version_info[0] == 3:\n            if isinstance(pattern, bytes):\n                dirname = bytes(os.curdir, 'ASCII')\n        else:\n            if isinstance(pattern, unicode) and not isinstance(dirname, unicode):\n                dirname = unicode(dirname, sys.getfilesystemencoding() or\n                                           sys.getdefaultencoding())\n\n        # If no magic, short-circuit, only check for existence\n        if not has_magic(pattern):\n            if pattern == '':\n                if self.isdir(dirname):\n                    return [(pattern, ())]\n            else:\n                if self.exists(_join_paths([dirname, pattern], sep=sep)):\n                    return [(pattern, ())]\n            return []\n\n        if not dirname:\n            dirname = os.curdir\n\n        try:\n            if pattern == '**':\n                # Include the current directory in **, if asked; by adding\n                # an empty string as opposed to '.', we spare ourselves\n                # having to deal with os.path.normpath() later.\n                names = [''] if globstar_with_root else []\n                for top, entries in self.walk(dirname, sep=sep):\n                    _mkabs = lambda s: _join_paths([top[len(dirname) + 1:], s], sep=sep)\n                    names.extend(map(_mkabs, entries))\n                # Reset pattern so that fnmatch(), which does not understand\n                # ** specifically, will only return a single group match.\n                pattern = '*'\n            else:\n                names = self.listdir(dirname)\n        except os.error:\n            return []\n\n        if not include_hidden and not _ishidden(pattern):\n            # Remove hidden files, but take care to ensure\n            # that the empty string we may have added earlier remains.\n            # Do not filter out the '' that we might have added earlier\n            names = filter(lambda x: not x or not _ishidden(x), names)\n        return fnmatch.filter(names, pattern, norm_paths, case_sensitive, sep)\n\n\ndefault_globber = Globber()\nglob = default_globber.glob\niglob = default_globber.iglob\ndel default_globber\n\n\nmagic_check = re.compile('[*?[]')\nmagic_check_bytes = re.compile(b'[*?[]')\n\n\ndef has_magic(s):\n    if isinstance(s, bytes):\n        match = magic_check_bytes.search(s)\n    else:\n        match = magic_check.search(s)\n    return match is not None\n\n\ndef _ishidden(path):\n    return path[0] in ('.', b'.'[0])\n\n\ndef _join_paths(paths, sep=None):\n    path = join(*paths)\n    if sep:\n        path = re.sub(r'\\/', sep, path)  # cached internally\n    return path\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/LICENSE.rst",
    "content": "Copyright 2007 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n#. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n#. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n\n#. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/README.rst",
    "content": "This is the last Jinja release to support Python2.6, which we want due\nto the RHELs.\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/__init__.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2\n    ~~~~~~\n\n    Jinja2 is a template engine written in pure Python.  It provides a\n    Django inspired non-XML syntax but supports inline expressions and\n    an optional sandboxed environment.\n\n    Nutshell\n    --------\n\n    Here a small example of a Jinja2 template::\n\n        {% extends 'base.html' %}\n        {% block title %}Memberlist{% endblock %}\n        {% block content %}\n          <ul>\n          {% for user in users %}\n            <li><a href=\"{{ user.url }}\">{{ user.username }}</a></li>\n          {% endfor %}\n          </ul>\n        {% endblock %}\n\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\n__docformat__ = 'restructuredtext en'\n__version__ = \"2.10.3\"\n\n# high level interface\nfrom jinja2.environment import Environment, Template\n\n# loaders\nfrom jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \\\n     DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \\\n     ModuleLoader\n\n# bytecode caches\nfrom jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \\\n     MemcachedBytecodeCache\n\n# undefined types\nfrom jinja2.runtime import Undefined, DebugUndefined, StrictUndefined, \\\n     make_logging_undefined\n\n# exceptions\nfrom jinja2.exceptions import TemplateError, UndefinedError, \\\n     TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \\\n     TemplateAssertionError, TemplateRuntimeError\n\n# decorators and public utilities\nfrom jinja2.filters import environmentfilter, contextfilter, \\\n     evalcontextfilter\nfrom jinja2.utils import Markup, escape, clear_caches, \\\n     environmentfunction, evalcontextfunction, contextfunction, \\\n     is_undefined, select_autoescape\n\n__all__ = [\n    'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',\n    'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',\n    'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',\n    'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',\n    'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',\n    'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',\n    'TemplateRuntimeError',\n    'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',\n    'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',\n    'evalcontextfilter', 'evalcontextfunction', 'make_logging_undefined',\n    'select_autoescape',\n]\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/_compat.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2._compat\n    ~~~~~~~~~~~~~~\n\n    Some py2/py3 compatibility support based on a stripped down\n    version of six so we don't have to depend on a specific version\n    of it.\n\n    :copyright: Copyright 2013 by the Jinja team, see AUTHORS.\n    :license: BSD, see LICENSE for details.\n\"\"\"\nimport sys\n\nPY2 = sys.version_info[0] == 2\nPYPY = hasattr(sys, 'pypy_translation_info')\n_identity = lambda x: x\n\n\nif not PY2:\n    unichr = chr\n    range_type = range\n    text_type = str\n    string_types = (str,)\n    integer_types = (int,)\n\n    iterkeys = lambda d: iter(d.keys())\n    itervalues = lambda d: iter(d.values())\n    iteritems = lambda d: iter(d.items())\n\n    import pickle\n    from io import BytesIO, StringIO\n    NativeStringIO = StringIO\n\n    def reraise(tp, value, tb=None):\n        if value.__traceback__ is not tb:\n            raise value.with_traceback(tb)\n        raise value\n\n    ifilter = filter\n    imap = map\n    izip = zip\n    intern = sys.intern\n\n    implements_iterator = _identity\n    implements_to_string = _identity\n    encode_filename = _identity\n\nelse:\n    unichr = unichr\n    text_type = unicode\n    range_type = xrange\n    string_types = (str, unicode)\n    integer_types = (int, long)\n\n    iterkeys = lambda d: d.iterkeys()\n    itervalues = lambda d: d.itervalues()\n    iteritems = lambda d: d.iteritems()\n\n    import cPickle as pickle\n    from cStringIO import StringIO as BytesIO, StringIO\n    NativeStringIO = BytesIO\n\n    exec('def reraise(tp, value, tb=None):\\n raise tp, value, tb')\n\n    from itertools import imap, izip, ifilter\n    intern = intern\n\n    def implements_iterator(cls):\n        cls.next = cls.__next__\n        del cls.__next__\n        return cls\n\n    def implements_to_string(cls):\n        cls.__unicode__ = cls.__str__\n        cls.__str__ = lambda x: x.__unicode__().encode('utf-8')\n        return cls\n\n    def encode_filename(filename):\n        if isinstance(filename, unicode):\n            return filename.encode('utf-8')\n        return filename\n\n\ndef with_metaclass(meta, *bases):\n    \"\"\"Create a base class with a metaclass.\"\"\"\n    # This requires a bit of explanation: the basic idea is to make a\n    # dummy metaclass for one level of class instantiation that replaces\n    # itself with the actual metaclass.\n    class metaclass(type):\n        def __new__(cls, name, this_bases, d):\n            return meta(name, bases, d)\n    return type.__new__(metaclass, 'temporary_class', (), {})\n\n\ntry:\n    from urllib.parse import quote_from_bytes as url_quote\nexcept ImportError:\n    from urllib import quote as url_quote\n\n\ntry:\n    from collections import abc\nexcept ImportError:\n    import collections as abc\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/_identifier.py",
    "content": "# generated by scripts/generate_identifier_pattern.py\npattern = '·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఃా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪽ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰℘℮⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯︳︴﹍-﹏＿𐇽𐋠𐍶-𐍺𐨁-𐨃𐨅𐨆𐨌-𐨏𐨸-𐨿𐨺𐫦𐫥𑀀-𑀂𑀸-𑁆𑁿-𑂂𑂰-𑂺𑄀-𑄂𑄧-𑅳𑄴𑆀-𑆂𑆳-𑇊𑇀-𑇌𑈬-𑈷𑈾𑋟-𑋪𑌀-𑌃𑌼𑌾-𑍄𑍇𑍈𑍋-𑍍𑍗𑍢𑍣𑍦-𑍬𑍰-𑍴𑐵-𑑆𑒰-𑓃𑖯-𑖵𑖸-𑗀𑗜𑗝𑘰-𑙀𑚫-𑚷𑜝-𑜫𑰯-𑰶𑰸-𑰿𑲒-𑲧𑲩-𑲶𖫰-𖫴𖬰-𖬶𖽑-𖽾𖾏-𖾒𛲝𛲞𝅥-𝅩𝅭-𝅲𝅻-𝆂𝆅-𝆋𝆪-𝆭𝉂-𝉄𝨀-𝨶𝨻-𝩬𝩵𝪄𝪛-𝪟𝪡-𝪯𞀀-𞀆𞀈-𞀘𞀛-𞀡𞀣𞀤𞀦-𞣐𞀪-𞣖𞥄-𞥊󠄀-󠇯'\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/bccache.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.bccache\n    ~~~~~~~~~~~~~~\n\n    This module implements the bytecode cache system Jinja is optionally\n    using.  This is useful if you have very complex template situations and\n    the compiliation of all those templates slow down your application too\n    much.\n\n    Situations where this is useful are often forking web applications that\n    are initialized on the first request.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom os import path, listdir\nimport os\nimport sys\nimport stat\nimport errno\nimport marshal\nimport tempfile\nimport fnmatch\nfrom hashlib import sha1\nfrom jinja2.utils import open_if_exists\nfrom jinja2._compat import BytesIO, pickle, PY2, text_type\n\n\n# marshal works better on 3.x, one hack less required\nif not PY2:\n    marshal_dump = marshal.dump\n    marshal_load = marshal.load\nelse:\n\n    def marshal_dump(code, f):\n        if isinstance(f, file):\n            marshal.dump(code, f)\n        else:\n            f.write(marshal.dumps(code))\n\n    def marshal_load(f):\n        if isinstance(f, file):\n            return marshal.load(f)\n        return marshal.loads(f.read())\n\n\nbc_version = 3\n\n# magic version used to only change with new jinja versions.  With 2.6\n# we change this to also take Python version changes into account.  The\n# reason for this is that Python tends to segfault if fed earlier bytecode\n# versions because someone thought it would be a good idea to reuse opcodes\n# or make Python incompatible with earlier versions.\nbc_magic = 'j2'.encode('ascii') + \\\n    pickle.dumps(bc_version, 2) + \\\n    pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1])\n\n\nclass Bucket(object):\n    \"\"\"Buckets are used to store the bytecode for one template.  It's created\n    and initialized by the bytecode cache and passed to the loading functions.\n\n    The buckets get an internal checksum from the cache assigned and use this\n    to automatically reject outdated cache material.  Individual bytecode\n    cache subclasses don't have to care about cache invalidation.\n    \"\"\"\n\n    def __init__(self, environment, key, checksum):\n        self.environment = environment\n        self.key = key\n        self.checksum = checksum\n        self.reset()\n\n    def reset(self):\n        \"\"\"Resets the bucket (unloads the bytecode).\"\"\"\n        self.code = None\n\n    def load_bytecode(self, f):\n        \"\"\"Loads bytecode from a file or file like object.\"\"\"\n        # make sure the magic header is correct\n        magic = f.read(len(bc_magic))\n        if magic != bc_magic:\n            self.reset()\n            return\n        # the source code of the file changed, we need to reload\n        checksum = pickle.load(f)\n        if self.checksum != checksum:\n            self.reset()\n            return\n        # if marshal_load fails then we need to reload\n        try:\n            self.code = marshal_load(f)\n        except (EOFError, ValueError, TypeError):\n            self.reset()\n            return\n\n    def write_bytecode(self, f):\n        \"\"\"Dump the bytecode into the file or file like object passed.\"\"\"\n        if self.code is None:\n            raise TypeError('can\\'t write empty bucket')\n        f.write(bc_magic)\n        pickle.dump(self.checksum, f, 2)\n        marshal_dump(self.code, f)\n\n    def bytecode_from_string(self, string):\n        \"\"\"Load bytecode from a string.\"\"\"\n        self.load_bytecode(BytesIO(string))\n\n    def bytecode_to_string(self):\n        \"\"\"Return the bytecode as string.\"\"\"\n        out = BytesIO()\n        self.write_bytecode(out)\n        return out.getvalue()\n\n\nclass BytecodeCache(object):\n    \"\"\"To implement your own bytecode cache you have to subclass this class\n    and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of\n    these methods are passed a :class:`~jinja2.bccache.Bucket`.\n\n    A very basic bytecode cache that saves the bytecode on the file system::\n\n        from os import path\n\n        class MyCache(BytecodeCache):\n\n            def __init__(self, directory):\n                self.directory = directory\n\n            def load_bytecode(self, bucket):\n                filename = path.join(self.directory, bucket.key)\n                if path.exists(filename):\n                    with open(filename, 'rb') as f:\n                        bucket.load_bytecode(f)\n\n            def dump_bytecode(self, bucket):\n                filename = path.join(self.directory, bucket.key)\n                with open(filename, 'wb') as f:\n                    bucket.write_bytecode(f)\n\n    A more advanced version of a filesystem based bytecode cache is part of\n    Jinja2.\n    \"\"\"\n\n    def load_bytecode(self, bucket):\n        \"\"\"Subclasses have to override this method to load bytecode into a\n        bucket.  If they are not able to find code in the cache for the\n        bucket, it must not do anything.\n        \"\"\"\n        raise NotImplementedError()\n\n    def dump_bytecode(self, bucket):\n        \"\"\"Subclasses have to override this method to write the bytecode\n        from a bucket back to the cache.  If it unable to do so it must not\n        fail silently but raise an exception.\n        \"\"\"\n        raise NotImplementedError()\n\n    def clear(self):\n        \"\"\"Clears the cache.  This method is not used by Jinja2 but should be\n        implemented to allow applications to clear the bytecode cache used\n        by a particular environment.\n        \"\"\"\n\n    def get_cache_key(self, name, filename=None):\n        \"\"\"Returns the unique hash key for this template name.\"\"\"\n        hash = sha1(name.encode('utf-8'))\n        if filename is not None:\n            filename = '|' + filename\n            if isinstance(filename, text_type):\n                filename = filename.encode('utf-8')\n            hash.update(filename)\n        return hash.hexdigest()\n\n    def get_source_checksum(self, source):\n        \"\"\"Returns a checksum for the source.\"\"\"\n        return sha1(source.encode('utf-8')).hexdigest()\n\n    def get_bucket(self, environment, name, filename, source):\n        \"\"\"Return a cache bucket for the given template.  All arguments are\n        mandatory but filename may be `None`.\n        \"\"\"\n        key = self.get_cache_key(name, filename)\n        checksum = self.get_source_checksum(source)\n        bucket = Bucket(environment, key, checksum)\n        self.load_bytecode(bucket)\n        return bucket\n\n    def set_bucket(self, bucket):\n        \"\"\"Put the bucket into the cache.\"\"\"\n        self.dump_bytecode(bucket)\n\n\nclass FileSystemBytecodeCache(BytecodeCache):\n    \"\"\"A bytecode cache that stores bytecode on the filesystem.  It accepts\n    two arguments: The directory where the cache items are stored and a\n    pattern string that is used to build the filename.\n\n    If no directory is specified a default cache directory is selected.  On\n    Windows the user's temp directory is used, on UNIX systems a directory\n    is created for the user in the system temp directory.\n\n    The pattern can be used to have multiple separate caches operate on the\n    same directory.  The default pattern is ``'__jinja2_%s.cache'``.  ``%s``\n    is replaced with the cache key.\n\n    >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')\n\n    This bytecode cache supports clearing of the cache using the clear method.\n    \"\"\"\n\n    def __init__(self, directory=None, pattern='__jinja2_%s.cache'):\n        if directory is None:\n            directory = self._get_default_cache_dir()\n        self.directory = directory\n        self.pattern = pattern\n\n    def _get_default_cache_dir(self):\n        def _unsafe_dir():\n            raise RuntimeError('Cannot determine safe temp directory.  You '\n                               'need to explicitly provide one.')\n\n        tmpdir = tempfile.gettempdir()\n\n        # On windows the temporary directory is used specific unless\n        # explicitly forced otherwise.  We can just use that.\n        if os.name == 'nt':\n            return tmpdir\n        if not hasattr(os, 'getuid'):\n            _unsafe_dir()\n\n        dirname = '_jinja2-cache-%d' % os.getuid()\n        actual_dir = os.path.join(tmpdir, dirname)\n\n        try:\n            os.mkdir(actual_dir, stat.S_IRWXU)\n        except OSError as e:\n            if e.errno != errno.EEXIST:\n                raise\n        try:\n            os.chmod(actual_dir, stat.S_IRWXU)\n            actual_dir_stat = os.lstat(actual_dir)\n            if actual_dir_stat.st_uid != os.getuid() \\\n               or not stat.S_ISDIR(actual_dir_stat.st_mode) \\\n               or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:\n                _unsafe_dir()\n        except OSError as e:\n            if e.errno != errno.EEXIST:\n                raise\n\n        actual_dir_stat = os.lstat(actual_dir)\n        if actual_dir_stat.st_uid != os.getuid() \\\n           or not stat.S_ISDIR(actual_dir_stat.st_mode) \\\n           or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:\n            _unsafe_dir()\n\n        return actual_dir\n\n    def _get_cache_filename(self, bucket):\n        return path.join(self.directory, self.pattern % bucket.key)\n\n    def load_bytecode(self, bucket):\n        f = open_if_exists(self._get_cache_filename(bucket), 'rb')\n        if f is not None:\n            try:\n                bucket.load_bytecode(f)\n            finally:\n                f.close()\n\n    def dump_bytecode(self, bucket):\n        f = open(self._get_cache_filename(bucket), 'wb')\n        try:\n            bucket.write_bytecode(f)\n        finally:\n            f.close()\n\n    def clear(self):\n        # imported lazily here because google app-engine doesn't support\n        # write access on the file system and the function does not exist\n        # normally.\n        from os import remove\n        files = fnmatch.filter(listdir(self.directory), self.pattern % '*')\n        for filename in files:\n            try:\n                remove(path.join(self.directory, filename))\n            except OSError:\n                pass\n\n\nclass MemcachedBytecodeCache(BytecodeCache):\n    \"\"\"This class implements a bytecode cache that uses a memcache cache for\n    storing the information.  It does not enforce a specific memcache library\n    (tummy's memcache or cmemcache) but will accept any class that provides\n    the minimal interface required.\n\n    Libraries compatible with this class:\n\n    -   `cachelib <https://github.com/pallets/cachelib>`_\n    -   `python-memcached <https://pypi.org/project/python-memcached/>`_\n\n    (Unfortunately the django cache interface is not compatible because it\n    does not support storing binary data, only unicode.  You can however pass\n    the underlying cache client to the bytecode cache which is available\n    as `django.core.cache.cache._client`.)\n\n    The minimal interface for the client passed to the constructor is this:\n\n    .. class:: MinimalClientInterface\n\n        .. method:: set(key, value[, timeout])\n\n            Stores the bytecode in the cache.  `value` is a string and\n            `timeout` the timeout of the key.  If timeout is not provided\n            a default timeout or no timeout should be assumed, if it's\n            provided it's an integer with the number of seconds the cache\n            item should exist.\n\n        .. method:: get(key)\n\n            Returns the value for the cache key.  If the item does not\n            exist in the cache the return value must be `None`.\n\n    The other arguments to the constructor are the prefix for all keys that\n    is added before the actual cache key and the timeout for the bytecode in\n    the cache system.  We recommend a high (or no) timeout.\n\n    This bytecode cache does not support clearing of used items in the cache.\n    The clear method is a no-operation function.\n\n    .. versionadded:: 2.7\n       Added support for ignoring memcache errors through the\n       `ignore_memcache_errors` parameter.\n    \"\"\"\n\n    def __init__(self, client, prefix='jinja2/bytecode/', timeout=None,\n                 ignore_memcache_errors=True):\n        self.client = client\n        self.prefix = prefix\n        self.timeout = timeout\n        self.ignore_memcache_errors = ignore_memcache_errors\n\n    def load_bytecode(self, bucket):\n        try:\n            code = self.client.get(self.prefix + bucket.key)\n        except Exception:\n            if not self.ignore_memcache_errors:\n                raise\n            code = None\n        if code is not None:\n            bucket.bytecode_from_string(code)\n\n    def dump_bytecode(self, bucket):\n        args = (self.prefix + bucket.key, bucket.bytecode_to_string())\n        if self.timeout is not None:\n            args += (self.timeout,)\n        try:\n            self.client.set(*args)\n        except Exception:\n            if not self.ignore_memcache_errors:\n                raise\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/compiler.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.compiler\n    ~~~~~~~~~~~~~~~\n\n    Compiles nodes into python code.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom itertools import chain\nfrom copy import deepcopy\nfrom keyword import iskeyword as is_python_keyword\nfrom functools import update_wrapper\nfrom jinja2 import nodes\nfrom jinja2.nodes import EvalContext\nfrom jinja2.visitor import NodeVisitor\nfrom jinja2.optimizer import Optimizer\nfrom jinja2.exceptions import TemplateAssertionError\nfrom jinja2.utils import Markup, concat, escape\nfrom jinja2._compat import range_type, text_type, string_types, \\\n     iteritems, NativeStringIO, imap, izip\nfrom jinja2.idtracking import Symbols, VAR_LOAD_PARAMETER, \\\n     VAR_LOAD_RESOLVE, VAR_LOAD_ALIAS, VAR_LOAD_UNDEFINED\n\n\noperators = {\n    'eq':       '==',\n    'ne':       '!=',\n    'gt':       '>',\n    'gteq':     '>=',\n    'lt':       '<',\n    'lteq':     '<=',\n    'in':       'in',\n    'notin':    'not in'\n}\n\n# what method to iterate over items do we want to use for dict iteration\n# in generated code?  on 2.x let's go with iteritems, on 3.x with items\nif hasattr(dict, 'iteritems'):\n    dict_item_iter = 'iteritems'\nelse:\n    dict_item_iter = 'items'\n\ncode_features = ['division']\n\n# does this python version support generator stops? (PEP 0479)\ntry:\n    exec('from __future__ import generator_stop')\n    code_features.append('generator_stop')\nexcept SyntaxError:\n    pass\n\n# does this python version support yield from?\ntry:\n    exec('def f(): yield from x()')\nexcept SyntaxError:\n    supports_yield_from = False\nelse:\n    supports_yield_from = True\n\n\ndef optimizeconst(f):\n    def new_func(self, node, frame, **kwargs):\n        # Only optimize if the frame is not volatile\n        if self.optimized and not frame.eval_ctx.volatile:\n            new_node = self.optimizer.visit(node, frame.eval_ctx)\n            if new_node != node:\n                return self.visit(new_node, frame)\n        return f(self, node, frame, **kwargs)\n    return update_wrapper(new_func, f)\n\n\ndef generate(node, environment, name, filename, stream=None,\n             defer_init=False, optimized=True):\n    \"\"\"Generate the python source for a node tree.\"\"\"\n    if not isinstance(node, nodes.Template):\n        raise TypeError('Can\\'t compile non template nodes')\n    generator = environment.code_generator_class(environment, name, filename,\n                                                 stream, defer_init,\n                                                 optimized)\n    generator.visit(node)\n    if stream is None:\n        return generator.stream.getvalue()\n\n\ndef has_safe_repr(value):\n    \"\"\"Does the node have a safe representation?\"\"\"\n    if value is None or value is NotImplemented or value is Ellipsis:\n        return True\n    if type(value) in (bool, int, float, complex, range_type, Markup) + string_types:\n        return True\n    if type(value) in (tuple, list, set, frozenset):\n        for item in value:\n            if not has_safe_repr(item):\n                return False\n        return True\n    elif type(value) is dict:\n        for key, value in iteritems(value):\n            if not has_safe_repr(key):\n                return False\n            if not has_safe_repr(value):\n                return False\n        return True\n    return False\n\n\ndef find_undeclared(nodes, names):\n    \"\"\"Check if the names passed are accessed undeclared.  The return value\n    is a set of all the undeclared names from the sequence of names found.\n    \"\"\"\n    visitor = UndeclaredNameVisitor(names)\n    try:\n        for node in nodes:\n            visitor.visit(node)\n    except VisitorExit:\n        pass\n    return visitor.undeclared\n\n\nclass MacroRef(object):\n\n    def __init__(self, node):\n        self.node = node\n        self.accesses_caller = False\n        self.accesses_kwargs = False\n        self.accesses_varargs = False\n\n\nclass Frame(object):\n    \"\"\"Holds compile time information for us.\"\"\"\n\n    def __init__(self, eval_ctx, parent=None, level=None):\n        self.eval_ctx = eval_ctx\n        self.symbols = Symbols(parent and parent.symbols or None,\n                               level=level)\n\n        # a toplevel frame is the root + soft frames such as if conditions.\n        self.toplevel = False\n\n        # the root frame is basically just the outermost frame, so no if\n        # conditions.  This information is used to optimize inheritance\n        # situations.\n        self.rootlevel = False\n\n        # in some dynamic inheritance situations the compiler needs to add\n        # write tests around output statements.\n        self.require_output_check = parent and parent.require_output_check\n\n        # inside some tags we are using a buffer rather than yield statements.\n        # this for example affects {% filter %} or {% macro %}.  If a frame\n        # is buffered this variable points to the name of the list used as\n        # buffer.\n        self.buffer = None\n\n        # the name of the block we're in, otherwise None.\n        self.block = parent and parent.block or None\n\n        # the parent of this frame\n        self.parent = parent\n\n        if parent is not None:\n            self.buffer = parent.buffer\n\n    def copy(self):\n        \"\"\"Create a copy of the current one.\"\"\"\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.symbols = self.symbols.copy()\n        return rv\n\n    def inner(self, isolated=False):\n        \"\"\"Return an inner frame.\"\"\"\n        if isolated:\n            return Frame(self.eval_ctx, level=self.symbols.level + 1)\n        return Frame(self.eval_ctx, self)\n\n    def soft(self):\n        \"\"\"Return a soft frame.  A soft frame may not be modified as\n        standalone thing as it shares the resources with the frame it\n        was created of, but it's not a rootlevel frame any longer.\n\n        This is only used to implement if-statements.\n        \"\"\"\n        rv = self.copy()\n        rv.rootlevel = False\n        return rv\n\n    __copy__ = copy\n\n\nclass VisitorExit(RuntimeError):\n    \"\"\"Exception used by the `UndeclaredNameVisitor` to signal a stop.\"\"\"\n\n\nclass DependencyFinderVisitor(NodeVisitor):\n    \"\"\"A visitor that collects filter and test calls.\"\"\"\n\n    def __init__(self):\n        self.filters = set()\n        self.tests = set()\n\n    def visit_Filter(self, node):\n        self.generic_visit(node)\n        self.filters.add(node.name)\n\n    def visit_Test(self, node):\n        self.generic_visit(node)\n        self.tests.add(node.name)\n\n    def visit_Block(self, node):\n        \"\"\"Stop visiting at blocks.\"\"\"\n\n\nclass UndeclaredNameVisitor(NodeVisitor):\n    \"\"\"A visitor that checks if a name is accessed without being\n    declared.  This is different from the frame visitor as it will\n    not stop at closure frames.\n    \"\"\"\n\n    def __init__(self, names):\n        self.names = set(names)\n        self.undeclared = set()\n\n    def visit_Name(self, node):\n        if node.ctx == 'load' and node.name in self.names:\n            self.undeclared.add(node.name)\n            if self.undeclared == self.names:\n                raise VisitorExit()\n        else:\n            self.names.discard(node.name)\n\n    def visit_Block(self, node):\n        \"\"\"Stop visiting a blocks.\"\"\"\n\n\nclass CompilerExit(Exception):\n    \"\"\"Raised if the compiler encountered a situation where it just\n    doesn't make sense to further process the code.  Any block that\n    raises such an exception is not further processed.\n    \"\"\"\n\n\nclass CodeGenerator(NodeVisitor):\n\n    def __init__(self, environment, name, filename, stream=None,\n                 defer_init=False, optimized=True):\n        if stream is None:\n            stream = NativeStringIO()\n        self.environment = environment\n        self.name = name\n        self.filename = filename\n        self.stream = stream\n        self.created_block_context = False\n        self.defer_init = defer_init\n        self.optimized = optimized\n        if optimized:\n            self.optimizer = Optimizer(environment)\n\n        # aliases for imports\n        self.import_aliases = {}\n\n        # a registry for all blocks.  Because blocks are moved out\n        # into the global python scope they are registered here\n        self.blocks = {}\n\n        # the number of extends statements so far\n        self.extends_so_far = 0\n\n        # some templates have a rootlevel extends.  In this case we\n        # can safely assume that we're a child template and do some\n        # more optimizations.\n        self.has_known_extends = False\n\n        # the current line number\n        self.code_lineno = 1\n\n        # registry of all filters and tests (global, not block local)\n        self.tests = {}\n        self.filters = {}\n\n        # the debug information\n        self.debug_info = []\n        self._write_debug_info = None\n\n        # the number of new lines before the next write()\n        self._new_lines = 0\n\n        # the line number of the last written statement\n        self._last_line = 0\n\n        # true if nothing was written so far.\n        self._first_write = True\n\n        # used by the `temporary_identifier` method to get new\n        # unique, temporary identifier\n        self._last_identifier = 0\n\n        # the current indentation\n        self._indentation = 0\n\n        # Tracks toplevel assignments\n        self._assign_stack = []\n\n        # Tracks parameter definition blocks\n        self._param_def_block = []\n\n        # Tracks the current context.\n        self._context_reference_stack = ['context']\n\n    # -- Various compilation helpers\n\n    def fail(self, msg, lineno):\n        \"\"\"Fail with a :exc:`TemplateAssertionError`.\"\"\"\n        raise TemplateAssertionError(msg, lineno, self.name, self.filename)\n\n    def temporary_identifier(self):\n        \"\"\"Get a new unique identifier.\"\"\"\n        self._last_identifier += 1\n        return 't_%d' % self._last_identifier\n\n    def buffer(self, frame):\n        \"\"\"Enable buffering for the frame from that point onwards.\"\"\"\n        frame.buffer = self.temporary_identifier()\n        self.writeline('%s = []' % frame.buffer)\n\n    def return_buffer_contents(self, frame, force_unescaped=False):\n        \"\"\"Return the buffer contents of the frame.\"\"\"\n        if not force_unescaped:\n            if frame.eval_ctx.volatile:\n                self.writeline('if context.eval_ctx.autoescape:')\n                self.indent()\n                self.writeline('return Markup(concat(%s))' % frame.buffer)\n                self.outdent()\n                self.writeline('else:')\n                self.indent()\n                self.writeline('return concat(%s)' % frame.buffer)\n                self.outdent()\n                return\n            elif frame.eval_ctx.autoescape:\n                self.writeline('return Markup(concat(%s))' % frame.buffer)\n                return\n        self.writeline('return concat(%s)' % frame.buffer)\n\n    def indent(self):\n        \"\"\"Indent by one.\"\"\"\n        self._indentation += 1\n\n    def outdent(self, step=1):\n        \"\"\"Outdent by step.\"\"\"\n        self._indentation -= step\n\n    def start_write(self, frame, node=None):\n        \"\"\"Yield or write into the frame buffer.\"\"\"\n        if frame.buffer is None:\n            self.writeline('yield ', node)\n        else:\n            self.writeline('%s.append(' % frame.buffer, node)\n\n    def end_write(self, frame):\n        \"\"\"End the writing process started by `start_write`.\"\"\"\n        if frame.buffer is not None:\n            self.write(')')\n\n    def simple_write(self, s, frame, node=None):\n        \"\"\"Simple shortcut for start_write + write + end_write.\"\"\"\n        self.start_write(frame, node)\n        self.write(s)\n        self.end_write(frame)\n\n    def blockvisit(self, nodes, frame):\n        \"\"\"Visit a list of nodes as block in a frame.  If the current frame\n        is no buffer a dummy ``if 0: yield None`` is written automatically.\n        \"\"\"\n        try:\n            self.writeline('pass')\n            for node in nodes:\n                self.visit(node, frame)\n        except CompilerExit:\n            pass\n\n    def write(self, x):\n        \"\"\"Write a string into the output stream.\"\"\"\n        if self._new_lines:\n            if not self._first_write:\n                self.stream.write('\\n' * self._new_lines)\n                self.code_lineno += self._new_lines\n                if self._write_debug_info is not None:\n                    self.debug_info.append((self._write_debug_info,\n                                            self.code_lineno))\n                    self._write_debug_info = None\n            self._first_write = False\n            self.stream.write('    ' * self._indentation)\n            self._new_lines = 0\n        self.stream.write(x)\n\n    def writeline(self, x, node=None, extra=0):\n        \"\"\"Combination of newline and write.\"\"\"\n        self.newline(node, extra)\n        self.write(x)\n\n    def newline(self, node=None, extra=0):\n        \"\"\"Add one or more newlines before the next write.\"\"\"\n        self._new_lines = max(self._new_lines, 1 + extra)\n        if node is not None and node.lineno != self._last_line:\n            self._write_debug_info = node.lineno\n            self._last_line = node.lineno\n\n    def signature(self, node, frame, extra_kwargs=None):\n        \"\"\"Writes a function call to the stream for the current node.\n        A leading comma is added automatically.  The extra keyword\n        arguments may not include python keywords otherwise a syntax\n        error could occour.  The extra keyword arguments should be given\n        as python dict.\n        \"\"\"\n        # if any of the given keyword arguments is a python keyword\n        # we have to make sure that no invalid call is created.\n        kwarg_workaround = False\n        for kwarg in chain((x.key for x in node.kwargs), extra_kwargs or ()):\n            if is_python_keyword(kwarg):\n                kwarg_workaround = True\n                break\n\n        for arg in node.args:\n            self.write(', ')\n            self.visit(arg, frame)\n\n        if not kwarg_workaround:\n            for kwarg in node.kwargs:\n                self.write(', ')\n                self.visit(kwarg, frame)\n            if extra_kwargs is not None:\n                for key, value in iteritems(extra_kwargs):\n                    self.write(', %s=%s' % (key, value))\n        if node.dyn_args:\n            self.write(', *')\n            self.visit(node.dyn_args, frame)\n\n        if kwarg_workaround:\n            if node.dyn_kwargs is not None:\n                self.write(', **dict({')\n            else:\n                self.write(', **{')\n            for kwarg in node.kwargs:\n                self.write('%r: ' % kwarg.key)\n                self.visit(kwarg.value, frame)\n                self.write(', ')\n            if extra_kwargs is not None:\n                for key, value in iteritems(extra_kwargs):\n                    self.write('%r: %s, ' % (key, value))\n            if node.dyn_kwargs is not None:\n                self.write('}, **')\n                self.visit(node.dyn_kwargs, frame)\n                self.write(')')\n            else:\n                self.write('}')\n\n        elif node.dyn_kwargs is not None:\n            self.write(', **')\n            self.visit(node.dyn_kwargs, frame)\n\n    def pull_dependencies(self, nodes):\n        \"\"\"Pull all the dependencies.\"\"\"\n        visitor = DependencyFinderVisitor()\n        for node in nodes:\n            visitor.visit(node)\n        for dependency in 'filters', 'tests':\n            mapping = getattr(self, dependency)\n            for name in getattr(visitor, dependency):\n                if name not in mapping:\n                    mapping[name] = self.temporary_identifier()\n                self.writeline('%s = environment.%s[%r]' %\n                               (mapping[name], dependency, name))\n\n    def enter_frame(self, frame):\n        undefs = []\n        for target, (action, param) in iteritems(frame.symbols.loads):\n            if action == VAR_LOAD_PARAMETER:\n                pass\n            elif action == VAR_LOAD_RESOLVE:\n                self.writeline('%s = %s(%r)' %\n                               (target, self.get_resolve_func(), param))\n            elif action == VAR_LOAD_ALIAS:\n                self.writeline('%s = %s' % (target, param))\n            elif action == VAR_LOAD_UNDEFINED:\n                undefs.append(target)\n            else:\n                raise NotImplementedError('unknown load instruction')\n        if undefs:\n            self.writeline('%s = missing' % ' = '.join(undefs))\n\n    def leave_frame(self, frame, with_python_scope=False):\n        if not with_python_scope:\n            undefs = []\n            for target, _ in iteritems(frame.symbols.loads):\n                undefs.append(target)\n            if undefs:\n                self.writeline('%s = missing' % ' = '.join(undefs))\n\n    def func(self, name):\n        if self.environment.is_async:\n            return 'async def %s' % name\n        return 'def %s' % name\n\n    def macro_body(self, node, frame):\n        \"\"\"Dump the function def of a macro or call block.\"\"\"\n        frame = frame.inner()\n        frame.symbols.analyze_node(node)\n        macro_ref = MacroRef(node)\n\n        explicit_caller = None\n        skip_special_params = set()\n        args = []\n        for idx, arg in enumerate(node.args):\n            if arg.name == 'caller':\n                explicit_caller = idx\n            if arg.name in ('kwargs', 'varargs'):\n                skip_special_params.add(arg.name)\n            args.append(frame.symbols.ref(arg.name))\n\n        undeclared = find_undeclared(node.body, ('caller', 'kwargs', 'varargs'))\n\n        if 'caller' in undeclared:\n            # In older Jinja2 versions there was a bug that allowed caller\n            # to retain the special behavior even if it was mentioned in\n            # the argument list.  However thankfully this was only really\n            # working if it was the last argument.  So we are explicitly\n            # checking this now and error out if it is anywhere else in\n            # the argument list.\n            if explicit_caller is not None:\n                try:\n                    node.defaults[explicit_caller - len(node.args)]\n                except IndexError:\n                    self.fail('When defining macros or call blocks the '\n                              'special \"caller\" argument must be omitted '\n                              'or be given a default.', node.lineno)\n            else:\n                args.append(frame.symbols.declare_parameter('caller'))\n            macro_ref.accesses_caller = True\n        if 'kwargs' in undeclared and not 'kwargs' in skip_special_params:\n            args.append(frame.symbols.declare_parameter('kwargs'))\n            macro_ref.accesses_kwargs = True\n        if 'varargs' in undeclared and not 'varargs' in skip_special_params:\n            args.append(frame.symbols.declare_parameter('varargs'))\n            macro_ref.accesses_varargs = True\n\n        # macros are delayed, they never require output checks\n        frame.require_output_check = False\n        frame.symbols.analyze_node(node)\n        self.writeline('%s(%s):' % (self.func('macro'), ', '.join(args)), node)\n        self.indent()\n\n        self.buffer(frame)\n        self.enter_frame(frame)\n\n        self.push_parameter_definitions(frame)\n        for idx, arg in enumerate(node.args):\n            ref = frame.symbols.ref(arg.name)\n            self.writeline('if %s is missing:' % ref)\n            self.indent()\n            try:\n                default = node.defaults[idx - len(node.args)]\n            except IndexError:\n                self.writeline('%s = undefined(%r, name=%r)' % (\n                    ref,\n                    'parameter %r was not provided' % arg.name,\n                    arg.name))\n            else:\n                self.writeline('%s = ' % ref)\n                self.visit(default, frame)\n            self.mark_parameter_stored(ref)\n            self.outdent()\n        self.pop_parameter_definitions()\n\n        self.blockvisit(node.body, frame)\n        self.return_buffer_contents(frame, force_unescaped=True)\n        self.leave_frame(frame, with_python_scope=True)\n        self.outdent()\n\n        return frame, macro_ref\n\n    def macro_def(self, macro_ref, frame):\n        \"\"\"Dump the macro definition for the def created by macro_body.\"\"\"\n        arg_tuple = ', '.join(repr(x.name) for x in macro_ref.node.args)\n        name = getattr(macro_ref.node, 'name', None)\n        if len(macro_ref.node.args) == 1:\n            arg_tuple += ','\n        self.write('Macro(environment, macro, %r, (%s), %r, %r, %r, '\n                   'context.eval_ctx.autoescape)' %\n                   (name, arg_tuple, macro_ref.accesses_kwargs,\n                    macro_ref.accesses_varargs, macro_ref.accesses_caller))\n\n    def position(self, node):\n        \"\"\"Return a human readable position for the node.\"\"\"\n        rv = 'line %d' % node.lineno\n        if self.name is not None:\n            rv += ' in ' + repr(self.name)\n        return rv\n\n    def dump_local_context(self, frame):\n        return '{%s}' % ', '.join(\n            '%r: %s' % (name, target) for name, target\n            in iteritems(frame.symbols.dump_stores()))\n\n    def write_commons(self):\n        \"\"\"Writes a common preamble that is used by root and block functions.\n        Primarily this sets up common local helpers and enforces a generator\n        through a dead branch.\n        \"\"\"\n        self.writeline('resolve = context.resolve_or_missing')\n        self.writeline('undefined = environment.undefined')\n        self.writeline('if 0: yield None')\n\n    def push_parameter_definitions(self, frame):\n        \"\"\"Pushes all parameter targets from the given frame into a local\n        stack that permits tracking of yet to be assigned parameters.  In\n        particular this enables the optimization from `visit_Name` to skip\n        undefined expressions for parameters in macros as macros can reference\n        otherwise unbound parameters.\n        \"\"\"\n        self._param_def_block.append(frame.symbols.dump_param_targets())\n\n    def pop_parameter_definitions(self):\n        \"\"\"Pops the current parameter definitions set.\"\"\"\n        self._param_def_block.pop()\n\n    def mark_parameter_stored(self, target):\n        \"\"\"Marks a parameter in the current parameter definitions as stored.\n        This will skip the enforced undefined checks.\n        \"\"\"\n        if self._param_def_block:\n            self._param_def_block[-1].discard(target)\n\n    def push_context_reference(self, target):\n        self._context_reference_stack.append(target)\n\n    def pop_context_reference(self):\n        self._context_reference_stack.pop()\n\n    def get_context_ref(self):\n        return self._context_reference_stack[-1]\n\n    def get_resolve_func(self):\n        target = self._context_reference_stack[-1]\n        if target == 'context':\n            return 'resolve'\n        return '%s.resolve' % target\n\n    def derive_context(self, frame):\n        return '%s.derived(%s)' % (\n            self.get_context_ref(),\n            self.dump_local_context(frame),\n        )\n\n    def parameter_is_undeclared(self, target):\n        \"\"\"Checks if a given target is an undeclared parameter.\"\"\"\n        if not self._param_def_block:\n            return False\n        return target in self._param_def_block[-1]\n\n    def push_assign_tracking(self):\n        \"\"\"Pushes a new layer for assignment tracking.\"\"\"\n        self._assign_stack.append(set())\n\n    def pop_assign_tracking(self, frame):\n        \"\"\"Pops the topmost level for assignment tracking and updates the\n        context variables if necessary.\n        \"\"\"\n        vars = self._assign_stack.pop()\n        if not frame.toplevel or not vars:\n            return\n        public_names = [x for x in vars if x[:1] != '_']\n        if len(vars) == 1:\n            name = next(iter(vars))\n            ref = frame.symbols.ref(name)\n            self.writeline('context.vars[%r] = %s' % (name, ref))\n        else:\n            self.writeline('context.vars.update({')\n            for idx, name in enumerate(vars):\n                if idx:\n                    self.write(', ')\n                ref = frame.symbols.ref(name)\n                self.write('%r: %s' % (name, ref))\n            self.write('})')\n        if public_names:\n            if len(public_names) == 1:\n                self.writeline('context.exported_vars.add(%r)' %\n                               public_names[0])\n            else:\n                self.writeline('context.exported_vars.update((%s))' %\n                               ', '.join(imap(repr, public_names)))\n\n    # -- Statement Visitors\n\n    def visit_Template(self, node, frame=None):\n        assert frame is None, 'no root frame allowed'\n        eval_ctx = EvalContext(self.environment, self.name)\n\n        from jinja2.runtime import __all__ as exported\n        self.writeline('from __future__ import %s' % ', '.join(code_features))\n        self.writeline('from jinja2.runtime import ' + ', '.join(exported))\n\n        if self.environment.is_async:\n            self.writeline('from jinja2.asyncsupport import auto_await, '\n                           'auto_aiter, make_async_loop_context')\n\n        # if we want a deferred initialization we cannot move the\n        # environment into a local name\n        envenv = not self.defer_init and ', environment=environment' or ''\n\n        # do we have an extends tag at all?  If not, we can save some\n        # overhead by just not processing any inheritance code.\n        have_extends = node.find(nodes.Extends) is not None\n\n        # find all blocks\n        for block in node.find_all(nodes.Block):\n            if block.name in self.blocks:\n                self.fail('block %r defined twice' % block.name, block.lineno)\n            self.blocks[block.name] = block\n\n        # find all imports and import them\n        for import_ in node.find_all(nodes.ImportedName):\n            if import_.importname not in self.import_aliases:\n                imp = import_.importname\n                self.import_aliases[imp] = alias = self.temporary_identifier()\n                if '.' in imp:\n                    module, obj = imp.rsplit('.', 1)\n                    self.writeline('from %s import %s as %s' %\n                                   (module, obj, alias))\n                else:\n                    self.writeline('import %s as %s' % (imp, alias))\n\n        # add the load name\n        self.writeline('name = %r' % self.name)\n\n        # generate the root render function.\n        self.writeline('%s(context, missing=missing%s):' %\n                       (self.func('root'), envenv), extra=1)\n        self.indent()\n        self.write_commons()\n\n        # process the root\n        frame = Frame(eval_ctx)\n        if 'self' in find_undeclared(node.body, ('self',)):\n            ref = frame.symbols.declare_parameter('self')\n            self.writeline('%s = TemplateReference(context)' % ref)\n        frame.symbols.analyze_node(node)\n        frame.toplevel = frame.rootlevel = True\n        frame.require_output_check = have_extends and not self.has_known_extends\n        if have_extends:\n            self.writeline('parent_template = None')\n        self.enter_frame(frame)\n        self.pull_dependencies(node.body)\n        self.blockvisit(node.body, frame)\n        self.leave_frame(frame, with_python_scope=True)\n        self.outdent()\n\n        # make sure that the parent root is called.\n        if have_extends:\n            if not self.has_known_extends:\n                self.indent()\n                self.writeline('if parent_template is not None:')\n            self.indent()\n            if supports_yield_from and not self.environment.is_async:\n                self.writeline('yield from parent_template.'\n                               'root_render_func(context)')\n            else:\n                self.writeline('%sfor event in parent_template.'\n                               'root_render_func(context):' %\n                               (self.environment.is_async and 'async ' or ''))\n                self.indent()\n                self.writeline('yield event')\n                self.outdent()\n            self.outdent(1 + (not self.has_known_extends))\n\n        # at this point we now have the blocks collected and can visit them too.\n        for name, block in iteritems(self.blocks):\n            self.writeline('%s(context, missing=missing%s):' %\n                           (self.func('block_' + name), envenv),\n                           block, 1)\n            self.indent()\n            self.write_commons()\n            # It's important that we do not make this frame a child of the\n            # toplevel template.  This would cause a variety of\n            # interesting issues with identifier tracking.\n            block_frame = Frame(eval_ctx)\n            undeclared = find_undeclared(block.body, ('self', 'super'))\n            if 'self' in undeclared:\n                ref = block_frame.symbols.declare_parameter('self')\n                self.writeline('%s = TemplateReference(context)' % ref)\n            if 'super' in undeclared:\n                ref = block_frame.symbols.declare_parameter('super')\n                self.writeline('%s = context.super(%r, '\n                               'block_%s)' % (ref, name, name))\n            block_frame.symbols.analyze_node(block)\n            block_frame.block = name\n            self.enter_frame(block_frame)\n            self.pull_dependencies(block.body)\n            self.blockvisit(block.body, block_frame)\n            self.leave_frame(block_frame, with_python_scope=True)\n            self.outdent()\n\n        self.writeline('blocks = {%s}' % ', '.join('%r: block_%s' % (x, x)\n                                                   for x in self.blocks),\n                       extra=1)\n\n        # add a function that returns the debug info\n        self.writeline('debug_info = %r' % '&'.join('%s=%s' % x for x\n                                                    in self.debug_info))\n\n    def visit_Block(self, node, frame):\n        \"\"\"Call a block and register it for the template.\"\"\"\n        level = 0\n        if frame.toplevel:\n            # if we know that we are a child template, there is no need to\n            # check if we are one\n            if self.has_known_extends:\n                return\n            if self.extends_so_far > 0:\n                self.writeline('if parent_template is None:')\n                self.indent()\n                level += 1\n\n        if node.scoped:\n            context = self.derive_context(frame)\n        else:\n            context = self.get_context_ref()\n\n        if supports_yield_from and not self.environment.is_async and \\\n           frame.buffer is None:\n            self.writeline('yield from context.blocks[%r][0](%s)' % (\n                           node.name, context), node)\n        else:\n            loop = self.environment.is_async and 'async for' or 'for'\n            self.writeline('%s event in context.blocks[%r][0](%s):' % (\n                           loop, node.name, context), node)\n            self.indent()\n            self.simple_write('event', frame)\n            self.outdent()\n\n        self.outdent(level)\n\n    def visit_Extends(self, node, frame):\n        \"\"\"Calls the extender.\"\"\"\n        if not frame.toplevel:\n            self.fail('cannot use extend from a non top-level scope',\n                      node.lineno)\n\n        # if the number of extends statements in general is zero so\n        # far, we don't have to add a check if something extended\n        # the template before this one.\n        if self.extends_so_far > 0:\n\n            # if we have a known extends we just add a template runtime\n            # error into the generated code.  We could catch that at compile\n            # time too, but i welcome it not to confuse users by throwing the\n            # same error at different times just \"because we can\".\n            if not self.has_known_extends:\n                self.writeline('if parent_template is not None:')\n                self.indent()\n            self.writeline('raise TemplateRuntimeError(%r)' %\n                           'extended multiple times')\n\n            # if we have a known extends already we don't need that code here\n            # as we know that the template execution will end here.\n            if self.has_known_extends:\n                raise CompilerExit()\n            else:\n                self.outdent()\n\n        self.writeline('parent_template = environment.get_template(', node)\n        self.visit(node.template, frame)\n        self.write(', %r)' % self.name)\n        self.writeline('for name, parent_block in parent_template.'\n                       'blocks.%s():' % dict_item_iter)\n        self.indent()\n        self.writeline('context.blocks.setdefault(name, []).'\n                       'append(parent_block)')\n        self.outdent()\n\n        # if this extends statement was in the root level we can take\n        # advantage of that information and simplify the generated code\n        # in the top level from this point onwards\n        if frame.rootlevel:\n            self.has_known_extends = True\n\n        # and now we have one more\n        self.extends_so_far += 1\n\n    def visit_Include(self, node, frame):\n        \"\"\"Handles includes.\"\"\"\n        if node.ignore_missing:\n            self.writeline('try:')\n            self.indent()\n\n        func_name = 'get_or_select_template'\n        if isinstance(node.template, nodes.Const):\n            if isinstance(node.template.value, string_types):\n                func_name = 'get_template'\n            elif isinstance(node.template.value, (tuple, list)):\n                func_name = 'select_template'\n        elif isinstance(node.template, (nodes.Tuple, nodes.List)):\n            func_name = 'select_template'\n\n        self.writeline('template = environment.%s(' % func_name, node)\n        self.visit(node.template, frame)\n        self.write(', %r)' % self.name)\n        if node.ignore_missing:\n            self.outdent()\n            self.writeline('except TemplateNotFound:')\n            self.indent()\n            self.writeline('pass')\n            self.outdent()\n            self.writeline('else:')\n            self.indent()\n\n        skip_event_yield = False\n        if node.with_context:\n            loop = self.environment.is_async and 'async for' or 'for'\n            self.writeline('%s event in template.root_render_func('\n                           'template.new_context(context.get_all(), True, '\n                           '%s)):' % (loop, self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.writeline('for event in (await '\n                           'template._get_default_module_async())'\n                           '._body_stream:')\n        else:\n            if supports_yield_from:\n                self.writeline('yield from template._get_default_module()'\n                               '._body_stream')\n                skip_event_yield = True\n            else:\n                self.writeline('for event in template._get_default_module()'\n                               '._body_stream:')\n\n        if not skip_event_yield:\n            self.indent()\n            self.simple_write('event', frame)\n            self.outdent()\n\n        if node.ignore_missing:\n            self.outdent()\n\n    def visit_Import(self, node, frame):\n        \"\"\"Visit regular imports.\"\"\"\n        self.writeline('%s = ' % frame.symbols.ref(node.target), node)\n        if frame.toplevel:\n            self.write('context.vars[%r] = ' % node.target)\n        if self.environment.is_async:\n            self.write('await ')\n        self.write('environment.get_template(')\n        self.visit(node.template, frame)\n        self.write(', %r).' % self.name)\n        if node.with_context:\n            self.write('make_module%s(context.get_all(), True, %s)'\n                       % (self.environment.is_async and '_async' or '',\n                          self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.write('_get_default_module_async()')\n        else:\n            self.write('_get_default_module()')\n        if frame.toplevel and not node.target.startswith('_'):\n            self.writeline('context.exported_vars.discard(%r)' % node.target)\n\n    def visit_FromImport(self, node, frame):\n        \"\"\"Visit named imports.\"\"\"\n        self.newline(node)\n        self.write('included_template = %senvironment.get_template('\n                   % (self.environment.is_async and 'await ' or ''))\n        self.visit(node.template, frame)\n        self.write(', %r).' % self.name)\n        if node.with_context:\n            self.write('make_module%s(context.get_all(), True, %s)'\n                       % (self.environment.is_async and '_async' or '',\n                          self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.write('_get_default_module_async()')\n        else:\n            self.write('_get_default_module()')\n\n        var_names = []\n        discarded_names = []\n        for name in node.names:\n            if isinstance(name, tuple):\n                name, alias = name\n            else:\n                alias = name\n            self.writeline('%s = getattr(included_template, '\n                           '%r, missing)' % (frame.symbols.ref(alias), name))\n            self.writeline('if %s is missing:' % frame.symbols.ref(alias))\n            self.indent()\n            self.writeline('%s = undefined(%r %% '\n                           'included_template.__name__, '\n                           'name=%r)' %\n                           (frame.symbols.ref(alias),\n                            'the template %%r (imported on %s) does '\n                            'not export the requested name %s' % (\n                                self.position(node),\n                                repr(name)\n                           ), name))\n            self.outdent()\n            if frame.toplevel:\n                var_names.append(alias)\n                if not alias.startswith('_'):\n                    discarded_names.append(alias)\n\n        if var_names:\n            if len(var_names) == 1:\n                name = var_names[0]\n                self.writeline('context.vars[%r] = %s' %\n                               (name, frame.symbols.ref(name)))\n            else:\n                self.writeline('context.vars.update({%s})' % ', '.join(\n                    '%r: %s' % (name, frame.symbols.ref(name)) for name in var_names\n                ))\n        if discarded_names:\n            if len(discarded_names) == 1:\n                self.writeline('context.exported_vars.discard(%r)' %\n                               discarded_names[0])\n            else:\n                self.writeline('context.exported_vars.difference_'\n                               'update((%s))' % ', '.join(imap(repr, discarded_names)))\n\n    def visit_For(self, node, frame):\n        loop_frame = frame.inner()\n        test_frame = frame.inner()\n        else_frame = frame.inner()\n\n        # try to figure out if we have an extended loop.  An extended loop\n        # is necessary if the loop is in recursive mode if the special loop\n        # variable is accessed in the body.\n        extended_loop = node.recursive or 'loop' in \\\n                        find_undeclared(node.iter_child_nodes(\n                            only=('body',)), ('loop',))\n\n        loop_ref = None\n        if extended_loop:\n            loop_ref = loop_frame.symbols.declare_parameter('loop')\n\n        loop_frame.symbols.analyze_node(node, for_branch='body')\n        if node.else_:\n            else_frame.symbols.analyze_node(node, for_branch='else')\n\n        if node.test:\n            loop_filter_func = self.temporary_identifier()\n            test_frame.symbols.analyze_node(node, for_branch='test')\n            self.writeline('%s(fiter):' % self.func(loop_filter_func), node.test)\n            self.indent()\n            self.enter_frame(test_frame)\n            self.writeline(self.environment.is_async and 'async for ' or 'for ')\n            self.visit(node.target, loop_frame)\n            self.write(' in ')\n            self.write(self.environment.is_async and 'auto_aiter(fiter)' or 'fiter')\n            self.write(':')\n            self.indent()\n            self.writeline('if ', node.test)\n            self.visit(node.test, test_frame)\n            self.write(':')\n            self.indent()\n            self.writeline('yield ')\n            self.visit(node.target, loop_frame)\n            self.outdent(3)\n            self.leave_frame(test_frame, with_python_scope=True)\n\n        # if we don't have an recursive loop we have to find the shadowed\n        # variables at that point.  Because loops can be nested but the loop\n        # variable is a special one we have to enforce aliasing for it.\n        if node.recursive:\n            self.writeline('%s(reciter, loop_render_func, depth=0):' %\n                           self.func('loop'), node)\n            self.indent()\n            self.buffer(loop_frame)\n\n            # Use the same buffer for the else frame\n            else_frame.buffer = loop_frame.buffer\n\n        # make sure the loop variable is a special one and raise a template\n        # assertion error if a loop tries to write to loop\n        if extended_loop:\n            self.writeline('%s = missing' % loop_ref)\n\n        for name in node.find_all(nodes.Name):\n            if name.ctx == 'store' and name.name == 'loop':\n                self.fail('Can\\'t assign to special loop variable '\n                          'in for-loop target', name.lineno)\n\n        if node.else_:\n            iteration_indicator = self.temporary_identifier()\n            self.writeline('%s = 1' % iteration_indicator)\n\n        self.writeline(self.environment.is_async and 'async for ' or 'for ', node)\n        self.visit(node.target, loop_frame)\n        if extended_loop:\n            if self.environment.is_async:\n                self.write(', %s in await make_async_loop_context(' % loop_ref)\n            else:\n                self.write(', %s in LoopContext(' % loop_ref)\n        else:\n            self.write(' in ')\n\n        if node.test:\n            self.write('%s(' % loop_filter_func)\n        if node.recursive:\n            self.write('reciter')\n        else:\n            if self.environment.is_async and not extended_loop:\n                self.write('auto_aiter(')\n            self.visit(node.iter, frame)\n            if self.environment.is_async and not extended_loop:\n                self.write(')')\n        if node.test:\n            self.write(')')\n\n        if node.recursive:\n            self.write(', undefined, loop_render_func, depth):')\n        else:\n            self.write(extended_loop and ', undefined):' or ':')\n\n        self.indent()\n        self.enter_frame(loop_frame)\n\n        self.blockvisit(node.body, loop_frame)\n        if node.else_:\n            self.writeline('%s = 0' % iteration_indicator)\n        self.outdent()\n        self.leave_frame(loop_frame, with_python_scope=node.recursive\n                         and not node.else_)\n\n        if node.else_:\n            self.writeline('if %s:' % iteration_indicator)\n            self.indent()\n            self.enter_frame(else_frame)\n            self.blockvisit(node.else_, else_frame)\n            self.leave_frame(else_frame)\n            self.outdent()\n\n        # if the node was recursive we have to return the buffer contents\n        # and start the iteration code\n        if node.recursive:\n            self.return_buffer_contents(loop_frame)\n            self.outdent()\n            self.start_write(frame, node)\n            if self.environment.is_async:\n                self.write('await ')\n            self.write('loop(')\n            if self.environment.is_async:\n                self.write('auto_aiter(')\n            self.visit(node.iter, frame)\n            if self.environment.is_async:\n                self.write(')')\n            self.write(', loop)')\n            self.end_write(frame)\n\n    def visit_If(self, node, frame):\n        if_frame = frame.soft()\n        self.writeline('if ', node)\n        self.visit(node.test, if_frame)\n        self.write(':')\n        self.indent()\n        self.blockvisit(node.body, if_frame)\n        self.outdent()\n        for elif_ in node.elif_:\n            self.writeline('elif ', elif_)\n            self.visit(elif_.test, if_frame)\n            self.write(':')\n            self.indent()\n            self.blockvisit(elif_.body, if_frame)\n            self.outdent()\n        if node.else_:\n            self.writeline('else:')\n            self.indent()\n            self.blockvisit(node.else_, if_frame)\n            self.outdent()\n\n    def visit_Macro(self, node, frame):\n        macro_frame, macro_ref = self.macro_body(node, frame)\n        self.newline()\n        if frame.toplevel:\n            if not node.name.startswith('_'):\n                self.write('context.exported_vars.add(%r)' % node.name)\n            ref = frame.symbols.ref(node.name)\n            self.writeline('context.vars[%r] = ' % node.name)\n        self.write('%s = ' % frame.symbols.ref(node.name))\n        self.macro_def(macro_ref, macro_frame)\n\n    def visit_CallBlock(self, node, frame):\n        call_frame, macro_ref = self.macro_body(node, frame)\n        self.writeline('caller = ')\n        self.macro_def(macro_ref, call_frame)\n        self.start_write(frame, node)\n        self.visit_Call(node.call, frame, forward_caller=True)\n        self.end_write(frame)\n\n    def visit_FilterBlock(self, node, frame):\n        filter_frame = frame.inner()\n        filter_frame.symbols.analyze_node(node)\n        self.enter_frame(filter_frame)\n        self.buffer(filter_frame)\n        self.blockvisit(node.body, filter_frame)\n        self.start_write(frame, node)\n        self.visit_Filter(node.filter, filter_frame)\n        self.end_write(frame)\n        self.leave_frame(filter_frame)\n\n    def visit_With(self, node, frame):\n        with_frame = frame.inner()\n        with_frame.symbols.analyze_node(node)\n        self.enter_frame(with_frame)\n        for idx, (target, expr) in enumerate(izip(node.targets, node.values)):\n            self.newline()\n            self.visit(target, with_frame)\n            self.write(' = ')\n            self.visit(expr, frame)\n        self.blockvisit(node.body, with_frame)\n        self.leave_frame(with_frame)\n\n    def visit_ExprStmt(self, node, frame):\n        self.newline(node)\n        self.visit(node.node, frame)\n\n    def visit_Output(self, node, frame):\n        # if we have a known extends statement, we don't output anything\n        # if we are in a require_output_check section\n        if self.has_known_extends and frame.require_output_check:\n            return\n\n        allow_constant_finalize = True\n        if self.environment.finalize:\n            func = self.environment.finalize\n            if getattr(func, 'contextfunction', False) or \\\n               getattr(func, 'evalcontextfunction', False):\n                allow_constant_finalize = False\n            elif getattr(func, 'environmentfunction', False):\n                finalize = lambda x: text_type(\n                    self.environment.finalize(self.environment, x))\n            else:\n                finalize = lambda x: text_type(self.environment.finalize(x))\n        else:\n            finalize = text_type\n\n        # if we are inside a frame that requires output checking, we do so\n        outdent_later = False\n        if frame.require_output_check:\n            self.writeline('if parent_template is None:')\n            self.indent()\n            outdent_later = True\n\n        # try to evaluate as many chunks as possible into a static\n        # string at compile time.\n        body = []\n        for child in node.nodes:\n            try:\n                if not allow_constant_finalize:\n                    raise nodes.Impossible()\n                const = child.as_const(frame.eval_ctx)\n            except nodes.Impossible:\n                body.append(child)\n                continue\n            # the frame can't be volatile here, becaus otherwise the\n            # as_const() function would raise an Impossible exception\n            # at that point.\n            try:\n                if frame.eval_ctx.autoescape:\n                    if hasattr(const, '__html__'):\n                        const = const.__html__()\n                    else:\n                        const = escape(const)\n                const = finalize(const)\n            except Exception:\n                # if something goes wrong here we evaluate the node\n                # at runtime for easier debugging\n                body.append(child)\n                continue\n            if body and isinstance(body[-1], list):\n                body[-1].append(const)\n            else:\n                body.append([const])\n\n        # if we have less than 3 nodes or a buffer we yield or extend/append\n        if len(body) < 3 or frame.buffer is not None:\n            if frame.buffer is not None:\n                # for one item we append, for more we extend\n                if len(body) == 1:\n                    self.writeline('%s.append(' % frame.buffer)\n                else:\n                    self.writeline('%s.extend((' % frame.buffer)\n                self.indent()\n            for item in body:\n                if isinstance(item, list):\n                    val = repr(concat(item))\n                    if frame.buffer is None:\n                        self.writeline('yield ' + val)\n                    else:\n                        self.writeline(val + ',')\n                else:\n                    if frame.buffer is None:\n                        self.writeline('yield ', item)\n                    else:\n                        self.newline(item)\n                    close = 1\n                    if frame.eval_ctx.volatile:\n                        self.write('(escape if context.eval_ctx.autoescape'\n                                   ' else to_string)(')\n                    elif frame.eval_ctx.autoescape:\n                        self.write('escape(')\n                    else:\n                        self.write('to_string(')\n                    if self.environment.finalize is not None:\n                        self.write('environment.finalize(')\n                        if getattr(self.environment.finalize,\n                                   \"contextfunction\", False):\n                            self.write('context, ')\n                        close += 1\n                    self.visit(item, frame)\n                    self.write(')' * close)\n                    if frame.buffer is not None:\n                        self.write(',')\n            if frame.buffer is not None:\n                # close the open parentheses\n                self.outdent()\n                self.writeline(len(body) == 1 and ')' or '))')\n\n        # otherwise we create a format string as this is faster in that case\n        else:\n            format = []\n            arguments = []\n            for item in body:\n                if isinstance(item, list):\n                    format.append(concat(item).replace('%', '%%'))\n                else:\n                    format.append('%s')\n                    arguments.append(item)\n            self.writeline('yield ')\n            self.write(repr(concat(format)) + ' % (')\n            self.indent()\n            for argument in arguments:\n                self.newline(argument)\n                close = 0\n                if frame.eval_ctx.volatile:\n                    self.write('(escape if context.eval_ctx.autoescape else'\n                               ' to_string)(')\n                    close += 1\n                elif frame.eval_ctx.autoescape:\n                    self.write('escape(')\n                    close += 1\n                if self.environment.finalize is not None:\n                    self.write('environment.finalize(')\n                    if getattr(self.environment.finalize,\n                               'contextfunction', False):\n                        self.write('context, ')\n                    elif getattr(self.environment.finalize,\n                               'evalcontextfunction', False):\n                        self.write('context.eval_ctx, ')\n                    elif getattr(self.environment.finalize,\n                               'environmentfunction', False):\n                        self.write('environment, ')\n                    close += 1\n                self.visit(argument, frame)\n                self.write(')' * close + ', ')\n            self.outdent()\n            self.writeline(')')\n\n        if outdent_later:\n            self.outdent()\n\n    def visit_Assign(self, node, frame):\n        self.push_assign_tracking()\n        self.newline(node)\n        self.visit(node.target, frame)\n        self.write(' = ')\n        self.visit(node.node, frame)\n        self.pop_assign_tracking(frame)\n\n    def visit_AssignBlock(self, node, frame):\n        self.push_assign_tracking()\n        block_frame = frame.inner()\n        # This is a special case.  Since a set block always captures we\n        # will disable output checks.  This way one can use set blocks\n        # toplevel even in extended templates.\n        block_frame.require_output_check = False\n        block_frame.symbols.analyze_node(node)\n        self.enter_frame(block_frame)\n        self.buffer(block_frame)\n        self.blockvisit(node.body, block_frame)\n        self.newline(node)\n        self.visit(node.target, frame)\n        self.write(' = (Markup if context.eval_ctx.autoescape '\n                   'else identity)(')\n        if node.filter is not None:\n            self.visit_Filter(node.filter, block_frame)\n        else:\n            self.write('concat(%s)' % block_frame.buffer)\n        self.write(')')\n        self.pop_assign_tracking(frame)\n        self.leave_frame(block_frame)\n\n    # -- Expression Visitors\n\n    def visit_Name(self, node, frame):\n        if node.ctx == 'store' and frame.toplevel:\n            if self._assign_stack:\n                self._assign_stack[-1].add(node.name)\n        ref = frame.symbols.ref(node.name)\n\n        # If we are looking up a variable we might have to deal with the\n        # case where it's undefined.  We can skip that case if the load\n        # instruction indicates a parameter which are always defined.\n        if node.ctx == 'load':\n            load = frame.symbols.find_load(ref)\n            if not (load is not None and load[0] == VAR_LOAD_PARAMETER and \\\n                    not self.parameter_is_undeclared(ref)):\n                self.write('(undefined(name=%r) if %s is missing else %s)' %\n                           (node.name, ref, ref))\n                return\n\n        self.write(ref)\n\n    def visit_NSRef(self, node, frame):\n        # NSRefs can only be used to store values; since they use the normal\n        # `foo.bar` notation they will be parsed as a normal attribute access\n        # when used anywhere but in a `set` context\n        ref = frame.symbols.ref(node.name)\n        self.writeline('if not isinstance(%s, Namespace):' % ref)\n        self.indent()\n        self.writeline('raise TemplateRuntimeError(%r)' %\n                       'cannot assign attribute on non-namespace object')\n        self.outdent()\n        self.writeline('%s[%r]' % (ref, node.attr))\n\n    def visit_Const(self, node, frame):\n        val = node.as_const(frame.eval_ctx)\n        if isinstance(val, float):\n            self.write(str(val))\n        else:\n            self.write(repr(val))\n\n    def visit_TemplateData(self, node, frame):\n        try:\n            self.write(repr(node.as_const(frame.eval_ctx)))\n        except nodes.Impossible:\n            self.write('(Markup if context.eval_ctx.autoescape else identity)(%r)'\n                       % node.data)\n\n    def visit_Tuple(self, node, frame):\n        self.write('(')\n        idx = -1\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item, frame)\n        self.write(idx == 0 and ',)' or ')')\n\n    def visit_List(self, node, frame):\n        self.write('[')\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item, frame)\n        self.write(']')\n\n    def visit_Dict(self, node, frame):\n        self.write('{')\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item.key, frame)\n            self.write(': ')\n            self.visit(item.value, frame)\n        self.write('}')\n\n    def binop(operator, interceptable=True):\n        @optimizeconst\n        def visitor(self, node, frame):\n            if self.environment.sandboxed and \\\n               operator in self.environment.intercepted_binops:\n                self.write('environment.call_binop(context, %r, ' % operator)\n                self.visit(node.left, frame)\n                self.write(', ')\n                self.visit(node.right, frame)\n            else:\n                self.write('(')\n                self.visit(node.left, frame)\n                self.write(' %s ' % operator)\n                self.visit(node.right, frame)\n            self.write(')')\n        return visitor\n\n    def uaop(operator, interceptable=True):\n        @optimizeconst\n        def visitor(self, node, frame):\n            if self.environment.sandboxed and \\\n               operator in self.environment.intercepted_unops:\n                self.write('environment.call_unop(context, %r, ' % operator)\n                self.visit(node.node, frame)\n            else:\n                self.write('(' + operator)\n                self.visit(node.node, frame)\n            self.write(')')\n        return visitor\n\n    visit_Add = binop('+')\n    visit_Sub = binop('-')\n    visit_Mul = binop('*')\n    visit_Div = binop('/')\n    visit_FloorDiv = binop('//')\n    visit_Pow = binop('**')\n    visit_Mod = binop('%')\n    visit_And = binop('and', interceptable=False)\n    visit_Or = binop('or', interceptable=False)\n    visit_Pos = uaop('+')\n    visit_Neg = uaop('-')\n    visit_Not = uaop('not ', interceptable=False)\n    del binop, uaop\n\n    @optimizeconst\n    def visit_Concat(self, node, frame):\n        if frame.eval_ctx.volatile:\n            func_name = '(context.eval_ctx.volatile and' \\\n                        ' markup_join or unicode_join)'\n        elif frame.eval_ctx.autoescape:\n            func_name = 'markup_join'\n        else:\n            func_name = 'unicode_join'\n        self.write('%s((' % func_name)\n        for arg in node.nodes:\n            self.visit(arg, frame)\n            self.write(', ')\n        self.write('))')\n\n    @optimizeconst\n    def visit_Compare(self, node, frame):\n        self.visit(node.expr, frame)\n        for op in node.ops:\n            self.visit(op, frame)\n\n    def visit_Operand(self, node, frame):\n        self.write(' %s ' % operators[node.op])\n        self.visit(node.expr, frame)\n\n    @optimizeconst\n    def visit_Getattr(self, node, frame):\n        self.write('environment.getattr(')\n        self.visit(node.node, frame)\n        self.write(', %r)' % node.attr)\n\n    @optimizeconst\n    def visit_Getitem(self, node, frame):\n        # slices bypass the environment getitem method.\n        if isinstance(node.arg, nodes.Slice):\n            self.visit(node.node, frame)\n            self.write('[')\n            self.visit(node.arg, frame)\n            self.write(']')\n        else:\n            self.write('environment.getitem(')\n            self.visit(node.node, frame)\n            self.write(', ')\n            self.visit(node.arg, frame)\n            self.write(')')\n\n    def visit_Slice(self, node, frame):\n        if node.start is not None:\n            self.visit(node.start, frame)\n        self.write(':')\n        if node.stop is not None:\n            self.visit(node.stop, frame)\n        if node.step is not None:\n            self.write(':')\n            self.visit(node.step, frame)\n\n    @optimizeconst\n    def visit_Filter(self, node, frame):\n        if self.environment.is_async:\n            self.write('await auto_await(')\n        self.write(self.filters[node.name] + '(')\n        func = self.environment.filters.get(node.name)\n        if func is None:\n            self.fail('no filter named %r' % node.name, node.lineno)\n        if getattr(func, 'contextfilter', False):\n            self.write('context, ')\n        elif getattr(func, 'evalcontextfilter', False):\n            self.write('context.eval_ctx, ')\n        elif getattr(func, 'environmentfilter', False):\n            self.write('environment, ')\n\n        # if the filter node is None we are inside a filter block\n        # and want to write to the current buffer\n        if node.node is not None:\n            self.visit(node.node, frame)\n        elif frame.eval_ctx.volatile:\n            self.write('(context.eval_ctx.autoescape and'\n                       ' Markup(concat(%s)) or concat(%s))' %\n                       (frame.buffer, frame.buffer))\n        elif frame.eval_ctx.autoescape:\n            self.write('Markup(concat(%s))' % frame.buffer)\n        else:\n            self.write('concat(%s)' % frame.buffer)\n        self.signature(node, frame)\n        self.write(')')\n        if self.environment.is_async:\n            self.write(')')\n\n    @optimizeconst\n    def visit_Test(self, node, frame):\n        self.write(self.tests[node.name] + '(')\n        if node.name not in self.environment.tests:\n            self.fail('no test named %r' % node.name, node.lineno)\n        self.visit(node.node, frame)\n        self.signature(node, frame)\n        self.write(')')\n\n    @optimizeconst\n    def visit_CondExpr(self, node, frame):\n        def write_expr2():\n            if node.expr2 is not None:\n                return self.visit(node.expr2, frame)\n            self.write('undefined(%r)' % ('the inline if-'\n                       'expression on %s evaluated to false and '\n                       'no else section was defined.' % self.position(node)))\n\n        self.write('(')\n        self.visit(node.expr1, frame)\n        self.write(' if ')\n        self.visit(node.test, frame)\n        self.write(' else ')\n        write_expr2()\n        self.write(')')\n\n    @optimizeconst\n    def visit_Call(self, node, frame, forward_caller=False):\n        if self.environment.is_async:\n            self.write('await auto_await(')\n        if self.environment.sandboxed:\n            self.write('environment.call(context, ')\n        else:\n            self.write('context.call(')\n        self.visit(node.node, frame)\n        extra_kwargs = forward_caller and {'caller': 'caller'} or None\n        self.signature(node, frame, extra_kwargs)\n        self.write(')')\n        if self.environment.is_async:\n            self.write(')')\n\n    def visit_Keyword(self, node, frame):\n        self.write(node.key + '=')\n        self.visit(node.value, frame)\n\n    # -- Unused nodes for extensions\n\n    def visit_MarkSafe(self, node, frame):\n        self.write('Markup(')\n        self.visit(node.expr, frame)\n        self.write(')')\n\n    def visit_MarkSafeIfAutoescape(self, node, frame):\n        self.write('(context.eval_ctx.autoescape and Markup or identity)(')\n        self.visit(node.expr, frame)\n        self.write(')')\n\n    def visit_EnvironmentAttribute(self, node, frame):\n        self.write('environment.' + node.name)\n\n    def visit_ExtensionAttribute(self, node, frame):\n        self.write('environment.extensions[%r].%s' % (node.identifier, node.name))\n\n    def visit_ImportedName(self, node, frame):\n        self.write(self.import_aliases[node.importname])\n\n    def visit_InternalName(self, node, frame):\n        self.write(node.name)\n\n    def visit_ContextReference(self, node, frame):\n        self.write('context')\n\n    def visit_Continue(self, node, frame):\n        self.writeline('continue', node)\n\n    def visit_Break(self, node, frame):\n        self.writeline('break', node)\n\n    def visit_Scope(self, node, frame):\n        scope_frame = frame.inner()\n        scope_frame.symbols.analyze_node(node)\n        self.enter_frame(scope_frame)\n        self.blockvisit(node.body, scope_frame)\n        self.leave_frame(scope_frame)\n\n    def visit_OverlayScope(self, node, frame):\n        ctx = self.temporary_identifier()\n        self.writeline('%s = %s' % (ctx, self.derive_context(frame)))\n        self.writeline('%s.vars = ' % ctx)\n        self.visit(node.context, frame)\n        self.push_context_reference(ctx)\n\n        scope_frame = frame.inner(isolated=True)\n        scope_frame.symbols.analyze_node(node)\n        self.enter_frame(scope_frame)\n        self.blockvisit(node.body, scope_frame)\n        self.leave_frame(scope_frame)\n        self.pop_context_reference()\n\n    def visit_EvalContextModifier(self, node, frame):\n        for keyword in node.options:\n            self.writeline('context.eval_ctx.%s = ' % keyword.key)\n            self.visit(keyword.value, frame)\n            try:\n                val = keyword.value.as_const(frame.eval_ctx)\n            except nodes.Impossible:\n                frame.eval_ctx.volatile = True\n            else:\n                setattr(frame.eval_ctx, keyword.key, val)\n\n    def visit_ScopedEvalContextModifier(self, node, frame):\n        old_ctx_name = self.temporary_identifier()\n        saved_ctx = frame.eval_ctx.save()\n        self.writeline('%s = context.eval_ctx.save()' % old_ctx_name)\n        self.visit_EvalContextModifier(node, frame)\n        for child in node.body:\n            self.visit(child, frame)\n        frame.eval_ctx.revert(saved_ctx)\n        self.writeline('context.eval_ctx.revert(%s)' % old_ctx_name)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/constants.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja.constants\n    ~~~~~~~~~~~~~~~\n\n    Various constants.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\n\n\n#: list of lorem ipsum words used by the lipsum() helper function\nLOREM_IPSUM_WORDS = u'''\\\na ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at\nauctor augue bibendum blandit class commodo condimentum congue consectetuer\nconsequat conubia convallis cras cubilia cum curabitur curae cursus dapibus\ndiam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend\nelementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames\nfaucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac\nhendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum\njusto lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem\nluctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie\nmollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non\nnonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque\npenatibus per pharetra phasellus placerat platea porta porttitor posuere\npotenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus\nridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit\nsociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor\ntempus tincidunt torquent tortor tristique turpis ullamcorper ultrices\nultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus\nviverra volutpat vulputate'''\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/debug.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.debug\n    ~~~~~~~~~~~~\n\n    Implements the debug interface for Jinja.  This module does some pretty\n    ugly stuff with the Python traceback system in order to achieve tracebacks\n    with correct line numbers, locals and contents.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport sys\nimport traceback\nfrom types import TracebackType, CodeType\nfrom jinja2.utils import missing, internal_code\nfrom jinja2.exceptions import TemplateSyntaxError\nfrom jinja2._compat import iteritems, reraise, PY2\n\n# on pypy we can take advantage of transparent proxies\ntry:\n    from __pypy__ import tproxy\nexcept ImportError:\n    tproxy = None\n\n\n# how does the raise helper look like?\ntry:\n    exec(\"raise TypeError, 'foo'\")\nexcept SyntaxError:\n    raise_helper = 'raise __jinja_exception__[1]'\nexcept TypeError:\n    raise_helper = 'raise __jinja_exception__[0], __jinja_exception__[1]'\n\n\nclass TracebackFrameProxy(object):\n    \"\"\"Proxies a traceback frame.\"\"\"\n\n    def __init__(self, tb):\n        self.tb = tb\n        self._tb_next = None\n\n    @property\n    def tb_next(self):\n        return self._tb_next\n\n    def set_next(self, next):\n        if tb_set_next is not None:\n            try:\n                tb_set_next(self.tb, next and next.tb or None)\n            except Exception:\n                # this function can fail due to all the hackery it does\n                # on various python implementations.  We just catch errors\n                # down and ignore them if necessary.\n                pass\n        self._tb_next = next\n\n    @property\n    def is_jinja_frame(self):\n        return '__jinja_template__' in self.tb.tb_frame.f_globals\n\n    def __getattr__(self, name):\n        return getattr(self.tb, name)\n\n\ndef make_frame_proxy(frame):\n    proxy = TracebackFrameProxy(frame)\n    if tproxy is None:\n        return proxy\n    def operation_handler(operation, *args, **kwargs):\n        if operation in ('__getattribute__', '__getattr__'):\n            return getattr(proxy, args[0])\n        elif operation == '__setattr__':\n            proxy.__setattr__(*args, **kwargs)\n        else:\n            return getattr(proxy, operation)(*args, **kwargs)\n    return tproxy(TracebackType, operation_handler)\n\n\nclass ProcessedTraceback(object):\n    \"\"\"Holds a Jinja preprocessed traceback for printing or reraising.\"\"\"\n\n    def __init__(self, exc_type, exc_value, frames):\n        assert frames, 'no frames for this traceback?'\n        self.exc_type = exc_type\n        self.exc_value = exc_value\n        self.frames = frames\n\n        # newly concatenate the frames (which are proxies)\n        prev_tb = None\n        for tb in self.frames:\n            if prev_tb is not None:\n                prev_tb.set_next(tb)\n            prev_tb = tb\n        prev_tb.set_next(None)\n\n    def render_as_text(self, limit=None):\n        \"\"\"Return a string with the traceback.\"\"\"\n        lines = traceback.format_exception(self.exc_type, self.exc_value,\n                                           self.frames[0], limit=limit)\n        return ''.join(lines).rstrip()\n\n    def render_as_html(self, full=False):\n        \"\"\"Return a unicode string with the traceback as rendered HTML.\"\"\"\n        from jinja2.debugrenderer import render_traceback\n        return u'%s\\n\\n<!--\\n%s\\n-->' % (\n            render_traceback(self, full=full),\n            self.render_as_text().decode('utf-8', 'replace')\n        )\n\n    @property\n    def is_template_syntax_error(self):\n        \"\"\"`True` if this is a template syntax error.\"\"\"\n        return isinstance(self.exc_value, TemplateSyntaxError)\n\n    @property\n    def exc_info(self):\n        \"\"\"Exception info tuple with a proxy around the frame objects.\"\"\"\n        return self.exc_type, self.exc_value, self.frames[0]\n\n    @property\n    def standard_exc_info(self):\n        \"\"\"Standard python exc_info for re-raising\"\"\"\n        tb = self.frames[0]\n        # the frame will be an actual traceback (or transparent proxy) if\n        # we are on pypy or a python implementation with support for tproxy\n        if type(tb) is not TracebackType:\n            tb = tb.tb\n        return self.exc_type, self.exc_value, tb\n\n\ndef make_traceback(exc_info, source_hint=None):\n    \"\"\"Creates a processed traceback object from the exc_info.\"\"\"\n    exc_type, exc_value, tb = exc_info\n    if isinstance(exc_value, TemplateSyntaxError):\n        exc_info = translate_syntax_error(exc_value, source_hint)\n        initial_skip = 0\n    else:\n        initial_skip = 1\n    return translate_exception(exc_info, initial_skip)\n\n\ndef translate_syntax_error(error, source=None):\n    \"\"\"Rewrites a syntax error to please traceback systems.\"\"\"\n    error.source = source\n    error.translated = True\n    exc_info = (error.__class__, error, None)\n    filename = error.filename\n    if filename is None:\n        filename = '<unknown>'\n    return fake_exc_info(exc_info, filename, error.lineno)\n\n\ndef translate_exception(exc_info, initial_skip=0):\n    \"\"\"If passed an exc_info it will automatically rewrite the exceptions\n    all the way down to the correct line numbers and frames.\n    \"\"\"\n    tb = exc_info[2]\n    frames = []\n\n    # skip some internal frames if wanted\n    for x in range(initial_skip):\n        if tb is not None:\n            tb = tb.tb_next\n    initial_tb = tb\n\n    while tb is not None:\n        # skip frames decorated with @internalcode.  These are internal\n        # calls we can't avoid and that are useless in template debugging\n        # output.\n        if tb.tb_frame.f_code in internal_code:\n            tb = tb.tb_next\n            continue\n\n        # save a reference to the next frame if we override the current\n        # one with a faked one.\n        next = tb.tb_next\n\n        # fake template exceptions\n        template = tb.tb_frame.f_globals.get('__jinja_template__')\n        if template is not None:\n            lineno = template.get_corresponding_lineno(tb.tb_lineno)\n            tb = fake_exc_info(exc_info[:2] + (tb,), template.filename,\n                               lineno)[2]\n\n        frames.append(make_frame_proxy(tb))\n        tb = next\n\n    # if we don't have any exceptions in the frames left, we have to\n    # reraise it unchanged.\n    # XXX: can we backup here?  when could this happen?\n    if not frames:\n        reraise(exc_info[0], exc_info[1], exc_info[2])\n\n    return ProcessedTraceback(exc_info[0], exc_info[1], frames)\n\n\ndef get_jinja_locals(real_locals):\n    ctx = real_locals.get('context')\n    if ctx:\n        locals = ctx.get_all().copy()\n    else:\n        locals = {}\n\n    local_overrides = {}\n\n    for name, value in iteritems(real_locals):\n        if not name.startswith('l_') or value is missing:\n            continue\n        try:\n            _, depth, name = name.split('_', 2)\n            depth = int(depth)\n        except ValueError:\n            continue\n        cur_depth = local_overrides.get(name, (-1,))[0]\n        if cur_depth < depth:\n            local_overrides[name] = (depth, value)\n\n    for name, (_, value) in iteritems(local_overrides):\n        if value is missing:\n            locals.pop(name, None)\n        else:\n            locals[name] = value\n\n    return locals\n\n\ndef fake_exc_info(exc_info, filename, lineno):\n    \"\"\"Helper for `translate_exception`.\"\"\"\n    exc_type, exc_value, tb = exc_info\n\n    # figure the real context out\n    if tb is not None:\n        locals = get_jinja_locals(tb.tb_frame.f_locals)\n\n        # if there is a local called __jinja_exception__, we get\n        # rid of it to not break the debug functionality.\n        locals.pop('__jinja_exception__', None)\n    else:\n        locals = {}\n\n    # assamble fake globals we need\n    globals = {\n        '__name__':             filename,\n        '__file__':             filename,\n        '__jinja_exception__':  exc_info[:2],\n\n        # we don't want to keep the reference to the template around\n        # to not cause circular dependencies, but we mark it as Jinja\n        # frame for the ProcessedTraceback\n        '__jinja_template__':   None\n    }\n\n    # and fake the exception\n    code = compile('\\n' * (lineno - 1) + raise_helper, filename, 'exec')\n\n    # if it's possible, change the name of the code.  This won't work\n    # on some python environments such as google appengine\n    try:\n        if tb is None:\n            location = 'template'\n        else:\n            function = tb.tb_frame.f_code.co_name\n            if function == 'root':\n                location = 'top-level template code'\n            elif function.startswith('block_'):\n                location = 'block \"%s\"' % function[6:]\n            else:\n                location = 'template'\n\n        if PY2:\n            code = CodeType(0, code.co_nlocals, code.co_stacksize,\n                            code.co_flags, code.co_code, code.co_consts,\n                            code.co_names, code.co_varnames, filename,\n                            location, code.co_firstlineno,\n                            code.co_lnotab, (), ())\n        else:\n            code = CodeType(0, code.co_kwonlyargcount,\n                            code.co_nlocals, code.co_stacksize,\n                            code.co_flags, code.co_code, code.co_consts,\n                            code.co_names, code.co_varnames, filename,\n                            location, code.co_firstlineno,\n                            code.co_lnotab, (), ())\n    except Exception as e:\n        pass\n\n    # execute the code and catch the new traceback\n    try:\n        exec(code, globals, locals)\n    except:\n        exc_info = sys.exc_info()\n        new_tb = exc_info[2].tb_next\n\n    # return without this frame\n    return exc_info[:2] + (new_tb,)\n\n\ndef _init_ugly_crap():\n    \"\"\"This function implements a few ugly things so that we can patch the\n    traceback objects.  The function returned allows resetting `tb_next` on\n    any python traceback object.  Do not attempt to use this on non cpython\n    interpreters\n    \"\"\"\n    import ctypes\n    from types import TracebackType\n\n    if PY2:\n        # figure out size of _Py_ssize_t for Python 2:\n        if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):\n            _Py_ssize_t = ctypes.c_int64\n        else:\n            _Py_ssize_t = ctypes.c_int\n    else:\n        # platform ssize_t on Python 3\n        _Py_ssize_t = ctypes.c_ssize_t\n\n    # regular python\n    class _PyObject(ctypes.Structure):\n        pass\n    _PyObject._fields_ = [\n        ('ob_refcnt', _Py_ssize_t),\n        ('ob_type', ctypes.POINTER(_PyObject))\n    ]\n\n    # python with trace\n    if hasattr(sys, 'getobjects'):\n        class _PyObject(ctypes.Structure):\n            pass\n        _PyObject._fields_ = [\n            ('_ob_next', ctypes.POINTER(_PyObject)),\n            ('_ob_prev', ctypes.POINTER(_PyObject)),\n            ('ob_refcnt', _Py_ssize_t),\n            ('ob_type', ctypes.POINTER(_PyObject))\n        ]\n\n    class _Traceback(_PyObject):\n        pass\n    _Traceback._fields_ = [\n        ('tb_next', ctypes.POINTER(_Traceback)),\n        ('tb_frame', ctypes.POINTER(_PyObject)),\n        ('tb_lasti', ctypes.c_int),\n        ('tb_lineno', ctypes.c_int)\n    ]\n\n    def tb_set_next(tb, next):\n        \"\"\"Set the tb_next attribute of a traceback object.\"\"\"\n        if not (isinstance(tb, TracebackType) and\n                (next is None or isinstance(next, TracebackType))):\n            raise TypeError('tb_set_next arguments must be traceback objects')\n        obj = _Traceback.from_address(id(tb))\n        if tb.tb_next is not None:\n            old = _Traceback.from_address(id(tb.tb_next))\n            old.ob_refcnt -= 1\n        if next is None:\n            obj.tb_next = ctypes.POINTER(_Traceback)()\n        else:\n            next = _Traceback.from_address(id(next))\n            next.ob_refcnt += 1\n            obj.tb_next = ctypes.pointer(next)\n\n    return tb_set_next\n\n\n# try to get a tb_set_next implementation if we don't have transparent\n# proxies.\ntb_set_next = None\nif tproxy is None:\n    # traceback.tb_next can be modified since CPython 3.7\n    if sys.version_info >= (3, 7):\n        def tb_set_next(tb, next):\n            tb.tb_next = next\n    else:\n        # On Python 3.6 and older, use ctypes\n        try:\n            tb_set_next = _init_ugly_crap()\n        except Exception:\n            pass\ndel _init_ugly_crap\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/defaults.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.defaults\n    ~~~~~~~~~~~~~~~\n\n    Jinja default filters and tags.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2._compat import range_type\nfrom jinja2.utils import generate_lorem_ipsum, Cycler, Joiner, Namespace\n\n\n# defaults for the parser / lexer\nBLOCK_START_STRING = '{%'\nBLOCK_END_STRING = '%}'\nVARIABLE_START_STRING = '{{'\nVARIABLE_END_STRING = '}}'\nCOMMENT_START_STRING = '{#'\nCOMMENT_END_STRING = '#}'\nLINE_STATEMENT_PREFIX = None\nLINE_COMMENT_PREFIX = None\nTRIM_BLOCKS = False\nLSTRIP_BLOCKS = False\nNEWLINE_SEQUENCE = '\\n'\nKEEP_TRAILING_NEWLINE = False\n\n\n# default filters, tests and namespace\nfrom jinja2.filters import FILTERS as DEFAULT_FILTERS\nfrom jinja2.tests import TESTS as DEFAULT_TESTS\nDEFAULT_NAMESPACE = {\n    'range':        range_type,\n    'dict':         dict,\n    'lipsum':       generate_lorem_ipsum,\n    'cycler':       Cycler,\n    'joiner':       Joiner,\n    'namespace':    Namespace\n}\n\n\n# default policies\nDEFAULT_POLICIES = {\n    'compiler.ascii_str':   True,\n    'urlize.rel':           'noopener',\n    'urlize.target':        None,\n    'truncate.leeway':      5,\n    'json.dumps_function':  None,\n    'json.dumps_kwargs':    {'sort_keys': True},\n    'ext.i18n.trimmed':     False,\n}\n\n\n# export all constants\n__all__ = tuple(x for x in locals().keys() if x.isupper())\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/environment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.environment\n    ~~~~~~~~~~~~~~~~~~\n\n    Provides a class that holds runtime and parsing time options.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport sys\nimport weakref\nfrom functools import reduce, partial\nfrom jinja2 import nodes\nfrom jinja2.defaults import BLOCK_START_STRING, \\\n     BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \\\n     COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \\\n     LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \\\n     DEFAULT_FILTERS, DEFAULT_TESTS, DEFAULT_NAMESPACE, \\\n     DEFAULT_POLICIES, KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS\nfrom jinja2.lexer import get_lexer, TokenStream\nfrom jinja2.parser import Parser\nfrom jinja2.nodes import EvalContext\nfrom jinja2.compiler import generate, CodeGenerator\nfrom jinja2.runtime import Undefined, new_context, Context\nfrom jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \\\n     TemplatesNotFound, TemplateRuntimeError\nfrom jinja2.utils import import_string, LRUCache, Markup, missing, \\\n     concat, consume, internalcode, have_async_gen\nfrom jinja2._compat import imap, ifilter, string_types, iteritems, \\\n     text_type, reraise, implements_iterator, implements_to_string, \\\n     encode_filename, PY2, PYPY\n\n\n# for direct template usage we have up to ten living environments\n_spontaneous_environments = LRUCache(10)\n\n# the function to create jinja traceback objects.  This is dynamically\n# imported on the first exception in the exception handler.\n_make_traceback = None\n\n\ndef get_spontaneous_environment(*args):\n    \"\"\"Return a new spontaneous environment.  A spontaneous environment is an\n    unnamed and unaccessible (in theory) environment that is used for\n    templates generated from a string and not from the file system.\n    \"\"\"\n    try:\n        env = _spontaneous_environments.get(args)\n    except TypeError:\n        return Environment(*args)\n    if env is not None:\n        return env\n    _spontaneous_environments[args] = env = Environment(*args)\n    env.shared = True\n    return env\n\n\ndef create_cache(size):\n    \"\"\"Return the cache class for the given size.\"\"\"\n    if size == 0:\n        return None\n    if size < 0:\n        return {}\n    return LRUCache(size)\n\n\ndef copy_cache(cache):\n    \"\"\"Create an empty copy of the given cache.\"\"\"\n    if cache is None:\n        return None\n    elif type(cache) is dict:\n        return {}\n    return LRUCache(cache.capacity)\n\n\ndef load_extensions(environment, extensions):\n    \"\"\"Load the extensions from the list and bind it to the environment.\n    Returns a dict of instantiated environments.\n    \"\"\"\n    result = {}\n    for extension in extensions:\n        if isinstance(extension, string_types):\n            extension = import_string(extension)\n        result[extension.identifier] = extension(environment)\n    return result\n\n\ndef fail_for_missing_callable(string, name):\n    msg = string % name\n    if isinstance(name, Undefined):\n        try:\n            name._fail_with_undefined_error()\n        except Exception as e:\n            msg = '%s (%s; did you forget to quote the callable name?)' % (msg, e)\n    raise TemplateRuntimeError(msg)\n\n\ndef _environment_sanity_check(environment):\n    \"\"\"Perform a sanity check on the environment.\"\"\"\n    assert issubclass(environment.undefined, Undefined), 'undefined must ' \\\n        'be a subclass of undefined because filters depend on it.'\n    assert environment.block_start_string != \\\n        environment.variable_start_string != \\\n        environment.comment_start_string, 'block, variable and comment ' \\\n        'start strings must be different'\n    assert environment.newline_sequence in ('\\r', '\\r\\n', '\\n'), \\\n        'newline_sequence set to unknown line ending string.'\n    return environment\n\n\nclass Environment(object):\n    r\"\"\"The core component of Jinja is the `Environment`.  It contains\n    important shared variables like configuration, filters, tests,\n    globals and others.  Instances of this class may be modified if\n    they are not shared and if no template was loaded so far.\n    Modifications on environments after the first template was loaded\n    will lead to surprising effects and undefined behavior.\n\n    Here are the possible initialization parameters:\n\n        `block_start_string`\n            The string marking the beginning of a block.  Defaults to ``'{%'``.\n\n        `block_end_string`\n            The string marking the end of a block.  Defaults to ``'%}'``.\n\n        `variable_start_string`\n            The string marking the beginning of a print statement.\n            Defaults to ``'{{'``.\n\n        `variable_end_string`\n            The string marking the end of a print statement.  Defaults to\n            ``'}}'``.\n\n        `comment_start_string`\n            The string marking the beginning of a comment.  Defaults to ``'{#'``.\n\n        `comment_end_string`\n            The string marking the end of a comment.  Defaults to ``'#}'``.\n\n        `line_statement_prefix`\n            If given and a string, this will be used as prefix for line based\n            statements.  See also :ref:`line-statements`.\n\n        `line_comment_prefix`\n            If given and a string, this will be used as prefix for line based\n            comments.  See also :ref:`line-statements`.\n\n            .. versionadded:: 2.2\n\n        `trim_blocks`\n            If this is set to ``True`` the first newline after a block is\n            removed (block, not variable tag!).  Defaults to `False`.\n\n        `lstrip_blocks`\n            If this is set to ``True`` leading spaces and tabs are stripped\n            from the start of a line to a block.  Defaults to `False`.\n\n        `newline_sequence`\n            The sequence that starts a newline.  Must be one of ``'\\r'``,\n            ``'\\n'`` or ``'\\r\\n'``.  The default is ``'\\n'`` which is a\n            useful default for Linux and OS X systems as well as web\n            applications.\n\n        `keep_trailing_newline`\n            Preserve the trailing newline when rendering templates.\n            The default is ``False``, which causes a single newline,\n            if present, to be stripped from the end of the template.\n\n            .. versionadded:: 2.7\n\n        `extensions`\n            List of Jinja extensions to use.  This can either be import paths\n            as strings or extension classes.  For more information have a\n            look at :ref:`the extensions documentation <jinja-extensions>`.\n\n        `optimized`\n            should the optimizer be enabled?  Default is ``True``.\n\n        `undefined`\n            :class:`Undefined` or a subclass of it that is used to represent\n            undefined values in the template.\n\n        `finalize`\n            A callable that can be used to process the result of a variable\n            expression before it is output.  For example one can convert\n            ``None`` implicitly into an empty string here.\n\n        `autoescape`\n            If set to ``True`` the XML/HTML autoescaping feature is enabled by\n            default.  For more details about autoescaping see\n            :class:`~jinja2.utils.Markup`.  As of Jinja 2.4 this can also\n            be a callable that is passed the template name and has to\n            return ``True`` or ``False`` depending on autoescape should be\n            enabled by default.\n\n            .. versionchanged:: 2.4\n               `autoescape` can now be a function\n\n        `loader`\n            The template loader for this environment.\n\n        `cache_size`\n            The size of the cache.  Per default this is ``400`` which means\n            that if more than 400 templates are loaded the loader will clean\n            out the least recently used template.  If the cache size is set to\n            ``0`` templates are recompiled all the time, if the cache size is\n            ``-1`` the cache will not be cleaned.\n\n            .. versionchanged:: 2.8\n               The cache size was increased to 400 from a low 50.\n\n        `auto_reload`\n            Some loaders load templates from locations where the template\n            sources may change (ie: file system or database).  If\n            ``auto_reload`` is set to ``True`` (default) every time a template is\n            requested the loader checks if the source changed and if yes, it\n            will reload the template.  For higher performance it's possible to\n            disable that.\n\n        `bytecode_cache`\n            If set to a bytecode cache object, this object will provide a\n            cache for the internal Jinja bytecode so that templates don't\n            have to be parsed if they were not changed.\n\n            See :ref:`bytecode-cache` for more information.\n\n        `enable_async`\n            If set to true this enables async template execution which allows\n            you to take advantage of newer Python features.  This requires\n            Python 3.6 or later.\n    \"\"\"\n\n    #: if this environment is sandboxed.  Modifying this variable won't make\n    #: the environment sandboxed though.  For a real sandboxed environment\n    #: have a look at jinja2.sandbox.  This flag alone controls the code\n    #: generation by the compiler.\n    sandboxed = False\n\n    #: True if the environment is just an overlay\n    overlayed = False\n\n    #: the environment this environment is linked to if it is an overlay\n    linked_to = None\n\n    #: shared environments have this set to `True`.  A shared environment\n    #: must not be modified\n    shared = False\n\n    #: these are currently EXPERIMENTAL undocumented features.\n    exception_handler = None\n    exception_formatter = None\n\n    #: the class that is used for code generation.  See\n    #: :class:`~jinja2.compiler.CodeGenerator` for more information.\n    code_generator_class = CodeGenerator\n\n    #: the context class thatis used for templates.  See\n    #: :class:`~jinja2.runtime.Context` for more information.\n    context_class = Context\n\n    def __init__(self,\n                 block_start_string=BLOCK_START_STRING,\n                 block_end_string=BLOCK_END_STRING,\n                 variable_start_string=VARIABLE_START_STRING,\n                 variable_end_string=VARIABLE_END_STRING,\n                 comment_start_string=COMMENT_START_STRING,\n                 comment_end_string=COMMENT_END_STRING,\n                 line_statement_prefix=LINE_STATEMENT_PREFIX,\n                 line_comment_prefix=LINE_COMMENT_PREFIX,\n                 trim_blocks=TRIM_BLOCKS,\n                 lstrip_blocks=LSTRIP_BLOCKS,\n                 newline_sequence=NEWLINE_SEQUENCE,\n                 keep_trailing_newline=KEEP_TRAILING_NEWLINE,\n                 extensions=(),\n                 optimized=True,\n                 undefined=Undefined,\n                 finalize=None,\n                 autoescape=False,\n                 loader=None,\n                 cache_size=400,\n                 auto_reload=True,\n                 bytecode_cache=None,\n                 enable_async=False):\n        # !!Important notice!!\n        #   The constructor accepts quite a few arguments that should be\n        #   passed by keyword rather than position.  However it's important to\n        #   not change the order of arguments because it's used at least\n        #   internally in those cases:\n        #       -   spontaneous environments (i18n extension and Template)\n        #       -   unittests\n        #   If parameter changes are required only add parameters at the end\n        #   and don't change the arguments (or the defaults!) of the arguments\n        #   existing already.\n\n        # lexer / parser information\n        self.block_start_string = block_start_string\n        self.block_end_string = block_end_string\n        self.variable_start_string = variable_start_string\n        self.variable_end_string = variable_end_string\n        self.comment_start_string = comment_start_string\n        self.comment_end_string = comment_end_string\n        self.line_statement_prefix = line_statement_prefix\n        self.line_comment_prefix = line_comment_prefix\n        self.trim_blocks = trim_blocks\n        self.lstrip_blocks = lstrip_blocks\n        self.newline_sequence = newline_sequence\n        self.keep_trailing_newline = keep_trailing_newline\n\n        # runtime information\n        self.undefined = undefined\n        self.optimized = optimized\n        self.finalize = finalize\n        self.autoescape = autoescape\n\n        # defaults\n        self.filters = DEFAULT_FILTERS.copy()\n        self.tests = DEFAULT_TESTS.copy()\n        self.globals = DEFAULT_NAMESPACE.copy()\n\n        # set the loader provided\n        self.loader = loader\n        self.cache = create_cache(cache_size)\n        self.bytecode_cache = bytecode_cache\n        self.auto_reload = auto_reload\n\n        # configurable policies\n        self.policies = DEFAULT_POLICIES.copy()\n\n        # load extensions\n        self.extensions = load_extensions(self, extensions)\n\n        self.enable_async = enable_async\n        self.is_async = self.enable_async and have_async_gen\n\n        _environment_sanity_check(self)\n\n    def add_extension(self, extension):\n        \"\"\"Adds an extension after the environment was created.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        self.extensions.update(load_extensions(self, [extension]))\n\n    def extend(self, **attributes):\n        \"\"\"Add the items to the instance of the environment if they do not exist\n        yet.  This is used by :ref:`extensions <writing-extensions>` to register\n        callbacks and configuration values without breaking inheritance.\n        \"\"\"\n        for key, value in iteritems(attributes):\n            if not hasattr(self, key):\n                setattr(self, key, value)\n\n    def overlay(self, block_start_string=missing, block_end_string=missing,\n                variable_start_string=missing, variable_end_string=missing,\n                comment_start_string=missing, comment_end_string=missing,\n                line_statement_prefix=missing, line_comment_prefix=missing,\n                trim_blocks=missing, lstrip_blocks=missing,\n                extensions=missing, optimized=missing,\n                undefined=missing, finalize=missing, autoescape=missing,\n                loader=missing, cache_size=missing, auto_reload=missing,\n                bytecode_cache=missing):\n        \"\"\"Create a new overlay environment that shares all the data with the\n        current environment except for cache and the overridden attributes.\n        Extensions cannot be removed for an overlayed environment.  An overlayed\n        environment automatically gets all the extensions of the environment it\n        is linked to plus optional extra extensions.\n\n        Creating overlays should happen after the initial environment was set\n        up completely.  Not all attributes are truly linked, some are just\n        copied over so modifications on the original environment may not shine\n        through.\n        \"\"\"\n        args = dict(locals())\n        del args['self'], args['cache_size'], args['extensions']\n\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.overlayed = True\n        rv.linked_to = self\n\n        for key, value in iteritems(args):\n            if value is not missing:\n                setattr(rv, key, value)\n\n        if cache_size is not missing:\n            rv.cache = create_cache(cache_size)\n        else:\n            rv.cache = copy_cache(self.cache)\n\n        rv.extensions = {}\n        for key, value in iteritems(self.extensions):\n            rv.extensions[key] = value.bind(rv)\n        if extensions is not missing:\n            rv.extensions.update(load_extensions(rv, extensions))\n\n        return _environment_sanity_check(rv)\n\n    lexer = property(get_lexer, doc=\"The lexer for this environment.\")\n\n    def iter_extensions(self):\n        \"\"\"Iterates over the extensions by priority.\"\"\"\n        return iter(sorted(self.extensions.values(),\n                           key=lambda x: x.priority))\n\n    def getitem(self, obj, argument):\n        \"\"\"Get an item or attribute of an object but prefer the item.\"\"\"\n        try:\n            return obj[argument]\n        except (AttributeError, TypeError, LookupError):\n            if isinstance(argument, string_types):\n                try:\n                    attr = str(argument)\n                except Exception:\n                    pass\n                else:\n                    try:\n                        return getattr(obj, attr)\n                    except AttributeError:\n                        pass\n            return self.undefined(obj=obj, name=argument)\n\n    def getattr(self, obj, attribute):\n        \"\"\"Get an item or attribute of an object but prefer the attribute.\n        Unlike :meth:`getitem` the attribute *must* be a bytestring.\n        \"\"\"\n        try:\n            return getattr(obj, attribute)\n        except AttributeError:\n            pass\n        try:\n            return obj[attribute]\n        except (TypeError, LookupError, AttributeError):\n            return self.undefined(obj=obj, name=attribute)\n\n    def call_filter(self, name, value, args=None, kwargs=None,\n                    context=None, eval_ctx=None):\n        \"\"\"Invokes a filter on a value the same way the compiler does it.\n\n        Note that on Python 3 this might return a coroutine in case the\n        filter is running from an environment in async mode and the filter\n        supports async execution.  It's your responsibility to await this\n        if needed.\n\n        .. versionadded:: 2.7\n        \"\"\"\n        func = self.filters.get(name)\n        if func is None:\n            fail_for_missing_callable('no filter named %r', name)\n        args = [value] + list(args or ())\n        if getattr(func, 'contextfilter', False):\n            if context is None:\n                raise TemplateRuntimeError('Attempted to invoke context '\n                                           'filter without context')\n            args.insert(0, context)\n        elif getattr(func, 'evalcontextfilter', False):\n            if eval_ctx is None:\n                if context is not None:\n                    eval_ctx = context.eval_ctx\n                else:\n                    eval_ctx = EvalContext(self)\n            args.insert(0, eval_ctx)\n        elif getattr(func, 'environmentfilter', False):\n            args.insert(0, self)\n        return func(*args, **(kwargs or {}))\n\n    def call_test(self, name, value, args=None, kwargs=None):\n        \"\"\"Invokes a test on a value the same way the compiler does it.\n\n        .. versionadded:: 2.7\n        \"\"\"\n        func = self.tests.get(name)\n        if func is None:\n            fail_for_missing_callable('no test named %r', name)\n        return func(value, *(args or ()), **(kwargs or {}))\n\n    @internalcode\n    def parse(self, source, name=None, filename=None):\n        \"\"\"Parse the sourcecode and return the abstract syntax tree.  This\n        tree of nodes is used by the compiler to convert the template into\n        executable source- or bytecode.  This is useful for debugging or to\n        extract information from templates.\n\n        If you are :ref:`developing Jinja2 extensions <writing-extensions>`\n        this gives you a good overview of the node tree generated.\n        \"\"\"\n        try:\n            return self._parse(source, name, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source)\n\n    def _parse(self, source, name, filename):\n        \"\"\"Internal parsing function used by `parse` and `compile`.\"\"\"\n        return Parser(self, source, name, encode_filename(filename)).parse()\n\n    def lex(self, source, name=None, filename=None):\n        \"\"\"Lex the given sourcecode and return a generator that yields\n        tokens as tuples in the form ``(lineno, token_type, value)``.\n        This can be useful for :ref:`extension development <writing-extensions>`\n        and debugging templates.\n\n        This does not perform preprocessing.  If you want the preprocessing\n        of the extensions to be applied you have to filter source through\n        the :meth:`preprocess` method.\n        \"\"\"\n        source = text_type(source)\n        try:\n            return self.lexer.tokeniter(source, name, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source)\n\n    def preprocess(self, source, name=None, filename=None):\n        \"\"\"Preprocesses the source with all extensions.  This is automatically\n        called for all parsing and compiling methods but *not* for :meth:`lex`\n        because there you usually only want the actual source tokenized.\n        \"\"\"\n        return reduce(lambda s, e: e.preprocess(s, name, filename),\n                      self.iter_extensions(), text_type(source))\n\n    def _tokenize(self, source, name, filename=None, state=None):\n        \"\"\"Called by the parser to do the preprocessing and filtering\n        for all the extensions.  Returns a :class:`~jinja2.lexer.TokenStream`.\n        \"\"\"\n        source = self.preprocess(source, name, filename)\n        stream = self.lexer.tokenize(source, name, filename, state)\n        for ext in self.iter_extensions():\n            stream = ext.filter_stream(stream)\n            if not isinstance(stream, TokenStream):\n                stream = TokenStream(stream, name, filename)\n        return stream\n\n    def _generate(self, source, name, filename, defer_init=False):\n        \"\"\"Internal hook that can be overridden to hook a different generate\n        method in.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        return generate(source, self, name, filename, defer_init=defer_init,\n                        optimized=self.optimized)\n\n    def _compile(self, source, filename):\n        \"\"\"Internal hook that can be overridden to hook a different compile\n        method in.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        return compile(source, filename, 'exec')\n\n    @internalcode\n    def compile(self, source, name=None, filename=None, raw=False,\n                defer_init=False):\n        \"\"\"Compile a node or template source code.  The `name` parameter is\n        the load name of the template after it was joined using\n        :meth:`join_path` if necessary, not the filename on the file system.\n        the `filename` parameter is the estimated filename of the template on\n        the file system.  If the template came from a database or memory this\n        can be omitted.\n\n        The return value of this method is a python code object.  If the `raw`\n        parameter is `True` the return value will be a string with python\n        code equivalent to the bytecode returned otherwise.  This method is\n        mainly used internally.\n\n        `defer_init` is use internally to aid the module code generator.  This\n        causes the generated code to be able to import without the global\n        environment variable to be set.\n\n        .. versionadded:: 2.4\n           `defer_init` parameter added.\n        \"\"\"\n        source_hint = None\n        try:\n            if isinstance(source, string_types):\n                source_hint = source\n                source = self._parse(source, name, filename)\n            source = self._generate(source, name, filename,\n                                    defer_init=defer_init)\n            if raw:\n                return source\n            if filename is None:\n                filename = '<template>'\n            else:\n                filename = encode_filename(filename)\n            return self._compile(source, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source_hint)\n\n    def compile_expression(self, source, undefined_to_none=True):\n        \"\"\"A handy helper method that returns a callable that accepts keyword\n        arguments that appear as variables in the expression.  If called it\n        returns the result of the expression.\n\n        This is useful if applications want to use the same rules as Jinja\n        in template \"configuration files\" or similar situations.\n\n        Example usage:\n\n        >>> env = Environment()\n        >>> expr = env.compile_expression('foo == 42')\n        >>> expr(foo=23)\n        False\n        >>> expr(foo=42)\n        True\n\n        Per default the return value is converted to `None` if the\n        expression returns an undefined value.  This can be changed\n        by setting `undefined_to_none` to `False`.\n\n        >>> env.compile_expression('var')() is None\n        True\n        >>> env.compile_expression('var', undefined_to_none=False)()\n        Undefined\n\n        .. versionadded:: 2.1\n        \"\"\"\n        parser = Parser(self, source, state='variable')\n        exc_info = None\n        try:\n            expr = parser.parse_expression()\n            if not parser.stream.eos:\n                raise TemplateSyntaxError('chunk after expression',\n                                          parser.stream.current.lineno,\n                                          None, None)\n            expr.set_environment(self)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        if exc_info is not None:\n            self.handle_exception(exc_info, source_hint=source)\n        body = [nodes.Assign(nodes.Name('result', 'store'), expr, lineno=1)]\n        template = self.from_string(nodes.Template(body, lineno=1))\n        return TemplateExpression(template, undefined_to_none)\n\n    def compile_templates(self, target, extensions=None, filter_func=None,\n                          zip='deflated', log_function=None,\n                          ignore_errors=True, py_compile=False):\n        \"\"\"Finds all the templates the loader can find, compiles them\n        and stores them in `target`.  If `zip` is `None`, instead of in a\n        zipfile, the templates will be stored in a directory.\n        By default a deflate zip algorithm is used. To switch to\n        the stored algorithm, `zip` can be set to ``'stored'``.\n\n        `extensions` and `filter_func` are passed to :meth:`list_templates`.\n        Each template returned will be compiled to the target folder or\n        zipfile.\n\n        By default template compilation errors are ignored.  In case a\n        log function is provided, errors are logged.  If you want template\n        syntax errors to abort the compilation you can set `ignore_errors`\n        to `False` and you will get an exception on syntax errors.\n\n        If `py_compile` is set to `True` .pyc files will be written to the\n        target instead of standard .py files.  This flag does not do anything\n        on pypy and Python 3 where pyc files are not picked up by itself and\n        don't give much benefit.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        from jinja2.loaders import ModuleLoader\n\n        if log_function is None:\n            log_function = lambda x: None\n\n        if py_compile:\n            if not PY2 or PYPY:\n                from warnings import warn\n                warn(Warning('py_compile has no effect on pypy or Python 3'))\n                py_compile = False\n            else:\n                import imp\n                import marshal\n                py_header = imp.get_magic() + \\\n                    u'\\xff\\xff\\xff\\xff'.encode('iso-8859-15')\n\n                # Python 3.3 added a source filesize to the header\n                if sys.version_info >= (3, 3):\n                    py_header += u'\\x00\\x00\\x00\\x00'.encode('iso-8859-15')\n\n        def write_file(filename, data, mode):\n            if zip:\n                info = ZipInfo(filename)\n                info.external_attr = 0o755 << 16\n                zip_file.writestr(info, data)\n            else:\n                f = open(os.path.join(target, filename), mode)\n                try:\n                    f.write(data)\n                finally:\n                    f.close()\n\n        if zip is not None:\n            from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED, ZIP_STORED\n            zip_file = ZipFile(target, 'w', dict(deflated=ZIP_DEFLATED,\n                                                 stored=ZIP_STORED)[zip])\n            log_function('Compiling into Zip archive \"%s\"' % target)\n        else:\n            if not os.path.isdir(target):\n                os.makedirs(target)\n            log_function('Compiling into folder \"%s\"' % target)\n\n        try:\n            for name in self.list_templates(extensions, filter_func):\n                source, filename, _ = self.loader.get_source(self, name)\n                try:\n                    code = self.compile(source, name, filename, True, True)\n                except TemplateSyntaxError as e:\n                    if not ignore_errors:\n                        raise\n                    log_function('Could not compile \"%s\": %s' % (name, e))\n                    continue\n\n                filename = ModuleLoader.get_module_filename(name)\n\n                if py_compile:\n                    c = self._compile(code, encode_filename(filename))\n                    write_file(filename + 'c', py_header +\n                               marshal.dumps(c), 'wb')\n                    log_function('Byte-compiled \"%s\" as %s' %\n                                 (name, filename + 'c'))\n                else:\n                    write_file(filename, code, 'w')\n                    log_function('Compiled \"%s\" as %s' % (name, filename))\n        finally:\n            if zip:\n                zip_file.close()\n\n        log_function('Finished compiling templates')\n\n    def list_templates(self, extensions=None, filter_func=None):\n        \"\"\"Returns a list of templates for this environment.  This requires\n        that the loader supports the loader's\n        :meth:`~BaseLoader.list_templates` method.\n\n        If there are other files in the template folder besides the\n        actual templates, the returned list can be filtered.  There are two\n        ways: either `extensions` is set to a list of file extensions for\n        templates, or a `filter_func` can be provided which is a callable that\n        is passed a template name and should return `True` if it should end up\n        in the result list.\n\n        If the loader does not support that, a :exc:`TypeError` is raised.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        x = self.loader.list_templates()\n        if extensions is not None:\n            if filter_func is not None:\n                raise TypeError('either extensions or filter_func '\n                                'can be passed, but not both')\n            filter_func = lambda x: '.' in x and \\\n                                    x.rsplit('.', 1)[1] in extensions\n        if filter_func is not None:\n            x = list(ifilter(filter_func, x))\n        return x\n\n    def handle_exception(self, exc_info=None, rendered=False, source_hint=None):\n        \"\"\"Exception handling helper.  This is used internally to either raise\n        rewritten exceptions or return a rendered traceback for the template.\n        \"\"\"\n        global _make_traceback\n        if exc_info is None:\n            exc_info = sys.exc_info()\n\n        # the debugging module is imported when it's used for the first time.\n        # we're doing a lot of stuff there and for applications that do not\n        # get any exceptions in template rendering there is no need to load\n        # all of that.\n        if _make_traceback is None:\n            from jinja2.debug import make_traceback as _make_traceback\n        traceback = _make_traceback(exc_info, source_hint)\n        if rendered and self.exception_formatter is not None:\n            return self.exception_formatter(traceback)\n        if self.exception_handler is not None:\n            self.exception_handler(traceback)\n        exc_type, exc_value, tb = traceback.standard_exc_info\n        reraise(exc_type, exc_value, tb)\n\n    def join_path(self, template, parent):\n        \"\"\"Join a template with the parent.  By default all the lookups are\n        relative to the loader root so this method returns the `template`\n        parameter unchanged, but if the paths should be relative to the\n        parent template, this function can be used to calculate the real\n        template name.\n\n        Subclasses may override this method and implement template path\n        joining here.\n        \"\"\"\n        return template\n\n    @internalcode\n    def _load_template(self, name, globals):\n        if self.loader is None:\n            raise TypeError('no loader for this environment specified')\n        cache_key = (weakref.ref(self.loader), name)\n        if self.cache is not None:\n            template = self.cache.get(cache_key)\n            if template is not None and (not self.auto_reload or\n                                         template.is_up_to_date):\n                return template\n        template = self.loader.load(self, name, globals)\n        if self.cache is not None:\n            self.cache[cache_key] = template\n        return template\n\n    @internalcode\n    def get_template(self, name, parent=None, globals=None):\n        \"\"\"Load a template from the loader.  If a loader is configured this\n        method asks the loader for the template and returns a :class:`Template`.\n        If the `parent` parameter is not `None`, :meth:`join_path` is called\n        to get the real template name before loading.\n\n        The `globals` parameter can be used to provide template wide globals.\n        These variables are available in the context at render time.\n\n        If the template does not exist a :exc:`TemplateNotFound` exception is\n        raised.\n\n        .. versionchanged:: 2.4\n           If `name` is a :class:`Template` object it is returned from the\n           function unchanged.\n        \"\"\"\n        if isinstance(name, Template):\n            return name\n        if parent is not None:\n            name = self.join_path(name, parent)\n        return self._load_template(name, self.make_globals(globals))\n\n    @internalcode\n    def select_template(self, names, parent=None, globals=None):\n        \"\"\"Works like :meth:`get_template` but tries a number of templates\n        before it fails.  If it cannot find any of the templates, it will\n        raise a :exc:`TemplatesNotFound` exception.\n\n        .. versionadded:: 2.3\n\n        .. versionchanged:: 2.4\n           If `names` contains a :class:`Template` object it is returned\n           from the function unchanged.\n        \"\"\"\n        if not names:\n            raise TemplatesNotFound(message=u'Tried to select from an empty list '\n                                            u'of templates.')\n        globals = self.make_globals(globals)\n        for name in names:\n            if isinstance(name, Template):\n                return name\n            if parent is not None:\n                name = self.join_path(name, parent)\n            try:\n                return self._load_template(name, globals)\n            except TemplateNotFound:\n                pass\n        raise TemplatesNotFound(names)\n\n    @internalcode\n    def get_or_select_template(self, template_name_or_list,\n                               parent=None, globals=None):\n        \"\"\"Does a typecheck and dispatches to :meth:`select_template`\n        if an iterable of template names is given, otherwise to\n        :meth:`get_template`.\n\n        .. versionadded:: 2.3\n        \"\"\"\n        if isinstance(template_name_or_list, string_types):\n            return self.get_template(template_name_or_list, parent, globals)\n        elif isinstance(template_name_or_list, Template):\n            return template_name_or_list\n        return self.select_template(template_name_or_list, parent, globals)\n\n    def from_string(self, source, globals=None, template_class=None):\n        \"\"\"Load a template from a string.  This parses the source given and\n        returns a :class:`Template` object.\n        \"\"\"\n        globals = self.make_globals(globals)\n        cls = template_class or self.template_class\n        return cls.from_code(self, self.compile(source), globals, None)\n\n    def make_globals(self, d):\n        \"\"\"Return a dict for the globals.\"\"\"\n        if not d:\n            return self.globals\n        return dict(self.globals, **d)\n\n\nclass Template(object):\n    \"\"\"The central template object.  This class represents a compiled template\n    and is used to evaluate it.\n\n    Normally the template object is generated from an :class:`Environment` but\n    it also has a constructor that makes it possible to create a template\n    instance directly using the constructor.  It takes the same arguments as\n    the environment constructor but it's not possible to specify a loader.\n\n    Every template object has a few methods and members that are guaranteed\n    to exist.  However it's important that a template object should be\n    considered immutable.  Modifications on the object are not supported.\n\n    Template objects created from the constructor rather than an environment\n    do have an `environment` attribute that points to a temporary environment\n    that is probably shared with other templates created with the constructor\n    and compatible settings.\n\n    >>> template = Template('Hello {{ name }}!')\n    >>> template.render(name='John Doe') == u'Hello John Doe!'\n    True\n    >>> stream = template.stream(name='John Doe')\n    >>> next(stream) == u'Hello John Doe!'\n    True\n    >>> next(stream)\n    Traceback (most recent call last):\n        ...\n    StopIteration\n    \"\"\"\n\n    def __new__(cls, source,\n                block_start_string=BLOCK_START_STRING,\n                block_end_string=BLOCK_END_STRING,\n                variable_start_string=VARIABLE_START_STRING,\n                variable_end_string=VARIABLE_END_STRING,\n                comment_start_string=COMMENT_START_STRING,\n                comment_end_string=COMMENT_END_STRING,\n                line_statement_prefix=LINE_STATEMENT_PREFIX,\n                line_comment_prefix=LINE_COMMENT_PREFIX,\n                trim_blocks=TRIM_BLOCKS,\n                lstrip_blocks=LSTRIP_BLOCKS,\n                newline_sequence=NEWLINE_SEQUENCE,\n                keep_trailing_newline=KEEP_TRAILING_NEWLINE,\n                extensions=(),\n                optimized=True,\n                undefined=Undefined,\n                finalize=None,\n                autoescape=False,\n                enable_async=False):\n        env = get_spontaneous_environment(\n            block_start_string, block_end_string, variable_start_string,\n            variable_end_string, comment_start_string, comment_end_string,\n            line_statement_prefix, line_comment_prefix, trim_blocks,\n            lstrip_blocks, newline_sequence, keep_trailing_newline,\n            frozenset(extensions), optimized, undefined, finalize, autoescape,\n            None, 0, False, None, enable_async)\n        return env.from_string(source, template_class=cls)\n\n    @classmethod\n    def from_code(cls, environment, code, globals, uptodate=None):\n        \"\"\"Creates a template object from compiled code and the globals.  This\n        is used by the loaders and environment to create a template object.\n        \"\"\"\n        namespace = {\n            'environment':  environment,\n            '__file__':     code.co_filename\n        }\n        exec(code, namespace)\n        rv = cls._from_namespace(environment, namespace, globals)\n        rv._uptodate = uptodate\n        return rv\n\n    @classmethod\n    def from_module_dict(cls, environment, module_dict, globals):\n        \"\"\"Creates a template object from a module.  This is used by the\n        module loader to create a template object.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        return cls._from_namespace(environment, module_dict, globals)\n\n    @classmethod\n    def _from_namespace(cls, environment, namespace, globals):\n        t = object.__new__(cls)\n        t.environment = environment\n        t.globals = globals\n        t.name = namespace['name']\n        t.filename = namespace['__file__']\n        t.blocks = namespace['blocks']\n\n        # render function and module\n        t.root_render_func = namespace['root']\n        t._module = None\n\n        # debug and loader helpers\n        t._debug_info = namespace['debug_info']\n        t._uptodate = None\n\n        # store the reference\n        namespace['environment'] = environment\n        namespace['__jinja_template__'] = t\n\n        return t\n\n    def render(self, *args, **kwargs):\n        \"\"\"This method accepts the same arguments as the `dict` constructor:\n        A dict, a dict subclass or some keyword arguments.  If no arguments\n        are given the context will be empty.  These two calls do the same::\n\n            template.render(knights='that say nih')\n            template.render({'knights': 'that say nih'})\n\n        This will return the rendered template as unicode string.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n        try:\n            return concat(self.root_render_func(self.new_context(vars)))\n        except Exception:\n            exc_info = sys.exc_info()\n        return self.environment.handle_exception(exc_info, True)\n\n    def render_async(self, *args, **kwargs):\n        \"\"\"This works similar to :meth:`render` but returns a coroutine\n        that when awaited returns the entire rendered template string.  This\n        requires the async feature to be enabled.\n\n        Example usage::\n\n            await template.render_async(knights='that say nih; asynchronously')\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    def stream(self, *args, **kwargs):\n        \"\"\"Works exactly like :meth:`generate` but returns a\n        :class:`TemplateStream`.\n        \"\"\"\n        return TemplateStream(self.generate(*args, **kwargs))\n\n    def generate(self, *args, **kwargs):\n        \"\"\"For very large templates it can be useful to not render the whole\n        template at once but evaluate each statement after another and yield\n        piece for piece.  This method basically does exactly that and returns\n        a generator that yields one item after another as unicode strings.\n\n        It accepts the same arguments as :meth:`render`.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n        try:\n            for event in self.root_render_func(self.new_context(vars)):\n                yield event\n        except Exception:\n            exc_info = sys.exc_info()\n        else:\n            return\n        yield self.environment.handle_exception(exc_info, True)\n\n    def generate_async(self, *args, **kwargs):\n        \"\"\"An async version of :meth:`generate`.  Works very similarly but\n        returns an async iterator instead.\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    def new_context(self, vars=None, shared=False, locals=None):\n        \"\"\"Create a new :class:`Context` for this template.  The vars\n        provided will be passed to the template.  Per default the globals\n        are added to the context.  If shared is set to `True` the data\n        is passed as it to the context without adding the globals.\n\n        `locals` can be a dict of local variables for internal usage.\n        \"\"\"\n        return new_context(self.environment, self.name, self.blocks,\n                           vars, shared, self.globals, locals)\n\n    def make_module(self, vars=None, shared=False, locals=None):\n        \"\"\"This method works like the :attr:`module` attribute when called\n        without arguments but it will evaluate the template on every call\n        rather than caching it.  It's also possible to provide\n        a dict which is then used as context.  The arguments are the same\n        as for the :meth:`new_context` method.\n        \"\"\"\n        return TemplateModule(self, self.new_context(vars, shared, locals))\n\n    def make_module_async(self, vars=None, shared=False, locals=None):\n        \"\"\"As template module creation can invoke template code for\n        asynchronous exections this method must be used instead of the\n        normal :meth:`make_module` one.  Likewise the module attribute\n        becomes unavailable in async mode.\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    @internalcode\n    def _get_default_module(self):\n        if self._module is not None:\n            return self._module\n        self._module = rv = self.make_module()\n        return rv\n\n    @property\n    def module(self):\n        \"\"\"The template as module.  This is used for imports in the\n        template runtime but is also useful if one wants to access\n        exported template variables from the Python layer:\n\n        >>> t = Template('{% macro foo() %}42{% endmacro %}23')\n        >>> str(t.module)\n        '23'\n        >>> t.module.foo() == u'42'\n        True\n\n        This attribute is not available if async mode is enabled.\n        \"\"\"\n        return self._get_default_module()\n\n    def get_corresponding_lineno(self, lineno):\n        \"\"\"Return the source line number of a line number in the\n        generated bytecode as they are not in sync.\n        \"\"\"\n        for template_line, code_line in reversed(self.debug_info):\n            if code_line <= lineno:\n                return template_line\n        return 1\n\n    @property\n    def is_up_to_date(self):\n        \"\"\"If this variable is `False` there is a newer version available.\"\"\"\n        if self._uptodate is None:\n            return True\n        return self._uptodate()\n\n    @property\n    def debug_info(self):\n        \"\"\"The debug info mapping.\"\"\"\n        return [tuple(imap(int, x.split('='))) for x in\n                self._debug_info.split('&')]\n\n    def __repr__(self):\n        if self.name is None:\n            name = 'memory:%x' % id(self)\n        else:\n            name = repr(self.name)\n        return '<%s %s>' % (self.__class__.__name__, name)\n\n\n@implements_to_string\nclass TemplateModule(object):\n    \"\"\"Represents an imported template.  All the exported names of the\n    template are available as attributes on this object.  Additionally\n    converting it into an unicode- or bytestrings renders the contents.\n    \"\"\"\n\n    def __init__(self, template, context, body_stream=None):\n        if body_stream is None:\n            if context.environment.is_async:\n                raise RuntimeError('Async mode requires a body stream '\n                                   'to be passed to a template module.  Use '\n                                   'the async methods of the API you are '\n                                   'using.')\n            body_stream = list(template.root_render_func(context))\n        self._body_stream = body_stream\n        self.__dict__.update(context.get_exported())\n        self.__name__ = template.name\n\n    def __html__(self):\n        return Markup(concat(self._body_stream))\n\n    def __str__(self):\n        return concat(self._body_stream)\n\n    def __repr__(self):\n        if self.__name__ is None:\n            name = 'memory:%x' % id(self)\n        else:\n            name = repr(self.__name__)\n        return '<%s %s>' % (self.__class__.__name__, name)\n\n\nclass TemplateExpression(object):\n    \"\"\"The :meth:`jinja2.Environment.compile_expression` method returns an\n    instance of this object.  It encapsulates the expression-like access\n    to the template with an expression it wraps.\n    \"\"\"\n\n    def __init__(self, template, undefined_to_none):\n        self._template = template\n        self._undefined_to_none = undefined_to_none\n\n    def __call__(self, *args, **kwargs):\n        context = self._template.new_context(dict(*args, **kwargs))\n        consume(self._template.root_render_func(context))\n        rv = context.vars['result']\n        if self._undefined_to_none and isinstance(rv, Undefined):\n            rv = None\n        return rv\n\n\n@implements_iterator\nclass TemplateStream(object):\n    \"\"\"A template stream works pretty much like an ordinary python generator\n    but it can buffer multiple items to reduce the number of total iterations.\n    Per default the output is unbuffered which means that for every unbuffered\n    instruction in the template one unicode string is yielded.\n\n    If buffering is enabled with a buffer size of 5, five items are combined\n    into a new unicode string.  This is mainly useful if you are streaming\n    big templates to a client via WSGI which flushes after each iteration.\n    \"\"\"\n\n    def __init__(self, gen):\n        self._gen = gen\n        self.disable_buffering()\n\n    def dump(self, fp, encoding=None, errors='strict'):\n        \"\"\"Dump the complete stream into a file or file-like object.\n        Per default unicode strings are written, if you want to encode\n        before writing specify an `encoding`.\n\n        Example usage::\n\n            Template('Hello {{ name }}!').stream(name='foo').dump('hello.html')\n        \"\"\"\n        close = False\n        if isinstance(fp, string_types):\n            if encoding is None:\n                encoding = 'utf-8'\n            fp = open(fp, 'wb')\n            close = True\n        try:\n            if encoding is not None:\n                iterable = (x.encode(encoding, errors) for x in self)\n            else:\n                iterable = self\n            if hasattr(fp, 'writelines'):\n                fp.writelines(iterable)\n            else:\n                for item in iterable:\n                    fp.write(item)\n        finally:\n            if close:\n                fp.close()\n\n    def disable_buffering(self):\n        \"\"\"Disable the output buffering.\"\"\"\n        self._next = partial(next, self._gen)\n        self.buffered = False\n\n    def _buffered_generator(self, size):\n        buf = []\n        c_size = 0\n        push = buf.append\n\n        while 1:\n            try:\n                while c_size < size:\n                    c = next(self._gen)\n                    push(c)\n                    if c:\n                        c_size += 1\n            except StopIteration:\n                if not c_size:\n                    return\n            yield concat(buf)\n            del buf[:]\n            c_size = 0\n\n    def enable_buffering(self, size=5):\n        \"\"\"Enable buffering.  Buffer `size` items before yielding them.\"\"\"\n        if size <= 1:\n            raise ValueError('buffer size too small')\n\n        self.buffered = True\n        self._next = partial(next, self._buffered_generator(size))\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        return self._next()\n\n\n# hook in default template class.  if anyone reads this comment: ignore that\n# it's possible to use custom templates ;-)\nEnvironment.template_class = Template\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/exceptions.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.exceptions\n    ~~~~~~~~~~~~~~~~~\n\n    Jinja exceptions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2._compat import imap, text_type, PY2, implements_to_string\n\n\nclass TemplateError(Exception):\n    \"\"\"Baseclass for all template errors.\"\"\"\n\n    if PY2:\n        def __init__(self, message=None):\n            if message is not None:\n                message = text_type(message).encode('utf-8')\n            Exception.__init__(self, message)\n\n        @property\n        def message(self):\n            if self.args:\n                message = self.args[0]\n                if message is not None:\n                    return message.decode('utf-8', 'replace')\n\n        def __unicode__(self):\n            return self.message or u''\n    else:\n        def __init__(self, message=None):\n            Exception.__init__(self, message)\n\n        @property\n        def message(self):\n            if self.args:\n                message = self.args[0]\n                if message is not None:\n                    return message\n\n\n@implements_to_string\nclass TemplateNotFound(IOError, LookupError, TemplateError):\n    \"\"\"Raised if a template does not exist.\"\"\"\n\n    # looks weird, but removes the warning descriptor that just\n    # bogusly warns us about message being deprecated\n    message = None\n\n    def __init__(self, name, message=None):\n        IOError.__init__(self)\n        if message is None:\n            message = name\n        self.message = message\n        self.name = name\n        self.templates = [name]\n\n    def __str__(self):\n        return self.message\n\n\nclass TemplatesNotFound(TemplateNotFound):\n    \"\"\"Like :class:`TemplateNotFound` but raised if multiple templates\n    are selected.  This is a subclass of :class:`TemplateNotFound`\n    exception, so just catching the base exception will catch both.\n\n    .. versionadded:: 2.2\n    \"\"\"\n\n    def __init__(self, names=(), message=None):\n        if message is None:\n            message = u'none of the templates given were found: ' + \\\n                      u', '.join(imap(text_type, names))\n        TemplateNotFound.__init__(self, names and names[-1] or None, message)\n        self.templates = list(names)\n\n\n@implements_to_string\nclass TemplateSyntaxError(TemplateError):\n    \"\"\"Raised to tell the user that there is a problem with the template.\"\"\"\n\n    def __init__(self, message, lineno, name=None, filename=None):\n        TemplateError.__init__(self, message)\n        self.lineno = lineno\n        self.name = name\n        self.filename = filename\n        self.source = None\n\n        # this is set to True if the debug.translate_syntax_error\n        # function translated the syntax error into a new traceback\n        self.translated = False\n\n    def __str__(self):\n        # for translated errors we only return the message\n        if self.translated:\n            return self.message\n\n        # otherwise attach some stuff\n        location = 'line %d' % self.lineno\n        name = self.filename or self.name\n        if name:\n            location = 'File \"%s\", %s' % (name, location)\n        lines = [self.message, '  ' + location]\n\n        # if the source is set, add the line to the output\n        if self.source is not None:\n            try:\n                line = self.source.splitlines()[self.lineno - 1]\n            except IndexError:\n                line = None\n            if line:\n                lines.append('    ' + line.strip())\n\n        return u'\\n'.join(lines)\n\n\nclass TemplateAssertionError(TemplateSyntaxError):\n    \"\"\"Like a template syntax error, but covers cases where something in the\n    template caused an error at compile time that wasn't necessarily caused\n    by a syntax error.  However it's a direct subclass of\n    :exc:`TemplateSyntaxError` and has the same attributes.\n    \"\"\"\n\n\nclass TemplateRuntimeError(TemplateError):\n    \"\"\"A generic runtime error in the template engine.  Under some situations\n    Jinja may raise this exception.\n    \"\"\"\n\n\nclass UndefinedError(TemplateRuntimeError):\n    \"\"\"Raised if a template tries to operate on :class:`Undefined`.\"\"\"\n\n\nclass SecurityError(TemplateRuntimeError):\n    \"\"\"Raised if a template tries to do something insecure if the\n    sandbox is enabled.\n    \"\"\"\n\n\nclass FilterArgumentError(TemplateRuntimeError):\n    \"\"\"This error is raised if a filter was called with inappropriate\n    arguments\n    \"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/ext.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.ext\n    ~~~~~~~~~~\n\n    Jinja extensions allow to add custom tags similar to the way django custom\n    tags work.  By default two example extensions exist: an i18n and a cache\n    extension.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport re\n\nfrom jinja2 import nodes\nfrom jinja2.defaults import BLOCK_START_STRING, \\\n     BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \\\n     COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \\\n     LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \\\n     KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS\nfrom jinja2.environment import Environment\nfrom jinja2.runtime import concat\nfrom jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError\nfrom jinja2.utils import contextfunction, import_string, Markup\nfrom jinja2._compat import with_metaclass, string_types, iteritems\n\n\n# the only real useful gettext functions for a Jinja template.  Note\n# that ugettext must be assigned to gettext as Jinja doesn't support\n# non unicode strings.\nGETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')\n\n\nclass ExtensionRegistry(type):\n    \"\"\"Gives the extension an unique identifier.\"\"\"\n\n    def __new__(cls, name, bases, d):\n        rv = type.__new__(cls, name, bases, d)\n        rv.identifier = rv.__module__ + '.' + rv.__name__\n        return rv\n\n\nclass Extension(with_metaclass(ExtensionRegistry, object)):\n    \"\"\"Extensions can be used to add extra functionality to the Jinja template\n    system at the parser level.  Custom extensions are bound to an environment\n    but may not store environment specific data on `self`.  The reason for\n    this is that an extension can be bound to another environment (for\n    overlays) by creating a copy and reassigning the `environment` attribute.\n\n    As extensions are created by the environment they cannot accept any\n    arguments for configuration.  One may want to work around that by using\n    a factory function, but that is not possible as extensions are identified\n    by their import name.  The correct way to configure the extension is\n    storing the configuration values on the environment.  Because this way the\n    environment ends up acting as central configuration storage the\n    attributes may clash which is why extensions have to ensure that the names\n    they choose for configuration are not too generic.  ``prefix`` for example\n    is a terrible name, ``fragment_cache_prefix`` on the other hand is a good\n    name as includes the name of the extension (fragment cache).\n    \"\"\"\n\n    #: if this extension parses this is the list of tags it's listening to.\n    tags = set()\n\n    #: the priority of that extension.  This is especially useful for\n    #: extensions that preprocess values.  A lower value means higher\n    #: priority.\n    #:\n    #: .. versionadded:: 2.4\n    priority = 100\n\n    def __init__(self, environment):\n        self.environment = environment\n\n    def bind(self, environment):\n        \"\"\"Create a copy of this extension bound to another environment.\"\"\"\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.environment = environment\n        return rv\n\n    def preprocess(self, source, name, filename=None):\n        \"\"\"This method is called before the actual lexing and can be used to\n        preprocess the source.  The `filename` is optional.  The return value\n        must be the preprocessed source.\n        \"\"\"\n        return source\n\n    def filter_stream(self, stream):\n        \"\"\"It's passed a :class:`~jinja2.lexer.TokenStream` that can be used\n        to filter tokens returned.  This method has to return an iterable of\n        :class:`~jinja2.lexer.Token`\\\\s, but it doesn't have to return a\n        :class:`~jinja2.lexer.TokenStream`.\n\n        In the `ext` folder of the Jinja2 source distribution there is a file\n        called `inlinegettext.py` which implements a filter that utilizes this\n        method.\n        \"\"\"\n        return stream\n\n    def parse(self, parser):\n        \"\"\"If any of the :attr:`tags` matched this method is called with the\n        parser as first argument.  The token the parser stream is pointing at\n        is the name token that matched.  This method has to return one or a\n        list of multiple nodes.\n        \"\"\"\n        raise NotImplementedError()\n\n    def attr(self, name, lineno=None):\n        \"\"\"Return an attribute node for the current extension.  This is useful\n        to pass constants on extensions to generated template code.\n\n        ::\n\n            self.attr('_my_attribute', lineno=lineno)\n        \"\"\"\n        return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno)\n\n    def call_method(self, name, args=None, kwargs=None, dyn_args=None,\n                    dyn_kwargs=None, lineno=None):\n        \"\"\"Call a method of the extension.  This is a shortcut for\n        :meth:`attr` + :class:`jinja2.nodes.Call`.\n        \"\"\"\n        if args is None:\n            args = []\n        if kwargs is None:\n            kwargs = []\n        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,\n                          dyn_args, dyn_kwargs, lineno=lineno)\n\n\n@contextfunction\ndef _gettext_alias(__context, *args, **kwargs):\n    return __context.call(__context.resolve('gettext'), *args, **kwargs)\n\n\ndef _make_new_gettext(func):\n    @contextfunction\n    def gettext(__context, __string, **variables):\n        rv = __context.call(func, __string)\n        if __context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv % variables\n    return gettext\n\n\ndef _make_new_ngettext(func):\n    @contextfunction\n    def ngettext(__context, __singular, __plural, __num, **variables):\n        variables.setdefault('num', __num)\n        rv = __context.call(func, __singular, __plural, __num)\n        if __context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv % variables\n    return ngettext\n\n\nclass InternationalizationExtension(Extension):\n    \"\"\"This extension adds gettext support to Jinja2.\"\"\"\n    tags = set(['trans'])\n\n    # TODO: the i18n extension is currently reevaluating values in a few\n    # situations.  Take this example:\n    #   {% trans count=something() %}{{ count }} foo{% pluralize\n    #     %}{{ count }} fooss{% endtrans %}\n    # something is called twice here.  One time for the gettext value and\n    # the other time for the n-parameter of the ngettext function.\n\n    def __init__(self, environment):\n        Extension.__init__(self, environment)\n        environment.globals['_'] = _gettext_alias\n        environment.extend(\n            install_gettext_translations=self._install,\n            install_null_translations=self._install_null,\n            install_gettext_callables=self._install_callables,\n            uninstall_gettext_translations=self._uninstall,\n            extract_translations=self._extract,\n            newstyle_gettext=False\n        )\n\n    def _install(self, translations, newstyle=None):\n        gettext = getattr(translations, 'ugettext', None)\n        if gettext is None:\n            gettext = translations.gettext\n        ngettext = getattr(translations, 'ungettext', None)\n        if ngettext is None:\n            ngettext = translations.ngettext\n        self._install_callables(gettext, ngettext, newstyle)\n\n    def _install_null(self, newstyle=None):\n        self._install_callables(\n            lambda x: x,\n            lambda s, p, n: (n != 1 and (p,) or (s,))[0],\n            newstyle\n        )\n\n    def _install_callables(self, gettext, ngettext, newstyle=None):\n        if newstyle is not None:\n            self.environment.newstyle_gettext = newstyle\n        if self.environment.newstyle_gettext:\n            gettext = _make_new_gettext(gettext)\n            ngettext = _make_new_ngettext(ngettext)\n        self.environment.globals.update(\n            gettext=gettext,\n            ngettext=ngettext\n        )\n\n    def _uninstall(self, translations):\n        for key in 'gettext', 'ngettext':\n            self.environment.globals.pop(key, None)\n\n    def _extract(self, source, gettext_functions=GETTEXT_FUNCTIONS):\n        if isinstance(source, string_types):\n            source = self.environment.parse(source)\n        return extract_from_ast(source, gettext_functions)\n\n    def parse(self, parser):\n        \"\"\"Parse a translatable tag.\"\"\"\n        lineno = next(parser.stream).lineno\n        num_called_num = False\n\n        # find all the variables referenced.  Additionally a variable can be\n        # defined in the body of the trans block too, but this is checked at\n        # a later state.\n        plural_expr = None\n        plural_expr_assignment = None\n        variables = {}\n        trimmed = None\n        while parser.stream.current.type != 'block_end':\n            if variables:\n                parser.stream.expect('comma')\n\n            # skip colon for python compatibility\n            if parser.stream.skip_if('colon'):\n                break\n\n            name = parser.stream.expect('name')\n            if name.value in variables:\n                parser.fail('translatable variable %r defined twice.' %\n                            name.value, name.lineno,\n                            exc=TemplateAssertionError)\n\n            # expressions\n            if parser.stream.current.type == 'assign':\n                next(parser.stream)\n                variables[name.value] = var = parser.parse_expression()\n            elif trimmed is None and name.value in ('trimmed', 'notrimmed'):\n                trimmed = name.value == 'trimmed'\n                continue\n            else:\n                variables[name.value] = var = nodes.Name(name.value, 'load')\n\n            if plural_expr is None:\n                if isinstance(var, nodes.Call):\n                    plural_expr = nodes.Name('_trans', 'load')\n                    variables[name.value] = plural_expr\n                    plural_expr_assignment = nodes.Assign(\n                        nodes.Name('_trans', 'store'), var)\n                else:\n                    plural_expr = var\n                num_called_num = name.value == 'num'\n\n        parser.stream.expect('block_end')\n\n        plural = None\n        have_plural = False\n        referenced = set()\n\n        # now parse until endtrans or pluralize\n        singular_names, singular = self._parse_block(parser, True)\n        if singular_names:\n            referenced.update(singular_names)\n            if plural_expr is None:\n                plural_expr = nodes.Name(singular_names[0], 'load')\n                num_called_num = singular_names[0] == 'num'\n\n        # if we have a pluralize block, we parse that too\n        if parser.stream.current.test('name:pluralize'):\n            have_plural = True\n            next(parser.stream)\n            if parser.stream.current.type != 'block_end':\n                name = parser.stream.expect('name')\n                if name.value not in variables:\n                    parser.fail('unknown variable %r for pluralization' %\n                                name.value, name.lineno,\n                                exc=TemplateAssertionError)\n                plural_expr = variables[name.value]\n                num_called_num = name.value == 'num'\n            parser.stream.expect('block_end')\n            plural_names, plural = self._parse_block(parser, False)\n            next(parser.stream)\n            referenced.update(plural_names)\n        else:\n            next(parser.stream)\n\n        # register free names as simple name expressions\n        for var in referenced:\n            if var not in variables:\n                variables[var] = nodes.Name(var, 'load')\n\n        if not have_plural:\n            plural_expr = None\n        elif plural_expr is None:\n            parser.fail('pluralize without variables', lineno)\n\n        if trimmed is None:\n            trimmed = self.environment.policies['ext.i18n.trimmed']\n        if trimmed:\n            singular = self._trim_whitespace(singular)\n            if plural:\n                plural = self._trim_whitespace(plural)\n\n        node = self._make_node(singular, plural, variables, plural_expr,\n                               bool(referenced),\n                               num_called_num and have_plural)\n        node.set_lineno(lineno)\n        if plural_expr_assignment is not None:\n            return [plural_expr_assignment, node]\n        else:\n            return node\n\n    def _trim_whitespace(self, string, _ws_re=re.compile(r'\\s*\\n\\s*')):\n        return _ws_re.sub(' ', string.strip())\n\n    def _parse_block(self, parser, allow_pluralize):\n        \"\"\"Parse until the next block tag with a given name.\"\"\"\n        referenced = []\n        buf = []\n        while 1:\n            if parser.stream.current.type == 'data':\n                buf.append(parser.stream.current.value.replace('%', '%%'))\n                next(parser.stream)\n            elif parser.stream.current.type == 'variable_begin':\n                next(parser.stream)\n                name = parser.stream.expect('name').value\n                referenced.append(name)\n                buf.append('%%(%s)s' % name)\n                parser.stream.expect('variable_end')\n            elif parser.stream.current.type == 'block_begin':\n                next(parser.stream)\n                if parser.stream.current.test('name:endtrans'):\n                    break\n                elif parser.stream.current.test('name:pluralize'):\n                    if allow_pluralize:\n                        break\n                    parser.fail('a translatable section can have only one '\n                                'pluralize section')\n                parser.fail('control structures in translatable sections are '\n                            'not allowed')\n            elif parser.stream.eos:\n                parser.fail('unclosed translation block')\n            else:\n                assert False, 'internal parser error'\n\n        return referenced, concat(buf)\n\n    def _make_node(self, singular, plural, variables, plural_expr,\n                   vars_referenced, num_called_num):\n        \"\"\"Generates a useful node from the data provided.\"\"\"\n        # no variables referenced?  no need to escape for old style\n        # gettext invocations only if there are vars.\n        if not vars_referenced and not self.environment.newstyle_gettext:\n            singular = singular.replace('%%', '%')\n            if plural:\n                plural = plural.replace('%%', '%')\n\n        # singular only:\n        if plural_expr is None:\n            gettext = nodes.Name('gettext', 'load')\n            node = nodes.Call(gettext, [nodes.Const(singular)],\n                              [], None, None)\n\n        # singular and plural\n        else:\n            ngettext = nodes.Name('ngettext', 'load')\n            node = nodes.Call(ngettext, [\n                nodes.Const(singular),\n                nodes.Const(plural),\n                plural_expr\n            ], [], None, None)\n\n        # in case newstyle gettext is used, the method is powerful\n        # enough to handle the variable expansion and autoescape\n        # handling itself\n        if self.environment.newstyle_gettext:\n            for key, value in iteritems(variables):\n                # the function adds that later anyways in case num was\n                # called num, so just skip it.\n                if num_called_num and key == 'num':\n                    continue\n                node.kwargs.append(nodes.Keyword(key, value))\n\n        # otherwise do that here\n        else:\n            # mark the return value as safe if we are in an\n            # environment with autoescaping turned on\n            node = nodes.MarkSafeIfAutoescape(node)\n            if variables:\n                node = nodes.Mod(node, nodes.Dict([\n                    nodes.Pair(nodes.Const(key), value)\n                    for key, value in variables.items()\n                ]))\n        return nodes.Output([node])\n\n\nclass ExprStmtExtension(Extension):\n    \"\"\"Adds a `do` tag to Jinja2 that works like the print statement just\n    that it doesn't print the return value.\n    \"\"\"\n    tags = set(['do'])\n\n    def parse(self, parser):\n        node = nodes.ExprStmt(lineno=next(parser.stream).lineno)\n        node.node = parser.parse_tuple()\n        return node\n\n\nclass LoopControlExtension(Extension):\n    \"\"\"Adds break and continue to the template engine.\"\"\"\n    tags = set(['break', 'continue'])\n\n    def parse(self, parser):\n        token = next(parser.stream)\n        if token.value == 'break':\n            return nodes.Break(lineno=token.lineno)\n        return nodes.Continue(lineno=token.lineno)\n\n\nclass WithExtension(Extension):\n    pass\n\n\nclass AutoEscapeExtension(Extension):\n    pass\n\n\ndef extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,\n                     babel_style=True):\n    \"\"\"Extract localizable strings from the given template node.  Per\n    default this function returns matches in babel style that means non string\n    parameters as well as keyword arguments are returned as `None`.  This\n    allows Babel to figure out what you really meant if you are using\n    gettext functions that allow keyword arguments for placeholder expansion.\n    If you don't want that behavior set the `babel_style` parameter to `False`\n    which causes only strings to be returned and parameters are always stored\n    in tuples.  As a consequence invalid gettext calls (calls without a single\n    string parameter or string parameters after non-string parameters) are\n    skipped.\n\n    This example explains the behavior:\n\n    >>> from jinja2 import Environment\n    >>> env = Environment()\n    >>> node = env.parse('{{ (_(\"foo\"), _(), ngettext(\"foo\", \"bar\", 42)) }}')\n    >>> list(extract_from_ast(node))\n    [(1, '_', 'foo'), (1, '_', ()), (1, 'ngettext', ('foo', 'bar', None))]\n    >>> list(extract_from_ast(node, babel_style=False))\n    [(1, '_', ('foo',)), (1, 'ngettext', ('foo', 'bar'))]\n\n    For every string found this function yields a ``(lineno, function,\n    message)`` tuple, where:\n\n    * ``lineno`` is the number of the line on which the string was found,\n    * ``function`` is the name of the ``gettext`` function used (if the\n      string was extracted from embedded Python code), and\n    *  ``message`` is the string itself (a ``unicode`` object, or a tuple\n       of ``unicode`` objects for functions with multiple string arguments).\n\n    This extraction function operates on the AST and is because of that unable\n    to extract any comments.  For comment support you have to use the babel\n    extraction interface or extract comments yourself.\n    \"\"\"\n    for node in node.find_all(nodes.Call):\n        if not isinstance(node.node, nodes.Name) or \\\n           node.node.name not in gettext_functions:\n            continue\n\n        strings = []\n        for arg in node.args:\n            if isinstance(arg, nodes.Const) and \\\n               isinstance(arg.value, string_types):\n                strings.append(arg.value)\n            else:\n                strings.append(None)\n\n        for arg in node.kwargs:\n            strings.append(None)\n        if node.dyn_args is not None:\n            strings.append(None)\n        if node.dyn_kwargs is not None:\n            strings.append(None)\n\n        if not babel_style:\n            strings = tuple(x for x in strings if x is not None)\n            if not strings:\n                continue\n        else:\n            if len(strings) == 1:\n                strings = strings[0]\n            else:\n                strings = tuple(strings)\n        yield node.lineno, node.node.name, strings\n\n\nclass _CommentFinder(object):\n    \"\"\"Helper class to find comments in a token stream.  Can only\n    find comments for gettext calls forwards.  Once the comment\n    from line 4 is found, a comment for line 1 will not return a\n    usable value.\n    \"\"\"\n\n    def __init__(self, tokens, comment_tags):\n        self.tokens = tokens\n        self.comment_tags = comment_tags\n        self.offset = 0\n        self.last_lineno = 0\n\n    def find_backwards(self, offset):\n        try:\n            for _, token_type, token_value in \\\n                    reversed(self.tokens[self.offset:offset]):\n                if token_type in ('comment', 'linecomment'):\n                    try:\n                        prefix, comment = token_value.split(None, 1)\n                    except ValueError:\n                        continue\n                    if prefix in self.comment_tags:\n                        return [comment.rstrip()]\n            return []\n        finally:\n            self.offset = offset\n\n    def find_comments(self, lineno):\n        if not self.comment_tags or self.last_lineno > lineno:\n            return []\n        for idx, (token_lineno, _, _) in enumerate(self.tokens[self.offset:]):\n            if token_lineno > lineno:\n                return self.find_backwards(self.offset + idx)\n        return self.find_backwards(len(self.tokens))\n\n\ndef babel_extract(fileobj, keywords, comment_tags, options):\n    \"\"\"Babel extraction method for Jinja templates.\n\n    .. versionchanged:: 2.3\n       Basic support for translation comments was added.  If `comment_tags`\n       is now set to a list of keywords for extraction, the extractor will\n       try to find the best preceeding comment that begins with one of the\n       keywords.  For best results, make sure to not have more than one\n       gettext call in one line of code and the matching comment in the\n       same line or the line before.\n\n    .. versionchanged:: 2.5.1\n       The `newstyle_gettext` flag can be set to `True` to enable newstyle\n       gettext calls.\n\n    .. versionchanged:: 2.7\n       A `silent` option can now be provided.  If set to `False` template\n       syntax errors are propagated instead of being ignored.\n\n    :param fileobj: the file-like object the messages should be extracted from\n    :param keywords: a list of keywords (i.e. function names) that should be\n                     recognized as translation functions\n    :param comment_tags: a list of translator tags to search for and include\n                         in the results.\n    :param options: a dictionary of additional options (optional)\n    :return: an iterator over ``(lineno, funcname, message, comments)`` tuples.\n             (comments will be empty currently)\n    \"\"\"\n    extensions = set()\n    for extension in options.get('extensions', '').split(','):\n        extension = extension.strip()\n        if not extension:\n            continue\n        extensions.add(import_string(extension))\n    if InternationalizationExtension not in extensions:\n        extensions.add(InternationalizationExtension)\n\n    def getbool(options, key, default=False):\n        return options.get(key, str(default)).lower() in \\\n            ('1', 'on', 'yes', 'true')\n\n    silent = getbool(options, 'silent', True)\n    environment = Environment(\n        options.get('block_start_string', BLOCK_START_STRING),\n        options.get('block_end_string', BLOCK_END_STRING),\n        options.get('variable_start_string', VARIABLE_START_STRING),\n        options.get('variable_end_string', VARIABLE_END_STRING),\n        options.get('comment_start_string', COMMENT_START_STRING),\n        options.get('comment_end_string', COMMENT_END_STRING),\n        options.get('line_statement_prefix') or LINE_STATEMENT_PREFIX,\n        options.get('line_comment_prefix') or LINE_COMMENT_PREFIX,\n        getbool(options, 'trim_blocks', TRIM_BLOCKS),\n        getbool(options, 'lstrip_blocks', LSTRIP_BLOCKS),\n        NEWLINE_SEQUENCE,\n        getbool(options, 'keep_trailing_newline', KEEP_TRAILING_NEWLINE),\n        frozenset(extensions),\n        cache_size=0,\n        auto_reload=False\n    )\n\n    if getbool(options, 'trimmed'):\n        environment.policies['ext.i18n.trimmed'] = True\n    if getbool(options, 'newstyle_gettext'):\n        environment.newstyle_gettext = True\n\n    source = fileobj.read().decode(options.get('encoding', 'utf-8'))\n    try:\n        node = environment.parse(source)\n        tokens = list(environment.lex(environment.preprocess(source)))\n    except TemplateSyntaxError as e:\n        if not silent:\n            raise\n        # skip templates with syntax errors\n        return\n\n    finder = _CommentFinder(tokens, comment_tags)\n    for lineno, func, message in extract_from_ast(node, keywords):\n        yield lineno, func, message, finder.find_comments(lineno)\n\n\n#: nicer import names\ni18n = InternationalizationExtension\ndo = ExprStmtExtension\nloopcontrols = LoopControlExtension\nwith_ = WithExtension\nautoescape = AutoEscapeExtension\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/filters.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.filters\n    ~~~~~~~~~~~~~~\n\n    Bundled jinja filters.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nimport math\nimport random\nimport warnings\n\nfrom itertools import groupby, chain\nfrom collections import namedtuple\nfrom jinja2.utils import Markup, escape, pformat, urlize, soft_unicode, \\\n     unicode_urlencode, htmlsafe_json_dumps\nfrom jinja2.runtime import Undefined\nfrom jinja2.exceptions import FilterArgumentError\nfrom jinja2._compat import imap, string_types, text_type, iteritems, PY2\n\n\n_word_re = re.compile(r'\\w+', re.UNICODE)\n_word_beginning_split_re = re.compile(r'([-\\s\\(\\{\\[\\<]+)', re.UNICODE)\n\n\ndef contextfilter(f):\n    \"\"\"Decorator for marking context dependent filters. The current\n    :class:`Context` will be passed as first argument.\n    \"\"\"\n    f.contextfilter = True\n    return f\n\n\ndef evalcontextfilter(f):\n    \"\"\"Decorator for marking eval-context dependent filters.  An eval\n    context object is passed as first argument.  For more information\n    about the eval context, see :ref:`eval-context`.\n\n    .. versionadded:: 2.4\n    \"\"\"\n    f.evalcontextfilter = True\n    return f\n\n\ndef environmentfilter(f):\n    \"\"\"Decorator for marking environment dependent filters.  The current\n    :class:`Environment` is passed to the filter as first argument.\n    \"\"\"\n    f.environmentfilter = True\n    return f\n\n\ndef ignore_case(value):\n    \"\"\"For use as a postprocessor for :func:`make_attrgetter`. Converts strings\n    to lowercase and returns other types as-is.\"\"\"\n    return value.lower() if isinstance(value, string_types) else value\n\n\ndef make_attrgetter(environment, attribute, postprocess=None):\n    \"\"\"Returns a callable that looks up the given attribute from a\n    passed object with the rules of the environment.  Dots are allowed\n    to access attributes of attributes.  Integer parts in paths are\n    looked up as integers.\n    \"\"\"\n    if attribute is None:\n        attribute = []\n    elif isinstance(attribute, string_types):\n        attribute = [int(x) if x.isdigit() else x for x in attribute.split('.')]\n    else:\n        attribute = [attribute]\n\n    def attrgetter(item):\n        for part in attribute:\n            item = environment.getitem(item, part)\n\n        if postprocess is not None:\n            item = postprocess(item)\n\n        return item\n\n    return attrgetter\n\n\ndef do_forceescape(value):\n    \"\"\"Enforce HTML escaping.  This will probably double escape variables.\"\"\"\n    if hasattr(value, '__html__'):\n        value = value.__html__()\n    return escape(text_type(value))\n\n\ndef do_urlencode(value):\n    \"\"\"Escape strings for use in URLs (uses UTF-8 encoding).  It accepts both\n    dictionaries and regular strings as well as pairwise iterables.\n\n    .. versionadded:: 2.7\n    \"\"\"\n    itemiter = None\n    if isinstance(value, dict):\n        itemiter = iteritems(value)\n    elif not isinstance(value, string_types):\n        try:\n            itemiter = iter(value)\n        except TypeError:\n            pass\n    if itemiter is None:\n        return unicode_urlencode(value)\n    return u'&'.join(unicode_urlencode(k) + '=' +\n                     unicode_urlencode(v, for_qs=True)\n                     for k, v in itemiter)\n\n\n@evalcontextfilter\ndef do_replace(eval_ctx, s, old, new, count=None):\n    \"\"\"Return a copy of the value with all occurrences of a substring\n    replaced with a new one. The first argument is the substring\n    that should be replaced, the second is the replacement string.\n    If the optional third argument ``count`` is given, only the first\n    ``count`` occurrences are replaced:\n\n    .. sourcecode:: jinja\n\n        {{ \"Hello World\"|replace(\"Hello\", \"Goodbye\") }}\n            -> Goodbye World\n\n        {{ \"aaaaargh\"|replace(\"a\", \"d'oh, \", 2) }}\n            -> d'oh, d'oh, aaargh\n    \"\"\"\n    if count is None:\n        count = -1\n    if not eval_ctx.autoescape:\n        return text_type(s).replace(text_type(old), text_type(new), count)\n    if hasattr(old, '__html__') or hasattr(new, '__html__') and \\\n       not hasattr(s, '__html__'):\n        s = escape(s)\n    else:\n        s = soft_unicode(s)\n    return s.replace(soft_unicode(old), soft_unicode(new), count)\n\n\ndef do_upper(s):\n    \"\"\"Convert a value to uppercase.\"\"\"\n    return soft_unicode(s).upper()\n\n\ndef do_lower(s):\n    \"\"\"Convert a value to lowercase.\"\"\"\n    return soft_unicode(s).lower()\n\n\n@evalcontextfilter\ndef do_xmlattr(_eval_ctx, d, autospace=True):\n    \"\"\"Create an SGML/XML attribute string based on the items in a dict.\n    All values that are neither `none` nor `undefined` are automatically\n    escaped:\n\n    .. sourcecode:: html+jinja\n\n        <ul{{ {'class': 'my_list', 'missing': none,\n                'id': 'list-%d'|format(variable)}|xmlattr }}>\n        ...\n        </ul>\n\n    Results in something like this:\n\n    .. sourcecode:: html\n\n        <ul class=\"my_list\" id=\"list-42\">\n        ...\n        </ul>\n\n    As you can see it automatically prepends a space in front of the item\n    if the filter returned something unless the second parameter is false.\n    \"\"\"\n    rv = u' '.join(\n        u'%s=\"%s\"' % (escape(key), escape(value))\n        for key, value in iteritems(d)\n        if value is not None and not isinstance(value, Undefined)\n    )\n    if autospace and rv:\n        rv = u' ' + rv\n    if _eval_ctx.autoescape:\n        rv = Markup(rv)\n    return rv\n\n\ndef do_capitalize(s):\n    \"\"\"Capitalize a value. The first character will be uppercase, all others\n    lowercase.\n    \"\"\"\n    return soft_unicode(s).capitalize()\n\n\ndef do_title(s):\n    \"\"\"Return a titlecased version of the value. I.e. words will start with\n    uppercase letters, all remaining characters are lowercase.\n    \"\"\"\n    return ''.join(\n        [item[0].upper() + item[1:].lower()\n         for item in _word_beginning_split_re.split(soft_unicode(s))\n         if item])\n\n\ndef do_dictsort(value, case_sensitive=False, by='key', reverse=False):\n    \"\"\"Sort a dict and yield (key, value) pairs. Because python dicts are\n    unsorted you may want to use this function to order them by either\n    key or value:\n\n    .. sourcecode:: jinja\n\n        {% for item in mydict|dictsort %}\n            sort the dict by key, case insensitive\n\n        {% for item in mydict|dictsort(reverse=true) %}\n            sort the dict by key, case insensitive, reverse order\n\n        {% for item in mydict|dictsort(true) %}\n            sort the dict by key, case sensitive\n\n        {% for item in mydict|dictsort(false, 'value') %}\n            sort the dict by value, case insensitive\n    \"\"\"\n    if by == 'key':\n        pos = 0\n    elif by == 'value':\n        pos = 1\n    else:\n        raise FilterArgumentError(\n            'You can only sort by either \"key\" or \"value\"'\n        )\n\n    def sort_func(item):\n        value = item[pos]\n\n        if not case_sensitive:\n            value = ignore_case(value)\n\n        return value\n\n    return sorted(value.items(), key=sort_func, reverse=reverse)\n\n\n@environmentfilter\ndef do_sort(\n    environment, value, reverse=False, case_sensitive=False, attribute=None\n):\n    \"\"\"Sort an iterable.  Per default it sorts ascending, if you pass it\n    true as first argument it will reverse the sorting.\n\n    If the iterable is made of strings the third parameter can be used to\n    control the case sensitiveness of the comparison which is disabled by\n    default.\n\n    .. sourcecode:: jinja\n\n        {% for item in iterable|sort %}\n            ...\n        {% endfor %}\n\n    It is also possible to sort by an attribute (for example to sort\n    by the date of an object) by specifying the `attribute` parameter:\n\n    .. sourcecode:: jinja\n\n        {% for item in iterable|sort(attribute='date') %}\n            ...\n        {% endfor %}\n\n    .. versionchanged:: 2.6\n       The `attribute` parameter was added.\n    \"\"\"\n    key_func = make_attrgetter(\n        environment, attribute,\n        postprocess=ignore_case if not case_sensitive else None\n    )\n    return sorted(value, key=key_func, reverse=reverse)\n\n\n@environmentfilter\ndef do_unique(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Returns a list of unique items from the the given iterable.\n\n    .. sourcecode:: jinja\n\n        {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }}\n            -> ['foo', 'bar', 'foobar']\n\n    The unique items are yielded in the same order as their first occurrence in\n    the iterable passed to the filter.\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Filter objects with unique values for this attribute.\n    \"\"\"\n    getter = make_attrgetter(\n        environment, attribute,\n        postprocess=ignore_case if not case_sensitive else None\n    )\n    seen = set()\n\n    for item in value:\n        key = getter(item)\n\n        if key not in seen:\n            seen.add(key)\n            yield item\n\n\ndef _min_or_max(environment, value, func, case_sensitive, attribute):\n    it = iter(value)\n\n    try:\n        first = next(it)\n    except StopIteration:\n        return environment.undefined('No aggregated item, sequence was empty.')\n\n    key_func = make_attrgetter(\n        environment, attribute,\n        ignore_case if not case_sensitive else None\n    )\n    return func(chain([first], it), key=key_func)\n\n\n@environmentfilter\ndef do_min(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Return the smallest item from the sequence.\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|min }}\n            -> 1\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Get the object with the max value of this attribute.\n    \"\"\"\n    return _min_or_max(environment, value, min, case_sensitive, attribute)\n\n\n@environmentfilter\ndef do_max(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Return the largest item from the sequence.\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|max }}\n            -> 3\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Get the object with the max value of this attribute.\n    \"\"\"\n    return _min_or_max(environment, value, max, case_sensitive, attribute)\n\n\ndef do_default(value, default_value=u'', boolean=False):\n    \"\"\"If the value is undefined it will return the passed default value,\n    otherwise the value of the variable:\n\n    .. sourcecode:: jinja\n\n        {{ my_variable|default('my_variable is not defined') }}\n\n    This will output the value of ``my_variable`` if the variable was\n    defined, otherwise ``'my_variable is not defined'``. If you want\n    to use default with variables that evaluate to false you have to\n    set the second parameter to `true`:\n\n    .. sourcecode:: jinja\n\n        {{ ''|default('the string was empty', true) }}\n    \"\"\"\n    if isinstance(value, Undefined) or (boolean and not value):\n        return default_value\n    return value\n\n\n@evalcontextfilter\ndef do_join(eval_ctx, value, d=u'', attribute=None):\n    \"\"\"Return a string which is the concatenation of the strings in the\n    sequence. The separator between elements is an empty string per\n    default, you can define it with the optional parameter:\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|join('|') }}\n            -> 1|2|3\n\n        {{ [1, 2, 3]|join }}\n            -> 123\n\n    It is also possible to join certain attributes of an object:\n\n    .. sourcecode:: jinja\n\n        {{ users|join(', ', attribute='username') }}\n\n    .. versionadded:: 2.6\n       The `attribute` parameter was added.\n    \"\"\"\n    if attribute is not None:\n        value = imap(make_attrgetter(eval_ctx.environment, attribute), value)\n\n    # no automatic escaping?  joining is a lot eaiser then\n    if not eval_ctx.autoescape:\n        return text_type(d).join(imap(text_type, value))\n\n    # if the delimiter doesn't have an html representation we check\n    # if any of the items has.  If yes we do a coercion to Markup\n    if not hasattr(d, '__html__'):\n        value = list(value)\n        do_escape = False\n        for idx, item in enumerate(value):\n            if hasattr(item, '__html__'):\n                do_escape = True\n            else:\n                value[idx] = text_type(item)\n        if do_escape:\n            d = escape(d)\n        else:\n            d = text_type(d)\n        return d.join(value)\n\n    # no html involved, to normal joining\n    return soft_unicode(d).join(imap(soft_unicode, value))\n\n\ndef do_center(value, width=80):\n    \"\"\"Centers the value in a field of a given width.\"\"\"\n    return text_type(value).center(width)\n\n\n@environmentfilter\ndef do_first(environment, seq):\n    \"\"\"Return the first item of a sequence.\"\"\"\n    try:\n        return next(iter(seq))\n    except StopIteration:\n        return environment.undefined('No first item, sequence was empty.')\n\n\n@environmentfilter\ndef do_last(environment, seq):\n    \"\"\"Return the last item of a sequence.\"\"\"\n    try:\n        return next(iter(reversed(seq)))\n    except StopIteration:\n        return environment.undefined('No last item, sequence was empty.')\n\n\n@contextfilter\ndef do_random(context, seq):\n    \"\"\"Return a random item from the sequence.\"\"\"\n    try:\n        return random.choice(seq)\n    except IndexError:\n        return context.environment.undefined('No random item, sequence was empty.')\n\n\ndef do_filesizeformat(value, binary=False):\n    \"\"\"Format the value like a 'human-readable' file size (i.e. 13 kB,\n    4.1 MB, 102 Bytes, etc).  Per default decimal prefixes are used (Mega,\n    Giga, etc.), if the second parameter is set to `True` the binary\n    prefixes are used (Mebi, Gibi).\n    \"\"\"\n    bytes = float(value)\n    base = binary and 1024 or 1000\n    prefixes = [\n        (binary and 'KiB' or 'kB'),\n        (binary and 'MiB' or 'MB'),\n        (binary and 'GiB' or 'GB'),\n        (binary and 'TiB' or 'TB'),\n        (binary and 'PiB' or 'PB'),\n        (binary and 'EiB' or 'EB'),\n        (binary and 'ZiB' or 'ZB'),\n        (binary and 'YiB' or 'YB')\n    ]\n    if bytes == 1:\n        return '1 Byte'\n    elif bytes < base:\n        return '%d Bytes' % bytes\n    else:\n        for i, prefix in enumerate(prefixes):\n            unit = base ** (i + 2)\n            if bytes < unit:\n                return '%.1f %s' % ((base * bytes / unit), prefix)\n        return '%.1f %s' % ((base * bytes / unit), prefix)\n\n\ndef do_pprint(value, verbose=False):\n    \"\"\"Pretty print a variable. Useful for debugging.\n\n    With Jinja 1.2 onwards you can pass it a parameter.  If this parameter\n    is truthy the output will be more verbose (this requires `pretty`)\n    \"\"\"\n    return pformat(value, verbose=verbose)\n\n\n@evalcontextfilter\ndef do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False,\n              target=None, rel=None):\n    \"\"\"Converts URLs in plain text into clickable links.\n\n    If you pass the filter an additional integer it will shorten the urls\n    to that number. Also a third argument exists that makes the urls\n    \"nofollow\":\n\n    .. sourcecode:: jinja\n\n        {{ mytext|urlize(40, true) }}\n            links are shortened to 40 chars and defined with rel=\"nofollow\"\n\n    If *target* is specified, the ``target`` attribute will be added to the\n    ``<a>`` tag:\n\n    .. sourcecode:: jinja\n\n       {{ mytext|urlize(40, target='_blank') }}\n\n    .. versionchanged:: 2.8+\n       The *target* parameter was added.\n    \"\"\"\n    policies = eval_ctx.environment.policies\n    rel = set((rel or '').split() or [])\n    if nofollow:\n        rel.add('nofollow')\n    rel.update((policies['urlize.rel'] or '').split())\n    if target is None:\n        target = policies['urlize.target']\n    rel = ' '.join(sorted(rel)) or None\n    rv = urlize(value, trim_url_limit, rel=rel, target=target)\n    if eval_ctx.autoescape:\n        rv = Markup(rv)\n    return rv\n\n\ndef do_indent(\n    s, width=4, first=False, blank=False, indentfirst=None\n):\n    \"\"\"Return a copy of the string with each line indented by 4 spaces. The\n    first line and blank lines are not indented by default.\n\n    :param width: Number of spaces to indent by.\n    :param first: Don't skip indenting the first line.\n    :param blank: Don't skip indenting empty lines.\n\n    .. versionchanged:: 2.10\n        Blank lines are not indented by default.\n\n        Rename the ``indentfirst`` argument to ``first``.\n    \"\"\"\n    if indentfirst is not None:\n        warnings.warn(DeprecationWarning(\n            'The \"indentfirst\" argument is renamed to \"first\".'\n        ), stacklevel=2)\n        first = indentfirst\n\n    s += u'\\n'  # this quirk is necessary for splitlines method\n    indention = u' ' * width\n\n    if blank:\n        rv = (u'\\n' + indention).join(s.splitlines())\n    else:\n        lines = s.splitlines()\n        rv = lines.pop(0)\n\n        if lines:\n            rv += u'\\n' + u'\\n'.join(\n                indention + line if line else line for line in lines\n            )\n\n    if first:\n        rv = indention + rv\n\n    return rv\n\n\n@environmentfilter\ndef do_truncate(env, s, length=255, killwords=False, end='...', leeway=None):\n    \"\"\"Return a truncated copy of the string. The length is specified\n    with the first parameter which defaults to ``255``. If the second\n    parameter is ``true`` the filter will cut the text at length. Otherwise\n    it will discard the last word. If the text was in fact\n    truncated it will append an ellipsis sign (``\"...\"``). If you want a\n    different ellipsis sign than ``\"...\"`` you can specify it using the\n    third parameter. Strings that only exceed the length by the tolerance\n    margin given in the fourth parameter will not be truncated.\n\n    .. sourcecode:: jinja\n\n        {{ \"foo bar baz qux\"|truncate(9) }}\n            -> \"foo...\"\n        {{ \"foo bar baz qux\"|truncate(9, True) }}\n            -> \"foo ba...\"\n        {{ \"foo bar baz qux\"|truncate(11) }}\n            -> \"foo bar baz qux\"\n        {{ \"foo bar baz qux\"|truncate(11, False, '...', 0) }}\n            -> \"foo bar...\"\n\n    The default leeway on newer Jinja2 versions is 5 and was 0 before but\n    can be reconfigured globally.\n    \"\"\"\n    if leeway is None:\n        leeway = env.policies['truncate.leeway']\n    assert length >= len(end), 'expected length >= %s, got %s' % (len(end), length)\n    assert leeway >= 0, 'expected leeway >= 0, got %s' % leeway\n    if len(s) <= length + leeway:\n        return s\n    if killwords:\n        return s[:length - len(end)] + end\n    result = s[:length - len(end)].rsplit(' ', 1)[0]\n    return result + end\n\n\n@environmentfilter\ndef do_wordwrap(environment, s, width=79, break_long_words=True,\n                wrapstring=None):\n    \"\"\"\n    Return a copy of the string passed to the filter wrapped after\n    ``79`` characters.  You can override this default using the first\n    parameter.  If you set the second parameter to `false` Jinja will not\n    split words apart if they are longer than `width`. By default, the newlines\n    will be the default newlines for the environment, but this can be changed\n    using the wrapstring keyword argument.\n\n    .. versionadded:: 2.7\n       Added support for the `wrapstring` parameter.\n    \"\"\"\n    if not wrapstring:\n        wrapstring = environment.newline_sequence\n    import textwrap\n    return wrapstring.join(textwrap.wrap(s, width=width, expand_tabs=False,\n                                   replace_whitespace=False,\n                                   break_long_words=break_long_words))\n\n\ndef do_wordcount(s):\n    \"\"\"Count the words in that string.\"\"\"\n    return len(_word_re.findall(s))\n\n\ndef do_int(value, default=0, base=10):\n    \"\"\"Convert the value into an integer. If the\n    conversion doesn't work it will return ``0``. You can\n    override this default using the first parameter. You\n    can also override the default base (10) in the second\n    parameter, which handles input with prefixes such as\n    0b, 0o and 0x for bases 2, 8 and 16 respectively.\n    The base is ignored for decimal numbers and non-string values.\n    \"\"\"\n    try:\n        if isinstance(value, string_types):\n            return int(value, base)\n        return int(value)\n    except (TypeError, ValueError):\n        # this quirk is necessary so that \"42.23\"|int gives 42.\n        try:\n            return int(float(value))\n        except (TypeError, ValueError):\n            return default\n\n\ndef do_float(value, default=0.0):\n    \"\"\"Convert the value into a floating point number. If the\n    conversion doesn't work it will return ``0.0``. You can\n    override this default using the first parameter.\n    \"\"\"\n    try:\n        return float(value)\n    except (TypeError, ValueError):\n        return default\n\n\ndef do_format(value, *args, **kwargs):\n    \"\"\"\n    Apply python string formatting on an object:\n\n    .. sourcecode:: jinja\n\n        {{ \"%s - %s\"|format(\"Hello?\", \"Foo!\") }}\n            -> Hello? - Foo!\n    \"\"\"\n    if args and kwargs:\n        raise FilterArgumentError('can\\'t handle positional and keyword '\n                                  'arguments at the same time')\n    return soft_unicode(value) % (kwargs or args)\n\n\ndef do_trim(value):\n    \"\"\"Strip leading and trailing whitespace.\"\"\"\n    return soft_unicode(value).strip()\n\n\ndef do_striptags(value):\n    \"\"\"Strip SGML/XML tags and replace adjacent whitespace by one space.\n    \"\"\"\n    if hasattr(value, '__html__'):\n        value = value.__html__()\n    return Markup(text_type(value)).striptags()\n\n\ndef do_slice(value, slices, fill_with=None):\n    \"\"\"Slice an iterator and return a list of lists containing\n    those items. Useful if you want to create a div containing\n    three ul tags that represent columns:\n\n    .. sourcecode:: html+jinja\n\n        <div class=\"columwrapper\">\n          {%- for column in items|slice(3) %}\n            <ul class=\"column-{{ loop.index }}\">\n            {%- for item in column %}\n              <li>{{ item }}</li>\n            {%- endfor %}\n            </ul>\n          {%- endfor %}\n        </div>\n\n    If you pass it a second argument it's used to fill missing\n    values on the last iteration.\n    \"\"\"\n    seq = list(value)\n    length = len(seq)\n    items_per_slice = length // slices\n    slices_with_extra = length % slices\n    offset = 0\n    for slice_number in range(slices):\n        start = offset + slice_number * items_per_slice\n        if slice_number < slices_with_extra:\n            offset += 1\n        end = offset + (slice_number + 1) * items_per_slice\n        tmp = seq[start:end]\n        if fill_with is not None and slice_number >= slices_with_extra:\n            tmp.append(fill_with)\n        yield tmp\n\n\ndef do_batch(value, linecount, fill_with=None):\n    \"\"\"\n    A filter that batches items. It works pretty much like `slice`\n    just the other way round. It returns a list of lists with the\n    given number of items. If you provide a second parameter this\n    is used to fill up missing items. See this example:\n\n    .. sourcecode:: html+jinja\n\n        <table>\n        {%- for row in items|batch(3, '&nbsp;') %}\n          <tr>\n          {%- for column in row %}\n            <td>{{ column }}</td>\n          {%- endfor %}\n          </tr>\n        {%- endfor %}\n        </table>\n    \"\"\"\n    tmp = []\n    for item in value:\n        if len(tmp) == linecount:\n            yield tmp\n            tmp = []\n        tmp.append(item)\n    if tmp:\n        if fill_with is not None and len(tmp) < linecount:\n            tmp += [fill_with] * (linecount - len(tmp))\n        yield tmp\n\n\ndef do_round(value, precision=0, method='common'):\n    \"\"\"Round the number to a given precision. The first\n    parameter specifies the precision (default is ``0``), the\n    second the rounding method:\n\n    - ``'common'`` rounds either up or down\n    - ``'ceil'`` always rounds up\n    - ``'floor'`` always rounds down\n\n    If you don't specify a method ``'common'`` is used.\n\n    .. sourcecode:: jinja\n\n        {{ 42.55|round }}\n            -> 43.0\n        {{ 42.55|round(1, 'floor') }}\n            -> 42.5\n\n    Note that even if rounded to 0 precision, a float is returned.  If\n    you need a real integer, pipe it through `int`:\n\n    .. sourcecode:: jinja\n\n        {{ 42.55|round|int }}\n            -> 43\n    \"\"\"\n    if not method in ('common', 'ceil', 'floor'):\n        raise FilterArgumentError('method must be common, ceil or floor')\n    if method == 'common':\n        return round(value, precision)\n    func = getattr(math, method)\n    return func(value * (10 ** precision)) / (10 ** precision)\n\n\n# Use a regular tuple repr here.  This is what we did in the past and we\n# really want to hide this custom type as much as possible.  In particular\n# we do not want to accidentally expose an auto generated repr in case\n# people start to print this out in comments or something similar for\n# debugging.\n_GroupTuple = namedtuple('_GroupTuple', ['grouper', 'list'])\n_GroupTuple.__repr__ = tuple.__repr__\n_GroupTuple.__str__ = tuple.__str__\n\n@environmentfilter\ndef do_groupby(environment, value, attribute):\n    \"\"\"Group a sequence of objects by a common attribute.\n\n    If you for example have a list of dicts or objects that represent persons\n    with `gender`, `first_name` and `last_name` attributes and you want to\n    group all users by genders you can do something like the following\n    snippet:\n\n    .. sourcecode:: html+jinja\n\n        <ul>\n        {% for group in persons|groupby('gender') %}\n            <li>{{ group.grouper }}<ul>\n            {% for person in group.list %}\n                <li>{{ person.first_name }} {{ person.last_name }}</li>\n            {% endfor %}</ul></li>\n        {% endfor %}\n        </ul>\n\n    Additionally it's possible to use tuple unpacking for the grouper and\n    list:\n\n    .. sourcecode:: html+jinja\n\n        <ul>\n        {% for grouper, list in persons|groupby('gender') %}\n            ...\n        {% endfor %}\n        </ul>\n\n    As you can see the item we're grouping by is stored in the `grouper`\n    attribute and the `list` contains all the objects that have this grouper\n    in common.\n\n    .. versionchanged:: 2.6\n       It's now possible to use dotted notation to group by the child\n       attribute of another attribute.\n    \"\"\"\n    expr = make_attrgetter(environment, attribute)\n    return [_GroupTuple(key, list(values)) for key, values\n            in groupby(sorted(value, key=expr), expr)]\n\n\n@environmentfilter\ndef do_sum(environment, iterable, attribute=None, start=0):\n    \"\"\"Returns the sum of a sequence of numbers plus the value of parameter\n    'start' (which defaults to 0).  When the sequence is empty it returns\n    start.\n\n    It is also possible to sum up only certain attributes:\n\n    .. sourcecode:: jinja\n\n        Total: {{ items|sum(attribute='price') }}\n\n    .. versionchanged:: 2.6\n       The `attribute` parameter was added to allow suming up over\n       attributes.  Also the `start` parameter was moved on to the right.\n    \"\"\"\n    if attribute is not None:\n        iterable = imap(make_attrgetter(environment, attribute), iterable)\n    return sum(iterable, start)\n\n\ndef do_list(value):\n    \"\"\"Convert the value into a list.  If it was a string the returned list\n    will be a list of characters.\n    \"\"\"\n    return list(value)\n\n\ndef do_mark_safe(value):\n    \"\"\"Mark the value as safe which means that in an environment with automatic\n    escaping enabled this variable will not be escaped.\n    \"\"\"\n    return Markup(value)\n\n\ndef do_mark_unsafe(value):\n    \"\"\"Mark a value as unsafe.  This is the reverse operation for :func:`safe`.\"\"\"\n    return text_type(value)\n\n\ndef do_reverse(value):\n    \"\"\"Reverse the object or return an iterator that iterates over it the other\n    way round.\n    \"\"\"\n    if isinstance(value, string_types):\n        return value[::-1]\n    try:\n        return reversed(value)\n    except TypeError:\n        try:\n            rv = list(value)\n            rv.reverse()\n            return rv\n        except TypeError:\n            raise FilterArgumentError('argument must be iterable')\n\n\n@environmentfilter\ndef do_attr(environment, obj, name):\n    \"\"\"Get an attribute of an object.  ``foo|attr(\"bar\")`` works like\n    ``foo.bar`` just that always an attribute is returned and items are not\n    looked up.\n\n    See :ref:`Notes on subscriptions <notes-on-subscriptions>` for more details.\n    \"\"\"\n    try:\n        name = str(name)\n    except UnicodeError:\n        pass\n    else:\n        try:\n            value = getattr(obj, name)\n        except AttributeError:\n            pass\n        else:\n            if environment.sandboxed and not \\\n               environment.is_safe_attribute(obj, name, value):\n                return environment.unsafe_undefined(obj, name)\n            return value\n    return environment.undefined(obj=obj, name=name)\n\n\n@contextfilter\ndef do_map(*args, **kwargs):\n    \"\"\"Applies a filter on a sequence of objects or looks up an attribute.\n    This is useful when dealing with lists of objects but you are really\n    only interested in a certain value of it.\n\n    The basic usage is mapping on an attribute.  Imagine you have a list\n    of users but you are only interested in a list of usernames:\n\n    .. sourcecode:: jinja\n\n        Users on this page: {{ users|map(attribute='username')|join(', ') }}\n\n    Alternatively you can let it invoke a filter by passing the name of the\n    filter and the arguments afterwards.  A good example would be applying a\n    text conversion filter on a sequence:\n\n    .. sourcecode:: jinja\n\n        Users on this page: {{ titles|map('lower')|join(', ') }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    seq, func = prepare_map(args, kwargs)\n    if seq:\n        for item in seq:\n            yield func(item)\n\n\n@contextfilter\ndef do_select(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to each object,\n    and only selecting the objects with the test succeeding.\n\n    If no test is specified, each object will be evaluated as a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ numbers|select(\"odd\") }}\n        {{ numbers|select(\"odd\") }}\n        {{ numbers|select(\"divisibleby\", 3) }}\n        {{ numbers|select(\"lessthan\", 42) }}\n        {{ strings|select(\"equalto\", \"mystring\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: x, False)\n\n\n@contextfilter\ndef do_reject(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to each object,\n    and rejecting the objects with the test succeeding.\n\n    If no test is specified, each object will be evaluated as a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ numbers|reject(\"odd\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: not x, False)\n\n\n@contextfilter\ndef do_selectattr(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to the specified\n    attribute of each object, and only selecting the objects with the\n    test succeeding.\n\n    If no test is specified, the attribute's value will be evaluated as\n    a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ users|selectattr(\"is_active\") }}\n        {{ users|selectattr(\"email\", \"none\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: x, True)\n\n\n@contextfilter\ndef do_rejectattr(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to the specified\n    attribute of each object, and rejecting the objects with the test\n    succeeding.\n\n    If no test is specified, the attribute's value will be evaluated as\n    a boolean.\n\n    .. sourcecode:: jinja\n\n        {{ users|rejectattr(\"is_active\") }}\n        {{ users|rejectattr(\"email\", \"none\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: not x, True)\n\n\n@evalcontextfilter\ndef do_tojson(eval_ctx, value, indent=None):\n    \"\"\"Dumps a structure to JSON so that it's safe to use in ``<script>``\n    tags.  It accepts the same arguments and returns a JSON string.  Note that\n    this is available in templates through the ``|tojson`` filter which will\n    also mark the result as safe.  Due to how this function escapes certain\n    characters this is safe even if used outside of ``<script>`` tags.\n\n    The following characters are escaped in strings:\n\n    -   ``<``\n    -   ``>``\n    -   ``&``\n    -   ``'``\n\n    This makes it safe to embed such strings in any place in HTML with the\n    notable exception of double quoted attributes.  In that case single\n    quote your attributes or HTML escape it in addition.\n\n    The indent parameter can be used to enable pretty printing.  Set it to\n    the number of spaces that the structures should be indented with.\n\n    Note that this filter is for use in HTML contexts only.\n\n    .. versionadded:: 2.9\n    \"\"\"\n    policies = eval_ctx.environment.policies\n    dumper = policies['json.dumps_function']\n    options = policies['json.dumps_kwargs']\n    if indent is not None:\n        options = dict(options)\n        options['indent'] = indent\n    return htmlsafe_json_dumps(value, dumper=dumper, **options)\n\n\ndef prepare_map(args, kwargs):\n    context = args[0]\n    seq = args[1]\n\n    if len(args) == 2 and 'attribute' in kwargs:\n        attribute = kwargs.pop('attribute')\n        if kwargs:\n            raise FilterArgumentError('Unexpected keyword argument %r' %\n                next(iter(kwargs)))\n        func = make_attrgetter(context.environment, attribute)\n    else:\n        try:\n            name = args[2]\n            args = args[3:]\n        except LookupError:\n            raise FilterArgumentError('map requires a filter argument')\n        func = lambda item: context.environment.call_filter(\n            name, item, args, kwargs, context=context)\n\n    return seq, func\n\n\ndef prepare_select_or_reject(args, kwargs, modfunc, lookup_attr):\n    context = args[0]\n    seq = args[1]\n    if lookup_attr:\n        try:\n            attr = args[2]\n        except LookupError:\n            raise FilterArgumentError('Missing parameter for attribute name')\n        transfunc = make_attrgetter(context.environment, attr)\n        off = 1\n    else:\n        off = 0\n        transfunc = lambda x: x\n\n    try:\n        name = args[2 + off]\n        args = args[3 + off:]\n        func = lambda item: context.environment.call_test(\n            name, item, args, kwargs)\n    except LookupError:\n        func = bool\n\n    return seq, lambda item: modfunc(func(transfunc(item)))\n\n\ndef select_or_reject(args, kwargs, modfunc, lookup_attr):\n    seq, func = prepare_select_or_reject(args, kwargs, modfunc, lookup_attr)\n    if seq:\n        for item in seq:\n            if func(item):\n                yield item\n\n\nFILTERS = {\n    'abs':                  abs,\n    'attr':                 do_attr,\n    'batch':                do_batch,\n    'capitalize':           do_capitalize,\n    'center':               do_center,\n    'count':                len,\n    'd':                    do_default,\n    'default':              do_default,\n    'dictsort':             do_dictsort,\n    'e':                    escape,\n    'escape':               escape,\n    'filesizeformat':       do_filesizeformat,\n    'first':                do_first,\n    'float':                do_float,\n    'forceescape':          do_forceescape,\n    'format':               do_format,\n    'groupby':              do_groupby,\n    'indent':               do_indent,\n    'int':                  do_int,\n    'join':                 do_join,\n    'last':                 do_last,\n    'length':               len,\n    'list':                 do_list,\n    'lower':                do_lower,\n    'map':                  do_map,\n    'min':                  do_min,\n    'max':                  do_max,\n    'pprint':               do_pprint,\n    'random':               do_random,\n    'reject':               do_reject,\n    'rejectattr':           do_rejectattr,\n    'replace':              do_replace,\n    'reverse':              do_reverse,\n    'round':                do_round,\n    'safe':                 do_mark_safe,\n    'select':               do_select,\n    'selectattr':           do_selectattr,\n    'slice':                do_slice,\n    'sort':                 do_sort,\n    'string':               soft_unicode,\n    'striptags':            do_striptags,\n    'sum':                  do_sum,\n    'title':                do_title,\n    'trim':                 do_trim,\n    'truncate':             do_truncate,\n    'unique':               do_unique,\n    'upper':                do_upper,\n    'urlencode':            do_urlencode,\n    'urlize':               do_urlize,\n    'wordcount':            do_wordcount,\n    'wordwrap':             do_wordwrap,\n    'xmlattr':              do_xmlattr,\n    'tojson':               do_tojson,\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/idtracking.py",
    "content": "from jinja2.visitor import NodeVisitor\nfrom jinja2._compat import iteritems\n\n\nVAR_LOAD_PARAMETER = 'param'\nVAR_LOAD_RESOLVE = 'resolve'\nVAR_LOAD_ALIAS = 'alias'\nVAR_LOAD_UNDEFINED = 'undefined'\n\n\ndef find_symbols(nodes, parent_symbols=None):\n    sym = Symbols(parent=parent_symbols)\n    visitor = FrameSymbolVisitor(sym)\n    for node in nodes:\n        visitor.visit(node)\n    return sym\n\n\ndef symbols_for_node(node, parent_symbols=None):\n    sym = Symbols(parent=parent_symbols)\n    sym.analyze_node(node)\n    return sym\n\n\nclass Symbols(object):\n\n    def __init__(self, parent=None, level=None):\n        if level is None:\n            if parent is None:\n                level = 0\n            else:\n                level = parent.level + 1\n        self.level = level\n        self.parent = parent\n        self.refs = {}\n        self.loads = {}\n        self.stores = set()\n\n    def analyze_node(self, node, **kwargs):\n        visitor = RootVisitor(self)\n        visitor.visit(node, **kwargs)\n\n    def _define_ref(self, name, load=None):\n        ident = 'l_%d_%s' % (self.level, name)\n        self.refs[name] = ident\n        if load is not None:\n            self.loads[ident] = load\n        return ident\n\n    def find_load(self, target):\n        if target in self.loads:\n            return self.loads[target]\n        if self.parent is not None:\n            return self.parent.find_load(target)\n\n    def find_ref(self, name):\n        if name in self.refs:\n            return self.refs[name]\n        if self.parent is not None:\n            return self.parent.find_ref(name)\n\n    def ref(self, name):\n        rv = self.find_ref(name)\n        if rv is None:\n            raise AssertionError('Tried to resolve a name to a reference that '\n                                 'was unknown to the frame (%r)' % name)\n        return rv\n\n    def copy(self):\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.refs = self.refs.copy()\n        rv.loads = self.loads.copy()\n        rv.stores = self.stores.copy()\n        return rv\n\n    def store(self, name):\n        self.stores.add(name)\n\n        # If we have not see the name referenced yet, we need to figure\n        # out what to set it to.\n        if name not in self.refs:\n            # If there is a parent scope we check if the name has a\n            # reference there.  If it does it means we might have to alias\n            # to a variable there.\n            if self.parent is not None:\n                outer_ref = self.parent.find_ref(name)\n                if outer_ref is not None:\n                    self._define_ref(name, load=(VAR_LOAD_ALIAS, outer_ref))\n                    return\n\n            # Otherwise we can just set it to undefined.\n            self._define_ref(name, load=(VAR_LOAD_UNDEFINED, None))\n\n    def declare_parameter(self, name):\n        self.stores.add(name)\n        return self._define_ref(name, load=(VAR_LOAD_PARAMETER, None))\n\n    def load(self, name):\n        target = self.find_ref(name)\n        if target is None:\n            self._define_ref(name, load=(VAR_LOAD_RESOLVE, name))\n\n    def branch_update(self, branch_symbols):\n        stores = {}\n        for branch in branch_symbols:\n            for target in branch.stores:\n                if target in self.stores:\n                    continue\n                stores[target] = stores.get(target, 0) + 1\n\n        for sym in branch_symbols:\n            self.refs.update(sym.refs)\n            self.loads.update(sym.loads)\n            self.stores.update(sym.stores)\n\n        for name, branch_count in iteritems(stores):\n            if branch_count == len(branch_symbols):\n                continue\n            target = self.find_ref(name)\n            assert target is not None, 'should not happen'\n\n            if self.parent is not None:\n                outer_target = self.parent.find_ref(name)\n                if outer_target is not None:\n                    self.loads[target] = (VAR_LOAD_ALIAS, outer_target)\n                    continue\n            self.loads[target] = (VAR_LOAD_RESOLVE, name)\n\n    def dump_stores(self):\n        rv = {}\n        node = self\n        while node is not None:\n            for name in node.stores:\n                if name not in rv:\n                    rv[name] = self.find_ref(name)\n            node = node.parent\n        return rv\n\n    def dump_param_targets(self):\n        rv = set()\n        node = self\n        while node is not None:\n            for target, (instr, _) in iteritems(self.loads):\n                if instr == VAR_LOAD_PARAMETER:\n                    rv.add(target)\n            node = node.parent\n        return rv\n\n\nclass RootVisitor(NodeVisitor):\n\n    def __init__(self, symbols):\n        self.sym_visitor = FrameSymbolVisitor(symbols)\n\n    def _simple_visit(self, node, **kwargs):\n        for child in node.iter_child_nodes():\n            self.sym_visitor.visit(child)\n\n    visit_Template = visit_Block = visit_Macro = visit_FilterBlock = \\\n        visit_Scope = visit_If = visit_ScopedEvalContextModifier = \\\n        _simple_visit\n\n    def visit_AssignBlock(self, node, **kwargs):\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def visit_CallBlock(self, node, **kwargs):\n        for child in node.iter_child_nodes(exclude=('call',)):\n            self.sym_visitor.visit(child)\n\n    def visit_OverlayScope(self, node, **kwargs):\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def visit_For(self, node, for_branch='body', **kwargs):\n        if for_branch == 'body':\n            self.sym_visitor.visit(node.target, store_as_param=True)\n            branch = node.body\n        elif for_branch == 'else':\n            branch = node.else_\n        elif for_branch == 'test':\n            self.sym_visitor.visit(node.target, store_as_param=True)\n            if node.test is not None:\n                self.sym_visitor.visit(node.test)\n            return\n        else:\n            raise RuntimeError('Unknown for branch')\n        for item in branch or ():\n            self.sym_visitor.visit(item)\n\n    def visit_With(self, node, **kwargs):\n        for target in node.targets:\n            self.sym_visitor.visit(target)\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def generic_visit(self, node, *args, **kwargs):\n        raise NotImplementedError('Cannot find symbols for %r' %\n                                  node.__class__.__name__)\n\n\nclass FrameSymbolVisitor(NodeVisitor):\n    \"\"\"A visitor for `Frame.inspect`.\"\"\"\n\n    def __init__(self, symbols):\n        self.symbols = symbols\n\n    def visit_Name(self, node, store_as_param=False, **kwargs):\n        \"\"\"All assignments to names go through this function.\"\"\"\n        if store_as_param or node.ctx == 'param':\n            self.symbols.declare_parameter(node.name)\n        elif node.ctx == 'store':\n            self.symbols.store(node.name)\n        elif node.ctx == 'load':\n            self.symbols.load(node.name)\n\n    def visit_NSRef(self, node, **kwargs):\n        self.symbols.load(node.name)\n\n    def visit_If(self, node, **kwargs):\n        self.visit(node.test, **kwargs)\n\n        original_symbols = self.symbols\n\n        def inner_visit(nodes):\n            self.symbols = rv = original_symbols.copy()\n            for subnode in nodes:\n                self.visit(subnode, **kwargs)\n            self.symbols = original_symbols\n            return rv\n\n        body_symbols = inner_visit(node.body)\n        elif_symbols = inner_visit(node.elif_)\n        else_symbols = inner_visit(node.else_ or ())\n\n        self.symbols.branch_update([body_symbols, elif_symbols, else_symbols])\n\n    def visit_Macro(self, node, **kwargs):\n        self.symbols.store(node.name)\n\n    def visit_Import(self, node, **kwargs):\n        self.generic_visit(node, **kwargs)\n        self.symbols.store(node.target)\n\n    def visit_FromImport(self, node, **kwargs):\n        self.generic_visit(node, **kwargs)\n        for name in node.names:\n            if isinstance(name, tuple):\n                self.symbols.store(name[1])\n            else:\n                self.symbols.store(name)\n\n    def visit_Assign(self, node, **kwargs):\n        \"\"\"Visit assignments in the correct order.\"\"\"\n        self.visit(node.node, **kwargs)\n        self.visit(node.target, **kwargs)\n\n    def visit_For(self, node, **kwargs):\n        \"\"\"Visiting stops at for blocks.  However the block sequence\n        is visited as part of the outer scope.\n        \"\"\"\n        self.visit(node.iter, **kwargs)\n\n    def visit_CallBlock(self, node, **kwargs):\n        self.visit(node.call, **kwargs)\n\n    def visit_FilterBlock(self, node, **kwargs):\n        self.visit(node.filter, **kwargs)\n\n    def visit_With(self, node, **kwargs):\n        for target in node.values:\n            self.visit(target)\n\n    def visit_AssignBlock(self, node, **kwargs):\n        \"\"\"Stop visiting at block assigns.\"\"\"\n        self.visit(node.target, **kwargs)\n\n    def visit_Scope(self, node, **kwargs):\n        \"\"\"Stop visiting at scopes.\"\"\"\n\n    def visit_Block(self, node, **kwargs):\n        \"\"\"Stop visiting at blocks.\"\"\"\n\n    def visit_OverlayScope(self, node, **kwargs):\n        \"\"\"Do not visit into overlay scopes.\"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/lexer.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.lexer\n    ~~~~~~~~~~~~\n\n    This module implements a Jinja / Python combination lexer. The\n    `Lexer` class provided by this module is used to do some preprocessing\n    for Jinja.\n\n    On the one hand it filters out invalid operators like the bitshift\n    operators we don't allow in templates. On the other hand it separates\n    template code and python code in expressions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nfrom collections import deque\nfrom operator import itemgetter\n\nfrom jinja2._compat import implements_iterator, intern, iteritems, text_type\nfrom jinja2.exceptions import TemplateSyntaxError\nfrom jinja2.utils import LRUCache\n\n# cache for the lexers. Exists in order to be able to have multiple\n# environments with the same lexer\n_lexer_cache = LRUCache(50)\n\n# static regular expressions\nwhitespace_re = re.compile(r'\\s+', re.U)\nstring_re = re.compile(r\"('([^'\\\\]*(?:\\\\.[^'\\\\]*)*)'\"\n                       r'|\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")', re.S)\ninteger_re = re.compile(r'\\d+')\n\ntry:\n    # check if this Python supports Unicode identifiers\n    compile('föö', '<unknown>', 'eval')\nexcept SyntaxError:\n    # no Unicode support, use ASCII identifiers\n    name_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*')\n    check_ident = False\nelse:\n    # Unicode support, build a pattern to match valid characters, and set flag\n    # to use str.isidentifier to validate during lexing\n    from jinja2 import _identifier\n    name_re = re.compile(r'[\\w{0}]+'.format(_identifier.pattern))\n    check_ident = True\n    # remove the pattern from memory after building the regex\n    import sys\n    del sys.modules['jinja2._identifier']\n    import jinja2\n    del jinja2._identifier\n    del _identifier\n\nfloat_re = re.compile(r'(?<!\\.)\\d+\\.\\d+')\nnewline_re = re.compile(r'(\\r\\n|\\r|\\n)')\n\n# internal the tokens and keep references to them\nTOKEN_ADD = intern('add')\nTOKEN_ASSIGN = intern('assign')\nTOKEN_COLON = intern('colon')\nTOKEN_COMMA = intern('comma')\nTOKEN_DIV = intern('div')\nTOKEN_DOT = intern('dot')\nTOKEN_EQ = intern('eq')\nTOKEN_FLOORDIV = intern('floordiv')\nTOKEN_GT = intern('gt')\nTOKEN_GTEQ = intern('gteq')\nTOKEN_LBRACE = intern('lbrace')\nTOKEN_LBRACKET = intern('lbracket')\nTOKEN_LPAREN = intern('lparen')\nTOKEN_LT = intern('lt')\nTOKEN_LTEQ = intern('lteq')\nTOKEN_MOD = intern('mod')\nTOKEN_MUL = intern('mul')\nTOKEN_NE = intern('ne')\nTOKEN_PIPE = intern('pipe')\nTOKEN_POW = intern('pow')\nTOKEN_RBRACE = intern('rbrace')\nTOKEN_RBRACKET = intern('rbracket')\nTOKEN_RPAREN = intern('rparen')\nTOKEN_SEMICOLON = intern('semicolon')\nTOKEN_SUB = intern('sub')\nTOKEN_TILDE = intern('tilde')\nTOKEN_WHITESPACE = intern('whitespace')\nTOKEN_FLOAT = intern('float')\nTOKEN_INTEGER = intern('integer')\nTOKEN_NAME = intern('name')\nTOKEN_STRING = intern('string')\nTOKEN_OPERATOR = intern('operator')\nTOKEN_BLOCK_BEGIN = intern('block_begin')\nTOKEN_BLOCK_END = intern('block_end')\nTOKEN_VARIABLE_BEGIN = intern('variable_begin')\nTOKEN_VARIABLE_END = intern('variable_end')\nTOKEN_RAW_BEGIN = intern('raw_begin')\nTOKEN_RAW_END = intern('raw_end')\nTOKEN_COMMENT_BEGIN = intern('comment_begin')\nTOKEN_COMMENT_END = intern('comment_end')\nTOKEN_COMMENT = intern('comment')\nTOKEN_LINESTATEMENT_BEGIN = intern('linestatement_begin')\nTOKEN_LINESTATEMENT_END = intern('linestatement_end')\nTOKEN_LINECOMMENT_BEGIN = intern('linecomment_begin')\nTOKEN_LINECOMMENT_END = intern('linecomment_end')\nTOKEN_LINECOMMENT = intern('linecomment')\nTOKEN_DATA = intern('data')\nTOKEN_INITIAL = intern('initial')\nTOKEN_EOF = intern('eof')\n\n# bind operators to token types\noperators = {\n    '+':            TOKEN_ADD,\n    '-':            TOKEN_SUB,\n    '/':            TOKEN_DIV,\n    '//':           TOKEN_FLOORDIV,\n    '*':            TOKEN_MUL,\n    '%':            TOKEN_MOD,\n    '**':           TOKEN_POW,\n    '~':            TOKEN_TILDE,\n    '[':            TOKEN_LBRACKET,\n    ']':            TOKEN_RBRACKET,\n    '(':            TOKEN_LPAREN,\n    ')':            TOKEN_RPAREN,\n    '{':            TOKEN_LBRACE,\n    '}':            TOKEN_RBRACE,\n    '==':           TOKEN_EQ,\n    '!=':           TOKEN_NE,\n    '>':            TOKEN_GT,\n    '>=':           TOKEN_GTEQ,\n    '<':            TOKEN_LT,\n    '<=':           TOKEN_LTEQ,\n    '=':            TOKEN_ASSIGN,\n    '.':            TOKEN_DOT,\n    ':':            TOKEN_COLON,\n    '|':            TOKEN_PIPE,\n    ',':            TOKEN_COMMA,\n    ';':            TOKEN_SEMICOLON\n}\n\nreverse_operators = dict([(v, k) for k, v in iteritems(operators)])\nassert len(operators) == len(reverse_operators), 'operators dropped'\noperator_re = re.compile('(%s)' % '|'.join(re.escape(x) for x in\n                         sorted(operators, key=lambda x: -len(x))))\n\nignored_tokens = frozenset([TOKEN_COMMENT_BEGIN, TOKEN_COMMENT,\n                            TOKEN_COMMENT_END, TOKEN_WHITESPACE,\n                            TOKEN_LINECOMMENT_BEGIN, TOKEN_LINECOMMENT_END,\n                            TOKEN_LINECOMMENT])\nignore_if_empty = frozenset([TOKEN_WHITESPACE, TOKEN_DATA,\n                             TOKEN_COMMENT, TOKEN_LINECOMMENT])\n\n\ndef _describe_token_type(token_type):\n    if token_type in reverse_operators:\n        return reverse_operators[token_type]\n    return {\n        TOKEN_COMMENT_BEGIN:        'begin of comment',\n        TOKEN_COMMENT_END:          'end of comment',\n        TOKEN_COMMENT:              'comment',\n        TOKEN_LINECOMMENT:          'comment',\n        TOKEN_BLOCK_BEGIN:          'begin of statement block',\n        TOKEN_BLOCK_END:            'end of statement block',\n        TOKEN_VARIABLE_BEGIN:       'begin of print statement',\n        TOKEN_VARIABLE_END:         'end of print statement',\n        TOKEN_LINESTATEMENT_BEGIN:  'begin of line statement',\n        TOKEN_LINESTATEMENT_END:    'end of line statement',\n        TOKEN_DATA:                 'template data / text',\n        TOKEN_EOF:                  'end of template'\n    }.get(token_type, token_type)\n\n\ndef describe_token(token):\n    \"\"\"Returns a description of the token.\"\"\"\n    if token.type == 'name':\n        return token.value\n    return _describe_token_type(token.type)\n\n\ndef describe_token_expr(expr):\n    \"\"\"Like `describe_token` but for token expressions.\"\"\"\n    if ':' in expr:\n        type, value = expr.split(':', 1)\n        if type == 'name':\n            return value\n    else:\n        type = expr\n    return _describe_token_type(type)\n\n\ndef count_newlines(value):\n    \"\"\"Count the number of newline characters in the string.  This is\n    useful for extensions that filter a stream.\n    \"\"\"\n    return len(newline_re.findall(value))\n\n\ndef compile_rules(environment):\n    \"\"\"Compiles all the rules from the environment into a list of rules.\"\"\"\n    e = re.escape\n    rules = [\n        (len(environment.comment_start_string), 'comment',\n         e(environment.comment_start_string)),\n        (len(environment.block_start_string), 'block',\n         e(environment.block_start_string)),\n        (len(environment.variable_start_string), 'variable',\n         e(environment.variable_start_string))\n    ]\n\n    if environment.line_statement_prefix is not None:\n        rules.append((len(environment.line_statement_prefix), 'linestatement',\n                      r'^[ \\t\\v]*' + e(environment.line_statement_prefix)))\n    if environment.line_comment_prefix is not None:\n        rules.append((len(environment.line_comment_prefix), 'linecomment',\n                      r'(?:^|(?<=\\S))[^\\S\\r\\n]*' +\n                      e(environment.line_comment_prefix)))\n\n    return [x[1:] for x in sorted(rules, reverse=True)]\n\n\nclass Failure(object):\n    \"\"\"Class that raises a `TemplateSyntaxError` if called.\n    Used by the `Lexer` to specify known errors.\n    \"\"\"\n\n    def __init__(self, message, cls=TemplateSyntaxError):\n        self.message = message\n        self.error_class = cls\n\n    def __call__(self, lineno, filename):\n        raise self.error_class(self.message, lineno, filename)\n\n\nclass Token(tuple):\n    \"\"\"Token class.\"\"\"\n    __slots__ = ()\n    lineno, type, value = (property(itemgetter(x)) for x in range(3))\n\n    def __new__(cls, lineno, type, value):\n        return tuple.__new__(cls, (lineno, intern(str(type)), value))\n\n    def __str__(self):\n        if self.type in reverse_operators:\n            return reverse_operators[self.type]\n        elif self.type == 'name':\n            return self.value\n        return self.type\n\n    def test(self, expr):\n        \"\"\"Test a token against a token expression.  This can either be a\n        token type or ``'token_type:token_value'``.  This can only test\n        against string values and types.\n        \"\"\"\n        # here we do a regular string equality check as test_any is usually\n        # passed an iterable of not interned strings.\n        if self.type == expr:\n            return True\n        elif ':' in expr:\n            return expr.split(':', 1) == [self.type, self.value]\n        return False\n\n    def test_any(self, *iterable):\n        \"\"\"Test against multiple token expressions.\"\"\"\n        for expr in iterable:\n            if self.test(expr):\n                return True\n        return False\n\n    def __repr__(self):\n        return 'Token(%r, %r, %r)' % (\n            self.lineno,\n            self.type,\n            self.value\n        )\n\n\n@implements_iterator\nclass TokenStreamIterator(object):\n    \"\"\"The iterator for tokenstreams.  Iterate over the stream\n    until the eof token is reached.\n    \"\"\"\n\n    def __init__(self, stream):\n        self.stream = stream\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        token = self.stream.current\n        if token.type is TOKEN_EOF:\n            self.stream.close()\n            raise StopIteration()\n        next(self.stream)\n        return token\n\n\n@implements_iterator\nclass TokenStream(object):\n    \"\"\"A token stream is an iterable that yields :class:`Token`\\\\s.  The\n    parser however does not iterate over it but calls :meth:`next` to go\n    one token ahead.  The current active token is stored as :attr:`current`.\n    \"\"\"\n\n    def __init__(self, generator, name, filename):\n        self._iter = iter(generator)\n        self._pushed = deque()\n        self.name = name\n        self.filename = filename\n        self.closed = False\n        self.current = Token(1, TOKEN_INITIAL, '')\n        next(self)\n\n    def __iter__(self):\n        return TokenStreamIterator(self)\n\n    def __bool__(self):\n        return bool(self._pushed) or self.current.type is not TOKEN_EOF\n    __nonzero__ = __bool__  # py2\n\n    eos = property(lambda x: not x, doc=\"Are we at the end of the stream?\")\n\n    def push(self, token):\n        \"\"\"Push a token back to the stream.\"\"\"\n        self._pushed.append(token)\n\n    def look(self):\n        \"\"\"Look at the next token.\"\"\"\n        old_token = next(self)\n        result = self.current\n        self.push(result)\n        self.current = old_token\n        return result\n\n    def skip(self, n=1):\n        \"\"\"Got n tokens ahead.\"\"\"\n        for x in range(n):\n            next(self)\n\n    def next_if(self, expr):\n        \"\"\"Perform the token test and return the token if it matched.\n        Otherwise the return value is `None`.\n        \"\"\"\n        if self.current.test(expr):\n            return next(self)\n\n    def skip_if(self, expr):\n        \"\"\"Like :meth:`next_if` but only returns `True` or `False`.\"\"\"\n        return self.next_if(expr) is not None\n\n    def __next__(self):\n        \"\"\"Go one token ahead and return the old one.\n\n        Use the built-in :func:`next` instead of calling this directly.\n        \"\"\"\n        rv = self.current\n        if self._pushed:\n            self.current = self._pushed.popleft()\n        elif self.current.type is not TOKEN_EOF:\n            try:\n                self.current = next(self._iter)\n            except StopIteration:\n                self.close()\n        return rv\n\n    def close(self):\n        \"\"\"Close the stream.\"\"\"\n        self.current = Token(self.current.lineno, TOKEN_EOF, '')\n        self._iter = None\n        self.closed = True\n\n    def expect(self, expr):\n        \"\"\"Expect a given token type and return it.  This accepts the same\n        argument as :meth:`jinja2.lexer.Token.test`.\n        \"\"\"\n        if not self.current.test(expr):\n            expr = describe_token_expr(expr)\n            if self.current.type is TOKEN_EOF:\n                raise TemplateSyntaxError('unexpected end of template, '\n                                          'expected %r.' % expr,\n                                          self.current.lineno,\n                                          self.name, self.filename)\n            raise TemplateSyntaxError(\"expected token %r, got %r\" %\n                                      (expr, describe_token(self.current)),\n                                      self.current.lineno,\n                                      self.name, self.filename)\n        try:\n            return self.current\n        finally:\n            next(self)\n\n\ndef get_lexer(environment):\n    \"\"\"Return a lexer which is probably cached.\"\"\"\n    key = (environment.block_start_string,\n           environment.block_end_string,\n           environment.variable_start_string,\n           environment.variable_end_string,\n           environment.comment_start_string,\n           environment.comment_end_string,\n           environment.line_statement_prefix,\n           environment.line_comment_prefix,\n           environment.trim_blocks,\n           environment.lstrip_blocks,\n           environment.newline_sequence,\n           environment.keep_trailing_newline)\n    lexer = _lexer_cache.get(key)\n    if lexer is None:\n        lexer = Lexer(environment)\n        _lexer_cache[key] = lexer\n    return lexer\n\n\nclass Lexer(object):\n    \"\"\"Class that implements a lexer for a given environment. Automatically\n    created by the environment class, usually you don't have to do that.\n\n    Note that the lexer is not automatically bound to an environment.\n    Multiple environments can share the same lexer.\n    \"\"\"\n\n    def __init__(self, environment):\n        # shortcuts\n        c = lambda x: re.compile(x, re.M | re.S)\n        e = re.escape\n\n        # lexing rules for tags\n        tag_rules = [\n            (whitespace_re, TOKEN_WHITESPACE, None),\n            (float_re, TOKEN_FLOAT, None),\n            (integer_re, TOKEN_INTEGER, None),\n            (name_re, TOKEN_NAME, None),\n            (string_re, TOKEN_STRING, None),\n            (operator_re, TOKEN_OPERATOR, None)\n        ]\n\n        # assemble the root lexing rule. because \"|\" is ungreedy\n        # we have to sort by length so that the lexer continues working\n        # as expected when we have parsing rules like <% for block and\n        # <%= for variables. (if someone wants asp like syntax)\n        # variables are just part of the rules if variable processing\n        # is required.\n        root_tag_rules = compile_rules(environment)\n\n        # block suffix if trimming is enabled\n        block_suffix_re = environment.trim_blocks and '\\\\n?' or ''\n\n        # strip leading spaces if lstrip_blocks is enabled\n        prefix_re = {}\n        if environment.lstrip_blocks:\n            # use '{%+' to manually disable lstrip_blocks behavior\n            no_lstrip_re = e('+')\n            # detect overlap between block and variable or comment strings\n            block_diff = c(r'^%s(.*)' % e(environment.block_start_string))\n            # make sure we don't mistake a block for a variable or a comment\n            m = block_diff.match(environment.comment_start_string)\n            no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''\n            m = block_diff.match(environment.variable_start_string)\n            no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''\n\n            # detect overlap between comment and variable strings\n            comment_diff = c(r'^%s(.*)' % e(environment.comment_start_string))\n            m = comment_diff.match(environment.variable_start_string)\n            no_variable_re = m and r'(?!%s)' % e(m.group(1)) or ''\n\n            lstrip_re = r'^[ \\t]*'\n            block_prefix_re = r'%s%s(?!%s)|%s\\+?' % (\n                    lstrip_re,\n                    e(environment.block_start_string),\n                    no_lstrip_re,\n                    e(environment.block_start_string),\n                    )\n            comment_prefix_re = r'%s%s%s|%s\\+?' % (\n                    lstrip_re,\n                    e(environment.comment_start_string),\n                    no_variable_re,\n                    e(environment.comment_start_string),\n                    )\n            prefix_re['block'] = block_prefix_re\n            prefix_re['comment'] = comment_prefix_re\n        else:\n            block_prefix_re = '%s' % e(environment.block_start_string)\n\n        self.newline_sequence = environment.newline_sequence\n        self.keep_trailing_newline = environment.keep_trailing_newline\n\n        # global lexing rules\n        self.rules = {\n            'root': [\n                # directives\n                (c('(.*?)(?:%s)' % '|'.join(\n                    [r'(?P<raw_begin>(?:\\s*%s\\-|%s)\\s*raw\\s*(?:\\-%s\\s*|%s))' % (\n                        e(environment.block_start_string),\n                        block_prefix_re,\n                        e(environment.block_end_string),\n                        e(environment.block_end_string)\n                    )] + [\n                        r'(?P<%s_begin>\\s*%s\\-|%s)' % (n, r, prefix_re.get(n,r))\n                        for n, r in root_tag_rules\n                    ])), (TOKEN_DATA, '#bygroup'), '#bygroup'),\n                # data\n                (c('.+'), TOKEN_DATA, None)\n            ],\n            # comments\n            TOKEN_COMMENT_BEGIN: [\n                (c(r'(.*?)((?:\\-%s\\s*|%s)%s)' % (\n                    e(environment.comment_end_string),\n                    e(environment.comment_end_string),\n                    block_suffix_re\n                )), (TOKEN_COMMENT, TOKEN_COMMENT_END), '#pop'),\n                (c('(.)'), (Failure('Missing end of comment tag'),), None)\n            ],\n            # blocks\n            TOKEN_BLOCK_BEGIN: [\n                (c(r'(?:\\-%s\\s*|%s)%s' % (\n                    e(environment.block_end_string),\n                    e(environment.block_end_string),\n                    block_suffix_re\n                )), TOKEN_BLOCK_END, '#pop'),\n            ] + tag_rules,\n            # variables\n            TOKEN_VARIABLE_BEGIN: [\n                (c(r'\\-%s\\s*|%s' % (\n                    e(environment.variable_end_string),\n                    e(environment.variable_end_string)\n                )), TOKEN_VARIABLE_END, '#pop')\n            ] + tag_rules,\n            # raw block\n            TOKEN_RAW_BEGIN: [\n                (c(r'(.*?)((?:\\s*%s\\-|%s)\\s*endraw\\s*(?:\\-%s\\s*|%s%s))' % (\n                    e(environment.block_start_string),\n                    block_prefix_re,\n                    e(environment.block_end_string),\n                    e(environment.block_end_string),\n                    block_suffix_re\n                )), (TOKEN_DATA, TOKEN_RAW_END), '#pop'),\n                (c('(.)'), (Failure('Missing end of raw directive'),), None)\n            ],\n            # line statements\n            TOKEN_LINESTATEMENT_BEGIN: [\n                (c(r'\\s*(\\n|$)'), TOKEN_LINESTATEMENT_END, '#pop')\n            ] + tag_rules,\n            # line comments\n            TOKEN_LINECOMMENT_BEGIN: [\n                (c(r'(.*?)()(?=\\n|$)'), (TOKEN_LINECOMMENT,\n                 TOKEN_LINECOMMENT_END), '#pop')\n            ]\n        }\n\n    def _normalize_newlines(self, value):\n        \"\"\"Called for strings and template data to normalize it to unicode.\"\"\"\n        return newline_re.sub(self.newline_sequence, value)\n\n    def tokenize(self, source, name=None, filename=None, state=None):\n        \"\"\"Calls tokeniter + tokenize and wraps it in a token stream.\n        \"\"\"\n        stream = self.tokeniter(source, name, filename, state)\n        return TokenStream(self.wrap(stream, name, filename), name, filename)\n\n    def wrap(self, stream, name=None, filename=None):\n        \"\"\"This is called with the stream as returned by `tokenize` and wraps\n        every token in a :class:`Token` and converts the value.\n        \"\"\"\n        for lineno, token, value in stream:\n            if token in ignored_tokens:\n                continue\n            elif token == 'linestatement_begin':\n                token = 'block_begin'\n            elif token == 'linestatement_end':\n                token = 'block_end'\n            # we are not interested in those tokens in the parser\n            elif token in ('raw_begin', 'raw_end'):\n                continue\n            elif token == 'data':\n                value = self._normalize_newlines(value)\n            elif token == 'keyword':\n                token = value\n            elif token == 'name':\n                value = str(value)\n                if check_ident and not value.isidentifier():\n                    raise TemplateSyntaxError(\n                        'Invalid character in identifier',\n                        lineno, name, filename)\n            elif token == 'string':\n                # try to unescape string\n                try:\n                    value = self._normalize_newlines(value[1:-1]) \\\n                        .encode('ascii', 'backslashreplace') \\\n                        .decode('unicode-escape')\n                except Exception as e:\n                    msg = str(e).split(':')[-1].strip()\n                    raise TemplateSyntaxError(msg, lineno, name, filename)\n            elif token == 'integer':\n                value = int(value)\n            elif token == 'float':\n                value = float(value)\n            elif token == 'operator':\n                token = operators[value]\n            yield Token(lineno, token, value)\n\n    def tokeniter(self, source, name, filename=None, state=None):\n        \"\"\"This method tokenizes the text and returns the tokens in a\n        generator.  Use this method if you just want to tokenize a template.\n        \"\"\"\n        source = text_type(source)\n        lines = source.splitlines()\n        if self.keep_trailing_newline and source:\n            for newline in ('\\r\\n', '\\r', '\\n'):\n                if source.endswith(newline):\n                    lines.append('')\n                    break\n        source = '\\n'.join(lines)\n        pos = 0\n        lineno = 1\n        stack = ['root']\n        if state is not None and state != 'root':\n            assert state in ('variable', 'block'), 'invalid state'\n            stack.append(state + '_begin')\n        else:\n            state = 'root'\n        statetokens = self.rules[stack[-1]]\n        source_length = len(source)\n\n        balancing_stack = []\n\n        while 1:\n            # tokenizer loop\n            for regex, tokens, new_state in statetokens:\n                m = regex.match(source, pos)\n                # if no match we try again with the next rule\n                if m is None:\n                    continue\n\n                # we only match blocks and variables if braces / parentheses\n                # are balanced. continue parsing with the lower rule which\n                # is the operator rule. do this only if the end tags look\n                # like operators\n                if balancing_stack and \\\n                   tokens in ('variable_end', 'block_end',\n                              'linestatement_end'):\n                    continue\n\n                # tuples support more options\n                if isinstance(tokens, tuple):\n                    for idx, token in enumerate(tokens):\n                        # failure group\n                        if token.__class__ is Failure:\n                            raise token(lineno, filename)\n                        # bygroup is a bit more complex, in that case we\n                        # yield for the current token the first named\n                        # group that matched\n                        elif token == '#bygroup':\n                            for key, value in iteritems(m.groupdict()):\n                                if value is not None:\n                                    yield lineno, key, value\n                                    lineno += value.count('\\n')\n                                    break\n                            else:\n                                raise RuntimeError('%r wanted to resolve '\n                                                   'the token dynamically'\n                                                   ' but no group matched'\n                                                   % regex)\n                        # normal group\n                        else:\n                            data = m.group(idx + 1)\n                            if data or token not in ignore_if_empty:\n                                yield lineno, token, data\n                            lineno += data.count('\\n')\n\n                # strings as token just are yielded as it.\n                else:\n                    data = m.group()\n                    # update brace/parentheses balance\n                    if tokens == 'operator':\n                        if data == '{':\n                            balancing_stack.append('}')\n                        elif data == '(':\n                            balancing_stack.append(')')\n                        elif data == '[':\n                            balancing_stack.append(']')\n                        elif data in ('}', ')', ']'):\n                            if not balancing_stack:\n                                raise TemplateSyntaxError('unexpected \\'%s\\'' %\n                                                          data, lineno, name,\n                                                          filename)\n                            expected_op = balancing_stack.pop()\n                            if expected_op != data:\n                                raise TemplateSyntaxError('unexpected \\'%s\\', '\n                                                          'expected \\'%s\\'' %\n                                                          (data, expected_op),\n                                                          lineno, name,\n                                                          filename)\n                    # yield items\n                    if data or tokens not in ignore_if_empty:\n                        yield lineno, tokens, data\n                    lineno += data.count('\\n')\n\n                # fetch new position into new variable so that we can check\n                # if there is a internal parsing error which would result\n                # in an infinite loop\n                pos2 = m.end()\n\n                # handle state changes\n                if new_state is not None:\n                    # remove the uppermost state\n                    if new_state == '#pop':\n                        stack.pop()\n                    # resolve the new state by group checking\n                    elif new_state == '#bygroup':\n                        for key, value in iteritems(m.groupdict()):\n                            if value is not None:\n                                stack.append(key)\n                                break\n                        else:\n                            raise RuntimeError('%r wanted to resolve the '\n                                               'new state dynamically but'\n                                               ' no group matched' %\n                                               regex)\n                    # direct state name given\n                    else:\n                        stack.append(new_state)\n                    statetokens = self.rules[stack[-1]]\n                # we are still at the same position and no stack change.\n                # this means a loop without break condition, avoid that and\n                # raise error\n                elif pos2 == pos:\n                    raise RuntimeError('%r yielded empty string without '\n                                       'stack change' % regex)\n                # publish new function and start again\n                pos = pos2\n                break\n            # if loop terminated without break we haven't found a single match\n            # either we are at the end of the file or we have a problem\n            else:\n                # end of text\n                if pos >= source_length:\n                    return\n                # something went wrong\n                raise TemplateSyntaxError('unexpected char %r at %d' %\n                                          (source[pos], pos), lineno,\n                                          name, filename)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/loaders.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.loaders\n    ~~~~~~~~~~~~~~\n\n    Jinja loader classes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport sys\nimport weakref\nfrom types import ModuleType\nfrom os import path\nfrom hashlib import sha1\nfrom jinja2.exceptions import TemplateNotFound\nfrom jinja2.utils import open_if_exists, internalcode\nfrom jinja2._compat import string_types, iteritems\n\n\ndef split_template_path(template):\n    \"\"\"Split a path into segments and perform a sanity check.  If it detects\n    '..' in the path it will raise a `TemplateNotFound` error.\n    \"\"\"\n    pieces = []\n    for piece in template.split('/'):\n        if path.sep in piece \\\n           or (path.altsep and path.altsep in piece) or \\\n           piece == path.pardir:\n            raise TemplateNotFound(template)\n        elif piece and piece != '.':\n            pieces.append(piece)\n    return pieces\n\n\nclass BaseLoader(object):\n    \"\"\"Baseclass for all loaders.  Subclass this and override `get_source` to\n    implement a custom loading mechanism.  The environment provides a\n    `get_template` method that calls the loader's `load` method to get the\n    :class:`Template` object.\n\n    A very basic example for a loader that looks up templates on the file\n    system could look like this::\n\n        from jinja2 import BaseLoader, TemplateNotFound\n        from os.path import join, exists, getmtime\n\n        class MyLoader(BaseLoader):\n\n            def __init__(self, path):\n                self.path = path\n\n            def get_source(self, environment, template):\n                path = join(self.path, template)\n                if not exists(path):\n                    raise TemplateNotFound(template)\n                mtime = getmtime(path)\n                with file(path) as f:\n                    source = f.read().decode('utf-8')\n                return source, path, lambda: mtime == getmtime(path)\n    \"\"\"\n\n    #: if set to `False` it indicates that the loader cannot provide access\n    #: to the source of templates.\n    #:\n    #: .. versionadded:: 2.4\n    has_source_access = True\n\n    def get_source(self, environment, template):\n        \"\"\"Get the template source, filename and reload helper for a template.\n        It's passed the environment and template name and has to return a\n        tuple in the form ``(source, filename, uptodate)`` or raise a\n        `TemplateNotFound` error if it can't locate the template.\n\n        The source part of the returned tuple must be the source of the\n        template as unicode string or a ASCII bytestring.  The filename should\n        be the name of the file on the filesystem if it was loaded from there,\n        otherwise `None`.  The filename is used by python for the tracebacks\n        if no loader extension is used.\n\n        The last item in the tuple is the `uptodate` function.  If auto\n        reloading is enabled it's always called to check if the template\n        changed.  No arguments are passed so the function must store the\n        old state somewhere (for example in a closure).  If it returns `False`\n        the template will be reloaded.\n        \"\"\"\n        if not self.has_source_access:\n            raise RuntimeError('%s cannot provide access to the source' %\n                               self.__class__.__name__)\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        \"\"\"Iterates over all templates.  If the loader does not support that\n        it should raise a :exc:`TypeError` which is the default behavior.\n        \"\"\"\n        raise TypeError('this loader cannot iterate over all templates')\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        \"\"\"Loads a template.  This method looks up the template in the cache\n        or loads one by calling :meth:`get_source`.  Subclasses should not\n        override this method as loaders working on collections of other\n        loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n        will not call this method but `get_source` directly.\n        \"\"\"\n        code = None\n        if globals is None:\n            globals = {}\n\n        # first we try to get the source for this template together\n        # with the filename and the uptodate function.\n        source, filename, uptodate = self.get_source(environment, name)\n\n        # try to load the code from the bytecode cache if there is a\n        # bytecode cache configured.\n        bcc = environment.bytecode_cache\n        if bcc is not None:\n            bucket = bcc.get_bucket(environment, name, filename, source)\n            code = bucket.code\n\n        # if we don't have code so far (not cached, no longer up to\n        # date) etc. we compile the template\n        if code is None:\n            code = environment.compile(source, name, filename)\n\n        # if the bytecode cache is available and the bucket doesn't\n        # have a code so far, we give the bucket the new code and put\n        # it back to the bytecode cache.\n        if bcc is not None and bucket.code is None:\n            bucket.code = code\n            bcc.set_bucket(bucket)\n\n        return environment.template_class.from_code(environment, code,\n                                                    globals, uptodate)\n\n\nclass FileSystemLoader(BaseLoader):\n    \"\"\"Loads templates from the file system.  This loader can find templates\n    in folders on the file system and is the preferred way to load them.\n\n    The loader takes the path to the templates as string, or if multiple\n    locations are wanted a list of them which is then looked up in the\n    given order::\n\n    >>> loader = FileSystemLoader('/path/to/templates')\n    >>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])\n\n    Per default the template encoding is ``'utf-8'`` which can be changed\n    by setting the `encoding` parameter to something else.\n\n    To follow symbolic links, set the *followlinks* parameter to ``True``::\n\n    >>> loader = FileSystemLoader('/path/to/templates', followlinks=True)\n\n    .. versionchanged:: 2.8+\n       The *followlinks* parameter was added.\n    \"\"\"\n\n    def __init__(self, searchpath, encoding='utf-8', followlinks=False):\n        if isinstance(searchpath, string_types):\n            searchpath = [searchpath]\n        self.searchpath = list(searchpath)\n        self.encoding = encoding\n        self.followlinks = followlinks\n\n    def get_source(self, environment, template):\n        pieces = split_template_path(template)\n        for searchpath in self.searchpath:\n            filename = path.join(searchpath, *pieces)\n            f = open_if_exists(filename)\n            if f is None:\n                continue\n            try:\n                contents = f.read().decode(self.encoding)\n            finally:\n                f.close()\n\n            mtime = path.getmtime(filename)\n\n            def uptodate():\n                try:\n                    return path.getmtime(filename) == mtime\n                except OSError:\n                    return False\n            return contents, filename, uptodate\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        found = set()\n        for searchpath in self.searchpath:\n            walk_dir = os.walk(searchpath, followlinks=self.followlinks)\n            for dirpath, dirnames, filenames in walk_dir:\n                for filename in filenames:\n                    template = os.path.join(dirpath, filename) \\\n                        [len(searchpath):].strip(os.path.sep) \\\n                                          .replace(os.path.sep, '/')\n                    if template[:2] == './':\n                        template = template[2:]\n                    if template not in found:\n                        found.add(template)\n        return sorted(found)\n\n# Nuitka: Load this immediately to avoid having to have pkg_resources\n# inline copy present after initial import.\nimport pkg_resources\nfrom pkg_resources import DefaultProvider, ResourceManager, get_provider\n\nclass PackageLoader(BaseLoader):\n    \"\"\"Load templates from python eggs or packages.  It is constructed with\n    the name of the python package and the path to the templates in that\n    package::\n\n        loader = PackageLoader('mypackage', 'views')\n\n    If the package path is not given, ``'templates'`` is assumed.\n\n    Per default the template encoding is ``'utf-8'`` which can be changed\n    by setting the `encoding` parameter to something else.  Due to the nature\n    of eggs it's only possible to reload templates if the package was loaded\n    from the file system and not a zip file.\n    \"\"\"\n\n    def __init__(self, package_name, package_path='templates',\n                 encoding='utf-8'):\n        provider = get_provider(package_name)\n        self.encoding = encoding\n        self.manager = ResourceManager()\n        self.filesystem_bound = isinstance(provider, DefaultProvider)\n        self.provider = provider\n        self.package_path = package_path\n\n    def get_source(self, environment, template):\n        pieces = split_template_path(template)\n        p = '/'.join((self.package_path,) + tuple(pieces))\n        if not self.provider.has_resource(p):\n            raise TemplateNotFound(template)\n\n        filename = uptodate = None\n        if self.filesystem_bound:\n            filename = self.provider.get_resource_filename(self.manager, p)\n            mtime = path.getmtime(filename)\n            def uptodate():\n                try:\n                    return path.getmtime(filename) == mtime\n                except OSError:\n                    return False\n\n        source = self.provider.get_resource_string(self.manager, p)\n        return source.decode(self.encoding), filename, uptodate\n\n    def list_templates(self):\n        path = self.package_path\n        if path[:2] == './':\n            path = path[2:]\n        elif path == '.':\n            path = ''\n        offset = len(path)\n        results = []\n        def _walk(path):\n            for filename in self.provider.resource_listdir(path):\n                fullname = path + '/' + filename\n                if self.provider.resource_isdir(fullname):\n                    _walk(fullname)\n                else:\n                    results.append(fullname[offset:].lstrip('/'))\n        _walk(path)\n        results.sort()\n        return results\n\n\nclass DictLoader(BaseLoader):\n    \"\"\"Loads a template from a python dict.  It's passed a dict of unicode\n    strings bound to template names.  This loader is useful for unittesting:\n\n    >>> loader = DictLoader({'index.html': 'source here'})\n\n    Because auto reloading is rarely useful this is disabled per default.\n    \"\"\"\n\n    def __init__(self, mapping):\n        self.mapping = mapping\n\n    def get_source(self, environment, template):\n        if template in self.mapping:\n            source = self.mapping[template]\n            return source, None, lambda: source == self.mapping.get(template)\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        return sorted(self.mapping)\n\n\nclass FunctionLoader(BaseLoader):\n    \"\"\"A loader that is passed a function which does the loading.  The\n    function receives the name of the template and has to return either\n    an unicode string with the template source, a tuple in the form ``(source,\n    filename, uptodatefunc)`` or `None` if the template does not exist.\n\n    >>> def load_template(name):\n    ...     if name == 'index.html':\n    ...         return '...'\n    ...\n    >>> loader = FunctionLoader(load_template)\n\n    The `uptodatefunc` is a function that is called if autoreload is enabled\n    and has to return `True` if the template is still up to date.  For more\n    details have a look at :meth:`BaseLoader.get_source` which has the same\n    return value.\n    \"\"\"\n\n    def __init__(self, load_func):\n        self.load_func = load_func\n\n    def get_source(self, environment, template):\n        rv = self.load_func(template)\n        if rv is None:\n            raise TemplateNotFound(template)\n        elif isinstance(rv, string_types):\n            return rv, None, None\n        return rv\n\n\nclass PrefixLoader(BaseLoader):\n    \"\"\"A loader that is passed a dict of loaders where each loader is bound\n    to a prefix.  The prefix is delimited from the template by a slash per\n    default, which can be changed by setting the `delimiter` argument to\n    something else::\n\n        loader = PrefixLoader({\n            'app1':     PackageLoader('mypackage.app1'),\n            'app2':     PackageLoader('mypackage.app2')\n        })\n\n    By loading ``'app1/index.html'`` the file from the app1 package is loaded,\n    by loading ``'app2/index.html'`` the file from the second.\n    \"\"\"\n\n    def __init__(self, mapping, delimiter='/'):\n        self.mapping = mapping\n        self.delimiter = delimiter\n\n    def get_loader(self, template):\n        try:\n            prefix, name = template.split(self.delimiter, 1)\n            loader = self.mapping[prefix]\n        except (ValueError, KeyError):\n            raise TemplateNotFound(template)\n        return loader, name\n\n    def get_source(self, environment, template):\n        loader, name = self.get_loader(template)\n        try:\n            return loader.get_source(environment, name)\n        except TemplateNotFound:\n            # re-raise the exception with the correct filename here.\n            # (the one that includes the prefix)\n            raise TemplateNotFound(template)\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        loader, local_name = self.get_loader(name)\n        try:\n            return loader.load(environment, local_name, globals)\n        except TemplateNotFound:\n            # re-raise the exception with the correct filename here.\n            # (the one that includes the prefix)\n            raise TemplateNotFound(name)\n\n    def list_templates(self):\n        result = []\n        for prefix, loader in iteritems(self.mapping):\n            for template in loader.list_templates():\n                result.append(prefix + self.delimiter + template)\n        return result\n\n\nclass ChoiceLoader(BaseLoader):\n    \"\"\"This loader works like the `PrefixLoader` just that no prefix is\n    specified.  If a template could not be found by one loader the next one\n    is tried.\n\n    >>> loader = ChoiceLoader([\n    ...     FileSystemLoader('/path/to/user/templates'),\n    ...     FileSystemLoader('/path/to/system/templates')\n    ... ])\n\n    This is useful if you want to allow users to override builtin templates\n    from a different location.\n    \"\"\"\n\n    def __init__(self, loaders):\n        self.loaders = loaders\n\n    def get_source(self, environment, template):\n        for loader in self.loaders:\n            try:\n                return loader.get_source(environment, template)\n            except TemplateNotFound:\n                pass\n        raise TemplateNotFound(template)\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        for loader in self.loaders:\n            try:\n                return loader.load(environment, name, globals)\n            except TemplateNotFound:\n                pass\n        raise TemplateNotFound(name)\n\n    def list_templates(self):\n        found = set()\n        for loader in self.loaders:\n            found.update(loader.list_templates())\n        return sorted(found)\n\n\nclass _TemplateModule(ModuleType):\n    \"\"\"Like a normal module but with support for weak references\"\"\"\n\n\nclass ModuleLoader(BaseLoader):\n    \"\"\"This loader loads templates from precompiled templates.\n\n    Example usage:\n\n    >>> loader = ChoiceLoader([\n    ...     ModuleLoader('/path/to/compiled/templates'),\n    ...     FileSystemLoader('/path/to/templates')\n    ... ])\n\n    Templates can be precompiled with :meth:`Environment.compile_templates`.\n    \"\"\"\n\n    has_source_access = False\n\n    def __init__(self, path):\n        package_name = '_jinja2_module_templates_%x' % id(self)\n\n        # create a fake module that looks for the templates in the\n        # path given.\n        mod = _TemplateModule(package_name)\n        if isinstance(path, string_types):\n            path = [path]\n        else:\n            path = list(path)\n        mod.__path__ = path\n\n        sys.modules[package_name] = weakref.proxy(mod,\n            lambda x: sys.modules.pop(package_name, None))\n\n        # the only strong reference, the sys.modules entry is weak\n        # so that the garbage collector can remove it once the\n        # loader that created it goes out of business.\n        self.module = mod\n        self.package_name = package_name\n\n    @staticmethod\n    def get_template_key(name):\n        return 'tmpl_' + sha1(name.encode('utf-8')).hexdigest()\n\n    @staticmethod\n    def get_module_filename(name):\n        return ModuleLoader.get_template_key(name) + '.py'\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        key = self.get_template_key(name)\n        module = '%s.%s' % (self.package_name, key)\n        mod = getattr(self.module, module, None)\n        if mod is None:\n            try:\n                mod = __import__(module, None, None, ['root'])\n            except ImportError:\n                raise TemplateNotFound(name)\n\n            # remove the entry from sys.modules, we only want the attribute\n            # on the module object we have stored on the loader.\n            sys.modules.pop(module, None)\n\n        return environment.template_class.from_module_dict(\n            environment, mod.__dict__, globals)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/meta.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.meta\n    ~~~~~~~~~~~\n\n    This module implements various functions that exposes information about\n    templates that might be interesting for various kinds of applications.\n\n    :copyright: (c) 2017 by the Jinja Team, see AUTHORS for more details.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.compiler import CodeGenerator\nfrom jinja2._compat import string_types, iteritems\n\n\nclass TrackingCodeGenerator(CodeGenerator):\n    \"\"\"We abuse the code generator for introspection.\"\"\"\n\n    def __init__(self, environment):\n        CodeGenerator.__init__(self, environment, '<introspection>',\n                               '<introspection>')\n        self.undeclared_identifiers = set()\n\n    def write(self, x):\n        \"\"\"Don't write.\"\"\"\n\n    def enter_frame(self, frame):\n        \"\"\"Remember all undeclared identifiers.\"\"\"\n        CodeGenerator.enter_frame(self, frame)\n        for _, (action, param) in iteritems(frame.symbols.loads):\n            if action == 'resolve':\n                self.undeclared_identifiers.add(param)\n\n\ndef find_undeclared_variables(ast):\n    \"\"\"Returns a set of all variables in the AST that will be looked up from\n    the context at runtime.  Because at compile time it's not known which\n    variables will be used depending on the path the execution takes at\n    runtime, all variables are returned.\n\n    >>> from jinja2 import Environment, meta\n    >>> env = Environment()\n    >>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')\n    >>> meta.find_undeclared_variables(ast) == set(['bar'])\n    True\n\n    .. admonition:: Implementation\n\n       Internally the code generator is used for finding undeclared variables.\n       This is good to know because the code generator might raise a\n       :exc:`TemplateAssertionError` during compilation and as a matter of\n       fact this function can currently raise that exception as well.\n    \"\"\"\n    codegen = TrackingCodeGenerator(ast.environment)\n    codegen.visit(ast)\n    return codegen.undeclared_identifiers\n\n\ndef find_referenced_templates(ast):\n    \"\"\"Finds all the referenced templates from the AST.  This will return an\n    iterator over all the hardcoded template extensions, inclusions and\n    imports.  If dynamic inheritance or inclusion is used, `None` will be\n    yielded.\n\n    >>> from jinja2 import Environment, meta\n    >>> env = Environment()\n    >>> ast = env.parse('{% extends \"layout.html\" %}{% include helper %}')\n    >>> list(meta.find_referenced_templates(ast))\n    ['layout.html', None]\n\n    This function is useful for dependency tracking.  For example if you want\n    to rebuild parts of the website after a layout template has changed.\n    \"\"\"\n    for node in ast.find_all((nodes.Extends, nodes.FromImport, nodes.Import,\n                              nodes.Include)):\n        if not isinstance(node.template, nodes.Const):\n            # a tuple with some non consts in there\n            if isinstance(node.template, (nodes.Tuple, nodes.List)):\n                for template_name in node.template.items:\n                    # something const, only yield the strings and ignore\n                    # non-string consts that really just make no sense\n                    if isinstance(template_name, nodes.Const):\n                        if isinstance(template_name.value, string_types):\n                            yield template_name.value\n                    # something dynamic in there\n                    else:\n                        yield None\n            # something dynamic we don't know about here\n            else:\n                yield None\n            continue\n        # constant is a basestring, direct template name\n        if isinstance(node.template.value, string_types):\n            yield node.template.value\n        # a tuple or list (latter *should* not happen) made of consts,\n        # yield the consts that are strings.  We could warn here for\n        # non string values\n        elif isinstance(node, nodes.Include) and \\\n             isinstance(node.template.value, (tuple, list)):\n            for template_name in node.template.value:\n                if isinstance(template_name, string_types):\n                    yield template_name\n        # something else we don't care about, we could warn here\n        else:\n            yield None\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py",
    "content": "import sys\nfrom ast import literal_eval\nfrom itertools import islice, chain\nfrom jinja2 import nodes\nfrom jinja2._compat import text_type\nfrom jinja2.compiler import CodeGenerator, has_safe_repr\nfrom jinja2.environment import Environment, Template\nfrom jinja2.utils import concat, escape\n\n\ndef native_concat(nodes):\n    \"\"\"Return a native Python type from the list of compiled nodes. If the\n    result is a single node, its value is returned. Otherwise, the nodes are\n    concatenated as strings. If the result can be parsed with\n    :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the\n    string is returned.\n    \"\"\"\n    head = list(islice(nodes, 2))\n\n    if not head:\n        return None\n\n    if len(head) == 1:\n        out = head[0]\n    else:\n        out = u''.join([text_type(v) for v in chain(head, nodes)])\n\n    try:\n        return literal_eval(out)\n    except (ValueError, SyntaxError, MemoryError):\n        return out\n\n\nclass NativeCodeGenerator(CodeGenerator):\n    \"\"\"A code generator which avoids injecting ``to_string()`` calls around the\n    internal code Jinja uses to render templates.\n    \"\"\"\n\n    def visit_Output(self, node, frame):\n        \"\"\"Same as :meth:`CodeGenerator.visit_Output`, but do not call\n        ``to_string`` on output nodes in generated code.\n        \"\"\"\n        if self.has_known_extends and frame.require_output_check:\n            return\n\n        finalize = self.environment.finalize\n        finalize_context = getattr(finalize, 'contextfunction', False)\n        finalize_eval = getattr(finalize, 'evalcontextfunction', False)\n        finalize_env = getattr(finalize, 'environmentfunction', False)\n\n        if finalize is not None:\n            if finalize_context or finalize_eval:\n                const_finalize = None\n            elif finalize_env:\n                def const_finalize(x):\n                    return finalize(self.environment, x)\n            else:\n                const_finalize = finalize\n        else:\n            def const_finalize(x):\n                return x\n\n        # If we are inside a frame that requires output checking, we do so.\n        outdent_later = False\n\n        if frame.require_output_check:\n            self.writeline('if parent_template is None:')\n            self.indent()\n            outdent_later = True\n\n        # Try to evaluate as many chunks as possible into a static string at\n        # compile time.\n        body = []\n\n        for child in node.nodes:\n            try:\n                if const_finalize is None:\n                    raise nodes.Impossible()\n\n                const = child.as_const(frame.eval_ctx)\n                if not has_safe_repr(const):\n                    raise nodes.Impossible()\n            except nodes.Impossible:\n                body.append(child)\n                continue\n\n            # the frame can't be volatile here, because otherwise the as_const\n            # function would raise an Impossible exception at that point\n            try:\n                if frame.eval_ctx.autoescape:\n                    if hasattr(const, '__html__'):\n                        const = const.__html__()\n                    else:\n                        const = escape(const)\n\n                const = const_finalize(const)\n            except Exception:\n                # if something goes wrong here we evaluate the node at runtime\n                # for easier debugging\n                body.append(child)\n                continue\n\n            if body and isinstance(body[-1], list):\n                body[-1].append(const)\n            else:\n                body.append([const])\n\n        # if we have less than 3 nodes or a buffer we yield or extend/append\n        if len(body) < 3 or frame.buffer is not None:\n            if frame.buffer is not None:\n                # for one item we append, for more we extend\n                if len(body) == 1:\n                    self.writeline('%s.append(' % frame.buffer)\n                else:\n                    self.writeline('%s.extend((' % frame.buffer)\n\n                self.indent()\n\n            for item in body:\n                if isinstance(item, list):\n                    val = repr(native_concat(item))\n\n                    if frame.buffer is None:\n                        self.writeline('yield ' + val)\n                    else:\n                        self.writeline(val + ',')\n                else:\n                    if frame.buffer is None:\n                        self.writeline('yield ', item)\n                    else:\n                        self.newline(item)\n\n                    close = 0\n\n                    if finalize is not None:\n                        self.write('environment.finalize(')\n\n                        if finalize_context:\n                            self.write('context, ')\n\n                        close += 1\n\n                    self.visit(item, frame)\n\n                    if close > 0:\n                        self.write(')' * close)\n\n                    if frame.buffer is not None:\n                        self.write(',')\n\n            if frame.buffer is not None:\n                # close the open parentheses\n                self.outdent()\n                self.writeline(len(body) == 1 and ')' or '))')\n\n        # otherwise we create a format string as this is faster in that case\n        else:\n            format = []\n            arguments = []\n\n            for item in body:\n                if isinstance(item, list):\n                    format.append(native_concat(item).replace('%', '%%'))\n                else:\n                    format.append('%s')\n                    arguments.append(item)\n\n            self.writeline('yield ')\n            self.write(repr(concat(format)) + ' % (')\n            self.indent()\n\n            for argument in arguments:\n                self.newline(argument)\n                close = 0\n\n                if finalize is not None:\n                    self.write('environment.finalize(')\n\n                    if finalize_context:\n                        self.write('context, ')\n                    elif finalize_eval:\n                        self.write('context.eval_ctx, ')\n                    elif finalize_env:\n                        self.write('environment, ')\n\n                    close += 1\n\n                self.visit(argument, frame)\n                self.write(')' * close + ', ')\n\n            self.outdent()\n            self.writeline(')')\n\n        if outdent_later:\n            self.outdent()\n\n\nclass NativeTemplate(Template):\n    def render(self, *args, **kwargs):\n        \"\"\"Render the template to produce a native Python type. If the result\n        is a single node, its value is returned. Otherwise, the nodes are\n        concatenated as strings. If the result can be parsed with\n        :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the\n        string is returned.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n\n        try:\n            return native_concat(self.root_render_func(self.new_context(vars)))\n        except Exception:\n            exc_info = sys.exc_info()\n\n        return self.environment.handle_exception(exc_info, True)\n\n\nclass NativeEnvironment(Environment):\n    \"\"\"An environment that renders templates to native Python types.\"\"\"\n\n    code_generator_class = NativeCodeGenerator\n    template_class = NativeTemplate\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/nodes.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.nodes\n    ~~~~~~~~~~~~\n\n    This module implements additional nodes derived from the ast base node.\n\n    It also provides some node tree helper functions like `in_lineno` and\n    `get_nodes` used by the parser and translator in order to normalize\n    python and jinja nodes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport types\nimport operator\n\nfrom collections import deque\nfrom jinja2.utils import Markup\nfrom jinja2._compat import izip, with_metaclass, text_type, PY2\n\n\n#: the types we support for context functions\n_context_function_types = (types.FunctionType, types.MethodType)\n\n\n_binop_to_func = {\n    '*':        operator.mul,\n    '/':        operator.truediv,\n    '//':       operator.floordiv,\n    '**':       operator.pow,\n    '%':        operator.mod,\n    '+':        operator.add,\n    '-':        operator.sub\n}\n\n_uaop_to_func = {\n    'not':      operator.not_,\n    '+':        operator.pos,\n    '-':        operator.neg\n}\n\n_cmpop_to_func = {\n    'eq':       operator.eq,\n    'ne':       operator.ne,\n    'gt':       operator.gt,\n    'gteq':     operator.ge,\n    'lt':       operator.lt,\n    'lteq':     operator.le,\n    'in':       lambda a, b: a in b,\n    'notin':    lambda a, b: a not in b\n}\n\n\nclass Impossible(Exception):\n    \"\"\"Raised if the node could not perform a requested action.\"\"\"\n\n\nclass NodeType(type):\n    \"\"\"A metaclass for nodes that handles the field and attribute\n    inheritance.  fields and attributes from the parent class are\n    automatically forwarded to the child.\"\"\"\n\n    def __new__(cls, name, bases, d):\n        for attr in 'fields', 'attributes':\n            storage = []\n            storage.extend(getattr(bases[0], attr, ()))\n            storage.extend(d.get(attr, ()))\n            assert len(bases) == 1, 'multiple inheritance not allowed'\n            assert len(storage) == len(set(storage)), 'layout conflict'\n            d[attr] = tuple(storage)\n        d.setdefault('abstract', False)\n        return type.__new__(cls, name, bases, d)\n\n\nclass EvalContext(object):\n    \"\"\"Holds evaluation time information.  Custom attributes can be attached\n    to it in extensions.\n    \"\"\"\n\n    def __init__(self, environment, template_name=None):\n        self.environment = environment\n        if callable(environment.autoescape):\n            self.autoescape = environment.autoescape(template_name)\n        else:\n            self.autoescape = environment.autoescape\n        self.volatile = False\n\n    def save(self):\n        return self.__dict__.copy()\n\n    def revert(self, old):\n        self.__dict__.clear()\n        self.__dict__.update(old)\n\n\ndef get_eval_context(node, ctx):\n    if ctx is None:\n        if node.environment is None:\n            raise RuntimeError('if no eval context is passed, the '\n                               'node must have an attached '\n                               'environment.')\n        return EvalContext(node.environment)\n    return ctx\n\n\nclass Node(with_metaclass(NodeType, object)):\n    \"\"\"Baseclass for all Jinja2 nodes.  There are a number of nodes available\n    of different types.  There are four major types:\n\n    -   :class:`Stmt`: statements\n    -   :class:`Expr`: expressions\n    -   :class:`Helper`: helper nodes\n    -   :class:`Template`: the outermost wrapper node\n\n    All nodes have fields and attributes.  Fields may be other nodes, lists,\n    or arbitrary values.  Fields are passed to the constructor as regular\n    positional arguments, attributes as keyword arguments.  Each node has\n    two attributes: `lineno` (the line number of the node) and `environment`.\n    The `environment` attribute is set at the end of the parsing process for\n    all nodes automatically.\n    \"\"\"\n    fields = ()\n    attributes = ('lineno', 'environment')\n    abstract = True\n\n    def __init__(self, *fields, **attributes):\n        if self.abstract:\n            raise TypeError('abstract nodes are not instanciable')\n        if fields:\n            if len(fields) != len(self.fields):\n                if not self.fields:\n                    raise TypeError('%r takes 0 arguments' %\n                                    self.__class__.__name__)\n                raise TypeError('%r takes 0 or %d argument%s' % (\n                    self.__class__.__name__,\n                    len(self.fields),\n                    len(self.fields) != 1 and 's' or ''\n                ))\n            for name, arg in izip(self.fields, fields):\n                setattr(self, name, arg)\n        for attr in self.attributes:\n            setattr(self, attr, attributes.pop(attr, None))\n        if attributes:\n            raise TypeError('unknown attribute %r' %\n                            next(iter(attributes)))\n\n    def iter_fields(self, exclude=None, only=None):\n        \"\"\"This method iterates over all fields that are defined and yields\n        ``(key, value)`` tuples.  Per default all fields are returned, but\n        it's possible to limit that to some fields by providing the `only`\n        parameter or to exclude some using the `exclude` parameter.  Both\n        should be sets or tuples of field names.\n        \"\"\"\n        for name in self.fields:\n            if (exclude is only is None) or \\\n               (exclude is not None and name not in exclude) or \\\n               (only is not None and name in only):\n                try:\n                    yield name, getattr(self, name)\n                except AttributeError:\n                    pass\n\n    def iter_child_nodes(self, exclude=None, only=None):\n        \"\"\"Iterates over all direct child nodes of the node.  This iterates\n        over all fields and yields the values of they are nodes.  If the value\n        of a field is a list all the nodes in that list are returned.\n        \"\"\"\n        for field, item in self.iter_fields(exclude, only):\n            if isinstance(item, list):\n                for n in item:\n                    if isinstance(n, Node):\n                        yield n\n            elif isinstance(item, Node):\n                yield item\n\n    def find(self, node_type):\n        \"\"\"Find the first node of a given type.  If no such node exists the\n        return value is `None`.\n        \"\"\"\n        for result in self.find_all(node_type):\n            return result\n\n    def find_all(self, node_type):\n        \"\"\"Find all the nodes of a given type.  If the type is a tuple,\n        the check is performed for any of the tuple items.\n        \"\"\"\n        for child in self.iter_child_nodes():\n            if isinstance(child, node_type):\n                yield child\n            for result in child.find_all(node_type):\n                yield result\n\n    def set_ctx(self, ctx):\n        \"\"\"Reset the context of a node and all child nodes.  Per default the\n        parser will all generate nodes that have a 'load' context as it's the\n        most common one.  This method is used in the parser to set assignment\n        targets and other nodes to a store context.\n        \"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            if 'ctx' in node.fields:\n                node.ctx = ctx\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def set_lineno(self, lineno, override=False):\n        \"\"\"Set the line numbers of the node and children.\"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            if 'lineno' in node.attributes:\n                if node.lineno is None or override:\n                    node.lineno = lineno\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def set_environment(self, environment):\n        \"\"\"Set the environment for all nodes.\"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            node.environment = environment\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def __eq__(self, other):\n        return type(self) is type(other) and \\\n               tuple(self.iter_fields()) == tuple(other.iter_fields())\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    # Restore Python 2 hashing behavior on Python 3\n    __hash__ = object.__hash__\n\n    def __repr__(self):\n        return '%s(%s)' % (\n            self.__class__.__name__,\n            ', '.join('%s=%r' % (arg, getattr(self, arg, None)) for\n                      arg in self.fields)\n        )\n\n    def dump(self):\n        def _dump(node):\n            if not isinstance(node, Node):\n                buf.append(repr(node))\n                return\n\n            buf.append('nodes.%s(' % node.__class__.__name__)\n            if not node.fields:\n                buf.append(')')\n                return\n            for idx, field in enumerate(node.fields):\n                if idx:\n                    buf.append(', ')\n                value = getattr(node, field)\n                if isinstance(value, list):\n                    buf.append('[')\n                    for idx, item in enumerate(value):\n                        if idx:\n                            buf.append(', ')\n                        _dump(item)\n                    buf.append(']')\n                else:\n                    _dump(value)\n            buf.append(')')\n        buf = []\n        _dump(self)\n        return ''.join(buf)\n\n\n\nclass Stmt(Node):\n    \"\"\"Base node for all statements.\"\"\"\n    abstract = True\n\n\nclass Helper(Node):\n    \"\"\"Nodes that exist in a specific context only.\"\"\"\n    abstract = True\n\n\nclass Template(Node):\n    \"\"\"Node that represents a template.  This must be the outermost node that\n    is passed to the compiler.\n    \"\"\"\n    fields = ('body',)\n\n\nclass Output(Stmt):\n    \"\"\"A node that holds multiple expressions which are then printed out.\n    This is used both for the `print` statement and the regular template data.\n    \"\"\"\n    fields = ('nodes',)\n\n\nclass Extends(Stmt):\n    \"\"\"Represents an extends statement.\"\"\"\n    fields = ('template',)\n\n\nclass For(Stmt):\n    \"\"\"The for loop.  `target` is the target for the iteration (usually a\n    :class:`Name` or :class:`Tuple`), `iter` the iterable.  `body` is a list\n    of nodes that are used as loop-body, and `else_` a list of nodes for the\n    `else` block.  If no else node exists it has to be an empty list.\n\n    For filtered nodes an expression can be stored as `test`, otherwise `None`.\n    \"\"\"\n    fields = ('target', 'iter', 'body', 'else_', 'test', 'recursive')\n\n\nclass If(Stmt):\n    \"\"\"If `test` is true, `body` is rendered, else `else_`.\"\"\"\n    fields = ('test', 'body', 'elif_', 'else_')\n\n\nclass Macro(Stmt):\n    \"\"\"A macro definition.  `name` is the name of the macro, `args` a list of\n    arguments and `defaults` a list of defaults if there are any.  `body` is\n    a list of nodes for the macro body.\n    \"\"\"\n    fields = ('name', 'args', 'defaults', 'body')\n\n\nclass CallBlock(Stmt):\n    \"\"\"Like a macro without a name but a call instead.  `call` is called with\n    the unnamed macro as `caller` argument this node holds.\n    \"\"\"\n    fields = ('call', 'args', 'defaults', 'body')\n\n\nclass FilterBlock(Stmt):\n    \"\"\"Node for filter sections.\"\"\"\n    fields = ('body', 'filter')\n\n\nclass With(Stmt):\n    \"\"\"Specific node for with statements.  In older versions of Jinja the\n    with statement was implemented on the base of the `Scope` node instead.\n\n    .. versionadded:: 2.9.3\n    \"\"\"\n    fields = ('targets', 'values', 'body')\n\n\nclass Block(Stmt):\n    \"\"\"A node that represents a block.\"\"\"\n    fields = ('name', 'body', 'scoped')\n\n\nclass Include(Stmt):\n    \"\"\"A node that represents the include tag.\"\"\"\n    fields = ('template', 'with_context', 'ignore_missing')\n\n\nclass Import(Stmt):\n    \"\"\"A node that represents the import tag.\"\"\"\n    fields = ('template', 'target', 'with_context')\n\n\nclass FromImport(Stmt):\n    \"\"\"A node that represents the from import tag.  It's important to not\n    pass unsafe names to the name attribute.  The compiler translates the\n    attribute lookups directly into getattr calls and does *not* use the\n    subscript callback of the interface.  As exported variables may not\n    start with double underscores (which the parser asserts) this is not a\n    problem for regular Jinja code, but if this node is used in an extension\n    extra care must be taken.\n\n    The list of names may contain tuples if aliases are wanted.\n    \"\"\"\n    fields = ('template', 'names', 'with_context')\n\n\nclass ExprStmt(Stmt):\n    \"\"\"A statement that evaluates an expression and discards the result.\"\"\"\n    fields = ('node',)\n\n\nclass Assign(Stmt):\n    \"\"\"Assigns an expression to a target.\"\"\"\n    fields = ('target', 'node')\n\n\nclass AssignBlock(Stmt):\n    \"\"\"Assigns a block to a target.\"\"\"\n    fields = ('target', 'filter', 'body')\n\n\nclass Expr(Node):\n    \"\"\"Baseclass for all expressions.\"\"\"\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        \"\"\"Return the value of the expression as constant or raise\n        :exc:`Impossible` if this was not possible.\n\n        An :class:`EvalContext` can be provided, if none is given\n        a default context is created which requires the nodes to have\n        an attached environment.\n\n        .. versionchanged:: 2.4\n           the `eval_ctx` parameter was added.\n        \"\"\"\n        raise Impossible()\n\n    def can_assign(self):\n        \"\"\"Check if it's possible to assign something to this node.\"\"\"\n        return False\n\n\nclass BinExpr(Expr):\n    \"\"\"Baseclass for all binary expressions.\"\"\"\n    fields = ('left', 'right')\n    operator = None\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        # intercepted operators cannot be folded at compile time\n        if self.environment.sandboxed and \\\n           self.operator in self.environment.intercepted_binops:\n            raise Impossible()\n        f = _binop_to_func[self.operator]\n        try:\n            return f(self.left.as_const(eval_ctx), self.right.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n\nclass UnaryExpr(Expr):\n    \"\"\"Baseclass for all unary expressions.\"\"\"\n    fields = ('node',)\n    operator = None\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        # intercepted operators cannot be folded at compile time\n        if self.environment.sandboxed and \\\n           self.operator in self.environment.intercepted_unops:\n            raise Impossible()\n        f = _uaop_to_func[self.operator]\n        try:\n            return f(self.node.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n\nclass Name(Expr):\n    \"\"\"Looks up a name or stores a value in a name.\n    The `ctx` of the node can be one of the following values:\n\n    -   `store`: store a value in the name\n    -   `load`: load that name\n    -   `param`: like `store` but if the name was defined as function parameter.\n    \"\"\"\n    fields = ('name', 'ctx')\n\n    def can_assign(self):\n        return self.name not in ('true', 'false', 'none',\n                                 'True', 'False', 'None')\n\n\nclass NSRef(Expr):\n    \"\"\"Reference to a namespace value assignment\"\"\"\n    fields = ('name', 'attr')\n\n    def can_assign(self):\n        # We don't need any special checks here; NSRef assignments have a\n        # runtime check to ensure the target is a namespace object which will\n        # have been checked already as it is created using a normal assignment\n        # which goes through a `Name` node.\n        return True\n\n\nclass Literal(Expr):\n    \"\"\"Baseclass for literals.\"\"\"\n    abstract = True\n\n\nclass Const(Literal):\n    \"\"\"All constant values.  The parser will return this node for simple\n    constants such as ``42`` or ``\"foo\"`` but it can be used to store more\n    complex values such as lists too.  Only constants with a safe\n    representation (objects where ``eval(repr(x)) == x`` is true).\n    \"\"\"\n    fields = ('value',)\n\n    def as_const(self, eval_ctx=None):\n        rv = self.value\n        if PY2 and type(rv) is text_type and \\\n           self.environment.policies['compiler.ascii_str']:\n            try:\n                rv = rv.encode('ascii')\n            except UnicodeError:\n                pass\n        return rv\n\n    @classmethod\n    def from_untrusted(cls, value, lineno=None, environment=None):\n        \"\"\"Return a const object if the value is representable as\n        constant value in the generated code, otherwise it will raise\n        an `Impossible` exception.\n        \"\"\"\n        from .compiler import has_safe_repr\n        if not has_safe_repr(value):\n            raise Impossible()\n        return cls(value, lineno=lineno, environment=environment)\n\n\nclass TemplateData(Literal):\n    \"\"\"A constant template string.\"\"\"\n    fields = ('data',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if eval_ctx.volatile:\n            raise Impossible()\n        if eval_ctx.autoescape:\n            return Markup(self.data)\n        return self.data\n\n\nclass Tuple(Literal):\n    \"\"\"For loop unpacking and some other things like multiple arguments\n    for subscripts.  Like for :class:`Name` `ctx` specifies if the tuple\n    is used for loading the names or storing.\n    \"\"\"\n    fields = ('items', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return tuple(x.as_const(eval_ctx) for x in self.items)\n\n    def can_assign(self):\n        for item in self.items:\n            if not item.can_assign():\n                return False\n        return True\n\n\nclass List(Literal):\n    \"\"\"Any list literal such as ``[1, 2, 3]``\"\"\"\n    fields = ('items',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return [x.as_const(eval_ctx) for x in self.items]\n\n\nclass Dict(Literal):\n    \"\"\"Any dict literal such as ``{1: 2, 3: 4}``.  The items must be a list of\n    :class:`Pair` nodes.\n    \"\"\"\n    fields = ('items',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return dict(x.as_const(eval_ctx) for x in self.items)\n\n\nclass Pair(Helper):\n    \"\"\"A key, value pair for dicts.\"\"\"\n    fields = ('key', 'value')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.key.as_const(eval_ctx), self.value.as_const(eval_ctx)\n\n\nclass Keyword(Helper):\n    \"\"\"A key, value pair for keyword arguments where key is a string.\"\"\"\n    fields = ('key', 'value')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.key, self.value.as_const(eval_ctx)\n\n\nclass CondExpr(Expr):\n    \"\"\"A conditional expression (inline if expression).  (``{{\n    foo if bar else baz }}``)\n    \"\"\"\n    fields = ('test', 'expr1', 'expr2')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if self.test.as_const(eval_ctx):\n            return self.expr1.as_const(eval_ctx)\n\n        # if we evaluate to an undefined object, we better do that at runtime\n        if self.expr2 is None:\n            raise Impossible()\n\n        return self.expr2.as_const(eval_ctx)\n\n\ndef args_as_const(node, eval_ctx):\n    args = [x.as_const(eval_ctx) for x in node.args]\n    kwargs = dict(x.as_const(eval_ctx) for x in node.kwargs)\n\n    if node.dyn_args is not None:\n        try:\n            args.extend(node.dyn_args.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    if node.dyn_kwargs is not None:\n        try:\n            kwargs.update(node.dyn_kwargs.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    return args, kwargs\n\n\nclass Filter(Expr):\n    \"\"\"This node applies a filter on an expression.  `name` is the name of\n    the filter, the rest of the fields are the same as for :class:`Call`.\n\n    If the `node` of a filter is `None` the contents of the last buffer are\n    filtered.  Buffers are created by macros and filter blocks.\n    \"\"\"\n\n    fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n\n        if eval_ctx.volatile or self.node is None:\n            raise Impossible()\n\n        # we have to be careful here because we call filter_ below.\n        # if this variable would be called filter, 2to3 would wrap the\n        # call in a list beause it is assuming we are talking about the\n        # builtin filter function here which no longer returns a list in\n        # python 3.  because of that, do not rename filter_ to filter!\n        filter_ = self.environment.filters.get(self.name)\n\n        if filter_ is None or getattr(filter_, 'contextfilter', False):\n            raise Impossible()\n\n        # We cannot constant handle async filters, so we need to make sure\n        # to not go down this path.\n        if (\n            eval_ctx.environment.is_async\n            and getattr(filter_, 'asyncfiltervariant', False)\n        ):\n            raise Impossible()\n\n        args, kwargs = args_as_const(self, eval_ctx)\n        args.insert(0, self.node.as_const(eval_ctx))\n\n        if getattr(filter_, 'evalcontextfilter', False):\n            args.insert(0, eval_ctx)\n        elif getattr(filter_, 'environmentfilter', False):\n            args.insert(0, self.environment)\n\n        try:\n            return filter_(*args, **kwargs)\n        except Exception:\n            raise Impossible()\n\n\nclass Test(Expr):\n    \"\"\"Applies a test on an expression.  `name` is the name of the test, the\n    rest of the fields are the same as for :class:`Call`.\n    \"\"\"\n\n    fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n    def as_const(self, eval_ctx=None):\n        test = self.environment.tests.get(self.name)\n\n        if test is None:\n            raise Impossible()\n\n        eval_ctx = get_eval_context(self, eval_ctx)\n        args, kwargs = args_as_const(self, eval_ctx)\n        args.insert(0, self.node.as_const(eval_ctx))\n\n        try:\n            return test(*args, **kwargs)\n        except Exception:\n            raise Impossible()\n\n\nclass Call(Expr):\n    \"\"\"Calls an expression.  `args` is a list of arguments, `kwargs` a list\n    of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args`\n    and `dyn_kwargs` has to be either `None` or a node that is used as\n    node for dynamic positional (``*args``) or keyword (``**kwargs``)\n    arguments.\n    \"\"\"\n    fields = ('node', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n\nclass Getitem(Expr):\n    \"\"\"Get an attribute or item from an expression and prefer the item.\"\"\"\n    fields = ('node', 'arg', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if self.ctx != 'load':\n            raise Impossible()\n        try:\n            return self.environment.getitem(self.node.as_const(eval_ctx),\n                                            self.arg.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    def can_assign(self):\n        return False\n\n\nclass Getattr(Expr):\n    \"\"\"Get an attribute or item from an expression that is a ascii-only\n    bytestring and prefer the attribute.\n    \"\"\"\n    fields = ('node', 'attr', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        if self.ctx != 'load':\n            raise Impossible()\n        try:\n            eval_ctx = get_eval_context(self, eval_ctx)\n            return self.environment.getattr(self.node.as_const(eval_ctx),\n                                            self.attr)\n        except Exception:\n            raise Impossible()\n\n    def can_assign(self):\n        return False\n\n\nclass Slice(Expr):\n    \"\"\"Represents a slice object.  This must only be used as argument for\n    :class:`Subscript`.\n    \"\"\"\n    fields = ('start', 'stop', 'step')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        def const(obj):\n            if obj is None:\n                return None\n            return obj.as_const(eval_ctx)\n        return slice(const(self.start), const(self.stop), const(self.step))\n\n\nclass Concat(Expr):\n    \"\"\"Concatenates the list of expressions provided after converting them to\n    unicode.\n    \"\"\"\n    fields = ('nodes',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return ''.join(text_type(x.as_const(eval_ctx)) for x in self.nodes)\n\n\nclass Compare(Expr):\n    \"\"\"Compares an expression with some other expressions.  `ops` must be a\n    list of :class:`Operand`\\\\s.\n    \"\"\"\n    fields = ('expr', 'ops')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        result = value = self.expr.as_const(eval_ctx)\n        try:\n            for op in self.ops:\n                new_value = op.expr.as_const(eval_ctx)\n                result = _cmpop_to_func[op.op](value, new_value)\n                value = new_value\n        except Exception:\n            raise Impossible()\n        return result\n\n\nclass Operand(Helper):\n    \"\"\"Holds an operator and an expression.\"\"\"\n    fields = ('op', 'expr')\n\nif __debug__:\n    Operand.__doc__ += '\\nThe following operators are available: ' + \\\n        ', '.join(sorted('``%s``' % x for x in set(_binop_to_func) |\n                  set(_uaop_to_func) | set(_cmpop_to_func)))\n\n\nclass Mul(BinExpr):\n    \"\"\"Multiplies the left with the right node.\"\"\"\n    operator = '*'\n\n\nclass Div(BinExpr):\n    \"\"\"Divides the left by the right node.\"\"\"\n    operator = '/'\n\n\nclass FloorDiv(BinExpr):\n    \"\"\"Divides the left by the right node and truncates conver the\n    result into an integer by truncating.\n    \"\"\"\n    operator = '//'\n\n\nclass Add(BinExpr):\n    \"\"\"Add the left to the right node.\"\"\"\n    operator = '+'\n\n\nclass Sub(BinExpr):\n    \"\"\"Subtract the right from the left node.\"\"\"\n    operator = '-'\n\n\nclass Mod(BinExpr):\n    \"\"\"Left modulo right.\"\"\"\n    operator = '%'\n\n\nclass Pow(BinExpr):\n    \"\"\"Left to the power of right.\"\"\"\n    operator = '**'\n\n\nclass And(BinExpr):\n    \"\"\"Short circuited AND.\"\"\"\n    operator = 'and'\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)\n\n\nclass Or(BinExpr):\n    \"\"\"Short circuited OR.\"\"\"\n    operator = 'or'\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)\n\n\nclass Not(UnaryExpr):\n    \"\"\"Negate the expression.\"\"\"\n    operator = 'not'\n\n\nclass Neg(UnaryExpr):\n    \"\"\"Make the expression negative.\"\"\"\n    operator = '-'\n\n\nclass Pos(UnaryExpr):\n    \"\"\"Make the expression positive (noop for most expressions)\"\"\"\n    operator = '+'\n\n\n# Helpers for extensions\n\n\nclass EnvironmentAttribute(Expr):\n    \"\"\"Loads an attribute from the environment object.  This is useful for\n    extensions that want to call a callback stored on the environment.\n    \"\"\"\n    fields = ('name',)\n\n\nclass ExtensionAttribute(Expr):\n    \"\"\"Returns the attribute of an extension bound to the environment.\n    The identifier is the identifier of the :class:`Extension`.\n\n    This node is usually constructed by calling the\n    :meth:`~jinja2.ext.Extension.attr` method on an extension.\n    \"\"\"\n    fields = ('identifier', 'name')\n\n\nclass ImportedName(Expr):\n    \"\"\"If created with an import name the import name is returned on node\n    access.  For example ``ImportedName('cgi.escape')`` returns the `escape`\n    function from the cgi module on evaluation.  Imports are optimized by the\n    compiler so there is no need to assign them to local variables.\n    \"\"\"\n    fields = ('importname',)\n\n\nclass InternalName(Expr):\n    \"\"\"An internal name in the compiler.  You cannot create these nodes\n    yourself but the parser provides a\n    :meth:`~jinja2.parser.Parser.free_identifier` method that creates\n    a new identifier for you.  This identifier is not available from the\n    template and is not threated specially by the compiler.\n    \"\"\"\n    fields = ('name',)\n\n    def __init__(self):\n        raise TypeError('Can\\'t create internal names.  Use the '\n                        '`free_identifier` method on a parser.')\n\n\nclass MarkSafe(Expr):\n    \"\"\"Mark the wrapped expression as safe (wrap it as `Markup`).\"\"\"\n    fields = ('expr',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return Markup(self.expr.as_const(eval_ctx))\n\n\nclass MarkSafeIfAutoescape(Expr):\n    \"\"\"Mark the wrapped expression as safe (wrap it as `Markup`) but\n    only if autoescaping is active.\n\n    .. versionadded:: 2.5\n    \"\"\"\n    fields = ('expr',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if eval_ctx.volatile:\n            raise Impossible()\n        expr = self.expr.as_const(eval_ctx)\n        if eval_ctx.autoescape:\n            return Markup(expr)\n        return expr\n\n\nclass ContextReference(Expr):\n    \"\"\"Returns the current template context.  It can be used like a\n    :class:`Name` node, with a ``'load'`` ctx and will return the\n    current :class:`~jinja2.runtime.Context` object.\n\n    Here an example that assigns the current template name to a\n    variable named `foo`::\n\n        Assign(Name('foo', ctx='store'),\n               Getattr(ContextReference(), 'name'))\n    \"\"\"\n\n\nclass Continue(Stmt):\n    \"\"\"Continue a loop.\"\"\"\n\n\nclass Break(Stmt):\n    \"\"\"Break a loop.\"\"\"\n\n\nclass Scope(Stmt):\n    \"\"\"An artificial scope.\"\"\"\n    fields = ('body',)\n\n\nclass OverlayScope(Stmt):\n    \"\"\"An overlay scope for extensions.  This is a largely unoptimized scope\n    that however can be used to introduce completely arbitrary variables into\n    a sub scope from a dictionary or dictionary like object.  The `context`\n    field has to evaluate to a dictionary object.\n\n    Example usage::\n\n        OverlayScope(context=self.call_method('get_context'),\n                     body=[...])\n\n    .. versionadded:: 2.10\n    \"\"\"\n    fields = ('context', 'body')\n\n\nclass EvalContextModifier(Stmt):\n    \"\"\"Modifies the eval context.  For each option that should be modified,\n    a :class:`Keyword` has to be added to the :attr:`options` list.\n\n    Example to change the `autoescape` setting::\n\n        EvalContextModifier(options=[Keyword('autoescape', Const(True))])\n    \"\"\"\n    fields = ('options',)\n\n\nclass ScopedEvalContextModifier(EvalContextModifier):\n    \"\"\"Modifies the eval context and reverts it later.  Works exactly like\n    :class:`EvalContextModifier` but will only modify the\n    :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.\n    \"\"\"\n    fields = ('body',)\n\n\n# make sure nobody creates custom nodes\ndef _failing_new(*args, **kwargs):\n    raise TypeError('can\\'t create custom node types')\nNodeType.__new__ = staticmethod(_failing_new); del _failing_new\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/optimizer.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.optimizer\n    ~~~~~~~~~~~~~~~~\n\n    The jinja optimizer is currently trying to constant fold a few expressions\n    and modify the AST in place so that it should be easier to evaluate it.\n\n    Because the AST does not contain all the scoping information and the\n    compiler has to find that out, we cannot do all the optimizations we\n    want.  For example loop unrolling doesn't work because unrolled loops would\n    have a different scoping.\n\n    The solution would be a second syntax tree that has the scoping rules stored.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.visitor import NodeTransformer\n\n\ndef optimize(node, environment):\n    \"\"\"The context hint can be used to perform an static optimization\n    based on the context given.\"\"\"\n    optimizer = Optimizer(environment)\n    return optimizer.visit(node)\n\n\nclass Optimizer(NodeTransformer):\n\n    def __init__(self, environment):\n        self.environment = environment\n\n    def fold(self, node, eval_ctx=None):\n        \"\"\"Do constant folding.\"\"\"\n        node = self.generic_visit(node)\n        try:\n            return nodes.Const.from_untrusted(node.as_const(eval_ctx),\n                                              lineno=node.lineno,\n                                              environment=self.environment)\n        except nodes.Impossible:\n            return node\n\n    visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \\\n    visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \\\n    visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \\\n    visit_Filter = visit_Test = visit_CondExpr = fold\n    del fold\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/parser.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.parser\n    ~~~~~~~~~~~~~\n\n    Implements the template parser.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError\nfrom jinja2.lexer import describe_token, describe_token_expr\nfrom jinja2._compat import imap\n\n\n_statement_keywords = frozenset(['for', 'if', 'block', 'extends', 'print',\n                                 'macro', 'include', 'from', 'import',\n                                 'set', 'with', 'autoescape'])\n_compare_operators = frozenset(['eq', 'ne', 'lt', 'lteq', 'gt', 'gteq'])\n\n_math_nodes = {\n    'add': nodes.Add,\n    'sub': nodes.Sub,\n    'mul': nodes.Mul,\n    'div': nodes.Div,\n    'floordiv': nodes.FloorDiv,\n    'mod': nodes.Mod,\n}\n\n\nclass Parser(object):\n    \"\"\"This is the central parsing class Jinja2 uses.  It's passed to\n    extensions and can be used to parse expressions or statements.\n    \"\"\"\n\n    def __init__(self, environment, source, name=None, filename=None,\n                 state=None):\n        self.environment = environment\n        self.stream = environment._tokenize(source, name, filename, state)\n        self.name = name\n        self.filename = filename\n        self.closed = False\n        self.extensions = {}\n        for extension in environment.iter_extensions():\n            for tag in extension.tags:\n                self.extensions[tag] = extension.parse\n        self._last_identifier = 0\n        self._tag_stack = []\n        self._end_token_stack = []\n\n    def fail(self, msg, lineno=None, exc=TemplateSyntaxError):\n        \"\"\"Convenience method that raises `exc` with the message, passed\n        line number or last line number as well as the current name and\n        filename.\n        \"\"\"\n        if lineno is None:\n            lineno = self.stream.current.lineno\n        raise exc(msg, lineno, self.name, self.filename)\n\n    def _fail_ut_eof(self, name, end_token_stack, lineno):\n        expected = []\n        for exprs in end_token_stack:\n            expected.extend(imap(describe_token_expr, exprs))\n        if end_token_stack:\n            currently_looking = ' or '.join(\n                \"'%s'\" % describe_token_expr(expr)\n                for expr in end_token_stack[-1])\n        else:\n            currently_looking = None\n\n        if name is None:\n            message = ['Unexpected end of template.']\n        else:\n            message = ['Encountered unknown tag \\'%s\\'.' % name]\n\n        if currently_looking:\n            if name is not None and name in expected:\n                message.append('You probably made a nesting mistake. Jinja '\n                               'is expecting this tag, but currently looking '\n                               'for %s.' % currently_looking)\n            else:\n                message.append('Jinja was looking for the following tags: '\n                               '%s.' % currently_looking)\n\n        if self._tag_stack:\n            message.append('The innermost block that needs to be '\n                           'closed is \\'%s\\'.' % self._tag_stack[-1])\n\n        self.fail(' '.join(message), lineno)\n\n    def fail_unknown_tag(self, name, lineno=None):\n        \"\"\"Called if the parser encounters an unknown tag.  Tries to fail\n        with a human readable error message that could help to identify\n        the problem.\n        \"\"\"\n        return self._fail_ut_eof(name, self._end_token_stack, lineno)\n\n    def fail_eof(self, end_tokens=None, lineno=None):\n        \"\"\"Like fail_unknown_tag but for end of template situations.\"\"\"\n        stack = list(self._end_token_stack)\n        if end_tokens is not None:\n            stack.append(end_tokens)\n        return self._fail_ut_eof(None, stack, lineno)\n\n    def is_tuple_end(self, extra_end_rules=None):\n        \"\"\"Are we at the end of a tuple?\"\"\"\n        if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):\n            return True\n        elif extra_end_rules is not None:\n            return self.stream.current.test_any(extra_end_rules)\n        return False\n\n    def free_identifier(self, lineno=None):\n        \"\"\"Return a new free identifier as :class:`~jinja2.nodes.InternalName`.\"\"\"\n        self._last_identifier += 1\n        rv = object.__new__(nodes.InternalName)\n        nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)\n        return rv\n\n    def parse_statement(self):\n        \"\"\"Parse a single statement.\"\"\"\n        token = self.stream.current\n        if token.type != 'name':\n            self.fail('tag name expected', token.lineno)\n        self._tag_stack.append(token.value)\n        pop_tag = True\n        try:\n            if token.value in _statement_keywords:\n                return getattr(self, 'parse_' + self.stream.current.value)()\n            if token.value == 'call':\n                return self.parse_call_block()\n            if token.value == 'filter':\n                return self.parse_filter_block()\n            ext = self.extensions.get(token.value)\n            if ext is not None:\n                return ext(self)\n\n            # did not work out, remove the token we pushed by accident\n            # from the stack so that the unknown tag fail function can\n            # produce a proper error message.\n            self._tag_stack.pop()\n            pop_tag = False\n            self.fail_unknown_tag(token.value, token.lineno)\n        finally:\n            if pop_tag:\n                self._tag_stack.pop()\n\n    def parse_statements(self, end_tokens, drop_needle=False):\n        \"\"\"Parse multiple statements into a list until one of the end tokens\n        is reached.  This is used to parse the body of statements as it also\n        parses template data if appropriate.  The parser checks first if the\n        current token is a colon and skips it if there is one.  Then it checks\n        for the block end and parses until if one of the `end_tokens` is\n        reached.  Per default the active token in the stream at the end of\n        the call is the matched end token.  If this is not wanted `drop_needle`\n        can be set to `True` and the end token is removed.\n        \"\"\"\n        # the first token may be a colon for python compatibility\n        self.stream.skip_if('colon')\n\n        # in the future it would be possible to add whole code sections\n        # by adding some sort of end of statement token and parsing those here.\n        self.stream.expect('block_end')\n        result = self.subparse(end_tokens)\n\n        # we reached the end of the template too early, the subparser\n        # does not check for this, so we do that now\n        if self.stream.current.type == 'eof':\n            self.fail_eof(end_tokens)\n\n        if drop_needle:\n            next(self.stream)\n        return result\n\n    def parse_set(self):\n        \"\"\"Parse an assign statement.\"\"\"\n        lineno = next(self.stream).lineno\n        target = self.parse_assign_target(with_namespace=True)\n        if self.stream.skip_if('assign'):\n            expr = self.parse_tuple()\n            return nodes.Assign(target, expr, lineno=lineno)\n        filter_node = self.parse_filter(None)\n        body = self.parse_statements(('name:endset',),\n                                     drop_needle=True)\n        return nodes.AssignBlock(target, filter_node, body, lineno=lineno)\n\n    def parse_for(self):\n        \"\"\"Parse a for loop.\"\"\"\n        lineno = self.stream.expect('name:for').lineno\n        target = self.parse_assign_target(extra_end_rules=('name:in',))\n        self.stream.expect('name:in')\n        iter = self.parse_tuple(with_condexpr=False,\n                                extra_end_rules=('name:recursive',))\n        test = None\n        if self.stream.skip_if('name:if'):\n            test = self.parse_expression()\n        recursive = self.stream.skip_if('name:recursive')\n        body = self.parse_statements(('name:endfor', 'name:else'))\n        if next(self.stream).value == 'endfor':\n            else_ = []\n        else:\n            else_ = self.parse_statements(('name:endfor',), drop_needle=True)\n        return nodes.For(target, iter, body, else_, test,\n                         recursive, lineno=lineno)\n\n    def parse_if(self):\n        \"\"\"Parse an if construct.\"\"\"\n        node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)\n        while 1:\n            node.test = self.parse_tuple(with_condexpr=False)\n            node.body = self.parse_statements(('name:elif', 'name:else',\n                                               'name:endif'))\n            node.elif_ = []\n            node.else_ = []\n            token = next(self.stream)\n            if token.test('name:elif'):\n                node = nodes.If(lineno=self.stream.current.lineno)\n                result.elif_.append(node)\n                continue\n            elif token.test('name:else'):\n                result.else_ = self.parse_statements(('name:endif',),\n                                                     drop_needle=True)\n            break\n        return result\n\n    def parse_with(self):\n        node = nodes.With(lineno=next(self.stream).lineno)\n        targets = []\n        values = []\n        while self.stream.current.type != 'block_end':\n            lineno = self.stream.current.lineno\n            if targets:\n                self.stream.expect('comma')\n            target = self.parse_assign_target()\n            target.set_ctx('param')\n            targets.append(target)\n            self.stream.expect('assign')\n            values.append(self.parse_expression())\n        node.targets = targets\n        node.values = values\n        node.body = self.parse_statements(('name:endwith',),\n                                          drop_needle=True)\n        return node\n\n    def parse_autoescape(self):\n        node = nodes.ScopedEvalContextModifier(lineno=next(self.stream).lineno)\n        node.options = [\n            nodes.Keyword('autoescape', self.parse_expression())\n        ]\n        node.body = self.parse_statements(('name:endautoescape',),\n                                            drop_needle=True)\n        return nodes.Scope([node])\n\n    def parse_block(self):\n        node = nodes.Block(lineno=next(self.stream).lineno)\n        node.name = self.stream.expect('name').value\n        node.scoped = self.stream.skip_if('name:scoped')\n\n        # common problem people encounter when switching from django\n        # to jinja.  we do not support hyphens in block names, so let's\n        # raise a nicer error message in that case.\n        if self.stream.current.type == 'sub':\n            self.fail('Block names in Jinja have to be valid Python '\n                      'identifiers and may not contain hyphens, use an '\n                      'underscore instead.')\n\n        node.body = self.parse_statements(('name:endblock',), drop_needle=True)\n        self.stream.skip_if('name:' + node.name)\n        return node\n\n    def parse_extends(self):\n        node = nodes.Extends(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        return node\n\n    def parse_import_context(self, node, default):\n        if self.stream.current.test_any('name:with', 'name:without') and \\\n           self.stream.look().test('name:context'):\n            node.with_context = next(self.stream).value == 'with'\n            self.stream.skip()\n        else:\n            node.with_context = default\n        return node\n\n    def parse_include(self):\n        node = nodes.Include(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        if self.stream.current.test('name:ignore') and \\\n           self.stream.look().test('name:missing'):\n            node.ignore_missing = True\n            self.stream.skip(2)\n        else:\n            node.ignore_missing = False\n        return self.parse_import_context(node, True)\n\n    def parse_import(self):\n        node = nodes.Import(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        self.stream.expect('name:as')\n        node.target = self.parse_assign_target(name_only=True).name\n        return self.parse_import_context(node, False)\n\n    def parse_from(self):\n        node = nodes.FromImport(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        self.stream.expect('name:import')\n        node.names = []\n\n        def parse_context():\n            if self.stream.current.value in ('with', 'without') and \\\n               self.stream.look().test('name:context'):\n                node.with_context = next(self.stream).value == 'with'\n                self.stream.skip()\n                return True\n            return False\n\n        while 1:\n            if node.names:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'name':\n                if parse_context():\n                    break\n                target = self.parse_assign_target(name_only=True)\n                if target.name.startswith('_'):\n                    self.fail('names starting with an underline can not '\n                              'be imported', target.lineno,\n                              exc=TemplateAssertionError)\n                if self.stream.skip_if('name:as'):\n                    alias = self.parse_assign_target(name_only=True)\n                    node.names.append((target.name, alias.name))\n                else:\n                    node.names.append(target.name)\n                if parse_context() or self.stream.current.type != 'comma':\n                    break\n            else:\n                self.stream.expect('name')\n        if not hasattr(node, 'with_context'):\n            node.with_context = False\n        return node\n\n    def parse_signature(self, node):\n        node.args = args = []\n        node.defaults = defaults = []\n        self.stream.expect('lparen')\n        while self.stream.current.type != 'rparen':\n            if args:\n                self.stream.expect('comma')\n            arg = self.parse_assign_target(name_only=True)\n            arg.set_ctx('param')\n            if self.stream.skip_if('assign'):\n                defaults.append(self.parse_expression())\n            elif defaults:\n                self.fail('non-default argument follows default argument')\n            args.append(arg)\n        self.stream.expect('rparen')\n\n    def parse_call_block(self):\n        node = nodes.CallBlock(lineno=next(self.stream).lineno)\n        if self.stream.current.type == 'lparen':\n            self.parse_signature(node)\n        else:\n            node.args = []\n            node.defaults = []\n\n        node.call = self.parse_expression()\n        if not isinstance(node.call, nodes.Call):\n            self.fail('expected call', node.lineno)\n        node.body = self.parse_statements(('name:endcall',), drop_needle=True)\n        return node\n\n    def parse_filter_block(self):\n        node = nodes.FilterBlock(lineno=next(self.stream).lineno)\n        node.filter = self.parse_filter(None, start_inline=True)\n        node.body = self.parse_statements(('name:endfilter',),\n                                          drop_needle=True)\n        return node\n\n    def parse_macro(self):\n        node = nodes.Macro(lineno=next(self.stream).lineno)\n        node.name = self.parse_assign_target(name_only=True).name\n        self.parse_signature(node)\n        node.body = self.parse_statements(('name:endmacro',),\n                                          drop_needle=True)\n        return node\n\n    def parse_print(self):\n        node = nodes.Output(lineno=next(self.stream).lineno)\n        node.nodes = []\n        while self.stream.current.type != 'block_end':\n            if node.nodes:\n                self.stream.expect('comma')\n            node.nodes.append(self.parse_expression())\n        return node\n\n    def parse_assign_target(self, with_tuple=True, name_only=False,\n                            extra_end_rules=None, with_namespace=False):\n        \"\"\"Parse an assignment target.  As Jinja2 allows assignments to\n        tuples, this function can parse all allowed assignment targets.  Per\n        default assignments to tuples are parsed, that can be disable however\n        by setting `with_tuple` to `False`.  If only assignments to names are\n        wanted `name_only` can be set to `True`.  The `extra_end_rules`\n        parameter is forwarded to the tuple parsing function.  If\n        `with_namespace` is enabled, a namespace assignment may be parsed.\n        \"\"\"\n        if with_namespace and self.stream.look().type == 'dot':\n            token = self.stream.expect('name')\n            next(self.stream)  # dot\n            attr = self.stream.expect('name')\n            target = nodes.NSRef(token.value, attr.value, lineno=token.lineno)\n        elif name_only:\n            token = self.stream.expect('name')\n            target = nodes.Name(token.value, 'store', lineno=token.lineno)\n        else:\n            if with_tuple:\n                target = self.parse_tuple(simplified=True,\n                                          extra_end_rules=extra_end_rules)\n            else:\n                target = self.parse_primary()\n            target.set_ctx('store')\n        if not target.can_assign():\n            self.fail('can\\'t assign to %r' % target.__class__.\n                      __name__.lower(), target.lineno)\n        return target\n\n    def parse_expression(self, with_condexpr=True):\n        \"\"\"Parse an expression.  Per default all expressions are parsed, if\n        the optional `with_condexpr` parameter is set to `False` conditional\n        expressions are not parsed.\n        \"\"\"\n        if with_condexpr:\n            return self.parse_condexpr()\n        return self.parse_or()\n\n    def parse_condexpr(self):\n        lineno = self.stream.current.lineno\n        expr1 = self.parse_or()\n        while self.stream.skip_if('name:if'):\n            expr2 = self.parse_or()\n            if self.stream.skip_if('name:else'):\n                expr3 = self.parse_condexpr()\n            else:\n                expr3 = None\n            expr1 = nodes.CondExpr(expr2, expr1, expr3, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return expr1\n\n    def parse_or(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_and()\n        while self.stream.skip_if('name:or'):\n            right = self.parse_and()\n            left = nodes.Or(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_and(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_not()\n        while self.stream.skip_if('name:and'):\n            right = self.parse_not()\n            left = nodes.And(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_not(self):\n        if self.stream.current.test('name:not'):\n            lineno = next(self.stream).lineno\n            return nodes.Not(self.parse_not(), lineno=lineno)\n        return self.parse_compare()\n\n    def parse_compare(self):\n        lineno = self.stream.current.lineno\n        expr = self.parse_math1()\n        ops = []\n        while 1:\n            token_type = self.stream.current.type\n            if token_type in _compare_operators:\n                next(self.stream)\n                ops.append(nodes.Operand(token_type, self.parse_math1()))\n            elif self.stream.skip_if('name:in'):\n                ops.append(nodes.Operand('in', self.parse_math1()))\n            elif (self.stream.current.test('name:not') and\n                  self.stream.look().test('name:in')):\n                self.stream.skip(2)\n                ops.append(nodes.Operand('notin', self.parse_math1()))\n            else:\n                break\n            lineno = self.stream.current.lineno\n        if not ops:\n            return expr\n        return nodes.Compare(expr, ops, lineno=lineno)\n\n    def parse_math1(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_concat()\n        while self.stream.current.type in ('add', 'sub'):\n            cls = _math_nodes[self.stream.current.type]\n            next(self.stream)\n            right = self.parse_concat()\n            left = cls(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_concat(self):\n        lineno = self.stream.current.lineno\n        args = [self.parse_math2()]\n        while self.stream.current.type == 'tilde':\n            next(self.stream)\n            args.append(self.parse_math2())\n        if len(args) == 1:\n            return args[0]\n        return nodes.Concat(args, lineno=lineno)\n\n    def parse_math2(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_pow()\n        while self.stream.current.type in ('mul', 'div', 'floordiv', 'mod'):\n            cls = _math_nodes[self.stream.current.type]\n            next(self.stream)\n            right = self.parse_pow()\n            left = cls(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_pow(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_unary()\n        while self.stream.current.type == 'pow':\n            next(self.stream)\n            right = self.parse_unary()\n            left = nodes.Pow(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_unary(self, with_filter=True):\n        token_type = self.stream.current.type\n        lineno = self.stream.current.lineno\n        if token_type == 'sub':\n            next(self.stream)\n            node = nodes.Neg(self.parse_unary(False), lineno=lineno)\n        elif token_type == 'add':\n            next(self.stream)\n            node = nodes.Pos(self.parse_unary(False), lineno=lineno)\n        else:\n            node = self.parse_primary()\n        node = self.parse_postfix(node)\n        if with_filter:\n            node = self.parse_filter_expr(node)\n        return node\n\n    def parse_primary(self):\n        token = self.stream.current\n        if token.type == 'name':\n            if token.value in ('true', 'false', 'True', 'False'):\n                node = nodes.Const(token.value in ('true', 'True'),\n                                   lineno=token.lineno)\n            elif token.value in ('none', 'None'):\n                node = nodes.Const(None, lineno=token.lineno)\n            else:\n                node = nodes.Name(token.value, 'load', lineno=token.lineno)\n            next(self.stream)\n        elif token.type == 'string':\n            next(self.stream)\n            buf = [token.value]\n            lineno = token.lineno\n            while self.stream.current.type == 'string':\n                buf.append(self.stream.current.value)\n                next(self.stream)\n            node = nodes.Const(''.join(buf), lineno=lineno)\n        elif token.type in ('integer', 'float'):\n            next(self.stream)\n            node = nodes.Const(token.value, lineno=token.lineno)\n        elif token.type == 'lparen':\n            next(self.stream)\n            node = self.parse_tuple(explicit_parentheses=True)\n            self.stream.expect('rparen')\n        elif token.type == 'lbracket':\n            node = self.parse_list()\n        elif token.type == 'lbrace':\n            node = self.parse_dict()\n        else:\n            self.fail(\"unexpected '%s'\" % describe_token(token), token.lineno)\n        return node\n\n    def parse_tuple(self, simplified=False, with_condexpr=True,\n                    extra_end_rules=None, explicit_parentheses=False):\n        \"\"\"Works like `parse_expression` but if multiple expressions are\n        delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.\n        This method could also return a regular expression instead of a tuple\n        if no commas where found.\n\n        The default parsing mode is a full tuple.  If `simplified` is `True`\n        only names and literals are parsed.  The `no_condexpr` parameter is\n        forwarded to :meth:`parse_expression`.\n\n        Because tuples do not require delimiters and may end in a bogus comma\n        an extra hint is needed that marks the end of a tuple.  For example\n        for loops support tuples between `for` and `in`.  In that case the\n        `extra_end_rules` is set to ``['name:in']``.\n\n        `explicit_parentheses` is true if the parsing was triggered by an\n        expression in parentheses.  This is used to figure out if an empty\n        tuple is a valid expression or not.\n        \"\"\"\n        lineno = self.stream.current.lineno\n        if simplified:\n            parse = self.parse_primary\n        elif with_condexpr:\n            parse = self.parse_expression\n        else:\n            parse = lambda: self.parse_expression(with_condexpr=False)\n        args = []\n        is_tuple = False\n        while 1:\n            if args:\n                self.stream.expect('comma')\n            if self.is_tuple_end(extra_end_rules):\n                break\n            args.append(parse())\n            if self.stream.current.type == 'comma':\n                is_tuple = True\n            else:\n                break\n            lineno = self.stream.current.lineno\n\n        if not is_tuple:\n            if args:\n                return args[0]\n\n            # if we don't have explicit parentheses, an empty tuple is\n            # not a valid expression.  This would mean nothing (literally\n            # nothing) in the spot of an expression would be an empty\n            # tuple.\n            if not explicit_parentheses:\n                self.fail('Expected an expression, got \\'%s\\'' %\n                          describe_token(self.stream.current))\n\n        return nodes.Tuple(args, 'load', lineno=lineno)\n\n    def parse_list(self):\n        token = self.stream.expect('lbracket')\n        items = []\n        while self.stream.current.type != 'rbracket':\n            if items:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'rbracket':\n                break\n            items.append(self.parse_expression())\n        self.stream.expect('rbracket')\n        return nodes.List(items, lineno=token.lineno)\n\n    def parse_dict(self):\n        token = self.stream.expect('lbrace')\n        items = []\n        while self.stream.current.type != 'rbrace':\n            if items:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'rbrace':\n                break\n            key = self.parse_expression()\n            self.stream.expect('colon')\n            value = self.parse_expression()\n            items.append(nodes.Pair(key, value, lineno=key.lineno))\n        self.stream.expect('rbrace')\n        return nodes.Dict(items, lineno=token.lineno)\n\n    def parse_postfix(self, node):\n        while 1:\n            token_type = self.stream.current.type\n            if token_type == 'dot' or token_type == 'lbracket':\n                node = self.parse_subscript(node)\n            # calls are valid both after postfix expressions (getattr\n            # and getitem) as well as filters and tests\n            elif token_type == 'lparen':\n                node = self.parse_call(node)\n            else:\n                break\n        return node\n\n    def parse_filter_expr(self, node):\n        while 1:\n            token_type = self.stream.current.type\n            if token_type == 'pipe':\n                node = self.parse_filter(node)\n            elif token_type == 'name' and self.stream.current.value == 'is':\n                node = self.parse_test(node)\n            # calls are valid both after postfix expressions (getattr\n            # and getitem) as well as filters and tests\n            elif token_type == 'lparen':\n                node = self.parse_call(node)\n            else:\n                break\n        return node\n\n    def parse_subscript(self, node):\n        token = next(self.stream)\n        if token.type == 'dot':\n            attr_token = self.stream.current\n            next(self.stream)\n            if attr_token.type == 'name':\n                return nodes.Getattr(node, attr_token.value, 'load',\n                                     lineno=token.lineno)\n            elif attr_token.type != 'integer':\n                self.fail('expected name or number', attr_token.lineno)\n            arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)\n            return nodes.Getitem(node, arg, 'load', lineno=token.lineno)\n        if token.type == 'lbracket':\n            args = []\n            while self.stream.current.type != 'rbracket':\n                if args:\n                    self.stream.expect('comma')\n                args.append(self.parse_subscribed())\n            self.stream.expect('rbracket')\n            if len(args) == 1:\n                arg = args[0]\n            else:\n                arg = nodes.Tuple(args, 'load', lineno=token.lineno)\n            return nodes.Getitem(node, arg, 'load', lineno=token.lineno)\n        self.fail('expected subscript expression', self.lineno)\n\n    def parse_subscribed(self):\n        lineno = self.stream.current.lineno\n\n        if self.stream.current.type == 'colon':\n            next(self.stream)\n            args = [None]\n        else:\n            node = self.parse_expression()\n            if self.stream.current.type != 'colon':\n                return node\n            next(self.stream)\n            args = [node]\n\n        if self.stream.current.type == 'colon':\n            args.append(None)\n        elif self.stream.current.type not in ('rbracket', 'comma'):\n            args.append(self.parse_expression())\n        else:\n            args.append(None)\n\n        if self.stream.current.type == 'colon':\n            next(self.stream)\n            if self.stream.current.type not in ('rbracket', 'comma'):\n                args.append(self.parse_expression())\n            else:\n                args.append(None)\n        else:\n            args.append(None)\n\n        return nodes.Slice(lineno=lineno, *args)\n\n    def parse_call(self, node):\n        token = self.stream.expect('lparen')\n        args = []\n        kwargs = []\n        dyn_args = dyn_kwargs = None\n        require_comma = False\n\n        def ensure(expr):\n            if not expr:\n                self.fail('invalid syntax for function call expression',\n                          token.lineno)\n\n        while self.stream.current.type != 'rparen':\n            if require_comma:\n                self.stream.expect('comma')\n                # support for trailing comma\n                if self.stream.current.type == 'rparen':\n                    break\n            if self.stream.current.type == 'mul':\n                ensure(dyn_args is None and dyn_kwargs is None)\n                next(self.stream)\n                dyn_args = self.parse_expression()\n            elif self.stream.current.type == 'pow':\n                ensure(dyn_kwargs is None)\n                next(self.stream)\n                dyn_kwargs = self.parse_expression()\n            else:\n                ensure(dyn_args is None and dyn_kwargs is None)\n                if self.stream.current.type == 'name' and \\\n                   self.stream.look().type == 'assign':\n                    key = self.stream.current.value\n                    self.stream.skip(2)\n                    value = self.parse_expression()\n                    kwargs.append(nodes.Keyword(key, value,\n                                                lineno=value.lineno))\n                else:\n                    ensure(not kwargs)\n                    args.append(self.parse_expression())\n\n            require_comma = True\n        self.stream.expect('rparen')\n\n        if node is None:\n            return args, kwargs, dyn_args, dyn_kwargs\n        return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs,\n                          lineno=token.lineno)\n\n    def parse_filter(self, node, start_inline=False):\n        while self.stream.current.type == 'pipe' or start_inline:\n            if not start_inline:\n                next(self.stream)\n            token = self.stream.expect('name')\n            name = token.value\n            while self.stream.current.type == 'dot':\n                next(self.stream)\n                name += '.' + self.stream.expect('name').value\n            if self.stream.current.type == 'lparen':\n                args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)\n            else:\n                args = []\n                kwargs = []\n                dyn_args = dyn_kwargs = None\n            node = nodes.Filter(node, name, args, kwargs, dyn_args,\n                                dyn_kwargs, lineno=token.lineno)\n            start_inline = False\n        return node\n\n    def parse_test(self, node):\n        token = next(self.stream)\n        if self.stream.current.test('name:not'):\n            next(self.stream)\n            negated = True\n        else:\n            negated = False\n        name = self.stream.expect('name').value\n        while self.stream.current.type == 'dot':\n            next(self.stream)\n            name += '.' + self.stream.expect('name').value\n        dyn_args = dyn_kwargs = None\n        kwargs = []\n        if self.stream.current.type == 'lparen':\n            args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)\n        elif (self.stream.current.type in ('name', 'string', 'integer',\n                                           'float', 'lparen', 'lbracket',\n                                           'lbrace') and not\n              self.stream.current.test_any('name:else', 'name:or',\n                                           'name:and')):\n            if self.stream.current.test('name:is'):\n                self.fail('You cannot chain multiple tests with is')\n            args = [self.parse_primary()]\n        else:\n            args = []\n        node = nodes.Test(node, name, args, kwargs, dyn_args,\n                          dyn_kwargs, lineno=token.lineno)\n        if negated:\n            node = nodes.Not(node, lineno=token.lineno)\n        return node\n\n    def subparse(self, end_tokens=None):\n        body = []\n        data_buffer = []\n        add_data = data_buffer.append\n\n        if end_tokens is not None:\n            self._end_token_stack.append(end_tokens)\n\n        def flush_data():\n            if data_buffer:\n                lineno = data_buffer[0].lineno\n                body.append(nodes.Output(data_buffer[:], lineno=lineno))\n                del data_buffer[:]\n\n        try:\n            while self.stream:\n                token = self.stream.current\n                if token.type == 'data':\n                    if token.value:\n                        add_data(nodes.TemplateData(token.value,\n                                                    lineno=token.lineno))\n                    next(self.stream)\n                elif token.type == 'variable_begin':\n                    next(self.stream)\n                    add_data(self.parse_tuple(with_condexpr=True))\n                    self.stream.expect('variable_end')\n                elif token.type == 'block_begin':\n                    flush_data()\n                    next(self.stream)\n                    if end_tokens is not None and \\\n                       self.stream.current.test_any(*end_tokens):\n                        return body\n                    rv = self.parse_statement()\n                    if isinstance(rv, list):\n                        body.extend(rv)\n                    else:\n                        body.append(rv)\n                    self.stream.expect('block_end')\n                else:\n                    raise AssertionError('internal parsing error')\n\n            flush_data()\n        finally:\n            if end_tokens is not None:\n                self._end_token_stack.pop()\n\n        return body\n\n    def parse(self):\n        \"\"\"Parse the whole template into a `Template` node.\"\"\"\n        result = nodes.Template(self.subparse(), lineno=1)\n        result.set_environment(self.environment)\n        return result\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/runtime.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.runtime\n    ~~~~~~~~~~~~~~\n\n    Runtime helpers.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport sys\n\nfrom itertools import chain\nfrom types import MethodType\n\nfrom jinja2.nodes import EvalContext, _context_function_types\nfrom jinja2.utils import Markup, soft_unicode, escape, missing, concat, \\\n     internalcode, object_type_repr, evalcontextfunction, Namespace\nfrom jinja2.exceptions import UndefinedError, TemplateRuntimeError, \\\n     TemplateNotFound\nfrom jinja2._compat import imap, text_type, iteritems, \\\n     implements_iterator, implements_to_string, string_types, PY2, \\\n     with_metaclass, abc\n\n\n# these variables are exported to the template runtime\n__all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',\n           'TemplateRuntimeError', 'missing', 'concat', 'escape',\n           'markup_join', 'unicode_join', 'to_string', 'identity',\n           'TemplateNotFound', 'Namespace']\n\n#: the name of the function that is used to convert something into\n#: a string.  We can just use the text type here.\nto_string = text_type\n\n#: the identity function.  Useful for certain things in the environment\nidentity = lambda x: x\n\n_first_iteration = object()\n_last_iteration = object()\n\n\ndef markup_join(seq):\n    \"\"\"Concatenation that escapes if necessary and converts to unicode.\"\"\"\n    buf = []\n    iterator = imap(soft_unicode, seq)\n    for arg in iterator:\n        buf.append(arg)\n        if hasattr(arg, '__html__'):\n            return Markup(u'').join(chain(buf, iterator))\n    return concat(buf)\n\n\ndef unicode_join(seq):\n    \"\"\"Simple args to unicode conversion and concatenation.\"\"\"\n    return concat(imap(text_type, seq))\n\n\ndef new_context(environment, template_name, blocks, vars=None,\n                shared=None, globals=None, locals=None):\n    \"\"\"Internal helper to for context creation.\"\"\"\n    if vars is None:\n        vars = {}\n    if shared:\n        parent = vars\n    else:\n        parent = dict(globals or (), **vars)\n    if locals:\n        # if the parent is shared a copy should be created because\n        # we don't want to modify the dict passed\n        if shared:\n            parent = dict(parent)\n        for key, value in iteritems(locals):\n            if value is not missing:\n                parent[key] = value\n    return environment.context_class(environment, parent, template_name,\n                                     blocks)\n\n\nclass TemplateReference(object):\n    \"\"\"The `self` in templates.\"\"\"\n\n    def __init__(self, context):\n        self.__context = context\n\n    def __getitem__(self, name):\n        blocks = self.__context.blocks[name]\n        return BlockReference(name, self.__context, blocks, 0)\n\n    def __repr__(self):\n        return '<%s %r>' % (\n            self.__class__.__name__,\n            self.__context.name\n        )\n\n\ndef _get_func(x):\n    return getattr(x, '__func__', x)\n\n\nclass ContextMeta(type):\n\n    def __new__(cls, name, bases, d):\n        rv = type.__new__(cls, name, bases, d)\n        if bases == ():\n            return rv\n\n        resolve = _get_func(rv.resolve)\n        default_resolve = _get_func(Context.resolve)\n        resolve_or_missing = _get_func(rv.resolve_or_missing)\n        default_resolve_or_missing = _get_func(Context.resolve_or_missing)\n\n        # If we have a changed resolve but no changed default or missing\n        # resolve we invert the call logic.\n        if resolve is not default_resolve and \\\n           resolve_or_missing is default_resolve_or_missing:\n            rv._legacy_resolve_mode = True\n        elif resolve is default_resolve and \\\n             resolve_or_missing is default_resolve_or_missing:\n            rv._fast_resolve_mode = True\n\n        return rv\n\n\ndef resolve_or_missing(context, key, missing=missing):\n    if key in context.vars:\n        return context.vars[key]\n    if key in context.parent:\n        return context.parent[key]\n    return missing\n\n\nclass Context(with_metaclass(ContextMeta)):\n    \"\"\"The template context holds the variables of a template.  It stores the\n    values passed to the template and also the names the template exports.\n    Creating instances is neither supported nor useful as it's created\n    automatically at various stages of the template evaluation and should not\n    be created by hand.\n\n    The context is immutable.  Modifications on :attr:`parent` **must not**\n    happen and modifications on :attr:`vars` are allowed from generated\n    template code only.  Template filters and global functions marked as\n    :func:`contextfunction`\\\\s get the active context passed as first argument\n    and are allowed to access the context read-only.\n\n    The template context supports read only dict operations (`get`,\n    `keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`,\n    `__getitem__`, `__contains__`).  Additionally there is a :meth:`resolve`\n    method that doesn't fail with a `KeyError` but returns an\n    :class:`Undefined` object for missing variables.\n    \"\"\"\n    # XXX: we want to eventually make this be a deprecation warning and\n    # remove it.\n    _legacy_resolve_mode = False\n    _fast_resolve_mode = False\n\n    def __init__(self, environment, parent, name, blocks):\n        self.parent = parent\n        self.vars = {}\n        self.environment = environment\n        self.eval_ctx = EvalContext(self.environment, name)\n        self.exported_vars = set()\n        self.name = name\n\n        # create the initial mapping of blocks.  Whenever template inheritance\n        # takes place the runtime will update this mapping with the new blocks\n        # from the template.\n        self.blocks = dict((k, [v]) for k, v in iteritems(blocks))\n\n        # In case we detect the fast resolve mode we can set up an alias\n        # here that bypasses the legacy code logic.\n        if self._fast_resolve_mode:\n            self.resolve_or_missing = MethodType(resolve_or_missing, self)\n\n    def super(self, name, current):\n        \"\"\"Render a parent block.\"\"\"\n        try:\n            blocks = self.blocks[name]\n            index = blocks.index(current) + 1\n            blocks[index]\n        except LookupError:\n            return self.environment.undefined('there is no parent block '\n                                              'called %r.' % name,\n                                              name='super')\n        return BlockReference(name, self, blocks, index)\n\n    def get(self, key, default=None):\n        \"\"\"Returns an item from the template context, if it doesn't exist\n        `default` is returned.\n        \"\"\"\n        try:\n            return self[key]\n        except KeyError:\n            return default\n\n    def resolve(self, key):\n        \"\"\"Looks up a variable like `__getitem__` or `get` but returns an\n        :class:`Undefined` object with the name of the name looked up.\n        \"\"\"\n        if self._legacy_resolve_mode:\n            rv = resolve_or_missing(self, key)\n        else:\n            rv = self.resolve_or_missing(key)\n        if rv is missing:\n            return self.environment.undefined(name=key)\n        return rv\n\n    def resolve_or_missing(self, key):\n        \"\"\"Resolves a variable like :meth:`resolve` but returns the\n        special `missing` value if it cannot be found.\n        \"\"\"\n        if self._legacy_resolve_mode:\n            rv = self.resolve(key)\n            if isinstance(rv, Undefined):\n                rv = missing\n            return rv\n        return resolve_or_missing(self, key)\n\n    def get_exported(self):\n        \"\"\"Get a new dict with the exported variables.\"\"\"\n        return dict((k, self.vars[k]) for k in self.exported_vars)\n\n    def get_all(self):\n        \"\"\"Return the complete context as dict including the exported\n        variables.  For optimizations reasons this might not return an\n        actual copy so be careful with using it.\n        \"\"\"\n        if not self.vars:\n            return self.parent\n        if not self.parent:\n            return self.vars\n        return dict(self.parent, **self.vars)\n\n    @internalcode\n    def call(__self, __obj, *args, **kwargs):\n        \"\"\"Call the callable with the arguments and keyword arguments\n        provided but inject the active context or environment as first\n        argument if the callable is a :func:`contextfunction` or\n        :func:`environmentfunction`.\n        \"\"\"\n        if __debug__:\n            __traceback_hide__ = True  # noqa\n\n        # Allow callable classes to take a context\n        if hasattr(__obj, '__call__'):\n            fn = __obj.__call__\n            for fn_type in ('contextfunction',\n                            'evalcontextfunction',\n                            'environmentfunction'):\n                if hasattr(fn, fn_type):\n                    __obj = fn\n                    break\n\n        if isinstance(__obj, _context_function_types):\n            if getattr(__obj, 'contextfunction', 0):\n                args = (__self,) + args\n            elif getattr(__obj, 'evalcontextfunction', 0):\n                args = (__self.eval_ctx,) + args\n            elif getattr(__obj, 'environmentfunction', 0):\n                args = (__self.environment,) + args\n        try:\n            return __obj(*args, **kwargs)\n        except StopIteration:\n            return __self.environment.undefined('value was undefined because '\n                                                'a callable raised a '\n                                                'StopIteration exception')\n\n    def derived(self, locals=None):\n        \"\"\"Internal helper function to create a derived context.  This is\n        used in situations where the system needs a new context in the same\n        template that is independent.\n        \"\"\"\n        context = new_context(self.environment, self.name, {},\n                              self.get_all(), True, None, locals)\n        context.eval_ctx = self.eval_ctx\n        context.blocks.update((k, list(v)) for k, v in iteritems(self.blocks))\n        return context\n\n    def _all(meth):\n        proxy = lambda self: getattr(self.get_all(), meth)()\n        proxy.__doc__ = getattr(dict, meth).__doc__\n        proxy.__name__ = meth\n        return proxy\n\n    keys = _all('keys')\n    values = _all('values')\n    items = _all('items')\n\n    # not available on python 3\n    if PY2:\n        iterkeys = _all('iterkeys')\n        itervalues = _all('itervalues')\n        iteritems = _all('iteritems')\n    del _all\n\n    def __contains__(self, name):\n        return name in self.vars or name in self.parent\n\n    def __getitem__(self, key):\n        \"\"\"Lookup a variable or raise `KeyError` if the variable is\n        undefined.\n        \"\"\"\n        item = self.resolve_or_missing(key)\n        if item is missing:\n            raise KeyError(key)\n        return item\n\n    def __repr__(self):\n        return '<%s %s of %r>' % (\n            self.__class__.__name__,\n            repr(self.get_all()),\n            self.name\n        )\n\n\nabc.Mapping.register(Context)\n\n\nclass BlockReference(object):\n    \"\"\"One block on a template reference.\"\"\"\n\n    def __init__(self, name, context, stack, depth):\n        self.name = name\n        self._context = context\n        self._stack = stack\n        self._depth = depth\n\n    @property\n    def super(self):\n        \"\"\"Super the block.\"\"\"\n        if self._depth + 1 >= len(self._stack):\n            return self._context.environment. \\\n                undefined('there is no parent block called %r.' %\n                          self.name, name='super')\n        return BlockReference(self.name, self._context, self._stack,\n                              self._depth + 1)\n\n    @internalcode\n    def __call__(self):\n        rv = concat(self._stack[self._depth](self._context))\n        if self._context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv\n\n\nclass LoopContextBase(object):\n    \"\"\"A loop context for dynamic iteration.\"\"\"\n\n    _before = _first_iteration\n    _current = _first_iteration\n    _after = _last_iteration\n    _length = None\n\n    def __init__(self, undefined, recurse=None, depth0=0):\n        self._undefined = undefined\n        self._recurse = recurse\n        self.index0 = -1\n        self.depth0 = depth0\n        self._last_checked_value = missing\n\n    def cycle(self, *args):\n        \"\"\"Cycles among the arguments with the current loop index.\"\"\"\n        if not args:\n            raise TypeError('no items for cycling given')\n        return args[self.index0 % len(args)]\n\n    def changed(self, *value):\n        \"\"\"Checks whether the value has changed since the last call.\"\"\"\n        if self._last_checked_value != value:\n            self._last_checked_value = value\n            return True\n        return False\n\n    first = property(lambda x: x.index0 == 0)\n    last = property(lambda x: x._after is _last_iteration)\n    index = property(lambda x: x.index0 + 1)\n    revindex = property(lambda x: x.length - x.index0)\n    revindex0 = property(lambda x: x.length - x.index)\n    depth = property(lambda x: x.depth0 + 1)\n\n    @property\n    def previtem(self):\n        if self._before is _first_iteration:\n            return self._undefined('there is no previous item')\n        return self._before\n\n    @property\n    def nextitem(self):\n        if self._after is _last_iteration:\n            return self._undefined('there is no next item')\n        return self._after\n\n    def __len__(self):\n        return self.length\n\n    @internalcode\n    def loop(self, iterable):\n        if self._recurse is None:\n            raise TypeError('Tried to call non recursive loop.  Maybe you '\n                            \"forgot the 'recursive' modifier.\")\n        return self._recurse(iterable, self._recurse, self.depth0 + 1)\n\n    # a nifty trick to enhance the error message if someone tried to call\n    # the the loop without or with too many arguments.\n    __call__ = loop\n    del loop\n\n    def __repr__(self):\n        return '<%s %r/%r>' % (\n            self.__class__.__name__,\n            self.index,\n            self.length\n        )\n\n\nclass LoopContext(LoopContextBase):\n\n    def __init__(self, iterable, undefined, recurse=None, depth0=0):\n        LoopContextBase.__init__(self, undefined, recurse, depth0)\n        self._iterator = iter(iterable)\n\n        # try to get the length of the iterable early.  This must be done\n        # here because there are some broken iterators around where there\n        # __len__ is the number of iterations left (i'm looking at your\n        # listreverseiterator!).\n        try:\n            self._length = len(iterable)\n        except (TypeError, AttributeError):\n            self._length = None\n        self._after = self._safe_next()\n\n    @property\n    def length(self):\n        if self._length is None:\n            # if was not possible to get the length of the iterator when\n            # the loop context was created (ie: iterating over a generator)\n            # we have to convert the iterable into a sequence and use the\n            # length of that + the number of iterations so far.\n            iterable = tuple(self._iterator)\n            self._iterator = iter(iterable)\n            iterations_done = self.index0 + 2\n            self._length = len(iterable) + iterations_done\n        return self._length\n\n    def __iter__(self):\n        return LoopContextIterator(self)\n\n    def _safe_next(self):\n        try:\n            return next(self._iterator)\n        except StopIteration:\n            return _last_iteration\n\n\n@implements_iterator\nclass LoopContextIterator(object):\n    \"\"\"The iterator for a loop context.\"\"\"\n    __slots__ = ('context',)\n\n    def __init__(self, context):\n        self.context = context\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        ctx = self.context\n        ctx.index0 += 1\n        if ctx._after is _last_iteration:\n            raise StopIteration()\n        ctx._before = ctx._current\n        ctx._current = ctx._after\n        ctx._after = ctx._safe_next()\n        return ctx._current, ctx\n\n\nclass Macro(object):\n    \"\"\"Wraps a macro function.\"\"\"\n\n    def __init__(self, environment, func, name, arguments,\n                 catch_kwargs, catch_varargs, caller,\n                 default_autoescape=None):\n        self._environment = environment\n        self._func = func\n        self._argument_count = len(arguments)\n        self.name = name\n        self.arguments = arguments\n        self.catch_kwargs = catch_kwargs\n        self.catch_varargs = catch_varargs\n        self.caller = caller\n        self.explicit_caller = 'caller' in arguments\n        if default_autoescape is None:\n            default_autoescape = environment.autoescape\n        self._default_autoescape = default_autoescape\n\n    @internalcode\n    @evalcontextfunction\n    def __call__(self, *args, **kwargs):\n        # This requires a bit of explanation,  In the past we used to\n        # decide largely based on compile-time information if a macro is\n        # safe or unsafe.  While there was a volatile mode it was largely\n        # unused for deciding on escaping.  This turns out to be\n        # problemtic for macros because if a macro is safe or not not so\n        # much depends on the escape mode when it was defined but when it\n        # was used.\n        #\n        # Because however we export macros from the module system and\n        # there are historic callers that do not pass an eval context (and\n        # will continue to not pass one), we need to perform an instance\n        # check here.\n        #\n        # This is considered safe because an eval context is not a valid\n        # argument to callables otherwise anwyays.  Worst case here is\n        # that if no eval context is passed we fall back to the compile\n        # time autoescape flag.\n        if args and isinstance(args[0], EvalContext):\n            autoescape = args[0].autoescape\n            args = args[1:]\n        else:\n            autoescape = self._default_autoescape\n\n        # try to consume the positional arguments\n        arguments = list(args[:self._argument_count])\n        off = len(arguments)\n\n        # For information why this is necessary refer to the handling\n        # of caller in the `macro_body` handler in the compiler.\n        found_caller = False\n\n        # if the number of arguments consumed is not the number of\n        # arguments expected we start filling in keyword arguments\n        # and defaults.\n        if off != self._argument_count:\n            for idx, name in enumerate(self.arguments[len(arguments):]):\n                try:\n                    value = kwargs.pop(name)\n                except KeyError:\n                    value = missing\n                if name == 'caller':\n                    found_caller = True\n                arguments.append(value)\n        else:\n            found_caller = self.explicit_caller\n\n        # it's important that the order of these arguments does not change\n        # if not also changed in the compiler's `function_scoping` method.\n        # the order is caller, keyword arguments, positional arguments!\n        if self.caller and not found_caller:\n            caller = kwargs.pop('caller', None)\n            if caller is None:\n                caller = self._environment.undefined('No caller defined',\n                                                     name='caller')\n            arguments.append(caller)\n\n        if self.catch_kwargs:\n            arguments.append(kwargs)\n        elif kwargs:\n            if 'caller' in kwargs:\n                raise TypeError('macro %r was invoked with two values for '\n                                'the special caller argument.  This is '\n                                'most likely a bug.' % self.name)\n            raise TypeError('macro %r takes no keyword argument %r' %\n                            (self.name, next(iter(kwargs))))\n        if self.catch_varargs:\n            arguments.append(args[self._argument_count:])\n        elif len(args) > self._argument_count:\n            raise TypeError('macro %r takes not more than %d argument(s)' %\n                            (self.name, len(self.arguments)))\n\n        return self._invoke(arguments, autoescape)\n\n    def _invoke(self, arguments, autoescape):\n        \"\"\"This method is being swapped out by the async implementation.\"\"\"\n        rv = self._func(*arguments)\n        if autoescape:\n            rv = Markup(rv)\n        return rv\n\n    def __repr__(self):\n        return '<%s %s>' % (\n            self.__class__.__name__,\n            self.name is None and 'anonymous' or repr(self.name)\n        )\n\n\n@implements_to_string\nclass Undefined(object):\n    \"\"\"The default undefined type.  This undefined type can be printed and\n    iterated over, but every other access will raise an :exc:`jinja2.exceptions.UndefinedError`:\n\n    >>> foo = Undefined(name='foo')\n    >>> str(foo)\n    ''\n    >>> not foo\n    True\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ('_undefined_hint', '_undefined_obj', '_undefined_name',\n                 '_undefined_exception')\n\n    def __init__(self, hint=None, obj=missing, name=None, exc=UndefinedError):\n        self._undefined_hint = hint\n        self._undefined_obj = obj\n        self._undefined_name = name\n        self._undefined_exception = exc\n\n    @internalcode\n    def _fail_with_undefined_error(self, *args, **kwargs):\n        \"\"\"Regular callback function for undefined objects that raises an\n        `jinja2.exceptions.UndefinedError` on call.\n        \"\"\"\n        if self._undefined_hint is None:\n            if self._undefined_obj is missing:\n                hint = '%r is undefined' % self._undefined_name\n            elif not isinstance(self._undefined_name, string_types):\n                hint = '%s has no element %r' % (\n                    object_type_repr(self._undefined_obj),\n                    self._undefined_name\n                )\n            else:\n                hint = '%r has no attribute %r' % (\n                    object_type_repr(self._undefined_obj),\n                    self._undefined_name\n                )\n        else:\n            hint = self._undefined_hint\n        raise self._undefined_exception(hint)\n\n    @internalcode\n    def __getattr__(self, name):\n        if name[:2] == '__':\n            raise AttributeError(name)\n        return self._fail_with_undefined_error()\n\n    __add__ = __radd__ = __mul__ = __rmul__ = __div__ = __rdiv__ = \\\n        __truediv__ = __rtruediv__ = __floordiv__ = __rfloordiv__ = \\\n        __mod__ = __rmod__ = __pos__ = __neg__ = __call__ = \\\n        __getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \\\n        __float__ = __complex__ = __pow__ = __rpow__ = __sub__ = \\\n        __rsub__ = _fail_with_undefined_error\n\n    def __eq__(self, other):\n        return type(self) is type(other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __hash__(self):\n        return id(type(self))\n\n    def __str__(self):\n        return u''\n\n    def __len__(self):\n        return 0\n\n    def __iter__(self):\n        if 0:\n            yield None\n\n    def __nonzero__(self):\n        return False\n    __bool__ = __nonzero__\n\n    def __repr__(self):\n        return 'Undefined'\n\n\ndef make_logging_undefined(logger=None, base=None):\n    \"\"\"Given a logger object this returns a new undefined class that will\n    log certain failures.  It will log iterations and printing.  If no\n    logger is given a default logger is created.\n\n    Example::\n\n        logger = logging.getLogger(__name__)\n        LoggingUndefined = make_logging_undefined(\n            logger=logger,\n            base=Undefined\n        )\n\n    .. versionadded:: 2.8\n\n    :param logger: the logger to use.  If not provided, a default logger\n                   is created.\n    :param base: the base class to add logging functionality to.  This\n                 defaults to :class:`Undefined`.\n    \"\"\"\n    if logger is None:\n        import logging\n        logger = logging.getLogger(__name__)\n        logger.addHandler(logging.StreamHandler(sys.stderr))\n    if base is None:\n        base = Undefined\n\n    def _log_message(undef):\n        if undef._undefined_hint is None:\n            if undef._undefined_obj is missing:\n                hint = '%s is undefined' % undef._undefined_name\n            elif not isinstance(undef._undefined_name, string_types):\n                hint = '%s has no element %s' % (\n                    object_type_repr(undef._undefined_obj),\n                    undef._undefined_name)\n            else:\n                hint = '%s has no attribute %s' % (\n                    object_type_repr(undef._undefined_obj),\n                    undef._undefined_name)\n        else:\n            hint = undef._undefined_hint\n        logger.warning('Template variable warning: %s', hint)\n\n    class LoggingUndefined(base):\n\n        def _fail_with_undefined_error(self, *args, **kwargs):\n            try:\n                return base._fail_with_undefined_error(self, *args, **kwargs)\n            except self._undefined_exception as e:\n                logger.error('Template variable error: %s', str(e))\n                raise e\n\n        def __str__(self):\n            rv = base.__str__(self)\n            _log_message(self)\n            return rv\n\n        def __iter__(self):\n            rv = base.__iter__(self)\n            _log_message(self)\n            return rv\n\n        if PY2:\n            def __nonzero__(self):\n                rv = base.__nonzero__(self)\n                _log_message(self)\n                return rv\n\n            def __unicode__(self):\n                rv = base.__unicode__(self)\n                _log_message(self)\n                return rv\n        else:\n            def __bool__(self):\n                rv = base.__bool__(self)\n                _log_message(self)\n                return rv\n\n    return LoggingUndefined\n\n\n@implements_to_string\nclass DebugUndefined(Undefined):\n    \"\"\"An undefined that returns the debug info when printed.\n\n    >>> foo = DebugUndefined(name='foo')\n    >>> str(foo)\n    '{{ foo }}'\n    >>> not foo\n    True\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ()\n\n    def __str__(self):\n        if self._undefined_hint is None:\n            if self._undefined_obj is missing:\n                return u'{{ %s }}' % self._undefined_name\n            return '{{ no such element: %s[%r] }}' % (\n                object_type_repr(self._undefined_obj),\n                self._undefined_name\n            )\n        return u'{{ undefined value printed: %s }}' % self._undefined_hint\n\n\n@implements_to_string\nclass StrictUndefined(Undefined):\n    \"\"\"An undefined that barks on print and iteration as well as boolean\n    tests and all kinds of comparisons.  In other words: you can do nothing\n    with it except checking if it's defined using the `defined` test.\n\n    >>> foo = StrictUndefined(name='foo')\n    >>> str(foo)\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    >>> not foo\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ()\n    __iter__ = __str__ = __len__ = __nonzero__ = __eq__ = \\\n        __ne__ = __bool__ = __hash__ = \\\n        Undefined._fail_with_undefined_error\n\n\n# remove remaining slots attributes, after the metaclass did the magic they\n# are unneeded and irritating as they contain wrong data for the subclasses.\ndel Undefined.__slots__, DebugUndefined.__slots__, StrictUndefined.__slots__\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/sandbox.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.sandbox\n    ~~~~~~~~~~~~~~\n\n    Adds a sandbox layer to Jinja as it was the default behavior in the old\n    Jinja 1 releases.  This sandbox is slightly different from Jinja 1 as the\n    default behavior is easier to use.\n\n    The behavior can be changed by subclassing the environment.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport types\nimport operator\nfrom jinja2.environment import Environment\nfrom jinja2.exceptions import SecurityError\nfrom jinja2._compat import string_types, PY2, abc, range_type\nfrom jinja2.utils import Markup\n\nfrom markupsafe import EscapeFormatter\nfrom string import Formatter\n\n\n#: maximum number of items a range may produce\nMAX_RANGE = 100000\n\n#: attributes of function objects that are considered unsafe.\nif PY2:\n    UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',\n                                      'func_defaults', 'func_globals'])\nelse:\n    # On versions > python 2 the special attributes on functions are gone,\n    # but they remain on methods and generators for whatever reason.\n    UNSAFE_FUNCTION_ATTRIBUTES = set()\n\n\n#: unsafe method attributes.  function attributes are unsafe for methods too\nUNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])\n\n#: unsafe generator attirbutes.\nUNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])\n\n#: unsafe attributes on coroutines\nUNSAFE_COROUTINE_ATTRIBUTES = set(['cr_frame', 'cr_code'])\n\n#: unsafe attributes on async generators\nUNSAFE_ASYNC_GENERATOR_ATTRIBUTES = set(['ag_code', 'ag_frame'])\n\nimport warnings\n\n# make sure we don't warn in python 2.6 about stuff we don't care about\nwarnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,\n                        module='jinja2.sandbox')\n\nfrom collections import deque\n\n_mutable_set_types = (set,)\n_mutable_mapping_types = (dict,)\n_mutable_sequence_types = (list,)\n\n\n# on python 2.x we can register the user collection types\ntry:\n    from UserDict import UserDict, DictMixin\n    from UserList import UserList\n    _mutable_mapping_types += (UserDict, DictMixin)\n    _mutable_set_types += (UserList,)\nexcept ImportError:\n    pass\n\n# if sets is still available, register the mutable set from there as well\ntry:\n    from sets import Set\n    _mutable_set_types += (Set,)\nexcept ImportError:\n    pass\n\n#: register Python 2.6 abstract base classes\n_mutable_set_types += (abc.MutableSet,)\n_mutable_mapping_types += (abc.MutableMapping,)\n_mutable_sequence_types += (abc.MutableSequence,)\n\n\n_mutable_spec = (\n    (_mutable_set_types, frozenset([\n        'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',\n        'symmetric_difference_update', 'update'\n    ])),\n    (_mutable_mapping_types, frozenset([\n        'clear', 'pop', 'popitem', 'setdefault', 'update'\n    ])),\n    (_mutable_sequence_types, frozenset([\n        'append', 'reverse', 'insert', 'sort', 'extend', 'remove'\n    ])),\n    (deque, frozenset([\n        'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',\n        'popleft', 'remove', 'rotate'\n    ]))\n)\n\n\nclass _MagicFormatMapping(abc.Mapping):\n    \"\"\"This class implements a dummy wrapper to fix a bug in the Python\n    standard library for string formatting.\n\n    See https://bugs.python.org/issue13598 for information about why\n    this is necessary.\n    \"\"\"\n\n    def __init__(self, args, kwargs):\n        self._args = args\n        self._kwargs = kwargs\n        self._last_index = 0\n\n    def __getitem__(self, key):\n        if key == '':\n            idx = self._last_index\n            self._last_index += 1\n            try:\n                return self._args[idx]\n            except LookupError:\n                pass\n            key = str(idx)\n        return self._kwargs[key]\n\n    def __iter__(self):\n        return iter(self._kwargs)\n\n    def __len__(self):\n        return len(self._kwargs)\n\n\ndef inspect_format_method(callable):\n    if not isinstance(callable, (types.MethodType,\n                                 types.BuiltinMethodType)) or \\\n       callable.__name__ not in ('format', 'format_map'):\n        return None\n    obj = callable.__self__\n    if isinstance(obj, string_types):\n        return obj\n\n\ndef safe_range(*args):\n    \"\"\"A range that can't generate ranges with a length of more than\n    MAX_RANGE items.\n    \"\"\"\n    rng = range_type(*args)\n\n    if len(rng) > MAX_RANGE:\n        raise OverflowError(\n            \"Range too big. The sandbox blocks ranges larger than\"\n            \" MAX_RANGE (%d).\" % MAX_RANGE\n        )\n\n    return rng\n\n\ndef unsafe(f):\n    \"\"\"Marks a function or method as unsafe.\n\n    ::\n\n        @unsafe\n        def delete(self):\n            pass\n    \"\"\"\n    f.unsafe_callable = True\n    return f\n\n\ndef is_internal_attribute(obj, attr):\n    \"\"\"Test if the attribute given is an internal python attribute.  For\n    example this function returns `True` for the `func_code` attribute of\n    python objects.  This is useful if the environment method\n    :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.\n\n    >>> from jinja2.sandbox import is_internal_attribute\n    >>> is_internal_attribute(str, \"mro\")\n    True\n    >>> is_internal_attribute(str, \"upper\")\n    False\n    \"\"\"\n    if isinstance(obj, types.FunctionType):\n        if attr in UNSAFE_FUNCTION_ATTRIBUTES:\n            return True\n    elif isinstance(obj, types.MethodType):\n        if attr in UNSAFE_FUNCTION_ATTRIBUTES or \\\n           attr in UNSAFE_METHOD_ATTRIBUTES:\n            return True\n    elif isinstance(obj, type):\n        if attr == 'mro':\n            return True\n    elif isinstance(obj, (types.CodeType, types.TracebackType, types.FrameType)):\n        return True\n    elif isinstance(obj, types.GeneratorType):\n        if attr in UNSAFE_GENERATOR_ATTRIBUTES:\n            return True\n    elif hasattr(types, 'CoroutineType') and isinstance(obj, types.CoroutineType):\n        if attr in UNSAFE_COROUTINE_ATTRIBUTES:\n            return True\n    elif hasattr(types, 'AsyncGeneratorType') and isinstance(obj, types.AsyncGeneratorType):\n        if attr in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:\n            return True\n    return attr.startswith('__')\n\n\ndef modifies_known_mutable(obj, attr):\n    \"\"\"This function checks if an attribute on a builtin mutable object\n    (list, dict, set or deque) would modify it if called.  It also supports\n    the \"user\"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and\n    with Python 2.6 onwards the abstract base classes `MutableSet`,\n    `MutableMapping`, and `MutableSequence`.\n\n    >>> modifies_known_mutable({}, \"clear\")\n    True\n    >>> modifies_known_mutable({}, \"keys\")\n    False\n    >>> modifies_known_mutable([], \"append\")\n    True\n    >>> modifies_known_mutable([], \"index\")\n    False\n\n    If called with an unsupported object (such as unicode) `False` is\n    returned.\n\n    >>> modifies_known_mutable(\"foo\", \"upper\")\n    False\n    \"\"\"\n    for typespec, unsafe in _mutable_spec:\n        if isinstance(obj, typespec):\n            return attr in unsafe\n    return False\n\n\nclass SandboxedEnvironment(Environment):\n    \"\"\"The sandboxed environment.  It works like the regular environment but\n    tells the compiler to generate sandboxed code.  Additionally subclasses of\n    this environment may override the methods that tell the runtime what\n    attributes or functions are safe to access.\n\n    If the template tries to access insecure code a :exc:`SecurityError` is\n    raised.  However also other exceptions may occur during the rendering so\n    the caller has to ensure that all exceptions are caught.\n    \"\"\"\n    sandboxed = True\n\n    #: default callback table for the binary operators.  A copy of this is\n    #: available on each instance of a sandboxed environment as\n    #: :attr:`binop_table`\n    default_binop_table = {\n        '+':        operator.add,\n        '-':        operator.sub,\n        '*':        operator.mul,\n        '/':        operator.truediv,\n        '//':       operator.floordiv,\n        '**':       operator.pow,\n        '%':        operator.mod\n    }\n\n    #: default callback table for the unary operators.  A copy of this is\n    #: available on each instance of a sandboxed environment as\n    #: :attr:`unop_table`\n    default_unop_table = {\n        '+':        operator.pos,\n        '-':        operator.neg\n    }\n\n    #: a set of binary operators that should be intercepted.  Each operator\n    #: that is added to this set (empty by default) is delegated to the\n    #: :meth:`call_binop` method that will perform the operator.  The default\n    #: operator callback is specified by :attr:`binop_table`.\n    #:\n    #: The following binary operators are interceptable:\n    #: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``\n    #:\n    #: The default operation form the operator table corresponds to the\n    #: builtin function.  Intercepted calls are always slower than the native\n    #: operator call, so make sure only to intercept the ones you are\n    #: interested in.\n    #:\n    #: .. versionadded:: 2.6\n    intercepted_binops = frozenset()\n\n    #: a set of unary operators that should be intercepted.  Each operator\n    #: that is added to this set (empty by default) is delegated to the\n    #: :meth:`call_unop` method that will perform the operator.  The default\n    #: operator callback is specified by :attr:`unop_table`.\n    #:\n    #: The following unary operators are interceptable: ``+``, ``-``\n    #:\n    #: The default operation form the operator table corresponds to the\n    #: builtin function.  Intercepted calls are always slower than the native\n    #: operator call, so make sure only to intercept the ones you are\n    #: interested in.\n    #:\n    #: .. versionadded:: 2.6\n    intercepted_unops = frozenset()\n\n    def intercept_unop(self, operator):\n        \"\"\"Called during template compilation with the name of a unary\n        operator to check if it should be intercepted at runtime.  If this\n        method returns `True`, :meth:`call_unop` is excuted for this unary\n        operator.  The default implementation of :meth:`call_unop` will use\n        the :attr:`unop_table` dictionary to perform the operator with the\n        same logic as the builtin one.\n\n        The following unary operators are interceptable: ``+`` and ``-``\n\n        Intercepted calls are always slower than the native operator call,\n        so make sure only to intercept the ones you are interested in.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return False\n\n\n    def __init__(self, *args, **kwargs):\n        Environment.__init__(self, *args, **kwargs)\n        self.globals['range'] = safe_range\n        self.binop_table = self.default_binop_table.copy()\n        self.unop_table = self.default_unop_table.copy()\n\n    def is_safe_attribute(self, obj, attr, value):\n        \"\"\"The sandboxed environment will call this method to check if the\n        attribute of an object is safe to access.  Per default all attributes\n        starting with an underscore are considered private as well as the\n        special attributes of internal python objects as returned by the\n        :func:`is_internal_attribute` function.\n        \"\"\"\n        return not (attr.startswith('_') or is_internal_attribute(obj, attr))\n\n    def is_safe_callable(self, obj):\n        \"\"\"Check if an object is safely callable.  Per default a function is\n        considered safe unless the `unsafe_callable` attribute exists and is\n        True.  Override this method to alter the behavior, but this won't\n        affect the `unsafe` decorator from this module.\n        \"\"\"\n        return not (getattr(obj, 'unsafe_callable', False) or\n                    getattr(obj, 'alters_data', False))\n\n    def call_binop(self, context, operator, left, right):\n        \"\"\"For intercepted binary operator calls (:meth:`intercepted_binops`)\n        this function is executed instead of the builtin operator.  This can\n        be used to fine tune the behavior of certain operators.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return self.binop_table[operator](left, right)\n\n    def call_unop(self, context, operator, arg):\n        \"\"\"For intercepted unary operator calls (:meth:`intercepted_unops`)\n        this function is executed instead of the builtin operator.  This can\n        be used to fine tune the behavior of certain operators.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return self.unop_table[operator](arg)\n\n    def getitem(self, obj, argument):\n        \"\"\"Subscribe an object from sandboxed code.\"\"\"\n        try:\n            return obj[argument]\n        except (TypeError, LookupError):\n            if isinstance(argument, string_types):\n                try:\n                    attr = str(argument)\n                except Exception:\n                    pass\n                else:\n                    try:\n                        value = getattr(obj, attr)\n                    except AttributeError:\n                        pass\n                    else:\n                        if self.is_safe_attribute(obj, argument, value):\n                            return value\n                        return self.unsafe_undefined(obj, argument)\n        return self.undefined(obj=obj, name=argument)\n\n    def getattr(self, obj, attribute):\n        \"\"\"Subscribe an object from sandboxed code and prefer the\n        attribute.  The attribute passed *must* be a bytestring.\n        \"\"\"\n        try:\n            value = getattr(obj, attribute)\n        except AttributeError:\n            try:\n                return obj[attribute]\n            except (TypeError, LookupError):\n                pass\n        else:\n            if self.is_safe_attribute(obj, attribute, value):\n                return value\n            return self.unsafe_undefined(obj, attribute)\n        return self.undefined(obj=obj, name=attribute)\n\n    def unsafe_undefined(self, obj, attribute):\n        \"\"\"Return an undefined object for unsafe attributes.\"\"\"\n        return self.undefined('access to attribute %r of %r '\n                              'object is unsafe.' % (\n            attribute,\n            obj.__class__.__name__\n        ), name=attribute, obj=obj, exc=SecurityError)\n\n    def format_string(self, s, args, kwargs, format_func=None):\n        \"\"\"If a format call is detected, then this is routed through this\n        method so that our safety sandbox can be used for it.\n        \"\"\"\n        if isinstance(s, Markup):\n            formatter = SandboxedEscapeFormatter(self, s.escape)\n        else:\n            formatter = SandboxedFormatter(self)\n\n        if format_func is not None and format_func.__name__ == 'format_map':\n            if len(args) != 1 or kwargs:\n                raise TypeError(\n                    'format_map() takes exactly one argument %d given'\n                    % (len(args) + (kwargs is not None))\n                )\n\n            kwargs = args[0]\n            args = None\n\n        kwargs = _MagicFormatMapping(args, kwargs)\n        rv = formatter.vformat(s, args, kwargs)\n        return type(s)(rv)\n\n    def call(__self, __context, __obj, *args, **kwargs):\n        \"\"\"Call an object from sandboxed code.\"\"\"\n        fmt = inspect_format_method(__obj)\n        if fmt is not None:\n            return __self.format_string(fmt, args, kwargs, __obj)\n\n        # the double prefixes are to avoid double keyword argument\n        # errors when proxying the call.\n        if not __self.is_safe_callable(__obj):\n            raise SecurityError('%r is not safely callable' % (__obj,))\n        return __context.call(__obj, *args, **kwargs)\n\n\nclass ImmutableSandboxedEnvironment(SandboxedEnvironment):\n    \"\"\"Works exactly like the regular `SandboxedEnvironment` but does not\n    permit modifications on the builtin mutable objects `list`, `set`, and\n    `dict` by using the :func:`modifies_known_mutable` function.\n    \"\"\"\n\n    def is_safe_attribute(self, obj, attr, value):\n        if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):\n            return False\n        return not modifies_known_mutable(obj, attr)\n\n\n# This really is not a public API apparenlty.\ntry:\n    from _string import formatter_field_name_split\nexcept ImportError:\n    def formatter_field_name_split(field_name):\n        return field_name._formatter_field_name_split()\n\n\nclass SandboxedFormatterMixin(object):\n\n    def __init__(self, env):\n        self._env = env\n\n    def get_field(self, field_name, args, kwargs):\n        first, rest = formatter_field_name_split(field_name)\n        obj = self.get_value(first, args, kwargs)\n        for is_attr, i in rest:\n            if is_attr:\n                obj = self._env.getattr(obj, i)\n            else:\n                obj = self._env.getitem(obj, i)\n        return obj, first\n\nclass SandboxedFormatter(SandboxedFormatterMixin, Formatter):\n\n    def __init__(self, env):\n        SandboxedFormatterMixin.__init__(self, env)\n        Formatter.__init__(self)\n\nclass SandboxedEscapeFormatter(SandboxedFormatterMixin, EscapeFormatter):\n\n    def __init__(self, env, escape):\n        SandboxedFormatterMixin.__init__(self, env)\n        EscapeFormatter.__init__(self, escape)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/tests.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.tests\n    ~~~~~~~~~~~~\n\n    Jinja test functions. Used with the \"is\" operator.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport operator\nimport re\nfrom jinja2.runtime import Undefined\nfrom jinja2._compat import text_type, string_types, integer_types, abc\nimport decimal\n\nnumber_re = re.compile(r'^-?\\d+(\\.\\d+)?$')\nregex_type = type(number_re)\n\n\ntest_callable = callable\n\n\ndef test_odd(value):\n    \"\"\"Return true if the variable is odd.\"\"\"\n    return value % 2 == 1\n\n\ndef test_even(value):\n    \"\"\"Return true if the variable is even.\"\"\"\n    return value % 2 == 0\n\n\ndef test_divisibleby(value, num):\n    \"\"\"Check if a variable is divisible by a number.\"\"\"\n    return value % num == 0\n\n\ndef test_defined(value):\n    \"\"\"Return true if the variable is defined:\n\n    .. sourcecode:: jinja\n\n        {% if variable is defined %}\n            value of variable: {{ variable }}\n        {% else %}\n            variable is not defined\n        {% endif %}\n\n    See the :func:`default` filter for a simple way to set undefined\n    variables.\n    \"\"\"\n    return not isinstance(value, Undefined)\n\n\ndef test_undefined(value):\n    \"\"\"Like :func:`defined` but the other way round.\"\"\"\n    return isinstance(value, Undefined)\n\n\ndef test_none(value):\n    \"\"\"Return true if the variable is none.\"\"\"\n    return value is None\n\n\ndef test_lower(value):\n    \"\"\"Return true if the variable is lowercased.\"\"\"\n    return text_type(value).islower()\n\n\ndef test_upper(value):\n    \"\"\"Return true if the variable is uppercased.\"\"\"\n    return text_type(value).isupper()\n\n\ndef test_string(value):\n    \"\"\"Return true if the object is a string.\"\"\"\n    return isinstance(value, string_types)\n\n\ndef test_mapping(value):\n    \"\"\"Return true if the object is a mapping (dict etc.).\n\n    .. versionadded:: 2.6\n    \"\"\"\n    return isinstance(value, abc.Mapping)\n\n\ndef test_number(value):\n    \"\"\"Return true if the variable is a number.\"\"\"\n    return isinstance(value, integer_types + (float, complex, decimal.Decimal))\n\n\ndef test_sequence(value):\n    \"\"\"Return true if the variable is a sequence. Sequences are variables\n    that are iterable.\n    \"\"\"\n    try:\n        len(value)\n        value.__getitem__\n    except:\n        return False\n    return True\n\n\ndef test_sameas(value, other):\n    \"\"\"Check if an object points to the same memory address than another\n    object:\n\n    .. sourcecode:: jinja\n\n        {% if foo.attribute is sameas false %}\n            the foo attribute really is the `False` singleton\n        {% endif %}\n    \"\"\"\n    return value is other\n\n\ndef test_iterable(value):\n    \"\"\"Check if it's possible to iterate over an object.\"\"\"\n    try:\n        iter(value)\n    except TypeError:\n        return False\n    return True\n\n\ndef test_escaped(value):\n    \"\"\"Check if the value is escaped.\"\"\"\n    return hasattr(value, '__html__')\n\n\ndef test_in(value, seq):\n    \"\"\"Check if value is in seq.\n\n    .. versionadded:: 2.10\n    \"\"\"\n    return value in seq\n\n\nTESTS = {\n    'odd':              test_odd,\n    'even':             test_even,\n    'divisibleby':      test_divisibleby,\n    'defined':          test_defined,\n    'undefined':        test_undefined,\n    'none':             test_none,\n    'lower':            test_lower,\n    'upper':            test_upper,\n    'string':           test_string,\n    'mapping':          test_mapping,\n    'number':           test_number,\n    'sequence':         test_sequence,\n    'iterable':         test_iterable,\n    'callable':         test_callable,\n    'sameas':           test_sameas,\n    'escaped':          test_escaped,\n    'in':               test_in,\n    '==':               operator.eq,\n    'eq':               operator.eq,\n    'equalto':          operator.eq,\n    '!=':               operator.ne,\n    'ne':               operator.ne,\n    '>':                operator.gt,\n    'gt':               operator.gt,\n    'greaterthan':      operator.gt,\n    'ge':               operator.ge,\n    '>=':               operator.ge,\n    '<':                operator.lt,\n    'lt':               operator.lt,\n    'lessthan':         operator.lt,\n    '<=':               operator.le,\n    'le':               operator.le,\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/utils.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.utils\n    ~~~~~~~~~~~~\n\n    Utility functions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nimport json\nimport errno\nfrom collections import deque\nfrom threading import Lock\nfrom jinja2._compat import text_type, string_types, implements_iterator, \\\n     url_quote, abc\n\n\n_word_split_re = re.compile(r'(\\s+)')\n_punctuation_re = re.compile(\n    '^(?P<lead>(?:%s)*)(?P<middle>.*?)(?P<trail>(?:%s)*)$' % (\n        '|'.join(map(re.escape, ('(', '<', '&lt;'))),\n        '|'.join(map(re.escape, ('.', ',', ')', '>', '\\n', '&gt;')))\n    )\n)\n_simple_email_re = re.compile(r'^\\S+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+$')\n_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')\n_entity_re = re.compile(r'&([^;]+);')\n_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\n_digits = '0123456789'\n\n# special singleton representing missing values for the runtime\nmissing = type('MissingType', (), {'__repr__': lambda x: 'missing'})()\n\n# internal code\ninternal_code = set()\n\nconcat = u''.join\n\n_slash_escape = '\\\\/' not in json.dumps('/')\n\n\ndef contextfunction(f):\n    \"\"\"This decorator can be used to mark a function or method context callable.\n    A context callable is passed the active :class:`Context` as first argument when\n    called from the template.  This is useful if a function wants to get access\n    to the context or functions provided on the context object.  For example\n    a function that returns a sorted list of template variables the current\n    template exports could look like this::\n\n        @contextfunction\n        def get_exported_names(context):\n            return sorted(context.exported_vars)\n    \"\"\"\n    f.contextfunction = True\n    return f\n\n\ndef evalcontextfunction(f):\n    \"\"\"This decorator can be used to mark a function or method as an eval\n    context callable.  This is similar to the :func:`contextfunction`\n    but instead of passing the context, an evaluation context object is\n    passed.  For more information about the eval context, see\n    :ref:`eval-context`.\n\n    .. versionadded:: 2.4\n    \"\"\"\n    f.evalcontextfunction = True\n    return f\n\n\ndef environmentfunction(f):\n    \"\"\"This decorator can be used to mark a function or method as environment\n    callable.  This decorator works exactly like the :func:`contextfunction`\n    decorator just that the first argument is the active :class:`Environment`\n    and not context.\n    \"\"\"\n    f.environmentfunction = True\n    return f\n\n\ndef internalcode(f):\n    \"\"\"Marks the function as internally used\"\"\"\n    internal_code.add(f.__code__)\n    return f\n\n\ndef is_undefined(obj):\n    \"\"\"Check if the object passed is undefined.  This does nothing more than\n    performing an instance check against :class:`Undefined` but looks nicer.\n    This can be used for custom filters or tests that want to react to\n    undefined variables.  For example a custom default filter can look like\n    this::\n\n        def default(var, default=''):\n            if is_undefined(var):\n                return default\n            return var\n    \"\"\"\n    from jinja2.runtime import Undefined\n    return isinstance(obj, Undefined)\n\n\ndef consume(iterable):\n    \"\"\"Consumes an iterable without doing anything with it.\"\"\"\n    for event in iterable:\n        pass\n\n\ndef clear_caches():\n    \"\"\"Jinja2 keeps internal caches for environments and lexers.  These are\n    used so that Jinja2 doesn't have to recreate environments and lexers all\n    the time.  Normally you don't have to care about that but if you are\n    measuring memory consumption you may want to clean the caches.\n    \"\"\"\n    from jinja2.environment import _spontaneous_environments\n    from jinja2.lexer import _lexer_cache\n    _spontaneous_environments.clear()\n    _lexer_cache.clear()\n\n\ndef import_string(import_name, silent=False):\n    \"\"\"Imports an object based on a string.  This is useful if you want to\n    use import paths as endpoints or something similar.  An import path can\n    be specified either in dotted notation (``xml.sax.saxutils.escape``)\n    or with a colon as object delimiter (``xml.sax.saxutils:escape``).\n\n    If the `silent` is True the return value will be `None` if the import\n    fails.\n\n    :return: imported object\n    \"\"\"\n    try:\n        if ':' in import_name:\n            module, obj = import_name.split(':', 1)\n        elif '.' in import_name:\n            items = import_name.split('.')\n            module = '.'.join(items[:-1])\n            obj = items[-1]\n        else:\n            return __import__(import_name)\n        return getattr(__import__(module, None, None, [obj]), obj)\n    except (ImportError, AttributeError):\n        if not silent:\n            raise\n\n\ndef open_if_exists(filename, mode='rb'):\n    \"\"\"Returns a file descriptor for the filename if that file exists,\n    otherwise `None`.\n    \"\"\"\n    try:\n        return open(filename, mode)\n    except IOError as e:\n        if e.errno not in (errno.ENOENT, errno.EISDIR, errno.EINVAL):\n            raise\n\n\ndef object_type_repr(obj):\n    \"\"\"Returns the name of the object's type.  For some recognized\n    singletons the name of the object is returned instead. (For\n    example for `None` and `Ellipsis`).\n    \"\"\"\n    if obj is None:\n        return 'None'\n    elif obj is Ellipsis:\n        return 'Ellipsis'\n    # __builtin__ in 2.x, builtins in 3.x\n    if obj.__class__.__module__ in ('__builtin__', 'builtins'):\n        name = obj.__class__.__name__\n    else:\n        name = obj.__class__.__module__ + '.' + obj.__class__.__name__\n    return '%s object' % name\n\n\ndef pformat(obj, verbose=False):\n    \"\"\"Prettyprint an object.  Either use the `pretty` library or the\n    builtin `pprint`.\n    \"\"\"\n    try:\n        from pretty import pretty\n        return pretty(obj, verbose=verbose)\n    except ImportError:\n        from pprint import pformat\n        return pformat(obj)\n\n\ndef urlize(text, trim_url_limit=None, rel=None, target=None):\n    \"\"\"Converts any URLs in text into clickable links. Works on http://,\n    https:// and www. links. Links can have trailing punctuation (periods,\n    commas, close-parens) and leading punctuation (opening parens) and\n    it'll still do the right thing.\n\n    If trim_url_limit is not None, the URLs in link text will be limited\n    to trim_url_limit characters.\n\n    If nofollow is True, the URLs in link text will get a rel=\"nofollow\"\n    attribute.\n\n    If target is not None, a target attribute will be added to the link.\n    \"\"\"\n    trim_url = lambda x, limit=trim_url_limit: limit is not None \\\n                         and (x[:limit] + (len(x) >=limit and '...'\n                         or '')) or x\n    words = _word_split_re.split(text_type(escape(text)))\n    rel_attr = rel and ' rel=\"%s\"' % text_type(escape(rel)) or ''\n    target_attr = target and ' target=\"%s\"' % escape(target) or ''\n\n    for i, word in enumerate(words):\n        match = _punctuation_re.match(word)\n        if match:\n            lead, middle, trail = match.groups()\n            if middle.startswith('www.') or (\n                '@' not in middle and\n                not middle.startswith('http://') and\n                not middle.startswith('https://') and\n                len(middle) > 0 and\n                middle[0] in _letters + _digits and (\n                    middle.endswith('.org') or\n                    middle.endswith('.net') or\n                    middle.endswith('.com')\n                )):\n                middle = '<a href=\"http://%s\"%s%s>%s</a>' % (middle,\n                    rel_attr, target_attr, trim_url(middle))\n            if middle.startswith('http://') or \\\n               middle.startswith('https://'):\n                middle = '<a href=\"%s\"%s%s>%s</a>' % (middle,\n                    rel_attr, target_attr, trim_url(middle))\n            if '@' in middle and not middle.startswith('www.') and \\\n               not ':' in middle and _simple_email_re.match(middle):\n                middle = '<a href=\"mailto:%s\">%s</a>' % (middle, middle)\n            if lead + middle + trail != word:\n                words[i] = lead + middle + trail\n    return u''.join(words)\n\n\ndef generate_lorem_ipsum(n=5, html=True, min=20, max=100):\n    \"\"\"Generate some lorem ipsum for the template.\"\"\"\n    from jinja2.constants import LOREM_IPSUM_WORDS\n    from random import choice, randrange\n    words = LOREM_IPSUM_WORDS.split()\n    result = []\n\n    for _ in range(n):\n        next_capitalized = True\n        last_comma = last_fullstop = 0\n        word = None\n        last = None\n        p = []\n\n        # each paragraph contains out of 20 to 100 words.\n        for idx, _ in enumerate(range(randrange(min, max))):\n            while True:\n                word = choice(words)\n                if word != last:\n                    last = word\n                    break\n            if next_capitalized:\n                word = word.capitalize()\n                next_capitalized = False\n            # add commas\n            if idx - randrange(3, 8) > last_comma:\n                last_comma = idx\n                last_fullstop += 2\n                word += ','\n            # add end of sentences\n            if idx - randrange(10, 20) > last_fullstop:\n                last_comma = last_fullstop = idx\n                word += '.'\n                next_capitalized = True\n            p.append(word)\n\n        # ensure that the paragraph ends with a dot.\n        p = u' '.join(p)\n        if p.endswith(','):\n            p = p[:-1] + '.'\n        elif not p.endswith('.'):\n            p += '.'\n        result.append(p)\n\n    if not html:\n        return u'\\n\\n'.join(result)\n    return Markup(u'\\n'.join(u'<p>%s</p>' % escape(x) for x in result))\n\n\ndef unicode_urlencode(obj, charset='utf-8', for_qs=False):\n    \"\"\"URL escapes a single bytestring or unicode string with the\n    given charset if applicable to URL safe quoting under all rules\n    that need to be considered under all supported Python versions.\n\n    If non strings are provided they are converted to their unicode\n    representation first.\n    \"\"\"\n    if not isinstance(obj, string_types):\n        obj = text_type(obj)\n    if isinstance(obj, text_type):\n        obj = obj.encode(charset)\n    safe = not for_qs and b'/' or b''\n    rv = text_type(url_quote(obj, safe))\n    if for_qs:\n        rv = rv.replace('%20', '+')\n    return rv\n\n\nclass LRUCache(object):\n    \"\"\"A simple LRU Cache implementation.\"\"\"\n\n    # this is fast for small capacities (something below 1000) but doesn't\n    # scale.  But as long as it's only used as storage for templates this\n    # won't do any harm.\n\n    def __init__(self, capacity):\n        self.capacity = capacity\n        self._mapping = {}\n        self._queue = deque()\n        self._postinit()\n\n    def _postinit(self):\n        # alias all queue methods for faster lookup\n        self._popleft = self._queue.popleft\n        self._pop = self._queue.pop\n        self._remove = self._queue.remove\n        self._wlock = Lock()\n        self._append = self._queue.append\n\n    def __getstate__(self):\n        return {\n            'capacity':     self.capacity,\n            '_mapping':     self._mapping,\n            '_queue':       self._queue\n        }\n\n    def __setstate__(self, d):\n        self.__dict__.update(d)\n        self._postinit()\n\n    def __getnewargs__(self):\n        return (self.capacity,)\n\n    def copy(self):\n        \"\"\"Return a shallow copy of the instance.\"\"\"\n        rv = self.__class__(self.capacity)\n        rv._mapping.update(self._mapping)\n        rv._queue = deque(self._queue)\n        return rv\n\n    def get(self, key, default=None):\n        \"\"\"Return an item from the cache dict or `default`\"\"\"\n        try:\n            return self[key]\n        except KeyError:\n            return default\n\n    def setdefault(self, key, default=None):\n        \"\"\"Set `default` if the key is not in the cache otherwise\n        leave unchanged. Return the value of this key.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            try:\n                return self[key]\n            except KeyError:\n                self[key] = default\n                return default\n        finally:\n            self._wlock.release()\n\n    def clear(self):\n        \"\"\"Clear the cache.\"\"\"\n        self._wlock.acquire()\n        try:\n            self._mapping.clear()\n            self._queue.clear()\n        finally:\n            self._wlock.release()\n\n    def __contains__(self, key):\n        \"\"\"Check if a key exists in this cache.\"\"\"\n        return key in self._mapping\n\n    def __len__(self):\n        \"\"\"Return the current size of the cache.\"\"\"\n        return len(self._mapping)\n\n    def __repr__(self):\n        return '<%s %r>' % (\n            self.__class__.__name__,\n            self._mapping\n        )\n\n    def __getitem__(self, key):\n        \"\"\"Get an item from the cache. Moves the item up so that it has the\n        highest priority then.\n\n        Raise a `KeyError` if it does not exist.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            rv = self._mapping[key]\n            if self._queue[-1] != key:\n                try:\n                    self._remove(key)\n                except ValueError:\n                    # if something removed the key from the container\n                    # when we read, ignore the ValueError that we would\n                    # get otherwise.\n                    pass\n                self._append(key)\n            return rv\n        finally:\n            self._wlock.release()\n\n    def __setitem__(self, key, value):\n        \"\"\"Sets the value for an item. Moves the item up so that it\n        has the highest priority then.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            if key in self._mapping:\n                self._remove(key)\n            elif len(self._mapping) == self.capacity:\n                del self._mapping[self._popleft()]\n            self._append(key)\n            self._mapping[key] = value\n        finally:\n            self._wlock.release()\n\n    def __delitem__(self, key):\n        \"\"\"Remove an item from the cache dict.\n        Raise a `KeyError` if it does not exist.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            del self._mapping[key]\n            try:\n                self._remove(key)\n            except ValueError:\n                # __getitem__ is not locked, it might happen\n                pass\n        finally:\n            self._wlock.release()\n\n    def items(self):\n        \"\"\"Return a list of items.\"\"\"\n        result = [(key, self._mapping[key]) for key in list(self._queue)]\n        result.reverse()\n        return result\n\n    def iteritems(self):\n        \"\"\"Iterate over all items.\"\"\"\n        return iter(self.items())\n\n    def values(self):\n        \"\"\"Return a list of all values.\"\"\"\n        return [x[1] for x in self.items()]\n\n    def itervalue(self):\n        \"\"\"Iterate over all values.\"\"\"\n        return iter(self.values())\n\n    def keys(self):\n        \"\"\"Return a list of all keys ordered by most recent usage.\"\"\"\n        return list(self)\n\n    def iterkeys(self):\n        \"\"\"Iterate over all keys in the cache dict, ordered by\n        the most recent usage.\n        \"\"\"\n        return reversed(tuple(self._queue))\n\n    __iter__ = iterkeys\n\n    def __reversed__(self):\n        \"\"\"Iterate over the values in the cache dict, oldest items\n        coming first.\n        \"\"\"\n        return iter(tuple(self._queue))\n\n    __copy__ = copy\n\n\nabc.MutableMapping.register(LRUCache)\n\n\ndef select_autoescape(enabled_extensions=('html', 'htm', 'xml'),\n                      disabled_extensions=(),\n                      default_for_string=True,\n                      default=False):\n    \"\"\"Intelligently sets the initial value of autoescaping based on the\n    filename of the template.  This is the recommended way to configure\n    autoescaping if you do not want to write a custom function yourself.\n\n    If you want to enable it for all templates created from strings or\n    for all templates with `.html` and `.xml` extensions::\n\n        from jinja2 import Environment, select_autoescape\n        env = Environment(autoescape=select_autoescape(\n            enabled_extensions=('html', 'xml'),\n            default_for_string=True,\n        ))\n\n    Example configuration to turn it on at all times except if the template\n    ends with `.txt`::\n\n        from jinja2 import Environment, select_autoescape\n        env = Environment(autoescape=select_autoescape(\n            disabled_extensions=('txt',),\n            default_for_string=True,\n            default=True,\n        ))\n\n    The `enabled_extensions` is an iterable of all the extensions that\n    autoescaping should be enabled for.  Likewise `disabled_extensions` is\n    a list of all templates it should be disabled for.  If a template is\n    loaded from a string then the default from `default_for_string` is used.\n    If nothing matches then the initial value of autoescaping is set to the\n    value of `default`.\n\n    For security reasons this function operates case insensitive.\n\n    .. versionadded:: 2.9\n    \"\"\"\n    enabled_patterns = tuple('.' + x.lstrip('.').lower()\n                             for x in enabled_extensions)\n    disabled_patterns = tuple('.' + x.lstrip('.').lower()\n                              for x in disabled_extensions)\n    def autoescape(template_name):\n        if template_name is None:\n            return default_for_string\n        template_name = template_name.lower()\n        if template_name.endswith(enabled_patterns):\n            return True\n        if template_name.endswith(disabled_patterns):\n            return False\n        return default\n    return autoescape\n\n\ndef htmlsafe_json_dumps(obj, dumper=None, **kwargs):\n    \"\"\"Works exactly like :func:`dumps` but is safe for use in ``<script>``\n    tags.  It accepts the same arguments and returns a JSON string.  Note that\n    this is available in templates through the ``|tojson`` filter which will\n    also mark the result as safe.  Due to how this function escapes certain\n    characters this is safe even if used outside of ``<script>`` tags.\n\n    The following characters are escaped in strings:\n\n    -   ``<``\n    -   ``>``\n    -   ``&``\n    -   ``'``\n\n    This makes it safe to embed such strings in any place in HTML with the\n    notable exception of double quoted attributes.  In that case single\n    quote your attributes or HTML escape it in addition.\n    \"\"\"\n    if dumper is None:\n        dumper = json.dumps\n    rv = dumper(obj, **kwargs) \\\n        .replace(u'<', u'\\\\u003c') \\\n        .replace(u'>', u'\\\\u003e') \\\n        .replace(u'&', u'\\\\u0026') \\\n        .replace(u\"'\", u'\\\\u0027')\n    return Markup(rv)\n\n\n@implements_iterator\nclass Cycler(object):\n    \"\"\"A cycle helper for templates.\"\"\"\n\n    def __init__(self, *items):\n        if not items:\n            raise RuntimeError('at least one item has to be provided')\n        self.items = items\n        self.reset()\n\n    def reset(self):\n        \"\"\"Resets the cycle.\"\"\"\n        self.pos = 0\n\n    @property\n    def current(self):\n        \"\"\"Returns the current item.\"\"\"\n        return self.items[self.pos]\n\n    def next(self):\n        \"\"\"Goes one item ahead and returns it.\"\"\"\n        rv = self.current\n        self.pos = (self.pos + 1) % len(self.items)\n        return rv\n\n    __next__ = next\n\n\nclass Joiner(object):\n    \"\"\"A joining helper for templates.\"\"\"\n\n    def __init__(self, sep=u', '):\n        self.sep = sep\n        self.used = False\n\n    def __call__(self):\n        if not self.used:\n            self.used = True\n            return u''\n        return self.sep\n\n\nclass Namespace(object):\n    \"\"\"A namespace object that can hold arbitrary attributes.  It may be\n    initialized from a dictionary or with keyword argments.\"\"\"\n\n    def __init__(*args, **kwargs):\n        self, args = args[0], args[1:]\n        self.__attrs = dict(*args, **kwargs)\n\n    def __getattribute__(self, name):\n        if name == '_Namespace__attrs':\n            return object.__getattribute__(self, name)\n        try:\n            return self.__attrs[name]\n        except KeyError:\n            raise AttributeError(name)\n\n    def __setitem__(self, name, value):\n        self.__attrs[name] = value\n\n    def __repr__(self):\n        return '<Namespace %r>' % self.__attrs\n\n\n# does this python version support async for in and async generators?\ntry:\n    exec('async def _():\\n async for _ in ():\\n  yield _')\n    have_async_gen = True\nexcept SyntaxError:\n    have_async_gen = False\n\n\n# Imported here because that's where it was in the past\nfrom markupsafe import Markup, escape, soft_unicode\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2/jinja2/visitor.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.visitor\n    ~~~~~~~~~~~~~~\n\n    This module implements a visitor for the nodes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom jinja2.nodes import Node\n\n\nclass NodeVisitor(object):\n    \"\"\"Walks the abstract syntax tree and call visitor functions for every\n    node found.  The visitor functions may return values which will be\n    forwarded by the `visit` method.\n\n    Per default the visitor functions for the nodes are ``'visit_'`` +\n    class name of the node.  So a `TryFinally` node visit function would\n    be `visit_TryFinally`.  This behavior can be changed by overriding\n    the `get_visitor` function.  If no visitor function exists for a node\n    (return value `None`) the `generic_visit` visitor is used instead.\n    \"\"\"\n\n    def get_visitor(self, node):\n        \"\"\"Return the visitor function for this node or `None` if no visitor\n        exists for this node.  In that case the generic visit function is\n        used instead.\n        \"\"\"\n        method = 'visit_' + node.__class__.__name__\n        return getattr(self, method, None)\n\n    def visit(self, node, *args, **kwargs):\n        \"\"\"Visit a node.\"\"\"\n        f = self.get_visitor(node)\n        if f is not None:\n            return f(node, *args, **kwargs)\n        return self.generic_visit(node, *args, **kwargs)\n\n    def generic_visit(self, node, *args, **kwargs):\n        \"\"\"Called if no explicit visitor function exists for a node.\"\"\"\n        for node in node.iter_child_nodes():\n            self.visit(node, *args, **kwargs)\n\n\nclass NodeTransformer(NodeVisitor):\n    \"\"\"Walks the abstract syntax tree and allows modifications of nodes.\n\n    The `NodeTransformer` will walk the AST and use the return value of the\n    visitor functions to replace or remove the old node.  If the return\n    value of the visitor function is `None` the node will be removed\n    from the previous location otherwise it's replaced with the return\n    value.  The return value may be the original node in which case no\n    replacement takes place.\n    \"\"\"\n\n    def generic_visit(self, node, *args, **kwargs):\n        for field, old_value in node.iter_fields():\n            if isinstance(old_value, list):\n                new_values = []\n                for value in old_value:\n                    if isinstance(value, Node):\n                        value = self.visit(value, *args, **kwargs)\n                        if value is None:\n                            continue\n                        elif not isinstance(value, Node):\n                            new_values.extend(value)\n                            continue\n                    new_values.append(value)\n                old_value[:] = new_values\n            elif isinstance(old_value, Node):\n                new_node = self.visit(old_value, *args, **kwargs)\n                if new_node is None:\n                    delattr(node, field)\n                else:\n                    setattr(node, field, new_node)\n        return node\n\n    def visit_list(self, node, *args, **kwargs):\n        \"\"\"As transformers may return lists in some places this method\n        can be used to enforce a list as return value.\n        \"\"\"\n        rv = self.visit(node, *args, **kwargs)\n        if not isinstance(rv, list):\n            rv = [rv]\n        return rv\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/LICENSE.rst",
    "content": "Copyright 2007 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n#. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n#. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n\n#. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/README.rst",
    "content": "This is the last Jinja release to support Python2.6, which we want due\nto the RHELs."
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/__init__.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2\n    ~~~~~~\n\n    Jinja2 is a template engine written in pure Python.  It provides a\n    Django inspired non-XML syntax but supports inline expressions and\n    an optional sandboxed environment.\n\n    Nutshell\n    --------\n\n    Here a small example of a Jinja2 template::\n\n        {% extends 'base.html' %}\n        {% block title %}Memberlist{% endblock %}\n        {% block content %}\n          <ul>\n          {% for user in users %}\n            <li><a href=\"{{ user.url }}\">{{ user.username }}</a></li>\n          {% endfor %}\n          </ul>\n        {% endblock %}\n\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\n__docformat__ = 'restructuredtext en'\n__version__ = \"2.10.3\"\n\n# high level interface\nfrom jinja2.environment import Environment, Template\n\n# loaders\nfrom jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \\\n     DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \\\n     ModuleLoader\n\n# bytecode caches\nfrom jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \\\n     MemcachedBytecodeCache\n\n# undefined types\nfrom jinja2.runtime import Undefined, DebugUndefined, StrictUndefined, \\\n     make_logging_undefined\n\n# exceptions\nfrom jinja2.exceptions import TemplateError, UndefinedError, \\\n     TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \\\n     TemplateAssertionError, TemplateRuntimeError\n\n# decorators and public utilities\nfrom jinja2.filters import environmentfilter, contextfilter, \\\n     evalcontextfilter\nfrom jinja2.utils import Markup, escape, clear_caches, \\\n     environmentfunction, evalcontextfunction, contextfunction, \\\n     is_undefined, select_autoescape\n\n__all__ = [\n    'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',\n    'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',\n    'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',\n    'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',\n    'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',\n    'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',\n    'TemplateRuntimeError',\n    'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',\n    'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',\n    'evalcontextfilter', 'evalcontextfunction', 'make_logging_undefined',\n    'select_autoescape',\n]\n\n\ndef _patch_async():\n    from jinja2.utils import have_async_gen\n    if have_async_gen:\n        from jinja2.asyncsupport import patch_all\n        patch_all()\n\n\n_patch_async()\ndel _patch_async\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/_compat.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2._compat\n    ~~~~~~~~~~~~~~\n\n    Some py2/py3 compatibility support based on a stripped down\n    version of six so we don't have to depend on a specific version\n    of it.\n\n    :copyright: Copyright 2013 by the Jinja team, see AUTHORS.\n    :license: BSD, see LICENSE for details.\n\"\"\"\nimport sys\n\nPY2 = sys.version_info[0] == 2\nPYPY = hasattr(sys, 'pypy_translation_info')\n_identity = lambda x: x\n\n\nif not PY2:\n    unichr = chr\n    range_type = range\n    text_type = str\n    string_types = (str,)\n    integer_types = (int,)\n\n    iterkeys = lambda d: iter(d.keys())\n    itervalues = lambda d: iter(d.values())\n    iteritems = lambda d: iter(d.items())\n\n    import pickle\n    from io import BytesIO, StringIO\n    NativeStringIO = StringIO\n\n    def reraise(tp, value, tb=None):\n        if value.__traceback__ is not tb:\n            raise value.with_traceback(tb)\n        raise value\n\n    ifilter = filter\n    imap = map\n    izip = zip\n    intern = sys.intern\n\n    implements_iterator = _identity\n    implements_to_string = _identity\n    encode_filename = _identity\n\nelse:\n    unichr = unichr\n    text_type = unicode\n    range_type = xrange\n    string_types = (str, unicode)\n    integer_types = (int, long)\n\n    iterkeys = lambda d: d.iterkeys()\n    itervalues = lambda d: d.itervalues()\n    iteritems = lambda d: d.iteritems()\n\n    import cPickle as pickle\n    from cStringIO import StringIO as BytesIO, StringIO\n    NativeStringIO = BytesIO\n\n    exec('def reraise(tp, value, tb=None):\\n raise tp, value, tb')\n\n    from itertools import imap, izip, ifilter\n    intern = intern\n\n    def implements_iterator(cls):\n        cls.next = cls.__next__\n        del cls.__next__\n        return cls\n\n    def implements_to_string(cls):\n        cls.__unicode__ = cls.__str__\n        cls.__str__ = lambda x: x.__unicode__().encode('utf-8')\n        return cls\n\n    def encode_filename(filename):\n        if isinstance(filename, unicode):\n            return filename.encode('utf-8')\n        return filename\n\n\ndef with_metaclass(meta, *bases):\n    \"\"\"Create a base class with a metaclass.\"\"\"\n    # This requires a bit of explanation: the basic idea is to make a\n    # dummy metaclass for one level of class instantiation that replaces\n    # itself with the actual metaclass.\n    class metaclass(type):\n        def __new__(cls, name, this_bases, d):\n            return meta(name, bases, d)\n    return type.__new__(metaclass, 'temporary_class', (), {})\n\n\ntry:\n    from urllib.parse import quote_from_bytes as url_quote\nexcept ImportError:\n    from urllib import quote as url_quote\n\n\ntry:\n    from collections import abc\nexcept ImportError:\n    import collections as abc\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/_identifier.py",
    "content": "# generated by scripts/generate_identifier_pattern.py\npattern = '·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఃా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪽ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰℘℮⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯︳︴﹍-﹏＿𐇽𐋠𐍶-𐍺𐨁-𐨃𐨅𐨆𐨌-𐨏𐨸-𐨿𐨺𐫦𐫥𑀀-𑀂𑀸-𑁆𑁿-𑂂𑂰-𑂺𑄀-𑄂𑄧-𑅳𑄴𑆀-𑆂𑆳-𑇊𑇀-𑇌𑈬-𑈷𑈾𑋟-𑋪𑌀-𑌃𑌼𑌾-𑍄𑍇𑍈𑍋-𑍍𑍗𑍢𑍣𑍦-𑍬𑍰-𑍴𑐵-𑑆𑒰-𑓃𑖯-𑖵𑖸-𑗀𑗜𑗝𑘰-𑙀𑚫-𑚷𑜝-𑜫𑰯-𑰶𑰸-𑰿𑲒-𑲧𑲩-𑲶𖫰-𖫴𖬰-𖬶𖽑-𖽾𖾏-𖾒𛲝𛲞𝅥-𝅩𝅭-𝅲𝅻-𝆂𝆅-𝆋𝆪-𝆭𝉂-𝉄𝨀-𝨶𝨻-𝩬𝩵𝪄𝪛-𝪟𝪡-𝪯𞀀-𞀆𞀈-𞀘𞀛-𞀡𞀣𞀤𞀦-𞣐𞀪-𞣖𞥄-𞥊󠄀-󠇯'\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/bccache.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.bccache\n    ~~~~~~~~~~~~~~\n\n    This module implements the bytecode cache system Jinja is optionally\n    using.  This is useful if you have very complex template situations and\n    the compiliation of all those templates slow down your application too\n    much.\n\n    Situations where this is useful are often forking web applications that\n    are initialized on the first request.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom os import path, listdir\nimport os\nimport sys\nimport stat\nimport errno\nimport marshal\nimport tempfile\nimport fnmatch\nfrom hashlib import sha1\nfrom jinja2.utils import open_if_exists\nfrom jinja2._compat import BytesIO, pickle, PY2, text_type\n\n\n# marshal works better on 3.x, one hack less required\nif not PY2:\n    marshal_dump = marshal.dump\n    marshal_load = marshal.load\nelse:\n\n    def marshal_dump(code, f):\n        if isinstance(f, file):\n            marshal.dump(code, f)\n        else:\n            f.write(marshal.dumps(code))\n\n    def marshal_load(f):\n        if isinstance(f, file):\n            return marshal.load(f)\n        return marshal.loads(f.read())\n\n\nbc_version = 3\n\n# magic version used to only change with new jinja versions.  With 2.6\n# we change this to also take Python version changes into account.  The\n# reason for this is that Python tends to segfault if fed earlier bytecode\n# versions because someone thought it would be a good idea to reuse opcodes\n# or make Python incompatible with earlier versions.\nbc_magic = 'j2'.encode('ascii') + \\\n    pickle.dumps(bc_version, 2) + \\\n    pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1])\n\n\nclass Bucket(object):\n    \"\"\"Buckets are used to store the bytecode for one template.  It's created\n    and initialized by the bytecode cache and passed to the loading functions.\n\n    The buckets get an internal checksum from the cache assigned and use this\n    to automatically reject outdated cache material.  Individual bytecode\n    cache subclasses don't have to care about cache invalidation.\n    \"\"\"\n\n    def __init__(self, environment, key, checksum):\n        self.environment = environment\n        self.key = key\n        self.checksum = checksum\n        self.reset()\n\n    def reset(self):\n        \"\"\"Resets the bucket (unloads the bytecode).\"\"\"\n        self.code = None\n\n    def load_bytecode(self, f):\n        \"\"\"Loads bytecode from a file or file like object.\"\"\"\n        # make sure the magic header is correct\n        magic = f.read(len(bc_magic))\n        if magic != bc_magic:\n            self.reset()\n            return\n        # the source code of the file changed, we need to reload\n        checksum = pickle.load(f)\n        if self.checksum != checksum:\n            self.reset()\n            return\n        # if marshal_load fails then we need to reload\n        try:\n            self.code = marshal_load(f)\n        except (EOFError, ValueError, TypeError):\n            self.reset()\n            return\n\n    def write_bytecode(self, f):\n        \"\"\"Dump the bytecode into the file or file like object passed.\"\"\"\n        if self.code is None:\n            raise TypeError('can\\'t write empty bucket')\n        f.write(bc_magic)\n        pickle.dump(self.checksum, f, 2)\n        marshal_dump(self.code, f)\n\n    def bytecode_from_string(self, string):\n        \"\"\"Load bytecode from a string.\"\"\"\n        self.load_bytecode(BytesIO(string))\n\n    def bytecode_to_string(self):\n        \"\"\"Return the bytecode as string.\"\"\"\n        out = BytesIO()\n        self.write_bytecode(out)\n        return out.getvalue()\n\n\nclass BytecodeCache(object):\n    \"\"\"To implement your own bytecode cache you have to subclass this class\n    and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of\n    these methods are passed a :class:`~jinja2.bccache.Bucket`.\n\n    A very basic bytecode cache that saves the bytecode on the file system::\n\n        from os import path\n\n        class MyCache(BytecodeCache):\n\n            def __init__(self, directory):\n                self.directory = directory\n\n            def load_bytecode(self, bucket):\n                filename = path.join(self.directory, bucket.key)\n                if path.exists(filename):\n                    with open(filename, 'rb') as f:\n                        bucket.load_bytecode(f)\n\n            def dump_bytecode(self, bucket):\n                filename = path.join(self.directory, bucket.key)\n                with open(filename, 'wb') as f:\n                    bucket.write_bytecode(f)\n\n    A more advanced version of a filesystem based bytecode cache is part of\n    Jinja2.\n    \"\"\"\n\n    def load_bytecode(self, bucket):\n        \"\"\"Subclasses have to override this method to load bytecode into a\n        bucket.  If they are not able to find code in the cache for the\n        bucket, it must not do anything.\n        \"\"\"\n        raise NotImplementedError()\n\n    def dump_bytecode(self, bucket):\n        \"\"\"Subclasses have to override this method to write the bytecode\n        from a bucket back to the cache.  If it unable to do so it must not\n        fail silently but raise an exception.\n        \"\"\"\n        raise NotImplementedError()\n\n    def clear(self):\n        \"\"\"Clears the cache.  This method is not used by Jinja2 but should be\n        implemented to allow applications to clear the bytecode cache used\n        by a particular environment.\n        \"\"\"\n\n    def get_cache_key(self, name, filename=None):\n        \"\"\"Returns the unique hash key for this template name.\"\"\"\n        hash = sha1(name.encode('utf-8'))\n        if filename is not None:\n            filename = '|' + filename\n            if isinstance(filename, text_type):\n                filename = filename.encode('utf-8')\n            hash.update(filename)\n        return hash.hexdigest()\n\n    def get_source_checksum(self, source):\n        \"\"\"Returns a checksum for the source.\"\"\"\n        return sha1(source.encode('utf-8')).hexdigest()\n\n    def get_bucket(self, environment, name, filename, source):\n        \"\"\"Return a cache bucket for the given template.  All arguments are\n        mandatory but filename may be `None`.\n        \"\"\"\n        key = self.get_cache_key(name, filename)\n        checksum = self.get_source_checksum(source)\n        bucket = Bucket(environment, key, checksum)\n        self.load_bytecode(bucket)\n        return bucket\n\n    def set_bucket(self, bucket):\n        \"\"\"Put the bucket into the cache.\"\"\"\n        self.dump_bytecode(bucket)\n\n\nclass FileSystemBytecodeCache(BytecodeCache):\n    \"\"\"A bytecode cache that stores bytecode on the filesystem.  It accepts\n    two arguments: The directory where the cache items are stored and a\n    pattern string that is used to build the filename.\n\n    If no directory is specified a default cache directory is selected.  On\n    Windows the user's temp directory is used, on UNIX systems a directory\n    is created for the user in the system temp directory.\n\n    The pattern can be used to have multiple separate caches operate on the\n    same directory.  The default pattern is ``'__jinja2_%s.cache'``.  ``%s``\n    is replaced with the cache key.\n\n    >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')\n\n    This bytecode cache supports clearing of the cache using the clear method.\n    \"\"\"\n\n    def __init__(self, directory=None, pattern='__jinja2_%s.cache'):\n        if directory is None:\n            directory = self._get_default_cache_dir()\n        self.directory = directory\n        self.pattern = pattern\n\n    def _get_default_cache_dir(self):\n        def _unsafe_dir():\n            raise RuntimeError('Cannot determine safe temp directory.  You '\n                               'need to explicitly provide one.')\n\n        tmpdir = tempfile.gettempdir()\n\n        # On windows the temporary directory is used specific unless\n        # explicitly forced otherwise.  We can just use that.\n        if os.name == 'nt':\n            return tmpdir\n        if not hasattr(os, 'getuid'):\n            _unsafe_dir()\n\n        dirname = '_jinja2-cache-%d' % os.getuid()\n        actual_dir = os.path.join(tmpdir, dirname)\n\n        try:\n            os.mkdir(actual_dir, stat.S_IRWXU)\n        except OSError as e:\n            if e.errno != errno.EEXIST:\n                raise\n        try:\n            os.chmod(actual_dir, stat.S_IRWXU)\n            actual_dir_stat = os.lstat(actual_dir)\n            if actual_dir_stat.st_uid != os.getuid() \\\n               or not stat.S_ISDIR(actual_dir_stat.st_mode) \\\n               or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:\n                _unsafe_dir()\n        except OSError as e:\n            if e.errno != errno.EEXIST:\n                raise\n\n        actual_dir_stat = os.lstat(actual_dir)\n        if actual_dir_stat.st_uid != os.getuid() \\\n           or not stat.S_ISDIR(actual_dir_stat.st_mode) \\\n           or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:\n            _unsafe_dir()\n\n        return actual_dir\n\n    def _get_cache_filename(self, bucket):\n        return path.join(self.directory, self.pattern % bucket.key)\n\n    def load_bytecode(self, bucket):\n        f = open_if_exists(self._get_cache_filename(bucket), 'rb')\n        if f is not None:\n            try:\n                bucket.load_bytecode(f)\n            finally:\n                f.close()\n\n    def dump_bytecode(self, bucket):\n        f = open(self._get_cache_filename(bucket), 'wb')\n        try:\n            bucket.write_bytecode(f)\n        finally:\n            f.close()\n\n    def clear(self):\n        # imported lazily here because google app-engine doesn't support\n        # write access on the file system and the function does not exist\n        # normally.\n        from os import remove\n        files = fnmatch.filter(listdir(self.directory), self.pattern % '*')\n        for filename in files:\n            try:\n                remove(path.join(self.directory, filename))\n            except OSError:\n                pass\n\n\nclass MemcachedBytecodeCache(BytecodeCache):\n    \"\"\"This class implements a bytecode cache that uses a memcache cache for\n    storing the information.  It does not enforce a specific memcache library\n    (tummy's memcache or cmemcache) but will accept any class that provides\n    the minimal interface required.\n\n    Libraries compatible with this class:\n\n    -   `cachelib <https://github.com/pallets/cachelib>`_\n    -   `python-memcached <https://pypi.org/project/python-memcached/>`_\n\n    (Unfortunately the django cache interface is not compatible because it\n    does not support storing binary data, only unicode.  You can however pass\n    the underlying cache client to the bytecode cache which is available\n    as `django.core.cache.cache._client`.)\n\n    The minimal interface for the client passed to the constructor is this:\n\n    .. class:: MinimalClientInterface\n\n        .. method:: set(key, value[, timeout])\n\n            Stores the bytecode in the cache.  `value` is a string and\n            `timeout` the timeout of the key.  If timeout is not provided\n            a default timeout or no timeout should be assumed, if it's\n            provided it's an integer with the number of seconds the cache\n            item should exist.\n\n        .. method:: get(key)\n\n            Returns the value for the cache key.  If the item does not\n            exist in the cache the return value must be `None`.\n\n    The other arguments to the constructor are the prefix for all keys that\n    is added before the actual cache key and the timeout for the bytecode in\n    the cache system.  We recommend a high (or no) timeout.\n\n    This bytecode cache does not support clearing of used items in the cache.\n    The clear method is a no-operation function.\n\n    .. versionadded:: 2.7\n       Added support for ignoring memcache errors through the\n       `ignore_memcache_errors` parameter.\n    \"\"\"\n\n    def __init__(self, client, prefix='jinja2/bytecode/', timeout=None,\n                 ignore_memcache_errors=True):\n        self.client = client\n        self.prefix = prefix\n        self.timeout = timeout\n        self.ignore_memcache_errors = ignore_memcache_errors\n\n    def load_bytecode(self, bucket):\n        try:\n            code = self.client.get(self.prefix + bucket.key)\n        except Exception:\n            if not self.ignore_memcache_errors:\n                raise\n            code = None\n        if code is not None:\n            bucket.bytecode_from_string(code)\n\n    def dump_bytecode(self, bucket):\n        args = (self.prefix + bucket.key, bucket.bytecode_to_string())\n        if self.timeout is not None:\n            args += (self.timeout,)\n        try:\n            self.client.set(*args)\n        except Exception:\n            if not self.ignore_memcache_errors:\n                raise\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/compiler.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.compiler\n    ~~~~~~~~~~~~~~~\n\n    Compiles nodes into python code.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom itertools import chain\nfrom copy import deepcopy\nfrom keyword import iskeyword as is_python_keyword\nfrom functools import update_wrapper\nfrom jinja2 import nodes\nfrom jinja2.nodes import EvalContext\nfrom jinja2.visitor import NodeVisitor\nfrom jinja2.optimizer import Optimizer\nfrom jinja2.exceptions import TemplateAssertionError\nfrom jinja2.utils import Markup, concat, escape\nfrom jinja2._compat import range_type, text_type, string_types, \\\n     iteritems, NativeStringIO, imap, izip\nfrom jinja2.idtracking import Symbols, VAR_LOAD_PARAMETER, \\\n     VAR_LOAD_RESOLVE, VAR_LOAD_ALIAS, VAR_LOAD_UNDEFINED\n\n\noperators = {\n    'eq':       '==',\n    'ne':       '!=',\n    'gt':       '>',\n    'gteq':     '>=',\n    'lt':       '<',\n    'lteq':     '<=',\n    'in':       'in',\n    'notin':    'not in'\n}\n\n# what method to iterate over items do we want to use for dict iteration\n# in generated code?  on 2.x let's go with iteritems, on 3.x with items\nif hasattr(dict, 'iteritems'):\n    dict_item_iter = 'iteritems'\nelse:\n    dict_item_iter = 'items'\n\ncode_features = ['division']\n\n# does this python version support generator stops? (PEP 0479)\ntry:\n    exec('from __future__ import generator_stop')\n    code_features.append('generator_stop')\nexcept SyntaxError:\n    pass\n\n# does this python version support yield from?\ntry:\n    exec('def f(): yield from x()')\nexcept SyntaxError:\n    supports_yield_from = False\nelse:\n    supports_yield_from = True\n\n\ndef optimizeconst(f):\n    def new_func(self, node, frame, **kwargs):\n        # Only optimize if the frame is not volatile\n        if self.optimized and not frame.eval_ctx.volatile:\n            new_node = self.optimizer.visit(node, frame.eval_ctx)\n            if new_node != node:\n                return self.visit(new_node, frame)\n        return f(self, node, frame, **kwargs)\n    return update_wrapper(new_func, f)\n\n\ndef generate(node, environment, name, filename, stream=None,\n             defer_init=False, optimized=True):\n    \"\"\"Generate the python source for a node tree.\"\"\"\n    if not isinstance(node, nodes.Template):\n        raise TypeError('Can\\'t compile non template nodes')\n    generator = environment.code_generator_class(environment, name, filename,\n                                                 stream, defer_init,\n                                                 optimized)\n    generator.visit(node)\n    if stream is None:\n        return generator.stream.getvalue()\n\n\ndef has_safe_repr(value):\n    \"\"\"Does the node have a safe representation?\"\"\"\n    if value is None or value is NotImplemented or value is Ellipsis:\n        return True\n    if type(value) in (bool, int, float, complex, range_type, Markup) + string_types:\n        return True\n    if type(value) in (tuple, list, set, frozenset):\n        for item in value:\n            if not has_safe_repr(item):\n                return False\n        return True\n    elif type(value) is dict:\n        for key, value in iteritems(value):\n            if not has_safe_repr(key):\n                return False\n            if not has_safe_repr(value):\n                return False\n        return True\n    return False\n\n\ndef find_undeclared(nodes, names):\n    \"\"\"Check if the names passed are accessed undeclared.  The return value\n    is a set of all the undeclared names from the sequence of names found.\n    \"\"\"\n    visitor = UndeclaredNameVisitor(names)\n    try:\n        for node in nodes:\n            visitor.visit(node)\n    except VisitorExit:\n        pass\n    return visitor.undeclared\n\n\nclass MacroRef(object):\n\n    def __init__(self, node):\n        self.node = node\n        self.accesses_caller = False\n        self.accesses_kwargs = False\n        self.accesses_varargs = False\n\n\nclass Frame(object):\n    \"\"\"Holds compile time information for us.\"\"\"\n\n    def __init__(self, eval_ctx, parent=None, level=None):\n        self.eval_ctx = eval_ctx\n        self.symbols = Symbols(parent and parent.symbols or None,\n                               level=level)\n\n        # a toplevel frame is the root + soft frames such as if conditions.\n        self.toplevel = False\n\n        # the root frame is basically just the outermost frame, so no if\n        # conditions.  This information is used to optimize inheritance\n        # situations.\n        self.rootlevel = False\n\n        # in some dynamic inheritance situations the compiler needs to add\n        # write tests around output statements.\n        self.require_output_check = parent and parent.require_output_check\n\n        # inside some tags we are using a buffer rather than yield statements.\n        # this for example affects {% filter %} or {% macro %}.  If a frame\n        # is buffered this variable points to the name of the list used as\n        # buffer.\n        self.buffer = None\n\n        # the name of the block we're in, otherwise None.\n        self.block = parent and parent.block or None\n\n        # the parent of this frame\n        self.parent = parent\n\n        if parent is not None:\n            self.buffer = parent.buffer\n\n    def copy(self):\n        \"\"\"Create a copy of the current one.\"\"\"\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.symbols = self.symbols.copy()\n        return rv\n\n    def inner(self, isolated=False):\n        \"\"\"Return an inner frame.\"\"\"\n        if isolated:\n            return Frame(self.eval_ctx, level=self.symbols.level + 1)\n        return Frame(self.eval_ctx, self)\n\n    def soft(self):\n        \"\"\"Return a soft frame.  A soft frame may not be modified as\n        standalone thing as it shares the resources with the frame it\n        was created of, but it's not a rootlevel frame any longer.\n\n        This is only used to implement if-statements.\n        \"\"\"\n        rv = self.copy()\n        rv.rootlevel = False\n        return rv\n\n    __copy__ = copy\n\n\nclass VisitorExit(RuntimeError):\n    \"\"\"Exception used by the `UndeclaredNameVisitor` to signal a stop.\"\"\"\n\n\nclass DependencyFinderVisitor(NodeVisitor):\n    \"\"\"A visitor that collects filter and test calls.\"\"\"\n\n    def __init__(self):\n        self.filters = set()\n        self.tests = set()\n\n    def visit_Filter(self, node):\n        self.generic_visit(node)\n        self.filters.add(node.name)\n\n    def visit_Test(self, node):\n        self.generic_visit(node)\n        self.tests.add(node.name)\n\n    def visit_Block(self, node):\n        \"\"\"Stop visiting at blocks.\"\"\"\n\n\nclass UndeclaredNameVisitor(NodeVisitor):\n    \"\"\"A visitor that checks if a name is accessed without being\n    declared.  This is different from the frame visitor as it will\n    not stop at closure frames.\n    \"\"\"\n\n    def __init__(self, names):\n        self.names = set(names)\n        self.undeclared = set()\n\n    def visit_Name(self, node):\n        if node.ctx == 'load' and node.name in self.names:\n            self.undeclared.add(node.name)\n            if self.undeclared == self.names:\n                raise VisitorExit()\n        else:\n            self.names.discard(node.name)\n\n    def visit_Block(self, node):\n        \"\"\"Stop visiting a blocks.\"\"\"\n\n\nclass CompilerExit(Exception):\n    \"\"\"Raised if the compiler encountered a situation where it just\n    doesn't make sense to further process the code.  Any block that\n    raises such an exception is not further processed.\n    \"\"\"\n\n\nclass CodeGenerator(NodeVisitor):\n\n    def __init__(self, environment, name, filename, stream=None,\n                 defer_init=False, optimized=True):\n        if stream is None:\n            stream = NativeStringIO()\n        self.environment = environment\n        self.name = name\n        self.filename = filename\n        self.stream = stream\n        self.created_block_context = False\n        self.defer_init = defer_init\n        self.optimized = optimized\n        if optimized:\n            self.optimizer = Optimizer(environment)\n\n        # aliases for imports\n        self.import_aliases = {}\n\n        # a registry for all blocks.  Because blocks are moved out\n        # into the global python scope they are registered here\n        self.blocks = {}\n\n        # the number of extends statements so far\n        self.extends_so_far = 0\n\n        # some templates have a rootlevel extends.  In this case we\n        # can safely assume that we're a child template and do some\n        # more optimizations.\n        self.has_known_extends = False\n\n        # the current line number\n        self.code_lineno = 1\n\n        # registry of all filters and tests (global, not block local)\n        self.tests = {}\n        self.filters = {}\n\n        # the debug information\n        self.debug_info = []\n        self._write_debug_info = None\n\n        # the number of new lines before the next write()\n        self._new_lines = 0\n\n        # the line number of the last written statement\n        self._last_line = 0\n\n        # true if nothing was written so far.\n        self._first_write = True\n\n        # used by the `temporary_identifier` method to get new\n        # unique, temporary identifier\n        self._last_identifier = 0\n\n        # the current indentation\n        self._indentation = 0\n\n        # Tracks toplevel assignments\n        self._assign_stack = []\n\n        # Tracks parameter definition blocks\n        self._param_def_block = []\n\n        # Tracks the current context.\n        self._context_reference_stack = ['context']\n\n    # -- Various compilation helpers\n\n    def fail(self, msg, lineno):\n        \"\"\"Fail with a :exc:`TemplateAssertionError`.\"\"\"\n        raise TemplateAssertionError(msg, lineno, self.name, self.filename)\n\n    def temporary_identifier(self):\n        \"\"\"Get a new unique identifier.\"\"\"\n        self._last_identifier += 1\n        return 't_%d' % self._last_identifier\n\n    def buffer(self, frame):\n        \"\"\"Enable buffering for the frame from that point onwards.\"\"\"\n        frame.buffer = self.temporary_identifier()\n        self.writeline('%s = []' % frame.buffer)\n\n    def return_buffer_contents(self, frame, force_unescaped=False):\n        \"\"\"Return the buffer contents of the frame.\"\"\"\n        if not force_unescaped:\n            if frame.eval_ctx.volatile:\n                self.writeline('if context.eval_ctx.autoescape:')\n                self.indent()\n                self.writeline('return Markup(concat(%s))' % frame.buffer)\n                self.outdent()\n                self.writeline('else:')\n                self.indent()\n                self.writeline('return concat(%s)' % frame.buffer)\n                self.outdent()\n                return\n            elif frame.eval_ctx.autoescape:\n                self.writeline('return Markup(concat(%s))' % frame.buffer)\n                return\n        self.writeline('return concat(%s)' % frame.buffer)\n\n    def indent(self):\n        \"\"\"Indent by one.\"\"\"\n        self._indentation += 1\n\n    def outdent(self, step=1):\n        \"\"\"Outdent by step.\"\"\"\n        self._indentation -= step\n\n    def start_write(self, frame, node=None):\n        \"\"\"Yield or write into the frame buffer.\"\"\"\n        if frame.buffer is None:\n            self.writeline('yield ', node)\n        else:\n            self.writeline('%s.append(' % frame.buffer, node)\n\n    def end_write(self, frame):\n        \"\"\"End the writing process started by `start_write`.\"\"\"\n        if frame.buffer is not None:\n            self.write(')')\n\n    def simple_write(self, s, frame, node=None):\n        \"\"\"Simple shortcut for start_write + write + end_write.\"\"\"\n        self.start_write(frame, node)\n        self.write(s)\n        self.end_write(frame)\n\n    def blockvisit(self, nodes, frame):\n        \"\"\"Visit a list of nodes as block in a frame.  If the current frame\n        is no buffer a dummy ``if 0: yield None`` is written automatically.\n        \"\"\"\n        try:\n            self.writeline('pass')\n            for node in nodes:\n                self.visit(node, frame)\n        except CompilerExit:\n            pass\n\n    def write(self, x):\n        \"\"\"Write a string into the output stream.\"\"\"\n        if self._new_lines:\n            if not self._first_write:\n                self.stream.write('\\n' * self._new_lines)\n                self.code_lineno += self._new_lines\n                if self._write_debug_info is not None:\n                    self.debug_info.append((self._write_debug_info,\n                                            self.code_lineno))\n                    self._write_debug_info = None\n            self._first_write = False\n            self.stream.write('    ' * self._indentation)\n            self._new_lines = 0\n        self.stream.write(x)\n\n    def writeline(self, x, node=None, extra=0):\n        \"\"\"Combination of newline and write.\"\"\"\n        self.newline(node, extra)\n        self.write(x)\n\n    def newline(self, node=None, extra=0):\n        \"\"\"Add one or more newlines before the next write.\"\"\"\n        self._new_lines = max(self._new_lines, 1 + extra)\n        if node is not None and node.lineno != self._last_line:\n            self._write_debug_info = node.lineno\n            self._last_line = node.lineno\n\n    def signature(self, node, frame, extra_kwargs=None):\n        \"\"\"Writes a function call to the stream for the current node.\n        A leading comma is added automatically.  The extra keyword\n        arguments may not include python keywords otherwise a syntax\n        error could occour.  The extra keyword arguments should be given\n        as python dict.\n        \"\"\"\n        # if any of the given keyword arguments is a python keyword\n        # we have to make sure that no invalid call is created.\n        kwarg_workaround = False\n        for kwarg in chain((x.key for x in node.kwargs), extra_kwargs or ()):\n            if is_python_keyword(kwarg):\n                kwarg_workaround = True\n                break\n\n        for arg in node.args:\n            self.write(', ')\n            self.visit(arg, frame)\n\n        if not kwarg_workaround:\n            for kwarg in node.kwargs:\n                self.write(', ')\n                self.visit(kwarg, frame)\n            if extra_kwargs is not None:\n                for key, value in iteritems(extra_kwargs):\n                    self.write(', %s=%s' % (key, value))\n        if node.dyn_args:\n            self.write(', *')\n            self.visit(node.dyn_args, frame)\n\n        if kwarg_workaround:\n            if node.dyn_kwargs is not None:\n                self.write(', **dict({')\n            else:\n                self.write(', **{')\n            for kwarg in node.kwargs:\n                self.write('%r: ' % kwarg.key)\n                self.visit(kwarg.value, frame)\n                self.write(', ')\n            if extra_kwargs is not None:\n                for key, value in iteritems(extra_kwargs):\n                    self.write('%r: %s, ' % (key, value))\n            if node.dyn_kwargs is not None:\n                self.write('}, **')\n                self.visit(node.dyn_kwargs, frame)\n                self.write(')')\n            else:\n                self.write('}')\n\n        elif node.dyn_kwargs is not None:\n            self.write(', **')\n            self.visit(node.dyn_kwargs, frame)\n\n    def pull_dependencies(self, nodes):\n        \"\"\"Pull all the dependencies.\"\"\"\n        visitor = DependencyFinderVisitor()\n        for node in nodes:\n            visitor.visit(node)\n        for dependency in 'filters', 'tests':\n            mapping = getattr(self, dependency)\n            for name in getattr(visitor, dependency):\n                if name not in mapping:\n                    mapping[name] = self.temporary_identifier()\n                self.writeline('%s = environment.%s[%r]' %\n                               (mapping[name], dependency, name))\n\n    def enter_frame(self, frame):\n        undefs = []\n        for target, (action, param) in iteritems(frame.symbols.loads):\n            if action == VAR_LOAD_PARAMETER:\n                pass\n            elif action == VAR_LOAD_RESOLVE:\n                self.writeline('%s = %s(%r)' %\n                               (target, self.get_resolve_func(), param))\n            elif action == VAR_LOAD_ALIAS:\n                self.writeline('%s = %s' % (target, param))\n            elif action == VAR_LOAD_UNDEFINED:\n                undefs.append(target)\n            else:\n                raise NotImplementedError('unknown load instruction')\n        if undefs:\n            self.writeline('%s = missing' % ' = '.join(undefs))\n\n    def leave_frame(self, frame, with_python_scope=False):\n        if not with_python_scope:\n            undefs = []\n            for target, _ in iteritems(frame.symbols.loads):\n                undefs.append(target)\n            if undefs:\n                self.writeline('%s = missing' % ' = '.join(undefs))\n\n    def func(self, name):\n        if self.environment.is_async:\n            return 'async def %s' % name\n        return 'def %s' % name\n\n    def macro_body(self, node, frame):\n        \"\"\"Dump the function def of a macro or call block.\"\"\"\n        frame = frame.inner()\n        frame.symbols.analyze_node(node)\n        macro_ref = MacroRef(node)\n\n        explicit_caller = None\n        skip_special_params = set()\n        args = []\n        for idx, arg in enumerate(node.args):\n            if arg.name == 'caller':\n                explicit_caller = idx\n            if arg.name in ('kwargs', 'varargs'):\n                skip_special_params.add(arg.name)\n            args.append(frame.symbols.ref(arg.name))\n\n        undeclared = find_undeclared(node.body, ('caller', 'kwargs', 'varargs'))\n\n        if 'caller' in undeclared:\n            # In older Jinja2 versions there was a bug that allowed caller\n            # to retain the special behavior even if it was mentioned in\n            # the argument list.  However thankfully this was only really\n            # working if it was the last argument.  So we are explicitly\n            # checking this now and error out if it is anywhere else in\n            # the argument list.\n            if explicit_caller is not None:\n                try:\n                    node.defaults[explicit_caller - len(node.args)]\n                except IndexError:\n                    self.fail('When defining macros or call blocks the '\n                              'special \"caller\" argument must be omitted '\n                              'or be given a default.', node.lineno)\n            else:\n                args.append(frame.symbols.declare_parameter('caller'))\n            macro_ref.accesses_caller = True\n        if 'kwargs' in undeclared and not 'kwargs' in skip_special_params:\n            args.append(frame.symbols.declare_parameter('kwargs'))\n            macro_ref.accesses_kwargs = True\n        if 'varargs' in undeclared and not 'varargs' in skip_special_params:\n            args.append(frame.symbols.declare_parameter('varargs'))\n            macro_ref.accesses_varargs = True\n\n        # macros are delayed, they never require output checks\n        frame.require_output_check = False\n        frame.symbols.analyze_node(node)\n        self.writeline('%s(%s):' % (self.func('macro'), ', '.join(args)), node)\n        self.indent()\n\n        self.buffer(frame)\n        self.enter_frame(frame)\n\n        self.push_parameter_definitions(frame)\n        for idx, arg in enumerate(node.args):\n            ref = frame.symbols.ref(arg.name)\n            self.writeline('if %s is missing:' % ref)\n            self.indent()\n            try:\n                default = node.defaults[idx - len(node.args)]\n            except IndexError:\n                self.writeline('%s = undefined(%r, name=%r)' % (\n                    ref,\n                    'parameter %r was not provided' % arg.name,\n                    arg.name))\n            else:\n                self.writeline('%s = ' % ref)\n                self.visit(default, frame)\n            self.mark_parameter_stored(ref)\n            self.outdent()\n        self.pop_parameter_definitions()\n\n        self.blockvisit(node.body, frame)\n        self.return_buffer_contents(frame, force_unescaped=True)\n        self.leave_frame(frame, with_python_scope=True)\n        self.outdent()\n\n        return frame, macro_ref\n\n    def macro_def(self, macro_ref, frame):\n        \"\"\"Dump the macro definition for the def created by macro_body.\"\"\"\n        arg_tuple = ', '.join(repr(x.name) for x in macro_ref.node.args)\n        name = getattr(macro_ref.node, 'name', None)\n        if len(macro_ref.node.args) == 1:\n            arg_tuple += ','\n        self.write('Macro(environment, macro, %r, (%s), %r, %r, %r, '\n                   'context.eval_ctx.autoescape)' %\n                   (name, arg_tuple, macro_ref.accesses_kwargs,\n                    macro_ref.accesses_varargs, macro_ref.accesses_caller))\n\n    def position(self, node):\n        \"\"\"Return a human readable position for the node.\"\"\"\n        rv = 'line %d' % node.lineno\n        if self.name is not None:\n            rv += ' in ' + repr(self.name)\n        return rv\n\n    def dump_local_context(self, frame):\n        return '{%s}' % ', '.join(\n            '%r: %s' % (name, target) for name, target\n            in iteritems(frame.symbols.dump_stores()))\n\n    def write_commons(self):\n        \"\"\"Writes a common preamble that is used by root and block functions.\n        Primarily this sets up common local helpers and enforces a generator\n        through a dead branch.\n        \"\"\"\n        self.writeline('resolve = context.resolve_or_missing')\n        self.writeline('undefined = environment.undefined')\n        self.writeline('if 0: yield None')\n\n    def push_parameter_definitions(self, frame):\n        \"\"\"Pushes all parameter targets from the given frame into a local\n        stack that permits tracking of yet to be assigned parameters.  In\n        particular this enables the optimization from `visit_Name` to skip\n        undefined expressions for parameters in macros as macros can reference\n        otherwise unbound parameters.\n        \"\"\"\n        self._param_def_block.append(frame.symbols.dump_param_targets())\n\n    def pop_parameter_definitions(self):\n        \"\"\"Pops the current parameter definitions set.\"\"\"\n        self._param_def_block.pop()\n\n    def mark_parameter_stored(self, target):\n        \"\"\"Marks a parameter in the current parameter definitions as stored.\n        This will skip the enforced undefined checks.\n        \"\"\"\n        if self._param_def_block:\n            self._param_def_block[-1].discard(target)\n\n    def push_context_reference(self, target):\n        self._context_reference_stack.append(target)\n\n    def pop_context_reference(self):\n        self._context_reference_stack.pop()\n\n    def get_context_ref(self):\n        return self._context_reference_stack[-1]\n\n    def get_resolve_func(self):\n        target = self._context_reference_stack[-1]\n        if target == 'context':\n            return 'resolve'\n        return '%s.resolve' % target\n\n    def derive_context(self, frame):\n        return '%s.derived(%s)' % (\n            self.get_context_ref(),\n            self.dump_local_context(frame),\n        )\n\n    def parameter_is_undeclared(self, target):\n        \"\"\"Checks if a given target is an undeclared parameter.\"\"\"\n        if not self._param_def_block:\n            return False\n        return target in self._param_def_block[-1]\n\n    def push_assign_tracking(self):\n        \"\"\"Pushes a new layer for assignment tracking.\"\"\"\n        self._assign_stack.append(set())\n\n    def pop_assign_tracking(self, frame):\n        \"\"\"Pops the topmost level for assignment tracking and updates the\n        context variables if necessary.\n        \"\"\"\n        vars = self._assign_stack.pop()\n        if not frame.toplevel or not vars:\n            return\n        public_names = [x for x in vars if x[:1] != '_']\n        if len(vars) == 1:\n            name = next(iter(vars))\n            ref = frame.symbols.ref(name)\n            self.writeline('context.vars[%r] = %s' % (name, ref))\n        else:\n            self.writeline('context.vars.update({')\n            for idx, name in enumerate(vars):\n                if idx:\n                    self.write(', ')\n                ref = frame.symbols.ref(name)\n                self.write('%r: %s' % (name, ref))\n            self.write('})')\n        if public_names:\n            if len(public_names) == 1:\n                self.writeline('context.exported_vars.add(%r)' %\n                               public_names[0])\n            else:\n                self.writeline('context.exported_vars.update((%s))' %\n                               ', '.join(imap(repr, public_names)))\n\n    # -- Statement Visitors\n\n    def visit_Template(self, node, frame=None):\n        assert frame is None, 'no root frame allowed'\n        eval_ctx = EvalContext(self.environment, self.name)\n\n        from jinja2.runtime import __all__ as exported\n        self.writeline('from __future__ import %s' % ', '.join(code_features))\n        self.writeline('from jinja2.runtime import ' + ', '.join(exported))\n\n        if self.environment.is_async:\n            self.writeline('from jinja2.asyncsupport import auto_await, '\n                           'auto_aiter, make_async_loop_context')\n\n        # if we want a deferred initialization we cannot move the\n        # environment into a local name\n        envenv = not self.defer_init and ', environment=environment' or ''\n\n        # do we have an extends tag at all?  If not, we can save some\n        # overhead by just not processing any inheritance code.\n        have_extends = node.find(nodes.Extends) is not None\n\n        # find all blocks\n        for block in node.find_all(nodes.Block):\n            if block.name in self.blocks:\n                self.fail('block %r defined twice' % block.name, block.lineno)\n            self.blocks[block.name] = block\n\n        # find all imports and import them\n        for import_ in node.find_all(nodes.ImportedName):\n            if import_.importname not in self.import_aliases:\n                imp = import_.importname\n                self.import_aliases[imp] = alias = self.temporary_identifier()\n                if '.' in imp:\n                    module, obj = imp.rsplit('.', 1)\n                    self.writeline('from %s import %s as %s' %\n                                   (module, obj, alias))\n                else:\n                    self.writeline('import %s as %s' % (imp, alias))\n\n        # add the load name\n        self.writeline('name = %r' % self.name)\n\n        # generate the root render function.\n        self.writeline('%s(context, missing=missing%s):' %\n                       (self.func('root'), envenv), extra=1)\n        self.indent()\n        self.write_commons()\n\n        # process the root\n        frame = Frame(eval_ctx)\n        if 'self' in find_undeclared(node.body, ('self',)):\n            ref = frame.symbols.declare_parameter('self')\n            self.writeline('%s = TemplateReference(context)' % ref)\n        frame.symbols.analyze_node(node)\n        frame.toplevel = frame.rootlevel = True\n        frame.require_output_check = have_extends and not self.has_known_extends\n        if have_extends:\n            self.writeline('parent_template = None')\n        self.enter_frame(frame)\n        self.pull_dependencies(node.body)\n        self.blockvisit(node.body, frame)\n        self.leave_frame(frame, with_python_scope=True)\n        self.outdent()\n\n        # make sure that the parent root is called.\n        if have_extends:\n            if not self.has_known_extends:\n                self.indent()\n                self.writeline('if parent_template is not None:')\n            self.indent()\n            if supports_yield_from and not self.environment.is_async:\n                self.writeline('yield from parent_template.'\n                               'root_render_func(context)')\n            else:\n                self.writeline('%sfor event in parent_template.'\n                               'root_render_func(context):' %\n                               (self.environment.is_async and 'async ' or ''))\n                self.indent()\n                self.writeline('yield event')\n                self.outdent()\n            self.outdent(1 + (not self.has_known_extends))\n\n        # at this point we now have the blocks collected and can visit them too.\n        for name, block in iteritems(self.blocks):\n            self.writeline('%s(context, missing=missing%s):' %\n                           (self.func('block_' + name), envenv),\n                           block, 1)\n            self.indent()\n            self.write_commons()\n            # It's important that we do not make this frame a child of the\n            # toplevel template.  This would cause a variety of\n            # interesting issues with identifier tracking.\n            block_frame = Frame(eval_ctx)\n            undeclared = find_undeclared(block.body, ('self', 'super'))\n            if 'self' in undeclared:\n                ref = block_frame.symbols.declare_parameter('self')\n                self.writeline('%s = TemplateReference(context)' % ref)\n            if 'super' in undeclared:\n                ref = block_frame.symbols.declare_parameter('super')\n                self.writeline('%s = context.super(%r, '\n                               'block_%s)' % (ref, name, name))\n            block_frame.symbols.analyze_node(block)\n            block_frame.block = name\n            self.enter_frame(block_frame)\n            self.pull_dependencies(block.body)\n            self.blockvisit(block.body, block_frame)\n            self.leave_frame(block_frame, with_python_scope=True)\n            self.outdent()\n\n        self.writeline('blocks = {%s}' % ', '.join('%r: block_%s' % (x, x)\n                                                   for x in self.blocks),\n                       extra=1)\n\n        # add a function that returns the debug info\n        self.writeline('debug_info = %r' % '&'.join('%s=%s' % x for x\n                                                    in self.debug_info))\n\n    def visit_Block(self, node, frame):\n        \"\"\"Call a block and register it for the template.\"\"\"\n        level = 0\n        if frame.toplevel:\n            # if we know that we are a child template, there is no need to\n            # check if we are one\n            if self.has_known_extends:\n                return\n            if self.extends_so_far > 0:\n                self.writeline('if parent_template is None:')\n                self.indent()\n                level += 1\n\n        if node.scoped:\n            context = self.derive_context(frame)\n        else:\n            context = self.get_context_ref()\n\n        if supports_yield_from and not self.environment.is_async and \\\n           frame.buffer is None:\n            self.writeline('yield from context.blocks[%r][0](%s)' % (\n                           node.name, context), node)\n        else:\n            loop = self.environment.is_async and 'async for' or 'for'\n            self.writeline('%s event in context.blocks[%r][0](%s):' % (\n                           loop, node.name, context), node)\n            self.indent()\n            self.simple_write('event', frame)\n            self.outdent()\n\n        self.outdent(level)\n\n    def visit_Extends(self, node, frame):\n        \"\"\"Calls the extender.\"\"\"\n        if not frame.toplevel:\n            self.fail('cannot use extend from a non top-level scope',\n                      node.lineno)\n\n        # if the number of extends statements in general is zero so\n        # far, we don't have to add a check if something extended\n        # the template before this one.\n        if self.extends_so_far > 0:\n\n            # if we have a known extends we just add a template runtime\n            # error into the generated code.  We could catch that at compile\n            # time too, but i welcome it not to confuse users by throwing the\n            # same error at different times just \"because we can\".\n            if not self.has_known_extends:\n                self.writeline('if parent_template is not None:')\n                self.indent()\n            self.writeline('raise TemplateRuntimeError(%r)' %\n                           'extended multiple times')\n\n            # if we have a known extends already we don't need that code here\n            # as we know that the template execution will end here.\n            if self.has_known_extends:\n                raise CompilerExit()\n            else:\n                self.outdent()\n\n        self.writeline('parent_template = environment.get_template(', node)\n        self.visit(node.template, frame)\n        self.write(', %r)' % self.name)\n        self.writeline('for name, parent_block in parent_template.'\n                       'blocks.%s():' % dict_item_iter)\n        self.indent()\n        self.writeline('context.blocks.setdefault(name, []).'\n                       'append(parent_block)')\n        self.outdent()\n\n        # if this extends statement was in the root level we can take\n        # advantage of that information and simplify the generated code\n        # in the top level from this point onwards\n        if frame.rootlevel:\n            self.has_known_extends = True\n\n        # and now we have one more\n        self.extends_so_far += 1\n\n    def visit_Include(self, node, frame):\n        \"\"\"Handles includes.\"\"\"\n        if node.ignore_missing:\n            self.writeline('try:')\n            self.indent()\n\n        func_name = 'get_or_select_template'\n        if isinstance(node.template, nodes.Const):\n            if isinstance(node.template.value, string_types):\n                func_name = 'get_template'\n            elif isinstance(node.template.value, (tuple, list)):\n                func_name = 'select_template'\n        elif isinstance(node.template, (nodes.Tuple, nodes.List)):\n            func_name = 'select_template'\n\n        self.writeline('template = environment.%s(' % func_name, node)\n        self.visit(node.template, frame)\n        self.write(', %r)' % self.name)\n        if node.ignore_missing:\n            self.outdent()\n            self.writeline('except TemplateNotFound:')\n            self.indent()\n            self.writeline('pass')\n            self.outdent()\n            self.writeline('else:')\n            self.indent()\n\n        skip_event_yield = False\n        if node.with_context:\n            loop = self.environment.is_async and 'async for' or 'for'\n            self.writeline('%s event in template.root_render_func('\n                           'template.new_context(context.get_all(), True, '\n                           '%s)):' % (loop, self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.writeline('for event in (await '\n                           'template._get_default_module_async())'\n                           '._body_stream:')\n        else:\n            if supports_yield_from:\n                self.writeline('yield from template._get_default_module()'\n                               '._body_stream')\n                skip_event_yield = True\n            else:\n                self.writeline('for event in template._get_default_module()'\n                               '._body_stream:')\n\n        if not skip_event_yield:\n            self.indent()\n            self.simple_write('event', frame)\n            self.outdent()\n\n        if node.ignore_missing:\n            self.outdent()\n\n    def visit_Import(self, node, frame):\n        \"\"\"Visit regular imports.\"\"\"\n        self.writeline('%s = ' % frame.symbols.ref(node.target), node)\n        if frame.toplevel:\n            self.write('context.vars[%r] = ' % node.target)\n        if self.environment.is_async:\n            self.write('await ')\n        self.write('environment.get_template(')\n        self.visit(node.template, frame)\n        self.write(', %r).' % self.name)\n        if node.with_context:\n            self.write('make_module%s(context.get_all(), True, %s)'\n                       % (self.environment.is_async and '_async' or '',\n                          self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.write('_get_default_module_async()')\n        else:\n            self.write('_get_default_module()')\n        if frame.toplevel and not node.target.startswith('_'):\n            self.writeline('context.exported_vars.discard(%r)' % node.target)\n\n    def visit_FromImport(self, node, frame):\n        \"\"\"Visit named imports.\"\"\"\n        self.newline(node)\n        self.write('included_template = %senvironment.get_template('\n                   % (self.environment.is_async and 'await ' or ''))\n        self.visit(node.template, frame)\n        self.write(', %r).' % self.name)\n        if node.with_context:\n            self.write('make_module%s(context.get_all(), True, %s)'\n                       % (self.environment.is_async and '_async' or '',\n                          self.dump_local_context(frame)))\n        elif self.environment.is_async:\n            self.write('_get_default_module_async()')\n        else:\n            self.write('_get_default_module()')\n\n        var_names = []\n        discarded_names = []\n        for name in node.names:\n            if isinstance(name, tuple):\n                name, alias = name\n            else:\n                alias = name\n            self.writeline('%s = getattr(included_template, '\n                           '%r, missing)' % (frame.symbols.ref(alias), name))\n            self.writeline('if %s is missing:' % frame.symbols.ref(alias))\n            self.indent()\n            self.writeline('%s = undefined(%r %% '\n                           'included_template.__name__, '\n                           'name=%r)' %\n                           (frame.symbols.ref(alias),\n                            'the template %%r (imported on %s) does '\n                            'not export the requested name %s' % (\n                                self.position(node),\n                                repr(name)\n                           ), name))\n            self.outdent()\n            if frame.toplevel:\n                var_names.append(alias)\n                if not alias.startswith('_'):\n                    discarded_names.append(alias)\n\n        if var_names:\n            if len(var_names) == 1:\n                name = var_names[0]\n                self.writeline('context.vars[%r] = %s' %\n                               (name, frame.symbols.ref(name)))\n            else:\n                self.writeline('context.vars.update({%s})' % ', '.join(\n                    '%r: %s' % (name, frame.symbols.ref(name)) for name in var_names\n                ))\n        if discarded_names:\n            if len(discarded_names) == 1:\n                self.writeline('context.exported_vars.discard(%r)' %\n                               discarded_names[0])\n            else:\n                self.writeline('context.exported_vars.difference_'\n                               'update((%s))' % ', '.join(imap(repr, discarded_names)))\n\n    def visit_For(self, node, frame):\n        loop_frame = frame.inner()\n        test_frame = frame.inner()\n        else_frame = frame.inner()\n\n        # try to figure out if we have an extended loop.  An extended loop\n        # is necessary if the loop is in recursive mode if the special loop\n        # variable is accessed in the body.\n        extended_loop = node.recursive or 'loop' in \\\n                        find_undeclared(node.iter_child_nodes(\n                            only=('body',)), ('loop',))\n\n        loop_ref = None\n        if extended_loop:\n            loop_ref = loop_frame.symbols.declare_parameter('loop')\n\n        loop_frame.symbols.analyze_node(node, for_branch='body')\n        if node.else_:\n            else_frame.symbols.analyze_node(node, for_branch='else')\n\n        if node.test:\n            loop_filter_func = self.temporary_identifier()\n            test_frame.symbols.analyze_node(node, for_branch='test')\n            self.writeline('%s(fiter):' % self.func(loop_filter_func), node.test)\n            self.indent()\n            self.enter_frame(test_frame)\n            self.writeline(self.environment.is_async and 'async for ' or 'for ')\n            self.visit(node.target, loop_frame)\n            self.write(' in ')\n            self.write(self.environment.is_async and 'auto_aiter(fiter)' or 'fiter')\n            self.write(':')\n            self.indent()\n            self.writeline('if ', node.test)\n            self.visit(node.test, test_frame)\n            self.write(':')\n            self.indent()\n            self.writeline('yield ')\n            self.visit(node.target, loop_frame)\n            self.outdent(3)\n            self.leave_frame(test_frame, with_python_scope=True)\n\n        # if we don't have an recursive loop we have to find the shadowed\n        # variables at that point.  Because loops can be nested but the loop\n        # variable is a special one we have to enforce aliasing for it.\n        if node.recursive:\n            self.writeline('%s(reciter, loop_render_func, depth=0):' %\n                           self.func('loop'), node)\n            self.indent()\n            self.buffer(loop_frame)\n\n            # Use the same buffer for the else frame\n            else_frame.buffer = loop_frame.buffer\n\n        # make sure the loop variable is a special one and raise a template\n        # assertion error if a loop tries to write to loop\n        if extended_loop:\n            self.writeline('%s = missing' % loop_ref)\n\n        for name in node.find_all(nodes.Name):\n            if name.ctx == 'store' and name.name == 'loop':\n                self.fail('Can\\'t assign to special loop variable '\n                          'in for-loop target', name.lineno)\n\n        if node.else_:\n            iteration_indicator = self.temporary_identifier()\n            self.writeline('%s = 1' % iteration_indicator)\n\n        self.writeline(self.environment.is_async and 'async for ' or 'for ', node)\n        self.visit(node.target, loop_frame)\n        if extended_loop:\n            if self.environment.is_async:\n                self.write(', %s in await make_async_loop_context(' % loop_ref)\n            else:\n                self.write(', %s in LoopContext(' % loop_ref)\n        else:\n            self.write(' in ')\n\n        if node.test:\n            self.write('%s(' % loop_filter_func)\n        if node.recursive:\n            self.write('reciter')\n        else:\n            if self.environment.is_async and not extended_loop:\n                self.write('auto_aiter(')\n            self.visit(node.iter, frame)\n            if self.environment.is_async and not extended_loop:\n                self.write(')')\n        if node.test:\n            self.write(')')\n\n        if node.recursive:\n            self.write(', undefined, loop_render_func, depth):')\n        else:\n            self.write(extended_loop and ', undefined):' or ':')\n\n        self.indent()\n        self.enter_frame(loop_frame)\n\n        self.blockvisit(node.body, loop_frame)\n        if node.else_:\n            self.writeline('%s = 0' % iteration_indicator)\n        self.outdent()\n        self.leave_frame(loop_frame, with_python_scope=node.recursive\n                         and not node.else_)\n\n        if node.else_:\n            self.writeline('if %s:' % iteration_indicator)\n            self.indent()\n            self.enter_frame(else_frame)\n            self.blockvisit(node.else_, else_frame)\n            self.leave_frame(else_frame)\n            self.outdent()\n\n        # if the node was recursive we have to return the buffer contents\n        # and start the iteration code\n        if node.recursive:\n            self.return_buffer_contents(loop_frame)\n            self.outdent()\n            self.start_write(frame, node)\n            if self.environment.is_async:\n                self.write('await ')\n            self.write('loop(')\n            if self.environment.is_async:\n                self.write('auto_aiter(')\n            self.visit(node.iter, frame)\n            if self.environment.is_async:\n                self.write(')')\n            self.write(', loop)')\n            self.end_write(frame)\n\n    def visit_If(self, node, frame):\n        if_frame = frame.soft()\n        self.writeline('if ', node)\n        self.visit(node.test, if_frame)\n        self.write(':')\n        self.indent()\n        self.blockvisit(node.body, if_frame)\n        self.outdent()\n        for elif_ in node.elif_:\n            self.writeline('elif ', elif_)\n            self.visit(elif_.test, if_frame)\n            self.write(':')\n            self.indent()\n            self.blockvisit(elif_.body, if_frame)\n            self.outdent()\n        if node.else_:\n            self.writeline('else:')\n            self.indent()\n            self.blockvisit(node.else_, if_frame)\n            self.outdent()\n\n    def visit_Macro(self, node, frame):\n        macro_frame, macro_ref = self.macro_body(node, frame)\n        self.newline()\n        if frame.toplevel:\n            if not node.name.startswith('_'):\n                self.write('context.exported_vars.add(%r)' % node.name)\n            ref = frame.symbols.ref(node.name)\n            self.writeline('context.vars[%r] = ' % node.name)\n        self.write('%s = ' % frame.symbols.ref(node.name))\n        self.macro_def(macro_ref, macro_frame)\n\n    def visit_CallBlock(self, node, frame):\n        call_frame, macro_ref = self.macro_body(node, frame)\n        self.writeline('caller = ')\n        self.macro_def(macro_ref, call_frame)\n        self.start_write(frame, node)\n        self.visit_Call(node.call, frame, forward_caller=True)\n        self.end_write(frame)\n\n    def visit_FilterBlock(self, node, frame):\n        filter_frame = frame.inner()\n        filter_frame.symbols.analyze_node(node)\n        self.enter_frame(filter_frame)\n        self.buffer(filter_frame)\n        self.blockvisit(node.body, filter_frame)\n        self.start_write(frame, node)\n        self.visit_Filter(node.filter, filter_frame)\n        self.end_write(frame)\n        self.leave_frame(filter_frame)\n\n    def visit_With(self, node, frame):\n        with_frame = frame.inner()\n        with_frame.symbols.analyze_node(node)\n        self.enter_frame(with_frame)\n        for idx, (target, expr) in enumerate(izip(node.targets, node.values)):\n            self.newline()\n            self.visit(target, with_frame)\n            self.write(' = ')\n            self.visit(expr, frame)\n        self.blockvisit(node.body, with_frame)\n        self.leave_frame(with_frame)\n\n    def visit_ExprStmt(self, node, frame):\n        self.newline(node)\n        self.visit(node.node, frame)\n\n    def visit_Output(self, node, frame):\n        # if we have a known extends statement, we don't output anything\n        # if we are in a require_output_check section\n        if self.has_known_extends and frame.require_output_check:\n            return\n\n        allow_constant_finalize = True\n        if self.environment.finalize:\n            func = self.environment.finalize\n            if getattr(func, 'contextfunction', False) or \\\n               getattr(func, 'evalcontextfunction', False):\n                allow_constant_finalize = False\n            elif getattr(func, 'environmentfunction', False):\n                finalize = lambda x: text_type(\n                    self.environment.finalize(self.environment, x))\n            else:\n                finalize = lambda x: text_type(self.environment.finalize(x))\n        else:\n            finalize = text_type\n\n        # if we are inside a frame that requires output checking, we do so\n        outdent_later = False\n        if frame.require_output_check:\n            self.writeline('if parent_template is None:')\n            self.indent()\n            outdent_later = True\n\n        # try to evaluate as many chunks as possible into a static\n        # string at compile time.\n        body = []\n        for child in node.nodes:\n            try:\n                if not allow_constant_finalize:\n                    raise nodes.Impossible()\n                const = child.as_const(frame.eval_ctx)\n            except nodes.Impossible:\n                body.append(child)\n                continue\n            # the frame can't be volatile here, becaus otherwise the\n            # as_const() function would raise an Impossible exception\n            # at that point.\n            try:\n                if frame.eval_ctx.autoescape:\n                    if hasattr(const, '__html__'):\n                        const = const.__html__()\n                    else:\n                        const = escape(const)\n                const = finalize(const)\n            except Exception:\n                # if something goes wrong here we evaluate the node\n                # at runtime for easier debugging\n                body.append(child)\n                continue\n            if body and isinstance(body[-1], list):\n                body[-1].append(const)\n            else:\n                body.append([const])\n\n        # if we have less than 3 nodes or a buffer we yield or extend/append\n        if len(body) < 3 or frame.buffer is not None:\n            if frame.buffer is not None:\n                # for one item we append, for more we extend\n                if len(body) == 1:\n                    self.writeline('%s.append(' % frame.buffer)\n                else:\n                    self.writeline('%s.extend((' % frame.buffer)\n                self.indent()\n            for item in body:\n                if isinstance(item, list):\n                    val = repr(concat(item))\n                    if frame.buffer is None:\n                        self.writeline('yield ' + val)\n                    else:\n                        self.writeline(val + ',')\n                else:\n                    if frame.buffer is None:\n                        self.writeline('yield ', item)\n                    else:\n                        self.newline(item)\n                    close = 1\n                    if frame.eval_ctx.volatile:\n                        self.write('(escape if context.eval_ctx.autoescape'\n                                   ' else to_string)(')\n                    elif frame.eval_ctx.autoescape:\n                        self.write('escape(')\n                    else:\n                        self.write('to_string(')\n                    if self.environment.finalize is not None:\n                        self.write('environment.finalize(')\n                        if getattr(self.environment.finalize,\n                                   \"contextfunction\", False):\n                            self.write('context, ')\n                        close += 1\n                    self.visit(item, frame)\n                    self.write(')' * close)\n                    if frame.buffer is not None:\n                        self.write(',')\n            if frame.buffer is not None:\n                # close the open parentheses\n                self.outdent()\n                self.writeline(len(body) == 1 and ')' or '))')\n\n        # otherwise we create a format string as this is faster in that case\n        else:\n            format = []\n            arguments = []\n            for item in body:\n                if isinstance(item, list):\n                    format.append(concat(item).replace('%', '%%'))\n                else:\n                    format.append('%s')\n                    arguments.append(item)\n            self.writeline('yield ')\n            self.write(repr(concat(format)) + ' % (')\n            self.indent()\n            for argument in arguments:\n                self.newline(argument)\n                close = 0\n                if frame.eval_ctx.volatile:\n                    self.write('(escape if context.eval_ctx.autoescape else'\n                               ' to_string)(')\n                    close += 1\n                elif frame.eval_ctx.autoescape:\n                    self.write('escape(')\n                    close += 1\n                if self.environment.finalize is not None:\n                    self.write('environment.finalize(')\n                    if getattr(self.environment.finalize,\n                               'contextfunction', False):\n                        self.write('context, ')\n                    elif getattr(self.environment.finalize,\n                               'evalcontextfunction', False):\n                        self.write('context.eval_ctx, ')\n                    elif getattr(self.environment.finalize,\n                               'environmentfunction', False):\n                        self.write('environment, ')\n                    close += 1\n                self.visit(argument, frame)\n                self.write(')' * close + ', ')\n            self.outdent()\n            self.writeline(')')\n\n        if outdent_later:\n            self.outdent()\n\n    def visit_Assign(self, node, frame):\n        self.push_assign_tracking()\n        self.newline(node)\n        self.visit(node.target, frame)\n        self.write(' = ')\n        self.visit(node.node, frame)\n        self.pop_assign_tracking(frame)\n\n    def visit_AssignBlock(self, node, frame):\n        self.push_assign_tracking()\n        block_frame = frame.inner()\n        # This is a special case.  Since a set block always captures we\n        # will disable output checks.  This way one can use set blocks\n        # toplevel even in extended templates.\n        block_frame.require_output_check = False\n        block_frame.symbols.analyze_node(node)\n        self.enter_frame(block_frame)\n        self.buffer(block_frame)\n        self.blockvisit(node.body, block_frame)\n        self.newline(node)\n        self.visit(node.target, frame)\n        self.write(' = (Markup if context.eval_ctx.autoescape '\n                   'else identity)(')\n        if node.filter is not None:\n            self.visit_Filter(node.filter, block_frame)\n        else:\n            self.write('concat(%s)' % block_frame.buffer)\n        self.write(')')\n        self.pop_assign_tracking(frame)\n        self.leave_frame(block_frame)\n\n    # -- Expression Visitors\n\n    def visit_Name(self, node, frame):\n        if node.ctx == 'store' and frame.toplevel:\n            if self._assign_stack:\n                self._assign_stack[-1].add(node.name)\n        ref = frame.symbols.ref(node.name)\n\n        # If we are looking up a variable we might have to deal with the\n        # case where it's undefined.  We can skip that case if the load\n        # instruction indicates a parameter which are always defined.\n        if node.ctx == 'load':\n            load = frame.symbols.find_load(ref)\n            if not (load is not None and load[0] == VAR_LOAD_PARAMETER and \\\n                    not self.parameter_is_undeclared(ref)):\n                self.write('(undefined(name=%r) if %s is missing else %s)' %\n                           (node.name, ref, ref))\n                return\n\n        self.write(ref)\n\n    def visit_NSRef(self, node, frame):\n        # NSRefs can only be used to store values; since they use the normal\n        # `foo.bar` notation they will be parsed as a normal attribute access\n        # when used anywhere but in a `set` context\n        ref = frame.symbols.ref(node.name)\n        self.writeline('if not isinstance(%s, Namespace):' % ref)\n        self.indent()\n        self.writeline('raise TemplateRuntimeError(%r)' %\n                       'cannot assign attribute on non-namespace object')\n        self.outdent()\n        self.writeline('%s[%r]' % (ref, node.attr))\n\n    def visit_Const(self, node, frame):\n        val = node.as_const(frame.eval_ctx)\n        if isinstance(val, float):\n            self.write(str(val))\n        else:\n            self.write(repr(val))\n\n    def visit_TemplateData(self, node, frame):\n        try:\n            self.write(repr(node.as_const(frame.eval_ctx)))\n        except nodes.Impossible:\n            self.write('(Markup if context.eval_ctx.autoescape else identity)(%r)'\n                       % node.data)\n\n    def visit_Tuple(self, node, frame):\n        self.write('(')\n        idx = -1\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item, frame)\n        self.write(idx == 0 and ',)' or ')')\n\n    def visit_List(self, node, frame):\n        self.write('[')\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item, frame)\n        self.write(']')\n\n    def visit_Dict(self, node, frame):\n        self.write('{')\n        for idx, item in enumerate(node.items):\n            if idx:\n                self.write(', ')\n            self.visit(item.key, frame)\n            self.write(': ')\n            self.visit(item.value, frame)\n        self.write('}')\n\n    def binop(operator, interceptable=True):\n        @optimizeconst\n        def visitor(self, node, frame):\n            if self.environment.sandboxed and \\\n               operator in self.environment.intercepted_binops:\n                self.write('environment.call_binop(context, %r, ' % operator)\n                self.visit(node.left, frame)\n                self.write(', ')\n                self.visit(node.right, frame)\n            else:\n                self.write('(')\n                self.visit(node.left, frame)\n                self.write(' %s ' % operator)\n                self.visit(node.right, frame)\n            self.write(')')\n        return visitor\n\n    def uaop(operator, interceptable=True):\n        @optimizeconst\n        def visitor(self, node, frame):\n            if self.environment.sandboxed and \\\n               operator in self.environment.intercepted_unops:\n                self.write('environment.call_unop(context, %r, ' % operator)\n                self.visit(node.node, frame)\n            else:\n                self.write('(' + operator)\n                self.visit(node.node, frame)\n            self.write(')')\n        return visitor\n\n    visit_Add = binop('+')\n    visit_Sub = binop('-')\n    visit_Mul = binop('*')\n    visit_Div = binop('/')\n    visit_FloorDiv = binop('//')\n    visit_Pow = binop('**')\n    visit_Mod = binop('%')\n    visit_And = binop('and', interceptable=False)\n    visit_Or = binop('or', interceptable=False)\n    visit_Pos = uaop('+')\n    visit_Neg = uaop('-')\n    visit_Not = uaop('not ', interceptable=False)\n    del binop, uaop\n\n    @optimizeconst\n    def visit_Concat(self, node, frame):\n        if frame.eval_ctx.volatile:\n            func_name = '(context.eval_ctx.volatile and' \\\n                        ' markup_join or unicode_join)'\n        elif frame.eval_ctx.autoescape:\n            func_name = 'markup_join'\n        else:\n            func_name = 'unicode_join'\n        self.write('%s((' % func_name)\n        for arg in node.nodes:\n            self.visit(arg, frame)\n            self.write(', ')\n        self.write('))')\n\n    @optimizeconst\n    def visit_Compare(self, node, frame):\n        self.visit(node.expr, frame)\n        for op in node.ops:\n            self.visit(op, frame)\n\n    def visit_Operand(self, node, frame):\n        self.write(' %s ' % operators[node.op])\n        self.visit(node.expr, frame)\n\n    @optimizeconst\n    def visit_Getattr(self, node, frame):\n        self.write('environment.getattr(')\n        self.visit(node.node, frame)\n        self.write(', %r)' % node.attr)\n\n    @optimizeconst\n    def visit_Getitem(self, node, frame):\n        # slices bypass the environment getitem method.\n        if isinstance(node.arg, nodes.Slice):\n            self.visit(node.node, frame)\n            self.write('[')\n            self.visit(node.arg, frame)\n            self.write(']')\n        else:\n            self.write('environment.getitem(')\n            self.visit(node.node, frame)\n            self.write(', ')\n            self.visit(node.arg, frame)\n            self.write(')')\n\n    def visit_Slice(self, node, frame):\n        if node.start is not None:\n            self.visit(node.start, frame)\n        self.write(':')\n        if node.stop is not None:\n            self.visit(node.stop, frame)\n        if node.step is not None:\n            self.write(':')\n            self.visit(node.step, frame)\n\n    @optimizeconst\n    def visit_Filter(self, node, frame):\n        if self.environment.is_async:\n            self.write('await auto_await(')\n        self.write(self.filters[node.name] + '(')\n        func = self.environment.filters.get(node.name)\n        if func is None:\n            self.fail('no filter named %r' % node.name, node.lineno)\n        if getattr(func, 'contextfilter', False):\n            self.write('context, ')\n        elif getattr(func, 'evalcontextfilter', False):\n            self.write('context.eval_ctx, ')\n        elif getattr(func, 'environmentfilter', False):\n            self.write('environment, ')\n\n        # if the filter node is None we are inside a filter block\n        # and want to write to the current buffer\n        if node.node is not None:\n            self.visit(node.node, frame)\n        elif frame.eval_ctx.volatile:\n            self.write('(context.eval_ctx.autoescape and'\n                       ' Markup(concat(%s)) or concat(%s))' %\n                       (frame.buffer, frame.buffer))\n        elif frame.eval_ctx.autoescape:\n            self.write('Markup(concat(%s))' % frame.buffer)\n        else:\n            self.write('concat(%s)' % frame.buffer)\n        self.signature(node, frame)\n        self.write(')')\n        if self.environment.is_async:\n            self.write(')')\n\n    @optimizeconst\n    def visit_Test(self, node, frame):\n        self.write(self.tests[node.name] + '(')\n        if node.name not in self.environment.tests:\n            self.fail('no test named %r' % node.name, node.lineno)\n        self.visit(node.node, frame)\n        self.signature(node, frame)\n        self.write(')')\n\n    @optimizeconst\n    def visit_CondExpr(self, node, frame):\n        def write_expr2():\n            if node.expr2 is not None:\n                return self.visit(node.expr2, frame)\n            self.write('undefined(%r)' % ('the inline if-'\n                       'expression on %s evaluated to false and '\n                       'no else section was defined.' % self.position(node)))\n\n        self.write('(')\n        self.visit(node.expr1, frame)\n        self.write(' if ')\n        self.visit(node.test, frame)\n        self.write(' else ')\n        write_expr2()\n        self.write(')')\n\n    @optimizeconst\n    def visit_Call(self, node, frame, forward_caller=False):\n        if self.environment.is_async:\n            self.write('await auto_await(')\n        if self.environment.sandboxed:\n            self.write('environment.call(context, ')\n        else:\n            self.write('context.call(')\n        self.visit(node.node, frame)\n        extra_kwargs = forward_caller and {'caller': 'caller'} or None\n        self.signature(node, frame, extra_kwargs)\n        self.write(')')\n        if self.environment.is_async:\n            self.write(')')\n\n    def visit_Keyword(self, node, frame):\n        self.write(node.key + '=')\n        self.visit(node.value, frame)\n\n    # -- Unused nodes for extensions\n\n    def visit_MarkSafe(self, node, frame):\n        self.write('Markup(')\n        self.visit(node.expr, frame)\n        self.write(')')\n\n    def visit_MarkSafeIfAutoescape(self, node, frame):\n        self.write('(context.eval_ctx.autoescape and Markup or identity)(')\n        self.visit(node.expr, frame)\n        self.write(')')\n\n    def visit_EnvironmentAttribute(self, node, frame):\n        self.write('environment.' + node.name)\n\n    def visit_ExtensionAttribute(self, node, frame):\n        self.write('environment.extensions[%r].%s' % (node.identifier, node.name))\n\n    def visit_ImportedName(self, node, frame):\n        self.write(self.import_aliases[node.importname])\n\n    def visit_InternalName(self, node, frame):\n        self.write(node.name)\n\n    def visit_ContextReference(self, node, frame):\n        self.write('context')\n\n    def visit_Continue(self, node, frame):\n        self.writeline('continue', node)\n\n    def visit_Break(self, node, frame):\n        self.writeline('break', node)\n\n    def visit_Scope(self, node, frame):\n        scope_frame = frame.inner()\n        scope_frame.symbols.analyze_node(node)\n        self.enter_frame(scope_frame)\n        self.blockvisit(node.body, scope_frame)\n        self.leave_frame(scope_frame)\n\n    def visit_OverlayScope(self, node, frame):\n        ctx = self.temporary_identifier()\n        self.writeline('%s = %s' % (ctx, self.derive_context(frame)))\n        self.writeline('%s.vars = ' % ctx)\n        self.visit(node.context, frame)\n        self.push_context_reference(ctx)\n\n        scope_frame = frame.inner(isolated=True)\n        scope_frame.symbols.analyze_node(node)\n        self.enter_frame(scope_frame)\n        self.blockvisit(node.body, scope_frame)\n        self.leave_frame(scope_frame)\n        self.pop_context_reference()\n\n    def visit_EvalContextModifier(self, node, frame):\n        for keyword in node.options:\n            self.writeline('context.eval_ctx.%s = ' % keyword.key)\n            self.visit(keyword.value, frame)\n            try:\n                val = keyword.value.as_const(frame.eval_ctx)\n            except nodes.Impossible:\n                frame.eval_ctx.volatile = True\n            else:\n                setattr(frame.eval_ctx, keyword.key, val)\n\n    def visit_ScopedEvalContextModifier(self, node, frame):\n        old_ctx_name = self.temporary_identifier()\n        saved_ctx = frame.eval_ctx.save()\n        self.writeline('%s = context.eval_ctx.save()' % old_ctx_name)\n        self.visit_EvalContextModifier(node, frame)\n        for child in node.body:\n            self.visit(child, frame)\n        frame.eval_ctx.revert(saved_ctx)\n        self.writeline('context.eval_ctx.revert(%s)' % old_ctx_name)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/constants.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja.constants\n    ~~~~~~~~~~~~~~~\n\n    Various constants.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\n\n\n#: list of lorem ipsum words used by the lipsum() helper function\nLOREM_IPSUM_WORDS = u'''\\\na ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at\nauctor augue bibendum blandit class commodo condimentum congue consectetuer\nconsequat conubia convallis cras cubilia cum curabitur curae cursus dapibus\ndiam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend\nelementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames\nfaucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac\nhendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum\njusto lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem\nluctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie\nmollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non\nnonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque\npenatibus per pharetra phasellus placerat platea porta porttitor posuere\npotenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus\nridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit\nsociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor\ntempus tincidunt torquent tortor tristique turpis ullamcorper ultrices\nultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus\nviverra volutpat vulputate'''\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/debug.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.debug\n    ~~~~~~~~~~~~\n\n    Implements the debug interface for Jinja.  This module does some pretty\n    ugly stuff with the Python traceback system in order to achieve tracebacks\n    with correct line numbers, locals and contents.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport sys\nimport traceback\nfrom types import TracebackType, CodeType\nfrom jinja2.utils import missing, internal_code\nfrom jinja2.exceptions import TemplateSyntaxError\nfrom jinja2._compat import iteritems, reraise, PY2\n\n# on pypy we can take advantage of transparent proxies\ntry:\n    from __pypy__ import tproxy\nexcept ImportError:\n    tproxy = None\n\n\n# how does the raise helper look like?\ntry:\n    exec(\"raise TypeError, 'foo'\")\nexcept SyntaxError:\n    raise_helper = 'raise __jinja_exception__[1]'\nexcept TypeError:\n    raise_helper = 'raise __jinja_exception__[0], __jinja_exception__[1]'\n\n\nclass TracebackFrameProxy(object):\n    \"\"\"Proxies a traceback frame.\"\"\"\n\n    def __init__(self, tb):\n        self.tb = tb\n        self._tb_next = None\n\n    @property\n    def tb_next(self):\n        return self._tb_next\n\n    def set_next(self, next):\n        if tb_set_next is not None:\n            try:\n                tb_set_next(self.tb, next and next.tb or None)\n            except Exception:\n                # this function can fail due to all the hackery it does\n                # on various python implementations.  We just catch errors\n                # down and ignore them if necessary.\n                pass\n        self._tb_next = next\n\n    @property\n    def is_jinja_frame(self):\n        return '__jinja_template__' in self.tb.tb_frame.f_globals\n\n    def __getattr__(self, name):\n        return getattr(self.tb, name)\n\n\ndef make_frame_proxy(frame):\n    proxy = TracebackFrameProxy(frame)\n    if tproxy is None:\n        return proxy\n    def operation_handler(operation, *args, **kwargs):\n        if operation in ('__getattribute__', '__getattr__'):\n            return getattr(proxy, args[0])\n        elif operation == '__setattr__':\n            proxy.__setattr__(*args, **kwargs)\n        else:\n            return getattr(proxy, operation)(*args, **kwargs)\n    return tproxy(TracebackType, operation_handler)\n\n\nclass ProcessedTraceback(object):\n    \"\"\"Holds a Jinja preprocessed traceback for printing or reraising.\"\"\"\n\n    def __init__(self, exc_type, exc_value, frames):\n        assert frames, 'no frames for this traceback?'\n        self.exc_type = exc_type\n        self.exc_value = exc_value\n        self.frames = frames\n\n        # newly concatenate the frames (which are proxies)\n        prev_tb = None\n        for tb in self.frames:\n            if prev_tb is not None:\n                prev_tb.set_next(tb)\n            prev_tb = tb\n        prev_tb.set_next(None)\n\n    def render_as_text(self, limit=None):\n        \"\"\"Return a string with the traceback.\"\"\"\n        lines = traceback.format_exception(self.exc_type, self.exc_value,\n                                           self.frames[0], limit=limit)\n        return ''.join(lines).rstrip()\n\n    def render_as_html(self, full=False):\n        \"\"\"Return a unicode string with the traceback as rendered HTML.\"\"\"\n        from jinja2.debugrenderer import render_traceback\n        return u'%s\\n\\n<!--\\n%s\\n-->' % (\n            render_traceback(self, full=full),\n            self.render_as_text().decode('utf-8', 'replace')\n        )\n\n    @property\n    def is_template_syntax_error(self):\n        \"\"\"`True` if this is a template syntax error.\"\"\"\n        return isinstance(self.exc_value, TemplateSyntaxError)\n\n    @property\n    def exc_info(self):\n        \"\"\"Exception info tuple with a proxy around the frame objects.\"\"\"\n        return self.exc_type, self.exc_value, self.frames[0]\n\n    @property\n    def standard_exc_info(self):\n        \"\"\"Standard python exc_info for re-raising\"\"\"\n        tb = self.frames[0]\n        # the frame will be an actual traceback (or transparent proxy) if\n        # we are on pypy or a python implementation with support for tproxy\n        if type(tb) is not TracebackType:\n            tb = tb.tb\n        return self.exc_type, self.exc_value, tb\n\n\ndef make_traceback(exc_info, source_hint=None):\n    \"\"\"Creates a processed traceback object from the exc_info.\"\"\"\n    exc_type, exc_value, tb = exc_info\n    if isinstance(exc_value, TemplateSyntaxError):\n        exc_info = translate_syntax_error(exc_value, source_hint)\n        initial_skip = 0\n    else:\n        initial_skip = 1\n    return translate_exception(exc_info, initial_skip)\n\n\ndef translate_syntax_error(error, source=None):\n    \"\"\"Rewrites a syntax error to please traceback systems.\"\"\"\n    error.source = source\n    error.translated = True\n    exc_info = (error.__class__, error, None)\n    filename = error.filename\n    if filename is None:\n        filename = '<unknown>'\n    return fake_exc_info(exc_info, filename, error.lineno)\n\n\ndef translate_exception(exc_info, initial_skip=0):\n    \"\"\"If passed an exc_info it will automatically rewrite the exceptions\n    all the way down to the correct line numbers and frames.\n    \"\"\"\n    tb = exc_info[2]\n    frames = []\n\n    # skip some internal frames if wanted\n    for x in range(initial_skip):\n        if tb is not None:\n            tb = tb.tb_next\n    initial_tb = tb\n\n    while tb is not None:\n        # skip frames decorated with @internalcode.  These are internal\n        # calls we can't avoid and that are useless in template debugging\n        # output.\n        if tb.tb_frame.f_code in internal_code:\n            tb = tb.tb_next\n            continue\n\n        # save a reference to the next frame if we override the current\n        # one with a faked one.\n        next = tb.tb_next\n\n        # fake template exceptions\n        template = tb.tb_frame.f_globals.get('__jinja_template__')\n        if template is not None:\n            lineno = template.get_corresponding_lineno(tb.tb_lineno)\n            tb = fake_exc_info(exc_info[:2] + (tb,), template.filename,\n                               lineno)[2]\n\n        frames.append(make_frame_proxy(tb))\n        tb = next\n\n    # if we don't have any exceptions in the frames left, we have to\n    # reraise it unchanged.\n    # XXX: can we backup here?  when could this happen?\n    if not frames:\n        reraise(exc_info[0], exc_info[1], exc_info[2])\n\n    return ProcessedTraceback(exc_info[0], exc_info[1], frames)\n\n\ndef get_jinja_locals(real_locals):\n    ctx = real_locals.get('context')\n    if ctx:\n        locals = ctx.get_all().copy()\n    else:\n        locals = {}\n\n    local_overrides = {}\n\n    for name, value in iteritems(real_locals):\n        if not name.startswith('l_') or value is missing:\n            continue\n        try:\n            _, depth, name = name.split('_', 2)\n            depth = int(depth)\n        except ValueError:\n            continue\n        cur_depth = local_overrides.get(name, (-1,))[0]\n        if cur_depth < depth:\n            local_overrides[name] = (depth, value)\n\n    for name, (_, value) in iteritems(local_overrides):\n        if value is missing:\n            locals.pop(name, None)\n        else:\n            locals[name] = value\n\n    return locals\n\n\ndef fake_exc_info(exc_info, filename, lineno):\n    \"\"\"Helper for `translate_exception`.\"\"\"\n    exc_type, exc_value, tb = exc_info\n\n    # figure the real context out\n    if tb is not None:\n        locals = get_jinja_locals(tb.tb_frame.f_locals)\n\n        # if there is a local called __jinja_exception__, we get\n        # rid of it to not break the debug functionality.\n        locals.pop('__jinja_exception__', None)\n    else:\n        locals = {}\n\n    # assamble fake globals we need\n    globals = {\n        '__name__':             filename,\n        '__file__':             filename,\n        '__jinja_exception__':  exc_info[:2],\n\n        # we don't want to keep the reference to the template around\n        # to not cause circular dependencies, but we mark it as Jinja\n        # frame for the ProcessedTraceback\n        '__jinja_template__':   None\n    }\n\n    # and fake the exception\n    code = compile('\\n' * (lineno - 1) + raise_helper, filename, 'exec')\n\n    # if it's possible, change the name of the code.  This won't work\n    # on some python environments such as google appengine\n    try:\n        if tb is None:\n            location = 'template'\n        else:\n            function = tb.tb_frame.f_code.co_name\n            if function == 'root':\n                location = 'top-level template code'\n            elif function.startswith('block_'):\n                location = 'block \"%s\"' % function[6:]\n            else:\n                location = 'template'\n\n        if PY2:\n            code = CodeType(0, code.co_nlocals, code.co_stacksize,\n                            code.co_flags, code.co_code, code.co_consts,\n                            code.co_names, code.co_varnames, filename,\n                            location, code.co_firstlineno,\n                            code.co_lnotab, (), ())\n        else:\n            code = CodeType(0, code.co_kwonlyargcount,\n                            code.co_nlocals, code.co_stacksize,\n                            code.co_flags, code.co_code, code.co_consts,\n                            code.co_names, code.co_varnames, filename,\n                            location, code.co_firstlineno,\n                            code.co_lnotab, (), ())\n    except Exception as e:\n        pass\n\n    # execute the code and catch the new traceback\n    try:\n        exec(code, globals, locals)\n    except:\n        exc_info = sys.exc_info()\n        new_tb = exc_info[2].tb_next\n\n    # return without this frame\n    return exc_info[:2] + (new_tb,)\n\n\ndef _init_ugly_crap():\n    \"\"\"This function implements a few ugly things so that we can patch the\n    traceback objects.  The function returned allows resetting `tb_next` on\n    any python traceback object.  Do not attempt to use this on non cpython\n    interpreters\n    \"\"\"\n    import ctypes\n    from types import TracebackType\n\n    if PY2:\n        # figure out size of _Py_ssize_t for Python 2:\n        if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):\n            _Py_ssize_t = ctypes.c_int64\n        else:\n            _Py_ssize_t = ctypes.c_int\n    else:\n        # platform ssize_t on Python 3\n        _Py_ssize_t = ctypes.c_ssize_t\n\n    # regular python\n    class _PyObject(ctypes.Structure):\n        pass\n    _PyObject._fields_ = [\n        ('ob_refcnt', _Py_ssize_t),\n        ('ob_type', ctypes.POINTER(_PyObject))\n    ]\n\n    # python with trace\n    if hasattr(sys, 'getobjects'):\n        class _PyObject(ctypes.Structure):\n            pass\n        _PyObject._fields_ = [\n            ('_ob_next', ctypes.POINTER(_PyObject)),\n            ('_ob_prev', ctypes.POINTER(_PyObject)),\n            ('ob_refcnt', _Py_ssize_t),\n            ('ob_type', ctypes.POINTER(_PyObject))\n        ]\n\n    class _Traceback(_PyObject):\n        pass\n    _Traceback._fields_ = [\n        ('tb_next', ctypes.POINTER(_Traceback)),\n        ('tb_frame', ctypes.POINTER(_PyObject)),\n        ('tb_lasti', ctypes.c_int),\n        ('tb_lineno', ctypes.c_int)\n    ]\n\n    def tb_set_next(tb, next):\n        \"\"\"Set the tb_next attribute of a traceback object.\"\"\"\n        if not (isinstance(tb, TracebackType) and\n                (next is None or isinstance(next, TracebackType))):\n            raise TypeError('tb_set_next arguments must be traceback objects')\n        obj = _Traceback.from_address(id(tb))\n        if tb.tb_next is not None:\n            old = _Traceback.from_address(id(tb.tb_next))\n            old.ob_refcnt -= 1\n        if next is None:\n            obj.tb_next = ctypes.POINTER(_Traceback)()\n        else:\n            next = _Traceback.from_address(id(next))\n            next.ob_refcnt += 1\n            obj.tb_next = ctypes.pointer(next)\n\n    return tb_set_next\n\n\n# try to get a tb_set_next implementation if we don't have transparent\n# proxies.\ntb_set_next = None\nif tproxy is None:\n    # traceback.tb_next can be modified since CPython 3.7\n    if sys.version_info >= (3, 7):\n        def tb_set_next(tb, next):\n            tb.tb_next = next\n    else:\n        # On Python 3.6 and older, use ctypes\n        try:\n            tb_set_next = _init_ugly_crap()\n        except Exception:\n            pass\ndel _init_ugly_crap\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/defaults.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.defaults\n    ~~~~~~~~~~~~~~~\n\n    Jinja default filters and tags.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2._compat import range_type\nfrom jinja2.utils import generate_lorem_ipsum, Cycler, Joiner, Namespace\n\n\n# defaults for the parser / lexer\nBLOCK_START_STRING = '{%'\nBLOCK_END_STRING = '%}'\nVARIABLE_START_STRING = '{{'\nVARIABLE_END_STRING = '}}'\nCOMMENT_START_STRING = '{#'\nCOMMENT_END_STRING = '#}'\nLINE_STATEMENT_PREFIX = None\nLINE_COMMENT_PREFIX = None\nTRIM_BLOCKS = False\nLSTRIP_BLOCKS = False\nNEWLINE_SEQUENCE = '\\n'\nKEEP_TRAILING_NEWLINE = False\n\n\n# default filters, tests and namespace\nfrom jinja2.filters import FILTERS as DEFAULT_FILTERS\nfrom jinja2.tests import TESTS as DEFAULT_TESTS\nDEFAULT_NAMESPACE = {\n    'range':        range_type,\n    'dict':         dict,\n    'lipsum':       generate_lorem_ipsum,\n    'cycler':       Cycler,\n    'joiner':       Joiner,\n    'namespace':    Namespace\n}\n\n\n# default policies\nDEFAULT_POLICIES = {\n    'compiler.ascii_str':   True,\n    'urlize.rel':           'noopener',\n    'urlize.target':        None,\n    'truncate.leeway':      5,\n    'json.dumps_function':  None,\n    'json.dumps_kwargs':    {'sort_keys': True},\n    'ext.i18n.trimmed':     False,\n}\n\n\n# export all constants\n__all__ = tuple(x for x in locals().keys() if x.isupper())\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/environment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.environment\n    ~~~~~~~~~~~~~~~~~~\n\n    Provides a class that holds runtime and parsing time options.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport sys\nimport weakref\nfrom functools import reduce, partial\nfrom jinja2 import nodes\nfrom jinja2.defaults import BLOCK_START_STRING, \\\n     BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \\\n     COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \\\n     LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \\\n     DEFAULT_FILTERS, DEFAULT_TESTS, DEFAULT_NAMESPACE, \\\n     DEFAULT_POLICIES, KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS\nfrom jinja2.lexer import get_lexer, TokenStream\nfrom jinja2.parser import Parser\nfrom jinja2.nodes import EvalContext\nfrom jinja2.compiler import generate, CodeGenerator\nfrom jinja2.runtime import Undefined, new_context, Context\nfrom jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \\\n     TemplatesNotFound, TemplateRuntimeError\nfrom jinja2.utils import import_string, LRUCache, Markup, missing, \\\n     concat, consume, internalcode, have_async_gen\nfrom jinja2._compat import imap, ifilter, string_types, iteritems, \\\n     text_type, reraise, implements_iterator, implements_to_string, \\\n     encode_filename, PY2, PYPY\n\n\n# for direct template usage we have up to ten living environments\n_spontaneous_environments = LRUCache(10)\n\n# the function to create jinja traceback objects.  This is dynamically\n# imported on the first exception in the exception handler.\n_make_traceback = None\n\n\ndef get_spontaneous_environment(*args):\n    \"\"\"Return a new spontaneous environment.  A spontaneous environment is an\n    unnamed and unaccessible (in theory) environment that is used for\n    templates generated from a string and not from the file system.\n    \"\"\"\n    try:\n        env = _spontaneous_environments.get(args)\n    except TypeError:\n        return Environment(*args)\n    if env is not None:\n        return env\n    _spontaneous_environments[args] = env = Environment(*args)\n    env.shared = True\n    return env\n\n\ndef create_cache(size):\n    \"\"\"Return the cache class for the given size.\"\"\"\n    if size == 0:\n        return None\n    if size < 0:\n        return {}\n    return LRUCache(size)\n\n\ndef copy_cache(cache):\n    \"\"\"Create an empty copy of the given cache.\"\"\"\n    if cache is None:\n        return None\n    elif type(cache) is dict:\n        return {}\n    return LRUCache(cache.capacity)\n\n\ndef load_extensions(environment, extensions):\n    \"\"\"Load the extensions from the list and bind it to the environment.\n    Returns a dict of instantiated environments.\n    \"\"\"\n    result = {}\n    for extension in extensions:\n        if isinstance(extension, string_types):\n            extension = import_string(extension)\n        result[extension.identifier] = extension(environment)\n    return result\n\n\ndef fail_for_missing_callable(string, name):\n    msg = string % name\n    if isinstance(name, Undefined):\n        try:\n            name._fail_with_undefined_error()\n        except Exception as e:\n            msg = '%s (%s; did you forget to quote the callable name?)' % (msg, e)\n    raise TemplateRuntimeError(msg)\n\n\ndef _environment_sanity_check(environment):\n    \"\"\"Perform a sanity check on the environment.\"\"\"\n    assert issubclass(environment.undefined, Undefined), 'undefined must ' \\\n        'be a subclass of undefined because filters depend on it.'\n    assert environment.block_start_string != \\\n        environment.variable_start_string != \\\n        environment.comment_start_string, 'block, variable and comment ' \\\n        'start strings must be different'\n    assert environment.newline_sequence in ('\\r', '\\r\\n', '\\n'), \\\n        'newline_sequence set to unknown line ending string.'\n    return environment\n\n\nclass Environment(object):\n    r\"\"\"The core component of Jinja is the `Environment`.  It contains\n    important shared variables like configuration, filters, tests,\n    globals and others.  Instances of this class may be modified if\n    they are not shared and if no template was loaded so far.\n    Modifications on environments after the first template was loaded\n    will lead to surprising effects and undefined behavior.\n\n    Here are the possible initialization parameters:\n\n        `block_start_string`\n            The string marking the beginning of a block.  Defaults to ``'{%'``.\n\n        `block_end_string`\n            The string marking the end of a block.  Defaults to ``'%}'``.\n\n        `variable_start_string`\n            The string marking the beginning of a print statement.\n            Defaults to ``'{{'``.\n\n        `variable_end_string`\n            The string marking the end of a print statement.  Defaults to\n            ``'}}'``.\n\n        `comment_start_string`\n            The string marking the beginning of a comment.  Defaults to ``'{#'``.\n\n        `comment_end_string`\n            The string marking the end of a comment.  Defaults to ``'#}'``.\n\n        `line_statement_prefix`\n            If given and a string, this will be used as prefix for line based\n            statements.  See also :ref:`line-statements`.\n\n        `line_comment_prefix`\n            If given and a string, this will be used as prefix for line based\n            comments.  See also :ref:`line-statements`.\n\n            .. versionadded:: 2.2\n\n        `trim_blocks`\n            If this is set to ``True`` the first newline after a block is\n            removed (block, not variable tag!).  Defaults to `False`.\n\n        `lstrip_blocks`\n            If this is set to ``True`` leading spaces and tabs are stripped\n            from the start of a line to a block.  Defaults to `False`.\n\n        `newline_sequence`\n            The sequence that starts a newline.  Must be one of ``'\\r'``,\n            ``'\\n'`` or ``'\\r\\n'``.  The default is ``'\\n'`` which is a\n            useful default for Linux and OS X systems as well as web\n            applications.\n\n        `keep_trailing_newline`\n            Preserve the trailing newline when rendering templates.\n            The default is ``False``, which causes a single newline,\n            if present, to be stripped from the end of the template.\n\n            .. versionadded:: 2.7\n\n        `extensions`\n            List of Jinja extensions to use.  This can either be import paths\n            as strings or extension classes.  For more information have a\n            look at :ref:`the extensions documentation <jinja-extensions>`.\n\n        `optimized`\n            should the optimizer be enabled?  Default is ``True``.\n\n        `undefined`\n            :class:`Undefined` or a subclass of it that is used to represent\n            undefined values in the template.\n\n        `finalize`\n            A callable that can be used to process the result of a variable\n            expression before it is output.  For example one can convert\n            ``None`` implicitly into an empty string here.\n\n        `autoescape`\n            If set to ``True`` the XML/HTML autoescaping feature is enabled by\n            default.  For more details about autoescaping see\n            :class:`~jinja2.utils.Markup`.  As of Jinja 2.4 this can also\n            be a callable that is passed the template name and has to\n            return ``True`` or ``False`` depending on autoescape should be\n            enabled by default.\n\n            .. versionchanged:: 2.4\n               `autoescape` can now be a function\n\n        `loader`\n            The template loader for this environment.\n\n        `cache_size`\n            The size of the cache.  Per default this is ``400`` which means\n            that if more than 400 templates are loaded the loader will clean\n            out the least recently used template.  If the cache size is set to\n            ``0`` templates are recompiled all the time, if the cache size is\n            ``-1`` the cache will not be cleaned.\n\n            .. versionchanged:: 2.8\n               The cache size was increased to 400 from a low 50.\n\n        `auto_reload`\n            Some loaders load templates from locations where the template\n            sources may change (ie: file system or database).  If\n            ``auto_reload`` is set to ``True`` (default) every time a template is\n            requested the loader checks if the source changed and if yes, it\n            will reload the template.  For higher performance it's possible to\n            disable that.\n\n        `bytecode_cache`\n            If set to a bytecode cache object, this object will provide a\n            cache for the internal Jinja bytecode so that templates don't\n            have to be parsed if they were not changed.\n\n            See :ref:`bytecode-cache` for more information.\n\n        `enable_async`\n            If set to true this enables async template execution which allows\n            you to take advantage of newer Python features.  This requires\n            Python 3.6 or later.\n    \"\"\"\n\n    #: if this environment is sandboxed.  Modifying this variable won't make\n    #: the environment sandboxed though.  For a real sandboxed environment\n    #: have a look at jinja2.sandbox.  This flag alone controls the code\n    #: generation by the compiler.\n    sandboxed = False\n\n    #: True if the environment is just an overlay\n    overlayed = False\n\n    #: the environment this environment is linked to if it is an overlay\n    linked_to = None\n\n    #: shared environments have this set to `True`.  A shared environment\n    #: must not be modified\n    shared = False\n\n    #: these are currently EXPERIMENTAL undocumented features.\n    exception_handler = None\n    exception_formatter = None\n\n    #: the class that is used for code generation.  See\n    #: :class:`~jinja2.compiler.CodeGenerator` for more information.\n    code_generator_class = CodeGenerator\n\n    #: the context class thatis used for templates.  See\n    #: :class:`~jinja2.runtime.Context` for more information.\n    context_class = Context\n\n    def __init__(self,\n                 block_start_string=BLOCK_START_STRING,\n                 block_end_string=BLOCK_END_STRING,\n                 variable_start_string=VARIABLE_START_STRING,\n                 variable_end_string=VARIABLE_END_STRING,\n                 comment_start_string=COMMENT_START_STRING,\n                 comment_end_string=COMMENT_END_STRING,\n                 line_statement_prefix=LINE_STATEMENT_PREFIX,\n                 line_comment_prefix=LINE_COMMENT_PREFIX,\n                 trim_blocks=TRIM_BLOCKS,\n                 lstrip_blocks=LSTRIP_BLOCKS,\n                 newline_sequence=NEWLINE_SEQUENCE,\n                 keep_trailing_newline=KEEP_TRAILING_NEWLINE,\n                 extensions=(),\n                 optimized=True,\n                 undefined=Undefined,\n                 finalize=None,\n                 autoescape=False,\n                 loader=None,\n                 cache_size=400,\n                 auto_reload=True,\n                 bytecode_cache=None,\n                 enable_async=False):\n        # !!Important notice!!\n        #   The constructor accepts quite a few arguments that should be\n        #   passed by keyword rather than position.  However it's important to\n        #   not change the order of arguments because it's used at least\n        #   internally in those cases:\n        #       -   spontaneous environments (i18n extension and Template)\n        #       -   unittests\n        #   If parameter changes are required only add parameters at the end\n        #   and don't change the arguments (or the defaults!) of the arguments\n        #   existing already.\n\n        # lexer / parser information\n        self.block_start_string = block_start_string\n        self.block_end_string = block_end_string\n        self.variable_start_string = variable_start_string\n        self.variable_end_string = variable_end_string\n        self.comment_start_string = comment_start_string\n        self.comment_end_string = comment_end_string\n        self.line_statement_prefix = line_statement_prefix\n        self.line_comment_prefix = line_comment_prefix\n        self.trim_blocks = trim_blocks\n        self.lstrip_blocks = lstrip_blocks\n        self.newline_sequence = newline_sequence\n        self.keep_trailing_newline = keep_trailing_newline\n\n        # runtime information\n        self.undefined = undefined\n        self.optimized = optimized\n        self.finalize = finalize\n        self.autoescape = autoescape\n\n        # defaults\n        self.filters = DEFAULT_FILTERS.copy()\n        self.tests = DEFAULT_TESTS.copy()\n        self.globals = DEFAULT_NAMESPACE.copy()\n\n        # set the loader provided\n        self.loader = loader\n        self.cache = create_cache(cache_size)\n        self.bytecode_cache = bytecode_cache\n        self.auto_reload = auto_reload\n\n        # configurable policies\n        self.policies = DEFAULT_POLICIES.copy()\n\n        # load extensions\n        self.extensions = load_extensions(self, extensions)\n\n        self.enable_async = enable_async\n        self.is_async = self.enable_async and have_async_gen\n\n        _environment_sanity_check(self)\n\n    def add_extension(self, extension):\n        \"\"\"Adds an extension after the environment was created.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        self.extensions.update(load_extensions(self, [extension]))\n\n    def extend(self, **attributes):\n        \"\"\"Add the items to the instance of the environment if they do not exist\n        yet.  This is used by :ref:`extensions <writing-extensions>` to register\n        callbacks and configuration values without breaking inheritance.\n        \"\"\"\n        for key, value in iteritems(attributes):\n            if not hasattr(self, key):\n                setattr(self, key, value)\n\n    def overlay(self, block_start_string=missing, block_end_string=missing,\n                variable_start_string=missing, variable_end_string=missing,\n                comment_start_string=missing, comment_end_string=missing,\n                line_statement_prefix=missing, line_comment_prefix=missing,\n                trim_blocks=missing, lstrip_blocks=missing,\n                extensions=missing, optimized=missing,\n                undefined=missing, finalize=missing, autoescape=missing,\n                loader=missing, cache_size=missing, auto_reload=missing,\n                bytecode_cache=missing):\n        \"\"\"Create a new overlay environment that shares all the data with the\n        current environment except for cache and the overridden attributes.\n        Extensions cannot be removed for an overlayed environment.  An overlayed\n        environment automatically gets all the extensions of the environment it\n        is linked to plus optional extra extensions.\n\n        Creating overlays should happen after the initial environment was set\n        up completely.  Not all attributes are truly linked, some are just\n        copied over so modifications on the original environment may not shine\n        through.\n        \"\"\"\n        args = dict(locals())\n        del args['self'], args['cache_size'], args['extensions']\n\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.overlayed = True\n        rv.linked_to = self\n\n        for key, value in iteritems(args):\n            if value is not missing:\n                setattr(rv, key, value)\n\n        if cache_size is not missing:\n            rv.cache = create_cache(cache_size)\n        else:\n            rv.cache = copy_cache(self.cache)\n\n        rv.extensions = {}\n        for key, value in iteritems(self.extensions):\n            rv.extensions[key] = value.bind(rv)\n        if extensions is not missing:\n            rv.extensions.update(load_extensions(rv, extensions))\n\n        return _environment_sanity_check(rv)\n\n    lexer = property(get_lexer, doc=\"The lexer for this environment.\")\n\n    def iter_extensions(self):\n        \"\"\"Iterates over the extensions by priority.\"\"\"\n        return iter(sorted(self.extensions.values(),\n                           key=lambda x: x.priority))\n\n    def getitem(self, obj, argument):\n        \"\"\"Get an item or attribute of an object but prefer the item.\"\"\"\n        try:\n            return obj[argument]\n        except (AttributeError, TypeError, LookupError):\n            if isinstance(argument, string_types):\n                try:\n                    attr = str(argument)\n                except Exception:\n                    pass\n                else:\n                    try:\n                        return getattr(obj, attr)\n                    except AttributeError:\n                        pass\n            return self.undefined(obj=obj, name=argument)\n\n    def getattr(self, obj, attribute):\n        \"\"\"Get an item or attribute of an object but prefer the attribute.\n        Unlike :meth:`getitem` the attribute *must* be a bytestring.\n        \"\"\"\n        try:\n            return getattr(obj, attribute)\n        except AttributeError:\n            pass\n        try:\n            return obj[attribute]\n        except (TypeError, LookupError, AttributeError):\n            return self.undefined(obj=obj, name=attribute)\n\n    def call_filter(self, name, value, args=None, kwargs=None,\n                    context=None, eval_ctx=None):\n        \"\"\"Invokes a filter on a value the same way the compiler does it.\n\n        Note that on Python 3 this might return a coroutine in case the\n        filter is running from an environment in async mode and the filter\n        supports async execution.  It's your responsibility to await this\n        if needed.\n\n        .. versionadded:: 2.7\n        \"\"\"\n        func = self.filters.get(name)\n        if func is None:\n            fail_for_missing_callable('no filter named %r', name)\n        args = [value] + list(args or ())\n        if getattr(func, 'contextfilter', False):\n            if context is None:\n                raise TemplateRuntimeError('Attempted to invoke context '\n                                           'filter without context')\n            args.insert(0, context)\n        elif getattr(func, 'evalcontextfilter', False):\n            if eval_ctx is None:\n                if context is not None:\n                    eval_ctx = context.eval_ctx\n                else:\n                    eval_ctx = EvalContext(self)\n            args.insert(0, eval_ctx)\n        elif getattr(func, 'environmentfilter', False):\n            args.insert(0, self)\n        return func(*args, **(kwargs or {}))\n\n    def call_test(self, name, value, args=None, kwargs=None):\n        \"\"\"Invokes a test on a value the same way the compiler does it.\n\n        .. versionadded:: 2.7\n        \"\"\"\n        func = self.tests.get(name)\n        if func is None:\n            fail_for_missing_callable('no test named %r', name)\n        return func(value, *(args or ()), **(kwargs or {}))\n\n    @internalcode\n    def parse(self, source, name=None, filename=None):\n        \"\"\"Parse the sourcecode and return the abstract syntax tree.  This\n        tree of nodes is used by the compiler to convert the template into\n        executable source- or bytecode.  This is useful for debugging or to\n        extract information from templates.\n\n        If you are :ref:`developing Jinja2 extensions <writing-extensions>`\n        this gives you a good overview of the node tree generated.\n        \"\"\"\n        try:\n            return self._parse(source, name, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source)\n\n    def _parse(self, source, name, filename):\n        \"\"\"Internal parsing function used by `parse` and `compile`.\"\"\"\n        return Parser(self, source, name, encode_filename(filename)).parse()\n\n    def lex(self, source, name=None, filename=None):\n        \"\"\"Lex the given sourcecode and return a generator that yields\n        tokens as tuples in the form ``(lineno, token_type, value)``.\n        This can be useful for :ref:`extension development <writing-extensions>`\n        and debugging templates.\n\n        This does not perform preprocessing.  If you want the preprocessing\n        of the extensions to be applied you have to filter source through\n        the :meth:`preprocess` method.\n        \"\"\"\n        source = text_type(source)\n        try:\n            return self.lexer.tokeniter(source, name, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source)\n\n    def preprocess(self, source, name=None, filename=None):\n        \"\"\"Preprocesses the source with all extensions.  This is automatically\n        called for all parsing and compiling methods but *not* for :meth:`lex`\n        because there you usually only want the actual source tokenized.\n        \"\"\"\n        return reduce(lambda s, e: e.preprocess(s, name, filename),\n                      self.iter_extensions(), text_type(source))\n\n    def _tokenize(self, source, name, filename=None, state=None):\n        \"\"\"Called by the parser to do the preprocessing and filtering\n        for all the extensions.  Returns a :class:`~jinja2.lexer.TokenStream`.\n        \"\"\"\n        source = self.preprocess(source, name, filename)\n        stream = self.lexer.tokenize(source, name, filename, state)\n        for ext in self.iter_extensions():\n            stream = ext.filter_stream(stream)\n            if not isinstance(stream, TokenStream):\n                stream = TokenStream(stream, name, filename)\n        return stream\n\n    def _generate(self, source, name, filename, defer_init=False):\n        \"\"\"Internal hook that can be overridden to hook a different generate\n        method in.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        return generate(source, self, name, filename, defer_init=defer_init,\n                        optimized=self.optimized)\n\n    def _compile(self, source, filename):\n        \"\"\"Internal hook that can be overridden to hook a different compile\n        method in.\n\n        .. versionadded:: 2.5\n        \"\"\"\n        return compile(source, filename, 'exec')\n\n    @internalcode\n    def compile(self, source, name=None, filename=None, raw=False,\n                defer_init=False):\n        \"\"\"Compile a node or template source code.  The `name` parameter is\n        the load name of the template after it was joined using\n        :meth:`join_path` if necessary, not the filename on the file system.\n        the `filename` parameter is the estimated filename of the template on\n        the file system.  If the template came from a database or memory this\n        can be omitted.\n\n        The return value of this method is a python code object.  If the `raw`\n        parameter is `True` the return value will be a string with python\n        code equivalent to the bytecode returned otherwise.  This method is\n        mainly used internally.\n\n        `defer_init` is use internally to aid the module code generator.  This\n        causes the generated code to be able to import without the global\n        environment variable to be set.\n\n        .. versionadded:: 2.4\n           `defer_init` parameter added.\n        \"\"\"\n        source_hint = None\n        try:\n            if isinstance(source, string_types):\n                source_hint = source\n                source = self._parse(source, name, filename)\n            source = self._generate(source, name, filename,\n                                    defer_init=defer_init)\n            if raw:\n                return source\n            if filename is None:\n                filename = '<template>'\n            else:\n                filename = encode_filename(filename)\n            return self._compile(source, filename)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        self.handle_exception(exc_info, source_hint=source_hint)\n\n    def compile_expression(self, source, undefined_to_none=True):\n        \"\"\"A handy helper method that returns a callable that accepts keyword\n        arguments that appear as variables in the expression.  If called it\n        returns the result of the expression.\n\n        This is useful if applications want to use the same rules as Jinja\n        in template \"configuration files\" or similar situations.\n\n        Example usage:\n\n        >>> env = Environment()\n        >>> expr = env.compile_expression('foo == 42')\n        >>> expr(foo=23)\n        False\n        >>> expr(foo=42)\n        True\n\n        Per default the return value is converted to `None` if the\n        expression returns an undefined value.  This can be changed\n        by setting `undefined_to_none` to `False`.\n\n        >>> env.compile_expression('var')() is None\n        True\n        >>> env.compile_expression('var', undefined_to_none=False)()\n        Undefined\n\n        .. versionadded:: 2.1\n        \"\"\"\n        parser = Parser(self, source, state='variable')\n        exc_info = None\n        try:\n            expr = parser.parse_expression()\n            if not parser.stream.eos:\n                raise TemplateSyntaxError('chunk after expression',\n                                          parser.stream.current.lineno,\n                                          None, None)\n            expr.set_environment(self)\n        except TemplateSyntaxError:\n            exc_info = sys.exc_info()\n        if exc_info is not None:\n            self.handle_exception(exc_info, source_hint=source)\n        body = [nodes.Assign(nodes.Name('result', 'store'), expr, lineno=1)]\n        template = self.from_string(nodes.Template(body, lineno=1))\n        return TemplateExpression(template, undefined_to_none)\n\n    def compile_templates(self, target, extensions=None, filter_func=None,\n                          zip='deflated', log_function=None,\n                          ignore_errors=True, py_compile=False):\n        \"\"\"Finds all the templates the loader can find, compiles them\n        and stores them in `target`.  If `zip` is `None`, instead of in a\n        zipfile, the templates will be stored in a directory.\n        By default a deflate zip algorithm is used. To switch to\n        the stored algorithm, `zip` can be set to ``'stored'``.\n\n        `extensions` and `filter_func` are passed to :meth:`list_templates`.\n        Each template returned will be compiled to the target folder or\n        zipfile.\n\n        By default template compilation errors are ignored.  In case a\n        log function is provided, errors are logged.  If you want template\n        syntax errors to abort the compilation you can set `ignore_errors`\n        to `False` and you will get an exception on syntax errors.\n\n        If `py_compile` is set to `True` .pyc files will be written to the\n        target instead of standard .py files.  This flag does not do anything\n        on pypy and Python 3 where pyc files are not picked up by itself and\n        don't give much benefit.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        from jinja2.loaders import ModuleLoader\n\n        if log_function is None:\n            log_function = lambda x: None\n\n        if py_compile:\n            if not PY2 or PYPY:\n                from warnings import warn\n                warn(Warning('py_compile has no effect on pypy or Python 3'))\n                py_compile = False\n            else:\n                import imp\n                import marshal\n                py_header = imp.get_magic() + \\\n                    u'\\xff\\xff\\xff\\xff'.encode('iso-8859-15')\n\n                # Python 3.3 added a source filesize to the header\n                if sys.version_info >= (3, 3):\n                    py_header += u'\\x00\\x00\\x00\\x00'.encode('iso-8859-15')\n\n        def write_file(filename, data, mode):\n            if zip:\n                info = ZipInfo(filename)\n                info.external_attr = 0o755 << 16\n                zip_file.writestr(info, data)\n            else:\n                f = open(os.path.join(target, filename), mode)\n                try:\n                    f.write(data)\n                finally:\n                    f.close()\n\n        if zip is not None:\n            from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED, ZIP_STORED\n            zip_file = ZipFile(target, 'w', dict(deflated=ZIP_DEFLATED,\n                                                 stored=ZIP_STORED)[zip])\n            log_function('Compiling into Zip archive \"%s\"' % target)\n        else:\n            if not os.path.isdir(target):\n                os.makedirs(target)\n            log_function('Compiling into folder \"%s\"' % target)\n\n        try:\n            for name in self.list_templates(extensions, filter_func):\n                source, filename, _ = self.loader.get_source(self, name)\n                try:\n                    code = self.compile(source, name, filename, True, True)\n                except TemplateSyntaxError as e:\n                    if not ignore_errors:\n                        raise\n                    log_function('Could not compile \"%s\": %s' % (name, e))\n                    continue\n\n                filename = ModuleLoader.get_module_filename(name)\n\n                if py_compile:\n                    c = self._compile(code, encode_filename(filename))\n                    write_file(filename + 'c', py_header +\n                               marshal.dumps(c), 'wb')\n                    log_function('Byte-compiled \"%s\" as %s' %\n                                 (name, filename + 'c'))\n                else:\n                    write_file(filename, code, 'w')\n                    log_function('Compiled \"%s\" as %s' % (name, filename))\n        finally:\n            if zip:\n                zip_file.close()\n\n        log_function('Finished compiling templates')\n\n    def list_templates(self, extensions=None, filter_func=None):\n        \"\"\"Returns a list of templates for this environment.  This requires\n        that the loader supports the loader's\n        :meth:`~BaseLoader.list_templates` method.\n\n        If there are other files in the template folder besides the\n        actual templates, the returned list can be filtered.  There are two\n        ways: either `extensions` is set to a list of file extensions for\n        templates, or a `filter_func` can be provided which is a callable that\n        is passed a template name and should return `True` if it should end up\n        in the result list.\n\n        If the loader does not support that, a :exc:`TypeError` is raised.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        x = self.loader.list_templates()\n        if extensions is not None:\n            if filter_func is not None:\n                raise TypeError('either extensions or filter_func '\n                                'can be passed, but not both')\n            filter_func = lambda x: '.' in x and \\\n                                    x.rsplit('.', 1)[1] in extensions\n        if filter_func is not None:\n            x = list(ifilter(filter_func, x))\n        return x\n\n    def handle_exception(self, exc_info=None, rendered=False, source_hint=None):\n        \"\"\"Exception handling helper.  This is used internally to either raise\n        rewritten exceptions or return a rendered traceback for the template.\n        \"\"\"\n        global _make_traceback\n        if exc_info is None:\n            exc_info = sys.exc_info()\n\n        # the debugging module is imported when it's used for the first time.\n        # we're doing a lot of stuff there and for applications that do not\n        # get any exceptions in template rendering there is no need to load\n        # all of that.\n        if _make_traceback is None:\n            from jinja2.debug import make_traceback as _make_traceback\n        traceback = _make_traceback(exc_info, source_hint)\n        if rendered and self.exception_formatter is not None:\n            return self.exception_formatter(traceback)\n        if self.exception_handler is not None:\n            self.exception_handler(traceback)\n        exc_type, exc_value, tb = traceback.standard_exc_info\n        reraise(exc_type, exc_value, tb)\n\n    def join_path(self, template, parent):\n        \"\"\"Join a template with the parent.  By default all the lookups are\n        relative to the loader root so this method returns the `template`\n        parameter unchanged, but if the paths should be relative to the\n        parent template, this function can be used to calculate the real\n        template name.\n\n        Subclasses may override this method and implement template path\n        joining here.\n        \"\"\"\n        return template\n\n    @internalcode\n    def _load_template(self, name, globals):\n        if self.loader is None:\n            raise TypeError('no loader for this environment specified')\n        cache_key = (weakref.ref(self.loader), name)\n        if self.cache is not None:\n            template = self.cache.get(cache_key)\n            if template is not None and (not self.auto_reload or\n                                         template.is_up_to_date):\n                return template\n        template = self.loader.load(self, name, globals)\n        if self.cache is not None:\n            self.cache[cache_key] = template\n        return template\n\n    @internalcode\n    def get_template(self, name, parent=None, globals=None):\n        \"\"\"Load a template from the loader.  If a loader is configured this\n        method asks the loader for the template and returns a :class:`Template`.\n        If the `parent` parameter is not `None`, :meth:`join_path` is called\n        to get the real template name before loading.\n\n        The `globals` parameter can be used to provide template wide globals.\n        These variables are available in the context at render time.\n\n        If the template does not exist a :exc:`TemplateNotFound` exception is\n        raised.\n\n        .. versionchanged:: 2.4\n           If `name` is a :class:`Template` object it is returned from the\n           function unchanged.\n        \"\"\"\n        if isinstance(name, Template):\n            return name\n        if parent is not None:\n            name = self.join_path(name, parent)\n        return self._load_template(name, self.make_globals(globals))\n\n    @internalcode\n    def select_template(self, names, parent=None, globals=None):\n        \"\"\"Works like :meth:`get_template` but tries a number of templates\n        before it fails.  If it cannot find any of the templates, it will\n        raise a :exc:`TemplatesNotFound` exception.\n\n        .. versionadded:: 2.3\n\n        .. versionchanged:: 2.4\n           If `names` contains a :class:`Template` object it is returned\n           from the function unchanged.\n        \"\"\"\n        if not names:\n            raise TemplatesNotFound(message=u'Tried to select from an empty list '\n                                            u'of templates.')\n        globals = self.make_globals(globals)\n        for name in names:\n            if isinstance(name, Template):\n                return name\n            if parent is not None:\n                name = self.join_path(name, parent)\n            try:\n                return self._load_template(name, globals)\n            except TemplateNotFound:\n                pass\n        raise TemplatesNotFound(names)\n\n    @internalcode\n    def get_or_select_template(self, template_name_or_list,\n                               parent=None, globals=None):\n        \"\"\"Does a typecheck and dispatches to :meth:`select_template`\n        if an iterable of template names is given, otherwise to\n        :meth:`get_template`.\n\n        .. versionadded:: 2.3\n        \"\"\"\n        if isinstance(template_name_or_list, string_types):\n            return self.get_template(template_name_or_list, parent, globals)\n        elif isinstance(template_name_or_list, Template):\n            return template_name_or_list\n        return self.select_template(template_name_or_list, parent, globals)\n\n    def from_string(self, source, globals=None, template_class=None):\n        \"\"\"Load a template from a string.  This parses the source given and\n        returns a :class:`Template` object.\n        \"\"\"\n        globals = self.make_globals(globals)\n        cls = template_class or self.template_class\n        return cls.from_code(self, self.compile(source), globals, None)\n\n    def make_globals(self, d):\n        \"\"\"Return a dict for the globals.\"\"\"\n        if not d:\n            return self.globals\n        return dict(self.globals, **d)\n\n\nclass Template(object):\n    \"\"\"The central template object.  This class represents a compiled template\n    and is used to evaluate it.\n\n    Normally the template object is generated from an :class:`Environment` but\n    it also has a constructor that makes it possible to create a template\n    instance directly using the constructor.  It takes the same arguments as\n    the environment constructor but it's not possible to specify a loader.\n\n    Every template object has a few methods and members that are guaranteed\n    to exist.  However it's important that a template object should be\n    considered immutable.  Modifications on the object are not supported.\n\n    Template objects created from the constructor rather than an environment\n    do have an `environment` attribute that points to a temporary environment\n    that is probably shared with other templates created with the constructor\n    and compatible settings.\n\n    >>> template = Template('Hello {{ name }}!')\n    >>> template.render(name='John Doe') == u'Hello John Doe!'\n    True\n    >>> stream = template.stream(name='John Doe')\n    >>> next(stream) == u'Hello John Doe!'\n    True\n    >>> next(stream)\n    Traceback (most recent call last):\n        ...\n    StopIteration\n    \"\"\"\n\n    def __new__(cls, source,\n                block_start_string=BLOCK_START_STRING,\n                block_end_string=BLOCK_END_STRING,\n                variable_start_string=VARIABLE_START_STRING,\n                variable_end_string=VARIABLE_END_STRING,\n                comment_start_string=COMMENT_START_STRING,\n                comment_end_string=COMMENT_END_STRING,\n                line_statement_prefix=LINE_STATEMENT_PREFIX,\n                line_comment_prefix=LINE_COMMENT_PREFIX,\n                trim_blocks=TRIM_BLOCKS,\n                lstrip_blocks=LSTRIP_BLOCKS,\n                newline_sequence=NEWLINE_SEQUENCE,\n                keep_trailing_newline=KEEP_TRAILING_NEWLINE,\n                extensions=(),\n                optimized=True,\n                undefined=Undefined,\n                finalize=None,\n                autoescape=False,\n                enable_async=False):\n        env = get_spontaneous_environment(\n            block_start_string, block_end_string, variable_start_string,\n            variable_end_string, comment_start_string, comment_end_string,\n            line_statement_prefix, line_comment_prefix, trim_blocks,\n            lstrip_blocks, newline_sequence, keep_trailing_newline,\n            frozenset(extensions), optimized, undefined, finalize, autoescape,\n            None, 0, False, None, enable_async)\n        return env.from_string(source, template_class=cls)\n\n    @classmethod\n    def from_code(cls, environment, code, globals, uptodate=None):\n        \"\"\"Creates a template object from compiled code and the globals.  This\n        is used by the loaders and environment to create a template object.\n        \"\"\"\n        namespace = {\n            'environment':  environment,\n            '__file__':     code.co_filename\n        }\n        exec(code, namespace)\n        rv = cls._from_namespace(environment, namespace, globals)\n        rv._uptodate = uptodate\n        return rv\n\n    @classmethod\n    def from_module_dict(cls, environment, module_dict, globals):\n        \"\"\"Creates a template object from a module.  This is used by the\n        module loader to create a template object.\n\n        .. versionadded:: 2.4\n        \"\"\"\n        return cls._from_namespace(environment, module_dict, globals)\n\n    @classmethod\n    def _from_namespace(cls, environment, namespace, globals):\n        t = object.__new__(cls)\n        t.environment = environment\n        t.globals = globals\n        t.name = namespace['name']\n        t.filename = namespace['__file__']\n        t.blocks = namespace['blocks']\n\n        # render function and module\n        t.root_render_func = namespace['root']\n        t._module = None\n\n        # debug and loader helpers\n        t._debug_info = namespace['debug_info']\n        t._uptodate = None\n\n        # store the reference\n        namespace['environment'] = environment\n        namespace['__jinja_template__'] = t\n\n        return t\n\n    def render(self, *args, **kwargs):\n        \"\"\"This method accepts the same arguments as the `dict` constructor:\n        A dict, a dict subclass or some keyword arguments.  If no arguments\n        are given the context will be empty.  These two calls do the same::\n\n            template.render(knights='that say nih')\n            template.render({'knights': 'that say nih'})\n\n        This will return the rendered template as unicode string.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n        try:\n            return concat(self.root_render_func(self.new_context(vars)))\n        except Exception:\n            exc_info = sys.exc_info()\n        return self.environment.handle_exception(exc_info, True)\n\n    def render_async(self, *args, **kwargs):\n        \"\"\"This works similar to :meth:`render` but returns a coroutine\n        that when awaited returns the entire rendered template string.  This\n        requires the async feature to be enabled.\n\n        Example usage::\n\n            await template.render_async(knights='that say nih; asynchronously')\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    def stream(self, *args, **kwargs):\n        \"\"\"Works exactly like :meth:`generate` but returns a\n        :class:`TemplateStream`.\n        \"\"\"\n        return TemplateStream(self.generate(*args, **kwargs))\n\n    def generate(self, *args, **kwargs):\n        \"\"\"For very large templates it can be useful to not render the whole\n        template at once but evaluate each statement after another and yield\n        piece for piece.  This method basically does exactly that and returns\n        a generator that yields one item after another as unicode strings.\n\n        It accepts the same arguments as :meth:`render`.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n        try:\n            for event in self.root_render_func(self.new_context(vars)):\n                yield event\n        except Exception:\n            exc_info = sys.exc_info()\n        else:\n            return\n        yield self.environment.handle_exception(exc_info, True)\n\n    def generate_async(self, *args, **kwargs):\n        \"\"\"An async version of :meth:`generate`.  Works very similarly but\n        returns an async iterator instead.\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    def new_context(self, vars=None, shared=False, locals=None):\n        \"\"\"Create a new :class:`Context` for this template.  The vars\n        provided will be passed to the template.  Per default the globals\n        are added to the context.  If shared is set to `True` the data\n        is passed as it to the context without adding the globals.\n\n        `locals` can be a dict of local variables for internal usage.\n        \"\"\"\n        return new_context(self.environment, self.name, self.blocks,\n                           vars, shared, self.globals, locals)\n\n    def make_module(self, vars=None, shared=False, locals=None):\n        \"\"\"This method works like the :attr:`module` attribute when called\n        without arguments but it will evaluate the template on every call\n        rather than caching it.  It's also possible to provide\n        a dict which is then used as context.  The arguments are the same\n        as for the :meth:`new_context` method.\n        \"\"\"\n        return TemplateModule(self, self.new_context(vars, shared, locals))\n\n    def make_module_async(self, vars=None, shared=False, locals=None):\n        \"\"\"As template module creation can invoke template code for\n        asynchronous exections this method must be used instead of the\n        normal :meth:`make_module` one.  Likewise the module attribute\n        becomes unavailable in async mode.\n        \"\"\"\n        # see asyncsupport for the actual implementation\n        raise NotImplementedError('This feature is not available for this '\n                                  'version of Python')\n\n    @internalcode\n    def _get_default_module(self):\n        if self._module is not None:\n            return self._module\n        self._module = rv = self.make_module()\n        return rv\n\n    @property\n    def module(self):\n        \"\"\"The template as module.  This is used for imports in the\n        template runtime but is also useful if one wants to access\n        exported template variables from the Python layer:\n\n        >>> t = Template('{% macro foo() %}42{% endmacro %}23')\n        >>> str(t.module)\n        '23'\n        >>> t.module.foo() == u'42'\n        True\n\n        This attribute is not available if async mode is enabled.\n        \"\"\"\n        return self._get_default_module()\n\n    def get_corresponding_lineno(self, lineno):\n        \"\"\"Return the source line number of a line number in the\n        generated bytecode as they are not in sync.\n        \"\"\"\n        for template_line, code_line in reversed(self.debug_info):\n            if code_line <= lineno:\n                return template_line\n        return 1\n\n    @property\n    def is_up_to_date(self):\n        \"\"\"If this variable is `False` there is a newer version available.\"\"\"\n        if self._uptodate is None:\n            return True\n        return self._uptodate()\n\n    @property\n    def debug_info(self):\n        \"\"\"The debug info mapping.\"\"\"\n        return [tuple(imap(int, x.split('='))) for x in\n                self._debug_info.split('&')]\n\n    def __repr__(self):\n        if self.name is None:\n            name = 'memory:%x' % id(self)\n        else:\n            name = repr(self.name)\n        return '<%s %s>' % (self.__class__.__name__, name)\n\n\n@implements_to_string\nclass TemplateModule(object):\n    \"\"\"Represents an imported template.  All the exported names of the\n    template are available as attributes on this object.  Additionally\n    converting it into an unicode- or bytestrings renders the contents.\n    \"\"\"\n\n    def __init__(self, template, context, body_stream=None):\n        if body_stream is None:\n            if context.environment.is_async:\n                raise RuntimeError('Async mode requires a body stream '\n                                   'to be passed to a template module.  Use '\n                                   'the async methods of the API you are '\n                                   'using.')\n            body_stream = list(template.root_render_func(context))\n        self._body_stream = body_stream\n        self.__dict__.update(context.get_exported())\n        self.__name__ = template.name\n\n    def __html__(self):\n        return Markup(concat(self._body_stream))\n\n    def __str__(self):\n        return concat(self._body_stream)\n\n    def __repr__(self):\n        if self.__name__ is None:\n            name = 'memory:%x' % id(self)\n        else:\n            name = repr(self.__name__)\n        return '<%s %s>' % (self.__class__.__name__, name)\n\n\nclass TemplateExpression(object):\n    \"\"\"The :meth:`jinja2.Environment.compile_expression` method returns an\n    instance of this object.  It encapsulates the expression-like access\n    to the template with an expression it wraps.\n    \"\"\"\n\n    def __init__(self, template, undefined_to_none):\n        self._template = template\n        self._undefined_to_none = undefined_to_none\n\n    def __call__(self, *args, **kwargs):\n        context = self._template.new_context(dict(*args, **kwargs))\n        consume(self._template.root_render_func(context))\n        rv = context.vars['result']\n        if self._undefined_to_none and isinstance(rv, Undefined):\n            rv = None\n        return rv\n\n\n@implements_iterator\nclass TemplateStream(object):\n    \"\"\"A template stream works pretty much like an ordinary python generator\n    but it can buffer multiple items to reduce the number of total iterations.\n    Per default the output is unbuffered which means that for every unbuffered\n    instruction in the template one unicode string is yielded.\n\n    If buffering is enabled with a buffer size of 5, five items are combined\n    into a new unicode string.  This is mainly useful if you are streaming\n    big templates to a client via WSGI which flushes after each iteration.\n    \"\"\"\n\n    def __init__(self, gen):\n        self._gen = gen\n        self.disable_buffering()\n\n    def dump(self, fp, encoding=None, errors='strict'):\n        \"\"\"Dump the complete stream into a file or file-like object.\n        Per default unicode strings are written, if you want to encode\n        before writing specify an `encoding`.\n\n        Example usage::\n\n            Template('Hello {{ name }}!').stream(name='foo').dump('hello.html')\n        \"\"\"\n        close = False\n        if isinstance(fp, string_types):\n            if encoding is None:\n                encoding = 'utf-8'\n            fp = open(fp, 'wb')\n            close = True\n        try:\n            if encoding is not None:\n                iterable = (x.encode(encoding, errors) for x in self)\n            else:\n                iterable = self\n            if hasattr(fp, 'writelines'):\n                fp.writelines(iterable)\n            else:\n                for item in iterable:\n                    fp.write(item)\n        finally:\n            if close:\n                fp.close()\n\n    def disable_buffering(self):\n        \"\"\"Disable the output buffering.\"\"\"\n        self._next = partial(next, self._gen)\n        self.buffered = False\n\n    def _buffered_generator(self, size):\n        buf = []\n        c_size = 0\n        push = buf.append\n\n        while 1:\n            try:\n                while c_size < size:\n                    c = next(self._gen)\n                    push(c)\n                    if c:\n                        c_size += 1\n            except StopIteration:\n                if not c_size:\n                    return\n            yield concat(buf)\n            del buf[:]\n            c_size = 0\n\n    def enable_buffering(self, size=5):\n        \"\"\"Enable buffering.  Buffer `size` items before yielding them.\"\"\"\n        if size <= 1:\n            raise ValueError('buffer size too small')\n\n        self.buffered = True\n        self._next = partial(next, self._buffered_generator(size))\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        return self._next()\n\n\n# hook in default template class.  if anyone reads this comment: ignore that\n# it's possible to use custom templates ;-)\nEnvironment.template_class = Template\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/exceptions.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.exceptions\n    ~~~~~~~~~~~~~~~~~\n\n    Jinja exceptions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2._compat import imap, text_type, PY2, implements_to_string\n\n\nclass TemplateError(Exception):\n    \"\"\"Baseclass for all template errors.\"\"\"\n\n    if PY2:\n        def __init__(self, message=None):\n            if message is not None:\n                message = text_type(message).encode('utf-8')\n            Exception.__init__(self, message)\n\n        @property\n        def message(self):\n            if self.args:\n                message = self.args[0]\n                if message is not None:\n                    return message.decode('utf-8', 'replace')\n\n        def __unicode__(self):\n            return self.message or u''\n    else:\n        def __init__(self, message=None):\n            Exception.__init__(self, message)\n\n        @property\n        def message(self):\n            if self.args:\n                message = self.args[0]\n                if message is not None:\n                    return message\n\n\n@implements_to_string\nclass TemplateNotFound(IOError, LookupError, TemplateError):\n    \"\"\"Raised if a template does not exist.\"\"\"\n\n    # looks weird, but removes the warning descriptor that just\n    # bogusly warns us about message being deprecated\n    message = None\n\n    def __init__(self, name, message=None):\n        IOError.__init__(self)\n        if message is None:\n            message = name\n        self.message = message\n        self.name = name\n        self.templates = [name]\n\n    def __str__(self):\n        return self.message\n\n\nclass TemplatesNotFound(TemplateNotFound):\n    \"\"\"Like :class:`TemplateNotFound` but raised if multiple templates\n    are selected.  This is a subclass of :class:`TemplateNotFound`\n    exception, so just catching the base exception will catch both.\n\n    .. versionadded:: 2.2\n    \"\"\"\n\n    def __init__(self, names=(), message=None):\n        if message is None:\n            message = u'none of the templates given were found: ' + \\\n                      u', '.join(imap(text_type, names))\n        TemplateNotFound.__init__(self, names and names[-1] or None, message)\n        self.templates = list(names)\n\n\n@implements_to_string\nclass TemplateSyntaxError(TemplateError):\n    \"\"\"Raised to tell the user that there is a problem with the template.\"\"\"\n\n    def __init__(self, message, lineno, name=None, filename=None):\n        TemplateError.__init__(self, message)\n        self.lineno = lineno\n        self.name = name\n        self.filename = filename\n        self.source = None\n\n        # this is set to True if the debug.translate_syntax_error\n        # function translated the syntax error into a new traceback\n        self.translated = False\n\n    def __str__(self):\n        # for translated errors we only return the message\n        if self.translated:\n            return self.message\n\n        # otherwise attach some stuff\n        location = 'line %d' % self.lineno\n        name = self.filename or self.name\n        if name:\n            location = 'File \"%s\", %s' % (name, location)\n        lines = [self.message, '  ' + location]\n\n        # if the source is set, add the line to the output\n        if self.source is not None:\n            try:\n                line = self.source.splitlines()[self.lineno - 1]\n            except IndexError:\n                line = None\n            if line:\n                lines.append('    ' + line.strip())\n\n        return u'\\n'.join(lines)\n\n\nclass TemplateAssertionError(TemplateSyntaxError):\n    \"\"\"Like a template syntax error, but covers cases where something in the\n    template caused an error at compile time that wasn't necessarily caused\n    by a syntax error.  However it's a direct subclass of\n    :exc:`TemplateSyntaxError` and has the same attributes.\n    \"\"\"\n\n\nclass TemplateRuntimeError(TemplateError):\n    \"\"\"A generic runtime error in the template engine.  Under some situations\n    Jinja may raise this exception.\n    \"\"\"\n\n\nclass UndefinedError(TemplateRuntimeError):\n    \"\"\"Raised if a template tries to operate on :class:`Undefined`.\"\"\"\n\n\nclass SecurityError(TemplateRuntimeError):\n    \"\"\"Raised if a template tries to do something insecure if the\n    sandbox is enabled.\n    \"\"\"\n\n\nclass FilterArgumentError(TemplateRuntimeError):\n    \"\"\"This error is raised if a filter was called with inappropriate\n    arguments\n    \"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/ext.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.ext\n    ~~~~~~~~~~\n\n    Jinja extensions allow to add custom tags similar to the way django custom\n    tags work.  By default two example extensions exist: an i18n and a cache\n    extension.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport re\n\nfrom jinja2 import nodes\nfrom jinja2.defaults import BLOCK_START_STRING, \\\n     BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \\\n     COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \\\n     LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \\\n     KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS\nfrom jinja2.environment import Environment\nfrom jinja2.runtime import concat\nfrom jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError\nfrom jinja2.utils import contextfunction, import_string, Markup\nfrom jinja2._compat import with_metaclass, string_types, iteritems\n\n\n# the only real useful gettext functions for a Jinja template.  Note\n# that ugettext must be assigned to gettext as Jinja doesn't support\n# non unicode strings.\nGETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')\n\n\nclass ExtensionRegistry(type):\n    \"\"\"Gives the extension an unique identifier.\"\"\"\n\n    def __new__(cls, name, bases, d):\n        rv = type.__new__(cls, name, bases, d)\n        rv.identifier = rv.__module__ + '.' + rv.__name__\n        return rv\n\n\nclass Extension(with_metaclass(ExtensionRegistry, object)):\n    \"\"\"Extensions can be used to add extra functionality to the Jinja template\n    system at the parser level.  Custom extensions are bound to an environment\n    but may not store environment specific data on `self`.  The reason for\n    this is that an extension can be bound to another environment (for\n    overlays) by creating a copy and reassigning the `environment` attribute.\n\n    As extensions are created by the environment they cannot accept any\n    arguments for configuration.  One may want to work around that by using\n    a factory function, but that is not possible as extensions are identified\n    by their import name.  The correct way to configure the extension is\n    storing the configuration values on the environment.  Because this way the\n    environment ends up acting as central configuration storage the\n    attributes may clash which is why extensions have to ensure that the names\n    they choose for configuration are not too generic.  ``prefix`` for example\n    is a terrible name, ``fragment_cache_prefix`` on the other hand is a good\n    name as includes the name of the extension (fragment cache).\n    \"\"\"\n\n    #: if this extension parses this is the list of tags it's listening to.\n    tags = set()\n\n    #: the priority of that extension.  This is especially useful for\n    #: extensions that preprocess values.  A lower value means higher\n    #: priority.\n    #:\n    #: .. versionadded:: 2.4\n    priority = 100\n\n    def __init__(self, environment):\n        self.environment = environment\n\n    def bind(self, environment):\n        \"\"\"Create a copy of this extension bound to another environment.\"\"\"\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.environment = environment\n        return rv\n\n    def preprocess(self, source, name, filename=None):\n        \"\"\"This method is called before the actual lexing and can be used to\n        preprocess the source.  The `filename` is optional.  The return value\n        must be the preprocessed source.\n        \"\"\"\n        return source\n\n    def filter_stream(self, stream):\n        \"\"\"It's passed a :class:`~jinja2.lexer.TokenStream` that can be used\n        to filter tokens returned.  This method has to return an iterable of\n        :class:`~jinja2.lexer.Token`\\\\s, but it doesn't have to return a\n        :class:`~jinja2.lexer.TokenStream`.\n\n        In the `ext` folder of the Jinja2 source distribution there is a file\n        called `inlinegettext.py` which implements a filter that utilizes this\n        method.\n        \"\"\"\n        return stream\n\n    def parse(self, parser):\n        \"\"\"If any of the :attr:`tags` matched this method is called with the\n        parser as first argument.  The token the parser stream is pointing at\n        is the name token that matched.  This method has to return one or a\n        list of multiple nodes.\n        \"\"\"\n        raise NotImplementedError()\n\n    def attr(self, name, lineno=None):\n        \"\"\"Return an attribute node for the current extension.  This is useful\n        to pass constants on extensions to generated template code.\n\n        ::\n\n            self.attr('_my_attribute', lineno=lineno)\n        \"\"\"\n        return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno)\n\n    def call_method(self, name, args=None, kwargs=None, dyn_args=None,\n                    dyn_kwargs=None, lineno=None):\n        \"\"\"Call a method of the extension.  This is a shortcut for\n        :meth:`attr` + :class:`jinja2.nodes.Call`.\n        \"\"\"\n        if args is None:\n            args = []\n        if kwargs is None:\n            kwargs = []\n        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,\n                          dyn_args, dyn_kwargs, lineno=lineno)\n\n\n@contextfunction\ndef _gettext_alias(__context, *args, **kwargs):\n    return __context.call(__context.resolve('gettext'), *args, **kwargs)\n\n\ndef _make_new_gettext(func):\n    @contextfunction\n    def gettext(__context, __string, **variables):\n        rv = __context.call(func, __string)\n        if __context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv % variables\n    return gettext\n\n\ndef _make_new_ngettext(func):\n    @contextfunction\n    def ngettext(__context, __singular, __plural, __num, **variables):\n        variables.setdefault('num', __num)\n        rv = __context.call(func, __singular, __plural, __num)\n        if __context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv % variables\n    return ngettext\n\n\nclass InternationalizationExtension(Extension):\n    \"\"\"This extension adds gettext support to Jinja2.\"\"\"\n    tags = set(['trans'])\n\n    # TODO: the i18n extension is currently reevaluating values in a few\n    # situations.  Take this example:\n    #   {% trans count=something() %}{{ count }} foo{% pluralize\n    #     %}{{ count }} fooss{% endtrans %}\n    # something is called twice here.  One time for the gettext value and\n    # the other time for the n-parameter of the ngettext function.\n\n    def __init__(self, environment):\n        Extension.__init__(self, environment)\n        environment.globals['_'] = _gettext_alias\n        environment.extend(\n            install_gettext_translations=self._install,\n            install_null_translations=self._install_null,\n            install_gettext_callables=self._install_callables,\n            uninstall_gettext_translations=self._uninstall,\n            extract_translations=self._extract,\n            newstyle_gettext=False\n        )\n\n    def _install(self, translations, newstyle=None):\n        gettext = getattr(translations, 'ugettext', None)\n        if gettext is None:\n            gettext = translations.gettext\n        ngettext = getattr(translations, 'ungettext', None)\n        if ngettext is None:\n            ngettext = translations.ngettext\n        self._install_callables(gettext, ngettext, newstyle)\n\n    def _install_null(self, newstyle=None):\n        self._install_callables(\n            lambda x: x,\n            lambda s, p, n: (n != 1 and (p,) or (s,))[0],\n            newstyle\n        )\n\n    def _install_callables(self, gettext, ngettext, newstyle=None):\n        if newstyle is not None:\n            self.environment.newstyle_gettext = newstyle\n        if self.environment.newstyle_gettext:\n            gettext = _make_new_gettext(gettext)\n            ngettext = _make_new_ngettext(ngettext)\n        self.environment.globals.update(\n            gettext=gettext,\n            ngettext=ngettext\n        )\n\n    def _uninstall(self, translations):\n        for key in 'gettext', 'ngettext':\n            self.environment.globals.pop(key, None)\n\n    def _extract(self, source, gettext_functions=GETTEXT_FUNCTIONS):\n        if isinstance(source, string_types):\n            source = self.environment.parse(source)\n        return extract_from_ast(source, gettext_functions)\n\n    def parse(self, parser):\n        \"\"\"Parse a translatable tag.\"\"\"\n        lineno = next(parser.stream).lineno\n        num_called_num = False\n\n        # find all the variables referenced.  Additionally a variable can be\n        # defined in the body of the trans block too, but this is checked at\n        # a later state.\n        plural_expr = None\n        plural_expr_assignment = None\n        variables = {}\n        trimmed = None\n        while parser.stream.current.type != 'block_end':\n            if variables:\n                parser.stream.expect('comma')\n\n            # skip colon for python compatibility\n            if parser.stream.skip_if('colon'):\n                break\n\n            name = parser.stream.expect('name')\n            if name.value in variables:\n                parser.fail('translatable variable %r defined twice.' %\n                            name.value, name.lineno,\n                            exc=TemplateAssertionError)\n\n            # expressions\n            if parser.stream.current.type == 'assign':\n                next(parser.stream)\n                variables[name.value] = var = parser.parse_expression()\n            elif trimmed is None and name.value in ('trimmed', 'notrimmed'):\n                trimmed = name.value == 'trimmed'\n                continue\n            else:\n                variables[name.value] = var = nodes.Name(name.value, 'load')\n\n            if plural_expr is None:\n                if isinstance(var, nodes.Call):\n                    plural_expr = nodes.Name('_trans', 'load')\n                    variables[name.value] = plural_expr\n                    plural_expr_assignment = nodes.Assign(\n                        nodes.Name('_trans', 'store'), var)\n                else:\n                    plural_expr = var\n                num_called_num = name.value == 'num'\n\n        parser.stream.expect('block_end')\n\n        plural = None\n        have_plural = False\n        referenced = set()\n\n        # now parse until endtrans or pluralize\n        singular_names, singular = self._parse_block(parser, True)\n        if singular_names:\n            referenced.update(singular_names)\n            if plural_expr is None:\n                plural_expr = nodes.Name(singular_names[0], 'load')\n                num_called_num = singular_names[0] == 'num'\n\n        # if we have a pluralize block, we parse that too\n        if parser.stream.current.test('name:pluralize'):\n            have_plural = True\n            next(parser.stream)\n            if parser.stream.current.type != 'block_end':\n                name = parser.stream.expect('name')\n                if name.value not in variables:\n                    parser.fail('unknown variable %r for pluralization' %\n                                name.value, name.lineno,\n                                exc=TemplateAssertionError)\n                plural_expr = variables[name.value]\n                num_called_num = name.value == 'num'\n            parser.stream.expect('block_end')\n            plural_names, plural = self._parse_block(parser, False)\n            next(parser.stream)\n            referenced.update(plural_names)\n        else:\n            next(parser.stream)\n\n        # register free names as simple name expressions\n        for var in referenced:\n            if var not in variables:\n                variables[var] = nodes.Name(var, 'load')\n\n        if not have_plural:\n            plural_expr = None\n        elif plural_expr is None:\n            parser.fail('pluralize without variables', lineno)\n\n        if trimmed is None:\n            trimmed = self.environment.policies['ext.i18n.trimmed']\n        if trimmed:\n            singular = self._trim_whitespace(singular)\n            if plural:\n                plural = self._trim_whitespace(plural)\n\n        node = self._make_node(singular, plural, variables, plural_expr,\n                               bool(referenced),\n                               num_called_num and have_plural)\n        node.set_lineno(lineno)\n        if plural_expr_assignment is not None:\n            return [plural_expr_assignment, node]\n        else:\n            return node\n\n    def _trim_whitespace(self, string, _ws_re=re.compile(r'\\s*\\n\\s*')):\n        return _ws_re.sub(' ', string.strip())\n\n    def _parse_block(self, parser, allow_pluralize):\n        \"\"\"Parse until the next block tag with a given name.\"\"\"\n        referenced = []\n        buf = []\n        while 1:\n            if parser.stream.current.type == 'data':\n                buf.append(parser.stream.current.value.replace('%', '%%'))\n                next(parser.stream)\n            elif parser.stream.current.type == 'variable_begin':\n                next(parser.stream)\n                name = parser.stream.expect('name').value\n                referenced.append(name)\n                buf.append('%%(%s)s' % name)\n                parser.stream.expect('variable_end')\n            elif parser.stream.current.type == 'block_begin':\n                next(parser.stream)\n                if parser.stream.current.test('name:endtrans'):\n                    break\n                elif parser.stream.current.test('name:pluralize'):\n                    if allow_pluralize:\n                        break\n                    parser.fail('a translatable section can have only one '\n                                'pluralize section')\n                parser.fail('control structures in translatable sections are '\n                            'not allowed')\n            elif parser.stream.eos:\n                parser.fail('unclosed translation block')\n            else:\n                assert False, 'internal parser error'\n\n        return referenced, concat(buf)\n\n    def _make_node(self, singular, plural, variables, plural_expr,\n                   vars_referenced, num_called_num):\n        \"\"\"Generates a useful node from the data provided.\"\"\"\n        # no variables referenced?  no need to escape for old style\n        # gettext invocations only if there are vars.\n        if not vars_referenced and not self.environment.newstyle_gettext:\n            singular = singular.replace('%%', '%')\n            if plural:\n                plural = plural.replace('%%', '%')\n\n        # singular only:\n        if plural_expr is None:\n            gettext = nodes.Name('gettext', 'load')\n            node = nodes.Call(gettext, [nodes.Const(singular)],\n                              [], None, None)\n\n        # singular and plural\n        else:\n            ngettext = nodes.Name('ngettext', 'load')\n            node = nodes.Call(ngettext, [\n                nodes.Const(singular),\n                nodes.Const(plural),\n                plural_expr\n            ], [], None, None)\n\n        # in case newstyle gettext is used, the method is powerful\n        # enough to handle the variable expansion and autoescape\n        # handling itself\n        if self.environment.newstyle_gettext:\n            for key, value in iteritems(variables):\n                # the function adds that later anyways in case num was\n                # called num, so just skip it.\n                if num_called_num and key == 'num':\n                    continue\n                node.kwargs.append(nodes.Keyword(key, value))\n\n        # otherwise do that here\n        else:\n            # mark the return value as safe if we are in an\n            # environment with autoescaping turned on\n            node = nodes.MarkSafeIfAutoescape(node)\n            if variables:\n                node = nodes.Mod(node, nodes.Dict([\n                    nodes.Pair(nodes.Const(key), value)\n                    for key, value in variables.items()\n                ]))\n        return nodes.Output([node])\n\n\nclass ExprStmtExtension(Extension):\n    \"\"\"Adds a `do` tag to Jinja2 that works like the print statement just\n    that it doesn't print the return value.\n    \"\"\"\n    tags = set(['do'])\n\n    def parse(self, parser):\n        node = nodes.ExprStmt(lineno=next(parser.stream).lineno)\n        node.node = parser.parse_tuple()\n        return node\n\n\nclass LoopControlExtension(Extension):\n    \"\"\"Adds break and continue to the template engine.\"\"\"\n    tags = set(['break', 'continue'])\n\n    def parse(self, parser):\n        token = next(parser.stream)\n        if token.value == 'break':\n            return nodes.Break(lineno=token.lineno)\n        return nodes.Continue(lineno=token.lineno)\n\n\nclass WithExtension(Extension):\n    pass\n\n\nclass AutoEscapeExtension(Extension):\n    pass\n\n\ndef extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,\n                     babel_style=True):\n    \"\"\"Extract localizable strings from the given template node.  Per\n    default this function returns matches in babel style that means non string\n    parameters as well as keyword arguments are returned as `None`.  This\n    allows Babel to figure out what you really meant if you are using\n    gettext functions that allow keyword arguments for placeholder expansion.\n    If you don't want that behavior set the `babel_style` parameter to `False`\n    which causes only strings to be returned and parameters are always stored\n    in tuples.  As a consequence invalid gettext calls (calls without a single\n    string parameter or string parameters after non-string parameters) are\n    skipped.\n\n    This example explains the behavior:\n\n    >>> from jinja2 import Environment\n    >>> env = Environment()\n    >>> node = env.parse('{{ (_(\"foo\"), _(), ngettext(\"foo\", \"bar\", 42)) }}')\n    >>> list(extract_from_ast(node))\n    [(1, '_', 'foo'), (1, '_', ()), (1, 'ngettext', ('foo', 'bar', None))]\n    >>> list(extract_from_ast(node, babel_style=False))\n    [(1, '_', ('foo',)), (1, 'ngettext', ('foo', 'bar'))]\n\n    For every string found this function yields a ``(lineno, function,\n    message)`` tuple, where:\n\n    * ``lineno`` is the number of the line on which the string was found,\n    * ``function`` is the name of the ``gettext`` function used (if the\n      string was extracted from embedded Python code), and\n    *  ``message`` is the string itself (a ``unicode`` object, or a tuple\n       of ``unicode`` objects for functions with multiple string arguments).\n\n    This extraction function operates on the AST and is because of that unable\n    to extract any comments.  For comment support you have to use the babel\n    extraction interface or extract comments yourself.\n    \"\"\"\n    for node in node.find_all(nodes.Call):\n        if not isinstance(node.node, nodes.Name) or \\\n           node.node.name not in gettext_functions:\n            continue\n\n        strings = []\n        for arg in node.args:\n            if isinstance(arg, nodes.Const) and \\\n               isinstance(arg.value, string_types):\n                strings.append(arg.value)\n            else:\n                strings.append(None)\n\n        for arg in node.kwargs:\n            strings.append(None)\n        if node.dyn_args is not None:\n            strings.append(None)\n        if node.dyn_kwargs is not None:\n            strings.append(None)\n\n        if not babel_style:\n            strings = tuple(x for x in strings if x is not None)\n            if not strings:\n                continue\n        else:\n            if len(strings) == 1:\n                strings = strings[0]\n            else:\n                strings = tuple(strings)\n        yield node.lineno, node.node.name, strings\n\n\nclass _CommentFinder(object):\n    \"\"\"Helper class to find comments in a token stream.  Can only\n    find comments for gettext calls forwards.  Once the comment\n    from line 4 is found, a comment for line 1 will not return a\n    usable value.\n    \"\"\"\n\n    def __init__(self, tokens, comment_tags):\n        self.tokens = tokens\n        self.comment_tags = comment_tags\n        self.offset = 0\n        self.last_lineno = 0\n\n    def find_backwards(self, offset):\n        try:\n            for _, token_type, token_value in \\\n                    reversed(self.tokens[self.offset:offset]):\n                if token_type in ('comment', 'linecomment'):\n                    try:\n                        prefix, comment = token_value.split(None, 1)\n                    except ValueError:\n                        continue\n                    if prefix in self.comment_tags:\n                        return [comment.rstrip()]\n            return []\n        finally:\n            self.offset = offset\n\n    def find_comments(self, lineno):\n        if not self.comment_tags or self.last_lineno > lineno:\n            return []\n        for idx, (token_lineno, _, _) in enumerate(self.tokens[self.offset:]):\n            if token_lineno > lineno:\n                return self.find_backwards(self.offset + idx)\n        return self.find_backwards(len(self.tokens))\n\n\ndef babel_extract(fileobj, keywords, comment_tags, options):\n    \"\"\"Babel extraction method for Jinja templates.\n\n    .. versionchanged:: 2.3\n       Basic support for translation comments was added.  If `comment_tags`\n       is now set to a list of keywords for extraction, the extractor will\n       try to find the best preceeding comment that begins with one of the\n       keywords.  For best results, make sure to not have more than one\n       gettext call in one line of code and the matching comment in the\n       same line or the line before.\n\n    .. versionchanged:: 2.5.1\n       The `newstyle_gettext` flag can be set to `True` to enable newstyle\n       gettext calls.\n\n    .. versionchanged:: 2.7\n       A `silent` option can now be provided.  If set to `False` template\n       syntax errors are propagated instead of being ignored.\n\n    :param fileobj: the file-like object the messages should be extracted from\n    :param keywords: a list of keywords (i.e. function names) that should be\n                     recognized as translation functions\n    :param comment_tags: a list of translator tags to search for and include\n                         in the results.\n    :param options: a dictionary of additional options (optional)\n    :return: an iterator over ``(lineno, funcname, message, comments)`` tuples.\n             (comments will be empty currently)\n    \"\"\"\n    extensions = set()\n    for extension in options.get('extensions', '').split(','):\n        extension = extension.strip()\n        if not extension:\n            continue\n        extensions.add(import_string(extension))\n    if InternationalizationExtension not in extensions:\n        extensions.add(InternationalizationExtension)\n\n    def getbool(options, key, default=False):\n        return options.get(key, str(default)).lower() in \\\n            ('1', 'on', 'yes', 'true')\n\n    silent = getbool(options, 'silent', True)\n    environment = Environment(\n        options.get('block_start_string', BLOCK_START_STRING),\n        options.get('block_end_string', BLOCK_END_STRING),\n        options.get('variable_start_string', VARIABLE_START_STRING),\n        options.get('variable_end_string', VARIABLE_END_STRING),\n        options.get('comment_start_string', COMMENT_START_STRING),\n        options.get('comment_end_string', COMMENT_END_STRING),\n        options.get('line_statement_prefix') or LINE_STATEMENT_PREFIX,\n        options.get('line_comment_prefix') or LINE_COMMENT_PREFIX,\n        getbool(options, 'trim_blocks', TRIM_BLOCKS),\n        getbool(options, 'lstrip_blocks', LSTRIP_BLOCKS),\n        NEWLINE_SEQUENCE,\n        getbool(options, 'keep_trailing_newline', KEEP_TRAILING_NEWLINE),\n        frozenset(extensions),\n        cache_size=0,\n        auto_reload=False\n    )\n\n    if getbool(options, 'trimmed'):\n        environment.policies['ext.i18n.trimmed'] = True\n    if getbool(options, 'newstyle_gettext'):\n        environment.newstyle_gettext = True\n\n    source = fileobj.read().decode(options.get('encoding', 'utf-8'))\n    try:\n        node = environment.parse(source)\n        tokens = list(environment.lex(environment.preprocess(source)))\n    except TemplateSyntaxError as e:\n        if not silent:\n            raise\n        # skip templates with syntax errors\n        return\n\n    finder = _CommentFinder(tokens, comment_tags)\n    for lineno, func, message in extract_from_ast(node, keywords):\n        yield lineno, func, message, finder.find_comments(lineno)\n\n\n#: nicer import names\ni18n = InternationalizationExtension\ndo = ExprStmtExtension\nloopcontrols = LoopControlExtension\nwith_ = WithExtension\nautoescape = AutoEscapeExtension\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/filters.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.filters\n    ~~~~~~~~~~~~~~\n\n    Bundled jinja filters.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nimport math\nimport random\nimport warnings\n\nfrom itertools import groupby, chain\nfrom collections import namedtuple\nfrom jinja2.utils import Markup, escape, pformat, urlize, soft_unicode, \\\n     unicode_urlencode, htmlsafe_json_dumps\nfrom jinja2.runtime import Undefined\nfrom jinja2.exceptions import FilterArgumentError\nfrom jinja2._compat import imap, string_types, text_type, iteritems, PY2\n\n\n_word_re = re.compile(r'\\w+', re.UNICODE)\n_word_beginning_split_re = re.compile(r'([-\\s\\(\\{\\[\\<]+)', re.UNICODE)\n\n\ndef contextfilter(f):\n    \"\"\"Decorator for marking context dependent filters. The current\n    :class:`Context` will be passed as first argument.\n    \"\"\"\n    f.contextfilter = True\n    return f\n\n\ndef evalcontextfilter(f):\n    \"\"\"Decorator for marking eval-context dependent filters.  An eval\n    context object is passed as first argument.  For more information\n    about the eval context, see :ref:`eval-context`.\n\n    .. versionadded:: 2.4\n    \"\"\"\n    f.evalcontextfilter = True\n    return f\n\n\ndef environmentfilter(f):\n    \"\"\"Decorator for marking environment dependent filters.  The current\n    :class:`Environment` is passed to the filter as first argument.\n    \"\"\"\n    f.environmentfilter = True\n    return f\n\n\ndef ignore_case(value):\n    \"\"\"For use as a postprocessor for :func:`make_attrgetter`. Converts strings\n    to lowercase and returns other types as-is.\"\"\"\n    return value.lower() if isinstance(value, string_types) else value\n\n\ndef make_attrgetter(environment, attribute, postprocess=None):\n    \"\"\"Returns a callable that looks up the given attribute from a\n    passed object with the rules of the environment.  Dots are allowed\n    to access attributes of attributes.  Integer parts in paths are\n    looked up as integers.\n    \"\"\"\n    if attribute is None:\n        attribute = []\n    elif isinstance(attribute, string_types):\n        attribute = [int(x) if x.isdigit() else x for x in attribute.split('.')]\n    else:\n        attribute = [attribute]\n\n    def attrgetter(item):\n        for part in attribute:\n            item = environment.getitem(item, part)\n\n        if postprocess is not None:\n            item = postprocess(item)\n\n        return item\n\n    return attrgetter\n\n\ndef do_forceescape(value):\n    \"\"\"Enforce HTML escaping.  This will probably double escape variables.\"\"\"\n    if hasattr(value, '__html__'):\n        value = value.__html__()\n    return escape(text_type(value))\n\n\ndef do_urlencode(value):\n    \"\"\"Escape strings for use in URLs (uses UTF-8 encoding).  It accepts both\n    dictionaries and regular strings as well as pairwise iterables.\n\n    .. versionadded:: 2.7\n    \"\"\"\n    itemiter = None\n    if isinstance(value, dict):\n        itemiter = iteritems(value)\n    elif not isinstance(value, string_types):\n        try:\n            itemiter = iter(value)\n        except TypeError:\n            pass\n    if itemiter is None:\n        return unicode_urlencode(value)\n    return u'&'.join(unicode_urlencode(k) + '=' +\n                     unicode_urlencode(v, for_qs=True)\n                     for k, v in itemiter)\n\n\n@evalcontextfilter\ndef do_replace(eval_ctx, s, old, new, count=None):\n    \"\"\"Return a copy of the value with all occurrences of a substring\n    replaced with a new one. The first argument is the substring\n    that should be replaced, the second is the replacement string.\n    If the optional third argument ``count`` is given, only the first\n    ``count`` occurrences are replaced:\n\n    .. sourcecode:: jinja\n\n        {{ \"Hello World\"|replace(\"Hello\", \"Goodbye\") }}\n            -> Goodbye World\n\n        {{ \"aaaaargh\"|replace(\"a\", \"d'oh, \", 2) }}\n            -> d'oh, d'oh, aaargh\n    \"\"\"\n    if count is None:\n        count = -1\n    if not eval_ctx.autoescape:\n        return text_type(s).replace(text_type(old), text_type(new), count)\n    if hasattr(old, '__html__') or hasattr(new, '__html__') and \\\n       not hasattr(s, '__html__'):\n        s = escape(s)\n    else:\n        s = soft_unicode(s)\n    return s.replace(soft_unicode(old), soft_unicode(new), count)\n\n\ndef do_upper(s):\n    \"\"\"Convert a value to uppercase.\"\"\"\n    return soft_unicode(s).upper()\n\n\ndef do_lower(s):\n    \"\"\"Convert a value to lowercase.\"\"\"\n    return soft_unicode(s).lower()\n\n\n@evalcontextfilter\ndef do_xmlattr(_eval_ctx, d, autospace=True):\n    \"\"\"Create an SGML/XML attribute string based on the items in a dict.\n    All values that are neither `none` nor `undefined` are automatically\n    escaped:\n\n    .. sourcecode:: html+jinja\n\n        <ul{{ {'class': 'my_list', 'missing': none,\n                'id': 'list-%d'|format(variable)}|xmlattr }}>\n        ...\n        </ul>\n\n    Results in something like this:\n\n    .. sourcecode:: html\n\n        <ul class=\"my_list\" id=\"list-42\">\n        ...\n        </ul>\n\n    As you can see it automatically prepends a space in front of the item\n    if the filter returned something unless the second parameter is false.\n    \"\"\"\n    rv = u' '.join(\n        u'%s=\"%s\"' % (escape(key), escape(value))\n        for key, value in iteritems(d)\n        if value is not None and not isinstance(value, Undefined)\n    )\n    if autospace and rv:\n        rv = u' ' + rv\n    if _eval_ctx.autoescape:\n        rv = Markup(rv)\n    return rv\n\n\ndef do_capitalize(s):\n    \"\"\"Capitalize a value. The first character will be uppercase, all others\n    lowercase.\n    \"\"\"\n    return soft_unicode(s).capitalize()\n\n\ndef do_title(s):\n    \"\"\"Return a titlecased version of the value. I.e. words will start with\n    uppercase letters, all remaining characters are lowercase.\n    \"\"\"\n    return ''.join(\n        [item[0].upper() + item[1:].lower()\n         for item in _word_beginning_split_re.split(soft_unicode(s))\n         if item])\n\n\ndef do_dictsort(value, case_sensitive=False, by='key', reverse=False):\n    \"\"\"Sort a dict and yield (key, value) pairs. Because python dicts are\n    unsorted you may want to use this function to order them by either\n    key or value:\n\n    .. sourcecode:: jinja\n\n        {% for item in mydict|dictsort %}\n            sort the dict by key, case insensitive\n\n        {% for item in mydict|dictsort(reverse=true) %}\n            sort the dict by key, case insensitive, reverse order\n\n        {% for item in mydict|dictsort(true) %}\n            sort the dict by key, case sensitive\n\n        {% for item in mydict|dictsort(false, 'value') %}\n            sort the dict by value, case insensitive\n    \"\"\"\n    if by == 'key':\n        pos = 0\n    elif by == 'value':\n        pos = 1\n    else:\n        raise FilterArgumentError(\n            'You can only sort by either \"key\" or \"value\"'\n        )\n\n    def sort_func(item):\n        value = item[pos]\n\n        if not case_sensitive:\n            value = ignore_case(value)\n\n        return value\n\n    return sorted(value.items(), key=sort_func, reverse=reverse)\n\n\n@environmentfilter\ndef do_sort(\n    environment, value, reverse=False, case_sensitive=False, attribute=None\n):\n    \"\"\"Sort an iterable.  Per default it sorts ascending, if you pass it\n    true as first argument it will reverse the sorting.\n\n    If the iterable is made of strings the third parameter can be used to\n    control the case sensitiveness of the comparison which is disabled by\n    default.\n\n    .. sourcecode:: jinja\n\n        {% for item in iterable|sort %}\n            ...\n        {% endfor %}\n\n    It is also possible to sort by an attribute (for example to sort\n    by the date of an object) by specifying the `attribute` parameter:\n\n    .. sourcecode:: jinja\n\n        {% for item in iterable|sort(attribute='date') %}\n            ...\n        {% endfor %}\n\n    .. versionchanged:: 2.6\n       The `attribute` parameter was added.\n    \"\"\"\n    key_func = make_attrgetter(\n        environment, attribute,\n        postprocess=ignore_case if not case_sensitive else None\n    )\n    return sorted(value, key=key_func, reverse=reverse)\n\n\n@environmentfilter\ndef do_unique(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Returns a list of unique items from the the given iterable.\n\n    .. sourcecode:: jinja\n\n        {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }}\n            -> ['foo', 'bar', 'foobar']\n\n    The unique items are yielded in the same order as their first occurrence in\n    the iterable passed to the filter.\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Filter objects with unique values for this attribute.\n    \"\"\"\n    getter = make_attrgetter(\n        environment, attribute,\n        postprocess=ignore_case if not case_sensitive else None\n    )\n    seen = set()\n\n    for item in value:\n        key = getter(item)\n\n        if key not in seen:\n            seen.add(key)\n            yield item\n\n\ndef _min_or_max(environment, value, func, case_sensitive, attribute):\n    it = iter(value)\n\n    try:\n        first = next(it)\n    except StopIteration:\n        return environment.undefined('No aggregated item, sequence was empty.')\n\n    key_func = make_attrgetter(\n        environment, attribute,\n        ignore_case if not case_sensitive else None\n    )\n    return func(chain([first], it), key=key_func)\n\n\n@environmentfilter\ndef do_min(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Return the smallest item from the sequence.\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|min }}\n            -> 1\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Get the object with the max value of this attribute.\n    \"\"\"\n    return _min_or_max(environment, value, min, case_sensitive, attribute)\n\n\n@environmentfilter\ndef do_max(environment, value, case_sensitive=False, attribute=None):\n    \"\"\"Return the largest item from the sequence.\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|max }}\n            -> 3\n\n    :param case_sensitive: Treat upper and lower case strings as distinct.\n    :param attribute: Get the object with the max value of this attribute.\n    \"\"\"\n    return _min_or_max(environment, value, max, case_sensitive, attribute)\n\n\ndef do_default(value, default_value=u'', boolean=False):\n    \"\"\"If the value is undefined it will return the passed default value,\n    otherwise the value of the variable:\n\n    .. sourcecode:: jinja\n\n        {{ my_variable|default('my_variable is not defined') }}\n\n    This will output the value of ``my_variable`` if the variable was\n    defined, otherwise ``'my_variable is not defined'``. If you want\n    to use default with variables that evaluate to false you have to\n    set the second parameter to `true`:\n\n    .. sourcecode:: jinja\n\n        {{ ''|default('the string was empty', true) }}\n    \"\"\"\n    if isinstance(value, Undefined) or (boolean and not value):\n        return default_value\n    return value\n\n\n@evalcontextfilter\ndef do_join(eval_ctx, value, d=u'', attribute=None):\n    \"\"\"Return a string which is the concatenation of the strings in the\n    sequence. The separator between elements is an empty string per\n    default, you can define it with the optional parameter:\n\n    .. sourcecode:: jinja\n\n        {{ [1, 2, 3]|join('|') }}\n            -> 1|2|3\n\n        {{ [1, 2, 3]|join }}\n            -> 123\n\n    It is also possible to join certain attributes of an object:\n\n    .. sourcecode:: jinja\n\n        {{ users|join(', ', attribute='username') }}\n\n    .. versionadded:: 2.6\n       The `attribute` parameter was added.\n    \"\"\"\n    if attribute is not None:\n        value = imap(make_attrgetter(eval_ctx.environment, attribute), value)\n\n    # no automatic escaping?  joining is a lot eaiser then\n    if not eval_ctx.autoescape:\n        return text_type(d).join(imap(text_type, value))\n\n    # if the delimiter doesn't have an html representation we check\n    # if any of the items has.  If yes we do a coercion to Markup\n    if not hasattr(d, '__html__'):\n        value = list(value)\n        do_escape = False\n        for idx, item in enumerate(value):\n            if hasattr(item, '__html__'):\n                do_escape = True\n            else:\n                value[idx] = text_type(item)\n        if do_escape:\n            d = escape(d)\n        else:\n            d = text_type(d)\n        return d.join(value)\n\n    # no html involved, to normal joining\n    return soft_unicode(d).join(imap(soft_unicode, value))\n\n\ndef do_center(value, width=80):\n    \"\"\"Centers the value in a field of a given width.\"\"\"\n    return text_type(value).center(width)\n\n\n@environmentfilter\ndef do_first(environment, seq):\n    \"\"\"Return the first item of a sequence.\"\"\"\n    try:\n        return next(iter(seq))\n    except StopIteration:\n        return environment.undefined('No first item, sequence was empty.')\n\n\n@environmentfilter\ndef do_last(environment, seq):\n    \"\"\"Return the last item of a sequence.\"\"\"\n    try:\n        return next(iter(reversed(seq)))\n    except StopIteration:\n        return environment.undefined('No last item, sequence was empty.')\n\n\n@contextfilter\ndef do_random(context, seq):\n    \"\"\"Return a random item from the sequence.\"\"\"\n    try:\n        return random.choice(seq)\n    except IndexError:\n        return context.environment.undefined('No random item, sequence was empty.')\n\n\ndef do_filesizeformat(value, binary=False):\n    \"\"\"Format the value like a 'human-readable' file size (i.e. 13 kB,\n    4.1 MB, 102 Bytes, etc).  Per default decimal prefixes are used (Mega,\n    Giga, etc.), if the second parameter is set to `True` the binary\n    prefixes are used (Mebi, Gibi).\n    \"\"\"\n    bytes = float(value)\n    base = binary and 1024 or 1000\n    prefixes = [\n        (binary and 'KiB' or 'kB'),\n        (binary and 'MiB' or 'MB'),\n        (binary and 'GiB' or 'GB'),\n        (binary and 'TiB' or 'TB'),\n        (binary and 'PiB' or 'PB'),\n        (binary and 'EiB' or 'EB'),\n        (binary and 'ZiB' or 'ZB'),\n        (binary and 'YiB' or 'YB')\n    ]\n    if bytes == 1:\n        return '1 Byte'\n    elif bytes < base:\n        return '%d Bytes' % bytes\n    else:\n        for i, prefix in enumerate(prefixes):\n            unit = base ** (i + 2)\n            if bytes < unit:\n                return '%.1f %s' % ((base * bytes / unit), prefix)\n        return '%.1f %s' % ((base * bytes / unit), prefix)\n\n\ndef do_pprint(value, verbose=False):\n    \"\"\"Pretty print a variable. Useful for debugging.\n\n    With Jinja 1.2 onwards you can pass it a parameter.  If this parameter\n    is truthy the output will be more verbose (this requires `pretty`)\n    \"\"\"\n    return pformat(value, verbose=verbose)\n\n\n@evalcontextfilter\ndef do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False,\n              target=None, rel=None):\n    \"\"\"Converts URLs in plain text into clickable links.\n\n    If you pass the filter an additional integer it will shorten the urls\n    to that number. Also a third argument exists that makes the urls\n    \"nofollow\":\n\n    .. sourcecode:: jinja\n\n        {{ mytext|urlize(40, true) }}\n            links are shortened to 40 chars and defined with rel=\"nofollow\"\n\n    If *target* is specified, the ``target`` attribute will be added to the\n    ``<a>`` tag:\n\n    .. sourcecode:: jinja\n\n       {{ mytext|urlize(40, target='_blank') }}\n\n    .. versionchanged:: 2.8+\n       The *target* parameter was added.\n    \"\"\"\n    policies = eval_ctx.environment.policies\n    rel = set((rel or '').split() or [])\n    if nofollow:\n        rel.add('nofollow')\n    rel.update((policies['urlize.rel'] or '').split())\n    if target is None:\n        target = policies['urlize.target']\n    rel = ' '.join(sorted(rel)) or None\n    rv = urlize(value, trim_url_limit, rel=rel, target=target)\n    if eval_ctx.autoescape:\n        rv = Markup(rv)\n    return rv\n\n\ndef do_indent(\n    s, width=4, first=False, blank=False, indentfirst=None\n):\n    \"\"\"Return a copy of the string with each line indented by 4 spaces. The\n    first line and blank lines are not indented by default.\n\n    :param width: Number of spaces to indent by.\n    :param first: Don't skip indenting the first line.\n    :param blank: Don't skip indenting empty lines.\n\n    .. versionchanged:: 2.10\n        Blank lines are not indented by default.\n\n        Rename the ``indentfirst`` argument to ``first``.\n    \"\"\"\n    if indentfirst is not None:\n        warnings.warn(DeprecationWarning(\n            'The \"indentfirst\" argument is renamed to \"first\".'\n        ), stacklevel=2)\n        first = indentfirst\n\n    s += u'\\n'  # this quirk is necessary for splitlines method\n    indention = u' ' * width\n\n    if blank:\n        rv = (u'\\n' + indention).join(s.splitlines())\n    else:\n        lines = s.splitlines()\n        rv = lines.pop(0)\n\n        if lines:\n            rv += u'\\n' + u'\\n'.join(\n                indention + line if line else line for line in lines\n            )\n\n    if first:\n        rv = indention + rv\n\n    return rv\n\n\n@environmentfilter\ndef do_truncate(env, s, length=255, killwords=False, end='...', leeway=None):\n    \"\"\"Return a truncated copy of the string. The length is specified\n    with the first parameter which defaults to ``255``. If the second\n    parameter is ``true`` the filter will cut the text at length. Otherwise\n    it will discard the last word. If the text was in fact\n    truncated it will append an ellipsis sign (``\"...\"``). If you want a\n    different ellipsis sign than ``\"...\"`` you can specify it using the\n    third parameter. Strings that only exceed the length by the tolerance\n    margin given in the fourth parameter will not be truncated.\n\n    .. sourcecode:: jinja\n\n        {{ \"foo bar baz qux\"|truncate(9) }}\n            -> \"foo...\"\n        {{ \"foo bar baz qux\"|truncate(9, True) }}\n            -> \"foo ba...\"\n        {{ \"foo bar baz qux\"|truncate(11) }}\n            -> \"foo bar baz qux\"\n        {{ \"foo bar baz qux\"|truncate(11, False, '...', 0) }}\n            -> \"foo bar...\"\n\n    The default leeway on newer Jinja2 versions is 5 and was 0 before but\n    can be reconfigured globally.\n    \"\"\"\n    if leeway is None:\n        leeway = env.policies['truncate.leeway']\n    assert length >= len(end), 'expected length >= %s, got %s' % (len(end), length)\n    assert leeway >= 0, 'expected leeway >= 0, got %s' % leeway\n    if len(s) <= length + leeway:\n        return s\n    if killwords:\n        return s[:length - len(end)] + end\n    result = s[:length - len(end)].rsplit(' ', 1)[0]\n    return result + end\n\n\n@environmentfilter\ndef do_wordwrap(environment, s, width=79, break_long_words=True,\n                wrapstring=None):\n    \"\"\"\n    Return a copy of the string passed to the filter wrapped after\n    ``79`` characters.  You can override this default using the first\n    parameter.  If you set the second parameter to `false` Jinja will not\n    split words apart if they are longer than `width`. By default, the newlines\n    will be the default newlines for the environment, but this can be changed\n    using the wrapstring keyword argument.\n\n    .. versionadded:: 2.7\n       Added support for the `wrapstring` parameter.\n    \"\"\"\n    if not wrapstring:\n        wrapstring = environment.newline_sequence\n    import textwrap\n    return wrapstring.join(textwrap.wrap(s, width=width, expand_tabs=False,\n                                   replace_whitespace=False,\n                                   break_long_words=break_long_words))\n\n\ndef do_wordcount(s):\n    \"\"\"Count the words in that string.\"\"\"\n    return len(_word_re.findall(s))\n\n\ndef do_int(value, default=0, base=10):\n    \"\"\"Convert the value into an integer. If the\n    conversion doesn't work it will return ``0``. You can\n    override this default using the first parameter. You\n    can also override the default base (10) in the second\n    parameter, which handles input with prefixes such as\n    0b, 0o and 0x for bases 2, 8 and 16 respectively.\n    The base is ignored for decimal numbers and non-string values.\n    \"\"\"\n    try:\n        if isinstance(value, string_types):\n            return int(value, base)\n        return int(value)\n    except (TypeError, ValueError):\n        # this quirk is necessary so that \"42.23\"|int gives 42.\n        try:\n            return int(float(value))\n        except (TypeError, ValueError):\n            return default\n\n\ndef do_float(value, default=0.0):\n    \"\"\"Convert the value into a floating point number. If the\n    conversion doesn't work it will return ``0.0``. You can\n    override this default using the first parameter.\n    \"\"\"\n    try:\n        return float(value)\n    except (TypeError, ValueError):\n        return default\n\n\ndef do_format(value, *args, **kwargs):\n    \"\"\"\n    Apply python string formatting on an object:\n\n    .. sourcecode:: jinja\n\n        {{ \"%s - %s\"|format(\"Hello?\", \"Foo!\") }}\n            -> Hello? - Foo!\n    \"\"\"\n    if args and kwargs:\n        raise FilterArgumentError('can\\'t handle positional and keyword '\n                                  'arguments at the same time')\n    return soft_unicode(value) % (kwargs or args)\n\n\ndef do_trim(value):\n    \"\"\"Strip leading and trailing whitespace.\"\"\"\n    return soft_unicode(value).strip()\n\n\ndef do_striptags(value):\n    \"\"\"Strip SGML/XML tags and replace adjacent whitespace by one space.\n    \"\"\"\n    if hasattr(value, '__html__'):\n        value = value.__html__()\n    return Markup(text_type(value)).striptags()\n\n\ndef do_slice(value, slices, fill_with=None):\n    \"\"\"Slice an iterator and return a list of lists containing\n    those items. Useful if you want to create a div containing\n    three ul tags that represent columns:\n\n    .. sourcecode:: html+jinja\n\n        <div class=\"columwrapper\">\n          {%- for column in items|slice(3) %}\n            <ul class=\"column-{{ loop.index }}\">\n            {%- for item in column %}\n              <li>{{ item }}</li>\n            {%- endfor %}\n            </ul>\n          {%- endfor %}\n        </div>\n\n    If you pass it a second argument it's used to fill missing\n    values on the last iteration.\n    \"\"\"\n    seq = list(value)\n    length = len(seq)\n    items_per_slice = length // slices\n    slices_with_extra = length % slices\n    offset = 0\n    for slice_number in range(slices):\n        start = offset + slice_number * items_per_slice\n        if slice_number < slices_with_extra:\n            offset += 1\n        end = offset + (slice_number + 1) * items_per_slice\n        tmp = seq[start:end]\n        if fill_with is not None and slice_number >= slices_with_extra:\n            tmp.append(fill_with)\n        yield tmp\n\n\ndef do_batch(value, linecount, fill_with=None):\n    \"\"\"\n    A filter that batches items. It works pretty much like `slice`\n    just the other way round. It returns a list of lists with the\n    given number of items. If you provide a second parameter this\n    is used to fill up missing items. See this example:\n\n    .. sourcecode:: html+jinja\n\n        <table>\n        {%- for row in items|batch(3, '&nbsp;') %}\n          <tr>\n          {%- for column in row %}\n            <td>{{ column }}</td>\n          {%- endfor %}\n          </tr>\n        {%- endfor %}\n        </table>\n    \"\"\"\n    tmp = []\n    for item in value:\n        if len(tmp) == linecount:\n            yield tmp\n            tmp = []\n        tmp.append(item)\n    if tmp:\n        if fill_with is not None and len(tmp) < linecount:\n            tmp += [fill_with] * (linecount - len(tmp))\n        yield tmp\n\n\ndef do_round(value, precision=0, method='common'):\n    \"\"\"Round the number to a given precision. The first\n    parameter specifies the precision (default is ``0``), the\n    second the rounding method:\n\n    - ``'common'`` rounds either up or down\n    - ``'ceil'`` always rounds up\n    - ``'floor'`` always rounds down\n\n    If you don't specify a method ``'common'`` is used.\n\n    .. sourcecode:: jinja\n\n        {{ 42.55|round }}\n            -> 43.0\n        {{ 42.55|round(1, 'floor') }}\n            -> 42.5\n\n    Note that even if rounded to 0 precision, a float is returned.  If\n    you need a real integer, pipe it through `int`:\n\n    .. sourcecode:: jinja\n\n        {{ 42.55|round|int }}\n            -> 43\n    \"\"\"\n    if not method in ('common', 'ceil', 'floor'):\n        raise FilterArgumentError('method must be common, ceil or floor')\n    if method == 'common':\n        return round(value, precision)\n    func = getattr(math, method)\n    return func(value * (10 ** precision)) / (10 ** precision)\n\n\n# Use a regular tuple repr here.  This is what we did in the past and we\n# really want to hide this custom type as much as possible.  In particular\n# we do not want to accidentally expose an auto generated repr in case\n# people start to print this out in comments or something similar for\n# debugging.\n_GroupTuple = namedtuple('_GroupTuple', ['grouper', 'list'])\n_GroupTuple.__repr__ = tuple.__repr__\n_GroupTuple.__str__ = tuple.__str__\n\n@environmentfilter\ndef do_groupby(environment, value, attribute):\n    \"\"\"Group a sequence of objects by a common attribute.\n\n    If you for example have a list of dicts or objects that represent persons\n    with `gender`, `first_name` and `last_name` attributes and you want to\n    group all users by genders you can do something like the following\n    snippet:\n\n    .. sourcecode:: html+jinja\n\n        <ul>\n        {% for group in persons|groupby('gender') %}\n            <li>{{ group.grouper }}<ul>\n            {% for person in group.list %}\n                <li>{{ person.first_name }} {{ person.last_name }}</li>\n            {% endfor %}</ul></li>\n        {% endfor %}\n        </ul>\n\n    Additionally it's possible to use tuple unpacking for the grouper and\n    list:\n\n    .. sourcecode:: html+jinja\n\n        <ul>\n        {% for grouper, list in persons|groupby('gender') %}\n            ...\n        {% endfor %}\n        </ul>\n\n    As you can see the item we're grouping by is stored in the `grouper`\n    attribute and the `list` contains all the objects that have this grouper\n    in common.\n\n    .. versionchanged:: 2.6\n       It's now possible to use dotted notation to group by the child\n       attribute of another attribute.\n    \"\"\"\n    expr = make_attrgetter(environment, attribute)\n    return [_GroupTuple(key, list(values)) for key, values\n            in groupby(sorted(value, key=expr), expr)]\n\n\n@environmentfilter\ndef do_sum(environment, iterable, attribute=None, start=0):\n    \"\"\"Returns the sum of a sequence of numbers plus the value of parameter\n    'start' (which defaults to 0).  When the sequence is empty it returns\n    start.\n\n    It is also possible to sum up only certain attributes:\n\n    .. sourcecode:: jinja\n\n        Total: {{ items|sum(attribute='price') }}\n\n    .. versionchanged:: 2.6\n       The `attribute` parameter was added to allow suming up over\n       attributes.  Also the `start` parameter was moved on to the right.\n    \"\"\"\n    if attribute is not None:\n        iterable = imap(make_attrgetter(environment, attribute), iterable)\n    return sum(iterable, start)\n\n\ndef do_list(value):\n    \"\"\"Convert the value into a list.  If it was a string the returned list\n    will be a list of characters.\n    \"\"\"\n    return list(value)\n\n\ndef do_mark_safe(value):\n    \"\"\"Mark the value as safe which means that in an environment with automatic\n    escaping enabled this variable will not be escaped.\n    \"\"\"\n    return Markup(value)\n\n\ndef do_mark_unsafe(value):\n    \"\"\"Mark a value as unsafe.  This is the reverse operation for :func:`safe`.\"\"\"\n    return text_type(value)\n\n\ndef do_reverse(value):\n    \"\"\"Reverse the object or return an iterator that iterates over it the other\n    way round.\n    \"\"\"\n    if isinstance(value, string_types):\n        return value[::-1]\n    try:\n        return reversed(value)\n    except TypeError:\n        try:\n            rv = list(value)\n            rv.reverse()\n            return rv\n        except TypeError:\n            raise FilterArgumentError('argument must be iterable')\n\n\n@environmentfilter\ndef do_attr(environment, obj, name):\n    \"\"\"Get an attribute of an object.  ``foo|attr(\"bar\")`` works like\n    ``foo.bar`` just that always an attribute is returned and items are not\n    looked up.\n\n    See :ref:`Notes on subscriptions <notes-on-subscriptions>` for more details.\n    \"\"\"\n    try:\n        name = str(name)\n    except UnicodeError:\n        pass\n    else:\n        try:\n            value = getattr(obj, name)\n        except AttributeError:\n            pass\n        else:\n            if environment.sandboxed and not \\\n               environment.is_safe_attribute(obj, name, value):\n                return environment.unsafe_undefined(obj, name)\n            return value\n    return environment.undefined(obj=obj, name=name)\n\n\n@contextfilter\ndef do_map(*args, **kwargs):\n    \"\"\"Applies a filter on a sequence of objects or looks up an attribute.\n    This is useful when dealing with lists of objects but you are really\n    only interested in a certain value of it.\n\n    The basic usage is mapping on an attribute.  Imagine you have a list\n    of users but you are only interested in a list of usernames:\n\n    .. sourcecode:: jinja\n\n        Users on this page: {{ users|map(attribute='username')|join(', ') }}\n\n    Alternatively you can let it invoke a filter by passing the name of the\n    filter and the arguments afterwards.  A good example would be applying a\n    text conversion filter on a sequence:\n\n    .. sourcecode:: jinja\n\n        Users on this page: {{ titles|map('lower')|join(', ') }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    seq, func = prepare_map(args, kwargs)\n    if seq:\n        for item in seq:\n            yield func(item)\n\n\n@contextfilter\ndef do_select(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to each object,\n    and only selecting the objects with the test succeeding.\n\n    If no test is specified, each object will be evaluated as a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ numbers|select(\"odd\") }}\n        {{ numbers|select(\"odd\") }}\n        {{ numbers|select(\"divisibleby\", 3) }}\n        {{ numbers|select(\"lessthan\", 42) }}\n        {{ strings|select(\"equalto\", \"mystring\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: x, False)\n\n\n@contextfilter\ndef do_reject(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to each object,\n    and rejecting the objects with the test succeeding.\n\n    If no test is specified, each object will be evaluated as a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ numbers|reject(\"odd\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: not x, False)\n\n\n@contextfilter\ndef do_selectattr(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to the specified\n    attribute of each object, and only selecting the objects with the\n    test succeeding.\n\n    If no test is specified, the attribute's value will be evaluated as\n    a boolean.\n\n    Example usage:\n\n    .. sourcecode:: jinja\n\n        {{ users|selectattr(\"is_active\") }}\n        {{ users|selectattr(\"email\", \"none\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: x, True)\n\n\n@contextfilter\ndef do_rejectattr(*args, **kwargs):\n    \"\"\"Filters a sequence of objects by applying a test to the specified\n    attribute of each object, and rejecting the objects with the test\n    succeeding.\n\n    If no test is specified, the attribute's value will be evaluated as\n    a boolean.\n\n    .. sourcecode:: jinja\n\n        {{ users|rejectattr(\"is_active\") }}\n        {{ users|rejectattr(\"email\", \"none\") }}\n\n    .. versionadded:: 2.7\n    \"\"\"\n    return select_or_reject(args, kwargs, lambda x: not x, True)\n\n\n@evalcontextfilter\ndef do_tojson(eval_ctx, value, indent=None):\n    \"\"\"Dumps a structure to JSON so that it's safe to use in ``<script>``\n    tags.  It accepts the same arguments and returns a JSON string.  Note that\n    this is available in templates through the ``|tojson`` filter which will\n    also mark the result as safe.  Due to how this function escapes certain\n    characters this is safe even if used outside of ``<script>`` tags.\n\n    The following characters are escaped in strings:\n\n    -   ``<``\n    -   ``>``\n    -   ``&``\n    -   ``'``\n\n    This makes it safe to embed such strings in any place in HTML with the\n    notable exception of double quoted attributes.  In that case single\n    quote your attributes or HTML escape it in addition.\n\n    The indent parameter can be used to enable pretty printing.  Set it to\n    the number of spaces that the structures should be indented with.\n\n    Note that this filter is for use in HTML contexts only.\n\n    .. versionadded:: 2.9\n    \"\"\"\n    policies = eval_ctx.environment.policies\n    dumper = policies['json.dumps_function']\n    options = policies['json.dumps_kwargs']\n    if indent is not None:\n        options = dict(options)\n        options['indent'] = indent\n    return htmlsafe_json_dumps(value, dumper=dumper, **options)\n\n\ndef prepare_map(args, kwargs):\n    context = args[0]\n    seq = args[1]\n\n    if len(args) == 2 and 'attribute' in kwargs:\n        attribute = kwargs.pop('attribute')\n        if kwargs:\n            raise FilterArgumentError('Unexpected keyword argument %r' %\n                next(iter(kwargs)))\n        func = make_attrgetter(context.environment, attribute)\n    else:\n        try:\n            name = args[2]\n            args = args[3:]\n        except LookupError:\n            raise FilterArgumentError('map requires a filter argument')\n        func = lambda item: context.environment.call_filter(\n            name, item, args, kwargs, context=context)\n\n    return seq, func\n\n\ndef prepare_select_or_reject(args, kwargs, modfunc, lookup_attr):\n    context = args[0]\n    seq = args[1]\n    if lookup_attr:\n        try:\n            attr = args[2]\n        except LookupError:\n            raise FilterArgumentError('Missing parameter for attribute name')\n        transfunc = make_attrgetter(context.environment, attr)\n        off = 1\n    else:\n        off = 0\n        transfunc = lambda x: x\n\n    try:\n        name = args[2 + off]\n        args = args[3 + off:]\n        func = lambda item: context.environment.call_test(\n            name, item, args, kwargs)\n    except LookupError:\n        func = bool\n\n    return seq, lambda item: modfunc(func(transfunc(item)))\n\n\ndef select_or_reject(args, kwargs, modfunc, lookup_attr):\n    seq, func = prepare_select_or_reject(args, kwargs, modfunc, lookup_attr)\n    if seq:\n        for item in seq:\n            if func(item):\n                yield item\n\n\nFILTERS = {\n    'abs':                  abs,\n    'attr':                 do_attr,\n    'batch':                do_batch,\n    'capitalize':           do_capitalize,\n    'center':               do_center,\n    'count':                len,\n    'd':                    do_default,\n    'default':              do_default,\n    'dictsort':             do_dictsort,\n    'e':                    escape,\n    'escape':               escape,\n    'filesizeformat':       do_filesizeformat,\n    'first':                do_first,\n    'float':                do_float,\n    'forceescape':          do_forceescape,\n    'format':               do_format,\n    'groupby':              do_groupby,\n    'indent':               do_indent,\n    'int':                  do_int,\n    'join':                 do_join,\n    'last':                 do_last,\n    'length':               len,\n    'list':                 do_list,\n    'lower':                do_lower,\n    'map':                  do_map,\n    'min':                  do_min,\n    'max':                  do_max,\n    'pprint':               do_pprint,\n    'random':               do_random,\n    'reject':               do_reject,\n    'rejectattr':           do_rejectattr,\n    'replace':              do_replace,\n    'reverse':              do_reverse,\n    'round':                do_round,\n    'safe':                 do_mark_safe,\n    'select':               do_select,\n    'selectattr':           do_selectattr,\n    'slice':                do_slice,\n    'sort':                 do_sort,\n    'string':               soft_unicode,\n    'striptags':            do_striptags,\n    'sum':                  do_sum,\n    'title':                do_title,\n    'trim':                 do_trim,\n    'truncate':             do_truncate,\n    'unique':               do_unique,\n    'upper':                do_upper,\n    'urlencode':            do_urlencode,\n    'urlize':               do_urlize,\n    'wordcount':            do_wordcount,\n    'wordwrap':             do_wordwrap,\n    'xmlattr':              do_xmlattr,\n    'tojson':               do_tojson,\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/idtracking.py",
    "content": "from jinja2.visitor import NodeVisitor\nfrom jinja2._compat import iteritems\n\n\nVAR_LOAD_PARAMETER = 'param'\nVAR_LOAD_RESOLVE = 'resolve'\nVAR_LOAD_ALIAS = 'alias'\nVAR_LOAD_UNDEFINED = 'undefined'\n\n\ndef find_symbols(nodes, parent_symbols=None):\n    sym = Symbols(parent=parent_symbols)\n    visitor = FrameSymbolVisitor(sym)\n    for node in nodes:\n        visitor.visit(node)\n    return sym\n\n\ndef symbols_for_node(node, parent_symbols=None):\n    sym = Symbols(parent=parent_symbols)\n    sym.analyze_node(node)\n    return sym\n\n\nclass Symbols(object):\n\n    def __init__(self, parent=None, level=None):\n        if level is None:\n            if parent is None:\n                level = 0\n            else:\n                level = parent.level + 1\n        self.level = level\n        self.parent = parent\n        self.refs = {}\n        self.loads = {}\n        self.stores = set()\n\n    def analyze_node(self, node, **kwargs):\n        visitor = RootVisitor(self)\n        visitor.visit(node, **kwargs)\n\n    def _define_ref(self, name, load=None):\n        ident = 'l_%d_%s' % (self.level, name)\n        self.refs[name] = ident\n        if load is not None:\n            self.loads[ident] = load\n        return ident\n\n    def find_load(self, target):\n        if target in self.loads:\n            return self.loads[target]\n        if self.parent is not None:\n            return self.parent.find_load(target)\n\n    def find_ref(self, name):\n        if name in self.refs:\n            return self.refs[name]\n        if self.parent is not None:\n            return self.parent.find_ref(name)\n\n    def ref(self, name):\n        rv = self.find_ref(name)\n        if rv is None:\n            raise AssertionError('Tried to resolve a name to a reference that '\n                                 'was unknown to the frame (%r)' % name)\n        return rv\n\n    def copy(self):\n        rv = object.__new__(self.__class__)\n        rv.__dict__.update(self.__dict__)\n        rv.refs = self.refs.copy()\n        rv.loads = self.loads.copy()\n        rv.stores = self.stores.copy()\n        return rv\n\n    def store(self, name):\n        self.stores.add(name)\n\n        # If we have not see the name referenced yet, we need to figure\n        # out what to set it to.\n        if name not in self.refs:\n            # If there is a parent scope we check if the name has a\n            # reference there.  If it does it means we might have to alias\n            # to a variable there.\n            if self.parent is not None:\n                outer_ref = self.parent.find_ref(name)\n                if outer_ref is not None:\n                    self._define_ref(name, load=(VAR_LOAD_ALIAS, outer_ref))\n                    return\n\n            # Otherwise we can just set it to undefined.\n            self._define_ref(name, load=(VAR_LOAD_UNDEFINED, None))\n\n    def declare_parameter(self, name):\n        self.stores.add(name)\n        return self._define_ref(name, load=(VAR_LOAD_PARAMETER, None))\n\n    def load(self, name):\n        target = self.find_ref(name)\n        if target is None:\n            self._define_ref(name, load=(VAR_LOAD_RESOLVE, name))\n\n    def branch_update(self, branch_symbols):\n        stores = {}\n        for branch in branch_symbols:\n            for target in branch.stores:\n                if target in self.stores:\n                    continue\n                stores[target] = stores.get(target, 0) + 1\n\n        for sym in branch_symbols:\n            self.refs.update(sym.refs)\n            self.loads.update(sym.loads)\n            self.stores.update(sym.stores)\n\n        for name, branch_count in iteritems(stores):\n            if branch_count == len(branch_symbols):\n                continue\n            target = self.find_ref(name)\n            assert target is not None, 'should not happen'\n\n            if self.parent is not None:\n                outer_target = self.parent.find_ref(name)\n                if outer_target is not None:\n                    self.loads[target] = (VAR_LOAD_ALIAS, outer_target)\n                    continue\n            self.loads[target] = (VAR_LOAD_RESOLVE, name)\n\n    def dump_stores(self):\n        rv = {}\n        node = self\n        while node is not None:\n            for name in node.stores:\n                if name not in rv:\n                    rv[name] = self.find_ref(name)\n            node = node.parent\n        return rv\n\n    def dump_param_targets(self):\n        rv = set()\n        node = self\n        while node is not None:\n            for target, (instr, _) in iteritems(self.loads):\n                if instr == VAR_LOAD_PARAMETER:\n                    rv.add(target)\n            node = node.parent\n        return rv\n\n\nclass RootVisitor(NodeVisitor):\n\n    def __init__(self, symbols):\n        self.sym_visitor = FrameSymbolVisitor(symbols)\n\n    def _simple_visit(self, node, **kwargs):\n        for child in node.iter_child_nodes():\n            self.sym_visitor.visit(child)\n\n    visit_Template = visit_Block = visit_Macro = visit_FilterBlock = \\\n        visit_Scope = visit_If = visit_ScopedEvalContextModifier = \\\n        _simple_visit\n\n    def visit_AssignBlock(self, node, **kwargs):\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def visit_CallBlock(self, node, **kwargs):\n        for child in node.iter_child_nodes(exclude=('call',)):\n            self.sym_visitor.visit(child)\n\n    def visit_OverlayScope(self, node, **kwargs):\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def visit_For(self, node, for_branch='body', **kwargs):\n        if for_branch == 'body':\n            self.sym_visitor.visit(node.target, store_as_param=True)\n            branch = node.body\n        elif for_branch == 'else':\n            branch = node.else_\n        elif for_branch == 'test':\n            self.sym_visitor.visit(node.target, store_as_param=True)\n            if node.test is not None:\n                self.sym_visitor.visit(node.test)\n            return\n        else:\n            raise RuntimeError('Unknown for branch')\n        for item in branch or ():\n            self.sym_visitor.visit(item)\n\n    def visit_With(self, node, **kwargs):\n        for target in node.targets:\n            self.sym_visitor.visit(target)\n        for child in node.body:\n            self.sym_visitor.visit(child)\n\n    def generic_visit(self, node, *args, **kwargs):\n        raise NotImplementedError('Cannot find symbols for %r' %\n                                  node.__class__.__name__)\n\n\nclass FrameSymbolVisitor(NodeVisitor):\n    \"\"\"A visitor for `Frame.inspect`.\"\"\"\n\n    def __init__(self, symbols):\n        self.symbols = symbols\n\n    def visit_Name(self, node, store_as_param=False, **kwargs):\n        \"\"\"All assignments to names go through this function.\"\"\"\n        if store_as_param or node.ctx == 'param':\n            self.symbols.declare_parameter(node.name)\n        elif node.ctx == 'store':\n            self.symbols.store(node.name)\n        elif node.ctx == 'load':\n            self.symbols.load(node.name)\n\n    def visit_NSRef(self, node, **kwargs):\n        self.symbols.load(node.name)\n\n    def visit_If(self, node, **kwargs):\n        self.visit(node.test, **kwargs)\n\n        original_symbols = self.symbols\n\n        def inner_visit(nodes):\n            self.symbols = rv = original_symbols.copy()\n            for subnode in nodes:\n                self.visit(subnode, **kwargs)\n            self.symbols = original_symbols\n            return rv\n\n        body_symbols = inner_visit(node.body)\n        elif_symbols = inner_visit(node.elif_)\n        else_symbols = inner_visit(node.else_ or ())\n\n        self.symbols.branch_update([body_symbols, elif_symbols, else_symbols])\n\n    def visit_Macro(self, node, **kwargs):\n        self.symbols.store(node.name)\n\n    def visit_Import(self, node, **kwargs):\n        self.generic_visit(node, **kwargs)\n        self.symbols.store(node.target)\n\n    def visit_FromImport(self, node, **kwargs):\n        self.generic_visit(node, **kwargs)\n        for name in node.names:\n            if isinstance(name, tuple):\n                self.symbols.store(name[1])\n            else:\n                self.symbols.store(name)\n\n    def visit_Assign(self, node, **kwargs):\n        \"\"\"Visit assignments in the correct order.\"\"\"\n        self.visit(node.node, **kwargs)\n        self.visit(node.target, **kwargs)\n\n    def visit_For(self, node, **kwargs):\n        \"\"\"Visiting stops at for blocks.  However the block sequence\n        is visited as part of the outer scope.\n        \"\"\"\n        self.visit(node.iter, **kwargs)\n\n    def visit_CallBlock(self, node, **kwargs):\n        self.visit(node.call, **kwargs)\n\n    def visit_FilterBlock(self, node, **kwargs):\n        self.visit(node.filter, **kwargs)\n\n    def visit_With(self, node, **kwargs):\n        for target in node.values:\n            self.visit(target)\n\n    def visit_AssignBlock(self, node, **kwargs):\n        \"\"\"Stop visiting at block assigns.\"\"\"\n        self.visit(node.target, **kwargs)\n\n    def visit_Scope(self, node, **kwargs):\n        \"\"\"Stop visiting at scopes.\"\"\"\n\n    def visit_Block(self, node, **kwargs):\n        \"\"\"Stop visiting at blocks.\"\"\"\n\n    def visit_OverlayScope(self, node, **kwargs):\n        \"\"\"Do not visit into overlay scopes.\"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/lexer.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.lexer\n    ~~~~~~~~~~~~\n\n    This module implements a Jinja / Python combination lexer. The\n    `Lexer` class provided by this module is used to do some preprocessing\n    for Jinja.\n\n    On the one hand it filters out invalid operators like the bitshift\n    operators we don't allow in templates. On the other hand it separates\n    template code and python code in expressions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nfrom collections import deque\nfrom operator import itemgetter\n\nfrom jinja2._compat import implements_iterator, intern, iteritems, text_type\nfrom jinja2.exceptions import TemplateSyntaxError\nfrom jinja2.utils import LRUCache\n\n# cache for the lexers. Exists in order to be able to have multiple\n# environments with the same lexer\n_lexer_cache = LRUCache(50)\n\n# static regular expressions\nwhitespace_re = re.compile(r'\\s+', re.U)\nstring_re = re.compile(r\"('([^'\\\\]*(?:\\\\.[^'\\\\]*)*)'\"\n                       r'|\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")', re.S)\ninteger_re = re.compile(r'\\d+')\n\ntry:\n    # check if this Python supports Unicode identifiers\n    compile('föö', '<unknown>', 'eval')\nexcept SyntaxError:\n    # no Unicode support, use ASCII identifiers\n    name_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*')\n    check_ident = False\nelse:\n    # Unicode support, build a pattern to match valid characters, and set flag\n    # to use str.isidentifier to validate during lexing\n    from jinja2 import _identifier\n    name_re = re.compile(r'[\\w{0}]+'.format(_identifier.pattern))\n    check_ident = True\n    # remove the pattern from memory after building the regex\n    import sys\n    del sys.modules['jinja2._identifier']\n    import jinja2\n    del jinja2._identifier\n    del _identifier\n\nfloat_re = re.compile(r'(?<!\\.)\\d+\\.\\d+')\nnewline_re = re.compile(r'(\\r\\n|\\r|\\n)')\n\n# internal the tokens and keep references to them\nTOKEN_ADD = intern('add')\nTOKEN_ASSIGN = intern('assign')\nTOKEN_COLON = intern('colon')\nTOKEN_COMMA = intern('comma')\nTOKEN_DIV = intern('div')\nTOKEN_DOT = intern('dot')\nTOKEN_EQ = intern('eq')\nTOKEN_FLOORDIV = intern('floordiv')\nTOKEN_GT = intern('gt')\nTOKEN_GTEQ = intern('gteq')\nTOKEN_LBRACE = intern('lbrace')\nTOKEN_LBRACKET = intern('lbracket')\nTOKEN_LPAREN = intern('lparen')\nTOKEN_LT = intern('lt')\nTOKEN_LTEQ = intern('lteq')\nTOKEN_MOD = intern('mod')\nTOKEN_MUL = intern('mul')\nTOKEN_NE = intern('ne')\nTOKEN_PIPE = intern('pipe')\nTOKEN_POW = intern('pow')\nTOKEN_RBRACE = intern('rbrace')\nTOKEN_RBRACKET = intern('rbracket')\nTOKEN_RPAREN = intern('rparen')\nTOKEN_SEMICOLON = intern('semicolon')\nTOKEN_SUB = intern('sub')\nTOKEN_TILDE = intern('tilde')\nTOKEN_WHITESPACE = intern('whitespace')\nTOKEN_FLOAT = intern('float')\nTOKEN_INTEGER = intern('integer')\nTOKEN_NAME = intern('name')\nTOKEN_STRING = intern('string')\nTOKEN_OPERATOR = intern('operator')\nTOKEN_BLOCK_BEGIN = intern('block_begin')\nTOKEN_BLOCK_END = intern('block_end')\nTOKEN_VARIABLE_BEGIN = intern('variable_begin')\nTOKEN_VARIABLE_END = intern('variable_end')\nTOKEN_RAW_BEGIN = intern('raw_begin')\nTOKEN_RAW_END = intern('raw_end')\nTOKEN_COMMENT_BEGIN = intern('comment_begin')\nTOKEN_COMMENT_END = intern('comment_end')\nTOKEN_COMMENT = intern('comment')\nTOKEN_LINESTATEMENT_BEGIN = intern('linestatement_begin')\nTOKEN_LINESTATEMENT_END = intern('linestatement_end')\nTOKEN_LINECOMMENT_BEGIN = intern('linecomment_begin')\nTOKEN_LINECOMMENT_END = intern('linecomment_end')\nTOKEN_LINECOMMENT = intern('linecomment')\nTOKEN_DATA = intern('data')\nTOKEN_INITIAL = intern('initial')\nTOKEN_EOF = intern('eof')\n\n# bind operators to token types\noperators = {\n    '+':            TOKEN_ADD,\n    '-':            TOKEN_SUB,\n    '/':            TOKEN_DIV,\n    '//':           TOKEN_FLOORDIV,\n    '*':            TOKEN_MUL,\n    '%':            TOKEN_MOD,\n    '**':           TOKEN_POW,\n    '~':            TOKEN_TILDE,\n    '[':            TOKEN_LBRACKET,\n    ']':            TOKEN_RBRACKET,\n    '(':            TOKEN_LPAREN,\n    ')':            TOKEN_RPAREN,\n    '{':            TOKEN_LBRACE,\n    '}':            TOKEN_RBRACE,\n    '==':           TOKEN_EQ,\n    '!=':           TOKEN_NE,\n    '>':            TOKEN_GT,\n    '>=':           TOKEN_GTEQ,\n    '<':            TOKEN_LT,\n    '<=':           TOKEN_LTEQ,\n    '=':            TOKEN_ASSIGN,\n    '.':            TOKEN_DOT,\n    ':':            TOKEN_COLON,\n    '|':            TOKEN_PIPE,\n    ',':            TOKEN_COMMA,\n    ';':            TOKEN_SEMICOLON\n}\n\nreverse_operators = dict([(v, k) for k, v in iteritems(operators)])\nassert len(operators) == len(reverse_operators), 'operators dropped'\noperator_re = re.compile('(%s)' % '|'.join(re.escape(x) for x in\n                         sorted(operators, key=lambda x: -len(x))))\n\nignored_tokens = frozenset([TOKEN_COMMENT_BEGIN, TOKEN_COMMENT,\n                            TOKEN_COMMENT_END, TOKEN_WHITESPACE,\n                            TOKEN_LINECOMMENT_BEGIN, TOKEN_LINECOMMENT_END,\n                            TOKEN_LINECOMMENT])\nignore_if_empty = frozenset([TOKEN_WHITESPACE, TOKEN_DATA,\n                             TOKEN_COMMENT, TOKEN_LINECOMMENT])\n\n\ndef _describe_token_type(token_type):\n    if token_type in reverse_operators:\n        return reverse_operators[token_type]\n    return {\n        TOKEN_COMMENT_BEGIN:        'begin of comment',\n        TOKEN_COMMENT_END:          'end of comment',\n        TOKEN_COMMENT:              'comment',\n        TOKEN_LINECOMMENT:          'comment',\n        TOKEN_BLOCK_BEGIN:          'begin of statement block',\n        TOKEN_BLOCK_END:            'end of statement block',\n        TOKEN_VARIABLE_BEGIN:       'begin of print statement',\n        TOKEN_VARIABLE_END:         'end of print statement',\n        TOKEN_LINESTATEMENT_BEGIN:  'begin of line statement',\n        TOKEN_LINESTATEMENT_END:    'end of line statement',\n        TOKEN_DATA:                 'template data / text',\n        TOKEN_EOF:                  'end of template'\n    }.get(token_type, token_type)\n\n\ndef describe_token(token):\n    \"\"\"Returns a description of the token.\"\"\"\n    if token.type == 'name':\n        return token.value\n    return _describe_token_type(token.type)\n\n\ndef describe_token_expr(expr):\n    \"\"\"Like `describe_token` but for token expressions.\"\"\"\n    if ':' in expr:\n        type, value = expr.split(':', 1)\n        if type == 'name':\n            return value\n    else:\n        type = expr\n    return _describe_token_type(type)\n\n\ndef count_newlines(value):\n    \"\"\"Count the number of newline characters in the string.  This is\n    useful for extensions that filter a stream.\n    \"\"\"\n    return len(newline_re.findall(value))\n\n\ndef compile_rules(environment):\n    \"\"\"Compiles all the rules from the environment into a list of rules.\"\"\"\n    e = re.escape\n    rules = [\n        (len(environment.comment_start_string), 'comment',\n         e(environment.comment_start_string)),\n        (len(environment.block_start_string), 'block',\n         e(environment.block_start_string)),\n        (len(environment.variable_start_string), 'variable',\n         e(environment.variable_start_string))\n    ]\n\n    if environment.line_statement_prefix is not None:\n        rules.append((len(environment.line_statement_prefix), 'linestatement',\n                      r'^[ \\t\\v]*' + e(environment.line_statement_prefix)))\n    if environment.line_comment_prefix is not None:\n        rules.append((len(environment.line_comment_prefix), 'linecomment',\n                      r'(?:^|(?<=\\S))[^\\S\\r\\n]*' +\n                      e(environment.line_comment_prefix)))\n\n    return [x[1:] for x in sorted(rules, reverse=True)]\n\n\nclass Failure(object):\n    \"\"\"Class that raises a `TemplateSyntaxError` if called.\n    Used by the `Lexer` to specify known errors.\n    \"\"\"\n\n    def __init__(self, message, cls=TemplateSyntaxError):\n        self.message = message\n        self.error_class = cls\n\n    def __call__(self, lineno, filename):\n        raise self.error_class(self.message, lineno, filename)\n\n\nclass Token(tuple):\n    \"\"\"Token class.\"\"\"\n    __slots__ = ()\n    lineno, type, value = (property(itemgetter(x)) for x in range(3))\n\n    def __new__(cls, lineno, type, value):\n        return tuple.__new__(cls, (lineno, intern(str(type)), value))\n\n    def __str__(self):\n        if self.type in reverse_operators:\n            return reverse_operators[self.type]\n        elif self.type == 'name':\n            return self.value\n        return self.type\n\n    def test(self, expr):\n        \"\"\"Test a token against a token expression.  This can either be a\n        token type or ``'token_type:token_value'``.  This can only test\n        against string values and types.\n        \"\"\"\n        # here we do a regular string equality check as test_any is usually\n        # passed an iterable of not interned strings.\n        if self.type == expr:\n            return True\n        elif ':' in expr:\n            return expr.split(':', 1) == [self.type, self.value]\n        return False\n\n    def test_any(self, *iterable):\n        \"\"\"Test against multiple token expressions.\"\"\"\n        for expr in iterable:\n            if self.test(expr):\n                return True\n        return False\n\n    def __repr__(self):\n        return 'Token(%r, %r, %r)' % (\n            self.lineno,\n            self.type,\n            self.value\n        )\n\n\n@implements_iterator\nclass TokenStreamIterator(object):\n    \"\"\"The iterator for tokenstreams.  Iterate over the stream\n    until the eof token is reached.\n    \"\"\"\n\n    def __init__(self, stream):\n        self.stream = stream\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        token = self.stream.current\n        if token.type is TOKEN_EOF:\n            self.stream.close()\n            raise StopIteration()\n        next(self.stream)\n        return token\n\n\n@implements_iterator\nclass TokenStream(object):\n    \"\"\"A token stream is an iterable that yields :class:`Token`\\\\s.  The\n    parser however does not iterate over it but calls :meth:`next` to go\n    one token ahead.  The current active token is stored as :attr:`current`.\n    \"\"\"\n\n    def __init__(self, generator, name, filename):\n        self._iter = iter(generator)\n        self._pushed = deque()\n        self.name = name\n        self.filename = filename\n        self.closed = False\n        self.current = Token(1, TOKEN_INITIAL, '')\n        next(self)\n\n    def __iter__(self):\n        return TokenStreamIterator(self)\n\n    def __bool__(self):\n        return bool(self._pushed) or self.current.type is not TOKEN_EOF\n    __nonzero__ = __bool__  # py2\n\n    eos = property(lambda x: not x, doc=\"Are we at the end of the stream?\")\n\n    def push(self, token):\n        \"\"\"Push a token back to the stream.\"\"\"\n        self._pushed.append(token)\n\n    def look(self):\n        \"\"\"Look at the next token.\"\"\"\n        old_token = next(self)\n        result = self.current\n        self.push(result)\n        self.current = old_token\n        return result\n\n    def skip(self, n=1):\n        \"\"\"Got n tokens ahead.\"\"\"\n        for x in range(n):\n            next(self)\n\n    def next_if(self, expr):\n        \"\"\"Perform the token test and return the token if it matched.\n        Otherwise the return value is `None`.\n        \"\"\"\n        if self.current.test(expr):\n            return next(self)\n\n    def skip_if(self, expr):\n        \"\"\"Like :meth:`next_if` but only returns `True` or `False`.\"\"\"\n        return self.next_if(expr) is not None\n\n    def __next__(self):\n        \"\"\"Go one token ahead and return the old one.\n\n        Use the built-in :func:`next` instead of calling this directly.\n        \"\"\"\n        rv = self.current\n        if self._pushed:\n            self.current = self._pushed.popleft()\n        elif self.current.type is not TOKEN_EOF:\n            try:\n                self.current = next(self._iter)\n            except StopIteration:\n                self.close()\n        return rv\n\n    def close(self):\n        \"\"\"Close the stream.\"\"\"\n        self.current = Token(self.current.lineno, TOKEN_EOF, '')\n        self._iter = None\n        self.closed = True\n\n    def expect(self, expr):\n        \"\"\"Expect a given token type and return it.  This accepts the same\n        argument as :meth:`jinja2.lexer.Token.test`.\n        \"\"\"\n        if not self.current.test(expr):\n            expr = describe_token_expr(expr)\n            if self.current.type is TOKEN_EOF:\n                raise TemplateSyntaxError('unexpected end of template, '\n                                          'expected %r.' % expr,\n                                          self.current.lineno,\n                                          self.name, self.filename)\n            raise TemplateSyntaxError(\"expected token %r, got %r\" %\n                                      (expr, describe_token(self.current)),\n                                      self.current.lineno,\n                                      self.name, self.filename)\n        try:\n            return self.current\n        finally:\n            next(self)\n\n\ndef get_lexer(environment):\n    \"\"\"Return a lexer which is probably cached.\"\"\"\n    key = (environment.block_start_string,\n           environment.block_end_string,\n           environment.variable_start_string,\n           environment.variable_end_string,\n           environment.comment_start_string,\n           environment.comment_end_string,\n           environment.line_statement_prefix,\n           environment.line_comment_prefix,\n           environment.trim_blocks,\n           environment.lstrip_blocks,\n           environment.newline_sequence,\n           environment.keep_trailing_newline)\n    lexer = _lexer_cache.get(key)\n    if lexer is None:\n        lexer = Lexer(environment)\n        _lexer_cache[key] = lexer\n    return lexer\n\n\nclass Lexer(object):\n    \"\"\"Class that implements a lexer for a given environment. Automatically\n    created by the environment class, usually you don't have to do that.\n\n    Note that the lexer is not automatically bound to an environment.\n    Multiple environments can share the same lexer.\n    \"\"\"\n\n    def __init__(self, environment):\n        # shortcuts\n        c = lambda x: re.compile(x, re.M | re.S)\n        e = re.escape\n\n        # lexing rules for tags\n        tag_rules = [\n            (whitespace_re, TOKEN_WHITESPACE, None),\n            (float_re, TOKEN_FLOAT, None),\n            (integer_re, TOKEN_INTEGER, None),\n            (name_re, TOKEN_NAME, None),\n            (string_re, TOKEN_STRING, None),\n            (operator_re, TOKEN_OPERATOR, None)\n        ]\n\n        # assemble the root lexing rule. because \"|\" is ungreedy\n        # we have to sort by length so that the lexer continues working\n        # as expected when we have parsing rules like <% for block and\n        # <%= for variables. (if someone wants asp like syntax)\n        # variables are just part of the rules if variable processing\n        # is required.\n        root_tag_rules = compile_rules(environment)\n\n        # block suffix if trimming is enabled\n        block_suffix_re = environment.trim_blocks and '\\\\n?' or ''\n\n        # strip leading spaces if lstrip_blocks is enabled\n        prefix_re = {}\n        if environment.lstrip_blocks:\n            # use '{%+' to manually disable lstrip_blocks behavior\n            no_lstrip_re = e('+')\n            # detect overlap between block and variable or comment strings\n            block_diff = c(r'^%s(.*)' % e(environment.block_start_string))\n            # make sure we don't mistake a block for a variable or a comment\n            m = block_diff.match(environment.comment_start_string)\n            no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''\n            m = block_diff.match(environment.variable_start_string)\n            no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''\n\n            # detect overlap between comment and variable strings\n            comment_diff = c(r'^%s(.*)' % e(environment.comment_start_string))\n            m = comment_diff.match(environment.variable_start_string)\n            no_variable_re = m and r'(?!%s)' % e(m.group(1)) or ''\n\n            lstrip_re = r'^[ \\t]*'\n            block_prefix_re = r'%s%s(?!%s)|%s\\+?' % (\n                    lstrip_re,\n                    e(environment.block_start_string),\n                    no_lstrip_re,\n                    e(environment.block_start_string),\n                    )\n            comment_prefix_re = r'%s%s%s|%s\\+?' % (\n                    lstrip_re,\n                    e(environment.comment_start_string),\n                    no_variable_re,\n                    e(environment.comment_start_string),\n                    )\n            prefix_re['block'] = block_prefix_re\n            prefix_re['comment'] = comment_prefix_re\n        else:\n            block_prefix_re = '%s' % e(environment.block_start_string)\n\n        self.newline_sequence = environment.newline_sequence\n        self.keep_trailing_newline = environment.keep_trailing_newline\n\n        # global lexing rules\n        self.rules = {\n            'root': [\n                # directives\n                (c('(.*?)(?:%s)' % '|'.join(\n                    [r'(?P<raw_begin>(?:\\s*%s\\-|%s)\\s*raw\\s*(?:\\-%s\\s*|%s))' % (\n                        e(environment.block_start_string),\n                        block_prefix_re,\n                        e(environment.block_end_string),\n                        e(environment.block_end_string)\n                    )] + [\n                        r'(?P<%s_begin>\\s*%s\\-|%s)' % (n, r, prefix_re.get(n,r))\n                        for n, r in root_tag_rules\n                    ])), (TOKEN_DATA, '#bygroup'), '#bygroup'),\n                # data\n                (c('.+'), TOKEN_DATA, None)\n            ],\n            # comments\n            TOKEN_COMMENT_BEGIN: [\n                (c(r'(.*?)((?:\\-%s\\s*|%s)%s)' % (\n                    e(environment.comment_end_string),\n                    e(environment.comment_end_string),\n                    block_suffix_re\n                )), (TOKEN_COMMENT, TOKEN_COMMENT_END), '#pop'),\n                (c('(.)'), (Failure('Missing end of comment tag'),), None)\n            ],\n            # blocks\n            TOKEN_BLOCK_BEGIN: [\n                (c(r'(?:\\-%s\\s*|%s)%s' % (\n                    e(environment.block_end_string),\n                    e(environment.block_end_string),\n                    block_suffix_re\n                )), TOKEN_BLOCK_END, '#pop'),\n            ] + tag_rules,\n            # variables\n            TOKEN_VARIABLE_BEGIN: [\n                (c(r'\\-%s\\s*|%s' % (\n                    e(environment.variable_end_string),\n                    e(environment.variable_end_string)\n                )), TOKEN_VARIABLE_END, '#pop')\n            ] + tag_rules,\n            # raw block\n            TOKEN_RAW_BEGIN: [\n                (c(r'(.*?)((?:\\s*%s\\-|%s)\\s*endraw\\s*(?:\\-%s\\s*|%s%s))' % (\n                    e(environment.block_start_string),\n                    block_prefix_re,\n                    e(environment.block_end_string),\n                    e(environment.block_end_string),\n                    block_suffix_re\n                )), (TOKEN_DATA, TOKEN_RAW_END), '#pop'),\n                (c('(.)'), (Failure('Missing end of raw directive'),), None)\n            ],\n            # line statements\n            TOKEN_LINESTATEMENT_BEGIN: [\n                (c(r'\\s*(\\n|$)'), TOKEN_LINESTATEMENT_END, '#pop')\n            ] + tag_rules,\n            # line comments\n            TOKEN_LINECOMMENT_BEGIN: [\n                (c(r'(.*?)()(?=\\n|$)'), (TOKEN_LINECOMMENT,\n                 TOKEN_LINECOMMENT_END), '#pop')\n            ]\n        }\n\n    def _normalize_newlines(self, value):\n        \"\"\"Called for strings and template data to normalize it to unicode.\"\"\"\n        return newline_re.sub(self.newline_sequence, value)\n\n    def tokenize(self, source, name=None, filename=None, state=None):\n        \"\"\"Calls tokeniter + tokenize and wraps it in a token stream.\n        \"\"\"\n        stream = self.tokeniter(source, name, filename, state)\n        return TokenStream(self.wrap(stream, name, filename), name, filename)\n\n    def wrap(self, stream, name=None, filename=None):\n        \"\"\"This is called with the stream as returned by `tokenize` and wraps\n        every token in a :class:`Token` and converts the value.\n        \"\"\"\n        for lineno, token, value in stream:\n            if token in ignored_tokens:\n                continue\n            elif token == 'linestatement_begin':\n                token = 'block_begin'\n            elif token == 'linestatement_end':\n                token = 'block_end'\n            # we are not interested in those tokens in the parser\n            elif token in ('raw_begin', 'raw_end'):\n                continue\n            elif token == 'data':\n                value = self._normalize_newlines(value)\n            elif token == 'keyword':\n                token = value\n            elif token == 'name':\n                value = str(value)\n                if check_ident and not value.isidentifier():\n                    raise TemplateSyntaxError(\n                        'Invalid character in identifier',\n                        lineno, name, filename)\n            elif token == 'string':\n                # try to unescape string\n                try:\n                    value = self._normalize_newlines(value[1:-1]) \\\n                        .encode('ascii', 'backslashreplace') \\\n                        .decode('unicode-escape')\n                except Exception as e:\n                    msg = str(e).split(':')[-1].strip()\n                    raise TemplateSyntaxError(msg, lineno, name, filename)\n            elif token == 'integer':\n                value = int(value)\n            elif token == 'float':\n                value = float(value)\n            elif token == 'operator':\n                token = operators[value]\n            yield Token(lineno, token, value)\n\n    def tokeniter(self, source, name, filename=None, state=None):\n        \"\"\"This method tokenizes the text and returns the tokens in a\n        generator.  Use this method if you just want to tokenize a template.\n        \"\"\"\n        source = text_type(source)\n        lines = source.splitlines()\n        if self.keep_trailing_newline and source:\n            for newline in ('\\r\\n', '\\r', '\\n'):\n                if source.endswith(newline):\n                    lines.append('')\n                    break\n        source = '\\n'.join(lines)\n        pos = 0\n        lineno = 1\n        stack = ['root']\n        if state is not None and state != 'root':\n            assert state in ('variable', 'block'), 'invalid state'\n            stack.append(state + '_begin')\n        else:\n            state = 'root'\n        statetokens = self.rules[stack[-1]]\n        source_length = len(source)\n\n        balancing_stack = []\n\n        while 1:\n            # tokenizer loop\n            for regex, tokens, new_state in statetokens:\n                m = regex.match(source, pos)\n                # if no match we try again with the next rule\n                if m is None:\n                    continue\n\n                # we only match blocks and variables if braces / parentheses\n                # are balanced. continue parsing with the lower rule which\n                # is the operator rule. do this only if the end tags look\n                # like operators\n                if balancing_stack and \\\n                   tokens in ('variable_end', 'block_end',\n                              'linestatement_end'):\n                    continue\n\n                # tuples support more options\n                if isinstance(tokens, tuple):\n                    for idx, token in enumerate(tokens):\n                        # failure group\n                        if token.__class__ is Failure:\n                            raise token(lineno, filename)\n                        # bygroup is a bit more complex, in that case we\n                        # yield for the current token the first named\n                        # group that matched\n                        elif token == '#bygroup':\n                            for key, value in iteritems(m.groupdict()):\n                                if value is not None:\n                                    yield lineno, key, value\n                                    lineno += value.count('\\n')\n                                    break\n                            else:\n                                raise RuntimeError('%r wanted to resolve '\n                                                   'the token dynamically'\n                                                   ' but no group matched'\n                                                   % regex)\n                        # normal group\n                        else:\n                            data = m.group(idx + 1)\n                            if data or token not in ignore_if_empty:\n                                yield lineno, token, data\n                            lineno += data.count('\\n')\n\n                # strings as token just are yielded as it.\n                else:\n                    data = m.group()\n                    # update brace/parentheses balance\n                    if tokens == 'operator':\n                        if data == '{':\n                            balancing_stack.append('}')\n                        elif data == '(':\n                            balancing_stack.append(')')\n                        elif data == '[':\n                            balancing_stack.append(']')\n                        elif data in ('}', ')', ']'):\n                            if not balancing_stack:\n                                raise TemplateSyntaxError('unexpected \\'%s\\'' %\n                                                          data, lineno, name,\n                                                          filename)\n                            expected_op = balancing_stack.pop()\n                            if expected_op != data:\n                                raise TemplateSyntaxError('unexpected \\'%s\\', '\n                                                          'expected \\'%s\\'' %\n                                                          (data, expected_op),\n                                                          lineno, name,\n                                                          filename)\n                    # yield items\n                    if data or tokens not in ignore_if_empty:\n                        yield lineno, tokens, data\n                    lineno += data.count('\\n')\n\n                # fetch new position into new variable so that we can check\n                # if there is a internal parsing error which would result\n                # in an infinite loop\n                pos2 = m.end()\n\n                # handle state changes\n                if new_state is not None:\n                    # remove the uppermost state\n                    if new_state == '#pop':\n                        stack.pop()\n                    # resolve the new state by group checking\n                    elif new_state == '#bygroup':\n                        for key, value in iteritems(m.groupdict()):\n                            if value is not None:\n                                stack.append(key)\n                                break\n                        else:\n                            raise RuntimeError('%r wanted to resolve the '\n                                               'new state dynamically but'\n                                               ' no group matched' %\n                                               regex)\n                    # direct state name given\n                    else:\n                        stack.append(new_state)\n                    statetokens = self.rules[stack[-1]]\n                # we are still at the same position and no stack change.\n                # this means a loop without break condition, avoid that and\n                # raise error\n                elif pos2 == pos:\n                    raise RuntimeError('%r yielded empty string without '\n                                       'stack change' % regex)\n                # publish new function and start again\n                pos = pos2\n                break\n            # if loop terminated without break we haven't found a single match\n            # either we are at the end of the file or we have a problem\n            else:\n                # end of text\n                if pos >= source_length:\n                    return\n                # something went wrong\n                raise TemplateSyntaxError('unexpected char %r at %d' %\n                                          (source[pos], pos), lineno,\n                                          name, filename)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/loaders.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.loaders\n    ~~~~~~~~~~~~~~\n\n    Jinja loader classes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport sys\nimport weakref\nfrom types import ModuleType\nfrom os import path\nfrom hashlib import sha1\nfrom jinja2.exceptions import TemplateNotFound\nfrom jinja2.utils import open_if_exists, internalcode\nfrom jinja2._compat import string_types, iteritems\n\n\ndef split_template_path(template):\n    \"\"\"Split a path into segments and perform a sanity check.  If it detects\n    '..' in the path it will raise a `TemplateNotFound` error.\n    \"\"\"\n    pieces = []\n    for piece in template.split('/'):\n        if path.sep in piece \\\n           or (path.altsep and path.altsep in piece) or \\\n           piece == path.pardir:\n            raise TemplateNotFound(template)\n        elif piece and piece != '.':\n            pieces.append(piece)\n    return pieces\n\n\nclass BaseLoader(object):\n    \"\"\"Baseclass for all loaders.  Subclass this and override `get_source` to\n    implement a custom loading mechanism.  The environment provides a\n    `get_template` method that calls the loader's `load` method to get the\n    :class:`Template` object.\n\n    A very basic example for a loader that looks up templates on the file\n    system could look like this::\n\n        from jinja2 import BaseLoader, TemplateNotFound\n        from os.path import join, exists, getmtime\n\n        class MyLoader(BaseLoader):\n\n            def __init__(self, path):\n                self.path = path\n\n            def get_source(self, environment, template):\n                path = join(self.path, template)\n                if not exists(path):\n                    raise TemplateNotFound(template)\n                mtime = getmtime(path)\n                with file(path) as f:\n                    source = f.read().decode('utf-8')\n                return source, path, lambda: mtime == getmtime(path)\n    \"\"\"\n\n    #: if set to `False` it indicates that the loader cannot provide access\n    #: to the source of templates.\n    #:\n    #: .. versionadded:: 2.4\n    has_source_access = True\n\n    def get_source(self, environment, template):\n        \"\"\"Get the template source, filename and reload helper for a template.\n        It's passed the environment and template name and has to return a\n        tuple in the form ``(source, filename, uptodate)`` or raise a\n        `TemplateNotFound` error if it can't locate the template.\n\n        The source part of the returned tuple must be the source of the\n        template as unicode string or a ASCII bytestring.  The filename should\n        be the name of the file on the filesystem if it was loaded from there,\n        otherwise `None`.  The filename is used by python for the tracebacks\n        if no loader extension is used.\n\n        The last item in the tuple is the `uptodate` function.  If auto\n        reloading is enabled it's always called to check if the template\n        changed.  No arguments are passed so the function must store the\n        old state somewhere (for example in a closure).  If it returns `False`\n        the template will be reloaded.\n        \"\"\"\n        if not self.has_source_access:\n            raise RuntimeError('%s cannot provide access to the source' %\n                               self.__class__.__name__)\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        \"\"\"Iterates over all templates.  If the loader does not support that\n        it should raise a :exc:`TypeError` which is the default behavior.\n        \"\"\"\n        raise TypeError('this loader cannot iterate over all templates')\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        \"\"\"Loads a template.  This method looks up the template in the cache\n        or loads one by calling :meth:`get_source`.  Subclasses should not\n        override this method as loaders working on collections of other\n        loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n        will not call this method but `get_source` directly.\n        \"\"\"\n        code = None\n        if globals is None:\n            globals = {}\n\n        # first we try to get the source for this template together\n        # with the filename and the uptodate function.\n        source, filename, uptodate = self.get_source(environment, name)\n\n        # try to load the code from the bytecode cache if there is a\n        # bytecode cache configured.\n        bcc = environment.bytecode_cache\n        if bcc is not None:\n            bucket = bcc.get_bucket(environment, name, filename, source)\n            code = bucket.code\n\n        # if we don't have code so far (not cached, no longer up to\n        # date) etc. we compile the template\n        if code is None:\n            code = environment.compile(source, name, filename)\n\n        # if the bytecode cache is available and the bucket doesn't\n        # have a code so far, we give the bucket the new code and put\n        # it back to the bytecode cache.\n        if bcc is not None and bucket.code is None:\n            bucket.code = code\n            bcc.set_bucket(bucket)\n\n        return environment.template_class.from_code(environment, code,\n                                                    globals, uptodate)\n\n\nclass FileSystemLoader(BaseLoader):\n    \"\"\"Loads templates from the file system.  This loader can find templates\n    in folders on the file system and is the preferred way to load them.\n\n    The loader takes the path to the templates as string, or if multiple\n    locations are wanted a list of them which is then looked up in the\n    given order::\n\n    >>> loader = FileSystemLoader('/path/to/templates')\n    >>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])\n\n    Per default the template encoding is ``'utf-8'`` which can be changed\n    by setting the `encoding` parameter to something else.\n\n    To follow symbolic links, set the *followlinks* parameter to ``True``::\n\n    >>> loader = FileSystemLoader('/path/to/templates', followlinks=True)\n\n    .. versionchanged:: 2.8+\n       The *followlinks* parameter was added.\n    \"\"\"\n\n    def __init__(self, searchpath, encoding='utf-8', followlinks=False):\n        if isinstance(searchpath, string_types):\n            searchpath = [searchpath]\n        self.searchpath = list(searchpath)\n        self.encoding = encoding\n        self.followlinks = followlinks\n\n    def get_source(self, environment, template):\n        pieces = split_template_path(template)\n        for searchpath in self.searchpath:\n            filename = path.join(searchpath, *pieces)\n            f = open_if_exists(filename)\n            if f is None:\n                continue\n            try:\n                contents = f.read().decode(self.encoding)\n            finally:\n                f.close()\n\n            mtime = path.getmtime(filename)\n\n            def uptodate():\n                try:\n                    return path.getmtime(filename) == mtime\n                except OSError:\n                    return False\n            return contents, filename, uptodate\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        found = set()\n        for searchpath in self.searchpath:\n            walk_dir = os.walk(searchpath, followlinks=self.followlinks)\n            for dirpath, dirnames, filenames in walk_dir:\n                for filename in filenames:\n                    template = os.path.join(dirpath, filename) \\\n                        [len(searchpath):].strip(os.path.sep) \\\n                                          .replace(os.path.sep, '/')\n                    if template[:2] == './':\n                        template = template[2:]\n                    if template not in found:\n                        found.add(template)\n        return sorted(found)\n\n\n# Nuitka: Load this immediately to avoid having to have pkg_resources\n# inline copy present after initial import.\nimport pkg_resources\nfrom pkg_resources import DefaultProvider, ResourceManager, get_provider\n\nclass PackageLoader(BaseLoader):\n    \"\"\"Load templates from python eggs or packages.  It is constructed with\n    the name of the python package and the path to the templates in that\n    package::\n\n        loader = PackageLoader('mypackage', 'views')\n\n    If the package path is not given, ``'templates'`` is assumed.\n\n    Per default the template encoding is ``'utf-8'`` which can be changed\n    by setting the `encoding` parameter to something else.  Due to the nature\n    of eggs it's only possible to reload templates if the package was loaded\n    from the file system and not a zip file.\n    \"\"\"\n\n    def __init__(self, package_name, package_path='templates',\n                 encoding='utf-8'):\n        provider = get_provider(package_name)\n        self.encoding = encoding\n        self.manager = ResourceManager()\n        self.filesystem_bound = isinstance(provider, DefaultProvider)\n        self.provider = provider\n        self.package_path = package_path\n\n    def get_source(self, environment, template):\n        pieces = split_template_path(template)\n        p = '/'.join((self.package_path,) + tuple(pieces))\n        if not self.provider.has_resource(p):\n            raise TemplateNotFound(template)\n\n        filename = uptodate = None\n        if self.filesystem_bound:\n            filename = self.provider.get_resource_filename(self.manager, p)\n            mtime = path.getmtime(filename)\n            def uptodate():\n                try:\n                    return path.getmtime(filename) == mtime\n                except OSError:\n                    return False\n\n        source = self.provider.get_resource_string(self.manager, p)\n        return source.decode(self.encoding), filename, uptodate\n\n    def list_templates(self):\n        path = self.package_path\n        if path[:2] == './':\n            path = path[2:]\n        elif path == '.':\n            path = ''\n        offset = len(path)\n        results = []\n        def _walk(path):\n            for filename in self.provider.resource_listdir(path):\n                fullname = path + '/' + filename\n                if self.provider.resource_isdir(fullname):\n                    _walk(fullname)\n                else:\n                    results.append(fullname[offset:].lstrip('/'))\n        _walk(path)\n        results.sort()\n        return results\n\n\nclass DictLoader(BaseLoader):\n    \"\"\"Loads a template from a python dict.  It's passed a dict of unicode\n    strings bound to template names.  This loader is useful for unittesting:\n\n    >>> loader = DictLoader({'index.html': 'source here'})\n\n    Because auto reloading is rarely useful this is disabled per default.\n    \"\"\"\n\n    def __init__(self, mapping):\n        self.mapping = mapping\n\n    def get_source(self, environment, template):\n        if template in self.mapping:\n            source = self.mapping[template]\n            return source, None, lambda: source == self.mapping.get(template)\n        raise TemplateNotFound(template)\n\n    def list_templates(self):\n        return sorted(self.mapping)\n\n\nclass FunctionLoader(BaseLoader):\n    \"\"\"A loader that is passed a function which does the loading.  The\n    function receives the name of the template and has to return either\n    an unicode string with the template source, a tuple in the form ``(source,\n    filename, uptodatefunc)`` or `None` if the template does not exist.\n\n    >>> def load_template(name):\n    ...     if name == 'index.html':\n    ...         return '...'\n    ...\n    >>> loader = FunctionLoader(load_template)\n\n    The `uptodatefunc` is a function that is called if autoreload is enabled\n    and has to return `True` if the template is still up to date.  For more\n    details have a look at :meth:`BaseLoader.get_source` which has the same\n    return value.\n    \"\"\"\n\n    def __init__(self, load_func):\n        self.load_func = load_func\n\n    def get_source(self, environment, template):\n        rv = self.load_func(template)\n        if rv is None:\n            raise TemplateNotFound(template)\n        elif isinstance(rv, string_types):\n            return rv, None, None\n        return rv\n\n\nclass PrefixLoader(BaseLoader):\n    \"\"\"A loader that is passed a dict of loaders where each loader is bound\n    to a prefix.  The prefix is delimited from the template by a slash per\n    default, which can be changed by setting the `delimiter` argument to\n    something else::\n\n        loader = PrefixLoader({\n            'app1':     PackageLoader('mypackage.app1'),\n            'app2':     PackageLoader('mypackage.app2')\n        })\n\n    By loading ``'app1/index.html'`` the file from the app1 package is loaded,\n    by loading ``'app2/index.html'`` the file from the second.\n    \"\"\"\n\n    def __init__(self, mapping, delimiter='/'):\n        self.mapping = mapping\n        self.delimiter = delimiter\n\n    def get_loader(self, template):\n        try:\n            prefix, name = template.split(self.delimiter, 1)\n            loader = self.mapping[prefix]\n        except (ValueError, KeyError):\n            raise TemplateNotFound(template)\n        return loader, name\n\n    def get_source(self, environment, template):\n        loader, name = self.get_loader(template)\n        try:\n            return loader.get_source(environment, name)\n        except TemplateNotFound:\n            # re-raise the exception with the correct filename here.\n            # (the one that includes the prefix)\n            raise TemplateNotFound(template)\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        loader, local_name = self.get_loader(name)\n        try:\n            return loader.load(environment, local_name, globals)\n        except TemplateNotFound:\n            # re-raise the exception with the correct filename here.\n            # (the one that includes the prefix)\n            raise TemplateNotFound(name)\n\n    def list_templates(self):\n        result = []\n        for prefix, loader in iteritems(self.mapping):\n            for template in loader.list_templates():\n                result.append(prefix + self.delimiter + template)\n        return result\n\n\nclass ChoiceLoader(BaseLoader):\n    \"\"\"This loader works like the `PrefixLoader` just that no prefix is\n    specified.  If a template could not be found by one loader the next one\n    is tried.\n\n    >>> loader = ChoiceLoader([\n    ...     FileSystemLoader('/path/to/user/templates'),\n    ...     FileSystemLoader('/path/to/system/templates')\n    ... ])\n\n    This is useful if you want to allow users to override builtin templates\n    from a different location.\n    \"\"\"\n\n    def __init__(self, loaders):\n        self.loaders = loaders\n\n    def get_source(self, environment, template):\n        for loader in self.loaders:\n            try:\n                return loader.get_source(environment, template)\n            except TemplateNotFound:\n                pass\n        raise TemplateNotFound(template)\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        for loader in self.loaders:\n            try:\n                return loader.load(environment, name, globals)\n            except TemplateNotFound:\n                pass\n        raise TemplateNotFound(name)\n\n    def list_templates(self):\n        found = set()\n        for loader in self.loaders:\n            found.update(loader.list_templates())\n        return sorted(found)\n\n\nclass _TemplateModule(ModuleType):\n    \"\"\"Like a normal module but with support for weak references\"\"\"\n\n\nclass ModuleLoader(BaseLoader):\n    \"\"\"This loader loads templates from precompiled templates.\n\n    Example usage:\n\n    >>> loader = ChoiceLoader([\n    ...     ModuleLoader('/path/to/compiled/templates'),\n    ...     FileSystemLoader('/path/to/templates')\n    ... ])\n\n    Templates can be precompiled with :meth:`Environment.compile_templates`.\n    \"\"\"\n\n    has_source_access = False\n\n    def __init__(self, path):\n        package_name = '_jinja2_module_templates_%x' % id(self)\n\n        # create a fake module that looks for the templates in the\n        # path given.\n        mod = _TemplateModule(package_name)\n        if isinstance(path, string_types):\n            path = [path]\n        else:\n            path = list(path)\n        mod.__path__ = path\n\n        sys.modules[package_name] = weakref.proxy(mod,\n            lambda x: sys.modules.pop(package_name, None))\n\n        # the only strong reference, the sys.modules entry is weak\n        # so that the garbage collector can remove it once the\n        # loader that created it goes out of business.\n        self.module = mod\n        self.package_name = package_name\n\n    @staticmethod\n    def get_template_key(name):\n        return 'tmpl_' + sha1(name.encode('utf-8')).hexdigest()\n\n    @staticmethod\n    def get_module_filename(name):\n        return ModuleLoader.get_template_key(name) + '.py'\n\n    @internalcode\n    def load(self, environment, name, globals=None):\n        key = self.get_template_key(name)\n        module = '%s.%s' % (self.package_name, key)\n        mod = getattr(self.module, module, None)\n        if mod is None:\n            try:\n                mod = __import__(module, None, None, ['root'])\n            except ImportError:\n                raise TemplateNotFound(name)\n\n            # remove the entry from sys.modules, we only want the attribute\n            # on the module object we have stored on the loader.\n            sys.modules.pop(module, None)\n\n        return environment.template_class.from_module_dict(\n            environment, mod.__dict__, globals)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/meta.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.meta\n    ~~~~~~~~~~~\n\n    This module implements various functions that exposes information about\n    templates that might be interesting for various kinds of applications.\n\n    :copyright: (c) 2017 by the Jinja Team, see AUTHORS for more details.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.compiler import CodeGenerator\nfrom jinja2._compat import string_types, iteritems\n\n\nclass TrackingCodeGenerator(CodeGenerator):\n    \"\"\"We abuse the code generator for introspection.\"\"\"\n\n    def __init__(self, environment):\n        CodeGenerator.__init__(self, environment, '<introspection>',\n                               '<introspection>')\n        self.undeclared_identifiers = set()\n\n    def write(self, x):\n        \"\"\"Don't write.\"\"\"\n\n    def enter_frame(self, frame):\n        \"\"\"Remember all undeclared identifiers.\"\"\"\n        CodeGenerator.enter_frame(self, frame)\n        for _, (action, param) in iteritems(frame.symbols.loads):\n            if action == 'resolve':\n                self.undeclared_identifiers.add(param)\n\n\ndef find_undeclared_variables(ast):\n    \"\"\"Returns a set of all variables in the AST that will be looked up from\n    the context at runtime.  Because at compile time it's not known which\n    variables will be used depending on the path the execution takes at\n    runtime, all variables are returned.\n\n    >>> from jinja2 import Environment, meta\n    >>> env = Environment()\n    >>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')\n    >>> meta.find_undeclared_variables(ast) == set(['bar'])\n    True\n\n    .. admonition:: Implementation\n\n       Internally the code generator is used for finding undeclared variables.\n       This is good to know because the code generator might raise a\n       :exc:`TemplateAssertionError` during compilation and as a matter of\n       fact this function can currently raise that exception as well.\n    \"\"\"\n    codegen = TrackingCodeGenerator(ast.environment)\n    codegen.visit(ast)\n    return codegen.undeclared_identifiers\n\n\ndef find_referenced_templates(ast):\n    \"\"\"Finds all the referenced templates from the AST.  This will return an\n    iterator over all the hardcoded template extensions, inclusions and\n    imports.  If dynamic inheritance or inclusion is used, `None` will be\n    yielded.\n\n    >>> from jinja2 import Environment, meta\n    >>> env = Environment()\n    >>> ast = env.parse('{% extends \"layout.html\" %}{% include helper %}')\n    >>> list(meta.find_referenced_templates(ast))\n    ['layout.html', None]\n\n    This function is useful for dependency tracking.  For example if you want\n    to rebuild parts of the website after a layout template has changed.\n    \"\"\"\n    for node in ast.find_all((nodes.Extends, nodes.FromImport, nodes.Import,\n                              nodes.Include)):\n        if not isinstance(node.template, nodes.Const):\n            # a tuple with some non consts in there\n            if isinstance(node.template, (nodes.Tuple, nodes.List)):\n                for template_name in node.template.items:\n                    # something const, only yield the strings and ignore\n                    # non-string consts that really just make no sense\n                    if isinstance(template_name, nodes.Const):\n                        if isinstance(template_name.value, string_types):\n                            yield template_name.value\n                    # something dynamic in there\n                    else:\n                        yield None\n            # something dynamic we don't know about here\n            else:\n                yield None\n            continue\n        # constant is a basestring, direct template name\n        if isinstance(node.template.value, string_types):\n            yield node.template.value\n        # a tuple or list (latter *should* not happen) made of consts,\n        # yield the consts that are strings.  We could warn here for\n        # non string values\n        elif isinstance(node, nodes.Include) and \\\n             isinstance(node.template.value, (tuple, list)):\n            for template_name in node.template.value:\n                if isinstance(template_name, string_types):\n                    yield template_name\n        # something else we don't care about, we could warn here\n        else:\n            yield None\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/nativetypes.py",
    "content": "import sys\nfrom ast import literal_eval\nfrom itertools import islice, chain\nfrom jinja2 import nodes\nfrom jinja2._compat import text_type\nfrom jinja2.compiler import CodeGenerator, has_safe_repr\nfrom jinja2.environment import Environment, Template\nfrom jinja2.utils import concat, escape\n\n\ndef native_concat(nodes):\n    \"\"\"Return a native Python type from the list of compiled nodes. If the\n    result is a single node, its value is returned. Otherwise, the nodes are\n    concatenated as strings. If the result can be parsed with\n    :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the\n    string is returned.\n    \"\"\"\n    head = list(islice(nodes, 2))\n\n    if not head:\n        return None\n\n    if len(head) == 1:\n        out = head[0]\n    else:\n        out = u''.join([text_type(v) for v in chain(head, nodes)])\n\n    try:\n        return literal_eval(out)\n    except (ValueError, SyntaxError, MemoryError):\n        return out\n\n\nclass NativeCodeGenerator(CodeGenerator):\n    \"\"\"A code generator which avoids injecting ``to_string()`` calls around the\n    internal code Jinja uses to render templates.\n    \"\"\"\n\n    def visit_Output(self, node, frame):\n        \"\"\"Same as :meth:`CodeGenerator.visit_Output`, but do not call\n        ``to_string`` on output nodes in generated code.\n        \"\"\"\n        if self.has_known_extends and frame.require_output_check:\n            return\n\n        finalize = self.environment.finalize\n        finalize_context = getattr(finalize, 'contextfunction', False)\n        finalize_eval = getattr(finalize, 'evalcontextfunction', False)\n        finalize_env = getattr(finalize, 'environmentfunction', False)\n\n        if finalize is not None:\n            if finalize_context or finalize_eval:\n                const_finalize = None\n            elif finalize_env:\n                def const_finalize(x):\n                    return finalize(self.environment, x)\n            else:\n                const_finalize = finalize\n        else:\n            def const_finalize(x):\n                return x\n\n        # If we are inside a frame that requires output checking, we do so.\n        outdent_later = False\n\n        if frame.require_output_check:\n            self.writeline('if parent_template is None:')\n            self.indent()\n            outdent_later = True\n\n        # Try to evaluate as many chunks as possible into a static string at\n        # compile time.\n        body = []\n\n        for child in node.nodes:\n            try:\n                if const_finalize is None:\n                    raise nodes.Impossible()\n\n                const = child.as_const(frame.eval_ctx)\n                if not has_safe_repr(const):\n                    raise nodes.Impossible()\n            except nodes.Impossible:\n                body.append(child)\n                continue\n\n            # the frame can't be volatile here, because otherwise the as_const\n            # function would raise an Impossible exception at that point\n            try:\n                if frame.eval_ctx.autoescape:\n                    if hasattr(const, '__html__'):\n                        const = const.__html__()\n                    else:\n                        const = escape(const)\n\n                const = const_finalize(const)\n            except Exception:\n                # if something goes wrong here we evaluate the node at runtime\n                # for easier debugging\n                body.append(child)\n                continue\n\n            if body and isinstance(body[-1], list):\n                body[-1].append(const)\n            else:\n                body.append([const])\n\n        # if we have less than 3 nodes or a buffer we yield or extend/append\n        if len(body) < 3 or frame.buffer is not None:\n            if frame.buffer is not None:\n                # for one item we append, for more we extend\n                if len(body) == 1:\n                    self.writeline('%s.append(' % frame.buffer)\n                else:\n                    self.writeline('%s.extend((' % frame.buffer)\n\n                self.indent()\n\n            for item in body:\n                if isinstance(item, list):\n                    val = repr(native_concat(item))\n\n                    if frame.buffer is None:\n                        self.writeline('yield ' + val)\n                    else:\n                        self.writeline(val + ',')\n                else:\n                    if frame.buffer is None:\n                        self.writeline('yield ', item)\n                    else:\n                        self.newline(item)\n\n                    close = 0\n\n                    if finalize is not None:\n                        self.write('environment.finalize(')\n\n                        if finalize_context:\n                            self.write('context, ')\n\n                        close += 1\n\n                    self.visit(item, frame)\n\n                    if close > 0:\n                        self.write(')' * close)\n\n                    if frame.buffer is not None:\n                        self.write(',')\n\n            if frame.buffer is not None:\n                # close the open parentheses\n                self.outdent()\n                self.writeline(len(body) == 1 and ')' or '))')\n\n        # otherwise we create a format string as this is faster in that case\n        else:\n            format = []\n            arguments = []\n\n            for item in body:\n                if isinstance(item, list):\n                    format.append(native_concat(item).replace('%', '%%'))\n                else:\n                    format.append('%s')\n                    arguments.append(item)\n\n            self.writeline('yield ')\n            self.write(repr(concat(format)) + ' % (')\n            self.indent()\n\n            for argument in arguments:\n                self.newline(argument)\n                close = 0\n\n                if finalize is not None:\n                    self.write('environment.finalize(')\n\n                    if finalize_context:\n                        self.write('context, ')\n                    elif finalize_eval:\n                        self.write('context.eval_ctx, ')\n                    elif finalize_env:\n                        self.write('environment, ')\n\n                    close += 1\n\n                self.visit(argument, frame)\n                self.write(')' * close + ', ')\n\n            self.outdent()\n            self.writeline(')')\n\n        if outdent_later:\n            self.outdent()\n\n\nclass NativeTemplate(Template):\n    def render(self, *args, **kwargs):\n        \"\"\"Render the template to produce a native Python type. If the result\n        is a single node, its value is returned. Otherwise, the nodes are\n        concatenated as strings. If the result can be parsed with\n        :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the\n        string is returned.\n        \"\"\"\n        vars = dict(*args, **kwargs)\n\n        try:\n            return native_concat(self.root_render_func(self.new_context(vars)))\n        except Exception:\n            exc_info = sys.exc_info()\n\n        return self.environment.handle_exception(exc_info, True)\n\n\nclass NativeEnvironment(Environment):\n    \"\"\"An environment that renders templates to native Python types.\"\"\"\n\n    code_generator_class = NativeCodeGenerator\n    template_class = NativeTemplate\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/nodes.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.nodes\n    ~~~~~~~~~~~~\n\n    This module implements additional nodes derived from the ast base node.\n\n    It also provides some node tree helper functions like `in_lineno` and\n    `get_nodes` used by the parser and translator in order to normalize\n    python and jinja nodes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport types\nimport operator\n\nfrom collections import deque\nfrom jinja2.utils import Markup\nfrom jinja2._compat import izip, with_metaclass, text_type, PY2\n\n\n#: the types we support for context functions\n_context_function_types = (types.FunctionType, types.MethodType)\n\n\n_binop_to_func = {\n    '*':        operator.mul,\n    '/':        operator.truediv,\n    '//':       operator.floordiv,\n    '**':       operator.pow,\n    '%':        operator.mod,\n    '+':        operator.add,\n    '-':        operator.sub\n}\n\n_uaop_to_func = {\n    'not':      operator.not_,\n    '+':        operator.pos,\n    '-':        operator.neg\n}\n\n_cmpop_to_func = {\n    'eq':       operator.eq,\n    'ne':       operator.ne,\n    'gt':       operator.gt,\n    'gteq':     operator.ge,\n    'lt':       operator.lt,\n    'lteq':     operator.le,\n    'in':       lambda a, b: a in b,\n    'notin':    lambda a, b: a not in b\n}\n\n\nclass Impossible(Exception):\n    \"\"\"Raised if the node could not perform a requested action.\"\"\"\n\n\nclass NodeType(type):\n    \"\"\"A metaclass for nodes that handles the field and attribute\n    inheritance.  fields and attributes from the parent class are\n    automatically forwarded to the child.\"\"\"\n\n    def __new__(cls, name, bases, d):\n        for attr in 'fields', 'attributes':\n            storage = []\n            storage.extend(getattr(bases[0], attr, ()))\n            storage.extend(d.get(attr, ()))\n            assert len(bases) == 1, 'multiple inheritance not allowed'\n            assert len(storage) == len(set(storage)), 'layout conflict'\n            d[attr] = tuple(storage)\n        d.setdefault('abstract', False)\n        return type.__new__(cls, name, bases, d)\n\n\nclass EvalContext(object):\n    \"\"\"Holds evaluation time information.  Custom attributes can be attached\n    to it in extensions.\n    \"\"\"\n\n    def __init__(self, environment, template_name=None):\n        self.environment = environment\n        if callable(environment.autoescape):\n            self.autoescape = environment.autoescape(template_name)\n        else:\n            self.autoescape = environment.autoescape\n        self.volatile = False\n\n    def save(self):\n        return self.__dict__.copy()\n\n    def revert(self, old):\n        self.__dict__.clear()\n        self.__dict__.update(old)\n\n\ndef get_eval_context(node, ctx):\n    if ctx is None:\n        if node.environment is None:\n            raise RuntimeError('if no eval context is passed, the '\n                               'node must have an attached '\n                               'environment.')\n        return EvalContext(node.environment)\n    return ctx\n\n\nclass Node(with_metaclass(NodeType, object)):\n    \"\"\"Baseclass for all Jinja2 nodes.  There are a number of nodes available\n    of different types.  There are four major types:\n\n    -   :class:`Stmt`: statements\n    -   :class:`Expr`: expressions\n    -   :class:`Helper`: helper nodes\n    -   :class:`Template`: the outermost wrapper node\n\n    All nodes have fields and attributes.  Fields may be other nodes, lists,\n    or arbitrary values.  Fields are passed to the constructor as regular\n    positional arguments, attributes as keyword arguments.  Each node has\n    two attributes: `lineno` (the line number of the node) and `environment`.\n    The `environment` attribute is set at the end of the parsing process for\n    all nodes automatically.\n    \"\"\"\n    fields = ()\n    attributes = ('lineno', 'environment')\n    abstract = True\n\n    def __init__(self, *fields, **attributes):\n        if self.abstract:\n            raise TypeError('abstract nodes are not instanciable')\n        if fields:\n            if len(fields) != len(self.fields):\n                if not self.fields:\n                    raise TypeError('%r takes 0 arguments' %\n                                    self.__class__.__name__)\n                raise TypeError('%r takes 0 or %d argument%s' % (\n                    self.__class__.__name__,\n                    len(self.fields),\n                    len(self.fields) != 1 and 's' or ''\n                ))\n            for name, arg in izip(self.fields, fields):\n                setattr(self, name, arg)\n        for attr in self.attributes:\n            setattr(self, attr, attributes.pop(attr, None))\n        if attributes:\n            raise TypeError('unknown attribute %r' %\n                            next(iter(attributes)))\n\n    def iter_fields(self, exclude=None, only=None):\n        \"\"\"This method iterates over all fields that are defined and yields\n        ``(key, value)`` tuples.  Per default all fields are returned, but\n        it's possible to limit that to some fields by providing the `only`\n        parameter or to exclude some using the `exclude` parameter.  Both\n        should be sets or tuples of field names.\n        \"\"\"\n        for name in self.fields:\n            if (exclude is only is None) or \\\n               (exclude is not None and name not in exclude) or \\\n               (only is not None and name in only):\n                try:\n                    yield name, getattr(self, name)\n                except AttributeError:\n                    pass\n\n    def iter_child_nodes(self, exclude=None, only=None):\n        \"\"\"Iterates over all direct child nodes of the node.  This iterates\n        over all fields and yields the values of they are nodes.  If the value\n        of a field is a list all the nodes in that list are returned.\n        \"\"\"\n        for field, item in self.iter_fields(exclude, only):\n            if isinstance(item, list):\n                for n in item:\n                    if isinstance(n, Node):\n                        yield n\n            elif isinstance(item, Node):\n                yield item\n\n    def find(self, node_type):\n        \"\"\"Find the first node of a given type.  If no such node exists the\n        return value is `None`.\n        \"\"\"\n        for result in self.find_all(node_type):\n            return result\n\n    def find_all(self, node_type):\n        \"\"\"Find all the nodes of a given type.  If the type is a tuple,\n        the check is performed for any of the tuple items.\n        \"\"\"\n        for child in self.iter_child_nodes():\n            if isinstance(child, node_type):\n                yield child\n            for result in child.find_all(node_type):\n                yield result\n\n    def set_ctx(self, ctx):\n        \"\"\"Reset the context of a node and all child nodes.  Per default the\n        parser will all generate nodes that have a 'load' context as it's the\n        most common one.  This method is used in the parser to set assignment\n        targets and other nodes to a store context.\n        \"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            if 'ctx' in node.fields:\n                node.ctx = ctx\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def set_lineno(self, lineno, override=False):\n        \"\"\"Set the line numbers of the node and children.\"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            if 'lineno' in node.attributes:\n                if node.lineno is None or override:\n                    node.lineno = lineno\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def set_environment(self, environment):\n        \"\"\"Set the environment for all nodes.\"\"\"\n        todo = deque([self])\n        while todo:\n            node = todo.popleft()\n            node.environment = environment\n            todo.extend(node.iter_child_nodes())\n        return self\n\n    def __eq__(self, other):\n        return type(self) is type(other) and \\\n               tuple(self.iter_fields()) == tuple(other.iter_fields())\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    # Restore Python 2 hashing behavior on Python 3\n    __hash__ = object.__hash__\n\n    def __repr__(self):\n        return '%s(%s)' % (\n            self.__class__.__name__,\n            ', '.join('%s=%r' % (arg, getattr(self, arg, None)) for\n                      arg in self.fields)\n        )\n\n    def dump(self):\n        def _dump(node):\n            if not isinstance(node, Node):\n                buf.append(repr(node))\n                return\n\n            buf.append('nodes.%s(' % node.__class__.__name__)\n            if not node.fields:\n                buf.append(')')\n                return\n            for idx, field in enumerate(node.fields):\n                if idx:\n                    buf.append(', ')\n                value = getattr(node, field)\n                if isinstance(value, list):\n                    buf.append('[')\n                    for idx, item in enumerate(value):\n                        if idx:\n                            buf.append(', ')\n                        _dump(item)\n                    buf.append(']')\n                else:\n                    _dump(value)\n            buf.append(')')\n        buf = []\n        _dump(self)\n        return ''.join(buf)\n\n\n\nclass Stmt(Node):\n    \"\"\"Base node for all statements.\"\"\"\n    abstract = True\n\n\nclass Helper(Node):\n    \"\"\"Nodes that exist in a specific context only.\"\"\"\n    abstract = True\n\n\nclass Template(Node):\n    \"\"\"Node that represents a template.  This must be the outermost node that\n    is passed to the compiler.\n    \"\"\"\n    fields = ('body',)\n\n\nclass Output(Stmt):\n    \"\"\"A node that holds multiple expressions which are then printed out.\n    This is used both for the `print` statement and the regular template data.\n    \"\"\"\n    fields = ('nodes',)\n\n\nclass Extends(Stmt):\n    \"\"\"Represents an extends statement.\"\"\"\n    fields = ('template',)\n\n\nclass For(Stmt):\n    \"\"\"The for loop.  `target` is the target for the iteration (usually a\n    :class:`Name` or :class:`Tuple`), `iter` the iterable.  `body` is a list\n    of nodes that are used as loop-body, and `else_` a list of nodes for the\n    `else` block.  If no else node exists it has to be an empty list.\n\n    For filtered nodes an expression can be stored as `test`, otherwise `None`.\n    \"\"\"\n    fields = ('target', 'iter', 'body', 'else_', 'test', 'recursive')\n\n\nclass If(Stmt):\n    \"\"\"If `test` is true, `body` is rendered, else `else_`.\"\"\"\n    fields = ('test', 'body', 'elif_', 'else_')\n\n\nclass Macro(Stmt):\n    \"\"\"A macro definition.  `name` is the name of the macro, `args` a list of\n    arguments and `defaults` a list of defaults if there are any.  `body` is\n    a list of nodes for the macro body.\n    \"\"\"\n    fields = ('name', 'args', 'defaults', 'body')\n\n\nclass CallBlock(Stmt):\n    \"\"\"Like a macro without a name but a call instead.  `call` is called with\n    the unnamed macro as `caller` argument this node holds.\n    \"\"\"\n    fields = ('call', 'args', 'defaults', 'body')\n\n\nclass FilterBlock(Stmt):\n    \"\"\"Node for filter sections.\"\"\"\n    fields = ('body', 'filter')\n\n\nclass With(Stmt):\n    \"\"\"Specific node for with statements.  In older versions of Jinja the\n    with statement was implemented on the base of the `Scope` node instead.\n\n    .. versionadded:: 2.9.3\n    \"\"\"\n    fields = ('targets', 'values', 'body')\n\n\nclass Block(Stmt):\n    \"\"\"A node that represents a block.\"\"\"\n    fields = ('name', 'body', 'scoped')\n\n\nclass Include(Stmt):\n    \"\"\"A node that represents the include tag.\"\"\"\n    fields = ('template', 'with_context', 'ignore_missing')\n\n\nclass Import(Stmt):\n    \"\"\"A node that represents the import tag.\"\"\"\n    fields = ('template', 'target', 'with_context')\n\n\nclass FromImport(Stmt):\n    \"\"\"A node that represents the from import tag.  It's important to not\n    pass unsafe names to the name attribute.  The compiler translates the\n    attribute lookups directly into getattr calls and does *not* use the\n    subscript callback of the interface.  As exported variables may not\n    start with double underscores (which the parser asserts) this is not a\n    problem for regular Jinja code, but if this node is used in an extension\n    extra care must be taken.\n\n    The list of names may contain tuples if aliases are wanted.\n    \"\"\"\n    fields = ('template', 'names', 'with_context')\n\n\nclass ExprStmt(Stmt):\n    \"\"\"A statement that evaluates an expression and discards the result.\"\"\"\n    fields = ('node',)\n\n\nclass Assign(Stmt):\n    \"\"\"Assigns an expression to a target.\"\"\"\n    fields = ('target', 'node')\n\n\nclass AssignBlock(Stmt):\n    \"\"\"Assigns a block to a target.\"\"\"\n    fields = ('target', 'filter', 'body')\n\n\nclass Expr(Node):\n    \"\"\"Baseclass for all expressions.\"\"\"\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        \"\"\"Return the value of the expression as constant or raise\n        :exc:`Impossible` if this was not possible.\n\n        An :class:`EvalContext` can be provided, if none is given\n        a default context is created which requires the nodes to have\n        an attached environment.\n\n        .. versionchanged:: 2.4\n           the `eval_ctx` parameter was added.\n        \"\"\"\n        raise Impossible()\n\n    def can_assign(self):\n        \"\"\"Check if it's possible to assign something to this node.\"\"\"\n        return False\n\n\nclass BinExpr(Expr):\n    \"\"\"Baseclass for all binary expressions.\"\"\"\n    fields = ('left', 'right')\n    operator = None\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        # intercepted operators cannot be folded at compile time\n        if self.environment.sandboxed and \\\n           self.operator in self.environment.intercepted_binops:\n            raise Impossible()\n        f = _binop_to_func[self.operator]\n        try:\n            return f(self.left.as_const(eval_ctx), self.right.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n\nclass UnaryExpr(Expr):\n    \"\"\"Baseclass for all unary expressions.\"\"\"\n    fields = ('node',)\n    operator = None\n    abstract = True\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        # intercepted operators cannot be folded at compile time\n        if self.environment.sandboxed and \\\n           self.operator in self.environment.intercepted_unops:\n            raise Impossible()\n        f = _uaop_to_func[self.operator]\n        try:\n            return f(self.node.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n\nclass Name(Expr):\n    \"\"\"Looks up a name or stores a value in a name.\n    The `ctx` of the node can be one of the following values:\n\n    -   `store`: store a value in the name\n    -   `load`: load that name\n    -   `param`: like `store` but if the name was defined as function parameter.\n    \"\"\"\n    fields = ('name', 'ctx')\n\n    def can_assign(self):\n        return self.name not in ('true', 'false', 'none',\n                                 'True', 'False', 'None')\n\n\nclass NSRef(Expr):\n    \"\"\"Reference to a namespace value assignment\"\"\"\n    fields = ('name', 'attr')\n\n    def can_assign(self):\n        # We don't need any special checks here; NSRef assignments have a\n        # runtime check to ensure the target is a namespace object which will\n        # have been checked already as it is created using a normal assignment\n        # which goes through a `Name` node.\n        return True\n\n\nclass Literal(Expr):\n    \"\"\"Baseclass for literals.\"\"\"\n    abstract = True\n\n\nclass Const(Literal):\n    \"\"\"All constant values.  The parser will return this node for simple\n    constants such as ``42`` or ``\"foo\"`` but it can be used to store more\n    complex values such as lists too.  Only constants with a safe\n    representation (objects where ``eval(repr(x)) == x`` is true).\n    \"\"\"\n    fields = ('value',)\n\n    def as_const(self, eval_ctx=None):\n        rv = self.value\n        if PY2 and type(rv) is text_type and \\\n           self.environment.policies['compiler.ascii_str']:\n            try:\n                rv = rv.encode('ascii')\n            except UnicodeError:\n                pass\n        return rv\n\n    @classmethod\n    def from_untrusted(cls, value, lineno=None, environment=None):\n        \"\"\"Return a const object if the value is representable as\n        constant value in the generated code, otherwise it will raise\n        an `Impossible` exception.\n        \"\"\"\n        from .compiler import has_safe_repr\n        if not has_safe_repr(value):\n            raise Impossible()\n        return cls(value, lineno=lineno, environment=environment)\n\n\nclass TemplateData(Literal):\n    \"\"\"A constant template string.\"\"\"\n    fields = ('data',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if eval_ctx.volatile:\n            raise Impossible()\n        if eval_ctx.autoescape:\n            return Markup(self.data)\n        return self.data\n\n\nclass Tuple(Literal):\n    \"\"\"For loop unpacking and some other things like multiple arguments\n    for subscripts.  Like for :class:`Name` `ctx` specifies if the tuple\n    is used for loading the names or storing.\n    \"\"\"\n    fields = ('items', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return tuple(x.as_const(eval_ctx) for x in self.items)\n\n    def can_assign(self):\n        for item in self.items:\n            if not item.can_assign():\n                return False\n        return True\n\n\nclass List(Literal):\n    \"\"\"Any list literal such as ``[1, 2, 3]``\"\"\"\n    fields = ('items',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return [x.as_const(eval_ctx) for x in self.items]\n\n\nclass Dict(Literal):\n    \"\"\"Any dict literal such as ``{1: 2, 3: 4}``.  The items must be a list of\n    :class:`Pair` nodes.\n    \"\"\"\n    fields = ('items',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return dict(x.as_const(eval_ctx) for x in self.items)\n\n\nclass Pair(Helper):\n    \"\"\"A key, value pair for dicts.\"\"\"\n    fields = ('key', 'value')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.key.as_const(eval_ctx), self.value.as_const(eval_ctx)\n\n\nclass Keyword(Helper):\n    \"\"\"A key, value pair for keyword arguments where key is a string.\"\"\"\n    fields = ('key', 'value')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.key, self.value.as_const(eval_ctx)\n\n\nclass CondExpr(Expr):\n    \"\"\"A conditional expression (inline if expression).  (``{{\n    foo if bar else baz }}``)\n    \"\"\"\n    fields = ('test', 'expr1', 'expr2')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if self.test.as_const(eval_ctx):\n            return self.expr1.as_const(eval_ctx)\n\n        # if we evaluate to an undefined object, we better do that at runtime\n        if self.expr2 is None:\n            raise Impossible()\n\n        return self.expr2.as_const(eval_ctx)\n\n\ndef args_as_const(node, eval_ctx):\n    args = [x.as_const(eval_ctx) for x in node.args]\n    kwargs = dict(x.as_const(eval_ctx) for x in node.kwargs)\n\n    if node.dyn_args is not None:\n        try:\n            args.extend(node.dyn_args.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    if node.dyn_kwargs is not None:\n        try:\n            kwargs.update(node.dyn_kwargs.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    return args, kwargs\n\n\nclass Filter(Expr):\n    \"\"\"This node applies a filter on an expression.  `name` is the name of\n    the filter, the rest of the fields are the same as for :class:`Call`.\n\n    If the `node` of a filter is `None` the contents of the last buffer are\n    filtered.  Buffers are created by macros and filter blocks.\n    \"\"\"\n\n    fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n\n        if eval_ctx.volatile or self.node is None:\n            raise Impossible()\n\n        # we have to be careful here because we call filter_ below.\n        # if this variable would be called filter, 2to3 would wrap the\n        # call in a list beause it is assuming we are talking about the\n        # builtin filter function here which no longer returns a list in\n        # python 3.  because of that, do not rename filter_ to filter!\n        filter_ = self.environment.filters.get(self.name)\n\n        if filter_ is None or getattr(filter_, 'contextfilter', False):\n            raise Impossible()\n\n        # We cannot constant handle async filters, so we need to make sure\n        # to not go down this path.\n        if (\n            eval_ctx.environment.is_async\n            and getattr(filter_, 'asyncfiltervariant', False)\n        ):\n            raise Impossible()\n\n        args, kwargs = args_as_const(self, eval_ctx)\n        args.insert(0, self.node.as_const(eval_ctx))\n\n        if getattr(filter_, 'evalcontextfilter', False):\n            args.insert(0, eval_ctx)\n        elif getattr(filter_, 'environmentfilter', False):\n            args.insert(0, self.environment)\n\n        try:\n            return filter_(*args, **kwargs)\n        except Exception:\n            raise Impossible()\n\n\nclass Test(Expr):\n    \"\"\"Applies a test on an expression.  `name` is the name of the test, the\n    rest of the fields are the same as for :class:`Call`.\n    \"\"\"\n\n    fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n    def as_const(self, eval_ctx=None):\n        test = self.environment.tests.get(self.name)\n\n        if test is None:\n            raise Impossible()\n\n        eval_ctx = get_eval_context(self, eval_ctx)\n        args, kwargs = args_as_const(self, eval_ctx)\n        args.insert(0, self.node.as_const(eval_ctx))\n\n        try:\n            return test(*args, **kwargs)\n        except Exception:\n            raise Impossible()\n\n\nclass Call(Expr):\n    \"\"\"Calls an expression.  `args` is a list of arguments, `kwargs` a list\n    of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args`\n    and `dyn_kwargs` has to be either `None` or a node that is used as\n    node for dynamic positional (``*args``) or keyword (``**kwargs``)\n    arguments.\n    \"\"\"\n    fields = ('node', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')\n\n\nclass Getitem(Expr):\n    \"\"\"Get an attribute or item from an expression and prefer the item.\"\"\"\n    fields = ('node', 'arg', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if self.ctx != 'load':\n            raise Impossible()\n        try:\n            return self.environment.getitem(self.node.as_const(eval_ctx),\n                                            self.arg.as_const(eval_ctx))\n        except Exception:\n            raise Impossible()\n\n    def can_assign(self):\n        return False\n\n\nclass Getattr(Expr):\n    \"\"\"Get an attribute or item from an expression that is a ascii-only\n    bytestring and prefer the attribute.\n    \"\"\"\n    fields = ('node', 'attr', 'ctx')\n\n    def as_const(self, eval_ctx=None):\n        if self.ctx != 'load':\n            raise Impossible()\n        try:\n            eval_ctx = get_eval_context(self, eval_ctx)\n            return self.environment.getattr(self.node.as_const(eval_ctx),\n                                            self.attr)\n        except Exception:\n            raise Impossible()\n\n    def can_assign(self):\n        return False\n\n\nclass Slice(Expr):\n    \"\"\"Represents a slice object.  This must only be used as argument for\n    :class:`Subscript`.\n    \"\"\"\n    fields = ('start', 'stop', 'step')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        def const(obj):\n            if obj is None:\n                return None\n            return obj.as_const(eval_ctx)\n        return slice(const(self.start), const(self.stop), const(self.step))\n\n\nclass Concat(Expr):\n    \"\"\"Concatenates the list of expressions provided after converting them to\n    unicode.\n    \"\"\"\n    fields = ('nodes',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return ''.join(text_type(x.as_const(eval_ctx)) for x in self.nodes)\n\n\nclass Compare(Expr):\n    \"\"\"Compares an expression with some other expressions.  `ops` must be a\n    list of :class:`Operand`\\\\s.\n    \"\"\"\n    fields = ('expr', 'ops')\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        result = value = self.expr.as_const(eval_ctx)\n        try:\n            for op in self.ops:\n                new_value = op.expr.as_const(eval_ctx)\n                result = _cmpop_to_func[op.op](value, new_value)\n                value = new_value\n        except Exception:\n            raise Impossible()\n        return result\n\n\nclass Operand(Helper):\n    \"\"\"Holds an operator and an expression.\"\"\"\n    fields = ('op', 'expr')\n\nif __debug__:\n    Operand.__doc__ += '\\nThe following operators are available: ' + \\\n        ', '.join(sorted('``%s``' % x for x in set(_binop_to_func) |\n                  set(_uaop_to_func) | set(_cmpop_to_func)))\n\n\nclass Mul(BinExpr):\n    \"\"\"Multiplies the left with the right node.\"\"\"\n    operator = '*'\n\n\nclass Div(BinExpr):\n    \"\"\"Divides the left by the right node.\"\"\"\n    operator = '/'\n\n\nclass FloorDiv(BinExpr):\n    \"\"\"Divides the left by the right node and truncates conver the\n    result into an integer by truncating.\n    \"\"\"\n    operator = '//'\n\n\nclass Add(BinExpr):\n    \"\"\"Add the left to the right node.\"\"\"\n    operator = '+'\n\n\nclass Sub(BinExpr):\n    \"\"\"Subtract the right from the left node.\"\"\"\n    operator = '-'\n\n\nclass Mod(BinExpr):\n    \"\"\"Left modulo right.\"\"\"\n    operator = '%'\n\n\nclass Pow(BinExpr):\n    \"\"\"Left to the power of right.\"\"\"\n    operator = '**'\n\n\nclass And(BinExpr):\n    \"\"\"Short circuited AND.\"\"\"\n    operator = 'and'\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)\n\n\nclass Or(BinExpr):\n    \"\"\"Short circuited OR.\"\"\"\n    operator = 'or'\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)\n\n\nclass Not(UnaryExpr):\n    \"\"\"Negate the expression.\"\"\"\n    operator = 'not'\n\n\nclass Neg(UnaryExpr):\n    \"\"\"Make the expression negative.\"\"\"\n    operator = '-'\n\n\nclass Pos(UnaryExpr):\n    \"\"\"Make the expression positive (noop for most expressions)\"\"\"\n    operator = '+'\n\n\n# Helpers for extensions\n\n\nclass EnvironmentAttribute(Expr):\n    \"\"\"Loads an attribute from the environment object.  This is useful for\n    extensions that want to call a callback stored on the environment.\n    \"\"\"\n    fields = ('name',)\n\n\nclass ExtensionAttribute(Expr):\n    \"\"\"Returns the attribute of an extension bound to the environment.\n    The identifier is the identifier of the :class:`Extension`.\n\n    This node is usually constructed by calling the\n    :meth:`~jinja2.ext.Extension.attr` method on an extension.\n    \"\"\"\n    fields = ('identifier', 'name')\n\n\nclass ImportedName(Expr):\n    \"\"\"If created with an import name the import name is returned on node\n    access.  For example ``ImportedName('cgi.escape')`` returns the `escape`\n    function from the cgi module on evaluation.  Imports are optimized by the\n    compiler so there is no need to assign them to local variables.\n    \"\"\"\n    fields = ('importname',)\n\n\nclass InternalName(Expr):\n    \"\"\"An internal name in the compiler.  You cannot create these nodes\n    yourself but the parser provides a\n    :meth:`~jinja2.parser.Parser.free_identifier` method that creates\n    a new identifier for you.  This identifier is not available from the\n    template and is not threated specially by the compiler.\n    \"\"\"\n    fields = ('name',)\n\n    def __init__(self):\n        raise TypeError('Can\\'t create internal names.  Use the '\n                        '`free_identifier` method on a parser.')\n\n\nclass MarkSafe(Expr):\n    \"\"\"Mark the wrapped expression as safe (wrap it as `Markup`).\"\"\"\n    fields = ('expr',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        return Markup(self.expr.as_const(eval_ctx))\n\n\nclass MarkSafeIfAutoescape(Expr):\n    \"\"\"Mark the wrapped expression as safe (wrap it as `Markup`) but\n    only if autoescaping is active.\n\n    .. versionadded:: 2.5\n    \"\"\"\n    fields = ('expr',)\n\n    def as_const(self, eval_ctx=None):\n        eval_ctx = get_eval_context(self, eval_ctx)\n        if eval_ctx.volatile:\n            raise Impossible()\n        expr = self.expr.as_const(eval_ctx)\n        if eval_ctx.autoescape:\n            return Markup(expr)\n        return expr\n\n\nclass ContextReference(Expr):\n    \"\"\"Returns the current template context.  It can be used like a\n    :class:`Name` node, with a ``'load'`` ctx and will return the\n    current :class:`~jinja2.runtime.Context` object.\n\n    Here an example that assigns the current template name to a\n    variable named `foo`::\n\n        Assign(Name('foo', ctx='store'),\n               Getattr(ContextReference(), 'name'))\n    \"\"\"\n\n\nclass Continue(Stmt):\n    \"\"\"Continue a loop.\"\"\"\n\n\nclass Break(Stmt):\n    \"\"\"Break a loop.\"\"\"\n\n\nclass Scope(Stmt):\n    \"\"\"An artificial scope.\"\"\"\n    fields = ('body',)\n\n\nclass OverlayScope(Stmt):\n    \"\"\"An overlay scope for extensions.  This is a largely unoptimized scope\n    that however can be used to introduce completely arbitrary variables into\n    a sub scope from a dictionary or dictionary like object.  The `context`\n    field has to evaluate to a dictionary object.\n\n    Example usage::\n\n        OverlayScope(context=self.call_method('get_context'),\n                     body=[...])\n\n    .. versionadded:: 2.10\n    \"\"\"\n    fields = ('context', 'body')\n\n\nclass EvalContextModifier(Stmt):\n    \"\"\"Modifies the eval context.  For each option that should be modified,\n    a :class:`Keyword` has to be added to the :attr:`options` list.\n\n    Example to change the `autoescape` setting::\n\n        EvalContextModifier(options=[Keyword('autoescape', Const(True))])\n    \"\"\"\n    fields = ('options',)\n\n\nclass ScopedEvalContextModifier(EvalContextModifier):\n    \"\"\"Modifies the eval context and reverts it later.  Works exactly like\n    :class:`EvalContextModifier` but will only modify the\n    :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.\n    \"\"\"\n    fields = ('body',)\n\n\n# make sure nobody creates custom nodes\ndef _failing_new(*args, **kwargs):\n    raise TypeError('can\\'t create custom node types')\nNodeType.__new__ = staticmethod(_failing_new); del _failing_new\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/optimizer.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.optimizer\n    ~~~~~~~~~~~~~~~~\n\n    The jinja optimizer is currently trying to constant fold a few expressions\n    and modify the AST in place so that it should be easier to evaluate it.\n\n    Because the AST does not contain all the scoping information and the\n    compiler has to find that out, we cannot do all the optimizations we\n    want.  For example loop unrolling doesn't work because unrolled loops would\n    have a different scoping.\n\n    The solution would be a second syntax tree that has the scoping rules stored.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.visitor import NodeTransformer\n\n\ndef optimize(node, environment):\n    \"\"\"The context hint can be used to perform an static optimization\n    based on the context given.\"\"\"\n    optimizer = Optimizer(environment)\n    return optimizer.visit(node)\n\n\nclass Optimizer(NodeTransformer):\n\n    def __init__(self, environment):\n        self.environment = environment\n\n    def fold(self, node, eval_ctx=None):\n        \"\"\"Do constant folding.\"\"\"\n        node = self.generic_visit(node)\n        try:\n            return nodes.Const.from_untrusted(node.as_const(eval_ctx),\n                                              lineno=node.lineno,\n                                              environment=self.environment)\n        except nodes.Impossible:\n            return node\n\n    visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \\\n    visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \\\n    visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \\\n    visit_Filter = visit_Test = visit_CondExpr = fold\n    del fold\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/parser.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.parser\n    ~~~~~~~~~~~~~\n\n    Implements the template parser.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nfrom jinja2 import nodes\nfrom jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError\nfrom jinja2.lexer import describe_token, describe_token_expr\nfrom jinja2._compat import imap\n\n\n_statement_keywords = frozenset(['for', 'if', 'block', 'extends', 'print',\n                                 'macro', 'include', 'from', 'import',\n                                 'set', 'with', 'autoescape'])\n_compare_operators = frozenset(['eq', 'ne', 'lt', 'lteq', 'gt', 'gteq'])\n\n_math_nodes = {\n    'add': nodes.Add,\n    'sub': nodes.Sub,\n    'mul': nodes.Mul,\n    'div': nodes.Div,\n    'floordiv': nodes.FloorDiv,\n    'mod': nodes.Mod,\n}\n\n\nclass Parser(object):\n    \"\"\"This is the central parsing class Jinja2 uses.  It's passed to\n    extensions and can be used to parse expressions or statements.\n    \"\"\"\n\n    def __init__(self, environment, source, name=None, filename=None,\n                 state=None):\n        self.environment = environment\n        self.stream = environment._tokenize(source, name, filename, state)\n        self.name = name\n        self.filename = filename\n        self.closed = False\n        self.extensions = {}\n        for extension in environment.iter_extensions():\n            for tag in extension.tags:\n                self.extensions[tag] = extension.parse\n        self._last_identifier = 0\n        self._tag_stack = []\n        self._end_token_stack = []\n\n    def fail(self, msg, lineno=None, exc=TemplateSyntaxError):\n        \"\"\"Convenience method that raises `exc` with the message, passed\n        line number or last line number as well as the current name and\n        filename.\n        \"\"\"\n        if lineno is None:\n            lineno = self.stream.current.lineno\n        raise exc(msg, lineno, self.name, self.filename)\n\n    def _fail_ut_eof(self, name, end_token_stack, lineno):\n        expected = []\n        for exprs in end_token_stack:\n            expected.extend(imap(describe_token_expr, exprs))\n        if end_token_stack:\n            currently_looking = ' or '.join(\n                \"'%s'\" % describe_token_expr(expr)\n                for expr in end_token_stack[-1])\n        else:\n            currently_looking = None\n\n        if name is None:\n            message = ['Unexpected end of template.']\n        else:\n            message = ['Encountered unknown tag \\'%s\\'.' % name]\n\n        if currently_looking:\n            if name is not None and name in expected:\n                message.append('You probably made a nesting mistake. Jinja '\n                               'is expecting this tag, but currently looking '\n                               'for %s.' % currently_looking)\n            else:\n                message.append('Jinja was looking for the following tags: '\n                               '%s.' % currently_looking)\n\n        if self._tag_stack:\n            message.append('The innermost block that needs to be '\n                           'closed is \\'%s\\'.' % self._tag_stack[-1])\n\n        self.fail(' '.join(message), lineno)\n\n    def fail_unknown_tag(self, name, lineno=None):\n        \"\"\"Called if the parser encounters an unknown tag.  Tries to fail\n        with a human readable error message that could help to identify\n        the problem.\n        \"\"\"\n        return self._fail_ut_eof(name, self._end_token_stack, lineno)\n\n    def fail_eof(self, end_tokens=None, lineno=None):\n        \"\"\"Like fail_unknown_tag but for end of template situations.\"\"\"\n        stack = list(self._end_token_stack)\n        if end_tokens is not None:\n            stack.append(end_tokens)\n        return self._fail_ut_eof(None, stack, lineno)\n\n    def is_tuple_end(self, extra_end_rules=None):\n        \"\"\"Are we at the end of a tuple?\"\"\"\n        if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):\n            return True\n        elif extra_end_rules is not None:\n            return self.stream.current.test_any(extra_end_rules)\n        return False\n\n    def free_identifier(self, lineno=None):\n        \"\"\"Return a new free identifier as :class:`~jinja2.nodes.InternalName`.\"\"\"\n        self._last_identifier += 1\n        rv = object.__new__(nodes.InternalName)\n        nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)\n        return rv\n\n    def parse_statement(self):\n        \"\"\"Parse a single statement.\"\"\"\n        token = self.stream.current\n        if token.type != 'name':\n            self.fail('tag name expected', token.lineno)\n        self._tag_stack.append(token.value)\n        pop_tag = True\n        try:\n            if token.value in _statement_keywords:\n                return getattr(self, 'parse_' + self.stream.current.value)()\n            if token.value == 'call':\n                return self.parse_call_block()\n            if token.value == 'filter':\n                return self.parse_filter_block()\n            ext = self.extensions.get(token.value)\n            if ext is not None:\n                return ext(self)\n\n            # did not work out, remove the token we pushed by accident\n            # from the stack so that the unknown tag fail function can\n            # produce a proper error message.\n            self._tag_stack.pop()\n            pop_tag = False\n            self.fail_unknown_tag(token.value, token.lineno)\n        finally:\n            if pop_tag:\n                self._tag_stack.pop()\n\n    def parse_statements(self, end_tokens, drop_needle=False):\n        \"\"\"Parse multiple statements into a list until one of the end tokens\n        is reached.  This is used to parse the body of statements as it also\n        parses template data if appropriate.  The parser checks first if the\n        current token is a colon and skips it if there is one.  Then it checks\n        for the block end and parses until if one of the `end_tokens` is\n        reached.  Per default the active token in the stream at the end of\n        the call is the matched end token.  If this is not wanted `drop_needle`\n        can be set to `True` and the end token is removed.\n        \"\"\"\n        # the first token may be a colon for python compatibility\n        self.stream.skip_if('colon')\n\n        # in the future it would be possible to add whole code sections\n        # by adding some sort of end of statement token and parsing those here.\n        self.stream.expect('block_end')\n        result = self.subparse(end_tokens)\n\n        # we reached the end of the template too early, the subparser\n        # does not check for this, so we do that now\n        if self.stream.current.type == 'eof':\n            self.fail_eof(end_tokens)\n\n        if drop_needle:\n            next(self.stream)\n        return result\n\n    def parse_set(self):\n        \"\"\"Parse an assign statement.\"\"\"\n        lineno = next(self.stream).lineno\n        target = self.parse_assign_target(with_namespace=True)\n        if self.stream.skip_if('assign'):\n            expr = self.parse_tuple()\n            return nodes.Assign(target, expr, lineno=lineno)\n        filter_node = self.parse_filter(None)\n        body = self.parse_statements(('name:endset',),\n                                     drop_needle=True)\n        return nodes.AssignBlock(target, filter_node, body, lineno=lineno)\n\n    def parse_for(self):\n        \"\"\"Parse a for loop.\"\"\"\n        lineno = self.stream.expect('name:for').lineno\n        target = self.parse_assign_target(extra_end_rules=('name:in',))\n        self.stream.expect('name:in')\n        iter = self.parse_tuple(with_condexpr=False,\n                                extra_end_rules=('name:recursive',))\n        test = None\n        if self.stream.skip_if('name:if'):\n            test = self.parse_expression()\n        recursive = self.stream.skip_if('name:recursive')\n        body = self.parse_statements(('name:endfor', 'name:else'))\n        if next(self.stream).value == 'endfor':\n            else_ = []\n        else:\n            else_ = self.parse_statements(('name:endfor',), drop_needle=True)\n        return nodes.For(target, iter, body, else_, test,\n                         recursive, lineno=lineno)\n\n    def parse_if(self):\n        \"\"\"Parse an if construct.\"\"\"\n        node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)\n        while 1:\n            node.test = self.parse_tuple(with_condexpr=False)\n            node.body = self.parse_statements(('name:elif', 'name:else',\n                                               'name:endif'))\n            node.elif_ = []\n            node.else_ = []\n            token = next(self.stream)\n            if token.test('name:elif'):\n                node = nodes.If(lineno=self.stream.current.lineno)\n                result.elif_.append(node)\n                continue\n            elif token.test('name:else'):\n                result.else_ = self.parse_statements(('name:endif',),\n                                                     drop_needle=True)\n            break\n        return result\n\n    def parse_with(self):\n        node = nodes.With(lineno=next(self.stream).lineno)\n        targets = []\n        values = []\n        while self.stream.current.type != 'block_end':\n            lineno = self.stream.current.lineno\n            if targets:\n                self.stream.expect('comma')\n            target = self.parse_assign_target()\n            target.set_ctx('param')\n            targets.append(target)\n            self.stream.expect('assign')\n            values.append(self.parse_expression())\n        node.targets = targets\n        node.values = values\n        node.body = self.parse_statements(('name:endwith',),\n                                          drop_needle=True)\n        return node\n\n    def parse_autoescape(self):\n        node = nodes.ScopedEvalContextModifier(lineno=next(self.stream).lineno)\n        node.options = [\n            nodes.Keyword('autoescape', self.parse_expression())\n        ]\n        node.body = self.parse_statements(('name:endautoescape',),\n                                            drop_needle=True)\n        return nodes.Scope([node])\n\n    def parse_block(self):\n        node = nodes.Block(lineno=next(self.stream).lineno)\n        node.name = self.stream.expect('name').value\n        node.scoped = self.stream.skip_if('name:scoped')\n\n        # common problem people encounter when switching from django\n        # to jinja.  we do not support hyphens in block names, so let's\n        # raise a nicer error message in that case.\n        if self.stream.current.type == 'sub':\n            self.fail('Block names in Jinja have to be valid Python '\n                      'identifiers and may not contain hyphens, use an '\n                      'underscore instead.')\n\n        node.body = self.parse_statements(('name:endblock',), drop_needle=True)\n        self.stream.skip_if('name:' + node.name)\n        return node\n\n    def parse_extends(self):\n        node = nodes.Extends(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        return node\n\n    def parse_import_context(self, node, default):\n        if self.stream.current.test_any('name:with', 'name:without') and \\\n           self.stream.look().test('name:context'):\n            node.with_context = next(self.stream).value == 'with'\n            self.stream.skip()\n        else:\n            node.with_context = default\n        return node\n\n    def parse_include(self):\n        node = nodes.Include(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        if self.stream.current.test('name:ignore') and \\\n           self.stream.look().test('name:missing'):\n            node.ignore_missing = True\n            self.stream.skip(2)\n        else:\n            node.ignore_missing = False\n        return self.parse_import_context(node, True)\n\n    def parse_import(self):\n        node = nodes.Import(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        self.stream.expect('name:as')\n        node.target = self.parse_assign_target(name_only=True).name\n        return self.parse_import_context(node, False)\n\n    def parse_from(self):\n        node = nodes.FromImport(lineno=next(self.stream).lineno)\n        node.template = self.parse_expression()\n        self.stream.expect('name:import')\n        node.names = []\n\n        def parse_context():\n            if self.stream.current.value in ('with', 'without') and \\\n               self.stream.look().test('name:context'):\n                node.with_context = next(self.stream).value == 'with'\n                self.stream.skip()\n                return True\n            return False\n\n        while 1:\n            if node.names:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'name':\n                if parse_context():\n                    break\n                target = self.parse_assign_target(name_only=True)\n                if target.name.startswith('_'):\n                    self.fail('names starting with an underline can not '\n                              'be imported', target.lineno,\n                              exc=TemplateAssertionError)\n                if self.stream.skip_if('name:as'):\n                    alias = self.parse_assign_target(name_only=True)\n                    node.names.append((target.name, alias.name))\n                else:\n                    node.names.append(target.name)\n                if parse_context() or self.stream.current.type != 'comma':\n                    break\n            else:\n                self.stream.expect('name')\n        if not hasattr(node, 'with_context'):\n            node.with_context = False\n        return node\n\n    def parse_signature(self, node):\n        node.args = args = []\n        node.defaults = defaults = []\n        self.stream.expect('lparen')\n        while self.stream.current.type != 'rparen':\n            if args:\n                self.stream.expect('comma')\n            arg = self.parse_assign_target(name_only=True)\n            arg.set_ctx('param')\n            if self.stream.skip_if('assign'):\n                defaults.append(self.parse_expression())\n            elif defaults:\n                self.fail('non-default argument follows default argument')\n            args.append(arg)\n        self.stream.expect('rparen')\n\n    def parse_call_block(self):\n        node = nodes.CallBlock(lineno=next(self.stream).lineno)\n        if self.stream.current.type == 'lparen':\n            self.parse_signature(node)\n        else:\n            node.args = []\n            node.defaults = []\n\n        node.call = self.parse_expression()\n        if not isinstance(node.call, nodes.Call):\n            self.fail('expected call', node.lineno)\n        node.body = self.parse_statements(('name:endcall',), drop_needle=True)\n        return node\n\n    def parse_filter_block(self):\n        node = nodes.FilterBlock(lineno=next(self.stream).lineno)\n        node.filter = self.parse_filter(None, start_inline=True)\n        node.body = self.parse_statements(('name:endfilter',),\n                                          drop_needle=True)\n        return node\n\n    def parse_macro(self):\n        node = nodes.Macro(lineno=next(self.stream).lineno)\n        node.name = self.parse_assign_target(name_only=True).name\n        self.parse_signature(node)\n        node.body = self.parse_statements(('name:endmacro',),\n                                          drop_needle=True)\n        return node\n\n    def parse_print(self):\n        node = nodes.Output(lineno=next(self.stream).lineno)\n        node.nodes = []\n        while self.stream.current.type != 'block_end':\n            if node.nodes:\n                self.stream.expect('comma')\n            node.nodes.append(self.parse_expression())\n        return node\n\n    def parse_assign_target(self, with_tuple=True, name_only=False,\n                            extra_end_rules=None, with_namespace=False):\n        \"\"\"Parse an assignment target.  As Jinja2 allows assignments to\n        tuples, this function can parse all allowed assignment targets.  Per\n        default assignments to tuples are parsed, that can be disable however\n        by setting `with_tuple` to `False`.  If only assignments to names are\n        wanted `name_only` can be set to `True`.  The `extra_end_rules`\n        parameter is forwarded to the tuple parsing function.  If\n        `with_namespace` is enabled, a namespace assignment may be parsed.\n        \"\"\"\n        if with_namespace and self.stream.look().type == 'dot':\n            token = self.stream.expect('name')\n            next(self.stream)  # dot\n            attr = self.stream.expect('name')\n            target = nodes.NSRef(token.value, attr.value, lineno=token.lineno)\n        elif name_only:\n            token = self.stream.expect('name')\n            target = nodes.Name(token.value, 'store', lineno=token.lineno)\n        else:\n            if with_tuple:\n                target = self.parse_tuple(simplified=True,\n                                          extra_end_rules=extra_end_rules)\n            else:\n                target = self.parse_primary()\n            target.set_ctx('store')\n        if not target.can_assign():\n            self.fail('can\\'t assign to %r' % target.__class__.\n                      __name__.lower(), target.lineno)\n        return target\n\n    def parse_expression(self, with_condexpr=True):\n        \"\"\"Parse an expression.  Per default all expressions are parsed, if\n        the optional `with_condexpr` parameter is set to `False` conditional\n        expressions are not parsed.\n        \"\"\"\n        if with_condexpr:\n            return self.parse_condexpr()\n        return self.parse_or()\n\n    def parse_condexpr(self):\n        lineno = self.stream.current.lineno\n        expr1 = self.parse_or()\n        while self.stream.skip_if('name:if'):\n            expr2 = self.parse_or()\n            if self.stream.skip_if('name:else'):\n                expr3 = self.parse_condexpr()\n            else:\n                expr3 = None\n            expr1 = nodes.CondExpr(expr2, expr1, expr3, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return expr1\n\n    def parse_or(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_and()\n        while self.stream.skip_if('name:or'):\n            right = self.parse_and()\n            left = nodes.Or(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_and(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_not()\n        while self.stream.skip_if('name:and'):\n            right = self.parse_not()\n            left = nodes.And(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_not(self):\n        if self.stream.current.test('name:not'):\n            lineno = next(self.stream).lineno\n            return nodes.Not(self.parse_not(), lineno=lineno)\n        return self.parse_compare()\n\n    def parse_compare(self):\n        lineno = self.stream.current.lineno\n        expr = self.parse_math1()\n        ops = []\n        while 1:\n            token_type = self.stream.current.type\n            if token_type in _compare_operators:\n                next(self.stream)\n                ops.append(nodes.Operand(token_type, self.parse_math1()))\n            elif self.stream.skip_if('name:in'):\n                ops.append(nodes.Operand('in', self.parse_math1()))\n            elif (self.stream.current.test('name:not') and\n                  self.stream.look().test('name:in')):\n                self.stream.skip(2)\n                ops.append(nodes.Operand('notin', self.parse_math1()))\n            else:\n                break\n            lineno = self.stream.current.lineno\n        if not ops:\n            return expr\n        return nodes.Compare(expr, ops, lineno=lineno)\n\n    def parse_math1(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_concat()\n        while self.stream.current.type in ('add', 'sub'):\n            cls = _math_nodes[self.stream.current.type]\n            next(self.stream)\n            right = self.parse_concat()\n            left = cls(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_concat(self):\n        lineno = self.stream.current.lineno\n        args = [self.parse_math2()]\n        while self.stream.current.type == 'tilde':\n            next(self.stream)\n            args.append(self.parse_math2())\n        if len(args) == 1:\n            return args[0]\n        return nodes.Concat(args, lineno=lineno)\n\n    def parse_math2(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_pow()\n        while self.stream.current.type in ('mul', 'div', 'floordiv', 'mod'):\n            cls = _math_nodes[self.stream.current.type]\n            next(self.stream)\n            right = self.parse_pow()\n            left = cls(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_pow(self):\n        lineno = self.stream.current.lineno\n        left = self.parse_unary()\n        while self.stream.current.type == 'pow':\n            next(self.stream)\n            right = self.parse_unary()\n            left = nodes.Pow(left, right, lineno=lineno)\n            lineno = self.stream.current.lineno\n        return left\n\n    def parse_unary(self, with_filter=True):\n        token_type = self.stream.current.type\n        lineno = self.stream.current.lineno\n        if token_type == 'sub':\n            next(self.stream)\n            node = nodes.Neg(self.parse_unary(False), lineno=lineno)\n        elif token_type == 'add':\n            next(self.stream)\n            node = nodes.Pos(self.parse_unary(False), lineno=lineno)\n        else:\n            node = self.parse_primary()\n        node = self.parse_postfix(node)\n        if with_filter:\n            node = self.parse_filter_expr(node)\n        return node\n\n    def parse_primary(self):\n        token = self.stream.current\n        if token.type == 'name':\n            if token.value in ('true', 'false', 'True', 'False'):\n                node = nodes.Const(token.value in ('true', 'True'),\n                                   lineno=token.lineno)\n            elif token.value in ('none', 'None'):\n                node = nodes.Const(None, lineno=token.lineno)\n            else:\n                node = nodes.Name(token.value, 'load', lineno=token.lineno)\n            next(self.stream)\n        elif token.type == 'string':\n            next(self.stream)\n            buf = [token.value]\n            lineno = token.lineno\n            while self.stream.current.type == 'string':\n                buf.append(self.stream.current.value)\n                next(self.stream)\n            node = nodes.Const(''.join(buf), lineno=lineno)\n        elif token.type in ('integer', 'float'):\n            next(self.stream)\n            node = nodes.Const(token.value, lineno=token.lineno)\n        elif token.type == 'lparen':\n            next(self.stream)\n            node = self.parse_tuple(explicit_parentheses=True)\n            self.stream.expect('rparen')\n        elif token.type == 'lbracket':\n            node = self.parse_list()\n        elif token.type == 'lbrace':\n            node = self.parse_dict()\n        else:\n            self.fail(\"unexpected '%s'\" % describe_token(token), token.lineno)\n        return node\n\n    def parse_tuple(self, simplified=False, with_condexpr=True,\n                    extra_end_rules=None, explicit_parentheses=False):\n        \"\"\"Works like `parse_expression` but if multiple expressions are\n        delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.\n        This method could also return a regular expression instead of a tuple\n        if no commas where found.\n\n        The default parsing mode is a full tuple.  If `simplified` is `True`\n        only names and literals are parsed.  The `no_condexpr` parameter is\n        forwarded to :meth:`parse_expression`.\n\n        Because tuples do not require delimiters and may end in a bogus comma\n        an extra hint is needed that marks the end of a tuple.  For example\n        for loops support tuples between `for` and `in`.  In that case the\n        `extra_end_rules` is set to ``['name:in']``.\n\n        `explicit_parentheses` is true if the parsing was triggered by an\n        expression in parentheses.  This is used to figure out if an empty\n        tuple is a valid expression or not.\n        \"\"\"\n        lineno = self.stream.current.lineno\n        if simplified:\n            parse = self.parse_primary\n        elif with_condexpr:\n            parse = self.parse_expression\n        else:\n            parse = lambda: self.parse_expression(with_condexpr=False)\n        args = []\n        is_tuple = False\n        while 1:\n            if args:\n                self.stream.expect('comma')\n            if self.is_tuple_end(extra_end_rules):\n                break\n            args.append(parse())\n            if self.stream.current.type == 'comma':\n                is_tuple = True\n            else:\n                break\n            lineno = self.stream.current.lineno\n\n        if not is_tuple:\n            if args:\n                return args[0]\n\n            # if we don't have explicit parentheses, an empty tuple is\n            # not a valid expression.  This would mean nothing (literally\n            # nothing) in the spot of an expression would be an empty\n            # tuple.\n            if not explicit_parentheses:\n                self.fail('Expected an expression, got \\'%s\\'' %\n                          describe_token(self.stream.current))\n\n        return nodes.Tuple(args, 'load', lineno=lineno)\n\n    def parse_list(self):\n        token = self.stream.expect('lbracket')\n        items = []\n        while self.stream.current.type != 'rbracket':\n            if items:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'rbracket':\n                break\n            items.append(self.parse_expression())\n        self.stream.expect('rbracket')\n        return nodes.List(items, lineno=token.lineno)\n\n    def parse_dict(self):\n        token = self.stream.expect('lbrace')\n        items = []\n        while self.stream.current.type != 'rbrace':\n            if items:\n                self.stream.expect('comma')\n            if self.stream.current.type == 'rbrace':\n                break\n            key = self.parse_expression()\n            self.stream.expect('colon')\n            value = self.parse_expression()\n            items.append(nodes.Pair(key, value, lineno=key.lineno))\n        self.stream.expect('rbrace')\n        return nodes.Dict(items, lineno=token.lineno)\n\n    def parse_postfix(self, node):\n        while 1:\n            token_type = self.stream.current.type\n            if token_type == 'dot' or token_type == 'lbracket':\n                node = self.parse_subscript(node)\n            # calls are valid both after postfix expressions (getattr\n            # and getitem) as well as filters and tests\n            elif token_type == 'lparen':\n                node = self.parse_call(node)\n            else:\n                break\n        return node\n\n    def parse_filter_expr(self, node):\n        while 1:\n            token_type = self.stream.current.type\n            if token_type == 'pipe':\n                node = self.parse_filter(node)\n            elif token_type == 'name' and self.stream.current.value == 'is':\n                node = self.parse_test(node)\n            # calls are valid both after postfix expressions (getattr\n            # and getitem) as well as filters and tests\n            elif token_type == 'lparen':\n                node = self.parse_call(node)\n            else:\n                break\n        return node\n\n    def parse_subscript(self, node):\n        token = next(self.stream)\n        if token.type == 'dot':\n            attr_token = self.stream.current\n            next(self.stream)\n            if attr_token.type == 'name':\n                return nodes.Getattr(node, attr_token.value, 'load',\n                                     lineno=token.lineno)\n            elif attr_token.type != 'integer':\n                self.fail('expected name or number', attr_token.lineno)\n            arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)\n            return nodes.Getitem(node, arg, 'load', lineno=token.lineno)\n        if token.type == 'lbracket':\n            args = []\n            while self.stream.current.type != 'rbracket':\n                if args:\n                    self.stream.expect('comma')\n                args.append(self.parse_subscribed())\n            self.stream.expect('rbracket')\n            if len(args) == 1:\n                arg = args[0]\n            else:\n                arg = nodes.Tuple(args, 'load', lineno=token.lineno)\n            return nodes.Getitem(node, arg, 'load', lineno=token.lineno)\n        self.fail('expected subscript expression', self.lineno)\n\n    def parse_subscribed(self):\n        lineno = self.stream.current.lineno\n\n        if self.stream.current.type == 'colon':\n            next(self.stream)\n            args = [None]\n        else:\n            node = self.parse_expression()\n            if self.stream.current.type != 'colon':\n                return node\n            next(self.stream)\n            args = [node]\n\n        if self.stream.current.type == 'colon':\n            args.append(None)\n        elif self.stream.current.type not in ('rbracket', 'comma'):\n            args.append(self.parse_expression())\n        else:\n            args.append(None)\n\n        if self.stream.current.type == 'colon':\n            next(self.stream)\n            if self.stream.current.type not in ('rbracket', 'comma'):\n                args.append(self.parse_expression())\n            else:\n                args.append(None)\n        else:\n            args.append(None)\n\n        return nodes.Slice(lineno=lineno, *args)\n\n    def parse_call(self, node):\n        token = self.stream.expect('lparen')\n        args = []\n        kwargs = []\n        dyn_args = dyn_kwargs = None\n        require_comma = False\n\n        def ensure(expr):\n            if not expr:\n                self.fail('invalid syntax for function call expression',\n                          token.lineno)\n\n        while self.stream.current.type != 'rparen':\n            if require_comma:\n                self.stream.expect('comma')\n                # support for trailing comma\n                if self.stream.current.type == 'rparen':\n                    break\n            if self.stream.current.type == 'mul':\n                ensure(dyn_args is None and dyn_kwargs is None)\n                next(self.stream)\n                dyn_args = self.parse_expression()\n            elif self.stream.current.type == 'pow':\n                ensure(dyn_kwargs is None)\n                next(self.stream)\n                dyn_kwargs = self.parse_expression()\n            else:\n                ensure(dyn_args is None and dyn_kwargs is None)\n                if self.stream.current.type == 'name' and \\\n                   self.stream.look().type == 'assign':\n                    key = self.stream.current.value\n                    self.stream.skip(2)\n                    value = self.parse_expression()\n                    kwargs.append(nodes.Keyword(key, value,\n                                                lineno=value.lineno))\n                else:\n                    ensure(not kwargs)\n                    args.append(self.parse_expression())\n\n            require_comma = True\n        self.stream.expect('rparen')\n\n        if node is None:\n            return args, kwargs, dyn_args, dyn_kwargs\n        return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs,\n                          lineno=token.lineno)\n\n    def parse_filter(self, node, start_inline=False):\n        while self.stream.current.type == 'pipe' or start_inline:\n            if not start_inline:\n                next(self.stream)\n            token = self.stream.expect('name')\n            name = token.value\n            while self.stream.current.type == 'dot':\n                next(self.stream)\n                name += '.' + self.stream.expect('name').value\n            if self.stream.current.type == 'lparen':\n                args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)\n            else:\n                args = []\n                kwargs = []\n                dyn_args = dyn_kwargs = None\n            node = nodes.Filter(node, name, args, kwargs, dyn_args,\n                                dyn_kwargs, lineno=token.lineno)\n            start_inline = False\n        return node\n\n    def parse_test(self, node):\n        token = next(self.stream)\n        if self.stream.current.test('name:not'):\n            next(self.stream)\n            negated = True\n        else:\n            negated = False\n        name = self.stream.expect('name').value\n        while self.stream.current.type == 'dot':\n            next(self.stream)\n            name += '.' + self.stream.expect('name').value\n        dyn_args = dyn_kwargs = None\n        kwargs = []\n        if self.stream.current.type == 'lparen':\n            args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)\n        elif (self.stream.current.type in ('name', 'string', 'integer',\n                                           'float', 'lparen', 'lbracket',\n                                           'lbrace') and not\n              self.stream.current.test_any('name:else', 'name:or',\n                                           'name:and')):\n            if self.stream.current.test('name:is'):\n                self.fail('You cannot chain multiple tests with is')\n            args = [self.parse_primary()]\n        else:\n            args = []\n        node = nodes.Test(node, name, args, kwargs, dyn_args,\n                          dyn_kwargs, lineno=token.lineno)\n        if negated:\n            node = nodes.Not(node, lineno=token.lineno)\n        return node\n\n    def subparse(self, end_tokens=None):\n        body = []\n        data_buffer = []\n        add_data = data_buffer.append\n\n        if end_tokens is not None:\n            self._end_token_stack.append(end_tokens)\n\n        def flush_data():\n            if data_buffer:\n                lineno = data_buffer[0].lineno\n                body.append(nodes.Output(data_buffer[:], lineno=lineno))\n                del data_buffer[:]\n\n        try:\n            while self.stream:\n                token = self.stream.current\n                if token.type == 'data':\n                    if token.value:\n                        add_data(nodes.TemplateData(token.value,\n                                                    lineno=token.lineno))\n                    next(self.stream)\n                elif token.type == 'variable_begin':\n                    next(self.stream)\n                    add_data(self.parse_tuple(with_condexpr=True))\n                    self.stream.expect('variable_end')\n                elif token.type == 'block_begin':\n                    flush_data()\n                    next(self.stream)\n                    if end_tokens is not None and \\\n                       self.stream.current.test_any(*end_tokens):\n                        return body\n                    rv = self.parse_statement()\n                    if isinstance(rv, list):\n                        body.extend(rv)\n                    else:\n                        body.append(rv)\n                    self.stream.expect('block_end')\n                else:\n                    raise AssertionError('internal parsing error')\n\n            flush_data()\n        finally:\n            if end_tokens is not None:\n                self._end_token_stack.pop()\n\n        return body\n\n    def parse(self):\n        \"\"\"Parse the whole template into a `Template` node.\"\"\"\n        result = nodes.Template(self.subparse(), lineno=1)\n        result.set_environment(self.environment)\n        return result\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/runtime.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.runtime\n    ~~~~~~~~~~~~~~\n\n    Runtime helpers.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport sys\n\nfrom itertools import chain\nfrom types import MethodType\n\nfrom jinja2.nodes import EvalContext, _context_function_types\nfrom jinja2.utils import Markup, soft_unicode, escape, missing, concat, \\\n     internalcode, object_type_repr, evalcontextfunction, Namespace\nfrom jinja2.exceptions import UndefinedError, TemplateRuntimeError, \\\n     TemplateNotFound\nfrom jinja2._compat import imap, text_type, iteritems, \\\n     implements_iterator, implements_to_string, string_types, PY2, \\\n     with_metaclass, abc\n\n\n# these variables are exported to the template runtime\n__all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',\n           'TemplateRuntimeError', 'missing', 'concat', 'escape',\n           'markup_join', 'unicode_join', 'to_string', 'identity',\n           'TemplateNotFound', 'Namespace']\n\n#: the name of the function that is used to convert something into\n#: a string.  We can just use the text type here.\nto_string = text_type\n\n#: the identity function.  Useful for certain things in the environment\nidentity = lambda x: x\n\n_first_iteration = object()\n_last_iteration = object()\n\n\ndef markup_join(seq):\n    \"\"\"Concatenation that escapes if necessary and converts to unicode.\"\"\"\n    buf = []\n    iterator = imap(soft_unicode, seq)\n    for arg in iterator:\n        buf.append(arg)\n        if hasattr(arg, '__html__'):\n            return Markup(u'').join(chain(buf, iterator))\n    return concat(buf)\n\n\ndef unicode_join(seq):\n    \"\"\"Simple args to unicode conversion and concatenation.\"\"\"\n    return concat(imap(text_type, seq))\n\n\ndef new_context(environment, template_name, blocks, vars=None,\n                shared=None, globals=None, locals=None):\n    \"\"\"Internal helper to for context creation.\"\"\"\n    if vars is None:\n        vars = {}\n    if shared:\n        parent = vars\n    else:\n        parent = dict(globals or (), **vars)\n    if locals:\n        # if the parent is shared a copy should be created because\n        # we don't want to modify the dict passed\n        if shared:\n            parent = dict(parent)\n        for key, value in iteritems(locals):\n            if value is not missing:\n                parent[key] = value\n    return environment.context_class(environment, parent, template_name,\n                                     blocks)\n\n\nclass TemplateReference(object):\n    \"\"\"The `self` in templates.\"\"\"\n\n    def __init__(self, context):\n        self.__context = context\n\n    def __getitem__(self, name):\n        blocks = self.__context.blocks[name]\n        return BlockReference(name, self.__context, blocks, 0)\n\n    def __repr__(self):\n        return '<%s %r>' % (\n            self.__class__.__name__,\n            self.__context.name\n        )\n\n\ndef _get_func(x):\n    return getattr(x, '__func__', x)\n\n\nclass ContextMeta(type):\n\n    def __new__(cls, name, bases, d):\n        rv = type.__new__(cls, name, bases, d)\n        if bases == ():\n            return rv\n\n        resolve = _get_func(rv.resolve)\n        default_resolve = _get_func(Context.resolve)\n        resolve_or_missing = _get_func(rv.resolve_or_missing)\n        default_resolve_or_missing = _get_func(Context.resolve_or_missing)\n\n        # If we have a changed resolve but no changed default or missing\n        # resolve we invert the call logic.\n        if resolve is not default_resolve and \\\n           resolve_or_missing is default_resolve_or_missing:\n            rv._legacy_resolve_mode = True\n        elif resolve is default_resolve and \\\n             resolve_or_missing is default_resolve_or_missing:\n            rv._fast_resolve_mode = True\n\n        return rv\n\n\ndef resolve_or_missing(context, key, missing=missing):\n    if key in context.vars:\n        return context.vars[key]\n    if key in context.parent:\n        return context.parent[key]\n    return missing\n\n\nclass Context(with_metaclass(ContextMeta)):\n    \"\"\"The template context holds the variables of a template.  It stores the\n    values passed to the template and also the names the template exports.\n    Creating instances is neither supported nor useful as it's created\n    automatically at various stages of the template evaluation and should not\n    be created by hand.\n\n    The context is immutable.  Modifications on :attr:`parent` **must not**\n    happen and modifications on :attr:`vars` are allowed from generated\n    template code only.  Template filters and global functions marked as\n    :func:`contextfunction`\\\\s get the active context passed as first argument\n    and are allowed to access the context read-only.\n\n    The template context supports read only dict operations (`get`,\n    `keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`,\n    `__getitem__`, `__contains__`).  Additionally there is a :meth:`resolve`\n    method that doesn't fail with a `KeyError` but returns an\n    :class:`Undefined` object for missing variables.\n    \"\"\"\n    # XXX: we want to eventually make this be a deprecation warning and\n    # remove it.\n    _legacy_resolve_mode = False\n    _fast_resolve_mode = False\n\n    def __init__(self, environment, parent, name, blocks):\n        self.parent = parent\n        self.vars = {}\n        self.environment = environment\n        self.eval_ctx = EvalContext(self.environment, name)\n        self.exported_vars = set()\n        self.name = name\n\n        # create the initial mapping of blocks.  Whenever template inheritance\n        # takes place the runtime will update this mapping with the new blocks\n        # from the template.\n        self.blocks = dict((k, [v]) for k, v in iteritems(blocks))\n\n        # In case we detect the fast resolve mode we can set up an alias\n        # here that bypasses the legacy code logic.\n        if self._fast_resolve_mode:\n            self.resolve_or_missing = MethodType(resolve_or_missing, self)\n\n    def super(self, name, current):\n        \"\"\"Render a parent block.\"\"\"\n        try:\n            blocks = self.blocks[name]\n            index = blocks.index(current) + 1\n            blocks[index]\n        except LookupError:\n            return self.environment.undefined('there is no parent block '\n                                              'called %r.' % name,\n                                              name='super')\n        return BlockReference(name, self, blocks, index)\n\n    def get(self, key, default=None):\n        \"\"\"Returns an item from the template context, if it doesn't exist\n        `default` is returned.\n        \"\"\"\n        try:\n            return self[key]\n        except KeyError:\n            return default\n\n    def resolve(self, key):\n        \"\"\"Looks up a variable like `__getitem__` or `get` but returns an\n        :class:`Undefined` object with the name of the name looked up.\n        \"\"\"\n        if self._legacy_resolve_mode:\n            rv = resolve_or_missing(self, key)\n        else:\n            rv = self.resolve_or_missing(key)\n        if rv is missing:\n            return self.environment.undefined(name=key)\n        return rv\n\n    def resolve_or_missing(self, key):\n        \"\"\"Resolves a variable like :meth:`resolve` but returns the\n        special `missing` value if it cannot be found.\n        \"\"\"\n        if self._legacy_resolve_mode:\n            rv = self.resolve(key)\n            if isinstance(rv, Undefined):\n                rv = missing\n            return rv\n        return resolve_or_missing(self, key)\n\n    def get_exported(self):\n        \"\"\"Get a new dict with the exported variables.\"\"\"\n        return dict((k, self.vars[k]) for k in self.exported_vars)\n\n    def get_all(self):\n        \"\"\"Return the complete context as dict including the exported\n        variables.  For optimizations reasons this might not return an\n        actual copy so be careful with using it.\n        \"\"\"\n        if not self.vars:\n            return self.parent\n        if not self.parent:\n            return self.vars\n        return dict(self.parent, **self.vars)\n\n    @internalcode\n    def call(__self, __obj, *args, **kwargs):\n        \"\"\"Call the callable with the arguments and keyword arguments\n        provided but inject the active context or environment as first\n        argument if the callable is a :func:`contextfunction` or\n        :func:`environmentfunction`.\n        \"\"\"\n        if __debug__:\n            __traceback_hide__ = True  # noqa\n\n        # Allow callable classes to take a context\n        if hasattr(__obj, '__call__'):\n            fn = __obj.__call__\n            for fn_type in ('contextfunction',\n                            'evalcontextfunction',\n                            'environmentfunction'):\n                if hasattr(fn, fn_type):\n                    __obj = fn\n                    break\n\n        if isinstance(__obj, _context_function_types):\n            if getattr(__obj, 'contextfunction', 0):\n                args = (__self,) + args\n            elif getattr(__obj, 'evalcontextfunction', 0):\n                args = (__self.eval_ctx,) + args\n            elif getattr(__obj, 'environmentfunction', 0):\n                args = (__self.environment,) + args\n        try:\n            return __obj(*args, **kwargs)\n        except StopIteration:\n            return __self.environment.undefined('value was undefined because '\n                                                'a callable raised a '\n                                                'StopIteration exception')\n\n    def derived(self, locals=None):\n        \"\"\"Internal helper function to create a derived context.  This is\n        used in situations where the system needs a new context in the same\n        template that is independent.\n        \"\"\"\n        context = new_context(self.environment, self.name, {},\n                              self.get_all(), True, None, locals)\n        context.eval_ctx = self.eval_ctx\n        context.blocks.update((k, list(v)) for k, v in iteritems(self.blocks))\n        return context\n\n    def _all(meth):\n        proxy = lambda self: getattr(self.get_all(), meth)()\n        proxy.__doc__ = getattr(dict, meth).__doc__\n        proxy.__name__ = meth\n        return proxy\n\n    keys = _all('keys')\n    values = _all('values')\n    items = _all('items')\n\n    # not available on python 3\n    if PY2:\n        iterkeys = _all('iterkeys')\n        itervalues = _all('itervalues')\n        iteritems = _all('iteritems')\n    del _all\n\n    def __contains__(self, name):\n        return name in self.vars or name in self.parent\n\n    def __getitem__(self, key):\n        \"\"\"Lookup a variable or raise `KeyError` if the variable is\n        undefined.\n        \"\"\"\n        item = self.resolve_or_missing(key)\n        if item is missing:\n            raise KeyError(key)\n        return item\n\n    def __repr__(self):\n        return '<%s %s of %r>' % (\n            self.__class__.__name__,\n            repr(self.get_all()),\n            self.name\n        )\n\n\nabc.Mapping.register(Context)\n\n\nclass BlockReference(object):\n    \"\"\"One block on a template reference.\"\"\"\n\n    def __init__(self, name, context, stack, depth):\n        self.name = name\n        self._context = context\n        self._stack = stack\n        self._depth = depth\n\n    @property\n    def super(self):\n        \"\"\"Super the block.\"\"\"\n        if self._depth + 1 >= len(self._stack):\n            return self._context.environment. \\\n                undefined('there is no parent block called %r.' %\n                          self.name, name='super')\n        return BlockReference(self.name, self._context, self._stack,\n                              self._depth + 1)\n\n    @internalcode\n    def __call__(self):\n        rv = concat(self._stack[self._depth](self._context))\n        if self._context.eval_ctx.autoescape:\n            rv = Markup(rv)\n        return rv\n\n\nclass LoopContextBase(object):\n    \"\"\"A loop context for dynamic iteration.\"\"\"\n\n    _before = _first_iteration\n    _current = _first_iteration\n    _after = _last_iteration\n    _length = None\n\n    def __init__(self, undefined, recurse=None, depth0=0):\n        self._undefined = undefined\n        self._recurse = recurse\n        self.index0 = -1\n        self.depth0 = depth0\n        self._last_checked_value = missing\n\n    def cycle(self, *args):\n        \"\"\"Cycles among the arguments with the current loop index.\"\"\"\n        if not args:\n            raise TypeError('no items for cycling given')\n        return args[self.index0 % len(args)]\n\n    def changed(self, *value):\n        \"\"\"Checks whether the value has changed since the last call.\"\"\"\n        if self._last_checked_value != value:\n            self._last_checked_value = value\n            return True\n        return False\n\n    first = property(lambda x: x.index0 == 0)\n    last = property(lambda x: x._after is _last_iteration)\n    index = property(lambda x: x.index0 + 1)\n    revindex = property(lambda x: x.length - x.index0)\n    revindex0 = property(lambda x: x.length - x.index)\n    depth = property(lambda x: x.depth0 + 1)\n\n    @property\n    def previtem(self):\n        if self._before is _first_iteration:\n            return self._undefined('there is no previous item')\n        return self._before\n\n    @property\n    def nextitem(self):\n        if self._after is _last_iteration:\n            return self._undefined('there is no next item')\n        return self._after\n\n    def __len__(self):\n        return self.length\n\n    @internalcode\n    def loop(self, iterable):\n        if self._recurse is None:\n            raise TypeError('Tried to call non recursive loop.  Maybe you '\n                            \"forgot the 'recursive' modifier.\")\n        return self._recurse(iterable, self._recurse, self.depth0 + 1)\n\n    # a nifty trick to enhance the error message if someone tried to call\n    # the the loop without or with too many arguments.\n    __call__ = loop\n    del loop\n\n    def __repr__(self):\n        return '<%s %r/%r>' % (\n            self.__class__.__name__,\n            self.index,\n            self.length\n        )\n\n\nclass LoopContext(LoopContextBase):\n\n    def __init__(self, iterable, undefined, recurse=None, depth0=0):\n        LoopContextBase.__init__(self, undefined, recurse, depth0)\n        self._iterator = iter(iterable)\n\n        # try to get the length of the iterable early.  This must be done\n        # here because there are some broken iterators around where there\n        # __len__ is the number of iterations left (i'm looking at your\n        # listreverseiterator!).\n        try:\n            self._length = len(iterable)\n        except (TypeError, AttributeError):\n            self._length = None\n        self._after = self._safe_next()\n\n    @property\n    def length(self):\n        if self._length is None:\n            # if was not possible to get the length of the iterator when\n            # the loop context was created (ie: iterating over a generator)\n            # we have to convert the iterable into a sequence and use the\n            # length of that + the number of iterations so far.\n            iterable = tuple(self._iterator)\n            self._iterator = iter(iterable)\n            iterations_done = self.index0 + 2\n            self._length = len(iterable) + iterations_done\n        return self._length\n\n    def __iter__(self):\n        return LoopContextIterator(self)\n\n    def _safe_next(self):\n        try:\n            return next(self._iterator)\n        except StopIteration:\n            return _last_iteration\n\n\n@implements_iterator\nclass LoopContextIterator(object):\n    \"\"\"The iterator for a loop context.\"\"\"\n    __slots__ = ('context',)\n\n    def __init__(self, context):\n        self.context = context\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        ctx = self.context\n        ctx.index0 += 1\n        if ctx._after is _last_iteration:\n            raise StopIteration()\n        ctx._before = ctx._current\n        ctx._current = ctx._after\n        ctx._after = ctx._safe_next()\n        return ctx._current, ctx\n\n\nclass Macro(object):\n    \"\"\"Wraps a macro function.\"\"\"\n\n    def __init__(self, environment, func, name, arguments,\n                 catch_kwargs, catch_varargs, caller,\n                 default_autoescape=None):\n        self._environment = environment\n        self._func = func\n        self._argument_count = len(arguments)\n        self.name = name\n        self.arguments = arguments\n        self.catch_kwargs = catch_kwargs\n        self.catch_varargs = catch_varargs\n        self.caller = caller\n        self.explicit_caller = 'caller' in arguments\n        if default_autoescape is None:\n            default_autoescape = environment.autoescape\n        self._default_autoescape = default_autoescape\n\n    @internalcode\n    @evalcontextfunction\n    def __call__(self, *args, **kwargs):\n        # This requires a bit of explanation,  In the past we used to\n        # decide largely based on compile-time information if a macro is\n        # safe or unsafe.  While there was a volatile mode it was largely\n        # unused for deciding on escaping.  This turns out to be\n        # problemtic for macros because if a macro is safe or not not so\n        # much depends on the escape mode when it was defined but when it\n        # was used.\n        #\n        # Because however we export macros from the module system and\n        # there are historic callers that do not pass an eval context (and\n        # will continue to not pass one), we need to perform an instance\n        # check here.\n        #\n        # This is considered safe because an eval context is not a valid\n        # argument to callables otherwise anwyays.  Worst case here is\n        # that if no eval context is passed we fall back to the compile\n        # time autoescape flag.\n        if args and isinstance(args[0], EvalContext):\n            autoescape = args[0].autoescape\n            args = args[1:]\n        else:\n            autoescape = self._default_autoescape\n\n        # try to consume the positional arguments\n        arguments = list(args[:self._argument_count])\n        off = len(arguments)\n\n        # For information why this is necessary refer to the handling\n        # of caller in the `macro_body` handler in the compiler.\n        found_caller = False\n\n        # if the number of arguments consumed is not the number of\n        # arguments expected we start filling in keyword arguments\n        # and defaults.\n        if off != self._argument_count:\n            for idx, name in enumerate(self.arguments[len(arguments):]):\n                try:\n                    value = kwargs.pop(name)\n                except KeyError:\n                    value = missing\n                if name == 'caller':\n                    found_caller = True\n                arguments.append(value)\n        else:\n            found_caller = self.explicit_caller\n\n        # it's important that the order of these arguments does not change\n        # if not also changed in the compiler's `function_scoping` method.\n        # the order is caller, keyword arguments, positional arguments!\n        if self.caller and not found_caller:\n            caller = kwargs.pop('caller', None)\n            if caller is None:\n                caller = self._environment.undefined('No caller defined',\n                                                     name='caller')\n            arguments.append(caller)\n\n        if self.catch_kwargs:\n            arguments.append(kwargs)\n        elif kwargs:\n            if 'caller' in kwargs:\n                raise TypeError('macro %r was invoked with two values for '\n                                'the special caller argument.  This is '\n                                'most likely a bug.' % self.name)\n            raise TypeError('macro %r takes no keyword argument %r' %\n                            (self.name, next(iter(kwargs))))\n        if self.catch_varargs:\n            arguments.append(args[self._argument_count:])\n        elif len(args) > self._argument_count:\n            raise TypeError('macro %r takes not more than %d argument(s)' %\n                            (self.name, len(self.arguments)))\n\n        return self._invoke(arguments, autoescape)\n\n    def _invoke(self, arguments, autoescape):\n        \"\"\"This method is being swapped out by the async implementation.\"\"\"\n        rv = self._func(*arguments)\n        if autoescape:\n            rv = Markup(rv)\n        return rv\n\n    def __repr__(self):\n        return '<%s %s>' % (\n            self.__class__.__name__,\n            self.name is None and 'anonymous' or repr(self.name)\n        )\n\n\n@implements_to_string\nclass Undefined(object):\n    \"\"\"The default undefined type.  This undefined type can be printed and\n    iterated over, but every other access will raise an :exc:`jinja2.exceptions.UndefinedError`:\n\n    >>> foo = Undefined(name='foo')\n    >>> str(foo)\n    ''\n    >>> not foo\n    True\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ('_undefined_hint', '_undefined_obj', '_undefined_name',\n                 '_undefined_exception')\n\n    def __init__(self, hint=None, obj=missing, name=None, exc=UndefinedError):\n        self._undefined_hint = hint\n        self._undefined_obj = obj\n        self._undefined_name = name\n        self._undefined_exception = exc\n\n    @internalcode\n    def _fail_with_undefined_error(self, *args, **kwargs):\n        \"\"\"Regular callback function for undefined objects that raises an\n        `jinja2.exceptions.UndefinedError` on call.\n        \"\"\"\n        if self._undefined_hint is None:\n            if self._undefined_obj is missing:\n                hint = '%r is undefined' % self._undefined_name\n            elif not isinstance(self._undefined_name, string_types):\n                hint = '%s has no element %r' % (\n                    object_type_repr(self._undefined_obj),\n                    self._undefined_name\n                )\n            else:\n                hint = '%r has no attribute %r' % (\n                    object_type_repr(self._undefined_obj),\n                    self._undefined_name\n                )\n        else:\n            hint = self._undefined_hint\n        raise self._undefined_exception(hint)\n\n    @internalcode\n    def __getattr__(self, name):\n        if name[:2] == '__':\n            raise AttributeError(name)\n        return self._fail_with_undefined_error()\n\n    __add__ = __radd__ = __mul__ = __rmul__ = __div__ = __rdiv__ = \\\n        __truediv__ = __rtruediv__ = __floordiv__ = __rfloordiv__ = \\\n        __mod__ = __rmod__ = __pos__ = __neg__ = __call__ = \\\n        __getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \\\n        __float__ = __complex__ = __pow__ = __rpow__ = __sub__ = \\\n        __rsub__ = _fail_with_undefined_error\n\n    def __eq__(self, other):\n        return type(self) is type(other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __hash__(self):\n        return id(type(self))\n\n    def __str__(self):\n        return u''\n\n    def __len__(self):\n        return 0\n\n    def __iter__(self):\n        if 0:\n            yield None\n\n    def __nonzero__(self):\n        return False\n    __bool__ = __nonzero__\n\n    def __repr__(self):\n        return 'Undefined'\n\n\ndef make_logging_undefined(logger=None, base=None):\n    \"\"\"Given a logger object this returns a new undefined class that will\n    log certain failures.  It will log iterations and printing.  If no\n    logger is given a default logger is created.\n\n    Example::\n\n        logger = logging.getLogger(__name__)\n        LoggingUndefined = make_logging_undefined(\n            logger=logger,\n            base=Undefined\n        )\n\n    .. versionadded:: 2.8\n\n    :param logger: the logger to use.  If not provided, a default logger\n                   is created.\n    :param base: the base class to add logging functionality to.  This\n                 defaults to :class:`Undefined`.\n    \"\"\"\n    if logger is None:\n        import logging\n        logger = logging.getLogger(__name__)\n        logger.addHandler(logging.StreamHandler(sys.stderr))\n    if base is None:\n        base = Undefined\n\n    def _log_message(undef):\n        if undef._undefined_hint is None:\n            if undef._undefined_obj is missing:\n                hint = '%s is undefined' % undef._undefined_name\n            elif not isinstance(undef._undefined_name, string_types):\n                hint = '%s has no element %s' % (\n                    object_type_repr(undef._undefined_obj),\n                    undef._undefined_name)\n            else:\n                hint = '%s has no attribute %s' % (\n                    object_type_repr(undef._undefined_obj),\n                    undef._undefined_name)\n        else:\n            hint = undef._undefined_hint\n        logger.warning('Template variable warning: %s', hint)\n\n    class LoggingUndefined(base):\n\n        def _fail_with_undefined_error(self, *args, **kwargs):\n            try:\n                return base._fail_with_undefined_error(self, *args, **kwargs)\n            except self._undefined_exception as e:\n                logger.error('Template variable error: %s', str(e))\n                raise e\n\n        def __str__(self):\n            rv = base.__str__(self)\n            _log_message(self)\n            return rv\n\n        def __iter__(self):\n            rv = base.__iter__(self)\n            _log_message(self)\n            return rv\n\n        if PY2:\n            def __nonzero__(self):\n                rv = base.__nonzero__(self)\n                _log_message(self)\n                return rv\n\n            def __unicode__(self):\n                rv = base.__unicode__(self)\n                _log_message(self)\n                return rv\n        else:\n            def __bool__(self):\n                rv = base.__bool__(self)\n                _log_message(self)\n                return rv\n\n    return LoggingUndefined\n\n\n@implements_to_string\nclass DebugUndefined(Undefined):\n    \"\"\"An undefined that returns the debug info when printed.\n\n    >>> foo = DebugUndefined(name='foo')\n    >>> str(foo)\n    '{{ foo }}'\n    >>> not foo\n    True\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ()\n\n    def __str__(self):\n        if self._undefined_hint is None:\n            if self._undefined_obj is missing:\n                return u'{{ %s }}' % self._undefined_name\n            return '{{ no such element: %s[%r] }}' % (\n                object_type_repr(self._undefined_obj),\n                self._undefined_name\n            )\n        return u'{{ undefined value printed: %s }}' % self._undefined_hint\n\n\n@implements_to_string\nclass StrictUndefined(Undefined):\n    \"\"\"An undefined that barks on print and iteration as well as boolean\n    tests and all kinds of comparisons.  In other words: you can do nothing\n    with it except checking if it's defined using the `defined` test.\n\n    >>> foo = StrictUndefined(name='foo')\n    >>> str(foo)\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    >>> not foo\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    >>> foo + 42\n    Traceback (most recent call last):\n      ...\n    jinja2.exceptions.UndefinedError: 'foo' is undefined\n    \"\"\"\n    __slots__ = ()\n    __iter__ = __str__ = __len__ = __nonzero__ = __eq__ = \\\n        __ne__ = __bool__ = __hash__ = \\\n        Undefined._fail_with_undefined_error\n\n\n# remove remaining slots attributes, after the metaclass did the magic they\n# are unneeded and irritating as they contain wrong data for the subclasses.\ndel Undefined.__slots__, DebugUndefined.__slots__, StrictUndefined.__slots__\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/sandbox.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.sandbox\n    ~~~~~~~~~~~~~~\n\n    Adds a sandbox layer to Jinja as it was the default behavior in the old\n    Jinja 1 releases.  This sandbox is slightly different from Jinja 1 as the\n    default behavior is easier to use.\n\n    The behavior can be changed by subclassing the environment.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nimport types\nimport operator\nfrom jinja2.environment import Environment\nfrom jinja2.exceptions import SecurityError\nfrom jinja2._compat import string_types, PY2, abc, range_type\nfrom jinja2.utils import Markup\n\nfrom markupsafe import EscapeFormatter\nfrom string import Formatter\n\n\n#: maximum number of items a range may produce\nMAX_RANGE = 100000\n\n#: attributes of function objects that are considered unsafe.\nif PY2:\n    UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',\n                                      'func_defaults', 'func_globals'])\nelse:\n    # On versions > python 2 the special attributes on functions are gone,\n    # but they remain on methods and generators for whatever reason.\n    UNSAFE_FUNCTION_ATTRIBUTES = set()\n\n\n#: unsafe method attributes.  function attributes are unsafe for methods too\nUNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])\n\n#: unsafe generator attirbutes.\nUNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])\n\n#: unsafe attributes on coroutines\nUNSAFE_COROUTINE_ATTRIBUTES = set(['cr_frame', 'cr_code'])\n\n#: unsafe attributes on async generators\nUNSAFE_ASYNC_GENERATOR_ATTRIBUTES = set(['ag_code', 'ag_frame'])\n\nimport warnings\n\n# make sure we don't warn in python 2.6 about stuff we don't care about\nwarnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,\n                        module='jinja2.sandbox')\n\nfrom collections import deque\n\n_mutable_set_types = (set,)\n_mutable_mapping_types = (dict,)\n_mutable_sequence_types = (list,)\n\n\n# on python 2.x we can register the user collection types\ntry:\n    from UserDict import UserDict, DictMixin\n    from UserList import UserList\n    _mutable_mapping_types += (UserDict, DictMixin)\n    _mutable_set_types += (UserList,)\nexcept ImportError:\n    pass\n\n# if sets is still available, register the mutable set from there as well\ntry:\n    from sets import Set\n    _mutable_set_types += (Set,)\nexcept ImportError:\n    pass\n\n#: register Python 2.6 abstract base classes\n_mutable_set_types += (abc.MutableSet,)\n_mutable_mapping_types += (abc.MutableMapping,)\n_mutable_sequence_types += (abc.MutableSequence,)\n\n\n_mutable_spec = (\n    (_mutable_set_types, frozenset([\n        'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',\n        'symmetric_difference_update', 'update'\n    ])),\n    (_mutable_mapping_types, frozenset([\n        'clear', 'pop', 'popitem', 'setdefault', 'update'\n    ])),\n    (_mutable_sequence_types, frozenset([\n        'append', 'reverse', 'insert', 'sort', 'extend', 'remove'\n    ])),\n    (deque, frozenset([\n        'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',\n        'popleft', 'remove', 'rotate'\n    ]))\n)\n\n\nclass _MagicFormatMapping(abc.Mapping):\n    \"\"\"This class implements a dummy wrapper to fix a bug in the Python\n    standard library for string formatting.\n\n    See https://bugs.python.org/issue13598 for information about why\n    this is necessary.\n    \"\"\"\n\n    def __init__(self, args, kwargs):\n        self._args = args\n        self._kwargs = kwargs\n        self._last_index = 0\n\n    def __getitem__(self, key):\n        if key == '':\n            idx = self._last_index\n            self._last_index += 1\n            try:\n                return self._args[idx]\n            except LookupError:\n                pass\n            key = str(idx)\n        return self._kwargs[key]\n\n    def __iter__(self):\n        return iter(self._kwargs)\n\n    def __len__(self):\n        return len(self._kwargs)\n\n\ndef inspect_format_method(callable):\n    if not isinstance(callable, (types.MethodType,\n                                 types.BuiltinMethodType)) or \\\n       callable.__name__ not in ('format', 'format_map'):\n        return None\n    obj = callable.__self__\n    if isinstance(obj, string_types):\n        return obj\n\n\ndef safe_range(*args):\n    \"\"\"A range that can't generate ranges with a length of more than\n    MAX_RANGE items.\n    \"\"\"\n    rng = range_type(*args)\n\n    if len(rng) > MAX_RANGE:\n        raise OverflowError(\n            \"Range too big. The sandbox blocks ranges larger than\"\n            \" MAX_RANGE (%d).\" % MAX_RANGE\n        )\n\n    return rng\n\n\ndef unsafe(f):\n    \"\"\"Marks a function or method as unsafe.\n\n    ::\n\n        @unsafe\n        def delete(self):\n            pass\n    \"\"\"\n    f.unsafe_callable = True\n    return f\n\n\ndef is_internal_attribute(obj, attr):\n    \"\"\"Test if the attribute given is an internal python attribute.  For\n    example this function returns `True` for the `func_code` attribute of\n    python objects.  This is useful if the environment method\n    :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.\n\n    >>> from jinja2.sandbox import is_internal_attribute\n    >>> is_internal_attribute(str, \"mro\")\n    True\n    >>> is_internal_attribute(str, \"upper\")\n    False\n    \"\"\"\n    if isinstance(obj, types.FunctionType):\n        if attr in UNSAFE_FUNCTION_ATTRIBUTES:\n            return True\n    elif isinstance(obj, types.MethodType):\n        if attr in UNSAFE_FUNCTION_ATTRIBUTES or \\\n           attr in UNSAFE_METHOD_ATTRIBUTES:\n            return True\n    elif isinstance(obj, type):\n        if attr == 'mro':\n            return True\n    elif isinstance(obj, (types.CodeType, types.TracebackType, types.FrameType)):\n        return True\n    elif isinstance(obj, types.GeneratorType):\n        if attr in UNSAFE_GENERATOR_ATTRIBUTES:\n            return True\n    elif hasattr(types, 'CoroutineType') and isinstance(obj, types.CoroutineType):\n        if attr in UNSAFE_COROUTINE_ATTRIBUTES:\n            return True\n    elif hasattr(types, 'AsyncGeneratorType') and isinstance(obj, types.AsyncGeneratorType):\n        if attr in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:\n            return True\n    return attr.startswith('__')\n\n\ndef modifies_known_mutable(obj, attr):\n    \"\"\"This function checks if an attribute on a builtin mutable object\n    (list, dict, set or deque) would modify it if called.  It also supports\n    the \"user\"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and\n    with Python 2.6 onwards the abstract base classes `MutableSet`,\n    `MutableMapping`, and `MutableSequence`.\n\n    >>> modifies_known_mutable({}, \"clear\")\n    True\n    >>> modifies_known_mutable({}, \"keys\")\n    False\n    >>> modifies_known_mutable([], \"append\")\n    True\n    >>> modifies_known_mutable([], \"index\")\n    False\n\n    If called with an unsupported object (such as unicode) `False` is\n    returned.\n\n    >>> modifies_known_mutable(\"foo\", \"upper\")\n    False\n    \"\"\"\n    for typespec, unsafe in _mutable_spec:\n        if isinstance(obj, typespec):\n            return attr in unsafe\n    return False\n\n\nclass SandboxedEnvironment(Environment):\n    \"\"\"The sandboxed environment.  It works like the regular environment but\n    tells the compiler to generate sandboxed code.  Additionally subclasses of\n    this environment may override the methods that tell the runtime what\n    attributes or functions are safe to access.\n\n    If the template tries to access insecure code a :exc:`SecurityError` is\n    raised.  However also other exceptions may occur during the rendering so\n    the caller has to ensure that all exceptions are caught.\n    \"\"\"\n    sandboxed = True\n\n    #: default callback table for the binary operators.  A copy of this is\n    #: available on each instance of a sandboxed environment as\n    #: :attr:`binop_table`\n    default_binop_table = {\n        '+':        operator.add,\n        '-':        operator.sub,\n        '*':        operator.mul,\n        '/':        operator.truediv,\n        '//':       operator.floordiv,\n        '**':       operator.pow,\n        '%':        operator.mod\n    }\n\n    #: default callback table for the unary operators.  A copy of this is\n    #: available on each instance of a sandboxed environment as\n    #: :attr:`unop_table`\n    default_unop_table = {\n        '+':        operator.pos,\n        '-':        operator.neg\n    }\n\n    #: a set of binary operators that should be intercepted.  Each operator\n    #: that is added to this set (empty by default) is delegated to the\n    #: :meth:`call_binop` method that will perform the operator.  The default\n    #: operator callback is specified by :attr:`binop_table`.\n    #:\n    #: The following binary operators are interceptable:\n    #: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``\n    #:\n    #: The default operation form the operator table corresponds to the\n    #: builtin function.  Intercepted calls are always slower than the native\n    #: operator call, so make sure only to intercept the ones you are\n    #: interested in.\n    #:\n    #: .. versionadded:: 2.6\n    intercepted_binops = frozenset()\n\n    #: a set of unary operators that should be intercepted.  Each operator\n    #: that is added to this set (empty by default) is delegated to the\n    #: :meth:`call_unop` method that will perform the operator.  The default\n    #: operator callback is specified by :attr:`unop_table`.\n    #:\n    #: The following unary operators are interceptable: ``+``, ``-``\n    #:\n    #: The default operation form the operator table corresponds to the\n    #: builtin function.  Intercepted calls are always slower than the native\n    #: operator call, so make sure only to intercept the ones you are\n    #: interested in.\n    #:\n    #: .. versionadded:: 2.6\n    intercepted_unops = frozenset()\n\n    def intercept_unop(self, operator):\n        \"\"\"Called during template compilation with the name of a unary\n        operator to check if it should be intercepted at runtime.  If this\n        method returns `True`, :meth:`call_unop` is excuted for this unary\n        operator.  The default implementation of :meth:`call_unop` will use\n        the :attr:`unop_table` dictionary to perform the operator with the\n        same logic as the builtin one.\n\n        The following unary operators are interceptable: ``+`` and ``-``\n\n        Intercepted calls are always slower than the native operator call,\n        so make sure only to intercept the ones you are interested in.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return False\n\n\n    def __init__(self, *args, **kwargs):\n        Environment.__init__(self, *args, **kwargs)\n        self.globals['range'] = safe_range\n        self.binop_table = self.default_binop_table.copy()\n        self.unop_table = self.default_unop_table.copy()\n\n    def is_safe_attribute(self, obj, attr, value):\n        \"\"\"The sandboxed environment will call this method to check if the\n        attribute of an object is safe to access.  Per default all attributes\n        starting with an underscore are considered private as well as the\n        special attributes of internal python objects as returned by the\n        :func:`is_internal_attribute` function.\n        \"\"\"\n        return not (attr.startswith('_') or is_internal_attribute(obj, attr))\n\n    def is_safe_callable(self, obj):\n        \"\"\"Check if an object is safely callable.  Per default a function is\n        considered safe unless the `unsafe_callable` attribute exists and is\n        True.  Override this method to alter the behavior, but this won't\n        affect the `unsafe` decorator from this module.\n        \"\"\"\n        return not (getattr(obj, 'unsafe_callable', False) or\n                    getattr(obj, 'alters_data', False))\n\n    def call_binop(self, context, operator, left, right):\n        \"\"\"For intercepted binary operator calls (:meth:`intercepted_binops`)\n        this function is executed instead of the builtin operator.  This can\n        be used to fine tune the behavior of certain operators.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return self.binop_table[operator](left, right)\n\n    def call_unop(self, context, operator, arg):\n        \"\"\"For intercepted unary operator calls (:meth:`intercepted_unops`)\n        this function is executed instead of the builtin operator.  This can\n        be used to fine tune the behavior of certain operators.\n\n        .. versionadded:: 2.6\n        \"\"\"\n        return self.unop_table[operator](arg)\n\n    def getitem(self, obj, argument):\n        \"\"\"Subscribe an object from sandboxed code.\"\"\"\n        try:\n            return obj[argument]\n        except (TypeError, LookupError):\n            if isinstance(argument, string_types):\n                try:\n                    attr = str(argument)\n                except Exception:\n                    pass\n                else:\n                    try:\n                        value = getattr(obj, attr)\n                    except AttributeError:\n                        pass\n                    else:\n                        if self.is_safe_attribute(obj, argument, value):\n                            return value\n                        return self.unsafe_undefined(obj, argument)\n        return self.undefined(obj=obj, name=argument)\n\n    def getattr(self, obj, attribute):\n        \"\"\"Subscribe an object from sandboxed code and prefer the\n        attribute.  The attribute passed *must* be a bytestring.\n        \"\"\"\n        try:\n            value = getattr(obj, attribute)\n        except AttributeError:\n            try:\n                return obj[attribute]\n            except (TypeError, LookupError):\n                pass\n        else:\n            if self.is_safe_attribute(obj, attribute, value):\n                return value\n            return self.unsafe_undefined(obj, attribute)\n        return self.undefined(obj=obj, name=attribute)\n\n    def unsafe_undefined(self, obj, attribute):\n        \"\"\"Return an undefined object for unsafe attributes.\"\"\"\n        return self.undefined('access to attribute %r of %r '\n                              'object is unsafe.' % (\n            attribute,\n            obj.__class__.__name__\n        ), name=attribute, obj=obj, exc=SecurityError)\n\n    def format_string(self, s, args, kwargs, format_func=None):\n        \"\"\"If a format call is detected, then this is routed through this\n        method so that our safety sandbox can be used for it.\n        \"\"\"\n        if isinstance(s, Markup):\n            formatter = SandboxedEscapeFormatter(self, s.escape)\n        else:\n            formatter = SandboxedFormatter(self)\n\n        if format_func is not None and format_func.__name__ == 'format_map':\n            if len(args) != 1 or kwargs:\n                raise TypeError(\n                    'format_map() takes exactly one argument %d given'\n                    % (len(args) + (kwargs is not None))\n                )\n\n            kwargs = args[0]\n            args = None\n\n        kwargs = _MagicFormatMapping(args, kwargs)\n        rv = formatter.vformat(s, args, kwargs)\n        return type(s)(rv)\n\n    def call(__self, __context, __obj, *args, **kwargs):\n        \"\"\"Call an object from sandboxed code.\"\"\"\n        fmt = inspect_format_method(__obj)\n        if fmt is not None:\n            return __self.format_string(fmt, args, kwargs, __obj)\n\n        # the double prefixes are to avoid double keyword argument\n        # errors when proxying the call.\n        if not __self.is_safe_callable(__obj):\n            raise SecurityError('%r is not safely callable' % (__obj,))\n        return __context.call(__obj, *args, **kwargs)\n\n\nclass ImmutableSandboxedEnvironment(SandboxedEnvironment):\n    \"\"\"Works exactly like the regular `SandboxedEnvironment` but does not\n    permit modifications on the builtin mutable objects `list`, `set`, and\n    `dict` by using the :func:`modifies_known_mutable` function.\n    \"\"\"\n\n    def is_safe_attribute(self, obj, attr, value):\n        if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):\n            return False\n        return not modifies_known_mutable(obj, attr)\n\n\n# This really is not a public API apparenlty.\ntry:\n    from _string import formatter_field_name_split\nexcept ImportError:\n    def formatter_field_name_split(field_name):\n        return field_name._formatter_field_name_split()\n\n\nclass SandboxedFormatterMixin(object):\n\n    def __init__(self, env):\n        self._env = env\n\n    def get_field(self, field_name, args, kwargs):\n        first, rest = formatter_field_name_split(field_name)\n        obj = self.get_value(first, args, kwargs)\n        for is_attr, i in rest:\n            if is_attr:\n                obj = self._env.getattr(obj, i)\n            else:\n                obj = self._env.getitem(obj, i)\n        return obj, first\n\nclass SandboxedFormatter(SandboxedFormatterMixin, Formatter):\n\n    def __init__(self, env):\n        SandboxedFormatterMixin.__init__(self, env)\n        Formatter.__init__(self)\n\nclass SandboxedEscapeFormatter(SandboxedFormatterMixin, EscapeFormatter):\n\n    def __init__(self, env, escape):\n        SandboxedFormatterMixin.__init__(self, env)\n        EscapeFormatter.__init__(self, escape)\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/tests.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.tests\n    ~~~~~~~~~~~~\n\n    Jinja test functions. Used with the \"is\" operator.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport operator\nimport re\nfrom jinja2.runtime import Undefined\nfrom jinja2._compat import text_type, string_types, integer_types, abc\nimport decimal\n\nnumber_re = re.compile(r'^-?\\d+(\\.\\d+)?$')\nregex_type = type(number_re)\n\n\ntest_callable = callable\n\n\ndef test_odd(value):\n    \"\"\"Return true if the variable is odd.\"\"\"\n    return value % 2 == 1\n\n\ndef test_even(value):\n    \"\"\"Return true if the variable is even.\"\"\"\n    return value % 2 == 0\n\n\ndef test_divisibleby(value, num):\n    \"\"\"Check if a variable is divisible by a number.\"\"\"\n    return value % num == 0\n\n\ndef test_defined(value):\n    \"\"\"Return true if the variable is defined:\n\n    .. sourcecode:: jinja\n\n        {% if variable is defined %}\n            value of variable: {{ variable }}\n        {% else %}\n            variable is not defined\n        {% endif %}\n\n    See the :func:`default` filter for a simple way to set undefined\n    variables.\n    \"\"\"\n    return not isinstance(value, Undefined)\n\n\ndef test_undefined(value):\n    \"\"\"Like :func:`defined` but the other way round.\"\"\"\n    return isinstance(value, Undefined)\n\n\ndef test_none(value):\n    \"\"\"Return true if the variable is none.\"\"\"\n    return value is None\n\n\ndef test_lower(value):\n    \"\"\"Return true if the variable is lowercased.\"\"\"\n    return text_type(value).islower()\n\n\ndef test_upper(value):\n    \"\"\"Return true if the variable is uppercased.\"\"\"\n    return text_type(value).isupper()\n\n\ndef test_string(value):\n    \"\"\"Return true if the object is a string.\"\"\"\n    return isinstance(value, string_types)\n\n\ndef test_mapping(value):\n    \"\"\"Return true if the object is a mapping (dict etc.).\n\n    .. versionadded:: 2.6\n    \"\"\"\n    return isinstance(value, abc.Mapping)\n\n\ndef test_number(value):\n    \"\"\"Return true if the variable is a number.\"\"\"\n    return isinstance(value, integer_types + (float, complex, decimal.Decimal))\n\n\ndef test_sequence(value):\n    \"\"\"Return true if the variable is a sequence. Sequences are variables\n    that are iterable.\n    \"\"\"\n    try:\n        len(value)\n        value.__getitem__\n    except:\n        return False\n    return True\n\n\ndef test_sameas(value, other):\n    \"\"\"Check if an object points to the same memory address than another\n    object:\n\n    .. sourcecode:: jinja\n\n        {% if foo.attribute is sameas false %}\n            the foo attribute really is the `False` singleton\n        {% endif %}\n    \"\"\"\n    return value is other\n\n\ndef test_iterable(value):\n    \"\"\"Check if it's possible to iterate over an object.\"\"\"\n    try:\n        iter(value)\n    except TypeError:\n        return False\n    return True\n\n\ndef test_escaped(value):\n    \"\"\"Check if the value is escaped.\"\"\"\n    return hasattr(value, '__html__')\n\n\ndef test_in(value, seq):\n    \"\"\"Check if value is in seq.\n\n    .. versionadded:: 2.10\n    \"\"\"\n    return value in seq\n\n\nTESTS = {\n    'odd':              test_odd,\n    'even':             test_even,\n    'divisibleby':      test_divisibleby,\n    'defined':          test_defined,\n    'undefined':        test_undefined,\n    'none':             test_none,\n    'lower':            test_lower,\n    'upper':            test_upper,\n    'string':           test_string,\n    'mapping':          test_mapping,\n    'number':           test_number,\n    'sequence':         test_sequence,\n    'iterable':         test_iterable,\n    'callable':         test_callable,\n    'sameas':           test_sameas,\n    'escaped':          test_escaped,\n    'in':               test_in,\n    '==':               operator.eq,\n    'eq':               operator.eq,\n    'equalto':          operator.eq,\n    '!=':               operator.ne,\n    'ne':               operator.ne,\n    '>':                operator.gt,\n    'gt':               operator.gt,\n    'greaterthan':      operator.gt,\n    'ge':               operator.ge,\n    '>=':               operator.ge,\n    '<':                operator.lt,\n    'lt':               operator.lt,\n    'lessthan':         operator.lt,\n    '<=':               operator.le,\n    'le':               operator.le,\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/utils.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.utils\n    ~~~~~~~~~~~~\n\n    Utility functions.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD, see LICENSE for more details.\n\"\"\"\nimport re\nimport json\nimport errno\nfrom collections import deque\nfrom threading import Lock\nfrom jinja2._compat import text_type, string_types, implements_iterator, \\\n     url_quote, abc\n\n\n_word_split_re = re.compile(r'(\\s+)')\n_punctuation_re = re.compile(\n    '^(?P<lead>(?:%s)*)(?P<middle>.*?)(?P<trail>(?:%s)*)$' % (\n        '|'.join(map(re.escape, ('(', '<', '&lt;'))),\n        '|'.join(map(re.escape, ('.', ',', ')', '>', '\\n', '&gt;')))\n    )\n)\n_simple_email_re = re.compile(r'^\\S+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+$')\n_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')\n_entity_re = re.compile(r'&([^;]+);')\n_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\n_digits = '0123456789'\n\n# special singleton representing missing values for the runtime\nmissing = type('MissingType', (), {'__repr__': lambda x: 'missing'})()\n\n# internal code\ninternal_code = set()\n\nconcat = u''.join\n\n_slash_escape = '\\\\/' not in json.dumps('/')\n\n\ndef contextfunction(f):\n    \"\"\"This decorator can be used to mark a function or method context callable.\n    A context callable is passed the active :class:`Context` as first argument when\n    called from the template.  This is useful if a function wants to get access\n    to the context or functions provided on the context object.  For example\n    a function that returns a sorted list of template variables the current\n    template exports could look like this::\n\n        @contextfunction\n        def get_exported_names(context):\n            return sorted(context.exported_vars)\n    \"\"\"\n    f.contextfunction = True\n    return f\n\n\ndef evalcontextfunction(f):\n    \"\"\"This decorator can be used to mark a function or method as an eval\n    context callable.  This is similar to the :func:`contextfunction`\n    but instead of passing the context, an evaluation context object is\n    passed.  For more information about the eval context, see\n    :ref:`eval-context`.\n\n    .. versionadded:: 2.4\n    \"\"\"\n    f.evalcontextfunction = True\n    return f\n\n\ndef environmentfunction(f):\n    \"\"\"This decorator can be used to mark a function or method as environment\n    callable.  This decorator works exactly like the :func:`contextfunction`\n    decorator just that the first argument is the active :class:`Environment`\n    and not context.\n    \"\"\"\n    f.environmentfunction = True\n    return f\n\n\ndef internalcode(f):\n    \"\"\"Marks the function as internally used\"\"\"\n    internal_code.add(f.__code__)\n    return f\n\n\ndef is_undefined(obj):\n    \"\"\"Check if the object passed is undefined.  This does nothing more than\n    performing an instance check against :class:`Undefined` but looks nicer.\n    This can be used for custom filters or tests that want to react to\n    undefined variables.  For example a custom default filter can look like\n    this::\n\n        def default(var, default=''):\n            if is_undefined(var):\n                return default\n            return var\n    \"\"\"\n    from jinja2.runtime import Undefined\n    return isinstance(obj, Undefined)\n\n\ndef consume(iterable):\n    \"\"\"Consumes an iterable without doing anything with it.\"\"\"\n    for event in iterable:\n        pass\n\n\ndef clear_caches():\n    \"\"\"Jinja2 keeps internal caches for environments and lexers.  These are\n    used so that Jinja2 doesn't have to recreate environments and lexers all\n    the time.  Normally you don't have to care about that but if you are\n    measuring memory consumption you may want to clean the caches.\n    \"\"\"\n    from jinja2.environment import _spontaneous_environments\n    from jinja2.lexer import _lexer_cache\n    _spontaneous_environments.clear()\n    _lexer_cache.clear()\n\n\ndef import_string(import_name, silent=False):\n    \"\"\"Imports an object based on a string.  This is useful if you want to\n    use import paths as endpoints or something similar.  An import path can\n    be specified either in dotted notation (``xml.sax.saxutils.escape``)\n    or with a colon as object delimiter (``xml.sax.saxutils:escape``).\n\n    If the `silent` is True the return value will be `None` if the import\n    fails.\n\n    :return: imported object\n    \"\"\"\n    try:\n        if ':' in import_name:\n            module, obj = import_name.split(':', 1)\n        elif '.' in import_name:\n            items = import_name.split('.')\n            module = '.'.join(items[:-1])\n            obj = items[-1]\n        else:\n            return __import__(import_name)\n        return getattr(__import__(module, None, None, [obj]), obj)\n    except (ImportError, AttributeError):\n        if not silent:\n            raise\n\n\ndef open_if_exists(filename, mode='rb'):\n    \"\"\"Returns a file descriptor for the filename if that file exists,\n    otherwise `None`.\n    \"\"\"\n    try:\n        return open(filename, mode)\n    except IOError as e:\n        if e.errno not in (errno.ENOENT, errno.EISDIR, errno.EINVAL):\n            raise\n\n\ndef object_type_repr(obj):\n    \"\"\"Returns the name of the object's type.  For some recognized\n    singletons the name of the object is returned instead. (For\n    example for `None` and `Ellipsis`).\n    \"\"\"\n    if obj is None:\n        return 'None'\n    elif obj is Ellipsis:\n        return 'Ellipsis'\n    # __builtin__ in 2.x, builtins in 3.x\n    if obj.__class__.__module__ in ('__builtin__', 'builtins'):\n        name = obj.__class__.__name__\n    else:\n        name = obj.__class__.__module__ + '.' + obj.__class__.__name__\n    return '%s object' % name\n\n\ndef pformat(obj, verbose=False):\n    \"\"\"Prettyprint an object.  Either use the `pretty` library or the\n    builtin `pprint`.\n    \"\"\"\n    try:\n        from pretty import pretty\n        return pretty(obj, verbose=verbose)\n    except ImportError:\n        from pprint import pformat\n        return pformat(obj)\n\n\ndef urlize(text, trim_url_limit=None, rel=None, target=None):\n    \"\"\"Converts any URLs in text into clickable links. Works on http://,\n    https:// and www. links. Links can have trailing punctuation (periods,\n    commas, close-parens) and leading punctuation (opening parens) and\n    it'll still do the right thing.\n\n    If trim_url_limit is not None, the URLs in link text will be limited\n    to trim_url_limit characters.\n\n    If nofollow is True, the URLs in link text will get a rel=\"nofollow\"\n    attribute.\n\n    If target is not None, a target attribute will be added to the link.\n    \"\"\"\n    trim_url = lambda x, limit=trim_url_limit: limit is not None \\\n                         and (x[:limit] + (len(x) >=limit and '...'\n                         or '')) or x\n    words = _word_split_re.split(text_type(escape(text)))\n    rel_attr = rel and ' rel=\"%s\"' % text_type(escape(rel)) or ''\n    target_attr = target and ' target=\"%s\"' % escape(target) or ''\n\n    for i, word in enumerate(words):\n        match = _punctuation_re.match(word)\n        if match:\n            lead, middle, trail = match.groups()\n            if middle.startswith('www.') or (\n                '@' not in middle and\n                not middle.startswith('http://') and\n                not middle.startswith('https://') and\n                len(middle) > 0 and\n                middle[0] in _letters + _digits and (\n                    middle.endswith('.org') or\n                    middle.endswith('.net') or\n                    middle.endswith('.com')\n                )):\n                middle = '<a href=\"http://%s\"%s%s>%s</a>' % (middle,\n                    rel_attr, target_attr, trim_url(middle))\n            if middle.startswith('http://') or \\\n               middle.startswith('https://'):\n                middle = '<a href=\"%s\"%s%s>%s</a>' % (middle,\n                    rel_attr, target_attr, trim_url(middle))\n            if '@' in middle and not middle.startswith('www.') and \\\n               not ':' in middle and _simple_email_re.match(middle):\n                middle = '<a href=\"mailto:%s\">%s</a>' % (middle, middle)\n            if lead + middle + trail != word:\n                words[i] = lead + middle + trail\n    return u''.join(words)\n\n\ndef generate_lorem_ipsum(n=5, html=True, min=20, max=100):\n    \"\"\"Generate some lorem ipsum for the template.\"\"\"\n    from jinja2.constants import LOREM_IPSUM_WORDS\n    from random import choice, randrange\n    words = LOREM_IPSUM_WORDS.split()\n    result = []\n\n    for _ in range(n):\n        next_capitalized = True\n        last_comma = last_fullstop = 0\n        word = None\n        last = None\n        p = []\n\n        # each paragraph contains out of 20 to 100 words.\n        for idx, _ in enumerate(range(randrange(min, max))):\n            while True:\n                word = choice(words)\n                if word != last:\n                    last = word\n                    break\n            if next_capitalized:\n                word = word.capitalize()\n                next_capitalized = False\n            # add commas\n            if idx - randrange(3, 8) > last_comma:\n                last_comma = idx\n                last_fullstop += 2\n                word += ','\n            # add end of sentences\n            if idx - randrange(10, 20) > last_fullstop:\n                last_comma = last_fullstop = idx\n                word += '.'\n                next_capitalized = True\n            p.append(word)\n\n        # ensure that the paragraph ends with a dot.\n        p = u' '.join(p)\n        if p.endswith(','):\n            p = p[:-1] + '.'\n        elif not p.endswith('.'):\n            p += '.'\n        result.append(p)\n\n    if not html:\n        return u'\\n\\n'.join(result)\n    return Markup(u'\\n'.join(u'<p>%s</p>' % escape(x) for x in result))\n\n\ndef unicode_urlencode(obj, charset='utf-8', for_qs=False):\n    \"\"\"URL escapes a single bytestring or unicode string with the\n    given charset if applicable to URL safe quoting under all rules\n    that need to be considered under all supported Python versions.\n\n    If non strings are provided they are converted to their unicode\n    representation first.\n    \"\"\"\n    if not isinstance(obj, string_types):\n        obj = text_type(obj)\n    if isinstance(obj, text_type):\n        obj = obj.encode(charset)\n    safe = not for_qs and b'/' or b''\n    rv = text_type(url_quote(obj, safe))\n    if for_qs:\n        rv = rv.replace('%20', '+')\n    return rv\n\n\nclass LRUCache(object):\n    \"\"\"A simple LRU Cache implementation.\"\"\"\n\n    # this is fast for small capacities (something below 1000) but doesn't\n    # scale.  But as long as it's only used as storage for templates this\n    # won't do any harm.\n\n    def __init__(self, capacity):\n        self.capacity = capacity\n        self._mapping = {}\n        self._queue = deque()\n        self._postinit()\n\n    def _postinit(self):\n        # alias all queue methods for faster lookup\n        self._popleft = self._queue.popleft\n        self._pop = self._queue.pop\n        self._remove = self._queue.remove\n        self._wlock = Lock()\n        self._append = self._queue.append\n\n    def __getstate__(self):\n        return {\n            'capacity':     self.capacity,\n            '_mapping':     self._mapping,\n            '_queue':       self._queue\n        }\n\n    def __setstate__(self, d):\n        self.__dict__.update(d)\n        self._postinit()\n\n    def __getnewargs__(self):\n        return (self.capacity,)\n\n    def copy(self):\n        \"\"\"Return a shallow copy of the instance.\"\"\"\n        rv = self.__class__(self.capacity)\n        rv._mapping.update(self._mapping)\n        rv._queue = deque(self._queue)\n        return rv\n\n    def get(self, key, default=None):\n        \"\"\"Return an item from the cache dict or `default`\"\"\"\n        try:\n            return self[key]\n        except KeyError:\n            return default\n\n    def setdefault(self, key, default=None):\n        \"\"\"Set `default` if the key is not in the cache otherwise\n        leave unchanged. Return the value of this key.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            try:\n                return self[key]\n            except KeyError:\n                self[key] = default\n                return default\n        finally:\n            self._wlock.release()\n\n    def clear(self):\n        \"\"\"Clear the cache.\"\"\"\n        self._wlock.acquire()\n        try:\n            self._mapping.clear()\n            self._queue.clear()\n        finally:\n            self._wlock.release()\n\n    def __contains__(self, key):\n        \"\"\"Check if a key exists in this cache.\"\"\"\n        return key in self._mapping\n\n    def __len__(self):\n        \"\"\"Return the current size of the cache.\"\"\"\n        return len(self._mapping)\n\n    def __repr__(self):\n        return '<%s %r>' % (\n            self.__class__.__name__,\n            self._mapping\n        )\n\n    def __getitem__(self, key):\n        \"\"\"Get an item from the cache. Moves the item up so that it has the\n        highest priority then.\n\n        Raise a `KeyError` if it does not exist.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            rv = self._mapping[key]\n            if self._queue[-1] != key:\n                try:\n                    self._remove(key)\n                except ValueError:\n                    # if something removed the key from the container\n                    # when we read, ignore the ValueError that we would\n                    # get otherwise.\n                    pass\n                self._append(key)\n            return rv\n        finally:\n            self._wlock.release()\n\n    def __setitem__(self, key, value):\n        \"\"\"Sets the value for an item. Moves the item up so that it\n        has the highest priority then.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            if key in self._mapping:\n                self._remove(key)\n            elif len(self._mapping) == self.capacity:\n                del self._mapping[self._popleft()]\n            self._append(key)\n            self._mapping[key] = value\n        finally:\n            self._wlock.release()\n\n    def __delitem__(self, key):\n        \"\"\"Remove an item from the cache dict.\n        Raise a `KeyError` if it does not exist.\n        \"\"\"\n        self._wlock.acquire()\n        try:\n            del self._mapping[key]\n            try:\n                self._remove(key)\n            except ValueError:\n                # __getitem__ is not locked, it might happen\n                pass\n        finally:\n            self._wlock.release()\n\n    def items(self):\n        \"\"\"Return a list of items.\"\"\"\n        result = [(key, self._mapping[key]) for key in list(self._queue)]\n        result.reverse()\n        return result\n\n    def iteritems(self):\n        \"\"\"Iterate over all items.\"\"\"\n        return iter(self.items())\n\n    def values(self):\n        \"\"\"Return a list of all values.\"\"\"\n        return [x[1] for x in self.items()]\n\n    def itervalue(self):\n        \"\"\"Iterate over all values.\"\"\"\n        return iter(self.values())\n\n    def keys(self):\n        \"\"\"Return a list of all keys ordered by most recent usage.\"\"\"\n        return list(self)\n\n    def iterkeys(self):\n        \"\"\"Iterate over all keys in the cache dict, ordered by\n        the most recent usage.\n        \"\"\"\n        return reversed(tuple(self._queue))\n\n    __iter__ = iterkeys\n\n    def __reversed__(self):\n        \"\"\"Iterate over the values in the cache dict, oldest items\n        coming first.\n        \"\"\"\n        return iter(tuple(self._queue))\n\n    __copy__ = copy\n\n\nabc.MutableMapping.register(LRUCache)\n\n\ndef select_autoescape(enabled_extensions=('html', 'htm', 'xml'),\n                      disabled_extensions=(),\n                      default_for_string=True,\n                      default=False):\n    \"\"\"Intelligently sets the initial value of autoescaping based on the\n    filename of the template.  This is the recommended way to configure\n    autoescaping if you do not want to write a custom function yourself.\n\n    If you want to enable it for all templates created from strings or\n    for all templates with `.html` and `.xml` extensions::\n\n        from jinja2 import Environment, select_autoescape\n        env = Environment(autoescape=select_autoescape(\n            enabled_extensions=('html', 'xml'),\n            default_for_string=True,\n        ))\n\n    Example configuration to turn it on at all times except if the template\n    ends with `.txt`::\n\n        from jinja2 import Environment, select_autoescape\n        env = Environment(autoescape=select_autoescape(\n            disabled_extensions=('txt',),\n            default_for_string=True,\n            default=True,\n        ))\n\n    The `enabled_extensions` is an iterable of all the extensions that\n    autoescaping should be enabled for.  Likewise `disabled_extensions` is\n    a list of all templates it should be disabled for.  If a template is\n    loaded from a string then the default from `default_for_string` is used.\n    If nothing matches then the initial value of autoescaping is set to the\n    value of `default`.\n\n    For security reasons this function operates case insensitive.\n\n    .. versionadded:: 2.9\n    \"\"\"\n    enabled_patterns = tuple('.' + x.lstrip('.').lower()\n                             for x in enabled_extensions)\n    disabled_patterns = tuple('.' + x.lstrip('.').lower()\n                              for x in disabled_extensions)\n    def autoescape(template_name):\n        if template_name is None:\n            return default_for_string\n        template_name = template_name.lower()\n        if template_name.endswith(enabled_patterns):\n            return True\n        if template_name.endswith(disabled_patterns):\n            return False\n        return default\n    return autoescape\n\n\ndef htmlsafe_json_dumps(obj, dumper=None, **kwargs):\n    \"\"\"Works exactly like :func:`dumps` but is safe for use in ``<script>``\n    tags.  It accepts the same arguments and returns a JSON string.  Note that\n    this is available in templates through the ``|tojson`` filter which will\n    also mark the result as safe.  Due to how this function escapes certain\n    characters this is safe even if used outside of ``<script>`` tags.\n\n    The following characters are escaped in strings:\n\n    -   ``<``\n    -   ``>``\n    -   ``&``\n    -   ``'``\n\n    This makes it safe to embed such strings in any place in HTML with the\n    notable exception of double quoted attributes.  In that case single\n    quote your attributes or HTML escape it in addition.\n    \"\"\"\n    if dumper is None:\n        dumper = json.dumps\n    rv = dumper(obj, **kwargs) \\\n        .replace(u'<', u'\\\\u003c') \\\n        .replace(u'>', u'\\\\u003e') \\\n        .replace(u'&', u'\\\\u0026') \\\n        .replace(u\"'\", u'\\\\u0027')\n    return Markup(rv)\n\n\n@implements_iterator\nclass Cycler(object):\n    \"\"\"A cycle helper for templates.\"\"\"\n\n    def __init__(self, *items):\n        if not items:\n            raise RuntimeError('at least one item has to be provided')\n        self.items = items\n        self.reset()\n\n    def reset(self):\n        \"\"\"Resets the cycle.\"\"\"\n        self.pos = 0\n\n    @property\n    def current(self):\n        \"\"\"Returns the current item.\"\"\"\n        return self.items[self.pos]\n\n    def next(self):\n        \"\"\"Goes one item ahead and returns it.\"\"\"\n        rv = self.current\n        self.pos = (self.pos + 1) % len(self.items)\n        return rv\n\n    __next__ = next\n\n\nclass Joiner(object):\n    \"\"\"A joining helper for templates.\"\"\"\n\n    def __init__(self, sep=u', '):\n        self.sep = sep\n        self.used = False\n\n    def __call__(self):\n        if not self.used:\n            self.used = True\n            return u''\n        return self.sep\n\n\nclass Namespace(object):\n    \"\"\"A namespace object that can hold arbitrary attributes.  It may be\n    initialized from a dictionary or with keyword argments.\"\"\"\n\n    def __init__(*args, **kwargs):\n        self, args = args[0], args[1:]\n        self.__attrs = dict(*args, **kwargs)\n\n    def __getattribute__(self, name):\n        if name == '_Namespace__attrs':\n            return object.__getattribute__(self, name)\n        try:\n            return self.__attrs[name]\n        except KeyError:\n            raise AttributeError(name)\n\n    def __setitem__(self, name, value):\n        self.__attrs[name] = value\n\n    def __repr__(self):\n        return '<Namespace %r>' % self.__attrs\n\n\n# does this python version support async for in and async generators?\ntry:\n    exec('async def _():\\n async for _ in ():\\n  yield _')\n    have_async_gen = True\nexcept SyntaxError:\n    have_async_gen = False\n\n\n# Imported here because that's where it was in the past\nfrom markupsafe import Markup, escape, soft_unicode\n"
  },
  {
    "path": "nuitka/build/inline_copy/jinja2_35/jinja2/visitor.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n    jinja2.visitor\n    ~~~~~~~~~~~~~~\n\n    This module implements a visitor for the nodes.\n\n    :copyright: (c) 2017 by the Jinja Team.\n    :license: BSD.\n\"\"\"\nfrom jinja2.nodes import Node\n\n\nclass NodeVisitor(object):\n    \"\"\"Walks the abstract syntax tree and call visitor functions for every\n    node found.  The visitor functions may return values which will be\n    forwarded by the `visit` method.\n\n    Per default the visitor functions for the nodes are ``'visit_'`` +\n    class name of the node.  So a `TryFinally` node visit function would\n    be `visit_TryFinally`.  This behavior can be changed by overriding\n    the `get_visitor` function.  If no visitor function exists for a node\n    (return value `None`) the `generic_visit` visitor is used instead.\n    \"\"\"\n\n    def get_visitor(self, node):\n        \"\"\"Return the visitor function for this node or `None` if no visitor\n        exists for this node.  In that case the generic visit function is\n        used instead.\n        \"\"\"\n        method = 'visit_' + node.__class__.__name__\n        return getattr(self, method, None)\n\n    def visit(self, node, *args, **kwargs):\n        \"\"\"Visit a node.\"\"\"\n        f = self.get_visitor(node)\n        if f is not None:\n            return f(node, *args, **kwargs)\n        return self.generic_visit(node, *args, **kwargs)\n\n    def generic_visit(self, node, *args, **kwargs):\n        \"\"\"Called if no explicit visitor function exists for a node.\"\"\"\n        for node in node.iter_child_nodes():\n            self.visit(node, *args, **kwargs)\n\n\nclass NodeTransformer(NodeVisitor):\n    \"\"\"Walks the abstract syntax tree and allows modifications of nodes.\n\n    The `NodeTransformer` will walk the AST and use the return value of the\n    visitor functions to replace or remove the old node.  If the return\n    value of the visitor function is `None` the node will be removed\n    from the previous location otherwise it's replaced with the return\n    value.  The return value may be the original node in which case no\n    replacement takes place.\n    \"\"\"\n\n    def generic_visit(self, node, *args, **kwargs):\n        for field, old_value in node.iter_fields():\n            if isinstance(old_value, list):\n                new_values = []\n                for value in old_value:\n                    if isinstance(value, Node):\n                        value = self.visit(value, *args, **kwargs)\n                        if value is None:\n                            continue\n                        elif not isinstance(value, Node):\n                            new_values.extend(value)\n                            continue\n                    new_values.append(value)\n                old_value[:] = new_values\n            elif isinstance(old_value, Node):\n                new_node = self.visit(old_value, *args, **kwargs)\n                if new_node is None:\n                    delattr(node, field)\n                else:\n                    setattr(node, field, new_node)\n        return node\n\n    def visit_list(self, node, *args, **kwargs):\n        \"\"\"As transformers may return lists in some places this method\n        can be used to enforce a list as return value.\n        \"\"\"\n        rv = self.visit(node, *args, **kwargs)\n        if not isinstance(rv, list):\n            rv = [rv]\n        return rv\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Action.py",
    "content": "\"\"\"SCons.Action\n\nThis encapsulates information about executing any sort of action that\ncan build one or more target Nodes (typically files) from one or more\nsource Nodes (also typically files) given a specific Environment.\n\nThe base class here is ActionBase.  The base class supplies just a few\nOO utility methods and some generic methods for displaying information\nabout an Action in response to the various commands that control printing.\n\nA second-level base class is _ActionAction.  This extends ActionBase\nby providing the methods that can be used to show and perform an\naction.  True Action objects will subclass _ActionAction; Action\nfactory class objects will subclass ActionBase.\n\nThe heavy lifting is handled by subclasses for the different types of\nactions we might execute:\n\n    CommandAction\n    CommandGeneratorAction\n    FunctionAction\n    ListAction\n\nThe subclasses supply the following public interface methods used by\nother modules:\n\n    __call__()\n        THE public interface, \"calling\" an Action object executes the\n        command or Python function.  This also takes care of printing\n        a pre-substitution command for debugging purposes.\n\n    get_contents()\n        Fetches the \"contents\" of an Action for signature calculation\n        plus the varlist.  This is what gets MD5 checksummed to decide\n        if a target needs to be rebuilt because its action changed.\n\n    genstring()\n        Returns a string representation of the Action *without*\n        command substitution, but allows a CommandGeneratorAction to\n        generate the right action based on the specified target,\n        source and env.  This is used by the Signature subsystem\n        (through the Executor) to obtain an (imprecise) representation\n        of the Action operation for informative purposes.\n\n\nSubclasses also supply the following methods for internal use within\nthis module:\n\n    __str__()\n        Returns a string approximation of the Action; no variable\n        substitution is performed.\n\n    execute()\n        The internal method that really, truly, actually handles the\n        execution of a command or Python function.  This is used so\n        that the __call__() methods can take care of displaying any\n        pre-substitution representations, and *then* execute an action\n        without worrying about the specific Actions involved.\n\n    get_presig()\n        Fetches the \"contents\" of a subclass for signature calculation.\n        The varlist is added to this to produce the Action's contents.\n\n    strfunction()\n        Returns a substituted string representation of the Action.\n        This is used by the _ActionAction.show() command to display the\n        command/function that will be executed to generate the target(s).\n\nThere is a related independent ActionCaller class that looks like a\nregular Action, and which serves as a wrapper for arbitrary functions\nthat we want to let the user specify the arguments to now, but actually\nexecute later (when an out-of-date check determines that it's needed to\nbe executed, for example).  Objects of this class are returned by an\nActionFactory class that provides a __call__() method as a convenient\nway for wrapping up the functions.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Action.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport dis\nimport os\n# compat layer imports \"cPickle\" for us if it's available.\nimport pickle\nimport re\nimport sys\nimport subprocess\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Executor\nimport SCons.Util\nimport SCons.Subst\n\n# we use these a lot, so try to optimize them\nis_String = SCons.Util.is_String\nis_List = SCons.Util.is_List\n\nclass _null(object):\n    pass\n\nprint_actions = 1\nexecute_actions = 1\nprint_actions_presub = 0\n\ndef rfile(n):\n    try:\n        return n.rfile()\n    except AttributeError:\n        return n\n\ndef default_exitstatfunc(s):\n    return s\n\ntry:\n    SET_LINENO = dis.SET_LINENO\n    HAVE_ARGUMENT = dis.HAVE_ARGUMENT\nexcept AttributeError:\n    remove_set_lineno_codes = lambda x: x\nelse:\n    def remove_set_lineno_codes(code):\n        result = []\n        n = len(code)\n        i = 0\n        while i < n:\n            c = code[i]\n            op = ord(c)\n            if op >= HAVE_ARGUMENT:\n                if op != SET_LINENO:\n                    result.append(code[i:i+3])\n                i = i+3\n            else:\n                result.append(c)\n                i = i+1\n        return ''.join(result)\n\nstrip_quotes = re.compile('^[\\'\"](.*)[\\'\"]$')\n\n\ndef _callable_contents(obj):\n    \"\"\"Return the signature contents of a callable Python object.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.im_func)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.im_func)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                    # Test if obj is a function object.\n                    return _function_contents(obj)\n\n\ndef _object_contents(obj):\n    \"\"\"Return the signature contents of any Python object.\n\n    We have to handle the case where object contains a code object\n    since it can be pickled directly.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.im_func)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.im_func)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                try:\n                    # Test if obj is a function object.\n                    return _function_contents(obj)\n\n                except AttributeError:\n                    # Should be a pickable Python object.\n                    try:\n                        return pickle.dumps(obj)\n                    except (pickle.PicklingError, TypeError):\n                        # This is weird, but it seems that nested classes\n                        # are unpickable. The Python docs say it should\n                        # always be a PicklingError, but some Python\n                        # versions seem to return TypeError.  Just do\n                        # the best we can.\n                        return str(obj)\n\n\ndef _code_contents(code):\n    \"\"\"Return the signature contents of a code object.\n\n    By providing direct access to the code object of the\n    function, Python makes this extremely easy.  Hooray!\n\n    Unfortunately, older versions of Python include line\n    number indications in the compiled byte code.  Boo!\n    So we remove the line number byte codes to prevent\n    recompilations from moving a Python function.\n    \"\"\"\n\n    contents = []\n\n    # The code contents depends on the number of local variables\n    # but not their actual names.\n    contents.append(\"%s,%s\" % (code.co_argcount, len(code.co_varnames)))\n    try:\n        contents.append(\",%s,%s\" % (len(code.co_cellvars), len(code.co_freevars)))\n    except AttributeError:\n        # Older versions of Python do not support closures.\n        contents.append(\",0,0\")\n\n    # The code contents depends on any constants accessed by the\n    # function. Note that we have to call _object_contents on each\n    # constants because the code object of nested functions can\n    # show-up among the constants.\n    #\n    # Note that we also always ignore the first entry of co_consts\n    # which contains the function doc string. We assume that the\n    # function does not access its doc string.\n    contents.append(',(' + ','.join(map(_object_contents,code.co_consts[1:])) + ')')\n\n    # The code contents depends on the variable names used to\n    # accessed global variable, as changing the variable name changes\n    # the variable actually accessed and therefore changes the\n    # function result.\n    contents.append(',(' + ','.join(map(_object_contents,code.co_names)) + ')')\n\n\n    # The code contents depends on its actual code!!!\n    contents.append(',(' + str(remove_set_lineno_codes(code.co_code)) + ')')\n\n    return ''.join(contents)\n\n\ndef _function_contents(func):\n    \"\"\"Return the signature contents of a function.\"\"\"\n\n    contents = [_code_contents(func.func_code)]\n\n    # The function contents depends on the value of defaults arguments\n    if func.func_defaults:\n        contents.append(',(' + ','.join(map(_object_contents,func.func_defaults)) + ')')\n    else:\n        contents.append(',()')\n\n    # The function contents depends on the closure captured cell values.\n    try:\n        closure = func.func_closure or []\n    except AttributeError:\n        # Older versions of Python do not support closures.\n        closure = []\n\n    #xxx = [_object_contents(x.cell_contents) for x in closure]\n    try:\n        xxx = [_object_contents(x.cell_contents) for x in closure]\n    except AttributeError:\n        xxx = []\n    contents.append(',(' + ','.join(xxx) + ')')\n\n    return ''.join(contents)\n\n\ndef _actionAppend(act1, act2):\n    # This function knows how to slap two actions together.\n    # Mainly, it handles ListActions by concatenating into\n    # a single ListAction.\n    a1 = Action(act1)\n    a2 = Action(act2)\n    if a1 is None:\n        return a2\n    if a2 is None:\n        return a1\n    if isinstance(a1, ListAction):\n        if isinstance(a2, ListAction):\n            return ListAction(a1.list + a2.list)\n        else:\n            return ListAction(a1.list + [ a2 ])\n    else:\n        if isinstance(a2, ListAction):\n            return ListAction([ a1 ] + a2.list)\n        else:\n            return ListAction([ a1, a2 ])\n\ndef _do_create_keywords(args, kw):\n    \"\"\"This converts any arguments after the action argument into\n    their equivalent keywords and adds them to the kw argument.\n    \"\"\"\n    v = kw.get('varlist', ())\n    # prevent varlist=\"FOO\" from being interpreted as ['F', 'O', 'O']\n    if is_String(v): v = (v,)\n    kw['varlist'] = tuple(v)\n    if args:\n        # turn positional args into equivalent keywords\n        cmdstrfunc = args[0]\n        if cmdstrfunc is None or is_String(cmdstrfunc):\n            kw['cmdstr'] = cmdstrfunc\n        elif callable(cmdstrfunc):\n            kw['strfunction'] = cmdstrfunc\n        else:\n            raise SCons.Errors.UserError(\n                'Invalid command display variable type. '\n                'You must either pass a string or a callback which '\n                'accepts (target, source, env) as parameters.')\n        if len(args) > 1:\n            kw['varlist'] = tuple(SCons.Util.flatten(args[1:])) + kw['varlist']\n    if kw.get('strfunction', _null) is not _null \\\n                      and kw.get('cmdstr', _null) is not _null:\n        raise SCons.Errors.UserError(\n            'Cannot have both strfunction and cmdstr args to Action()')\n\ndef _do_create_action(act, kw):\n    \"\"\"This is the actual \"implementation\" for the\n    Action factory method, below.  This handles the\n    fact that passing lists to Action() itself has\n    different semantics than passing lists as elements\n    of lists.\n\n    The former will create a ListAction, the latter\n    will create a CommandAction by converting the inner\n    list elements to strings.\"\"\"\n\n    if isinstance(act, ActionBase):\n        return act\n\n    if is_List(act):\n        return CommandAction(act, **kw)\n\n    if callable(act):\n        try:\n            gen = kw['generator']\n            del kw['generator']\n        except KeyError:\n            gen = 0\n        if gen:\n            action_type = CommandGeneratorAction\n        else:\n            action_type = FunctionAction\n        return action_type(act, kw)\n\n    if is_String(act):\n        var=SCons.Util.get_environment_var(act)\n        if var:\n            # This looks like a string that is purely an Environment\n            # variable reference, like \"$FOO\" or \"${FOO}\".  We do\n            # something special here...we lazily evaluate the contents\n            # of that Environment variable, so a user could put something\n            # like a function or a CommandGenerator in that variable\n            # instead of a string.\n            return LazyAction(var, kw)\n        commands = str(act).split('\\n')\n        if len(commands) == 1:\n            return CommandAction(commands[0], **kw)\n        # The list of string commands may include a LazyAction, so we\n        # reprocess them via _do_create_list_action.\n        return _do_create_list_action(commands, kw)\n    # Catch a common error case with a nice message:\n    if isinstance(act, int) or isinstance(act, float):\n        raise TypeError(\"Don't know how to create an Action from a number (%s)\"%act)\n    # Else fail silently (???)\n    return None\n\ndef _do_create_list_action(act, kw):\n    \"\"\"A factory for list actions.  Convert the input list into Actions\n    and then wrap them in a ListAction.\"\"\"\n    acts = []\n    for a in act:\n        aa = _do_create_action(a, kw)\n        if aa is not None: acts.append(aa)\n    if not acts:\n        return ListAction([])\n    elif len(acts) == 1:\n        return acts[0]\n    else:\n        return ListAction(acts)\n\ndef Action(act, *args, **kw):\n    \"\"\"A factory for action objects.\"\"\"\n    # Really simple: the _do_create_* routines do the heavy lifting.\n    _do_create_keywords(args, kw)\n    if is_List(act):\n        return _do_create_list_action(act, kw)\n    return _do_create_action(act, kw)\n\nclass ActionBase(object):\n    \"\"\"Base class for all types of action objects that can be held by\n    other objects (Builders, Executors, etc.)  This provides the\n    common methods for manipulating and combining those actions.\"\"\"\n\n    def __cmp__(self, other):\n        return cmp(self.__dict__, other)\n\n    def no_batch_key(self, env, target, source):\n        return None\n\n    batch_key = no_batch_key\n\n    def genstring(self, target, source, env):\n        return str(self)\n\n    def get_contents(self, target, source, env):\n        result = [ self.get_presig(target, source, env) ]\n        # This should never happen, as the Action() factory should wrap\n        # the varlist, but just in case an action is created directly,\n        # we duplicate this check here.\n        vl = self.get_varlist(target, source, env)\n        if is_String(vl): vl = (vl,)\n        for v in vl:\n            # do the subst this way to ignore $(...$) parts:\n            result.append(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))\n        return ''.join(result)\n\n    def __add__(self, other):\n        return _actionAppend(self, other)\n\n    def __radd__(self, other):\n        return _actionAppend(other, self)\n\n    def presub_lines(self, env):\n        # CommandGeneratorAction needs a real environment\n        # in order to return the proper string here, since\n        # it may call LazyAction, which looks up a key\n        # in that env.  So we temporarily remember the env here,\n        # and CommandGeneratorAction will use this env\n        # when it calls its _generate method.\n        self.presub_env = env\n        lines = str(self).split('\\n')\n        self.presub_env = None      # don't need this any more\n        return lines\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self.varlist\n\n    def get_targets(self, env, executor):\n        \"\"\"\n        Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used\n        by this action.\n        \"\"\"\n        return self.targets\n\nclass _ActionAction(ActionBase):\n    \"\"\"Base class for actions that create output objects.\"\"\"\n    def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),\n                       presub=_null, chdir=None, exitstatfunc=None,\n                       batch_key=None, targets='$TARGETS',\n                 **kw):\n        self.cmdstr = cmdstr\n        if strfunction is not _null:\n            if strfunction is None:\n                self.cmdstr = None\n            else:\n                self.strfunction = strfunction\n        self.varlist = varlist\n        self.presub = presub\n        self.chdir = chdir\n        if not exitstatfunc:\n            exitstatfunc = default_exitstatfunc\n        self.exitstatfunc = exitstatfunc\n\n        self.targets = targets\n\n        if batch_key:\n            if not callable(batch_key):\n                # They have set batch_key, but not to their own\n                # callable.  The default behavior here will batch\n                # *all* targets+sources using this action, separated\n                # for each construction environment.\n                def default_batch_key(self, env, target, source):\n                    return (id(self), id(env))\n                batch_key = default_batch_key\n            SCons.Util.AddMethod(self, batch_key, 'batch_key')\n\n    def print_cmd_line(self, s, target, source, env):\n        # In python 3, and in some of our tests, sys.stdout is\n        # a String io object, and it takes unicode strings only\n        # In other cases it's a regular Python 2.x file object\n        # which takes strings (bytes), and if you pass those a\n        # unicode object they try to decode with 'ascii' codec\n        # which fails if the cmd line has any hi-bit-set chars.\n        # This code assumes s is a regular string, but should\n        # work if it's unicode too.\n        try:\n            sys.stdout.write(unicode(s + \"\\n\"))\n        except UnicodeDecodeError:\n            sys.stdout.write(s + \"\\n\")\n\n    def __call__(self, target, source, env,\n                               exitstatfunc=_null,\n                               presub=_null,\n                               show=_null,\n                               execute=_null,\n                               chdir=_null,\n                               executor=None):\n        if not is_List(target):\n            target = [target]\n        if not is_List(source):\n            source = [source]\n\n        if presub is _null:\n            presub = self.presub\n            if presub is _null:\n                presub = print_actions_presub\n        if exitstatfunc is _null: exitstatfunc = self.exitstatfunc\n        if show is _null:  show = print_actions\n        if execute is _null:  execute = execute_actions\n        if chdir is _null: chdir = self.chdir\n        save_cwd = None\n        if chdir:\n            save_cwd = os.getcwd()\n            try:\n                chdir = str(chdir.abspath)\n            except AttributeError:\n                if not is_String(chdir):\n                    if executor:\n                        chdir = str(executor.batches[0].targets[0].dir)\n                    else:\n                        chdir = str(target[0].dir)\n        if presub:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            t = ' and '.join(map(str, target))\n            l = '\\n  '.join(self.presub_lines(env))\n            out = u\"Building %s with action:\\n  %s\\n\" % (t, l)\n            sys.stdout.write(out)\n        cmd = None\n        if show and self.strfunction:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            try:\n                cmd = self.strfunction(target, source, env, executor)\n            except TypeError:\n                cmd = self.strfunction(target, source, env)\n            if cmd:\n                if chdir:\n                    cmd = ('os.chdir(%s)\\n' % repr(chdir)) + cmd\n                try:\n                    get = env.get\n                except AttributeError:\n                    print_func = self.print_cmd_line\n                else:\n                    print_func = get('PRINT_CMD_LINE_FUNC')\n                    if not print_func:\n                        print_func = self.print_cmd_line\n                print_func(cmd, target, source, env)\n        stat = 0\n        if execute:\n            if chdir:\n                os.chdir(chdir)\n            try:\n                stat = self.execute(target, source, env, executor=executor)\n                if isinstance(stat, SCons.Errors.BuildError):\n                    s = exitstatfunc(stat.status)\n                    if s:\n                        stat.status = s\n                    else:\n                        stat = s\n                else:\n                    stat = exitstatfunc(stat)\n            finally:\n                if save_cwd:\n                    os.chdir(save_cwd)\n        if cmd and save_cwd:\n            print_func('os.chdir(%s)' % repr(save_cwd), target, source, env)\n\n        return stat\n\n\ndef _string_from_cmd_list(cmd_list):\n    \"\"\"Takes a list of command line arguments and returns a pretty\n    representation for printing.\"\"\"\n    cl = []\n    for arg in map(str, cmd_list):\n        if ' ' in arg or '\\t' in arg:\n            arg = '\"' + arg + '\"'\n        cl.append(arg)\n    return ' '.join(cl)\n\n# A fiddlin' little function that has an 'import SCons.Environment' which\n# can't be moved to the top level without creating an import loop.  Since\n# this import creates a local variable named 'SCons', it blocks access to\n# the global variable, so we move it here to prevent complaints about local\n# variables being used uninitialized.\ndefault_ENV = None\ndef get_default_ENV(env):\n    global default_ENV\n    try:\n        return env['ENV']\n    except KeyError:\n        if not default_ENV:\n            import SCons.Environment\n            # This is a hideously expensive way to get a default shell\n            # environment.  What it really should do is run the platform\n            # setup to get the default ENV.  Fortunately, it's incredibly\n            # rare for an Environment not to have a shell environment, so\n            # we're not going to worry about it overmuch.\n            default_ENV = SCons.Environment.Environment()['ENV']\n        return default_ENV\n\n# This function is still in draft mode.  We're going to need something like\n# it in the long run as more and more places use subprocess, but I'm sure\n# it'll have to be tweaked to get the full desired functionality.\n# one special arg (so far?), 'error', to tell what to do with exceptions.\ndef _subproc(scons_env, cmd, error = 'ignore', **kw):\n    \"\"\"Do common setup for a subprocess.Popen() call\"\"\"\n    # allow std{in,out,err} to be \"'devnull'\"\n    io = kw.get('stdin')\n    if is_String(io) and io == 'devnull':\n        kw['stdin'] = open(os.devnull)\n    io = kw.get('stdout')\n    if is_String(io) and io == 'devnull':\n        kw['stdout'] = open(os.devnull, 'w')\n    io = kw.get('stderr')\n    if is_String(io) and io == 'devnull':\n        kw['stderr'] = open(os.devnull, 'w')\n\n    # Figure out what shell environment to use\n    ENV = kw.get('env', None)\n    if ENV is None: ENV = get_default_ENV(scons_env)\n\n    # Ensure that the ENV values are all strings:\n    new_env = {}\n    for key, value in ENV.items():\n        if is_List(value):\n            # If the value is a list, then we assume it is a path list,\n            # because that's a pretty common list-like value to stick\n            # in an environment variable:\n            value = SCons.Util.flatten_sequence(value)\n            new_env[key] = os.pathsep.join(map(str, value))\n        else:\n            # It's either a string or something else.  If it's a string,\n            # we still want to call str() because it might be a *Unicode*\n            # string, which makes subprocess.Popen() gag.  If it isn't a\n            # string or a list, then we just coerce it to a string, which\n            # is the proper way to handle Dir and File instances and will\n            # produce something reasonable for just about everything else:\n            new_env[key] = str(value)\n    kw['env'] = new_env\n\n    try:\n        return subprocess.Popen(cmd, **kw)\n    except EnvironmentError, e:\n        if error == 'raise': raise\n        # return a dummy Popen instance that only returns error\n        class dummyPopen(object):\n            def __init__(self, e): self.exception = e\n            def communicate(self,input=None): return ('','')\n            def wait(self): return -self.exception.errno\n            stdin = None\n            class f(object):\n                def read(self): return ''\n                def readline(self): return ''\n                def __iter__(self): return iter(())\n            stdout = stderr = f()\n        return dummyPopen(e)\n\nclass CommandAction(_ActionAction):\n    \"\"\"Class for command-execution actions.\"\"\"\n    def __init__(self, cmd, **kw):\n        # Cmd can actually be a list or a single item; if it's a\n        # single item it should be the command string to execute; if a\n        # list then it should be the words of the command string to\n        # execute.  Only a single command should be executed by this\n        # object; lists of commands should be handled by embedding\n        # these objects in a ListAction object (which the Action()\n        # factory above does).  cmd will be passed to\n        # Environment.subst_list() for substituting environment\n        # variables.\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')\n\n        _ActionAction.__init__(self, **kw)\n        if is_List(cmd):\n            if list(filter(is_List, cmd)):\n                raise TypeError(\"CommandAction should be given only \" \\\n                      \"a single command\")\n        self.cmd_list = cmd\n\n    def __str__(self):\n        if is_List(self.cmd_list):\n            return ' '.join(map(str, self.cmd_list))\n        return str(self.cmd_list)\n\n    def process(self, target, source, env, executor=None):\n        if executor:\n            result = env.subst_list(self.cmd_list, 0, executor=executor)\n        else:\n            result = env.subst_list(self.cmd_list, 0, target, source)\n        silent = None\n        ignore = None\n        while True:\n            try: c = result[0][0][0]\n            except IndexError: c = None\n            if c == '@': silent = 1\n            elif c == '-': ignore = 1\n            else: break\n            result[0][0] = result[0][0][1:]\n        try:\n            if not result[0][0]:\n                result[0] = result[0][1:]\n        except IndexError:\n            pass\n        return result, ignore, silent\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n        cmd_list, ignore, silent = self.process(target, source, env, executor)\n        if silent:\n            return ''\n        return _string_from_cmd_list(cmd_list[0])\n\n    def execute(self, target, source, env, executor=None):\n        \"\"\"Execute a command action.\n\n        This will handle lists of commands as well as individual commands,\n        because construction variable substitution may turn a single\n        \"command\" into a list.  This means that this class can actually\n        handle lists of commands, even though that's not how we use it\n        externally.\n        \"\"\"\n        escape_list = SCons.Subst.escape_list\n        flatten_sequence = SCons.Util.flatten_sequence\n\n        try:\n            shell = env['SHELL']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SHELL construction variable.')\n\n        try:\n            spawn = env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n        else:\n            if is_String(spawn):\n                spawn = env.subst(spawn, raw=1, conv=lambda x: x)\n\n        escape = env.get('ESCAPE', lambda x: x)\n\n        ENV = get_default_ENV(env)\n\n        # Ensure that the ENV values are all strings:\n        for key, value in ENV.items():\n            if not is_String(value):\n                if is_List(value):\n                    # If the value is a list, then we assume it is a\n                    # path list, because that's a pretty common list-like\n                    # value to stick in an environment variable:\n                    value = flatten_sequence(value)\n                    ENV[key] = os.pathsep.join(map(str, value))\n                else:\n                    # If it isn't a string or a list, then we just coerce\n                    # it to a string, which is the proper way to handle\n                    # Dir and File instances and will produce something\n                    # reasonable for just about everything else:\n                    ENV[key] = str(value)\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        cmd_list, ignore, silent = self.process(target, list(map(rfile, source)), env, executor)\n\n        # Use len() to filter out any \"command\" that's zero-length.\n        for cmd_line in filter(len, cmd_list):\n            # Escape the command line for the interpreter we are using.\n            cmd_line = escape_list(cmd_line, escape)\n            result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)\n            if not ignore and result:\n                msg = \"Error %s\" % result\n                return SCons.Errors.BuildError(errstr=msg,\n                                               status=result,\n                                               action=self,\n                                               command=cmd_line)\n        return 0\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        from SCons.Subst import SUBST_SIG\n        cmd = self.cmd_list\n        if is_List(cmd):\n            cmd = ' '.join(map(str, cmd))\n        else:\n            cmd = str(cmd)\n        if executor:\n            return env.subst_target_source(cmd, SUBST_SIG, executor=executor)\n        else:\n            return env.subst_target_source(cmd, SUBST_SIG, target, source)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        icd = env.get('IMPLICIT_COMMAND_DEPENDENCIES', True)\n        if is_String(icd) and icd[:1] == '$':\n            icd = env.subst(icd)\n        if not icd or icd in ('0', 'None'):\n            return []\n        from SCons.Subst import SUBST_SIG\n        if executor:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, executor=executor)\n        else:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, target, source)\n        res = []\n        for cmd_line in cmd_list:\n            if cmd_line:\n                d = str(cmd_line[0])\n                m = strip_quotes.match(d)\n                if m:\n                    d = m.group(1)\n                d = env.WhereIs(d)\n                if d:\n                    res.append(env.fs.File(d))\n        return res\n\nclass CommandGeneratorAction(ActionBase):\n    \"\"\"Class for command-generator actions.\"\"\"\n    def __init__(self, generator, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')\n        self.generator = generator\n        self.gen_kw = kw\n        self.varlist = kw.get('varlist', ())\n        self.targets = kw.get('targets', '$TARGETS')\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        # ensure that target is a list, to make it easier to write\n        # generator functions:\n        if not is_List(target):\n            target = [target]\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        ret = self.generator(target=target,\n                             source=source,\n                             env=env,\n                             for_signature=for_signature)\n        gen_cmd = Action(ret, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"Object returned from command generator: %s cannot be used to create an Action.\" % repr(ret))\n        return gen_cmd\n\n    def __str__(self):\n        try:\n            env = self.presub_env\n        except AttributeError:\n            env = None\n        if env is None:\n            env = SCons.Defaults.DefaultEnvironment()\n        act = self._generate([], [], env, 1)\n        return str(act)\n\n    def batch_key(self, env, target, source):\n        return self._generate(target, source, env, 1).batch_key(env, target, source)\n\n    def genstring(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).genstring(target, source, env)\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        act = self._generate(target, source, env, 0, executor)\n        if act is None:\n            raise SCons.Errors.UserError(\"While building `%s': \"\n                            \"Cannot deduce file extension from source files: %s\"\n                % (repr(list(map(str, target))), repr(list(map(str, source)))))\n        return act(target, source, env, exitstatfunc, presub,\n                   show, execute, chdir, executor)\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        return self._generate(target, source, env, 1, executor).get_presig(target, source, env)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor)\n\n    def get_targets(self, env, executor):\n        return self._generate(None, None, env, 1, executor).get_targets(env, executor)\n\n\n\n# A LazyAction is a kind of hybrid generator and command action for\n# strings of the form \"$VAR\".  These strings normally expand to other\n# strings (think \"$CCCOM\" to \"$CC -c -o $TARGET $SOURCE\"), but we also\n# want to be able to replace them with functions in the construction\n# environment.  Consequently, we want lazy evaluation and creation of\n# an Action in the case of the function, but that's overkill in the more\n# normal case of expansion to other strings.\n#\n# So we do this with a subclass that's both a generator *and*\n# a command action.  The overridden methods all do a quick check\n# of the construction variable, and if it's a string we just call\n# the corresponding CommandAction method to do the heavy lifting.\n# If not, then we call the same-named CommandGeneratorAction method.\n# The CommandGeneratorAction methods work by using the overridden\n# _generate() method, that is, our own way of handling \"generation\" of\n# an action based on what's in the construction variable.\n\nclass LazyAction(CommandGeneratorAction, CommandAction):\n\n    def __init__(self, var, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')\n        #FUTURE CommandAction.__init__(self, '${'+var+'}', **kw)\n        CommandAction.__init__(self, '${'+var+'}', **kw)\n        self.var = SCons.Util.to_String(var)\n        self.gen_kw = kw\n\n    def get_parent_class(self, env):\n        c = env.get(self.var)\n        if is_String(c) and not '\\n' in c:\n            return CommandAction\n        return CommandGeneratorAction\n\n    def _generate_cache(self, env):\n        if env:\n            c = env.get(self.var, '')\n        else:\n            c = ''\n        gen_cmd = Action(c, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"$%s value %s cannot be used to create an Action.\" % (self.var, repr(c)))\n        return gen_cmd\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        return self._generate_cache(env)\n\n    def __call__(self, target, source, env, *args, **kw):\n        c = self.get_parent_class(env)\n        return c.__call__(self, target, source, env, *args, **kw)\n\n    def get_presig(self, target, source, env):\n        c = self.get_parent_class(env)\n        return c.get_presig(self, target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        c = self.get_parent_class(env)\n        return c.get_varlist(self, target, source, env, executor)\n\n\nclass FunctionAction(_ActionAction):\n    \"\"\"Class for Python function actions.\"\"\"\n\n    def __init__(self, execfunction, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction')\n\n        self.execfunction = execfunction\n        try:\n            self.funccontents = _callable_contents(execfunction)\n        except AttributeError:\n            try:\n                # See if execfunction will do the heavy lifting for us.\n                self.gc = execfunction.get_contents\n            except AttributeError:\n                # This is weird, just do the best we can.\n                self.funccontents = _object_contents(execfunction)\n\n        _ActionAction.__init__(self, **kw)\n\n    def function_name(self):\n        try:\n            return self.execfunction.__name__\n        except AttributeError:\n            try:\n                return self.execfunction.__class__.__name__\n            except AttributeError:\n                return \"unknown_python_function\"\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n        def array(a):\n            def quote(s):\n                try:\n                    str_for_display = s.str_for_display\n                except AttributeError:\n                    s = repr(s)\n                else:\n                    s = str_for_display()\n                return s\n            return '[' + \", \".join(map(quote, a)) + ']'\n        try:\n            strfunc = self.execfunction.strfunction\n        except AttributeError:\n            pass\n        else:\n            if strfunc is None:\n                return None\n            if callable(strfunc):\n                return strfunc(target, source, env)\n        name = self.function_name()\n        tstr = array(target)\n        sstr = array(source)\n        return \"%s(%s, %s)\" % (name, tstr, sstr)\n\n    def __str__(self):\n        name = self.function_name()\n        if name == 'ActionCaller':\n            return str(self.execfunction)\n        return \"%s(target, source, env)\" % name\n\n    def execute(self, target, source, env, executor=None):\n        exc_info = (None,None,None)\n        try:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            rsources = list(map(rfile, source))\n            try:\n                result = self.execfunction(target=target, source=rsources, env=env)\n            except KeyboardInterrupt, e:\n                raise\n            except SystemExit, e:\n                raise\n            except Exception, e:\n                result = e\n                exc_info = sys.exc_info()\n\n            if result:\n                result = SCons.Errors.convert_to_BuildError(result, exc_info)\n                result.node=target\n                result.action=self\n                try:\n                    result.command=self.strfunction(target, source, env, executor)\n                except TypeError:\n                    result.command=self.strfunction(target, source, env)\n\n                # FIXME: This maintains backward compatibility with respect to\n                # which type of exceptions were returned by raising an\n                # exception and which ones were returned by value. It would\n                # probably be best to always return them by value here, but\n                # some codes do not check the return value of Actions and I do\n                # not have the time to modify them at this point.\n                if (exc_info[1] and\n                    not isinstance(exc_info[1],EnvironmentError)):\n                    raise result\n\n            return result\n        finally:\n            # Break the cycle between the traceback object and this\n            # function stack frame. See the sys.exc_info() doc info for\n            # more information about this issue.\n            del exc_info\n\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this callable action.\"\"\"\n        try:\n            return self.gc(target, source, env)\n        except AttributeError:\n            return self.funccontents\n\n    def get_implicit_deps(self, target, source, env):\n        return []\n\nclass ListAction(ActionBase):\n    \"\"\"Class for lists of other actions.\"\"\"\n    def __init__(self, actionlist):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction')\n        def list_of_actions(x):\n            if isinstance(x, ActionBase):\n                return x\n            return Action(x)\n        self.list = list(map(list_of_actions, actionlist))\n        # our children will have had any varlist\n        # applied; we don't need to do it again\n        self.varlist = ()\n        self.targets = '$TARGETS'\n\n    def genstring(self, target, source, env):\n        return '\\n'.join([a.genstring(target, source, env) for a in self.list])\n\n    def __str__(self):\n        return '\\n'.join(map(str, self.list))\n\n    def presub_lines(self, env):\n        return SCons.Util.flatten_sequence(\n            [a.presub_lines(env) for a in self.list])\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this action list.\n\n        Simple concatenation of the signatures of the elements.\n        \"\"\"\n        return \"\".join([x.get_contents(target, source, env) for x in self.list])\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        for act in self.list:\n            stat = act(target, source, env, exitstatfunc, presub,\n                       show, execute, chdir, executor)\n            if stat:\n                return stat\n        return 0\n\n    def get_implicit_deps(self, target, source, env):\n        result = []\n        for act in self.list:\n            result.extend(act.get_implicit_deps(target, source, env))\n        return result\n\n    def get_varlist(self, target, source, env, executor=None):\n        result = SCons.Util.OrderedDict()\n        for act in self.list:\n            for var in act.get_varlist(target, source, env, executor):\n                result[var] = True\n        return list(result.keys())\n\nclass ActionCaller(object):\n    \"\"\"A class for delaying calling an Action function with specific\n    (positional and keyword) arguments until the Action is actually\n    executed.\n\n    This class looks to the rest of the world like a normal Action object,\n    but what it's really doing is hanging on to the arguments until we\n    have a target, source and env to use for the expansion.\n    \"\"\"\n    def __init__(self, parent, args, kw):\n        self.parent = parent\n        self.args = args\n        self.kw = kw\n\n    def get_contents(self, target, source, env):\n        actfunc = self.parent.actfunc\n        try:\n            # \"self.actfunc\" is a function.\n            contents = str(actfunc.func_code.co_code)\n        except AttributeError:\n            # \"self.actfunc\" is a callable object.\n            try:\n                contents = str(actfunc.__call__.im_func.func_code.co_code)\n            except AttributeError:\n                # No __call__() method, so it might be a builtin\n                # or something like that.  Do the best we can.\n                contents = str(actfunc)\n        contents = remove_set_lineno_codes(contents)\n        return contents\n\n    def subst(self, s, target, source, env):\n        # If s is a list, recursively apply subst()\n        # to every element in the list\n        if is_List(s):\n            result = []\n            for elem in s:\n                result.append(self.subst(elem, target, source, env))\n            return self.parent.convert(result)\n\n        # Special-case hack:  Let a custom function wrapped in an\n        # ActionCaller get at the environment through which the action\n        # was called by using this hard-coded value as a special return.\n        if s == '$__env__':\n            return env\n        elif is_String(s):\n            return env.subst(s, 1, target, source)\n        return self.parent.convert(s)\n\n    def subst_args(self, target, source, env):\n        return [self.subst(x, target, source, env) for x in self.args]\n\n    def subst_kw(self, target, source, env):\n        kw = {}\n        for key in self.kw.keys():\n            kw[key] = self.subst(self.kw[key], target, source, env)\n        return kw\n\n    def __call__(self, target, source, env, executor=None):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.actfunc(*args, **kw)\n\n    def strfunction(self, target, source, env):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.strfunc(*args, **kw)\n\n    def __str__(self):\n        return self.parent.strfunc(*self.args, **self.kw)\n\nclass ActionFactory(object):\n    \"\"\"A factory class that will wrap up an arbitrary function\n    as an SCons-executable Action object.\n\n    The real heavy lifting here is done by the ActionCaller class.\n    We just collect the (positional and keyword) arguments that we're\n    called with and give them to the ActionCaller object we create,\n    so it can hang onto them until it needs them.\n    \"\"\"\n    def __init__(self, actfunc, strfunc, convert=lambda x: x):\n        self.actfunc = actfunc\n        self.strfunc = strfunc\n        self.convert = convert\n\n    def __call__(self, *args, **kw):\n        ac = ActionCaller(self, args, kw)\n        action = Action(ac, strfunction=ac.strfunction)\n        return action\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Builder.py",
    "content": "\"\"\"SCons.Builder\n\nBuilder object subsystem.\n\nA Builder object is a callable that encapsulates information about how\nto execute actions to create a target Node (file) from source Nodes\n(files), and how to create those dependencies for tracking.\n\nThe main entry point here is the Builder() factory method.  This provides\na procedural interface that creates the right underlying Builder object\nbased on the keyword arguments supplied and the types of the arguments.\n\nThe goal is for this external interface to be simple enough that the\nvast majority of users can create new Builders as necessary to support\nbuilding new types of files in their configurations, without having to\ndive any deeper into this subsystem.\n\nThe base class here is BuilderBase.  This is a concrete base class which\ndoes, in fact, represent the Builder objects that we (or users) create.\n\nThere is also a proxy that looks like a Builder:\n\n    CompositeBuilder\n\n        This proxies for a Builder with an action that is actually a\n        dictionary that knows how to map file suffixes to a specific\n        action.  This is so that we can invoke different actions\n        (compilers, compile options) for different flavors of source\n        files.\n\nBuilders and their proxies have the following public interface methods\nused by other modules:\n\n    __call__()\n        THE public interface.  Calling a Builder object (with the\n        use of internal helper methods) sets up the target and source\n        dependencies, appropriate mapping to a specific action, and the\n        environment manipulation necessary for overridden construction\n        variable.  This also takes care of warning about possible mistakes\n        in keyword arguments.\n\n    add_emitter()\n        Adds an emitter for a specific file suffix, used by some Tool\n        modules to specify that (for example) a yacc invocation on a .y\n        can create a .h *and* a .c file.\n\n    add_action()\n        Adds an action for a specific file suffix, heavily used by\n        Tool modules to add their specific action(s) for turning\n        a source file into an object file to the global static\n        and shared object file Builders.\n\nThere are the following methods for internal use within this module:\n\n    _execute()\n        The internal method that handles the heavily lifting when a\n        Builder is called.  This is used so that the __call__() methods\n        can set up warning about possible mistakes in keyword-argument\n        overrides, and *then* execute all of the steps necessary so that\n        the warnings only occur once.\n\n    get_name()\n        Returns the Builder's name within a specific Environment,\n        primarily used to try to return helpful information in error\n        messages.\n\n    adjust_suffix()\n    get_prefix()\n    get_suffix()\n    get_src_suffix()\n    set_src_suffix()\n        Miscellaneous stuff for handling the prefix and suffix\n        manipulation we use in turning source file names into target\n        file names.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Builder.py  2014/07/05 09:42:21 garyo\"\n\nimport collections\n\nimport SCons.Action\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nfrom SCons.Errors import InternalError, UserError\nimport SCons.Executor\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Util\nimport SCons.Warnings\n\nclass _Null(object):\n    pass\n\n_null = _Null\n\ndef match_splitext(path, suffixes = []):\n    if suffixes:\n        matchsuf = [S for S in suffixes if path[-len(S):] == S]\n        if matchsuf:\n            suf = max([(len(_f),_f) for _f in matchsuf])[1]\n            return [path[:-len(suf)], path[-len(suf):]]\n    return SCons.Util.splitext(path)\n\nclass DictCmdGenerator(SCons.Util.Selector):\n    \"\"\"This is a callable class that can be used as a\n    command generator function.  It holds on to a dictionary\n    mapping file suffixes to Actions.  It uses that dictionary\n    to return the proper action based on the file suffix of\n    the source file.\"\"\"\n\n    def __init__(self, dict=None, source_ext_match=1):\n        SCons.Util.Selector.__init__(self, dict)\n        self.source_ext_match = source_ext_match\n\n    def src_suffixes(self):\n        return list(self.keys())\n\n    def add_action(self, suffix, action):\n        \"\"\"Add a suffix-action pair to the mapping.\n        \"\"\"\n        self[suffix] = action\n\n    def __call__(self, target, source, env, for_signature):\n        if not source:\n            return []\n\n        if self.source_ext_match:\n            suffixes = self.src_suffixes()\n            ext = None\n            for src in map(str, source):\n                my_ext = match_splitext(src, suffixes)[1]\n                if ext and my_ext != ext:\n                    raise UserError(\"While building `%s' from `%s': Cannot build multiple sources with different extensions: %s, %s\"\n                             % (repr(list(map(str, target))), src, ext, my_ext))\n                ext = my_ext\n        else:\n            ext = match_splitext(str(source[0]), self.src_suffixes())[1]\n\n        if not ext:\n            #return ext\n            raise UserError(\"While building `%s': \"\n                            \"Cannot deduce file extension from source files: %s\"\n                 % (repr(list(map(str, target))), repr(list(map(str, source)))))\n\n        try:\n            ret = SCons.Util.Selector.__call__(self, env, source, ext)\n        except KeyError, e:\n            raise UserError(\"Ambiguous suffixes after environment substitution: %s == %s == %s\" % (e.args[0], e.args[1], e.args[2]))\n        if ret is None:\n            raise UserError(\"While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'.  Expected a suffix in this list: %s.\" % \\\n                            (repr(list(map(str, target))), repr(list(map(str, source))), ext, repr(list(self.keys()))))\n        return ret\n\nclass CallableSelector(SCons.Util.Selector):\n    \"\"\"A callable dictionary that will, in turn, call the value it\n    finds if it can.\"\"\"\n    def __call__(self, env, source):\n        value = SCons.Util.Selector.__call__(self, env, source)\n        if callable(value):\n            value = value(env, source)\n        return value\n\nclass DictEmitter(SCons.Util.Selector):\n    \"\"\"A callable dictionary that maps file suffixes to emitters.\n    When called, it finds the right emitter in its dictionary for the\n    suffix of the first source file, and calls that emitter to get the\n    right lists of targets and sources to return.  If there's no emitter\n    for the suffix in its dictionary, the original target and source are\n    returned.\n    \"\"\"\n    def __call__(self, target, source, env):\n        emitter = SCons.Util.Selector.__call__(self, env, source)\n        if emitter:\n            target, source = emitter(target, source, env)\n        return (target, source)\n\nclass ListEmitter(collections.UserList):\n    \"\"\"A callable list of emitters that calls each in sequence,\n    returning the result.\n    \"\"\"\n    def __call__(self, target, source, env):\n        for e in self.data:\n            target, source = e(target, source, env)\n        return (target, source)\n\n# These are a common errors when calling a Builder;\n# they are similar to the 'target' and 'source' keyword args to builders,\n# so we issue warnings when we see them.  The warnings can, of course,\n# be disabled.\nmisleading_keywords = {\n    'targets'   : 'target',\n    'sources'   : 'source',\n}\n\nclass OverrideWarner(collections.UserDict):\n    \"\"\"A class for warning about keyword arguments that we use as\n    overrides in a Builder call.\n\n    This class exists to handle the fact that a single Builder call\n    can actually invoke multiple builders.  This class only emits the\n    warnings once, no matter how many Builders are invoked.\n    \"\"\"\n    def __init__(self, dict):\n        collections.UserDict.__init__(self, dict)\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner')\n        self.already_warned = None\n    def warn(self):\n        if self.already_warned:\n            return\n        for k in self.keys():\n            if k in misleading_keywords:\n                alt = misleading_keywords[k]\n                msg = \"Did you mean to use `%s' instead of `%s'?\" % (alt, k)\n                SCons.Warnings.warn(SCons.Warnings.MisleadingKeywordsWarning, msg)\n        self.already_warned = 1\n\ndef Builder(**kw):\n    \"\"\"A factory for builder objects.\"\"\"\n    composite = None\n    if 'generator' in kw:\n        if 'action' in kw:\n            raise UserError(\"You must not specify both an action and a generator.\")\n        kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {})\n        del kw['generator']\n    elif 'action' in kw:\n        source_ext_match = kw.get('source_ext_match', 1)\n        if 'source_ext_match' in kw:\n            del kw['source_ext_match']\n        if SCons.Util.is_Dict(kw['action']):\n            composite = DictCmdGenerator(kw['action'], source_ext_match)\n            kw['action'] = SCons.Action.CommandGeneratorAction(composite, {})\n            kw['src_suffix'] = composite.src_suffixes()\n        else:\n            kw['action'] = SCons.Action.Action(kw['action'])\n\n    if 'emitter' in kw:\n        emitter = kw['emitter']\n        if SCons.Util.is_String(emitter):\n            # This allows users to pass in an Environment\n            # variable reference (like \"$FOO\") as an emitter.\n            # We will look in that Environment variable for\n            # a callable to use as the actual emitter.\n            var = SCons.Util.get_environment_var(emitter)\n            if not var:\n                raise UserError(\"Supplied emitter '%s' does not appear to refer to an Environment variable\" % emitter)\n            kw['emitter'] = EmitterProxy(var)\n        elif SCons.Util.is_Dict(emitter):\n            kw['emitter'] = DictEmitter(emitter)\n        elif SCons.Util.is_List(emitter):\n            kw['emitter'] = ListEmitter(emitter)\n\n    result = BuilderBase(**kw)\n\n    if not composite is None:\n        result = CompositeBuilder(result, composite)\n\n    return result\n\ndef _node_errors(builder, env, tlist, slist):\n    \"\"\"Validate that the lists of target and source nodes are\n    legal for this builder and environment.  Raise errors or\n    issue warnings as appropriate.\n    \"\"\"\n\n    # First, figure out if there are any errors in the way the targets\n    # were specified.\n    for t in tlist:\n        if t.side_effect:\n            raise UserError(\"Multiple ways to build the same target were specified for: %s\" % t)\n        if t.has_explicit_builder():\n            if not t.env is None and not t.env is env:\n                action = t.builder.action\n                t_contents = action.get_contents(tlist, slist, t.env)\n                contents = action.get_contents(tlist, slist, env)\n\n                if t_contents == contents:\n                    msg = \"Two different environments were specified for target %s,\\n\\tbut they appear to have the same action: %s\" % (t, action.genstring(tlist, slist, t.env))\n                    SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)\n                else:\n                    msg = \"Two environments with different actions were specified for the same target: %s\" % t\n                    raise UserError(msg)\n            if builder.multi:\n                if t.builder != builder:\n                    msg = \"Two different builders (%s and %s) were specified for the same target: %s\" % (t.builder.get_name(env), builder.get_name(env), t)\n                    raise UserError(msg)\n                # TODO(batch):  list constructed each time!\n                if t.get_executor().get_all_targets() != tlist:\n                    msg = \"Two different target lists have a target in common: %s  (from %s and from %s)\" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist)))\n                    raise UserError(msg)\n            elif t.sources != slist:\n                msg = \"Multiple ways to build the same target were specified for: %s  (from %s and from %s)\" % (t, list(map(str, t.sources)), list(map(str, slist)))\n                raise UserError(msg)\n\n    if builder.single_source:\n        if len(slist) > 1:\n            raise UserError(\"More than one source given for single-source builder: targets=%s sources=%s\" % (list(map(str,tlist)), list(map(str,slist))))\n\nclass EmitterProxy(object):\n    \"\"\"This is a callable class that can act as a\n    Builder emitter.  It holds on to a string that\n    is a key into an Environment dictionary, and will\n    look there at actual build time to see if it holds\n    a callable.  If so, we will call that as the actual\n    emitter.\"\"\"\n    def __init__(self, var):\n        self.var = SCons.Util.to_String(var)\n\n    def __call__(self, target, source, env):\n        emitter = self.var\n\n        # Recursively substitute the variable.\n        # We can't use env.subst() because it deals only\n        # in strings.  Maybe we should change that?\n        while SCons.Util.is_String(emitter) and emitter in env:\n            emitter = env[emitter]\n        if callable(emitter):\n            target, source = emitter(target, source, env)\n        elif SCons.Util.is_List(emitter):\n            for e in emitter:\n                target, source = e(target, source, env)\n\n        return (target, source)\n\n\n    def __cmp__(self, other):\n        return cmp(self.var, other.var)\n\nclass BuilderBase(object):\n    \"\"\"Base class for Builders, objects that create output\n    nodes (files) from input nodes (files).\n    \"\"\"\n\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    memoizer_counters = []\n\n    def __init__(self,  action = None,\n                        prefix = '',\n                        suffix = '',\n                        src_suffix = '',\n                        target_factory = None,\n                        source_factory = None,\n                        target_scanner = None,\n                        source_scanner = None,\n                        emitter = None,\n                        multi = 0,\n                        env = None,\n                        single_source = 0,\n                        name = None,\n                        chdir = _null,\n                        is_explicit = 1,\n                        src_builder = None,\n                        ensure_suffix = False,\n                        **overrides):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase')\n        self._memo = {}\n        self.action = action\n        self.multi = multi\n        if SCons.Util.is_Dict(prefix):\n            prefix = CallableSelector(prefix)\n        self.prefix = prefix\n        if SCons.Util.is_Dict(suffix):\n            suffix = CallableSelector(suffix)\n        self.env = env\n        self.single_source = single_source\n        if 'overrides' in overrides:\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedBuilderKeywordsWarning,\n                \"The \\\"overrides\\\" keyword to Builder() creation has been deprecated;\\n\" +\\\n                \"\\tspecify the items as keyword arguments to the Builder() call instead.\")\n            overrides.update(overrides['overrides'])\n            del overrides['overrides']\n        if 'scanner' in overrides:\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedBuilderKeywordsWarning,\n                                \"The \\\"scanner\\\" keyword to Builder() creation has been deprecated;\\n\"\n                                \"\\tuse: source_scanner or target_scanner as appropriate.\")\n            del overrides['scanner']\n        self.overrides = overrides\n\n        self.set_suffix(suffix)\n        self.set_src_suffix(src_suffix)\n        self.ensure_suffix = ensure_suffix\n\n        self.target_factory = target_factory\n        self.source_factory = source_factory\n        self.target_scanner = target_scanner\n        self.source_scanner = source_scanner\n\n        self.emitter = emitter\n\n        # Optional Builder name should only be used for Builders\n        # that don't get attached to construction environments.\n        if name:\n            self.name = name\n        self.executor_kw = {}\n        if not chdir is _null:\n            self.executor_kw['chdir'] = chdir\n        self.is_explicit = is_explicit\n\n        if src_builder is None:\n            src_builder = []\n        elif not SCons.Util.is_List(src_builder):\n            src_builder = [ src_builder ]\n        self.src_builder = src_builder\n\n    def __nonzero__(self):\n        raise InternalError(\"Do not test for the Node.builder attribute directly; use Node.has_builder() instead\")\n\n    def get_name(self, env):\n        \"\"\"Attempts to get the name of the Builder.\n\n        Look at the BUILDERS variable of env, expecting it to be a\n        dictionary containing this Builder, and return the key of the\n        dictionary.  If there's no key, then return a directly-configured\n        name (if there is one) or the name of the class (by default).\"\"\"\n\n        try:\n            index = list(env['BUILDERS'].values()).index(self)\n            return list(env['BUILDERS'].keys())[index]\n        except (AttributeError, KeyError, TypeError, ValueError):\n            try:\n                return self.name\n            except AttributeError:\n                return str(self.__class__)\n\n    def __cmp__(self, other):\n        return cmp(self.__dict__, other.__dict__)\n\n    def splitext(self, path, env=None):\n        if not env:\n            env = self.env\n        if env:\n            suffixes = self.src_suffixes(env)\n        else:\n            suffixes = []\n        return match_splitext(path, suffixes)\n\n    def _adjustixes(self, files, pre, suf, ensure_suffix=False):\n        if not files:\n            return []\n        result = []\n        if not SCons.Util.is_List(files):\n            files = [files]\n\n        for f in files:\n            if SCons.Util.is_String(f):\n                f = SCons.Util.adjustixes(f, pre, suf, ensure_suffix)\n            result.append(f)\n        return result\n\n    def _create_nodes(self, env, target = None, source = None):\n        \"\"\"Create and return lists of target and source nodes.\n        \"\"\"\n        src_suf = self.get_src_suffix(env)\n\n        target_factory = env.get_factory(self.target_factory)\n        source_factory = env.get_factory(self.source_factory)\n\n        source = self._adjustixes(source, None, src_suf)\n        slist = env.arg2nodes(source, source_factory)\n\n        pre = self.get_prefix(env, slist)\n        suf = self.get_suffix(env, slist)\n\n        if target is None:\n            try:\n                t_from_s = slist[0].target_from_source\n            except AttributeError:\n                raise UserError(\"Do not know how to create a target from source `%s'\" % slist[0])\n            except IndexError:\n                tlist = []\n            else:\n                splitext = lambda S: self.splitext(S,env)\n                tlist = [ t_from_s(pre, suf, splitext) ]\n        else:\n            target = self._adjustixes(target, pre, suf, self.ensure_suffix)\n            tlist = env.arg2nodes(target, target_factory, target=target, source=source)\n\n        if self.emitter:\n            # The emitter is going to do str(node), but because we're\n            # being called *from* a builder invocation, the new targets\n            # don't yet have a builder set on them and will look like\n            # source files.  Fool the emitter's str() calls by setting\n            # up a temporary builder on the new targets.\n            new_targets = []\n            for t in tlist:\n                if not t.is_derived():\n                    t.builder_set(self)\n                    new_targets.append(t)\n\n            orig_tlist = tlist[:]\n            orig_slist = slist[:]\n\n            target, source = self.emitter(target=tlist, source=slist, env=env)\n\n            # Now delete the temporary builders that we attached to any\n            # new targets, so that _node_errors() doesn't do weird stuff\n            # to them because it thinks they already have builders.\n            for t in new_targets:\n                if t.builder is self:\n                    # Only delete the temporary builder if the emitter\n                    # didn't change it on us.\n                    t.builder_set(None)\n\n            # Have to call arg2nodes yet again, since it is legal for\n            # emitters to spit out strings as well as Node instances.\n            tlist = env.arg2nodes(target, target_factory,\n                                  target=orig_tlist, source=orig_slist)\n            slist = env.arg2nodes(source, source_factory,\n                                  target=orig_tlist, source=orig_slist)\n\n        return tlist, slist\n\n    def _execute(self, env, target, source, overwarn={}, executor_kw={}):\n        # We now assume that target and source are lists or None.\n        if self.src_builder:\n            source = self.src_builder_sources(env, source, overwarn)\n\n        if self.single_source and len(source) > 1 and target is None:\n            result = []\n            if target is None: target = [None]*len(source)\n            for tgt, src in zip(target, source):\n                if not tgt is None: tgt = [tgt]\n                if not src is None: src = [src]\n                result.extend(self._execute(env, tgt, src, overwarn))\n            return SCons.Node.NodeList(result)\n\n        overwarn.warn()\n\n        tlist, slist = self._create_nodes(env, target, source)\n\n        # Check for errors with the specified target/source lists.\n        _node_errors(self, env, tlist, slist)\n\n        # The targets are fine, so find or make the appropriate Executor to\n        # build this particular list of targets from this particular list of\n        # sources.\n\n        executor = None\n        key = None\n\n        if self.multi:\n            try:\n                executor = tlist[0].get_executor(create = 0)\n            except (AttributeError, IndexError):\n                pass\n            else:\n                executor.add_sources(slist)\n\n        if executor is None:\n            if not self.action:\n                fmt = \"Builder %s must have an action to build %s.\"\n                raise UserError(fmt % (self.get_name(env or self.env),\n                                        list(map(str,tlist))))\n            key = self.action.batch_key(env or self.env, tlist, slist)\n            if key:\n                try:\n                    executor = SCons.Executor.GetBatchExecutor(key)\n                except KeyError:\n                    pass\n                else:\n                    executor.add_batch(tlist, slist)\n\n        if executor is None:\n            executor = SCons.Executor.Executor(self.action, env, [],\n                                               tlist, slist, executor_kw)\n            if key:\n                SCons.Executor.AddBatchExecutor(key, executor)\n\n        # Now set up the relevant information in the target Nodes themselves.\n        for t in tlist:\n            t.cwd = env.fs.getcwd()\n            t.builder_set(self)\n            t.env_set(env)\n            t.add_source(slist)\n            t.set_executor(executor)\n            t.set_explicit(self.is_explicit)\n\n        return SCons.Node.NodeList(tlist)\n\n    def __call__(self, env, target=None, source=None, chdir=_null, **kw):\n        # We now assume that target and source are lists or None.\n        # The caller (typically Environment.BuilderWrapper) is\n        # responsible for converting any scalar values to lists.\n        if chdir is _null:\n            ekw = self.executor_kw\n        else:\n            ekw = self.executor_kw.copy()\n            ekw['chdir'] = chdir\n        if kw:\n            if 'srcdir' in kw:\n                def prependDirIfRelative(f, srcdir=kw['srcdir']):\n                    import os.path\n                    if SCons.Util.is_String(f) and not os.path.isabs(f):\n                        f = os.path.join(srcdir, f)\n                    return f\n                if not SCons.Util.is_List(source):\n                    source = [source]\n                source = list(map(prependDirIfRelative, source))\n                del kw['srcdir']\n            if self.overrides:\n                env_kw = self.overrides.copy()\n                env_kw.update(kw)\n            else:\n                env_kw = kw\n        else:\n            env_kw = self.overrides\n        env = env.Override(env_kw)\n        return self._execute(env, target, source, OverrideWarner(kw), ekw)\n\n    def adjust_suffix(self, suff):\n        if suff and not suff[0] in [ '.', '_', '$' ]:\n            return '.' + suff\n        return suff\n\n    def get_prefix(self, env, sources=[]):\n        prefix = self.prefix\n        if callable(prefix):\n            prefix = prefix(env, sources)\n        return env.subst(prefix)\n\n    def set_suffix(self, suffix):\n        if not callable(suffix):\n            suffix = self.adjust_suffix(suffix)\n        self.suffix = suffix\n\n    def get_suffix(self, env, sources=[]):\n        suffix = self.suffix\n        if callable(suffix):\n            suffix = suffix(env, sources)\n        return env.subst(suffix)\n\n    def set_src_suffix(self, src_suffix):\n        if not src_suffix:\n            src_suffix = []\n        elif not SCons.Util.is_List(src_suffix):\n            src_suffix = [ src_suffix ]\n        self.src_suffix = [callable(suf) and suf or self.adjust_suffix(suf) for suf in src_suffix]\n\n    def get_src_suffix(self, env):\n        \"\"\"Get the first src_suffix in the list of src_suffixes.\"\"\"\n        ret = self.src_suffixes(env)\n        if not ret:\n            return ''\n        return ret[0]\n\n    def add_emitter(self, suffix, emitter):\n        \"\"\"Add a suffix-emitter mapping to this Builder.\n\n        This assumes that emitter has been initialized with an\n        appropriate dictionary type, and will throw a TypeError if\n        not, so the caller is responsible for knowing that this is an\n        appropriate method to call for the Builder in question.\n        \"\"\"\n        self.emitter[suffix] = emitter\n\n    def add_src_builder(self, builder):\n        \"\"\"\n        Add a new Builder to the list of src_builders.\n\n        This requires wiping out cached values so that the computed\n        lists of source suffixes get re-calculated.\n        \"\"\"\n        self._memo = {}\n        self.src_builder.append(builder)\n\n    def _get_sdict(self, env):\n        \"\"\"\n        Returns a dictionary mapping all of the source suffixes of all\n        src_builders of this Builder to the underlying Builder that\n        should be called first.\n\n        This dictionary is used for each target specified, so we save a\n        lot of extra computation by memoizing it for each construction\n        environment.\n\n        Note that this is re-computed each time, not cached, because there\n        might be changes to one of our source Builders (or one of their\n        source Builders, and so on, and so on...) that we can't \"see.\"\n\n        The underlying methods we call cache their computed values,\n        though, so we hope repeatedly aggregating them into a dictionary\n        like this won't be too big a hit.  We may need to look for a\n        better way to do this if performance data show this has turned\n        into a significant bottleneck.\n        \"\"\"\n        sdict = {}\n        for bld in self.get_src_builders(env):\n            for suf in bld.src_suffixes(env):\n                sdict[suf] = bld\n        return sdict\n\n    def src_builder_sources(self, env, source, overwarn={}):\n        sdict = self._get_sdict(env)\n\n        src_suffixes = self.src_suffixes(env)\n\n        lengths = list(set(map(len, src_suffixes)))\n\n        def match_src_suffix(name, src_suffixes=src_suffixes, lengths=lengths):\n            node_suffixes = [name[-l:] for l in lengths]\n            for suf in src_suffixes:\n                if suf in node_suffixes:\n                    return suf\n            return None\n\n        result = []\n        for s in SCons.Util.flatten(source):\n            if SCons.Util.is_String(s):\n                match_suffix = match_src_suffix(env.subst(s))\n                if not match_suffix and not '.' in s:\n                    src_suf = self.get_src_suffix(env)\n                    s = self._adjustixes(s, None, src_suf)[0]\n            else:\n                match_suffix = match_src_suffix(s.name)\n            if match_suffix:\n                try:\n                    bld = sdict[match_suffix]\n                except KeyError:\n                    result.append(s)\n                else:\n                    tlist = bld._execute(env, None, [s], overwarn)\n                    # If the subsidiary Builder returned more than one\n                    # target, then filter out any sources that this\n                    # Builder isn't capable of building.\n                    if len(tlist) > 1:\n                        tlist = [t for t in tlist if match_src_suffix(t.name)]\n                    result.extend(tlist)\n            else:\n                result.append(s)\n\n        source_factory = env.get_factory(self.source_factory)\n\n        return env.arg2nodes(result, source_factory)\n\n    def _get_src_builders_key(self, env):\n        return id(env)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('get_src_builders', _get_src_builders_key))\n\n    def get_src_builders(self, env):\n        \"\"\"\n        Returns the list of source Builders for this Builder.\n\n        This exists mainly to look up Builders referenced as\n        strings in the 'BUILDER' variable of the construction\n        environment and cache the result.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['get_src_builders']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_src_builders'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        builders = []\n        for bld in self.src_builder:\n            if SCons.Util.is_String(bld):\n                try:\n                    bld = env['BUILDERS'][bld]\n                except KeyError:\n                    continue\n            builders.append(bld)\n\n        memo_dict[memo_key] = builders\n        return builders\n\n    def _subst_src_suffixes_key(self, env):\n        return id(env)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('subst_src_suffixes', _subst_src_suffixes_key))\n\n    def subst_src_suffixes(self, env):\n        \"\"\"\n        The suffix list may contain construction variable expansions,\n        so we have to evaluate the individual strings.  To avoid doing\n        this over and over, we memoize the results for each construction\n        environment.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['subst_src_suffixes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['subst_src_suffixes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n        suffixes = [env.subst(x) for x in self.src_suffix]\n        memo_dict[memo_key] = suffixes\n        return suffixes\n\n    def src_suffixes(self, env):\n        \"\"\"\n        Returns the list of source suffixes for all src_builders of this\n        Builder.\n\n        This is essentially a recursive descent of the src_builder \"tree.\"\n        (This value isn't cached because there may be changes in a\n        src_builder many levels deep that we can't see.)\n        \"\"\"\n        sdict = {}\n        suffixes = self.subst_src_suffixes(env)\n        for s in suffixes:\n            sdict[s] = 1\n        for builder in self.get_src_builders(env):\n            for s in builder.src_suffixes(env):\n                if s not in sdict:\n                    sdict[s] = 1\n                    suffixes.append(s)\n        return suffixes\n\nclass CompositeBuilder(SCons.Util.Proxy):\n    \"\"\"A Builder Proxy whose main purpose is to always have\n    a DictCmdGenerator as its action, and to provide access\n    to the DictCmdGenerator's add_action() method.\n    \"\"\"\n\n    def __init__(self, builder, cmdgen):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder')\n        SCons.Util.Proxy.__init__(self, builder)\n\n        # cmdgen should always be an instance of DictCmdGenerator.\n        self.cmdgen = cmdgen\n        self.builder = builder\n\n    __call__ = SCons.Util.Delegate('__call__')\n\n    def add_action(self, suffix, action):\n        self.cmdgen.add_action(suffix, action)\n        self.set_src_suffix(self.cmdgen.src_suffixes())\n\ndef is_a_Builder(obj):\n    \"\"\"\"Returns True iff the specified obj is one of our Builder classes.\n\n    The test is complicated a bit by the fact that CompositeBuilder\n    is a proxy, not a subclass of BuilderBase.\n    \"\"\"\n    return (isinstance(obj, BuilderBase)\n            or isinstance(obj, CompositeBuilder)\n            or callable(obj))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/CacheDir.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/CacheDir.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"\nCacheDir support\n\"\"\"\n\nimport os.path\nimport stat\nimport sys\n\nimport SCons.Action\n\ncache_enabled = True\ncache_debug = False\ncache_force = False\ncache_show = False\ncache_readonly = False\n\ndef CacheRetrieveFunc(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if not fs.exists(cachefile):\n        cd.CacheDebug('CacheRetrieve(%s):  %s not in cache\\n', t, cachefile)\n        return 1\n    cd.CacheDebug('CacheRetrieve(%s):  retrieving from %s\\n', t, cachefile)\n    if SCons.Action.execute_actions:\n        if fs.islink(cachefile):\n            fs.symlink(fs.readlink(cachefile), t.path)\n        else:\n            env.copy_from_cache(cachefile, t.path)\n        st = fs.stat(cachefile)\n        fs.chmod(t.path, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n    return 0\n\ndef CacheRetrieveString(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if t.fs.exists(cachefile):\n        return \"Retrieved `%s' from cache\" % t.path\n    return None\n\nCacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)\n\nCacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)\n\ndef CachePushFunc(target, source, env):\n    if cache_readonly: return\n\n    t = target[0]\n    if t.nocache:\n        return\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if fs.exists(cachefile):\n        # Don't bother copying it if it's already there.  Note that\n        # usually this \"shouldn't happen\" because if the file already\n        # existed in cache, we'd have retrieved the file from there,\n        # not built it.  This can happen, though, in a race, if some\n        # other person running the same build pushes their copy to\n        # the cache after we decide we need to build it but before our\n        # build completes.\n        cd.CacheDebug('CachePush(%s):  %s already exists in cache\\n', t, cachefile)\n        return\n\n    cd.CacheDebug('CachePush(%s):  pushing to %s\\n', t, cachefile)\n\n    tempfile = cachefile+'.tmp'+str(os.getpid())\n    errfmt = \"Unable to copy %s to cache. Cache file is %s\"\n\n    if not fs.isdir(cachedir):\n        try:\n            fs.makedirs(cachedir)\n        except EnvironmentError:\n            # We may have received an exception because another process\n            # has beaten us creating the directory.\n            if not fs.isdir(cachedir):\n                msg = errfmt % (str(target), cachefile)\n                raise SCons.Errors.EnvironmentError(msg)\n\n    try:\n        if fs.islink(t.path):\n            fs.symlink(fs.readlink(t.path), tempfile)\n        else:\n            fs.copy2(t.path, tempfile)\n        fs.rename(tempfile, cachefile)\n        st = fs.stat(t.path)\n        fs.chmod(cachefile, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n    except EnvironmentError:\n        # It's possible someone else tried writing the file at the\n        # same time we did, or else that there was some problem like\n        # the CacheDir being on a separate file system that's full.\n        # In any case, inability to push a file to cache doesn't affect\n        # the correctness of the build, so just print a warning.\n        msg = errfmt % (str(target), cachefile)\n        SCons.Warnings.warn(SCons.Warnings.CacheWriteErrorWarning, msg)\n\nCachePush = SCons.Action.Action(CachePushFunc, None)\n\nclass CacheDir(object):\n\n    def __init__(self, path):\n        try:\n            import hashlib\n        except ImportError:\n            msg = \"No hashlib or MD5 module available, CacheDir() not supported\"\n            SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg)\n            self.path = None\n        else:\n            self.path = path\n        self.current_cache_debug = None\n        self.debugFP = None\n\n    def CacheDebug(self, fmt, target, cachefile):\n        if cache_debug != self.current_cache_debug:\n            if cache_debug == '-':\n                self.debugFP = sys.stdout\n            elif cache_debug:\n                self.debugFP = open(cache_debug, 'w')\n            else:\n                self.debugFP = None\n            self.current_cache_debug = cache_debug\n        if self.debugFP:\n            self.debugFP.write(fmt % (target, os.path.split(cachefile)[1]))\n\n    def is_enabled(self):\n        return (cache_enabled and not self.path is None)\n\n    def is_readonly(self):\n        return cache_readonly\n\n    def cachepath(self, node):\n        \"\"\"\n        \"\"\"\n        if not self.is_enabled():\n            return None, None\n\n        sig = node.get_cachedir_bsig()\n        subdir = sig[0].upper()\n        dir = os.path.join(self.path, subdir)\n        return dir, os.path.join(dir, sig)\n\n    def retrieve(self, node):\n        \"\"\"\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Note that there's a special trick here with the execute flag\n        (one that's not normally done for other actions).  Basically\n        if the user requested a no_exec (-n) build, then\n        SCons.Action.execute_actions is set to 0 and when any action\n        is called, it does its showing but then just returns zero\n        instead of actually calling the action execution operation.\n        The problem for caching is that if the file does NOT exist in\n        cache then the CacheRetrieveString won't return anything to\n        show for the task, but the Action.__call__ won't call\n        CacheRetrieveFunc; instead it just returns zero, which makes\n        the code below think that the file *was* successfully\n        retrieved from the cache, therefore it doesn't do any\n        subsequent building.  However, the CacheRetrieveString didn't\n        print anything because it didn't actually exist in the cache,\n        and no more build actions will be performed, so the user just\n        sees nothing.  The fix is to tell Action.__call__ to always\n        execute the CacheRetrieveFunc and then have the latter\n        explicitly check SCons.Action.execute_actions itself.\n        \"\"\"\n        if not self.is_enabled():\n            return False\n\n        env = node.get_build_env()\n        if cache_show:\n            if CacheRetrieveSilent(node, [], env, execute=1) == 0:\n                node.build(presub=0, execute=0)\n                return True\n        else:\n            if CacheRetrieve(node, [], env, execute=1) == 0:\n                return True\n\n        return False\n\n    def push(self, node):\n        if self.is_readonly() or not self.is_enabled():\n            return\n        return CachePush(node, [], node.get_build_env())\n\n    def push_if_forced(self, node):\n        if cache_force:\n            return self.push(node)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Conftest.py",
    "content": "\"\"\"SCons.Conftest\n\nAutoconf-like configuration support; low level implementation of tests.\n\"\"\"\n\n#\n# Copyright (c) 2003 Stichting NLnet Labs\n# Copyright (c) 2001, 2002, 2003 Steven Knight\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n#\n# The purpose of this module is to define how a check is to be performed.\n# Use one of the Check...() functions below.\n#\n\n#\n# A context class is used that defines functions for carrying out the tests,\n# logging and messages.  The following methods and members must be present:\n#\n# context.Display(msg)  Function called to print messages that are normally\n#                       displayed for the user.  Newlines are explicitly used.\n#                       The text should also be written to the logfile!\n#\n# context.Log(msg)      Function called to write to a log file.\n#\n# context.BuildProg(text, ext)\n#                       Function called to build a program, using \"ext\" for the\n#                       file extention.  Must return an empty string for\n#                       success, an error message for failure.\n#                       For reliable test results building should be done just\n#                       like an actual program would be build, using the same\n#                       command and arguments (including configure results so\n#                       far).\n#\n# context.CompileProg(text, ext)\n#                       Function called to compile a program, using \"ext\" for\n#                       the file extention.  Must return an empty string for\n#                       success, an error message for failure.\n#                       For reliable test results compiling should be done just\n#                       like an actual source file would be compiled, using the\n#                       same command and arguments (including configure results\n#                       so far).\n#\n# context.AppendLIBS(lib_name_list)\n#                       Append \"lib_name_list\" to the value of LIBS.\n#                       \"lib_namelist\" is a list of strings.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.PrependLIBS(lib_name_list)\n#                       Prepend \"lib_name_list\" to the value of LIBS.\n#                       \"lib_namelist\" is a list of strings.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.SetLIBS(value)\n#                       Set LIBS to \"value\".  The type of \"value\" is what\n#                       AppendLIBS() returned.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.headerfilename\n#                       Name of file to append configure results to, usually\n#                       \"confdefs.h\".\n#                       The file must not exist or be empty when starting.\n#                       Empty or None to skip this (some tests will not work!).\n#\n# context.config_h      (may be missing). If present, must be a string, which\n#                       will be filled with the contents of a config_h file.\n#\n# context.vardict       Dictionary holding variables used for the tests and\n#                       stores results from the tests, used for the build\n#                       commands.\n#                       Normally contains \"CC\", \"LIBS\", \"CPPFLAGS\", etc.\n#\n# context.havedict      Dictionary holding results from the tests that are to\n#                       be used inside a program.\n#                       Names often start with \"HAVE_\".  These are zero\n#                       (feature not present) or one (feature present).  Other\n#                       variables may have any value, e.g., \"PERLVERSION\" can\n#                       be a number and \"SYSTEMNAME\" a string.\n#\n\nimport re\nfrom types import IntType\n\n#\n# PUBLIC VARIABLES\n#\n\nLogInputFiles = 1    # Set that to log the input files in case of a failed test\nLogErrorMessages = 1 # Set that to log Conftest-generated error messages\n\n#\n# PUBLIC FUNCTIONS\n#\n\n# Generic remarks:\n# - When a language is specified which is not supported the test fails.  The\n#   message is a bit different, because not all the arguments for the normal\n#   message are available yet (chicken-egg problem).\n\n\ndef CheckBuilder(context, text = None, language = None):\n    \"\"\"\n    Configure check to see if the compiler works.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    \"text\" may be used to specify the code to be build.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"%s\\n\" % msg)\n        return msg\n\n    if not text:\n        text = \"\"\"\nint main() {\n    return 0;\n}\n\"\"\"\n\n    context.Display(\"Checking if building a %s file works... \" % lang)\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCC(context):\n    \"\"\"\n    Configure check for a working C compiler.\n\n    This checks whether the C compiler, as defined in the $CC construction\n    variable, can compile a C source file. It uses the current $CCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C compiler works... \")\n    text = \"\"\"\nint main()\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CC', text, 'C')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCC(context):\n    \"\"\"\n    Configure check for a working shared C compiler.\n\n    This checks whether the C compiler, as defined in the $SHCC construction\n    variable, can compile a C source file. It uses the current $SHCCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C compiler works... \")\n    text = \"\"\"\nint foo()\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCC', text, 'C', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCXX(context):\n    \"\"\"\n    Configure check for a working CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $CXX construction\n    variable, can compile a CXX source file. It uses the current $CXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C++ compiler works... \")\n    text = \"\"\"\nint main()\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CXX', text, 'C++')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCXX(context):\n    \"\"\"\n    Configure check for a working shared CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $SHCXX construction\n    variable, can compile a CXX source file. It uses the current $SHCXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C++ compiler works... \")\n    text = \"\"\"\nint main()\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCXX', text, 'C++', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef _check_empty_program(context, comp, text, language, use_shared = False):\n    \"\"\"Return 0 on success, 1 otherwise.\"\"\"\n    if comp not in context.env or not context.env[comp]:\n        # The compiler construction variable is not set or empty\n        return 1\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        return 1\n\n    if use_shared:\n        return context.CompileSharedObject(text, suffix)\n    else:\n        return context.CompileProg(text, suffix)\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    \"\"\"\n    Configure check for a function \"function_name\".\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Optional \"header\" can be defined to define a function prototype, include a\n    header file or anything else that comes before main().\n    Sets HAVE_function_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Remarks from autoconf:\n    # - Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>\n    #   which includes <sys/select.h> which contains a prototype for select.\n    #   Similarly for bzero.\n    # - assert.h is included to define __stub macros and hopefully few\n    #   prototypes, which can conflict with char $1(); below.\n    # - Override any gcc2 internal prototype to avoid an error.\n    # - We use char for the function declaration because int might match the\n    #   return type of a gcc2 builtin and then its argument prototype would\n    #   still apply.\n    # - The GNU C library defines this for functions which it implements to\n    #   always fail with ENOSYS.  Some functions are actually named something\n    #   starting with __ and the normal name is an alias.\n\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\"\"\" % function_name\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s(): %s\\n\" % (function_name, msg))\n        return msg\n\n    text = \"\"\"\n%(include)s\n#include <assert.h>\n%(hdr)s\n\nint main() {\n#if defined (__stub_%(name)s) || defined (__stub___%(name)s)\n  fail fail fail\n#else\n  %(name)s();\n#endif\n\n  return 0;\n}\n\"\"\" % { 'name': function_name,\n        'include': includetext,\n        'hdr': header }\n\n    context.Display(\"Checking for %s function %s()... \" % (lang, function_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + function_name, text,\n                 \"Define to 1 if the system has the function `%s'.\" %\\\n                 function_name)\n    return ret\n\n\ndef CheckHeader(context, header_name, header = None, language = None,\n                                                        include_quotes = None):\n    \"\"\"\n    Configure check for a C or C++ header file \"header_name\".\n    Optional \"header\" can be defined to do something before including the\n    header file (unusual, supported for consistency).\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_header_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS and $CPPFLAGS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Why compile the program instead of just running the preprocessor?\n    # It is possible that the header file exists, but actually using it may\n    # fail (e.g., because it depends on other header files).  Thus this test is\n    # more strict.  It may require using the \"header\" argument.\n    #\n    # Use <> by default, because the check is normally used for system header\n    # files.  SCons passes '\"\"' to overrule this.\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"\\n' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for header file %s: %s\\n\"\n                                                          % (header_name, msg))\n        return msg\n\n    if not include_quotes:\n        include_quotes = \"<>\"\n\n    text = \"%s%s\\n#include %s%s%s\\n\\n\" % (includetext, header,\n                             include_quotes[0], header_name, include_quotes[1])\n\n    context.Display(\"Checking for %s header file %s... \" % (lang, header_name))\n    ret = context.CompileProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + header_name, text,\n                 \"Define to 1 if you have the <%s> header file.\" % header_name)\n    return ret\n\n\ndef CheckType(context, type_name, fallback = None,\n                                               header = None, language = None):\n    \"\"\"\n    Configure check for a C or C++ type \"type_name\".\n    Optional \"header\" can be defined to include a header file.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_type_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    # Remarks from autoconf about this test:\n    # - Grepping for the type in include files is not reliable (grep isn't\n    #   portable anyway).\n    # - Using \"TYPE my_var;\" doesn't work for const qualified types in C++.\n    #   Adding an initializer is not valid for some C++ classes.\n    # - Using the type as parameter to a function either fails for K&$ C or for\n    #   C++.\n    # - Using \"TYPE *my_var;\" is valid in C for some types that are not\n    #   declared (struct something).\n    # - Using \"sizeof(TYPE)\" is valid when TYPE is actually a variable.\n    # - Using the previous two together works reliably.\n    text = \"\"\"\n%(include)s\n%(header)s\n\nint main() {\n  if ((%(name)s *) 0)\n    return 0;\n  if (sizeof (%(name)s))\n    return 0;\n}\n\"\"\" % { 'include': includetext,\n        'header': header,\n        'name': type_name }\n\n    context.Display(\"Checking for %s type %s... \" % (lang, type_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + type_name, text,\n                 \"Define to 1 if the system has the type `%s'.\" % type_name)\n    if ret and fallback and context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(\"typedef %s %s;\\n\" % (fallback, type_name))\n        f.close()\n\n    return ret\n\ndef CheckTypeSize(context, type_name, header = None, language = None, expect = None):\n    \"\"\"This check can be used to get the size of a given type, or to check whether\n    the type is of expected size.\n\n    Arguments:\n        - type : str\n            the type to check\n        - includes : sequence\n            list of headers to include in the test code before testing the type\n        - language : str\n            'C' or 'C++'\n        - expect : int\n            if given, will test wether the type has the given number of bytes.\n            If not given, will automatically find the size.\n\n        Returns:\n            status : int\n                0 if the check failed, or the found size of the type if the check succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    src = includetext + header\n    if not expect is None:\n        # Only check if the given size is the right one\n        context.Display('Checking %s is %d bytes... ' % (type_name, expect))\n\n        # test code taken from autoconf: this is a pretty clever hack to find that\n        # a type is of a given size using only compilation. This speeds things up\n        # quite a bit compared to straightforward code using TryRun\n        src = src + r\"\"\"\ntypedef %s scons_check_type;\n\nint main()\n{\n    static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)];\n    test_array[0] = 0;\n\n    return 0;\n}\n\"\"\"\n\n        st = context.CompileProg(src % (type_name, expect), suffix)\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, expect,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return expect\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n    else:\n        # Only check if the given size is the right one\n        context.Message('Checking size of %s ... ' % type_name)\n\n        # We have to be careful with the program we wish to test here since\n        # compilation will be attempted using the current environment's flags.\n        # So make sure that the program will compile without any warning. For\n        # example using: 'int main(int argc, char** argv)' will fail with the\n        # '-Wall -Werror' flags since the variables argc and argv would not be\n        # used in the program...\n        #\n        src = src + \"\"\"\n#include <stdlib.h>\n#include <stdio.h>\nint main() {\n    printf(\"%d\", (int)sizeof(\"\"\" + type_name + \"\"\"));\n    return 0;\n}\n    \"\"\"\n        st, out = context.RunProg(src, suffix)\n        try:\n            size = int(out)\n        except ValueError:\n            # If cannot convert output of test prog to an integer (the size),\n            # something went wront, so just fail\n            st = 1\n            size = 0\n\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, size,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return size\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n\n    return 0\n\ndef CheckDeclaration(context, symbol, includes = None, language = None):\n    \"\"\"Checks whether symbol is declared.\n\n    Use the same test as autoconf, that is test whether the symbol is defined\n    as a macro or can be used as an r-value.\n\n    Arguments:\n        symbol : str\n            the symbol to check\n        includes : str\n            Optional \"header\" can be defined to include a header file.\n        language : str\n            only C and C++ supported.\n\n    Returns:\n        status : bool\n            True if the check failed, False if succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not includes:\n        includes = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for declaration %s: %s\\n\" % (symbol, msg))\n        return msg\n\n    src = includetext + includes\n    context.Display('Checking whether %s is declared... ' % symbol)\n\n    src = src + r\"\"\"\nint main()\n{\n#ifndef %s\n    (void) %s;\n#endif\n    ;\n    return 0;\n}\n\"\"\" % (symbol, symbol)\n\n    st = context.CompileProg(src, suffix)\n    _YesNoResult(context, st, \"HAVE_DECL_\" + symbol, src,\n                 \"Set to 1 if %s is defined.\" % symbol)\n    return st\n\ndef CheckLib(context, libs, func_name = None, header = None,\n             extra_libs = None, call = None, language = None, autoadd = 1,\n             append = True):\n    \"\"\"\n    Configure check for a C or C++ libraries \"libs\".  Searches through\n    the list of libraries, until one is found where the test succeeds.\n    Tests if \"func_name\" or \"call\" exists in the library.  Note: if it exists\n    in another library the test succeeds anyway!\n    Optional \"header\" can be defined to include a header file.  If not given a\n    default prototype for \"func_name\" is added.\n    Optional \"extra_libs\" is a list of library names to be added after\n    \"lib_name\" in the build command.  To be used for libraries that \"lib_name\"\n    depends on.\n    Optional \"call\" replaces the call to \"func_name\" in the test code.  It must\n    consist of complete C statements, including a trailing \";\".\n    Both \"func_name\" and \"call\" arguments are optional, and in that case, just\n    linking against the libs is tested.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    text = \"\"\"\n%s\n%s\"\"\" % (includetext, header)\n\n    # Add a function declaration if needed.\n    if func_name and func_name != \"main\":\n        if not header:\n            text = text + \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\n\"\"\" % func_name\n\n        # The actual test code.\n        if not call:\n            call = \"%s();\" % func_name\n\n    # if no function to test, leave main() blank\n    text = text + \"\"\"\nint\nmain() {\n  %s\nreturn 0;\n}\n\"\"\" % (call or \"\")\n\n    if call:\n        i = call.find(\"\\n\")\n        if i > 0:\n            calltext = call[:i] + \"..\"\n        elif call[-1] == ';':\n            calltext = call[:-1]\n        else:\n            calltext = call\n\n    for lib_name in libs:\n\n        lang, suffix, msg = _lang2suffix(language)\n        if msg:\n            context.Display(\"Cannot check for library %s: %s\\n\" % (lib_name, msg))\n            return msg\n\n        # if a function was specified to run in main(), say it\n        if call:\n                context.Display(\"Checking for %s in %s library %s... \"\n                                % (calltext, lang, lib_name))\n        # otherwise, just say the name of library and language\n        else:\n                context.Display(\"Checking for %s library %s... \"\n                                % (lang, lib_name))\n\n        if lib_name:\n            l = [ lib_name ]\n            if extra_libs:\n                l.extend(extra_libs)\n            if append:\n                oldLIBS = context.AppendLIBS(l)\n            else:\n                oldLIBS = context.PrependLIBS(l)\n            sym = \"HAVE_LIB\" + lib_name\n        else:\n            oldLIBS = -1\n            sym = None\n\n        ret = context.BuildProg(text, suffix)\n\n        _YesNoResult(context, ret, sym, text,\n                     \"Define to 1 if you have the `%s' library.\" % lib_name)\n        if oldLIBS != -1 and (ret or not autoadd):\n            context.SetLIBS(oldLIBS)\n\n        if not ret:\n            return ret\n\n    return ret\n\n#\n# END OF PUBLIC FUNCTIONS\n#\n\ndef _YesNoResult(context, ret, key, text, comment = None):\n    \"\"\"\n    Handle the result of a test with a \"yes\" or \"no\" result.\n    \"ret\" is the return value: empty if OK, error message when not.\n    \"key\" is the name of the symbol to be defined (HAVE_foo).\n    \"text\" is the source code of the program used for testing.\n    \"comment\" is the C comment to add above the line defining the symbol (the\n    comment is automatically put inside a /* */). If None, no comment is added.\n    \"\"\"\n    if key:\n        _Have(context, key, not ret, comment)\n    if ret:\n        context.Display(\"no\\n\")\n        _LogFailed(context, text, ret)\n    else:\n        context.Display(\"yes\\n\")\n\n\ndef _Have(context, key, have, comment = None):\n    \"\"\"\n    Store result of a test in context.havedict and context.headerfilename.\n    \"key\" is a \"HAVE_abc\" name.  It is turned into all CAPITALS and non-\n    alphanumerics are replaced by an underscore.\n    The value of \"have\" can be:\n    1      - Feature is defined, add \"#define key\".\n    0      - Feature is not defined, add \"/* #undef key */\".\n             Adding \"undef\" is what autoconf does.  Not useful for the\n             compiler, but it shows that the test was done.\n    number - Feature is defined to this number \"#define key have\".\n             Doesn't work for 0 or 1, use a string then.\n    string - Feature is defined to this string \"#define key have\".\n             Give \"have\" as is should appear in the header file, include quotes\n             when desired and escape special characters!\n    \"\"\"\n    key_up = key.upper()\n    key_up = re.sub('[^A-Z0-9_]', '_', key_up)\n    context.havedict[key_up] = have\n    if have == 1:\n        line = \"#define %s 1\\n\" % key_up\n    elif have == 0:\n        line = \"/* #undef %s */\\n\" % key_up\n    elif isinstance(have, IntType):\n        line = \"#define %s %d\\n\" % (key_up, have)\n    else:\n        line = \"#define %s %s\\n\" % (key_up, str(have))\n\n    if comment is not None:\n        lines = \"\\n/* %s */\\n\" % comment + line\n    else:\n        lines = \"\\n\" + line\n\n    if context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(lines)\n        f.close()\n    elif hasattr(context,'config_h'):\n        context.config_h = context.config_h + lines\n\n\ndef _LogFailed(context, text, msg):\n    \"\"\"\n    Write to the log about a failed program.\n    Add line numbers, so that error messages can be understood.\n    \"\"\"\n    if LogInputFiles:\n        context.Log(\"Failed program was:\\n\")\n        lines = text.split('\\n')\n        if len(lines) and lines[-1] == '':\n            lines = lines[:-1]              # remove trailing empty line\n        n = 1\n        for line in lines:\n            context.Log(\"%d: %s\\n\" % (n, line))\n            n = n + 1\n    if LogErrorMessages:\n        context.Log(\"Error message: %s\\n\" % msg)\n\n\ndef _lang2suffix(lang):\n    \"\"\"\n    Convert a language name to a suffix.\n    When \"lang\" is empty or None C is assumed.\n    Returns a tuple (lang, suffix, None) when it works.\n    For an unrecognized language returns (None, None, msg).\n    Where:\n        lang   = the unified language name\n        suffix = the suffix, including the leading dot\n        msg    = an error message\n    \"\"\"\n    if not lang or lang in [\"C\", \"c\"]:\n        return (\"C\", \".c\", None)\n    if lang in [\"c++\", \"C++\", \"cpp\", \"CXX\", \"cxx\"]:\n        return (\"C++\", \".cpp\", None)\n\n    return None, None, \"Unsupported language: %s\" % lang\n\n\n# vim: set sw=4 et sts=4 tw=79 fo+=l:\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Debug.py",
    "content": "\"\"\"SCons.Debug\n\nCode for debugging SCons internal things.  Shouldn't be\nneeded by most users.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Debug.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport sys\nimport time\nimport weakref\n\n# Global variable that gets set to 'True' by the Main script,\n# when the creation of class instances should get tracked.\ntrack_instances = False\n# List of currently tracked classes\ntracked_classes = {}\n\ndef logInstanceCreation(instance, name=None):\n    if name is None:\n        name = instance.__class__.__name__\n    if name not in tracked_classes:\n        tracked_classes[name] = []\n    tracked_classes[name].append(weakref.ref(instance))\n\ndef string_to_classes(s):\n    if s == '*':\n        return sorted(tracked_classes.keys())\n    else:\n        return s.split()\n\ndef fetchLoggedInstances(classes=\"*\"):\n    classnames = string_to_classes(classes)\n    return [(cn, len(tracked_classes[cn])) for cn in classnames]\n\ndef countLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write(\"%s: %d\\n\" % (classname, len(tracked_classes[classname])))\n\ndef listLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            obj = ref()\n            if obj is not None:\n                file.write('    %s\\n' % repr(obj))\n\ndef dumpLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            obj = ref()\n            if obj is not None:\n                file.write('    %s:\\n' % obj)\n                for key, value in obj.__dict__.items():\n                    file.write('        %20s : %s\\n' % (key, value))\n\n\n\nif sys.platform[:5] == \"linux\":\n    # Linux doesn't actually support memory usage stats from getrusage().\n    def memory():\n        mstr = open('/proc/self/stat').read()\n        mstr = mstr.split()[22]\n        return int(mstr)\nelif sys.platform[:6] == 'darwin':\n    #TODO really get memory stats for OS X\n    def memory():\n        return 0\nelse:\n    try:\n        import resource\n    except ImportError:\n        try:\n            import win32process\n            import win32api\n        except ImportError:\n            def memory():\n                return 0\n        else:\n            def memory():\n                process_handle = win32api.GetCurrentProcess()\n                memory_info = win32process.GetProcessMemoryInfo( process_handle )\n                return memory_info['PeakWorkingSetSize']\n    else:\n        def memory():\n            res = resource.getrusage(resource.RUSAGE_SELF)\n            return res[4]\n\n# returns caller's stack\ndef caller_stack():\n    import traceback\n    tb = traceback.extract_stack()\n    # strip itself and the caller from the output\n    tb = tb[:-2]\n    result = []\n    for back in tb:\n        # (filename, line number, function name, text)\n        key = back[:3]\n        result.append('%s:%d(%s)' % func_shorten(key))\n    return result\n\ncaller_bases = {}\ncaller_dicts = {}\n\n# trace a caller's stack\ndef caller_trace(back=0):\n    import traceback\n    tb = traceback.extract_stack(limit=3+back)\n    tb.reverse()\n    callee = tb[1][:3]\n    caller_bases[callee] = caller_bases.get(callee, 0) + 1\n    for caller in tb[2:]:\n        caller = callee + caller[:3]\n        try:\n            entry = caller_dicts[callee]\n        except KeyError:\n            caller_dicts[callee] = entry = {}\n        entry[caller] = entry.get(caller, 0) + 1\n        callee = caller\n\n# print a single caller and its callers, if any\ndef _dump_one_caller(key, file, level=0):\n    leader = '      '*level\n    for v,c in sorted([(-v,c) for c,v in caller_dicts[key].items()]):\n        file.write(\"%s  %6d %s:%d(%s)\\n\" % ((leader,-v) + func_shorten(c[-3:])))\n        if c in caller_dicts:\n            _dump_one_caller(c, file, level+1)\n\n# print each call tree\ndef dump_caller_counts(file=sys.stdout):\n    for k in sorted(caller_bases.keys()):\n        file.write(\"Callers of %s:%d(%s), %d calls:\\n\"\n                    % (func_shorten(k) + (caller_bases[k],)))\n        _dump_one_caller(k, file)\n\nshorten_list = [\n    ( '/scons/SCons/',          1),\n    ( '/src/engine/SCons/',     1),\n    ( '/usr/lib/python',        0),\n]\n\nif os.sep != '/':\n    shorten_list = [(t[0].replace('/', os.sep), t[1]) for t in shorten_list]\n\ndef func_shorten(func_tuple):\n    f = func_tuple[0]\n    for t in shorten_list:\n        i = f.find(t[0])\n        if i >= 0:\n            if t[1]:\n                i = i + len(t[0])\n            return (f[i:],)+func_tuple[1:]\n    return func_tuple\n\n\nTraceFP = {}\nif sys.platform == 'win32':\n    TraceDefault = 'con'\nelse:\n    TraceDefault = '/dev/tty'\n\nTimeStampDefault = None\nStartTime = time.time()\nPreviousTime = StartTime\n\ndef Trace(msg, file=None, mode='w', tstamp=None):\n    \"\"\"Write a trace message to a file.  Whenever a file is specified,\n    it becomes the default for the next call to Trace().\"\"\"\n    global TraceDefault\n    global TimeStampDefault\n    global PreviousTime\n    if file is None:\n        file = TraceDefault\n    else:\n        TraceDefault = file\n    if tstamp is None:\n        tstamp = TimeStampDefault\n    else:\n        TimeStampDefault = tstamp\n    try:\n        fp = TraceFP[file]\n    except KeyError:\n        try:\n            fp = TraceFP[file] = open(file, mode)\n        except TypeError:\n            # Assume we were passed an open file pointer.\n            fp = file\n    if tstamp:\n        now = time.time()\n        fp.write('%8.4f %8.4f:  ' % (now - StartTime, now - PreviousTime))\n        PreviousTime = now\n    fp.write(msg)\n    fp.flush()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Defaults.py",
    "content": "\"\"\"SCons.Defaults\n\nBuilders and other things for the local site.  Here's where we'll\nduplicate the functionality of autoconf until we move it into the\ninstallation procedure or use something like qmconf.\n\nThe code that reads the registry to find MSVC components was borrowed\nfrom distutils.msvccompiler.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import division\n\n__revision__ = \"src/engine/SCons/Defaults.py  2014/07/05 09:42:21 garyo\"\n\n\nimport os\nimport errno\nimport shutil\nimport stat\nimport time\nimport sys\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.CacheDir\nimport SCons.Environment\nimport SCons.PathList\nimport SCons.Subst\nimport SCons.Tool\n\n# A placeholder for a default Environment (for fetching source files\n# from source code management systems and the like).  This must be\n# initialized later, after the top-level directory is set by the calling\n# interface.\n_default_env = None\n\n# Lazily instantiate the default environment so the overhead of creating\n# it doesn't apply when it's not needed.\ndef _fetch_DefaultEnvironment(*args, **kw):\n    \"\"\"\n    Returns the already-created default construction environment.\n    \"\"\"\n    global _default_env\n    return _default_env\n\ndef DefaultEnvironment(*args, **kw):\n    \"\"\"\n    Initial public entry point for creating the default construction\n    Environment.\n\n    After creating the environment, we overwrite our name\n    (DefaultEnvironment) with the _fetch_DefaultEnvironment() function,\n    which more efficiently returns the initialized default construction\n    environment without checking for its existence.\n\n    (This function still exists with its _default_check because someone\n    else (*cough* Script/__init__.py *cough*) may keep a reference\n    to this function.  So we can't use the fully functional idiom of\n    having the name originally be a something that *only* creates the\n    construction environment and then overwrites the name.)\n    \"\"\"\n    global _default_env\n    if not _default_env:\n        import SCons.Util\n        _default_env = SCons.Environment.Environment(*args, **kw)\n        if SCons.Util.md5:\n            _default_env.Decider('MD5')\n        else:\n            _default_env.Decider('timestamp-match')\n        global DefaultEnvironment\n        DefaultEnvironment = _fetch_DefaultEnvironment\n        _default_env._CacheDir_path = None\n    return _default_env\n\n# Emitters for setting the shared attribute on object files,\n# and an action for checking that all of the source files\n# going into a shared library are, in fact, shared.\ndef StaticObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = None\n    return (target, source)\n\ndef SharedObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = 1\n    return (target, source)\n\ndef SharedFlagChecker(source, target, env):\n    same = env.subst('$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME')\n    if same == '0' or same == '' or same == 'False':\n        for src in source:\n            try:\n                shared = src.attributes.shared\n            except AttributeError:\n                shared = None\n            if not shared:\n                raise SCons.Errors.UserError(\"Source file: %s is static and is not compatible with shared target: %s\" % (src, target[0]))\n\nSharedCheck = SCons.Action.Action(SharedFlagChecker, None)\n\n# Some people were using these variable name before we made\n# SourceFileScanner part of the public interface.  Don't break their\n# SConscript files until we've given them some fair warning and a\n# transition period.\nCScan = SCons.Tool.CScanner\nObjSourceScan = SCons.Tool.SourceFileScanner\nProgScan = SCons.Tool.ProgramScanner\n\n# These aren't really tool scanners, so they don't quite belong with\n# the rest of those in Tool/__init__.py, but I'm not sure where else\n# they should go.  Leave them here for now.\nimport SCons.Scanner.Dir\nDirScanner = SCons.Scanner.Dir.DirScanner()\nDirEntryScanner = SCons.Scanner.Dir.DirEntryScanner()\n\n# Actions for common languages.\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\")\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\")\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\")\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\")\n\nDAction = SCons.Action.Action(\"$DCOM\", \"$DCOMSTR\")\nShDAction = SCons.Action.Action(\"$SHDCOM\", \"$SHDCOMSTR\")\n\nASAction = SCons.Action.Action(\"$ASCOM\", \"$ASCOMSTR\")\nASPPAction = SCons.Action.Action(\"$ASPPCOM\", \"$ASPPCOMSTR\")\n\nLinkAction = SCons.Action.Action(\"$LINKCOM\", \"$LINKCOMSTR\")\nShLinkAction = SCons.Action.Action(\"$SHLINKCOM\", \"$SHLINKCOMSTR\")\n\nLdModuleLinkAction = SCons.Action.Action(\"$LDMODULECOM\", \"$LDMODULECOMSTR\")\n\n# Common tasks that we allow users to perform in platform-independent\n# ways by creating ActionFactory instances.\nActionFactory = SCons.Action.ActionFactory\n\ndef get_paths_str(dest):\n    # If dest is a list, we need to manually call str() on each element\n    if SCons.Util.is_List(dest):\n        elem_strs = []\n        for element in dest:\n            elem_strs.append('\"' + str(element) + '\"')\n        return '[' + ', '.join(elem_strs) + ']'\n    else:\n        return '\"' + str(dest) + '\"'\n\ndef chmod_func(dest, mode):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for element in dest:\n        os.chmod(str(element), mode)\n\ndef chmod_strfunc(dest, mode):\n    return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)\n\nChmod = ActionFactory(chmod_func, chmod_strfunc)\n\ndef copy_func(dest, src):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if SCons.Util.is_List(src) and os.path.isdir(dest):\n        for file in src:\n            shutil.copy2(file, dest)\n        return 0\n    elif os.path.isfile(src):\n        return shutil.copy2(src, dest)\n    else:\n        return shutil.copytree(src, dest, 1)\n\nCopy = ActionFactory(copy_func,\n                     lambda dest, src: 'Copy(\"%s\", \"%s\")' % (dest, src),\n                     convert=str)\n\ndef delete_func(dest, must_exist=0):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        entry = str(entry)\n        # os.path.exists returns False with broken links that exist\n        entry_exists = os.path.exists(entry) or os.path.islink(entry)\n        if not entry_exists and not must_exist:\n            continue\n        # os.path.isdir returns True when entry is a link to a dir\n        if os.path.isdir(entry) and not os.path.islink(entry):\n            shutil.rmtree(entry, 1)\n            continue\n        os.unlink(entry)\n\ndef delete_strfunc(dest, must_exist=0):\n    return 'Delete(%s)' % get_paths_str(dest)\n\nDelete = ActionFactory(delete_func, delete_strfunc)\n\ndef mkdir_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        try:\n            os.makedirs(str(entry))\n        except os.error, e:\n            p = str(entry)\n            if (e.args[0] == errno.EEXIST or\n                    (sys.platform=='win32' and e.args[0]==183)) \\\n                    and os.path.isdir(str(entry)):\n                pass            # not an error if already exists\n            else:\n                raise\n\nMkdir = ActionFactory(mkdir_func,\n                      lambda dir: 'Mkdir(%s)' % get_paths_str(dir))\n\ndef move_func(dest, src):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    SCons.Node.FS.invalidate_node_memos(src)\n    shutil.move(src, dest)\n\nMove = ActionFactory(move_func,\n                     lambda dest, src: 'Move(\"%s\", \"%s\")' % (dest, src),\n                     convert=str)\n\ndef touch_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for file in dest:\n        file = str(file)\n        mtime = int(time.time())\n        if os.path.exists(file):\n            atime = os.path.getatime(file)\n        else:\n            open(file, 'w')\n            atime = mtime\n        os.utime(file, (atime, mtime))\n\nTouch = ActionFactory(touch_func,\n                      lambda file: 'Touch(%s)' % get_paths_str(file))\n\n# Internal utility functions\n\ndef _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None):\n    \"\"\"\n    Creates a new list from 'list' by first interpolating each element\n    in the list using the 'env' dictionary and then calling f on the\n    list, and finally calling _concat_ixes to concatenate 'prefix' and\n    'suffix' onto each element of the list.\n    \"\"\"\n    if not list:\n        return list\n\n    l = f(SCons.PathList.PathList(list).subst_path(env, target, source))\n    if l is not None:\n        list = l\n\n    return _concat_ixes(prefix, list, suffix, env)\n\ndef _concat_ixes(prefix, list, suffix, env):\n    \"\"\"\n    Creates a new list from 'list' by concatenating the 'prefix' and\n    'suffix' arguments onto each element of the list.  A trailing space\n    on 'prefix' or leading space on 'suffix' will cause them to be put\n    into separate list elements rather than being concatenated.\n    \"\"\"\n\n    result = []\n\n    # ensure that prefix and suffix are strings\n    prefix = str(env.subst(prefix, SCons.Subst.SUBST_RAW))\n    suffix = str(env.subst(suffix, SCons.Subst.SUBST_RAW))\n\n    for x in list:\n        if isinstance(x, SCons.Node.FS.File):\n            result.append(x)\n            continue\n        x = str(x)\n        if x:\n\n            if prefix:\n                if prefix[-1] == ' ':\n                    result.append(prefix[:-1])\n                elif x[:len(prefix)] != prefix:\n                    x = prefix + x\n\n            result.append(x)\n\n            if suffix:\n                if suffix[0] == ' ':\n                    result.append(suffix[1:])\n                elif x[-len(suffix):] != suffix:\n                    result[-1] = result[-1]+suffix\n\n    return result\n\ndef _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):\n    \"\"\"\n    This is a wrapper around _concat()/_concat_ixes() that checks for\n    the existence of prefixes or suffixes on list items and strips them\n    where it finds them.  This is used by tools (like the GNU linker)\n    that need to turn something like 'libfoo.a' into '-lfoo'.\n    \"\"\"\n\n    if not itms:\n        return itms\n\n    if not callable(c):\n        env_c = env['_concat']\n        if env_c != _concat and callable(env_c):\n            # There's a custom _concat() method in the construction\n            # environment, and we've allowed people to set that in\n            # the past (see test/custom-concat.py), so preserve the\n            # backwards compatibility.\n            c = env_c\n        else:\n            c = _concat_ixes\n\n    stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes)))\n    stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes)))\n\n    stripped = []\n    for l in SCons.PathList.PathList(itms).subst_path(env, None, None):\n        if isinstance(l, SCons.Node.FS.File):\n            stripped.append(l)\n            continue\n\n        if not SCons.Util.is_String(l):\n            l = str(l)\n\n        for stripprefix in stripprefixes:\n            lsp = len(stripprefix)\n            if l[:lsp] == stripprefix:\n                l = l[lsp:]\n                # Do not strip more than one prefix\n                break\n\n        for stripsuffix in stripsuffixes:\n            lss = len(stripsuffix)\n            if l[-lss:] == stripsuffix:\n                l = l[:-lss]\n                # Do not strip more than one suffix\n                break\n\n        stripped.append(l)\n\n    return c(prefix, stripped, suffix, env)\n\ndef processDefines(defs):\n    \"\"\"process defines, resolving strings, lists, dictionaries, into a list of\n    strings\n    \"\"\"\n    if SCons.Util.is_List(defs):\n        l = []\n        for d in defs:\n            if d is None:\n                continue\n            elif SCons.Util.is_List(d) or isinstance(d, tuple):\n                if len(d) >= 2:\n                    l.append(str(d[0]) + '=' + str(d[1]))\n                else:\n                    l.append(str(d[0]))\n            elif SCons.Util.is_Dict(d):\n                for macro,value in d.iteritems():\n                    if value is not None:\n                        l.append(str(macro) + '=' + str(value))\n                    else:\n                        l.append(str(macro))\n            elif SCons.Util.is_String(d):\n                l.append(str(d))\n            else:\n                raise SCons.Errors.UserError(\"DEFINE %s is not a list, dict, string or None.\"%repr(d))\n    elif SCons.Util.is_Dict(defs):\n        # The items in a dictionary are stored in random order, but\n        # if the order of the command-line options changes from\n        # invocation to invocation, then the signature of the command\n        # line will change and we'll get random unnecessary rebuilds.\n        # Consequently, we have to sort the keys to ensure a\n        # consistent order...\n        l = []\n        for k,v in sorted(defs.items()):\n            if v is None:\n                l.append(str(k))\n            else:\n                l.append(str(k) + '=' + str(v))\n    else:\n        l = [str(defs)]\n    return l\n\ndef _defines(prefix, defs, suffix, env, c=_concat_ixes):\n    \"\"\"A wrapper around _concat_ixes that turns a list or string\n    into a list of C preprocessor command-line definitions.\n    \"\"\"\n\n    return c(prefix, env.subst_path(processDefines(defs)), suffix, env)\n\nclass NullCmdGenerator(object):\n    \"\"\"This is a callable class that can be used in place of other\n    command generators if you don't want them to do anything.\n\n    The __call__ method for this class simply returns the thing\n    you instantiated it with.\n\n    Example usage:\n    env[\"DO_NOTHING\"] = NullCmdGenerator\n    env[\"LINKCOM\"] = \"${DO_NOTHING('$LINK $SOURCES $TARGET')}\"\n    \"\"\"\n\n    def __init__(self, cmd):\n        self.cmd = cmd\n\n    def __call__(self, target, source, env, for_signature=None):\n        return self.cmd\n\nclass Variable_Method_Caller(object):\n    \"\"\"A class for finding a construction variable on the stack and\n    calling one of its methods.\n\n    We use this to support \"construction variables\" in our string\n    eval()s that actually stand in for methods--specifically, use\n    of \"RDirs\" in call to _concat that should actually execute the\n    \"TARGET.RDirs\" method.  (We used to support this by creating a little\n    \"build dictionary\" that mapped RDirs to the method, but this got in\n    the way of Memoizing construction environments, because we had to\n    create new environment objects to hold the variables.)\n    \"\"\"\n    def __init__(self, variable, method):\n        self.variable = variable\n        self.method = method\n    def __call__(self, *args, **kw):\n        try: 1//0\n        except ZeroDivisionError:\n            # Don't start iterating with the current stack-frame to\n            # prevent creating reference cycles (f_back is safe).\n            frame = sys.exc_info()[2].tb_frame.f_back\n        variable = self.variable\n        while frame:\n            if variable in frame.f_locals:\n                v = frame.f_locals[variable]\n                if v:\n                    method = getattr(v, self.method)\n                    return method(*args, **kw)\n            frame = frame.f_back\n        return None\n\nConstructionEnvironment = {\n    'BUILDERS'      : {},\n    'SCANNERS'      : [],\n    'CONFIGUREDIR'  : '#/.sconf_temp',\n    'CONFIGURELOG'  : '#/config.log',\n    'CPPSUFFIXES'   : SCons.Tool.CSuffixes,\n    'DSUFFIXES'     : SCons.Tool.DSuffixes,\n    'ENV'           : {},\n    'IDLSUFFIXES'   : SCons.Tool.IDLSuffixes,\n#    'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, # moved to the TeX tools generate functions\n    '_concat'       : _concat,\n    '_defines'      : _defines,\n    '_stripixes'    : _stripixes,\n    '_LIBFLAGS'     : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',\n    '_LIBDIRFLAGS'  : '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',\n    '_CPPINCFLAGS'  : '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',\n    '_CPPDEFFLAGS'  : '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',\n    'TEMPFILE'      : NullCmdGenerator,\n    'Dir'           : Variable_Method_Caller('TARGET', 'Dir'),\n    'Dirs'          : Variable_Method_Caller('TARGET', 'Dirs'),\n    'File'          : Variable_Method_Caller('TARGET', 'File'),\n    'RDirs'         : Variable_Method_Caller('TARGET', 'RDirs'),\n}\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Environment.py",
    "content": "\"\"\"SCons.Environment\n\nBase class for construction Environments.  These are\nthe primary objects used to communicate dependency and\nconstruction information to the build engine.\n\nKeyword arguments supplied when the construction Environment\nis created are construction variables used to initialize the\nEnvironment\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Environment.py  2014/07/05 09:42:21 garyo\"\n\n\nimport copy\nimport os\nimport sys\nimport re\nimport shlex\nfrom collections import UserDict\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Node.Python\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.SConsign\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\n\nclass _Null(object):\n    pass\n\n_null = _Null\n\n_warn_copy_deprecated = True\n_warn_source_signatures_deprecated = True\n_warn_target_signatures_deprecated = True\n\nCleanTargets = {}\nCalculatorArgs = {}\n\nsemi_deepcopy = SCons.Util.semi_deepcopy\nsemi_deepcopy_dict = SCons.Util.semi_deepcopy_dict\n\n# Pull UserError into the global name space for the benefit of\n# Environment().SourceSignatures(), which has some import statements\n# which seem to mess up its ability to reference SCons directly.\nUserError = SCons.Errors.UserError\n\ndef alias_builder(env, target, source):\n    pass\n\nAliasBuilder = SCons.Builder.Builder(action = alias_builder,\n                                     target_factory = SCons.Node.Alias.default_ans.Alias,\n                                     source_factory = SCons.Node.FS.Entry,\n                                     multi = 1,\n                                     is_explicit = None,\n                                     name='AliasBuilder')\n\ndef apply_tools(env, tools, toolpath):\n    # Store the toolpath in the Environment.\n    if toolpath is not None:\n        env['toolpath'] = toolpath\n\n    if not tools:\n        return\n    # Filter out null tools from the list.\n    for tool in [_f for _f in tools if _f]:\n        if SCons.Util.is_List(tool) or isinstance(tool, tuple):\n            toolname = tool[0]\n            toolargs = tool[1] # should be a dict of kw args\n            tool = env.Tool(toolname, **toolargs)\n        else:\n            env.Tool(tool)\n\n# These names are (or will be) controlled by SCons; users should never\n# set or override them.  This warning can optionally be turned off,\n# but scons will still ignore the illegal variable names even if it's off.\nreserved_construction_var_names = [\n    'CHANGED_SOURCES',\n    'CHANGED_TARGETS',\n    'SOURCE',\n    'SOURCES',\n    'TARGET',\n    'TARGETS',\n    'UNCHANGED_SOURCES',\n    'UNCHANGED_TARGETS',\n]\n\nfuture_reserved_construction_var_names = [\n    #'HOST_OS',\n    #'HOST_ARCH',\n    #'HOST_CPU',\n    ]\n\ndef copy_non_reserved_keywords(dict):\n    result = semi_deepcopy(dict)\n    for k in result.keys():\n        if k in reserved_construction_var_names:\n            msg = \"Ignoring attempt to set reserved variable `$%s'\"\n            SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k)\n            del result[k]\n    return result\n\ndef _set_reserved(env, key, value):\n    msg = \"Ignoring attempt to set reserved variable `$%s'\"\n    SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key)\n\ndef _set_future_reserved(env, key, value):\n    env._dict[key] = value\n    msg = \"`$%s' will be reserved in a future release and setting it will become ignored\"\n    SCons.Warnings.warn(SCons.Warnings.FutureReservedVariableWarning, msg % key)\n\ndef _set_BUILDERS(env, key, value):\n    try:\n        bd = env._dict[key]\n        for k in bd.keys():\n            del bd[k]\n    except KeyError:\n        bd = BuilderDict(kwbd, env)\n        env._dict[key] = bd\n    for k, v in value.items():\n        if not SCons.Builder.is_a_Builder(v):\n            raise SCons.Errors.UserError('%s is not a Builder.' % repr(v))\n    bd.update(value)\n\ndef _del_SCANNERS(env, key):\n    del env._dict[key]\n    env.scanner_map_delete()\n\ndef _set_SCANNERS(env, key, value):\n    env._dict[key] = value\n    env.scanner_map_delete()\n\ndef _delete_duplicates(l, keep_last):\n    \"\"\"Delete duplicates from a sequence, keeping the first or last.\"\"\"\n    seen={}\n    result=[]\n    if keep_last:           # reverse in & out, then keep first\n        l.reverse()\n    for i in l:\n        try:\n            if i not in seen:\n                result.append(i)\n                seen[i]=1\n        except TypeError:\n            # probably unhashable.  Just keep it.\n            result.append(i)\n    if keep_last:\n        result.reverse()\n    return result\n\n\n\n# The following is partly based on code in a comment added by Peter\n# Shannon at the following page (there called the \"transplant\" class):\n#\n# ASPN : Python Cookbook : Dynamically added methods to a class\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732\n#\n# We had independently been using the idiom as BuilderWrapper, but\n# factoring out the common parts into this base class, and making\n# BuilderWrapper a subclass that overrides __call__() to enforce specific\n# Builder calling conventions, simplified some of our higher-layer code.\n\nclass MethodWrapper(object):\n    \"\"\"\n    A generic Wrapper class that associates a method (which can\n    actually be any callable) with an object.  As part of creating this\n    MethodWrapper object an attribute with the specified (by default,\n    the name of the supplied method) is added to the underlying object.\n    When that new \"method\" is called, our __call__() method adds the\n    object as the first argument, simulating the Python behavior of\n    supplying \"self\" on method calls.\n\n    We hang on to the name by which the method was added to the underlying\n    base class so that we can provide a method to \"clone\" ourselves onto\n    a new underlying object being copied (without which we wouldn't need\n    to save that info).\n    \"\"\"\n    def __init__(self, object, method, name=None):\n        if name is None:\n            name = method.__name__\n        self.object = object\n        self.method = method\n        self.name = name\n        setattr(self.object, name, self)\n\n    def __call__(self, *args, **kwargs):\n        nargs = (self.object,) + args\n        return self.method(*nargs, **kwargs)\n\n    def clone(self, new_object):\n        \"\"\"\n        Returns an object that re-binds the underlying \"method\" to\n        the specified new object.\n        \"\"\"\n        return self.__class__(new_object, self.method, self.name)\n\nclass BuilderWrapper(MethodWrapper):\n    \"\"\"\n    A MethodWrapper subclass that that associates an environment with\n    a Builder.\n\n    This mainly exists to wrap the __call__() function so that all calls\n    to Builders can have their argument lists massaged in the same way\n    (treat a lone argument as the source, treat two arguments as target\n    then source, make sure both target and source are lists) without\n    having to have cut-and-paste code to do it.\n\n    As a bit of obsessive backwards compatibility, we also intercept\n    attempts to get or set the \"env\" or \"builder\" attributes, which were\n    the names we used before we put the common functionality into the\n    MethodWrapper base class.  We'll keep this around for a while in case\n    people shipped Tool modules that reached into the wrapper (like the\n    Tool/qt.py module does, or did).  There shouldn't be a lot attribute\n    fetching or setting on these, so a little extra work shouldn't hurt.\n    \"\"\"\n    def __call__(self, target=None, source=_null, *args, **kw):\n        if source is _null:\n            source = target\n            target = None\n        if target is not None and not SCons.Util.is_List(target):\n            target = [target]\n        if source is not None and not SCons.Util.is_List(source):\n            source = [source]\n        return MethodWrapper.__call__(self, target, source, *args, **kw)\n\n    def __repr__(self):\n        return '<BuilderWrapper %s>' % repr(self.name)\n\n    def __str__(self):\n        return self.__repr__()\n\n    def __getattr__(self, name):\n        if name == 'env':\n            return self.object\n        elif name == 'builder':\n            return self.method\n        else:\n            raise AttributeError(name)\n\n    def __setattr__(self, name, value):\n        if name == 'env':\n            self.object = value\n        elif name == 'builder':\n            self.method = value\n        else:\n            self.__dict__[name] = value\n\n    # This allows a Builder to be executed directly\n    # through the Environment to which it's attached.\n    # In practice, we shouldn't need this, because\n    # builders actually get executed through a Node.\n    # But we do have a unit test for this, and can't\n    # yet rule out that it would be useful in the\n    # future, so leave it for now.\n    #def execute(self, **kw):\n    #    kw['env'] = self.env\n    #    self.builder.execute(**kw)\n\nclass BuilderDict(UserDict):\n    \"\"\"This is a dictionary-like class used by an Environment to hold\n    the Builders.  We need to do this because every time someone changes\n    the Builders in the Environment's BUILDERS dictionary, we must\n    update the Environment's attributes.\"\"\"\n    def __init__(self, dict, env):\n        # Set self.env before calling the superclass initialization,\n        # because it will end up calling our other methods, which will\n        # need to point the values in this dictionary to self.env.\n        self.env = env\n        UserDict.__init__(self, dict)\n\n    def __semi_deepcopy__(self):\n        # These cannot be copied since they would both modify the same builder object, and indeed\n        # just copying would modify the original builder\n        raise TypeError( 'cannot semi_deepcopy a BuilderDict' )\n\n    def __setitem__(self, item, val):\n        try:\n            method = getattr(self.env, item).method\n        except AttributeError:\n            pass\n        else:\n            self.env.RemoveMethod(method)\n        UserDict.__setitem__(self, item, val)\n        BuilderWrapper(self.env, val, item)\n\n    def __delitem__(self, item):\n        UserDict.__delitem__(self, item)\n        delattr(self.env, item)\n\n    def update(self, dict):\n        for i, v in dict.items():\n            self.__setitem__(i, v)\n\n\n\n_is_valid_var = re.compile(r'[_a-zA-Z]\\w*$')\n\ndef is_valid_construction_var(varstr):\n    \"\"\"Return if the specified string is a legitimate construction\n    variable.\n    \"\"\"\n    return _is_valid_var.match(varstr)\n\n\n\nclass SubstitutionEnvironment(object):\n    \"\"\"Base class for different flavors of construction environments.\n\n    This class contains a minimal set of methods that handle contruction\n    variable expansion and conversion of strings to Nodes, which may or\n    may not be actually useful as a stand-alone class.  Which methods\n    ended up in this class is pretty arbitrary right now.  They're\n    basically the ones which we've empirically determined are common to\n    the different construction environment subclasses, and most of the\n    others that use or touch the underlying dictionary of construction\n    variables.\n\n    Eventually, this class should contain all the methods that we\n    determine are necessary for a \"minimal\" interface to the build engine.\n    A full \"native Python\" SCons environment has gotten pretty heavyweight\n    with all of the methods and Tools and construction variables we've\n    jammed in there, so it would be nice to have a lighter weight\n    alternative for interfaces that don't need all of the bells and\n    whistles.  (At some point, we'll also probably rename this class\n    \"Base,\" since that more reflects what we want this class to become,\n    but because we've released comments that tell people to subclass\n    Environment.Base to create their own flavors of construction\n    environment, we'll save that for a future refactoring when this\n    class actually becomes useful.)\n    \"\"\"\n\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    def __init__(self, **kw):\n        \"\"\"Initialization of an underlying SubstitutionEnvironment class.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = kw.copy()\n        self._init_special()\n        self.added_methods = []\n        #self._memo = {}\n\n    def _init_special(self):\n        \"\"\"Initial the dispatch tables for special handling of\n        special construction variables.\"\"\"\n        self._special_del = {}\n        self._special_del['SCANNERS'] = _del_SCANNERS\n\n        self._special_set = {}\n        for key in reserved_construction_var_names:\n            self._special_set[key] = _set_reserved\n        for key in future_reserved_construction_var_names:\n            self._special_set[key] = _set_future_reserved\n        self._special_set['BUILDERS'] = _set_BUILDERS\n        self._special_set['SCANNERS'] = _set_SCANNERS\n\n        # Freeze the keys of self._special_set in a list for use by\n        # methods that need to check.  (Empirically, list scanning has\n        # gotten better than dict.has_key() in Python 2.5.)\n        self._special_set_keys = list(self._special_set.keys())\n\n    def __cmp__(self, other):\n        return cmp(self._dict, other._dict)\n\n    def __delitem__(self, key):\n        special = self._special_del.get(key)\n        if special:\n            special(self, key)\n        else:\n            del self._dict[key]\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __setitem__(self, key, value):\n        # This is heavily used.  This implementation is the best we have\n        # according to the timings in bench/env.__setitem__.py.\n        #\n        # The \"key in self._special_set_keys\" test here seems to perform\n        # pretty well for the number of keys we have.  A hard-coded\n        # list works a little better in Python 2.5, but that has the\n        # disadvantage of maybe getting out of sync if we ever add more\n        # variable names.  Using self._special_set.has_key() works a\n        # little better in Python 2.4, but is worse than this test.\n        # So right now it seems like a good trade-off, but feel free to\n        # revisit this with bench/env.__setitem__.py as needed (and\n        # as newer versions of Python come out).\n        if key in self._special_set_keys:\n            self._special_set[key](self, key, value)\n        else:\n            # If we already have the entry, then it's obviously a valid\n            # key and we don't need to check.  If we do check, using a\n            # global, pre-compiled regular expression directly is more\n            # efficient than calling another function or a method.\n            if key not in self._dict \\\n               and not _is_valid_var.match(key):\n                    raise SCons.Errors.UserError(\"Illegal construction variable `%s'\" % key)\n            self._dict[key] = value\n\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        return self._dict.get(key, default)\n\n    def has_key(self, key):\n        return key in self._dict\n\n    def __contains__(self, key):\n        return self._dict.__contains__(key)\n\n    def items(self):\n        return list(self._dict.items())\n\n    def arg2nodes(self, args, node_factory=_null, lookup_list=_null, **kw):\n        if node_factory is _null:\n            node_factory = self.fs.File\n        if lookup_list is _null:\n            lookup_list = self.lookup_list\n\n        if not args:\n            return []\n\n        args = SCons.Util.flatten(args)\n\n        nodes = []\n        for v in args:\n            if SCons.Util.is_String(v):\n                n = None\n                for l in lookup_list:\n                    n = l(v)\n                    if n is not None:\n                        break\n                if n is not None:\n                    if SCons.Util.is_String(n):\n                        # n = self.subst(n, raw=1, **kw)\n                        kw['raw'] = 1\n                        n = self.subst(n, **kw)\n                        if node_factory:\n                            n = node_factory(n)\n                    if SCons.Util.is_List(n):\n                        nodes.extend(n)\n                    else:\n                        nodes.append(n)\n                elif node_factory:\n                    # v = node_factory(self.subst(v, raw=1, **kw))\n                    kw['raw'] = 1\n                    v = node_factory(self.subst(v, **kw))\n                    if SCons.Util.is_List(v):\n                        nodes.extend(v)\n                    else:\n                        nodes.append(v)\n            else:\n                nodes.append(v)\n\n        return nodes\n\n    def gvars(self):\n        return self._dict\n\n    def lvars(self):\n        return {}\n\n    def subst(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Recursively interpolates construction variables from the\n        Environment into the specified string, returning the expanded\n        result.  Construction variables are specified by a $ prefix\n        in the string and begin with an initial underscore or\n        alphabetic character followed by any number of underscores\n        or alphanumeric characters.  The construction variable names\n        may be surrounded by curly braces to separate the name from\n        trailing characters.\n        \"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_kw(self, kw, raw=0, target=None, source=None):\n        nkw = {}\n        for k, v in kw.items():\n            k = self.subst(k, raw, target, source)\n            if SCons.Util.is_String(v):\n                v = self.subst(v, raw, target, source)\n            nkw[k] = v\n        return nkw\n\n    def subst_list(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Calls through to SCons.Subst.scons_subst_list().  See\n        the documentation for that function.\"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst_list(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_path(self, path, target=None, source=None):\n        \"\"\"Substitute a path list, turning EntryProxies into Nodes\n        and leaving Nodes (and other objects) as-is.\"\"\"\n\n        if not SCons.Util.is_List(path):\n            path = [path]\n\n        def s(obj):\n            \"\"\"This is the \"string conversion\" routine that we have our\n            substitutions use to return Nodes, not strings.  This relies\n            on the fact that an EntryProxy object has a get() method that\n            returns the underlying Node that it wraps, which is a bit of\n            architectural dependence that we might need to break or modify\n            in the future in response to additional requirements.\"\"\"\n            try:\n                get = obj.get\n            except AttributeError:\n                obj = SCons.Util.to_String_for_subst(obj)\n            else:\n                obj = get()\n            return obj\n\n        r = []\n        for p in path:\n            if SCons.Util.is_String(p):\n                p = self.subst(p, target=target, source=source, conv=s)\n                if SCons.Util.is_List(p):\n                    if len(p) == 1:\n                        p = p[0]\n                    else:\n                        # We have an object plus a string, or multiple\n                        # objects that we need to smush together.  No choice\n                        # but to make them into a string.\n                        p = ''.join(map(SCons.Util.to_String_for_subst, p))\n            else:\n                p = s(p)\n            r.append(p)\n        return r\n\n    subst_target_source = subst\n\n    def backtick(self, command):\n        import subprocess\n        # common arguments\n        kw = { 'stdin' : 'devnull',\n               'stdout' : subprocess.PIPE,\n               'stderr' : subprocess.PIPE,\n               'universal_newlines' : True,\n             }\n        # if the command is a list, assume it's been quoted\n        # othewise force a shell\n        if not SCons.Util.is_List(command): kw['shell'] = True\n        # run constructed command\n        p = SCons.Action._subproc(self, command, **kw)\n        out,err = p.communicate()\n        status = p.wait()\n        if err:\n            sys.stderr.write(unicode(err))\n        if status:\n            raise OSError(\"'%s' exited %d\" % (command, status))\n        return out\n\n    def AddMethod(self, function, name=None):\n        \"\"\"\n        Adds the specified function as a method of this construction\n        environment with the specified name.  If the name is omitted,\n        the default name is the name of the function itself.\n        \"\"\"\n        method = MethodWrapper(self, function, name)\n        self.added_methods.append(method)\n\n    def RemoveMethod(self, function):\n        \"\"\"\n        Removes the specified function's MethodWrapper from the\n        added_methods list, so we don't re-bind it when making a clone.\n        \"\"\"\n        self.added_methods = [dm for dm in self.added_methods if not dm.method is function]\n\n    def Override(self, overrides):\n        \"\"\"\n        Produce a modified environment whose variables are overriden by\n        the overrides dictionaries.  \"overrides\" is a dictionary that\n        will override the variables of this environment.\n\n        This function is much more efficient than Clone() or creating\n        a new Environment because it doesn't copy the construction\n        environment dictionary, it just wraps the underlying construction\n        environment, and doesn't even create a wrapper object if there\n        are no overrides.\n        \"\"\"\n        if not overrides: return self\n        o = copy_non_reserved_keywords(overrides)\n        if not o: return self\n        overrides = {}\n        merges = None\n        for key, value in o.items():\n            if key == 'parse_flags':\n                merges = value\n            else:\n                overrides[key] = SCons.Subst.scons_subst_once(value, self, key)\n        env = OverrideEnvironment(self, overrides)\n        if merges: env.MergeFlags(merges)\n        return env\n\n    def ParseFlags(self, *flags):\n        \"\"\"\n        Parse the set of flags and return a dict with the flags placed\n        in the appropriate entry.  The flags are treated as a typical\n        set of command-line flags for a GNU-like toolchain and used to\n        populate the entries in the dict immediately below.  If one of\n        the flag strings begins with a bang (exclamation mark), it is\n        assumed to be a command and the rest of the string is executed;\n        the result of that evaluation is then added to the dict.\n        \"\"\"\n        dict = {\n            'ASFLAGS'       : SCons.Util.CLVar(''),\n            'CFLAGS'        : SCons.Util.CLVar(''),\n            'CCFLAGS'       : SCons.Util.CLVar(''),\n            'CXXFLAGS'      : SCons.Util.CLVar(''),\n            'CPPDEFINES'    : [],\n            'CPPFLAGS'      : SCons.Util.CLVar(''),\n            'CPPPATH'       : [],\n            'FRAMEWORKPATH' : SCons.Util.CLVar(''),\n            'FRAMEWORKS'    : SCons.Util.CLVar(''),\n            'LIBPATH'       : [],\n            'LIBS'          : [],\n            'LINKFLAGS'     : SCons.Util.CLVar(''),\n            'RPATH'         : [],\n        }\n\n        def do_parse(arg):\n            # if arg is a sequence, recurse with each element\n            if not arg:\n                return\n\n            if not SCons.Util.is_String(arg):\n                for t in arg: do_parse(t)\n                return\n\n            # if arg is a command, execute it\n            if arg[0] == '!':\n                arg = self.backtick(arg[1:])\n\n            # utility function to deal with -D option\n            def append_define(name, dict = dict):\n                t = name.split('=')\n                if len(t) == 1:\n                    dict['CPPDEFINES'].append(name)\n                else:\n                    dict['CPPDEFINES'].append([t[0], '='.join(t[1:])])\n\n            # Loop through the flags and add them to the appropriate option.\n            # This tries to strike a balance between checking for all possible\n            # flags and keeping the logic to a finite size, so it doesn't\n            # check for some that don't occur often.  It particular, if the\n            # flag is not known to occur in a config script and there's a way\n            # of passing the flag to the right place (by wrapping it in a -W\n            # flag, for example) we don't check for it.  Note that most\n            # preprocessor options are not handled, since unhandled options\n            # are placed in CCFLAGS, so unless the preprocessor is invoked\n            # separately, these flags will still get to the preprocessor.\n            # Other options not currently handled:\n            #  -iqoutedir      (preprocessor search path)\n            #  -u symbol       (linker undefined symbol)\n            #  -s              (linker strip files)\n            #  -static*        (linker static binding)\n            #  -shared*        (linker dynamic binding)\n            #  -symbolic       (linker global binding)\n            #  -R dir          (deprecated linker rpath)\n            # IBM compilers may also accept -qframeworkdir=foo\n\n            params = shlex.split(arg)\n            append_next_arg_to = None   # for multi-word args\n            for arg in params:\n                if append_next_arg_to:\n                   if append_next_arg_to == 'CPPDEFINES':\n                       append_define(arg)\n                   elif append_next_arg_to == '-include':\n                       t = ('-include', self.fs.File(arg))\n                       dict['CCFLAGS'].append(t)\n                   elif append_next_arg_to == '-isysroot':\n                       t = ('-isysroot', arg)\n                       dict['CCFLAGS'].append(t)\n                       dict['LINKFLAGS'].append(t)\n                   elif append_next_arg_to == '-arch':\n                       t = ('-arch', arg)\n                       dict['CCFLAGS'].append(t)\n                       dict['LINKFLAGS'].append(t)\n                   else:\n                       dict[append_next_arg_to].append(arg)\n                   append_next_arg_to = None\n                elif not arg[0] in ['-', '+']:\n                    dict['LIBS'].append(self.fs.File(arg))\n                elif arg == '-dylib_file':\n                    dict['LINKFLAGS'].append(arg)\n                    append_next_arg_to = 'LINKFLAGS'\n                elif arg[:2] == '-L':\n                    if arg[2:]:\n                        dict['LIBPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBPATH'\n                elif arg[:2] == '-l':\n                    if arg[2:]:\n                        dict['LIBS'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBS'\n                elif arg[:2] == '-I':\n                    if arg[2:]:\n                        dict['CPPPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPPATH'\n                elif arg[:4] == '-Wa,':\n                    dict['ASFLAGS'].append(arg[4:])\n                    dict['CCFLAGS'].append(arg)\n                elif arg[:4] == '-Wl,':\n                    if arg[:11] == '-Wl,-rpath=':\n                        dict['RPATH'].append(arg[11:])\n                    elif arg[:7] == '-Wl,-R,':\n                        dict['RPATH'].append(arg[7:])\n                    elif arg[:6] == '-Wl,-R':\n                        dict['RPATH'].append(arg[6:])\n                    else:\n                        dict['LINKFLAGS'].append(arg)\n                elif arg[:4] == '-Wp,':\n                    dict['CPPFLAGS'].append(arg)\n                elif arg[:2] == '-D':\n                    if arg[2:]:\n                        append_define(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPDEFINES'\n                elif arg == '-framework':\n                    append_next_arg_to = 'FRAMEWORKS'\n                elif arg[:14] == '-frameworkdir=':\n                    dict['FRAMEWORKPATH'].append(arg[14:])\n                elif arg[:2] == '-F':\n                    if arg[2:]:\n                        dict['FRAMEWORKPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'FRAMEWORKPATH'\n                elif arg in ['-mno-cygwin',\n                             '-pthread',\n                             '-openmp',\n                             '-fopenmp']:\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg == '-mwindows':\n                    dict['LINKFLAGS'].append(arg)\n                elif arg[:5] == '-std=':\n                    if arg[5:].find('++')!=-1:\n                        key='CXXFLAGS'\n                    else:\n                        key='CFLAGS'\n                    dict[key].append(arg)\n                elif arg[0] == '+':\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg in ['-include', '-isysroot', '-arch']:\n                    append_next_arg_to = arg\n                else:\n                    dict['CCFLAGS'].append(arg)\n\n        for arg in flags:\n            do_parse(arg)\n        return dict\n\n    def MergeFlags(self, args, unique=1, dict=None):\n        \"\"\"\n        Merge the dict in args into the construction variables of this\n        env, or the passed-in dict.  If args is not a dict, it is\n        converted into a dict using ParseFlags.  If unique is not set,\n        the flags are appended rather than merged.\n        \"\"\"\n\n        if dict is None:\n            dict = self\n        if not SCons.Util.is_Dict(args):\n            args = self.ParseFlags(args)\n        if not unique:\n            self.Append(**args)\n            return self\n        for key, value in args.items():\n            if not value:\n                continue\n            try:\n                orig = self[key]\n            except KeyError:\n                orig = value\n            else:\n                if not orig:\n                    orig = value\n                elif value:\n                    # Add orig and value.  The logic here was lifted from\n                    # part of env.Append() (see there for a lot of comments\n                    # about the order in which things are tried) and is\n                    # used mainly to handle coercion of strings to CLVar to\n                    # \"do the right thing\" given (e.g.) an original CCFLAGS\n                    # string variable like '-pipe -Wall'.\n                    try:\n                        orig = orig + value\n                    except (KeyError, TypeError):\n                        try:\n                            add_to_orig = orig.append\n                        except AttributeError:\n                            value.insert(0, orig)\n                            orig = value\n                        else:\n                            add_to_orig(value)\n            t = []\n            if key[-4:] == 'PATH':\n                ### keep left-most occurence\n                for v in orig:\n                    if v not in t:\n                        t.append(v)\n            else:\n                ### keep right-most occurence\n                orig.reverse()\n                for v in orig:\n                    if v not in t:\n                        t.insert(0, v)\n            self[key] = t\n        return self\n\n#     def MergeShellPaths(self, args, prepend=1):\n#         \"\"\"\n#         Merge the dict in args into the shell environment in env['ENV'].\n#         Shell path elements are appended or prepended according to prepend.\n\n#         Uses Pre/AppendENVPath, so it always appends or prepends uniquely.\n\n#         Example: env.MergeShellPaths({'LIBPATH': '/usr/local/lib'})\n#         prepends /usr/local/lib to env['ENV']['LIBPATH'].\n#         \"\"\"\n\n#         for pathname, pathval in args.items():\n#             if not pathval:\n#                 continue\n#             if prepend:\n#                 self.PrependENVPath(pathname, pathval)\n#             else:\n#                 self.AppendENVPath(pathname, pathval)\n\n\ndef default_decide_source(dependency, target, prev_ni):\n    f = SCons.Defaults.DefaultEnvironment().decide_source\n    return f(dependency, target, prev_ni)\n\ndef default_decide_target(dependency, target, prev_ni):\n    f = SCons.Defaults.DefaultEnvironment().decide_target\n    return f(dependency, target, prev_ni)\n\ndef default_copy_from_cache(src, dst):\n    f = SCons.Defaults.DefaultEnvironment().copy_from_cache\n    return f(src, dst)\n\nclass Base(SubstitutionEnvironment):\n    \"\"\"Base class for \"real\" construction Environments.  These are the\n    primary objects used to communicate dependency and construction\n    information to the build engine.\n\n    Keyword arguments supplied when the construction Environment\n    is created are construction variables used to initialize the\n    Environment.\n    \"\"\"\n\n    memoizer_counters = []\n\n    #######################################################################\n    # This is THE class for interacting with the SCons build engine,\n    # and it contains a lot of stuff, so we're going to try to keep this\n    # a little organized by grouping the methods.\n    #######################################################################\n\n    #######################################################################\n    # Methods that make an Environment act like a dictionary.  These have\n    # the expected standard names for Python mapping objects.  Note that\n    # we don't actually make an Environment a subclass of UserDict for\n    # performance reasons.  Note also that we only supply methods for\n    # dictionary functionality that we actually need and use.\n    #######################################################################\n\n    def __init__(self,\n                 platform=None,\n                 tools=None,\n                 toolpath=None,\n                 variables=None,\n                 parse_flags = None,\n                 **kw):\n        \"\"\"\n        Initialization of a basic SCons construction environment,\n        including setting up special construction variables like BUILDER,\n        PLATFORM, etc., and searching for and applying available Tools.\n\n        Note that we do *not* call the underlying base class\n        (SubsitutionEnvironment) initialization, because we need to\n        initialize things in a very specific order that doesn't work\n        with the much simpler base class initialization.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base')\n        self._memo = {}\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = semi_deepcopy(SCons.Defaults.ConstructionEnvironment)\n        self._init_special()\n        self.added_methods = []\n\n        # We don't use AddMethod, or define these as methods in this\n        # class, because we *don't* want these functions to be bound\n        # methods.  They need to operate independently so that the\n        # settings will work properly regardless of whether a given\n        # target ends up being built with a Base environment or an\n        # OverrideEnvironment or what have you.\n        self.decide_target = default_decide_target\n        self.decide_source = default_decide_source\n\n        self.copy_from_cache = default_copy_from_cache\n\n        self._dict['BUILDERS'] = BuilderDict(self._dict['BUILDERS'], self)\n\n        if platform is None:\n            platform = self._dict.get('PLATFORM', None)\n            if platform is None:\n                platform = SCons.Platform.Platform()\n        if SCons.Util.is_String(platform):\n            platform = SCons.Platform.Platform(platform)\n        self._dict['PLATFORM'] = str(platform)\n        platform(self)\n\n        self._dict['HOST_OS']      = self._dict.get('HOST_OS',None)\n        self._dict['HOST_ARCH']    = self._dict.get('HOST_ARCH',None)\n\n        # Now set defaults for TARGET_{OS|ARCH}\n        self._dict['TARGET_OS']      = self._dict.get('TARGET_OS',None)\n        self._dict['TARGET_ARCH']    = self._dict.get('TARGET_ARCH',None)\n\n\n        # Apply the passed-in and customizable variables to the\n        # environment before calling the tools, because they may use\n        # some of them during initialization.\n        if 'options' in kw:\n            # Backwards compatibility:  they may stll be using the\n            # old \"options\" keyword.\n            variables = kw['options']\n            del kw['options']\n        self.Replace(**kw)\n        keys = list(kw.keys())\n        if variables:\n            keys = keys + list(variables.keys())\n            variables.Update(self)\n\n        save = {}\n        for k in keys:\n            try:\n                save[k] = self._dict[k]\n            except KeyError:\n                # No value may have been set if they tried to pass in a\n                # reserved variable name like TARGETS.\n                pass\n\n        SCons.Tool.Initializers(self)\n\n        if tools is None:\n            tools = self._dict.get('TOOLS', None)\n            if tools is None:\n                tools = ['default']\n        apply_tools(self, tools, toolpath)\n\n        # Now restore the passed-in and customized variables\n        # to the environment, since the values the user set explicitly\n        # should override any values set by the tools.\n        for key, val in save.items():\n            self._dict[key] = val\n\n        # Finally, apply any flags to be merged in\n        if parse_flags: self.MergeFlags(parse_flags)\n\n    #######################################################################\n    # Utility methods that are primarily for internal use by SCons.\n    # These begin with lower-case letters.\n    #######################################################################\n\n    def get_builder(self, name):\n        \"\"\"Fetch the builder with the specified name from the environment.\n        \"\"\"\n        try:\n            return self._dict['BUILDERS'][name]\n        except KeyError:\n            return None\n\n    def get_CacheDir(self):\n        try:\n            path = self._CacheDir_path\n        except AttributeError:\n            path = SCons.Defaults.DefaultEnvironment()._CacheDir_path\n        try:\n            if path == self._last_CacheDir_path:\n                return self._last_CacheDir\n        except AttributeError:\n            pass\n        cd = SCons.CacheDir.CacheDir(path)\n        self._last_CacheDir_path = path\n        self._last_CacheDir = cd\n        return cd\n\n    def get_factory(self, factory, default='File'):\n        \"\"\"Return a factory function for creating Nodes for this\n        construction environment.\n        \"\"\"\n        name = default\n        try:\n            is_node = issubclass(factory, SCons.Node.FS.Base)\n        except TypeError:\n            # The specified factory isn't a Node itself--it's\n            # most likely None, or possibly a callable.\n            pass\n        else:\n            if is_node:\n                # The specified factory is a Node (sub)class.  Try to\n                # return the FS method that corresponds to the Node's\n                # name--that is, we return self.fs.Dir if they want a Dir,\n                # self.fs.File for a File, etc.\n                try: name = factory.__name__\n                except AttributeError: pass\n                else: factory = None\n        if not factory:\n            # They passed us None, or we picked up a name from a specified\n            # class, so return the FS method.  (Note that we *don't*\n            # use our own self.{Dir,File} methods because that would\n            # cause env.subst() to be called twice on the file name,\n            # interfering with files that have $$ in them.)\n            factory = getattr(self.fs, name)\n        return factory\n\n    memoizer_counters.append(SCons.Memoize.CountValue('_gsm'))\n\n    def _gsm(self):\n        try:\n            return self._memo['_gsm']\n        except KeyError:\n            pass\n\n        result = {}\n\n        try:\n            scanners = self._dict['SCANNERS']\n        except KeyError:\n            pass\n        else:\n            # Reverse the scanner list so that, if multiple scanners\n            # claim they can scan the same suffix, earlier scanners\n            # in the list will overwrite later scanners, so that\n            # the result looks like a \"first match\" to the user.\n            if not SCons.Util.is_List(scanners):\n                scanners = [scanners]\n            else:\n                scanners = scanners[:] # copy so reverse() doesn't mod original\n            scanners.reverse()\n            for scanner in scanners:\n                for k in scanner.get_skeys(self):\n                    if k and self['PLATFORM'] == 'win32':\n                        k = k.lower()\n                    result[k] = scanner\n\n        self._memo['_gsm'] = result\n\n        return result\n\n    def get_scanner(self, skey):\n        \"\"\"Find the appropriate scanner given a key (usually a file suffix).\n        \"\"\"\n        if skey and self['PLATFORM'] == 'win32':\n            skey = skey.lower()\n        return self._gsm().get(skey)\n\n    def scanner_map_delete(self, kw=None):\n        \"\"\"Delete the cached scanner map (if we need to).\n        \"\"\"\n        try:\n            del self._memo['_gsm']\n        except KeyError:\n            pass\n\n    def _update(self, dict):\n        \"\"\"Update an environment's values directly, bypassing the normal\n        checks that occur when users try to set items.\n        \"\"\"\n        self._dict.update(dict)\n\n    def get_src_sig_type(self):\n        try:\n            return self.src_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().src_sig_type\n            self.src_sig_type = t\n            return t\n\n    def get_tgt_sig_type(self):\n        try:\n            return self.tgt_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().tgt_sig_type\n            self.tgt_sig_type = t\n            return t\n\n    #######################################################################\n    # Public methods for manipulating an Environment.  These begin with\n    # upper-case letters.  The essential characteristic of methods in\n    # this section is that they do *not* have corresponding same-named\n    # global functions.  For example, a stand-alone Append() function\n    # makes no sense, because Append() is all about appending values to\n    # an Environment's construction variables.\n    #######################################################################\n\n    def Append(self, **kw):\n        \"\"\"Append values to existing construction variables\n        in an Environment.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            # It would be easier on the eyes to write this using\n            # \"continue\" statements whenever we finish processing an item,\n            # but Python 1.5.2 apparently doesn't let you use \"continue\"\n            # within try:-except: blocks, so we have to nest our code.\n            try:\n                if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):\n                    self._dict[key] = [self._dict[key]]\n                orig = self._dict[key]\n            except KeyError:\n                # No existing variable in the environment, so just set\n                # it to the new value.\n                if key == 'CPPDEFINES' and SCons.Util.is_String(val):\n                    self._dict[key] = [val]\n                else:\n                    self._dict[key] = val\n            else:\n                try:\n                    # Check if the original looks like a dictionary.\n                    # If it is, we can't just try adding the value because\n                    # dictionaries don't have __add__() methods, and\n                    # things like UserList will incorrectly coerce the\n                    # original dict to a list (which we don't want).\n                    update_dict = orig.update\n                except AttributeError:\n                    try:\n                        # Most straightforward:  just try to add them\n                        # together.  This will work in most cases, when the\n                        # original and new values are of compatible types.\n                        self._dict[key] = orig + val\n                    except (KeyError, TypeError):\n                        try:\n                            # Check if the original is a list.\n                            add_to_orig = orig.append\n                        except AttributeError:\n                            # The original isn't a list, but the new\n                            # value is (by process of elimination),\n                            # so insert the original in the new value\n                            # (if there's one to insert) and replace\n                            # the variable with it.\n                            if orig:\n                                val.insert(0, orig)\n                            self._dict[key] = val\n                        else:\n                            # The original is a list, so append the new\n                            # value to it (if there's a value to append).\n                            if val:\n                                add_to_orig(val)\n                else:\n                    # The original looks like a dictionary, so update it\n                    # based on what we think the value looks like.\n                    if SCons.Util.is_List(val):\n                        if key == 'CPPDEFINES':\n                            orig = orig.items()\n                            orig += val\n                            self._dict[key] = orig\n                        else:\n                            for v in val:\n                                orig[v] = None\n                    else:\n                        try:\n                            update_dict(val)\n                        except (AttributeError, TypeError, ValueError):\n                            if SCons.Util.is_Dict(val):\n                                for k, v in val.items():\n                                    orig[k] = v\n                            else:\n                                orig[val] = None\n        self.scanner_map_delete(kw)\n\n    # allow Dirs and strings beginning with # for top-relative\n    # Note this uses the current env's fs (in self).\n    def _canonicalize(self, path):\n        if not SCons.Util.is_String(path): # typically a Dir\n            path = str(path)\n        if path and path[0] == '#':\n            path = str(self.fs.Dir(path))\n        return path\n\n    def AppendENVPath(self, name, newpath, envname = 'ENV',\n                      sep = os.pathsep, delete_existing=1):\n        \"\"\"Append path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the end (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = SCons.Util.AppendPath(orig, newpath, sep, delete_existing,\n                                   canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def AppendUnique(self, delete_existing=0, **kw):\n        \"\"\"Append values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to end.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if SCons.Util.is_List(val):\n                val = _delete_duplicates(val, delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif SCons.Util.is_Dict(self._dict[key]) and \\\n                 SCons.Util.is_Dict(val):\n                self._dict[key].update(val)\n            elif SCons.Util.is_List(val):\n                dk = self._dict[key]\n                if key == 'CPPDEFINES':\n                    tmp = []\n                    for i in val:\n                        if SCons.Util.is_List(i):\n                            if len(i) >= 2:\n                                tmp.append((i[0], i[1]))\n                            else:\n                                tmp.append((i[0],))\n                        elif SCons.Util.is_Tuple(i):\n                            tmp.append(i)\n                        else:\n                            tmp.append((i,))\n                    val = tmp\n                    if SCons.Util.is_Dict(dk):\n                        dk = dk.items()\n                    elif SCons.Util.is_String(dk):\n                        dk = [(dk,)]\n                    else:\n                        tmp = []\n                        for i in dk:\n                            if SCons.Util.is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif SCons.Util.is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                else:\n                    if not SCons.Util.is_List(dk):\n                        dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = dk + val\n            else:\n                dk = self._dict[key]\n                if SCons.Util.is_List(dk):\n                    if key == 'CPPDEFINES':\n                        tmp = []\n                        for i in dk:\n                            if SCons.Util.is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif SCons.Util.is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                        if SCons.Util.is_Dict(val):\n                            val = val.items()\n                        elif SCons.Util.is_String(val):\n                            val = [(val,)]\n                        if delete_existing:\n                            dk = filter(lambda x, val=val: x not in val, dk)\n                            self._dict[key] = dk + val\n                        else:\n                            dk = [x for x in dk if x not in val]\n                            self._dict[key] = dk + val\n                    else:\n                        # By elimination, val is not a list.  Since dk is a\n                        # list, wrap val in a list first.\n                        if delete_existing:\n                            dk = filter(lambda x, val=val: x not in val, dk)\n                            self._dict[key] = dk + [val]\n                        else:\n                            if not val in dk:\n                                self._dict[key] = dk + [val]\n                else:\n                    if key == 'CPPDEFINES':\n                        if SCons.Util.is_String(dk):\n                            dk = [dk]\n                        elif SCons.Util.is_Dict(dk):\n                            dk = dk.items()\n                        if SCons.Util.is_String(val):\n                            if val in dk:\n                                val = []\n                            else:\n                                val = [val]\n                        elif SCons.Util.is_Dict(val):\n                            tmp = []\n                            for i,j in val.iteritems():\n                                if j is not None:\n                                    tmp.append((i,j))\n                                else:\n                                    tmp.append(i)\n                            val = tmp\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = dk + val\n        self.scanner_map_delete(kw)\n\n    def Clone(self, tools=[], toolpath=None, parse_flags = None, **kw):\n        \"\"\"Return a copy of a construction Environment.  The\n        copy is like a Python \"deep copy\"--that is, independent\n        copies are made recursively of each objects--except that\n        a reference is copied when an object is not deep-copyable\n        (like a function).  There are no references to any mutable\n        objects in the original Environment.\n        \"\"\"\n        try:\n            builders = self._dict['BUILDERS']\n        except KeyError:\n            pass\n\n        clone = copy.copy(self)\n        # BUILDERS is not safe to do a simple copy\n        clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])\n        clone._dict['BUILDERS'] = BuilderDict(builders, clone)\n\n        # Check the methods added via AddMethod() and re-bind them to\n        # the cloned environment.  Only do this if the attribute hasn't\n        # been overwritten by the user explicitly and still points to\n        # the added method.\n        clone.added_methods = []\n        for mw in self.added_methods:\n            if mw == getattr(self, mw.name):\n                clone.added_methods.append(mw.clone(clone))\n\n        clone._memo = {}\n\n        # Apply passed-in variables before the tools\n        # so the tools can use the new variables\n        kw = copy_non_reserved_keywords(kw)\n        new = {}\n        for key, value in kw.items():\n            new[key] = SCons.Subst.scons_subst_once(value, self, key)\n        clone.Replace(**new)\n\n        apply_tools(clone, tools, toolpath)\n\n        # apply them again in case the tools overwrote them\n        clone.Replace(**new)\n\n        # Finally, apply any flags to be merged in\n        if parse_flags: clone.MergeFlags(parse_flags)\n\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone')\n        return clone\n\n    def Copy(self, *args, **kw):\n        global _warn_copy_deprecated\n        if _warn_copy_deprecated:\n            msg = \"The env.Copy() method is deprecated; use the env.Clone() method instead.\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedCopyWarning, msg)\n            _warn_copy_deprecated = False\n        return self.Clone(*args, **kw)\n\n    def _changed_build(self, dependency, target, prev_ni):\n        if dependency.changed_state(target, prev_ni):\n            return 1\n        return self.decide_source(dependency, target, prev_ni)\n\n    def _changed_content(self, dependency, target, prev_ni):\n        return dependency.changed_content(target, prev_ni)\n\n    def _changed_source(self, dependency, target, prev_ni):\n        target_env = dependency.get_build_env()\n        type = target_env.get_tgt_sig_type()\n        if type == 'source':\n            return target_env.decide_source(dependency, target, prev_ni)\n        else:\n            return target_env.decide_target(dependency, target, prev_ni)\n\n    def _changed_timestamp_then_content(self, dependency, target, prev_ni):\n        return dependency.changed_timestamp_then_content(target, prev_ni)\n\n    def _changed_timestamp_newer(self, dependency, target, prev_ni):\n        return dependency.changed_timestamp_newer(target, prev_ni)\n\n    def _changed_timestamp_match(self, dependency, target, prev_ni):\n        return dependency.changed_timestamp_match(target, prev_ni)\n\n    def _copy_from_cache(self, src, dst):\n        return self.fs.copy(src, dst)\n\n    def _copy2_from_cache(self, src, dst):\n        return self.fs.copy2(src, dst)\n\n    def Decider(self, function):\n        copy_function = self._copy2_from_cache\n        if function in ('MD5', 'content'):\n            if not SCons.Util.md5:\n                raise UserError(\"MD5 signatures are not available in this version of Python.\")\n            function = self._changed_content\n        elif function == 'MD5-timestamp':\n            function = self._changed_timestamp_then_content\n        elif function in ('timestamp-newer', 'make'):\n            function = self._changed_timestamp_newer\n            copy_function = self._copy_from_cache\n        elif function == 'timestamp-match':\n            function = self._changed_timestamp_match\n        elif not callable(function):\n            raise UserError(\"Unknown Decider value %s\" % repr(function))\n\n        # We don't use AddMethod because we don't want to turn the\n        # function, which only expects three arguments, into a bound\n        # method, which would add self as an initial, fourth argument.\n        self.decide_target = function\n        self.decide_source = function\n\n        self.copy_from_cache = copy_function\n\n    def Detect(self, progs):\n        \"\"\"Return the first available program in progs.\n        \"\"\"\n        if not SCons.Util.is_List(progs):\n            progs = [ progs ]\n        for prog in progs:\n            path = self.WhereIs(prog)\n            if path: return prog\n        return None\n\n    def Dictionary(self, *args):\n        if not args:\n            return self._dict\n        dlist = [self._dict[x] for x in args]\n        if len(dlist) == 1:\n            dlist = dlist[0]\n        return dlist\n\n    def Dump(self, key = None):\n        \"\"\"\n        Using the standard Python pretty printer, dump the contents of the\n        scons build environment to stdout.\n\n        If the key passed in is anything other than None, then that will\n        be used as an index into the build environment dictionary and\n        whatever is found there will be fed into the pretty printer. Note\n        that this key is case sensitive.\n        \"\"\"\n        import pprint\n        pp = pprint.PrettyPrinter(indent=2)\n        if key:\n            dict = self.Dictionary(key)\n        else:\n            dict = self.Dictionary()\n        return pp.pformat(dict)\n\n    def FindIxes(self, paths, prefix, suffix):\n        \"\"\"\n        Search a list of paths for something that matches the prefix and suffix.\n\n        paths - the list of paths or nodes.\n        prefix - construction variable for the prefix.\n        suffix - construction variable for the suffix.\n        \"\"\"\n\n        suffix = self.subst('$'+suffix)\n        prefix = self.subst('$'+prefix)\n\n        for path in paths:\n            dir,name = os.path.split(str(path))\n            if name[:len(prefix)] == prefix and name[-len(suffix):] == suffix:\n                return path\n\n    def ParseConfig(self, command, function=None, unique=1):\n        \"\"\"\n        Use the specified function to parse the output of the command\n        in order to modify the current environment.  The 'command' can\n        be a string or a list of strings representing a command and\n        its arguments.  'Function' is an optional argument that takes\n        the environment, the output of the command, and the unique flag.\n        If no function is specified, MergeFlags, which treats the output\n        as the result of a typical 'X-config' command (i.e. gtk-config),\n        will merge the output into the appropriate variables.\n        \"\"\"\n        if function is None:\n            def parse_conf(env, cmd, unique=unique):\n                return env.MergeFlags(cmd, unique)\n            function = parse_conf\n        if SCons.Util.is_List(command):\n            command = ' '.join(command)\n        command = self.subst(command)\n        return function(self, self.backtick(command))\n\n    def ParseDepends(self, filename, must_exist=None, only_one=0):\n        \"\"\"\n        Parse a mkdep-style file for explicit dependencies.  This is\n        completely abusable, and should be unnecessary in the \"normal\"\n        case of proper SCons configuration, but it may help make\n        the transition from a Make hierarchy easier for some people\n        to swallow.  It can also be genuinely useful when using a tool\n        that can write a .d file, but for which writing a scanner would\n        be too complicated.\n        \"\"\"\n        filename = self.subst(filename)\n        try:\n            fp = open(filename, 'r')\n        except IOError:\n            if must_exist:\n                raise\n            return\n        lines = SCons.Util.LogicalLines(fp).readlines()\n        lines = [l for l in lines if l[0] != '#']\n        tdlist = []\n        for line in lines:\n            try:\n                target, depends = line.split(':', 1)\n            except (AttributeError, ValueError):\n                # Throws AttributeError if line isn't a string.  Can throw\n                # ValueError if line doesn't split into two or more elements.\n                pass\n            else:\n                tdlist.append((target.split(), depends.split()))\n        if only_one:\n            targets = []\n            for td in tdlist:\n                targets.extend(td[0])\n            if len(targets) > 1:\n                raise SCons.Errors.UserError(\n                            \"More than one dependency target found in `%s':  %s\"\n                                            % (filename, targets))\n        for target, depends in tdlist:\n            self.Depends(target, depends)\n\n    def Platform(self, platform):\n        platform = self.subst(platform)\n        return SCons.Platform.Platform(platform)(self)\n\n    def Prepend(self, **kw):\n        \"\"\"Prepend values to existing construction variables\n        in an Environment.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            # It would be easier on the eyes to write this using\n            # \"continue\" statements whenever we finish processing an item,\n            # but Python 1.5.2 apparently doesn't let you use \"continue\"\n            # within try:-except: blocks, so we have to nest our code.\n            try:\n                orig = self._dict[key]\n            except KeyError:\n                # No existing variable in the environment, so just set\n                # it to the new value.\n                self._dict[key] = val\n            else:\n                try:\n                    # Check if the original looks like a dictionary.\n                    # If it is, we can't just try adding the value because\n                    # dictionaries don't have __add__() methods, and\n                    # things like UserList will incorrectly coerce the\n                    # original dict to a list (which we don't want).\n                    update_dict = orig.update\n                except AttributeError:\n                    try:\n                        # Most straightforward:  just try to add them\n                        # together.  This will work in most cases, when the\n                        # original and new values are of compatible types.\n                        self._dict[key] = val + orig\n                    except (KeyError, TypeError):\n                        try:\n                            # Check if the added value is a list.\n                            add_to_val = val.append\n                        except AttributeError:\n                            # The added value isn't a list, but the\n                            # original is (by process of elimination),\n                            # so insert the the new value in the original\n                            # (if there's one to insert).\n                            if val:\n                                orig.insert(0, val)\n                        else:\n                            # The added value is a list, so append\n                            # the original to it (if there's a value\n                            # to append).\n                            if orig:\n                                add_to_val(orig)\n                            self._dict[key] = val\n                else:\n                    # The original looks like a dictionary, so update it\n                    # based on what we think the value looks like.\n                    if SCons.Util.is_List(val):\n                        for v in val:\n                            orig[v] = None\n                    else:\n                        try:\n                            update_dict(val)\n                        except (AttributeError, TypeError, ValueError):\n                            if SCons.Util.is_Dict(val):\n                                for k, v in val.items():\n                                    orig[k] = v\n                            else:\n                                orig[val] = None\n        self.scanner_map_delete(kw)\n\n    def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,\n                       delete_existing=1):\n        \"\"\"Prepend path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the front (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = SCons.Util.PrependPath(orig, newpath, sep, delete_existing,\n                                    canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def PrependUnique(self, delete_existing=0, **kw):\n        \"\"\"Prepend values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to front.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if SCons.Util.is_List(val):\n                val = _delete_duplicates(val, not delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif SCons.Util.is_Dict(self._dict[key]) and \\\n                 SCons.Util.is_Dict(val):\n                self._dict[key].update(val)\n            elif SCons.Util.is_List(val):\n                dk = self._dict[key]\n                if not SCons.Util.is_List(dk):\n                    dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = val + dk\n            else:\n                dk = self._dict[key]\n                if SCons.Util.is_List(dk):\n                    # By elimination, val is not a list.  Since dk is a\n                    # list, wrap val in a list first.\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                        self._dict[key] = [val] + dk\n                    else:\n                        if not val in dk:\n                            self._dict[key] = [val] + dk\n                else:\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = val + dk\n        self.scanner_map_delete(kw)\n\n    def Replace(self, **kw):\n        \"\"\"Replace existing construction variables in an Environment\n        with new construction variables and/or values.\n        \"\"\"\n        try:\n            kwbd = kw['BUILDERS']\n        except KeyError:\n            pass\n        else:\n            kwbd = BuilderDict(kwbd,self)\n            del kw['BUILDERS']\n            self.__setitem__('BUILDERS', kwbd)\n        kw = copy_non_reserved_keywords(kw)\n        self._update(semi_deepcopy(kw))\n        self.scanner_map_delete(kw)\n\n    def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):\n        \"\"\"\n        Replace old_prefix with new_prefix and old_suffix with new_suffix.\n\n        env - Environment used to interpolate variables.\n        path - the path that will be modified.\n        old_prefix - construction variable for the old prefix.\n        old_suffix - construction variable for the old suffix.\n        new_prefix - construction variable for the new prefix.\n        new_suffix - construction variable for the new suffix.\n        \"\"\"\n        old_prefix = self.subst('$'+old_prefix)\n        old_suffix = self.subst('$'+old_suffix)\n\n        new_prefix = self.subst('$'+new_prefix)\n        new_suffix = self.subst('$'+new_suffix)\n\n        dir,name = os.path.split(str(path))\n        if name[:len(old_prefix)] == old_prefix:\n            name = name[len(old_prefix):]\n        if name[-len(old_suffix):] == old_suffix:\n            name = name[:-len(old_suffix)]\n        return os.path.join(dir, new_prefix+name+new_suffix)\n\n    def SetDefault(self, **kw):\n        for k in kw.keys():\n            if k in self._dict:\n                del kw[k]\n        self.Replace(**kw)\n\n    def _find_toolpath_dir(self, tp):\n        return self.fs.Dir(self.subst(tp)).srcnode().abspath\n\n    def Tool(self, tool, toolpath=None, **kw):\n        if SCons.Util.is_String(tool):\n            tool = self.subst(tool)\n            if toolpath is None:\n                toolpath = self.get('toolpath', [])\n            toolpath = list(map(self._find_toolpath_dir, toolpath))\n            tool = SCons.Tool.Tool(tool, toolpath, **kw)\n        tool(self)\n\n    def WhereIs(self, prog, path=None, pathext=None, reject=[]):\n        \"\"\"Find prog in the path.\n        \"\"\"\n        if path is None:\n            try:\n                path = self['ENV']['PATH']\n            except KeyError:\n                pass\n        elif SCons.Util.is_String(path):\n            path = self.subst(path)\n        if pathext is None:\n            try:\n                pathext = self['ENV']['PATHEXT']\n            except KeyError:\n                pass\n        elif SCons.Util.is_String(pathext):\n            pathext = self.subst(pathext)\n        prog = SCons.Util.CLVar(self.subst(prog)) # support \"program --with-args\"\n        path = SCons.Util.WhereIs(prog[0], path, pathext, reject)\n        if path: return path\n        return None\n\n    #######################################################################\n    # Public methods for doing real \"SCons stuff\" (manipulating\n    # dependencies, setting attributes on targets, etc.).  These begin\n    # with upper-case letters.  The essential characteristic of methods\n    # in this section is that they all *should* have corresponding\n    # same-named global functions.\n    #######################################################################\n\n    def Action(self, *args, **kw):\n        def subst_string(a, self=self):\n            if SCons.Util.is_String(a):\n                a = self.subst(a)\n            return a\n        nargs = list(map(subst_string, args))\n        nkw = self.subst_kw(kw)\n        return SCons.Action.Action(*nargs, **nkw)\n\n    def AddPreAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in uniq.keys():\n            executor.add_pre_action(action)\n        return nodes\n\n    def AddPostAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in uniq.keys():\n            executor.add_post_action(action)\n        return nodes\n\n    def Alias(self, target, source=[], action=None, **kw):\n        tlist = self.arg2nodes(target, self.ans.Alias)\n        if not SCons.Util.is_List(source):\n            source = [source]\n        source = [_f for _f in source if _f]\n\n        if not action:\n            if not source:\n                # There are no source files and no action, so just\n                # return a target list of classic Alias Nodes, without\n                # any builder.  The externally visible effect is that\n                # this will make the wrapping Script.BuildTask class\n                # say that there's \"Nothing to be done\" for this Alias,\n                # instead of that it's \"up to date.\"\n                return tlist\n\n            # No action, but there are sources.  Re-call all the target\n            # builders to add the sources to each target.\n            result = []\n            for t in tlist:\n                bld = t.get_builder(AliasBuilder)\n                result.extend(bld(self, t, source))\n            return result\n\n        nkw = self.subst_kw(kw)\n        nkw.update({\n            'action'            : SCons.Action.Action(action),\n            'source_factory'    : self.fs.Entry,\n            'multi'             : 1,\n            'is_explicit'       : None,\n        })\n        bld = SCons.Builder.Builder(**nkw)\n\n        # Apply the Builder separately to each target so that the Aliases\n        # stay separate.  If we did one \"normal\" Builder call with the\n        # whole target list, then all of the target Aliases would be\n        # associated under a single Executor.\n        result = []\n        for t in tlist:\n            # Calling the convert() method will cause a new Executor to be\n            # created from scratch, so we have to explicitly initialize\n            # it with the target's existing sources, plus our new ones,\n            # so nothing gets lost.\n            b = t.get_builder()\n            if b is None or b is AliasBuilder:\n                b = bld\n            else:\n                nkw['action'] = b.action + action\n                b = SCons.Builder.Builder(**nkw)\n            t.convert()\n            result.extend(b(self, t, t.sources + source))\n        return result\n\n    def AlwaysBuild(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_always_build()\n        return tlist\n\n    def BuildDir(self, *args, **kw):\n        msg = \"\"\"BuildDir() and the build_dir keyword have been deprecated;\\n\\tuse VariantDir() and the variant_dir keyword instead.\"\"\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)\n        if 'build_dir' in kw:\n            kw['variant_dir'] = kw['build_dir']\n            del kw['build_dir']\n        return self.VariantDir(*args, **kw)\n\n    def Builder(self, **kw):\n        nkw = self.subst_kw(kw)\n        return SCons.Builder.Builder(**nkw)\n\n    def CacheDir(self, path):\n        import SCons.CacheDir\n        if path is not None:\n            path = self.subst(path)\n        self._CacheDir_path = path\n\n    def Clean(self, targets, files):\n        global CleanTargets\n        tlist = self.arg2nodes(targets, self.fs.Entry)\n        flist = self.arg2nodes(files, self.fs.Entry)\n        for t in tlist:\n            try:\n                CleanTargets[t].extend(flist)\n            except KeyError:\n                CleanTargets[t] = flist\n\n    def Configure(self, *args, **kw):\n        nargs = [self]\n        if args:\n            nargs = nargs + self.subst_list(args)[0]\n        nkw = self.subst_kw(kw)\n        nkw['_depth'] = kw.get('_depth', 0) + 1\n        try:\n            nkw['custom_tests'] = self.subst_kw(nkw['custom_tests'])\n        except KeyError:\n            pass\n        return SCons.SConf.SConf(*nargs, **nkw)\n\n    def Command(self, target, source, action, **kw):\n        \"\"\"Builds the supplied target files from the supplied\n        source files using the supplied action.  Action may\n        be any type that the Builder constructor will accept\n        for an action.\"\"\"\n        bkw = {\n            'action' : action,\n            'target_factory' : self.fs.Entry,\n            'source_factory' : self.fs.Entry,\n        }\n        try: bkw['source_scanner'] = kw['source_scanner']\n        except KeyError: pass\n        else: del kw['source_scanner']\n        bld = SCons.Builder.Builder(**bkw)\n        return bld(self, target, source, **kw)\n\n    def Depends(self, target, dependency):\n        \"\"\"Explicity specify that 'target's depend on 'dependency'.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_dependency(dlist)\n        return tlist\n\n    def Dir(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Dir(e, *args, **kw))\n            return result\n        return self.fs.Dir(s, *args, **kw)\n\n    def NoClean(self, *targets):\n        \"\"\"Tags a target so that it will not be cleaned by -c\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_noclean()\n        return tlist\n\n    def NoCache(self, *targets):\n        \"\"\"Tags a target so that it will not be cached\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_nocache()\n        return tlist\n\n    def Entry(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Entry(e, *args, **kw))\n            return result\n        return self.fs.Entry(s, *args, **kw)\n\n    def Environment(self, **kw):\n        return SCons.Environment.Environment(**self.subst_kw(kw))\n\n    def Execute(self, action, *args, **kw):\n        \"\"\"Directly execute an action through an Environment\n        \"\"\"\n        action = self.Action(action, *args, **kw)\n        result = action([], [], self)\n        if isinstance(result, SCons.Errors.BuildError):\n            errstr = result.errstr\n            if result.filename:\n                errstr = result.filename + ': ' + errstr\n            sys.stderr.write(\"scons: *** %s\\n\" % errstr)\n            return result.status\n        else:\n            return result\n\n    def File(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.File(e, *args, **kw))\n            return result\n        return self.fs.File(s, *args, **kw)\n\n    def FindFile(self, file, dirs):\n        file = self.subst(file)\n        nodes = self.arg2nodes(dirs, self.fs.Dir)\n        return SCons.Node.FS.find_file(file, tuple(nodes))\n\n    def Flatten(self, sequence):\n        return SCons.Util.flatten(sequence)\n\n    def GetBuildPath(self, files):\n        result = list(map(str, self.arg2nodes(files, self.fs.Entry)))\n        if SCons.Util.is_List(files):\n            return result\n        else:\n            return result[0]\n\n    def Glob(self, pattern, ondisk=True, source=False, strings=False):\n        return self.fs.Glob(self.subst(pattern), ondisk, source, strings)\n\n    def Ignore(self, target, dependency):\n        \"\"\"Ignore a dependency.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_ignore(dlist)\n        return tlist\n\n    def Literal(self, string):\n        return SCons.Subst.Literal(string)\n\n    def Local(self, *targets):\n        ret = []\n        for targ in targets:\n            if isinstance(targ, SCons.Node.Node):\n                targ.set_local()\n                ret.append(targ)\n            else:\n                for t in self.arg2nodes(targ, self.fs.Entry):\n                   t.set_local()\n                   ret.append(t)\n        return ret\n\n    def Precious(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_precious()\n        return tlist\n\n    def Pseudo(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_pseudo()\n        return tlist\n\n    def Repository(self, *dirs, **kw):\n        dirs = self.arg2nodes(list(dirs), self.fs.Dir)\n        self.fs.Repository(*dirs, **kw)\n\n    def Requires(self, target, prerequisite):\n        \"\"\"Specify that 'prerequisite' must be built before 'target',\n        (but 'target' does not actually depend on 'prerequisite'\n        and need not be rebuilt if it changes).\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        plist = self.arg2nodes(prerequisite, self.fs.Entry)\n        for t in tlist:\n            t.add_prerequisite(plist)\n        return tlist\n\n    def Scanner(self, *args, **kw):\n        nargs = []\n        for arg in args:\n            if SCons.Util.is_String(arg):\n                arg = self.subst(arg)\n            nargs.append(arg)\n        nkw = self.subst_kw(kw)\n        return SCons.Scanner.Base(*nargs, **nkw)\n\n    def SConsignFile(self, name=\".sconsign\", dbm_module=None):\n        if name is not None:\n            name = self.subst(name)\n            if not os.path.isabs(name):\n                name = os.path.join(str(self.fs.SConstruct_dir), name)\n        if name:\n            name = os.path.normpath(name)\n            sconsign_dir = os.path.dirname(name)\n            if sconsign_dir and not os.path.exists(sconsign_dir):\n                self.Execute(SCons.Defaults.Mkdir(sconsign_dir))\n        SCons.SConsign.File(name, dbm_module)\n\n    def SideEffect(self, side_effect, target):\n        \"\"\"Tell scons that side_effects are built as side\n        effects of building targets.\"\"\"\n        side_effects = self.arg2nodes(side_effect, self.fs.Entry)\n        targets = self.arg2nodes(target, self.fs.Entry)\n\n        for side_effect in side_effects:\n            if side_effect.multiple_side_effect_has_builder():\n                raise SCons.Errors.UserError(\"Multiple ways to build the same target were specified for: %s\" % str(side_effect))\n            side_effect.add_source(targets)\n            side_effect.side_effect = 1\n            self.Precious(side_effect)\n            for target in targets:\n                target.side_effects.append(side_effect)\n        return side_effects\n\n    def SourceCode(self, entry, builder):\n        \"\"\"Arrange for a source code builder for (part of) a tree.\"\"\"\n        msg = \"\"\"SourceCode() has been deprecated and there is no replacement.\n\\tIf you need this function, please contact scons-dev@scons.org\"\"\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceCodeWarning, msg)\n        entries = self.arg2nodes(entry, self.fs.Entry)\n        for entry in entries:\n            entry.set_src_builder(builder)\n        return entries\n\n    def SourceSignatures(self, type):\n        global _warn_source_signatures_deprecated\n        if _warn_source_signatures_deprecated:\n            msg = \"The env.SourceSignatures() method is deprecated;\\n\" + \\\n                  \"\\tconvert your build to use the env.Decider() method instead.\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceSignaturesWarning, msg)\n            _warn_source_signatures_deprecated = False\n        type = self.subst(type)\n        self.src_sig_type = type\n        if type == 'MD5':\n            if not SCons.Util.md5:\n                raise UserError(\"MD5 signatures are not available in this version of Python.\")\n            self.decide_source = self._changed_content\n        elif type == 'timestamp':\n            self.decide_source = self._changed_timestamp_match\n        else:\n            raise UserError(\"Unknown source signature type '%s'\" % type)\n\n    def Split(self, arg):\n        \"\"\"This function converts a string or list into a list of strings\n        or Nodes.  This makes things easier for users by allowing files to\n        be specified as a white-space separated list to be split.\n        The input rules are:\n            - A single string containing names separated by spaces. These will be\n              split apart at the spaces.\n            - A single Node instance\n            - A list containing either strings or Node instances. Any strings\n              in the list are not split at spaces.\n        In all cases, the function returns a list of Nodes and strings.\"\"\"\n        if SCons.Util.is_List(arg):\n            return list(map(self.subst, arg))\n        elif SCons.Util.is_String(arg):\n            return self.subst(arg).split()\n        else:\n            return [self.subst(arg)]\n\n    def TargetSignatures(self, type):\n        global _warn_target_signatures_deprecated\n        if _warn_target_signatures_deprecated:\n            msg = \"The env.TargetSignatures() method is deprecated;\\n\" + \\\n                  \"\\tconvert your build to use the env.Decider() method instead.\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedTargetSignaturesWarning, msg)\n            _warn_target_signatures_deprecated = False\n        type = self.subst(type)\n        self.tgt_sig_type = type\n        if type in ('MD5', 'content'):\n            if not SCons.Util.md5:\n                raise UserError(\"MD5 signatures are not available in this version of Python.\")\n            self.decide_target = self._changed_content\n        elif type == 'timestamp':\n            self.decide_target = self._changed_timestamp_match\n        elif type == 'build':\n            self.decide_target = self._changed_build\n        elif type == 'source':\n            self.decide_target = self._changed_source\n        else:\n            raise UserError(\"Unknown target signature type '%s'\"%type)\n\n    def Value(self, value, built_value=None):\n        \"\"\"\n        \"\"\"\n        return SCons.Node.Python.Value(value, built_value)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        variant_dir = self.arg2nodes(variant_dir, self.fs.Dir)[0]\n        src_dir = self.arg2nodes(src_dir, self.fs.Dir)[0]\n        self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n    def FindSourceFiles(self, node='.'):\n        \"\"\" returns a list of all source files.\n        \"\"\"\n        node = self.arg2nodes(node, self.fs.Entry)[0]\n\n        sources = []\n        def build_source(ss):\n            for s in ss:\n                if isinstance(s, SCons.Node.FS.Dir):\n                    build_source(s.all_children())\n                elif s.has_builder():\n                    build_source(s.sources)\n                elif isinstance(s.disambiguate(), SCons.Node.FS.File):\n                    sources.append(s)\n        build_source(node.all_children())\n\n        def final_source(node):\n            while (node != node.srcnode()):\n              node = node.srcnode()\n            return node\n        sources = map( final_source, sources );\n        # remove duplicates\n        return list(set(sources))\n\n    def FindInstalledFiles(self):\n        \"\"\" returns the list of all targets of the Install and InstallAs Builder.\n        \"\"\"\n        from SCons.Tool import install\n        if install._UNIQUE_INSTALLED_FILES is None:\n            install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)\n        return install._UNIQUE_INSTALLED_FILES\n\n\nclass OverrideEnvironment(Base):\n    \"\"\"A proxy that overrides variables in a wrapped construction\n    environment by returning values from an overrides dictionary in\n    preference to values from the underlying subject environment.\n\n    This is a lightweight (I hope) proxy that passes through most use of\n    attributes to the underlying Environment.Base class, but has just\n    enough additional methods defined to act like a real construction\n    environment with overridden values.  It can wrap either a Base\n    construction environment, or another OverrideEnvironment, which\n    can in turn nest arbitrary OverrideEnvironments...\n\n    Note that we do *not* call the underlying base class\n    (SubsitutionEnvironment) initialization, because we get most of those\n    from proxying the attributes of the subject construction environment.\n    But because we subclass SubstitutionEnvironment, this class also\n    has inherited arg2nodes() and subst*() methods; those methods can't\n    be proxied because they need *this* object's methods to fetch the\n    values from the overrides dictionary.\n    \"\"\"\n\n    def __init__(self, subject, overrides={}):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment')\n        self.__dict__['__subject'] = subject\n        self.__dict__['overrides'] = overrides\n\n    # Methods that make this class act like a proxy.\n    def __getattr__(self, name):\n        return getattr(self.__dict__['__subject'], name)\n    def __setattr__(self, name, value):\n        setattr(self.__dict__['__subject'], name, value)\n\n    # Methods that make this class act like a dictionary.\n    def __getitem__(self, key):\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].__getitem__(key)\n    def __setitem__(self, key, value):\n        if not is_valid_construction_var(key):\n            raise SCons.Errors.UserError(\"Illegal construction variable `%s'\" % key)\n        self.__dict__['overrides'][key] = value\n    def __delitem__(self, key):\n        try:\n            del self.__dict__['overrides'][key]\n        except KeyError:\n            deleted = 0\n        else:\n            deleted = 1\n        try:\n            result = self.__dict__['__subject'].__delitem__(key)\n        except KeyError:\n            if not deleted:\n                raise\n            result = None\n        return result\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].get(key, default)\n    def has_key(self, key):\n        try:\n            self.__dict__['overrides'][key]\n            return 1\n        except KeyError:\n            return key in self.__dict__['__subject']\n    def __contains__(self, key):\n        if self.__dict__['overrides'].__contains__(key):\n            return 1\n        return self.__dict__['__subject'].__contains__(key)\n    def Dictionary(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        d = self.__dict__['__subject'].Dictionary().copy()\n        d.update(self.__dict__['overrides'])\n        return d\n    def items(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        return list(self.Dictionary().items())\n\n    # Overridden private construction environment methods.\n    def _update(self, dict):\n        \"\"\"Update an environment's values directly, bypassing the normal\n        checks that occur when users try to set items.\n        \"\"\"\n        self.__dict__['overrides'].update(dict)\n\n    def gvars(self):\n        return self.__dict__['__subject'].gvars()\n\n    def lvars(self):\n        lvars = self.__dict__['__subject'].lvars()\n        lvars.update(self.__dict__['overrides'])\n        return lvars\n\n    # Overridden public construction environment methods.\n    def Replace(self, **kw):\n        kw = copy_non_reserved_keywords(kw)\n        self.__dict__['overrides'].update(semi_deepcopy(kw))\n\n# The entry point that will be used by the external world\n# to refer to a construction environment.  This allows the wrapper\n# interface to extend a construction environment for its own purposes\n# by subclassing SCons.Environment.Base and then assigning the\n# class to SCons.Environment.Environment.\n\nEnvironment = Base\n\n# An entry point for returning a proxy subclass instance that overrides\n# the subst*() methods so they don't actually perform construction\n# variable substitution.  This is specifically intended to be the shim\n# layer in between global function calls (which don't want construction\n# variable substitution) and the DefaultEnvironment() (which would\n# substitute variables if left to its own devices).\"\"\"\n#\n# We have to wrap this in a function that allows us to delay definition of\n# the class until it's necessary, so that when it subclasses Environment\n# it will pick up whatever Environment subclass the wrapper interface\n# might have assigned to SCons.Environment.Environment.\n\ndef NoSubstitutionProxy(subject):\n    class _NoSubstitutionProxy(Environment):\n        def __init__(self, subject):\n            self.__dict__['__subject'] = subject\n        def __getattr__(self, name):\n            return getattr(self.__dict__['__subject'], name)\n        def __setattr__(self, name, value):\n            return setattr(self.__dict__['__subject'], name, value)\n        def executor_to_lvars(self, kwdict):\n            if kwdict.has_key('executor'):\n                kwdict['lvars'] = kwdict['executor'].get_lvars()\n                del kwdict['executor']\n            else:\n                kwdict['lvars'] = {}\n        def raw_to_mode(self, dict):\n            try:\n                raw = dict['raw']\n            except KeyError:\n                pass\n            else:\n                del dict['raw']\n                dict['mode'] = raw\n        def subst(self, string, *args, **kwargs):\n            return string\n        def subst_kw(self, kw, *args, **kwargs):\n            return kw\n        def subst_list(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst_list(*nargs, **nkw)\n        def subst_target_source(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst(*nargs, **nkw)\n    return _NoSubstitutionProxy(subject)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Errors.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\"\"\"SCons.Errors\n\nThis file contains the exception classes used to handle internal\nand user errors in SCons.\n\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Errors.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport exceptions\n\nclass BuildError(Exception):\n    \"\"\" Errors occuring while building.\n\n    BuildError have the following attributes:\n\n        Information about the cause of the build error:\n        -----------------------------------------------\n\n        errstr : a description of the error message\n\n        status : the return code of the action that caused the build\n                 error. Must be set to a non-zero value even if the\n                 build error is not due to an action returning a\n                 non-zero returned code.\n\n        exitstatus : SCons exit status due to this build error.\n                     Must be nonzero unless due to an explicit Exit()\n                     call.  Not always the same as status, since\n                     actions return a status code that should be\n                     respected, but SCons typically exits with 2\n                     irrespective of the return value of the failed\n                     action.\n\n        filename : The name of the file or directory that caused the\n                   build error. Set to None if no files are associated with\n                   this error. This might be different from the target\n                   being built. For example, failure to create the\n                   directory in which the target file will appear. It\n                   can be None if the error is not due to a particular\n                   filename.\n\n        exc_info : Info about exception that caused the build\n                   error. Set to (None, None, None) if this build\n                   error is not due to an exception.\n\n\n        Information about the cause of the location of the error:\n        ---------------------------------------------------------\n\n        node : the error occured while building this target node(s)\n\n        executor : the executor that caused the build to fail (might\n                   be None if the build failures is not due to the\n                   executor failing)\n\n        action : the action that caused the build to fail (might be\n                 None if the build failures is not due to the an\n                 action failure)\n\n        command : the command line for the action that caused the\n                  build to fail (might be None if the build failures\n                  is not due to the an action failure)\n        \"\"\"\n\n    def __init__(self,\n                 node=None, errstr=\"Unknown error\", status=2, exitstatus=2,\n                 filename=None, executor=None, action=None, command=None,\n                 exc_info=(None, None, None)):\n\n        self.errstr = errstr\n        self.status = status\n        self.exitstatus = exitstatus\n        self.filename = filename\n        self.exc_info = exc_info\n\n        self.node = node\n        self.executor = executor\n        self.action = action\n        self.command = command\n\n        Exception.__init__(self, node, errstr, status, exitstatus, filename,\n                           executor, action, command, exc_info)\n\n    def __str__(self):\n        if self.filename:\n            return self.filename + ': ' + self.errstr\n        else:\n            return self.errstr\n\nclass InternalError(Exception):\n    pass\n\nclass UserError(Exception):\n    pass\n\nclass StopError(Exception):\n    pass\n\nclass EnvironmentError(Exception):\n    pass\n\nclass MSVCError(IOError):\n    pass\n\nclass ExplicitExit(Exception):\n    def __init__(self, node=None, status=None, *args):\n        self.node = node\n        self.status = status\n        self.exitstatus = status\n        Exception.__init__(self, *args)\n\ndef convert_to_BuildError(status, exc_info=None):\n    \"\"\"\n    Convert any return code a BuildError Exception.\n\n    `status' can either be a return code or an Exception.\n    The buildError.status we set here will normally be\n    used as the exit status of the \"scons\" process.\n    \"\"\"\n    if not exc_info and isinstance(status, Exception):\n        exc_info = (status.__class__, status, None)\n\n    if isinstance(status, BuildError):\n        buildError = status\n        buildError.exitstatus = 2   # always exit with 2 on build errors\n    elif isinstance(status, ExplicitExit):\n        status = status.status\n        errstr = 'Explicit exit, status %s' % status\n        buildError = BuildError(\n            errstr=errstr,\n            status=status,      # might be 0, OK here\n            exitstatus=status,      # might be 0, OK here\n            exc_info=exc_info)\n    elif isinstance(status, (StopError, UserError)):\n        buildError = BuildError(\n            errstr=str(status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif isinstance(status, exceptions.EnvironmentError):\n        # If an IOError/OSError happens, raise a BuildError.\n        # Report the name of the file or directory that caused the\n        # error, which might be different from the target being built\n        # (for example, failure to create the directory in which the\n        # target file will appear).\n        try: filename = status.filename\n        except AttributeError: filename = None\n        buildError = BuildError(\n            errstr=status.strerror,\n            status=status.errno,\n            exitstatus=2,\n            filename=filename,\n            exc_info=exc_info)\n    elif isinstance(status, Exception):\n        buildError = BuildError(\n            errstr='%s : %s' % (status.__class__.__name__, status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif SCons.Util.is_String(status):\n        buildError = BuildError(\n            errstr=status,\n            status=2,\n            exitstatus=2)\n    else:\n        buildError = BuildError(\n            errstr=\"Error %s\" % status,\n            status=status,\n            exitstatus=2)\n\n    #import sys\n    #sys.stderr.write(\"convert_to_BuildError: status %s => (errstr %s, status %s)\"%(status,buildError.errstr, buildError.status))\n    return buildError\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Executor.py",
    "content": "\"\"\"SCons.Executor\n\nA module for executing actions with specific lists of target and source\nNodes.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Executor.py  2014/07/05 09:42:21 garyo\"\n\nimport collections\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Memoize\n\n\nclass Batch(object):\n    \"\"\"Remembers exact association between targets\n    and sources of executor.\"\"\"\n    def __init__(self, targets=[], sources=[]):\n        self.targets = targets\n        self.sources = sources\n\n\n\nclass TSList(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by wrapping\n    an executor Method.  This class is used in the Executor.lvars()\n    to delay creation of NodeList objects until they're needed.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        nl = self.func()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.func()\n        return nl[i]\n    def __getslice__(self, i, j):\n        nl = self.func()\n        i = max(i, 0); j = max(j, 0)\n        return nl[i:j]\n    def __str__(self):\n        nl = self.func()\n        return str(nl)\n    def __repr__(self):\n        nl = self.func()\n        return repr(nl)\n\nclass TSObject(object):\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by wrapping\n    an Executor method.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        n = self.func()\n        return getattr(n, attr)\n    def __str__(self):\n        n = self.func()\n        if n:\n            return str(n)\n        return ''\n    def __repr__(self):\n        n = self.func()\n        if n:\n            return repr(n)\n        return ''\n\ndef rfile(node):\n    \"\"\"\n    A function to return the results of a Node's rfile() method,\n    if it exists, and the Node itself otherwise (if it's a Value\n    Node, e.g.).\n    \"\"\"\n    try:\n        rfile = node.rfile\n    except AttributeError:\n        return node\n    else:\n        return rfile()\n\n\nclass Executor(object):\n    \"\"\"A class for controlling instances of executing an action.\n\n    This largely exists to hold a single association of an action,\n    environment, list of environment override dictionaries, targets\n    and sources for later processing as needed.\n    \"\"\"\n\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    memoizer_counters = []\n\n    def __init__(self, action, env=None, overridelist=[{}],\n                 targets=[], sources=[], builder_kw={}):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor')\n        self.set_action_list(action)\n        self.pre_actions = []\n        self.post_actions = []\n        self.env = env\n        self.overridelist = overridelist\n        if targets or sources:\n            self.batches = [Batch(targets[:], sources[:])]\n        else:\n            self.batches = []\n        self.builder_kw = builder_kw\n        self._memo = {}\n\n    def get_lvars(self):\n        try:\n            return self.lvars\n        except AttributeError:\n            self.lvars = {\n                'CHANGED_SOURCES' : TSList(self._get_changed_sources),\n                'CHANGED_TARGETS' : TSList(self._get_changed_targets),\n                'SOURCE' : TSObject(self._get_source),\n                'SOURCES' : TSList(self._get_sources),\n                'TARGET' : TSObject(self._get_target),\n                'TARGETS' : TSList(self._get_targets),\n                'UNCHANGED_SOURCES' : TSList(self._get_unchanged_sources),\n                'UNCHANGED_TARGETS' : TSList(self._get_unchanged_targets),\n            }\n            return self.lvars\n\n    def _get_changes(self):\n        cs = []\n        ct = []\n        us = []\n        ut = []\n        for b in self.batches:\n            if b.targets[0].is_up_to_date():\n                us.extend(list(map(rfile, b.sources)))\n                ut.extend(b.targets)\n            else:\n                cs.extend(list(map(rfile, b.sources)))\n                ct.extend(b.targets)\n        self._changed_sources_list = SCons.Util.NodeList(cs)\n        self._changed_targets_list = SCons.Util.NodeList(ct)\n        self._unchanged_sources_list = SCons.Util.NodeList(us)\n        self._unchanged_targets_list = SCons.Util.NodeList(ut)\n\n    def _get_changed_sources(self, *args, **kw):\n        try:\n            return self._changed_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_sources_list\n\n    def _get_changed_targets(self, *args, **kw):\n        try:\n            return self._changed_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_targets_list\n\n    def _get_source(self, *args, **kw):\n        #return SCons.Util.NodeList([rfile(self.batches[0].sources[0]).get_subst_proxy()])\n        return rfile(self.batches[0].sources[0]).get_subst_proxy()\n\n    def _get_sources(self, *args, **kw):\n        return SCons.Util.NodeList([rfile(n).get_subst_proxy() for n in self.get_all_sources()])\n\n    def _get_target(self, *args, **kw):\n        #return SCons.Util.NodeList([self.batches[0].targets[0].get_subst_proxy()])\n        return self.batches[0].targets[0].get_subst_proxy()\n\n    def _get_targets(self, *args, **kw):\n        return SCons.Util.NodeList([n.get_subst_proxy() for n in self.get_all_targets()])\n\n    def _get_unchanged_sources(self, *args, **kw):\n        try:\n            return self._unchanged_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_sources_list\n\n    def _get_unchanged_targets(self, *args, **kw):\n        try:\n            return self._unchanged_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_targets_list\n\n    def get_action_targets(self):\n        if not self.action_list:\n            return []\n        targets_string = self.action_list[0].get_targets(self.env, self)\n        if targets_string[0] == '$':\n            targets_string = targets_string[1:]\n        return self.get_lvars()[targets_string]\n\n    def set_action_list(self, action):\n        import SCons.Util\n        if not SCons.Util.is_List(action):\n            if not action:\n                import SCons.Errors\n                raise SCons.Errors.UserError(\"Executor must have an action.\")\n            action = [action]\n        self.action_list = action\n\n    def get_action_list(self):\n        if self.action_list is None:\n            return []\n        return self.pre_actions + self.action_list + self.post_actions\n\n    def get_all_targets(self):\n        \"\"\"Returns all targets for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.targets)\n        return result\n\n    def get_all_sources(self):\n        \"\"\"Returns all sources for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.sources)\n        return result\n\n    def get_all_children(self):\n        \"\"\"Returns all unique children (dependencies) for all batches\n        of this Executor.\n\n        The Taskmaster can recognize when it's already evaluated a\n        Node, so we don't have to make this list unique for its intended\n        canonical use case, but we expect there to be a lot of redundancy\n        (long lists of batched .cc files #including the same .h files\n        over and over), so removing the duplicates once up front should\n        save the Taskmaster a lot of work.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            result.extend(target.children())\n        return result\n\n    def get_all_prerequisites(self):\n        \"\"\"Returns all unique (order-only) prerequisites for all batches\n        of this Executor.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            if target.prerequisites is not None:\n                result.extend(target.prerequisites)\n        return result\n\n    def get_action_side_effects(self):\n\n        \"\"\"Returns all side effects for all batches of this\n        Executor used by the underlying Action.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_action_targets():\n            result.extend(target.side_effects)\n        return result\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_build_env'))\n\n    def get_build_env(self):\n        \"\"\"Fetch or create the appropriate build Environment\n        for this Executor.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n\n        # Create the build environment instance with appropriate\n        # overrides.  These get evaluated against the current\n        # environment's construction variables so that users can\n        # add to existing values by referencing the variable in\n        # the expansion.\n        overrides = {}\n        for odict in self.overridelist:\n            overrides.update(odict)\n\n        import SCons.Defaults\n        env = self.env or SCons.Defaults.DefaultEnvironment()\n        build_env = env.Override(overrides)\n\n        self._memo['get_build_env'] = build_env\n\n        return build_env\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the scanner path for this executor's targets and sources.\n        \"\"\"\n        env = self.get_build_env()\n        try:\n            cwd = self.batches[0].targets[0].cwd\n        except (IndexError, AttributeError):\n            cwd = None\n        return scanner.path(env, cwd,\n                            self.get_all_targets(),\n                            self.get_all_sources())\n\n    def get_kw(self, kw={}):\n        result = self.builder_kw.copy()\n        result.update(kw)\n        result['executor'] = self\n        return result\n\n    def do_nothing(self, target, kw):\n        return 0\n\n    def do_execute(self, target, kw):\n        \"\"\"Actually execute the action list.\"\"\"\n        env = self.get_build_env()\n        kw = self.get_kw(kw)\n        status = 0\n        for act in self.get_action_list():\n            #args = (self.get_all_targets(), self.get_all_sources(), env)\n            args = ([], [], env)\n            status = act(*args, **kw)\n            if isinstance(status, SCons.Errors.BuildError):\n                status.executor = self\n                raise status\n            elif status:\n                msg = \"Error %s\" % status\n                raise SCons.Errors.BuildError(\n                    errstr=msg,\n                    node=self.batches[0].targets,\n                    executor=self,\n                    action=act)\n        return status\n\n    # use extra indirection because with new-style objects (Python 2.2\n    # and above) we can't override special methods, and nullify() needs\n    # to be able to do this.\n\n    def __call__(self, target, **kw):\n        return self.do_execute(target, kw)\n\n    def cleanup(self):\n        self._memo = {}\n\n    def add_sources(self, sources):\n        \"\"\"Add source files to this Executor's list.  This is necessary\n        for \"multi\" Builders that can be called repeatedly to build up\n        a source file list for a given target.\"\"\"\n        # TODO(batch):  extend to multiple batches\n        assert (len(self.batches) == 1)\n        # TODO(batch):  remove duplicates?\n        sources = [x for x in sources if x not in self.batches[0].sources]\n        self.batches[0].sources.extend(sources)\n\n    def get_sources(self):\n        return self.batches[0].sources\n\n    def add_batch(self, targets, sources):\n        \"\"\"Add pair of associated target and source to this Executor's list.\n        This is necessary for \"batch\" Builders that can be called repeatedly\n        to build up a list of matching target and source files that will be\n        used in order to update multiple target files at once from multiple\n        corresponding source files, for tools like MSVC that support it.\"\"\"\n        self.batches.append(Batch(targets, sources))\n\n    def prepare(self):\n        \"\"\"\n        Preparatory checks for whether this Executor can go ahead\n        and (try to) build its targets.\n        \"\"\"\n        for s in self.get_all_sources():\n            if s.missing():\n                msg = \"Source `%s' not found, needed by target `%s'.\"\n                raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))\n\n    def add_pre_action(self, action):\n        self.pre_actions.append(action)\n\n    def add_post_action(self, action):\n        self.post_actions.append(action)\n\n    # another extra indirection for new-style objects and nullify...\n\n    def my_str(self):\n        env = self.get_build_env()\n        return \"\\n\".join([action.genstring(self.get_all_targets(),\n                                           self.get_all_sources(),\n                                           env)\n                          for action in self.get_action_list()])\n\n\n    def __str__(self):\n        return self.my_str()\n\n    def nullify(self):\n        self.cleanup()\n        self.do_execute = self.do_nothing\n        self.my_str     = lambda: ''\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_contents'))\n\n    def get_contents(self):\n        \"\"\"Fetch the signature contents.  This is the main reason this\n        class exists, so we can compute this once and cache it regardless\n        of how many target or source Nodes there are.\n        \"\"\"\n        try:\n            return self._memo['get_contents']\n        except KeyError:\n            pass\n        env = self.get_build_env()\n        result = \"\".join([action.get_contents(self.get_all_targets(),\n                                              self.get_all_sources(),\n                                              env)\n                          for action in self.get_action_list()])\n        self._memo['get_contents'] = result\n        return result\n\n    def get_timestamp(self):\n        \"\"\"Fetch a time stamp for this Executor.  We don't have one, of\n        course (only files do), but this is the interface used by the\n        timestamp module.\n        \"\"\"\n        return 0\n\n    def scan_targets(self, scanner):\n        # TODO(batch):  scan by batches\n        self.scan(scanner, self.get_all_targets())\n\n    def scan_sources(self, scanner):\n        # TODO(batch):  scan by batches\n        if self.batches[0].sources:\n            self.scan(scanner, self.get_all_sources())\n\n    def scan(self, scanner, node_list):\n        \"\"\"Scan a list of this Executor's files (targets or sources) for\n        implicit dependencies and update all of the targets with them.\n        This essentially short-circuits an N*M scan of the sources for\n        each individual target, which is a hell of a lot more efficient.\n        \"\"\"\n        env = self.get_build_env()\n\n        # TODO(batch):  scan by batches)\n        deps = []\n        if scanner:\n            for node in node_list:\n                node.disambiguate()\n                s = scanner.select(node)\n                if not s:\n                    continue\n                path = self.get_build_scanner_path(s)\n                deps.extend(node.get_implicit_deps(env, s, path))\n        else:\n            kw = self.get_kw()\n            for node in node_list:\n                node.disambiguate()\n                scanner = node.get_env_scanner(env, kw)\n                if not scanner:\n                    continue\n                scanner = scanner.select(node)\n                if not scanner:\n                    continue\n                path = self.get_build_scanner_path(scanner)\n                deps.extend(node.get_implicit_deps(env, scanner, path))\n\n        deps.extend(self.get_implicit_deps())\n\n        for tgt in self.get_all_targets():\n            tgt.add_to_implicit(deps)\n\n    def _get_unignored_sources_key(self, node, ignore=()):\n        return (node,) + tuple(ignore)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('get_unignored_sources', _get_unignored_sources_key))\n\n    def get_unignored_sources(self, node, ignore=()):\n        key = (node,) + tuple(ignore)\n        try:\n            memo_dict = self._memo['get_unignored_sources']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_unignored_sources'] = memo_dict\n        else:\n            try:\n                return memo_dict[key]\n            except KeyError:\n                pass\n\n        if node:\n            # TODO:  better way to do this (it's a linear search,\n            # but it may not be critical path)?\n            sourcelist = []\n            for b in self.batches:\n                if node in b.targets:\n                    sourcelist = b.sources\n                    break\n        else:\n            sourcelist = self.get_all_sources()\n        if ignore:\n            idict = {}\n            for i in ignore:\n                idict[i] = 1\n            sourcelist = [s for s in sourcelist if s not in idict]\n\n        memo_dict[key] = sourcelist\n\n        return sourcelist\n\n    def get_implicit_deps(self):\n        \"\"\"Return the executor's implicit dependencies, i.e. the nodes of\n        the commands to be executed.\"\"\"\n        result = []\n        build_env = self.get_build_env()\n        for act in self.get_action_list():\n            deps = act.get_implicit_deps(self.get_all_targets(),\n                                         self.get_all_sources(),\n                                         build_env)\n            result.extend(deps)\n        return result\n\n\n\n_batch_executors = {}\n\ndef GetBatchExecutor(key):\n    return _batch_executors[key]\n\ndef AddBatchExecutor(key, executor):\n    assert key not in _batch_executors\n    _batch_executors[key] = executor\n\nnullenv = None\n\n\ndef get_NullEnvironment():\n    \"\"\"Use singleton pattern for Null Environments.\"\"\"\n    global nullenv\n\n    import SCons.Util\n    class NullEnvironment(SCons.Util.Null):\n        import SCons.CacheDir\n        _CacheDir_path = None\n        _CacheDir = SCons.CacheDir.CacheDir(None)\n        def get_CacheDir(self):\n            return self._CacheDir\n\n    if not nullenv:\n        nullenv = NullEnvironment()\n    return nullenv\n\nclass Null(object):\n    \"\"\"A null Executor, with a null build Environment, that does\n    nothing when the rest of the methods call it.\n\n    This might be able to disappear when we refactor things to\n    disassociate Builders from Nodes entirely, so we're not\n    going to worry about unit tests for this--at least for now.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null')\n        self.batches = [Batch(kw['targets'][:], [])]\n    def get_build_env(self):\n        return get_NullEnvironment()\n    def get_build_scanner_path(self):\n        return None\n    def cleanup(self):\n        pass\n    def prepare(self):\n        pass\n    def get_unignored_sources(self, *args, **kw):\n        return tuple(())\n    def get_action_targets(self):\n        return []\n    def get_action_list(self):\n        return []\n    def get_all_targets(self):\n        return self.batches[0].targets\n    def get_all_sources(self):\n        return self.batches[0].targets[0].sources\n    def get_all_children(self):\n        return self.batches[0].targets[0].children()\n    def get_all_prerequisites(self):\n        return []\n    def get_action_side_effects(self):\n        return []\n    def __call__(self, *args, **kw):\n        return 0\n    def get_contents(self):\n        return ''\n    def _morph(self):\n        \"\"\"Morph this Null executor to a real Executor object.\"\"\"\n        batches = self.batches\n        self.__class__ = Executor\n        self.__init__([])\n        self.batches = batches\n\n    # The following methods require morphing this Null Executor to a\n    # real Executor object.\n\n    def add_pre_action(self, action):\n        self._morph()\n        self.add_pre_action(action)\n    def add_post_action(self, action):\n        self._morph()\n        self.add_post_action(action)\n    def set_action_list(self, action):\n        self._morph()\n        self.set_action_list(action)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Job.py",
    "content": "\"\"\"SCons.Job\n\nThis module defines the Serial and Parallel classes that execute tasks to\ncomplete a build. The Jobs class provides a higher level interface to start,\nstop, and wait on jobs.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Job.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport os\nimport signal\n\nimport SCons.Errors\n\n# The default stack size (in kilobytes) of the threads used to execute\n# jobs in parallel.\n#\n# We use a stack size of 256 kilobytes. The default on some platforms\n# is too large and prevents us from creating enough threads to fully\n# parallelized the build. For example, the default stack size on linux\n# is 8 MBytes.\n\nexplicit_stack_size = None\ndefault_stack_size = 256\n\ninterrupt_msg = 'Build interrupted.'\n\n\nclass InterruptState(object):\n   def __init__(self):\n       self.interrupted = False\n\n   def set(self):\n       self.interrupted = True\n\n   def __call__(self):\n       return self.interrupted\n\n\nclass Jobs(object):\n    \"\"\"An instance of this class initializes N jobs, and provides\n    methods for starting, stopping, and waiting on all N jobs.\n    \"\"\"\n\n    def __init__(self, num, taskmaster):\n        \"\"\"\n        create 'num' jobs using the given taskmaster.\n\n        If 'num' is 1 or less, then a serial job will be used,\n        otherwise a parallel job with 'num' worker threads will\n        be used.\n\n        The 'num_jobs' attribute will be set to the actual number of jobs\n        allocated.  If more than one job is requested but the Parallel\n        class can't do it, it gets reset to 1.  Wrapping interfaces that\n        care should check the value of 'num_jobs' after initialization.\n        \"\"\"\n\n        self.job = None\n        if num > 1:\n            stack_size = explicit_stack_size\n            if stack_size is None:\n                stack_size = default_stack_size\n\n            try:\n                self.job = Parallel(taskmaster, num, stack_size)\n                self.num_jobs = num\n            except NameError:\n                pass\n        if self.job is None:\n            self.job = Serial(taskmaster)\n            self.num_jobs = 1\n\n    def run(self, postfunc=lambda: None):\n        \"\"\"Run the jobs.\n\n        postfunc() will be invoked after the jobs has run. It will be\n        invoked even if the jobs are interrupted by a keyboard\n        interrupt (well, in fact by a signal such as either SIGINT,\n        SIGTERM or SIGHUP). The execution of postfunc() is protected\n        against keyboard interrupts and is guaranteed to run to\n        completion.\"\"\"\n        self._setup_sig_handler()\n        try:\n            self.job.start()\n        finally:\n            postfunc()\n            self._reset_sig_handler()\n\n    def were_interrupted(self):\n        \"\"\"Returns whether the jobs were interrupted by a signal.\"\"\"\n        return self.job.interrupted()\n\n    def _setup_sig_handler(self):\n        \"\"\"Setup an interrupt handler so that SCons can shutdown cleanly in\n        various conditions:\n\n          a) SIGINT: Keyboard interrupt\n          b) SIGTERM: kill or system shutdown\n          c) SIGHUP: Controlling shell exiting\n\n        We handle all of these cases by stopping the taskmaster. It\n        turns out that it very difficult to stop the build process\n        by throwing asynchronously an exception such as\n        KeyboardInterrupt. For example, the python Condition\n        variables (threading.Condition) and queue's do not seem to\n        asynchronous-exception-safe. It would require adding a whole\n        bunch of try/finally block and except KeyboardInterrupt all\n        over the place.\n\n        Note also that we have to be careful to handle the case when\n        SCons forks before executing another process. In that case, we\n        want the child to exit immediately.\n        \"\"\"\n        def handler(signum, stack, self=self, parentpid=os.getpid()):\n            if os.getpid() == parentpid:\n                self.job.taskmaster.stop()\n                self.job.interrupted.set()\n            else:\n                os._exit(2)\n\n        self.old_sigint  = signal.signal(signal.SIGINT, handler)\n        self.old_sigterm = signal.signal(signal.SIGTERM, handler)\n        try:\n            self.old_sighup = signal.signal(signal.SIGHUP, handler)\n        except AttributeError:\n            pass\n\n    def _reset_sig_handler(self):\n        \"\"\"Restore the signal handlers to their previous state (before the\n         call to _setup_sig_handler().\"\"\"\n\n        signal.signal(signal.SIGINT, self.old_sigint)\n        signal.signal(signal.SIGTERM, self.old_sigterm)\n        try:\n            signal.signal(signal.SIGHUP, self.old_sighup)\n        except AttributeError:\n            pass\n\nclass Serial(object):\n    \"\"\"This class is used to execute tasks in series, and is more efficient\n    than Parallel, but is only appropriate for non-parallel builds. Only\n    one instance of this class should be in existence at a time.\n\n    This class is not thread safe.\n    \"\"\"\n\n    def __init__(self, taskmaster):\n        \"\"\"Create a new serial job given a taskmaster.\n\n        The taskmaster's next_task() method should return the next task\n        that needs to be executed, or None if there are no more tasks. The\n        taskmaster's executed() method will be called for each task when it\n        is successfully executed or failed() will be called if it failed to\n        execute (e.g. execute() raised an exception).\"\"\"\n\n        self.taskmaster = taskmaster\n        self.interrupted = InterruptState()\n\n    def start(self):\n        \"\"\"Start the job. This will begin pulling tasks from the taskmaster\n        and executing them, and return when there are no more tasks. If a task\n        fails to execute (i.e. execute() raises an exception), then the job will\n        stop.\"\"\"\n\n        while True:\n            task = self.taskmaster.next_task()\n\n            if task is None:\n                break\n\n            try:\n                task.prepare()\n                if task.needs_execute():\n                    task.execute()\n            except:\n                if self.interrupted():\n                    try:\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    except:\n                        task.exception_set()\n                else:\n                    task.exception_set()\n\n                # Let the failed() callback function arrange for the\n                # build to stop if that's appropriate.\n                task.failed()\n            else:\n                task.executed()\n\n            task.postprocess()\n        self.taskmaster.cleanup()\n\n\n# Trap import failure so that everything in the Job module but the\n# Parallel class (and its dependent classes) will work if the interpreter\n# doesn't support threads.\ntry:\n    import queue\n    import threading\nexcept ImportError:\n    pass\nelse:\n    class Worker(threading.Thread):\n        \"\"\"A worker thread waits on a task to be posted to its request queue,\n        dequeues the task, executes it, and posts a tuple including the task\n        and a boolean indicating whether the task executed successfully. \"\"\"\n\n        def __init__(self, requestQueue, resultsQueue, interrupted):\n            threading.Thread.__init__(self)\n            self.setDaemon(1)\n            self.requestQueue = requestQueue\n            self.resultsQueue = resultsQueue\n            self.interrupted = interrupted\n            self.start()\n\n        def run(self):\n            while True:\n                task = self.requestQueue.get()\n\n                if task is None:\n                    # The \"None\" value is used as a sentinel by\n                    # ThreadPool.cleanup().  This indicates that there\n                    # are no more tasks, so we should quit.\n                    break\n\n                try:\n                    if self.interrupted():\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    task.execute()\n                except:\n                    task.exception_set()\n                    ok = False\n                else:\n                    ok = True\n\n                self.resultsQueue.put((task, ok))\n\n    class ThreadPool(object):\n        \"\"\"This class is responsible for spawning and managing worker threads.\"\"\"\n\n        def __init__(self, num, stack_size, interrupted):\n            \"\"\"Create the request and reply queues, and 'num' worker threads.\n\n            One must specify the stack size of the worker threads. The\n            stack size is specified in kilobytes.\n            \"\"\"\n            self.requestQueue = queue.Queue(0)\n            self.resultsQueue = queue.Queue(0)\n\n            try:\n                prev_size = threading.stack_size(stack_size*1024)\n            except AttributeError, e:\n                # Only print a warning if the stack size has been\n                # explicitly set.\n                if not explicit_stack_size is None:\n                    msg = \"Setting stack size is unsupported by this version of Python:\\n    \" + \\\n                        e.args[0]\n                    SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n            except ValueError, e:\n                msg = \"Setting stack size failed:\\n    \" + str(e)\n                SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n\n            # Create worker threads\n            self.workers = []\n            for _ in range(num):\n                worker = Worker(self.requestQueue, self.resultsQueue, interrupted)\n                self.workers.append(worker)\n\n            if 'prev_size' in locals():\n                threading.stack_size(prev_size)\n\n        def put(self, task):\n            \"\"\"Put task into request queue.\"\"\"\n            self.requestQueue.put(task)\n\n        def get(self):\n            \"\"\"Remove and return a result tuple from the results queue.\"\"\"\n            return self.resultsQueue.get()\n\n        def preparation_failed(self, task):\n            self.resultsQueue.put((task, False))\n\n        def cleanup(self):\n            \"\"\"\n            Shuts down the thread pool, giving each worker thread a\n            chance to shut down gracefully.\n            \"\"\"\n            # For each worker thread, put a sentinel \"None\" value\n            # on the requestQueue (indicating that there's no work\n            # to be done) so that each worker thread will get one and\n            # terminate gracefully.\n            for _ in self.workers:\n                self.requestQueue.put(None)\n\n            # Wait for all of the workers to terminate.\n            #\n            # If we don't do this, later Python versions (2.4, 2.5) often\n            # seem to raise exceptions during shutdown.  This happens\n            # in requestQueue.get(), as an assertion failure that\n            # requestQueue.not_full is notified while not acquired,\n            # seemingly because the main thread has shut down (or is\n            # in the process of doing so) while the workers are still\n            # trying to pull sentinels off the requestQueue.\n            #\n            # Normally these terminations should happen fairly quickly,\n            # but we'll stick a one-second timeout on here just in case\n            # someone gets hung.\n            for worker in self.workers:\n                worker.join(1.0)\n            self.workers = []\n\n    class Parallel(object):\n        \"\"\"This class is used to execute tasks in parallel, and is somewhat\n        less efficient than Serial, but is appropriate for parallel builds.\n\n        This class is thread safe.\n        \"\"\"\n\n        def __init__(self, taskmaster, num, stack_size):\n            \"\"\"Create a new parallel job given a taskmaster.\n\n            The taskmaster's next_task() method should return the next\n            task that needs to be executed, or None if there are no more\n            tasks. The taskmaster's executed() method will be called\n            for each task when it is successfully executed or failed()\n            will be called if the task failed to execute (i.e. execute()\n            raised an exception).\n\n            Note: calls to taskmaster are serialized, but calls to\n            execute() on distinct tasks are not serialized, because\n            that is the whole point of parallel jobs: they can execute\n            multiple tasks simultaneously. \"\"\"\n\n            self.taskmaster = taskmaster\n            self.interrupted = InterruptState()\n            self.tp = ThreadPool(num, stack_size, self.interrupted)\n\n            self.maxjobs = num\n\n        def start(self):\n            \"\"\"Start the job. This will begin pulling tasks from the\n            taskmaster and executing them, and return when there are no\n            more tasks. If a task fails to execute (i.e. execute() raises\n            an exception), then the job will stop.\"\"\"\n\n            jobs = 0\n\n            while True:\n                # Start up as many available tasks as we're\n                # allowed to.\n                while jobs < self.maxjobs:\n                    task = self.taskmaster.next_task()\n                    if task is None:\n                        break\n\n                    try:\n                        # prepare task for execution\n                        task.prepare()\n                    except:\n                        task.exception_set()\n                        task.failed()\n                        task.postprocess()\n                    else:\n                        if task.needs_execute():\n                            # dispatch task\n                            self.tp.put(task)\n                            jobs = jobs + 1\n                        else:\n                            task.executed()\n                            task.postprocess()\n\n                if not task and not jobs: break\n\n                # Let any/all completed tasks finish up before we go\n                # back and put the next batch of tasks on the queue.\n                while True:\n                    task, ok = self.tp.get()\n                    jobs = jobs - 1\n\n                    if ok:\n                        task.executed()\n                    else:\n                        if self.interrupted():\n                            try:\n                                raise SCons.Errors.BuildError(\n                                    task.targets[0], errstr=interrupt_msg)\n                            except:\n                                task.exception_set()\n\n                        # Let the failed() callback function arrange\n                        # for the build to stop if that's appropriate.\n                        task.failed()\n\n                    task.postprocess()\n\n                    if self.tp.resultsQueue.empty():\n                        break\n\n            self.tp.cleanup()\n            self.taskmaster.cleanup()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Memoize.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Memoize.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Memoizer\n\nA metaclass implementation to count hits and misses of the computed\nvalues that various methods cache in memory.\n\nUse of this modules assumes that wrapped methods be coded to cache their\nvalues in a consistent way.  Here is an example of wrapping a method\nthat returns a computed value, with no input parameters:\n\n    memoizer_counters = []                                      # Memoization\n\n    memoizer_counters.append(SCons.Memoize.CountValue('foo'))   # Memoization\n\n    def foo(self):\n\n        try:                                                    # Memoization\n            return self._memo['foo']                            # Memoization\n        except KeyError:                                        # Memoization\n            pass                                                # Memoization\n\n        result = self.compute_foo_value()\n\n        self._memo['foo'] = result                              # Memoization\n\n        return result\n\nHere is an example of wrapping a method that will return different values\nbased on one or more input arguments:\n\n    def _bar_key(self, argument):                               # Memoization\n        return argument                                         # Memoization\n\n    memoizer_counters.append(SCons.Memoize.CountDict('bar', _bar_key)) # Memoization\n\n    def bar(self, argument):\n\n        memo_key = argument                                     # Memoization\n        try:                                                    # Memoization\n            memo_dict = self._memo['bar']                       # Memoization\n        except KeyError:                                        # Memoization\n            memo_dict = {}                                      # Memoization\n            self._memo['dict'] = memo_dict                      # Memoization\n        else:                                                   # Memoization\n            try:                                                # Memoization\n                return memo_dict[memo_key]                      # Memoization\n            except KeyError:                                    # Memoization\n                pass                                            # Memoization\n\n        result = self.compute_bar_value(argument)\n\n        memo_dict[memo_key] = result                            # Memoization\n\n        return result\n\nAt one point we avoided replicating this sort of logic in all the methods\nby putting it right into this module, but we've moved away from that at\npresent (see the \"Historical Note,\" below.).\n\nDeciding what to cache is tricky, because different configurations\ncan have radically different performance tradeoffs, and because the\ntradeoffs involved are often so non-obvious.  Consequently, deciding\nwhether or not to cache a given method will likely be more of an art than\na science, but should still be based on available data from this module.\nHere are some VERY GENERAL guidelines about deciding whether or not to\ncache return values from a method that's being called a lot:\n\n    --  The first question to ask is, \"Can we change the calling code\n        so this method isn't called so often?\"  Sometimes this can be\n        done by changing the algorithm.  Sometimes the *caller* should\n        be memoized, not the method you're looking at.\n\n    --  The memoized function should be timed with multiple configurations\n        to make sure it doesn't inadvertently slow down some other\n        configuration.\n\n    --  When memoizing values based on a dictionary key composed of\n        input arguments, you don't need to use all of the arguments\n        if some of them don't affect the return values.\n\nHistorical Note:  The initial Memoizer implementation actually handled\nthe caching of values for the wrapped methods, based on a set of generic\nalgorithms for computing hashable values based on the method's arguments.\nThis collected caching logic nicely, but had two drawbacks:\n\n    Running arguments through a generic key-conversion mechanism is slower\n    (and less flexible) than just coding these things directly.  Since the\n    methods that need memoized values are generally performance-critical,\n    slowing them down in order to collect the logic isn't the right\n    tradeoff.\n\n    Use of the memoizer really obscured what was being called, because\n    all the memoized methods were wrapped with re-used generic methods.\n    This made it more difficult, for example, to use the Python profiler\n    to figure out how to optimize the underlying methods.\n\"\"\"\n\nimport types\n\n# A flag controlling whether or not we actually use memoization.\nuse_memoizer = None\n\nCounterList = []\n\nclass Counter(object):\n    \"\"\"\n    Base class for counting memoization hits and misses.\n\n    We expect that the metaclass initialization will have filled in\n    the .name attribute that represents the name of the function\n    being counted.\n    \"\"\"\n    def __init__(self, method_name):\n        \"\"\"\n        \"\"\"\n        self.method_name = method_name\n        self.hit = 0\n        self.miss = 0\n        CounterList.append(self)\n    def display(self):\n        fmt = \"    %7d hits %7d misses    %s()\"\n        print fmt % (self.hit, self.miss, self.name)\n    def __cmp__(self, other):\n        try:\n            return cmp(self.name, other.name)\n        except AttributeError:\n            return 0\n\nclass CountValue(Counter):\n    \"\"\"\n    A counter class for simple, atomic memoized values.\n\n    A CountValue object should be instantiated in a class for each of\n    the class's methods that memoizes its return value by simply storing\n    the return value in its _memo dictionary.\n\n    We expect that the metaclass initialization will fill in the\n    .underlying_method attribute with the method that we're wrapping.\n    We then call the underlying_method method after counting whether\n    its memoized value has already been set (a hit) or not (a miss).\n    \"\"\"\n    def __call__(self, *args, **kw):\n        obj = args[0]\n        if self.method_name in obj._memo:\n            self.hit = self.hit + 1\n        else:\n            self.miss = self.miss + 1\n        return self.underlying_method(*args, **kw)\n\nclass CountDict(Counter):\n    \"\"\"\n    A counter class for memoized values stored in a dictionary, with\n    keys based on the method's input arguments.\n\n    A CountDict object is instantiated in a class for each of the\n    class's methods that memoizes its return value in a dictionary,\n    indexed by some key that can be computed from one or more of\n    its input arguments.\n\n    We expect that the metaclass initialization will fill in the\n    .underlying_method attribute with the method that we're wrapping.\n    We then call the underlying_method method after counting whether the\n    computed key value is already present in the memoization dictionary\n    (a hit) or not (a miss).\n    \"\"\"\n    def __init__(self, method_name, keymaker):\n        \"\"\"\n        \"\"\"\n        Counter.__init__(self, method_name)\n        self.keymaker = keymaker\n    def __call__(self, *args, **kw):\n        obj = args[0]\n        try:\n            memo_dict = obj._memo[self.method_name]\n        except KeyError:\n            self.miss = self.miss + 1\n        else:\n            key = self.keymaker(*args, **kw)\n            if key in memo_dict:\n                self.hit = self.hit + 1\n            else:\n                self.miss = self.miss + 1\n        return self.underlying_method(*args, **kw)\n\nclass Memoizer(object):\n    \"\"\"Object which performs caching of method calls for its 'primary'\n    instance.\"\"\"\n\n    def __init__(self):\n        pass\n\ndef Dump(title=None):\n    if title:\n        print title\n    CounterList.sort()\n    for counter in CounterList:\n        counter.display()\n\nclass Memoized_Metaclass(type):\n    def __init__(cls, name, bases, cls_dict):\n        super(Memoized_Metaclass, cls).__init__(name, bases, cls_dict)\n\n        for counter in cls_dict.get('memoizer_counters', []):\n            method_name = counter.method_name\n\n            counter.name = cls.__name__ + '.' + method_name\n            counter.underlying_method = cls_dict[method_name]\n\n            replacement_method = types.MethodType(counter, None, cls)\n            setattr(cls, method_name, replacement_method)\n\ndef EnableMemoization():\n    global use_memoizer\n    use_memoizer = 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/Alias.py",
    "content": "\n\"\"\"scons.Node.Alias\n\nAlias nodes.\n\nThis creates a hash of global Aliases (dummy targets).\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Node/Alias.py  2014/07/05 09:42:21 garyo\"\n\nimport collections\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Util\n\nclass AliasNameSpace(collections.UserDict):\n    def Alias(self, name, **kw):\n        if isinstance(name, SCons.Node.Alias.Alias):\n            return name\n        try:\n            a = self[name]\n        except KeyError:\n            a = SCons.Node.Alias.Alias(name, **kw)\n            self[name] = a\n        return a\n\n    def lookup(self, name, **kw):\n        try:\n            return self[name]\n        except KeyError:\n            return None\n\nclass AliasNodeInfo(SCons.Node.NodeInfoBase):\n    current_version_id = 1\n    field_list = ['csig']\n    def str_to_node(self, s):\n        return default_ans.Alias(s)\n\nclass AliasBuildInfo(SCons.Node.BuildInfoBase):\n    current_version_id = 1\n\nclass Alias(SCons.Node.Node):\n\n    NodeInfo = AliasNodeInfo\n    BuildInfo = AliasBuildInfo\n\n    def __init__(self, name):\n        SCons.Node.Node.__init__(self)\n        self.name = name\n\n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def __str__(self):\n        return self.name\n\n    def make_ready(self):\n        self.get_csig()\n\n    really_build = SCons.Node.Node.build\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Alias nodes get built regardless of\n        # what directory scons was run from. Alias nodes\n        # are outside the filesystem:\n        return 1\n\n    def get_contents(self):\n        \"\"\"The contents of an alias is the concatenation\n        of the content signatures of all its sources.\"\"\"\n        childsigs = [n.get_csig() for n in self.children()]\n        return ''.join(childsigs)\n\n    def sconsign(self):\n        \"\"\"An Alias is not recorded in .sconsign files\"\"\"\n        pass\n\n    #\n    #\n    #\n\n    def changed_since_last_build(self, target, prev_ni):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def build(self):\n        \"\"\"A \"builder\" for aliases.\"\"\"\n        pass\n\n    def convert(self):\n        try: del self.builder\n        except AttributeError: pass\n        self.reset_executor()\n        self.build = self.really_build\n\n    def get_csig(self):\n        \"\"\"\n        Generate a node's content signature, the digested signature\n        of its content.\n\n        node - the node\n        cache - alternate node to use for the signature cache\n        returns - the content signature\n        \"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n\n        contents = self.get_contents()\n        csig = SCons.Util.MD5signature(contents)\n        self.get_ninfo().csig = csig\n        return csig\n\ndefault_ans = AliasNameSpace()\n\nSCons.Node.arg2nodes_lookups.append(default_ans.lookup)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/FS.py",
    "content": "\"\"\"scons.Node.FS\n\nFile system nodes.\n\nThese Nodes represent the canonical external objects that people think\nof when they think of building software: files and directories.\n\nThis holds a \"default_fs\" variable that should be initialized with an FS\nthat can be used by scripts or modules looking for the canonical default.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Node/FS.py  2014/07/05 09:42:21 garyo\"\n\nimport fnmatch\nimport os\nimport re\nimport shutil\nimport stat\nimport sys\nimport time\nimport codecs\n\nimport SCons.Action\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Subst\nimport SCons.Util\nimport SCons.Warnings\n\nfrom SCons.Debug import Trace\n\ndo_store_info = True\nprint_duplicate = 0\n\n\nclass EntryProxyAttributeError(AttributeError):\n    \"\"\"\n    An AttributeError subclass for recording and displaying the name\n    of the underlying Entry involved in an AttributeError exception.\n    \"\"\"\n    def __init__(self, entry_proxy, attribute):\n        AttributeError.__init__(self)\n        self.entry_proxy = entry_proxy\n        self.attribute = attribute\n    def __str__(self):\n        entry = self.entry_proxy.get()\n        fmt = \"%s instance %s has no attribute %s\"\n        return fmt % (entry.__class__.__name__,\n                      repr(entry.name),\n                      repr(self.attribute))\n\n# The max_drift value:  by default, use a cached signature value for\n# any file that's been untouched for more than two days.\ndefault_max_drift = 2*24*60*60\n\n#\n# We stringify these file system Nodes a lot.  Turning a file system Node\n# into a string is non-trivial, because the final string representation\n# can depend on a lot of factors:  whether it's a derived target or not,\n# whether it's linked to a repository or source directory, and whether\n# there's duplication going on.  The normal technique for optimizing\n# calculations like this is to memoize (cache) the string value, so you\n# only have to do the calculation once.\n#\n# A number of the above factors, however, can be set after we've already\n# been asked to return a string for a Node, because a Repository() or\n# VariantDir() call or the like may not occur until later in SConscript\n# files.  So this variable controls whether we bother trying to save\n# string values for Nodes.  The wrapper interface can set this whenever\n# they're done mucking with Repository and VariantDir and the other stuff,\n# to let this module know it can start returning saved string values\n# for Nodes.\n#\nSave_Strings = None\n\ndef save_strings(val):\n    global Save_Strings\n    Save_Strings = val\n\n#\n# Avoid unnecessary function calls by recording a Boolean value that\n# tells us whether or not os.path.splitdrive() actually does anything\n# on this system, and therefore whether we need to bother calling it\n# when looking up path names in various methods below.\n#\n\ndo_splitdrive = None\n_my_splitdrive =None\n\ndef initialize_do_splitdrive():\n    global do_splitdrive\n    global has_unc\n    drive, path = os.path.splitdrive('X:/foo')\n    has_unc = hasattr(os.path, 'splitunc')\n\n    do_splitdrive = not not drive or has_unc\n\n    global _my_splitdrive\n    if has_unc:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            if p[0:2] == '//':\n                # Note that we leave a leading slash in the path\n                # because UNC paths are always absolute.\n                return '//', p[1:]\n            return '', p\n    else:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            return '', p\n    _my_splitdrive = splitdrive\n\n    # Keep some commonly used values in global variables to skip to\n    # module look-up costs.\n    global OS_SEP\n    global UNC_PREFIX\n    global os_sep_is_slash\n\n    OS_SEP = os.sep\n    UNC_PREFIX = OS_SEP + OS_SEP\n    os_sep_is_slash = OS_SEP == '/'\n\ninitialize_do_splitdrive()\n\n# Used to avoid invoking os.path.normpath if not necessary.\nneeds_normpath_check = re.compile(\n    r'''\n      # We need to renormalize the path if it contains any consecutive\n      # '/' characters.\n      .*// |\n\n      # We need to renormalize the path if it contains a '..' directory.\n      # Note that we check for all the following cases:\n      #\n      #    a) The path is a single '..'\n      #    b) The path starts with '..'. E.g. '../' or '../moredirs'\n      #       but we not match '..abc/'.\n      #    c) The path ends with '..'. E.g. '/..' or 'dirs/..'\n      #    d) The path contains a '..' in the middle.\n      #       E.g. dirs/../moredirs\n\n      (.*/)?\\.\\.(?:/|$) |\n\n      # We need to renormalize the path if it contains a '.'\n      # directory, but NOT if it is a single '.'  '/' characters. We\n      # do not want to match a single '.' because this case is checked\n      # for explicitely since this is common enough case.\n      #\n      # Note that we check for all the following cases:\n      #\n      #    a) We don't match a single '.'\n      #    b) We match if the path starts with '.'. E.g. './' or\n      #       './moredirs' but we not match '.abc/'.\n      #    c) We match if the path ends with '.'. E.g. '/.' or\n      #    'dirs/.'\n      #    d) We match if the path contains a '.' in the middle.\n      #       E.g. dirs/./moredirs\n\n      \\./|.*/\\.(?:/|$)\n\n    ''',\n    re.VERBOSE\n    )\nneeds_normpath_match = needs_normpath_check.match\n\n#\n# SCons.Action objects for interacting with the outside world.\n#\n# The Node.FS methods in this module should use these actions to\n# create and/or remove files and directories; they should *not* use\n# os.{link,symlink,unlink,mkdir}(), etc., directly.\n#\n# Using these SCons.Action objects ensures that descriptions of these\n# external activities are properly displayed, that the displays are\n# suppressed when the -s (silent) option is used, and (most importantly)\n# the actions are disabled when the the -n option is used, in which case\n# there should be *no* changes to the external file system(s)...\n#\n\nif hasattr(os, 'link'):\n    def _hardlink_func(fs, src, dst):\n        # If the source is a symlink, we can't just hard-link to it\n        # because a relative symlink may point somewhere completely\n        # different.  We must disambiguate the symlink and then\n        # hard-link the final destination file.\n        while fs.islink(src):\n            link = fs.readlink(src)\n            if not os.path.isabs(link):\n                src = link\n            else:\n                src = os.path.join(os.path.dirname(src), link)\n        fs.link(src, dst)\nelse:\n    _hardlink_func = None\n\nif hasattr(os, 'symlink'):\n    def _softlink_func(fs, src, dst):\n        fs.symlink(src, dst)\nelse:\n    _softlink_func = None\n\ndef _copy_func(fs, src, dest):\n    shutil.copy2(src, dest)\n    st = fs.stat(src)\n    fs.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n\nValid_Duplicates = ['hard-soft-copy', 'soft-hard-copy',\n                    'hard-copy', 'soft-copy', 'copy']\n\nLink_Funcs = [] # contains the callables of the specified duplication style\n\ndef set_duplicate(duplicate):\n    # Fill in the Link_Funcs list according to the argument\n    # (discarding those not available on the platform).\n\n    # Set up the dictionary that maps the argument names to the\n    # underlying implementations.  We do this inside this function,\n    # not in the top-level module code, so that we can remap os.link\n    # and os.symlink for testing purposes.\n    link_dict = {\n        'hard' : _hardlink_func,\n        'soft' : _softlink_func,\n        'copy' : _copy_func\n    }\n\n    if not duplicate in Valid_Duplicates:\n        raise SCons.Errors.InternalError(\"The argument of set_duplicate \"\n                                           \"should be in Valid_Duplicates\")\n    global Link_Funcs\n    Link_Funcs = []\n    for func in duplicate.split('-'):\n        if link_dict[func]:\n            Link_Funcs.append(link_dict[func])\n\ndef LinkFunc(target, source, env):\n    # Relative paths cause problems with symbolic links, so\n    # we use absolute paths, which may be a problem for people\n    # who want to move their soft-linked src-trees around. Those\n    # people should use the 'hard-copy' mode, softlinks cannot be\n    # used for that; at least I have no idea how ...\n    src = source[0].abspath\n    dest = target[0].abspath\n    dir, file = os.path.split(dest)\n    if dir and not target[0].fs.isdir(dir):\n        os.makedirs(dir)\n    if not Link_Funcs:\n        # Set a default order of link functions.\n        set_duplicate('hard-soft-copy')\n    fs = source[0].fs\n    # Now link the files with the previously specified order.\n    for func in Link_Funcs:\n        try:\n            func(fs, src, dest)\n            break\n        except (IOError, OSError):\n            # An OSError indicates something happened like a permissions\n            # problem or an attempt to symlink across file-system\n            # boundaries.  An IOError indicates something like the file\n            # not existing.  In either case, keeping trying additional\n            # functions in the list and only raise an error if the last\n            # one failed.\n            if func == Link_Funcs[-1]:\n                # exception of the last link method (copy) are fatal\n                raise\n    return 0\n\nLink = SCons.Action.Action(LinkFunc, None)\ndef LocalString(target, source, env):\n    return 'Local copy of %s from %s' % (target[0], source[0])\n\nLocalCopy = SCons.Action.Action(LinkFunc, LocalString)\n\ndef UnlinkFunc(target, source, env):\n    t = target[0]\n    t.fs.unlink(t.abspath)\n    return 0\n\nUnlink = SCons.Action.Action(UnlinkFunc, None)\n\ndef MkdirFunc(target, source, env):\n    t = target[0]\n    if not t.exists():\n        t.fs.mkdir(t.abspath)\n    return 0\n\nMkdir = SCons.Action.Action(MkdirFunc, None, presub=None)\n\nMkdirBuilder = None\n\ndef get_MkdirBuilder():\n    global MkdirBuilder\n    if MkdirBuilder is None:\n        import SCons.Builder\n        import SCons.Defaults\n        # \"env\" will get filled in by Executor.get_build_env()\n        # calling SCons.Defaults.DefaultEnvironment() when necessary.\n        MkdirBuilder = SCons.Builder.Builder(action = Mkdir,\n                                             env = None,\n                                             explain = None,\n                                             is_explicit = None,\n                                             target_scanner = SCons.Defaults.DirEntryScanner,\n                                             name = \"MkdirBuilder\")\n    return MkdirBuilder\n\nclass _Null(object):\n    pass\n\n_null = _Null()\n\nDefaultSCCSBuilder = None\nDefaultRCSBuilder = None\n\ndef get_DefaultSCCSBuilder():\n    global DefaultSCCSBuilder\n    if DefaultSCCSBuilder is None:\n        import SCons.Builder\n        # \"env\" will get filled in by Executor.get_build_env()\n        # calling SCons.Defaults.DefaultEnvironment() when necessary.\n        act = SCons.Action.Action('$SCCSCOM', '$SCCSCOMSTR')\n        DefaultSCCSBuilder = SCons.Builder.Builder(action = act,\n                                                   env = None,\n                                                   name = \"DefaultSCCSBuilder\")\n    return DefaultSCCSBuilder\n\ndef get_DefaultRCSBuilder():\n    global DefaultRCSBuilder\n    if DefaultRCSBuilder is None:\n        import SCons.Builder\n        # \"env\" will get filled in by Executor.get_build_env()\n        # calling SCons.Defaults.DefaultEnvironment() when necessary.\n        act = SCons.Action.Action('$RCS_COCOM', '$RCS_COCOMSTR')\n        DefaultRCSBuilder = SCons.Builder.Builder(action = act,\n                                                  env = None,\n                                                  name = \"DefaultRCSBuilder\")\n    return DefaultRCSBuilder\n\n# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.\n_is_cygwin = sys.platform == \"cygwin\"\nif os.path.normcase(\"TeSt\") == os.path.normpath(\"TeSt\") and not _is_cygwin:\n    def _my_normcase(x):\n        return x\nelse:\n    def _my_normcase(x):\n        return x.upper()\n\n\n\nclass DiskChecker(object):\n    def __init__(self, type, do, ignore):\n        self.type = type\n        self.do = do\n        self.ignore = ignore\n        self.func = do\n    def __call__(self, *args, **kw):\n        return self.func(*args, **kw)\n    def set(self, list):\n        if self.type in list:\n            self.func = self.do\n        else:\n            self.func = self.ignore\n\ndef do_diskcheck_match(node, predicate, errorfmt):\n    result = predicate()\n    try:\n        # If calling the predicate() cached a None value from stat(),\n        # remove it so it doesn't interfere with later attempts to\n        # build this Node as we walk the DAG.  (This isn't a great way\n        # to do this, we're reaching into an interface that doesn't\n        # really belong to us, but it's all about performance, so\n        # for now we'll just document the dependency...)\n        if node._memo['stat'] is None:\n            del node._memo['stat']\n    except (AttributeError, KeyError):\n        pass\n    if result:\n        raise TypeError(errorfmt % node.abspath)\n\ndef ignore_diskcheck_match(node, predicate, errorfmt):\n    pass\n\ndef do_diskcheck_rcs(node, name):\n    try:\n        rcs_dir = node.rcs_dir\n    except AttributeError:\n        if node.entry_exists_on_disk('RCS'):\n            rcs_dir = node.Dir('RCS')\n        else:\n            rcs_dir = None\n        node.rcs_dir = rcs_dir\n    if rcs_dir:\n        return rcs_dir.entry_exists_on_disk(name+',v')\n    return None\n\ndef ignore_diskcheck_rcs(node, name):\n    return None\n\ndef do_diskcheck_sccs(node, name):\n    try:\n        sccs_dir = node.sccs_dir\n    except AttributeError:\n        if node.entry_exists_on_disk('SCCS'):\n            sccs_dir = node.Dir('SCCS')\n        else:\n            sccs_dir = None\n        node.sccs_dir = sccs_dir\n    if sccs_dir:\n        return sccs_dir.entry_exists_on_disk('s.'+name)\n    return None\n\ndef ignore_diskcheck_sccs(node, name):\n    return None\n\ndiskcheck_match = DiskChecker('match', do_diskcheck_match, ignore_diskcheck_match)\ndiskcheck_rcs = DiskChecker('rcs', do_diskcheck_rcs, ignore_diskcheck_rcs)\ndiskcheck_sccs = DiskChecker('sccs', do_diskcheck_sccs, ignore_diskcheck_sccs)\n\ndiskcheckers = [\n    diskcheck_match,\n    diskcheck_rcs,\n    diskcheck_sccs,\n]\n\ndef set_diskcheck(list):\n    for dc in diskcheckers:\n        dc.set(list)\n\ndef diskcheck_types():\n    return [dc.type for dc in diskcheckers]\n\n\n\nclass EntryProxy(SCons.Util.Proxy):\n\n    __str__ = SCons.Util.Delegate('__str__')\n\n    def __get_abspath(self):\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(),\n                                             entry.name + \"_abspath\")\n\n    def __get_filebase(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[0],\n                                             name + \"_filebase\")\n\n    def __get_suffix(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[1],\n                                             name + \"_suffix\")\n\n    def __get_file(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(name, name + \"_file\")\n\n    def __get_base_path(self):\n        \"\"\"Return the file's directory and file name, with the\n        suffix stripped.\"\"\"\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],\n                                             entry.name + \"_base\")\n\n    def __get_posix_path(self):\n        \"\"\"Return the path with / as the path separator,\n        regardless of platform.\"\"\"\n        if os_sep_is_slash:\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '/')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_posix\")\n\n    def __get_windows_path(self):\n        \"\"\"Return the path with \\ as the path separator,\n        regardless of platform.\"\"\"\n        if OS_SEP == '\\\\':\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '\\\\')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_windows\")\n\n    def __get_srcnode(self):\n        return EntryProxy(self.get().srcnode())\n\n    def __get_srcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().dir)\n\n    def __get_rsrcnode(self):\n        return EntryProxy(self.get().srcnode().rfile())\n\n    def __get_rsrcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().rfile().dir)\n\n    def __get_dir(self):\n        return EntryProxy(self.get().dir)\n\n    dictSpecialAttrs = { \"base\"     : __get_base_path,\n                         \"posix\"    : __get_posix_path,\n                         \"windows\"  : __get_windows_path,\n                         \"win32\"    : __get_windows_path,\n                         \"srcpath\"  : __get_srcnode,\n                         \"srcdir\"   : __get_srcdir,\n                         \"dir\"      : __get_dir,\n                         \"abspath\"  : __get_abspath,\n                         \"filebase\" : __get_filebase,\n                         \"suffix\"   : __get_suffix,\n                         \"file\"     : __get_file,\n                         \"rsrcpath\" : __get_rsrcnode,\n                         \"rsrcdir\"  : __get_rsrcdir,\n                       }\n\n    def __getattr__(self, name):\n        # This is how we implement the \"special\" attributes\n        # such as base, posix, srcdir, etc.\n        try:\n            attr_function = self.dictSpecialAttrs[name]\n        except KeyError:\n            try:\n                attr = SCons.Util.Proxy.__getattr__(self, name)\n            except AttributeError, e:\n                # Raise our own AttributeError subclass with an\n                # overridden __str__() method that identifies the\n                # name of the entry that caused the exception.\n                raise EntryProxyAttributeError(self, name)\n            return attr\n        else:\n            return attr_function(self)\n\nclass Base(SCons.Node.Node):\n    \"\"\"A generic class for file system entries.  This class is for\n    when we don't know yet whether the entry being looked up is a file\n    or a directory.  Instances of this class can morph into either\n    Dir or File objects by a later, more precise lookup.\n\n    Note: this class does not define __cmp__ and __hash__ for\n    efficiency reasons.  SCons does a lot of comparing of\n    Node.FS.{Base,Entry,File,Dir} objects, so those operations must be\n    as fast as possible, which means we want to use Python's built-in\n    object identity comparisons.\n    \"\"\"\n\n    memoizer_counters = []\n\n    def __init__(self, name, directory, fs):\n        \"\"\"Initialize a generic Node.FS.Base object.\n\n        Call the superclass initialization, take care of setting up\n        our relative and absolute paths, identify our parent\n        directory, and indicate that this node should use\n        signatures.\"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')\n        SCons.Node.Node.__init__(self)\n\n        # Filenames and paths are probably reused and are intern'ed to\n        # save some memory.\n\n        #: Filename with extension as it was specified when the object was\n        #: created; to obtain filesystem path, use Python str() function\n        self.name = SCons.Util.silent_intern(name)\n        #: Cached filename extension\n        self.suffix = SCons.Util.silent_intern(SCons.Util.splitext(name)[1])\n        self.fs = fs #: Reference to parent Node.FS object\n\n        assert directory, \"A directory must be provided\"\n\n        self.abspath = SCons.Util.silent_intern(directory.entry_abspath(name))\n        self.labspath = SCons.Util.silent_intern(directory.entry_labspath(name))\n        if directory.path == '.':\n            self.path = SCons.Util.silent_intern(name)\n        else:\n            self.path = SCons.Util.silent_intern(directory.entry_path(name))\n        if directory.tpath == '.':\n            self.tpath = SCons.Util.silent_intern(name)\n        else:\n            self.tpath = SCons.Util.silent_intern(directory.entry_tpath(name))\n        self.path_elements = directory.path_elements + [self]\n\n        self.dir = directory\n        self.cwd = None # will hold the SConscript directory for target nodes\n        self.duplicate = directory.duplicate\n\n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def must_be_same(self, klass):\n        \"\"\"\n        This node, which already existed, is being looked up as the\n        specified klass.  Raise an exception if it isn't.\n        \"\"\"\n        if isinstance(self, klass) or klass is Entry:\n            return\n        raise TypeError(\"Tried to lookup %s '%s' as a %s.\" %\\\n              (self.__class__.__name__, self.path, klass.__name__))\n\n    def get_dir(self):\n        return self.dir\n\n    def get_suffix(self):\n        return self.suffix\n\n    def rfile(self):\n        return self\n\n    def __str__(self):\n        \"\"\"A Node.FS.Base object's string representation is its path\n        name.\"\"\"\n        global Save_Strings\n        if Save_Strings:\n            return self._save_str()\n        return self._get_str()\n\n    memoizer_counters.append(SCons.Memoize.CountValue('_save_str'))\n\n    def _save_str(self):\n        try:\n            return self._memo['_save_str']\n        except KeyError:\n            pass\n        result = sys.intern(self._get_str())\n        self._memo['_save_str'] = result\n        return result\n\n    def _get_str(self):\n        global Save_Strings\n        if self.duplicate or self.is_derived():\n            return self.get_path()\n        srcnode = self.srcnode()\n        if srcnode.stat() is None and self.stat() is not None:\n            result = self.get_path()\n        else:\n            result = srcnode.get_path()\n        if not Save_Strings:\n            # We're not at the point where we're saving the string\n            # representations of FS Nodes (because we haven't finished\n            # reading the SConscript files and need to have str() return\n            # things relative to them).  That also means we can't yet\n            # cache values returned (or not returned) by stat(), since\n            # Python code in the SConscript files might still create\n            # or otherwise affect the on-disk file.  So get rid of the\n            # values that the underlying stat() method saved.\n            try: del self._memo['stat']\n            except KeyError: pass\n            if self is not srcnode:\n                try: del srcnode._memo['stat']\n                except KeyError: pass\n        return result\n\n    rstr = __str__\n\n    memoizer_counters.append(SCons.Memoize.CountValue('stat'))\n\n    def stat(self):\n        try: return self._memo['stat']\n        except KeyError: pass\n        try: result = self.fs.stat(self.abspath)\n        except os.error: result = None\n        self._memo['stat'] = result\n        return result\n\n    def exists(self):\n        return self.stat() is not None\n\n    def rexists(self):\n        return self.rfile().exists()\n\n    def getmtime(self):\n        st = self.stat()\n        if st: return st[stat.ST_MTIME]\n        else: return None\n\n    def getsize(self):\n        st = self.stat()\n        if st: return st[stat.ST_SIZE]\n        else: return None\n\n    def isdir(self):\n        st = self.stat()\n        return st is not None and stat.S_ISDIR(st[stat.ST_MODE])\n\n    def isfile(self):\n        st = self.stat()\n        return st is not None and stat.S_ISREG(st[stat.ST_MODE])\n\n    if hasattr(os, 'symlink'):\n        def islink(self):\n            try: st = self.fs.lstat(self.abspath)\n            except os.error: return 0\n            return stat.S_ISLNK(st[stat.ST_MODE])\n    else:\n        def islink(self):\n            return 0                    # no symlinks\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return self.dir.is_under(dir)\n\n    def set_local(self):\n        self._local = 1\n\n    def srcnode(self):\n        \"\"\"If this node is in a build path, return the node\n        corresponding to its source file.  Otherwise, return\n        ourself.\n        \"\"\"\n        srcdir_list = self.dir.srcdir_list()\n        if srcdir_list:\n            srcnode = srcdir_list[0].Entry(self.name)\n            srcnode.must_be_same(self.__class__)\n            return srcnode\n        return self\n\n    def get_path(self, dir=None):\n        \"\"\"Return path relative to the current working directory of the\n        Node.FS.Base object that owns us.\"\"\"\n        if not dir:\n            dir = self.fs.getcwd()\n        if self == dir:\n            return '.'\n        path_elems = self.path_elements\n        pathname = ''\n        try: i = path_elems.index(dir)\n        except ValueError:\n            for p in path_elems[:-1]:\n                pathname += p.dirname\n        else:\n            for p in path_elems[i+1:-1]:\n                pathname += p.dirname\n        return pathname + path_elems[-1].name\n\n    def set_src_builder(self, builder):\n        \"\"\"Set the source code builder for this node.\"\"\"\n        self.sbuilder = builder\n        if not self.has_builder():\n            self.builder_set(builder)\n\n    def src_builder(self):\n        \"\"\"Fetch the source code builder for this node.\n\n        If there isn't one, we cache the source code builder specified\n        for the directory (which in turn will cache the value from its\n        parent directory, and so on up to the file system root).\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.dir.src_builder()\n            self.sbuilder = scb\n        return scb\n\n    def get_abspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self.abspath\n\n    def for_signature(self):\n        # Return just our name.  Even an absolute path would not work,\n        # because that can change thanks to symlinks or remapped network\n        # paths.\n        return self.name\n\n    def get_subst_proxy(self):\n        try:\n            return self._proxy\n        except AttributeError:\n            ret = EntryProxy(self)\n            self._proxy = ret\n            return ret\n\n    def target_from_source(self, prefix, suffix, splitext=SCons.Util.splitext):\n        \"\"\"\n\n        Generates a target entry that corresponds to this entry (usually\n        a source file) with the specified prefix and suffix.\n\n        Note that this method can be overridden dynamically for generated\n        files that need different behavior.  See Tool/swig.py for\n        an example.\n        \"\"\"\n        return self.dir.Entry(prefix + splitext(self.name)[0] + suffix)\n\n    def _Rfindalldirs_key(self, pathlist):\n        return pathlist\n\n    memoizer_counters.append(SCons.Memoize.CountDict('Rfindalldirs', _Rfindalldirs_key))\n\n    def Rfindalldirs(self, pathlist):\n        \"\"\"\n        Return all of the directories for a given path list, including\n        corresponding \"backing\" directories in any repositories.\n\n        The Node lookups are relative to this Node (typically a\n        directory), so memoizing result saves cycles from looking\n        up the same path for each target in a given directory.\n        \"\"\"\n        try:\n            memo_dict = self._memo['Rfindalldirs']\n        except KeyError:\n            memo_dict = {}\n            self._memo['Rfindalldirs'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        create_dir_relative_to_self = self.Dir\n        result = []\n        for path in pathlist:\n            if isinstance(path, SCons.Node.Node):\n                result.append(path)\n            else:\n                dir = create_dir_relative_to_self(path)\n                result.extend(dir.get_all_rdirs())\n\n        memo_dict[pathlist] = result\n\n        return result\n\n    def RDirs(self, pathlist):\n        \"\"\"Search for a list of directories in the Repository list.\"\"\"\n        cwd = self.cwd or self.fs._cwd\n        return cwd.Rfindalldirs(pathlist)\n\n    memoizer_counters.append(SCons.Memoize.CountValue('rentry'))\n\n    def rentry(self):\n        try:\n            return self._memo['rentry']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try:\n                    node = dir.entries[norm_name]\n                except KeyError:\n                    if dir.entry_exists_on_disk(self.name):\n                        result = dir.Entry(self.name)\n                        break\n        self._memo['rentry'] = result\n        return result\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return []\n\nclass Entry(Base):\n    \"\"\"This is the class for generic Node.FS entries--that is, things\n    that could be a File or a Dir, but we're just not sure yet.\n    Consequently, the methods in this class really exist just to\n    transform their associated object into the right class when the\n    time comes, and then call the same-named method in the transformed\n    class.\"\"\"\n\n    def diskcheck_match(self):\n        pass\n\n    def disambiguate(self, must_exist=None):\n        \"\"\"\n        \"\"\"\n        if self.isdir():\n            self.__class__ = Dir\n            self._morph()\n        elif self.isfile():\n            self.__class__ = File\n            self._morph()\n            self.clear()\n        else:\n            # There was nothing on-disk at this location, so look in\n            # the src directory.\n            #\n            # We can't just use self.srcnode() straight away because\n            # that would create an actual Node for this file in the src\n            # directory, and there might not be one.  Instead, use the\n            # dir_on_disk() method to see if there's something on-disk\n            # with that name, in which case we can go ahead and call\n            # self.srcnode() to create the right type of entry.\n            srcdir = self.dir.srcnode()\n            if srcdir != self.dir and \\\n               srcdir.entry_exists_on_disk(self.name) and \\\n               self.srcnode().isdir():\n                self.__class__ = Dir\n                self._morph()\n            elif must_exist:\n                msg = \"No such file or directory: '%s'\" % self.abspath\n                raise SCons.Errors.UserError(msg)\n            else:\n                self.__class__ = File\n                self._morph()\n                self.clear()\n        return self\n\n    def rfile(self):\n        \"\"\"We're a generic Entry, but the caller is actually looking for\n        a File at this point, so morph into one.\"\"\"\n        self.__class__ = File\n        self._morph()\n        self.clear()\n        return File.rfile(self)\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self):\n        \"\"\"Fetch the contents of the entry.  Returns the exact binary\n        contents of the file.\"\"\"\n        try:\n            self = self.disambiguate(must_exist=1)\n        except SCons.Errors.UserError:\n            # There was nothing on disk with which to disambiguate\n            # this entry.  Leave it as an Entry, but return a null\n            # string so calls to get_contents() in emitters and the\n            # like (e.g. in qt.py) don't have to disambiguate by hand\n            # or catch the exception.\n            return ''\n        else:\n            return self.get_contents()\n\n    def get_text_contents(self):\n        \"\"\"Fetch the decoded text contents of a Unicode encoded Entry.\n\n        Since this should return the text contents from the file\n        system, we check to see into what sort of subclass we should\n        morph this Entry.\"\"\"\n        try:\n            self = self.disambiguate(must_exist=1)\n        except SCons.Errors.UserError:\n            # There was nothing on disk with which to disambiguate\n            # this entry.  Leave it as an Entry, but return a null\n            # string so calls to get_text_contents() in emitters and\n            # the like (e.g. in qt.py) don't have to disambiguate by\n            # hand or catch the exception.\n            return ''\n        else:\n            return self.get_text_contents()\n\n    def must_be_same(self, klass):\n        \"\"\"Called to make sure a Node is a Dir.  Since we're an\n        Entry, we can morph into one.\"\"\"\n        if self.__class__ is not klass:\n            self.__class__ = klass\n            self._morph()\n            self.clear()\n\n    # The following methods can get called before the Taskmaster has\n    # had a chance to call disambiguate() directly to see if this Entry\n    # should really be a Dir or a File.  We therefore use these to call\n    # disambiguate() transparently (from our caller's point of view).\n    #\n    # Right now, this minimal set of methods has been derived by just\n    # looking at some of the methods that will obviously be called early\n    # in any of the various Taskmasters' calling sequences, and then\n    # empirically figuring out which additional methods are necessary\n    # to make various tests pass.\n\n    def exists(self):\n        \"\"\"Return if the Entry exists.  Check the file system to see\n        what we should turn into first.  Assume a file if there's no\n        directory.\"\"\"\n        return self.disambiguate().exists()\n\n    def rel_path(self, other):\n        d = self.disambiguate()\n        if d.__class__ is Entry:\n            raise Exception(\"rel_path() could not disambiguate File/Dir\")\n        return d.rel_path(other)\n\n    def new_ninfo(self):\n        return self.disambiguate().new_ninfo()\n\n    def changed_since_last_build(self, target, prev_ni):\n        return self.disambiguate().changed_since_last_build(target, prev_ni)\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return self.disambiguate()._glob1(pattern, ondisk, source, strings)\n\n    def get_subst_proxy(self):\n        return self.disambiguate().get_subst_proxy()\n\n# This is for later so we can differentiate between Entry the class and Entry\n# the method of the FS class.\n_classEntry = Entry\n\n\nclass LocalFS(object):\n\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    # This class implements an abstraction layer for operations involving\n    # a local file system.  Essentially, this wraps any function in\n    # the os, os.path or shutil modules that we use to actually go do\n    # anything with or to the local file system.\n    #\n    # Note that there's a very good chance we'll refactor this part of\n    # the architecture in some way as we really implement the interface(s)\n    # for remote file system Nodes.  For example, the right architecture\n    # might be to have this be a subclass instead of a base class.\n    # Nevertheless, we're using this as a first step in that direction.\n    #\n    # We're not using chdir() yet because the calling subclass method\n    # needs to use os.chdir() directly to avoid recursion.  Will we\n    # really need this one?\n    #def chdir(self, path):\n    #    return os.chdir(path)\n    def chmod(self, path, mode):\n        return os.chmod(path, mode)\n    def copy(self, src, dst):\n        return shutil.copy(src, dst)\n    def copy2(self, src, dst):\n        return shutil.copy2(src, dst)\n    def exists(self, path):\n        return os.path.exists(path)\n    def getmtime(self, path):\n        return os.path.getmtime(path)\n    def getsize(self, path):\n        return os.path.getsize(path)\n    def isdir(self, path):\n        return os.path.isdir(path)\n    def isfile(self, path):\n        return os.path.isfile(path)\n    def link(self, src, dst):\n        return os.link(src, dst)\n    def lstat(self, path):\n        return os.lstat(path)\n    def listdir(self, path):\n        return os.listdir(path)\n    def makedirs(self, path):\n        return os.makedirs(path)\n    def mkdir(self, path):\n        return os.mkdir(path)\n    def rename(self, old, new):\n        return os.rename(old, new)\n    def stat(self, path):\n        return os.stat(path)\n    def symlink(self, src, dst):\n        return os.symlink(src, dst)\n    def open(self, path):\n        return open(path)\n    def unlink(self, path):\n        return os.unlink(path)\n\n    if hasattr(os, 'symlink'):\n        def islink(self, path):\n            return os.path.islink(path)\n    else:\n        def islink(self, path):\n            return 0                    # no symlinks\n\n    if hasattr(os, 'readlink'):\n        def readlink(self, file):\n            return os.readlink(file)\n    else:\n        def readlink(self, file):\n            return ''\n\n\n#class RemoteFS:\n#    # Skeleton for the obvious methods we might need from the\n#    # abstraction layer for a remote filesystem.\n#    def upload(self, local_src, remote_dst):\n#        pass\n#    def download(self, remote_src, local_dst):\n#        pass\n\n\nclass FS(LocalFS):\n\n    memoizer_counters = []\n\n    def __init__(self, path = None):\n        \"\"\"Initialize the Node.FS subsystem.\n\n        The supplied path is the top of the source tree, where we\n        expect to find the top-level build file.  If no path is\n        supplied, the current directory is the default.\n\n        The path argument must be a valid absolute path.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS')\n\n        self._memo = {}\n\n        self.Root = {}\n        self.SConstruct_dir = None\n        self.max_drift = default_max_drift\n\n        self.Top = None\n        if path is None:\n            self.pathTop = os.getcwd()\n        else:\n            self.pathTop = path\n        self.defaultDrive = _my_normcase(_my_splitdrive(self.pathTop)[0])\n\n        self.Top = self.Dir(self.pathTop)\n        self.Top.path = '.'\n        self.Top.tpath = '.'\n        self._cwd = self.Top\n\n        DirNodeInfo.fs = self\n        FileNodeInfo.fs = self\n\n    def set_SConstruct_dir(self, dir):\n        self.SConstruct_dir = dir\n\n    def get_max_drift(self):\n        return self.max_drift\n\n    def set_max_drift(self, max_drift):\n        self.max_drift = max_drift\n\n    def getcwd(self):\n        if hasattr(self, \"_cwd\"):\n           return self._cwd\n        else:\n           return \"<no cwd>\"\n\n    def chdir(self, dir, change_os_dir=0):\n        \"\"\"Change the current working directory for lookups.\n        If change_os_dir is true, we will also change the \"real\" cwd\n        to match.\n        \"\"\"\n        curr=self._cwd\n        try:\n            if dir is not None:\n                self._cwd = dir\n                if change_os_dir:\n                    os.chdir(dir.abspath)\n        except OSError:\n            self._cwd = curr\n            raise\n\n    def get_root(self, drive):\n        \"\"\"\n        Returns the root directory for the specified drive, creating\n        it if necessary.\n        \"\"\"\n        drive = _my_normcase(drive)\n        try:\n            return self.Root[drive]\n        except KeyError:\n            root = RootDir(drive, self)\n            self.Root[drive] = root\n            if not drive:\n                self.Root[self.defaultDrive] = root\n            elif drive == self.defaultDrive:\n                self.Root[''] = root\n            return root\n\n    def _lookup(self, p, directory, fsclass, create=1):\n        \"\"\"\n        The generic entry point for Node lookup with user-supplied data.\n\n        This translates arbitrary input into a canonical Node.FS object\n        of the specified fsclass.  The general approach for strings is\n        to turn it into a fully normalized absolute path and then call\n        the root directory's lookup_abs() method for the heavy lifting.\n\n        If the path name begins with '#', it is unconditionally\n        interpreted relative to the top-level directory of this FS.  '#'\n        is treated as a synonym for the top-level SConstruct directory,\n        much like '~' is treated as a synonym for the user's home\n        directory in a UNIX shell.  So both '#foo' and '#/foo' refer\n        to the 'foo' subdirectory underneath the top-level SConstruct\n        directory.\n\n        If the path name is relative, then the path is looked up relative\n        to the specified directory, or the current directory (self._cwd,\n        typically the SConscript directory) if the specified directory\n        is None.\n        \"\"\"\n        if isinstance(p, Base):\n            # It's already a Node.FS object.  Make sure it's the right\n            # class and return.\n            p.must_be_same(fsclass)\n            return p\n        # str(p) in case it's something like a proxy object\n        p = str(p)\n\n        if not os_sep_is_slash:\n            p = p.replace(OS_SEP, '/')\n\n        if p[0:1] == '#':\n            # There was an initial '#', so we strip it and override\n            # whatever directory they may have specified with the\n            # top-level SConstruct directory.\n            p = p[1:]\n            directory = self.Top\n\n            # There might be a drive letter following the\n            # '#'. Although it is not described in the SCons man page,\n            # the regression test suite explicitly tests for that\n            # syntax. It seems to mean the following thing:\n            #\n            #   Assuming the the SCons top dir is in C:/xxx/yyy,\n            #   '#X:/toto' means X:/xxx/yyy/toto.\n            #\n            # i.e. it assumes that the X: drive has a directory\n            # structure similar to the one found on drive C:.\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n            else:\n                root = directory.root\n\n            # We can only strip trailing after splitting the drive\n            # since the drive might the UNC '//' prefix.\n            p = p.strip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            # The path is relative to the top-level SCons directory.\n            if p in ('', '.'):\n                p = directory.labspath\n            else:\n                p = directory.labspath + '/' + p\n        else:\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive and not p:\n                    # This causes a naked drive letter to be treated\n                    # as a synonym for the root directory on that\n                    # drive.\n                    p = '/'\n            else:\n                drive = ''\n\n            # We can only strip trailing '/' since the drive might the\n            # UNC '//' prefix.\n            if p != '/':\n                p = p.rstrip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            if p[0:1] == '/':\n                # Absolute path\n                root = self.get_root(drive)\n            else:\n                # This is a relative lookup or to the current directory\n                # (the path name is not absolute).  Add the string to the\n                # appropriate directory lookup path, after which the whole\n                # thing gets normalized.\n                if directory:\n                    if not isinstance(directory, Dir):\n                        directory = self.Dir(directory)\n                else:\n                    directory = self._cwd\n\n                if p in ('', '.'):\n                    p = directory.labspath\n                else:\n                    p = directory.labspath + '/' + p\n\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n\n        if needs_normpath is not None:\n            # Normalize a pathname. Will return the same result for\n            # equivalent paths.\n            #\n            # We take advantage of the fact that we have an absolute\n            # path here for sure. In addition, we know that the\n            # components of lookup path are separated by slashes at\n            # this point. Because of this, this code is about 2X\n            # faster than calling os.path.normpath() followed by\n            # replacing os.sep with '/' again.\n            ins = p.split('/')[1:]\n            outs = []\n            for d in ins:\n                if d == '..':\n                    try:\n                        outs.pop()\n                    except IndexError:\n                        pass\n                elif d not in ('', '.'):\n                    outs.append(d)\n            p = '/' + '/'.join(outs)\n\n        return root._lookup_abs(p, fsclass, create)\n\n    def Entry(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a generic Entry node with the specified name.\n        If the name is a relative path (begins with ./, ../, or a file\n        name), then it is looked up relative to the supplied directory\n        node, or to the top level directory of the FS (supplied at\n        construction time) if no directory is supplied.\n        \"\"\"\n        return self._lookup(name, directory, Entry, create)\n\n    def File(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a File node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a directory is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, File, create)\n\n    def Dir(self, name, directory = None, create = True):\n        \"\"\"Look up or create a Dir node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a normal file is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, Dir, create)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        \"\"\"Link the supplied variant directory to the source directory\n        for purposes of building files.\"\"\"\n\n        if not isinstance(src_dir, SCons.Node.Node):\n            src_dir = self.Dir(src_dir)\n        if not isinstance(variant_dir, SCons.Node.Node):\n            variant_dir = self.Dir(variant_dir)\n        if src_dir.is_under(variant_dir):\n            raise SCons.Errors.UserError(\"Source directory cannot be under variant directory.\")\n        if variant_dir.srcdir:\n            if variant_dir.srcdir == src_dir:\n                return # We already did this.\n            raise SCons.Errors.UserError(\"'%s' already has a source directory: '%s'.\"%(variant_dir, variant_dir.srcdir))\n        variant_dir.link(src_dir, duplicate)\n\n    def Repository(self, *dirs):\n        \"\"\"Specify Repository directories to search.\"\"\"\n        for d in dirs:\n            if not isinstance(d, SCons.Node.Node):\n                d = self.Dir(d)\n            self.Top.addRepository(d)\n\n    def variant_dir_target_climb(self, orig, dir, tail):\n        \"\"\"Create targets in corresponding variant directories\n\n        Climb the directory tree, and look up path names\n        relative to any linked variant directories we find.\n\n        Even though this loops and walks up the tree, we don't memoize\n        the return value because this is really only used to process\n        the command-line targets.\n        \"\"\"\n        targets = []\n        message = None\n        fmt = \"building associated VariantDir targets: %s\"\n        start_dir = dir\n        while dir:\n            for bd in dir.variant_dirs:\n                if start_dir.is_under(bd):\n                    # If already in the build-dir location, don't reflect\n                    return [orig], fmt % str(orig)\n                p = os.path.join(bd.path, *tail)\n                targets.append(self.Entry(p))\n            tail = [dir.name] + tail\n            dir = dir.up()\n        if targets:\n            message = fmt % ' '.join(map(str, targets))\n        return targets, message\n\n    def Glob(self, pathname, ondisk=True, source=True, strings=False, cwd=None):\n        \"\"\"\n        Globs\n\n        This is mainly a shim layer\n        \"\"\"\n        if cwd is None:\n            cwd = self.getcwd()\n        return cwd.glob(pathname, ondisk, source, strings)\n\nclass DirNodeInfo(SCons.Node.NodeInfoBase):\n    # This should get reset by the FS initialization.\n    current_version_id = 1\n\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.labspath + '/' + s\n        return root._lookup_abs(s, Entry)\n\nclass DirBuildInfo(SCons.Node.BuildInfoBase):\n    current_version_id = 1\n\nglob_magic_check = re.compile('[*?[]')\n\ndef has_glob_magic(s):\n    return glob_magic_check.search(s) is not None\n\nclass Dir(Base):\n    \"\"\"A class for directories in a file system.\n    \"\"\"\n\n    memoizer_counters = []\n\n    NodeInfo = DirNodeInfo\n    BuildInfo = DirBuildInfo\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def _morph(self):\n        \"\"\"Turn a file system Node (either a freshly initialized directory\n        object or a separate Entry object) into a proper directory object.\n\n        Set up this directory's entries and hook it into the file\n        system tree.  Specify that directories (this Node) don't use\n        signatures for calculating whether they're current.\n        \"\"\"\n\n        self.repositories = []\n        self.srcdir = None\n\n        self.entries = {}\n        self.entries['.'] = self\n        self.entries['..'] = self.dir\n        self.cwd = self\n        self.searched = 0\n        self._sconsign = None\n        self.variant_dirs = []\n        self.root = self.dir.root\n\n        # For directories, we make a difference between the directory\n        # 'name' and the directory 'dirname'. The 'name' attribute is\n        # used when we need to print the 'name' of the directory or\n        # when we it is used as the last part of a path. The 'dirname'\n        # is used when the directory is not the last element of the\n        # path. The main reason for making that distinction is that\n        # for RoorDir's the dirname can not be easily inferred from\n        # the name. For example, we have to add a '/' after a drive\n        # letter but not after a UNC path prefix ('//').\n        self.dirname = self.name + OS_SEP\n\n        # Don't just reset the executor, replace its action list,\n        # because it might have some pre-or post-actions that need to\n        # be preserved.\n        #\n        # But don't reset the executor if there is a non-null executor\n        # attached already. The existing executor might have other\n        # targets, in which case replacing the action list with a\n        # Mkdir action is a big mistake.\n        if not hasattr(self, 'executor'):\n            self.builder = get_MkdirBuilder()\n            self.get_executor().set_action_list(self.builder.action)\n        else:\n            # Prepend MkdirBuilder action to existing action list\n            l = self.get_executor().action_list\n            a = get_MkdirBuilder().action\n            l.insert(0, a)\n            self.get_executor().set_action_list(l)\n\n    def diskcheck_match(self):\n        diskcheck_match(self, self.isfile,\n                        \"File %s found where directory expected.\")\n\n    def __clearRepositoryCache(self, duplicate=None):\n        \"\"\"Called when we change the repository(ies) for a directory.\n        This clears any cached information that is invalidated by changing\n        the repository.\"\"\"\n\n        for node in self.entries.values():\n            if node != self.dir:\n                if node != self and isinstance(node, Dir):\n                    node.__clearRepositoryCache(duplicate)\n                else:\n                    node.clear()\n                    try:\n                        del node._srcreps\n                    except AttributeError:\n                        pass\n                    if duplicate is not None:\n                        node.duplicate=duplicate\n\n    def __resetDuplicate(self, node):\n        if node != self:\n            node.duplicate = node.get_dir().duplicate\n\n    def Entry(self, name):\n        \"\"\"\n        Looks up or creates an entry node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Entry(name, self)\n\n    def Dir(self, name, create=True):\n        \"\"\"\n        Looks up or creates a directory node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Dir(name, self, create)\n\n    def File(self, name):\n        \"\"\"\n        Looks up or creates a file node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.File(name, self)\n\n    def link(self, srcdir, duplicate):\n        \"\"\"Set this directory as the variant directory for the\n        supplied source directory.\"\"\"\n        self.srcdir = srcdir\n        self.duplicate = duplicate\n        self.__clearRepositoryCache(duplicate)\n        srcdir.variant_dirs.append(self)\n\n    def getRepositories(self):\n        \"\"\"Returns a list of repositories for this directory.\n        \"\"\"\n        if self.srcdir and not self.duplicate:\n            return self.srcdir.get_all_rdirs() + self.repositories\n        return self.repositories\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_all_rdirs'))\n\n    def get_all_rdirs(self):\n        try:\n            return list(self._memo['get_all_rdirs'])\n        except KeyError:\n            pass\n\n        result = [self]\n        fname = '.'\n        dir = self\n        while dir:\n            for rep in dir.getRepositories():\n                result.append(rep.Dir(fname))\n            if fname == '.':\n                fname = dir.name\n            else:\n                fname = dir.name + OS_SEP + fname\n            dir = dir.up()\n\n        self._memo['get_all_rdirs'] = list(result)\n\n        return result\n\n    def addRepository(self, dir):\n        if dir != self and not dir in self.repositories:\n            self.repositories.append(dir)\n            dir.tpath = '.'\n            self.__clearRepositoryCache()\n\n    def up(self):\n        return self.dir\n\n    def _rel_path_key(self, other):\n        return str(other)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('rel_path', _rel_path_key))\n\n    def rel_path(self, other):\n        \"\"\"Return a path to \"other\" relative to this directory.\n        \"\"\"\n\n        # This complicated and expensive method, which constructs relative\n        # paths between arbitrary Node.FS objects, is no longer used\n        # by SCons itself.  It was introduced to store dependency paths\n        # in .sconsign files relative to the target, but that ended up\n        # being significantly inefficient.\n        #\n        # We're continuing to support the method because some SConstruct\n        # files out there started using it when it was available, and\n        # we're all about backwards compatibility..\n\n        try:\n            memo_dict = self._memo['rel_path']\n        except KeyError:\n            memo_dict = {}\n            self._memo['rel_path'] = memo_dict\n        else:\n            try:\n                return memo_dict[other]\n            except KeyError:\n                pass\n\n        if self is other:\n            result = '.'\n\n        elif not other in self.path_elements:\n            try:\n                other_dir = other.get_dir()\n            except AttributeError:\n                result = str(other)\n            else:\n                if other_dir is None:\n                    result = other.name\n                else:\n                    dir_rel_path = self.rel_path(other_dir)\n                    if dir_rel_path == '.':\n                        result = other.name\n                    else:\n                        result = dir_rel_path + OS_SEP + other.name\n        else:\n            i = self.path_elements.index(other) + 1\n\n            path_elems = ['..'] * (len(self.path_elements) - i) \\\n                         + [n.name for n in other.path_elements[i:]]\n\n            result = OS_SEP.join(path_elems)\n\n        memo_dict[other] = result\n\n        return result\n\n    def get_env_scanner(self, env, kw={}):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_target_scanner(self):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return this directory's implicit dependencies.\n\n        We don't bother caching the results because the scan typically\n        shouldn't be requested more than once (as opposed to scanning\n        .h file contents, which can be requested as many times as the\n        files is #included by other files).\n        \"\"\"\n        if not scanner:\n            return []\n        # Clear cached info for this Dir.  If we already visited this\n        # directory on our walk down the tree (because we didn't know at\n        # that point it was being used as the source for another Node)\n        # then we may have calculated build signature before realizing\n        # we had to scan the disk.  Now that we have to, though, we need\n        # to invalidate the old calculated signature so that any node\n        # dependent on our directory structure gets one that includes\n        # info about everything on disk.\n        self.clear()\n        return scanner(self, env, path)\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def prepare(self):\n        pass\n\n    def build(self, **kw):\n        \"\"\"A null \"builder\" for directories.\"\"\"\n        global MkdirBuilder\n        if self.builder is not MkdirBuilder:\n            SCons.Node.Node.build(self, **kw)\n\n    #\n    #\n    #\n\n    def _create(self):\n        \"\"\"Create this directory, silently and without worrying about\n        whether the builder is the default or not.\"\"\"\n        listDirs = []\n        parent = self\n        while parent:\n            if parent.exists():\n                break\n            listDirs.append(parent)\n            p = parent.up()\n            if p is None:\n                # Don't use while: - else: for this condition because\n                # if so, then parent is None and has no .path attribute.\n                raise SCons.Errors.StopError(parent.path)\n            parent = p\n        listDirs.reverse()\n        for dirnode in listDirs:\n            try:\n                # Don't call dirnode.build(), call the base Node method\n                # directly because we definitely *must* create this\n                # directory.  The dirnode.build() method will suppress\n                # the build if it's the default builder.\n                SCons.Node.Node.build(dirnode)\n                dirnode.get_executor().nullify()\n                # The build() action may or may not have actually\n                # created the directory, depending on whether the -n\n                # option was used or not.  Delete the _exists and\n                # _rexists attributes so they can be reevaluated.\n                dirnode.clear()\n            except OSError:\n                pass\n\n    def multiple_side_effect_has_builder(self):\n        global MkdirBuilder\n        return self.builder is not MkdirBuilder and self.has_builder()\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        return self.fs.variant_dir_target_climb(self, self, [])\n\n    def scanner_key(self):\n        \"\"\"A directory does not get scanned.\"\"\"\n        return None\n\n    def get_text_contents(self):\n        \"\"\"We already emit things in text, so just return the binary\n        version.\"\"\"\n        return self.get_contents()\n\n    def get_contents(self):\n        \"\"\"Return content signatures and names of all our children\n        separated by new-lines. Ensure that the nodes are sorted.\"\"\"\n        contents = []\n        for node in sorted(self.children(), key=lambda t: t.name):\n            contents.append('%s %s\\n' % (node.get_csig(), node.name))\n        return ''.join(contents)\n\n    def get_csig(self):\n        \"\"\"Compute the content signature for Directory nodes. In\n        general, this is not needed and the content signature is not\n        stored in the DirNodeInfo. However, if get_contents on a Dir\n        node is called which has a child directory, the child\n        directory should return the hash of its contents.\"\"\"\n        contents = self.get_contents()\n        return SCons.Util.MD5signature(contents)\n\n    def do_duplicate(self, src):\n        pass\n\n    changed_since_last_build = SCons.Node.Node.state_has_changed\n\n    def is_up_to_date(self):\n        \"\"\"If any child is not up-to-date, then this directory isn't,\n        either.\"\"\"\n        if self.builder is not MkdirBuilder and not self.exists():\n            return 0\n        up_to_date = SCons.Node.up_to_date\n        for kid in self.children():\n            if kid.get_state() > up_to_date:\n                return 0\n        return 1\n\n    def rdir(self):\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try: node = dir.entries[norm_name]\n                except KeyError: node = dir.dir_on_disk(self.name)\n                if node and node.exists() and \\\n                    (isinstance(dir, Dir) or isinstance(dir, Entry)):\n                        return node\n        return self\n\n    def sconsign(self):\n        \"\"\"Return the .sconsign file info for this directory,\n        creating it first if necessary.\"\"\"\n        if not self._sconsign:\n            import SCons.SConsign\n            self._sconsign = SCons.SConsign.ForDirectory(self)\n        return self._sconsign\n\n    def srcnode(self):\n        \"\"\"Dir has a special need for srcnode()...if we\n        have a srcdir attribute set, then that *is* our srcnode.\"\"\"\n        if self.srcdir:\n            return self.srcdir\n        return Base.srcnode(self)\n\n    def get_timestamp(self):\n        \"\"\"Return the latest timestamp from among our children\"\"\"\n        stamp = 0\n        for kid in self.children():\n            if kid.get_timestamp() > stamp:\n                stamp = kid.get_timestamp()\n        return stamp\n\n    def entry_abspath(self, name):\n        return self.abspath + OS_SEP + name\n\n    def entry_labspath(self, name):\n        return self.labspath + '/' + name\n\n    def entry_path(self, name):\n        return self.path + OS_SEP + name\n\n    def entry_tpath(self, name):\n        return self.tpath + OS_SEP + name\n\n    def entry_exists_on_disk(self, name):\n        try:\n            d = self.on_disk_entries\n        except AttributeError:\n            d = {}\n            try:\n                entries = os.listdir(self.abspath)\n            except OSError:\n                pass\n            else:\n                for entry in map(_my_normcase, entries):\n                    d[entry] = True\n            self.on_disk_entries = d\n        if sys.platform == 'win32' or sys.platform == 'cygwin':\n            name = _my_normcase(name)\n            result = d.get(name)\n            if result is None:\n                # Belt-and-suspenders for Windows:  check directly for\n                # 8.3 file names that don't show up in os.listdir().\n                result = os.path.exists(self.abspath + OS_SEP + name)\n                d[name] = result\n            return result\n        else:\n            return name in d\n\n    memoizer_counters.append(SCons.Memoize.CountValue('srcdir_list'))\n\n    def srcdir_list(self):\n        try:\n            return self._memo['srcdir_list']\n        except KeyError:\n            pass\n\n        result = []\n\n        dirname = '.'\n        dir = self\n        while dir:\n            if dir.srcdir:\n                result.append(dir.srcdir.Dir(dirname))\n            dirname = dir.name + OS_SEP + dirname\n            dir = dir.up()\n\n        self._memo['srcdir_list'] = result\n\n        return result\n\n    def srcdir_duplicate(self, name):\n        for dir in self.srcdir_list():\n            if self.is_under(dir):\n                # We shouldn't source from something in the build path;\n                # variant_dir is probably under src_dir, in which case\n                # we are reflecting.\n                break\n            if dir.entry_exists_on_disk(name):\n                srcnode = dir.Entry(name).disambiguate()\n                if self.duplicate:\n                    node = self.Entry(name).disambiguate()\n                    node.do_duplicate(srcnode)\n                    return node\n                else:\n                    return srcnode\n        return None\n\n    def _srcdir_find_file_key(self, filename):\n        return filename\n\n    memoizer_counters.append(SCons.Memoize.CountDict('srcdir_find_file', _srcdir_find_file_key))\n\n    def srcdir_find_file(self, filename):\n        try:\n            memo_dict = self._memo['srcdir_find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['srcdir_find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[filename]\n            except KeyError:\n                pass\n\n        def func(node):\n            if (isinstance(node, File) or isinstance(node, Entry)) and \\\n               (node.is_derived() or node.exists()):\n                    return node\n            return None\n\n        norm_name = _my_normcase(filename)\n\n        for rdir in self.get_all_rdirs():\n            try: node = rdir.entries[norm_name]\n            except KeyError: node = rdir.file_on_disk(filename)\n            else: node = func(node)\n            if node:\n                result = (node, self)\n                memo_dict[filename] = result\n                return result\n\n        for srcdir in self.srcdir_list():\n            for rdir in srcdir.get_all_rdirs():\n                try: node = rdir.entries[norm_name]\n                except KeyError: node = rdir.file_on_disk(filename)\n                else: node = func(node)\n                if node:\n                    result = (File(filename, self, self.fs), srcdir)\n                    memo_dict[filename] = result\n                    return result\n\n        result = (None, None)\n        memo_dict[filename] = result\n        return result\n\n    def dir_on_disk(self, name):\n        if self.entry_exists_on_disk(name):\n            try: return self.Dir(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, File):\n            return None\n        return node\n\n    def file_on_disk(self, name):\n        if self.entry_exists_on_disk(name) or \\\n           diskcheck_rcs(self, name) or \\\n           diskcheck_sccs(self, name):\n            try: return self.File(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, Dir):\n            return None\n        return node\n\n    def walk(self, func, arg):\n        \"\"\"\n        Walk this directory tree by calling the specified function\n        for each directory in the tree.\n\n        This behaves like the os.path.walk() function, but for in-memory\n        Node.FS.Dir objects.  The function takes the same arguments as\n        the functions passed to os.path.walk():\n\n                func(arg, dirname, fnames)\n\n        Except that \"dirname\" will actually be the directory *Node*,\n        not the string.  The '.' and '..' entries are excluded from\n        fnames.  The fnames list may be modified in-place to filter the\n        subdirectories visited or otherwise impose a specific order.\n        The \"arg\" argument is always passed to func() and may be used\n        in any way (or ignored, passing None is common).\n        \"\"\"\n        entries = self.entries\n        names = list(entries.keys())\n        names.remove('.')\n        names.remove('..')\n        func(arg, self, names)\n        for dirname in [n for n in names if isinstance(entries[n], Dir)]:\n            entries[dirname].walk(func, arg)\n\n    def glob(self, pathname, ondisk=True, source=False, strings=False):\n        \"\"\"\n        Returns a list of Nodes (or strings) matching a specified\n        pathname pattern.\n\n        Pathname patterns follow UNIX shell semantics:  * matches\n        any-length strings of any characters, ? matches any character,\n        and [] can enclose lists or ranges of characters.  Matches do\n        not span directory separators.\n\n        The matches take into account Repositories, returning local\n        Nodes if a corresponding entry exists in a Repository (either\n        an in-memory Node or something on disk).\n\n        By defafult, the glob() function matches entries that exist\n        on-disk, in addition to in-memory Nodes.  Setting the \"ondisk\"\n        argument to False (or some other non-true value) causes the glob()\n        function to only match in-memory Nodes.  The default behavior is\n        to return both the on-disk and in-memory Nodes.\n\n        The \"source\" argument, when true, specifies that corresponding\n        source Nodes must be returned if you're globbing in a build\n        directory (initialized with VariantDir()).  The default behavior\n        is to return Nodes local to the VariantDir().\n\n        The \"strings\" argument, when true, returns the matches as strings,\n        not Nodes.  The strings are path names relative to this directory.\n\n        The underlying algorithm is adapted from the glob.glob() function\n        in the Python library (but heavily modified), and uses fnmatch()\n        under the covers.\n        \"\"\"\n        dirname, basename = os.path.split(pathname)\n        if not dirname:\n            return sorted(self._glob1(basename, ondisk, source, strings),\n                          key=lambda t: str(t))\n        if has_glob_magic(dirname):\n            list = self.glob(dirname, ondisk, source, strings=False)\n        else:\n            list = [self.Dir(dirname, create=True)]\n        result = []\n        for dir in list:\n            r = dir._glob1(basename, ondisk, source, strings)\n            if strings:\n                r = [os.path.join(str(dir), x) for x in r]\n            result.extend(r)\n        return sorted(result, key=lambda a: str(a))\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        \"\"\"\n        Globs for and returns a list of entry names matching a single\n        pattern in this directory.\n\n        This searches any repositories and source directories for\n        corresponding entries and returns a Node (or string) relative\n        to the current directory if an entry is found anywhere.\n\n        TODO: handle pattern with no wildcard\n        \"\"\"\n        search_dir_list = self.get_all_rdirs()\n        for srcdir in self.srcdir_list():\n            search_dir_list.extend(srcdir.get_all_rdirs())\n\n        selfEntry = self.Entry\n        names = []\n        for dir in search_dir_list:\n            # We use the .name attribute from the Node because the keys of\n            # the dir.entries dictionary are normalized (that is, all upper\n            # case) on case-insensitive systems like Windows.\n            node_names = [ v.name for k, v in dir.entries.items()\n                           if k not in ('.', '..') ]\n            names.extend(node_names)\n            if not strings:\n                # Make sure the working directory (self) actually has\n                # entries for all Nodes in repositories or variant dirs.\n                for name in node_names: selfEntry(name)\n            if ondisk:\n                try:\n                    disk_names = os.listdir(dir.abspath)\n                except os.error:\n                    continue\n                names.extend(disk_names)\n                if not strings:\n                    # We're going to return corresponding Nodes in\n                    # the local directory, so we need to make sure\n                    # those Nodes exist.  We only want to create\n                    # Nodes for the entries that will match the\n                    # specified pattern, though, which means we\n                    # need to filter the list here, even though\n                    # the overall list will also be filtered later,\n                    # after we exit this loop.\n                    if pattern[0] != '.':\n                        #disk_names = [ d for d in disk_names if d[0] != '.' ]\n                        disk_names = [x for x in disk_names if x[0] != '.']\n                    disk_names = fnmatch.filter(disk_names, pattern)\n                    dirEntry = dir.Entry\n                    for name in disk_names:\n                        # Add './' before disk filename so that '#' at\n                        # beginning of filename isn't interpreted.\n                        name = './' + name\n                        node = dirEntry(name).disambiguate()\n                        n = selfEntry(name)\n                        if n.__class__ != node.__class__:\n                            n.__class__ = node.__class__\n                            n._morph()\n\n        names = set(names)\n        if pattern[0] != '.':\n            #names = [ n for n in names if n[0] != '.' ]\n            names = [x for x in names if x[0] != '.']\n        names = fnmatch.filter(names, pattern)\n\n        if strings:\n            return names\n\n        #return [ self.entries[_my_normcase(n)] for n in names ]\n        return [self.entries[_my_normcase(n)] for n in names]\n\nclass RootDir(Dir):\n    \"\"\"A class for the root directory of a file system.\n\n    This is the same as a Dir class, except that the path separator\n    ('/' or '\\\\') is actually part of the name, so we don't need to\n    add a separator when creating the path names of entries within\n    this directory.\n    \"\"\"\n    def __init__(self, drive, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')\n        # We're going to be our own parent directory (\"..\" entry and .dir\n        # attribute) so we have to set up some values so Base.__init__()\n        # won't gag won't it calls some of our methods.\n        self.abspath = ''\n        self.labspath = ''\n        self.path = ''\n        self.tpath = ''\n        self.path_elements = []\n        self.duplicate = 0\n        self.root = self\n\n        # Handle all the types of drives:\n        if drive == '':\n            # No drive, regular UNIX root or Windows default drive.\n            name = OS_SEP\n            dirname = OS_SEP\n        elif drive == '//':\n            # UNC path\n            name = UNC_PREFIX\n            dirname = UNC_PREFIX\n        else:\n            # Windows drive letter\n            name = drive\n            dirname = drive + OS_SEP\n\n        Base.__init__(self, name, self, fs)\n\n        # Now set our paths to what we really want them to be. The\n        # name should already contain any necessary separators, such\n        # as the initial drive letter (the name) plus the directory\n        # separator, except for the \"lookup abspath,\" which does not\n        # have the drive letter.\n        self.abspath = dirname\n        self.labspath = ''\n        self.path = dirname\n        self.tpath = dirname\n        self._morph()\n\n        # Must be reset after Dir._morph() is invoked...\n        self.dirname = dirname\n\n        self._lookupDict = {}\n\n        self._lookupDict[''] = self\n        self._lookupDict['/'] = self\n\n        # The // entry is necessary because os.path.normpath()\n        # preserves double slashes at the beginning of a path on Posix\n        # platforms.\n        if not has_unc:\n            self._lookupDict['//'] = self\n\n    def must_be_same(self, klass):\n        if klass is Dir:\n            return\n        Base.must_be_same(self, klass)\n\n    def _lookup_abs(self, p, klass, create=1):\n        \"\"\"\n        Fast (?) lookup of a *normalized* absolute path.\n\n        This method is intended for use by internal lookups with\n        already-normalized path data.  For general-purpose lookups,\n        use the FS.Entry(), FS.Dir() or FS.File() methods.\n\n        The caller is responsible for making sure we're passed a\n        normalized absolute path; we merely let Python's dictionary look\n        up and return the One True Node.FS object for the path.\n\n        If a Node for the specified \"p\" doesn't already exist, and\n        \"create\" is specified, the Node may be created after recursive\n        invocation to find or create the parent directory or directories.\n        \"\"\"\n        k = _my_normcase(p)\n        try:\n            result = self._lookupDict[k]\n        except KeyError:\n            if not create:\n                msg = \"No such file or directory: '%s' in '%s' (and create is False)\" % (p, str(self))\n                raise SCons.Errors.UserError(msg)\n            # There is no Node for this path name, and we're allowed\n            # to create it.\n            # (note: would like to use p.rsplit('/',1) here but\n            # that's not in python 2.3)\n            # e.g.: dir_name, file_name = p.rsplit('/',1)\n            last_slash = p.rindex('/')\n            if (last_slash >= 0):\n                dir_name  = p[:last_slash]\n                file_name = p[last_slash+1:]\n            else:\n                dir_name  = p         # shouldn't happen, just in case\n                file_name = ''\n\n            dir_node = self._lookup_abs(dir_name, Dir)\n            result = klass(file_name, dir_node, self.fs)\n\n            # Double-check on disk (as configured) that the Node we\n            # created matches whatever is out there in the real world.\n            result.diskcheck_match()\n\n            self._lookupDict[k] = result\n            dir_node.entries[_my_normcase(file_name)] = result\n            dir_node.implicit = None\n        else:\n            # There is already a Node for this path name.  Allow it to\n            # complain if we were looking for an inappropriate type.\n            result.must_be_same(klass)\n        return result\n\n    def __str__(self):\n        return self.abspath\n\n    def entry_abspath(self, name):\n        return self.abspath + name\n\n    def entry_labspath(self, name):\n        return '/' + name\n\n    def entry_path(self, name):\n        return self.path + name\n\n    def entry_tpath(self, name):\n        return self.tpath + name\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return 0\n\n    def up(self):\n        return None\n\n    def get_dir(self):\n        return None\n\n    def src_builder(self):\n        return _null\n\nclass FileNodeInfo(SCons.Node.NodeInfoBase):\n    current_version_id = 1\n\n    field_list = ['csig', 'timestamp', 'size']\n\n    # This should get reset by the FS initialization.\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.labspath + '/' + s\n        return root._lookup_abs(s, Entry)\n\nclass FileBuildInfo(SCons.Node.BuildInfoBase):\n    current_version_id = 1\n\n    def convert_to_sconsign(self):\n        \"\"\"\n        Converts this FileBuildInfo object for writing to a .sconsign file\n\n        This replaces each Node in our various dependency lists with its\n        usual string representation: relative to the top-level SConstruct\n        directory, or an absolute path if it's outside.\n        \"\"\"\n        if os_sep_is_slash:\n            node_to_str = str\n        else:\n            def node_to_str(n):\n                try:\n                    s = n.path\n                except AttributeError:\n                    s = str(n)\n                else:\n                    s = s.replace(OS_SEP, '/')\n                return s\n        for attr in ['bsources', 'bdepends', 'bimplicit']:\n            try:\n                val = getattr(self, attr)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, attr, list(map(node_to_str, val)))\n    def convert_from_sconsign(self, dir, name):\n        \"\"\"\n        Converts a newly-read FileBuildInfo object for in-SCons use\n\n        For normal up-to-date checking, we don't have any conversion to\n        perform--but we're leaving this method here to make that clear.\n        \"\"\"\n        pass\n    def prepare_dependencies(self):\n        \"\"\"\n        Prepares a FileBuildInfo object for explaining what changed\n\n        The bsources, bdepends and bimplicit lists have all been\n        stored on disk as paths relative to the top-level SConstruct\n        directory.  Convert the strings to actual Nodes (for use by the\n        --debug=explain code and --implicit-cache).\n        \"\"\"\n        attrs = [\n            ('bsources', 'bsourcesigs'),\n            ('bdepends', 'bdependsigs'),\n            ('bimplicit', 'bimplicitsigs'),\n        ]\n        for (nattr, sattr) in attrs:\n            try:\n                strings = getattr(self, nattr)\n                nodeinfos = getattr(self, sattr)\n            except AttributeError:\n                continue\n            nodes = []\n            for s, ni in zip(strings, nodeinfos):\n                if not isinstance(s, SCons.Node.Node):\n                    s = ni.str_to_node(s)\n                nodes.append(s)\n            setattr(self, nattr, nodes)\n    def format(self, names=0):\n        result = []\n        bkids = self.bsources + self.bdepends + self.bimplicit\n        bkidsigs = self.bsourcesigs + self.bdependsigs + self.bimplicitsigs\n        for bkid, bkidsig in zip(bkids, bkidsigs):\n            result.append(str(bkid) + ': ' +\n                          ' '.join(bkidsig.format(names=names)))\n        result.append('%s [%s]' % (self.bactsig, self.bact))\n        return '\\n'.join(result)\n\nclass File(Base):\n    \"\"\"A class for files in a file system.\n    \"\"\"\n\n    memoizer_counters = []\n\n    NodeInfo = FileNodeInfo\n    BuildInfo = FileBuildInfo\n\n    md5_chunksize = 64\n\n    def diskcheck_match(self):\n        diskcheck_match(self, self.isdir,\n                        \"Directory %s found where file expected.\")\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def Entry(self, name):\n        \"\"\"Create an entry node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Entry(name)\n\n    def Dir(self, name, create=True):\n        \"\"\"Create a directory node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Dir(name, create=create)\n\n    def Dirs(self, pathlist):\n        \"\"\"Create a list of directories relative to the SConscript\n        directory of this file.\"\"\"\n        return [self.Dir(p) for p in pathlist]\n\n    def File(self, name):\n        \"\"\"Create a file node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.File(name)\n\n    #def generate_build_dict(self):\n    #    \"\"\"Return an appropriate dictionary of values for building\n    #    this File.\"\"\"\n    #    return {'Dir' : self.Dir,\n    #            'File' : self.File,\n    #            'RDirs' : self.RDirs}\n\n    def _morph(self):\n        \"\"\"Turn a file system node into a File object.\"\"\"\n        self.scanner_paths = {}\n        if not hasattr(self, '_local'):\n            self._local = 0\n        if not hasattr(self, 'released_target_info'):\n            self.released_target_info = False\n\n        # If there was already a Builder set on this entry, then\n        # we need to make sure we call the target-decider function,\n        # not the source-decider.  Reaching in and doing this by hand\n        # is a little bogus.  We'd prefer to handle this by adding\n        # an Entry.builder_set() method that disambiguates like the\n        # other methods, but that starts running into problems with the\n        # fragile way we initialize Dir Nodes with their Mkdir builders,\n        # yet still allow them to be overridden by the user.  Since it's\n        # not clear right now how to fix that, stick with what works\n        # until it becomes clear...\n        if self.has_builder():\n            self.changed_since_last_build = self.decide_target\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self):\n        if not self.rexists():\n            return ''\n        fname = self.rfile().abspath\n        try:\n            contents = open(fname, \"rb\").read()\n        except EnvironmentError, e:\n            if not e.filename:\n                e.filename = fname\n            raise\n        return contents\n\n    # This attempts to figure out what the encoding of the text is\n    # based upon the BOM bytes, and then decodes the contents so that\n    # it's a valid python string.\n    def get_text_contents(self):\n        contents = self.get_contents()\n        # The behavior of various decode() methods and functions\n        # w.r.t. the initial BOM bytes is different for different\n        # encodings and/or Python versions.  ('utf-8' does not strip\n        # them, but has a 'utf-8-sig' which does; 'utf-16' seems to\n        # strip them; etc.)  Just sidestep all the complication by\n        # explicitly stripping the BOM before we decode().\n        if contents.startswith(codecs.BOM_UTF8):\n            return contents[len(codecs.BOM_UTF8):].decode('utf-8')\n        if contents.startswith(codecs.BOM_UTF16_LE):\n            return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le')\n        if contents.startswith(codecs.BOM_UTF16_BE):\n            return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')\n        return contents\n\n    def get_content_hash(self):\n        \"\"\"\n        Compute and return the MD5 hash for this file.\n        \"\"\"\n        if not self.rexists():\n            return SCons.Util.MD5signature('')\n        fname = self.rfile().abspath\n        try:\n            cs = SCons.Util.MD5filesignature(fname,\n                chunksize=SCons.Node.FS.File.md5_chunksize*1024)\n        except EnvironmentError, e:\n            if not e.filename:\n                e.filename = fname\n            raise\n        return cs\n\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_size'))\n\n    def get_size(self):\n        try:\n            return self._memo['get_size']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            size = self.rfile().getsize()\n        else:\n            size = 0\n\n        self._memo['get_size'] = size\n\n        return size\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_timestamp'))\n\n    def get_timestamp(self):\n        try:\n            return self._memo['get_timestamp']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            timestamp = self.rfile().getmtime()\n        else:\n            timestamp = 0\n\n        self._memo['get_timestamp'] = timestamp\n\n        return timestamp\n\n    def store_info(self):\n        # Merge our build information into the already-stored entry.\n        # This accomodates \"chained builds\" where a file that's a target\n        # in one build (SConstruct file) is a source in a different build.\n        # See test/chained-build.py for the use case.\n        if do_store_info:\n            self.dir.sconsign().store_info(self.name, self)\n\n    convert_copy_attrs = [\n        'bsources',\n        'bimplicit',\n        'bdepends',\n        'bact',\n        'bactsig',\n        'ninfo',\n    ]\n\n\n    convert_sig_attrs = [\n        'bsourcesigs',\n        'bimplicitsigs',\n        'bdependsigs',\n    ]\n\n    def convert_old_entry(self, old_entry):\n        # Convert a .sconsign entry from before the Big Signature\n        # Refactoring, doing what we can to convert its information\n        # to the new .sconsign entry format.\n        #\n        # The old format looked essentially like this:\n        #\n        #   BuildInfo\n        #       .ninfo (NodeInfo)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bsources\n        #       .bsourcesigs (\"signature\" list)\n        #       .bdepends\n        #       .bdependsigs (\"signature\" list)\n        #       .bimplicit\n        #       .bimplicitsigs (\"signature\" list)\n        #       .bact\n        #       .bactsig\n        #\n        # The new format looks like this:\n        #\n        #   .ninfo (NodeInfo)\n        #       .bsig\n        #       .csig\n        #       .timestamp\n        #       .size\n        #   .binfo (BuildInfo)\n        #       .bsources\n        #       .bsourcesigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bdepends\n        #       .bdependsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bimplicit\n        #       .bimplicitsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bact\n        #       .bactsig\n        #\n        # The basic idea of the new structure is that a NodeInfo always\n        # holds all available information about the state of a given Node\n        # at a certain point in time.  The various .b*sigs lists can just\n        # be a list of pointers to the .ninfo attributes of the different\n        # dependent nodes, without any copying of information until it's\n        # time to pickle it for writing out to a .sconsign file.\n        #\n        # The complicating issue is that the *old* format only stored one\n        # \"signature\" per dependency, based on however the *last* build\n        # was configured.  We don't know from just looking at it whether\n        # it was a build signature, a content signature, or a timestamp\n        # \"signature\".  Since we no longer use build signatures, the\n        # best we can do is look at the length and if it's thirty two,\n        # assume that it was (or might have been) a content signature.\n        # If it was actually a build signature, then it will cause a\n        # rebuild anyway when it doesn't match the new content signature,\n        # but that's probably the best we can do.\n        import SCons.SConsign\n        new_entry = SCons.SConsign.SConsignEntry()\n        new_entry.binfo = self.new_binfo()\n        binfo = new_entry.binfo\n        for attr in self.convert_copy_attrs:\n            try:\n                value = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        for attr in self.convert_sig_attrs:\n            try:\n                sig_list = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            value = []\n            for sig in sig_list:\n                ninfo = self.new_ninfo()\n                if len(sig) == 32:\n                    ninfo.csig = sig\n                else:\n                    ninfo.timestamp = sig\n                value.append(ninfo)\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        return new_entry\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_stored_info'))\n\n    def get_stored_info(self):\n        try:\n            return self._memo['get_stored_info']\n        except KeyError:\n            pass\n\n        try:\n            sconsign_entry = self.dir.sconsign().get_entry(self.name)\n        except (KeyError, EnvironmentError):\n            import SCons.SConsign\n            sconsign_entry = SCons.SConsign.SConsignEntry()\n            sconsign_entry.binfo = self.new_binfo()\n            sconsign_entry.ninfo = self.new_ninfo()\n        else:\n            if isinstance(sconsign_entry, FileBuildInfo):\n                # This is a .sconsign file from before the Big Signature\n                # Refactoring; convert it as best we can.\n                sconsign_entry = self.convert_old_entry(sconsign_entry)\n            try:\n                delattr(sconsign_entry.ninfo, 'bsig')\n            except AttributeError:\n                pass\n\n        self._memo['get_stored_info'] = sconsign_entry\n\n        return sconsign_entry\n\n    def get_stored_implicit(self):\n        binfo = self.get_stored_info().binfo\n        binfo.prepare_dependencies()\n        try: return binfo.bimplicit\n        except AttributeError: return None\n\n    def rel_path(self, other):\n        return self.dir.rel_path(other)\n\n    def _get_found_includes_key(self, env, scanner, path):\n        return (id(env), id(scanner), path)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('get_found_includes', _get_found_includes_key))\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the included implicit dependencies in this file.\n        Cache results so we only scan the file once per path\n        regardless of how many times this information is requested.\n        \"\"\"\n        memo_key = (id(env), id(scanner), path)\n        try:\n            memo_dict = self._memo['get_found_includes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_found_includes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if scanner:\n            # result = [n.disambiguate() for n in scanner(self, env, path)]\n            result = scanner(self, env, path)\n            result = [N.disambiguate() for N in result]\n        else:\n            result = []\n\n        memo_dict[memo_key] = result\n\n        return result\n\n    def _createDir(self):\n        # ensure that the directories for this node are\n        # created.\n        self.dir._create()\n\n    def push_to_cache(self):\n        \"\"\"Try to push the node into a cache\n        \"\"\"\n        # This should get called before the Nodes' .built() method is\n        # called, which would clear the build signature if the file has\n        # a source scanner.\n        #\n        # We have to clear the local memoized values *before* we push\n        # the node to cache so that the memoization of the self.exists()\n        # return value doesn't interfere.\n        if self.nocache:\n            return\n        self.clear_memoized_values()\n        if self.exists():\n            self.get_build_env().get_CacheDir().push(self)\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        if self.nocache:\n            return None\n        if not self.is_derived():\n            return None\n        return self.get_build_env().get_CacheDir().retrieve(self)\n\n    def visited(self):\n        if self.exists() and self.executor is not None:\n            self.get_build_env().get_CacheDir().push_if_forced(self)\n\n        ninfo = self.get_ninfo()\n\n        csig = self.get_max_drift_csig()\n        if csig:\n            ninfo.csig = csig\n\n        ninfo.timestamp = self.get_timestamp()\n        ninfo.size      = self.get_size()\n\n        if not self.has_builder():\n            # This is a source file, but it might have been a target file\n            # in another build that included more of the DAG.  Copy\n            # any build information that's stored in the .sconsign file\n            # into our binfo object so it doesn't get lost.\n            old = self.get_stored_info()\n            self.get_binfo().__dict__.update(old.binfo.__dict__)\n\n        self.store_info()\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n         up-to-date or was built completely.\n\n         This is where we try to release as many target node infos\n         as possible for clean builds and update runs, in order\n         to minimize the overall memory consumption.\n\n         We'd like to remove a lot more attributes like self.sources\n         and self.sources_set, but they might get used\n         in a next build step. For example, during configuration\n         the source files for a built *.o file are used to figure out\n         which linker to use for the resulting Program (gcc vs. g++)!\n         That's why we check for the 'keep_targetinfo' attribute,\n         config Nodes and the Interactive mode just don't allow\n         an early release of most variables.\n\n         In the same manner, we can't simply remove the self.attributes\n         here. The smart linking relies on the shared flag, and some\n         parts of the java Tool use it to transport information\n         about nodes...\n\n         @see: built() and Node.release_target_info()\n         \"\"\"\n        if (self.released_target_info or SCons.Node.interactive):\n            return\n\n        if not hasattr(self.attributes, 'keep_targetinfo'):\n            # Cache some required values, before releasing\n            # stuff like env, executor and builder...\n            self.changed(allowcache=True)\n            self.get_contents_sig()\n            self.get_build_env()\n            # Now purge unneeded stuff to free memory...\n            self.executor = None\n            self._memo.pop('rfile', None)\n            self.prerequisites = None\n            # Cleanup lists, but only if they're empty\n            if not len(self.ignore_set):\n                self.ignore_set = None\n            if not len(self.implicit_set):\n                self.implicit_set = None\n            if not len(self.depends_set):\n                self.depends_set = None\n            if not len(self.ignore):\n                self.ignore = None\n            if not len(self.depends):\n                self.depends = None\n            # Mark this node as done, we only have to release\n            # the memory once...\n            self.released_target_info = True\n\n    def find_src_builder(self):\n        if self.rexists():\n            return None\n        scb = self.dir.src_builder()\n        if scb is _null:\n            if diskcheck_sccs(self.dir, self.name):\n                scb = get_DefaultSCCSBuilder()\n            elif diskcheck_rcs(self.dir, self.name):\n                scb = get_DefaultRCSBuilder()\n            else:\n                scb = None\n        if scb is not None:\n            try:\n                b = self.builder\n            except AttributeError:\n                b = None\n            if b is None:\n                self.builder_set(scb)\n        return scb\n\n    def has_src_builder(self):\n        \"\"\"Return whether this Node has a source builder or not.\n\n        If this Node doesn't have an explicit source code builder, this\n        is where we figure out, on the fly, if there's a transparent\n        source code builder for it.\n\n        Note that if we found a source builder, we also set the\n        self.builder attribute, so that all of the methods that actually\n        *build* this file don't have to do anything different.\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.sbuilder = self.find_src_builder()\n        return scb is not None\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        if self.is_derived():\n            return [], None\n        return self.fs.variant_dir_target_climb(self, self.dir, [self.name])\n\n    def _rmv_existing(self):\n        self.clear_memoized_values()\n        if print_duplicate:\n            print \"dup: removing existing target %s\"%self\n        e = Unlink(self, [], None)\n        if isinstance(e, SCons.Errors.BuildError):\n            raise e\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        self.has_src_builder()\n        self.get_binfo()\n\n    def prepare(self):\n        \"\"\"Prepare for this file to be created.\"\"\"\n        SCons.Node.Node.prepare(self)\n\n        if self.get_state() != SCons.Node.up_to_date:\n            if self.exists():\n                if self.is_derived() and not self.precious:\n                    self._rmv_existing()\n            else:\n                try:\n                    self._createDir()\n                except SCons.Errors.StopError, drive:\n                    desc = \"No drive `%s' for target `%s'.\" % (drive, self)\n                    raise SCons.Errors.StopError(desc)\n\n    #\n    #\n    #\n\n    def remove(self):\n        \"\"\"Remove this file.\"\"\"\n        if self.exists() or self.islink():\n            self.fs.unlink(self.path)\n            return 1\n        return None\n\n    def do_duplicate(self, src):\n        self._createDir()\n        if print_duplicate:\n            print \"dup: relinking variant '%s' from '%s'\"%(self, src)\n        Unlink(self, None, None)\n        e = Link(self, src, None)\n        if isinstance(e, SCons.Errors.BuildError):\n            desc = \"Cannot duplicate `%s' in `%s': %s.\" % (src.path, self.dir.path, e.errstr)\n            raise SCons.Errors.StopError(desc)\n        self.linked = 1\n        # The Link() action may or may not have actually\n        # created the file, depending on whether the -n\n        # option was used or not.  Delete the _exists and\n        # _rexists attributes so they can be reevaluated.\n        self.clear()\n\n    memoizer_counters.append(SCons.Memoize.CountValue('exists'))\n\n    def exists(self):\n        try:\n            return self._memo['exists']\n        except KeyError:\n            pass\n        # Duplicate from source path if we are set up to do this.\n        if self.duplicate and not self.is_derived() and not self.linked:\n            src = self.srcnode()\n            if src is not self:\n                # At this point, src is meant to be copied in a variant directory.\n                src = src.rfile()\n                if src.abspath != self.abspath:\n                    if src.exists():\n                        self.do_duplicate(src)\n                        # Can't return 1 here because the duplication might\n                        # not actually occur if the -n option is being used.\n                    else:\n                        # The source file does not exist.  Make sure no old\n                        # copy remains in the variant directory.\n                        if print_duplicate:\n                            print \"dup: no src for %s, unlinking old variant copy\"%self\n                        if Base.exists(self) or self.islink():\n                            self.fs.unlink(self.path)\n                        # Return None explicitly because the Base.exists() call\n                        # above will have cached its value if the file existed.\n                        self._memo['exists'] = None\n                        return None\n        result = Base.exists(self)\n        self._memo['exists'] = result\n        return result\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    def get_max_drift_csig(self):\n        \"\"\"\n        Returns the content signature currently stored for this node\n        if it's been unmodified longer than the max_drift value, or the\n        max_drift value is 0.  Returns None otherwise.\n        \"\"\"\n        old = self.get_stored_info()\n        mtime = self.get_timestamp()\n\n        max_drift = self.fs.max_drift\n        if max_drift > 0:\n            if (time.time() - mtime) > max_drift:\n                try:\n                    n = old.ninfo\n                    if n.timestamp and n.csig and n.timestamp == mtime:\n                        return n.csig\n                except AttributeError:\n                    pass\n        elif max_drift == 0:\n            try:\n                return old.ninfo.csig\n            except AttributeError:\n                pass\n\n        return None\n\n    def get_csig(self):\n        \"\"\"\n        Generate a node's content signature, the digested signature\n        of its content.\n\n        node - the node\n        cache - alternate node to use for the signature cache\n        returns - the content signature\n        \"\"\"\n        ninfo = self.get_ninfo()\n        try:\n            return ninfo.csig\n        except AttributeError:\n            pass\n\n        csig = self.get_max_drift_csig()\n        if csig is None:\n\n            try:\n                if self.get_size() < SCons.Node.FS.File.md5_chunksize:\n                    contents = self.get_contents()\n                else:\n                    csig = self.get_content_hash()\n            except IOError:\n                # This can happen if there's actually a directory on-disk,\n                # which can be the case if they've disabled disk checks,\n                # or if an action with a File target actually happens to\n                # create a same-named directory by mistake.\n                csig = ''\n            else:\n                if not csig:\n                    csig = SCons.Util.MD5signature(contents)\n\n        ninfo.csig = csig\n\n        return csig\n\n    #\n    # DECISION SUBSYSTEM\n    #\n\n    def builder_set(self, builder):\n        SCons.Node.Node.builder_set(self, builder)\n        self.changed_since_last_build = self.decide_target\n\n    def built(self):\n        \"\"\"Called just after this File node is successfully built.\n\n         Just like for 'release_target_info' we try to release\n         some more target node attributes in order to minimize the\n         overall memory consumption.\n\n         @see: release_target_info\n        \"\"\"\n\n        SCons.Node.Node.built(self)\n\n        if (not SCons.Node.interactive and\n            not hasattr(self.attributes, 'keep_targetinfo')):\n            # Ensure that the build infos get computed and cached...\n            self.store_info()\n            # ... then release some more variables.\n            self._specific_sources = False\n            self.labspath = None\n            self._save_str()\n            self.cwd = None\n\n            self.scanner_paths = None\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.\n\n        For File nodes this is basically a wrapper around Node.changed(),\n        but we allow the return value to get cached after the reference\n        to the Executor got released in release_target_info().\n\n        @see: Node.changed()\n        \"\"\"\n        if node is None:\n            try:\n                return self._memo['changed']\n            except KeyError:\n                pass\n\n        has_changed = SCons.Node.Node.changed(self, node)\n        if allowcache:\n            self._memo['changed'] = has_changed\n        return has_changed\n\n    def changed_content(self, target, prev_ni):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def changed_state(self, target, prev_ni):\n        return self.state != SCons.Node.up_to_date\n\n    def changed_timestamp_then_content(self, target, prev_ni):\n        if not self.changed_timestamp_match(target, prev_ni):\n            try:\n                self.get_ninfo().csig = prev_ni.csig\n            except AttributeError:\n                pass\n            return False\n        return self.changed_content(target, prev_ni)\n\n    def changed_timestamp_newer(self, target, prev_ni):\n        try:\n            return self.get_timestamp() > target.get_timestamp()\n        except AttributeError:\n            return 1\n\n    def changed_timestamp_match(self, target, prev_ni):\n        try:\n            return self.get_timestamp() != prev_ni.timestamp\n        except AttributeError:\n            return 1\n\n    def decide_source(self, target, prev_ni):\n        return target.get_build_env().decide_source(self, target, prev_ni)\n\n    def decide_target(self, target, prev_ni):\n        return target.get_build_env().decide_target(self, target, prev_ni)\n\n    # Initialize this Node's decider function to decide_source() because\n    # every file is a source file until it has a Builder attached...\n    changed_since_last_build = decide_source\n\n    def is_up_to_date(self):\n        T = 0\n        if T: Trace('is_up_to_date(%s):' % self)\n        if not self.exists():\n            if T: Trace(' not self.exists():')\n            # The file doesn't exist locally...\n            r = self.rfile()\n            if r != self:\n                # ...but there is one in a Repository...\n                if not self.changed(r):\n                    if T: Trace(' changed(%s):' % r)\n                    # ...and it's even up-to-date...\n                    if self._local:\n                        # ...and they'd like a local copy.\n                        e = LocalCopy(self, r, None)\n                        if isinstance(e, SCons.Errors.BuildError):\n                            raise\n                        self.store_info()\n                    if T: Trace(' 1\\n')\n                    return 1\n            self.changed()\n            if T: Trace(' None\\n')\n            return None\n        else:\n            r = self.changed()\n            if T: Trace(' self.exists():  %s\\n' % r)\n            return not r\n\n    memoizer_counters.append(SCons.Memoize.CountValue('rfile'))\n\n    def rfile(self):\n        try:\n            return self._memo['rfile']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try: node = dir.entries[norm_name]\n                except KeyError: node = dir.file_on_disk(self.name)\n                if node and node.exists() and \\\n                   (isinstance(node, File) or isinstance(node, Entry) \\\n                    or not node.is_derived()):\n                        result = node\n                        # Copy over our local attributes to the repository\n                        # Node so we identify shared object files in the\n                        # repository and don't assume they're static.\n                        #\n                        # This isn't perfect; the attribute would ideally\n                        # be attached to the object in the repository in\n                        # case it was built statically in the repository\n                        # and we changed it to shared locally, but that's\n                        # rarely the case and would only occur if you\n                        # intentionally used the same suffix for both\n                        # shared and static objects anyway.  So this\n                        # should work well in practice.\n                        result.attributes = self.attributes\n                        break\n        self._memo['rfile'] = result\n        return result\n\n    def rstr(self):\n        return str(self.rfile())\n\n    def get_cachedir_csig(self):\n        \"\"\"\n        Fetch a Node's content signature for purposes of computing\n        another Node's cachesig.\n\n        This is a wrapper around the normal get_csig() method that handles\n        the somewhat obscure case of using CacheDir with the -n option.\n        Any files that don't exist would normally be \"built\" by fetching\n        them from the cache, but the normal get_csig() method will try\n        to open up the local file, which doesn't exist because the -n\n        option meant we didn't actually pull the file from cachedir.\n        But since the file *does* actually exist in the cachedir, we\n        can use its contents for the csig.\n        \"\"\"\n        try:\n            return self.cachedir_csig\n        except AttributeError:\n            pass\n\n        cachedir, cachefile = self.get_build_env().get_CacheDir().cachepath(self)\n        if not self.exists() and cachefile and os.path.exists(cachefile):\n            self.cachedir_csig = SCons.Util.MD5filesignature(cachefile, \\\n                SCons.Node.FS.File.md5_chunksize * 1024)\n        else:\n            self.cachedir_csig = self.get_csig()\n        return self.cachedir_csig\n\n    def get_contents_sig(self):\n        \"\"\"\n        A helper method for get_cachedir_bsig.\n\n        It computes and returns the signature for this\n        node's contents.\n        \"\"\"\n\n        try:\n            return self.contentsig\n        except AttributeError:\n            pass\n\n        executor = self.get_executor()\n\n        result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())\n        return result\n\n    def get_cachedir_bsig(self):\n        \"\"\"\n        Return the signature for a cached file, including\n        its children.\n\n        It adds the path of the cached file to the cache signature,\n        because multiple targets built by the same action will all\n        have the same build signature, and we have to differentiate\n        them somehow.\n        \"\"\"\n        try:\n            return self.cachesig\n        except AttributeError:\n            pass\n\n        # Collect signatures for all children\n        children = self.children()\n        sigs = [n.get_cachedir_csig() for n in children]\n        # Append this node's signature...\n        sigs.append(self.get_contents_sig())\n        # ...and it's path\n        sigs.append(self.path)\n        # Merge this all into a single signature\n        result = self.cachesig = SCons.Util.MD5collect(sigs)\n        return result\n\ndefault_fs = None\n\ndef get_default_fs():\n    global default_fs\n    if not default_fs:\n        default_fs = FS()\n    return default_fs\n\nclass FileFinder(object):\n    \"\"\"\n    \"\"\"\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    memoizer_counters = []\n\n    def __init__(self):\n        self._memo = {}\n\n    def filedir_lookup(self, p, fd=None):\n        \"\"\"\n        A helper method for find_file() that looks up a directory for\n        a file we're trying to find.  This only creates the Dir Node if\n        it exists on-disk, since if the directory doesn't exist we know\n        we won't find any files in it...  :-)\n\n        It would be more compact to just use this as a nested function\n        with a default keyword argument (see the commented-out version\n        below), but that doesn't work unless you have nested scopes,\n        so we define it here just so this work under Python 1.5.2.\n        \"\"\"\n        if fd is None:\n            fd = self.default_filedir\n        dir, name = os.path.split(fd)\n        drive, d = _my_splitdrive(dir)\n        if not name and d[:1] in ('/', OS_SEP):\n            #return p.fs.get_root(drive).dir_on_disk(name)\n            return p.fs.get_root(drive)\n        if dir:\n            p = self.filedir_lookup(p, dir)\n            if not p:\n                return None\n        norm_name = _my_normcase(name)\n        try:\n            node = p.entries[norm_name]\n        except KeyError:\n            return p.dir_on_disk(name)\n        if isinstance(node, Dir):\n            return node\n        if isinstance(node, Entry):\n            node.must_be_same(Dir)\n            return node\n        return None\n\n    def _find_file_key(self, filename, paths, verbose=None):\n        return (filename, paths)\n\n    memoizer_counters.append(SCons.Memoize.CountDict('find_file', _find_file_key))\n\n    def find_file(self, filename, paths, verbose=None):\n        \"\"\"\n        find_file(str, [Dir()]) -> [nodes]\n\n        filename - a filename to find\n        paths - a list of directory path *nodes* to search in.  Can be\n                represented as a list, a tuple, or a callable that is\n                called with no arguments and returns the list or tuple.\n\n        returns - the node created from the found file.\n\n        Find a node corresponding to either a derived file or a file\n        that exists already.\n\n        Only the first file found is returned, and none is returned\n        if no file is found.\n        \"\"\"\n        memo_key = self._find_file_key(filename, paths)\n        try:\n            memo_dict = self._memo['find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if verbose and not callable(verbose):\n            if not SCons.Util.is_String(verbose):\n                verbose = \"find_file\"\n            _verbose = u'  %s: ' % verbose\n            verbose = lambda s: sys.stdout.write(_verbose + s)\n\n        filedir, filename = os.path.split(filename)\n        if filedir:\n            # More compact code that we can't use until we drop\n            # support for Python 1.5.2:\n            #\n            #def filedir_lookup(p, fd=filedir):\n            #    \"\"\"\n            #    A helper function that looks up a directory for a file\n            #    we're trying to find.  This only creates the Dir Node\n            #    if it exists on-disk, since if the directory doesn't\n            #    exist we know we won't find any files in it...  :-)\n            #    \"\"\"\n            #    dir, name = os.path.split(fd)\n            #    if dir:\n            #        p = filedir_lookup(p, dir)\n            #        if not p:\n            #            return None\n            #    norm_name = _my_normcase(name)\n            #    try:\n            #        node = p.entries[norm_name]\n            #    except KeyError:\n            #        return p.dir_on_disk(name)\n            #    if isinstance(node, Dir):\n            #        return node\n            #    if isinstance(node, Entry):\n            #        node.must_be_same(Dir)\n            #        return node\n            #    if isinstance(node, Dir) or isinstance(node, Entry):\n            #        return node\n            #    return None\n            #paths = [_f for _f in map(filedir_lookup, paths) if _f]\n\n            self.default_filedir = filedir\n            paths = [_f for _f in map(self.filedir_lookup, paths) if _f]\n\n        result = None\n        for dir in paths:\n            if verbose:\n                verbose(\"looking for '%s' in '%s' ...\\n\" % (filename, dir))\n            node, d = dir.srcdir_find_file(filename)\n            if node:\n                if verbose:\n                    verbose(\"... FOUND '%s' in '%s'\\n\" % (filename, d))\n                result = node\n                break\n\n        memo_dict[memo_key] = result\n\n        return result\n\nfind_file = FileFinder().find_file\n\n\ndef invalidate_node_memos(targets):\n    \"\"\"\n    Invalidate the memoized values of all Nodes (files or directories)\n    that are associated with the given entries. Has been added to\n    clear the cache of nodes affected by a direct execution of an\n    action (e.g.  Delete/Copy/Chmod). Existing Node caches become\n    inconsistent if the action is run through Execute().  The argument\n    `targets` can be a single Node object or filename, or a sequence\n    of Nodes/filenames.\n    \"\"\"\n    from traceback import extract_stack\n\n    # First check if the cache really needs to be flushed. Only\n    # actions run in the SConscript with Execute() seem to be\n    # affected. XXX The way to check if Execute() is in the stacktrace\n    # is a very dirty hack and should be replaced by a more sensible\n    # solution.\n    for f in extract_stack():\n        if f[2] == 'Execute' and f[0][-14:] == 'Environment.py':\n            break\n    else:\n        # Dont have to invalidate, so return\n        return\n\n    if not SCons.Util.is_List(targets):\n        targets = [targets]\n\n    for entry in targets:\n        # If the target is a Node object, clear the cache. If it is a\n        # filename, look up potentially existing Node object first.\n        try:\n            entry.clear_memoized_values()\n        except AttributeError:\n            # Not a Node object, try to look up Node by filename.  XXX\n            # This creates Node objects even for those filenames which\n            # do not correspond to an existing Node object.\n            node = get_default_fs().Entry(entry)\n            if node:\n                node.clear_memoized_values()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/Python.py",
    "content": "\"\"\"scons.Node.Python\n\nPython nodes.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Node/Python.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Node\n\nclass ValueNodeInfo(SCons.Node.NodeInfoBase):\n    current_version_id = 1\n\n    field_list = ['csig']\n\n    def str_to_node(self, s):\n        return Value(s)\n\nclass ValueBuildInfo(SCons.Node.BuildInfoBase):\n    current_version_id = 1\n\nclass Value(SCons.Node.Node):\n    \"\"\"A class for Python variables, typically passed on the command line\n    or generated by a script, but not from a file or some other source.\n    \"\"\"\n\n    NodeInfo = ValueNodeInfo\n    BuildInfo = ValueBuildInfo\n\n    def __init__(self, value, built_value=None):\n        SCons.Node.Node.__init__(self)\n        self.value = value\n        if built_value is not None:\n            self.built_value = built_value\n\n    def str_for_display(self):\n        return repr(self.value)\n\n    def __str__(self):\n        return str(self.value)\n\n    def make_ready(self):\n        self.get_csig()\n\n    def build(self, **kw):\n        if not hasattr(self, 'built_value'):\n            SCons.Node.Node.build(self, **kw)\n\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Value nodes get built regardless of\n        # what directory scons was run from. Value nodes\n        # are outside the filesystem:\n        return 1\n\n    def write(self, built_value):\n        \"\"\"Set the value of the node.\"\"\"\n        self.built_value = built_value\n\n    def read(self):\n        \"\"\"Return the value. If necessary, the value is built.\"\"\"\n        self.build()\n        if not hasattr(self, 'built_value'):\n            self.built_value = self.value\n        return self.built_value\n\n    def get_text_contents(self):\n        \"\"\"By the assumption that the node.built_value is a\n        deterministic product of the sources, the contents of a Value\n        are the concatenation of all the contents of its sources.  As\n        the value need not be built when get_contents() is called, we\n        cannot use the actual node.built_value.\"\"\"\n        ###TODO: something reasonable about universal newlines\n        contents = str(self.value)\n        for kid in self.children(None):\n            contents = contents + kid.get_contents()\n        return contents\n\n    get_contents = get_text_contents    ###TODO should return 'bytes' value\n\n    def changed_since_last_build(self, target, prev_ni):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def get_csig(self, calc=None):\n        \"\"\"Because we're a Python value node and don't have a real\n        timestamp, we get to ignore the calculator and just use the\n        value contents.\"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n        contents = self.get_contents()\n        self.get_ninfo().csig = contents\n        return contents\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/__init__.py",
    "content": "\"\"\"SCons.Node\n\nThe Node package for the SCons software construction utility.\n\nThis is, in many ways, the heart of SCons.\n\nA Node is where we encapsulate all of the dependency information about\nany thing that SCons can build, or about any thing which SCons can use\nto build some other thing.  The canonical \"thing,\" of course, is a file,\nbut a Node can also represent something remote (like a web page) or\nsomething completely abstract (like an Alias).\n\nEach specific type of \"thing\" is specifically represented by a subclass\nof the Node base class:  Node.FS.File for files, Node.Alias for aliases,\netc.  Dependency information is kept here in the base class, and\ninformation specific to files/aliases/etc. is in the subclass.  The\ngoal, if we've done this correctly, is that any type of \"thing\" should\nbe able to depend on any other type of \"thing.\"\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Node/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport collections\nimport copy\nfrom itertools import chain\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Executor\nimport SCons.Memoize\nimport SCons.Util\n\nfrom SCons.Debug import Trace\n\ndef classname(obj):\n    return str(obj.__class__).split('.')[-1]\n\n# Set to false if we're doing a dry run. There's more than one of these\n# little treats\ndo_store_info = True\n\n# Node states\n#\n# These are in \"priority\" order, so that the maximum value for any\n# child/dependency of a node represents the state of that node if\n# it has no builder of its own.  The canonical example is a file\n# system directory, which is only up to date if all of its children\n# were up to date.\nno_state = 0\npending = 1\nexecuting = 2\nup_to_date = 3\nexecuted = 4\nfailed = 5\n\nStateString = {\n    0 : \"no_state\",\n    1 : \"pending\",\n    2 : \"executing\",\n    3 : \"up_to_date\",\n    4 : \"executed\",\n    5 : \"failed\",\n}\n\n# controls whether implicit dependencies are cached:\nimplicit_cache = 0\n\n# controls whether implicit dep changes are ignored:\nimplicit_deps_unchanged = 0\n\n# controls whether the cached implicit deps are ignored:\nimplicit_deps_changed = 0\n\n# A variable that can be set to an interface-specific function be called\n# to annotate a Node with information about its creation.\ndef do_nothing(node): pass\n\nAnnotate = do_nothing\n\n# Gets set to 'True' if we're running in interactive mode. Is\n# currently used to release parts of a target's info during\n# clean builds and update runs (see release_target_info).\ninteractive = False\n\n# Classes for signature info for Nodes.\n\nclass NodeInfoBase(object):\n    \"\"\"\n    The generic base class for signature information for a Node.\n\n    Node subclasses should subclass NodeInfoBase to provide their own\n    logic for dealing with their own Node-specific signature information.\n    \"\"\"\n    current_version_id = 1\n    def __init__(self, node=None):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        self._version_id = self.current_version_id\n    def update(self, node):\n        try:\n            field_list = self.field_list\n        except AttributeError:\n            return\n        for f in field_list:\n            try:\n                delattr(self, f)\n            except AttributeError:\n                pass\n            try:\n                func = getattr(node, 'get_' + f)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, f, func())\n    def convert(self, node, val):\n        pass\n    def merge(self, other):\n        self.__dict__.update(other.__dict__)\n    def format(self, field_list=None, names=0):\n        if field_list is None:\n            try:\n                field_list = self.field_list\n            except AttributeError:\n                field_list = sorted(self.__dict__.keys())\n        fields = []\n        for field in field_list:\n            try:\n                f = getattr(self, field)\n            except AttributeError:\n                f = None\n            f = str(f)\n            if names:\n                f = field + ': ' + f\n            fields.append(f)\n        return fields\n\nclass BuildInfoBase(object):\n    \"\"\"\n    The generic base class for build information for a Node.\n\n    This is what gets stored in a .sconsign file for each target file.\n    It contains a NodeInfo instance for this node (signature information\n    that's specific to the type of Node) and direct attributes for the\n    generic build stuff we have to track:  sources, explicit dependencies,\n    implicit dependencies, and action information.\n    \"\"\"\n    current_version_id = 1\n    def __init__(self, node=None):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        self._version_id = self.current_version_id\n        self.bsourcesigs = []\n        self.bdependsigs = []\n        self.bimplicitsigs = []\n        self.bactsig = None\n    def merge(self, other):\n        self.__dict__.update(other.__dict__)\n\nclass Node(object):\n    \"\"\"The base Node class, for entities that we know how to\n    build, or use to build other Nodes.\n    \"\"\"\n\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    memoizer_counters = []\n\n    class Attrs(object):\n        pass\n\n    def __init__(self):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')\n        # Note that we no longer explicitly initialize a self.builder\n        # attribute to None here.  That's because the self.builder\n        # attribute may be created on-the-fly later by a subclass (the\n        # canonical example being a builder to fetch a file from a\n        # source code system like CVS or Subversion).\n\n        # Each list of children that we maintain is accompanied by a\n        # dictionary used to look up quickly whether a node is already\n        # present in the list.  Empirical tests showed that it was\n        # fastest to maintain them as side-by-side Node attributes in\n        # this way, instead of wrapping up each list+dictionary pair in\n        # a class.  (Of course, we could always still do that in the\n        # future if we had a good reason to...).\n        self.sources = []       # source files used to build node\n        self.sources_set = set()\n        self._specific_sources = False\n        self.depends = []       # explicit dependencies (from Depends)\n        self.depends_set = set()\n        self.ignore = []        # dependencies to ignore\n        self.ignore_set = set()\n        self.prerequisites = None\n        self.implicit = None    # implicit (scanned) dependencies (None means not scanned yet)\n        self.waiting_parents = set()\n        self.waiting_s_e = set()\n        self.ref_count = 0\n        self.wkids = None       # Kids yet to walk, when it's an array\n\n        self.env = None\n        self.state = no_state\n        self.precious = None\n        self.pseudo = False\n        self.noclean = 0\n        self.nocache = 0\n        self.cached = 0 # is this node pulled from cache?\n        self.always_build = None\n        self.includes = None\n        self.attributes = self.Attrs() # Generic place to stick information about the Node.\n        self.side_effect = 0 # true iff this node is a side effect\n        self.side_effects = [] # the side effects of building this target\n        self.linked = 0 # is this node linked to the variant directory?\n\n        self.clear_memoized_values()\n\n        # Let the interface in which the build engine is embedded\n        # annotate this Node with its own info (like a description of\n        # what line in what file created the node, for example).\n        Annotate(self)\n\n    def disambiguate(self, must_exist=None):\n        return self\n\n    def get_suffix(self):\n        return ''\n\n    memoizer_counters.append(SCons.Memoize.CountValue('get_build_env'))\n\n    def get_build_env(self):\n        \"\"\"Fetch the appropriate Environment to build this node.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n        result = self.get_executor().get_build_env()\n        self._memo['get_build_env'] = result\n        return result\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the appropriate scanner path for this node.\"\"\"\n        return self.get_executor().get_build_scanner_path(scanner)\n\n    def set_executor(self, executor):\n        \"\"\"Set the action executor for this node.\"\"\"\n        self.executor = executor\n\n    def get_executor(self, create=1):\n        \"\"\"Fetch the action executor for this node.  Create one if\n        there isn't already one, and requested to do so.\"\"\"\n        try:\n            executor = self.executor\n        except AttributeError:\n            if not create:\n                raise\n            try:\n                act = self.builder.action\n            except AttributeError:\n                executor = SCons.Executor.Null(targets=[self])\n            else:\n                executor = SCons.Executor.Executor(act,\n                                                   self.env or self.builder.env,\n                                                   [self.builder.overrides],\n                                                   [self],\n                                                   self.sources)\n            self.executor = executor\n        return executor\n\n    def executor_cleanup(self):\n        \"\"\"Let the executor clean up any cached information.\"\"\"\n        try:\n            executor = self.get_executor(create=None)\n        except AttributeError:\n            pass\n        else:\n            if executor is not None:\n                executor.cleanup()\n\n    def reset_executor(self):\n        \"Remove cached executor; forces recompute when needed.\"\n        try:\n            delattr(self, 'executor')\n        except AttributeError:\n            pass\n\n    def push_to_cache(self):\n        \"\"\"Try to push a node into a cache\n        \"\"\"\n        pass\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        return 0\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        \"\"\"Get a Node ready for evaluation.\n\n        This is called before the Taskmaster decides if the Node is\n        up-to-date or not.  Overriding this method allows for a Node\n        subclass to be disambiguated if necessary, or for an implicit\n        source builder to be attached.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"Prepare for this Node to be built.\n\n        This is called after the Taskmaster has decided that the Node\n        is out-of-date and must be rebuilt, but before actually calling\n        the method to build the Node.\n\n        This default implementation checks that explicit or implicit\n        dependencies either exist or are derived, and initializes the\n        BuildInfo structure that will hold the information about how\n        this node is, uh, built.\n\n        (The existence of source files is checked separately by the\n        Executor, which aggregates checks for all of the targets built\n        by a specific action.)\n\n        Overriding this method allows for for a Node subclass to remove\n        the underlying file from the file system.  Note that subclass\n        methods should call this base class method to get the child\n        check and the BuildInfo structure.\n        \"\"\"\n        if self.depends is not None:\n            for d in self.depends:\n                if d.missing():\n                    msg = \"Explicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (d, self))\n        if self.implicit is not None:\n            for i in self.implicit:\n                if i.missing():\n                    msg = \"Implicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (i, self))\n        self.binfo = self.get_binfo()\n\n    def build(self, **kw):\n        \"\"\"Actually build the node.\n\n        This is called by the Taskmaster after it's decided that the\n        Node is out-of-date and must be rebuilt, and after the prepare()\n        method has gotten everything, uh, prepared.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff\n        in built().\n\n        \"\"\"\n        try:\n            self.get_executor()(self, **kw)\n        except SCons.Errors.BuildError, e:\n            e.node = self\n            raise\n\n    def built(self):\n        \"\"\"Called just after this node is successfully built.\"\"\"\n\n        # Clear the implicit dependency caches of any Nodes\n        # waiting for this Node to be built.\n        for parent in self.waiting_parents:\n            parent.implicit = None\n\n        self.clear()\n\n        if self.pseudo:\n            if self.exists():\n                raise SCons.Errors.UserError(\"Pseudo target \" + str(self) + \" must not exist\")\n        else:\n            if not self.exists() and do_store_info:\n                SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,\n                                    \"Cannot find target \" + str(self) + \" after building\")\n        self.ninfo.update(self)\n\n    def visited(self):\n        \"\"\"Called just after this node has been visited (with or\n        without a build).\"\"\"\n        try:\n            binfo = self.binfo\n        except AttributeError:\n            # Apparently this node doesn't need build info, so\n            # don't bother calculating or storing it.\n            pass\n        else:\n            self.ninfo.update(self)\n            self.store_info()\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n         up-to-date or was built completely.\n\n         This is where we try to release as many target node infos\n         as possible for clean builds and update runs, in order\n         to minimize the overall memory consumption.\n\n         By purging attributes that aren't needed any longer after\n         a Node (=File) got built, we don't have to care that much how\n         many KBytes a Node actually requires...as long as we free\n         the memory shortly afterwards.\n\n         @see: built() and File.release_target_info()\n         \"\"\"\n        pass\n\n    #\n    #\n    #\n\n    def add_to_waiting_s_e(self, node):\n        self.waiting_s_e.add(node)\n\n    def add_to_waiting_parents(self, node):\n        \"\"\"\n        Returns the number of nodes added to our waiting parents list:\n        1 if we add a unique waiting parent, 0 if not.  (Note that the\n        returned values are intended to be used to increment a reference\n        count, so don't think you can \"clean up\" this function by using\n        True and False instead...)\n        \"\"\"\n        wp = self.waiting_parents\n        if node in wp:\n            return 0\n        wp.add(node)\n        return 1\n\n    def postprocess(self):\n        \"\"\"Clean up anything we don't need to hang onto after we've\n        been built.\"\"\"\n        self.executor_cleanup()\n        self.waiting_parents = set()\n\n    def clear(self):\n        \"\"\"Completely clear a Node of all its cached state (so that it\n        can be re-evaluated by interfaces that do continuous integration\n        builds).\n        \"\"\"\n        # The del_binfo() call here isn't necessary for normal execution,\n        # but is for interactive mode, where we might rebuild the same\n        # target and need to start from scratch.\n        self.del_binfo()\n        self.clear_memoized_values()\n        self.ninfo = self.new_ninfo()\n        self.executor_cleanup()\n        try:\n            delattr(self, '_calculated_sig')\n        except AttributeError:\n            pass\n        self.includes = None\n\n    def clear_memoized_values(self):\n        self._memo = {}\n\n    def builder_set(self, builder):\n        self.builder = builder\n        try:\n            del self.executor\n        except AttributeError:\n            pass\n\n    def has_builder(self):\n        \"\"\"Return whether this Node has a builder or not.\n\n        In Boolean tests, this turns out to be a *lot* more efficient\n        than simply examining the builder attribute directly (\"if\n        node.builder: ...\"). When the builder attribute is examined\n        directly, it ends up calling __getattr__ for both the __len__\n        and __nonzero__ attributes on instances of our Builder Proxy\n        class(es), generating a bazillion extra calls and slowing\n        things down immensely.\n        \"\"\"\n        try:\n            b = self.builder\n        except AttributeError:\n            # There was no explicit builder for this Node, so initialize\n            # the self.builder attribute to None now.\n            b = self.builder = None\n        return b is not None\n\n    def set_explicit(self, is_explicit):\n        self.is_explicit = is_explicit\n\n    def has_explicit_builder(self):\n        \"\"\"Return whether this Node has an explicit builder\n\n        This allows an internal Builder created by SCons to be marked\n        non-explicit, so that it can be overridden by an explicit\n        builder that the user supplies (the canonical example being\n        directories).\"\"\"\n        try:\n            return self.is_explicit\n        except AttributeError:\n            self.is_explicit = None\n            return self.is_explicit\n\n    def get_builder(self, default_builder=None):\n        \"\"\"Return the set builder, or a specified default value\"\"\"\n        try:\n            return self.builder\n        except AttributeError:\n            return default_builder\n\n    multiple_side_effect_has_builder = has_builder\n\n    def is_derived(self):\n        \"\"\"\n        Returns true if this node is derived (i.e. built).\n\n        This should return true only for nodes whose path should be in\n        the variant directory when duplicate=0 and should contribute their build\n        signatures when they are used as source files to other derived files. For\n        example: source with source builders are not derived in this sense,\n        and hence should not return true.\n        \"\"\"\n        return self.has_builder() or self.side_effect\n\n    def alter_targets(self):\n        \"\"\"Return a list of alternate targets for this Node.\n        \"\"\"\n        return [], None\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the scanned include lines (implicit dependencies)\n        found in this node.\n\n        The default is no implicit dependencies.  We expect this method\n        to be overridden by any subclass that can be scanned for\n        implicit dependencies.\n        \"\"\"\n        return []\n\n    def get_implicit_deps(self, env, scanner, path):\n        \"\"\"Return a list of implicit dependencies for this node.\n\n        This method exists to handle recursive invocation of the scanner\n        on the implicit dependencies returned by the scanner, if the\n        scanner's recursive flag says that we should.\n        \"\"\"\n        if not scanner:\n            return []\n\n        # Give the scanner a chance to select a more specific scanner\n        # for this Node.\n        #scanner = scanner.select(self)\n\n        nodes = [self]\n        seen = {}\n        seen[self] = 1\n        deps = []\n        while nodes:\n            n = nodes.pop(0)\n            d = [x for x in n.get_found_includes(env, scanner, path) if x not in seen]\n            if d:\n                deps.extend(d)\n                for n in d:\n                    seen[n] = 1\n                nodes.extend(scanner.recurse_nodes(d))\n\n        return deps\n\n    def get_env_scanner(self, env, kw={}):\n        return env.get_scanner(self.scanner_key())\n\n    def get_target_scanner(self):\n        return self.builder.target_scanner\n\n    def get_source_scanner(self, node):\n        \"\"\"Fetch the source scanner for the specified node\n\n        NOTE:  \"self\" is the target being built, \"node\" is\n        the source file for which we want to fetch the scanner.\n\n        Implies self.has_builder() is true; again, expect to only be\n        called from locations where this is already verified.\n\n        This function may be called very often; it attempts to cache\n        the scanner found to improve performance.\n        \"\"\"\n        scanner = None\n        try:\n            scanner = self.builder.source_scanner\n        except AttributeError:\n            pass\n        if not scanner:\n            # The builder didn't have an explicit scanner, so go look up\n            # a scanner from env['SCANNERS'] based on the node's scanner\n            # key (usually the file extension).\n            scanner = self.get_env_scanner(self.get_build_env())\n        if scanner:\n            scanner = scanner.select(node)\n        return scanner\n\n    def add_to_implicit(self, deps):\n        if not hasattr(self, 'implicit') or self.implicit is None:\n            self.implicit = []\n            self.implicit_set = set()\n            self._children_reset()\n        self._add_child(self.implicit, self.implicit_set, deps)\n\n    def scan(self):\n        \"\"\"Scan this node's dependents for implicit dependencies.\"\"\"\n        # Don't bother scanning non-derived files, because we don't\n        # care what their dependencies are.\n        # Don't scan again, if we already have scanned.\n        if self.implicit is not None:\n            return\n        self.implicit = []\n        self.implicit_set = set()\n        self._children_reset()\n        if not self.has_builder():\n            return\n\n        build_env = self.get_build_env()\n        executor = self.get_executor()\n\n        # Here's where we implement --implicit-cache.\n        if implicit_cache and not implicit_deps_changed:\n            implicit = self.get_stored_implicit()\n            if implicit is not None:\n                # We now add the implicit dependencies returned from the\n                # stored .sconsign entry to have already been converted\n                # to Nodes for us.  (We used to run them through a\n                # source_factory function here.)\n\n                # Update all of the targets with them.  This\n                # essentially short-circuits an N*M scan of the\n                # sources for each individual target, which is a hell\n                # of a lot more efficient.\n                for tgt in executor.get_all_targets():\n                    tgt.add_to_implicit(implicit)\n\n                if implicit_deps_unchanged or self.is_up_to_date():\n                    return\n                # one of this node's sources has changed,\n                # so we must recalculate the implicit deps for all targets\n                for tgt in executor.get_all_targets():\n                    tgt.implicit = []\n                    tgt.implicit_set = set()\n\n        # Have the executor scan the sources.\n        executor.scan_sources(self.builder.source_scanner)\n\n        # If there's a target scanner, have the executor scan the target\n        # node itself and associated targets that might be built.\n        scanner = self.get_target_scanner()\n        if scanner:\n            executor.scan_targets(scanner)\n\n    def scanner_key(self):\n        return None\n\n    def select_scanner(self, scanner):\n        \"\"\"Selects a scanner for this Node.\n\n        This is a separate method so it can be overridden by Node\n        subclasses (specifically, Node.FS.Dir) that *must* use their\n        own Scanner and don't select one the Scanner.Selector that's\n        configured for the target.\n        \"\"\"\n        return scanner.select(self)\n\n    def env_set(self, env, safe=0):\n        if safe and self.env:\n            return\n        self.env = env\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    NodeInfo = NodeInfoBase\n    BuildInfo = BuildInfoBase\n\n    def new_ninfo(self):\n        ninfo = self.NodeInfo(self)\n        return ninfo\n\n    def get_ninfo(self):\n        try:\n            return self.ninfo\n        except AttributeError:\n            self.ninfo = self.new_ninfo()\n            return self.ninfo\n\n    def new_binfo(self):\n        binfo = self.BuildInfo(self)\n        return binfo\n\n    def get_binfo(self):\n        \"\"\"\n        Fetch a node's build information.\n\n        node - the node whose sources will be collected\n        cache - alternate node to use for the signature cache\n        returns - the build signature\n\n        This no longer handles the recursive descent of the\n        node's children's signatures.  We expect that they're\n        already built and updated by someone else, if that's\n        what's wanted.\n        \"\"\"\n        try:\n            return self.binfo\n        except AttributeError:\n            pass\n\n        binfo = self.new_binfo()\n        self.binfo = binfo\n\n        executor = self.get_executor()\n        ignore_set = self.ignore_set\n\n        if self.has_builder():\n            binfo.bact = str(executor)\n            binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())\n\n        if self._specific_sources:\n            sources = []\n            for s in self.sources:\n                if s not in ignore_set:\n                    sources.append(s)\n        else:\n            sources = executor.get_unignored_sources(self, self.ignore)\n        seen = set()\n        bsources = []\n        bsourcesigs = []\n        for s in sources:\n            if not s in seen:\n                seen.add(s)\n                bsources.append(s)\n                bsourcesigs.append(s.get_ninfo())\n        binfo.bsources = bsources\n        binfo.bsourcesigs = bsourcesigs\n\n        depends = self.depends\n        dependsigs = []\n        for d in depends:\n            if d not in ignore_set:\n                dependsigs.append(d.get_ninfo())\n        binfo.bdepends = depends\n        binfo.bdependsigs = dependsigs\n\n        implicit = self.implicit or []\n        implicitsigs = []\n        for i in implicit:\n            if i not in ignore_set:\n                implicitsigs.append(i.get_ninfo())\n        binfo.bimplicit = implicit\n        binfo.bimplicitsigs = implicitsigs\n\n        return binfo\n\n    def del_binfo(self):\n        \"\"\"Delete the build info from this node.\"\"\"\n        try:\n            delattr(self, 'binfo')\n        except AttributeError:\n            pass\n\n    def get_csig(self):\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            ninfo = self.get_ninfo()\n            ninfo.csig = SCons.Util.MD5signature(self.get_contents())\n            return self.ninfo.csig\n\n    def get_cachedir_csig(self):\n        return self.get_csig()\n\n    def store_info(self):\n        \"\"\"Make the build signature permanent (that is, store it in the\n        .sconsign file or equivalent).\"\"\"\n        pass\n\n    def do_not_store_info(self):\n        pass\n\n    def get_stored_info(self):\n        return None\n\n    def get_stored_implicit(self):\n        \"\"\"Fetch the stored implicit dependencies\"\"\"\n        return None\n\n    #\n    #\n    #\n\n    def set_precious(self, precious = 1):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.precious = precious\n\n    def set_pseudo(self, pseudo = True):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.pseudo = pseudo\n\n    def set_noclean(self, noclean = 1):\n        \"\"\"Set the Node's noclean value.\"\"\"\n        # Make sure noclean is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.noclean = noclean and 1 or 0\n\n    def set_nocache(self, nocache = 1):\n        \"\"\"Set the Node's nocache value.\"\"\"\n        # Make sure nocache is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.nocache = nocache and 1 or 0\n\n    def set_always_build(self, always_build = 1):\n        \"\"\"Set the Node's always_build value.\"\"\"\n        self.always_build = always_build\n\n    def exists(self):\n        \"\"\"Does this node exists?\"\"\"\n        # All node exist by default:\n        return 1\n\n    def rexists(self):\n        \"\"\"Does this node exist locally or in a repositiory?\"\"\"\n        # There are no repositories by default:\n        return self.exists()\n\n    def missing(self):\n        return not self.is_derived() and \\\n               not self.linked and \\\n               not self.rexists()\n\n    def remove(self):\n        \"\"\"Remove this Node:  no-op by default.\"\"\"\n        return None\n\n    def add_dependency(self, depend):\n        \"\"\"Adds dependencies.\"\"\"\n        try:\n            self._add_child(self.depends, self.depends_set, depend)\n        except TypeError, e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node dependency to %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_prerequisite(self, prerequisite):\n        \"\"\"Adds prerequisites\"\"\"\n        if self.prerequisites is None:\n            self.prerequisites = SCons.Util.UniqueList()\n        self.prerequisites.extend(prerequisite)\n        self._children_reset()\n\n    def add_ignore(self, depend):\n        \"\"\"Adds dependencies to ignore.\"\"\"\n        try:\n            self._add_child(self.ignore, self.ignore_set, depend)\n        except TypeError, e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to ignore a non-Node dependency of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_source(self, source):\n        \"\"\"Adds sources.\"\"\"\n        if self._specific_sources:\n            return\n        try:\n            self._add_child(self.sources, self.sources_set, source)\n        except TypeError, e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node as source of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def _add_child(self, collection, set, child):\n        \"\"\"Adds 'child' to 'collection', first checking 'set' to see if it's\n        already present.\"\"\"\n        #if type(child) is not type([]):\n        #    child = [child]\n        #for c in child:\n        #    if not isinstance(c, Node):\n        #        raise TypeError, c\n        added = None\n        for c in child:\n            if c not in set:\n                set.add(c)\n                collection.append(c)\n                added = 1\n        if added:\n            self._children_reset()\n\n    def set_specific_source(self, source):\n        self.add_source(source)\n        self._specific_sources = True\n\n    def add_wkid(self, wkid):\n        \"\"\"Add a node to the list of kids waiting to be evaluated\"\"\"\n        if self.wkids is not None:\n            self.wkids.append(wkid)\n\n    def _children_reset(self):\n        self.clear_memoized_values()\n        # We need to let the Executor clear out any calculated\n        # build info that it's cached so we can re-calculate it.\n        self.executor_cleanup()\n\n    memoizer_counters.append(SCons.Memoize.CountValue('_children_get'))\n\n    def _children_get(self):\n        try:\n            return self._memo['children_get']\n        except KeyError:\n            pass\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        if self.ignore_set:\n            iter = chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit]))\n\n            children = []\n            for i in iter:\n                if i not in self.ignore_set:\n                    children.append(i)\n        else:\n            children = self.all_children(scan=0)\n\n        self._memo['children_get'] = children\n        return children\n\n    def all_children(self, scan=1):\n        \"\"\"Return a list of all the node's direct children.\"\"\"\n        if scan:\n            self.scan()\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        return list(chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit])))\n\n    def children(self, scan=1):\n        \"\"\"Return a list of the node's direct children, minus those\n        that are ignored by this node.\"\"\"\n        if scan:\n            self.scan()\n        return self._children_get()\n\n    def set_state(self, state):\n        self.state = state\n\n    def get_state(self):\n        return self.state\n\n    def state_has_changed(self, target, prev_ni):\n        return (self.state != SCons.Node.up_to_date)\n\n    def get_env(self):\n        env = self.env\n        if not env:\n            import SCons.Defaults\n            env = SCons.Defaults.DefaultEnvironment()\n        return env\n\n    def changed_since_last_build(self, target, prev_ni):\n        \"\"\"\n\n        Must be overridden in a specific subclass to return True if this\n        Node (a dependency) has changed since the last time it was used\n        to build the specified target.  prev_ni is this Node's state (for\n        example, its file timestamp, length, maybe content signature)\n        as of the last time the target was built.\n\n        Note that this method is called through the dependency, not the\n        target, because a dependency Node must be able to use its own\n        logic to decide if it changed.  For example, File Nodes need to\n        obey if we're configured to use timestamps, but Python Value Nodes\n        never use timestamps and always use the content.  If this method\n        were called through the target, then each Node's implementation\n        of this method would have to have more complicated logic to\n        handle all the different Node types on which it might depend.\n        \"\"\"\n        raise NotImplementedError\n\n    def Decider(self, function):\n        SCons.Util.AddMethod(self, function, 'changed_since_last_build')\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.  The default behavior is to compare\n        it against our own previously stored BuildInfo, but the stored\n        BuildInfo from another Node (typically one in a Repository)\n        can be used instead.\n\n        Note that we now *always* check every dependency.  We used to\n        short-circuit the check by returning as soon as we detected\n        any difference, but we now rely on checking every dependency\n        to make sure that any necessary Node information (for example,\n        the content signature of an #included .h file) is updated.\n\n        The allowcache option was added for supporting the early\n        release of the executor/builder structures, right after\n        a File target was built. When set to true, the return\n        value of this changed method gets cached for File nodes.\n        Like this, the executor isn't needed any longer for subsequent\n        calls to changed().\n\n        @see: FS.File.changed(), FS.File.release_target_info()\n        \"\"\"\n        t = 0\n        if t: Trace('changed(%s [%s], %s)' % (self, classname(self), node))\n        if node is None:\n            node = self\n\n        result = False\n\n        bi = node.get_stored_info().binfo\n        then = bi.bsourcesigs + bi.bdependsigs + bi.bimplicitsigs\n        children = self.children()\n\n        diff = len(children) - len(then)\n        if diff:\n            # The old and new dependency lists are different lengths.\n            # This always indicates that the Node must be rebuilt.\n            # We also extend the old dependency list with enough None\n            # entries to equal the new dependency list, for the benefit\n            # of the loop below that updates node information.\n            then.extend([None] * diff)\n            if t: Trace(': old %s new %s' % (len(then), len(children)))\n            result = True\n\n        for child, prev_ni in zip(children, then):\n            if child.changed_since_last_build(self, prev_ni):\n                if t: Trace(': %s changed' % child)\n                result = True\n\n        contents = self.get_executor().get_contents()\n        if self.has_builder():\n            import SCons.Util\n            newsig = SCons.Util.MD5signature(contents)\n            if bi.bactsig != newsig:\n                if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig))\n                result = True\n\n        if not result:\n            if t: Trace(': up to date')\n\n        if t: Trace('\\n')\n\n        return result\n\n    def is_up_to_date(self):\n        \"\"\"Default check for whether the Node is current: unknown Node\n        subtypes are always out of date, so they will always get built.\"\"\"\n        return None\n\n    def children_are_up_to_date(self):\n        \"\"\"Alternate check for whether the Node is current:  If all of\n        our children were up-to-date, then this Node was up-to-date, too.\n\n        The SCons.Node.Alias and SCons.Node.Python.Value subclasses\n        rebind their current() method to this method.\"\"\"\n        # Allow the children to calculate their signatures.\n        self.binfo = self.get_binfo()\n        if self.always_build:\n            return None\n        state = 0\n        for kid in self.children(None):\n            s = kid.get_state()\n            if s and (not state or s > state):\n                state = s\n        return (state == 0 or state == SCons.Node.up_to_date)\n\n    def is_literal(self):\n        \"\"\"Always pass the string representation of a Node to\n        the command interpreter literally.\"\"\"\n        return 1\n\n    def render_include_tree(self):\n        \"\"\"\n        Return a text representation, suitable for displaying to the\n        user, of the include tree for the sources of this node.\n        \"\"\"\n        if self.is_derived():\n            env = self.get_build_env()\n            if env:\n                for s in self.sources:\n                    scanner = self.get_source_scanner(s)\n                    if scanner:\n                        path = self.get_build_scanner_path(scanner)\n                    else:\n                        path = None\n                    def f(node, env=env, scanner=scanner, path=path):\n                        return node.get_found_includes(env, scanner, path)\n                    return SCons.Util.render_tree(s, f, 1)\n        else:\n            return None\n\n    def get_abspath(self):\n        \"\"\"\n        Return an absolute path to the Node.  This will return simply\n        str(Node) by default, but for Node types that have a concept of\n        relative path, this might return something different.\n        \"\"\"\n        return str(self)\n\n    def for_signature(self):\n        \"\"\"\n        Return a string representation of the Node that will always\n        be the same for this particular Node, no matter what.  This\n        is by contrast to the __str__() method, which might, for\n        instance, return a relative path for a file Node.  The purpose\n        of this method is to generate a value to be used in signature\n        calculation for the command line used to build a target, and\n        we use this method instead of str() to avoid unnecessary\n        rebuilds.  This method does not need to return something that\n        would actually work in a command line; it can return any kind of\n        nonsense, so long as it does not change.\n        \"\"\"\n        return str(self)\n\n    def get_string(self, for_signature):\n        \"\"\"This is a convenience function designed primarily to be\n        used in command generators (i.e., CommandGeneratorActions or\n        Environment variables that are callable), which are called\n        with a for_signature argument that is nonzero if the command\n        generator is being called to generate a signature for the\n        command line, which determines if we should rebuild or not.\n\n        Such command generators should use this method in preference\n        to str(Node) when converting a Node to a string, passing\n        in the for_signature parameter, such that we will call\n        Node.for_signature() or str(Node) properly, depending on whether\n        we are calculating a signature or actually constructing a\n        command line.\"\"\"\n        if for_signature:\n            return self.for_signature()\n        return str(self)\n\n    def get_subst_proxy(self):\n        \"\"\"\n        This method is expected to return an object that will function\n        exactly like this Node, except that it implements any additional\n        special features that we would like to be in effect for\n        Environment variable substitution.  The principle use is that\n        some Nodes would like to implement a __getattr__() method,\n        but putting that in the Node type itself has a tendency to kill\n        performance.  We instead put it in a proxy and return it from\n        this method.  It is legal for this method to return self\n        if no new functionality is needed for Environment substitution.\n        \"\"\"\n        return self\n\n    def explain(self):\n        if not self.exists():\n            return \"building `%s' because it doesn't exist\\n\" % self\n\n        if self.always_build:\n            return \"rebuilding `%s' because AlwaysBuild() is specified\\n\" % self\n\n        old = self.get_stored_info()\n        if old is None:\n            return None\n\n        old = old.binfo\n        old.prepare_dependencies()\n\n        try:\n            old_bkids    = old.bsources    + old.bdepends    + old.bimplicit\n            old_bkidsigs = old.bsourcesigs + old.bdependsigs + old.bimplicitsigs\n        except AttributeError:\n            return \"Cannot explain why `%s' is being rebuilt: No previous build information found\\n\" % self\n\n        new = self.get_binfo()\n\n        new_bkids    = new.bsources    + new.bdepends    + new.bimplicit\n        new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs\n\n        osig = dict(zip(old_bkids, old_bkidsigs))\n        nsig = dict(zip(new_bkids, new_bkidsigs))\n\n        # The sources and dependencies we'll want to report are all stored\n        # as relative paths to this target's directory, but we want to\n        # report them relative to the top-level SConstruct directory,\n        # so we only print them after running them through this lambda\n        # to turn them into the right relative Node and then return\n        # its string.\n        def stringify( s, E=self.dir.Entry ) :\n            if hasattr( s, 'dir' ) :\n                return str(E(s))\n            return str(s)\n\n        lines = []\n\n        removed = [x for x in old_bkids if not x in new_bkids]\n        if removed:\n            removed = list(map(stringify, removed))\n            fmt = \"`%s' is no longer a dependency\\n\"\n            lines.extend([fmt % s for s in removed])\n\n        for k in new_bkids:\n            if not k in old_bkids:\n                lines.append(\"`%s' is a new dependency\\n\" % stringify(k))\n            elif k.changed_since_last_build(self, osig[k]):\n                lines.append(\"`%s' changed\\n\" % stringify(k))\n\n        if len(lines) == 0 and old_bkids != new_bkids:\n            lines.append(\"the dependency order changed:\\n\" +\n                         \"%sold: %s\\n\" % (' '*15, list(map(stringify, old_bkids))) +\n                         \"%snew: %s\\n\" % (' '*15, list(map(stringify, new_bkids))))\n\n        if len(lines) == 0:\n            def fmt_with_title(title, strlines):\n                lines = strlines.split('\\n')\n                sep = '\\n' + ' '*(15 + len(title))\n                return ' '*15 + title + sep.join(lines) + '\\n'\n            if old.bactsig != new.bactsig:\n                if old.bact == new.bact:\n                    lines.append(\"the contents of the build action changed\\n\" +\n                                 fmt_with_title('action: ', new.bact))\n                else:\n                    lines.append(\"the build action changed:\\n\" +\n                                 fmt_with_title('old: ', old.bact) +\n                                 fmt_with_title('new: ', new.bact))\n\n        if len(lines) == 0:\n            return \"rebuilding `%s' for unknown reasons\\n\" % self\n\n        preamble = \"rebuilding `%s' because\" % self\n        if len(lines) == 1:\n            return \"%s %s\"  % (preamble, lines[0])\n        else:\n            lines = [\"%s:\\n\" % preamble] + lines\n            return ( ' '*11).join(lines)\n\nclass NodeList(collections.UserList):\n    def __str__(self):\n        return str(list(map(str, self.data)))\n\ndef get_children(node, parent): return node.children()\ndef ignore_cycle(node, stack): pass\ndef do_nothing(node, parent): pass\n\nclass Walker(object):\n    \"\"\"An iterator for walking a Node tree.\n\n    This is depth-first, children are visited before the parent.\n    The Walker object can be initialized with any node, and\n    returns the next node on the descent with each get_next() call.\n    'kids_func' is an optional function that will be called to\n    get the children of a node instead of calling 'children'.\n    'cycle_func' is an optional function that will be called\n    when a cycle is detected.\n\n    This class does not get caught in node cycles caused, for example,\n    by C header file include loops.\n    \"\"\"\n    def __init__(self, node, kids_func=get_children,\n                             cycle_func=ignore_cycle,\n                             eval_func=do_nothing):\n        self.kids_func = kids_func\n        self.cycle_func = cycle_func\n        self.eval_func = eval_func\n        node.wkids = copy.copy(kids_func(node, None))\n        self.stack = [node]\n        self.history = {} # used to efficiently detect and avoid cycles\n        self.history[node] = None\n\n    def get_next(self):\n        \"\"\"Return the next node for this walk of the tree.\n\n        This function is intentionally iterative, not recursive,\n        to sidestep any issues of stack size limitations.\n        \"\"\"\n\n        while self.stack:\n            if self.stack[-1].wkids:\n                node = self.stack[-1].wkids.pop(0)\n                if not self.stack[-1].wkids:\n                    self.stack[-1].wkids = None\n                if node in self.history:\n                    self.cycle_func(node, self.stack)\n                else:\n                    node.wkids = copy.copy(self.kids_func(node, self.stack[-1]))\n                    self.stack.append(node)\n                    self.history[node] = None\n            else:\n                node = self.stack.pop()\n                del self.history[node]\n                if node:\n                    if self.stack:\n                        parent = self.stack[-1]\n                    else:\n                        parent = None\n                    self.eval_func(node, parent)\n                return node\n        return None\n\n    def is_done(self):\n        return not self.stack\n\n\narg2nodes_lookups = []\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/BoolOption.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/BoolOption.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nwarned = False\n\ndef BoolOption(*args, **kw):\n    global warned\n    if not warned:\n        msg = \"The BoolOption() function is deprecated; use the BoolVariable() function instead.\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n        warned = True\n    return SCons.Variables.BoolVariable(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/EnumOption.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/EnumOption.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nwarned = False\n\ndef EnumOption(*args, **kw):\n    global warned\n    if not warned:\n        msg = \"The EnumOption() function is deprecated; use the EnumVariable() function instead.\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n        warned = True\n    return SCons.Variables.EnumVariable(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/ListOption.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/ListOption.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nwarned = False\n\ndef ListOption(*args, **kw):\n    global warned\n    if not warned:\n        msg = \"The ListOption() function is deprecated; use the ListVariable() function instead.\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n        warned = True\n    return SCons.Variables.ListVariable(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/PackageOption.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/PackageOption.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nwarned = False\n\ndef PackageOption(*args, **kw):\n    global warned\n    if not warned:\n        msg = \"The PackageOption() function is deprecated; use the PackageVariable() function instead.\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n        warned = True\n    return SCons.Variables.PackageVariable(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/PathOption.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/PathOption.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nwarned = False\n\nclass _PathOptionClass(object):\n    def warn(self):\n        global warned\n        if not warned:\n            msg = \"The PathOption() function is deprecated; use the PathVariable() function instead.\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n            warned = True\n\n    def __call__(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable(*args, **kw)\n\n    def PathAccept(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable.PathAccept(*args, **kw)\n\n    def PathIsDir(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable.PathIsDir(*args, **kw)\n\n    def PathIsDirCreate(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable.PathIsDirCreate(*args, **kw)\n\n    def PathIsFile(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable.PathIsFile(*args, **kw)\n\n    def PathExists(self, *args, **kw):\n        self.warn()\n        return SCons.Variables.PathVariable.PathExists(*args, **kw)\n\nPathOption = _PathOptionClass()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Options/__init__.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Options/__init__.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Options module hierarchy\n\nThis is for backwards compatibility.  The new equivalent is the Variables/\nclass hierarchy.  These will have deprecation warnings added (some day),\nand will then be removed entirely (some day).\n\"\"\"\n\nimport SCons.Variables\nimport SCons.Warnings\n\nfrom BoolOption import BoolOption  # okay\nfrom EnumOption import EnumOption  # okay\nfrom ListOption import ListOption  # naja\nfrom PackageOption import PackageOption # naja\nfrom PathOption import PathOption # okay\n\nwarned = False\n\nclass Options(SCons.Variables.Variables):\n    def __init__(self, *args, **kw):\n        global warned\n        if not warned:\n            msg = \"The Options class is deprecated; use the Variables class instead.\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)\n            warned = True\n        SCons.Variables.Variables.__init__(self, *args, **kw)\n\n    def AddOptions(self, *args, **kw):\n        return SCons.Variables.Variables.AddVariables(self, *args, **kw)\n\n    def UnknownOptions(self, *args, **kw):\n        return SCons.Variables.Variables.UnknownVariables(self, *args, **kw)\n\n    def FormatOptionHelpText(self, *args, **kw):\n        return SCons.Variables.Variables.FormatVariableHelpText(self, *args,\n                     **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/PathList.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/PathList.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"SCons.PathList\n\nA module for handling lists of directory paths (the sort of things\nthat get set as CPPPATH, LIBPATH, etc.) with as much caching of data and\nefficiency as we can while still keeping the evaluation delayed so that we\nDo the Right Thing (almost) regardless of how the variable is specified.\n\n\"\"\"\n\nimport os\n\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Util\n\n#\n# Variables to specify the different types of entries in a PathList object:\n#\n\nTYPE_STRING_NO_SUBST = 0        # string with no '$'\nTYPE_STRING_SUBST = 1           # string containing '$'\nTYPE_OBJECT = 2                 # other object\n\ndef node_conv(obj):\n    \"\"\"\n    This is the \"string conversion\" routine that we have our substitutions\n    use to return Nodes, not strings.  This relies on the fact that an\n    EntryProxy object has a get() method that returns the underlying\n    Node that it wraps, which is a bit of architectural dependence\n    that we might need to break or modify in the future in response to\n    additional requirements.\n    \"\"\"\n    try:\n        get = obj.get\n    except AttributeError:\n        if isinstance(obj, SCons.Node.Node) or SCons.Util.is_Sequence( obj ):\n            result = obj\n        else:\n            result = str(obj)\n    else:\n        result = get()\n    return result\n\nclass _PathList(object):\n    \"\"\"\n    An actual PathList object.\n    \"\"\"\n    def __init__(self, pathlist):\n        \"\"\"\n        Initializes a PathList object, canonicalizing the input and\n        pre-processing it for quicker substitution later.\n\n        The stored representation of the PathList is a list of tuples\n        containing (type, value), where the \"type\" is one of the TYPE_*\n        variables defined above.  We distinguish between:\n\n            strings that contain no '$' and therefore need no\n            delayed-evaluation string substitution (we expect that there\n            will be many of these and that we therefore get a pretty\n            big win from avoiding string substitution)\n\n            strings that contain '$' and therefore need substitution\n            (the hard case is things like '${TARGET.dir}/include',\n            which require re-evaluation for every target + source)\n\n            other objects (which may be something like an EntryProxy\n            that needs a method called to return a Node)\n\n        Pre-identifying the type of each element in the PathList up-front\n        and storing the type in the list of tuples is intended to reduce\n        the amount of calculation when we actually do the substitution\n        over and over for each target.\n        \"\"\"\n        if SCons.Util.is_String(pathlist):\n            pathlist = pathlist.split(os.pathsep)\n        elif not SCons.Util.is_Sequence(pathlist):\n            pathlist = [pathlist]\n\n        pl = []\n        for p in pathlist:\n            try:\n                index = p.find('$')\n            except (AttributeError, TypeError):\n                type = TYPE_OBJECT\n            else:\n                if index == -1:\n                    type = TYPE_STRING_NO_SUBST\n                else:\n                    type = TYPE_STRING_SUBST\n            pl.append((type, p))\n\n        self.pathlist = tuple(pl)\n\n    def __len__(self): return len(self.pathlist)\n\n    def __getitem__(self, i): return self.pathlist[i]\n\n    def subst_path(self, env, target, source):\n        \"\"\"\n        Performs construction variable substitution on a pre-digested\n        PathList for a specific target and source.\n        \"\"\"\n        result = []\n        for type, value in self.pathlist:\n            if type == TYPE_STRING_SUBST:\n                value = env.subst(value, target=target, source=source,\n                                  conv=node_conv)\n                if SCons.Util.is_Sequence(value):\n                    result.extend(SCons.Util.flatten(value))\n                elif value:\n                    result.append(value)\n            elif type == TYPE_OBJECT:\n                value = node_conv(value)\n                if value:\n                    result.append(value)\n            elif value:\n                result.append(value)\n        return tuple(result)\n\n\nclass PathListCache(object):\n    \"\"\"\n    A class to handle caching of PathList lookups.\n\n    This class gets instantiated once and then deleted from the namespace,\n    so it's used as a Singleton (although we don't enforce that in the\n    usual Pythonic ways).  We could have just made the cache a dictionary\n    in the module namespace, but putting it in this class allows us to\n    use the same Memoizer pattern that we use elsewhere to count cache\n    hits and misses, which is very valuable.\n\n    Lookup keys in the cache are computed by the _PathList_key() method.\n    Cache lookup should be quick, so we don't spend cycles canonicalizing\n    all forms of the same lookup key.  For example, 'x:y' and ['x',\n    'y'] logically represent the same list, but we don't bother to\n    split string representations and treat those two equivalently.\n    (Note, however, that we do, treat lists and tuples the same.)\n\n    The main type of duplication we're trying to catch will come from\n    looking up the same path list from two different clones of the\n    same construction environment.  That is, given\n\n        env2 = env1.Clone()\n\n    both env1 and env2 will have the same CPPPATH value, and we can\n    cheaply avoid re-parsing both values of CPPPATH by using the\n    common value from this cache.\n    \"\"\"\n    if SCons.Memoize.use_memoizer:\n        __metaclass__ = SCons.Memoize.Memoized_Metaclass\n\n    memoizer_counters = []\n\n    def __init__(self):\n        self._memo = {}\n\n    def _PathList_key(self, pathlist):\n        \"\"\"\n        Returns the key for memoization of PathLists.\n\n        Note that we want this to be pretty quick, so we don't completely\n        canonicalize all forms of the same list.  For example,\n        'dir1:$ROOT/dir2' and ['$ROOT/dir1', 'dir'] may logically\n        represent the same list if you're executing from $ROOT, but\n        we're not going to bother splitting strings into path elements,\n        or massaging strings into Nodes, to identify that equivalence.\n        We just want to eliminate obvious redundancy from the normal\n        case of re-using exactly the same cloned value for a path.\n        \"\"\"\n        if SCons.Util.is_Sequence(pathlist):\n            pathlist = tuple(SCons.Util.flatten(pathlist))\n        return pathlist\n\n    memoizer_counters.append(SCons.Memoize.CountDict('PathList', _PathList_key))\n\n    def PathList(self, pathlist):\n        \"\"\"\n        Returns the cached _PathList object for the specified pathlist,\n        creating and caching a new object as necessary.\n        \"\"\"\n        pathlist = self._PathList_key(pathlist)\n        try:\n            memo_dict = self._memo['PathList']\n        except KeyError:\n            memo_dict = {}\n            self._memo['PathList'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        result = _PathList(pathlist)\n\n        memo_dict[pathlist] = result\n\n        return result\n\nPathList = PathListCache().PathList\n\n\ndel PathListCache\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/__init__.py",
    "content": "\"\"\"SCons.Platform\n\nSCons platform selection.\n\nThis looks for modules that define a callable object that can modify a\nconstruction environment as appropriate for a given platform.\n\nNote that we take a more simplistic view of \"platform\" than Python does.\nWe're looking for a single string that determines a set of\ntool-independent variables with which to initialize a construction\nenvironment.  Consequently, we'll examine both sys.platform and os.name\n(and anything else that might come in to play) in order to return some\nspecification which is unique enough for our purposes.\n\nNote that because this subsysem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"platform specification\" in an arbitrary callable function.\nNo one needs to use or tie in to this subsystem in order to roll\ntheir own platform definition.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport imp\nimport os\nimport sys\nimport tempfile\n\nimport SCons.Errors\nimport SCons.Subst\nimport SCons.Tool\n\ndef platform_default():\n    \"\"\"Return the platform string for our execution environment.\n\n    The returned value should map to one of the SCons/Platform/*.py\n    files.  Since we're architecture independent, though, we don't\n    care about the machine architecture.\n    \"\"\"\n    osname = os.name\n    if osname == 'java':\n        osname = os._osType\n    if osname == 'posix':\n        if sys.platform == 'cygwin':\n            return 'cygwin'\n        elif sys.platform.find('irix') != -1:\n            return 'irix'\n        elif sys.platform.find('sunos') != -1:\n            return 'sunos'\n        elif sys.platform.find('hp-ux') != -1:\n            return 'hpux'\n        elif sys.platform.find('aix') != -1:\n            return 'aix'\n        elif sys.platform.find('darwin') != -1:\n            return 'darwin'\n        else:\n            return 'posix'\n    elif os.name == 'os2':\n        return 'os2'\n    else:\n        return sys.platform\n\ndef platform_module(name = platform_default()):\n    \"\"\"Return the imported module for the platform.\n\n    This looks for a module name that matches the specified argument.\n    If the name is unspecified, we fetch the appropriate default for\n    our execution environment.\n    \"\"\"\n    full_name = 'SCons.Platform.' + name\n    if full_name not in sys.modules:\n        if os.name == 'java':\n            eval(full_name)\n        else:\n            try:\n                file, path, desc = imp.find_module(name,\n                                        sys.modules['SCons.Platform'].__path__)\n                try:\n                    mod = imp.load_module(full_name, file, path, desc)\n                finally:\n                    if file:\n                        file.close()\n            except ImportError:\n                try:\n                    import zipimport\n                    importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] )\n                    mod = importer.load_module(full_name)\n                except ImportError:\n                    raise SCons.Errors.UserError(\"No platform named '%s'\" % name)\n            setattr(SCons.Platform, name, mod)\n    return sys.modules[full_name]\n\ndef DefaultToolList(platform, env):\n    \"\"\"Select a default tool list for the specified platform.\n    \"\"\"\n    return SCons.Tool.tool_list(platform, env)\n\nclass PlatformSpec(object):\n    def __init__(self, name, generate):\n        self.name = name\n        self.generate = generate\n\n    def __call__(self, *args, **kw):\n        return self.generate(*args, **kw)\n\n    def __str__(self):\n        return self.name\n\nclass TempFileMunge(object):\n    \"\"\"A callable class.  You can set an Environment variable to this,\n    then call it with a string argument, then it will perform temporary\n    file substitution on it.  This is used to circumvent the long command\n    line limitation.\n\n    Example usage:\n    env[\"TEMPFILE\"] = TempFileMunge\n    env[\"LINKCOM\"] = \"${TEMPFILE('$LINK $TARGET $SOURCES')}\"\n\n    By default, the name of the temporary file used begins with a\n    prefix of '@'.  This may be configred for other tool chains by\n    setting '$TEMPFILEPREFIX'.\n\n    env[\"TEMPFILEPREFIX\"] = '-@'        # diab compiler\n    env[\"TEMPFILEPREFIX\"] = '-via'      # arm tool chain\n    \"\"\"\n    def __init__(self, cmd):\n        self.cmd = cmd\n\n    def __call__(self, target, source, env, for_signature):\n        if for_signature:\n            # If we're being called for signature calculation, it's\n            # because we're being called by the string expansion in\n            # Subst.py, which has the logic to strip any $( $) that\n            # may be in the command line we squirreled away.  So we\n            # just return the raw command line and let the upper\n            # string substitution layers do their thing.\n            return self.cmd\n\n        # Now we're actually being called because someone is actually\n        # going to try to execute the command, so we have to do our\n        # own expansion.\n        cmd = env.subst_list(self.cmd, SCons.Subst.SUBST_CMD, target, source)[0]\n        try:\n            maxline = int(env.subst('$MAXLINELENGTH'))\n        except ValueError:\n            maxline = 2048\n\n        length = 0\n        for c in cmd:\n            length += len(c)\n        if length <= maxline:\n            return self.cmd\n\n        # We do a normpath because mktemp() has what appears to be\n        # a bug in Windows that will use a forward slash as a path\n        # delimiter.  Windows's link mistakes that for a command line\n        # switch and barfs.\n        #\n        # We use the .lnk suffix for the benefit of the Phar Lap\n        # linkloc linker, which likes to append an .lnk suffix if\n        # none is given.\n        (fd, tmp) = tempfile.mkstemp('.lnk', text=True)\n        native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp))\n\n        if env['SHELL'] and env['SHELL'] == 'sh':\n            # The sh shell will try to escape the backslashes in the\n            # path, so unescape them.\n            native_tmp = native_tmp.replace('\\\\', r'\\\\\\\\')\n            # In Cygwin, we want to use rm to delete the temporary\n            # file, because del does not exist in the sh shell.\n            rm = env.Detect('rm') or 'del'\n        else:\n            # Don't use 'rm' if the shell is not sh, because rm won't\n            # work with the Windows shells (cmd.exe or command.com) or\n            # Windows path names.\n            rm = 'del'\n\n        prefix = env.subst('$TEMPFILEPREFIX')\n        if not prefix:\n            prefix = '@'\n\n        args = list(map(SCons.Subst.quote_spaces, cmd[1:]))\n        os.write(fd, \"\\n\".join(args) + \"\\n\")\n        os.close(fd)\n        # XXX Using the SCons.Action.print_actions value directly\n        # like this is bogus, but expedient.  This class should\n        # really be rewritten as an Action that defines the\n        # __call__() and strfunction() methods and lets the\n        # normal action-execution logic handle whether or not to\n        # print/execute the action.  The problem, though, is all\n        # of that is decided before we execute this method as\n        # part of expanding the $TEMPFILE construction variable.\n        # Consequently, refactoring this will have to wait until\n        # we get more flexible with allowing Actions to exist\n        # independently and get strung together arbitrarily like\n        # Ant tasks.  In the meantime, it's going to be more\n        # user-friendly to not let obsession with architectural\n        # purity get in the way of just being helpful, so we'll\n        # reach into SCons.Action directly.\n        if SCons.Action.print_actions:\n            print(\"Using tempfile \"+native_tmp+\" for command line:\\n\"+\n                  str(cmd[0]) + \" \" + \" \".join(args))\n        return [ cmd[0], prefix + native_tmp + '\\n' + rm, native_tmp ]\n\ndef Platform(name = platform_default()):\n    \"\"\"Select a canned Platform specification.\n    \"\"\"\n    module = platform_module(name)\n    spec = PlatformSpec(name, module.generate)\n    return spec\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/aix.py",
    "content": "\"\"\"engine.SCons.Platform.aix\n\nPlatform-specific initialization for IBM AIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/aix.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport subprocess\n\nimport posix\n\nimport SCons.Util\nimport SCons.Action\n\ndef get_xlc(env, xlc=None, packages=[]):\n    # Use the AIX package installer tool lslpp to figure out where a\n    # given xl* compiler is installed and what version it is.\n    xlcPath = None\n    xlcVersion = None\n\n    if xlc is None:\n        xlc = env.get('CC', 'xlc')\n    if SCons.Util.is_List(xlc):\n        xlc = xlc[0]\n    for package in packages:\n        # find the installed filename, which may be a symlink as well\n        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],\n                stdin = 'devnull',\n                stderr = 'devnull',\n                stdout = subprocess.PIPE)\n        # output of lslpp is something like this:\n        #     #Path:Fileset:File\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc\n        for line in pipe.stdout:\n            if xlcPath:\n                continue # read everything to let lslpp terminate\n            fileset, filename = line.split(':')[1:3]\n            filename = filename.split()[0]\n            if ('/' in xlc and filename == xlc) \\\n            or ('/' not in xlc and filename.endswith('/' + xlc)):\n                xlcVersion = fileset.split()[1]\n                xlcPath, sep, xlc = filename.rpartition('/')\n            pass\n        pass\n    return (xlcPath, xlc, xlcVersion)\n\ndef generate(env):\n    posix.generate(env)\n    #Based on AIX 5.2: ARG_MAX=24576 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 21576\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/cygwin.py",
    "content": "\"\"\"SCons.Platform.cygwin\n\nPlatform-specific initialization for Cygwin systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/cygwin.py  2014/07/05 09:42:21 garyo\"\n\nimport posix\nfrom SCons.Platform import TempFileMunge\n\ndef generate(env):\n    posix.generate(env)\n\n    env['PROGPREFIX']  = ''\n    env['PROGSUFFIX']  = '.exe'\n    env['SHLIBPREFIX'] = ''\n    env['SHLIBSUFFIX'] = '.dll'\n    env['LIBPREFIXES'] = [ '$LIBPREFIX', '$SHLIBPREFIX' ]\n    env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['TEMPFILE']    = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/darwin.py",
    "content": "\"\"\"engine.SCons.Platform.darwin\n\nPlatform-specific initialization for Mac OS X systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/darwin.py  2014/07/05 09:42:21 garyo\"\n\nimport posix\nimport os\n\ndef generate(env):\n    posix.generate(env)\n    env['SHLIBSUFFIX'] = '.dylib'\n    # put macports paths at front to override Apple's versions, fink path is after\n    # For now let people who want Macports or Fink tools specify it!\n    # env['ENV']['PATH'] = '/opt/local/bin:/opt/local/sbin:' + env['ENV']['PATH'] + ':/sw/bin'\n\n    # Store extra system paths in env['ENV']['PATHOSX']\n\n    filelist = ['/etc/paths',]\n    # make sure this works on Macs with Tiger or earlier\n    try:\n        dirlist = os.listdir('/etc/paths.d')\n    except:\n        dirlist = []\n\n    for file in dirlist:\n        filelist.append('/etc/paths.d/'+file)\n\n    for file in filelist:\n        if os.path.isfile(file):\n            f = open(file, 'r')\n            lines = f.readlines()\n            for line in lines:\n                if line:\n                    env.AppendENVPath('PATHOSX', line.strip('\\n'))\n            f.close()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/hpux.py",
    "content": "\"\"\"engine.SCons.Platform.hpux\n\nPlatform-specific initialization for HP-UX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/hpux.py  2014/07/05 09:42:21 garyo\"\n\nimport posix\n\ndef generate(env):\n    posix.generate(env)\n    #Based on HP-UX11i: ARG_MAX=2048000 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 2045000\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/irix.py",
    "content": "\"\"\"SCons.Platform.irix\n\nPlatform-specific initialization for SGI IRIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/irix.py  2014/07/05 09:42:21 garyo\"\n\nimport posix\n\ndef generate(env):\n    posix.generate(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/os2.py",
    "content": "\"\"\"SCons.Platform.os2\n\nPlatform-specific initialization for OS/2 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/os2.py  2014/07/05 09:42:21 garyo\"\nimport win32\n\ndef generate(env):\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = '$LIBPREFIX'\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['HOST_OS']        = 'os2'\n    env['HOST_ARCH']      = win32.get_architecture().arch\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/posix.py",
    "content": "\"\"\"SCons.Platform.posix\n\nPlatform-specific initialization for POSIX (Linux, UNIX, etc.) systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/posix.py  2014/07/05 09:42:21 garyo\"\n\nimport errno\nimport os\nimport os.path\nimport subprocess\nimport sys\nimport select\n\nimport SCons.Util\nfrom SCons.Platform import TempFileMunge\n\nexitvalmap = {\n    2 : 127,\n    13 : 126,\n}\n\ndef escape(arg):\n    \"escape shell special characters\"\n    slash = '\\\\'\n    special = '\"$()'\n\n    arg = arg.replace(slash, slash+slash)\n    for c in special:\n        arg = arg.replace(c, slash+c)\n\n    return '\"' + arg + '\"'\n\ndef exec_subprocess(l, env):\n    proc = subprocess.Popen(l, env = env, close_fds = True)\n    return proc.wait()\n\ndef subprocess_spawn(sh, escape, cmd, args, env):\n    return exec_subprocess([sh, '-c', ' '.join(args)], env)\n\ndef exec_popen3(l, env, stdout, stderr):\n    proc = subprocess.Popen(l, env = env, close_fds = True,\n                            stdout = stdout,\n                            stderr = stderr)\n    return proc.wait()\n\ndef piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # spawn using Popen3 combined with the env command\n    # the command name and the command's stdout is written to stdout\n    # the command's stderr is written to stderr\n    return exec_popen3([sh, '-c', ' '.join(args)],\n                       env, stdout, stderr)\n\n\ndef generate(env):\n    # Bearing in mind we have python 2.4 as a baseline, we can just do this:\n    spawn = subprocess_spawn\n    pspawn = piped_env_spawn\n    # Note that this means that 'escape' is no longer used\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['ENV']['PATH']    = '/usr/local/bin:/opt/bin:/bin:/usr/bin'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.o'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = ''\n    env['LIBPREFIX']      = 'lib'\n    env['LIBSUFFIX']      = '.a'\n    env['SHLIBPREFIX']    = '$LIBPREFIX'\n    env['SHLIBSUFFIX']    = '.so'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['PSPAWN']         = pspawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = 'sh'\n    env['ESCAPE']         = escape\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion\n    #Note: specific platforms might rise or lower this value\n    env['MAXLINELENGTH']  = 128072\n\n    # This platform supports RPATH specifications.\n    env['__RPATH'] = '$_RPATH'\n\n    # GDC is GCC family, but DMD and LDC have different options.\n    # Must be able to have GCC and DMD work in the same build, so:\n    env['__DRPATH'] = '$_DRPATH'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/sunos.py",
    "content": "\"\"\"engine.SCons.Platform.sunos\n\nPlatform-specific initialization for Sun systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/sunos.py  2014/07/05 09:42:21 garyo\"\n\nimport posix\n\ndef generate(env):\n    posix.generate(env)\n    # Based on sunSparc 8:32bit\n    # ARG_MAX=1048320 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 1045320\n    env['PKGINFO'] = 'pkginfo'\n    env['PKGCHK'] = '/usr/sbin/pkgchk'\n    env['ENV']['PATH'] = env['ENV']['PATH'] + ':/opt/SUNWspro/bin:/usr/ccs/bin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Platform/win32.py",
    "content": "\"\"\"SCons.Platform.win32\n\nPlatform-specific initialization for Win32 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/win32.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\nimport sys\nimport tempfile\n\nfrom SCons.Platform.posix import exitvalmap\nfrom SCons.Platform import TempFileMunge\nimport SCons.Util\n\ntry:\n    import msvcrt\n    import win32api\n    import win32con\n\n    msvcrt.get_osfhandle\n    win32api.SetHandleInformation\n    win32con.HANDLE_FLAG_INHERIT\nexcept ImportError:\n    parallel_msg = \\\n        \"you do not seem to have the pywin32 extensions installed;\\n\" + \\\n        \"\\tparallel (-j) builds may not work reliably with open Python files.\"\nexcept AttributeError:\n    parallel_msg = \\\n        \"your pywin32 extensions do not support file handle operations;\\n\" + \\\n        \"\\tparallel (-j) builds may not work reliably with open Python files.\"\nelse:\n    parallel_msg = None\n\n    import builtins\n\n    _builtin_file = builtins.file\n    _builtin_open = builtins.open\n\n    class _scons_file(_builtin_file):\n        def __init__(self, *args, **kw):\n            _builtin_file.__init__(self, *args, **kw)\n            win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),\n                win32con.HANDLE_FLAG_INHERIT, 0)\n\n    def _scons_open(*args, **kw):\n        fp = _builtin_open(*args, **kw)\n        win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()),\n                                      win32con.HANDLE_FLAG_INHERIT,\n                                      0)\n        return fp\n\n    builtins.file = _scons_file\n    builtins.open = _scons_open\n\ntry:\n    import threading\n    spawn_lock = threading.Lock()\n\n    # This locked version of spawnve works around a Windows\n    # MSVCRT bug, because its spawnve is not thread-safe.\n    # Without this, python can randomly crash while using -jN.\n    # See the python bug at http://bugs.python.org/issue6476\n    # and SCons issue at\n    # http://scons.tigris.org/issues/show_bug.cgi?id=2449\n    def spawnve(mode, file, args, env):\n        spawn_lock.acquire()\n        try:\n            if mode == os.P_WAIT:\n                ret = os.spawnve(os.P_NOWAIT, file, args, env)\n            else:\n                ret = os.spawnve(mode, file, args, env)\n        finally:\n            spawn_lock.release()\n        if mode == os.P_WAIT:\n            pid, status = os.waitpid(ret, 0)\n            ret = status >> 8\n        return ret\nexcept ImportError:\n    # Use the unsafe method of spawnve.\n    # Please, don't try to optimize this try-except block\n    # away by assuming that the threading module is always present.\n    # In the test test/option-j.py we intentionally call SCons with\n    # a fake threading.py that raises an import exception right away,\n    # simulating a non-existent package.\n    def spawnve(mode, file, args, env):\n        return os.spawnve(mode, file, args, env)\n\n# The upshot of all this is that, if you are using Python 1.5.2,\n# you had better have cmd or command.com in your PATH when you run\n# scons.\n\ndef piped_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # There is no direct way to do that in python. What we do\n    # here should work for most cases:\n    #   In case stdout (stderr) is not redirected to a file,\n    #   we redirect it into a temporary file tmpFileStdout\n    #   (tmpFileStderr) and copy the contents of this file\n    #   to stdout (stderr) given in the argument\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n    else:\n        # one temporary file for stdout and stderr\n        tmpFileStdout, tmpFileStdoutName = tempfile.mkstemp(text=True)\n        os.close(tmpFileStdout)\n        tmpFileStderr, tmpFileStderrname = tempfile.mkstemp(text=True)\n        os.close(tmpFileStderr)\n\n        # check if output is redirected\n        stdoutRedirected = 0\n        stderrRedirected = 0\n        for arg in args:\n            # are there more possibilities to redirect stdout ?\n            if (arg.find( \">\", 0, 1 ) != -1 or\n                arg.find( \"1>\", 0, 2 ) != -1):\n                stdoutRedirected = 1\n            # are there more possibilities to redirect stderr ?\n            if arg.find( \"2>\", 0, 2 ) != -1:\n                stderrRedirected = 1\n\n        # redirect output of non-redirected streams to our tempfiles\n        if stdoutRedirected == 0:\n            args.append(\">\" + str(tmpFileStdoutName))\n        if stderrRedirected == 0:\n            args.append(\"2>\" + str(tmpFileStderrname))\n\n        # actually do the spawn\n        try:\n            args = [sh, '/C', escape(' '.join(args)) ]\n            ret = spawnve(os.P_WAIT, sh, args, env)\n        except OSError, e:\n            # catch any error\n            try:\n                ret = exitvalmap[e[0]]\n            except KeyError:\n                sys.stderr.write(\"scons: unknown OSError exception code %d - %s: %s\\n\" % (e[0], cmd, e[1]))\n            if stderr is not None:\n                stderr.write(\"scons: %s: %s\\n\" % (cmd, e[1]))\n        # copy child output from tempfiles to our streams\n        # and do clean up stuff\n        if stdout is not None and stdoutRedirected == 0:\n            try:\n                stdout.write(open( tmpFileStdout, \"r\" ).read())\n                os.remove( tmpFileStdout )\n            except (IOError, OSError):\n                pass\n\n        if stderr is not None and stderrRedirected == 0:\n            try:\n                stderr.write(open( tmpFileStderr, \"r\" ).read())\n                os.remove( tmpFileStderr )\n            except (IOError, OSError):\n                pass\n        return ret\n\ndef exec_spawn(l, env):\n    try:\n        result = spawnve(os.P_WAIT, l[0], l, env)\n    except OSError, e:\n        try:\n            result = exitvalmap[e[0]]\n            sys.stderr.write(\"scons: %s: %s\\n\" % (l[0], e[1]))\n        except KeyError:\n            result = 127\n            if len(l) > 2:\n                if len(l[2]) < 1000:\n                    command = ' '.join(l[0:3])\n                else:\n                    command = l[0]\n            else:\n                command = l[0]\n            sys.stderr.write(\"scons: unknown OSError exception code %d - '%s': %s\\n\" % (e[0], command, e[1]))\n    return result\n\ndef spawn(sh, escape, cmd, args, env):\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n    return exec_spawn([sh, '/C', escape(' '.join(args))], env)\n\n# Windows does not allow special characters in file names anyway, so no\n# need for a complex escape function, we will just quote the arg, except\n# that \"cmd /c\" requires that if an argument ends with a backslash it\n# needs to be escaped so as not to interfere with closing double quote\n# that we add.\ndef escape(x):\n    if x[-1] == '\\\\':\n        x = x + '\\\\'\n    return '\"' + x + '\"'\n\n# Get the windows system directory name\n_system_root = None\n\ndef get_system_root():\n    global _system_root\n    if _system_root is not None:\n        return _system_root\n\n    # A resonable default if we can't read the registry\n    val = os.environ.get('SystemRoot', \"C:\\\\WINDOWS\")\n\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n    _system_root = val\n    return val\n\n# Get the location of the program files directory\ndef get_program_files_dir():\n    # Now see if we can look in the registry...\n    val = ''\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows Program Files directory\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir')\n        except SCons.Util.RegError:\n            val = ''\n            pass\n\n    if val == '':\n        # A reasonable default if we can't read the registry\n        # (Actually, it's pretty reasonable even if we can :-)\n        val = os.path.join(os.path.dirname(get_system_root()),\"Program Files\")\n\n    return val\n\n\n\n# Determine which windows CPU were running on.\nclass ArchDefinition(object):\n    \"\"\"\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\ndef get_architecture(arch=None):\n    \"\"\"Returns the definition for the specified architecture string.\n\n    If no string is specified, the system default is returned (as defined\n    by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment\n    variables).\n    \"\"\"\n    if arch is None:\n        arch = os.environ.get('PROCESSOR_ARCHITEW6432')\n        if not arch:\n            arch = os.environ.get('PROCESSOR_ARCHITECTURE')\n    return SupportedArchitectureMap.get(arch, ArchDefinition('', ['']))\n\ndef generate(env):\n    # Attempt to find cmd.exe (for WinNT/2k/XP) or\n    # command.com for Win9x\n    cmd_interp = ''\n    # First see if we can look in the registry...\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            cmd_interp = os.path.join(val, 'System32\\\\cmd.exe')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                              'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n                cmd_interp = os.path.join(val, 'command.com')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n\n    # For the special case of not having access to the registry, we\n    # use a temporary path and pathext to attempt to find the command\n    # interpreter.  If we fail, we try to find the interpreter through\n    # the env's PATH.  The problem with that is that it might not\n    # contain an ENV and a PATH.\n    if not cmd_interp:\n        systemroot = get_system_root()\n        tmp_path = systemroot + os.pathsep + \\\n                   os.path.join(systemroot,'System32')\n        tmp_pathext = '.com;.exe;.bat;.cmd'\n        if 'PATHEXT' in os.environ:\n            tmp_pathext = os.environ['PATHEXT']\n        cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext)\n        if not cmd_interp:\n            cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext)\n\n    if not cmd_interp:\n        cmd_interp = env.Detect('cmd')\n        if not cmd_interp:\n            cmd_interp = env.Detect('command')\n\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n\n    # Import things from the external environment to the construction\n    # environment's ENV.  This is a potential slippery slope, because we\n    # *don't* want to make builds dependent on the user's environment by\n    # default.  We're doing this for SystemRoot, though, because it's\n    # needed for anything that uses sockets, and seldom changes, and\n    # for SystemDrive because it's related.\n    #\n    # Weigh the impact carefully before adding other variables to this list.\n    import_env = [ 'SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]\n    for var in import_env:\n        v = os.environ.get(var)\n        if v:\n            env['ENV'][var] = v\n\n    if 'COMSPEC' not in env['ENV']:\n        v = os.environ.get(\"COMSPEC\")\n        if v:\n            env['ENV']['COMSPEC'] = v\n\n    env.AppendENVPath('PATH', get_system_root() + '\\System32')\n\n    env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX' ]\n    env['PSPAWN']         = piped_spawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = cmd_interp\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n    env['ESCAPE']         = escape\n\n    env['HOST_OS']        = 'win32'\n    env['HOST_ARCH']      = get_architecture().arch\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/SConf.py",
    "content": "\"\"\"SCons.SConf\n\nAutoconf-like configuration support.\n\nIn other words, this package allows to run series of tests to detect\ncapabilities of current system and generate config files (header files\nin C/C++) that turn on system-specific options and optimizations.\n\nFor example, it is possible to detect if optional libraries are present\non current system and generate config that makes compiler include them.\nC compilers do not have ability to catch ImportError if some library is\nnot found, so these checks should be done externally.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/SConf.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport io\nimport os\nimport re\nimport sys\nimport traceback\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node.FS\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Conftest\n\nfrom SCons.Debug import Trace\n\n# Turn off the Conftest error logging\nSCons.Conftest.LogInputFiles = 0\nSCons.Conftest.LogErrorMessages = 0\n\n# Set\nbuild_type = None\nbuild_types = ['clean', 'help']\n\ndef SetBuildType(type):\n    global build_type\n    build_type = type\n\n# to be set, if we are in dry-run mode\ndryrun = 0\n\nAUTO=0  # use SCons dependency scanning for up-to-date checks\nFORCE=1 # force all tests to be rebuilt\nCACHE=2 # force all tests to be taken from cache (raise an error, if necessary)\ncache_mode = AUTO\n\ndef SetCacheMode(mode):\n    \"\"\"Set the Configure cache mode. mode must be one of \"auto\", \"force\",\n    or \"cache\".\"\"\"\n    global cache_mode\n    if mode == \"auto\":\n        cache_mode = AUTO\n    elif mode == \"force\":\n        cache_mode = FORCE\n    elif mode == \"cache\":\n        cache_mode = CACHE\n    else:\n        raise ValueError(\"SCons.SConf.SetCacheMode: Unknown mode \" + mode)\n\nprogress_display = SCons.Util.display # will be overwritten by SCons.Script\ndef SetProgressDisplay(display):\n    \"\"\"Set the progress display to use (called from SCons.Script)\"\"\"\n    global progress_display\n    progress_display = display\n\nSConfFS = None\n\n_ac_build_counter = 0 # incremented, whenever TryBuild is called\n_ac_config_logs = {}  # all config.log files created in this build\n_ac_config_hs   = {}  # all config.h files created in this build\nsconf_global = None   # current sconf object\n\ndef _createConfigH(target, source, env):\n    t = open(str(target[0]), \"w\")\n    defname = re.sub('[^A-Za-z0-9_]', '_', str(target[0]).upper())\n    t.write(\"\"\"#ifndef %(DEFNAME)s_SEEN\n#define %(DEFNAME)s_SEEN\n\n\"\"\" % {'DEFNAME' : defname})\n    t.write(source[0].get_contents())\n    t.write(\"\"\"\n#endif /* %(DEFNAME)s_SEEN */\n\"\"\" % {'DEFNAME' : defname})\n    t.close()\n\ndef _stringConfigH(target, source, env):\n    return \"scons: Configure: creating \" + str(target[0])\n\n\ndef NeedConfigHBuilder():\n    if len(_ac_config_hs) == 0:\n       return False\n    else:\n       return True\n\ndef CreateConfigHBuilder(env):\n    \"\"\"Called if necessary just before the building targets phase begins.\"\"\"\n    action = SCons.Action.Action(_createConfigH,\n                                 _stringConfigH)\n    sconfigHBld = SCons.Builder.Builder(action=action)\n    env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )\n    for k in _ac_config_hs.keys():\n        env.SConfigHBuilder(k, env.Value(_ac_config_hs[k]))\n\n\nclass SConfWarning(SCons.Warnings.Warning):\n    pass\nSCons.Warnings.enableWarningClass(SConfWarning)\n\n# some error definitions\nclass SConfError(SCons.Errors.UserError):\n    def __init__(self,msg):\n        SCons.Errors.UserError.__init__(self,msg)\n\nclass ConfigureDryRunError(SConfError):\n    \"\"\"Raised when a file or directory needs to be updated during a Configure\n    process, but the user requested a dry-run\"\"\"\n    def __init__(self,target):\n        if not isinstance(target, SCons.Node.FS.File):\n            msg = 'Cannot create configure directory \"%s\" within a dry-run.' % str(target)\n        else:\n            msg = 'Cannot update configure test \"%s\" within a dry-run.' % str(target)\n        SConfError.__init__(self,msg)\n\nclass ConfigureCacheError(SConfError):\n    \"\"\"Raised when a use explicitely requested the cache feature, but the test\n    is run the first time.\"\"\"\n    def __init__(self,target):\n        SConfError.__init__(self, '\"%s\" is not yet built and cache is forced.' % str(target))\n\n# define actions for building text files\ndef _createSource( target, source, env ):\n    fd = open(str(target[0]), \"w\")\n    fd.write(source[0].get_contents())\n    fd.close()\ndef _stringSource( target, source, env ):\n    return (str(target[0]) + ' <-\\n  |' +\n            source[0].get_contents().replace( '\\n', \"\\n  |\" ) )\n\nclass SConfBuildInfo(SCons.Node.FS.FileBuildInfo):\n    \"\"\"\n    Special build info for targets of configure tests. Additional members\n    are result (did the builder succeed last time?) and string, which\n    contains messages of the original build phase.\n    \"\"\"\n    result = None # -> 0/None -> no error, != 0 error\n    string = None # the stdout / stderr output when building the target\n\n    def set_build_result(self, result, string):\n        self.result = result\n        self.string = string\n\n\nclass Streamer(object):\n    \"\"\"\n    'Sniffer' for a file-like writable object. Similar to the unix tool tee.\n    \"\"\"\n    def __init__(self, orig):\n        self.orig = orig\n        self.s = io.StringIO()\n\n    def write(self, str):\n        if self.orig:\n            self.orig.write(str)\n        try:\n            self.s.write(str)\n        except TypeError as e:\n            if e.message.startswith('unicode argument expected'):\n                self.s.write(str.decode())\n            else:\n                raise\n\n    def writelines(self, lines):\n        for l in lines:\n            self.write(l + '\\n')\n\n    def getvalue(self):\n        \"\"\"\n        Return everything written to orig since the Streamer was created.\n        \"\"\"\n        return self.s.getvalue()\n\n    def flush(self):\n        if self.orig:\n            self.orig.flush()\n        self.s.flush()\n\n\nclass SConfBuildTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"\n    This is almost the same as SCons.Script.BuildTask. Handles SConfErrors\n    correctly and knows about the current cache_mode.\n    \"\"\"\n    def display(self, message):\n        if sconf_global.logstream:\n            sconf_global.logstream.write(\"scons: Configure: \" + message + \"\\n\")\n\n    def display_cached_string(self, bi):\n        \"\"\"\n        Logs the original builder messages, given the SConfBuildInfo instance\n        bi.\n        \"\"\"\n        if not isinstance(bi, SConfBuildInfo):\n            SCons.Warnings.warn(SConfWarning,\n              \"The stored build information has an unexpected class: %s\" % bi.__class__)\n        else:\n            self.display(\"The original builder output was:\\n\" +\n                         (\"  |\" + str(bi.string)).replace(\"\\n\", \"\\n  |\"))\n\n    def failed(self):\n        # check, if the reason was a ConfigureDryRunError or a\n        # ConfigureCacheError and if yes, reraise the exception\n        exc_type = self.exc_info()[0]\n        if issubclass(exc_type, SConfError):\n            raise\n        elif issubclass(exc_type, SCons.Errors.BuildError):\n            # we ignore Build Errors (occurs, when a test doesn't pass)\n            # Clear the exception to prevent the contained traceback\n            # to build a reference cycle.\n            self.exc_clear()\n        else:\n            self.display('Caught exception while building \"%s\":\\n' %\n                         self.targets[0])\n            try:\n                excepthook = sys.excepthook\n            except AttributeError:\n                # Earlier versions of Python don't have sys.excepthook...\n                def excepthook(type, value, tb):\n                    traceback.print_tb(tb)\n                    print type, value\n            excepthook(*self.exc_info())\n        return SCons.Taskmaster.Task.failed(self)\n\n    def collect_node_states(self):\n        # returns (is_up_to_date, cached_error, cachable)\n        # where is_up_to_date is 1, if the node(s) are up_to_date\n        #       cached_error  is 1, if the node(s) are up_to_date, but the\n        #                           build will fail\n        #       cachable      is 0, if some nodes are not in our cache\n        T = 0\n        changed = False\n        cached_error = False\n        cachable = True\n        for t in self.targets:\n            if T: Trace('%s' % (t))\n            bi = t.get_stored_info().binfo\n            if isinstance(bi, SConfBuildInfo):\n                if T: Trace(': SConfBuildInfo')\n                if cache_mode == CACHE:\n                    t.set_state(SCons.Node.up_to_date)\n                    if T: Trace(': set_state(up_to-date)')\n                else:\n                    if T: Trace(': get_state() %s' % t.get_state())\n                    if T: Trace(': changed() %s' % t.changed())\n                    if (t.get_state() != SCons.Node.up_to_date and t.changed()):\n                        changed = True\n                    if T: Trace(': changed %s' % changed)\n                cached_error = cached_error or bi.result\n            else:\n                if T: Trace(': else')\n                # the node hasn't been built in a SConf context or doesn't\n                # exist\n                cachable = False\n                changed = ( t.get_state() != SCons.Node.up_to_date )\n                if T: Trace(': changed %s' % changed)\n        if T: Trace('\\n')\n        return (not changed, cached_error, cachable)\n\n    def execute(self):\n        if not self.targets[0].has_builder():\n            return\n\n        sconf = sconf_global\n\n        is_up_to_date, cached_error, cachable = self.collect_node_states()\n\n        if cache_mode == CACHE and not cachable:\n            raise ConfigureCacheError(self.targets[0])\n        elif cache_mode == FORCE:\n            is_up_to_date = 0\n\n        if cached_error and is_up_to_date:\n            self.display(\"Building \\\"%s\\\" failed in a previous run and all \"\n                         \"its sources are up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n            raise SCons.Errors.BuildError # will be 'caught' in self.failed\n        elif is_up_to_date:\n            self.display(\"\\\"%s\\\" is up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n        elif dryrun:\n            raise ConfigureDryRunError(self.targets[0])\n        else:\n            # note stdout and stderr are the same here\n            s = sys.stdout = sys.stderr = Streamer(sys.stdout)\n            try:\n                env = self.targets[0].get_build_env()\n                if cache_mode == FORCE:\n                    # Set up the Decider() to force rebuilds by saying\n                    # that every source has changed.  Note that we still\n                    # call the environment's underlying source decider so\n                    # that the correct .sconsign info will get calculated\n                    # and keep the build state consistent.\n                    def force_build(dependency, target, prev_ni,\n                                    env_decider=env.decide_source):\n                        env_decider(dependency, target, prev_ni)\n                        return True\n                    if env.decide_source.func_code is not force_build.func_code:\n                        env.Decider(force_build)\n                env['PSTDOUT'] = env['PSTDERR'] = s\n                try:\n                    sconf.cached = 0\n                    self.targets[0].build()\n                finally:\n                    sys.stdout = sys.stderr = env['PSTDOUT'] = \\\n                                 env['PSTDERR'] = sconf.logstream\n            except KeyboardInterrupt:\n                raise\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code)\n            except Exception, e:\n                for t in self.targets:\n                    binfo = t.get_binfo()\n                    binfo.__class__ = SConfBuildInfo\n                    binfo.set_build_result(1, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n                raise e\n            else:\n                for t in self.targets:\n                    binfo = t.get_binfo()\n                    binfo.__class__ = SConfBuildInfo\n                    binfo.set_build_result(0, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n\nclass SConfBase(object):\n    \"\"\"This is simply a class to represent a configure context. After\n    creating a SConf object, you can call any tests. After finished with your\n    tests, be sure to call the Finish() method, which returns the modified\n    environment.\n    Some words about caching: In most cases, it is not necessary to cache\n    Test results explicitely. Instead, we use the scons dependency checking\n    mechanism. For example, if one wants to compile a test program\n    (SConf.TryLink), the compiler is only called, if the program dependencies\n    have changed. However, if the program could not be compiled in a former\n    SConf run, we need to explicitely cache this error.\n    \"\"\"\n\n    def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR',\n                 log_file='$CONFIGURELOG', config_h = None, _depth = 0):\n        \"\"\"Constructor. Pass additional tests in the custom_tests-dictinary,\n        e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest\n        defines a custom test.\n        Note also the conf_dir and log_file arguments (you may want to\n        build tests in the VariantDir, not in the SourceDir)\n        \"\"\"\n        global SConfFS\n        if not SConfFS:\n            SConfFS = SCons.Node.FS.default_fs or \\\n                      SCons.Node.FS.FS(env.fs.pathTop)\n        if sconf_global is not None:\n            raise SCons.Errors.UserError\n        self.env = env\n        if log_file is not None:\n            log_file = SConfFS.File(env.subst(log_file))\n        self.logfile = log_file\n        self.logstream = None\n        self.lastTarget = None\n        self.depth = _depth\n        self.cached = 0 # will be set, if all test results are cached\n\n        # add default tests\n        default_tests = {\n                 'CheckCC'            : CheckCC,\n                 'CheckCXX'           : CheckCXX,\n                 'CheckSHCC'          : CheckSHCC,\n                 'CheckSHCXX'         : CheckSHCXX,\n                 'CheckFunc'          : CheckFunc,\n                 'CheckType'          : CheckType,\n                 'CheckTypeSize'      : CheckTypeSize,\n                 'CheckDeclaration'   : CheckDeclaration,\n                 'CheckHeader'        : CheckHeader,\n                 'CheckCHeader'       : CheckCHeader,\n                 'CheckCXXHeader'     : CheckCXXHeader,\n                 'CheckLib'           : CheckLib,\n                 'CheckLibWithHeader' : CheckLibWithHeader,\n               }\n        self.AddTests(default_tests)\n        self.AddTests(custom_tests)\n        self.confdir = SConfFS.Dir(env.subst(conf_dir))\n        if config_h is not None:\n            config_h = SConfFS.File(config_h)\n        self.config_h = config_h\n        self._startup()\n\n    def Finish(self):\n        \"\"\"Call this method after finished with your tests:\n                env = sconf.Finish()\n        \"\"\"\n        self._shutdown()\n        return self.env\n\n    def Define(self, name, value = None, comment = None):\n        \"\"\"\n        Define a pre processor symbol name, with the optional given value in the\n        current config header.\n\n        If value is None (default), then #define name is written. If value is not\n        none, then #define name value is written.\n\n        comment is a string which will be put as a C comment in the\n        header, to explain the meaning of the value (appropriate C comments /* and\n        */ will be put automatically.\"\"\"\n        lines = []\n        if comment:\n            comment_str = \"/* %s */\" % comment\n            lines.append(comment_str)\n\n        if value is not None:\n            define_str = \"#define %s %s\" % (name, value)\n        else:\n            define_str = \"#define %s\" % name\n        lines.append(define_str)\n        lines.append('')\n\n        self.config_h_text = self.config_h_text + '\\n'.join(lines)\n\n    def BuildNodes(self, nodes):\n        \"\"\"\n        Tries to build the given nodes immediately. Returns 1 on success,\n        0 on error.\n        \"\"\"\n        if self.logstream is not None:\n            # override stdout / stderr to write in log file\n            oldStdout = sys.stdout\n            sys.stdout = self.logstream\n            oldStderr = sys.stderr\n            sys.stderr = self.logstream\n\n        # the engine assumes the current path is the SConstruct directory ...\n        old_fs_dir = SConfFS.getcwd()\n        old_os_dir = os.getcwd()\n        SConfFS.chdir(SConfFS.Top, change_os_dir=1)\n\n        # Because we take responsibility here for writing out our\n        # own .sconsign info (see SConfBuildTask.execute(), above),\n        # we override the store_info() method with a null place-holder\n        # so we really control how it gets written.\n        for n in nodes:\n            n.store_info = n.do_not_store_info\n            if not hasattr(n, 'attributes'):\n                n.attributes = SCons.Node.Node.Attrs()\n            n.attributes.keep_targetinfo = 1\n\n        ret = 1\n\n        try:\n            # ToDo: use user options for calc\n            save_max_drift = SConfFS.get_max_drift()\n            SConfFS.set_max_drift(0)\n            tm = SCons.Taskmaster.Taskmaster(nodes, SConfBuildTask)\n            # we don't want to build tests in parallel\n            jobs = SCons.Job.Jobs(1, tm )\n            jobs.run()\n            for n in nodes:\n                state = n.get_state()\n                if (state != SCons.Node.executed and\n                    state != SCons.Node.up_to_date):\n                    # the node could not be built. we return 0 in this case\n                    ret = 0\n        finally:\n            SConfFS.set_max_drift(save_max_drift)\n            os.chdir(old_os_dir)\n            SConfFS.chdir(old_fs_dir, change_os_dir=0)\n            if self.logstream is not None:\n                # restore stdout / stderr\n                sys.stdout = oldStdout\n                sys.stderr = oldStderr\n        return ret\n\n    def pspawn_wrapper(self, sh, escape, cmd, args, env):\n        \"\"\"Wrapper function for handling piped spawns.\n\n        This looks to the calling interface (in Action.py) like a \"normal\"\n        spawn, but associates the call with the PSPAWN variable from\n        the construction environment and with the streams to which we\n        want the output logged.  This gets slid into the construction\n        environment as the SPAWN variable so Action.py doesn't have to\n        know or care whether it's spawning a piped command or not.\n        \"\"\"\n        return self.pspawn(sh, escape, cmd, args, env, self.logstream, self.logstream)\n\n\n    def TryBuild(self, builder, text = None, extension = \"\"):\n        \"\"\"Low level TryBuild implementation. Normally you don't need to\n        call that - you can use TryCompile / TryLink / TryRun instead\n        \"\"\"\n        global _ac_build_counter\n\n        # Make sure we have a PSPAWN value, and save the current\n        # SPAWN value.\n        try:\n            self.pspawn = self.env['PSPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing PSPAWN construction variable.')\n        try:\n            save_spawn = self.env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n\n        nodesToBeBuilt = []\n\n        f = \"conftest_\" + str(_ac_build_counter)\n        pref = self.env.subst( builder.builder.prefix )\n        suff = self.env.subst( builder.builder.suffix )\n        target = self.confdir.File(pref + f + suff)\n\n        try:\n            # Slide our wrapper into the construction environment as\n            # the SPAWN function.\n            self.env['SPAWN'] = self.pspawn_wrapper\n            sourcetext = self.env.Value(text)\n\n            if text is not None:\n                textFile = self.confdir.File(f + extension)\n                textFileNode = self.env.SConfSourceBuilder(target=textFile,\n                                                           source=sourcetext)\n                nodesToBeBuilt.extend(textFileNode)\n                source = textFileNode\n            else:\n                source = None\n\n            nodes = builder(target = target, source = source)\n            if not SCons.Util.is_List(nodes):\n                nodes = [nodes]\n            nodesToBeBuilt.extend(nodes)\n            result = self.BuildNodes(nodesToBeBuilt)\n\n        finally:\n            self.env['SPAWN'] = save_spawn\n\n        _ac_build_counter = _ac_build_counter + 1\n        if result:\n            self.lastTarget = nodes[0]\n        else:\n            self.lastTarget = None\n\n        return result\n\n    def TryAction(self, action, text = None, extension = \"\"):\n        \"\"\"Tries to execute the given action with optional source file\n        contents <text> and optional source file extension <extension>,\n        Returns the status (0 : failed, 1 : ok) and the contents of the\n        output file.\n        \"\"\"\n        builder = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS = {'SConfActionBuilder' : builder} )\n        ok = self.TryBuild(self.env.SConfActionBuilder, text, extension)\n        del self.env['BUILDERS']['SConfActionBuilder']\n        if ok:\n            outputStr = self.lastTarget.get_contents()\n            return (1, outputStr)\n        return (0, \"\")\n\n    def TryCompile( self, text, extension):\n        \"\"\"Compiles the program given in text to an env.Object, using extension\n        as file extension (e.g. '.c'). Returns 1, if compilation was\n        successful, 0 otherwise. The target is saved in self.lastTarget (for\n        further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Object, text, extension)\n\n    def TryLink( self, text, extension ):\n        \"\"\"Compiles the program given in text to an executable env.Program,\n        using extension as file extension (e.g. '.c'). Returns 1, if\n        compilation was successful, 0 otherwise. The target is saved in\n        self.lastTarget (for further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Program, text, extension )\n\n    def TryRun(self, text, extension ):\n        \"\"\"Compiles and runs the program given in text, using extension\n        as file extension (e.g. '.c'). Returns (1, outputStr) on success,\n        (0, '') otherwise. The target (a file containing the program's stdout)\n        is saved in self.lastTarget (for further processing).\n        \"\"\"\n        ok = self.TryLink(text, extension)\n        if( ok ):\n            prog = self.lastTarget\n            pname = prog.path\n            output = self.confdir.File(os.path.basename(pname)+'.out')\n            node = self.env.Command(output, prog, [ [ pname, \">\", \"${TARGET}\"] ])\n            ok = self.BuildNodes(node)\n            if ok:\n                outputStr = output.get_contents()\n                return( 1, outputStr)\n        return (0, \"\")\n\n    class TestWrapper(object):\n        \"\"\"A wrapper around Tests (to ensure sanity)\"\"\"\n        def __init__(self, test, sconf):\n            self.test = test\n            self.sconf = sconf\n        def __call__(self, *args, **kw):\n            if not self.sconf.active:\n                raise SCons.Errors.UserError\n            context = CheckContext(self.sconf)\n            ret = self.test(context, *args, **kw)\n            if self.sconf.config_h is not None:\n                self.sconf.config_h_text = self.sconf.config_h_text + context.config_h\n            context.Result(\"error: no result\")\n            return ret\n\n    def AddTest(self, test_name, test_instance):\n        \"\"\"Adds test_class to this SConf instance. It can be called with\n        self.test_name(...)\"\"\"\n        setattr(self, test_name, SConfBase.TestWrapper(test_instance, self))\n\n    def AddTests(self, tests):\n        \"\"\"Adds all the tests given in the tests dictionary to this SConf\n        instance\n        \"\"\"\n        for name in tests.keys():\n            self.AddTest(name, tests[name])\n\n    def _createDir( self, node ):\n        dirName = str(node)\n        if dryrun:\n            if not os.path.isdir( dirName ):\n                raise ConfigureDryRunError(dirName)\n        else:\n            if not os.path.isdir( dirName ):\n                os.makedirs( dirName )\n                node._exists = 1\n\n    def _startup(self):\n        \"\"\"Private method. Set up logstream, and set the environment\n        variables necessary for a piped build\n        \"\"\"\n        global _ac_config_logs\n        global sconf_global\n        global SConfFS\n\n        self.lastEnvFs = self.env.fs\n        self.env.fs = SConfFS\n        self._createDir(self.confdir)\n        self.confdir.up().add_ignore( [self.confdir] )\n\n        if self.logfile is not None and not dryrun:\n            # truncate logfile, if SConf.Configure is called for the first time\n            # in a build\n            if self.logfile in _ac_config_logs:\n                log_mode = \"a\"\n            else:\n                _ac_config_logs[self.logfile] = None\n                log_mode = \"w\"\n            fp = open(str(self.logfile), log_mode)\n            self.logstream = SCons.Util.Unbuffered(fp)\n            # logfile may stay in a build directory, so we tell\n            # the build system not to override it with a eventually\n            # existing file with the same name in the source directory\n            self.logfile.dir.add_ignore( [self.logfile] )\n\n            tb = traceback.extract_stack()[-3-self.depth]\n            old_fs_dir = SConfFS.getcwd()\n            SConfFS.chdir(SConfFS.Top, change_os_dir=0)\n            self.logstream.write('file %s,line %d:\\n\\tConfigure(confdir = %s)\\n' %\n                                 (tb[0], tb[1], str(self.confdir)) )\n            SConfFS.chdir(old_fs_dir)\n        else:\n            self.logstream = None\n        # we use a special builder to create source files from TEXT\n        action = SCons.Action.Action(_createSource,\n                                     _stringSource)\n        sconfSrcBld = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS={'SConfSourceBuilder':sconfSrcBld} )\n        self.config_h_text = _ac_config_hs.get(self.config_h, \"\")\n        self.active = 1\n        # only one SConf instance should be active at a time ...\n        sconf_global = self\n\n    def _shutdown(self):\n        \"\"\"Private method. Reset to non-piped spawn\"\"\"\n        global sconf_global, _ac_config_hs\n\n        if not self.active:\n            raise SCons.Errors.UserError(\"Finish may be called only once!\")\n        if self.logstream is not None and not dryrun:\n            self.logstream.write(\"\\n\")\n            self.logstream.close()\n            self.logstream = None\n        # remove the SConfSourceBuilder from the environment\n        blds = self.env['BUILDERS']\n        del blds['SConfSourceBuilder']\n        self.env.Replace( BUILDERS=blds )\n        self.active = 0\n        sconf_global = None\n        if not self.config_h is None:\n            _ac_config_hs[self.config_h] = self.config_h_text\n        self.env.fs = self.lastEnvFs\n\nclass CheckContext(object):\n    \"\"\"Provides a context for configure tests. Defines how a test writes to the\n    screen and log file.\n\n    A typical test is just a callable with an instance of CheckContext as\n    first argument:\n\n    def CheckCustom(context, ...)\n    context.Message('Checking my weird test ... ')\n    ret = myWeirdTestFunction(...)\n    context.Result(ret)\n\n    Often, myWeirdTestFunction will be one of\n    context.TryCompile/context.TryLink/context.TryRun. The results of\n    those are cached, for they are only rebuild, if the dependencies have\n    changed.\n    \"\"\"\n\n    def __init__(self, sconf):\n        \"\"\"Constructor. Pass the corresponding SConf instance.\"\"\"\n        self.sconf = sconf\n        self.did_show_result = 0\n\n        # for Conftest.py:\n        self.vardict = {}\n        self.havedict = {}\n        self.headerfilename = None\n        self.config_h = \"\" # config_h text will be stored here\n        # we don't regenerate the config.h file after each test. That means,\n        # that tests won't be able to include the config.h file, and so\n        # they can't do an #ifdef HAVE_XXX_H. This shouldn't be a major\n        # issue, though. If it turns out, that we need to include config.h\n        # in tests, we must ensure, that the dependencies are worked out\n        # correctly. Note that we can't use Conftest.py's support for config.h,\n        # cause we will need to specify a builder for the config.h file ...\n\n    def Message(self, text):\n        \"\"\"Inform about what we are doing right now, e.g.\n        'Checking for SOMETHING ... '\n        \"\"\"\n        self.Display(text)\n        self.sconf.cached = 1\n        self.did_show_result = 0\n\n    def Result(self, res):\n        \"\"\"Inform about the result of the test. If res is not a string, displays\n        'yes' or 'no' depending on whether res is evaluated as true or false.\n        The result is only displayed when self.did_show_result is not set.\n        \"\"\"\n        if isinstance(res, str):\n            text = res\n        elif res:\n            text = \"yes\"\n        else:\n            text = \"no\"\n\n        if self.did_show_result == 0:\n            # Didn't show result yet, do it now.\n            self.Display(text + \"\\n\")\n            self.did_show_result = 1\n\n    def TryBuild(self, *args, **kw):\n        return self.sconf.TryBuild(*args, **kw)\n\n    def TryAction(self, *args, **kw):\n        return self.sconf.TryAction(*args, **kw)\n\n    def TryCompile(self, *args, **kw):\n        return self.sconf.TryCompile(*args, **kw)\n\n    def TryLink(self, *args, **kw):\n        return self.sconf.TryLink(*args, **kw)\n\n    def TryRun(self, *args, **kw):\n        return self.sconf.TryRun(*args, **kw)\n\n    def __getattr__( self, attr ):\n        if( attr == 'env' ):\n            return self.sconf.env\n        elif( attr == 'lastTarget' ):\n            return self.sconf.lastTarget\n        else:\n            raise AttributeError(\"CheckContext instance has no attribute '%s'\" % attr)\n\n    #### Stuff used by Conftest.py (look there for explanations).\n\n    def BuildProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Program, text, ext)\n\n    def CompileProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Object, text, ext)\n\n    def CompileSharedObject(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $SHCC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.SharedObject, text, ext)\n\n    def RunProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        st, out = self.TryRun(text, ext)\n        return not st, out\n\n    def AppendLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Append(LIBS = lib_name_list)\n        return oldLIBS\n\n    def PrependLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Prepend(LIBS = lib_name_list)\n        return oldLIBS\n\n    def SetLIBS(self, val):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Replace(LIBS = val)\n        return oldLIBS\n\n    def Display(self, msg):\n        if self.sconf.cached:\n            # We assume that Display is called twice for each test here\n            # once for the Checking for ... message and once for the result.\n            # The self.sconf.cached flag can only be set between those calls\n            msg = \"(cached) \" + msg\n            self.sconf.cached = 0\n        progress_display(msg, append_newline=0)\n        self.Log(\"scons: Configure: \" + msg + \"\\n\")\n\n    def Log(self, msg):\n        if self.sconf.logstream is not None:\n            self.sconf.logstream.write(msg)\n\n    #### End of stuff used by Conftest.py.\n\n\ndef SConf(*args, **kw):\n    if kw.get(build_type, True):\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        for bt in build_types:\n            try:\n                del kw[bt]\n            except KeyError:\n                pass\n        return SConfBase(*args, **kw)\n    else:\n        return SCons.Util.Null()\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    res = SCons.Conftest.CheckFunc(context, function_name, header = header, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckType(context, type_name, includes = \"\", language = None):\n    res = SCons.Conftest.CheckType(context, type_name,\n                                   header = includes, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckTypeSize(context, type_name, includes = \"\", language = None, expect = None):\n    res = SCons.Conftest.CheckTypeSize(context, type_name,\n                                       header = includes, language = language,\n                                       expect = expect)\n    context.did_show_result = 1\n    return res\n\ndef CheckDeclaration(context, declaration, includes = \"\", language = None):\n    res = SCons.Conftest.CheckDeclaration(context, declaration,\n                                          includes = includes,\n                                          language = language)\n    context.did_show_result = 1\n    return not res\n\ndef createIncludesFromHeaders(headers, leaveLast, include_quotes = '\"\"'):\n    # used by CheckHeader and CheckLibWithHeader to produce C - #include\n    # statements from the specified header (list)\n    if not SCons.Util.is_List(headers):\n        headers = [headers]\n    l = []\n    if leaveLast:\n        lastHeader = headers[-1]\n        headers = headers[:-1]\n    else:\n        lastHeader = None\n    for s in headers:\n        l.append(\"#include %s%s%s\\n\"\n                 % (include_quotes[0], s, include_quotes[1]))\n    return ''.join(l), lastHeader\n\ndef CheckHeader(context, header, include_quotes = '<>', language = None):\n    \"\"\"\n    A test for a C or C++ header file.\n    \"\"\"\n    prog_prefix, hdr_to_check = \\\n                 createIncludesFromHeaders(header, 1, include_quotes)\n    res = SCons.Conftest.CheckHeader(context, hdr_to_check, prog_prefix,\n                                     language = language,\n                                     include_quotes = include_quotes)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCC(context):\n    res = SCons.Conftest.CheckCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCXX(context):\n    res = SCons.Conftest.CheckCXX(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCC(context):\n    res = SCons.Conftest.CheckSHCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCXX(context):\n    res = SCons.Conftest.CheckSHCXX(context)\n    context.did_show_result = 1\n    return not res\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C\")\n\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCXXHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C++ header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C++\")\n\n\ndef CheckLib(context, library = None, symbol = \"main\",\n             header = None, language = None, autoadd = 1):\n    \"\"\"\n    A test for a library. See also CheckLibWithHeader.\n    Note that library may also be None to test whether the given symbol\n    compiles without flags.\n    \"\"\"\n\n    if library == []:\n        library = [None]\n\n    if not SCons.Util.is_List(library):\n        library = [library]\n\n    # ToDo: accept path for the library\n    res = SCons.Conftest.CheckLib(context, library, symbol, header = header,\n                                        language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\n# XXX\n# Bram: Can only include one header and can't use #ifdef HAVE_HEADER_H.\n\ndef CheckLibWithHeader(context, libs, header, language,\n                       call = None, autoadd = 1):\n    # ToDo: accept path for library. Support system header files.\n    \"\"\"\n    Another (more sophisticated) test for a library.\n    Checks, if library and header is available for language (may be 'C'\n    or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'.\n    As in CheckLib, we support library=None, to test if the call compiles\n    without extra link flags.\n    \"\"\"\n    prog_prefix, dummy = \\\n                 createIncludesFromHeaders(header, 0)\n    if libs == []:\n        libs = [None]\n\n    if not SCons.Util.is_List(libs):\n        libs = [libs]\n\n    res = SCons.Conftest.CheckLib(context, libs, None, prog_prefix,\n            call = call, language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/SConsign.py",
    "content": "\"\"\"SCons.SConsign\n\nWriting and reading information to the .sconsign file or files.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/SConsign.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport os\n# compat layer imports \"cPickle\" for us if it's available.\nimport pickle\n\nimport SCons.dblite\nimport SCons.Warnings\n\ndef corrupt_dblite_warning(filename):\n    SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                        \"Ignoring corrupt .sconsign file: %s\"%filename)\n\nSCons.dblite.ignore_corrupt_dbfiles = 1\nSCons.dblite.corruption_warning = corrupt_dblite_warning\n\n#XXX Get rid of the global array so this becomes re-entrant.\nsig_files = []\n\n# Info for the database SConsign implementation (now the default):\n# \"DataBase\" is a dictionary that maps top-level SConstruct directories\n# to open database handles.\n# \"DB_Module\" is the Python database module to create the handles.\n# \"DB_Name\" is the base name of the database file (minus any\n# extension the underlying DB module will add).\nDataBase = {}\nDB_Module = SCons.dblite\n# Nuitka: Avoid collisions with newer Scons using newer pickle protocols\nDB_Name = \".sconsign2\"\nDB_sync_list = []\n\ndef Get_DataBase(dir):\n    global DataBase, DB_Module, DB_Name\n    top = dir.fs.Top\n    if not os.path.isabs(DB_Name) and top.repositories:\n        mode = \"c\"\n        for d in [top] + top.repositories:\n            if dir.is_under(d):\n                try:\n                    return DataBase[d], mode\n                except KeyError:\n                    path = d.entry_abspath(DB_Name)\n                    try: db = DataBase[d] = DB_Module.open(path, mode)\n                    except (IOError, OSError): pass\n                    else:\n                        if mode != \"r\":\n                            DB_sync_list.append(db)\n                        return db, mode\n            mode = \"r\"\n    try:\n        return DataBase[top], \"c\"\n    except KeyError:\n        db = DataBase[top] = DB_Module.open(DB_Name, \"c\")\n        DB_sync_list.append(db)\n        return db, \"c\"\n    except TypeError:\n        print \"DataBase =\", DataBase\n        raise\n\ndef Reset():\n    \"\"\"Reset global state.  Used by unit tests that end up using\n    SConsign multiple times to get a clean slate for each test.\"\"\"\n    global sig_files, DB_sync_list\n    sig_files = []\n    DB_sync_list = []\n\nnormcase = os.path.normcase\n\ndef write():\n    global sig_files\n    for sig_file in sig_files:\n        sig_file.write(sync=0)\n    for db in DB_sync_list:\n        try:\n            syncmethod = db.sync\n        except AttributeError:\n            pass # Not all dbm modules have sync() methods.\n        else:\n            syncmethod()\n        try:\n            closemethod = db.close\n        except AttributeError:\n            pass # Not all dbm modules have close() methods.\n        else:\n            closemethod()\n\nclass SConsignEntry(object):\n    \"\"\"\n    Wrapper class for the generic entry in a .sconsign file.\n    The Node subclass populates it with attributes as it pleases.\n\n    XXX As coded below, we do expect a '.binfo' attribute to be added,\n    but we'll probably generalize this in the next refactorings.\n    \"\"\"\n    current_version_id = 1\n    def __init__(self):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        _version_id = self.current_version_id\n    def convert_to_sconsign(self):\n        self.binfo.convert_to_sconsign()\n    def convert_from_sconsign(self, dir, name):\n        self.binfo.convert_from_sconsign(dir, name)\n\nclass Base(object):\n    \"\"\"\n    This is the controlling class for the signatures for the collection of\n    entries associated with a specific directory.  The actual directory\n    association will be maintained by a subclass that is specific to\n    the underlying storage method.  This class provides a common set of\n    methods for fetching and storing the individual bits of information\n    that make up signature entry.\n    \"\"\"\n    def __init__(self):\n        self.entries = {}\n        self.dirty = False\n        self.to_be_merged = {}\n\n    def get_entry(self, filename):\n        \"\"\"\n        Fetch the specified entry attribute.\n        \"\"\"\n        return self.entries[filename]\n\n    def set_entry(self, filename, obj):\n        \"\"\"\n        Set the entry.\n        \"\"\"\n        self.entries[filename] = obj\n        self.dirty = True\n\n    def do_not_set_entry(self, filename, obj):\n        pass\n\n    def store_info(self, filename, node):\n        entry = node.get_stored_info()\n        entry.binfo.merge(node.get_binfo())\n        self.to_be_merged[filename] = node\n        self.dirty = True\n\n    def do_not_store_info(self, filename, node):\n        pass\n\n    def merge(self):\n        for key, node in self.to_be_merged.items():\n            entry = node.get_stored_info()\n            try:\n                ninfo = entry.ninfo\n            except AttributeError:\n                # This happens with SConf Nodes, because the configuration\n                # subsystem takes direct control over how the build decision\n                # is made and its information stored.\n                pass\n            else:\n                ninfo.merge(node.get_ninfo())\n            self.entries[key] = entry\n        self.to_be_merged = {}\n\nclass DB(Base):\n    \"\"\"\n    A Base subclass that reads and writes signature information\n    from a global .sconsign.db* file--the actual file suffix is\n    determined by the database module.\n    \"\"\"\n    def __init__(self, dir):\n        Base.__init__(self)\n\n        self.dir = dir\n\n        db, mode = Get_DataBase(dir)\n\n        # Read using the path relative to the top of the Repository\n        # (self.dir.tpath) from which we're fetching the signature\n        # information.\n        path = normcase(dir.tpath)\n        try:\n            rawentries = db[path]\n        except KeyError:\n            pass\n        else:\n            try:\n                self.entries = pickle.loads(rawentries)\n                if not isinstance(self.entries, dict):\n                    self.entries = {}\n                    raise TypeError\n            except KeyboardInterrupt:\n                raise\n            except Exception, e:\n                SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                    \"Ignoring corrupt sconsign entry : %s (%s)\\n\"%(self.dir.tpath, e))\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\n        if mode == \"r\":\n            # This directory is actually under a repository, which means\n            # likely they're reaching in directly for a dependency on\n            # a file there.  Don't actually set any entry info, so we\n            # won't try to write to that .sconsign.dblite file.\n            self.set_entry = self.do_not_set_entry\n            self.store_info = self.do_not_store_info\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        db, mode = Get_DataBase(self.dir)\n\n        # Write using the path relative to the top of the SConstruct\n        # directory (self.dir.path), not relative to the top of\n        # the Repository; we only write to our own .sconsign file,\n        # not to .sconsign files in Repositories.\n        path = normcase(self.dir.path)\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        db[path] = pickle.dumps(self.entries, 1)\n\n        if sync:\n            try:\n                syncmethod = db.sync\n            except AttributeError:\n                # Not all anydbm modules have sync() methods.\n                pass\n            else:\n                syncmethod()\n\nclass Dir(Base):\n    def __init__(self, fp=None, dir=None):\n        \"\"\"\n        fp - file pointer to read entries from\n        \"\"\"\n        Base.__init__(self)\n\n        if not fp:\n            return\n\n        self.entries = pickle.load(fp)\n        if not isinstance(self.entries, dict):\n            self.entries = {}\n            raise TypeError\n\n        if dir:\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\nclass DirFile(Dir):\n    \"\"\"\n    Encapsulates reading and writing a per-directory .sconsign file.\n    \"\"\"\n    def __init__(self, dir):\n        \"\"\"\n        dir - the directory for the file\n        \"\"\"\n\n        self.dir = dir\n        self.sconsign = os.path.join(dir.path, '.sconsign')\n\n        try:\n            fp = open(self.sconsign, 'rb')\n        except IOError:\n            fp = None\n\n        try:\n            Dir.__init__(self, fp, dir)\n        except KeyboardInterrupt:\n            raise\n        except:\n            SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                \"Ignoring corrupt .sconsign file: %s\"%self.sconsign)\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        \"\"\"\n        Write the .sconsign file to disk.\n\n        Try to write to a temporary file first, and rename it if we\n        succeed.  If we can't write to the temporary file, it's\n        probably because the directory isn't writable (and if so,\n        how did we build anything in this directory, anyway?), so\n        try to write directly to the .sconsign file as a backup.\n        If we can't rename, try to copy the temporary contents back\n        to the .sconsign file.  Either way, always try to remove\n        the temporary file at the end.\n        \"\"\"\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        temp = os.path.join(self.dir.path, '.scons%d' % os.getpid())\n        try:\n            file = open(temp, 'wb')\n            fname = temp\n        except IOError:\n            try:\n                file = open(self.sconsign, 'wb')\n                fname = self.sconsign\n            except IOError:\n                return\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        pickle.dump(self.entries, file, 1)\n        file.close()\n        if fname != self.sconsign:\n            try:\n                mode = os.stat(self.sconsign)[0]\n                os.chmod(self.sconsign, 0666)\n                os.unlink(self.sconsign)\n            except (IOError, OSError):\n                # Try to carry on in the face of either OSError\n                # (things like permission issues) or IOError (disk\n                # or network issues).  If there's a really dangerous\n                # issue, it should get re-raised by the calls below.\n                pass\n            try:\n                os.rename(fname, self.sconsign)\n            except OSError:\n                # An OSError failure to rename may indicate something\n                # like the directory has no write permission, but\n                # the .sconsign file itself might still be writable,\n                # so try writing on top of it directly.  An IOError\n                # here, or in any of the following calls, would get\n                # raised, indicating something like a potentially\n                # serious disk or network issue.\n                open(self.sconsign, 'wb').write(open(fname, 'rb').read())\n                os.chmod(self.sconsign, mode)\n        try:\n            os.unlink(temp)\n        except (IOError, OSError):\n            pass\n\nForDirectory = DB\n\ndef File(name, dbm_module=None):\n    \"\"\"\n    Arrange for all signatures to be stored in a global .sconsign.db*\n    file.\n    \"\"\"\n    global ForDirectory, DB_Name, DB_Module\n    if name is None:\n        ForDirectory = DirFile\n        DB_Module = None\n    else:\n        ForDirectory = DB\n        DB_Name = name\n        if not dbm_module is None:\n            DB_Module = dbm_module\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/C.py",
    "content": "\"\"\"SCons.Scanner.C\n\nThis module implements the depenency scanner for C/C++ code.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/C.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Util\n\nimport SCons.cpp\n\nclass SConsCPPScanner(SCons.cpp.PreProcessor):\n    \"\"\"\n    SCons-specific subclass of the cpp.py module's processing.\n\n    We subclass this so that: 1) we can deal with files represented\n    by Nodes, not strings; 2) we can keep track of the files that are\n    missing.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        SCons.cpp.PreProcessor.__init__(self, *args, **kw)\n        self.missing = []\n    def initialize_result(self, fname):\n        self.result = SCons.Util.UniqueList([fname])\n    def finalize_result(self, fname):\n        return self.result[1:]\n    def find_include_file(self, t):\n        keyword, quote, fname = t\n        result = SCons.Node.FS.find_file(fname, self.searchpath[quote])\n        if not result:\n            self.missing.append((fname, self.current_file))\n        return result\n    def read_file(self, file):\n        try:\n            fp = open(str(file.rfile()))\n        except EnvironmentError, e:\n            self.missing.append((file, self.current_file))\n            return ''\n        else:\n            return fp.read()\n\ndef dictify_CPPDEFINES(env):\n    cppdefines = env.get('CPPDEFINES', {})\n    if cppdefines is None:\n        return {}\n    if SCons.Util.is_Sequence(cppdefines):\n        result = {}\n        for c in cppdefines:\n            if SCons.Util.is_Sequence(c):\n                result[c[0]] = c[1]\n            else:\n                result[c] = None\n        return result\n    if not SCons.Util.is_Dict(cppdefines):\n        return {cppdefines : None}\n    return cppdefines\n\nclass SConsCPPScannerWrapper(object):\n    \"\"\"\n    The SCons wrapper around a cpp.py scanner.\n\n    This is the actual glue between the calling conventions of generic\n    SCons scanners, and the (subclass of) cpp.py class that knows how\n    to look for #include lines with reasonably real C-preprocessor-like\n    evaluation of #if/#ifdef/#else/#elif lines.\n    \"\"\"\n    def __init__(self, name, variable):\n        self.name = name\n        self.path = SCons.Scanner.FindPathDirs(variable)\n    def __call__(self, node, env, path = ()):\n        cpp = SConsCPPScanner(current = node.get_dir(),\n                              cpppath = path,\n                              dict = dictify_CPPDEFINES(env))\n        result = cpp(node)\n        for included, includer in cpp.missing:\n            fmt = \"No dependency generated for file: %s (included from: %s) -- file not found\"\n            SCons.Warnings.warn(SCons.Warnings.DependencyWarning,\n                                fmt % (included, includer))\n        return result\n\n    def recurse_nodes(self, nodes):\n        return nodes\n    def select(self, node):\n        return self\n\ndef CScanner():\n    \"\"\"Return a prototype Scanner instance for scanning source files\n    that use the C pre-processor\"\"\"\n\n    # Here's how we would (or might) use the CPP scanner code above that\n    # knows how to evaluate #if/#ifdef/#else/#elif lines when searching\n    # for #includes.  This is commented out for now until we add the\n    # right configurability to let users pick between the scanners.\n    #return SConsCPPScannerWrapper(\"CScanner\", \"CPPPATH\")\n\n    cs = SCons.Scanner.ClassicCPP(\"CScanner\",\n                                  \"$CPPSUFFIXES\",\n                                  \"CPPPATH\",\n                                  '^[ \\t]*#[ \\t]*(?:include|import)[ \\t]*(<|\")([^>\"]+)(>|\")')\n    return cs\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/Dir.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Scanner/Dir.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Node.FS\nimport SCons.Scanner\n\ndef only_dirs(nodes):\n    is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir)\n    return list(filter(is_Dir, nodes))\n\ndef DirScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for scanning\n    directories for on-disk files\"\"\"\n    kw['node_factory'] = SCons.Node.FS.Entry\n    kw['recursive'] = only_dirs\n    return SCons.Scanner.Base(scan_on_disk, \"DirScanner\", **kw)\n\ndef DirEntryScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for \"scanning\"\n    directory Nodes for their in-memory entries\"\"\"\n    kw['node_factory'] = SCons.Node.FS.Entry\n    kw['recursive'] = None\n    return SCons.Scanner.Base(scan_in_memory, \"DirEntryScanner\", **kw)\n\nskip_entry = {}\n\nskip_entry_list = [\n   '.',\n   '..',\n   '.sconsign',\n   # Used by the native dblite.py module.\n   '.sconsign.dblite',\n   # Used by dbm and dumbdbm.\n   '.sconsign.dir',\n   # Used by dbm.\n   '.sconsign.pag',\n   # Used by dumbdbm.\n   '.sconsign.dat',\n   '.sconsign.bak',\n   # Used by some dbm emulations using Berkeley DB.\n   '.sconsign.db',\n]\n\nfor skip in skip_entry_list:\n    skip_entry[skip] = 1\n    skip_entry[SCons.Node.FS._my_normcase(skip)] = 1\n\ndo_not_scan = lambda k: k not in skip_entry\n\ndef scan_on_disk(node, env, path=()):\n    \"\"\"\n    Scans a directory for on-disk files and directories therein.\n\n    Looking up the entries will add these to the in-memory Node tree\n    representation of the file system, so all we have to do is just\n    that and then call the in-memory scanning function.\n    \"\"\"\n    try:\n        flist = node.fs.listdir(node.abspath)\n    except (IOError, OSError):\n        return []\n    e = node.Entry\n    for f in  filter(do_not_scan, flist):\n        # Add ./ to the beginning of the file name so if it begins with a\n        # '#' we don't look it up relative to the top-level directory.\n        e('./' + f)\n    return scan_in_memory(node, env, path)\n\ndef scan_in_memory(node, env, path=()):\n    \"\"\"\n    \"Scans\" a Node.FS.Dir for its in-memory entries.\n    \"\"\"\n    try:\n        entries = node.entries\n    except AttributeError:\n        # It's not a Node.FS.Dir (or doesn't look enough like one for\n        # our purposes), which can happen if a target list containing\n        # mixed Node types (Dirs and Files, for example) has a Dir as\n        # the first entry.\n        return []\n    entry_list = sorted(filter(do_not_scan, list(entries.keys())))\n    return [entries[n] for n in entry_list]\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/Prog.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/Prog.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Util\n\n# global, set by --debug=findlibs\nprint_find_libs = None\n\ndef ProgramScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for scanning executable\n    files for static-lib dependencies\"\"\"\n    kw['path_function'] = SCons.Scanner.FindPathDirs('LIBPATH')\n    ps = SCons.Scanner.Base(scan, \"ProgramScanner\", **kw)\n    return ps\n\ndef scan(node, env, libpath = ()):\n    \"\"\"\n    This scanner scans program files for static-library\n    dependencies.  It will search the LIBPATH environment variable\n    for libraries specified in the LIBS variable, returning any\n    files it finds as dependencies.\n    \"\"\"\n    try:\n        libs = env['LIBS']\n    except KeyError:\n        # There are no LIBS in this environment, so just return a null list:\n        return []\n    if SCons.Util.is_String(libs):\n        libs = libs.split()\n    else:\n        libs = SCons.Util.flatten(libs)\n\n    try:\n        prefix = env['LIBPREFIXES']\n        if not SCons.Util.is_List(prefix):\n            prefix = [ prefix ]\n    except KeyError:\n        prefix = [ '' ]\n\n    try:\n        suffix = env['LIBSUFFIXES']\n        if not SCons.Util.is_List(suffix):\n            suffix = [ suffix ]\n    except KeyError:\n        suffix = [ '' ]\n\n    pairs = []\n    for suf in map(env.subst, suffix):\n        for pref in map(env.subst, prefix):\n            pairs.append((pref, suf))\n\n    result = []\n\n    if callable(libpath):\n        libpath = libpath()\n\n    find_file = SCons.Node.FS.find_file\n    adjustixes = SCons.Util.adjustixes\n    for lib in libs:\n        if SCons.Util.is_String(lib):\n            lib = env.subst(lib)\n            for pref, suf in pairs:\n                l = adjustixes(lib, pref, suf)\n                l = find_file(l, libpath, verbose=print_find_libs)\n                if l:\n                    result.append(l)\n        else:\n            result.append(lib)\n\n    return result\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/RC.py",
    "content": "\"\"\"SCons.Scanner.RC\n\nThis module implements the depenency scanner for RC (Interface\nDefinition Language) files.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/RC.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Node.FS\nimport SCons.Scanner\nimport re\n\ndef RCScan():\n    \"\"\"Return a prototype Scanner instance for scanning RC source files\"\"\"\n\n    res_re= r'^(?:\\s*#\\s*(?:include)|' \\\n            '.*?\\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \\\n            '\\s*.*?)' \\\n            '\\s*(<|\"| )([^>\"\\s]+)(?:[>\"\\s])*$'\n    resScanner = SCons.Scanner.ClassicCPP( \"ResourceScanner\",\n                                           \"$RCSUFFIXES\",\n                                           \"CPPPATH\",\n                                           res_re )\n\n    return resScanner\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/__init__.py",
    "content": "\"\"\"SCons.Scanner\n\nThe Scanner package for the SCons software construction utility.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport re\n\nimport SCons.Node.FS\nimport SCons.Util\n\n\nclass _Null(object):\n    pass\n\n# This is used instead of None as a default argument value so None can be\n# used as an actual argument value.\n_null = _Null\n\ndef Scanner(function, *args, **kw):\n    \"\"\"\n    Public interface factory function for creating different types\n    of Scanners based on the different types of \"functions\" that may\n    be supplied.\n\n    TODO:  Deprecate this some day.  We've moved the functionality\n    inside the Base class and really don't need this factory function\n    any more.  It was, however, used by some of our Tool modules, so\n    the call probably ended up in various people's custom modules\n    patterned on SCons code.\n    \"\"\"\n    if SCons.Util.is_Dict(function):\n        return Selector(function, *args, **kw)\n    else:\n        return Base(function, *args, **kw)\n\n\n\nclass FindPathDirs(object):\n    \"\"\"A class to bind a specific *PATH variable name to a function that\n    will return all of the *path directories.\"\"\"\n    def __init__(self, variable):\n        self.variable = variable\n    def __call__(self, env, dir=None, target=None, source=None, argument=None):\n        import SCons.PathList\n        try:\n            path = env[self.variable]\n        except KeyError:\n            return ()\n\n        dir = dir or env.fs._cwd\n        path = SCons.PathList.PathList(path).subst_path(env, target, source)\n        return tuple(dir.Rfindalldirs(path))\n\n\n\nclass Base(object):\n    \"\"\"\n    The base class for dependency scanners.  This implements\n    straightforward, single-pass scanning of a single file.\n    \"\"\"\n\n    def __init__(self,\n                 function,\n                 name = \"NONE\",\n                 argument = _null,\n                 skeys = _null,\n                 path_function = None,\n                 # Node.FS.Base so that, by default, it's okay for a\n                 # scanner to return a Dir, File or Entry.\n                 node_class = SCons.Node.FS.Base,\n                 node_factory = None,\n                 scan_check = None,\n                 recursive = None):\n        \"\"\"\n        Construct a new scanner object given a scanner function.\n\n        'function' - a scanner function taking two or three\n        arguments and returning a list of strings.\n\n        'name' - a name for identifying this scanner object.\n\n        'argument' - an optional argument that, if specified, will be\n        passed to both the scanner function and the path_function.\n\n        'skeys' - an optional list argument that can be used to determine\n        which scanner should be used for a given Node. In the case of File\n        nodes, for example, the 'skeys' would be file suffixes.\n\n        'path_function' - a function that takes four or five arguments\n        (a construction environment, Node for the directory containing\n        the SConscript file that defined the primary target, list of\n        target nodes, list of source nodes, and optional argument for\n        this instance) and returns a tuple of the directories that can\n        be searched for implicit dependency files.  May also return a\n        callable() which is called with no args and returns the tuple\n        (supporting Bindable class).\n\n        'node_class' - the class of Nodes which this scan will return.\n        If node_class is None, then this scanner will not enforce any\n        Node conversion and will return the raw results from the\n        underlying scanner function.\n\n        'node_factory' - the factory function to be called to translate\n        the raw results returned by the scanner function into the\n        expected node_class objects.\n\n        'scan_check' - a function to be called to first check whether\n        this node really needs to be scanned.\n\n        'recursive' - specifies that this scanner should be invoked\n        recursively on all of the implicit dependencies it returns\n        (the canonical example being #include lines in C source files).\n        May be a callable, which will be called to filter the list\n        of nodes found to select a subset for recursive scanning\n        (the canonical example being only recursively scanning\n        subdirectories within a directory).\n\n        The scanner function's first argument will be a Node that should\n        be scanned for dependencies, the second argument will be an\n        Environment object, the third argument will be the tuple of paths\n        returned by the path_function, and the fourth argument will be\n        the value passed into 'argument', and the returned list should\n        contain the Nodes for all the direct dependencies of the file.\n\n        Examples:\n\n        s = Scanner(my_scanner_function)\n\n        s = Scanner(function = my_scanner_function)\n\n        s = Scanner(function = my_scanner_function, argument = 'foo')\n\n        \"\"\"\n\n        # Note: this class could easily work with scanner functions that take\n        # something other than a filename as an argument (e.g. a database\n        # node) and a dependencies list that aren't file names. All that\n        # would need to be changed is the documentation.\n\n        self.function = function\n        self.path_function = path_function\n        self.name = name\n        self.argument = argument\n\n        if skeys is _null:\n            if SCons.Util.is_Dict(function):\n                skeys = list(function.keys())\n            else:\n                skeys = []\n        self.skeys = skeys\n\n        self.node_class = node_class\n        self.node_factory = node_factory\n        self.scan_check = scan_check\n        if callable(recursive):\n            self.recurse_nodes = recursive\n        elif recursive:\n            self.recurse_nodes = self._recurse_all_nodes\n        else:\n            self.recurse_nodes = self._recurse_no_nodes\n\n    def path(self, env, dir=None, target=None, source=None):\n        if not self.path_function:\n            return ()\n        if not self.argument is _null:\n            return self.path_function(env, dir, target, source, self.argument)\n        else:\n            return self.path_function(env, dir, target, source)\n\n    def __call__(self, node, env, path = ()):\n        \"\"\"\n        This method scans a single object. 'node' is the node\n        that will be passed to the scanner function, and 'env' is the\n        environment that will be passed to the scanner function. A list of\n        direct dependency nodes for the specified node will be returned.\n        \"\"\"\n        if self.scan_check and not self.scan_check(node, env):\n            return []\n\n        self = self.select(node)\n\n        if not self.argument is _null:\n            list = self.function(node, env, path, self.argument)\n        else:\n            list = self.function(node, env, path)\n\n        kw = {}\n        if hasattr(node, 'dir'):\n            kw['directory'] = node.dir\n        node_factory = env.get_factory(self.node_factory)\n        nodes = []\n        for l in list:\n            if self.node_class and not isinstance(l, self.node_class):\n                l = node_factory(l, **kw)\n            nodes.append(l)\n        return nodes\n\n    def __cmp__(self, other):\n        try:\n            return cmp(self.__dict__, other.__dict__)\n        except AttributeError:\n            # other probably doesn't have a __dict__\n            return cmp(self.__dict__, other)\n\n    def __hash__(self):\n        return id(self)\n\n    def __str__(self):\n        return self.name\n\n    def add_skey(self, skey):\n        \"\"\"Add a skey to the list of skeys\"\"\"\n        self.skeys.append(skey)\n\n    def get_skeys(self, env=None):\n        if env and SCons.Util.is_String(self.skeys):\n            return env.subst_list(self.skeys)[0]\n        return self.skeys\n\n    def select(self, node):\n        if SCons.Util.is_Dict(self.function):\n            key = node.scanner_key()\n            try:\n                return self.function[key]\n            except KeyError:\n                return None\n        else:\n            return self\n\n    def _recurse_all_nodes(self, nodes):\n        return nodes\n\n    def _recurse_no_nodes(self, nodes):\n        return []\n\n    recurse_nodes = _recurse_no_nodes\n\n    def add_scanner(self, skey, scanner):\n        self.function[skey] = scanner\n        self.add_skey(skey)\n\n\nclass Selector(Base):\n    \"\"\"\n    A class for selecting a more specific scanner based on the\n    scanner_key() (suffix) for a specific Node.\n\n    TODO:  This functionality has been moved into the inner workings of\n    the Base class, and this class will be deprecated at some point.\n    (It was never exposed directly as part of the public interface,\n    although it is used by the Scanner() factory function that was\n    used by various Tool modules and therefore was likely a template\n    for custom modules that may be out there.)\n    \"\"\"\n    def __init__(self, dict, *args, **kw):\n        Base.__init__(self, None, *args, **kw)\n        self.dict = dict\n        self.skeys = list(dict.keys())\n\n    def __call__(self, node, env, path = ()):\n        return self.select(node)(node, env, path)\n\n    def select(self, node):\n        try:\n            return self.dict[node.scanner_key()]\n        except KeyError:\n            return None\n\n    def add_scanner(self, skey, scanner):\n        self.dict[skey] = scanner\n        self.add_skey(skey)\n\n\nclass Current(Base):\n    \"\"\"\n    A class for scanning files that are source files (have no builder)\n    or are derived files and are current (which implies that they exist,\n    either locally or in a repository).\n    \"\"\"\n\n    def __init__(self, *args, **kw):\n        def current_check(node, env):\n            return not node.has_builder() or node.is_up_to_date()\n        kw['scan_check'] = current_check\n        Base.__init__(self, *args, **kw)\n\nclass Classic(Current):\n    \"\"\"\n    A Scanner subclass to contain the common logic for classic CPP-style\n    include scanning, but which can be customized to use different\n    regular expressions to find the includes.\n\n    Note that in order for this to work \"out of the box\" (without\n    overriding the find_include() and sort_key() methods), the regular\n    expression passed to the constructor must return the name of the\n    include file in group 0.\n    \"\"\"\n\n    def __init__(self, name, suffixes, path_variable, regex, *args, **kw):\n\n        self.cre = re.compile(regex, re.M)\n\n        def _scan(node, env, path=(), self=self):\n            node = node.rfile()\n            if not node.exists():\n                return []\n            return self.scan(node, path)\n\n        kw['function'] = _scan\n        kw['path_function'] = FindPathDirs(path_variable)\n        kw['recursive'] = 1\n        kw['skeys'] = suffixes\n        kw['name'] = name\n\n        Current.__init__(self, *args, **kw)\n\n    def find_include(self, include, source_dir, path):\n        n = SCons.Node.FS.find_file(include, (source_dir,) + tuple(path))\n        return n, include\n\n    def sort_key(self, include):\n        return SCons.Node.FS._my_normcase(include)\n\n    def find_include_names(self, node):\n        return self.cre.findall(node.get_text_contents())\n\n    def scan(self, node, path=()):\n\n        # cache the includes list in node so we only scan it once:\n        if node.includes is not None:\n            includes = node.includes\n        else:\n            includes = self.find_include_names (node)\n            # Intern the names of the include files. Saves some memory\n            # if the same header is included many times.\n            node.includes = list(map(SCons.Util.silent_intern, includes))\n\n        # This is a hand-coded DSU (decorate-sort-undecorate, or\n        # Schwartzian transform) pattern.  The sort key is the raw name\n        # of the file as specifed on the #include line (including the\n        # \" or <, since that may affect what file is found), which lets\n        # us keep the sort order constant regardless of whether the file\n        # is actually found in a Repository or locally.\n        nodes = []\n        source_dir = node.get_dir()\n        if callable(path):\n            path = path()\n        for include in includes:\n            n, i = self.find_include(include, source_dir, path)\n\n            if n is None:\n                SCons.Warnings.warn(SCons.Warnings.DependencyWarning,\n                                    \"No dependency generated for file: %s (included from: %s) -- file not found\" % (i, node))\n            else:\n                nodes.append((self.sort_key(include), n))\n\n        return [pair[1] for pair in sorted(nodes)]\n\nclass ClassicCPP(Classic):\n    \"\"\"\n    A Classic Scanner subclass which takes into account the type of\n    bracketing used to include the file, and uses classic CPP rules\n    for searching for the files based on the bracketing.\n\n    Note that in order for this to work, the regular expression passed\n    to the constructor must return the leading bracket in group 0, and\n    the contained filename in group 1.\n    \"\"\"\n    def find_include(self, include, source_dir, path):\n        if include[0] == '\"':\n            paths = (source_dir,) + tuple(path)\n        else:\n            paths = tuple(path) + (source_dir,)\n\n        n = SCons.Node.FS.find_file(include[1], paths)\n\n        i = SCons.Util.silent_intern(include[1])\n        return n, i\n\n    def sort_key(self, include):\n        return SCons.Node.FS._my_normcase(' '.join(include))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Script/Interactive.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Script/Interactive.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"\nSCons interactive mode\n\"\"\"\n\n# TODO:\n#\n# This has the potential to grow into something with a really big life\n# of its own, which might or might not be a good thing.  Nevertheless,\n# here are some enhancements that will probably be requested some day\n# and are worth keeping in mind (assuming this takes off):\n#\n# - A command to re-read / re-load the SConscript files.  This may\n#   involve allowing people to specify command-line options (e.g. -f,\n#   -I, --no-site-dir) that affect how the SConscript files are read.\n#\n# - Additional command-line options on the \"build\" command.\n#\n#   Of the supported options that seemed to make sense (after a quick\n#   pass through the list), the ones that seemed likely enough to be\n#   used are listed in the man page and have explicit test scripts.\n#\n#   These had code changed in Script/Main.py to support them, but didn't\n#   seem likely to be used regularly, so had no test scripts added:\n#\n#       build --diskcheck=*\n#       build --implicit-cache=*\n#       build --implicit-deps-changed=*\n#       build --implicit-deps-unchanged=*\n#\n#   These look like they should \"just work\" with no changes to the\n#   existing code, but like those above, look unlikely to be used and\n#   therefore had no test scripts added:\n#\n#       build --random\n#\n#   These I'm not sure about.  They might be useful for individual\n#   \"build\" commands, and may even work, but they seem unlikely enough\n#   that we'll wait until they're requested before spending any time on\n#   writing test scripts for them, or investigating whether they work.\n#\n#       build -q [???  is there a useful analog to the exit status?]\n#       build --duplicate=\n#       build --profile=\n#       build --max-drift=\n#       build --warn=*\n#       build --Y\n#\n# - Most of the SCons command-line options that the \"build\" command\n#   supports should be settable as default options that apply to all\n#   subsequent \"build\" commands.  Maybe a \"set {option}\" command that\n#   maps to \"SetOption('{option}')\".\n#\n# - Need something in the 'help' command that prints the -h output.\n#\n# - A command to run the configure subsystem separately (must see how\n#   this interacts with the new automake model).\n#\n# - Command-line completion of target names; maybe even of SCons options?\n#   Completion is something that's supported by the Python cmd module,\n#   so this should be doable without too much trouble.\n#\n\nimport cmd\nimport copy\nimport os\nimport re\nimport shlex\nimport sys\n\ntry:\n    import readline\nexcept ImportError:\n    pass\n\nclass SConsInteractiveCmd(cmd.Cmd):\n    \"\"\"\\\n    build [TARGETS]         Build the specified TARGETS and their dependencies.\n                            'b' is a synonym.\n    clean [TARGETS]         Clean (remove) the specified TARGETS and their\n                            dependencies.  'c' is a synonym.\n    exit                    Exit SCons interactive mode.\n    help [COMMAND]          Prints help for the specified COMMAND.  'h' and\n                            '?' are synonyms.\n    shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!'\n                            are synonyms.\n    version                 Prints SCons version information.\n    \"\"\"\n\n    synonyms = {\n        'b'     : 'build',\n        'c'     : 'clean',\n        'h'     : 'help',\n        'scons' : 'build',\n        'sh'    : 'shell',\n    }\n\n    def __init__(self, **kw):\n        cmd.Cmd.__init__(self)\n        for key, val in kw.items():\n            setattr(self, key, val)\n\n        if sys.platform == 'win32':\n            self.shell_variable = 'COMSPEC'\n        else:\n            self.shell_variable = 'SHELL'\n\n    def default(self, argv):\n        print \"*** Unknown command: %s\" % argv[0]\n\n    def onecmd(self, line):\n        line = line.strip()\n        if not line:\n            print self.lastcmd\n            return self.emptyline()\n        self.lastcmd = line\n        if line[0] == '!':\n            line = 'shell ' + line[1:]\n        elif line[0] == '?':\n            line = 'help ' + line[1:]\n        if os.sep == '\\\\':\n            line = line.replace('\\\\', '\\\\\\\\')\n        argv = shlex.split(line)\n        argv[0] = self.synonyms.get(argv[0], argv[0])\n        if not argv[0]:\n            return self.default(line)\n        else:\n            try:\n                func = getattr(self, 'do_' + argv[0])\n            except AttributeError:\n                return self.default(argv)\n            return func(argv)\n\n    def do_build(self, argv):\n        \"\"\"\\\n        build [TARGETS]         Build the specified TARGETS and their\n                                dependencies.  'b' is a synonym.\n        \"\"\"\n        import SCons.Node\n        import SCons.SConsign\n        import SCons.Script.Main\n\n        options = copy.deepcopy(self.options)\n\n        options, targets = self.parser.parse_args(argv[1:], values=options)\n\n        SCons.Script.COMMAND_LINE_TARGETS = targets\n\n        if targets:\n            SCons.Script.BUILD_TARGETS = targets\n        else:\n            # If the user didn't specify any targets on the command line,\n            # use the list of default targets.\n            SCons.Script.BUILD_TARGETS = SCons.Script._build_plus_default\n\n        nodes = SCons.Script.Main._build_targets(self.fs,\n                                                 options,\n                                                 targets,\n                                                 self.target_top)\n\n        if not nodes:\n            return\n\n        # Call each of the Node's alter_targets() methods, which may\n        # provide additional targets that ended up as part of the build\n        # (the canonical example being a VariantDir() when we're building\n        # from a source directory) and which we therefore need their\n        # state cleared, too.\n        x = []\n        for n in nodes:\n            x.extend(n.alter_targets()[0])\n        nodes.extend(x)\n\n        # Clean up so that we can perform the next build correctly.\n        #\n        # We do this by walking over all the children of the targets,\n        # and clearing their state.\n        #\n        # We currently have to re-scan each node to find their\n        # children, because built nodes have already been partially\n        # cleared and don't remember their children.  (In scons\n        # 0.96.1 and earlier, this wasn't the case, and we didn't\n        # have to re-scan the nodes.)\n        #\n        # Because we have to re-scan each node, we can't clear the\n        # nodes as we walk over them, because we may end up rescanning\n        # a cleared node as we scan a later node.  Therefore, only\n        # store the list of nodes that need to be cleared as we walk\n        # the tree, and clear them in a separate pass.\n        #\n        # XXX: Someone more familiar with the inner workings of scons\n        # may be able to point out a more efficient way to do this.\n\n        SCons.Script.Main.progress_display(\"scons: Clearing cached node information ...\")\n\n        seen_nodes = {}\n\n        def get_unseen_children(node, parent, seen_nodes=seen_nodes):\n            def is_unseen(node, seen_nodes=seen_nodes):\n                return node not in seen_nodes\n            return list(filter(is_unseen, node.children(scan=1)))\n\n        def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):\n            seen_nodes[node] = 1\n\n            # If this file is in a VariantDir and has a\n            # corresponding source file in the source tree, remember the\n            # node in the source tree, too.  This is needed in\n            # particular to clear cached implicit dependencies on the\n            # source file, since the scanner will scan it if the\n            # VariantDir was created with duplicate=0.\n            try:\n                rfile_method = node.rfile\n            except AttributeError:\n                return\n            else:\n                rfile = rfile_method()\n            if rfile != node:\n                seen_nodes[rfile] = 1\n\n        for node in nodes:\n            walker = SCons.Node.Walker(node,\n                                        kids_func=get_unseen_children,\n                                        eval_func=add_to_seen_nodes)\n            n = walker.get_next()\n            while n:\n                n = walker.get_next()\n\n        for node in seen_nodes.keys():\n            # Call node.clear() to clear most of the state\n            node.clear()\n            # node.clear() doesn't reset node.state, so call\n            # node.set_state() to reset it manually\n            node.set_state(SCons.Node.no_state)\n            node.implicit = None\n\n            # Debug:  Uncomment to verify that all Taskmaster reference\n            # counts have been reset to zero.\n            #if node.ref_count != 0:\n            #    from SCons.Debug import Trace\n            #    Trace('node %s, ref_count %s !!!\\n' % (node, node.ref_count))\n\n        SCons.SConsign.Reset()\n        SCons.Script.Main.progress_display(\"scons: done clearing node information.\")\n\n    def do_clean(self, argv):\n        \"\"\"\\\n        clean [TARGETS]         Clean (remove) the specified TARGETS\n                                and their dependencies.  'c' is a synonym.\n        \"\"\"\n        return self.do_build(['build', '--clean'] + argv[1:])\n\n    def do_EOF(self, argv):\n        print\n        self.do_exit(argv)\n\n    def _do_one_help(self, arg):\n        try:\n            # If help_<arg>() exists, then call it.\n            func = getattr(self, 'help_' + arg)\n        except AttributeError:\n            try:\n                func = getattr(self, 'do_' + arg)\n            except AttributeError:\n                doc = None\n            else:\n                doc = self._doc_to_help(func)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n        else:\n            doc = self.strip_initial_spaces(func())\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def _doc_to_help(self, obj):\n        doc = obj.__doc__\n        if doc is None:\n            return ''\n        return self._strip_initial_spaces(doc)\n\n    def _strip_initial_spaces(self, s):\n        #lines = s.split('\\n')\n        lines = s.split('\\n')\n        spaces = re.match(' *', lines[0]).group(0)\n        #def strip_spaces(l):\n        #    if l.startswith(spaces):\n        #        l = l[len(spaces):]\n        #    return l\n        #return '\\n'.join([ strip_spaces(l) for l in lines ])\n        def strip_spaces(l, spaces=spaces):\n            if l[:len(spaces)] == spaces:\n                l = l[len(spaces):]\n            return l\n        lines = list(map(strip_spaces, lines))\n        return '\\n'.join(lines)\n\n    def do_exit(self, argv):\n        \"\"\"\\\n        exit                    Exit SCons interactive mode.\n        \"\"\"\n        sys.exit(0)\n\n    def do_help(self, argv):\n        \"\"\"\\\n        help [COMMAND]          Prints help for the specified COMMAND.  'h'\n                                and '?' are synonyms.\n        \"\"\"\n        if argv[1:]:\n            for arg in argv[1:]:\n                if self._do_one_help(arg):\n                    break\n        else:\n            # If bare 'help' is called, print this class's doc\n            # string (if it has one).\n            doc = self._doc_to_help(self.__class__)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def do_shell(self, argv):\n        \"\"\"\\\n        shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and\n                                '!' are synonyms.\n        \"\"\"\n        import subprocess\n        argv = argv[1:]\n        if not argv:\n            argv = os.environ[self.shell_variable]\n        try:\n            # Per \"[Python-Dev] subprocess insufficiently platform-independent?\"\n            # http://mail.python.org/pipermail/python-dev/2008-August/081979.html \"+\n            # Doing the right thing with an argument list currently\n            # requires different shell= values on Windows and Linux.\n            p = subprocess.Popen(argv, shell=(sys.platform=='win32'))\n        except EnvironmentError, e:\n            sys.stderr.write('scons: %s: %s\\n' % (argv[0], e.strerror))\n        else:\n            p.wait()\n\n    def do_version(self, argv):\n        \"\"\"\\\n        version                 Prints SCons version information.\n        \"\"\"\n        sys.stdout.write(self.parser.version + '\\n')\n\ndef interact(fs, parser, options, targets, target_top):\n    c = SConsInteractiveCmd(prompt = 'scons>>> ',\n                            fs = fs,\n                            parser = parser,\n                            options = options,\n                            targets = targets,\n                            target_top = target_top)\n    c.cmdloop()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Script/Main.py",
    "content": "\"\"\"SCons.Script\n\nThis file implements the main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\"\"\"\n\nunsupported_python_version = (2, 3, 0)\ndeprecated_python_version = (2, 7, 0)\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Script/Main.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport os\nimport sys\nimport time\nimport traceback\n\n# Strip the script directory from sys.path() so on case-insensitive\n# (Windows) systems Python doesn't think that the \"scons\" script is the\n# \"SCons\" package.  Replace it with our own version directory so, if\n# if they're there, we pick up the right version of the build engine\n# modules.\n#sys.path = [os.path.join(sys.prefix,\n#                         'lib',\n#                         'scons-%d' % SCons.__version__)] + sys.path[1:]\n\nimport SCons.CacheDir\nimport SCons.Debug\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.Script\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\n\nimport SCons.Script.Interactive\n\ndef fetch_win32_parallel_msg():\n    # A subsidiary function that exists solely to isolate this import\n    # so we don't have to pull it in on all platforms, and so that an\n    # in-line \"import\" statement in the _main() function below doesn't\n    # cause warnings about local names shadowing use of the 'SCons'\n    # globl in nest scopes and UnboundLocalErrors and the like in some\n    # versions (2.1) of Python.\n    import SCons.Platform.win32\n    return SCons.Platform.win32.parallel_msg\n\ndef revert_io():\n    # This call is added to revert stderr and stdout to the original\n    # ones just in case some build rule or something else in the system\n    # has redirected them elsewhere.\n    sys.stderr = sys.__stderr__\n    sys.stdout = sys.__stdout__\n\nclass SConsPrintHelpException(Exception):\n    pass\n\ndisplay = SCons.Util.display\nprogress_display = SCons.Util.DisplayEngine()\n\nfirst_command_start = None\nlast_command_end = None\n\nclass Progressor(object):\n    prev = ''\n    count = 0\n    target_string = '$TARGET'\n\n    def __init__(self, obj, interval=1, file=None, overwrite=False):\n        if file is None:\n            file = sys.stdout\n\n        self.obj = obj\n        self.file = file\n        self.interval = interval\n        self.overwrite = overwrite\n\n        if callable(obj):\n            self.func = obj\n        elif SCons.Util.is_List(obj):\n            self.func = self.spinner\n        elif obj.find(self.target_string) != -1:\n            self.func = self.replace_string\n        else:\n            self.func = self.string\n\n    def write(self, s):\n        self.file.write(s)\n        self.file.flush()\n        self.prev = s\n\n    def erase_previous(self):\n        if self.prev:\n            length = len(self.prev)\n            if self.prev[-1] in ('\\n', '\\r'):\n                length = length - 1\n            self.write(' ' * length + '\\r')\n            self.prev = ''\n\n    def spinner(self, node):\n        self.write(self.obj[self.count % len(self.obj)])\n\n    def string(self, node):\n        self.write(self.obj)\n\n    def replace_string(self, node):\n        self.write(self.obj.replace(self.target_string, str(node)))\n\n    def __call__(self, node):\n        self.count = self.count + 1\n        if (self.count % self.interval) == 0:\n            if self.overwrite:\n                self.erase_previous()\n            self.func(node)\n\nProgressObject = SCons.Util.Null()\n\ndef Progress(*args, **kw):\n    global ProgressObject\n    ProgressObject = Progressor(*args, **kw)\n\n# Task control.\n#\n\n_BuildFailures = []\n\ndef GetBuildFailures():\n    return _BuildFailures\n\nclass BuildTask(SCons.Taskmaster.OutOfDateTask):\n    \"\"\"An SCons build task.\"\"\"\n    progress = ProgressObject\n\n    def display(self, message):\n        display('scons: ' + message)\n\n    def prepare(self):\n        self.progress(self.targets[0])\n        return SCons.Taskmaster.OutOfDateTask.prepare(self)\n\n    def needs_execute(self):\n        if SCons.Taskmaster.OutOfDateTask.needs_execute(self):\n            return True\n        if self.top and self.targets[0].has_builder():\n            display(\"scons: `%s' is up to date.\" % str(self.node))\n        return False\n\n    def execute(self):\n        if print_time:\n            start_time = time.time()\n            global first_command_start\n            if first_command_start is None:\n                first_command_start = start_time\n        SCons.Taskmaster.OutOfDateTask.execute(self)\n        if print_time:\n            global cumulative_command_time\n            global last_command_end\n            finish_time = time.time()\n            last_command_end = finish_time\n            cumulative_command_time = cumulative_command_time+finish_time-start_time\n            sys.stdout.write(\"Command execution time: %s: %f seconds\\n\"%(str(self.node), finish_time-start_time))\n\n    def do_failed(self, status=2):\n        _BuildFailures.append(self.exception[1])\n        global exit_status\n        global this_build_status\n        if self.options.ignore_errors:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n        elif self.options.keep_going:\n            SCons.Taskmaster.OutOfDateTask.fail_continue(self)\n            exit_status = status\n            this_build_status = status\n        else:\n            SCons.Taskmaster.OutOfDateTask.fail_stop(self)\n            exit_status = status\n            this_build_status = status\n\n    def executed(self):\n        t = self.targets[0]\n        if self.top and not t.has_builder() and not t.side_effect:\n            if not t.exists():\n                if t.__class__.__name__ in ('File', 'Dir', 'Entry'):\n                    errstr=\"Do not know how to make %s target `%s' (%s).\" % (t.__class__.__name__, t, t.abspath)\n                else: # Alias or Python or ...\n                    errstr=\"Do not know how to make %s target `%s'.\" % (t.__class__.__name__, t)\n                sys.stderr.write(\"scons: *** \" + errstr)\n                if not self.options.keep_going:\n                    sys.stderr.write(\"  Stop.\")\n                sys.stderr.write(\"\\n\")\n                try:\n                    raise SCons.Errors.BuildError(t, errstr)\n                except KeyboardInterrupt:\n                    raise\n                except:\n                    self.exception_set()\n                self.do_failed()\n            else:\n                print \"scons: Nothing to be done for `%s'.\" % t\n                SCons.Taskmaster.OutOfDateTask.executed(self)\n        else:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n\n    def failed(self):\n        # Handle the failure of a build task.  The primary purpose here\n        # is to display the various types of Errors and Exceptions\n        # appropriately.\n        exc_info = self.exc_info()\n        try:\n            t, e, tb = exc_info\n        except ValueError:\n            t, e = exc_info\n            tb = None\n\n        if t is None:\n            # The Taskmaster didn't record an exception for this Task;\n            # see if the sys module has one.\n            try:\n                t, e, tb = sys.exc_info()[:]\n            except ValueError:\n                t, e = exc_info\n                tb = None\n\n        # Deprecated string exceptions will have their string stored\n        # in the first entry of the tuple.\n        if e is None:\n            e = t\n\n        buildError = SCons.Errors.convert_to_BuildError(e)\n        if not buildError.node:\n            buildError.node = self.node\n\n        node = buildError.node\n        if not SCons.Util.is_List(node):\n                node = [ node ]\n        nodename = ', '.join(map(str, node))\n\n        errfmt = \"scons: *** [%s] %s\\n\"\n        sys.stderr.write(errfmt % (nodename, buildError))\n\n        if (buildError.exc_info[2] and buildError.exc_info[1] and\n           not isinstance(\n               buildError.exc_info[1],\n               (EnvironmentError, SCons.Errors.StopError,\n                            SCons.Errors.UserError))):\n            type, value, trace = buildError.exc_info\n            if tb and print_stacktrace:\n                sys.stderr.write(\"scons: internal stack trace:\\n\")\n                traceback.print_tb(tb, file=sys.stderr)\n            traceback.print_exception(type, value, trace)\n        elif tb and print_stacktrace:\n            sys.stderr.write(\"scons: internal stack trace:\\n\")\n            traceback.print_tb(tb, file=sys.stderr)\n\n        self.exception = (e, buildError, tb) # type, value, traceback\n        self.do_failed(buildError.exitstatus)\n\n        self.exc_clear()\n\n    def postprocess(self):\n        if self.top:\n            t = self.targets[0]\n            for tp in self.options.tree_printers:\n                tp.display(t)\n            if self.options.debug_includes:\n                tree = t.render_include_tree()\n                if tree:\n                    print\n                    print tree\n        SCons.Taskmaster.OutOfDateTask.postprocess(self)\n\n    def make_ready(self):\n        \"\"\"Make a task ready for execution\"\"\"\n        SCons.Taskmaster.OutOfDateTask.make_ready(self)\n        if self.out_of_date and self.options.debug_explain:\n            explanation = self.out_of_date[0].explain()\n            if explanation:\n                sys.stdout.write(\"scons: \" + explanation)\n\nclass CleanTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons clean task.\"\"\"\n    def fs_delete(self, path, pathstr, remove=True):\n        try:\n            if os.path.lexists(path):\n                if os.path.isfile(path) or os.path.islink(path):\n                    if remove: os.unlink(path)\n                    display(\"Removed \" + pathstr)\n                elif os.path.isdir(path) and not os.path.islink(path):\n                    # delete everything in the dir\n                    for e in sorted(os.listdir(path)):\n                        p = os.path.join(path, e)\n                        s = os.path.join(pathstr, e)\n                        if os.path.isfile(p):\n                            if remove: os.unlink(p)\n                            display(\"Removed \" + s)\n                        else:\n                            self.fs_delete(p, s, remove)\n                    # then delete dir itself\n                    if remove: os.rmdir(path)\n                    display(\"Removed directory \" + pathstr)\n                else:\n                    errstr = \"Path '%s' exists but isn't a file or directory.\"\n                    raise SCons.Errors.UserError(errstr % (pathstr))\n        except SCons.Errors.UserError, e:\n            print e\n        except (IOError, OSError), e:\n            print \"scons: Could not remove '%s':\" % pathstr, e.strerror\n\n    def _get_files_to_clean(self):\n        result = []\n        target = self.targets[0]\n        if target.has_builder() or target.side_effect:\n            result = [t for t in self.targets if not t.noclean]\n        return result\n\n    def _clean_targets(self, remove=True):\n        target = self.targets[0]\n        if target in SCons.Environment.CleanTargets:\n            files = SCons.Environment.CleanTargets[target]\n            for f in files:\n                self.fs_delete(f.abspath, str(f), remove)\n\n    def show(self):\n        for t in self._get_files_to_clean():\n            if not t.isdir():\n                display(\"Removed \" + str(t))\n        self._clean_targets(remove=False)\n\n    def remove(self):\n        for t in self._get_files_to_clean():\n            try:\n                removed = t.remove()\n            except OSError, e:\n                # An OSError may indicate something like a permissions\n                # issue, an IOError would indicate something like\n                # the file not existing.  In either case, print a\n                # message and keep going to try to remove as many\n                # targets aa possible.\n                print \"scons: Could not remove '%s':\" % str(t), e.strerror\n            else:\n                if removed:\n                    display(\"Removed \" + str(t))\n        self._clean_targets(remove=True)\n\n    execute = remove\n\n    # We want the Taskmaster to update the Node states (and therefore\n    # handle reference counts, etc.), but we don't want to call\n    # back to the Node's post-build methods, which would do things\n    # we don't want, like store .sconsign information.\n    executed = SCons.Taskmaster.Task.executed_without_callbacks\n\n    # Have the taskmaster arrange to \"execute\" all of the targets, because\n    # we'll figure out ourselves (in remove() or show() above) whether\n    # anything really needs to be done.\n    make_ready = SCons.Taskmaster.Task.make_ready_all\n\n    def prepare(self):\n        pass\n\nclass QuestionTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons task for the -q (question) option.\"\"\"\n    def prepare(self):\n        pass\n\n    def execute(self):\n        if self.targets[0].get_state() != SCons.Node.up_to_date or \\\n           (self.top and not self.targets[0].exists()):\n            global exit_status\n            global this_build_status\n            exit_status = 1\n            this_build_status = 1\n            self.tm.stop()\n\n    def executed(self):\n        pass\n\n\nclass TreePrinter(object):\n    def __init__(self, derived=False, prune=False, status=False):\n        self.derived = derived\n        self.prune = prune\n        self.status = status\n    def get_all_children(self, node):\n        return node.all_children()\n    def get_derived_children(self, node):\n        children = node.all_children(None)\n        return [x for x in children if x.has_builder()]\n    def display(self, t):\n        if self.derived:\n            func = self.get_derived_children\n        else:\n            func = self.get_all_children\n        s = self.status and 2 or 0\n        SCons.Util.print_tree(t, func, prune=self.prune, showtags=s)\n\n\ndef python_version_string():\n    return sys.version.split()[0]\n\ndef python_version_unsupported(version=sys.version_info):\n    return version < unsupported_python_version\n\ndef python_version_deprecated(version=sys.version_info):\n    return version < deprecated_python_version\n\n\n# Global variables\n\nprint_objects = 0\nprint_memoizer = 0\nprint_stacktrace = 0\nprint_time = 0\nsconscript_time = 0\ncumulative_command_time = 0\nexit_status = 0 # final exit status, assume success by default\nthis_build_status = 0 # \"exit status\" of an individual build\nnum_jobs = None\ndelayed_warnings = []\n\nclass FakeOptionParser(object):\n    \"\"\"\n    A do-nothing option parser, used for the initial OptionsParser variable.\n\n    During normal SCons operation, the OptionsParser is created right\n    away by the main() function.  Certain tests scripts however, can\n    introspect on different Tool modules, the initialization of which\n    can try to add a new, local option to an otherwise uninitialized\n    OptionsParser object.  This allows that introspection to happen\n    without blowing up.\n\n    \"\"\"\n    class FakeOptionValues(object):\n        def __getattr__(self, attr):\n            return None\n    values = FakeOptionValues()\n    def add_local_option(self, *args, **kw):\n        pass\n\nOptionsParser = FakeOptionParser()\n\ndef AddOption(*args, **kw):\n    if 'default' not in kw:\n        kw['default'] = None\n    result = OptionsParser.add_local_option(*args, **kw)\n    return result\n\ndef GetOption(name):\n    return getattr(OptionsParser.values, name)\n\ndef SetOption(name, value):\n    return OptionsParser.values.set_option(name, value)\n\n#\nclass Stats(object):\n    def __init__(self):\n        self.stats = []\n        self.labels = []\n        self.append = self.do_nothing\n        self.print_stats = self.do_nothing\n    def enable(self, outfp):\n        self.outfp = outfp\n        self.append = self.do_append\n        self.print_stats = self.do_print\n    def do_nothing(self, *args, **kw):\n        pass\n\nclass CountStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.fetchLoggedInstances())\n    def do_print(self):\n        stats_table = {}\n        for s in self.stats:\n            for n in [t[0] for t in s]:\n                stats_table[n] = [0, 0, 0, 0]\n        i = 0\n        for s in self.stats:\n            for n, c in s:\n                stats_table[n][i] = c\n            i = i + 1\n        self.outfp.write(\"Object counts:\\n\")\n        pre = [\"   \"]\n        post = [\"   %s\\n\"]\n        l = len(self.stats)\n        fmt1 = ''.join(pre + [' %7s']*l + post)\n        fmt2 = ''.join(pre + [' %7d']*l + post)\n        labels = self.labels[:l]\n        labels.append((\"\", \"Class\"))\n        self.outfp.write(fmt1 % tuple([x[0] for x in labels]))\n        self.outfp.write(fmt1 % tuple([x[1] for x in labels]))\n        for k in sorted(stats_table.keys()):\n            r = stats_table[k][:l] + [k]\n            self.outfp.write(fmt2 % tuple(r))\n\ncount_stats = CountStats()\n\nclass MemStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.memory())\n    def do_print(self):\n        fmt = 'Memory %-32s %12d\\n'\n        for label, stats in zip(self.labels, self.stats):\n            self.outfp.write(fmt % (label, stats))\n\nmemory_stats = MemStats()\n\n# utility functions\n\ndef _scons_syntax_error(e):\n    \"\"\"Handle syntax errors. Print out a message and show where the error\n    occurred.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    lines = traceback.format_exception_only(etype, value)\n    for line in lines:\n        sys.stderr.write(line+'\\n')\n    sys.exit(2)\n\ndef find_deepest_user_frame(tb):\n    \"\"\"\n    Find the deepest stack frame that is not part of SCons.\n\n    Input is a \"pre-processed\" stack trace in the form\n    returned by traceback.extract_tb() or traceback.extract_stack()\n    \"\"\"\n\n    tb.reverse()\n\n    # find the deepest traceback frame that is not part\n    # of SCons:\n    for frame in tb:\n        filename = frame[0]\n        if filename.find(os.sep+'SCons'+os.sep) == -1:\n            return frame\n    return tb[0]\n\ndef _scons_user_error(e):\n    \"\"\"Handle user errors. Print out a message and a description of the\n    error, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    global print_stacktrace\n    etype, value, tb = sys.exc_info()\n    if print_stacktrace:\n        traceback.print_exception(etype, value, tb)\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: *** %s\\n\" % value)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n    sys.exit(2)\n\ndef _scons_user_warning(e):\n    \"\"\"Handle user warnings. Print out a message and a description of\n    the warning, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_warning(e):\n    \"\"\"Slightly different from _scons_user_warning in that we use the\n    *current call stack* rather than sys.exc_info() to get our stack trace.\n    This is used by the warnings framework to print warnings.\"\"\"\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack())\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e.args[0])\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_error():\n    \"\"\"Handle all errors but user errors. Print out a message telling\n    the user what to do in this case and print a normal trace.\n    \"\"\"\n    print 'internal error'\n    traceback.print_exc()\n    sys.exit(2)\n\ndef _SConstruct_exists(dirname='', repositories=[], filelist=None):\n    \"\"\"This function checks that an SConstruct file exists in a directory.\n    If so, it returns the path of the file. By default, it checks the\n    current directory.\n    \"\"\"\n    if not filelist:\n        filelist = ['SConstruct', 'Sconstruct', 'sconstruct']\n    for file in filelist:\n        sfile = os.path.join(dirname, file)\n        if os.path.isfile(sfile):\n            return sfile\n        if not os.path.isabs(sfile):\n            for rep in repositories:\n                if os.path.isfile(os.path.join(rep, sfile)):\n                    return sfile\n    return None\n\ndef _set_debug_values(options):\n    global print_memoizer, print_objects, print_stacktrace, print_time\n\n    debug_values = options.debug\n\n    if \"count\" in debug_values:\n        # All of the object counts are within \"if track_instances:\" blocks,\n        # which get stripped when running optimized (with python -O or\n        # from compiled *.pyo files).  Provide a warning if __debug__ is\n        # stripped, so it doesn't just look like --debug=count is broken.\n        enable_count = False\n        if __debug__: enable_count = True\n        if enable_count:\n            count_stats.enable(sys.stdout)\n            SCons.Debug.track_instances = True\n        else:\n            msg = \"--debug=count is not supported when running SCons\\n\" + \\\n                  \"\\twith the python -O option or optimized (.pyo) modules.\"\n            SCons.Warnings.warn(SCons.Warnings.NoObjectCountWarning, msg)\n    if \"dtree\" in debug_values:\n        options.tree_printers.append(TreePrinter(derived=True))\n    options.debug_explain = (\"explain\" in debug_values)\n    if \"findlibs\" in debug_values:\n        SCons.Scanner.Prog.print_find_libs = \"findlibs\"\n    options.debug_includes = (\"includes\" in debug_values)\n    print_memoizer = (\"memoizer\" in debug_values)\n    if \"memory\" in debug_values:\n        memory_stats.enable(sys.stdout)\n    print_objects = (\"objects\" in debug_values)\n    if print_objects:\n        SCons.Debug.track_instances = True\n    if \"presub\" in debug_values:\n        SCons.Action.print_actions_presub = 1\n    if \"stacktrace\" in debug_values:\n        print_stacktrace = 1\n    if \"stree\" in debug_values:\n        options.tree_printers.append(TreePrinter(status=True))\n    if \"time\" in debug_values:\n        print_time = 1\n    if \"tree\" in debug_values:\n        options.tree_printers.append(TreePrinter())\n    if \"prepare\" in debug_values:\n        SCons.Taskmaster.print_prepare = 1\n    if \"duplicate\" in debug_values:\n        SCons.Node.FS.print_duplicate = 1\n\ndef _create_path(plist):\n    path = '.'\n    for d in plist:\n        if os.path.isabs(d):\n            path = d\n        else:\n            path = path + '/' + d\n    return path\n\ndef _load_site_scons_dir(topdir, site_dir_name=None):\n    \"\"\"Load the site_scons dir under topdir.\n    Prepends site_scons to sys.path, imports site_scons/site_init.py,\n    and prepends site_scons/site_tools to default toolpath.\"\"\"\n    if site_dir_name:\n        err_if_not_found = True       # user specified: err if missing\n    else:\n        site_dir_name = \"site_scons\"\n        err_if_not_found = False\n\n    site_dir = os.path.join(topdir, site_dir_name)\n    if not os.path.exists(site_dir):\n        if err_if_not_found:\n            raise SCons.Errors.UserError(\"site dir %s not found.\"%site_dir)\n        return\n\n    site_init_filename = \"site_init.py\"\n    site_init_modname = \"site_init\"\n    site_tools_dirname = \"site_tools\"\n    # prepend to sys.path\n    sys.path = [os.path.abspath(site_dir)] + sys.path\n    site_init_file = os.path.join(site_dir, site_init_filename)\n    site_tools_dir = os.path.join(site_dir, site_tools_dirname)\n    if os.path.exists(site_init_file):\n        import imp, re\n        # TODO(2.4): turn this into try:-except:-finally:\n        try:\n            try:\n                fp, pathname, description = imp.find_module(site_init_modname,\n                                                            [site_dir])\n                # Load the file into SCons.Script namespace.  This is\n                # opaque and clever; m is the module object for the\n                # SCons.Script module, and the exec ... in call executes a\n                # file (or string containing code) in the context of the\n                # module's dictionary, so anything that code defines ends\n                # up adding to that module.  This is really short, but all\n                # the error checking makes it longer.\n                try:\n                    m = sys.modules['SCons.Script']\n                except Exception, e:\n                    fmt = 'cannot import site_init.py: missing SCons.Script module %s'\n                    raise SCons.Errors.InternalError(fmt % repr(e))\n                try:\n                    sfx = description[0]\n                    modname = os.path.basename(pathname)[:-len(sfx)]\n                    site_m = {\"__file__\": pathname, \"__name__\": modname, \"__doc__\": None}\n                    re_special = re.compile(\"__[^_]+__\")\n                    for k in m.__dict__.keys():\n                        if not re_special.match(k):\n                            site_m[k] = m.__dict__[k]\n\n                    # This is the magic.\n                    exec fp in site_m\n                except KeyboardInterrupt:\n                    raise\n                except Exception, e:\n                    fmt = '*** Error loading site_init file %s:\\n'\n                    sys.stderr.write(fmt % repr(site_init_file))\n                    raise\n                else:\n                    for k in site_m:\n                        if not re_special.match(k):\n                            m.__dict__[k] = site_m[k]\n            except KeyboardInterrupt:\n                raise\n            except ImportError, e:\n                fmt = '*** cannot import site init file %s:\\n'\n                sys.stderr.write(fmt % repr(site_init_file))\n                raise\n        finally:\n            if fp:\n                fp.close()\n    if os.path.exists(site_tools_dir):\n        # prepend to DefaultToolpath\n        SCons.Tool.DefaultToolpath.insert(0, os.path.abspath(site_tools_dir))\n\ndef _load_all_site_scons_dirs(topdir, verbose=None):\n    \"\"\"Load all of the predefined site_scons dir.\n    Order is significant; we load them in order from most generic\n    (machine-wide) to most specific (topdir).\n    The verbose argument is only for testing.\n    \"\"\"\n    platform = SCons.Platform.platform_default()\n\n    def homedir(d):\n        return os.path.expanduser('~/'+d)\n\n    if platform == 'win32' or platform == 'cygwin':\n        # Note we use $ here instead of %...% because older\n        # pythons (prior to 2.6?) didn't expand %...% on Windows.\n        # This set of dirs should work on XP, Vista, 7 and later.\n        sysdirs=[\n            os.path.expandvars('$ALLUSERSPROFILE\\\\Application Data\\\\scons'),\n            os.path.expandvars('$USERPROFILE\\\\Local Settings\\\\Application Data\\\\scons')]\n        appdatadir = os.path.expandvars('$APPDATA\\\\scons')\n        if appdatadir not in sysdirs:\n            sysdirs.append(appdatadir)\n        sysdirs.append(homedir('.scons'))\n\n    elif platform == 'darwin':  # MacOS X\n        sysdirs=['/Library/Application Support/SCons',\n                 '/opt/local/share/scons', # (for MacPorts)\n                 '/sw/share/scons', # (for Fink)\n                  homedir('Library/Application Support/SCons'),\n                  homedir('.scons')]\n    elif platform == 'sunos':   # Solaris\n        sysdirs=['/opt/sfw/scons',\n                 '/usr/share/scons',\n                 homedir('.scons')]\n    else:                       # Linux, HPUX, etc.\n        # assume posix-like, i.e. platform == 'posix'\n        sysdirs=['/usr/share/scons',\n                 homedir('.scons')]\n\n    dirs=sysdirs + [topdir]\n    for d in dirs:\n        if verbose:    # this is used by unit tests.\n            print \"Loading site dir \", d\n        _load_site_scons_dir(d)\n\ndef test_load_all_site_scons_dirs(d):\n    _load_all_site_scons_dirs(d, True)\n\ndef version_string(label, module):\n    version = module.__version__\n    build = module.__build__\n    if build:\n        if build[0] != '.':\n            build = '.' + build\n        version = version + build\n    fmt = \"\\t%s: v%s, %s, by %s on %s\\n\"\n    return fmt % (label,\n                  version,\n                  module.__date__,\n                  module.__developer__,\n                  module.__buildsys__)\n\ndef path_string(label, module):\n    path = module.__path__\n    return \"\\t%s path: %s\\n\"%(label,path)\n\ndef _main(parser):\n    global exit_status\n    global this_build_status\n\n    options = parser.values\n\n    # Here's where everything really happens.\n\n    # First order of business:  set up default warnings and then\n    # handle the user's warning options, so that we can issue (or\n    # suppress) appropriate warnings about anything that might happen,\n    # as configured by the user.\n\n    default_warnings = [ SCons.Warnings.WarningOnByDefault,\n                         SCons.Warnings.DeprecatedWarning,\n                       ]\n\n    for warning in default_warnings:\n        SCons.Warnings.enableWarningClass(warning)\n    SCons.Warnings._warningOut = _scons_internal_warning\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we have the warnings configuration set up, we can actually\n    # issue (or suppress) any warnings about warning-worthy things that\n    # occurred while the command-line options were getting parsed.\n    try:\n        dw = options.delayed_warnings\n    except AttributeError:\n        pass\n    else:\n        delayed_warnings.extend(dw)\n    for warning_type, message in delayed_warnings:\n        SCons.Warnings.warn(warning_type, message)\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    # Next, we want to create the FS object that represents the outside\n    # world's file system, as that's central to a lot of initialization.\n    # To do this, however, we need to be in the directory from which we\n    # want to start everything, which means first handling any relevant\n    # options that might cause us to chdir somewhere (-C, -D, -U, -u).\n    if options.directory:\n        script_dir = os.path.abspath(_create_path(options.directory))\n    else:\n        script_dir = os.getcwd()\n\n    target_top = None\n    if options.climb_up:\n        target_top = '.'  # directory to prepend to targets\n        while script_dir and not _SConstruct_exists(script_dir,\n                                                    options.repository,\n                                                    options.file):\n            script_dir, last_part = os.path.split(script_dir)\n            if last_part:\n                target_top = os.path.join(last_part, target_top)\n            else:\n                script_dir = ''\n\n    if script_dir and script_dir != os.getcwd():\n        if not options.silent:\n            display(\"scons: Entering directory `%s'\" % script_dir)\n        try:\n            os.chdir(script_dir)\n        except OSError:\n            sys.stderr.write(\"Could not change directory to %s\\n\" % script_dir)\n\n    # Now that we're in the top-level SConstruct directory, go ahead\n    # and initialize the FS object that represents the file system,\n    # and make it the build engine default.\n    fs = SCons.Node.FS.get_default_fs()\n\n    for rep in options.repository:\n        fs.Repository(rep)\n\n    # Now that we have the FS object, the next order of business is to\n    # check for an SConstruct file (or other specified config file).\n    # If there isn't one, we can bail before doing any more work.\n    scripts = []\n    if options.file:\n        scripts.extend(options.file)\n    if not scripts:\n        sfile = _SConstruct_exists(repositories=options.repository,\n                                   filelist=options.file)\n        if sfile:\n            scripts.append(sfile)\n\n    if not scripts:\n        if options.help:\n            # There's no SConstruct, but they specified -h.\n            # Give them the options usage now, before we fail\n            # trying to read a non-existent SConstruct file.\n            raise SConsPrintHelpException\n        raise SCons.Errors.UserError(\"No SConstruct file found.\")\n\n    if scripts[0] == \"-\":\n        d = fs.getcwd()\n    else:\n        d = fs.File(scripts[0]).dir\n    fs.set_SConstruct_dir(d)\n\n    _set_debug_values(options)\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.implicit_deps_changed = options.implicit_deps_changed\n    SCons.Node.implicit_deps_unchanged = options.implicit_deps_unchanged\n\n    if options.no_exec:\n        SCons.SConf.dryrun = 1\n        SCons.Action.execute_actions = None\n    if options.question:\n        SCons.SConf.dryrun = 1\n    if options.clean:\n        SCons.SConf.SetBuildType('clean')\n    if options.help:\n        SCons.SConf.SetBuildType('help')\n    SCons.SConf.SetCacheMode(options.config)\n    SCons.SConf.SetProgressDisplay(progress_display)\n\n    if options.no_progress or options.silent:\n        progress_display.set_mode(0)\n\n    if options.site_dir:\n        _load_site_scons_dir(d.path, options.site_dir)\n    elif not options.no_site_dir:\n        _load_all_site_scons_dirs(d.path)\n\n    if options.include_dir:\n        sys.path = options.include_dir + sys.path\n\n    # That should cover (most of) the options.  Next, set up the variables\n    # that hold command-line arguments, so the SConscript files that we\n    # read and execute have access to them.\n    targets = []\n    xmit_args = []\n    for a in parser.largs:\n        if a[:1] == '-':\n            continue\n        if '=' in a:\n            xmit_args.append(a)\n        else:\n            targets.append(a)\n    SCons.Script._Add_Targets(targets + parser.rargs)\n    SCons.Script._Add_Arguments(xmit_args)\n\n    # If stdout is not a tty, replace it with a wrapper object to call flush\n    # after every write.\n    #\n    # Tty devices automatically flush after every newline, so the replacement\n    # isn't necessary.  Furthermore, if we replace sys.stdout, the readline\n    # module will no longer work.  This affects the behavior during\n    # --interactive mode.  --interactive should only be used when stdin and\n    # stdout refer to a tty.\n    if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():\n        sys.stdout = SCons.Util.Unbuffered(sys.stdout)\n    if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty():\n        sys.stderr = SCons.Util.Unbuffered(sys.stderr)\n\n    memory_stats.append('before reading SConscript files:')\n    count_stats.append(('pre-', 'read'))\n\n    # And here's where we (finally) read the SConscript files.\n\n    progress_display(\"scons: Reading SConscript files ...\")\n\n    start_time = time.time()\n    try:\n        for script in scripts:\n            SCons.Script._SConscript._SConscript(fs, script)\n    except SCons.Errors.StopError, e:\n        # We had problems reading an SConscript file, such as it\n        # couldn't be copied in to the VariantDir.  Since we're just\n        # reading SConscript files and haven't started building\n        # things yet, stop regardless of whether they used -i or -k\n        # or anything else.\n        revert_io()\n        sys.stderr.write(\"scons: *** %s  Stop.\\n\" % e)\n        sys.exit(2)\n    global sconscript_time\n    sconscript_time = time.time() - start_time\n\n    progress_display(\"scons: done reading SConscript files.\")\n\n    memory_stats.append('after reading SConscript files:')\n    count_stats.append(('post-', 'read'))\n\n    # Re-{enable,disable} warnings in case they disabled some in\n    # the SConscript file.\n    #\n    # We delay enabling the PythonVersionWarning class until here so that,\n    # if they explicity disabled it in either in the command line or in\n    # $SCONSFLAGS, or in the SConscript file, then the search through\n    # the list of deprecated warning classes will find that disabling\n    # first and not issue the warning.\n    #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we've read the SConscript files, we can check for the\n    # warning about deprecated Python versions--delayed until here\n    # in case they disabled the warning in the SConscript files.\n    if python_version_deprecated():\n        msg = \"Support for pre-%s Python version (%s) is deprecated.\\n\" + \\\n              \"    If this will cause hardship, contact scons-dev@scons.org\"\n        deprecated_version_string = \".\".join(map(str, deprecated_python_version))\n        SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,\n                            msg % (deprecated_version_string, python_version_string()))\n\n    if not options.help:\n        # [ ] Clarify why we need to create Builder here at all, and\n        #     why it is created in DefaultEnvironment\n        # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30\n        if SCons.SConf.NeedConfigHBuilder():\n            SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())\n\n    # Now re-parse the command-line options (any to the left of a '--'\n    # argument, that is) with any user-defined command-line options that\n    # the SConscript files may have added to the parser object.  This will\n    # emit the appropriate error message and exit if any unknown option\n    # was specified on the command line.\n\n    parser.preserve_unknown_options = False\n    parser.parse_args(parser.largs, options)\n\n    if options.help:\n        help_text = SCons.Script.help_text\n        if help_text is None:\n            # They specified -h, but there was no Help() inside the\n            # SConscript files.  Give them the options usage.\n            raise SConsPrintHelpException\n        else:\n            print help_text\n            print \"Use scons -H for help about command-line options.\"\n        exit_status = 0\n        return\n\n    # Change directory to the top-level SConstruct directory, then tell\n    # the Node.FS subsystem that we're all done reading the SConscript\n    # files and calling Repository() and VariantDir() and changing\n    # directories and the like, so it can go ahead and start memoizing\n    # the string values of file system nodes.\n\n    fs.chdir(fs.Top)\n\n    SCons.Node.FS.save_strings(1)\n\n    # Now that we've read the SConscripts we can set the options\n    # that are SConscript settable:\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.FS.set_duplicate(options.duplicate)\n    fs.set_max_drift(options.max_drift)\n\n    SCons.Job.explicit_stack_size = options.stack_size\n\n    if options.md5_chunksize:\n        SCons.Node.FS.File.md5_chunksize = options.md5_chunksize\n\n    platform = SCons.Platform.platform_module()\n\n    if options.interactive:\n        SCons.Node.interactive = True\n        SCons.Script.Interactive.interact(fs, OptionsParser, options,\n                                          targets, target_top)\n\n    else:\n\n        # Build the targets\n        nodes = _build_targets(fs, options, targets, target_top)\n        if not nodes:\n            revert_io()\n            print 'Found nothing to build'\n            exit_status = 2\n\ndef _build_targets(fs, options, targets, target_top):\n\n    global this_build_status\n    this_build_status = 0\n\n    progress_display.set_mode(not (options.no_progress or options.silent))\n    display.set_mode(not options.silent)\n    SCons.Action.print_actions          = not options.silent\n    SCons.Action.execute_actions        = not options.no_exec\n    SCons.Node.FS.do_store_info         = not options.no_exec\n    SCons.Node.do_store_info            = not options.no_exec\n    SCons.SConf.dryrun                  = options.no_exec\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    SCons.CacheDir.cache_enabled = not options.cache_disable\n    SCons.CacheDir.cache_readonly = options.cache_readonly\n    SCons.CacheDir.cache_debug = options.cache_debug\n    SCons.CacheDir.cache_force = options.cache_force\n    SCons.CacheDir.cache_show = options.cache_show\n\n    if options.no_exec:\n        CleanTask.execute = CleanTask.show\n    else:\n        CleanTask.execute = CleanTask.remove\n\n    lookup_top = None\n    if targets or SCons.Script.BUILD_TARGETS != SCons.Script._build_plus_default:\n        # They specified targets on the command line or modified\n        # BUILD_TARGETS in the SConscript file(s), so if they used -u,\n        # -U or -D, we have to look up targets relative to the top,\n        # but we build whatever they specified.\n        if target_top:\n            lookup_top = fs.Dir(target_top)\n            target_top = None\n\n        targets = SCons.Script.BUILD_TARGETS\n    else:\n        # There are no targets specified on the command line,\n        # so if they used -u, -U or -D, we may have to restrict\n        # what actually gets built.\n        d = None\n        if target_top:\n            if options.climb_up == 1:\n                # -u, local directory and below\n                target_top = fs.Dir(target_top)\n                lookup_top = target_top\n            elif options.climb_up == 2:\n                # -D, all Default() targets\n                target_top = None\n                lookup_top = None\n            elif options.climb_up == 3:\n                # -U, local SConscript Default() targets\n                target_top = fs.Dir(target_top)\n                def check_dir(x, target_top=target_top):\n                    if hasattr(x, 'cwd') and not x.cwd is None:\n                        cwd = x.cwd.srcnode()\n                        return cwd == target_top\n                    else:\n                        # x doesn't have a cwd, so it's either not a target,\n                        # or not a file, so go ahead and keep it as a default\n                        # target and let the engine sort it out:\n                        return 1\n                d = list(filter(check_dir, SCons.Script.DEFAULT_TARGETS))\n                SCons.Script.DEFAULT_TARGETS[:] = d\n                target_top = None\n                lookup_top = None\n\n        targets = SCons.Script._Get_Default_Targets(d, fs)\n\n    if not targets:\n        sys.stderr.write(\"scons: *** No targets specified and no Default() targets found.  Stop.\\n\")\n        return None\n\n    def Entry(x, ltop=lookup_top, ttop=target_top, fs=fs):\n        if isinstance(x, SCons.Node.Node):\n            node = x\n        else:\n            node = None\n            # Why would ltop be None? Unfortunately this happens.\n            if ltop is None: ltop = ''\n            # Curdir becomes important when SCons is called with -u, -C,\n            # or similar option that changes directory, and so the paths\n            # of targets given on the command line need to be adjusted.\n            curdir = os.path.join(os.getcwd(), str(ltop))\n            for lookup in SCons.Node.arg2nodes_lookups:\n                node = lookup(x, curdir=curdir)\n                if node is not None:\n                    break\n            if node is None:\n                node = fs.Entry(x, directory=ltop, create=1)\n        if ttop and not node.is_under(ttop):\n            if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node):\n                node = ttop\n            else:\n                node = None\n        return node\n\n    nodes = [_f for _f in map(Entry, targets) if _f]\n\n    task_class = BuildTask      # default action is to build targets\n    opening_message = \"Building targets ...\"\n    closing_message = \"done building targets.\"\n    if options.keep_going:\n        failure_message = \"done building targets (errors occurred during build).\"\n    else:\n        failure_message = \"building terminated because of errors.\"\n    if options.question:\n        task_class = QuestionTask\n    try:\n        if options.clean:\n            task_class = CleanTask\n            opening_message = \"Cleaning targets ...\"\n            closing_message = \"done cleaning targets.\"\n            if options.keep_going:\n                failure_message = \"done cleaning targets (errors occurred during clean).\"\n            else:\n                failure_message = \"cleaning terminated because of errors.\"\n    except AttributeError:\n        pass\n\n    task_class.progress = ProgressObject\n\n    if options.random:\n        def order(dependencies):\n            \"\"\"Randomize the dependencies.\"\"\"\n            import random\n            # This is cribbed from the implementation of\n            # random.shuffle() in Python 2.X.\n            d = dependencies\n            for i in range(len(d)-1, 0, -1):\n                j = int(random.random() * (i+1))\n                d[i], d[j] = d[j], d[i]\n            return d\n    else:\n        def order(dependencies):\n            \"\"\"Leave the order of dependencies alone.\"\"\"\n            return dependencies\n\n    if options.taskmastertrace_file == '-':\n        tmtrace = sys.stdout\n    elif options.taskmastertrace_file:\n        tmtrace = open(options.taskmastertrace_file, 'wb')\n    else:\n        tmtrace = None\n    taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace)\n\n    # Let the BuildTask objects get at the options to respond to the\n    # various print_* settings, tree_printer list, etc.\n    BuildTask.options = options\n\n    global num_jobs\n    num_jobs = options.num_jobs\n    jobs = SCons.Job.Jobs(num_jobs, taskmaster)\n    if num_jobs > 1:\n        msg = None\n        if jobs.num_jobs == 1:\n            msg = \"parallel builds are unsupported by this version of Python;\\n\" + \\\n                  \"\\tignoring -j or num_jobs option.\\n\"\n        elif sys.platform == 'win32':\n            msg = fetch_win32_parallel_msg()\n\n        # Nuitka: We know we are not affected.\n        if False and msg:\n            SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg)\n\n    memory_stats.append('before building targets:')\n    count_stats.append(('pre-', 'build'))\n\n    def jobs_postfunc(\n        jobs=jobs,\n        options=options,\n        closing_message=closing_message,\n        failure_message=failure_message\n        ):\n        if jobs.were_interrupted():\n            if not options.no_progress and not options.silent:\n                sys.stderr.write(\"scons: Build interrupted.\\n\")\n            global exit_status\n            global this_build_status\n            exit_status = 2\n            this_build_status = 2\n\n        if this_build_status:\n            progress_display(\"scons: \" + failure_message)\n        else:\n            progress_display(\"scons: \" + closing_message)\n        if not options.no_exec:\n            if jobs.were_interrupted():\n                progress_display(\"scons: writing .sconsign file.\")\n            SCons.SConsign.write()\n\n    progress_display(\"scons: \" + opening_message)\n    jobs.run(postfunc = jobs_postfunc)\n\n    memory_stats.append('after building targets:')\n    count_stats.append(('post-', 'build'))\n\n    return nodes\n\ndef _exec_main(parser, values):\n    sconsflags = os.environ.get('SCONSFLAGS', '')\n    all_args = sconsflags.split() + sys.argv[1:]\n\n    options, args = parser.parse_args(all_args, values)\n\n    if isinstance(options.debug, list) and \"pdb\" in options.debug:\n        import pdb\n        pdb.Pdb().runcall(_main, parser)\n    elif options.profile_file:\n        # compat layer imports \"cProfile\" for us if it's available.\n        from profile import Profile\n\n        # Some versions of Python 2.4 shipped a profiler that had the\n        # wrong 'c_exception' entry in its dispatch table.  Make sure\n        # we have the right one.  (This may put an unnecessary entry\n        # in the table in earlier versions of Python, but its presence\n        # shouldn't hurt anything).\n        try:\n            dispatch = Profile.dispatch\n        except AttributeError:\n            pass\n        else:\n            dispatch['c_exception'] = Profile.trace_dispatch_return\n\n        prof = Profile()\n        try:\n            prof.runcall(_main, parser)\n        finally:\n            prof.dump_stats(options.profile_file)\n    else:\n        _main(parser)\n\ndef main():\n    global OptionsParser\n    global exit_status\n    global first_command_start\n\n    # Check up front for a Python version we do not support.  We\n    # delay the check for deprecated Python versions until later,\n    # after the SConscript files have been read, in case they\n    # disable that warning.\n    if python_version_unsupported():\n        msg = \"scons: *** SCons version %s does not run under Python version %s.\\n\"\n        sys.stderr.write(msg % (SCons.__version__, python_version_string()))\n        sys.exit(1)\n\n    parts = [\"SCons by Steven Knight et al.:\\n\"]\n    try:\n        import __main__\n        parts.append(version_string(\"script\", __main__))\n    except (ImportError, AttributeError):\n        # On Windows there is no scons.py, so there is no\n        # __main__.__version__, hence there is no script version.\n        pass\n    parts.append(version_string(\"engine\", SCons))\n    parts.append(path_string(\"engine\", SCons))\n    parts.append(\"Copyright (c) 2001 - 2014 The SCons Foundation\")\n    version = ''.join(parts)\n\n    import SConsOptions\n    parser = SConsOptions.Parser(version)\n    values = SConsOptions.SConsValues(parser.get_default_values())\n\n    OptionsParser = parser\n\n    try:\n        try:\n            _exec_main(parser, values)\n        finally:\n            revert_io()\n    except SystemExit, s:\n        if s:\n            exit_status = s\n    except KeyboardInterrupt:\n        print(\"scons: Build interrupted.\")\n        sys.exit(2)\n    except SyntaxError, e:\n        _scons_syntax_error(e)\n    except SCons.Errors.InternalError:\n        _scons_internal_error()\n    except SCons.Errors.UserError, e:\n        _scons_user_error(e)\n    except SConsPrintHelpException:\n        parser.print_help()\n        exit_status = 0\n    except SCons.Errors.BuildError, e:\n        print e\n        exit_status = e.exitstatus\n    except:\n        # An exception here is likely a builtin Python exception Python\n        # code in an SConscript file.  Show them precisely what the\n        # problem was and where it happened.\n        SCons.Script._SConscript.SConscript_exception()\n        sys.exit(2)\n\n    memory_stats.print_stats()\n    count_stats.print_stats()\n\n    if print_objects:\n        SCons.Debug.listLoggedInstances('*')\n        #SCons.Debug.dumpLoggedInstances('*')\n\n    if print_memoizer:\n        SCons.Memoize.Dump(\"Memoizer (memory cache) hits and misses:\")\n\n    # Dump any development debug info that may have been enabled.\n    # These are purely for internal debugging during development, so\n    # there's no need to control them with --debug= options; they're\n    # controlled by changing the source code.\n    SCons.Debug.dump_caller_counts()\n    SCons.Taskmaster.dump_stats()\n\n    if print_time:\n        total_time = time.time() - SCons.Script.start_time\n        if num_jobs == 1:\n            ct = cumulative_command_time\n        else:\n            if last_command_end is None or first_command_start is None:\n                ct = 0.0\n            else:\n                ct = last_command_end - first_command_start\n        scons_time = total_time - sconscript_time - ct\n        print \"Total build time: %f seconds\"%total_time\n        print \"Total SConscript file execution time: %f seconds\"%sconscript_time\n        print \"Total SCons execution time: %f seconds\"%scons_time\n        print \"Total command execution time: %f seconds\"%ct\n\n    sys.exit(exit_status)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Script/SConsOptions.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Script/SConsOptions.py  2014/07/05 09:42:21 garyo\"\n\nimport optparse\nimport re\nimport sys\nimport textwrap\n\nno_hyphen_re = re.compile(r'(\\s+|(?<=[\\w\\!\\\"\\'\\&\\.\\,\\?])-{2,}(?=\\w))')\n\ntry:\n    from gettext import gettext\nexcept ImportError:\n    def gettext(message):\n        return message\n_ = gettext\n\nimport SCons.Node.FS\nimport SCons.Warnings\n\nOptionValueError        = optparse.OptionValueError\nSUPPRESS_HELP           = optparse.SUPPRESS_HELP\n\ndiskcheck_all = SCons.Node.FS.diskcheck_types()\n\ndef diskcheck_convert(value):\n    if value is None:\n        return []\n    if not SCons.Util.is_List(value):\n        value = value.split(',')\n    result = []\n    for v in value:\n        v = v.lower()\n        if v == 'all':\n            result = diskcheck_all\n        elif v == 'none':\n            result = []\n        elif v in diskcheck_all:\n            result.append(v)\n        else:\n            raise ValueError(v)\n    return result\n\nclass SConsValues(optparse.Values):\n    \"\"\"\n    Holder class for uniform access to SCons options, regardless\n    of whether or not they can be set on the command line or in the\n    SConscript files (using the SetOption() function).\n\n    A SCons option value can originate three different ways:\n\n        1)  set on the command line;\n        2)  set in an SConscript file;\n        3)  the default setting (from the the op.add_option()\n            calls in the Parser() function, below).\n\n    The command line always overrides a value set in a SConscript file,\n    which in turn always overrides default settings.  Because we want\n    to support user-specified options in the SConscript file itself,\n    though, we may not know about all of the options when the command\n    line is first parsed, so we can't make all the necessary precedence\n    decisions at the time the option is configured.\n\n    The solution implemented in this class is to keep these different sets\n    of settings separate (command line, SConscript file, and default)\n    and to override the __getattr__() method to check them in turn.\n    This should allow the rest of the code to just fetch values as\n    attributes of an instance of this class, without having to worry\n    about where they came from.\n\n    Note that not all command line options are settable from SConscript\n    files, and the ones that are must be explicitly added to the\n    \"settable\" list in this class, and optionally validated and coerced\n    in the set_option() method.\n    \"\"\"\n\n    def __init__(self, defaults):\n        self.__dict__['__defaults__'] = defaults\n        self.__dict__['__SConscript_settings__'] = {}\n\n    def __getattr__(self, attr):\n        \"\"\"\n        Fetches an options value, checking first for explicit settings\n        from the command line (which are direct attributes), then the\n        SConscript file settings, then the default values.\n        \"\"\"\n        try:\n            return self.__dict__[attr]\n        except KeyError:\n            try:\n                return self.__dict__['__SConscript_settings__'][attr]\n            except KeyError:\n                return getattr(self.__dict__['__defaults__'], attr)\n\n    settable = [\n        'clean',\n        'diskcheck',\n        'duplicate',\n        'help',\n        'implicit_cache',\n        'max_drift',\n        'md5_chunksize',\n        'no_exec',\n        'num_jobs',\n        'random',\n        'stack_size',\n        'warn',\n    ]\n\n    def set_option(self, name, value):\n        \"\"\"\n        Sets an option from an SConscript file.\n        \"\"\"\n        if not name in self.settable:\n            raise SCons.Errors.UserError(\"This option is not settable from a SConscript file: %s\"%name)\n\n        if name == 'num_jobs':\n            try:\n                value = int(value)\n                if value < 1:\n                    raise ValueError\n            except ValueError:\n                raise SCons.Errors.UserError(\"A positive integer is required: %s\"%repr(value))\n        elif name == 'max_drift':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'duplicate':\n            try:\n                value = str(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"A string is required: %s\"%repr(value))\n            if not value in SCons.Node.FS.Valid_Duplicates:\n                raise SCons.Errors.UserError(\"Not a valid duplication style: %s\" % value)\n            # Set the duplicate style right away so it can affect linking\n            # of SConscript files.\n            SCons.Node.FS.set_duplicate(value)\n        elif name == 'diskcheck':\n            try:\n                value = diskcheck_convert(value)\n            except ValueError, v:\n                raise SCons.Errors.UserError(\"Not a valid diskcheck value: %s\"%v)\n            if 'diskcheck' not in self.__dict__:\n                # No --diskcheck= option was specified on the command line.\n                # Set this right away so it can affect the rest of the\n                # file/Node lookups while processing the SConscript files.\n                SCons.Node.FS.set_diskcheck(value)\n        elif name == 'stack_size':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'md5_chunksize':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'warn':\n            if SCons.Util.is_String(value):\n                value = [value]\n            value = self.__SConscript_settings__.get(name, []) + value\n            SCons.Warnings.process_warn_strings(value)\n\n        self.__SConscript_settings__[name] = value\n\nclass SConsOption(optparse.Option):\n    def convert_value(self, opt, value):\n        if value is not None:\n            if self.nargs in (1, '?'):\n                return self.check_value(opt, value)\n            else:\n                return tuple([self.check_value(opt, v) for v in value])\n\n    def process(self, opt, value, values, parser):\n\n        # First, convert the value(s) to the right type.  Howl if any\n        # value(s) are bogus.\n        value = self.convert_value(opt, value)\n\n        # And then take whatever action is expected of us.\n        # This is a separate method to make life easier for\n        # subclasses to add new actions.\n        return self.take_action(\n            self.action, self.dest, opt, value, values, parser)\n\n    def _check_nargs_optional(self):\n        if self.nargs == '?' and self._short_opts:\n            fmt = \"option %s: nargs='?' is incompatible with short options\"\n            raise SCons.Errors.UserError(fmt % self._short_opts[0])\n\n    try:\n        _orig_CONST_ACTIONS = optparse.Option.CONST_ACTIONS\n\n        _orig_CHECK_METHODS = optparse.Option.CHECK_METHODS\n\n    except AttributeError:\n        # optparse.Option had no CONST_ACTIONS before Python 2.5.\n\n        _orig_CONST_ACTIONS = (\"store_const\",)\n\n        def _check_const(self):\n            if self.action not in self.CONST_ACTIONS and self.const is not None:\n                raise OptionError(\n                    \"'const' must not be supplied for action %r\" % self.action,\n                    self)\n\n        # optparse.Option collects its list of unbound check functions\n        # up front.  This sucks because it means we can't just override\n        # the _check_const() function like a normal method, we have to\n        # actually replace it in the list.  This seems to be the most\n        # straightforward way to do that.\n\n        _orig_CHECK_METHODS = [optparse.Option._check_action,\n                     optparse.Option._check_type,\n                     optparse.Option._check_choice,\n                     optparse.Option._check_dest,\n                     _check_const,\n                     optparse.Option._check_nargs,\n                     optparse.Option._check_callback]\n\n    CHECK_METHODS = _orig_CHECK_METHODS + [_check_nargs_optional]\n\n    CONST_ACTIONS = _orig_CONST_ACTIONS + optparse.Option.TYPED_ACTIONS\n\nclass SConsOptionGroup(optparse.OptionGroup):\n    \"\"\"\n    A subclass for SCons-specific option groups.\n\n    The only difference between this and the base class is that we print\n    the group's help text flush left, underneath their own title but\n    lined up with the normal \"SCons Options\".\n    \"\"\"\n    def format_help(self, formatter):\n        \"\"\"\n        Format an option group's help text, outdenting the title so it's\n        flush with the \"SCons Options\" title we print at the top.\n        \"\"\"\n        formatter.dedent()\n        result = formatter.format_heading(self.title)\n        formatter.indent()\n        result = result + optparse.OptionContainer.format_help(self, formatter)\n        return result\n\nclass SConsOptionParser(optparse.OptionParser):\n    preserve_unknown_options = False\n\n    def error(self, msg):\n        # overriden OptionValueError exception handler\n        self.print_usage(sys.stderr)\n        sys.stderr.write(\"SCons Error: %s\\n\" % msg)\n        sys.exit(2)\n\n    def _process_long_opt(self, rargs, values):\n        \"\"\"\n        SCons-specific processing of long options.\n\n        This is copied directly from the normal\n        optparse._process_long_opt() method, except that, if configured\n        to do so, we catch the exception thrown when an unknown option\n        is encountered and just stick it back on the \"leftover\" arguments\n        for later (re-)processing.\n        \"\"\"\n        arg = rargs.pop(0)\n\n        # Value explicitly attached to arg?  Pretend it's the next\n        # argument.\n        if \"=\" in arg:\n            (opt, next_arg) = arg.split(\"=\", 1)\n            rargs.insert(0, next_arg)\n            had_explicit_value = True\n        else:\n            opt = arg\n            had_explicit_value = False\n\n        try:\n            opt = self._match_long_opt(opt)\n        except optparse.BadOptionError:\n            if self.preserve_unknown_options:\n                # SCons-specific:  if requested, add unknown options to\n                # the \"leftover arguments\" list for later processing.\n                self.largs.append(arg)\n                if had_explicit_value:\n                    # The unknown option will be re-processed later,\n                    # so undo the insertion of the explicit value.\n                    rargs.pop(0)\n                return\n            raise\n\n        option = self._long_opt[opt]\n        if option.takes_value():\n            nargs = option.nargs\n            if nargs == '?':\n                if had_explicit_value:\n                    value = rargs.pop(0)\n                else:\n                    value = option.const\n            elif len(rargs) < nargs:\n                if nargs == 1:\n                    self.error(_(\"%s option requires an argument\") % opt)\n                else:\n                    self.error(_(\"%s option requires %d arguments\")\n                               % (opt, nargs))\n            elif nargs == 1:\n                value = rargs.pop(0)\n            else:\n                value = tuple(rargs[0:nargs])\n                del rargs[0:nargs]\n\n        elif had_explicit_value:\n            self.error(_(\"%s option does not take a value\") % opt)\n\n        else:\n            value = None\n\n        option.process(opt, value, values, self)\n\n    def reparse_local_options(self):\n        \"\"\"\n        Re-parse the leftover command-line options stored\n        in self.largs, so that any value overridden on the\n        command line is immediately available if the user turns\n        around and does a GetOption() right away.\n\n        We mimic the processing of the single args\n        in the original OptionParser._process_args(), but here we\n        allow exact matches for long-opts only (no partial\n        argument names!).\n\n        Else, this would lead to problems in add_local_option()\n        below. When called from there, we try to reparse the\n        command-line arguments that\n          1. haven't been processed so far (self.largs), but\n          2. are possibly not added to the list of options yet.\n\n        So, when we only have a value for \"--myargument\" yet,\n        a command-line argument of \"--myarg=test\" would set it.\n        Responsible for this behaviour is the method\n        _match_long_opt(), which allows for partial matches of\n        the option name, as long as the common prefix appears to\n        be unique.\n        This would lead to further confusion, because we might want\n        to add another option \"--myarg\" later on (see issue #2929).\n\n        \"\"\"\n        rargs = []\n        largs_restore = []\n        # Loop over all remaining arguments\n        skip = False\n        for l in self.largs:\n            if skip:\n                # Accept all remaining arguments as they are\n                largs_restore.append(l)\n            else:\n                if len(l) > 2 and l[0:2] == \"--\":\n                    # Check long option\n                    lopt = (l,)\n                    if \"=\" in l:\n                        # Split into option and value\n                        lopt = l.split(\"=\", 1)\n\n                    if lopt[0] in self._long_opt:\n                        # Argument is already known\n                        rargs.append('='.join(lopt))\n                    else:\n                        # Not known yet, so reject for now\n                        largs_restore.append('='.join(lopt))\n                else:\n                    if l == \"--\" or l == \"-\":\n                        # Stop normal processing and don't\n                        # process the rest of the command-line opts\n                        largs_restore.append(l)\n                        skip = True\n                    else:\n                        rargs.append(l)\n\n        # Parse the filtered list\n        self.parse_args(rargs, self.values)\n        # Restore the list of remaining arguments for the\n        # next call of AddOption/add_local_option...\n        self.largs = self.largs + largs_restore\n\n    def add_local_option(self, *args, **kw):\n        \"\"\"\n        Adds a local option to the parser.\n\n        This is initiated by a SetOption() call to add a user-defined\n        command-line option.  We add the option to a separate option\n        group for the local options, creating the group if necessary.\n        \"\"\"\n        try:\n            group = self.local_option_group\n        except AttributeError:\n            group = SConsOptionGroup(self, 'Local Options')\n            group = self.add_option_group(group)\n            self.local_option_group = group\n\n        result = group.add_option(*args, **kw)\n\n        if result:\n            # The option was added succesfully.  We now have to add the\n            # default value to our object that holds the default values\n            # (so that an attempt to fetch the option's attribute will\n            # yield the default value when not overridden) and then\n            # we re-parse the leftover command-line options, so that\n            # any value overridden on the command line is immediately\n            # available if the user turns around and does a GetOption()\n            # right away.\n            setattr(self.values.__defaults__, result.dest, result.default)\n            self.reparse_local_options()\n\n        return result\n\nclass SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter):\n    def format_usage(self, usage):\n        return \"usage: %s\\n\" % usage\n\n    def format_heading(self, heading):\n        \"\"\"\n        This translates any heading of \"options\" or \"Options\" into\n        \"SCons Options.\"  Unfortunately, we have to do this here,\n        because those titles are hard-coded in the optparse calls.\n        \"\"\"\n        if heading == 'options':\n            # The versions of optparse.py shipped with Pythons 2.3 and\n            # 2.4 pass this in uncapitalized; override that so we get\n            # consistent output on all versions.\n            heading = \"Options\"\n        if heading == 'Options':\n            heading = \"SCons Options\"\n        return optparse.IndentedHelpFormatter.format_heading(self, heading)\n\n    def format_option(self, option):\n        \"\"\"\n        A copy of the normal optparse.IndentedHelpFormatter.format_option()\n        method.  This has been snarfed so we can modify text wrapping to\n        out liking:\n\n        --  add our own regular expression that doesn't break on hyphens\n            (so things like --no-print-directory don't get broken);\n\n        --  wrap the list of options themselves when it's too long\n            (the wrapper.fill(opts) call below);\n\n        --  set the subsequent_indent when wrapping the help_text.\n        \"\"\"\n        # The help for each option consists of two parts:\n        #   * the opt strings and metavars\n        #     eg. (\"-x\", or \"-fFILENAME, --file=FILENAME\")\n        #   * the user-supplied help string\n        #     eg. (\"turn on expert mode\", \"read data from FILENAME\")\n        #\n        # If possible, we write both of these on the same line:\n        #   -x      turn on expert mode\n        #\n        # But if the opt string list is too long, we put the help\n        # string on a second line, indented to the same column it would\n        # start in if it fit on the first line.\n        #   -fFILENAME, --file=FILENAME\n        #           read data from FILENAME\n        result = []\n\n        try:\n            opts = self.option_strings[option]\n        except AttributeError:\n            # The Python 2.3 version of optparse attaches this to\n            # to the option argument, not to this object.\n            opts = option.option_strings\n\n        opt_width = self.help_position - self.current_indent - 2\n        if len(opts) > opt_width:\n            wrapper = textwrap.TextWrapper(width=self.width,\n                                           initial_indent = '  ',\n                                           subsequent_indent = '  ')\n            wrapper.wordsep_re = no_hyphen_re\n            opts = wrapper.fill(opts) + '\\n'\n            indent_first = self.help_position\n        else:                       # start help on same line as opts\n            opts = \"%*s%-*s  \" % (self.current_indent, \"\", opt_width, opts)\n            indent_first = 0\n        result.append(opts)\n        if option.help:\n\n            try:\n                expand_default = self.expand_default\n            except AttributeError:\n                # The HelpFormatter base class in the Python 2.3 version\n                # of optparse has no expand_default() method.\n                help_text = option.help\n            else:\n                help_text = expand_default(option)\n\n            # SCons:  indent every line of the help text but the first.\n            wrapper = textwrap.TextWrapper(width=self.help_width,\n                                           subsequent_indent = '  ')\n            wrapper.wordsep_re = no_hyphen_re\n            help_lines = wrapper.wrap(help_text)\n            result.append(\"%*s%s\\n\" % (indent_first, \"\", help_lines[0]))\n            for line in help_lines[1:]:\n                result.append(\"%*s%s\\n\" % (self.help_position, \"\", line))\n        elif opts[-1] != \"\\n\":\n            result.append(\"\\n\")\n        return \"\".join(result)\n\n    # For consistent help output across Python versions, we provide a\n    # subclass copy of format_option_strings() and these two variables.\n    # This is necessary (?) for Python2.3, which otherwise concatenates\n    # a short option with its metavar.\n    _short_opt_fmt = \"%s %s\"\n    _long_opt_fmt = \"%s=%s\"\n\n    def format_option_strings(self, option):\n        \"\"\"Return a comma-separated list of option strings & metavariables.\"\"\"\n        if option.takes_value():\n            metavar = option.metavar or option.dest.upper()\n            short_opts = []\n            for sopt in option._short_opts:\n                short_opts.append(self._short_opt_fmt % (sopt, metavar))\n            long_opts = []\n            for lopt in option._long_opts:\n                long_opts.append(self._long_opt_fmt % (lopt, metavar))\n        else:\n            short_opts = option._short_opts\n            long_opts = option._long_opts\n\n        if self.short_first:\n            opts = short_opts + long_opts\n        else:\n            opts = long_opts + short_opts\n\n        return \", \".join(opts)\n\ndef Parser(version):\n    \"\"\"\n    Returns an options parser object initialized with the standard\n    SCons options.\n    \"\"\"\n\n    formatter = SConsIndentedHelpFormatter(max_help_position=30)\n\n    op = SConsOptionParser(option_class=SConsOption,\n                           add_help_option=False,\n                           formatter=formatter,\n                           usage=\"usage: scons [OPTION] [TARGET] ...\",)\n\n    op.preserve_unknown_options = True\n    op.version = version\n\n    # Add the options to the parser we just created.\n    #\n    # These are in the order we want them to show up in the -H help\n    # text, basically alphabetical.  Each op.add_option() call below\n    # should have a consistent format:\n    #\n    #   op.add_option(\"-L\", \"--long-option-name\",\n    #                 nargs=1, type=\"string\",\n    #                 dest=\"long_option_name\", default='foo',\n    #                 action=\"callback\", callback=opt_long_option,\n    #                 help=\"help text goes here\",\n    #                 metavar=\"VAR\")\n    #\n    # Even though the optparse module constructs reasonable default\n    # destination names from the long option names, we're going to be\n    # explicit about each one for easier readability and so this code\n    # will at least show up when grepping the source for option attribute\n    # names, or otherwise browsing the source code.\n\n    # options ignored for compatibility\n    def opt_ignore(option, opt, value, parser):\n        sys.stderr.write(\"Warning:  ignoring %s option\\n\" % opt)\n    op.add_option(\"-b\", \"-d\", \"-e\", \"-m\", \"-S\", \"-t\", \"-w\",\n                  \"--environment-overrides\",\n                  \"--no-keep-going\",\n                  \"--no-print-directory\",\n                  \"--print-directory\",\n                  \"--stop\",\n                  \"--touch\",\n                  action=\"callback\", callback=opt_ignore,\n                  help=\"Ignored for compatibility.\")\n\n    op.add_option('-c', '--clean', '--remove',\n                  dest=\"clean\", default=False,\n                  action=\"store_true\",\n                  help=\"Remove specified targets and dependencies.\")\n\n    op.add_option('-C', '--directory',\n                  nargs=1, type=\"string\",\n                  dest=\"directory\", default=[],\n                  action=\"append\",\n                  help=\"Change to DIR before doing anything.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--cache-debug',\n                  nargs=1,\n                  dest=\"cache_debug\", default=None,\n                  action=\"store\",\n                  help=\"Print CacheDir debug info to FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('--cache-disable', '--no-cache',\n                  dest='cache_disable', default=False,\n                  action=\"store_true\",\n                  help=\"Do not retrieve built targets from CacheDir.\")\n\n    op.add_option('--cache-force', '--cache-populate',\n                  dest='cache_force', default=False,\n                  action=\"store_true\",\n                  help=\"Copy already-built targets into the CacheDir.\")\n\n    op.add_option('--cache-readonly',\n                  dest='cache_readonly', default=False,\n                  action=\"store_true\",\n                  help=\"Do not update CacheDir with built targets.\")\n\n    op.add_option('--cache-show',\n                  dest='cache_show', default=False,\n                  action=\"store_true\",\n                  help=\"Print build actions for files from CacheDir.\")\n\n    def opt_invalid(group, value, options):\n        errmsg  = \"`%s' is not a valid %s option type, try:\\n\" % (value, group)\n        return errmsg + \"    %s\" % \", \".join(options)\n\n    config_options = [\"auto\", \"force\" ,\"cache\"]\n\n    def opt_config(option, opt, value, parser, c_options=config_options):\n        if not value in c_options:\n            raise OptionValueError(opt_invalid('config', value, c_options))\n        setattr(parser.values, option.dest, value)\n\n    opt_config_help = \"Controls Configure subsystem: %s.\" \\\n                      % \", \".join(config_options)\n\n    op.add_option('--config',\n                  nargs=1, type=\"string\",\n                  dest=\"config\", default=\"auto\",\n                  action=\"callback\", callback=opt_config,\n                  help = opt_config_help,\n                  metavar=\"MODE\")\n\n    op.add_option('-D',\n                  dest=\"climb_up\", default=None,\n                  action=\"store_const\", const=2,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build all Default() targets.\")\n\n    deprecated_debug_options = {\n        \"dtree\"         : '; please use --tree=derived instead',\n        \"nomemoizer\"    : ' and has no effect',\n        \"stree\"         : '; please use --tree=all,status instead',\n        \"tree\"          : '; please use --tree=all instead',\n    }\n\n    debug_options = [\"count\", \"duplicate\", \"explain\", \"findlibs\",\n                     \"includes\", \"memoizer\", \"memory\", \"objects\",\n                     \"pdb\", \"prepare\", \"presub\", \"stacktrace\",\n                     \"time\"]\n\n    def opt_debug(option, opt, value__, parser,\n                  debug_options=debug_options,\n                  deprecated_debug_options=deprecated_debug_options):\n        for value in value__.split(','):\n            if value in debug_options:\n                parser.values.debug.append(value)\n            elif value in deprecated_debug_options.keys():\n                parser.values.debug.append(value)\n                try:\n                    parser.values.delayed_warnings\n                except AttributeError:\n                    parser.values.delayed_warnings = []\n                msg = deprecated_debug_options[value]\n                w = \"The --debug=%s option is deprecated%s.\" % (value, msg)\n                t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)\n                parser.values.delayed_warnings.append(t)\n            else:\n                raise OptionValueError(opt_invalid('debug', value, debug_options))\n\n    opt_debug_help = \"Print various types of debugging information: %s.\" \\\n                     % \", \".join(debug_options)\n    op.add_option('--debug',\n                  nargs=1, type=\"string\",\n                  dest=\"debug\", default=[],\n                  action=\"callback\", callback=opt_debug,\n                  help=opt_debug_help,\n                  metavar=\"TYPE\")\n\n    def opt_diskcheck(option, opt, value, parser):\n        try:\n            diskcheck_value = diskcheck_convert(value)\n        except ValueError, e:\n            raise OptionValueError(\"`%s' is not a valid diskcheck type\" % e)\n        setattr(parser.values, option.dest, diskcheck_value)\n\n    op.add_option('--diskcheck',\n                  nargs=1, type=\"string\",\n                  dest='diskcheck', default=None,\n                  action=\"callback\", callback=opt_diskcheck,\n                  help=\"Enable specific on-disk checks.\",\n                  metavar=\"TYPE\")\n\n    def opt_duplicate(option, opt, value, parser):\n        if not value in SCons.Node.FS.Valid_Duplicates:\n            raise OptionValueError(opt_invalid('duplication', value,\n                                              SCons.Node.FS.Valid_Duplicates))\n        setattr(parser.values, option.dest, value)\n        # Set the duplicate style right away so it can affect linking\n        # of SConscript files.\n        SCons.Node.FS.set_duplicate(value)\n\n    opt_duplicate_help = \"Set the preferred duplication methods. Must be one of \" \\\n                         + \", \".join(SCons.Node.FS.Valid_Duplicates)\n\n    op.add_option('--duplicate',\n                  nargs=1, type=\"string\",\n                  dest=\"duplicate\", default='hard-soft-copy',\n                  action=\"callback\", callback=opt_duplicate,\n                  help=opt_duplicate_help)\n\n    op.add_option('-f', '--file', '--makefile', '--sconstruct',\n                  nargs=1, type=\"string\",\n                  dest=\"file\", default=[],\n                  action=\"append\",\n                  help=\"Read FILE as the top-level SConstruct file.\")\n\n    op.add_option('-h', '--help',\n                  dest=\"help\", default=False,\n                  action=\"store_true\",\n                  help=\"Print defined help message, or this one.\")\n\n    op.add_option(\"-H\", \"--help-options\",\n                  action=\"help\",\n                  help=\"Print this message and exit.\")\n\n    op.add_option('-i', '--ignore-errors',\n                  dest='ignore_errors', default=False,\n                  action=\"store_true\",\n                  help=\"Ignore errors from build actions.\")\n\n    op.add_option('-I', '--include-dir',\n                  nargs=1,\n                  dest='include_dir', default=[],\n                  action=\"append\",\n                  help=\"Search DIR for imported Python modules.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--implicit-cache',\n                  dest='implicit_cache', default=False,\n                  action=\"store_true\",\n                  help=\"Cache implicit dependencies\")\n\n    def opt_implicit_deps(option, opt, value, parser):\n        setattr(parser.values, 'implicit_cache', True)\n        setattr(parser.values, option.dest, True)\n\n    op.add_option('--implicit-deps-changed',\n                  dest=\"implicit_deps_changed\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore cached implicit dependencies.\")\n\n    op.add_option('--implicit-deps-unchanged',\n                  dest=\"implicit_deps_unchanged\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore changes in implicit dependencies.\")\n\n    op.add_option('--interact', '--interactive',\n                  dest='interactive', default=False,\n                  action=\"store_true\",\n                  help=\"Run in interactive mode.\")\n\n    op.add_option('-j', '--jobs',\n                  nargs=1, type=\"int\",\n                  dest=\"num_jobs\", default=1,\n                  action=\"store\",\n                  help=\"Allow N jobs at once.\",\n                  metavar=\"N\")\n\n    op.add_option('-k', '--keep-going',\n                  dest='keep_going', default=False,\n                  action=\"store_true\",\n                  help=\"Keep going when a target can't be made.\")\n\n    op.add_option('--max-drift',\n                  nargs=1, type=\"int\",\n                  dest='max_drift', default=SCons.Node.FS.default_max_drift,\n                  action=\"store\",\n                  help=\"Set maximum system clock drift to N seconds.\",\n                  metavar=\"N\")\n\n    op.add_option('--md5-chunksize',\n                  nargs=1, type=\"int\",\n                  dest='md5_chunksize', default=SCons.Node.FS.File.md5_chunksize,\n                  action=\"store\",\n                  help=\"Set chunk-size for MD5 signature computation to N kilobytes.\",\n                  metavar=\"N\")\n\n    op.add_option('-n', '--no-exec', '--just-print', '--dry-run', '--recon',\n                  dest='no_exec', default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; just print commands.\")\n\n    op.add_option('--no-site-dir',\n                  dest='no_site_dir', default=False,\n                  action=\"store_true\",\n                  help=\"Don't search or use the usual site_scons dir.\")\n\n    op.add_option('--profile',\n                  nargs=1,\n                  dest=\"profile_file\", default=None,\n                  action=\"store\",\n                  help=\"Profile SCons and put results in FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('-q', '--question',\n                  dest=\"question\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; exit status says if up to date.\")\n\n    op.add_option('-Q',\n                  dest='no_progress', default=False,\n                  action=\"store_true\",\n                  help=\"Suppress \\\"Reading/Building\\\" progress messages.\")\n\n    op.add_option('--random',\n                  dest=\"random\", default=False,\n                  action=\"store_true\",\n                  help=\"Build dependencies in random order.\")\n\n    op.add_option('-s', '--silent', '--quiet',\n                  dest=\"silent\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't print commands.\")\n\n    op.add_option('--site-dir',\n                  nargs=1,\n                  dest='site_dir', default=None,\n                  action=\"store\",\n                  help=\"Use DIR instead of the usual site_scons dir.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--stack-size',\n                  nargs=1, type=\"int\",\n                  dest='stack_size',\n                  action=\"store\",\n                  help=\"Set the stack size of the threads used to run jobs to N kilobytes.\",\n                  metavar=\"N\")\n\n    op.add_option('--taskmastertrace',\n                  nargs=1,\n                  dest=\"taskmastertrace_file\", default=None,\n                  action=\"store\",\n                  help=\"Trace Node evaluation to FILE.\",\n                  metavar=\"FILE\")\n\n    tree_options = [\"all\", \"derived\", \"prune\", \"status\"]\n\n    def opt_tree(option, opt, value, parser, tree_options=tree_options):\n        import Main\n        tp = Main.TreePrinter()\n        for o in value.split(','):\n            if o == 'all':\n                tp.derived = False\n            elif o == 'derived':\n                tp.derived = True\n            elif o == 'prune':\n                tp.prune = True\n            elif o == 'status':\n                tp.status = True\n            else:\n                raise OptionValueError(opt_invalid('--tree', o, tree_options))\n        parser.values.tree_printers.append(tp)\n\n    opt_tree_help = \"Print a dependency tree in various formats: %s.\" \\\n                    % \", \".join(tree_options)\n\n    op.add_option('--tree',\n                  nargs=1, type=\"string\",\n                  dest=\"tree_printers\", default=[],\n                  action=\"callback\", callback=opt_tree,\n                  help=opt_tree_help,\n                  metavar=\"OPTIONS\")\n\n    op.add_option('-u', '--up', '--search-up',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=1,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build targets at or below current directory.\")\n\n    op.add_option('-U',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=3,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build Default() targets from local SConscript.\")\n\n    def opt_version(option, opt, value, parser):\n        sys.stdout.write(parser.version + '\\n')\n        sys.exit(0)\n    op.add_option(\"-v\", \"--version\",\n                  action=\"callback\", callback=opt_version,\n                  help=\"Print the SCons version number and exit.\")\n\n    def opt_warn(option, opt, value, parser, tree_options=tree_options):\n        if SCons.Util.is_String(value):\n            value = value.split(',')\n        parser.values.warn.extend(value)\n\n    op.add_option('--warn', '--warning',\n                  nargs=1, type=\"string\",\n                  dest=\"warn\", default=[],\n                  action=\"callback\", callback=opt_warn,\n                  help=\"Enable or disable warnings.\",\n                  metavar=\"WARNING-SPEC\")\n\n    op.add_option('-Y', '--repository', '--srcdir',\n                  nargs=1,\n                  dest=\"repository\", default=[],\n                  action=\"append\",\n                  help=\"Search REPOSITORY for source and target files.\")\n\n    # Options from Make and Cons classic that we do not yet support,\n    # but which we may support someday and whose (potential) meanings\n    # we don't want to change.  These all get a \"the -X option is not\n    # yet implemented\" message and don't show up in the help output.\n\n    def opt_not_yet(option, opt, value, parser):\n        msg = \"Warning:  the %s option is not yet implemented\\n\" % opt\n        sys.stderr.write(msg)\n\n    op.add_option('-l', '--load-average', '--max-load',\n                  nargs=1, type=\"float\",\n                  dest=\"load_average\", default=0,\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"store\",\n                  # help=\"Don't start multiple jobs unless load is below \"\n                  #      \"LOAD-AVERAGE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-actions',\n                  dest=\"list_actions\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and build actions.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-derived',\n                  dest=\"list_derived\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files that would be built.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-where',\n                  dest=\"list_where\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and where defined.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-o', '--old-file', '--assume-old',\n                  nargs=1, type=\"string\",\n                  dest=\"old_file\", default=[],\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"append\",\n                  # help = \"Consider FILE to be old; don't rebuild it.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--override',\n                  nargs=1, type=\"string\",\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"override\",\n                  # help=\"Override variables as specified in FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-p',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"p\",\n                  # help=\"Print internal environments/objects.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-r', '-R', '--no-builtin-rules', '--no-builtin-variables',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"no_builtin_rules\",\n                  # help=\"Clear default environments and variables.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--write-filenames',\n                  nargs=1, type=\"string\",\n                  dest=\"write_filenames\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Write all filenames examined into FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-W', '--new-file', '--assume-new', '--what-if',\n                  nargs=1, type=\"string\",\n                  dest=\"new_file\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Consider FILE to be changed.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--warn-undefined-variables',\n                  dest=\"warn_undefined_variables\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Warn when an undefined variable is referenced.\"\n                  help=SUPPRESS_HELP)\n\n    return op\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Script/SConscript.py",
    "content": "\"\"\"SCons.Script.SConscript\n\nThis module defines the Python API provided to SConscript and SConstruct\nfiles.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import division\n\n__revision__ = \"src/engine/SCons/Script/SConscript.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.Script.Main\nimport SCons.Tool\nimport SCons.Util\n\nimport collections\nimport os\nimport os.path\nimport re\nimport sys\nimport traceback\n\n# The following variables used to live in this module.  Some\n# SConscript files out there may have referred to them directly as\n# SCons.Script.SConscript.*.  This is now supported by some special\n# handling towards the bottom of the SConscript.__init__.py module.\n#Arguments = {}\n#ArgList = []\n#BuildTargets = TargetList()\n#CommandLineTargets = []\n#DefaultTargets = []\n\nclass SConscriptReturn(Exception):\n    pass\n\nlaunch_dir = os.path.abspath(os.curdir)\n\nGlobalDict = None\n\n# global exports set by Export():\nglobal_exports = {}\n\n# chdir flag\nsconscript_chdir = 1\n\ndef get_calling_namespaces():\n    \"\"\"Return the locals and globals for the function that called\n    into this module in the current call stack.\"\"\"\n    try: 1//0\n    except ZeroDivisionError:\n        # Don't start iterating with the current stack-frame to\n        # prevent creating reference cycles (f_back is safe).\n        frame = sys.exc_info()[2].tb_frame.f_back\n\n    # Find the first frame that *isn't* from this file.  This means\n    # that we expect all of the SCons frames that implement an Export()\n    # or SConscript() call to be in this file, so that we can identify\n    # the first non-Script.SConscript frame as the user's local calling\n    # environment, and the locals and globals dictionaries from that\n    # frame as the calling namespaces.  See the comment below preceding\n    # the DefaultEnvironmentCall block for even more explanation.\n    while frame.f_globals.get(\"__name__\") == __name__:\n        frame = frame.f_back\n\n    return frame.f_locals, frame.f_globals\n\n\ndef compute_exports(exports):\n    \"\"\"Compute a dictionary of exports given one of the parameters\n    to the Export() function or the exports argument to SConscript().\"\"\"\n\n    loc, glob = get_calling_namespaces()\n\n    retval = {}\n    try:\n        for export in exports:\n            if SCons.Util.is_Dict(export):\n                retval.update(export)\n            else:\n                try:\n                    retval[export] = loc[export]\n                except KeyError:\n                    retval[export] = glob[export]\n    except KeyError, x:\n        raise SCons.Errors.UserError(\"Export of non-existent variable '%s'\"%x)\n\n    return retval\n\nclass Frame(object):\n    \"\"\"A frame on the SConstruct/SConscript call stack\"\"\"\n    def __init__(self, fs, exports, sconscript):\n        self.globals = BuildDefaultGlobals()\n        self.retval = None\n        self.prev_dir = fs.getcwd()\n        self.exports = compute_exports(exports)  # exports from the calling SConscript\n        # make sure the sconscript attr is a Node.\n        if isinstance(sconscript, SCons.Node.Node):\n            self.sconscript = sconscript\n        elif sconscript == '-':\n            self.sconscript = None\n        else:\n            self.sconscript = fs.File(str(sconscript))\n\n# the SConstruct/SConscript call stack:\ncall_stack = []\n\n# For documentation on the methods in this file, see the scons man-page\n\ndef Return(*vars, **kw):\n    retval = []\n    try:\n        fvars = SCons.Util.flatten(vars)\n        for var in fvars:\n            for v in var.split():\n                retval.append(call_stack[-1].globals[v])\n    except KeyError, x:\n        raise SCons.Errors.UserError(\"Return of non-existent variable '%s'\"%x)\n\n    if len(retval) == 1:\n        call_stack[-1].retval = retval[0]\n    else:\n        call_stack[-1].retval = tuple(retval)\n\n    stop = kw.get('stop', True)\n\n    if stop:\n        raise SConscriptReturn\n\n\nstack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)\n\ndef _SConscript(fs, *files, **kw):\n    top = fs.Top\n    sd = fs.SConstruct_dir.rdir()\n    exports = kw.get('exports', [])\n\n    # evaluate each SConscript file\n    results = []\n    for fn in files:\n        call_stack.append(Frame(fs, exports, fn))\n        old_sys_path = sys.path\n        try:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1\n            if fn == \"-\":\n                exec sys.stdin in call_stack[-1].globals\n            else:\n                if isinstance(fn, SCons.Node.Node):\n                    f = fn\n                else:\n                    f = fs.File(str(fn))\n                _file_ = None\n\n                # Change directory to the top of the source\n                # tree to make sure the os's cwd and the cwd of\n                # fs match so we can open the SConscript.\n                fs.chdir(top, change_os_dir=1)\n                if f.rexists():\n                    actual = f.rfile()\n                    _file_ = open(actual.get_abspath(), \"r\")\n                elif f.srcnode().rexists():\n                    actual = f.srcnode().rfile()\n                    _file_ = open(actual.get_abspath(), \"r\")\n                elif f.has_src_builder():\n                    # The SConscript file apparently exists in a source\n                    # code management system.  Build it, but then clear\n                    # the builder so that it doesn't get built *again*\n                    # during the actual build phase.\n                    f.build()\n                    f.built()\n                    f.builder_set(None)\n                    if f.exists():\n                        _file_ = open(f.get_abspath(), \"r\")\n                if _file_:\n                    # Chdir to the SConscript directory.  Use a path\n                    # name relative to the SConstruct file so that if\n                    # we're using the -f option, we're essentially\n                    # creating a parallel SConscript directory structure\n                    # in our local directory tree.\n                    #\n                    # XXX This is broken for multiple-repository cases\n                    # where the SConstruct and SConscript files might be\n                    # in different Repositories.  For now, cross that\n                    # bridge when someone comes to it.\n                    try:\n                        src_dir = kw['src_dir']\n                    except KeyError:\n                        ldir = fs.Dir(f.dir.get_path(sd))\n                    else:\n                        ldir = fs.Dir(src_dir)\n                        if not ldir.is_under(f.dir):\n                            # They specified a source directory, but\n                            # it's above the SConscript directory.\n                            # Do the sensible thing and just use the\n                            # SConcript directory.\n                            ldir = fs.Dir(f.dir.get_path(sd))\n                    try:\n                        fs.chdir(ldir, change_os_dir=sconscript_chdir)\n                    except OSError:\n                        # There was no local directory, so we should be\n                        # able to chdir to the Repository directory.\n                        # Note that we do this directly, not through\n                        # fs.chdir(), because we still need to\n                        # interpret the stuff within the SConscript file\n                        # relative to where we are logically.\n                        fs.chdir(ldir, change_os_dir=0)\n                        os.chdir(actual.dir.get_abspath())\n\n                    # Append the SConscript directory to the beginning\n                    # of sys.path so Python modules in the SConscript\n                    # directory can be easily imported.\n                    sys.path = [ f.dir.get_abspath() ] + sys.path\n\n                    # This is the magic line that actually reads up\n                    # and executes the stuff in the SConscript file.\n                    # The locals for this frame contain the special\n                    # bottom-of-the-stack marker so that any\n                    # exceptions that occur when processing this\n                    # SConscript can base the printed frames at this\n                    # level and not show SCons internals as well.\n                    call_stack[-1].globals.update({stack_bottom:1})\n                    old_file = call_stack[-1].globals.get('__file__')\n                    try:\n                        del call_stack[-1].globals['__file__']\n                    except KeyError:\n                        pass\n                    try:\n                        try:\n                            exec _file_ in call_stack[-1].globals\n                        except SConscriptReturn:\n                            pass\n                    finally:\n                        if old_file is not None:\n                            call_stack[-1].globals.update({__file__:old_file})\n                else:\n                    SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning,\n                             \"Ignoring missing SConscript '%s'\" % f.path)\n\n        finally:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1\n            sys.path = old_sys_path\n            frame = call_stack.pop()\n            try:\n                fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir)\n            except OSError:\n                # There was no local directory, so chdir to the\n                # Repository directory.  Like above, we do this\n                # directly.\n                fs.chdir(frame.prev_dir, change_os_dir=0)\n                rdir = frame.prev_dir.rdir()\n                rdir._create()  # Make sure there's a directory there.\n                try:\n                    os.chdir(rdir.get_abspath())\n                except OSError, e:\n                    # We still couldn't chdir there, so raise the error,\n                    # but only if actions are being executed.\n                    #\n                    # If the -n option was used, the directory would *not*\n                    # have been created and we should just carry on and\n                    # let things muddle through.  This isn't guaranteed\n                    # to work if the SConscript files are reading things\n                    # from disk (for example), but it should work well\n                    # enough for most configurations.\n                    if SCons.Action.execute_actions:\n                        raise e\n\n            results.append(frame.retval)\n\n    # if we only have one script, don't return a tuple\n    if len(results) == 1:\n        return results[0]\n    else:\n        return tuple(results)\n\ndef SConscript_exception(file=sys.stderr):\n    \"\"\"Print an exception stack trace just for the SConscript file(s).\n    This will show users who have Python errors where the problem is,\n    without cluttering the output with all of the internal calls leading\n    up to where we exec the SConscript.\"\"\"\n    exc_type, exc_value, exc_tb = sys.exc_info()\n    tb = exc_tb\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find our exec statement, so this was actually a bug\n        # in SCons itself.  Show the whole stack.\n        tb = exc_tb\n    stack = traceback.extract_tb(tb)\n    try:\n        type = exc_type.__name__\n    except AttributeError:\n        type = str(exc_type)\n        if type[:11] == \"exceptions.\":\n            type = type[11:]\n    file.write('%s: %s:\\n' % (type, exc_value))\n    for fname, line, func, text in stack:\n        file.write('  File \"%s\", line %d:\\n' % (fname, line))\n        file.write('    %s\\n' % text)\n\ndef annotate(node):\n    \"\"\"Annotate a node with the stack frame describing the\n    SConscript file and line number that created it.\"\"\"\n    tb = sys.exc_info()[2]\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find any exec of an SConscript file: what?!\n        raise SCons.Errors.InternalError(\"could not find SConscript stack frame\")\n    node.creator = traceback.extract_stack(tb)[0]\n\n# The following line would cause each Node to be annotated using the\n# above function.  Unfortunately, this is a *huge* performance hit, so\n# leave this disabled until we find a more efficient mechanism.\n#SCons.Node.Annotate = annotate\n\nclass SConsEnvironment(SCons.Environment.Base):\n    \"\"\"An Environment subclass that contains all of the methods that\n    are particular to the wrapper SCons interface and which aren't\n    (or shouldn't be) part of the build engine itself.\n\n    Note that not all of the methods of this class have corresponding\n    global functions, there are some private methods.\n    \"\"\"\n\n    #\n    # Private methods of an SConsEnvironment.\n    #\n    def _exceeds_version(self, major, minor, v_major, v_minor):\n        \"\"\"Return 1 if 'major' and 'minor' are greater than the version\n        in 'v_major' and 'v_minor', and 0 otherwise.\"\"\"\n        return (major > v_major or (major == v_major and minor > v_minor))\n\n    def _get_major_minor_revision(self, version_string):\n        \"\"\"Split a version string into major, minor and (optionally)\n        revision parts.\n\n        This is complicated by the fact that a version string can be\n        something like 3.2b1.\"\"\"\n        version = version_string.split(' ')[0].split('.')\n        v_major = int(version[0])\n        v_minor = int(re.match('\\d+', version[1]).group())\n        if len(version) >= 3:\n            v_revision = int(re.match('\\d+', version[2]).group())\n        else:\n            v_revision = 0\n        return v_major, v_minor, v_revision\n\n    def _get_SConscript_filenames(self, ls, kw):\n        \"\"\"\n        Convert the parameters passed to SConscript() calls into a list\n        of files and export variables.  If the parameters are invalid,\n        throws SCons.Errors.UserError. Returns a tuple (l, e) where l\n        is a list of SConscript filenames and e is a list of exports.\n        \"\"\"\n        exports = []\n\n        if len(ls) == 0:\n            try:\n                dirs = kw[\"dirs\"]\n            except KeyError:\n                raise SCons.Errors.UserError(\"Invalid SConscript usage - no parameters\")\n\n            if not SCons.Util.is_List(dirs):\n                dirs = [ dirs ]\n            dirs = list(map(str, dirs))\n\n            name = kw.get('name', 'SConscript')\n\n            files = [os.path.join(n, name) for n in dirs]\n\n        elif len(ls) == 1:\n\n            files = ls[0]\n\n        elif len(ls) == 2:\n\n            files   = ls[0]\n            exports = self.Split(ls[1])\n\n        else:\n\n            raise SCons.Errors.UserError(\"Invalid SConscript() usage - too many arguments\")\n\n        if not SCons.Util.is_List(files):\n            files = [ files ]\n\n        if kw.get('exports'):\n            exports.extend(self.Split(kw['exports']))\n\n        variant_dir = kw.get('variant_dir') or kw.get('build_dir')\n        if variant_dir:\n            if len(files) != 1:\n                raise SCons.Errors.UserError(\"Invalid SConscript() usage - can only specify one SConscript with a variant_dir\")\n            duplicate = kw.get('duplicate', 1)\n            src_dir = kw.get('src_dir')\n            if not src_dir:\n                src_dir, fname = os.path.split(str(files[0]))\n                files = [os.path.join(str(variant_dir), fname)]\n            else:\n                if not isinstance(src_dir, SCons.Node.Node):\n                    src_dir = self.fs.Dir(src_dir)\n                fn = files[0]\n                if not isinstance(fn, SCons.Node.Node):\n                    fn = self.fs.File(fn)\n                if fn.is_under(src_dir):\n                    # Get path relative to the source directory.\n                    fname = fn.get_path(src_dir)\n                    files = [os.path.join(str(variant_dir), fname)]\n                else:\n                    files = [fn.abspath]\n                kw['src_dir'] = variant_dir\n            self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n        return (files, exports)\n\n    #\n    # Public methods of an SConsEnvironment.  These get\n    # entry points in the global name space so they can be called\n    # as global functions.\n    #\n\n    def Configure(self, *args, **kw):\n        if not SCons.Script.sconscript_reading:\n            raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        return SCons.Environment.Base.Configure(self, *args, **kw)\n\n    def Default(self, *targets):\n        SCons.Script._Set_Default_Targets(self, targets)\n\n    def EnsureSConsVersion(self, major, minor, revision=0):\n        \"\"\"Exit abnormally if the SCons version is not late enough.\"\"\"\n        scons_ver = self._get_major_minor_revision(SCons.__version__)\n        if scons_ver < (major, minor, revision):\n            if revision:\n                scons_ver_string = '%d.%d.%d' % (major, minor, revision)\n            else:\n                scons_ver_string = '%d.%d' % (major, minor)\n            print \"SCons %s or greater required, but you have SCons %s\" % \\\n                  (scons_ver_string, SCons.__version__)\n            sys.exit(2)\n\n    def EnsurePythonVersion(self, major, minor):\n        \"\"\"Exit abnormally if the Python version is not late enough.\"\"\"\n        if sys.version_info < (major, minor):\n            v = sys.version.split()[0]\n            print \"Python %d.%d or greater required, but you have Python %s\" %(major,minor,v)\n            sys.exit(2)\n\n    def Exit(self, value=0):\n        sys.exit(value)\n\n    def Export(self, *vars, **kw):\n        for var in vars:\n            global_exports.update(compute_exports(self.Split(var)))\n        global_exports.update(kw)\n\n    def GetLaunchDir(self):\n        global launch_dir\n        return launch_dir\n\n    def GetOption(self, name):\n        name = self.subst(name)\n        return SCons.Script.Main.GetOption(name)\n\n    def Help(self, text):\n        text = self.subst(text, raw=1)\n        SCons.Script.HelpFunction(text)\n\n    def Import(self, *vars):\n        try:\n            frame = call_stack[-1]\n            globals = frame.globals\n            exports = frame.exports\n            for var in vars:\n                var = self.Split(var)\n                for v in var:\n                    if v == '*':\n                        globals.update(global_exports)\n                        globals.update(exports)\n                    else:\n                        if v in exports:\n                            globals[v] = exports[v]\n                        else:\n                            globals[v] = global_exports[v]\n        except KeyError,x:\n            raise SCons.Errors.UserError(\"Import of non-existent variable '%s'\"%x)\n\n    def SConscript(self, *ls, **kw):\n        if 'build_dir' in kw:\n            msg = \"\"\"The build_dir keyword has been deprecated; use the variant_dir keyword instead.\"\"\"\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)\n        def subst_element(x, subst=self.subst):\n            if SCons.Util.is_List(x):\n                x = list(map(subst, x))\n            else:\n                x = subst(x)\n            return x\n        ls = list(map(subst_element, ls))\n        subst_kw = {}\n        for key, val in kw.items():\n            if SCons.Util.is_String(val):\n                val = self.subst(val)\n            elif SCons.Util.is_List(val):\n                result = []\n                for v in val:\n                    if SCons.Util.is_String(v):\n                        v = self.subst(v)\n                    result.append(v)\n                val = result\n            subst_kw[key] = val\n\n        files, exports = self._get_SConscript_filenames(ls, subst_kw)\n        subst_kw['exports'] = exports\n        return _SConscript(self.fs, *files, **subst_kw)\n\n    def SConscriptChdir(self, flag):\n        global sconscript_chdir\n        sconscript_chdir = flag\n\n    def SetOption(self, name, value):\n        name = self.subst(name)\n        SCons.Script.Main.SetOption(name, value)\n\n#\n#\n#\nSCons.Environment.Environment = SConsEnvironment\n\ndef Configure(*args, **kw):\n    if not SCons.Script.sconscript_reading:\n        raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n    kw['_depth'] = 1\n    return SCons.SConf.SConf(*args, **kw)\n\n# It's very important that the DefaultEnvironmentCall() class stay in this\n# file, with the get_calling_namespaces() function, the compute_exports()\n# function, the Frame class and the SConsEnvironment.Export() method.\n# These things make up the calling stack leading up to the actual global\n# Export() or SConscript() call that the user issued.  We want to allow\n# users to export local variables that they define, like so:\n#\n#       def func():\n#           x = 1\n#           Export('x')\n#\n# To support this, the get_calling_namespaces() function assumes that\n# the *first* stack frame that's not from this file is the local frame\n# for the Export() or SConscript() call.\n\n_DefaultEnvironmentProxy = None\n\ndef get_DefaultEnvironmentProxy():\n    global _DefaultEnvironmentProxy\n    if not _DefaultEnvironmentProxy:\n        default_env = SCons.Defaults.DefaultEnvironment()\n        _DefaultEnvironmentProxy = SCons.Environment.NoSubstitutionProxy(default_env)\n    return _DefaultEnvironmentProxy\n\nclass DefaultEnvironmentCall(object):\n    \"\"\"A class that implements \"global function\" calls of\n    Environment methods by fetching the specified method from the\n    DefaultEnvironment's class.  Note that this uses an intermediate\n    proxy class instead of calling the DefaultEnvironment method\n    directly so that the proxy can override the subst() method and\n    thereby prevent expansion of construction variables (since from\n    the user's point of view this was called as a global function,\n    with no associated construction environment).\"\"\"\n    def __init__(self, method_name, subst=0):\n        self.method_name = method_name\n        if subst:\n            self.factory = SCons.Defaults.DefaultEnvironment\n        else:\n            self.factory = get_DefaultEnvironmentProxy\n    def __call__(self, *args, **kw):\n        env = self.factory()\n        method = getattr(env, self.method_name)\n        return method(*args, **kw)\n\n\ndef BuildDefaultGlobals():\n    \"\"\"\n    Create a dictionary containing all the default globals for\n    SConstruct and SConscript files.\n    \"\"\"\n\n    global GlobalDict\n    if GlobalDict is None:\n        GlobalDict = {}\n\n        import SCons.Script\n        d = SCons.Script.__dict__\n        def not_a_module(m, d=d, mtype=type(SCons.Script)):\n             return not isinstance(d[m], mtype)\n        for m in filter(not_a_module, dir(SCons.Script)):\n             GlobalDict[m] = d[m]\n\n    return GlobalDict.copy()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Script/__init__.py",
    "content": "\"\"\"SCons.Script\n\nThis file implements the main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Script/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport time\nstart_time = time.time()\n\nimport collections\nimport os\nimport sys\n\n# Special chicken-and-egg handling of the \"--debug=memoizer\" flag:\n#\n# SCons.Memoize contains a metaclass implementation that affects how\n# the other classes are instantiated.  The Memoizer may add shim methods\n# to classes that have methods that cache computed values in order to\n# count and report the hits and misses.\n#\n# If we wait to enable the Memoization until after we've parsed the\n# command line options normally, it will be too late, because the Memoizer\n# will have already analyzed the classes that it's Memoizing and decided\n# to not add the shims.  So we use a special-case, up-front check for\n# the \"--debug=memoizer\" flag and enable Memoizer before we import any\n# of the other modules that use it.\n\n_args = sys.argv + os.environ.get('SCONSFLAGS', '').split()\nif \"--debug=memoizer\" in _args:\n    import SCons.Memoize\n    import SCons.Warnings\n    try:\n        SCons.Memoize.EnableMemoization()\n    except SCons.Warnings.Warning:\n        # Some warning was thrown.  Arrange for it to be displayed\n        # or not after warnings are configured.\n        import Main\n        exc_type, exc_value, tb = sys.exc_info()\n        Main.delayed_warnings.append((exc_type, exc_value))\ndel _args\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Environment\nimport SCons.Node.FS\nimport SCons.Options\nimport SCons.Platform\nimport SCons.Scanner\nimport SCons.SConf\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Variables\nimport SCons.Defaults\n\nimport Main\n\nmain                    = Main.main\n\n# The following are global class definitions and variables that used to\n# live directly in this module back before 0.96.90, when it contained\n# a lot of code.  Some SConscript files in widely-distributed packages\n# (Blender is the specific example) actually reached into SCons.Script\n# directly to use some of these.  Rather than break those SConscript\n# files, we're going to propagate these names into the SCons.Script\n# namespace here.\n#\n# Some of these are commented out because it's *really* unlikely anyone\n# used them, but we're going to leave the comment here to try to make\n# it obvious what to do if the situation arises.\nBuildTask               = Main.BuildTask\nCleanTask               = Main.CleanTask\nQuestionTask            = Main.QuestionTask\n#PrintHelp               = Main.PrintHelp\n#SConscriptSettableOptions = Main.SConscriptSettableOptions\n\nAddOption               = Main.AddOption\nGetOption               = Main.GetOption\nSetOption               = Main.SetOption\nProgress                = Main.Progress\nGetBuildFailures        = Main.GetBuildFailures\n\n#keep_going_on_error     = Main.keep_going_on_error\n#print_dtree             = Main.print_dtree\n#print_explanations      = Main.print_explanations\n#print_includes          = Main.print_includes\n#print_objects           = Main.print_objects\n#print_time              = Main.print_time\n#print_tree              = Main.print_tree\n#memory_stats            = Main.memory_stats\n#ignore_errors           = Main.ignore_errors\n#sconscript_time         = Main.sconscript_time\n#command_time            = Main.command_time\n#exit_status             = Main.exit_status\n#profiling               = Main.profiling\n#repositories            = Main.repositories\n\n#\nimport SConscript\n_SConscript = SConscript\n\ncall_stack              = _SConscript.call_stack\n\n#\nAction                  = SCons.Action.Action\nAddMethod               = SCons.Util.AddMethod\nAllowSubstExceptions    = SCons.Subst.SetAllowableExceptions\nBuilder                 = SCons.Builder.Builder\nConfigure               = _SConscript.Configure\nEnvironment             = SCons.Environment.Environment\n#OptParser               = SCons.SConsOptions.OptParser\nFindPathDirs            = SCons.Scanner.FindPathDirs\nPlatform                = SCons.Platform.Platform\nReturn                  = _SConscript.Return\nScanner                 = SCons.Scanner.Base\nTool                    = SCons.Tool.Tool\nWhereIs                 = SCons.Util.WhereIs\n\n#\nBoolVariable            = SCons.Variables.BoolVariable\nEnumVariable            = SCons.Variables.EnumVariable\nListVariable            = SCons.Variables.ListVariable\nPackageVariable         = SCons.Variables.PackageVariable\nPathVariable            = SCons.Variables.PathVariable\n\n# Deprecated names that will go away some day.\nBoolOption              = SCons.Options.BoolOption\nEnumOption              = SCons.Options.EnumOption\nListOption              = SCons.Options.ListOption\nPackageOption           = SCons.Options.PackageOption\nPathOption              = SCons.Options.PathOption\n\n# Action factories.\nChmod                   = SCons.Defaults.Chmod\nCopy                    = SCons.Defaults.Copy\nDelete                  = SCons.Defaults.Delete\nMkdir                   = SCons.Defaults.Mkdir\nMove                    = SCons.Defaults.Move\nTouch                   = SCons.Defaults.Touch\n\n# Pre-made, public scanners.\nCScanner                = SCons.Tool.CScanner\nDirScanner              = SCons.Defaults.DirScanner\nProgramScanner          = SCons.Tool.ProgramScanner\nSourceFileScanner       = SCons.Tool.SourceFileScanner\n\n# Functions we might still convert to Environment methods.\nCScan                   = SCons.Defaults.CScan\nDefaultEnvironment      = SCons.Defaults.DefaultEnvironment\n\n# Other variables we provide.\nclass TargetList(collections.UserList):\n    def _do_nothing(self, *args, **kw):\n        pass\n    def _add_Default(self, list):\n        self.extend(list)\n    def _clear(self):\n        del self[:]\n\nARGUMENTS               = {}\nARGLIST                 = []\nBUILD_TARGETS           = TargetList()\nCOMMAND_LINE_TARGETS    = []\nDEFAULT_TARGETS         = []\n\n# BUILD_TARGETS can be modified in the SConscript files.  If so, we\n# want to treat the modified BUILD_TARGETS list as if they specified\n# targets on the command line.  To do that, though, we need to know if\n# BUILD_TARGETS was modified through \"official\" APIs or by hand.  We do\n# this by updating two lists in parallel, the documented BUILD_TARGETS\n# list, above, and this internal _build_plus_default targets list which\n# should only have \"official\" API changes.  Then Script/Main.py can\n# compare these two afterwards to figure out if the user added their\n# own targets to BUILD_TARGETS.\n_build_plus_default = TargetList()\n\ndef _Add_Arguments(alist):\n    for arg in alist:\n        a, b = arg.split('=', 1)\n        ARGUMENTS[a] = b\n        ARGLIST.append((a, b))\n\ndef _Add_Targets(tlist):\n    if tlist:\n        COMMAND_LINE_TARGETS.extend(tlist)\n        BUILD_TARGETS.extend(tlist)\n        BUILD_TARGETS._add_Default = BUILD_TARGETS._do_nothing\n        BUILD_TARGETS._clear = BUILD_TARGETS._do_nothing\n        _build_plus_default.extend(tlist)\n        _build_plus_default._add_Default = _build_plus_default._do_nothing\n        _build_plus_default._clear = _build_plus_default._do_nothing\n\ndef _Set_Default_Targets_Has_Been_Called(d, fs):\n    return DEFAULT_TARGETS\n\ndef _Set_Default_Targets_Has_Not_Been_Called(d, fs):\n    if d is None:\n        d = [fs.Dir('.')]\n    return d\n\n_Get_Default_Targets = _Set_Default_Targets_Has_Not_Been_Called\n\ndef _Set_Default_Targets(env, tlist):\n    global DEFAULT_TARGETS\n    global _Get_Default_Targets\n    _Get_Default_Targets = _Set_Default_Targets_Has_Been_Called\n    for t in tlist:\n        if t is None:\n            # Delete the elements from the list in-place, don't\n            # reassign an empty list to DEFAULT_TARGETS, so that the\n            # variables will still point to the same object we point to.\n            del DEFAULT_TARGETS[:]\n            BUILD_TARGETS._clear()\n            _build_plus_default._clear()\n        elif isinstance(t, SCons.Node.Node):\n            DEFAULT_TARGETS.append(t)\n            BUILD_TARGETS._add_Default([t])\n            _build_plus_default._add_Default([t])\n        else:\n            nodes = env.arg2nodes(t, env.fs.Entry)\n            DEFAULT_TARGETS.extend(nodes)\n            BUILD_TARGETS._add_Default(nodes)\n            _build_plus_default._add_Default(nodes)\n\n#\nhelp_text = None\n\ndef HelpFunction(text):\n    global help_text\n    if SCons.Script.help_text is None:\n        SCons.Script.help_text = text\n    else:\n        help_text = help_text + text\n\n#\n# Will be non-zero if we are reading an SConscript file.\nsconscript_reading = 0\n\n#\ndef Variables(files=[], args=ARGUMENTS):\n    return SCons.Variables.Variables(files, args)\n\ndef Options(files=[], args=ARGUMENTS):\n    return SCons.Options.Options(files, args)\n\n# The list of global functions to add to the SConscript name space\n# that end up calling corresponding methods or Builders in the\n# DefaultEnvironment().\nGlobalDefaultEnvironmentFunctions = [\n    # Methods from the SConsEnvironment class, above.\n    'Default',\n    'EnsurePythonVersion',\n    'EnsureSConsVersion',\n    'Exit',\n    'Export',\n    'GetLaunchDir',\n    'Help',\n    'Import',\n    #'SConscript', is handled separately, below.\n    'SConscriptChdir',\n\n    # Methods from the Environment.Base class.\n    'AddPostAction',\n    'AddPreAction',\n    'Alias',\n    'AlwaysBuild',\n    'BuildDir',\n    'CacheDir',\n    'Clean',\n    #The Command() method is handled separately, below.\n    'Decider',\n    'Depends',\n    'Dir',\n    'NoClean',\n    'NoCache',\n    'Entry',\n    'Execute',\n    'File',\n    'FindFile',\n    'FindInstalledFiles',\n    'FindSourceFiles',\n    'Flatten',\n    'GetBuildPath',\n    'Glob',\n    'Ignore',\n    'Install',\n    'InstallAs',\n    'Literal',\n    'Local',\n    'ParseDepends',\n    'Precious',\n    'Repository',\n    'Requires',\n    'SConsignFile',\n    'SideEffect',\n    'SourceCode',\n    'SourceSignatures',\n    'Split',\n    'Tag',\n    'TargetSignatures',\n    'Value',\n    'VariantDir',\n]\n\nGlobalDefaultBuilders = [\n    # Supported builders.\n    'CFile',\n    'CXXFile',\n    'DVI',\n    'Jar',\n    'Java',\n    'JavaH',\n    'Library',\n    'M4',\n    'MSVSProject',\n    'Object',\n    'PCH',\n    'PDF',\n    'PostScript',\n    'Program',\n    'RES',\n    'RMIC',\n    'SharedLibrary',\n    'SharedObject',\n    'StaticLibrary',\n    'StaticObject',\n    'Tar',\n    'TypeLibrary',\n    'Zip',\n    'Package',\n]\n\nfor name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders:\n    exec \"%s = _SConscript.DefaultEnvironmentCall(%s)\" % (name, repr(name))\ndel name\n\n# There are a handful of variables that used to live in the\n# Script/SConscript.py module that some SConscript files out there were\n# accessing directly as SCons.Script.SConscript.*.  The problem is that\n# \"SConscript\" in this namespace is no longer a module, it's a global\n# function call--or more precisely, an object that implements a global\n# function call through the default Environment.  Nevertheless, we can\n# maintain backwards compatibility for SConscripts that were reaching in\n# this way by hanging some attributes off the \"SConscript\" object here.\nSConscript = _SConscript.DefaultEnvironmentCall('SConscript')\n\n# Make SConscript look enough like the module it used to be so\n# that pychecker doesn't barf.\nSConscript.__name__ = 'SConscript'\n\nSConscript.Arguments = ARGUMENTS\nSConscript.ArgList = ARGLIST\nSConscript.BuildTargets = BUILD_TARGETS\nSConscript.CommandLineTargets = COMMAND_LINE_TARGETS\nSConscript.DefaultTargets = DEFAULT_TARGETS\n\n# The global Command() function must be handled differently than the\n# global functions for other construction environment methods because\n# we want people to be able to use Actions that must expand $TARGET\n# and $SOURCE later, when (and if) the Action is invoked to build\n# the target(s).  We do this with the subst=1 argument, which creates\n# a DefaultEnvironmentCall instance that wraps up a normal default\n# construction environment that performs variable substitution, not a\n# proxy that doesn't.\n#\n# There's a flaw here, though, because any other $-variables on a command\n# line will *also* be expanded, each to a null string, but that should\n# only be a problem in the unusual case where someone was passing a '$'\n# on a command line and *expected* the $ to get through to the shell\n# because they were calling Command() and not env.Command()...  This is\n# unlikely enough that we're going to leave this as is and cross that\n# bridge if someone actually comes to it.\nCommand = _SConscript.DefaultEnvironmentCall('Command', subst=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Sig.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Sig.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"Place-holder for the old SCons.Sig module hierarchy\n\nThis is no longer used, but code out there (such as the NSIS module on\nthe SCons wiki) may try to import SCons.Sig.  If so, we generate a warning\nthat points them to the line that caused the import, and don't die.\n\nIf someone actually tried to use the sub-modules or functions within\nthe package (for example, SCons.Sig.MD5.signature()), then they'll still\nget an AttributeError, but at least they'll know where to start looking.\n\"\"\"\n\nimport SCons.Util\nimport SCons.Warnings\n\nmsg = 'The SCons.Sig module no longer exists.\\n' \\\n      '    Remove the following \"import SCons.Sig\" line to eliminate this warning:'\n\nSCons.Warnings.warn(SCons.Warnings.DeprecatedSigModuleWarning, msg)\n\ndefault_calc = None\ndefault_module = None\n\nclass MD5Null(SCons.Util.Null):\n    def __repr__(self):\n        return \"MD5Null()\"\n\nclass TimeStampNull(SCons.Util.Null):\n    def __repr__(self):\n        return \"TimeStampNull()\"\n\nMD5 = MD5Null()\nTimeStamp = TimeStampNull()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Subst.py",
    "content": "\"\"\"SCons.Subst\n\nSCons string substitution.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Subst.py  2014/07/05 09:42:21 garyo\"\n\nimport collections\nimport re\n\nimport SCons.Errors\n\nfrom SCons.Util import is_String, is_Sequence\n\n# Indexed by the SUBST_* constants below.\n_strconv = [SCons.Util.to_String_for_subst,\n            SCons.Util.to_String_for_subst,\n            SCons.Util.to_String_for_signature]\n\n\n\nAllowableExceptions = (IndexError, NameError)\n\ndef SetAllowableExceptions(*excepts):\n    global AllowableExceptions\n    AllowableExceptions = [_f for _f in excepts if _f]\n\ndef raise_exception(exception, target, s):\n    name = exception.__class__.__name__\n    msg = \"%s `%s' trying to evaluate `%s'\" % (name, exception, s)\n    if target:\n        raise SCons.Errors.BuildError(target[0], msg)\n    else:\n        raise SCons.Errors.UserError(msg)\n\n\n\nclass Literal(object):\n    \"\"\"A wrapper for a string.  If you use this object wrapped\n    around a string, then it will be interpreted as literal.\n    When passed to the command interpreter, all special\n    characters will be escaped.\"\"\"\n    def __init__(self, lstr):\n        self.lstr = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.lstr\n\n    def is_literal(self):\n        return 1\n\n    def __eq__(self, other):\n        if not isinstance(other, Literal):\n            return False\n        return self.lstr == other.lstr\n\n    def __neq__(self, other):\n        return not self.__eq__(other)\n\nclass SpecialAttrWrapper(object):\n    \"\"\"This is a wrapper for what we call a 'Node special attribute.'\n    This is any of the attributes of a Node that we can reference from\n    Environment variable substitution, such as $TARGET.abspath or\n    $SOURCES[1].filebase.  We implement the same methods as Literal\n    so we can handle special characters, plus a for_signature method,\n    such that we can return some canonical string during signature\n    calculation to avoid unnecessary rebuilds.\"\"\"\n\n    def __init__(self, lstr, for_signature=None):\n        \"\"\"The for_signature parameter, if supplied, will be the\n        canonical string we return from for_signature().  Else\n        we will simply return lstr.\"\"\"\n        self.lstr = lstr\n        if for_signature:\n            self.forsig = for_signature\n        else:\n            self.forsig = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.forsig\n\n    def is_literal(self):\n        return 1\n\ndef quote_spaces(arg):\n    \"\"\"Generic function for putting double quotes around any string that\n    has white space in it.\"\"\"\n    if ' ' in arg or '\\t' in arg:\n        return '\"%s\"' % arg\n    else:\n        return str(arg)\n\nclass CmdStringHolder(collections.UserString):\n    \"\"\"This is a special class used to hold strings generated by\n    scons_subst() and scons_subst_list().  It defines a special method\n    escape().  When passed a function with an escape algorithm for a\n    particular platform, it will return the contained string with the\n    proper escape sequences inserted.\n    \"\"\"\n    def __init__(self, cmd, literal=None):\n        collections.UserString.__init__(self, cmd)\n        self.literal = literal\n\n    def is_literal(self):\n        return self.literal\n\n    def escape(self, escape_func, quote_func=quote_spaces):\n        \"\"\"Escape the string with the supplied function.  The\n        function is expected to take an arbitrary string, then\n        return it with all special characters escaped and ready\n        for passing to the command interpreter.\n\n        After calling this function, the next call to str() will\n        return the escaped string.\n        \"\"\"\n\n        if self.is_literal():\n            return escape_func(self.data)\n        elif ' ' in self.data or '\\t' in self.data:\n            return quote_func(self.data)\n        else:\n            return self.data\n\ndef escape_list(mylist, escape_func):\n    \"\"\"Escape a list of arguments by running the specified escape_func\n    on every object in the list that has an escape() method.\"\"\"\n    def escape(obj, escape_func=escape_func):\n        try:\n            e = obj.escape\n        except AttributeError:\n            return obj\n        else:\n            return e(escape_func)\n    return list(map(escape, mylist))\n\nclass NLWrapper(object):\n    \"\"\"A wrapper class that delays turning a list of sources or targets\n    into a NodeList until it's needed.  The specified function supplied\n    when the object is initialized is responsible for turning raw nodes\n    into proxies that implement the special attributes like .abspath,\n    .source, etc.  This way, we avoid creating those proxies just\n    \"in case\" someone is going to use $TARGET or the like, and only\n    go through the trouble if we really have to.\n\n    In practice, this might be a wash performance-wise, but it's a little\n    cleaner conceptually...\n    \"\"\"\n\n    def __init__(self, list, func):\n        self.list = list\n        self.func = func\n    def _return_nodelist(self):\n        return self.nodelist\n    def _gen_nodelist(self):\n        mylist = self.list\n        if mylist is None:\n            mylist = []\n        elif not is_Sequence(mylist):\n            mylist = [mylist]\n        # The map(self.func) call is what actually turns\n        # a list into appropriate proxies.\n        self.nodelist = SCons.Util.NodeList(list(map(self.func, mylist)))\n        self._create_nodelist = self._return_nodelist\n        return self.nodelist\n    _create_nodelist = _gen_nodelist\n\n\nclass Targets_or_Sources(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access the list, calling the NLWrapper to create proxies on demand.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.nl._create_nodelist()\n        return nl[i]\n    def __getslice__(self, i, j):\n        nl = self.nl._create_nodelist()\n        i = max(i, 0); j = max(j, 0)\n        return nl[i:j]\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        return str(nl)\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        return repr(nl)\n\nclass Target_or_Source(object):\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access an individual proxy Node, calling the NLWrapper to create\n    a proxy on demand.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        try:\n            nl0 = nl[0]\n        except IndexError:\n            # If there is nothing in the list, then we have no attributes to\n            # pass through, so raise AttributeError for everything.\n            raise AttributeError(\"NodeList has no attribute: %s\" % attr)\n        return getattr(nl0, attr)\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return str(nl[0])\n        return ''\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return repr(nl[0])\n        return ''\n\nclass NullNodeList(SCons.Util.NullSeq):\n  def __call__(self, *args, **kwargs): return ''\n  def __str__(self): return ''\n\nNullNodesList = NullNodeList()\n\ndef subst_dict(target, source):\n    \"\"\"Create a dictionary for substitution of special\n    construction variables.\n\n    This translates the following special arguments:\n\n    target - the target (object or array of objects),\n             used to generate the TARGET and TARGETS\n             construction variables\n\n    source - the source (object or array of objects),\n             used to generate the SOURCES and SOURCE\n             construction variables\n    \"\"\"\n    dict = {}\n\n    if target:\n        def get_tgt_subst_proxy(thing):\n            try:\n                subst_proxy = thing.get_subst_proxy()\n            except AttributeError:\n                subst_proxy = thing # probably a string, just return it\n            return subst_proxy\n        tnl = NLWrapper(target, get_tgt_subst_proxy)\n        dict['TARGETS'] = Targets_or_Sources(tnl)\n        dict['TARGET'] = Target_or_Source(tnl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_TARGETS'] = '$TARGETS'\n        dict['UNCHANGED_TARGETS'] = '$TARGETS'\n    else:\n        dict['TARGETS'] = NullNodesList\n        dict['TARGET'] = NullNodesList\n\n    if source:\n        def get_src_subst_proxy(node):\n            try:\n                rfile = node.rfile\n            except AttributeError:\n                pass\n            else:\n                node = rfile()\n            try:\n                return node.get_subst_proxy()\n            except AttributeError:\n                return node     # probably a String, just return it\n        snl = NLWrapper(source, get_src_subst_proxy)\n        dict['SOURCES'] = Targets_or_Sources(snl)\n        dict['SOURCE'] = Target_or_Source(snl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_SOURCES'] = '$SOURCES'\n        dict['UNCHANGED_SOURCES'] = '$SOURCES'\n    else:\n        dict['SOURCES'] = NullNodesList\n        dict['SOURCE'] = NullNodesList\n\n    return dict\n\n# Constants for the \"mode\" parameter to scons_subst_list() and\n# scons_subst().  SUBST_RAW gives the raw command line.  SUBST_CMD\n# gives a command line suitable for passing to a shell.  SUBST_SIG\n# gives a command line appropriate for calculating the signature\n# of a command line...if this changes, we should rebuild.\nSUBST_CMD = 0\nSUBST_RAW = 1\nSUBST_SIG = 2\n\n_rm = re.compile(r'\\$[()]')\n_remove = re.compile(r'\\$\\([^\\$]*(\\$[^\\)][^\\$]*)*\\$\\)')\n\n# Indexed by the SUBST_* constants above.\n_regex_remove = [ _rm, None, _remove ]\n\ndef _rm_list(list):\n    #return [ l for l in list if not l in ('$(', '$)') ]\n    return [l for l in list if not l in ('$(', '$)')]\n\ndef _remove_list(list):\n    result = []\n    do_append = result.append\n    for l in list:\n        if l == '$(':\n            do_append = lambda x: None\n        elif l == '$)':\n            do_append = result.append\n        else:\n            do_append(l)\n    return result\n\n# Indexed by the SUBST_* constants above.\n_list_remove = [ _rm_list, None, _remove_list ]\n\n# Regular expressions for splitting strings and handling substitutions,\n# for use by the scons_subst() and scons_subst_list() functions:\n#\n# The first expression compiled matches all of the $-introduced tokens\n# that we need to process in some way, and is used for substitutions.\n# The expressions it matches are:\n#\n#       \"$$\"\n#       \"$(\"\n#       \"$)\"\n#       \"$variable\"             [must begin with alphabetic or underscore]\n#       \"${any stuff}\"\n#\n# The second expression compiled is used for splitting strings into tokens\n# to be processed, and it matches all of the tokens listed above, plus\n# the following that affect how arguments do or don't get joined together:\n#\n#       \"   \"                   [white space]\n#       \"non-white-space\"       [without any dollar signs]\n#       \"$\"                     [single dollar sign]\n#\n_dollar_exps_str = r'\\$[\\$\\(\\)]|\\$[_a-zA-Z][\\.\\w]*|\\${[^}]*}'\n_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)\n_separate_args = re.compile(r'(%s|\\s+|[^\\s\\$]+|\\$)' % _dollar_exps_str)\n\n# This regular expression is used to replace strings of multiple white\n# space characters in the string result from the scons_subst() function.\n_space_sep = re.compile(r'[\\t ]+(?![^{]*})')\n\ndef scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Expand a string or list containing construction variable\n    substitutions.\n\n    This is the work-horse function for substitutions in file names\n    and the like.  The companion scons_subst_list() function (below)\n    handles separating command lines into lists of arguments, so see\n    that function if that's what you're looking for.\n    \"\"\"\n    if isinstance(strSubst, str) and strSubst.find('$') < 0:\n        return strSubst\n\n    class StringSubber(object):\n        \"\"\"A class to construct the results of a scons_subst() call.\n\n        This binds a specific construction environment, mode, target and\n        source with two methods (substitute() and expand()) that handle\n        the expansion.\n        \"\"\"\n        def __init__(self, env, mode, conv, gvars):\n            self.env = env\n            self.mode = mode\n            self.conv = conv\n            self.gvars = gvars\n\n        def expand(self, s, lvars):\n            \"\"\"Expand a single \"token\" as necessary, returning an\n            appropriate string containing the expansion.\n\n            This handles expanding different types of things (strings,\n            lists, callables) appropriately.  It calls the wrapper\n            substitute() method to re-expand things as necessary, so that\n            the results of expansions of side-by-side strings still get\n            re-evaluated separately, not smushed together.\n            \"\"\"\n            if is_String(s):\n                try:\n                    s0, s1 = s[:2]\n                except (IndexError, ValueError):\n                    return s\n                if s0 != '$':\n                    return s\n                if s1 == '$':\n                    return '$'\n                elif s1 in '()':\n                    return s\n                else:\n                    key = s[1:]\n                    if key[0] == '{' or key.find('.') >= 0:\n                        if key[0] == '{':\n                            key = key[1:-1]\n                        try:\n                            s = eval(key, self.gvars, lvars)\n                        except KeyboardInterrupt:\n                            raise\n                        except Exception, e:\n                            if e.__class__ in AllowableExceptions:\n                                return ''\n                            raise_exception(e, lvars['TARGETS'], s)\n                    else:\n                        if key in lvars:\n                            s = lvars[key]\n                        elif key in self.gvars:\n                            s = self.gvars[key]\n                        elif not NameError in AllowableExceptions:\n                            raise_exception(NameError(key), lvars['TARGETS'], s)\n                        else:\n                            return ''\n\n                    # Before re-expanding the result, handle\n                    # recursive expansion by copying the local\n                    # variable dictionary and overwriting a null\n                    # string for the value of the variable name\n                    # we just expanded.\n                    #\n                    # This could potentially be optimized by only\n                    # copying lvars when s contains more expansions,\n                    # but lvars is usually supposed to be pretty\n                    # small, and deeply nested variable expansions\n                    # are probably more the exception than the norm,\n                    # so it should be tolerable for now.\n                    lv = lvars.copy()\n                    var = key.split('.')[0]\n                    lv[var] = ''\n                    return self.substitute(s, lv)\n            elif is_Sequence(s):\n                def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars):\n                    return conv(substitute(l, lvars))\n                return list(map(func, s))\n            elif callable(s):\n                try:\n                    s = s(target=lvars['TARGETS'],\n                         source=lvars['SOURCES'],\n                         env=self.env,\n                         for_signature=(self.mode != SUBST_CMD))\n                except TypeError:\n                    # This probably indicates that it's a callable\n                    # object that doesn't match our calling arguments\n                    # (like an Action).\n                    if self.mode == SUBST_RAW:\n                        return s\n                    s = self.conv(s)\n                return self.substitute(s, lvars)\n            elif s is None:\n                return ''\n            else:\n                return s\n\n        def substitute(self, args, lvars):\n            \"\"\"Substitute expansions in an argument or list of arguments.\n\n            This serves as a wrapper for splitting up a string into\n            separate tokens.\n            \"\"\"\n            if is_String(args) and not isinstance(args, CmdStringHolder):\n                args = str(args)        # In case it's a UserString.\n                try:\n                    def sub_match(match):\n                        return self.conv(self.expand(match.group(1), lvars))\n                    result = _dollar_exps.sub(sub_match, args)\n                except TypeError:\n                    # If the internal conversion routine doesn't return\n                    # strings (it could be overridden to return Nodes, for\n                    # example), then the 1.5.2 re module will throw this\n                    # exception.  Back off to a slower, general-purpose\n                    # algorithm that works for all data types.\n                    args = _separate_args.findall(args)\n                    result = []\n                    for a in args:\n                        result.append(self.conv(self.expand(a, lvars)))\n                    if len(result) == 1:\n                        result = result[0]\n                    else:\n                        result = ''.join(map(str, result))\n                return result\n            else:\n                return self.expand(args, lvars)\n\n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ss = StringSubber(env, mode, conv, gvars)\n    result = ss.substitute(strSubst, lvars)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    if is_String(result):\n        # Remove $(-$) pairs and any stuff in between,\n        # if that's appropriate.\n        remove = _regex_remove[mode]\n        if remove:\n            result = remove.sub('', result)\n        if mode != SUBST_RAW:\n            # Compress strings of white space characters into\n            # a single space.\n            result = _space_sep.sub(' ', result).strip()\n    elif is_Sequence(result):\n        remove = _list_remove[mode]\n        if remove:\n            result = remove(result)\n\n    return result\n\n#Subst_List_Strings = {}\n\ndef scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Substitute construction variables in a string (or list or other\n    object) and separate the arguments into a command list.\n\n    The companion scons_subst() function (above) handles basic\n    substitutions within strings, so see that function instead\n    if that's what you're looking for.\n    \"\"\"\n#    try:\n#        Subst_List_Strings[strSubst] = Subst_List_Strings[strSubst] + 1\n#    except KeyError:\n#        Subst_List_Strings[strSubst] = 1\n#    import SCons.Debug\n#    SCons.Debug.caller_trace(1)\n    class ListSubber(collections.UserList):\n        \"\"\"A class to construct the results of a scons_subst_list() call.\n\n        Like StringSubber, this class binds a specific construction\n        environment, mode, target and source with two methods\n        (substitute() and expand()) that handle the expansion.\n\n        In addition, however, this class is used to track the state of\n        the result(s) we're gathering so we can do the appropriate thing\n        whenever we have to append another word to the result--start a new\n        line, start a new word, append to the current word, etc.  We do\n        this by setting the \"append\" attribute to the right method so\n        that our wrapper methods only need ever call ListSubber.append(),\n        and the rest of the object takes care of doing the right thing\n        internally.\n        \"\"\"\n        def __init__(self, env, mode, conv, gvars):\n            collections.UserList.__init__(self, [])\n            self.env = env\n            self.mode = mode\n            self.conv = conv\n            self.gvars = gvars\n\n            if self.mode == SUBST_RAW:\n                self.add_strip = lambda x: self.append(x)\n            else:\n                self.add_strip = lambda x: None\n            self.in_strip = None\n            self.next_line()\n\n        def expand(self, s, lvars, within_list):\n            \"\"\"Expand a single \"token\" as necessary, appending the\n            expansion to the current result.\n\n            This handles expanding different types of things (strings,\n            lists, callables) appropriately.  It calls the wrapper\n            substitute() method to re-expand things as necessary, so that\n            the results of expansions of side-by-side strings still get\n            re-evaluated separately, not smushed together.\n            \"\"\"\n\n            if is_String(s):\n                try:\n                    s0, s1 = s[:2]\n                except (IndexError, ValueError):\n                    self.append(s)\n                    return\n                if s0 != '$':\n                    self.append(s)\n                    return\n                if s1 == '$':\n                    self.append('$')\n                elif s1 == '(':\n                    self.open_strip('$(')\n                elif s1 == ')':\n                    self.close_strip('$)')\n                else:\n                    key = s[1:]\n                    if key[0] == '{' or key.find('.') >= 0:\n                        if key[0] == '{':\n                            key = key[1:-1]\n                        try:\n                            s = eval(key, self.gvars, lvars)\n                        except KeyboardInterrupt:\n                            raise\n                        except Exception, e:\n                            if e.__class__ in AllowableExceptions:\n                                return\n                            raise_exception(e, lvars['TARGETS'], s)\n                    else:\n                        if key in lvars:\n                            s = lvars[key]\n                        elif key in self.gvars:\n                            s = self.gvars[key]\n                        elif not NameError in AllowableExceptions:\n                            raise_exception(NameError(), lvars['TARGETS'], s)\n                        else:\n                            return\n\n                    # Before re-expanding the result, handle\n                    # recursive expansion by copying the local\n                    # variable dictionary and overwriting a null\n                    # string for the value of the variable name\n                    # we just expanded.\n                    lv = lvars.copy()\n                    var = key.split('.')[0]\n                    lv[var] = ''\n                    self.substitute(s, lv, 0)\n                    self.this_word()\n            elif is_Sequence(s):\n                for a in s:\n                    self.substitute(a, lvars, 1)\n                    self.next_word()\n            elif callable(s):\n                try:\n                    s = s(target=lvars['TARGETS'],\n                         source=lvars['SOURCES'],\n                         env=self.env,\n                         for_signature=(self.mode != SUBST_CMD))\n                except TypeError:\n                    # This probably indicates that it's a callable\n                    # object that doesn't match our calling arguments\n                    # (like an Action).\n                    if self.mode == SUBST_RAW:\n                        self.append(s)\n                        return\n                    s = self.conv(s)\n                self.substitute(s, lvars, within_list)\n            elif s is None:\n                self.this_word()\n            else:\n                self.append(s)\n\n        def substitute(self, args, lvars, within_list):\n            \"\"\"Substitute expansions in an argument or list of arguments.\n\n            This serves as a wrapper for splitting up a string into\n            separate tokens.\n            \"\"\"\n\n            if is_String(args) and not isinstance(args, CmdStringHolder):\n                args = str(args)        # In case it's a UserString.\n                args = _separate_args.findall(args)\n                for a in args:\n                    if a[0] in ' \\t\\n\\r\\f\\v':\n                        if '\\n' in a:\n                            self.next_line()\n                        elif within_list:\n                            self.append(a)\n                        else:\n                            self.next_word()\n                    else:\n                        self.expand(a, lvars, within_list)\n            else:\n                self.expand(args, lvars, within_list)\n\n        def next_line(self):\n            \"\"\"Arrange for the next word to start a new line.  This\n            is like starting a new word, except that we have to append\n            another line to the result.\"\"\"\n            collections.UserList.append(self, [])\n            self.next_word()\n\n        def this_word(self):\n            \"\"\"Arrange for the next word to append to the end of the\n            current last word in the result.\"\"\"\n            self.append = self.add_to_current_word\n\n        def next_word(self):\n            \"\"\"Arrange for the next word to start a new word.\"\"\"\n            self.append = self.add_new_word\n\n        def add_to_current_word(self, x):\n            \"\"\"Append the string x to the end of the current last word\n            in the result.  If that is not possible, then just add\n            it as a new word.  Make sure the entire concatenated string\n            inherits the object attributes of x (in particular, the\n            escape function) by wrapping it as CmdStringHolder.\"\"\"\n\n            if not self.in_strip or self.mode != SUBST_SIG:\n                try:\n                    current_word = self[-1][-1]\n                except IndexError:\n                    self.add_new_word(x)\n                else:\n                    # All right, this is a hack and it should probably\n                    # be refactored out of existence in the future.\n                    # The issue is that we want to smoosh words together\n                    # and make one file name that gets escaped if\n                    # we're expanding something like foo$EXTENSION,\n                    # but we don't want to smoosh them together if\n                    # it's something like >$TARGET, because then we'll\n                    # treat the '>' like it's part of the file name.\n                    # So for now, just hard-code looking for the special\n                    # command-line redirection characters...\n                    try:\n                        last_char = str(current_word)[-1]\n                    except IndexError:\n                        last_char = '\\0'\n                    if last_char in '<>|':\n                        self.add_new_word(x)\n                    else:\n                        y = current_word + x\n\n                        # We used to treat a word appended to a literal\n                        # as a literal itself, but this caused problems\n                        # with interpreting quotes around space-separated\n                        # targets on command lines.  Removing this makes\n                        # none of the \"substantive\" end-to-end tests fail,\n                        # so we'll take this out but leave it commented\n                        # for now in case there's a problem not covered\n                        # by the test cases and we need to resurrect this.\n                        #literal1 = self.literal(self[-1][-1])\n                        #literal2 = self.literal(x)\n                        y = self.conv(y)\n                        if is_String(y):\n                            #y = CmdStringHolder(y, literal1 or literal2)\n                            y = CmdStringHolder(y, None)\n                        self[-1][-1] = y\n\n        def add_new_word(self, x):\n            if not self.in_strip or self.mode != SUBST_SIG:\n                literal = self.literal(x)\n                x = self.conv(x)\n                if is_String(x):\n                    x = CmdStringHolder(x, literal)\n                self[-1].append(x)\n            self.append = self.add_to_current_word\n\n        def literal(self, x):\n            try:\n                l = x.is_literal\n            except AttributeError:\n                return None\n            else:\n                return l()\n\n        def open_strip(self, x):\n            \"\"\"Handle the \"open strip\" $( token.\"\"\"\n            self.add_strip(x)\n            self.in_strip = 1\n\n        def close_strip(self, x):\n            \"\"\"Handle the \"close strip\" $) token.\"\"\"\n            self.add_strip(x)\n            self.in_strip = None\n\n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ls = ListSubber(env, mode, conv, gvars)\n    ls.substitute(strSubst, lvars, 0)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    return ls.data\n\ndef scons_subst_once(strSubst, env, key):\n    \"\"\"Perform single (non-recursive) substitution of a single\n    construction variable keyword.\n\n    This is used when setting a variable when copying or overriding values\n    in an Environment.  We want to capture (expand) the old value before\n    we override it, so people can do things like:\n\n        env2 = env.Clone(CCFLAGS = '$CCFLAGS -g')\n\n    We do this with some straightforward, brute-force code here...\n    \"\"\"\n    if isinstance(strSubst, str) and strSubst.find('$') < 0:\n        return strSubst\n\n    matchlist = ['$' + key, '${' + key + '}']\n    val = env.get(key, '')\n    def sub_match(match, val=val, matchlist=matchlist):\n        a = match.group(1)\n        if a in matchlist:\n            a = val\n        if is_Sequence(a):\n            return ' '.join(map(str, a))\n        else:\n            return str(a)\n\n    if is_Sequence(strSubst):\n        result = []\n        for arg in strSubst:\n            if is_String(arg):\n                if arg in matchlist:\n                    arg = val\n                    if is_Sequence(arg):\n                        result.extend(arg)\n                    else:\n                        result.append(arg)\n                else:\n                    result.append(_dollar_exps.sub(sub_match, arg))\n            else:\n                result.append(arg)\n        return result\n    elif is_String(strSubst):\n        return _dollar_exps.sub(sub_match, strSubst)\n    else:\n        return strSubst\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Taskmaster.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__doc__ = \"\"\"\nGeneric Taskmaster module for the SCons build engine.\n\nThis module contains the primary interface(s) between a wrapping user\ninterface and the SCons build engine.  There are two key classes here:\n\n    Taskmaster\n        This is the main engine for walking the dependency graph and\n        calling things to decide what does or doesn't need to be built.\n\n    Task\n        This is the base class for allowing a wrapping interface to\n        decide what does or doesn't actually need to be done.  The\n        intention is for a wrapping interface to subclass this as\n        appropriate for different types of behavior it may need.\n\n        The canonical example is the SCons native Python interface,\n        which has Task subclasses that handle its specific behavior,\n        like printing \"`foo' is up to date\" when a top-level target\n        doesn't need to be built, and handling the -c option by removing\n        targets as its \"build\" action.  There is also a separate subclass\n        for suppressing this output when the -q option is used.\n\n        The Taskmaster instantiates a Task object for each (set of)\n        target(s) that it decides need to be evaluated and/or built.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Taskmaster.py  2014/07/05 09:42:21 garyo\"\n\nfrom itertools import chain\nimport operator\nimport sys\nimport traceback\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Warnings\n\nStateString = SCons.Node.StateString\nNODE_NO_STATE = SCons.Node.no_state\nNODE_PENDING = SCons.Node.pending\nNODE_EXECUTING = SCons.Node.executing\nNODE_UP_TO_DATE = SCons.Node.up_to_date\nNODE_EXECUTED = SCons.Node.executed\nNODE_FAILED = SCons.Node.failed\n\nprint_prepare = 0               # set by option --debug=prepare\n\n# A subsystem for recording stats about how different Nodes are handled by\n# the main Taskmaster loop.  There's no external control here (no need for\n# a --debug= option); enable it by changing the value of CollectStats.\n\nCollectStats = None\n\nclass Stats(object):\n    \"\"\"\n    A simple class for holding statistics about the disposition of a\n    Node by the Taskmaster.  If we're collecting statistics, each Node\n    processed by the Taskmaster gets one of these attached, in which case\n    the Taskmaster records its decision each time it processes the Node.\n    (Ideally, that's just once per Node.)\n    \"\"\"\n    def __init__(self):\n        \"\"\"\n        Instantiates a Taskmaster.Stats object, initializing all\n        appropriate counters to zero.\n        \"\"\"\n        self.considered  = 0\n        self.already_handled  = 0\n        self.problem  = 0\n        self.child_failed  = 0\n        self.not_built  = 0\n        self.side_effects  = 0\n        self.build  = 0\n\nStatsNodes = []\n\nfmt = \"%(considered)3d \"\\\n      \"%(already_handled)3d \" \\\n      \"%(problem)3d \" \\\n      \"%(child_failed)3d \" \\\n      \"%(not_built)3d \" \\\n      \"%(side_effects)3d \" \\\n      \"%(build)3d \"\n\ndef dump_stats():\n    for n in sorted(StatsNodes, key=lambda a: str(a)):\n        print (fmt % n.stats.__dict__) + str(n)\n\n\n\nclass Task(object):\n    \"\"\"\n    Default SCons build engine task.\n\n    This controls the interaction of the actual building of node\n    and the rest of the engine.\n\n    This is expected to handle all of the normally-customizable\n    aspects of controlling a build, so any given application\n    *should* be able to do what it wants by sub-classing this\n    class and overriding methods as appropriate.  If an application\n    needs to customze something by sub-classing Taskmaster (or\n    some other build engine class), we should first try to migrate\n    that functionality into this class.\n\n    Note that it's generally a good idea for sub-classes to call\n    these methods explicitly to update state, etc., rather than\n    roll their own interaction with Taskmaster from scratch.\n    \"\"\"\n    def __init__(self, tm, targets, top, node):\n        self.tm = tm\n        self.targets = targets\n        self.top = top\n        self.node = node\n        self.exc_clear()\n\n    def trace_message(self, method, node, description='node'):\n        fmt = '%-20s %s %s\\n'\n        return fmt % (method + ':', description, self.tm.trace_node(node))\n\n    def display(self, message):\n        \"\"\"\n        Hook to allow the calling interface to display a message.\n\n        This hook gets called as part of preparing a task for execution\n        (that is, a Node to be built).  As part of figuring out what Node\n        should be built next, the actually target list may be altered,\n        along with a message describing the alteration.  The calling\n        interface can subclass Task and provide a concrete implementation\n        of this method to see those messages.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"\n        Called just before the task is executed.\n\n        This is mainly intended to give the target Nodes a chance to\n        unlink underlying files and make all necessary directories before\n        the Action is actually called to build the targets.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.prepare()', self.node))\n\n        # Now that it's the appropriate time, give the TaskMaster a\n        # chance to raise any exceptions it encountered while preparing\n        # this task.\n        self.exception_raise()\n\n        if self.tm.message:\n            self.display(self.tm.message)\n            self.tm.message = None\n\n        # Let the targets take care of any necessary preparations.\n        # This includes verifying that all of the necessary sources\n        # and dependencies exist, removing the target file(s), etc.\n        #\n        # As of April 2008, the get_executor().prepare() method makes\n        # sure that all of the aggregate sources necessary to build this\n        # Task's target(s) exist in one up-front check.  The individual\n        # target t.prepare() methods check that each target's explicit\n        # or implicit dependencies exists, and also initialize the\n        # .sconsign info.\n        executor = self.targets[0].get_executor()\n        if executor is None:\n            return\n        executor.prepare()\n        for t in executor.get_action_targets():\n            if print_prepare:\n                print \"Preparing target %s...\"%t\n                for s in t.side_effects:\n                    print \"...with side-effect %s...\"%s\n            t.prepare()\n            for s in t.side_effects:\n                if print_prepare:\n                    print \"...Preparing side-effect %s...\"%s\n                s.prepare()\n\n    def get_target(self):\n        \"\"\"Fetch the target being built or updated by this task.\n        \"\"\"\n        return self.node\n\n    def needs_execute(self):\n        # TODO(deprecate):  \"return True\" is the old default behavior;\n        # change it to NotImplementedError (after running through the\n        # Deprecation Cycle) so the desired behavior is explicitly\n        # determined by which concrete subclass is used.\n        #raise NotImplementedError\n        msg = ('Taskmaster.Task is an abstract base class; instead of\\n'\n              '\\tusing it directly, '\n              'derive from it and override the abstract methods.')\n        SCons.Warnings.warn(SCons.Warnings.TaskmasterNeedsExecuteWarning, msg)\n        return True\n\n    def execute(self):\n        \"\"\"\n        Called to execute the task.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here.  Do thread unsafe stuff in\n        prepare(), executed() or failed().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.execute()', self.node))\n\n        try:\n            cached_targets = []\n            for t in self.targets:\n                if not t.retrieve_from_cache():\n                    break\n                cached_targets.append(t)\n            if len(cached_targets) < len(self.targets):\n                # Remove targets before building. It's possible that we\n                # partially retrieved targets from the cache, leaving\n                # them in read-only mode. That might cause the command\n                # to fail.\n                #\n                for t in cached_targets:\n                    try:\n                        t.fs.unlink(t.path)\n                    except (IOError, OSError):\n                        pass\n                self.targets[0].build()\n            else:\n                for t in cached_targets:\n                    t.cached = 1\n        except SystemExit:\n            exc_value = sys.exc_info()[1]\n            raise SCons.Errors.ExplicitExit(self.targets[0], exc_value.code)\n        except SCons.Errors.UserError:\n            raise\n        except SCons.Errors.BuildError:\n            raise\n        except Exception, e:\n            buildError = SCons.Errors.convert_to_BuildError(e)\n            buildError.node = self.targets[0]\n            buildError.exc_info = sys.exc_info()\n            raise buildError\n\n    def executed_without_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed\n        and the Taskmaster instance doesn't want to call\n        the Node's callback methods.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_without_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n\n    def executed_with_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed and\n        the Taskmaster instance wants to call the Node's callback\n        methods.\n\n        This may have been a do-nothing operation (to preserve build\n        order), so we must check the node's state before deciding whether\n        it was \"built\", in which case we call the appropriate Node method.\n        In any event, we always call \"visited()\", which will handle any\n        post-visit actions that must take place regardless of whether\n        or not the target was an actual built target or a source Node.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_with_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n                if not t.cached:\n                    t.push_to_cache()\n                t.built()\n                t.visited()\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n            else:\n                t.visited()\n\n    executed = executed_with_callbacks\n\n    def failed(self):\n        \"\"\"\n        Default action when a task fails:  stop the build.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        self.fail_stop()\n\n    def fail_stop(self):\n        \"\"\"\n        Explicit stop-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_stop()', self.node))\n\n        # Invoke will_not_build() to clean-up the pending children\n        # list.\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n        # Tell the taskmaster to not start any new tasks\n        self.tm.stop()\n\n        # We're stopping because of a build failure, but give the\n        # calling Task class a chance to postprocess() the top-level\n        # target under which the build failure occurred.\n        self.targets = [self.tm.current_top]\n        self.top = 1\n\n    def fail_continue(self):\n        \"\"\"\n        Explicit continue-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_continue()', self.node))\n\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n    def make_ready_all(self):\n        \"\"\"\n        Marks all targets in a task ready for execution.\n\n        This is used when the interface needs every target Node to be\n        visited--the canonical example being the \"scons -c\" option.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.make_ready_all()', self.node))\n\n        self.out_of_date = self.targets[:]\n        for t in self.targets:\n            t.disambiguate().set_state(NODE_EXECUTING)\n            for s in t.side_effects:\n                # add disambiguate here to mirror the call on targets above\n                s.disambiguate().set_state(NODE_EXECUTING)\n\n    def make_ready_current(self):\n        \"\"\"\n        Marks all targets in a task ready for execution if any target\n        is not current.\n\n        This is the default behavior for building only what's necessary.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.make_ready_current()',\n                                         self.node))\n\n        self.out_of_date = []\n        needs_executing = False\n        for t in self.targets:\n            try:\n                t.disambiguate().make_ready()\n                is_up_to_date = not t.has_builder() or \\\n                                (not t.always_build and t.is_up_to_date())\n            except EnvironmentError, e:\n                raise SCons.Errors.BuildError(node=t, errstr=e.strerror, filename=e.filename)\n\n            if not is_up_to_date:\n                self.out_of_date.append(t)\n                needs_executing = True\n\n        if needs_executing:\n            for t in self.targets:\n                t.set_state(NODE_EXECUTING)\n                for s in t.side_effects:\n                    # add disambiguate here to mirror the call on targets in first loop above\n                    s.disambiguate().set_state(NODE_EXECUTING)\n        else:\n            for t in self.targets:\n                # We must invoke visited() to ensure that the node\n                # information has been computed before allowing the\n                # parent nodes to execute. (That could occur in a\n                # parallel build...)\n                t.visited()\n                t.set_state(NODE_UP_TO_DATE)\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n\n    make_ready = make_ready_current\n\n    def postprocess(self):\n        \"\"\"\n        Post-processes a task after it's been executed.\n\n        This examines all the targets just built (or not, we don't care\n        if the build was successful, or even if there was no build\n        because everything was up-to-date) to see if they have any\n        waiting parent Nodes, or Nodes waiting on a common side effect,\n        that can be put back on the candidates list.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.postprocess()', self.node))\n\n        # We may have built multiple targets, some of which may have\n        # common parents waiting for this build.  Count up how many\n        # targets each parent was waiting for so we can subtract the\n        # values later, and so we *don't* put waiting side-effect Nodes\n        # back on the candidates list if the Node is also a waiting\n        # parent.\n\n        targets = set(self.targets)\n\n        pending_children = self.tm.pending_children\n        parents = {}\n        for t in targets:\n            # A node can only be in the pending_children set if it has\n            # some waiting_parents.\n            if t.waiting_parents:\n                if T: T.write(self.trace_message(u'Task.postprocess()',\n                                                 t,\n                                                 'removing'))\n                pending_children.discard(t)\n            for p in t.waiting_parents:\n                parents[p] = parents.get(p, 0) + 1\n\n        for t in targets:\n            if t.side_effects is not None:\n                for s in t.side_effects:\n                    if s.get_state() == NODE_EXECUTING:\n                        s.set_state(NODE_NO_STATE)\n                        for p in s.waiting_parents:\n                            parents[p] = parents.get(p, 0) + 1\n                    for p in s.waiting_s_e:\n                        if p.ref_count == 0:\n                            self.tm.candidates.append(p)\n\n        for p, subtract in parents.items():\n            p.ref_count = p.ref_count - subtract\n            if T: T.write(self.trace_message(u'Task.postprocess()',\n                                             p,\n                                             'adjusted parent ref count'))\n            if p.ref_count == 0:\n                self.tm.candidates.append(p)\n\n        for t in targets:\n            t.postprocess()\n\n    # Exception handling subsystem.\n    #\n    # Exceptions that occur while walking the DAG or examining Nodes\n    # must be raised, but must be raised at an appropriate time and in\n    # a controlled manner so we can, if necessary, recover gracefully,\n    # possibly write out signature information for Nodes we've updated,\n    # etc.  This is done by having the Taskmaster tell us about the\n    # exception, and letting\n\n    def exc_info(self):\n        \"\"\"\n        Returns info about a recorded exception.\n        \"\"\"\n        return self.exception\n\n    def exc_clear(self):\n        \"\"\"\n        Clears any recorded exception.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the appropriate do-nothing method.\n        \"\"\"\n        self.exception = (None, None, None)\n        self.exception_raise = self._no_exception_to_raise\n\n    def exception_set(self, exception=None):\n        \"\"\"\n        Records an exception to be raised at the appropriate time.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the method that will, in fact\n        \"\"\"\n        if not exception:\n            exception = sys.exc_info()\n        self.exception = exception\n        self.exception_raise = self._exception_raise\n\n    def _no_exception_to_raise(self):\n        pass\n\n    def _exception_raise(self):\n        \"\"\"\n        Raises a pending exception that was recorded while getting a\n        Task ready for execution.\n        \"\"\"\n        exc = self.exc_info()[:]\n        try:\n            exc_type, exc_value, exc_traceback = exc\n        except ValueError:\n            exc_type, exc_value = exc\n            exc_traceback = None\n        raise exc_type, exc_value, exc_traceback\n\nclass AlwaysTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Always returns True (indicating this Task should always\n        be executed).\n\n        Subclasses that need this behavior (as opposed to the default\n        of only executing Nodes that are out of date w.r.t. their\n        dependencies) can use this as follows:\n\n            class MyTaskSubclass(SCons.Taskmaster.Task):\n                needs_execute = SCons.Taskmaster.Task.execute_always\n        \"\"\"\n        return True\n\nclass OutOfDateTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Returns True (indicating this Task should be executed) if this\n        Task's target state indicates it needs executing, which has\n        already been determined by an earlier up-to-date check.\n        \"\"\"\n        return self.targets[0].get_state() == SCons.Node.executing\n\n\ndef find_cycle(stack, visited):\n    if stack[-1] in visited:\n        return None\n    visited.add(stack[-1])\n    for n in stack[-1].waiting_parents:\n        stack.append(n)\n        if stack[0] == stack[-1]:\n            return stack\n        if find_cycle(stack, visited):\n            return stack\n        stack.pop()\n    return None\n\n\nclass Taskmaster(object):\n    \"\"\"\n    The Taskmaster for walking the dependency DAG.\n    \"\"\"\n\n    def __init__(self, targets=[], tasker=None, order=None, trace=None):\n        self.original_top = targets\n        self.top_targets_left = targets[:]\n        self.top_targets_left.reverse()\n        self.candidates = []\n        if tasker is None:\n            tasker = OutOfDateTask\n        self.tasker = tasker\n        if not order:\n            order = lambda l: l\n        self.order = order\n        self.message = None\n        self.trace = trace\n        self.next_candidate = self.find_next_candidate\n        self.pending_children = set()\n\n    def find_next_candidate(self):\n        \"\"\"\n        Returns the next candidate Node for (potential) evaluation.\n\n        The candidate list (really a stack) initially consists of all of\n        the top-level (command line) targets provided when the Taskmaster\n        was initialized.  While we walk the DAG, visiting Nodes, all the\n        children that haven't finished processing get pushed on to the\n        candidate list.  Each child can then be popped and examined in\n        turn for whether *their* children are all up-to-date, in which\n        case a Task will be created for their actual evaluation and\n        potential building.\n\n        Here is where we also allow candidate Nodes to alter the list of\n        Nodes that should be examined.  This is used, for example, when\n        invoking SCons in a source directory.  A source directory Node can\n        return its corresponding build directory Node, essentially saying,\n        \"Hey, you really need to build this thing over here instead.\"\n        \"\"\"\n        try:\n            return self.candidates.pop()\n        except IndexError:\n            pass\n        try:\n            node = self.top_targets_left.pop()\n        except IndexError:\n            return None\n        self.current_top = node\n        alt, message = node.alter_targets()\n        if alt:\n            self.message = message\n            self.candidates.append(node)\n            self.candidates.extend(self.order(alt))\n            node = self.candidates.pop()\n        return node\n\n    def no_next_candidate(self):\n        \"\"\"\n        Stops Taskmaster processing by not returning a next candidate.\n\n        Note that we have to clean-up the Taskmaster candidate list\n        because the cycle detection depends on the fact all nodes have\n        been processed somehow.\n        \"\"\"\n        while self.candidates:\n            candidates = self.candidates\n            self.candidates = []\n            self.will_not_build(candidates)\n        return None\n\n    def _validate_pending_children(self):\n        \"\"\"\n        Validate the content of the pending_children set. Assert if an\n        internal error is found.\n\n        This function is used strictly for debugging the taskmaster by\n        checking that no invariants are violated. It is not used in\n        normal operation.\n\n        The pending_children set is used to detect cycles in the\n        dependency graph. We call a \"pending child\" a child that is\n        found in the \"pending\" state when checking the dependencies of\n        its parent node.\n\n        A pending child can occur when the Taskmaster completes a loop\n        through a cycle. For example, lets imagine a graph made of\n        three node (A, B and C) making a cycle. The evaluation starts\n        at node A. The taskmaster first consider whether node A's\n        child B is up-to-date. Then, recursively, node B needs to\n        check whether node C is up-to-date. This leaves us with a\n        dependency graph looking like:\n\n                                      Next candidate \\\n                                                      \\\n        Node A (Pending) --> Node B(Pending) --> Node C (NoState)\n                ^                                     |\n                |                                     |\n                +-------------------------------------+\n\n        Now, when the Taskmaster examines the Node C's child Node A,\n        it finds that Node A is in the \"pending\" state. Therefore,\n        Node A is a pending child of node C.\n\n        Pending children indicate that the Taskmaster has potentially\n        loop back through a cycle. We say potentially because it could\n        also occur when a DAG is evaluated in parallel. For example,\n        consider the following graph:\n\n\n        Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...\n                |                                     ^\n                |                                     |\n                +----------> Node D (NoState) --------+\n                                  /\n                  Next candidate /\n\n        The Taskmaster first evaluates the nodes A, B, and C and\n        starts building some children of node C. Assuming, that the\n        maximum parallel level has not been reached, the Taskmaster\n        will examine Node D. It will find that Node C is a pending\n        child of Node D.\n\n        In summary, evaluating a graph with a cycle will always\n        involve a pending child at one point. A pending child might\n        indicate either a cycle or a diamond-shaped DAG. Only a\n        fraction of the nodes ends-up being a \"pending child\" of\n        another node. This keeps the pending_children set small in\n        practice.\n\n        We can differentiate between the two cases if we wait until\n        the end of the build. At this point, all the pending children\n        nodes due to a diamond-shaped DAG will have been properly\n        built (or will have failed to build). But, the pending\n        children involved in a cycle will still be in the pending\n        state.\n\n        The taskmaster removes nodes from the pending_children set as\n        soon as a pending_children node moves out of the pending\n        state. This also helps to keep the pending_children set small.\n        \"\"\"\n\n        for n in self.pending_children:\n            assert n.state in (NODE_PENDING, NODE_EXECUTING), \\\n                (str(n), StateString[n.state])\n            assert len(n.waiting_parents) != 0, (str(n), len(n.waiting_parents))\n            for p in n.waiting_parents:\n                assert p.ref_count > 0, (str(n), str(p), p.ref_count)\n\n\n    def trace_message(self, message):\n        return 'Taskmaster: %s\\n' % message\n\n    def trace_node(self, node):\n        return '<%-10s %-3s %s>' % (StateString[node.get_state()],\n                                    node.ref_count,\n                                    repr(str(node)))\n\n    def _find_next_ready_node(self):\n        \"\"\"\n        Finds the next node that is ready to be built.\n\n        This is *the* main guts of the DAG walk.  We loop through the\n        list of candidates, looking for something that has no un-built\n        children (i.e., that is a leaf Node or has dependencies that are\n        all leaf Nodes or up-to-date).  Candidate Nodes are re-scanned\n        (both the target Node itself and its sources, which are always\n        scanned in the context of a given target) to discover implicit\n        dependencies.  A Node that must wait for some children to be\n        built will be put back on the candidates list after the children\n        have finished building.  A Node that has been put back on the\n        candidates list in this way may have itself (or its sources)\n        re-scanned, in order to handle generated header files (e.g.) and\n        the implicit dependencies therein.\n\n        Note that this method does not do any signature calculation or\n        up-to-date check itself.  All of that is handled by the Task\n        class.  This is purely concerned with the dependency graph walk.\n        \"\"\"\n\n        self.ready_exc = None\n\n        T = self.trace\n        if T: T.write(u'\\n' + self.trace_message('Looking for a node to evaluate'))\n\n        while True:\n            node = self.next_candidate()\n            if node is None:\n                if T: T.write(self.trace_message('No candidate anymore.') + u'\\n')\n                return None\n\n            node = node.disambiguate()\n            state = node.get_state()\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            if CollectStats:\n                if not hasattr(node, 'stats'):\n                    node.stats = Stats()\n                    StatsNodes.append(node)\n                S = node.stats\n                S.considered = S.considered + 1\n            else:\n                S = None\n\n            if T: T.write(self.trace_message(u'    Considering node %s and its children:' % self.trace_node(node)))\n\n            if state == NODE_NO_STATE:\n                # Mark this node as being on the execution stack:\n                node.set_state(NODE_PENDING)\n            elif state > NODE_PENDING:\n                # Skip this node if it has already been evaluated:\n                if S: S.already_handled = S.already_handled + 1\n                if T: T.write(self.trace_message(u'       already handled (executed)'))\n                continue\n\n            executor = node.get_executor()\n\n            try:\n                children = executor.get_all_children()\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                e = SCons.Errors.ExplicitExit(node, exc_value.code)\n                self.ready_exc = (SCons.Errors.ExplicitExit, e)\n                if T: T.write(self.trace_message('       SystemExit'))\n                return node\n            except Exception, e:\n                # We had a problem just trying to figure out the\n                # children (like a child couldn't be linked in to a\n                # VariantDir, or a Scanner threw something).  Arrange to\n                # raise the exception when the Task is \"executed.\"\n                self.ready_exc = sys.exc_info()\n                if S: S.problem = S.problem + 1\n                if T: T.write(self.trace_message('       exception %s while scanning children.\\n' % e))\n                return node\n\n            children_not_visited = []\n            children_pending = set()\n            children_not_ready = []\n            children_failed = False\n\n            for child in chain(executor.get_all_prerequisites(), children):\n                childstate = child.get_state()\n\n                if T: T.write(self.trace_message(u'       ' + self.trace_node(child)))\n\n                if childstate == NODE_NO_STATE:\n                    children_not_visited.append(child)\n                elif childstate == NODE_PENDING:\n                    children_pending.add(child)\n                elif childstate == NODE_FAILED:\n                    children_failed = True\n\n                if childstate <= NODE_EXECUTING:\n                    children_not_ready.append(child)\n\n\n            # These nodes have not even been visited yet.  Add\n            # them to the list so that on some next pass we can\n            # take a stab at evaluating them (or their children).\n            children_not_visited.reverse()\n            self.candidates.extend(self.order(children_not_visited))\n            #if T and children_not_visited:\n            #    T.write(self.trace_message('     adding to candidates: %s' % map(str, children_not_visited)))\n            #    T.write(self.trace_message('     candidates now: %s\\n' % map(str, self.candidates)))\n\n            # Skip this node if any of its children have failed.\n            #\n            # This catches the case where we're descending a top-level\n            # target and one of our children failed while trying to be\n            # built by a *previous* descent of an earlier top-level\n            # target.\n            #\n            # It can also occur if a node is reused in multiple\n            # targets. One first descends though the one of the\n            # target, the next time occurs through the other target.\n            #\n            # Note that we can only have failed_children if the\n            # --keep-going flag was used, because without it the build\n            # will stop before diving in the other branch.\n            #\n            # Note that even if one of the children fails, we still\n            # added the other children to the list of candidate nodes\n            # to keep on building (--keep-going).\n            if children_failed:\n                for n in executor.get_action_targets():\n                    n.set_state(NODE_FAILED)\n\n                if S: S.child_failed = S.child_failed + 1\n                if T: T.write(self.trace_message('****** %s\\n' % self.trace_node(node)))\n                continue\n\n            if children_not_ready:\n                for child in children_not_ready:\n                    # We're waiting on one or more derived targets\n                    # that have not yet finished building.\n                    if S: S.not_built = S.not_built + 1\n\n                    # Add this node to the waiting parents lists of\n                    # anything we're waiting on, with a reference\n                    # count so we can be put back on the list for\n                    # re-evaluation when they've all finished.\n                    node.ref_count =  node.ref_count + child.add_to_waiting_parents(node)\n                    if T: T.write(self.trace_message(u'     adjusted ref count: %s, child %s' %\n                                  (self.trace_node(node), repr(str(child)))))\n\n                if T:\n                    for pc in children_pending:\n                        T.write(self.trace_message('       adding %s to the pending children set\\n' %\n                                self.trace_node(pc)))\n                self.pending_children = self.pending_children | children_pending\n\n                continue\n\n            # Skip this node if it has side-effects that are\n            # currently being built:\n            wait_side_effects = False\n            for se in executor.get_action_side_effects():\n                if se.get_state() == NODE_EXECUTING:\n                    se.add_to_waiting_s_e(node)\n                    wait_side_effects = True\n\n            if wait_side_effects:\n                if S: S.side_effects = S.side_effects + 1\n                continue\n\n            # The default when we've gotten through all of the checks above:\n            # this node is ready to be built.\n            if S: S.build = S.build + 1\n            if T: T.write(self.trace_message(u'Evaluating %s\\n' %\n                                             self.trace_node(node)))\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            return node\n\n        return None\n\n    def next_task(self):\n        \"\"\"\n        Returns the next task to be executed.\n\n        This simply asks for the next Node to be evaluated, and then wraps\n        it in the specific Task subclass with which we were initialized.\n        \"\"\"\n        node = self._find_next_ready_node()\n\n        if node is None:\n            return None\n\n        executor = node.get_executor()\n        if executor is None:\n            return None\n\n        tlist = executor.get_all_targets()\n\n        task = self.tasker(self, tlist, node in self.original_top, node)\n        try:\n            task.make_ready()\n        except:\n            # We had a problem just trying to get this task ready (like\n            # a child couldn't be linked in to a VariantDir when deciding\n            # whether this node is current).  Arrange to raise the\n            # exception when the Task is \"executed.\"\n            self.ready_exc = sys.exc_info()\n\n        if self.ready_exc:\n            task.exception_set(self.ready_exc)\n\n        self.ready_exc = None\n\n        return task\n\n    def will_not_build(self, nodes, node_func=lambda n: None):\n        \"\"\"\n        Perform clean-up about nodes that will never be built. Invokes\n        a user defined function on all of these nodes (including all\n        of their parents).\n        \"\"\"\n\n        T = self.trace\n\n        pending_children = self.pending_children\n\n        to_visit = set(nodes)\n        pending_children = pending_children - to_visit\n\n        if T:\n            for n in nodes:\n                T.write(self.trace_message('       removing node %s from the pending children set\\n' %\n                        self.trace_node(n)))\n        try:\n            while len(to_visit):\n                node = to_visit.pop()\n                node_func(node)\n\n                # Prune recursion by flushing the waiting children\n                # list immediately.\n                parents = node.waiting_parents\n                node.waiting_parents = set()\n\n                to_visit = to_visit | parents\n                pending_children = pending_children - parents\n\n                for p in parents:\n                    p.ref_count = p.ref_count - 1\n                    if T: T.write(self.trace_message('       removing parent %s from the pending children set\\n' %\n                                  self.trace_node(p)))\n        except KeyError:\n            # The container to_visit has been emptied.\n            pass\n\n        # We have the stick back the pending_children list into the\n        # taskmaster because the python 1.5.2 compatibility does not\n        # allow us to use in-place updates\n        self.pending_children = pending_children\n\n    def stop(self):\n        \"\"\"\n        Stops the current build completely.\n        \"\"\"\n        self.next_candidate = self.no_next_candidate\n\n    def cleanup(self):\n        \"\"\"\n        Check for dependency cycles.\n        \"\"\"\n        if not self.pending_children:\n            return\n\n        nclist = [(n, find_cycle([n], set())) for n in self.pending_children]\n\n        genuine_cycles = [\n            node for node,cycle in nclist\n                     if cycle or node.get_state() != NODE_EXECUTED\n        ]\n        if not genuine_cycles:\n            # All of the \"cycles\" found were single nodes in EXECUTED state,\n            # which is to say, they really weren't cycles.  Just return.\n            return\n\n        desc = 'Found dependency cycle(s):\\n'\n        for node, cycle in nclist:\n            if cycle:\n                desc = desc + \"  \" + \" -> \".join(map(str, cycle)) + \"\\n\"\n            else:\n                desc = desc + \\\n                    \"  Internal Error: no cycle found for node %s (%s) in state %s\\n\" %  \\\n                    (node, repr(node), StateString[node.get_state()])\n\n        raise SCons.Errors.UserError(desc)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/386asm.py",
    "content": "\"\"\"SCons.Tool.386asm\n\nTool specification for the 386ASM assembler for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/386asm.py  2014/07/05 09:42:21 garyo\"\n\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\nimport SCons.Util\n\nas_module = __import__('as', globals(), locals(), [])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = '386asm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS $SOURCES -o $TARGET'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES -o $TARGET'\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    return env.Detect('386asm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/BitKeeper.py",
    "content": "\"\"\"SCons.Tool.BitKeeper.py\n\nTool-specific initialization for the BitKeeper source code control\nsystem.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/BitKeeper.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    BitKeeper to an Environment.\"\"\"\n\n    def BitKeeperFactory(env=env):\n        \"\"\" \"\"\"\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The BitKeeper() factory is deprecated and there is no replacement.\"\"\")\n        act = SCons.Action.Action(\"$BITKEEPERCOM\", \"$BITKEEPERCOMSTR\")\n        return SCons.Builder.Builder(action = act, env = env)\n\n    #setattr(env, 'BitKeeper', BitKeeperFactory)\n    env.BitKeeper = BitKeeperFactory\n\n    env['BITKEEPER']         = 'bk'\n    env['BITKEEPERGET']      = '$BITKEEPER get'\n    env['BITKEEPERGETFLAGS'] = SCons.Util.CLVar('')\n    env['BITKEEPERCOM']      = '$BITKEEPERGET $BITKEEPERGETFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('bk')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/CVS.py",
    "content": "\"\"\"SCons.Tool.CVS.py\n\nTool-specific initialization for CVS.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/CVS.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    CVS to an Environment.\"\"\"\n\n    def CVSFactory(repos, module='', env=env):\n        \"\"\" \"\"\"\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The CVS() factory is deprecated and there is no replacement.\"\"\")\n        # fail if repos is not an absolute path name?\n        if module != '':\n           # Don't use os.path.join() because the name we fetch might\n           # be across a network and must use POSIX slashes as separators.\n           module = module + '/'\n           env['CVSCOM']   = '$CVS $CVSFLAGS co $CVSCOFLAGS -d ${TARGET.dir} $CVSMODULE${TARGET.posix}'\n        act = SCons.Action.Action('$CVSCOM', '$CVSCOMSTR')\n        return SCons.Builder.Builder(action = act,\n                                     env = env,\n                                     CVSREPOSITORY = repos,\n                                     CVSMODULE = module)\n\n    #setattr(env, 'CVS', CVSFactory)\n    env.CVS = CVSFactory\n\n    env['CVS']        = 'cvs'\n    env['CVSFLAGS']   = SCons.Util.CLVar('-d $CVSREPOSITORY')\n    env['CVSCOFLAGS'] = SCons.Util.CLVar('')\n    env['CVSCOM']     = '$CVS $CVSFLAGS co $CVSCOFLAGS ${TARGET.posix}'\n\ndef exists(env):\n    return env.Detect('cvs')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/GettextCommon.py",
    "content": "\"\"\"SCons.Tool.GettextCommon module\n\nUsed by several tools of `gettext` toolset.\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/GettextCommon.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Warnings\nimport re\n\n#############################################################################\nclass XgettextToolWarning(SCons.Warnings.Warning): pass\nclass XgettextNotFound(XgettextToolWarning): pass\nclass MsginitToolWarning(SCons.Warnings.Warning): pass\nclass MsginitNotFound(MsginitToolWarning): pass\nclass MsgmergeToolWarning(SCons.Warnings.Warning): pass\nclass MsgmergeNotFound(MsgmergeToolWarning): pass\nclass MsgfmtToolWarning(SCons.Warnings.Warning): pass\nclass MsgfmtNotFound(MsgfmtToolWarning): pass\n#############################################################################\nSCons.Warnings.enableWarningClass(XgettextToolWarning)\nSCons.Warnings.enableWarningClass(XgettextNotFound)\nSCons.Warnings.enableWarningClass(MsginitToolWarning)\nSCons.Warnings.enableWarningClass(MsginitNotFound)\nSCons.Warnings.enableWarningClass(MsgmergeToolWarning)\nSCons.Warnings.enableWarningClass(MsgmergeNotFound)\nSCons.Warnings.enableWarningClass(MsgfmtToolWarning)\nSCons.Warnings.enableWarningClass(MsgfmtNotFound)\n#############################################################################\n\n#############################################################################\nclass _POTargetFactory(object):\n  \"\"\" A factory of `PO` target files.\n\n  Factory defaults differ from these of `SCons.Node.FS.FS`.  We set `precious`\n  (this is required by builders and actions gettext) and `noclean` flags by\n  default for all produced nodes.\n  \"\"\"\n  def __init__( self, env, nodefault = True, alias = None, precious = True\n              , noclean = True ):\n    \"\"\" Object constructor.\n\n    **Arguments**\n\n        - *env* (`SCons.Environment.Environment`)\n        - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored\n          from default target `'.'`\n        - *alias* (`string`) - if provided, produced nodes will be automatically\n          added to this alias, and alias will be set as `AlwaysBuild`\n        - *precious* (`boolean`) - if `True`, the produced nodes will be set as\n          `Precious`.\n        - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded\n          from `Clean`.\n    \"\"\"\n    self.env = env\n    self.alias = alias\n    self.precious = precious\n    self.noclean = noclean\n    self.nodefault = nodefault\n\n  def _create_node(self, name, factory, directory = None, create = 1):\n    \"\"\" Create node, and set it up to factory settings. \"\"\"\n    import SCons.Util\n    node = factory(name, directory, create)\n    node.set_noclean(self.noclean)\n    node.set_precious(self.precious)\n    if self.nodefault:\n      self.env.Ignore('.', node)\n    if self.alias:\n      self.env.AlwaysBuild(self.env.Alias(self.alias, node))\n    return node\n\n  def Entry(self, name, directory = None, create = 1):\n    \"\"\" Create `SCons.Node.FS.Entry` \"\"\"\n    return self._create_node(name, self.env.fs.Entry, directory, create)\n\n  def File(self, name, directory = None, create = 1):\n    \"\"\" Create `SCons.Node.FS.File` \"\"\"\n    return self._create_node(name, self.env.fs.File, directory, create)\n#############################################################################\n\n#############################################################################\n_re_comment = re.compile(r'(#[^\\n\\r]+)$', re.M)\n_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)\n#############################################################################\ndef _read_linguas_from_files(env, linguas_files = None):\n  \"\"\" Parse `LINGUAS` file and return list of extracted languages \"\"\"\n  import SCons.Util\n  import SCons.Environment\n  global _re_comment\n  global _re_lang\n  if not SCons.Util.is_List(linguas_files) \\\n  and not SCons.Util.is_String(linguas_files) \\\n  and not isinstance(linguas_files, SCons.Node.FS.Base) \\\n  and linguas_files:\n    # If, linguas_files==True or such, then read 'LINGUAS' file.\n    linguas_files = [ 'LINGUAS' ]\n  if linguas_files is None:\n    return []\n  fnodes = env.arg2nodes(linguas_files)\n  linguas = []\n  for fnode in fnodes:\n    contents =  _re_comment.sub(\"\", fnode.get_text_contents())\n    ls = [ l for l in _re_lang.findall(contents) if l ]\n    linguas.extend(ls)\n  return linguas\n#############################################################################\n\n#############################################################################\nfrom SCons.Builder import BuilderBase\n#############################################################################\nclass _POFileBuilder(BuilderBase):\n  \"\"\" `PO` file builder.\n\n  This is multi-target single-source builder. In typical situation the source\n  is single `POT` file, e.g. `messages.pot`, and there are multiple `PO`\n  targets to be updated from this `POT`. We must run\n  `SCons.Builder.BuilderBase._execute()` separatelly for each target to track\n  dependencies separatelly for each target file.\n\n  **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)`\n  with target being list of all targets, all targets would be rebuilt each time\n  one of the targets from this list is missing. This would happen, for example,\n  when new language `ll` enters `LINGUAS_FILE` (at this moment there is no\n  `ll.po` file yet). To avoid this, we override\n  `SCons.Builder.BuilerBase._execute()` and call it separatelly for each\n  target. Here we also append to the target list the languages read from\n  `LINGUAS_FILE`.\n  \"\"\"\n  #\n  #* The argument for overriding _execute(): We must use environment with\n  #  builder overrides applied (see BuilderBase.__init__(). Here it comes for\n  #  free.\n  #* The argument against using 'emitter': The emitter is called too late\n  #  by BuilderBase._execute(). If user calls, for example:\n  #\n  #    env.POUpdate(LINGUAS_FILE = 'LINGUAS')\n  #\n  #  the builder throws error, because it is called with target=None,\n  #  source=None and is trying to \"generate\" sources or target list first.\n  #  If user calls\n  #\n  #    env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS')\n  #\n  #  the env.BuilderWrapper() calls our builder with target=None,\n  #  source=['foo', 'baz']. The BuilderBase._execute() then splits execution\n  #  and execute iterativelly (recursion) self._execute(None, source[i]).\n  #  After that it calls emitter (which is quite too late). The emitter is\n  #  also called in each iteration, what makes things yet worse.\n  def __init__(self, env, **kw):\n    if not 'suffix' in kw:\n       kw['suffix'] = '$POSUFFIX'\n    if not 'src_suffix' in kw:\n       kw['src_suffix'] = '$POTSUFFIX'\n    if not 'src_builder' in kw:\n       kw['src_builder'] = '_POTUpdateBuilder'\n    if not 'single_source' in kw:\n       kw['single_source'] = True\n    alias = None\n    if 'target_alias' in kw:\n       alias = kw['target_alias']\n       del kw['target_alias']\n    if not 'target_factory' in kw:\n       kw['target_factory'] = _POTargetFactory(env, alias=alias).File\n    BuilderBase.__init__(self, **kw)\n\n  def _execute(self, env, target, source, *args, **kw):\n    \"\"\" Execute builder's actions.\n\n    Here we append to `target` the languages read from `$LINGUAS_FILE` and\n    apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.\n    The arguments and return value are same as for\n    `SCons.Builder.BuilderBase._execute()`.\n    \"\"\"\n    import SCons.Util\n    import SCons.Node\n    linguas_files = None\n    if env.has_key('LINGUAS_FILE') and env['LINGUAS_FILE']:\n      linguas_files = env['LINGUAS_FILE']\n      # This prevents endless recursion loop (we'll be invoked once for\n      # each target appended here, we must not extend the list again).\n      env['LINGUAS_FILE'] = None\n      linguas = _read_linguas_from_files(env,linguas_files)\n      if SCons.Util.is_List(target):\n        target.extend(linguas)\n      elif target is not None:\n        target = [target] + linguas\n      else:\n        target = linguas\n    if not target:\n      # Let the SCons.BuilderBase to handle this patologic situation\n      return BuilderBase._execute( self, env, target, source, *args, **kw)\n    # The rest is ours\n    if not SCons.Util.is_List(target):\n      target = [ target ]\n    result = []\n    for tgt in target:\n      r = BuilderBase._execute( self, env, [tgt], source, *args, **kw)\n      result.extend(r)\n    if linguas_files is not None:\n      env['LINGUAS_FILE'] = linguas_files\n    return SCons.Node.NodeList(result)\n#############################################################################\n\nimport SCons.Environment\n#############################################################################\ndef _translate(env, target=None, source=SCons.Environment._null, *args, **kw):\n  \"\"\" Function for `Translate()` pseudo-builder \"\"\"\n  if target is None: target = []\n  pot = env.POTUpdate(None, source, *args, **kw)\n  po = env.POUpdate(target, pot, *args, **kw)\n  return po\n#############################################################################\n\n#############################################################################\nclass RPaths(object):\n  \"\"\" Callable object, which returns pathnames relative to SCons current\n  working directory.\n\n  It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths\n  for nodes that are outside of current working directory (`env.fs.getcwd()`).\n  Here, we often have `SConscript`, `POT` and `PO` files within `po/`\n  directory and source files (e.g. `*.c`) outside of it. When generating `POT`\n  template file, references to source files are written to `POT` template, so\n  a translator may later quickly jump to appropriate source file and line from\n  its `PO` editor (e.g. `poedit`).  Relative paths in  `PO` file are usually\n  interpreted by `PO` editor as paths relative to the place, where `PO` file\n  lives. The absolute paths would make resultant `POT` file nonportable, as\n  the references would be correct only on the machine, where `POT` file was\n  recently re-created. For such reason, we need a function, which always\n  returns relative paths. This is the purpose of `RPaths` callable object.\n\n  The `__call__` method returns paths relative to current woking directory, but\n  we assume, that *xgettext(1)* is run from the directory, where target file is\n  going to be created.\n\n  Note, that this may not work for files distributed over several hosts or\n  across different drives on windows. We assume here, that single local\n  filesystem holds both source files and target `POT` templates.\n\n  Intended use of `RPaths` - in `xgettext.py`::\n\n    def generate(env):\n        from GettextCommon import RPaths\n        ...\n        sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET, SOURCES)} $)'\n        env.Append(\n          ...\n          XGETTEXTCOM = 'XGETTEXT ... ' + sources,\n          ...\n          XgettextRPaths = RPaths(env)\n        )\n  \"\"\"\n  # NOTE: This callable object returns pathnames of dirs/files relative to\n  # current working directory. The pathname remains relative also for entries\n  # that are outside of current working directory (node, that\n  # SCons.Node.FS.File and siblings return absolute path in such case). For\n  # simplicity we compute path relative to current working directory, this\n  # seems be enough for our purposes (don't need TARGET variable and\n  # SCons.Defaults.Variable_Caller stuff).\n\n  def __init__(self, env):\n    \"\"\" Initialize `RPaths` callable object.\n\n      **Arguments**:\n\n        - *env* - a `SCons.Environment.Environment` object, defines *current\n          working dir*.\n    \"\"\"\n    self.env = env\n\n  # FIXME: I'm not sure, how it should be implemented (what the *args are in\n  # general, what is **kw).\n  def __call__(self, nodes, *args, **kw):\n    \"\"\" Return nodes' paths (strings) relative to current working directory.\n\n      **Arguments**:\n\n        - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.\n        - *args* -  currently unused.\n        - *kw* - currently unused.\n\n      **Returns**:\n\n       - Tuple of strings, which represent paths relative to current working\n         directory (for given environment).\n    \"\"\"\n    # os.path.relpath is available only on python >= 2.6. We use our own\n    # implementation. It's taken from BareNecessities package:\n    #   http://jimmyg.org/work/code/barenecessities/index.html\n    from posixpath import curdir\n    def relpath(path, start=curdir):\n        import posixpath\n        \"\"\"Return a relative version of a path\"\"\"\n        if not path:\n           raise ValueError(\"no path specified\")\n        start_list = posixpath.abspath(start).split(posixpath.sep)\n        path_list = posixpath.abspath(path).split(posixpath.sep)\n        # Work out how much of the filepath is shared by start and path.\n        i = len(posixpath.commonprefix([start_list, path_list]))\n        rel_list = [posixpath.pardir] * (len(start_list)-i) + path_list[i:]\n        if not rel_list:\n           return posixpath.curdir\n        return posixpath.join(*rel_list)\n    import os\n    import SCons.Node.FS\n    rpaths = ()\n    cwd =  self.env.fs.getcwd().get_abspath()\n    for node in nodes:\n      rpath = None\n      if isinstance(node, SCons.Node.FS.Base):\n        rpath = relpath(node.get_abspath(), cwd)\n      # FIXME: Other types possible here?\n      if rpath is not None:\n        rpaths += (rpath,)\n    return rpaths\n#############################################################################\n\n#############################################################################\ndef _init_po_files(target, source, env):\n  \"\"\" Action function for `POInit` builder. \"\"\"\n  nop = lambda target, source, env : 0\n  if env.has_key('POAUTOINIT'):\n    autoinit = env['POAUTOINIT']\n  else:\n    autoinit = False\n  # Well, if everything outside works well, this loop should do single\n  # iteration. Otherwise we are rebuilding all the targets even, if just\n  # one has changed (but is this out fault?).\n  for tgt in target:\n    if not tgt.exists():\n      if autoinit:\n        action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR')\n      else:\n        msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \\\n            + 'If you are a translator, you can create it through: \\n' \\\n            + '$MSGINITCOM'\n        action = SCons.Action.Action(nop, msg)\n      status = action([tgt], source, env)\n      if status: return status\n  return 0\n#############################################################################\n\n#############################################################################\ndef _detect_xgettext(env):\n  \"\"\" Detects *xgettext(1)* binary \"\"\"\n  if env.has_key('XGETTEXT'):\n    return env['XGETTEXT']\n  xgettext = env.Detect('xgettext');\n  if xgettext:\n    return xgettext\n  raise SCons.Errors.StopError(XgettextNotFound,\"Could not detect xgettext\")\n  return None\n#############################################################################\ndef _xgettext_exists(env):\n  return _detect_xgettext(env)\n#############################################################################\n\n#############################################################################\ndef _detect_msginit(env):\n  \"\"\" Detects *msginit(1)* program. \"\"\"\n  if env.has_key('MSGINIT'):\n    return env['MSGINIT']\n  msginit = env.Detect('msginit');\n  if msginit:\n    return msginit\n  raise SCons.Errors.StopError(MsginitNotFound, \"Could not detect msginit\")\n  return None\n#############################################################################\ndef _msginit_exists(env):\n  return  _detect_msginit(env)\n#############################################################################\n\n#############################################################################\ndef _detect_msgmerge(env):\n  \"\"\" Detects *msgmerge(1)* program. \"\"\"\n  if env.has_key('MSGMERGE'):\n    return env['MSGMERGE']\n  msgmerge = env.Detect('msgmerge');\n  if msgmerge:\n    return msgmerge\n  raise SCons.Errors.StopError(MsgmergeNotFound, \"Could not detect msgmerge\")\n  return None\n#############################################################################\ndef _msgmerge_exists(env):\n  return  _detect_msgmerge(env)\n#############################################################################\n\n#############################################################################\ndef _detect_msgfmt(env):\n  \"\"\" Detects *msgmfmt(1)* program. \"\"\"\n  if env.has_key('MSGFMT'):\n    return env['MSGFMT']\n  msgfmt = env.Detect('msgfmt');\n  if msgfmt:\n    return msgfmt\n  raise SCons.Errors.StopError(MsgfmtNotFound, \"Could not detect msgfmt\")\n  return None\n#############################################################################\ndef _msgfmt_exists(env):\n  return _detect_msgfmt(env)\n#############################################################################\n\n#############################################################################\ndef tool_list(platform, env):\n  \"\"\" List tools that shall be generated by top-level `gettext` tool \"\"\"\n  return [ 'xgettext', 'msginit', 'msgmerge', 'msgfmt' ]\n#############################################################################\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/__init__.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/__init__.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"\nCommon functions for Microsoft Visual Studio and Visual C/C++.\n\"\"\"\n\nimport copy\nimport os\nimport re\nimport subprocess\n\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon.sdk import mssdk_exists, \\\n                                    mssdk_setup_env\n\nfrom SCons.Tool.MSCommon.vc import msvc_exists, \\\n                                   msvc_setup_env, \\\n                                   msvc_setup_env_once\n\nfrom SCons.Tool.MSCommon.vs import get_default_version, \\\n                                   get_vs_by_version, \\\n                                   merge_default_version, \\\n                                   msvs_exists, \\\n                                   query_versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/arch.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/arch.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"Module to define supported Windows chip architectures.\n\"\"\"\n\nimport os\n\nclass ArchDefinition(object):\n    \"\"\"\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchitectureDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchitectureDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchitectureDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/common.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/common.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"\nCommon helper functions for working with the Microsoft tool chain.\n\"\"\"\n\nimport copy\nimport os\nimport subprocess\nimport re\n\nimport SCons.Util\n\n\nlogfile = os.environ.get('SCONS_MSCOMMON_DEBUG')\nif logfile == '-':\n    def debug(x):\n        print x\nelif logfile:\n    try:\n        import logging\n    except ImportError:\n        debug = lambda x: open(logfile, 'a').write(x + '\\n')\n    else:\n        logging.basicConfig(filename=logfile, level=logging.DEBUG)\n        debug = logging.debug\nelse:\n    debug = lambda x: None\n\n\n_is_win64 = None\n\ndef is_win64():\n    \"\"\"Return true if running on windows 64 bits.\n\n    Works whether python itself runs in 64 bits or 32 bits.\"\"\"\n    # Unfortunately, python does not provide a useful way to determine\n    # if the underlying Windows OS is 32-bit or 64-bit.  Worse, whether\n    # the Python itself is 32-bit or 64-bit affects what it returns,\n    # so nothing in sys.* or os.* help.\n\n    # Apparently the best solution is to use env vars that Windows\n    # sets.  If PROCESSOR_ARCHITECTURE is not x86, then the python\n    # process is running in 64 bit mode (on a 64-bit OS, 64-bit\n    # hardware, obviously).\n    # If this python is 32-bit but the OS is 64, Windows will set\n    # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null.\n    # (Checking for HKLM\\Software\\Wow6432Node in the registry doesn't\n    # work, because some 32-bit installers create it.)\n    global _is_win64\n    if _is_win64 is None:\n        # I structured these tests to make it easy to add new ones or\n        # add exceptions in the future, because this is a bit fragile.\n        _is_win64 = False\n        if os.environ.get('PROCESSOR_ARCHITECTURE','x86') != 'x86':\n            _is_win64 = True\n        if os.environ.get('PROCESSOR_ARCHITEW6432'):\n            _is_win64 = True\n        if os.environ.get('ProgramW6432'):\n            _is_win64 = True\n    return _is_win64\n\n\ndef read_reg(value):\n    return SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, value)[0]\n\ndef has_reg(value):\n    \"\"\"Return True if the given key exists in HKEY_LOCAL_MACHINE, False\n    otherwise.\"\"\"\n    try:\n        SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)\n        ret = True\n    except WindowsError:\n        ret = False\n    return ret\n\n# Functions for fetching environment variable settings from batch files.\n\ndef normalize_env(env, keys, force=False):\n    \"\"\"Given a dictionary representing a shell environment, add the variables\n    from os.environ needed for the processing of .bat files; the keys are\n    controlled by the keys argument.\n\n    It also makes sure the environment values are correctly encoded.\n\n    If force=True, then all of the key values that exist are copied\n    into the returned dictionary.  If force=false, values are only\n    copied if the key does not already exist in the copied dictionary.\n\n    Note: the environment is copied.\"\"\"\n    normenv = {}\n    if env:\n        for k in env.keys():\n            normenv[k] = copy.deepcopy(env[k]).encode('mbcs')\n\n        for k in keys:\n            if k in os.environ and (force or not k in normenv):\n                normenv[k] = os.environ[k].encode('mbcs')\n\n    # This shouldn't be necessary, since the default environment should include system32,\n    # but keep this here to be safe, since it's needed to find reg.exe which the MSVC\n    # bat scripts use.\n    sys32_dir = os.path.join(os.environ.get(\"SystemRoot\", os.environ.get(\"windir\",r\"C:\\Windows\\system32\")),\"System32\")\n\n    if sys32_dir not in normenv['PATH']:\n        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir\n\n    debug(\"PATH: %s\"%normenv['PATH'])\n\n    return normenv\n\ndef get_output(vcbat, args = None, env = None):\n    \"\"\"Parse the output of given bat file, with given args.\"\"\"\n\n    if env is None:\n        # Create a blank environment, for use in launching the tools\n        env = SCons.Environment.Environment(tools=[])\n\n    # TODO:  This is a hard-coded list of the variables that (may) need\n    # to be imported from os.environ[] for v[sc]*vars*.bat file\n    # execution to work.  This list should really be either directly\n    # controlled by vc.py, or else derived from the common_tools_var\n    # settings in vs.py.\n    vars = [\n        'COMSPEC',\n# VS100 and VS110: Still set, but modern MSVC setup scripts will\n# discard these if registry has values.  However Intel compiler setup\n# script still requires these as of 2013/2014.\n        'VS110COMNTOOLS',\n        'VS100COMNTOOLS',\n        'VS90COMNTOOLS',\n        'VS80COMNTOOLS',\n        'VS71COMNTOOLS',\n        'VS70COMNTOOLS',\n        'VS60COMNTOOLS',\n    ]\n    env['ENV'] = normalize_env(env['ENV'], vars, force=False)\n\n    if args:\n        debug(\"Calling '%s %s'\" % (vcbat, args))\n        popen = SCons.Action._subproc(env,\n                                     '\"%s\" %s & set' % (vcbat, args),\n                                     stdin = 'devnull',\n                                     stdout=subprocess.PIPE,\n                                     stderr=subprocess.PIPE)\n    else:\n        debug(\"Calling '%s'\" % vcbat)\n        popen = SCons.Action._subproc(env,\n                                     '\"%s\" & set' % vcbat,\n                                     stdin = 'devnull',\n                                     stdout=subprocess.PIPE,\n                                     stderr=subprocess.PIPE)\n\n    # Use the .stdout and .stderr attributes directly because the\n    # .communicate() method uses the threading module on Windows\n    # and won't work under Pythons not built with threading.\n    stdout = popen.stdout.read()\n    stderr = popen.stderr.read()\n\n    # Extra debug logic, uncomment if necessar\n#     debug('get_output():stdout:%s'%stdout)\n#     debug('get_output():stderr:%s'%stderr)\n\n    if stderr:\n        if \"wmic\" not in stderr:\n            # TODO: find something better to do with stderr;\n            # this at least prevents errors from getting swallowed.\n            import sys\n            sys.stderr.write(stderr)\n    if popen.wait() != 0:\n        raise IOError(stderr.decode(\"mbcs\"))\n\n    output = stdout.decode(\"mbcs\")\n    return output\n\ndef parse_output(output, keep = (\"INCLUDE\", \"LIB\", \"LIBPATH\", \"PATH\")):\n    # dkeep is a dict associating key: path_list, where key is one item from\n    # keep, and pat_list the associated list of paths\n\n    dkeep = dict([(i, []) for i in keep])\n\n    # rdk will  keep the regex to match the .bat file output line starts\n    rdk = {}\n    for i in keep:\n        rdk[i] = re.compile('%s=(.*)' % i, re.I)\n\n    def add_env(rmatch, key, dkeep=dkeep):\n        plist = rmatch.group(1).split(os.pathsep)\n        for p in plist:\n            # Do not add empty paths (when a var ends with ;)\n            if p:\n                p = p.encode('mbcs')\n                # XXX: For some reason, VC98 .bat file adds \"\" around the PATH\n                # values, and it screws up the environment later, so we strip\n                # it.\n                p = p.strip('\"')\n                dkeep[key].append(p)\n\n    for line in output.splitlines():\n        for k,v in rdk.items():\n            m = v.match(line)\n            if m:\n                add_env(m, k)\n\n    return dkeep\n\n# TODO(sgk): unused\ndef output_to_dict(output):\n    \"\"\"Given an output string, parse it to find env variables.\n\n    Return a dict where keys are variables names, and values their content\"\"\"\n    envlinem = re.compile(r'^([a-zA-z0-9]+)=([\\S\\s]*)$')\n    parsedenv = {}\n    for line in output.splitlines():\n        m = envlinem.match(line)\n        if m:\n            parsedenv[m.group(1)] = m.group(2)\n    return parsedenv\n\n# TODO(sgk): unused\ndef get_new(l1, l2):\n    \"\"\"Given two list l1 and l2, return the items in l2 which are not in l1.\n    Order is maintained.\"\"\"\n\n    # We don't try to be smart: lists are small, and this is not the bottleneck\n    # is any case\n    new = []\n    for i in l2:\n        if i not in l1:\n            new.append(i)\n\n    return new\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/netframework.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/netframework.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"\n\"\"\"\n\nimport os\nimport re\n\nfrom common import read_reg, debug\n\n# Original value recorded by dcournapeau\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\.NETFramework\\InstallRoot'\n# On SGK's system\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\Microsoft SDKs\\.NETFramework\\v2.0\\InstallationFolder'\n\ndef find_framework_root():\n    # XXX: find it from environment (FrameworkDir)\n    try:\n        froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT)\n        debug(\"Found framework install root in registry: %s\" % froot)\n    except WindowsError, e:\n        debug(\"Could not read reg key %s\" % _FRAMEWORKDIR_HKEY_ROOT)\n        return None\n\n    if not os.path.exists(froot):\n        debug(\"%s not found on fs\" % froot)\n        return None\n\n    return froot\n\ndef query_versions():\n    froot = find_framework_root()\n    if froot:\n        contents = os.listdir(froot)\n\n        l = re.compile('v[0-9]+.*')\n        versions = [e for e in contents if l.match(e)]\n\n        def versrt(a,b):\n            # since version numbers aren't really floats...\n            aa = a[1:]\n            bb = b[1:]\n            aal = aa.split('.')\n            bbl = bb.split('.')\n            # sequence comparison in python is lexicographical\n            # which is exactly what we want.\n            # Note we sort backwards so the highest version is first.\n            return cmp(bbl,aal)\n\n        versions.sort(versrt)\n    else:\n        versions = []\n\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/sdk.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/sdk.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"Module to detect the Platform/Windows SDK\n\nPSDK 2003 R1 is the earliest version detected.\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nimport common\n\ndebug = common.debug\n\n# SDK Checks. This is of course a mess as everything else on MS platforms. Here\n# is what we do to detect the SDK:\n#\n# For Windows SDK >= 6.0: just look into the registry entries:\n#   HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows\n# All the keys in there are the available versions.\n#\n# For Platform SDK before 6.0 (2003 server R1 and R2, etc...), there does not\n# seem to be any sane registry key, so the precise location is hardcoded.\n#\n# For versions below 2003R1, it seems the PSDK is included with Visual Studio?\n#\n# Also, per the following:\n#     http://benjamin.smedbergs.us/blog/tag/atl/\n# VC++ Professional comes with the SDK, VC++ Express does not.\n\n# Location of the SDK (checked for 6.1 only)\n_CURINSTALLED_SDK_HKEY_ROOT = \\\n        r\"Software\\Microsoft\\Microsoft SDKs\\Windows\\CurrentInstallFolder\"\n\n\nclass SDKDefinition(object):\n    \"\"\"\n    An abstract base class for trying to find installed SDK directories.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        self.__dict__.update(kw)\n\n    def find_sdk_dir(self):\n        \"\"\"Try to find the MS SDK from the registry.\n\n        Return None if failed or the directory does not exist.\n        \"\"\"\n        if not SCons.Util.can_read_reg:\n            debug('find_sdk_dir(): can not read registry')\n            return None\n\n        hkey = self.HKEY_FMT % self.hkey_data\n        debug('find_sdk_dir(): checking registry:%s'%hkey)\n\n        try:\n            sdk_dir = common.read_reg(hkey)\n        except WindowsError, e:\n            debug('find_sdk_dir(): no SDK registry key %s' % repr(hkey))\n            return None\n\n        debug('find_sdk_dir(): Trying SDK Dir: %s'%sdk_dir)\n\n        if not os.path.exists(sdk_dir):\n            debug('find_sdk_dir():  %s not on file system' % sdk_dir)\n            return None\n\n        ftc = os.path.join(sdk_dir, self.sanity_check_file)\n        if not os.path.exists(ftc):\n            debug(\"find_sdk_dir(): sanity check %s not found\" % ftc)\n            return None\n\n        return sdk_dir\n\n    def get_sdk_dir(self):\n        \"\"\"Return the MSSSDK given the version string.\"\"\"\n        try:\n            return self._sdk_dir\n        except AttributeError:\n            sdk_dir = self.find_sdk_dir()\n            self._sdk_dir = sdk_dir\n            return sdk_dir\n\n    def get_sdk_vc_script(self,host_arch, target_arch):\n        \"\"\" Return the script to initialize the VC compiler installed by SDK\n        \"\"\"\n\n        if (host_arch == 'amd64' and target_arch == 'x86'):\n            # No cross tools needed compiling 32 bits on 64 bit machine\n            host_arch=target_arch\n\n        arch_string=target_arch\n        if (host_arch != target_arch):\n            arch_string='%s_%s'%(host_arch,target_arch)\n\n        debug(\"sdk.py: get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s\"%(arch_string,\n                                                           host_arch,\n                                                           target_arch))\n        file=self.vc_setup_scripts.get(arch_string,None)\n        debug(\"sdk.py: get_sdk_vc_script():file:%s\"%file)\n        return file\n\nclass WindowsSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Windows SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\Microsoft SDKs\\Windows\\v%s\\InstallationFolder'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.version\n\nclass PlatformSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Platform SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\MicrosoftSDK\\InstalledSDKS\\%s\\Install Dir'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.uuid\n\n#\n# The list of VC initialization scripts installed by the SDK\n# These should be tried if the vcvarsall.bat TARGET_ARCH fails\npreSDK61VCSetupScripts = { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvarsamd64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\nSDK61VCSetupScripts = {'x86'      : r'bin\\vcvars32.bat',\n                       'amd64'    : r'bin\\amd64\\vcvarsamd64.bat',\n                       'x86_amd64': r'bin\\x86_amd64\\vcvarsx86_amd64.bat',\n                       'x86_ia64' : r'bin\\x86_ia64\\vcvarsx86_ia64.bat',\n                       'ia64'     : r'bin\\ia64\\vcvarsia64.bat'}\n\nSDK70VCSetupScripts =    { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvars64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\n# The list of support SDKs which we know how to detect.\n#\n# The first SDK found in the list is the one used by default if there\n# are multiple SDKs installed.  Barring good reasons to the contrary,\n# this means we should list SDKs with from most recent to oldest.\n#\n# If you update this list, update the documentation in Tool/mssdk.xml.\nSupportedSDKList = [\n    WindowsSDK('7.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0A',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('6.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0A',\n               sanity_check_file=r'include\\windows.h',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0',\n               sanity_check_file=r'bin\\gacutil.exe',\n               include_subdir='include',\n               lib_subdir='lib',\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    PlatformSDK('2003R2',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n\n    PlatformSDK('2003R1',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n]\n\nSupportedSDKMap = {}\nfor sdk in SupportedSDKList:\n    SupportedSDKMap[sdk.version] = sdk\n\n\n# Finding installed SDKs isn't cheap, because it goes not only to the\n# registry but also to the disk to sanity-check that there is, in fact,\n# an SDK installed there and that the registry entry isn't just stale.\n# Find this information once, when requested, and cache it.\n\nInstalledSDKList = None\nInstalledSDKMap = None\n\ndef get_installed_sdks():\n    global InstalledSDKList\n    global InstalledSDKMap\n    debug('sdk.py:get_installed_sdks()')\n    if InstalledSDKList is None:\n        InstalledSDKList = []\n        InstalledSDKMap = {}\n        for sdk in SupportedSDKList:\n            debug('MSCommon/sdk.py: trying to find SDK %s' % sdk.version)\n            if sdk.get_sdk_dir():\n                debug('MSCommon/sdk.py:found SDK %s' % sdk.version)\n                InstalledSDKList.append(sdk)\n                InstalledSDKMap[sdk.version] = sdk\n    return InstalledSDKList\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\nSDKEnvironmentUpdates = {}\n\ndef set_sdk_by_directory(env, sdk_dir):\n    global SDKEnvironmentUpdates\n    debug('set_sdk_by_directory: Using dir:%s'%sdk_dir)\n    try:\n        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n    except KeyError:\n        env_tuple_list = []\n        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n\n        include_path = os.path.join(sdk_dir, 'include')\n        mfc_path = os.path.join(include_path, 'mfc')\n        atl_path = os.path.join(include_path, 'atl')\n\n        if os.path.exists(mfc_path):\n            env_tuple_list.append(('INCLUDE', mfc_path))\n        if os.path.exists(atl_path):\n            env_tuple_list.append(('INCLUDE', atl_path))\n        env_tuple_list.append(('INCLUDE', include_path))\n\n        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n\n    for variable, directory in env_tuple_list:\n        env.PrependENVPath(variable, directory)\n\n\n# TODO(sgk):  currently unused; remove?\ndef get_cur_sdk_dir_from_reg():\n    \"\"\"Try to find the platform sdk directory from the registry.\n\n    Return None if failed or the directory does not exist\"\"\"\n    if not SCons.Util.can_read_reg:\n        debug('SCons cannot read registry')\n        return None\n\n    try:\n        val = common.read_reg(_CURINSTALLED_SDK_HKEY_ROOT)\n        debug(\"Found current sdk dir in registry: %s\" % val)\n    except WindowsError, e:\n        debug(\"Did not find current sdk in registry\")\n        return None\n\n    if not os.path.exists(val):\n        debug(\"Current sdk dir %s not on fs\" % val)\n        return None\n\n    return val\n\ndef get_sdk_by_version(mssdk):\n    if mssdk not in SupportedSDKMap:\n        msg = \"SDK version %s is not supported\" % repr(mssdk)\n        raise SCons.Errors.UserError(msg)\n    get_installed_sdks()\n    return InstalledSDKMap.get(mssdk)\n\ndef get_default_sdk():\n    \"\"\"Set up the default Platform/Windows SDK.\"\"\"\n    get_installed_sdks()\n    if not InstalledSDKList:\n        return None\n    return InstalledSDKList[0]\n\n\n\n\ndef mssdk_setup_env(env):\n    debug('sdk.py:mssdk_setup_env()')\n    if 'MSSDK_DIR' in env:\n        sdk_dir = env['MSSDK_DIR']\n        if sdk_dir is None:\n            return\n        sdk_dir = env.subst(sdk_dir)\n        debug('sdk.py:mssdk_setup_env: Using MSSDK_DIR:%s'%sdk_dir)\n    elif 'MSSDK_VERSION' in env:\n        sdk_version = env['MSSDK_VERSION']\n        if sdk_version is None:\n            msg = \"SDK version is specified as None\"\n            raise SCons.Errors.UserError(msg)\n        sdk_version = env.subst(sdk_version)\n        mssdk = get_sdk_by_version(sdk_version)\n        if mssdk is None:\n            msg = \"SDK version %s is not installed\" % sdk_version\n            raise SCons.Errors.UserError(msg)\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('sdk.py:mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir)\n    elif 'MSVS_VERSION' in env:\n        msvs_version = env['MSVS_VERSION']\n        debug('sdk.py:mssdk_setup_env:Getting MSVS_VERSION from env:%s'%msvs_version)\n        if msvs_version is None:\n            debug('sdk.py:mssdk_setup_env thinks msvs_version is None')\n            return\n        msvs_version = env.subst(msvs_version)\n        import vs\n        msvs = vs.get_vs_by_version(msvs_version)\n        debug('sdk.py:mssdk_setup_env:msvs is :%s'%msvs)\n        if not msvs:\n            debug('sdk.py:mssdk_setup_env: no VS version detected, bailingout:%s'%msvs)\n            return\n        sdk_version = msvs.sdk_version\n        debug('sdk.py:msvs.sdk_version is %s'%sdk_version)\n        if not sdk_version:\n            return\n        mssdk = get_sdk_by_version(sdk_version)\n        if not mssdk:\n            mssdk = get_default_sdk()\n            if not mssdk:\n                return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('sdk.py:mssdk_setup_env: Using MSVS_VERSION:%s'%sdk_dir)\n    else:\n        mssdk = get_default_sdk()\n        if not mssdk:\n            return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('sdk.py:mssdk_setup_env: not using any env values. sdk_dir:%s'%sdk_dir)\n\n    set_sdk_by_directory(env, sdk_dir)\n\n    #print \"No MSVS_VERSION: this is likely to be a bug\"\n\ndef mssdk_exists(version=None):\n    sdks = get_installed_sdks()\n    if version is None:\n        return len(sdks) > 0\n    return version in sdks\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/vc.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# TODO:\n#   * supported arch for versions: for old versions of batch file without\n#     argument, giving bogus argument cannot be detected, so we have to hardcode\n#     this here\n#   * print warning when msvc version specified but not found\n#   * find out why warning do not print\n#   * test on 64 bits XP +  VS 2005 (and VS 6 if possible)\n#   * SDK\n#   * Assembly\n__revision__ = \"src/engine/SCons/Tool/MSCommon/vc.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"Module for Visual C/C++ detection and configuration.\n\"\"\"\nimport SCons.compat\n\nimport os\nimport platform\nfrom string import digits as string_digits\n\nimport SCons.Warnings\n\nimport common\n\ndebug = common.debug\n\nimport sdk\n\nget_installed_sdks = sdk.get_installed_sdks\n\n\nclass VisualCException(Exception):\n    pass\n\nclass UnsupportedVersion(VisualCException):\n    pass\n\nclass UnsupportedArch(VisualCException):\n    pass\n\nclass MissingConfiguration(VisualCException):\n    pass\n\nclass NoVersionFound(VisualCException):\n    pass\n\nclass BatchFileExecutionError(VisualCException):\n    pass\n\n# Dict to 'canonalize' the arch\n_ARCH_TO_CANONICAL = {\n    \"amd64\"     : \"amd64\",\n    \"emt64\"     : \"amd64\",\n    \"i386\"      : \"x86\",\n    \"i486\"      : \"x86\",\n    \"i586\"      : \"x86\",\n    \"i686\"      : \"x86\",\n    \"ia64\"      : \"ia64\",\n    \"itanium\"   : \"ia64\",\n    \"x86\"       : \"x86\",\n    \"x86_64\"    : \"amd64\",\n    \"x86_amd64\" : \"x86_amd64\", # Cross compile to 64 bit from 32bits\n}\n\n# Given a (host, target) tuple, return the argument for the bat file. Both host\n# and targets should be canonalized.\n_HOST_TARGET_ARCH_TO_BAT_ARCH = {\n    (\"x86\", \"x86\"): \"x86\",\n    (\"x86\", \"amd64\"): \"x86_amd64\",\n    (\"x86\", \"x86_amd64\"): \"x86_amd64\",\n    (\"amd64\", \"x86_amd64\"): \"x86_amd64\", # This is present in (at least) VS2012 express\n    (\"amd64\", \"amd64\"): \"amd64\",\n    (\"amd64\", \"x86\"): \"x86\",\n    (\"x86\", \"ia64\"): \"x86_ia64\"\n}\n\ndef get_host_target(env):\n    debug('vc.py:get_host_target()')\n\n    host_platform = env.get('HOST_ARCH')\n    if not host_platform:\n        host_platform = platform.machine()\n        # TODO(2.5):  the native Python platform.machine() function returns\n        # '' on all Python versions before 2.6, after which it also uses\n        # PROCESSOR_ARCHITECTURE.\n        if not host_platform:\n            host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '')\n\n    # Retain user requested TARGET_ARCH\n    req_target_platform = env.get('TARGET_ARCH')\n    debug('vc.py:get_host_target() req_target_platform:%s'%req_target_platform)\n\n    if  req_target_platform:\n        # If user requested a specific platform then only try that one.\n        target_platform = req_target_platform\n    else:\n        target_platform = host_platform\n\n    try:\n        host = _ARCH_TO_CANONICAL[host_platform.lower()]\n    except KeyError, e:\n        msg = \"Unrecognized host architecture %s\"\n        raise ValueError(msg % repr(host_platform))\n\n    try:\n        target = _ARCH_TO_CANONICAL[target_platform.lower()]\n    except KeyError, e:\n        all_archs = str(_ARCH_TO_CANONICAL.keys())\n        raise ValueError(\"Unrecognized target architecture %s\\n\\tValid architectures: %s\" % (target_platform, all_archs))\n\n    return (host, target,req_target_platform)\n\n# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the\n# MSVC_VERSION documentation in Tool/msvc.xml.\n_VCVER = [\"15.0\", \"14.0\", \"14.0Exp\", \"12.0\", \"12.0Exp\", \"11.0\", \"11.0Exp\", \"10.0\", \"10.0Exp\", \"9.0\", \"9.0Exp\",\"8.0\", \"8.0Exp\",\"7.1\", \"7.0\", \"6.0\"]\n\n_VCVER_TO_PRODUCT_DIR = {\n        '15.0' : [\n            r'Microsoft\\VisualStudio\\SxS\\VS7\\15.0'],\n        '14.0' : [\n            r'Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir'],\n        '14.0' : [\n            r'Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir'],\n        '12.0' : [\n            r'Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir'],\n        '12.0Exp' : [\n            r'Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir'],\n        '11.0': [\n            r'Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir'],\n        '11.0Exp' : [\n            r'Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir'],\n        '10.0': [\n            r'Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir'],\n        '10.0Exp' : [\n            r'Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir'],\n        '9.0': [\n            r'Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir'],\n        '9.0Exp' : [\n            r'Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir'],\n        '8.0': [\n            r'Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir'],\n        '8.0Exp': [\n            r'Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir'],\n        '7.1': [\n            r'Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir'],\n        '7.0': [\n            r'Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir'],\n        '6.0': [\n            r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir']\n}\n\ndef msvc_version_to_maj_min(msvc_version):\n   msvc_version_numeric = ''.join([x for  x in msvc_version if x in string_digits + '.'])\n\n   t = msvc_version_numeric.split(\".\")\n   if not len(t) == 2:\n       raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n   try:\n       maj = int(t[0])\n       min = int(t[1])\n       return maj, min\n   except ValueError, e:\n       raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n\ndef is_host_target_supported(host_target, msvc_version):\n    \"\"\"Return True if the given (host, target) tuple is supported given the\n    msvc version.\n\n    Parameters\n    ----------\n    host_target: tuple\n        tuple of (canonalized) host-target, e.g. (\"x86\", \"amd64\") for cross\n        compilation from 32 bits windows to 64 bits.\n    msvc_version: str\n        msvc version (major.minor, e.g. 10.0)\n\n    Note\n    ----\n    This only check whether a given version *may* support the given (host,\n    target), not that the toolchain is actually present on the machine.\n    \"\"\"\n    # We assume that any Visual Studio version supports x86 as a target\n    if host_target[1] != \"x86\":\n        maj, min = msvc_version_to_maj_min(msvc_version)\n        if maj < 8:\n            return False\n\n    return True\n\ndef find_vc_pdir(msvc_version):\n    \"\"\"Try to find the product directory for the given\n    version.\n\n    Note\n    ----\n    If for some reason the requested version could not be found, an\n    exception which inherits from VisualCException will be raised.\"\"\"\n    root = 'Software\\\\'\n    if common.is_win64():\n        root = root + 'Wow6432Node\\\\'\n    try:\n        hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version]\n    except KeyError:\n        debug(\"Unknown version of MSVC: %s\" % msvc_version)\n        raise UnsupportedVersion(\"Unknown version %s\" % msvc_version)\n\n    for key in hkeys:\n        key = root + key\n        try:\n            comps = common.read_reg(key)\n        except WindowsError, e:\n            debug('find_vc_dir(): no VC registry key %s' % repr(key))\n        else:\n            debug('find_vc_dir(): found VC in registry: %s' % comps)\n\n            if msvc_version == \"15.0\":\n                comps = os.path.join(comps, \"VC\")\n\n            if os.path.exists(comps):\n                return comps\n            else:\n                debug('find_vc_dir(): reg says dir is %s, but it does not exist. (ignoring)'\\\n                          % comps)\n                raise MissingConfiguration(\"registry dir %s not found on the filesystem\" % comps)\n    return None\n\ndef find_batch_file(env,msvc_version,host_arch,target_arch):\n    \"\"\"\n    Find the location of the batch script which should set up the compiler\n    for any TARGET_ARCH whose compilers were installed by Visual Studio/VCExpress\n    \"\"\"\n    pdir = find_vc_pdir(msvc_version)\n    if pdir is None:\n        raise NoVersionFound(\"No version of Visual Studio found\")\n\n    debug('vc.py: find_batch_file() pdir:%s'%pdir)\n\n    # filter out e.g. \"Exp\" from the version name\n    msvc_ver_numeric = ''.join([x for x in msvc_version if x in string_digits + \".\"])\n    vernum = float(msvc_ver_numeric)\n    if 7 <= vernum < 8:\n        pdir = os.path.join(pdir, os.pardir, \"Common7\", \"Tools\")\n        batfilename = os.path.join(pdir, \"vsvars32.bat\")\n    elif vernum < 7:\n        pdir = os.path.join(pdir, \"Bin\")\n        batfilename = os.path.join(pdir, \"vcvars32.bat\")\n    elif vernum >= 15:\n        pdir = os.path.join(pdir, \"Auxiliary\", \"Build\")\n        batfilename = os.path.join(pdir, \"vcvarsall.bat\")\n    else: # >= 8\n        batfilename = os.path.join(pdir, \"vcvarsall.bat\")\n\n    if not os.path.exists(batfilename):\n        debug(\"Not found: %s\" % batfilename)\n        batfilename = None\n\n    installed_sdks=get_installed_sdks()\n    for _sdk in installed_sdks:\n        sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)\n        if not sdk_bat_file:\n            debug(\"vc.py:find_batch_file() not found:%s\"%_sdk)\n        else:\n            sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)\n            if os.path.exists(sdk_bat_file_path):\n                debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)\n                return (batfilename,sdk_bat_file_path)\n    return (batfilename,None)\n\n\n__INSTALLED_VCS_RUN = None\n\ndef cached_get_installed_vcs():\n    global __INSTALLED_VCS_RUN\n\n    if __INSTALLED_VCS_RUN is None:\n        ret = get_installed_vcs()\n        __INSTALLED_VCS_RUN = ret\n\n    return __INSTALLED_VCS_RUN\n\ndef get_installed_vcs():\n    installed_versions = []\n    for ver in _VCVER:\n        debug('trying to find VC %s' % ver)\n        try:\n            if find_vc_pdir(ver):\n                debug('found VC %s' % ver)\n                installed_versions.append(ver)\n            else:\n                debug('find_vc_pdir return None for ver %s' % ver)\n        except VisualCException, e:\n            debug('did not find VC %s: caught exception %s' % (ver, str(e)))\n    return installed_versions\n\ndef reset_installed_vcs():\n    \"\"\"Make it try again to find VC.  This is just for the tests.\"\"\"\n    __INSTALLED_VCS_RUN = None\n\n# Running these batch files isn't cheap: most of the time spent in\n# msvs.generate() is due to vcvars*.bat.  In a build that uses \"tools='msvs'\"\n# in multiple environments, for example:\n#    env1 = Environment(tools='msvs')\n#    env2 = Environment(tools='msvs')\n# we can greatly improve the speed of the second and subsequent Environment\n# (or Clone) calls by memoizing the environment variables set by vcvars*.bat.\nscript_env_stdout_cache = {}\ndef script_env(script, args=None):\n    cache_key = (script, args)\n    stdout = script_env_stdout_cache.get(cache_key, None)\n    if stdout is None:\n        stdout = common.get_output(script, args)\n        script_env_stdout_cache[cache_key] = stdout\n\n    # Stupid batch files do not set return code: we take a look at the\n    # beginning of the output for an error message instead\n    olines = stdout.splitlines()\n    if olines[0].startswith(\"The specified configuration type is missing\"):\n        raise BatchFileExecutionError(\"\\n\".join(olines[:2]))\n\n    return common.parse_output(stdout)\n\ndef get_default_version(env):\n    debug('get_default_version()')\n\n    msvc_version = env.get('MSVC_VERSION')\n    msvs_version = env.get('MSVS_VERSION')\n\n    debug('get_default_version(): msvc_version:%s msvs_version:%s'%(msvc_version,msvs_version))\n\n    if msvs_version and not msvc_version:\n        SCons.Warnings.warn(\n                SCons.Warnings.DeprecatedWarning,\n                \"MSVS_VERSION is deprecated: please use MSVC_VERSION instead \")\n        return msvs_version\n    elif msvc_version and msvs_version:\n        if not msvc_version == msvs_version:\n            SCons.Warnings.warn(\n                    SCons.Warnings.VisualVersionMismatch,\n                    \"Requested msvc version (%s) and msvs version (%s) do \" \\\n                    \"not match: please use MSVC_VERSION only to request a \" \\\n                    \"visual studio version, MSVS_VERSION is deprecated\" \\\n                    % (msvc_version, msvs_version))\n        return msvs_version\n    if not msvc_version:\n        installed_vcs = cached_get_installed_vcs()\n        debug('installed_vcs:%s' % installed_vcs)\n        if not installed_vcs:\n            #msg = 'No installed VCs'\n            #debug('msv %s\\n' % repr(msg))\n            #SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg)\n            debug('msvc_setup_env: No installed VCs')\n            return None\n        msvc_version = installed_vcs[0]\n        debug('msvc_setup_env: using default installed MSVC version %s\\n' % repr(msvc_version))\n\n    return msvc_version\n\ndef msvc_setup_env_once(env):\n    try:\n        has_run  = env[\"MSVC_SETUP_RUN\"]\n    except KeyError:\n        has_run = False\n\n    if not has_run:\n        msvc_setup_env(env)\n        env[\"MSVC_SETUP_RUN\"] = True\n\ndef msvc_find_valid_batch_script(env,version):\n    debug('vc.py:msvc_find_valid_batch_script()')\n    # Find the host platform, target platform, and if present the requested\n    # target platform\n    (host_platform, target_platform,req_target_platform) = get_host_target(env)\n\n    try_target_archs = [target_platform]\n    debug(\"msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s\"%(req_target_platform,target_platform))\n\n    # VS2012 has a \"cross compile\" environment to build 64 bit\n    # with x86_amd64 as the argument to the batch setup script\n    if req_target_platform in ('amd64','x86_64'):\n        try_target_archs.append('x86_amd64')\n    elif not req_target_platform and target_platform in ['amd64','x86_64']:\n        # There may not be \"native\" amd64, but maybe \"cross\" x86_amd64 tools\n        try_target_archs.append('x86_amd64')\n        # If the user hasn't specifically requested a TARGET_ARCH, and\n        # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable\n        # 64 bit tools installed\n        try_target_archs.append('x86')\n\n    debug(\"msvs_find_valid_batch_script(): host_platform: %s try_target_archs:%s\"%(host_platform, try_target_archs))\n\n    d = None\n    for tp in try_target_archs:\n        # Set to current arch.\n        env['TARGET_ARCH']=tp\n\n        debug(\"vc.py:msvc_find_valid_batch_script() trying target_platform:%s\"%tp)\n        host_target = (host_platform, tp)\n        if not is_host_target_supported(host_target, version):\n            warn_msg = \"host, target = %s not supported for MSVC version %s\" % \\\n                (host_target, version)\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target]\n\n        # Try to locate a batch file for this host/target platform combo\n        try:\n            (vc_script,sdk_script) = find_batch_file(env,version,host_platform,tp)\n            debug('vc.py:msvc_find_valid_batch_script() vc_script:%s sdk_script:%s'%(vc_script,sdk_script))\n        except VisualCException, e:\n            msg = str(e)\n            debug('Caught exception while looking for batch file (%s)' % msg)\n            warn_msg = \"VC version %s not installed.  \" + \\\n                       \"C/C++ compilers are most likely not set correctly.\\n\" + \\\n                       \" Installed versions are: %s\"\n            warn_msg = warn_msg % (version, cached_get_installed_vcs())\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n            continue\n\n        # Try to use the located batch file for this host/target platform combo\n        debug('vc.py:msvc_find_valid_batch_script() use_script 2 %s, args:%s\\n' % (repr(vc_script), arg))\n        if vc_script:\n            try:\n                d = script_env(vc_script, args=arg)\n            except BatchFileExecutionError, e:\n                debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e))\n                vc_script=None\n                continue\n        if not vc_script and sdk_script:\n            debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script))\n            try:\n                d = script_env(sdk_script)\n            except BatchFileExecutionError,e:\n                debug('vc.py:msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e))\n                continue\n        elif not vc_script and not sdk_script:\n            debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found')\n            continue\n\n        debug(\"vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s\"%(repr(sdk_script),arg))\n        break # We've found a working target_platform, so stop looking\n\n    # If we cannot find a viable installed compiler, reset the TARGET_ARCH\n    # To it's initial value\n    if not d:\n        env['TARGET_ARCH']=req_target_platform\n\n    return d\n\n\ndef msvc_setup_env(env):\n    debug('msvc_setup_env()')\n\n    version = get_default_version(env)\n    if version is None:\n        warn_msg = \"No version of Visual Studio compiler found - C/C++ \" \\\n                   \"compilers most likely not set correctly\"\n        # Nuitka: Useless warning for us.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n    debug('msvc_setup_env: using specified MSVC version %s\\n' % repr(version))\n\n    # XXX: we set-up both MSVS version for backward\n    # compatibility with the msvs tool\n    env['MSVC_VERSION'] = version\n    env['MSVS_VERSION'] = version\n    env['MSVS'] = {}\n\n\n    use_script = env.get('MSVC_USE_SCRIPT', True)\n    if SCons.Util.is_String(use_script):\n        debug('vc.py:msvc_setup_env() use_script 1 %s\\n' % repr(use_script))\n        d = script_env(use_script)\n    elif use_script:\n        d = msvc_find_valid_batch_script(env,version)\n        debug('vc.py:msvc_setup_env() use_script 2 %s\\n' % d)\n        if not d:\n            return d\n    else:\n        debug('MSVC_USE_SCRIPT set to False')\n        warn_msg = \"MSVC_USE_SCRIPT set to False, assuming environment \" \\\n                   \"set correctly.\"\n        # Nuitka: We use this on purpose.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n\n    for k, v in d.items():\n        debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v))\n        env.PrependENVPath(k, v, delete_existing=True)\n\ndef msvc_exists(version=None):\n    vcs = cached_get_installed_vcs()\n    if version is None:\n        return len(vcs) > 0\n    return version in vcs\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/MSCommon/vs.py",
    "content": "#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/vs.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\n__doc__ = \"\"\"Module to detect Visual Studio and/or Visual C/C++\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nfrom common import debug, \\\n                   get_output, \\\n                   is_win64, \\\n                   normalize_env, \\\n                   parse_output, \\\n                   read_reg\n\nimport SCons.Tool.MSCommon.vc\n\nclass VisualStudio(object):\n    \"\"\"\n    An abstract base class for trying to find installed versions of\n    Visual Studio.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        kw['vc_version']  = kw.get('vc_version', version)\n        kw['sdk_version'] = kw.get('sdk_version', version)\n        self.__dict__.update(kw)\n        self._cache = {}\n\n    #\n\n    def find_batch_file(self):\n        vs_dir = self.get_vs_dir()\n        if not vs_dir:\n            debug('find_executable():  no vs_dir')\n            return None\n        batch_file = os.path.join(vs_dir, self.batch_file_path)\n        batch_file = os.path.normpath(batch_file)\n        if not os.path.isfile(batch_file):\n            debug('find_batch_file():  %s not on file system' % batch_file)\n            return None\n        return batch_file\n\n    def find_vs_dir_by_vc(self):\n        SCons.Tool.MSCommon.vc.get_installed_vcs()\n        dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version)\n        if not dir:\n            debug('find_vs_dir():  no installed VC %s' % self.vc_version)\n            return None\n        return dir\n\n    def find_vs_dir_by_reg(self):\n        root = 'Software\\\\'\n\n        if is_win64():\n            root = root + 'Wow6432Node\\\\'\n        for key in self.hkeys:\n            if key=='use_dir':\n                return self.find_vs_dir_by_vc()\n            key = root + key\n            try:\n                comps = read_reg(key)\n            except WindowsError, e:\n                debug('find_vs_dir_by_reg(): no VS registry key %s' % repr(key))\n            else:\n                debug('find_vs_dir_by_reg(): found VS in registry: %s' % comps)\n                return comps\n        return None\n\n    def find_vs_dir(self):\n        \"\"\" Can use registry or location of VC to find vs dir\n        First try to find by registry, and if that fails find via VC dir\n        \"\"\"\n\n\n        if True:\n            vs_dir=self.find_vs_dir_by_reg()\n            return vs_dir\n        else:\n            return self.find_vs_dir_by_vc()\n\n    def find_executable(self):\n        vs_dir = self.get_vs_dir()\n        if not vs_dir:\n            debug('find_executable():  no vs_dir (%s)'%vs_dir)\n            return None\n        executable = os.path.join(vs_dir, self.executable_path)\n        executable = os.path.normpath(executable)\n        if not os.path.isfile(executable):\n            debug('find_executable():  %s not on file system' % executable)\n            return None\n        return executable\n\n    #\n\n    def get_batch_file(self):\n        try:\n            return self._cache['batch_file']\n        except KeyError:\n            batch_file = self.find_batch_file()\n            self._cache['batch_file'] = batch_file\n            return batch_file\n\n    def get_executable(self):\n        try:\n            debug('get_executable using cache:%s'%self._cache['executable'])\n            return self._cache['executable']\n        except KeyError:\n            executable = self.find_executable()\n            self._cache['executable'] = executable\n            debug('get_executable not in cache:%s'%executable)\n            return executable\n\n    def get_vs_dir(self):\n        try:\n            return self._cache['vs_dir']\n        except KeyError:\n            vs_dir = self.find_vs_dir()\n            self._cache['vs_dir'] = vs_dir\n            return vs_dir\n\n    def get_supported_arch(self):\n        try:\n            return self._cache['supported_arch']\n        except KeyError:\n            # RDEVE: for the time being use hardcoded lists\n            # supported_arch = self.find_supported_arch()\n            self._cache['supported_arch'] = self.supported_arch\n            return self.supported_arch\n\n    def reset(self):\n        self._cache = {}\n\n# The list of supported Visual Studio versions we know how to detect.\n#\n# How to look for .bat file ?\n#  - VS 2008 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS90COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2008 Express (WoW6432: 32 bits on windows x64):\n#         Software\\Wow6432Node\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#\n#  - VS 2005 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\8.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS80COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2005 Express (WoW6432: 32 bits on windows x64): does not seem to have a\n#  productdir ?\n#\n#  - VS 2003 .Net (pro edition ? x86):\n#     * from registry key productdir. The path is then ..\\Common7\\Tools\\\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\productdir\n#     * from environmnent variable VS71COMNTOOLS: the path is the full path to\n#     vsvars32.bat\n#\n#  - VS 98 (VS 6):\n#     * from registry key productdir. The path is then Bin\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\6.0\\Setup\\VC98\\productdir\n#\n# The first version found in the list is the one used by default if\n# there are multiple versions installed.  Barring good reasons to\n# the contrary, this means we should list versions from most recent\n# to oldest.  Pro versions get listed before Express versions on the\n# assumption that, by default, you'd rather use the version you paid\n# good money for in preference to whatever Microsoft makes available\n# for free.\n#\n# If you update this list, update _VCVER and _VCVER_TO_PRODUCT_DIR in\n# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.\n\nSupportedVSList = [\n    # Visual Studio 2015\n    VisualStudio('14.0',\n                 vc_version='14.0',\n                 sdk_version='10.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual C++ 2015 Express Edition (for Desktop)\n    VisualStudio('14.0Exp',\n                 vc_version='14.0',\n                 sdk_version='10.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual Studio 2013\n    VisualStudio('12.0',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2013 Express Edition (for Desktop)\n    VisualStudio('12.0Exp',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2012\n    VisualStudio('11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2012 Express Edition (for Desktop)\n    VisualStudio('11.0Exp',\n                 vc_version='11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2010\n    VisualStudio('10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2010 Express Edition\n    VisualStudio('10.0Exp',\n                 vc_version='10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2008\n    VisualStudio('9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2008 Express Edition\n    VisualStudio('9.0Exp',\n                 vc_version='9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2005\n    VisualStudio('8.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2005 Express Edition\n    VisualStudio('8.0Exp',\n                 vc_version='8.0Exp',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET 2003\n    VisualStudio('7.1',\n                 sdk_version='6.0',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.1\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS71COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET 2003',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET\n    VisualStudio('7.0',\n                 sdk_version='2003R2',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS70COMNTOOLS',\n                 executable_path=r'IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 6.0\n    VisualStudio('6.0',\n                 sdk_version='2003R1',\n                 hkeys=[r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual Studio\\ProductDir',\n                        'use_dir'],\n                 common_tools_var='VS60COMNTOOLS',\n                 executable_path=r'Common\\MSDev98\\Bin\\MSDEV.COM',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio',\n                 supported_arch=['x86'],\n    ),\n]\n\nSupportedVSMap = {}\nfor vs in SupportedVSList:\n    SupportedVSMap[vs.version] = vs\n\n\n# Finding installed versions of Visual Studio isn't cheap, because it\n# goes not only to the registry but also to the disk to sanity-check\n# that there is, in fact, a Visual Studio directory there and that the\n# registry entry isn't just stale.  Find this information once, when\n# requested, and cache it.\n\nInstalledVSList = None\nInstalledVSMap  = None\n\ndef get_installed_visual_studios():\n    global InstalledVSList\n    global InstalledVSMap\n    if InstalledVSList is None:\n        InstalledVSList = []\n        InstalledVSMap = {}\n        for vs in SupportedVSList:\n            debug('trying to find VS %s' % vs.version)\n            if vs.get_executable():\n                debug('found VS %s' % vs.version)\n                InstalledVSList.append(vs)\n                InstalledVSMap[vs.version] = vs\n    return InstalledVSList\n\ndef reset_installed_visual_studios():\n    global InstalledVSList\n    global InstalledVSMap\n    InstalledVSList = None\n    InstalledVSMap  = None\n    for vs in SupportedVSList:\n        vs.reset()\n\n    # Need to clear installed VC's as well as they are used in finding\n    # installed VS's\n    SCons.Tool.MSCommon.vc.reset_installed_vcs()\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\n#SDKEnvironmentUpdates = {}\n#\n#def set_sdk_by_directory(env, sdk_dir):\n#    global SDKEnvironmentUpdates\n#    try:\n#        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n#    except KeyError:\n#        env_tuple_list = []\n#        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n#\n#        include_path = os.path.join(sdk_dir, 'include')\n#        mfc_path = os.path.join(include_path, 'mfc')\n#        atl_path = os.path.join(include_path, 'atl')\n#\n#        if os.path.exists(mfc_path):\n#            env_tuple_list.append(('INCLUDE', mfc_path))\n#        if os.path.exists(atl_path):\n#            env_tuple_list.append(('INCLUDE', atl_path))\n#        env_tuple_list.append(('INCLUDE', include_path))\n#\n#        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n#\n#    for variable, directory in env_tuple_list:\n#        env.PrependENVPath(variable, directory)\n\ndef msvs_exists():\n    return (len(get_installed_visual_studios()) > 0)\n\ndef get_vs_by_version(msvs):\n    global InstalledVSMap\n    global SupportedVSMap\n\n    debug('vs.py:get_vs_by_version()')\n    if msvs not in SupportedVSMap:\n        msg = \"Visual Studio version %s is not supported\" % repr(msvs)\n        raise SCons.Errors.UserError(msg)\n    get_installed_visual_studios()\n    vs = InstalledVSMap.get(msvs)\n    debug('InstalledVSMap:%s'%InstalledVSMap)\n    debug('vs.py:get_vs_by_version: found vs:%s'%vs)\n    # Some check like this would let us provide a useful error message\n    # if they try to set a Visual Studio version that's not installed.\n    # However, we also want to be able to run tests (like the unit\n    # tests) on systems that don't, or won't ever, have it installed.\n    # It might be worth resurrecting this, with some configurable\n    # setting that the tests can use to bypass the check.\n    #if not vs:\n    #    msg = \"Visual Studio version %s is not installed\" % repr(msvs)\n    #    raise SCons.Errors.UserError, msg\n    return vs\n\ndef get_default_version(env):\n    \"\"\"Returns the default version string to use for MSVS.\n\n    If no version was requested by the user through the MSVS environment\n    variable, query all the available the visual studios through\n    get_installed_visual_studios, and take the highest one.\n\n    Return\n    ------\n    version: str\n        the default version.\n    \"\"\"\n    if 'MSVS' not in env or not SCons.Util.is_Dict(env['MSVS']):\n        # get all versions, and remember them for speed later\n        versions = [vs.version for vs in get_installed_visual_studios()]\n        env['MSVS'] = {'VERSIONS' : versions}\n    else:\n        versions = env['MSVS'].get('VERSIONS', [])\n\n    if 'MSVS_VERSION' not in env:\n        if versions:\n            env['MSVS_VERSION'] = versions[0] #use highest version by default\n        else:\n            debug('get_default_version: WARNING: no installed versions found, '\n                  'using first in SupportedVSList (%s)'%SupportedVSList[0].version)\n            env['MSVS_VERSION'] = SupportedVSList[0].version\n\n    env['MSVS']['VERSION'] = env['MSVS_VERSION']\n\n    return env['MSVS_VERSION']\n\ndef get_default_arch(env):\n    \"\"\"Return the default arch to use for MSVS\n\n    if no version was requested by the user through the MSVS_ARCH environment\n    variable, select x86\n\n    Return\n    ------\n    arch: str\n    \"\"\"\n    arch = env.get('MSVS_ARCH', 'x86')\n\n    msvs = InstalledVSMap.get(env['MSVS_VERSION'])\n\n    if not msvs:\n        arch = 'x86'\n    elif not arch in msvs.get_supported_arch():\n        fmt = \"Visual Studio version %s does not support architecture %s\"\n        raise SCons.Errors.UserError(fmt % (env['MSVS_VERSION'], arch))\n\n    return arch\n\ndef merge_default_version(env):\n    version = get_default_version(env)\n    arch = get_default_arch(env)\n\ndef msvs_setup_env(env):\n    batfilename = msvs.get_batch_file()\n    msvs = get_vs_by_version(version)\n    if msvs is None:\n        return\n\n    # XXX: I think this is broken. This will silently set a bogus tool instead\n    # of failing, but there is no other way with the current scons tool\n    # framework\n    if batfilename is not None:\n\n        vars = ('LIB', 'LIBPATH', 'PATH', 'INCLUDE')\n\n        msvs_list = get_installed_visual_studios()\n        vscommonvarnames = [vs.common_tools_var for vs in msvs_list]\n        save_ENV = env['ENV']\n        nenv = normalize_env(env['ENV'],\n                             ['COMSPEC'] + vscommonvarnames,\n                             force=True)\n        try:\n            output = get_output(batfilename, arch, env=nenv)\n        finally:\n            env['ENV'] = save_ENV\n        vars = parse_output(output, vars)\n\n        for k, v in vars.items():\n            env.PrependENVPath(k, v, delete_existing=1)\n\ndef query_versions():\n    \"\"\"Query the system to get available versions of VS. A version is\n    considered when a batfile is found.\"\"\"\n    msvs_list = get_installed_visual_studios()\n    versions = [msvs.version for msvs in msvs_list]\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/Perforce.py",
    "content": "\"\"\"SCons.Tool.Perforce.py\n\nTool-specific initialization for Perforce Source Code Management system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/Perforce.py  2014/07/05 09:42:21 garyo\"\n\nimport os\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Util\n\n# This function should maybe be moved to SCons.Util?\nfrom SCons.Tool.PharLapCommon import addPathIfNotExists\n\n\n# Variables that we want to import from the base OS environment.\n_import_env = [ 'P4PORT', 'P4CLIENT', 'P4USER', 'USER', 'USERNAME', 'P4PASSWD',\n                'P4CHARSET', 'P4LANGUAGE', 'SystemRoot' ]\n\nPerforceAction = SCons.Action.Action('$P4COM', '$P4COMSTR')\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    Perforce to an Environment.\"\"\"\n\n    def PerforceFactory(env=env):\n        \"\"\" \"\"\"\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The Perforce() factory is deprecated and there is no replacement.\"\"\")\n        return SCons.Builder.Builder(action = PerforceAction, env = env)\n\n    #setattr(env, 'Perforce', PerforceFactory)\n    env.Perforce = PerforceFactory\n\n    env['P4']      = 'p4'\n    env['P4FLAGS'] = SCons.Util.CLVar('')\n    env['P4COM']   = '$P4 $P4FLAGS sync $TARGET'\n    try:\n        environ = env['ENV']\n    except KeyError:\n        environ = {}\n        env['ENV'] = environ\n\n    # Perforce seems to use the PWD environment variable rather than\n    # calling getcwd() for itself, which is odd.  If no PWD variable\n    # is present, p4 WILL call getcwd, but this seems to cause problems\n    # with good ol' Windows's tilde-mangling for long file names.\n    environ['PWD'] = env.Dir('#').get_abspath()\n\n    for var in _import_env:\n        v = os.environ.get(var)\n        if v:\n            environ[var] = v\n\n    if SCons.Util.can_read_reg:\n        # If we can read the registry, add the path to Perforce to our environment.\n        try:\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Perforce\\\\environment')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'P4INSTROOT')\n            addPathIfNotExists(environ, 'PATH', val)\n        except SCons.Util.RegError:\n            # Can't detect where Perforce is, hope the user has it set in the\n            # PATH.\n            pass\n\ndef exists(env):\n    return env.Detect('p4')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/PharLapCommon.py",
    "content": "\"\"\"SCons.Tool.PharLapCommon\n\nThis module contains common code used by all Tools for the\nPhar Lap ETS tool chain.  Right now, this is linkloc and\n386asm.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/PharLapCommon.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\nimport SCons.Errors\nimport SCons.Util\nimport re\n\ndef getPharLapPath():\n    \"\"\"Reads the registry to find the installed path of the Phar Lap ETS\n    development kit.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    if not SCons.Util.can_read_reg:\n        raise SCons.Errors.InternalError(\"No Windows registry module was found\")\n    try:\n        k=SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                  'SOFTWARE\\\\Pharlap\\\\ETS')\n        val, type = SCons.Util.RegQueryValueEx(k, 'BaseDir')\n\n        # The following is a hack...there is (not surprisingly)\n        # an odd issue in the Phar Lap plug in that inserts\n        # a bunch of junk data after the phar lap path in the\n        # registry.  We must trim it.\n        idx=val.find('\\0')\n        if idx >= 0:\n            val = val[:idx]\n\n        return os.path.normpath(val)\n    except SCons.Util.RegError:\n        raise SCons.Errors.UserError(\"Cannot find Phar Lap ETS path in the registry.  Is it installed properly?\")\n\nREGEX_ETS_VER = re.compile(r'#define\\s+ETS_VER\\s+([0-9]+)')\n\ndef getPharLapVersion():\n    \"\"\"Returns the version of the installed ETS Tool Suite as a\n    decimal number.  This version comes from the ETS_VER #define in\n    the embkern.h header.  For example, '#define ETS_VER 1010' (which\n    is what Phar Lap 10.1 defines) would cause this method to return\n    1010. Phar Lap 9.1 does not have such a #define, but this method\n    will return 910 as a default.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    include_path = os.path.join(getPharLapPath(), os.path.normpath(\"include/embkern.h\"))\n    if not os.path.exists(include_path):\n        raise SCons.Errors.UserError(\"Cannot find embkern.h in ETS include directory.\\nIs Phar Lap ETS installed properly?\")\n    mo = REGEX_ETS_VER.search(open(include_path, 'r').read())\n    if mo:\n        return int(mo.group(1))\n    # Default return for Phar Lap 9.1\n    return 910\n\ndef addPathIfNotExists(env_dict, key, path, sep=os.pathsep):\n    \"\"\"This function will take 'key' out of the dictionary\n    'env_dict', then add the path 'path' to that key if it is not\n    already there.  This treats the value of env_dict[key] as if it\n    has a similar format to the PATH variable...a list of paths\n    separated by tokens.  The 'path' will get added to the list if it\n    is not already there.\"\"\"\n    try:\n        is_list = 1\n        paths = env_dict[key]\n        if not SCons.Util.is_List(env_dict[key]):\n            paths = paths.split(sep)\n            is_list = 0\n        if os.path.normcase(path) not in list(map(os.path.normcase, paths)):\n            paths = [ path ] + paths\n        if is_list:\n            env_dict[key] = paths\n        else:\n            env_dict[key] = sep.join(paths)\n    except KeyError:\n        env_dict[key] = path\n\ndef addPharLapPaths(env):\n    \"\"\"This function adds the path to the Phar Lap binaries, includes,\n    and libraries, if they are not already there.\"\"\"\n    ph_path = getPharLapPath()\n\n    try:\n        env_dict = env['ENV']\n    except KeyError:\n        env_dict = {}\n        env['ENV'] = env_dict\n    addPathIfNotExists(env_dict, 'PATH',\n                       os.path.join(ph_path, 'bin'))\n    addPathIfNotExists(env_dict, 'INCLUDE',\n                       os.path.join(ph_path, 'include'))\n    addPathIfNotExists(env_dict, 'LIB',\n                       os.path.join(ph_path, 'lib'))\n    addPathIfNotExists(env_dict, 'LIB',\n                       os.path.join(ph_path, os.path.normpath('lib/vclib')))\n\n    env['PHARLAP_PATH'] = getPharLapPath()\n    env['PHARLAP_VERSION'] = str(getPharLapVersion())\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/RCS.py",
    "content": "\"\"\"SCons.Tool.RCS.py\n\nTool-specific initialization for RCS.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/RCS.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    RCS to an Environment.\"\"\"\n\n    def RCSFactory(env=env):\n        \"\"\" \"\"\"\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The RCS() factory is deprecated and there is no replacement.\"\"\")\n        act = SCons.Action.Action('$RCS_COCOM', '$RCS_COCOMSTR')\n        return SCons.Builder.Builder(action = act, env = env)\n\n    #setattr(env, 'RCS', RCSFactory)\n    env.RCS = RCSFactory\n\n    env['RCS']          = 'rcs'\n    env['RCS_CO']       = 'co'\n    env['RCS_COFLAGS']  = SCons.Util.CLVar('')\n    env['RCS_COCOM']    = '$RCS_CO $RCS_COFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('rcs')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/SCCS.py",
    "content": "\"\"\"SCons.Tool.SCCS.py\n\nTool-specific initialization for SCCS.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/SCCS.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    SCCS to an Environment.\"\"\"\n\n    def SCCSFactory(env=env):\n        \"\"\" \"\"\"\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The SCCS() factory is deprecated and there is no replacement.\"\"\")\n        act = SCons.Action.Action('$SCCSCOM', '$SCCSCOMSTR')\n        return SCons.Builder.Builder(action = act, env = env)\n\n    #setattr(env, 'SCCS', SCCSFactory)\n    env.SCCS = SCCSFactory\n\n    env['SCCS']         = 'sccs'\n    env['SCCSFLAGS']    = SCons.Util.CLVar('')\n    env['SCCSGETFLAGS'] = SCons.Util.CLVar('')\n    env['SCCSCOM']      = '$SCCS $SCCSFLAGS get $SCCSGETFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('sccs')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/Subversion.py",
    "content": "\"\"\"SCons.Tool.Subversion.py\n\nTool-specific initialization for Subversion.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/Subversion.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add a Builder factory function and construction variables for\n    Subversion to an Environment.\"\"\"\n\n    def SubversionFactory(repos, module='', env=env):\n        \"\"\" \"\"\"\n        # fail if repos is not an absolute path name?\n        import SCons.Warnings as W\n        W.warn(W.DeprecatedSourceCodeWarning, \"\"\"The Subversion() factory is deprecated and there is no replacement.\"\"\")\n        if module != '':\n            module = os.path.join(module, '')\n        act = SCons.Action.Action('$SVNCOM', '$SVNCOMSTR')\n        return SCons.Builder.Builder(action = act,\n                                     env = env,\n                                     SVNREPOSITORY = repos,\n                                     SVNMODULE = module)\n\n    #setattr(env, 'Subversion', SubversionFactory)\n    env.Subversion = SubversionFactory\n\n    env['SVN']      = 'svn'\n    env['SVNFLAGS'] = SCons.Util.CLVar('')\n    env['SVNCOM']   = '$SVN $SVNFLAGS cat $SVNREPOSITORY/$SVNMODULE$TARGET > $TARGET'\n\ndef exists(env):\n    return env.Detect('svn')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/__init__.py",
    "content": "\"\"\"SCons.Tool\n\nSCons tool selection.\n\nThis looks for modules that define a callable object that can modify\na construction environment as appropriate for a given tool (or tool\nchain).\n\nNote that because this subsystem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"tool specification\" in an arbitrary callable function.  No\none needs to use or tie in to this subsystem in order to roll their own\ntool definition.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport imp\nimport sys\nimport re\nimport os\nimport shutil\n\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Scanner.C\nimport SCons.Scanner.Prog\n\nDefaultToolpath=[]\n\nCScanner = SCons.Scanner.C.CScanner()\nProgramScanner = SCons.Scanner.Prog.ProgramScanner()\nSourceFileScanner = SCons.Scanner.Base({}, name='SourceFileScanner')\n\nCSuffixes = [\".c\", \".C\", \".cxx\", \".cpp\", \".c++\", \".cc\",\n             \".h\", \".H\", \".hxx\", \".hpp\", \".hh\",\n             \".F\", \".fpp\", \".FPP\",\n             \".m\", \".mm\",\n             \".S\", \".spp\", \".SPP\", \".sx\"]\n\nDSuffixes = ['.d']\n\nIDLSuffixes = [\".idl\", \".IDL\"]\n\nLaTeXSuffixes = [\".tex\", \".ltx\", \".latex\"]\n\nfor suffix in CSuffixes:\n    SourceFileScanner.add_scanner(suffix, CScanner)\n\nclass Tool(object):\n    def __init__(self, name, toolpath=[], **kw):\n        self.name = name\n        self.toolpath = toolpath + DefaultToolpath\n        # remember these so we can merge them into the call\n        self.init_kw = kw\n\n        module = self._tool_module()\n        self.generate = module.generate\n        self.exists = module.exists\n        if hasattr(module, 'options'):\n            self.options = module.options\n\n    def _tool_module(self):\n        # TODO: Interchange zipimport with normal initilization for better error reporting\n        oldpythonpath = sys.path\n        sys.path = self.toolpath + sys.path\n\n        try:\n            try:\n                file, path, desc = imp.find_module(self.name, self.toolpath)\n                try:\n                    return imp.load_module(self.name, file, path, desc)\n                finally:\n                    if file:\n                        file.close()\n            except ImportError, e:\n                if str(e)!=\"No module named %s\"%self.name:\n                    raise SCons.Errors.EnvironmentError(e)\n                try:\n                    import zipimport\n                except ImportError:\n                    pass\n                else:\n                    for aPath in self.toolpath:\n                        try:\n                            importer = zipimport.zipimporter(aPath)\n                            return importer.load_module(self.name)\n                        except ImportError, e:\n                            pass\n        finally:\n            sys.path = oldpythonpath\n\n        full_name = 'SCons.Tool.' + self.name\n        try:\n            return sys.modules[full_name]\n        except KeyError:\n            try:\n                smpath = sys.modules['SCons.Tool'].__path__\n                try:\n                    file, path, desc = imp.find_module(self.name, smpath)\n                    module = imp.load_module(full_name, file, path, desc)\n                    setattr(SCons.Tool, self.name, module)\n                    if file:\n                        file.close()\n                    return module\n                except ImportError, e:\n                    if str(e)!=\"No module named %s\"%self.name:\n                        raise SCons.Errors.EnvironmentError(e)\n                    try:\n                        import zipimport\n                        importer = zipimport.zipimporter( sys.modules['SCons.Tool'].__path__[0] )\n                        module = importer.load_module(full_name)\n                        setattr(SCons.Tool, self.name, module)\n                        return module\n                    except ImportError, e:\n                        m = \"No tool named '%s': %s\" % (self.name, e)\n                        raise SCons.Errors.EnvironmentError(m)\n            except ImportError, e:\n                m = \"No tool named '%s': %s\" % (self.name, e)\n                raise SCons.Errors.EnvironmentError(m)\n\n    def __call__(self, env, *args, **kw):\n        if self.init_kw is not None:\n            # Merge call kws into init kws;\n            # but don't bash self.init_kw.\n            if kw is not None:\n                call_kw = kw\n                kw = self.init_kw.copy()\n                kw.update(call_kw)\n            else:\n                kw = self.init_kw\n        env.Append(TOOLS = [ self.name ])\n        if hasattr(self, 'options'):\n            import SCons.Variables\n            if 'options' not in env:\n                from SCons.Script import ARGUMENTS\n                env['options']=SCons.Variables.Variables(args=ARGUMENTS)\n            opts=env['options']\n\n            self.options(opts)\n            opts.Update(env)\n\n        self.generate(env, *args, **kw)\n\n    def __str__(self):\n        return self.name\n\n##########################################################################\n#  Create common executable program / library / object builders\n\ndef createProgBuilder(env):\n    \"\"\"This is a utility function that creates the Program\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        program = env['BUILDERS']['Program']\n    except KeyError:\n        import SCons.Defaults\n        program = SCons.Builder.Builder(action = SCons.Defaults.LinkAction,\n                                        emitter = '$PROGEMITTER',\n                                        prefix = '$PROGPREFIX',\n                                        suffix = '$PROGSUFFIX',\n                                        src_suffix = '$OBJSUFFIX',\n                                        src_builder = 'Object',\n                                        target_scanner = ProgramScanner)\n        env['BUILDERS']['Program'] = program\n\n    return program\n\ndef createStaticLibBuilder(env):\n    \"\"\"This is a utility function that creates the StaticLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        static_lib = env['BUILDERS']['StaticLibrary']\n    except KeyError:\n        action_list = [ SCons.Action.Action(\"$ARCOM\", \"$ARCOMSTR\") ]\n        if env.Detect('ranlib'):\n            ranlib_action = SCons.Action.Action(\"$RANLIBCOM\", \"$RANLIBCOMSTR\")\n            action_list.append(ranlib_action)\n\n        static_lib = SCons.Builder.Builder(action = action_list,\n                                           emitter = '$LIBEMITTER',\n                                           prefix = '$LIBPREFIX',\n                                           suffix = '$LIBSUFFIX',\n                                           src_suffix = '$OBJSUFFIX',\n                                           src_builder = 'StaticObject')\n        env['BUILDERS']['StaticLibrary'] = static_lib\n        env['BUILDERS']['Library'] = static_lib\n\n    return static_lib\n\ndef VersionShLibLinkNames(version, libname, env):\n    \"\"\"Generate names of symlinks to the versioned shared library\"\"\"\n    Verbose = False\n    platform = env.subst('$PLATFORM')\n    shlib_suffix = env.subst('$SHLIBSUFFIX')\n    shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))\n\n    linknames = []\n    if version.count(\".\") != 2:\n        # We need a version string of the form x.y.z to proceed\n        # Several changes need to be made to support versions like x.y\n        raise ValueError\n\n    if platform == 'darwin':\n        # For libfoo.x.y.z.dylib, linknames libfoo.so\n        suffix_re = re.escape('.' + version + shlib_suffix)\n        linkname = re.sub(suffix_re, shlib_suffix, libname)\n        if Verbose:\n            print \"VersionShLibLinkNames: linkname = \",linkname\n        linknames.append(linkname)\n    elif platform == 'posix':\n        if sys.platform.startswith('openbsd'):\n            # OpenBSD uses x.y shared library versioning numbering convention\n            # and doesn't use symlinks to backwards-compatible libraries\n            return []\n        # For libfoo.so.x.y.z, linknames libfoo.so libfoo.so.x.y libfoo.so.x\n        suffix_re = re.escape(shlib_suffix + '.' + version)\n        # First linkname has no version number\n        linkname = re.sub(suffix_re, shlib_suffix, libname)\n        if Verbose:\n            print \"VersionShLibLinkNames: linkname = \",linkname\n        linknames.append(linkname)\n        versionparts = version.split('.')\n        major_name = linkname + \".\" + versionparts[0]\n        minor_name = major_name + \".\" + versionparts[1]\n        #Only add link for major_name\n        #for linkname in [major_name, minor_name]:\n        for linkname in [major_name, ]:\n            if Verbose:\n                print \"VersionShLibLinkNames: linkname \",linkname, \", target \",libname\n            linknames.append(linkname)\n    # note: no Windows case here (win32 or cygwin);\n    # MSVC doesn't support this type of versioned shared libs.\n    # (could probably do something for MinGW though)\n    return linknames\n\ndef VersionedSharedLibrary(target = None, source= None, env=None):\n    \"\"\"Build a shared library. If the environment has SHLIBVERSION\ndefined make a versioned shared library and create the appropriate\nsymlinks for the platform we are on\"\"\"\n    Verbose = False\n    try:\n        version = env.subst('$SHLIBVERSION')\n    except KeyError:\n        version = None\n\n    # libname includes the version number if one was given\n    libname = target[0].name\n    platform = env.subst('$PLATFORM')\n    shlib_suffix = env.subst('$SHLIBSUFFIX')\n    shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))\n    if Verbose:\n        print \"VersionShLib: libname      = \",libname\n        print \"VersionShLib: platform     = \",platform\n        print \"VersionShLib: shlib_suffix = \",shlib_suffix\n        print \"VersionShLib: target = \",str(target[0])\n\n    if version:\n        # set the shared library link flags\n        if platform == 'posix':\n            shlink_flags += [ '-Wl,-Bsymbolic' ]\n            # OpenBSD doesn't usually use SONAME for libraries\n            if not sys.platform.startswith('openbsd'):\n                # continue setup of shlink flags for all other POSIX systems\n                suffix_re = re.escape(shlib_suffix + '.' + version)\n                (major, age, revision) = version.split(\".\")\n                # soname will have only the major version number in it\n                soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major\n                shlink_flags += [ '-Wl,-soname=%s' % soname ]\n                if Verbose:\n                    print \" soname \",soname,\", shlink_flags \",shlink_flags\n        elif platform == 'cygwin':\n            shlink_flags += [ '-Wl,-Bsymbolic',\n                              '-Wl,--out-implib,${TARGET.base}.a' ]\n        elif platform == 'darwin':\n            shlink_flags += [ '-current_version', '%s' % version,\n                              '-compatibility_version', '%s' % version,\n                              '-undefined', 'dynamic_lookup' ]\n        if Verbose:\n            print \"VersionShLib: shlink_flags = \",shlink_flags\n        envlink = env.Clone()\n        envlink['SHLINKFLAGS'] = shlink_flags\n    else:\n        envlink = env\n\n    result = SCons.Defaults.ShLinkAction(target, source, envlink)\n\n    if version:\n        # here we need the full pathname so the links end up in the right directory\n        libname = target[0].path\n        linknames = VersionShLibLinkNames(version, libname, env)\n        if Verbose:\n            print \"VerShLib: linknames \",linknames\n        # Here we just need the file name w/o path as the target of the link\n        lib_ver = target[0].name\n        # make symlink of adjacent names in linknames\n        for count in range(len(linknames)):\n            linkname = linknames[count]\n            if count > 0:\n                try:\n                    os.remove(lastlinkname)\n                except:\n                    pass\n                os.symlink(os.path.basename(linkname),lastlinkname)\n                if Verbose:\n                    print \"VerShLib: made sym link of %s -> %s\" % (lastlinkname,linkname)\n            lastlinkname = linkname\n        # finish chain of sym links with link to the actual library\n        if len(linknames)>0:\n            try:\n                os.remove(lastlinkname)\n            except:\n                pass\n            os.symlink(lib_ver,lastlinkname)\n            if Verbose:\n                print \"VerShLib: made sym link of %s -> %s\" % (linkname, lib_ver)\n    return result\n\n# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 :\n# Ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM.\n# This was tricky because we don't want changing LIBPATH to cause a rebuild, but\n# changing other link args should.  LIBPATH has $( ... $) around it but until this\n# fix, when the varlist was added to the build sig those ignored parts weren't getting\n# ignored.\nShLibAction = SCons.Action.Action(VersionedSharedLibrary, None, varlist=['SHLINKCOM'])\n\ndef createSharedLibBuilder(env):\n    \"\"\"This is a utility function that creates the SharedLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        shared_lib = env['BUILDERS']['SharedLibrary']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [ SCons.Defaults.SharedCheck,\n                        ShLibAction ]\n        shared_lib = SCons.Builder.Builder(action = action_list,\n                                           emitter = \"$SHLIBEMITTER\",\n                                           prefix = '$SHLIBPREFIX',\n                                           suffix = '$SHLIBSUFFIX',\n                                           target_scanner = ProgramScanner,\n                                           src_suffix = '$SHOBJSUFFIX',\n                                           src_builder = 'SharedObject')\n        env['BUILDERS']['SharedLibrary'] = shared_lib\n\n    return shared_lib\n\ndef createLoadableModuleBuilder(env):\n    \"\"\"This is a utility function that creates the LoadableModule\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        ld_module = env['BUILDERS']['LoadableModule']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [ SCons.Defaults.SharedCheck,\n                        SCons.Defaults.LdModuleLinkAction ]\n        ld_module = SCons.Builder.Builder(action = action_list,\n                                          emitter = \"$LDMODULEEMITTER\",\n                                          prefix = '$LDMODULEPREFIX',\n                                          suffix = '$LDMODULESUFFIX',\n                                          target_scanner = ProgramScanner,\n                                          src_suffix = '$SHOBJSUFFIX',\n                                          src_builder = 'SharedObject')\n        env['BUILDERS']['LoadableModule'] = ld_module\n\n    return ld_module\n\ndef createObjBuilders(env):\n    \"\"\"This is a utility function that creates the StaticObject\n    and SharedObject Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (StaticObject, SharedObject)\n    \"\"\"\n\n\n    try:\n        static_obj = env['BUILDERS']['StaticObject']\n    except KeyError:\n        static_obj = SCons.Builder.Builder(action = {},\n                                           emitter = {},\n                                           prefix = '$OBJPREFIX',\n                                           suffix = '$OBJSUFFIX',\n                                           src_builder = ['CFile', 'CXXFile'],\n                                           source_scanner = SourceFileScanner,\n                                           single_source = 1)\n        env['BUILDERS']['StaticObject'] = static_obj\n        env['BUILDERS']['Object'] = static_obj\n\n    try:\n        shared_obj = env['BUILDERS']['SharedObject']\n    except KeyError:\n        shared_obj = SCons.Builder.Builder(action = {},\n                                           emitter = {},\n                                           prefix = '$SHOBJPREFIX',\n                                           suffix = '$SHOBJSUFFIX',\n                                           src_builder = ['CFile', 'CXXFile'],\n                                           source_scanner = SourceFileScanner,\n                                           single_source = 1)\n        env['BUILDERS']['SharedObject'] = shared_obj\n\n    return (static_obj, shared_obj)\n\ndef createCFileBuilders(env):\n    \"\"\"This is a utility function that creates the CFile/CXXFile\n    Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (CFile, CXXFile)\n    \"\"\"\n\n    try:\n        c_file = env['BUILDERS']['CFile']\n    except KeyError:\n        c_file = SCons.Builder.Builder(action = {},\n                                       emitter = {},\n                                       suffix = {None:'$CFILESUFFIX'})\n        env['BUILDERS']['CFile'] = c_file\n\n        env.SetDefault(CFILESUFFIX = '.c')\n\n    try:\n        cxx_file = env['BUILDERS']['CXXFile']\n    except KeyError:\n        cxx_file = SCons.Builder.Builder(action = {},\n                                         emitter = {},\n                                         suffix = {None:'$CXXFILESUFFIX'})\n        env['BUILDERS']['CXXFile'] = cxx_file\n        env.SetDefault(CXXFILESUFFIX = '.cc')\n\n    return (c_file, cxx_file)\n\n##########################################################################\n#  Create common Java builders\n\ndef CreateJarBuilder(env):\n    try:\n        java_jar = env['BUILDERS']['Jar']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')\n        java_jar = SCons.Builder.Builder(action = jar_com,\n                                         suffix = '$JARSUFFIX',\n                                         src_suffix = '$JAVACLASSSUFIX',\n                                         src_builder = 'JavaClassFile',\n                                         source_factory = fs.Entry)\n        env['BUILDERS']['Jar'] = java_jar\n    return java_jar\n\ndef CreateJavaHBuilder(env):\n    try:\n        java_javah = env['BUILDERS']['JavaH']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR')\n        java_javah = SCons.Builder.Builder(action = java_javah_com,\n                                           src_suffix = '$JAVACLASSSUFFIX',\n                                           target_factory = fs.Entry,\n                                           source_factory = fs.File,\n                                           src_builder = 'JavaClassFile')\n        env['BUILDERS']['JavaH'] = java_javah\n    return java_javah\n\ndef CreateJavaClassFileBuilder(env):\n    try:\n        java_class_file = env['BUILDERS']['JavaClassFile']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_file = SCons.Builder.Builder(action = javac_com,\n                                                emitter = {},\n                                                #suffix = '$JAVACLASSSUFFIX',\n                                                src_suffix = '$JAVASUFFIX',\n                                                src_builder = ['JavaFile'],\n                                                target_factory = fs.Entry,\n                                                source_factory = fs.File)\n        env['BUILDERS']['JavaClassFile'] = java_class_file\n    return java_class_file\n\ndef CreateJavaClassDirBuilder(env):\n    try:\n        java_class_dir = env['BUILDERS']['JavaClassDir']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_dir = SCons.Builder.Builder(action = javac_com,\n                                               emitter = {},\n                                               target_factory = fs.Dir,\n                                               source_factory = fs.Dir)\n        env['BUILDERS']['JavaClassDir'] = java_class_dir\n    return java_class_dir\n\ndef CreateJavaFileBuilder(env):\n    try:\n        java_file = env['BUILDERS']['JavaFile']\n    except KeyError:\n        java_file = SCons.Builder.Builder(action = {},\n                                          emitter = {},\n                                          suffix = {None:'$JAVASUFFIX'})\n        env['BUILDERS']['JavaFile'] = java_file\n        env['JAVASUFFIX'] = '.java'\n    return java_file\n\nclass ToolInitializerMethod(object):\n    \"\"\"\n    This is added to a construction environment in place of a\n    method(s) normally called for a Builder (env.Object, env.StaticObject,\n    etc.).  When called, it has its associated ToolInitializer\n    object search the specified list of tools and apply the first\n    one that exists to the construction environment.  It then calls\n    whatever builder was (presumably) added to the construction\n    environment in place of this particular instance.\n    \"\"\"\n    def __init__(self, name, initializer):\n        \"\"\"\n        Note:  we store the tool name as __name__ so it can be used by\n        the class that attaches this to a construction environment.\n        \"\"\"\n        self.__name__ = name\n        self.initializer = initializer\n\n    def get_builder(self, env):\n        \"\"\"\n\tReturns the appropriate real Builder for this method name\n\tafter having the associated ToolInitializer object apply\n\tthe appropriate Tool module.\n        \"\"\"\n        builder = getattr(env, self.__name__)\n\n        self.initializer.apply_tools(env)\n\n        builder = getattr(env, self.__name__)\n        if builder is self:\n            # There was no Builder added, which means no valid Tool\n            # for this name was found (or possibly there's a mismatch\n            # between the name we were called by and the Builder name\n            # added by the Tool module).\n            return None\n\n        self.initializer.remove_methods(env)\n\n        return builder\n\n    def __call__(self, env, *args, **kw):\n        \"\"\"\n        \"\"\"\n        builder = self.get_builder(env)\n        if builder is None:\n            return [], []\n        return builder(*args, **kw)\n\nclass ToolInitializer(object):\n    \"\"\"\n    A class for delayed initialization of Tools modules.\n\n    Instances of this class associate a list of Tool modules with\n    a list of Builder method names that will be added by those Tool\n    modules.  As part of instantiating this object for a particular\n    construction environment, we also add the appropriate\n    ToolInitializerMethod objects for the various Builder methods\n    that we want to use to delay Tool searches until necessary.\n    \"\"\"\n    def __init__(self, env, tools, names):\n        if not SCons.Util.is_List(tools):\n            tools = [tools]\n        if not SCons.Util.is_List(names):\n            names = [names]\n        self.env = env\n        self.tools = tools\n        self.names = names\n        self.methods = {}\n        for name in names:\n            method = ToolInitializerMethod(name, self)\n            self.methods[name] = method\n            env.AddMethod(method)\n\n    def remove_methods(self, env):\n        \"\"\"\n        Removes the methods that were added by the tool initialization\n        so we no longer copy and re-bind them when the construction\n        environment gets cloned.\n        \"\"\"\n        for method in self.methods.values():\n            env.RemoveMethod(method)\n\n    def apply_tools(self, env):\n        \"\"\"\n\tSearches the list of associated Tool modules for one that\n\texists, and applies that to the construction environment.\n        \"\"\"\n        for t in self.tools:\n            tool = SCons.Tool.Tool(t)\n            if tool.exists(env):\n                env.Tool(tool)\n                return\n\n\t# If we fall through here, there was no tool module found.\n\t# This is where we can put an informative error message\n\t# about the inability to find the tool.   We'll start doing\n\t# this as we cut over more pre-defined Builder+Tools to use\n\t# the ToolInitializer class.\n\ndef Initializers(env):\n    ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib'])\n    def Install(self, *args, **kw):\n        return self._InternalInstall(*args, **kw)\n    def InstallAs(self, *args, **kw):\n        return self._InternalInstallAs(*args, **kw)\n    def InstallVersionedLib(self, *args, **kw):\n        return self._InternalInstallVersionedLib(*args, **kw)\n    env.AddMethod(Install)\n    env.AddMethod(InstallAs)\n    env.AddMethod(InstallVersionedLib)\n\ndef FindTool(tools, env):\n    for tool in tools:\n        t = Tool(tool)\n        if t.exists(env):\n            return tool\n    return None\n\ndef FindAllTools(tools, env):\n    def ToolExists(tool, env=env):\n        return Tool(tool).exists(env)\n    return list(filter (ToolExists, tools))\n\ndef tool_list(platform, env):\n\n    other_plat_tools=[]\n    # XXX this logic about what tool to prefer on which platform\n    #     should be moved into either the platform files or\n    #     the tool files themselves.\n    # The search orders here are described in the man page.  If you\n    # change these search orders, update the man page as well.\n    if str(platform) == 'win32':\n        \"prefer Microsoft tools on Windows\"\n        linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ]\n        c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ]\n        cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'c++', 'bcc32' ]\n        assemblers = ['masm', 'nasm', 'gas', '386asm' ]\n        fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']\n        ars = ['mslib', 'ar', 'tlib']\n        other_plat_tools = ['msvs']\n    elif str(platform) == 'os2':\n        \"prefer IBM tools on OS/2\"\n        linkers = ['ilink', 'gnulink', ]#'mslink']\n        c_compilers = ['icc', 'gcc',]# 'msvc', 'cc']\n        cxx_compilers = ['icc', 'g++',]# 'msvc', 'c++']\n        assemblers = ['nasm',]# 'masm', 'gas']\n        fortran_compilers = ['ifl', 'g77']\n        ars = ['ar',]# 'mslib']\n    elif str(platform) == 'irix':\n        \"prefer MIPSPro on IRIX\"\n        linkers = ['sgilink', 'gnulink']\n        c_compilers = ['sgicc', 'gcc', 'cc']\n        cxx_compilers = ['sgic++', 'g++', 'c++']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['sgiar']\n    elif str(platform) == 'sunos':\n        \"prefer Forte tools on SunOS\"\n        linkers = ['sunlink', 'gnulink']\n        c_compilers = ['suncc', 'gcc', 'cc']\n        cxx_compilers = ['sunc++', 'g++', 'c++']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77',\n                             'gfortran', 'g77', 'fortran']\n        ars = ['sunar']\n    elif str(platform) == 'hpux':\n        \"prefer aCC tools on HP-UX\"\n        linkers = ['hplink', 'gnulink']\n        c_compilers = ['hpcc', 'gcc', 'cc']\n        cxx_compilers = ['hpc++', 'g++', 'c++']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['ar']\n    elif str(platform) == 'aix':\n        \"prefer AIX Visual Age tools on AIX\"\n        linkers = ['aixlink', 'gnulink']\n        c_compilers = ['aixcc', 'gcc', 'cc']\n        cxx_compilers = ['aixc++', 'g++', 'c++']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran']\n    elif str(platform) == 'darwin':\n        \"prefer GNU tools on Mac OS X, except for some linkers and IBM tools\"\n        linkers = ['applelink', 'gnulink']\n        c_compilers = ['gcc', 'cc']\n        cxx_compilers = ['g++', 'c++']\n        assemblers = ['as']\n        fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']\n        ars = ['ar']\n    elif str(platform) == 'cygwin':\n        \"prefer GNU tools on Cygwin, except for a platform-specific linker\"\n        linkers = ['cyglink', 'mslink', 'ilink']\n        c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']\n        cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']\n        assemblers = ['gas', 'nasm', 'masm']\n        ars = ['ar', 'mslib']\n    else:\n        \"prefer GNU tools on all other platforms\"\n        linkers = ['gnulink', 'mslink', 'ilink']\n        c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']\n        cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']\n        assemblers = ['gas', 'nasm', 'masm']\n        ars = ['ar', 'mslib']\n\n    c_compiler = FindTool(c_compilers, env) or c_compilers[0]\n\n    # XXX this logic about what tool provides what should somehow be\n    #     moved into the tool files themselves.\n    if c_compiler and c_compiler == 'mingw':\n        # MinGW contains a linker, C compiler, C++ compiler,\n        # Fortran compiler, archiver and assembler:\n        cxx_compiler = None\n        linker = None\n        assembler = None\n        ar = None\n    else:\n        # Don't use g++ if the C compiler has built-in C++ support:\n        if c_compiler in ('msvc', 'intelc', 'icc'):\n            cxx_compiler = None\n        else:\n            cxx_compiler = FindTool(cxx_compilers, env) or cxx_compilers[0]\n        linker = FindTool(linkers, env) or linkers[0]\n        assembler = FindTool(assemblers, env) or assemblers[0]\n        ar = FindTool(ars, env) or ars[0]\n\n\n    tools = [linker, c_compiler, cxx_compiler,\n              assembler, ar]\n\n    return [x for x in tools if x]\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/aixc++.py",
    "content": "\"\"\"SCons.Tool.aixc++\n\nTool-specific initialization for IBM xlC / Visual Age C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixc++.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\npackages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CXX', 'xlC')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlC / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        _cxx = os.path.join(path, _cxx)\n\n    if 'CXX' not in env:\n        env['CXX'] = _cxx\n\n    cplusplus.generate(env)\n\n    if version:\n        env['CXXVERSION'] = version\n\ndef exists(env):\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        xlc = os.path.join(path, _cxx)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/aixcc.py",
    "content": "\"\"\"SCons.Tool.aixcc\n\nTool-specific initialization for IBM xlc / Visual Age C compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixcc.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\nimport cc\n\npackages = ['vac.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CC', 'xlc')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlc / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        _cc = os.path.join(path, _cc)\n\n    if 'CC' not in env:\n        env['CC'] = _cc\n\n    cc.generate(env)\n\n    if version:\n        env['CCVERSION'] = version\n\ndef exists(env):\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        xlc = os.path.join(path, _cc)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/aixf77.py",
    "content": "\"\"\"engine.SCons.Tool.aixf77\n\nTool-specific initialization for IBM Visual Age f77 Fortran compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixf77.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\n#import SCons.Platform.aix\n\nimport f77\n\n# It would be good to look for the AIX F77 package the same way we're now\n# looking for the C and C++ packages.  This should be as easy as supplying\n# the correct package names in the following list and uncommenting the\n# SCons.Platform.aix_get_xlc() call the in the function below.\npackages = []\n\ndef get_xlf77(env):\n    xlf77 = env.get('F77', 'xlf77')\n    xlf77_r = env.get('SHF77', 'xlf77_r')\n    #return SCons.Platform.aix.get_xlc(env, xlf77, xlf77_r, packages)\n    return (None, xlf77, xlf77_r, None)\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for the Visual Age FORTRAN\n    compiler to an Environment.\n    \"\"\"\n    path, _f77, _shf77, version = get_xlf77(env)\n    if path:\n        _f77 = os.path.join(path, _f77)\n        _shf77 = os.path.join(path, _shf77)\n\n    f77.generate(env)\n\n    env['F77'] = _f77\n    env['SHF77'] = _shf77\n\ndef exists(env):\n    path, _f77, _shf77, version = get_xlf77(env)\n    if path and _f77:\n        xlf77 = os.path.join(path, _f77)\n        if os.path.exists(xlf77):\n            return xlf77\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/aixlink.py",
    "content": "\"\"\"SCons.Tool.aixlink\n\nTool-specific initialization for the IBM Visual Age linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixlink.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nimport link\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\ndef smart_linkflags(source, target, env, for_signature):\n    if cplusplus.iscplusplus(source):\n        build_dir = env.subst('$BUILDDIR', target=target, source=source)\n        if build_dir:\n            return '-qtempinc=' + os.path.join(build_dir, 'tempinc')\n    return ''\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n\n    env['SMARTLINKFLAGS'] = smart_linkflags\n    env['LINKFLAGS']      = SCons.Util.CLVar('$SMARTLINKFLAGS')\n    env['SHLINKFLAGS']    = SCons.Util.CLVar('$LINKFLAGS -qmkshrobj -qsuppress=1501-218')\n    env['SHLIBSUFFIX']    = '.a'\n\ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] }\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env: # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/applelink.py",
    "content": "\"\"\"SCons.Tool.applelink\n\nTool-specific initialization for the Apple gnu-like linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/applelink.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\n# Even though the Mac is based on the GNU toolchain, it doesn't understand\n# the -rpath option, so we use the \"link\" tool instead of \"gnulink\".\nimport link\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for applelink to an\n    Environment.\"\"\"\n    link.generate(env)\n\n    env['FRAMEWORKPATHPREFIX'] = '-F'\n    env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, \"\", __env__)}'\n    env['_FRAMEWORKS'] = '${_concat(\"-framework \", FRAMEWORKS, \"\", __env__)}'\n    env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib')\n    env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n    # override the default for loadable modules, which are different\n    # on OS X than dynamic shared libs.  echoing what XCode does for\n    # pre/suffixes:\n    env['LDMODULEPREFIX'] = ''\n    env['LDMODULESUFFIX'] = ''\n    env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle')\n    env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n\n\ndef exists(env):\n    return env['PLATFORM'] == 'darwin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/ar.py",
    "content": "\"\"\"SCons.Tool.ar\n\nTool-specific initialization for ar (library archive).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ar.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    env['AR']          = 'ar'\n    env['ARFLAGS']     = SCons.Util.CLVar('rc')\n    env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\n    if env.Detect('ranlib'):\n        env['RANLIB']      = 'ranlib'\n        env['RANLIBFLAGS'] = SCons.Util.CLVar('')\n        env['RANLIBCOM']   = '$RANLIB $RANLIBFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/as.py",
    "content": "\"\"\"SCons.Tool.as\n\nTool-specific initialization for as, the generic Posix assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/as.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nassemblers = ['as']\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/bcc32.py",
    "content": "\"\"\"SCons.Tool.bcc32\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/bcc32.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef findIt(program, env):\n    # First search in the SCons path and then the OS path:\n    borwin = env.WhereIs(program) or SCons.Util.WhereIs(program)\n    if borwin:\n        dir = os.path.dirname(borwin)\n        env.PrependENVPath('PATH', dir)\n    return borwin\n\ndef generate(env):\n    findIt('bcc32', env)\n    \"\"\"Add Builders and construction variables for bcc to an\n    Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n    for suffix in ['.c', '.cpp']:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['CC']        = 'bcc32'\n    env['CCFLAGS']   = SCons.Util.CLVar('')\n    env['CFLAGS']   = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -q $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -WD $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.dll'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n    env['CFILESUFFIX'] = '.cpp'\n\ndef exists(env):\n    return findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/c++.py",
    "content": "\"\"\"SCons.Tool.c++\n\nTool-specific initialization for generic Posix C++ compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/c++.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\nimport os.path\n\nimport SCons.Tool\nimport SCons.Defaults\nimport SCons.Util\n\ncompilers = ['CC', 'c++']\n\nCXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']\nif SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CXXSuffixes.append('.C')\n\ndef iscplusplus(source):\n    if not source:\n        # Source might be None for unusual cases like SConf.\n        return 0\n    for s in source:\n        if s.sources:\n            ext = os.path.splitext(str(s.sources[0]))[1]\n            if ext in CXXSuffixes:\n                return 1\n    return 0\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age C++ compilers\n    to an Environment.\n    \"\"\"\n    import SCons.Tool\n    import SCons.Tool.cc\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    SCons.Tool.cc.add_common_cc_variables(env)\n\n    if 'CXX' not in env:\n        env['CXX']    = env.Detect(compilers) or compilers[0]\n    env['CXXFLAGS']   = SCons.Util.CLVar('')\n    env['CXXCOM']     = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['OBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect(env.get('CXX', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/cc.py",
    "content": "\"\"\"SCons.Tool.cc\n\nTool-specific initialization for generic Posix C compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/cc.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool\nimport SCons.Defaults\nimport SCons.Util\n\nCSuffixes = ['.c', '.m']\nif not SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CSuffixes.append('.C')\n\ndef add_common_cc_variables(env):\n    \"\"\"\n    Add underlying common \"C compiler\" variables that\n    are used by multiple tools (specifically, c++).\n    \"\"\"\n    if '_CCCOMCOM' not in env:\n        env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS'\n        # It's a hack to test for darwin here, but the alternative\n        # of creating an applecc.py to contain this seems overkill.\n        # Maybe someday the Apple platform will require more setup and\n        # this logic will be moved.\n        env['FRAMEWORKS'] = SCons.Util.CLVar('')\n        env['FRAMEWORKPATH'] = SCons.Util.CLVar('')\n        if env['PLATFORM'] == 'darwin':\n            env['_CCCOMCOM'] = env['_CCCOMCOM'] + ' $_FRAMEWORKPATH'\n\n    if 'CCFLAGS' not in env:\n        env['CCFLAGS']   = SCons.Util.CLVar('')\n\n    if 'SHCCFLAGS' not in env:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n\ncompilers = ['cc']\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for C compilers to an Environment.\n    \"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    add_common_cc_variables(env)\n\n    if 'CC' not in env:\n        env['CC']    = env.Detect(compilers) or compilers[0]\n    env['CFLAGS']    = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CFILESUFFIX'] = '.c'\n\ndef exists(env):\n    return env.Detect(env.get('CC', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/cyglink.py",
    "content": "\"\"\"SCons.Tool.cyglink\n\nCustomization of gnulink for Cygwin (http://www.cygwin.com/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport SCons.Action\nimport SCons.Util\n\nimport gnulink\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = SCons.Util.CLVar(['$SHLINK'])\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    cmd.extend(['$SHLINKFLAGS', '$__RPATH'])\n\n    implib = env.FindIxes(target, 'IMPLIBPREFIX', 'IMPLIBSUFFIX')\n    if implib:\n        cmd.extend([\n            '-Wl,--out-implib='+implib.get_string(for_signature),\n            '-Wl,--export-all-symbols',\n            '-Wl,--enable-auto-import',\n            '-Wl,--whole-archive', '$SOURCES',\n            '-Wl,--no-whole-archive', '$_LIBDIRFLAGS', '$_LIBFLAGS'\n            ])\n    else:\n        cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    return [cmd]\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll or len(target) > 1:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$SHLIBSUFFIX\"))\n\n    # Remove any \"lib\" after the prefix\n    pre = env.subst('$SHLIBPREFIX')\n    if dll.name[len(pre):len(pre)+3] == 'lib':\n        dll.name = pre + dll.name[len(pre)+3:]\n\n    orig_target = target\n    target = [env.fs.File(dll)]\n    target[0].attributes.shared = 1\n\n    # Append an import lib target\n    if not no_import_lib:\n        # Create list of target libraries as strings\n        target_strings = env.ReplaceIxes(orig_target[0],\n                                         'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                         'IMPLIBPREFIX', 'IMPLIBSUFFIX')\n\n        implib_target = env.fs.File(target_strings)\n        implib_target.attributes.shared = 1\n        target.append(implib_target)\n\n    return (target, source)\n\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for cyglink to an Environment.\"\"\"\n    gnulink.generate(env)\n\n    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,-no-undefined')\n\n    env['SHLINKCOM'] = shlib_action\n    env['LDMODULECOM'] = shlib_action\n    env.Append(SHLIBEMITTER = [shlib_emitter])\n\n    env['SHLIBPREFIX']         = 'cyg'\n    env['SHLIBSUFFIX']         = '.dll'\n\n    env['IMPLIBPREFIX']        = 'lib'\n    env['IMPLIBSUFFIX']        = '.dll.a'\n\ndef exists(env):\n    return gnulink.exists(env)\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/default.py",
    "content": "\"\"\"SCons.Tool.default\n\nInitialization with a default tool list.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/default.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool\n\ndef generate(env):\n    \"\"\"Add default tools.\"\"\"\n    for t in SCons.Tool.tool_list(env['PLATFORM'], env):\n        SCons.Tool.Tool(t)(env)\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/dmd.py",
    "content": "\n# Stub only, D support was broken with Python2.6 and unnecessary to Nuitka\n\ndef generate(env):\n    return\n\ndef exists(env):\n    return False\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/docbook/__init__.py",
    "content": "\n\"\"\"SCons.Tool.docbook\n\nTool-specific initialization for Docbook.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001-7,2010 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os\nimport glob\nimport re\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Script\nimport SCons.Tool\nimport SCons.Util\n\n# Get full path to this script\nscriptpath = os.path.dirname(os.path.realpath(__file__))\n\n# Local folder for the collection of DocBook XSLs\ndb_xsl_folder = 'docbook-xsl-1.76.1'\n\n# Do we have libxml2/libxslt/lxml?\nhas_libxml2 = True\nhas_lxml = True\ntry:\n    import libxml2\n    import libxslt\nexcept:\n    has_libxml2 = False\ntry:\n    import lxml\nexcept:\n    has_lxml = False\n\n# Set this to True, to prefer xsltproc over libxml2 and lxml\nprefer_xsltproc = False\n\n# Regexs for parsing Docbook XML sources of MAN pages\nre_manvolnum = re.compile(\"<manvolnum>([^<]*)</manvolnum>\")\nre_refname = re.compile(\"<refname>([^<]*)</refname>\")\n\n#\n# Helper functions\n#\ndef __extend_targets_sources(target, source):\n    \"\"\" Prepare the lists of target and source files. \"\"\"\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target[:]\n    elif not SCons.Util.is_List(source):\n        source = [source]\n    if len(target) < len(source):\n        target.extend(source[len(target):])\n\n    return target, source\n\ndef __init_xsl_stylesheet(kw, env, user_xsl_var, default_path):\n    if kw.get('DOCBOOK_XSL','') == '':\n        xsl_style = kw.get('xsl', env.subst(user_xsl_var))\n        if xsl_style == '':\n            path_args = [scriptpath, db_xsl_folder] + default_path\n            xsl_style = os.path.join(*path_args)\n        kw['DOCBOOK_XSL'] =  xsl_style\n\ndef __select_builder(lxml_builder, libxml2_builder, cmdline_builder):\n    \"\"\" Selects a builder, based on which Python modules are present. \"\"\"\n    if prefer_xsltproc:\n        return cmdline_builder\n\n    if not has_libxml2:\n        # At the moment we prefer libxml2 over lxml, the latter can lead\n        # to conflicts when installed together with libxml2.\n        if has_lxml:\n            return lxml_builder\n        else:\n            return cmdline_builder\n\n    return libxml2_builder\n\ndef __ensure_suffix(t, suffix):\n    \"\"\" Ensure that the target t has the given suffix. \"\"\"\n    tpath = str(t)\n    if not tpath.endswith(suffix):\n        return tpath+suffix\n\n    return t\n\ndef __ensure_suffix_stem(t, suffix):\n    \"\"\" Ensure that the target t has the given suffix, and return the file's stem. \"\"\"\n    tpath = str(t)\n    if not tpath.endswith(suffix):\n        stem = tpath\n        tpath += suffix\n\n        return tpath, stem\n    else:\n        stem, ext = os.path.splitext(tpath)\n\n    return t, stem\n\ndef __get_xml_text(root):\n    \"\"\" Return the text for the given root node (xml.dom.minidom). \"\"\"\n    txt = \"\"\n    for e in root.childNodes:\n        if (e.nodeType == e.TEXT_NODE):\n            txt += e.data\n    return txt\n\ndef __create_output_dir(base_dir):\n    \"\"\" Ensure that the output directory base_dir exists. \"\"\"\n    root, tail = os.path.split(base_dir)\n    dir = None\n    if tail:\n        if base_dir.endswith('/'):\n            dir = base_dir\n        else:\n            dir = root\n    else:\n        if base_dir.endswith('/'):\n            dir = base_dir\n\n    if dir and not os.path.isdir(dir):\n        os.makedirs(dir)\n\n\n#\n# Supported command line tools and their call \"signature\"\n#\nxsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',\n                'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',\n                'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',\n                'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}\nxmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}\nfop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',\n           'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',\n           'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}\n\ndef __detect_cl_tool(env, chainkey, cdict):\n    \"\"\"\n    Helper function, picks a command line tool from the list\n    and initializes its environment variables.\n    \"\"\"\n    if env.get(chainkey,'') == '':\n        clpath = ''\n        for cltool in cdict:\n            clpath = env.WhereIs(cltool)\n            if clpath:\n                env[chainkey] = clpath\n                if not env[chainkey + 'COM']:\n                    env[chainkey + 'COM'] = cdict[cltool]\n\ndef _detect(env):\n    \"\"\"\n    Detect all the command line tools that we might need for creating\n    the requested output formats.\n    \"\"\"\n    global prefer_xsltproc\n\n    if env.get('DOCBOOK_PREFER_XSLTPROC',''):\n        prefer_xsltproc = True\n\n    if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)):\n        # Try to find the XSLT processors\n        __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com)\n        __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)\n\n    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com)\n\n#\n# Scanners\n#\ninclude_re = re.compile('fileref\\\\s*=\\\\s*[\"|\\']([^\\\\n]*)[\"|\\']')\nsentity_re = re.compile('<!ENTITY\\\\s+%*\\\\s*[^\\\\s]+\\\\s+SYSTEM\\\\s+[\"|\\']([^\\\\n]*)[\"|\\']>')\n\ndef __xml_scan(node, env, path, arg):\n    \"\"\" Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. \"\"\"\n    # Does the node exist yet?\n    if not os.path.isfile(str(node)):\n        return []\n\n    if env.get('DOCBOOK_SCANENT',''):\n        # Use simple pattern matching for system entities..., no support\n        # for recursion yet.\n        contents = node.get_text_contents()\n        return sentity_re.findall(contents)\n\n    xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl')\n    if not has_libxml2 or prefer_xsltproc:\n        if has_lxml and not prefer_xsltproc:\n\n            from lxml import etree\n\n            xsl_tree = etree.parse(xsl_file)\n            doc = etree.parse(str(node))\n            result = doc.xslt(xsl_tree)\n\n            depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != \"\" and not x.startswith(\"<?xml \")]\n            return depfiles\n        else:\n            # Try to call xsltproc\n            xsltproc = env.subst(\"$DOCBOOK_XSLTPROC\")\n            if xsltproc and xsltproc.endswith('xsltproc'):\n                result = env.backtick(' '.join([xsltproc, xsl_file, str(node)]))\n                depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != \"\" and not x.startswith(\"<?xml \")]\n                return depfiles\n            else:\n                # Use simple pattern matching, there is currently no support\n                # for xi:includes...\n                contents = node.get_text_contents()\n                return include_re.findall(contents)\n\n    styledoc = libxml2.parseFile(xsl_file)\n    style = libxslt.parseStylesheetDoc(styledoc)\n    doc = libxml2.readFile(str(node), None, libxml2.XML_PARSE_NOENT)\n    result = style.applyStylesheet(doc, None)\n\n    depfiles = []\n    for x in str(result).splitlines():\n        if x.strip() != \"\" and not x.startswith(\"<?xml \"):\n            depfiles.extend(x.strip().split())\n\n    style.freeStylesheet()\n    doc.freeDoc()\n    result.freeDoc()\n\n    return depfiles\n\n# Creating the instance of our XML dependency scanner\ndocbook_xml_scanner = SCons.Script.Scanner(function = __xml_scan,\n                                           argument = None)\n\n\n#\n# Action generators\n#\ndef __generate_xsltproc_action(source, target, env, for_signature):\n    cmd = env['DOCBOOK_XSLTPROCCOM']\n    # Does the environment have a base_dir defined?\n    base_dir = env.subst('$base_dir')\n    if base_dir:\n        # Yes, so replace target path by its filename\n        return cmd.replace('$TARGET','${TARGET.file}')\n    return cmd\n\n\n#\n# Emitters\n#\ndef __emit_xsl_basedir(target, source, env):\n    # Does the environment have a base_dir defined?\n    base_dir = env.subst('$base_dir')\n    if base_dir:\n        # Yes, so prepend it to each target\n        return [os.path.join(base_dir, str(t)) for t in target], source\n\n    # No, so simply pass target and source names through\n    return target, source\n\n\n#\n# Builders\n#\ndef __build_libxml2(target, source, env):\n    \"\"\"\n    General XSLT builder (HTML/FO), using the libxml2 module.\n    \"\"\"\n    xsl_style = env.subst('$DOCBOOK_XSL')\n    styledoc = libxml2.parseFile(xsl_style)\n    style = libxslt.parseStylesheetDoc(styledoc)\n    doc = libxml2.readFile(str(source[0]),None,libxml2.XML_PARSE_NOENT)\n    # Support for additional parameters\n    parampass = {}\n    if parampass:\n        result = style.applyStylesheet(doc, parampass)\n    else:\n        result = style.applyStylesheet(doc, None)\n    style.saveResultToFilename(str(target[0]), result, 0)\n    style.freeStylesheet()\n    doc.freeDoc()\n    result.freeDoc()\n\n    return None\n\ndef __build_lxml(target, source, env):\n    \"\"\"\n    General XSLT builder (HTML/FO), using the lxml module.\n    \"\"\"\n    from lxml import etree\n\n    xslt_ac = etree.XSLTAccessControl(read_file=True,\n                                      write_file=True,\n                                      create_dir=True,\n                                      read_network=False,\n                                      write_network=False)\n    xsl_style = env.subst('$DOCBOOK_XSL')\n    xsl_tree = etree.parse(xsl_style)\n    transform = etree.XSLT(xsl_tree, access_control=xslt_ac)\n    doc = etree.parse(str(source[0]))\n    # Support for additional parameters\n    parampass = {}\n    if parampass:\n        result = transform(doc, **parampass)\n    else:\n        result = transform(doc)\n\n    try:\n        of = open(str(target[0]), \"w\")\n        of.write(of.write(etree.tostring(result, pretty_print=True)))\n        of.close()\n    except:\n        pass\n\n    return None\n\ndef __xinclude_libxml2(target, source, env):\n    \"\"\"\n    Resolving XIncludes, using the libxml2 module.\n    \"\"\"\n    doc = libxml2.readFile(str(source[0]), None, libxml2.XML_PARSE_NOENT)\n    doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT)\n    doc.saveFile(str(target[0]))\n    doc.freeDoc()\n\n    return None\n\ndef __xinclude_lxml(target, source, env):\n    \"\"\"\n    Resolving XIncludes, using the lxml module.\n    \"\"\"\n    from lxml import etree\n\n    doc = etree.parse(str(source[0]))\n    doc.xinclude()\n    try:\n        doc.write(str(target[0]), xml_declaration=True,\n                  encoding=\"UTF-8\", pretty_print=True)\n    except:\n        pass\n\n    return None\n\n__libxml2_builder = SCons.Builder.Builder(\n        action = __build_libxml2,\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n__lxml_builder = SCons.Builder.Builder(\n        action = __build_lxml,\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n\n__xinclude_libxml2_builder = SCons.Builder.Builder(\n        action = __xinclude_libxml2,\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n__xinclude_lxml_builder = SCons.Builder.Builder(\n        action = __xinclude_lxml,\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n\n__xsltproc_builder = SCons.Builder.Builder(\n        action = SCons.Action.CommandGeneratorAction(__generate_xsltproc_action,\n                                                     {'cmdstr' : '$DOCBOOK_XSLTPROCCOMSTR'}),\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n__xmllint_builder = SCons.Builder.Builder(\n        action = SCons.Action.Action('$DOCBOOK_XMLLINTCOM','$DOCBOOK_XMLLINTCOMSTR'),\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n__fop_builder = SCons.Builder.Builder(\n        action = SCons.Action.Action('$DOCBOOK_FOPCOM','$DOCBOOK_FOPCOMSTR'),\n        suffix = '.pdf',\n        src_suffix = '.fo',\n        ensure_suffix=1)\n\ndef DocbookEpub(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for ePub output.\n    \"\"\"\n    import zipfile\n    import shutil\n\n    def build_open_container(target, source, env):\n        \"\"\"Generate the *.epub file from intermediate outputs\n\n        Constructs the epub file according to the Open Container Format. This\n        function could be replaced by a call to the SCons Zip builder if support\n        was added for different compression formats for separate source nodes.\n        \"\"\"\n        zf = zipfile.ZipFile(str(target[0]), 'w')\n        mime_file = open('mimetype', 'w')\n        mime_file.write('application/epub+zip')\n        mime_file.close()\n        zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED)\n        for s in source:\n            if os.path.isfile(str(s)):\n                head, tail = os.path.split(str(s))\n                if not head:\n                    continue\n                s = head\n            for dirpath, dirnames, filenames in os.walk(str(s)):\n                for fname in filenames:\n                    path = os.path.join(dirpath, fname)\n                    if os.path.isfile(path):\n                        zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))),\n                            zipfile.ZIP_DEFLATED)\n        zf.close()\n\n    def add_resources(target, source, env):\n        \"\"\"Add missing resources to the OEBPS directory\n\n        Ensure all the resources in the manifest are present in the OEBPS directory.\n        \"\"\"\n        hrefs = []\n        content_file = os.path.join(source[0].abspath, 'content.opf')\n        if not os.path.isfile(content_file):\n            return\n\n        hrefs = []\n        if has_libxml2:\n            nsmap = {'opf' : 'http://www.idpf.org/2007/opf'}\n            # Read file and resolve entities\n            doc = libxml2.readFile(content_file, None, 0)\n            opf = doc.getRootElement()\n            # Create xpath context\n            xpath_context = doc.xpathNewContext()\n            # Register namespaces\n            for key, val in nsmap.iteritems():\n                xpath_context.xpathRegisterNs(key, val)\n\n            if hasattr(opf, 'xpathEval') and xpath_context:\n                # Use the xpath context\n                xpath_context.setContextNode(opf)\n                items = xpath_context.xpathEval(\".//opf:item\")\n            else:\n                items = opf.findall(\".//{'http://www.idpf.org/2007/opf'}item\")\n\n            for item in items:\n                if hasattr(item, 'prop'):\n                    hrefs.append(item.prop('href'))\n                else:\n                    hrefs.append(item.attrib['href'])\n\n            doc.freeDoc()\n            xpath_context.xpathFreeContext()\n        elif has_lxml:\n            from lxml import etree\n\n            opf = etree.parse(content_file)\n            # All the opf:item elements are resources\n            for item in opf.xpath('//opf:item',\n                    namespaces= { 'opf': 'http://www.idpf.org/2007/opf' }):\n                hrefs.append(item.attrib['href'])\n\n        for href in hrefs:\n            # If the resource was not already created by DocBook XSL itself,\n            # copy it into the OEBPS folder\n            referenced_file = os.path.join(source[0].abspath, href)\n            if not os.path.exists(referenced_file):\n                shutil.copy(href, os.path.join(source[0].abspath, href))\n\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_EPUB', ['epub','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    if not env.GetOption('clean'):\n        # Ensure that the folders OEBPS and META-INF exist\n        __create_output_dir('OEBPS/')\n        __create_output_dir('META-INF/')\n    dirs = env.Dir(['OEBPS', 'META-INF'])\n\n    # Set the fixed base_dir\n    kw['base_dir'] = 'OEBPS/'\n    tocncx = __builder.__call__(env, 'toc.ncx', source[0], **kw)\n    cxml = env.File('META-INF/container.xml')\n    env.SideEffect(cxml, tocncx)\n\n    env.Depends(tocncx, kw['DOCBOOK_XSL'])\n    result.extend(tocncx+[cxml])\n\n    container = env.Command(__ensure_suffix(str(target[0]), '.epub'),\n        tocncx+[cxml], [add_resources, build_open_container])\n    mimetype = env.File('mimetype')\n    env.SideEffect(mimetype, container)\n\n    result.extend(container)\n    # Add supporting files for cleanup\n    env.Clean(tocncx, dirs)\n\n    return result\n\ndef DocbookHtml(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTML output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTML', ['html','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        r = __builder.__call__(env, __ensure_suffix(t,'.html'), s, **kw)\n        env.Depends(r, kw['DOCBOOK_XSL'])\n        result.extend(r)\n\n    return result\n\ndef DocbookHtmlChunked(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for chunked HTML output.\n    \"\"\"\n    # Init target/source\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED', ['html','chunkfast.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, glob.glob(os.path.join(base_dir, '*.html')))\n\n    return result\n\n\ndef DocbookHtmlhelp(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output.\n    \"\"\"\n    # Init target/source\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLHELP', ['htmlhelp','htmlhelp.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, ['toc.hhc', 'htmlhelp.hhp', 'index.hhk'] +\n                 glob.glob(os.path.join(base_dir, '[ar|bk|ch]*.html')))\n\n    return result\n\ndef DocbookPdf(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for PDF output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_PDF', ['fo','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        t, stem = __ensure_suffix_stem(t, '.pdf')\n        xsl = __builder.__call__(env, stem+'.fo', s, **kw)\n        result.extend(xsl)\n        env.Depends(xsl, kw['DOCBOOK_XSL'])\n        result.extend(__fop_builder.__call__(env, t, xsl, **kw))\n\n    return result\n\ndef DocbookMan(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for Man page output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_MAN', ['manpages','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        volnum = \"1\"\n        outfiles = []\n        srcfile = __ensure_suffix(str(s),'.xml')\n        if os.path.isfile(srcfile):\n            try:\n                import xml.dom.minidom\n\n                dom = xml.dom.minidom.parse(__ensure_suffix(str(s),'.xml'))\n                # Extract volume number, default is 1\n                for node in dom.getElementsByTagName('refmeta'):\n                    for vol in node.getElementsByTagName('manvolnum'):\n                        volnum = __get_xml_text(vol)\n\n                # Extract output filenames\n                for node in dom.getElementsByTagName('refnamediv'):\n                    for ref in node.getElementsByTagName('refname'):\n                        outfiles.append(__get_xml_text(ref)+'.'+volnum)\n\n            except:\n                # Use simple regex parsing\n                f = open(__ensure_suffix(str(s),'.xml'), 'r')\n                content = f.read()\n                f.close()\n\n                for m in re_manvolnum.finditer(content):\n                    volnum = m.group(1)\n\n                for m in re_refname.finditer(content):\n                    outfiles.append(m.group(1)+'.'+volnum)\n\n            if not outfiles:\n                # Use stem of the source file\n                spath = str(s)\n                if not spath.endswith('.xml'):\n                    outfiles.append(spath+'.'+volnum)\n                else:\n                    stem, ext = os.path.splitext(spath)\n                    outfiles.append(stem+'.'+volnum)\n        else:\n            # We have to completely rely on the given target name\n            outfiles.append(t)\n\n        __builder.__call__(env, outfiles[0], s, **kw)\n        env.Depends(outfiles[0], kw['DOCBOOK_XSL'])\n        result.append(outfiles[0])\n        if len(outfiles) > 1:\n            env.Clean(outfiles[0], outfiles[1:])\n\n\n    return result\n\ndef DocbookSlidesPdf(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for PDF slides output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESPDF', ['slides','fo','plain.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        t, stem = __ensure_suffix_stem(t, '.pdf')\n        xsl = __builder.__call__(env, stem+'.fo', s, **kw)\n        env.Depends(xsl, kw['DOCBOOK_XSL'])\n        result.extend(xsl)\n        result.extend(__fop_builder.__call__(env, t, xsl, **kw))\n\n    return result\n\ndef DocbookSlidesHtml(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTML slides output.\n    \"\"\"\n    # Init list of targets/sources\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, [os.path.join(base_dir, 'toc.html')] +\n                 glob.glob(os.path.join(base_dir, 'foil*.html')))\n\n    return result\n\ndef DocbookXInclude(env, target, source, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, for resolving XIncludes in a separate processing step.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Setup builder\n    __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        result.extend(__builder.__call__(env, t, s, **kw))\n\n    return result\n\ndef DocbookXslt(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, applying a simple XSL transformation to the input file.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl')\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        r = __builder.__call__(env, t, s, **kw)\n        env.Depends(r, kw['DOCBOOK_XSL'])\n        result.extend(r)\n\n    return result\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for docbook to an Environment.\"\"\"\n\n    env.SetDefault(\n        # Default names for customized XSL stylesheets\n        DOCBOOK_DEFAULT_XSL_EPUB = '',\n        DOCBOOK_DEFAULT_XSL_HTML = '',\n        DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '',\n        DOCBOOK_DEFAULT_XSL_HTMLHELP = '',\n        DOCBOOK_DEFAULT_XSL_PDF = '',\n        DOCBOOK_DEFAULT_XSL_MAN = '',\n        DOCBOOK_DEFAULT_XSL_SLIDESPDF = '',\n        DOCBOOK_DEFAULT_XSL_SLIDESHTML = '',\n\n        # Paths to the detected executables\n        DOCBOOK_XSLTPROC = '',\n        DOCBOOK_XMLLINT = '',\n        DOCBOOK_FOP = '',\n\n        # Additional flags for the text processors\n        DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''),\n\n        # Default command lines for the detected executables\n        DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'],\n        DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'],\n        DOCBOOK_FOPCOM = fop_com['fop'],\n\n        # Screen output for the text processors\n        DOCBOOK_XSLTPROCCOMSTR = None,\n        DOCBOOK_XMLLINTCOMSTR = None,\n        DOCBOOK_FOPCOMSTR = None,\n\n        )\n    _detect(env)\n\n    try:\n        env.AddMethod(DocbookEpub, \"DocbookEpub\")\n        env.AddMethod(DocbookHtml, \"DocbookHtml\")\n        env.AddMethod(DocbookHtmlChunked, \"DocbookHtmlChunked\")\n        env.AddMethod(DocbookHtmlhelp, \"DocbookHtmlhelp\")\n        env.AddMethod(DocbookPdf, \"DocbookPdf\")\n        env.AddMethod(DocbookMan, \"DocbookMan\")\n        env.AddMethod(DocbookSlidesPdf, \"DocbookSlidesPdf\")\n        env.AddMethod(DocbookSlidesHtml, \"DocbookSlidesHtml\")\n        env.AddMethod(DocbookXInclude, \"DocbookXInclude\")\n        env.AddMethod(DocbookXslt, \"DocbookXslt\")\n    except AttributeError:\n        # Looks like we use a pre-0.98 version of SCons...\n        from SCons.Script.SConscript import SConsEnvironment\n        SConsEnvironment.DocbookEpub = DocbookEpub\n        SConsEnvironment.DocbookHtml = DocbookHtml\n        SConsEnvironment.DocbookHtmlChunked = DocbookHtmlChunked\n        SConsEnvironment.DocbookHtmlhelp = DocbookHtmlhelp\n        SConsEnvironment.DocbookPdf = DocbookPdf\n        SConsEnvironment.DocbookMan = DocbookMan\n        SConsEnvironment.DocbookSlidesPdf = DocbookSlidesPdf\n        SConsEnvironment.DocbookSlidesHtml = DocbookSlidesHtml\n        SConsEnvironment.DocbookXInclude = DocbookXInclude\n        SConsEnvironment.DocbookXslt = DocbookXslt\n\n\ndef exists(env):\n    return 1\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/filesystem.py",
    "content": "\"\"\"SCons.Tool.filesystem\n\nTool-specific initialization for the filesystem tools.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/filesystem.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons\nfrom SCons.Tool.install import copyFunc\n\ncopyToBuilder, copyAsBuilder = None, None\n\ndef copyto_emitter(target, source, env):\n    \"\"\" changes the path of the source to be under the target (which\n    are assumed to be directories.\n    \"\"\"\n    n_target = []\n\n    for t in target:\n        n_target = n_target + [t.File( str( s ) ) for s in source]\n\n    return (n_target, source)\n\ndef copy_action_func(target, source, env):\n    assert( len(target) == len(source) ), \"\\ntarget: %s\\nsource: %s\" %(list(map(str, target)),list(map(str, source)))\n\n    for t, s in zip(target, source):\n        if copyFunc(t.get_path(), s.get_path(), env):\n            return 1\n\n    return 0\n\ndef copy_action_str(target, source, env):\n    return env.subst_target_source(env['COPYSTR'], 0, target, source)\n\ncopy_action = SCons.Action.Action( copy_action_func, copy_action_str )\n\ndef generate(env):\n    try:\n        env['BUILDERS']['CopyTo']\n        env['BUILDERS']['CopyAs']\n    except KeyError, e:\n        global copyToBuilder\n        if copyToBuilder is None:\n            copyToBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Dir,\n                             source_factory = env.fs.Entry,\n                             multi          = 1,\n                             emitter        = [ copyto_emitter, ] )\n\n        global copyAsBuilder\n        if copyAsBuilder is None:\n            copyAsBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Entry,\n                             source_factory = env.fs.Entry )\n\n        env['BUILDERS']['CopyTo'] = copyToBuilder\n        env['BUILDERS']['CopyAs'] = copyAsBuilder\n\n        env['COPYSTR'] = 'Copy file(s): \"$SOURCES\" to \"$TARGETS\"'\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/g++.py",
    "content": "\"\"\"SCons.Tool.g++\n\nTool-specific initialization for g++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/g++.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\nimport os.path\nimport re\nimport subprocess\n\nimport SCons.Tool\nimport SCons.Util\n\nimport gcc\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\ncompilers = ['g++']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    if 'CXX' not in env:\n        env['CXX']    = env.Detect(compilers) or compilers[0]\n\n    cplusplus.generate(env)\n\n    # platform specific settings\n    if env['PLATFORM'] == 'aix':\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')\n        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n        env['SHOBJSUFFIX'] = '$OBJSUFFIX'\n    elif env['PLATFORM'] == 'hpux':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'sunos':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    # determine compiler version\n    version = gcc.detect_version(env, env['CXX'])\n    if version:\n        env['CXXVERSION'] = version\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/g77.py",
    "content": "\"\"\"engine.SCons.Tool.g77\n\nTool-specific initialization for g77.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/g77.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\nfrom SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env\n\ncompilers = ['g77', 'f77']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for g77 to an Environment.\"\"\"\n    add_all_to_env(env)\n    add_f77_to_env(env)\n\n    fcomp = env.Detect(compilers) or 'g77'\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS')\n        env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS')\n    else:\n        env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -fPIC')\n        env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS -fPIC')\n\n    env['FORTRAN'] = fcomp\n    env['SHFORTRAN'] = '$FORTRAN'\n\n    env['F77'] = fcomp\n    env['SHF77'] = '$F77'\n\n    env['INCFORTRANPREFIX'] = \"-I\"\n    env['INCFORTRANSUFFIX'] = \"\"\n\n    env['INCF77PREFIX'] = \"-I\"\n    env['INCF77SUFFIX'] = \"\"\n\ndef exists(env):\n    return env.Detect(compilers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gas.py",
    "content": "\"\"\"SCons.Tool.gas\n\nTool-specific initialization for as, the Gnu assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gas.py  2014/07/05 09:42:21 garyo\"\n\nas_module = __import__('as', globals(), locals(), [])\n\nassemblers = ['as', 'gas']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gcc.py",
    "content": "\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for gcc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2015 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gcc.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog\"\n\nimport cc\nimport os\nimport re\nimport subprocess\n\nimport SCons.Util\n\ncompilers = ['gcc', 'cc']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n\n    if 'CC' not in env:\n        env['CC'] = env.Detect(compilers) or compilers[0]\n\n    cc.generate(env)\n\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    else:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')\n    # determine compiler version\n    version = detect_version(env, env['CC'])\n    if version:\n        env['CCVERSION'] = version\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return detect_version(env, env.Detect(env.get('CC', compilers)))\n\ndef detect_version(env, cc):\n    \"\"\"Return the version of the GNU compiler, or None if it is not a GNU compiler.\"\"\"\n    cc = env.subst(cc)\n    if not cc:\n        return None\n    version = None\n    #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],\n    pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],\n                                 stdin = 'devnull',\n                                 stderr = 'devnull',\n                                 stdout = subprocess.PIPE)\n    # -dumpversion was added in GCC 3.0.  As long as we're supporting\n    # GCC versions older than that, we should use --version and a\n    # regular expression.\n    #line = pipe.stdout.read().strip()\n    #if line:\n    #    version = line\n    line = pipe.stdout.readline()\n    match = re.search(r'[0-9]+(\\.[0-9]+)+', line)\n    if match:\n        version = match.group(0)\n    # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer:\n    # So continue with reading to let the child process actually terminate.\n    while pipe.stdout.readline():\n        pass\n    ret = pipe.wait()\n    if ret != 0:\n        return None\n    return version\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gdc.py",
    "content": "\"\"\"SCons.Tool.gdc\n\nTool-specific initialization for the GDC compiler.\n(https://github.com/D-Programming-GDC/GDC)\n\nDeveloped by Russel Winder (russel@winder.org.uk)\n2012-05-09 onwards\n\nCompiler variables:\n    DC - The name of the D compiler to use.  Defaults to gdc.\n    DPATH - List of paths to search for import modules.\n    DVERSIONS - List of version tags to enable when compiling.\n    DDEBUG - List of debug tags to enable when compiling.\n\nLinker related variables:\n    LIBS - List of library files to link in.\n    DLINK - Name of the linker to use.  Defaults to gdc.\n    DLINKFLAGS - List of linker flags.\n\nLib tool variables:\n    DLIB - Name of the lib tool to use.  Defaults to lib.\n    DLIBFLAGS - List of flags to pass to the lib tool.\n    LIBS - Same as for the linker. (libraries to pull into the .lib)\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gdc.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Tool\n\nimport SCons.Tool.DCommon\n\n\ndef generate(env):\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    static_obj.add_action('.d', SCons.Defaults.DAction)\n    shared_obj.add_action('.d', SCons.Defaults.ShDAction)\n    static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)\n    shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)\n\n    env['DC'] = env.Detect('gdc')\n    env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -o $TARGET $SOURCES'\n    env['_DINCFLAGS'] = '$( ${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}  $)'\n    env['_DVERFLAGS'] = '$( ${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}  $)'\n    env['_DDEBUGFLAGS'] = '$( ${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)} $)'\n    env['_DFLAGS'] = '$( ${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)} $)'\n\n    env['SHDC'] = '$DC'\n    env['SHDCOM'] = '$SHDC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -fPIC -c -o $TARGET $SOURCES'\n\n    env['DPATH'] = ['#/']\n    env['DFLAGS'] = []\n    env['DVERSIONS'] = []\n    env['DDEBUG'] = []\n\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    if env['DC']:\n        SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])\n\n    env['DINCPREFIX'] = '-I'\n    env['DINCSUFFIX'] = ''\n    env['DVERPREFIX'] = '-version='\n    env['DVERSUFFIX'] = ''\n    env['DDEBUGPREFIX'] = '-debug='\n    env['DDEBUGSUFFIX'] = ''\n    env['DFLAGPREFIX'] = '-'\n    env['DFLAGSUFFIX'] = ''\n    env['DFILESUFFIX'] = '.d'\n\n    env['DLINK'] = '$DC'\n    env['DLINKFLAGS'] = SCons.Util.CLVar('')\n    env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    env['SHDLINK'] = '$DC'\n    env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared')\n    env['SHDLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'\n    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')\n\n    env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)'\n\n    env['DLIBFLAGPREFIX'] = '-'\n    env['DLIBFLAGSUFFIX'] = ''\n    env['DLINKFLAGPREFIX'] = '-'\n    env['DLINKFLAGSUFFIX'] = ''\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-Wl,-rpath='\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\n    SCons.Tool.createStaticLibBuilder(env)\n\n\ndef exists(env):\n    return env.Detect('gdc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gettext.py",
    "content": "\"\"\"gettext tool\n\"\"\"\n\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/gettext.py  2014/07/05 09:42:21 garyo\"\n\n#############################################################################\ndef generate(env,**kw):\n  import SCons.Tool\n  from SCons.Tool.GettextCommon \\\n    import  _translate, tool_list\n  for t in tool_list(env['PLATFORM'], env):\n    env.Tool(t)\n  env.AddMethod(_translate, 'Translate')\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  from SCons.Tool.GettextCommon \\\n  import _xgettext_exists, _msginit_exists, \\\n         _msgmerge_exists, _msgfmt_exists\n  try:\n    return _xgettext_exists(env) and _msginit_exists(env) \\\n       and _msgmerge_exists(env) and _msgfmt_exists(env)\n  except:\n    return False\n#############################################################################\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gfortran.py",
    "content": "\"\"\"SCons.Tool.gfortran\n\nTool-specific initialization for gfortran, the GNU Fortran 95/Fortran\n2003 compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gfortran.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport fortran\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gfortran to an\n    Environment.\"\"\"\n    fortran.generate(env)\n\n    for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03']:\n        env['%s' % dialect] = 'gfortran'\n        env['SH%s' % dialect] = '$%s' % dialect\n        if env['PLATFORM'] in ['cygwin', 'win32']:\n            env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS' % dialect)\n        else:\n            env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect)\n\n        env['INC%sPREFIX' % dialect] = \"-I\"\n        env['INC%sSUFFIX' % dialect] = \"\"\n\ndef exists(env):\n    return env.Detect('gfortran')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/gnulink.py",
    "content": "\"\"\"SCons.Tool.gnulink\n\nTool-specific initialization for the gnu linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gnulink.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport link\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    link.generate(env)\n\n    if env['PLATFORM'] == 'hpux':\n        env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared -fPIC')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-Wl,-rpath='\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = { 'CXX': ['g++'], 'CC': ['gcc'] }\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env: # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env) # find CXX or CC\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/hpc++.py",
    "content": "\"\"\"SCons.Tool.hpc++\n\nTool-specific initialization for c++ on HP/UX.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hpc++.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Util\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\nacc = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    cc = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(cc):\n        acc = cc\n        break\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    cplusplus.generate(env)\n\n    if acc:\n        env['CXX']        = acc or 'aCC'\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n        # determine version of aCC\n        line = os.popen(acc + ' -V 2>&1').readline().rstrip()\n        if line.find('aCC: HP ANSI C++') == 0:\n            env['CXXVERSION'] = line.split()[-1]\n\n        if env['PLATFORM'] == 'cygwin':\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n        else:\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n\ndef exists(env):\n    return acc\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/hpcc.py",
    "content": "\"\"\"SCons.Tool.hpcc\n\nTool-specific initialization for HP aCC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hpcc.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for aCC & cc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'aCC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS +Z')\n\ndef exists(env):\n    return env.Detect('aCC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/hplink.py",
    "content": "\"\"\"SCons.Tool.hplink\n\nTool-specific initialization for the HP linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hplink.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nimport link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    linker = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n\n    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,+s -Wl,+vnocompatwarnings')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -b')\n    env['SHLIBSUFFIX'] = '.sl'\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/icc.py",
    "content": "\"\"\"engine.SCons.Tool.icc\n\nTool-specific initialization for the OS/2 icc compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/icc.py  2014/07/05 09:42:21 garyo\"\n\nimport cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the OS/2 to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CC']         = 'icc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect('icc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/icl.py",
    "content": "\"\"\"engine.SCons.Tool.icl\n\nTool-specific initialization for the Intel C/C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/icl.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool.intelc\n\n# This has been completely superceded by intelc.py, which can\n# handle both Windows and Linux versions.\n\ndef generate(*args, **kw):\n    \"\"\"Add Builders and construction variables for icl to an Environment.\"\"\"\n    return SCons.Tool.intelc.generate(*args, **kw)\n\ndef exists(*args, **kw):\n    return SCons.Tool.intelc.exists(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/ilink.py",
    "content": "\"\"\"SCons.Tool.ilink\n\nTool-specific initialization for the OS/2 ilink linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ilink.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ilink to an Environment.\"\"\"\n    SCons.Tool.createProgBuilder(env)\n\n    env['LINK']        = 'ilink'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK $LINKFLAGS /O:$TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX']='/LIBPATH:'\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\ndef exists(env):\n    return env.Detect('ilink')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/ilink32.py",
    "content": "\"\"\"SCons.Tool.ilink32\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ilink32.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Borland ilink to an\n    Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['LINK']        = '$CC'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK -q $LINKFLAGS -e$TARGET $SOURCES $LIBS'\n    env['LIBDIRPREFIX']=''\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n\ndef exists(env):\n    # Uses bcc32 to do linking as it generally knows where the standard\n    # LIBS are and set up the linking correctly\n    return SCons.Tool.bcc32.findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/install.py",
    "content": "\"\"\"SCons.Tool.install\n\nTool-specific initialization for the install tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/install.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport re\nimport shutil\nimport stat\n\nimport SCons.Action\nfrom SCons.Util import make_path_relative\n\n#\n# We keep track of *all* installed files.\n_INSTALLED_FILES = []\n_UNIQUE_INSTALLED_FILES = None\n\nclass CopytreeError(EnvironmentError):\n    pass\n\n# This is a patched version of shutil.copytree from python 2.5.  It\n# doesn't fail if the dir exists, which regular copytree does\n# (annoyingly).  Note the XXX comment in the docstring.\ndef scons_copytree(src, dst, symlinks=False):\n    \"\"\"Recursively copy a directory tree using copy2().\n\n    The destination directory must not already exist.\n    If exception(s) occur, an CopytreeError is raised with a list of reasons.\n\n    If the optional symlinks flag is true, symbolic links in the\n    source tree result in symbolic links in the destination tree; if\n    it is false, the contents of the files pointed to by symbolic\n    links are copied.\n\n    XXX Consider this example code rather than the ultimate tool.\n\n    \"\"\"\n    names = os.listdir(src)\n    # garyo@genarts.com fix: check for dir before making dirs.\n    if not os.path.exists(dst):\n        os.makedirs(dst)\n    errors = []\n    for name in names:\n        srcname = os.path.join(src, name)\n        dstname = os.path.join(dst, name)\n        try:\n            if symlinks and os.path.islink(srcname):\n                linkto = os.readlink(srcname)\n                os.symlink(linkto, dstname)\n            elif os.path.isdir(srcname):\n                scons_copytree(srcname, dstname, symlinks)\n            else:\n                shutil.copy2(srcname, dstname)\n            # XXX What about devices, sockets etc.?\n        except (IOError, os.error), why:\n            errors.append((srcname, dstname, str(why)))\n        # catch the CopytreeError from the recursive copytree so that we can\n        # continue with other files\n        except CopytreeError, err:\n            errors.extend(err.args[0])\n    try:\n        shutil.copystat(src, dst)\n    except WindowsError:\n        # can't copy file access times on Windows\n        pass\n    except OSError, why:\n        errors.extend((src, dst, str(why)))\n    if errors:\n        raise CopytreeError, errors\n\n\n#\n# Functions doing the actual work of the Install Builder.\n#\ndef copyFunc(dest, source, env):\n    \"\"\"Install a source file or directory into a destination by copying,\n    (including copying permission/mode bits).\"\"\"\n\n    if os.path.isdir(source):\n        if os.path.exists(dest):\n            if not os.path.isdir(dest):\n                raise SCons.Errors.UserError(\"cannot overwrite non-directory `%s' with a directory `%s'\" % (str(dest), str(source)))\n        else:\n            parent = os.path.split(dest)[0]\n            if not os.path.exists(parent):\n                os.makedirs(parent)\n        scons_copytree(source, dest)\n    else:\n        shutil.copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n    return 0\n\n#\n# Functions doing the actual work of the InstallVersionedLib Builder.\n#\ndef copyFuncVersionedLib(dest, source, env):\n    \"\"\"Install a versioned library into a destination by copying,\n    (including copying permission/mode bits) and then creating\n    required symlinks.\"\"\"\n\n    if os.path.isdir(source):\n        raise SCons.Errors.UserError(\"cannot install directory `%s' as a version library\" % str(source) )\n    else:\n        # remove the link if it is already there\n        try:\n            os.remove(dest)\n        except:\n            pass\n        shutil.copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n        versionedLibLinks(dest, source, env)\n\n    return 0\n\ndef versionedLibVersion(dest, env):\n    \"\"\"Check if dest is a version shared library name. Return version, libname, & install_dir if it is.\"\"\"\n    Verbose = False\n    platform = env.subst('$PLATFORM')\n    if not (platform == 'posix'  or platform == 'darwin'):\n        return (None, None, None)\n\n    libname = os.path.basename(dest)\n    install_dir = os.path.dirname(dest)\n    shlib_suffix = env.subst('$SHLIBSUFFIX')\n    # See if the source name is a versioned shared library, get the version number\n    result = False\n\n    version_re = re.compile(\"[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z]+\")\n    version_File = None\n    if platform == 'posix':\n        # handle unix names\n        versioned_re = re.compile(re.escape(shlib_suffix + '.') + \"[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z]+\")\n        result = versioned_re.findall(libname)\n        if result:\n            version_File = version_re.findall(versioned_re.findall(libname)[-1])[-1]\n    elif platform == 'darwin':\n        # handle OSX names\n        versioned_re = re.compile(\"\\\\.[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z]+\" + re.escape(shlib_suffix) )\n        result = versioned_re.findall(libname)\n        if result:\n            version_File = version_re.findall(versioned_re.findall(libname)[-1])[-1]\n\n    if Verbose:\n        print \"install: version_File \", version_File\n    # result is False if we did not find a versioned shared library name, so return and empty list\n    if not result:\n        return (None, libname, install_dir)\n\n    version = None\n    # get version number from the environment\n    try:\n        version = env.subst('$SHLIBVERSION')\n    except KeyError:\n        version = None\n\n    if version != version_File:\n        #raise SCons.Errors.UserError(\"SHLIBVERSION '%s' does not match the version # '%s' in the filename\" % (version, version_File) )\n        print \"SHLIBVERSION '%s' does not match the version # '%s' in the filename, proceeding based on file name\" % (version, version_File)\n        version = version_File\n    return (version, libname, install_dir)\n\ndef versionedLibLinks(dest, source, env):\n    \"\"\"If we are installing a versioned shared library create the required links.\"\"\"\n    Verbose = False\n    linknames = []\n    version, libname, install_dir = versionedLibVersion(dest, env)\n\n    if version != None:\n        # libname includes the version number if one was given\n        linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)\n        if Verbose:\n            print \"versionedLibLinks: linknames \",linknames\n        # Here we just need the file name w/o path as the target of the link\n        lib_ver = libname\n        # make symlink of adjacent names in linknames\n        for count in range(len(linknames)):\n            linkname = linknames[count]\n            fulllinkname = os.path.join(install_dir, linkname)\n            if Verbose:\n                print \"full link name \",fulllinkname\n            if count > 0:\n                try:\n                    os.remove(lastlinkname)\n                except:\n                    pass\n                os.symlink(os.path.basename(fulllinkname),lastlinkname)\n                if Verbose:\n                    print \"versionedLibLinks: made sym link of %s -> %s\" % (lastlinkname,os.path.basename(fulllinkname))\n            lastlinkname = fulllinkname\n        # finish chain of sym links with link to the actual library\n        if len(linknames)>0:\n            try:\n                os.remove(lastlinkname)\n            except:\n                pass\n            os.symlink(lib_ver,lastlinkname)\n            if Verbose:\n                print \"versionedLibLinks: made sym link of %s -> %s\" % (lib_ver,lastlinkname)\n    return\n\ndef installFunc(target, source, env):\n    \"\"\"Install a source file into a target using the function specified\n    as the INSTALL construction variable.\"\"\"\n    try:\n        install = env['INSTALL']\n    except KeyError:\n        raise SCons.Errors.UserError('Missing INSTALL construction variable.')\n\n    assert len(target)==len(source), \\\n           \"Installing source %s into target %s: target and source lists must have same length.\"%(list(map(str, source)), list(map(str, target)))\n    for t,s in zip(target,source):\n        if install(t.get_path(),s.get_path(),env):\n            return 1\n\n    return 0\n\ndef installFuncVersionedLib(target, source, env):\n    \"\"\"Install a versioned library into a target using the function specified\n    as the INSTALLVERSIONEDLIB construction variable.\"\"\"\n    try:\n        install = env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        raise SCons.Errors.UserError('Missing INSTALLVERSIONEDLIB construction variable.')\n\n    assert len(target)==len(source), \\\n           \"Installing source %s into target %s: target and source lists must have same length.\"%(list(map(str, source)), list(map(str, target)))\n    for t,s in zip(target,source):\n        if install(t.get_path(),s.get_path(),env):\n            return 1\n\n    return 0\n\ndef stringFunc(target, source, env):\n    installstr = env.get('INSTALLSTR')\n    if installstr:\n        return env.subst_target_source(installstr, 0, target, source)\n    target = str(target[0])\n    source = str(source[0])\n    if os.path.isdir(source):\n        type = 'directory'\n    else:\n        type = 'file'\n    return 'Install %s: \"%s\" as \"%s\"' % (type, source, target)\n\n#\n# Emitter functions\n#\ndef add_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" an emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    _INSTALLED_FILES.extend(target)\n\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\ndef add_versioned_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" an emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    Verbose = False\n    _INSTALLED_FILES.extend(target)\n    if Verbose:\n        print \"ver lib emitter \",repr(target)\n\n    # see if we have a versioned shared library, if so generate side effects\n    version, libname, install_dir = versionedLibVersion(target[0].path, env)\n    if version != None:\n        # generate list of link names\n        linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)\n        for linkname in linknames:\n            if Verbose:\n                print \"make side effect of %s\" % os.path.join(install_dir, linkname)\n            fulllinkname = os.path.join(install_dir, linkname)\n            env.SideEffect(fulllinkname,target[0])\n            env.Clean(target[0],fulllinkname)\n            _INSTALLED_FILES.append(fulllinkname)\n            if Verbose:\n                print \"installed list \", _INSTALLED_FILES\n\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\nclass DESTDIR_factory(object):\n    \"\"\" a node factory, where all files will be relative to the dir supplied\n    in the constructor.\n    \"\"\"\n    def __init__(self, env, dir):\n        self.env = env\n        self.dir = env.arg2nodes( dir, env.fs.Dir )[0]\n\n    def Entry(self, name):\n        name = make_path_relative(name)\n        return self.dir.Entry(name)\n\n    def Dir(self, name):\n        name = make_path_relative(name)\n        return self.dir.Dir(name)\n\n#\n# The Builder Definition\n#\ninstall_action       = SCons.Action.Action(installFunc, stringFunc)\ninstallas_action     = SCons.Action.Action(installFunc, stringFunc)\ninstallVerLib_action = SCons.Action.Action(installFuncVersionedLib, stringFunc)\n\nBaseInstallBuilder               = None\n\ndef InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            #tgt.extend(BaseInstallBuilder(env, target, src, **kw))\n            tgt.extend(BaseInstallBuilder(env, target, src, **kw))\n    return tgt\n\ndef InstallAsBuilderWrapper(env, target=None, source=None, **kw):\n    result = []\n    for src, tgt in map(lambda x, y: (x, y), source, target):\n        #result.extend(BaseInstallBuilder(env, tgt, src, **kw))\n        result.extend(BaseInstallBuilder(env, tgt, src, **kw))\n    return result\n\nBaseVersionedInstallBuilder = None\n\ndef InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            tgt.extend(BaseVersionedInstallBuilder(env, target, src, **kw))\n    return tgt\n\nadded = None\n\ndef generate(env):\n\n    from SCons.Script import AddOption, GetOption\n    global added\n    if not added:\n        added = 1\n        AddOption('--install-sandbox',\n                  dest='install_sandbox',\n                  type=\"string\",\n                  action=\"store\",\n                  help='A directory under which all installed files will be placed.')\n\n    global BaseInstallBuilder\n    if BaseInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseInstallBuilder = SCons.Builder.Builder(\n                              action         = install_action,\n                              target_factory = target_factory.Entry,\n                              source_factory = env.fs.Entry,\n                              multi          = 1,\n                              emitter        = [ add_targets_to_INSTALLED_FILES, ],\n                              name           = 'InstallBuilder')\n\n    global BaseVersionedInstallBuilder\n    if BaseVersionedInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseVersionedInstallBuilder = SCons.Builder.Builder(\n                                       action         = installVerLib_action,\n                                       target_factory = target_factory.Entry,\n                                       source_factory = env.fs.Entry,\n                                       multi          = 1,\n                                       emitter        = [ add_versioned_targets_to_INSTALLED_FILES, ],\n                                       name           = 'InstallVersionedBuilder')\n\n    env['BUILDERS']['_InternalInstall'] = InstallBuilderWrapper\n    env['BUILDERS']['_InternalInstallAs'] = InstallAsBuilderWrapper\n    env['BUILDERS']['_InternalInstallVersionedLib'] = InstallVersionedBuilderWrapper\n\n    # We'd like to initialize this doing something like the following,\n    # but there isn't yet support for a ${SOURCE.type} expansion that\n    # will print \"file\" or \"directory\" depending on what's being\n    # installed.  For now we punt by not initializing it, and letting\n    # the stringFunc() that we put in the action fall back to the\n    # hand-crafted default string if it's not set.\n    #\n    #try:\n    #    env['INSTALLSTR']\n    #except KeyError:\n    #    env['INSTALLSTR'] = 'Install ${SOURCE.type}: \"$SOURCES\" as \"$TARGETS\"'\n\n    try:\n        env['INSTALL']\n    except KeyError:\n        env['INSTALL']    = copyFunc\n\n    try:\n        env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        env['INSTALLVERSIONEDLIB']    = copyFuncVersionedLib\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/intelc.py",
    "content": "\"\"\"SCons.Tool.icl\n\nTool-specific initialization for the Intel C/C++ compiler.\nSupports Linux and Windows compilers, v7 and up.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import division\n\n__revision__ = \"src/engine/SCons/Tool/intelc.py  2014/07/05 09:42:21 garyo\"\n\nimport math, sys, os.path, glob, string, re\n\nis_windows = sys.platform == 'win32'\nis_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or\n                           ('PROCESSOR_ARCHITEW6432' in os.environ and\n                            os.environ['PROCESSOR_ARCHITEW6432'] == 'AMD64'))\nis_linux = sys.platform.startswith('linux')\nis_mac     = sys.platform == 'darwin'\n\nif is_windows:\n    import SCons.Tool.msvc\nelif is_linux:\n    import SCons.Tool.gcc\nelif is_mac:\n    import SCons.Tool.gcc\nimport SCons.Util\nimport SCons.Warnings\n\n# Exceptions for this tool\nclass IntelCError(SCons.Errors.InternalError):\n    pass\nclass MissingRegistryError(IntelCError): # missing registry entry\n    pass\nclass MissingDirError(IntelCError):     # dir not found\n    pass\nclass NoRegistryModuleError(IntelCError): # can't read registry at all\n    pass\n\ndef uniquify(s):\n    \"\"\"Return a sequence containing only one copy of each unique element from input sequence s.\n    Does not preserve order.\n    Input sequence must be hashable (i.e. must be usable as a dictionary key).\"\"\"\n    u = {}\n    for x in s:\n        u[x] = 1\n    return list(u.keys())\n\ndef linux_ver_normalize(vstr):\n    \"\"\"Normalize a Linux compiler version number.\n    Intel changed from \"80\" to \"9.0\" in 2005, so we assume if the number\n    is greater than 60 it's an old-style number and otherwise new-style.\n    Always returns an old-style float like 80 or 90 for compatibility with Windows.\n    Shades of Y2K!\"\"\"\n    # Check for version number like 9.1.026: return 91.026\n    # XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5)\n    m = re.match(r'([0-9]+)\\.([0-9]+)\\.([0-9]+)', vstr)\n    if m:\n        vmaj,vmin,build = m.groups()\n        return float(vmaj) * 10. + float(vmin) + float(build) / 1000.;\n    else:\n        f = float(vstr)\n        if is_windows:\n            return f\n        else:\n            if f < 60: return f * 10.0\n            else: return f\n\ndef check_abi(abi):\n    \"\"\"Check for valid ABI (application binary interface) name,\n    and map into canonical one\"\"\"\n    if not abi:\n        return None\n    abi = abi.lower()\n    # valid_abis maps input name to canonical name\n    if is_windows:\n        valid_abis = {'ia32'  : 'ia32',\n                      'x86'   : 'ia32',\n                      'ia64'  : 'ia64',\n                      'em64t' : 'em64t',\n                      'amd64' : 'em64t'}\n    if is_linux:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64',\n                      'amd64'  : 'x86_64'}\n    if is_mac:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64'}\n    try:\n        abi = valid_abis[abi]\n    except KeyError:\n        raise SCons.Errors.UserError(\"Intel compiler: Invalid ABI %s, valid values are %s\"% \\\n              (abi, list(valid_abis.keys())))\n    return abi\n\ndef vercmp(a, b):\n    \"\"\"Compare strings as floats,\n    but Intel changed Linux naming convention at 9.0\"\"\"\n    return cmp(linux_ver_normalize(b), linux_ver_normalize(a))\n\ndef get_version_from_list(v, vlist):\n    \"\"\"See if we can match v (string) in vlist (list of strings)\n    Linux has to match in a fuzzy way.\"\"\"\n    if is_windows:\n        # Simple case, just find it in the list\n        if v in vlist: return v\n        else: return None\n    else:\n        # Fuzzy match: normalize version number first, but still return\n        # original non-normalized form.\n        fuzz = 0.001\n        for vi in vlist:\n            if math.fabs(linux_ver_normalize(vi) - linux_ver_normalize(v)) < fuzz:\n                return vi\n        # Not found\n        return None\n\ndef get_intel_registry_value(valuename, version=None, abi=None):\n    \"\"\"\n    Return a value from the Intel compiler registry tree. (Windows only)\n    \"\"\"\n    # Open the key:\n    if is_win64:\n        K = 'Software\\\\Wow6432Node\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    else:\n        K = 'Software\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    try:\n        k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n    except SCons.Util.RegError:\n        # For version 13 and later, check UUID subkeys for valuename\n        if is_win64:\n            K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        else:\n            K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            uuid = SCons.Util.RegQueryValueEx(k, 'SubKey')[0]\n\n            if is_win64:\n                K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            else:\n                K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                if abi.upper() == 'EM64T':\n                    abi = 'em64t_native'\n                if is_win64:\n                    K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                else:\n                    K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n        except SCons.Util.RegError:\n            raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n        except WindowsError:\n            raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n    # Get the value:\n    try:\n        v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n        return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n    except SCons.Util.RegError:\n        raise MissingRegistryError(\"%s\\\\%s was not found in the registry.\"%(K, valuename))\n\n\ndef get_all_compiler_versions():\n    \"\"\"Returns a sorted list of strings, like \"70\" or \"80\" or \"9.0\"\n    with most recent compiler version first.\n    \"\"\"\n    versions=[]\n    if is_windows:\n        if is_win64:\n            keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Compilers\\\\C++'\n        else:\n            keyname = 'Software\\\\Intel\\\\Compilers\\\\C++'\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                        keyname)\n        except WindowsError:\n            # For version 13 or later, check for default instance UUID\n            if is_win64:\n                keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Suites'\n            else:\n                keyname = 'Software\\\\Intel\\\\Suites'\n            try:\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                            keyname)\n            except WindowsError:\n                return []\n        i = 0\n        versions = []\n        try:\n            while i < 100:\n                subkey = SCons.Util.RegEnumKey(k, i) # raises EnvironmentError\n                # Check that this refers to an existing dir.\n                # This is not 100% perfect but should catch common\n                # installation issues like when the compiler was installed\n                # and then the install directory deleted or moved (rather\n                # than uninstalling properly), so the registry values\n                # are still there.\n                if subkey == 'Defaults': # Ignore default instances\n                    i = i + 1\n                    continue\n                ok = False\n                for try_abi in ('IA32', 'IA32e',  'IA64', 'EM64T'):\n                    try:\n                        d = get_intel_registry_value('ProductDir', subkey, try_abi)\n                    except MissingRegistryError:\n                        continue  # not found in reg, keep going\n                    if os.path.exists(d): ok = True\n                if ok:\n                    versions.append(subkey)\n                else:\n                    try:\n                        # Registry points to nonexistent dir.  Ignore this\n                        # version.\n                        value = get_intel_registry_value('ProductDir', subkey, 'IA32')\n                    except MissingRegistryError, e:\n\n                        # Registry key is left dangling (potentially\n                        # after uninstalling).\n\n                        print \\\n                            \"scons: *** Ignoring the registry key for the Intel compiler version %s.\\n\" \\\n                            \"scons: *** It seems that the compiler was uninstalled and that the registry\\n\" \\\n                            \"scons: *** was not cleaned up properly.\\n\" % subkey\n                    else:\n                        print \"scons: *** Ignoring \"+str(value)\n\n                i = i + 1\n        except EnvironmentError:\n            # no more subkeys\n            pass\n    elif is_linux or is_mac:\n        for d in glob.glob('/opt/intel_cc_*'):\n            # Typical dir here is /opt/intel_cc_80.\n            m = re.search(r'cc_(.*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/cc*/*'):\n            # Typical dir here is /opt/intel/cc/9.0 for IA32,\n            # /opt/intel/cce/9.0 for EMT64 (AMD64)\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/Compiler/*'):\n            # Typical dir here is /opt/intel/Compiler/11.1\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composerxe-*'):\n            # Typical dir here is /opt/intel/composerxe-2011.4.184\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composer_xe_*'):\n            # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n            # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n            m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(\"%s.%s\"%(m.group(1), m.group(2)))\n    def keyfunc(str):\n        \"\"\"Given a dot-separated version string, return a tuple of ints representing it.\"\"\"\n        return [int(x) for x in str.split('.')]\n    # split into ints, sort, then remove dups\n    return sorted(uniquify(versions), key=keyfunc, reverse=True)\n\ndef get_intel_compiler_top(version, abi):\n    \"\"\"\n    Return the main path to the top-level dir of the Intel compiler,\n    using the given version.\n    The compiler will be in <top>/bin/icl.exe (icc on linux),\n    the include dir is <top>/include, etc.\n    \"\"\"\n\n    if is_windows:\n        if not SCons.Util.can_read_reg:\n            raise NoRegistryModuleError(\"No Windows registry module was found\")\n        top = get_intel_registry_value('ProductDir', version, abi)\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        # pre-11, icl was in Bin.  11 and later, it's in Bin/<abi> apparently.\n        if not os.path.exists(os.path.join(top, \"Bin\", \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", abi, \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", archdir, \"icl.exe\")):\n            raise MissingDirError(\"Can't find Intel compiler in %s\"%(top))\n    elif is_mac or is_linux:\n        def find_in_2008style_dir(version):\n            # first dir is new (>=9.0) style, second is old (8.0) style.\n            dirs=('/opt/intel/cc/%s', '/opt/intel_cc_%s')\n            if abi == 'x86_64':\n                dirs=('/opt/intel/cce/%s',)  # 'e' stands for 'em64t', aka x86_64 aka amd64\n            top=None\n            for d in dirs:\n                if os.path.exists(os.path.join(d%version, \"bin\", \"icc\")):\n                    top = d%version\n                    break\n            return top\n        def find_in_2010style_dir(version):\n            dirs=('/opt/intel/Compiler/%s/*'%version)\n            # typically /opt/intel/Compiler/11.1/064 (then bin/intel64/icc)\n            dirs=glob.glob(dirs)\n            # find highest sub-version number by reverse sorting and picking first existing one.\n            dirs.sort()\n            dirs.reverse()\n            top=None\n            for d in dirs:\n                if (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                    os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                    top = d\n                    break\n            return top\n        def find_in_2011style_dir(version):\n            # The 2011 (compiler v12) dirs are inconsistent, so just redo the search from\n            # get_all_compiler_versions and look for a match (search the newest form first)\n            top=None\n            for d in glob.glob('/opt/intel/composer_xe_*'):\n                # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n                # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n                m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n                if m:\n                    cur_ver = \"%s.%s\"%(m.group(1), m.group(2))\n                    if cur_ver == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                        top = d\n                        break\n            if not top:\n                for d in glob.glob('/opt/intel/composerxe-*'):\n                    # Typical dir here is /opt/intel/composerxe-2011.4.184\n                    m = re.search(r'([0-9][0-9.]*)$', d)\n                    if m and m.group(1) == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                            top = d\n                            break\n            return top\n        top = find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version)\n        # print \"INTELC: top=\",top\n        if not top:\n            raise MissingDirError(\"Can't find version %s Intel compiler in %s (abi='%s')\"%(version,top, abi))\n    return top\n\n\ndef generate(env, version=None, abi=None, topdir=None, verbose=0):\n    \"\"\"Add Builders and construction variables for Intel C/C++ compiler\n    to an Environment.\n    args:\n      version: (string) compiler version to use, like \"80\"\n      abi:     (string) 'win32' or whatever Itanium version wants\n      topdir:  (string) compiler top dir, like\n                         \"c:\\Program Files\\Intel\\Compiler70\"\n                        If topdir is used, version and abi are ignored.\n      verbose: (int)    if >0, prints compiler version used.\n    \"\"\"\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return\n\n    if is_windows:\n        SCons.Tool.msvc.generate(env)\n    elif is_linux:\n        SCons.Tool.gcc.generate(env)\n    elif is_mac:\n        SCons.Tool.gcc.generate(env)\n\n    # if version is unspecified, use latest\n    vlist = get_all_compiler_versions()\n    if not version:\n        if vlist:\n            version = vlist[0]\n    else:\n        # User may have specified '90' but we need to get actual dirname '9.0'.\n        # get_version_from_list does that mapping.\n        v = get_version_from_list(version, vlist)\n        if not v:\n            raise SCons.Errors.UserError(\"Invalid Intel compiler version %s: \"%version + \\\n                  \"installed versions are %s\"%(', '.join(vlist)))\n        version = v\n\n    # if abi is unspecified, use ia32\n    # alternatives are ia64 for Itanium, or amd64 or em64t or x86_64 (all synonyms here)\n    abi = check_abi(abi)\n    if abi is None:\n        if is_mac or is_linux:\n            # Check if we are on 64-bit linux, default to 64 then.\n            uname_m = os.uname()[4]\n            if uname_m == 'x86_64':\n                abi = 'x86_64'\n            else:\n                abi = 'ia32'\n        else:\n            if is_win64:\n                abi = 'em64t'\n            else:\n                abi = 'ia32'\n\n    if version and not topdir:\n        try:\n            topdir = get_intel_compiler_top(version, abi)\n        except (SCons.Util.RegError, IntelCError):\n            topdir = None\n\n    if not topdir:\n        # Normally this is an error, but it might not be if the compiler is\n        # on $PATH and the user is importing their env.\n        class ICLTopDirWarning(SCons.Warnings.Warning):\n            pass\n        if (is_mac or is_linux) and not env.Detect('icc') or \\\n           is_windows and not env.Detect('icl'):\n\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(ICLTopDirWarning,\n                                \"Failed to find Intel compiler for version='%s', abi='%s'\"%\n                                (str(version), str(abi)))\n        else:\n            # should be cleaned up to say what this other version is\n            # since in this case we have some other Intel compiler installed\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(ICLTopDirWarning,\n                                \"Can't find Intel compiler top dir for version='%s', abi='%s'\"%\n                                    (str(version), str(abi)))\n\n    if topdir:\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        if os.path.exists(os.path.join(topdir, 'bin', archdir)):\n            bindir=\"bin/%s\"%archdir\n            libdir=\"lib/%s\"%archdir\n        else:\n            bindir=\"bin\"\n            libdir=\"lib\"\n        if verbose:\n            print \"Intel C compiler: using version %s (%g), abi %s, in '%s/%s'\"%\\\n                  (repr(version), linux_ver_normalize(version),abi,topdir,bindir)\n            if is_linux:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n            if is_mac:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n\n        env['INTEL_C_COMPILER_TOP'] = topdir\n        if is_linux:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p in paths.keys():\n                env.PrependENVPath(p, os.path.join(topdir, paths[p]))\n        if is_mac:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p in paths.keys():\n                env.PrependENVPath(p, os.path.join(topdir, paths[p]))\n        if is_windows:\n            #       env key    reg valname   default subdir of top\n            paths=(('INCLUDE', 'IncludeDir', 'Include'),\n                   ('LIB'    , 'LibDir',     'Lib'),\n                   ('PATH'   , 'BinDir',     'Bin'))\n            # We are supposed to ignore version if topdir is set, so set\n            # it to the emptry string if it's not already set.\n            if version is None:\n                version = ''\n            # Each path has a registry entry, use that or default to subdir\n            for p in paths:\n                try:\n                    path=get_intel_registry_value(p[1], version, abi)\n                    # These paths may have $(ICInstallDir)\n                    # which needs to be substituted with the topdir.\n                    path=path.replace('$(ICInstallDir)', topdir + os.sep)\n                except IntelCError:\n                    # Couldn't get it from registry: use default subdir of topdir\n                    env.PrependENVPath(p[0], os.path.join(topdir, p[2]))\n                else:\n                    env.PrependENVPath(p[0], path.split(os.pathsep))\n                    # print \"ICL %s: %s, final=%s\"%(p[0], path, str(env['ENV'][p[0]]))\n\n    if is_windows:\n        env['CC']        = 'icl'\n        env['CXX']       = 'icl'\n        env['LINK']      = 'xilink'\n    else:\n        env['CC']        = 'icc'\n        env['CXX']       = 'icpc'\n        # Don't reset LINK here;\n        # use smart_link which should already be here from link.py.\n        #env['LINK']      = '$CC'\n        env['AR']        = 'xiar'\n        env['LD']        = 'xild' # not used by default\n\n    # This is not the exact (detailed) compiler version,\n    # just the major version as determined above or specified\n    # by the user.  It is a float like 80 or 90, in normalized form for Linux\n    # (i.e. even for Linux 9.0 compiler, still returns 90 rather than 9.0)\n    if version:\n        env['INTEL_C_COMPILER_VERSION']=linux_ver_normalize(version)\n\n    if is_windows:\n        # Look for license file dir\n        # in system environment, registry, and default location.\n        envlicdir = os.environ.get(\"INTEL_LICENSE_FILE\", '')\n        K = ('SOFTWARE\\Intel\\Licenses')\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            reglicdir = SCons.Util.RegQueryValueEx(k, \"w_cpp\")[0]\n        except (AttributeError, SCons.Util.RegError):\n            reglicdir = \"\"\n        defaultlicdir = r'C:\\Program Files\\Common Files\\Intel\\Licenses'\n\n        licdir = None\n        for ld in [envlicdir, reglicdir]:\n            # If the string contains an '@', then assume it's a network\n            # license (port@system) and good by definition.\n            if ld and (ld.find('@') != -1 or os.path.exists(ld)):\n                licdir = ld\n                break\n        if not licdir:\n            licdir = defaultlicdir\n            if not os.path.exists(licdir):\n                class ICLLicenseDirWarning(SCons.Warnings.Warning):\n                    pass\n                SCons.Warnings.enableWarningClass(ICLLicenseDirWarning)\n                SCons.Warnings.warn(ICLLicenseDirWarning,\n                                    \"Intel license dir was not found.\"\n                                    \"  Tried using the INTEL_LICENSE_FILE environment variable (%s), the registry (%s) and the default path (%s).\"\n                                    \"  Using the default path as a last resort.\"\n                                        % (envlicdir, reglicdir, defaultlicdir))\n        env['ENV']['INTEL_LICENSE_FILE'] = licdir\n\ndef exists(env):\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return 0\n\n    try:\n        versions = get_all_compiler_versions()\n    except (SCons.Util.RegError, IntelCError):\n        versions = None\n    detected = versions is not None and len(versions) > 0\n    if not detected:\n        # try env.Detect, maybe that will work\n        if is_windows:\n            return env.Detect('icl')\n        elif is_linux:\n            return env.Detect('icc')\n        elif is_mac:\n            return env.Detect('icc')\n    return detected\n\n# end of file\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/lex.py",
    "content": "\"\"\"SCons.Tool.lex\n\nTool-specific initialization for lex.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/lex.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Util\n\nLexAction = SCons.Action.Action(\"$LEXCOM\", \"$LEXCOMSTR\")\n\ndef lexEmitter(target, source, env):\n    sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0]))\n\n    if sourceExt == \".lm\":           # If using Objective-C\n        target = [sourceBase + \".m\"] # the extension is \".m\".\n\n    # This emitter essentially tries to add to the target all extra\n    # files generated by flex.\n\n    # Different options that are used to trigger the creation of extra files.\n    fileGenOptions = [\"--header-file=\", \"--tables-file=\"]\n\n    lexflags = env.subst(\"$LEXFLAGS\", target=target, source=source)\n    for option in SCons.Util.CLVar(lexflags):\n        for fileGenOption in fileGenOptions:\n            l = len(fileGenOption)\n            if option[:l] == fileGenOption:\n                # A file generating option is present, so add the\n                # file name to the target list.\n                fileName = option[l:].strip()\n                target.append(fileName)\n    return (target, source)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lex to an Environment.\"\"\"\n    c_file, cxx_file = SCons.Tool.createCFileBuilders(env)\n\n    # C\n    c_file.add_action(\".l\", LexAction)\n    c_file.add_emitter(\".l\", lexEmitter)\n\n    c_file.add_action(\".lex\", LexAction)\n    c_file.add_emitter(\".lex\", lexEmitter)\n\n    # Objective-C\n    cxx_file.add_action(\".lm\", LexAction)\n    cxx_file.add_emitter(\".lm\", lexEmitter)\n\n    # C++\n    cxx_file.add_action(\".ll\", LexAction)\n    cxx_file.add_emitter(\".ll\", lexEmitter)\n\n    env[\"LEX\"]      = env.Detect(\"flex\") or \"lex\"\n    env[\"LEXFLAGS\"] = SCons.Util.CLVar(\"\")\n    env[\"LEXCOM\"] = \"$LEX $LEXFLAGS -t $SOURCES > $TARGET\"\n\ndef exists(env):\n    return env.Detect([\"flex\", \"lex\"])\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/link.py",
    "content": "\"\"\"SCons.Tool.link\n\nTool-specific initialization for the generic Posix linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/link.py  2014/07/05 09:42:21 garyo\"\n\nimport re\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\ndef isfortran(env, source): return False\ndef isD(env,source): return False\n\nissued_mixed_link_warning = False\n\ndef smart_link(source, target, env, for_signature):\n    has_cplusplus = cplusplus.iscplusplus(source)\n    has_fortran = isfortran(env, source)\n    has_d = isD(env, source)\n    if has_cplusplus and has_fortran and not has_d:\n        global issued_mixed_link_warning\n        if not issued_mixed_link_warning:\n            msg = \"Using $CXX to link Fortran and C++ code together.\\n\\t\" + \\\n              \"This may generate a buggy executable if the '%s'\\n\\t\" + \\\n              \"compiler does not know how to deal with Fortran runtimes.\"\n            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,\n                                msg % env.subst('$CXX'))\n            issued_mixed_link_warning = True\n        return '$CXX'\n    elif has_d:\n        env['LINKCOM'] = env['DLINKCOM']\n        env['SHLINKCOM'] = env['SHDLINKCOM']\n        return '$DC'\n    elif has_fortran:\n        return '$FORTRAN'\n    elif has_cplusplus:\n        return '$CXX'\n    return '$CC'\n\ndef shlib_emitter(target, source, env):\n    Verbose = False\n    platform = env.subst('$PLATFORM')\n    for tgt in target:\n        tgt.attributes.shared = 1\n    try:\n        # target[0] comes in as libtest.so. Add the version extensions\n        version = env.subst('$SHLIBVERSION')\n        if version:\n            version_names = shlib_emitter_names(target, source, env)\n            # change the name of the target to include the version number\n            target[0].name = version_names[0]\n            for name in version_names:\n                env.SideEffect(name, target[0])\n                env.Clean(target[0], name)\n                if Verbose:\n                    print \"shlib_emitter: add side effect - \",name\n    except KeyError:\n        version = None\n    return (target, source)\n\ndef shlib_emitter_names(target, source, env):\n    \"\"\"Return list of file names that are side effects for a versioned library build. The first name in the list is the new name for the target\"\"\"\n    Verbose = False\n    platform = env.subst('$PLATFORM')\n    version_names = []\n    try:\n        # target[0] comes in as libtest.so. Add the version extensions\n        version = env.subst('$SHLIBVERSION')\n        if version.count(\".\") != 2:\n            # We need a version of the form x.y.z to proceed\n            raise ValueError\n        if version:\n            if platform == 'posix':\n                versionparts = version.split('.')\n                name = target[0].name\n                # generate library name with the version number\n                version_name = target[0].name + '.' + version\n                if Verbose:\n                    print \"shlib_emitter_names: target is \", version_name\n                    print \"shlib_emitter_names: side effect: \", name\n                # add version_name to list of names to be a Side effect\n                version_names.append(version_name)\n                if Verbose:\n                    print \"shlib_emitter_names: versionparts \",versionparts\n                for ver in versionparts[0:-1]:\n                    name = name + '.' + ver\n                    if Verbose:\n                        print \"shlib_emitter_names: side effect: \", name\n                    # add name to list of names to be a Side effect\n                    version_names.append(name)\n            elif platform == 'darwin':\n                shlib_suffix = env.subst('$SHLIBSUFFIX')\n                name = target[0].name\n                # generate library name with the version number\n                suffix_re = re.escape(shlib_suffix)\n                version_name = re.sub(suffix_re, '.' + version + shlib_suffix, name)\n                if Verbose:\n                    print \"shlib_emitter_names: target is \", version_name\n                    print \"shlib_emitter_names: side effect: \", name\n                # add version_name to list of names to be a Side effect\n                version_names.append(version_name)\n            elif platform == 'cygwin':\n                shlib_suffix = env.subst('$SHLIBSUFFIX')\n                name = target[0].name\n                # generate library name with the version number\n                suffix_re = re.escape(shlib_suffix)\n                version_name = re.sub(suffix_re, '-' + re.sub('\\.', '-', version) + shlib_suffix, name)\n                if Verbose:\n                    print \"shlib_emitter_names: target is \", version_name\n                    print \"shlib_emitter_names: side effect: \", name\n                # add version_name to list of names to be a Side effect\n                version_names.append(version_name)\n\n    except KeyError:\n        version = None\n    return version_names\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM']   = '$SHLINK -o $TARGET $SHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    # don't set up the emitter, cause AppendUnique will generate a list\n    # starting with None :-(\n    env.Append(SHLIBEMITTER = [shlib_emitter])\n    env['SMARTLINK']   = smart_link\n    env['LINK']        = \"$SMARTLINK\"\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    # __RPATH is only set to something ($_RPATH typically) on platforms that support it.\n    env['LINKCOM']     = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX']='-L'\n    env['LIBDIRSUFFIX']=''\n    env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'\n    env['LIBLINKPREFIX']='-l'\n    env['LIBLINKSUFFIX']=''\n\n    if env['PLATFORM'] == 'hpux':\n        env['SHLIBSUFFIX'] = '.sl'\n    elif env['PLATFORM'] == 'aix':\n        env['SHLIBSUFFIX'] = '.a'\n\n    # For most platforms, a loadable module is the same as a shared\n    # library.  Platforms which are different can override these, but\n    # setting them the same means that LoadableModule works everywhere.\n    SCons.Tool.createLoadableModuleBuilder(env)\n    env['LDMODULE'] = '$SHLINK'\n    # don't set up the emitter, cause AppendUnique will generate a list\n    # starting with None :-(\n    env.Append(LDMODULEEMITTER='$SHLIBEMITTER')\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n\n\ndef exists(env):\n    # This module isn't really a Tool on its own, it's common logic for\n    # other linkers.\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/linkloc.py",
    "content": "\"\"\"SCons.Tool.linkloc\n\nTool specification for the LinkLoc linker for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/linkloc.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\nimport re\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Tool\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon import msvs_exists, merge_default_version\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\n\n_re_linker_command = re.compile(r'(\\s)@\\s*([^\\s]+)')\n\ndef repl_linker_command(m):\n    # Replaces any linker command file directives (e.g. \"@foo.lnk\") with\n    # the actual contents of the file.\n    try:\n        f=open(m.group(2), \"r\")\n        return m.group(1) + f.read()\n    except IOError:\n        # the linker should return an error if it can't\n        # find the linker command file so we will remain quiet.\n        # However, we will replace the @ with a # so we will not continue\n        # to find it with recursive substitution\n        return m.group(1) + '#' + m.group(2)\n\nclass LinklocGenerator(object):\n    def __init__(self, cmdline):\n        self.cmdline = cmdline\n\n    def __call__(self, env, target, source, for_signature):\n        if for_signature:\n            # Expand the contents of any linker command files recursively\n            subs = 1\n            strsub = env.subst(self.cmdline, target=target, source=source)\n            while subs:\n                strsub, subs = _re_linker_command.subn(repl_linker_command, strsub)\n            return strsub\n        else:\n            return \"${TEMPFILE('\" + self.cmdline + \"')}\"\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SUBST_CMD_FILE'] = LinklocGenerator\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS')\n    env['SHLINKCOM']   = '${SUBST_CMD_FILE(\"$SHLINK $SHLINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -dll $TARGET $SOURCES\")}'\n    env['SHLIBEMITTER']= None\n    env['LINK']        = \"linkloc\"\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '${SUBST_CMD_FILE(\"$LINK $LINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -exe $TARGET $SOURCES\")}'\n    env['LIBDIRPREFIX']='-libpath '\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']='-lib '\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n    # Set-up ms tools paths for default version\n    merge_default_version(env)\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    if msvs_exists():\n        return env.Detect('linkloc')\n    else:\n        return 0\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/m4.py",
    "content": "\"\"\"SCons.Tool.m4\n\nTool-specific initialization for m4.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/m4.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for m4 to an Environment.\"\"\"\n    M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR')\n    bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4')\n\n    env['BUILDERS']['M4'] = bld\n\n    # .m4 files might include other files, and it would be pretty hard\n    # to write a scanner for it, so let's just cd to the dir of the m4\n    # file and run from there.\n    # The src_suffix setup is like so: file.c.m4 -> file.c,\n    # file.cpp.m4 -> file.cpp etc.\n    env['M4']      = 'm4'\n    env['M4FLAGS'] = SCons.Util.CLVar('-E')\n    env['M4COM']   = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}'\n\ndef exists(env):\n    return env.Detect('m4')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/masm.py",
    "content": "\"\"\"SCons.Tool.masm\n\nTool-specific initialization for the Microsoft Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/masm.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for masm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = 'ml'\n    env['ASFLAGS']   = SCons.Util.CLVar('/nologo')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('ml')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mingw.py",
    "content": "\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for MinGW (http://www.mingw.org/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mingw.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n\ndef find(env):\n    # Nuitka: Check for MinGW64.\n    key_program = 'gcc'\n\n    # First search in the SCons path\n    path=env.WhereIs(key_program)\n    if (path):\n        return path\n    # then the OS path:\n    path=SCons.Util.WhereIs(key_program)\n    if (path):\n        return path\n\n    # If that doesn't work try default location for mingw\n    save_path = env['ENV']['PATH']\n\n    # This should allow installing both into the same place and picking arch\n    # just automatically.\n    if env[\"TARGET_ARCH\"] == \"x86_64\":\n        env.AppendENVPath('PATH',r'c:\\MinGW64\\mingw64\\bin')\n        env.AppendENVPath('PATH',r'\\MinGW64\\mingw64\\bin')\n    else:\n        env.AppendENVPath('PATH',r'c:\\MinGW64\\mingw32\\bin')\n        env.AppendENVPath('PATH',r'\\MinGW64\\mingw32\\bin')\n\n    # Older versions of MinGW just has this.\n    env.AppendENVPath('PATH',r'c:\\MinGW64\\bin')\n    env.AppendENVPath('PATH',r'\\MinGW64\\bin')\n\n    path =env.WhereIs(key_program)\n    if not path:\n        env['ENV']['PATH'] = save_path\n    return path\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    # Nuitka: Disable implib here, we do it manually.\n    # implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    # if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))\n\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if not insert_def in ['', '0', 0] and def_target: \\\n        cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))\n\n    return [cmd]\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$SHLIBSUFFIX\"))\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n\n        # Create list of target libraries as strings\n        targetStrings=env.ReplaceIxes(dll,\n                                      'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                      'LIBPREFIX', 'LIBSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    # Append a def file target if there isn't already a def file target\n    # or a def file source or the user has explicitly asked for the target\n    # to be emitted.\n    def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    skip_def_insert = env.subst(\"$WINDOWS_INSERT_DEF\") in ['', '0', 0]\n    if not def_source and not def_target and not skip_def_insert:\n        # Create list of target libraries and def files as strings\n        targetStrings=env.ReplaceIxes(dll,\n                                      'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                      'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    return (target, source)\n\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\n\nres_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\n\nres_builder = SCons.Builder.Builder(action=res_action, suffix='.o',\n                                    source_scanner=SCons.Tool.SourceFileScanner)\nSCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)\n\ndef generate(env):\n    mingw = find(env)\n    if mingw:\n        dir = os.path.dirname(mingw)\n        env.PrependENVPath('PATH', dir )\n\n\n    # Most of mingw is the same as gcc and friends...\n    gnu_tools = ['gcc', 'g++', 'gnulink']\n    for tool in gnu_tools:\n        SCons.Tool.Tool(tool)(env)\n\n    #... but a few things differ:\n    env['CC'] = 'gcc'\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['CXX'] = 'g++'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM']   = shlib_action\n    env['LDMODULECOM'] = shlib_action\n    env.Append(SHLIBEMITTER = [shlib_emitter])\n    env['AS'] = 'as'\n\n    env['WIN32DEFPREFIX']        = ''\n    env['WIN32DEFSUFFIX']        = '.def'\n    env['WINDOWSDEFPREFIX']      = '${WIN32DEFPREFIX}'\n    env['WINDOWSDEFSUFFIX']      = '${WIN32DEFSUFFIX}'\n\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\n    env['RC'] = 'windres'\n    env['RCFLAGS'] = SCons.Util.CLVar('')\n    env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'\n    env['RCINCPREFIX'] = '--include-dir '\n    env['RCINCSUFFIX'] = ''\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'\n    env['BUILDERS']['RES'] = res_builder\n\n    # Some setting from the platform also have to be overridden:\n    env['OBJSUFFIX'] = '.o'\n    env['LIBPREFIX'] = 'lib'\n    env['LIBSUFFIX'] = '.a'\n    env['PROGSUFFIX'] = '.exe'\n\ndef exists(env):\n    return find(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/msgfmt.py",
    "content": "\"\"\" msgfmt tool \"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msgfmt.py  2014/07/05 09:42:21 garyo\"\n\nfrom SCons.Builder import BuilderBase\n#############################################################################\nclass _MOFileBuilder(BuilderBase):\n  \"\"\" The builder class for `MO` files.\n\n  The reason for this builder to exists and its purpose is quite simillar\n  as for `_POFileBuilder`. This time, we extend list of sources, not targets,\n  and call `BuilderBase._execute()` only once (as we assume single-target\n  here).\n  \"\"\"\n\n  def _execute(self, env, target, source, *args, **kw):\n    # Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable\n    # in this case, as it is called too late (after multiple sources\n    # are handled single_source builder.\n    import SCons.Util\n    from SCons.Tool.GettextCommon import _read_linguas_from_files\n    linguas_files = None\n    if env.has_key('LINGUAS_FILE') and env['LINGUAS_FILE'] is not None:\n      linguas_files = env['LINGUAS_FILE']\n      # This should prevent from endless recursion.\n      env['LINGUAS_FILE'] = None\n      # We read only languages. Suffixes shall be added automatically.\n      linguas = _read_linguas_from_files(env, linguas_files)\n      if SCons.Util.is_List(source):\n        source.extend(linguas)\n      elif source is not None:\n        source = [source] + linguas\n      else:\n        source = linguas\n    result = BuilderBase._execute(self,env,target,source,*args, **kw)\n    if linguas_files is not None:\n      env['LINGUAS_FILE'] = linguas_files\n    return result\n#############################################################################\n\n#############################################################################\ndef _create_mo_file_builder(env, **kw):\n  \"\"\" Create builder object for `MOFiles` builder \"\"\"\n  import SCons.Action\n  # FIXME: What factory use for source? Ours or their?\n  kw['action'] = SCons.Action.Action('$MSGFMTCOM','$MSGFMTCOMSTR')\n  kw['suffix'] = '$MOSUFFIX'\n  kw['src_suffix'] = '$POSUFFIX'\n  kw['src_builder'] = '_POUpdateBuilder'\n  kw['single_source'] = True\n  return _MOFileBuilder(**kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate `msgfmt` tool \"\"\"\n  import SCons.Util\n  from SCons.Tool.GettextCommon import _detect_msgfmt\n  try:\n    env['MSGFMT'] = _detect_msgfmt(env)\n  except:\n    env['MSGFMT'] = 'msgfmt'\n  env.SetDefault(\n    MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],\n    MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',\n    MSGFMTCOMSTR = '',\n    MOSUFFIX = ['.mo'],\n    POSUFFIX = ['.po']\n  )\n  env.Append( BUILDERS = { 'MOFiles'  : _create_mo_file_builder(env) } )\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msgfmt_exists\n  try:\n    return _msgfmt_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/msginit.py",
    "content": "\"\"\" msginit tool\n\nTool specific initialization of msginit tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msginit.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Warnings\nimport SCons.Builder\nimport re\n\n#############################################################################\ndef _optional_no_translator_flag(env):\n  \"\"\" Return '--no-translator' flag if we run *msginit(1)*  in non-interactive\n      mode.\"\"\"\n  import SCons.Util\n  if env.has_key('POAUTOINIT'):\n    autoinit = env['POAUTOINIT']\n  else:\n    autoinit = False\n  if autoinit:\n    return [SCons.Util.CLVar('--no-translator')]\n  else:\n    return [SCons.Util.CLVar('')]\n#############################################################################\n\n#############################################################################\ndef _POInitBuilder(env, **kw):\n  \"\"\" Create builder object for `POInit` builder. \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _init_po_files, _POFileBuilder\n  action = SCons.Action.Action(_init_po_files, None)\n  return _POFileBuilder(env, action=action, target_alias='$POCREATE_ALIAS')\n#############################################################################\n\n#############################################################################\nfrom SCons.Environment import _null\n#############################################################################\ndef _POInitBuilderWrapper(env, target=None, source=_null, **kw):\n  \"\"\" Wrapper for _POFileBuilder. We use it to make user's life easier.\n\n  This wrapper checks for `$POTDOMAIN` construction variable (or override in\n  `**kw`) and treats it appropriatelly.\n  \"\"\"\n  if source is _null:\n    if 'POTDOMAIN' in kw:\n      domain = kw['POTDOMAIN']\n    elif env.has_key('POTDOMAIN'):\n      domain = env['POTDOMAIN']\n    else:\n      domain = 'messages'\n    source = [ domain ] # NOTE: Suffix shall be appended automatically\n  return env._POInitBuilder(target, source, **kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate the `msginit` tool \"\"\"\n  import SCons.Util\n  from SCons.Tool.GettextCommon import _detect_msginit\n  try:\n    env['MSGINIT'] = _detect_msginit(env)\n  except:\n    env['MSGINIT'] = 'msginit'\n  msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \\\n             + ' $MSGINITFLAGS -i $SOURCE -o $TARGET'\n  # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded\n  #       (sometimes we really don't need it)\n  env.SetDefault(\n    POSUFFIX = ['.po'],\n    POTSUFFIX = ['.pot'],\n    _MSGINITLOCALE = '${TARGET.filebase}',\n    _MSGNoTranslator = _optional_no_translator_flag,\n    MSGINITCOM = msginitcom,\n    MSGINITCOMSTR = '',\n    MSGINITFLAGS = [ ],\n    POAUTOINIT = False,\n    POCREATE_ALIAS = 'po-create'\n  )\n  env.Append( BUILDERS = { '_POInitBuilder' : _POInitBuilder(env) } )\n  env.AddMethod(_POInitBuilderWrapper, 'POInit')\n  env.AlwaysBuild(env.Alias('$POCREATE_ALIAS'))\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msginit_exists\n  try:\n    return  _msginit_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/msgmerge.py",
    "content": "\"\"\" msgmerget tool\n\nTool specific initialization for `msgmerge` tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msgmerge.py  2014/07/05 09:42:21 garyo\"\n\n#############################################################################\ndef _update_or_init_po_files(target, source, env):\n  \"\"\" Action function for `POUpdate` builder \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _init_po_files\n  for tgt in target:\n    if tgt.rexists():\n      action = SCons.Action.Action('$MSGMERGECOM', '$MSGMERGECOMSTR')\n    else:\n      action = _init_po_files\n    status = action([tgt], source, env)\n    if status : return status\n  return 0\n#############################################################################\n\n#############################################################################\ndef _POUpdateBuilder(env, **kw):\n  \"\"\" Create an object of `POUpdate` builder \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _POFileBuilder\n  action = SCons.Action.Action(_update_or_init_po_files, None)\n  return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS')\n#############################################################################\n\n#############################################################################\nfrom SCons.Environment import _null\n#############################################################################\ndef _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n  \"\"\" Wrapper for `POUpdate` builder - make user's life easier \"\"\"\n  if source is _null:\n    if 'POTDOMAIN' in kw:\n      domain = kw['POTDOMAIN']\n    elif env.has_key('POTDOMAIN') and env['POTDOMAIN']:\n      domain = env['POTDOMAIN']\n    else:\n      domain = 'messages'\n    source = [ domain ] # NOTE: Suffix shall be appended automatically\n  return env._POUpdateBuilder(target, source, **kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate the `xgettext` tool \"\"\"\n  from SCons.Tool.GettextCommon import _detect_msgmerge\n  try:\n    env['MSGMERGE'] = _detect_msgmerge(env)\n  except:\n    env['MSGMERGE'] = 'msgmerge'\n  env.SetDefault(\n    POTSUFFIX = ['.pot'],\n    POSUFFIX = ['.po'],\n    MSGMERGECOM = '$MSGMERGE  $MSGMERGEFLAGS --update $TARGET $SOURCE',\n    MSGMERGECOMSTR = '',\n    MSGMERGEFLAGS = [ ],\n    POUPDATE_ALIAS = 'po-update'\n  )\n  env.Append(BUILDERS = { '_POUpdateBuilder':_POUpdateBuilder(env) })\n  env.AddMethod(_POUpdateBuilderWrapper, 'POUpdate')\n  env.AlwaysBuild(env.Alias('$POUPDATE_ALIAS'))\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msgmerge_exists\n  try:\n    return  _msgmerge_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mslib.py",
    "content": "\"\"\"SCons.Tool.mslib\n\nTool-specific initialization for lib (MicroSoft library archiver).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mslib.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Tool.msvc\nimport SCons.Util\n\nfrom MSCommon import msvc_exists, msvc_setup_env_once\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['AR']          = 'lib'\n    env['ARFLAGS']     = SCons.Util.CLVar('/nologo')\n    env['ARCOM']       = \"${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}\"\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\ndef exists(env):\n    return msvc_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mslink.py",
    "content": "\"\"\"SCons.Tool.mslink\n\nTool-specific initialization for the Microsoft linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mslink.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvc\nimport SCons.Tool.msvs\nimport SCons.Util\n\nfrom MSCommon import msvc_setup_env_once, msvc_exists\n\ndef pdbGenerator(env, target, source, for_signature):\n    try:\n        return ['/PDB:%s' % target[0].attributes.pdb, '/DEBUG']\n    except (AttributeError, IndexError):\n        return None\n\ndef _dllTargets(target, source, env, for_signature, paramtp):\n    listCmd = []\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    if dll: listCmd.append(\"/out:%s\"%dll.get_string(for_signature))\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: listCmd.append(\"/implib:%s\"%implib.get_string(for_signature))\n\n    return listCmd\n\ndef _dllSources(target, source, env, for_signature, paramtp):\n    listCmd = []\n\n    deffile = env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\")\n    for src in source:\n        # Check explicitly for a non-None deffile so that the __cmp__\n        # method of the base SCons.Util.Proxy class used for some Node\n        # proxies doesn't try to use a non-existent __dict__ attribute.\n        if deffile and src == deffile:\n            # Treat this source as a .def file.\n            listCmd.append(\"/def:%s\" % src.get_string(for_signature))\n        else:\n            # Just treat it as a generic source file.\n            listCmd.append(src)\n    return listCmd\n\ndef windowsShlinkTargets(target, source, env, for_signature):\n    return _dllTargets(target, source, env, for_signature, 'SHLIB')\n\ndef windowsShlinkSources(target, source, env, for_signature):\n    return _dllSources(target, source, env, for_signature, 'SHLIB')\n\ndef _windowsLdmodTargets(target, source, env, for_signature):\n    \"\"\"Get targets for loadable modules.\"\"\"\n    return _dllTargets(target, source, env, for_signature, 'LDMODULE')\n\ndef _windowsLdmodSources(target, source, env, for_signature):\n    \"\"\"Get sources for loadable modules.\"\"\"\n    return _dllSources(target, source, env, for_signature, 'LDMODULE')\n\ndef _dllEmitter(target, source, env, paramtp):\n    \"\"\"Common implementation of dll emitter.\"\"\"\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError('A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp))\n\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if not insert_def in ['', '0', 0] and \\\n       not env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"):\n\n        # append a def file to the list of sources\n        extrasources.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that must be installed\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSSHLIBMANIFESTPREFIX\", \"WINDOWSSHLIBMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, \"LIBPREFIX\", \"LIBSUFFIX\"):\n        # Append an import library to the list of targets.\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"LIBPREFIX\", \"LIBSUFFIX\"))\n        # and .exp file is created if there are exports from a DLL\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSEXPPREFIX\", \"WINDOWSEXPSUFFIX\"))\n\n    return (target+extratargets, source+extrasources)\n\ndef windowsLibEmitter(target, source, env):\n    return _dllEmitter(target, source, env, 'SHLIB')\n\ndef ldmodEmitter(target, source, env):\n    \"\"\"Emitter for loadable modules.\n\n    Loadable modules are identical to shared libraries on Windows, but building\n    them is subject to different parameters (LDMODULE*).\n    \"\"\"\n    return _dllEmitter(target, source, env, 'LDMODULE')\n\ndef prog_emitter(target, source, env):\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    exe = env.FindIxes(target, \"PROGPREFIX\", \"PROGSUFFIX\")\n    if not exe:\n        raise SCons.Errors.UserError(\"An executable should have exactly one target with the suffix: %s\" % env.subst(\"$PROGSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that have to be installed\n        extratargets.append(\n            env.ReplaceIxes(exe,\n                            \"PROGPREFIX\", \"PROGSUFFIX\",\n                            \"WINDOWSPROGMANIFESTPREFIX\", \"WINDOWSPROGMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    if version_num >= 11.0 and env.get('PCH', 0):\n        # MSVC 11 and above need the PCH object file to be added to the link line,\n        # otherwise you get link error LNK2011.\n        pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'\n        # print \"prog_emitter, version %s, appending pchobj %s\"%(version_num, pchobj)\n        if pchobj not in extrasources:\n            extrasources.append(pchobj)\n\n    return (target+extratargets,source+extrasources)\n\ndef RegServerFunc(target, source, env):\n    if 'register' in env and env['register']:\n        ret = regServerAction([target[0]], [source[0]], env)\n        if ret:\n            raise SCons.Errors.UserError(\"Unable to register %s\" % target[0])\n        else:\n            print \"Registered %s sucessfully\" % target[0]\n        return ret\n    return 0\n\n# These are the actual actions run to embed the manifest.\n# They are only called from the Check versions below.\nembedManifestExeAction = SCons.Action.Action('$MTEXECOM')\nembedManifestDllAction = SCons.Action.Action('$MTSHLIBCOM')\n\ndef embedManifestDllCheck(target, source, env):\n    \"\"\"Function run by embedManifestDllCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestDllAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].abspath + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = (embedManifestDllAction) ([target[0]],None,env)\n            if ret:\n                raise SCons.Errors.UserError, \"Unable to embed manifest into %s\" % (target[0])\n            return ret\n        else:\n            print '(embed: no %s.manifest found; not embedding.)'%str(target[0])\n    return 0\n\ndef embedManifestExeCheck(target, source, env):\n    \"\"\"Function run by embedManifestExeCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestExeAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].abspath + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = (embedManifestExeAction) ([target[0]],None,env)\n            if ret:\n                raise SCons.Errors.UserError, \"Unable to embed manifest into %s\" % (target[0])\n            return ret\n        else:\n            print '(embed: no %s.manifest found; not embedding.)'%str(target[0])\n    return 0\n\nembedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None)\nembedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)\n\nregServerAction = SCons.Action.Action(\"$REGSVRCOM\", \"$REGSVRCOMSTR\")\nregServerCheck = SCons.Action.Action(RegServerFunc, None)\nshlibLinkAction = SCons.Action.Action('${TEMPFILE(\"$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES\")}', '$SHLINKCOMSTR')\ncompositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction\nldmodLinkAction = SCons.Action.Action('${TEMPFILE(\"$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES\")}', '$LDMODULECOMSTR')\ncompositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction\nexeLinkAction = SCons.Action.Action('${TEMPFILE(\"$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows\")}', '$LINKCOMSTR')\ncompositeLinkAction = exeLinkAction + embedManifestExeCheckAction\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')\n    env['_SHLINK_TARGETS'] = windowsShlinkTargets\n    env['_SHLINK_SOURCES'] = windowsShlinkSources\n    env['SHLINKCOM']   =  compositeShLinkAction\n    env.Append(SHLIBEMITTER = [windowsLibEmitter])\n    env['LINK']        = 'link'\n    env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')\n    env['_PDB'] = pdbGenerator\n    env['LINKCOM'] = compositeLinkAction\n    env.Append(PROGEMITTER = [prog_emitter])\n    env['LIBDIRPREFIX']='/LIBPATH:'\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n    env['WIN32DEFPREFIX']        = ''\n    env['WIN32DEFSUFFIX']        = '.def'\n    env['WIN32_INSERT_DEF']      = 0\n    env['WINDOWSDEFPREFIX']      = '${WIN32DEFPREFIX}'\n    env['WINDOWSDEFSUFFIX']      = '${WIN32DEFSUFFIX}'\n    env['WINDOWS_INSERT_DEF']    = '${WIN32_INSERT_DEF}'\n\n    env['WIN32EXPPREFIX']        = ''\n    env['WIN32EXPSUFFIX']        = '.exp'\n    env['WINDOWSEXPPREFIX']      = '${WIN32EXPPREFIX}'\n    env['WINDOWSEXPSUFFIX']      = '${WIN32EXPSUFFIX}'\n\n    env['WINDOWSSHLIBMANIFESTPREFIX'] = ''\n    env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest'\n    env['WINDOWSPROGMANIFESTPREFIX']  = ''\n    env['WINDOWSPROGMANIFESTSUFFIX']  = '${PROGSUFFIX}.manifest'\n\n    env['REGSVRACTION'] = regServerCheck\n    env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')\n    env['REGSVRFLAGS'] = '/s '\n    env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'\n\n    env['WINDOWS_EMBED_MANIFEST'] = 0\n    env['MT'] = 'mt'\n    #env['MTFLAGS'] = ['-hashupdate']\n    env['MTFLAGS'] = SCons.Util.CLVar('/nologo')\n    # Note: use - here to prevent build failure if no manifest produced.\n    # This seems much simpler than a fancy system using a function action to see\n    # if the manifest actually exists before trying to run mt with it.\n    env['MTEXECOM']   = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1'\n    env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2'\n    # Future work garyo 27-Feb-11\n    env['_MANIFEST_SOURCES'] = None # _windowsManifestSources\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n\n    # Loadable modules are on Windows the same as shared libraries, but they\n    # are subject to different build parameters (LDMODULE* variables).\n    # Therefore LDMODULE* variables correspond as much as possible to\n    # SHLINK*/SHLIB* ones.\n    SCons.Tool.createLoadableModuleBuilder(env)\n    env['LDMODULE'] = '$SHLINK'\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n    env['_LDMODULE_TARGETS'] = _windowsLdmodTargets\n    env['_LDMODULE_SOURCES'] = _windowsLdmodSources\n    env['LDMODULEEMITTER'] = [ldmodEmitter]\n    env['LDMODULECOM'] = compositeLdmodAction\n\ndef exists(env):\n    return msvc_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mssdk.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mssdk.py  2014/07/05 09:42:21 garyo\"\n\n\"\"\"engine.SCons.Tool.mssdk\n\nTool-specific initialization for Microsoft SDKs, both Platform\nSDKs and Windows SDKs.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nfrom MSCommon import mssdk_exists, \\\n                     mssdk_setup_env\n\ndef generate(env):\n    \"\"\"Add construction variables for an MS SDK to an Environment.\"\"\"\n    mssdk_setup_env(env)\n\ndef exists(env):\n    return mssdk_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/msvc.py",
    "content": "\"\"\"engine.SCons.Tool.msvc\n\nTool-specific initialization for Microsoft Visual C/C++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/msvc.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\nimport re\nimport sys\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Scanner.RC\n\nfrom MSCommon import msvc_exists, msvc_setup_env_once\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\ndef validate_vars(env):\n    \"\"\"Validate the PCH and PCHSTOP construction variables.\"\"\"\n    if 'PCH' in env and env['PCH']:\n        if 'PCHSTOP' not in env:\n            raise SCons.Errors.UserError(\"The PCHSTOP construction must be defined if PCH is defined.\")\n        if not SCons.Util.is_String(env['PCHSTOP']):\n            raise SCons.Errors.UserError(\"The PCHSTOP construction variable must be a string: %r\"%env['PCHSTOP'])\n\ndef pch_emitter(target, source, env):\n    \"\"\"Adds the object file target.\"\"\"\n\n    validate_vars(env)\n\n    pch = None\n    obj = None\n\n    for t in target:\n        if SCons.Util.splitext(str(t))[1] == '.pch':\n            pch = t\n        if SCons.Util.splitext(str(t))[1] == '.obj':\n            obj = t\n\n    if not obj:\n        obj = SCons.Util.splitext(str(pch))[0]+'.obj'\n\n    target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work\n\n    return (target, source)\n\ndef object_emitter(target, source, env, parent_emitter):\n    \"\"\"Sets up the PCH dependencies for an object file.\"\"\"\n\n    validate_vars(env)\n\n    parent_emitter(target, source, env)\n\n    # Add a dependency, but only if the target (e.g. 'Source1.obj')\n    # doesn't correspond to the pre-compiled header ('Source1.pch').\n    # If the basenames match, then this was most likely caused by\n    # someone adding the source file to both the env.PCH() and the\n    # env.Program() calls, and adding the explicit dependency would\n    # cause a cycle on the .pch file itself.\n    #\n    # See issue #2505 for a discussion of what to do if it turns\n    # out this assumption causes trouble in the wild:\n    # http://scons.tigris.org/issues/show_bug.cgi?id=2505\n    if 'PCH' in env:\n        pch = env['PCH']\n        if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':\n            env.Depends(target, pch)\n\n    return (target, source)\n\ndef static_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.StaticObjectEmitter)\n\ndef shared_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.SharedObjectEmitter)\n\npch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')\npch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',\n                                    emitter=pch_emitter,\n                                    source_scanner=SCons.Tool.SourceFileScanner)\n\n\n# Logic to build .rc files into .res files (resource files)\nres_scanner = SCons.Scanner.RC.RCScan()\nres_action  = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\nres_builder = SCons.Builder.Builder(action=res_action,\n                                    src_suffix='.rc',\n                                    suffix='.res',\n                                    src_builder=[],\n                                    source_scanner=res_scanner)\n\ndef msvc_batch_key(action, env, target, source):\n    \"\"\"\n    Returns a key to identify unique batches of sources for compilation.\n\n    If batching is enabled (via the $MSVC_BATCH setting), then all\n    target+source pairs that use the same action, defined by the same\n    environment, and have the same target and source directories, will\n    be batched.\n\n    Returning None specifies that the specified target+source should not\n    be batched with other compilations.\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better.\n    # Note we need to do the env.subst so $MSVC_BATCH can be a reference to\n    # another construction variable, which is why we test for False and 0\n    # as strings.\n    if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        # We're not using batching; return no key.\n        return None\n    t = target[0]\n    s = source[0]\n    if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]:\n        # The base names are different, so this *must* be compiled\n        # separately; return no key.\n        return None\n    return (id(action), id(env), t.dir, s.dir)\n\ndef msvc_output_flag(target, source, env, for_signature):\n    \"\"\"\n    Returns the correct /Fo flag for batching.\n\n    If batching is disabled or there's only one source file, then we\n    return an /Fo string that specifies the target explicitly.  Otherwise,\n    we return an /Fo string that just specifies the first target's\n    directory (where the Visual C/C++ compiler will put the .obj files).\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better. Removed\n    # len(source)==1 as batch mode can compile only one file\n    # (and it also fixed problem with compiling only one changed file\n    # with batch mode enabled)\n    if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        return '/Fo$TARGET'\n    else:\n        # The Visual C/C++ compiler requires a \\ at the end of the /Fo\n        # option to indicate an output directory.  We use os.sep here so\n        # that the test(s) for this can be run on non-Windows systems\n        # without having a hard-coded backslash mess up command-line\n        # argument parsing.\n        return '/Fo${TARGET.dir}' + os.sep\n\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\",\n                              batch_key=msvc_batch_key,\n                              targets='$CHANGED_TARGETS')\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\",\n                                  batch_key=msvc_batch_key,\n                                  targets='$CHANGED_TARGETS')\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MSVC++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    # TODO(batch):  shouldn't reach in to cmdgen this way; necessary\n    # for now to bypass the checks in Builder.DictCmdGenerator.__call__()\n    # and allow .cc and .cpp to be compiled in the same command line.\n    static_obj.cmdgen.source_ext_match = False\n    shared_obj.cmdgen.source_ext_match = False\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, CAction)\n        shared_obj.add_action(suffix, ShCAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, CXXAction)\n        shared_obj.add_action(suffix, ShCXXAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Z7\") or \"\"}'])\n    env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and \"/Yu%s \\\\\\\"/Fp%s\\\\\\\"\"%(PCHSTOP or \"\",File(PCH))) or \"\"}'])\n    env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag\n    env['_CCCOMCOM']  = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'\n    env['CC']         = 'cl'\n    env['CCFLAGS']    = SCons.Util.CLVar('/nologo')\n    env['CFLAGS']     = SCons.Util.CLVar('')\n    env['CCCOM']      = '${TEMPFILE(\"$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM\")}'\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']    = '${TEMPFILE(\"$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM\")}'\n    env['CXX']        = '$CC'\n    env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')\n    env['CXXCOM']     = '${TEMPFILE(\"$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM\")}'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '${TEMPFILE(\"$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM\")}'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n#    env.Append(OBJEMITTER = [static_object_emitter])\n#    env.Append(SHOBJEMITTER = [shared_object_emitter])\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\n    env['RC'] = 'rc'\n    env['RCFLAGS'] = SCons.Util.CLVar('')\n    env['RCSUFFIXES']=['.rc','.rc2']\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'\n    env['BUILDERS']['RES'] = res_builder\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\n    env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Yd\") or \"\"}'])\n    env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'\n    env['BUILDERS']['PCH'] = pch_builder\n\n    if 'ENV' not in env:\n        env['ENV'] = {}\n    if 'SystemRoot' not in env['ENV']:    # required for dlls in the winsxs folders\n        env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()\n\ndef exists(env):\n    return msvc_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/msvs.py",
    "content": "\"\"\"SCons.Tool.msvs\n\nTool-specific initialization for Microsoft Visual Studio project files.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msvs.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.compat\n\nimport base64\nimport hashlib\nimport ntpath\nimport os\n# compat layer imports \"cPickle\" for us if it's available.\nimport pickle\nimport re\nimport sys\n\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Platform.win32\nimport SCons.Script.SConscript\nimport SCons.PathList\nimport SCons.Util\nimport SCons.Warnings\n\nfrom MSCommon import msvc_exists, msvc_setup_env_once\nfrom SCons.Defaults import processDefines\n\n##############################################################################\n# Below here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef xmlify(s):\n    s = s.replace(\"&\", \"&amp;\") # do this first\n    s = s.replace(\"'\", \"&apos;\")\n    s = s.replace('\"', \"&quot;\")\n    return s\n\n# Process a CPPPATH list in includes, given the env, target and source.\n# Returns a tuple of nodes.\ndef processIncludes(includes, env, target, source):\n    return SCons.PathList.PathList(includes).subst_path(env, target, source)\n\n\nexternal_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'\n\ndef _generateGUID(slnfile, name):\n    \"\"\"This generates a dummy GUID for the sln file to use.  It is\n    based on the MD5 signatures of the sln filename plus the name of\n    the project.  It basically just needs to be unique, and not\n    change with each invocation.\"\"\"\n    m = hashlib.md5()\n    # Normalize the slnfile path to a Windows path (\\ separators) so\n    # the generated file has a consistent GUID even if we generate\n    # it on a non-Windows platform.\n    m.update(ntpath.normpath(str(slnfile)) + str(name))\n    solution = m.hexdigest().upper()\n    # convert most of the signature to GUID form (discard the rest)\n    solution = \"{\" + solution[:8] + \"-\" + solution[8:12] + \"-\" + solution[12:16] + \"-\" + solution[16:20] + \"-\" + solution[20:32] + \"}\"\n    return solution\n\nversion_re = re.compile(r'(\\d+\\.\\d+)(.*)')\n\ndef msvs_parse_version(s):\n    \"\"\"\n    Split a Visual Studio version, which may in fact be something like\n    '7.0Exp', into is version number (returned as a float) and trailing\n    \"suite\" portion.\n    \"\"\"\n    num, suite = version_re.match(s).groups()\n    return float(num), suite\n\n# os.path.relpath has been introduced in Python 2.6\n# We define it locally for earlier versions of Python\ndef relpath(path, start=os.path.curdir):\n    \"\"\"Return a relative version of a path\"\"\"\n    import sys\n    if not path:\n        raise ValueError(\"no path specified\")\n    start_list = os.path.abspath(start).split(os.sep)\n    path_list = os.path.abspath(path).split(os.sep)\n    if 'posix' in sys.builtin_module_names:\n        # Work out how much of the filepath is shared by start and path.\n        i = len(os.path.commonprefix([start_list, path_list]))\n    else:\n        if start_list[0].lower() != path_list[0].lower():\n            unc_path, rest = os.path.splitunc(path)\n            unc_start, rest = os.path.splitunc(start)\n            if bool(unc_path) ^ bool(unc_start):\n                raise ValueError(\"Cannot mix UNC and non-UNC paths (%s and %s)\"\n                                                                    % (path, start))\n            else:\n                raise ValueError(\"path is on drive %s, start on drive %s\"\n                                                    % (path_list[0], start_list[0]))\n        # Work out how much of the filepath is shared by start and path.\n        for i in range(min(len(start_list), len(path_list))):\n            if start_list[i].lower() != path_list[i].lower():\n                break\n        else:\n            i += 1\n    rel_list = [os.pardir] * (len(start_list)-i) + path_list[i:]\n    if not rel_list:\n        return os.path.curdir\n    return os.path.join(*rel_list)\n\nif not \"relpath\" in os.path.__all__:\n    os.path.relpath = relpath\n\n# This is how we re-invoke SCons from inside MSVS Project files.\n# The problem is that we might have been invoked as either scons.bat\n# or scons.py.  If we were invoked directly as scons.py, then we could\n# use sys.argv[0] to find the SCons \"executable,\" but that doesn't work\n# if we were invoked as scons.bat, which uses \"python -c\" to execute\n# things and ends up with \"-c\" as sys.argv[0].  Consequently, we have\n# the MSVS Project file invoke SCons the same way that scons.bat does,\n# which works regardless of how we were invoked.\ndef getExecScriptMain(env, xml=None):\n    scons_home = env.get('SCONS_HOME')\n    if not scons_home and 'SCONS_LIB_DIR' in os.environ:\n        scons_home = os.environ['SCONS_LIB_DIR']\n    if scons_home:\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()\" % scons_home\n    else:\n        version = SCons.__version__\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()\" % locals()\n    if xml:\n        exec_script_main = xmlify(exec_script_main)\n    return exec_script_main\n\n# The string for the Python executable we tell the Project file to use\n# is either sys.executable or, if an external PYTHON_ROOT environment\n# variable exists, $(PYTHON)ROOT\\\\python.exe (generalized a little to\n# pluck the actual executable name from sys.executable).\ntry:\n    python_root = os.environ['PYTHON_ROOT']\nexcept KeyError:\n    python_executable = sys.executable\nelse:\n    python_executable = os.path.join('$$(PYTHON_ROOT)',\n                                     os.path.split(sys.executable)[1])\n\nclass Config(object):\n    pass\n\ndef splitFully(path):\n    dir, base = os.path.split(path)\n    if dir and dir != '' and dir != path:\n        return splitFully(dir)+[base]\n    if base == '':\n        return []\n    return [base]\n\ndef makeHierarchy(sources):\n    '''Break a list of files into a hierarchy; for each value, if it is a string,\n       then it is a file.  If it is a dictionary, it is a folder.  The string is\n       the original path of the file.'''\n\n    hierarchy = {}\n    for file in sources:\n        path = splitFully(file)\n        if len(path):\n            dict = hierarchy\n            for part in path[:-1]:\n                if part not in dict:\n                    dict[part] = {}\n                dict = dict[part]\n            dict[path[-1]] = file\n        #else:\n        #    print 'Warning: failed to decompose path for '+str(file)\n    return hierarchy\n\nclass _DSPGenerator(object):\n    \"\"\" Base class for DSP generators \"\"\"\n\n    srcargs = [\n        'srcs',\n        'incs',\n        'localincs',\n        'resources',\n        'misc']\n\n    def __init__(self, dspfile, source, env):\n        self.dspfile = str(dspfile)\n        try:\n            get_abspath = dspfile.get_abspath\n        except AttributeError:\n            self.dspabs = os.path.abspath(dspfile)\n        else:\n            self.dspabs = get_abspath()\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVSProject.\")\n        elif SCons.Util.is_String(env['variant']):\n            variants = [env['variant']]\n        elif SCons.Util.is_List(env['variant']):\n            variants = env['variant']\n\n        if 'buildtarget' not in env or env['buildtarget'] == None:\n            buildtarget = ['']\n        elif SCons.Util.is_String(env['buildtarget']):\n            buildtarget = [env['buildtarget']]\n        elif SCons.Util.is_List(env['buildtarget']):\n            if len(env['buildtarget']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'buildtarget' and 'variant' lists must be the same.\")\n            buildtarget = []\n            for bt in env['buildtarget']:\n                if SCons.Util.is_String(bt):\n                    buildtarget.append(bt)\n                else:\n                    buildtarget.append(bt.get_abspath())\n        else:\n            buildtarget = [env['buildtarget'].get_abspath()]\n        if len(buildtarget) == 1:\n            bt = buildtarget[0]\n            buildtarget = []\n            for _ in variants:\n                buildtarget.append(bt)\n\n        if 'outdir' not in env or env['outdir'] == None:\n            outdir = ['']\n        elif SCons.Util.is_String(env['outdir']):\n            outdir = [env['outdir']]\n        elif SCons.Util.is_List(env['outdir']):\n            if len(env['outdir']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'outdir' and 'variant' lists must be the same.\")\n            outdir = []\n            for s in env['outdir']:\n                if SCons.Util.is_String(s):\n                    outdir.append(s)\n                else:\n                    outdir.append(s.get_abspath())\n        else:\n            outdir = [env['outdir'].get_abspath()]\n        if len(outdir) == 1:\n            s = outdir[0]\n            outdir = []\n            for v in variants:\n                outdir.append(s)\n\n        if 'runfile' not in env or env['runfile'] == None:\n            runfile = buildtarget[-1:]\n        elif SCons.Util.is_String(env['runfile']):\n            runfile = [env['runfile']]\n        elif SCons.Util.is_List(env['runfile']):\n            if len(env['runfile']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'runfile' and 'variant' lists must be the same.\")\n            runfile = []\n            for s in env['runfile']:\n                if SCons.Util.is_String(s):\n                    runfile.append(s)\n                else:\n                    runfile.append(s.get_abspath())\n        else:\n            runfile = [env['runfile'].get_abspath()]\n        if len(runfile) == 1:\n            s = runfile[0]\n            runfile = []\n            for v in variants:\n                runfile.append(s)\n\n        self.sconscript = env['MSVSSCONSCRIPT']\n\n        cmdargs = env.get('cmdargs', '')\n\n        self.env = env\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0])\n        self.name = self.env.subst(self.name)\n\n        sourcenames = [\n            'Source Files',\n            'Header Files',\n            'Local Headers',\n            'Resource Files',\n            'Other Files']\n\n        self.sources = {}\n        for n in sourcenames:\n            self.sources[n] = []\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dspabs):\n            self.Parse()\n\n        for t in zip(sourcenames,self.srcargs):\n            if t[1] in self.env:\n                if SCons.Util.is_List(self.env[t[1]]):\n                    for i in self.env[t[1]]:\n                        if not i in self.sources[t[0]]:\n                            self.sources[t[0]].append(i)\n                else:\n                    if not self.env[t[1]] in self.sources[t[0]]:\n                        self.sources[t[0]].append(self.env[t[1]])\n\n        for n in sourcenames:\n            #TODO 2.4: compat layer supports sorted(key=) but not sort(key=)\n            #TODO 2.4: self.sources[n].sort(key=lambda a: a.lower())\n            self.sources[n] = sorted(self.sources[n], key=lambda a: a.lower())\n\n        def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile):\n            config = Config()\n            config.buildtarget = buildtarget\n            config.outdir = outdir\n            config.cmdargs = cmdargs\n            config.runfile = runfile\n\n            match = re.match('(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            print \"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dspfile) + \"'\"\n\n        for i in range(len(variants)):\n            AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs)\n\n        self.platforms = []\n        for key in self.configs.keys():\n            platform = self.configs[key].platform\n            if not platform in self.platforms:\n                self.platforms.append(platform)\n\n    def Build(self):\n        pass\n\nV6DSPHeader = \"\"\"\\\n# Microsoft Developer Studio Project File - Name=\"%(name)s\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) External Target\" 0x0106\n\nCFG=%(name)s - Win32 %(confkey)s\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\" CFG=\"%(name)s - Win32 %(confkey)s\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n\"\"\"\n\nclass _GenerateV6DSP(_DSPGenerator):\n    \"\"\"Generates a Project file for MSVS 6.0\"\"\"\n\n    def PrintHeader(self):\n        # pick a default config\n        confkeys = sorted(self.configs.keys())\n\n        name = self.name\n        confkey = confkeys[0]\n\n        self.file.write(V6DSPHeader % locals())\n\n        for kind in confkeys:\n            self.file.write('!MESSAGE \"%s - Win32 %s\" (based on \"Win32 (x86) External Target\")\\n' % (name, kind))\n\n        self.file.write('!MESSAGE \\n\\n')\n\n    def PrintProject(self):\n        name = self.name\n        self.file.write('# Begin Project\\n'\n                        '# PROP AllowPerConfigDependencies 0\\n'\n                        '# PROP Scc_ProjName \"\"\\n'\n                        '# PROP Scc_LocalPath \"\"\\n\\n')\n\n        first = 1\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            if first == 1:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n                first = 0\n            else:\n                self.file.write('\\n!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            # have to write this twice, once with the BASE settings, and once without\n            for base in (\"BASE \",\"\"):\n                self.file.write('# PROP %sUse_MFC 0\\n'\n                                '# PROP %sUse_Debug_Libraries ' % (base, base))\n                if kind.lower().find('debug') < 0:\n                    self.file.write('0\\n')\n                else:\n                    self.file.write('1\\n')\n                self.file.write('# PROP %sOutput_Dir \"%s\"\\n'\n                                '# PROP %sIntermediate_Dir \"%s\"\\n' % (base,outdir,base,outdir))\n                cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1)\n                self.file.write('# PROP %sCmd_Line \"%s\"\\n'\n                                '# PROP %sRebuild_Opt \"-c && %s\"\\n'\n                                '# PROP %sTarget_File \"%s\"\\n'\n                                '# PROP %sBsc_Name \"\"\\n'\n                                '# PROP %sTarget_Dir \"\"\\n'\\\n                                %(base,cmd,base,cmd,base,buildtarget,base,base))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n        self.file.write('\\n!ENDIF\\n\\n'\n                        '# Begin Target\\n\\n')\n        for kind in confkeys:\n            self.file.write('# Name \"%s - Win32 %s\"\\n' % (name,kind))\n        self.file.write('\\n')\n        first = 0\n        for kind in confkeys:\n            if first == 0:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n                first = 1\n            else:\n                self.file.write('!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n        self.file.write('!ENDIF \\n\\n')\n        self.PrintSourceFiles()\n        self.file.write('# End Target\\n'\n                        '# End Project\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write(pdata + '\\n')\n            pdata = pickle.dumps(self.sources,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write(pdata + '\\n')\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat',\n                      'Header Files': 'h|hpp|hxx|hm|inl',\n                      'Local Headers': 'h|hpp|hxx|hm|inl',\n                      'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',\n                      'Other Files': ''}\n\n        for kind in sorted(categories.keys(), key=lambda a: a.lower()):\n            if not self.sources[kind]:\n                continue # skip empty groups\n\n            self.file.write('# Begin Group \"' + kind + '\"\\n\\n')\n            typelist = categories[kind].replace('|', ';')\n            self.file.write('# PROP Default_Filter \"' + typelist + '\"\\n')\n\n            for file in self.sources[kind]:\n                file = os.path.normpath(file)\n                self.file.write('# Begin Source File\\n\\n'\n                                'SOURCE=\"' + file + '\"\\n'\n                                '# End Source File\\n')\n            self.file.write('# End Group\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('# Begin Source File\\n\\n'\n                        'SOURCE=\"' + str(self.sconscript) + '\"\\n'\n                        '# End Source File\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        while line:\n            if line.find(\"# End Project\") > -1:\n                break\n            line = dspfile.readline()\n\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        # it has a \"# \" in front of it, so we strip that.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\nV7DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV7DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tOutputDirectory=\"%(outdir)s\"\n\\t\\t\\tIntermediateDirectory=\"%(outdir)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\">\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"/>\n\\t\\t</Configuration>\n\"\"\"\n\nV8DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n\\tRootNamespace=\"%(name)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV8DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\\t\\t\\t>\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"\n\\t\\t\\t\\tPreprocessorDefinitions=\"%(preprocdefs)s\"\n\\t\\t\\t\\tIncludeSearchPath=\"%(includepath)s\"\n\\t\\t\\t\\tForcedIncludes=\"\"\n\\t\\t\\t\\tAssemblySearchPath=\"\"\n\\t\\t\\t\\tForcedUsingAssemblies=\"\"\n\\t\\t\\t\\tCompileAsManaged=\"\"\n\\t\\t\\t/>\n\\t\\t</Configuration>\n\"\"\"\nclass _GenerateV7DSP(_DSPGenerator):\n    \"\"\"Generates a Project file for MSVS .NET\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n        self.version = env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        if self.version_num >= 9.0:\n            self.versionstr = '9.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        elif self.version_num >= 8.0:\n            self.versionstr = '8.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        else:\n            if self.version_num >= 7.1:\n                self.versionstr = '7.10'\n            else:\n                self.versionstr = '7.00'\n            self.dspheader = V7DSPHeader\n            self.dspconfiguration = V7DSPConfiguration\n        self.file = None\n\n    def PrintHeader(self):\n        env = self.env\n        versionstr = self.versionstr\n        name = self.name\n        encoding = self.env.subst('$MSVSENCODING')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\tSccProjectName=\"%s\"\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\tSccAuxPath=\"%s\"\\n' % scc_aux_path\n            scc_attrs += ('\\tSccLocalPath=\"%s\"\\n'\n                          '\\tSccProvider=\"%s\"' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\tSccProjectName=\"%s\"\\n'\n                         '\\tSccLocalPath=\"%s\"' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspheader = self.dspheader.replace('%(scc_attrs)s\\n', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<Platforms>\\n')\n        for platform in self.platforms:\n            self.file.write(\n                        '\\t\\t<Platform\\n'\n                        '\\t\\t\\tName=\"%s\"/>\\n' % platform)\n        self.file.write('\\t</Platforms>\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\t<ToolFiles>\\n'\n                            '\\t</ToolFiles>\\n')\n\n    def PrintProject(self):\n        self.file.write('\\t<Configurations>\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))\n            includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None)\n            includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</Configurations>\\n')\n\n        if self.version_num >= 7.1:\n            self.file.write('\\t<References>\\n'\n                            '\\t</References>\\n')\n\n        self.PrintSourceFiles()\n\n        self.file.write('</VisualStudioProject>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write(pdata + '-->\\n')\n\n    def printSources(self, hierarchy, commonprefix):\n        sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.file.write('\\t\\t\\t<Filter\\n'\n                                '\\t\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\t\\tFilter=\"\">\\n' % (key))\n                self.printSources(value, commonprefix)\n                self.file.write('\\t\\t\\t</Filter>\\n')\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n                self.file.write('\\t\\t\\t<File\\n'\n                                '\\t\\t\\t\\tRelativePath=\"%s\">\\n'\n                                '\\t\\t\\t</File>\\n' % (file))\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        self.file.write('\\t<Files>\\n')\n\n        cats = sorted([k for k in categories.keys() if self.sources[k]],\n                      key=lambda a: a.lower())\n        for kind in cats:\n            if len(cats) > 1:\n                self.file.write('\\t\\t<Filter\\n'\n                                '\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\tFilter=\"%s\">\\n' % (kind, categories[kind]))\n\n            sources = self.sources[kind]\n\n            # First remove any common prefix\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, commonprefix=commonprefix)\n\n            if len(cats)>1:\n                self.file.write('\\t\\t</Filter>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t\\t<File\\n'\n                        '\\t\\t\\tRelativePath=\"%s\">\\n'\n                        '\\t\\t</File>\\n' % str(self.sconscript))\n\n        self.file.write('\\t</Files>\\n'\n                        '\\t<Globals>\\n'\n                        '\\t</Globals>\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        while line:\n            if line.find('<!-- SCons Data:') > -1:\n                break\n            line = dspfile.readline()\n\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\nV10DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nV10DSPProjectConfiguration = \"\"\"\\\n\\t\\t<ProjectConfiguration Include=\"%(variant)s|%(platform)s\">\n\\t\\t\\t<Configuration>%(variant)s</Configuration>\n\\t\\t\\t<Platform>%(platform)s</Platform>\n\\t\\t</ProjectConfiguration>\n\"\"\"\n\nV10DSPGlobals = \"\"\"\\\n\\t<PropertyGroup Label=\"Globals\">\n\\t\\t<ProjectGuid>%(project_guid)s</ProjectGuid>\n%(scc_attrs)s\\t\\t<RootNamespace>%(name)s</RootNamespace>\n\\t\\t<Keyword>MakeFileProj</Keyword>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPPropertyGroupCondition = \"\"\"\\\n\\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"Configuration\">\n\\t\\t<ConfigurationType>Makefile</ConfigurationType>\n\\t\\t<UseOfMfc>false</UseOfMfc>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPImportGroupCondition = \"\"\"\\\n\\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"PropertySheets\">\n\\t\\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n\\t</ImportGroup>\n\"\"\"\n\nV10DSPCommandLine = \"\"\"\\\n\\t\\t<NMakeBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(buildcmd)s</NMakeBuildCommandLine>\n\\t\\t<NMakeReBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(rebuildcmd)s</NMakeReBuildCommandLine>\n\\t\\t<NMakeCleanCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(cleancmd)s</NMakeCleanCommandLine>\n\\t\\t<NMakeOutput Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(runfile)s</NMakeOutput>\n\\t\\t<NMakePreprocessorDefinitions Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(preprocdefs)s</NMakePreprocessorDefinitions>\n\\t\\t<NMakeIncludeSearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(includepath)s</NMakeIncludeSearchPath>\n\\t\\t<NMakeForcedIncludes Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedIncludes)</NMakeForcedIncludes>\n\\t\\t<NMakeAssemblySearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\n\\t\\t<NMakeForcedUsingAssemblies Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\n\"\"\"\n\nclass _GenerateV10DSP(_DSPGenerator):\n    \"\"\"Generates a Project file for MSVS 2010\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n\n        self.dspheader = V10DSPHeader\n        self.dspconfiguration = V10DSPProjectConfiguration\n        self.dspglobals = V10DSPGlobals\n\n    def PrintHeader(self):\n        env = self.env\n        name = self.name\n        encoding = env.subst('$MSVSENCODING')\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\t\\t<SccProjectName>%s</SccProjectName>\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\t\\t<SccAuxPath>%s</SccAuxPath>\\n' % scc_aux_path\n            scc_attrs += ('\\t\\t<SccLocalPath>%s</SccLocalPath>\\n'\n                          '\\t\\t<SccProvider>%s</SccProvider>\\n' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\t\\t<SccProjectName>%s</SccProjectName>\\n'\n                         '\\t\\t<SccLocalPath>%s</SccLocalPath>\\n' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<ItemGroup Label=\"ProjectConfigurations\">\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</ItemGroup>\\n')\n\n        self.file.write(self.dspglobals % locals())\n\n    def PrintProject(self):\n        name = self.name\n        confkeys = sorted(self.configs.keys())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPPropertyGroupCondition % locals())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\\n')\n        self.file.write('\\t<ImportGroup Label=\"ExtensionSettings\">\\n')\n        self.file.write('\\t</ImportGroup>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPImportGroupCondition % locals())\n\n        self.file.write('\\t<PropertyGroup Label=\"UserMacros\" />\\n')\n        self.file.write('\\t<PropertyGroup>\\n')\n        self.file.write('\\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))\n            includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None)\n            includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(V10DSPCommandLine % locals())\n\n        self.file.write('\\t</PropertyGroup>\\n')\n\n        #filter settings in MSVS 2010 are stored in separate file\n        self.filtersabs = self.dspabs + '.filters'\n        try:\n            self.filters_file = open(self.filtersabs, 'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.filtersabs + '\" for writing:' + str(detail))\n\n        self.filters_file.write('<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n'\n                                '<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\\n')\n\n        self.PrintSourceFiles()\n\n        self.filters_file.write('</Project>')\n        self.filters_file.close()\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\\n'\n                        '\\t<ImportGroup Label=\"ExtensionTargets\">\\n'\n                        '\\t</ImportGroup>\\n'\n                        '</Project>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write(pdata + '-->\\n')\n\n    def printFilters(self, hierarchy, name):\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                filter_name = name + '\\\\' + key\n                self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                        '\\t\\t\\t<UniqueIdentifier>%s</UniqueIdentifier>\\n'\n                                        '\\t\\t</Filter>\\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))\n                self.printFilters(value, filter_name)\n\n    def printSources(self, hierarchy, kind, commonprefix, filter_name):\n        keywords = {'Source Files': 'ClCompile',\n                    'Header Files': 'ClInclude',\n                    'Local Headers': 'ClInclude',\n                    'Resource Files': 'None',\n                    'Other Files': 'None'}\n\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.printSources(value, kind, commonprefix, filter_name + '\\\\' + key)\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n\n                self.file.write('\\t\\t<%s Include=\"%s\" />\\n' % (keywords[kind], file))\n                self.filters_file.write('\\t\\t<%s Include=\"%s\">\\n'\n                                        '\\t\\t\\t<Filter>%s</Filter>\\n'\n                                        '\\t\\t</%s>\\n' % (keywords[kind], file, filter_name, keywords[kind]))\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        cats = sorted([k for k in categories.keys() if self.sources[k]],\n\t\t              key = lambda a: a.lower())\n\n        # print vcxproj.filters file first\n        self.filters_file.write('\\t<ItemGroup>\\n')\n        for kind in cats:\n            self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                    '\\t\\t\\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\\n'\n                                    '\\t\\t\\t<Extensions>%s</Extensions>\\n'\n                                    '\\t\\t</Filter>\\n' % (kind, categories[kind]))\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printFilters(hierarchy, kind)\n\n        self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # then print files and filters\n        for kind in cats:\n            self.file.write('\\t<ItemGroup>\\n')\n            self.filters_file.write('\\t<ItemGroup>\\n')\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, kind, commonprefix, kind)\n\n            self.file.write('\\t</ItemGroup>\\n')\n            self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t<ItemGroup>\\n'\n                        '\\t\\t<None Include=\"%s\" />\\n'\n                        #'\\t\\t<None Include=\"SConstruct\" />\\n'\n                        '\\t</ItemGroup>\\n' % str(self.sconscript))\n\n    def Parse(self):\n        print \"_GenerateV10DSP.Parse()\"\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs, 'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\nclass _DSWGenerator(object):\n    \"\"\" Base class for DSW generators \"\"\"\n    def __init__(self, dswfile, source, env):\n        self.dswfile = os.path.normpath(str(dswfile))\n        self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile))\n        self.env = env\n\n        if 'projects' not in env:\n            raise SCons.Errors.UserError(\"You must specify a 'projects' argument to create an MSVSSolution.\")\n        projects = env['projects']\n        if not SCons.Util.is_List(projects):\n            raise SCons.Errors.InternalError(\"The 'projects' argument must be a list of nodes.\")\n        projects = SCons.Util.flatten(projects)\n        if len(projects) < 1:\n            raise SCons.Errors.UserError(\"You must specify at least one project to create an MSVSSolution.\")\n        self.dspfiles = list(map(str, projects))\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0])\n        self.name = self.env.subst(self.name)\n\n    def Build(self):\n        pass\n\nclass _GenerateV7DSW(_DSWGenerator):\n    \"\"\"Generates a Solution file for MSVS .NET\"\"\"\n    def __init__(self, dswfile, source, env):\n        _DSWGenerator.__init__(self, dswfile, source, env)\n\n        self.file = None\n        self.version = self.env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        self.versionstr = '7.00'\n        if self.version_num >= 11.0:\n            self.versionstr = '12.00'\n        elif self.version_num >= 10.0:\n            self.versionstr = '11.00'\n        elif self.version_num >= 9.0:\n            self.versionstr = '10.00'\n        elif self.version_num >= 8.0:\n            self.versionstr = '9.00'\n        elif self.version_num >= 7.1:\n            self.versionstr = '8.00'\n\n        if 'slnguid' in env and env['slnguid']:\n            self.slnguid = env['slnguid']\n        else:\n            self.slnguid = _generateGUID(dswfile, self.name)\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dswfile):\n            self.Parse()\n\n        def AddConfig(self, variant, dswfile=dswfile):\n            config = Config()\n\n            match = re.match('(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            print \"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dswfile) + \"'\"\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVS Solution File.\")\n        elif SCons.Util.is_String(env['variant']):\n            AddConfig(self, env['variant'])\n        elif SCons.Util.is_List(env['variant']):\n            for variant in env['variant']:\n                AddConfig(self, variant)\n\n        self.platforms = []\n        for key in self.configs.keys():\n            platform = self.configs[key].platform\n            if not platform in self.platforms:\n                self.platforms.append(platform)\n\n        def GenerateProjectFilesInfo(self):\n            for dspfile in self.dspfiles:\n                dsp_folder_path, name = os.path.split(dspfile)\n                dsp_folder_path = os.path.abspath(dsp_folder_path)\n                dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path)\n                if dsp_relative_folder_path == os.curdir:\n                    dsp_relative_file_path = name\n                else:\n                    dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)\n                dspfile_info = {'NAME': name,\n                                'GUID': _generateGUID(dspfile, ''),\n                                'FOLDER_PATH': dsp_folder_path,\n                                'FILE_PATH': dspfile,\n                                'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,\n                                'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}\n                self.dspfiles_info.append(dspfile_info)\n\n        self.dspfiles_info = []\n        GenerateProjectFilesInfo(self)\n\n    def Parse(self):\n        try:\n            dswfile = open(self.dswfile,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dswfile.readline()\n        while line:\n            if line[:9] == \"EndGlobal\":\n                break\n            line = dswfile.readline()\n\n        line = dswfile.readline()\n        datas = line\n        while line:\n            line = dswfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n    def PrintSolution(self):\n        \"\"\"Writes a solution file\"\"\"\n        self.file.write('Microsoft Visual Studio Solution File, Format Version %s\\n' % self.versionstr)\n        if self.version_num >= 11.0:\n            self.file.write('# Visual Studio 11\\n')\n        elif self.version_num >= 10.0:\n            self.file.write('# Visual Studio 2010\\n')\n        elif self.version_num >= 9.0:\n            self.file.write('# Visual Studio 2008\\n')\n        elif self.version_num >= 8.0:\n            self.file.write('# Visual Studio 2005\\n')\n\n        for dspinfo in self.dspfiles_info:\n            name = dspinfo['NAME']\n            base, suffix = SCons.Util.splitext(name)\n            if suffix == '.vcproj':\n                name = base\n            self.file.write('Project(\"%s\") = \"%s\", \"%s\", \"%s\"\\n'\n                            % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))\n            if self.version_num >= 7.1 and self.version_num < 8.0:\n                self.file.write('\\tProjectSection(ProjectDependencies) = postProject\\n'\n                                '\\tEndProjectSection\\n')\n            self.file.write('EndProject\\n')\n\n        self.file.write('Global\\n')\n\n        env = self.env\n        if 'MSVS_SCC_PROVIDER' in env:\n            scc_number_of_projects = len(self.dspfiles) + 1\n            slnguid = self.slnguid\n            scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\\u0020')\n            scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\\u0020')\n            scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n            scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\\\', '\\\\\\\\')\n            self.file.write('\\tGlobalSection(SourceCodeControl) = preSolution\\n'\n                            '\\t\\tSccNumberOfProjects = %(scc_number_of_projects)d\\n'\n                            '\\t\\tSccProjectName0 = %(scc_project_name)s\\n'\n                            '\\t\\tSccLocalPath0 = %(scc_local_path)s\\n'\n                            '\\t\\tSccProvider0 = %(scc_provider)s\\n'\n                            '\\t\\tCanCheckoutShared = true\\n'  % locals())\n            sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root)\n            if sln_relative_path_from_scc != os.curdir:\n                self.file.write('\\t\\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\\\\\\n'\n                                % sln_relative_path_from_scc.replace('\\\\', '\\\\\\\\'))\n            if self.version_num < 8.0:\n                # When present, SolutionUniqueID is automatically removed by VS 2005\n                # TODO: check for Visual Studio versions newer than 2005\n                self.file.write('\\t\\tSolutionUniqueID = %s\\n' % slnguid)\n            for dspinfo in self.dspfiles_info:\n                i = self.dspfiles_info.index(dspinfo) + 1\n                dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\\\', '\\\\\\\\')\n                dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\\\', '\\\\\\\\')\n                self.file.write('\\t\\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\\n'\n                                '\\t\\tSccLocalPath%(i)d = %(scc_local_path)s\\n'\n                                '\\t\\tCanCheckoutShared = true\\n'\n                                '\\t\\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\\\\\\n'\n                                % locals())\n            self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(SolutionConfiguration) = preSolution\\n')\n\n        confkeys = sorted(self.configs.keys())\n        cnt = 0\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                self.file.write('\\t\\t%s|%s = %s|%s\\n' % (variant, platform, variant, platform))\n            else:\n                self.file.write('\\t\\tConfigName.%d = %s\\n' % (cnt, variant))\n            cnt = cnt + 1\n        self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num <= 7.1:\n            self.file.write('\\tGlobalSection(ProjectDependencies) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(ProjectConfiguration) = postSolution\\n')\n\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s|%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s|%s.Build.0 = %s|%s\\n'  % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))\n            else:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s.Build.0 = %s|%s\\n'  %(guid,variant,variant,platform,guid,variant,variant,platform))\n\n        self.file.write('\\tEndGlobalSection\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionProperties) = preSolution\\n'\n                            '\\t\\tHideSolutionNode = FALSE\\n'\n                            '\\tEndGlobalSection\\n')\n        else:\n            self.file.write('\\tGlobalSection(ExtensibilityGlobals) = postSolution\\n'\n                            '\\tEndGlobalSection\\n'\n                            '\\tGlobalSection(ExtensibilityAddIns) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        self.file.write('EndGlobal\\n')\n        if self.nokeep == 0:\n            pdata = pickle.dumps(self.configs,1)\n            pdata = base64.encodestring(pdata)\n            self.file.write(pdata + '\\n')\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintSolution()\n            self.file.close()\n\nV6DSWHeader = \"\"\"\\\nMicrosoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"%(name)s\"=\"%(dspfile)s\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\"\"\"\n\nclass _GenerateV6DSW(_DSWGenerator):\n    \"\"\"Generates a Workspace file for MSVS 6.0\"\"\"\n\n    def PrintWorkspace(self):\n        \"\"\" writes a DSW file \"\"\"\n        name = self.name\n        dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path)\n        self.file.write(V6DSWHeader % locals())\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError, detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintWorkspace()\n            self.file.close()\n\n\ndef GenerateDSP(dspfile, source, env):\n    \"\"\"Generates a Project file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 10.0:\n        g = _GenerateV10DSP(dspfile, source, env)\n        g.Build()\n    elif version_num >= 7.0:\n        g = _GenerateV7DSP(dspfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSP(dspfile, source, env)\n        g.Build()\n\ndef GenerateDSW(dswfile, source, env):\n    \"\"\"Generates a Solution/Workspace file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 7.0:\n        g = _GenerateV7DSW(dswfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSW(dswfile, source, env)\n        g.Build()\n\n\n##############################################################################\n# Above here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef GetMSVSProjectSuffix(target, source, env, for_signature):\n    return env['MSVS']['PROJECTSUFFIX']\n\ndef GetMSVSSolutionSuffix(target, source, env, for_signature):\n    return env['MSVS']['SOLUTIONSUFFIX']\n\ndef GenerateProject(target, source, env):\n    # generate the dsp file, according to the version of MSVS.\n    builddspfile = target[0]\n    dspfile = builddspfile.srcnode()\n\n    # this detects whether or not we're using a VariantDir\n    if not dspfile is builddspfile:\n        try:\n            bdsp = open(str(builddspfile), \"w+\")\n        except IOError, detail:\n            print 'Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n'\n            raise\n\n        bdsp.write(\"This is just a placeholder file.\\nThe real project file is here:\\n%s\\n\" % dspfile.get_abspath())\n\n    GenerateDSP(dspfile, source, env)\n\n    if env.get('auto_build_solution', 1):\n        builddswfile = target[1]\n        dswfile = builddswfile.srcnode()\n\n        if not dswfile is builddswfile:\n\n            try:\n                bdsw = open(str(builddswfile), \"w+\")\n            except IOError, detail:\n                print 'Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n'\n                raise\n\n            bdsw.write(\"This is just a placeholder file.\\nThe real workspace file is here:\\n%s\\n\" % dswfile.get_abspath())\n\n        GenerateDSW(dswfile, source, env)\n\ndef GenerateSolution(target, source, env):\n    GenerateDSW(target[0], source, env)\n\ndef projectEmitter(target, source, env):\n    \"\"\"Sets up the DSP dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSPROJECTSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSPROJECTSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'prj_inputs:'\n        source = source + env.subst('$MSVSSCONSCOM', 1)\n        source = source + env.subst('$MSVSENCODING', 1)\n\n        # Project file depends on CPPDEFINES and CPPPATH\n        preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', []))))\n        includepath_Dirs = processIncludes(env.get('CPPPATH', []), env, None, None)\n        includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))\n        source = source + \"; ppdefs:%s incpath:%s\"%(preprocdefs, includepath)\n\n        if 'buildtarget' in env and env['buildtarget'] != None:\n            if SCons.Util.is_String(env['buildtarget']):\n                source = source + ' \"%s\"' % env['buildtarget']\n            elif SCons.Util.is_List(env['buildtarget']):\n                for bt in env['buildtarget']:\n                    if SCons.Util.is_String(bt):\n                        source = source + ' \"%s\"' % bt\n                    else:\n                        try: source = source + ' \"%s\"' % bt.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['buildtarget'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'outdir' in env and env['outdir'] != None:\n            if SCons.Util.is_String(env['outdir']):\n                source = source + ' \"%s\"' % env['outdir']\n            elif SCons.Util.is_List(env['outdir']):\n                for s in env['outdir']:\n                    if SCons.Util.is_String(s):\n                        source = source + ' \"%s\"' % s\n                    else:\n                        try: source = source + ' \"%s\"' % s.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['outdir'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        for s in _DSPGenerator.srcargs:\n            if s in env:\n                if SCons.Util.is_String(env[s]):\n                    source = source + ' \"%s' % env[s]\n                elif SCons.Util.is_List(env[s]):\n                    for t in env[s]:\n                        if SCons.Util.is_String(t):\n                            source = source + ' \"%s\"' % t\n                        else:\n                            raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n                else:\n                    raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    targetlist = [target[0]]\n    sourcelist = source\n\n    if env.get('auto_build_solution', 1):\n        env['projects'] = [env.File(t).srcnode() for t in targetlist]\n        t, s = solutionEmitter(target, target, env)\n        targetlist = targetlist + t\n\n    # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)\n    if float(env['MSVS_VERSION']) >= 10.0:\n        targetlist.append(targetlist[0] + '.filters')\n\n    return (targetlist, sourcelist)\n\ndef solutionEmitter(target, source, env):\n    \"\"\"Sets up the DSW dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSSOLUTIONSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'sln_inputs:'\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        if 'slnguid' in env:\n            if SCons.Util.is_String(env['slnguid']):\n                source = source + ' \"%s\"' % env['slnguid']\n            else:\n                raise SCons.Errors.InternalError(\"slnguid must be a string\")\n\n        if 'projects' in env:\n            if SCons.Util.is_String(env['projects']):\n                source = source + ' \"%s\"' % env['projects']\n            elif SCons.Util.is_List(env['projects']):\n                for t in env['projects']:\n                    if SCons.Util.is_String(t):\n                        source = source + ' \"%s\"' % t\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    return ([target[0]], source)\n\nprojectAction = SCons.Action.Action(GenerateProject, None)\n\nsolutionAction = SCons.Action.Action(GenerateSolution, None)\n\nprojectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM',\n                                       suffix = '$MSVSPROJECTSUFFIX',\n                                       emitter = projectEmitter)\n\nsolutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM',\n                                        suffix = '$MSVSSOLUTIONSUFFIX',\n                                        emitter = solutionEmitter)\n\ndefault_MSVS_SConscript = None\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Microsoft Visual\n    Studio project files to an Environment.\"\"\"\n    try:\n        env['BUILDERS']['MSVSProject']\n    except KeyError:\n        env['BUILDERS']['MSVSProject'] = projectBuilder\n\n    try:\n        env['BUILDERS']['MSVSSolution']\n    except KeyError:\n        env['BUILDERS']['MSVSSolution'] = solutionBuilder\n\n    env['MSVSPROJECTCOM'] = projectAction\n    env['MSVSSOLUTIONCOM'] = solutionAction\n\n    if SCons.Script.call_stack:\n        # XXX Need to find a way to abstract this; the build engine\n        # shouldn't depend on anything in SCons.Script.\n        env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript\n    else:\n        global default_MSVS_SConscript\n        if default_MSVS_SConscript is None:\n            default_MSVS_SConscript = env.File('SConstruct')\n        env['MSVSSCONSCRIPT'] = default_MSVS_SConscript\n\n    env['MSVSSCONS'] = '\"%s\" -c \"%s\"' % (python_executable, getExecScriptMain(env))\n    env['MSVSSCONSFLAGS'] = '-C \"${MSVSSCONSCRIPT.dir.abspath}\" -f ${MSVSSCONSCRIPT.name}'\n    env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'\n    env['MSVSBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c \"$MSVSBUILDTARGET\"'\n\n    # Set-up ms tools paths for default version\n    msvc_setup_env_once(env)\n\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    else:\n        (version_num, suite) = (7.0, None) # guess at a default\n    if 'MSVS' not in env:\n        env['MSVS'] = {}\n    if (version_num < 7.0):\n        env['MSVS']['PROJECTSUFFIX']  = '.dsp'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'\n    elif (version_num < 10.0):\n        env['MSVS']['PROJECTSUFFIX']  = '.vcproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n    else:\n        env['MSVS']['PROJECTSUFFIX']  = '.vcxproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n\n    if (version_num >= 10.0):\n        env['MSVSENCODING'] = 'utf-8'\n    else:\n        env['MSVSENCODING'] = 'Windows-1252'\n\n    env['GET_MSVSPROJECTSUFFIX']  = GetMSVSProjectSuffix\n    env['GET_MSVSSOLUTIONSUFFIX']  = GetMSVSSolutionSuffix\n    env['MSVSPROJECTSUFFIX']  = '${GET_MSVSPROJECTSUFFIX}'\n    env['MSVSSOLUTIONSUFFIX']  = '${GET_MSVSSOLUTIONSUFFIX}'\n    env['SCONS_HOME'] = os.environ.get('SCONS_HOME')\n\ndef exists(env):\n    return msvc_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mwcc.py",
    "content": "\"\"\"SCons.Tool.mwcc\n\nTool-specific initialization for the Metrowerks CodeWarrior compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mwcc.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\ndef set_vars(env):\n    \"\"\"Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars\n\n    MWCW_VERSIONS is set to a list of objects representing installed versions\n\n    MWCW_VERSION  is set to the version object that will be used for building.\n                  MWCW_VERSION can be set to a string during Environment\n                  construction to influence which version is chosen, otherwise\n                  the latest one from MWCW_VERSIONS is used.\n\n    Returns true if at least one version is found, false otherwise\n    \"\"\"\n    desired = env.get('MWCW_VERSION', '')\n\n    # return right away if the variables are already set\n    if isinstance(desired, MWVersion):\n        return 1\n    elif desired is None:\n        return 0\n\n    versions = find_versions()\n    version = None\n\n    if desired:\n        for v in versions:\n            if str(v) == desired:\n                version = v\n    elif versions:\n        version = versions[-1]\n\n    env['MWCW_VERSIONS'] = versions\n    env['MWCW_VERSION'] = version\n\n    if version is None:\n      return 0\n\n    env.PrependENVPath('PATH', version.clpath)\n    env.PrependENVPath('PATH', version.dllpath)\n    ENV = env['ENV']\n    ENV['CWFolder'] = version.path\n    ENV['LM_LICENSE_FILE'] = version.license\n    plus = lambda x: '+%s' % x\n    ENV['MWCIncludes'] = os.pathsep.join(map(plus, version.includes))\n    ENV['MWLibraries'] = os.pathsep.join(map(plus, version.libs))\n    return 1\n\n\ndef find_versions():\n    \"\"\"Return a list of MWVersion objects representing installed versions\"\"\"\n    versions = []\n\n    ### This function finds CodeWarrior by reading from the registry on\n    ### Windows. Some other method needs to be implemented for other\n    ### platforms, maybe something that calls env.WhereIs('mwcc')\n\n    if SCons.Util.can_read_reg:\n        try:\n            HLM = SCons.Util.HKEY_LOCAL_MACHINE\n            product = 'SOFTWARE\\\\Metrowerks\\\\CodeWarrior\\\\Product Versions'\n            product_key = SCons.Util.RegOpenKeyEx(HLM, product)\n\n            i = 0\n            while True:\n                name = product + '\\\\' + SCons.Util.RegEnumKey(product_key, i)\n                name_key = SCons.Util.RegOpenKeyEx(HLM, name)\n\n                try:\n                    version = SCons.Util.RegQueryValueEx(name_key, 'VERSION')\n                    path = SCons.Util.RegQueryValueEx(name_key, 'PATH')\n                    mwv = MWVersion(version[0], path[0], 'Win32-X86')\n                    versions.append(mwv)\n                except SCons.Util.RegError:\n                    pass\n\n                i = i + 1\n\n        except SCons.Util.RegError:\n            pass\n\n    return versions\n\n\nclass MWVersion(object):\n    def __init__(self, version, path, platform):\n        self.version = version\n        self.path = path\n        self.platform = platform\n        self.clpath = os.path.join(path, 'Other Metrowerks Tools',\n                                   'Command Line Tools')\n        self.dllpath = os.path.join(path, 'Bin')\n\n        # The Metrowerks tools don't store any configuration data so they\n        # are totally dumb when it comes to locating standard headers,\n        # libraries, and other files, expecting all the information\n        # to be handed to them in environment variables. The members set\n        # below control what information scons injects into the environment\n\n        ### The paths below give a normal build environment in CodeWarrior for\n        ### Windows, other versions of CodeWarrior might need different paths.\n\n        msl = os.path.join(path, 'MSL')\n        support = os.path.join(path, '%s Support' % platform)\n\n        self.license = os.path.join(path, 'license.dat')\n        self.includes = [msl, support]\n        self.libs = [msl, support]\n\n    def __str__(self):\n        return self.version\n\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the mwcc to an Environment.\"\"\"\n    import SCons.Defaults\n    import SCons.Tool\n\n    set_vars(env)\n\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n\n    env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -nolink -o $TARGET $SOURCES'\n\n    env['CC']         = 'mwcc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS'\n\n    env['CXX']        = 'mwcc'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'\n\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = '$CCFLAGS'\n    env['SHCFLAGS']   = '$CFLAGS'\n    env['SHCCCOM']    = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS'\n\n    env['SHCXX']       = '$CXX'\n    env['SHCXXFLAGS']  = '$CXXFLAGS'\n    env['SHCXXCOM']    = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cpp'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n\n    #env['PCH'] = ?\n    #env['PCHSTOP'] = ?\n\n\ndef exists(env):\n    return set_vars(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/mwld.py",
    "content": "\"\"\"SCons.Tool.mwld\n\nTool-specific initialization for the Metrowerks CodeWarrior linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mwld.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['AR'] = 'mwld'\n    env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES'\n\n    env['LIBDIRPREFIX'] = '-L'\n    env['LIBDIRSUFFIX'] = ''\n    env['LIBLINKPREFIX'] = '-l'\n    env['LIBLINKSUFFIX'] = '.lib'\n\n    env['LINK'] = 'mwld'\n    env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    env['SHLINK'] = '$LINK'\n    env['SHLINKFLAGS'] = '$LINKFLAGS'\n    env['SHLINKCOM']   = shlib_action\n    env['SHLIBEMITTER']= shlib_emitter\n\n\ndef exists(env):\n    import SCons.Tool.mwcc\n    return SCons.Tool.mwcc.set_vars(env)\n\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = ['$SHLINK', '$SHLINKFLAGS', '-shared']\n\n    no_import_lib = env.get('no_import_lib', 0)\n    if no_import_lib: cmd.extend('-noimplib')\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: cmd.extend(['-implib', implib.get_string(for_signature)])\n\n    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    return [cmd]\n\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$SHLIBSUFFIX\"))\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n\n        # Append an import library to the list of targets.\n        target.append(env.ReplaceIxes(dll,\n                                      'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                      'LIBPREFIX', 'LIBSUFFIX'))\n\n    return target, source\n\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/nasm.py",
    "content": "\"\"\"SCons.Tool.nasm\n\nTool-specific initialization for nasm, the famous Netwide Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/nasm.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for nasm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    env['AS']        = 'nasm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect('nasm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/rmic.py",
    "content": "\"\"\"SCons.Tool.rmic\n\nTool-specific initialization for rmic.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/rmic.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Util\n\ndef emit_rmic_classes(target, source, env):\n    \"\"\"Create and return lists of Java RMI stub and skeleton\n    class files to be created from a set of class files.\n    \"\"\"\n    class_suffix = env.get('JAVACLASSSUFFIX', '.class')\n    classdir = env.get('JAVACLASSDIR')\n\n    if not classdir:\n        try:\n            s = source[0]\n        except IndexError:\n            classdir = '.'\n        else:\n            try:\n                classdir = s.attributes.java_classdir\n            except AttributeError:\n                classdir = '.'\n    classdir = env.Dir(classdir).rdir()\n    if str(classdir) == '.':\n        c_ = None\n    else:\n        c_ = str(classdir) + os.sep\n\n    slist = []\n    for src in source:\n        try:\n            classname = src.attributes.java_classname\n        except AttributeError:\n            classname = str(src)\n            if c_ and classname[:len(c_)] == c_:\n                classname = classname[len(c_):]\n            if class_suffix and classname[:-len(class_suffix)] == class_suffix:\n                classname = classname[-len(class_suffix):]\n        s = src.rfile()\n        s.attributes.java_classdir = classdir\n        s.attributes.java_classname = classname\n        slist.append(s)\n\n    stub_suffixes = ['_Stub']\n    if env.get('JAVAVERSION') == '1.4':\n        stub_suffixes.append('_Skel')\n\n    tlist = []\n    for s in source:\n        for suff in stub_suffixes:\n            fname = s.attributes.java_classname.replace('.', os.sep) + \\\n                    suff + class_suffix\n            t = target[0].File(fname)\n            t.attributes.java_lookupdir = target[0]\n            tlist.append(t)\n\n    return tlist, source\n\nRMICAction = SCons.Action.Action('$RMICCOM', '$RMICCOMSTR')\n\nRMICBuilder = SCons.Builder.Builder(action = RMICAction,\n                     emitter = emit_rmic_classes,\n                     src_suffix = '$JAVACLASSSUFFIX',\n                     target_factory = SCons.Node.FS.Dir,\n                     source_factory = SCons.Node.FS.File)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for rmic to an Environment.\"\"\"\n    env['BUILDERS']['RMIC'] = RMICBuilder\n\n    env['RMIC']            = 'rmic'\n    env['RMICFLAGS']       = SCons.Util.CLVar('')\n    env['RMICCOM']         = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}'\n    env['JAVACLASSSUFFIX']  = '.class'\n\ndef exists(env):\n    # As reported by Jan Nijtmans in issue #2730, the simple\n    #    return env.Detect('rmic')\n    # doesn't always work during initialization. For now, we\n    # stop trying to detect an executable (analogous to the\n    # javac Builder).\n    # TODO: Come up with a proper detect() routine...and enable it.\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/rpcgen.py",
    "content": "\"\"\"SCons.Tool.rpcgen\n\nTool-specific initialization for RPCGEN tools.\n\nThree normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/rpcgen.py  2014/07/05 09:42:21 garyo\"\n\nfrom SCons.Builder import Builder\nimport SCons.Util\n\ncmd = \"cd ${SOURCE.dir} && $RPCGEN -%s $RPCGENFLAGS %s -o ${TARGET.abspath} ${SOURCE.file}\"\n\nrpcgen_client   = cmd % ('l', '$RPCGENCLIENTFLAGS')\nrpcgen_header   = cmd % ('h', '$RPCGENHEADERFLAGS')\nrpcgen_service  = cmd % ('m', '$RPCGENSERVICEFLAGS')\nrpcgen_xdr      = cmd % ('c', '$RPCGENXDRFLAGS')\n\ndef generate(env):\n    \"Add RPCGEN Builders and construction variables for an Environment.\"\n\n    client  = Builder(action=rpcgen_client,  suffix='_clnt.c', src_suffix='.x')\n    header  = Builder(action=rpcgen_header,  suffix='.h',      src_suffix='.x')\n    service = Builder(action=rpcgen_service, suffix='_svc.c',  src_suffix='.x')\n    xdr     = Builder(action=rpcgen_xdr,     suffix='_xdr.c',  src_suffix='.x')\n    env.Append(BUILDERS={'RPCGenClient'  : client,\n                         'RPCGenHeader'  : header,\n                         'RPCGenService' : service,\n                         'RPCGenXDR'     : xdr})\n    env['RPCGEN'] = 'rpcgen'\n    env['RPCGENFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENCLIENTFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENHEADERFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENSERVICEFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENXDRFLAGS'] = SCons.Util.CLVar('')\n\ndef exists(env):\n    return env.Detect('rpcgen')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sgiar.py",
    "content": "\"\"\"SCons.Tool.sgiar\n\nTool-specific initialization for SGI ar (library archive).  If CC\nexists, static libraries should be built with it, so the prelinker has\na chance to resolve C++ template instantiations.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgiar.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-ar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sgic++.py",
    "content": "\"\"\"SCons.Tool.sgic++\n\nTool-specific initialization for MIPSpro C++ on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgic++.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SGI MIPS C++ to an Environment.\"\"\"\n\n    cplusplus.generate(env)\n\n    env['CXX']         = 'CC'\n    env['CXXFLAGS']    = SCons.Util.CLVar('-LANG:std')\n    env['SHCXX']       = '$CXX'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sgicc.py",
    "content": "\"\"\"SCons.Tool.sgicc\n\nTool-specific initialization for MIPSPro cc on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgicc.py  2014/07/05 09:42:21 garyo\"\n\nimport cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'CC'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('cc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sgilink.py",
    "content": "\"\"\"SCons.Tool.sgilink\n\nTool-specific initialization for the SGI MIPSPro linker on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgilink.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport link\n\nlinkers = ['CC', 'cc']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MIPSPro to an Environment.\"\"\"\n    link.generate(env)\n\n    env['LINK'] = env.Detect(linkers) or 'cc'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-rpath '\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\ndef exists(env):\n    return env.Detect(linkers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sunar.py",
    "content": "\"\"\"engine.SCons.Tool.sunar\n\nTool-specific initialization for Solaris (Forte) ar (library archive). If CC\nexists, static libraries should be built with it, so that template\ninstantians can be resolved.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunar.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-xar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')\n    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sunc++.py",
    "content": "\"\"\"SCons.Tool.sunc++\n\nTool-specific initialization for C++ on SunOS / Solaris.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunc++.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons\n\nimport os\nimport re\nimport subprocess\n\ncplusplus = __import__('c++', globals(), locals(), [])\n\npackage_info = {}\n\ndef get_package_info(package_name, pkginfo, pkgchk):\n    try:\n        return package_info[package_name]\n    except KeyError:\n        version = None\n        pathname = None\n        try:\n            sadm_contents = open('/var/sadm/install/contents', 'r').read()\n        except EnvironmentError:\n            pass\n        else:\n            sadm_re = re.compile('^(\\S*/bin/CC)(=\\S*)? %s$' % package_name, re.M)\n            sadm_match = sadm_re.search(sadm_contents)\n            if sadm_match:\n                pathname = os.path.dirname(sadm_match.group(1))\n\n        try:\n            p = subprocess.Popen([pkginfo, '-l', package_name],\n                                 stdout=subprocess.PIPE,\n                                 stderr=open('/dev/null', 'w'))\n        except EnvironmentError:\n            pass\n        else:\n            pkginfo_contents = p.communicate()[0]\n            version_re = re.compile('^ *VERSION:\\s*(.*)$', re.M)\n            version_match = version_re.search(pkginfo_contents)\n            if version_match:\n                version = version_match.group(1)\n\n        if pathname is None:\n            try:\n                p = subprocess.Popen([pkgchk, '-l', package_name],\n                                     stdout=subprocess.PIPE,\n                                     stderr=open('/dev/null', 'w'))\n            except EnvironmentError:\n                pass\n            else:\n                pkgchk_contents = p.communicate()[0]\n                pathname_re = re.compile(r'^Pathname:\\s*(.*/bin/CC)$', re.M)\n                pathname_match = pathname_re.search(pkgchk_contents)\n                if pathname_match:\n                    pathname = os.path.dirname(pathname_match.group(1))\n\n        package_info[package_name] = (pathname, version)\n        return package_info[package_name]\n\n# use the package installer tool lslpp to figure out where cppc and what\n# version of it is installed\ndef get_cppc(env):\n    cxx = env.subst('$CXX')\n    if cxx:\n        cppcPath = os.path.dirname(cxx)\n    else:\n        cppcPath = None\n\n    cppcVersion = None\n\n    pkginfo = env.subst('$PKGINFO')\n    pkgchk = env.subst('$PKGCHK')\n\n    for package in ['SPROcpl']:\n        path, version = get_package_info(package, pkginfo, pkgchk)\n        if path and version:\n            cppcPath, cppcVersion = path, version\n            break\n\n    return (cppcPath, 'CC', 'CC', cppcVersion)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SunPRO C++.\"\"\"\n    path, cxx, shcxx, version = get_cppc(env)\n    if path:\n        cxx = os.path.join(path, cxx)\n        shcxx = os.path.join(path, shcxx)\n\n    cplusplus.generate(env)\n\n    env['CXX'] = cxx\n    env['SHCXX'] = shcxx\n    env['CXXVERSION'] = version\n    env['SHCXXFLAGS']   = SCons.Util.CLVar('$CXXFLAGS -KPIC')\n    env['SHOBJPREFIX']  = 'so_'\n    env['SHOBJSUFFIX']  = '.o'\n\ndef exists(env):\n    path, cxx, shcxx, version = get_cppc(env)\n    if path and cxx:\n        cppc = os.path.join(path, cxx)\n        if os.path.exists(cppc):\n            return cppc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/suncc.py",
    "content": "\"\"\"SCons.Tool.suncc\n\nTool-specific initialization for Sun Solaris (Forte) CC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/suncc.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Util\n\nimport cc\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Forte C and C++ compilers\n    to an Environment.\n    \"\"\"\n    cc.generate(env)\n\n    env['CXX']          = 'CC'\n    env['SHCCFLAGS']    = SCons.Util.CLVar('$CCFLAGS -KPIC')\n    env['SHOBJPREFIX']  = 'so_'\n    env['SHOBJSUFFIX']  = '.o'\n\ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/sunlink.py",
    "content": "\"\"\"SCons.Tool.sunlink\n\nTool-specific initialization for the Sun Solaris (Forte) linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunlink.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nimport link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor d in dirs:\n    linker = '/opt/' + d + '/bin/CC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Forte to an Environment.\"\"\"\n    link.generate(env)\n\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')\n\n    env['RPATHPREFIX'] = '-R'\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/tar.py",
    "content": "\"\"\"SCons.Tool.tar\n\nTool-specific initialization for tar.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/tar.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\ntars = ['tar', 'gtar']\n\nTarAction = SCons.Action.Action('$TARCOM', '$TARCOMSTR')\n\nTarBuilder = SCons.Builder.Builder(action = TarAction,\n                                   source_factory = SCons.Node.FS.Entry,\n                                   source_scanner = SCons.Defaults.DirScanner,\n                                   suffix = '$TARSUFFIX',\n                                   multi = 1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for tar to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Tar']\n    except KeyError:\n        bld = TarBuilder\n        env['BUILDERS']['Tar'] = bld\n\n    env['TAR']        = env.Detect(tars) or 'gtar'\n    env['TARFLAGS']   = SCons.Util.CLVar('-c')\n    env['TARCOM']     = '$TAR $TARFLAGS -f $TARGET $SOURCES'\n    env['TARSUFFIX']  = '.tar'\n\ndef exists(env):\n    return env.Detect(tars)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/textfile.py",
    "content": "# -*- python -*-\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nTextfile/Substfile builder for SCons.\n\n    Create file 'target' which typically is a textfile.  The 'source'\n    may be any combination of strings, Nodes, or lists of same.  A\n    'linesep' will be put between any part written and defaults to\n    os.linesep.\n\n    The only difference between the Textfile builder and the Substfile\n    builder is that strings are converted to Value() nodes for the\n    former and File() nodes for the latter.  To insert files in the\n    former or strings in the latter, wrap them in a File() or Value(),\n    respectively.\n\n    The values of SUBST_DICT first have any construction variables\n    expanded (its keys are not expanded).  If a value of SUBST_DICT is\n    a python callable function, it is called and the result is expanded\n    as the value.  Values are substituted in a \"random\" order; if any\n    substitution could be further expanded by another subsitition, it\n    is unpredictible whether the expansion will occur.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Tool/textfile.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons\n\nimport os\nimport re\n\nfrom SCons.Node import Node\nfrom SCons.Node.Python import Value\nfrom SCons.Util import is_String, is_Sequence, is_Dict\n\ndef _do_subst(node, subs):\n    \"\"\"\n    Fetch the node contents and replace all instances of the keys with\n    their values.  For example, if subs is\n        {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'},\n    then all instances of %VERSION% in the file will be replaced with\n    1.2345 and so forth.\n    \"\"\"\n    contents = node.get_text_contents()\n    if not subs: return contents\n    for (k,v) in subs:\n        contents = re.sub(k, v, contents)\n    return contents\n\ndef _action(target, source, env):\n    # prepare the line separator\n    linesep = env['LINESEPARATOR']\n    if linesep is None:\n        linesep = os.linesep\n    elif is_String(linesep):\n        pass\n    elif isinstance(linesep, Value):\n        linesep = linesep.get_text_contents()\n    else:\n        raise SCons.Errors.UserError(\n                           'unexpected type/class for LINESEPARATOR: %s'\n                                         % repr(linesep), None)\n\n    # create a dictionary to use for the substitutions\n    if 'SUBST_DICT' not in env:\n        subs = None    # no substitutions\n    else:\n        d = env['SUBST_DICT']\n        if is_Dict(d):\n            d = list(d.items())\n        elif is_Sequence(d):\n            pass\n        else:\n            raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence')\n        subs = []\n        for (k,v) in d:\n            if callable(v):\n                v = v()\n            if is_String(v):\n                v = env.subst(v)\n            else:\n                v = str(v)\n            subs.append((k,v))\n\n    # write the file\n    try:\n        fd = open(target[0].get_path(), \"wb\")\n    except (OSError,IOError), e:\n        raise SCons.Errors.UserError(\"Can't write target file %s\" % target[0])\n    # separate lines by 'linesep' only if linesep is not empty\n    lsep = None\n    for s in source:\n        if lsep: fd.write(lsep)\n        fd.write(_do_subst(s, subs))\n        lsep = linesep\n    fd.close()\n\ndef _strfunc(target, source, env):\n    return \"Creating '%s'\" % target[0]\n\ndef _convert_list_R(newlist, sources):\n    for elem in sources:\n        if is_Sequence(elem):\n            _convert_list_R(newlist, elem)\n        elif isinstance(elem, Node):\n            newlist.append(elem)\n        else:\n            newlist.append(Value(elem))\ndef _convert_list(target, source, env):\n    if len(target) != 1:\n        raise SCons.Errors.UserError(\"Only one target file allowed\")\n    newlist = []\n    _convert_list_R(newlist, source)\n    return target, newlist\n\n_common_varlist = ['SUBST_DICT', 'LINESEPARATOR']\n\n_text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']\n_text_builder = SCons.Builder.Builder(\n    action = SCons.Action.Action(_action, _strfunc, varlist = _text_varlist),\n    source_factory = Value,\n    emitter = _convert_list,\n    prefix = '$TEXTFILEPREFIX',\n    suffix = '$TEXTFILESUFFIX',\n    )\n\n_subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'TEXTFILESUFFIX']\n_subst_builder = SCons.Builder.Builder(\n    action = SCons.Action.Action(_action, _strfunc, varlist = _subst_varlist),\n    source_factory = SCons.Node.FS.File,\n    emitter = _convert_list,\n    prefix = '$SUBSTFILEPREFIX',\n    suffix = '$SUBSTFILESUFFIX',\n    src_suffix = ['.in'],\n    )\n\ndef generate(env):\n    env['LINESEPARATOR'] = os.linesep\n    env['BUILDERS']['Textfile'] = _text_builder\n    env['TEXTFILEPREFIX'] = ''\n    env['TEXTFILESUFFIX'] = '.txt'\n    env['BUILDERS']['Substfile'] = _subst_builder\n    env['SUBSTFILEPREFIX'] = ''\n    env['SUBSTFILESUFFIX'] = ''\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/tlib.py",
    "content": "\"\"\"SCons.Tool.tlib\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/tlib.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    SCons.Tool.bcc32.findIt('tlib', env)\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    env['AR']          = 'tlib'\n    env['ARFLAGS']     = SCons.Util.CLVar('')\n    env['ARCOM']       = '$AR $TARGET $ARFLAGS /a $SOURCES'\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\ndef exists(env):\n    return SCons.Tool.bcc32.findIt('tlib', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/wix.py",
    "content": "\"\"\"SCons.Tool.wix\n\nTool-specific initialization for wix, the Windows Installer XML Tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/wix.py  2014/07/05 09:42:21 garyo\"\n\nimport SCons.Builder\nimport SCons.Action\nimport os\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for WiX to an Environment.\"\"\"\n    if not exists(env):\n      return\n\n    env['WIXCANDLEFLAGS'] = ['-nologo']\n    env['WIXCANDLEINCLUDE'] = []\n    env['WIXCANDLECOM'] = '$WIXCANDLE $WIXCANDLEFLAGS -I $WIXCANDLEINCLUDE -o ${TARGET} ${SOURCE}'\n\n    env['WIXLIGHTFLAGS'].append( '-nologo' )\n    env['WIXLIGHTCOM'] = \"$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}\"\n    env['WIXSRCSUF'] = '.wxs'\n    env['WIXOBJSUF'] = '.wixobj'\n\n    object_builder = SCons.Builder.Builder(\n        action      = '$WIXCANDLECOM',\n        suffix      = '$WIXOBJSUF',\n        src_suffix  = '$WIXSRCSUF')\n\n    linker_builder = SCons.Builder.Builder(\n        action      = '$WIXLIGHTCOM',\n        src_suffix  = '$WIXOBJSUF',\n        src_builder = object_builder)\n\n    env['BUILDERS']['WiX'] = linker_builder\n\ndef exists(env):\n    env['WIXCANDLE'] = 'candle.exe'\n    env['WIXLIGHT']  = 'light.exe'\n\n    # try to find the candle.exe and light.exe tools and\n    # add the install directory to light libpath.\n    for path in os.environ['PATH'].split(os.pathsep):\n        if not path:\n            continue\n\n        # workaround for some weird python win32 bug.\n        if path[0] == '\"' and path[-1:]=='\"':\n            path = path[1:-1]\n\n        # normalize the path\n        path = os.path.normpath(path)\n\n        # search for the tools in the PATH environment variable\n        try:\n            files = os.listdir(path)\n            if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:\n                env.PrependENVPath('PATH', path)\n                # include appropriate flags if running WiX 2.0\n                if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:\n                    env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),\n                                             '-loc',\n                                             os.path.join( path, 'WixUI_en-us.wxl' ) ]\n                else:\n                    env['WIXLIGHTFLAGS'] = []\n                return 1\n        except OSError:\n            pass # ignore this, could be a stale PATH entry.\n\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/xgettext.py",
    "content": "\"\"\" xgettext tool\n\nTool specific initialization of `xgettext` tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/xgettext.py  2014/07/05 09:42:21 garyo\"\n\n#############################################################################\nclass _CmdRunner(object):\n  \"\"\" Callabe object, which runs shell command storing its stdout and stderr to\n  variables. It also provides `strfunction()` method, which shall be used by\n  scons Action objects to print command string. \"\"\"\n\n  def __init__( self, command, commandstr = None):\n    self.out = None\n    self.err = None\n    self.status = None\n    self.command = command\n    self.commandstr = commandstr\n\n  def __call__(self, target, source, env):\n    import SCons.Action\n    import subprocess\n    import os\n    import sys\n    kw = {\n      'stdin'  : 'devnull',\n      'stdout' : subprocess.PIPE,\n      'stderr' : subprocess.PIPE,\n      'universal_newlines' : True,\n      'shell'  : True\n    }\n    command = env.subst(self.command, target = target, source = source)\n    proc = SCons.Action._subproc(env, command, **kw)\n    self.out, self.err = proc.communicate()\n    self.status = proc.wait()\n    if self.err: sys.stderr.write(unicode(self.err))\n    return self.status\n\n  def strfunction(self, target, source, env):\n    import os\n    comstr = self.commandstr\n    if env.subst(comstr, target = target, source = source) == \"\":\n      comstr = self.command\n    s = env.subst(comstr, target = target, source = source)\n    return s\n#############################################################################\n\n#############################################################################\ndef _update_pot_file(target, source, env):\n  \"\"\" Action function for `POTUpdate` builder \"\"\"\n  import re\n  import os\n  import SCons.Action\n  nop = lambda target, source, env : 0\n\n  # Save scons cwd and os cwd (NOTE: they may be different. After the job, we\n  # revert ech one to its original state).\n  save_cwd = env.fs.getcwd()\n  save_os_cwd = os.getcwd()\n  chdir = target[0].dir\n  chdir_str = repr(chdir.get_abspath())\n  # Print chdir message (employ SCons.Action.Action for that. It knows better\n  # than me how to to this correctly).\n  env.Execute(SCons.Action.Action(nop, \"Entering \" + chdir_str))\n  # Go to target's directory and do our job\n  env.fs.chdir(chdir, 1) # Go into target's directory\n  try:\n    cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR')\n    action = SCons.Action.Action(cmd, strfunction=cmd.strfunction)\n    status = action([ target[0] ], source, env)\n  except:\n    # Something went wrong.\n    env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n    # Revert working dirs to previous state and re-throw exception.\n    env.fs.chdir(save_cwd, 0)\n    os.chdir(save_os_cwd)\n    raise\n  # Print chdir message.\n  env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n  # Revert working dirs to previous state.\n  env.fs.chdir(save_cwd, 0)\n  os.chdir(save_os_cwd)\n  # If the command was not successfull, return error code.\n  if status: return status\n\n  new_content = cmd.out\n\n  if not new_content:\n    # When xgettext finds no internationalized messages, no *.pot is created\n    # (because we don't want to bother translators with empty POT files).\n    needs_update = False\n    explain = \"no internationalized messages encountered\"\n  else:\n    if target[0].exists():\n      # If the file already exists, it's left unaltered unless its messages\n      # are outdated (w.r.t. to these recovered by xgettext from sources).\n      old_content = target[0].get_text_contents()\n      re_cdate = re.compile(r'^\"POT-Creation-Date: .*\"$[\\r\\n]?', re.M)\n      old_content_nocdate = re.sub(re_cdate,\"\",old_content)\n      new_content_nocdate = re.sub(re_cdate,\"\",new_content)\n      if(old_content_nocdate == new_content_nocdate):\n        # Messages are up-to-date\n        needs_update = False\n        explain = \"messages in file found to be up-to-date\"\n      else:\n        # Messages are outdated\n        needs_update = True\n        explain = \"messages in file were outdated\"\n    else:\n      # No POT file found, create new one\n      needs_update = True\n      explain = \"new file\"\n  if needs_update:\n    # Print message employing SCons.Action.Action for that.\n    msg = \"Writting \" + repr(str(target[0])) + \" (\" + explain + \")\"\n    env.Execute(SCons.Action.Action(nop, msg))\n    f = open(str(target[0]),\"w\")\n    f.write(new_content)\n    f.close()\n    return 0\n  else:\n    # Print message employing SCons.Action.Action for that.\n    msg = \"Not writting \" + repr(str(target[0])) + \" (\" + explain + \")\"\n    env.Execute(SCons.Action.Action(nop, msg))\n    return 0\n#############################################################################\n\n#############################################################################\nfrom SCons.Builder import BuilderBase\n#############################################################################\nclass _POTBuilder(BuilderBase):\n  def _execute(self, env, target, source, *args):\n    if not target:\n      if env.has_key('POTDOMAIN') and env['POTDOMAIN']:\n        domain = env['POTDOMAIN']\n      else:\n        domain = 'messages'\n      target = [ domain ]\n    return BuilderBase._execute(self, env, target, source, *args)\n#############################################################################\n\n#############################################################################\ndef _scan_xgettext_from_files(target, source, env, files = None, path = None):\n  \"\"\" Parses `POTFILES.in`-like file and returns list of extracted file names.\n  \"\"\"\n  import re\n  import SCons.Util\n  import SCons.Node.FS\n\n  if files is None:\n    return 0\n  if not SCons.Util.is_List(files):\n    files = [ files ]\n\n  if path is None:\n    if env.has_key('XGETTEXTPATH'):\n      path = env['XGETTEXTPATH']\n    else:\n      path = []\n  if not SCons.Util.is_List(path):\n    path = [ path ]\n\n  path = SCons.Util.flatten(path)\n\n  dirs = ()\n  for p in path:\n    if not isinstance(p, SCons.Node.FS.Base):\n      if SCons.Util.is_String(p):\n        p = env.subst(p, source = source, target = target)\n      p = env.arg2nodes(p, env.fs.Dir)\n    dirs += tuple(p)\n  # cwd is the default search path (when no path is defined by user)\n  if not dirs:\n    dirs = (env.fs.getcwd(),)\n\n  # Parse 'POTFILE.in' files.\n  re_comment = re.compile(r'^#[^\\n\\r]*$\\r?\\n?', re.M)\n  re_emptyln = re.compile(r'^[ \\t\\r]*$\\r?\\n?', re.M)\n  re_trailws = re.compile(r'[ \\t\\r]+$')\n  for f in files:\n    # Find files in search path $XGETTEXTPATH\n    if isinstance(f, SCons.Node.FS.Base) and f.rexists():\n      contents = f.get_text_contents()\n      contents = re_comment.sub(\"\", contents)\n      contents = re_emptyln.sub(\"\", contents)\n      contents = re_trailws.sub(\"\", contents)\n      depnames = contents.splitlines()\n      for depname in depnames:\n        depfile = SCons.Node.FS.find_file(depname, dirs)\n        if not depfile:\n          depfile = env.arg2nodes(depname, dirs[0].File)\n        env.Depends(target, depfile)\n  return 0\n#############################################################################\n\n#############################################################################\ndef _pot_update_emitter(target, source, env):\n  \"\"\" Emitter function for `POTUpdate` builder \"\"\"\n  from SCons.Tool.GettextCommon import _POTargetFactory\n  import SCons.Util\n  import SCons.Node.FS\n\n  if env.has_key('XGETTEXTFROM'):\n    xfrom = env['XGETTEXTFROM']\n  else:\n    return target, source\n  if not SCons.Util.is_List(xfrom):\n    xfrom = [ xfrom ]\n\n  xfrom = SCons.Util.flatten(xfrom)\n\n  # Prepare list of 'POTFILE.in' files.\n  files = []\n  for xf in xfrom:\n    if not isinstance(xf, SCons.Node.FS.Base):\n      if SCons.Util.is_String(xf):\n        # Interpolate variables in strings\n        xf = env.subst(xf, source = source, target = target)\n      xf = env.arg2nodes(xf)\n    files.extend(xf)\n  if files:\n    env.Depends(target, files)\n    _scan_xgettext_from_files(target, source, env, files)\n  return target, source\n#############################################################################\n\n#############################################################################\nfrom SCons.Environment import _null\n#############################################################################\ndef _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n  return env._POTUpdateBuilder(target, source, **kw)\n#############################################################################\n\n#############################################################################\ndef _POTUpdateBuilder(env, **kw):\n  \"\"\" Creates `POTUpdate` builder object \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _POTargetFactory\n  kw['action'] = SCons.Action.Action(_update_pot_file, None)\n  kw['suffix'] = '$POTSUFFIX'\n  kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File\n  kw['emitter'] = _pot_update_emitter\n  return _POTBuilder(**kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate `xgettext` tool \"\"\"\n  import SCons.Util\n  from SCons.Tool.GettextCommon import RPaths, _detect_xgettext\n\n  try:\n    env['XGETTEXT'] = _detect_xgettext(env)\n  except:\n    env['XGETTEXT'] = 'xgettext'\n  # NOTE: sources=\"$SOURCES\" would work as well. However, we use following\n  # construction to convert absolute paths provided by scons onto paths\n  # relative to current working dir. Note, that scons expands $SOURCE(S) to\n  # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in\n  # \"../\"). With source=$SOURCE these absolute paths would be written to the\n  # resultant *.pot file (and its derived *.po files) as references to lines in\n  # source code (e.g. referring lines in *.c files). Such references would be\n  # correct (e.g. in poedit) only on machine on which *.pot was generated and\n  # would be of no use on other hosts (having a copy of source code located\n  # in different place in filesystem).\n  sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET' \\\n    + ', SOURCES)} $)'\n\n  # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file.\n  # This is required by the POTUpdate builder's action.\n  xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \\\n    + ' $_XGETTEXTFROMFLAGS -o - ' + sources\n\n  xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \\\n    + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)'\n  xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \\\n    + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)'\n\n  env.SetDefault(\n    _XGETTEXTDOMAIN     = '${TARGET.filebase}',\n    XGETTEXTFLAGS       = [ ],\n    XGETTEXTCOM         = xgettextcom,\n    XGETTEXTCOMSTR      = '',\n    XGETTEXTPATH        = [ ],\n    XGETTEXTPATHPREFIX   = '-D',\n    XGETTEXTPATHSUFFIX   = '',\n    XGETTEXTFROM        = None,\n    XGETTEXTFROMPREFIX   = '-f',\n    XGETTEXTFROMSUFFIX   = '',\n   _XGETTEXTPATHFLAGS    = xgettextpathflags,\n   _XGETTEXTFROMFLAGS   = xgettextfromflags,\n    POTSUFFIX           =  ['.pot'],\n    POTUPDATE_ALIAS     = 'pot-update',\n    XgettextRPaths      = RPaths(env)\n  )\n  env.Append( BUILDERS = {\n    '_POTUpdateBuilder' : _POTUpdateBuilder(env)\n  } )\n  env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate')\n  env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check, whether the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _xgettext_exists\n  try:\n    return _xgettext_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/zip.py",
    "content": "\"\"\"SCons.Tool.zip\n\nTool-specific initialization for zip.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/zip.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\n\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\ntry:\n    import zipfile\n    internal_zip = 1\nexcept ImportError:\n    internal_zip = 0\n\nif internal_zip:\n    zipcompression = zipfile.ZIP_DEFLATED\n    def zip(target, source, env):\n        compression = env.get('ZIPCOMPRESSION', 0)\n        zf = zipfile.ZipFile(str(target[0]), 'w', compression)\n        for s in source:\n            if s.isdir():\n                for dirpath, dirnames, filenames in os.walk(str(s)):\n                    for fname in filenames:\n                        path = os.path.join(dirpath, fname)\n                        if os.path.isfile(path):\n                            zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))\n            else:\n                zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))\n        zf.close()\nelse:\n    zipcompression = 0\n    zip = \"$ZIP $ZIPFLAGS ${TARGET.abspath} $SOURCES\"\n\n\nzipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION'])\n\nZipBuilder = SCons.Builder.Builder(action = SCons.Action.Action('$ZIPCOM', '$ZIPCOMSTR'),\n                                   source_factory = SCons.Node.FS.Entry,\n                                   source_scanner = SCons.Defaults.DirScanner,\n                                   suffix = '$ZIPSUFFIX',\n                                   multi = 1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for zip to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Zip']\n    except KeyError:\n        bld = ZipBuilder\n        env['BUILDERS']['Zip'] = bld\n\n    env['ZIP']        = 'zip'\n    env['ZIPFLAGS']   = SCons.Util.CLVar('')\n    env['ZIPCOM']     = zipAction\n    env['ZIPCOMPRESSION'] =  zipcompression\n    env['ZIPSUFFIX']  = '.zip'\n    env['ZIPROOT']    = SCons.Util.CLVar('')\n\ndef exists(env):\n    return internal_zip or env.Detect('zip')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Util.py",
    "content": "\"\"\"SCons.Util\n\nVarious utility functions go here.\n\"\"\"\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Util.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport sys\nimport copy\nimport re\nimport types\n\nfrom collections import UserDict, UserList, UserString\n\n# Don't \"from types import ...\" these because we need to get at the\n# types module later to look for UnicodeType.\nInstanceType    = types.InstanceType\nMethodType      = types.MethodType\nFunctionType    = types.FunctionType\ntry: unicode\nexcept NameError: UnicodeType = None\nelse:             UnicodeType = unicode\n\ndef dictify(keys, values, result={}):\n    for k, v in zip(keys, values):\n        result[k] = v\n    return result\n\n_altsep = os.altsep\nif _altsep is None and sys.platform == 'win32':\n    # My ActivePython 2.0.1 doesn't set os.altsep!  What gives?\n    _altsep = '/'\nif _altsep:\n    def rightmost_separator(path, sep):\n        return max(path.rfind(sep), path.rfind(_altsep))\nelse:\n    def rightmost_separator(path, sep):\n        return path.rfind(sep)\n\n# First two from the Python Cookbook, just for completeness.\n# (Yeah, yeah, YAGNI...)\ndef containsAny(str, set):\n    \"\"\"Check whether sequence str contains ANY of the items in set.\"\"\"\n    for c in set:\n        if c in str: return 1\n    return 0\n\ndef containsAll(str, set):\n    \"\"\"Check whether sequence str contains ALL of the items in set.\"\"\"\n    for c in set:\n        if c not in str: return 0\n    return 1\n\ndef containsOnly(str, set):\n    \"\"\"Check whether sequence str contains ONLY items in set.\"\"\"\n    for c in str:\n        if c not in set: return 0\n    return 1\n\ndef splitext(path):\n    \"Same as os.path.splitext() but faster.\"\n    sep = rightmost_separator(path, os.sep)\n    dot = path.rfind('.')\n    # An ext is only real if it has at least one non-digit char\n    if dot > sep and not containsOnly(path[dot:], \"0123456789.\"):\n        return path[:dot],path[dot:]\n    else:\n        return path,\"\"\n\ndef updrive(path):\n    \"\"\"\n    Make the drive letter (if any) upper case.\n    This is useful because Windows is inconsitent on the case\n    of the drive letter, which can cause inconsistencies when\n    calculating command signatures.\n    \"\"\"\n    drive, rest = os.path.splitdrive(path)\n    if drive:\n        path = drive.upper() + rest\n    return path\n\nclass NodeList(UserList):\n    \"\"\"This class is almost exactly like a regular list of Nodes\n    (actually it can hold any object), with one important difference.\n    If you try to get an attribute from this list, it will return that\n    attribute from every item in the list.  For example:\n\n    >>> someList = NodeList([ '  foo  ', '  bar  ' ])\n    >>> someList.strip()\n    [ 'foo', 'bar' ]\n    \"\"\"\n    def __nonzero__(self):\n        return len(self.data) != 0\n\n    def __str__(self):\n        return ' '.join(map(str, self.data))\n\n    def __iter__(self):\n        return iter(self.data)\n\n    def __call__(self, *args, **kwargs):\n        result = [x(*args, **kwargs) for x in self.data]\n        return self.__class__(result)\n\n    def __getattr__(self, name):\n        result = [getattr(x, name) for x in self.data]\n        return self.__class__(result)\n\n\n_get_env_var = re.compile(r'^\\$([_a-zA-Z]\\w*|{[_a-zA-Z]\\w*})$')\n\ndef get_environment_var(varstr):\n    \"\"\"Given a string, first determine if it looks like a reference\n    to a single environment variable, like \"$FOO\" or \"${FOO}\".\n    If so, return that variable with no decorations (\"FOO\").\n    If not, return None.\"\"\"\n    mo=_get_env_var.match(to_String(varstr))\n    if mo:\n        var = mo.group(1)\n        if var[0] == '{':\n            return var[1:-1]\n        else:\n            return var\n    else:\n        return None\n\nclass DisplayEngine(object):\n    print_it = True\n    def __call__(self, text, append_newline=1):\n        if not self.print_it:\n            return\n        if append_newline: text = text + '\\n'\n        try:\n            sys.stdout.write(unicode(text))\n        except IOError:\n            # Stdout might be connected to a pipe that has been closed\n            # by now. The most likely reason for the pipe being closed\n            # is that the user has press ctrl-c. It this is the case,\n            # then SCons is currently shutdown. We therefore ignore\n            # IOError's here so that SCons can continue and shutdown\n            # properly so that the .sconsign is correctly written\n            # before SCons exits.\n            pass\n\n    def set_mode(self, mode):\n        self.print_it = mode\n\ndef render_tree(root, child_func, prune=0, margin=[0], visited={}):\n    \"\"\"\n    Render a tree of nodes into an ASCII tree view.\n    root - the root node of the tree\n    child_func - the function called to get the children of a node\n    prune - don't visit the same node twice\n    margin - the format of the left margin to use for children of root.\n       1 results in a pipe, and 0 results in no pipe.\n    visited - a dictionary of visited nodes in the current branch if not prune,\n       or in the whole tree if prune.\n    \"\"\"\n\n    rname = str(root)\n\n    children = child_func(root)\n    retval = \"\"\n    for pipe in margin[:-1]:\n        if pipe:\n            retval = retval + \"| \"\n        else:\n            retval = retval + \"  \"\n\n    if rname in visited:\n        return retval + \"+-[\" + rname + \"]\\n\"\n\n    retval = retval + \"+-\" + rname + \"\\n\"\n    if not prune:\n        visited = copy.copy(visited)\n    visited[rname] = 1\n\n    for i in range(len(children)):\n        margin.append(i<len(children)-1)\n        retval = retval + render_tree(children[i], child_func, prune, margin, visited\n)\n        margin.pop()\n\n    return retval\n\nIDX = lambda N: N and 1 or 0\n\ndef print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited={}):\n    \"\"\"\n    Print a tree of nodes.  This is like render_tree, except it prints\n    lines directly instead of creating a string representation in memory,\n    so that huge trees can be printed.\n\n    root - the root node of the tree\n    child_func - the function called to get the children of a node\n    prune - don't visit the same node twice\n    showtags - print status information to the left of each node line\n    margin - the format of the left margin to use for children of root.\n       1 results in a pipe, and 0 results in no pipe.\n    visited - a dictionary of visited nodes in the current branch if not prune,\n       or in the whole tree if prune.\n    \"\"\"\n\n    rname = str(root)\n\n    if showtags:\n\n        if showtags == 2:\n            legend = (' E         = exists\\n' +\n                      '  R        = exists in repository only\\n' +\n                      '   b       = implicit builder\\n' +\n                      '   B       = explicit builder\\n' +\n                      '    S      = side effect\\n' +\n                      '     P     = precious\\n' +\n                      '      A    = always build\\n' +\n                      '       C   = current\\n' +\n                      '        N  = no clean\\n' +\n                      '         H = no cache\\n' +\n                      '\\n')\n            sys.stdout.write(unicode(legend))\n\n        tags = ['[']\n        tags.append(' E'[IDX(root.exists())])\n        tags.append(' R'[IDX(root.rexists() and not root.exists())])\n        tags.append(' BbB'[[0,1][IDX(root.has_explicit_builder())] +\n                           [0,2][IDX(root.has_builder())]])\n        tags.append(' S'[IDX(root.side_effect)])\n        tags.append(' P'[IDX(root.precious)])\n        tags.append(' A'[IDX(root.always_build)])\n        tags.append(' C'[IDX(root.is_up_to_date())])\n        tags.append(' N'[IDX(root.noclean)])\n        tags.append(' H'[IDX(root.nocache)])\n        tags.append(']')\n\n    else:\n        tags = []\n\n    def MMM(m):\n        return [\"  \",\"| \"][m]\n    margins = list(map(MMM, margin[:-1]))\n\n    children = child_func(root)\n\n    if prune and rname in visited and children:\n        sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + u'\\n')\n        return\n\n    sys.stdout.write(''.join(tags + margins + ['+-', rname]) + u'\\n')\n\n    visited[rname] = 1\n\n    if children:\n        margin.append(1)\n        idx = IDX(showtags)\n        for C in children[:-1]:\n            print_tree(C, child_func, prune, idx, margin, visited)\n        margin[-1] = 0\n        print_tree(children[-1], child_func, prune, idx, margin, visited)\n        margin.pop()\n\n\n\n# Functions for deciding if things are like various types, mainly to\n# handle UserDict, UserList and UserString like their underlying types.\n#\n# Yes, all of this manual testing breaks polymorphism, and the real\n# Pythonic way to do all of this would be to just try it and handle the\n# exception, but handling the exception when it's not the right type is\n# often too slow.\n\n# We are using the following trick to speed up these\n# functions. Default arguments are used to take a snapshot of the\n# the global functions and constants used by these functions. This\n# transforms accesses to global variable into local variables\n# accesses (i.e. LOAD_FAST instead of LOAD_GLOBAL).\n\nDictTypes = (dict, UserDict)\nListTypes = (list, UserList)\nSequenceTypes = (list, tuple, UserList)\n\n# Note that profiling data shows a speed-up when comparing\n# explicitely with str and unicode instead of simply comparing\n# with basestring. (at least on Python 2.5.1)\nStringTypes = (str, unicode, UserString)\n\n# Empirically, it is faster to check explicitely for str and\n# unicode than for basestring.\nBaseStringTypes = (str, unicode)\n\ndef is_Dict(obj, isinstance=isinstance, DictTypes=DictTypes):\n    return isinstance(obj, DictTypes)\n\ndef is_List(obj, isinstance=isinstance, ListTypes=ListTypes):\n    return isinstance(obj, ListTypes)\n\ndef is_Sequence(obj, isinstance=isinstance, SequenceTypes=SequenceTypes):\n    return isinstance(obj, SequenceTypes)\n\ndef is_Tuple(obj, isinstance=isinstance, tuple=tuple):\n    return isinstance(obj, tuple)\n\ndef is_String(obj, isinstance=isinstance, StringTypes=StringTypes):\n    return isinstance(obj, StringTypes)\n\ndef is_Scalar(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes):\n    # Profiling shows that there is an impressive speed-up of 2x\n    # when explicitely checking for strings instead of just not\n    # sequence when the argument (i.e. obj) is already a string.\n    # But, if obj is a not string then it is twice as fast to\n    # check only for 'not sequence'. The following code therefore\n    # assumes that the obj argument is a string must of the time.\n    return isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes)\n\ndef do_flatten(sequence, result, isinstance=isinstance,\n               StringTypes=StringTypes, SequenceTypes=SequenceTypes):\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n\ndef flatten(obj, isinstance=isinstance, StringTypes=StringTypes,\n            SequenceTypes=SequenceTypes, do_flatten=do_flatten):\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Flatten() converts either a single scalar or a nested sequence\n    to a non-nested list. Note that flatten() considers strings\n    to be scalars instead of sequences like Python would.\n    \"\"\"\n    if isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes):\n        return [obj]\n    result = []\n    for item in obj:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\ndef flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes,\n                     SequenceTypes=SequenceTypes, do_flatten=do_flatten):\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Same as flatten(), but it does not handle the single scalar\n    case. This is slightly more efficient when one knows that\n    the sequence to flatten can not be a scalar.\n    \"\"\"\n    result = []\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\n# Generic convert-to-string functions that abstract away whether or\n# not the Python we're executing has Unicode support.  The wrapper\n# to_String_for_signature() will use a for_signature() method if the\n# specified object has one.\n#\ndef to_String(s,\n              isinstance=isinstance, str=str,\n              UserString=UserString, BaseStringTypes=BaseStringTypes):\n    if isinstance(s,BaseStringTypes):\n        # Early out when already a string!\n        return s\n    elif isinstance(s, UserString):\n        # s.data can only be either a unicode or a regular\n        # string. Please see the UserString initializer.\n        return s.data\n    else:\n        return str(s)\n\ndef to_String_for_subst(s,\n                        isinstance=isinstance, str=str, to_String=to_String,\n                        BaseStringTypes=BaseStringTypes, SequenceTypes=SequenceTypes,\n                        UserString=UserString):\n\n    # Note that the test cases are sorted by order of probability.\n    if isinstance(s, BaseStringTypes):\n        return s\n    elif isinstance(s, SequenceTypes):\n        l = []\n        for e in s:\n            l.append(to_String_for_subst(e))\n        return ' '.join( s )\n    elif isinstance(s, UserString):\n        # s.data can only be either a unicode or a regular\n        # string. Please see the UserString initializer.\n        return s.data\n    else:\n        return str(s)\n\ndef to_String_for_signature(obj, to_String_for_subst=to_String_for_subst,\n                            AttributeError=AttributeError):\n    try:\n        f = obj.for_signature\n    except AttributeError:\n        return to_String_for_subst(obj)\n    else:\n        return f()\n\n\n# The SCons \"semi-deep\" copy.\n#\n# This makes separate copies of lists (including UserList objects)\n# dictionaries (including UserDict objects) and tuples, but just copies\n# references to anything else it finds.\n#\n# A special case is any object that has a __semi_deepcopy__() method,\n# which we invoke to create the copy. Currently only used by\n# BuilderDict to actually prevent the copy operation (as invalid on that object)\n#\n# The dispatch table approach used here is a direct rip-off from the\n# normal Python copy module.\n\n_semi_deepcopy_dispatch = d = {}\n\ndef semi_deepcopy_dict(x, exclude = [] ):\n    copy = {}\n    for key, val in x.items():\n        # The regular Python copy.deepcopy() also deepcopies the key,\n        # as follows:\n        #\n        #    copy[semi_deepcopy(key)] = semi_deepcopy(val)\n        #\n        # Doesn't seem like we need to, but we'll comment it just in case.\n        if key not in exclude:\n            copy[key] = semi_deepcopy(val)\n    return copy\nd[dict] = semi_deepcopy_dict\n\ndef _semi_deepcopy_list(x):\n    return list(map(semi_deepcopy, x))\nd[list] = _semi_deepcopy_list\n\ndef _semi_deepcopy_tuple(x):\n    return tuple(map(semi_deepcopy, x))\nd[tuple] = _semi_deepcopy_tuple\n\ndef semi_deepcopy(x):\n    copier = _semi_deepcopy_dispatch.get(type(x))\n    if copier:\n        return copier(x)\n    else:\n        if hasattr(x, '__semi_deepcopy__') and callable(x.__semi_deepcopy__):\n            return x.__semi_deepcopy__()\n        elif isinstance(x, UserDict):\n            return x.__class__(semi_deepcopy_dict(x))\n        elif isinstance(x, UserList):\n            return x.__class__(_semi_deepcopy_list(x))\n\n        return x\n\n\nclass Proxy(object):\n    \"\"\"A simple generic Proxy class, forwarding all calls to\n    subject.  So, for the benefit of the python newbie, what does\n    this really mean?  Well, it means that you can take an object, let's\n    call it 'objA', and wrap it in this Proxy class, with a statement\n    like this\n\n                 proxyObj = Proxy(objA),\n\n    Then, if in the future, you do something like this\n\n                 x = proxyObj.var1,\n\n    since Proxy does not have a 'var1' attribute (but presumably objA does),\n    the request actually is equivalent to saying\n\n                 x = objA.var1\n\n    Inherit from this class to create a Proxy.\n\n    Note that, with new-style classes, this does *not* work transparently\n    for Proxy subclasses that use special .__*__() method names, because\n    those names are now bound to the class, not the individual instances.\n    You now need to know in advance which .__*__() method names you want\n    to pass on to the underlying Proxy object, and specifically delegate\n    their calls like this:\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n\n    def __init__(self, subject):\n        \"\"\"Wrap an object as a Proxy object\"\"\"\n        self._subject = subject\n\n    def __getattr__(self, name):\n        \"\"\"Retrieve an attribute from the wrapped object.  If the named\n           attribute doesn't exist, AttributeError is raised\"\"\"\n        return getattr(self._subject, name)\n\n    def get(self):\n        \"\"\"Retrieve the entire wrapped object\"\"\"\n        return self._subject\n\n    def __cmp__(self, other):\n        if issubclass(other.__class__, self._subject.__class__):\n            return cmp(self._subject, other)\n        return cmp(self.__dict__, other.__dict__)\n\nclass Delegate(object):\n    \"\"\"A Python Descriptor class that delegates attribute fetches\n    to an underlying wrapped subject of a Proxy.  Typical use:\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n    def __init__(self, attribute):\n        self.attribute = attribute\n    def __get__(self, obj, cls):\n        if isinstance(obj, cls):\n            return getattr(obj._subject, self.attribute)\n        else:\n            return self\n\n# attempt to load the windows registry module:\ncan_read_reg = 0\ntry:\n    import winreg\n\n    can_read_reg = 1\n    hkey_mod = winreg\n\n    RegOpenKeyEx    = winreg.OpenKeyEx\n    RegEnumKey      = winreg.EnumKey\n    RegEnumValue    = winreg.EnumValue\n    RegQueryValueEx = winreg.QueryValueEx\n    RegError        = winreg.error\n\nexcept ImportError:\n    try:\n        import win32api\n        import win32con\n        can_read_reg = 1\n        hkey_mod = win32con\n\n        RegOpenKeyEx    = win32api.RegOpenKeyEx\n        RegEnumKey      = win32api.RegEnumKey\n        RegEnumValue    = win32api.RegEnumValue\n        RegQueryValueEx = win32api.RegQueryValueEx\n        RegError        = win32api.error\n\n    except ImportError:\n        class _NoError(Exception):\n            pass\n        RegError = _NoError\n\nif can_read_reg:\n    HKEY_CLASSES_ROOT  = hkey_mod.HKEY_CLASSES_ROOT\n    HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE\n    HKEY_CURRENT_USER  = hkey_mod.HKEY_CURRENT_USER\n    HKEY_USERS         = hkey_mod.HKEY_USERS\n\n    def RegGetValue(root, key):\n        \"\"\"This utility function returns a value in the registry\n        without having to open the key first.  Only available on\n        Windows platforms with a version of Python that can read the\n        registry.  Returns the same thing as\n        SCons.Util.RegQueryValueEx, except you just specify the entire\n        path to the value, and don't have to bother opening the key\n        first.  So:\n\n        Instead of:\n          k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion')\n          out = SCons.Util.RegQueryValueEx(k,\n                'ProgramFilesDir')\n\n        You can write:\n          out = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir')\n        \"\"\"\n        # I would use os.path.split here, but it's not a filesystem\n        # path...\n        p = key.rfind('\\\\') + 1\n        keyp = key[:p-1]          # -1 to omit trailing slash\n        val = key[p:]\n        k = RegOpenKeyEx(root, keyp)\n        return RegQueryValueEx(k,val)\nelse:\n    try:\n        e = WindowsError\n    except NameError:\n        # Make sure we have a definition of WindowsError so we can\n        # run platform-independent tests of Windows functionality on\n        # platforms other than Windows.  (WindowsError is, in fact, an\n        # OSError subclass on Windows.)\n        class WindowsError(OSError):\n            pass\n        import builtins\n        builtins.WindowsError = WindowsError\n    else:\n        del e\n\n    HKEY_CLASSES_ROOT = None\n    HKEY_LOCAL_MACHINE = None\n    HKEY_CURRENT_USER = None\n    HKEY_USERS = None\n\n    def RegGetValue(root, key):\n        raise WindowsError\n\n    def RegOpenKeyEx(root, key):\n        raise WindowsError\n\nif sys.platform == 'win32':\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            try:\n                pathext = os.environ['PATHEXT']\n            except KeyError:\n                pathext = '.COM;.EXE;.BAT;.CMD'\n        if is_String(pathext):\n            pathext = pathext.split(os.pathsep)\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for dir in path:\n            f = os.path.join(dir, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelif os.name == 'os2':\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            pathext = ['.exe', '.cmd']\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for dir in path:\n            f = os.path.join(dir, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelse:\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        import stat\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for d in path:\n            f = os.path.join(d, file)\n            if os.path.isfile(f):\n                try:\n                    st = os.stat(f)\n                except OSError:\n                    # os.stat() raises OSError, not IOError if the file\n                    # doesn't exist, so in this case we let IOError get\n                    # raised so as to not mask possibly serious disk or\n                    # network issues.\n                    continue\n                if stat.S_IMODE(st[stat.ST_MODE]) & 0111:\n                    try:\n                        reject.index(f)\n                    except ValueError:\n                        return os.path.normpath(f)\n                    continue\n        return None\n\ndef PrependPath(oldpath, newpath, sep = os.pathsep,\n                delete_existing=1, canonicalize=None):\n    \"\"\"This prepends newpath elements to the given oldpath.  Will only\n    add any particular path once (leaving the first one it encounters\n    and ignoring the rest, to preserve path order), and will\n    os.path.normpath and os.path.normcase all paths to help assure\n    this.  This can also handle the case where the given old path\n    variable is a list instead of a string, in which case a list will\n    be returned instead of a string.\n\n    Example:\n      Old Path: \"/foo/bar:/foo\"\n      New Path: \"/biz/boom:/foo\"\n      Result:   \"/biz/boom:/foo:/foo/bar\"\n\n    If delete_existing is 0, then adding a path that exists will\n    not move it to the beginning; it will stay where it is in the\n    list.\n\n    If canonicalize is not None, it is applied to each element of\n    newpath before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = 1\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = 0\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [ newpath ]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # First uniquify the old paths, making sure to\n        # preserve the first instance (in Unix/Linux,\n        # the first one wins), and remembering them in normpaths.\n        # Then insert the new paths at the head of the list\n        # if they're not already in the normpaths list.\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        newpaths.reverse()      # since we're inserting at the head\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.insert(0, path)\n                normpaths.append(normpath)\n        paths = result\n\n    else:\n        newpaths = newpaths + paths # prepend new paths\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and not normpath in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n\n    if is_list:\n        return paths\n    else:\n        return sep.join(paths)\n\ndef AppendPath(oldpath, newpath, sep = os.pathsep,\n               delete_existing=1, canonicalize=None):\n    \"\"\"This appends new path elements to the given old path.  Will\n    only add any particular path once (leaving the last one it\n    encounters and ignoring the rest, to preserve path order), and\n    will os.path.normpath and os.path.normcase all paths to help\n    assure this.  This can also handle the case where the given old\n    path variable is a list instead of a string, in which case a list\n    will be returned instead of a string.\n\n    Example:\n      Old Path: \"/foo/bar:/foo\"\n      New Path: \"/biz/boom:/foo\"\n      Result:   \"/foo/bar:/biz/boom:/foo\"\n\n    If delete_existing is 0, then adding a path that exists\n    will not move it to the end; it will stay where it is in the list.\n\n    If canonicalize is not None, it is applied to each element of\n    newpath before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = 1\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = 0\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [ newpath ]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # add old paths to result, then\n        # add new paths if not already present\n        # (I thought about using a dict for normpaths for speed,\n        # but it's not clear hashing the strings would be faster\n        # than linear searching these typically short lists.)\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            result.append(path)\n            normpaths.append(os.path.normpath(os.path.normcase(path)))\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        paths = result\n    else:\n        # start w/ new paths, add old ones if not present,\n        # then reverse.\n        newpaths = paths + newpaths # append new paths\n        newpaths.reverse()\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and not normpath in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n        paths.reverse()\n\n    if is_list:\n        return paths\n    else:\n        return sep.join(paths)\n\nif sys.platform == 'cygwin':\n    def get_native_path(path):\n        \"\"\"Transforms an absolute path into a native path for the system.  In\n        Cygwin, this converts from a Cygwin path to a Windows one.\"\"\"\n        return os.popen('cygpath -w ' + path).read().replace('\\n', '')\nelse:\n    def get_native_path(path):\n        \"\"\"Transforms an absolute path into a native path for the system.\n        Non-Cygwin version, just leave the path alone.\"\"\"\n        return path\n\ndisplay = DisplayEngine()\n\ndef Split(arg):\n    if is_List(arg) or is_Tuple(arg):\n        return arg\n    elif is_String(arg):\n        return arg.split()\n    else:\n        return [arg]\n\nclass CLVar(UserList):\n    \"\"\"A class for command-line construction variables.\n\n    This is a list that uses Split() to split an initial string along\n    white-space arguments, and similarly to split any strings that get\n    added.  This allows us to Do the Right Thing with Append() and\n    Prepend() (as well as straight Python foo = env['VAR'] + 'arg1\n    arg2') regardless of whether a user adds a list or a string to a\n    command-line construction variable.\n    \"\"\"\n    def __init__(self, seq = []):\n        UserList.__init__(self, Split(seq))\n    def __add__(self, other):\n        return UserList.__add__(self, CLVar(other))\n    def __radd__(self, other):\n        return UserList.__radd__(self, CLVar(other))\n    def __coerce__(self, other):\n        return (self, CLVar(other))\n    def __str__(self):\n        return ' '.join(self.data)\n\n# A dictionary that preserves the order in which items are added.\n# Submitted by David Benjamin to ActiveState's Python Cookbook web site:\n#     http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747\n# Including fixes/enhancements from the follow-on discussions.\nclass OrderedDict(UserDict):\n    def __init__(self, dict = None):\n        self._keys = []\n        UserDict.__init__(self, dict)\n\n    def __delitem__(self, key):\n        UserDict.__delitem__(self, key)\n        self._keys.remove(key)\n\n    def __setitem__(self, key, item):\n        UserDict.__setitem__(self, key, item)\n        if key not in self._keys: self._keys.append(key)\n\n    def clear(self):\n        UserDict.clear(self)\n        self._keys = []\n\n    def copy(self):\n        dict = OrderedDict()\n        dict.update(self)\n        return dict\n\n    def items(self):\n        return list(zip(self._keys, list(self.values())))\n\n    def keys(self):\n        return self._keys[:]\n\n    def popitem(self):\n        try:\n            key = self._keys[-1]\n        except IndexError:\n            raise KeyError('dictionary is empty')\n\n        val = self[key]\n        del self[key]\n\n        return (key, val)\n\n    def setdefault(self, key, failobj = None):\n        UserDict.setdefault(self, key, failobj)\n        if key not in self._keys: self._keys.append(key)\n\n    def update(self, dict):\n        for (key, val) in dict.items():\n            self.__setitem__(key, val)\n\n    def values(self):\n        return list(map(self.get, self._keys))\n\nclass Selector(OrderedDict):\n    \"\"\"A callable ordered dictionary that maps file suffixes to\n    dictionary values.  We preserve the order in which items are added\n    so that get_suffix() calls always return the first suffix added.\"\"\"\n    def __call__(self, env, source, ext=None):\n        if ext is None:\n            try:\n                ext = source[0].suffix\n            except IndexError:\n                ext = \"\"\n        try:\n            return self[ext]\n        except KeyError:\n            # Try to perform Environment substitution on the keys of\n            # the dictionary before giving up.\n            s_dict = {}\n            for (k,v) in self.items():\n                if k is not None:\n                    s_k = env.subst(k)\n                    if s_k in s_dict:\n                        # We only raise an error when variables point\n                        # to the same suffix.  If one suffix is literal\n                        # and a variable suffix contains this literal,\n                        # the literal wins and we don't raise an error.\n                        raise KeyError(s_dict[s_k][0], k, s_k)\n                    s_dict[s_k] = (k,v)\n            try:\n                return s_dict[ext][1]\n            except KeyError:\n                try:\n                    return self[None]\n                except KeyError:\n                    return None\n\n\nif sys.platform == 'cygwin':\n    # On Cygwin, os.path.normcase() lies, so just report back the\n    # fact that the underlying Windows OS is case-insensitive.\n    def case_sensitive_suffixes(s1, s2):\n        return 0\nelse:\n    def case_sensitive_suffixes(s1, s2):\n        return (os.path.normcase(s1) != os.path.normcase(s2))\n\ndef adjustixes(fname, pre, suf, ensure_suffix=False):\n    if pre:\n        path, fn = os.path.split(os.path.normpath(fname))\n        if fn[:len(pre)] != pre:\n            fname = os.path.join(path, pre + fn)\n    # Only append a suffix if the suffix we're going to add isn't already\n    # there, and if either we've been asked to ensure the specific suffix\n    # is present or there's no suffix on it at all.\n    if suf and fname[-len(suf):] != suf and \\\n       (ensure_suffix or not splitext(fname)[1]):\n            fname = fname + suf\n    return fname\n\n\n\n# From Tim Peters,\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# (Also in the printed Python Cookbook.)\n\ndef unique(s):\n    \"\"\"Return a list of the elements in s, but without duplicates.\n\n    For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],\n    unique(\"abcabc\") some permutation of [\"a\", \"b\", \"c\"], and\n    unique(([1, 2], [2, 3], [1, 2])) some permutation of\n    [[2, 3], [1, 2]].\n\n    For best speed, all sequence elements should be hashable.  Then\n    unique() will usually work in linear time.\n\n    If not possible, the sequence elements should enjoy a total\n    ordering, and if list(s).sort() doesn't raise TypeError it's\n    assumed that they do enjoy a total ordering.  Then unique() will\n    usually work in O(N*log2(N)) time.\n\n    If that's not possible either, the sequence elements must support\n    equality-testing.  Then unique() will usually work in quadratic\n    time.\n    \"\"\"\n\n    n = len(s)\n    if n == 0:\n        return []\n\n    # Try using a dict first, as that's the fastest and will usually\n    # work.  If it doesn't work, it will usually fail quickly, so it\n    # usually doesn't cost much to *try* it.  It requires that all the\n    # sequence elements be hashable, and support equality comparison.\n    u = {}\n    try:\n        for x in s:\n            u[x] = 1\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        return list(u.keys())\n    del u\n\n    # We can't hash all the elements.  Second fastest is to sort,\n    # which brings the equal elements together; then duplicates are\n    # easy to weed out in a single pass.\n    # NOTE:  Python's list.sort() was designed to be efficient in the\n    # presence of many duplicate elements.  This isn't true of all\n    # sort functions in all languages or libraries, so this approach\n    # is more effective in Python than it may be elsewhere.\n    try:\n        t = sorted(s)\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        assert n > 0\n        last = t[0]\n        lasti = i = 1\n        while i < n:\n            if t[i] != last:\n                t[lasti] = last = t[i]\n                lasti = lasti + 1\n            i = i + 1\n        return t[:lasti]\n    del t\n\n    # Brute force is all that's left.\n    u = []\n    for x in s:\n        if x not in u:\n            u.append(x)\n    return u\n\n\n\n# From Alex Martelli,\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# First comment, dated 2001/10/13.\n# (Also in the printed Python Cookbook.)\n\ndef uniquer(seq, idfun=None):\n    if idfun is None:\n        def idfun(x): return x\n    seen = {}\n    result = []\n    for item in seq:\n        marker = idfun(item)\n        # in old Python versions:\n        # if seen.has_key(marker)\n        # but in new ones:\n        if marker in seen: continue\n        seen[marker] = 1\n        result.append(item)\n    return result\n\n# A more efficient implementation of Alex's uniquer(), this avoids the\n# idfun() argument and function-call overhead by assuming that all\n# items in the sequence are hashable.\n\ndef uniquer_hashables(seq):\n    seen = {}\n    result = []\n    for item in seq:\n        #if not item in seen:\n        if item not in seen:\n            seen[item] = 1\n            result.append(item)\n    return result\n\n\n\n# Much of the logic here was originally based on recipe 4.9 from the\n# Python CookBook, but we had to dumb it way down for Python 1.5.2.\nclass LogicalLines(object):\n\n    def __init__(self, fileobj):\n        self.fileobj = fileobj\n\n    def readline(self):\n        result = []\n        while True:\n            line = self.fileobj.readline()\n            if not line:\n                break\n            if line[-2:] == '\\\\\\n':\n                result.append(line[:-2])\n            else:\n                result.append(line)\n                break\n        return ''.join(result)\n\n    def readlines(self):\n        result = []\n        while True:\n            line = self.readline()\n            if not line:\n                break\n            result.append(line)\n        return result\n\n\n\nclass UniqueList(UserList):\n    def __init__(self, seq = []):\n        UserList.__init__(self, seq)\n        self.unique = True\n    def __make_unique(self):\n        if not self.unique:\n            self.data = uniquer_hashables(self.data)\n            self.unique = True\n    def __lt__(self, other):\n        self.__make_unique()\n        return UserList.__lt__(self, other)\n    def __le__(self, other):\n        self.__make_unique()\n        return UserList.__le__(self, other)\n    def __eq__(self, other):\n        self.__make_unique()\n        return UserList.__eq__(self, other)\n    def __ne__(self, other):\n        self.__make_unique()\n        return UserList.__ne__(self, other)\n    def __gt__(self, other):\n        self.__make_unique()\n        return UserList.__gt__(self, other)\n    def __ge__(self, other):\n        self.__make_unique()\n        return UserList.__ge__(self, other)\n    def __cmp__(self, other):\n        self.__make_unique()\n        return UserList.__cmp__(self, other)\n    def __len__(self):\n        self.__make_unique()\n        return UserList.__len__(self)\n    def __getitem__(self, i):\n        self.__make_unique()\n        return UserList.__getitem__(self, i)\n    def __setitem__(self, i, item):\n        UserList.__setitem__(self, i, item)\n        self.unique = False\n    def __getslice__(self, i, j):\n        self.__make_unique()\n        return UserList.__getslice__(self, i, j)\n    def __setslice__(self, i, j, other):\n        UserList.__setslice__(self, i, j, other)\n        self.unique = False\n    def __add__(self, other):\n        result = UserList.__add__(self, other)\n        result.unique = False\n        return result\n    def __radd__(self, other):\n        result = UserList.__radd__(self, other)\n        result.unique = False\n        return result\n    def __iadd__(self, other):\n        result = UserList.__iadd__(self, other)\n        result.unique = False\n        return result\n    def __mul__(self, other):\n        result = UserList.__mul__(self, other)\n        result.unique = False\n        return result\n    def __rmul__(self, other):\n        result = UserList.__rmul__(self, other)\n        result.unique = False\n        return result\n    def __imul__(self, other):\n        result = UserList.__imul__(self, other)\n        result.unique = False\n        return result\n    def append(self, item):\n        UserList.append(self, item)\n        self.unique = False\n    def insert(self, i):\n        UserList.insert(self, i)\n        self.unique = False\n    def count(self, item):\n        self.__make_unique()\n        return UserList.count(self, item)\n    def index(self, item):\n        self.__make_unique()\n        return UserList.index(self, item)\n    def reverse(self):\n        self.__make_unique()\n        UserList.reverse(self)\n    def sort(self, *args, **kwds):\n        self.__make_unique()\n        return UserList.sort(self, *args, **kwds)\n    def extend(self, other):\n        UserList.extend(self, other)\n        self.unique = False\n\n\nclass Unbuffered(object):\n    \"\"\"\n    A proxy class that wraps a file object, flushing after every write,\n    and delegating everything else to the wrapped object.\n    \"\"\"\n    def __init__(self, file):\n        self.file = file\n        self.softspace = 0  ## backward compatibility; not supported in Py3k\n    def write(self, arg):\n        try:\n            self.file.write(arg)\n            self.file.flush()\n        except IOError:\n            # Stdout might be connected to a pipe that has been closed\n            # by now. The most likely reason for the pipe being closed\n            # is that the user has press ctrl-c. It this is the case,\n            # then SCons is currently shutdown. We therefore ignore\n            # IOError's here so that SCons can continue and shutdown\n            # properly so that the .sconsign is correctly written\n            # before SCons exits.\n            pass\n    def __getattr__(self, attr):\n        return getattr(self.file, attr)\n\ndef make_path_relative(path):\n    \"\"\" makes an absolute path name to a relative pathname.\n    \"\"\"\n    if os.path.isabs(path):\n        drive_s,path = os.path.splitdrive(path)\n\n        import re\n        if not drive_s:\n            path=re.compile(\"/*(.*)\").findall(path)[0]\n        else:\n            path=path[1:]\n\n    assert( not os.path.isabs( path ) ), path\n    return path\n\n\n\n# The original idea for AddMethod() and RenameFunction() come from the\n# following post to the ActiveState Python Cookbook:\n#\n#\tASPN: Python Cookbook : Install bound methods in an instance\n#\thttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613\n#\n# That code was a little fragile, though, so the following changes\n# have been wrung on it:\n#\n# * Switched the installmethod() \"object\" and \"function\" arguments,\n#   so the order reflects that the left-hand side is the thing being\n#   \"assigned to\" and the right-hand side is the value being assigned.\n#\n# * Changed explicit type-checking to the \"try: klass = object.__class__\"\n#   block in installmethod() below so that it still works with the\n#   old-style classes that SCons uses.\n#\n# * Replaced the by-hand creation of methods and functions with use of\n#   the \"new\" module, as alluded to in Alex Martelli's response to the\n#   following Cookbook post:\n#\n#\tASPN: Python Cookbook : Dynamically added methods to a class\n#\thttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732\n\ndef AddMethod(obj, function, name=None):\n    \"\"\"\n    Adds either a bound method to an instance or an unbound method to\n    a class. If name is ommited the name of the specified function\n    is used by default.\n    Example:\n      a = A()\n      def f(self, x, y):\n        self.z = x + y\n      AddMethod(f, A, \"add\")\n      a.add(2, 4)\n      print a.z\n      AddMethod(lambda self, i: self.l[i], a, \"listIndex\")\n      print a.listIndex(5)\n    \"\"\"\n    if name is None:\n        name = function.func_name\n    else:\n        function = RenameFunction(function, name)\n\n    if hasattr(obj, '__class__') and obj.__class__ is not type:\n        # \"obj\" is an instance, so it gets a bound method.\n        setattr(obj, name, MethodType(function, obj, obj.__class__))\n    else:\n        # \"obj\" is a class, so it gets an unbound method.\n        setattr(obj, name, MethodType(function, None, obj))\n\ndef RenameFunction(function, name):\n    \"\"\"\n    Returns a function identical to the specified function, but with\n    the specified name.\n    \"\"\"\n    return FunctionType(function.func_code,\n                        function.func_globals,\n                        name,\n                        function.func_defaults)\n\n\nmd5 = False\ndef MD5signature(s):\n    return str(s)\n\ndef MD5filesignature(fname, chunksize=65536):\n    f = open(fname, \"rb\")\n    result = f.read()\n    f.close()\n    return result\n\ntry:\n    import hashlib\nexcept ImportError:\n    pass\nelse:\n    if hasattr(hashlib, 'md5'):\n        md5 = True\n        def MD5signature(s):\n            m = hashlib.md5()\n            m.update(str(s))\n            return m.hexdigest()\n\n        def MD5filesignature(fname, chunksize=65536):\n            m = hashlib.md5()\n            f = open(fname, \"rb\")\n            while True:\n                blck = f.read(chunksize)\n                if not blck:\n                    break\n                m.update(str(blck))\n            f.close()\n            return m.hexdigest()\n\ndef MD5collect(signatures):\n    \"\"\"\n    Collects a list of signatures into an aggregate signature.\n\n    signatures - a list of signatures\n    returns - the aggregate signature\n    \"\"\"\n    if len(signatures) == 1:\n        return signatures[0]\n    else:\n        return MD5signature(', '.join(signatures))\n\n\n\ndef silent_intern(x):\n    \"\"\"\n    Perform sys.intern() on the passed argument and return the result.\n    If the input is ineligible (e.g. a unicode string) the original argument is\n    returned and no exception is thrown.\n    \"\"\"\n    try:\n        return sys.intern(x)\n    except TypeError:\n        return x\n\n\n\n# From Dinu C. Gherman,\n# Python Cookbook, second edition, recipe 6.17, p. 277.\n# Also:\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/68205\n# ASPN: Python Cookbook: Null Object Design Pattern\n\n#TODO??? class Null(object):\nclass Null(object):\n    \"\"\" Null objects always and reliably \"do nothing.\" \"\"\"\n    def __new__(cls, *args, **kwargs):\n        if not '_instance' in vars(cls):\n            cls._instance = super(Null, cls).__new__(cls, *args, **kwargs)\n        return cls._instance\n    def __init__(self, *args, **kwargs):\n        pass\n    def __call__(self, *args, **kwargs):\n        return self\n    def __repr__(self):\n        return \"Null(0x%08X)\" % id(self)\n    def __nonzero__(self):\n        return False\n    def __getattr__(self, name):\n        return self\n    def __setattr__(self, name, value):\n        return self\n    def __delattr__(self, name):\n        return self\n\nclass NullSeq(Null):\n    def __len__(self):\n        return 0\n    def __iter__(self):\n        return iter(())\n    def __getitem__(self, i):\n        return self\n    def __delitem__(self, i):\n        return self\n    def __setitem__(self, i, v):\n        return self\n\n\ndel __revision__\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/BoolVariable.py",
    "content": "\"\"\"engine.SCons.Variables.BoolVariable\n\nThis file defines the option type for SCons implementing true/false values.\n\nUsage example:\n\n  opts = Variables()\n  opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))\n  ...\n  if env['embedded'] == 1:\n    ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/BoolVariable.py  2014/07/05 09:42:21 garyo\"\n\n__all__ = ['BoolVariable',]\n\nimport SCons.Errors\n\n__true_strings  = ('y', 'yes', 'true', 't', '1', 'on' , 'all' )\n__false_strings = ('n', 'no', 'false', 'f', '0', 'off', 'none')\n\n\ndef _text2bool(val):\n    \"\"\"\n    Converts strings to True/False depending on the 'truth' expressed by\n    the string. If the string can't be converted, the original value\n    will be returned.\n\n    See '__true_strings' and '__false_strings' for values considered\n    'true' or 'false respectivly.\n\n    This is usable as 'converter' for SCons' Variables.\n    \"\"\"\n    lval = val.lower()\n    if lval in __true_strings: return True\n    if lval in __false_strings: return False\n    raise ValueError(\"Invalid value for boolean option: %s\" % val)\n\n\ndef _validator(key, val, env):\n    \"\"\"\n    Validates the given value to be either '0' or '1'.\n\n    This is usable as 'validator' for SCons' Variables.\n    \"\"\"\n    if not env[key] in (True, False):\n        raise SCons.Errors.UserError(\n            'Invalid value for boolean option %s: %s' % (key, env[key]))\n\n\ndef BoolVariable(key, help, default):\n    \"\"\"\n    The input parameters describe a boolen option, thus they are\n    returned with the correct converter and validator appended. The\n    'help' text will by appended by '(yes|no) to show the valid\n    valued. The result is usable for input to opts.Add().\n    \"\"\"\n    return (key, '%s (yes|no)' % help, default,\n            _validator, _text2bool)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/EnumVariable.py",
    "content": "\"\"\"engine.SCons.Variables.EnumVariable\n\nThis file defines the option type for SCons allowing only specified\ninput-values.\n\nUsage example:\n\n  opts = Variables()\n  opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',\n                      allowed_values=('yes', 'no', 'full'),\n                      map={}, ignorecase=2))\n  ...\n  if env['debug'] == 'full':\n    ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/EnumVariable.py  2014/07/05 09:42:21 garyo\"\n\n__all__ = ['EnumVariable',]\n\n\nimport SCons.Errors\n\ndef _validator(key, val, env, vals):\n    if not val in vals:\n        raise SCons.Errors.UserError(\n            'Invalid value for option %s: %s.  Valid values are: %s' % (key, val, vals))\n\n\ndef EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):\n    \"\"\"\n    The input parameters describe a option with only certain values\n    allowed. They are returned with an appropriate converter and\n    validator appended. The result is usable for input to\n    Variables.Add().\n\n    'key' and 'default' are the values to be passed on to Variables.Add().\n\n    'help' will be appended by the allowed values automatically\n\n    'allowed_values' is a list of strings, which are allowed as values\n    for this option.\n\n    The 'map'-dictionary may be used for converting the input value\n    into canonical values (eg. for aliases).\n\n    'ignorecase' defines the behaviour of the validator:\n\n    If ignorecase == 0, the validator/converter are case-sensitive.\n    If ignorecase == 1, the validator/converter are case-insensitive.\n    If ignorecase == 2, the validator/converter is case-insensitive and\n                        the converted value will always be lower-case.\n\n    The 'validator' tests whether the value is in the list of allowed\n    values. The 'converter' converts input values according to the\n    given 'map'-dictionary (unmapped input values are returned\n    unchanged).\n    \"\"\"\n    help = '%s (%s)' % (help, '|'.join(allowed_values))\n    # define validator\n    if ignorecase >= 1:\n        validator = lambda key, val, env: \\\n                    _validator(key, val.lower(), env, allowed_values)\n    else:\n        validator = lambda key, val, env: \\\n                    _validator(key, val, env, allowed_values)\n    # define converter\n    if ignorecase == 2:\n        converter = lambda val: map.get(val.lower(), val).lower()\n    elif ignorecase == 1:\n        converter = lambda val: map.get(val.lower(), val)\n    else:\n        converter = lambda val: map.get(val, val)\n    return (key, help, default, validator, converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/ListVariable.py",
    "content": "\"\"\"engine.SCons.Variables.ListVariable\n\nThis file defines the option type for SCons implementing 'lists'.\n\nA 'list' option may either be 'all', 'none' or a list of names\nseparated by comma. After the option has been processed, the option\nvalue holds either the named list elements, all list elemens or no\nlist elements at all.\n\nUsage example:\n\n  list_of_libs = Split('x11 gl qt ical')\n\n  opts = Variables()\n  opts.Add(ListVariable('shared',\n                      'libraries to build as shared libraries',\n                      'all',\n                      elems = list_of_libs))\n  ...\n  for lib in list_of_libs:\n     if lib in env['shared']:\n         env.SharedObject(...)\n     else:\n         env.Object(...)\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Variables/ListVariable.py  2014/07/05 09:42:21 garyo\"\n\n# Know Bug: This should behave like a Set-Type, but does not really,\n# since elements can occur twice.\n\n__all__ = ['ListVariable',]\n\nimport collections\n\nimport SCons.Util\n\n\nclass _ListVariable(collections.UserList):\n    def __init__(self, initlist=[], allowedElems=[]):\n        collections.UserList.__init__(self, [_f for _f in initlist if _f])\n        self.allowedElems = sorted(allowedElems)\n\n    def __cmp__(self, other):\n        return NotImplemented\n    def __eq__(self, other):\n        return NotImplemented\n    def __ge__(self, other):\n        return NotImplemented\n    def __gt__(self, other):\n        return NotImplemented\n    def __le__(self, other):\n        return NotImplemented\n    def __lt__(self, other):\n        return NotImplemented\n    def __str__(self):\n        if len(self) == 0:\n            return 'none'\n        self.data.sort()\n        if self.data == self.allowedElems:\n            return 'all'\n        else:\n            return ','.join(self)\n    def prepare_to_store(self):\n        return self.__str__()\n\ndef _converter(val, allowedElems, mapdict):\n    \"\"\"\n    \"\"\"\n    if val == 'none':\n        val = []\n    elif val == 'all':\n        val = allowedElems\n    else:\n        val = [_f for _f in val.split(',') if _f]\n        val = [mapdict.get(v, v) for v in val]\n        notAllowed = [v for v in val if not v in allowedElems]\n        if notAllowed:\n            raise ValueError(\"Invalid value(s) for option: %s\" %\n                             ','.join(notAllowed))\n    return _ListVariable(val, allowedElems)\n\n\n## def _validator(key, val, env):\n##     \"\"\"\n##     \"\"\"\n##     # todo: write validater for pgk list\n##     return 1\n\n\ndef ListVariable(key, help, default, names, map={}):\n    \"\"\"\n    The input parameters describe a 'package list' option, thus they\n    are returned with the correct converter and validater appended. The\n    result is usable for input to opts.Add() .\n\n    A 'package list' option may either be 'all', 'none' or a list of\n    package names (separated by space).\n    \"\"\"\n    names_str = 'allowed names: %s' % ' '.join(names)\n    if SCons.Util.is_List(default):\n        default = ','.join(default)\n    help = '\\n    '.join(\n        (help, '(all|none|comma-separated list of names)', names_str))\n    return (key, help, default,\n            None, #_validator,\n            lambda val: _converter(val, names, map))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/PackageVariable.py",
    "content": "\"\"\"engine.SCons.Variables.PackageVariable\n\nThis file defines the option type for SCons implementing 'package\nactivation'.\n\nTo be used whenever a 'package' may be enabled/disabled and the\npackage path may be specified.\n\nUsage example:\n\n  Examples:\n      x11=no   (disables X11 support)\n      x11=yes  (will search for the package installation dir)\n      x11=/usr/local/X11 (will check this path for existance)\n\n  To replace autoconf's --with-xxx=yyy\n\n  opts = Variables()\n  opts.Add(PackageVariable('x11',\n                         'use X11 installed here (yes = search some places',\n                         'yes'))\n  ...\n  if env['x11'] == True:\n      dir = ... search X11 in some standard places ...\n      env['x11'] = dir\n  if env['x11']:\n      ... build with x11 ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/PackageVariable.py  2014/07/05 09:42:21 garyo\"\n\n__all__ = ['PackageVariable',]\n\nimport SCons.Errors\n\n__enable_strings  = ('1', 'yes', 'true',  'on', 'enable', 'search')\n__disable_strings = ('0', 'no',  'false', 'off', 'disable')\n\ndef _converter(val):\n    \"\"\"\n    \"\"\"\n    lval = val.lower()\n    if lval in __enable_strings: return True\n    if lval in __disable_strings: return False\n    #raise ValueError(\"Invalid value for boolean option: %s\" % val)\n    return val\n\n\ndef _validator(key, val, env, searchfunc):\n    # NB: searchfunc is currenty undocumented and unsupported\n    \"\"\"\n    \"\"\"\n    # todo: write validator, check for path\n    import os\n    if env[key] is True:\n        if searchfunc:\n            env[key] = searchfunc(key, val)\n    elif env[key] and not os.path.exists(val):\n        raise SCons.Errors.UserError(\n            'Path does not exist for option %s: %s' % (key, val))\n\n\ndef PackageVariable(key, help, default, searchfunc=None):\n    # NB: searchfunc is currenty undocumented and unsupported\n    \"\"\"\n    The input parameters describe a 'package list' option, thus they\n    are returned with the correct converter and validator appended. The\n    result is usable for input to opts.Add() .\n\n    A 'package list' option may either be 'all', 'none' or a list of\n    package names (seperated by space).\n    \"\"\"\n    help = '\\n    '.join(\n        (help, '( yes | no | /path/to/%s )' % key))\n    return (key, help, default,\n            lambda k, v, e: _validator(k,v,e,searchfunc),\n            _converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/PathVariable.py",
    "content": "\"\"\"SCons.Variables.PathVariable\n\nThis file defines an option type for SCons implementing path settings.\n\nTo be used whenever a a user-specified path override should be allowed.\n\nArguments to PathVariable are:\n  option-name  = name of this option on the command line (e.g. \"prefix\")\n  option-help  = help string for option\n  option-dflt  = default value for this option\n  validator    = [optional] validator for option value.  Predefined\n                 validators are:\n\n                     PathAccept -- accepts any path setting; no validation\n                     PathIsDir  -- path must be an existing directory\n                     PathIsDirCreate -- path must be a dir; will create\n                     PathIsFile -- path must be a file\n                     PathExists -- path must exist (any type) [default]\n\n                 The validator is a function that is called and which\n                 should return True or False to indicate if the path\n                 is valid.  The arguments to the validator function\n                 are: (key, val, env).  The key is the name of the\n                 option, the val is the path specified for the option,\n                 and the env is the env to which the Otions have been\n                 added.\n\nUsage example:\n\n  Examples:\n      prefix=/usr/local\n\n  opts = Variables()\n\n  opts = Variables()\n  opts.Add(PathVariable('qtdir',\n                      'where the root of Qt is installed',\n                      qtdir, PathIsDir))\n  opts.Add(PathVariable('qt_includes',\n                      'where the Qt includes are installed',\n                      '$qtdir/includes', PathIsDirCreate))\n  opts.Add(PathVariable('qt_libraries',\n                      'where the Qt library is installed',\n                      '$qtdir/lib'))\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/PathVariable.py  2014/07/05 09:42:21 garyo\"\n\n__all__ = ['PathVariable',]\n\nimport os\nimport os.path\n\nimport SCons.Errors\n\nclass _PathVariableClass(object):\n\n    def PathAccept(self, key, val, env):\n        \"\"\"Accepts any path, no checking done.\"\"\"\n        pass\n\n    def PathIsDir(self, key, val, env):\n        \"\"\"Validator to check if Path is a directory.\"\"\"\n        if not os.path.isdir(val):\n            if os.path.isfile(val):\n                m = 'Directory path for option %s is a file: %s'\n            else:\n                m = 'Directory path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def PathIsDirCreate(self, key, val, env):\n        \"\"\"Validator to check if Path is a directory,\n           creating it if it does not exist.\"\"\"\n        if os.path.isfile(val):\n            m = 'Path for option %s is a file, not a directory: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n        if not os.path.isdir(val):\n            os.makedirs(val)\n\n    def PathIsFile(self, key, val, env):\n        \"\"\"validator to check if Path is a file\"\"\"\n        if not os.path.isfile(val):\n            if os.path.isdir(val):\n                m = 'File path for option %s is a directory: %s'\n            else:\n                m = 'File path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def PathExists(self, key, val, env):\n        \"\"\"validator to check if Path exists\"\"\"\n        if not os.path.exists(val):\n            m = 'Path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def __call__(self, key, help, default, validator=None):\n        # NB: searchfunc is currenty undocumented and unsupported\n        \"\"\"\n        The input parameters describe a 'path list' option, thus they\n        are returned with the correct converter and validator appended. The\n        result is usable for input to opts.Add() .\n\n        The 'default' option specifies the default path to use if the\n        user does not specify an override with this option.\n\n        validator is a validator, see this file for examples\n        \"\"\"\n        if validator is None:\n            validator = self.PathExists\n\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            return (key, '%s ( /path/to/%s )' % (help, key[0]), default,\n                    validator, None)\n        else:\n            return (key, '%s ( /path/to/%s )' % (help, key), default,\n                    validator, None)\n\nPathVariable = _PathVariableClass()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Variables/__init__.py",
    "content": "\"\"\"engine.SCons.Variables\n\nThis file defines the Variables class that is used to add user-friendly\ncustomizable variables to an SCons build.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Variables/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport os.path\nimport sys\n\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Util\nimport SCons.Warnings\n\nfrom BoolVariable import BoolVariable  # okay\nfrom EnumVariable import EnumVariable  # okay\nfrom ListVariable import ListVariable  # naja\nfrom PackageVariable import PackageVariable # naja\nfrom PathVariable import PathVariable # okay\n\n\nclass Variables(object):\n    instance=None\n\n    \"\"\"\n    Holds all the options, updates the environment with the variables,\n    and renders the help text.\n    \"\"\"\n    def __init__(self, files=[], args={}, is_global=1):\n        \"\"\"\n        files - [optional] List of option configuration files to load\n            (backward compatibility) If a single string is passed it is\n                                     automatically placed in a file list\n        \"\"\"\n        self.options = []\n        self.args = args\n        if not SCons.Util.is_List(files):\n            if files:\n                files = [ files ]\n            else:\n                files = []\n        self.files = files\n        self.unknown = {}\n\n        # create the singleton instance\n        if is_global:\n            self=Variables.instance\n\n            if not Variables.instance:\n                Variables.instance=self\n\n    def _do_add(self, key, help=\"\", default=None, validator=None, converter=None):\n        class Variable(object):\n            pass\n\n        option = Variable()\n\n        # if we get a list or a tuple, we take the first element as the\n        # option key and store the remaining in aliases.\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            option.key     = key[0]\n            option.aliases = key[1:]\n        else:\n            option.key     = key\n            option.aliases = [ key ]\n        option.help = help\n        option.default = default\n        option.validator = validator\n        option.converter = converter\n\n        self.options.append(option)\n\n        # options might be added after the 'unknown' dict has been set up,\n        # so we remove the key and all its aliases from that dict\n        for alias in list(option.aliases) + [ option.key ]:\n            if alias in self.unknown:\n                del self.unknown[alias]\n\n    def keys(self):\n        \"\"\"\n        Returns the keywords for the options\n        \"\"\"\n        return [o.key for o in self.options]\n\n    def Add(self, key, help=\"\", default=None, validator=None, converter=None, **kw):\n        \"\"\"\n        Add an option.\n\n        key - the name of the variable, or a list or tuple of arguments\n        help - optional help text for the options\n        default - optional default value\n        validator - optional function that is called to validate the option's value\n                    Called with (key, value, environment)\n        converter - optional function that is called to convert the option's value before\n                    putting it in the environment.\n        \"\"\"\n\n        if SCons.Util.is_List(key) or isinstance(key, tuple):\n            self._do_add(*key)\n            return\n\n        if not SCons.Util.is_String(key) or \\\n            not SCons.Environment.is_valid_construction_var(key):\n                raise SCons.Errors.UserError(\"Illegal Variables.Add() key `%s'\" % str(key))\n\n        self._do_add(key, help, default, validator, converter)\n\n    def AddVariables(self, *optlist):\n        \"\"\"\n        Add a list of options.\n\n        Each list element is a tuple/list of arguments to be passed on\n        to the underlying method for adding options.\n\n        Example:\n          opt.AddVariables(\n            ('debug', '', 0),\n            ('CC', 'The C compiler'),\n            ('VALIDATE', 'An option for testing validation', 'notset',\n             validator, None),\n            )\n        \"\"\"\n        for o in optlist:\n            self._do_add(*o)\n\n\n    def Update(self, env, args=None):\n        \"\"\"\n        Update an environment with the option variables.\n\n        env - the environment to update.\n        \"\"\"\n\n        values = {}\n\n        # first set the defaults:\n        for option in self.options:\n            if not option.default is None:\n                values[option.key] = option.default\n\n        # next set the value specified in the options file\n        for filename in self.files:\n            if os.path.exists(filename):\n                dir = os.path.split(os.path.abspath(filename))[0]\n                if dir:\n                    sys.path.insert(0, dir)\n                try:\n                    values['__name__'] = filename\n                    exec open(filename, 'rU').read() in {}, values\n                finally:\n                    if dir:\n                        del sys.path[0]\n                    del values['__name__']\n\n        # set the values specified on the command line\n        if args is None:\n            args = self.args\n\n        for arg, value in args.items():\n            added = False\n            for option in self.options:\n                if arg in list(option.aliases) + [ option.key ]:\n                    values[option.key] = value\n                    added = True\n            if not added:\n                self.unknown[arg] = value\n\n        # put the variables in the environment:\n        # (don't copy over variables that are not declared as options)\n        for option in self.options:\n            try:\n                env[option.key] = values[option.key]\n            except KeyError:\n                pass\n\n        # Call the convert functions:\n        for option in self.options:\n            if option.converter and option.key in values:\n                value = env.subst('${%s}'%option.key)\n                try:\n                    try:\n                        env[option.key] = option.converter(value)\n                    except TypeError:\n                        env[option.key] = option.converter(value, env)\n                except ValueError, x:\n                    raise SCons.Errors.UserError('Error converting option: %s\\n%s'%(option.key, x))\n\n\n        # Finally validate the values:\n        for option in self.options:\n            if option.validator and option.key in values:\n                option.validator(option.key, env.subst('${%s}'%option.key), env)\n\n    def UnknownVariables(self):\n        \"\"\"\n        Returns any options in the specified arguments lists that\n        were not known, declared options in this object.\n        \"\"\"\n        return self.unknown\n\n    def Save(self, filename, env):\n        \"\"\"\n        Saves all the options in the given file.  This file can\n        then be used to load the options next run.  This can be used\n        to create an option cache file.\n\n        filename - Name of the file to save into\n        env - the environment get the option values from\n        \"\"\"\n\n        # Create the file and write out the header\n        try:\n            fh = open(filename, 'w')\n\n            try:\n                # Make an assignment in the file for each option\n                # within the environment that was assigned a value\n                # other than the default.\n                for option in self.options:\n                    try:\n                        value = env[option.key]\n                        try:\n                            prepare = value.prepare_to_store\n                        except AttributeError:\n                            try:\n                                eval(repr(value))\n                            except KeyboardInterrupt:\n                                raise\n                            except:\n                                # Convert stuff that has a repr() that\n                                # cannot be evaluated into a string\n                                value = SCons.Util.to_String(value)\n                        else:\n                            value = prepare()\n\n                        defaultVal = env.subst(SCons.Util.to_String(option.default))\n                        if option.converter:\n                            defaultVal = option.converter(defaultVal)\n\n                        if str(env.subst('${%s}' % option.key)) != str(defaultVal):\n                            fh.write('%s = %s\\n' % (option.key, repr(value)))\n                    except KeyError:\n                        pass\n            finally:\n                fh.close()\n\n        except IOError, x:\n            raise SCons.Errors.UserError('Error writing options to file: %s\\n%s' % (filename, x))\n\n    def GenerateHelpText(self, env, sort=None):\n        \"\"\"\n        Generate the help text for the options.\n\n        env - an environment that is used to get the current values\n              of the options.\n        \"\"\"\n\n        if sort:\n            options = sorted(self.options, key=lambda x: x.key)\n        else:\n            options = self.options\n\n        def format(opt, self=self, env=env):\n            if opt.key in env:\n                actual = env.subst('${%s}' % opt.key)\n            else:\n                actual = None\n            return self.FormatVariableHelpText(env, opt.key, opt.help, opt.default, actual, opt.aliases)\n        lines = [_f for _f in map(format, options) if _f]\n\n        return ''.join(lines)\n\n    format  = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n'\n    format_ = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n    aliases: %s\\n'\n\n    def FormatVariableHelpText(self, env, key, help, default, actual, aliases=[]):\n        # Don't display the key name itself as an alias.\n        aliases = [a for a in aliases if a != key]\n        if len(aliases)==0:\n            return self.format % (key, help, default, actual)\n        else:\n            return self.format_ % (key, help, default, actual, aliases)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Warnings.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\"\"\"SCons.Warnings\n\nThis file implements the warnings framework for SCons.\n\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Warnings.py  2014/07/05 09:42:21 garyo\"\n\nimport sys\n\nimport SCons.Errors\n\nclass Warning(SCons.Errors.UserError):\n    pass\n\nclass WarningOnByDefault(Warning):\n    pass\n\n\n# NOTE:  If you add a new warning class, add it to the man page, too!\n\nclass TargetNotBuiltWarning(Warning): # Should go to OnByDefault\n    pass\n\nclass CacheWriteErrorWarning(Warning):\n    pass\n\nclass CorruptSConsignWarning(WarningOnByDefault):\n    pass\n\nclass DependencyWarning(Warning):\n    pass\n\nclass DuplicateEnvironmentWarning(WarningOnByDefault):\n    pass\n\nclass FutureReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass LinkWarning(WarningOnByDefault):\n    pass\n\nclass MisleadingKeywordsWarning(WarningOnByDefault):\n    pass\n\nclass MissingSConscriptWarning(WarningOnByDefault):\n    pass\n\nclass NoMD5ModuleWarning(WarningOnByDefault):\n    pass\n\nclass NoMetaclassSupportWarning(WarningOnByDefault):\n    pass\n\nclass NoObjectCountWarning(WarningOnByDefault):\n    pass\n\nclass NoParallelSupportWarning(WarningOnByDefault):\n    pass\n\nclass ReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass StackSizeWarning(WarningOnByDefault):\n    pass\n\nclass VisualCMissingWarning(WarningOnByDefault):\n    pass\n\n# Used when MSVC_VERSION and MSVS_VERSION do not point to the\n# same version (MSVS_VERSION is deprecated)\nclass VisualVersionMismatch(WarningOnByDefault):\n    pass\n\nclass VisualStudioMissingWarning(Warning):\n    pass\n\nclass FortranCxxMixWarning(LinkWarning):\n    pass\n\n\n# Deprecation warnings\n\nclass FutureDeprecatedWarning(Warning):\n    pass\n\nclass DeprecatedWarning(Warning):\n    pass\n\nclass MandatoryDeprecatedWarning(DeprecatedWarning):\n    pass\n\n\n# Special case; base always stays DeprecatedWarning\nclass PythonVersionWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedSourceCodeWarning(FutureDeprecatedWarning):\n    pass\n\nclass DeprecatedBuildDirWarning(DeprecatedWarning):\n    pass\n\nclass TaskmasterNeedsExecuteWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedCopyWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedSourceSignaturesWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedTargetSignaturesWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedSigModuleWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedBuilderKeywordsWarning(MandatoryDeprecatedWarning):\n    pass\n\n\n# The below is a list of 2-tuples.  The first element is a class object.\n# The second element is true if that class is enabled, false if it is disabled.\n_enabled = []\n\n# If set, raise the warning as an exception\n_warningAsException = 0\n\n# If not None, a function to call with the warning\n_warningOut = None\n\ndef suppressWarningClass(clazz):\n    \"\"\"Suppresses all warnings that are of type clazz or\n    derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, 0))\n\ndef enableWarningClass(clazz):\n    \"\"\"Enables all warnings that are of type clazz or\n    derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, 1))\n\ndef warningAsException(flag=1):\n    \"\"\"Turn warnings into exceptions.  Returns the old value of the flag.\"\"\"\n    global _warningAsException\n    old = _warningAsException\n    _warningAsException = flag\n    return old\n\ndef warn(clazz, *args):\n    global _enabled, _warningAsException, _warningOut\n\n    warning = clazz(args)\n    for clazz, flag in _enabled:\n        if isinstance(warning, clazz):\n            if flag:\n                if _warningAsException:\n                    raise warning\n\n                if _warningOut:\n                    _warningOut(warning)\n            break\n\ndef process_warn_strings(arguments):\n    \"\"\"Process string specifications of enabling/disabling warnings,\n    as passed to the --warn option or the SetOption('warn') function.\n\n\n    An argument to this option should be of the form <warning-class>\n    or no-<warning-class>.  The warning class is munged in order\n    to get an actual class name from the classes above, which we\n    need to pass to the {enable,disable}WarningClass() functions.\n    The supplied <warning-class> is split on hyphens, each element\n    is capitalized, then smushed back together.  Then the string\n    \"Warning\" is appended to get the class name.\n\n    For example, 'deprecated' will enable the DeprecatedWarning\n    class.  'no-dependency' will disable the DependencyWarning class.\n\n    As a special case, --warn=all and --warn=no-all will enable or\n    disable (respectively) the base Warning class of all warnings.\n\n    \"\"\"\n\n    def _capitalize(s):\n        if s[:5] == \"scons\":\n            return \"SCons\" + s[5:]\n        else:\n            return s.capitalize()\n\n    for arg in arguments:\n\n        elems = arg.lower().split('-')\n        enable = 1\n        if elems[0] == 'no':\n            enable = 0\n            del elems[0]\n\n        if len(elems) == 1 and elems[0] == 'all':\n            class_name = \"Warning\"\n        else:\n            class_name = ''.join(map(_capitalize, elems)) + \"Warning\"\n        try:\n            clazz = globals()[class_name]\n        except KeyError:\n            sys.stderr.write(\"No warning type: '%s'\\n\" % arg)\n        else:\n            if enable:\n                enableWarningClass(clazz)\n            elif issubclass(clazz, MandatoryDeprecatedWarning):\n                fmt = \"Can not disable mandataory warning: '%s'\\n\"\n                sys.stderr.write(fmt % arg)\n            else:\n                suppressWarningClass(clazz)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/__init__.py",
    "content": "\"\"\"SCons\n\nThe main package for the SCons software construction utility.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/__init__.py  2014/07/05 09:42:21 garyo\"\n\n__version__ = \"2.3.2\"\n\n__build__ = \"\"\n\n__buildsys__ = \"lubuntu\"\n\n__date__ = \"2014/07/05 09:42:21\"\n\n__developer__ = \"garyo\"\n\n# make sure compatibility is always in place\nimport SCons.compat\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/__init__.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nSCons compatibility package for old Python versions\n\nThis subpackage holds modules that provide backwards-compatible\nimplementations of various things that we'd like to use in SCons but which\nonly show up in later versions of Python than the early, old version(s)\nwe still support.\n\nOther code will not generally reference things in this package through\nthe SCons.compat namespace.  The modules included here add things to\nthe builtins namespace or the global module list so that the rest\nof our code can use the objects and names imported here regardless of\nPython version.\n\nSimply enough, things that go in the builtins name space come from\nour _scons_builtins module.\n\nThe rest of the things here will be in individual compatibility modules\nthat are either: 1) suitably modified copies of the future modules that\nwe want to use; or 2) backwards compatible re-implementations of the\nspecific portions of a future module's API that we want to use.\n\nGENERAL WARNINGS:  Implementations of functions in the SCons.compat\nmodules are *NOT* guaranteed to be fully compliant with these functions in\nlater versions of Python.  We are only concerned with adding functionality\nthat we actually use in SCons, so be wary if you lift this code for\nother uses.  (That said, making these more nearly the same as later,\nofficial versions is still a desirable goal, we just don't need to be\nobsessive about it.)\n\nWe name the compatibility modules with an initial '_scons_' (for example,\n_scons_subprocess.py is our compatibility module for subprocess) so\nthat we can still try to import the real module name and fall back to\nour compatibility module if we get an ImportError.  The import_as()\nfunction defined below loads the module as the \"real\" name (without the\n'_scons'), after which all of the \"import {module}\" statements in the\nrest of our code will find our pre-loaded compatibility module.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/__init__.py  2014/07/05 09:42:21 garyo\"\n\nimport os\nimport sys\nimport imp   # Use the \"imp\" module to protect imports from fixers.\n\ndef import_as(module, name):\n    \"\"\"\n    Imports the specified module (from our local directory) as the\n    specified name, returning the loaded module object.\n    \"\"\"\n    dir = os.path.split(__file__)[0]\n    return imp.load_module(name, *imp.find_module(module, [dir]))\n\ndef rename_module(new, old):\n    \"\"\"\n    Attempts to import the old module and load it under the new name.\n    Used for purely cosmetic name changes in Python 3.x.\n    \"\"\"\n    try:\n        sys.modules[new] = imp.load_module(old, *imp.find_module(old))\n        return True\n    except ImportError:\n        return False\n\n\nrename_module('builtins', '__builtin__')\nimport _scons_builtins\n\n\ntry:\n    import hashlib\nexcept ImportError:\n    # Pre-2.5 Python has no hashlib module.\n    try:\n        import_as('_scons_hashlib', 'hashlib')\n    except ImportError:\n        # If we failed importing our compatibility module, it probably\n        # means this version of Python has no md5 module.  Don't do\n        # anything and let the higher layer discover this fact, so it\n        # can fall back to using timestamp.\n        pass\n\ntry:\n    set\nexcept NameError:\n    # Pre-2.4 Python has no native set type\n    import_as('_scons_sets', 'sets')\n    import builtins, sets\n    builtins.set = sets.Set\n\n\ntry:\n    import collections\nexcept ImportError:\n    # Pre-2.4 Python has no collections module.\n    import_as('_scons_collections', 'collections')\nelse:\n    try:\n        collections.UserDict\n    except AttributeError:\n        exec('from UserDict import UserDict as _UserDict')\n        collections.UserDict = _UserDict\n        del _UserDict\n    try:\n        collections.UserList\n    except AttributeError:\n        exec('from UserList import UserList as _UserList')\n        collections.UserList = _UserList\n        del _UserList\n    try:\n        collections.UserString\n    except AttributeError:\n        exec('from UserString import UserString as _UserString')\n        collections.UserString = _UserString\n        del _UserString\n\n\ntry:\n    import io\nexcept ImportError:\n    # Pre-2.6 Python has no io module.\n    import_as('_scons_io', 'io')\n\n\ntry:\n    os.devnull\nexcept AttributeError:\n    # Pre-2.4 Python has no os.devnull attribute\n    _names = sys.builtin_module_names\n    if 'posix' in _names:\n        os.devnull = '/dev/null'\n    elif 'nt' in _names:\n        os.devnull = 'nul'\n    os.path.devnull = os.devnull\ntry:\n    os.path.lexists\nexcept AttributeError:\n    # Pre-2.4 Python has no os.path.lexists function\n    def lexists(path):\n        return os.path.exists(path) or os.path.islink(path)\n    os.path.lexists = lexists\n\n\n# When we're using the '-3' option during regression tests, importing\n# cPickle gives a warning no matter how it's done, so always use the\n# real profile module, whether it's fast or not.\nif os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is None:\n    # Not a regression test with '-3', so try to use faster version.\n    # In 3.x, 'pickle' automatically loads the fast version if available.\n    rename_module('pickle', 'cPickle')\n\n\n# In 3.x, 'profile' automatically loads the fast version if available.\nrename_module('profile', 'cProfile')\n\n\n# Before Python 3.0, the 'queue' module was named 'Queue'.\nrename_module('queue', 'Queue')\n\n\n# Before Python 3.0, the 'winreg' module was named '_winreg'\nrename_module('winreg', '_winreg')\n\n\ntry:\n    import subprocess\nexcept ImportError:\n    # Pre-2.4 Python has no subprocess module.\n    import_as('_scons_subprocess', 'subprocess')\n\ntry:\n    sys.intern\nexcept AttributeError:\n    # Pre-2.6 Python has no sys.intern() function.\n    import builtins\n    try:\n        sys.intern = builtins.intern\n    except AttributeError:\n        # Pre-2.x Python has no builtin intern() function.\n        def intern(x):\n           return x\n        sys.intern = intern\n        del intern\ntry:\n    sys.maxsize\nexcept AttributeError:\n    # Pre-2.6 Python has no sys.maxsize attribute\n    # Wrapping sys in () is silly, but protects it from 2to3 renames fixer\n    sys.maxsize = (sys).maxint\n\n\nif os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None:\n    # We can't apply the 'callable' fixer until the floor is 2.6, but the\n    # '-3' option to Python 2.6 and 2.7 generates almost ten thousand\n    # warnings.  This hack allows us to run regression tests with the '-3'\n    # option by replacing the callable() built-in function with a hack\n    # that performs the same function but doesn't generate the warning.\n    # Note that this hack is ONLY intended to be used for regression\n    # testing, and should NEVER be used for real runs.\n    from types import ClassType\n    def callable(obj):\n        if hasattr(obj, '__call__'): return True\n        if isinstance(obj, (ClassType, type)): return True\n        return False\n    import builtins\n    builtins.callable = callable\n    del callable\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_builtins.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# Portions of the following are derived from the compat.py file in\n# Twisted, under the following copyright:\n#\n# Copyright (c) 2001-2004 Twisted Matrix Laboratories\n\n__doc__ = \"\"\"\nCompatibility idioms for builtins names\n\nThis module adds names to the builtins module for things that we want\nto use in SCons but which don't show up until later Python versions than\nthe earliest ones we support.\n\nThis module checks for the following builtins names:\n\n        all()\n        any()\n        memoryview()\n\nImplementations of functions are *NOT* guaranteed to be fully compliant\nwith these functions in later versions of Python.  We are only concerned\nwith adding functionality that we actually use in SCons, so be wary\nif you lift this code for other uses.  (That said, making these more\nnearly the same as later, official versions is still a desirable goal,\nwe just don't need to be obsessive about it.)\n\nIf you're looking at this with pydoc and various names don't show up in\nthe FUNCTIONS or DATA output, that means those names are already built in\nto this version of Python and we don't need to add them from this module.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_builtins.py  2014/07/05 09:42:21 garyo\"\n\nimport builtins\n\ntry:\n    all\nexcept NameError:\n    # Pre-2.5 Python has no all() function.\n    def all(iterable):\n        \"\"\"\n        Returns True if all elements of the iterable are true.\n        \"\"\"\n        for element in iterable:\n            if not element:\n                return False\n        return True\n    builtins.all = all\n    all = all\n\ntry:\n    any\nexcept NameError:\n    # Pre-2.5 Python has no any() function.\n    def any(iterable):\n        \"\"\"\n        Returns True if any element of the iterable is true.\n        \"\"\"\n        for element in iterable:\n            if element:\n                return True\n        return False\n    builtins.any = any\n    any = any\n\ntry:\n    memoryview\nexcept NameError:\n    # Pre-2.7 doesn't have the memoryview() built-in.\n    class memoryview(object):\n        def __init__(self, obj):\n            # wrapping buffer in () keeps the fixer from changing it\n            self.obj = (buffer)(obj)\n        def __getitem__(self, indx):\n            if isinstance(indx, slice):\n                return self.obj[indx.start:indx.stop]\n            else:\n                return self.obj[indx]\n    builtins.memoryview = memoryview\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_collections.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\ncollections compatibility module for older (pre-2.4) Python versions\n\nThis does not not NOT (repeat, *NOT*) provide complete collections\nfunctionality.  It only wraps the portions of collections functionality\nused by SCons, in an interface that looks enough like collections for\nour purposes.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_collections.py  2014/07/05 09:42:21 garyo\"\n\n# Use exec to hide old names from fixers.\nexec(\"\"\"if True:\n            from UserDict import UserDict\n            from UserList import UserList\n            from UserString import UserString\"\"\")\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_dbm.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\ndbm compatibility module for Python versions that don't have dbm.\n\nThis does not not NOT (repeat, *NOT*) provide complete dbm functionality.\nIt's just a stub on which to hang just enough pieces of dbm functionality\nthat the whichdb.whichdb() implementstation in the various 2.X versions of\nPython won't blow up even if dbm wasn't compiled in.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_dbm.py  2014/07/05 09:42:21 garyo\"\n\nclass error(Exception):\n    pass\n\ndef open(*args, **kw):\n    raise error()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_hashlib.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nhashlib backwards-compatibility module for older (pre-2.5) Python versions\n\nThis does not not NOT (repeat, *NOT*) provide complete hashlib\nfunctionality.  It only wraps the portions of MD5 functionality used\nby SCons, in an interface that looks like hashlib (or enough for our\npurposes, anyway).  In fact, this module will raise an ImportError if\nthe underlying md5 module isn't available.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_hashlib.py  2014/07/05 09:42:21 garyo\"\n\nimport md5\nfrom string import hexdigits\n\nclass md5obj(object):\n\n    md5_module = md5\n\n    def __init__(self, name, string=''):\n        if not name in ('MD5', 'md5'):\n            raise ValueError(\"unsupported hash type\")\n        self.name = 'md5'\n        self.m = self.md5_module.md5()\n\n    def __repr__(self):\n        return '<%s HASH object @ %#x>' % (self.name, id(self))\n\n    def copy(self):\n        import copy\n        result = copy.copy(self)\n        result.m = self.m.copy()\n        return result\n\n    def digest(self):\n        return self.m.digest()\n\n    def update(self, arg):\n        return self.m.update(arg)\n\n    def hexdigest(self):\n        return self.m.hexdigest()\n\nnew = md5obj\n\ndef md5(string=''):\n    return md5obj('md5', string)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_io.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nio compatibility module for older (pre-2.6) Python versions\n\nThis does not not NOT (repeat, *NOT*) provide complete io\nfunctionality.  It only wraps the portions of io functionality used\nby SCons, in an interface that looks enough like io for our purposes.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_io.py  2014/07/05 09:42:21 garyo\"\n\n# Use the \"imp\" module to protect the imports below from fixers.\nimport imp\n\n_cStringIO = imp.load_module('cStringIO', *imp.find_module('cStringIO'))\nStringIO = _cStringIO.StringIO\ndel _cStringIO\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_sets.py",
    "content": "\"\"\"Classes to represent arbitrary sets (including sets of sets).\n\nThis module implements sets using dictionaries whose values are\nignored.  The usual operations (union, intersection, deletion, etc.)\nare provided as both methods and operators.\n\nImportant: sets are not sequences!  While they support 'x in s',\n'len(s)', and 'for x in s', none of those operations are unique for\nsequences; for example, mappings support all three as well.  The\ncharacteristic operation for sequences is subscripting with small\nintegers: s[i], for i in range(len(s)).  Sets don't support\nsubscripting at all.  Also, sequences allow multiple occurrences and\ntheir elements have a definite order; sets on the other hand don't\nrecord multiple occurrences and don't remember the order of element\ninsertion (which is why they don't support s[i]).\n\nThe following classes are provided:\n\nBaseSet -- All the operations common to both mutable and immutable\n    sets. This is an abstract class, not meant to be directly\n    instantiated.\n\nSet -- Mutable sets, subclass of BaseSet; not hashable.\n\nImmutableSet -- Immutable sets, subclass of BaseSet; hashable.\n    An iterable argument is mandatory to create an ImmutableSet.\n\n_TemporarilyImmutableSet -- A wrapper around a Set, hashable,\n    giving the same hash value as the immutable set equivalent\n    would have.  Do not use this class directly.\n\nOnly hashable objects can be added to a Set. In particular, you cannot\nreally add a Set as an element to another Set; if you try, what is\nactually added is an ImmutableSet built from it (it compares equal to\nthe one you tried adding).\n\nWhen you ask if `x in y' where x is a Set and y is a Set or\nImmutableSet, x is wrapped into a _TemporarilyImmutableSet z, and\nwhat's tested is actually `z in y'.\n\n\"\"\"\n\n# Code history:\n#\n# - Greg V. Wilson wrote the first version, using a different approach\n#   to the mutable/immutable problem, and inheriting from dict.\n#\n# - Alex Martelli modified Greg's version to implement the current\n#   Set/ImmutableSet approach, and make the data an attribute.\n#\n# - Guido van Rossum rewrote much of the code, made some API changes,\n#   and cleaned up the docstrings.\n#\n# - Raymond Hettinger added a number of speedups and other\n#   improvements.\n\n# protect this import from the fixers...\nexec('from itertools import ifilterfalse as filterfalse')\n\n__all__ = ['BaseSet', 'Set', 'ImmutableSet']\n\nclass BaseSet(object):\n    \"\"\"Common base class for mutable and immutable sets.\"\"\"\n\n    __slots__ = ['_data']\n\n    # Constructor\n\n    def __init__(self):\n        \"\"\"This is an abstract class.\"\"\"\n        # Don't call this from a concrete subclass!\n        if self.__class__ is BaseSet:\n            raise TypeError(\"BaseSet is an abstract class.  \"\n                              \"Use Set or ImmutableSet.\")\n\n    # Standard protocols: __len__, __repr__, __str__, __iter__\n\n    def __len__(self):\n        \"\"\"Return the number of elements of a set.\"\"\"\n        return len(self._data)\n\n    def __repr__(self):\n        \"\"\"Return string representation of a set.\n\n        This looks like 'Set([<list of elements>])'.\n        \"\"\"\n        return self._repr()\n\n    # __str__ is the same as __repr__\n    __str__ = __repr__\n\n    def _repr(self, sort_them=False):\n        elements = list(self._data.keys())\n        if sort_them:\n            elements.sort()\n        return '%s(%r)' % (self.__class__.__name__, elements)\n\n    def __iter__(self):\n        \"\"\"Return an iterator over the elements or a set.\n\n        This is the keys iterator for the underlying dict.\n        \"\"\"\n        # Wrapping name in () prevents fixer from \"fixing\" this\n        return (self._data.iterkeys)()\n\n    # Three-way comparison is not supported.  However, because __eq__ is\n    # tried before __cmp__, if Set x == Set y, x.__eq__(y) returns True and\n    # then cmp(x, y) returns 0 (Python doesn't actually call __cmp__ in this\n    # case).\n\n    def __cmp__(self, other):\n        raise TypeError(\"can't compare sets using cmp()\")\n\n    # Equality comparisons using the underlying dicts.  Mixed-type comparisons\n    # are allowed here, where Set == z for non-Set z always returns False,\n    # and Set != z always True.  This allows expressions like \"x in y\" to\n    # give the expected result when y is a sequence of mixed types, not\n    # raising a pointless TypeError just because y contains a Set, or x is\n    # a Set and y contain's a non-set (\"in\" invokes only __eq__).\n    # Subtle:  it would be nicer if __eq__ and __ne__ could return\n    # NotImplemented instead of True or False.  Then the other comparand\n    # would get a chance to determine the result, and if the other comparand\n    # also returned NotImplemented then it would fall back to object address\n    # comparison (which would always return False for __eq__ and always\n    # True for __ne__).  However, that doesn't work, because this type\n    # *also* implements __cmp__:  if, e.g., __eq__ returns NotImplemented,\n    # Python tries __cmp__ next, and the __cmp__ here then raises TypeError.\n\n    def __eq__(self, other):\n        if isinstance(other, BaseSet):\n            return self._data == other._data\n        else:\n            return False\n\n    def __ne__(self, other):\n        if isinstance(other, BaseSet):\n            return self._data != other._data\n        else:\n            return True\n\n    # Copying operations\n\n    def copy(self):\n        \"\"\"Return a shallow copy of a set.\"\"\"\n        result = self.__class__()\n        result._data.update(self._data)\n        return result\n\n    __copy__ = copy # For the copy module\n\n    def __deepcopy__(self, memo):\n        \"\"\"Return a deep copy of a set; used by copy module.\"\"\"\n        # This pre-creates the result and inserts it in the memo\n        # early, in case the deep copy recurses into another reference\n        # to this same set.  A set can't be an element of itself, but\n        # it can certainly contain an object that has a reference to\n        # itself.\n        from copy import deepcopy\n        result = self.__class__()\n        memo[id(self)] = result\n        data = result._data\n        value = True\n        for elt in self:\n            data[deepcopy(elt, memo)] = value\n        return result\n\n    # Standard set operations: union, intersection, both differences.\n    # Each has an operator version (e.g. __or__, invoked with |) and a\n    # method version (e.g. union).\n    # Subtle:  Each pair requires distinct code so that the outcome is\n    # correct when the type of other isn't suitable.  For example, if\n    # we did \"union = __or__\" instead, then Set().union(3) would return\n    # NotImplemented instead of raising TypeError (albeit that *why* it\n    # raises TypeError as-is is also a bit subtle).\n\n    def __or__(self, other):\n        \"\"\"Return the union of two sets as a new set.\n\n        (I.e. all elements that are in either set.)\n        \"\"\"\n        if not isinstance(other, BaseSet):\n            return NotImplemented\n        return self.union(other)\n\n    def union(self, other):\n        \"\"\"Return the union of two sets as a new set.\n\n        (I.e. all elements that are in either set.)\n        \"\"\"\n        result = self.__class__(self)\n        result._update(other)\n        return result\n\n    def __and__(self, other):\n        \"\"\"Return the intersection of two sets as a new set.\n\n        (I.e. all elements that are in both sets.)\n        \"\"\"\n        if not isinstance(other, BaseSet):\n            return NotImplemented\n        return self.intersection(other)\n\n    def intersection(self, other):\n        \"\"\"Return the intersection of two sets as a new set.\n\n        (I.e. all elements that are in both sets.)\n        \"\"\"\n        if not isinstance(other, BaseSet):\n            other = Set(other)\n        if len(self) <= len(other):\n            little, big = self, other\n        else:\n            little, big = other, self\n        common = iter(filter(big._data.has_key, little))\n        return self.__class__(common)\n\n    def __xor__(self, other):\n        \"\"\"Return the symmetric difference of two sets as a new set.\n\n        (I.e. all elements that are in exactly one of the sets.)\n        \"\"\"\n        if not isinstance(other, BaseSet):\n            return NotImplemented\n        return self.symmetric_difference(other)\n\n    def symmetric_difference(self, other):\n        \"\"\"Return the symmetric difference of two sets as a new set.\n\n        (I.e. all elements that are in exactly one of the sets.)\n        \"\"\"\n        result = self.__class__()\n        data = result._data\n        value = True\n        selfdata = self._data\n        try:\n            otherdata = other._data\n        except AttributeError:\n            otherdata = Set(other)._data\n        for elt in filterfalse(otherdata.has_key, selfdata):\n            data[elt] = value\n        for elt in filterfalse(selfdata.has_key, otherdata):\n            data[elt] = value\n        return result\n\n    def  __sub__(self, other):\n        \"\"\"Return the difference of two sets as a new Set.\n\n        (I.e. all elements that are in this set and not in the other.)\n        \"\"\"\n        if not isinstance(other, BaseSet):\n            return NotImplemented\n        return self.difference(other)\n\n    def difference(self, other):\n        \"\"\"Return the difference of two sets as a new Set.\n\n        (I.e. all elements that are in this set and not in the other.)\n        \"\"\"\n        result = self.__class__()\n        data = result._data\n        try:\n            otherdata = other._data\n        except AttributeError:\n            otherdata = Set(other)._data\n        value = True\n        for elt in filterfalse(otherdata.has_key, self):\n            data[elt] = value\n        return result\n\n    # Membership test\n\n    def __contains__(self, element):\n        \"\"\"Report whether an element is a member of a set.\n\n        (Called in response to the expression `element in self'.)\n        \"\"\"\n        try:\n            return element in self._data\n        except TypeError:\n            transform = getattr(element, \"__as_temporarily_immutable__\", None)\n            if transform is None:\n                raise # re-raise the TypeError exception we caught\n            return transform() in self._data\n\n    # Subset and superset test\n\n    def issubset(self, other):\n        \"\"\"Report whether another set contains this set.\"\"\"\n        self._binary_sanity_check(other)\n        if len(self) > len(other):  # Fast check for obvious cases\n            return False\n        for elt in filterfalse(other._data.has_key, self):\n            return False\n        return True\n\n    def issuperset(self, other):\n        \"\"\"Report whether this set contains another set.\"\"\"\n        self._binary_sanity_check(other)\n        if len(self) < len(other):  # Fast check for obvious cases\n            return False\n        for elt in filterfalse(self._data.has_key, other):\n            return False\n        return True\n\n    # Inequality comparisons using the is-subset relation.\n    __le__ = issubset\n    __ge__ = issuperset\n\n    def __lt__(self, other):\n        self._binary_sanity_check(other)\n        return len(self) < len(other) and self.issubset(other)\n\n    def __gt__(self, other):\n        self._binary_sanity_check(other)\n        return len(self) > len(other) and self.issuperset(other)\n\n    # Assorted helpers\n\n    def _binary_sanity_check(self, other):\n        # Check that the other argument to a binary operation is also\n        # a set, raising a TypeError otherwise.\n        if not isinstance(other, BaseSet):\n            raise TypeError(\"Binary operation only permitted between sets\")\n\n    def _compute_hash(self):\n        # Calculate hash code for a set by xor'ing the hash codes of\n        # the elements.  This ensures that the hash code does not depend\n        # on the order in which elements are added to the set.  This is\n        # not called __hash__ because a BaseSet should not be hashable;\n        # only an ImmutableSet is hashable.\n        result = 0\n        for elt in self:\n            result ^= hash(elt)\n        return result\n\n    def _update(self, iterable):\n        # The main loop for update() and the subclass __init__() methods.\n        data = self._data\n\n        # Use the fast update() method when a dictionary is available.\n        if isinstance(iterable, BaseSet):\n            data.update(iterable._data)\n            return\n\n        value = True\n\n        if type(iterable) in (list, tuple, xrange):\n            # Optimized: we know that __iter__() and next() can't\n            # raise TypeError, so we can move 'try:' out of the loop.\n            it = iter(iterable)\n            while True:\n                try:\n                    for element in it:\n                        data[element] = value\n                    return\n                except TypeError:\n                    transform = getattr(element, \"__as_immutable__\", None)\n                    if transform is None:\n                        raise # re-raise the TypeError exception we caught\n                    data[transform()] = value\n        else:\n            # Safe: only catch TypeError where intended\n            for element in iterable:\n                try:\n                    data[element] = value\n                except TypeError:\n                    transform = getattr(element, \"__as_immutable__\", None)\n                    if transform is None:\n                        raise # re-raise the TypeError exception we caught\n                    data[transform()] = value\n\n\nclass ImmutableSet(BaseSet):\n    \"\"\"Immutable set class.\"\"\"\n\n    __slots__ = ['_hashcode']\n\n    # BaseSet + hashing\n\n    def __init__(self, iterable=None):\n        \"\"\"Construct an immutable set from an optional iterable.\"\"\"\n        self._hashcode = None\n        self._data = {}\n        if iterable is not None:\n            self._update(iterable)\n\n    def __hash__(self):\n        if self._hashcode is None:\n            self._hashcode = self._compute_hash()\n        return self._hashcode\n\n    def __getstate__(self):\n        return self._data, self._hashcode\n\n    def __setstate__(self, state):\n        self._data, self._hashcode = state\n\nclass Set(BaseSet):\n    \"\"\" Mutable set class.\"\"\"\n\n    __slots__ = []\n\n    # BaseSet + operations requiring mutability; no hashing\n\n    def __init__(self, iterable=None):\n        \"\"\"Construct a set from an optional iterable.\"\"\"\n        self._data = {}\n        if iterable is not None:\n            self._update(iterable)\n\n    def __getstate__(self):\n        # getstate's results are ignored if it is not\n        return self._data,\n\n    def __setstate__(self, data):\n        self._data, = data\n\n    def __hash__(self):\n        \"\"\"A Set cannot be hashed.\"\"\"\n        # We inherit object.__hash__, so we must deny this explicitly\n        raise TypeError(\"Can't hash a Set, only an ImmutableSet.\")\n\n    # In-place union, intersection, differences.\n    # Subtle:  The xyz_update() functions deliberately return None,\n    # as do all mutating operations on built-in container types.\n    # The __xyz__ spellings have to return self, though.\n\n    def __ior__(self, other):\n        \"\"\"Update a set with the union of itself and another.\"\"\"\n        self._binary_sanity_check(other)\n        self._data.update(other._data)\n        return self\n\n    def union_update(self, other):\n        \"\"\"Update a set with the union of itself and another.\"\"\"\n        self._update(other)\n\n    def __iand__(self, other):\n        \"\"\"Update a set with the intersection of itself and another.\"\"\"\n        self._binary_sanity_check(other)\n        self._data = (self & other)._data\n        return self\n\n    def intersection_update(self, other):\n        \"\"\"Update a set with the intersection of itself and another.\"\"\"\n        if isinstance(other, BaseSet):\n            self &= other\n        else:\n            self._data = (self.intersection(other))._data\n\n    def __ixor__(self, other):\n        \"\"\"Update a set with the symmetric difference of itself and another.\"\"\"\n        self._binary_sanity_check(other)\n        self.symmetric_difference_update(other)\n        return self\n\n    def symmetric_difference_update(self, other):\n        \"\"\"Update a set with the symmetric difference of itself and another.\"\"\"\n        data = self._data\n        value = True\n        if not isinstance(other, BaseSet):\n            other = Set(other)\n        if self is other:\n            self.clear()\n        for elt in other:\n            if elt in data:\n                del data[elt]\n            else:\n                data[elt] = value\n\n    def __isub__(self, other):\n        \"\"\"Remove all elements of another set from this set.\"\"\"\n        self._binary_sanity_check(other)\n        self.difference_update(other)\n        return self\n\n    def difference_update(self, other):\n        \"\"\"Remove all elements of another set from this set.\"\"\"\n        data = self._data\n        if not isinstance(other, BaseSet):\n            other = Set(other)\n        if self is other:\n            self.clear()\n        for elt in filter(data.has_key, other):\n            del data[elt]\n\n    # Python dict-like mass mutations: update, clear\n\n    def update(self, iterable):\n        \"\"\"Add all values from an iterable (such as a list or file).\"\"\"\n        self._update(iterable)\n\n    def clear(self):\n        \"\"\"Remove all elements from this set.\"\"\"\n        self._data.clear()\n\n    # Single-element mutations: add, remove, discard\n\n    def add(self, element):\n        \"\"\"Add an element to a set.\n\n        This has no effect if the element is already present.\n        \"\"\"\n        try:\n            self._data[element] = True\n        except TypeError:\n            transform = getattr(element, \"__as_immutable__\", None)\n            if transform is None:\n                raise # re-raise the TypeError exception we caught\n            self._data[transform()] = True\n\n    def remove(self, element):\n        \"\"\"Remove an element from a set; it must be a member.\n\n        If the element is not a member, raise a KeyError.\n        \"\"\"\n        try:\n            del self._data[element]\n        except TypeError:\n            transform = getattr(element, \"__as_temporarily_immutable__\", None)\n            if transform is None:\n                raise # re-raise the TypeError exception we caught\n            del self._data[transform()]\n\n    def discard(self, element):\n        \"\"\"Remove an element from a set if it is a member.\n\n        If the element is not a member, do nothing.\n        \"\"\"\n        try:\n            self.remove(element)\n        except KeyError:\n            pass\n\n    def pop(self):\n        \"\"\"Remove and return an arbitrary set element.\"\"\"\n        return self._data.popitem()[0]\n\n    def __as_immutable__(self):\n        # Return a copy of self as an immutable set\n        return ImmutableSet(self)\n\n    def __as_temporarily_immutable__(self):\n        # Return self wrapped in a temporarily immutable set\n        return _TemporarilyImmutableSet(self)\n\n\nclass _TemporarilyImmutableSet(BaseSet):\n    # Wrap a mutable set as if it was temporarily immutable.\n    # This only supplies hashing and equality comparisons.\n\n    def __init__(self, set):\n        self._set = set\n        self._data = set._data  # Needed by ImmutableSet.__eq__()\n\n    def __hash__(self):\n        return self._set._compute_hash()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/compat/_scons_subprocess.py",
    "content": "# subprocess - Subprocesses with accessible I/O streams\n#\n# For more information about this module, see PEP 324.\n#\n# This module should remain compatible with Python 2.2, see PEP 291.\n#\n# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>\n#\n# Licensed to PSF under a Contributor Agreement.\n# See http://www.python.org/2.4/license for licensing details.\n\nr\"\"\"subprocess - Subprocesses with accessible I/O streams\n\nThis module allows you to spawn processes, connect to their\ninput/output/error pipes, and obtain their return codes.  This module\nintends to replace several other, older modules and functions, like:\n\nos.system\nos.spawn*\nos.popen*\npopen2.*\ncommands.*\n\nInformation about how the subprocess module can be used to replace these\nmodules and functions can be found below.\n\n\n\nUsing the subprocess module\n===========================\nThis module defines one class called Popen:\n\nclass Popen(args, bufsize=0, executable=None,\n            stdin=None, stdout=None, stderr=None,\n            preexec_fn=None, close_fds=False, shell=False,\n            cwd=None, env=None, universal_newlines=False,\n            startupinfo=None, creationflags=0):\n\n\nArguments are:\n\nargs should be a string, or a sequence of program arguments.  The\nprogram to execute is normally the first item in the args sequence or\nstring, but can be explicitly set by using the executable argument.\n\nOn UNIX, with shell=False (default): In this case, the Popen class\nuses os.execvp() to execute the child program.  args should normally\nbe a sequence.  A string will be treated as a sequence with the string\nas the only item (the program to execute).\n\nOn UNIX, with shell=True: If args is a string, it specifies the\ncommand string to execute through the shell.  If args is a sequence,\nthe first item specifies the command string, and any additional items\nwill be treated as additional shell arguments.\n\nOn Windows: the Popen class uses CreateProcess() to execute the child\nprogram, which operates on strings.  If args is a sequence, it will be\nconverted to a string using the list2cmdline method.  Please note that\nnot all MS Windows applications interpret the command line the same\nway: The list2cmdline is designed for applications using the same\nrules as the MS C runtime.\n\nbufsize, if given, has the same meaning as the corresponding argument\nto the built-in open() function: 0 means unbuffered, 1 means line\nbuffered, any other positive value means use a buffer of\n(approximately) that size.  A negative bufsize means to use the system\ndefault, which usually means fully buffered.  The default value for\nbufsize is 0 (unbuffered).\n\nstdin, stdout and stderr specify the executed programs' standard\ninput, standard output and standard error file handles, respectively.\nValid values are PIPE, an existing file descriptor (a positive\ninteger), an existing file object, and None.  PIPE indicates that a\nnew pipe to the child should be created.  With None, no redirection\nwill occur; the child's file handles will be inherited from the\nparent.  Additionally, stderr can be STDOUT, which indicates that the\nstderr data from the applications should be captured into the same\nfile handle as for stdout.\n\nIf preexec_fn is set to a callable object, this object will be called\nin the child process just before the child is executed.\n\nIf close_fds is true, all file descriptors except 0, 1 and 2 will be\nclosed before the child process is executed.\n\nif shell is true, the specified command will be executed through the\nshell.\n\nIf cwd is not None, the current directory will be changed to cwd\nbefore the child is executed.\n\nIf env is not None, it defines the environment variables for the new\nprocess.\n\nIf universal_newlines is true, the file objects stdout and stderr are\nopened as a text files, but lines may be terminated by any of '\\n',\nthe Unix end-of-line convention, '\\r', the Macintosh convention or\n'\\r\\n', the Windows convention.  All of these external representations\nare seen as '\\n' by the Python program.  Note: This feature is only\navailable if Python is built with universal newline support (the\ndefault).  Also, the newlines attribute of the file objects stdout,\nstdin and stderr are not updated by the communicate() method.\n\nThe startupinfo and creationflags, if given, will be passed to the\nunderlying CreateProcess() function.  They can specify things such as\nappearance of the main window and priority for the new process.\n(Windows only)\n\n\nThis module also defines two shortcut functions:\n\ncall(*popenargs, **kwargs):\n    Run command with arguments.  Wait for command to complete, then\n    return the returncode attribute.\n\n    The arguments are the same as for the Popen constructor.  Example:\n\n    retcode = call([\"ls\", \"-l\"])\n\ncheck_call(*popenargs, **kwargs):\n    Run command with arguments.  Wait for command to complete.  If the\n    exit code was zero then return, otherwise raise\n    CalledProcessError.  The CalledProcessError object will have the\n    return code in the returncode attribute.\n\n    The arguments are the same as for the Popen constructor.  Example:\n\n    check_call([\"ls\", \"-l\"])\n\nExceptions\n----------\nExceptions raised in the child process, before the new program has\nstarted to execute, will be re-raised in the parent.  Additionally,\nthe exception object will have one extra attribute called\n'child_traceback', which is a string containing traceback information\nfrom the childs point of view.\n\nThe most common exception raised is OSError.  This occurs, for\nexample, when trying to execute a non-existent file.  Applications\nshould prepare for OSErrors.\n\nA ValueError will be raised if Popen is called with invalid arguments.\n\ncheck_call() will raise CalledProcessError, if the called process\nreturns a non-zero return code.\n\n\nSecurity\n--------\nUnlike some other popen functions, this implementation will never call\n/bin/sh implicitly.  This means that all characters, including shell\nmetacharacters, can safely be passed to child processes.\n\n\nPopen objects\n=============\nInstances of the Popen class have the following methods:\n\npoll()\n    Check if child process has terminated.  Returns returncode\n    attribute.\n\nwait()\n    Wait for child process to terminate.  Returns returncode attribute.\n\ncommunicate(input=None)\n    Interact with process: Send data to stdin.  Read data from stdout\n    and stderr, until end-of-file is reached.  Wait for process to\n    terminate.  The optional stdin argument should be a string to be\n    sent to the child process, or None, if no data should be sent to\n    the child.\n\n    communicate() returns a tuple (stdout, stderr).\n\n    Note: The data read is buffered in memory, so do not use this\n    method if the data size is large or unlimited.\n\nThe following attributes are also available:\n\nstdin\n    If the stdin argument is PIPE, this attribute is a file object\n    that provides input to the child process.  Otherwise, it is None.\n\nstdout\n    If the stdout argument is PIPE, this attribute is a file object\n    that provides output from the child process.  Otherwise, it is\n    None.\n\nstderr\n    If the stderr argument is PIPE, this attribute is file object that\n    provides error output from the child process.  Otherwise, it is\n    None.\n\npid\n    The process ID of the child process.\n\nreturncode\n    The child return code.  A None value indicates that the process\n    hasn't terminated yet.  A negative value -N indicates that the\n    child was terminated by signal N (UNIX only).\n\n\nReplacing older functions with the subprocess module\n====================================================\nIn this section, \"a ==> b\" means that b can be used as a replacement\nfor a.\n\nNote: All functions in this section fail (more or less) silently if\nthe executed program cannot be found; this module raises an OSError\nexception.\n\nIn the following examples, we assume that the subprocess module is\nimported with \"from subprocess import *\".\n\n\nReplacing /bin/sh shell backquote\n---------------------------------\noutput=`mycmd myarg`\n==>\noutput = Popen([\"mycmd\", \"myarg\"], stdout=PIPE).communicate()[0]\n\n\nReplacing shell pipe line\n-------------------------\noutput=`dmesg | grep hda`\n==>\np1 = Popen([\"dmesg\"], stdout=PIPE)\np2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\noutput = p2.communicate()[0]\n\n\nReplacing os.system()\n---------------------\nsts = os.system(\"mycmd\" + \" myarg\")\n==>\np = Popen(\"mycmd\" + \" myarg\", shell=True)\npid, sts = os.waitpid(p.pid, 0)\n\nNote:\n\n* Calling the program through the shell is usually not required.\n\n* It's easier to look at the returncode attribute than the\n  exitstatus.\n\nA more real-world example would look like this:\n\ntry:\n    retcode = call(\"mycmd\" + \" myarg\", shell=True)\n    if retcode < 0:\n        print >>sys.stderr, \"Child was terminated by signal\", -retcode\n    else:\n        print >>sys.stderr, \"Child returned\", retcode\nexcept OSError, e:\n    print >>sys.stderr, \"Execution failed:\", e\n\n\nReplacing os.spawn*\n-------------------\nP_NOWAIT example:\n\npid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n==>\npid = Popen([\"/bin/mycmd\", \"myarg\"]).pid\n\n\nP_WAIT example:\n\nretcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n==>\nretcode = call([\"/bin/mycmd\", \"myarg\"])\n\n\nVector example:\n\nos.spawnvp(os.P_NOWAIT, path, args)\n==>\nPopen([path] + args[1:])\n\n\nEnvironment example:\n\nos.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n==>\nPopen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})\n\n\nReplacing os.popen*\n-------------------\npipe = os.popen(cmd, mode='r', bufsize)\n==>\npipe = Popen(cmd, shell=True, bufsize=bufsize, stdout=PIPE).stdout\n\npipe = os.popen(cmd, mode='w', bufsize)\n==>\npipe = Popen(cmd, shell=True, bufsize=bufsize, stdin=PIPE).stdin\n\n\n(child_stdin, child_stdout) = os.popen2(cmd, mode, bufsize)\n==>\np = Popen(cmd, shell=True, bufsize=bufsize,\n          stdin=PIPE, stdout=PIPE, close_fds=True)\n(child_stdin, child_stdout) = (p.stdin, p.stdout)\n\n\n(child_stdin,\n child_stdout,\n child_stderr) = os.popen3(cmd, mode, bufsize)\n==>\np = Popen(cmd, shell=True, bufsize=bufsize,\n          stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)\n(child_stdin,\n child_stdout,\n child_stderr) = (p.stdin, p.stdout, p.stderr)\n\n\n(child_stdin, child_stdout_and_stderr) = os.popen4(cmd, mode, bufsize)\n==>\np = Popen(cmd, shell=True, bufsize=bufsize,\n          stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)\n(child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout)\n\n\nReplacing popen2.*\n------------------\nNote: If the cmd argument to popen2 functions is a string, the command\nis executed through /bin/sh.  If it is a list, the command is directly\nexecuted.\n\n(child_stdout, child_stdin) = popen2.popen2(\"somestring\", bufsize, mode)\n==>\np = Popen([\"somestring\"], shell=True, bufsize=bufsize\n          stdin=PIPE, stdout=PIPE, close_fds=True)\n(child_stdout, child_stdin) = (p.stdout, p.stdin)\n\n\n(child_stdout, child_stdin) = popen2.popen2([\"mycmd\", \"myarg\"], bufsize, mode)\n==>\np = Popen([\"mycmd\", \"myarg\"], bufsize=bufsize,\n          stdin=PIPE, stdout=PIPE, close_fds=True)\n(child_stdout, child_stdin) = (p.stdout, p.stdin)\n\nThe popen2.Popen3 and popen3.Popen4 basically works as subprocess.Popen,\nexcept that:\n\n* subprocess.Popen raises an exception if the execution fails\n* the capturestderr argument is replaced with the stderr argument.\n* stdin=PIPE and stdout=PIPE must be specified.\n* popen2 closes all filedescriptors by default, but you have to specify\n  close_fds=True with subprocess.Popen.\n\n\n\"\"\"\n\nimport sys\nmswindows = (sys.platform == \"win32\")\n\nimport os\nimport types\nimport traceback\n\n# Exception classes used by this module.\nclass CalledProcessError(Exception):\n    \"\"\"This exception is raised when a process run by check_call() returns\n    a non-zero exit status.  The exit status will be stored in the\n    returncode attribute.\"\"\"\n    def __init__(self, returncode, cmd):\n        self.returncode = returncode\n        self.cmd = cmd\n    def __str__(self):\n        return \"Command '%s' returned non-zero exit status %d\" % (self.cmd, self.returncode)\n\n\nif mswindows:\n    try:\n        import threading\n    except ImportError:\n        # SCons:  the threading module is only used by the communicate()\n        # method, which we don't actually use, so don't worry if we\n        # can't import it.\n        pass\n    import msvcrt\n    try:\n        # Try to get _subprocess\n        from _subprocess import *\n        class STARTUPINFO(object):\n            dwFlags = 0\n            hStdInput = None\n            hStdOutput = None\n            hStdError = None\n            wShowWindow = 0\n        class pywintypes(object):\n            error = IOError\n    except ImportError:\n        # If not there, then drop back to requiring pywin32\n        # TODO: Should this be wrapped in try as well? To notify user to install\n        #       pywin32 ? With URL to it?\n        import pywintypes\n        from win32api import GetStdHandle, STD_INPUT_HANDLE, \\\n                             STD_OUTPUT_HANDLE, STD_ERROR_HANDLE\n        from win32api import GetCurrentProcess, DuplicateHandle, \\\n                             GetModuleFileName, GetVersion\n        from win32con import DUPLICATE_SAME_ACCESS, SW_HIDE\n        from win32pipe import CreatePipe\n        from win32process import CreateProcess, STARTUPINFO, \\\n                                 GetExitCodeProcess, STARTF_USESTDHANDLES, \\\n                                 STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE\n        from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0\n\n\nelse:\n    import select\n    import errno\n    import fcntl\n    import pickle\n\n    try:\n        fcntl.F_GETFD\n    except AttributeError:\n        fcntl.F_GETFD = 1\n\n    try:\n        fcntl.F_SETFD\n    except AttributeError:\n        fcntl.F_SETFD = 2\n\n__all__ = [\"Popen\", \"PIPE\", \"STDOUT\", \"call\", \"check_call\", \"CalledProcessError\"]\n\ntry:\n    MAXFD = os.sysconf(\"SC_OPEN_MAX\")\nexcept KeyboardInterrupt:\n    raise       # SCons:  don't swallow keyboard interrupts\nexcept:\n    MAXFD = 256\n\ntry:\n    isinstance(1, int)\nexcept TypeError:\n    def is_int(obj):\n        return isinstance(obj, type(1))\n    def is_int_or_long(obj):\n        return type(obj) in (type(1), type(1L))\nelse:\n    def is_int(obj):\n        return isinstance(obj, int)\n    def is_int_or_long(obj):\n        return isinstance(obj, (int, long))\n\ntry:\n    types.StringTypes\nexcept AttributeError:\n    try:\n        types.StringTypes = (str, unicode)\n    except NameError:\n        types.StringTypes = (str,)\ndef is_string(obj):\n    return isinstance(obj, types.StringTypes)\n\n_active = []\n\ndef _cleanup():\n    for inst in _active[:]:\n        if inst.poll(_deadstate=sys.maxsize) >= 0:\n            try:\n                _active.remove(inst)\n            except ValueError:\n                # This can happen if two threads create a new Popen instance.\n                # It's harmless that it was already removed, so ignore.\n                pass\n\nPIPE = -1\nSTDOUT = -2\n\n\ndef call(*popenargs, **kwargs):\n    \"\"\"Run command with arguments.  Wait for command to complete, then\n    return the returncode attribute.\n\n    The arguments are the same as for the Popen constructor.  Example:\n\n    retcode = call([\"ls\", \"-l\"])\n    \"\"\"\n    return apply(Popen, popenargs, kwargs).wait()\n\n\ndef check_call(*popenargs, **kwargs):\n    \"\"\"Run command with arguments.  Wait for command to complete.  If\n    the exit code was zero then return, otherwise raise\n    CalledProcessError.  The CalledProcessError object will have the\n    return code in the returncode attribute.\n\n    The arguments are the same as for the Popen constructor.  Example:\n\n    check_call([\"ls\", \"-l\"])\n    \"\"\"\n    retcode = call(*popenargs, **kwargs)\n    cmd = kwargs.get(\"args\")\n    if cmd is None:\n        cmd = popenargs[0]\n    if retcode:\n        raise CalledProcessError(retcode, cmd)\n    return retcode\n\n\ndef list2cmdline(seq):\n    \"\"\"\n    Translate a sequence of arguments into a command line\n    string, using the same rules as the MS C runtime:\n\n    1) Arguments are delimited by white space, which is either a\n       space or a tab.\n\n    2) A string surrounded by double quotation marks is\n       interpreted as a single argument, regardless of white space\n       contained within.  A quoted string can be embedded in an\n       argument.\n\n    3) A double quotation mark preceded by a backslash is\n       interpreted as a literal double quotation mark.\n\n    4) Backslashes are interpreted literally, unless they\n       immediately precede a double quotation mark.\n\n    5) If backslashes immediately precede a double quotation mark,\n       every pair of backslashes is interpreted as a literal\n       backslash.  If the number of backslashes is odd, the last\n       backslash escapes the next double quotation mark as\n       described in rule 3.\n    \"\"\"\n\n    # See\n    # http://msdn.microsoft.com/library/en-us/vccelng/htm/progs_12.asp\n    result = []\n    needquote = False\n    for arg in seq:\n        bs_buf = []\n\n        # Add a space to separate this argument from the others\n        if result:\n            result.append(' ')\n\n        needquote = (\" \" in arg) or (\"\\t\" in arg)\n        if needquote:\n            result.append('\"')\n\n        for c in arg:\n            if c == '\\\\':\n                # Don't know if we need to double yet.\n                bs_buf.append(c)\n            elif c == '\"':\n                # Double backspaces.\n                result.append('\\\\' * len(bs_buf)*2)\n                bs_buf = []\n                result.append('\\\\\"')\n            else:\n                # Normal char\n                if bs_buf:\n                    result.extend(bs_buf)\n                    bs_buf = []\n                result.append(c)\n\n        # Add remaining backspaces, if any.\n        if bs_buf:\n            result.extend(bs_buf)\n\n        if needquote:\n            result.extend(bs_buf)\n            result.append('\"')\n\n    return ''.join(result)\n\nclass Popen(object):\n    def __init__(self, args, bufsize=0, executable=None,\n                 stdin=None, stdout=None, stderr=None,\n                 preexec_fn=None, close_fds=False, shell=False,\n                 cwd=None, env=None, universal_newlines=False,\n                 startupinfo=None, creationflags=0):\n        \"\"\"Create new Popen instance.\"\"\"\n        _cleanup()\n\n        self._child_created = False\n        if not is_int_or_long(bufsize):\n            raise TypeError(\"bufsize must be an integer\")\n\n        if mswindows:\n            if preexec_fn is not None:\n                raise ValueError(\"preexec_fn is not supported on Windows \"\n                                 \"platforms\")\n            if close_fds:\n                raise ValueError(\"close_fds is not supported on Windows \"\n                                 \"platforms\")\n        else:\n            # POSIX\n            if startupinfo is not None:\n                raise ValueError(\"startupinfo is only supported on Windows \"\n                                 \"platforms\")\n            if creationflags != 0:\n                raise ValueError(\"creationflags is only supported on Windows \"\n                                 \"platforms\")\n\n        self.stdin = None\n        self.stdout = None\n        self.stderr = None\n        self.pid = None\n        self.returncode = None\n        self.universal_newlines = universal_newlines\n\n        # Input and output objects. The general principle is like\n        # this:\n        #\n        # Parent                   Child\n        # ------                   -----\n        # p2cwrite   ---stdin--->  p2cread\n        # c2pread    <--stdout---  c2pwrite\n        # errread    <--stderr---  errwrite\n        #\n        # On POSIX, the child objects are file descriptors.  On\n        # Windows, these are Windows file handles.  The parent objects\n        # are file descriptors on both platforms.  The parent objects\n        # are None when not using PIPEs. The child objects are None\n        # when not redirecting.\n\n        (p2cread, p2cwrite,\n         c2pread, c2pwrite,\n         errread, errwrite) = self._get_handles(stdin, stdout, stderr)\n\n        self._execute_child(args, executable, preexec_fn, close_fds,\n                            cwd, env, universal_newlines,\n                            startupinfo, creationflags, shell,\n                            p2cread, p2cwrite,\n                            c2pread, c2pwrite,\n                            errread, errwrite)\n\n        if p2cwrite:\n            self.stdin = os.fdopen(p2cwrite, 'wb', bufsize)\n        if c2pread:\n            if universal_newlines:\n                self.stdout = os.fdopen(c2pread, 'rU', bufsize)\n            else:\n                self.stdout = os.fdopen(c2pread, 'rb', bufsize)\n        if errread:\n            if universal_newlines:\n                self.stderr = os.fdopen(errread, 'rU', bufsize)\n            else:\n                self.stderr = os.fdopen(errread, 'rb', bufsize)\n\n\n    def _translate_newlines(self, data):\n        data = data.replace(\"\\r\\n\", \"\\n\")\n        data = data.replace(\"\\r\", \"\\n\")\n        return data\n\n\n    def __del__(self):\n        if not self._child_created:\n            # We didn't get to successfully create a child process.\n            return\n        # In case the child hasn't been waited on, check if it's done.\n        self.poll(_deadstate=sys.maxsize)\n        if self.returncode is None and _active is not None:\n            # Child is still running, keep us alive until we can wait on it.\n            _active.append(self)\n\n\n    def communicate(self, input=None):\n        \"\"\"Interact with process: Send data to stdin.  Read data from\n        stdout and stderr, until end-of-file is reached.  Wait for\n        process to terminate.  The optional input argument should be a\n        string to be sent to the child process, or None, if no data\n        should be sent to the child.\n\n        communicate() returns a tuple (stdout, stderr).\"\"\"\n\n        # Optimization: If we are only using one pipe, or no pipe at\n        # all, using select() or threads is unnecessary.\n        if [self.stdin, self.stdout, self.stderr].count(None) >= 2:\n            stdout = None\n            stderr = None\n            if self.stdin:\n                if input:\n                    self.stdin.write(input)\n                self.stdin.close()\n            elif self.stdout:\n                stdout = self.stdout.read()\n            elif self.stderr:\n                stderr = self.stderr.read()\n            self.wait()\n            return (stdout, stderr)\n\n        return self._communicate(input)\n\n\n    if mswindows:\n        #\n        # Windows methods\n        #\n        def _get_handles(self, stdin, stdout, stderr):\n            \"\"\"Construct and return tupel with IO objects:\n            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite\n            \"\"\"\n            if stdin is None and stdout is None and stderr is None:\n                return (None, None, None, None, None, None)\n\n            p2cread, p2cwrite = None, None\n            c2pread, c2pwrite = None, None\n            errread, errwrite = None, None\n\n            if stdin is None:\n                p2cread = GetStdHandle(STD_INPUT_HANDLE)\n            elif stdin == PIPE:\n                p2cread, p2cwrite = CreatePipe(None, 0)\n                # Detach and turn into fd\n                p2cwrite = p2cwrite.Detach()\n                p2cwrite = msvcrt.open_osfhandle(p2cwrite, 0)\n            elif is_int(stdin):\n                p2cread = msvcrt.get_osfhandle(stdin)\n            else:\n                # Assuming file-like object\n                p2cread = msvcrt.get_osfhandle(stdin.fileno())\n            p2cread = self._make_inheritable(p2cread)\n\n            if stdout is None:\n                c2pwrite = GetStdHandle(STD_OUTPUT_HANDLE)\n            elif stdout == PIPE:\n                c2pread, c2pwrite = CreatePipe(None, 0)\n                # Detach and turn into fd\n                c2pread = c2pread.Detach()\n                c2pread = msvcrt.open_osfhandle(c2pread, 0)\n            elif is_int(stdout):\n                c2pwrite = msvcrt.get_osfhandle(stdout)\n            else:\n                # Assuming file-like object\n                c2pwrite = msvcrt.get_osfhandle(stdout.fileno())\n            c2pwrite = self._make_inheritable(c2pwrite)\n\n            if stderr is None:\n                errwrite = GetStdHandle(STD_ERROR_HANDLE)\n            elif stderr == PIPE:\n                errread, errwrite = CreatePipe(None, 0)\n                # Detach and turn into fd\n                errread = errread.Detach()\n                errread = msvcrt.open_osfhandle(errread, 0)\n            elif stderr == STDOUT:\n                errwrite = c2pwrite\n            elif is_int(stderr):\n                errwrite = msvcrt.get_osfhandle(stderr)\n            else:\n                # Assuming file-like object\n                errwrite = msvcrt.get_osfhandle(stderr.fileno())\n            errwrite = self._make_inheritable(errwrite)\n\n            return (p2cread, p2cwrite,\n                    c2pread, c2pwrite,\n                    errread, errwrite)\n\n\n        def _make_inheritable(self, handle):\n            \"\"\"Return a duplicate of handle, which is inheritable\"\"\"\n            return DuplicateHandle(GetCurrentProcess(), handle,\n                                   GetCurrentProcess(), 0, 1,\n                                   DUPLICATE_SAME_ACCESS)\n\n\n        def _find_w9xpopen(self):\n            \"\"\"Find and return absolut path to w9xpopen.exe\"\"\"\n            w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)),\n                                    \"w9xpopen.exe\")\n            if not os.path.exists(w9xpopen):\n                # Eeek - file-not-found - possibly an embedding\n                # situation - see if we can locate it in sys.exec_prefix\n                w9xpopen = os.path.join(os.path.dirname(sys.exec_prefix),\n                                        \"w9xpopen.exe\")\n                if not os.path.exists(w9xpopen):\n                    raise RuntimeError(\"Cannot locate w9xpopen.exe, which is \"\n                                       \"needed for Popen to work with your \"\n                                       \"shell or platform.\")\n            return w9xpopen\n\n\n        def _execute_child(self, args, executable, preexec_fn, close_fds,\n                           cwd, env, universal_newlines,\n                           startupinfo, creationflags, shell,\n                           p2cread, p2cwrite,\n                           c2pread, c2pwrite,\n                           errread, errwrite):\n            \"\"\"Execute program (MS Windows version)\"\"\"\n\n            if not isinstance(args, types.StringTypes):\n                args = list2cmdline(args)\n\n            # Process startup details\n            if startupinfo is None:\n                startupinfo = STARTUPINFO()\n            if None not in (p2cread, c2pwrite, errwrite):\n                startupinfo.dwFlags = startupinfo.dwFlags | STARTF_USESTDHANDLES\n                startupinfo.hStdInput = p2cread\n                startupinfo.hStdOutput = c2pwrite\n                startupinfo.hStdError = errwrite\n\n            if shell:\n                startupinfo.dwFlags = startupinfo.dwFlags | STARTF_USESHOWWINDOW\n                startupinfo.wShowWindow = SW_HIDE\n                comspec = os.environ.get(\"COMSPEC\", \"cmd.exe\")\n                args = comspec + \" /c \" + args\n                if (GetVersion() >= 0x80000000L or\n                        os.path.basename(comspec).lower() == \"command.com\"):\n                    # Win9x, or using command.com on NT. We need to\n                    # use the w9xpopen intermediate program. For more\n                    # information, see KB Q150956\n                    # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/support/kb/articles/Q150/9/56.asp)\n                    w9xpopen = self._find_w9xpopen()\n                    args = '\"%s\" %s' % (w9xpopen, args)\n                    # Not passing CREATE_NEW_CONSOLE has been known to\n                    # cause random failures on win9x.  Specifically a\n                    # dialog: \"Your program accessed mem currently in\n                    # use at xxx\" and a hopeful warning about the\n                    # stability of your system.  Cost is Ctrl+C wont\n                    # kill children.\n                    creationflags = creationflags | CREATE_NEW_CONSOLE\n\n            # Start the process\n            try:\n                hp, ht, pid, tid = CreateProcess(executable, args,\n                                         # no special security\n                                         None, None,\n                                         # must inherit handles to pass std\n                                         # handles\n                                         1,\n                                         creationflags,\n                                         env,\n                                         cwd,\n                                         startupinfo)\n            except pywintypes.error, e:\n                # Translate pywintypes.error to WindowsError, which is\n                # a subclass of OSError.  FIXME: We should really\n                # translate errno using _sys_errlist (or simliar), but\n                # how can this be done from Python?\n                raise WindowsError(*e.args)\n\n            # Retain the process handle, but close the thread handle\n            self._child_created = True\n            self._handle = hp\n            self.pid = pid\n            ht.Close()\n\n            # Child is launched. Close the parent's copy of those pipe\n            # handles that only the child should have open.  You need\n            # to make sure that no handles to the write end of the\n            # output pipe are maintained in this process or else the\n            # pipe will not close when the child process exits and the\n            # ReadFile will hang.\n            if p2cread is not None:\n                p2cread.Close()\n            if c2pwrite is not None:\n                c2pwrite.Close()\n            if errwrite is not None:\n                errwrite.Close()\n\n\n        def poll(self, _deadstate=None):\n            \"\"\"Check if child process has terminated.  Returns returncode\n            attribute.\"\"\"\n            if self.returncode is None:\n                if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0:\n                    self.returncode = GetExitCodeProcess(self._handle)\n            return self.returncode\n\n\n        def wait(self):\n            \"\"\"Wait for child process to terminate.  Returns returncode\n            attribute.\"\"\"\n            if self.returncode is None:\n                obj = WaitForSingleObject(self._handle, INFINITE)\n                self.returncode = GetExitCodeProcess(self._handle)\n            return self.returncode\n\n\n        def _readerthread(self, fh, buffer):\n            buffer.append(fh.read())\n\n\n        def _communicate(self, input):\n            stdout = None # Return\n            stderr = None # Return\n\n            if self.stdout:\n                stdout = []\n                stdout_thread = threading.Thread(target=self._readerthread,\n                                                 args=(self.stdout, stdout))\n                stdout_thread.setDaemon(True)\n                stdout_thread.start()\n            if self.stderr:\n                stderr = []\n                stderr_thread = threading.Thread(target=self._readerthread,\n                                                 args=(self.stderr, stderr))\n                stderr_thread.setDaemon(True)\n                stderr_thread.start()\n\n            if self.stdin:\n                if input is not None:\n                    self.stdin.write(input)\n                self.stdin.close()\n\n            if self.stdout:\n                stdout_thread.join()\n            if self.stderr:\n                stderr_thread.join()\n\n            # All data exchanged.  Translate lists into strings.\n            if stdout is not None:\n                stdout = stdout[0]\n            if stderr is not None:\n                stderr = stderr[0]\n\n            # Translate newlines, if requested.  We cannot let the file\n            # object do the translation: It is based on stdio, which is\n            # impossible to combine with select (unless forcing no\n            # buffering).\n            if self.universal_newlines and hasattr(file, 'newlines'):\n                if stdout:\n                    stdout = self._translate_newlines(stdout)\n                if stderr:\n                    stderr = self._translate_newlines(stderr)\n\n            self.wait()\n            return (stdout, stderr)\n\n    else:\n        #\n        # POSIX methods\n        #\n        def _get_handles(self, stdin, stdout, stderr):\n            \"\"\"Construct and return tupel with IO objects:\n            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite\n            \"\"\"\n            p2cread, p2cwrite = None, None\n            c2pread, c2pwrite = None, None\n            errread, errwrite = None, None\n\n            if stdin is None:\n                pass\n            elif stdin == PIPE:\n                p2cread, p2cwrite = os.pipe()\n            elif is_int(stdin):\n                p2cread = stdin\n            else:\n                # Assuming file-like object\n                p2cread = stdin.fileno()\n\n            if stdout is None:\n                pass\n            elif stdout == PIPE:\n                c2pread, c2pwrite = os.pipe()\n            elif is_int(stdout):\n                c2pwrite = stdout\n            else:\n                # Assuming file-like object\n                c2pwrite = stdout.fileno()\n\n            if stderr is None:\n                pass\n            elif stderr == PIPE:\n                errread, errwrite = os.pipe()\n            elif stderr == STDOUT:\n                errwrite = c2pwrite\n            elif is_int(stderr):\n                errwrite = stderr\n            else:\n                # Assuming file-like object\n                errwrite = stderr.fileno()\n\n            return (p2cread, p2cwrite,\n                    c2pread, c2pwrite,\n                    errread, errwrite)\n\n\n        def _set_cloexec_flag(self, fd):\n            try:\n                cloexec_flag = fcntl.FD_CLOEXEC\n            except AttributeError:\n                cloexec_flag = 1\n\n            old = fcntl.fcntl(fd, fcntl.F_GETFD)\n            fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag)\n\n\n        def _close_fds(self, but):\n            for i in range(3, MAXFD):\n                if i == but:\n                    continue\n                try:\n                    os.close(i)\n                except KeyboardInterrupt:\n                    raise       # SCons:  don't swallow keyboard interrupts\n                except:\n                    pass\n\n\n        def _execute_child(self, args, executable, preexec_fn, close_fds,\n                           cwd, env, universal_newlines,\n                           startupinfo, creationflags, shell,\n                           p2cread, p2cwrite,\n                           c2pread, c2pwrite,\n                           errread, errwrite):\n            \"\"\"Execute program (POSIX version)\"\"\"\n\n            if is_string(args):\n                args = [args]\n\n            if shell:\n                args = [\"/bin/sh\", \"-c\"] + args\n\n            if executable is None:\n                executable = args[0]\n\n            # For transferring possible exec failure from child to parent\n            # The first char specifies the exception type: 0 means\n            # OSError, 1 means some other error.\n            errpipe_read, errpipe_write = os.pipe()\n            self._set_cloexec_flag(errpipe_write)\n\n            self.pid = os.fork()\n            self._child_created = True\n            if self.pid == 0:\n                # Child\n                try:\n                    # Close parent's pipe ends\n                    if p2cwrite:\n                        os.close(p2cwrite)\n                    if c2pread:\n                        os.close(c2pread)\n                    if errread:\n                        os.close(errread)\n                    os.close(errpipe_read)\n\n                    # Dup fds for child\n                    if p2cread:\n                        os.dup2(p2cread, 0)\n                    if c2pwrite:\n                        os.dup2(c2pwrite, 1)\n                    if errwrite:\n                        os.dup2(errwrite, 2)\n\n                    # Close pipe fds.  Make sure we don't close the same\n                    # fd more than once, or standard fds.\n                    try:\n                        set\n                    except NameError:\n                        # Fall-back for earlier Python versions, so epydoc\n                        # can use this module directly to execute things.\n                        if p2cread:\n                            os.close(p2cread)\n                        if c2pwrite and c2pwrite not in (p2cread,):\n                            os.close(c2pwrite)\n                        if errwrite and errwrite not in (p2cread, c2pwrite):\n                            os.close(errwrite)\n                    else:\n                        for fd in set((p2cread, c2pwrite, errwrite))-set((0,1,2)):\n                            if fd: os.close(fd)\n\n                    # Close all other fds, if asked for\n                    if close_fds:\n                        self._close_fds(but=errpipe_write)\n\n                    if cwd is not None:\n                        os.chdir(cwd)\n\n                    if preexec_fn:\n                        apply(preexec_fn)\n\n                    if env is None:\n                        os.execvp(executable, args)\n                    else:\n                        os.execvpe(executable, args, env)\n\n                except KeyboardInterrupt:\n                    raise       # SCons:  don't swallow keyboard interrupts\n\n                except:\n                    exc_type, exc_value, tb = sys.exc_info()\n                    # Save the traceback and attach it to the exception object\n                    exc_lines = traceback.format_exception(exc_type,\n                                                           exc_value,\n                                                           tb)\n                    exc_value.child_traceback = ''.join(exc_lines)\n                    os.write(errpipe_write, pickle.dumps(exc_value))\n\n                # This exitcode won't be reported to applications, so it\n                # really doesn't matter what we return.\n                os._exit(255)\n\n            # Parent\n            os.close(errpipe_write)\n            if p2cread and p2cwrite:\n                os.close(p2cread)\n            if c2pwrite and c2pread:\n                os.close(c2pwrite)\n            if errwrite and errread:\n                os.close(errwrite)\n\n            # Wait for exec to fail or succeed; possibly raising exception\n            data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB\n            os.close(errpipe_read)\n            if data != \"\":\n                os.waitpid(self.pid, 0)\n                child_exception = pickle.loads(data)\n                raise child_exception\n\n\n        def _handle_exitstatus(self, sts):\n            if os.WIFSIGNALED(sts):\n                self.returncode = -os.WTERMSIG(sts)\n            elif os.WIFEXITED(sts):\n                self.returncode = os.WEXITSTATUS(sts)\n            else:\n                # Should never happen\n                raise RuntimeError(\"Unknown child exit status!\")\n\n\n        def poll(self, _deadstate=None):\n            \"\"\"Check if child process has terminated.  Returns returncode\n            attribute.\"\"\"\n            if self.returncode is None:\n                try:\n                    pid, sts = os.waitpid(self.pid, os.WNOHANG)\n                    if pid == self.pid:\n                        self._handle_exitstatus(sts)\n                except os.error:\n                    if _deadstate is not None:\n                        self.returncode = _deadstate\n            return self.returncode\n\n\n        def wait(self):\n            \"\"\"Wait for child process to terminate.  Returns returncode\n            attribute.\"\"\"\n            if self.returncode is None:\n                pid, sts = os.waitpid(self.pid, 0)\n                self._handle_exitstatus(sts)\n            return self.returncode\n\n\n        def _communicate(self, input):\n            read_set = []\n            write_set = []\n            stdout = None # Return\n            stderr = None # Return\n\n            if self.stdin:\n                # Flush stdio buffer.  This might block, if the user has\n                # been writing to .stdin in an uncontrolled fashion.\n                self.stdin.flush()\n                if input:\n                    write_set.append(self.stdin)\n                else:\n                    self.stdin.close()\n            if self.stdout:\n                read_set.append(self.stdout)\n                stdout = []\n            if self.stderr:\n                read_set.append(self.stderr)\n                stderr = []\n\n            input_offset = 0\n            while read_set or write_set:\n                rlist, wlist, xlist = select.select(read_set, write_set, [])\n\n                if self.stdin in wlist:\n                    # When select has indicated that the file is writable,\n                    # we can write up to PIPE_BUF bytes without risk\n                    # blocking.  POSIX defines PIPE_BUF >= 512\n                    m = memoryview(input)[input_offset:input_offset+512]\n                    bytes_written = os.write(self.stdin.fileno(), m)\n                    input_offset = input_offset + bytes_written\n                    if input_offset >= len(input):\n                        self.stdin.close()\n                        write_set.remove(self.stdin)\n\n                if self.stdout in rlist:\n                    data = os.read(self.stdout.fileno(), 1024)\n                    if data == \"\":\n                        self.stdout.close()\n                        read_set.remove(self.stdout)\n                    stdout.append(data)\n\n                if self.stderr in rlist:\n                    data = os.read(self.stderr.fileno(), 1024)\n                    if data == \"\":\n                        self.stderr.close()\n                        read_set.remove(self.stderr)\n                    stderr.append(data)\n\n            # All data exchanged.  Translate lists into strings.\n            if stdout is not None:\n                stdout = ''.join(stdout)\n            if stderr is not None:\n                stderr = ''.join(stderr)\n\n            # Translate newlines, if requested.  We cannot let the file\n            # object do the translation: It is based on stdio, which is\n            # impossible to combine with select (unless forcing no\n            # buffering).\n            if self.universal_newlines and hasattr(file, 'newlines'):\n                if stdout:\n                    stdout = self._translate_newlines(stdout)\n                if stderr:\n                    stderr = self._translate_newlines(stderr)\n\n            self.wait()\n            return (stdout, stderr)\n\n\ndef _demo_posix():\n    #\n    # Example 1: Simple redirection: Get process list\n    #\n    plist = Popen([\"ps\"], stdout=PIPE).communicate()[0]\n    print \"Process list:\"\n    print plist\n\n    #\n    # Example 2: Change uid before executing child\n    #\n    if os.getuid() == 0:\n        p = Popen([\"id\"], preexec_fn=lambda: os.setuid(100))\n        p.wait()\n\n    #\n    # Example 3: Connecting several subprocesses\n    #\n    print \"Looking for 'hda'...\"\n    p1 = Popen([\"dmesg\"], stdout=PIPE)\n    p2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\n    print repr(p2.communicate()[0])\n\n    #\n    # Example 4: Catch execution error\n    #\n    print\n    print \"Trying a weird file...\"\n    try:\n        print Popen([\"/this/path/does/not/exist\"]).communicate()\n    except OSError, e:\n        if e.errno == errno.ENOENT:\n            print \"The file didn't exist.  I thought so...\"\n            print \"Child traceback:\"\n            print e.child_traceback\n        else:\n            print \"Error\", e.errno\n    else:\n        sys.stderr.write( \"Gosh.  No error.\\n\" )\n\n\ndef _demo_windows():\n    #\n    # Example 1: Connecting several subprocesses\n    #\n    print \"Looking for 'PROMPT' in set output...\"\n    p1 = Popen(\"set\", stdout=PIPE, shell=True)\n    p2 = Popen('find \"PROMPT\"', stdin=p1.stdout, stdout=PIPE)\n    print repr(p2.communicate()[0])\n\n    #\n    # Example 2: Simple execution of program\n    #\n    print \"Executing calc...\"\n    p = Popen(\"calc\")\n    p.wait()\n\n\nif __name__ == \"__main__\":\n    if mswindows:\n        _demo_windows()\n    else:\n        _demo_posix()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/cpp.py",
    "content": "#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/cpp.py  2014/07/05 09:42:21 garyo\"\n\n__doc__ = \"\"\"\nSCons C Pre-Processor module\n\"\"\"\n#TODO 2.3 and before has no sorted()\nimport SCons.compat\n\nimport os\nimport re\n\n#\n# First \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to turn the C preprocessor directives in a file's contents into\n# a list of tuples that we can process easily.\n#\n\n# A table of regular expressions that fetch the arguments from the rest of\n# a C preprocessor line.  Different directives have different arguments\n# that we want to fetch, using the regular expressions to which the lists\n# of preprocessor directives map.\ncpp_lines_dict = {\n    # Fetch the rest of a #if/#elif/#ifdef/#ifndef as one argument,\n    # separated from the keyword by white space.\n    ('if', 'elif', 'ifdef', 'ifndef',)\n                        : '\\s+(.+)',\n\n    # Fetch the rest of a #import/#include/#include_next line as one\n    # argument, with white space optional.\n    ('import', 'include', 'include_next',)\n                        : '\\s*(.+)',\n\n    # We don't care what comes after a #else or #endif line.\n    ('else', 'endif',)  : '',\n\n    # Fetch three arguments from a #define line:\n    #   1) The #defined keyword.\n    #   2) The optional parentheses and arguments (if it's a function-like\n    #      macro, '' if it's not).\n    #   3) The expansion value.\n    ('define',)         : '\\s+([_A-Za-z][_A-Za-z0-9_]*)(\\([^)]*\\))?\\s*(.*)',\n\n    # Fetch the #undefed keyword from a #undef line.\n    ('undef',)          : '\\s+([_A-Za-z][A-Za-z0-9_]*)',\n}\n\n# Create a table that maps each individual C preprocessor directive to\n# the corresponding compiled regular expression that fetches the arguments\n# we care about.\nTable = {}\nfor op_list, expr in cpp_lines_dict.items():\n    e = re.compile(expr)\n    for op in op_list:\n        Table[op] = e\ndel e\ndel op\ndel op_list\n\n# Create a list of the expressions we'll use to match all of the\n# preprocessor directives.  These are the same as the directives\n# themselves *except* that we must use a negative lookahead assertion\n# when matching \"if\" so it doesn't match the \"if\" in \"ifdef.\"\noverride = {\n    'if'                        : 'if(?!def)',\n}\nl = [override.get(x, x) for x in Table.keys()]\n\n\n# Turn the list of expressions into one big honkin' regular expression\n# that will match all the preprocessor lines at once.  This will return\n# a list of tuples, one for each preprocessor line.  The preprocessor\n# directive will be the first element in each tuple, and the rest of\n# the line will be the second element.\ne = '^\\s*#\\s*(' + '|'.join(l) + ')(.*)$'\n\n# And last but not least, compile the expression.\nCPP_Expression = re.compile(e, re.M)\n\n\n\n\n#\n# Second \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to translate a C preprocessor expression (as found on a #if or\n# #elif line) into an equivalent Python expression that we can eval().\n#\n\n# A dictionary that maps the C representation of Boolean operators\n# to their Python equivalents.\nCPP_to_Python_Ops_Dict = {\n    '!'         : ' not ',\n    '!='        : ' != ',\n    '&&'        : ' and ',\n    '||'        : ' or ',\n    '?'         : ' and ',\n    ':'         : ' or ',\n    '\\r'        : '',\n}\n\nCPP_to_Python_Ops_Sub = lambda m: CPP_to_Python_Ops_Dict[m.group(0)]\n\n# We have to sort the keys by length so that longer expressions\n# come *before* shorter expressions--in particular, \"!=\" must\n# come before \"!\" in the alternation.  Without this, the Python\n# re module, as late as version 2.2.2, empirically matches the\n# \"!\" in \"!=\" first, instead of finding the longest match.\n# What's up with that?\nl = sorted(CPP_to_Python_Ops_Dict.keys(), key=lambda a: len(a), reverse=True)\n\n# Turn the list of keys into one regular expression that will allow us\n# to substitute all of the operators at once.\nexpr = '|'.join(map(re.escape, l))\n\n# ...and compile the expression.\nCPP_to_Python_Ops_Expression = re.compile(expr)\n\n# A separate list of expressions to be evaluated and substituted\n# sequentially, not all at once.\nCPP_to_Python_Eval_List = [\n    ['defined\\s+(\\w+)',         '\"\\\\1\" in __dict__'],\n    ['defined\\s*\\((\\w+)\\)',     '\"\\\\1\" in __dict__'],\n    ['/\\*.*\\*/',                ''],\n    ['/\\*.*',                   ''],\n    ['//.*',                    ''],\n    ['(0x[0-9A-Fa-f]*)[UL]+',   '\\\\1'],\n]\n\n# Replace the string representations of the regular expressions in the\n# list with compiled versions.\nfor l in CPP_to_Python_Eval_List:\n    l[0] = re.compile(l[0])\n\n# Wrap up all of the above into a handy function.\ndef CPP_to_Python(s):\n    \"\"\"\n    Converts a C pre-processor expression into an equivalent\n    Python expression that can be evaluated.\n    \"\"\"\n    s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)\n    for expr, repl in CPP_to_Python_Eval_List:\n        s = expr.sub(repl, s)\n    return s\n\n\n\ndel expr\ndel l\ndel override\n\n\n\nclass FunctionEvaluator(object):\n    \"\"\"\n    Handles delayed evaluation of a #define function call.\n    \"\"\"\n    def __init__(self, name, args, expansion):\n        \"\"\"\n        Squirrels away the arguments and expansion value of a #define\n        macro function for later evaluation when we must actually expand\n        a value that uses it.\n        \"\"\"\n        self.name = name\n        self.args = function_arg_separator.split(args)\n        try:\n            expansion = expansion.split('##')\n        except AttributeError:\n            pass\n        self.expansion = expansion\n    def __call__(self, *values):\n        \"\"\"\n        Evaluates the expansion of a #define macro function called\n        with the specified values.\n        \"\"\"\n        if len(self.args) != len(values):\n            raise ValueError(\"Incorrect number of arguments to `%s'\" % self.name)\n        # Create a dictionary that maps the macro arguments to the\n        # corresponding values in this \"call.\"  We'll use this when we\n        # eval() the expansion so that arguments will get expanded to\n        # the right values.\n        locals = {}\n        for k, v in zip(self.args, values):\n            locals[k] = v\n\n        parts = []\n        for s in self.expansion:\n            if not s in self.args:\n                s = repr(s)\n            parts.append(s)\n        statement = ' + '.join(parts)\n\n        return eval(statement, globals(), locals)\n\n\n\n# Find line continuations.\nline_continuations = re.compile('\\\\\\\\\\r?\\n')\n\n# Search for a \"function call\" macro on an expansion.  Returns the\n# two-tuple of the \"function\" name itself, and a string containing the\n# arguments within the call parentheses.\nfunction_name = re.compile('(\\S+)\\(([^)]*)\\)')\n\n# Split a string containing comma-separated function call arguments into\n# the separate arguments.\nfunction_arg_separator = re.compile(',\\s*')\n\n\n\nclass PreProcessor(object):\n    \"\"\"\n    The main workhorse class for handling C pre-processing.\n    \"\"\"\n    def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0):\n        global Table\n\n        cpppath = tuple(cpppath)\n\n        self.searchpath = {\n            '\"' :       (current,) + cpppath,\n            '<' :       cpppath + (current,),\n        }\n\n        # Initialize our C preprocessor namespace for tracking the\n        # values of #defined keywords.  We use this namespace to look\n        # for keywords on #ifdef/#ifndef lines, and to eval() the\n        # expressions on #if/#elif lines (after massaging them from C to\n        # Python).\n        self.cpp_namespace = dict.copy()\n        self.cpp_namespace['__dict__'] = self.cpp_namespace\n\n        if all:\n           self.do_include = self.all_include\n\n        # For efficiency, a dispatch table maps each C preprocessor\n        # directive (#if, #define, etc.) to the method that should be\n        # called when we see it.  We accomodate state changes (#if,\n        # #ifdef, #ifndef) by pushing the current dispatch table on a\n        # stack and changing what method gets called for each relevant\n        # directive we might see next at this level (#else, #elif).\n        # #endif will simply pop the stack.\n        d = {\n            'scons_current_file'    : self.scons_current_file\n        }\n        for op in Table.keys():\n            d[op] = getattr(self, 'do_' + op)\n        self.default_table = d\n\n    # Controlling methods.\n\n    def tupleize(self, contents):\n        \"\"\"\n        Turns the contents of a file into a list of easily-processed\n        tuples describing the CPP lines in the file.\n\n        The first element of each tuple is the line's preprocessor\n        directive (#if, #include, #define, etc., minus the initial '#').\n        The remaining elements are specific to the type of directive, as\n        pulled apart by the regular expression.\n        \"\"\"\n        global CPP_Expression, Table\n        contents = line_continuations.sub('', contents)\n        cpp_tuples = CPP_Expression.findall(contents)\n        return  [(m[0],) + Table[m[0]].match(m[1]).groups() for m in cpp_tuples]\n\n    def __call__(self, file):\n        \"\"\"\n        Pre-processes a file.\n\n        This is the main public entry point.\n        \"\"\"\n        self.current_file = file\n        return self.process_contents(self.read_file(file), file)\n\n    def process_contents(self, contents, fname=None):\n        \"\"\"\n        Pre-processes a file contents.\n\n        This is the main internal entry point.\n        \"\"\"\n        self.stack = []\n        self.dispatch_table = self.default_table.copy()\n        self.current_file = fname\n        self.tuples = self.tupleize(contents)\n\n        self.initialize_result(fname)\n        while self.tuples:\n            t = self.tuples.pop(0)\n            # Uncomment to see the list of tuples being processed (e.g.,\n            # to validate the CPP lines are being translated correctly).\n            #print t\n            self.dispatch_table[t[0]](t)\n        return self.finalize_result(fname)\n\n    # Dispatch table stack manipulation methods.\n\n    def save(self):\n        \"\"\"\n        Pushes the current dispatch table on the stack and re-initializes\n        the current dispatch table to the default.\n        \"\"\"\n        self.stack.append(self.dispatch_table)\n        self.dispatch_table = self.default_table.copy()\n\n    def restore(self):\n        \"\"\"\n        Pops the previous dispatch table off the stack and makes it the\n        current one.\n        \"\"\"\n        try: self.dispatch_table = self.stack.pop()\n        except IndexError: pass\n\n    # Utility methods.\n\n    def do_nothing(self, t):\n        \"\"\"\n        Null method for when we explicitly want the action for a\n        specific preprocessor directive to do nothing.\n        \"\"\"\n        pass\n\n    def scons_current_file(self, t):\n        self.current_file = t[1]\n\n    def eval_expression(self, t):\n        \"\"\"\n        Evaluates a C preprocessor expression.\n\n        This is done by converting it to a Python equivalent and\n        eval()ing it in the C preprocessor namespace we use to\n        track #define values.\n        \"\"\"\n        t = CPP_to_Python(' '.join(t[1:]))\n        try: return eval(t, self.cpp_namespace)\n        except (NameError, TypeError): return 0\n\n    def initialize_result(self, fname):\n        self.result = [fname]\n\n    def finalize_result(self, fname):\n        return self.result[1:]\n\n    def find_include_file(self, t):\n        \"\"\"\n        Finds the #include file for a given preprocessor tuple.\n        \"\"\"\n        fname = t[2]\n        for d in self.searchpath[t[1]]:\n            if d == os.curdir:\n                f = fname\n            else:\n                f = os.path.join(d, fname)\n            if os.path.isfile(f):\n                return f\n        return None\n\n    def read_file(self, file):\n        return open(file).read()\n\n    # Start and stop processing include lines.\n\n    def start_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to start processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates True, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated\n        False.\n\n        \"\"\"\n        d = self.dispatch_table\n        p = self.stack[-1] if self.stack else self.default_table\n\n        for k in ('import', 'include', 'include_next'):\n            d[k] = p[k]\n\n    def stop_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to stop processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates False, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated True.\n        \"\"\"\n        d = self.dispatch_table\n        d['import'] = self.do_nothing\n        d['include'] =  self.do_nothing\n        d['include_next'] =  self.do_nothing\n\n    # Default methods for handling all of the preprocessor directives.\n    # (Note that what actually gets called for a given directive at any\n    # point in time is really controlled by the dispatch_table.)\n\n    def _do_if_else_condition(self, condition):\n        \"\"\"\n        Common logic for evaluating the conditions on #if, #ifdef and\n        #ifndef lines.\n        \"\"\"\n        self.save()\n        d = self.dispatch_table\n        if condition:\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n        else:\n            self.stop_handling_includes()\n            d['elif'] = self.do_elif\n            d['else'] = self.start_handling_includes\n\n    def do_ifdef(self, t):\n        \"\"\"\n        Default handling of a #ifdef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] in self.cpp_namespace)\n\n    def do_ifndef(self, t):\n        \"\"\"\n        Default handling of a #ifndef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] not in self.cpp_namespace)\n\n    def do_if(self, t):\n        \"\"\"\n        Default handling of a #if line.\n        \"\"\"\n        self._do_if_else_condition(self.eval_expression(t))\n\n    def do_elif(self, t):\n        \"\"\"\n        Default handling of a #elif line.\n        \"\"\"\n        d = self.dispatch_table\n        if self.eval_expression(t):\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n\n    def do_else(self, t):\n        \"\"\"\n        Default handling of a #else line.\n        \"\"\"\n        pass\n\n    def do_endif(self, t):\n        \"\"\"\n        Default handling of a #endif line.\n        \"\"\"\n        self.restore()\n\n    def do_define(self, t):\n        \"\"\"\n        Default handling of a #define line.\n        \"\"\"\n        _, name, args, expansion = t\n        try:\n            expansion = int(expansion)\n        except (TypeError, ValueError):\n            pass\n        if args:\n            evaluator = FunctionEvaluator(name, args[1:-1], expansion)\n            self.cpp_namespace[name] = evaluator\n        else:\n            self.cpp_namespace[name] = expansion\n\n    def do_undef(self, t):\n        \"\"\"\n        Default handling of a #undef line.\n        \"\"\"\n        try: del self.cpp_namespace[t[1]]\n        except KeyError: pass\n\n    def do_import(self, t):\n        \"\"\"\n        Default handling of a #import line.\n        \"\"\"\n        # XXX finish this -- maybe borrow/share logic from do_include()...?\n        pass\n\n    def do_include(self, t):\n        \"\"\"\n        Default handling of a #include line.\n        \"\"\"\n        t = self.resolve_include(t)\n        include_file = self.find_include_file(t)\n        if include_file:\n            #print \"include_file =\", include_file\n            self.result.append(include_file)\n            contents = self.read_file(include_file)\n            new_tuples = [('scons_current_file', include_file)] + \\\n                         self.tupleize(contents) + \\\n                         [('scons_current_file', self.current_file)]\n            self.tuples[:] = new_tuples + self.tuples\n\n    # Date: Tue, 22 Nov 2005 20:26:09 -0500\n    # From: Stefan Seefeld <seefeld@sympatico.ca>\n    #\n    # By the way, #include_next is not the same as #include. The difference\n    # being that #include_next starts its search in the path following the\n    # path that let to the including file. In other words, if your system\n    # include paths are ['/foo', '/bar'], and you are looking at a header\n    # '/foo/baz.h', it might issue an '#include_next <baz.h>' which would\n    # correctly resolve to '/bar/baz.h' (if that exists), but *not* see\n    # '/foo/baz.h' again. See http://www.delorie.com/gnu/docs/gcc/cpp_11.html\n    # for more reasoning.\n    #\n    # I have no idea in what context 'import' might be used.\n\n    # XXX is #include_next really the same as #include ?\n    do_include_next = do_include\n\n    # Utility methods for handling resolution of include files.\n\n    def resolve_include(self, t):\n        \"\"\"Resolve a tuple-ized #include line.\n\n        This handles recursive expansion of values without \"\" or <>\n        surrounding the name until an initial \" or < is found, to handle\n                #include FILE\n        where FILE is a #define somewhere else.\n        \"\"\"\n        s = t[1]\n        while not s[0] in '<\"':\n            #print \"s =\", s\n            try:\n                s = self.cpp_namespace[s]\n            except KeyError:\n                m = function_name.search(s)\n                s = self.cpp_namespace[m.group(1)]\n                if callable(s):\n                    args = function_arg_separator.split(m.group(2))\n                    s = s(*args)\n            if not s:\n                return None\n        return (t[0], s[0], s[1:-1])\n\n    def all_include(self, t):\n        \"\"\"\n        \"\"\"\n        self.result.append(self.resolve_include(t))\n\nclass DumbPreProcessor(PreProcessor):\n    \"\"\"A preprocessor that ignores all #if/#elif/#else/#endif directives\n    and just reports back *all* of the #include files (like the classic\n    SCons scanner did).\n\n    This is functionally equivalent to using a regular expression to\n    find all of the #include lines, only slower.  It exists mainly as\n    an example of how the main PreProcessor class can be sub-classed\n    to tailor its behavior.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        PreProcessor.__init__(self, *args, **kw)\n        d = self.default_table\n        for func in ['if', 'elif', 'else', 'endif', 'ifdef', 'ifndef']:\n            d[func] = d[func] = self.do_nothing\n\ndel __revision__\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/dblite.py",
    "content": "# dblite.py module contributed by Ralf W. Grosse-Kunstleve.\n# Extended for Unicode by Steven Knight.\n\nimport SCons.compat\n\nimport builtins\nimport os\n# compat layer imports \"cPickle\" for us if it's available.\nimport pickle\nimport shutil\nimport time\n\nkeep_all_files = 00000\nignore_corrupt_dbfiles = 0\n\ndef corruption_warning(filename):\n    print \"Warning: Discarding corrupt database:\", filename\n\ntry: unicode\nexcept NameError:\n    def is_string(s):\n        return isinstance(s, str)\nelse:\n    def is_string(s):\n        return type(s) in (str, unicode)\n\ntry:\n    unicode('a')\nexcept NameError:\n    def unicode(s): return s\n\ndblite_suffix = '.dblite'\ntmp_suffix = '.tmp'\n\nclass dblite(object):\n\n  # Squirrel away references to the functions in various modules\n  # that we'll use when our __del__() method calls our sync() method\n  # during shutdown.  We might get destroyed when Python is in the midst\n  # of tearing down the different modules we import in an essentially\n  # arbitrary order, and some of the various modules's global attributes\n  # may already be wiped out from under us.\n  #\n  # See the discussion at:\n  #   http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html\n\n  _open = builtins.open\n  _pickle_dump = staticmethod(pickle.dump)\n  _os_chmod = os.chmod\n  try:\n      _os_chown = os.chown\n  except AttributeError:\n      _os_chown = None\n  _os_rename = os.rename\n  _os_unlink = os.unlink\n  _shutil_copyfile = shutil.copyfile\n  _time_time = time.time\n\n  def __init__(self, file_base_name, flag, mode):\n    assert flag in (None, \"r\", \"w\", \"c\", \"n\")\n    if (flag is None): flag = \"r\"\n    base, ext = os.path.splitext(file_base_name)\n    if ext == dblite_suffix:\n      # There's already a suffix on the file name, don't add one.\n      self._file_name = file_base_name\n      self._tmp_name = base + tmp_suffix\n    else:\n      self._file_name = file_base_name + dblite_suffix\n      self._tmp_name = file_base_name + tmp_suffix\n    self._flag = flag\n    self._mode = mode\n    self._dict = {}\n    self._needs_sync = 00000\n    if self._os_chown is not None and (os.geteuid()==0 or os.getuid()==0):\n      # running as root; chown back to current owner/group when done\n      try:\n        statinfo = os.stat(self._file_name)\n        self._chown_to = statinfo.st_uid\n        self._chgrp_to = statinfo.st_gid\n      except OSError, e:\n        # db file doesn't exist yet.\n        # Check os.environ for SUDO_UID, use if set\n        self._chown_to = int(os.environ.get('SUDO_UID', -1))\n        self._chgrp_to = int(os.environ.get('SUDO_GID', -1))\n    else:\n      self._chown_to = -1        # don't chown\n      self._chgrp_to = -1        # don't chgrp\n    if (self._flag == \"n\"):\n      self._open(self._file_name, \"wb\", self._mode)\n    else:\n      try:\n        f = self._open(self._file_name, \"rb\")\n      except IOError, e:\n        if (self._flag != \"c\"):\n          raise e\n        self._open(self._file_name, \"wb\", self._mode)\n      else:\n        p = f.read()\n        if (len(p) > 0):\n          try:\n            self._dict = pickle.loads(p)\n          except (pickle.UnpicklingError, EOFError):\n            if (ignore_corrupt_dbfiles == 0): raise\n            if (ignore_corrupt_dbfiles == 1):\n              corruption_warning(self._file_name)\n\n  def close(self):\n    if (self._needs_sync):\n      self.sync()\n\n  def __del__(self):\n    self.close()\n\n  def sync(self):\n    self._check_writable()\n    f = self._open(self._tmp_name, \"wb\", self._mode)\n    self._pickle_dump(self._dict, f, 1)\n    f.close()\n    # Windows doesn't allow renaming if the file exists, so unlink\n    # it first, chmod'ing it to make sure we can do so.  On UNIX, we\n    # may not be able to chmod the file if it's owned by someone else\n    # (e.g. from a previous run as root).  We should still be able to\n    # unlink() the file if the directory's writable, though, so ignore\n    # any OSError exception  thrown by the chmod() call.\n    try: self._os_chmod(self._file_name, 0777)\n    except OSError: pass\n    self._os_unlink(self._file_name)\n    self._os_rename(self._tmp_name, self._file_name)\n    if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1\n      try:\n        self._os_chown(self._file_name, self._chown_to, self._chgrp_to)\n      except OSError:\n        pass\n    self._needs_sync = 00000\n    if (keep_all_files):\n      self._shutil_copyfile(\n        self._file_name,\n        self._file_name + \"_\" + str(int(self._time_time())))\n\n  def _check_writable(self):\n    if (self._flag == \"r\"):\n      raise IOError(\"Read-only database: %s\" % self._file_name)\n\n  def __getitem__(self, key):\n    return self._dict[key]\n\n  def __setitem__(self, key, value):\n    self._check_writable()\n    if (not is_string(key)):\n      raise TypeError(\"key `%s' must be a string but is %s\" % (key, type(key)))\n    if (not is_string(value)):\n      raise TypeError(\"value `%s' must be a string but is %s\" % (value, type(value)))\n    self._dict[key] = value\n    self._needs_sync = 0001\n\n  def keys(self):\n    return list(self._dict.keys())\n\n  def has_key(self, key):\n    return key in self._dict\n\n  def __contains__(self, key):\n    return key in self._dict\n\n  def iterkeys(self):\n    # Wrapping name in () prevents fixer from \"fixing\" this\n    return (self._dict.iterkeys)()\n\n  __iter__ = iterkeys\n\n  def __len__(self):\n    return len(self._dict)\n\ndef open(file, flag=None, mode=0666):\n  return dblite(file, flag, mode)\n\ndef _exercise():\n  db = open(\"tmp\", \"n\")\n  assert len(db) == 0\n  db[\"foo\"] = \"bar\"\n  assert db[\"foo\"] == \"bar\"\n  db[unicode(\"ufoo\")] = unicode(\"ubar\")\n  assert db[unicode(\"ufoo\")] == unicode(\"ubar\")\n  db.sync()\n  db = open(\"tmp\", \"c\")\n  assert len(db) == 2, len(db)\n  assert db[\"foo\"] == \"bar\"\n  db[\"bar\"] = \"foo\"\n  assert db[\"bar\"] == \"foo\"\n  db[unicode(\"ubar\")] = unicode(\"ufoo\")\n  assert db[unicode(\"ubar\")] == unicode(\"ufoo\")\n  db.sync()\n  db = open(\"tmp\", \"r\")\n  assert len(db) == 4, len(db)\n  assert db[\"foo\"] == \"bar\"\n  assert db[\"bar\"] == \"foo\"\n  assert db[unicode(\"ufoo\")] == unicode(\"ubar\")\n  assert db[unicode(\"ubar\")] == unicode(\"ufoo\")\n  try:\n    db.sync()\n  except IOError, e:\n    assert str(e) == \"Read-only database: tmp.dblite\"\n  else:\n    raise RuntimeError(\"IOError expected.\")\n  db = open(\"tmp\", \"w\")\n  assert len(db) == 4\n  db[\"ping\"] = \"pong\"\n  db.sync()\n  try:\n    db[(1,2)] = \"tuple\"\n  except TypeError, e:\n    assert str(e) == \"key `(1, 2)' must be a string but is <type 'tuple'>\", str(e)\n  else:\n    raise RuntimeError(\"TypeError exception expected\")\n  try:\n    db[\"list\"] = [1,2]\n  except TypeError, e:\n    assert str(e) == \"value `[1, 2]' must be a string but is <type 'list'>\", str(e)\n  else:\n    raise RuntimeError(\"TypeError exception expected\")\n  db = open(\"tmp\", \"r\")\n  assert len(db) == 5\n  db = open(\"tmp\", \"n\")\n  assert len(db) == 0\n  dblite._open(\"tmp.dblite\", \"w\")\n  db = open(\"tmp\", \"r\")\n  dblite._open(\"tmp.dblite\", \"w\").write(\"x\")\n  try:\n    db = open(\"tmp\", \"r\")\n  except pickle.UnpicklingError:\n    pass\n  else:\n    raise RuntimeError(\"pickle exception expected.\")\n  global ignore_corrupt_dbfiles\n  ignore_corrupt_dbfiles = 2\n  db = open(\"tmp\", \"r\")\n  assert len(db) == 0\n  os.unlink(\"tmp.dblite\")\n  try:\n    db = open(\"tmp\", \"w\")\n  except IOError, e:\n    assert str(e) == \"[Errno 2] No such file or directory: 'tmp.dblite'\", str(e)\n  else:\n    raise RuntimeError(\"IOError expected.\")\n  print \"OK\"\n\nif (__name__ == \"__main__\"):\n  _exercise()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-2.3.2/SCons/exitfuncs.py",
    "content": "\"\"\"SCons.exitfuncs\n\nRegister functions which are executed when SCons exits for any reason.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2014 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/exitfuncs.py  2014/07/05 09:42:21 garyo\"\n\n\nimport atexit\n\n_exithandlers = []\ndef _run_exitfuncs():\n    \"\"\"run any registered exit functions\n\n    _exithandlers is traversed in reverse order so functions are executed\n    last in, first out.\n    \"\"\"\n\n    while _exithandlers:\n        func, targs, kargs =  _exithandlers.pop()\n        func(*targs, **kargs)\n\ndef register(func, *targs, **kargs):\n    \"\"\"register a function to be executed upon normal program termination\n\n    func - function to be called at exit\n    targs - optional arguments to pass to func\n    kargs - optional keyword arguments to pass to func\n    \"\"\"\n    _exithandlers.append((func, targs, kargs))\n\n\n# make our exit function get run by python when it exits\natexit.register(_run_exitfuncs)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Action.py",
    "content": "\"\"\"SCons.Action\n\nThis encapsulates information about executing any sort of action that\ncan build one or more target Nodes (typically files) from one or more\nsource Nodes (also typically files) given a specific Environment.\n\nThe base class here is ActionBase.  The base class supplies just a few\nOO utility methods and some generic methods for displaying information\nabout an Action in response to the various commands that control printing.\n\nA second-level base class is _ActionAction.  This extends ActionBase\nby providing the methods that can be used to show and perform an\naction.  True Action objects will subclass _ActionAction; Action\nfactory class objects will subclass ActionBase.\n\nThe heavy lifting is handled by subclasses for the different types of\nactions we might execute:\n\n    CommandAction\n    CommandGeneratorAction\n    FunctionAction\n    ListAction\n\nThe subclasses supply the following public interface methods used by\nother modules:\n\n    __call__()\n        THE public interface, \"calling\" an Action object executes the\n        command or Python function.  This also takes care of printing\n        a pre-substitution command for debugging purposes.\n\n    get_contents()\n        Fetches the \"contents\" of an Action for signature calculation\n        plus the varlist.  This is what gets MD5 checksummed to decide\n        if a target needs to be rebuilt because its action changed.\n\n    genstring()\n        Returns a string representation of the Action *without*\n        command substitution, but allows a CommandGeneratorAction to\n        generate the right action based on the specified target,\n        source and env.  This is used by the Signature subsystem\n        (through the Executor) to obtain an (imprecise) representation\n        of the Action operation for informative purposes.\n\n\nSubclasses also supply the following methods for internal use within\nthis module:\n\n    __str__()\n        Returns a string approximation of the Action; no variable\n        substitution is performed.\n\n    execute()\n        The internal method that really, truly, actually handles the\n        execution of a command or Python function.  This is used so\n        that the __call__() methods can take care of displaying any\n        pre-substitution representations, and *then* execute an action\n        without worrying about the specific Actions involved.\n\n    get_presig()\n        Fetches the \"contents\" of a subclass for signature calculation.\n        The varlist is added to this to produce the Action's contents.\n        TODO(?): Change this to always return ascii/bytes and not unicode (or py3 strings)\n\n    strfunction()\n        Returns a substituted string representation of the Action.\n        This is used by the _ActionAction.show() command to display the\n        command/function that will be executed to generate the target(s).\n\nThere is a related independent ActionCaller class that looks like a\nregular Action, and which serves as a wrapper for arbitrary functions\nthat we want to let the user specify the arguments to now, but actually\nexecute later (when an out-of-date check determines that it's needed to\nbe executed, for example).  Objects of this class are returned by an\nActionFactory class that provides a __call__() method as a convenient\nway for wrapping up the functions.\n\n\"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Action.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport pickle\nimport re\nimport sys\nimport subprocess\nimport itertools\nimport inspect\nfrom collections import OrderedDict\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Util\nimport SCons.Subst\n\n# we use these a lot, so try to optimize them\nfrom SCons.Util import is_String, is_List\n\nclass _null(object):\n    pass\n\nprint_actions = 1\nexecute_actions = 1\nprint_actions_presub = 0\n\n# Use pickle protocol 1 when pickling functions for signature\n# otherwise python3 and python2 will yield different pickles\n# for the same object.\n# This is due to default being 1 for python 2.7, and 3 for 3.x\n# TODO: We can roll this forward to 2 (if it has value), but not\n# before a deprecation cycle as the sconsigns will change\nACTION_SIGNATURE_PICKLE_PROTOCOL = 1\n\n\ndef rfile(n):\n    try:\n        return n.rfile()\n    except AttributeError:\n        return n\n\n\ndef default_exitstatfunc(s):\n    return s\n\nstrip_quotes = re.compile('^[\\'\"](.*)[\\'\"]$')\n\n\ndef _callable_contents(obj):\n    \"\"\"Return the signature contents of a callable Python object.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.__func__)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.__func__)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                # Test if obj is a function object.\n                return _function_contents(obj)\n\n\ndef _object_contents(obj):\n    \"\"\"Return the signature contents of any Python object.\n\n    We have to handle the case where object contains a code object\n    since it can be pickled directly.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.__func__)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.__func__)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                try:\n                    # Test if obj is a function object.\n                    return _function_contents(obj)\n\n                except AttributeError as ae:\n                    # Should be a pickle-able Python object.\n                    try:\n                        return _object_instance_content(obj)\n                        # pickling an Action instance or object doesn't yield a stable\n                        # content as instance property may be dumped in different orders\n                        # return pickle.dumps(obj, ACTION_SIGNATURE_PICKLE_PROTOCOL)\n                    except (pickle.PicklingError, TypeError, AttributeError) as ex:\n                        # This is weird, but it seems that nested classes\n                        # are unpickable. The Python docs say it should\n                        # always be a PicklingError, but some Python\n                        # versions seem to return TypeError.  Just do\n                        # the best we can.\n                        return bytearray(repr(obj), 'utf-8')\n\n\ndef _code_contents(code, docstring=None):\n    r\"\"\"Return the signature contents of a code object.\n\n    By providing direct access to the code object of the\n    function, Python makes this extremely easy.  Hooray!\n\n    Unfortunately, older versions of Python include line\n    number indications in the compiled byte code.  Boo!\n    So we remove the line number byte codes to prevent\n    recompilations from moving a Python function.\n\n    See:\n      - https://docs.python.org/2/library/inspect.html\n      - http://python-reference.readthedocs.io/en/latest/docs/code/index.html\n\n    For info on what each co\\_ variable provides\n\n    The signature is as follows (should be byte/chars):\n    co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars),\n    ( comma separated signature for each object in co_consts ),\n    ( comma separated signature for each object in co_names ),\n    ( The bytecode with line number bytecodes removed from  co_code )\n\n    co_argcount - Returns the number of positional arguments (including arguments with default values).\n    co_varnames - Returns a tuple containing the names of the local variables (starting with the argument names).\n    co_cellvars - Returns a tuple containing the names of local variables that are referenced by nested functions.\n    co_freevars - Returns a tuple containing the names of free variables. (?)\n    co_consts   - Returns a tuple containing the literals used by the bytecode.\n    co_names    - Returns a tuple containing the names used by the bytecode.\n    co_code     - Returns a string representing the sequence of bytecode instructions.\n\n    \"\"\"\n\n    # contents = []\n\n    # The code contents depends on the number of local variables\n    # but not their actual names.\n    contents = bytearray(\"{}, {}\".format(code.co_argcount, len(code.co_varnames)), 'utf-8')\n\n    contents.extend(b\", \")\n    contents.extend(bytearray(str(len(code.co_cellvars)), 'utf-8'))\n    contents.extend(b\", \")\n    contents.extend(bytearray(str(len(code.co_freevars)), 'utf-8'))\n\n    # The code contents depends on any constants accessed by the\n    # function. Note that we have to call _object_contents on each\n    # constants because the code object of nested functions can\n    # show-up among the constants.\n    z = [_object_contents(cc) for cc in code.co_consts if cc != docstring]\n    contents.extend(b',(')\n    contents.extend(bytearray(',', 'utf-8').join(z))\n    contents.extend(b')')\n\n    # The code contents depends on the variable names used to\n    # accessed global variable, as changing the variable name changes\n    # the variable actually accessed and therefore changes the\n    # function result.\n    z= [bytearray(_object_contents(cc)) for cc in code.co_names]\n    contents.extend(b',(')\n    contents.extend(bytearray(',','utf-8').join(z))\n    contents.extend(b')')\n\n    # The code contents depends on its actual code!!!\n    contents.extend(b',(')\n    contents.extend(code.co_code)\n    contents.extend(b')')\n\n    return contents\n\n\ndef _function_contents(func):\n    \"\"\"\n    The signature is as follows (should be byte/chars):\n    < _code_contents (see above) from func.__code__ >\n    ,( comma separated _object_contents for function argument defaults)\n    ,( comma separated _object_contents for any closure contents )\n\n\n    See also: https://docs.python.org/3/reference/datamodel.html\n      - func.__code__     - The code object representing the compiled function body.\n      - func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value\n      - func.__closure__  - None or a tuple of cells that contain bindings for the function's free variables.\n\n    :Returns:\n      Signature contents of a function. (in bytes)\n    \"\"\"\n\n    contents = [_code_contents(func.__code__, func.__doc__)]\n\n    # The function contents depends on the value of defaults arguments\n    if func.__defaults__:\n\n        function_defaults_contents = [_object_contents(cc) for cc in func.__defaults__]\n\n        defaults = bytearray(b',(')\n        defaults.extend(bytearray(b',').join(function_defaults_contents))\n        defaults.extend(b')')\n\n        contents.append(defaults)\n    else:\n        contents.append(b',()')\n\n    # The function contents depends on the closure captured cell values.\n    closure = func.__closure__ or []\n\n    try:\n        closure_contents = [_object_contents(x.cell_contents) for x in closure]\n    except AttributeError:\n        closure_contents = []\n\n    contents.append(b',(')\n    contents.append(bytearray(b',').join(closure_contents))\n    contents.append(b')')\n\n    retval = bytearray(b'').join(contents)\n    return retval\n\n\ndef _object_instance_content(obj):\n    \"\"\"\n    Returns consistant content for a action class or an instance thereof\n\n    :Parameters:\n      - `obj` Should be either and action class or an instance thereof\n\n    :Returns:\n      bytearray or bytes representing the obj suitable for generating a signature from.\n    \"\"\"\n    retval = bytearray()\n\n    if obj is None:\n        return b'N.'\n\n    if isinstance(obj, SCons.Util.BaseStringTypes):\n        return SCons.Util.to_bytes(obj)\n\n    inst_class = obj.__class__\n    inst_class_name = bytearray(obj.__class__.__name__,'utf-8')\n    inst_class_module = bytearray(obj.__class__.__module__,'utf-8')\n    inst_class_hierarchy = bytearray(repr(inspect.getclasstree([obj.__class__,])),'utf-8')\n    # print(\"ICH:%s : %s\"%(inst_class_hierarchy, repr(obj)))\n\n    properties = [(p, getattr(obj, p, \"None\")) for p in dir(obj) if not (p[:2] == '__' or inspect.ismethod(getattr(obj, p)) or inspect.isbuiltin(getattr(obj,p))) ]\n    properties.sort()\n    properties_str = ','.join([\"%s=%s\"%(p[0],p[1]) for p in properties])\n    properties_bytes = bytearray(properties_str,'utf-8')\n\n    methods = [p for p in dir(obj) if inspect.ismethod(getattr(obj, p))]\n    methods.sort()\n\n    method_contents = []\n    for m in methods:\n        # print(\"Method:%s\"%m)\n        v = _function_contents(getattr(obj, m))\n        # print(\"[%s->]V:%s [%s]\"%(m,v,type(v)))\n        method_contents.append(v)\n\n    retval = bytearray(b'{')\n    retval.extend(inst_class_name)\n    retval.extend(b\":\")\n    retval.extend(inst_class_module)\n    retval.extend(b'}[[')\n    retval.extend(inst_class_hierarchy)\n    retval.extend(b']]{{')\n    retval.extend(bytearray(b\",\").join(method_contents))\n    retval.extend(b\"}}{{{\")\n    retval.extend(properties_bytes)\n    retval.extend(b'}}}')\n    return retval\n\n    # print(\"class          :%s\"%inst_class)\n    # print(\"class_name     :%s\"%inst_class_name)\n    # print(\"class_module   :%s\"%inst_class_module)\n    # print(\"Class hier     :\\n%s\"%pp.pformat(inst_class_hierarchy))\n    # print(\"Inst Properties:\\n%s\"%pp.pformat(properties))\n    # print(\"Inst Methods   :\\n%s\"%pp.pformat(methods))\n\ndef _actionAppend(act1, act2):\n    # This function knows how to slap two actions together.\n    # Mainly, it handles ListActions by concatenating into\n    # a single ListAction.\n    a1 = Action(act1)\n    a2 = Action(act2)\n    if a1 is None:\n        return a2\n    if a2 is None:\n        return a1\n    if isinstance(a1, ListAction):\n        if isinstance(a2, ListAction):\n            return ListAction(a1.list + a2.list)\n        else:\n            return ListAction(a1.list + [ a2 ])\n    else:\n        if isinstance(a2, ListAction):\n            return ListAction([ a1 ] + a2.list)\n        else:\n            return ListAction([ a1, a2 ])\n\n\ndef _do_create_keywords(args, kw):\n    \"\"\"This converts any arguments after the action argument into\n    their equivalent keywords and adds them to the kw argument.\n    \"\"\"\n    v = kw.get('varlist', ())\n    # prevent varlist=\"FOO\" from being interpreted as ['F', 'O', 'O']\n    if is_String(v): v = (v,)\n    kw['varlist'] = tuple(v)\n    if args:\n        # turn positional args into equivalent keywords\n        cmdstrfunc = args[0]\n        if cmdstrfunc is None or is_String(cmdstrfunc):\n            kw['cmdstr'] = cmdstrfunc\n        elif callable(cmdstrfunc):\n            kw['strfunction'] = cmdstrfunc\n        else:\n            raise SCons.Errors.UserError(\n                'Invalid command display variable type. '\n                'You must either pass a string or a callback which '\n                'accepts (target, source, env) as parameters.')\n        if len(args) > 1:\n            kw['varlist'] = tuple(SCons.Util.flatten(args[1:])) + kw['varlist']\n    if kw.get('strfunction', _null) is not _null \\\n                      and kw.get('cmdstr', _null) is not _null:\n        raise SCons.Errors.UserError(\n            'Cannot have both strfunction and cmdstr args to Action()')\n\n\ndef _do_create_action(act, kw):\n    \"\"\"This is the actual \"implementation\" for the\n    Action factory method, below.  This handles the\n    fact that passing lists to Action() itself has\n    different semantics than passing lists as elements\n    of lists.\n\n    The former will create a ListAction, the latter\n    will create a CommandAction by converting the inner\n    list elements to strings.\"\"\"\n\n    if isinstance(act, ActionBase):\n        return act\n\n    if is_String(act):\n        var=SCons.Util.get_environment_var(act)\n        if var:\n            # This looks like a string that is purely an Environment\n            # variable reference, like \"$FOO\" or \"${FOO}\".  We do\n            # something special here...we lazily evaluate the contents\n            # of that Environment variable, so a user could put something\n            # like a function or a CommandGenerator in that variable\n            # instead of a string.\n            return LazyAction(var, kw)\n        commands = str(act).split('\\n')\n        if len(commands) == 1:\n            return CommandAction(commands[0], **kw)\n        # The list of string commands may include a LazyAction, so we\n        # reprocess them via _do_create_list_action.\n        return _do_create_list_action(commands, kw)\n\n    if is_List(act):\n        return CommandAction(act, **kw)\n\n    if callable(act):\n        try:\n            gen = kw['generator']\n            del kw['generator']\n        except KeyError:\n            gen = 0\n        if gen:\n            action_type = CommandGeneratorAction\n        else:\n            action_type = FunctionAction\n        return action_type(act, kw)\n\n    # Catch a common error case with a nice message:\n    if isinstance(act, int) or isinstance(act, float):\n        raise TypeError(\"Don't know how to create an Action from a number (%s)\"%act)\n    # Else fail silently (???)\n    return None\n\n\ndef _do_create_list_action(act, kw):\n    \"\"\"A factory for list actions.  Convert the input list into Actions\n    and then wrap them in a ListAction.\"\"\"\n    acts = []\n    for a in act:\n        aa = _do_create_action(a, kw)\n        if aa is not None: acts.append(aa)\n    if not acts:\n        return ListAction([])\n    elif len(acts) == 1:\n        return acts[0]\n    else:\n        return ListAction(acts)\n\n\ndef Action(act, *args, **kw):\n    \"\"\"A factory for action objects.\"\"\"\n    # Really simple: the _do_create_* routines do the heavy lifting.\n    _do_create_keywords(args, kw)\n    if is_List(act):\n        return _do_create_list_action(act, kw)\n    return _do_create_action(act, kw)\n\n\nclass ActionBase(object):\n    \"\"\"Base class for all types of action objects that can be held by\n    other objects (Builders, Executors, etc.)  This provides the\n    common methods for manipulating and combining those actions.\"\"\"\n\n    def __eq__(self, other):\n        return self.__dict__ == other\n\n    def no_batch_key(self, env, target, source):\n        return None\n\n    batch_key = no_batch_key\n\n    def genstring(self, target, source, env):\n        return str(self)\n\n    def get_contents(self, target, source, env):\n        result = self.get_presig(target, source, env)\n\n        if not isinstance(result,(bytes, bytearray)):\n            result = bytearray(result, 'utf-8')\n        else:\n            # Make a copy and put in bytearray, without this the contents returned by get_presig\n            # can be changed by the logic below, appending with each call and causing very\n            # hard to track down issues...\n            result = bytearray(result)\n\n        # At this point everything should be a bytearray\n\n        # This should never happen, as the Action() factory should wrap\n        # the varlist, but just in case an action is created directly,\n        # we duplicate this check here.\n        vl = self.get_varlist(target, source, env)\n        if is_String(vl): vl = (vl,)\n        for v in vl:\n            # do the subst this way to ignore $(...$) parts:\n            if isinstance(result, bytearray):\n                result.extend(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))\n            else:\n                raise Exception(\"WE SHOULD NEVER GET HERE result should be bytearray not:%s\"%type(result))\n                # result.append(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))\n\n\n        if isinstance(result, (bytes,bytearray)):\n            return result\n        else:\n            raise Exception(\"WE SHOULD NEVER GET HERE - #2 result should be bytearray not:%s\" % type(result))\n            # return b''.join(result)\n\n    def __add__(self, other):\n        return _actionAppend(self, other)\n\n    def __radd__(self, other):\n        return _actionAppend(other, self)\n\n    def presub_lines(self, env):\n        # CommandGeneratorAction needs a real environment\n        # in order to return the proper string here, since\n        # it may call LazyAction, which looks up a key\n        # in that env.  So we temporarily remember the env here,\n        # and CommandGeneratorAction will use this env\n        # when it calls its _generate method.\n        self.presub_env = env\n        lines = str(self).split('\\n')\n        self.presub_env = None      # don't need this any more\n        return lines\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self.varlist\n\n    def get_targets(self, env, executor):\n        \"\"\"\n        Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used\n        by this action.\n        \"\"\"\n        return self.targets\n\n\nclass _ActionAction(ActionBase):\n    \"\"\"Base class for actions that create output objects.\"\"\"\n    def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),\n                       presub=_null, chdir=None, exitstatfunc=None,\n                       batch_key=None, targets='$TARGETS',\n                 **kw):\n        self.cmdstr = cmdstr\n        if strfunction is not _null:\n            if strfunction is None:\n                self.cmdstr = None\n            else:\n                self.strfunction = strfunction\n        self.varlist = varlist\n        self.presub = presub\n        self.chdir = chdir\n        if not exitstatfunc:\n            exitstatfunc = default_exitstatfunc\n        self.exitstatfunc = exitstatfunc\n\n        self.targets = targets\n\n        if batch_key:\n            if not callable(batch_key):\n                # They have set batch_key, but not to their own\n                # callable.  The default behavior here will batch\n                # *all* targets+sources using this action, separated\n                # for each construction environment.\n                def default_batch_key(self, env, target, source):\n                    return (id(self), id(env))\n                batch_key = default_batch_key\n            SCons.Util.AddMethod(self, batch_key, 'batch_key')\n\n    def print_cmd_line(self, s, target, source, env):\n        \"\"\"\n        In python 3, and in some of our tests, sys.stdout is\n        a String io object, and it takes unicode strings only\n        In other cases it's a regular Python 2.x file object\n        which takes strings (bytes), and if you pass those a\n        unicode object they try to decode with 'ascii' codec\n        which fails if the cmd line has any hi-bit-set chars.\n        This code assumes s is a regular string, but should\n        work if it's unicode too.\n        \"\"\"\n        try:\n            sys.stdout.write(s + u\"\\n\")\n        except UnicodeDecodeError:\n            sys.stdout.write(s + \"\\n\")\n\n    def __call__(self, target, source, env,\n                               exitstatfunc=_null,\n                               presub=_null,\n                               show=_null,\n                               execute=_null,\n                               chdir=_null,\n                               executor=None):\n        if not is_List(target):\n            target = [target]\n        if not is_List(source):\n            source = [source]\n\n        if presub is _null:\n            presub = self.presub\n            if presub is _null:\n                presub = print_actions_presub\n        if exitstatfunc is _null: exitstatfunc = self.exitstatfunc\n        if show is _null:  show = print_actions\n        if execute is _null:  execute = execute_actions\n        if chdir is _null: chdir = self.chdir\n        save_cwd = None\n        if chdir:\n            save_cwd = os.getcwd()\n            try:\n                chdir = str(chdir.get_abspath())\n            except AttributeError:\n                if not is_String(chdir):\n                    if executor:\n                        chdir = str(executor.batches[0].targets[0].dir)\n                    else:\n                        chdir = str(target[0].dir)\n        if presub:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            t = ' and '.join(map(str, target))\n            l = '\\n  '.join(self.presub_lines(env))\n            out = u\"Building %s with action:\\n  %s\\n\" % (t, l)\n            sys.stdout.write(out)\n        cmd = None\n        if show and self.strfunction:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            try:\n                cmd = self.strfunction(target, source, env, executor)\n            except TypeError:\n                cmd = self.strfunction(target, source, env)\n            if cmd:\n                if chdir:\n                    cmd = ('os.chdir(%s)\\n' % repr(chdir)) + cmd\n                try:\n                    get = env.get\n                except AttributeError:\n                    print_func = self.print_cmd_line\n                else:\n                    print_func = get('PRINT_CMD_LINE_FUNC')\n                    if not print_func:\n                        print_func = self.print_cmd_line\n                print_func(cmd, target, source, env)\n        stat = 0\n        if execute:\n            if chdir:\n                os.chdir(chdir)\n            try:\n                stat = self.execute(target, source, env, executor=executor)\n                if isinstance(stat, SCons.Errors.BuildError):\n                    s = exitstatfunc(stat.status)\n                    if s:\n                        stat.status = s\n                    else:\n                        stat = s\n                else:\n                    stat = exitstatfunc(stat)\n            finally:\n                if save_cwd:\n                    os.chdir(save_cwd)\n        if cmd and save_cwd:\n            print_func('os.chdir(%s)' % repr(save_cwd), target, source, env)\n\n        return stat\n\n\ndef _string_from_cmd_list(cmd_list):\n    \"\"\"Takes a list of command line arguments and returns a pretty\n    representation for printing.\"\"\"\n    cl = []\n    for arg in map(str, cmd_list):\n        if ' ' in arg or '\\t' in arg:\n            arg = '\"' + arg + '\"'\n        cl.append(arg)\n    return ' '.join(cl)\n\ndefault_ENV = None\n\n\ndef get_default_ENV(env):\n    \"\"\"\n    A fiddlin' little function that has an 'import SCons.Environment' which\n    can't be moved to the top level without creating an import loop.  Since\n    this import creates a local variable named 'SCons', it blocks access to\n    the global variable, so we move it here to prevent complaints about local\n    variables being used uninitialized.\n    \"\"\"\n    global default_ENV\n    try:\n        return env['ENV']\n    except KeyError:\n        if not default_ENV:\n            import SCons.Environment\n            # This is a hideously expensive way to get a default shell\n            # environment.  What it really should do is run the platform\n            # setup to get the default ENV.  Fortunately, it's incredibly\n            # rare for an Environment not to have a shell environment, so\n            # we're not going to worry about it overmuch.\n            default_ENV = SCons.Environment.Environment()['ENV']\n        return default_ENV\n\n\ndef _subproc(scons_env, cmd, error = 'ignore', **kw):\n    \"\"\"Do common setup for a subprocess.Popen() call\n\n    This function is still in draft mode.  We're going to need something like\n    it in the long run as more and more places use subprocess, but I'm sure\n    it'll have to be tweaked to get the full desired functionality.\n    one special arg (so far?), 'error', to tell what to do with exceptions.\n    \"\"\"\n    # allow std{in,out,err} to be \"'devnull'\".  This is like\n    # subprocess.DEVNULL, which does not exist for Py2. Use the\n    # subprocess one if possible.\n    # Clean this up when Py2 support is dropped\n    try:\n        from subprocess import DEVNULL\n    except ImportError:\n        DEVNULL = None\n\n    for stream in 'stdin', 'stdout', 'stderr':\n        io = kw.get(stream)\n        if is_String(io) and io == 'devnull':\n            if DEVNULL:\n                kw[stream] = DEVNULL\n            else:\n                kw[stream] = open(os.devnull, \"r+\")\n\n    # Figure out what shell environment to use\n    ENV = kw.get('env', None)\n    if ENV is None: ENV = get_default_ENV(scons_env)\n\n    # Ensure that the ENV values are all strings:\n    new_env = {}\n    for key, value in ENV.items():\n        if is_List(value):\n            # If the value is a list, then we assume it is a path list,\n            # because that's a pretty common list-like value to stick\n            # in an environment variable:\n            value = SCons.Util.flatten_sequence(value)\n            new_env[key] = os.pathsep.join(map(str, value))\n        else:\n            # It's either a string or something else.  If it's a string,\n            # we still want to call str() because it might be a *Unicode*\n            # string, which makes subprocess.Popen() gag.  If it isn't a\n            # string or a list, then we just coerce it to a string, which\n            # is the proper way to handle Dir and File instances and will\n            # produce something reasonable for just about everything else:\n            new_env[key] = str(value)\n    kw['env'] = new_env\n\n    try:\n        pobj = subprocess.Popen(cmd, **kw)\n    except EnvironmentError as e:\n        if error == 'raise': raise\n        # return a dummy Popen instance that only returns error\n        class dummyPopen(object):\n            def __init__(self, e): self.exception = e\n            def communicate(self, input=None): return ('', '')\n            def wait(self): return -self.exception.errno\n            stdin = None\n            class f(object):\n                def read(self): return ''\n                def readline(self): return ''\n                def __iter__(self): return iter(())\n            stdout = stderr = f()\n        pobj = dummyPopen(e)\n    finally:\n        # clean up open file handles stored in parent's kw\n        for k, v in kw.items():\n            if inspect.ismethod(getattr(v, 'close', None)):\n                v.close()\n\n    return pobj\n\n\nclass CommandAction(_ActionAction):\n    \"\"\"Class for command-execution actions.\"\"\"\n    def __init__(self, cmd, **kw):\n        # Cmd can actually be a list or a single item; if it's a\n        # single item it should be the command string to execute; if a\n        # list then it should be the words of the command string to\n        # execute.  Only a single command should be executed by this\n        # object; lists of commands should be handled by embedding\n        # these objects in a ListAction object (which the Action()\n        # factory above does).  cmd will be passed to\n        # Environment.subst_list() for substituting environment\n        # variables.\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')\n\n        _ActionAction.__init__(self, **kw)\n        if is_List(cmd):\n            if [c for c in cmd if is_List(c)]:\n                raise TypeError(\"CommandAction should be given only \"\n                                \"a single command\")\n        self.cmd_list = cmd\n\n    def __str__(self):\n        if is_List(self.cmd_list):\n            return ' '.join(map(str, self.cmd_list))\n        return str(self.cmd_list)\n\n    def process(self, target, source, env, executor=None):\n        if executor:\n            result = env.subst_list(self.cmd_list, 0, executor=executor)\n        else:\n            result = env.subst_list(self.cmd_list, 0, target, source)\n        silent = None\n        ignore = None\n        while True:\n            try: c = result[0][0][0]\n            except IndexError: c = None\n            if c == '@': silent = 1\n            elif c == '-': ignore = 1\n            else: break\n            result[0][0] = result[0][0][1:]\n        try:\n            if not result[0][0]:\n                result[0] = result[0][1:]\n        except IndexError:\n            pass\n        return result, ignore, silent\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n        cmd_list, ignore, silent = self.process(target, source, env, executor)\n        if silent:\n            return ''\n        return _string_from_cmd_list(cmd_list[0])\n\n    def execute(self, target, source, env, executor=None):\n        \"\"\"Execute a command action.\n\n        This will handle lists of commands as well as individual commands,\n        because construction variable substitution may turn a single\n        \"command\" into a list.  This means that this class can actually\n        handle lists of commands, even though that's not how we use it\n        externally.\n        \"\"\"\n        escape_list = SCons.Subst.escape_list\n        flatten_sequence = SCons.Util.flatten_sequence\n\n        try:\n            shell = env['SHELL']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SHELL construction variable.')\n\n        try:\n            spawn = env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n        else:\n            if is_String(spawn):\n                spawn = env.subst(spawn, raw=1, conv=lambda x: x)\n\n        escape = env.get('ESCAPE', lambda x: x)\n\n        ENV = get_default_ENV(env)\n\n        # Ensure that the ENV values are all strings:\n        for key, value in ENV.items():\n            if not is_String(value):\n                if is_List(value):\n                    # If the value is a list, then we assume it is a\n                    # path list, because that's a pretty common list-like\n                    # value to stick in an environment variable:\n                    value = flatten_sequence(value)\n                    ENV[key] = os.pathsep.join(map(str, value))\n                else:\n                    # If it isn't a string or a list, then we just coerce\n                    # it to a string, which is the proper way to handle\n                    # Dir and File instances and will produce something\n                    # reasonable for just about everything else:\n                    ENV[key] = str(value)\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        cmd_list, ignore, silent = self.process(target, list(map(rfile, source)), env, executor)\n\n        # Use len() to filter out any \"command\" that's zero-length.\n        for cmd_line in filter(len, cmd_list):\n            # Escape the command line for the interpreter we are using.\n            cmd_line = escape_list(cmd_line, escape)\n            result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)\n            if not ignore and result:\n                msg = \"Error %s\" % result\n                return SCons.Errors.BuildError(errstr=msg,\n                                               status=result,\n                                               action=self,\n                                               command=cmd_line)\n        return 0\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        from SCons.Subst import SUBST_SIG\n        cmd = self.cmd_list\n        if is_List(cmd):\n            cmd = ' '.join(map(str, cmd))\n        else:\n            cmd = str(cmd)\n        if executor:\n            return env.subst_target_source(cmd, SUBST_SIG, executor=executor)\n        else:\n            return env.subst_target_source(cmd, SUBST_SIG, target, source)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        icd = env.get('IMPLICIT_COMMAND_DEPENDENCIES', True)\n        if is_String(icd) and icd[:1] == '$':\n            icd = env.subst(icd)\n        if not icd or icd in ('0', 'None'):\n            return []\n        from SCons.Subst import SUBST_SIG\n        if executor:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, executor=executor)\n        else:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, target, source)\n        res = []\n        for cmd_line in cmd_list:\n            if cmd_line:\n                d = str(cmd_line[0])\n                m = strip_quotes.match(d)\n                if m:\n                    d = m.group(1)\n                d = env.WhereIs(d)\n                if d:\n                    res.append(env.fs.File(d))\n        return res\n\n\nclass CommandGeneratorAction(ActionBase):\n    \"\"\"Class for command-generator actions.\"\"\"\n    def __init__(self, generator, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')\n        self.generator = generator\n        self.gen_kw = kw\n        self.varlist = kw.get('varlist', ())\n        self.targets = kw.get('targets', '$TARGETS')\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        # ensure that target is a list, to make it easier to write\n        # generator functions:\n        if not is_List(target):\n            target = [target]\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        ret = self.generator(target=target,\n                             source=source,\n                             env=env,\n                             for_signature=for_signature)\n        gen_cmd = Action(ret, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"Object returned from command generator: %s cannot be used to create an Action.\" % repr(ret))\n        return gen_cmd\n\n    def __str__(self):\n        try:\n            env = self.presub_env\n        except AttributeError:\n            env = None\n        if env is None:\n            env = SCons.Defaults.DefaultEnvironment()\n        act = self._generate([], [], env, 1)\n        return str(act)\n\n    def batch_key(self, env, target, source):\n        return self._generate(target, source, env, 1).batch_key(env, target, source)\n\n    def genstring(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).genstring(target, source, env)\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        act = self._generate(target, source, env, 0, executor)\n        if act is None:\n            raise SCons.Errors.UserError(\"While building `%s': \"\n                            \"Cannot deduce file extension from source files: %s\"\n                % (repr(list(map(str, target))), repr(list(map(str, source)))))\n        return act(target, source, env, exitstatfunc, presub,\n                   show, execute, chdir, executor)\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        return self._generate(target, source, env, 1, executor).get_presig(target, source, env)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor)\n\n    def get_targets(self, env, executor):\n        return self._generate(None, None, env, 1, executor).get_targets(env, executor)\n\n\nclass LazyAction(CommandGeneratorAction, CommandAction):\n    \"\"\"\n    A LazyAction is a kind of hybrid generator and command action for\n    strings of the form \"$VAR\".  These strings normally expand to other\n    strings (think \"$CCCOM\" to \"$CC -c -o $TARGET $SOURCE\"), but we also\n    want to be able to replace them with functions in the construction\n    environment.  Consequently, we want lazy evaluation and creation of\n    an Action in the case of the function, but that's overkill in the more\n    normal case of expansion to other strings.\n\n    So we do this with a subclass that's both a generator *and*\n    a command action.  The overridden methods all do a quick check\n    of the construction variable, and if it's a string we just call\n    the corresponding CommandAction method to do the heavy lifting.\n    If not, then we call the same-named CommandGeneratorAction method.\n    The CommandGeneratorAction methods work by using the overridden\n    _generate() method, that is, our own way of handling \"generation\" of\n    an action based on what's in the construction variable.\n    \"\"\"\n\n    def __init__(self, var, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')\n        CommandAction.__init__(self, '${'+var+'}', **kw)\n        self.var = SCons.Util.to_String(var)\n        self.gen_kw = kw\n\n    def get_parent_class(self, env):\n        c = env.get(self.var)\n        if is_String(c) and '\\n' not in c:\n            return CommandAction\n        return CommandGeneratorAction\n\n    def _generate_cache(self, env):\n        if env:\n            c = env.get(self.var, '')\n        else:\n            c = ''\n        gen_cmd = Action(c, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"$%s value %s cannot be used to create an Action.\" % (self.var, repr(c)))\n        return gen_cmd\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        return self._generate_cache(env)\n\n    def __call__(self, target, source, env, *args, **kw):\n        c = self.get_parent_class(env)\n        return c.__call__(self, target, source, env, *args, **kw)\n\n    def get_presig(self, target, source, env):\n        c = self.get_parent_class(env)\n        return c.get_presig(self, target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        c = self.get_parent_class(env)\n        return c.get_varlist(self, target, source, env, executor)\n\n\nclass FunctionAction(_ActionAction):\n    \"\"\"Class for Python function actions.\"\"\"\n\n    def __init__(self, execfunction, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction')\n\n        self.execfunction = execfunction\n        try:\n            self.funccontents = _callable_contents(execfunction)\n        except AttributeError:\n            try:\n                # See if execfunction will do the heavy lifting for us.\n                self.gc = execfunction.get_contents\n            except AttributeError:\n                # This is weird, just do the best we can.\n                self.funccontents = _object_contents(execfunction)\n\n        _ActionAction.__init__(self, **kw)\n\n    def function_name(self):\n        try:\n            return self.execfunction.__name__\n        except AttributeError:\n            try:\n                return self.execfunction.__class__.__name__\n            except AttributeError:\n                return \"unknown_python_function\"\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n\n        def array(a):\n            def quote(s):\n                try:\n                    str_for_display = s.str_for_display\n                except AttributeError:\n                    s = repr(s)\n                else:\n                    s = str_for_display()\n                return s\n            return '[' + \", \".join(map(quote, a)) + ']'\n        try:\n            strfunc = self.execfunction.strfunction\n        except AttributeError:\n            pass\n        else:\n            if strfunc is None:\n                return None\n            if callable(strfunc):\n                return strfunc(target, source, env)\n        name = self.function_name()\n        tstr = array(target)\n        sstr = array(source)\n        return \"%s(%s, %s)\" % (name, tstr, sstr)\n\n    def __str__(self):\n        name = self.function_name()\n        if name == 'ActionCaller':\n            return str(self.execfunction)\n        return \"%s(target, source, env)\" % name\n\n    def execute(self, target, source, env, executor=None):\n        exc_info = (None,None,None)\n        try:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            rsources = list(map(rfile, source))\n            try:\n                result = self.execfunction(target=target, source=rsources, env=env)\n            except KeyboardInterrupt as e:\n                raise\n            except SystemExit as e:\n                raise\n            except Exception as e:\n                result = e\n                exc_info = sys.exc_info()\n\n            if result:\n                result = SCons.Errors.convert_to_BuildError(result, exc_info)\n                result.node=target\n                result.action=self\n                try:\n                    result.command=self.strfunction(target, source, env, executor)\n                except TypeError:\n                    result.command=self.strfunction(target, source, env)\n\n                # FIXME: This maintains backward compatibility with respect to\n                # which type of exceptions were returned by raising an\n                # exception and which ones were returned by value. It would\n                # probably be best to always return them by value here, but\n                # some codes do not check the return value of Actions and I do\n                # not have the time to modify them at this point.\n                if (exc_info[1] and\n                    not isinstance(exc_info[1],EnvironmentError)):\n                    raise result\n\n            return result\n        finally:\n            # Break the cycle between the traceback object and this\n            # function stack frame. See the sys.exc_info() doc info for\n            # more information about this issue.\n            del exc_info\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this callable action.\"\"\"\n        try:\n            return self.gc(target, source, env)\n        except AttributeError:\n            return self.funccontents\n\n    def get_implicit_deps(self, target, source, env):\n        return []\n\nclass ListAction(ActionBase):\n    \"\"\"Class for lists of other actions.\"\"\"\n    def __init__(self, actionlist):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction')\n        def list_of_actions(x):\n            if isinstance(x, ActionBase):\n                return x\n            return Action(x)\n        self.list = list(map(list_of_actions, actionlist))\n        # our children will have had any varlist\n        # applied; we don't need to do it again\n        self.varlist = ()\n        self.targets = '$TARGETS'\n\n    def genstring(self, target, source, env):\n        return '\\n'.join([a.genstring(target, source, env) for a in self.list])\n\n    def __str__(self):\n        return '\\n'.join(map(str, self.list))\n\n    def presub_lines(self, env):\n        return SCons.Util.flatten_sequence(\n            [a.presub_lines(env) for a in self.list])\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this action list.\n\n        Simple concatenation of the signatures of the elements.\n        \"\"\"\n        return b\"\".join([bytes(x.get_contents(target, source, env)) for x in self.list])\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        for act in self.list:\n            stat = act(target, source, env, exitstatfunc, presub,\n                       show, execute, chdir, executor)\n            if stat:\n                return stat\n        return 0\n\n    def get_implicit_deps(self, target, source, env):\n        result = []\n        for act in self.list:\n            result.extend(act.get_implicit_deps(target, source, env))\n        return result\n\n    def get_varlist(self, target, source, env, executor=None):\n        result = OrderedDict()\n        for act in self.list:\n            for var in act.get_varlist(target, source, env, executor):\n                result[var] = True\n        return list(result.keys())\n\n\nclass ActionCaller(object):\n    \"\"\"A class for delaying calling an Action function with specific\n    (positional and keyword) arguments until the Action is actually\n    executed.\n\n    This class looks to the rest of the world like a normal Action object,\n    but what it's really doing is hanging on to the arguments until we\n    have a target, source and env to use for the expansion.\n    \"\"\"\n    def __init__(self, parent, args, kw):\n        self.parent = parent\n        self.args = args\n        self.kw = kw\n\n    def get_contents(self, target, source, env):\n        actfunc = self.parent.actfunc\n        try:\n            # \"self.actfunc\" is a function.\n            contents = actfunc.__code__.co_code\n        except AttributeError:\n            # \"self.actfunc\" is a callable object.\n            try:\n                contents = actfunc.__call__.__func__.__code__.co_code\n            except AttributeError:\n                # No __call__() method, so it might be a builtin\n                # or something like that.  Do the best we can.\n                contents = repr(actfunc)\n\n        return contents\n\n    def subst(self, s, target, source, env):\n        # If s is a list, recursively apply subst()\n        # to every element in the list\n        if is_List(s):\n            result = []\n            for elem in s:\n                result.append(self.subst(elem, target, source, env))\n            return self.parent.convert(result)\n\n        # Special-case hack:  Let a custom function wrapped in an\n        # ActionCaller get at the environment through which the action\n        # was called by using this hard-coded value as a special return.\n        if s == '$__env__':\n            return env\n        elif is_String(s):\n            return env.subst(s, 1, target, source)\n        return self.parent.convert(s)\n\n    def subst_args(self, target, source, env):\n        return [self.subst(x, target, source, env) for x in self.args]\n\n    def subst_kw(self, target, source, env):\n        kw = {}\n        for key in list(self.kw.keys()):\n            kw[key] = self.subst(self.kw[key], target, source, env)\n        return kw\n\n    def __call__(self, target, source, env, executor=None):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.actfunc(*args, **kw)\n\n    def strfunction(self, target, source, env):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.strfunc(*args, **kw)\n\n    def __str__(self):\n        return self.parent.strfunc(*self.args, **self.kw)\n\n\nclass ActionFactory(object):\n    \"\"\"A factory class that will wrap up an arbitrary function\n    as an SCons-executable Action object.\n\n    The real heavy lifting here is done by the ActionCaller class.\n    We just collect the (positional and keyword) arguments that we're\n    called with and give them to the ActionCaller object we create,\n    so it can hang onto them until it needs them.\n    \"\"\"\n    def __init__(self, actfunc, strfunc, convert=lambda x: x):\n        self.actfunc = actfunc\n        self.strfunc = strfunc\n        self.convert = convert\n\n    def __call__(self, *args, **kw):\n        ac = ActionCaller(self, args, kw)\n        action = Action(ac, strfunction=ac.strfunction)\n        return action\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Builder.py",
    "content": "\"\"\"\nSCons.Builder\n\nBuilder object subsystem.\n\nA Builder object is a callable that encapsulates information about how\nto execute actions to create a target Node (file) from source Nodes\n(files), and how to create those dependencies for tracking.\n\nThe main entry point here is the Builder() factory method.  This provides\na procedural interface that creates the right underlying Builder object\nbased on the keyword arguments supplied and the types of the arguments.\n\nThe goal is for this external interface to be simple enough that the\nvast majority of users can create new Builders as necessary to support\nbuilding new types of files in their configurations, without having to\ndive any deeper into this subsystem.\n\nThe base class here is BuilderBase.  This is a concrete base class which\ndoes, in fact, represent the Builder objects that we (or users) create.\n\nThere is also a proxy that looks like a Builder:\n\n    CompositeBuilder\n\n        This proxies for a Builder with an action that is actually a\n        dictionary that knows how to map file suffixes to a specific\n        action.  This is so that we can invoke different actions\n        (compilers, compile options) for different flavors of source\n        files.\n\nBuilders and their proxies have the following public interface methods\nused by other modules:\n\n    - __call__()\n        THE public interface.  Calling a Builder object (with the\n        use of internal helper methods) sets up the target and source\n        dependencies, appropriate mapping to a specific action, and the\n        environment manipulation necessary for overridden construction\n        variable.  This also takes care of warning about possible mistakes\n        in keyword arguments.\n\n    - add_emitter()\n        Adds an emitter for a specific file suffix, used by some Tool\n        modules to specify that (for example) a yacc invocation on a .y\n        can create a .h *and* a .c file.\n\n    - add_action()\n        Adds an action for a specific file suffix, heavily used by\n        Tool modules to add their specific action(s) for turning\n        a source file into an object file to the global static\n        and shared object file Builders.\n\nThere are the following methods for internal use within this module:\n\n    - _execute()\n        The internal method that handles the heavily lifting when a\n        Builder is called.  This is used so that the __call__() methods\n        can set up warning about possible mistakes in keyword-argument\n        overrides, and *then* execute all of the steps necessary so that\n        the warnings only occur once.\n\n    - get_name()\n        Returns the Builder's name within a specific Environment,\n        primarily used to try to return helpful information in error\n        messages.\n\n    - adjust_suffix()\n    - get_prefix()\n    - get_suffix()\n    - get_src_suffix()\n    - set_src_suffix()\n        Miscellaneous stuff for handling the prefix and suffix\n        manipulation we use in turning source file names into target\n        file names.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Builder.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport collections\n\nimport SCons.Action\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nfrom SCons.Errors import InternalError, UserError\nimport SCons.Executor\nimport SCons.Memoize\nimport SCons.Util\nimport SCons.Warnings\n\nclass _Null(object):\n    pass\n\n_null = _Null\n\ndef match_splitext(path, suffixes = []):\n    if suffixes:\n        matchsuf = [S for S in suffixes if path[-len(S):] == S]\n        if matchsuf:\n            suf = max([(len(_f),_f) for _f in matchsuf])[1]\n            return [path[:-len(suf)], path[-len(suf):]]\n    return SCons.Util.splitext(path)\n\nclass DictCmdGenerator(SCons.Util.Selector):\n    \"\"\"This is a callable class that can be used as a\n    command generator function.  It holds on to a dictionary\n    mapping file suffixes to Actions.  It uses that dictionary\n    to return the proper action based on the file suffix of\n    the source file.\"\"\"\n\n    def __init__(self, dict=None, source_ext_match=1):\n        SCons.Util.Selector.__init__(self, dict)\n        self.source_ext_match = source_ext_match\n\n    def src_suffixes(self):\n        return list(self.keys())\n\n    def add_action(self, suffix, action):\n        \"\"\"Add a suffix-action pair to the mapping.\n        \"\"\"\n        self[suffix] = action\n\n    def __call__(self, target, source, env, for_signature):\n        if not source:\n            return []\n\n        if self.source_ext_match:\n            suffixes = self.src_suffixes()\n            ext = None\n            for src in map(str, source):\n                my_ext = match_splitext(src, suffixes)[1]\n                if ext and my_ext != ext:\n                    raise UserError(\"While building `%s' from `%s': Cannot build multiple sources with different extensions: %s, %s\"\n                             % (repr(list(map(str, target))), src, ext, my_ext))\n                ext = my_ext\n        else:\n            ext = match_splitext(str(source[0]), self.src_suffixes())[1]\n\n        if not ext:\n            #return ext\n            raise UserError(\"While building `%s': \"\n                            \"Cannot deduce file extension from source files: %s\"\n                 % (repr(list(map(str, target))), repr(list(map(str, source)))))\n\n        try:\n            ret = SCons.Util.Selector.__call__(self, env, source, ext)\n        except KeyError as e:\n            raise UserError(\"Ambiguous suffixes after environment substitution: %s == %s == %s\" % (e.args[0], e.args[1], e.args[2]))\n        if ret is None:\n            raise UserError(\"While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'.  Expected a suffix in this list: %s.\" % \\\n                            (repr(list(map(str, target))), repr(list(map(str, source))), ext, repr(list(self.keys()))))\n        return ret\n\nclass CallableSelector(SCons.Util.Selector):\n    \"\"\"A callable dictionary that will, in turn, call the value it\n    finds if it can.\"\"\"\n    def __call__(self, env, source):\n        value = SCons.Util.Selector.__call__(self, env, source)\n        if callable(value):\n            value = value(env, source)\n        return value\n\nclass DictEmitter(SCons.Util.Selector):\n    \"\"\"A callable dictionary that maps file suffixes to emitters.\n    When called, it finds the right emitter in its dictionary for the\n    suffix of the first source file, and calls that emitter to get the\n    right lists of targets and sources to return.  If there's no emitter\n    for the suffix in its dictionary, the original target and source are\n    returned.\n    \"\"\"\n    def __call__(self, target, source, env):\n        emitter = SCons.Util.Selector.__call__(self, env, source)\n        if emitter:\n            target, source = emitter(target, source, env)\n        return (target, source)\n\nclass ListEmitter(collections.UserList):\n    \"\"\"A callable list of emitters that calls each in sequence,\n    returning the result.\n    \"\"\"\n    def __call__(self, target, source, env):\n        for e in self.data:\n            target, source = e(target, source, env)\n        return (target, source)\n\n# These are a common errors when calling a Builder;\n# they are similar to the 'target' and 'source' keyword args to builders,\n# so we issue warnings when we see them.  The warnings can, of course,\n# be disabled.\nmisleading_keywords = {\n    'targets'   : 'target',\n    'sources'   : 'source',\n}\n\nclass OverrideWarner(collections.UserDict):\n    \"\"\"A class for warning about keyword arguments that we use as\n    overrides in a Builder call.\n\n    This class exists to handle the fact that a single Builder call\n    can actually invoke multiple builders.  This class only emits the\n    warnings once, no matter how many Builders are invoked.\n    \"\"\"\n    def __init__(self, dict):\n        collections.UserDict.__init__(self, dict)\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner')\n        self.already_warned = None\n    def warn(self):\n        if self.already_warned:\n            return\n        for k in list(self.keys()):\n            if k in misleading_keywords:\n                alt = misleading_keywords[k]\n                msg = \"Did you mean to use `%s' instead of `%s'?\" % (alt, k)\n                SCons.Warnings.warn(SCons.Warnings.MisleadingKeywordsWarning, msg)\n        self.already_warned = 1\n\ndef Builder(**kw):\n    \"\"\"A factory for builder objects.\"\"\"\n    composite = None\n    if 'generator' in kw:\n        if 'action' in kw:\n            raise UserError(\"You must not specify both an action and a generator.\")\n        kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {})\n        del kw['generator']\n    elif 'action' in kw:\n        source_ext_match = kw.get('source_ext_match', 1)\n        if 'source_ext_match' in kw:\n            del kw['source_ext_match']\n        if SCons.Util.is_Dict(kw['action']):\n            composite = DictCmdGenerator(kw['action'], source_ext_match)\n            kw['action'] = SCons.Action.CommandGeneratorAction(composite, {})\n            kw['src_suffix'] = composite.src_suffixes()\n        else:\n            kw['action'] = SCons.Action.Action(kw['action'])\n\n    if 'emitter' in kw:\n        emitter = kw['emitter']\n        if SCons.Util.is_String(emitter):\n            # This allows users to pass in an Environment\n            # variable reference (like \"$FOO\") as an emitter.\n            # We will look in that Environment variable for\n            # a callable to use as the actual emitter.\n            var = SCons.Util.get_environment_var(emitter)\n            if not var:\n                raise UserError(\"Supplied emitter '%s' does not appear to refer to an Environment variable\" % emitter)\n            kw['emitter'] = EmitterProxy(var)\n        elif SCons.Util.is_Dict(emitter):\n            kw['emitter'] = DictEmitter(emitter)\n        elif SCons.Util.is_List(emitter):\n            kw['emitter'] = ListEmitter(emitter)\n\n    result = BuilderBase(**kw)\n\n    if composite is not None:\n        result = CompositeBuilder(result, composite)\n\n    return result\n\ndef _node_errors(builder, env, tlist, slist):\n    \"\"\"Validate that the lists of target and source nodes are\n    legal for this builder and environment.  Raise errors or\n    issue warnings as appropriate.\n    \"\"\"\n\n    # First, figure out if there are any errors in the way the targets\n    # were specified.\n    for t in tlist:\n        if t.side_effect:\n            raise UserError(\"Multiple ways to build the same target were specified for: %s\" % t)\n        if t.has_explicit_builder():\n            # Check for errors when the environments are different\n            # No error if environments are the same Environment instance\n            if (t.env is not None and t.env is not env and\n                    # Check OverrideEnvironment case - no error if wrapped Environments\n                    # are the same instance, and overrides lists match\n                    not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and\n                         getattr(t.env, 'overrides', 0) == getattr(env, 'overrides', 1) and\n                         not builder.multi)):\n                action = t.builder.action\n                t_contents = t.builder.action.get_contents(tlist, slist, t.env)\n                contents = builder.action.get_contents(tlist, slist, env)\n\n                if t_contents == contents:\n                    msg = \"Two different environments were specified for target %s,\\n\\tbut they appear to have the same action: %s\" % (t, action.genstring(tlist, slist, t.env))\n                    SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)\n                else:\n                    try:\n                        msg = \"Two environments with different actions were specified for the same target: %s\\n(action 1: %s)\\n(action 2: %s)\" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))\n                    except UnicodeDecodeError:\n                        msg = \"Two environments with different actions were specified for the same target: %s\"%t\n                    raise UserError(msg)\n            if builder.multi:\n                if t.builder != builder:\n                    msg = \"Two different builders (%s and %s) were specified for the same target: %s\" % (t.builder.get_name(env), builder.get_name(env), t)\n                    raise UserError(msg)\n                # TODO(batch):  list constructed each time!\n                if t.get_executor().get_all_targets() != tlist:\n                    msg = \"Two different target lists have a target in common: %s  (from %s and from %s)\" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist)))\n                    raise UserError(msg)\n            elif t.sources != slist:\n                msg = \"Multiple ways to build the same target were specified for: %s  (from %s and from %s)\" % (t, list(map(str, t.sources)), list(map(str, slist)))\n                raise UserError(msg)\n\n    if builder.single_source:\n        if len(slist) > 1:\n            raise UserError(\"More than one source given for single-source builder: targets=%s sources=%s\" % (list(map(str,tlist)), list(map(str,slist))))\n\nclass EmitterProxy(object):\n    \"\"\"This is a callable class that can act as a\n    Builder emitter.  It holds on to a string that\n    is a key into an Environment dictionary, and will\n    look there at actual build time to see if it holds\n    a callable.  If so, we will call that as the actual\n    emitter.\"\"\"\n    def __init__(self, var):\n        self.var = SCons.Util.to_String(var)\n\n    def __call__(self, target, source, env):\n        emitter = self.var\n\n        # Recursively substitute the variable.\n        # We can't use env.subst() because it deals only\n        # in strings.  Maybe we should change that?\n        while SCons.Util.is_String(emitter) and emitter in env:\n            emitter = env[emitter]\n        if callable(emitter):\n            target, source = emitter(target, source, env)\n        elif SCons.Util.is_List(emitter):\n            for e in emitter:\n                target, source = e(target, source, env)\n\n        return (target, source)\n\n\n    def __eq__(self, other):\n        return self.var == other.var\n\n    def __lt__(self, other):\n        return self.var < other.var\n\nclass BuilderBase(object):\n    \"\"\"Base class for Builders, objects that create output\n    nodes (files) from input nodes (files).\n    \"\"\"\n\n    def __init__(self,  action = None,\n                        prefix = '',\n                        suffix = '',\n                        src_suffix = '',\n                        target_factory = None,\n                        source_factory = None,\n                        target_scanner = None,\n                        source_scanner = None,\n                        emitter = None,\n                        multi = 0,\n                        env = None,\n                        single_source = 0,\n                        name = None,\n                        chdir = _null,\n                        is_explicit = 1,\n                        src_builder = None,\n                        ensure_suffix = False,\n                        **overrides):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase')\n        self._memo = {}\n        self.action = action\n        self.multi = multi\n        if SCons.Util.is_Dict(prefix):\n            prefix = CallableSelector(prefix)\n        self.prefix = prefix\n        if SCons.Util.is_Dict(suffix):\n            suffix = CallableSelector(suffix)\n        self.env = env\n        self.single_source = single_source\n        if 'overrides' in overrides:\n            msg =  \"The \\\"overrides\\\" keyword to Builder() creation has been removed;\\n\" +\\\n                \"\\tspecify the items as keyword arguments to the Builder() call instead.\"\n            raise TypeError(msg)\n        if 'scanner' in overrides:\n            msg = \"The \\\"scanner\\\" keyword to Builder() creation has been removed;\\n\" +\\\n                \"\\tuse: source_scanner or target_scanner as appropriate.\"\n            raise TypeError(msg)\n        self.overrides = overrides\n\n        self.set_suffix(suffix)\n        self.set_src_suffix(src_suffix)\n        self.ensure_suffix = ensure_suffix\n\n        self.target_factory = target_factory\n        self.source_factory = source_factory\n        self.target_scanner = target_scanner\n        self.source_scanner = source_scanner\n\n        self.emitter = emitter\n\n        # Optional Builder name should only be used for Builders\n        # that don't get attached to construction environments.\n        if name:\n            self.name = name\n        self.executor_kw = {}\n        if chdir is not _null:\n            self.executor_kw['chdir'] = chdir\n        self.is_explicit = is_explicit\n\n        if src_builder is None:\n            src_builder = []\n        elif not SCons.Util.is_List(src_builder):\n            src_builder = [ src_builder ]\n        self.src_builder = src_builder\n\n    def __nonzero__(self):\n        raise InternalError(\"Do not test for the Node.builder attribute directly; use Node.has_builder() instead\")\n\n    def __bool__(self):\n        return self.__nonzero__()\n\n    def get_name(self, env):\n        \"\"\"Attempts to get the name of the Builder.\n\n        Look at the BUILDERS variable of env, expecting it to be a\n        dictionary containing this Builder, and return the key of the\n        dictionary.  If there's no key, then return a directly-configured\n        name (if there is one) or the name of the class (by default).\"\"\"\n\n        try:\n            index = list(env['BUILDERS'].values()).index(self)\n            return list(env['BUILDERS'].keys())[index]\n        except (AttributeError, KeyError, TypeError, ValueError):\n            try:\n                return self.name\n            except AttributeError:\n                return str(self.__class__)\n\n    def __eq__(self, other):\n        return self.__dict__ == other.__dict__\n\n    def splitext(self, path, env=None):\n        if not env:\n            env = self.env\n        if env:\n            suffixes = self.src_suffixes(env)\n        else:\n            suffixes = []\n        return match_splitext(path, suffixes)\n\n    def _adjustixes(self, files, pre, suf, ensure_suffix=False):\n        if not files:\n            return []\n        result = []\n        if not SCons.Util.is_List(files):\n            files = [files]\n\n        for f in files:\n            if SCons.Util.is_String(f):\n                f = SCons.Util.adjustixes(f, pre, suf, ensure_suffix)\n            result.append(f)\n        return result\n\n    def _create_nodes(self, env, target = None, source = None):\n        \"\"\"Create and return lists of target and source nodes.\n        \"\"\"\n        src_suf = self.get_src_suffix(env)\n\n        target_factory = env.get_factory(self.target_factory)\n        source_factory = env.get_factory(self.source_factory)\n\n        source = self._adjustixes(source, None, src_suf)\n        slist = env.arg2nodes(source, source_factory)\n\n        pre = self.get_prefix(env, slist)\n        suf = self.get_suffix(env, slist)\n\n        if target is None:\n            try:\n                t_from_s = slist[0].target_from_source\n            except AttributeError:\n                raise UserError(\"Do not know how to create a target from source `%s'\" % slist[0])\n            except IndexError:\n                tlist = []\n            else:\n                splitext = lambda S: self.splitext(S,env)\n                tlist = [ t_from_s(pre, suf, splitext) ]\n        else:\n            target = self._adjustixes(target, pre, suf, self.ensure_suffix)\n            tlist = env.arg2nodes(target, target_factory, target=target, source=source)\n\n        if self.emitter:\n            # The emitter is going to do str(node), but because we're\n            # being called *from* a builder invocation, the new targets\n            # don't yet have a builder set on them and will look like\n            # source files.  Fool the emitter's str() calls by setting\n            # up a temporary builder on the new targets.\n            new_targets = []\n            for t in tlist:\n                if not t.is_derived():\n                    t.builder_set(self)\n                    new_targets.append(t)\n\n            orig_tlist = tlist[:]\n            orig_slist = slist[:]\n\n            target, source = self.emitter(target=tlist, source=slist, env=env)\n\n            # Now delete the temporary builders that we attached to any\n            # new targets, so that _node_errors() doesn't do weird stuff\n            # to them because it thinks they already have builders.\n            for t in new_targets:\n                if t.builder is self:\n                    # Only delete the temporary builder if the emitter\n                    # didn't change it on us.\n                    t.builder_set(None)\n\n            # Have to call arg2nodes yet again, since it is legal for\n            # emitters to spit out strings as well as Node instances.\n            tlist = env.arg2nodes(target, target_factory,\n                                  target=orig_tlist, source=orig_slist)\n            slist = env.arg2nodes(source, source_factory,\n                                  target=orig_tlist, source=orig_slist)\n\n        return tlist, slist\n\n    def _execute(self, env, target, source, overwarn={}, executor_kw={}):\n        # We now assume that target and source are lists or None.\n        if self.src_builder:\n            source = self.src_builder_sources(env, source, overwarn)\n\n        if self.single_source and len(source) > 1 and target is None:\n            result = []\n            if target is None: target = [None]*len(source)\n            for tgt, src in zip(target, source):\n                if tgt is not None:\n                    tgt = [tgt]\n                if src is not None:\n                    src = [src]\n                result.extend(self._execute(env, tgt, src, overwarn))\n            return SCons.Node.NodeList(result)\n\n        overwarn.warn()\n\n        tlist, slist = self._create_nodes(env, target, source)\n\n        # If there is more than one target ensure that if we need to reset\n        # the implicit list to new scan of dependency all targets implicit lists\n        # are cleared. (SCons GH Issue #2811 and MongoDB SERVER-33111)\n        if len(tlist) > 1:\n            for t in tlist:\n                t.target_peers = tlist\n\n        # Check for errors with the specified target/source lists.\n        _node_errors(self, env, tlist, slist)\n\n        # The targets are fine, so find or make the appropriate Executor to\n        # build this particular list of targets from this particular list of\n        # sources.\n\n        executor = None\n        key = None\n\n        if self.multi:\n            try:\n                executor = tlist[0].get_executor(create = 0)\n            except (AttributeError, IndexError):\n                pass\n            else:\n                executor.add_sources(slist)\n\n        if executor is None:\n            if not self.action:\n                fmt = \"Builder %s must have an action to build %s.\"\n                raise UserError(fmt % (self.get_name(env or self.env),\n                                        list(map(str,tlist))))\n            key = self.action.batch_key(env or self.env, tlist, slist)\n            if key:\n                try:\n                    executor = SCons.Executor.GetBatchExecutor(key)\n                except KeyError:\n                    pass\n                else:\n                    executor.add_batch(tlist, slist)\n\n        if executor is None:\n            executor = SCons.Executor.Executor(self.action, env, [],\n                                               tlist, slist, executor_kw)\n            if key:\n                SCons.Executor.AddBatchExecutor(key, executor)\n\n        # Now set up the relevant information in the target Nodes themselves.\n        for t in tlist:\n            t.cwd = env.fs.getcwd()\n            t.builder_set(self)\n            t.env_set(env)\n            t.add_source(slist)\n            t.set_executor(executor)\n            t.set_explicit(self.is_explicit)\n\n        return SCons.Node.NodeList(tlist)\n\n    def __call__(self, env, target=None, source=None, chdir=_null, **kw):\n        # We now assume that target and source are lists or None.\n        # The caller (typically Environment.BuilderWrapper) is\n        # responsible for converting any scalar values to lists.\n        if chdir is _null:\n            ekw = self.executor_kw\n        else:\n            ekw = self.executor_kw.copy()\n            ekw['chdir'] = chdir\n        if 'chdir' in ekw and SCons.Util.is_String(ekw['chdir']):\n            ekw['chdir'] = env.subst(ekw['chdir'])\n        if kw:\n            if 'srcdir' in kw:\n                def prependDirIfRelative(f, srcdir=kw['srcdir']):\n                    import os.path\n                    if SCons.Util.is_String(f) and not os.path.isabs(f):\n                        f = os.path.join(srcdir, f)\n                    return f\n                if not SCons.Util.is_List(source):\n                    source = [source]\n                source = list(map(prependDirIfRelative, source))\n                del kw['srcdir']\n            if self.overrides:\n                env_kw = self.overrides.copy()\n                env_kw.update(kw)\n            else:\n                env_kw = kw\n        else:\n            env_kw = self.overrides\n        env = env.Override(env_kw)\n        return self._execute(env, target, source, OverrideWarner(kw), ekw)\n\n    def adjust_suffix(self, suff):\n        if suff and not suff[0] in [ '.', '_', '$' ]:\n            return '.' + suff\n        return suff\n\n    def get_prefix(self, env, sources=[]):\n        prefix = self.prefix\n        if callable(prefix):\n            prefix = prefix(env, sources)\n        return env.subst(prefix)\n\n    def set_suffix(self, suffix):\n        if not callable(suffix):\n            suffix = self.adjust_suffix(suffix)\n        self.suffix = suffix\n\n    def get_suffix(self, env, sources=[]):\n        suffix = self.suffix\n        if callable(suffix):\n            suffix = suffix(env, sources)\n        return env.subst(suffix)\n\n    def set_src_suffix(self, src_suffix):\n        if not src_suffix:\n            src_suffix = []\n        elif not SCons.Util.is_List(src_suffix):\n            src_suffix = [ src_suffix ]\n        self.src_suffix = [callable(suf) and suf or self.adjust_suffix(suf) for suf in src_suffix]\n\n    def get_src_suffix(self, env):\n        \"\"\"Get the first src_suffix in the list of src_suffixes.\"\"\"\n        ret = self.src_suffixes(env)\n        if not ret:\n            return ''\n        return ret[0]\n\n    def add_emitter(self, suffix, emitter):\n        \"\"\"Add a suffix-emitter mapping to this Builder.\n\n        This assumes that emitter has been initialized with an\n        appropriate dictionary type, and will throw a TypeError if\n        not, so the caller is responsible for knowing that this is an\n        appropriate method to call for the Builder in question.\n        \"\"\"\n        self.emitter[suffix] = emitter\n\n    def add_src_builder(self, builder):\n        \"\"\"\n        Add a new Builder to the list of src_builders.\n\n        This requires wiping out cached values so that the computed\n        lists of source suffixes get re-calculated.\n        \"\"\"\n        self._memo = {}\n        self.src_builder.append(builder)\n\n    def _get_sdict(self, env):\n        \"\"\"\n        Returns a dictionary mapping all of the source suffixes of all\n        src_builders of this Builder to the underlying Builder that\n        should be called first.\n\n        This dictionary is used for each target specified, so we save a\n        lot of extra computation by memoizing it for each construction\n        environment.\n\n        Note that this is re-computed each time, not cached, because there\n        might be changes to one of our source Builders (or one of their\n        source Builders, and so on, and so on...) that we can't \"see.\"\n\n        The underlying methods we call cache their computed values,\n        though, so we hope repeatedly aggregating them into a dictionary\n        like this won't be too big a hit.  We may need to look for a\n        better way to do this if performance data show this has turned\n        into a significant bottleneck.\n        \"\"\"\n        sdict = {}\n        for bld in self.get_src_builders(env):\n            for suf in bld.src_suffixes(env):\n                sdict[suf] = bld\n        return sdict\n\n    def src_builder_sources(self, env, source, overwarn={}):\n        sdict = self._get_sdict(env)\n\n        src_suffixes = self.src_suffixes(env)\n\n        lengths = list(set(map(len, src_suffixes)))\n\n        def match_src_suffix(name, src_suffixes=src_suffixes, lengths=lengths):\n            node_suffixes = [name[-l:] for l in lengths]\n            for suf in src_suffixes:\n                if suf in node_suffixes:\n                    return suf\n            return None\n\n        result = []\n        for s in SCons.Util.flatten(source):\n            if SCons.Util.is_String(s):\n                match_suffix = match_src_suffix(env.subst(s))\n                if not match_suffix and '.' not in s:\n                    src_suf = self.get_src_suffix(env)\n                    s = self._adjustixes(s, None, src_suf)[0]\n            else:\n                match_suffix = match_src_suffix(s.name)\n            if match_suffix:\n                try:\n                    bld = sdict[match_suffix]\n                except KeyError:\n                    result.append(s)\n                else:\n                    tlist = bld._execute(env, None, [s], overwarn)\n                    # If the subsidiary Builder returned more than one\n                    # target, then filter out any sources that this\n                    # Builder isn't capable of building.\n                    if len(tlist) > 1:\n                        tlist = [t for t in tlist if match_src_suffix(t.name)]\n                    result.extend(tlist)\n            else:\n                result.append(s)\n\n        source_factory = env.get_factory(self.source_factory)\n\n        return env.arg2nodes(result, source_factory)\n\n    def _get_src_builders_key(self, env):\n        return id(env)\n\n    @SCons.Memoize.CountDictCall(_get_src_builders_key)\n    def get_src_builders(self, env):\n        \"\"\"\n        Returns the list of source Builders for this Builder.\n\n        This exists mainly to look up Builders referenced as\n        strings in the 'BUILDER' variable of the construction\n        environment and cache the result.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['get_src_builders']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_src_builders'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        builders = []\n        for bld in self.src_builder:\n            if SCons.Util.is_String(bld):\n                try:\n                    bld = env['BUILDERS'][bld]\n                except KeyError:\n                    continue\n            builders.append(bld)\n\n        memo_dict[memo_key] = builders\n        return builders\n\n    def _subst_src_suffixes_key(self, env):\n        return id(env)\n\n    @SCons.Memoize.CountDictCall(_subst_src_suffixes_key)\n    def subst_src_suffixes(self, env):\n        \"\"\"\n        The suffix list may contain construction variable expansions,\n        so we have to evaluate the individual strings.  To avoid doing\n        this over and over, we memoize the results for each construction\n        environment.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['subst_src_suffixes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['subst_src_suffixes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n        suffixes = [env.subst(x) for x in self.src_suffix]\n        memo_dict[memo_key] = suffixes\n        return suffixes\n\n    def src_suffixes(self, env):\n        \"\"\"\n        Returns the list of source suffixes for all src_builders of this\n        Builder.\n\n        This is essentially a recursive descent of the src_builder \"tree.\"\n        (This value isn't cached because there may be changes in a\n        src_builder many levels deep that we can't see.)\n        \"\"\"\n        sdict = {}\n        suffixes = self.subst_src_suffixes(env)\n        for s in suffixes:\n            sdict[s] = 1\n        for builder in self.get_src_builders(env):\n            for s in builder.src_suffixes(env):\n                if s not in sdict:\n                    sdict[s] = 1\n                    suffixes.append(s)\n        return suffixes\n\nclass CompositeBuilder(SCons.Util.Proxy):\n    \"\"\"A Builder Proxy whose main purpose is to always have\n    a DictCmdGenerator as its action, and to provide access\n    to the DictCmdGenerator's add_action() method.\n    \"\"\"\n\n    def __init__(self, builder, cmdgen):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder')\n        SCons.Util.Proxy.__init__(self, builder)\n\n        # cmdgen should always be an instance of DictCmdGenerator.\n        self.cmdgen = cmdgen\n        self.builder = builder\n\n    __call__ = SCons.Util.Delegate('__call__')\n\n    def add_action(self, suffix, action):\n        self.cmdgen.add_action(suffix, action)\n        self.set_src_suffix(self.cmdgen.src_suffixes())\n\ndef is_a_Builder(obj):\n    \"\"\"\"Returns True if the specified obj is one of our Builder classes.\n\n    The test is complicated a bit by the fact that CompositeBuilder\n    is a proxy, not a subclass of BuilderBase.\n    \"\"\"\n    return (isinstance(obj, BuilderBase)\n            or isinstance(obj, CompositeBuilder)\n            or callable(obj))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/CacheDir.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/CacheDir.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"\nCacheDir support\n\"\"\"\n\nimport hashlib\nimport json\nimport os\nimport stat\nimport sys\n\nimport SCons\nimport SCons.Action\nimport SCons.Warnings\nfrom SCons.Util import PY3\n\ncache_enabled = True\ncache_debug = False\ncache_force = False\ncache_show = False\ncache_readonly = False\n\ndef CacheRetrieveFunc(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cd.requests += 1\n    cachedir, cachefile = cd.cachepath(t)\n    if not fs.exists(cachefile):\n        cd.CacheDebug('CacheRetrieve(%s):  %s not in cache\\n', t, cachefile)\n        return 1\n    cd.hits += 1\n    cd.CacheDebug('CacheRetrieve(%s):  retrieving from %s\\n', t, cachefile)\n    if SCons.Action.execute_actions:\n        if fs.islink(cachefile):\n            fs.symlink(fs.readlink(cachefile), t.get_internal_path())\n        else:\n            env.copy_from_cache(cachefile, t.get_internal_path())\n            try:\n                os.utime(cachefile, None)\n            except OSError:\n                pass\n        st = fs.stat(cachefile)\n        fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n    return 0\n\ndef CacheRetrieveString(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if t.fs.exists(cachefile):\n        return \"Retrieved `%s' from cache\" % t.get_internal_path()\n    return None\n\nCacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)\n\nCacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)\n\ndef CachePushFunc(target, source, env):\n    if cache_readonly:\n        return\n\n    t = target[0]\n    if t.nocache:\n        return\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if fs.exists(cachefile):\n        # Don't bother copying it if it's already there.  Note that\n        # usually this \"shouldn't happen\" because if the file already\n        # existed in cache, we'd have retrieved the file from there,\n        # not built it.  This can happen, though, in a race, if some\n        # other person running the same build pushes their copy to\n        # the cache after we decide we need to build it but before our\n        # build completes.\n        cd.CacheDebug('CachePush(%s):  %s already exists in cache\\n', t, cachefile)\n        return\n\n    cd.CacheDebug('CachePush(%s):  pushing to %s\\n', t, cachefile)\n\n    tempfile = cachefile+'.tmp'+str(os.getpid())\n    errfmt = \"Unable to copy %s to cache. Cache file is %s\"\n\n    if not fs.isdir(cachedir):\n        try:\n            fs.makedirs(cachedir)\n        except EnvironmentError:\n            # We may have received an exception because another process\n            # has beaten us creating the directory.\n            if not fs.isdir(cachedir):\n                msg = errfmt % (str(target), cachefile)\n                raise SCons.Errors.SConsEnvironmentError(msg)\n\n    try:\n        if fs.islink(t.get_internal_path()):\n            fs.symlink(fs.readlink(t.get_internal_path()), tempfile)\n        else:\n            fs.copy2(t.get_internal_path(), tempfile)\n        fs.rename(tempfile, cachefile)\n        st = fs.stat(t.get_internal_path())\n        fs.chmod(cachefile, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n    except EnvironmentError:\n        # It's possible someone else tried writing the file at the\n        # same time we did, or else that there was some problem like\n        # the CacheDir being on a separate file system that's full.\n        # In any case, inability to push a file to cache doesn't affect\n        # the correctness of the build, so just print a warning.\n        msg = errfmt % (str(target), cachefile)\n        SCons.Warnings.warn(SCons.Warnings.CacheWriteErrorWarning, msg)\n\nCachePush = SCons.Action.Action(CachePushFunc, None)\n\n# Nasty hack to cut down to one warning for each cachedir path that needs\n# upgrading.\nwarned = dict()\n\nclass CacheDir(object):\n\n    def __init__(self, path):\n        \"\"\"\n        Initialize a CacheDir object.\n\n        The cache configuration is stored in the object. It\n        is read from the config file in the supplied path if\n        one exists,  if not the config file is created and\n        the default config is written, as well as saved in the object.\n        \"\"\"\n        self.requests = 0\n        self.hits = 0\n        self.path = path\n        self.current_cache_debug = None\n        self.debugFP = None\n        self.config = dict()\n        if path is None:\n            return\n\n        if PY3:\n            self._readconfig3(path)\n        else:\n            self._readconfig2(path)\n\n\n    def _readconfig3(self, path):\n        \"\"\"\n        Python3 version of reading the cache config.\n\n        If directory or config file do not exist, create.  Take advantage\n        of Py3 capability in os.makedirs() and in file open(): just try\n        the operation and handle failure appropriately.\n\n        Omit the check for old cache format, assume that's old enough\n        there will be none of those left to worry about.\n\n        :param path: path to the cache directory\n        \"\"\"\n        config_file = os.path.join(path, 'config')\n        try:\n            os.makedirs(path, exist_ok=True)\n        except FileExistsError:\n            pass\n        except OSError:\n            msg = \"Failed to create cache directory \" + path\n            raise SCons.Errors.SConsEnvironmentError(msg)\n\n        try:\n            with open(config_file, 'x') as config:\n                self.config['prefix_len'] = 2\n                try:\n                    json.dump(self.config, config)\n                except Exception:\n                    msg = \"Failed to write cache configuration for \" + path\n                    raise SCons.Errors.SConsEnvironmentError(msg)\n        except FileExistsError:\n            try:\n                with open(config_file) as config:\n                    self.config = json.load(config)\n            except ValueError:\n                msg = \"Failed to read cache configuration for \" + path\n                raise SCons.Errors.SConsEnvironmentError(msg)\n\n\n    def _readconfig2(self, path):\n        \"\"\"\n        Python2 version of reading cache config.\n\n        See if there is a config file in the cache directory. If there is,\n        use it. If there isn't, and the directory exists and isn't empty,\n        produce a warning. If the directory does not exist or is empty,\n        write a config file.\n\n        :param path: path to the cache directory\n        \"\"\"\n        config_file = os.path.join(path, 'config')\n        if not os.path.exists(config_file):\n            # A note: There is a race hazard here if two processes start and\n            # attempt to create the cache directory at the same time. However,\n            # Python 2.x does not give you the option to do exclusive file\n            # creation (not even the option to error on opening an existing\n            # file for writing...). The ordering of events here is an attempt\n            # to alleviate this, on the basis that it's a pretty unlikely\n            # occurrence (would require two builds with a brand new cache\n            # directory)\n            if os.path.isdir(path) and any(f != \"config\" for f in os.listdir(path)):\n                self.config['prefix_len'] = 1\n                # When building the project I was testing this on, the warning\n                # was output over 20 times. That seems excessive\n                global warned\n                if self.path not in warned:\n                    msg = \"Please upgrade your cache by running \" +\\\n                          \"scons-configure-cache.py \" +  self.path\n                    SCons.Warnings.warn(SCons.Warnings.CacheVersionWarning, msg)\n                    warned[self.path] = True\n            else:\n                if not os.path.isdir(path):\n                    try:\n                        os.makedirs(path)\n                    except OSError:\n                        # If someone else is trying to create the directory at\n                        # the same time as me, bad things will happen\n                        msg = \"Failed to create cache directory \" + path\n                        raise SCons.Errors.SConsEnvironmentError(msg)\n\n                self.config['prefix_len'] = 2\n                if not os.path.exists(config_file):\n                    try:\n                        with open(config_file, 'w') as config:\n                            json.dump(self.config, config)\n                    except Exception:\n                        msg = \"Failed to write cache configuration for \" + path\n                        raise SCons.Errors.SConsEnvironmentError(msg)\n        else:\n            try:\n                with open(config_file) as config:\n                    self.config = json.load(config)\n            except ValueError:\n                msg = \"Failed to read cache configuration for \" + path\n                raise SCons.Errors.SConsEnvironmentError(msg)\n\n\n    def CacheDebug(self, fmt, target, cachefile):\n        if cache_debug != self.current_cache_debug:\n            if cache_debug == '-':\n                self.debugFP = sys.stdout\n            elif cache_debug:\n                self.debugFP = open(cache_debug, 'w')\n            else:\n                self.debugFP = None\n            self.current_cache_debug = cache_debug\n        if self.debugFP:\n            self.debugFP.write(fmt % (target, os.path.split(cachefile)[1]))\n            self.debugFP.write(\"requests: %d, hits: %d, misses: %d, hit rate: %.2f%%\\n\" %\n                               (self.requests, self.hits, self.misses, self.hit_ratio))\n\n    @property\n    def hit_ratio(self):\n        return (100.0 * self.hits / self.requests if self.requests > 0 else 100)\n\n    @property\n    def misses(self):\n        return self.requests - self.hits\n\n    def is_enabled(self):\n        return cache_enabled and self.path is not None\n\n    def is_readonly(self):\n        return cache_readonly\n\n    def cachepath(self, node):\n        \"\"\"\n        \"\"\"\n        if not self.is_enabled():\n            return None, None\n\n        sig = node.get_cachedir_bsig()\n\n        subdir = sig[:self.config['prefix_len']].upper()\n\n        dir = os.path.join(self.path, subdir)\n        return dir, os.path.join(dir, sig)\n\n    def retrieve(self, node):\n        \"\"\"\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Note that there's a special trick here with the execute flag\n        (one that's not normally done for other actions).  Basically\n        if the user requested a no_exec (-n) build, then\n        SCons.Action.execute_actions is set to 0 and when any action\n        is called, it does its showing but then just returns zero\n        instead of actually calling the action execution operation.\n        The problem for caching is that if the file does NOT exist in\n        cache then the CacheRetrieveString won't return anything to\n        show for the task, but the Action.__call__ won't call\n        CacheRetrieveFunc; instead it just returns zero, which makes\n        the code below think that the file *was* successfully\n        retrieved from the cache, therefore it doesn't do any\n        subsequent building.  However, the CacheRetrieveString didn't\n        print anything because it didn't actually exist in the cache,\n        and no more build actions will be performed, so the user just\n        sees nothing.  The fix is to tell Action.__call__ to always\n        execute the CacheRetrieveFunc and then have the latter\n        explicitly check SCons.Action.execute_actions itself.\n        \"\"\"\n        if not self.is_enabled():\n            return False\n\n        env = node.get_build_env()\n        if cache_show:\n            if CacheRetrieveSilent(node, [], env, execute=1) == 0:\n                node.build(presub=0, execute=0)\n                return True\n        else:\n            if CacheRetrieve(node, [], env, execute=1) == 0:\n                return True\n\n        return False\n\n    def push(self, node):\n        if self.is_readonly() or not self.is_enabled():\n            return\n        return CachePush(node, [], node.get_build_env())\n\n    def push_if_forced(self, node):\n        if cache_force:\n            return self.push(node)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Conftest.py",
    "content": "\"\"\"SCons.Conftest\n\nAutoconf-like configuration support; low level implementation of tests.\n\"\"\"\n\n#\n# Copyright (c) 2003 Stichting NLnet Labs\n# Copyright (c) 2001, 2002, 2003 Steven Knight\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n#\n# The purpose of this module is to define how a check is to be performed.\n# Use one of the Check...() functions below.\n#\n\n#\n# A context class is used that defines functions for carrying out the tests,\n# logging and messages.  The following methods and members must be present:\n#\n# context.Display(msg)  Function called to print messages that are normally\n#                       displayed for the user.  Newlines are explicitly used.\n#                       The text should also be written to the logfile!\n#\n# context.Log(msg)      Function called to write to a log file.\n#\n# context.BuildProg(text, ext)\n#                       Function called to build a program, using \"ext\" for the\n#                       file extention.  Must return an empty string for\n#                       success, an error message for failure.\n#                       For reliable test results building should be done just\n#                       like an actual program would be build, using the same\n#                       command and arguments (including configure results so\n#                       far).\n#\n# context.CompileProg(text, ext)\n#                       Function called to compile a program, using \"ext\" for\n#                       the file extention.  Must return an empty string for\n#                       success, an error message for failure.\n#                       For reliable test results compiling should be done just\n#                       like an actual source file would be compiled, using the\n#                       same command and arguments (including configure results\n#                       so far).\n#\n# context.AppendLIBS(lib_name_list)\n#                       Append \"lib_name_list\" to the value of LIBS.\n#                       \"lib_namelist\" is a list of strings.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.PrependLIBS(lib_name_list)\n#                       Prepend \"lib_name_list\" to the value of LIBS.\n#                       \"lib_namelist\" is a list of strings.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.SetLIBS(value)\n#                       Set LIBS to \"value\".  The type of \"value\" is what\n#                       AppendLIBS() returned.\n#                       Return the value of LIBS before changing it (any type\n#                       can be used, it is passed to SetLIBS() later.)\n#\n# context.headerfilename\n#                       Name of file to append configure results to, usually\n#                       \"confdefs.h\".\n#                       The file must not exist or be empty when starting.\n#                       Empty or None to skip this (some tests will not work!).\n#\n# context.config_h      (may be missing). If present, must be a string, which\n#                       will be filled with the contents of a config_h file.\n#\n# context.vardict       Dictionary holding variables used for the tests and\n#                       stores results from the tests, used for the build\n#                       commands.\n#                       Normally contains \"CC\", \"LIBS\", \"CPPFLAGS\", etc.\n#\n# context.havedict      Dictionary holding results from the tests that are to\n#                       be used inside a program.\n#                       Names often start with \"HAVE_\".  These are zero\n#                       (feature not present) or one (feature present).  Other\n#                       variables may have any value, e.g., \"PERLVERSION\" can\n#                       be a number and \"SYSTEMNAME\" a string.\n#\n\nimport re\n\n#\n# PUBLIC VARIABLES\n#\n\nLogInputFiles = 1    # Set that to log the input files in case of a failed test\nLogErrorMessages = 1 # Set that to log Conftest-generated error messages\n\n#\n# PUBLIC FUNCTIONS\n#\n\n# Generic remarks:\n# - When a language is specified which is not supported the test fails.  The\n#   message is a bit different, because not all the arguments for the normal\n#   message are available yet (chicken-egg problem).\n\n\ndef CheckBuilder(context, text = None, language = None):\n    \"\"\"\n    Configure check to see if the compiler works.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    \"text\" may be used to specify the code to be build.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"%s\\n\" % msg)\n        return msg\n\n    if not text:\n        text = \"\"\"\nint main(void) {\n    return 0;\n}\n\"\"\"\n\n    context.Display(\"Checking if building a %s file works... \" % lang)\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCC(context):\n    \"\"\"\n    Configure check for a working C compiler.\n\n    This checks whether the C compiler, as defined in the $CC construction\n    variable, can compile a C source file. It uses the current $CCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CC', text, 'C')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCC(context):\n    \"\"\"\n    Configure check for a working shared C compiler.\n\n    This checks whether the C compiler, as defined in the $SHCC construction\n    variable, can compile a C source file. It uses the current $SHCCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C compiler works... \")\n    text = \"\"\"\nint foo(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCC', text, 'C', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCXX(context):\n    \"\"\"\n    Configure check for a working CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $CXX construction\n    variable, can compile a CXX source file. It uses the current $CXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C++ compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CXX', text, 'C++')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCXX(context):\n    \"\"\"\n    Configure check for a working shared CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $SHCXX construction\n    variable, can compile a CXX source file. It uses the current $SHCXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C++ compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCXX', text, 'C++', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef _check_empty_program(context, comp, text, language, use_shared = False):\n    \"\"\"Return 0 on success, 1 otherwise.\"\"\"\n    if comp not in context.env or not context.env[comp]:\n        # The compiler construction variable is not set or empty\n        return 1\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        return 1\n\n    if use_shared:\n        return context.CompileSharedObject(text, suffix)\n    else:\n        return context.CompileProg(text, suffix)\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    \"\"\"\n    Configure check for a function \"function_name\".\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Optional \"header\" can be defined to define a function prototype, include a\n    header file or anything else that comes before main().\n    Sets HAVE_function_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Remarks from autoconf:\n    # - Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>\n    #   which includes <sys/select.h> which contains a prototype for select.\n    #   Similarly for bzero.\n    # - assert.h is included to define __stub macros and hopefully few\n    #   prototypes, which can conflict with char $1(); below.\n    # - Override any gcc2 internal prototype to avoid an error.\n    # - We use char for the function declaration because int might match the\n    #   return type of a gcc2 builtin and then its argument prototype would\n    #   still apply.\n    # - The GNU C library defines this for functions which it implements to\n    #   always fail with ENOSYS.  Some functions are actually named something\n    #   starting with __ and the normal name is an alias.\n\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\"\"\" % function_name\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s(): %s\\n\" % (function_name, msg))\n        return msg\n\n    text = \"\"\"\n%(include)s\n#include <assert.h>\n%(hdr)s\n\n#if _MSC_VER && !__INTEL_COMPILER\n    #pragma function(%(name)s)\n#endif\n\nint main(void) {\n#if defined (__stub_%(name)s) || defined (__stub___%(name)s)\n  fail fail fail\n#else\n  %(name)s();\n#endif\n\n  return 0;\n}\n\"\"\" % { 'name': function_name,\n        'include': includetext,\n        'hdr': header }\n\n    context.Display(\"Checking for %s function %s()... \" % (lang, function_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + function_name, text,\n                 \"Define to 1 if the system has the function `%s'.\" %\\\n                 function_name)\n    return ret\n\n\ndef CheckHeader(context, header_name, header = None, language = None,\n                                                        include_quotes = None):\n    \"\"\"\n    Configure check for a C or C++ header file \"header_name\".\n    Optional \"header\" can be defined to do something before including the\n    header file (unusual, supported for consistency).\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_header_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS and $CPPFLAGS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Why compile the program instead of just running the preprocessor?\n    # It is possible that the header file exists, but actually using it may\n    # fail (e.g., because it depends on other header files).  Thus this test is\n    # more strict.  It may require using the \"header\" argument.\n    #\n    # Use <> by default, because the check is normally used for system header\n    # files.  SCons passes '\"\"' to overrule this.\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"\\n' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for header file %s: %s\\n\"\n                                                          % (header_name, msg))\n        return msg\n\n    if not include_quotes:\n        include_quotes = \"<>\"\n\n    text = \"%s%s\\n#include %s%s%s\\n\\n\" % (includetext, header,\n                             include_quotes[0], header_name, include_quotes[1])\n\n    context.Display(\"Checking for %s header file %s... \" % (lang, header_name))\n    ret = context.CompileProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + header_name, text,\n                 \"Define to 1 if you have the <%s> header file.\" % header_name)\n    return ret\n\n\ndef CheckType(context, type_name, fallback = None,\n                                               header = None, language = None):\n    \"\"\"\n    Configure check for a C or C++ type \"type_name\".\n    Optional \"header\" can be defined to include a header file.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_type_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    # Remarks from autoconf about this test:\n    # - Grepping for the type in include files is not reliable (grep isn't\n    #   portable anyway).\n    # - Using \"TYPE my_var;\" doesn't work for const qualified types in C++.\n    #   Adding an initializer is not valid for some C++ classes.\n    # - Using the type as parameter to a function either fails for K&$ C or for\n    #   C++.\n    # - Using \"TYPE *my_var;\" is valid in C for some types that are not\n    #   declared (struct something).\n    # - Using \"sizeof(TYPE)\" is valid when TYPE is actually a variable.\n    # - Using the previous two together works reliably.\n    text = \"\"\"\n%(include)s\n%(header)s\n\nint main(void) {\n  if ((%(name)s *) 0)\n    return 0;\n  if (sizeof (%(name)s))\n    return 0;\n}\n\"\"\" % { 'include': includetext,\n        'header': header,\n        'name': type_name }\n\n    context.Display(\"Checking for %s type %s... \" % (lang, type_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + type_name, text,\n                 \"Define to 1 if the system has the type `%s'.\" % type_name)\n    if ret and fallback and context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(\"typedef %s %s;\\n\" % (fallback, type_name))\n        f.close()\n\n    return ret\n\ndef CheckTypeSize(context, type_name, header = None, language = None, expect = None):\n    \"\"\"This check can be used to get the size of a given type, or to check whether\n    the type is of expected size.\n\n    Arguments:\n        - type : str\n            the type to check\n        - includes : sequence\n            list of headers to include in the test code before testing the type\n        - language : str\n            'C' or 'C++'\n        - expect : int\n            if given, will test wether the type has the given number of bytes.\n            If not given, will automatically find the size.\n\n        Returns:\n            status : int\n                0 if the check failed, or the found size of the type if the check succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    src = includetext + header\n    if expect is not None:\n        # Only check if the given size is the right one\n        context.Display('Checking %s is %d bytes... ' % (type_name, expect))\n\n        # test code taken from autoconf: this is a pretty clever hack to find that\n        # a type is of a given size using only compilation. This speeds things up\n        # quite a bit compared to straightforward code using TryRun\n        src = src + r\"\"\"\ntypedef %s scons_check_type;\n\nint main(void)\n{\n    static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)];\n    test_array[0] = 0;\n\n    return 0;\n}\n\"\"\"\n\n        st = context.CompileProg(src % (type_name, expect), suffix)\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, expect,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return expect\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n    else:\n        # Only check if the given size is the right one\n        context.Message('Checking size of %s ... ' % type_name)\n\n        # We have to be careful with the program we wish to test here since\n        # compilation will be attempted using the current environment's flags.\n        # So make sure that the program will compile without any warning. For\n        # example using: 'int main(int argc, char** argv)' will fail with the\n        # '-Wall -Werror' flags since the variables argc and argv would not be\n        # used in the program...\n        #\n        src = src + \"\"\"\n#include <stdlib.h>\n#include <stdio.h>\nint main(void) {\n    printf(\"%d\", (int)sizeof(\"\"\" + type_name + \"\"\"));\n    return 0;\n}\n    \"\"\"\n        st, out = context.RunProg(src, suffix)\n        try:\n            size = int(out)\n        except ValueError:\n            # If cannot convert output of test prog to an integer (the size),\n            # something went wront, so just fail\n            st = 1\n            size = 0\n\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, size,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return size\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n\n    return 0\n\ndef CheckDeclaration(context, symbol, includes = None, language = None):\n    \"\"\"Checks whether symbol is declared.\n\n    Use the same test as autoconf, that is test whether the symbol is defined\n    as a macro or can be used as an r-value.\n\n    Arguments:\n        symbol : str\n            the symbol to check\n        includes : str\n            Optional \"header\" can be defined to include a header file.\n        language : str\n            only C and C++ supported.\n\n    Returns:\n        status : bool\n            True if the check failed, False if succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not includes:\n        includes = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for declaration %s: %s\\n\" % (symbol, msg))\n        return msg\n\n    src = includetext + includes\n    context.Display('Checking whether %s is declared... ' % symbol)\n\n    src = src + r\"\"\"\nint main(void)\n{\n#ifndef %s\n    (void) %s;\n#endif\n    ;\n    return 0;\n}\n\"\"\" % (symbol, symbol)\n\n    st = context.CompileProg(src, suffix)\n    _YesNoResult(context, st, \"HAVE_DECL_\" + symbol, src,\n                 \"Set to 1 if %s is defined.\" % symbol)\n    return st\n\ndef CheckLib(context, libs, func_name = None, header = None,\n             extra_libs = None, call = None, language = None, autoadd = 1,\n             append = True):\n    \"\"\"\n    Configure check for a C or C++ libraries \"libs\".  Searches through\n    the list of libraries, until one is found where the test succeeds.\n    Tests if \"func_name\" or \"call\" exists in the library.  Note: if it exists\n    in another library the test succeeds anyway!\n    Optional \"header\" can be defined to include a header file.  If not given a\n    default prototype for \"func_name\" is added.\n    Optional \"extra_libs\" is a list of library names to be added after\n    \"lib_name\" in the build command.  To be used for libraries that \"lib_name\"\n    depends on.\n    Optional \"call\" replaces the call to \"func_name\" in the test code.  It must\n    consist of complete C statements, including a trailing \";\".\n    Both \"func_name\" and \"call\" arguments are optional, and in that case, just\n    linking against the libs is tested.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    text = \"\"\"\n%s\n%s\"\"\" % (includetext, header)\n\n    # Add a function declaration if needed.\n    if func_name and func_name != \"main\":\n        if not header:\n            text = text + \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\n\"\"\" % func_name\n\n        # The actual test code.\n        if not call:\n            call = \"%s();\" % func_name\n\n    # if no function to test, leave main() blank\n    text = text + \"\"\"\nint\nmain() {\n  %s\nreturn 0;\n}\n\"\"\" % (call or \"\")\n\n    if call:\n        i = call.find(\"\\n\")\n        if i > 0:\n            calltext = call[:i] + \"..\"\n        elif call[-1] == ';':\n            calltext = call[:-1]\n        else:\n            calltext = call\n\n    for lib_name in libs:\n\n        lang, suffix, msg = _lang2suffix(language)\n        if msg:\n            context.Display(\"Cannot check for library %s: %s\\n\" % (lib_name, msg))\n            return msg\n\n        # if a function was specified to run in main(), say it\n        if call:\n                context.Display(\"Checking for %s in %s library %s... \"\n                                % (calltext, lang, lib_name))\n        # otherwise, just say the name of library and language\n        else:\n                context.Display(\"Checking for %s library %s... \"\n                                % (lang, lib_name))\n\n        if lib_name:\n            l = [ lib_name ]\n            if extra_libs:\n                l.extend(extra_libs)\n            if append:\n                oldLIBS = context.AppendLIBS(l)\n            else:\n                oldLIBS = context.PrependLIBS(l)\n            sym = \"HAVE_LIB\" + lib_name\n        else:\n            oldLIBS = -1\n            sym = None\n\n        ret = context.BuildProg(text, suffix)\n\n        _YesNoResult(context, ret, sym, text,\n                     \"Define to 1 if you have the `%s' library.\" % lib_name)\n        if oldLIBS != -1 and (ret or not autoadd):\n            context.SetLIBS(oldLIBS)\n\n        if not ret:\n            return ret\n\n    return ret\n\ndef CheckProg(context, prog_name):\n    \"\"\"\n    Configure check for a specific program.\n\n    Check whether program prog_name exists in path.  If it is found,\n    returns the path for it, otherwise returns None.\n    \"\"\"\n    context.Display(\"Checking whether %s program exists...\" % prog_name)\n    path = context.env.WhereIs(prog_name)\n    if path:\n        context.Display(path + \"\\n\")\n    else:\n        context.Display(\"no\\n\")\n    return path\n\n\n#\n# END OF PUBLIC FUNCTIONS\n#\n\ndef _YesNoResult(context, ret, key, text, comment = None):\n    r\"\"\"\n    Handle the result of a test with a \"yes\" or \"no\" result.\n\n    :Parameters:\n      - `ret` is the return value: empty if OK, error message when not.\n      - `key` is the name of the symbol to be defined (HAVE_foo).\n      - `text` is the source code of the program used for testing.\n      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\\* \\*/). If None, no comment is added.\n    \"\"\"\n    if key:\n        _Have(context, key, not ret, comment)\n    if ret:\n        context.Display(\"no\\n\")\n        _LogFailed(context, text, ret)\n    else:\n        context.Display(\"yes\\n\")\n\n\ndef _Have(context, key, have, comment = None):\n    r\"\"\"\n    Store result of a test in context.havedict and context.headerfilename.\n\n    :Parameters:\n      - `key` - is a \"HAVE_abc\" name.  It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.\n      - `have`   - value as it should appear in the header file, include quotes when desired and escape special characters!\n      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\\* \\*/). If None, no comment is added.\n\n\n    The value of \"have\" can be:\n      - 1      - Feature is defined, add \"#define key\".\n      - 0      - Feature is not defined, add \"/\\* #undef key \\*/\". Adding \"undef\" is what autoconf does.  Not useful for the compiler, but it shows that the test was done.\n      - number - Feature is defined to this number \"#define key have\". Doesn't work for 0 or 1, use a string then.\n      - string - Feature is defined to this string \"#define key have\".\n\n\n    \"\"\"\n    key_up = key.upper()\n    key_up = re.sub('[^A-Z0-9_]', '_', key_up)\n    context.havedict[key_up] = have\n    if have == 1:\n        line = \"#define %s 1\\n\" % key_up\n    elif have == 0:\n        line = \"/* #undef %s */\\n\" % key_up\n    elif isinstance(have, int):\n        line = \"#define %s %d\\n\" % (key_up, have)\n    else:\n        line = \"#define %s %s\\n\" % (key_up, str(have))\n\n    if comment is not None:\n        lines = \"\\n/* %s */\\n\" % comment + line\n    else:\n        lines = \"\\n\" + line\n\n    if context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(lines)\n        f.close()\n    elif hasattr(context,'config_h'):\n        context.config_h = context.config_h + lines\n\n\ndef _LogFailed(context, text, msg):\n    \"\"\"\n    Write to the log about a failed program.\n    Add line numbers, so that error messages can be understood.\n    \"\"\"\n    if LogInputFiles:\n        context.Log(\"Failed program was:\\n\")\n        lines = text.split('\\n')\n        if len(lines) and lines[-1] == '':\n            lines = lines[:-1]              # remove trailing empty line\n        n = 1\n        for line in lines:\n            context.Log(\"%d: %s\\n\" % (n, line))\n            n = n + 1\n    if LogErrorMessages:\n        context.Log(\"Error message: %s\\n\" % msg)\n\n\ndef _lang2suffix(lang):\n    \"\"\"\n    Convert a language name to a suffix.\n    When \"lang\" is empty or None C is assumed.\n    Returns a tuple (lang, suffix, None) when it works.\n    For an unrecognized language returns (None, None, msg).\n\n    Where:\n      - lang   = the unified language name\n      - suffix = the suffix, including the leading dot\n      - msg    = an error message\n    \"\"\"\n    if not lang or lang in [\"C\", \"c\"]:\n        return (\"C\", \".c\", None)\n    if lang in [\"c++\", \"C++\", \"cpp\", \"CXX\", \"cxx\"]:\n        return (\"C++\", \".cpp\", None)\n\n    return None, None, \"Unsupported language: %s\" % lang\n\n\n# vim: set sw=4 et sts=4 tw=79 fo+=l:\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Debug.py",
    "content": "\"\"\"SCons.Debug\n\nCode for debugging SCons internal things.  Shouldn't be\nneeded by most users. Quick shortcuts:\n\nfrom SCons.Debug import caller_trace\ncaller_trace()\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Debug.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport sys\nimport time\nimport weakref\nimport inspect\n\n# Global variable that gets set to 'True' by the Main script,\n# when the creation of class instances should get tracked.\ntrack_instances = False\n# List of currently tracked classes\ntracked_classes = {}\n\ndef logInstanceCreation(instance, name=None):\n    if name is None:\n        name = instance.__class__.__name__\n    if name not in tracked_classes:\n        tracked_classes[name] = []\n    if hasattr(instance, '__dict__'):\n        tracked_classes[name].append(weakref.ref(instance))\n    else:\n        # weakref doesn't seem to work when the instance\n        # contains only slots...\n        tracked_classes[name].append(instance)\n\ndef string_to_classes(s):\n    if s == '*':\n        return sorted(tracked_classes.keys())\n    else:\n        return s.split()\n\ndef fetchLoggedInstances(classes=\"*\"):\n    classnames = string_to_classes(classes)\n    return [(cn, len(tracked_classes[cn])) for cn in classnames]\n  \ndef countLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write(\"%s: %d\\n\" % (classname, len(tracked_classes[classname])))\n\ndef listLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            if inspect.isclass(ref):\n                obj = ref()\n            else:\n                obj = ref\n            if obj is not None:\n                file.write('    %s\\n' % repr(obj))\n\ndef dumpLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            obj = ref()\n            if obj is not None:\n                file.write('    %s:\\n' % obj)\n                for key, value in obj.__dict__.items():\n                    file.write('        %20s : %s\\n' % (key, value))\n\n\n\nif sys.platform[:5] == \"linux\":\n    # Linux doesn't actually support memory usage stats from getrusage().\n    def memory():\n        with open('/proc/self/stat') as f:\n            mstr = f.read()\n        mstr = mstr.split()[22]\n        return int(mstr)\nelif sys.platform[:6] == 'darwin':\n    #TODO really get memory stats for OS X\n    def memory():\n        return 0\nelse:\n    try:\n        import resource\n    except ImportError:\n        try:\n            import win32process\n            import win32api\n        except ImportError:\n            def memory():\n                return 0\n        else:\n            def memory():\n                process_handle = win32api.GetCurrentProcess()\n                memory_info = win32process.GetProcessMemoryInfo( process_handle )\n                return memory_info['PeakWorkingSetSize']\n    else:\n        def memory():\n            res = resource.getrusage(resource.RUSAGE_SELF)\n            return res[4]\n\n# returns caller's stack\ndef caller_stack():\n    import traceback\n    tb = traceback.extract_stack()\n    # strip itself and the caller from the output\n    tb = tb[:-2]\n    result = []\n    for back in tb:\n        # (filename, line number, function name, text)\n        key = back[:3]\n        result.append('%s:%d(%s)' % func_shorten(key))\n    return result\n\ncaller_bases = {}\ncaller_dicts = {}\n\ndef caller_trace(back=0):\n    \"\"\"\n    Trace caller stack and save info into global dicts, which\n    are printed automatically at the end of SCons execution.\n    \"\"\"\n    global caller_bases, caller_dicts\n    import traceback\n    tb = traceback.extract_stack(limit=3+back)\n    tb.reverse()\n    callee = tb[1][:3]\n    caller_bases[callee] = caller_bases.get(callee, 0) + 1\n    for caller in tb[2:]:\n        caller = callee + caller[:3]\n        try:\n            entry = caller_dicts[callee]\n        except KeyError:\n            caller_dicts[callee] = entry = {}\n        entry[caller] = entry.get(caller, 0) + 1\n        callee = caller\n\n# print a single caller and its callers, if any\ndef _dump_one_caller(key, file, level=0):\n    leader = '      '*level\n    for v,c in sorted([(-v,c) for c,v in caller_dicts[key].items()]):\n        file.write(\"%s  %6d %s:%d(%s)\\n\" % ((leader,-v) + func_shorten(c[-3:])))\n        if c in caller_dicts:\n            _dump_one_caller(c, file, level+1)\n\n# print each call tree\ndef dump_caller_counts(file=sys.stdout):\n    for k in sorted(caller_bases.keys()):\n        file.write(\"Callers of %s:%d(%s), %d calls:\\n\"\n                    % (func_shorten(k) + (caller_bases[k],)))\n        _dump_one_caller(k, file)\n\nshorten_list = [\n    ( '/scons/SCons/',          1),\n    ( '/src/engine/SCons/',     1),\n    ( '/usr/lib/python',        0),\n]\n\nif os.sep != '/':\n    shorten_list = [(t[0].replace('/', os.sep), t[1]) for t in shorten_list]\n\ndef func_shorten(func_tuple):\n    f = func_tuple[0]\n    for t in shorten_list:\n        i = f.find(t[0])\n        if i >= 0:\n            if t[1]:\n                i = i + len(t[0])\n            return (f[i:],)+func_tuple[1:]\n    return func_tuple\n\n\nTraceFP = {}\nif sys.platform == 'win32':\n    TraceDefault = 'con'\nelse:\n    TraceDefault = '/dev/tty'\n\nTimeStampDefault = None\nStartTime = time.time()\nPreviousTime = StartTime\n\ndef Trace(msg, file=None, mode='w', tstamp=None):\n    \"\"\"Write a trace message to a file.  Whenever a file is specified,\n    it becomes the default for the next call to Trace().\"\"\"\n    global TraceDefault\n    global TimeStampDefault\n    global PreviousTime\n    if file is None:\n        file = TraceDefault\n    else:\n        TraceDefault = file\n    if tstamp is None:\n        tstamp = TimeStampDefault\n    else:\n        TimeStampDefault = tstamp\n    try:\n        fp = TraceFP[file]\n    except KeyError:\n        try:\n            fp = TraceFP[file] = open(file, mode)\n        except TypeError:\n            # Assume we were passed an open file pointer.\n            fp = file\n    if tstamp:\n        now = time.time()\n        fp.write('%8.4f %8.4f:  ' % (now - StartTime, now - PreviousTime))\n        PreviousTime = now\n    fp.write(msg)\n    fp.flush()\n    fp.close()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Defaults.py",
    "content": "\"\"\"SCons.Defaults\n\nBuilders and other things for the local site.  Here's where we'll\nduplicate the functionality of autoconf until we move it into the\ninstallation procedure or use something like qmconf.\n\nThe code that reads the registry to find MSVC components was borrowed\nfrom distutils.msvccompiler.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import division\n\n__revision__ = \"src/engine/SCons/Defaults.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\nimport os\nimport errno\nimport shutil\nimport stat\nimport time\nimport sys\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.CacheDir\nimport SCons.Environment\nimport SCons.PathList\nimport SCons.Subst\nimport SCons.Tool\n\n# A placeholder for a default Environment (for fetching source files\n# from source code management systems and the like).  This must be\n# initialized later, after the top-level directory is set by the calling\n# interface.\n_default_env = None\n\n# Lazily instantiate the default environment so the overhead of creating\n# it doesn't apply when it's not needed.\ndef _fetch_DefaultEnvironment(*args, **kw):\n    \"\"\"\n    Returns the already-created default construction environment.\n    \"\"\"\n    global _default_env\n    return _default_env\n\ndef DefaultEnvironment(*args, **kw):\n    \"\"\"\n    Initial public entry point for creating the default construction\n    Environment.\n\n    After creating the environment, we overwrite our name\n    (DefaultEnvironment) with the _fetch_DefaultEnvironment() function,\n    which more efficiently returns the initialized default construction\n    environment without checking for its existence.\n\n    (This function still exists with its _default_check because someone\n    else (*cough* Script/__init__.py *cough*) may keep a reference\n    to this function.  So we can't use the fully functional idiom of\n    having the name originally be a something that *only* creates the\n    construction environment and then overwrites the name.)\n    \"\"\"\n    global _default_env\n    if not _default_env:\n        import SCons.Util\n        _default_env = SCons.Environment.Environment(*args, **kw)\n        if SCons.Util.md5:\n            _default_env.Decider('MD5')\n        else:\n            _default_env.Decider('timestamp-match')\n        global DefaultEnvironment\n        DefaultEnvironment = _fetch_DefaultEnvironment\n        _default_env._CacheDir_path = None\n    return _default_env\n\n# Emitters for setting the shared attribute on object files,\n# and an action for checking that all of the source files\n# going into a shared library are, in fact, shared.\ndef StaticObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = None\n    return (target, source)\n\ndef SharedObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = 1\n    return (target, source)\n\ndef SharedFlagChecker(source, target, env):\n    same = env.subst('$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME')\n    if same == '0' or same == '' or same == 'False':\n        for src in source:\n            try:\n                shared = src.attributes.shared\n            except AttributeError:\n                shared = None\n            if not shared:\n                raise SCons.Errors.UserError(\"Source file: %s is static and is not compatible with shared target: %s\" % (src, target[0]))\n\nSharedCheck = SCons.Action.Action(SharedFlagChecker, None)\n\n# Some people were using these variable name before we made\n# SourceFileScanner part of the public interface.  Don't break their\n# SConscript files until we've given them some fair warning and a\n# transition period.\nCScan = SCons.Tool.CScanner\n# Nuitka: Avoid unused tools\n# DScan = SCons.Tool.DScanner\n# LaTeXScan = SCons.Tool.LaTeXScanner\n# ObjSourceScan = SCons.Tool.SourceFileScanner\nProgScan = SCons.Tool.ProgramScanner\n\n# These aren't really tool scanners, so they don't quite belong with\n# the rest of those in Tool/__init__.py, but I'm not sure where else\n# they should go.  Leave them here for now.\nimport SCons.Scanner.Dir\nDirScanner = SCons.Scanner.Dir.DirScanner()\nDirEntryScanner = SCons.Scanner.Dir.DirEntryScanner()\n\n# Actions for common languages.\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\")\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\")\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\")\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\")\n\nDAction = SCons.Action.Action(\"$DCOM\", \"$DCOMSTR\")\nShDAction = SCons.Action.Action(\"$SHDCOM\", \"$SHDCOMSTR\")\n\nASAction = SCons.Action.Action(\"$ASCOM\", \"$ASCOMSTR\")\nASPPAction = SCons.Action.Action(\"$ASPPCOM\", \"$ASPPCOMSTR\")\n\nLinkAction = SCons.Action.Action(\"$LINKCOM\", \"$LINKCOMSTR\")\nShLinkAction = SCons.Action.Action(\"$SHLINKCOM\", \"$SHLINKCOMSTR\")\n\nLdModuleLinkAction = SCons.Action.Action(\"$LDMODULECOM\", \"$LDMODULECOMSTR\")\n\n# Common tasks that we allow users to perform in platform-independent\n# ways by creating ActionFactory instances.\nActionFactory = SCons.Action.ActionFactory\n\ndef get_paths_str(dest):\n    # If dest is a list, we need to manually call str() on each element\n    if SCons.Util.is_List(dest):\n        elem_strs = []\n        for element in dest:\n            elem_strs.append('\"' + str(element) + '\"')\n        return '[' + ', '.join(elem_strs) + ']'\n    else:\n        return '\"' + str(dest) + '\"'\n\npermission_dic = {\n    'u':{\n        'r':stat.S_IRUSR,\n        'w':stat.S_IWUSR,\n        'x':stat.S_IXUSR\n    },\n    'g':{\n        'r':stat.S_IRGRP,\n        'w':stat.S_IWGRP,\n        'x':stat.S_IXGRP\n    },\n    'o':{\n        'r':stat.S_IROTH,\n        'w':stat.S_IWOTH,\n        'x':stat.S_IXOTH\n    }\n}\n\ndef chmod_func(dest, mode):\n    import SCons.Util\n    from string import digits\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    if SCons.Util.is_String(mode) and 0 not in [i in digits for i in mode]:\n        mode = int(mode, 8)\n    if not SCons.Util.is_String(mode):\n        for element in dest:\n            os.chmod(str(element), mode)\n    else:\n        mode = str(mode)\n        for operation in mode.split(\",\"):\n            if \"=\" in operation:\n                operator = \"=\"\n            elif \"+\" in operation:\n                operator = \"+\"\n            elif \"-\" in operation:\n                operator = \"-\"\n            else:\n                raise SyntaxError(\"Could not find +, - or =\")\n            operation_list = operation.split(operator)\n            if len(operation_list) != 2:\n                raise SyntaxError(\"More than one operator found\")\n            user = operation_list[0].strip().replace(\"a\", \"ugo\")\n            permission = operation_list[1].strip()\n            new_perm = 0\n            for u in user:\n                for p in permission:\n                    try:\n                        new_perm = new_perm | permission_dic[u][p]\n                    except KeyError:\n                        raise SyntaxError(\"Unrecognized user or permission format\")\n            for element in dest:\n                curr_perm = os.stat(str(element)).st_mode\n                if operator == \"=\":\n                    os.chmod(str(element), new_perm)\n                elif operator == \"+\":\n                    os.chmod(str(element), curr_perm | new_perm)\n                elif operator == \"-\":\n                    os.chmod(str(element), curr_perm & ~new_perm)\n\ndef chmod_strfunc(dest, mode):\n    import SCons.Util\n    if not SCons.Util.is_String(mode):\n        return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)\n    else:\n        return 'Chmod(%s, \"%s\")' % (get_paths_str(dest), str(mode))\n\nChmod = ActionFactory(chmod_func, chmod_strfunc)\n\ndef copy_func(dest, src, symlinks=True):\n    \"\"\"\n    If symlinks (is true), then a symbolic link will be\n    shallow copied and recreated as a symbolic link; otherwise, copying\n    a symbolic link will be equivalent to copying the symbolic link's\n    final target regardless of symbolic link depth.\n    \"\"\"\n\n    dest = str(dest)\n    src = str(src)\n\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if SCons.Util.is_List(src) and os.path.isdir(dest):\n        for file in src:\n            shutil.copy2(file, dest)\n        return 0\n    elif os.path.islink(src):\n        if symlinks:\n            return os.symlink(os.readlink(src), dest)\n        else:\n            return copy_func(dest, os.path.realpath(src))\n    elif os.path.isfile(src):\n        shutil.copy2(src, dest)\n        return 0\n    else:\n        shutil.copytree(src, dest, symlinks)\n        # copytree returns None in python2 and destination string in python3\n        # A error is raised in both cases, so we can just return 0 for success\n        return 0\n\nCopy = ActionFactory(\n    copy_func,\n    lambda dest, src, symlinks=True: 'Copy(\"%s\", \"%s\")' % (dest, src)\n)\n\ndef delete_func(dest, must_exist=0):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        entry = str(entry)\n        # os.path.exists returns False with broken links that exist\n        entry_exists = os.path.exists(entry) or os.path.islink(entry)\n        if not entry_exists and not must_exist:\n            continue\n        # os.path.isdir returns True when entry is a link to a dir\n        if os.path.isdir(entry) and not os.path.islink(entry):\n            shutil.rmtree(entry, 1)\n            continue\n        os.unlink(entry)\n\ndef delete_strfunc(dest, must_exist=0):\n    return 'Delete(%s)' % get_paths_str(dest)\n\nDelete = ActionFactory(delete_func, delete_strfunc)\n\ndef mkdir_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        try:\n            os.makedirs(str(entry))\n        except os.error as e:\n            p = str(entry)\n            if (e.args[0] == errno.EEXIST or\n                    (sys.platform=='win32' and e.args[0]==183)) \\\n                    and os.path.isdir(str(entry)):\n                pass            # not an error if already exists\n            else:\n                raise\n\nMkdir = ActionFactory(mkdir_func,\n                      lambda dir: 'Mkdir(%s)' % get_paths_str(dir))\n\ndef move_func(dest, src):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    SCons.Node.FS.invalidate_node_memos(src)\n    shutil.move(src, dest)\n\nMove = ActionFactory(move_func,\n                     lambda dest, src: 'Move(\"%s\", \"%s\")' % (dest, src),\n                     convert=str)\n\ndef touch_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for file in dest:\n        file = str(file)\n        mtime = int(time.time())\n        if os.path.exists(file):\n            atime = os.path.getatime(file)\n        else:\n            with open(file, 'w'):\n                atime = mtime\n        os.utime(file, (atime, mtime))\n\nTouch = ActionFactory(touch_func,\n                      lambda file: 'Touch(%s)' % get_paths_str(file))\n\n# Internal utility functions\n\n\ndef _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None):\n    \"\"\"\n    Creates a new list from 'list' by first interpolating each element\n    in the list using the 'env' dictionary and then calling f on the\n    list, and finally calling _concat_ixes to concatenate 'prefix' and\n    'suffix' onto each element of the list.\n    \"\"\"\n    if not list:\n        return list\n\n    l = f(SCons.PathList.PathList(list).subst_path(env, target, source))\n    if l is not None:\n        list = l\n\n    return _concat_ixes(prefix, list, suffix, env)\n\n\ndef _concat_ixes(prefix, list, suffix, env):\n    \"\"\"\n    Creates a new list from 'list' by concatenating the 'prefix' and\n    'suffix' arguments onto each element of the list.  A trailing space\n    on 'prefix' or leading space on 'suffix' will cause them to be put\n    into separate list elements rather than being concatenated.\n    \"\"\"\n\n    result = []\n\n    # ensure that prefix and suffix are strings\n    prefix = str(env.subst(prefix, SCons.Subst.SUBST_RAW))\n    suffix = str(env.subst(suffix, SCons.Subst.SUBST_RAW))\n\n    for x in list:\n        if isinstance(x, SCons.Node.FS.File):\n            result.append(x)\n            continue\n        x = str(x)\n        if x:\n\n            if prefix:\n                if prefix[-1] == ' ':\n                    result.append(prefix[:-1])\n                elif x[:len(prefix)] != prefix:\n                    x = prefix + x\n\n            result.append(x)\n\n            if suffix:\n                if suffix[0] == ' ':\n                    result.append(suffix[1:])\n                elif x[-len(suffix):] != suffix:\n                    result[-1] = result[-1]+suffix\n\n    return result\n\n\ndef _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):\n    \"\"\"\n    This is a wrapper around _concat()/_concat_ixes() that checks for\n    the existence of prefixes or suffixes on list items and strips them\n    where it finds them.  This is used by tools (like the GNU linker)\n    that need to turn something like 'libfoo.a' into '-lfoo'.\n    \"\"\"\n\n    if not itms:\n        return itms\n\n    if not callable(c):\n        env_c = env['_concat']\n        if env_c != _concat and callable(env_c):\n            # There's a custom _concat() method in the construction\n            # environment, and we've allowed people to set that in\n            # the past (see test/custom-concat.py), so preserve the\n            # backwards compatibility.\n            c = env_c\n        else:\n            c = _concat_ixes\n\n    stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes)))\n    stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes)))\n\n    stripped = []\n    for l in SCons.PathList.PathList(itms).subst_path(env, None, None):\n        if isinstance(l, SCons.Node.FS.File):\n            stripped.append(l)\n            continue\n\n        if not SCons.Util.is_String(l):\n            l = str(l)\n\n        for stripprefix in stripprefixes:\n            lsp = len(stripprefix)\n            if l[:lsp] == stripprefix:\n                l = l[lsp:]\n                # Do not strip more than one prefix\n                break\n\n        for stripsuffix in stripsuffixes:\n            lss = len(stripsuffix)\n            if l[-lss:] == stripsuffix:\n                l = l[:-lss]\n                # Do not strip more than one suffix\n                break\n\n        stripped.append(l)\n\n    return c(prefix, stripped, suffix, env)\n\ndef processDefines(defs):\n    \"\"\"process defines, resolving strings, lists, dictionaries, into a list of\n    strings\n    \"\"\"\n    if SCons.Util.is_List(defs):\n        l = []\n        for d in defs:\n            if d is None:\n                continue\n            elif SCons.Util.is_List(d) or isinstance(d, tuple):\n                if len(d) >= 2:\n                    l.append(str(d[0]) + '=' + str(d[1]))\n                else:\n                    l.append(str(d[0]))\n            elif SCons.Util.is_Dict(d):\n                for macro,value in d.items():\n                    if value is not None:\n                        l.append(str(macro) + '=' + str(value))\n                    else:\n                        l.append(str(macro))\n            elif SCons.Util.is_String(d):\n                l.append(str(d))\n            else:\n                raise SCons.Errors.UserError(\"DEFINE %s is not a list, dict, string or None.\"%repr(d))\n    elif SCons.Util.is_Dict(defs):\n        # The items in a dictionary are stored in random order, but\n        # if the order of the command-line options changes from\n        # invocation to invocation, then the signature of the command\n        # line will change and we'll get random unnecessary rebuilds.\n        # Consequently, we have to sort the keys to ensure a\n        # consistent order...\n        l = []\n        for k,v in sorted(defs.items()):\n            if v is None:\n                l.append(str(k))\n            else:\n                l.append(str(k) + '=' + str(v))\n    else:\n        l = [str(defs)]\n    return l\n\n\ndef _defines(prefix, defs, suffix, env, c=_concat_ixes):\n    \"\"\"A wrapper around _concat_ixes that turns a list or string\n    into a list of C preprocessor command-line definitions.\n    \"\"\"\n\n    return c(prefix, env.subst_path(processDefines(defs)), suffix, env)\n\n\nclass NullCmdGenerator(object):\n    \"\"\"This is a callable class that can be used in place of other\n    command generators if you don't want them to do anything.\n\n    The __call__ method for this class simply returns the thing\n    you instantiated it with.\n\n    Example usage:\n    env[\"DO_NOTHING\"] = NullCmdGenerator\n    env[\"LINKCOM\"] = \"${DO_NOTHING('$LINK $SOURCES $TARGET')}\"\n    \"\"\"\n\n    def __init__(self, cmd):\n        self.cmd = cmd\n\n    def __call__(self, target, source, env, for_signature=None):\n        return self.cmd\n\n\nclass Variable_Method_Caller(object):\n    \"\"\"A class for finding a construction variable on the stack and\n    calling one of its methods.\n\n    We use this to support \"construction variables\" in our string\n    eval()s that actually stand in for methods--specifically, use\n    of \"RDirs\" in call to _concat that should actually execute the\n    \"TARGET.RDirs\" method.  (We used to support this by creating a little\n    \"build dictionary\" that mapped RDirs to the method, but this got in\n    the way of Memoizing construction environments, because we had to\n    create new environment objects to hold the variables.)\n    \"\"\"\n    def __init__(self, variable, method):\n        self.variable = variable\n        self.method = method\n    def __call__(self, *args, **kw):\n        try: 1//0\n        except ZeroDivisionError:\n            # Don't start iterating with the current stack-frame to\n            # prevent creating reference cycles (f_back is safe).\n            frame = sys.exc_info()[2].tb_frame.f_back\n        variable = self.variable\n        while frame:\n            if variable in frame.f_locals:\n                v = frame.f_locals[variable]\n                if v:\n                    method = getattr(v, self.method)\n                    return method(*args, **kw)\n            frame = frame.f_back\n        return None\n\n# if $version_var is not empty, returns env[flags_var], otherwise returns None\ndef __libversionflags(env, version_var, flags_var):\n    try:\n        if env.subst('$'+version_var):\n            return env[flags_var]\n    except KeyError:\n        pass\n    return None\n\nConstructionEnvironment = {\n    'BUILDERS'      : {},\n    'SCANNERS'      : [ SCons.Tool.SourceFileScanner ],\n    'CONFIGUREDIR'  : '#/.sconf_temp',\n    'CONFIGURELOG'  : '#/config.log',\n    'CPPSUFFIXES'   : SCons.Tool.CSuffixes,\n    'DSUFFIXES'     : SCons.Tool.DSuffixes,\n    'ENV'           : {},\n    'IDLSUFFIXES'   : SCons.Tool.IDLSuffixes,\n    '_concat'       : _concat,\n    '_defines'      : _defines,\n    '_stripixes'    : _stripixes,\n    '_LIBFLAGS'     : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',\n    '_LIBDIRFLAGS'  : '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',\n    '_CPPINCFLAGS'  : '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',\n    '_CPPDEFFLAGS'  : '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',\n\n    '__libversionflags'      : __libversionflags,\n    '__SHLIBVERSIONFLAGS'    : '${__libversionflags(__env__,\"SHLIBVERSION\",\"_SHLIBVERSIONFLAGS\")}',\n    '__LDMODULEVERSIONFLAGS' : '${__libversionflags(__env__,\"LDMODULEVERSION\",\"_LDMODULEVERSIONFLAGS\")}',\n    '__DSHLIBVERSIONFLAGS'   : '${__libversionflags(__env__,\"DSHLIBVERSION\",\"_DSHLIBVERSIONFLAGS\")}',\n\n    'TEMPFILE'      : NullCmdGenerator,\n    'TEMPFILEARGJOIN': ' ',\n    'Dir'           : Variable_Method_Caller('TARGET', 'Dir'),\n    'Dirs'          : Variable_Method_Caller('TARGET', 'Dirs'),\n    'File'          : Variable_Method_Caller('TARGET', 'File'),\n    'RDirs'         : Variable_Method_Caller('TARGET', 'RDirs'),\n}\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Environment.py",
    "content": "\"\"\"SCons.Environment\n\nBase class for construction Environments.  These are\nthe primary objects used to communicate dependency and\nconstruction information to the build engine.\n\nKeyword arguments supplied when the construction Environment\nis created are construction variables used to initialize the\nEnvironment\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Environment.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\nimport copy\nimport os\nimport sys\nimport re\nimport shlex\nfrom collections import UserDict\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Defaults\nfrom SCons.Errors import UserError, BuildError\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Node.Python\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.SConsign\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\n\nclass _Null(object):\n    pass\n\n_null = _Null\n\n_warn_copy_deprecated = True\n_warn_source_signatures_deprecated = True\n_warn_target_signatures_deprecated = True\n\nCleanTargets = {}\nCalculatorArgs = {}\n\nsemi_deepcopy = SCons.Util.semi_deepcopy\nsemi_deepcopy_dict = SCons.Util.semi_deepcopy_dict\n\ndef alias_builder(env, target, source):\n    pass\n\nAliasBuilder = SCons.Builder.Builder(action = alias_builder,\n                                     target_factory = SCons.Node.Alias.default_ans.Alias,\n                                     source_factory = SCons.Node.FS.Entry,\n                                     multi = 1,\n                                     is_explicit = None,\n                                     name='AliasBuilder')\n\ndef apply_tools(env, tools, toolpath):\n    # Store the toolpath in the Environment.\n    if toolpath is not None:\n        env['toolpath'] = toolpath\n\n    if not tools:\n        return\n    # Filter out null tools from the list.\n    for tool in [_f for _f in tools if _f]:\n        if SCons.Util.is_List(tool) or isinstance(tool, tuple):\n            toolname = tool[0]\n            toolargs = tool[1] # should be a dict of kw args\n            tool = env.Tool(toolname, **toolargs)\n        else:\n            env.Tool(tool)\n\n# These names are (or will be) controlled by SCons; users should never\n# set or override them.  This warning can optionally be turned off,\n# but scons will still ignore the illegal variable names even if it's off.\nreserved_construction_var_names = [\n    'CHANGED_SOURCES',\n    'CHANGED_TARGETS',\n    'SOURCE',\n    'SOURCES',\n    'TARGET',\n    'TARGETS',\n    'UNCHANGED_SOURCES',\n    'UNCHANGED_TARGETS',\n]\n\nfuture_reserved_construction_var_names = [\n    #'HOST_OS',\n    #'HOST_ARCH',\n    #'HOST_CPU',\n    ]\n\ndef copy_non_reserved_keywords(dict):\n    result = semi_deepcopy(dict)\n    for k in list(result.keys()):\n        if k in reserved_construction_var_names:\n            msg = \"Ignoring attempt to set reserved variable `$%s'\"\n            SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k)\n            del result[k]\n    return result\n\ndef _set_reserved(env, key, value):\n    msg = \"Ignoring attempt to set reserved variable `$%s'\"\n    SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key)\n\ndef _set_future_reserved(env, key, value):\n    env._dict[key] = value\n    msg = \"`$%s' will be reserved in a future release and setting it will become ignored\"\n    SCons.Warnings.warn(SCons.Warnings.FutureReservedVariableWarning, msg % key)\n\ndef _set_BUILDERS(env, key, value):\n    try:\n        bd = env._dict[key]\n        for k in list(bd.keys()):\n            del bd[k]\n    except KeyError:\n        bd = BuilderDict(bd, env)\n        env._dict[key] = bd\n    for k, v in value.items():\n        if not SCons.Builder.is_a_Builder(v):\n            raise UserError('%s is not a Builder.' % repr(v))\n    bd.update(value)\n\ndef _del_SCANNERS(env, key):\n    del env._dict[key]\n    env.scanner_map_delete()\n\ndef _set_SCANNERS(env, key, value):\n    env._dict[key] = value\n    env.scanner_map_delete()\n\ndef _delete_duplicates(l, keep_last):\n    \"\"\"Delete duplicates from a sequence, keeping the first or last.\"\"\"\n    seen=set()\n    result=[]\n    if keep_last:           # reverse in & out, then keep first\n        l.reverse()\n    for i in l:\n        try:\n            if i not in seen:\n                result.append(i)\n                seen.add(i)\n        except TypeError:\n            # probably unhashable.  Just keep it.\n            result.append(i)\n    if keep_last:\n        result.reverse()\n    return result\n\n\n\n# The following is partly based on code in a comment added by Peter\n# Shannon at the following page (there called the \"transplant\" class):\n#\n# ASPN : Python Cookbook : Dynamically added methods to a class\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732\n#\n# We had independently been using the idiom as BuilderWrapper, but\n# factoring out the common parts into this base class, and making\n# BuilderWrapper a subclass that overrides __call__() to enforce specific\n# Builder calling conventions, simplified some of our higher-layer code.\n\nclass MethodWrapper(object):\n    \"\"\"\n    A generic Wrapper class that associates a method (which can\n    actually be any callable) with an object.  As part of creating this\n    MethodWrapper object an attribute with the specified (by default,\n    the name of the supplied method) is added to the underlying object.\n    When that new \"method\" is called, our __call__() method adds the\n    object as the first argument, simulating the Python behavior of\n    supplying \"self\" on method calls.\n\n    We hang on to the name by which the method was added to the underlying\n    base class so that we can provide a method to \"clone\" ourselves onto\n    a new underlying object being copied (without which we wouldn't need\n    to save that info).\n    \"\"\"\n    def __init__(self, object, method, name=None):\n        if name is None:\n            name = method.__name__\n        self.object = object\n        self.method = method\n        self.name = name\n        setattr(self.object, name, self)\n\n    def __call__(self, *args, **kwargs):\n        nargs = (self.object,) + args\n        return self.method(*nargs, **kwargs)\n\n    def clone(self, new_object):\n        \"\"\"\n        Returns an object that re-binds the underlying \"method\" to\n        the specified new object.\n        \"\"\"\n        return self.__class__(new_object, self.method, self.name)\n\nclass BuilderWrapper(MethodWrapper):\n    \"\"\"\n    A MethodWrapper subclass that that associates an environment with\n    a Builder.\n\n    This mainly exists to wrap the __call__() function so that all calls\n    to Builders can have their argument lists massaged in the same way\n    (treat a lone argument as the source, treat two arguments as target\n    then source, make sure both target and source are lists) without\n    having to have cut-and-paste code to do it.\n\n    As a bit of obsessive backwards compatibility, we also intercept\n    attempts to get or set the \"env\" or \"builder\" attributes, which were\n    the names we used before we put the common functionality into the\n    MethodWrapper base class.  We'll keep this around for a while in case\n    people shipped Tool modules that reached into the wrapper (like the\n    Tool/qt.py module does, or did).  There shouldn't be a lot attribute\n    fetching or setting on these, so a little extra work shouldn't hurt.\n    \"\"\"\n    def __call__(self, target=None, source=_null, *args, **kw):\n        if source is _null:\n            source = target\n            target = None\n        if target is not None and not SCons.Util.is_List(target):\n            target = [target]\n        if source is not None and not SCons.Util.is_List(source):\n            source = [source]\n        return MethodWrapper.__call__(self, target, source, *args, **kw)\n\n    def __repr__(self):\n        return '<BuilderWrapper %s>' % repr(self.name)\n\n    def __str__(self):\n        return self.__repr__()\n\n    def __getattr__(self, name):\n        if name == 'env':\n            return self.object\n        elif name == 'builder':\n            return self.method\n        else:\n            raise AttributeError(name)\n\n    def __setattr__(self, name, value):\n        if name == 'env':\n            self.object = value\n        elif name == 'builder':\n            self.method = value\n        else:\n            self.__dict__[name] = value\n\n    # This allows a Builder to be executed directly\n    # through the Environment to which it's attached.\n    # In practice, we shouldn't need this, because\n    # builders actually get executed through a Node.\n    # But we do have a unit test for this, and can't\n    # yet rule out that it would be useful in the\n    # future, so leave it for now.\n    #def execute(self, **kw):\n    #    kw['env'] = self.env\n    #    self.builder.execute(**kw)\n\nclass BuilderDict(UserDict):\n    \"\"\"This is a dictionary-like class used by an Environment to hold\n    the Builders.  We need to do this because every time someone changes\n    the Builders in the Environment's BUILDERS dictionary, we must\n    update the Environment's attributes.\"\"\"\n    def __init__(self, dict, env):\n        # Set self.env before calling the superclass initialization,\n        # because it will end up calling our other methods, which will\n        # need to point the values in this dictionary to self.env.\n        self.env = env\n        UserDict.__init__(self, dict)\n\n    def __semi_deepcopy__(self):\n        # These cannot be copied since they would both modify the same builder object, and indeed\n        # just copying would modify the original builder\n        raise TypeError( 'cannot semi_deepcopy a BuilderDict' )\n\n    def __setitem__(self, item, val):\n        try:\n            method = getattr(self.env, item).method\n        except AttributeError:\n            pass\n        else:\n            self.env.RemoveMethod(method)\n        UserDict.__setitem__(self, item, val)\n        BuilderWrapper(self.env, val, item)\n\n    def __delitem__(self, item):\n        UserDict.__delitem__(self, item)\n        delattr(self.env, item)\n\n    def update(self, dict):\n        for i, v in dict.items():\n            self.__setitem__(i, v)\n\n\n\n_is_valid_var = re.compile(r'[_a-zA-Z]\\w*$')\n\ndef is_valid_construction_var(varstr):\n    \"\"\"Return if the specified string is a legitimate construction\n    variable.\n    \"\"\"\n    return _is_valid_var.match(varstr)\n\n\n\nclass SubstitutionEnvironment(object):\n    \"\"\"Base class for different flavors of construction environments.\n\n    This class contains a minimal set of methods that handle construction\n    variable expansion and conversion of strings to Nodes, which may or\n    may not be actually useful as a stand-alone class.  Which methods\n    ended up in this class is pretty arbitrary right now.  They're\n    basically the ones which we've empirically determined are common to\n    the different construction environment subclasses, and most of the\n    others that use or touch the underlying dictionary of construction\n    variables.\n\n    Eventually, this class should contain all the methods that we\n    determine are necessary for a \"minimal\" interface to the build engine.\n    A full \"native Python\" SCons environment has gotten pretty heavyweight\n    with all of the methods and Tools and construction variables we've\n    jammed in there, so it would be nice to have a lighter weight\n    alternative for interfaces that don't need all of the bells and\n    whistles.  (At some point, we'll also probably rename this class\n    \"Base,\" since that more reflects what we want this class to become,\n    but because we've released comments that tell people to subclass\n    Environment.Base to create their own flavors of construction\n    environment, we'll save that for a future refactoring when this\n    class actually becomes useful.)\n    \"\"\"\n\n    def __init__(self, **kw):\n        \"\"\"Initialization of an underlying SubstitutionEnvironment class.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = kw.copy()\n        self._init_special()\n        self.added_methods = []\n        #self._memo = {}\n\n    def _init_special(self):\n        \"\"\"Initial the dispatch tables for special handling of\n        special construction variables.\"\"\"\n        self._special_del = {}\n        self._special_del['SCANNERS'] = _del_SCANNERS\n\n        self._special_set = {}\n        for key in reserved_construction_var_names:\n            self._special_set[key] = _set_reserved\n        for key in future_reserved_construction_var_names:\n            self._special_set[key] = _set_future_reserved\n        self._special_set['BUILDERS'] = _set_BUILDERS\n        self._special_set['SCANNERS'] = _set_SCANNERS\n\n        # Freeze the keys of self._special_set in a list for use by\n        # methods that need to check.  (Empirically, list scanning has\n        # gotten better than dict.has_key() in Python 2.5.)\n        self._special_set_keys = list(self._special_set.keys())\n\n    def __eq__(self, other):\n        return self._dict == other._dict\n\n    def __delitem__(self, key):\n        special = self._special_del.get(key)\n        if special:\n            special(self, key)\n        else:\n            del self._dict[key]\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __setitem__(self, key, value):\n        # This is heavily used.  This implementation is the best we have\n        # according to the timings in bench/env.__setitem__.py.\n        #\n        # The \"key in self._special_set_keys\" test here seems to perform\n        # pretty well for the number of keys we have.  A hard-coded\n        # list works a little better in Python 2.5, but that has the\n        # disadvantage of maybe getting out of sync if we ever add more\n        # variable names.  Using self._special_set.has_key() works a\n        # little better in Python 2.4, but is worse than this test.\n        # So right now it seems like a good trade-off, but feel free to\n        # revisit this with bench/env.__setitem__.py as needed (and\n        # as newer versions of Python come out).\n        if key in self._special_set_keys:\n            self._special_set[key](self, key, value)\n        else:\n            # If we already have the entry, then it's obviously a valid\n            # key and we don't need to check.  If we do check, using a\n            # global, pre-compiled regular expression directly is more\n            # efficient than calling another function or a method.\n            if key not in self._dict \\\n               and not _is_valid_var.match(key):\n                    raise UserError(\"Illegal construction variable `%s'\" % key)\n            self._dict[key] = value\n\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        return self._dict.get(key, default)\n\n    def has_key(self, key):\n        return key in self._dict\n\n    def __contains__(self, key):\n        return self._dict.__contains__(key)\n\n    def items(self):\n        return list(self._dict.items())\n\n    def arg2nodes(self, args, node_factory=_null, lookup_list=_null, **kw):\n        if node_factory is _null:\n            node_factory = self.fs.File\n        if lookup_list is _null:\n            lookup_list = self.lookup_list\n\n        if not args:\n            return []\n\n        args = SCons.Util.flatten(args)\n\n        nodes = []\n        for v in args:\n            if SCons.Util.is_String(v):\n                n = None\n                for l in lookup_list:\n                    n = l(v)\n                    if n is not None:\n                        break\n                if n is not None:\n                    if SCons.Util.is_String(n):\n                        # n = self.subst(n, raw=1, **kw)\n                        kw['raw'] = 1\n                        n = self.subst(n, **kw)\n                        if node_factory:\n                            n = node_factory(n)\n                    if SCons.Util.is_List(n):\n                        nodes.extend(n)\n                    else:\n                        nodes.append(n)\n                elif node_factory:\n                    # v = node_factory(self.subst(v, raw=1, **kw))\n                    kw['raw'] = 1\n                    v = node_factory(self.subst(v, **kw))\n                    if SCons.Util.is_List(v):\n                        nodes.extend(v)\n                    else:\n                        nodes.append(v)\n            else:\n                nodes.append(v)\n\n        return nodes\n\n    def gvars(self):\n        return self._dict\n\n    def lvars(self):\n        return {}\n\n    def subst(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Recursively interpolates construction variables from the\n        Environment into the specified string, returning the expanded\n        result.  Construction variables are specified by a $ prefix\n        in the string and begin with an initial underscore or\n        alphabetic character followed by any number of underscores\n        or alphanumeric characters.  The construction variable names\n        may be surrounded by curly braces to separate the name from\n        trailing characters.\n        \"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_kw(self, kw, raw=0, target=None, source=None):\n        nkw = {}\n        for k, v in kw.items():\n            k = self.subst(k, raw, target, source)\n            if SCons.Util.is_String(v):\n                v = self.subst(v, raw, target, source)\n            nkw[k] = v\n        return nkw\n\n    def subst_list(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Calls through to SCons.Subst.scons_subst_list().  See\n        the documentation for that function.\"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst_list(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_path(self, path, target=None, source=None):\n        \"\"\"Substitute a path list, turning EntryProxies into Nodes\n        and leaving Nodes (and other objects) as-is.\"\"\"\n\n        if not SCons.Util.is_List(path):\n            path = [path]\n\n        def s(obj):\n            \"\"\"This is the \"string conversion\" routine that we have our\n            substitutions use to return Nodes, not strings.  This relies\n            on the fact that an EntryProxy object has a get() method that\n            returns the underlying Node that it wraps, which is a bit of\n            architectural dependence that we might need to break or modify\n            in the future in response to additional requirements.\"\"\"\n            try:\n                get = obj.get\n            except AttributeError:\n                obj = SCons.Util.to_String_for_subst(obj)\n            else:\n                obj = get()\n            return obj\n\n        r = []\n        for p in path:\n            if SCons.Util.is_String(p):\n                p = self.subst(p, target=target, source=source, conv=s)\n                if SCons.Util.is_List(p):\n                    if len(p) == 1:\n                        p = p[0]\n                    else:\n                        # We have an object plus a string, or multiple\n                        # objects that we need to smush together.  No choice\n                        # but to make them into a string.\n                        p = ''.join(map(SCons.Util.to_String_for_subst, p))\n            else:\n                p = s(p)\n            r.append(p)\n        return r\n\n    subst_target_source = subst\n\n    def backtick(self, command):\n        import subprocess\n        # common arguments\n        kw = { 'stdin' : 'devnull',\n               'stdout' : subprocess.PIPE,\n               'stderr' : subprocess.PIPE,\n               'universal_newlines' : True,\n             }\n        # if the command is a list, assume it's been quoted\n        # othewise force a shell\n        if not SCons.Util.is_List(command): kw['shell'] = True\n        # run constructed command\n        p = SCons.Action._subproc(self, command, **kw)\n        out,err = p.communicate()\n        status = p.wait()\n        if err:\n            sys.stderr.write(u\"\" + err)\n        if status:\n            raise OSError(\"'%s' exited %d\" % (command, status))\n        return out\n\n    def AddMethod(self, function, name=None):\n        \"\"\"\n        Adds the specified function as a method of this construction\n        environment with the specified name.  If the name is omitted,\n        the default name is the name of the function itself.\n        \"\"\"\n        method = MethodWrapper(self, function, name)\n        self.added_methods.append(method)\n\n    def RemoveMethod(self, function):\n        \"\"\"\n        Removes the specified function's MethodWrapper from the\n        added_methods list, so we don't re-bind it when making a clone.\n        \"\"\"\n        self.added_methods = [dm for dm in self.added_methods if dm.method is not function]\n\n    def Override(self, overrides):\n        \"\"\"\n        Produce a modified environment whose variables are overridden by\n        the overrides dictionaries.  \"overrides\" is a dictionary that\n        will override the variables of this environment.\n\n        This function is much more efficient than Clone() or creating\n        a new Environment because it doesn't copy the construction\n        environment dictionary, it just wraps the underlying construction\n        environment, and doesn't even create a wrapper object if there\n        are no overrides.\n        \"\"\"\n        if not overrides: return self\n        o = copy_non_reserved_keywords(overrides)\n        if not o: return self\n        overrides = {}\n        merges = None\n        for key, value in o.items():\n            if key == 'parse_flags':\n                merges = value\n            else:\n                overrides[key] = SCons.Subst.scons_subst_once(value, self, key)\n        env = OverrideEnvironment(self, overrides)\n        if merges: env.MergeFlags(merges)\n        return env\n\n    def ParseFlags(self, *flags):\n        \"\"\"\n        Parse the set of flags and return a dict with the flags placed\n        in the appropriate entry.  The flags are treated as a typical\n        set of command-line flags for a GNU-like toolchain and used to\n        populate the entries in the dict immediately below.  If one of\n        the flag strings begins with a bang (exclamation mark), it is\n        assumed to be a command and the rest of the string is executed;\n        the result of that evaluation is then added to the dict.\n        \"\"\"\n        dict = {\n            'ASFLAGS'       : SCons.Util.CLVar(''),\n            'CFLAGS'        : SCons.Util.CLVar(''),\n            'CCFLAGS'       : SCons.Util.CLVar(''),\n            'CXXFLAGS'      : SCons.Util.CLVar(''),\n            'CPPDEFINES'    : [],\n            'CPPFLAGS'      : SCons.Util.CLVar(''),\n            'CPPPATH'       : [],\n            'FRAMEWORKPATH' : SCons.Util.CLVar(''),\n            'FRAMEWORKS'    : SCons.Util.CLVar(''),\n            'LIBPATH'       : [],\n            'LIBS'          : [],\n            'LINKFLAGS'     : SCons.Util.CLVar(''),\n            'RPATH'         : [],\n        }\n\n        def do_parse(arg):\n            # if arg is a sequence, recurse with each element\n            if not arg:\n                return\n\n            if not SCons.Util.is_String(arg):\n                for t in arg: do_parse(t)\n                return\n\n            # if arg is a command, execute it\n            if arg[0] == '!':\n                arg = self.backtick(arg[1:])\n\n            # utility function to deal with -D option\n            def append_define(name, dict = dict):\n                t = name.split('=')\n                if len(t) == 1:\n                    dict['CPPDEFINES'].append(name)\n                else:\n                    dict['CPPDEFINES'].append([t[0], '='.join(t[1:])])\n\n            # Loop through the flags and add them to the appropriate option.\n            # This tries to strike a balance between checking for all possible\n            # flags and keeping the logic to a finite size, so it doesn't\n            # check for some that don't occur often.  It particular, if the\n            # flag is not known to occur in a config script and there's a way\n            # of passing the flag to the right place (by wrapping it in a -W\n            # flag, for example) we don't check for it.  Note that most\n            # preprocessor options are not handled, since unhandled options\n            # are placed in CCFLAGS, so unless the preprocessor is invoked\n            # separately, these flags will still get to the preprocessor.\n            # Other options not currently handled:\n            #  -iqoutedir      (preprocessor search path)\n            #  -u symbol       (linker undefined symbol)\n            #  -s              (linker strip files)\n            #  -static*        (linker static binding)\n            #  -shared*        (linker dynamic binding)\n            #  -symbolic       (linker global binding)\n            #  -R dir          (deprecated linker rpath)\n            # IBM compilers may also accept -qframeworkdir=foo\n\n            params = shlex.split(arg)\n            append_next_arg_to = None   # for multi-word args\n            for arg in params:\n                if append_next_arg_to:\n                    if append_next_arg_to == 'CPPDEFINES':\n                        append_define(arg)\n                    elif append_next_arg_to == '-include':\n                        t = ('-include', self.fs.File(arg))\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-imacros':\n                        t = ('-imacros', self.fs.File(arg))\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-isysroot':\n                        t = ('-isysroot', arg)\n                        dict['CCFLAGS'].append(t)\n                        dict['LINKFLAGS'].append(t)\n                    elif append_next_arg_to == '-isystem':\n                        t = ('-isystem', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-iquote':\n                        t = ('-iquote', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-idirafter':\n                        t = ('-idirafter', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-arch':\n                        t = ('-arch', arg)\n                        dict['CCFLAGS'].append(t)\n                        dict['LINKFLAGS'].append(t)\n                    else:\n                        dict[append_next_arg_to].append(arg)\n                    append_next_arg_to = None\n                elif not arg[0] in ['-', '+']:\n                    dict['LIBS'].append(self.fs.File(arg))\n                elif arg == '-dylib_file':\n                    dict['LINKFLAGS'].append(arg)\n                    append_next_arg_to = 'LINKFLAGS'\n                elif arg[:2] == '-L':\n                    if arg[2:]:\n                        dict['LIBPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBPATH'\n                elif arg[:2] == '-l':\n                    if arg[2:]:\n                        dict['LIBS'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBS'\n                elif arg[:2] == '-I':\n                    if arg[2:]:\n                        dict['CPPPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPPATH'\n                elif arg[:4] == '-Wa,':\n                    dict['ASFLAGS'].append(arg[4:])\n                    dict['CCFLAGS'].append(arg)\n                elif arg[:4] == '-Wl,':\n                    if arg[:11] == '-Wl,-rpath=':\n                        dict['RPATH'].append(arg[11:])\n                    elif arg[:7] == '-Wl,-R,':\n                        dict['RPATH'].append(arg[7:])\n                    elif arg[:6] == '-Wl,-R':\n                        dict['RPATH'].append(arg[6:])\n                    else:\n                        dict['LINKFLAGS'].append(arg)\n                elif arg[:4] == '-Wp,':\n                    dict['CPPFLAGS'].append(arg)\n                elif arg[:2] == '-D':\n                    if arg[2:]:\n                        append_define(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPDEFINES'\n                elif arg == '-framework':\n                    append_next_arg_to = 'FRAMEWORKS'\n                elif arg[:14] == '-frameworkdir=':\n                    dict['FRAMEWORKPATH'].append(arg[14:])\n                elif arg[:2] == '-F':\n                    if arg[2:]:\n                        dict['FRAMEWORKPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'FRAMEWORKPATH'\n                elif arg in ['-mno-cygwin',\n                             '-pthread',\n                             '-openmp',\n                             '-fmerge-all-constants',\n                             '-fopenmp']:\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg == '-mwindows':\n                    dict['LINKFLAGS'].append(arg)\n                elif arg[:5] == '-std=':\n                    if '++' in arg[5:]:\n                        key='CXXFLAGS'\n                    else:\n                        key='CFLAGS'\n                    dict[key].append(arg)\n                elif arg[0] == '+':\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg in ['-include', '-imacros', '-isysroot', '-isystem', '-iquote', '-idirafter', '-arch']:\n                    append_next_arg_to = arg\n                else:\n                    dict['CCFLAGS'].append(arg)\n\n        for arg in flags:\n            do_parse(arg)\n        return dict\n\n    def MergeFlags(self, args, unique=1, dict=None):\n        \"\"\"\n        Merge the dict in args into the construction variables of this\n        env, or the passed-in dict.  If args is not a dict, it is\n        converted into a dict using ParseFlags.  If unique is not set,\n        the flags are appended rather than merged.\n        \"\"\"\n\n        if dict is None:\n            dict = self\n        if not SCons.Util.is_Dict(args):\n            args = self.ParseFlags(args)\n        if not unique:\n            self.Append(**args)\n            return self\n        for key, value in args.items():\n            if not value:\n                continue\n            try:\n                orig = self[key]\n            except KeyError:\n                orig = value\n            else:\n                if not orig:\n                    orig = value\n                elif value:\n                    # Add orig and value.  The logic here was lifted from\n                    # part of env.Append() (see there for a lot of comments\n                    # about the order in which things are tried) and is\n                    # used mainly to handle coercion of strings to CLVar to\n                    # \"do the right thing\" given (e.g.) an original CCFLAGS\n                    # string variable like '-pipe -Wall'.\n                    try:\n                        orig = orig + value\n                    except (KeyError, TypeError):\n                        try:\n                            add_to_orig = orig.append\n                        except AttributeError:\n                            value.insert(0, orig)\n                            orig = value\n                        else:\n                            add_to_orig(value)\n            t = []\n            if key[-4:] == 'PATH':\n                ### keep left-most occurence\n                for v in orig:\n                    if v not in t:\n                        t.append(v)\n            else:\n                ### keep right-most occurence\n                orig.reverse()\n                for v in orig:\n                    if v not in t:\n                        t.insert(0, v)\n            self[key] = t\n        return self\n\n\ndef default_decide_source(dependency, target, prev_ni, repo_node=None):\n    f = SCons.Defaults.DefaultEnvironment().decide_source\n    return f(dependency, target, prev_ni, repo_node)\n\n\ndef default_decide_target(dependency, target, prev_ni, repo_node=None):\n    f = SCons.Defaults.DefaultEnvironment().decide_target\n    return f(dependency, target, prev_ni, repo_node)\n\n\ndef default_copy_from_cache(src, dst):\n    f = SCons.Defaults.DefaultEnvironment().copy_from_cache\n    return f(src, dst)\n\n\nclass Base(SubstitutionEnvironment):\n    \"\"\"Base class for \"real\" construction Environments.  These are the\n    primary objects used to communicate dependency and construction\n    information to the build engine.\n\n    Keyword arguments supplied when the construction Environment\n    is created are construction variables used to initialize the\n    Environment.\n    \"\"\"\n\n    #######################################################################\n    # This is THE class for interacting with the SCons build engine,\n    # and it contains a lot of stuff, so we're going to try to keep this\n    # a little organized by grouping the methods.\n    #######################################################################\n\n    #######################################################################\n    # Methods that make an Environment act like a dictionary.  These have\n    # the expected standard names for Python mapping objects.  Note that\n    # we don't actually make an Environment a subclass of UserDict for\n    # performance reasons.  Note also that we only supply methods for\n    # dictionary functionality that we actually need and use.\n    #######################################################################\n\n    def __init__(self,\n                 platform=None,\n                 tools=None,\n                 toolpath=None,\n                 variables=None,\n                 parse_flags = None,\n                 **kw):\n        \"\"\"\n        Initialization of a basic SCons construction environment,\n        including setting up special construction variables like BUILDER,\n        PLATFORM, etc., and searching for and applying available Tools.\n\n        Note that we do *not* call the underlying base class\n        (SubsitutionEnvironment) initialization, because we need to\n        initialize things in a very specific order that doesn't work\n        with the much simpler base class initialization.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base')\n        self._memo = {}\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = semi_deepcopy(SCons.Defaults.ConstructionEnvironment)\n        self._init_special()\n        self.added_methods = []\n\n        # We don't use AddMethod, or define these as methods in this\n        # class, because we *don't* want these functions to be bound\n        # methods.  They need to operate independently so that the\n        # settings will work properly regardless of whether a given\n        # target ends up being built with a Base environment or an\n        # OverrideEnvironment or what have you.\n        self.decide_target = default_decide_target\n        self.decide_source = default_decide_source\n\n        self.copy_from_cache = default_copy_from_cache\n\n        self._dict['BUILDERS'] = BuilderDict(self._dict['BUILDERS'], self)\n\n        if platform is None:\n            platform = self._dict.get('PLATFORM', None)\n            if platform is None:\n                platform = SCons.Platform.Platform()\n        if SCons.Util.is_String(platform):\n            platform = SCons.Platform.Platform(platform)\n        self._dict['PLATFORM'] = str(platform)\n        platform(self)\n\n        self._dict['HOST_OS']      = self._dict.get('HOST_OS',None)\n        self._dict['HOST_ARCH']    = self._dict.get('HOST_ARCH',None)\n\n        # Now set defaults for TARGET_{OS|ARCH}\n        self._dict['TARGET_OS']      = self._dict.get('TARGET_OS',None)\n        self._dict['TARGET_ARCH']    = self._dict.get('TARGET_ARCH',None)\n\n\n        # Apply the passed-in and customizable variables to the\n        # environment before calling the tools, because they may use\n        # some of them during initialization.\n        if 'options' in kw:\n            # Backwards compatibility:  they may stll be using the\n            # old \"options\" keyword.\n            variables = kw['options']\n            del kw['options']\n        self.Replace(**kw)\n        keys = list(kw.keys())\n        if variables:\n            keys = keys + list(variables.keys())\n            variables.Update(self)\n\n        save = {}\n        for k in keys:\n            try:\n                save[k] = self._dict[k]\n            except KeyError:\n                # No value may have been set if they tried to pass in a\n                # reserved variable name like TARGETS.\n                pass\n\n        SCons.Tool.Initializers(self)\n\n        if tools is None:\n            tools = self._dict.get('TOOLS', None)\n            if tools is None:\n                tools = ['default']\n        apply_tools(self, tools, toolpath)\n\n        # Now restore the passed-in and customized variables\n        # to the environment, since the values the user set explicitly\n        # should override any values set by the tools.\n        for key, val in save.items():\n            self._dict[key] = val\n\n        # Finally, apply any flags to be merged in\n        if parse_flags: self.MergeFlags(parse_flags)\n\n    #######################################################################\n    # Utility methods that are primarily for internal use by SCons.\n    # These begin with lower-case letters.\n    #######################################################################\n\n    def get_builder(self, name):\n        \"\"\"Fetch the builder with the specified name from the environment.\n        \"\"\"\n        try:\n            return self._dict['BUILDERS'][name]\n        except KeyError:\n            return None\n\n    def get_CacheDir(self):\n        try:\n            path = self._CacheDir_path\n        except AttributeError:\n            path = SCons.Defaults.DefaultEnvironment()._CacheDir_path\n        try:\n            if path == self._last_CacheDir_path:\n                return self._last_CacheDir\n        except AttributeError:\n            pass\n        cd = SCons.CacheDir.CacheDir(path)\n        self._last_CacheDir_path = path\n        self._last_CacheDir = cd\n        return cd\n\n    def get_factory(self, factory, default='File'):\n        \"\"\"Return a factory function for creating Nodes for this\n        construction environment.\n        \"\"\"\n        name = default\n        try:\n            is_node = issubclass(factory, SCons.Node.FS.Base)\n        except TypeError:\n            # The specified factory isn't a Node itself--it's\n            # most likely None, or possibly a callable.\n            pass\n        else:\n            if is_node:\n                # The specified factory is a Node (sub)class.  Try to\n                # return the FS method that corresponds to the Node's\n                # name--that is, we return self.fs.Dir if they want a Dir,\n                # self.fs.File for a File, etc.\n                try: name = factory.__name__\n                except AttributeError: pass\n                else: factory = None\n        if not factory:\n            # They passed us None, or we picked up a name from a specified\n            # class, so return the FS method.  (Note that we *don't*\n            # use our own self.{Dir,File} methods because that would\n            # cause env.subst() to be called twice on the file name,\n            # interfering with files that have $$ in them.)\n            factory = getattr(self.fs, name)\n        return factory\n\n    @SCons.Memoize.CountMethodCall\n    def _gsm(self):\n        try:\n            return self._memo['_gsm']\n        except KeyError:\n            pass\n\n        result = {}\n\n        try:\n            scanners = self._dict['SCANNERS']\n        except KeyError:\n            pass\n        else:\n            # Reverse the scanner list so that, if multiple scanners\n            # claim they can scan the same suffix, earlier scanners\n            # in the list will overwrite later scanners, so that\n            # the result looks like a \"first match\" to the user.\n            if not SCons.Util.is_List(scanners):\n                scanners = [scanners]\n            else:\n                scanners = scanners[:] # copy so reverse() doesn't mod original\n            scanners.reverse()\n            for scanner in scanners:\n                for k in scanner.get_skeys(self):\n                    if k and self['PLATFORM'] == 'win32':\n                        k = k.lower()\n                    result[k] = scanner\n\n        self._memo['_gsm'] = result\n\n        return result\n\n    def get_scanner(self, skey):\n        \"\"\"Find the appropriate scanner given a key (usually a file suffix).\n        \"\"\"\n        if skey and self['PLATFORM'] == 'win32':\n            skey = skey.lower()\n        return self._gsm().get(skey)\n\n    def scanner_map_delete(self, kw=None):\n        \"\"\"Delete the cached scanner map (if we need to).\n        \"\"\"\n        try:\n            del self._memo['_gsm']\n        except KeyError:\n            pass\n\n    def _update(self, dict):\n        \"\"\"Update an environment's values directly, bypassing the normal\n        checks that occur when users try to set items.\n        \"\"\"\n        self._dict.update(dict)\n\n    def get_src_sig_type(self):\n        try:\n            return self.src_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().src_sig_type\n            self.src_sig_type = t\n            return t\n\n    def get_tgt_sig_type(self):\n        try:\n            return self.tgt_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().tgt_sig_type\n            self.tgt_sig_type = t\n            return t\n\n    #######################################################################\n    # Public methods for manipulating an Environment.  These begin with\n    # upper-case letters.  The essential characteristic of methods in\n    # this section is that they do *not* have corresponding same-named\n    # global functions.  For example, a stand-alone Append() function\n    # makes no sense, because Append() is all about appending values to\n    # an Environment's construction variables.\n    #######################################################################\n\n    def Append(self, **kw):\n        \"\"\"Append values to existing construction variables\n        in an Environment.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            # It would be easier on the eyes to write this using\n            # \"continue\" statements whenever we finish processing an item,\n            # but Python 1.5.2 apparently doesn't let you use \"continue\"\n            # within try:-except: blocks, so we have to nest our code.\n            try:\n                if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):\n                    self._dict[key] = [self._dict[key]]\n                orig = self._dict[key]\n            except KeyError:\n                # No existing variable in the environment, so just set\n                # it to the new value.\n                if key == 'CPPDEFINES' and SCons.Util.is_String(val):\n                    self._dict[key] = [val]\n                else:\n                    self._dict[key] = val\n            else:\n                try:\n                    # Check if the original looks like a dictionary.\n                    # If it is, we can't just try adding the value because\n                    # dictionaries don't have __add__() methods, and\n                    # things like UserList will incorrectly coerce the\n                    # original dict to a list (which we don't want).\n                    update_dict = orig.update\n                except AttributeError:\n                    try:\n                        # Most straightforward:  just try to add them\n                        # together.  This will work in most cases, when the\n                        # original and new values are of compatible types.\n                        self._dict[key] = orig + val\n                    except (KeyError, TypeError):\n                        try:\n                            # Check if the original is a list.\n                            add_to_orig = orig.append\n                        except AttributeError:\n                            # The original isn't a list, but the new\n                            # value is (by process of elimination),\n                            # so insert the original in the new value\n                            # (if there's one to insert) and replace\n                            # the variable with it.\n                            if orig:\n                                val.insert(0, orig)\n                            self._dict[key] = val\n                        else:\n                            # The original is a list, so append the new\n                            # value to it (if there's a value to append).\n                            if val:\n                                add_to_orig(val)\n                else:\n                    # The original looks like a dictionary, so update it\n                    # based on what we think the value looks like.\n                    if SCons.Util.is_List(val):\n                        if key == 'CPPDEFINES':\n                            tmp = []\n                            for (k, v) in orig.items():\n                                if v is not None:\n                                    tmp.append((k, v))\n                                else:\n                                    tmp.append((k,))\n                            orig = tmp\n                            orig += val\n                            self._dict[key] = orig\n                        else:\n                            for v in val:\n                                orig[v] = None\n                    else:\n                        try:\n                            update_dict(val)\n                        except (AttributeError, TypeError, ValueError):\n                            if SCons.Util.is_Dict(val):\n                                for k, v in val.items():\n                                    orig[k] = v\n                            else:\n                                orig[val] = None\n        self.scanner_map_delete(kw)\n\n    # allow Dirs and strings beginning with # for top-relative\n    # Note this uses the current env's fs (in self).\n    def _canonicalize(self, path):\n        if not SCons.Util.is_String(path): # typically a Dir\n            path = str(path)\n        if path and path[0] == '#':\n            path = str(self.fs.Dir(path))\n        return path\n\n    def AppendENVPath(self, name, newpath, envname = 'ENV',\n                      sep = os.pathsep, delete_existing=0):\n        \"\"\"Append path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the end (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = SCons.Util.AppendPath(orig, newpath, sep, delete_existing,\n                                   canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def AppendUnique(self, delete_existing=0, **kw):\n        \"\"\"Append values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to end.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if SCons.Util.is_List(val):\n                val = _delete_duplicates(val, delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif SCons.Util.is_Dict(self._dict[key]) and \\\n                 SCons.Util.is_Dict(val):\n                self._dict[key].update(val)\n            elif SCons.Util.is_List(val):\n                dk = self._dict[key]\n                if key == 'CPPDEFINES':\n                    tmp = []\n                    for i in val:\n                        if SCons.Util.is_List(i):\n                            if len(i) >= 2:\n                                tmp.append((i[0], i[1]))\n                            else:\n                                tmp.append((i[0],))\n                        elif SCons.Util.is_Tuple(i):\n                            tmp.append(i)\n                        else:\n                            tmp.append((i,))\n                    val = tmp\n                    # Construct a list of (key, value) tuples.\n                    if SCons.Util.is_Dict(dk):\n                        tmp = []\n                        for (k, v) in dk.items():\n                            if v is not None:\n                                tmp.append((k, v))\n                            else:\n                                tmp.append((k,))\n                        dk = tmp\n                    elif SCons.Util.is_String(dk):\n                        dk = [(dk,)]\n                    else:\n                        tmp = []\n                        for i in dk:\n                            if SCons.Util.is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif SCons.Util.is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                else:\n                    if not SCons.Util.is_List(dk):\n                        dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = dk + val\n            else:\n                dk = self._dict[key]\n                if SCons.Util.is_List(dk):\n                    if key == 'CPPDEFINES':\n                        tmp = []\n                        for i in dk:\n                            if SCons.Util.is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif SCons.Util.is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                        # Construct a list of (key, value) tuples.\n                        if SCons.Util.is_Dict(val):\n                            tmp = []\n                            for (k, v) in val.items():\n                                if v is not None:\n                                    tmp.append((k, v))\n                                else:\n                                    tmp.append((k,))\n                            val = tmp\n                        elif SCons.Util.is_String(val):\n                            val = [(val,)]\n                        if delete_existing:\n                            dk = list(filter(lambda x, val=val: x not in val, dk))\n                            self._dict[key] = dk + val\n                        else:\n                            dk = [x for x in dk if x not in val]\n                            self._dict[key] = dk + val\n                    else:\n                        # By elimination, val is not a list.  Since dk is a\n                        # list, wrap val in a list first.\n                        if delete_existing:\n                            dk = list(filter(lambda x, val=val: x not in val, dk))\n                            self._dict[key] = dk + [val]\n                        else:\n                            if val not in dk:\n                                self._dict[key] = dk + [val]\n                else:\n                    if key == 'CPPDEFINES':\n                        if SCons.Util.is_String(dk):\n                            dk = [dk]\n                        elif SCons.Util.is_Dict(dk):\n                            tmp = []\n                            for (k, v) in dk.items():\n                                if v is not None:\n                                    tmp.append((k, v))\n                                else:\n                                    tmp.append((k,))\n                            dk = tmp\n                        if SCons.Util.is_String(val):\n                            if val in dk:\n                                val = []\n                            else:\n                                val = [val]\n                        elif SCons.Util.is_Dict(val):\n                            tmp = []\n                            for i,j in val.items():\n                                if j is not None:\n                                    tmp.append((i,j))\n                                else:\n                                    tmp.append(i)\n                            val = tmp\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = dk + val\n        self.scanner_map_delete(kw)\n\n    def Clone(self, tools=[], toolpath=None, parse_flags = None, **kw):\n        \"\"\"Return a copy of a construction Environment.  The\n        copy is like a Python \"deep copy\"--that is, independent\n        copies are made recursively of each objects--except that\n        a reference is copied when an object is not deep-copyable\n        (like a function).  There are no references to any mutable\n        objects in the original Environment.\n        \"\"\"\n\n        builders = self._dict.get('BUILDERS', {})\n\n        clone = copy.copy(self)\n        # BUILDERS is not safe to do a simple copy\n        clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])\n        clone._dict['BUILDERS'] = BuilderDict(builders, clone)\n\n        # Check the methods added via AddMethod() and re-bind them to\n        # the cloned environment.  Only do this if the attribute hasn't\n        # been overwritten by the user explicitly and still points to\n        # the added method.\n        clone.added_methods = []\n        for mw in self.added_methods:\n            if mw == getattr(self, mw.name):\n                clone.added_methods.append(mw.clone(clone))\n\n        clone._memo = {}\n\n        # Apply passed-in variables before the tools\n        # so the tools can use the new variables\n        kw = copy_non_reserved_keywords(kw)\n        new = {}\n        for key, value in kw.items():\n            new[key] = SCons.Subst.scons_subst_once(value, self, key)\n        clone.Replace(**new)\n\n        apply_tools(clone, tools, toolpath)\n\n        # apply them again in case the tools overwrote them\n        clone.Replace(**new)\n\n        # Finally, apply any flags to be merged in\n        if parse_flags: clone.MergeFlags(parse_flags)\n\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone')\n        return clone\n\n    def _changed_build(self, dependency, target, prev_ni, repo_node=None):\n        if dependency.changed_state(target, prev_ni, repo_node):\n            return 1\n        return self.decide_source(dependency, target, prev_ni, repo_node)\n\n    def _changed_content(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_content(target, prev_ni, repo_node)\n\n    def _changed_source(self, dependency, target, prev_ni, repo_node=None):\n        target_env = dependency.get_build_env()\n        type = target_env.get_tgt_sig_type()\n        if type == 'source':\n            return target_env.decide_source(dependency, target, prev_ni, repo_node)\n        else:\n            return target_env.decide_target(dependency, target, prev_ni, repo_node)\n\n    def _changed_timestamp_then_content(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_then_content(target, prev_ni, repo_node)\n\n    def _changed_timestamp_newer(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_newer(target, prev_ni, repo_node)\n\n    def _changed_timestamp_match(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_match(target, prev_ni, repo_node)\n\n    def _copy_from_cache(self, src, dst):\n        return self.fs.copy(src, dst)\n\n    def _copy2_from_cache(self, src, dst):\n        return self.fs.copy2(src, dst)\n\n    def Decider(self, function):\n        copy_function = self._copy2_from_cache\n        if function in ('MD5', 'content'):\n            if not SCons.Util.md5:\n                raise UserError(\"MD5 signatures are not available in this version of Python.\")\n            function = self._changed_content\n        elif function == 'MD5-timestamp':\n            function = self._changed_timestamp_then_content\n        elif function in ('timestamp-newer', 'make'):\n            function = self._changed_timestamp_newer\n            copy_function = self._copy_from_cache\n        elif function == 'timestamp-match':\n            function = self._changed_timestamp_match\n        elif not callable(function):\n            raise UserError(\"Unknown Decider value %s\" % repr(function))\n\n        # We don't use AddMethod because we don't want to turn the\n        # function, which only expects three arguments, into a bound\n        # method, which would add self as an initial, fourth argument.\n        self.decide_target = function\n        self.decide_source = function\n\n        self.copy_from_cache = copy_function\n\n\n    def Detect(self, progs):\n        \"\"\"Return the first available program in progs.\n\n        :param progs: one or more command names to check for\n        :type progs: str or list\n        :returns str: first name from progs that can be found.\n\n        \"\"\"\n        if not SCons.Util.is_List(progs):\n            progs = [ progs ]\n        for prog in progs:\n            path = self.WhereIs(prog)\n            if path: return prog\n        return None\n\n\n    def Dictionary(self, *args):\n        \"\"\"Return construction variables from an environment.\n\n        :param *args: (optional) variable names to look up\n        :returns: if args omitted, the dictionary of all constr. vars.\n            If one arg, the corresponding value is returned.\n            If more than one arg, a list of values is returned.\n        :raises KeyError: if any of *args is not in the construction env.\n\n        \"\"\"\n        if not args:\n            return self._dict\n        dlist = [self._dict[x] for x in args]\n        if len(dlist) == 1:\n            dlist = dlist[0]\n        return dlist\n\n\n    def Dump(self, key=None):\n        \"\"\" Return pretty-printed string of construction variables.\n\n        :param key: if None, format the whole dict of variables.\n            Else look up and format just the value for key.\n\n        \"\"\"\n        import pprint\n        pp = pprint.PrettyPrinter(indent=2)\n        if key:\n            cvars = self.Dictionary(key)\n        else:\n            cvars = self.Dictionary()\n\n        # TODO: pprint doesn't do a nice job on path-style values\n        # if the paths contain spaces (i.e. Windows), because the\n        # algorithm tries to break lines on spaces, while breaking\n        # on the path-separator would be more \"natural\". Is there\n        # a better way to format those?\n        return pp.pformat(cvars)\n\n\n    def FindIxes(self, paths, prefix, suffix):\n        \"\"\"\n        Search a list of paths for something that matches the prefix and suffix.\n\n        paths - the list of paths or nodes.\n        prefix - construction variable for the prefix.\n        suffix - construction variable for the suffix.\n        \"\"\"\n\n        suffix = self.subst('$'+suffix)\n        prefix = self.subst('$'+prefix)\n\n        for path in paths:\n            dir,name = os.path.split(str(path))\n            if name[:len(prefix)] == prefix and name[-len(suffix):] == suffix:\n                return path\n\n    def ParseConfig(self, command, function=None, unique=1):\n        \"\"\"\n        Use the specified function to parse the output of the command\n        in order to modify the current environment.  The 'command' can\n        be a string or a list of strings representing a command and\n        its arguments.  'Function' is an optional argument that takes\n        the environment, the output of the command, and the unique flag.\n        If no function is specified, MergeFlags, which treats the output\n        as the result of a typical 'X-config' command (i.e. gtk-config),\n        will merge the output into the appropriate variables.\n        \"\"\"\n        if function is None:\n            def parse_conf(env, cmd, unique=unique):\n                return env.MergeFlags(cmd, unique)\n            function = parse_conf\n        if SCons.Util.is_List(command):\n            command = ' '.join(command)\n        command = self.subst(command)\n        return function(self, self.backtick(command))\n\n    def ParseDepends(self, filename, must_exist=None, only_one=0):\n        \"\"\"\n        Parse a mkdep-style file for explicit dependencies.  This is\n        completely abusable, and should be unnecessary in the \"normal\"\n        case of proper SCons configuration, but it may help make\n        the transition from a Make hierarchy easier for some people\n        to swallow.  It can also be genuinely useful when using a tool\n        that can write a .d file, but for which writing a scanner would\n        be too complicated.\n        \"\"\"\n        filename = self.subst(filename)\n        try:\n            with open(filename, 'r') as fp:\n                lines = SCons.Util.LogicalLines(fp).readlines()\n        except IOError:\n            if must_exist:\n                raise\n            return\n        lines = [l for l in lines if l[0] != '#']\n        tdlist = []\n        for line in lines:\n            try:\n                target, depends = line.split(':', 1)\n            except (AttributeError, ValueError):\n                # Throws AttributeError if line isn't a string.  Can throw\n                # ValueError if line doesn't split into two or more elements.\n                pass\n            else:\n                tdlist.append((target.split(), depends.split()))\n        if only_one:\n            targets = []\n            for td in tdlist:\n                targets.extend(td[0])\n            if len(targets) > 1:\n                raise UserError(\n                            \"More than one dependency target found in `%s':  %s\"\n                                            % (filename, targets))\n        for target, depends in tdlist:\n            self.Depends(target, depends)\n\n    def Platform(self, platform):\n        platform = self.subst(platform)\n        return SCons.Platform.Platform(platform)(self)\n\n    def Prepend(self, **kw):\n        \"\"\"Prepend values to existing construction variables\n        in an Environment.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            # It would be easier on the eyes to write this using\n            # \"continue\" statements whenever we finish processing an item,\n            # but Python 1.5.2 apparently doesn't let you use \"continue\"\n            # within try:-except: blocks, so we have to nest our code.\n            try:\n                orig = self._dict[key]\n            except KeyError:\n                # No existing variable in the environment, so just set\n                # it to the new value.\n                self._dict[key] = val\n            else:\n                try:\n                    # Check if the original looks like a dictionary.\n                    # If it is, we can't just try adding the value because\n                    # dictionaries don't have __add__() methods, and\n                    # things like UserList will incorrectly coerce the\n                    # original dict to a list (which we don't want).\n                    update_dict = orig.update\n                except AttributeError:\n                    try:\n                        # Most straightforward:  just try to add them\n                        # together.  This will work in most cases, when the\n                        # original and new values are of compatible types.\n                        self._dict[key] = val + orig\n                    except (KeyError, TypeError):\n                        try:\n                            # Check if the added value is a list.\n                            add_to_val = val.append\n                        except AttributeError:\n                            # The added value isn't a list, but the\n                            # original is (by process of elimination),\n                            # so insert the the new value in the original\n                            # (if there's one to insert).\n                            if val:\n                                orig.insert(0, val)\n                        else:\n                            # The added value is a list, so append\n                            # the original to it (if there's a value\n                            # to append).\n                            if orig:\n                                add_to_val(orig)\n                            self._dict[key] = val\n                else:\n                    # The original looks like a dictionary, so update it\n                    # based on what we think the value looks like.\n                    if SCons.Util.is_List(val):\n                        for v in val:\n                            orig[v] = None\n                    else:\n                        try:\n                            update_dict(val)\n                        except (AttributeError, TypeError, ValueError):\n                            if SCons.Util.is_Dict(val):\n                                for k, v in val.items():\n                                    orig[k] = v\n                            else:\n                                orig[val] = None\n        self.scanner_map_delete(kw)\n\n    def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,\n                       delete_existing=1):\n        \"\"\"Prepend path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the front (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = SCons.Util.PrependPath(orig, newpath, sep, delete_existing,\n                                    canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def PrependUnique(self, delete_existing=0, **kw):\n        \"\"\"Prepend values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to front.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if SCons.Util.is_List(val):\n                val = _delete_duplicates(val, not delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif SCons.Util.is_Dict(self._dict[key]) and \\\n                 SCons.Util.is_Dict(val):\n                self._dict[key].update(val)\n            elif SCons.Util.is_List(val):\n                dk = self._dict[key]\n                if not SCons.Util.is_List(dk):\n                    dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = val + dk\n            else:\n                dk = self._dict[key]\n                if SCons.Util.is_List(dk):\n                    # By elimination, val is not a list.  Since dk is a\n                    # list, wrap val in a list first.\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                        self._dict[key] = [val] + dk\n                    else:\n                        if val not in dk:\n                            self._dict[key] = [val] + dk\n                else:\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = val + dk\n        self.scanner_map_delete(kw)\n\n    def Replace(self, **kw):\n        \"\"\"Replace existing construction variables in an Environment\n        with new construction variables and/or values.\n        \"\"\"\n        try:\n            kwbd = kw['BUILDERS']\n        except KeyError:\n            pass\n        else:\n            kwbd = BuilderDict(kwbd,self)\n            del kw['BUILDERS']\n            self.__setitem__('BUILDERS', kwbd)\n        kw = copy_non_reserved_keywords(kw)\n        self._update(semi_deepcopy(kw))\n        self.scanner_map_delete(kw)\n\n    def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):\n        \"\"\"\n        Replace old_prefix with new_prefix and old_suffix with new_suffix.\n\n        env - Environment used to interpolate variables.\n        path - the path that will be modified.\n        old_prefix - construction variable for the old prefix.\n        old_suffix - construction variable for the old suffix.\n        new_prefix - construction variable for the new prefix.\n        new_suffix - construction variable for the new suffix.\n        \"\"\"\n        old_prefix = self.subst('$'+old_prefix)\n        old_suffix = self.subst('$'+old_suffix)\n\n        new_prefix = self.subst('$'+new_prefix)\n        new_suffix = self.subst('$'+new_suffix)\n\n        dir,name = os.path.split(str(path))\n        if name[:len(old_prefix)] == old_prefix:\n            name = name[len(old_prefix):]\n        if name[-len(old_suffix):] == old_suffix:\n            name = name[:-len(old_suffix)]\n        return os.path.join(dir, new_prefix+name+new_suffix)\n\n    def SetDefault(self, **kw):\n        for k in list(kw.keys()):\n            if k in self._dict:\n                del kw[k]\n        self.Replace(**kw)\n\n    def _find_toolpath_dir(self, tp):\n        return self.fs.Dir(self.subst(tp)).srcnode().get_abspath()\n\n    def Tool(self, tool, toolpath=None, **kw):\n        if SCons.Util.is_String(tool):\n            tool = self.subst(tool)\n            if toolpath is None:\n                toolpath = self.get('toolpath', [])\n            toolpath = list(map(self._find_toolpath_dir, toolpath))\n            tool = SCons.Tool.Tool(tool, toolpath, **kw)\n        tool(self)\n\n    def WhereIs(self, prog, path=None, pathext=None, reject=[]):\n        \"\"\"Find prog in the path.\n        \"\"\"\n        if path is None:\n            try:\n                path = self['ENV']['PATH']\n            except KeyError:\n                pass\n        elif SCons.Util.is_String(path):\n            path = self.subst(path)\n        if pathext is None:\n            try:\n                pathext = self['ENV']['PATHEXT']\n            except KeyError:\n                pass\n        elif SCons.Util.is_String(pathext):\n            pathext = self.subst(pathext)\n        prog = SCons.Util.CLVar(self.subst(prog)) # support \"program --with-args\"\n        path = SCons.Util.WhereIs(prog[0], path, pathext, reject)\n        if path: return path\n        return None\n\n    #######################################################################\n    # Public methods for doing real \"SCons stuff\" (manipulating\n    # dependencies, setting attributes on targets, etc.).  These begin\n    # with upper-case letters.  The essential characteristic of methods\n    # in this section is that they all *should* have corresponding\n    # same-named global functions.\n    #######################################################################\n\n    def Action(self, *args, **kw):\n        def subst_string(a, self=self):\n            if SCons.Util.is_String(a):\n                a = self.subst(a)\n            return a\n        nargs = list(map(subst_string, args))\n        nkw = self.subst_kw(kw)\n        return SCons.Action.Action(*nargs, **nkw)\n\n    def AddPreAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in list(uniq.keys()):\n            executor.add_pre_action(action)\n        return nodes\n\n    def AddPostAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in list(uniq.keys()):\n            executor.add_post_action(action)\n        return nodes\n\n    def Alias(self, target, source=[], action=None, **kw):\n        tlist = self.arg2nodes(target, self.ans.Alias)\n        if not SCons.Util.is_List(source):\n            source = [source]\n        source = [_f for _f in source if _f]\n\n        if not action:\n            if not source:\n                # There are no source files and no action, so just\n                # return a target list of classic Alias Nodes, without\n                # any builder.  The externally visible effect is that\n                # this will make the wrapping Script.BuildTask class\n                # say that there's \"Nothing to be done\" for this Alias,\n                # instead of that it's \"up to date.\"\n                return tlist\n\n            # No action, but there are sources.  Re-call all the target\n            # builders to add the sources to each target.\n            result = []\n            for t in tlist:\n                bld = t.get_builder(AliasBuilder)\n                result.extend(bld(self, t, source))\n            return result\n\n        nkw = self.subst_kw(kw)\n        nkw.update({\n            'action'            : SCons.Action.Action(action),\n            'source_factory'    : self.fs.Entry,\n            'multi'             : 1,\n            'is_explicit'       : None,\n        })\n        bld = SCons.Builder.Builder(**nkw)\n\n        # Apply the Builder separately to each target so that the Aliases\n        # stay separate.  If we did one \"normal\" Builder call with the\n        # whole target list, then all of the target Aliases would be\n        # associated under a single Executor.\n        result = []\n        for t in tlist:\n            # Calling the convert() method will cause a new Executor to be\n            # created from scratch, so we have to explicitly initialize\n            # it with the target's existing sources, plus our new ones,\n            # so nothing gets lost.\n            b = t.get_builder()\n            if b is None or b is AliasBuilder:\n                b = bld\n            else:\n                nkw['action'] = b.action + action\n                b = SCons.Builder.Builder(**nkw)\n            t.convert()\n            result.extend(b(self, t, t.sources + source))\n        return result\n\n    def AlwaysBuild(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_always_build()\n        return tlist\n\n    def Builder(self, **kw):\n        nkw = self.subst_kw(kw)\n        return SCons.Builder.Builder(**nkw)\n\n    def CacheDir(self, path):\n        import SCons.CacheDir\n        if path is not None:\n            path = self.subst(path)\n        self._CacheDir_path = path\n\n    def Clean(self, targets, files):\n        global CleanTargets\n        tlist = self.arg2nodes(targets, self.fs.Entry)\n        flist = self.arg2nodes(files, self.fs.Entry)\n        for t in tlist:\n            try:\n                CleanTargets[t].extend(flist)\n            except KeyError:\n                CleanTargets[t] = flist\n\n    def Configure(self, *args, **kw):\n        nargs = [self]\n        if args:\n            nargs = nargs + self.subst_list(args)[0]\n        nkw = self.subst_kw(kw)\n        nkw['_depth'] = kw.get('_depth', 0) + 1\n        try:\n            nkw['custom_tests'] = self.subst_kw(nkw['custom_tests'])\n        except KeyError:\n            pass\n        return SCons.SConf.SConf(*nargs, **nkw)\n\n    def Command(self, target, source, action, **kw):\n        \"\"\"Builds the supplied target files from the supplied\n        source files using the supplied action.  Action may\n        be any type that the Builder constructor will accept\n        for an action.\"\"\"\n        bkw = {\n            'action': action,\n            'target_factory': self.fs.Entry,\n            'source_factory': self.fs.Entry,\n        }\n        # source scanner\n        try:\n            bkw['source_scanner'] = kw['source_scanner']\n        except KeyError:\n            pass\n        else:\n            del kw['source_scanner']\n\n        # target scanner\n        try:\n            bkw['target_scanner'] = kw['target_scanner']\n        except KeyError:\n            pass\n        else:\n            del kw['target_scanner']\n\n        # source factory\n        try:\n            bkw['source_factory'] = kw['source_factory']\n        except KeyError:\n            pass\n        else:\n            del kw['source_factory']\n\n        # target factory\n        try:\n            bkw['target_factory'] = kw['target_factory']\n        except KeyError:\n            pass\n        else:\n            del kw['target_factory']\n            \n        bld = SCons.Builder.Builder(**bkw)\n        return bld(self, target, source, **kw)\n\n    def Depends(self, target, dependency):\n        \"\"\"Explicity specify that 'target's depend on 'dependency'.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_dependency(dlist)\n        return tlist\n\n    def Dir(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Dir(e, *args, **kw))\n            return result\n        return self.fs.Dir(s, *args, **kw)\n\n    def PyPackageDir(self, modulename):\n        s = self.subst(modulename)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.PyPackageDir(e))\n            return result\n        return self.fs.PyPackageDir(s)\n\n    def NoClean(self, *targets):\n        \"\"\"Tags a target so that it will not be cleaned by -c\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_noclean()\n        return tlist\n\n    def NoCache(self, *targets):\n        \"\"\"Tags a target so that it will not be cached\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_nocache()\n        return tlist\n\n    def Entry(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Entry(e, *args, **kw))\n            return result\n        return self.fs.Entry(s, *args, **kw)\n\n    def Environment(self, **kw):\n        return SCons.Environment.Environment(**self.subst_kw(kw))\n\n    def Execute(self, action, *args, **kw):\n        \"\"\"Directly execute an action through an Environment\n        \"\"\"\n        action = self.Action(action, *args, **kw)\n        result = action([], [], self)\n        if isinstance(result, BuildError):\n            errstr = result.errstr\n            if result.filename:\n                errstr = result.filename + ': ' + errstr\n            sys.stderr.write(\"scons: *** %s\\n\" % errstr)\n            return result.status\n        else:\n            return result\n\n    def File(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if SCons.Util.is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.File(e, *args, **kw))\n            return result\n        return self.fs.File(s, *args, **kw)\n\n    def FindFile(self, file, dirs):\n        file = self.subst(file)\n        nodes = self.arg2nodes(dirs, self.fs.Dir)\n        return SCons.Node.FS.find_file(file, tuple(nodes))\n\n    def Flatten(self, sequence):\n        return SCons.Util.flatten(sequence)\n\n    def GetBuildPath(self, files):\n        result = list(map(str, self.arg2nodes(files, self.fs.Entry)))\n        if SCons.Util.is_List(files):\n            return result\n        else:\n            return result[0]\n\n    def Glob(self, pattern, ondisk=True, source=False, strings=False, exclude=None):\n        return self.fs.Glob(self.subst(pattern), ondisk, source, strings, exclude)\n\n    def Ignore(self, target, dependency):\n        \"\"\"Ignore a dependency.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_ignore(dlist)\n        return tlist\n\n    def Literal(self, string):\n        return SCons.Subst.Literal(string)\n\n    def Local(self, *targets):\n        ret = []\n        for targ in targets:\n            if isinstance(targ, SCons.Node.Node):\n                targ.set_local()\n                ret.append(targ)\n            else:\n                for t in self.arg2nodes(targ, self.fs.Entry):\n                   t.set_local()\n                   ret.append(t)\n        return ret\n\n    def Precious(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_precious()\n        return tlist\n\n    def Pseudo(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_pseudo()\n        return tlist\n\n    def Repository(self, *dirs, **kw):\n        dirs = self.arg2nodes(list(dirs), self.fs.Dir)\n        self.fs.Repository(*dirs, **kw)\n\n    def Requires(self, target, prerequisite):\n        \"\"\"Specify that 'prerequisite' must be built before 'target',\n        (but 'target' does not actually depend on 'prerequisite'\n        and need not be rebuilt if it changes).\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        plist = self.arg2nodes(prerequisite, self.fs.Entry)\n        for t in tlist:\n            t.add_prerequisite(plist)\n        return tlist\n\n    def Scanner(self, *args, **kw):\n        nargs = []\n        for arg in args:\n            if SCons.Util.is_String(arg):\n                arg = self.subst(arg)\n            nargs.append(arg)\n        nkw = self.subst_kw(kw)\n        return SCons.Scanner.Base(*nargs, **nkw)\n\n    def SConsignFile(self, name=\".sconsign\", dbm_module=None):\n        if name is not None:\n            name = self.subst(name)\n            if not os.path.isabs(name):\n                name = os.path.join(str(self.fs.SConstruct_dir), name)\n        if name:\n            name = os.path.normpath(name)\n            sconsign_dir = os.path.dirname(name)\n            if sconsign_dir and not os.path.exists(sconsign_dir):\n                self.Execute(SCons.Defaults.Mkdir(sconsign_dir))\n        SCons.SConsign.File(name, dbm_module)\n\n    def SideEffect(self, side_effect, target):\n        \"\"\"Tell scons that side_effects are built as side\n        effects of building targets.\"\"\"\n        side_effects = self.arg2nodes(side_effect, self.fs.Entry)\n        targets = self.arg2nodes(target, self.fs.Entry)\n\n        for side_effect in side_effects:\n            if side_effect.multiple_side_effect_has_builder():\n                raise UserError(\"Multiple ways to build the same target were specified for: %s\" % str(side_effect))\n            side_effect.add_source(targets)\n            side_effect.side_effect = 1\n            self.Precious(side_effect)\n            for target in targets:\n                target.side_effects.append(side_effect)\n        return side_effects\n\n    def SourceCode(self, entry, builder):\n        \"\"\"Arrange for a source code builder for (part of) a tree.\"\"\"\n        msg = \"\"\"SourceCode() has been deprecated and there is no replacement.\n\\tIf you need this function, please contact scons-dev@scons.org\"\"\"\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceCodeWarning, msg)\n        entries = self.arg2nodes(entry, self.fs.Entry)\n        for entry in entries:\n            entry.set_src_builder(builder)\n        return entries\n\n    def Split(self, arg):\n        \"\"\"This function converts a string or list into a list of strings\n        or Nodes.  This makes things easier for users by allowing files to\n        be specified as a white-space separated list to be split.\n\n        The input rules are:\n            - A single string containing names separated by spaces. These will be\n              split apart at the spaces.\n            - A single Node instance\n            - A list containing either strings or Node instances. Any strings\n              in the list are not split at spaces.\n\n        In all cases, the function returns a list of Nodes and strings.\"\"\"\n\n        if SCons.Util.is_List(arg):\n            return list(map(self.subst, arg))\n        elif SCons.Util.is_String(arg):\n            return self.subst(arg).split()\n        else:\n            return [self.subst(arg)]\n\n    def Value(self, value, built_value=None):\n        \"\"\"\n        \"\"\"\n        return SCons.Node.Python.Value(value, built_value)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        variant_dir = self.arg2nodes(variant_dir, self.fs.Dir)[0]\n        src_dir = self.arg2nodes(src_dir, self.fs.Dir)[0]\n        self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n    def FindSourceFiles(self, node='.'):\n        \"\"\" returns a list of all source files.\n        \"\"\"\n        node = self.arg2nodes(node, self.fs.Entry)[0]\n\n        sources = []\n        def build_source(ss):\n            for s in ss:\n                if isinstance(s, SCons.Node.FS.Dir):\n                    build_source(s.all_children())\n                elif s.has_builder():\n                    build_source(s.sources)\n                elif isinstance(s.disambiguate(), SCons.Node.FS.File):\n                    sources.append(s)\n        build_source(node.all_children())\n\n        def final_source(node):\n            while (node != node.srcnode()):\n              node = node.srcnode()\n            return node\n        sources = list(map(final_source, sources))\n        # remove duplicates\n        return list(set(sources))\n\n    def FindInstalledFiles(self):\n        \"\"\" returns the list of all targets of the Install and InstallAs Builder.\n        \"\"\"\n        from SCons.Tool import install\n        if install._UNIQUE_INSTALLED_FILES is None:\n            install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)\n        return install._UNIQUE_INSTALLED_FILES\n\n\nclass OverrideEnvironment(Base):\n    \"\"\"A proxy that overrides variables in a wrapped construction\n    environment by returning values from an overrides dictionary in\n    preference to values from the underlying subject environment.\n\n    This is a lightweight (I hope) proxy that passes through most use of\n    attributes to the underlying Environment.Base class, but has just\n    enough additional methods defined to act like a real construction\n    environment with overridden values.  It can wrap either a Base\n    construction environment, or another OverrideEnvironment, which\n    can in turn nest arbitrary OverrideEnvironments...\n\n    Note that we do *not* call the underlying base class\n    (SubsitutionEnvironment) initialization, because we get most of those\n    from proxying the attributes of the subject construction environment.\n    But because we subclass SubstitutionEnvironment, this class also\n    has inherited arg2nodes() and subst*() methods; those methods can't\n    be proxied because they need *this* object's methods to fetch the\n    values from the overrides dictionary.\n    \"\"\"\n\n    def __init__(self, subject, overrides={}):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment')\n        self.__dict__['__subject'] = subject\n        self.__dict__['overrides'] = overrides\n\n    # Methods that make this class act like a proxy.\n    def __getattr__(self, name):\n        attr = getattr(self.__dict__['__subject'], name)\n        # Here we check if attr is one of the Wrapper classes. For\n        # example when a pseudo-builder is being called from an\n        # OverrideEnvironment.\n        #\n        # These wrappers when they're constructed capture the\n        # Environment they are being constructed with and so will not\n        # have access to overrided values. So we rebuild them with the\n        # OverrideEnvironment so they have access to overrided values.\n        if isinstance(attr, (MethodWrapper, BuilderWrapper)):\n            return attr.clone(self)\n        else:\n            return attr\n\n    def __setattr__(self, name, value):\n        setattr(self.__dict__['__subject'], name, value)\n\n    # Methods that make this class act like a dictionary.\n    def __getitem__(self, key):\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].__getitem__(key)\n    def __setitem__(self, key, value):\n        if not is_valid_construction_var(key):\n            raise UserError(\"Illegal construction variable `%s'\" % key)\n        self.__dict__['overrides'][key] = value\n    def __delitem__(self, key):\n        try:\n            del self.__dict__['overrides'][key]\n        except KeyError:\n            deleted = 0\n        else:\n            deleted = 1\n        try:\n            result = self.__dict__['__subject'].__delitem__(key)\n        except KeyError:\n            if not deleted:\n                raise\n            result = None\n        return result\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].get(key, default)\n    def has_key(self, key):\n        try:\n            self.__dict__['overrides'][key]\n            return 1\n        except KeyError:\n            return key in self.__dict__['__subject']\n    def __contains__(self, key):\n        if self.__dict__['overrides'].__contains__(key):\n            return 1\n        return self.__dict__['__subject'].__contains__(key)\n    def Dictionary(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        d = self.__dict__['__subject'].Dictionary().copy()\n        d.update(self.__dict__['overrides'])\n        return d\n    def items(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        return list(self.Dictionary().items())\n\n    # Overridden private construction environment methods.\n    def _update(self, dict):\n        \"\"\"Update an environment's values directly, bypassing the normal\n        checks that occur when users try to set items.\n        \"\"\"\n        self.__dict__['overrides'].update(dict)\n\n    def gvars(self):\n        return self.__dict__['__subject'].gvars()\n\n    def lvars(self):\n        lvars = self.__dict__['__subject'].lvars()\n        lvars.update(self.__dict__['overrides'])\n        return lvars\n\n    # Overridden public construction environment methods.\n    def Replace(self, **kw):\n        kw = copy_non_reserved_keywords(kw)\n        self.__dict__['overrides'].update(semi_deepcopy(kw))\n\n\n# The entry point that will be used by the external world\n# to refer to a construction environment.  This allows the wrapper\n# interface to extend a construction environment for its own purposes\n# by subclassing SCons.Environment.Base and then assigning the\n# class to SCons.Environment.Environment.\n\nEnvironment = Base\n\n\ndef NoSubstitutionProxy(subject):\n    \"\"\"\n    An entry point for returning a proxy subclass instance that overrides\n    the subst*() methods so they don't actually perform construction\n    variable substitution.  This is specifically intended to be the shim\n    layer in between global function calls (which don't want construction\n    variable substitution) and the DefaultEnvironment() (which would\n    substitute variables if left to its own devices).\n\n    We have to wrap this in a function that allows us to delay definition of\n    the class until it's necessary, so that when it subclasses Environment\n    it will pick up whatever Environment subclass the wrapper interface\n    might have assigned to SCons.Environment.Environment.\n    \"\"\"\n    class _NoSubstitutionProxy(Environment):\n        def __init__(self, subject):\n            self.__dict__['__subject'] = subject\n        def __getattr__(self, name):\n            return getattr(self.__dict__['__subject'], name)\n        def __setattr__(self, name, value):\n            return setattr(self.__dict__['__subject'], name, value)\n        def executor_to_lvars(self, kwdict):\n            if 'executor' in kwdict:\n                kwdict['lvars'] = kwdict['executor'].get_lvars()\n                del kwdict['executor']\n            else:\n                kwdict['lvars'] = {}\n        def raw_to_mode(self, dict):\n            try:\n                raw = dict['raw']\n            except KeyError:\n                pass\n            else:\n                del dict['raw']\n                dict['mode'] = raw\n        def subst(self, string, *args, **kwargs):\n            return string\n        def subst_kw(self, kw, *args, **kwargs):\n            return kw\n        def subst_list(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst_list(*nargs, **nkw)\n        def subst_target_source(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst(*nargs, **nkw)\n    return _NoSubstitutionProxy(subject)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Errors.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\"\"\"SCons.Errors\n\nThis file contains the exception classes used to handle internal\nand user errors in SCons.\n\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Errors.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport shutil\nimport SCons.Util\n\n\nclass BuildError(Exception):\n    \"\"\" Errors occurring while building.\n\n    BuildError have the following attributes:\n    =========================================\n\n    Information about the cause of the build error:\n    -----------------------------------------------\n\n    errstr : a description of the error message\n\n    status : the return code of the action that caused the build error.\n    Must be set to a non-zero value even if the build error is not due\n    to an action returning a non-zero returned code.\n\n    exitstatus : SCons exit status due to this build error.\n    Must be nonzero unless due to an explicit Exit()\n    call.  Not always the same as status, since\n    actions return a status code that should be\n    respected, but SCons typically exits with 2\n    irrespective of the return value of the failed\n    action.\n\n    filename : The name of the file or directory that caused the\n    build error. Set to None if no files are associated with\n    this error. This might be different from the target\n    being built. For example, failure to create the\n    directory in which the target file will appear. It\n    can be None if the error is not due to a particular\n    filename.\n\n    exc_info : Info about exception that caused the build\n    error. Set to (None, None, None) if this build\n    error is not due to an exception.\n\n\n    Information about the cause of the location of the error:\n    ---------------------------------------------------------\n\n    node : the error occured while building this target node(s)\n\n    executor : the executor that caused the build to fail (might\n               be None if the build failures is not due to the\n               executor failing)\n\n    action : the action that caused the build to fail (might be\n             None if the build failures is not due to the an\n             action failure)\n\n    command : the command line for the action that caused the\n              build to fail (might be None if the build failures\n              is not due to the an action failure)\n    \"\"\"\n\n    def __init__(self,\n                 node=None, errstr=\"Unknown error\", status=2, exitstatus=2,\n                 filename=None, executor=None, action=None, command=None,\n                 exc_info=(None, None, None)):\n\n        # py3: errstr should be string and not bytes.\n\n        self.errstr = SCons.Util.to_String(errstr)\n        self.status = status\n        self.exitstatus = exitstatus\n        self.filename = filename\n        self.exc_info = exc_info\n\n        self.node = node\n        self.executor = executor\n        self.action = action\n        self.command = command\n\n        Exception.__init__(self, node, errstr, status, exitstatus, filename,\n                           executor, action, command, exc_info)\n\n    def __str__(self):\n        if self.filename:\n            return self.filename + ': ' + self.errstr\n        else:\n            return self.errstr\n\nclass InternalError(Exception):\n    pass\n\nclass UserError(Exception):\n    pass\n\nclass StopError(Exception):\n    pass\n\nclass SConsEnvironmentError(Exception):\n    pass\n\nclass MSVCError(IOError):\n    pass\n\nclass ExplicitExit(Exception):\n    def __init__(self, node=None, status=None, *args):\n        self.node = node\n        self.status = status\n        self.exitstatus = status\n        Exception.__init__(self, *args)\n\ndef convert_to_BuildError(status, exc_info=None):\n    \"\"\"\n    Convert any return code a BuildError Exception.\n\n    :Parameters:\n      - `status`: can either be a return code or an Exception.\n\n    The buildError.status we set here will normally be\n    used as the exit status of the \"scons\" process.\n    \"\"\"\n\n    if not exc_info and isinstance(status, Exception):\n        exc_info = (status.__class__, status, None)\n\n\n    if isinstance(status, BuildError):\n        buildError = status\n        buildError.exitstatus = 2   # always exit with 2 on build errors\n    elif isinstance(status, ExplicitExit):\n        status = status.status\n        errstr = 'Explicit exit, status %s' % status\n        buildError = BuildError(\n            errstr=errstr,\n            status=status,      # might be 0, OK here\n            exitstatus=status,      # might be 0, OK here\n            exc_info=exc_info)\n    elif isinstance(status, (StopError, UserError)):\n        buildError = BuildError(\n            errstr=str(status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif isinstance(status, shutil.SameFileError):\n        # PY3 has a exception for when copying file to itself\n        # It's object provides info differently than below\n        try:\n            filename = status.filename\n        except AttributeError:\n            filename = None\n\n        buildError = BuildError(\n            errstr=status.args[0],\n            status=status.errno,\n            exitstatus=2,\n            filename=filename,\n            exc_info=exc_info)\n\n    elif isinstance(status, (SConsEnvironmentError, OSError, IOError)):\n        # If an IOError/OSError happens, raise a BuildError.\n        # Report the name of the file or directory that caused the\n        # error, which might be different from the target being built\n        # (for example, failure to create the directory in which the\n        # target file will appear).\n        filename = getattr(status, 'filename', None)\n        strerror = getattr(status, 'strerror', str(status))\n        errno = getattr(status, 'errno', 2)\n\n        buildError = BuildError(\n            errstr=strerror,\n            status=errno,\n            exitstatus=2,\n            filename=filename,\n            exc_info=exc_info)\n    elif isinstance(status, Exception):\n        buildError = BuildError(\n            errstr='%s : %s' % (status.__class__.__name__, status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif SCons.Util.is_String(status):\n        buildError = BuildError(\n            errstr=status,\n            status=2,\n            exitstatus=2)\n    else:\n        buildError = BuildError(\n            errstr=\"Error %s\" % status,\n            status=status,\n            exitstatus=2)\n\n    #import sys\n    #sys.stderr.write(\"convert_to_BuildError: status %s => (errstr %s, status %s)\\n\"%(status,buildError.errstr, buildError.status))\n    return buildError\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Executor.py",
    "content": "\"\"\"SCons.Executor\n\nA module for executing actions with specific lists of target and source\nNodes.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Executor.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport collections\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Util\nfrom SCons.compat import with_metaclass, NoSlotsPyPy\n\nclass Batch(object):\n    \"\"\"Remembers exact association between targets\n    and sources of executor.\"\"\"\n\n    __slots__ = ('targets',\n                 'sources')\n\n    def __init__(self, targets=[], sources=[]):\n        self.targets = targets\n        self.sources = sources\n\n\n\nclass TSList(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by wrapping\n    an executor Method.  This class is used in the Executor.lvars()\n    to delay creation of NodeList objects until they're needed.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        nl = self.func()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.func()\n        return nl[i]\n    def __getslice__(self, i, j):\n        nl = self.func()\n        i, j = max(i, 0), max(j, 0)\n        return nl[i:j]\n    def __str__(self):\n        nl = self.func()\n        return str(nl)\n    def __repr__(self):\n        nl = self.func()\n        return repr(nl)\n\nclass TSObject(object):\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by wrapping\n    an Executor method.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        n = self.func()\n        return getattr(n, attr)\n    def __str__(self):\n        n = self.func()\n        if n:\n            return str(n)\n        return ''\n    def __repr__(self):\n        n = self.func()\n        if n:\n            return repr(n)\n        return ''\n\ndef rfile(node):\n    \"\"\"\n    A function to return the results of a Node's rfile() method,\n    if it exists, and the Node itself otherwise (if it's a Value\n    Node, e.g.).\n    \"\"\"\n    try:\n        rfile = node.rfile\n    except AttributeError:\n        return node\n    else:\n        return rfile()\n\n\ndef execute_nothing(obj, target, kw):\n    return 0\n\ndef execute_action_list(obj, target, kw):\n    \"\"\"Actually execute the action list.\"\"\"\n    env = obj.get_build_env()\n    kw = obj.get_kw(kw)\n    status = 0\n    for act in obj.get_action_list():\n        args = ([], [], env)\n        status = act(*args, **kw)\n        if isinstance(status, SCons.Errors.BuildError):\n            status.executor = obj\n            raise status    # TODO pylint E0702: raising int not allowed\n        elif status:\n            msg = \"Error %s\" % status\n            raise SCons.Errors.BuildError(\n                errstr=msg,\n                node=obj.batches[0].targets,\n                executor=obj,\n                action=act)\n    return status\n\n_do_execute_map = {0 : execute_nothing,\n                   1 : execute_action_list}\n\n\ndef execute_actions_str(obj):\n    env = obj.get_build_env()\n    return \"\\n\".join([action.genstring(obj.get_all_targets(),\n                                       obj.get_all_sources(),\n                                       env)\n                      for action in obj.get_action_list()])\n\ndef execute_null_str(obj):\n    return ''\n\n_execute_str_map = {0 : execute_null_str,\n                    1 : execute_actions_str}\n\n\nclass Executor(object, with_metaclass(NoSlotsPyPy)):\n    \"\"\"A class for controlling instances of executing an action.\n\n    This largely exists to hold a single association of an action,\n    environment, list of environment override dictionaries, targets\n    and sources for later processing as needed.\n    \"\"\"\n\n    __slots__ = ('pre_actions',\n                 'post_actions',\n                 'env',\n                 'overridelist',\n                 'batches',\n                 'builder_kw',\n                 '_memo',\n                 'lvars',\n                 '_changed_sources_list',\n                 '_changed_targets_list',\n                 '_unchanged_sources_list',\n                 '_unchanged_targets_list',\n                 'action_list',\n                 '_do_execute',\n                 '_execute_str')\n\n    def __init__(self, action, env=None, overridelist=[{}],\n                 targets=[], sources=[], builder_kw={}):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor')\n        self.set_action_list(action)\n        self.pre_actions = []\n        self.post_actions = []\n        self.env = env\n        self.overridelist = overridelist\n        if targets or sources:\n            self.batches = [Batch(targets[:], sources[:])]\n        else:\n            self.batches = []\n        self.builder_kw = builder_kw\n        self._do_execute = 1\n        self._execute_str = 1\n        self._memo = {}\n\n    def get_lvars(self):\n        try:\n            return self.lvars\n        except AttributeError:\n            self.lvars = {\n                'CHANGED_SOURCES' : TSList(self._get_changed_sources),\n                'CHANGED_TARGETS' : TSList(self._get_changed_targets),\n                'SOURCE' : TSObject(self._get_source),\n                'SOURCES' : TSList(self._get_sources),\n                'TARGET' : TSObject(self._get_target),\n                'TARGETS' : TSList(self._get_targets),\n                'UNCHANGED_SOURCES' : TSList(self._get_unchanged_sources),\n                'UNCHANGED_TARGETS' : TSList(self._get_unchanged_targets),\n            }\n            return self.lvars\n\n    def _get_changes(self):\n        cs = []\n        ct = []\n        us = []\n        ut = []\n        for b in self.batches:\n            # don't add targets marked always build to unchanged lists\n            # add to changed list as they always need to build\n            if not b.targets[0].always_build and b.targets[0].is_up_to_date():\n                us.extend(list(map(rfile, b.sources)))\n                ut.extend(b.targets)\n            else:\n                cs.extend(list(map(rfile, b.sources)))\n                ct.extend(b.targets)\n        self._changed_sources_list = SCons.Util.NodeList(cs)\n        self._changed_targets_list = SCons.Util.NodeList(ct)\n        self._unchanged_sources_list = SCons.Util.NodeList(us)\n        self._unchanged_targets_list = SCons.Util.NodeList(ut)\n\n    def _get_changed_sources(self, *args, **kw):\n        try:\n            return self._changed_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_sources_list\n\n    def _get_changed_targets(self, *args, **kw):\n        try:\n            return self._changed_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_targets_list\n\n    def _get_source(self, *args, **kw):\n        return rfile(self.batches[0].sources[0]).get_subst_proxy()\n\n    def _get_sources(self, *args, **kw):\n        return SCons.Util.NodeList([rfile(n).get_subst_proxy() for n in self.get_all_sources()])\n\n    def _get_target(self, *args, **kw):\n        return self.batches[0].targets[0].get_subst_proxy()\n\n    def _get_targets(self, *args, **kw):\n        return SCons.Util.NodeList([n.get_subst_proxy() for n in self.get_all_targets()])\n\n    def _get_unchanged_sources(self, *args, **kw):\n        try:\n            return self._unchanged_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_sources_list\n\n    def _get_unchanged_targets(self, *args, **kw):\n        try:\n            return self._unchanged_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_targets_list\n\n    def get_action_targets(self):\n        if not self.action_list:\n            return []\n        targets_string = self.action_list[0].get_targets(self.env, self)\n        if targets_string[0] == '$':\n            targets_string = targets_string[1:]\n        return self.get_lvars()[targets_string]\n\n    def set_action_list(self, action):\n        import SCons.Util\n        if not SCons.Util.is_List(action):\n            if not action:\n                import SCons.Errors\n                raise SCons.Errors.UserError(\"Executor must have an action.\")\n            action = [action]\n        self.action_list = action\n\n    def get_action_list(self):\n        if self.action_list is None:\n            return []\n        return self.pre_actions + self.action_list + self.post_actions\n\n    def get_all_targets(self):\n        \"\"\"Returns all targets for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.targets)\n        return result\n\n    def get_all_sources(self):\n        \"\"\"Returns all sources for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.sources)\n        return result\n\n    def get_all_children(self):\n        \"\"\"Returns all unique children (dependencies) for all batches\n        of this Executor.\n\n        The Taskmaster can recognize when it's already evaluated a\n        Node, so we don't have to make this list unique for its intended\n        canonical use case, but we expect there to be a lot of redundancy\n        (long lists of batched .cc files #including the same .h files\n        over and over), so removing the duplicates once up front should\n        save the Taskmaster a lot of work.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            result.extend(target.children())\n        return result\n\n    def get_all_prerequisites(self):\n        \"\"\"Returns all unique (order-only) prerequisites for all batches\n        of this Executor.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            if target.prerequisites is not None:\n                result.extend(target.prerequisites)\n        return result\n\n    def get_action_side_effects(self):\n\n        \"\"\"Returns all side effects for all batches of this\n        Executor used by the underlying Action.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_action_targets():\n            result.extend(target.side_effects)\n        return result\n\n    @SCons.Memoize.CountMethodCall\n    def get_build_env(self):\n        \"\"\"Fetch or create the appropriate build Environment\n        for this Executor.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n\n        # Create the build environment instance with appropriate\n        # overrides.  These get evaluated against the current\n        # environment's construction variables so that users can\n        # add to existing values by referencing the variable in\n        # the expansion.\n        overrides = {}\n        for odict in self.overridelist:\n            overrides.update(odict)\n\n        import SCons.Defaults\n        env = self.env or SCons.Defaults.DefaultEnvironment()\n        build_env = env.Override(overrides)\n\n        self._memo['get_build_env'] = build_env\n\n        return build_env\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the scanner path for this executor's targets and sources.\n        \"\"\"\n        env = self.get_build_env()\n        try:\n            cwd = self.batches[0].targets[0].cwd\n        except (IndexError, AttributeError):\n            cwd = None\n        return scanner.path(env, cwd,\n                            self.get_all_targets(),\n                            self.get_all_sources())\n\n    def get_kw(self, kw={}):\n        result = self.builder_kw.copy()\n        result.update(kw)\n        result['executor'] = self\n        return result\n\n    # use extra indirection because with new-style objects (Python 2.2\n    # and above) we can't override special methods, and nullify() needs\n    # to be able to do this.\n\n    def __call__(self, target, **kw):\n        return _do_execute_map[self._do_execute](self, target, kw)\n\n    def cleanup(self):\n        self._memo = {}\n\n    def add_sources(self, sources):\n        \"\"\"Add source files to this Executor's list.  This is necessary\n        for \"multi\" Builders that can be called repeatedly to build up\n        a source file list for a given target.\"\"\"\n        # TODO(batch):  extend to multiple batches\n        assert (len(self.batches) == 1)\n        # TODO(batch):  remove duplicates?\n        sources = [x for x in sources if x not in self.batches[0].sources]\n        self.batches[0].sources.extend(sources)\n\n    def get_sources(self):\n        return self.batches[0].sources\n\n    def add_batch(self, targets, sources):\n        \"\"\"Add pair of associated target and source to this Executor's list.\n        This is necessary for \"batch\" Builders that can be called repeatedly\n        to build up a list of matching target and source files that will be\n        used in order to update multiple target files at once from multiple\n        corresponding source files, for tools like MSVC that support it.\"\"\"\n        self.batches.append(Batch(targets, sources))\n\n    def prepare(self):\n        \"\"\"\n        Preparatory checks for whether this Executor can go ahead\n        and (try to) build its targets.\n        \"\"\"\n        for s in self.get_all_sources():\n            if s.missing():\n                msg = \"Source `%s' not found, needed by target `%s'.\"\n                raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))\n\n    def add_pre_action(self, action):\n        self.pre_actions.append(action)\n\n    def add_post_action(self, action):\n        self.post_actions.append(action)\n\n    # another extra indirection for new-style objects and nullify...\n\n    def __str__(self):\n        return _execute_str_map[self._execute_str](self)\n\n    def nullify(self):\n        self.cleanup()\n        self._do_execute = 0\n        self._execute_str = 0\n\n    @SCons.Memoize.CountMethodCall\n    def get_contents(self):\n        \"\"\"Fetch the signature contents.  This is the main reason this\n        class exists, so we can compute this once and cache it regardless\n        of how many target or source Nodes there are.\n\n        Returns bytes\n        \"\"\"\n        try:\n            return self._memo['get_contents']\n        except KeyError:\n            pass\n        env = self.get_build_env()\n\n        action_list = self.get_action_list()\n        all_targets = self.get_all_targets()\n        all_sources = self.get_all_sources()\n\n        result = bytearray(\"\",'utf-8').join([action.get_contents(all_targets,\n                                                                 all_sources,\n                                                                 env)\n                                             for action in action_list])\n\n        self._memo['get_contents'] = result\n        return result\n\n    def get_timestamp(self):\n        \"\"\"Fetch a time stamp for this Executor.  We don't have one, of\n        course (only files do), but this is the interface used by the\n        timestamp module.\n        \"\"\"\n        return 0\n\n    def scan_targets(self, scanner):\n        # TODO(batch):  scan by batches\n        self.scan(scanner, self.get_all_targets())\n\n    def scan_sources(self, scanner):\n        # TODO(batch):  scan by batches\n        if self.batches[0].sources:\n            self.scan(scanner, self.get_all_sources())\n\n    def scan(self, scanner, node_list):\n        \"\"\"Scan a list of this Executor's files (targets or sources) for\n        implicit dependencies and update all of the targets with them.\n        This essentially short-circuits an N*M scan of the sources for\n        each individual target, which is a hell of a lot more efficient.\n        \"\"\"\n        env = self.get_build_env()\n        path = self.get_build_scanner_path\n        kw = self.get_kw()\n\n        # TODO(batch):  scan by batches)\n        deps = []\n\n        for node in node_list:\n            node.disambiguate()\n            deps.extend(node.get_implicit_deps(env, scanner, path, kw))\n\n        deps.extend(self.get_implicit_deps())\n\n        for tgt in self.get_all_targets():\n            tgt.add_to_implicit(deps)\n\n    def _get_unignored_sources_key(self, node, ignore=()):\n        return (node,) + tuple(ignore)\n\n    @SCons.Memoize.CountDictCall(_get_unignored_sources_key)\n    def get_unignored_sources(self, node, ignore=()):\n        key = (node,) + tuple(ignore)\n        try:\n            memo_dict = self._memo['get_unignored_sources']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_unignored_sources'] = memo_dict\n        else:\n            try:\n                return memo_dict[key]\n            except KeyError:\n                pass\n\n        if node:\n            # TODO:  better way to do this (it's a linear search,\n            # but it may not be critical path)?\n            sourcelist = []\n            for b in self.batches:\n                if node in b.targets:\n                    sourcelist = b.sources\n                    break\n        else:\n            sourcelist = self.get_all_sources()\n        if ignore:\n            idict = {}\n            for i in ignore:\n                idict[i] = 1\n            sourcelist = [s for s in sourcelist if s not in idict]\n\n        memo_dict[key] = sourcelist\n\n        return sourcelist\n\n    def get_implicit_deps(self):\n        \"\"\"Return the executor's implicit dependencies, i.e. the nodes of\n        the commands to be executed.\"\"\"\n        result = []\n        build_env = self.get_build_env()\n        for act in self.get_action_list():\n            deps = act.get_implicit_deps(self.get_all_targets(),\n                                         self.get_all_sources(),\n                                         build_env)\n            result.extend(deps)\n        return result\n\n\n\n_batch_executors = {}\n\ndef GetBatchExecutor(key):\n    return _batch_executors[key]\n\ndef AddBatchExecutor(key, executor):\n    assert key not in _batch_executors\n    _batch_executors[key] = executor\n\nnullenv = None\n\n\nclass NullEnvironment(SCons.Util.Null):\n    import SCons.CacheDir\n    _CacheDir_path = None\n    _CacheDir = SCons.CacheDir.CacheDir(None)\n    def get_CacheDir(self):\n        return self._CacheDir\n\n\ndef get_NullEnvironment():\n    \"\"\"Use singleton pattern for Null Environments.\"\"\"\n    global nullenv\n\n    if nullenv is None:\n        nullenv = NullEnvironment()\n    return nullenv\n\nclass Null(object, with_metaclass(NoSlotsPyPy)):\n    \"\"\"A null Executor, with a null build Environment, that does\n    nothing when the rest of the methods call it.\n\n    This might be able to disappear when we refactor things to\n    disassociate Builders from Nodes entirely, so we're not\n    going to worry about unit tests for this--at least for now.\n    \"\"\"\n\n    __slots__ = ('pre_actions',\n                 'post_actions',\n                 'env',\n                 'overridelist',\n                 'batches',\n                 'builder_kw',\n                 '_memo',\n                 'lvars',\n                 '_changed_sources_list',\n                 '_changed_targets_list',\n                 '_unchanged_sources_list',\n                 '_unchanged_targets_list',\n                 'action_list',\n                 '_do_execute',\n                 '_execute_str')\n\n    def __init__(self, *args, **kw):\n        if SCons.Debug.track_instances:\n            logInstanceCreation(self, 'Executor.Null')\n        self.batches = [Batch(kw['targets'][:], [])]\n    def get_build_env(self):\n        return get_NullEnvironment()\n    def get_build_scanner_path(self):\n        return None\n    def cleanup(self):\n        pass\n    def prepare(self):\n        pass\n    def get_unignored_sources(self, *args, **kw):\n        return tuple(())\n    def get_action_targets(self):\n        return []\n    def get_action_list(self):\n        return []\n    def get_all_targets(self):\n        return self.batches[0].targets\n    def get_all_sources(self):\n        return self.batches[0].targets[0].sources\n    def get_all_children(self):\n        return self.batches[0].targets[0].children()\n    def get_all_prerequisites(self):\n        return []\n    def get_action_side_effects(self):\n        return []\n    def __call__(self, *args, **kw):\n        return 0\n    def get_contents(self):\n        return ''\n    def _morph(self):\n        \"\"\"Morph this Null executor to a real Executor object.\"\"\"\n        batches = self.batches\n        self.__class__ = Executor\n        self.__init__([])\n        self.batches = batches\n\n    # The following methods require morphing this Null Executor to a\n    # real Executor object.\n\n    def add_pre_action(self, action):\n        self._morph()\n        self.add_pre_action(action)\n    def add_post_action(self, action):\n        self._morph()\n        self.add_post_action(action)\n    def set_action_list(self, action):\n        self._morph()\n        self.set_action_list(action)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Job.py",
    "content": "\"\"\"SCons.Job\n\nThis module defines the Serial and Parallel classes that execute tasks to\ncomplete a build. The Jobs class provides a higher level interface to start,\nstop, and wait on jobs.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Job.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.compat\n\nimport os\nimport signal\n\nimport SCons.Errors\n\n# The default stack size (in kilobytes) of the threads used to execute\n# jobs in parallel.\n#\n# We use a stack size of 256 kilobytes. The default on some platforms\n# is too large and prevents us from creating enough threads to fully\n# parallelized the build. For example, the default stack size on linux\n# is 8 MBytes.\n\nexplicit_stack_size = None\ndefault_stack_size = 256\n\ninterrupt_msg = 'Build interrupted.'\n\n\nclass InterruptState(object):\n    def __init__(self):\n        self.interrupted = False\n\n    def set(self):\n        self.interrupted = True\n\n    def __call__(self):\n        return self.interrupted\n\n\nclass Jobs(object):\n    \"\"\"An instance of this class initializes N jobs, and provides\n    methods for starting, stopping, and waiting on all N jobs.\n    \"\"\"\n\n    def __init__(self, num, taskmaster):\n        \"\"\"\n        Create 'num' jobs using the given taskmaster.\n\n        If 'num' is 1 or less, then a serial job will be used,\n        otherwise a parallel job with 'num' worker threads will\n        be used.\n\n        The 'num_jobs' attribute will be set to the actual number of jobs\n        allocated.  If more than one job is requested but the Parallel\n        class can't do it, it gets reset to 1.  Wrapping interfaces that\n        care should check the value of 'num_jobs' after initialization.\n        \"\"\"\n\n        self.job = None\n        if num > 1:\n            stack_size = explicit_stack_size\n            if stack_size is None:\n                stack_size = default_stack_size\n\n            try:\n                self.job = Parallel(taskmaster, num, stack_size)\n                self.num_jobs = num\n            except NameError:\n                pass\n        if self.job is None:\n            self.job = Serial(taskmaster)\n            self.num_jobs = 1\n\n    def run(self, postfunc=lambda: None):\n        \"\"\"Run the jobs.\n\n        postfunc() will be invoked after the jobs has run. It will be\n        invoked even if the jobs are interrupted by a keyboard\n        interrupt (well, in fact by a signal such as either SIGINT,\n        SIGTERM or SIGHUP). The execution of postfunc() is protected\n        against keyboard interrupts and is guaranteed to run to\n        completion.\"\"\"\n        self._setup_sig_handler()\n        try:\n            self.job.start()\n        finally:\n            postfunc()\n            self._reset_sig_handler()\n\n    def were_interrupted(self):\n        \"\"\"Returns whether the jobs were interrupted by a signal.\"\"\"\n        return self.job.interrupted()\n\n    def _setup_sig_handler(self):\n        \"\"\"Setup an interrupt handler so that SCons can shutdown cleanly in\n        various conditions:\n\n          a) SIGINT: Keyboard interrupt\n          b) SIGTERM: kill or system shutdown\n          c) SIGHUP: Controlling shell exiting\n\n        We handle all of these cases by stopping the taskmaster. It\n        turns out that it's very difficult to stop the build process\n        by throwing asynchronously an exception such as\n        KeyboardInterrupt. For example, the python Condition\n        variables (threading.Condition) and queues do not seem to be\n        asynchronous-exception-safe. It would require adding a whole\n        bunch of try/finally block and except KeyboardInterrupt all\n        over the place.\n\n        Note also that we have to be careful to handle the case when\n        SCons forks before executing another process. In that case, we\n        want the child to exit immediately.\n        \"\"\"\n        def handler(signum, stack, self=self, parentpid=os.getpid()):\n            if os.getpid() == parentpid:\n                self.job.taskmaster.stop()\n                self.job.interrupted.set()\n            else:\n                os._exit(2)\n\n        self.old_sigint  = signal.signal(signal.SIGINT, handler)\n        self.old_sigterm = signal.signal(signal.SIGTERM, handler)\n        try:\n            self.old_sighup = signal.signal(signal.SIGHUP, handler)\n        except AttributeError:\n            pass\n\n    def _reset_sig_handler(self):\n        \"\"\"Restore the signal handlers to their previous state (before the\n         call to _setup_sig_handler().\"\"\"\n\n        signal.signal(signal.SIGINT, self.old_sigint)\n        signal.signal(signal.SIGTERM, self.old_sigterm)\n        try:\n            signal.signal(signal.SIGHUP, self.old_sighup)\n        except AttributeError:\n            pass\n\nclass Serial(object):\n    \"\"\"This class is used to execute tasks in series, and is more efficient\n    than Parallel, but is only appropriate for non-parallel builds. Only\n    one instance of this class should be in existence at a time.\n\n    This class is not thread safe.\n    \"\"\"\n\n    def __init__(self, taskmaster):\n        \"\"\"Create a new serial job given a taskmaster.\n\n        The taskmaster's next_task() method should return the next task\n        that needs to be executed, or None if there are no more tasks. The\n        taskmaster's executed() method will be called for each task when it\n        is successfully executed, or failed() will be called if it failed to\n        execute (e.g. execute() raised an exception).\"\"\"\n\n        self.taskmaster = taskmaster\n        self.interrupted = InterruptState()\n\n    def start(self):\n        \"\"\"Start the job. This will begin pulling tasks from the taskmaster\n        and executing them, and return when there are no more tasks. If a task\n        fails to execute (i.e. execute() raises an exception), then the job will\n        stop.\"\"\"\n\n        while True:\n            task = self.taskmaster.next_task()\n\n            if task is None:\n                break\n\n            try:\n                task.prepare()\n                if task.needs_execute():\n                    task.execute()\n            except Exception:\n                if self.interrupted():\n                    try:\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    except:\n                        task.exception_set()\n                else:\n                    task.exception_set()\n\n                # Let the failed() callback function arrange for the\n                # build to stop if that's appropriate.\n                task.failed()\n            else:\n                task.executed()\n\n            task.postprocess()\n        self.taskmaster.cleanup()\n\n\n# Trap import failure so that everything in the Job module but the\n# Parallel class (and its dependent classes) will work if the interpreter\n# doesn't support threads.\ntry:\n    import queue\n    import threading\nexcept ImportError:\n    pass\nelse:\n    class Worker(threading.Thread):\n        \"\"\"A worker thread waits on a task to be posted to its request queue,\n        dequeues the task, executes it, and posts a tuple including the task\n        and a boolean indicating whether the task executed successfully. \"\"\"\n\n        def __init__(self, requestQueue, resultsQueue, interrupted):\n            threading.Thread.__init__(self)\n            self.setDaemon(1)\n            self.requestQueue = requestQueue\n            self.resultsQueue = resultsQueue\n            self.interrupted = interrupted\n            self.start()\n\n        def run(self):\n            while True:\n                task = self.requestQueue.get()\n\n                if task is None:\n                    # The \"None\" value is used as a sentinel by\n                    # ThreadPool.cleanup().  This indicates that there\n                    # are no more tasks, so we should quit.\n                    break\n\n                try:\n                    if self.interrupted():\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    task.execute()\n                except:\n                    task.exception_set()\n                    ok = False\n                else:\n                    ok = True\n\n                self.resultsQueue.put((task, ok))\n\n    class ThreadPool(object):\n        \"\"\"This class is responsible for spawning and managing worker threads.\"\"\"\n\n        def __init__(self, num, stack_size, interrupted):\n            \"\"\"Create the request and reply queues, and 'num' worker threads.\n\n            One must specify the stack size of the worker threads. The\n            stack size is specified in kilobytes.\n            \"\"\"\n            self.requestQueue = queue.Queue(0)\n            self.resultsQueue = queue.Queue(0)\n\n            try:\n                prev_size = threading.stack_size(stack_size*1024)\n            except AttributeError as e:\n                # Only print a warning if the stack size has been\n                # explicitly set.\n                if explicit_stack_size is not None:\n                    msg = \"Setting stack size is unsupported by this version of Python:\\n    \" + \\\n                        e.args[0]\n                    SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n            except ValueError as e:\n                msg = \"Setting stack size failed:\\n    \" + str(e)\n                SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n\n            # Create worker threads\n            self.workers = []\n            for _ in range(num):\n                worker = Worker(self.requestQueue, self.resultsQueue, interrupted)\n                self.workers.append(worker)\n\n            if 'prev_size' in locals():\n                threading.stack_size(prev_size)\n\n        def put(self, task):\n            \"\"\"Put task into request queue.\"\"\"\n            self.requestQueue.put(task)\n\n        def get(self):\n            \"\"\"Remove and return a result tuple from the results queue.\"\"\"\n            return self.resultsQueue.get()\n\n        def preparation_failed(self, task):\n            self.resultsQueue.put((task, False))\n\n        def cleanup(self):\n            \"\"\"\n            Shuts down the thread pool, giving each worker thread a\n            chance to shut down gracefully.\n            \"\"\"\n            # For each worker thread, put a sentinel \"None\" value\n            # on the requestQueue (indicating that there's no work\n            # to be done) so that each worker thread will get one and\n            # terminate gracefully.\n            for _ in self.workers:\n                self.requestQueue.put(None)\n\n            # Wait for all of the workers to terminate.\n            #\n            # If we don't do this, later Python versions (2.4, 2.5) often\n            # seem to raise exceptions during shutdown.  This happens\n            # in requestQueue.get(), as an assertion failure that\n            # requestQueue.not_full is notified while not acquired,\n            # seemingly because the main thread has shut down (or is\n            # in the process of doing so) while the workers are still\n            # trying to pull sentinels off the requestQueue.\n            #\n            # Normally these terminations should happen fairly quickly,\n            # but we'll stick a one-second timeout on here just in case\n            # someone gets hung.\n            for worker in self.workers:\n                worker.join(1.0)\n            self.workers = []\n\n    class Parallel(object):\n        \"\"\"This class is used to execute tasks in parallel, and is somewhat\n        less efficient than Serial, but is appropriate for parallel builds.\n\n        This class is thread safe.\n        \"\"\"\n\n        def __init__(self, taskmaster, num, stack_size):\n            \"\"\"Create a new parallel job given a taskmaster.\n\n            The taskmaster's next_task() method should return the next\n            task that needs to be executed, or None if there are no more\n            tasks. The taskmaster's executed() method will be called\n            for each task when it is successfully executed, or failed()\n            will be called if the task failed to execute (i.e. execute()\n            raised an exception).\n\n            Note: calls to taskmaster are serialized, but calls to\n            execute() on distinct tasks are not serialized, because\n            that is the whole point of parallel jobs: they can execute\n            multiple tasks simultaneously. \"\"\"\n\n            self.taskmaster = taskmaster\n            self.interrupted = InterruptState()\n            self.tp = ThreadPool(num, stack_size, self.interrupted)\n\n            self.maxjobs = num\n\n        def start(self):\n            \"\"\"Start the job. This will begin pulling tasks from the\n            taskmaster and executing them, and return when there are no\n            more tasks. If a task fails to execute (i.e. execute() raises\n            an exception), then the job will stop.\"\"\"\n\n            jobs = 0\n\n            while True:\n                # Start up as many available tasks as we're\n                # allowed to.\n                while jobs < self.maxjobs:\n                    task = self.taskmaster.next_task()\n                    if task is None:\n                        break\n\n                    try:\n                        # prepare task for execution\n                        task.prepare()\n                    except:\n                        task.exception_set()\n                        task.failed()\n                        task.postprocess()\n                    else:\n                        if task.needs_execute():\n                            # dispatch task\n                            self.tp.put(task)\n                            jobs = jobs + 1\n                        else:\n                            task.executed()\n                            task.postprocess()\n\n                if not task and not jobs: break\n\n                # Let any/all completed tasks finish up before we go\n                # back and put the next batch of tasks on the queue.\n                while True:\n                    task, ok = self.tp.get()\n                    jobs = jobs - 1\n\n                    if ok:\n                        task.executed()\n                    else:\n                        if self.interrupted():\n                            try:\n                                raise SCons.Errors.BuildError(\n                                    task.targets[0], errstr=interrupt_msg)\n                            except:\n                                task.exception_set()\n\n                        # Let the failed() callback function arrange\n                        # for the build to stop if that's appropriate.\n                        task.failed()\n\n                    task.postprocess()\n\n                    if self.tp.resultsQueue.empty():\n                        break\n\n            self.tp.cleanup()\n            self.taskmaster.cleanup()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Memoize.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Memoize.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"Memoizer\n\nA decorator-based implementation to count hits and misses of the computed\nvalues that various methods cache in memory.\n\nUse of this modules assumes that wrapped methods be coded to cache their\nvalues in a consistent way. In particular, it requires that the class uses a\ndictionary named \"_memo\" to store the cached values.\n\nHere is an example of wrapping a method that returns a computed value,\nwith no input parameters::\n\n    @SCons.Memoize.CountMethodCall\n    def foo(self):\n\n        try:                                                    # Memoization\n            return self._memo['foo']                            # Memoization\n        except KeyError:                                        # Memoization\n            pass                                                # Memoization\n\n        result = self.compute_foo_value()\n\n        self._memo['foo'] = result                              # Memoization\n\n        return result\n\nHere is an example of wrapping a method that will return different values\nbased on one or more input arguments::\n\n    def _bar_key(self, argument):                               # Memoization\n        return argument                                         # Memoization\n\n    @SCons.Memoize.CountDictCall(_bar_key)\n    def bar(self, argument):\n\n        memo_key = argument                                     # Memoization\n        try:                                                    # Memoization\n            memo_dict = self._memo['bar']                       # Memoization\n        except KeyError:                                        # Memoization\n            memo_dict = {}                                      # Memoization\n            self._memo['dict'] = memo_dict                      # Memoization\n        else:                                                   # Memoization\n            try:                                                # Memoization\n                return memo_dict[memo_key]                      # Memoization\n            except KeyError:                                    # Memoization\n                pass                                            # Memoization\n\n        result = self.compute_bar_value(argument)\n\n        memo_dict[memo_key] = result                            # Memoization\n\n        return result\n\nDeciding what to cache is tricky, because different configurations\ncan have radically different performance tradeoffs, and because the\ntradeoffs involved are often so non-obvious.  Consequently, deciding\nwhether or not to cache a given method will likely be more of an art than\na science, but should still be based on available data from this module.\nHere are some VERY GENERAL guidelines about deciding whether or not to\ncache return values from a method that's being called a lot:\n\n    --  The first question to ask is, \"Can we change the calling code\n        so this method isn't called so often?\"  Sometimes this can be\n        done by changing the algorithm.  Sometimes the *caller* should\n        be memoized, not the method you're looking at.\n\n    --  The memoized function should be timed with multiple configurations\n        to make sure it doesn't inadvertently slow down some other\n        configuration.\n\n    --  When memoizing values based on a dictionary key composed of\n        input arguments, you don't need to use all of the arguments\n        if some of them don't affect the return values.\n\n\"\"\"\n\n# A flag controlling whether or not we actually use memoization.\nuse_memoizer = None\n\n# Global list of counter objects\nCounterList = {}\n\nclass Counter(object):\n    \"\"\"\n    Base class for counting memoization hits and misses.\n\n    We expect that the initialization in a matching decorator will\n    fill in the correct class name and method name that represents\n    the name of the function being counted.\n    \"\"\"\n    def __init__(self, cls_name, method_name):\n        \"\"\"\n        \"\"\"\n        self.cls_name = cls_name\n        self.method_name = method_name\n        self.hit = 0\n        self.miss = 0\n    def key(self):\n        return self.cls_name+'.'+self.method_name\n    def display(self):\n        print(\"    {:7d} hits {:7d} misses    {}()\".format(self.hit, self.miss, self.key()))\n    def __eq__(self, other):\n        try:\n            return self.key() == other.key()\n        except AttributeError:\n            return True\n\nclass CountValue(Counter):\n    \"\"\"\n    A counter class for simple, atomic memoized values.\n\n    A CountValue object should be instantiated in a decorator for each of\n    the class's methods that memoizes its return value by simply storing\n    the return value in its _memo dictionary.\n    \"\"\"\n    def count(self, *args, **kw):\n        \"\"\" Counts whether the memoized value has already been\n            set (a hit) or not (a miss).\n        \"\"\"\n        obj = args[0]\n        if self.method_name in obj._memo:\n            self.hit = self.hit + 1\n        else:\n            self.miss = self.miss + 1\n\nclass CountDict(Counter):\n    \"\"\"\n    A counter class for memoized values stored in a dictionary, with\n    keys based on the method's input arguments.\n\n    A CountDict object is instantiated in a decorator for each of the\n    class's methods that memoizes its return value in a dictionary,\n    indexed by some key that can be computed from one or more of\n    its input arguments.\n    \"\"\"\n    def __init__(self, cls_name, method_name, keymaker):\n        \"\"\"\n        \"\"\"\n        Counter.__init__(self, cls_name, method_name)\n        self.keymaker = keymaker\n    def count(self, *args, **kw):\n        \"\"\" Counts whether the computed key value is already present\n           in the memoization dictionary (a hit) or not (a miss).\n        \"\"\"\n        obj = args[0]\n        try:\n            memo_dict = obj._memo[self.method_name]\n        except KeyError:\n            self.miss = self.miss + 1\n        else:\n            key = self.keymaker(*args, **kw)\n            if key in memo_dict:\n                self.hit = self.hit + 1\n            else:\n                self.miss = self.miss + 1\n\ndef Dump(title=None):\n    \"\"\" Dump the hit/miss count for all the counters\n        collected so far.\n    \"\"\"\n    if title:\n        print(title)\n    for counter in sorted(CounterList):\n        CounterList[counter].display()\n\ndef EnableMemoization():\n    global use_memoizer\n    use_memoizer = 1\n\ndef CountMethodCall(fn):\n    \"\"\" Decorator for counting memoizer hits/misses while retrieving\n        a simple value in a class method. It wraps the given method\n        fn and uses a CountValue object to keep track of the\n        caching statistics.\n        Wrapping gets enabled by calling EnableMemoization().\n    \"\"\"\n    if use_memoizer:\n        def wrapper(self, *args, **kwargs):\n            global CounterList\n            key = self.__class__.__name__+'.'+fn.__name__\n            if key not in CounterList:\n                CounterList[key] = CountValue(self.__class__.__name__, fn.__name__)\n            CounterList[key].count(self, *args, **kwargs)\n            return fn(self, *args, **kwargs)\n        wrapper.__name__= fn.__name__\n        return wrapper\n    else:\n        return fn\n\ndef CountDictCall(keyfunc):\n    \"\"\" Decorator for counting memoizer hits/misses while accessing\n        dictionary values with a key-generating function. Like\n        CountMethodCall above, it wraps the given method\n        fn and uses a CountDict object to keep track of the\n        caching statistics. The dict-key function keyfunc has to\n        get passed in the decorator call and gets stored in the\n        CountDict instance.\n        Wrapping gets enabled by calling EnableMemoization().\n    \"\"\"\n    def decorator(fn):\n        if use_memoizer:\n            def wrapper(self, *args, **kwargs):\n                global CounterList\n                key = self.__class__.__name__+'.'+fn.__name__\n                if key not in CounterList:\n                    CounterList[key] = CountDict(self.__class__.__name__, fn.__name__, keyfunc)\n                CounterList[key].count(self, *args, **kwargs)\n                return fn(self, *args, **kwargs)\n            wrapper.__name__= fn.__name__\n            return wrapper\n        else:\n            return fn\n    return decorator\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/Alias.py",
    "content": "\n\"\"\"scons.Node.Alias\n\nAlias nodes.\n\nThis creates a hash of global Aliases (dummy targets).\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Node/Alias.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport collections\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Util\n\nclass AliasNameSpace(collections.UserDict):\n    def Alias(self, name, **kw):\n        if isinstance(name, SCons.Node.Alias.Alias):\n            return name\n        try:\n            a = self[name]\n        except KeyError:\n            a = SCons.Node.Alias.Alias(name, **kw)\n            self[name] = a\n        return a\n\n    def lookup(self, name, **kw):\n        try:\n            return self[name]\n        except KeyError:\n            return None\n\nclass AliasNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig',)\n    current_version_id = 2\n    field_list = ['csig']\n    def str_to_node(self, s):\n        return default_ans.Alias(s)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n          \n\nclass AliasBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\nclass Alias(SCons.Node.Node):\n\n    NodeInfo = AliasNodeInfo\n    BuildInfo = AliasBuildInfo\n\n    def __init__(self, name):\n        SCons.Node.Node.__init__(self)\n        self.name = name\n        self.changed_since_last_build = 1\n        self.store_info = 0\n        \n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def __str__(self):\n        return self.name\n\n    def make_ready(self):\n        self.get_csig()\n\n    really_build = SCons.Node.Node.build\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Alias nodes get built regardless of\n        # what directory scons was run from. Alias nodes\n        # are outside the filesystem:\n        return 1\n\n    def get_contents(self):\n        \"\"\"The contents of an alias is the concatenation\n        of the content signatures of all its sources.\"\"\"\n        childsigs = [n.get_csig() for n in self.children()]\n        return ''.join(childsigs)\n\n    def sconsign(self):\n        \"\"\"An Alias is not recorded in .sconsign files\"\"\"\n        pass\n\n    #\n    #\n    #\n\n    def build(self):\n        \"\"\"A \"builder\" for aliases.\"\"\"\n        pass\n\n    def convert(self):\n        try: del self.builder\n        except AttributeError: pass\n        self.reset_executor()\n        self.build = self.really_build\n\n    def get_csig(self):\n        \"\"\"\n        Generate a node's content signature, the digested signature\n        of its content.\n\n        node - the node\n        cache - alternate node to use for the signature cache\n        returns - the content signature\n        \"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n\n        contents = self.get_contents()\n        csig = SCons.Util.MD5signature(contents)\n        self.get_ninfo().csig = csig\n        return csig\n\ndefault_ans = AliasNameSpace()\n\nSCons.Node.arg2nodes_lookups.append(default_ans.lookup)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/FS.py",
    "content": "\"\"\"scons.Node.FS\n\nFile system nodes.\n\nThese Nodes represent the canonical external objects that people think\nof when they think of building software: files and directories.\n\nThis holds a \"default_fs\" variable that should be initialized with an FS\nthat can be used by scripts or modules looking for the canonical default.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Node/FS.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport fnmatch\nimport os\nimport re\nimport shutil\nimport stat\nimport sys\nimport time\nimport codecs\nfrom itertools import chain\n\nimport SCons.Action\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Subst\nimport SCons.Util\nimport SCons.Warnings\n\nfrom SCons.Debug import Trace\n\nprint_duplicate = 0\n\nMD5_TIMESTAMP_DEBUG = False\n\n\ndef sconsign_none(node):\n    raise NotImplementedError\n\ndef sconsign_dir(node):\n    \"\"\"Return the .sconsign file info for this directory,\n    creating it first if necessary.\"\"\"\n    if not node._sconsign:\n        import SCons.SConsign\n        node._sconsign = SCons.SConsign.ForDirectory(node)\n    return node._sconsign\n\n_sconsign_map = {0 : sconsign_none,\n                 1 : sconsign_dir}\n\nclass FileBuildInfoFileToCsigMappingError(Exception):\n    pass\n\nclass EntryProxyAttributeError(AttributeError):\n    \"\"\"\n    An AttributeError subclass for recording and displaying the name\n    of the underlying Entry involved in an AttributeError exception.\n    \"\"\"\n    def __init__(self, entry_proxy, attribute):\n        AttributeError.__init__(self)\n        self.entry_proxy = entry_proxy\n        self.attribute = attribute\n    def __str__(self):\n        entry = self.entry_proxy.get()\n        fmt = \"%s instance %s has no attribute %s\"\n        return fmt % (entry.__class__.__name__,\n                      repr(entry.name),\n                      repr(self.attribute))\n\n# The max_drift value:  by default, use a cached signature value for\n# any file that's been untouched for more than two days.\ndefault_max_drift = 2*24*60*60\n\n#\n# We stringify these file system Nodes a lot.  Turning a file system Node\n# into a string is non-trivial, because the final string representation\n# can depend on a lot of factors:  whether it's a derived target or not,\n# whether it's linked to a repository or source directory, and whether\n# there's duplication going on.  The normal technique for optimizing\n# calculations like this is to memoize (cache) the string value, so you\n# only have to do the calculation once.\n#\n# A number of the above factors, however, can be set after we've already\n# been asked to return a string for a Node, because a Repository() or\n# VariantDir() call or the like may not occur until later in SConscript\n# files.  So this variable controls whether we bother trying to save\n# string values for Nodes.  The wrapper interface can set this whenever\n# they're done mucking with Repository and VariantDir and the other stuff,\n# to let this module know it can start returning saved string values\n# for Nodes.\n#\nSave_Strings = None\n\ndef save_strings(val):\n    global Save_Strings\n    Save_Strings = val\n\n#\n# Avoid unnecessary function calls by recording a Boolean value that\n# tells us whether or not os.path.splitdrive() actually does anything\n# on this system, and therefore whether we need to bother calling it\n# when looking up path names in various methods below.\n#\n\ndo_splitdrive = None\n_my_splitdrive =None\n\ndef initialize_do_splitdrive():\n    global do_splitdrive\n    global has_unc\n    drive, path = os.path.splitdrive('X:/foo')\n    # splitunc is removed from python 3.7 and newer\n    # so we can also just test if splitdrive works with UNC\n    has_unc = (hasattr(os.path, 'splitunc')\n        or os.path.splitdrive(r'\\\\split\\drive\\test')[0] == r'\\\\split\\drive')\n\n    do_splitdrive = not not drive or has_unc\n\n    global _my_splitdrive\n    if has_unc:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            if p[0:2] == '//':\n                # Note that we leave a leading slash in the path\n                # because UNC paths are always absolute.\n                return '//', p[1:]\n            return '', p\n    else:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            return '', p\n    _my_splitdrive = splitdrive\n\n    # Keep some commonly used values in global variables to skip to\n    # module look-up costs.\n    global OS_SEP\n    global UNC_PREFIX\n    global os_sep_is_slash\n\n    OS_SEP = os.sep\n    UNC_PREFIX = OS_SEP + OS_SEP\n    os_sep_is_slash = OS_SEP == '/'\n\ninitialize_do_splitdrive()\n\n# Used to avoid invoking os.path.normpath if not necessary.\nneeds_normpath_check = re.compile(\n    r'''\n      # We need to renormalize the path if it contains any consecutive\n      # '/' characters.\n      .*// |\n\n      # We need to renormalize the path if it contains a '..' directory.\n      # Note that we check for all the following cases:\n      #\n      #    a) The path is a single '..'\n      #    b) The path starts with '..'. E.g. '../' or '../moredirs'\n      #       but we not match '..abc/'.\n      #    c) The path ends with '..'. E.g. '/..' or 'dirs/..'\n      #    d) The path contains a '..' in the middle.\n      #       E.g. dirs/../moredirs\n\n      (.*/)?\\.\\.(?:/|$) |\n\n      # We need to renormalize the path if it contains a '.'\n      # directory, but NOT if it is a single '.'  '/' characters. We\n      # do not want to match a single '.' because this case is checked\n      # for explicitly since this is common enough case.\n      #\n      # Note that we check for all the following cases:\n      #\n      #    a) We don't match a single '.'\n      #    b) We match if the path starts with '.'. E.g. './' or\n      #       './moredirs' but we not match '.abc/'.\n      #    c) We match if the path ends with '.'. E.g. '/.' or\n      #    'dirs/.'\n      #    d) We match if the path contains a '.' in the middle.\n      #       E.g. dirs/./moredirs\n\n      \\./|.*/\\.(?:/|$)\n\n    ''',\n    re.VERBOSE\n    )\nneeds_normpath_match = needs_normpath_check.match\n\n#\n# SCons.Action objects for interacting with the outside world.\n#\n# The Node.FS methods in this module should use these actions to\n# create and/or remove files and directories; they should *not* use\n# os.{link,symlink,unlink,mkdir}(), etc., directly.\n#\n# Using these SCons.Action objects ensures that descriptions of these\n# external activities are properly displayed, that the displays are\n# suppressed when the -s (silent) option is used, and (most importantly)\n# the actions are disabled when the the -n option is used, in which case\n# there should be *no* changes to the external file system(s)...\n#\n\n# For Now disable hard & softlinks for win32\n# PY3 supports them, but the rest of SCons is not ready for this\n# in some cases user permissions may be required.\n# TODO: See if theres a reasonable way to enable using links on win32/64\n\nif hasattr(os, 'link') and sys.platform != 'win32':\n    def _hardlink_func(fs, src, dst):\n        # If the source is a symlink, we can't just hard-link to it\n        # because a relative symlink may point somewhere completely\n        # different.  We must disambiguate the symlink and then\n        # hard-link the final destination file.\n        while fs.islink(src):\n            link = fs.readlink(src)\n            if not os.path.isabs(link):\n                src = link\n            else:\n                src = os.path.join(os.path.dirname(src), link)\n        fs.link(src, dst)\nelse:\n    _hardlink_func = None\n\nif hasattr(os, 'symlink') and sys.platform != 'win32':\n    def _softlink_func(fs, src, dst):\n        fs.symlink(src, dst)\nelse:\n    _softlink_func = None\n\ndef _copy_func(fs, src, dest):\n    shutil.copy2(src, dest)\n    st = fs.stat(src)\n    fs.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n\nValid_Duplicates = ['hard-soft-copy', 'soft-hard-copy',\n                    'hard-copy', 'soft-copy', 'copy']\n\nLink_Funcs = [] # contains the callables of the specified duplication style\n\ndef set_duplicate(duplicate):\n    # Fill in the Link_Funcs list according to the argument\n    # (discarding those not available on the platform).\n\n    # Set up the dictionary that maps the argument names to the\n    # underlying implementations.  We do this inside this function,\n    # not in the top-level module code, so that we can remap os.link\n    # and os.symlink for testing purposes.\n    link_dict = {\n        'hard' : _hardlink_func,\n        'soft' : _softlink_func,\n        'copy' : _copy_func\n    }\n\n    if duplicate not in Valid_Duplicates:\n        raise SCons.Errors.InternalError(\"The argument of set_duplicate \"\n                                           \"should be in Valid_Duplicates\")\n    global Link_Funcs\n    Link_Funcs = []\n    for func in duplicate.split('-'):\n        if link_dict[func]:\n            Link_Funcs.append(link_dict[func])\n\ndef LinkFunc(target, source, env):\n    \"\"\"\n    Relative paths cause problems with symbolic links, so\n    we use absolute paths, which may be a problem for people\n    who want to move their soft-linked src-trees around. Those\n    people should use the 'hard-copy' mode, softlinks cannot be\n    used for that; at least I have no idea how ...\n    \"\"\"\n    src = source[0].get_abspath()\n    dest = target[0].get_abspath()\n    dir, file = os.path.split(dest)\n    if dir and not target[0].fs.isdir(dir):\n        os.makedirs(dir)\n    if not Link_Funcs:\n        # Set a default order of link functions.\n        set_duplicate('hard-soft-copy')\n    fs = source[0].fs\n    # Now link the files with the previously specified order.\n    for func in Link_Funcs:\n        try:\n            func(fs, src, dest)\n            break\n        except (IOError, OSError):\n            # An OSError indicates something happened like a permissions\n            # problem or an attempt to symlink across file-system\n            # boundaries.  An IOError indicates something like the file\n            # not existing.  In either case, keeping trying additional\n            # functions in the list and only raise an error if the last\n            # one failed.\n            if func == Link_Funcs[-1]:\n                # exception of the last link method (copy) are fatal\n                raise\n    return 0\n\nLink = SCons.Action.Action(LinkFunc, None)\ndef LocalString(target, source, env):\n    return 'Local copy of %s from %s' % (target[0], source[0])\n\nLocalCopy = SCons.Action.Action(LinkFunc, LocalString)\n\ndef UnlinkFunc(target, source, env):\n    t = target[0]\n    t.fs.unlink(t.get_abspath())\n    return 0\n\nUnlink = SCons.Action.Action(UnlinkFunc, None)\n\ndef MkdirFunc(target, source, env):\n    t = target[0]\n    # This os.path.exists test looks redundant, but it's possible\n    # when using Install() to install multiple dirs outside the\n    # source tree to get a case where t.exists() is true but\n    # the path does already exist, so this prevents spurious\n    # build failures in that case. See test/Install/multi-dir.\n    if not t.exists() and not os.path.exists(t.get_abspath()):\n        t.fs.mkdir(t.get_abspath())\n    return 0\n\nMkdir = SCons.Action.Action(MkdirFunc, None, presub=None)\n\nMkdirBuilder = None\n\ndef get_MkdirBuilder():\n    global MkdirBuilder\n    if MkdirBuilder is None:\n        import SCons.Builder\n        import SCons.Defaults\n        # \"env\" will get filled in by Executor.get_build_env()\n        # calling SCons.Defaults.DefaultEnvironment() when necessary.\n        MkdirBuilder = SCons.Builder.Builder(action = Mkdir,\n                                             env = None,\n                                             explain = None,\n                                             is_explicit = None,\n                                             target_scanner = SCons.Defaults.DirEntryScanner,\n                                             name = \"MkdirBuilder\")\n    return MkdirBuilder\n\nclass _Null(object):\n    pass\n\n_null = _Null()\n\n# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.\n_is_cygwin = sys.platform == \"cygwin\"\nif os.path.normcase(\"TeSt\") == os.path.normpath(\"TeSt\") and not _is_cygwin:\n    def _my_normcase(x):\n        return x\nelse:\n    def _my_normcase(x):\n        return x.upper()\n\n\n\nclass DiskChecker(object):\n    def __init__(self, type, do, ignore):\n        self.type = type\n        self.do = do\n        self.ignore = ignore\n        self.func = do\n    def __call__(self, *args, **kw):\n        return self.func(*args, **kw)\n    def set(self, list):\n        if self.type in list:\n            self.func = self.do\n        else:\n            self.func = self.ignore\n\ndef do_diskcheck_match(node, predicate, errorfmt):\n    result = predicate()\n    try:\n        # If calling the predicate() cached a None value from stat(),\n        # remove it so it doesn't interfere with later attempts to\n        # build this Node as we walk the DAG.  (This isn't a great way\n        # to do this, we're reaching into an interface that doesn't\n        # really belong to us, but it's all about performance, so\n        # for now we'll just document the dependency...)\n        if node._memo['stat'] is None:\n            del node._memo['stat']\n    except (AttributeError, KeyError):\n        pass\n    if result:\n        raise TypeError(errorfmt % node.get_abspath())\n\ndef ignore_diskcheck_match(node, predicate, errorfmt):\n    pass\n\n\n\ndiskcheck_match = DiskChecker('match', do_diskcheck_match, ignore_diskcheck_match)\n\ndiskcheckers = [\n    diskcheck_match,\n]\n\ndef set_diskcheck(list):\n    for dc in diskcheckers:\n        dc.set(list)\n\ndef diskcheck_types():\n    return [dc.type for dc in diskcheckers]\n\n\n\nclass EntryProxy(SCons.Util.Proxy):\n\n    __str__ = SCons.Util.Delegate('__str__')\n\n    # In PY3 if a class defines __eq__, then it must explicitly provide\n    # __hash__.  Since SCons.Util.Proxy provides __eq__ we need the following\n    # see: https://docs.python.org/3.1/reference/datamodel.html#object.__hash__\n    __hash__ = SCons.Util.Delegate('__hash__')\n\n    def __get_abspath(self):\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(),\n                                             entry.name + \"_abspath\")\n\n    def __get_filebase(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[0],\n                                             name + \"_filebase\")\n\n    def __get_suffix(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[1],\n                                             name + \"_suffix\")\n\n    def __get_file(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(name, name + \"_file\")\n\n    def __get_base_path(self):\n        \"\"\"Return the file's directory and file name, with the\n        suffix stripped.\"\"\"\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],\n                                             entry.name + \"_base\")\n\n    def __get_posix_path(self):\n        \"\"\"Return the path with / as the path separator,\n        regardless of platform.\"\"\"\n        if os_sep_is_slash:\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '/')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_posix\")\n\n    def __get_windows_path(self):\n        r\"\"\"Return the path with \\ as the path separator,\n        regardless of platform.\"\"\"\n        if OS_SEP == '\\\\':\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '\\\\')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_windows\")\n\n    def __get_srcnode(self):\n        return EntryProxy(self.get().srcnode())\n\n    def __get_srcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().dir)\n\n    def __get_rsrcnode(self):\n        return EntryProxy(self.get().srcnode().rfile())\n\n    def __get_rsrcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().rfile().dir)\n\n    def __get_dir(self):\n        return EntryProxy(self.get().dir)\n\n    dictSpecialAttrs = { \"base\"     : __get_base_path,\n                         \"posix\"    : __get_posix_path,\n                         \"windows\"  : __get_windows_path,\n                         \"win32\"    : __get_windows_path,\n                         \"srcpath\"  : __get_srcnode,\n                         \"srcdir\"   : __get_srcdir,\n                         \"dir\"      : __get_dir,\n                         \"abspath\"  : __get_abspath,\n                         \"filebase\" : __get_filebase,\n                         \"suffix\"   : __get_suffix,\n                         \"file\"     : __get_file,\n                         \"rsrcpath\" : __get_rsrcnode,\n                         \"rsrcdir\"  : __get_rsrcdir,\n                       }\n\n    def __getattr__(self, name):\n        # This is how we implement the \"special\" attributes\n        # such as base, posix, srcdir, etc.\n        try:\n            attr_function = self.dictSpecialAttrs[name]\n        except KeyError:\n            try:\n                attr = SCons.Util.Proxy.__getattr__(self, name)\n            except AttributeError:\n                # Raise our own AttributeError subclass with an\n                # overridden __str__() method that identifies the\n                # name of the entry that caused the exception.\n                raise EntryProxyAttributeError(self, name)\n            return attr\n        else:\n            return attr_function(self)\n\n\nclass Base(SCons.Node.Node):\n    \"\"\"A generic class for file system entries.  This class is for\n    when we don't know yet whether the entry being looked up is a file\n    or a directory.  Instances of this class can morph into either\n    Dir or File objects by a later, more precise lookup.\n\n    Note: this class does not define __cmp__ and __hash__ for\n    efficiency reasons.  SCons does a lot of comparing of\n    Node.FS.{Base,Entry,File,Dir} objects, so those operations must be\n    as fast as possible, which means we want to use Python's built-in\n    object identity comparisons.\n    \"\"\"\n\n    __slots__ = ['name',\n                 'fs',\n                 '_abspath',\n                 '_labspath',\n                 '_path',\n                 '_tpath',\n                 '_path_elements',\n                 'dir',\n                 'cwd',\n                 'duplicate',\n                 '_local',\n                 'sbuilder',\n                 '_proxy',\n                 '_func_sconsign']\n\n    def __init__(self, name, directory, fs):\n        \"\"\"Initialize a generic Node.FS.Base object.\n\n        Call the superclass initialization, take care of setting up\n        our relative and absolute paths, identify our parent\n        directory, and indicate that this node should use\n        signatures.\"\"\"\n\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')\n        SCons.Node.Node.__init__(self)\n\n        # Filenames and paths are probably reused and are intern'ed to save some memory.\n        # Filename with extension as it was specified when the object was\n        # created; to obtain filesystem path, use Python str() function\n        self.name = SCons.Util.silent_intern(name)\n        self.fs = fs #: Reference to parent Node.FS object\n\n        assert directory, \"A directory must be provided\"\n\n        self._abspath = None\n        self._labspath = None\n        self._path = None\n        self._tpath = None\n        self._path_elements = None\n\n        self.dir = directory\n        self.cwd = None # will hold the SConscript directory for target nodes\n        self.duplicate = directory.duplicate\n        self.changed_since_last_build = 2\n        self._func_sconsign = 0\n        self._func_exists = 2\n        self._func_rexists = 2\n        self._func_get_contents = 0\n        self._func_target_from_source = 1\n        self.store_info = 1\n\n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def must_be_same(self, klass):\n        \"\"\"\n        This node, which already existed, is being looked up as the\n        specified klass.  Raise an exception if it isn't.\n        \"\"\"\n        if isinstance(self, klass) or klass is Entry:\n            return\n        raise TypeError(\"Tried to lookup %s '%s' as a %s.\" %\\\n              (self.__class__.__name__, self.get_internal_path(), klass.__name__))\n\n    def get_dir(self):\n        return self.dir\n\n    def get_suffix(self):\n        return SCons.Util.splitext(self.name)[1]\n\n    def rfile(self):\n        return self\n\n    def __getattr__(self, attr):\n        \"\"\" Together with the node_bwcomp dict defined below,\n            this method provides a simple backward compatibility\n            layer for the Node attributes 'abspath', 'labspath',\n            'path', 'tpath', 'suffix' and 'path_elements'. These Node\n            attributes used to be directly available in v2.3 and earlier, but\n            have been replaced by getter methods that initialize the\n            single variables lazily when required, in order to save memory.\n            The redirection to the getters lets older Tools and\n            SConstruct continue to work without any additional changes,\n            fully transparent to the user.\n            Note, that __getattr__ is only called as fallback when the\n            requested attribute can't be found, so there should be no\n            speed performance penalty involved for standard builds.\n        \"\"\"\n        if attr in node_bwcomp:\n            return node_bwcomp[attr](self)\n\n        raise AttributeError(\"%r object has no attribute %r\" %\n                         (self.__class__, attr))\n\n    def __str__(self):\n        \"\"\"A Node.FS.Base object's string representation is its path\n        name.\"\"\"\n        global Save_Strings\n        if Save_Strings:\n            return self._save_str()\n        return self._get_str()\n\n    def __lt__(self, other):\n        \"\"\" less than operator used by sorting on py3\"\"\"\n        return str(self) < str(other)\n\n    @SCons.Memoize.CountMethodCall\n    def _save_str(self):\n        try:\n            return self._memo['_save_str']\n        except KeyError:\n            pass\n        result = SCons.Util.silent_intern(self._get_str())\n        self._memo['_save_str'] = result\n        return result\n\n    def _get_str(self):\n        global Save_Strings\n        if self.duplicate or self.is_derived():\n            return self.get_path()\n        srcnode = self.srcnode()\n        if srcnode.stat() is None and self.stat() is not None:\n            result = self.get_path()\n        else:\n            result = srcnode.get_path()\n        if not Save_Strings:\n            # We're not at the point where we're saving the string\n            # representations of FS Nodes (because we haven't finished\n            # reading the SConscript files and need to have str() return\n            # things relative to them).  That also means we can't yet\n            # cache values returned (or not returned) by stat(), since\n            # Python code in the SConscript files might still create\n            # or otherwise affect the on-disk file.  So get rid of the\n            # values that the underlying stat() method saved.\n            try: del self._memo['stat']\n            except KeyError: pass\n            if self is not srcnode:\n                try: del srcnode._memo['stat']\n                except KeyError: pass\n        return result\n\n    rstr = __str__\n\n    @SCons.Memoize.CountMethodCall\n    def stat(self):\n        try:\n            return self._memo['stat']\n        except KeyError:\n            pass\n        try:\n            result = self.fs.stat(self.get_abspath())\n        except os.error:\n            result = None\n\n        self._memo['stat'] = result\n        return result\n\n    def exists(self):\n        return SCons.Node._exists_map[self._func_exists](self)\n\n    def rexists(self):\n        return SCons.Node._rexists_map[self._func_rexists](self)\n\n    def getmtime(self):\n        st = self.stat()\n        if st:\n            return st[stat.ST_MTIME]\n        else:\n            return None\n\n    def getsize(self):\n        st = self.stat()\n        if st:\n            return st[stat.ST_SIZE]\n        else:\n            return None\n\n    def isdir(self):\n        st = self.stat()\n        return st is not None and stat.S_ISDIR(st[stat.ST_MODE])\n\n    def isfile(self):\n        st = self.stat()\n        return st is not None and stat.S_ISREG(st[stat.ST_MODE])\n\n    if hasattr(os, 'symlink'):\n        def islink(self):\n            try: st = self.fs.lstat(self.get_abspath())\n            except os.error: return 0\n            return stat.S_ISLNK(st[stat.ST_MODE])\n    else:\n        def islink(self):\n            return 0                    # no symlinks\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return self.dir.is_under(dir)\n\n    def set_local(self):\n        self._local = 1\n\n    def srcnode(self):\n        \"\"\"If this node is in a build path, return the node\n        corresponding to its source file.  Otherwise, return\n        ourself.\n        \"\"\"\n        srcdir_list = self.dir.srcdir_list()\n        if srcdir_list:\n            srcnode = srcdir_list[0].Entry(self.name)\n            srcnode.must_be_same(self.__class__)\n            return srcnode\n        return self\n\n    def get_path(self, dir=None):\n        \"\"\"Return path relative to the current working directory of the\n        Node.FS.Base object that owns us.\"\"\"\n        if not dir:\n            dir = self.fs.getcwd()\n        if self == dir:\n            return '.'\n        path_elems = self.get_path_elements()\n        pathname = ''\n        try: i = path_elems.index(dir)\n        except ValueError:\n            for p in path_elems[:-1]:\n                pathname += p.dirname\n        else:\n            for p in path_elems[i+1:-1]:\n                pathname += p.dirname\n        return pathname + path_elems[-1].name\n\n    def set_src_builder(self, builder):\n        \"\"\"Set the source code builder for this node.\"\"\"\n        self.sbuilder = builder\n        if not self.has_builder():\n            self.builder_set(builder)\n\n    def src_builder(self):\n        \"\"\"Fetch the source code builder for this node.\n\n        If there isn't one, we cache the source code builder specified\n        for the directory (which in turn will cache the value from its\n        parent directory, and so on up to the file system root).\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.dir.src_builder()\n            self.sbuilder = scb\n        return scb\n\n    def get_abspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self.dir.entry_abspath(self.name)\n\n    def get_labspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self.dir.entry_labspath(self.name)\n\n    def get_internal_path(self):\n        if self.dir._path == '.':\n            return self.name\n        else:\n            return self.dir.entry_path(self.name)\n\n    def get_tpath(self):\n        if self.dir._tpath == '.':\n            return self.name\n        else:\n            return self.dir.entry_tpath(self.name)\n\n    def get_path_elements(self):\n        return self.dir._path_elements + [self]\n\n    def for_signature(self):\n        # Return just our name.  Even an absolute path would not work,\n        # because that can change thanks to symlinks or remapped network\n        # paths.\n        return self.name\n\n    def get_subst_proxy(self):\n        try:\n            return self._proxy\n        except AttributeError:\n            ret = EntryProxy(self)\n            self._proxy = ret\n            return ret\n\n    def target_from_source(self, prefix, suffix, splitext=SCons.Util.splitext):\n        \"\"\"\n\n        Generates a target entry that corresponds to this entry (usually\n        a source file) with the specified prefix and suffix.\n\n        Note that this method can be overridden dynamically for generated\n        files that need different behavior.  See Tool/swig.py for\n        an example.\n        \"\"\"\n        return SCons.Node._target_from_source_map[self._func_target_from_source](self, prefix, suffix, splitext)\n\n    def _Rfindalldirs_key(self, pathlist):\n        return pathlist\n\n    @SCons.Memoize.CountDictCall(_Rfindalldirs_key)\n    def Rfindalldirs(self, pathlist):\n        \"\"\"\n        Return all of the directories for a given path list, including\n        corresponding \"backing\" directories in any repositories.\n\n        The Node lookups are relative to this Node (typically a\n        directory), so memoizing result saves cycles from looking\n        up the same path for each target in a given directory.\n        \"\"\"\n        try:\n            memo_dict = self._memo['Rfindalldirs']\n        except KeyError:\n            memo_dict = {}\n            self._memo['Rfindalldirs'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        create_dir_relative_to_self = self.Dir\n        result = []\n        for path in pathlist:\n            if isinstance(path, SCons.Node.Node):\n                result.append(path)\n            else:\n                dir = create_dir_relative_to_self(path)\n                result.extend(dir.get_all_rdirs())\n\n        memo_dict[pathlist] = result\n\n        return result\n\n    def RDirs(self, pathlist):\n        \"\"\"Search for a list of directories in the Repository list.\"\"\"\n        cwd = self.cwd or self.fs._cwd\n        return cwd.Rfindalldirs(pathlist)\n\n    @SCons.Memoize.CountMethodCall\n    def rentry(self):\n        try:\n            return self._memo['rentry']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try:\n                    node = dir.entries[norm_name]\n                except KeyError:\n                    if dir.entry_exists_on_disk(self.name):\n                        result = dir.Entry(self.name)\n                        break\n        self._memo['rentry'] = result\n        return result\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return []\n\n# Dict that provides a simple backward compatibility\n# layer for the Node attributes 'abspath', 'labspath',\n# 'path', 'tpath' and 'path_elements'.\n# @see Base.__getattr__ above\nnode_bwcomp = {'abspath' : Base.get_abspath,\n               'labspath' : Base.get_labspath,\n               'path' : Base.get_internal_path,\n               'tpath' : Base.get_tpath,\n               'path_elements' : Base.get_path_elements,\n               'suffix' : Base.get_suffix}\n\nclass Entry(Base):\n    \"\"\"This is the class for generic Node.FS entries--that is, things\n    that could be a File or a Dir, but we're just not sure yet.\n    Consequently, the methods in this class really exist just to\n    transform their associated object into the right class when the\n    time comes, and then call the same-named method in the transformed\n    class.\"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    def __init__(self, name, directory, fs):\n        Base.__init__(self, name, directory, fs)\n        self._func_exists = 3\n        self._func_get_contents = 1\n\n    def diskcheck_match(self):\n        pass\n\n    def disambiguate(self, must_exist=None):\n        \"\"\"\n        \"\"\"\n        if self.isfile():\n            self.__class__ = File\n            self._morph()\n            self.clear()\n        elif self.isdir():\n            self.__class__ = Dir\n            self._morph()\n        else:\n            # There was nothing on-disk at this location, so look in\n            # the src directory.\n            #\n            # We can't just use self.srcnode() straight away because\n            # that would create an actual Node for this file in the src\n            # directory, and there might not be one.  Instead, use the\n            # dir_on_disk() method to see if there's something on-disk\n            # with that name, in which case we can go ahead and call\n            # self.srcnode() to create the right type of entry.\n            srcdir = self.dir.srcnode()\n            if srcdir != self.dir and \\\n               srcdir.entry_exists_on_disk(self.name) and \\\n               self.srcnode().isdir():\n                self.__class__ = Dir\n                self._morph()\n            elif must_exist:\n                msg = \"No such file or directory: '%s'\" % self.get_abspath()\n                raise SCons.Errors.UserError(msg)\n            else:\n                self.__class__ = File\n                self._morph()\n                self.clear()\n        return self\n\n    def rfile(self):\n        \"\"\"We're a generic Entry, but the caller is actually looking for\n        a File at this point, so morph into one.\"\"\"\n        self.__class__ = File\n        self._morph()\n        self.clear()\n        return File.rfile(self)\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self):\n        \"\"\"Fetch the contents of the entry.  Returns the exact binary\n        contents of the file.\"\"\"\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_text_contents(self):\n        \"\"\"Fetch the decoded text contents of a Unicode encoded Entry.\n\n        Since this should return the text contents from the file\n        system, we check to see into what sort of subclass we should\n        morph this Entry.\"\"\"\n        try:\n            self = self.disambiguate(must_exist=1)\n        except SCons.Errors.UserError:\n            # There was nothing on disk with which to disambiguate\n            # this entry.  Leave it as an Entry, but return a null\n            # string so calls to get_text_contents() in emitters and\n            # the like (e.g. in qt.py) don't have to disambiguate by\n            # hand or catch the exception.\n            return ''\n        else:\n            return self.get_text_contents()\n\n    def must_be_same(self, klass):\n        \"\"\"Called to make sure a Node is a Dir.  Since we're an\n        Entry, we can morph into one.\"\"\"\n        if self.__class__ is not klass:\n            self.__class__ = klass\n            self._morph()\n            self.clear()\n\n    # The following methods can get called before the Taskmaster has\n    # had a chance to call disambiguate() directly to see if this Entry\n    # should really be a Dir or a File.  We therefore use these to call\n    # disambiguate() transparently (from our caller's point of view).\n    #\n    # Right now, this minimal set of methods has been derived by just\n    # looking at some of the methods that will obviously be called early\n    # in any of the various Taskmasters' calling sequences, and then\n    # empirically figuring out which additional methods are necessary\n    # to make various tests pass.\n\n    def exists(self):\n        return SCons.Node._exists_map[self._func_exists](self)\n\n    def rel_path(self, other):\n        d = self.disambiguate()\n        if d.__class__ is Entry:\n            raise Exception(\"rel_path() could not disambiguate File/Dir\")\n        return d.rel_path(other)\n\n    def new_ninfo(self):\n        return self.disambiguate().new_ninfo()\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return self.disambiguate()._glob1(pattern, ondisk, source, strings)\n\n    def get_subst_proxy(self):\n        return self.disambiguate().get_subst_proxy()\n\n# This is for later so we can differentiate between Entry the class and Entry\n# the method of the FS class.\n_classEntry = Entry\n\n\nclass LocalFS(object):\n    \"\"\"\n    This class implements an abstraction layer for operations involving\n    a local file system.  Essentially, this wraps any function in\n    the os, os.path or shutil modules that we use to actually go do\n    anything with or to the local file system.\n\n    Note that there's a very good chance we'll refactor this part of\n    the architecture in some way as we really implement the interface(s)\n    for remote file system Nodes.  For example, the right architecture\n    might be to have this be a subclass instead of a base class.\n    Nevertheless, we're using this as a first step in that direction.\n\n    We're not using chdir() yet because the calling subclass method\n    needs to use os.chdir() directly to avoid recursion.  Will we\n    really need this one?\n    \"\"\"\n    #def chdir(self, path):\n    #    return os.chdir(path)\n    def chmod(self, path, mode):\n        return os.chmod(path, mode)\n    def copy(self, src, dst):\n        return shutil.copy(src, dst)\n    def copy2(self, src, dst):\n        return shutil.copy2(src, dst)\n    def exists(self, path):\n        return os.path.exists(path)\n    def getmtime(self, path):\n        return os.path.getmtime(path)\n    def getsize(self, path):\n        return os.path.getsize(path)\n    def isdir(self, path):\n        return os.path.isdir(path)\n    def isfile(self, path):\n        return os.path.isfile(path)\n    def link(self, src, dst):\n        return os.link(src, dst)\n    def lstat(self, path):\n        return os.lstat(path)\n    def listdir(self, path):\n        return os.listdir(path)\n    def makedirs(self, path):\n        return os.makedirs(path)\n    def mkdir(self, path):\n        return os.mkdir(path)\n    def rename(self, old, new):\n        return os.rename(old, new)\n    def stat(self, path):\n        return os.stat(path)\n    def symlink(self, src, dst):\n        return os.symlink(src, dst)\n    def open(self, path):\n        return open(path)\n    def unlink(self, path):\n        return os.unlink(path)\n\n    if hasattr(os, 'symlink'):\n        def islink(self, path):\n            return os.path.islink(path)\n    else:\n        def islink(self, path):\n            return 0                    # no symlinks\n\n    if hasattr(os, 'readlink'):\n        def readlink(self, file):\n            return os.readlink(file)\n    else:\n        def readlink(self, file):\n            return ''\n\n\nclass FS(LocalFS):\n\n    def __init__(self, path = None):\n        \"\"\"Initialize the Node.FS subsystem.\n\n        The supplied path is the top of the source tree, where we\n        expect to find the top-level build file.  If no path is\n        supplied, the current directory is the default.\n\n        The path argument must be a valid absolute path.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS')\n\n        self._memo = {}\n\n        self.Root = {}\n        self.SConstruct_dir = None\n        self.max_drift = default_max_drift\n\n        self.Top = None\n        if path is None:\n            self.pathTop = os.getcwd()\n        else:\n            self.pathTop = path\n        self.defaultDrive = _my_normcase(_my_splitdrive(self.pathTop)[0])\n\n        self.Top = self.Dir(self.pathTop)\n        self.Top._path = '.'\n        self.Top._tpath = '.'\n        self._cwd = self.Top\n\n        DirNodeInfo.fs = self\n        FileNodeInfo.fs = self\n\n    def set_SConstruct_dir(self, dir):\n        self.SConstruct_dir = dir\n\n    def get_max_drift(self):\n        return self.max_drift\n\n    def set_max_drift(self, max_drift):\n        self.max_drift = max_drift\n\n    def getcwd(self):\n        if hasattr(self, \"_cwd\"):\n            return self._cwd\n        else:\n            return \"<no cwd>\"\n\n    def chdir(self, dir, change_os_dir=0):\n        \"\"\"Change the current working directory for lookups.\n        If change_os_dir is true, we will also change the \"real\" cwd\n        to match.\n        \"\"\"\n        curr=self._cwd\n        try:\n            if dir is not None:\n                self._cwd = dir\n                if change_os_dir:\n                    os.chdir(dir.get_abspath())\n        except OSError:\n            self._cwd = curr\n            raise\n\n    def get_root(self, drive):\n        \"\"\"\n        Returns the root directory for the specified drive, creating\n        it if necessary.\n        \"\"\"\n        drive = _my_normcase(drive)\n        try:\n            return self.Root[drive]\n        except KeyError:\n            root = RootDir(drive, self)\n            self.Root[drive] = root\n            if not drive:\n                self.Root[self.defaultDrive] = root\n            elif drive == self.defaultDrive:\n                self.Root[''] = root\n            return root\n\n    def _lookup(self, p, directory, fsclass, create=1):\n        \"\"\"\n        The generic entry point for Node lookup with user-supplied data.\n\n        This translates arbitrary input into a canonical Node.FS object\n        of the specified fsclass.  The general approach for strings is\n        to turn it into a fully normalized absolute path and then call\n        the root directory's lookup_abs() method for the heavy lifting.\n\n        If the path name begins with '#', it is unconditionally\n        interpreted relative to the top-level directory of this FS.  '#'\n        is treated as a synonym for the top-level SConstruct directory,\n        much like '~' is treated as a synonym for the user's home\n        directory in a UNIX shell.  So both '#foo' and '#/foo' refer\n        to the 'foo' subdirectory underneath the top-level SConstruct\n        directory.\n\n        If the path name is relative, then the path is looked up relative\n        to the specified directory, or the current directory (self._cwd,\n        typically the SConscript directory) if the specified directory\n        is None.\n        \"\"\"\n        if isinstance(p, Base):\n            # It's already a Node.FS object.  Make sure it's the right\n            # class and return.\n            p.must_be_same(fsclass)\n            return p\n        # str(p) in case it's something like a proxy object\n        p = str(p)\n\n        if not os_sep_is_slash:\n            p = p.replace(OS_SEP, '/')\n\n        if p[0:1] == '#':\n            # There was an initial '#', so we strip it and override\n            # whatever directory they may have specified with the\n            # top-level SConstruct directory.\n            p = p[1:]\n            directory = self.Top\n\n            # There might be a drive letter following the\n            # '#'. Although it is not described in the SCons man page,\n            # the regression test suite explicitly tests for that\n            # syntax. It seems to mean the following thing:\n            #\n            #   Assuming the the SCons top dir is in C:/xxx/yyy,\n            #   '#X:/toto' means X:/xxx/yyy/toto.\n            #\n            # i.e. it assumes that the X: drive has a directory\n            # structure similar to the one found on drive C:.\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n            else:\n                root = directory.root\n\n            # We can only strip trailing after splitting the drive\n            # since the drive might the UNC '//' prefix.\n            p = p.strip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            # The path is relative to the top-level SCons directory.\n            if p in ('', '.'):\n                p = directory.get_labspath()\n            else:\n                p = directory.get_labspath() + '/' + p\n        else:\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive and not p:\n                    # This causes a naked drive letter to be treated\n                    # as a synonym for the root directory on that\n                    # drive.\n                    p = '/'\n            else:\n                drive = ''\n\n            # We can only strip trailing '/' since the drive might the\n            # UNC '//' prefix.\n            if p != '/':\n                p = p.rstrip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            if p[0:1] == '/':\n                # Absolute path\n                root = self.get_root(drive)\n            else:\n                # This is a relative lookup or to the current directory\n                # (the path name is not absolute).  Add the string to the\n                # appropriate directory lookup path, after which the whole\n                # thing gets normalized.\n                if directory:\n                    if not isinstance(directory, Dir):\n                        directory = self.Dir(directory)\n                else:\n                    directory = self._cwd\n\n                if p in ('', '.'):\n                    p = directory.get_labspath()\n                else:\n                    p = directory.get_labspath() + '/' + p\n\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n\n        if needs_normpath is not None:\n            # Normalize a pathname. Will return the same result for\n            # equivalent paths.\n            #\n            # We take advantage of the fact that we have an absolute\n            # path here for sure. In addition, we know that the\n            # components of lookup path are separated by slashes at\n            # this point. Because of this, this code is about 2X\n            # faster than calling os.path.normpath() followed by\n            # replacing os.sep with '/' again.\n            ins = p.split('/')[1:]\n            outs = []\n            for d in ins:\n                if d == '..':\n                    try:\n                        outs.pop()\n                    except IndexError:\n                        pass\n                elif d not in ('', '.'):\n                    outs.append(d)\n            p = '/' + '/'.join(outs)\n\n        return root._lookup_abs(p, fsclass, create)\n\n    def Entry(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a generic Entry node with the specified name.\n        If the name is a relative path (begins with ./, ../, or a file\n        name), then it is looked up relative to the supplied directory\n        node, or to the top level directory of the FS (supplied at\n        construction time) if no directory is supplied.\n        \"\"\"\n        return self._lookup(name, directory, Entry, create)\n\n    def File(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a File node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a directory is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, File, create)\n\n    def Dir(self, name, directory = None, create = True):\n        \"\"\"Look up or create a Dir node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a normal file is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, Dir, create)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        \"\"\"Link the supplied variant directory to the source directory\n        for purposes of building files.\"\"\"\n\n        if not isinstance(src_dir, SCons.Node.Node):\n            src_dir = self.Dir(src_dir)\n        if not isinstance(variant_dir, SCons.Node.Node):\n            variant_dir = self.Dir(variant_dir)\n        if src_dir.is_under(variant_dir):\n            raise SCons.Errors.UserError(\"Source directory cannot be under variant directory.\")\n        if variant_dir.srcdir:\n            if variant_dir.srcdir == src_dir:\n                return # We already did this.\n            raise SCons.Errors.UserError(\"'%s' already has a source directory: '%s'.\"%(variant_dir, variant_dir.srcdir))\n        variant_dir.link(src_dir, duplicate)\n\n    def Repository(self, *dirs):\n        \"\"\"Specify Repository directories to search.\"\"\"\n        for d in dirs:\n            if not isinstance(d, SCons.Node.Node):\n                d = self.Dir(d)\n            self.Top.addRepository(d)\n\n    def PyPackageDir(self, modulename):\n        r\"\"\"Locate the directory of a given python module name\n\n        For example scons might resolve to\n        Windows: C:\\Python27\\Lib\\site-packages\\scons-2.5.1\n        Linux: /usr/lib/scons\n\n        This can be useful when we want to determine a toolpath based on a python module name\"\"\"\n\n        dirpath = ''\n        if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)):\n            # Python2 Code\n            import imp\n            splitname = modulename.split('.')\n            srchpths = sys.path\n            for item in splitname:\n                file, path, desc = imp.find_module(item, srchpths)\n                if file is not None:\n                    path = os.path.dirname(path)\n                srchpths = [path]\n            dirpath = path\n        else:\n            # Python3 Code\n            import importlib.util\n            modspec = importlib.util.find_spec(modulename)\n            dirpath = os.path.dirname(modspec.origin)\n        return self._lookup(dirpath, None, Dir, True)\n\n\n    def variant_dir_target_climb(self, orig, dir, tail):\n        \"\"\"Create targets in corresponding variant directories\n\n        Climb the directory tree, and look up path names\n        relative to any linked variant directories we find.\n\n        Even though this loops and walks up the tree, we don't memoize\n        the return value because this is really only used to process\n        the command-line targets.\n        \"\"\"\n        targets = []\n        message = None\n        fmt = \"building associated VariantDir targets: %s\"\n        start_dir = dir\n        while dir:\n            for bd in dir.variant_dirs:\n                if start_dir.is_under(bd):\n                    # If already in the build-dir location, don't reflect\n                    return [orig], fmt % str(orig)\n                p = os.path.join(bd._path, *tail)\n                targets.append(self.Entry(p))\n            tail = [dir.name] + tail\n            dir = dir.up()\n        if targets:\n            message = fmt % ' '.join(map(str, targets))\n        return targets, message\n\n    def Glob(self, pathname, ondisk=True, source=True, strings=False, exclude=None, cwd=None):\n        \"\"\"\n        Globs\n\n        This is mainly a shim layer\n        \"\"\"\n        if cwd is None:\n            cwd = self.getcwd()\n        return cwd.glob(pathname, ondisk, source, strings, exclude)\n\nclass DirNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ()\n    # This should get reset by the FS initialization.\n    current_version_id = 2\n\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.get_labspath() + '/' + s\n        return root._lookup_abs(s, Entry)\n\nclass DirBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\nglob_magic_check = re.compile('[*?[]')\n\ndef has_glob_magic(s):\n    return glob_magic_check.search(s) is not None\n\nclass Dir(Base):\n    \"\"\"A class for directories in a file system.\n    \"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    NodeInfo = DirNodeInfo\n    BuildInfo = DirBuildInfo\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def _morph(self):\n        \"\"\"Turn a file system Node (either a freshly initialized directory\n        object or a separate Entry object) into a proper directory object.\n\n        Set up this directory's entries and hook it into the file\n        system tree.  Specify that directories (this Node) don't use\n        signatures for calculating whether they're current.\n        \"\"\"\n\n        self.repositories = []\n        self.srcdir = None\n\n        self.entries = {}\n        self.entries['.'] = self\n        self.entries['..'] = self.dir\n        self.cwd = self\n        self.searched = 0\n        self._sconsign = None\n        self.variant_dirs = []\n        self.root = self.dir.root\n        self.changed_since_last_build = 3\n        self._func_sconsign = 1\n        self._func_exists = 2\n        self._func_get_contents = 2\n\n        self._abspath = SCons.Util.silent_intern(self.dir.entry_abspath(self.name))\n        self._labspath = SCons.Util.silent_intern(self.dir.entry_labspath(self.name))\n        if self.dir._path == '.':\n            self._path = SCons.Util.silent_intern(self.name)\n        else:\n            self._path = SCons.Util.silent_intern(self.dir.entry_path(self.name))\n        if self.dir._tpath == '.':\n            self._tpath = SCons.Util.silent_intern(self.name)\n        else:\n            self._tpath = SCons.Util.silent_intern(self.dir.entry_tpath(self.name))\n        self._path_elements = self.dir._path_elements + [self]\n\n        # For directories, we make a difference between the directory\n        # 'name' and the directory 'dirname'. The 'name' attribute is\n        # used when we need to print the 'name' of the directory or\n        # when we it is used as the last part of a path. The 'dirname'\n        # is used when the directory is not the last element of the\n        # path. The main reason for making that distinction is that\n        # for RoorDir's the dirname can not be easily inferred from\n        # the name. For example, we have to add a '/' after a drive\n        # letter but not after a UNC path prefix ('//').\n        self.dirname = self.name + OS_SEP\n\n        # Don't just reset the executor, replace its action list,\n        # because it might have some pre-or post-actions that need to\n        # be preserved.\n        #\n        # But don't reset the executor if there is a non-null executor\n        # attached already. The existing executor might have other\n        # targets, in which case replacing the action list with a\n        # Mkdir action is a big mistake.\n        if not hasattr(self, 'executor'):\n            self.builder = get_MkdirBuilder()\n            self.get_executor().set_action_list(self.builder.action)\n        else:\n            # Prepend MkdirBuilder action to existing action list\n            l = self.get_executor().action_list\n            a = get_MkdirBuilder().action\n            l.insert(0, a)\n            self.get_executor().set_action_list(l)\n\n    def diskcheck_match(self):\n        # Nuitka: This check breaks with symlinks on Windows and Python2\n        if os.name == \"nt\" and str is bytes:\n            return\n\n        diskcheck_match(self, self.isfile,\n                        \"File %s found where directory expected.\")\n\n    def __clearRepositoryCache(self, duplicate=None):\n        \"\"\"Called when we change the repository(ies) for a directory.\n        This clears any cached information that is invalidated by changing\n        the repository.\"\"\"\n\n        for node in list(self.entries.values()):\n            if node != self.dir:\n                if node != self and isinstance(node, Dir):\n                    node.__clearRepositoryCache(duplicate)\n                else:\n                    node.clear()\n                    try:\n                        del node._srcreps\n                    except AttributeError:\n                        pass\n                    if duplicate is not None:\n                        node.duplicate=duplicate\n\n    def __resetDuplicate(self, node):\n        if node != self:\n            node.duplicate = node.get_dir().duplicate\n\n    def Entry(self, name):\n        \"\"\"\n        Looks up or creates an entry node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Entry(name, self)\n\n    def Dir(self, name, create=True):\n        \"\"\"\n        Looks up or creates a directory node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Dir(name, self, create)\n\n    def File(self, name):\n        \"\"\"\n        Looks up or creates a file node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.File(name, self)\n\n    def link(self, srcdir, duplicate):\n        \"\"\"Set this directory as the variant directory for the\n        supplied source directory.\"\"\"\n        self.srcdir = srcdir\n        self.duplicate = duplicate\n        self.__clearRepositoryCache(duplicate)\n        srcdir.variant_dirs.append(self)\n\n    def getRepositories(self):\n        \"\"\"Returns a list of repositories for this directory.\n        \"\"\"\n        if self.srcdir and not self.duplicate:\n            return self.srcdir.get_all_rdirs() + self.repositories\n        return self.repositories\n\n    @SCons.Memoize.CountMethodCall\n    def get_all_rdirs(self):\n        try:\n            return list(self._memo['get_all_rdirs'])\n        except KeyError:\n            pass\n\n        result = [self]\n        fname = '.'\n        dir = self\n        while dir:\n            for rep in dir.getRepositories():\n                result.append(rep.Dir(fname))\n            if fname == '.':\n                fname = dir.name\n            else:\n                fname = dir.name + OS_SEP + fname\n            dir = dir.up()\n\n        self._memo['get_all_rdirs'] = list(result)\n\n        return result\n\n    def addRepository(self, dir):\n        if dir != self and dir not in self.repositories:\n            self.repositories.append(dir)\n            dir._tpath = '.'\n            self.__clearRepositoryCache()\n\n    def up(self):\n        return self.dir\n\n    def _rel_path_key(self, other):\n        return str(other)\n\n    @SCons.Memoize.CountDictCall(_rel_path_key)\n    def rel_path(self, other):\n        \"\"\"Return a path to \"other\" relative to this directory.\n        \"\"\"\n\n        # This complicated and expensive method, which constructs relative\n        # paths between arbitrary Node.FS objects, is no longer used\n        # by SCons itself.  It was introduced to store dependency paths\n        # in .sconsign files relative to the target, but that ended up\n        # being significantly inefficient.\n        #\n        # We're continuing to support the method because some SConstruct\n        # files out there started using it when it was available, and\n        # we're all about backwards compatibility..\n\n        try:\n            memo_dict = self._memo['rel_path']\n        except KeyError:\n            memo_dict = {}\n            self._memo['rel_path'] = memo_dict\n        else:\n            try:\n                return memo_dict[other]\n            except KeyError:\n                pass\n\n        if self is other:\n            result = '.'\n\n        elif other not in self._path_elements:\n            try:\n                other_dir = other.get_dir()\n            except AttributeError:\n                result = str(other)\n            else:\n                if other_dir is None:\n                    result = other.name\n                else:\n                    dir_rel_path = self.rel_path(other_dir)\n                    if dir_rel_path == '.':\n                        result = other.name\n                    else:\n                        result = dir_rel_path + OS_SEP + other.name\n        else:\n            i = self._path_elements.index(other) + 1\n\n            path_elems = ['..'] * (len(self._path_elements) - i) \\\n                         + [n.name for n in other._path_elements[i:]]\n\n            result = OS_SEP.join(path_elems)\n\n        memo_dict[other] = result\n\n        return result\n\n    def get_env_scanner(self, env, kw={}):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_target_scanner(self):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return this directory's implicit dependencies.\n\n        We don't bother caching the results because the scan typically\n        shouldn't be requested more than once (as opposed to scanning\n        .h file contents, which can be requested as many times as the\n        files is #included by other files).\n        \"\"\"\n        if not scanner:\n            return []\n        # Clear cached info for this Dir.  If we already visited this\n        # directory on our walk down the tree (because we didn't know at\n        # that point it was being used as the source for another Node)\n        # then we may have calculated build signature before realizing\n        # we had to scan the disk.  Now that we have to, though, we need\n        # to invalidate the old calculated signature so that any node\n        # dependent on our directory structure gets one that includes\n        # info about everything on disk.\n        self.clear()\n        return scanner(self, env, path)\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def prepare(self):\n        pass\n\n    def build(self, **kw):\n        \"\"\"A null \"builder\" for directories.\"\"\"\n        global MkdirBuilder\n        if self.builder is not MkdirBuilder:\n            SCons.Node.Node.build(self, **kw)\n\n    #\n    #\n    #\n\n    def _create(self):\n        \"\"\"Create this directory, silently and without worrying about\n        whether the builder is the default or not.\"\"\"\n        listDirs = []\n        parent = self\n        while parent:\n            if parent.exists():\n                break\n            listDirs.append(parent)\n            p = parent.up()\n            if p is None:\n                # Don't use while: - else: for this condition because\n                # if so, then parent is None and has no .path attribute.\n                raise SCons.Errors.StopError(parent._path)\n            parent = p\n        listDirs.reverse()\n        for dirnode in listDirs:\n            try:\n                # Don't call dirnode.build(), call the base Node method\n                # directly because we definitely *must* create this\n                # directory.  The dirnode.build() method will suppress\n                # the build if it's the default builder.\n                SCons.Node.Node.build(dirnode)\n                dirnode.get_executor().nullify()\n                # The build() action may or may not have actually\n                # created the directory, depending on whether the -n\n                # option was used or not.  Delete the _exists and\n                # _rexists attributes so they can be reevaluated.\n                dirnode.clear()\n            except OSError:\n                pass\n\n    def multiple_side_effect_has_builder(self):\n        global MkdirBuilder\n        return self.builder is not MkdirBuilder and self.has_builder()\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        return self.fs.variant_dir_target_climb(self, self, [])\n\n    def scanner_key(self):\n        \"\"\"A directory does not get scanned.\"\"\"\n        return None\n\n    def get_text_contents(self):\n        \"\"\"We already emit things in text, so just return the binary\n        version.\"\"\"\n        return self.get_contents()\n\n    def get_contents(self):\n        \"\"\"Return content signatures and names of all our children\n        separated by new-lines. Ensure that the nodes are sorted.\"\"\"\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_csig(self):\n        \"\"\"Compute the content signature for Directory nodes. In\n        general, this is not needed and the content signature is not\n        stored in the DirNodeInfo. However, if get_contents on a Dir\n        node is called which has a child directory, the child\n        directory should return the hash of its contents.\"\"\"\n        contents = self.get_contents()\n        return SCons.Util.MD5signature(contents)\n\n    def do_duplicate(self, src):\n        pass\n\n    def is_up_to_date(self):\n        \"\"\"If any child is not up-to-date, then this directory isn't,\n        either.\"\"\"\n        if self.builder is not MkdirBuilder and not self.exists():\n            return 0\n        up_to_date = SCons.Node.up_to_date\n        for kid in self.children():\n            if kid.get_state() > up_to_date:\n                return 0\n        return 1\n\n    def rdir(self):\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try: node = dir.entries[norm_name]\n                except KeyError: node = dir.dir_on_disk(self.name)\n                if node and node.exists() and \\\n                    (isinstance(dir, Dir) or isinstance(dir, Entry)):\n                        return node\n        return self\n\n    def sconsign(self):\n        \"\"\"Return the .sconsign file info for this directory. \"\"\"\n        return _sconsign_map[self._func_sconsign](self)\n\n    def srcnode(self):\n        \"\"\"Dir has a special need for srcnode()...if we\n        have a srcdir attribute set, then that *is* our srcnode.\"\"\"\n        if self.srcdir:\n            return self.srcdir\n        return Base.srcnode(self)\n\n    def get_timestamp(self):\n        \"\"\"Return the latest timestamp from among our children\"\"\"\n        stamp = 0\n        for kid in self.children():\n            if kid.get_timestamp() > stamp:\n                stamp = kid.get_timestamp()\n        return stamp\n\n    def get_abspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self._abspath\n\n    def get_labspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self._labspath\n\n    def get_internal_path(self):\n        return self._path\n\n    def get_tpath(self):\n        return self._tpath\n\n    def get_path_elements(self):\n        return self._path_elements\n\n    def entry_abspath(self, name):\n        return self._abspath + OS_SEP + name\n\n    def entry_labspath(self, name):\n        return self._labspath + '/' + name\n\n    def entry_path(self, name):\n        return self._path + OS_SEP + name\n\n    def entry_tpath(self, name):\n        return self._tpath + OS_SEP + name\n\n    def entry_exists_on_disk(self, name):\n        \"\"\" Searches through the file/dir entries of the current\n            directory, and returns True if a physical entry with the given\n            name could be found.\n\n            @see rentry_exists_on_disk\n        \"\"\"\n        try:\n            d = self.on_disk_entries\n        except AttributeError:\n            d = {}\n            try:\n                entries = os.listdir(self._abspath)\n            except OSError:\n                pass\n            else:\n                for entry in map(_my_normcase, entries):\n                    d[entry] = True\n            self.on_disk_entries = d\n        if sys.platform == 'win32' or sys.platform == 'cygwin':\n            name = _my_normcase(name)\n            result = d.get(name)\n            if result is None:\n                # Belt-and-suspenders for Windows:  check directly for\n                # 8.3 file names that don't show up in os.listdir().\n                result = os.path.exists(self._abspath + OS_SEP + name)\n                d[name] = result\n            return result\n        else:\n            return name in d\n\n    def rentry_exists_on_disk(self, name):\n        \"\"\" Searches through the file/dir entries of the current\n            *and* all its remote directories (repos), and returns\n            True if a physical entry with the given name could be found.\n            The local directory (self) gets searched first, so\n            repositories take a lower precedence regarding the\n            searching order.\n\n            @see entry_exists_on_disk\n        \"\"\"\n\n        rentry_exists = self.entry_exists_on_disk(name)\n        if not rentry_exists:\n            # Search through the repository folders\n            norm_name = _my_normcase(name)\n            for rdir in self.get_all_rdirs():\n                try:\n                    node = rdir.entries[norm_name]\n                    if node:\n                        rentry_exists = True\n                        break\n                except KeyError:\n                    if rdir.entry_exists_on_disk(name):\n                        rentry_exists = True\n                        break\n        return rentry_exists\n\n    @SCons.Memoize.CountMethodCall\n    def srcdir_list(self):\n        try:\n            return self._memo['srcdir_list']\n        except KeyError:\n            pass\n\n        result = []\n\n        dirname = '.'\n        dir = self\n        while dir:\n            if dir.srcdir:\n                result.append(dir.srcdir.Dir(dirname))\n            dirname = dir.name + OS_SEP + dirname\n            dir = dir.up()\n\n        self._memo['srcdir_list'] = result\n\n        return result\n\n    def srcdir_duplicate(self, name):\n        for dir in self.srcdir_list():\n            if self.is_under(dir):\n                # We shouldn't source from something in the build path;\n                # variant_dir is probably under src_dir, in which case\n                # we are reflecting.\n                break\n            if dir.entry_exists_on_disk(name):\n                srcnode = dir.Entry(name).disambiguate()\n                if self.duplicate:\n                    node = self.Entry(name).disambiguate()\n                    node.do_duplicate(srcnode)\n                    return node\n                else:\n                    return srcnode\n        return None\n\n    def _srcdir_find_file_key(self, filename):\n        return filename\n\n    @SCons.Memoize.CountDictCall(_srcdir_find_file_key)\n    def srcdir_find_file(self, filename):\n        try:\n            memo_dict = self._memo['srcdir_find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['srcdir_find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[filename]\n            except KeyError:\n                pass\n\n        def func(node):\n            if (isinstance(node, File) or isinstance(node, Entry)) and \\\n               (node.is_derived() or node.exists()):\n                    return node\n            return None\n\n        norm_name = _my_normcase(filename)\n\n        for rdir in self.get_all_rdirs():\n            try: node = rdir.entries[norm_name]\n            except KeyError: node = rdir.file_on_disk(filename)\n            else: node = func(node)\n            if node:\n                result = (node, self)\n                memo_dict[filename] = result\n                return result\n\n        for srcdir in self.srcdir_list():\n            for rdir in srcdir.get_all_rdirs():\n                try: node = rdir.entries[norm_name]\n                except KeyError: node = rdir.file_on_disk(filename)\n                else: node = func(node)\n                if node:\n                    result = (File(filename, self, self.fs), srcdir)\n                    memo_dict[filename] = result\n                    return result\n\n        result = (None, None)\n        memo_dict[filename] = result\n        return result\n\n    def dir_on_disk(self, name):\n        if self.entry_exists_on_disk(name):\n            try: return self.Dir(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, File):\n            return None\n        return node\n\n    def file_on_disk(self, name):\n        if self.entry_exists_on_disk(name):\n            try: return self.File(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, Dir):\n            return None\n        return node\n\n    def walk(self, func, arg):\n        \"\"\"\n        Walk this directory tree by calling the specified function\n        for each directory in the tree.\n\n        This behaves like the os.path.walk() function, but for in-memory\n        Node.FS.Dir objects.  The function takes the same arguments as\n        the functions passed to os.path.walk():\n\n                func(arg, dirname, fnames)\n\n        Except that \"dirname\" will actually be the directory *Node*,\n        not the string.  The '.' and '..' entries are excluded from\n        fnames.  The fnames list may be modified in-place to filter the\n        subdirectories visited or otherwise impose a specific order.\n        The \"arg\" argument is always passed to func() and may be used\n        in any way (or ignored, passing None is common).\n        \"\"\"\n        entries = self.entries\n        names = list(entries.keys())\n        names.remove('.')\n        names.remove('..')\n        func(arg, self, names)\n        for dirname in [n for n in names if isinstance(entries[n], Dir)]:\n            entries[dirname].walk(func, arg)\n\n    def glob(self, pathname, ondisk=True, source=False, strings=False, exclude=None):\n        \"\"\"\n        Returns a list of Nodes (or strings) matching a specified\n        pathname pattern.\n\n        Pathname patterns follow UNIX shell semantics:  * matches\n        any-length strings of any characters, ? matches any character,\n        and [] can enclose lists or ranges of characters.  Matches do\n        not span directory separators.\n\n        The matches take into account Repositories, returning local\n        Nodes if a corresponding entry exists in a Repository (either\n        an in-memory Node or something on disk).\n\n        By defafult, the glob() function matches entries that exist\n        on-disk, in addition to in-memory Nodes.  Setting the \"ondisk\"\n        argument to False (or some other non-true value) causes the glob()\n        function to only match in-memory Nodes.  The default behavior is\n        to return both the on-disk and in-memory Nodes.\n\n        The \"source\" argument, when true, specifies that corresponding\n        source Nodes must be returned if you're globbing in a build\n        directory (initialized with VariantDir()).  The default behavior\n        is to return Nodes local to the VariantDir().\n\n        The \"strings\" argument, when true, returns the matches as strings,\n        not Nodes.  The strings are path names relative to this directory.\n\n        The \"exclude\" argument, if not None, must be a pattern or a list\n        of patterns following the same UNIX shell semantics.\n        Elements matching a least one pattern of this list will be excluded\n        from the result.\n\n        The underlying algorithm is adapted from the glob.glob() function\n        in the Python library (but heavily modified), and uses fnmatch()\n        under the covers.\n        \"\"\"\n        dirname, basename = os.path.split(pathname)\n        if not dirname:\n            result = self._glob1(basename, ondisk, source, strings)\n        else:\n            if has_glob_magic(dirname):\n                list = self.glob(dirname, ondisk, source, False, exclude)\n            else:\n                list = [self.Dir(dirname, create=True)]\n            result = []\n            for dir in list:\n                r = dir._glob1(basename, ondisk, source, strings)\n                if strings:\n                    r = [os.path.join(str(dir), x) for x in r]\n                result.extend(r)\n        if exclude:\n            excludes = []\n            excludeList = SCons.Util.flatten(exclude)\n            for x in excludeList:\n                r = self.glob(x, ondisk, source, strings)\n                excludes.extend(r)\n            result = [x for x in result if not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes))]\n        return sorted(result, key=lambda a: str(a))\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        \"\"\"\n        Globs for and returns a list of entry names matching a single\n        pattern in this directory.\n\n        This searches any repositories and source directories for\n        corresponding entries and returns a Node (or string) relative\n        to the current directory if an entry is found anywhere.\n\n        TODO: handle pattern with no wildcard\n        \"\"\"\n        search_dir_list = self.get_all_rdirs()\n        for srcdir in self.srcdir_list():\n            search_dir_list.extend(srcdir.get_all_rdirs())\n\n        selfEntry = self.Entry\n        names = []\n        for dir in search_dir_list:\n            # We use the .name attribute from the Node because the keys of\n            # the dir.entries dictionary are normalized (that is, all upper\n            # case) on case-insensitive systems like Windows.\n            node_names = [ v.name for k, v in dir.entries.items()\n                           if k not in ('.', '..') ]\n            names.extend(node_names)\n            if not strings:\n                # Make sure the working directory (self) actually has\n                # entries for all Nodes in repositories or variant dirs.\n                for name in node_names: selfEntry(name)\n            if ondisk:\n                try:\n                    disk_names = os.listdir(dir._abspath)\n                except os.error:\n                    continue\n                names.extend(disk_names)\n                if not strings:\n                    # We're going to return corresponding Nodes in\n                    # the local directory, so we need to make sure\n                    # those Nodes exist.  We only want to create\n                    # Nodes for the entries that will match the\n                    # specified pattern, though, which means we\n                    # need to filter the list here, even though\n                    # the overall list will also be filtered later,\n                    # after we exit this loop.\n                    if pattern[0] != '.':\n                        disk_names = [x for x in disk_names if x[0] != '.']\n                    disk_names = fnmatch.filter(disk_names, pattern)\n                    dirEntry = dir.Entry\n                    for name in disk_names:\n                        # Add './' before disk filename so that '#' at\n                        # beginning of filename isn't interpreted.\n                        name = './' + name\n                        node = dirEntry(name).disambiguate()\n                        n = selfEntry(name)\n                        if n.__class__ != node.__class__:\n                            n.__class__ = node.__class__\n                            n._morph()\n\n        names = set(names)\n        if pattern[0] != '.':\n            names = [x for x in names if x[0] != '.']\n        names = fnmatch.filter(names, pattern)\n\n        if strings:\n            return names\n\n        return [self.entries[_my_normcase(n)] for n in names]\n\nclass RootDir(Dir):\n    \"\"\"A class for the root directory of a file system.\n\n    This is the same as a Dir class, except that the path separator\n    ('/' or '\\\\') is actually part of the name, so we don't need to\n    add a separator when creating the path names of entries within\n    this directory.\n    \"\"\"\n\n    __slots__ = ('_lookupDict', )\n\n    def __init__(self, drive, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')\n        SCons.Node.Node.__init__(self)\n\n        # Handle all the types of drives:\n        if drive == '':\n            # No drive, regular UNIX root or Windows default drive.\n            name = OS_SEP\n            dirname = OS_SEP\n        elif drive == '//':\n            # UNC path\n            name = UNC_PREFIX\n            dirname = UNC_PREFIX\n        else:\n            # Windows drive letter\n            name = drive\n            dirname = drive + OS_SEP\n\n        # Filename with extension as it was specified when the object was\n        # created; to obtain filesystem path, use Python str() function\n        self.name = SCons.Util.silent_intern(name)\n        self.fs = fs #: Reference to parent Node.FS object\n\n        self._path_elements = [self]\n        self.dir = self\n        self._func_rexists = 2\n        self._func_target_from_source = 1\n        self.store_info = 1\n\n        # Now set our paths to what we really want them to be. The\n        # name should already contain any necessary separators, such\n        # as the initial drive letter (the name) plus the directory\n        # separator, except for the \"lookup abspath,\" which does not\n        # have the drive letter.\n        self._abspath = dirname\n        self._labspath = ''\n        self._path = dirname\n        self._tpath = dirname\n        self.dirname = dirname\n\n        self._morph()\n\n        self.duplicate = 0\n        self._lookupDict = {}\n\n        self._lookupDict[''] = self\n        self._lookupDict['/'] = self\n        self.root = self\n        # The // entry is necessary because os.path.normpath()\n        # preserves double slashes at the beginning of a path on Posix\n        # platforms.\n        if not has_unc:\n            self._lookupDict['//'] = self\n\n    def _morph(self):\n        \"\"\"Turn a file system Node (either a freshly initialized directory\n        object or a separate Entry object) into a proper directory object.\n\n        Set up this directory's entries and hook it into the file\n        system tree.  Specify that directories (this Node) don't use\n        signatures for calculating whether they're current.\n        \"\"\"\n\n        self.repositories = []\n        self.srcdir = None\n\n        self.entries = {}\n        self.entries['.'] = self\n        self.entries['..'] = self.dir\n        self.cwd = self\n        self.searched = 0\n        self._sconsign = None\n        self.variant_dirs = []\n        self.changed_since_last_build = 3\n        self._func_sconsign = 1\n        self._func_exists = 2\n        self._func_get_contents = 2\n\n        # Don't just reset the executor, replace its action list,\n        # because it might have some pre-or post-actions that need to\n        # be preserved.\n        #\n        # But don't reset the executor if there is a non-null executor\n        # attached already. The existing executor might have other\n        # targets, in which case replacing the action list with a\n        # Mkdir action is a big mistake.\n        if not hasattr(self, 'executor'):\n            self.builder = get_MkdirBuilder()\n            self.get_executor().set_action_list(self.builder.action)\n        else:\n            # Prepend MkdirBuilder action to existing action list\n            l = self.get_executor().action_list\n            a = get_MkdirBuilder().action\n            l.insert(0, a)\n            self.get_executor().set_action_list(l)\n\n\n    def must_be_same(self, klass):\n        if klass is Dir:\n            return\n        Base.must_be_same(self, klass)\n\n    def _lookup_abs(self, p, klass, create=1):\n        \"\"\"\n        Fast (?) lookup of a *normalized* absolute path.\n\n        This method is intended for use by internal lookups with\n        already-normalized path data.  For general-purpose lookups,\n        use the FS.Entry(), FS.Dir() or FS.File() methods.\n\n        The caller is responsible for making sure we're passed a\n        normalized absolute path; we merely let Python's dictionary look\n        up and return the One True Node.FS object for the path.\n\n        If a Node for the specified \"p\" doesn't already exist, and\n        \"create\" is specified, the Node may be created after recursive\n        invocation to find or create the parent directory or directories.\n        \"\"\"\n        k = _my_normcase(p)\n        try:\n            result = self._lookupDict[k]\n        except KeyError:\n            if not create:\n                msg = \"No such file or directory: '%s' in '%s' (and create is False)\" % (p, str(self))\n                raise SCons.Errors.UserError(msg)\n            # There is no Node for this path name, and we're allowed\n            # to create it.\n            dir_name, file_name = p.rsplit('/',1)\n            dir_node = self._lookup_abs(dir_name, Dir)\n            result = klass(file_name, dir_node, self.fs)\n\n            # Double-check on disk (as configured) that the Node we\n            # created matches whatever is out there in the real world.\n            result.diskcheck_match()\n\n            self._lookupDict[k] = result\n            dir_node.entries[_my_normcase(file_name)] = result\n            dir_node.implicit = None\n        else:\n            # There is already a Node for this path name.  Allow it to\n            # complain if we were looking for an inappropriate type.\n            result.must_be_same(klass)\n        return result\n\n    def __str__(self):\n        return self._abspath\n\n    def entry_abspath(self, name):\n        return self._abspath + name\n\n    def entry_labspath(self, name):\n        return '/' + name\n\n    def entry_path(self, name):\n        return self._path + name\n\n    def entry_tpath(self, name):\n        return self._tpath + name\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return 0\n\n    def up(self):\n        return None\n\n    def get_dir(self):\n        return None\n\n    def src_builder(self):\n        return _null\n\n\nclass FileNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig', 'timestamp', 'size')\n    current_version_id = 2\n\n    field_list = ['csig', 'timestamp', 'size']\n\n    # This should get reset by the FS initialization.\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.get_labspath() + '/' + s\n        return root._lookup_abs(s, Entry)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj, '__slots__', ()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n    def __eq__(self, other):\n        return self.csig == other.csig and self.timestamp == other.timestamp and self.size == other.size\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n\nclass FileBuildInfo(SCons.Node.BuildInfoBase):\n    \"\"\"\n    This is info loaded from sconsign.\n\n    Attributes unique to FileBuildInfo:\n        dependency_map : Caches file->csig mapping\n                    for all dependencies.  Currently this is only used when using\n                    MD5-timestamp decider.\n                    It's used to ensure that we copy the correct\n                    csig from previous build to be written to .sconsign when current build\n                    is done. Previously the matching of csig to file was strictly by order\n                    they appeared in bdepends, bsources, or bimplicit, and so a change in order\n                    or count of any of these could yield writing wrong csig, and then false positive\n                    rebuilds\n    \"\"\"\n    __slots__ = ['dependency_map', ]\n    current_version_id = 2\n\n    def __setattr__(self, key, value):\n\n        # If any attributes are changed in FileBuildInfo, we need to\n        # invalidate the cached map of file name to content signature\n        # heald in dependency_map. Currently only used with\n        # MD5-timestamp decider\n        if key != 'dependency_map' and hasattr(self, 'dependency_map'):\n            del self.dependency_map\n\n        return super(FileBuildInfo, self).__setattr__(key, value)\n\n    def convert_to_sconsign(self):\n        \"\"\"\n        Converts this FileBuildInfo object for writing to a .sconsign file\n\n        This replaces each Node in our various dependency lists with its\n        usual string representation: relative to the top-level SConstruct\n        directory, or an absolute path if it's outside.\n        \"\"\"\n        if os_sep_is_slash:\n            node_to_str = str\n        else:\n            def node_to_str(n):\n                try:\n                    s = n.get_internal_path()\n                except AttributeError:\n                    s = str(n)\n                else:\n                    s = s.replace(OS_SEP, '/')\n                return s\n        for attr in ['bsources', 'bdepends', 'bimplicit']:\n            try:\n                val = getattr(self, attr)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, attr, list(map(node_to_str, val)))\n\n    def convert_from_sconsign(self, dir, name):\n        \"\"\"\n        Converts a newly-read FileBuildInfo object for in-SCons use\n\n        For normal up-to-date checking, we don't have any conversion to\n        perform--but we're leaving this method here to make that clear.\n        \"\"\"\n        pass\n\n    def prepare_dependencies(self):\n        \"\"\"\n        Prepares a FileBuildInfo object for explaining what changed\n\n        The bsources, bdepends and bimplicit lists have all been\n        stored on disk as paths relative to the top-level SConstruct\n        directory.  Convert the strings to actual Nodes (for use by the\n        --debug=explain code and --implicit-cache).\n        \"\"\"\n        attrs = [\n            ('bsources', 'bsourcesigs'),\n            ('bdepends', 'bdependsigs'),\n            ('bimplicit', 'bimplicitsigs'),\n        ]\n        for (nattr, sattr) in attrs:\n            try:\n                strings = getattr(self, nattr)\n                nodeinfos = getattr(self, sattr)\n            except AttributeError:\n                continue\n            if strings is None or nodeinfos is None:\n                continue\n            nodes = []\n            for s, ni in zip(strings, nodeinfos):\n                if not isinstance(s, SCons.Node.Node):\n                    s = ni.str_to_node(s)\n                nodes.append(s)\n            setattr(self, nattr, nodes)\n\n    def format(self, names=0):\n        result = []\n        bkids = self.bsources + self.bdepends + self.bimplicit\n        bkidsigs = self.bsourcesigs + self.bdependsigs + self.bimplicitsigs\n        for bkid, bkidsig in zip(bkids, bkidsigs):\n            result.append(str(bkid) + ': ' +\n                          ' '.join(bkidsig.format(names=names)))\n        if not hasattr(self,'bact'):\n            self.bact = \"none\"\n        result.append('%s [%s]' % (self.bactsig, self.bact))\n        return '\\n'.join(result)\n\n\nclass File(Base):\n    \"\"\"A class for files in a file system.\n    \"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    NodeInfo = FileNodeInfo\n    BuildInfo = FileBuildInfo\n\n    md5_chunksize = 64\n\n    def diskcheck_match(self):\n        diskcheck_match(self, self.isdir,\n                        \"Directory %s found where file expected.\")\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def Entry(self, name):\n        \"\"\"Create an entry node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Entry(name)\n\n    def Dir(self, name, create=True):\n        \"\"\"Create a directory node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Dir(name, create=create)\n\n    def Dirs(self, pathlist):\n        \"\"\"Create a list of directories relative to the SConscript\n        directory of this file.\"\"\"\n        return [self.Dir(p) for p in pathlist]\n\n    def File(self, name):\n        \"\"\"Create a file node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.File(name)\n\n    def _morph(self):\n        \"\"\"Turn a file system node into a File object.\"\"\"\n        self.scanner_paths = {}\n        if not hasattr(self, '_local'):\n            self._local = 0\n        if not hasattr(self, 'released_target_info'):\n            self.released_target_info = False\n\n        self.store_info = 1\n        self._func_exists = 4\n        self._func_get_contents = 3\n\n        # Initialize this Node's decider function to decide_source() because\n        # every file is a source file until it has a Builder attached...\n        self.changed_since_last_build = 4\n\n        # If there was already a Builder set on this entry, then\n        # we need to make sure we call the target-decider function,\n        # not the source-decider.  Reaching in and doing this by hand\n        # is a little bogus.  We'd prefer to handle this by adding\n        # an Entry.builder_set() method that disambiguates like the\n        # other methods, but that starts running into problems with the\n        # fragile way we initialize Dir Nodes with their Mkdir builders,\n        # yet still allow them to be overridden by the user.  Since it's\n        # not clear right now how to fix that, stick with what works\n        # until it becomes clear...\n        if self.has_builder():\n            self.changed_since_last_build = 5\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self):\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_text_contents(self):\n        \"\"\"\n        This attempts to figure out what the encoding of the text is\n        based upon the BOM bytes, and then decodes the contents so that\n        it's a valid python string.\n        \"\"\"\n        contents = self.get_contents()\n        # The behavior of various decode() methods and functions\n        # w.r.t. the initial BOM bytes is different for different\n        # encodings and/or Python versions.  ('utf-8' does not strip\n        # them, but has a 'utf-8-sig' which does; 'utf-16' seems to\n        # strip them; etc.)  Just sidestep all the complication by\n        # explicitly stripping the BOM before we decode().\n        if contents[:len(codecs.BOM_UTF8)] == codecs.BOM_UTF8:\n            return contents[len(codecs.BOM_UTF8):].decode('utf-8')\n        if contents[:len(codecs.BOM_UTF16_LE)] == codecs.BOM_UTF16_LE:\n            return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le')\n        if contents[:len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE:\n            return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')\n        try:\n            return contents.decode('utf-8')\n        except UnicodeDecodeError as e:\n            try:\n                return contents.decode('latin-1')\n            except UnicodeDecodeError as e:\n                return contents.decode('utf-8', error='backslashreplace')\n\n\n    def get_content_hash(self):\n        \"\"\"\n        Compute and return the MD5 hash for this file.\n        \"\"\"\n        if not self.rexists():\n            return SCons.Util.MD5signature('')\n        fname = self.rfile().get_abspath()\n        try:\n            cs = SCons.Util.MD5filesignature(fname,\n                chunksize=SCons.Node.FS.File.md5_chunksize*1024)\n        except EnvironmentError as e:\n            if not e.filename:\n                e.filename = fname\n            raise\n        return cs\n\n    @SCons.Memoize.CountMethodCall\n    def get_size(self):\n        try:\n            return self._memo['get_size']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            size = self.rfile().getsize()\n        else:\n            size = 0\n\n        self._memo['get_size'] = size\n\n        return size\n\n    @SCons.Memoize.CountMethodCall\n    def get_timestamp(self):\n        try:\n            return self._memo['get_timestamp']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            timestamp = self.rfile().getmtime()\n        else:\n            timestamp = 0\n\n        self._memo['get_timestamp'] = timestamp\n\n        return timestamp\n\n    convert_copy_attrs = [\n        'bsources',\n        'bimplicit',\n        'bdepends',\n        'bact',\n        'bactsig',\n        'ninfo',\n    ]\n\n\n    convert_sig_attrs = [\n        'bsourcesigs',\n        'bimplicitsigs',\n        'bdependsigs',\n    ]\n\n    def convert_old_entry(self, old_entry):\n        # Convert a .sconsign entry from before the Big Signature\n        # Refactoring, doing what we can to convert its information\n        # to the new .sconsign entry format.\n        #\n        # The old format looked essentially like this:\n        #\n        #   BuildInfo\n        #       .ninfo (NodeInfo)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bsources\n        #       .bsourcesigs (\"signature\" list)\n        #       .bdepends\n        #       .bdependsigs (\"signature\" list)\n        #       .bimplicit\n        #       .bimplicitsigs (\"signature\" list)\n        #       .bact\n        #       .bactsig\n        #\n        # The new format looks like this:\n        #\n        #   .ninfo (NodeInfo)\n        #       .bsig\n        #       .csig\n        #       .timestamp\n        #       .size\n        #   .binfo (BuildInfo)\n        #       .bsources\n        #       .bsourcesigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bdepends\n        #       .bdependsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bimplicit\n        #       .bimplicitsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bact\n        #       .bactsig\n        #\n        # The basic idea of the new structure is that a NodeInfo always\n        # holds all available information about the state of a given Node\n        # at a certain point in time.  The various .b*sigs lists can just\n        # be a list of pointers to the .ninfo attributes of the different\n        # dependent nodes, without any copying of information until it's\n        # time to pickle it for writing out to a .sconsign file.\n        #\n        # The complicating issue is that the *old* format only stored one\n        # \"signature\" per dependency, based on however the *last* build\n        # was configured.  We don't know from just looking at it whether\n        # it was a build signature, a content signature, or a timestamp\n        # \"signature\".  Since we no longer use build signatures, the\n        # best we can do is look at the length and if it's thirty two,\n        # assume that it was (or might have been) a content signature.\n        # If it was actually a build signature, then it will cause a\n        # rebuild anyway when it doesn't match the new content signature,\n        # but that's probably the best we can do.\n        import SCons.SConsign\n        new_entry = SCons.SConsign.SConsignEntry()\n        new_entry.binfo = self.new_binfo()\n        binfo = new_entry.binfo\n        for attr in self.convert_copy_attrs:\n            try:\n                value = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        for attr in self.convert_sig_attrs:\n            try:\n                sig_list = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            value = []\n            for sig in sig_list:\n                ninfo = self.new_ninfo()\n                if len(sig) == 32:\n                    ninfo.csig = sig\n                else:\n                    ninfo.timestamp = sig\n                value.append(ninfo)\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        return new_entry\n\n    @SCons.Memoize.CountMethodCall\n    def get_stored_info(self):\n        try:\n            return self._memo['get_stored_info']\n        except KeyError:\n            pass\n\n        try:\n            sconsign_entry = self.dir.sconsign().get_entry(self.name)\n        except (KeyError, EnvironmentError):\n            import SCons.SConsign\n            sconsign_entry = SCons.SConsign.SConsignEntry()\n            sconsign_entry.binfo = self.new_binfo()\n            sconsign_entry.ninfo = self.new_ninfo()\n        else:\n            if isinstance(sconsign_entry, FileBuildInfo):\n                # This is a .sconsign file from before the Big Signature\n                # Refactoring; convert it as best we can.\n                sconsign_entry = self.convert_old_entry(sconsign_entry)\n            try:\n                delattr(sconsign_entry.ninfo, 'bsig')\n            except AttributeError:\n                pass\n\n        self._memo['get_stored_info'] = sconsign_entry\n\n        return sconsign_entry\n\n    def get_stored_implicit(self):\n        binfo = self.get_stored_info().binfo\n        binfo.prepare_dependencies()\n        try: return binfo.bimplicit\n        except AttributeError: return None\n\n    def rel_path(self, other):\n        return self.dir.rel_path(other)\n\n    def _get_found_includes_key(self, env, scanner, path):\n        return (id(env), id(scanner), path)\n\n    @SCons.Memoize.CountDictCall(_get_found_includes_key)\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the included implicit dependencies in this file.\n        Cache results so we only scan the file once per path\n        regardless of how many times this information is requested.\n        \"\"\"\n        memo_key = (id(env), id(scanner), path)\n        try:\n            memo_dict = self._memo['get_found_includes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_found_includes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if scanner:\n            result = [n.disambiguate() for n in scanner(self, env, path)]\n        else:\n            result = []\n\n        memo_dict[memo_key] = result\n\n        return result\n\n    def _createDir(self):\n        # ensure that the directories for this node are\n        # created.\n        self.dir._create()\n\n    def push_to_cache(self):\n        \"\"\"Try to push the node into a cache\n        \"\"\"\n        # This should get called before the Nodes' .built() method is\n        # called, which would clear the build signature if the file has\n        # a source scanner.\n        #\n        # We have to clear the local memoized values *before* we push\n        # the node to cache so that the memoization of the self.exists()\n        # return value doesn't interfere.\n        if self.nocache:\n            return\n        self.clear_memoized_values()\n        if self.exists():\n            self.get_build_env().get_CacheDir().push(self)\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        if self.nocache:\n            return None\n        if not self.is_derived():\n            return None\n        return self.get_build_env().get_CacheDir().retrieve(self)\n\n    def visited(self):\n        if self.exists() and self.executor is not None:\n            self.get_build_env().get_CacheDir().push_if_forced(self)\n\n        ninfo = self.get_ninfo()\n\n        csig = self.get_max_drift_csig()\n        if csig:\n            ninfo.csig = csig\n\n        ninfo.timestamp = self.get_timestamp()\n        ninfo.size      = self.get_size()\n\n        if not self.has_builder():\n            # This is a source file, but it might have been a target file\n            # in another build that included more of the DAG.  Copy\n            # any build information that's stored in the .sconsign file\n            # into our binfo object so it doesn't get lost.\n            old = self.get_stored_info()\n            self.get_binfo().merge(old.binfo)\n\n        SCons.Node.store_info_map[self.store_info](self)\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n         up-to-date or was built completely.\n\n         This is where we try to release as many target node infos\n         as possible for clean builds and update runs, in order\n         to minimize the overall memory consumption.\n\n         We'd like to remove a lot more attributes like self.sources\n         and self.sources_set, but they might get used\n         in a next build step. For example, during configuration\n         the source files for a built E{*}.o file are used to figure out\n         which linker to use for the resulting Program (gcc vs. g++)!\n         That's why we check for the 'keep_targetinfo' attribute,\n         config Nodes and the Interactive mode just don't allow\n         an early release of most variables.\n\n         In the same manner, we can't simply remove the self.attributes\n         here. The smart linking relies on the shared flag, and some\n         parts of the java Tool use it to transport information\n         about nodes...\n\n         @see: built() and Node.release_target_info()\n         \"\"\"\n        if (self.released_target_info or SCons.Node.interactive):\n            return\n\n        if not hasattr(self.attributes, 'keep_targetinfo'):\n            # Cache some required values, before releasing\n            # stuff like env, executor and builder...\n            self.changed(allowcache=True)\n            self.get_contents_sig()\n            self.get_build_env()\n            # Now purge unneeded stuff to free memory...\n            self.executor = None\n            self._memo.pop('rfile', None)\n            self.prerequisites = None\n            # Cleanup lists, but only if they're empty\n            if not len(self.ignore_set):\n                self.ignore_set = None\n            if not len(self.implicit_set):\n                self.implicit_set = None\n            if not len(self.depends_set):\n                self.depends_set = None\n            if not len(self.ignore):\n                self.ignore = None\n            if not len(self.depends):\n                self.depends = None\n            # Mark this node as done, we only have to release\n            # the memory once...\n            self.released_target_info = True\n\n    def find_src_builder(self):\n        if self.rexists():\n            return None\n        scb = self.dir.src_builder()\n        if scb is _null:\n            scb = None\n        if scb is not None:\n            try:\n                b = self.builder\n            except AttributeError:\n                b = None\n            if b is None:\n                self.builder_set(scb)\n        return scb\n\n    def has_src_builder(self):\n        \"\"\"Return whether this Node has a source builder or not.\n\n        If this Node doesn't have an explicit source code builder, this\n        is where we figure out, on the fly, if there's a transparent\n        source code builder for it.\n\n        Note that if we found a source builder, we also set the\n        self.builder attribute, so that all of the methods that actually\n        *build* this file don't have to do anything different.\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.sbuilder = self.find_src_builder()\n        return scb is not None\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        if self.is_derived():\n            return [], None\n        return self.fs.variant_dir_target_climb(self, self.dir, [self.name])\n\n    def _rmv_existing(self):\n        self.clear_memoized_values()\n        if SCons.Node.print_duplicate:\n            print(\"dup: removing existing target {}\".format(self))\n        e = Unlink(self, [], None)\n        if isinstance(e, SCons.Errors.BuildError):\n            raise e\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        self.has_src_builder()\n        self.get_binfo()\n\n    def prepare(self):\n        \"\"\"Prepare for this file to be created.\"\"\"\n        SCons.Node.Node.prepare(self)\n\n        if self.get_state() != SCons.Node.up_to_date:\n            if self.exists():\n                if self.is_derived() and not self.precious:\n                    self._rmv_existing()\n            else:\n                try:\n                    self._createDir()\n                except SCons.Errors.StopError as drive:\n                    raise SCons.Errors.StopError(\"No drive `{}' for target `{}'.\".format(drive, self))\n\n    #\n    #\n    #\n\n    def remove(self):\n        \"\"\"Remove this file.\"\"\"\n        if self.exists() or self.islink():\n            self.fs.unlink(self.get_internal_path())\n            return 1\n        return None\n\n    def do_duplicate(self, src):\n        self._createDir()\n        if SCons.Node.print_duplicate:\n            print(\"dup: relinking variant '{}' from '{}'\".format(self, src))\n        Unlink(self, None, None)\n        e = Link(self, src, None)\n        if isinstance(e, SCons.Errors.BuildError):\n            raise SCons.Errors.StopError(\"Cannot duplicate `{}' in `{}': {}.\".format(src.get_internal_path(), self.dir._path, e.errstr))\n        self.linked = 1\n        # The Link() action may or may not have actually\n        # created the file, depending on whether the -n\n        # option was used or not.  Delete the _exists and\n        # _rexists attributes so they can be reevaluated.\n        self.clear()\n\n    @SCons.Memoize.CountMethodCall\n    def exists(self):\n        try:\n            return self._memo['exists']\n        except KeyError:\n            pass\n        result = SCons.Node._exists_map[self._func_exists](self)\n        self._memo['exists'] = result\n        return result\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    def get_max_drift_csig(self):\n        \"\"\"\n        Returns the content signature currently stored for this node\n        if it's been unmodified longer than the max_drift value, or the\n        max_drift value is 0.  Returns None otherwise.\n        \"\"\"\n        old = self.get_stored_info()\n        mtime = self.get_timestamp()\n\n        max_drift = self.fs.max_drift\n        if max_drift > 0:\n            if (time.time() - mtime) > max_drift:\n                try:\n                    n = old.ninfo\n                    if n.timestamp and n.csig and n.timestamp == mtime:\n                        return n.csig\n                except AttributeError:\n                    pass\n        elif max_drift == 0:\n            try:\n                return old.ninfo.csig\n            except AttributeError:\n                pass\n\n        return None\n\n    def get_csig(self):\n        \"\"\"\n        Generate a node's content signature, the digested signature\n        of its content.\n\n        node - the node\n        cache - alternate node to use for the signature cache\n        returns - the content signature\n        \"\"\"\n        ninfo = self.get_ninfo()\n        try:\n            return ninfo.csig\n        except AttributeError:\n            pass\n\n        csig = self.get_max_drift_csig()\n        if csig is None:\n\n            try:\n                if self.get_size() < SCons.Node.FS.File.md5_chunksize:\n                    contents = self.get_contents()\n                else:\n                    csig = self.get_content_hash()\n            except IOError:\n                # This can happen if there's actually a directory on-disk,\n                # which can be the case if they've disabled disk checks,\n                # or if an action with a File target actually happens to\n                # create a same-named directory by mistake.\n                csig = ''\n            else:\n                if not csig:\n                    csig = SCons.Util.MD5signature(contents)\n\n        ninfo.csig = csig\n\n        return csig\n\n    #\n    # DECISION SUBSYSTEM\n    #\n\n    def builder_set(self, builder):\n        SCons.Node.Node.builder_set(self, builder)\n        self.changed_since_last_build = 5\n\n    def built(self):\n        \"\"\"Called just after this File node is successfully built.\n\n         Just like for 'release_target_info' we try to release\n         some more target node attributes in order to minimize the\n         overall memory consumption.\n\n         @see: release_target_info\n        \"\"\"\n\n        SCons.Node.Node.built(self)\n\n        if (not SCons.Node.interactive and\n            not hasattr(self.attributes, 'keep_targetinfo')):\n            # Ensure that the build infos get computed and cached...\n            SCons.Node.store_info_map[self.store_info](self)\n            # ... then release some more variables.\n            self._specific_sources = False\n            self._labspath = None\n            self._save_str()\n            self.cwd = None\n\n            self.scanner_paths = None\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.\n\n        For File nodes this is basically a wrapper around Node.changed(),\n        but we allow the return value to get cached after the reference\n        to the Executor got released in release_target_info().\n\n        @see: Node.changed()\n        \"\"\"\n        if node is None:\n            try:\n                return self._memo['changed']\n            except KeyError:\n                pass\n\n        has_changed = SCons.Node.Node.changed(self, node)\n        if allowcache:\n            self._memo['changed'] = has_changed\n        return has_changed\n\n    def changed_content(self, target, prev_ni, repo_node=None):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def changed_state(self, target, prev_ni, repo_node=None):\n        return self.state != SCons.Node.up_to_date\n\n\n    # Caching node -> string mapping for the below method\n    __dmap_cache = {}\n    __dmap_sig_cache = {}\n\n\n    def _build_dependency_map(self, binfo):\n        \"\"\"\n        Build mapping from file -> signature\n\n        Args:\n            self - self\n            binfo - buildinfo from node being considered\n\n        Returns:\n            dictionary of file->signature mappings\n        \"\"\"\n\n        # For an \"empty\" binfo properties like bsources\n        # do not exist: check this to avoid exception.\n        if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) + \\\n            len(binfo.bimplicitsigs)) == 0:\n            return {}\n\n        binfo.dependency_map = { child:signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit),\n                                     chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))}\n\n        return binfo.dependency_map\n\n    # @profile\n    def _add_strings_to_dependency_map(self, dmap):\n        \"\"\"\n        In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map\n        :return:\n        \"\"\"\n\n        first_string = str(next(iter(dmap)))\n\n        # print(\"DMAP:%s\"%id(dmap))\n        if first_string not in dmap:\n                string_dict = {str(child): signature for child, signature in dmap.items()}\n                dmap.update(string_dict)\n        return dmap\n\n    def _get_previous_signatures(self, dmap):\n        \"\"\"\n        Return a list of corresponding csigs from previous\n        build in order of the node/files in children.\n\n        Args:\n            self - self\n            dmap - Dictionary of file -> csig\n\n        Returns:\n            List of csigs for provided list of children\n        \"\"\"\n        prev = []\n        # MD5_TIMESTAMP_DEBUG = False\n\n        if len(dmap) == 0:\n            if MD5_TIMESTAMP_DEBUG: print(\"Nothing dmap shortcutting\")\n            return None\n        elif MD5_TIMESTAMP_DEBUG: print(\"len(dmap):%d\"%len(dmap))\n\n\n        # First try retrieving via Node\n        if MD5_TIMESTAMP_DEBUG: print(\"Checking if self is in  map:%s id:%s type:%s\"%(str(self), id(self), type(self)))\n        df = dmap.get(self, False)\n        if df:\n            return df\n\n        # Now check if self's repository file is in map.\n        rf = self.rfile()\n        if MD5_TIMESTAMP_DEBUG: print(\"Checking if self.rfile  is in  map:%s id:%s type:%s\"%(str(rf), id(rf), type(rf)))\n        rfm = dmap.get(rf, False)\n        if rfm:\n            return rfm\n\n        # get default string for node and then also string swapping os.altsep for os.sep (/ for \\)\n        c_strs = [str(self)]\n\n        if os.altsep:\n            c_strs.append(c_strs[0].replace(os.sep, os.altsep))\n\n        # In some cases the dependency_maps' keys are already strings check.\n        # Check if either string is now in dmap.\n        for s in c_strs:\n            if MD5_TIMESTAMP_DEBUG: print(\"Checking if str(self) is in map  :%s\" % s)\n            df = dmap.get(s, False)\n            if df:\n                return df\n\n        # Strings don't exist in map, add them and try again\n        # If there are no strings in this dmap, then add them.\n        # This may not be necessary, we could walk the nodes in the dmap and check each string\n        # rather than adding ALL the strings to dmap. In theory that would be n/2 vs 2n str() calls on node\n        # if not dmap.has_strings:\n        dmap = self._add_strings_to_dependency_map(dmap)\n\n        # In some cases the dependency_maps' keys are already strings check.\n        # Check if either string is now in dmap.\n        for s in c_strs:\n            if MD5_TIMESTAMP_DEBUG: print(\"Checking if str(self) is in map (now with strings)  :%s\" % s)\n            df = dmap.get(s, False)\n            if df:\n                return df\n\n        # Lastly use nodes get_path() to generate string and see if that's in dmap\n        if not df:\n            try:\n                # this should yield a path which matches what's in the sconsign\n                c_str = self.get_path()\n                if os.altsep:\n                    c_str = c_str.replace(os.sep, os.altsep)\n\n                if MD5_TIMESTAMP_DEBUG: print(\"Checking if self.get_path is in map (now with strings)  :%s\" % s)\n\n                df = dmap.get(c_str, None)\n\n            except AttributeError as e:\n                raise FileBuildInfoFileToCsigMappingError(\"No mapping from file name to content signature for :%s\"%c_str)\n\n        return df\n\n    def changed_timestamp_then_content(self, target, prev_ni, node=None):\n        \"\"\"\n        Used when decider for file is Timestamp-MD5\n\n        NOTE: If the timestamp hasn't changed this will skip md5'ing the\n              file and just copy the prev_ni provided.  If the prev_ni\n              is wrong. It will propagate it.\n              See: https://github.com/SCons/scons/issues/2980\n\n        Args:\n            self - dependency\n            target - target\n            prev_ni - The NodeInfo object loaded from previous builds .sconsign\n            node - Node instance.  Check this node for file existence/timestamp\n                   if specified.\n\n        Returns:\n            Boolean - Indicates if node(File) has changed.\n        \"\"\"\n\n        if node is None:\n            node = self\n        # Now get sconsign name -> csig map and then get proper prev_ni if possible\n        bi = node.get_stored_info().binfo\n        rebuilt = False\n        try:\n            dependency_map = bi.dependency_map\n        except AttributeError as e:\n            dependency_map = self._build_dependency_map(bi)\n            rebuilt = True\n\n        if len(dependency_map) == 0:\n            # If there's no dependency map, there's no need to find the\n            # prev_ni as there aren't any\n            # shortcut the rest of the logic\n            if MD5_TIMESTAMP_DEBUG: print(\"Skipping checks len(dmap)=0\")\n\n            # We still need to get the current file's csig\n            # This should be slightly faster than calling self.changed_content(target, new_prev_ni)\n            self.get_csig()\n            return True\n\n        new_prev_ni = self._get_previous_signatures(dependency_map)\n        new = self.changed_timestamp_match(target, new_prev_ni)\n\n        if MD5_TIMESTAMP_DEBUG:\n            old = self.changed_timestamp_match(target, prev_ni)\n\n            if old != new:\n                print(\"Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s\"%(str(target), old, new))\n                new_prev_ni = self._get_previous_signatures(dependency_map)\n\n        if not new:\n            try:\n                # NOTE: We're modifying the current node's csig in a query.\n                self.get_ninfo().csig = new_prev_ni.csig\n            except AttributeError:\n                pass\n            return False\n        return self.changed_content(target, new_prev_ni)\n\n    def changed_timestamp_newer(self, target, prev_ni, repo_node=None):\n        try:\n            return self.get_timestamp() > target.get_timestamp()\n        except AttributeError:\n            return 1\n\n    def changed_timestamp_match(self, target, prev_ni, repo_node=None):\n        \"\"\"\n        Return True if the timestamps don't match or if there is no previous timestamp\n        :param target:\n        :param prev_ni: Information about the node from the previous build\n        :return:\n        \"\"\"\n        try:\n            return self.get_timestamp() != prev_ni.timestamp\n        except AttributeError:\n            return 1\n\n    def is_up_to_date(self):\n        \"\"\"Check for whether the Node is current\n           In all cases self is the target we're checking to see if it's up to date\n        \"\"\"\n\n        T = 0\n        if T: Trace('is_up_to_date(%s):' % self)\n        if not self.exists():\n            if T: Trace(' not self.exists():')\n            # The file (always a target) doesn't exist locally...\n            r = self.rfile()\n            if r != self:\n                # ...but there is one (always a target) in a Repository...\n                if not self.changed(r):\n                    if T: Trace(' changed(%s):' % r)\n                    # ...and it's even up-to-date...\n                    if self._local:\n                        # ...and they'd like a local copy.\n                        e = LocalCopy(self, r, None)\n                        if isinstance(e, SCons.Errors.BuildError):\n                            # Likely this should be re-raising exception e\n                            # (which would be BuildError)\n                            raise e\n                        SCons.Node.store_info_map[self.store_info](self)\n                    if T: Trace(' 1\\n')\n                    return 1\n            self.changed()\n            if T: Trace(' None\\n')\n            return None\n        else:\n            r = self.changed()\n            if T: Trace(' self.exists():  %s\\n' % r)\n            return not r\n\n    @SCons.Memoize.CountMethodCall\n    def rfile(self):\n        try:\n            return self._memo['rfile']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for repo_dir in self.dir.get_all_rdirs():\n                try:\n                    node = repo_dir.entries[norm_name]\n                except KeyError:\n                    node = repo_dir.file_on_disk(self.name)\n\n                if node and node.exists() and \\\n                   (isinstance(node, File) or isinstance(node, Entry)\n                    or not node.is_derived()):\n                        result = node\n                        # Copy over our local attributes to the repository\n                        # Node so we identify shared object files in the\n                        # repository and don't assume they're static.\n                        #\n                        # This isn't perfect; the attribute would ideally\n                        # be attached to the object in the repository in\n                        # case it was built statically in the repository\n                        # and we changed it to shared locally, but that's\n                        # rarely the case and would only occur if you\n                        # intentionally used the same suffix for both\n                        # shared and static objects anyway.  So this\n                        # should work well in practice.\n                        result.attributes = self.attributes\n                        break\n        self._memo['rfile'] = result\n        return result\n\n    def find_repo_file(self):\n        \"\"\"\n        For this node, find if there exists a corresponding file in one or more repositories\n        :return: list of corresponding files in repositories\n        \"\"\"\n        retvals = []\n\n        norm_name = _my_normcase(self.name)\n        for repo_dir in self.dir.get_all_rdirs():\n            try:\n                node = repo_dir.entries[norm_name]\n            except KeyError:\n                node = repo_dir.file_on_disk(self.name)\n\n            if node and node.exists() and \\\n                    (isinstance(node, File) or isinstance(node, Entry) \\\n                     or not node.is_derived()):\n                retvals.append(node)\n\n        return retvals\n\n\n    def rstr(self):\n        return str(self.rfile())\n\n    def get_cachedir_csig(self):\n        \"\"\"\n        Fetch a Node's content signature for purposes of computing\n        another Node's cachesig.\n\n        This is a wrapper around the normal get_csig() method that handles\n        the somewhat obscure case of using CacheDir with the -n option.\n        Any files that don't exist would normally be \"built\" by fetching\n        them from the cache, but the normal get_csig() method will try\n        to open up the local file, which doesn't exist because the -n\n        option meant we didn't actually pull the file from cachedir.\n        But since the file *does* actually exist in the cachedir, we\n        can use its contents for the csig.\n        \"\"\"\n        try:\n            return self.cachedir_csig\n        except AttributeError:\n            pass\n\n        cachedir, cachefile = self.get_build_env().get_CacheDir().cachepath(self)\n        if not self.exists() and cachefile and os.path.exists(cachefile):\n            self.cachedir_csig = SCons.Util.MD5filesignature(cachefile, \\\n                SCons.Node.FS.File.md5_chunksize * 1024)\n        else:\n            self.cachedir_csig = self.get_csig()\n        return self.cachedir_csig\n\n    def get_contents_sig(self):\n        \"\"\"\n        A helper method for get_cachedir_bsig.\n\n        It computes and returns the signature for this\n        node's contents.\n        \"\"\"\n\n        try:\n            return self.contentsig\n        except AttributeError:\n            pass\n\n        executor = self.get_executor()\n\n        result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())\n        return result\n\n    def get_cachedir_bsig(self):\n        \"\"\"\n        Return the signature for a cached file, including\n        its children.\n\n        It adds the path of the cached file to the cache signature,\n        because multiple targets built by the same action will all\n        have the same build signature, and we have to differentiate\n        them somehow.\n\n        Signature should normally be string of hex digits.\n        \"\"\"\n        try:\n            return self.cachesig\n        except AttributeError:\n            pass\n\n        # Collect signatures for all children\n        children = self.children()\n        sigs = [n.get_cachedir_csig() for n in children]\n\n        # Append this node's signature...\n        sigs.append(self.get_contents_sig())\n\n        # ...and it's path\n        sigs.append(self.get_internal_path())\n\n        # Merge this all into a single signature\n        result = self.cachesig = SCons.Util.MD5collect(sigs)\n        return result\n\ndefault_fs = None\n\ndef get_default_fs():\n    global default_fs\n    if not default_fs:\n        default_fs = FS()\n    return default_fs\n\nclass FileFinder(object):\n    \"\"\"\n    \"\"\"\n\n    def __init__(self):\n        self._memo = {}\n\n    def filedir_lookup(self, p, fd=None):\n        \"\"\"\n        A helper method for find_file() that looks up a directory for\n        a file we're trying to find.  This only creates the Dir Node if\n        it exists on-disk, since if the directory doesn't exist we know\n        we won't find any files in it...  :-)\n\n        It would be more compact to just use this as a nested function\n        with a default keyword argument (see the commented-out version\n        below), but that doesn't work unless you have nested scopes,\n        so we define it here just so this work under Python 1.5.2.\n        \"\"\"\n        if fd is None:\n            fd = self.default_filedir\n        dir, name = os.path.split(fd)\n        drive, d = _my_splitdrive(dir)\n        if not name and d[:1] in ('/', OS_SEP):\n            #return p.fs.get_root(drive).dir_on_disk(name)\n            return p.fs.get_root(drive)\n        if dir:\n            p = self.filedir_lookup(p, dir)\n            if not p:\n                return None\n        norm_name = _my_normcase(name)\n        try:\n            node = p.entries[norm_name]\n        except KeyError:\n            return p.dir_on_disk(name)\n        if isinstance(node, Dir):\n            return node\n        if isinstance(node, Entry):\n            node.must_be_same(Dir)\n            return node\n        return None\n\n    def _find_file_key(self, filename, paths, verbose=None):\n        return (filename, paths)\n\n    @SCons.Memoize.CountDictCall(_find_file_key)\n    def find_file(self, filename, paths, verbose=None):\n        \"\"\"\n        Find a node corresponding to either a derived file or a file that exists already.\n\n        Only the first file found is returned, and none is returned if no file is found.\n\n        filename: A filename to find\n        paths: A list of directory path *nodes* to search in.  Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple.\n\n        returns The node created from the found file.\n\n        \"\"\"\n        memo_key = self._find_file_key(filename, paths)\n        try:\n            memo_dict = self._memo['find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if verbose and not callable(verbose):\n            if not SCons.Util.is_String(verbose):\n                verbose = \"find_file\"\n            _verbose = u'  %s: ' % verbose\n            verbose = lambda s: sys.stdout.write(_verbose + s)\n\n        filedir, filename = os.path.split(filename)\n        if filedir:\n            self.default_filedir = filedir\n            paths = [_f for _f in map(self.filedir_lookup, paths) if _f]\n\n        result = None\n        for dir in paths:\n            if verbose:\n                verbose(\"looking for '%s' in '%s' ...\\n\" % (filename, dir))\n            node, d = dir.srcdir_find_file(filename)\n            if node:\n                if verbose:\n                    verbose(\"... FOUND '%s' in '%s'\\n\" % (filename, d))\n                result = node\n                break\n\n        memo_dict[memo_key] = result\n\n        return result\n\nfind_file = FileFinder().find_file\n\n\ndef invalidate_node_memos(targets):\n    \"\"\"\n    Invalidate the memoized values of all Nodes (files or directories)\n    that are associated with the given entries. Has been added to\n    clear the cache of nodes affected by a direct execution of an\n    action (e.g.  Delete/Copy/Chmod). Existing Node caches become\n    inconsistent if the action is run through Execute().  The argument\n    `targets` can be a single Node object or filename, or a sequence\n    of Nodes/filenames.\n    \"\"\"\n    from traceback import extract_stack\n\n    # First check if the cache really needs to be flushed. Only\n    # actions run in the SConscript with Execute() seem to be\n    # affected. XXX The way to check if Execute() is in the stacktrace\n    # is a very dirty hack and should be replaced by a more sensible\n    # solution.\n    for f in extract_stack():\n        if f[2] == 'Execute' and f[0][-14:] == 'Environment.py':\n            break\n    else:\n        # Dont have to invalidate, so return\n        return\n\n    if not SCons.Util.is_List(targets):\n        targets = [targets]\n\n    for entry in targets:\n        # If the target is a Node object, clear the cache. If it is a\n        # filename, look up potentially existing Node object first.\n        try:\n            entry.clear_memoized_values()\n        except AttributeError:\n            # Not a Node object, try to look up Node by filename.  XXX\n            # This creates Node objects even for those filenames which\n            # do not correspond to an existing Node object.\n            node = get_default_fs().Entry(entry)\n            if node:\n                node.clear_memoized_values()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/Python.py",
    "content": "\"\"\"scons.Node.Python\n\nPython nodes.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Node/Python.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Node\n\nclass ValueNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig',)\n    current_version_id = 2\n\n    field_list = ['csig']\n\n    def str_to_node(self, s):\n        return Value(s)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass ValueBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\nclass Value(SCons.Node.Node):\n    \"\"\"A class for Python variables, typically passed on the command line\n    or generated by a script, but not from a file or some other source.\n    \"\"\"\n\n    NodeInfo = ValueNodeInfo\n    BuildInfo = ValueBuildInfo\n\n    def __init__(self, value, built_value=None):\n        SCons.Node.Node.__init__(self)\n        self.value = value\n        self.changed_since_last_build = 6\n        self.store_info = 0\n        if built_value is not None:\n            self.built_value = built_value\n\n    def str_for_display(self):\n        return repr(self.value)\n\n    def __str__(self):\n        return str(self.value)\n\n    def make_ready(self):\n        self.get_csig()\n\n    def build(self, **kw):\n        if not hasattr(self, 'built_value'):\n            SCons.Node.Node.build(self, **kw)\n\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Value nodes get built regardless of\n        # what directory scons was run from. Value nodes\n        # are outside the filesystem:\n        return 1\n\n    def write(self, built_value):\n        \"\"\"Set the value of the node.\"\"\"\n        self.built_value = built_value\n\n    def read(self):\n        \"\"\"Return the value. If necessary, the value is built.\"\"\"\n        self.build()\n        if not hasattr(self, 'built_value'):\n            self.built_value = self.value\n        return self.built_value\n\n    def get_text_contents(self):\n        \"\"\"By the assumption that the node.built_value is a\n        deterministic product of the sources, the contents of a Value\n        are the concatenation of all the contents of its sources.  As\n        the value need not be built when get_contents() is called, we\n        cannot use the actual node.built_value.\"\"\"\n        ###TODO: something reasonable about universal newlines\n        contents = str(self.value)\n        for kid in self.children(None):\n            contents = contents + kid.get_contents().decode()\n        return contents\n\n    def get_contents(self):\n        \"\"\"\n        Get contents for signature calculations.\n        :return: bytes\n        \"\"\"\n        text_contents = self.get_text_contents()\n        try:\n            return text_contents.encode()\n        except UnicodeDecodeError:\n            # Already encoded as python2 str are bytes\n            return text_contents\n\n\n    def changed_since_last_build(self, target, prev_ni):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def get_csig(self, calc=None):\n        \"\"\"Because we're a Python value node and don't have a real\n        timestamp, we get to ignore the calculator and just use the\n        value contents.\n\n        Returns string. Ideally string of hex digits. (Not bytes)\n        \"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n\n        contents = self.get_text_contents()\n\n        self.get_ninfo().csig = contents\n        return contents\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/__init__.py",
    "content": "\"\"\"SCons.Node\n\nThe Node package for the SCons software construction utility.\n\nThis is, in many ways, the heart of SCons.\n\nA Node is where we encapsulate all of the dependency information about\nany thing that SCons can build, or about any thing which SCons can use\nto build some other thing.  The canonical \"thing,\" of course, is a file,\nbut a Node can also represent something remote (like a web page) or\nsomething completely abstract (like an Alias).\n\nEach specific type of \"thing\" is specifically represented by a subclass\nof the Node base class:  Node.FS.File for files, Node.Alias for aliases,\netc.  Dependency information is kept here in the base class, and\ninformation specific to files/aliases/etc. is in the subclass.  The\ngoal, if we've done this correctly, is that any type of \"thing\" should\nbe able to depend on any other type of \"thing.\"\n\n\"\"\"\n\nfrom __future__ import print_function\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Node/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport collections\nimport copy\nfrom itertools import chain\n\ntry:\n    from itertools import zip_longest\nexcept ImportError:\n    from itertools import izip_longest as zip_longest\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Executor\nimport SCons.Memoize\nimport SCons.Util\n\nfrom SCons.Debug import Trace\n\nfrom SCons.compat import with_metaclass, NoSlotsPyPy\n\nprint_duplicate = 0\n\ndef classname(obj):\n    return str(obj.__class__).split('.')[-1]\n\n# Set to false if we're doing a dry run. There's more than one of these\n# little treats\ndo_store_info = True\n\n# Node states\n#\n# These are in \"priority\" order, so that the maximum value for any\n# child/dependency of a node represents the state of that node if\n# it has no builder of its own.  The canonical example is a file\n# system directory, which is only up to date if all of its children\n# were up to date.\nno_state = 0\npending = 1\nexecuting = 2\nup_to_date = 3\nexecuted = 4\nfailed = 5\n\nStateString = {\n    0 : \"no_state\",\n    1 : \"pending\",\n    2 : \"executing\",\n    3 : \"up_to_date\",\n    4 : \"executed\",\n    5 : \"failed\",\n}\n\n# controls whether implicit dependencies are cached:\nimplicit_cache = 0\n\n# controls whether implicit dep changes are ignored:\nimplicit_deps_unchanged = 0\n\n# controls whether the cached implicit deps are ignored:\nimplicit_deps_changed = 0\n\n# A variable that can be set to an interface-specific function be called\n# to annotate a Node with information about its creation.\ndef do_nothing_node(node): pass\n\nAnnotate = do_nothing_node\n\n# Gets set to 'True' if we're running in interactive mode. Is\n# currently used to release parts of a target's info during\n# clean builds and update runs (see release_target_info).\ninteractive = False\n\ndef is_derived_none(node):\n    raise NotImplementedError\n\ndef is_derived_node(node):\n    \"\"\"\n        Returns true if this node is derived (i.e. built).\n    \"\"\"\n    return node.has_builder() or node.side_effect\n\n_is_derived_map = {0 : is_derived_none,\n                   1 : is_derived_node}\n\ndef exists_none(node):\n    raise NotImplementedError\n\ndef exists_always(node):\n    return 1\n\ndef exists_base(node):\n    return node.stat() is not None\n\ndef exists_entry(node):\n    \"\"\"Return if the Entry exists.  Check the file system to see\n    what we should turn into first.  Assume a file if there's no\n    directory.\"\"\"\n    node.disambiguate()\n    return _exists_map[node._func_exists](node)\n\n\ndef exists_file(node):\n    # Duplicate from source path if we are set up to do this.\n    if node.duplicate and not node.is_derived() and not node.linked:\n        src = node.srcnode()\n        if src is not node:\n            # At this point, src is meant to be copied in a variant directory.\n            src = src.rfile()\n            if src.get_abspath() != node.get_abspath():\n                if src.exists():\n                    node.do_duplicate(src)\n                    # Can't return 1 here because the duplication might\n                    # not actually occur if the -n option is being used.\n                else:\n                    # The source file does not exist.  Make sure no old\n                    # copy remains in the variant directory.\n                    if print_duplicate:\n                        print(\"dup: no src for %s, unlinking old variant copy\" % node)\n                    if exists_base(node) or node.islink():\n                        node.fs.unlink(node.get_internal_path())\n                    # Return None explicitly because the Base.exists() call\n                    # above will have cached its value if the file existed.\n                    return None\n    return exists_base(node)\n\n_exists_map = {0 : exists_none,\n               1 : exists_always,\n               2 : exists_base,\n               3 : exists_entry,\n               4 : exists_file}\n\n\ndef rexists_none(node):\n    raise NotImplementedError\n\ndef rexists_node(node):\n    return node.exists()\n\ndef rexists_base(node):\n    return node.rfile().exists()\n\n_rexists_map = {0 : rexists_none,\n                1 : rexists_node,\n                2 : rexists_base}\n\ndef get_contents_none(node):\n    raise NotImplementedError\n\ndef get_contents_entry(node):\n    \"\"\"Fetch the contents of the entry.  Returns the exact binary\n    contents of the file.\"\"\"\n    try:\n        node = node.disambiguate(must_exist=1)\n    except SCons.Errors.UserError:\n        # There was nothing on disk with which to disambiguate\n        # this entry.  Leave it as an Entry, but return a null\n        # string so calls to get_contents() in emitters and the\n        # like (e.g. in qt.py) don't have to disambiguate by hand\n        # or catch the exception.\n        return ''\n    else:\n        return _get_contents_map[node._func_get_contents](node)\n\ndef get_contents_dir(node):\n    \"\"\"Return content signatures and names of all our children\n    separated by new-lines. Ensure that the nodes are sorted.\"\"\"\n    contents = []\n    for n in sorted(node.children(), key=lambda t: t.name):\n        contents.append('%s %s\\n' % (n.get_csig(), n.name))\n    return ''.join(contents)\n\ndef get_contents_file(node):\n    if not node.rexists():\n        return b''\n    fname = node.rfile().get_abspath()\n    try:\n        with open(fname, \"rb\") as fp:\n            contents = fp.read()\n    except EnvironmentError as e:\n        if not e.filename:\n            e.filename = fname\n        raise\n    return contents\n\n_get_contents_map = {0 : get_contents_none,\n                     1 : get_contents_entry,\n                     2 : get_contents_dir,\n                     3 : get_contents_file}\n\ndef target_from_source_none(node, prefix, suffix, splitext):\n    raise NotImplementedError\n\ndef target_from_source_base(node, prefix, suffix, splitext):\n    return node.dir.Entry(prefix + splitext(node.name)[0] + suffix)\n\n_target_from_source_map = {0 : target_from_source_none,\n                           1 : target_from_source_base}\n\n#\n# The new decider subsystem for Nodes\n#\n# We would set and overwrite the changed_since_last_build function\n# before, but for being able to use slots (less memory!) we now have\n# a dictionary of the different decider functions. Then in the Node\n# subclasses we simply store the index to the decider that should be\n# used by it.\n#\n\n#\n# First, the single decider functions\n#\ndef changed_since_last_build_node(node, target, prev_ni, repo_node=None):\n    \"\"\"\n\n    Must be overridden in a specific subclass to return True if this\n    Node (a dependency) has changed since the last time it was used\n    to build the specified target.  prev_ni is this Node's state (for\n    example, its file timestamp, length, maybe content signature)\n    as of the last time the target was built.\n\n    Note that this method is called through the dependency, not the\n    target, because a dependency Node must be able to use its own\n    logic to decide if it changed.  For example, File Nodes need to\n    obey if we're configured to use timestamps, but Python Value Nodes\n    never use timestamps and always use the content.  If this method\n    were called through the target, then each Node's implementation\n    of this method would have to have more complicated logic to\n    handle all the different Node types on which it might depend.\n    \"\"\"\n    raise NotImplementedError\n\n\ndef changed_since_last_build_alias(node, target, prev_ni, repo_node=None):\n    cur_csig = node.get_csig()\n    try:\n        return cur_csig != prev_ni.csig\n    except AttributeError:\n        return 1\n\n\ndef changed_since_last_build_entry(node, target, prev_ni, repo_node=None):\n    node.disambiguate()\n    return _decider_map[node.changed_since_last_build](node, target, prev_ni, repo_node)\n\n\ndef changed_since_last_build_state_changed(node, target, prev_ni, repo_node=None):\n    return node.state != SCons.Node.up_to_date\n\n\ndef decide_source(node, target, prev_ni, repo_node=None):\n    return target.get_build_env().decide_source(node, target, prev_ni, repo_node)\n\n\ndef decide_target(node, target, prev_ni, repo_node=None):\n    return target.get_build_env().decide_target(node, target, prev_ni, repo_node)\n\n\ndef changed_since_last_build_python(node, target, prev_ni, repo_node=None):\n    cur_csig = node.get_csig()\n    try:\n        return cur_csig != prev_ni.csig\n    except AttributeError:\n        return 1\n\n\n#\n# Now, the mapping from indices to decider functions\n#\n_decider_map = {0 : changed_since_last_build_node,\n               1 : changed_since_last_build_alias,\n               2 : changed_since_last_build_entry,\n               3 : changed_since_last_build_state_changed,\n               4 : decide_source,\n               5 : decide_target,\n               6 : changed_since_last_build_python}\n\ndo_store_info = True\n\n#\n# The new store_info subsystem for Nodes\n#\n# We would set and overwrite the store_info function\n# before, but for being able to use slots (less memory!) we now have\n# a dictionary of the different functions. Then in the Node\n# subclasses we simply store the index to the info method that should be\n# used by it.\n#\n\n#\n# First, the single info functions\n#\n\ndef store_info_pass(node):\n    pass\n\ndef store_info_file(node):\n    # Merge our build information into the already-stored entry.\n    # This accommodates \"chained builds\" where a file that's a target\n    # in one build (SConstruct file) is a source in a different build.\n    # See test/chained-build.py for the use case.\n    if do_store_info:\n        node.dir.sconsign().store_info(node.name, node)\n\n\nstore_info_map = {0 : store_info_pass,\n                  1 : store_info_file}\n\n# Classes for signature info for Nodes.\n\nclass NodeInfoBase(object):\n    \"\"\"\n    The generic base class for signature information for a Node.\n\n    Node subclasses should subclass NodeInfoBase to provide their own\n    logic for dealing with their own Node-specific signature information.\n    \"\"\"\n    __slots__ = ('__weakref__',)\n    current_version_id = 2\n\n    def update(self, node):\n        try:\n            field_list = self.field_list\n        except AttributeError:\n            return\n        for f in field_list:\n            try:\n                delattr(self, f)\n            except AttributeError:\n                pass\n            try:\n                func = getattr(node, 'get_' + f)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, f, func())\n\n    def convert(self, node, val):\n        pass\n\n    def merge(self, other):\n        \"\"\"\n        Merge the fields of another object into this object. Already existing\n        information is overwritten by the other instance's data.\n        WARNING: If a '__dict__' slot is added, it should be updated instead of\n        replaced.\n        \"\"\"\n        state = other.__getstate__()\n        self.__setstate__(state)\n\n    def format(self, field_list=None, names=0):\n        if field_list is None:\n            try:\n                field_list = self.field_list\n            except AttributeError:\n                field_list = list(getattr(self, '__dict__', {}).keys())\n                for obj in type(self).mro():\n                    for slot in getattr(obj, '__slots__', ()):\n                        if slot not in ('__weakref__', '__dict__'):\n                            field_list.append(slot)\n                field_list.sort()\n        fields = []\n        for field in field_list:\n            try:\n                f = getattr(self, field)\n            except AttributeError:\n                f = None\n            f = str(f)\n            if names:\n                f = field + ': ' + f\n            fields.append(f)\n        return fields\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state. The version is discarded.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass BuildInfoBase(object):\n    \"\"\"\n    The generic base class for build information for a Node.\n\n    This is what gets stored in a .sconsign file for each target file.\n    It contains a NodeInfo instance for this node (signature information\n    that's specific to the type of Node) and direct attributes for the\n    generic build stuff we have to track:  sources, explicit dependencies,\n    implicit dependencies, and action information.\n    \"\"\"\n    __slots__ = (\"bsourcesigs\", \"bdependsigs\", \"bimplicitsigs\", \"bactsig\",\n                 \"bsources\", \"bdepends\", \"bact\", \"bimplicit\", \"__weakref__\")\n    current_version_id = 2\n\n    def __init__(self):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        self.bsourcesigs = []\n        self.bdependsigs = []\n        self.bimplicitsigs = []\n        self.bactsig = None\n\n    def merge(self, other):\n        \"\"\"\n        Merge the fields of another object into this object. Already existing\n        information is overwritten by the other instance's data.\n        WARNING: If a '__dict__' slot is added, it should be updated instead of\n        replaced.\n        \"\"\"\n        state = other.__getstate__()\n        self.__setstate__(state)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass Node(object, with_metaclass(NoSlotsPyPy)):\n    \"\"\"The base Node class, for entities that we know how to\n    build, or use to build other Nodes.\n    \"\"\"\n\n    __slots__ = ['sources',\n                 'sources_set',\n                 'target_peers',\n                 '_specific_sources',\n                 'depends',\n                 'depends_set',\n                 'ignore',\n                 'ignore_set',\n                 'prerequisites',\n                 'implicit',\n                 'waiting_parents',\n                 'waiting_s_e',\n                 'ref_count',\n                 'wkids',\n                 'env',\n                 'state',\n                 'precious',\n                 'noclean',\n                 'nocache',\n                 'cached',\n                 'always_build',\n                 'includes',\n                 'attributes',\n                 'side_effect',\n                 'side_effects',\n                 'linked',\n                 '_memo',\n                 'executor',\n                 'binfo',\n                 'ninfo',\n                 'builder',\n                 'is_explicit',\n                 'implicit_set',\n                 'changed_since_last_build',\n                 'store_info',\n                 'pseudo',\n                 '_tags',\n                 '_func_is_derived',\n                 '_func_exists',\n                 '_func_rexists',\n                 '_func_get_contents',\n                 '_func_target_from_source']\n\n    class Attrs(object):\n        __slots__ = ('shared', '__dict__')\n\n\n    def __init__(self):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')\n        # Note that we no longer explicitly initialize a self.builder\n        # attribute to None here.  That's because the self.builder\n        # attribute may be created on-the-fly later by a subclass (the\n        # canonical example being a builder to fetch a file from a\n        # source code system like CVS or Subversion).\n\n        # Each list of children that we maintain is accompanied by a\n        # dictionary used to look up quickly whether a node is already\n        # present in the list.  Empirical tests showed that it was\n        # fastest to maintain them as side-by-side Node attributes in\n        # this way, instead of wrapping up each list+dictionary pair in\n        # a class.  (Of course, we could always still do that in the\n        # future if we had a good reason to...).\n        self.sources = []       # source files used to build node\n        self.sources_set = set()\n        self._specific_sources = False\n        self.depends = []       # explicit dependencies (from Depends)\n        self.depends_set = set()\n        self.ignore = []        # dependencies to ignore\n        self.ignore_set = set()\n        self.prerequisites = None\n        self.implicit = None    # implicit (scanned) dependencies (None means not scanned yet)\n        self.waiting_parents = set()\n        self.waiting_s_e = set()\n        self.ref_count = 0\n        self.wkids = None       # Kids yet to walk, when it's an array\n\n        self.env = None\n        self.state = no_state\n        self.precious = None\n        self.pseudo = False\n        self.noclean = 0\n        self.nocache = 0\n        self.cached = 0 # is this node pulled from cache?\n        self.always_build = None\n        self.includes = None\n        self.attributes = self.Attrs() # Generic place to stick information about the Node.\n        self.side_effect = 0 # true iff this node is a side effect\n        self.side_effects = [] # the side effects of building this target\n        self.linked = 0 # is this node linked to the variant directory?\n        self.changed_since_last_build = 0\n        self.store_info = 0\n        self._tags = None\n        self._func_is_derived = 1\n        self._func_exists = 1\n        self._func_rexists = 1\n        self._func_get_contents = 0\n        self._func_target_from_source = 0\n        self.ninfo = None\n\n        self.clear_memoized_values()\n\n        # Let the interface in which the build engine is embedded\n        # annotate this Node with its own info (like a description of\n        # what line in what file created the node, for example).\n        Annotate(self)\n\n    def disambiguate(self, must_exist=None):\n        return self\n\n    def get_suffix(self):\n        return ''\n\n    @SCons.Memoize.CountMethodCall\n    def get_build_env(self):\n        \"\"\"Fetch the appropriate Environment to build this node.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n        result = self.get_executor().get_build_env()\n        self._memo['get_build_env'] = result\n        return result\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the appropriate scanner path for this node.\"\"\"\n        return self.get_executor().get_build_scanner_path(scanner)\n\n    def set_executor(self, executor):\n        \"\"\"Set the action executor for this node.\"\"\"\n        self.executor = executor\n\n    def get_executor(self, create=1):\n        \"\"\"Fetch the action executor for this node.  Create one if\n        there isn't already one, and requested to do so.\"\"\"\n        try:\n            executor = self.executor\n        except AttributeError:\n            if not create:\n                raise\n            try:\n                act = self.builder.action\n            except AttributeError:\n                executor = SCons.Executor.Null(targets=[self])\n            else:\n                executor = SCons.Executor.Executor(act,\n                                                   self.env or self.builder.env,\n                                                   [self.builder.overrides],\n                                                   [self],\n                                                   self.sources)\n            self.executor = executor\n        return executor\n\n    def executor_cleanup(self):\n        \"\"\"Let the executor clean up any cached information.\"\"\"\n        try:\n            executor = self.get_executor(create=None)\n        except AttributeError:\n            pass\n        else:\n            if executor is not None:\n                executor.cleanup()\n\n    def reset_executor(self):\n        \"\"\"Remove cached executor; forces recompute when needed.\"\"\"\n        try:\n            delattr(self, 'executor')\n        except AttributeError:\n            pass\n\n    def push_to_cache(self):\n        \"\"\"Try to push a node into a cache\n        \"\"\"\n        pass\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        return 0\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        \"\"\"Get a Node ready for evaluation.\n\n        This is called before the Taskmaster decides if the Node is\n        up-to-date or not.  Overriding this method allows for a Node\n        subclass to be disambiguated if necessary, or for an implicit\n        source builder to be attached.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"Prepare for this Node to be built.\n\n        This is called after the Taskmaster has decided that the Node\n        is out-of-date and must be rebuilt, but before actually calling\n        the method to build the Node.\n\n        This default implementation checks that explicit or implicit\n        dependencies either exist or are derived, and initializes the\n        BuildInfo structure that will hold the information about how\n        this node is, uh, built.\n\n        (The existence of source files is checked separately by the\n        Executor, which aggregates checks for all of the targets built\n        by a specific action.)\n\n        Overriding this method allows for for a Node subclass to remove\n        the underlying file from the file system.  Note that subclass\n        methods should call this base class method to get the child\n        check and the BuildInfo structure.\n        \"\"\"\n        if self.depends is not None:\n            for d in self.depends:\n                if d.missing():\n                    msg = \"Explicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (d, self))\n        if self.implicit is not None:\n            for i in self.implicit:\n                if i.missing():\n                    msg = \"Implicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (i, self))\n        self.binfo = self.get_binfo()\n\n    def build(self, **kw):\n        \"\"\"Actually build the node.\n\n        This is called by the Taskmaster after it's decided that the\n        Node is out-of-date and must be rebuilt, and after the prepare()\n        method has gotten everything, uh, prepared.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff\n        in built().\n\n        \"\"\"\n        try:\n            self.get_executor()(self, **kw)\n        except SCons.Errors.BuildError as e:\n            e.node = self\n            raise\n\n    def built(self):\n        \"\"\"Called just after this node is successfully built.\"\"\"\n\n        # Clear the implicit dependency caches of any Nodes\n        # waiting for this Node to be built.\n        for parent in self.waiting_parents:\n            parent.implicit = None\n\n            # Handle issue where builder emits more than one target and\n            # the source file for the builder is generated.\n            # in that case only the first target was getting it's .implicit\n            # cleared when the source file is built (second scan). \n            # leaving only partial implicits from scan before source file is generated\n            # typically the compiler only. Then scanned files are appended\n            # This is persisted to sconsign and rebuild causes false rebuilds\n            # because the ordering of the implicit list then changes to what it\n            # should have been.\n            # This is at least the following bugs\n            # https://github.com/SCons/scons/issues/2811\n            # https://jira.mongodb.org/browse/SERVER-33111\n            try:\n                for peer in parent.target_peers:\n                    peer.implicit = None\n            except AttributeError:\n                pass\n\n\n        self.clear()\n\n        if self.pseudo:\n            if self.exists():\n                raise SCons.Errors.UserError(\"Pseudo target \" + str(self) + \" must not exist\")\n        else:\n            if not self.exists() and do_store_info:\n                SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,\n                                    \"Cannot find target \" + str(self) + \" after building\")\n        self.ninfo.update(self)\n\n    def visited(self):\n        \"\"\"Called just after this node has been visited (with or\n        without a build).\"\"\"\n        try:\n            binfo = self.binfo\n        except AttributeError:\n            # Apparently this node doesn't need build info, so\n            # don't bother calculating or storing it.\n            pass\n        else:\n            self.ninfo.update(self)\n            SCons.Node.store_info_map[self.store_info](self)\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n         up-to-date or was built completely.\n\n         This is where we try to release as many target node infos\n         as possible for clean builds and update runs, in order\n         to minimize the overall memory consumption.\n\n         By purging attributes that aren't needed any longer after\n         a Node (=File) got built, we don't have to care that much how\n         many KBytes a Node actually requires...as long as we free\n         the memory shortly afterwards.\n\n         @see: built() and File.release_target_info()\n         \"\"\"\n        pass\n\n    #\n    #\n    #\n\n    def add_to_waiting_s_e(self, node):\n        self.waiting_s_e.add(node)\n\n    def add_to_waiting_parents(self, node):\n        \"\"\"\n        Returns the number of nodes added to our waiting parents list:\n        1 if we add a unique waiting parent, 0 if not.  (Note that the\n        returned values are intended to be used to increment a reference\n        count, so don't think you can \"clean up\" this function by using\n        True and False instead...)\n        \"\"\"\n        wp = self.waiting_parents\n        if node in wp:\n            return 0\n        wp.add(node)\n        return 1\n\n    def postprocess(self):\n        \"\"\"Clean up anything we don't need to hang onto after we've\n        been built.\"\"\"\n        self.executor_cleanup()\n        self.waiting_parents = set()\n\n    def clear(self):\n        \"\"\"Completely clear a Node of all its cached state (so that it\n        can be re-evaluated by interfaces that do continuous integration\n        builds).\n        \"\"\"\n        # The del_binfo() call here isn't necessary for normal execution,\n        # but is for interactive mode, where we might rebuild the same\n        # target and need to start from scratch.\n        self.del_binfo()\n        self.clear_memoized_values()\n        self.ninfo = self.new_ninfo()\n        self.executor_cleanup()\n        try:\n            delattr(self, '_calculated_sig')\n        except AttributeError:\n            pass\n        self.includes = None\n\n    def clear_memoized_values(self):\n        self._memo = {}\n\n    def builder_set(self, builder):\n        self.builder = builder\n        try:\n            del self.executor\n        except AttributeError:\n            pass\n\n    def has_builder(self):\n        \"\"\"Return whether this Node has a builder or not.\n\n        In Boolean tests, this turns out to be a *lot* more efficient\n        than simply examining the builder attribute directly (\"if\n        node.builder: ...\"). When the builder attribute is examined\n        directly, it ends up calling __getattr__ for both the __len__\n        and __nonzero__ attributes on instances of our Builder Proxy\n        class(es), generating a bazillion extra calls and slowing\n        things down immensely.\n        \"\"\"\n        try:\n            b = self.builder\n        except AttributeError:\n            # There was no explicit builder for this Node, so initialize\n            # the self.builder attribute to None now.\n            b = self.builder = None\n        return b is not None\n\n    def set_explicit(self, is_explicit):\n        self.is_explicit = is_explicit\n\n    def has_explicit_builder(self):\n        \"\"\"Return whether this Node has an explicit builder\n\n        This allows an internal Builder created by SCons to be marked\n        non-explicit, so that it can be overridden by an explicit\n        builder that the user supplies (the canonical example being\n        directories).\"\"\"\n        try:\n            return self.is_explicit\n        except AttributeError:\n            self.is_explicit = None\n            return self.is_explicit\n\n    def get_builder(self, default_builder=None):\n        \"\"\"Return the set builder, or a specified default value\"\"\"\n        try:\n            return self.builder\n        except AttributeError:\n            return default_builder\n\n    multiple_side_effect_has_builder = has_builder\n\n    def is_derived(self):\n        \"\"\"\n        Returns true if this node is derived (i.e. built).\n\n        This should return true only for nodes whose path should be in\n        the variant directory when duplicate=0 and should contribute their build\n        signatures when they are used as source files to other derived files. For\n        example: source with source builders are not derived in this sense,\n        and hence should not return true.\n        \"\"\"\n        return _is_derived_map[self._func_is_derived](self)\n\n    def alter_targets(self):\n        \"\"\"Return a list of alternate targets for this Node.\n        \"\"\"\n        return [], None\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the scanned include lines (implicit dependencies)\n        found in this node.\n\n        The default is no implicit dependencies.  We expect this method\n        to be overridden by any subclass that can be scanned for\n        implicit dependencies.\n        \"\"\"\n        return []\n\n    def get_implicit_deps(self, env, initial_scanner, path_func, kw = {}):\n        \"\"\"Return a list of implicit dependencies for this node.\n\n        This method exists to handle recursive invocation of the scanner\n        on the implicit dependencies returned by the scanner, if the\n        scanner's recursive flag says that we should.\n        \"\"\"\n        nodes = [self]\n        seen = set(nodes)\n        dependencies = []\n        path_memo = {}\n\n        root_node_scanner = self._get_scanner(env, initial_scanner, None, kw)\n\n        while nodes:\n            node = nodes.pop(0)\n\n            scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw)\n            if not scanner:\n                continue\n\n            try:\n                path = path_memo[scanner]\n            except KeyError:\n                path = path_func(scanner)\n                path_memo[scanner] = path\n\n            included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen]\n            if included_deps:\n                dependencies.extend(included_deps)\n                seen.update(included_deps)\n                nodes.extend(scanner.recurse_nodes(included_deps))\n\n        return dependencies\n\n    def _get_scanner(self, env, initial_scanner, root_node_scanner, kw):\n        if initial_scanner:\n            # handle explicit scanner case\n            scanner = initial_scanner.select(self)\n        else:\n            # handle implicit scanner case\n            scanner = self.get_env_scanner(env, kw)\n            if scanner:\n                scanner = scanner.select(self)\n\n        if not scanner:\n            # no scanner could be found for the given node's scanner key;\n            # thus, make an attempt at using a default.\n            scanner = root_node_scanner\n\n        return scanner\n\n    def get_env_scanner(self, env, kw={}):\n        return env.get_scanner(self.scanner_key())\n\n    def get_target_scanner(self):\n        return self.builder.target_scanner\n\n    def get_source_scanner(self, node):\n        \"\"\"Fetch the source scanner for the specified node\n\n        NOTE:  \"self\" is the target being built, \"node\" is\n        the source file for which we want to fetch the scanner.\n\n        Implies self.has_builder() is true; again, expect to only be\n        called from locations where this is already verified.\n\n        This function may be called very often; it attempts to cache\n        the scanner found to improve performance.\n        \"\"\"\n        scanner = None\n        try:\n            scanner = self.builder.source_scanner\n        except AttributeError:\n            pass\n        if not scanner:\n            # The builder didn't have an explicit scanner, so go look up\n            # a scanner from env['SCANNERS'] based on the node's scanner\n            # key (usually the file extension).\n            scanner = self.get_env_scanner(self.get_build_env())\n        if scanner:\n            scanner = scanner.select(node)\n        return scanner\n\n    def add_to_implicit(self, deps):\n        if not hasattr(self, 'implicit') or self.implicit is None:\n            self.implicit = []\n            self.implicit_set = set()\n            self._children_reset()\n        self._add_child(self.implicit, self.implicit_set, deps)\n\n    def scan(self):\n        \"\"\"Scan this node's dependents for implicit dependencies.\"\"\"\n        # Don't bother scanning non-derived files, because we don't\n        # care what their dependencies are.\n        # Don't scan again, if we already have scanned.\n        if self.implicit is not None:\n            return\n        self.implicit = []\n        self.implicit_set = set()\n        self._children_reset()\n        if not self.has_builder():\n            return\n\n        build_env = self.get_build_env()\n        executor = self.get_executor()\n\n        # Here's where we implement --implicit-cache.\n        if implicit_cache and not implicit_deps_changed:\n            implicit = self.get_stored_implicit()\n            if implicit is not None:\n                # We now add the implicit dependencies returned from the\n                # stored .sconsign entry to have already been converted\n                # to Nodes for us.  (We used to run them through a\n                # source_factory function here.)\n\n                # Update all of the targets with them.  This\n                # essentially short-circuits an N*M scan of the\n                # sources for each individual target, which is a hell\n                # of a lot more efficient.\n                for tgt in executor.get_all_targets():\n                    tgt.add_to_implicit(implicit)\n\n                if implicit_deps_unchanged or self.is_up_to_date():\n                    return\n                # one of this node's sources has changed,\n                # so we must recalculate the implicit deps for all targets\n                for tgt in executor.get_all_targets():\n                    tgt.implicit = []\n                    tgt.implicit_set = set()\n\n        # Have the executor scan the sources.\n        executor.scan_sources(self.builder.source_scanner)\n\n        # If there's a target scanner, have the executor scan the target\n        # node itself and associated targets that might be built.\n        scanner = self.get_target_scanner()\n        if scanner:\n            executor.scan_targets(scanner)\n\n    def scanner_key(self):\n        return None\n\n    def select_scanner(self, scanner):\n        \"\"\"Selects a scanner for this Node.\n\n        This is a separate method so it can be overridden by Node\n        subclasses (specifically, Node.FS.Dir) that *must* use their\n        own Scanner and don't select one the Scanner.Selector that's\n        configured for the target.\n        \"\"\"\n        return scanner.select(self)\n\n    def env_set(self, env, safe=0):\n        if safe and self.env:\n            return\n        self.env = env\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    NodeInfo = NodeInfoBase\n    BuildInfo = BuildInfoBase\n\n    def new_ninfo(self):\n        ninfo = self.NodeInfo()\n        return ninfo\n\n    def get_ninfo(self):\n        if self.ninfo is not None:\n            return self.ninfo\n        self.ninfo = self.new_ninfo()\n        return self.ninfo\n\n    def new_binfo(self):\n        binfo = self.BuildInfo()\n        return binfo\n\n    def get_binfo(self):\n        \"\"\"\n        Fetch a node's build information.\n\n        node - the node whose sources will be collected\n        cache - alternate node to use for the signature cache\n        returns - the build signature\n\n        This no longer handles the recursive descent of the\n        node's children's signatures.  We expect that they're\n        already built and updated by someone else, if that's\n        what's wanted.\n        \"\"\"\n        try:\n            return self.binfo\n        except AttributeError:\n            pass\n\n        binfo = self.new_binfo()\n        self.binfo = binfo\n\n        executor = self.get_executor()\n        ignore_set = self.ignore_set\n\n        if self.has_builder():\n            binfo.bact = str(executor)\n            binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())\n\n        if self._specific_sources:\n            sources = [s for s in self.sources if s not in ignore_set]\n\n        else:\n            sources = executor.get_unignored_sources(self, self.ignore)\n\n        seen = set()\n        binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)]\n        binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources]\n\n        binfo.bdepends = [d for d in self.depends if d not in ignore_set]\n        binfo.bdependsigs = [d.get_ninfo() for d in self.depends]\n\n        # Because self.implicit is initialized to None (and not empty list [])\n        # we have to handle this case\n        if not self.implicit:\n            binfo.bimplicit = []\n            binfo.bimplicitsigs = []\n        else:\n            binfo.bimplicit = [i for i in self.implicit if i not in ignore_set]\n            binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit]\n\n        return binfo\n\n    def del_binfo(self):\n        \"\"\"Delete the build info from this node.\"\"\"\n        try:\n            delattr(self, 'binfo')\n        except AttributeError:\n            pass\n\n    def get_csig(self):\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            ninfo = self.get_ninfo()\n            ninfo.csig = SCons.Util.MD5signature(self.get_contents())\n            return self.ninfo.csig\n\n    def get_cachedir_csig(self):\n        return self.get_csig()\n\n    def get_stored_info(self):\n        return None\n\n    def get_stored_implicit(self):\n        \"\"\"Fetch the stored implicit dependencies\"\"\"\n        return None\n\n    #\n    #\n    #\n\n    def set_precious(self, precious = 1):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.precious = precious\n\n    def set_pseudo(self, pseudo = True):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.pseudo = pseudo\n\n    def set_noclean(self, noclean = 1):\n        \"\"\"Set the Node's noclean value.\"\"\"\n        # Make sure noclean is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.noclean = noclean and 1 or 0\n\n    def set_nocache(self, nocache = 1):\n        \"\"\"Set the Node's nocache value.\"\"\"\n        # Make sure nocache is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.nocache = nocache and 1 or 0\n\n    def set_always_build(self, always_build = 1):\n        \"\"\"Set the Node's always_build value.\"\"\"\n        self.always_build = always_build\n\n    def exists(self):\n        \"\"\"Does this node exists?\"\"\"\n        return _exists_map[self._func_exists](self)\n\n    def rexists(self):\n        \"\"\"Does this node exist locally or in a repository?\"\"\"\n        # There are no repositories by default:\n        return _rexists_map[self._func_rexists](self)\n\n    def get_contents(self):\n        \"\"\"Fetch the contents of the entry.\"\"\"\n        return _get_contents_map[self._func_get_contents](self)\n\n    def missing(self):\n        return not self.is_derived() and \\\n               not self.linked and \\\n               not self.rexists()\n\n    def remove(self):\n        \"\"\"Remove this Node:  no-op by default.\"\"\"\n        return None\n\n    def add_dependency(self, depend):\n        \"\"\"Adds dependencies.\"\"\"\n        try:\n            self._add_child(self.depends, self.depends_set, depend)\n        except TypeError as e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node dependency to %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_prerequisite(self, prerequisite):\n        \"\"\"Adds prerequisites\"\"\"\n        if self.prerequisites is None:\n            self.prerequisites = SCons.Util.UniqueList()\n        self.prerequisites.extend(prerequisite)\n        self._children_reset()\n\n    def add_ignore(self, depend):\n        \"\"\"Adds dependencies to ignore.\"\"\"\n        try:\n            self._add_child(self.ignore, self.ignore_set, depend)\n        except TypeError as e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to ignore a non-Node dependency of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_source(self, source):\n        \"\"\"Adds sources.\"\"\"\n        if self._specific_sources:\n            return\n        try:\n            self._add_child(self.sources, self.sources_set, source)\n        except TypeError as e:\n            e = e.args[0]\n            if SCons.Util.is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node as source of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def _add_child(self, collection, set, child):\n        \"\"\"Adds 'child' to 'collection', first checking 'set' to see if it's\n        already present.\"\"\"\n        added = None\n        for c in child:\n            if c not in set:\n                set.add(c)\n                collection.append(c)\n                added = 1\n        if added:\n            self._children_reset()\n\n    def set_specific_source(self, source):\n        self.add_source(source)\n        self._specific_sources = True\n\n    def add_wkid(self, wkid):\n        \"\"\"Add a node to the list of kids waiting to be evaluated\"\"\"\n        if self.wkids is not None:\n            self.wkids.append(wkid)\n\n    def _children_reset(self):\n        self.clear_memoized_values()\n        # We need to let the Executor clear out any calculated\n        # build info that it's cached so we can re-calculate it.\n        self.executor_cleanup()\n\n    @SCons.Memoize.CountMethodCall\n    def _children_get(self):\n        try:\n            return self._memo['_children_get']\n        except KeyError:\n            pass\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        if self.ignore_set:\n            iter = chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f])\n\n            children = []\n            for i in iter:\n                if i not in self.ignore_set:\n                    children.append(i)\n        else:\n            children = self.all_children(scan=0)\n\n        self._memo['_children_get'] = children\n        return children\n\n    def all_children(self, scan=1):\n        \"\"\"Return a list of all the node's direct children.\"\"\"\n        if scan:\n            self.scan()\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        return list(chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f]))\n\n    def children(self, scan=1):\n        \"\"\"Return a list of the node's direct children, minus those\n        that are ignored by this node.\"\"\"\n        if scan:\n            self.scan()\n        return self._children_get()\n\n    def set_state(self, state):\n        self.state = state\n\n    def get_state(self):\n        return self.state\n\n    def get_env(self):\n        env = self.env\n        if not env:\n            import SCons.Defaults\n            env = SCons.Defaults.DefaultEnvironment()\n        return env\n\n    def Decider(self, function):\n        foundkey = None\n        for k, v in _decider_map.items():\n            if v == function:\n                foundkey = k\n                break\n        if not foundkey:\n            foundkey = len(_decider_map)\n            _decider_map[foundkey] = function\n        self.changed_since_last_build = foundkey\n\n    def Tag(self, key, value):\n        \"\"\" Add a user-defined tag. \"\"\"\n        if not self._tags:\n            self._tags = {}\n        self._tags[key] = value\n\n    def GetTag(self, key):\n        \"\"\" Return a user-defined tag. \"\"\"\n        if not self._tags:\n            return None\n        return self._tags.get(key, None)\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.  The default behavior is to compare\n        it against our own previously stored BuildInfo, but the stored\n        BuildInfo from another Node (typically one in a Repository)\n        can be used instead.\n\n        Note that we now *always* check every dependency.  We used to\n        short-circuit the check by returning as soon as we detected\n        any difference, but we now rely on checking every dependency\n        to make sure that any necessary Node information (for example,\n        the content signature of an #included .h file) is updated.\n\n        The allowcache option was added for supporting the early\n        release of the executor/builder structures, right after\n        a File target was built. When set to true, the return\n        value of this changed method gets cached for File nodes.\n        Like this, the executor isn't needed any longer for subsequent\n        calls to changed().\n\n        @see: FS.File.changed(), FS.File.release_target_info()\n        \"\"\"\n        t = 0\n        if t: Trace('changed(%s [%s], %s)' % (self, classname(self), node))\n        if node is None:\n            node = self\n\n        result = False\n\n        bi = node.get_stored_info().binfo\n        then = bi.bsourcesigs + bi.bdependsigs + bi.bimplicitsigs\n        children = self.children()\n\n        diff = len(children) - len(then)\n        if diff:\n            # The old and new dependency lists are different lengths.\n            # This always indicates that the Node must be rebuilt.\n            # We also extend the old dependency list with enough None\n            # entries to equal the new dependency list, for the benefit\n            # of the loop below that updates node information.\n            then.extend([None] * diff)\n            if t: Trace(': old %s new %s' % (len(then), len(children)))\n            result = True\n\n        for child, prev_ni in zip(children, then):\n            if _decider_map[child.changed_since_last_build](child, self, prev_ni, node):\n                if t: Trace(': %s changed' % child)\n                result = True\n\n        if self.has_builder():\n            contents = self.get_executor().get_contents()\n            newsig = SCons.Util.MD5signature(contents)\n            if bi.bactsig != newsig:\n                if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig))\n                result = True\n\n        if not result:\n            if t: Trace(': up to date')\n\n        if t: Trace('\\n')\n\n        return result\n\n    def is_up_to_date(self):\n        \"\"\"Default check for whether the Node is current: unknown Node\n        subtypes are always out of date, so they will always get built.\"\"\"\n        return None\n\n    def children_are_up_to_date(self):\n        \"\"\"Alternate check for whether the Node is current:  If all of\n        our children were up-to-date, then this Node was up-to-date, too.\n\n        The SCons.Node.Alias and SCons.Node.Python.Value subclasses\n        rebind their current() method to this method.\"\"\"\n        # Allow the children to calculate their signatures.\n        self.binfo = self.get_binfo()\n        if self.always_build:\n            return None\n        state = 0\n        for kid in self.children(None):\n            s = kid.get_state()\n            if s and (not state or s > state):\n                state = s\n        return (state == 0 or state == SCons.Node.up_to_date)\n\n    def is_literal(self):\n        \"\"\"Always pass the string representation of a Node to\n        the command interpreter literally.\"\"\"\n        return 1\n\n    def render_include_tree(self):\n        \"\"\"\n        Return a text representation, suitable for displaying to the\n        user, of the include tree for the sources of this node.\n        \"\"\"\n        if self.is_derived():\n            env = self.get_build_env()\n            if env:\n                for s in self.sources:\n                    scanner = self.get_source_scanner(s)\n                    if scanner:\n                        path = self.get_build_scanner_path(scanner)\n                    else:\n                        path = None\n                    def f(node, env=env, scanner=scanner, path=path):\n                        return node.get_found_includes(env, scanner, path)\n                    return SCons.Util.render_tree(s, f, 1)\n        else:\n            return None\n\n    def get_abspath(self):\n        \"\"\"\n        Return an absolute path to the Node.  This will return simply\n        str(Node) by default, but for Node types that have a concept of\n        relative path, this might return something different.\n        \"\"\"\n        return str(self)\n\n    def for_signature(self):\n        \"\"\"\n        Return a string representation of the Node that will always\n        be the same for this particular Node, no matter what.  This\n        is by contrast to the __str__() method, which might, for\n        instance, return a relative path for a file Node.  The purpose\n        of this method is to generate a value to be used in signature\n        calculation for the command line used to build a target, and\n        we use this method instead of str() to avoid unnecessary\n        rebuilds.  This method does not need to return something that\n        would actually work in a command line; it can return any kind of\n        nonsense, so long as it does not change.\n        \"\"\"\n        return str(self)\n\n    def get_string(self, for_signature):\n        \"\"\"This is a convenience function designed primarily to be\n        used in command generators (i.e., CommandGeneratorActions or\n        Environment variables that are callable), which are called\n        with a for_signature argument that is nonzero if the command\n        generator is being called to generate a signature for the\n        command line, which determines if we should rebuild or not.\n\n        Such command generators should use this method in preference\n        to str(Node) when converting a Node to a string, passing\n        in the for_signature parameter, such that we will call\n        Node.for_signature() or str(Node) properly, depending on whether\n        we are calculating a signature or actually constructing a\n        command line.\"\"\"\n        if for_signature:\n            return self.for_signature()\n        return str(self)\n\n    def get_subst_proxy(self):\n        \"\"\"\n        This method is expected to return an object that will function\n        exactly like this Node, except that it implements any additional\n        special features that we would like to be in effect for\n        Environment variable substitution.  The principle use is that\n        some Nodes would like to implement a __getattr__() method,\n        but putting that in the Node type itself has a tendency to kill\n        performance.  We instead put it in a proxy and return it from\n        this method.  It is legal for this method to return self\n        if no new functionality is needed for Environment substitution.\n        \"\"\"\n        return self\n\n    def explain(self):\n        if not self.exists():\n            return \"building `%s' because it doesn't exist\\n\" % self\n\n        if self.always_build:\n            return \"rebuilding `%s' because AlwaysBuild() is specified\\n\" % self\n\n        old = self.get_stored_info()\n        if old is None:\n            return None\n\n        old = old.binfo\n        old.prepare_dependencies()\n\n        try:\n            old_bkids    = old.bsources    + old.bdepends    + old.bimplicit\n            old_bkidsigs = old.bsourcesigs + old.bdependsigs + old.bimplicitsigs\n        except AttributeError:\n            return \"Cannot explain why `%s' is being rebuilt: No previous build information found\\n\" % self\n\n        new = self.get_binfo()\n\n        new_bkids    = new.bsources    + new.bdepends    + new.bimplicit\n        new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs\n\n        osig = dict(list(zip(old_bkids, old_bkidsigs)))\n        nsig = dict(list(zip(new_bkids, new_bkidsigs)))\n\n        # The sources and dependencies we'll want to report are all stored\n        # as relative paths to this target's directory, but we want to\n        # report them relative to the top-level SConstruct directory,\n        # so we only print them after running them through this lambda\n        # to turn them into the right relative Node and then return\n        # its string.\n        def stringify( s, E=self.dir.Entry):\n            if hasattr( s, 'dir' ) :\n                return str(E(s))\n            return str(s)\n\n        lines = []\n\n        removed = [x for x in old_bkids if x not in new_bkids]\n        if removed:\n            removed = [stringify(r) for r in removed]\n            fmt = \"`%s' is no longer a dependency\\n\"\n            lines.extend([fmt % s for s in removed])\n\n        for k in new_bkids:\n            if k not in old_bkids:\n                lines.append(\"`%s' is a new dependency\\n\" % stringify(k))\n            else:\n                changed = _decider_map[k.changed_since_last_build](k, self, osig[k])\n\n                if changed:\n                    lines.append(\"`%s' changed\\n\" % stringify(k))\n\n        if len(lines) == 0 and old_bkids != new_bkids:\n            lines.append(\"the dependency order changed:\\n\")\n            lines.append(\"->Sources\\n\")\n            for (o,n) in zip_longest(old.bsources, new.bsources, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n            lines.append(\"->Depends\\n\")\n            for (o,n) in zip_longest(old.bdepends, new.bdepends, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n            lines.append(\"->Implicit\\n\")\n            for (o,n) in zip_longest(old.bimplicit, new.bimplicit, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n\n        if len(lines) == 0:\n            def fmt_with_title(title, strlines):\n                lines = strlines.split('\\n')\n                sep = '\\n' + ' '*(15 + len(title))\n                return ' '*15 + title + sep.join(lines) + '\\n'\n            if old.bactsig != new.bactsig:\n                if old.bact == new.bact:\n                    lines.append(\"the contents of the build action changed\\n\" +\n                                 fmt_with_title('action: ', new.bact))\n\n                    # lines.append(\"the contents of the build action changed [%s] [%s]\\n\"%(old.bactsig,new.bactsig) +\n                    #              fmt_with_title('action: ', new.bact))\n                else:\n                    lines.append(\"the build action changed:\\n\" +\n                                 fmt_with_title('old: ', old.bact) +\n                                 fmt_with_title('new: ', new.bact))\n\n        if len(lines) == 0:\n            return \"rebuilding `%s' for unknown reasons\\n\" % self\n\n        preamble = \"rebuilding `%s' because\" % self\n        if len(lines) == 1:\n            return \"%s %s\"  % (preamble, lines[0])\n        else:\n            lines = [\"%s:\\n\" % preamble] + lines\n            return ( ' '*11).join(lines)\n\nclass NodeList(collections.UserList):\n    def __str__(self):\n        return str(list(map(str, self.data)))\n\ndef get_children(node, parent): return node.children()\ndef ignore_cycle(node, stack): pass\ndef do_nothing(node, parent): pass\n\nclass Walker(object):\n    \"\"\"An iterator for walking a Node tree.\n\n    This is depth-first, children are visited before the parent.\n    The Walker object can be initialized with any node, and\n    returns the next node on the descent with each get_next() call.\n    get the children of a node instead of calling 'children'.\n    'cycle_func' is an optional function that will be called\n    when a cycle is detected.\n\n    This class does not get caught in node cycles caused, for example,\n    by C header file include loops.\n    \"\"\"\n    def __init__(self, node, kids_func=get_children,\n                             cycle_func=ignore_cycle,\n                             eval_func=do_nothing):\n        self.kids_func = kids_func\n        self.cycle_func = cycle_func\n        self.eval_func = eval_func\n        node.wkids = copy.copy(kids_func(node, None))\n        self.stack = [node]\n        self.history = {} # used to efficiently detect and avoid cycles\n        self.history[node] = None\n\n    def get_next(self):\n        \"\"\"Return the next node for this walk of the tree.\n\n        This function is intentionally iterative, not recursive,\n        to sidestep any issues of stack size limitations.\n        \"\"\"\n\n        while self.stack:\n            if self.stack[-1].wkids:\n                node = self.stack[-1].wkids.pop(0)\n                if not self.stack[-1].wkids:\n                    self.stack[-1].wkids = None\n                if node in self.history:\n                    self.cycle_func(node, self.stack)\n                else:\n                    node.wkids = copy.copy(self.kids_func(node, self.stack[-1]))\n                    self.stack.append(node)\n                    self.history[node] = None\n            else:\n                node = self.stack.pop()\n                del self.history[node]\n                if node:\n                    if self.stack:\n                        parent = self.stack[-1]\n                    else:\n                        parent = None\n                    self.eval_func(node, parent)\n                return node\n        return None\n\n    def is_done(self):\n        return not self.stack\n\n\narg2nodes_lookups = []\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/PathList.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/PathList.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"SCons.PathList\n\nA module for handling lists of directory paths (the sort of things\nthat get set as CPPPATH, LIBPATH, etc.) with as much caching of data and\nefficiency as we can, while still keeping the evaluation delayed so that we\nDo the Right Thing (almost) regardless of how the variable is specified.\n\n\"\"\"\n\nimport os\n\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Util\n\n#\n# Variables to specify the different types of entries in a PathList object:\n#\n\nTYPE_STRING_NO_SUBST = 0        # string with no '$'\nTYPE_STRING_SUBST = 1           # string containing '$'\nTYPE_OBJECT = 2                 # other object\n\ndef node_conv(obj):\n    \"\"\"\n    This is the \"string conversion\" routine that we have our substitutions\n    use to return Nodes, not strings.  This relies on the fact that an\n    EntryProxy object has a get() method that returns the underlying\n    Node that it wraps, which is a bit of architectural dependence\n    that we might need to break or modify in the future in response to\n    additional requirements.\n    \"\"\"\n    try:\n        get = obj.get\n    except AttributeError:\n        if isinstance(obj, SCons.Node.Node) or SCons.Util.is_Sequence( obj ):\n            result = obj\n        else:\n            result = str(obj)\n    else:\n        result = get()\n    return result\n\nclass _PathList(object):\n    \"\"\"\n    An actual PathList object.\n    \"\"\"\n    def __init__(self, pathlist):\n        \"\"\"\n        Initializes a PathList object, canonicalizing the input and\n        pre-processing it for quicker substitution later.\n\n        The stored representation of the PathList is a list of tuples\n        containing (type, value), where the \"type\" is one of the TYPE_*\n        variables defined above.  We distinguish between:\n\n            strings that contain no '$' and therefore need no\n            delayed-evaluation string substitution (we expect that there\n            will be many of these and that we therefore get a pretty\n            big win from avoiding string substitution)\n\n            strings that contain '$' and therefore need substitution\n            (the hard case is things like '${TARGET.dir}/include',\n            which require re-evaluation for every target + source)\n\n            other objects (which may be something like an EntryProxy\n            that needs a method called to return a Node)\n\n        Pre-identifying the type of each element in the PathList up-front\n        and storing the type in the list of tuples is intended to reduce\n        the amount of calculation when we actually do the substitution\n        over and over for each target.\n        \"\"\"\n        if SCons.Util.is_String(pathlist):\n            pathlist = pathlist.split(os.pathsep)\n        elif not SCons.Util.is_Sequence(pathlist):\n            pathlist = [pathlist]\n\n        pl = []\n        for p in pathlist:\n            try:\n                found = '$' in p\n            except (AttributeError, TypeError):\n                type = TYPE_OBJECT\n            else:\n                if not found:\n                    type = TYPE_STRING_NO_SUBST\n                else:\n                    type = TYPE_STRING_SUBST\n            pl.append((type, p))\n\n        self.pathlist = tuple(pl)\n\n    def __len__(self): return len(self.pathlist)\n\n    def __getitem__(self, i): return self.pathlist[i]\n\n    def subst_path(self, env, target, source):\n        \"\"\"\n        Performs construction variable substitution on a pre-digested\n        PathList for a specific target and source.\n        \"\"\"\n        result = []\n        for type, value in self.pathlist:\n            if type == TYPE_STRING_SUBST:\n                value = env.subst(value, target=target, source=source,\n                                  conv=node_conv)\n                if SCons.Util.is_Sequence(value):\n                    result.extend(SCons.Util.flatten(value))\n                elif value:\n                    result.append(value)\n            elif type == TYPE_OBJECT:\n                value = node_conv(value)\n                if value:\n                    result.append(value)\n            elif value:\n                result.append(value)\n        return tuple(result)\n\n\nclass PathListCache(object):\n    \"\"\"\n    A class to handle caching of PathList lookups.\n\n    This class gets instantiated once and then deleted from the namespace,\n    so it's used as a Singleton (although we don't enforce that in the\n    usual Pythonic ways).  We could have just made the cache a dictionary\n    in the module namespace, but putting it in this class allows us to\n    use the same Memoizer pattern that we use elsewhere to count cache\n    hits and misses, which is very valuable.\n\n    Lookup keys in the cache are computed by the _PathList_key() method.\n    Cache lookup should be quick, so we don't spend cycles canonicalizing\n    all forms of the same lookup key.  For example, 'x:y' and ['x',\n    'y'] logically represent the same list, but we don't bother to\n    split string representations and treat those two equivalently.\n    (Note, however, that we do, treat lists and tuples the same.)\n\n    The main type of duplication we're trying to catch will come from\n    looking up the same path list from two different clones of the\n    same construction environment.  That is, given\n    \n        env2 = env1.Clone()\n\n    both env1 and env2 will have the same CPPPATH value, and we can\n    cheaply avoid re-parsing both values of CPPPATH by using the\n    common value from this cache.\n    \"\"\"\n    def __init__(self):\n        self._memo = {}\n\n    def _PathList_key(self, pathlist):\n        \"\"\"\n        Returns the key for memoization of PathLists.\n\n        Note that we want this to be pretty quick, so we don't completely\n        canonicalize all forms of the same list.  For example,\n        'dir1:$ROOT/dir2' and ['$ROOT/dir1', 'dir'] may logically\n        represent the same list if you're executing from $ROOT, but\n        we're not going to bother splitting strings into path elements,\n        or massaging strings into Nodes, to identify that equivalence.\n        We just want to eliminate obvious redundancy from the normal\n        case of re-using exactly the same cloned value for a path.\n        \"\"\"\n        if SCons.Util.is_Sequence(pathlist):\n            pathlist = tuple(SCons.Util.flatten(pathlist))\n        return pathlist\n\n    @SCons.Memoize.CountDictCall(_PathList_key)\n    def PathList(self, pathlist):\n        \"\"\"\n        Returns the cached _PathList object for the specified pathlist,\n        creating and caching a new object as necessary.\n        \"\"\"\n        pathlist = self._PathList_key(pathlist)\n        try:\n            memo_dict = self._memo['PathList']\n        except KeyError:\n            memo_dict = {}\n            self._memo['PathList'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        result = _PathList(pathlist)\n\n        memo_dict[pathlist] = result\n\n        return result\n\nPathList = PathListCache().PathList\n\n\ndel PathListCache\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/__init__.py",
    "content": "\"\"\"SCons.Platform\n\nSCons platform selection.\n\nThis looks for modules that define a callable object that can modify a\nconstruction environment as appropriate for a given platform.\n\nNote that we take a more simplistic view of \"platform\" than Python does.\nWe're looking for a single string that determines a set of\ntool-independent variables with which to initialize a construction\nenvironment.  Consequently, we'll examine both sys.platform and os.name\n(and anything else that might come in to play) in order to return some\nspecification which is unique enough for our purposes.\n\nNote that because this subsystem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"platform specification\" in an arbitrary callable function.\nNo one needs to use or tie in to this subsystem in order to roll\ntheir own platform definition.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Platform/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.compat\n\nimport importlib\nimport os\nimport sys\nimport tempfile\n\nimport SCons.Errors\nimport SCons.Subst\nimport SCons.Tool\n\n\ndef platform_default():\n    \"\"\"Return the platform string for our execution environment.\n\n    The returned value should map to one of the SCons/Platform/*.py\n    files.  Since we're architecture independent, though, we don't\n    care about the machine architecture.\n    \"\"\"\n    osname = os.name\n    if osname == 'java':\n        osname = os._osType\n    if osname == 'posix':\n        if sys.platform == 'cygwin':\n            return 'cygwin'\n        elif sys.platform.find('irix') != -1:\n            return 'irix'\n        elif sys.platform.find('sunos') != -1:\n            return 'sunos'\n        elif sys.platform.find('hp-ux') != -1:\n            return 'hpux'\n        elif sys.platform.find('aix') != -1:\n            return 'aix'\n        elif sys.platform.find('darwin') != -1:\n            return 'darwin'\n        else:\n            return 'posix'\n    elif os.name == 'os2':\n        return 'os2'\n    else:\n        return sys.platform\n\n\ndef platform_module(name = platform_default()):\n    \"\"\"Return the imported module for the platform.\n\n    This looks for a module name that matches the specified argument.\n    If the name is unspecified, we fetch the appropriate default for\n    our execution environment.\n    \"\"\"\n    full_name = 'SCons.Platform.' + name\n    if full_name not in sys.modules:\n        if os.name == 'java':\n            eval(full_name)\n        else:\n            try:\n                # the specific platform module is a relative import\n                mod = importlib.import_module(\".\" + name, __name__)\n            except ImportError:\n                try:\n                    import zipimport\n                    importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] )\n                    mod = importer.load_module(full_name)\n                except ImportError:\n                    raise SCons.Errors.UserError(\"No platform named '%s'\" % name)\n            setattr(SCons.Platform, name, mod)\n    return sys.modules[full_name]\n\n\ndef DefaultToolList(platform, env):\n    \"\"\"Select a default tool list for the specified platform.\n    \"\"\"\n    return SCons.Tool.tool_list(platform, env)\n\n\nclass PlatformSpec(object):\n    def __init__(self, name, generate):\n        self.name = name\n        self.generate = generate\n\n    def __call__(self, *args, **kw):\n        return self.generate(*args, **kw)\n\n    def __str__(self):\n        return self.name\n\n\nclass TempFileMunge(object):\n    \"\"\"A callable class.  You can set an Environment variable to this,\n    then call it with a string argument, then it will perform temporary\n    file substitution on it.  This is used to circumvent the long command\n    line limitation.\n\n    Example usage:\n        env[\"TEMPFILE\"] = TempFileMunge\n        env[\"LINKCOM\"] = \"${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}\"\n\n    By default, the name of the temporary file used begins with a\n    prefix of '@'.  This may be configured for other tool chains by\n    setting '$TEMPFILEPREFIX':\n        env[\"TEMPFILEPREFIX\"] = '-@'        # diab compiler\n        env[\"TEMPFILEPREFIX\"] = '-via'      # arm tool chain\n        env[\"TEMPFILEPREFIX\"] = ''          # (the empty string) PC Lint\n\n    You can configure the extension of the temporary file through the\n    TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments\n    in the code below):\n        env[\"TEMPFILESUFFIX\"] = '.lnt'   # PC Lint\n    \"\"\"\n    def __init__(self, cmd, cmdstr = None):\n        self.cmd = cmd\n        self.cmdstr = cmdstr\n\n    def __call__(self, target, source, env, for_signature):\n        if for_signature:\n            # If we're being called for signature calculation, it's\n            # because we're being called by the string expansion in\n            # Subst.py, which has the logic to strip any $( $) that\n            # may be in the command line we squirreled away.  So we\n            # just return the raw command line and let the upper\n            # string substitution layers do their thing.\n            return self.cmd\n\n        # Now we're actually being called because someone is actually\n        # going to try to execute the command, so we have to do our\n        # own expansion.\n        cmd = env.subst_list(self.cmd, SCons.Subst.SUBST_CMD, target, source)[0]\n        try:\n            maxline = int(env.subst('$MAXLINELENGTH'))\n        except ValueError:\n            maxline = 2048\n\n        length = 0\n        for c in cmd:\n            length += len(c)\n        length += len(cmd) - 1\n        if length <= maxline:\n            return self.cmd\n\n        # Check if we already created the temporary file for this target\n        # It should have been previously done by Action.strfunction() call\n        node = target[0] if SCons.Util.is_List(target) else target\n        cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \\\n                    if node is not None else None\n        if cmdlist is not None:\n            return cmdlist\n\n        # We do a normpath because mktemp() has what appears to be\n        # a bug in Windows that will use a forward slash as a path\n        # delimiter.  Windows' link mistakes that for a command line\n        # switch and barfs.\n        #\n        # Default to the .lnk suffix for the benefit of the Phar Lap\n        # linkloc linker, which likes to append an .lnk suffix if\n        # none is given.\n        if env.has_key('TEMPFILESUFFIX'):\n            suffix = env.subst('$TEMPFILESUFFIX')\n        else:\n            suffix = '.lnk'\n\n        fd, tmp = tempfile.mkstemp(suffix, text=True)\n        native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp))\n\n        if env.get('SHELL', None) == 'sh':\n            # The sh shell will try to escape the backslashes in the\n            # path, so unescape them.\n            native_tmp = native_tmp.replace('\\\\', r'\\\\\\\\')\n            # In Cygwin, we want to use rm to delete the temporary\n            # file, because del does not exist in the sh shell.\n            rm = env.Detect('rm') or 'del'\n        else:\n            # Don't use 'rm' if the shell is not sh, because rm won't\n            # work with the Windows shells (cmd.exe or command.com) or\n            # Windows path names.\n            rm = 'del'\n\n        prefix = env.subst('$TEMPFILEPREFIX')\n        if not prefix:\n            prefix = '@'\n\n        args = list(map(SCons.Subst.quote_spaces, cmd[1:]))\n        join_char = env.get('TEMPFILEARGJOIN',' ')\n        os.write(fd, bytearray(join_char.join(args) + \"\\n\",'utf-8'))\n        os.close(fd)\n\n        # XXX Using the SCons.Action.print_actions value directly\n        # like this is bogus, but expedient.  This class should\n        # really be rewritten as an Action that defines the\n        # __call__() and strfunction() methods and lets the\n        # normal action-execution logic handle whether or not to\n        # print/execute the action.  The problem, though, is all\n        # of that is decided before we execute this method as\n        # part of expanding the $TEMPFILE construction variable.\n        # Consequently, refactoring this will have to wait until\n        # we get more flexible with allowing Actions to exist\n        # independently and get strung together arbitrarily like\n        # Ant tasks.  In the meantime, it's going to be more\n        # user-friendly to not let obsession with architectural\n        # purity get in the way of just being helpful, so we'll\n        # reach into SCons.Action directly.\n        if SCons.Action.print_actions:\n            cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,\n                               source) if self.cmdstr is not None else ''\n            # Print our message only if XXXCOMSTR returns an empty string\n            if len(cmdstr) == 0 :\n                cmdstr = (\"Using tempfile \"+native_tmp+\" for command line:\\n\"+\n                    str(cmd[0]) + \" \" + \" \".join(args))\n                self._print_cmd_str(target, source, env, cmdstr)\n\n        # Store the temporary file command list into the target Node.attributes\n        # to avoid creating two temporary files one for print and one for execute.\n        cmdlist = [ cmd[0], prefix + native_tmp + '\\n' + rm, native_tmp ]\n        if node is not None:\n            try :\n                setattr(node.attributes, 'tempfile_cmdlist', cmdlist)\n            except AttributeError:\n                pass\n        return cmdlist\n\n    def _print_cmd_str(self, target, source, env, cmdstr):\n        # check if the user has specified a cmd line print function\n        print_func = None\n        try:\n            get = env.get\n        except AttributeError:\n            pass\n        else:\n            print_func = get('PRINT_CMD_LINE_FUNC')\n\n        # use the default action cmd line print if user did not supply one\n        if not print_func:\n            action = SCons.Action._ActionAction()\n            action.print_cmd_line(cmdstr, target, source, env)\n        else:\n            print_func(cmdstr, target, source, env)\n\n\ndef Platform(name = platform_default()):\n    \"\"\"Select a canned Platform specification.\n    \"\"\"\n    module = platform_module(name)\n    spec = PlatformSpec(name, module.generate)\n    return spec\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/aix.py",
    "content": "\"\"\"engine.SCons.Platform.aix\n\nPlatform-specific initialization for IBM AIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/aix.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport subprocess\n\nfrom . import posix\n\nimport SCons.Util\nimport SCons.Action\n\ndef get_xlc(env, xlc=None, packages=[]):\n    # Use the AIX package installer tool lslpp to figure out where a\n    # given xl* compiler is installed and what version it is.\n    xlcPath = None\n    xlcVersion = None\n\n    if xlc is None:\n        xlc = env.get('CC', 'xlc')\n    if SCons.Util.is_List(xlc):\n        xlc = xlc[0]\n    for package in packages:\n        # find the installed filename, which may be a symlink as well\n        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],\n                stdin = 'devnull',\n                stderr = 'devnull',\n                stdout = subprocess.PIPE)\n        # output of lslpp is something like this:\n        #     #Path:Fileset:File\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc\n        for line in pipe.stdout:\n            if xlcPath:\n                continue # read everything to let lslpp terminate\n            fileset, filename = line.split(':')[1:3]\n            filename = filename.split()[0]\n            if ('/' in xlc and filename == xlc) \\\n            or ('/' not in xlc and filename.endswith('/' + xlc)):\n                xlcVersion = fileset.split()[1]\n                xlcPath, sep, xlc = filename.rpartition('/')\n            pass\n        pass\n    return (xlcPath, xlc, xlcVersion)\n\ndef generate(env):\n    posix.generate(env)\n    #Based on AIX 5.2: ARG_MAX=24576 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 21576\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/cygwin.py",
    "content": "\"\"\"SCons.Platform.cygwin\n\nPlatform-specific initialization for Cygwin systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/cygwin.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport sys\n\nfrom . import posix\nfrom SCons.Platform import TempFileMunge\n\nCYGWIN_DEFAULT_PATHS = []\nif sys.platform == 'win32':\n    CYGWIN_DEFAULT_PATHS = [\n        r'C:\\cygwin64\\bin',\n        r'C:\\cygwin\\bin'\n    ]\n\ndef generate(env):\n    posix.generate(env)\n\n    env['PROGPREFIX']  = ''\n    env['PROGSUFFIX']  = '.exe'\n    env['SHLIBPREFIX'] = ''\n    env['SHLIBSUFFIX'] = '.dll'\n    env['LIBPREFIXES'] = [ '$LIBPREFIX', '$SHLIBPREFIX', '$IMPLIBPREFIX' ]\n    env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX', '$IMPLIBSUFFIX' ]\n    env['TEMPFILE']    = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/darwin.py",
    "content": "\"\"\"engine.SCons.Platform.darwin\n\nPlatform-specific initialization for Mac OS X systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/darwin.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import posix\nimport os\n\ndef generate(env):\n    posix.generate(env)\n    env['SHLIBSUFFIX'] = '.dylib'\n    # put macports paths at front to override Apple's versions, fink path is after\n    # For now let people who want Macports or Fink tools specify it!\n    # env['ENV']['PATH'] = '/opt/local/bin:/opt/local/sbin:' + env['ENV']['PATH'] + ':/sw/bin'\n    \n    # Store extra system paths in env['ENV']['PATHOSX']\n    \n    filelist = ['/etc/paths',]\n    # make sure this works on Macs with Tiger or earlier\n    try:\n        dirlist = os.listdir('/etc/paths.d')\n    except:\n        dirlist = []\n\n    for file in dirlist:\n        filelist.append('/etc/paths.d/'+file)\n\n    for file in filelist:\n        if os.path.isfile(file):\n            with open(file, 'r') as f:\n                lines = f.readlines()\n                for line in lines:\n                    if line:\n                        env.AppendENVPath('PATHOSX', line.strip('\\n'))\n\n    # Not sure why this wasn't the case all along?\n    if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False):\n        env.AppendENVPath('PATH',env['ENV']['PATHOSX'])\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/hpux.py",
    "content": "\"\"\"engine.SCons.Platform.hpux\n\nPlatform-specific initialization for HP-UX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/hpux.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n    #Based on HP-UX11i: ARG_MAX=2048000 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 2045000\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/irix.py",
    "content": "\"\"\"SCons.Platform.irix\n\nPlatform-specific initialization for SGI IRIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/irix.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/mingw.py",
    "content": "\"\"\"SCons.Platform.mingw\n\nPlatform-specific initialization for the MinGW system.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/mingw.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport sys\n\nMINGW_DEFAULT_PATHS = []\nif sys.platform == 'win32':\n    MINGW_DEFAULT_PATHS = [\n        r'C:\\msys64',\n        r'C:\\msys'\n    ]"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/os2.py",
    "content": "\"\"\"SCons.Platform.os2\n\nPlatform-specific initialization for OS/2 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/os2.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\nfrom . import win32\n\ndef generate(env):\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = '$LIBPREFIX'\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['HOST_OS']        = 'os2'\n    env['HOST_ARCH']      = win32.get_architecture().arch\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/posix.py",
    "content": "\"\"\"SCons.Platform.posix\n\nPlatform-specific initialization for POSIX (Linux, UNIX, etc.) systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/posix.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport errno\nimport os\nimport os.path\nimport subprocess\nimport sys\nimport select\n\nimport SCons.Util\nfrom SCons.Platform import TempFileMunge\nfrom SCons.Platform.virtualenv import ImportVirtualenv\nfrom SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv\n\nexitvalmap = {\n    2 : 127,\n    13 : 126,\n}\n\ndef escape(arg):\n    \"\"\"escape shell special characters\"\"\"\n    slash = '\\\\'\n    special = '\"$'\n\n    arg = arg.replace(slash, slash+slash)\n    for c in special:\n        arg = arg.replace(c, slash+c)\n\n    # print(\"ESCAPE RESULT: %s\" % arg)\n    return '\"' + arg + '\"'\n\n\ndef exec_subprocess(l, env):\n    proc = subprocess.Popen(l, env = env, close_fds = True)\n    return proc.wait()\n\ndef subprocess_spawn(sh, escape, cmd, args, env):\n    return exec_subprocess([sh, '-c', ' '.join(args)], env)\n\ndef exec_popen3(l, env, stdout, stderr):\n    proc = subprocess.Popen(l, env = env, close_fds = True,\n                            stdout = stdout,\n                            stderr = stderr)\n    return proc.wait()\n\ndef piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # spawn using Popen3 combined with the env command\n    # the command name and the command's stdout is written to stdout\n    # the command's stderr is written to stderr\n    return exec_popen3([sh, '-c', ' '.join(args)],\n                       env, stdout, stderr)\n\n\ndef generate(env):\n    # Bearing in mind we have python 2.4 as a baseline, we can just do this:\n    spawn = subprocess_spawn\n    pspawn = piped_env_spawn\n    # Note that this means that 'escape' is no longer used\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['ENV']['PATH']    = '/usr/local/bin:/opt/bin:/bin:/usr/bin'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.o'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = ''\n    env['LIBPREFIX']      = 'lib'\n    env['LIBSUFFIX']      = '.a'\n    env['SHLIBPREFIX']    = '$LIBPREFIX'\n    env['SHLIBSUFFIX']    = '.so'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['PSPAWN']         = pspawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = 'sh'\n    env['ESCAPE']         = escape\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion\n    #Note: specific platforms might rise or lower this value\n    env['MAXLINELENGTH']  = 128072\n\n    # This platform supports RPATH specifications.\n    env['__RPATH'] = '$_RPATH'\n\n    # GDC is GCC family, but DMD and LDC have different options.\n    # Must be able to have GCC and DMD work in the same build, so:\n    env['__DRPATH'] = '$_DRPATH'\n\n    if enable_virtualenv and not ignore_virtualenv:\n        ImportVirtualenv(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/sunos.py",
    "content": "\"\"\"engine.SCons.Platform.sunos\n\nPlatform-specific initialization for Sun systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/sunos.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n    # Based on sunSparc 8:32bit\n    # ARG_MAX=1048320 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 1045320\n    env['PKGINFO'] = 'pkginfo'\n    env['PKGCHK'] = '/usr/sbin/pkgchk'\n    env['ENV']['PATH'] = env['ENV']['PATH'] + ':/opt/SUNWspro/bin:/usr/ccs/bin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/virtualenv.py",
    "content": "\"\"\"SCons.Platform.virtualenv\n\nSupport for virtualenv.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/virtualenv.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport sys\nimport SCons.Util\n\n\nvirtualenv_enabled_by_default = False\n\n\ndef _enable_virtualenv_default():\n    return SCons.Util.get_os_env_bool('SCONS_ENABLE_VIRTUALENV', virtualenv_enabled_by_default)\n\n\ndef _ignore_virtualenv_default():\n    return SCons.Util.get_os_env_bool('SCONS_IGNORE_VIRTUALENV', False)\n\n\nenable_virtualenv = _enable_virtualenv_default()\nignore_virtualenv = _ignore_virtualenv_default()\nvirtualenv_variables = ['VIRTUAL_ENV', 'PIPENV_ACTIVE']\n\n\ndef _running_in_virtualenv():\n    \"\"\"Returns True, if scons is executed within a virtualenv\"\"\"\n    # see https://stackoverflow.com/a/42580137\n    return (hasattr(sys, 'real_prefix') or\n            (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))\n\n\ndef _is_path_in(path, base):\n    \"\"\"Returns true, if **path** is located under the **base** directory.\"\"\"\n    if not path or not base: # empty path may happen, base too\n        return False\n    rp = os.path.relpath(path, base)\n    return ((not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir))\n\n\ndef _inject_venv_variables(env):\n    if 'ENV' not in env:\n        env['ENV'] = {}\n    ENV = env['ENV']\n    for name in virtualenv_variables:\n        try:\n            ENV[name] = os.environ[name]\n        except KeyError:\n            pass\n\ndef _inject_venv_path(env, path_list=None):\n    \"\"\"Modify environment such that SCons will take into account its virtualenv\n    when running external tools.\"\"\"\n    if path_list is None:\n        path_list = os.getenv('PATH')\n    env.PrependENVPath('PATH', select_paths_in_venv(path_list))\n\n\ndef select_paths_in_venv(path_list):\n    \"\"\"Returns a list of paths from **path_list** which are under virtualenv's\n    home directory.\"\"\"\n    if SCons.Util.is_String(path_list):\n        path_list = path_list.split(os.path.pathsep)\n    # Find in path_list the paths under the virtualenv's home\n    return [path for path in path_list if IsInVirtualenv(path)]\n\n\ndef ImportVirtualenv(env):\n    \"\"\"Copies virtualenv-related environment variables from OS environment\n    to ``env['ENV']`` and prepends virtualenv's PATH to ``env['ENV']['PATH']``.\n    \"\"\"\n    _inject_venv_variables(env)\n    _inject_venv_path(env)\n\n\ndef Virtualenv():\n    \"\"\"Returns path to the virtualenv home if scons is executing within a\n    virtualenv or None, if not.\"\"\"\n    if _running_in_virtualenv():\n        return sys.prefix\n    return None\n\n\ndef IsInVirtualenv(path):\n    \"\"\"Returns True, if **path** is under virtualenv's home directory. If not,\n    or if we don't use virtualenv, returns False.\"\"\"\n    return _is_path_in(path, Virtualenv())\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/win32.py",
    "content": "\"\"\"SCons.Platform.win32\n\nPlatform-specific initialization for Win32 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Platform/win32.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\nimport sys\nimport tempfile\n\nfrom SCons.Platform.posix import exitvalmap\nfrom SCons.Platform import TempFileMunge\nfrom SCons.Platform.virtualenv import ImportVirtualenv\nfrom SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv\nimport SCons.Util\n\nCHOCO_DEFAULT_PATH = [\n    r'C:\\ProgramData\\chocolatey\\bin'\n]\n\ntry:\n    import msvcrt\n    import win32api\n    import win32con\nexcept ImportError:\n    parallel_msg = \\\n        \"you do not seem to have the pywin32 extensions installed;\\n\" + \\\n        \"\\tparallel (-j) builds may not work reliably with open Python files.\"\nexcept AttributeError:\n    parallel_msg = \\\n        \"your pywin32 extensions do not support file handle operations;\\n\" + \\\n        \"\\tparallel (-j) builds may not work reliably with open Python files.\"\nelse:\n    parallel_msg = None\n\n    if sys.version_info.major == 2:\n        import __builtin__\n\n        _builtin_file = __builtin__.file\n        _builtin_open = __builtin__.open\n\n        def _scons_fixup_mode(mode):\n            \"\"\"Adjust 'mode' to mark handle as non-inheritable.\n\n            SCons is multithreaded, so allowing handles to be inherited by\n            children opens us up to races, where (e.g.) processes spawned by\n            the Taskmaster may inherit and retain references to files opened\n            by other threads. This may lead to sharing violations and,\n            ultimately, build failures.\n\n            By including 'N' as part of fopen's 'mode' parameter, all file\n            handles returned from these functions are atomically marked as\n            non-inheritable.\n            \"\"\"\n            if not mode:\n                # Python's default is 'r'.\n                # https://docs.python.org/2/library/functions.html#open\n                mode = 'rN'\n            elif 'N' not in mode:\n                mode += 'N'\n            return mode\n\n        class _scons_file(_builtin_file):\n            def __init__(self, name, mode=None, *args, **kwargs):\n                _builtin_file.__init__(self, name, _scons_fixup_mode(mode),\n                                       *args, **kwargs)\n\n        def _scons_open(name, mode=None, *args, **kwargs):\n            return _builtin_open(name, _scons_fixup_mode(mode),\n                                 *args, **kwargs)\n\n        __builtin__.file = _scons_file\n        __builtin__.open = _scons_open\n\n\n\nif False:\n    # Now swap out shutil.filecopy and filecopy2 for win32 api native CopyFile\n    try:\n        from ctypes import windll\n        import shutil\n\n        CopyFile = windll.kernel32.CopyFileA\n        SetFileTime = windll.kernel32.SetFileTime\n\n        _shutil_copy = shutil.copy\n        _shutil_copy2 = shutil.copy2\n\n        shutil.copy2 = CopyFile\n\n        def win_api_copyfile(src,dst):\n            CopyFile(src,dst)\n            os.utime(dst)\n\n        shutil.copy = win_api_copyfile\n\n    except AttributeError:\n        parallel_msg = \\\n            \"Couldn't override shutil.copy or shutil.copy2 falling back to shutil defaults\"\n\n\n\n\n\n\n\ntry:\n    import threading\n    spawn_lock = threading.Lock()\n\n    # This locked version of spawnve works around a Windows\n    # MSVCRT bug, because its spawnve is not thread-safe.\n    # Without this, python can randomly crash while using -jN.\n    # See the python bug at http://bugs.python.org/issue6476\n    # and SCons issue at\n    # https://github.com/SCons/scons/issues/2449\n    def spawnve(mode, file, args, env):\n        spawn_lock.acquire()\n        try:\n            if mode == os.P_WAIT:\n                ret = os.spawnve(os.P_NOWAIT, file, args, env)\n            else:\n                ret = os.spawnve(mode, file, args, env)\n        finally:\n            spawn_lock.release()\n        if mode == os.P_WAIT:\n            pid, status = os.waitpid(ret, 0)\n            ret = status >> 8\n        return ret\nexcept ImportError:\n    # Use the unsafe method of spawnve.\n    # Please, don't try to optimize this try-except block\n    # away by assuming that the threading module is always present.\n    # In the test test/option-j.py we intentionally call SCons with\n    # a fake threading.py that raises an import exception right away,\n    # simulating a non-existent package.\n    def spawnve(mode, file, args, env):\n        return os.spawnve(mode, file, args, env)\n\n# The upshot of all this is that, if you are using Python 1.5.2,\n# you had better have cmd or command.com in your PATH when you run\n# scons.\n\n\ndef piped_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # There is no direct way to do that in python. What we do\n    # here should work for most cases:\n    #   In case stdout (stderr) is not redirected to a file,\n    #   we redirect it into a temporary file tmpFileStdout\n    #   (tmpFileStderr) and copy the contents of this file\n    #   to stdout (stderr) given in the argument\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n    else:\n        # one temporary file for stdout and stderr\n        tmpFileStdout, tmpFileStdoutName = tempfile.mkstemp(text=True)\n        os.close(tmpFileStdout)\n        tmpFileStderr, tmpFileStderrName = tempfile.mkstemp(text=True)\n        os.close(tmpFileStderr)\n\n        # check if output is redirected\n        stdoutRedirected = 0\n        stderrRedirected = 0\n        for arg in args:\n            # are there more possibilities to redirect stdout ?\n            if arg.find( \">\", 0, 1 ) != -1 or arg.find( \"1>\", 0, 2 ) != -1:\n                stdoutRedirected = 1\n            # are there more possibilities to redirect stderr ?\n            if arg.find( \"2>\", 0, 2 ) != -1:\n                stderrRedirected = 1\n\n        # redirect output of non-redirected streams to our tempfiles\n        if stdoutRedirected == 0:\n            args.append(\">\" + str(tmpFileStdoutName))\n        if stderrRedirected == 0:\n            args.append(\"2>\" + str(tmpFileStderrName))\n\n        # actually do the spawn\n        try:\n            args = [sh, '/C', escape(' '.join(args))]\n            ret = spawnve(os.P_WAIT, sh, args, env)\n        except OSError as e:\n            # catch any error\n            try:\n                ret = exitvalmap[e.errno]\n            except KeyError:\n                sys.stderr.write(\"scons: unknown OSError exception code %d - %s: %s\\n\" % (e.errno, cmd, e.strerror))\n            if stderr is not None:\n                stderr.write(\"scons: %s: %s\\n\" % (cmd, e.strerror))\n        # copy child output from tempfiles to our streams\n        # and do clean up stuff\n        if stdout is not None and stdoutRedirected == 0:\n            try:\n                with open(tmpFileStdout, \"r\" ) as tmp:\n                    stdout.write(tmp.read())\n                os.remove(tmpFileStdout)\n            except (IOError, OSError):\n                pass\n\n        if stderr is not None and stderrRedirected == 0:\n            try:\n                with open(tmpFileStderr, \"r\" ) as tmp:\n                    stderr.write(tmp.read())\n                os.remove(tmpFileStderr)\n            except (IOError, OSError):\n                pass\n        return ret\n\n\ndef exec_spawn(l, env):\n    try:\n        result = spawnve(os.P_WAIT, l[0], l, env)\n    except (OSError, EnvironmentError) as e:\n        try:\n            result = exitvalmap[e.errno]\n            sys.stderr.write(\"scons: %s: %s\\n\" % (l[0], e.strerror))\n        except KeyError:\n            result = 127\n            if len(l) > 2:\n                if len(l[2]) < 1000:\n                    command = ' '.join(l[0:3])\n                else:\n                    command = l[0]\n            else:\n                command = l[0]\n            sys.stderr.write(\"scons: unknown OSError exception code %d - '%s': %s\\n\" % (e.errno, command, e.strerror))\n    return result\n\n\ndef spawn(sh, escape, cmd, args, env):\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n    return exec_spawn([sh, '/C', escape(' '.join(args))], env)\n\n# Windows does not allow special characters in file names anyway, so no\n# need for a complex escape function, we will just quote the arg, except\n# that \"cmd /c\" requires that if an argument ends with a backslash it\n# needs to be escaped so as not to interfere with closing double quote\n# that we add.\ndef escape(x):\n    if x[-1] == '\\\\':\n        x = x + '\\\\'\n    return '\"' + x + '\"'\n\n# Get the windows system directory name\n_system_root = None\n\n\ndef get_system_root():\n    global _system_root\n    if _system_root is not None:\n        return _system_root\n\n    # A resonable default if we can't read the registry\n    val = os.environ.get('SystemRoot', \"C:\\\\WINDOWS\")\n\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n\n    # Ensure system root is a string and not unicode\n    # (This only matters for py27 were unicode in env passed to POpen fails)\n    val = str(val)\n    _system_root = val\n    return val\n\n\ndef get_program_files_dir():\n    \"\"\"\n    Get the location of the program files directory\n    Returns\n    -------\n\n    \"\"\"\n    # Now see if we can look in the registry...\n    val = ''\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows Program Files directory\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir')\n        except SCons.Util.RegError:\n            val = ''\n            pass\n\n    if val == '':\n        # A reasonable default if we can't read the registry\n        # (Actually, it's pretty reasonable even if we can :-)\n        val = os.path.join(os.path.dirname(get_system_root()),\"Program Files\")\n\n    return val\n\n\nclass ArchDefinition(object):\n    \"\"\"\n    Determine which windows CPU were running on.\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\n\ndef get_architecture(arch=None):\n    \"\"\"Returns the definition for the specified architecture string.\n\n    If no string is specified, the system default is returned (as defined\n    by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment\n    variables).\n    \"\"\"\n    if arch is None:\n        arch = os.environ.get('PROCESSOR_ARCHITEW6432')\n        if not arch:\n            arch = os.environ.get('PROCESSOR_ARCHITECTURE')\n    return SupportedArchitectureMap.get(arch, ArchDefinition('', ['']))\n\n\ndef generate(env):\n    # Attempt to find cmd.exe (for WinNT/2k/XP) or\n    # command.com for Win9x\n    cmd_interp = ''\n    # First see if we can look in the registry...\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            cmd_interp = os.path.join(val, 'System32\\\\cmd.exe')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                              'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n                cmd_interp = os.path.join(val, 'command.com')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n\n    # For the special case of not having access to the registry, we\n    # use a temporary path and pathext to attempt to find the command\n    # interpreter.  If we fail, we try to find the interpreter through\n    # the env's PATH.  The problem with that is that it might not\n    # contain an ENV and a PATH.\n    if not cmd_interp:\n        systemroot = get_system_root()\n        tmp_path = systemroot + os.pathsep + \\\n                   os.path.join(systemroot,'System32')\n        tmp_pathext = '.com;.exe;.bat;.cmd'\n        if 'PATHEXT' in os.environ:\n            tmp_pathext = os.environ['PATHEXT']\n        cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext)\n        if not cmd_interp:\n            cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext)\n\n    if not cmd_interp:\n        cmd_interp = env.Detect('cmd')\n        if not cmd_interp:\n            cmd_interp = env.Detect('command')\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n\n    # Import things from the external environment to the construction\n    # environment's ENV.  This is a potential slippery slope, because we\n    # *don't* want to make builds dependent on the user's environment by\n    # default.  We're doing this for SystemRoot, though, because it's\n    # needed for anything that uses sockets, and seldom changes, and\n    # for SystemDrive because it's related.\n    #\n    # Weigh the impact carefully before adding other variables to this list.\n    import_env = ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]\n    for var in import_env:\n        v = os.environ.get(var)\n        if v:\n            env['ENV'][var] = v\n\n    if 'COMSPEC' not in env['ENV']:\n        v = os.environ.get(\"COMSPEC\")\n        if v:\n            env['ENV']['COMSPEC'] = v\n\n    env.AppendENVPath('PATH', get_system_root() + '\\\\System32')\n\n    env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX' ]\n    env['PSPAWN']         = piped_spawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = cmd_interp\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n    env['ESCAPE']         = escape\n\n    env['HOST_OS']        = 'win32'\n    env['HOST_ARCH']      = get_architecture().arch\n\n    if enable_virtualenv and not ignore_virtualenv:\n        ImportVirtualenv(env)\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/SConf.py",
    "content": "\"\"\"SCons.SConf\n\nAutoconf-like configuration support.\n\nIn other words, SConf allows to run tests on the build machine to detect\ncapabilities of system and do some things based on result: generate config\nfiles, header files for C/C++, update variables in environment.\n\nTests on the build system can detect if compiler sees header files, if\nlibraries are installed, if some command line options are supported etc.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/SConf.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.compat\n\nimport io\nimport os\nimport re\nimport sys\nimport traceback\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node.FS\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Conftest\n\nfrom SCons.Debug import Trace\n\n# Turn off the Conftest error logging\nSCons.Conftest.LogInputFiles = 0\nSCons.Conftest.LogErrorMessages = 0\n\n# Set\nbuild_type = None\nbuild_types = ['clean', 'help']\n\ndef SetBuildType(type):\n    global build_type\n    build_type = type\n\n# to be set, if we are in dry-run mode\ndryrun = 0\n\nAUTO=0  # use SCons dependency scanning for up-to-date checks\nFORCE=1 # force all tests to be rebuilt\nCACHE=2 # force all tests to be taken from cache (raise an error, if necessary)\ncache_mode = AUTO\n\ndef SetCacheMode(mode):\n    \"\"\"Set the Configure cache mode. mode must be one of \"auto\", \"force\",\n    or \"cache\".\"\"\"\n    global cache_mode\n    if mode == \"auto\":\n        cache_mode = AUTO\n    elif mode == \"force\":\n        cache_mode = FORCE\n    elif mode == \"cache\":\n        cache_mode = CACHE\n    else:\n        raise ValueError(\"SCons.SConf.SetCacheMode: Unknown mode \" + mode)\n\nprogress_display = SCons.Util.display # will be overwritten by SCons.Script\ndef SetProgressDisplay(display):\n    \"\"\"Set the progress display to use (called from SCons.Script)\"\"\"\n    global progress_display\n    progress_display = display\n\nSConfFS = None\n\n_ac_build_counter = 0 # incremented, whenever TryBuild is called\n_ac_config_logs = {}  # all config.log files created in this build\n_ac_config_hs   = {}  # all config.h files created in this build\nsconf_global = None   # current sconf object\n\ndef _createConfigH(target, source, env):\n    t = open(str(target[0]), \"w\")\n    defname = re.sub('[^A-Za-z0-9_]', '_', str(target[0]).upper())\n    t.write(\"\"\"#ifndef %(DEFNAME)s_SEEN\n#define %(DEFNAME)s_SEEN\n\n\"\"\" % {'DEFNAME' : defname})\n    t.write(source[0].get_contents().decode())\n    t.write(\"\"\"\n#endif /* %(DEFNAME)s_SEEN */\n\"\"\" % {'DEFNAME' : defname})\n    t.close()\n\ndef _stringConfigH(target, source, env):\n    return \"scons: Configure: creating \" + str(target[0])\n\n\ndef NeedConfigHBuilder():\n    if len(_ac_config_hs) == 0:\n       return False\n    else:\n       return True\n\ndef CreateConfigHBuilder(env):\n    \"\"\"Called if necessary just before the building targets phase begins.\"\"\"\n    action = SCons.Action.Action(_createConfigH,\n                                 _stringConfigH)\n    sconfigHBld = SCons.Builder.Builder(action=action)\n    env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )\n    for k in list(_ac_config_hs.keys()):\n        env.SConfigHBuilder(k, env.Value(_ac_config_hs[k]))\n\n\nclass SConfWarning(SCons.Warnings.Warning):\n    pass\nSCons.Warnings.enableWarningClass(SConfWarning)\n\n# some error definitions\nclass SConfError(SCons.Errors.UserError):\n    def __init__(self,msg):\n        SCons.Errors.UserError.__init__(self,msg)\n\nclass ConfigureDryRunError(SConfError):\n    \"\"\"Raised when a file or directory needs to be updated during a Configure\n    process, but the user requested a dry-run\"\"\"\n    def __init__(self,target):\n        if not isinstance(target, SCons.Node.FS.File):\n            msg = 'Cannot create configure directory \"%s\" within a dry-run.' % str(target)\n        else:\n            msg = 'Cannot update configure test \"%s\" within a dry-run.' % str(target)\n        SConfError.__init__(self,msg)\n\nclass ConfigureCacheError(SConfError):\n    \"\"\"Raised when a use explicitely requested the cache feature, but the test\n    is run the first time.\"\"\"\n    def __init__(self,target):\n        SConfError.__init__(self, '\"%s\" is not yet built and cache is forced.' % str(target))\n\n# define actions for building text files\ndef _createSource( target, source, env ):\n    fd = open(str(target[0]), \"w\")\n    fd.write(source[0].get_contents().decode())\n    fd.close()\ndef _stringSource( target, source, env ):\n    return (str(target[0]) + ' <-\\n  |' +\n            source[0].get_contents().decode().replace( '\\n', \"\\n  |\" ) )\n\nclass SConfBuildInfo(SCons.Node.FS.FileBuildInfo):\n    \"\"\"\n    Special build info for targets of configure tests. Additional members\n    are result (did the builder succeed last time?) and string, which\n    contains messages of the original build phase.\n    \"\"\"\n    __slots__ = ('result', 'string')\n\n    def __init__(self):\n        self.result = None # -> 0/None -> no error, != 0 error\n        self.string = None # the stdout / stderr output when building the target\n\n    def set_build_result(self, result, string):\n        self.result = result\n        self.string = string\n\n\nclass Streamer(object):\n    \"\"\"\n    'Sniffer' for a file-like writable object. Similar to the unix tool tee.\n    \"\"\"\n    def __init__(self, orig):\n        self.orig = orig\n        self.s = io.StringIO()\n\n    def write(self, str):\n        if self.orig:\n            self.orig.write(str)\n        try:\n            self.s.write(str)\n        except TypeError as e:\n            # \"unicode argument expected\" bug in IOStream (python 2.x)\n            self.s.write(str.decode())\n\n    def writelines(self, lines):\n        for l in lines:\n            self.write(l + '\\n')\n\n    def getvalue(self):\n        \"\"\"\n        Return everything written to orig since the Streamer was created.\n        \"\"\"\n        return self.s.getvalue()\n\n    def flush(self):\n        if self.orig:\n            self.orig.flush()\n        self.s.flush()\n\n\nclass SConfBuildTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"\n    This is almost the same as SCons.Script.BuildTask. Handles SConfErrors\n    correctly and knows about the current cache_mode.\n    \"\"\"\n    def display(self, message):\n        if sconf_global.logstream:\n            sconf_global.logstream.write(\"scons: Configure: \" + message + \"\\n\")\n\n    def display_cached_string(self, bi):\n        \"\"\"\n        Logs the original builder messages, given the SConfBuildInfo instance\n        bi.\n        \"\"\"\n        if not isinstance(bi, SConfBuildInfo):\n            SCons.Warnings.warn(SConfWarning,\n              \"The stored build information has an unexpected class: %s\" % bi.__class__)\n        else:\n            self.display(\"The original builder output was:\\n\" +\n                         (\"  |\" + str(bi.string)).replace(\"\\n\", \"\\n  |\"))\n\n    def failed(self):\n        # check, if the reason was a ConfigureDryRunError or a\n        # ConfigureCacheError and if yes, reraise the exception\n        exc_type = self.exc_info()[0]\n        if issubclass(exc_type, SConfError):\n            # TODO pylint E0704: bare raise not inside except\n            raise\n        elif issubclass(exc_type, SCons.Errors.BuildError):\n            # we ignore Build Errors (occurs, when a test doesn't pass)\n            # Clear the exception to prevent the contained traceback\n            # to build a reference cycle.\n            self.exc_clear()\n        else:\n            self.display('Caught exception while building \"%s\":\\n' %\n                         self.targets[0])\n            sys.excepthook(*self.exc_info())\n        return SCons.Taskmaster.Task.failed(self)\n\n    def collect_node_states(self):\n        # returns (is_up_to_date, cached_error, cachable)\n        # where is_up_to_date is 1, if the node(s) are up_to_date\n        #       cached_error  is 1, if the node(s) are up_to_date, but the\n        #                           build will fail\n        #       cachable      is 0, if some nodes are not in our cache\n        T = 0\n        changed = False\n        cached_error = False\n        cachable = True\n        for t in self.targets:\n            if T: Trace('%s' % (t))\n            bi = t.get_stored_info().binfo\n            if isinstance(bi, SConfBuildInfo):\n                if T: Trace(': SConfBuildInfo')\n                if cache_mode == CACHE:\n                    t.set_state(SCons.Node.up_to_date)\n                    if T: Trace(': set_state(up_to-date)')\n                else:\n                    if T: Trace(': get_state() %s' % t.get_state())\n                    if T: Trace(': changed() %s' % t.changed())\n                    if (t.get_state() != SCons.Node.up_to_date and t.changed()):\n                        changed = True\n                    if T: Trace(': changed %s' % changed)\n                cached_error = cached_error or bi.result\n            else:\n                if T: Trace(': else')\n                # the node hasn't been built in a SConf context or doesn't\n                # exist\n                cachable = False\n                changed = ( t.get_state() != SCons.Node.up_to_date )\n                if T: Trace(': changed %s' % changed)\n        if T: Trace('\\n')\n        return (not changed, cached_error, cachable)\n\n    def execute(self):\n        if not self.targets[0].has_builder():\n            return\n\n        sconf = sconf_global\n\n        is_up_to_date, cached_error, cachable = self.collect_node_states()\n\n        if cache_mode == CACHE and not cachable:\n            raise ConfigureCacheError(self.targets[0])\n        elif cache_mode == FORCE:\n            is_up_to_date = 0\n\n        if cached_error and is_up_to_date:\n            self.display(\"Building \\\"%s\\\" failed in a previous run and all \"\n                         \"its sources are up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n            raise SCons.Errors.BuildError # will be 'caught' in self.failed\n        elif is_up_to_date:\n            self.display(\"\\\"%s\\\" is up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n        elif dryrun:\n            raise ConfigureDryRunError(self.targets[0])\n        else:\n            # note stdout and stderr are the same here\n            s = sys.stdout = sys.stderr = Streamer(sys.stdout)\n            try:\n                env = self.targets[0].get_build_env()\n                env['PSTDOUT'] = env['PSTDERR'] = s\n                try:\n                    sconf.cached = 0\n                    self.targets[0].build()\n                finally:\n                    sys.stdout = sys.stderr = env['PSTDOUT'] = \\\n                                 env['PSTDERR'] = sconf.logstream\n            except KeyboardInterrupt:\n                raise\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code)\n            except Exception as e:\n                for t in self.targets:\n                    binfo = SConfBuildInfo()\n                    binfo.merge(t.get_binfo())\n                    binfo.set_build_result(1, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n                raise e\n            else:\n                for t in self.targets:\n                    binfo = SConfBuildInfo()\n                    binfo.merge(t.get_binfo())\n                    binfo.set_build_result(0, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n\nclass SConfBase(object):\n    \"\"\"This is simply a class to represent a configure context. After\n    creating a SConf object, you can call any tests. After finished with your\n    tests, be sure to call the Finish() method, which returns the modified\n    environment.\n    Some words about caching: In most cases, it is not necessary to cache\n    Test results explicitly. Instead, we use the scons dependency checking\n    mechanism. For example, if one wants to compile a test program\n    (SConf.TryLink), the compiler is only called, if the program dependencies\n    have changed. However, if the program could not be compiled in a former\n    SConf run, we need to explicitly cache this error.\n    \"\"\"\n\n    def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR',\n                 log_file='$CONFIGURELOG', config_h = None, _depth = 0):\n        \"\"\"Constructor. Pass additional tests in the custom_tests-dictionary,\n        e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest\n        defines a custom test.\n        Note also the conf_dir and log_file arguments (you may want to\n        build tests in the VariantDir, not in the SourceDir)\n        \"\"\"\n        global SConfFS\n\n        # Now create isolated override so setting source_decider doesn't affect parent Environment\n        if cache_mode == FORCE:\n            self.original_env = env\n            self.env = env.Clone()\n\n            # Set up the Decider() to force rebuilds by saying\n            # that every source has changed.  Note that we still\n            # call the environment's underlying source decider so\n            # that the correct .sconsign info will get calculated\n            # and keep the build state consistent.\n            def force_build(dependency, target, prev_ni,\n                            repo_node=None,\n                            env_decider=env.decide_source):\n                try:\n                    env_decider(dependency, target, prev_ni, repo_node)\n                except Exception as e:\n                    raise e\n                return True\n\n            if self.env.decide_source.__code__ is not force_build.__code__:\n                self.env.Decider(force_build)\n\n        else:\n            self.env = env\n\n        # print(\"Override env:%s\"%env)\n\n        if not SConfFS:\n            SConfFS = SCons.Node.FS.default_fs or \\\n                      SCons.Node.FS.FS(env.fs.pathTop)\n        if sconf_global is not None:\n            raise SCons.Errors.UserError\n\n        if log_file is not None:\n            log_file = SConfFS.File(env.subst(log_file))\n        self.logfile = log_file\n        self.logstream = None\n        self.lastTarget = None\n        self.depth = _depth\n        self.cached = 0 # will be set, if all test results are cached\n\n        # add default tests\n        default_tests = {\n                 'CheckCC'            : CheckCC,\n                 'CheckCXX'           : CheckCXX,\n                 'CheckSHCC'          : CheckSHCC,\n                 'CheckSHCXX'         : CheckSHCXX,\n                 'CheckFunc'          : CheckFunc,\n                 'CheckType'          : CheckType,\n                 'CheckTypeSize'      : CheckTypeSize,\n                 'CheckDeclaration'   : CheckDeclaration,\n                 'CheckHeader'        : CheckHeader,\n                 'CheckCHeader'       : CheckCHeader,\n                 'CheckCXXHeader'     : CheckCXXHeader,\n                 'CheckLib'           : CheckLib,\n                 'CheckLibWithHeader' : CheckLibWithHeader,\n                 'CheckProg'          : CheckProg,\n               }\n        self.AddTests(default_tests)\n        self.AddTests(custom_tests)\n        self.confdir = SConfFS.Dir(env.subst(conf_dir))\n        if config_h is not None:\n            config_h = SConfFS.File(config_h)\n        self.config_h = config_h\n        self._startup()\n\n    def Finish(self):\n        \"\"\"Call this method after finished with your tests:\n                env = sconf.Finish()\n        \"\"\"\n        self._shutdown()\n\n        return self.env\n\n    def Define(self, name, value = None, comment = None):\n        \"\"\"\n        Define a pre processor symbol name, with the optional given value in the\n        current config header.\n\n        If value is None (default), then #define name is written. If value is not\n        none, then #define name value is written.\n\n        comment is a string which will be put as a C comment in the header, to explain the meaning of the value\n        (appropriate C comments will be added automatically).\n        \"\"\"\n        lines = []\n        if comment:\n            comment_str = \"/* %s */\" % comment\n            lines.append(comment_str)\n\n        if value is not None:\n            define_str = \"#define %s %s\" % (name, value)\n        else:\n            define_str = \"#define %s\" % name\n        lines.append(define_str)\n        lines.append('')\n\n        self.config_h_text = self.config_h_text + '\\n'.join(lines)\n\n    def BuildNodes(self, nodes):\n        \"\"\"\n        Tries to build the given nodes immediately. Returns 1 on success,\n        0 on error.\n        \"\"\"\n        if self.logstream is not None:\n            # override stdout / stderr to write in log file\n            oldStdout = sys.stdout\n            sys.stdout = self.logstream\n            oldStderr = sys.stderr\n            sys.stderr = self.logstream\n\n        # the engine assumes the current path is the SConstruct directory ...\n        old_fs_dir = SConfFS.getcwd()\n        old_os_dir = os.getcwd()\n        SConfFS.chdir(SConfFS.Top, change_os_dir=1)\n\n        # Because we take responsibility here for writing out our\n        # own .sconsign info (see SConfBuildTask.execute(), above),\n        # we override the store_info() method with a null place-holder\n        # so we really control how it gets written.\n        for n in nodes:\n            n.store_info = 0\n            if not hasattr(n, 'attributes'):\n                n.attributes = SCons.Node.Node.Attrs()\n            n.attributes.keep_targetinfo = 1\n\n            if True:\n                # Some checkers have intermediate files (for example anything that compiles a c file into a program to run\n                # Those files need to be set to not release their target info, otherwise taskmaster will throw a\n                # Nonetype not callable\n                for c in n.children(scan=False):\n                    # Keep debug code here.\n                    # print(\"Checking [%s] for builders and then setting keep_targetinfo\"%c)\n                    if  c.has_builder():\n                        n.store_info = 0\n                        if not hasattr(c, 'attributes'):\n                            c.attributes = SCons.Node.Node.Attrs()\n                        c.attributes.keep_targetinfo = 1\n                    # pass\n\n        ret = 1\n\n        try:\n            # ToDo: use user options for calc\n            save_max_drift = SConfFS.get_max_drift()\n            SConfFS.set_max_drift(0)\n            tm = SCons.Taskmaster.Taskmaster(nodes, SConfBuildTask)\n            # we don't want to build tests in parallel\n            jobs = SCons.Job.Jobs(1, tm )\n            jobs.run()\n            for n in nodes:\n                state = n.get_state()\n                if (state != SCons.Node.executed and\n                    state != SCons.Node.up_to_date):\n                    # the node could not be built. we return 0 in this case\n                    ret = 0\n        finally:\n            SConfFS.set_max_drift(save_max_drift)\n            os.chdir(old_os_dir)\n            SConfFS.chdir(old_fs_dir, change_os_dir=0)\n            if self.logstream is not None:\n                # restore stdout / stderr\n                sys.stdout = oldStdout\n                sys.stderr = oldStderr\n        return ret\n\n    def pspawn_wrapper(self, sh, escape, cmd, args, env):\n        \"\"\"Wrapper function for handling piped spawns.\n\n        This looks to the calling interface (in Action.py) like a \"normal\"\n        spawn, but associates the call with the PSPAWN variable from\n        the construction environment and with the streams to which we\n        want the output logged.  This gets slid into the construction\n        environment as the SPAWN variable so Action.py doesn't have to\n        know or care whether it's spawning a piped command or not.\n        \"\"\"\n        return self.pspawn(sh, escape, cmd, args, env, self.logstream, self.logstream)\n\n\n    def TryBuild(self, builder, text = None, extension = \"\"):\n        \"\"\"Low level TryBuild implementation. Normally you don't need to\n        call that - you can use TryCompile / TryLink / TryRun instead\n        \"\"\"\n        global _ac_build_counter\n\n        # Make sure we have a PSPAWN value, and save the current\n        # SPAWN value.\n        try:\n            self.pspawn = self.env['PSPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing PSPAWN construction variable.')\n        try:\n            save_spawn = self.env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n\n        nodesToBeBuilt = []\n\n        f = \"conftest_\" + str(_ac_build_counter)\n        pref = self.env.subst( builder.builder.prefix )\n        suff = self.env.subst( builder.builder.suffix )\n        target = self.confdir.File(pref + f + suff)\n\n        try:\n            # Slide our wrapper into the construction environment as\n            # the SPAWN function.\n            self.env['SPAWN'] = self.pspawn_wrapper\n            sourcetext = self.env.Value(text)\n\n            if text is not None:\n                textFile = self.confdir.File(f + extension)\n                textFileNode = self.env.SConfSourceBuilder(target=textFile,\n                                                           source=sourcetext)\n                nodesToBeBuilt.extend(textFileNode)\n                source = textFileNode\n            else:\n                source = None\n\n            nodes = builder(target = target, source = source)\n            if not SCons.Util.is_List(nodes):\n                nodes = [nodes]\n            nodesToBeBuilt.extend(nodes)\n            result = self.BuildNodes(nodesToBeBuilt)\n\n        finally:\n            self.env['SPAWN'] = save_spawn\n\n        _ac_build_counter = _ac_build_counter + 1\n        if result:\n            self.lastTarget = nodes[0]\n        else:\n            self.lastTarget = None\n\n        return result\n\n    def TryAction(self, action, text = None, extension = \"\"):\n        \"\"\"Tries to execute the given action with optional source file\n        contents <text> and optional source file extension <extension>,\n        Returns the status (0 : failed, 1 : ok) and the contents of the\n        output file.\n        \"\"\"\n        builder = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS = {'SConfActionBuilder' : builder} )\n        ok = self.TryBuild(self.env.SConfActionBuilder, text, extension)\n        del self.env['BUILDERS']['SConfActionBuilder']\n        if ok:\n            outputStr = self.lastTarget.get_text_contents()\n            return (1, outputStr)\n        return (0, \"\")\n\n    def TryCompile( self, text, extension):\n        \"\"\"Compiles the program given in text to an env.Object, using extension\n        as file extension (e.g. '.c'). Returns 1, if compilation was\n        successful, 0 otherwise. The target is saved in self.lastTarget (for\n        further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Object, text, extension)\n\n    def TryLink( self, text, extension ):\n        \"\"\"Compiles the program given in text to an executable env.Program,\n        using extension as file extension (e.g. '.c'). Returns 1, if\n        compilation was successful, 0 otherwise. The target is saved in\n        self.lastTarget (for further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Program, text, extension )\n\n    def TryRun(self, text, extension ):\n        \"\"\"Compiles and runs the program given in text, using extension\n        as file extension (e.g. '.c'). Returns (1, outputStr) on success,\n        (0, '') otherwise. The target (a file containing the program's stdout)\n        is saved in self.lastTarget (for further processing).\n        \"\"\"\n        ok = self.TryLink(text, extension)\n        if( ok ):\n            prog = self.lastTarget\n            pname = prog.get_internal_path()\n            output = self.confdir.File(os.path.basename(pname)+'.out')\n            node = self.env.Command(output, prog, [ [ pname, \">\", \"${TARGET}\"] ])\n            ok = self.BuildNodes(node)\n            if ok:\n                outputStr = SCons.Util.to_str(output.get_contents())\n                return( 1, outputStr)\n        return (0, \"\")\n\n    class TestWrapper(object):\n        \"\"\"A wrapper around Tests (to ensure sanity)\"\"\"\n        def __init__(self, test, sconf):\n            self.test = test\n            self.sconf = sconf\n        def __call__(self, *args, **kw):\n            if not self.sconf.active:\n                raise SCons.Errors.UserError\n            context = CheckContext(self.sconf)\n            ret = self.test(context, *args, **kw)\n            if self.sconf.config_h is not None:\n                self.sconf.config_h_text = self.sconf.config_h_text + context.config_h\n            context.Result(\"error: no result\")\n            return ret\n\n    def AddTest(self, test_name, test_instance):\n        \"\"\"Adds test_class to this SConf instance. It can be called with\n        self.test_name(...)\"\"\"\n        setattr(self, test_name, SConfBase.TestWrapper(test_instance, self))\n\n    def AddTests(self, tests):\n        \"\"\"Adds all the tests given in the tests dictionary to this SConf\n        instance\n        \"\"\"\n        for name in list(tests.keys()):\n            self.AddTest(name, tests[name])\n\n    def _createDir( self, node ):\n        dirName = str(node)\n        if dryrun:\n            if not os.path.isdir( dirName ):\n                raise ConfigureDryRunError(dirName)\n        else:\n            if not os.path.isdir( dirName ):\n                os.makedirs( dirName )\n\n    def _startup(self):\n        \"\"\"Private method. Set up logstream, and set the environment\n        variables necessary for a piped build\n        \"\"\"\n        global _ac_config_logs\n        global sconf_global\n        global SConfFS\n\n        self.lastEnvFs = self.env.fs\n        self.env.fs = SConfFS\n        self._createDir(self.confdir)\n        self.confdir.up().add_ignore( [self.confdir] )\n\n        if self.logfile is not None and not dryrun:\n            # truncate logfile, if SConf.Configure is called for the first time\n            # in a build\n            if self.logfile in _ac_config_logs:\n                log_mode = \"a\"\n            else:\n                _ac_config_logs[self.logfile] = None\n                log_mode = \"w\"\n            fp = open(str(self.logfile), log_mode)\n            self.logstream = SCons.Util.Unbuffered(fp)\n            # logfile may stay in a build directory, so we tell\n            # the build system not to override it with a eventually\n            # existing file with the same name in the source directory\n            self.logfile.dir.add_ignore( [self.logfile] )\n\n            tb = traceback.extract_stack()[-3-self.depth]\n            old_fs_dir = SConfFS.getcwd()\n            SConfFS.chdir(SConfFS.Top, change_os_dir=0)\n            self.logstream.write('file %s,line %d:\\n\\tConfigure(confdir = %s)\\n' %\n                                 (tb[0], tb[1], str(self.confdir)) )\n            SConfFS.chdir(old_fs_dir)\n        else:\n            self.logstream = None\n        # we use a special builder to create source files from TEXT\n        action = SCons.Action.Action(_createSource,\n                                     _stringSource)\n        sconfSrcBld = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS={'SConfSourceBuilder':sconfSrcBld} )\n        self.config_h_text = _ac_config_hs.get(self.config_h, \"\")\n        self.active = 1\n        # only one SConf instance should be active at a time ...\n        sconf_global = self\n\n    def _shutdown(self):\n        \"\"\"Private method. Reset to non-piped spawn\"\"\"\n        global sconf_global, _ac_config_hs\n\n        if not self.active:\n            raise SCons.Errors.UserError(\"Finish may be called only once!\")\n        if self.logstream is not None and not dryrun:\n            self.logstream.write(\"\\n\")\n            self.logstream.close()\n            self.logstream = None\n\n        # Now reset the decider if we changed it due to --config=force\n        # We saved original Environment passed in and cloned it to isolate\n        # it from being changed.\n        if cache_mode == FORCE:\n            self.env.Decider(self.original_env.decide_source)\n\n            # remove the SConfSourceBuilder from the environment\n            blds = self.env['BUILDERS']\n            del blds['SConfSourceBuilder']\n            self.env.Replace( BUILDERS=blds )\n\n        self.active = 0\n        sconf_global = None\n        if self.config_h is not None:\n            _ac_config_hs[self.config_h] = self.config_h_text\n        self.env.fs = self.lastEnvFs\n\nclass CheckContext(object):\n    \"\"\"Provides a context for configure tests. Defines how a test writes to the\n    screen and log file.\n\n    A typical test is just a callable with an instance of CheckContext as\n    first argument:\n\n        def CheckCustom(context, ...):\n            context.Message('Checking my weird test ... ')\n            ret = myWeirdTestFunction(...)\n            context.Result(ret)\n\n    Often, myWeirdTestFunction will be one of\n    context.TryCompile/context.TryLink/context.TryRun. The results of\n    those are cached, for they are only rebuild, if the dependencies have\n    changed.\n    \"\"\"\n\n    def __init__(self, sconf):\n        \"\"\"Constructor. Pass the corresponding SConf instance.\"\"\"\n        self.sconf = sconf\n        self.did_show_result = 0\n\n        # for Conftest.py:\n        self.vardict = {}\n        self.havedict = {}\n        self.headerfilename = None\n        self.config_h = \"\" # config_h text will be stored here\n        # we don't regenerate the config.h file after each test. That means,\n        # that tests won't be able to include the config.h file, and so\n        # they can't do an #ifdef HAVE_XXX_H. This shouldn't be a major\n        # issue, though. If it turns out, that we need to include config.h\n        # in tests, we must ensure, that the dependencies are worked out\n        # correctly. Note that we can't use Conftest.py's support for config.h,\n        # cause we will need to specify a builder for the config.h file ...\n\n    def Message(self, text):\n        \"\"\"Inform about what we are doing right now, e.g.\n        'Checking for SOMETHING ... '\n        \"\"\"\n        self.Display(text)\n        self.sconf.cached = 1\n        self.did_show_result = 0\n\n    def Result(self, res):\n        \"\"\"Inform about the result of the test. If res is not a string, displays\n        'yes' or 'no' depending on whether res is evaluated as true or false.\n        The result is only displayed when self.did_show_result is not set.\n        \"\"\"\n        if isinstance(res, str):\n            text = res\n        elif res:\n            text = \"yes\"\n        else:\n            text = \"no\"\n\n        if self.did_show_result == 0:\n            # Didn't show result yet, do it now.\n            self.Display(text + \"\\n\")\n            self.did_show_result = 1\n\n    def TryBuild(self, *args, **kw):\n        return self.sconf.TryBuild(*args, **kw)\n\n    def TryAction(self, *args, **kw):\n        return self.sconf.TryAction(*args, **kw)\n\n    def TryCompile(self, *args, **kw):\n        return self.sconf.TryCompile(*args, **kw)\n\n    def TryLink(self, *args, **kw):\n        return self.sconf.TryLink(*args, **kw)\n\n    def TryRun(self, *args, **kw):\n        return self.sconf.TryRun(*args, **kw)\n\n    def __getattr__( self, attr ):\n        if( attr == 'env' ):\n            return self.sconf.env\n        elif( attr == 'lastTarget' ):\n            return self.sconf.lastTarget\n        else:\n            raise AttributeError(\"CheckContext instance has no attribute '%s'\" % attr)\n\n    #### Stuff used by Conftest.py (look there for explanations).\n\n    def BuildProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Program, text, ext)\n\n    def CompileProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Object, text, ext)\n\n    def CompileSharedObject(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $SHCC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.SharedObject, text, ext)\n\n    def RunProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        st, out = self.TryRun(text, ext)\n        return not st, out\n\n    def AppendLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Append(LIBS = lib_name_list)\n        return oldLIBS\n\n    def PrependLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Prepend(LIBS = lib_name_list)\n        return oldLIBS\n\n    def SetLIBS(self, val):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Replace(LIBS = val)\n        return oldLIBS\n\n    def Display(self, msg):\n        if self.sconf.cached:\n            # We assume that Display is called twice for each test here\n            # once for the Checking for ... message and once for the result.\n            # The self.sconf.cached flag can only be set between those calls\n            msg = \"(cached) \" + msg\n            self.sconf.cached = 0\n        progress_display(msg, append_newline=0)\n        self.Log(\"scons: Configure: \" + msg + \"\\n\")\n\n    def Log(self, msg):\n        if self.sconf.logstream is not None:\n            self.sconf.logstream.write(msg)\n\n    #### End of stuff used by Conftest.py.\n\n\ndef SConf(*args, **kw):\n    if kw.get(build_type, True):\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        for bt in build_types:\n            try:\n                del kw[bt]\n            except KeyError:\n                pass\n        return SConfBase(*args, **kw)\n    else:\n        return SCons.Util.Null()\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    res = SCons.Conftest.CheckFunc(context, function_name, header = header, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckType(context, type_name, includes = \"\", language = None):\n    res = SCons.Conftest.CheckType(context, type_name,\n                                   header = includes, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckTypeSize(context, type_name, includes = \"\", language = None, expect = None):\n    res = SCons.Conftest.CheckTypeSize(context, type_name,\n                                       header = includes, language = language,\n                                       expect = expect)\n    context.did_show_result = 1\n    return res\n\ndef CheckDeclaration(context, declaration, includes = \"\", language = None):\n    res = SCons.Conftest.CheckDeclaration(context, declaration,\n                                          includes = includes,\n                                          language = language)\n    context.did_show_result = 1\n    return not res\n\ndef createIncludesFromHeaders(headers, leaveLast, include_quotes = '\"\"'):\n    # used by CheckHeader and CheckLibWithHeader to produce C - #include\n    # statements from the specified header (list)\n    if not SCons.Util.is_List(headers):\n        headers = [headers]\n    l = []\n    if leaveLast:\n        lastHeader = headers[-1]\n        headers = headers[:-1]\n    else:\n        lastHeader = None\n    for s in headers:\n        l.append(\"#include %s%s%s\\n\"\n                 % (include_quotes[0], s, include_quotes[1]))\n    return ''.join(l), lastHeader\n\ndef CheckHeader(context, header, include_quotes = '<>', language = None):\n    \"\"\"\n    A test for a C or C++ header file.\n    \"\"\"\n    prog_prefix, hdr_to_check = \\\n                 createIncludesFromHeaders(header, 1, include_quotes)\n    res = SCons.Conftest.CheckHeader(context, hdr_to_check, prog_prefix,\n                                     language = language,\n                                     include_quotes = include_quotes)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCC(context):\n    res = SCons.Conftest.CheckCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCXX(context):\n    res = SCons.Conftest.CheckCXX(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCC(context):\n    res = SCons.Conftest.CheckSHCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCXX(context):\n    res = SCons.Conftest.CheckSHCXX(context)\n    context.did_show_result = 1\n    return not res\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C\")\n\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCXXHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C++ header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C++\")\n\n\ndef CheckLib(context, library = None, symbol = \"main\",\n             header = None, language = None, autoadd = 1):\n    \"\"\"\n    A test for a library. See also CheckLibWithHeader.\n    Note that library may also be None to test whether the given symbol\n    compiles without flags.\n    \"\"\"\n\n    if not library:\n        library = [None]\n\n    if not SCons.Util.is_List(library):\n        library = [library]\n\n    # ToDo: accept path for the library\n    res = SCons.Conftest.CheckLib(context, library, symbol, header = header,\n                                        language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\n# XXX\n# Bram: Can only include one header and can't use #ifdef HAVE_HEADER_H.\n\ndef CheckLibWithHeader(context, libs, header, language,\n                       call = None, autoadd = 1):\n    # ToDo: accept path for library. Support system header files.\n    \"\"\"\n    Another (more sophisticated) test for a library.\n    Checks, if library and header is available for language (may be 'C'\n    or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'.\n    As in CheckLib, we support library=None, to test if the call compiles\n    without extra link flags.\n    \"\"\"\n    prog_prefix, dummy = \\\n                 createIncludesFromHeaders(header, 0)\n    if libs == []:\n        libs = [None]\n\n    if not SCons.Util.is_List(libs):\n        libs = [libs]\n\n    res = SCons.Conftest.CheckLib(context, libs, None, prog_prefix,\n            call = call, language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\ndef CheckProg(context, prog_name):\n    \"\"\"Simple check if a program exists in the path.  Returns the path\n    for the application, or None if not found.\n    \"\"\"\n    res = SCons.Conftest.CheckProg(context, prog_name)\n    context.did_show_result = 1\n    return res\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/SConsign.py",
    "content": "\"\"\"SCons.SConsign\n\nWriting and reading information to the .sconsign file or files.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/SConsign.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.compat\n\nimport os\nimport pickle\n\nimport SCons.dblite\nimport SCons.Warnings\n\nfrom SCons.compat import PICKLE_PROTOCOL\n\n\ndef corrupt_dblite_warning(filename):\n    SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                        \"Ignoring corrupt .sconsign file: %s\"%filename)\n\nSCons.dblite.ignore_corrupt_dbfiles = 1\nSCons.dblite.corruption_warning = corrupt_dblite_warning\n\n# XXX Get rid of the global array so this becomes re-entrant.\nsig_files = []\n\n# Info for the database SConsign implementation (now the default):\n# \"DataBase\" is a dictionary that maps top-level SConstruct directories\n# to open database handles.\n# \"DB_Module\" is the Python database module to create the handles.\n# \"DB_Name\" is the base name of the database file (minus any\n# extension the underlying DB module will add).\nDataBase = {}\nDB_Module = SCons.dblite\nDB_Name = \".sconsign\"\nDB_sync_list = []\n\n\ndef Get_DataBase(dir):\n    global DataBase, DB_Module, DB_Name\n    top = dir.fs.Top\n    if not os.path.isabs(DB_Name) and top.repositories:\n        mode = \"c\"\n        for d in [top] + top.repositories:\n            if dir.is_under(d):\n                try:\n                    return DataBase[d], mode\n                except KeyError:\n                    path = d.entry_abspath(DB_Name)\n                    try: db = DataBase[d] = DB_Module.open(path, mode)\n                    except (IOError, OSError):\n                        pass\n                    else:\n                        if mode != \"r\":\n                            DB_sync_list.append(db)\n                        return db, mode\n            mode = \"r\"\n    try:\n        return DataBase[top], \"c\"\n    except KeyError:\n        db = DataBase[top] = DB_Module.open(DB_Name, \"c\")\n        DB_sync_list.append(db)\n        return db, \"c\"\n    except TypeError:\n        print(\"DataBase =\", DataBase)\n        raise\n\n\ndef Reset():\n    \"\"\"Reset global state.  Used by unit tests that end up using\n    SConsign multiple times to get a clean slate for each test.\"\"\"\n    global sig_files, DB_sync_list\n    sig_files = []\n    DB_sync_list = []\n\nnormcase = os.path.normcase\n\n\ndef write():\n    global sig_files\n    for sig_file in sig_files:\n        sig_file.write(sync=0)\n    for db in DB_sync_list:\n        try:\n            syncmethod = db.sync\n        except AttributeError:\n            pass # Not all dbm modules have sync() methods.\n        else:\n            syncmethod()\n        try:\n            closemethod = db.close\n        except AttributeError:\n            pass # Not all dbm modules have close() methods.\n        else:\n            closemethod()\n\n\nclass SConsignEntry(object):\n    \"\"\"\n    Wrapper class for the generic entry in a .sconsign file.\n    The Node subclass populates it with attributes as it pleases.\n\n    XXX As coded below, we do expect a '.binfo' attribute to be added,\n    but we'll probably generalize this in the next refactorings.\n    \"\"\"\n    __slots__ = (\"binfo\", \"ninfo\", \"__weakref__\")\n    current_version_id = 2\n\n    def __init__(self):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        #_version_id = self.current_version_id\n        pass\n\n    def convert_to_sconsign(self):\n        self.binfo.convert_to_sconsign()\n\n    def convert_from_sconsign(self, dir, name):\n        self.binfo.convert_from_sconsign(dir, name)\n\n    def __getstate__(self):\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        for key, value in state.items():\n            if key not in ('_version_id','__weakref__'):\n                setattr(self, key, value)\n\n\nclass Base(object):\n    \"\"\"\n    This is the controlling class for the signatures for the collection of\n    entries associated with a specific directory.  The actual directory\n    association will be maintained by a subclass that is specific to\n    the underlying storage method.  This class provides a common set of\n    methods for fetching and storing the individual bits of information\n    that make up signature entry.\n    \"\"\"\n    def __init__(self):\n        self.entries = {}\n        self.dirty = False\n        self.to_be_merged = {}\n\n    def get_entry(self, filename):\n        \"\"\"\n        Fetch the specified entry attribute.\n        \"\"\"\n        return self.entries[filename]\n\n    def set_entry(self, filename, obj):\n        \"\"\"\n        Set the entry.\n        \"\"\"\n        self.entries[filename] = obj\n        self.dirty = True\n\n    def do_not_set_entry(self, filename, obj):\n        pass\n\n    def store_info(self, filename, node):\n        entry = node.get_stored_info()\n        entry.binfo.merge(node.get_binfo())\n        self.to_be_merged[filename] = node\n        self.dirty = True\n\n    def do_not_store_info(self, filename, node):\n        pass\n\n    def merge(self):\n        for key, node in self.to_be_merged.items():\n            entry = node.get_stored_info()\n            try:\n                ninfo = entry.ninfo\n            except AttributeError:\n                # This happens with SConf Nodes, because the configuration\n                # subsystem takes direct control over how the build decision\n                # is made and its information stored.\n                pass\n            else:\n                ninfo.merge(node.get_ninfo())\n            self.entries[key] = entry\n        self.to_be_merged = {}\n\n\nclass DB(Base):\n    \"\"\"\n    A Base subclass that reads and writes signature information\n    from a global .sconsign.db* file--the actual file suffix is\n    determined by the database module.\n    \"\"\"\n    def __init__(self, dir):\n        Base.__init__(self)\n\n        self.dir = dir\n\n        db, mode = Get_DataBase(dir)\n\n        # Read using the path relative to the top of the Repository\n        # (self.dir.tpath) from which we're fetching the signature\n        # information.\n        path = normcase(dir.get_tpath())\n        try:\n            rawentries = db[path]\n        except KeyError:\n            pass\n        else:\n            try:\n                self.entries = pickle.loads(rawentries)\n                if not isinstance(self.entries, dict):\n                    self.entries = {}\n                    raise TypeError\n            except KeyboardInterrupt:\n                raise\n            except Exception as e:\n                SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                    \"Ignoring corrupt sconsign entry : %s (%s)\\n\"%(self.dir.get_tpath(), e))\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\n        if mode == \"r\":\n            # This directory is actually under a repository, which means\n            # likely they're reaching in directly for a dependency on\n            # a file there.  Don't actually set any entry info, so we\n            # won't try to write to that .sconsign.dblite file.\n            self.set_entry = self.do_not_set_entry\n            self.store_info = self.do_not_store_info\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        db, mode = Get_DataBase(self.dir)\n\n        # Write using the path relative to the top of the SConstruct\n        # directory (self.dir.path), not relative to the top of\n        # the Repository; we only write to our own .sconsign file,\n        # not to .sconsign files in Repositories.\n        path = normcase(self.dir.get_internal_path())\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        db[path] = pickle.dumps(self.entries, PICKLE_PROTOCOL)\n\n        if sync:\n            try:\n                syncmethod = db.sync\n            except AttributeError:\n                # Not all anydbm modules have sync() methods.\n                pass\n            else:\n                syncmethod()\n\n\nclass Dir(Base):\n    def __init__(self, fp=None, dir=None):\n        \"\"\"\n        fp - file pointer to read entries from\n        \"\"\"\n        Base.__init__(self)\n\n        if not fp:\n            return\n\n        self.entries = pickle.load(fp)\n        if not isinstance(self.entries, dict):\n            self.entries = {}\n            raise TypeError\n\n        if dir:\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\n\nclass DirFile(Dir):\n    \"\"\"\n    Encapsulates reading and writing a per-directory .sconsign file.\n    \"\"\"\n    def __init__(self, dir):\n        \"\"\"\n        dir - the directory for the file\n        \"\"\"\n\n        self.dir = dir\n        self.sconsign = os.path.join(dir.get_internal_path(), '.sconsign')\n\n        try:\n            fp = open(self.sconsign, 'rb')\n        except IOError:\n            fp = None\n\n        try:\n            Dir.__init__(self, fp, dir)\n        except KeyboardInterrupt:\n            raise\n        except Exception:\n            SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                \"Ignoring corrupt .sconsign file: %s\"%self.sconsign)\n\n        try:\n            fp.close()\n        except AttributeError:\n            pass\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        \"\"\"\n        Write the .sconsign file to disk.\n\n        Try to write to a temporary file first, and rename it if we\n        succeed.  If we can't write to the temporary file, it's\n        probably because the directory isn't writable (and if so,\n        how did we build anything in this directory, anyway?), so\n        try to write directly to the .sconsign file as a backup.\n        If we can't rename, try to copy the temporary contents back\n        to the .sconsign file.  Either way, always try to remove\n        the temporary file at the end.\n        \"\"\"\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        temp = os.path.join(self.dir.get_internal_path(), '.scons%d' % os.getpid())\n        try:\n            file = open(temp, 'wb')\n            fname = temp\n        except IOError:\n            try:\n                file = open(self.sconsign, 'wb')\n                fname = self.sconsign\n            except IOError:\n                return\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        pickle.dump(self.entries, file, PICKLE_PROTOCOL)\n        file.close()\n        if fname != self.sconsign:\n            try:\n                mode = os.stat(self.sconsign)[0]\n                os.chmod(self.sconsign, 0o666)\n                os.unlink(self.sconsign)\n            except (IOError, OSError):\n                # Try to carry on in the face of either OSError\n                # (things like permission issues) or IOError (disk\n                # or network issues).  If there's a really dangerous\n                # issue, it should get re-raised by the calls below.\n                pass\n            try:\n                os.rename(fname, self.sconsign)\n            except OSError:\n                # An OSError failure to rename may indicate something\n                # like the directory has no write permission, but\n                # the .sconsign file itself might still be writable,\n                # so try writing on top of it directly.  An IOError\n                # here, or in any of the following calls, would get\n                # raised, indicating something like a potentially\n                # serious disk or network issue.\n                with open(self.sconsign, 'wb') as f, open(fname, 'rb') as f2:\n                    f.write(f2.read())\n                os.chmod(self.sconsign, mode)\n        try:\n            os.unlink(temp)\n        except (IOError, OSError):\n            pass\n\nForDirectory = DB\n\n\ndef File(name, dbm_module=None):\n    \"\"\"\n    Arrange for all signatures to be stored in a global .sconsign.db*\n    file.\n    \"\"\"\n    global ForDirectory, DB_Name, DB_Module\n    if name is None:\n        ForDirectory = DirFile\n        DB_Module = None\n    else:\n        ForDirectory = DB\n        DB_Name = name\n        if dbm_module is not None:\n            DB_Module = dbm_module\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Scanner/C.py",
    "content": "\"\"\"SCons.Scanner.C\n\nThis module implements the dependency scanner for C/C++ code. \n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/C.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Util\n\nimport SCons.cpp\n\nclass SConsCPPScanner(SCons.cpp.PreProcessor):\n    \"\"\"\n    SCons-specific subclass of the cpp.py module's processing.\n\n    We subclass this so that: 1) we can deal with files represented\n    by Nodes, not strings; 2) we can keep track of the files that are\n    missing.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        SCons.cpp.PreProcessor.__init__(self, *args, **kw)\n        self.missing = []\n    def initialize_result(self, fname):\n        self.result = SCons.Util.UniqueList([fname])\n    def finalize_result(self, fname):\n        return self.result[1:]\n    def find_include_file(self, t):\n        keyword, quote, fname = t\n        result = SCons.Node.FS.find_file(fname, self.searchpath[quote])\n        if not result:\n            self.missing.append((fname, self.current_file))\n        return result\n    def read_file(self, file):\n        try:\n            with open(str(file.rfile())) as fp:\n                return fp.read()\n        except EnvironmentError as e:\n            self.missing.append((file, self.current_file))\n            return ''\n\ndef dictify_CPPDEFINES(env):\n    cppdefines = env.get('CPPDEFINES', {})\n    if cppdefines is None:\n        return {}\n    if SCons.Util.is_Sequence(cppdefines):\n        result = {}\n        for c in cppdefines:\n            if SCons.Util.is_Sequence(c):\n                result[c[0]] = c[1]\n            else:\n                result[c] = None\n        return result\n    if not SCons.Util.is_Dict(cppdefines):\n        return {cppdefines : None}\n    return cppdefines\n\nclass SConsCPPScannerWrapper(object):\n    \"\"\"\n    The SCons wrapper around a cpp.py scanner.\n\n    This is the actual glue between the calling conventions of generic\n    SCons scanners, and the (subclass of) cpp.py class that knows how\n    to look for #include lines with reasonably real C-preprocessor-like\n    evaluation of #if/#ifdef/#else/#elif lines.\n    \"\"\"\n    def __init__(self, name, variable):\n        self.name = name\n        self.path = SCons.Scanner.FindPathDirs(variable)\n    def __call__(self, node, env, path = ()):\n        cpp = SConsCPPScanner(current = node.get_dir(),\n                              cpppath = path,\n                              dict = dictify_CPPDEFINES(env))\n        result = cpp(node)\n        for included, includer in cpp.missing:\n            fmt = \"No dependency generated for file: %s (included from: %s) -- file not found\"\n            SCons.Warnings.warn(SCons.Warnings.DependencyWarning,\n                                fmt % (included, includer))\n        return result\n\n    def recurse_nodes(self, nodes):\n        return nodes\n    def select(self, node):\n        return self\n\ndef CScanner():\n    \"\"\"Return a prototype Scanner instance for scanning source files\n    that use the C pre-processor\"\"\"\n\n    # Here's how we would (or might) use the CPP scanner code above that\n    # knows how to evaluate #if/#ifdef/#else/#elif lines when searching\n    # for #includes.  This is commented out for now until we add the\n    # right configurability to let users pick between the scanners.\n    #return SConsCPPScannerWrapper(\"CScanner\", \"CPPPATH\")\n\n    cs = SCons.Scanner.ClassicCPP(\"CScanner\",\n                                  \"$CPPSUFFIXES\",\n                                  \"CPPPATH\",\n                                  '^[ \\t]*#[ \\t]*(?:include|import)[ \\t]*(<|\")([^>\"]+)(>|\")')\n    return cs\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Scanner/Dir.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Scanner/Dir.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Node.FS\nimport SCons.Scanner\n\ndef only_dirs(nodes):\n    is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir)\n    return [node for node in nodes if is_Dir(node)]\n\ndef DirScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for scanning\n    directories for on-disk files\"\"\"\n    kw['node_factory'] = SCons.Node.FS.Entry\n    kw['recursive'] = only_dirs\n    return SCons.Scanner.Base(scan_on_disk, \"DirScanner\", **kw)\n\ndef DirEntryScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for \"scanning\"\n    directory Nodes for their in-memory entries\"\"\"\n    kw['node_factory'] = SCons.Node.FS.Entry\n    kw['recursive'] = None\n    return SCons.Scanner.Base(scan_in_memory, \"DirEntryScanner\", **kw)\n\nskip_entry = {}\n\nskip_entry_list = [\n   '.',\n   '..',\n   '.sconsign',\n   # Used by the native dblite.py module.\n   '.sconsign.dblite',\n   # Used by dbm and dumbdbm.\n   '.sconsign.dir',\n   # Used by dbm.\n   '.sconsign.pag',\n   # Used by dumbdbm.\n   '.sconsign.dat',\n   '.sconsign.bak',\n   # Used by some dbm emulations using Berkeley DB.\n   '.sconsign.db',\n]\n\nfor skip in skip_entry_list:\n    skip_entry[skip] = 1\n    skip_entry[SCons.Node.FS._my_normcase(skip)] = 1\n\ndo_not_scan = lambda k: k not in skip_entry\n\ndef scan_on_disk(node, env, path=()):\n    \"\"\"\n    Scans a directory for on-disk files and directories therein.\n\n    Looking up the entries will add these to the in-memory Node tree\n    representation of the file system, so all we have to do is just\n    that and then call the in-memory scanning function.\n    \"\"\"\n    try:\n        flist = node.fs.listdir(node.get_abspath())\n    except (IOError, OSError):\n        return []\n    e = node.Entry\n    for f in  filter(do_not_scan, flist):\n        # Add ./ to the beginning of the file name so if it begins with a\n        # '#' we don't look it up relative to the top-level directory.\n        e('./' + f)\n    return scan_in_memory(node, env, path)\n\ndef scan_in_memory(node, env, path=()):\n    \"\"\"\n    \"Scans\" a Node.FS.Dir for its in-memory entries.\n    \"\"\"\n    try:\n        entries = node.entries\n    except AttributeError:\n        # It's not a Node.FS.Dir (or doesn't look enough like one for\n        # our purposes), which can happen if a target list containing\n        # mixed Node types (Dirs and Files, for example) has a Dir as\n        # the first entry.\n        return []\n    entry_list = sorted(filter(do_not_scan, list(entries.keys())))\n    return [entries[n] for n in entry_list]\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Scanner/Prog.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/Prog.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Util\n\n# global, set by --debug=findlibs\nprint_find_libs = None\n\ndef ProgramScanner(**kw):\n    \"\"\"Return a prototype Scanner instance for scanning executable\n    files for static-lib dependencies\"\"\"\n    kw['path_function'] = SCons.Scanner.FindPathDirs('LIBPATH')\n    ps = SCons.Scanner.Base(scan, \"ProgramScanner\", **kw)\n    return ps\n\ndef _subst_libs(env, libs):\n    \"\"\"\n    Substitute environment variables and split into list.\n    \"\"\"\n    if SCons.Util.is_String(libs):\n        libs = env.subst(libs)\n        if SCons.Util.is_String(libs):\n            libs = libs.split()\n    elif SCons.Util.is_Sequence(libs):\n        _libs = []\n        for l in libs:\n            _libs += _subst_libs(env, l)\n        libs = _libs\n    else:\n        # libs is an object (Node, for example)\n        libs = [libs]\n    return libs\n\ndef scan(node, env, libpath = ()):\n    \"\"\"\n    This scanner scans program files for static-library\n    dependencies.  It will search the LIBPATH environment variable\n    for libraries specified in the LIBS variable, returning any\n    files it finds as dependencies.\n    \"\"\"\n    try:\n        libs = env['LIBS']\n    except KeyError:\n        # There are no LIBS in this environment, so just return a null list:\n        return []\n\n    libs = _subst_libs(env, libs)\n\n    try:\n        prefix = env['LIBPREFIXES']\n        if not SCons.Util.is_List(prefix):\n            prefix = [ prefix ]\n    except KeyError:\n        prefix = [ '' ]\n\n    try:\n        suffix = env['LIBSUFFIXES']\n        if not SCons.Util.is_List(suffix):\n            suffix = [ suffix ]\n    except KeyError:\n        suffix = [ '' ]\n\n    pairs = []\n    for suf in map(env.subst, suffix):\n        for pref in map(env.subst, prefix):\n            pairs.append((pref, suf))\n\n    result = []\n\n    if callable(libpath):\n        libpath = libpath()\n\n    find_file = SCons.Node.FS.find_file\n    adjustixes = SCons.Util.adjustixes\n    for lib in libs:\n        if SCons.Util.is_String(lib):\n            for pref, suf in pairs:\n                l = adjustixes(lib, pref, suf)\n                l = find_file(l, libpath, verbose=print_find_libs)\n                if l:\n                    result.append(l)\n        else:\n            result.append(lib)\n\n    return result\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Scanner/RC.py",
    "content": "\"\"\"SCons.Scanner.RC\n\nThis module implements the dependency scanner for RC (Interface\nDefinition Language) files.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/RC.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport re\n\nimport SCons.Node.FS\nimport SCons.Scanner\n\n\ndef no_tlb(nodes):\n    \"\"\"\n    Filter out .tlb files as they are binary and shouldn't be scanned\n    \"\"\"\n    # print(\"Nodes:%s\"%[str(n) for n in nodes])\n    return [n for n in nodes if str(n)[-4:] != '.tlb']\n\n\ndef RCScan():\n    \"\"\"Return a prototype Scanner instance for scanning RC source files\"\"\"\n\n    res_re= r'^(?:\\s*#\\s*(?:include)|' \\\n            r'.*?\\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \\\n            r'\\s*.*?)' \\\n            r'\\s*(<|\"| )([^>\"\\s]+)(?:[>\"\\s])*$'\n    resScanner = SCons.Scanner.ClassicCPP(\"ResourceScanner\",\n                                          \"$RCSUFFIXES\",\n                                          \"CPPPATH\",\n                                          res_re,\n                                          recursive=no_tlb)\n    \n    return resScanner\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Scanner/__init__.py",
    "content": "\"\"\"SCons.Scanner\n\nThe Scanner package for the SCons software construction utility.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Scanner/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport re\n\nimport SCons.Node.FS\nimport SCons.Util\n\n\nclass _Null(object):\n    pass\n\n# This is used instead of None as a default argument value so None can be\n# used as an actual argument value.\n_null = _Null\n\ndef Scanner(function, *args, **kw):\n    \"\"\"\n    Public interface factory function for creating different types\n    of Scanners based on the different types of \"functions\" that may\n    be supplied.\n\n    TODO:  Deprecate this some day.  We've moved the functionality\n    inside the Base class and really don't need this factory function\n    any more.  It was, however, used by some of our Tool modules, so\n    the call probably ended up in various people's custom modules\n    patterned on SCons code.\n    \"\"\"\n    if SCons.Util.is_Dict(function):\n        return Selector(function, *args, **kw)\n    else:\n        return Base(function, *args, **kw)\n\n\n\nclass FindPathDirs(object):\n    \"\"\"\n    A class to bind a specific E{*}PATH variable name to a function that\n    will return all of the E{*}path directories.\n    \"\"\"\n    def __init__(self, variable):\n        self.variable = variable\n    def __call__(self, env, dir=None, target=None, source=None, argument=None):\n        import SCons.PathList\n        try:\n            path = env[self.variable]\n        except KeyError:\n            return ()\n\n        dir = dir or env.fs._cwd\n        path = SCons.PathList.PathList(path).subst_path(env, target, source)\n        return tuple(dir.Rfindalldirs(path))\n\n\n\nclass Base(object):\n    \"\"\"\n    The base class for dependency scanners.  This implements\n    straightforward, single-pass scanning of a single file.\n    \"\"\"\n\n    def __init__(self,\n                 function,\n                 name = \"NONE\",\n                 argument = _null,\n                 skeys = _null,\n                 path_function = None,\n                 # Node.FS.Base so that, by default, it's okay for a\n                 # scanner to return a Dir, File or Entry.\n                 node_class = SCons.Node.FS.Base,\n                 node_factory = None,\n                 scan_check = None,\n                 recursive = None):\n        \"\"\"\n        Construct a new scanner object given a scanner function.\n\n        'function' - a scanner function taking two or three\n        arguments and returning a list of strings.\n\n        'name' - a name for identifying this scanner object.\n\n        'argument' - an optional argument that, if specified, will be\n        passed to both the scanner function and the path_function.\n\n        'skeys' - an optional list argument that can be used to determine\n        which scanner should be used for a given Node. In the case of File\n        nodes, for example, the 'skeys' would be file suffixes.\n\n        'path_function' - a function that takes four or five arguments\n        (a construction environment, Node for the directory containing\n        the SConscript file that defined the primary target, list of\n        target nodes, list of source nodes, and optional argument for\n        this instance) and returns a tuple of the directories that can\n        be searched for implicit dependency files.  May also return a\n        callable() which is called with no args and returns the tuple\n        (supporting Bindable class).\n\n        'node_class' - the class of Nodes which this scan will return.\n        If node_class is None, then this scanner will not enforce any\n        Node conversion and will return the raw results from the\n        underlying scanner function.\n\n        'node_factory' - the factory function to be called to translate\n        the raw results returned by the scanner function into the\n        expected node_class objects.\n\n        'scan_check' - a function to be called to first check whether\n        this node really needs to be scanned.\n\n        'recursive' - specifies that this scanner should be invoked\n        recursively on all of the implicit dependencies it returns\n        (the canonical example being #include lines in C source files).\n        May be a callable, which will be called to filter the list\n        of nodes found to select a subset for recursive scanning\n        (the canonical example being only recursively scanning\n        subdirectories within a directory).\n\n        The scanner function's first argument will be a Node that should\n        be scanned for dependencies, the second argument will be an\n        Environment object, the third argument will be the tuple of paths\n        returned by the path_function, and the fourth argument will be\n        the value passed into 'argument', and the returned list should\n        contain the Nodes for all the direct dependencies of the file.\n\n        Examples:\n\n        s = Scanner(my_scanner_function)\n\n        s = Scanner(function = my_scanner_function)\n\n        s = Scanner(function = my_scanner_function, argument = 'foo')\n\n        \"\"\"\n\n        # Note: this class could easily work with scanner functions that take\n        # something other than a filename as an argument (e.g. a database\n        # node) and a dependencies list that aren't file names. All that\n        # would need to be changed is the documentation.\n\n        self.function = function\n        self.path_function = path_function\n        self.name = name\n        self.argument = argument\n\n        if skeys is _null:\n            if SCons.Util.is_Dict(function):\n                skeys = list(function.keys())\n            else:\n                skeys = []\n        self.skeys = skeys\n\n        self.node_class = node_class\n        self.node_factory = node_factory\n        self.scan_check = scan_check\n        if callable(recursive):\n            self.recurse_nodes = recursive\n        elif recursive:\n            self.recurse_nodes = self._recurse_all_nodes\n        else:\n            self.recurse_nodes = self._recurse_no_nodes\n\n    def path(self, env, dir=None, target=None, source=None):\n        if not self.path_function:\n            return ()\n        if self.argument is not _null:\n            return self.path_function(env, dir, target, source, self.argument)\n        else:\n            return self.path_function(env, dir, target, source)\n\n    def __call__(self, node, env, path=()):\n        \"\"\"\n        This method scans a single object. 'node' is the node\n        that will be passed to the scanner function, and 'env' is the\n        environment that will be passed to the scanner function. A list of\n        direct dependency nodes for the specified node will be returned.\n        \"\"\"\n        if self.scan_check and not self.scan_check(node, env):\n            return []\n\n        self = self.select(node)\n\n        if self.argument is not _null:\n            node_list = self.function(node, env, path, self.argument)\n        else:\n            node_list = self.function(node, env, path)\n\n        kw = {}\n        if hasattr(node, 'dir'):\n            kw['directory'] = node.dir\n        node_factory = env.get_factory(self.node_factory)\n        nodes = []\n        for l in node_list:\n            if self.node_class and not isinstance(l, self.node_class):\n                l = node_factory(l, **kw)\n            nodes.append(l)\n        return nodes\n\n    def __eq__(self, other):\n        try:\n            return self.__dict__ == other.__dict__\n        except AttributeError:\n            # other probably doesn't have a __dict__\n            return self.__dict__ == other\n\n    def __hash__(self):\n        return id(self)\n\n    def __str__(self):\n        return self.name\n\n    def add_skey(self, skey):\n        \"\"\"Add a skey to the list of skeys\"\"\"\n        self.skeys.append(skey)\n\n    def get_skeys(self, env=None):\n        if env and SCons.Util.is_String(self.skeys):\n            return env.subst_list(self.skeys)[0]\n        return self.skeys\n\n    def select(self, node):\n        if SCons.Util.is_Dict(self.function):\n            key = node.scanner_key()\n            try:\n                return self.function[key]\n            except KeyError:\n                return None\n        else:\n            return self\n\n    def _recurse_all_nodes(self, nodes):\n        return nodes\n\n    def _recurse_no_nodes(self, nodes):\n        return []\n\n    # recurse_nodes = _recurse_no_nodes\n\n    def add_scanner(self, skey, scanner):\n        self.function[skey] = scanner\n        self.add_skey(skey)\n\n\nclass Selector(Base):\n    \"\"\"\n    A class for selecting a more specific scanner based on the\n    scanner_key() (suffix) for a specific Node.\n\n    TODO:  This functionality has been moved into the inner workings of\n    the Base class, and this class will be deprecated at some point.\n    (It was never exposed directly as part of the public interface,\n    although it is used by the Scanner() factory function that was\n    used by various Tool modules and therefore was likely a template\n    for custom modules that may be out there.)\n    \"\"\"\n    def __init__(self, dict, *args, **kw):\n        Base.__init__(self, None, *args, **kw)\n        self.dict = dict\n        self.skeys = list(dict.keys())\n\n    def __call__(self, node, env, path=()):\n        return self.select(node)(node, env, path)\n\n    def select(self, node):\n        try:\n            return self.dict[node.scanner_key()]\n        except KeyError:\n            return None\n\n    def add_scanner(self, skey, scanner):\n        self.dict[skey] = scanner\n        self.add_skey(skey)\n\n\nclass Current(Base):\n    \"\"\"\n    A class for scanning files that are source files (have no builder)\n    or are derived files and are current (which implies that they exist,\n    either locally or in a repository).\n    \"\"\"\n\n    def __init__(self, *args, **kw):\n        def current_check(node, env):\n            return not node.has_builder() or node.is_up_to_date()\n        kw['scan_check'] = current_check\n        Base.__init__(self, *args, **kw)\n\nclass Classic(Current):\n    \"\"\"\n    A Scanner subclass to contain the common logic for classic CPP-style\n    include scanning, but which can be customized to use different\n    regular expressions to find the includes.\n\n    Note that in order for this to work \"out of the box\" (without\n    overriding the find_include() and sort_key() methods), the regular\n    expression passed to the constructor must return the name of the\n    include file in group 0.\n    \"\"\"\n\n    def __init__(self, name, suffixes, path_variable, regex, *args, **kw):\n\n        self.cre = re.compile(regex, re.M)\n\n        def _scan(node, _, path=(), self=self):\n            node = node.rfile()\n            if not node.exists():\n                return []\n            return self.scan(node, path)\n\n        kw['function'] = _scan\n        kw['path_function'] = FindPathDirs(path_variable)\n\n        # Allow recursive to propagate if child class specifies.\n        # In this case resource scanner needs to specify a filter on which files\n        # get recursively processed.  Previously was hardcoded to 1 instead of\n        # defaulted to 1.\n        kw['recursive'] = kw.get('recursive', 1)\n        kw['skeys'] = suffixes\n        kw['name'] = name\n\n        Current.__init__(self, *args, **kw)\n\n    def find_include(self, include, source_dir, path):\n        n = SCons.Node.FS.find_file(include, (source_dir,) + tuple(path))\n        return n, include\n\n    def sort_key(self, include):\n        return SCons.Node.FS._my_normcase(include)\n\n    def find_include_names(self, node):\n        return self.cre.findall(node.get_text_contents())\n\n    def scan(self, node, path=()):\n\n        # cache the includes list in node so we only scan it once:\n        if node.includes is not None:\n            includes = node.includes\n        else:\n            includes = self.find_include_names(node)\n            # Intern the names of the include files. Saves some memory\n            # if the same header is included many times.\n            node.includes = list(map(SCons.Util.silent_intern, includes))\n\n        # This is a hand-coded DSU (decorate-sort-undecorate, or\n        # Schwartzian transform) pattern.  The sort key is the raw name\n        # of the file as specifed on the #include line (including the\n        # \" or <, since that may affect what file is found), which lets\n        # us keep the sort order constant regardless of whether the file\n        # is actually found in a Repository or locally.\n        nodes = []\n        source_dir = node.get_dir()\n        if callable(path):\n            path = path()\n        for include in includes:\n            n, i = self.find_include(include, source_dir, path)\n\n            if n is None:\n                SCons.Warnings.warn(SCons.Warnings.DependencyWarning,\n                                    \"No dependency generated for file: %s (included from: %s) -- file not found\" % (i, node))\n            else:\n                nodes.append((self.sort_key(include), n))\n\n        return [pair[1] for pair in sorted(nodes)]\n\nclass ClassicCPP(Classic):\n    \"\"\"\n    A Classic Scanner subclass which takes into account the type of\n    bracketing used to include the file, and uses classic CPP rules\n    for searching for the files based on the bracketing.\n\n    Note that in order for this to work, the regular expression passed\n    to the constructor must return the leading bracket in group 0, and\n    the contained filename in group 1.\n    \"\"\"\n    def find_include(self, include, source_dir, path):\n        include = list(map(SCons.Util.to_str, include))\n        if include[0] == '\"':\n            paths = (source_dir,) + tuple(path)\n        else:\n            paths = tuple(path) + (source_dir,)\n\n        n = SCons.Node.FS.find_file(include[1], paths)\n\n        i = SCons.Util.silent_intern(include[1])\n        return n, i\n\n    def sort_key(self, include):\n        return SCons.Node.FS._my_normcase(' '.join(include))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/Interactive.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Script/Interactive.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"\nSCons interactive mode\n\"\"\"\n\n# TODO:\n#\n# This has the potential to grow into something with a really big life\n# of its own, which might or might not be a good thing.  Nevertheless,\n# here are some enhancements that will probably be requested some day\n# and are worth keeping in mind (assuming this takes off):\n# \n# - A command to re-read / re-load the SConscript files.  This may\n#   involve allowing people to specify command-line options (e.g. -f,\n#   -I, --no-site-dir) that affect how the SConscript files are read.\n#\n# - Additional command-line options on the \"build\" command.\n#\n#   Of the supported options that seemed to make sense (after a quick\n#   pass through the list), the ones that seemed likely enough to be\n#   used are listed in the man page and have explicit test scripts.\n#\n#   These had code changed in Script/Main.py to support them, but didn't\n#   seem likely to be used regularly, so had no test scripts added:\n#\n#       build --diskcheck=*\n#       build --implicit-cache=*\n#       build --implicit-deps-changed=*\n#       build --implicit-deps-unchanged=*\n#\n#   These look like they should \"just work\" with no changes to the\n#   existing code, but like those above, look unlikely to be used and\n#   therefore had no test scripts added:\n#\n#       build --random\n#\n#   These I'm not sure about.  They might be useful for individual\n#   \"build\" commands, and may even work, but they seem unlikely enough\n#   that we'll wait until they're requested before spending any time on\n#   writing test scripts for them, or investigating whether they work.\n#\n#       build -q [???  is there a useful analog to the exit status?]\n#       build --duplicate=\n#       build --profile=\n#       build --max-drift=\n#       build --warn=*\n#       build --Y\n#\n# - Most of the SCons command-line options that the \"build\" command\n#   supports should be settable as default options that apply to all\n#   subsequent \"build\" commands.  Maybe a \"set {option}\" command that\n#   maps to \"SetOption('{option}')\".\n#\n# - Need something in the 'help' command that prints the -h output.\n#\n# - A command to run the configure subsystem separately (must see how\n#   this interacts with the new automake model).\n#\n# - Command-line completion of target names; maybe even of SCons options?\n#   Completion is something that's supported by the Python cmd module,\n#   so this should be doable without too much trouble.\n#\n\nimport cmd\nimport copy\nimport os\nimport re\nimport shlex\nimport sys\n\ntry:\n    import readline\nexcept ImportError:\n    pass\n\nclass SConsInteractiveCmd(cmd.Cmd):\n    \"\"\"\\\n\nbuild [TARGETS]         Build the specified TARGETS and their dependencies. 'b' is a synonym.\nclean [TARGETS]         Clean (remove) the specified TARGETS and their dependencies.  'c' is a synonym.\nexit                    Exit SCons interactive mode.\nhelp [COMMAND]          Prints help for the specified COMMAND.  'h' and '?' are synonyms.\nshell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!' are synonyms.\nversion                 Prints SCons version information.\n\"\"\"\n\n    synonyms = {\n        'b'     : 'build',\n        'c'     : 'clean',\n        'h'     : 'help',\n        'scons' : 'build',\n        'sh'    : 'shell',\n    }\n\n    def __init__(self, **kw):\n        cmd.Cmd.__init__(self)\n        for key, val in kw.items():\n            setattr(self, key, val)\n\n        if sys.platform == 'win32':\n            self.shell_variable = 'COMSPEC'\n        else:\n            self.shell_variable = 'SHELL'\n\n    def default(self, argv):\n        print(\"*** Unknown command: %s\" % argv[0])\n\n    def onecmd(self, line):\n        line = line.strip()\n        if not line:\n            print(self.lastcmd)\n            return self.emptyline()\n        self.lastcmd = line\n        if line[0] == '!':\n            line = 'shell ' + line[1:]\n        elif line[0] == '?':\n            line = 'help ' + line[1:]\n        if os.sep == '\\\\':\n            line = line.replace('\\\\', '\\\\\\\\')\n        argv = shlex.split(line)\n        argv[0] = self.synonyms.get(argv[0], argv[0])\n        if not argv[0]:\n            return self.default(line)\n        else:\n            try:\n                func = getattr(self, 'do_' + argv[0])\n            except AttributeError:\n                return self.default(argv)\n            return func(argv)\n\n    def do_build(self, argv):\n        \"\"\"\\\n        build [TARGETS]         Build the specified TARGETS and their\n                                dependencies.  'b' is a synonym.\n        \"\"\"\n        import SCons.Node\n        import SCons.SConsign\n        import SCons.Script.Main\n\n        options = copy.deepcopy(self.options)\n\n        options, targets = self.parser.parse_args(argv[1:], values=options)\n\n        SCons.Script.COMMAND_LINE_TARGETS = targets\n\n        if targets:\n            SCons.Script.BUILD_TARGETS = targets\n        else:\n            # If the user didn't specify any targets on the command line,\n            # use the list of default targets.\n            SCons.Script.BUILD_TARGETS = SCons.Script._build_plus_default\n\n        nodes = SCons.Script.Main._build_targets(self.fs,\n                                                 options,\n                                                 targets,\n                                                 self.target_top)\n\n        if not nodes:\n            return\n\n        # Call each of the Node's alter_targets() methods, which may\n        # provide additional targets that ended up as part of the build\n        # (the canonical example being a VariantDir() when we're building\n        # from a source directory) and which we therefore need their\n        # state cleared, too.\n        x = []\n        for n in nodes:\n            x.extend(n.alter_targets()[0])\n        nodes.extend(x)\n\n        # Clean up so that we can perform the next build correctly.\n        #\n        # We do this by walking over all the children of the targets,\n        # and clearing their state.\n        #\n        # We currently have to re-scan each node to find their\n        # children, because built nodes have already been partially\n        # cleared and don't remember their children.  (In scons\n        # 0.96.1 and earlier, this wasn't the case, and we didn't\n        # have to re-scan the nodes.)\n        #\n        # Because we have to re-scan each node, we can't clear the\n        # nodes as we walk over them, because we may end up rescanning\n        # a cleared node as we scan a later node.  Therefore, only\n        # store the list of nodes that need to be cleared as we walk\n        # the tree, and clear them in a separate pass.\n        #\n        # XXX: Someone more familiar with the inner workings of scons\n        # may be able to point out a more efficient way to do this.\n\n        SCons.Script.Main.progress_display(\"scons: Clearing cached node information ...\")\n\n        seen_nodes = {}\n\n        def get_unseen_children(node, parent, seen_nodes=seen_nodes):\n            def is_unseen(node, seen_nodes=seen_nodes):\n                return node not in seen_nodes\n            return [child for child in node.children(scan=1) if is_unseen(child)]\n\n        def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):\n            seen_nodes[node] = 1\n\n            # If this file is in a VariantDir and has a\n            # corresponding source file in the source tree, remember the\n            # node in the source tree, too.  This is needed in\n            # particular to clear cached implicit dependencies on the\n            # source file, since the scanner will scan it if the\n            # VariantDir was created with duplicate=0.\n            try:\n                rfile_method = node.rfile\n            except AttributeError:\n                return\n            else:\n                rfile = rfile_method()\n            if rfile != node:\n                seen_nodes[rfile] = 1\n\n        for node in nodes:\n            walker = SCons.Node.Walker(node,\n                                        kids_func=get_unseen_children,\n                                        eval_func=add_to_seen_nodes)\n            n = walker.get_next()\n            while n:\n                n = walker.get_next()\n\n        for node in list(seen_nodes.keys()):\n            # Call node.clear() to clear most of the state\n            node.clear()\n            # node.clear() doesn't reset node.state, so call\n            # node.set_state() to reset it manually\n            node.set_state(SCons.Node.no_state)\n            node.implicit = None\n\n            # Debug:  Uncomment to verify that all Taskmaster reference\n            # counts have been reset to zero.\n            #if node.ref_count != 0:\n            #    from SCons.Debug import Trace\n            #    Trace('node %s, ref_count %s !!!\\n' % (node, node.ref_count))\n\n        SCons.SConsign.Reset()\n        SCons.Script.Main.progress_display(\"scons: done clearing node information.\")\n\n    def do_clean(self, argv):\n        \"\"\"\\\n        clean [TARGETS]         Clean (remove) the specified TARGETS\n                                and their dependencies.  'c' is a synonym.\n        \"\"\"\n        return self.do_build(['build', '--clean'] + argv[1:])\n\n    def do_EOF(self, argv):\n        print()\n        self.do_exit(argv)\n\n    def _do_one_help(self, arg):\n        try:\n            # If help_<arg>() exists, then call it.\n            func = getattr(self, 'help_' + arg)\n        except AttributeError:\n            try:\n                func = getattr(self, 'do_' + arg)\n            except AttributeError:\n                doc = None\n            else:\n                doc = self._doc_to_help(func)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n        else:\n            doc = self.strip_initial_spaces(func())\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def _doc_to_help(self, obj):\n        doc = obj.__doc__\n        if doc is None:\n            return ''\n        return self._strip_initial_spaces(doc)\n\n    def _strip_initial_spaces(self, s):\n        lines = s.split('\\n')\n        spaces = re.match(' *', lines[0]).group(0)\n        def strip_spaces(l, spaces=spaces):\n            if l[:len(spaces)] == spaces:\n                l = l[len(spaces):]\n            return l\n        lines = list(map(strip_spaces, lines))\n        return '\\n'.join(lines)\n\n    def do_exit(self, argv):\n        \"\"\"\\\n        exit                    Exit SCons interactive mode.\n        \"\"\"\n        sys.exit(0)\n\n    def do_help(self, argv):\n        \"\"\"\\\n        help [COMMAND]          Prints help for the specified COMMAND.  'h'\n                                and '?' are synonyms.\n        \"\"\"\n        if argv[1:]:\n            for arg in argv[1:]:\n                if self._do_one_help(arg):\n                    break\n        else:\n            # If bare 'help' is called, print this class's doc\n            # string (if it has one).\n            doc = self._doc_to_help(self.__class__)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def do_shell(self, argv):\n        \"\"\"\\\n        shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and\n                                '!' are synonyms.\n        \"\"\"\n        import subprocess\n        argv = argv[1:]\n        if not argv:\n            argv = os.environ[self.shell_variable]\n        try:\n            # Per \"[Python-Dev] subprocess insufficiently platform-independent?\"\n            # http://mail.python.org/pipermail/python-dev/2008-August/081979.html \"+\n            # Doing the right thing with an argument list currently\n            # requires different shell= values on Windows and Linux.\n            p = subprocess.Popen(argv, shell=(sys.platform=='win32'))\n        except EnvironmentError as e:\n            sys.stderr.write('scons: %s: %s\\n' % (argv[0], e.strerror))\n        else:\n            p.wait()\n\n    def do_version(self, argv):\n        \"\"\"\\\n        version                 Prints SCons version information.\n        \"\"\"\n        sys.stdout.write(self.parser.version + '\\n')\n\ndef interact(fs, parser, options, targets, target_top):\n    c = SConsInteractiveCmd(prompt = 'scons>>> ',\n                            fs = fs,\n                            parser = parser,\n                            options = options,\n                            targets = targets,\n                            target_top = target_top)\n    c.cmdloop()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/Main.py",
    "content": "\"\"\"SCons.Script\n\nThis file implements the main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\"\"\"\n\nfrom __future__ import print_function\n\n\nunsupported_python_version = (2, 6, 0)\ndeprecated_python_version = (2, 7, 0)\n\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Script/Main.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\nimport SCons.compat\n\nimport os\nimport sys\nimport time\nimport traceback\nimport sysconfig\nimport platform\n\nimport SCons.CacheDir\nimport SCons.Debug\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.Platform.virtualenv\nimport SCons.SConf\nimport SCons.Script\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\n\nimport SCons.Script.Interactive\n\n# Global variables\nfirst_command_start = None\nlast_command_end = None\nprint_objects = 0\nprint_memoizer = 0\nprint_stacktrace = 0\nprint_time = 0\nprint_action_timestamps = 0\nsconscript_time = 0\ncumulative_command_time = 0\nexit_status = 0   # final exit status, assume success by default\nthis_build_status = 0   # \"exit status\" of an individual build\nnum_jobs = None\ndelayed_warnings = []\n\n\ndef fetch_win32_parallel_msg():\n    # A subsidiary function that exists solely to isolate this import\n    # so we don't have to pull it in on all platforms, and so that an\n    # in-line \"import\" statement in the _main() function below doesn't\n    # cause warnings about local names shadowing use of the 'SCons'\n    # global in nest scopes and UnboundLocalErrors and the like in some\n    # versions (2.1) of Python.\n    import SCons.Platform.win32\n    return SCons.Platform.win32.parallel_msg\n\n\ndef revert_io():\n    # This call is added to revert stderr and stdout to the original\n    # ones just in case some build rule or something else in the system\n    # has redirected them elsewhere.\n    sys.stderr = sys.__stderr__\n    sys.stdout = sys.__stdout__\n\n\nclass SConsPrintHelpException(Exception):\n    pass\n\n\ndisplay = SCons.Util.display\nprogress_display = SCons.Util.DisplayEngine()\n\n\nclass Progressor(object):\n    prev = ''\n    count = 0\n    target_string = '$TARGET'\n\n    def __init__(self, obj, interval=1, file=None, overwrite=False):\n        if file is None:\n            file = sys.stdout\n\n        self.obj = obj\n        self.file = file\n        self.interval = interval\n        self.overwrite = overwrite\n\n        if callable(obj):\n            self.func = obj\n        elif SCons.Util.is_List(obj):\n            self.func = self.spinner\n        elif obj.find(self.target_string) != -1:\n            self.func = self.replace_string\n        else:\n            self.func = self.string\n\n    def write(self, s):\n        self.file.write(s)\n        self.file.flush()\n        self.prev = s\n\n    def erase_previous(self):\n        if self.prev:\n            length = len(self.prev)\n            if self.prev[-1] in ('\\n', '\\r'):\n                length = length - 1\n            self.write(' ' * length + '\\r')\n            self.prev = ''\n\n    def spinner(self, node):\n        self.write(self.obj[self.count % len(self.obj)])\n\n    def string(self, node):\n        self.write(self.obj)\n\n    def replace_string(self, node):\n        self.write(self.obj.replace(self.target_string, str(node)))\n\n    def __call__(self, node):\n        self.count = self.count + 1\n        if (self.count % self.interval) == 0:\n            if self.overwrite:\n                self.erase_previous()\n            self.func(node)\n\nProgressObject = SCons.Util.Null()\n\ndef Progress(*args, **kw):\n    global ProgressObject\n    ProgressObject = Progressor(*args, **kw)\n\n# Task control.\n#\n\n_BuildFailures = []\n\n\ndef GetBuildFailures():\n    return _BuildFailures\n\n\nclass BuildTask(SCons.Taskmaster.OutOfDateTask):\n    \"\"\"An SCons build task.\"\"\"\n    progress = ProgressObject\n\n    def display(self, message):\n        display('scons: ' + message)\n\n    def prepare(self):\n        self.progress(self.targets[0])\n        return SCons.Taskmaster.OutOfDateTask.prepare(self)\n\n    def needs_execute(self):\n        if SCons.Taskmaster.OutOfDateTask.needs_execute(self):\n            return True\n        if self.top and self.targets[0].has_builder():\n            display(\"scons: `%s' is up to date.\" % str(self.node))\n        return False\n\n    def execute(self):\n        if print_time:\n            start_time = time.time()\n            global first_command_start\n            if first_command_start is None:\n                first_command_start = start_time\n        SCons.Taskmaster.OutOfDateTask.execute(self)\n        if print_time:\n            global cumulative_command_time\n            global last_command_end\n            finish_time = time.time()\n            last_command_end = finish_time\n            cumulative_command_time = cumulative_command_time+finish_time-start_time\n            if print_action_timestamps:\n                sys.stdout.write(\"Command execution start timestamp: %s: %f\\n\"%(str(self.node), start_time))\n                sys.stdout.write(\"Command execution end timestamp: %s: %f\\n\"%(str(self.node), finish_time))\n            sys.stdout.write(\"Command execution time: %s: %f seconds\\n\"%(str(self.node), finish_time-start_time))\n\n    def do_failed(self, status=2):\n        _BuildFailures.append(self.exception[1])\n        global exit_status\n        global this_build_status\n        if self.options.ignore_errors:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n        elif self.options.keep_going:\n            SCons.Taskmaster.OutOfDateTask.fail_continue(self)\n            exit_status = status\n            this_build_status = status\n        else:\n            SCons.Taskmaster.OutOfDateTask.fail_stop(self)\n            exit_status = status\n            this_build_status = status\n\n    def executed(self):\n        t = self.targets[0]\n        if self.top and not t.has_builder() and not t.side_effect:\n            if not t.exists():\n                if t.__class__.__name__ in ('File', 'Dir', 'Entry'):\n                    errstr=\"Do not know how to make %s target `%s' (%s).\" % (t.__class__.__name__, t, t.get_abspath())\n                else: # Alias or Python or ...\n                    errstr=\"Do not know how to make %s target `%s'.\" % (t.__class__.__name__, t)\n                sys.stderr.write(\"scons: *** \" + errstr)\n                if not self.options.keep_going:\n                    sys.stderr.write(\"  Stop.\")\n                sys.stderr.write(\"\\n\")\n                try:\n                    raise SCons.Errors.BuildError(t, errstr)\n                except KeyboardInterrupt:\n                    raise\n                except:\n                    self.exception_set()\n                self.do_failed()\n            else:\n                print(\"scons: Nothing to be done for `%s'.\" % t)\n                SCons.Taskmaster.OutOfDateTask.executed(self)\n        else:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n\n    def failed(self):\n        # Handle the failure of a build task.  The primary purpose here\n        # is to display the various types of Errors and Exceptions\n        # appropriately.\n        exc_info = self.exc_info()\n        try:\n            t, e, tb = exc_info\n        except ValueError:\n            t, e = exc_info\n            tb = None\n\n        if t is None:\n            # The Taskmaster didn't record an exception for this Task;\n            # see if the sys module has one.\n            try:\n                t, e, tb = sys.exc_info()[:]\n            except ValueError:\n                t, e = exc_info\n                tb = None\n\n        # Deprecated string exceptions will have their string stored\n        # in the first entry of the tuple.\n        if e is None:\n            e = t\n\n        buildError = SCons.Errors.convert_to_BuildError(e)\n        if not buildError.node:\n            buildError.node = self.node\n\n        node = buildError.node\n        if not SCons.Util.is_List(node):\n                node = [ node ]\n        nodename = ', '.join(map(str, node))\n\n        errfmt = \"scons: *** [%s] %s\\n\"\n        sys.stderr.write(errfmt % (nodename, buildError))\n\n        if (buildError.exc_info[2] and buildError.exc_info[1] and\n           not isinstance(\n               buildError.exc_info[1],\n               (EnvironmentError, SCons.Errors.StopError,\n                            SCons.Errors.UserError))):\n            type, value, trace = buildError.exc_info\n            if tb and print_stacktrace:\n                sys.stderr.write(\"scons: internal stack trace:\\n\")\n                traceback.print_tb(tb, file=sys.stderr)\n            traceback.print_exception(type, value, trace)\n        elif tb and print_stacktrace:\n            sys.stderr.write(\"scons: internal stack trace:\\n\")\n            traceback.print_tb(tb, file=sys.stderr)\n\n        self.exception = (e, buildError, tb) # type, value, traceback\n        self.do_failed(buildError.exitstatus)\n\n        self.exc_clear()\n\n    def postprocess(self):\n        if self.top:\n            t = self.targets[0]\n            for tp in self.options.tree_printers:\n                tp.display(t)\n            if self.options.debug_includes:\n                tree = t.render_include_tree()\n                if tree:\n                    print()\n                    print(tree)\n        SCons.Taskmaster.OutOfDateTask.postprocess(self)\n\n    def make_ready(self):\n        \"\"\"Make a task ready for execution\"\"\"\n        SCons.Taskmaster.OutOfDateTask.make_ready(self)\n        if self.out_of_date and self.options.debug_explain:\n            explanation = self.out_of_date[0].explain()\n            if explanation:\n                sys.stdout.write(\"scons: \" + explanation)\n\n\nclass CleanTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons clean task.\"\"\"\n    def fs_delete(self, path, pathstr, remove=True):\n        try:\n            if os.path.lexists(path):\n                if os.path.isfile(path) or os.path.islink(path):\n                    if remove: os.unlink(path)\n                    display(\"Removed \" + pathstr)\n                elif os.path.isdir(path) and not os.path.islink(path):\n                    # delete everything in the dir\n                    for e in sorted(os.listdir(path)):\n                        p = os.path.join(path, e)\n                        s = os.path.join(pathstr, e)\n                        if os.path.isfile(p):\n                            if remove: os.unlink(p)\n                            display(\"Removed \" + s)\n                        else:\n                            self.fs_delete(p, s, remove)\n                    # then delete dir itself\n                    if remove: os.rmdir(path)\n                    display(\"Removed directory \" + pathstr)\n                else:\n                    errstr = \"Path '%s' exists but isn't a file or directory.\"\n                    raise SCons.Errors.UserError(errstr % (pathstr))\n        except SCons.Errors.UserError as e:\n            print(e)\n        except (IOError, OSError) as e:\n            print(\"scons: Could not remove '%s':\" % pathstr, e.strerror)\n\n    def _get_files_to_clean(self):\n        result = []\n        target = self.targets[0]\n        if target.has_builder() or target.side_effect:\n            result = [t for t in self.targets if not t.noclean]\n        return result\n\n    def _clean_targets(self, remove=True):\n        target = self.targets[0]\n        if target in SCons.Environment.CleanTargets:\n            files = SCons.Environment.CleanTargets[target]\n            for f in files:\n                self.fs_delete(f.get_abspath(), str(f), remove)\n\n    def show(self):\n        for t in self._get_files_to_clean():\n            if not t.isdir():\n                display(\"Removed \" + str(t))\n        self._clean_targets(remove=False)\n\n    def remove(self):\n        for t in self._get_files_to_clean():\n            try:\n                removed = t.remove()\n            except OSError as e:\n                # An OSError may indicate something like a permissions\n                # issue, an IOError would indicate something like\n                # the file not existing.  In either case, print a\n                # message and keep going to try to remove as many\n                # targets as possible.\n                print(\"scons: Could not remove '{0}'\".format(str(t)), e.strerror)\n            else:\n                if removed:\n                    display(\"Removed \" + str(t))\n        self._clean_targets(remove=True)\n\n    execute = remove\n\n    # We want the Taskmaster to update the Node states (and therefore\n    # handle reference counts, etc.), but we don't want to call\n    # back to the Node's post-build methods, which would do things\n    # we don't want, like store .sconsign information.\n    executed = SCons.Taskmaster.Task.executed_without_callbacks\n\n    # Have the Taskmaster arrange to \"execute\" all of the targets, because\n    # we'll figure out ourselves (in remove() or show() above) whether\n    # anything really needs to be done.\n    make_ready = SCons.Taskmaster.Task.make_ready_all\n\n    def prepare(self):\n        pass\n\nclass QuestionTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons task for the -q (question) option.\"\"\"\n    def prepare(self):\n        pass\n\n    def execute(self):\n        if self.targets[0].get_state() != SCons.Node.up_to_date or \\\n           (self.top and not self.targets[0].exists()):\n            global exit_status\n            global this_build_status\n            exit_status = 1\n            this_build_status = 1\n            self.tm.stop()\n\n    def executed(self):\n        pass\n\n\nclass TreePrinter(object):\n    def __init__(self, derived=False, prune=False, status=False):\n        self.derived = derived\n        self.prune = prune\n        self.status = status\n    def get_all_children(self, node):\n        return node.all_children()\n    def get_derived_children(self, node):\n        children = node.all_children(None)\n        return [x for x in children if x.has_builder()]\n    def display(self, t):\n        if self.derived:\n            func = self.get_derived_children\n        else:\n            func = self.get_all_children\n        s = self.status and 2 or 0\n        SCons.Util.print_tree(t, func, prune=self.prune, showtags=s)\n\n\ndef python_version_string():\n    return sys.version.split()[0]\n\ndef python_version_unsupported(version=sys.version_info):\n    return version < unsupported_python_version\n\ndef python_version_deprecated(version=sys.version_info):\n    return version < deprecated_python_version\n\n\nclass FakeOptionParser(object):\n    \"\"\"\n    A do-nothing option parser, used for the initial OptionsParser variable.\n\n    During normal SCons operation, the OptionsParser is created right\n    away by the main() function.  Certain tests scripts however, can\n    introspect on different Tool modules, the initialization of which\n    can try to add a new, local option to an otherwise uninitialized\n    OptionsParser object.  This allows that introspection to happen\n    without blowing up.\n\n    \"\"\"\n    class FakeOptionValues(object):\n        def __getattr__(self, attr):\n            return None\n    values = FakeOptionValues()\n    def add_local_option(self, *args, **kw):\n        pass\n\nOptionsParser = FakeOptionParser()\n\ndef AddOption(*args, **kw):\n    if 'default' not in kw:\n        kw['default'] = None\n    result = OptionsParser.add_local_option(*args, **kw)\n    return result\n\ndef GetOption(name):\n    return getattr(OptionsParser.values, name)\n\ndef SetOption(name, value):\n    return OptionsParser.values.set_option(name, value)\n\ndef PrintHelp(file=None):\n    OptionsParser.print_help(file=file)\n\nclass Stats(object):\n    def __init__(self):\n        self.stats = []\n        self.labels = []\n        self.append = self.do_nothing\n        self.print_stats = self.do_nothing\n    def enable(self, outfp):\n        self.outfp = outfp\n        self.append = self.do_append\n        self.print_stats = self.do_print\n    def do_nothing(self, *args, **kw):\n        pass\n\nclass CountStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.fetchLoggedInstances())\n    def do_print(self):\n        stats_table = {}\n        for s in self.stats:\n            for n in [t[0] for t in s]:\n                stats_table[n] = [0, 0, 0, 0]\n        i = 0\n        for s in self.stats:\n            for n, c in s:\n                stats_table[n][i] = c\n            i = i + 1\n        self.outfp.write(\"Object counts:\\n\")\n        pre = [\"   \"]\n        post = [\"   %s\\n\"]\n        l = len(self.stats)\n        fmt1 = ''.join(pre + [' %7s']*l + post)\n        fmt2 = ''.join(pre + [' %7d']*l + post)\n        labels = self.labels[:l]\n        labels.append((\"\", \"Class\"))\n        self.outfp.write(fmt1 % tuple([x[0] for x in labels]))\n        self.outfp.write(fmt1 % tuple([x[1] for x in labels]))\n        for k in sorted(stats_table.keys()):\n            r = stats_table[k][:l] + [k]\n            self.outfp.write(fmt2 % tuple(r))\n\ncount_stats = CountStats()\n\nclass MemStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.memory())\n    def do_print(self):\n        fmt = 'Memory %-32s %12d\\n'\n        for label, stats in zip(self.labels, self.stats):\n            self.outfp.write(fmt % (label, stats))\n\nmemory_stats = MemStats()\n\n# utility functions\n\ndef _scons_syntax_error(e):\n    \"\"\"Handle syntax errors. Print out a message and show where the error\n    occurred.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    lines = traceback.format_exception_only(etype, value)\n    for line in lines:\n        sys.stderr.write(line+'\\n')\n    sys.exit(2)\n\ndef find_deepest_user_frame(tb):\n    \"\"\"\n    Find the deepest stack frame that is not part of SCons.\n\n    Input is a \"pre-processed\" stack trace in the form\n    returned by traceback.extract_tb() or traceback.extract_stack()\n    \"\"\"\n\n    tb.reverse()\n\n    # find the deepest traceback frame that is not part\n    # of SCons:\n    for frame in tb:\n        filename = frame[0]\n        if filename.find(os.sep+'SCons'+os.sep) == -1:\n            return frame\n    return tb[0]\n\ndef _scons_user_error(e):\n    \"\"\"Handle user errors. Print out a message and a description of the\n    error, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    global print_stacktrace\n    etype, value, tb = sys.exc_info()\n    if print_stacktrace:\n        traceback.print_exception(etype, value, tb)\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: *** %s\\n\" % value)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n    sys.exit(2)\n\ndef _scons_user_warning(e):\n    \"\"\"Handle user warnings. Print out a message and a description of\n    the warning, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_warning(e):\n    \"\"\"Slightly different from _scons_user_warning in that we use the\n    *current call stack* rather than sys.exc_info() to get our stack trace.\n    This is used by the warnings framework to print warnings.\"\"\"\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack())\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e.args[0])\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_error():\n    \"\"\"Handle all errors but user errors. Print out a message telling\n    the user what to do in this case and print a normal trace.\n    \"\"\"\n    print('internal error')\n    traceback.print_exc()\n    sys.exit(2)\n\ndef _SConstruct_exists(dirname='', repositories=[], filelist=None):\n    \"\"\"This function checks that an SConstruct file exists in a directory.\n    If so, it returns the path of the file. By default, it checks the\n    current directory.\n    \"\"\"\n    if not filelist:\n        filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py']\n    for file in filelist:\n        sfile = os.path.join(dirname, file)\n        if os.path.isfile(sfile):\n            return sfile\n        if not os.path.isabs(sfile):\n            for rep in repositories:\n                if os.path.isfile(os.path.join(rep, sfile)):\n                    return sfile\n    return None\n\ndef _set_debug_values(options):\n    global print_memoizer, print_objects, print_stacktrace, print_time, print_action_timestamps\n\n    debug_values = options.debug\n\n    if \"count\" in debug_values:\n        # All of the object counts are within \"if track_instances:\" blocks,\n        # which get stripped when running optimized (with python -O or\n        # from compiled *.pyo files).  Provide a warning if __debug__ is\n        # stripped, so it doesn't just look like --debug=count is broken.\n        enable_count = False\n        if __debug__: enable_count = True\n        if enable_count:\n            count_stats.enable(sys.stdout)\n            SCons.Debug.track_instances = True\n        else:\n            msg = \"--debug=count is not supported when running SCons\\n\" + \\\n                  \"\\twith the python -O option or optimized (.pyo) modules.\"\n            SCons.Warnings.warn(SCons.Warnings.NoObjectCountWarning, msg)\n    if \"dtree\" in debug_values:\n        options.tree_printers.append(TreePrinter(derived=True))\n    options.debug_explain = (\"explain\" in debug_values)\n    if \"findlibs\" in debug_values:\n        SCons.Scanner.Prog.print_find_libs = \"findlibs\"\n    options.debug_includes = (\"includes\" in debug_values)\n    print_memoizer = (\"memoizer\" in debug_values)\n    if \"memory\" in debug_values:\n        memory_stats.enable(sys.stdout)\n    print_objects = (\"objects\" in debug_values)\n    if print_objects:\n        SCons.Debug.track_instances = True\n    if \"presub\" in debug_values:\n        SCons.Action.print_actions_presub = 1\n    if \"stacktrace\" in debug_values:\n        print_stacktrace = 1\n    if \"stree\" in debug_values:\n        options.tree_printers.append(TreePrinter(status=True))\n    if \"time\" in debug_values:\n        print_time = 1\n    if \"action-timestamps\" in debug_values:\n        print_time = 1\n        print_action_timestamps = 1\n    if \"tree\" in debug_values:\n        options.tree_printers.append(TreePrinter())\n    if \"prepare\" in debug_values:\n        SCons.Taskmaster.print_prepare = 1\n    if \"duplicate\" in debug_values:\n        SCons.Node.print_duplicate = 1\n\ndef _create_path(plist):\n    path = '.'\n    for d in plist:\n        if os.path.isabs(d):\n            path = d\n        else:\n            path = path + '/' + d\n    return path\n\ndef _load_site_scons_dir(topdir, site_dir_name=None):\n    \"\"\"Load the site_scons dir under topdir.\n    Prepends site_scons to sys.path, imports site_scons/site_init.py,\n    and prepends site_scons/site_tools to default toolpath.\"\"\"\n    if site_dir_name:\n        err_if_not_found = True       # user specified: err if missing\n    else:\n        site_dir_name = \"site_scons\"\n        err_if_not_found = False\n\n    site_dir = os.path.join(topdir, site_dir_name)\n    if not os.path.exists(site_dir):\n        if err_if_not_found:\n            raise SCons.Errors.UserError(\"site dir %s not found.\"%site_dir)\n        return\n\n    site_init_filename = \"site_init.py\"\n    site_init_modname = \"site_init\"\n    site_tools_dirname = \"site_tools\"\n    # prepend to sys.path\n    sys.path = [os.path.abspath(site_dir)] + sys.path\n    site_init_file = os.path.join(site_dir, site_init_filename)\n    site_tools_dir = os.path.join(site_dir, site_tools_dirname)\n    if os.path.exists(site_init_file):\n        import imp, re\n        try:\n            try:\n                fp, pathname, description = imp.find_module(site_init_modname,\n                                                            [site_dir])\n                # Load the file into SCons.Script namespace.  This is\n                # opaque and clever; m is the module object for the\n                # SCons.Script module, and the exec ... in call executes a\n                # file (or string containing code) in the context of the\n                # module's dictionary, so anything that code defines ends\n                # up adding to that module.  This is really short, but all\n                # the error checking makes it longer.\n                try:\n                    m = sys.modules['SCons.Script']\n                except Exception as e:\n                    fmt = 'cannot import site_init.py: missing SCons.Script module %s'\n                    raise SCons.Errors.InternalError(fmt % repr(e))\n                try:\n                    sfx = description[0]\n                    modname = os.path.basename(pathname)[:-len(sfx)]\n                    site_m = {\"__file__\": pathname, \"__name__\": modname, \"__doc__\": None}\n                    re_special = re.compile(\"__[^_]+__\")\n                    for k in list(m.__dict__.keys()):\n                        if not re_special.match(k):\n                            site_m[k] = m.__dict__[k]\n\n                    # This is the magic.\n                    exec(compile(fp.read(), fp.name, 'exec'), site_m)\n                except KeyboardInterrupt:\n                    raise\n                except Exception as e:\n                    fmt = '*** Error loading site_init file %s:\\n'\n                    sys.stderr.write(fmt % repr(site_init_file))\n                    raise\n                else:\n                    for k in site_m:\n                        if not re_special.match(k):\n                            m.__dict__[k] = site_m[k]\n            except KeyboardInterrupt:\n                raise\n            except ImportError as e:\n                fmt = '*** cannot import site init file %s:\\n'\n                sys.stderr.write(fmt % repr(site_init_file))\n                raise\n        finally:\n            if fp:\n                fp.close()\n    if os.path.exists(site_tools_dir):\n        # prepend to DefaultToolpath\n        SCons.Tool.DefaultToolpath.insert(0, os.path.abspath(site_tools_dir))\n\ndef _load_all_site_scons_dirs(topdir, verbose=None):\n    \"\"\"Load all of the predefined site_scons dir.\n    Order is significant; we load them in order from most generic\n    (machine-wide) to most specific (topdir).\n    The verbose argument is only for testing.\n    \"\"\"\n    platform = SCons.Platform.platform_default()\n\n    def homedir(d):\n        return os.path.expanduser('~/'+d)\n\n    if platform == 'win32' or platform == 'cygwin':\n        # Note we use $ here instead of %...% because older\n        # pythons (prior to 2.6?) didn't expand %...% on Windows.\n        # This set of dirs should work on XP, Vista, 7 and later.\n        sysdirs=[\n            os.path.expandvars('$ALLUSERSPROFILE\\\\Application Data\\\\scons'),\n            os.path.expandvars('$USERPROFILE\\\\Local Settings\\\\Application Data\\\\scons')]\n        appdatadir = os.path.expandvars('$APPDATA\\\\scons')\n        if appdatadir not in sysdirs:\n            sysdirs.append(appdatadir)\n        sysdirs.append(homedir('.scons'))\n\n    elif platform == 'darwin':  # MacOS X\n        sysdirs=['/Library/Application Support/SCons',\n                 '/opt/local/share/scons', # (for MacPorts)\n                 '/sw/share/scons', # (for Fink)\n                  homedir('Library/Application Support/SCons'),\n                  homedir('.scons')]\n    elif platform == 'sunos':   # Solaris\n        sysdirs=['/opt/sfw/scons',\n                 '/usr/share/scons',\n                 homedir('.scons')]\n    else:                       # Linux, HPUX, etc.\n        # assume posix-like, i.e. platform == 'posix'\n        sysdirs=['/usr/share/scons',\n                 homedir('.scons')]\n\n    dirs=sysdirs + [topdir]\n    for d in dirs:\n        if verbose:    # this is used by unit tests.\n            print(\"Loading site dir \", d)\n        _load_site_scons_dir(d)\n\ndef test_load_all_site_scons_dirs(d):\n    _load_all_site_scons_dirs(d, True)\n\ndef version_string(label, module):\n    version = module.__version__\n    build = module.__build__\n    if build:\n        if build[0] != '.':\n            build = '.' + build\n        version = version + build\n    fmt = \"\\t%s: v%s, %s, by %s on %s\\n\"\n    return fmt % (label,\n                  version,\n                  module.__date__,\n                  module.__developer__,\n                  module.__buildsys__)\n\ndef path_string(label, module):\n    path = module.__path__\n    return \"\\t%s path: %s\\n\"%(label,path)\n\ndef _main(parser):\n    global exit_status\n    global this_build_status\n\n    options = parser.values\n\n    # Here's where everything really happens.\n\n    # First order of business:  set up default warnings and then\n    # handle the user's warning options, so that we can issue (or\n    # suppress) appropriate warnings about anything that might happen,\n    # as configured by the user.\n\n    default_warnings = [ SCons.Warnings.WarningOnByDefault,\n                         SCons.Warnings.DeprecatedWarning,\n                       ]\n\n    for warning in default_warnings:\n        SCons.Warnings.enableWarningClass(warning)\n    SCons.Warnings._warningOut = _scons_internal_warning\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we have the warnings configuration set up, we can actually\n    # issue (or suppress) any warnings about warning-worthy things that\n    # occurred while the command-line options were getting parsed.\n    try:\n        dw = options.delayed_warnings\n    except AttributeError:\n        pass\n    else:\n        delayed_warnings.extend(dw)\n    for warning_type, message in delayed_warnings:\n        SCons.Warnings.warn(warning_type, message)\n\n    if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:\n        if options.enable_virtualenv:\n            SCons.Platform.virtualenv.enable_virtualenv = True\n\n    if options.ignore_virtualenv:\n        SCons.Platform.virtualenv.ignore_virtualenv = True\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    # Next, we want to create the FS object that represents the outside\n    # world's file system, as that's central to a lot of initialization.\n    # To do this, however, we need to be in the directory from which we\n    # want to start everything, which means first handling any relevant\n    # options that might cause us to chdir somewhere (-C, -D, -U, -u).\n    if options.directory:\n        script_dir = os.path.abspath(_create_path(options.directory))\n    else:\n        script_dir = os.getcwd()\n\n    target_top = None\n    if options.climb_up:\n        target_top = '.'  # directory to prepend to targets\n        while script_dir and not _SConstruct_exists(script_dir,\n                                                    options.repository,\n                                                    options.file):\n            script_dir, last_part = os.path.split(script_dir)\n            if last_part:\n                target_top = os.path.join(last_part, target_top)\n            else:\n                script_dir = ''\n\n    if script_dir and script_dir != os.getcwd():\n        if not options.silent:\n            display(\"scons: Entering directory `%s'\" % script_dir)\n        try:\n            os.chdir(script_dir)\n        except OSError:\n            sys.stderr.write(\"Could not change directory to %s\\n\" % script_dir)\n\n    # Now that we're in the top-level SConstruct directory, go ahead\n    # and initialize the FS object that represents the file system,\n    # and make it the build engine default.\n    fs = SCons.Node.FS.get_default_fs()\n\n    for rep in options.repository:\n        fs.Repository(rep)\n\n    # Now that we have the FS object, the next order of business is to\n    # check for an SConstruct file (or other specified config file).\n    # If there isn't one, we can bail before doing any more work.\n    scripts = []\n    if options.file:\n        scripts.extend(options.file)\n    if not scripts:\n        sfile = _SConstruct_exists(repositories=options.repository,\n                                   filelist=options.file)\n        if sfile:\n            scripts.append(sfile)\n\n    if not scripts:\n        if options.help:\n            # There's no SConstruct, but they specified -h.\n            # Give them the options usage now, before we fail\n            # trying to read a non-existent SConstruct file.\n            raise SConsPrintHelpException\n        raise SCons.Errors.UserError(\"No SConstruct file found.\")\n\n    if scripts[0] == \"-\":\n        d = fs.getcwd()\n    else:\n        d = fs.File(scripts[0]).dir\n    fs.set_SConstruct_dir(d)\n\n    _set_debug_values(options)\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.implicit_deps_changed = options.implicit_deps_changed\n    SCons.Node.implicit_deps_unchanged = options.implicit_deps_unchanged\n\n    if options.no_exec:\n        SCons.SConf.dryrun = 1\n        SCons.Action.execute_actions = None\n    if options.question:\n        SCons.SConf.dryrun = 1\n    if options.clean:\n        SCons.SConf.SetBuildType('clean')\n    if options.help:\n        SCons.SConf.SetBuildType('help')\n    SCons.SConf.SetCacheMode(options.config)\n    SCons.SConf.SetProgressDisplay(progress_display)\n\n    if options.no_progress or options.silent:\n        progress_display.set_mode(0)\n\n    if options.site_dir:\n        _load_site_scons_dir(d.get_internal_path(), options.site_dir)\n    elif not options.no_site_dir:\n        _load_all_site_scons_dirs(d.get_internal_path())\n\n    if options.include_dir:\n        sys.path = options.include_dir + sys.path\n\n    # If we're about to start SCons in the interactive mode,\n    # inform the FS about this right here. Else, the release_target_info\n    # method could get called on some nodes, like the used \"gcc\" compiler,\n    # when using the Configure methods within the SConscripts.\n    # This would then cause subtle bugs, as already happened in #2971.\n    if options.interactive:\n        SCons.Node.interactive = True\n\n    # That should cover (most of) the options.  Next, set up the variables\n    # that hold command-line arguments, so the SConscript files that we\n    # read and execute have access to them.\n    targets = []\n    xmit_args = []\n    for a in parser.largs:\n        if a[:1] == '-':\n            continue\n        if '=' in a:\n            xmit_args.append(a)\n        else:\n            targets.append(a)\n    SCons.Script._Add_Targets(targets + parser.rargs)\n    SCons.Script._Add_Arguments(xmit_args)\n\n    # If stdout is not a tty, replace it with a wrapper object to call flush\n    # after every write.\n    #\n    # Tty devices automatically flush after every newline, so the replacement\n    # isn't necessary.  Furthermore, if we replace sys.stdout, the readline\n    # module will no longer work.  This affects the behavior during\n    # --interactive mode.  --interactive should only be used when stdin and\n    # stdout refer to a tty.\n    if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():\n        sys.stdout = SCons.Util.Unbuffered(sys.stdout)\n    if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty():\n        sys.stderr = SCons.Util.Unbuffered(sys.stderr)\n\n    memory_stats.append('before reading SConscript files:')\n    count_stats.append(('pre-', 'read'))\n\n    # And here's where we (finally) read the SConscript files.\n\n    progress_display(\"scons: Reading SConscript files ...\")\n\n    start_time = time.time()\n    try:\n        for script in scripts:\n            SCons.Script._SConscript._SConscript(fs, script)\n    except SCons.Errors.StopError as e:\n        # We had problems reading an SConscript file, such as it\n        # couldn't be copied in to the VariantDir.  Since we're just\n        # reading SConscript files and haven't started building\n        # things yet, stop regardless of whether they used -i or -k\n        # or anything else.\n        revert_io()\n        sys.stderr.write(\"scons: *** %s  Stop.\\n\" % e)\n        sys.exit(2)\n    global sconscript_time\n    sconscript_time = time.time() - start_time\n\n    progress_display(\"scons: done reading SConscript files.\")\n\n    memory_stats.append('after reading SConscript files:')\n    count_stats.append(('post-', 'read'))\n\n    # Re-{enable,disable} warnings in case they disabled some in\n    # the SConscript file.\n    #\n    # We delay enabling the PythonVersionWarning class until here so that,\n    # if they explicitly disabled it in either in the command line or in\n    # $SCONSFLAGS, or in the SConscript file, then the search through\n    # the list of deprecated warning classes will find that disabling\n    # first and not issue the warning.\n    #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we've read the SConscript files, we can check for the\n    # warning about deprecated Python versions--delayed until here\n    # in case they disabled the warning in the SConscript files.\n    if python_version_deprecated():\n        msg = \"Support for pre-%s Python version (%s) is deprecated.\\n\" + \\\n              \"    If this will cause hardship, contact scons-dev@scons.org\"\n        deprecated_version_string = \".\".join(map(str, deprecated_python_version))\n        SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,\n                            msg % (deprecated_version_string, python_version_string()))\n\n    if not options.help:\n        # [ ] Clarify why we need to create Builder here at all, and\n        #     why it is created in DefaultEnvironment\n        # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30\n        if SCons.SConf.NeedConfigHBuilder():\n            SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())\n\n    # Now re-parse the command-line options (any to the left of a '--'\n    # argument, that is) with any user-defined command-line options that\n    # the SConscript files may have added to the parser object.  This will\n    # emit the appropriate error message and exit if any unknown option\n    # was specified on the command line.\n\n    parser.preserve_unknown_options = False\n    parser.parse_args(parser.largs, options)\n\n    if options.help:\n        help_text = SCons.Script.help_text\n        if help_text is None:\n            # They specified -h, but there was no Help() inside the\n            # SConscript files.  Give them the options usage.\n            raise SConsPrintHelpException\n        else:\n            print(help_text)\n            print(\"Use scons -H for help about command-line options.\")\n        exit_status = 0\n        return\n\n    # Change directory to the top-level SConstruct directory, then tell\n    # the Node.FS subsystem that we're all done reading the SConscript\n    # files and calling Repository() and VariantDir() and changing\n    # directories and the like, so it can go ahead and start memoizing\n    # the string values of file system nodes.\n\n    fs.chdir(fs.Top)\n\n    SCons.Node.FS.save_strings(1)\n\n    # Now that we've read the SConscripts we can set the options\n    # that are SConscript settable:\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.FS.set_duplicate(options.duplicate)\n    fs.set_max_drift(options.max_drift)\n\n    SCons.Job.explicit_stack_size = options.stack_size\n\n    if options.md5_chunksize:\n        SCons.Node.FS.File.md5_chunksize = options.md5_chunksize\n\n    platform = SCons.Platform.platform_module()\n\n    if options.interactive:\n        SCons.Script.Interactive.interact(fs, OptionsParser, options,\n                                          targets, target_top)\n\n    else:\n\n        # Build the targets\n        nodes = _build_targets(fs, options, targets, target_top)\n        if not nodes:\n            revert_io()\n            print('Found nothing to build')\n            exit_status = 2\n\ndef _build_targets(fs, options, targets, target_top):\n\n    global this_build_status\n    this_build_status = 0\n\n    progress_display.set_mode(not (options.no_progress or options.silent))\n    display.set_mode(not options.silent)\n    SCons.Action.print_actions          = not options.silent\n    SCons.Action.execute_actions        = not options.no_exec\n    SCons.Node.do_store_info            = not options.no_exec\n    SCons.SConf.dryrun                  = options.no_exec\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    SCons.CacheDir.cache_enabled = not options.cache_disable\n    SCons.CacheDir.cache_readonly = options.cache_readonly\n    SCons.CacheDir.cache_debug = options.cache_debug\n    SCons.CacheDir.cache_force = options.cache_force\n    SCons.CacheDir.cache_show = options.cache_show\n\n    if options.no_exec:\n        CleanTask.execute = CleanTask.show\n    else:\n        CleanTask.execute = CleanTask.remove\n\n    lookup_top = None\n    if targets or SCons.Script.BUILD_TARGETS != SCons.Script._build_plus_default:\n        # They specified targets on the command line or modified\n        # BUILD_TARGETS in the SConscript file(s), so if they used -u,\n        # -U or -D, we have to look up targets relative to the top,\n        # but we build whatever they specified.\n        if target_top:\n            lookup_top = fs.Dir(target_top)\n            target_top = None\n\n        targets = SCons.Script.BUILD_TARGETS\n    else:\n        # There are no targets specified on the command line,\n        # so if they used -u, -U or -D, we may have to restrict\n        # what actually gets built.\n        d = None\n        if target_top:\n            if options.climb_up == 1:\n                # -u, local directory and below\n                target_top = fs.Dir(target_top)\n                lookup_top = target_top\n            elif options.climb_up == 2:\n                # -D, all Default() targets\n                target_top = None\n                lookup_top = None\n            elif options.climb_up == 3:\n                # -U, local SConscript Default() targets\n                target_top = fs.Dir(target_top)\n                def check_dir(x, target_top=target_top):\n                    if hasattr(x, 'cwd') and x.cwd is not None:\n                        cwd = x.cwd.srcnode()\n                        return cwd == target_top\n                    else:\n                        # x doesn't have a cwd, so it's either not a target,\n                        # or not a file, so go ahead and keep it as a default\n                        # target and let the engine sort it out:\n                        return 1\n                d = [tgt for tgt in SCons.Script.DEFAULT_TARGETS if check_dir(tgt)]\n                SCons.Script.DEFAULT_TARGETS[:] = d\n                target_top = None\n                lookup_top = None\n\n        targets = SCons.Script._Get_Default_Targets(d, fs)\n\n    if not targets:\n        sys.stderr.write(\"scons: *** No targets specified and no Default() targets found.  Stop.\\n\")\n        return None\n\n    def Entry(x, ltop=lookup_top, ttop=target_top, fs=fs):\n        if isinstance(x, SCons.Node.Node):\n            node = x\n        else:\n            node = None\n            # Why would ltop be None? Unfortunately this happens.\n            if ltop is None: ltop = ''\n            # Curdir becomes important when SCons is called with -u, -C,\n            # or similar option that changes directory, and so the paths\n            # of targets given on the command line need to be adjusted.\n            curdir = os.path.join(os.getcwd(), str(ltop))\n            for lookup in SCons.Node.arg2nodes_lookups:\n                node = lookup(x, curdir=curdir)\n                if node is not None:\n                    break\n            if node is None:\n                node = fs.Entry(x, directory=ltop, create=1)\n        if ttop and not node.is_under(ttop):\n            if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node):\n                node = ttop\n            else:\n                node = None\n        return node\n\n    nodes = [_f for _f in map(Entry, targets) if _f]\n\n    task_class = BuildTask      # default action is to build targets\n    opening_message = \"Building targets ...\"\n    closing_message = \"done building targets.\"\n    if options.keep_going:\n        failure_message = \"done building targets (errors occurred during build).\"\n    else:\n        failure_message = \"building terminated because of errors.\"\n    if options.question:\n        task_class = QuestionTask\n    try:\n        if options.clean:\n            task_class = CleanTask\n            opening_message = \"Cleaning targets ...\"\n            closing_message = \"done cleaning targets.\"\n            if options.keep_going:\n                failure_message = \"done cleaning targets (errors occurred during clean).\"\n            else:\n                failure_message = \"cleaning terminated because of errors.\"\n    except AttributeError:\n        pass\n\n    task_class.progress = ProgressObject\n\n    if options.random:\n        def order(dependencies):\n            \"\"\"Randomize the dependencies.\"\"\"\n            import random\n            random.shuffle(dependencies)\n            return dependencies\n    else:\n        def order(dependencies):\n            \"\"\"Leave the order of dependencies alone.\"\"\"\n            return dependencies\n\n    if options.taskmastertrace_file == '-':\n        tmtrace = sys.stdout\n    elif options.taskmastertrace_file:\n        tmtrace = open(options.taskmastertrace_file, 'w')\n    else:\n        tmtrace = None\n    taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace)\n\n    # Let the BuildTask objects get at the options to respond to the\n    # various print_* settings, tree_printer list, etc.\n    BuildTask.options = options\n\n\n    is_pypy = platform.python_implementation() == 'PyPy'\n    # As of 3.7, python removed support for threadless platforms.\n    # See https://www.python.org/dev/peps/pep-0011/\n    is_37_or_later = sys.version_info >= (3, 7)\n    python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later\n    # to check if python configured with threads.\n    global num_jobs\n    num_jobs = options.num_jobs\n    jobs = SCons.Job.Jobs(num_jobs, taskmaster)\n    if num_jobs > 1:\n        msg = None\n        if sys.platform == 'win32':\n            msg = fetch_win32_parallel_msg()\n        elif jobs.num_jobs == 1 or not python_has_threads:\n            msg = \"parallel builds are unsupported by this version of Python;\\n\" + \\\n                  \"\\tignoring -j or num_jobs option.\\n\"\n\n        # Nuitka: We know we are not affected.\n        if False and msg:\n            SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg)\n\n    memory_stats.append('before building targets:')\n    count_stats.append(('pre-', 'build'))\n\n    def jobs_postfunc(\n        jobs=jobs,\n        options=options,\n        closing_message=closing_message,\n        failure_message=failure_message\n        ):\n        if jobs.were_interrupted():\n            if not options.no_progress and not options.silent:\n                sys.stderr.write(\"scons: Build interrupted.\\n\")\n            global exit_status\n            global this_build_status\n            exit_status = 2\n            this_build_status = 2\n\n        if this_build_status:\n            progress_display(\"scons: \" + failure_message)\n        else:\n            progress_display(\"scons: \" + closing_message)\n        if not options.no_exec:\n            if jobs.were_interrupted():\n                progress_display(\"scons: writing .sconsign file.\")\n            SCons.SConsign.write()\n\n    progress_display(\"scons: \" + opening_message)\n    jobs.run(postfunc = jobs_postfunc)\n\n    memory_stats.append('after building targets:')\n    count_stats.append(('post-', 'build'))\n\n    return nodes\n\ndef _exec_main(parser, values):\n    sconsflags = os.environ.get('SCONSFLAGS', '')\n    all_args = sconsflags.split() + sys.argv[1:]\n\n    options, args = parser.parse_args(all_args, values)\n\n    if isinstance(options.debug, list) and \"pdb\" in options.debug:\n        import pdb\n        pdb.Pdb().runcall(_main, parser)\n    elif options.profile_file:\n        # compat layer imports \"cProfile\" for us if it's available.\n        from profile import Profile\n\n        prof = Profile()\n        try:\n            prof.runcall(_main, parser)\n        finally:\n            prof.dump_stats(options.profile_file)\n    else:\n        _main(parser)\n\ndef main():\n    global OptionsParser\n    global exit_status\n    global first_command_start\n\n    # Check up front for a Python version we do not support.  We\n    # delay the check for deprecated Python versions until later,\n    # after the SConscript files have been read, in case they\n    # disable that warning.\n    if python_version_unsupported():\n        msg = \"scons: *** SCons version %s does not run under Python version %s.\\n\"\n        sys.stderr.write(msg % (SCons.__version__, python_version_string()))\n        sys.exit(1)\n\n    parts = [\"SCons by Steven Knight et al.:\\n\"]\n    try:\n        import __main__\n        parts.append(version_string(\"script\", __main__))\n    except (ImportError, AttributeError):\n        # On Windows there is no scons.py, so there is no\n        # __main__.__version__, hence there is no script version.\n        pass\n    parts.append(version_string(\"engine\", SCons))\n    parts.append(path_string(\"engine\", SCons))\n    parts.append(\"Copyright (c) 2001 - 2019 The SCons Foundation\")\n    version = ''.join(parts)\n\n    from . import SConsOptions\n    parser = SConsOptions.Parser(version)\n    values = SConsOptions.SConsValues(parser.get_default_values())\n\n    OptionsParser = parser\n\n    try:\n        try:\n            _exec_main(parser, values)\n        finally:\n            revert_io()\n    except SystemExit as s:\n        if s:\n            exit_status = s.code\n    except KeyboardInterrupt:\n        print(\"scons: Build interrupted.\")\n        sys.exit(2)\n    except SyntaxError as e:\n        _scons_syntax_error(e)\n    except SCons.Errors.InternalError:\n        _scons_internal_error()\n    except SCons.Errors.UserError as e:\n        _scons_user_error(e)\n    except SConsPrintHelpException:\n        parser.print_help()\n        exit_status = 0\n    except SCons.Errors.BuildError as e:\n        print(e)\n        exit_status = e.exitstatus\n    except:\n        # An exception here is likely a builtin Python exception Python\n        # code in an SConscript file.  Show them precisely what the\n        # problem was and where it happened.\n        SCons.Script._SConscript.SConscript_exception()\n        sys.exit(2)\n\n    memory_stats.print_stats()\n    count_stats.print_stats()\n\n    if print_objects:\n        SCons.Debug.listLoggedInstances('*')\n        #SCons.Debug.dumpLoggedInstances('*')\n\n    if print_memoizer:\n        SCons.Memoize.Dump(\"Memoizer (memory cache) hits and misses:\")\n\n    # Dump any development debug info that may have been enabled.\n    # These are purely for internal debugging during development, so\n    # there's no need to control them with --debug= options; they're\n    # controlled by changing the source code.\n    SCons.Debug.dump_caller_counts()\n    SCons.Taskmaster.dump_stats()\n\n    if print_time:\n        total_time = time.time() - SCons.Script.start_time\n        if num_jobs == 1:\n            ct = cumulative_command_time\n        else:\n            if last_command_end is None or first_command_start is None:\n                ct = 0.0\n            else:\n                ct = last_command_end - first_command_start\n        scons_time = total_time - sconscript_time - ct\n        print(\"Total build time: %f seconds\"%total_time)\n        print(\"Total SConscript file execution time: %f seconds\"%sconscript_time)\n        print(\"Total SCons execution time: %f seconds\"%scons_time)\n        print(\"Total command execution time: %f seconds\"%ct)\n\n    sys.exit(exit_status)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/SConsOptions.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Script/SConsOptions.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport optparse\nimport re\nimport sys\nimport textwrap\n\nno_hyphen_re = re.compile(r'(\\s+|(?<=[\\w\\!\\\"\\'\\&\\.\\,\\?])-{2,}(?=\\w))')\n\ntry:\n    from gettext import gettext\nexcept ImportError:\n    def gettext(message):\n        return message\n_ = gettext\n\nimport SCons.Node.FS\nimport SCons.Platform.virtualenv\nimport SCons.Warnings\n\nOptionValueError        = optparse.OptionValueError\nSUPPRESS_HELP           = optparse.SUPPRESS_HELP\n\ndiskcheck_all = SCons.Node.FS.diskcheck_types()\n\ndef diskcheck_convert(value):\n    if value is None:\n        return []\n    if not SCons.Util.is_List(value):\n        value = value.split(',')\n    result = []\n    for v in value:\n        v = v.lower()\n        if v == 'all':\n            result = diskcheck_all\n        elif v == 'none':\n            result = []\n        elif v in diskcheck_all:\n            result.append(v)\n        else:\n            raise ValueError(v)\n    return result\n\n\nclass SConsValues(optparse.Values):\n    \"\"\"\n    Holder class for uniform access to SCons options, regardless\n    of whether or not they can be set on the command line or in the\n    SConscript files (using the SetOption() function).\n\n    A SCons option value can originate three different ways:\n\n        1)  set on the command line;\n        2)  set in an SConscript file;\n        3)  the default setting (from the the op.add_option()\n            calls in the Parser() function, below).\n\n    The command line always overrides a value set in a SConscript file,\n    which in turn always overrides default settings.  Because we want\n    to support user-specified options in the SConscript file itself,\n    though, we may not know about all of the options when the command\n    line is first parsed, so we can't make all the necessary precedence\n    decisions at the time the option is configured.\n\n    The solution implemented in this class is to keep these different sets\n    of settings separate (command line, SConscript file, and default)\n    and to override the __getattr__() method to check them in turn.\n    This should allow the rest of the code to just fetch values as\n    attributes of an instance of this class, without having to worry\n    about where they came from.\n\n    Note that not all command line options are settable from SConscript\n    files, and the ones that are must be explicitly added to the\n    \"settable\" list in this class, and optionally validated and coerced\n    in the set_option() method.\n    \"\"\"\n\n    def __init__(self, defaults):\n        self.__dict__['__defaults__'] = defaults\n        self.__dict__['__SConscript_settings__'] = {}\n\n    def __getattr__(self, attr):\n        \"\"\"\n        Fetches an options value, checking first for explicit settings\n        from the command line (which are direct attributes), then the\n        SConscript file settings, then the default values.\n        \"\"\"\n        try:\n            return self.__dict__[attr]\n        except KeyError:\n            try:\n                return self.__dict__['__SConscript_settings__'][attr]\n            except KeyError:\n                try:\n                    return getattr(self.__dict__['__defaults__'], attr)\n                except KeyError:\n                    # Added because with py3 this is a new class,\n                    # not a classic class, and due to the way\n                    # In that case it will create an object without\n                    # __defaults__, and then query for __setstate__\n                    # which will throw an exception of KeyError\n                    # deepcopy() is expecting AttributeError if __setstate__\n                    # is not available.\n                    raise AttributeError(attr)\n\n\n    settable = [\n        'clean',\n        'diskcheck',\n        'duplicate',\n        'help',\n        'implicit_cache',\n        'max_drift',\n        'md5_chunksize',\n        'no_exec',\n        'num_jobs',\n        'random',\n        'stack_size',\n        'warn',\n        'silent'\n    ]\n\n    def set_option(self, name, value):\n        \"\"\"\n        Sets an option from an SConscript file.\n        \"\"\"\n        if name not in self.settable:\n            raise SCons.Errors.UserError(\"This option is not settable from a SConscript file: %s\"%name)\n\n        if name == 'num_jobs':\n            try:\n                value = int(value)\n                if value < 1:\n                    raise ValueError\n            except ValueError:\n                raise SCons.Errors.UserError(\"A positive integer is required: %s\"%repr(value))\n        elif name == 'max_drift':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'duplicate':\n            try:\n                value = str(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"A string is required: %s\"%repr(value))\n            if value not in SCons.Node.FS.Valid_Duplicates:\n                raise SCons.Errors.UserError(\"Not a valid duplication style: %s\" % value)\n            # Set the duplicate style right away so it can affect linking\n            # of SConscript files.\n            SCons.Node.FS.set_duplicate(value)\n        elif name == 'diskcheck':\n            try:\n                value = diskcheck_convert(value)\n            except ValueError as v:\n                raise SCons.Errors.UserError(\"Not a valid diskcheck value: %s\"%v)\n            if 'diskcheck' not in self.__dict__:\n                # No --diskcheck= option was specified on the command line.\n                # Set this right away so it can affect the rest of the\n                # file/Node lookups while processing the SConscript files.\n                SCons.Node.FS.set_diskcheck(value)\n        elif name == 'stack_size':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'md5_chunksize':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\"An integer is required: %s\"%repr(value))\n        elif name == 'warn':\n            if SCons.Util.is_String(value):\n                value = [value]\n            value = self.__SConscript_settings__.get(name, []) + value\n            SCons.Warnings.process_warn_strings(value)\n\n        self.__SConscript_settings__[name] = value\n\n\nclass SConsOption(optparse.Option):\n    def convert_value(self, opt, value):\n        if value is not None:\n            if self.nargs in (1, '?'):\n                return self.check_value(opt, value)\n            else:\n                return tuple([self.check_value(opt, v) for v in value])\n\n    def process(self, opt, value, values, parser):\n\n        # First, convert the value(s) to the right type.  Howl if any\n        # value(s) are bogus.\n        value = self.convert_value(opt, value)\n\n        # And then take whatever action is expected of us.\n        # This is a separate method to make life easier for\n        # subclasses to add new actions.\n        return self.take_action(\n            self.action, self.dest, opt, value, values, parser)\n\n    def _check_nargs_optional(self):\n        if self.nargs == '?' and self._short_opts:\n            fmt = \"option %s: nargs='?' is incompatible with short options\"\n            raise SCons.Errors.UserError(fmt % self._short_opts[0])\n\n    CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_nargs_optional]\n    CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS\n\nclass SConsOptionGroup(optparse.OptionGroup):\n    \"\"\"\n    A subclass for SCons-specific option groups.\n\n    The only difference between this and the base class is that we print\n    the group's help text flush left, underneath their own title but\n    lined up with the normal \"SCons Options\".\n    \"\"\"\n    def format_help(self, formatter):\n        \"\"\"\n        Format an option group's help text, outdenting the title so it's\n        flush with the \"SCons Options\" title we print at the top.\n        \"\"\"\n        formatter.dedent()\n        result = formatter.format_heading(self.title)\n        formatter.indent()\n        result = result + optparse.OptionContainer.format_help(self, formatter)\n        return result\n\nclass SConsOptionParser(optparse.OptionParser):\n    preserve_unknown_options = False\n\n    def error(self, msg):\n        # overridden OptionValueError exception handler\n        self.print_usage(sys.stderr)\n        sys.stderr.write(\"SCons Error: %s\\n\" % msg)\n        sys.exit(2)\n\n    def _process_long_opt(self, rargs, values):\n        \"\"\"\n        SCons-specific processing of long options.\n\n        This is copied directly from the normal\n        optparse._process_long_opt() method, except that, if configured\n        to do so, we catch the exception thrown when an unknown option\n        is encountered and just stick it back on the \"leftover\" arguments\n        for later (re-)processing.\n        \"\"\"\n        arg = rargs.pop(0)\n\n        # Value explicitly attached to arg?  Pretend it's the next\n        # argument.\n        if \"=\" in arg:\n            (opt, next_arg) = arg.split(\"=\", 1)\n            rargs.insert(0, next_arg)\n            had_explicit_value = True\n        else:\n            opt = arg\n            had_explicit_value = False\n\n        try:\n            opt = self._match_long_opt(opt)\n        except optparse.BadOptionError:\n            if self.preserve_unknown_options:\n                # SCons-specific:  if requested, add unknown options to\n                # the \"leftover arguments\" list for later processing.\n                self.largs.append(arg)\n                if had_explicit_value:\n                    # The unknown option will be re-processed later,\n                    # so undo the insertion of the explicit value.\n                    rargs.pop(0)\n                return\n            raise\n\n        option = self._long_opt[opt]\n        if option.takes_value():\n            nargs = option.nargs\n            if nargs == '?':\n                if had_explicit_value:\n                    value = rargs.pop(0)\n                else:\n                    value = option.const\n            elif len(rargs) < nargs:\n                if nargs == 1:\n                    if not option.choices:\n                        self.error(_(\"%s option requires an argument\") % opt)\n                    else:\n                        msg  = _(\"%s option requires an argument \" % opt)\n                        msg += _(\"(choose from %s)\"\n                                 % ', '.join(option.choices))\n                        self.error(msg)\n                else:\n                    self.error(_(\"%s option requires %d arguments\")\n                               % (opt, nargs))\n            elif nargs == 1:\n                value = rargs.pop(0)\n            else:\n                value = tuple(rargs[0:nargs])\n                del rargs[0:nargs]\n\n        elif had_explicit_value:\n            self.error(_(\"%s option does not take a value\") % opt)\n\n        else:\n            value = None\n\n        option.process(opt, value, values, self)\n\n    def reparse_local_options(self):\n        \"\"\"\n        Re-parse the leftover command-line options stored\n        in self.largs, so that any value overridden on the\n        command line is immediately available if the user turns\n        around and does a GetOption() right away.\n\n        We mimic the processing of the single args\n        in the original OptionParser._process_args(), but here we\n        allow exact matches for long-opts only (no partial\n        argument names!).\n\n        Else, this would lead to problems in add_local_option()\n        below. When called from there, we try to reparse the\n        command-line arguments that\n          1. haven't been processed so far (self.largs), but\n          2. are possibly not added to the list of options yet.\n\n        So, when we only have a value for \"--myargument\" yet,\n        a command-line argument of \"--myarg=test\" would set it.\n        Responsible for this behaviour is the method\n        _match_long_opt(), which allows for partial matches of\n        the option name, as long as the common prefix appears to\n        be unique.\n        This would lead to further confusion, because we might want\n        to add another option \"--myarg\" later on (see issue #2929).\n\n        \"\"\"\n        rargs = []\n        largs_restore = []\n        # Loop over all remaining arguments\n        skip = False\n        for l in self.largs:\n            if skip:\n                # Accept all remaining arguments as they are\n                largs_restore.append(l)\n            else:\n                if len(l) > 2 and l[0:2] == \"--\":\n                    # Check long option\n                    lopt = (l,)\n                    if \"=\" in l:\n                        # Split into option and value\n                        lopt = l.split(\"=\", 1)\n\n                    if lopt[0] in self._long_opt:\n                        # Argument is already known\n                        rargs.append('='.join(lopt))\n                    else:\n                        # Not known yet, so reject for now\n                        largs_restore.append('='.join(lopt))\n                else:\n                    if l == \"--\" or l == \"-\":\n                        # Stop normal processing and don't\n                        # process the rest of the command-line opts\n                        largs_restore.append(l)\n                        skip = True\n                    else:\n                        rargs.append(l)\n\n        # Parse the filtered list\n        self.parse_args(rargs, self.values)\n        # Restore the list of remaining arguments for the\n        # next call of AddOption/add_local_option...\n        self.largs = self.largs + largs_restore\n\n    def add_local_option(self, *args, **kw):\n        \"\"\"\n        Adds a local option to the parser.\n\n        This is initiated by a SetOption() call to add a user-defined\n        command-line option.  We add the option to a separate option\n        group for the local options, creating the group if necessary.\n        \"\"\"\n        try:\n            group = self.local_option_group\n        except AttributeError:\n            group = SConsOptionGroup(self, 'Local Options')\n            group = self.add_option_group(group)\n            self.local_option_group = group\n\n        result = group.add_option(*args, **kw)\n\n        if result:\n            # The option was added successfully.  We now have to add the\n            # default value to our object that holds the default values\n            # (so that an attempt to fetch the option's attribute will\n            # yield the default value when not overridden) and then\n            # we re-parse the leftover command-line options, so that\n            # any value overridden on the command line is immediately\n            # available if the user turns around and does a GetOption()\n            # right away.\n            setattr(self.values.__defaults__, result.dest, result.default)\n            self.reparse_local_options()\n\n        return result\n\nclass SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter):\n    def format_usage(self, usage):\n        return \"usage: %s\\n\" % usage\n\n    def format_heading(self, heading):\n        \"\"\"\n        This translates any heading of \"options\" or \"Options\" into\n        \"SCons Options.\"  Unfortunately, we have to do this here,\n        because those titles are hard-coded in the optparse calls.\n        \"\"\"\n        if heading == 'Options':\n            heading = \"SCons Options\"\n        return optparse.IndentedHelpFormatter.format_heading(self, heading)\n\n    def format_option(self, option):\n        \"\"\"\n        A copy of the normal optparse.IndentedHelpFormatter.format_option()\n        method.  This has been snarfed so we can modify text wrapping to\n        out liking:\n\n        --  add our own regular expression that doesn't break on hyphens\n            (so things like --no-print-directory don't get broken);\n\n        --  wrap the list of options themselves when it's too long\n            (the wrapper.fill(opts) call below);\n\n        --  set the subsequent_indent when wrapping the help_text.\n        \"\"\"\n        # The help for each option consists of two parts:\n        #   * the opt strings and metavars\n        #     eg. (\"-x\", or \"-fFILENAME, --file=FILENAME\")\n        #   * the user-supplied help string\n        #     eg. (\"turn on expert mode\", \"read data from FILENAME\")\n        #\n        # If possible, we write both of these on the same line:\n        #   -x      turn on expert mode\n        #\n        # But if the opt string list is too long, we put the help\n        # string on a second line, indented to the same column it would\n        # start in if it fit on the first line.\n        #   -fFILENAME, --file=FILENAME\n        #           read data from FILENAME\n        result = []\n\n        opts = self.option_strings[option]\n        opt_width = self.help_position - self.current_indent - 2\n        if len(opts) > opt_width:\n            wrapper = textwrap.TextWrapper(width=self.width,\n                                           initial_indent = '  ',\n                                           subsequent_indent = '  ')\n            wrapper.wordsep_re = no_hyphen_re\n            opts = wrapper.fill(opts) + '\\n'\n            indent_first = self.help_position\n        else:                       # start help on same line as opts\n            opts = \"%*s%-*s  \" % (self.current_indent, \"\", opt_width, opts)\n            indent_first = 0\n        result.append(opts)\n        if option.help:\n\n            help_text = self.expand_default(option)\n\n            # SCons:  indent every line of the help text but the first.\n            wrapper = textwrap.TextWrapper(width=self.help_width,\n                                           subsequent_indent = '  ')\n            wrapper.wordsep_re = no_hyphen_re\n            help_lines = wrapper.wrap(help_text)\n            result.append(\"%*s%s\\n\" % (indent_first, \"\", help_lines[0]))\n            for line in help_lines[1:]:\n                result.append(\"%*s%s\\n\" % (self.help_position, \"\", line))\n        elif opts[-1] != \"\\n\":\n            result.append(\"\\n\")\n        return \"\".join(result)\n\ndef Parser(version):\n    \"\"\"\n    Returns an options parser object initialized with the standard\n    SCons options.\n    \"\"\"\n\n    formatter = SConsIndentedHelpFormatter(max_help_position=30)\n\n    op = SConsOptionParser(option_class=SConsOption,\n                           add_help_option=False,\n                           formatter=formatter,\n                           usage=\"usage: scons [OPTION] [TARGET] ...\",)\n\n    op.preserve_unknown_options = True\n    op.version = version\n\n    # Add the options to the parser we just created.\n    #\n    # These are in the order we want them to show up in the -H help\n    # text, basically alphabetical.  Each op.add_option() call below\n    # should have a consistent format:\n    #\n    #   op.add_option(\"-L\", \"--long-option-name\",\n    #                 nargs=1, type=\"string\",\n    #                 dest=\"long_option_name\", default='foo',\n    #                 action=\"callback\", callback=opt_long_option,\n    #                 help=\"help text goes here\",\n    #                 metavar=\"VAR\")\n    #\n    # Even though the optparse module constructs reasonable default\n    # destination names from the long option names, we're going to be\n    # explicit about each one for easier readability and so this code\n    # will at least show up when grepping the source for option attribute\n    # names, or otherwise browsing the source code.\n\n    # options ignored for compatibility\n    def opt_ignore(option, opt, value, parser):\n        sys.stderr.write(\"Warning:  ignoring %s option\\n\" % opt)\n    op.add_option(\"-b\", \"-d\", \"-e\", \"-m\", \"-S\", \"-t\", \"-w\",\n                  \"--environment-overrides\",\n                  \"--no-keep-going\",\n                  \"--no-print-directory\",\n                  \"--print-directory\",\n                  \"--stop\",\n                  \"--touch\",\n                  action=\"callback\", callback=opt_ignore,\n                  help=\"Ignored for compatibility.\")\n\n    op.add_option('-c', '--clean', '--remove',\n                  dest=\"clean\", default=False,\n                  action=\"store_true\",\n                  help=\"Remove specified targets and dependencies.\")\n\n    op.add_option('-C', '--directory',\n                  nargs=1, type=\"string\",\n                  dest=\"directory\", default=[],\n                  action=\"append\",\n                  help=\"Change to DIR before doing anything.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--cache-debug',\n                  nargs=1,\n                  dest=\"cache_debug\", default=None,\n                  action=\"store\",\n                  help=\"Print CacheDir debug info to FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('--cache-disable', '--no-cache',\n                  dest='cache_disable', default=False,\n                  action=\"store_true\",\n                  help=\"Do not retrieve built targets from CacheDir.\")\n\n    op.add_option('--cache-force', '--cache-populate',\n                  dest='cache_force', default=False,\n                  action=\"store_true\",\n                  help=\"Copy already-built targets into the CacheDir.\")\n\n    op.add_option('--cache-readonly',\n                  dest='cache_readonly', default=False,\n                  action=\"store_true\",\n                  help=\"Do not update CacheDir with built targets.\")\n\n    op.add_option('--cache-show',\n                  dest='cache_show', default=False,\n                  action=\"store_true\",\n                  help=\"Print build actions for files from CacheDir.\")\n\n    def opt_invalid(group, value, options):\n        \"\"\"report an invalid option from a group\"\"\"\n        errmsg  = \"`%s' is not a valid %s option type, try:\\n\" % (value, group)\n        return errmsg + \"    %s\" % \", \".join(options)\n\n    def opt_invalid_rm(group, value, msg):\n        \"\"\"report an invalid option from a group: recognized but removed\"\"\"\n        errmsg  = \"`%s' is not a valid %s option type \" % (value, group)\n        return errmsg + msg\n\n    config_options = [\"auto\", \"force\" ,\"cache\"]\n\n    opt_config_help = \"Controls Configure subsystem: %s.\" \\\n                      % \", \".join(config_options)\n\n    op.add_option('--config',\n                  nargs=1, choices=config_options,\n                  dest=\"config\", default=\"auto\",\n                  help = opt_config_help,\n                  metavar=\"MODE\")\n\n    op.add_option('-D',\n                  dest=\"climb_up\", default=None,\n                  action=\"store_const\", const=2,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build all Default() targets.\")\n\n    deprecated_debug_options = {}\n\n    removed_debug_options = {\n        \"dtree\"         : '; please use --tree=derived instead',\n        \"nomemoizer\"    : '; there is no replacement',\n        \"stree\"         : '; please use --tree=all,status instead',\n        \"tree\"          : '; please use --tree=all instead',\n    }\n\n    debug_options = [\"count\", \"duplicate\", \"explain\", \"findlibs\",\n                     \"includes\", \"memoizer\", \"memory\", \"objects\",\n                     \"pdb\", \"prepare\", \"presub\", \"stacktrace\",\n                     \"time\", \"action-timestamps\"]\n\n    def opt_debug(option, opt, value__, parser,\n                  debug_options=debug_options,\n                  deprecated_debug_options=deprecated_debug_options,\n                  removed_debug_options=removed_debug_options):\n        for value in value__.split(','):\n            if value in debug_options:\n                parser.values.debug.append(value)\n            elif value in deprecated_debug_options:\n                parser.values.debug.append(value)\n                try:\n                    parser.values.delayed_warnings\n                except AttributeError:\n                    parser.values.delayed_warnings = []\n                msg = deprecated_debug_options[value]\n                w = \"The --debug=%s option is deprecated%s.\" % (value, msg)\n                t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)\n                parser.values.delayed_warnings.append(t)\n            elif value in removed_debug_options:\n                msg = removed_debug_options[value]\n                raise OptionValueError(opt_invalid_rm('debug', value, msg))\n            else:\n                raise OptionValueError(opt_invalid('debug', value, debug_options))\n\n    opt_debug_help = \"Print various types of debugging information: %s.\" \\\n                     % \", \".join(debug_options)\n    op.add_option('--debug',\n                  nargs=1, type=\"string\",\n                  dest=\"debug\", default=[],\n                  action=\"callback\", callback=opt_debug,\n                  help=opt_debug_help,\n                  metavar=\"TYPE\")\n\n    def opt_diskcheck(option, opt, value, parser):\n        try:\n            diskcheck_value = diskcheck_convert(value)\n        except ValueError as e:\n            raise OptionValueError(\"`%s' is not a valid diskcheck type\" % e)\n        setattr(parser.values, option.dest, diskcheck_value)\n\n    op.add_option('--diskcheck',\n                  nargs=1, type=\"string\",\n                  dest='diskcheck', default=None,\n                  action=\"callback\", callback=opt_diskcheck,\n                  help=\"Enable specific on-disk checks.\",\n                  metavar=\"TYPE\")\n\n    def opt_duplicate(option, opt, value, parser):\n        if value not in SCons.Node.FS.Valid_Duplicates:\n            raise OptionValueError(opt_invalid('duplication', value,\n                                              SCons.Node.FS.Valid_Duplicates))\n        setattr(parser.values, option.dest, value)\n        # Set the duplicate style right away so it can affect linking\n        # of SConscript files.\n        SCons.Node.FS.set_duplicate(value)\n\n    opt_duplicate_help = \"Set the preferred duplication methods. Must be one of \" \\\n                         + \", \".join(SCons.Node.FS.Valid_Duplicates)\n\n    op.add_option('--duplicate',\n                  nargs=1, type=\"string\",\n                  dest=\"duplicate\", default='hard-soft-copy',\n                  action=\"callback\", callback=opt_duplicate,\n                  help=opt_duplicate_help)\n\n    if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:\n        op.add_option('--enable-virtualenv',\n                     dest=\"enable_virtualenv\",\n                     action=\"store_true\",\n                     help=\"Import certain virtualenv variables to SCons\")\n\n    op.add_option('-f', '--file', '--makefile', '--sconstruct',\n                  nargs=1, type=\"string\",\n                  dest=\"file\", default=[],\n                  action=\"append\",\n                  help=\"Read FILE as the top-level SConstruct file.\")\n\n    op.add_option('-h', '--help',\n                  dest=\"help\", default=False,\n                  action=\"store_true\",\n                  help=\"Print defined help message, or this one.\")\n\n    op.add_option(\"-H\", \"--help-options\",\n                  action=\"help\",\n                  help=\"Print this message and exit.\")\n\n    op.add_option('-i', '--ignore-errors',\n                  dest='ignore_errors', default=False,\n                  action=\"store_true\",\n                  help=\"Ignore errors from build actions.\")\n\n    op.add_option('-I', '--include-dir',\n                  nargs=1,\n                  dest='include_dir', default=[],\n                  action=\"append\",\n                  help=\"Search DIR for imported Python modules.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--ignore-virtualenv',\n                 dest=\"ignore_virtualenv\",\n                 action=\"store_true\",\n                 help=\"Do not import virtualenv variables to SCons\")\n\n    op.add_option('--implicit-cache',\n                  dest='implicit_cache', default=False,\n                  action=\"store_true\",\n                  help=\"Cache implicit dependencies\")\n\n    def opt_implicit_deps(option, opt, value, parser):\n        setattr(parser.values, 'implicit_cache', True)\n        setattr(parser.values, option.dest, True)\n\n    op.add_option('--implicit-deps-changed',\n                  dest=\"implicit_deps_changed\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore cached implicit dependencies.\")\n\n    op.add_option('--implicit-deps-unchanged',\n                  dest=\"implicit_deps_unchanged\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore changes in implicit dependencies.\")\n\n    op.add_option('--interact', '--interactive',\n                  dest='interactive', default=False,\n                  action=\"store_true\",\n                  help=\"Run in interactive mode.\")\n\n    op.add_option('-j', '--jobs',\n                  nargs=1, type=\"int\",\n                  dest=\"num_jobs\", default=1,\n                  action=\"store\",\n                  help=\"Allow N jobs at once.\",\n                  metavar=\"N\")\n\n    op.add_option('-k', '--keep-going',\n                  dest='keep_going', default=False,\n                  action=\"store_true\",\n                  help=\"Keep going when a target can't be made.\")\n\n    op.add_option('--max-drift',\n                  nargs=1, type=\"int\",\n                  dest='max_drift', default=SCons.Node.FS.default_max_drift,\n                  action=\"store\",\n                  help=\"Set maximum system clock drift to N seconds.\",\n                  metavar=\"N\")\n\n    op.add_option('--md5-chunksize',\n                  nargs=1, type=\"int\",\n                  dest='md5_chunksize', default=SCons.Node.FS.File.md5_chunksize,\n                  action=\"store\",\n                  help=\"Set chunk-size for MD5 signature computation to N kilobytes.\",\n                  metavar=\"N\")\n\n    op.add_option('-n', '--no-exec', '--just-print', '--dry-run', '--recon',\n                  dest='no_exec', default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; just print commands.\")\n\n    op.add_option('--no-site-dir',\n                  dest='no_site_dir', default=False,\n                  action=\"store_true\",\n                  help=\"Don't search or use the usual site_scons dir.\")\n\n    op.add_option('--profile',\n                  nargs=1,\n                  dest=\"profile_file\", default=None,\n                  action=\"store\",\n                  help=\"Profile SCons and put results in FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('-q', '--question',\n                  dest=\"question\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; exit status says if up to date.\")\n\n    op.add_option('-Q',\n                  dest='no_progress', default=False,\n                  action=\"store_true\",\n                  help=\"Suppress \\\"Reading/Building\\\" progress messages.\")\n\n    op.add_option('--random',\n                  dest=\"random\", default=False,\n                  action=\"store_true\",\n                  help=\"Build dependencies in random order.\")\n\n    op.add_option('-s', '--silent', '--quiet',\n                  dest=\"silent\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't print commands.\")\n\n    op.add_option('--site-dir',\n                  nargs=1,\n                  dest='site_dir', default=None,\n                  action=\"store\",\n                  help=\"Use DIR instead of the usual site_scons dir.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--stack-size',\n                  nargs=1, type=\"int\",\n                  dest='stack_size',\n                  action=\"store\",\n                  help=\"Set the stack size of the threads used to run jobs to N kilobytes.\",\n                  metavar=\"N\")\n\n    op.add_option('--taskmastertrace',\n                  nargs=1,\n                  dest=\"taskmastertrace_file\", default=None,\n                  action=\"store\",\n                  help=\"Trace Node evaluation to FILE.\",\n                  metavar=\"FILE\")\n\n    tree_options = [\"all\", \"derived\", \"prune\", \"status\"]\n\n    def opt_tree(option, opt, value, parser, tree_options=tree_options):\n        from . import Main\n        tp = Main.TreePrinter()\n        for o in value.split(','):\n            if o == 'all':\n                tp.derived = False\n            elif o == 'derived':\n                tp.derived = True\n            elif o == 'prune':\n                tp.prune = True\n            elif o == 'status':\n                tp.status = True\n            else:\n                raise OptionValueError(opt_invalid('--tree', o, tree_options))\n        parser.values.tree_printers.append(tp)\n\n    opt_tree_help = \"Print a dependency tree in various formats: %s.\" \\\n                    % \", \".join(tree_options)\n\n    op.add_option('--tree',\n                  nargs=1, type=\"string\",\n                  dest=\"tree_printers\", default=[],\n                  action=\"callback\", callback=opt_tree,\n                  help=opt_tree_help,\n                  metavar=\"OPTIONS\")\n\n    op.add_option('-u', '--up', '--search-up',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=1,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build targets at or below current directory.\")\n\n    op.add_option('-U',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=3,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build Default() targets from local SConscript.\")\n\n    def opt_version(option, opt, value, parser):\n        sys.stdout.write(parser.version + '\\n')\n        sys.exit(0)\n    op.add_option(\"-v\", \"--version\",\n                  action=\"callback\", callback=opt_version,\n                  help=\"Print the SCons version number and exit.\")\n\n    def opt_warn(option, opt, value, parser, tree_options=tree_options):\n        if SCons.Util.is_String(value):\n            value = value.split(',')\n        parser.values.warn.extend(value)\n\n    op.add_option('--warn', '--warning',\n                  nargs=1, type=\"string\",\n                  dest=\"warn\", default=[],\n                  action=\"callback\", callback=opt_warn,\n                  help=\"Enable or disable warnings.\",\n                  metavar=\"WARNING-SPEC\")\n\n    op.add_option('-Y', '--repository', '--srcdir',\n                  nargs=1,\n                  dest=\"repository\", default=[],\n                  action=\"append\",\n                  help=\"Search REPOSITORY for source and target files.\")\n\n\n    # Options from Make and Cons classic that we do not yet support,\n    # but which we may support someday and whose (potential) meanings\n    # we don't want to change.  These all get a \"the -X option is not\n    # yet implemented\" message and don't show up in the help output.\n\n    def opt_not_yet(option, opt, value, parser):\n        msg = \"Warning:  the %s option is not yet implemented\\n\" % opt\n        sys.stderr.write(msg)\n\n    op.add_option('-l', '--load-average', '--max-load',\n                  nargs=1, type=\"float\",\n                  dest=\"load_average\", default=0,\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"store\",\n                  # help=\"Don't start multiple jobs unless load is below \"\n                  #      \"LOAD-AVERAGE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-actions',\n                  dest=\"list_actions\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and build actions.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-derived',\n                  dest=\"list_derived\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files that would be built.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-where',\n                  dest=\"list_where\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and where defined.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-o', '--old-file', '--assume-old',\n                  nargs=1, type=\"string\",\n                  dest=\"old_file\", default=[],\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"append\",\n                  # help = \"Consider FILE to be old; don't rebuild it.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--override',\n                  nargs=1, type=\"string\",\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"override\",\n                  # help=\"Override variables as specified in FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-p',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"p\",\n                  # help=\"Print internal environments/objects.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-r', '-R', '--no-builtin-rules', '--no-builtin-variables',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"no_builtin_rules\",\n                  # help=\"Clear default environments and variables.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--write-filenames',\n                  nargs=1, type=\"string\",\n                  dest=\"write_filenames\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Write all filenames examined into FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-W', '--new-file', '--assume-new', '--what-if',\n                  nargs=1, type=\"string\",\n                  dest=\"new_file\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Consider FILE to be changed.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--warn-undefined-variables',\n                  dest=\"warn_undefined_variables\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Warn when an undefined variable is referenced.\"\n                  help=SUPPRESS_HELP)\n    return op\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/SConscript.py",
    "content": "\"\"\"SCons.Script.SConscript\n\nThis module defines the Python API provided to SConscript and SConstruct\nfiles.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Script/SConscript.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.Script.Main\nimport SCons.Tool\nfrom SCons.Util import is_List, is_String, is_Dict, flatten\n\nfrom . import Main\n\nimport collections\nimport os\nimport os.path\nimport re\nimport sys\nimport traceback\nimport time\n\nclass SConscriptReturn(Exception):\n    pass\n\nlaunch_dir = os.path.abspath(os.curdir)\n\nGlobalDict = None\n\n# global exports set by Export():\nglobal_exports = {}\n\n# chdir flag\nsconscript_chdir = 1\n\ndef get_calling_namespaces():\n    \"\"\"Return the locals and globals for the function that called\n    into this module in the current call stack.\"\"\"\n    try: 1//0\n    except ZeroDivisionError:\n        # Don't start iterating with the current stack-frame to\n        # prevent creating reference cycles (f_back is safe).\n        frame = sys.exc_info()[2].tb_frame.f_back\n\n    # Find the first frame that *isn't* from this file.  This means\n    # that we expect all of the SCons frames that implement an Export()\n    # or SConscript() call to be in this file, so that we can identify\n    # the first non-Script.SConscript frame as the user's local calling\n    # environment, and the locals and globals dictionaries from that\n    # frame as the calling namespaces.  See the comment below preceding\n    # the DefaultEnvironmentCall block for even more explanation.\n    while frame.f_globals.get(\"__name__\") == __name__:\n        frame = frame.f_back\n\n    return frame.f_locals, frame.f_globals\n\n\ndef compute_exports(exports):\n    \"\"\"Compute a dictionary of exports given one of the parameters\n    to the Export() function or the exports argument to SConscript().\"\"\"\n\n    loc, glob = get_calling_namespaces()\n\n    retval = {}\n    try:\n        for export in exports:\n            if is_Dict(export):\n                retval.update(export)\n            else:\n                try:\n                    retval[export] = loc[export]\n                except KeyError:\n                    retval[export] = glob[export]\n    except KeyError as x:\n        raise SCons.Errors.UserError(\"Export of non-existent variable '%s'\"%x)\n\n    return retval\n\nclass Frame(object):\n    \"\"\"A frame on the SConstruct/SConscript call stack\"\"\"\n    def __init__(self, fs, exports, sconscript):\n        self.globals = BuildDefaultGlobals()\n        self.retval = None\n        self.prev_dir = fs.getcwd()\n        self.exports = compute_exports(exports)  # exports from the calling SConscript\n        # make sure the sconscript attr is a Node.\n        if isinstance(sconscript, SCons.Node.Node):\n            self.sconscript = sconscript\n        elif sconscript == '-':\n            self.sconscript = None\n        else:\n            self.sconscript = fs.File(str(sconscript))\n\n# the SConstruct/SConscript call stack:\ncall_stack = []\n\n# For documentation on the methods in this file, see the scons man-page\n\ndef Return(*vars, **kw):\n    retval = []\n    try:\n        fvars = flatten(vars)\n        for var in fvars:\n            for v in var.split():\n                retval.append(call_stack[-1].globals[v])\n    except KeyError as x:\n        raise SCons.Errors.UserError(\"Return of non-existent variable '%s'\"%x)\n\n    if len(retval) == 1:\n        call_stack[-1].retval = retval[0]\n    else:\n        call_stack[-1].retval = tuple(retval)\n\n    stop = kw.get('stop', True)\n\n    if stop:\n        raise SConscriptReturn\n\n\nstack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)\n\ndef handle_missing_SConscript(f, must_exist=None):\n    \"\"\"Take appropriate action on missing file in SConscript() call.\n\n    Print a warning or raise an exception on missing file.\n    On first warning, print a deprecation message.\n\n    Args:\n        f (str): path of missing configuration file\n        must_exist (bool): raise exception if file does not exist\n\n    Raises:\n        UserError if 'must_exist' is True or if global\n          SCons.Script._no_missing_sconscript is True.\n    \"\"\"\n\n    if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False):\n        msg = \"Fatal: missing SConscript '%s'\" % f.get_internal_path()\n        raise SCons.Errors.UserError(msg)\n\n    if SCons.Script._warn_missing_sconscript_deprecated:\n        msg = \"Calling missing SConscript without error is deprecated.\\n\" + \\\n              \"Transition by adding must_exist=0 to SConscript calls.\\n\" + \\\n              \"Missing SConscript '%s'\" % f.get_internal_path()\n        SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)\n        SCons.Script._warn_missing_sconscript_deprecated = False\n    else:\n        msg = \"Ignoring missing SConscript '%s'\" % f.get_internal_path()\n        SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)\n\ndef _SConscript(fs, *files, **kw):\n    top = fs.Top\n    sd = fs.SConstruct_dir.rdir()\n    exports = kw.get('exports', [])\n\n    # evaluate each SConscript file\n    results = []\n    for fn in files:\n        call_stack.append(Frame(fs, exports, fn))\n        old_sys_path = sys.path\n        try:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1\n            if fn == \"-\":\n                exec(sys.stdin.read(), call_stack[-1].globals)\n            else:\n                if isinstance(fn, SCons.Node.Node):\n                    f = fn\n                else:\n                    f = fs.File(str(fn))\n                _file_ = None\n\n                # Change directory to the top of the source\n                # tree to make sure the os's cwd and the cwd of\n                # fs match so we can open the SConscript.\n                fs.chdir(top, change_os_dir=1)\n                if f.rexists():\n                    actual = f.rfile()\n                    _file_ = open(actual.get_abspath(), \"rb\")\n                elif f.srcnode().rexists():\n                    actual = f.srcnode().rfile()\n                    _file_ = open(actual.get_abspath(), \"rb\")\n                elif f.has_src_builder():\n                    # The SConscript file apparently exists in a source\n                    # code management system.  Build it, but then clear\n                    # the builder so that it doesn't get built *again*\n                    # during the actual build phase.\n                    f.build()\n                    f.built()\n                    f.builder_set(None)\n                    if f.exists():\n                        _file_ = open(f.get_abspath(), \"rb\")\n                if _file_:\n                    # Chdir to the SConscript directory.  Use a path\n                    # name relative to the SConstruct file so that if\n                    # we're using the -f option, we're essentially\n                    # creating a parallel SConscript directory structure\n                    # in our local directory tree.\n                    #\n                    # XXX This is broken for multiple-repository cases\n                    # where the SConstruct and SConscript files might be\n                    # in different Repositories.  For now, cross that\n                    # bridge when someone comes to it.\n                    try:\n                        src_dir = kw['src_dir']\n                    except KeyError:\n                        ldir = fs.Dir(f.dir.get_path(sd))\n                    else:\n                        ldir = fs.Dir(src_dir)\n                        if not ldir.is_under(f.dir):\n                            # They specified a source directory, but\n                            # it's above the SConscript directory.\n                            # Do the sensible thing and just use the\n                            # SConcript directory.\n                            ldir = fs.Dir(f.dir.get_path(sd))\n                    try:\n                        fs.chdir(ldir, change_os_dir=sconscript_chdir)\n                    except OSError:\n                        # There was no local directory, so we should be\n                        # able to chdir to the Repository directory.\n                        # Note that we do this directly, not through\n                        # fs.chdir(), because we still need to\n                        # interpret the stuff within the SConscript file\n                        # relative to where we are logically.\n                        fs.chdir(ldir, change_os_dir=0)\n                        os.chdir(actual.dir.get_abspath())\n\n                    # Append the SConscript directory to the beginning\n                    # of sys.path so Python modules in the SConscript\n                    # directory can be easily imported.\n                    sys.path = [ f.dir.get_abspath() ] + sys.path\n\n                    # This is the magic line that actually reads up\n                    # and executes the stuff in the SConscript file.\n                    # The locals for this frame contain the special\n                    # bottom-of-the-stack marker so that any\n                    # exceptions that occur when processing this\n                    # SConscript can base the printed frames at this\n                    # level and not show SCons internals as well.\n                    call_stack[-1].globals.update({stack_bottom:1})\n                    old_file = call_stack[-1].globals.get('__file__')\n                    try:\n                        del call_stack[-1].globals['__file__']\n                    except KeyError:\n                        pass\n                    try:\n                        try:\n                            if Main.print_time:\n                                time1 = time.time()\n                            scriptdata = _file_.read()\n                            scriptname = _file_.name\n                            _file_.close()\n                            exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)\n                        except SConscriptReturn:\n                            pass\n                    finally:\n                        if Main.print_time:\n                            time2 = time.time()\n                            print('SConscript:%s  took %0.3f ms' % (f.get_abspath(), (time2 - time1) * 1000.0))\n\n                        if old_file is not None:\n                            call_stack[-1].globals.update({__file__:old_file})\n                else:\n                    handle_missing_SConscript(f, kw.get('must_exist', None))\n\n        finally:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1\n            sys.path = old_sys_path\n            frame = call_stack.pop()\n            try:\n                fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir)\n            except OSError:\n                # There was no local directory, so chdir to the\n                # Repository directory.  Like above, we do this\n                # directly.\n                fs.chdir(frame.prev_dir, change_os_dir=0)\n                rdir = frame.prev_dir.rdir()\n                rdir._create()  # Make sure there's a directory there.\n                try:\n                    os.chdir(rdir.get_abspath())\n                except OSError as e:\n                    # We still couldn't chdir there, so raise the error,\n                    # but only if actions are being executed.\n                    #\n                    # If the -n option was used, the directory would *not*\n                    # have been created and we should just carry on and\n                    # let things muddle through.  This isn't guaranteed\n                    # to work if the SConscript files are reading things\n                    # from disk (for example), but it should work well\n                    # enough for most configurations.\n                    if SCons.Action.execute_actions:\n                        raise e\n\n            results.append(frame.retval)\n\n    # if we only have one script, don't return a tuple\n    if len(results) == 1:\n        return results[0]\n    else:\n        return tuple(results)\n\ndef SConscript_exception(file=sys.stderr):\n    \"\"\"Print an exception stack trace just for the SConscript file(s).\n    This will show users who have Python errors where the problem is,\n    without cluttering the output with all of the internal calls leading\n    up to where we exec the SConscript.\"\"\"\n    exc_type, exc_value, exc_tb = sys.exc_info()\n    tb = exc_tb\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find our exec statement, so this was actually a bug\n        # in SCons itself.  Show the whole stack.\n        tb = exc_tb\n    stack = traceback.extract_tb(tb)\n    try:\n        type = exc_type.__name__\n    except AttributeError:\n        type = str(exc_type)\n        if type[:11] == \"exceptions.\":\n            type = type[11:]\n    file.write('%s: %s:\\n' % (type, exc_value))\n    for fname, line, func, text in stack:\n        file.write('  File \"%s\", line %d:\\n' % (fname, line))\n        file.write('    %s\\n' % text)\n\ndef annotate(node):\n    \"\"\"Annotate a node with the stack frame describing the\n    SConscript file and line number that created it.\"\"\"\n    tb = sys.exc_info()[2]\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find any exec of an SConscript file: what?!\n        raise SCons.Errors.InternalError(\"could not find SConscript stack frame\")\n    node.creator = traceback.extract_stack(tb)[0]\n\n# The following line would cause each Node to be annotated using the\n# above function.  Unfortunately, this is a *huge* performance hit, so\n# leave this disabled until we find a more efficient mechanism.\n#SCons.Node.Annotate = annotate\n\nclass SConsEnvironment(SCons.Environment.Base):\n    \"\"\"An Environment subclass that contains all of the methods that\n    are particular to the wrapper SCons interface and which aren't\n    (or shouldn't be) part of the build engine itself.\n\n    Note that not all of the methods of this class have corresponding\n    global functions, there are some private methods.\n    \"\"\"\n\n    #\n    # Private methods of an SConsEnvironment.\n    #\n    def _exceeds_version(self, major, minor, v_major, v_minor):\n        \"\"\"Return 1 if 'major' and 'minor' are greater than the version\n        in 'v_major' and 'v_minor', and 0 otherwise.\"\"\"\n        return (major > v_major or (major == v_major and minor > v_minor))\n\n    def _get_major_minor_revision(self, version_string):\n        \"\"\"Split a version string into major, minor and (optionally)\n        revision parts.\n\n        This is complicated by the fact that a version string can be\n        something like 3.2b1.\"\"\"\n        version = version_string.split(' ')[0].split('.')\n        v_major = int(version[0])\n        v_minor = int(re.match(r'\\d+', version[1]).group())\n        if len(version) >= 3:\n            v_revision = int(re.match(r'\\d+', version[2]).group())\n        else:\n            v_revision = 0\n        return v_major, v_minor, v_revision\n\n    def _get_SConscript_filenames(self, ls, kw):\n        \"\"\"\n        Convert the parameters passed to SConscript() calls into a list\n        of files and export variables.  If the parameters are invalid,\n        throws SCons.Errors.UserError. Returns a tuple (l, e) where l\n        is a list of SConscript filenames and e is a list of exports.\n        \"\"\"\n        exports = []\n\n        if len(ls) == 0:\n            try:\n                dirs = kw[\"dirs\"]\n            except KeyError:\n                raise SCons.Errors.UserError(\"Invalid SConscript usage - no parameters\")\n\n            if not is_List(dirs):\n                dirs = [ dirs ]\n            dirs = list(map(str, dirs))\n\n            name = kw.get('name', 'SConscript')\n\n            files = [os.path.join(n, name) for n in dirs]\n\n        elif len(ls) == 1:\n\n            files = ls[0]\n\n        elif len(ls) == 2:\n\n            files   = ls[0]\n            exports = self.Split(ls[1])\n\n        else:\n\n            raise SCons.Errors.UserError(\"Invalid SConscript() usage - too many arguments\")\n\n        if not is_List(files):\n            files = [ files ]\n\n        if kw.get('exports'):\n            exports.extend(self.Split(kw['exports']))\n\n        variant_dir = kw.get('variant_dir')\n        if variant_dir:\n            if len(files) != 1:\n                raise SCons.Errors.UserError(\"Invalid SConscript() usage - can only specify one SConscript with a variant_dir\")\n            duplicate = kw.get('duplicate', 1)\n            src_dir = kw.get('src_dir')\n            if not src_dir:\n                src_dir, fname = os.path.split(str(files[0]))\n                files = [os.path.join(str(variant_dir), fname)]\n            else:\n                if not isinstance(src_dir, SCons.Node.Node):\n                    src_dir = self.fs.Dir(src_dir)\n                fn = files[0]\n                if not isinstance(fn, SCons.Node.Node):\n                    fn = self.fs.File(fn)\n                if fn.is_under(src_dir):\n                    # Get path relative to the source directory.\n                    fname = fn.get_path(src_dir)\n                    files = [os.path.join(str(variant_dir), fname)]\n                else:\n                    files = [fn.get_abspath()]\n                kw['src_dir'] = variant_dir\n            self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n        return (files, exports)\n\n    #\n    # Public methods of an SConsEnvironment.  These get\n    # entry points in the global namespace so they can be called\n    # as global functions.\n    #\n\n    def Configure(self, *args, **kw):\n        if not SCons.Script.sconscript_reading:\n            raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        return SCons.Environment.Base.Configure(self, *args, **kw)\n\n    def Default(self, *targets):\n        SCons.Script._Set_Default_Targets(self, targets)\n\n    def EnsureSConsVersion(self, major, minor, revision=0):\n        \"\"\"Exit abnormally if the SCons version is not late enough.\"\"\"\n        # split string to avoid replacement during build process\n        if SCons.__version__ == '__' + 'VERSION__':\n            SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning,\n                \"EnsureSConsVersion is ignored for development version\")\n            return\n        scons_ver = self._get_major_minor_revision(SCons.__version__)\n        if scons_ver < (major, minor, revision):\n            if revision:\n                scons_ver_string = '%d.%d.%d' % (major, minor, revision)\n            else:\n                scons_ver_string = '%d.%d' % (major, minor)\n            print(\"SCons %s or greater required, but you have SCons %s\" % \\\n                  (scons_ver_string, SCons.__version__))\n            sys.exit(2)\n\n    def EnsurePythonVersion(self, major, minor):\n        \"\"\"Exit abnormally if the Python version is not late enough.\"\"\"\n        if sys.version_info < (major, minor):\n            v = sys.version.split()[0]\n            print(\"Python %d.%d or greater required, but you have Python %s\" %(major,minor,v))\n            sys.exit(2)\n\n    def Exit(self, value=0):\n        sys.exit(value)\n\n    def Export(self, *vars, **kw):\n        for var in vars:\n            global_exports.update(compute_exports(self.Split(var)))\n        global_exports.update(kw)\n\n    def GetLaunchDir(self):\n        global launch_dir\n        return launch_dir\n\n    def GetOption(self, name):\n        name = self.subst(name)\n        return SCons.Script.Main.GetOption(name)\n\n    def Help(self, text, append=False):\n        text = self.subst(text, raw=1)\n        SCons.Script.HelpFunction(text, append=append)\n\n    def Import(self, *vars):\n        try:\n            frame = call_stack[-1]\n            globals = frame.globals\n            exports = frame.exports\n            for var in vars:\n                var = self.Split(var)\n                for v in var:\n                    if v == '*':\n                        globals.update(global_exports)\n                        globals.update(exports)\n                    else:\n                        if v in exports:\n                            globals[v] = exports[v]\n                        else:\n                            globals[v] = global_exports[v]\n        except KeyError as x:\n            raise SCons.Errors.UserError(\"Import of non-existent variable '%s'\"%x)\n\n    def SConscript(self, *ls, **kw):\n        \"\"\"Execute SCons configuration files.\n\n        Parameters:\n            *ls (str or list): configuration file(s) to execute.\n\n        Keyword arguments:\n            dirs (list): execute SConscript in each listed directory.\n            name (str): execute script 'name' (used only with 'dirs').\n            exports (list or dict): locally export variables the\n              called script(s) can import.\n            variant_dir (str): mirror sources needed for the build in\n             a variant directory to allow building in it.\n            duplicate (bool): physically duplicate sources instead of just\n              adjusting paths of derived files (used only with 'variant_dir')\n              (default is True).\n            must_exist (bool): fail if a requested script is missing\n              (default is False, default is deprecated).\n\n        Returns:\n            list of variables returned by the called script\n\n        Raises:\n            UserError: a script is not found and such exceptions are enabled.\n        \"\"\"\n\n        def subst_element(x, subst=self.subst):\n            if SCons.Util.is_List(x):\n                x = list(map(subst, x))\n            else:\n                x = subst(x)\n            return x\n        ls = list(map(subst_element, ls))\n        subst_kw = {}\n        for key, val in kw.items():\n            if is_String(val):\n                val = self.subst(val)\n            elif SCons.Util.is_List(val):\n                val = [self.subst(v) if is_String(v) else v for v in val]\n            subst_kw[key] = val\n\n        files, exports = self._get_SConscript_filenames(ls, subst_kw)\n        subst_kw['exports'] = exports\n        return _SConscript(self.fs, *files, **subst_kw)\n\n    def SConscriptChdir(self, flag):\n        global sconscript_chdir\n        sconscript_chdir = flag\n\n    def SetOption(self, name, value):\n        name = self.subst(name)\n        SCons.Script.Main.SetOption(name, value)\n\n#\n#\n#\nSCons.Environment.Environment = SConsEnvironment\n\ndef Configure(*args, **kw):\n    if not SCons.Script.sconscript_reading:\n        raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n    kw['_depth'] = 1\n    return SCons.SConf.SConf(*args, **kw)\n\n# It's very important that the DefaultEnvironmentCall() class stay in this\n# file, with the get_calling_namespaces() function, the compute_exports()\n# function, the Frame class and the SConsEnvironment.Export() method.\n# These things make up the calling stack leading up to the actual global\n# Export() or SConscript() call that the user issued.  We want to allow\n# users to export local variables that they define, like so:\n#\n#       def func():\n#           x = 1\n#           Export('x')\n#\n# To support this, the get_calling_namespaces() function assumes that\n# the *first* stack frame that's not from this file is the local frame\n# for the Export() or SConscript() call.\n\n_DefaultEnvironmentProxy = None\n\ndef get_DefaultEnvironmentProxy():\n    global _DefaultEnvironmentProxy\n    if not _DefaultEnvironmentProxy:\n        default_env = SCons.Defaults.DefaultEnvironment()\n        _DefaultEnvironmentProxy = SCons.Environment.NoSubstitutionProxy(default_env)\n    return _DefaultEnvironmentProxy\n\nclass DefaultEnvironmentCall(object):\n    \"\"\"A class that implements \"global function\" calls of\n    Environment methods by fetching the specified method from the\n    DefaultEnvironment's class.  Note that this uses an intermediate\n    proxy class instead of calling the DefaultEnvironment method\n    directly so that the proxy can override the subst() method and\n    thereby prevent expansion of construction variables (since from\n    the user's point of view this was called as a global function,\n    with no associated construction environment).\"\"\"\n    def __init__(self, method_name, subst=0):\n        self.method_name = method_name\n        if subst:\n            self.factory = SCons.Defaults.DefaultEnvironment\n        else:\n            self.factory = get_DefaultEnvironmentProxy\n    def __call__(self, *args, **kw):\n        env = self.factory()\n        method = getattr(env, self.method_name)\n        return method(*args, **kw)\n\n\ndef BuildDefaultGlobals():\n    \"\"\"\n    Create a dictionary containing all the default globals for\n    SConstruct and SConscript files.\n    \"\"\"\n\n    global GlobalDict\n    if GlobalDict is None:\n        GlobalDict = {}\n\n        import SCons.Script\n        d = SCons.Script.__dict__\n        def not_a_module(m, d=d, mtype=type(SCons.Script)):\n             return not isinstance(d[m], mtype)\n        for m in filter(not_a_module, dir(SCons.Script)):\n             GlobalDict[m] = d[m]\n\n    return GlobalDict.copy()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/__init__.py",
    "content": "\"\"\"SCons.Script\n\nThis file implements the main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Script/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport time\nstart_time = time.time()\n\nimport collections\nimport os\n\ntry:\n    from StringIO import StringIO\nexcept ImportError:\n    from io import StringIO\n\nimport sys\n\n# Special chicken-and-egg handling of the \"--debug=memoizer\" flag:\n#\n# SCons.Memoize contains a metaclass implementation that affects how\n# the other classes are instantiated.  The Memoizer may add shim methods\n# to classes that have methods that cache computed values in order to\n# count and report the hits and misses.\n#\n# If we wait to enable the Memoization until after we've parsed the\n# command line options normally, it will be too late, because the Memoizer\n# will have already analyzed the classes that it's Memoizing and decided\n# to not add the shims.  So we use a special-case, up-front check for\n# the \"--debug=memoizer\" flag and enable Memoizer before we import any\n# of the other modules that use it.\n\n_args = sys.argv + os.environ.get('SCONSFLAGS', '').split()\nif \"--debug=memoizer\" in _args:\n    import SCons.Memoize\n    import SCons.Warnings\n    try:\n        SCons.Memoize.EnableMemoization()\n    except SCons.Warnings.Warning:\n        # Some warning was thrown.  Arrange for it to be displayed\n        # or not after warnings are configured.\n        from . import Main\n        exc_type, exc_value, tb = sys.exc_info()\n        Main.delayed_warnings.append((exc_type, exc_value))\ndel _args\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Environment\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.Platform.virtualenv\nimport SCons.Scanner\nimport SCons.SConf\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Variables\nimport SCons.Defaults\n\nfrom . import Main\n\nmain                    = Main.main\n\n# The following are global class definitions and variables that used to\n# live directly in this module back before 0.96.90, when it contained\n# a lot of code.  Some SConscript files in widely-distributed packages\n# (Blender is the specific example) actually reached into SCons.Script\n# directly to use some of these.  Rather than break those SConscript\n# files, we're going to propagate these names into the SCons.Script\n# namespace here.\n#\n# Some of these are commented out because it's *really* unlikely anyone\n# used them, but we're going to leave the comment here to try to make\n# it obvious what to do if the situation arises.\nBuildTask               = Main.BuildTask\nCleanTask               = Main.CleanTask\nQuestionTask            = Main.QuestionTask\n#PrintHelp               = Main.PrintHelp\n#SConscriptSettableOptions = Main.SConscriptSettableOptions\n\nAddOption               = Main.AddOption\nPrintHelp               = Main.PrintHelp\nGetOption               = Main.GetOption\nSetOption               = Main.SetOption\nProgress                = Main.Progress\nGetBuildFailures        = Main.GetBuildFailures\n\n#keep_going_on_error     = Main.keep_going_on_error\n#print_dtree             = Main.print_dtree\n#print_explanations      = Main.print_explanations\n#print_includes          = Main.print_includes\n#print_objects           = Main.print_objects\n#print_time              = Main.print_time\n#print_tree              = Main.print_tree\n#memory_stats            = Main.memory_stats\n#ignore_errors           = Main.ignore_errors\n#sconscript_time         = Main.sconscript_time\n#command_time            = Main.command_time\n#exit_status             = Main.exit_status\n#profiling               = Main.profiling\n#repositories            = Main.repositories\n\n#\nfrom . import SConscript\n_SConscript = SConscript\n\ncall_stack              = _SConscript.call_stack\n\n#\nAction                  = SCons.Action.Action\nAddMethod               = SCons.Util.AddMethod\nAllowSubstExceptions    = SCons.Subst.SetAllowableExceptions\nBuilder                 = SCons.Builder.Builder\nConfigure               = _SConscript.Configure\nEnvironment             = SCons.Environment.Environment\n#OptParser               = SCons.SConsOptions.OptParser\nFindPathDirs            = SCons.Scanner.FindPathDirs\nPlatform                = SCons.Platform.Platform\nVirtualenv              = SCons.Platform.virtualenv.Virtualenv\nReturn                  = _SConscript.Return\nScanner                 = SCons.Scanner.Base\nTool                    = SCons.Tool.Tool\nWhereIs                 = SCons.Util.WhereIs\n\n#\nBoolVariable            = SCons.Variables.BoolVariable\nEnumVariable            = SCons.Variables.EnumVariable\nListVariable            = SCons.Variables.ListVariable\nPackageVariable         = SCons.Variables.PackageVariable\nPathVariable            = SCons.Variables.PathVariable\n\n\n# Action factories.\nChmod                   = SCons.Defaults.Chmod\nCopy                    = SCons.Defaults.Copy\nDelete                  = SCons.Defaults.Delete\nMkdir                   = SCons.Defaults.Mkdir\nMove                    = SCons.Defaults.Move\nTouch                   = SCons.Defaults.Touch\n\n# Pre-made, public scanners.\nCScanner                = SCons.Tool.CScanner\n# Nuitka: Avoid unused tools\n# DScanner                = SCons.Tool.DScanner\nDirScanner              = SCons.Defaults.DirScanner\nProgramScanner          = SCons.Tool.ProgramScanner\nSourceFileScanner       = SCons.Tool.SourceFileScanner\n\n# Functions we might still convert to Environment methods.\nCScan                   = SCons.Defaults.CScan\nDefaultEnvironment      = SCons.Defaults.DefaultEnvironment\n\n# Other variables we provide.\nclass TargetList(collections.UserList):\n    def _do_nothing(self, *args, **kw):\n        pass\n    def _add_Default(self, list):\n        self.extend(list)\n    def _clear(self):\n        del self[:]\n\nARGUMENTS               = {}\nARGLIST                 = []\nBUILD_TARGETS           = TargetList()\nCOMMAND_LINE_TARGETS    = []\nDEFAULT_TARGETS         = []\n\n# BUILD_TARGETS can be modified in the SConscript files.  If so, we\n# want to treat the modified BUILD_TARGETS list as if they specified\n# targets on the command line.  To do that, though, we need to know if\n# BUILD_TARGETS was modified through \"official\" APIs or by hand.  We do\n# this by updating two lists in parallel, the documented BUILD_TARGETS\n# list, above, and this internal _build_plus_default targets list which\n# should only have \"official\" API changes.  Then Script/Main.py can\n# compare these two afterwards to figure out if the user added their\n# own targets to BUILD_TARGETS.\n_build_plus_default = TargetList()\n\ndef _Add_Arguments(alist):\n    for arg in alist:\n        a, b = arg.split('=', 1)\n        ARGUMENTS[a] = b\n        ARGLIST.append((a, b))\n\ndef _Add_Targets(tlist):\n    if tlist:\n        COMMAND_LINE_TARGETS.extend(tlist)\n        BUILD_TARGETS.extend(tlist)\n        BUILD_TARGETS._add_Default = BUILD_TARGETS._do_nothing\n        BUILD_TARGETS._clear = BUILD_TARGETS._do_nothing\n        _build_plus_default.extend(tlist)\n        _build_plus_default._add_Default = _build_plus_default._do_nothing\n        _build_plus_default._clear = _build_plus_default._do_nothing\n\ndef _Set_Default_Targets_Has_Been_Called(d, fs):\n    return DEFAULT_TARGETS\n\ndef _Set_Default_Targets_Has_Not_Been_Called(d, fs):\n    if d is None:\n        d = [fs.Dir('.')]\n    return d\n\n_Get_Default_Targets = _Set_Default_Targets_Has_Not_Been_Called\n\ndef _Set_Default_Targets(env, tlist):\n    global DEFAULT_TARGETS\n    global _Get_Default_Targets\n    _Get_Default_Targets = _Set_Default_Targets_Has_Been_Called\n    for t in tlist:\n        if t is None:\n            # Delete the elements from the list in-place, don't\n            # reassign an empty list to DEFAULT_TARGETS, so that the\n            # variables will still point to the same object we point to.\n            del DEFAULT_TARGETS[:]\n            BUILD_TARGETS._clear()\n            _build_plus_default._clear()\n        elif isinstance(t, SCons.Node.Node):\n            DEFAULT_TARGETS.append(t)\n            BUILD_TARGETS._add_Default([t])\n            _build_plus_default._add_Default([t])\n        else:\n            nodes = env.arg2nodes(t, env.fs.Entry)\n            DEFAULT_TARGETS.extend(nodes)\n            BUILD_TARGETS._add_Default(nodes)\n            _build_plus_default._add_Default(nodes)\n\n#\nhelp_text = None\n\ndef HelpFunction(text, append=False):\n    global help_text\n    if help_text is None:\n        if append:\n            s = StringIO()\n            PrintHelp(s)  \n            help_text = s.getvalue()\n            s.close()\n        else:\n            help_text = \"\"\n\n    help_text= help_text + text\n\n\n#\n# Will be non-zero if we are reading an SConscript file.\nsconscript_reading = 0\n\n_no_missing_sconscript = False\n_warn_missing_sconscript_deprecated = True\n\ndef set_missing_sconscript_error(flag=1):\n    \"\"\"Set behavior on missing file in SConscript() call. Returns previous value\"\"\"\n    global _no_missing_sconscript\n    old = _no_missing_sconscript\n    _no_missing_sconscript = flag\n    return old\n\n#\ndef Variables(files=[], args=ARGUMENTS):\n    return SCons.Variables.Variables(files, args)\n\n\n# The list of global functions to add to the SConscript name space\n# that end up calling corresponding methods or Builders in the\n# DefaultEnvironment().\nGlobalDefaultEnvironmentFunctions = [\n    # Methods from the SConsEnvironment class, above.\n    'Default',\n    'EnsurePythonVersion',\n    'EnsureSConsVersion',\n    'Exit',\n    'Export',\n    'GetLaunchDir',\n    'Help',\n    'Import',\n    #'SConscript', is handled separately, below.\n    'SConscriptChdir',\n\n    # Methods from the Environment.Base class.\n    'AddPostAction',\n    'AddPreAction',\n    'Alias',\n    'AlwaysBuild',\n    'CacheDir',\n    'Clean',\n    #The Command() method is handled separately, below.\n    'Decider',\n    'Depends',\n    'Dir',\n    'NoClean',\n    'NoCache',\n    'Entry',\n    'Execute',\n    'File',\n    'FindFile',\n    'FindInstalledFiles',\n    'FindSourceFiles',\n    'Flatten',\n    'GetBuildPath',\n    'Glob',\n    'Ignore',\n    'Install',\n    'InstallAs',\n    'InstallVersionedLib',\n    'Literal',\n    'Local',\n    'ParseDepends',\n    'Precious',\n    'PyPackageDir',\n    'Repository',\n    'Requires',\n    'SConsignFile',\n    'SideEffect',\n    'SourceCode',\n    'Split',\n    'Tag',\n    'Value',\n    'VariantDir',\n]\n\nGlobalDefaultBuilders = [\n    # Supported builders.\n    'CFile',\n    'CXXFile',\n    'DVI',\n    'Jar',\n    'Java',\n    'JavaH',\n    'Library',\n    'LoadableModule',\n    'M4',\n    'MSVSProject',\n    'Object',\n    'PCH',\n    'PDF',\n    'PostScript',\n    'Program',\n    'RES',\n    'RMIC',\n    'SharedLibrary',\n    'SharedObject',\n    'StaticLibrary',\n    'StaticObject',\n    'Substfile',\n    'Tar',\n    'Textfile',\n    'TypeLibrary',\n    'Zip',\n    'Package',\n]\n\nfor name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders:\n    exec (\"%s = _SConscript.DefaultEnvironmentCall(%s)\" % (name, repr(name)))\ndel name\n\n# There are a handful of variables that used to live in the\n# Script/SConscript.py module that some SConscript files out there were\n# accessing directly as SCons.Script.SConscript.*.  The problem is that\n# \"SConscript\" in this namespace is no longer a module, it's a global\n# function call--or more precisely, an object that implements a global\n# function call through the default Environment.  Nevertheless, we can\n# maintain backwards compatibility for SConscripts that were reaching in\n# this way by hanging some attributes off the \"SConscript\" object here.\nSConscript = _SConscript.DefaultEnvironmentCall('SConscript')\n\n# Make SConscript look enough like the module it used to be so\n# that pychecker doesn't barf.\nSConscript.__name__ = 'SConscript'\n\nSConscript.Arguments = ARGUMENTS\nSConscript.ArgList = ARGLIST\nSConscript.BuildTargets = BUILD_TARGETS\nSConscript.CommandLineTargets = COMMAND_LINE_TARGETS\nSConscript.DefaultTargets = DEFAULT_TARGETS\n\n# The global Command() function must be handled differently than the\n# global functions for other construction environment methods because\n# we want people to be able to use Actions that must expand $TARGET\n# and $SOURCE later, when (and if) the Action is invoked to build\n# the target(s).  We do this with the subst=1 argument, which creates\n# a DefaultEnvironmentCall instance that wraps up a normal default\n# construction environment that performs variable substitution, not a\n# proxy that doesn't.\n#\n# There's a flaw here, though, because any other $-variables on a command\n# line will *also* be expanded, each to a null string, but that should\n# only be a problem in the unusual case where someone was passing a '$'\n# on a command line and *expected* the $ to get through to the shell\n# because they were calling Command() and not env.Command()...  This is\n# unlikely enough that we're going to leave this as is and cross that\n# bridge if someone actually comes to it.\nCommand = _SConscript.DefaultEnvironmentCall('Command', subst=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Subst.py",
    "content": "\"\"\"SCons.Subst\n\nSCons string substitution.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Subst.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport collections\nimport re\n\nimport SCons.Errors\n\nfrom SCons.Util import is_String, is_Sequence\n\n# Indexed by the SUBST_* constants below.\n_strconv = [SCons.Util.to_String_for_subst,\n            SCons.Util.to_String_for_subst,\n            SCons.Util.to_String_for_signature]\n\n\n\nAllowableExceptions = (IndexError, NameError)\n\ndef SetAllowableExceptions(*excepts):\n    global AllowableExceptions\n    AllowableExceptions = [_f for _f in excepts if _f]\n\ndef raise_exception(exception, target, s):\n    name = exception.__class__.__name__\n    msg = \"%s `%s' trying to evaluate `%s'\" % (name, exception, s)\n    if target:\n        raise SCons.Errors.BuildError(target[0], msg)\n    else:\n        raise SCons.Errors.UserError(msg)\n\n\n\nclass Literal(object):\n    \"\"\"A wrapper for a string.  If you use this object wrapped\n    around a string, then it will be interpreted as literal.\n    When passed to the command interpreter, all special\n    characters will be escaped.\"\"\"\n    def __init__(self, lstr):\n        self.lstr = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.lstr\n\n    def is_literal(self):\n        return 1\n\n    def __eq__(self, other):\n        if not isinstance(other, Literal):\n            return False\n        return self.lstr == other.lstr\n\n    def __neq__(self, other):\n        return not self.__eq__(other)\n\n    def __hash__(self):\n        return hash(self.lstr)\n\nclass SpecialAttrWrapper(object):\n    \"\"\"This is a wrapper for what we call a 'Node special attribute.'\n    This is any of the attributes of a Node that we can reference from\n    Environment variable substitution, such as $TARGET.abspath or\n    $SOURCES[1].filebase.  We implement the same methods as Literal\n    so we can handle special characters, plus a for_signature method,\n    such that we can return some canonical string during signature\n    calculation to avoid unnecessary rebuilds.\"\"\"\n\n    def __init__(self, lstr, for_signature=None):\n        \"\"\"The for_signature parameter, if supplied, will be the\n        canonical string we return from for_signature().  Else\n        we will simply return lstr.\"\"\"\n        self.lstr = lstr\n        if for_signature:\n            self.forsig = for_signature\n        else:\n            self.forsig = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.forsig\n\n    def is_literal(self):\n        return 1\n\ndef quote_spaces(arg):\n    \"\"\"Generic function for putting double quotes around any string that\n    has white space in it.\"\"\"\n    if ' ' in arg or '\\t' in arg:\n        return '\"%s\"' % arg\n    else:\n        return str(arg)\n\nclass CmdStringHolder(collections.UserString):\n    \"\"\"This is a special class used to hold strings generated by\n    scons_subst() and scons_subst_list().  It defines a special method\n    escape().  When passed a function with an escape algorithm for a\n    particular platform, it will return the contained string with the\n    proper escape sequences inserted.\n    \"\"\"\n    def __init__(self, cmd, literal=None):\n        collections.UserString.__init__(self, cmd)\n        self.literal = literal\n\n    def is_literal(self):\n        return self.literal\n\n    def escape(self, escape_func, quote_func=quote_spaces):\n        \"\"\"Escape the string with the supplied function.  The\n        function is expected to take an arbitrary string, then\n        return it with all special characters escaped and ready\n        for passing to the command interpreter.\n\n        After calling this function, the next call to str() will\n        return the escaped string.\n        \"\"\"\n\n        if self.is_literal():\n            return escape_func(self.data)\n        elif ' ' in self.data or '\\t' in self.data:\n            return quote_func(self.data)\n        else:\n            return self.data\n\ndef escape_list(mylist, escape_func):\n    \"\"\"Escape a list of arguments by running the specified escape_func\n    on every object in the list that has an escape() method.\"\"\"\n    def escape(obj, escape_func=escape_func):\n        try:\n            e = obj.escape\n        except AttributeError:\n            return obj\n        else:\n            return e(escape_func)\n    return list(map(escape, mylist))\n\nclass NLWrapper(object):\n    \"\"\"A wrapper class that delays turning a list of sources or targets\n    into a NodeList until it's needed.  The specified function supplied\n    when the object is initialized is responsible for turning raw nodes\n    into proxies that implement the special attributes like .abspath,\n    .source, etc.  This way, we avoid creating those proxies just\n    \"in case\" someone is going to use $TARGET or the like, and only\n    go through the trouble if we really have to.\n\n    In practice, this might be a wash performance-wise, but it's a little\n    cleaner conceptually...\n    \"\"\"\n\n    def __init__(self, list, func):\n        self.list = list\n        self.func = func\n    def _return_nodelist(self):\n        return self.nodelist\n    def _gen_nodelist(self):\n        mylist = self.list\n        if mylist is None:\n            mylist = []\n        elif not is_Sequence(mylist):\n            mylist = [mylist]\n        # The map(self.func) call is what actually turns\n        # a list into appropriate proxies.\n        self.nodelist = SCons.Util.NodeList(list(map(self.func, mylist)))\n        self._create_nodelist = self._return_nodelist\n        return self.nodelist\n    _create_nodelist = _gen_nodelist\n\n\nclass Targets_or_Sources(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access the list, calling the NLWrapper to create proxies on demand.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.nl._create_nodelist()\n        return nl[i]\n    def __getslice__(self, i, j):\n        nl = self.nl._create_nodelist()\n        i = max(i, 0); j = max(j, 0)\n        return nl[i:j]\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        return str(nl)\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        return repr(nl)\n\nclass Target_or_Source(object):\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access an individual proxy Node, calling the NLWrapper to create\n    a proxy on demand.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        try:\n            nl0 = nl[0]\n        except IndexError:\n            # If there is nothing in the list, then we have no attributes to\n            # pass through, so raise AttributeError for everything.\n            raise AttributeError(\"NodeList has no attribute: %s\" % attr)\n        return getattr(nl0, attr)\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return str(nl[0])\n        return ''\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return repr(nl[0])\n        return ''\n\nclass NullNodeList(SCons.Util.NullSeq):\n  def __call__(self, *args, **kwargs): return ''\n  def __str__(self): return ''\n\nNullNodesList = NullNodeList()\n\ndef subst_dict(target, source):\n    \"\"\"Create a dictionary for substitution of special\n    construction variables.\n\n    This translates the following special arguments:\n\n    target - the target (object or array of objects),\n             used to generate the TARGET and TARGETS\n             construction variables\n\n    source - the source (object or array of objects),\n             used to generate the SOURCES and SOURCE\n             construction variables\n    \"\"\"\n    dict = {}\n\n    if target:\n        def get_tgt_subst_proxy(thing):\n            try:\n                subst_proxy = thing.get_subst_proxy()\n            except AttributeError:\n                subst_proxy = thing # probably a string, just return it\n            return subst_proxy\n        tnl = NLWrapper(target, get_tgt_subst_proxy)\n        dict['TARGETS'] = Targets_or_Sources(tnl)\n        dict['TARGET'] = Target_or_Source(tnl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_TARGETS'] = '$TARGETS'\n        dict['UNCHANGED_TARGETS'] = '$TARGETS'\n    else:\n        dict['TARGETS'] = NullNodesList\n        dict['TARGET'] = NullNodesList\n\n    if source:\n        def get_src_subst_proxy(node):\n            try:\n                rfile = node.rfile\n            except AttributeError:\n                pass\n            else:\n                node = rfile()\n            try:\n                return node.get_subst_proxy()\n            except AttributeError:\n                return node     # probably a String, just return it\n        snl = NLWrapper(source, get_src_subst_proxy)\n        dict['SOURCES'] = Targets_or_Sources(snl)\n        dict['SOURCE'] = Target_or_Source(snl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_SOURCES'] = '$SOURCES'\n        dict['UNCHANGED_SOURCES'] = '$SOURCES'\n    else:\n        dict['SOURCES'] = NullNodesList\n        dict['SOURCE'] = NullNodesList\n\n    return dict\n\n# Constants for the \"mode\" parameter to scons_subst_list() and\n# scons_subst().  SUBST_RAW gives the raw command line.  SUBST_CMD\n# gives a command line suitable for passing to a shell.  SUBST_SIG\n# gives a command line appropriate for calculating the signature\n# of a command line...if this changes, we should rebuild.\nSUBST_CMD = 0\nSUBST_RAW = 1\nSUBST_SIG = 2\n\n_rm = re.compile(r'\\$[()]')\n\n# Note the pattern below only matches $( or $) when there is no\n# preceeding $. (Thus the (?<!\\$))\n_rm_split = re.compile(r'(?<!\\$)(\\$[()])')\n\n# Indexed by the SUBST_* constants above.\n_regex_remove = [ _rm, None, _rm_split ]\n\ndef _rm_list(list):\n    return [l for l in list if l not in ('$(', '$)')]\n\ndef _remove_list(list):\n    result = []\n    depth = 0\n    for l in list:\n        if l == '$(':\n            depth += 1\n        elif l == '$)':\n            depth -= 1\n            if depth < 0:\n                break\n        elif depth == 0:\n            result.append(l)\n    if depth != 0:\n        return None\n    return result\n\n# Indexed by the SUBST_* constants above.\n_list_remove = [ _rm_list, None, _remove_list ]\n\n# Regular expressions for splitting strings and handling substitutions,\n# for use by the scons_subst() and scons_subst_list() functions:\n#\n# The first expression compiled matches all of the $-introduced tokens\n# that we need to process in some way, and is used for substitutions.\n# The expressions it matches are:\n#\n#       \"$$\"\n#       \"$(\"\n#       \"$)\"\n#       \"$variable\"             [must begin with alphabetic or underscore]\n#       \"${any stuff}\"\n#\n# The second expression compiled is used for splitting strings into tokens\n# to be processed, and it matches all of the tokens listed above, plus\n# the following that affect how arguments do or don't get joined together:\n#\n#       \"   \"                   [white space]\n#       \"non-white-space\"       [without any dollar signs]\n#       \"$\"                     [single dollar sign]\n#\n_dollar_exps_str = r'\\$[\\$\\(\\)]|\\$[_a-zA-Z][\\.\\w]*|\\${[^}]*}'\n_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)\n_separate_args = re.compile(r'(%s|\\s+|[^\\s\\$]+|\\$)' % _dollar_exps_str)\n\n# This regular expression is used to replace strings of multiple white\n# space characters in the string result from the scons_subst() function.\n_space_sep = re.compile(r'[\\t ]+(?![^{]*})')\n\ndef scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Expand a string or list containing construction variable\n    substitutions.\n\n    This is the work-horse function for substitutions in file names\n    and the like.  The companion scons_subst_list() function (below)\n    handles separating command lines into lists of arguments, so see\n    that function if that's what you're looking for.\n    \"\"\"\n    if (isinstance(strSubst, str) and '$' not in strSubst) or isinstance(strSubst, CmdStringHolder):\n        return strSubst\n\n    class StringSubber(object):\n        \"\"\"A class to construct the results of a scons_subst() call.\n\n        This binds a specific construction environment, mode, target and\n        source with two methods (substitute() and expand()) that handle\n        the expansion.\n        \"\"\"\n        def __init__(self, env, mode, conv, gvars):\n            self.env = env\n            self.mode = mode\n            self.conv = conv\n            self.gvars = gvars\n\n        def expand(self, s, lvars):\n            \"\"\"Expand a single \"token\" as necessary, returning an\n            appropriate string containing the expansion.\n\n            This handles expanding different types of things (strings,\n            lists, callables) appropriately.  It calls the wrapper\n            substitute() method to re-expand things as necessary, so that\n            the results of expansions of side-by-side strings still get\n            re-evaluated separately, not smushed together.\n            \"\"\"\n            if is_String(s):\n                try:\n                    s0, s1 = s[:2]\n                except (IndexError, ValueError):\n                    return s\n                if s0 != '$':\n                    return s\n                if s1 == '$':\n                    # In this case keep the double $'s which we'll later\n                    # swap for a single dollar sign as we need to retain\n                    # this information to properly avoid matching \"$(\"\" when\n                    # the actual text was \"$$(\"\"  (or \"$)\"\" when \"$$)\"\" )\n                    return '$$'\n                elif s1 in '()':\n                    return s\n                else:\n                    key = s[1:]\n                    if key[0] == '{' or '.' in key:\n                        if key[0] == '{':\n                            key = key[1:-1]\n                        try:\n                            s = eval(key, self.gvars, lvars)\n                        except KeyboardInterrupt:\n                            raise\n                        except Exception as e:\n                            if e.__class__ in AllowableExceptions:\n                                return ''\n                            raise_exception(e, lvars['TARGETS'], s)\n                    else:\n                        if key in lvars:\n                            s = lvars[key]\n                        elif key in self.gvars:\n                            s = self.gvars[key]\n                        elif NameError not in AllowableExceptions:\n                            raise_exception(NameError(key), lvars['TARGETS'], s)\n                        else:\n                            return ''\n\n                    # Before re-expanding the result, handle\n                    # recursive expansion by copying the local\n                    # variable dictionary and overwriting a null\n                    # string for the value of the variable name\n                    # we just expanded.\n                    #\n                    # This could potentially be optimized by only\n                    # copying lvars when s contains more expansions,\n                    # but lvars is usually supposed to be pretty\n                    # small, and deeply nested variable expansions\n                    # are probably more the exception than the norm,\n                    # so it should be tolerable for now.\n                    lv = lvars.copy()\n                    var = key.split('.')[0]\n                    lv[var] = ''\n                    return self.substitute(s, lv)\n            elif is_Sequence(s):\n                def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars):\n                    return conv(substitute(l, lvars))\n                return list(map(func, s))\n            elif callable(s):\n                try:\n                    s = s(target=lvars['TARGETS'],\n                         source=lvars['SOURCES'],\n                         env=self.env,\n                         for_signature=(self.mode != SUBST_CMD))\n                except TypeError:\n                    # This probably indicates that it's a callable\n                    # object that doesn't match our calling arguments\n                    # (like an Action).\n                    if self.mode == SUBST_RAW:\n                        return s\n                    s = self.conv(s)\n                return self.substitute(s, lvars)\n            elif s is None:\n                return ''\n            else:\n                return s\n\n        def substitute(self, args, lvars):\n            \"\"\"Substitute expansions in an argument or list of arguments.\n\n            This serves as a wrapper for splitting up a string into\n            separate tokens.\n            \"\"\"\n            if is_String(args) and not isinstance(args, CmdStringHolder):\n                args = str(args)        # In case it's a UserString.\n                try:\n                    def sub_match(match):\n                        return self.conv(self.expand(match.group(1), lvars))\n                    result = _dollar_exps.sub(sub_match, args)\n                except TypeError:\n                    # If the internal conversion routine doesn't return\n                    # strings (it could be overridden to return Nodes, for\n                    # example), then the 1.5.2 re module will throw this\n                    # exception.  Back off to a slower, general-purpose\n                    # algorithm that works for all data types.\n                    args = _separate_args.findall(args)\n                    result = []\n                    for a in args:\n                        result.append(self.conv(self.expand(a, lvars)))\n                    if len(result) == 1:\n                        result = result[0]\n                    else:\n                        result = ''.join(map(str, result))\n                return result\n            else:\n                return self.expand(args, lvars)\n\n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ss = StringSubber(env, mode, conv, gvars)\n    result = ss.substitute(strSubst, lvars)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    res = result\n    if is_String(result):\n        # Remove $(-$) pairs and any stuff in between,\n        # if that's appropriate.\n        remove = _regex_remove[mode]\n        if remove:\n            if mode == SUBST_SIG:\n                result = _list_remove[mode](remove.split(result))\n                if result is None:\n                    raise SCons.Errors.UserError(\"Unbalanced $(/$) in: \" + res)\n                result = ' '.join(result)\n            else:\n                result = remove.sub('', result)\n        if mode != SUBST_RAW:\n            # Compress strings of white space characters into\n            # a single space.\n            result = _space_sep.sub(' ', result).strip()\n\n        # Now replace escaped $'s currently \"$$\"\n        # This is needed because we now retain $$ instead of\n        # replacing them during substition to avoid\n        # improperly trying to escape \"$$(\" as being \"$(\"\n        result = result.replace('$$','$')\n    elif is_Sequence(result):\n        remove = _list_remove[mode]\n        if remove:\n            result = remove(result)\n            if result is None:\n                raise SCons.Errors.UserError(\"Unbalanced $(/$) in: \" + str(res))\n\n    return result\n\ndef scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Substitute construction variables in a string (or list or other\n    object) and separate the arguments into a command list.\n\n    The companion scons_subst() function (above) handles basic\n    substitutions within strings, so see that function instead\n    if that's what you're looking for.\n    \"\"\"\n    class ListSubber(collections.UserList):\n        \"\"\"A class to construct the results of a scons_subst_list() call.\n\n        Like StringSubber, this class binds a specific construction\n        environment, mode, target and source with two methods\n        (substitute() and expand()) that handle the expansion.\n\n        In addition, however, this class is used to track the state of\n        the result(s) we're gathering so we can do the appropriate thing\n        whenever we have to append another word to the result--start a new\n        line, start a new word, append to the current word, etc.  We do\n        this by setting the \"append\" attribute to the right method so\n        that our wrapper methods only need ever call ListSubber.append(),\n        and the rest of the object takes care of doing the right thing\n        internally.\n        \"\"\"\n        def __init__(self, env, mode, conv, gvars):\n            collections.UserList.__init__(self, [])\n            self.env = env\n            self.mode = mode\n            self.conv = conv\n            self.gvars = gvars\n\n            if self.mode == SUBST_RAW:\n                self.add_strip = lambda x: self.append(x)\n            else:\n                self.add_strip = lambda x: None\n            self.in_strip = None\n            self.next_line()\n\n        def expand(self, s, lvars, within_list):\n            \"\"\"Expand a single \"token\" as necessary, appending the\n            expansion to the current result.\n\n            This handles expanding different types of things (strings,\n            lists, callables) appropriately.  It calls the wrapper\n            substitute() method to re-expand things as necessary, so that\n            the results of expansions of side-by-side strings still get\n            re-evaluated separately, not smushed together.\n            \"\"\"\n\n            if is_String(s):\n                try:\n                    s0, s1 = s[:2]\n                except (IndexError, ValueError):\n                    self.append(s)\n                    return\n                if s0 != '$':\n                    self.append(s)\n                    return\n                if s1 == '$':\n                    self.append('$')\n                elif s1 == '(':\n                    self.open_strip('$(')\n                elif s1 == ')':\n                    self.close_strip('$)')\n                else:\n                    key = s[1:]\n                    if key[0] == '{' or key.find('.') >= 0:\n                        if key[0] == '{':\n                            key = key[1:-1]\n                        try:\n                            s = eval(key, self.gvars, lvars)\n                        except KeyboardInterrupt:\n                            raise\n                        except Exception as e:\n                            if e.__class__ in AllowableExceptions:\n                                return\n                            raise_exception(e, lvars['TARGETS'], s)\n                    else:\n                        if key in lvars:\n                            s = lvars[key]\n                        elif key in self.gvars:\n                            s = self.gvars[key]\n                        elif NameError not in AllowableExceptions:\n                            raise_exception(NameError(), lvars['TARGETS'], s)\n                        else:\n                            return\n\n                    # Before re-expanding the result, handle\n                    # recursive expansion by copying the local\n                    # variable dictionary and overwriting a null\n                    # string for the value of the variable name\n                    # we just expanded.\n                    lv = lvars.copy()\n                    var = key.split('.')[0]\n                    lv[var] = ''\n                    self.substitute(s, lv, 0)\n                    self.this_word()\n            elif is_Sequence(s):\n                for a in s:\n                    self.substitute(a, lvars, 1)\n                    self.next_word()\n            elif callable(s):\n                try:\n                    s = s(target=lvars['TARGETS'],\n                         source=lvars['SOURCES'],\n                         env=self.env,\n                         for_signature=(self.mode != SUBST_CMD))\n                except TypeError:\n                    # This probably indicates that it's a callable\n                    # object that doesn't match our calling arguments\n                    # (like an Action).\n                    if self.mode == SUBST_RAW:\n                        self.append(s)\n                        return\n                    s = self.conv(s)\n                self.substitute(s, lvars, within_list)\n            elif s is None:\n                self.this_word()\n            else:\n                self.append(s)\n\n        def substitute(self, args, lvars, within_list):\n            \"\"\"Substitute expansions in an argument or list of arguments.\n\n            This serves as a wrapper for splitting up a string into\n            separate tokens.\n            \"\"\"\n\n            if is_String(args) and not isinstance(args, CmdStringHolder):\n                args = str(args)        # In case it's a UserString.\n                args = _separate_args.findall(args)\n                for a in args:\n                    if a[0] in ' \\t\\n\\r\\f\\v':\n                        if '\\n' in a:\n                            self.next_line()\n                        elif within_list:\n                            self.append(a)\n                        else:\n                            self.next_word()\n                    else:\n                        self.expand(a, lvars, within_list)\n            else:\n                self.expand(args, lvars, within_list)\n\n        def next_line(self):\n            \"\"\"Arrange for the next word to start a new line.  This\n            is like starting a new word, except that we have to append\n            another line to the result.\"\"\"\n            collections.UserList.append(self, [])\n            self.next_word()\n\n        def this_word(self):\n            \"\"\"Arrange for the next word to append to the end of the\n            current last word in the result.\"\"\"\n            self.append = self.add_to_current_word\n\n        def next_word(self):\n            \"\"\"Arrange for the next word to start a new word.\"\"\"\n            self.append = self.add_new_word\n\n        def add_to_current_word(self, x):\n            \"\"\"Append the string x to the end of the current last word\n            in the result.  If that is not possible, then just add\n            it as a new word.  Make sure the entire concatenated string\n            inherits the object attributes of x (in particular, the\n            escape function) by wrapping it as CmdStringHolder.\"\"\"\n\n            if not self.in_strip or self.mode != SUBST_SIG:\n                try:\n                    current_word = self[-1][-1]\n                except IndexError:\n                    self.add_new_word(x)\n                else:\n                    # All right, this is a hack and it should probably\n                    # be refactored out of existence in the future.\n                    # The issue is that we want to smoosh words together\n                    # and make one file name that gets escaped if\n                    # we're expanding something like foo$EXTENSION,\n                    # but we don't want to smoosh them together if\n                    # it's something like >$TARGET, because then we'll\n                    # treat the '>' like it's part of the file name.\n                    # So for now, just hard-code looking for the special\n                    # command-line redirection characters...\n                    try:\n                        last_char = str(current_word)[-1]\n                    except IndexError:\n                        last_char = '\\0'\n                    if last_char in '<>|':\n                        self.add_new_word(x)\n                    else:\n                        y = current_word + x\n\n                        # We used to treat a word appended to a literal\n                        # as a literal itself, but this caused problems\n                        # with interpreting quotes around space-separated\n                        # targets on command lines.  Removing this makes\n                        # none of the \"substantive\" end-to-end tests fail,\n                        # so we'll take this out but leave it commented\n                        # for now in case there's a problem not covered\n                        # by the test cases and we need to resurrect this.\n                        #literal1 = self.literal(self[-1][-1])\n                        #literal2 = self.literal(x)\n                        y = self.conv(y)\n                        if is_String(y):\n                            #y = CmdStringHolder(y, literal1 or literal2)\n                            y = CmdStringHolder(y, None)\n                        self[-1][-1] = y\n\n        def add_new_word(self, x):\n            if not self.in_strip or self.mode != SUBST_SIG:\n                literal = self.literal(x)\n                x = self.conv(x)\n                if is_String(x):\n                    x = CmdStringHolder(x, literal)\n                self[-1].append(x)\n            self.append = self.add_to_current_word\n\n        def literal(self, x):\n            try:\n                l = x.is_literal\n            except AttributeError:\n                return None\n            else:\n                return l()\n\n        def open_strip(self, x):\n            \"\"\"Handle the \"open strip\" $( token.\"\"\"\n            self.add_strip(x)\n            self.in_strip = 1\n\n        def close_strip(self, x):\n            \"\"\"Handle the \"close strip\" $) token.\"\"\"\n            self.add_strip(x)\n            self.in_strip = None\n\n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ls = ListSubber(env, mode, conv, gvars)\n    ls.substitute(strSubst, lvars, 0)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    return ls.data\n\ndef scons_subst_once(strSubst, env, key):\n    \"\"\"Perform single (non-recursive) substitution of a single\n    construction variable keyword.\n\n    This is used when setting a variable when copying or overriding values\n    in an Environment.  We want to capture (expand) the old value before\n    we override it, so people can do things like:\n\n        env2 = env.Clone(CCFLAGS = '$CCFLAGS -g')\n\n    We do this with some straightforward, brute-force code here...\n    \"\"\"\n    if isinstance(strSubst, str) and strSubst.find('$') < 0:\n        return strSubst\n\n    matchlist = ['$' + key, '${' + key + '}']\n    val = env.get(key, '')\n    def sub_match(match, val=val, matchlist=matchlist):\n        a = match.group(1)\n        if a in matchlist:\n            a = val\n        if is_Sequence(a):\n            return ' '.join(map(str, a))\n        else:\n            return str(a)\n\n    if is_Sequence(strSubst):\n        result = []\n        for arg in strSubst:\n            if is_String(arg):\n                if arg in matchlist:\n                    arg = val\n                    if is_Sequence(arg):\n                        result.extend(arg)\n                    else:\n                        result.append(arg)\n                else:\n                    result.append(_dollar_exps.sub(sub_match, arg))\n            else:\n                result.append(arg)\n        return result\n    elif is_String(strSubst):\n        return _dollar_exps.sub(sub_match, strSubst)\n    else:\n        return strSubst\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Taskmaster.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom __future__ import print_function\n\nimport sys\n\n__doc__ = \"\"\"\n    Generic Taskmaster module for the SCons build engine.\n    =====================================================\n\n    This module contains the primary interface(s) between a wrapping user\n    interface and the SCons build engine.  There are two key classes here:\n\n    Taskmaster\n    ----------\n        This is the main engine for walking the dependency graph and\n        calling things to decide what does or doesn't need to be built.\n\n    Task\n    ----\n        This is the base class for allowing a wrapping interface to\n        decide what does or doesn't actually need to be done.  The\n        intention is for a wrapping interface to subclass this as\n        appropriate for different types of behavior it may need.\n\n        The canonical example is the SCons native Python interface,\n        which has Task subclasses that handle its specific behavior,\n        like printing \"'foo' is up to date\" when a top-level target\n        doesn't need to be built, and handling the -c option by removing\n        targets as its \"build\" action.  There is also a separate subclass\n        for suppressing this output when the -q option is used.\n\n        The Taskmaster instantiates a Task object for each (set of)\n        target(s) that it decides need to be evaluated and/or built.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Taskmaster.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom itertools import chain\nimport operator\nimport sys\nimport traceback\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Warnings\n\nStateString = SCons.Node.StateString\nNODE_NO_STATE = SCons.Node.no_state\nNODE_PENDING = SCons.Node.pending\nNODE_EXECUTING = SCons.Node.executing\nNODE_UP_TO_DATE = SCons.Node.up_to_date\nNODE_EXECUTED = SCons.Node.executed\nNODE_FAILED = SCons.Node.failed\n\nprint_prepare = 0               # set by option --debug=prepare\n\n# A subsystem for recording stats about how different Nodes are handled by\n# the main Taskmaster loop.  There's no external control here (no need for\n# a --debug= option); enable it by changing the value of CollectStats.\n\nCollectStats = None\n\nclass Stats(object):\n    \"\"\"\n    A simple class for holding statistics about the disposition of a\n    Node by the Taskmaster.  If we're collecting statistics, each Node\n    processed by the Taskmaster gets one of these attached, in which case\n    the Taskmaster records its decision each time it processes the Node.\n    (Ideally, that's just once per Node.)\n    \"\"\"\n    def __init__(self):\n        \"\"\"\n        Instantiates a Taskmaster.Stats object, initializing all\n        appropriate counters to zero.\n        \"\"\"\n        self.considered  = 0\n        self.already_handled  = 0\n        self.problem  = 0\n        self.child_failed  = 0\n        self.not_built  = 0\n        self.side_effects  = 0\n        self.build  = 0\n\nStatsNodes = []\n\nfmt = \"%(considered)3d \"\\\n      \"%(already_handled)3d \" \\\n      \"%(problem)3d \" \\\n      \"%(child_failed)3d \" \\\n      \"%(not_built)3d \" \\\n      \"%(side_effects)3d \" \\\n      \"%(build)3d \"\n\ndef dump_stats():\n    for n in sorted(StatsNodes, key=lambda a: str(a)):\n        print((fmt % n.attributes.stats.__dict__) + str(n))\n\n\n\nclass Task(object):\n    \"\"\"\n    Default SCons build engine task.\n\n    This controls the interaction of the actual building of node\n    and the rest of the engine.\n\n    This is expected to handle all of the normally-customizable\n    aspects of controlling a build, so any given application\n    *should* be able to do what it wants by sub-classing this\n    class and overriding methods as appropriate.  If an application\n    needs to customize something by sub-classing Taskmaster (or\n    some other build engine class), we should first try to migrate\n    that functionality into this class.\n\n    Note that it's generally a good idea for sub-classes to call\n    these methods explicitly to update state, etc., rather than\n    roll their own interaction with Taskmaster from scratch.\n    \"\"\"\n    def __init__(self, tm, targets, top, node):\n        self.tm = tm\n        self.targets = targets\n        self.top = top\n        self.node = node\n        self.exc_clear()\n\n    def trace_message(self, method, node, description='node'):\n        fmt = '%-20s %s %s\\n'\n        return fmt % (method + ':', description, self.tm.trace_node(node))\n\n    def display(self, message):\n        \"\"\"\n        Hook to allow the calling interface to display a message.\n\n        This hook gets called as part of preparing a task for execution\n        (that is, a Node to be built).  As part of figuring out what Node\n        should be built next, the actual target list may be altered,\n        along with a message describing the alteration.  The calling\n        interface can subclass Task and provide a concrete implementation\n        of this method to see those messages.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"\n        Called just before the task is executed.\n\n        This is mainly intended to give the target Nodes a chance to\n        unlink underlying files and make all necessary directories before\n        the Action is actually called to build the targets.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.prepare()', self.node))\n\n        # Now that it's the appropriate time, give the TaskMaster a\n        # chance to raise any exceptions it encountered while preparing\n        # this task.\n        self.exception_raise()\n\n        if self.tm.message:\n            self.display(self.tm.message)\n            self.tm.message = None\n\n        # Let the targets take care of any necessary preparations.\n        # This includes verifying that all of the necessary sources\n        # and dependencies exist, removing the target file(s), etc.\n        #\n        # As of April 2008, the get_executor().prepare() method makes\n        # sure that all of the aggregate sources necessary to build this\n        # Task's target(s) exist in one up-front check.  The individual\n        # target t.prepare() methods check that each target's explicit\n        # or implicit dependencies exists, and also initialize the\n        # .sconsign info.\n        executor = self.targets[0].get_executor()\n        if executor is None:\n            return\n        executor.prepare()\n        for t in executor.get_action_targets():\n            if print_prepare:\n                print(\"Preparing target %s...\"%t)\n                for s in t.side_effects:\n                    print(\"...with side-effect %s...\"%s)\n            t.prepare()\n            for s in t.side_effects:\n                if print_prepare:\n                    print(\"...Preparing side-effect %s...\"%s)\n                s.prepare()\n\n    def get_target(self):\n        \"\"\"Fetch the target being built or updated by this task.\n        \"\"\"\n        return self.node\n\n    def needs_execute(self):\n        # TODO(deprecate):  \"return True\" is the old default behavior;\n        # change it to NotImplementedError (after running through the\n        # Deprecation Cycle) so the desired behavior is explicitly\n        # determined by which concrete subclass is used.\n        #raise NotImplementedError\n        msg = ('Taskmaster.Task is an abstract base class; instead of\\n'\n              '\\tusing it directly, '\n              'derive from it and override the abstract methods.')\n        SCons.Warnings.warn(SCons.Warnings.TaskmasterNeedsExecuteWarning, msg)\n        return True\n\n    def execute(self):\n        \"\"\"\n        Called to execute the task.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here.  Do thread unsafe stuff in\n        prepare(), executed() or failed().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.execute()', self.node))\n\n        try:\n            cached_targets = []\n            for t in self.targets:\n                if not t.retrieve_from_cache():\n                    break\n                cached_targets.append(t)\n            if len(cached_targets) < len(self.targets):\n                # Remove targets before building. It's possible that we\n                # partially retrieved targets from the cache, leaving\n                # them in read-only mode. That might cause the command\n                # to fail.\n                #\n                for t in cached_targets:\n                    try:\n                        t.fs.unlink(t.get_internal_path())\n                    except (IOError, OSError):\n                        pass\n                self.targets[0].build()\n            else:\n                for t in cached_targets:\n                    t.cached = 1\n        except SystemExit:\n            exc_value = sys.exc_info()[1]\n            raise SCons.Errors.ExplicitExit(self.targets[0], exc_value.code)\n        except SCons.Errors.UserError:\n            raise\n        except SCons.Errors.BuildError:\n            raise\n        except Exception as e:\n            buildError = SCons.Errors.convert_to_BuildError(e)\n            buildError.node = self.targets[0]\n            buildError.exc_info = sys.exc_info()\n            raise buildError\n\n    def executed_without_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed\n        and the Taskmaster instance doesn't want to call\n        the Node's callback methods.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_without_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n\n    def executed_with_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed and\n        the Taskmaster instance wants to call the Node's callback\n        methods.\n\n        This may have been a do-nothing operation (to preserve build\n        order), so we must check the node's state before deciding whether\n        it was \"built\", in which case we call the appropriate Node method.\n        In any event, we always call \"visited()\", which will handle any\n        post-visit actions that must take place regardless of whether\n        or not the target was an actual built target or a source Node.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_with_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n                if not t.cached:\n                    t.push_to_cache()\n                t.built()\n                t.visited()\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n            else:\n                t.visited()\n\n    executed = executed_with_callbacks\n\n    def failed(self):\n        \"\"\"\n        Default action when a task fails:  stop the build.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        self.fail_stop()\n\n    def fail_stop(self):\n        \"\"\"\n        Explicit stop-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_stop()', self.node))\n\n        # Invoke will_not_build() to clean-up the pending children\n        # list.\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n        # Tell the taskmaster to not start any new tasks\n        self.tm.stop()\n\n        # We're stopping because of a build failure, but give the\n        # calling Task class a chance to postprocess() the top-level\n        # target under which the build failure occurred.\n        self.targets = [self.tm.current_top]\n        self.top = 1\n\n    def fail_continue(self):\n        \"\"\"\n        Explicit continue-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_continue()', self.node))\n\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n    def make_ready_all(self):\n        \"\"\"\n        Marks all targets in a task ready for execution.\n\n        This is used when the interface needs every target Node to be\n        visited--the canonical example being the \"scons -c\" option.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.make_ready_all()', self.node))\n\n        self.out_of_date = self.targets[:]\n        for t in self.targets:\n            t.disambiguate().set_state(NODE_EXECUTING)\n            for s in t.side_effects:\n                # add disambiguate here to mirror the call on targets above\n                s.disambiguate().set_state(NODE_EXECUTING)\n\n    def make_ready_current(self):\n        \"\"\"\n        Marks all targets in a task ready for execution if any target\n        is not current.\n\n        This is the default behavior for building only what's necessary.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.make_ready_current()',\n                                         self.node))\n\n        self.out_of_date = []\n        needs_executing = False\n        for t in self.targets:\n            try:\n                t.disambiguate().make_ready()\n                is_up_to_date = not t.has_builder() or \\\n                                (not t.always_build and t.is_up_to_date())\n            except EnvironmentError as e:\n                raise SCons.Errors.BuildError(node=t, errstr=e.strerror, filename=e.filename)\n\n            if not is_up_to_date:\n                self.out_of_date.append(t)\n                needs_executing = True\n\n        if needs_executing:\n            for t in self.targets:\n                t.set_state(NODE_EXECUTING)\n                for s in t.side_effects:\n                    # add disambiguate here to mirror the call on targets in first loop above\n                    s.disambiguate().set_state(NODE_EXECUTING)\n        else:\n            for t in self.targets:\n                # We must invoke visited() to ensure that the node\n                # information has been computed before allowing the\n                # parent nodes to execute. (That could occur in a\n                # parallel build...)\n                t.visited()\n                t.set_state(NODE_UP_TO_DATE)\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n\n    make_ready = make_ready_current\n\n    def postprocess(self):\n        \"\"\"\n        Post-processes a task after it's been executed.\n\n        This examines all the targets just built (or not, we don't care\n        if the build was successful, or even if there was no build\n        because everything was up-to-date) to see if they have any\n        waiting parent Nodes, or Nodes waiting on a common side effect,\n        that can be put back on the candidates list.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message(u'Task.postprocess()', self.node))\n\n        # We may have built multiple targets, some of which may have\n        # common parents waiting for this build.  Count up how many\n        # targets each parent was waiting for so we can subtract the\n        # values later, and so we *don't* put waiting side-effect Nodes\n        # back on the candidates list if the Node is also a waiting\n        # parent.\n\n        targets = set(self.targets)\n\n        pending_children = self.tm.pending_children\n        parents = {}\n        for t in targets:\n            # A node can only be in the pending_children set if it has\n            # some waiting_parents.\n            if t.waiting_parents:\n                if T: T.write(self.trace_message(u'Task.postprocess()',\n                                                 t,\n                                                 'removing'))\n                pending_children.discard(t)\n            for p in t.waiting_parents:\n                parents[p] = parents.get(p, 0) + 1\n            t.waiting_parents = set()\n\n        for t in targets:\n            if t.side_effects is not None:\n                for s in t.side_effects:\n                    if s.get_state() == NODE_EXECUTING:\n                        s.set_state(NODE_NO_STATE)\n\n                    # The side-effects may have been transferred to\n                    # NODE_NO_STATE by executed_with{,out}_callbacks, but was\n                    # not taken out of the waiting parents/pending children\n                    # data structures. Check for that now.\n                    if s.get_state() == NODE_NO_STATE and s.waiting_parents:\n                        pending_children.discard(s)\n                        for p in s.waiting_parents:\n                            parents[p] = parents.get(p, 0) + 1\n                        s.waiting_parents = set()\n                    for p in s.waiting_s_e:\n                        if p.ref_count == 0:\n                            self.tm.candidates.append(p)\n\n        for p, subtract in parents.items():\n            p.ref_count = p.ref_count - subtract\n            if T: T.write(self.trace_message(u'Task.postprocess()',\n                                             p,\n                                             'adjusted parent ref count'))\n            if p.ref_count == 0:\n                self.tm.candidates.append(p)\n\n        for t in targets:\n            t.postprocess()\n\n    # Exception handling subsystem.\n    #\n    # Exceptions that occur while walking the DAG or examining Nodes\n    # must be raised, but must be raised at an appropriate time and in\n    # a controlled manner so we can, if necessary, recover gracefully,\n    # possibly write out signature information for Nodes we've updated,\n    # etc.  This is done by having the Taskmaster tell us about the\n    # exception, and letting\n\n    def exc_info(self):\n        \"\"\"\n        Returns info about a recorded exception.\n        \"\"\"\n        return self.exception\n\n    def exc_clear(self):\n        \"\"\"\n        Clears any recorded exception.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the appropriate do-nothing method.\n        \"\"\"\n        self.exception = (None, None, None)\n        self.exception_raise = self._no_exception_to_raise\n\n    def exception_set(self, exception=None):\n        \"\"\"\n        Records an exception to be raised at the appropriate time.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the method that will, in fact\n        \"\"\"\n        if not exception:\n            exception = sys.exc_info()\n        self.exception = exception\n        self.exception_raise = self._exception_raise\n\n    def _no_exception_to_raise(self):\n        pass\n\n    def _exception_raise(self):\n        \"\"\"\n        Raises a pending exception that was recorded while getting a\n        Task ready for execution.\n        \"\"\"\n        exc = self.exc_info()[:]\n        try:\n            exc_type, exc_value, exc_traceback = exc\n        except ValueError:\n            exc_type, exc_value = exc  # pylint: disable=unbalanced-tuple-unpacking\n            exc_traceback = None\n\n        # raise exc_type(exc_value).with_traceback(exc_traceback)\n        if sys.version_info[0] == 2:\n            exec(\"raise exc_type, exc_value, exc_traceback\")\n        else: #  sys.version_info[0] == 3:\n            if isinstance(exc_value, Exception): #hasattr(exc_value, 'with_traceback'):\n                # If exc_value is an exception, then just reraise\n                exec(\"raise exc_value.with_traceback(exc_traceback)\")\n            else:\n                # else we'll create an exception using the value and raise that\n                exec(\"raise exc_type(exc_value).with_traceback(exc_traceback)\")\n\n\n        # raise e.__class__, e.__class__(e), sys.exc_info()[2]\n        #     exec(\"raise exc_type(exc_value).with_traceback(exc_traceback)\")\n\n\n\nclass AlwaysTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Always returns True (indicating this Task should always\n        be executed).\n\n        Subclasses that need this behavior (as opposed to the default\n        of only executing Nodes that are out of date w.r.t. their\n        dependencies) can use this as follows:\n\n            class MyTaskSubclass(SCons.Taskmaster.Task):\n                needs_execute = SCons.Taskmaster.Task.execute_always\n        \"\"\"\n        return True\n\nclass OutOfDateTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Returns True (indicating this Task should be executed) if this\n        Task's target state indicates it needs executing, which has\n        already been determined by an earlier up-to-date check.\n        \"\"\"\n        return self.targets[0].get_state() == SCons.Node.executing\n\n\ndef find_cycle(stack, visited):\n    if stack[-1] in visited:\n        return None\n    visited.add(stack[-1])\n    for n in stack[-1].waiting_parents:\n        stack.append(n)\n        if stack[0] == stack[-1]:\n            return stack\n        if find_cycle(stack, visited):\n            return stack\n        stack.pop()\n    return None\n\n\nclass Taskmaster(object):\n    \"\"\"\n    The Taskmaster for walking the dependency DAG.\n    \"\"\"\n\n    def __init__(self, targets=[], tasker=None, order=None, trace=None):\n        self.original_top = targets\n        self.top_targets_left = targets[:]\n        self.top_targets_left.reverse()\n        self.candidates = []\n        if tasker is None:\n            tasker = OutOfDateTask\n        self.tasker = tasker\n        if not order:\n            order = lambda l: l\n        self.order = order\n        self.message = None\n        self.trace = trace\n        self.next_candidate = self.find_next_candidate\n        self.pending_children = set()\n\n    def find_next_candidate(self):\n        \"\"\"\n        Returns the next candidate Node for (potential) evaluation.\n\n        The candidate list (really a stack) initially consists of all of\n        the top-level (command line) targets provided when the Taskmaster\n        was initialized.  While we walk the DAG, visiting Nodes, all the\n        children that haven't finished processing get pushed on to the\n        candidate list.  Each child can then be popped and examined in\n        turn for whether *their* children are all up-to-date, in which\n        case a Task will be created for their actual evaluation and\n        potential building.\n\n        Here is where we also allow candidate Nodes to alter the list of\n        Nodes that should be examined.  This is used, for example, when\n        invoking SCons in a source directory.  A source directory Node can\n        return its corresponding build directory Node, essentially saying,\n        \"Hey, you really need to build this thing over here instead.\"\n        \"\"\"\n        try:\n            return self.candidates.pop()\n        except IndexError:\n            pass\n        try:\n            node = self.top_targets_left.pop()\n        except IndexError:\n            return None\n        self.current_top = node\n        alt, message = node.alter_targets()\n        if alt:\n            self.message = message\n            self.candidates.append(node)\n            self.candidates.extend(self.order(alt))\n            node = self.candidates.pop()\n        return node\n\n    def no_next_candidate(self):\n        \"\"\"\n        Stops Taskmaster processing by not returning a next candidate.\n\n        Note that we have to clean-up the Taskmaster candidate list\n        because the cycle detection depends on the fact all nodes have\n        been processed somehow.\n        \"\"\"\n        while self.candidates:\n            candidates = self.candidates\n            self.candidates = []\n            self.will_not_build(candidates)\n        return None\n\n    def _validate_pending_children(self):\n        \"\"\"\n        Validate the content of the pending_children set. Assert if an\n        internal error is found.\n\n        This function is used strictly for debugging the taskmaster by\n        checking that no invariants are violated. It is not used in\n        normal operation.\n\n        The pending_children set is used to detect cycles in the\n        dependency graph. We call a \"pending child\" a child that is\n        found in the \"pending\" state when checking the dependencies of\n        its parent node.\n\n        A pending child can occur when the Taskmaster completes a loop\n        through a cycle. For example, let's imagine a graph made of\n        three nodes (A, B and C) making a cycle. The evaluation starts\n        at node A. The Taskmaster first considers whether node A's\n        child B is up-to-date. Then, recursively, node B needs to\n        check whether node C is up-to-date. This leaves us with a\n        dependency graph looking like::\n\n                                          Next candidate \\\n                                                          \\\n            Node A (Pending) --> Node B(Pending) --> Node C (NoState)\n                    ^                                     |\n                    |                                     |\n                    +-------------------------------------+\n\n        Now, when the Taskmaster examines the Node C's child Node A,\n        it finds that Node A is in the \"pending\" state. Therefore,\n        Node A is a pending child of node C.\n\n        Pending children indicate that the Taskmaster has potentially\n        loop back through a cycle. We say potentially because it could\n        also occur when a DAG is evaluated in parallel. For example,\n        consider the following graph::\n\n            Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...\n                    |                                     ^\n                    |                                     |\n                    +----------> Node D (NoState) --------+\n                                      /\n                      Next candidate /\n\n        The Taskmaster first evaluates the nodes A, B, and C and\n        starts building some children of node C. Assuming, that the\n        maximum parallel level has not been reached, the Taskmaster\n        will examine Node D. It will find that Node C is a pending\n        child of Node D.\n\n        In summary, evaluating a graph with a cycle will always\n        involve a pending child at one point. A pending child might\n        indicate either a cycle or a diamond-shaped DAG. Only a\n        fraction of the nodes ends-up being a \"pending child\" of\n        another node. This keeps the pending_children set small in\n        practice.\n\n        We can differentiate between the two cases if we wait until\n        the end of the build. At this point, all the pending children\n        nodes due to a diamond-shaped DAG will have been properly\n        built (or will have failed to build). But, the pending\n        children involved in a cycle will still be in the pending\n        state.\n\n        The taskmaster removes nodes from the pending_children set as\n        soon as a pending_children node moves out of the pending\n        state. This also helps to keep the pending_children set small.\n        \"\"\"\n\n        for n in self.pending_children:\n            assert n.state in (NODE_PENDING, NODE_EXECUTING), \\\n                (str(n), StateString[n.state])\n            assert len(n.waiting_parents) != 0, (str(n), len(n.waiting_parents))\n            for p in n.waiting_parents:\n                assert p.ref_count > 0, (str(n), str(p), p.ref_count)\n\n\n    def trace_message(self, message):\n        return 'Taskmaster: %s\\n' % message\n\n    def trace_node(self, node):\n        return '<%-10s %-3s %s>' % (StateString[node.get_state()],\n                                    node.ref_count,\n                                    repr(str(node)))\n\n    def _find_next_ready_node(self):\n        \"\"\"\n        Finds the next node that is ready to be built.\n\n        This is *the* main guts of the DAG walk.  We loop through the\n        list of candidates, looking for something that has no un-built\n        children (i.e., that is a leaf Node or has dependencies that are\n        all leaf Nodes or up-to-date).  Candidate Nodes are re-scanned\n        (both the target Node itself and its sources, which are always\n        scanned in the context of a given target) to discover implicit\n        dependencies.  A Node that must wait for some children to be\n        built will be put back on the candidates list after the children\n        have finished building.  A Node that has been put back on the\n        candidates list in this way may have itself (or its sources)\n        re-scanned, in order to handle generated header files (e.g.) and\n        the implicit dependencies therein.\n\n        Note that this method does not do any signature calculation or\n        up-to-date check itself.  All of that is handled by the Task\n        class.  This is purely concerned with the dependency graph walk.\n        \"\"\"\n\n        self.ready_exc = None\n\n        T = self.trace\n        if T: T.write(SCons.Util.UnicodeType('\\n') + self.trace_message('Looking for a node to evaluate'))\n\n        while True:\n            node = self.next_candidate()\n            if node is None:\n                if T: T.write(self.trace_message('No candidate anymore.') + u'\\n')\n                return None\n\n            node = node.disambiguate()\n            state = node.get_state()\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            if CollectStats:\n                if not hasattr(node.attributes, 'stats'):\n                    node.attributes.stats = Stats()\n                    StatsNodes.append(node)\n                S = node.attributes.stats\n                S.considered = S.considered + 1\n            else:\n                S = None\n\n            if T: T.write(self.trace_message(u'    Considering node %s and its children:' % self.trace_node(node)))\n\n            if state == NODE_NO_STATE:\n                # Mark this node as being on the execution stack:\n                node.set_state(NODE_PENDING)\n            elif state > NODE_PENDING:\n                # Skip this node if it has already been evaluated:\n                if S: S.already_handled = S.already_handled + 1\n                if T: T.write(self.trace_message(u'       already handled (executed)'))\n                continue\n\n            executor = node.get_executor()\n\n            try:\n                children = executor.get_all_children()\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                e = SCons.Errors.ExplicitExit(node, exc_value.code)\n                self.ready_exc = (SCons.Errors.ExplicitExit, e)\n                if T: T.write(self.trace_message('       SystemExit'))\n                return node\n            except Exception as e:\n                # We had a problem just trying to figure out the\n                # children (like a child couldn't be linked in to a\n                # VariantDir, or a Scanner threw something).  Arrange to\n                # raise the exception when the Task is \"executed.\"\n                self.ready_exc = sys.exc_info()\n                if S: S.problem = S.problem + 1\n                if T: T.write(self.trace_message('       exception %s while scanning children.\\n' % e))\n                return node\n\n            children_not_visited = []\n            children_pending = set()\n            children_not_ready = []\n            children_failed = False\n\n            for child in chain(executor.get_all_prerequisites(), children):\n                childstate = child.get_state()\n\n                if T: T.write(self.trace_message(u'       ' + self.trace_node(child)))\n\n                if childstate == NODE_NO_STATE:\n                    children_not_visited.append(child)\n                elif childstate == NODE_PENDING:\n                    children_pending.add(child)\n                elif childstate == NODE_FAILED:\n                    children_failed = True\n\n                if childstate <= NODE_EXECUTING:\n                    children_not_ready.append(child)\n\n            # These nodes have not even been visited yet.  Add\n            # them to the list so that on some next pass we can\n            # take a stab at evaluating them (or their children).\n            if children_not_visited:\n                if len(children_not_visited) > 1:\n                    children_not_visited.reverse()\n                self.candidates.extend(self.order(children_not_visited))\n\n            # if T and children_not_visited:\n            #    T.write(self.trace_message('     adding to candidates: %s' % map(str, children_not_visited)))\n            #    T.write(self.trace_message('     candidates now: %s\\n' % map(str, self.candidates)))\n\n            # Skip this node if any of its children have failed.\n            #\n            # This catches the case where we're descending a top-level\n            # target and one of our children failed while trying to be\n            # built by a *previous* descent of an earlier top-level\n            # target.\n            #\n            # It can also occur if a node is reused in multiple\n            # targets. One first descends though the one of the\n            # target, the next time occurs through the other target.\n            #\n            # Note that we can only have failed_children if the\n            # --keep-going flag was used, because without it the build\n            # will stop before diving in the other branch.\n            #\n            # Note that even if one of the children fails, we still\n            # added the other children to the list of candidate nodes\n            # to keep on building (--keep-going).\n            if children_failed:\n                for n in executor.get_action_targets():\n                    n.set_state(NODE_FAILED)\n\n                if S: S.child_failed = S.child_failed + 1\n                if T: T.write(self.trace_message('****** %s\\n' % self.trace_node(node)))\n                continue\n\n            if children_not_ready:\n                for child in children_not_ready:\n                    # We're waiting on one or more derived targets\n                    # that have not yet finished building.\n                    if S: S.not_built = S.not_built + 1\n\n                    # Add this node to the waiting parents lists of\n                    # anything we're waiting on, with a reference\n                    # count so we can be put back on the list for\n                    # re-evaluation when they've all finished.\n                    node.ref_count =  node.ref_count + child.add_to_waiting_parents(node)\n                    if T: T.write(self.trace_message(u'     adjusted ref count: %s, child %s' %\n                                  (self.trace_node(node), repr(str(child)))))\n\n                if T:\n                    for pc in children_pending:\n                        T.write(self.trace_message('       adding %s to the pending children set\\n' %\n                                self.trace_node(pc)))\n                self.pending_children = self.pending_children | children_pending\n\n                continue\n\n            # Skip this node if it has side-effects that are\n            # currently being built:\n            wait_side_effects = False\n            for se in executor.get_action_side_effects():\n                if se.get_state() == NODE_EXECUTING:\n                    se.add_to_waiting_s_e(node)\n                    wait_side_effects = True\n\n            if wait_side_effects:\n                if S: S.side_effects = S.side_effects + 1\n                continue\n\n            # The default when we've gotten through all of the checks above:\n            # this node is ready to be built.\n            if S: S.build = S.build + 1\n            if T: T.write(self.trace_message(u'Evaluating %s\\n' %\n                                             self.trace_node(node)))\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            return node\n\n        return None\n\n    def next_task(self):\n        \"\"\"\n        Returns the next task to be executed.\n\n        This simply asks for the next Node to be evaluated, and then wraps\n        it in the specific Task subclass with which we were initialized.\n        \"\"\"\n        node = self._find_next_ready_node()\n\n        if node is None:\n            return None\n\n        executor = node.get_executor()\n        if executor is None:\n            return None\n\n        tlist = executor.get_all_targets()\n\n        task = self.tasker(self, tlist, node in self.original_top, node)\n        try:\n            task.make_ready()\n        except Exception as e :\n            # We had a problem just trying to get this task ready (like\n            # a child couldn't be linked to a VariantDir when deciding\n            # whether this node is current).  Arrange to raise the\n            # exception when the Task is \"executed.\"\n            self.ready_exc = sys.exc_info()\n\n        if self.ready_exc:\n            task.exception_set(self.ready_exc)\n\n        self.ready_exc = None\n\n        return task\n\n    def will_not_build(self, nodes, node_func=lambda n: None):\n        \"\"\"\n        Perform clean-up about nodes that will never be built. Invokes\n        a user defined function on all of these nodes (including all\n        of their parents).\n        \"\"\"\n\n        T = self.trace\n\n        pending_children = self.pending_children\n\n        to_visit = set(nodes)\n        pending_children = pending_children - to_visit\n\n        if T:\n            for n in nodes:\n                T.write(self.trace_message('       removing node %s from the pending children set\\n' %\n                        self.trace_node(n)))\n        try:\n            while len(to_visit):\n                node = to_visit.pop()\n                node_func(node)\n\n                # Prune recursion by flushing the waiting children\n                # list immediately.\n                parents = node.waiting_parents\n                node.waiting_parents = set()\n\n                to_visit = to_visit | parents\n                pending_children = pending_children - parents\n\n                for p in parents:\n                    p.ref_count = p.ref_count - 1\n                    if T: T.write(self.trace_message('       removing parent %s from the pending children set\\n' %\n                                  self.trace_node(p)))\n        except KeyError:\n            # The container to_visit has been emptied.\n            pass\n\n        # We have the stick back the pending_children list into the\n        # taskmaster because the python 1.5.2 compatibility does not\n        # allow us to use in-place updates\n        self.pending_children = pending_children\n\n    def stop(self):\n        \"\"\"\n        Stops the current build completely.\n        \"\"\"\n        self.next_candidate = self.no_next_candidate\n\n    def cleanup(self):\n        \"\"\"\n        Check for dependency cycles.\n        \"\"\"\n        if not self.pending_children:\n            return\n\n        nclist = [(n, find_cycle([n], set())) for n in self.pending_children]\n\n        genuine_cycles = [\n            node for node,cycle in nclist\n                     if cycle or node.get_state() != NODE_EXECUTED\n        ]\n        if not genuine_cycles:\n            # All of the \"cycles\" found were single nodes in EXECUTED state,\n            # which is to say, they really weren't cycles.  Just return.\n            return\n\n        desc = 'Found dependency cycle(s):\\n'\n        for node, cycle in nclist:\n            if cycle:\n                desc = desc + \"  \" + \" -> \".join(map(str, cycle)) + \"\\n\"\n            else:\n                desc = desc + \\\n                    \"  Internal Error: no cycle found for node %s (%s) in state %s\\n\" %  \\\n                    (node, repr(node), StateString[node.get_state()])\n\n        raise SCons.Errors.UserError(desc)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/386asm.py",
    "content": "\"\"\"SCons.Tool.386asm\n\nTool specification for the 386ASM assembler for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/386asm.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\nimport SCons.Util\n\nas_module = __import__('as', globals(), locals(), [], 1)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = '386asm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS $SOURCES -o $TARGET'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES -o $TARGET'\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    return env.Detect('386asm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/GettextCommon.py",
    "content": "\"\"\"SCons.Tool.GettextCommon module\n\nUsed by several tools of `gettext` toolset.\n\"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/GettextCommon.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Warnings\nimport re\n\n\n#############################################################################\nclass XgettextToolWarning(SCons.Warnings.Warning): pass\n\n\nclass XgettextNotFound(XgettextToolWarning): pass\n\n\nclass MsginitToolWarning(SCons.Warnings.Warning): pass\n\n\nclass MsginitNotFound(MsginitToolWarning): pass\n\n\nclass MsgmergeToolWarning(SCons.Warnings.Warning): pass\n\n\nclass MsgmergeNotFound(MsgmergeToolWarning): pass\n\n\nclass MsgfmtToolWarning(SCons.Warnings.Warning): pass\n\n\nclass MsgfmtNotFound(MsgfmtToolWarning): pass\n\n\n#############################################################################\nSCons.Warnings.enableWarningClass(XgettextToolWarning)\nSCons.Warnings.enableWarningClass(XgettextNotFound)\nSCons.Warnings.enableWarningClass(MsginitToolWarning)\nSCons.Warnings.enableWarningClass(MsginitNotFound)\nSCons.Warnings.enableWarningClass(MsgmergeToolWarning)\nSCons.Warnings.enableWarningClass(MsgmergeNotFound)\nSCons.Warnings.enableWarningClass(MsgfmtToolWarning)\nSCons.Warnings.enableWarningClass(MsgfmtNotFound)\n\n\n#############################################################################\n\n#############################################################################\nclass _POTargetFactory(object):\n    \"\"\" A factory of `PO` target files.\n\n    Factory defaults differ from these of `SCons.Node.FS.FS`.  We set `precious`\n    (this is required by builders and actions gettext) and `noclean` flags by\n    default for all produced nodes.\n    \"\"\"\n\n    def __init__(self, env, nodefault=True, alias=None, precious=True\n                 , noclean=True):\n        \"\"\" Object constructor.\n\n        **Arguments**\n\n            - *env* (`SCons.Environment.Environment`)\n            - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored\n              from default target `'.'`\n            - *alias* (`string`) - if provided, produced nodes will be automatically\n              added to this alias, and alias will be set as `AlwaysBuild`\n            - *precious* (`boolean`) - if `True`, the produced nodes will be set as\n              `Precious`.\n            - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded\n              from `Clean`.\n        \"\"\"\n        self.env = env\n        self.alias = alias\n        self.precious = precious\n        self.noclean = noclean\n        self.nodefault = nodefault\n\n    def _create_node(self, name, factory, directory=None, create=1):\n        \"\"\" Create node, and set it up to factory settings. \"\"\"\n        import SCons.Util\n        node = factory(name, directory, create)\n        node.set_noclean(self.noclean)\n        node.set_precious(self.precious)\n        if self.nodefault:\n            self.env.Ignore('.', node)\n        if self.alias:\n            self.env.AlwaysBuild(self.env.Alias(self.alias, node))\n        return node\n\n    def Entry(self, name, directory=None, create=1):\n        \"\"\" Create `SCons.Node.FS.Entry` \"\"\"\n        return self._create_node(name, self.env.fs.Entry, directory, create)\n\n    def File(self, name, directory=None, create=1):\n        \"\"\" Create `SCons.Node.FS.File` \"\"\"\n        return self._create_node(name, self.env.fs.File, directory, create)\n\n\n#############################################################################\n\n#############################################################################\n_re_comment = re.compile(r'(#[^\\n\\r]+)$', re.M)\n_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)\n\n\n#############################################################################\ndef _read_linguas_from_files(env, linguas_files=None):\n    \"\"\" Parse `LINGUAS` file and return list of extracted languages \"\"\"\n    import SCons.Util\n    import SCons.Environment\n    global _re_comment\n    global _re_lang\n    if not SCons.Util.is_List(linguas_files) \\\n            and not SCons.Util.is_String(linguas_files) \\\n            and not isinstance(linguas_files, SCons.Node.FS.Base) \\\n            and linguas_files:\n        # If, linguas_files==True or such, then read 'LINGUAS' file.\n        linguas_files = ['LINGUAS']\n    if linguas_files is None:\n        return []\n    fnodes = env.arg2nodes(linguas_files)\n    linguas = []\n    for fnode in fnodes:\n        contents = _re_comment.sub(\"\", fnode.get_text_contents())\n        ls = [l for l in _re_lang.findall(contents) if l]\n        linguas.extend(ls)\n    return linguas\n\n\n#############################################################################\n\n#############################################################################\nfrom SCons.Builder import BuilderBase\n\n\n#############################################################################\nclass _POFileBuilder(BuilderBase):\n    \"\"\" `PO` file builder.\n\n    This is multi-target single-source builder. In typical situation the source\n    is single `POT` file, e.g. `messages.pot`, and there are multiple `PO`\n    targets to be updated from this `POT`. We must run\n    `SCons.Builder.BuilderBase._execute()` separatelly for each target to track\n    dependencies separatelly for each target file.\n\n    **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)`\n    with target being list of all targets, all targets would be rebuilt each time\n    one of the targets from this list is missing. This would happen, for example,\n    when new language `ll` enters `LINGUAS_FILE` (at this moment there is no\n    `ll.po` file yet). To avoid this, we override\n    `SCons.Builder.BuilerBase._execute()` and call it separatelly for each\n    target. Here we also append to the target list the languages read from\n    `LINGUAS_FILE`.\n    \"\"\"\n\n    #\n    # * The argument for overriding _execute(): We must use environment with\n    #  builder overrides applied (see BuilderBase.__init__(). Here it comes for\n    #  free.\n    # * The argument against using 'emitter': The emitter is called too late\n    #  by BuilderBase._execute(). If user calls, for example:\n    #\n    #    env.POUpdate(LINGUAS_FILE = 'LINGUAS')\n    #\n    #  the builder throws error, because it is called with target=None,\n    #  source=None and is trying to \"generate\" sources or target list first.\n    #  If user calls\n    #\n    #    env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS')\n    #\n    #  the env.BuilderWrapper() calls our builder with target=None,\n    #  source=['foo', 'baz']. The BuilderBase._execute() then splits execution\n    #  and execute iterativelly (recursion) self._execute(None, source[i]).\n    #  After that it calls emitter (which is quite too late). The emitter is\n    #  also called in each iteration, what makes things yet worse.\n    def __init__(self, env, **kw):\n        if 'suffix' not in kw:\n            kw['suffix'] = '$POSUFFIX'\n        if 'src_suffix' not in kw:\n            kw['src_suffix'] = '$POTSUFFIX'\n        if 'src_builder' not in kw:\n            kw['src_builder'] = '_POTUpdateBuilder'\n        if 'single_source' not in kw:\n            kw['single_source'] = True\n        alias = None\n        if 'target_alias' in kw:\n            alias = kw['target_alias']\n            del kw['target_alias']\n        if 'target_factory' not in kw:\n            kw['target_factory'] = _POTargetFactory(env, alias=alias).File\n        BuilderBase.__init__(self, **kw)\n\n    def _execute(self, env, target, source, *args, **kw):\n        \"\"\" Execute builder's actions.\n\n        Here we append to `target` the languages read from `$LINGUAS_FILE` and\n        apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.\n        The arguments and return value are same as for\n        `SCons.Builder.BuilderBase._execute()`.\n        \"\"\"\n        import SCons.Util\n        import SCons.Node\n        linguas_files = None\n        if 'LINGUAS_FILE' in env and env['LINGUAS_FILE']:\n            linguas_files = env['LINGUAS_FILE']\n            # This prevents endless recursion loop (we'll be invoked once for\n            # each target appended here, we must not extend the list again).\n            env['LINGUAS_FILE'] = None\n            linguas = _read_linguas_from_files(env, linguas_files)\n            if SCons.Util.is_List(target):\n                target.extend(linguas)\n            elif target is not None:\n                target = [target] + linguas\n            else:\n                target = linguas\n        if not target:\n            # Let the SCons.BuilderBase to handle this patologic situation\n            return BuilderBase._execute(self, env, target, source, *args, **kw)\n        # The rest is ours\n        if not SCons.Util.is_List(target):\n            target = [target]\n        result = []\n        for tgt in target:\n            r = BuilderBase._execute(self, env, [tgt], source, *args, **kw)\n            result.extend(r)\n        if linguas_files is not None:\n            env['LINGUAS_FILE'] = linguas_files\n        return SCons.Node.NodeList(result)\n\n\n#############################################################################\n\nimport SCons.Environment\n\n\n#############################################################################\ndef _translate(env, target=None, source=SCons.Environment._null, *args, **kw):\n    \"\"\" Function for `Translate()` pseudo-builder \"\"\"\n    if target is None: target = []\n    pot = env.POTUpdate(None, source, *args, **kw)\n    po = env.POUpdate(target, pot, *args, **kw)\n    return po\n\n\n#############################################################################\n\n#############################################################################\nclass RPaths(object):\n    \"\"\" Callable object, which returns pathnames relative to SCons current\n    working directory.\n\n    It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths\n    for nodes that are outside of current working directory (`env.fs.getcwd()`).\n    Here, we often have `SConscript`, `POT` and `PO` files within `po/`\n    directory and source files (e.g. `*.c`) outside of it. When generating `POT`\n    template file, references to source files are written to `POT` template, so\n    a translator may later quickly jump to appropriate source file and line from\n    its `PO` editor (e.g. `poedit`).  Relative paths in  `PO` file are usually\n    interpreted by `PO` editor as paths relative to the place, where `PO` file\n    lives. The absolute paths would make resultant `POT` file nonportable, as\n    the references would be correct only on the machine, where `POT` file was\n    recently re-created. For such reason, we need a function, which always\n    returns relative paths. This is the purpose of `RPaths` callable object.\n\n    The `__call__` method returns paths relative to current working directory, but\n    we assume, that *xgettext(1)* is run from the directory, where target file is\n    going to be created.\n\n    Note, that this may not work for files distributed over several hosts or\n    across different drives on windows. We assume here, that single local\n    filesystem holds both source files and target `POT` templates.\n\n    Intended use of `RPaths` - in `xgettext.py`::\n\n      def generate(env):\n          from GettextCommon import RPaths\n          ...\n          sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET, SOURCES)} $)'\n          env.Append(\n            ...\n            XGETTEXTCOM = 'XGETTEXT ... ' + sources,\n            ...\n            XgettextRPaths = RPaths(env)\n          )\n    \"\"\"\n\n    # NOTE: This callable object returns pathnames of dirs/files relative to\n    # current working directory. The pathname remains relative also for entries\n    # that are outside of current working directory (node, that\n    # SCons.Node.FS.File and siblings return absolute path in such case). For\n    # simplicity we compute path relative to current working directory, this\n    # seems be enough for our purposes (don't need TARGET variable and\n    # SCons.Defaults.Variable_Caller stuff).\n\n    def __init__(self, env):\n        \"\"\" Initialize `RPaths` callable object.\n\n          **Arguments**:\n\n            - *env* - a `SCons.Environment.Environment` object, defines *current\n              working dir*.\n        \"\"\"\n        self.env = env\n\n    # FIXME: I'm not sure, how it should be implemented (what the *args are in\n    # general, what is **kw).\n    def __call__(self, nodes, *args, **kw):\n        \"\"\" Return nodes' paths (strings) relative to current working directory.\n\n          **Arguments**:\n\n            - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.\n            - *args* -  currently unused.\n            - *kw* - currently unused.\n\n          **Returns**:\n\n           - Tuple of strings, which represent paths relative to current working\n             directory (for given environment).\n        \"\"\"\n        import os\n        import SCons.Node.FS\n        rpaths = ()\n        cwd = self.env.fs.getcwd().get_abspath()\n        for node in nodes:\n            rpath = None\n            if isinstance(node, SCons.Node.FS.Base):\n                rpath = os.path.relpath(node.get_abspath(), cwd)\n            # FIXME: Other types possible here?\n            if rpath is not None:\n                rpaths += (rpath,)\n        return rpaths\n\n\n#############################################################################\n\n#############################################################################\ndef _init_po_files(target, source, env):\n    \"\"\" Action function for `POInit` builder. \"\"\"\n    nop = lambda target, source, env: 0\n    if 'POAUTOINIT' in env:\n        autoinit = env['POAUTOINIT']\n    else:\n        autoinit = False\n    # Well, if everything outside works well, this loop should do single\n    # iteration. Otherwise we are rebuilding all the targets even, if just\n    # one has changed (but is this our fault?).\n    for tgt in target:\n        if not tgt.exists():\n            if autoinit:\n                action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR')\n            else:\n                msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \\\n                      + 'If you are a translator, you can create it through: \\n' \\\n                      + '$MSGINITCOM'\n                action = SCons.Action.Action(nop, msg)\n            status = action([tgt], source, env)\n            if status: return status\n    return 0\n\n\n#############################################################################\n\n#############################################################################\ndef _detect_xgettext(env):\n    \"\"\" Detects *xgettext(1)* binary \"\"\"\n    if 'XGETTEXT' in env:\n        return env['XGETTEXT']\n    xgettext = env.Detect('xgettext')\n    if xgettext:\n        return xgettext\n    raise SCons.Errors.StopError(XgettextNotFound, \"Could not detect xgettext\")\n    return None\n\n\n#############################################################################\ndef _xgettext_exists(env):\n    return _detect_xgettext(env)\n\n\n#############################################################################\n\n#############################################################################\ndef _detect_msginit(env):\n    \"\"\" Detects *msginit(1)* program. \"\"\"\n    if 'MSGINIT' in env:\n        return env['MSGINIT']\n    msginit = env.Detect('msginit')\n    if msginit:\n        return msginit\n    raise SCons.Errors.StopError(MsginitNotFound, \"Could not detect msginit\")\n    return None\n\n\n#############################################################################\ndef _msginit_exists(env):\n    return _detect_msginit(env)\n\n\n#############################################################################\n\n#############################################################################\ndef _detect_msgmerge(env):\n    \"\"\" Detects *msgmerge(1)* program. \"\"\"\n    if 'MSGMERGE' in env:\n        return env['MSGMERGE']\n    msgmerge = env.Detect('msgmerge')\n    if msgmerge:\n        return msgmerge\n    raise SCons.Errors.StopError(MsgmergeNotFound, \"Could not detect msgmerge\")\n    return None\n\n\n#############################################################################\ndef _msgmerge_exists(env):\n    return _detect_msgmerge(env)\n\n\n#############################################################################\n\n#############################################################################\ndef _detect_msgfmt(env):\n    \"\"\" Detects *msgmfmt(1)* program. \"\"\"\n    if 'MSGFMT' in env:\n        return env['MSGFMT']\n    msgfmt = env.Detect('msgfmt')\n    if msgfmt:\n        return msgfmt\n    raise SCons.Errors.StopError(MsgfmtNotFound, \"Could not detect msgfmt\")\n    return None\n\n\n#############################################################################\ndef _msgfmt_exists(env):\n    return _detect_msgfmt(env)\n\n\n#############################################################################\n\n#############################################################################\ndef tool_list(platform, env):\n    \"\"\" List tools that shall be generated by top-level `gettext` tool \"\"\"\n    return ['xgettext', 'msginit', 'msgmerge', 'msgfmt']\n\n#############################################################################\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/__init__.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"\nCommon functions for Microsoft Visual Studio and Visual C/C++.\n\"\"\"\n\nimport copy\nimport os\nimport re\nimport subprocess\n\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon.sdk import mssdk_exists, \\\n                                    mssdk_setup_env\n\nfrom SCons.Tool.MSCommon.vc import msvc_exists, \\\n                                   msvc_setup_env, \\\n                                   msvc_setup_env_once, \\\n                                   msvc_version_to_maj_min\n\nfrom SCons.Tool.MSCommon.vs import get_default_version, \\\n                                   get_vs_by_version, \\\n                                   merge_default_version, \\\n                                   msvs_exists, \\\n                                   query_versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/arch.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/arch.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"Module to define supported Windows chip architectures.\n\"\"\"\n\nimport os\n\nclass ArchDefinition(object):\n    \"\"\"\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n    \n    ArchDefinition(\n        'arm',\n        ['ARM'],\n    ),\n\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/common.py",
    "content": "\"\"\"\nCommon helper functions for working with the Microsoft tool chain.\n\"\"\"\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/common.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport copy\nimport json\nimport os\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Util\n\n# SCONS_MSCOMMON_DEBUG is internal-use so undocumented:\n# set to '-' to print to console, else set to filename to log to\nLOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG')\nif LOGFILE == '-':\n    def debug(message):\n        print(message)\nelif LOGFILE:\n    import logging\n    logging.basicConfig(\n        format='%(relativeCreated)05dms:pid%(process)05d:MSCommon/%(filename)s:%(message)s',\n        filename=LOGFILE,\n        level=logging.DEBUG)\n    debug = logging.getLogger(name=__name__).debug\nelse:\n    debug = lambda x: None\n\n\n# SCONS_CACHE_MSVC_CONFIG is public, and is documented.\nCONFIG_CACHE = os.environ.get('SCONS_CACHE_MSVC_CONFIG')\nif CONFIG_CACHE in ('1', 'true', 'True'):\n    CONFIG_CACHE = os.path.join(os.path.expanduser('~'), '.scons_msvc_cache')\n\ndef read_script_env_cache():\n    \"\"\" fetch cached msvc env vars if requested, else return empty dict \"\"\"\n    envcache = {}\n    if CONFIG_CACHE:\n        try:\n            with open(CONFIG_CACHE, 'r') as f:\n                envcache = json.load(f)\n        #TODO can use more specific FileNotFoundError when py2 dropped\n        except IOError:\n            # don't fail if no cache file, just proceed without it\n            pass\n    return envcache\n\n\ndef write_script_env_cache(cache):\n    \"\"\" write out cache of msvc env vars if requested \"\"\"\n    if CONFIG_CACHE:\n        try:\n            with open(CONFIG_CACHE, 'w') as f:\n                json.dump(cache, f, indent=2)\n        except TypeError:\n            # data can't serialize to json, don't leave partial file\n            os.remove(CONFIG_CACHE)\n        except IOError:\n            # can't write the file, just skip\n            pass\n\n\n_is_win64 = None\n\ndef is_win64():\n    \"\"\"Return true if running on windows 64 bits.\n\n    Works whether python itself runs in 64 bits or 32 bits.\"\"\"\n    # Unfortunately, python does not provide a useful way to determine\n    # if the underlying Windows OS is 32-bit or 64-bit.  Worse, whether\n    # the Python itself is 32-bit or 64-bit affects what it returns,\n    # so nothing in sys.* or os.* help.\n\n    # Apparently the best solution is to use env vars that Windows\n    # sets.  If PROCESSOR_ARCHITECTURE is not x86, then the python\n    # process is running in 64 bit mode (on a 64-bit OS, 64-bit\n    # hardware, obviously).\n    # If this python is 32-bit but the OS is 64, Windows will set\n    # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null.\n    # (Checking for HKLM\\Software\\Wow6432Node in the registry doesn't\n    # work, because some 32-bit installers create it.)\n    global _is_win64\n    if _is_win64 is None:\n        # I structured these tests to make it easy to add new ones or\n        # add exceptions in the future, because this is a bit fragile.\n        _is_win64 = False\n        if os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') != 'x86':\n            _is_win64 = True\n        if os.environ.get('PROCESSOR_ARCHITEW6432'):\n            _is_win64 = True\n        if os.environ.get('ProgramW6432'):\n            _is_win64 = True\n    return _is_win64\n\n\ndef read_reg(value, hkroot=SCons.Util.HKEY_LOCAL_MACHINE):\n    return SCons.Util.RegGetValue(hkroot, value)[0]\n\ndef has_reg(value):\n    \"\"\"Return True if the given key exists in HKEY_LOCAL_MACHINE, False\n    otherwise.\"\"\"\n    try:\n        SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)\n        ret = True\n    except SCons.Util.WinError:\n        ret = False\n    return ret\n\n# Functions for fetching environment variable settings from batch files.\n\ndef normalize_env(env, keys, force=False):\n    \"\"\"Given a dictionary representing a shell environment, add the variables\n    from os.environ needed for the processing of .bat files; the keys are\n    controlled by the keys argument.\n\n    It also makes sure the environment values are correctly encoded.\n\n    If force=True, then all of the key values that exist are copied\n    into the returned dictionary.  If force=false, values are only\n    copied if the key does not already exist in the copied dictionary.\n\n    Note: the environment is copied.\"\"\"\n    normenv = {}\n    if env:\n        for k in list(env.keys()):\n            normenv[k] = copy.deepcopy(env[k])\n\n        for k in keys:\n            if k in os.environ and (force or k not in normenv):\n                normenv[k] = os.environ[k]\n\n    # This shouldn't be necessary, since the default environment should include system32,\n    # but keep this here to be safe, since it's needed to find reg.exe which the MSVC\n    # bat scripts use.\n    sys32_dir = os.path.join(os.environ.get(\"SystemRoot\",\n                                            os.environ.get(\"windir\", r\"C:\\Windows\\system32\")),\n                             \"System32\")\n\n    if sys32_dir not in normenv['PATH']:\n        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir\n\n    # Without Wbem in PATH, vcvarsall.bat has a \"'wmic' is not recognized\"\n    # error starting with Visual Studio 2017, although the script still\n    # seems to work anyway.\n    sys32_wbem_dir = os.path.join(sys32_dir, 'Wbem')\n    if sys32_wbem_dir not in normenv['PATH']:\n        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir\n\n    debug(\"PATH: %s\"%normenv['PATH'])\n\n    return normenv\n\ndef get_output(vcbat, args = None, env = None):\n    \"\"\"Parse the output of given bat file, with given args.\"\"\"\n\n    if env is None:\n        # Create a blank environment, for use in launching the tools\n        env = SCons.Environment.Environment(tools=[])\n\n    # TODO:  This is a hard-coded list of the variables that (may) need\n    # to be imported from os.environ[] for v[sc]*vars*.bat file\n    # execution to work.  This list should really be either directly\n    # controlled by vc.py, or else derived from the common_tools_var\n    # settings in vs.py.\n    vs_vc_vars = [\n        'COMSPEC',\n        # VS100 and VS110: Still set, but modern MSVC setup scripts will\n        # discard these if registry has values.  However Intel compiler setup\n        # script still requires these as of 2013/2014.\n        'VS140COMNTOOLS',\n        'VS120COMNTOOLS',\n        'VS110COMNTOOLS',\n        'VS100COMNTOOLS',\n        'VS90COMNTOOLS',\n        'VS80COMNTOOLS',\n        'VS71COMNTOOLS',\n        'VS70COMNTOOLS',\n        'VS60COMNTOOLS',\n    ]\n    env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False)\n\n    if args:\n        debug(\"Calling '%s %s'\" % (vcbat, args))\n        popen = SCons.Action._subproc(env,\n                                      '\"%s\" %s & set' % (vcbat, args),\n                                      stdin='devnull',\n                                      stdout=subprocess.PIPE,\n                                      stderr=subprocess.PIPE)\n    else:\n        debug(\"Calling '%s'\" % vcbat)\n        popen = SCons.Action._subproc(env,\n                                      '\"%s\" & set' % vcbat,\n                                      stdin='devnull',\n                                      stdout=subprocess.PIPE,\n                                      stderr=subprocess.PIPE)\n\n    # Use the .stdout and .stderr attributes directly because the\n    # .communicate() method uses the threading module on Windows\n    # and won't work under Pythons not built with threading.\n    with popen.stdout:\n        stdout = popen.stdout.read()\n    with popen.stderr:\n        stderr = popen.stderr.read()\n\n    # Extra debug logic, uncomment if necessary\n#     debug('get_output():stdout:%s'%stdout)\n#     debug('get_output():stderr:%s'%stderr)\n\n    if stderr:\n        # TODO: find something better to do with stderr;\n        # this at least prevents errors from getting swallowed.\n\n        # Nuitka: this is writing bytes to stderr which wants unicode\n        sys.stderr.write(stderr.decode(\"mbcs\"))\n    if popen.wait() != 0:\n        raise IOError(stderr.decode(\"mbcs\"))\n\n    output = stdout.decode(\"mbcs\")\n    return output\n\nKEEPLIST = (\"INCLUDE\", \"LIB\", \"LIBPATH\", \"PATH\", 'VSCMD_ARG_app_plat')\n# Nuitka: Keep the Windows SDK version too\nKEEPLIST += (\"WindowsSDKVersion\",)\n\ndef parse_output(output, keep=KEEPLIST):\n    \"\"\"\n    Parse output from running visual c++/studios vcvarsall.bat and running set\n    To capture the values listed in keep\n    \"\"\"\n\n    # dkeep is a dict associating key: path_list, where key is one item from\n    # keep, and path_list the associated list of paths\n    dkeep = dict([(i, []) for i in keep])\n\n    # rdk will  keep the regex to match the .bat file output line starts\n    rdk = {}\n    for i in keep:\n        rdk[i] = re.compile('%s=(.*)' % i, re.I)\n\n    def add_env(rmatch, key, dkeep=dkeep):\n        path_list = rmatch.group(1).split(os.pathsep)\n        for path in path_list:\n            # Do not add empty paths (when a var ends with ;)\n            if path:\n                # XXX: For some reason, VC98 .bat file adds \"\" around the PATH\n                # values, and it screws up the environment later, so we strip\n                # it.\n                path = path.strip('\"')\n                dkeep[key].append(str(path))\n\n    for line in output.splitlines():\n        for k, value in rdk.items():\n            match = value.match(line)\n            if match:\n                add_env(match, k)\n\n    return dkeep\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/netframework.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/netframework.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"\n\"\"\"\n\nimport os\nimport re\nimport SCons.Util\n\nfrom .common import read_reg, debug\n\n# Original value recorded by dcournapeau\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\.NETFramework\\InstallRoot'\n# On SGK's system\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\Microsoft SDKs\\.NETFramework\\v2.0\\InstallationFolder'\n\ndef find_framework_root():\n    # XXX: find it from environment (FrameworkDir)\n    try:\n        froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT)\n        debug(\"Found framework install root in registry: {}\".format(froot))\n    except SCons.Util.WinError as e:\n        debug(\"Could not read reg key {}\".format(_FRAMEWORKDIR_HKEY_ROOT))\n        return None\n\n    if not os.path.exists(froot):\n        debug(\"{} not found on fs\".format(froot))\n        return None\n\n    return froot\n\ndef query_versions():\n    froot = find_framework_root()\n    if froot:\n        contents = os.listdir(froot)\n\n        l = re.compile('v[0-9]+.*')\n        versions = [e for e in contents if l.match(e)]\n\n        def versrt(a,b):\n            # since version numbers aren't really floats...\n            aa = a[1:]\n            bb = b[1:]\n            aal = aa.split('.')\n            bbl = bb.split('.')\n            # sequence comparison in python is lexicographical\n            # which is exactly what we want.\n            # Note we sort backwards so the highest version is first.\n            return (aal > bbl) - (aal < bbl)\n\n        versions.sort(versrt)\n    else:\n        versions = []\n\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/sdk.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/sdk.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"Module to detect the Platform/Windows SDK\n\nPSDK 2003 R1 is the earliest version detected.\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nfrom . import common\n\ndebug = common.debug\n\n# SDK Checks. This is of course a mess as everything else on MS platforms. Here\n# is what we do to detect the SDK:\n#\n# For Windows SDK >= 6.0: just look into the registry entries:\n#   HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows\n# All the keys in there are the available versions.\n#\n# For Platform SDK before 6.0 (2003 server R1 and R2, etc...), there does not\n# seem to be any sane registry key, so the precise location is hardcoded.\n#\n# For versions below 2003R1, it seems the PSDK is included with Visual Studio?\n#\n# Also, per the following:\n#     http://benjamin.smedbergs.us/blog/tag/atl/\n# VC++ Professional comes with the SDK, VC++ Express does not.\n\n# Location of the SDK (checked for 6.1 only)\n_CURINSTALLED_SDK_HKEY_ROOT = \\\n        r\"Software\\Microsoft\\Microsoft SDKs\\Windows\\CurrentInstallFolder\"\n\n\nclass SDKDefinition(object):\n    \"\"\"\n    An abstract base class for trying to find installed SDK directories.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        self.__dict__.update(kw)\n\n    def find_sdk_dir(self):\n        \"\"\"Try to find the MS SDK from the registry.\n\n        Return None if failed or the directory does not exist.\n        \"\"\"\n        if not SCons.Util.can_read_reg:\n            debug('find_sdk_dir(): can not read registry')\n            return None\n\n        hkey = self.HKEY_FMT % self.hkey_data\n        debug('find_sdk_dir(): checking registry:{}'.format(hkey))\n\n        try:\n            sdk_dir = common.read_reg(hkey)\n        except SCons.Util.WinError as e:\n            debug('find_sdk_dir(): no SDK registry key {}'.format(repr(hkey)))\n            return None\n\n        debug('find_sdk_dir(): Trying SDK Dir: {}'.format(sdk_dir))\n\n        if not os.path.exists(sdk_dir):\n            debug('find_sdk_dir():  {} not on file system'.format(sdk_dir))\n            return None\n\n        ftc = os.path.join(sdk_dir, self.sanity_check_file)\n        if not os.path.exists(ftc):\n            debug(\"find_sdk_dir(): sanity check {} not found\".format(ftc))\n            return None\n\n        return sdk_dir\n\n    def get_sdk_dir(self):\n        \"\"\"Return the MSSSDK given the version string.\"\"\"\n        try:\n            return self._sdk_dir\n        except AttributeError:\n            sdk_dir = self.find_sdk_dir()\n            self._sdk_dir = sdk_dir\n            return sdk_dir\n\n    def get_sdk_vc_script(self,host_arch, target_arch):\n        \"\"\" Return the script to initialize the VC compiler installed by SDK\n        \"\"\"\n\n        if (host_arch == 'amd64' and target_arch == 'x86'):\n            # No cross tools needed compiling 32 bits on 64 bit machine\n            host_arch=target_arch\n\n        arch_string=target_arch\n        if (host_arch != target_arch):\n            arch_string='%s_%s'%(host_arch,target_arch)\n\n        debug(\"get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s\"%(arch_string,\n                                                           host_arch,\n                                                           target_arch))\n        file=self.vc_setup_scripts.get(arch_string,None)\n        debug(\"get_sdk_vc_script():file:%s\"%file)\n        return file\n\nclass WindowsSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Windows SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\Microsoft SDKs\\Windows\\v%s\\InstallationFolder'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.version\n\nclass PlatformSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Platform SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\MicrosoftSDK\\InstalledSDKS\\%s\\Install Dir'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.uuid\n\n#\n# The list of VC initialization scripts installed by the SDK\n# These should be tried if the vcvarsall.bat TARGET_ARCH fails\npreSDK61VCSetupScripts = { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvarsamd64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\nSDK61VCSetupScripts = {'x86'      : r'bin\\vcvars32.bat',\n                       'amd64'    : r'bin\\amd64\\vcvarsamd64.bat',\n                       'x86_amd64': r'bin\\x86_amd64\\vcvarsx86_amd64.bat',\n                       'x86_ia64' : r'bin\\x86_ia64\\vcvarsx86_ia64.bat',\n                       'ia64'     : r'bin\\ia64\\vcvarsia64.bat'}\n\nSDK70VCSetupScripts =    { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvars64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\nSDK100VCSetupScripts =    {'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvars64.bat',\n                           'x86_amd64': r'bin\\x86_amd64\\vcvarsx86_amd64.bat',\n                           'x86_arm'  : r'bin\\x86_arm\\vcvarsx86_arm.bat'}\n\n\n# The list of support SDKs which we know how to detect.\n#\n# The first SDK found in the list is the one used by default if there\n# are multiple SDKs installed.  Barring good reasons to the contrary,\n# this means we should list SDKs from most recent to oldest.\n#\n# If you update this list, update the documentation in Tool/mssdk.xml.\nSupportedSDKList = [\n    WindowsSDK('10.0A',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('10.0',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0A',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('6.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0A',\n               sanity_check_file=r'include\\windows.h',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0',\n               sanity_check_file=r'bin\\gacutil.exe',\n               include_subdir='include',\n               lib_subdir='lib',\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    PlatformSDK('2003R2',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n\n    PlatformSDK('2003R1',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n]\n\nSupportedSDKMap = {}\nfor sdk in SupportedSDKList:\n    SupportedSDKMap[sdk.version] = sdk\n\n\n# Finding installed SDKs isn't cheap, because it goes not only to the\n# registry but also to the disk to sanity-check that there is, in fact,\n# an SDK installed there and that the registry entry isn't just stale.\n# Find this information once, when requested, and cache it.\n\nInstalledSDKList = None\nInstalledSDKMap = None\n\ndef get_installed_sdks():\n    global InstalledSDKList\n    global InstalledSDKMap\n    debug('get_installed_sdks()')\n    if InstalledSDKList is None:\n        InstalledSDKList = []\n        InstalledSDKMap = {}\n        for sdk in SupportedSDKList:\n            debug('trying to find SDK %s' % sdk.version)\n            if sdk.get_sdk_dir():\n                debug('found SDK %s' % sdk.version)\n                InstalledSDKList.append(sdk)\n                InstalledSDKMap[sdk.version] = sdk\n    return InstalledSDKList\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\nSDKEnvironmentUpdates = {}\n\ndef set_sdk_by_directory(env, sdk_dir):\n    global SDKEnvironmentUpdates\n    debug('set_sdk_by_directory: Using dir:%s'%sdk_dir)\n    try:\n        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n    except KeyError:\n        env_tuple_list = []\n        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n\n        include_path = os.path.join(sdk_dir, 'include')\n        mfc_path = os.path.join(include_path, 'mfc')\n        atl_path = os.path.join(include_path, 'atl')\n\n        if os.path.exists(mfc_path):\n            env_tuple_list.append(('INCLUDE', mfc_path))\n        if os.path.exists(atl_path):\n            env_tuple_list.append(('INCLUDE', atl_path))\n        env_tuple_list.append(('INCLUDE', include_path))\n\n        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n\n    for variable, directory in env_tuple_list:\n        env.PrependENVPath(variable, directory)\n\ndef get_sdk_by_version(mssdk):\n    if mssdk not in SupportedSDKMap:\n        raise SCons.Errors.UserError(\"SDK version {} is not supported\".format(repr(mssdk)))\n    get_installed_sdks()\n    return InstalledSDKMap.get(mssdk)\n\ndef get_default_sdk():\n    \"\"\"Set up the default Platform/Windows SDK.\"\"\"\n    get_installed_sdks()\n    if not InstalledSDKList:\n        return None\n    return InstalledSDKList[0]\n\ndef mssdk_setup_env(env):\n    debug('mssdk_setup_env()')\n    if 'MSSDK_DIR' in env:\n        sdk_dir = env['MSSDK_DIR']\n        if sdk_dir is None:\n            return\n        sdk_dir = env.subst(sdk_dir)\n        debug('mssdk_setup_env: Using MSSDK_DIR:{}'.format(sdk_dir))\n    elif 'MSSDK_VERSION' in env:\n        sdk_version = env['MSSDK_VERSION']\n        if sdk_version is None:\n            msg = \"SDK version is specified as None\"\n            raise SCons.Errors.UserError(msg)\n        sdk_version = env.subst(sdk_version)\n        mssdk = get_sdk_by_version(sdk_version)\n        if mssdk is None:\n            msg = \"SDK version %s is not installed\" % sdk_version\n            raise SCons.Errors.UserError(msg)\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir)\n    elif 'MSVS_VERSION' in env:\n        msvs_version = env['MSVS_VERSION']\n        debug('mssdk_setup_env:Getting MSVS_VERSION from env:%s'%msvs_version)\n        if msvs_version is None:\n            debug('mssdk_setup_env thinks msvs_version is None')\n            return\n        msvs_version = env.subst(msvs_version)\n        from . import vs\n        msvs = vs.get_vs_by_version(msvs_version)\n        debug('mssdk_setup_env:msvs is :%s'%msvs)\n        if not msvs:\n            debug('mssdk_setup_env: no VS version detected, bailingout:%s'%msvs)\n            return\n        sdk_version = msvs.sdk_version\n        debug('msvs.sdk_version is %s'%sdk_version)\n        if not sdk_version:\n            return\n        mssdk = get_sdk_by_version(sdk_version)\n        if not mssdk:\n            mssdk = get_default_sdk()\n            if not mssdk:\n                return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: Using MSVS_VERSION:%s'%sdk_dir)\n    else:\n        mssdk = get_default_sdk()\n        if not mssdk:\n            return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: not using any env values. sdk_dir:%s'%sdk_dir)\n\n    set_sdk_by_directory(env, sdk_dir)\n\n    #print \"No MSVS_VERSION: this is likely to be a bug\"\n\ndef mssdk_exists(version=None):\n    sdks = get_installed_sdks()\n    if version is None:\n        return len(sdks) > 0\n    return version in sdks\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/vc.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# TODO:\n#   * supported arch for versions: for old versions of batch file without\n#     argument, giving bogus argument cannot be detected, so we have to hardcode\n#     this here\n#   * print warning when msvc version specified but not found\n#   * find out why warning do not print\n#   * test on 64 bits XP +  VS 2005 (and VS 6 if possible)\n#   * SDK\n#   * Assembly\n__revision__ = \"src/engine/SCons/Tool/MSCommon/vc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"Module for Visual C/C++ detection and configuration.\n\"\"\"\nimport SCons.compat\nimport SCons.Util\n\nimport subprocess\nimport os\nimport platform\nimport sys\nfrom string import digits as string_digits\nif sys.version_info[0] == 2:\n    import collections\n\nimport SCons.Warnings\nfrom SCons.Tool import find_program_path\n\nfrom . import common\n\ndebug = common.debug\n\nfrom . import sdk\n\nget_installed_sdks = sdk.get_installed_sdks\n\n\nclass VisualCException(Exception):\n    pass\n\nclass UnsupportedVersion(VisualCException):\n    pass\n\nclass MSVCUnsupportedHostArch(VisualCException):\n    pass\n\nclass MSVCUnsupportedTargetArch(VisualCException):\n    pass\n\nclass MissingConfiguration(VisualCException):\n    pass\n\nclass NoVersionFound(VisualCException):\n    pass\n\nclass BatchFileExecutionError(VisualCException):\n    pass\n\n# Dict to 'canonalize' the arch\n_ARCH_TO_CANONICAL = {\n    \"amd64\"     : \"amd64\",\n    \"emt64\"     : \"amd64\",\n    \"i386\"      : \"x86\",\n    \"i486\"      : \"x86\",\n    \"i586\"      : \"x86\",\n    \"i686\"      : \"x86\",\n    \"ia64\"      : \"ia64\",      # deprecated\n    \"itanium\"   : \"ia64\",      # deprecated\n    \"x86\"       : \"x86\",\n    \"x86_64\"    : \"amd64\",\n    \"arm\"       : \"arm\",\n    \"arm64\"     : \"arm64\",\n    \"aarch64\"   : \"arm64\",\n}\n\n_HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = {\n    (\"amd64\",\"amd64\")  : (\"Hostx64\",\"x64\"),\n    (\"amd64\",\"x86\")    : (\"Hostx64\",\"x86\"),\n    (\"amd64\",\"arm\")    : (\"Hostx64\",\"arm\"),\n    (\"amd64\",\"arm64\")  : (\"Hostx64\",\"arm64\"),\n    (\"x86\",\"amd64\")    : (\"Hostx86\",\"x64\"),\n    (\"x86\",\"x86\")      : (\"Hostx86\",\"x86\"),\n    (\"x86\",\"arm\")      : (\"Hostx86\",\"arm\"),\n    (\"x86\",\"arm64\")    : (\"Hostx86\",\"arm64\"),\n}\n\n# get path to the cl.exe dir for older VS versions\n# based off a tuple of (host, target) platforms\n_HOST_TARGET_TO_CL_DIR = {\n    (\"amd64\",\"amd64\")  : \"amd64\",\n    (\"amd64\",\"x86\")    : \"amd64_x86\",\n    (\"amd64\",\"arm\")    : \"amd64_arm\",\n    (\"amd64\",\"arm64\")  : \"amd64_arm64\",\n    (\"x86\",\"amd64\")    : \"x86_amd64\",\n    (\"x86\",\"x86\")      : \"\",\n    (\"x86\",\"arm\")      : \"x86_arm\",\n    (\"x86\",\"arm64\")    : \"x86_arm64\",\n}\n\n# Given a (host, target) tuple, return the argument for the bat file.\n# Both host and targets should be canonalized.\n_HOST_TARGET_ARCH_TO_BAT_ARCH = {\n    (\"x86\", \"x86\"): \"x86\",\n    (\"x86\", \"amd64\"): \"x86_amd64\",\n    (\"x86\", \"x86_amd64\"): \"x86_amd64\",\n    (\"amd64\", \"x86_amd64\"): \"x86_amd64\", # This is present in (at least) VS2012 express\n    (\"amd64\", \"amd64\"): \"amd64\",\n    (\"amd64\", \"x86\"): \"x86\",\n    (\"x86\", \"ia64\"): \"x86_ia64\",         # gone since 14.0\n    (\"arm\", \"arm\"): \"arm\",              # since 14.0, maybe gone 14.1?\n    (\"x86\", \"arm\"): \"x86_arm\",          # since 14.0\n    (\"x86\", \"arm64\"): \"x86_arm64\",      # since 14.1\n    (\"amd64\", \"arm\"): \"amd64_arm\",      # since 14.0\n    (\"amd64\", \"arm64\"): \"amd64_arm64\",  # since 14.1\n}\n\n_CL_EXE_NAME = 'cl.exe'\n\ndef get_msvc_version_numeric(msvc_version):\n    \"\"\"Get the raw version numbers from a MSVC_VERSION string, so it\n    could be cast to float or other numeric values. For example, '14.0Exp'\n    would get converted to '14.0'.\n\n    Args:\n        msvc_version: str\n            string representing the version number, could contain non\n            digit characters\n\n    Returns:\n        str: the value converted to a numeric only string\n\n    \"\"\"\n    return ''.join([x for  x in msvc_version if x in string_digits + '.'])\n\ndef get_host_target(env):\n    debug('get_host_target()')\n\n    host_platform = env.get('HOST_ARCH')\n    if not host_platform:\n        host_platform = platform.machine()\n\n    # Solaris returns i86pc for both 32 and 64 bit architectures\n    if host_platform == \"i86pc\":\n        if platform.architecture()[0] == \"64bit\":\n            host_platform = \"amd64\"\n        else:\n            host_platform = \"x86\"\n\n    # Retain user requested TARGET_ARCH\n    req_target_platform = env.get('TARGET_ARCH')\n    debug('get_host_target() req_target_platform:%s'%req_target_platform)\n\n    if req_target_platform:\n        # If user requested a specific platform then only try that one.\n        target_platform = req_target_platform\n    else:\n        target_platform = host_platform\n\n    try:\n        host = _ARCH_TO_CANONICAL[host_platform.lower()]\n    except KeyError:\n        msg = \"Unrecognized host architecture %s\"\n        raise MSVCUnsupportedHostArch(msg % repr(host_platform))\n\n    try:\n        target = _ARCH_TO_CANONICAL[target_platform.lower()]\n    except KeyError:\n        all_archs = str(list(_ARCH_TO_CANONICAL.keys()))\n        raise MSVCUnsupportedTargetArch(\"Unrecognized target architecture %s\\n\\tValid architectures: %s\" % (target_platform, all_archs))\n\n    return (host, target,req_target_platform)\n\n# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the\n# MSVC_VERSION documentation in Tool/msvc.xml.\n_VCVER = [\"14.2\", \"14.1\", \"14.0\", \"14.0Exp\", \"12.0\", \"12.0Exp\", \"11.0\", \"11.0Exp\", \"10.0\", \"10.0Exp\", \"9.0\", \"9.0Exp\",\"8.0\", \"8.0Exp\",\"7.1\", \"7.0\", \"6.0\"]\n\n# if using vswhere, a further mapping is needed\n_VCVER_TO_VSWHERE_VER = {\n    '14.2' : '[16.0, 17.0)',\n    '14.1' : '[15.0, 16.0)',\n}\n\n_VCVER_TO_PRODUCT_DIR = {\n    '14.2' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2019 doesn't set this key\n    '14.1' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2017 doesn't set this key\n    '14.0' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir')],\n    '14.0Exp' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\14.0\\Setup\\VC\\ProductDir')],\n    '12.0' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir'),\n        ],\n    '12.0Exp' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir'),\n        ],\n    '11.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir'),\n        ],\n    '11.0Exp' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir'),\n        ],\n    '10.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir'),\n        ],\n    '10.0Exp' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir'),\n        ],\n    '9.0': [\n        (SCons.Util.HKEY_CURRENT_USER, r'Microsoft\\DevDiv\\VCForPython\\9.0\\installdir',),\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir',),\n        ],\n    '9.0Exp' : [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir'),\n        ],\n    '8.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir'),\n        ],\n    '8.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir'),\n        ],\n    '7.1': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir'),\n        ],\n    '7.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir'),\n        ],\n    '6.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir'),\n        ]\n}\n\ndef msvc_version_to_maj_min(msvc_version):\n    msvc_version_numeric = get_msvc_version_numeric(msvc_version)\n\n    t = msvc_version_numeric.split(\".\")\n    if not len(t) == 2:\n        raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n    try:\n        maj = int(t[0])\n        min = int(t[1])\n        return maj, min\n    except ValueError as e:\n        raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n\ndef is_host_target_supported(host_target, msvc_version):\n    \"\"\"Check if (host, target) pair is supported for a VC version.\n\n    :note: only checks whether a given version *may* support the given (host,\n        target), not that the toolchain is actually present on the machine.\n    :param tuple host_target: canonalized host-targets pair, e.g.\n        (\"x86\", \"amd64\") for cross compilation from 32 bit Windows to 64 bits.\n    :param str msvc_version: Visual C++ version (major.minor), e.g. \"10.0\"\n    :returns: True or False\n    \"\"\"\n    # We assume that any Visual Studio version supports x86 as a target\n    if host_target[1] != \"x86\":\n        maj, min = msvc_version_to_maj_min(msvc_version)\n        if maj < 8:\n            return False\n    return True\n\n\ndef find_vc_pdir_vswhere(msvc_version):\n    \"\"\"\n    Find the MSVC product directory using the vswhere program.\n\n    :param msvc_version: MSVC version to search for\n    :return: MSVC install dir or None\n    :raises UnsupportedVersion: if the version is not known by this file\n    \"\"\"\n\n    try:\n        vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version]\n    except KeyError:\n        debug(\"Unknown version of MSVC: %s\" % msvc_version)\n        raise UnsupportedVersion(\"Unknown version %s\" % msvc_version)\n\n    # For bug 3333 - support default location of vswhere for both 64 and 32 bit windows\n    # installs.\n    for pf in ['Program Files (x86)', 'Program Files']:\n        vswhere_path = os.path.join(\n            'C:\\\\',\n            pf,\n            'Microsoft Visual Studio',\n            'Installer',\n            'vswhere.exe'\n        )\n        if os.path.exists(vswhere_path):\n            # If we found vswhere, then use it.\n            break\n    else:\n        # No vswhere on system, no install info available\n        return None\n\n    vswhere_cmd = [vswhere_path,\n                   '-products', '*',\n                   '-version', vswhere_version,\n                   '-property', 'installationPath']\n\n    #TODO PY27 cannot use Popen as context manager\n    # try putting it back to the old way for now\n    sp = subprocess.Popen(vswhere_cmd,\n                          stdout=subprocess.PIPE,\n                          stderr=subprocess.PIPE)\n    vsdir, err = sp.communicate()\n    if vsdir:\n        vsdir = vsdir.decode(\"mbcs\").splitlines()\n        # vswhere could easily return multiple lines\n        # we could define a way to pick the one we prefer, but since\n        # this data is currently only used to make a check for existence,\n        # returning the first hit should be good enough for now.\n        vc_pdir = os.path.join(vsdir[0], 'VC')\n        return vc_pdir\n    else:\n        # No vswhere on system, no install info available\n        return None\n\n\ndef find_vc_pdir(msvc_version):\n    \"\"\"Find the MSVC product directory for the given version.\n\n    Tries to look up the path using a registry key from the table\n    _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere\n    for help instead.\n\n    Args:\n        msvc_version: str\n            msvc version (major.minor, e.g. 10.0)\n\n    Returns:\n        str: Path found in registry, or None\n\n    Raises:\n        UnsupportedVersion: if the version is not known by this file.\n        MissingConfiguration: found version but the directory is missing.\n\n        Both exceptions inherit from VisualCException.\n    \"\"\"\n    root = 'Software\\\\'\n    try:\n        hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version]\n    except KeyError:\n        debug(\"Unknown version of MSVC: %s\" % msvc_version)\n        raise UnsupportedVersion(\"Unknown version %s\" % msvc_version)\n\n    for hkroot, key in hkeys:\n        try:\n            comps = None\n            if not key:\n                comps = find_vc_pdir_vswhere(msvc_version)\n                if not comps:\n                    debug('find_vc_pdir_vswhere(): no VC found for version {}'.format(repr(msvc_version)))\n                    raise SCons.Util.WinError\n                debug('find_vc_pdir_vswhere(): VC found: {}'.format(repr(msvc_version)))\n                return comps\n            else:\n                if common.is_win64():\n                    try:\n                        # ordinally at win64, try Wow6432Node first.\n                        comps = common.read_reg(root + 'Wow6432Node\\\\' + key, hkroot)\n                    except SCons.Util.WinError as e:\n                        # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node\n                        pass\n                if not comps:\n                    # not Win64, or Microsoft Visual Studio for Python 2.7\n                    comps = common.read_reg(root + key, hkroot)\n        except SCons.Util.WinError as e:\n            debug('find_vc_dir(): no VC registry key {}'.format(repr(key)))\n        else:\n            debug('find_vc_dir(): found VC in registry: {}'.format(comps))\n            if os.path.exists(comps):\n                return comps\n            else:\n                debug('find_vc_dir(): reg says dir is {}, but it does not exist. (ignoring)'.format(comps))\n                raise MissingConfiguration(\"registry dir {} not found on the filesystem\".format(comps))\n    return None\n\ndef find_batch_file(env,msvc_version,host_arch,target_arch):\n    \"\"\"\n    Find the location of the batch script which should set up the compiler\n    for any TARGET_ARCH whose compilers were installed by Visual Studio/VCExpress\n    \"\"\"\n    pdir = find_vc_pdir(msvc_version)\n    if pdir is None:\n        raise NoVersionFound(\"No version of Visual Studio found\")\n\n    debug('find_batch_file() in {}'.format(pdir))\n\n    # filter out e.g. \"Exp\" from the version name\n    msvc_ver_numeric = get_msvc_version_numeric(msvc_version)\n    vernum = float(msvc_ver_numeric)\n    if 7 <= vernum < 8:\n        pdir = os.path.join(pdir, os.pardir, \"Common7\", \"Tools\")\n        batfilename = os.path.join(pdir, \"vsvars32.bat\")\n    elif vernum < 7:\n        pdir = os.path.join(pdir, \"Bin\")\n        batfilename = os.path.join(pdir, \"vcvars32.bat\")\n    elif 8 <= vernum <= 14:\n        batfilename = os.path.join(pdir, \"vcvarsall.bat\")\n    else:  # vernum >= 14.1  VS2017 and above\n        batfilename = os.path.join(pdir, \"Auxiliary\", \"Build\", \"vcvarsall.bat\")\n\n    if not os.path.exists(batfilename):\n        debug(\"Not found: %s\" % batfilename)\n        batfilename = None\n\n    installed_sdks = get_installed_sdks()\n    for _sdk in installed_sdks:\n        sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)\n        if not sdk_bat_file:\n            debug(\"find_batch_file() not found:%s\"%_sdk)\n        else:\n            sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)\n            if os.path.exists(sdk_bat_file_path):\n                debug('find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)\n                return (batfilename, sdk_bat_file_path)\n    return (batfilename, None)\n\n\n__INSTALLED_VCS_RUN = None\n_VC_TOOLS_VERSION_FILE_PATH = ['Auxiliary', 'Build', 'Microsoft.VCToolsVersion.default.txt']\n_VC_TOOLS_VERSION_FILE = os.sep.join(_VC_TOOLS_VERSION_FILE_PATH)\n\ndef _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version):\n    \"\"\"Find the cl.exe on the filesystem in the vc_dir depending on\n    TARGET_ARCH, HOST_ARCH and the msvc version. TARGET_ARCH and\n    HOST_ARCH can be extracted from the passed env, unless its None,\n    which then the native platform is assumed the host and target.\n\n    Args:\n        env: Environment\n            a construction environment, usually if this is passed its\n            because there is a desired TARGET_ARCH to be used when searching\n            for a cl.exe\n        vc_dir: str\n            the path to the VC dir in the MSVC installation\n        msvc_version: str\n            msvc version (major.minor, e.g. 10.0)\n\n    Returns:\n        bool:\n\n    \"\"\"\n\n    # determine if there is a specific target platform we want to build for and\n    # use that to find a list of valid VCs, default is host platform == target platform\n    # and same for if no env is specified to extract target platform from\n    if env:\n        (host_platform, target_platform, req_target_platform) = get_host_target(env)\n    else:\n        host_platform = platform.machine().lower()\n        target_platform = host_platform\n\n    host_platform = _ARCH_TO_CANONICAL[host_platform]\n    target_platform = _ARCH_TO_CANONICAL[target_platform]\n\n    debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s for version %s' % (host_platform, target_platform, msvc_version))\n\n    ver_num = float(get_msvc_version_numeric(msvc_version))\n\n    # make sure the cl.exe exists meaning the tool is installed\n    if ver_num > 14:\n        # 2017 and newer allowed multiple versions of the VC toolset to be installed at the same time.\n        # Just get the default tool version for now\n        #TODO: support setting a specific minor VC version\n        default_toolset_file = os.path.join(vc_dir, _VC_TOOLS_VERSION_FILE)\n        try:\n            with open(default_toolset_file) as f:\n                vc_specific_version = f.readlines()[0].strip()\n        except IOError:\n            debug('_check_cl_exists_in_vc_dir(): failed to read ' + default_toolset_file)\n            return False\n        except IndexError:\n            debug('_check_cl_exists_in_vc_dir(): failed to find MSVC version in ' + default_toolset_file)\n            return False\n\n        host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None)\n        if host_trgt_dir is None:\n            debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo: (%s,%s)'%(host_platform, target_platform))\n            return False\n\n        cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin',  host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME)\n        debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n        if os.path.exists(cl_path):\n            debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!')\n            return True\n\n    elif ver_num <= 14 and ver_num >= 8:\n\n        # Set default value to be -1 as \"\" which is the value for x86/x86 yields true when tested\n        # if not host_trgt_dir\n        host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None)\n        if host_trgt_dir is None:\n            debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo')\n            return False\n\n        cl_path = os.path.join(vc_dir, 'bin',  host_trgt_dir, _CL_EXE_NAME)\n        debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n\n        cl_path_exists = os.path.exists(cl_path)\n        if not cl_path_exists and host_platform == 'amd64':\n            # older versions of visual studio only had x86 binaries,\n            # so if the host platform is amd64, we need to check cross\n            # compile options (x86 binary compiles some other target on a 64 bit os)\n\n            # Set default value to be -1 as \"\" which is the value for x86/x86 yields true when tested\n            # if not host_trgt_dir\n            host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None)\n            if host_trgt_dir is None:\n                return False\n\n            cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME)\n            debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n            cl_path_exists = os.path.exists(cl_path)\n\n        if cl_path_exists:\n            debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!')\n            return True\n\n    elif ver_num < 8 and ver_num >= 6:\n        # not sure about these versions so if a walk the VC dir (could be slow)\n        for root, _, files in os.walk(vc_dir):\n            if _CL_EXE_NAME in files:\n                debug('get_installed_vcs ' + _CL_EXE_NAME + ' found %s' % os.path.join(root, _CL_EXE_NAME))\n                return True\n        return False\n    else:\n        # version not support return false\n        debug('_check_cl_exists_in_vc_dir(): unsupported MSVC version: ' + str(ver_num))\n\n    return False\n\ndef cached_get_installed_vcs(env=None):\n    global __INSTALLED_VCS_RUN\n\n    if __INSTALLED_VCS_RUN is None:\n        ret = get_installed_vcs(env)\n        __INSTALLED_VCS_RUN = ret\n\n    return __INSTALLED_VCS_RUN\n\ndef get_installed_vcs(env=None):\n    installed_versions = []\n\n    for ver in _VCVER:\n        debug('trying to find VC %s' % ver)\n        try:\n            VC_DIR = find_vc_pdir(ver)\n            if VC_DIR:\n                debug('found VC %s' % ver)\n                if _check_cl_exists_in_vc_dir(env, VC_DIR, ver):\n                    installed_versions.append(ver)\n                else:\n                    debug('find_vc_pdir no compiler found %s' % ver)\n            else:\n                debug('find_vc_pdir return None for ver %s' % ver)\n        except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch):\n            # Allow this exception to propagate further as it should cause\n            # SCons to exit with an error code\n            raise\n        except VisualCException as e:\n            debug('did not find VC %s: caught exception %s' % (ver, str(e)))\n    return installed_versions\n\ndef reset_installed_vcs():\n    \"\"\"Make it try again to find VC.  This is just for the tests.\"\"\"\n    __INSTALLED_VCS_RUN = None\n\n# Running these batch files isn't cheap: most of the time spent in\n# msvs.generate() is due to vcvars*.bat.  In a build that uses \"tools='msvs'\"\n# in multiple environments, for example:\n#    env1 = Environment(tools='msvs')\n#    env2 = Environment(tools='msvs')\n# we can greatly improve the speed of the second and subsequent Environment\n# (or Clone) calls by memoizing the environment variables set by vcvars*.bat.\n#\n# Updated: by 2018, vcvarsall.bat had gotten so expensive (vs2017 era)\n# it was breaking CI builds because the test suite starts scons so many\n# times and the existing memo logic only helped with repeated calls\n# within the same scons run. Windows builds on the CI system were split\n# into chunks to get around single-build time limits.\n# With VS2019 it got even slower and an optional persistent cache file\n# was introduced. The cache now also stores only the parsed vars,\n# not the entire output of running the batch file - saves a bit\n# of time not parsing every time.\n\nscript_env_cache = None\n\ndef script_env(script, args=None):\n    global script_env_cache\n\n    if script_env_cache is None:\n        script_env_cache = common.read_script_env_cache()\n    cache_key = \"{}--{}\".format(script, args)\n    cache_data = script_env_cache.get(cache_key, None)\n    if cache_data is None:\n        stdout = common.get_output(script, args)\n\n        # Stupid batch files do not set return code: we take a look at the\n        # beginning of the output for an error message instead\n        olines = stdout.splitlines()\n        if olines[0].startswith(\"The specified configuration type is missing\"):\n            raise BatchFileExecutionError(\"\\n\".join(olines[:2]))\n\n        cache_data = common.parse_output(stdout)\n        script_env_cache[cache_key] = cache_data\n        # once we updated cache, give a chance to write out if user wanted\n        common.write_script_env_cache(script_env_cache)\n    else:\n        #TODO: Python 2 cleanup\n        # If we \"hit\" data from the json file, we have a Py2 problem:\n        # keys & values will be unicode. don't detect, just convert.\n        if sys.version_info[0] == 2:\n            def convert(data):\n                if isinstance(data, basestring):\n                    return str(data)\n                elif isinstance(data, collections.Mapping):\n                    return dict(map(convert, data.iteritems()))\n                elif isinstance(data, collections.Iterable):\n                    return type(data)(map(convert, data))\n                else:\n                    return data\n\n            cache_data = convert(cache_data)\n\n    return cache_data\n\ndef get_default_version(env):\n    debug('get_default_version()')\n\n    msvc_version = env.get('MSVC_VERSION')\n    msvs_version = env.get('MSVS_VERSION')\n\n    debug('get_default_version(): msvc_version:%s msvs_version:%s'%(msvc_version,msvs_version))\n\n    if msvs_version and not msvc_version:\n        SCons.Warnings.warn(\n                SCons.Warnings.DeprecatedWarning,\n                \"MSVS_VERSION is deprecated: please use MSVC_VERSION instead \")\n        return msvs_version\n    elif msvc_version and msvs_version:\n        if not msvc_version == msvs_version:\n            SCons.Warnings.warn(\n                    SCons.Warnings.VisualVersionMismatch,\n                    \"Requested msvc version (%s) and msvs version (%s) do \" \\\n                    \"not match: please use MSVC_VERSION only to request a \" \\\n                    \"visual studio version, MSVS_VERSION is deprecated\" \\\n                    % (msvc_version, msvs_version))\n        return msvs_version\n    if not msvc_version:\n        installed_vcs = cached_get_installed_vcs(env)\n        debug('installed_vcs:%s' % installed_vcs)\n        if not installed_vcs:\n            #msg = 'No installed VCs'\n            #debug('msv %s' % repr(msg))\n            #SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg)\n            debug('msvc_setup_env: No installed VCs')\n            return None\n        msvc_version = installed_vcs[0]\n        debug('msvc_setup_env: using default installed MSVC version %s' % repr(msvc_version))\n\n    return msvc_version\n\ndef msvc_setup_env_once(env):\n    try:\n        has_run  = env[\"MSVC_SETUP_RUN\"]\n    except KeyError:\n        has_run = False\n\n    if not has_run:\n        msvc_setup_env(env)\n        env[\"MSVC_SETUP_RUN\"] = True\n\ndef msvc_find_valid_batch_script(env, version):\n    debug('msvc_find_valid_batch_script()')\n    # Find the host platform, target platform, and if present the requested\n    # target platform\n    platforms = get_host_target(env)\n    debug(\" msvs_find_valid_batch_script(): host_platform %s, target_platform %s req_target_platform:%s\" % platforms)\n\n    host_platform, target_platform, req_target_platform = platforms\n    try_target_archs = [target_platform]\n\n    # VS2012 has a \"cross compile\" environment to build 64 bit\n    # with x86_amd64 as the argument to the batch setup script\n    if req_target_platform in ('amd64', 'x86_64'):\n        try_target_archs.append('x86_amd64')\n    elif not req_target_platform and target_platform in ['amd64', 'x86_64']:\n        # There may not be \"native\" amd64, but maybe \"cross\" x86_amd64 tools\n        try_target_archs.append('x86_amd64')\n        # If the user hasn't specifically requested a TARGET_ARCH, and\n        # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable\n        # 64 bit tools installed\n        try_target_archs.append('x86')\n\n    debug(\"msvs_find_valid_batch_script(): host_platform: %s try_target_archs:%s\"%(host_platform, try_target_archs))\n\n    d = None\n    for tp in try_target_archs:\n        # Set to current arch.\n        env['TARGET_ARCH']=tp\n\n        debug(\"msvc_find_valid_batch_script() trying target_platform:%s\"%tp)\n        host_target = (host_platform, tp)\n        if not is_host_target_supported(host_target, version):\n            warn_msg = \"host, target = %s not supported for MSVC version %s\" % \\\n                (host_target, version)\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target]\n\n        # Get just version numbers\n        maj, min = msvc_version_to_maj_min(version)\n        # VS2015+\n        if maj >= 14:\n            if env.get('MSVC_UWP_APP') == '1':\n                # Initialize environment variables with store/universal paths\n                arg += ' store'\n\n        # Try to locate a batch file for this host/target platform combo\n        try:\n            (vc_script, sdk_script) = find_batch_file(env, version, host_platform, tp)\n            debug('msvc_find_valid_batch_script() vc_script:%s sdk_script:%s'%(vc_script,sdk_script))\n        except VisualCException as e:\n            msg = str(e)\n            debug('Caught exception while looking for batch file (%s)' % msg)\n            warn_msg = \"VC version %s not installed.  \" + \\\n                       \"C/C++ compilers are most likely not set correctly.\\n\" + \\\n                       \" Installed versions are: %s\"\n            warn_msg = warn_msg % (version, cached_get_installed_vcs(env))\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n            continue\n\n        # Try to use the located batch file for this host/target platform combo\n        debug('msvc_find_valid_batch_script() use_script 2 %s, args:%s' % (repr(vc_script), arg))\n        found = None\n        if vc_script:\n            try:\n                d = script_env(vc_script, args=arg)\n                found = vc_script\n            except BatchFileExecutionError as e:\n                debug('msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e))\n                vc_script=None\n                continue\n        if not vc_script and sdk_script:\n            debug('msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script))\n            try:\n                d = script_env(sdk_script)\n                found = sdk_script\n            except BatchFileExecutionError as e:\n                debug('msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e))\n                continue\n        elif not vc_script and not sdk_script:\n            debug('msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found')\n            continue\n\n        debug(\"msvc_find_valid_batch_script() Found a working script/target: %s/%s\"%(repr(found),arg))\n        break # We've found a working target_platform, so stop looking\n\n    # If we cannot find a viable installed compiler, reset the TARGET_ARCH\n    # To it's initial value\n    if not d:\n        env['TARGET_ARCH']=req_target_platform\n\n    return d\n\n\ndef msvc_setup_env(env):\n    debug('msvc_setup_env()')\n\n    version = get_default_version(env)\n    if version is None:\n        warn_msg = \"No version of Visual Studio compiler found - C/C++ \" \\\n                   \"compilers most likely not set correctly\"\n\n        # Nuitka: Useless warning for us.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n    debug('msvc_setup_env: using specified MSVC version %s' % repr(version))\n\n    # XXX: we set-up both MSVS version for backward\n    # compatibility with the msvs tool\n    env['MSVC_VERSION'] = version\n    env['MSVS_VERSION'] = version\n    env['MSVS'] = {}\n\n\n    use_script = env.get('MSVC_USE_SCRIPT', True)\n    if SCons.Util.is_String(use_script):\n        debug('msvc_setup_env() use_script 1 %s' % repr(use_script))\n        d = script_env(use_script)\n    elif use_script:\n        d = msvc_find_valid_batch_script(env,version)\n        debug('msvc_setup_env() use_script 2 %s' % d)\n        if not d:\n            return d\n    else:\n        debug('MSVC_USE_SCRIPT set to False')\n        warn_msg = \"MSVC_USE_SCRIPT set to False, assuming environment \" \\\n                   \"set correctly.\"\n        # Nuitka: We use this on purpose.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n\n    for k, v in d.items():\n        # Nuitka: Make the Windows SDK version visible in environment.\n        if k == \"WindowsSDKVersion\":\n            # Always just a single version if any.\n            if len(v) == 1:\n                env[\"WindowsSDKVersion\"] = v[0].rstrip('\\\\')\n            elif len(v) == 0:\n                env[\"WindowsSDKVersion\"] = None\n            else:\n                assert False, v\n\n            continue\n\n        debug('msvc_setup_env() env:%s -> %s'%(k,v))\n        env.PrependENVPath(k, v, delete_existing=True)\n\n    # final check to issue a warning if the compiler is not present\n    msvc_cl = find_program_path(env, 'cl')\n    if not msvc_cl:\n        SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning,\n            \"Could not find MSVC compiler 'cl', it may need to be installed separately with Visual Studio\")\n\ndef msvc_exists(env=None, version=None):\n    vcs = cached_get_installed_vcs(env)\n    if version is None:\n        return len(vcs) > 0\n    return version in vcs\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/MSCommon/vs.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/MSCommon/vs.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"Module to detect Visual Studio and/or Visual C/C++\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nfrom .common import debug, \\\n                   get_output, \\\n                   is_win64, \\\n                   normalize_env, \\\n                   parse_output, \\\n                   read_reg\n\nimport SCons.Tool.MSCommon.vc\n\nclass VisualStudio(object):\n    \"\"\"\n    An abstract base class for trying to find installed versions of\n    Visual Studio.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        kw['vc_version']  = kw.get('vc_version', version)\n        kw['sdk_version'] = kw.get('sdk_version', version)\n        self.__dict__.update(kw)\n        self._cache = {}\n\n    def find_batch_file(self):\n        vs_dir = self.get_vs_dir()\n        if not vs_dir:\n            debug('find_executable():  no vs_dir')\n            return None\n        batch_file = os.path.join(vs_dir, self.batch_file_path)\n        batch_file = os.path.normpath(batch_file)\n        if not os.path.isfile(batch_file):\n            debug('find_batch_file():  %s not on file system' % batch_file)\n            return None\n        return batch_file\n\n    def find_vs_dir_by_vc(self):\n        SCons.Tool.MSCommon.vc.get_installed_vcs()\n        dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version)\n        if not dir:\n            debug('find_vs_dir_by_vc():  no installed VC %s' % self.vc_version)\n            return None\n        return os.path.abspath(os.path.join(dir, os.pardir))\n\n    def find_vs_dir_by_reg(self):\n        root = 'Software\\\\'\n\n        if is_win64():\n            root = root + 'Wow6432Node\\\\'\n        for key in self.hkeys:\n            if key=='use_dir':\n                return self.find_vs_dir_by_vc()\n            key = root + key\n            try:\n                comps = read_reg(key)\n            except SCons.Util.WinError as e:\n                debug('find_vs_dir_by_reg(): no VS registry key {}'.format(repr(key)))\n            else:\n                debug('find_vs_dir_by_reg(): found VS in registry: {}'.format(comps))\n                return comps\n        return None\n\n    def find_vs_dir(self):\n        \"\"\" Can use registry or location of VC to find vs dir\n        First try to find by registry, and if that fails find via VC dir\n        \"\"\"\n\n        vs_dir=self.find_vs_dir_by_reg()\n        if not vs_dir:\n            vs_dir = self.find_vs_dir_by_vc()\n        debug('find_vs_dir(): found VS in ' + str(vs_dir ))\n        return vs_dir\n\n    def find_executable(self):\n        vs_dir = self.get_vs_dir()\n        if not vs_dir:\n            debug('find_executable():  no vs_dir ({})'.format(vs_dir))\n            return None\n        executable = os.path.join(vs_dir, self.executable_path)\n        executable = os.path.normpath(executable)\n        if not os.path.isfile(executable):\n            debug('find_executable():  {} not on file system'.format(executable))\n            return None\n        return executable\n\n    def get_batch_file(self):\n        try:\n            return self._cache['batch_file']\n        except KeyError:\n            batch_file = self.find_batch_file()\n            self._cache['batch_file'] = batch_file\n            return batch_file\n\n    def get_executable(self):\n        try:\n            debug('get_executable using cache:%s'%self._cache['executable'])\n            return self._cache['executable']\n        except KeyError:\n            executable = self.find_executable()\n            self._cache['executable'] = executable\n            debug('get_executable not in cache:%s'%executable)\n            return executable\n\n    def get_vs_dir(self):\n        try:\n            return self._cache['vs_dir']\n        except KeyError:\n            vs_dir = self.find_vs_dir()\n            self._cache['vs_dir'] = vs_dir\n            return vs_dir\n\n    def get_supported_arch(self):\n        try:\n            return self._cache['supported_arch']\n        except KeyError:\n            # RDEVE: for the time being use hardcoded lists\n            # supported_arch = self.find_supported_arch()\n            self._cache['supported_arch'] = self.supported_arch\n            return self.supported_arch\n\n    def reset(self):\n        self._cache = {}\n\n# The list of supported Visual Studio versions we know how to detect.\n#\n# How to look for .bat file ?\n#  - VS 2008 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS90COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2008 Express (WoW6432: 32 bits on windows x64):\n#         Software\\Wow6432Node\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#\n#  - VS 2005 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\8.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS80COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2005 Express (WoW6432: 32 bits on windows x64): does not seem to have a\n#  productdir ?\n#\n#  - VS 2003 .Net (pro edition ? x86):\n#     * from registry key productdir. The path is then ..\\Common7\\Tools\\\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\productdir\n#     * from environmnent variable VS71COMNTOOLS: the path is the full path to\n#     vsvars32.bat\n#\n#  - VS 98 (VS 6):\n#     * from registry key productdir. The path is then Bin\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\6.0\\Setup\\VC98\\productdir\n#\n# The first version found in the list is the one used by default if\n# there are multiple versions installed.  Barring good reasons to\n# the contrary, this means we should list versions from most recent\n# to oldest.  Pro versions get listed before Express versions on the\n# assumption that, by default, you'd rather use the version you paid\n# good money for in preference to whatever Microsoft makes available\n# for free.\n#\n# If you update this list, update _VCVER and _VCVER_TO_PRODUCT_DIR in\n# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.\n\nSupportedVSList = [\n    # Visual Studio 2019\n    VisualStudio('14.2',\n                 vc_version='14.2',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS160COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'VC\\Auxiliary\\Build\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n                 ),\n\n    # Visual Studio 2017\n    VisualStudio('14.1',\n                 vc_version='14.1',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS150COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'VC\\Auxiliary\\Build\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n                 ),\n\n    # Visual Studio 2015\n    VisualStudio('14.0',\n                 vc_version='14.0',\n                 sdk_version='10.0',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual C++ 2015 Express Edition (for Desktop)\n    VisualStudio('14.0Exp',\n                 vc_version='14.0',\n                 sdk_version='10.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual Studio 2013\n    VisualStudio('12.0',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2013 Express Edition (for Desktop)\n    VisualStudio('12.0Exp',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2012\n    VisualStudio('11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2012 Express Edition (for Desktop)\n    VisualStudio('11.0Exp',\n                 vc_version='11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2010\n    VisualStudio('10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2010 Express Edition\n    VisualStudio('10.0Exp',\n                 vc_version='10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2008\n    VisualStudio('9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2008 Express Edition\n    VisualStudio('9.0Exp',\n                 vc_version='9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2005\n    VisualStudio('8.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2005 Express Edition\n    VisualStudio('8.0Exp',\n                 vc_version='8.0Exp',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET 2003\n    VisualStudio('7.1',\n                 sdk_version='6.0',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.1\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS71COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET 2003',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET\n    VisualStudio('7.0',\n                 sdk_version='2003R2',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS70COMNTOOLS',\n                 executable_path=r'IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 6.0\n    VisualStudio('6.0',\n                 sdk_version='2003R1',\n                 hkeys=[r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual Studio\\ProductDir',\n                        'use_dir'],\n                 common_tools_var='VS60COMNTOOLS',\n                 executable_path=r'Common\\MSDev98\\Bin\\MSDEV.COM',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio',\n                 supported_arch=['x86'],\n    ),\n]\n\nSupportedVSMap = {}\nfor vs in SupportedVSList:\n    SupportedVSMap[vs.version] = vs\n\n\n# Finding installed versions of Visual Studio isn't cheap, because it\n# goes not only to the registry but also to the disk to sanity-check\n# that there is, in fact, a Visual Studio directory there and that the\n# registry entry isn't just stale.  Find this information once, when\n# requested, and cache it.\n\nInstalledVSList = None\nInstalledVSMap  = None\n\ndef get_installed_visual_studios():\n    global InstalledVSList\n    global InstalledVSMap\n    if InstalledVSList is None:\n        InstalledVSList = []\n        InstalledVSMap = {}\n        for vs in SupportedVSList:\n            debug('trying to find VS %s' % vs.version)\n            if vs.get_executable():\n                debug('found VS %s' % vs.version)\n                InstalledVSList.append(vs)\n                InstalledVSMap[vs.version] = vs\n    return InstalledVSList\n\ndef reset_installed_visual_studios():\n    global InstalledVSList\n    global InstalledVSMap\n    InstalledVSList = None\n    InstalledVSMap  = None\n    for vs in SupportedVSList:\n        vs.reset()\n\n    # Need to clear installed VC's as well as they are used in finding\n    # installed VS's\n    SCons.Tool.MSCommon.vc.reset_installed_vcs()\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\n#SDKEnvironmentUpdates = {}\n#\n#def set_sdk_by_directory(env, sdk_dir):\n#    global SDKEnvironmentUpdates\n#    try:\n#        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n#    except KeyError:\n#        env_tuple_list = []\n#        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n#\n#        include_path = os.path.join(sdk_dir, 'include')\n#        mfc_path = os.path.join(include_path, 'mfc')\n#        atl_path = os.path.join(include_path, 'atl')\n#\n#        if os.path.exists(mfc_path):\n#            env_tuple_list.append(('INCLUDE', mfc_path))\n#        if os.path.exists(atl_path):\n#            env_tuple_list.append(('INCLUDE', atl_path))\n#        env_tuple_list.append(('INCLUDE', include_path))\n#\n#        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n#\n#    for variable, directory in env_tuple_list:\n#        env.PrependENVPath(variable, directory)\n\ndef msvs_exists():\n    return (len(get_installed_visual_studios()) > 0)\n\ndef get_vs_by_version(msvs):\n    global InstalledVSMap\n    global SupportedVSMap\n\n    debug('get_vs_by_version()')\n    if msvs not in SupportedVSMap:\n        msg = \"Visual Studio version %s is not supported\" % repr(msvs)\n        raise SCons.Errors.UserError(msg)\n    get_installed_visual_studios()\n    vs = InstalledVSMap.get(msvs)\n    debug('InstalledVSMap:%s'%InstalledVSMap)\n    debug('get_vs_by_version: found vs:%s'%vs)\n    # Some check like this would let us provide a useful error message\n    # if they try to set a Visual Studio version that's not installed.\n    # However, we also want to be able to run tests (like the unit\n    # tests) on systems that don't, or won't ever, have it installed.\n    # It might be worth resurrecting this, with some configurable\n    # setting that the tests can use to bypass the check.\n    #if not vs:\n    #    msg = \"Visual Studio version %s is not installed\" % repr(msvs)\n    #    raise SCons.Errors.UserError, msg\n    return vs\n\ndef get_default_version(env):\n    \"\"\"Returns the default version string to use for MSVS.\n\n    If no version was requested by the user through the MSVS environment\n    variable, query all the available visual studios through\n    get_installed_visual_studios, and take the highest one.\n\n    Return\n    ------\n    version: str\n        the default version.\n    \"\"\"\n    if 'MSVS' not in env or not SCons.Util.is_Dict(env['MSVS']):\n        # get all versions, and remember them for speed later\n        versions = [vs.version for vs in get_installed_visual_studios()]\n        env['MSVS'] = {'VERSIONS' : versions}\n    else:\n        versions = env['MSVS'].get('VERSIONS', [])\n\n    if 'MSVS_VERSION' not in env:\n        if versions:\n            env['MSVS_VERSION'] = versions[0] #use highest version by default\n        else:\n            debug('get_default_version: WARNING: no installed versions found, '\n                  'using first in SupportedVSList (%s)'%SupportedVSList[0].version)\n            env['MSVS_VERSION'] = SupportedVSList[0].version\n\n    env['MSVS']['VERSION'] = env['MSVS_VERSION']\n\n    return env['MSVS_VERSION']\n\ndef get_default_arch(env):\n    \"\"\"Return the default arch to use for MSVS\n\n    if no version was requested by the user through the MSVS_ARCH environment\n    variable, select x86\n\n    Return\n    ------\n    arch: str\n    \"\"\"\n    arch = env.get('MSVS_ARCH', 'x86')\n\n    msvs = InstalledVSMap.get(env['MSVS_VERSION'])\n\n    if not msvs:\n        arch = 'x86'\n    elif arch not in msvs.get_supported_arch():\n        fmt = \"Visual Studio version %s does not support architecture %s\"\n        raise SCons.Errors.UserError(fmt % (env['MSVS_VERSION'], arch))\n\n    return arch\n\ndef merge_default_version(env):\n    version = get_default_version(env)\n    arch = get_default_arch(env)\n\ndef msvs_setup_env(env):\n    batfilename = msvs.get_batch_file()\n    msvs = get_vs_by_version(version)\n    if msvs is None:\n        return\n\n    # XXX: I think this is broken. This will silently set a bogus tool instead\n    # of failing, but there is no other way with the current scons tool\n    # framework\n    if batfilename is not None:\n\n        vars = ('LIB', 'LIBPATH', 'PATH', 'INCLUDE')\n\n        msvs_list = get_installed_visual_studios()\n        vscommonvarnames = [vs.common_tools_var for vs in msvs_list]\n        save_ENV = env['ENV']\n        nenv = normalize_env(env['ENV'],\n                             ['COMSPEC'] + vscommonvarnames,\n                             force=True)\n        try:\n            output = get_output(batfilename, arch, env=nenv)\n        finally:\n            env['ENV'] = save_ENV\n        vars = parse_output(output, vars)\n\n        for k, v in vars.items():\n            env.PrependENVPath(k, v, delete_existing=1)\n\ndef query_versions():\n    \"\"\"Query the system to get available versions of VS. A version is\n    considered when a batfile is found.\"\"\"\n    msvs_list = get_installed_visual_studios()\n    versions = [msvs.version for msvs in msvs_list]\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/PharLapCommon.py",
    "content": "\"\"\"SCons.Tool.PharLapCommon\n\nThis module contains common code used by all Tools for the\nPhar Lap ETS tool chain.  Right now, this is linkloc and\n386asm.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/PharLapCommon.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\nimport SCons.Errors\nimport SCons.Util\nimport re\n\ndef getPharLapPath():\n    \"\"\"Reads the registry to find the installed path of the Phar Lap ETS\n    development kit.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    if not SCons.Util.can_read_reg:\n        raise SCons.Errors.InternalError(\"No Windows registry module was found\")\n    try:\n        k=SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                  'SOFTWARE\\\\Pharlap\\\\ETS')\n        val, type = SCons.Util.RegQueryValueEx(k, 'BaseDir')\n\n        # The following is a hack...there is (not surprisingly)\n        # an odd issue in the Phar Lap plug in that inserts\n        # a bunch of junk data after the phar lap path in the\n        # registry.  We must trim it.\n        idx=val.find('\\0')\n        if idx >= 0:\n            val = val[:idx]\n                    \n        return os.path.normpath(val)\n    except SCons.Util.RegError:\n        raise SCons.Errors.UserError(\"Cannot find Phar Lap ETS path in the registry.  Is it installed properly?\")\n\nREGEX_ETS_VER = re.compile(r'#define\\s+ETS_VER\\s+([0-9]+)')\n\ndef getPharLapVersion():\n    \"\"\"Returns the version of the installed ETS Tool Suite as a\n    decimal number.  This version comes from the ETS_VER #define in\n    the embkern.h header.  For example, '#define ETS_VER 1010' (which\n    is what Phar Lap 10.1 defines) would cause this method to return\n    1010. Phar Lap 9.1 does not have such a #define, but this method\n    will return 910 as a default.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    include_path = os.path.join(getPharLapPath(), os.path.normpath(\"include/embkern.h\"))\n    if not os.path.exists(include_path):\n        raise SCons.Errors.UserError(\"Cannot find embkern.h in ETS include directory.\\nIs Phar Lap ETS installed properly?\")\n    with open(include_path, 'r') as f:\n        mo = REGEX_ETS_VER.search(f.read())\n    if mo:\n        return int(mo.group(1))\n    # Default return for Phar Lap 9.1\n    return 910\n\ndef addPharLapPaths(env):\n    \"\"\"This function adds the path to the Phar Lap binaries, includes,\n    and libraries, if they are not already there.\"\"\"\n    ph_path = getPharLapPath()\n\n    try:\n        env_dict = env['ENV']\n    except KeyError:\n        env_dict = {}\n        env['ENV'] = env_dict\n    SCons.Util.AddPathIfNotExists(env_dict, 'PATH',\n                                  os.path.join(ph_path, 'bin'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'INCLUDE',\n                                  os.path.join(ph_path, 'include'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',\n                                  os.path.join(ph_path, 'lib'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',\n                                  os.path.join(ph_path, os.path.normpath('lib/vclib')))\n    \n    env['PHARLAP_PATH'] = getPharLapPath()\n    env['PHARLAP_VERSION'] = str(getPharLapVersion())\n    \n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/__init__.py",
    "content": "\"\"\"SCons.Tool\n\nSCons tool selection.\n\nThis looks for modules that define a callable object that can modify\na construction environment as appropriate for a given tool (or tool\nchain).\n\nNote that because this subsystem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"tool specification\" in an arbitrary callable function.  No\none needs to use or tie in to this subsystem in order to roll their own\ntool definition.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport sys\nimport re\nimport os\nimport shutil\n\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Scanner.C\n# Nuitka: Avoid ununused tools\n# import SCons.Scanner.D\n# import SCons.Scanner.LaTeX\nimport SCons.Scanner.Prog\n# import SCons.Scanner.SWIG\ntry:\n    # Python 3\n    from collections.abc import Callable\nexcept ImportError:\n    # Python 2.7\n    from collections import Callable\n\nDefaultToolpath = []\n\nCScanner = SCons.Scanner.C.CScanner()\n# Nuitka: Avoid ununused tools\n# DScanner = SCons.Scanner.D.DScanner()\n# LaTeXScanner = SCons.Scanner.LaTeX.LaTeXScanner()\n# PDFLaTeXScanner = SCons.Scanner.LaTeX.PDFLaTeXScanner()\nProgramScanner = SCons.Scanner.Prog.ProgramScanner()\nSourceFileScanner = SCons.Scanner.Base({}, name='SourceFileScanner')\n# SWIGScanner = SCons.Scanner.SWIG.SWIGScanner()\n\nCSuffixes = [\".c\", \".C\", \".cxx\", \".cpp\", \".c++\", \".cc\",\n             \".h\", \".H\", \".hxx\", \".hpp\", \".hh\",\n             \".F\", \".fpp\", \".FPP\",\n             \".m\", \".mm\",\n             \".S\", \".spp\", \".SPP\", \".sx\"]\n\nDSuffixes = ['.d']\n\nIDLSuffixes = [\".idl\", \".IDL\"]\n\nLaTeXSuffixes = [\".tex\", \".ltx\", \".latex\"]\n\nSWIGSuffixes = ['.i']\n\nfor suffix in CSuffixes:\n    SourceFileScanner.add_scanner(suffix, CScanner)\n\n# Nuitka: Avoid ununused tools\n# for suffix in DSuffixes:\n#     SourceFileScanner.add_scanner(suffix, DScanner)\n# for suffix in SWIGSuffixes:\n#     SourceFileScanner.add_scanner(suffix, SWIGScanner)\n\n# FIXME: what should be done here? Two scanners scan the same extensions,\n# but look for different files, e.g., \"picture.eps\" vs. \"picture.pdf\".\n# The builders for DVI and PDF explicitly reference their scanners\n# I think that means this is not needed???\n# Nuitka: Avoid ununused tools\n# for suffix in LaTeXSuffixes:\n#     SourceFileScanner.add_scanner(suffix, LaTeXScanner)\n#     SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner)\n\n# Tool aliases are needed for those tools whose module names also\n# occur in the python standard library. This causes module shadowing and\n# can break using python library functions under python3\nTOOL_ALIASES = {\n    'gettext': 'gettext_tool',\n    'clang++': 'clangxx',\n}\n\n\nclass Tool(object):\n    def __init__(self, name, toolpath=None, **kw):\n        if toolpath is None:\n            toolpath = []\n\n        # Rename if there's a TOOL_ALIAS for this tool\n        self.name = TOOL_ALIASES.get(name, name)\n        self.toolpath = toolpath + DefaultToolpath\n        # remember these so we can merge them into the call\n        self.init_kw = kw\n\n        module = self._tool_module()\n        self.generate = module.generate\n        self.exists = module.exists\n        if hasattr(module, 'options'):\n            self.options = module.options\n\n    def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None):\n        import imp\n\n        splitname = short_name.split('.')\n        index = 0\n        srchpths = searchpaths\n        for item in splitname:\n            file, path, desc = imp.find_module(item, srchpths)\n            mod = imp.load_module(full_name, file, path, desc)\n            srchpths = [path]\n        return mod, file\n\n    def _tool_module(self):\n        oldpythonpath = sys.path\n        sys.path = self.toolpath + sys.path\n        # sys.stderr.write(\"Tool:%s\\nPATH:%s\\n\"%(self.name,sys.path))\n\n        if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0, 1, 2, 3, 4)):\n            # Py 2 code\n            try:\n                try:\n                    file = None\n                    try:\n                        mod, file = self._load_dotted_module_py2(self.name, self.name, self.toolpath)\n                        return mod\n                    finally:\n                        if file:\n                            file.close()\n                except ImportError as e:\n                    splitname = self.name.split('.')\n                    if str(e) != \"No module named %s\" % splitname[0]:\n                        raise SCons.Errors.SConsEnvironmentError(e)\n                    try:\n                        import zipimport\n                    except ImportError:\n                        pass\n                    else:\n                        for aPath in self.toolpath:\n                            try:\n                                importer = zipimport.zipimporter(aPath)\n                                return importer.load_module(self.name)\n                            except ImportError as e:\n                                pass\n            finally:\n                sys.path = oldpythonpath\n        elif sys.version_info[1] > 4:\n            # From: http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692\n            # import importlib.util\n            # spec = importlib.util.spec_from_file_location(\"module.name\", \"/path/to/file.py\")\n            # foo = importlib.util.module_from_spec(spec)\n            # spec.loader.exec_module(foo)\n            # foo.MyClass()\n            # Py 3 code\n\n            # import pdb; pdb.set_trace()\n            import importlib.util\n\n            # sys.stderr.write(\"toolpath:%s\\n\" % self.toolpath)\n            # sys.stderr.write(\"SCONS.TOOL path:%s\\n\" % sys.modules['SCons.Tool'].__path__)\n            debug = False\n            spec = None\n            found_name = self.name\n            add_to_scons_tools_namespace = False\n            for path in self.toolpath:\n                sepname = self.name.replace('.', os.path.sep)\n                file_path = os.path.join(path, \"%s.py\" % sepname)\n                file_package = os.path.join(path, sepname)\n\n                if debug: sys.stderr.write(\"Trying:%s %s\\n\" % (file_path, file_package))\n\n                if os.path.isfile(file_path):\n                    spec = importlib.util.spec_from_file_location(self.name, file_path)\n                    if debug: print(\"file_Path:%s FOUND\" % file_path)\n                    break\n                elif os.path.isdir(file_package):\n                    file_package = os.path.join(file_package, '__init__.py')\n                    spec = importlib.util.spec_from_file_location(self.name, file_package)\n                    if debug: print(\"PACKAGE:%s Found\" % file_package)\n                    break\n\n                else:\n                    continue\n\n            if spec is None:\n                if debug: sys.stderr.write(\"NO SPEC :%s\\n\" % self.name)\n                spec = importlib.util.find_spec(\".\" + self.name, package='SCons.Tool')\n                if spec:\n                    found_name = 'SCons.Tool.' + self.name\n                    add_to_scons_tools_namespace = True\n                if debug: sys.stderr.write(\"Spec Found? .%s :%s\\n\" % (self.name, spec))\n\n            if spec is None:\n                error_string = \"No module named %s\" % self.name\n                raise SCons.Errors.SConsEnvironmentError(error_string)\n\n            module = importlib.util.module_from_spec(spec)\n            if module is None:\n                if debug: print(\"MODULE IS NONE:%s\" % self.name)\n                error_string = \"No module named %s\" % self.name\n                raise SCons.Errors.SConsEnvironmentError(error_string)\n\n            # Don't reload a tool we already loaded.\n            sys_modules_value = sys.modules.get(found_name, False)\n\n            found_module = None\n            if sys_modules_value and sys_modules_value.__file__ == spec.origin:\n                found_module = sys.modules[found_name]\n            else:\n                # Not sure what to do in the case that there already\n                # exists sys.modules[self.name] but the source file is\n                # different.. ?\n                module = spec.loader.load_module(spec.name)\n\n                sys.modules[found_name] = module\n                if add_to_scons_tools_namespace:\n                    # If we found it in SCons.Tool, then add it to the module\n                    setattr(SCons.Tool, self.name, module)\n\n                found_module = module\n\n            if found_module is not None:\n                sys.path = oldpythonpath\n                return found_module\n\n        sys.path = oldpythonpath\n\n        full_name = 'SCons.Tool.' + self.name\n        try:\n            return sys.modules[full_name]\n        except KeyError:\n            try:\n                smpath = sys.modules['SCons.Tool'].__path__\n                try:\n                    module, file = self._load_dotted_module_py2(self.name, full_name, smpath)\n                    setattr(SCons.Tool, self.name, module)\n                    if file:\n                        file.close()\n                    return module\n                except ImportError as e:\n                    if str(e) != \"No module named %s\" % self.name:\n                        raise SCons.Errors.SConsEnvironmentError(e)\n                    try:\n                        import zipimport\n                        importer = zipimport.zipimporter(sys.modules['SCons.Tool'].__path__[0])\n                        module = importer.load_module(full_name)\n                        setattr(SCons.Tool, self.name, module)\n                        return module\n                    except ImportError as e:\n                        m = \"No tool named '%s': %s\" % (self.name, e)\n                        raise SCons.Errors.SConsEnvironmentError(m)\n            except ImportError as e:\n                m = \"No tool named '%s': %s\" % (self.name, e)\n                raise SCons.Errors.SConsEnvironmentError(m)\n\n    def __call__(self, env, *args, **kw):\n        if self.init_kw is not None:\n            # Merge call kws into init kws;\n            # but don't bash self.init_kw.\n            if kw is not None:\n                call_kw = kw\n                kw = self.init_kw.copy()\n                kw.update(call_kw)\n            else:\n                kw = self.init_kw\n        env.Append(TOOLS=[self.name])\n        if hasattr(self, 'options'):\n            import SCons.Variables\n            if 'options' not in env:\n                from SCons.Script import ARGUMENTS\n                env['options'] = SCons.Variables.Variables(args=ARGUMENTS)\n            opts = env['options']\n\n            self.options(opts)\n            opts.Update(env)\n\n        self.generate(env, *args, **kw)\n\n    def __str__(self):\n        return self.name\n\n\n##########################################################################\n#  Create common executable program / library / object builders\n\ndef createProgBuilder(env):\n    \"\"\"This is a utility function that creates the Program\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        program = env['BUILDERS']['Program']\n    except KeyError:\n        import SCons.Defaults\n        program = SCons.Builder.Builder(action=SCons.Defaults.LinkAction,\n                                        emitter='$PROGEMITTER',\n                                        prefix='$PROGPREFIX',\n                                        suffix='$PROGSUFFIX',\n                                        src_suffix='$OBJSUFFIX',\n                                        src_builder='Object',\n                                        target_scanner=ProgramScanner)\n        env['BUILDERS']['Program'] = program\n\n    return program\n\n\ndef createStaticLibBuilder(env):\n    \"\"\"This is a utility function that creates the StaticLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        static_lib = env['BUILDERS']['StaticLibrary']\n    except KeyError:\n        action_list = [SCons.Action.Action(\"$ARCOM\", \"$ARCOMSTR\")]\n        if env.get('RANLIB', False) or env.Detect('ranlib'):\n            ranlib_action = SCons.Action.Action(\"$RANLIBCOM\", \"$RANLIBCOMSTR\")\n            action_list.append(ranlib_action)\n\n        static_lib = SCons.Builder.Builder(action=action_list,\n                                           emitter='$LIBEMITTER',\n                                           prefix='$LIBPREFIX',\n                                           suffix='$LIBSUFFIX',\n                                           src_suffix='$OBJSUFFIX',\n                                           src_builder='StaticObject')\n        env['BUILDERS']['StaticLibrary'] = static_lib\n        env['BUILDERS']['Library'] = static_lib\n\n    return static_lib\n\n\ndef _call_linker_cb(env, callback, args, result=None):\n    \"\"\"Returns the result of env['LINKCALLBACKS'][callback](*args)\n    if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]\n    is callable. If these conditions are not met, return the value provided as\n    the *result* argument. This function is mainly used for generating library\n    info such as versioned suffixes, symlink maps, sonames etc. by delegating\n    the core job to callbacks configured by current linker tool\"\"\"\n\n    Verbose = False\n\n    if Verbose:\n        print('_call_linker_cb: args=%r' % args)\n        print('_call_linker_cb: callback=%r' % callback)\n\n    try:\n        cbfun = env['LINKCALLBACKS'][callback]\n    except (KeyError, TypeError):\n        if Verbose:\n            print('_call_linker_cb: env[\"LINKCALLBACKS\"][%r] not found or can not be used' % callback)\n        pass\n    else:\n        if Verbose:\n            print('_call_linker_cb: env[\"LINKCALLBACKS\"][%r] found' % callback)\n            print('_call_linker_cb: env[\"LINKCALLBACKS\"][%r]=%r' % (callback, cbfun))\n        if isinstance(cbfun, Callable):\n            if Verbose:\n                print('_call_linker_cb: env[\"LINKCALLBACKS\"][%r] is callable' % callback)\n            result = cbfun(env, *args)\n    return result\n\n\ndef _call_env_subst(env, string, *args, **kw):\n    kw2 = {}\n    for k in ('raw', 'target', 'source', 'conv', 'executor'):\n        try:\n            kw2[k] = kw[k]\n        except KeyError:\n            pass\n    return env.subst(string, *args, **kw2)\n\n\nclass _ShLibInfoSupport(object):\n    @property\n    def libtype(self):\n        return 'ShLib'\n\n    def get_lib_prefix(self, env, *args, **kw):\n        return _call_env_subst(env, '$SHLIBPREFIX', *args, **kw)\n\n    def get_lib_suffix(self, env, *args, **kw):\n        return _call_env_subst(env, '$SHLIBSUFFIX', *args, **kw)\n\n    def get_lib_version(self, env, *args, **kw):\n        return _call_env_subst(env, '$SHLIBVERSION', *args, **kw)\n\n    def get_lib_noversionsymlinks(self, env, *args, **kw):\n        return _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw)\n\n\nclass _LdModInfoSupport(object):\n    @property\n    def libtype(self):\n        return 'LdMod'\n\n    def get_lib_prefix(self, env, *args, **kw):\n        return _call_env_subst(env, '$LDMODULEPREFIX', *args, **kw)\n\n    def get_lib_suffix(self, env, *args, **kw):\n        return _call_env_subst(env, '$LDMODULESUFFIX', *args, **kw)\n\n    def get_lib_version(self, env, *args, **kw):\n        return _call_env_subst(env, '$LDMODULEVERSION', *args, **kw)\n\n    def get_lib_noversionsymlinks(self, env, *args, **kw):\n        return _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw)\n\n\nclass _ImpLibInfoSupport(object):\n    @property\n    def libtype(self):\n        return 'ImpLib'\n\n    def get_lib_prefix(self, env, *args, **kw):\n        return _call_env_subst(env, '$IMPLIBPREFIX', *args, **kw)\n\n    def get_lib_suffix(self, env, *args, **kw):\n        return _call_env_subst(env, '$IMPLIBSUFFIX', *args, **kw)\n\n    def get_lib_version(self, env, *args, **kw):\n        version = _call_env_subst(env, '$IMPLIBVERSION', *args, **kw)\n        if not version:\n            try:\n                lt = kw['implib_libtype']\n            except KeyError:\n                pass\n            else:\n                if lt == 'ShLib':\n                    version = _call_env_subst(env, '$SHLIBVERSION', *args, **kw)\n                elif lt == 'LdMod':\n                    version = _call_env_subst(env, '$LDMODULEVERSION', *args, **kw)\n        return version\n\n    def get_lib_noversionsymlinks(self, env, *args, **kw):\n        disable = None\n        try:\n            env['IMPLIBNOVERSIONSYMLINKS']\n        except KeyError:\n            try:\n                lt = kw['implib_libtype']\n            except KeyError:\n                pass\n            else:\n                if lt == 'ShLib':\n                    disable = _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw)\n                elif lt == 'LdMod':\n                    disable = _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw)\n        else:\n            disable = _call_env_subst(env, '$IMPLIBNOVERSIONSYMLINKS', *args, **kw)\n        return disable\n\n\nclass _LibInfoGeneratorBase(object):\n    \"\"\"Generator base class for library-related info such as suffixes for\n    versioned libraries, symlink maps, sonames etc. It handles commonities\n    of SharedLibrary and LoadableModule\n    \"\"\"\n    _support_classes = {'ShLib': _ShLibInfoSupport,\n                        'LdMod': _LdModInfoSupport,\n                        'ImpLib': _ImpLibInfoSupport}\n\n    def __init__(self, libtype, infoname):\n        self.libtype = libtype\n        self.infoname = infoname\n\n    @property\n    def libtype(self):\n        return self._support.libtype\n\n    @libtype.setter\n    def libtype(self, libtype):\n        try:\n            support_class = self._support_classes[libtype]\n        except KeyError:\n            raise ValueError('unsupported libtype %r' % libtype)\n        self._support = support_class()\n\n    def get_lib_prefix(self, env, *args, **kw):\n        return self._support.get_lib_prefix(env, *args, **kw)\n\n    def get_lib_suffix(self, env, *args, **kw):\n        return self._support.get_lib_suffix(env, *args, **kw)\n\n    def get_lib_version(self, env, *args, **kw):\n        return self._support.get_lib_version(env, *args, **kw)\n\n    def get_lib_noversionsymlinks(self, env, *args, **kw):\n        return self._support.get_lib_noversionsymlinks(env, *args, **kw)\n\n    # Returns name of generator linker callback that shall be used to generate\n    # our info for a versioned library. For example, if our libtype is 'ShLib'\n    # and infoname is 'Prefix', it would return 'VersionedShLibPrefix'.\n    def get_versioned_lib_info_generator(self, **kw):\n        try:\n            libtype = kw['generator_libtype']\n        except KeyError:\n            libtype = self.libtype\n        return 'Versioned%s%s' % (libtype, self.infoname)\n\n    def generate_versioned_lib_info(self, env, args, result=None, **kw):\n        callback = self.get_versioned_lib_info_generator(**kw)\n        return _call_linker_cb(env, callback, args, result)\n\n\nclass _LibPrefixGenerator(_LibInfoGeneratorBase):\n    \"\"\"Library prefix generator, used as target_prefix in SharedLibrary and\n    LoadableModule builders\"\"\"\n\n    def __init__(self, libtype):\n        super(_LibPrefixGenerator, self).__init__(libtype, 'Prefix')\n\n    def __call__(self, env, sources=None, **kw):\n        Verbose = False\n\n        if sources and 'source' not in kw:\n            kw2 = kw.copy()\n            kw2['source'] = sources\n        else:\n            kw2 = kw\n\n        prefix = self.get_lib_prefix(env, **kw2)\n        if Verbose:\n            print(\"_LibPrefixGenerator: input prefix=%r\" % prefix)\n\n        version = self.get_lib_version(env, **kw2)\n        if Verbose:\n            print(\"_LibPrefixGenerator: version=%r\" % version)\n\n        if version:\n            prefix = self.generate_versioned_lib_info(env, [prefix, version], prefix, **kw2)\n\n        if Verbose:\n            print(\"_LibPrefixGenerator: return prefix=%r\" % prefix)\n        return prefix\n\n\nShLibPrefixGenerator = _LibPrefixGenerator('ShLib')\nLdModPrefixGenerator = _LibPrefixGenerator('LdMod')\nImpLibPrefixGenerator = _LibPrefixGenerator('ImpLib')\n\n\nclass _LibSuffixGenerator(_LibInfoGeneratorBase):\n    \"\"\"Library suffix generator, used as target_suffix in SharedLibrary and\n    LoadableModule builders\"\"\"\n\n    def __init__(self, libtype):\n        super(_LibSuffixGenerator, self).__init__(libtype, 'Suffix')\n\n    def __call__(self, env, sources=None, **kw):\n        Verbose = False\n\n        if sources and 'source' not in kw:\n            kw2 = kw.copy()\n            kw2['source'] = sources\n        else:\n            kw2 = kw\n\n        suffix = self.get_lib_suffix(env, **kw2)\n        if Verbose:\n            print(\"_LibSuffixGenerator: input suffix=%r\" % suffix)\n\n        version = self.get_lib_version(env, **kw2)\n        if Verbose:\n            print(\"_LibSuffixGenerator: version=%r\" % version)\n\n        if version:\n            suffix = self.generate_versioned_lib_info(env, [suffix, version], suffix, **kw2)\n\n        if Verbose:\n            print(\"_LibSuffixGenerator: return suffix=%r\" % suffix)\n        return suffix\n\n\nShLibSuffixGenerator = _LibSuffixGenerator('ShLib')\nLdModSuffixGenerator = _LibSuffixGenerator('LdMod')\nImpLibSuffixGenerator = _LibSuffixGenerator('ImpLib')\n\n\nclass _LibSymlinkGenerator(_LibInfoGeneratorBase):\n    \"\"\"Library symlink map generator. It generates a list of symlinks that\n    should be created by SharedLibrary or LoadableModule builders\"\"\"\n\n    def __init__(self, libtype):\n        super(_LibSymlinkGenerator, self).__init__(libtype, 'Symlinks')\n\n    def __call__(self, env, libnode, **kw):\n        Verbose = False\n\n        if libnode and 'target' not in kw:\n            kw2 = kw.copy()\n            kw2['target'] = libnode\n        else:\n            kw2 = kw\n\n        if Verbose:\n            print(\"_LibSymLinkGenerator: libnode=%r\" % libnode.get_path())\n\n        symlinks = None\n\n        version = self.get_lib_version(env, **kw2)\n        disable = self.get_lib_noversionsymlinks(env, **kw2)\n        if Verbose:\n            print('_LibSymlinkGenerator: version=%r' % version)\n            print('_LibSymlinkGenerator: disable=%r' % disable)\n\n        if version and not disable:\n            prefix = self.get_lib_prefix(env, **kw2)\n            suffix = self.get_lib_suffix(env, **kw2)\n            symlinks = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)\n\n        if Verbose:\n            print('_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks))\n        return symlinks\n\n\nShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib')\nLdModSymlinkGenerator = _LibSymlinkGenerator('LdMod')\nImpLibSymlinkGenerator = _LibSymlinkGenerator('ImpLib')\n\n\nclass _LibNameGenerator(_LibInfoGeneratorBase):\n    \"\"\"Generates \"unmangled\" library name from a library file node.\n\n    Generally, it's thought to revert modifications done by prefix/suffix\n    generators (_LibPrefixGenerator/_LibSuffixGenerator) used by a library\n    builder. For example, on gnulink the suffix generator used by SharedLibrary\n    builder appends $SHLIBVERSION to $SHLIBSUFFIX producing node name which\n    ends with \"$SHLIBSUFFIX.$SHLIBVERSION\". Correspondingly, the implementation\n    of _LibNameGenerator replaces \"$SHLIBSUFFIX.$SHLIBVERSION\" with\n    \"$SHLIBSUFFIX\" in the node's basename. So that, if $SHLIBSUFFIX is \".so\",\n    $SHLIBVERSION is \"0.1.2\" and the node path is \"/foo/bar/libfoo.so.0.1.2\",\n    the _LibNameGenerator shall return \"libfoo.so\". Other link tools may\n    implement it's own way of library name unmangling.\n    \"\"\"\n\n    def __init__(self, libtype):\n        super(_LibNameGenerator, self).__init__(libtype, 'Name')\n\n    def __call__(self, env, libnode, **kw):\n        \"\"\"Returns \"demangled\" library name\"\"\"\n        Verbose = False\n\n        if libnode and 'target' not in kw:\n            kw2 = kw.copy()\n            kw2['target'] = libnode\n        else:\n            kw2 = kw\n\n        if Verbose:\n            print(\"_LibNameGenerator: libnode=%r\" % libnode.get_path())\n\n        version = self.get_lib_version(env, **kw2)\n        if Verbose:\n            print('_LibNameGenerator: version=%r' % version)\n\n        name = None\n        if version:\n            prefix = self.get_lib_prefix(env, **kw2)\n            suffix = self.get_lib_suffix(env, **kw2)\n            name = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)\n\n        if not name:\n            name = os.path.basename(libnode.get_path())\n\n        if Verbose:\n            print('_LibNameGenerator: return name=%r' % name)\n\n        return name\n\n\nShLibNameGenerator = _LibNameGenerator('ShLib')\nLdModNameGenerator = _LibNameGenerator('LdMod')\nImpLibNameGenerator = _LibNameGenerator('ImpLib')\n\n\nclass _LibSonameGenerator(_LibInfoGeneratorBase):\n    \"\"\"Library soname generator. Returns library soname (e.g. libfoo.so.0) for\n    a given node (e.g. /foo/bar/libfoo.so.0.1.2)\"\"\"\n\n    def __init__(self, libtype):\n        super(_LibSonameGenerator, self).__init__(libtype, 'Soname')\n\n    def __call__(self, env, libnode, **kw):\n        \"\"\"Returns a SONAME based on a shared library's node path\"\"\"\n        Verbose = False\n\n        if libnode and 'target' not in kw:\n            kw2 = kw.copy()\n            kw2['target'] = libnode\n        else:\n            kw2 = kw\n\n        if Verbose:\n            print(\"_LibSonameGenerator: libnode=%r\" % libnode.get_path())\n\n        soname = _call_env_subst(env, '$SONAME', **kw2)\n        if not soname:\n            version = self.get_lib_version(env, **kw2)\n            if Verbose:\n                print(\"_LibSonameGenerator: version=%r\" % version)\n            if version:\n                prefix = self.get_lib_prefix(env, **kw2)\n                suffix = self.get_lib_suffix(env, **kw2)\n                soname = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)\n\n        if not soname:\n            # fallback to library name (as returned by appropriate _LibNameGenerator)\n            soname = _LibNameGenerator(self.libtype)(env, libnode)\n            if Verbose:\n                print(\"_LibSonameGenerator: FALLBACK: soname=%r\" % soname)\n\n        if Verbose:\n            print(\"_LibSonameGenerator: return soname=%r\" % soname)\n\n        return soname\n\n\nShLibSonameGenerator = _LibSonameGenerator('ShLib')\nLdModSonameGenerator = _LibSonameGenerator('LdMod')\n\n\ndef StringizeLibSymlinks(symlinks):\n    \"\"\"Converts list with pairs of nodes to list with pairs of node paths\n    (strings). Used mainly for debugging.\"\"\"\n    if SCons.Util.is_List(symlinks):\n        try:\n            return [(k.get_path(), v.get_path()) for k, v in symlinks]\n        except (TypeError, ValueError):\n            return symlinks\n    else:\n        return symlinks\n\n\ndef EmitLibSymlinks(env, symlinks, libnode, **kw):\n    \"\"\"Used by emitters to handle (shared/versioned) library symlinks\"\"\"\n    Verbose = False\n\n    # nodes involved in process... all symlinks + library\n    nodes = list(set([x for x, y in symlinks] + [libnode]))\n\n    clean_targets = kw.get('clean_targets', [])\n    if not SCons.Util.is_List(clean_targets):\n        clean_targets = [clean_targets]\n\n    for link, linktgt in symlinks:\n        env.SideEffect(link, linktgt)\n        if (Verbose):\n            print(\"EmitLibSymlinks: SideEffect(%r,%r)\" % (link.get_path(), linktgt.get_path()))\n        clean_list = [x for x in nodes if x != linktgt]\n        env.Clean(list(set([linktgt] + clean_targets)), clean_list)\n        if (Verbose):\n            print(\"EmitLibSymlinks: Clean(%r,%r)\" % (linktgt.get_path(), [x.get_path() for x in clean_list]))\n\n\ndef CreateLibSymlinks(env, symlinks):\n    \"\"\"Physically creates symlinks. The symlinks argument must be a list in\n    form [ (link, linktarget), ... ], where link and linktarget are SCons\n    nodes.\n    \"\"\"\n\n    Verbose = False\n    for link, linktgt in symlinks:\n        linktgt = link.get_dir().rel_path(linktgt)\n        link = link.get_path()\n        if (Verbose):\n            print(\"CreateLibSymlinks: preparing to add symlink %r -> %r\" % (link, linktgt))\n        # Delete the (previously created) symlink if exists. Let only symlinks\n        # to be deleted to prevent accidental deletion of source files...\n        if env.fs.islink(link):\n            env.fs.unlink(link)\n            if (Verbose):\n                print(\"CreateLibSymlinks: removed old symlink %r\" % link)\n        # If a file or directory exists with the same name as link, an OSError\n        # will be thrown, which should be enough, I think.\n        env.fs.symlink(linktgt, link)\n        if (Verbose):\n            print(\"CreateLibSymlinks: add symlink %r -> %r\" % (link, linktgt))\n    return 0\n\n\ndef LibSymlinksActionFunction(target, source, env):\n    for tgt in target:\n        symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)\n        if symlinks:\n            CreateLibSymlinks(env, symlinks)\n    return 0\n\n\ndef LibSymlinksStrFun(target, source, env, *args):\n    cmd = None\n    for tgt in target:\n        symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)\n        if symlinks:\n            if cmd is None: cmd = \"\"\n            if cmd: cmd += \"\\n\"\n            cmd += \"Create symlinks for: %r\" % tgt.get_path()\n            try:\n                linkstr = ', '.join([\"%r->%r\" % (k, v) for k, v in StringizeLibSymlinks(symlinks)])\n            except (KeyError, ValueError):\n                pass\n            else:\n                cmd += \": %s\" % linkstr\n    return cmd\n\n\nLibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun)\n\n\ndef createSharedLibBuilder(env):\n    \"\"\"This is a utility function that creates the SharedLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        shared_lib = env['BUILDERS']['SharedLibrary']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [SCons.Defaults.SharedCheck,\n                       SCons.Defaults.ShLinkAction,\n                       LibSymlinksAction]\n        shared_lib = SCons.Builder.Builder(action=action_list,\n                                           emitter=\"$SHLIBEMITTER\",\n                                           prefix=ShLibPrefixGenerator,\n                                           suffix=ShLibSuffixGenerator,\n                                           target_scanner=ProgramScanner,\n                                           src_suffix='$SHOBJSUFFIX',\n                                           src_builder='SharedObject')\n        env['BUILDERS']['SharedLibrary'] = shared_lib\n\n    return shared_lib\n\n\ndef createLoadableModuleBuilder(env):\n    \"\"\"This is a utility function that creates the LoadableModule\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        ld_module = env['BUILDERS']['LoadableModule']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [SCons.Defaults.SharedCheck,\n                       SCons.Defaults.LdModuleLinkAction,\n                       LibSymlinksAction]\n        ld_module = SCons.Builder.Builder(action=action_list,\n                                          emitter=\"$LDMODULEEMITTER\",\n                                          prefix=LdModPrefixGenerator,\n                                          suffix=LdModSuffixGenerator,\n                                          target_scanner=ProgramScanner,\n                                          src_suffix='$SHOBJSUFFIX',\n                                          src_builder='SharedObject')\n        env['BUILDERS']['LoadableModule'] = ld_module\n\n    return ld_module\n\n\ndef createObjBuilders(env):\n    \"\"\"This is a utility function that creates the StaticObject\n    and SharedObject Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (StaticObject, SharedObject)\n    \"\"\"\n\n    try:\n        static_obj = env['BUILDERS']['StaticObject']\n    except KeyError:\n        static_obj = SCons.Builder.Builder(action={},\n                                           emitter={},\n                                           prefix='$OBJPREFIX',\n                                           suffix='$OBJSUFFIX',\n                                           src_builder=['CFile', 'CXXFile'],\n                                           source_scanner=SourceFileScanner,\n                                           single_source=1)\n        env['BUILDERS']['StaticObject'] = static_obj\n        env['BUILDERS']['Object'] = static_obj\n\n    try:\n        shared_obj = env['BUILDERS']['SharedObject']\n    except KeyError:\n        shared_obj = SCons.Builder.Builder(action={},\n                                           emitter={},\n                                           prefix='$SHOBJPREFIX',\n                                           suffix='$SHOBJSUFFIX',\n                                           src_builder=['CFile', 'CXXFile'],\n                                           source_scanner=SourceFileScanner,\n                                           single_source=1)\n        env['BUILDERS']['SharedObject'] = shared_obj\n\n    return (static_obj, shared_obj)\n\n\ndef createCFileBuilders(env):\n    \"\"\"This is a utility function that creates the CFile/CXXFile\n    Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (CFile, CXXFile)\n    \"\"\"\n\n    try:\n        c_file = env['BUILDERS']['CFile']\n    except KeyError:\n        c_file = SCons.Builder.Builder(action={},\n                                       emitter={},\n                                       suffix={None: '$CFILESUFFIX'})\n        env['BUILDERS']['CFile'] = c_file\n\n        env.SetDefault(CFILESUFFIX='.c')\n\n    try:\n        cxx_file = env['BUILDERS']['CXXFile']\n    except KeyError:\n        cxx_file = SCons.Builder.Builder(action={},\n                                         emitter={},\n                                         suffix={None: '$CXXFILESUFFIX'})\n        env['BUILDERS']['CXXFile'] = cxx_file\n        env.SetDefault(CXXFILESUFFIX='.cc')\n\n    return (c_file, cxx_file)\n\n\n##########################################################################\n#  Create common Java builders\n\ndef CreateJarBuilder(env):\n    \"\"\"The Jar builder expects a list of class files\n    which it can package into a jar file.\n\n    The jar tool provides an interface for passing other types\n    of java files such as .java, directories or swig interfaces\n    and will build them to class files in which it can package\n    into the jar.\n    \"\"\"\n    try:\n        java_jar = env['BUILDERS']['JarFile']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')\n        java_jar = SCons.Builder.Builder(action=jar_com,\n                                         suffix='$JARSUFFIX',\n                                         src_suffix='$JAVACLASSSUFFIX',\n                                         src_builder='JavaClassFile',\n                                         source_factory=fs.Entry)\n        env['BUILDERS']['JarFile'] = java_jar\n    return java_jar\n\n\ndef CreateJavaHBuilder(env):\n    try:\n        java_javah = env['BUILDERS']['JavaH']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR')\n        java_javah = SCons.Builder.Builder(action=java_javah_com,\n                                           src_suffix='$JAVACLASSSUFFIX',\n                                           target_factory=fs.Entry,\n                                           source_factory=fs.File,\n                                           src_builder='JavaClassFile')\n        env['BUILDERS']['JavaH'] = java_javah\n    return java_javah\n\n\ndef CreateJavaClassFileBuilder(env):\n    try:\n        java_class_file = env['BUILDERS']['JavaClassFile']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_file = SCons.Builder.Builder(action=javac_com,\n                                                emitter={},\n                                                # suffix = '$JAVACLASSSUFFIX',\n                                                src_suffix='$JAVASUFFIX',\n                                                src_builder=['JavaFile'],\n                                                target_factory=fs.Entry,\n                                                source_factory=fs.File)\n        env['BUILDERS']['JavaClassFile'] = java_class_file\n    return java_class_file\n\n\ndef CreateJavaClassDirBuilder(env):\n    try:\n        java_class_dir = env['BUILDERS']['JavaClassDir']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_dir = SCons.Builder.Builder(action=javac_com,\n                                               emitter={},\n                                               target_factory=fs.Dir,\n                                               source_factory=fs.Dir)\n        env['BUILDERS']['JavaClassDir'] = java_class_dir\n    return java_class_dir\n\n\ndef CreateJavaFileBuilder(env):\n    try:\n        java_file = env['BUILDERS']['JavaFile']\n    except KeyError:\n        java_file = SCons.Builder.Builder(action={},\n                                          emitter={},\n                                          suffix={None: '$JAVASUFFIX'})\n        env['BUILDERS']['JavaFile'] = java_file\n        env['JAVASUFFIX'] = '.java'\n    return java_file\n\n\nclass ToolInitializerMethod(object):\n    \"\"\"\n    This is added to a construction environment in place of a\n    method(s) normally called for a Builder (env.Object, env.StaticObject,\n    etc.).  When called, it has its associated ToolInitializer\n    object search the specified list of tools and apply the first\n    one that exists to the construction environment.  It then calls\n    whatever builder was (presumably) added to the construction\n    environment in place of this particular instance.\n    \"\"\"\n\n    def __init__(self, name, initializer):\n        \"\"\"\n        Note:  we store the tool name as __name__ so it can be used by\n        the class that attaches this to a construction environment.\n        \"\"\"\n        self.__name__ = name\n        self.initializer = initializer\n\n    def get_builder(self, env):\n        \"\"\"\n        Returns the appropriate real Builder for this method name\n        after having the associated ToolInitializer object apply\n        the appropriate Tool module.\n        \"\"\"\n        builder = getattr(env, self.__name__)\n\n        self.initializer.apply_tools(env)\n\n        builder = getattr(env, self.__name__)\n        if builder is self:\n            # There was no Builder added, which means no valid Tool\n            # for this name was found (or possibly there's a mismatch\n            # between the name we were called by and the Builder name\n            # added by the Tool module).\n            return None\n\n        self.initializer.remove_methods(env)\n\n        return builder\n\n    def __call__(self, env, *args, **kw):\n        \"\"\"\n        \"\"\"\n        builder = self.get_builder(env)\n        if builder is None:\n            return [], []\n        return builder(*args, **kw)\n\n\nclass ToolInitializer(object):\n    \"\"\"\n    A class for delayed initialization of Tools modules.\n\n    Instances of this class associate a list of Tool modules with\n    a list of Builder method names that will be added by those Tool\n    modules.  As part of instantiating this object for a particular\n    construction environment, we also add the appropriate\n    ToolInitializerMethod objects for the various Builder methods\n    that we want to use to delay Tool searches until necessary.\n    \"\"\"\n\n    def __init__(self, env, tools, names):\n        if not SCons.Util.is_List(tools):\n            tools = [tools]\n        if not SCons.Util.is_List(names):\n            names = [names]\n        self.env = env\n        self.tools = tools\n        self.names = names\n        self.methods = {}\n        for name in names:\n            method = ToolInitializerMethod(name, self)\n            self.methods[name] = method\n            env.AddMethod(method)\n\n    def remove_methods(self, env):\n        \"\"\"\n        Removes the methods that were added by the tool initialization\n        so we no longer copy and re-bind them when the construction\n        environment gets cloned.\n        \"\"\"\n        for method in list(self.methods.values()):\n            env.RemoveMethod(method)\n\n    def apply_tools(self, env):\n        \"\"\"\n        Searches the list of associated Tool modules for one that\n        exists, and applies that to the construction environment.\n        \"\"\"\n        for t in self.tools:\n            tool = SCons.Tool.Tool(t)\n            if tool.exists(env):\n                env.Tool(tool)\n                return\n\n        # If we fall through here, there was no tool module found.\n        # This is where we can put an informative error message\n        # about the inability to find the tool.   We'll start doing\n        # this as we cut over more pre-defined Builder+Tools to use\n        # the ToolInitializer class.\n\n\ndef Initializers(env):\n    ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib'])\n\n    def Install(self, *args, **kw):\n        return self._InternalInstall(*args, **kw)\n\n    def InstallAs(self, *args, **kw):\n        return self._InternalInstallAs(*args, **kw)\n\n    def InstallVersionedLib(self, *args, **kw):\n        return self._InternalInstallVersionedLib(*args, **kw)\n\n    env.AddMethod(Install)\n    env.AddMethod(InstallAs)\n    env.AddMethod(InstallVersionedLib)\n\n\ndef FindTool(tools, env):\n    for tool in tools:\n        t = Tool(tool)\n        if t.exists(env):\n            return tool\n    return None\n\n\ndef FindAllTools(tools, env):\n    def ToolExists(tool, env=env):\n        return Tool(tool).exists(env)\n\n    return list(filter(ToolExists, tools))\n\n\ndef tool_list(platform, env):\n    other_plat_tools = []\n    # XXX this logic about what tool to prefer on which platform\n    #     should be moved into either the platform files or\n    #     the tool files themselves.\n    # The search orders here are described in the man page.  If you\n    # change these search orders, update the man page as well.\n    if str(platform) == 'win32':\n        \"prefer Microsoft tools on Windows\"\n        linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32']\n        c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32']\n        cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32']\n        assemblers = ['masm', 'nasm', 'gas', '386asm']\n        fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']\n        ars = ['mslib', 'ar', 'tlib']\n        # Nuitka: Do not use \"midl\" tool.\n        other_plat_tools = ['msvs']\n    elif str(platform) == 'os2':\n        \"prefer IBM tools on OS/2\"\n        linkers = ['ilink', 'gnulink', ]  # 'mslink']\n        c_compilers = ['icc', 'gcc', ]  # 'msvc', 'cc']\n        cxx_compilers = ['icc', 'g++', ]  # 'msvc', 'cxx']\n        assemblers = ['nasm', ]  # 'masm', 'gas']\n        fortran_compilers = ['ifl', 'g77']\n        ars = ['ar', ]  # 'mslib']\n    elif str(platform) == 'irix':\n        \"prefer MIPSPro on IRIX\"\n        linkers = ['sgilink', 'gnulink']\n        c_compilers = ['sgicc', 'gcc', 'cc']\n        cxx_compilers = ['sgicxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['sgiar']\n    elif str(platform) == 'sunos':\n        \"prefer Forte tools on SunOS\"\n        linkers = ['sunlink', 'gnulink']\n        c_compilers = ['suncc', 'gcc', 'cc']\n        cxx_compilers = ['suncxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77',\n                             'gfortran', 'g77', 'fortran']\n        ars = ['sunar']\n    elif str(platform) == 'hpux':\n        \"prefer aCC tools on HP-UX\"\n        linkers = ['hplink', 'gnulink']\n        c_compilers = ['hpcc', 'gcc', 'cc']\n        cxx_compilers = ['hpcxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['ar']\n    elif str(platform) == 'aix':\n        \"prefer AIX Visual Age tools on AIX\"\n        linkers = ['aixlink', 'gnulink']\n        c_compilers = ['aixcc', 'gcc', 'cc']\n        cxx_compilers = ['aixcxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran']\n        ars = ['ar']\n    elif str(platform) == 'darwin':\n        \"prefer GNU tools on Mac OS X, except for some linkers and IBM tools\"\n        linkers = ['applelink', 'gnulink']\n        c_compilers = ['gcc', 'cc']\n        cxx_compilers = ['g++', 'cxx']\n        assemblers = ['as']\n        fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']\n        ars = ['ar']\n    elif str(platform) == 'cygwin':\n        \"prefer GNU tools on Cygwin, except for a platform-specific linker\"\n        linkers = ['cyglink', 'mslink', 'ilink']\n        c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']\n        cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx']\n        assemblers = ['gas', 'nasm', 'masm']\n        fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']\n        ars = ['ar', 'mslib']\n    else:\n        \"prefer GNU tools on all other platforms\"\n        linkers = ['gnulink', 'ilink']\n        c_compilers = ['gcc', 'intelc', 'icc', 'cc']\n        # Nuitka: Avoid ununused tools\n        # cxx_compilers = ['g++', 'intelc', 'icc', 'cxx']\n        cxx_compilers = ['g++']\n        assemblers = ['gas', 'nasm', 'masm']\n        fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']\n        ars = ['ar', ]\n\n# Nuitka: Avoid ununused tools\n#     if not str(platform) == 'win32':\n#         other_plat_tools += ['m4', 'rpm']\n\n    c_compiler = FindTool(c_compilers, env) or c_compilers[0]\n\n    # XXX this logic about what tool provides what should somehow be\n    #     moved into the tool files themselves.\n    if c_compiler and c_compiler == 'mingw':\n        # MinGW contains a linker, C compiler, C++ compiler,\n        # Fortran compiler, archiver and assembler:\n        cxx_compiler = None\n        linker = None\n        assembler = None\n        fortran_compiler = None\n        ar = None\n    else:\n        # Don't use g++ if the C compiler has built-in C++ support:\n        # Nuitka: Avoid GNU C++ tool\n        if c_compiler in ('msvc', 'intelc', 'icc') or not cxx_compilers:\n            cxx_compiler = None\n        else:\n            cxx_compiler = FindTool(cxx_compilers, env) or cxx_compilers[0]\n\n        linker = FindTool(linkers, env) or linkers[0]\n# Nuitka: Avoid ununused tools\n#         assembler = FindTool(assemblers, env) or assemblers[0]\n#         fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0]\n#         ar = FindTool(ars, env) or ars[0]\n        fortran_compiler = []\n        ar = None\n\n    d_compilers = ['dmd', 'ldc', 'gdc']\n# Nuitka: Avoid ununused tools\n#     d_compiler = FindTool(d_compilers, env) or d_compilers[0]\n    d_compiler = []\n\n    other_tools = FindAllTools(other_plat_tools, env)\n# Nuitka: Avoid ununused tools + [\n#         # TODO: merge 'install' into 'filesystem' and\n#         # make 'filesystem' the default\n#         'filesystem',\n#         'wix',  # 'midl', 'msvs',\n#         # Parser generators\n#         'lex', 'yacc',\n#         # Foreign function interface\n#         'rpcgen', 'swig',\n#         # Java\n#         'jar', 'javac', 'javah', 'rmic',\n#         # TeX\n#         'dvipdf', 'dvips', 'gs',\n#         'tex', 'latex', 'pdflatex', 'pdftex',\n#         # Archivers\n#         'tar', 'zip',\n#         # File builders (text)\n#         'textfile',\n#     ], env)\n\n    tools = ([linker, c_compiler, cxx_compiler,\n              fortran_compiler, ar, d_compiler]\n             + other_tools)\n\n    return [x for x in tools if x]\n\n\ndef find_program_path(env, key_program, default_paths=None):\n    \"\"\"\n    Find the location of a tool using various means.\n\n    Mainly for windows where tools aren't all installed in /usr/bin, etc.\n\n    :param env: Current Construction Environment.\n    :param key_program: Tool to locate.\n    :param default_paths: List of additional paths this tool might be found in.\n    \"\"\"\n    # First search in the SCons path\n    path = env.WhereIs(key_program)\n    if path:\n        return path\n\n    # Then in the OS path\n    path = SCons.Util.WhereIs(key_program)\n    if path:\n        return path\n\n    # Finally, add the defaults and check again. Do not change\n    # ['ENV']['PATH'] permananetly, the caller can do that if needed.\n    if default_paths is None:\n        return path\n    save_path = env['ENV']['PATH']\n    for p in default_paths:\n        env.AppendENVPath('PATH', p)\n    path = env.WhereIs(key_program)\n    env['ENV']['PATH'] = save_path\n    return path\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/aixc++.py",
    "content": "\"\"\"SCons.Tool.aixc++\n\nTool-specific initialization for IBM xlC / Visual Age C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixc++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.aixcxx import *\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/aixcc.py",
    "content": "\"\"\"SCons.Tool.aixcc\n\nTool-specific initialization for IBM xlc / Visual Age C compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixcc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\nfrom . import cc\n\npackages = ['vac.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CC', 'xlc')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlc / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        _cc = os.path.join(path, _cc)\n\n    if 'CC' not in env:\n        env['CC'] = _cc\n\n    cc.generate(env)\n\n    if version:\n        env['CCVERSION'] = version\n\ndef exists(env):\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        xlc = os.path.join(path, _cc)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/aixcxx.py",
    "content": "\"\"\"SCons.Tool.aixc++\n\nTool-specific initialization for IBM xlC / Visual Age C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixcxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\npackages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CXX', 'xlC')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlC / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        _cxx = os.path.join(path, _cxx)\n\n    if 'CXX' not in env:\n        env['CXX'] = _cxx\n\n    cplusplus.generate(env)\n\n    if version:\n        env['CXXVERSION'] = version\n    \ndef exists(env):\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        xlc = os.path.join(path, _cxx)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/aixlink.py",
    "content": "\"\"\"SCons.Tool.aixlink\n\nTool-specific initialization for the IBM Visual Age linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/aixlink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nfrom . import aixcc\nfrom . import link\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\n\ndef smart_linkflags(source, target, env, for_signature):\n    if cplusplus.iscplusplus(source):\n        build_dir = env.subst('$BUILDDIR', target=target, source=source)\n        if build_dir:\n            return '-qtempinc=' + os.path.join(build_dir, 'tempinc')\n    return ''\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n\n    env['SMARTLINKFLAGS'] = smart_linkflags\n    env['LINKFLAGS']      = SCons.Util.CLVar('$SMARTLINKFLAGS')\n    env['SHLINKFLAGS']    = SCons.Util.CLVar('$LINKFLAGS -qmkshrobj -qsuppress=1501-218')\n    env['SHLIBSUFFIX']    = '.a'\n\ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] }\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env: # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/applelink.py",
    "content": "\"\"\"SCons.Tool.applelink\n\nTool-specific initialization for Apple's gnu-like linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/applelink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\n\n# Even though the Mac is based on the GNU toolchain, it doesn't understand\n# the -rpath option, so we use the \"link\" tool instead of \"gnulink\".\nfrom . import link\n\n\nclass AppleLinkInvalidCurrentVersionException(Exception):\n    pass\n\nclass AppleLinkInvalidCompatibilityVersionException(Exception):\n    pass\n\n\ndef _applelib_versioned_lib_suffix(env, suffix, version):\n    \"\"\"For suffix='.dylib' and version='0.1.2' it returns '.0.1.2.dylib'\"\"\"\n    Verbose = False\n    if Verbose:\n        print(\"_applelib_versioned_lib_suffix: suffix={!r}\".format(suffix))\n        print(\"_applelib_versioned_lib_suffix: version={!r}\".format(version))\n    if version not in suffix:\n        suffix = \".\" + version + suffix\n    if Verbose:\n        print(\"_applelib_versioned_lib_suffix: return suffix={!r}\".format(suffix))\n    return suffix\n\n\ndef _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, name_func):\n    \"\"\"For libnode='/optional/dir/libfoo.X.Y.Z.dylib' it returns 'libfoo.X.dylib'\"\"\"\n    Verbose = False\n    if Verbose:\n        print(\"_applelib_versioned_lib_soname: version={!r}\".format(version))\n    name = name_func(env, libnode, version, prefix, suffix)\n    if Verbose:\n        print(\"_applelib_versioned_lib_soname: name={!r}\".format(name))\n    major = version.split('.')[0]\n    (libname,_suffix) = name.split('.')\n    soname = '.'.join([libname, major, _suffix])\n    if Verbose:\n        print(\"_applelib_versioned_lib_soname: soname={!r}\".format(soname))\n    return soname\n\ndef _applelib_versioned_shlib_soname(env, libnode, version, prefix, suffix):\n    return _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, link._versioned_shlib_name)\n\n\n# User programmatically describes how SHLIBVERSION maps to values for compat/current.\n_applelib_max_version_values = (65535, 255, 255)\ndef _applelib_check_valid_version(version_string):\n    \"\"\"\n    Check that the version # is valid.\n    X[.Y[.Z]]\n    where X 0-65535\n    where Y either not specified or 0-255\n    where Z either not specified or 0-255\n    :param version_string:\n    :return:\n    \"\"\"\n    parts = version_string.split('.')\n    if len(parts) > 3:\n        return False, \"Version string has too many periods [%s]\"%version_string\n    if len(parts) <= 0:\n        return False, \"Version string unspecified [%s]\"%version_string\n\n    for (i, p) in enumerate(parts):\n        try:\n            p_i = int(p)\n        except ValueError:\n            return False, \"Version component %s (from %s) is not a number\"%(p, version_string)\n        if p_i < 0 or p_i > _applelib_max_version_values[i]:\n            return False, \"Version component %s (from %s) is not valid value should be between 0 and %d\"%(p, version_string, _applelib_max_version_values[i])\n\n    return True, \"\"\n\n\ndef _applelib_currentVersionFromSoVersion(source, target, env, for_signature):\n    \"\"\"\n    A generator function to create the -Wl,-current_version flag if needed.\n    If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated\n    Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']\n    will be used.\n\n    :param source:\n    :param target:\n    :param env:\n    :param for_signature:\n    :return: A string providing the flag to specify the current_version of the shared library\n    \"\"\"\n    if env.get('APPLELINK_NO_CURRENT_VERSION', False):\n        return \"\"\n    elif env.get('APPLELINK_CURRENT_VERSION', False):\n        version_string = env['APPLELINK_CURRENT_VERSION']\n    elif env.get('SHLIBVERSION', False):\n        version_string = env['SHLIBVERSION']\n    else:\n        return \"\"\n\n    version_string = \".\".join(version_string.split('.')[:3])\n\n    valid, reason = _applelib_check_valid_version(version_string)\n    if not valid:\n        raise AppleLinkInvalidCurrentVersionException(reason)\n\n    return \"-Wl,-current_version,%s\" % version_string\n\n\ndef _applelib_compatVersionFromSoVersion(source, target, env, for_signature):\n    \"\"\"\n    A generator function to create the -Wl,-compatibility_version flag if needed.\n    If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated\n    Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified\n    the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.\n\n    :param source:\n    :param target:\n    :param env:\n    :param for_signature:\n    :return: A string providing the flag to specify the compatibility_version of the shared library\n    \"\"\"\n    if env.get('APPLELINK_NO_COMPATIBILITY_VERSION', False):\n        return \"\"\n    elif env.get('APPLELINK_COMPATIBILITY_VERSION', False):\n        version_string = env['APPLELINK_COMPATIBILITY_VERSION']\n    elif env.get('SHLIBVERSION', False):\n        version_string = \".\".join(env['SHLIBVERSION'].split('.')[:2] + ['0'])\n    else:\n        return \"\"\n\n    if version_string is None:\n        return \"\"\n\n    valid, reason = _applelib_check_valid_version(version_string)\n    if not valid:\n        raise AppleLinkInvalidCompatibilityVersionException(reason)\n\n    return \"-Wl,-compatibility_version,%s\" % version_string\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for applelink to an\n    Environment.\"\"\"\n    link.generate(env)\n\n    env['FRAMEWORKPATHPREFIX'] = '-F'\n    env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, \"\", __env__, RDirs)}'\n\n    env['_FRAMEWORKS'] = '${_concat(\"-framework \", FRAMEWORKS, \"\", __env__)}'\n    env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib')\n    env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n\n    # see: http://docstore.mik.ua/orelly/unix3/mac/ch05_04.htm  for proper naming\n    link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname)\n    env['LINKCALLBACKS'] = link._versioned_lib_callbacks()\n    env['LINKCALLBACKS']['VersionedShLibSuffix'] = _applelib_versioned_lib_suffix\n    env['LINKCALLBACKS']['VersionedShLibSoname'] = _applelib_versioned_shlib_soname\n\n    env['_APPLELINK_CURRENT_VERSION'] = _applelib_currentVersionFromSoVersion\n    env['_APPLELINK_COMPATIBILITY_VERSION'] = _applelib_compatVersionFromSoVersion\n    env['_SHLIBVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '\n    env['_LDMODULEVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '\n\n    # override the default for loadable modules, which are different\n    # on OS X than dynamic shared libs.  echoing what XCode does for\n    # pre/suffixes:\n    env['LDMODULEPREFIX'] = '' \n    env['LDMODULESUFFIX'] = '' \n    env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle')\n    env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n    env['__SHLIBVERSIONFLAGS'] = '${__libversionflags(__env__,\"SHLIBVERSION\",\"_SHLIBVERSIONFLAGS\")}'\n\n\n\ndef exists(env):\n    return env['PLATFORM'] == 'darwin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/ar.py",
    "content": "\"\"\"SCons.Tool.ar\n\nTool-specific initialization for ar (library archive).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ar.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    env['AR']          = 'ar'\n    env['ARFLAGS']     = SCons.Util.CLVar('rc')\n    env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\n    if env.get('RANLIB',env.Detect('ranlib')) :\n        env['RANLIB']      = env.get('RANLIB','ranlib')\n        env['RANLIBFLAGS'] = SCons.Util.CLVar('')\n        env['RANLIBCOM']   = '$RANLIB $RANLIBFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/as.py",
    "content": "\"\"\"SCons.Tool.as\n\nTool-specific initialization for as, the generic Posix assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/as.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nassemblers = ['as']\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/bcc32.py",
    "content": "\"\"\"SCons.Tool.bcc32\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/bcc32.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef findIt(program, env):\n    # First search in the SCons path and then the OS path:\n    borwin = env.WhereIs(program) or SCons.Util.WhereIs(program)\n    if borwin:\n        dir = os.path.dirname(borwin)\n        env.PrependENVPath('PATH', dir)\n    return borwin\n\ndef generate(env):\n    findIt('bcc32', env)\n    \"\"\"Add Builders and construction variables for bcc to an\n    Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n    for suffix in ['.c', '.cpp']:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['CC']        = 'bcc32'\n    env['CCFLAGS']   = SCons.Util.CLVar('')\n    env['CFLAGS']   = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -q $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -WD $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.dll'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n    env['CFILESUFFIX'] = '.cpp'\n\ndef exists(env):\n    return findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/c++.py",
    "content": "\"\"\"SCons.Tool.c++\n\nTool-specific initialization for generic Posix C++ compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/c++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.cxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/cc.py",
    "content": "\"\"\"SCons.Tool.cc\n\nTool-specific initialization for generic Posix C compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/cc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool\nimport SCons.Defaults\nimport SCons.Util\n\nCSuffixes = ['.c', '.m']\nif not SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CSuffixes.append('.C')\n\ndef add_common_cc_variables(env):\n    \"\"\"\n    Add underlying common \"C compiler\" variables that\n    are used by multiple tools (specifically, c++).\n    \"\"\"\n    if '_CCCOMCOM' not in env:\n        env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS'\n        # It's a hack to test for darwin here, but the alternative\n        # of creating an applecc.py to contain this seems overkill.\n        # Maybe someday the Apple platform will require more setup and\n        # this logic will be moved.\n        env['FRAMEWORKS'] = SCons.Util.CLVar('')\n        env['FRAMEWORKPATH'] = SCons.Util.CLVar('')\n        if env['PLATFORM'] == 'darwin':\n            env['_CCCOMCOM'] = env['_CCCOMCOM'] + ' $_FRAMEWORKPATH'\n\n    if 'CCFLAGS' not in env:\n        env['CCFLAGS']   = SCons.Util.CLVar('')\n\n    if 'SHCCFLAGS' not in env:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n\ncompilers = ['cc']\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for C compilers to an Environment.\n    \"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    add_common_cc_variables(env)\n\n    if 'CC' not in env:\n        env['CC']    = env.Detect(compilers) or compilers[0]\n    env['CFLAGS']    = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CFILESUFFIX'] = '.c'\n\ndef exists(env):\n    return env.Detect(env.get('CC', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/clang.py",
    "content": "# -*- coding: utf-8; -*-\n\n\"\"\"SCons.Tool.clang\n\nTool-specific initialization for clang.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# __revision__ = \"src/engine/SCons/Tool/clang.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n# Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool.\n# Brought into the SCons mainline by Russel Winder 2017.\n\nimport os\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Util\nimport SCons.Tool.cc\nfrom SCons.Tool.clangCommon import get_clang_install_dirs\n\n\ncompilers = ['clang']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for clang to an Environment.\"\"\"\n    SCons.Tool.cc.generate(env)\n\n    if env['PLATFORM'] == 'win32':\n        # Ensure that we have a proper path for clang\n        clang = SCons.Tool.find_program_path(env, compilers[0], \n                                             default_paths=get_clang_install_dirs(env['PLATFORM']))\n        if clang:\n            clang_bin_dir = os.path.dirname(clang)\n            env.AppendENVPath('PATH', clang_bin_dir)\n\n    env['CC'] = env.Detect(compilers) or 'clang'\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    else:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')\n\n    # determine compiler version\n    if env['CC']:\n        #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],\n        pipe = SCons.Action._subproc(env, [env['CC'], '--version'],\n                                     stdin='devnull',\n                                     stderr='devnull',\n                                     stdout=subprocess.PIPE)\n        if pipe.wait() != 0: return\n        # clang -dumpversion is of no use\n        with pipe.stdout:\n            line = pipe.stdout.readline()\n        if sys.version_info[0] > 2:\n            line = line.decode()\n        match = re.search(r'clang +version +([0-9]+(?:\\.[0-9]+)+)', line)\n        if match:\n            env['CCVERSION'] = match.group(1)\n\ndef exists(env):\n    return env.Detect(compilers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/clangCommon/__init__.py",
    "content": "\"\"\"\nCommon routines and data for clang tools\n\"\"\"\n\nclang_win32_dirs = [\n    r'C:\\Program Files\\LLVM\\bin',\n    r'C:\\cygwin64\\bin',\n    r'C:\\msys64',\n    r'C:\\cygwin\\bin',\n    r'C:\\msys',\n]\n\ndef get_clang_install_dirs(platform):\n    if platform == 'win32':\n        return clang_win32_dirs\n    else:\n        return []"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/clangxx.py",
    "content": "# -*- coding: utf-8; -*-\n\n\"\"\"SCons.Tool.clang++\n\nTool-specific initialization for clang++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# __revision__ = \"src/engine/SCons/Tool/clangxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n# Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool.\n# Brought into the SCons mainline by Russel Winder 2017.\n\nimport os.path\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Tool.cxx\nfrom SCons.Tool.clangCommon import get_clang_install_dirs\n\n\ncompilers = ['clang++']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for clang++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    SCons.Tool.cxx.generate(env)\n\n    env['CXX']        = env.Detect(compilers) or 'clang++'\n\n    # platform specific settings\n    if env['PLATFORM'] == 'aix':\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')\n        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n        env['SHOBJSUFFIX'] = '$OBJSUFFIX'\n    elif env['PLATFORM'] == 'hpux':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'sunos':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'win32':\n        # Ensure that we have a proper path for clang++\n        clangxx = SCons.Tool.find_program_path(env, compilers[0], default_paths=get_clang_install_dirs(env['PLATFORM']))\n        if clangxx:\n            clangxx_bin_dir = os.path.dirname(clangxx)\n            env.AppendENVPath('PATH', clangxx_bin_dir)\n\n    # determine compiler version\n    if env['CXX']:\n        pipe = SCons.Action._subproc(env, [env['CXX'], '--version'],\n                                     stdin='devnull',\n                                     stderr='devnull',\n                                     stdout=subprocess.PIPE)\n        if pipe.wait() != 0: \n            return\n        \n        # clang -dumpversion is of no use\n        with pipe.stdout:\n            line = pipe.stdout.readline()\n        if sys.version_info[0] > 2:\n            line = line.decode()\n        match = re.search(r'clang +version +([0-9]+(?:\\.[0-9]+)+)', line)\n        if match:\n            env['CXXVERSION'] = match.group(1)\n\ndef exists(env):\n    return env.Detect(compilers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/cxx.py",
    "content": "\"\"\"SCons.Tool.c++\n\nTool-specific initialization for generic Posix C++ compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/cxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Tool\nimport SCons.Defaults\nimport SCons.Util\n\ncompilers = ['CC', 'c++']\n\nCXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']\nif SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CXXSuffixes.append('.C')\n\ndef iscplusplus(source):\n    if not source:\n        # Source might be None for unusual cases like SConf.\n        return 0\n    for s in source:\n        if s.sources:\n            ext = os.path.splitext(str(s.sources[0]))[1]\n            if ext in CXXSuffixes:\n                return 1\n    return 0\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age C++ compilers\n    to an Environment.\n    \"\"\"\n    import SCons.Tool\n    import SCons.Tool.cc\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    SCons.Tool.cc.add_common_cc_variables(env)\n\n    if 'CXX' not in env:\n        env['CXX']    = env.Detect(compilers) or compilers[0]\n    env['CXXFLAGS']   = SCons.Util.CLVar('')\n    env['CXXCOM']     = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['OBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect(env.get('CXX', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/cyglink.py",
    "content": "\"\"\"SCons.Tool.cyglink\n\nCustomization of gnulink for Cygwin (http://www.cygwin.com/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nfrom __future__ import absolute_import, print_function\n\nimport re\nimport os\n\nimport SCons.Action\nimport SCons.Util\nimport SCons.Tool\n\n#MAYBE:  from . import gnulink\nfrom . import gnulink\nfrom . import link\n\ndef _lib_generator(target, source, env, for_signature, **kw):\n    try: cmd = kw['cmd']\n    except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])\n\n    try: vp = kw['varprefix']\n    except KeyError: vp = 'SHLIB'\n\n    dll = env.FindIxes(target, '%sPREFIX' % vp, '%sSUFFIX' % vp)\n    if dll: cmd.extend(['-o', dll])\n\n    cmd.extend(['$SHLINKFLAGS', '$__%sVERSIONFLAGS' % vp, '$__RPATH'])\n\n    implib = env.FindIxes(target, 'IMPLIBPREFIX', 'IMPLIBSUFFIX')\n    if implib:\n        cmd.extend([\n            '-Wl,--out-implib='+implib.get_string(for_signature),\n            '-Wl,--export-all-symbols',\n            '-Wl,--enable-auto-import',\n            '-Wl,--whole-archive', '$SOURCES',\n            '-Wl,--no-whole-archive', '$_LIBDIRFLAGS', '$_LIBFLAGS'\n            ])\n    else:\n        cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    return [cmd]\n\n\ndef shlib_generator(target, source, env, for_signature):\n    return _lib_generator(target, source, env, for_signature,\n                          varprefix='SHLIB',\n                          cmd = SCons.Util.CLVar(['$SHLINK']))\n\ndef ldmod_generator(target, source, env, for_signature):\n    return _lib_generator(target, source, env, for_signature,\n                          varprefix='LDMODULE',\n                          cmd = SCons.Util.CLVar(['$LDMODULE']))\n\ndef _lib_emitter(target, source, env, **kw):\n    Verbose = False\n\n    if Verbose:\n        print(\"_lib_emitter: target[0]=%r\" % target[0].get_path())\n\n    try: vp = kw['varprefix']\n    except KeyError: vp = 'SHLIB'\n\n    try: libtype = kw['libtype']\n    except KeyError: libtype = 'ShLib'\n\n    dll = env.FindIxes(target, '%sPREFIX' % vp, '%sSUFFIX' % vp)\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if Verbose:\n        print(\"_lib_emitter: dll=%r\" % dll.get_path())\n\n    if not dll or len(target) > 1:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$%sSUFFIX\" % vp))\n\n    # Remove any \"lib\" after the prefix\n    pre = env.subst('$%sPREFIX' % vp)\n    if dll.name[len(pre):len(pre)+3] == 'lib':\n        dll.name = pre + dll.name[len(pre)+3:]\n\n    if Verbose:\n        print(\"_lib_emitter: dll.name=%r\" % dll.name)\n\n    orig_target = target\n    target = [env.fs.File(dll)]\n    target[0].attributes.shared = 1\n\n    if Verbose:\n        print(\"_lib_emitter: after target=[env.fs.File(dll)]: target[0]=%r\" % target[0].get_path())\n\n    # Append an import lib target\n    if not no_import_lib:\n        # Create list of target libraries as strings\n        target_strings = env.ReplaceIxes(orig_target[0],\n                                         '%sPREFIX' % vp, '%sSUFFIX' % vp,\n                                         'IMPLIBPREFIX', 'IMPLIBSUFFIX')\n        if Verbose:\n            print(\"_lib_emitter: target_strings=%r\" % target_strings)\n\n        implib_target = env.fs.File(target_strings)\n        if Verbose:\n            print(\"_lib_emitter: implib_target=%r\" % implib_target.get_path())\n        implib_target.attributes.shared = 1\n        target.append(implib_target)\n\n    symlinks = SCons.Tool.ImpLibSymlinkGenerator(env, implib_target,\n                                                 implib_libtype=libtype,\n                                                 generator_libtype=libtype+'ImpLib')\n    if Verbose:\n        print(\"_lib_emitter: implib symlinks=%r\" % SCons.Tool.StringizeLibSymlinks(symlinks))\n    if symlinks:\n        SCons.Tool.EmitLibSymlinks(env, symlinks, implib_target, clean_targets = target[0])\n        implib_target.attributes.shliblinks = symlinks\n\n    return (target, source)\n\ndef shlib_emitter(target, source, env):\n    return _lib_emitter(target, source, env, varprefix='SHLIB', libtype='ShLib')\n\ndef ldmod_emitter(target, source, env):\n    return _lib_emitter(target, source, env, varprefix='LDMODULE', libtype='LdMod')\n\ndef _versioned_lib_suffix(env, suffix, version):\n    \"\"\"Generate versioned shared library suffix from a unversioned one.\n       If suffix='.dll', and version='0.1.2', then it returns '-0-1-2.dll'\"\"\"\n    Verbose = False\n    if Verbose:\n        print(\"_versioned_lib_suffix: suffix= \", suffix)\n        print(\"_versioned_lib_suffix: version= \", version)\n    cygversion = re.sub(r'\\.', '-', version)\n    if not suffix.startswith('-' + cygversion):\n        suffix = '-' + cygversion + suffix\n    if Verbose:\n        print(\"_versioned_lib_suffix: return suffix= \", suffix)\n    return suffix\n\ndef _versioned_implib_name(env, libnode, version, prefix, suffix, **kw):\n    return link._versioned_lib_name(env, libnode, version, prefix, suffix,\n                                    SCons.Tool.ImpLibPrefixGenerator,\n                                    SCons.Tool.ImpLibSuffixGenerator,\n                                    implib_libtype=kw['libtype'])\n\ndef _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):\n    \"\"\"Generate link names that should be created for a versioned shared library.\n       Returns a list in the form [ (link, linktarget), ... ]\n    \"\"\"\n    Verbose = False\n\n    if Verbose:\n        print(\"_versioned_implib_symlinks: libnode=%r\" % libnode.get_path())\n        print(\"_versioned_implib_symlinks: version=%r\" % version)\n\n    try: libtype = kw['libtype']\n    except KeyError: libtype = 'ShLib'\n\n\n    linkdir = os.path.dirname(libnode.get_path())\n    if Verbose:\n        print(\"_versioned_implib_symlinks: linkdir=%r\" % linkdir)\n\n    name = SCons.Tool.ImpLibNameGenerator(env, libnode,\n                                          implib_libtype=libtype,\n                                          generator_libtype=libtype+'ImpLib')\n    if Verbose:\n        print(\"_versioned_implib_symlinks: name=%r\" % name)\n\n    major = version.split('.')[0]\n\n    link0 = env.fs.File(os.path.join(linkdir, name))\n    symlinks = [(link0, libnode)]\n\n    if Verbose:\n        print(\"_versioned_implib_symlinks: return symlinks=%r\" % SCons.Tool.StringizeLibSymlinks(symlinks))\n\n    return symlinks\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\nldmod_action = SCons.Action.Action(ldmod_generator, generator=1)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for cyglink to an Environment.\"\"\"\n    gnulink.generate(env)\n\n    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,-no-undefined')\n\n    env['SHLINKCOM'] = shlib_action\n    env['LDMODULECOM'] = ldmod_action\n    env.Append(SHLIBEMITTER = [shlib_emitter])\n    env.Append(LDMODULEEMITTER = [ldmod_emitter])\n\n    env['SHLIBPREFIX']         = 'cyg'\n    env['SHLIBSUFFIX']         = '.dll'\n\n    env['IMPLIBPREFIX']        = 'lib'\n    env['IMPLIBSUFFIX']        = '.dll.a'\n\n    # Variables used by versioned shared libraries\n    env['_SHLIBVERSIONFLAGS']      = '$SHLIBVERSIONFLAGS'\n    env['_LDMODULEVERSIONFLAGS']   = '$LDMODULEVERSIONFLAGS'\n\n    # SHLIBVERSIONFLAGS and LDMODULEVERSIONFLAGS are same as in gnulink...\n\n    # LINKCALLBACKS are NOT inherited from gnulink\n    env['LINKCALLBACKS'] = {\n        'VersionedShLibSuffix'          : _versioned_lib_suffix,\n        'VersionedLdModSuffix'          : _versioned_lib_suffix,\n        'VersionedImpLibSuffix'         : _versioned_lib_suffix,\n        'VersionedShLibName'            : link._versioned_shlib_name,\n        'VersionedLdModName'            : link._versioned_ldmod_name,\n        'VersionedShLibImpLibName'      : lambda *args: _versioned_implib_name(*args, libtype='ShLib'),\n        'VersionedLdModImpLibName'      : lambda *args: _versioned_implib_name(*args, libtype='LdMod'),\n        'VersionedShLibImpLibSymlinks'  : lambda *args: _versioned_implib_symlinks(*args, libtype='ShLib'),\n        'VersionedLdModImpLibSymlinks'  : lambda *args: _versioned_implib_symlinks(*args, libtype='LdMod'),\n    }\n\n    # these variables were set by gnulink but are not used in cyglink\n    try: del env['_SHLIBSONAME']\n    except KeyError: pass\n    try: del env['_LDMODULESONAME']\n    except KeyError: pass\n\ndef exists(env):\n    return gnulink.exists(env)\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/default.py",
    "content": "\"\"\"SCons.Tool.default\n\nInitialization with a default tool list.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/default.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool\n\ndef generate(env):\n    \"\"\"Add default tools.\"\"\"\n    for t in SCons.Tool.tool_list(env['PLATFORM'], env):\n        SCons.Tool.Tool(t)(env)\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/docbook/__init__.py",
    "content": "\n\"\"\"SCons.Tool.docbook\n\nTool-specific initialization for Docbook.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os\nimport glob\nimport re\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Script\nimport SCons.Tool\nimport SCons.Util\n\n\n__debug_tool_location = False\n# Get full path to this script\nscriptpath = os.path.dirname(os.path.realpath(__file__))\n\n# Local folder for the collection of DocBook XSLs\ndb_xsl_folder = 'docbook-xsl-1.76.1'\n\n# Do we have libxml2/libxslt/lxml?\nhas_libxml2 = True\nhas_lxml = True\ntry:\n    import libxml2\n    import libxslt\nexcept:\n    has_libxml2 = False\ntry:\n    import lxml\nexcept:\n    has_lxml = False\n\n# Set this to True, to prefer xsltproc over libxml2 and lxml\nprefer_xsltproc = False\n\n# Regexs for parsing Docbook XML sources of MAN pages\nre_manvolnum = re.compile(\"<manvolnum>([^<]*)</manvolnum>\")\nre_refname = re.compile(\"<refname>([^<]*)</refname>\")\n\n#\n# Helper functions\n#\ndef __extend_targets_sources(target, source):\n    \"\"\" Prepare the lists of target and source files. \"\"\"\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target[:]\n    elif not SCons.Util.is_List(source):\n        source = [source]\n    if len(target) < len(source):\n        target.extend(source[len(target):])\n\n    return target, source\n\ndef __init_xsl_stylesheet(kw, env, user_xsl_var, default_path):\n    if kw.get('DOCBOOK_XSL','') == '':\n        xsl_style = kw.get('xsl', env.subst(user_xsl_var))\n        if xsl_style == '':\n            path_args = [scriptpath, db_xsl_folder] + default_path\n            xsl_style = os.path.join(*path_args)\n        kw['DOCBOOK_XSL'] =  xsl_style\n\ndef __select_builder(lxml_builder, libxml2_builder, cmdline_builder):\n    \"\"\" Selects a builder, based on which Python modules are present. \"\"\"\n    if prefer_xsltproc:\n        return cmdline_builder\n\n    if not has_libxml2:\n        # At the moment we prefer libxml2 over lxml, the latter can lead\n        # to conflicts when installed together with libxml2.\n        if has_lxml:\n            return lxml_builder\n        else:\n            return cmdline_builder\n\n    return libxml2_builder\n\ndef __ensure_suffix(t, suffix):\n    \"\"\" Ensure that the target t has the given suffix. \"\"\"\n    tpath = str(t)\n    if not tpath.endswith(suffix):\n        return tpath+suffix\n\n    return t\n\ndef __ensure_suffix_stem(t, suffix):\n    \"\"\" Ensure that the target t has the given suffix, and return the file's stem. \"\"\"\n    tpath = str(t)\n    if not tpath.endswith(suffix):\n        stem = tpath\n        tpath += suffix\n\n        return tpath, stem\n    else:\n        stem, ext = os.path.splitext(tpath)\n\n    return t, stem\n\ndef __get_xml_text(root):\n    \"\"\" Return the text for the given root node (xml.dom.minidom). \"\"\"\n    txt = \"\"\n    for e in root.childNodes:\n        if (e.nodeType == e.TEXT_NODE):\n            txt += e.data\n    return txt\n\ndef __create_output_dir(base_dir):\n    \"\"\" Ensure that the output directory base_dir exists. \"\"\"\n    root, tail = os.path.split(base_dir)\n    dir = None\n    if tail:\n        if base_dir.endswith('/'):\n            dir = base_dir\n        else:\n            dir = root\n    else:\n        if base_dir.endswith('/'):\n            dir = base_dir\n\n    if dir and not os.path.isdir(dir):\n        os.makedirs(dir)\n\n\n#\n# Supported command line tools and their call \"signature\"\n#\nxsltproc_com_priority = ['xsltproc', 'saxon', 'saxon-xslt', 'xalan']\n\n# TODO: Set minimum version of saxon-xslt to be 8.x (lower than this only supports xslt 1.0.\n#       see: http://saxon.sourceforge.net/saxon6.5.5/\n#       see: http://saxon.sourceforge.net/\nxsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',\n                'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',\n                # Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)\n                #  'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL  $DOCBOOK_XSLTPROCPARAMS',\n                'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',\n                'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}\nxmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}\nfop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',\n           'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',\n           'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}\n\ndef __detect_cl_tool(env, chainkey, cdict, cpriority=None):\n    \"\"\"\n    Helper function, picks a command line tool from the list\n    and initializes its environment variables.\n    \"\"\"\n    if env.get(chainkey,'') == '':\n        clpath = ''\n\n        if cpriority is None:\n            cpriority = cdict.keys()\n        for cltool in cpriority:\n            if __debug_tool_location:\n                print(\"DocBook: Looking for %s\"%cltool)\n            clpath = env.WhereIs(cltool)\n            if clpath:\n                if __debug_tool_location:\n                    print(\"DocBook: Found:%s\"%cltool)\n                env[chainkey] = clpath\n                if not env[chainkey + 'COM']:\n                    env[chainkey + 'COM'] = cdict[cltool]\n                break\n\ndef _detect(env):\n    \"\"\"\n    Detect all the command line tools that we might need for creating\n    the requested output formats.\n    \"\"\"\n    global prefer_xsltproc\n\n    if env.get('DOCBOOK_PREFER_XSLTPROC',''):\n        prefer_xsltproc = True\n\n    if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)):\n        # Try to find the XSLT processors\n        __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority)\n        __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)\n\n    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com, ['fop','xep','jw'])\n\n#\n# Scanners\n#\ninclude_re = re.compile('fileref\\\\s*=\\\\s*[\"|\\']([^\\\\n]*)[\"|\\']')\nsentity_re = re.compile('<!ENTITY\\\\s+%*\\\\s*[^\\\\s]+\\\\s+SYSTEM\\\\s+[\"|\\']([^\\\\n]*)[\"|\\']>')\n\ndef __xml_scan(node, env, path, arg):\n    \"\"\" Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. \"\"\"\n    # Does the node exist yet?\n    if not os.path.isfile(str(node)):\n        return []\n\n    if env.get('DOCBOOK_SCANENT',''):\n        # Use simple pattern matching for system entities..., no support\n        # for recursion yet.\n        contents = node.get_text_contents()\n        return sentity_re.findall(contents)\n\n    xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl')\n    if not has_libxml2 or prefer_xsltproc:\n        if has_lxml and not prefer_xsltproc:\n\n            from lxml import etree\n\n            xsl_tree = etree.parse(xsl_file)\n            doc = etree.parse(str(node))\n            result = doc.xslt(xsl_tree)\n\n            depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != \"\" and not x.startswith(\"<?xml \")]\n            return depfiles\n        else:\n            # Try to call xsltproc\n            xsltproc = env.subst(\"$DOCBOOK_XSLTPROC\")\n            if xsltproc and xsltproc.endswith('xsltproc'):\n                result = env.backtick(' '.join([xsltproc, xsl_file, str(node)]))\n                depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != \"\" and not x.startswith(\"<?xml \")]\n                return depfiles\n            else:\n                # Use simple pattern matching, there is currently no support\n                # for xi:includes...\n                contents = node.get_text_contents()\n                return include_re.findall(contents)\n\n    styledoc = libxml2.parseFile(xsl_file)\n    style = libxslt.parseStylesheetDoc(styledoc)\n    doc = libxml2.readFile(str(node), None, libxml2.XML_PARSE_NOENT)\n    result = style.applyStylesheet(doc, None)\n\n    depfiles = []\n    for x in str(result).splitlines():\n        if x.strip() != \"\" and not x.startswith(\"<?xml \"):\n            depfiles.extend(x.strip().split())\n\n    style.freeStylesheet()\n    doc.freeDoc()\n    result.freeDoc()\n\n    return depfiles\n\n# Creating the instance of our XML dependency scanner\ndocbook_xml_scanner = SCons.Script.Scanner(function = __xml_scan,\n                                           argument = None)\n\n\n#\n# Action generators\n#\ndef __generate_xsltproc_action(source, target, env, for_signature):\n    cmd = env['DOCBOOK_XSLTPROCCOM']\n    # Does the environment have a base_dir defined?\n    base_dir = env.subst('$base_dir')\n    if base_dir:\n        # Yes, so replace target path by its filename\n        return cmd.replace('$TARGET','${TARGET.file}')\n    return cmd\n\n\n#\n# Emitters\n#\ndef __emit_xsl_basedir(target, source, env):\n    # Does the environment have a base_dir defined?\n    base_dir = env.subst('$base_dir')\n    if base_dir:\n        # Yes, so prepend it to each target\n        return [os.path.join(base_dir, str(t)) for t in target], source\n\n    # No, so simply pass target and source names through\n    return target, source\n\n\n#\n# Builders\n#\ndef __build_libxml2(target, source, env):\n    \"\"\"\n    General XSLT builder (HTML/FO), using the libxml2 module.\n    \"\"\"\n    xsl_style = env.subst('$DOCBOOK_XSL')\n    styledoc = libxml2.parseFile(xsl_style)\n    style = libxslt.parseStylesheetDoc(styledoc)\n    doc = libxml2.readFile(str(source[0]),None,libxml2.XML_PARSE_NOENT)\n    # Support for additional parameters\n    parampass = {}\n    if parampass:\n        result = style.applyStylesheet(doc, parampass)\n    else:\n        result = style.applyStylesheet(doc, None)\n    style.saveResultToFilename(str(target[0]), result, 0)\n    style.freeStylesheet()\n    doc.freeDoc()\n    result.freeDoc()\n\n    return None\n\ndef __build_lxml(target, source, env):\n    \"\"\"\n    General XSLT builder (HTML/FO), using the lxml module.\n    \"\"\"\n    from lxml import etree\n\n    xslt_ac = etree.XSLTAccessControl(read_file=True,\n                                      write_file=True,\n                                      create_dir=True,\n                                      read_network=False,\n                                      write_network=False)\n    xsl_style = env.subst('$DOCBOOK_XSL')\n    xsl_tree = etree.parse(xsl_style)\n    transform = etree.XSLT(xsl_tree, access_control=xslt_ac)\n    doc = etree.parse(str(source[0]))\n    # Support for additional parameters\n    parampass = {}\n    if parampass:\n        result = transform(doc, **parampass)\n    else:\n        result = transform(doc)\n\n    try:\n        with open(str(target[0]), \"wb\") as of:\n            of.write(etree.tostring(result, pretty_print=True))\n    except:\n        pass\n\n    return None\n\ndef __xinclude_libxml2(target, source, env):\n    \"\"\"\n    Resolving XIncludes, using the libxml2 module.\n    \"\"\"\n    doc = libxml2.readFile(str(source[0]), None, libxml2.XML_PARSE_NOENT)\n    doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT)\n    doc.saveFile(str(target[0]))\n    doc.freeDoc()\n\n    return None\n\ndef __xinclude_lxml(target, source, env):\n    \"\"\"\n    Resolving XIncludes, using the lxml module.\n    \"\"\"\n    from lxml import etree\n\n    doc = etree.parse(str(source[0]))\n    doc.xinclude()\n    try:\n        doc.write(str(target[0]), xml_declaration=True,\n                  encoding=\"UTF-8\", pretty_print=True)\n    except:\n        pass\n\n    return None\n\n__libxml2_builder = SCons.Builder.Builder(\n        action = __build_libxml2,\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n__lxml_builder = SCons.Builder.Builder(\n        action = __build_lxml,\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n\n__xinclude_libxml2_builder = SCons.Builder.Builder(\n        action = __xinclude_libxml2,\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n__xinclude_lxml_builder = SCons.Builder.Builder(\n        action = __xinclude_lxml,\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n\n__xsltproc_builder = SCons.Builder.Builder(\n        action = SCons.Action.CommandGeneratorAction(__generate_xsltproc_action,\n                                                     {'cmdstr' : '$DOCBOOK_XSLTPROCCOMSTR'}),\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner,\n        emitter = __emit_xsl_basedir)\n__xmllint_builder = SCons.Builder.Builder(\n        action = SCons.Action.Action('$DOCBOOK_XMLLINTCOM','$DOCBOOK_XMLLINTCOMSTR'),\n        suffix = '.xml',\n        src_suffix = '.xml',\n        source_scanner = docbook_xml_scanner)\n__fop_builder = SCons.Builder.Builder(\n        action = SCons.Action.Action('$DOCBOOK_FOPCOM','$DOCBOOK_FOPCOMSTR'),\n        suffix = '.pdf',\n        src_suffix = '.fo',\n        ensure_suffix=1)\n\ndef DocbookEpub(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for ePub output.\n    \"\"\"\n    import zipfile\n    import shutil\n\n    def build_open_container(target, source, env):\n        \"\"\"Generate the *.epub file from intermediate outputs\n\n        Constructs the epub file according to the Open Container Format. This\n        function could be replaced by a call to the SCons Zip builder if support\n        was added for different compression formats for separate source nodes.\n        \"\"\"\n        with zipfile.ZipFile(str(target[0]), 'w') as zf:\n            with open('mimetype', 'w') as mime_file:\n                mime_file.write('application/epub+zip')\n            zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED)\n            for s in source:\n                if os.path.isfile(str(s)):\n                    head, tail = os.path.split(str(s))\n                    if not head:\n                        continue\n                    s = head\n                for dirpath, dirnames, filenames in os.walk(str(s)):\n                    for fname in filenames:\n                        path = os.path.join(dirpath, fname)\n                        if os.path.isfile(path):\n                            zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))),\n                                zipfile.ZIP_DEFLATED)\n\n    def add_resources(target, source, env):\n        \"\"\"Add missing resources to the OEBPS directory\n\n        Ensure all the resources in the manifest are present in the OEBPS directory.\n        \"\"\"\n        hrefs = []\n        content_file = os.path.join(source[0].get_abspath(), 'content.opf')\n        if not os.path.isfile(content_file):\n            return\n\n        hrefs = []\n        if has_libxml2:\n            nsmap = {'opf' : 'http://www.idpf.org/2007/opf'}\n            # Read file and resolve entities\n            doc = libxml2.readFile(content_file, None, 0)\n            opf = doc.getRootElement()\n            # Create xpath context\n            xpath_context = doc.xpathNewContext()\n            # Register namespaces\n            for key, val in nsmap.items():\n                xpath_context.xpathRegisterNs(key, val)\n\n            if hasattr(opf, 'xpathEval') and xpath_context:\n                # Use the xpath context\n                xpath_context.setContextNode(opf)\n                items = xpath_context.xpathEval(\".//opf:item\")\n            else:\n                items = opf.findall(\".//{'http://www.idpf.org/2007/opf'}item\")\n\n            for item in items:\n                if hasattr(item, 'prop'):\n                    hrefs.append(item.prop('href'))\n                else:\n                    hrefs.append(item.attrib['href'])\n\n            doc.freeDoc()\n            xpath_context.xpathFreeContext()\n        elif has_lxml:\n            from lxml import etree\n\n            opf = etree.parse(content_file)\n            # All the opf:item elements are resources\n            for item in opf.xpath('//opf:item',\n                    namespaces= { 'opf': 'http://www.idpf.org/2007/opf' }):\n                hrefs.append(item.attrib['href'])\n\n        for href in hrefs:\n            # If the resource was not already created by DocBook XSL itself,\n            # copy it into the OEBPS folder\n            referenced_file = os.path.join(source[0].get_abspath(), href)\n            if not os.path.exists(referenced_file):\n                shutil.copy(href, os.path.join(source[0].get_abspath(), href))\n\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_EPUB', ['epub','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    if not env.GetOption('clean'):\n        # Ensure that the folders OEBPS and META-INF exist\n        __create_output_dir('OEBPS/')\n        __create_output_dir('META-INF/')\n    dirs = env.Dir(['OEBPS', 'META-INF'])\n\n    # Set the fixed base_dir\n    kw['base_dir'] = 'OEBPS/'\n    tocncx = __builder.__call__(env, 'toc.ncx', source[0], **kw)\n    cxml = env.File('META-INF/container.xml')\n    env.SideEffect(cxml, tocncx)\n\n    env.Depends(tocncx, kw['DOCBOOK_XSL'])\n    result.extend(tocncx+[cxml])\n\n    container = env.Command(__ensure_suffix(str(target[0]), '.epub'),\n        tocncx+[cxml], [add_resources, build_open_container])\n    mimetype = env.File('mimetype')\n    env.SideEffect(mimetype, container)\n\n    result.extend(container)\n    # Add supporting files for cleanup\n    env.Clean(tocncx, dirs)\n\n    return result\n\ndef DocbookHtml(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTML output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTML', ['html','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        r = __builder.__call__(env, __ensure_suffix(t,'.html'), s, **kw)\n        env.Depends(r, kw['DOCBOOK_XSL'])\n        result.extend(r)\n\n    return result\n\ndef DocbookHtmlChunked(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for chunked HTML output.\n    \"\"\"\n    # Init target/source\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED', ['html','chunkfast.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, glob.glob(os.path.join(base_dir, '*.html')))\n\n    return result\n\n\ndef DocbookHtmlhelp(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output.\n    \"\"\"\n    # Init target/source\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLHELP', ['htmlhelp','htmlhelp.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, ['toc.hhc', 'htmlhelp.hhp', 'index.hhk'] +\n                 glob.glob(os.path.join(base_dir, '[ar|bk|ch]*.html')))\n\n    return result\n\ndef DocbookPdf(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for PDF output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_PDF', ['fo','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        t, stem = __ensure_suffix_stem(t, '.pdf')\n        xsl = __builder.__call__(env, stem+'.fo', s, **kw)\n        result.extend(xsl)\n        env.Depends(xsl, kw['DOCBOOK_XSL'])\n        result.extend(__fop_builder.__call__(env, t, xsl, **kw))\n\n    return result\n\ndef DocbookMan(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for Man page output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_MAN', ['manpages','docbook.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        volnum = \"1\"\n        outfiles = []\n        srcfile = __ensure_suffix(str(s),'.xml')\n        if os.path.isfile(srcfile):\n            try:\n                import xml.dom.minidom\n\n                dom = xml.dom.minidom.parse(__ensure_suffix(str(s),'.xml'))\n                # Extract volume number, default is 1\n                for node in dom.getElementsByTagName('refmeta'):\n                    for vol in node.getElementsByTagName('manvolnum'):\n                        volnum = __get_xml_text(vol)\n\n                # Extract output filenames\n                for node in dom.getElementsByTagName('refnamediv'):\n                    for ref in node.getElementsByTagName('refname'):\n                        outfiles.append(__get_xml_text(ref)+'.'+volnum)\n\n            except:\n                # Use simple regex parsing\n                with open(__ensure_suffix(str(s),'.xml'), 'r') as f:\n                    content = f.read()\n\n                for m in re_manvolnum.finditer(content):\n                    volnum = m.group(1)\n\n                for m in re_refname.finditer(content):\n                    outfiles.append(m.group(1)+'.'+volnum)\n\n            if not outfiles:\n                # Use stem of the source file\n                spath = str(s)\n                if not spath.endswith('.xml'):\n                    outfiles.append(spath+'.'+volnum)\n                else:\n                    stem, ext = os.path.splitext(spath)\n                    outfiles.append(stem+'.'+volnum)\n        else:\n            # We have to completely rely on the given target name\n            outfiles.append(t)\n\n        __builder.__call__(env, outfiles[0], s, **kw)\n        env.Depends(outfiles[0], kw['DOCBOOK_XSL'])\n        result.append(outfiles[0])\n        if len(outfiles) > 1:\n            env.Clean(outfiles[0], outfiles[1:])\n\n\n    return result\n\ndef DocbookSlidesPdf(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for PDF slides output.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESPDF', ['slides','fo','plain.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        t, stem = __ensure_suffix_stem(t, '.pdf')\n        xsl = __builder.__call__(env, stem+'.fo', s, **kw)\n        env.Depends(xsl, kw['DOCBOOK_XSL'])\n        result.extend(xsl)\n        result.extend(__fop_builder.__call__(env, t, xsl, **kw))\n\n    return result\n\ndef DocbookSlidesHtml(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, providing a Docbook toolchain for HTML slides output.\n    \"\"\"\n    # Init list of targets/sources\n    if not SCons.Util.is_List(target):\n        target = [target]\n    if not source:\n        source = target\n        target = ['index.html']\n    elif not SCons.Util.is_List(source):\n        source = [source]\n\n    # Init XSL stylesheet\n    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl'])\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Detect base dir\n    base_dir = kw.get('base_dir', '')\n    if base_dir:\n        __create_output_dir(base_dir)\n\n    # Create targets\n    result = []\n    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)\n    env.Depends(r, kw['DOCBOOK_XSL'])\n    result.extend(r)\n    # Add supporting files for cleanup\n    env.Clean(r, [os.path.join(base_dir, 'toc.html')] +\n                 glob.glob(os.path.join(base_dir, 'foil*.html')))\n\n    return result\n\ndef DocbookXInclude(env, target, source, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, for resolving XIncludes in a separate processing step.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Setup builder\n    __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        result.extend(__builder.__call__(env, t, s, **kw))\n\n    return result\n\ndef DocbookXslt(env, target, source=None, *args, **kw):\n    \"\"\"\n    A pseudo-Builder, applying a simple XSL transformation to the input file.\n    \"\"\"\n    # Init list of targets/sources\n    target, source = __extend_targets_sources(target, source)\n\n    # Init XSL stylesheet\n    kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl')\n\n    # Setup builder\n    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)\n\n    # Create targets\n    result = []\n    for t,s in zip(target,source):\n        r = __builder.__call__(env, t, s, **kw)\n        env.Depends(r, kw['DOCBOOK_XSL'])\n        result.extend(r)\n\n    return result\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for docbook to an Environment.\"\"\"\n\n    env.SetDefault(\n        # Default names for customized XSL stylesheets\n        DOCBOOK_DEFAULT_XSL_EPUB = '',\n        DOCBOOK_DEFAULT_XSL_HTML = '',\n        DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '',\n        DOCBOOK_DEFAULT_XSL_HTMLHELP = '',\n        DOCBOOK_DEFAULT_XSL_PDF = '',\n        DOCBOOK_DEFAULT_XSL_MAN = '',\n        DOCBOOK_DEFAULT_XSL_SLIDESPDF = '',\n        DOCBOOK_DEFAULT_XSL_SLIDESHTML = '',\n\n        # Paths to the detected executables\n        DOCBOOK_XSLTPROC = '',\n        DOCBOOK_XMLLINT = '',\n        DOCBOOK_FOP = '',\n\n        # Additional flags for the text processors\n        DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''),\n        DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''),\n\n        # Default command lines for the detected executables\n        DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'],\n        DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'],\n        DOCBOOK_FOPCOM = fop_com['fop'],\n\n        # Screen output for the text processors\n        DOCBOOK_XSLTPROCCOMSTR = None,\n        DOCBOOK_XMLLINTCOMSTR = None,\n        DOCBOOK_FOPCOMSTR = None,\n\n        )\n    _detect(env)\n\n    env.AddMethod(DocbookEpub, \"DocbookEpub\")\n    env.AddMethod(DocbookHtml, \"DocbookHtml\")\n    env.AddMethod(DocbookHtmlChunked, \"DocbookHtmlChunked\")\n    env.AddMethod(DocbookHtmlhelp, \"DocbookHtmlhelp\")\n    env.AddMethod(DocbookPdf, \"DocbookPdf\")\n    env.AddMethod(DocbookMan, \"DocbookMan\")\n    env.AddMethod(DocbookSlidesPdf, \"DocbookSlidesPdf\")\n    env.AddMethod(DocbookSlidesHtml, \"DocbookSlidesHtml\")\n    env.AddMethod(DocbookXInclude, \"DocbookXInclude\")\n    env.AddMethod(DocbookXslt, \"DocbookXslt\")\n\n\ndef exists(env):\n    return 1\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/filesystem.py",
    "content": "\"\"\"SCons.Tool.filesystem\n\nTool-specific initialization for the filesystem tools.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/filesystem.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons\nfrom SCons.Tool.install import copyFunc\n\ncopyToBuilder, copyAsBuilder = None, None\n\ndef copyto_emitter(target, source, env):\n    \"\"\" changes the path of the source to be under the target (which\n    are assumed to be directories.\n    \"\"\"\n    n_target = []\n\n    for t in target:\n        n_target = n_target + [t.File( str( s ) ) for s in source]\n\n    return (n_target, source)\n\ndef copy_action_func(target, source, env):\n    assert( len(target) == len(source) ), \"\\ntarget: %s\\nsource: %s\" %(list(map(str, target)),list(map(str, source)))\n\n    for t, s in zip(target, source):\n        if copyFunc(t.get_path(), s.get_path(), env):\n            return 1\n\n    return 0\n\ndef copy_action_str(target, source, env):\n    return env.subst_target_source(env['COPYSTR'], 0, target, source)\n\ncopy_action = SCons.Action.Action( copy_action_func, copy_action_str )\n\ndef generate(env):\n    try:\n        env['BUILDERS']['CopyTo']\n        env['BUILDERS']['CopyAs']\n    except KeyError as e:\n        global copyToBuilder\n        if copyToBuilder is None:\n            copyToBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Dir,\n                             source_factory = env.fs.Entry,\n                             multi          = 1,\n                             emitter        = [ copyto_emitter, ] )\n\n        global copyAsBuilder\n        if copyAsBuilder is None:\n            copyAsBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Entry,\n                             source_factory = env.fs.Entry )\n\n        env['BUILDERS']['CopyTo'] = copyToBuilder\n        env['BUILDERS']['CopyAs'] = copyAsBuilder\n\n        env['COPYSTR'] = 'Copy file(s): \"$SOURCES\" to \"$TARGETS\"'\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/g++.py",
    "content": "\"\"\"SCons.Tool.g++\n\nTool-specific initialization for g++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/g++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.gxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/gas.py",
    "content": "\"\"\"SCons.Tool.gas\n\nTool-specific initialization for as, the Gnu assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gas.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\ntry:\n    as_module = __import__('as', globals(), locals(), [])\nexcept:\n    as_module = __import__(__package__+'.as', globals(), locals(), ['*'])\n\nassemblers = ['as', 'gas']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/gcc.py",
    "content": "\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for gcc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gcc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import cc\nimport os\nimport re\nimport subprocess\n\nimport SCons.Util\n\ncompilers = ['gcc', 'cc']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n\n    if 'CC' not in env:\n        env['CC'] = env.Detect(compilers) or compilers[0]\n\n    cc.generate(env)\n\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    else:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')\n    # determine compiler version\n    version = detect_version(env, env['CC'])\n    if version:\n        env['CCVERSION'] = version\n\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return detect_version(env, env.Detect(env.get('CC', compilers)))\n\n\ndef detect_version(env, cc):\n    \"\"\"Return the version of the GNU compiler, or None if it is not a GNU compiler.\"\"\"\n    version = None\n    cc = env.subst(cc)\n    if not cc:\n        return version\n\n    # -dumpversion was added in GCC 3.0.  As long as we're supporting\n    # GCC versions older than that, we should use --version and a\n    # regular expression.\n    # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],\n    pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],\n                                 stdin='devnull',\n                                 stderr='devnull',\n                                 stdout=subprocess.PIPE)\n    if pipe.wait() != 0:\n        return version\n\n    with pipe.stdout:\n        # -dumpversion variant:\n        # line = pipe.stdout.read().strip()\n        # --version variant:\n        line = SCons.Util.to_str(pipe.stdout.readline())\n        # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer:\n        # So continue with reading to let the child process actually terminate.\n        while SCons.Util.to_str(pipe.stdout.readline()):\n            pass\n\n    # -dumpversion variant:\n    # if line:\n    #     version = line\n    # --version variant:\n    match = re.search(r'[0-9]+(\\.[0-9]+)+', line)\n    if match:\n        version = match.group(0)\n\n    return version\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/gettext_tool.py",
    "content": "\"\"\"gettext tool\n\"\"\"\n\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/gettext_tool.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n#############################################################################\ndef generate(env,**kw):\n  import sys\n  import os\n  import SCons.Tool\n  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS\n  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\n\n  from SCons.Tool.GettextCommon \\\n    import  _translate, tool_list\n  for t in tool_list(env['PLATFORM'], env):\n    if sys.platform == 'win32':\n        tool = SCons.Tool.find_program_path(env, t, default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n        if tool:\n            tool_bin_dir = os.path.dirname(tool)\n            env.AppendENVPath('PATH', tool_bin_dir)\n        else:\n            SCons.Warnings.Warning(t + ' tool requested, but binary not found in ENV PATH')\n    env.Tool(t)\n  env.AddMethod(_translate, 'Translate')\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  from SCons.Tool.GettextCommon \\\n  import _xgettext_exists, _msginit_exists, \\\n         _msgmerge_exists, _msgfmt_exists\n  try:\n    return _xgettext_exists(env) and _msginit_exists(env) \\\n       and _msgmerge_exists(env) and _msgfmt_exists(env)\n  except:\n    return False\n#############################################################################\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/gnulink.py",
    "content": "\"\"\"SCons.Tool.gnulink\n\nTool-specific initialization for the gnu linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gnulink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\nimport SCons.Tool\nimport os\nimport sys\nimport re\n\nfrom . import link\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    link.generate(env)\n\n    if env['PLATFORM'] == 'hpux':\n        env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared -fPIC')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-Wl,-rpath='\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\n    # OpenBSD doesn't usually use SONAME for libraries\n    use_soname = not sys.platform.startswith('openbsd')\n    link._setup_versioned_lib_variables(env, tool = 'gnulink', use_soname = use_soname)\n    env['LINKCALLBACKS'] = link._versioned_lib_callbacks()\n\n    # For backward-compatibility with older SCons versions\n    env['SHLIBVERSIONFLAGS'] = SCons.Util.CLVar('-Wl,-Bsymbolic')\n    \ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = { 'CXX': ['g++'], 'CC': ['gcc'] }\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env: # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env) # find CXX or CC\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/gxx.py",
    "content": "\"\"\"SCons.Tool.g++\n\nTool-specific initialization for g++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/gxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\nimport re\nimport subprocess\n\nimport SCons.Tool\nimport SCons.Util\n\nfrom . import gcc\nfrom . import cxx\n\ncompilers = ['g++']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    if 'CXX' not in env:\n        env['CXX'] = env.Detect(compilers) or compilers[0]\n\n    cxx.generate(env)\n\n    # platform specific settings\n    if env['PLATFORM'] == 'aix':\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')\n        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n        env['SHOBJSUFFIX'] = '$OBJSUFFIX'\n    elif env['PLATFORM'] == 'hpux':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'sunos':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    # determine compiler version\n    version = gcc.detect_version(env, env['CXX'])\n    if version:\n        env['CXXVERSION'] = version\n\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/hpc++.py",
    "content": "\"\"\"SCons.Tool.hpc++\n\nTool-specific initialization for c++ on HP/UX.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hpc++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.hpcxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/hpcc.py",
    "content": "\"\"\"SCons.Tool.hpcc\n\nTool-specific initialization for HP aCC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hpcc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for aCC & cc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'aCC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS +Z')\n\ndef exists(env):\n    return env.Detect('aCC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/hpcxx.py",
    "content": "\"\"\"SCons.Tool.hpc++\n\nTool-specific initialization for c++ on HP/UX.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hpcxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Util\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\n\nacc = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    cc = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(cc):\n        acc = cc\n        break\n\n        \ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    cplusplus.generate(env)\n\n    if acc:\n        env['CXX']        = acc or 'aCC'\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n        # determine version of aCC\n        with os.popen(acc + ' -V 2>&1') as p:\n            line = p.readline().rstrip()\n        if line.find('aCC: HP ANSI C++') == 0:\n            env['CXXVERSION'] = line.split()[-1]\n\n        if env['PLATFORM'] == 'cygwin':\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n        else:\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n\ndef exists(env):\n    return acc\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/hplink.py",
    "content": "\"\"\"SCons.Tool.hplink\n\nTool-specific initialization for the HP linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/hplink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nfrom . import link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    linker = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n    \n    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,+s -Wl,+vnocompatwarnings')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -b')\n    env['SHLIBSUFFIX'] = '.sl'\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/icc.py",
    "content": "\"\"\"engine.SCons.Tool.icc\n\nTool-specific initialization for the OS/2 icc compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/icc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the OS/2 to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CC']         = 'icc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect('icc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/icl.py",
    "content": "\"\"\"engine.SCons.Tool.icl\n\nTool-specific initialization for the Intel C/C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/icl.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool.intelc\n\n# This has been completely superseded by intelc.py, which can\n# handle both Windows and Linux versions.\n\ndef generate(*args, **kw):\n    \"\"\"Add Builders and construction variables for icl to an Environment.\"\"\"\n    return SCons.Tool.intelc.generate(*args, **kw)\n\ndef exists(*args, **kw):\n    return SCons.Tool.intelc.exists(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/ilink.py",
    "content": "\"\"\"SCons.Tool.ilink\n\nTool-specific initialization for the OS/2 ilink linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ilink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ilink to an Environment.\"\"\"\n    SCons.Tool.createProgBuilder(env)\n    \n    env['LINK']        = 'ilink'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK $LINKFLAGS /O:$TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX']='/LIBPATH:'\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\ndef exists(env):\n    return env.Detect('ilink')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/ilink32.py",
    "content": "\"\"\"SCons.Tool.ilink32\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/ilink32.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Borland ilink to an\n    Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['LINK']        = '$CC'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK -q $LINKFLAGS -e$TARGET $SOURCES $LIBS'\n    env['LIBDIRPREFIX']=''\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n\ndef exists(env):\n    # Uses bcc32 to do linking as it generally knows where the standard\n    # LIBS are and set up the linking correctly\n    return SCons.Tool.bcc32.findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/install.py",
    "content": "\"\"\"SCons.Tool.install\n\nTool-specific initialization for the install tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Tool/install.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport re\nimport shutil\nimport stat\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Util\n\n#\n# We keep track of *all* installed files.\n_INSTALLED_FILES = []\n_UNIQUE_INSTALLED_FILES = None\n\nclass CopytreeError(EnvironmentError):\n    pass\n\n# This is a patched version of shutil.copytree from python 2.5.  It\n# doesn't fail if the dir exists, which regular copytree does\n# (annoyingly).  Note the XXX comment in the docstring.\ndef scons_copytree(src, dst, symlinks=False):\n    \"\"\"Recursively copy a directory tree using copy2().\n\n    The destination directory must not already exist.\n    If exception(s) occur, an CopytreeError is raised with a list of reasons.\n\n    If the optional symlinks flag is true, symbolic links in the\n    source tree result in symbolic links in the destination tree; if\n    it is false, the contents of the files pointed to by symbolic\n    links are copied.\n\n    XXX Consider this example code rather than the ultimate tool.\n\n    \"\"\"\n    names = os.listdir(src)\n    # garyo@genarts.com fix: check for dir before making dirs.\n    if not os.path.exists(dst):\n        os.makedirs(dst)\n    errors = []\n    for name in names:\n        srcname = os.path.join(src, name)\n        dstname = os.path.join(dst, name)\n        try:\n            if symlinks and os.path.islink(srcname):\n                linkto = os.readlink(srcname)\n                os.symlink(linkto, dstname)\n            elif os.path.isdir(srcname):\n                scons_copytree(srcname, dstname, symlinks)\n            else:\n                shutil.copy2(srcname, dstname)\n            # XXX What about devices, sockets etc.?\n        except (IOError, os.error) as why:\n            errors.append((srcname, dstname, str(why)))\n        # catch the CopytreeError from the recursive copytree so that we can\n        # continue with other files\n        except CopytreeError as err:\n            errors.extend(err.args[0])\n    try:\n        shutil.copystat(src, dst)\n    except SCons.Util.WinError:\n        # can't copy file access times on Windows\n        pass\n    except OSError as why:\n        errors.extend((src, dst, str(why)))\n    if errors:\n        raise CopytreeError(errors)\n\n\n#\n# Functions doing the actual work of the Install Builder.\n#\ndef copyFunc(dest, source, env):\n    \"\"\"Install a source file or directory into a destination by copying,\n    (including copying permission/mode bits).\"\"\"\n\n    if os.path.isdir(source):\n        if os.path.exists(dest):\n            if not os.path.isdir(dest):\n                raise SCons.Errors.UserError(\"cannot overwrite non-directory `%s' with a directory `%s'\" % (str(dest), str(source)))\n        else:\n            parent = os.path.split(dest)[0]\n            if not os.path.exists(parent):\n                os.makedirs(parent)\n        scons_copytree(source, dest)\n    else:\n        shutil.copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n    return 0\n\n#\n# Functions doing the actual work of the InstallVersionedLib Builder.\n#\ndef copyFuncVersionedLib(dest, source, env):\n    \"\"\"Install a versioned library into a destination by copying,\n    (including copying permission/mode bits) and then creating\n    required symlinks.\"\"\"\n\n    if os.path.isdir(source):\n        raise SCons.Errors.UserError(\"cannot install directory `%s' as a version library\" % str(source) )\n    else:\n        # remove the link if it is already there\n        try:\n            os.remove(dest)\n        except:\n            pass\n        shutil.copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n        installShlibLinks(dest, source, env)\n\n    return 0\n\ndef listShlibLinksToInstall(dest, source, env):\n    install_links = []\n    source = env.arg2nodes(source)\n    dest = env.fs.File(dest)\n    install_dir = dest.get_dir()\n    for src in source:\n        symlinks = getattr(getattr(src,'attributes',None), 'shliblinks', None)\n        if symlinks:\n            for link, linktgt in symlinks:\n                link_base = os.path.basename(link.get_path())\n                linktgt_base  = os.path.basename(linktgt.get_path())\n                install_link = env.fs.File(link_base, install_dir)\n                install_linktgt = env.fs.File(linktgt_base, install_dir)\n                install_links.append((install_link, install_linktgt))\n    return install_links\n\ndef installShlibLinks(dest, source, env):\n    \"\"\"If we are installing a versioned shared library create the required links.\"\"\"\n    Verbose = False\n    symlinks = listShlibLinksToInstall(dest, source, env)\n    if Verbose:\n        print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks)))\n    if symlinks:\n        SCons.Tool.CreateLibSymlinks(env, symlinks)\n    return\n\ndef installFunc(target, source, env):\n    \"\"\"Install a source file into a target using the function specified\n    as the INSTALL construction variable.\"\"\"\n    try:\n        install = env['INSTALL']\n    except KeyError:\n        raise SCons.Errors.UserError('Missing INSTALL construction variable.')\n\n    assert len(target)==len(source), \\\n           \"Installing source %s into target %s: target and source lists must have same length.\"%(list(map(str, source)), list(map(str, target)))\n    for t,s in zip(target,source):\n        if install(t.get_path(),s.get_path(),env):\n            return 1\n\n    return 0\n\ndef installFuncVersionedLib(target, source, env):\n    \"\"\"Install a versioned library into a target using the function specified\n    as the INSTALLVERSIONEDLIB construction variable.\"\"\"\n    try:\n        install = env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        raise SCons.Errors.UserError('Missing INSTALLVERSIONEDLIB construction variable.')\n\n    assert len(target)==len(source), \\\n           \"Installing source %s into target %s: target and source lists must have same length.\"%(list(map(str, source)), list(map(str, target)))\n    for t,s in zip(target,source):\n        if hasattr(t.attributes, 'shlibname'):\n            tpath = os.path.join(t.get_dir(), t.attributes.shlibname)\n        else:\n            tpath = t.get_path()\n        if install(tpath,s.get_path(),env):\n            return 1\n\n    return 0\n\ndef stringFunc(target, source, env):\n    installstr = env.get('INSTALLSTR')\n    if installstr:\n        return env.subst_target_source(installstr, 0, target, source)\n    target = str(target[0])\n    source = str(source[0])\n    if os.path.isdir(source):\n        type = 'directory'\n    else:\n        type = 'file'\n    return 'Install %s: \"%s\" as \"%s\"' % (type, source, target)\n\n#\n# Emitter functions\n#\ndef add_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" An emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    _INSTALLED_FILES.extend(target)\n\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\ndef add_versioned_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" An emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    Verbose = False\n    _INSTALLED_FILES.extend(target)\n    if Verbose:\n        print(\"add_versioned_targets_to_INSTALLED_FILES: target={:r}\".format(list(map(str, target))))\n    symlinks = listShlibLinksToInstall(target[0], source, env)\n    if symlinks:\n        SCons.Tool.EmitLibSymlinks(env, symlinks, target[0])\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\nclass DESTDIR_factory(object):\n    \"\"\" A node factory, where all files will be relative to the dir supplied\n    in the constructor.\n    \"\"\"\n    def __init__(self, env, dir):\n        self.env = env\n        self.dir = env.arg2nodes( dir, env.fs.Dir )[0]\n\n    def Entry(self, name):\n        name = SCons.Util.make_path_relative(name)\n        return self.dir.Entry(name)\n\n    def Dir(self, name):\n        name = SCons.Util.make_path_relative(name)\n        return self.dir.Dir(name)\n\n#\n# The Builder Definition\n#\ninstall_action       = SCons.Action.Action(installFunc, stringFunc)\ninstallas_action     = SCons.Action.Action(installFunc, stringFunc)\ninstallVerLib_action = SCons.Action.Action(installFuncVersionedLib, stringFunc)\n\nBaseInstallBuilder               = None\n\ndef InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            tgt.extend(BaseInstallBuilder(env, target, src, **kw))\n    return tgt\n\n\ndef InstallAsBuilderWrapper(env, target=None, source=None, **kw):\n    result = []\n    for src, tgt in map(lambda x, y: (x, y), source, target):\n        result.extend(BaseInstallBuilder(env, tgt, src, **kw))\n    return result\n\nBaseVersionedInstallBuilder = None\n\n\ndef InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            tgt.extend(BaseVersionedInstallBuilder(env, target, src, **kw))\n    return tgt\n\nadded = None\n\n\ndef generate(env):\n\n    from SCons.Script import AddOption, GetOption\n    global added\n    if not added:\n        added = 1\n        AddOption('--install-sandbox',\n                  dest='install_sandbox',\n                  type=\"string\",\n                  action=\"store\",\n                  help='A directory under which all installed files will be placed.')\n\n    global BaseInstallBuilder\n    if BaseInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseInstallBuilder = SCons.Builder.Builder(\n                              action         = install_action,\n                              target_factory = target_factory.Entry,\n                              source_factory = env.fs.Entry,\n                              multi          = 1,\n                              emitter        = [ add_targets_to_INSTALLED_FILES, ],\n                              source_scanner = SCons.Scanner.Base( {}, name = 'Install', recursive = False ),\n                              name           = 'InstallBuilder')\n\n    global BaseVersionedInstallBuilder\n    if BaseVersionedInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseVersionedInstallBuilder = SCons.Builder.Builder(\n                                       action         = installVerLib_action,\n                                       target_factory = target_factory.Entry,\n                                       source_factory = env.fs.Entry,\n                                       multi          = 1,\n                                       emitter        = [ add_versioned_targets_to_INSTALLED_FILES, ],\n                                       name           = 'InstallVersionedBuilder')\n\n    env['BUILDERS']['_InternalInstall'] = InstallBuilderWrapper\n    env['BUILDERS']['_InternalInstallAs'] = InstallAsBuilderWrapper\n    env['BUILDERS']['_InternalInstallVersionedLib'] = InstallVersionedBuilderWrapper\n\n    # We'd like to initialize this doing something like the following,\n    # but there isn't yet support for a ${SOURCE.type} expansion that\n    # will print \"file\" or \"directory\" depending on what's being\n    # installed.  For now we punt by not initializing it, and letting\n    # the stringFunc() that we put in the action fall back to the\n    # hand-crafted default string if it's not set.\n    #\n    #try:\n    #    env['INSTALLSTR']\n    #except KeyError:\n    #    env['INSTALLSTR'] = 'Install ${SOURCE.type}: \"$SOURCES\" as \"$TARGETS\"'\n\n    try:\n        env['INSTALL']\n    except KeyError:\n        env['INSTALL']    = copyFunc\n\n    try:\n        env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        env['INSTALLVERSIONEDLIB']    = copyFuncVersionedLib\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/intelc.py",
    "content": "\"\"\"SCons.Tool.icl\n\nTool-specific initialization for the Intel C/C++ compiler.\nSupports Linux and Windows compilers, v7 and up.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nfrom __future__ import division, print_function\n\n__revision__ = \"src/engine/SCons/Tool/intelc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport math, sys, os.path, glob, string, re\n\nis_windows = sys.platform == 'win32'\nis_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or\n                           ('PROCESSOR_ARCHITEW6432' in os.environ and\n                            os.environ['PROCESSOR_ARCHITEW6432'] == 'AMD64'))\nis_linux = sys.platform.startswith('linux')\nis_mac     = sys.platform == 'darwin'\n\nif is_windows:\n    import SCons.Tool.msvc\nelif is_linux:\n    import SCons.Tool.gcc\nelif is_mac:\n    import SCons.Tool.gcc\nimport SCons.Util\nimport SCons.Warnings\n\n# Exceptions for this tool\nclass IntelCError(SCons.Errors.InternalError):\n    pass\nclass MissingRegistryError(IntelCError): # missing registry entry\n    pass\nclass MissingDirError(IntelCError):     # dir not found\n    pass\nclass NoRegistryModuleError(IntelCError): # can't read registry at all\n    pass\n\ndef linux_ver_normalize(vstr):\n    \"\"\"Normalize a Linux compiler version number.\n    Intel changed from \"80\" to \"9.0\" in 2005, so we assume if the number\n    is greater than 60 it's an old-style number and otherwise new-style.\n    Always returns an old-style float like 80 or 90 for compatibility with Windows.\n    Shades of Y2K!\"\"\"\n    # Check for version number like 9.1.026: return 91.026\n    # XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5)\n    m = re.match(r'([0-9]+)\\.([0-9]+)\\.([0-9]+)', vstr)\n    if m:\n        vmaj,vmin,build = m.groups()\n        return float(vmaj) * 10. + float(vmin) + float(build) / 1000.\n    else:\n        f = float(vstr)\n        if is_windows:\n            return f\n        else:\n            if f < 60: return f * 10.0\n            else: return f\n\ndef check_abi(abi):\n    \"\"\"Check for valid ABI (application binary interface) name,\n    and map into canonical one\"\"\"\n    if not abi:\n        return None\n    abi = abi.lower()\n    # valid_abis maps input name to canonical name\n    if is_windows:\n        valid_abis = {'ia32'  : 'ia32',\n                      'x86'   : 'ia32',\n                      'ia64'  : 'ia64',\n                      'em64t' : 'em64t',\n                      'amd64' : 'em64t'}\n    if is_linux:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64',\n                      'amd64'  : 'x86_64'}\n    if is_mac:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64'}\n    try:\n        abi = valid_abis[abi]\n    except KeyError:\n        raise SCons.Errors.UserError(\"Intel compiler: Invalid ABI %s, valid values are %s\"% \\\n              (abi, list(valid_abis.keys())))\n    return abi\n\ndef get_version_from_list(v, vlist):\n    \"\"\"See if we can match v (string) in vlist (list of strings)\n    Linux has to match in a fuzzy way.\"\"\"\n    if is_windows:\n        # Simple case, just find it in the list\n        if v in vlist: return v\n        else: return None\n    else:\n        # Fuzzy match: normalize version number first, but still return\n        # original non-normalized form.\n        fuzz = 0.001\n        for vi in vlist:\n            if math.fabs(linux_ver_normalize(vi) - linux_ver_normalize(v)) < fuzz:\n                return vi\n        # Not found\n        return None\n\ndef get_intel_registry_value(valuename, version=None, abi=None):\n    \"\"\"\n    Return a value from the Intel compiler registry tree. (Windows only)\n    \"\"\"\n    # Open the key:\n    if is_win64:\n        K = 'Software\\\\Wow6432Node\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    else:\n        K = 'Software\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    try:\n        k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n    except SCons.Util.RegError:\n        # For version 13 and later, check UUID subkeys for valuename\n        if is_win64:\n            K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        else:\n            K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            uuid = SCons.Util.RegQueryValueEx(k, 'SubKey')[0]\n\n            if is_win64:\n                K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            else:\n                K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                if abi.upper() == 'EM64T':\n                    abi = 'em64t_native'\n                if is_win64:\n                    K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                else:\n                    K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n        except SCons.Util.RegError:\n            raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n        except SCons.Util.WinError:\n            raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n    # Get the value:\n    try:\n        v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n        return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n    except SCons.Util.RegError:\n        raise MissingRegistryError(\"%s\\\\%s was not found in the registry.\"%(K, valuename))\n\n\ndef get_all_compiler_versions():\n    \"\"\"Returns a sorted list of strings, like \"70\" or \"80\" or \"9.0\"\n    with most recent compiler version first.\n    \"\"\"\n    versions=[]\n    if is_windows:\n        if is_win64:\n            keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Compilers\\\\C++'\n        else:\n            keyname = 'Software\\\\Intel\\\\Compilers\\\\C++'\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                        keyname)\n        except SCons.Util.WinError:\n            # For version 13 or later, check for default instance UUID\n            if is_win64:\n                keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Suites'\n            else:\n                keyname = 'Software\\\\Intel\\\\Suites'\n            try:\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                            keyname)\n            except SCons.Util.WinError:\n                return []\n        i = 0\n        versions = []\n        try:\n            while i < 100:\n                subkey = SCons.Util.RegEnumKey(k, i) # raises SConsEnvironmentError\n                # Check that this refers to an existing dir.\n                # This is not 100% perfect but should catch common\n                # installation issues like when the compiler was installed\n                # and then the install directory deleted or moved (rather\n                # than uninstalling properly), so the registry values\n                # are still there.\n                if subkey == 'Defaults': # Ignore default instances\n                    i = i + 1\n                    continue\n                ok = False\n                for try_abi in ('IA32', 'IA32e',  'IA64', 'EM64T'):\n                    try:\n                        d = get_intel_registry_value('ProductDir', subkey, try_abi)\n                    except MissingRegistryError:\n                        continue  # not found in reg, keep going\n                    if os.path.exists(d): ok = True\n                if ok:\n                    versions.append(subkey)\n                else:\n                    try:\n                        # Registry points to nonexistent dir.  Ignore this\n                        # version.\n                        value = get_intel_registry_value('ProductDir', subkey, 'IA32')\n                    except MissingRegistryError as e:\n\n                        # Registry key is left dangling (potentially\n                        # after uninstalling).\n\n                        print(\"scons: *** Ignoring the registry key for the Intel compiler version %s.\\n\" \\\n                            \"scons: *** It seems that the compiler was uninstalled and that the registry\\n\" \\\n                            \"scons: *** was not cleaned up properly.\\n\" % subkey)\n                    else:\n                        print(\"scons: *** Ignoring \"+str(value))\n\n                i = i + 1\n        except EnvironmentError:\n            # no more subkeys\n            pass\n    elif is_linux or is_mac:\n        for d in glob.glob('/opt/intel_cc_*'):\n            # Typical dir here is /opt/intel_cc_80.\n            m = re.search(r'cc_(.*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/cc*/*'):\n            # Typical dir here is /opt/intel/cc/9.0 for IA32,\n            # /opt/intel/cce/9.0 for EMT64 (AMD64)\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/Compiler/*'):\n            # Typical dir here is /opt/intel/Compiler/11.1\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composerxe-*'):\n            # Typical dir here is /opt/intel/composerxe-2011.4.184\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composer_xe_*'):\n            # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n            # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n            m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(\"%s.%s\"%(m.group(1), m.group(2)))\n        for d in glob.glob('/opt/intel/compilers_and_libraries_*'):\n            # JPA: For the new version of Intel compiler 2016.1.\n            m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(\"%s.%s\"%(m.group(1), m.group(2)))\n\n    def keyfunc(str):\n        \"\"\"Given a dot-separated version string, return a tuple of ints representing it.\"\"\"\n        return [int(x) for x in str.split('.')]\n    # split into ints, sort, then remove dups\n    return sorted(SCons.Util.unique(versions), key=keyfunc, reverse=True)\n\ndef get_intel_compiler_top(version, abi):\n    \"\"\"\n    Return the main path to the top-level dir of the Intel compiler,\n    using the given version.\n    The compiler will be in <top>/bin/icl.exe (icc on linux),\n    the include dir is <top>/include, etc.\n    \"\"\"\n\n    if is_windows:\n        if not SCons.Util.can_read_reg:\n            raise NoRegistryModuleError(\"No Windows registry module was found\")\n        top = get_intel_registry_value('ProductDir', version, abi)\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        # pre-11, icl was in Bin.  11 and later, it's in Bin/<abi> apparently.\n        if not os.path.exists(os.path.join(top, \"Bin\", \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", abi, \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", archdir, \"icl.exe\")):\n            raise MissingDirError(\"Can't find Intel compiler in %s\"%(top))\n    elif is_mac or is_linux:\n        def find_in_2008style_dir(version):\n            # first dir is new (>=9.0) style, second is old (8.0) style.\n            dirs=('/opt/intel/cc/%s', '/opt/intel_cc_%s')\n            if abi == 'x86_64':\n                dirs=('/opt/intel/cce/%s',)  # 'e' stands for 'em64t', aka x86_64 aka amd64\n            top=None\n            for d in dirs:\n                if os.path.exists(os.path.join(d%version, \"bin\", \"icc\")):\n                    top = d%version\n                    break\n            return top\n        def find_in_2010style_dir(version):\n            dirs=('/opt/intel/Compiler/%s/*'%version)\n            # typically /opt/intel/Compiler/11.1/064 (then bin/intel64/icc)\n            dirs=glob.glob(dirs)\n            # find highest sub-version number by reverse sorting and picking first existing one.\n            dirs.sort()\n            dirs.reverse()\n            top=None\n            for d in dirs:\n                if (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                    os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                    top = d\n                    break\n            return top\n        def find_in_2011style_dir(version):\n            # The 2011 (compiler v12) dirs are inconsistent, so just redo the search from\n            # get_all_compiler_versions and look for a match (search the newest form first)\n            top=None\n            for d in glob.glob('/opt/intel/composer_xe_*'):\n                # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n                # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n                m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n                if m:\n                    cur_ver = \"%s.%s\"%(m.group(1), m.group(2))\n                    if cur_ver == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                        top = d\n                        break\n            if not top:\n                for d in glob.glob('/opt/intel/composerxe-*'):\n                    # Typical dir here is /opt/intel/composerxe-2011.4.184\n                    m = re.search(r'([0-9][0-9.]*)$', d)\n                    if m and m.group(1) == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                            top = d\n                            break\n            return top\n        def find_in_2016style_dir(version):\n            # The 2016 (compiler v16) dirs are inconsistent from previous.\n            top = None\n            for d in glob.glob('/opt/intel/compilers_and_libraries_%s/linux'%version):\n                if os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\")):\n                    top = d\n                    break\n            return top\n\n        top = find_in_2016style_dir(version) or find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version)\n        # print \"INTELC: top=\",top\n        if not top:\n            raise MissingDirError(\"Can't find version %s Intel compiler in %s (abi='%s')\"%(version,top, abi))\n    return top\n\n\ndef generate(env, version=None, abi=None, topdir=None, verbose=0):\n    r\"\"\"Add Builders and construction variables for Intel C/C++ compiler\n    to an Environment.\n    args:\n      version: (string) compiler version to use, like \"80\"\n      abi:     (string) 'win32' or whatever Itanium version wants\n      topdir:  (string) compiler top dir, like\n                         \"c:\\Program Files\\Intel\\Compiler70\"\n                        If topdir is used, version and abi are ignored.\n      verbose: (int)    if >0, prints compiler version used.\n    \"\"\"\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return\n\n    if is_windows:\n        SCons.Tool.msvc.generate(env)\n    elif is_linux:\n        SCons.Tool.gcc.generate(env)\n    elif is_mac:\n        SCons.Tool.gcc.generate(env)\n\n    # if version is unspecified, use latest\n    vlist = get_all_compiler_versions()\n    if not version:\n        if vlist:\n            version = vlist[0]\n    else:\n        # User may have specified '90' but we need to get actual dirname '9.0'.\n        # get_version_from_list does that mapping.\n        v = get_version_from_list(version, vlist)\n        if not v:\n            raise SCons.Errors.UserError(\"Invalid Intel compiler version %s: \"%version + \\\n                  \"installed versions are %s\"%(', '.join(vlist)))\n        version = v\n\n    # if abi is unspecified, use ia32\n    # alternatives are ia64 for Itanium, or amd64 or em64t or x86_64 (all synonyms here)\n    abi = check_abi(abi)\n    if abi is None:\n        if is_mac or is_linux:\n            # Check if we are on 64-bit linux, default to 64 then.\n            uname_m = os.uname()[4]\n            if uname_m == 'x86_64':\n                abi = 'x86_64'\n            else:\n                abi = 'ia32'\n        else:\n            if is_win64:\n                abi = 'em64t'\n            else:\n                abi = 'ia32'\n\n    if version and not topdir:\n        try:\n            topdir = get_intel_compiler_top(version, abi)\n        except (SCons.Util.RegError, IntelCError):\n            topdir = None\n\n    if not topdir:\n        # Normally this is an error, but it might not be if the compiler is\n        # on $PATH and the user is importing their env.\n        class ICLTopDirWarning(SCons.Warnings.Warning):\n            pass\n        if (is_mac or is_linux) and not env.Detect('icc') or \\\n           is_windows and not env.Detect('icl'):\n\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(ICLTopDirWarning,\n                                \"Failed to find Intel compiler for version='%s', abi='%s'\"%\n                                (str(version), str(abi)))\n        else:\n            # should be cleaned up to say what this other version is\n            # since in this case we have some other Intel compiler installed\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(ICLTopDirWarning,\n                                \"Can't find Intel compiler top dir for version='%s', abi='%s'\"%\n                                    (str(version), str(abi)))\n\n    if topdir:\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        if os.path.exists(os.path.join(topdir, 'bin', archdir)):\n            bindir=\"bin/%s\"%archdir\n            libdir=\"lib/%s\"%archdir\n        else:\n            bindir=\"bin\"\n            libdir=\"lib\"\n        if verbose:\n            print(\"Intel C compiler: using version %s (%g), abi %s, in '%s/%s'\"%\\\n                  (repr(version), linux_ver_normalize(version),abi,topdir,bindir))\n            if is_linux:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n            if is_mac:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n\n        env['INTEL_C_COMPILER_TOP'] = topdir\n        if is_linux:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p in list(paths.keys()):\n                env.PrependENVPath(p, os.path.join(topdir, paths[p]))\n        if is_mac:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p in list(paths.keys()):\n                env.PrependENVPath(p, os.path.join(topdir, paths[p]))\n        if is_windows:\n            #       env key    reg valname   default subdir of top\n            paths=(('INCLUDE', 'IncludeDir', 'Include'),\n                   ('LIB'    , 'LibDir',     'Lib'),\n                   ('PATH'   , 'BinDir',     'Bin'))\n            # We are supposed to ignore version if topdir is set, so set\n            # it to the emptry string if it's not already set.\n            if version is None:\n                version = ''\n            # Each path has a registry entry, use that or default to subdir\n            for p in paths:\n                try:\n                    path=get_intel_registry_value(p[1], version, abi)\n                    # These paths may have $(ICInstallDir)\n                    # which needs to be substituted with the topdir.\n                    path=path.replace('$(ICInstallDir)', topdir + os.sep)\n                except IntelCError:\n                    # Couldn't get it from registry: use default subdir of topdir\n                    env.PrependENVPath(p[0], os.path.join(topdir, p[2]))\n                else:\n                    env.PrependENVPath(p[0], path.split(os.pathsep))\n                    # print \"ICL %s: %s, final=%s\"%(p[0], path, str(env['ENV'][p[0]]))\n\n    if is_windows:\n        env['CC']        = 'icl'\n        env['CXX']       = 'icl'\n        env['LINK']      = 'xilink'\n    else:\n        env['CC']        = 'icc'\n        env['CXX']       = 'icpc'\n        # Don't reset LINK here;\n        # use smart_link which should already be here from link.py.\n        #env['LINK']      = '$CC'\n        env['AR']        = 'xiar'\n        env['LD']        = 'xild' # not used by default\n\n    # This is not the exact (detailed) compiler version,\n    # just the major version as determined above or specified\n    # by the user.  It is a float like 80 or 90, in normalized form for Linux\n    # (i.e. even for Linux 9.0 compiler, still returns 90 rather than 9.0)\n    if version:\n        env['INTEL_C_COMPILER_VERSION']=linux_ver_normalize(version)\n\n    if is_windows:\n        # Look for license file dir\n        # in system environment, registry, and default location.\n        envlicdir = os.environ.get(\"INTEL_LICENSE_FILE\", '')\n        K = r'SOFTWARE\\Intel\\Licenses'\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            reglicdir = SCons.Util.RegQueryValueEx(k, \"w_cpp\")[0]\n        except (AttributeError, SCons.Util.RegError):\n            reglicdir = \"\"\n        defaultlicdir = r'C:\\Program Files\\Common Files\\Intel\\Licenses'\n\n        licdir = None\n        for ld in [envlicdir, reglicdir]:\n            # If the string contains an '@', then assume it's a network\n            # license (port@system) and good by definition.\n            if ld and (ld.find('@') != -1 or os.path.exists(ld)):\n                licdir = ld\n                break\n        if not licdir:\n            licdir = defaultlicdir\n            if not os.path.exists(licdir):\n                class ICLLicenseDirWarning(SCons.Warnings.Warning):\n                    pass\n                SCons.Warnings.enableWarningClass(ICLLicenseDirWarning)\n                SCons.Warnings.warn(ICLLicenseDirWarning,\n                                    \"Intel license dir was not found.\"\n                                    \"  Tried using the INTEL_LICENSE_FILE environment variable (%s), the registry (%s) and the default path (%s).\"\n                                    \"  Using the default path as a last resort.\"\n                                        % (envlicdir, reglicdir, defaultlicdir))\n        env['ENV']['INTEL_LICENSE_FILE'] = licdir\n\ndef exists(env):\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return 0\n\n    try:\n        versions = get_all_compiler_versions()\n    except (SCons.Util.RegError, IntelCError):\n        versions = None\n    detected = versions is not None and len(versions) > 0\n    if not detected:\n        # try env.Detect, maybe that will work\n        if is_windows:\n            return env.Detect('icl')\n        elif is_linux:\n            return env.Detect('icc')\n        elif is_mac:\n            return env.Detect('icc')\n    return detected\n\n# end of file\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/link.py",
    "content": "\"\"\"SCons.Tool.link\n\nTool-specific initialization for the generic Posix linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Tool/link.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport sys\nimport re\nimport os\n\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\n\n# Nuitka: Avoid ununused tools\n# from SCons.Tool.FortranCommon import isfortran\n# from SCons.Tool.DCommon import isD\ndef isfortran(env, source): return False\ndef isD(env,source): return False\n\nfrom SCons.Tool.cxx import iscplusplus\n\nissued_mixed_link_warning = False\n\n\ndef smart_link(source, target, env, for_signature):\n    has_cplusplus = iscplusplus(source)\n    has_fortran = isfortran(env, source)\n    has_d = isD(env, source)\n    if has_cplusplus and has_fortran and not has_d:\n        global issued_mixed_link_warning\n        if not issued_mixed_link_warning:\n            msg = \"Using $CXX to link Fortran and C++ code together.\\n\\t\" + \\\n                  \"This may generate a buggy executable if the '%s'\\n\\t\" + \\\n                  \"compiler does not know how to deal with Fortran runtimes.\"\n            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,\n                                msg % env.subst('$CXX'))\n            issued_mixed_link_warning = True\n        return '$CXX'\n    elif has_d:\n        env['LINKCOM'] = env['DLINKCOM']\n        env['SHLINKCOM'] = env['SHDLINKCOM']\n        return '$DC'\n    elif has_fortran:\n        return '$FORTRAN'\n    elif has_cplusplus:\n        return '$CXX'\n    return '$CC'\n\n\ndef _lib_emitter(target, source, env, **kw):\n    Verbose = False\n    if Verbose:\n        print(\"_lib_emitter: target[0]={!r}\".format(target[0].get_path()))\n    for tgt in target:\n        if SCons.Util.is_String(tgt):\n            tgt = env.File(tgt)\n        tgt.attributes.shared = 1\n\n    try:\n        symlink_generator = kw['symlink_generator']\n    except KeyError:\n        pass\n    else:\n        if Verbose:\n            print(\"_lib_emitter: symlink_generator={!r}\".format(symlink_generator))\n        symlinks = symlink_generator(env, target[0])\n        if Verbose:\n            print(\"_lib_emitter: symlinks={!r}\".format(symlinks))\n\n        if symlinks:\n            SCons.Tool.EmitLibSymlinks(env, symlinks, target[0])\n            target[0].attributes.shliblinks = symlinks\n    return (target, source)\n\n\ndef shlib_emitter(target, source, env):\n    return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.ShLibSymlinkGenerator)\n\n\ndef ldmod_emitter(target, source, env):\n    return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.LdModSymlinkGenerator)\n\n\n# This is generic enough to be included here...\ndef _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw):\n    \"\"\"For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so'\"\"\"\n    Verbose = False\n\n    if Verbose:\n        print(\"_versioned_lib_name: libnode={!r}\".format(libnode.get_path()))\n        print(\"_versioned_lib_name: version={!r}\".format(version))\n        print(\"_versioned_lib_name: prefix={!r}\".format(prefix))\n        print(\"_versioned_lib_name: suffix={!r}\".format(suffix))\n        print(\"_versioned_lib_name: suffix_generator={!r}\".format(suffix_generator))\n\n    versioned_name = os.path.basename(libnode.get_path())\n    if Verbose:\n        print(\"_versioned_lib_name: versioned_name={!r}\".format(versioned_name))\n\n    versioned_prefix = prefix_generator(env, **kw)\n    versioned_suffix = suffix_generator(env, **kw)\n    if Verbose:\n        print(\"_versioned_lib_name: versioned_prefix={!r}\".format(versioned_prefix))\n        print(\"_versioned_lib_name: versioned_suffix={!r}\".format(versioned_suffix))\n\n    versioned_prefix_re = '^' + re.escape(versioned_prefix)\n    versioned_suffix_re = re.escape(versioned_suffix) + '$'\n    name = re.sub(versioned_prefix_re, prefix, versioned_name)\n    name = re.sub(versioned_suffix_re, suffix, name)\n    if Verbose:\n        print(\"_versioned_lib_name: name={!r}\".format(name))\n    return name\n\n\ndef _versioned_shlib_name(env, libnode, version, prefix, suffix, **kw):\n    prefix_generator = SCons.Tool.ShLibPrefixGenerator\n    suffix_generator = SCons.Tool.ShLibSuffixGenerator\n    return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw)\n\n\ndef _versioned_ldmod_name(env, libnode, version, prefix, suffix, **kw):\n    prefix_generator = SCons.Tool.LdModPrefixGenerator\n    suffix_generator = SCons.Tool.LdModSuffixGenerator\n    return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw)\n\n\ndef _versioned_lib_suffix(env, suffix, version):\n    \"\"\"For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'\"\"\"\n    Verbose = False\n    if Verbose:\n        print(\"_versioned_lib_suffix: suffix={!r}\".format(suffix))\n        print(\"_versioned_lib_suffix: version={!r}\".format(version))\n    if not suffix.endswith(version):\n        suffix = suffix + '.' + version\n    if Verbose:\n        print(\"_versioned_lib_suffix: return suffix={!r}\".format(suffix))\n    return suffix\n\n\ndef _versioned_lib_soname(env, libnode, version, prefix, suffix, name_func):\n    \"\"\"For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so.X'\"\"\"\n    Verbose = False\n    if Verbose:\n        print(\"_versioned_lib_soname: version={!r}\".format(version))\n    name = name_func(env, libnode, version, prefix, suffix)\n    if Verbose:\n        print(\"_versioned_lib_soname: name={!r}\".format(name))\n    major = version.split('.')[0]\n    soname = name + '.' + major\n    if Verbose:\n        print(\"_versioned_lib_soname: soname={!r}\".format(soname))\n    return soname\n\n\ndef _versioned_shlib_soname(env, libnode, version, prefix, suffix):\n    return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_shlib_name)\n\n\ndef _versioned_ldmod_soname(env, libnode, version, prefix, suffix):\n    return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_ldmod_name)\n\n\ndef _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func):\n    \"\"\"Generate link names that should be created for a versioned shared library.\n       Returns a dictionary in the form { linkname : linktarget }\n    \"\"\"\n    Verbose = False\n\n    if Verbose:\n        print(\"_versioned_lib_symlinks: libnode={!r}\".format(libnode.get_path()))\n        print(\"_versioned_lib_symlinks: version={!r}\".format(version))\n\n    if sys.platform.startswith('openbsd'):\n        # OpenBSD uses x.y shared library versioning numbering convention\n        # and doesn't use symlinks to backwards-compatible libraries\n        if Verbose:\n            print(\"_versioned_lib_symlinks: return symlinks={!r}\".format(None))\n        return None\n\n    linkdir = libnode.get_dir()\n    if Verbose:\n        print(\"_versioned_lib_symlinks: linkdir={!r}\".format(linkdir.get_path()))\n\n    name = name_func(env, libnode, version, prefix, suffix)\n    if Verbose:\n        print(\"_versioned_lib_symlinks: name={!r}\".format(name))\n\n    soname = soname_func(env, libnode, version, prefix, suffix)\n    if Verbose:\n        print(\"_versioned_lib_symlinks: soname={!r}\".format(soname))\n\n    link0 = env.fs.File(soname, linkdir)\n    link1 = env.fs.File(name, linkdir)\n\n    # We create direct symlinks, not daisy-chained.\n    if link0 == libnode:\n        # This enables SHLIBVERSION without periods (e.g. SHLIBVERSION=1)\n        symlinks = [(link1, libnode)]\n    else:\n        # This handles usual SHLIBVERSION, i.e. '1.2', '1.2.3', etc.\n        symlinks = [(link0, libnode), (link1, libnode)]\n\n    if Verbose:\n        print(\"_versioned_lib_symlinks: return symlinks={!r}\".format(SCons.Tool.StringizeLibSymlinks(symlinks)))\n\n    return symlinks\n\n\ndef _versioned_shlib_symlinks(env, libnode, version, prefix, suffix):\n    name_func = env['LINKCALLBACKS']['VersionedShLibName']\n    soname_func = env['LINKCALLBACKS']['VersionedShLibSoname']\n\n    return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func)\n\n\ndef _versioned_ldmod_symlinks(env, libnode, version, prefix, suffix):\n    name_func = _versioned_ldmod_name\n    soname_func = _versioned_ldmod_soname\n\n    name_func = env['LINKCALLBACKS']['VersionedLdModName']\n    soname_func = env['LINKCALLBACKS']['VersionedLdModSoname']\n\n    return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func)\n\n\ndef _versioned_lib_callbacks():\n    return {\n        'VersionedShLibSuffix': _versioned_lib_suffix,\n        'VersionedLdModSuffix': _versioned_lib_suffix,\n        'VersionedShLibSymlinks': _versioned_shlib_symlinks,\n        'VersionedLdModSymlinks': _versioned_ldmod_symlinks,\n        'VersionedShLibName': _versioned_shlib_name,\n        'VersionedLdModName': _versioned_ldmod_name,\n        'VersionedShLibSoname': _versioned_shlib_soname,\n        'VersionedLdModSoname': _versioned_ldmod_soname,\n    }.copy()\n\n\ndef _setup_versioned_lib_variables(env, **kw):\n    \"\"\"\n    Setup all variables required by the versioning machinery\n    \"\"\"\n\n    tool = None\n    try:\n        tool = kw['tool']\n    except KeyError:\n        pass\n\n    use_soname = False\n    try:\n        use_soname = kw['use_soname']\n    except KeyError:\n        pass\n\n    # The $_SHLIBVERSIONFLAGS define extra commandline flags used when\n    # building VERSIONED shared libraries. It's always set, but used only\n    # when VERSIONED library is built (see __SHLIBVERSIONFLAGS in SCons/Defaults.py).\n    if use_soname:\n        # If the linker uses SONAME, then we need this little automata\n        if tool == 'sunlink':\n            env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -h $_SHLIBSONAME'\n            env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -h $_LDMODULESONAME'\n        else:\n            env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -Wl,-soname=$_SHLIBSONAME'\n            env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -Wl,-soname=$_LDMODULESONAME'\n        env['_SHLIBSONAME'] = '${ShLibSonameGenerator(__env__,TARGET)}'\n        env['_LDMODULESONAME'] = '${LdModSonameGenerator(__env__,TARGET)}'\n        env['ShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator\n        env['LdModSonameGenerator'] = SCons.Tool.LdModSonameGenerator\n    else:\n        env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'\n        env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS'\n\n    # LDOMDULVERSIONFLAGS should always default to $SHLIBVERSIONFLAGS\n    env['LDMODULEVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SHLINK'] = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    # don't set up the emitter, because AppendUnique will generate a list\n    # starting with None :-(\n    env.Append(SHLIBEMITTER=[shlib_emitter])\n\n    env['SMARTLINK'] = smart_link\n    env['LINK'] = \"$SMARTLINK\"\n    env['LINKFLAGS'] = SCons.Util.CLVar('')\n\n    # __RPATH is only set to something ($_RPATH typically) on platforms that support it.\n    env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX'] = '-L'\n    env['LIBDIRSUFFIX'] = ''\n    env['_LIBFLAGS'] = '${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'\n    env['LIBLINKPREFIX'] = '-l'\n    env['LIBLINKSUFFIX'] = ''\n\n    if env['PLATFORM'] == 'hpux':\n        env['SHLIBSUFFIX'] = '.sl'\n    elif env['PLATFORM'] == 'aix':\n        env['SHLIBSUFFIX'] = '.a'\n\n    # For most platforms, a loadable module is the same as a shared\n    # library.  Platforms which are different can override these, but\n    # setting them the same means that LoadableModule works everywhere.\n    SCons.Tool.createLoadableModuleBuilder(env)\n    env['LDMODULE'] = '$SHLINK'\n    env.Append(LDMODULEEMITTER=[ldmod_emitter])\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n    env[\n        'LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LDMODULEVERSION'] = '$SHLIBVERSION'\n    env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS'\n\n\ndef exists(env):\n    # This module isn't really a Tool on its own, it's common logic for\n    # other linkers.\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/linkloc.py",
    "content": "\"\"\"SCons.Tool.linkloc\n\nTool specification for the LinkLoc linker for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/linkloc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\nimport re\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Tool\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon import msvs_exists, merge_default_version\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\n\n_re_linker_command = re.compile(r'(\\s)@\\s*([^\\s]+)')\n\ndef repl_linker_command(m):\n    # Replaces any linker command file directives (e.g. \"@foo.lnk\") with\n    # the actual contents of the file.\n    try:\n        with open(m.group(2), \"r\") as f:\n            return m.group(1) + f.read()\n    except IOError:\n        # the linker should return an error if it can't\n        # find the linker command file so we will remain quiet.\n        # However, we will replace the @ with a # so we will not continue\n        # to find it with recursive substitution\n        return m.group(1) + '#' + m.group(2)\n\nclass LinklocGenerator(object):\n    def __init__(self, cmdline):\n        self.cmdline = cmdline\n\n    def __call__(self, env, target, source, for_signature):\n        if for_signature:\n            # Expand the contents of any linker command files recursively\n            subs = 1\n            strsub = env.subst(self.cmdline, target=target, source=source)\n            while subs:\n                strsub, subs = _re_linker_command.subn(repl_linker_command, strsub)\n            return strsub\n        else:\n            return \"${TEMPFILE('\" + self.cmdline + \"')}\"\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SUBST_CMD_FILE'] = LinklocGenerator\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS')\n    env['SHLINKCOM']   = '${SUBST_CMD_FILE(\"$SHLINK $SHLINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -dll $TARGET $SOURCES\")}'\n    env['SHLIBEMITTER']= None\n    env['LDMODULEEMITTER']= None\n    env['LINK']        = \"linkloc\"\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '${SUBST_CMD_FILE(\"$LINK $LINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -exe $TARGET $SOURCES\")}'\n    env['LIBDIRPREFIX']='-libpath '\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']='-lib '\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n    # Set-up ms tools paths for default version\n    merge_default_version(env)\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    if msvs_exists():\n        return env.Detect('linkloc')\n    else:\n        return 0\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/m4.py",
    "content": "\"\"\"SCons.Tool.m4\n\nTool-specific initialization for m4.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/m4.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for m4 to an Environment.\"\"\"\n    M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR')\n    bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4')\n\n    env['BUILDERS']['M4'] = bld\n\n    # .m4 files might include other files, and it would be pretty hard\n    # to write a scanner for it, so let's just cd to the dir of the m4\n    # file and run from there.\n    # The src_suffix setup is like so: file.c.m4 -> file.c,\n    # file.cpp.m4 -> file.cpp etc.\n    env['M4']      = 'm4'\n    env['M4FLAGS'] = SCons.Util.CLVar('-E')\n    env['M4COM']   = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}'\n\ndef exists(env):\n    return env.Detect('m4')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/masm.py",
    "content": "\"\"\"SCons.Tool.masm\n\nTool-specific initialization for the Microsoft Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/masm.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for masm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = 'ml'\n    env['ASFLAGS']   = SCons.Util.CLVar('/nologo')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('ml')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mingw.py",
    "content": "\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for MinGW (http://www.mingw.org/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mingw.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\nimport glob\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n# Nuitka: Only use version specific paths if possible.\n# Cygwin and msys2 should be avoided.\nmingw_paths = []\n\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    # Nuitka: Disable implib here, we do it manually.\n    # implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    # if implib: cmd.append('-Wl,--out-implib,' + implib.get_string(for_signature))\n\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if insert_def not in ['', '0', 0] and def_target: \\\n            cmd.append('-Wl,--output-def,' + def_target.get_string(for_signature))\n\n    return [cmd]\n\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\n            \"A shared library should have exactly one target with the suffix: %s Target(s) are:%s\" % \\\n            (env.subst(\"$SHLIBSUFFIX\"), \",\".join([str(t) for t in target])))\n\n    if not no_import_lib and \\\n            not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n        # Create list of target libraries as strings\n        targetStrings = env.ReplaceIxes(dll,\n                                        'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                        'LIBPREFIX', 'LIBSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    # Append a def file target if there isn't already a def file target\n    # or a def file source or the user has explicitly asked for the target\n    # to be emitted.\n    def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    skip_def_insert = env.subst(\"$WINDOWS_INSERT_DEF\") in ['', '0', 0]\n    if not def_source and not def_target and not skip_def_insert:\n        # Create list of target libraries and def files as strings\n        targetStrings = env.ReplaceIxes(dll,\n                                        'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                        'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    return (target, source)\n\n\nshlib_action = SCons.Action.Action(shlib_generator, '$SHLINKCOMSTR', generator=1)\nldmodule_action = SCons.Action.Action(shlib_generator, '$LDMODULECOMSTR', generator=1)\n\nres_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\n\nres_builder = SCons.Builder.Builder(action=res_action, suffix='.o',\n                                    source_scanner=SCons.Tool.SourceFileScanner)\nSCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)\n\n# This is what we search for to find mingw:\n# key_program = 'mingw32-gcc'\nkey_program = 'mingw32-make'\n\n\n# Nuitka: We try to find matching ones only.\ndef find_version_specific_mingw_paths(env):\n    if env[\"TARGET_ARCH\"] == \"x86_64\":\n        new_paths = glob.glob(r'c:\\MinGW64\\mingw64\\bin')\n        new_paths += glob.glob(r'\\MinGW64\\mingw64\\bin')\n    else:\n        new_paths = glob.glob(r'c:\\MinGW64\\mingw64\\bin')\n        new_paths += glob.glob(r'\\MinGW64\\mingw64\\bin')\n\n    # Older versions of MinGW just has this.\n    new_paths += glob.glob(r'c:\\MinGW64\\bin')\n    new_paths += glob.glob(r'\\MinGW64\\bin')\n\n    return new_paths\n\n\ndef generate(env):\n    global mingw_paths\n    # Check for reasoanble mingw default paths\n    mingw_paths += find_version_specific_mingw_paths(env)\n\n    mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)\n    if mingw:\n        mingw_bin_dir = os.path.dirname(mingw)\n        env.AppendENVPath('PATH', mingw_bin_dir)\n\n    # Most of mingw is the same as gcc and friends...\n    # Nuitka: We need less than these:\n    # gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4']\n    gnu_tools = ['gcc', 'g++', 'gnulink']\n    for tool in gnu_tools:\n        SCons.Tool.Tool(tool)(env)\n\n    # ... but a few things differ:\n    env['CC'] = 'gcc'\n    # make sure the msvc tool doesnt break us, it added a /flag\n    if 'CCFLAGS' in env:\n        # make sure its a CLVar to handle list or str cases\n        if type(env['CCFLAGS']) is not SCons.Util.CLVar:\n            env['CCFLAGS'] = SCons.Util.CLVar(env['CCFLAGS'])\n        env['CCFLAGS'] = SCons.Util.CLVar(str(env['CCFLAGS']).replace('/nologo', ''))\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['CXX'] = 'g++'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM'] = shlib_action\n    env['LDMODULECOM'] = ldmodule_action\n    env.Append(SHLIBEMITTER=[shlib_emitter])\n    env.Append(LDMODULEEMITTER=[shlib_emitter])\n    env['AS'] = 'as'\n\n    env['WIN32DEFPREFIX'] = ''\n    env['WIN32DEFSUFFIX'] = '.def'\n    env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'\n    env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'\n\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n    env['RC'] = 'windres'\n    env['RCFLAGS'] = SCons.Util.CLVar('')\n    env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'\n    env['RCINCPREFIX'] = '--include-dir '\n    env['RCINCSUFFIX'] = ''\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'\n    env['BUILDERS']['RES'] = res_builder\n\n    # Some setting from the platform also have to be overridden:\n    env['OBJSUFFIX'] = '.o'\n    env['LIBPREFIX'] = 'lib'\n    env['LIBSUFFIX'] = '.a'\n    env['PROGSUFFIX'] = '.exe'\n\n\ndef exists(env):\n    mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)\n    if mingw:\n        mingw_bin_dir = os.path.dirname(mingw)\n        env.AppendENVPath('PATH', mingw_bin_dir)\n\n    return mingw\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/msgfmt.py",
    "content": "\"\"\" msgfmt tool \"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msgfmt.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom SCons.Builder import BuilderBase\n#############################################################################\nclass _MOFileBuilder(BuilderBase):\n  \"\"\" The builder class for `MO` files.\n  \n  The reason for this builder to exists and its purpose is quite simillar \n  as for `_POFileBuilder`. This time, we extend list of sources, not targets,\n  and call `BuilderBase._execute()` only once (as we assume single-target\n  here).\n  \"\"\"\n\n  def _execute(self, env, target, source, *args, **kw):\n    # Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable\n    # in this case, as it is called too late (after multiple sources\n    # are handled single_source builder.\n    import SCons.Util\n    from SCons.Tool.GettextCommon import _read_linguas_from_files\n    linguas_files = None\n    if 'LINGUAS_FILE' in env and env['LINGUAS_FILE'] is not None:\n      linguas_files = env['LINGUAS_FILE']\n      # This should prevent from endless recursion. \n      env['LINGUAS_FILE'] = None\n      # We read only languages. Suffixes shall be added automatically.\n      linguas = _read_linguas_from_files(env, linguas_files)\n      if SCons.Util.is_List(source):\n        source.extend(linguas)\n      elif source is not None:\n        source = [source] + linguas\n      else:\n        source = linguas\n    result = BuilderBase._execute(self,env,target,source,*args, **kw)\n    if linguas_files is not None:\n      env['LINGUAS_FILE'] = linguas_files\n    return result\n#############################################################################\n\n#############################################################################\ndef _create_mo_file_builder(env, **kw):\n  \"\"\" Create builder object for `MOFiles` builder \"\"\"\n  import SCons.Action\n  # FIXME: What factory use for source? Ours or their?\n  kw['action'] = SCons.Action.Action('$MSGFMTCOM','$MSGFMTCOMSTR')\n  kw['suffix'] = '$MOSUFFIX'\n  kw['src_suffix'] = '$POSUFFIX'\n  kw['src_builder'] = '_POUpdateBuilder'\n  kw['single_source'] = True \n  return _MOFileBuilder(**kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate `msgfmt` tool \"\"\"\n  import sys\n  import os\n  import SCons.Util\n  import SCons.Tool\n  from SCons.Tool.GettextCommon import _detect_msgfmt\n  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS\n  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\n\n  if sys.platform == 'win32':\n      msgfmt = SCons.Tool.find_program_path(env, 'msgfmt', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n      if msgfmt:\n          msgfmt_bin_dir = os.path.dirname(msgfmt)\n          env.AppendENVPath('PATH', msgfmt_bin_dir)\n      else:\n          SCons.Warnings.Warning('msgfmt tool requested, but binary not found in ENV PATH')\n\n  try:\n    env['MSGFMT'] = _detect_msgfmt(env)\n  except:\n    env['MSGFMT'] = 'msgfmt'\n  env.SetDefault(\n    MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],\n    MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',\n    MSGFMTCOMSTR = '',\n    MOSUFFIX = ['.mo'],\n    POSUFFIX = ['.po']\n  )\n  env.Append( BUILDERS = { 'MOFiles'  : _create_mo_file_builder(env) } )\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msgfmt_exists\n  try:\n    return _msgfmt_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/msginit.py",
    "content": "\"\"\" msginit tool \n\nTool specific initialization of msginit tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msginit.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Warnings\nimport SCons.Builder\nimport re\n\n#############################################################################\ndef _optional_no_translator_flag(env):\n  \"\"\" Return '--no-translator' flag if we run *msginit(1)*  in non-interactive\n      mode.\"\"\"\n  import SCons.Util\n  if 'POAUTOINIT' in env:\n    autoinit = env['POAUTOINIT']\n  else:\n    autoinit = False\n  if autoinit:\n    return [SCons.Util.CLVar('--no-translator')]\n  else:\n    return [SCons.Util.CLVar('')]\n#############################################################################\n\n#############################################################################\ndef _POInitBuilder(env, **kw):\n  \"\"\" Create builder object for `POInit` builder. \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _init_po_files, _POFileBuilder\n  action = SCons.Action.Action(_init_po_files, None)\n  return _POFileBuilder(env, action=action, target_alias='$POCREATE_ALIAS')\n#############################################################################\n  \n#############################################################################\nfrom SCons.Environment import _null\n#############################################################################\ndef _POInitBuilderWrapper(env, target=None, source=_null, **kw):\n  \"\"\" Wrapper for _POFileBuilder. We use it to make user's life easier.\n  \n  This wrapper checks for `$POTDOMAIN` construction variable (or override in\n  `**kw`) and treats it appropriatelly. \n  \"\"\"\n  if source is _null:\n    if 'POTDOMAIN' in kw:\n      domain = kw['POTDOMAIN']\n    elif 'POTDOMAIN' in env:\n      domain = env['POTDOMAIN']\n    else:\n      domain = 'messages'\n    source = [ domain ] # NOTE: Suffix shall be appended automatically\n  return env._POInitBuilder(target, source, **kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate the `msginit` tool \"\"\"\n  import sys\n  import os\n  import SCons.Util\n  import SCons.Tool\n  from SCons.Tool.GettextCommon import _detect_msginit\n  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS\n  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\n\n  if sys.platform == 'win32':\n      msginit = SCons.Tool.find_program_path(env, 'msginit', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n      if msginit:\n          msginit_bin_dir = os.path.dirname(msginit)\n          env.AppendENVPath('PATH', msginit_bin_dir)\n      else:\n          SCons.Warnings.Warning('msginit tool requested, but binary not found in ENV PATH')\n\n  try:\n    env['MSGINIT'] = _detect_msginit(env)\n  except:\n    env['MSGINIT'] = 'msginit'\n  msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \\\n             + ' $MSGINITFLAGS -i $SOURCE -o $TARGET'\n  # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded\n  #       (sometimes we really don't need it)\n  env.SetDefault(\n    POSUFFIX = ['.po'],\n    POTSUFFIX = ['.pot'],\n    _MSGINITLOCALE = '${TARGET.filebase}',\n    _MSGNoTranslator = _optional_no_translator_flag,\n    MSGINITCOM = msginitcom,\n    MSGINITCOMSTR = '',\n    MSGINITFLAGS = [ ],\n    POAUTOINIT = False,\n    POCREATE_ALIAS = 'po-create'\n  )\n  env.Append( BUILDERS = { '_POInitBuilder' : _POInitBuilder(env) } )\n  env.AddMethod(_POInitBuilderWrapper, 'POInit')\n  env.AlwaysBuild(env.Alias('$POCREATE_ALIAS'))\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msginit_exists\n  try:\n    return  _msginit_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/msgmerge.py",
    "content": "\"\"\" msgmerget tool \n\nTool specific initialization for `msgmerge` tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/msgmerge.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n#############################################################################\ndef _update_or_init_po_files(target, source, env):\n  \"\"\" Action function for `POUpdate` builder \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _init_po_files\n  for tgt in target:\n    if tgt.rexists():\n      action = SCons.Action.Action('$MSGMERGECOM', '$MSGMERGECOMSTR')\n    else:\n      action = _init_po_files\n    status = action([tgt], source, env)\n    if status : return status\n  return 0\n#############################################################################\n\n#############################################################################\ndef _POUpdateBuilder(env, **kw):\n  \"\"\" Create an object of `POUpdate` builder \"\"\"\n  import SCons.Action\n  from SCons.Tool.GettextCommon import _POFileBuilder\n  action = SCons.Action.Action(_update_or_init_po_files, None)\n  return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS')\n#############################################################################\n\n#############################################################################\nfrom SCons.Environment import _null\n#############################################################################\ndef _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n  \"\"\" Wrapper for `POUpdate` builder - make user's life easier \"\"\"\n  if source is _null:\n    if 'POTDOMAIN' in kw:\n      domain = kw['POTDOMAIN']\n    elif 'POTDOMAIN' in env and env['POTDOMAIN']:\n      domain = env['POTDOMAIN']\n    else:\n      domain = 'messages'\n    source = [ domain ] # NOTE: Suffix shall be appended automatically\n  return env._POUpdateBuilder(target, source, **kw)\n#############################################################################\n\n#############################################################################\ndef generate(env,**kw):\n  \"\"\" Generate the `msgmerge` tool \"\"\"\n  import sys\n  import os\n  import SCons.Tool\n  from SCons.Tool.GettextCommon import _detect_msgmerge\n  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS\n  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\n\n  if sys.platform == 'win32':\n      msgmerge = SCons.Tool.find_program_path(env, 'msgmerge', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n      if msgmerge:\n          msgmerge_bin_dir = os.path.dirname(msgmerge)\n          env.AppendENVPath('PATH', msgmerge_bin_dir)\n      else:\n          SCons.Warnings.Warning('msgmerge tool requested, but binary not found in ENV PATH')\n  try:\n    env['MSGMERGE'] = _detect_msgmerge(env)\n  except:\n    env['MSGMERGE'] = 'msgmerge'\n  env.SetDefault(\n    POTSUFFIX = ['.pot'],\n    POSUFFIX = ['.po'],\n    MSGMERGECOM = '$MSGMERGE  $MSGMERGEFLAGS --update $TARGET $SOURCE',\n    MSGMERGECOMSTR = '',\n    MSGMERGEFLAGS = [ ],\n    POUPDATE_ALIAS = 'po-update'\n  )\n  env.Append(BUILDERS = { '_POUpdateBuilder':_POUpdateBuilder(env) })\n  env.AddMethod(_POUpdateBuilderWrapper, 'POUpdate')\n  env.AlwaysBuild(env.Alias('$POUPDATE_ALIAS'))\n#############################################################################\n\n#############################################################################\ndef exists(env):\n  \"\"\" Check if the tool exists \"\"\"\n  from SCons.Tool.GettextCommon import _msgmerge_exists\n  try:\n    return  _msgmerge_exists(env)\n  except:\n    return False\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mslib.py",
    "content": "\"\"\"SCons.Tool.mslib\n\nTool-specific initialization for lib (MicroSoft library archiver).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mslib.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Tool.msvc\nimport SCons.Util\n\nfrom .MSCommon import msvc_exists, msvc_setup_env_once\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['AR']          = 'lib'\n    env['ARFLAGS']     = SCons.Util.CLVar('/nologo')\n    env['ARCOM']       = \"${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES','$ARCOMSTR')}\"\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mslink.py",
    "content": "\"\"\"SCons.Tool.mslink\n\nTool-specific initialization for the Microsoft linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Tool/mslink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvc\nimport SCons.Tool.msvs\nimport SCons.Util\n\nfrom .MSCommon import msvc_setup_env_once, msvc_exists\n\ndef pdbGenerator(env, target, source, for_signature):\n    try:\n        return ['/PDB:%s' % target[0].attributes.pdb, '/DEBUG']\n    except (AttributeError, IndexError):\n        return None\n\ndef _dllTargets(target, source, env, for_signature, paramtp):\n    listCmd = []\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    if dll: listCmd.append(\"/out:%s\"%dll.get_string(for_signature))\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: listCmd.append(\"/implib:%s\"%implib.get_string(for_signature))\n\n    return listCmd\n\ndef _dllSources(target, source, env, for_signature, paramtp):\n    listCmd = []\n\n    deffile = env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\")\n    for src in source:\n        # Check explicitly for a non-None deffile so that the __cmp__\n        # method of the base SCons.Util.Proxy class used for some Node\n        # proxies doesn't try to use a non-existent __dict__ attribute.\n        if deffile and src == deffile:\n            # Treat this source as a .def file.\n            listCmd.append(\"/def:%s\" % src.get_string(for_signature))\n        else:\n            # Just treat it as a generic source file.\n            listCmd.append(src)\n    return listCmd\n\ndef windowsShlinkTargets(target, source, env, for_signature):\n    return _dllTargets(target, source, env, for_signature, 'SHLIB')\n\ndef windowsShlinkSources(target, source, env, for_signature):\n    return _dllSources(target, source, env, for_signature, 'SHLIB')\n\ndef _windowsLdmodTargets(target, source, env, for_signature):\n    \"\"\"Get targets for loadable modules.\"\"\"\n    return _dllTargets(target, source, env, for_signature, 'LDMODULE')\n\ndef _windowsLdmodSources(target, source, env, for_signature):\n    \"\"\"Get sources for loadable modules.\"\"\"\n    return _dllSources(target, source, env, for_signature, 'LDMODULE')\n\ndef _dllEmitter(target, source, env, paramtp):\n    \"\"\"Common implementation of dll emitter.\"\"\"\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError('A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp))\n\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if insert_def not in ['', '0', 0] and \\\n       not env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"):\n\n        # append a def file to the list of sources\n        extrasources.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that must be installed\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSSHLIBMANIFESTPREFIX\", \"WINDOWSSHLIBMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    if version_num >= 11.0 and env.get('PCH', 0):\n        # MSVC 11 and above need the PCH object file to be added to the link line,\n        # otherwise you get link error LNK2011.\n        pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'\n        # print \"prog_emitter, version %s, appending pchobj %s\"%(version_num, pchobj)\n        if pchobj not in extrasources:\n            extrasources.append(pchobj)\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, \"LIBPREFIX\", \"LIBSUFFIX\"):\n        # Append an import library to the list of targets.\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"LIBPREFIX\", \"LIBSUFFIX\"))\n        # and .exp file is created if there are exports from a DLL\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSEXPPREFIX\", \"WINDOWSEXPSUFFIX\"))\n\n    return (target+extratargets, source+extrasources)\n\ndef windowsLibEmitter(target, source, env):\n    return _dllEmitter(target, source, env, 'SHLIB')\n\ndef ldmodEmitter(target, source, env):\n    \"\"\"Emitter for loadable modules.\n\n    Loadable modules are identical to shared libraries on Windows, but building\n    them is subject to different parameters (LDMODULE*).\n    \"\"\"\n    return _dllEmitter(target, source, env, 'LDMODULE')\n\ndef prog_emitter(target, source, env):\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    exe = env.FindIxes(target, \"PROGPREFIX\", \"PROGSUFFIX\")\n    if not exe:\n        raise SCons.Errors.UserError(\"An executable should have exactly one target with the suffix: %s\" % env.subst(\"$PROGSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that have to be installed\n        extratargets.append(\n            env.ReplaceIxes(exe,\n                            \"PROGPREFIX\", \"PROGSUFFIX\",\n                            \"WINDOWSPROGMANIFESTPREFIX\", \"WINDOWSPROGMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    if version_num >= 11.0 and env.get('PCH', 0):\n        # MSVC 11 and above need the PCH object file to be added to the link line,\n        # otherwise you get link error LNK2011.\n        pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'\n        # print(\"prog_emitter, version %s, appending pchobj %s\"%(version_num, pchobj))\n        if pchobj not in extrasources:\n            extrasources.append(pchobj)\n\n    return (target+extratargets,source+extrasources)\n\ndef RegServerFunc(target, source, env):\n    if 'register' in env and env['register']:\n        ret = regServerAction([target[0]], [source[0]], env)\n        if ret:\n            raise SCons.Errors.UserError(\"Unable to register %s\" % target[0])\n        else:\n            print(\"Registered %s sucessfully\" % target[0])\n        return ret\n    return 0\n\n# These are the actual actions run to embed the manifest.\n# They are only called from the Check versions below.\nembedManifestExeAction = SCons.Action.Action('$MTEXECOM')\nembedManifestDllAction = SCons.Action.Action('$MTSHLIBCOM')\n\ndef embedManifestDllCheck(target, source, env):\n    \"\"\"Function run by embedManifestDllCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestDllAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].get_abspath() + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = (embedManifestDllAction) ([target[0]],None,env)\n            if ret:\n                raise SCons.Errors.UserError(\"Unable to embed manifest into %s\" % (target[0]))\n            return ret\n        else:\n            print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))\n    return 0\n\ndef embedManifestExeCheck(target, source, env):\n    \"\"\"Function run by embedManifestExeCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestExeAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].get_abspath() + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = (embedManifestExeAction) ([target[0]],None,env)\n            if ret:\n                raise SCons.Errors.UserError(\"Unable to embed manifest into %s\" % (target[0]))\n            return ret\n        else:\n            print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))\n    return 0\n\nembedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None)\nembedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)\n\nregServerAction = SCons.Action.Action(\"$REGSVRCOM\", \"$REGSVRCOMSTR\")\nregServerCheck = SCons.Action.Action(RegServerFunc, None)\nshlibLinkAction = SCons.Action.Action('${TEMPFILE(\"$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES\", \"$SHLINKCOMSTR\")}', '$SHLINKCOMSTR')\ncompositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction\nldmodLinkAction = SCons.Action.Action('${TEMPFILE(\"$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES\", \"$LDMODULECOMSTR\")}', '$LDMODULECOMSTR')\ncompositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction\nexeLinkAction = SCons.Action.Action('${TEMPFILE(\"$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows\", \"$LINKCOMSTR\")}', '$LINKCOMSTR')\ncompositeLinkAction = exeLinkAction + embedManifestExeCheckAction\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')\n    env['_SHLINK_TARGETS'] = windowsShlinkTargets\n    env['_SHLINK_SOURCES'] = windowsShlinkSources\n    env['SHLINKCOM']   =  compositeShLinkAction\n    env.Append(SHLIBEMITTER = [windowsLibEmitter])\n    env.Append(LDMODULEEMITTER = [windowsLibEmitter])\n    env['LINK']        = 'link'\n    env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')\n    env['_PDB'] = pdbGenerator\n    env['LINKCOM'] = compositeLinkAction\n    env.Append(PROGEMITTER = [prog_emitter])\n    env['LIBDIRPREFIX']='/LIBPATH:'\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n    env['WIN32DEFPREFIX']        = ''\n    env['WIN32DEFSUFFIX']        = '.def'\n    env['WIN32_INSERT_DEF']      = 0\n    env['WINDOWSDEFPREFIX']      = '${WIN32DEFPREFIX}'\n    env['WINDOWSDEFSUFFIX']      = '${WIN32DEFSUFFIX}'\n    env['WINDOWS_INSERT_DEF']    = '${WIN32_INSERT_DEF}'\n\n    env['WIN32EXPPREFIX']        = ''\n    env['WIN32EXPSUFFIX']        = '.exp'\n    env['WINDOWSEXPPREFIX']      = '${WIN32EXPPREFIX}'\n    env['WINDOWSEXPSUFFIX']      = '${WIN32EXPSUFFIX}'\n\n    env['WINDOWSSHLIBMANIFESTPREFIX'] = ''\n    env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest'\n    env['WINDOWSPROGMANIFESTPREFIX']  = ''\n    env['WINDOWSPROGMANIFESTSUFFIX']  = '${PROGSUFFIX}.manifest'\n\n    env['REGSVRACTION'] = regServerCheck\n    env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')\n    env['REGSVRFLAGS'] = '/s '\n    env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'\n\n    env['WINDOWS_EMBED_MANIFEST'] = 0\n    env['MT'] = 'mt'\n    #env['MTFLAGS'] = ['-hashupdate']\n    env['MTFLAGS'] = SCons.Util.CLVar('/nologo')\n    # Note: use - here to prevent build failure if no manifest produced.\n    # This seems much simpler than a fancy system using a function action to see\n    # if the manifest actually exists before trying to run mt with it.\n    env['MTEXECOM']   = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1'\n    env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2'\n    # TODO Future work garyo 27-Feb-11\n    env['_MANIFEST_SOURCES'] = None # _windowsManifestSources\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n\n    # Loadable modules are on Windows the same as shared libraries, but they\n    # are subject to different build parameters (LDMODULE* variables).\n    # Therefore LDMODULE* variables correspond as much as possible to\n    # SHLINK*/SHLIB* ones.\n    SCons.Tool.createLoadableModuleBuilder(env)\n    env['LDMODULE'] = '$SHLINK'\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n    env['_LDMODULE_TARGETS'] = _windowsLdmodTargets\n    env['_LDMODULE_SOURCES'] = _windowsLdmodSources\n    env['LDMODULEEMITTER'] = [ldmodEmitter]\n    env['LDMODULECOM'] = compositeLdmodAction\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mssdk.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mssdk.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\"\"\"engine.SCons.Tool.mssdk\n\nTool-specific initialization for Microsoft SDKs, both Platform\nSDKs and Windows SDKs.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nfrom .MSCommon import mssdk_exists, \\\n                     mssdk_setup_env\n\ndef generate(env):\n    \"\"\"Add construction variables for an MS SDK to an Environment.\"\"\"\n    mssdk_setup_env(env)\n\ndef exists(env):\n    return mssdk_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/msvc.py",
    "content": "\"\"\"engine.SCons.Tool.msvc\n\nTool-specific initialization for Microsoft Visual C/C++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/msvc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\nimport os\nimport re\nimport sys\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Scanner.RC\n\nfrom .MSCommon import msvc_exists, msvc_setup_env_once, msvc_version_to_maj_min\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\ndef validate_vars(env):\n    \"\"\"Validate the PCH and PCHSTOP construction variables.\"\"\"\n    if 'PCH' in env and env['PCH']:\n        if 'PCHSTOP' not in env:\n            raise SCons.Errors.UserError(\"The PCHSTOP construction must be defined if PCH is defined.\")\n        if not SCons.Util.is_String(env['PCHSTOP']):\n            raise SCons.Errors.UserError(\"The PCHSTOP construction variable must be a string: %r\"%env['PCHSTOP'])\n\ndef msvc_set_PCHPDBFLAGS(env):\n    \"\"\"\n    Set appropriate PCHPDBFLAGS for the MSVC version being used.\n    \"\"\"\n    if env.get('MSVC_VERSION',False):\n        maj, min = msvc_version_to_maj_min(env['MSVC_VERSION'])\n        if maj < 8:\n            env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Yd\") or \"\"}'])\n        else:\n            env['PCHPDBFLAGS'] = ''\n    else:\n        # Default if we can't determine which version of MSVC we're using\n        env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Yd\") or \"\"}'])\n\n\ndef pch_emitter(target, source, env):\n    \"\"\"Adds the object file target.\"\"\"\n\n    validate_vars(env)\n\n    pch = None\n    obj = None\n\n    for t in target:\n        if SCons.Util.splitext(str(t))[1] == '.pch':\n            pch = t\n        if SCons.Util.splitext(str(t))[1] == '.obj':\n            obj = t\n\n    if not obj:\n        obj = SCons.Util.splitext(str(pch))[0]+'.obj'\n\n    target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work\n\n    return (target, source)\n\ndef object_emitter(target, source, env, parent_emitter):\n    \"\"\"Sets up the PCH dependencies for an object file.\"\"\"\n\n    validate_vars(env)\n\n    parent_emitter(target, source, env)\n\n    # Add a dependency, but only if the target (e.g. 'Source1.obj')\n    # doesn't correspond to the pre-compiled header ('Source1.pch').\n    # If the basenames match, then this was most likely caused by\n    # someone adding the source file to both the env.PCH() and the\n    # env.Program() calls, and adding the explicit dependency would\n    # cause a cycle on the .pch file itself.\n    #\n    # See issue #2505 for a discussion of what to do if it turns\n    # out this assumption causes trouble in the wild:\n    # https://github.com/SCons/scons/issues/2505\n    if 'PCH' in env:\n        pch = env['PCH']\n        if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':\n            env.Depends(target, pch)\n\n    return (target, source)\n\ndef static_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.StaticObjectEmitter)\n\ndef shared_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.SharedObjectEmitter)\n\npch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')\npch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',\n                                    emitter=pch_emitter,\n                                    source_scanner=SCons.Tool.SourceFileScanner)\n\n\n# Logic to build .rc files into .res files (resource files)\nres_scanner = SCons.Scanner.RC.RCScan()\nres_action  = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\nres_builder = SCons.Builder.Builder(action=res_action,\n                                    src_suffix='.rc',\n                                    suffix='.res',\n                                    src_builder=[],\n                                    source_scanner=res_scanner)\n\ndef msvc_batch_key(action, env, target, source):\n    \"\"\"\n    Returns a key to identify unique batches of sources for compilation.\n\n    If batching is enabled (via the $MSVC_BATCH setting), then all\n    target+source pairs that use the same action, defined by the same\n    environment, and have the same target and source directories, will\n    be batched.\n\n    Returning None specifies that the specified target+source should not\n    be batched with other compilations.\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better.\n    # Note we need to do the env.subst so $MSVC_BATCH can be a reference to\n    # another construction variable, which is why we test for False and 0\n    # as strings.\n    if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        # We're not using batching; return no key.\n        return None\n    t = target[0]\n    s = source[0]\n    if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]:\n        # The base names are different, so this *must* be compiled\n        # separately; return no key.\n        return None\n    return (id(action), id(env), t.dir, s.dir)\n\ndef msvc_output_flag(target, source, env, for_signature):\n    \"\"\"\n    Returns the correct /Fo flag for batching.\n\n    If batching is disabled or there's only one source file, then we\n    return an /Fo string that specifies the target explicitly.  Otherwise,\n    we return an /Fo string that just specifies the first target's\n    directory (where the Visual C/C++ compiler will put the .obj files).\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better. Removed\n    # len(source)==1 as batch mode can compile only one file\n    # (and it also fixed problem with compiling only one changed file\n    # with batch mode enabled)\n    if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        return '/Fo$TARGET'\n    else:\n        # The Visual C/C++ compiler requires a \\ at the end of the /Fo\n        # option to indicate an output directory.  We use os.sep here so\n        # that the test(s) for this can be run on non-Windows systems\n        # without having a hard-coded backslash mess up command-line\n        # argument parsing.\n        # Adding double os.sep's as if the TARGET.dir has a space or otherwise\n        # needs to be quoted they are needed per MSVC's odd behavior\n        # See: https://github.com/SCons/scons/issues/3106\n        return '/Fo${TARGET.dir}' + os.sep*2\n\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\",\n                              batch_key=msvc_batch_key,\n                              targets='$CHANGED_TARGETS')\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\",\n                                  batch_key=msvc_batch_key,\n                                  targets='$CHANGED_TARGETS')\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MSVC++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    # TODO(batch):  shouldn't reach in to cmdgen this way; necessary\n    # for now to bypass the checks in Builder.DictCmdGenerator.__call__()\n    # and allow .cc and .cpp to be compiled in the same command line.\n    static_obj.cmdgen.source_ext_match = False\n    shared_obj.cmdgen.source_ext_match = False\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, CAction)\n        shared_obj.add_action(suffix, ShCAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, CXXAction)\n        shared_obj.add_action(suffix, ShCXXAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Z7\") or \"\"}'])\n    env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and \"/Yu%s \\\\\\\"/Fp%s\\\\\\\"\"%(PCHSTOP or \"\",File(PCH))) or \"\"}'])\n    env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag\n    env['_CCCOMCOM']  = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'\n    env['CC']         = 'cl'\n    env['CCFLAGS']    = SCons.Util.CLVar('/nologo')\n    env['CFLAGS']     = SCons.Util.CLVar('')\n    env['CCCOM']      = '${TEMPFILE(\"$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM\",\"$CCCOMSTR\")}'\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']    = '${TEMPFILE(\"$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM\",\"$SHCCCOMSTR\")}'\n    env['CXX']        = '$CC'\n    env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')\n    env['CXXCOM']     = '${TEMPFILE(\"$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM\",\"$CXXCOMSTR\")}'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '${TEMPFILE(\"$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM\",\"$SHCXXCOMSTR\")}'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n#    env.Append(OBJEMITTER = [static_object_emitter])\n#    env.Append(SHOBJEMITTER = [shared_object_emitter])\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\n    env['RC'] = 'rc'\n    env['RCFLAGS'] = SCons.Util.CLVar('/nologo')\n    env['RCSUFFIXES']=['.rc','.rc2']\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'\n    env['BUILDERS']['RES'] = res_builder\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n\n    # MSVC probably wont support unistd.h so default\n    # without it for lex generation\n    env[\"LEXUNISTD\"] = SCons.Util.CLVar(\"--nounistd\")\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\n    msvc_set_PCHPDBFLAGS(env)\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\n\n    env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'\n    env['BUILDERS']['PCH'] = pch_builder\n\n    if 'ENV' not in env:\n        env['ENV'] = {}\n    if 'SystemRoot' not in env['ENV']:    # required for dlls in the winsxs folders\n        env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/msvs.py",
    "content": "\"\"\"SCons.Tool.msvs\n\nTool-specific initialization for Microsoft Visual Studio project files.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom __future__ import print_function\n\n__revision__ = \"src/engine/SCons/Tool/msvs.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.compat\n\nimport base64\nimport hashlib\nimport ntpath\nimport os\nimport pickle\nimport re\nimport sys\n\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Platform.win32\nimport SCons.Script.SConscript\nimport SCons.PathList\nimport SCons.Util\nimport SCons.Warnings\n\nfrom .MSCommon import msvc_exists, msvc_setup_env_once\nfrom SCons.Defaults import processDefines\nfrom SCons.compat import PICKLE_PROTOCOL\n\n##############################################################################\n# Below here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef xmlify(s):\n    s = s.replace(\"&\", \"&amp;\") # do this first\n    s = s.replace(\"'\", \"&apos;\")\n    s = s.replace('\"', \"&quot;\")\n    s = s.replace('<', \"&lt;\")\n    s = s.replace('>', \"&gt;\")\n    s = s.replace('\\n', '&#x0A;')\n    return s\n\ndef processIncludes(includes, env, target, source):\n    \"\"\"\n    Process a CPPPATH list in includes, given the env, target and source.\n    Returns a list of directory paths. These paths are absolute so we avoid\n    putting pound-prefixed paths in a Visual Studio project file.\n    \"\"\"\n    return [env.Dir(i).abspath for i in\n            SCons.PathList.PathList(includes).subst_path(env, target, source)]\n\n\nexternal_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'\n\ndef _generateGUID(slnfile, name):\n    \"\"\"This generates a dummy GUID for the sln file to use.  It is\n    based on the MD5 signatures of the sln filename plus the name of\n    the project.  It basically just needs to be unique, and not\n    change with each invocation.\"\"\"\n    m = hashlib.md5()\n    # Normalize the slnfile path to a Windows path (\\ separators) so\n    # the generated file has a consistent GUID even if we generate\n    # it on a non-Windows platform.\n    m.update(bytearray(ntpath.normpath(str(slnfile)) + str(name),'utf-8'))\n    solution = m.hexdigest().upper()\n    # convert most of the signature to GUID form (discard the rest)\n    solution = \"{\" + solution[:8] + \"-\" + solution[8:12] + \"-\" + solution[12:16] + \"-\" + solution[16:20] + \"-\" + solution[20:32] + \"}\"\n    return solution\n\nversion_re = re.compile(r'(\\d+\\.\\d+)(.*)')\n\ndef msvs_parse_version(s):\n    \"\"\"\n    Split a Visual Studio version, which may in fact be something like\n    '7.0Exp', into is version number (returned as a float) and trailing\n    \"suite\" portion.\n    \"\"\"\n    num, suite = version_re.match(s).groups()\n    return float(num), suite\n\n# This is how we re-invoke SCons from inside MSVS Project files.\n# The problem is that we might have been invoked as either scons.bat\n# or scons.py.  If we were invoked directly as scons.py, then we could\n# use sys.argv[0] to find the SCons \"executable,\" but that doesn't work\n# if we were invoked as scons.bat, which uses \"python -c\" to execute\n# things and ends up with \"-c\" as sys.argv[0].  Consequently, we have\n# the MSVS Project file invoke SCons the same way that scons.bat does,\n# which works regardless of how we were invoked.\ndef getExecScriptMain(env, xml=None):\n    scons_home = env.get('SCONS_HOME')\n    if not scons_home and 'SCONS_LIB_DIR' in os.environ:\n        scons_home = os.environ['SCONS_LIB_DIR']\n    if scons_home:\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()\" % scons_home\n    else:\n        version = SCons.__version__\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()\" % locals()\n    if xml:\n        exec_script_main = xmlify(exec_script_main)\n    return exec_script_main\n\n# The string for the Python executable we tell the Project file to use\n# is either sys.executable or, if an external PYTHON_ROOT environment\n# variable exists, $(PYTHON)ROOT\\\\python.exe (generalized a little to\n# pluck the actual executable name from sys.executable).\ntry:\n    python_root = os.environ['PYTHON_ROOT']\nexcept KeyError:\n    python_executable = sys.executable\nelse:\n    python_executable = os.path.join('$$(PYTHON_ROOT)',\n                                     os.path.split(sys.executable)[1])\n\nclass Config(object):\n    pass\n\ndef splitFully(path):\n    dir, base = os.path.split(path)\n    if dir and dir != '' and dir != path:\n        return splitFully(dir)+[base]\n    if base == '':\n        return []\n    return [base]\n\ndef makeHierarchy(sources):\n    \"\"\"Break a list of files into a hierarchy; for each value, if it is a string,\n       then it is a file.  If it is a dictionary, it is a folder.  The string is\n       the original path of the file.\"\"\"\n\n    hierarchy = {}\n    for file in sources:\n        path = splitFully(file)\n        if len(path):\n            dict = hierarchy\n            for part in path[:-1]:\n                if part not in dict:\n                    dict[part] = {}\n                dict = dict[part]\n            dict[path[-1]] = file\n        #else:\n        #    print 'Warning: failed to decompose path for '+str(file)\n    return hierarchy\n\nclass _UserGenerator(object):\n    '''\n    Base class for .dsp.user file generator\n    '''\n    # Default instance values.\n    # Ok ... a bit defensive, but it does not seem reasonable to crash the\n    # build for a workspace user file. :-)\n    usrhead = None\n    usrdebg = None\n    usrconf = None\n    createfile = False\n    def __init__(self, dspfile, source, env):\n        # DebugSettings should be a list of debug dictionary sorted in the same order\n        # as the target list and variants\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVSProject.\")\n        elif SCons.Util.is_String(env['variant']):\n            variants = [env['variant']]\n        elif SCons.Util.is_List(env['variant']):\n            variants = env['variant']\n\n        if 'DebugSettings' not in env or env['DebugSettings'] is None:\n            dbg_settings = []\n        elif SCons.Util.is_Dict(env['DebugSettings']):\n            dbg_settings = [env['DebugSettings']]\n        elif SCons.Util.is_List(env['DebugSettings']):\n            if len(env['DebugSettings']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'DebugSettings' and 'variant' lists must be the same.\")\n            dbg_settings = []\n            for ds in env['DebugSettings']:\n                if SCons.Util.is_Dict(ds):\n                    dbg_settings.append(ds)\n                else:\n                    dbg_settings.append({})\n        else:\n            dbg_settings = []\n\n        if len(dbg_settings) == 1:\n            dbg_settings = dbg_settings * len(variants)\n\n        self.createfile = self.usrhead and self.usrdebg and self.usrconf and \\\n                            dbg_settings and bool([ds for ds in dbg_settings if ds])\n\n        if self.createfile:\n            dbg_settings = dict(list(zip(variants, dbg_settings)))\n            for var, src in dbg_settings.items():\n                # Update only expected keys\n                trg = {}\n                for key in [k for k in list(self.usrdebg.keys()) if k in src]:\n                    trg[key] = str(src[key])\n                self.configs[var].debug = trg\n\n    def UserHeader(self):\n        encoding = self.env.subst('$MSVSENCODING')\n        versionstr = self.versionstr\n        self.usrfile.write(self.usrhead % locals())\n\n    def UserProject(self):\n        pass\n\n    def Build(self):\n        if not self.createfile:\n            return\n        try:\n            filename = self.dspabs +'.user'\n            self.usrfile = open(filename, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + filename + '\" for writing:' + str(detail))\n        else:\n            self.UserHeader()\n            self.UserProject()\n            self.usrfile.close()\n\nV9UserHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioUserFile\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tShowAllFiles=\"false\"\n\\t>\n\\t<Configurations>\n\"\"\"\n\nV9UserConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\t>\n\\t\\t\\t<DebugSettings\n%(debug_settings)s\n\\t\\t\\t/>\n\\t\\t</Configuration>\n\"\"\"\n\nV9DebugSettings = {\n'Command':'$(TargetPath)',\n'WorkingDirectory': None,\n'CommandArguments': None,\n'Attach':'false',\n'DebuggerType':'3',\n'Remote':'1',\n'RemoteMachine': None,\n'RemoteCommand': None,\n'HttpUrl': None,\n'PDBPath': None,\n'SQLDebugging': None,\n'Environment': None,\n'EnvironmentMerge':'true',\n'DebuggerFlavor': None,\n'MPIRunCommand': None,\n'MPIRunArguments': None,\n'MPIRunWorkingDirectory': None,\n'ApplicationCommand': None,\n'ApplicationArguments': None,\n'ShimCommand': None,\n'MPIAcceptMode': None,\n'MPIAcceptFilter': None,\n}\n\nclass _GenerateV7User(_UserGenerator):\n    \"\"\"Generates a Project file for MSVS .NET\"\"\"\n    def __init__(self, dspfile, source, env):\n        if self.version_num >= 9.0:\n            self.usrhead = V9UserHeader\n            self.usrconf = V9UserConfiguration\n            self.usrdebg = V9DebugSettings\n        _UserGenerator.__init__(self, dspfile, source, env)\n\n    def UserProject(self):\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            debug = self.configs[kind].debug\n            if debug:\n                debug_settings = '\\n'.join(['\\t\\t\\t\\t%s=\"%s\"' % (key, xmlify(value))\n                                            for key, value in debug.items()\n                                            if value is not None])\n                self.usrfile.write(self.usrconf % locals())\n        self.usrfile.write('\\t</Configurations>\\n</VisualStudioUserFile>')\n\nV10UserHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project ToolsVersion=\"%(versionstr)s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nV10UserConfiguration = \"\"\"\\\n\\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">\n%(debug_settings)s\n\\t</PropertyGroup>\n\"\"\"\n\nV10DebugSettings = {\n'LocalDebuggerCommand': None,\n'LocalDebuggerCommandArguments': None,\n'LocalDebuggerEnvironment': None,\n'DebuggerFlavor': 'WindowsLocalDebugger',\n'LocalDebuggerWorkingDirectory': None,\n'LocalDebuggerAttach': None,\n'LocalDebuggerDebuggerType': None,\n'LocalDebuggerMergeEnvironment': None,\n'LocalDebuggerSQLDebugging': None,\n'RemoteDebuggerCommand': None,\n'RemoteDebuggerCommandArguments': None,\n'RemoteDebuggerWorkingDirectory': None,\n'RemoteDebuggerServerName': None,\n'RemoteDebuggerConnection': None,\n'RemoteDebuggerDebuggerType': None,\n'RemoteDebuggerAttach': None,\n'RemoteDebuggerSQLDebugging': None,\n'DeploymentDirectory': None,\n'AdditionalFiles': None,\n'RemoteDebuggerDeployDebugCppRuntime': None,\n'WebBrowserDebuggerHttpUrl': None,\n'WebBrowserDebuggerDebuggerType': None,\n'WebServiceDebuggerHttpUrl': None,\n'WebServiceDebuggerDebuggerType': None,\n'WebServiceDebuggerSQLDebugging': None,\n}\n\nclass _GenerateV10User(_UserGenerator):\n    \"\"\"Generates a Project'user file for MSVS 2010 or later\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n        if version_num >= 14.2:\n            # Visual Studio 2019 is considered to be version 16.\n            self.versionstr = '16.0'\n        elif version_num >= 14.1:\n            # Visual Studio 2017 is considered to be version 15.\n            self.versionstr = '15.0'\n        elif version_num == 14.0:\n            self.versionstr = '14.0'\n        else:\n            self.versionstr = '4.0'\n        self.usrhead = V10UserHeader\n        self.usrconf = V10UserConfiguration\n        self.usrdebg = V10DebugSettings\n        _UserGenerator.__init__(self, dspfile, source, env)\n\n    def UserProject(self):\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            debug = self.configs[kind].debug\n            if debug:\n                debug_settings = '\\n'.join(['\\t\\t<%s>%s</%s>' % (key, xmlify(value), key)\n                                            for key, value in debug.items()\n                                            if value is not None])\n                self.usrfile.write(self.usrconf % locals())\n        self.usrfile.write('</Project>')\n\nclass _DSPGenerator(object):\n    \"\"\" Base class for DSP generators \"\"\"\n\n    srcargs = [\n        'srcs',\n        'incs',\n        'localincs',\n        'resources',\n        'misc']\n\n    def __init__(self, dspfile, source, env):\n        self.dspfile = str(dspfile)\n        try:\n            get_abspath = dspfile.get_abspath\n        except AttributeError:\n            self.dspabs = os.path.abspath(dspfile)\n        else:\n            self.dspabs = get_abspath()\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVSProject.\")\n        elif SCons.Util.is_String(env['variant']):\n            variants = [env['variant']]\n        elif SCons.Util.is_List(env['variant']):\n            variants = env['variant']\n\n        if 'buildtarget' not in env or env['buildtarget'] is None:\n            buildtarget = ['']\n        elif SCons.Util.is_String(env['buildtarget']):\n            buildtarget = [env['buildtarget']]\n        elif SCons.Util.is_List(env['buildtarget']):\n            if len(env['buildtarget']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'buildtarget' and 'variant' lists must be the same.\")\n            buildtarget = []\n            for bt in env['buildtarget']:\n                if SCons.Util.is_String(bt):\n                    buildtarget.append(bt)\n                else:\n                    buildtarget.append(bt.get_abspath())\n        else:\n            buildtarget = [env['buildtarget'].get_abspath()]\n        if len(buildtarget) == 1:\n            bt = buildtarget[0]\n            buildtarget = []\n            for _ in variants:\n                buildtarget.append(bt)\n\n        if 'outdir' not in env or env['outdir'] is None:\n            outdir = ['']\n        elif SCons.Util.is_String(env['outdir']):\n            outdir = [env['outdir']]\n        elif SCons.Util.is_List(env['outdir']):\n            if len(env['outdir']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'outdir' and 'variant' lists must be the same.\")\n            outdir = []\n            for s in env['outdir']:\n                if SCons.Util.is_String(s):\n                    outdir.append(s)\n                else:\n                    outdir.append(s.get_abspath())\n        else:\n            outdir = [env['outdir'].get_abspath()]\n        if len(outdir) == 1:\n            s = outdir[0]\n            outdir = []\n            for v in variants:\n                outdir.append(s)\n\n        if 'runfile' not in env or env['runfile'] is None:\n            runfile = buildtarget[-1:]\n        elif SCons.Util.is_String(env['runfile']):\n            runfile = [env['runfile']]\n        elif SCons.Util.is_List(env['runfile']):\n            if len(env['runfile']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'runfile' and 'variant' lists must be the same.\")\n            runfile = []\n            for s in env['runfile']:\n                if SCons.Util.is_String(s):\n                    runfile.append(s)\n                else:\n                    runfile.append(s.get_abspath())\n        else:\n            runfile = [env['runfile'].get_abspath()]\n        if len(runfile) == 1:\n            s = runfile[0]\n            runfile = []\n            for v in variants:\n                runfile.append(s)\n\n        self.sconscript = env['MSVSSCONSCRIPT']\n\n        def GetKeyFromEnv(env, key, variants):\n            \"\"\"\n            Retrieves a specific key from the environment. If the key is\n            present, it is expected to either be a string or a list with length\n            equal to the number of variants. The function returns a list of\n            the desired value (e.g. cpp include paths) guaranteed to be of\n            length equal to the length of the variants list.\n            \"\"\"\n            if key not in env or env[key] is None:\n                return [''] * len(variants)\n            elif SCons.Util.is_String(env[key]):\n                return [env[key]] * len(variants)\n            elif SCons.Util.is_List(env[key]):\n                if len(env[key]) != len(variants):\n                    raise SCons.Errors.InternalError(\"Sizes of '%s' and 'variant' lists must be the same.\" % key)\n                else:\n                    return env[key]\n            else:\n                raise SCons.Errors.InternalError(\"Unsupported type for key '%s' in environment: %s\" %\n                                                 (key, type(env[key])))\n\n        cmdargs = GetKeyFromEnv(env, 'cmdargs', variants)\n\n        # The caller is allowed to put 'cppdefines' and/or 'cpppaths' in the\n        # environment, which is useful if they want to provide per-variant\n        # values for these. Otherwise, we fall back to using the global\n        # 'CPPDEFINES' and 'CPPPATH' functions.\n        if 'cppdefines' in env:\n            cppdefines = GetKeyFromEnv(env, 'cppdefines', variants)\n        else:\n            cppdefines = [env.get('CPPDEFINES', [])] * len(variants)\n        if 'cpppaths' in env:\n            cpppaths = GetKeyFromEnv(env, 'cpppaths', variants)\n        else:\n            cpppaths = [env.get('CPPPATH', [])] * len(variants)\n\n        self.env = env\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0])\n        self.name = self.env.subst(self.name)\n\n        sourcenames = [\n            'Source Files',\n            'Header Files',\n            'Local Headers',\n            'Resource Files',\n            'Other Files']\n\n        self.sources = {}\n        for n in sourcenames:\n            self.sources[n] = []\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dspabs):\n            self.Parse()\n\n        for t in zip(sourcenames,self.srcargs):\n            if t[1] in self.env:\n                if SCons.Util.is_List(self.env[t[1]]):\n                    for i in self.env[t[1]]:\n                        if not i in self.sources[t[0]]:\n                            self.sources[t[0]].append(i)\n                else:\n                    if not self.env[t[1]] in self.sources[t[0]]:\n                        self.sources[t[0]].append(self.env[t[1]])\n\n        for n in sourcenames:\n            self.sources[n].sort(key=lambda a: a.lower())\n\n        def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines, cpppaths, dspfile=dspfile, env=env):\n            config = Config()\n            config.buildtarget = buildtarget\n            config.outdir = outdir\n            config.cmdargs = cmdargs\n            config.cppdefines = cppdefines\n            config.runfile = runfile\n\n            # Dir objects can't be pickled, so we need an absolute path here.\n            config.cpppaths = processIncludes(cpppaths, env, None, None)\n\n            match = re.match(r'(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            print(\"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dspfile) + \"'\")\n\n        for i in range(len(variants)):\n            AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i], cppdefines[i], cpppaths[i])\n\n        self.platforms = []\n        for key in list(self.configs.keys()):\n            platform = self.configs[key].platform\n            if platform not in self.platforms:\n                self.platforms.append(platform)\n\n    def Build(self):\n        pass\n\nV6DSPHeader = \"\"\"\\\n# Microsoft Developer Studio Project File - Name=\"%(name)s\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) External Target\" 0x0106\n\nCFG=%(name)s - Win32 %(confkey)s\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\" CFG=\"%(name)s - Win32 %(confkey)s\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n\"\"\"\n\nclass _GenerateV6DSP(_DSPGenerator):\n    \"\"\"Generates a Project file for MSVS 6.0\"\"\"\n\n    def PrintHeader(self):\n        # pick a default config\n        confkeys = sorted(self.configs.keys())\n\n        name = self.name\n        confkey = confkeys[0]\n\n        self.file.write(V6DSPHeader % locals())\n\n        for kind in confkeys:\n            self.file.write('!MESSAGE \"%s - Win32 %s\" (based on \"Win32 (x86) External Target\")\\n' % (name, kind))\n\n        self.file.write('!MESSAGE\\n\\n')\n\n    def PrintProject(self):\n        name = self.name\n        self.file.write('# Begin Project\\n'\n                        '# PROP AllowPerConfigDependencies 0\\n'\n                        '# PROP Scc_ProjName \"\"\\n'\n                        '# PROP Scc_LocalPath \"\"\\n\\n')\n\n        first = 1\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            if first == 1:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n                first = 0\n            else:\n                self.file.write('\\n!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            # have to write this twice, once with the BASE settings, and once without\n            for base in (\"BASE \",\"\"):\n                self.file.write('# PROP %sUse_MFC 0\\n'\n                                '# PROP %sUse_Debug_Libraries ' % (base, base))\n                if 'debug' not in kind.lower():\n                    self.file.write('0\\n')\n                else:\n                    self.file.write('1\\n')\n                self.file.write('# PROP %sOutput_Dir \"%s\"\\n'\n                                '# PROP %sIntermediate_Dir \"%s\"\\n' % (base,outdir,base,outdir))\n                cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1)\n                self.file.write('# PROP %sCmd_Line \"%s\"\\n'\n                                '# PROP %sRebuild_Opt \"-c && %s\"\\n'\n                                '# PROP %sTarget_File \"%s\"\\n'\n                                '# PROP %sBsc_Name \"\"\\n'\n                                '# PROP %sTarget_Dir \"\"\\n'\\\n                                %(base,cmd,base,cmd,base,buildtarget,base,base))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n        self.file.write('\\n!ENDIF\\n\\n'\n                        '# Begin Target\\n\\n')\n        for kind in confkeys:\n            self.file.write('# Name \"%s - Win32 %s\"\\n' % (name,kind))\n        self.file.write('\\n')\n        first = 0\n        for kind in confkeys:\n            if first == 0:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n                first = 1\n            else:\n                self.file.write('!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n        self.file.write('!ENDIF\\n\\n')\n        self.PrintSourceFiles()\n        self.file.write('# End Target\\n'\n                        '# End Project\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '\\n')\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat',\n                      'Header Files': 'h|hpp|hxx|hm|inl',\n                      'Local Headers': 'h|hpp|hxx|hm|inl',\n                      'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',\n                      'Other Files': ''}\n\n        for kind in sorted(list(categories.keys()), key=lambda a: a.lower()):\n            if not self.sources[kind]:\n                continue # skip empty groups\n\n            self.file.write('# Begin Group \"' + kind + '\"\\n\\n')\n            typelist = categories[kind].replace('|', ';')\n            self.file.write('# PROP Default_Filter \"' + typelist + '\"\\n')\n\n            for file in self.sources[kind]:\n                file = os.path.normpath(file)\n                self.file.write('# Begin Source File\\n\\n'\n                                'SOURCE=\"' + file + '\"\\n'\n                                '# End Source File\\n')\n            self.file.write('# End Group\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('# Begin Source File\\n\\n'\n                        'SOURCE=\"' + str(self.sconscript) + '\"\\n'\n                        '# End Source File\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        # skip until marker\n        while line:\n            if \"# End Project\" in line:\n                break\n            line = dspfile.readline()\n\n        # read to get configs\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        # keep reading to get sources\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n        dspfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        # it has a \"# \" in front of it, so we strip that.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\nV7DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV7DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tOutputDirectory=\"%(outdir)s\"\n\\t\\t\\tIntermediateDirectory=\"%(outdir)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\">\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"/>\n\\t\\t</Configuration>\n\"\"\"\n\nV8DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n\\tRootNamespace=\"%(name)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV8DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\\t\\t\\t>\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"\n\\t\\t\\t\\tPreprocessorDefinitions=\"%(preprocdefs)s\"\n\\t\\t\\t\\tIncludeSearchPath=\"%(includepath)s\"\n\\t\\t\\t\\tForcedIncludes=\"\"\n\\t\\t\\t\\tAssemblySearchPath=\"\"\n\\t\\t\\t\\tForcedUsingAssemblies=\"\"\n\\t\\t\\t\\tCompileAsManaged=\"\"\n\\t\\t\\t/>\n\\t\\t</Configuration>\n\"\"\"\nclass _GenerateV7DSP(_DSPGenerator, _GenerateV7User):\n    \"\"\"Generates a Project file for MSVS .NET\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n        self.version = env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        if self.version_num >= 9.0:\n            self.versionstr = '9.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        elif self.version_num >= 8.0:\n            self.versionstr = '8.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        else:\n            if self.version_num >= 7.1:\n                self.versionstr = '7.10'\n            else:\n                self.versionstr = '7.00'\n            self.dspheader = V7DSPHeader\n            self.dspconfiguration = V7DSPConfiguration\n        self.file = None\n\n        _GenerateV7User.__init__(self, dspfile, source, env)\n\n    def PrintHeader(self):\n        env = self.env\n        versionstr = self.versionstr\n        name = self.name\n        encoding = self.env.subst('$MSVSENCODING')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\tSccProjectName=\"%s\"\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\tSccAuxPath=\"%s\"\\n' % scc_aux_path\n            scc_attrs += ('\\tSccLocalPath=\"%s\"\\n'\n                          '\\tSccProvider=\"%s\"' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\tSccProjectName=\"%s\"\\n'\n                         '\\tSccLocalPath=\"%s\"' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspheader = self.dspheader.replace('%(scc_attrs)s\\n', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<Platforms>\\n')\n        for platform in self.platforms:\n            self.file.write(\n                        '\\t\\t<Platform\\n'\n                        '\\t\\t\\tName=\"%s\"/>\\n' % platform)\n        self.file.write('\\t</Platforms>\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\t<ToolFiles>\\n'\n                            '\\t</ToolFiles>\\n')\n\n    def PrintProject(self):\n        self.file.write('\\t<Configurations>\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n            cpppaths = self.configs[kind].cpppaths\n            cppdefines = self.configs[kind].cppdefines\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(cppdefines)))\n            includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</Configurations>\\n')\n\n        if self.version_num >= 7.1:\n            self.file.write('\\t<References>\\n'\n                            '\\t</References>\\n')\n\n        self.PrintSourceFiles()\n\n        self.file.write('</VisualStudioProject>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '-->\\n')\n\n    def printSources(self, hierarchy, commonprefix):\n        sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.file.write('\\t\\t\\t<Filter\\n'\n                                '\\t\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\t\\tFilter=\"\">\\n' % (key))\n                self.printSources(value, commonprefix)\n                self.file.write('\\t\\t\\t</Filter>\\n')\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n                self.file.write('\\t\\t\\t<File\\n'\n                                '\\t\\t\\t\\tRelativePath=\"%s\">\\n'\n                                '\\t\\t\\t</File>\\n' % (file))\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        self.file.write('\\t<Files>\\n')\n\n        cats = sorted([k for k in list(categories.keys()) if self.sources[k]],\n                      key=lambda a: a.lower())\n        for kind in cats:\n            if len(cats) > 1:\n                self.file.write('\\t\\t<Filter\\n'\n                                '\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\tFilter=\"%s\">\\n' % (kind, categories[kind]))\n\n            sources = self.sources[kind]\n\n            # First remove any common prefix\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, commonprefix=commonprefix)\n\n            if len(cats)>1:\n                self.file.write('\\t\\t</Filter>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t\\t<File\\n'\n                        '\\t\\t\\tRelativePath=\"%s\">\\n'\n                        '\\t\\t</File>\\n' % str(self.sconscript))\n\n        self.file.write('\\t</Files>\\n'\n                        '\\t<Globals>\\n'\n                        '\\t</Globals>\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        # skip until marker\n        while line:\n            if '<!-- SCons Data:' in line:\n                break\n            line = dspfile.readline()\n\n        # read to get configs\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        # keep reading to get sources\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n        dspfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\n        _GenerateV7User.Build(self)\n\nV10DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"%(versionstr)s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nV10DSPProjectConfiguration = \"\"\"\\\n\\t\\t<ProjectConfiguration Include=\"%(variant)s|%(platform)s\">\n\\t\\t\\t<Configuration>%(variant)s</Configuration>\n\\t\\t\\t<Platform>%(platform)s</Platform>\n\\t\\t</ProjectConfiguration>\n\"\"\"\n\nV10DSPGlobals = \"\"\"\\\n\\t<PropertyGroup Label=\"Globals\">\n\\t\\t<ProjectGuid>%(project_guid)s</ProjectGuid>\n%(scc_attrs)s\\t\\t<RootNamespace>%(name)s</RootNamespace>\n\\t\\t<Keyword>MakeFileProj</Keyword>\n\\t\\t<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPPropertyGroupCondition = \"\"\"\\\n\\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"Configuration\">\n\\t\\t<ConfigurationType>Makefile</ConfigurationType>\n\\t\\t<UseOfMfc>false</UseOfMfc>\n\\t\\t<PlatformToolset>%(toolset)s</PlatformToolset>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPImportGroupCondition = \"\"\"\\\n\\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"PropertySheets\">\n\\t\\t<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n\\t</ImportGroup>\n\"\"\"\n\nV10DSPCommandLine = \"\"\"\\\n\\t\\t<NMakeBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(buildcmd)s</NMakeBuildCommandLine>\n\\t\\t<NMakeReBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(rebuildcmd)s</NMakeReBuildCommandLine>\n\\t\\t<NMakeCleanCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(cleancmd)s</NMakeCleanCommandLine>\n\\t\\t<NMakeOutput Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(runfile)s</NMakeOutput>\n\\t\\t<NMakePreprocessorDefinitions Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(preprocdefs)s</NMakePreprocessorDefinitions>\n\\t\\t<NMakeIncludeSearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(includepath)s</NMakeIncludeSearchPath>\n\\t\\t<NMakeForcedIncludes Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedIncludes)</NMakeForcedIncludes>\n\\t\\t<NMakeAssemblySearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\n\\t\\t<NMakeForcedUsingAssemblies Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\n\"\"\"\n\nV15DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nclass _GenerateV10DSP(_DSPGenerator, _GenerateV10User):\n    \"\"\"Generates a Project file for MSVS 2010\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n        self.dspheader = V10DSPHeader\n        self.dspconfiguration = V10DSPProjectConfiguration\n        self.dspglobals = V10DSPGlobals\n\n        _GenerateV10User.__init__(self, dspfile, source, env)\n\n    def PrintHeader(self):\n        env = self.env\n        name = self.name\n        versionstr = self.versionstr\n        encoding = env.subst('$MSVSENCODING')\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\t\\t<SccProjectName>%s</SccProjectName>\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\t\\t<SccAuxPath>%s</SccAuxPath>\\n' % scc_aux_path\n            scc_attrs += ('\\t\\t<SccLocalPath>%s</SccLocalPath>\\n'\n                          '\\t\\t<SccProvider>%s</SccProvider>\\n' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\t\\t<SccProjectName>%s</SccProjectName>\\n'\n                         '\\t\\t<SccLocalPath>%s</SccLocalPath>\\n' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<ItemGroup Label=\"ProjectConfigurations\">\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</ItemGroup>\\n')\n\n        self.file.write(self.dspglobals % locals())\n\n    def PrintProject(self):\n        name = self.name\n        confkeys = sorted(self.configs.keys())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\\n')\n\n        toolset = ''\n        if 'MSVC_VERSION' in self.env:\n            version_num, suite = msvs_parse_version(self.env['MSVC_VERSION'])\n            toolset = 'v%d' % (version_num * 10)\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPPropertyGroupCondition % locals())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />\\n')\n        self.file.write('\\t<ImportGroup Label=\"ExtensionSettings\">\\n')\n        self.file.write('\\t</ImportGroup>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPImportGroupCondition % locals())\n\n        self.file.write('\\t<PropertyGroup Label=\"UserMacros\" />\\n')\n        self.file.write('\\t<PropertyGroup>\\n')\n        self.file.write('\\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n            cpppaths = self.configs[kind].cpppaths\n            cppdefines = self.configs[kind].cppdefines\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(cppdefines)))\n            includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(V10DSPCommandLine % locals())\n\n        self.file.write('\\t</PropertyGroup>\\n')\n\n        #filter settings in MSVS 2010 are stored in separate file\n        self.filtersabs = self.dspabs + '.filters'\n        try:\n            self.filters_file = open(self.filtersabs, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.filtersabs + '\" for writing:' + str(detail))\n\n        self.filters_file.write('<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n'\n                                '<Project ToolsVersion=\"%s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\\n' %\n                                self.versionstr)\n\n        self.PrintSourceFiles()\n\n        self.filters_file.write('</Project>')\n        self.filters_file.close()\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />\\n'\n                        '\\t<ImportGroup Label=\"ExtensionTargets\">\\n'\n                        '\\t</ImportGroup>\\n'\n                        '</Project>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '-->\\n')\n\n    def printFilters(self, hierarchy, name):\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                filter_name = name + '\\\\' + key\n                self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                        '\\t\\t\\t<UniqueIdentifier>%s</UniqueIdentifier>\\n'\n                                        '\\t\\t</Filter>\\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))\n                self.printFilters(value, filter_name)\n\n    def printSources(self, hierarchy, kind, commonprefix, filter_name):\n        keywords = {'Source Files': 'ClCompile',\n                    'Header Files': 'ClInclude',\n                    'Local Headers': 'ClInclude',\n                    'Resource Files': 'None',\n                    'Other Files': 'None'}\n\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.printSources(value, kind, commonprefix, filter_name + '\\\\' + key)\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n\n                self.file.write('\\t\\t<%s Include=\"%s\" />\\n' % (keywords[kind], file))\n                self.filters_file.write('\\t\\t<%s Include=\"%s\">\\n'\n                                        '\\t\\t\\t<Filter>%s</Filter>\\n'\n                                        '\\t\\t</%s>\\n' % (keywords[kind], file, filter_name, keywords[kind]))\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        cats = sorted([k for k in list(categories.keys()) if self.sources[k]],\n                      key = lambda a: a.lower())\n\n        # print vcxproj.filters file first\n        self.filters_file.write('\\t<ItemGroup>\\n')\n        for kind in cats:\n            self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                    '\\t\\t\\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\\n'\n                                    '\\t\\t\\t<Extensions>%s</Extensions>\\n'\n                                    '\\t\\t</Filter>\\n' % (kind, categories[kind]))\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printFilters(hierarchy, kind)\n\n        self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # then print files and filters\n        for kind in cats:\n            self.file.write('\\t<ItemGroup>\\n')\n            self.filters_file.write('\\t<ItemGroup>\\n')\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, kind, commonprefix, kind)\n\n            self.file.write('\\t</ItemGroup>\\n')\n            self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t<ItemGroup>\\n'\n                        '\\t\\t<None Include=\"%s\" />\\n'\n                        #'\\t\\t<None Include=\"SConstruct\" />\\n'\n                        '\\t</ItemGroup>\\n' % str(self.sconscript))\n\n    def Parse(self):\n        print(\"_GenerateV10DSP.Parse()\")\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\n        _GenerateV10User.Build(self)\n\nclass _DSWGenerator(object):\n    \"\"\" Base class for DSW generators \"\"\"\n    def __init__(self, dswfile, source, env):\n        self.dswfile = os.path.normpath(str(dswfile))\n        self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile))\n        self.env = env\n\n        if 'projects' not in env:\n            raise SCons.Errors.UserError(\"You must specify a 'projects' argument to create an MSVSSolution.\")\n        projects = env['projects']\n        if not SCons.Util.is_List(projects):\n            raise SCons.Errors.InternalError(\"The 'projects' argument must be a list of nodes.\")\n        projects = SCons.Util.flatten(projects)\n        if len(projects) < 1:\n            raise SCons.Errors.UserError(\"You must specify at least one project to create an MSVSSolution.\")\n        self.dspfiles = list(map(str, projects))\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0])\n        self.name = self.env.subst(self.name)\n\n    def Build(self):\n        pass\n\nclass _GenerateV7DSW(_DSWGenerator):\n    \"\"\"Generates a Solution file for MSVS .NET\"\"\"\n    def __init__(self, dswfile, source, env):\n        _DSWGenerator.__init__(self, dswfile, source, env)\n\n        self.file = None\n        self.version = self.env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        self.versionstr = '7.00'\n        if self.version_num >= 11.0:\n            self.versionstr = '12.00'\n        elif self.version_num >= 10.0:\n            self.versionstr = '11.00'\n        elif self.version_num >= 9.0:\n            self.versionstr = '10.00'\n        elif self.version_num >= 8.0:\n            self.versionstr = '9.00'\n        elif self.version_num >= 7.1:\n            self.versionstr = '8.00'\n\n        if 'slnguid' in env and env['slnguid']:\n            self.slnguid = env['slnguid']\n        else:\n            self.slnguid = _generateGUID(dswfile, self.name)\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dswfile):\n            self.Parse()\n\n        def AddConfig(self, variant, dswfile=dswfile):\n            config = Config()\n\n            match = re.match(r'(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            print(\"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dswfile) + \"'\")\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVS Solution File.\")\n        elif SCons.Util.is_String(env['variant']):\n            AddConfig(self, env['variant'])\n        elif SCons.Util.is_List(env['variant']):\n            for variant in env['variant']:\n                AddConfig(self, variant)\n\n        self.platforms = []\n        for key in list(self.configs.keys()):\n            platform = self.configs[key].platform\n            if platform not in self.platforms:\n                self.platforms.append(platform)\n\n        def GenerateProjectFilesInfo(self):\n            for dspfile in self.dspfiles:\n                dsp_folder_path, name = os.path.split(dspfile)\n                dsp_folder_path = os.path.abspath(dsp_folder_path)\n                if SCons.Util.splitext(name)[1] == '.filters':\n                    # Ignore .filters project files\n                    continue\n                dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path)\n                if dsp_relative_folder_path == os.curdir:\n                    dsp_relative_file_path = name\n                else:\n                    dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)\n                dspfile_info = {'NAME': name,\n                                'GUID': _generateGUID(dspfile, ''),\n                                'FOLDER_PATH': dsp_folder_path,\n                                'FILE_PATH': dspfile,\n                                'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,\n                                'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}\n                self.dspfiles_info.append(dspfile_info)\n\n        self.dspfiles_info = []\n        GenerateProjectFilesInfo(self)\n\n    def Parse(self):\n        try:\n            dswfile = open(self.dswfile,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dswfile.readline()\n        while line:\n            if line[:9] == \"EndGlobal\":\n                break\n            line = dswfile.readline()\n\n        line = dswfile.readline()\n        datas = line\n        while line:\n            line = dswfile.readline()\n            datas = datas + line\n        dswfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n    def PrintSolution(self):\n        \"\"\"Writes a solution file\"\"\"\n        self.file.write('Microsoft Visual Studio Solution File, Format Version %s\\n' % self.versionstr)\n        if self.version_num >= 14.2:\n            # Visual Studio 2019 is considered to be version 16.\n            self.file.write('# Visual Studio 16\\n')\n        elif self.version_num > 14.0:\n            # Visual Studio 2015 and 2017 are both considered to be version 15.\n            self.file.write('# Visual Studio 15\\n')\n        elif self.version_num >= 12.0:\n            self.file.write('# Visual Studio 14\\n')\n        elif self.version_num >= 11.0:\n            self.file.write('# Visual Studio 11\\n')\n        elif self.version_num >= 10.0:\n            self.file.write('# Visual Studio 2010\\n')\n        elif self.version_num >= 9.0:\n            self.file.write('# Visual Studio 2008\\n')\n        elif self.version_num >= 8.0:\n            self.file.write('# Visual Studio 2005\\n')\n\n        for dspinfo in self.dspfiles_info:\n            name = dspinfo['NAME']\n            base, suffix = SCons.Util.splitext(name)\n            if suffix == '.vcproj':\n                name = base\n            self.file.write('Project(\"%s\") = \"%s\", \"%s\", \"%s\"\\n'\n                            % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))\n            if 7.1 <= self.version_num < 8.0:\n                self.file.write('\\tProjectSection(ProjectDependencies) = postProject\\n'\n                                '\\tEndProjectSection\\n')\n            self.file.write('EndProject\\n')\n\n        self.file.write('Global\\n')\n\n        env = self.env\n        if 'MSVS_SCC_PROVIDER' in env:\n            scc_number_of_projects = len(self.dspfiles) + 1\n            slnguid = self.slnguid\n            scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\\u0020')\n            scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\\u0020')\n            scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n            scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\\\', '\\\\\\\\')\n            self.file.write('\\tGlobalSection(SourceCodeControl) = preSolution\\n'\n                            '\\t\\tSccNumberOfProjects = %(scc_number_of_projects)d\\n'\n                            '\\t\\tSccProjectName0 = %(scc_project_name)s\\n'\n                            '\\t\\tSccLocalPath0 = %(scc_local_path)s\\n'\n                            '\\t\\tSccProvider0 = %(scc_provider)s\\n'\n                            '\\t\\tCanCheckoutShared = true\\n'  % locals())\n            sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root)\n            if sln_relative_path_from_scc != os.curdir:\n                self.file.write('\\t\\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\\\\\\n'\n                                % sln_relative_path_from_scc.replace('\\\\', '\\\\\\\\'))\n            if self.version_num < 8.0:\n                # When present, SolutionUniqueID is automatically removed by VS 2005\n                # TODO: check for Visual Studio versions newer than 2005\n                self.file.write('\\t\\tSolutionUniqueID = %s\\n' % slnguid)\n            for dspinfo in self.dspfiles_info:\n                i = self.dspfiles_info.index(dspinfo) + 1\n                dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\\\', '\\\\\\\\')\n                dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\\\', '\\\\\\\\')\n                self.file.write('\\t\\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\\n'\n                                '\\t\\tSccLocalPath%(i)d = %(scc_local_path)s\\n'\n                                '\\t\\tCanCheckoutShared = true\\n'\n                                '\\t\\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\\\\\\n'\n                                % locals())\n            self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(SolutionConfiguration) = preSolution\\n')\n\n        confkeys = sorted(self.configs.keys())\n        cnt = 0\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                self.file.write('\\t\\t%s|%s = %s|%s\\n' % (variant, platform, variant, platform))\n            else:\n                self.file.write('\\t\\tConfigName.%d = %s\\n' % (cnt, variant))\n            cnt = cnt + 1\n        self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num <= 7.1:\n            self.file.write('\\tGlobalSection(ProjectDependencies) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(ProjectConfiguration) = postSolution\\n')\n\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s|%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s|%s.Build.0 = %s|%s\\n'  % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))\n            else:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s.Build.0 = %s|%s\\n'  %(guid,variant,variant,platform,guid,variant,variant,platform))\n\n        self.file.write('\\tEndGlobalSection\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionProperties) = preSolution\\n'\n                            '\\t\\tHideSolutionNode = FALSE\\n'\n                            '\\tEndGlobalSection\\n')\n        else:\n            self.file.write('\\tGlobalSection(ExtensibilityGlobals) = postSolution\\n'\n                            '\\tEndGlobalSection\\n'\n                            '\\tGlobalSection(ExtensibilityAddIns) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        self.file.write('EndGlobal\\n')\n        if self.nokeep == 0:\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata)\n            self.file.write('\\n')\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintSolution()\n            self.file.close()\n\nV6DSWHeader = \"\"\"\\\nMicrosoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"%(name)s\"=\"%(dspfile)s\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\"\"\"\n\nclass _GenerateV6DSW(_DSWGenerator):\n    \"\"\"Generates a Workspace file for MSVS 6.0\"\"\"\n\n    def PrintWorkspace(self):\n        \"\"\" writes a DSW file \"\"\"\n        name = self.name\n        dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path)\n        self.file.write(V6DSWHeader % locals())\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintWorkspace()\n            self.file.close()\n\n\ndef GenerateDSP(dspfile, source, env):\n    \"\"\"Generates a Project file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 10.0:\n        g = _GenerateV10DSP(dspfile, source, env)\n        g.Build()\n    elif version_num >= 7.0:\n        g = _GenerateV7DSP(dspfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSP(dspfile, source, env)\n        g.Build()\n\ndef GenerateDSW(dswfile, source, env):\n    \"\"\"Generates a Solution/Workspace file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 7.0:\n        g = _GenerateV7DSW(dswfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSW(dswfile, source, env)\n        g.Build()\n\n\n##############################################################################\n# Above here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef GetMSVSProjectSuffix(target, source, env, for_signature):\n    return env['MSVS']['PROJECTSUFFIX']\n\ndef GetMSVSSolutionSuffix(target, source, env, for_signature):\n    return env['MSVS']['SOLUTIONSUFFIX']\n\ndef GenerateProject(target, source, env):\n    # generate the dsp file, according to the version of MSVS.\n    builddspfile = target[0]\n    dspfile = builddspfile.srcnode()\n\n    # this detects whether or not we're using a VariantDir\n    if dspfile is not builddspfile:\n        try:\n            bdsp = open(str(builddspfile), \"w+\")\n        except IOError as detail:\n            print('Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n')\n            raise\n\n        bdsp.write(\"This is just a placeholder file.\\nThe real project file is here:\\n%s\\n\" % dspfile.get_abspath())\n        bdsp.close()\n\n    GenerateDSP(dspfile, source, env)\n\n    if env.get('auto_build_solution', 1):\n        builddswfile = target[1]\n        dswfile = builddswfile.srcnode()\n\n        if dswfile is not builddswfile:\n\n            try:\n                bdsw = open(str(builddswfile), \"w+\")\n            except IOError as detail:\n                print('Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n')\n                raise\n\n            bdsw.write(\"This is just a placeholder file.\\nThe real workspace file is here:\\n%s\\n\" % dswfile.get_abspath())\n            bdsw.close()\n\n        GenerateDSW(dswfile, source, env)\n\ndef GenerateSolution(target, source, env):\n    GenerateDSW(target[0], source, env)\n\ndef projectEmitter(target, source, env):\n    \"\"\"Sets up the DSP dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSPROJECTSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSPROJECTSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'prj_inputs:'\n        source = source + env.subst('$MSVSSCONSCOM', 1)\n        source = source + env.subst('$MSVSENCODING', 1)\n\n        # Project file depends on CPPDEFINES and CPPPATH\n        preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', []))))\n        includepath = xmlify(';'.join(processIncludes(env.get('CPPPATH', []), env, None, None)))\n        source = source + \"; ppdefs:%s incpath:%s\"%(preprocdefs, includepath)\n\n        if 'buildtarget' in env and env['buildtarget'] is not None:\n            if SCons.Util.is_String(env['buildtarget']):\n                source = source + ' \"%s\"' % env['buildtarget']\n            elif SCons.Util.is_List(env['buildtarget']):\n                for bt in env['buildtarget']:\n                    if SCons.Util.is_String(bt):\n                        source = source + ' \"%s\"' % bt\n                    else:\n                        try: source = source + ' \"%s\"' % bt.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['buildtarget'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'outdir' in env and env['outdir'] is not None:\n            if SCons.Util.is_String(env['outdir']):\n                source = source + ' \"%s\"' % env['outdir']\n            elif SCons.Util.is_List(env['outdir']):\n                for s in env['outdir']:\n                    if SCons.Util.is_String(s):\n                        source = source + ' \"%s\"' % s\n                    else:\n                        try: source = source + ' \"%s\"' % s.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['outdir'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        for s in _DSPGenerator.srcargs:\n            if s in env:\n                if SCons.Util.is_String(env[s]):\n                    source = source + ' \"%s' % env[s]\n                elif SCons.Util.is_List(env[s]):\n                    for t in env[s]:\n                        if SCons.Util.is_String(t):\n                            source = source + ' \"%s\"' % t\n                        else:\n                            raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n                else:\n                    raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    targetlist = [target[0]]\n    sourcelist = source\n\n    if env.get('auto_build_solution', 1):\n        env['projects'] = [env.File(t).srcnode() for t in targetlist]\n        t, s = solutionEmitter(target, target, env)\n        targetlist = targetlist + t\n\n    # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 10.0:\n        targetlist.append(targetlist[0] + '.filters')\n\n    return (targetlist, sourcelist)\n\ndef solutionEmitter(target, source, env):\n    \"\"\"Sets up the DSW dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSSOLUTIONSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'sln_inputs:'\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        if 'slnguid' in env:\n            if SCons.Util.is_String(env['slnguid']):\n                source = source + ' \"%s\"' % env['slnguid']\n            else:\n                raise SCons.Errors.InternalError(\"slnguid must be a string\")\n\n        if 'projects' in env:\n            if SCons.Util.is_String(env['projects']):\n                source = source + ' \"%s\"' % env['projects']\n            elif SCons.Util.is_List(env['projects']):\n                for t in env['projects']:\n                    if SCons.Util.is_String(t):\n                        source = source + ' \"%s\"' % t\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    return ([target[0]], source)\n\nprojectAction = SCons.Action.Action(GenerateProject, None)\n\nsolutionAction = SCons.Action.Action(GenerateSolution, None)\n\nprojectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM',\n                                       suffix = '$MSVSPROJECTSUFFIX',\n                                       emitter = projectEmitter)\n\nsolutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM',\n                                        suffix = '$MSVSSOLUTIONSUFFIX',\n                                        emitter = solutionEmitter)\n\ndefault_MSVS_SConscript = None\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Microsoft Visual\n    Studio project files to an Environment.\"\"\"\n    try:\n        env['BUILDERS']['MSVSProject']\n    except KeyError:\n        env['BUILDERS']['MSVSProject'] = projectBuilder\n\n    try:\n        env['BUILDERS']['MSVSSolution']\n    except KeyError:\n        env['BUILDERS']['MSVSSolution'] = solutionBuilder\n\n    env['MSVSPROJECTCOM'] = projectAction\n    env['MSVSSOLUTIONCOM'] = solutionAction\n\n    if SCons.Script.call_stack:\n        # XXX Need to find a way to abstract this; the build engine\n        # shouldn't depend on anything in SCons.Script.\n        env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript\n    else:\n        global default_MSVS_SConscript\n        if default_MSVS_SConscript is None:\n            default_MSVS_SConscript = env.File('SConstruct')\n        env['MSVSSCONSCRIPT'] = default_MSVS_SConscript\n\n    # Allow consumers to provide their own versions of MSVSSCONS and\n    # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to\n    # invoke scons.\n    if 'MSVSSCONS' not in env:\n        env['MSVSSCONS'] = '\"%s\" -c \"%s\"' % (python_executable, getExecScriptMain(env))\n    if 'MSVSSCONSFLAGS' not in env:\n        env['MSVSSCONSFLAGS'] = '-C \"${MSVSSCONSCRIPT.dir.get_abspath()}\" -f ${MSVSSCONSCRIPT.name}'\n\n    env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'\n    env['MSVSBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c \"$MSVSBUILDTARGET\"'\n\n    # Set-up ms tools paths for default version\n    msvc_setup_env_once(env)\n\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    else:\n        (version_num, suite) = (7.0, None) # guess at a default\n    if 'MSVS' not in env:\n        env['MSVS'] = {}\n    if (version_num < 7.0):\n        env['MSVS']['PROJECTSUFFIX']  = '.dsp'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'\n    elif (version_num < 10.0):\n        env['MSVS']['PROJECTSUFFIX']  = '.vcproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n    else:\n        env['MSVS']['PROJECTSUFFIX']  = '.vcxproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n\n    if (version_num >= 10.0):\n        env['MSVSENCODING'] = 'utf-8'\n    else:\n        env['MSVSENCODING'] = 'Windows-1252'\n\n    env['GET_MSVSPROJECTSUFFIX']  = GetMSVSProjectSuffix\n    env['GET_MSVSSOLUTIONSUFFIX']  = GetMSVSSolutionSuffix\n    env['MSVSPROJECTSUFFIX']  = '${GET_MSVSPROJECTSUFFIX}'\n    env['MSVSSOLUTIONSUFFIX']  = '${GET_MSVSSOLUTIONSUFFIX}'\n    env['SCONS_HOME'] = os.environ.get('SCONS_HOME')\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mwcc.py",
    "content": "\"\"\"SCons.Tool.mwcc\n\nTool-specific initialization for the Metrowerks CodeWarrior compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mwcc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\ndef set_vars(env):\n    \"\"\"Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars\n\n    MWCW_VERSIONS is set to a list of objects representing installed versions\n\n    MWCW_VERSION  is set to the version object that will be used for building.\n                  MWCW_VERSION can be set to a string during Environment\n                  construction to influence which version is chosen, otherwise\n                  the latest one from MWCW_VERSIONS is used.\n\n    Returns true if at least one version is found, false otherwise\n    \"\"\"\n    desired = env.get('MWCW_VERSION', '')\n\n    # return right away if the variables are already set\n    if isinstance(desired, MWVersion):\n        return 1\n    elif desired is None:\n        return 0\n\n    versions = find_versions()\n    version = None\n\n    if desired:\n        for v in versions:\n            if str(v) == desired:\n                version = v\n    elif versions:\n        version = versions[-1]\n\n    env['MWCW_VERSIONS'] = versions\n    env['MWCW_VERSION'] = version\n\n    if version is None:\n      return 0\n\n    env.PrependENVPath('PATH', version.clpath)\n    env.PrependENVPath('PATH', version.dllpath)\n    ENV = env['ENV']\n    ENV['CWFolder'] = version.path\n    ENV['LM_LICENSE_FILE'] = version.license\n    plus = lambda x: '+%s' % x\n    ENV['MWCIncludes'] = os.pathsep.join(map(plus, version.includes))\n    ENV['MWLibraries'] = os.pathsep.join(map(plus, version.libs))\n    return 1\n\n\ndef find_versions():\n    \"\"\"Return a list of MWVersion objects representing installed versions\"\"\"\n    versions = []\n\n    ### This function finds CodeWarrior by reading from the registry on\n    ### Windows. Some other method needs to be implemented for other\n    ### platforms, maybe something that calls env.WhereIs('mwcc')\n\n    if SCons.Util.can_read_reg:\n        try:\n            HLM = SCons.Util.HKEY_LOCAL_MACHINE\n            product = 'SOFTWARE\\\\Metrowerks\\\\CodeWarrior\\\\Product Versions'\n            product_key = SCons.Util.RegOpenKeyEx(HLM, product)\n\n            i = 0\n            while True:\n                name = product + '\\\\' + SCons.Util.RegEnumKey(product_key, i)\n                name_key = SCons.Util.RegOpenKeyEx(HLM, name)\n\n                try:\n                    version = SCons.Util.RegQueryValueEx(name_key, 'VERSION')\n                    path = SCons.Util.RegQueryValueEx(name_key, 'PATH')\n                    mwv = MWVersion(version[0], path[0], 'Win32-X86')\n                    versions.append(mwv)\n                except SCons.Util.RegError:\n                    pass\n\n                i = i + 1\n\n        except SCons.Util.RegError:\n            pass\n\n    return versions\n\n\nclass MWVersion(object):\n    def __init__(self, version, path, platform):\n        self.version = version\n        self.path = path\n        self.platform = platform\n        self.clpath = os.path.join(path, 'Other Metrowerks Tools',\n                                   'Command Line Tools')\n        self.dllpath = os.path.join(path, 'Bin')\n\n        # The Metrowerks tools don't store any configuration data so they\n        # are totally dumb when it comes to locating standard headers,\n        # libraries, and other files, expecting all the information\n        # to be handed to them in environment variables. The members set\n        # below control what information scons injects into the environment\n\n        ### The paths below give a normal build environment in CodeWarrior for\n        ### Windows, other versions of CodeWarrior might need different paths.\n\n        msl = os.path.join(path, 'MSL')\n        support = os.path.join(path, '%s Support' % platform)\n\n        self.license = os.path.join(path, 'license.dat')\n        self.includes = [msl, support]\n        self.libs = [msl, support]\n\n    def __str__(self):\n        return self.version\n\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the mwcc to an Environment.\"\"\"\n    import SCons.Defaults\n    import SCons.Tool\n\n    set_vars(env)\n\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n\n    env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -nolink -o $TARGET $SOURCES'\n\n    env['CC']         = 'mwcc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS'\n\n    env['CXX']        = 'mwcc'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'\n\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = '$CCFLAGS'\n    env['SHCFLAGS']   = '$CFLAGS'\n    env['SHCCCOM']    = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS'\n\n    env['SHCXX']       = '$CXX'\n    env['SHCXXFLAGS']  = '$CXXFLAGS'\n    env['SHCXXCOM']    = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cpp'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n\n    #env['PCH'] = ?\n    #env['PCHSTOP'] = ?\n\n\ndef exists(env):\n    return set_vars(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/mwld.py",
    "content": "\"\"\"SCons.Tool.mwld\n\nTool-specific initialization for the Metrowerks CodeWarrior linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/mwld.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['AR'] = 'mwld'\n    env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES'\n\n    env['LIBDIRPREFIX'] = '-L'\n    env['LIBDIRSUFFIX'] = ''\n    env['LIBLINKPREFIX'] = '-l'\n    env['LIBLINKSUFFIX'] = '.lib'\n\n    env['LINK'] = 'mwld'\n    env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    env['SHLINK'] = '$LINK'\n    env['SHLINKFLAGS'] = '$LINKFLAGS'\n    env['SHLINKCOM']   = shlib_action\n    env['SHLIBEMITTER']= shlib_emitter\n    env['LDMODULEEMITTER']= shlib_emitter\n\n\ndef exists(env):\n    import SCons.Tool.mwcc\n    return SCons.Tool.mwcc.set_vars(env)\n\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = ['$SHLINK', '$SHLINKFLAGS', '-shared']\n\n    no_import_lib = env.get('no_import_lib', 0)\n    if no_import_lib: cmd.extend('-noimplib')\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: cmd.extend(['-implib', implib.get_string(for_signature)])\n\n    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    return [cmd]\n\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$SHLIBSUFFIX\"))\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n\n        # Append an import library to the list of targets.\n        target.append(env.ReplaceIxes(dll,\n                                      'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                      'LIBPREFIX', 'LIBSUFFIX'))\n\n    return target, source\n\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/nasm.py",
    "content": "\"\"\"SCons.Tool.nasm\n\nTool-specific initialization for nasm, the famous Netwide Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/nasm.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for nasm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    env['AS']        = 'nasm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect('nasm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/rmic.py",
    "content": "\"\"\"SCons.Tool.rmic\n\nTool-specific initialization for rmic.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/rmic.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Util\n\nfrom SCons.Tool.JavaCommon import get_java_install_dirs\n\n\ndef emit_rmic_classes(target, source, env):\n    \"\"\"Create and return lists of Java RMI stub and skeleton\n    class files to be created from a set of class files.\n    \"\"\"\n    class_suffix = env.get('JAVACLASSSUFFIX', '.class')\n    classdir = env.get('JAVACLASSDIR')\n\n    if not classdir:\n        try:\n            s = source[0]\n        except IndexError:\n            classdir = '.'\n        else:\n            try:\n                classdir = s.attributes.java_classdir\n            except AttributeError:\n                classdir = '.'\n    classdir = env.Dir(classdir).rdir()\n    if str(classdir) == '.':\n        c_ = None\n    else:\n        c_ = str(classdir) + os.sep\n\n    slist = []\n    for src in source:\n        try:\n            classname = src.attributes.java_classname\n        except AttributeError:\n            classname = str(src)\n            if c_ and classname[:len(c_)] == c_:\n                classname = classname[len(c_):]\n            if class_suffix and classname[:-len(class_suffix)] == class_suffix:\n                classname = classname[-len(class_suffix):]\n        s = src.rfile()\n        s.attributes.java_classdir = classdir\n        s.attributes.java_classname = classname\n        slist.append(s)\n\n    stub_suffixes = ['_Stub']\n    if env.get('JAVAVERSION') == '1.4':\n        stub_suffixes.append('_Skel')\n\n    tlist = []\n    for s in source:\n        for suff in stub_suffixes:\n            fname = s.attributes.java_classname.replace('.', os.sep) + \\\n                    suff + class_suffix\n            t = target[0].File(fname)\n            t.attributes.java_lookupdir = target[0]\n            tlist.append(t)\n\n    return tlist, source\n\nRMICAction = SCons.Action.Action('$RMICCOM', '$RMICCOMSTR')\n\nRMICBuilder = SCons.Builder.Builder(action = RMICAction,\n                     emitter = emit_rmic_classes,\n                     src_suffix = '$JAVACLASSSUFFIX',\n                     target_factory = SCons.Node.FS.Dir,\n                     source_factory = SCons.Node.FS.File)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for rmic to an Environment.\"\"\"\n    env['BUILDERS']['RMIC'] = RMICBuilder\n\n    if env['PLATFORM'] == 'win32':\n        version = env.get('JAVAVERSION', None)\n        # Ensure that we have a proper path for rmic\n        paths = get_java_install_dirs('win32', version=version)\n        rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=paths)\n        # print(\"RMIC: %s\"%rmic)\n        if rmic:\n            rmic_bin_dir = os.path.dirname(rmic)\n            env.AppendENVPath('PATH', rmic_bin_dir)\n\n    env['RMIC']            = 'rmic'\n    env['RMICFLAGS']       = SCons.Util.CLVar('')\n    env['RMICCOM']         = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}'\n    env['JAVACLASSSUFFIX']  = '.class'\n\ndef exists(env):\n    # As reported by Jan Nijtmans in issue #2730, the simple\n    #    return env.Detect('rmic')\n    # doesn't always work during initialization. For now, we\n    # stop trying to detect an executable (analogous to the\n    # javac Builder).\n    # TODO: Come up with a proper detect() routine...and enable it.\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/rpcgen.py",
    "content": "\"\"\"SCons.Tool.rpcgen\n\nTool-specific initialization for RPCGEN tools.\n\nThree normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/rpcgen.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom SCons.Builder import Builder\nimport SCons.Util\n\ncmd = \"cd ${SOURCE.dir} && $RPCGEN -%s $RPCGENFLAGS %s -o ${TARGET.abspath} ${SOURCE.file}\"\n\nrpcgen_client   = cmd % ('l', '$RPCGENCLIENTFLAGS')\nrpcgen_header   = cmd % ('h', '$RPCGENHEADERFLAGS')\nrpcgen_service  = cmd % ('m', '$RPCGENSERVICEFLAGS')\nrpcgen_xdr      = cmd % ('c', '$RPCGENXDRFLAGS')\n\ndef generate(env):\n    \"\"\"Add RPCGEN Builders and construction variables for an Environment.\"\"\"\n    \n    client  = Builder(action=rpcgen_client,  suffix='_clnt.c', src_suffix='.x')\n    header  = Builder(action=rpcgen_header,  suffix='.h',      src_suffix='.x')\n    service = Builder(action=rpcgen_service, suffix='_svc.c',  src_suffix='.x')\n    xdr     = Builder(action=rpcgen_xdr,     suffix='_xdr.c',  src_suffix='.x')\n    env.Append(BUILDERS={'RPCGenClient'  : client,\n                         'RPCGenHeader'  : header,\n                         'RPCGenService' : service,\n                         'RPCGenXDR'     : xdr})\n    env['RPCGEN'] = 'rpcgen'\n    env['RPCGENFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENCLIENTFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENHEADERFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENSERVICEFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENXDRFLAGS'] = SCons.Util.CLVar('')\n\ndef exists(env):\n    return env.Detect('rpcgen')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sgiar.py",
    "content": "\"\"\"SCons.Tool.sgiar\n\nTool-specific initialization for SGI ar (library archive).  If CC\nexists, static libraries should be built with it, so the prelinker has\na chance to resolve C++ template instantiations.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgiar.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    \n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-ar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n        \n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sgic++.py",
    "content": "\"\"\"SCons.Tool.sgic++\n\nTool-specific initialization for MIPSpro C++ on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgic++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.sgicxx import *\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sgicc.py",
    "content": "\"\"\"SCons.Tool.sgicc\n\nTool-specific initialization for MIPSPro cc on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgicc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'CC'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('cc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sgicxx.py",
    "content": "\"\"\"SCons.Tool.sgic++\n\nTool-specific initialization for MIPSpro C++ on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgicxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SGI MIPS C++ to an Environment.\"\"\"\n\n    cplusplus.generate(env)\n\n    env['CXX']         = 'CC'\n    env['CXXFLAGS']    = SCons.Util.CLVar('-LANG:std')\n    env['SHCXX']       = '$CXX'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n    \ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sgilink.py",
    "content": "\"\"\"SCons.Tool.sgilink\n\nTool-specific initialization for the SGI MIPSPro linker on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sgilink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\n\nfrom . import link\n\nlinkers = ['CC', 'cc']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MIPSPro to an Environment.\"\"\"\n    link.generate(env)\n    \n    env['LINK'] = env.Detect(linkers) or 'cc'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-rpath '\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\ndef exists(env):\n    return env.Detect(linkers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sunar.py",
    "content": "\"\"\"engine.SCons.Tool.sunar\n\nTool-specific initialization for Solaris (Forte) ar (library archive). If CC\nexists, static libraries should be built with it, so that template\ninstantiations can be resolved.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunar.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    \n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-xar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sunc++.py",
    "content": "\"\"\"SCons.Tool.sunc++\n\nTool-specific initialization for C++ on SunOS / Solaris.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunc++.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.suncxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/suncc.py",
    "content": "\"\"\"SCons.Tool.suncc\n\nTool-specific initialization for Sun Solaris (Forte) CC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/suncc.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Util\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Forte C and C++ compilers\n    to an Environment.\n    \"\"\"\n    cc.generate(env)\n\n    env['CXX']          = 'CC'\n    env['SHCCFLAGS']    = SCons.Util.CLVar('$CCFLAGS -KPIC')\n    env['SHOBJPREFIX']  = 'so_'\n    env['SHOBJSUFFIX']  = '.o'\n\ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/suncxx.py",
    "content": "\"\"\"SCons.Tool.sunc++\n\nTool-specific initialization for C++ on SunOS / Solaris.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/suncxx.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons\n\nimport os\nimport re\nimport subprocess\n\nfrom SCons.Util import PY3\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n# cplusplus = __import__('c++', globals(), locals(), [])\n\npackage_info = {}\n\n\ndef get_package_info(package_name, pkginfo, pkgchk):\n    try:\n        return package_info[package_name]\n    except KeyError:\n        version = None\n        pathname = None\n        try:\n            from subprocess import DEVNULL  # py3k\n        except ImportError:\n            DEVNULL = open(os.devnull, 'wb')\n\n        try:\n            with open('/var/sadm/install/contents', 'r') as f:\n                sadm_contents = f.read()\n        except EnvironmentError:\n            pass\n        else:\n            sadm_re = re.compile(r'^(\\S*/bin/CC)(=\\S*)? %s$' % package_name, re.M)\n            sadm_match = sadm_re.search(sadm_contents)\n            if sadm_match:\n                pathname = os.path.dirname(sadm_match.group(1))\n\n        try:\n            popen_args = {'stdout': subprocess.PIPE,\n                          'stderr': DEVNULL}\n            if PY3:\n                popen_args['universal_newlines'] = True\n            p = subprocess.Popen([pkginfo, '-l', package_name],\n                                 **popen_args)\n        except EnvironmentError:\n            pass\n        else:\n            pkginfo_contents = p.communicate()[0]\n            if not PY3:\n                pkginfo_contents.decode()\n            version_re = re.compile(r'^ *VERSION:\\s*(.*)$', re.M)\n            version_match = version_re.search(pkginfo_contents)\n            if version_match:\n                version = version_match.group(1)\n\n        if pathname is None:\n            try:\n                popen_args = {'stdout': subprocess.PIPE,\n                              'stderr': DEVNULL}\n                if PY3:\n                    popen_args['universal_newlines'] = True\n                p = subprocess.Popen([pkgchk, '-l', package_name],\n                                     **popen_args)\n            except EnvironmentError:\n                pass\n            else:\n                pkgchk_contents = p.communicate()[0]\n                if not PY3:\n                    pkgchk_contents.decode()\n                pathname_re = re.compile(r'^Pathname:\\s*(.*/bin/CC)$', re.M)\n                pathname_match = pathname_re.search(pkgchk_contents)\n                if pathname_match:\n                    pathname = os.path.dirname(pathname_match.group(1))\n\n        package_info[package_name] = (pathname, version)\n        return package_info[package_name]\n\n\n# use the package installer tool \"pkg\" to figure out where cppc and what\n# version of it is installed\ndef get_cppc(env):\n    cxx = env.subst('$CXX')\n    if cxx:\n        cppcPath = os.path.dirname(cxx)\n    else:\n        cppcPath = None\n\n    cppcVersion = None\n\n    pkginfo = env.subst('$PKGINFO')\n    pkgchk = env.subst('$PKGCHK')\n\n    for package in ['SPROcpl']:\n        path, version = get_package_info(package, pkginfo, pkgchk)\n        if path and version:\n            cppcPath, cppcVersion = path, version\n            break\n\n    return (cppcPath, 'CC', 'CC', cppcVersion)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SunPRO C++.\"\"\"\n    path, cxx, shcxx, version = get_cppc(env)\n    if path:\n        cxx = os.path.join(path, cxx)\n        shcxx = os.path.join(path, shcxx)\n\n    cplusplus.generate(env)\n\n    env['CXX'] = cxx\n    env['SHCXX'] = shcxx\n    env['CXXVERSION'] = version\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')\n    env['SHOBJPREFIX'] = 'so_'\n    env['SHOBJSUFFIX'] = '.o'\n\n\ndef exists(env):\n    path, cxx, shcxx, version = get_cppc(env)\n    if path and cxx:\n        cppc = os.path.join(path, cxx)\n        if os.path.exists(cppc):\n            return cppc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/sunlink.py",
    "content": "\"\"\"SCons.Tool.sunlink\n\nTool-specific initialization for the Sun Solaris (Forte) linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/sunlink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nfrom . import link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor d in dirs:\n    linker = '/opt/' + d + '/bin/CC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Forte to an Environment.\"\"\"\n    link.generate(env)\n    \n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')\n\n    env['RPATHPREFIX'] = '-R'\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\n    # Support for versioned libraries\n    link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True) \n    env['LINKCALLBACKS'] = link._versioned_lib_callbacks()\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/tar.py",
    "content": "\"\"\"SCons.Tool.tar\n\nTool-specific initialization for tar.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/tar.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\ntars = ['tar', 'gtar']\n\nTarAction = SCons.Action.Action('$TARCOM', '$TARCOMSTR')\n\nTarBuilder = SCons.Builder.Builder(action = TarAction,\n                                   source_factory = SCons.Node.FS.Entry,\n                                   source_scanner = SCons.Defaults.DirScanner,\n                                   suffix = '$TARSUFFIX',\n                                   multi = 1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for tar to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Tar']\n    except KeyError:\n        bld = TarBuilder\n        env['BUILDERS']['Tar'] = bld\n\n    env['TAR']        = env.Detect(tars) or 'gtar'\n    env['TARFLAGS']   = SCons.Util.CLVar('-c')\n    env['TARCOM']     = '$TAR $TARFLAGS -f $TARGET $SOURCES'\n    env['TARSUFFIX']  = '.tar'\n\ndef exists(env):\n    return env.Detect(tars)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/textfile.py",
    "content": "# -*- python -*-\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nTextfile/Substfile builder for SCons.\n\n    Create file 'target' which typically is a textfile.  The 'source'\n    may be any combination of strings, Nodes, or lists of same.  A\n    'linesep' will be put between any part written and defaults to\n    os.linesep.\n\n    The only difference between the Textfile builder and the Substfile\n    builder is that strings are converted to Value() nodes for the\n    former and File() nodes for the latter.  To insert files in the\n    former or strings in the latter, wrap them in a File() or Value(),\n    respectively.\n\n    The values of SUBST_DICT first have any construction variables\n    expanded (its keys are not expanded).  If a value of SUBST_DICT is\n    a python callable function, it is called and the result is expanded\n    as the value.  Values are substituted in a \"random\" order; if any\n    substitution could be further expanded by another substitution, it\n    is unpredictable whether the expansion will occur.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Tool/textfile.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons\n\nimport os\nimport re\n\nfrom SCons.Node import Node\nfrom SCons.Node.Python import Value\nfrom SCons.Util import is_String, is_Sequence, is_Dict, to_bytes, PY3\n\n\nif PY3:\n    TEXTFILE_FILE_WRITE_MODE = 'w'\nelse:\n    TEXTFILE_FILE_WRITE_MODE = 'wb'\n\nLINESEP = '\\n'\n\ndef _do_subst(node, subs):\n    \"\"\"\n    Fetch the node contents and replace all instances of the keys with\n    their values.  For example, if subs is\n        {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'},\n    then all instances of %VERSION% in the file will be replaced with\n    1.2345 and so forth.\n    \"\"\"\n    contents = node.get_text_contents()\n    if subs:\n        for (k, val) in subs:\n            contents = re.sub(k, val, contents)\n\n    if 'b' in TEXTFILE_FILE_WRITE_MODE:\n        try:\n            contents = bytearray(contents, 'utf-8')\n        except UnicodeDecodeError:\n            # contents is already utf-8 encoded python 2 str i.e. a byte array\n            contents = bytearray(contents)\n\n    return contents\n\n\ndef _action(target, source, env):\n\n    # prepare the line separator\n    linesep = env['LINESEPARATOR']\n    if linesep is None:\n        linesep = LINESEP # os.linesep\n    elif is_String(linesep):\n        pass\n    elif isinstance(linesep, Value):\n        linesep = linesep.get_text_contents()\n    else:\n        raise SCons.Errors.UserError('unexpected type/class for LINESEPARATOR: %s'\n                                     % repr(linesep), None)\n\n    if 'b' in TEXTFILE_FILE_WRITE_MODE:\n        linesep = to_bytes(linesep)\n\n    # create a dictionary to use for the substitutions\n    if 'SUBST_DICT' not in env:\n        subs = None    # no substitutions\n    else:\n        subst_dict = env['SUBST_DICT']\n        if is_Dict(subst_dict):\n            subst_dict = list(subst_dict.items())\n        elif is_Sequence(subst_dict):\n            pass\n        else:\n            raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence')\n        subs = []\n        for (k, value) in subst_dict:\n            if callable(value):\n                value = value()\n            if is_String(value):\n                value = env.subst(value)\n            else:\n                value = str(value)\n            subs.append((k, value))\n\n    # write the file\n    try:\n        if SCons.Util.PY3:\n            target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')\n        else:\n            target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE)\n    except (OSError, IOError):\n        raise SCons.Errors.UserError(\"Can't write target file %s\" % target[0])\n\n    # separate lines by 'linesep' only if linesep is not empty\n    lsep = None\n    for line in source:\n        if lsep:\n            target_file.write(lsep)\n\n        target_file.write(_do_subst(line, subs))\n        lsep = linesep\n    target_file.close()\n\n\ndef _strfunc(target, source, env):\n    return \"Creating '%s'\" % target[0]\n\n\ndef _convert_list_R(newlist, sources):\n    for elem in sources:\n        if is_Sequence(elem):\n            _convert_list_R(newlist, elem)\n        elif isinstance(elem, Node):\n            newlist.append(elem)\n        else:\n            newlist.append(Value(elem))\n\n\ndef _convert_list(target, source, env):\n    if len(target) != 1:\n        raise SCons.Errors.UserError(\"Only one target file allowed\")\n    newlist = []\n    _convert_list_R(newlist, source)\n    return target, newlist\n\n\n_common_varlist = ['SUBST_DICT', 'LINESEPARATOR']\n\n_text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']\n_text_builder = SCons.Builder.Builder(\n    action=SCons.Action.Action(_action, _strfunc, varlist=_text_varlist),\n    source_factory=Value,\n    emitter=_convert_list,\n    prefix='$TEXTFILEPREFIX',\n    suffix='$TEXTFILESUFFIX',\n)\n\n_subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'TEXTFILESUFFIX']\n_subst_builder = SCons.Builder.Builder(\n    action=SCons.Action.Action(_action, _strfunc, varlist=_subst_varlist),\n    source_factory=SCons.Node.FS.File,\n    emitter=_convert_list,\n    prefix='$SUBSTFILEPREFIX',\n    suffix='$SUBSTFILESUFFIX',\n    src_suffix=['.in'],\n)\n\n\ndef generate(env):\n    env['LINESEPARATOR'] = LINESEP # os.linesep\n    env['BUILDERS']['Textfile'] = _text_builder\n    env['TEXTFILEPREFIX'] = ''\n    env['TEXTFILESUFFIX'] = '.txt'\n    env['BUILDERS']['Substfile'] = _subst_builder\n    env['SUBSTFILEPREFIX'] = ''\n    env['SUBSTFILESUFFIX'] = ''\n\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/tlib.py",
    "content": "\"\"\"SCons.Tool.tlib\n\nXXX\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/tlib.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    SCons.Tool.bcc32.findIt('tlib', env)\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    env['AR']          = 'tlib'\n    env['ARFLAGS']     = SCons.Util.CLVar('')\n    env['ARCOM']       = '$AR $TARGET $ARFLAGS /a $SOURCES'\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\ndef exists(env):\n    return SCons.Tool.bcc32.findIt('tlib', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/wix.py",
    "content": "\"\"\"SCons.Tool.wix\n\nTool-specific initialization for wix, the Windows Installer XML Tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/wix.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport SCons.Builder\nimport SCons.Action\nimport os\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for WiX to an Environment.\"\"\"\n    if not exists(env):\n      return\n\n    env['WIXCANDLEFLAGS'] = ['-nologo']\n    env['WIXCANDLEINCLUDE'] = []\n    env['WIXCANDLECOM'] = '$WIXCANDLE $WIXCANDLEFLAGS -I $WIXCANDLEINCLUDE -o ${TARGET} ${SOURCE}'\n\n    env['WIXLIGHTFLAGS'].append( '-nologo' )\n    env['WIXLIGHTCOM'] = \"$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}\"\n    env['WIXSRCSUF'] = '.wxs'\n    env['WIXOBJSUF'] = '.wixobj'\n\n    object_builder = SCons.Builder.Builder(\n        action      = '$WIXCANDLECOM',\n        suffix      = '$WIXOBJSUF',\n        src_suffix  = '$WIXSRCSUF')\n\n    linker_builder = SCons.Builder.Builder(\n        action      = '$WIXLIGHTCOM',\n        src_suffix  = '$WIXOBJSUF',\n        src_builder = object_builder)\n\n    env['BUILDERS']['WiX'] = linker_builder\n\ndef exists(env):\n    env['WIXCANDLE'] = 'candle.exe'\n    env['WIXLIGHT']  = 'light.exe'\n\n    # try to find the candle.exe and light.exe tools and \n    # add the install directory to light libpath.\n    for path in os.environ['PATH'].split(os.pathsep):\n        if not path:\n            continue\n\n        # workaround for some weird python win32 bug.\n        if path[0] == '\"' and path[-1:]=='\"':\n            path = path[1:-1]\n\n        # normalize the path\n        path = os.path.normpath(path)\n\n        # search for the tools in the PATH environment variable\n        try:\n            files = os.listdir(path)\n            if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:\n                env.PrependENVPath('PATH', path)\n                # include appropriate flags if running WiX 2.0\n                if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:\n                    env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),\n                                             '-loc',\n                                             os.path.join( path, 'WixUI_en-us.wxl' ) ]\n                else:\n                    env['WIXLIGHTFLAGS'] = []\n                return 1\n        except OSError:\n            pass # ignore this, could be a stale PATH entry.\n\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/xgettext.py",
    "content": "\"\"\" xgettext tool\n\nTool specific initialization of `xgettext` tool.\n\"\"\"\n\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Tool/xgettext.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Action\nimport SCons.Node.FS\nimport SCons.Tool\nimport SCons.Util\nfrom SCons.Builder import BuilderBase\nfrom SCons.Environment import _null\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import _POTargetFactory\nfrom SCons.Tool.GettextCommon import RPaths, _detect_xgettext\nfrom SCons.Tool.GettextCommon import _xgettext_exists\n\n\n#############################################################################\nclass _CmdRunner(object):\n    \"\"\" Callable object, which runs shell command storing its stdout and stderr to\n    variables. It also provides `strfunction()` method, which shall be used by\n    scons Action objects to print command string. \"\"\"\n\n    def __init__(self, command, commandstr=None):\n        self.out = None\n        self.err = None\n        self.status = None\n        self.command = command\n        self.commandstr = commandstr\n\n    def __call__(self, target, source, env):\n        kw = {\n            'stdin': 'devnull',\n            'stdout': subprocess.PIPE,\n            'stderr': subprocess.PIPE,\n            'universal_newlines': True,\n            'shell': True\n        }\n        command = env.subst(self.command, target=target, source=source)\n        proc = SCons.Action._subproc(env, command, **kw)\n        self.out, self.err = proc.communicate()\n        self.status = proc.wait()\n        if self.err:\n            sys.stderr.write(SCons.Util.UnicodeType(self.err))\n        return self.status\n\n    def strfunction(self, target, source, env):\n        comstr = self.commandstr\n        if env.subst(comstr, target=target, source=source) == \"\":\n            comstr = self.command\n        s = env.subst(comstr, target=target, source=source)\n        return s\n\n\n#############################################################################\n\n#############################################################################\ndef _update_pot_file(target, source, env):\n    \"\"\" Action function for `POTUpdate` builder \"\"\"\n    nop = lambda target, source, env: 0\n\n    # Save scons cwd and os cwd (NOTE: they may be different. After the job, we\n    # revert each one to its original state).\n    save_cwd = env.fs.getcwd()\n    save_os_cwd = os.getcwd()\n    chdir = target[0].dir\n    chdir_str = repr(chdir.get_abspath())\n    # Print chdir message (employ SCons.Action.Action for that. It knows better\n    # than me how to to this correctly).\n    env.Execute(SCons.Action.Action(nop, \"Entering \" + chdir_str))\n    # Go to target's directory and do our job\n    env.fs.chdir(chdir, 1)  # Go into target's directory\n    try:\n        cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR')\n        action = SCons.Action.Action(cmd, strfunction=cmd.strfunction)\n        status = action([target[0]], source, env)\n    except:\n        # Something went wrong.\n        env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n        # Revert working dirs to previous state and re-throw exception.\n        env.fs.chdir(save_cwd, 0)\n        os.chdir(save_os_cwd)\n        raise\n    # Print chdir message.\n    env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n    # Revert working dirs to previous state.\n    env.fs.chdir(save_cwd, 0)\n    os.chdir(save_os_cwd)\n    # If the command was not successfull, return error code.\n    if status: return status\n\n    new_content = cmd.out\n\n    if not new_content:\n        # When xgettext finds no internationalized messages, no *.pot is created\n        # (because we don't want to bother translators with empty POT files).\n        needs_update = False\n        explain = \"no internationalized messages encountered\"\n    else:\n        if target[0].exists():\n            # If the file already exists, it's left unaltered unless its messages\n            # are outdated (w.r.t. to these recovered by xgettext from sources).\n            old_content = target[0].get_text_contents()\n            re_cdate = re.compile(r'^\"POT-Creation-Date: .*\"$[\\r\\n]?', re.M)\n            old_content_nocdate = re.sub(re_cdate, \"\", old_content)\n            new_content_nocdate = re.sub(re_cdate, \"\", new_content)\n            if (old_content_nocdate == new_content_nocdate):\n                # Messages are up-to-date\n                needs_update = False\n                explain = \"messages in file found to be up-to-date\"\n            else:\n                # Messages are outdated\n                needs_update = True\n                explain = \"messages in file were outdated\"\n        else:\n            # No POT file found, create new one\n            needs_update = True\n            explain = \"new file\"\n    if needs_update:\n        # Print message employing SCons.Action.Action for that.\n        msg = \"Writing \" + repr(str(target[0])) + \" (\" + explain + \")\"\n        env.Execute(SCons.Action.Action(nop, msg))\n        f = open(str(target[0]), \"w\")\n        f.write(new_content)\n        f.close()\n        return 0\n    else:\n        # Print message employing SCons.Action.Action for that.\n        msg = \"Not writing \" + repr(str(target[0])) + \" (\" + explain + \")\"\n        env.Execute(SCons.Action.Action(nop, msg))\n        return 0\n\n\n#############################################################################\n\n#############################################################################\nclass _POTBuilder(BuilderBase):\n    def _execute(self, env, target, source, *args):\n        if not target:\n            if 'POTDOMAIN' in env and env['POTDOMAIN']:\n                domain = env['POTDOMAIN']\n            else:\n                domain = 'messages'\n            target = [domain]\n        return BuilderBase._execute(self, env, target, source, *args)\n\n\n#############################################################################\n\n#############################################################################\ndef _scan_xgettext_from_files(target, source, env, files=None, path=None):\n    \"\"\" Parses `POTFILES.in`-like file and returns list of extracted file names.\n    \"\"\"\n    if files is None:\n        return 0\n    if not SCons.Util.is_List(files):\n        files = [files]\n\n    if path is None:\n        if 'XGETTEXTPATH' in env:\n            path = env['XGETTEXTPATH']\n        else:\n            path = []\n    if not SCons.Util.is_List(path):\n        path = [path]\n\n    path = SCons.Util.flatten(path)\n\n    dirs = ()\n    for p in path:\n        if not isinstance(p, SCons.Node.FS.Base):\n            if SCons.Util.is_String(p):\n                p = env.subst(p, source=source, target=target)\n            p = env.arg2nodes(p, env.fs.Dir)\n        dirs += tuple(p)\n    # cwd is the default search path (when no path is defined by user)\n    if not dirs:\n        dirs = (env.fs.getcwd(),)\n\n    # Parse 'POTFILE.in' files.\n    re_comment = re.compile(r'^#[^\\n\\r]*$\\r?\\n?', re.M)\n    re_emptyln = re.compile(r'^[ \\t\\r]*$\\r?\\n?', re.M)\n    re_trailws = re.compile(r'[ \\t\\r]+$')\n    for f in files:\n        # Find files in search path $XGETTEXTPATH\n        if isinstance(f, SCons.Node.FS.Base) and f.rexists():\n            contents = f.get_text_contents()\n            contents = re_comment.sub(\"\", contents)\n            contents = re_emptyln.sub(\"\", contents)\n            contents = re_trailws.sub(\"\", contents)\n            depnames = contents.splitlines()\n            for depname in depnames:\n                depfile = SCons.Node.FS.find_file(depname, dirs)\n                if not depfile:\n                    depfile = env.arg2nodes(depname, dirs[0].File)\n                env.Depends(target, depfile)\n    return 0\n\n\n#############################################################################\n\n#############################################################################\ndef _pot_update_emitter(target, source, env):\n    \"\"\" Emitter function for `POTUpdate` builder \"\"\"\n    if 'XGETTEXTFROM' in env:\n        xfrom = env['XGETTEXTFROM']\n    else:\n        return target, source\n    if not SCons.Util.is_List(xfrom):\n        xfrom = [xfrom]\n\n    xfrom = SCons.Util.flatten(xfrom)\n\n    # Prepare list of 'POTFILE.in' files.\n    files = []\n    for xf in xfrom:\n        if not isinstance(xf, SCons.Node.FS.Base):\n            if SCons.Util.is_String(xf):\n                # Interpolate variables in strings\n                xf = env.subst(xf, source=source, target=target)\n            xf = env.arg2nodes(xf)\n        files.extend(xf)\n    if files:\n        env.Depends(target, files)\n        _scan_xgettext_from_files(target, source, env, files)\n    return target, source\n\n\n#############################################################################\n\n#############################################################################\ndef _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n    return env._POTUpdateBuilder(target, source, **kw)\n\n\n#############################################################################\n\n#############################################################################\ndef _POTUpdateBuilder(env, **kw):\n    \"\"\" Creates `POTUpdate` builder object \"\"\"\n    kw['action'] = SCons.Action.Action(_update_pot_file, None)\n    kw['suffix'] = '$POTSUFFIX'\n    kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File\n    kw['emitter'] = _pot_update_emitter\n    return _POTBuilder(**kw)\n\n\n#############################################################################\n\n#############################################################################\ndef generate(env, **kw):\n    \"\"\" Generate `xgettext` tool \"\"\"\n\n    if sys.platform == 'win32':\n        xgettext = SCons.Tool.find_program_path(env, 'xgettext', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n        if xgettext:\n            xgettext_bin_dir = os.path.dirname(xgettext)\n            env.AppendENVPath('PATH', xgettext_bin_dir)\n        else:\n            SCons.Warnings.Warning('xgettext tool requested, but binary not found in ENV PATH')\n    try:\n        env['XGETTEXT'] = _detect_xgettext(env)\n    except:\n        env['XGETTEXT'] = 'xgettext'\n    # NOTE: sources=\"$SOURCES\" would work as well. However, we use following\n    # construction to convert absolute paths provided by scons onto paths\n    # relative to current working dir. Note, that scons expands $SOURCE(S) to\n    # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in\n    # \"../\"). With source=$SOURCE these absolute paths would be written to the\n    # resultant *.pot file (and its derived *.po files) as references to lines in\n    # source code (e.g. referring lines in *.c files). Such references would be\n    # correct (e.g. in poedit) only on machine on which *.pot was generated and\n    # would be of no use on other hosts (having a copy of source code located\n    # in different place in filesystem).\n    sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET' \\\n              + ', SOURCES)} $)'\n\n    # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file.\n    # This is required by the POTUpdate builder's action.\n    xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \\\n                  + ' $_XGETTEXTFROMFLAGS -o - ' + sources\n\n    xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \\\n                        + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)'\n    xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \\\n                        + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)'\n\n    env.SetDefault(\n        _XGETTEXTDOMAIN='${TARGET.filebase}',\n        XGETTEXTFLAGS=[],\n        XGETTEXTCOM=xgettextcom,\n        XGETTEXTCOMSTR='',\n        XGETTEXTPATH=[],\n        XGETTEXTPATHPREFIX='-D',\n        XGETTEXTPATHSUFFIX='',\n        XGETTEXTFROM=None,\n        XGETTEXTFROMPREFIX='-f',\n        XGETTEXTFROMSUFFIX='',\n        _XGETTEXTPATHFLAGS=xgettextpathflags,\n        _XGETTEXTFROMFLAGS=xgettextfromflags,\n        POTSUFFIX=['.pot'],\n        POTUPDATE_ALIAS='pot-update',\n        XgettextRPaths=RPaths(env)\n    )\n    env.Append(BUILDERS={\n        '_POTUpdateBuilder': _POTUpdateBuilder(env)\n    })\n    env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate')\n    env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))\n\n\n#############################################################################\n\n#############################################################################\ndef exists(env):\n    \"\"\" Check, whether the tool exists \"\"\"\n    try:\n        return _xgettext_exists(env)\n    except:\n        return False\n\n#############################################################################\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Tool/zip.py",
    "content": "\"\"\"SCons.Tool.zip\n\nTool-specific initialization for zip.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Tool/zip.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\n\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\nimport zipfile\n\nzipcompression = zipfile.ZIP_DEFLATED\ndef zip(target, source, env):\n    compression = env.get('ZIPCOMPRESSION', 0)\n    zf = zipfile.ZipFile(str(target[0]), 'w', compression)\n    for s in source:\n        if s.isdir():\n            for dirpath, dirnames, filenames in os.walk(str(s)):\n                for fname in filenames:\n                    path = os.path.join(dirpath, fname)\n                    if os.path.isfile(path):\n\n                        zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))\n        else:\n            zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))\n    zf.close()\n\nzipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION'])\n\nZipBuilder = SCons.Builder.Builder(action = SCons.Action.Action('$ZIPCOM', '$ZIPCOMSTR'),\n                                   source_factory = SCons.Node.FS.Entry,\n                                   source_scanner = SCons.Defaults.DirScanner,\n                                   suffix = '$ZIPSUFFIX',\n                                   multi = 1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for zip to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Zip']\n    except KeyError:\n        bld = ZipBuilder\n        env['BUILDERS']['Zip'] = bld\n\n    env['ZIP']        = 'zip'\n    env['ZIPFLAGS']   = SCons.Util.CLVar('')\n    env['ZIPCOM']     = zipAction\n    env['ZIPCOMPRESSION'] =  zipcompression\n    env['ZIPSUFFIX']  = '.zip'\n    env['ZIPROOT']    = SCons.Util.CLVar('')\n\ndef exists(env):\n    return True\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Util.py",
    "content": "\"\"\"SCons.Util\n\nVarious utility functions go here.\n\"\"\"\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Util.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport sys\nimport copy\nimport re\nimport types\nimport codecs\nimport pprint\nimport hashlib\n\nPY3 = sys.version_info[0] == 3\n\ntry:\n    from collections import UserDict, UserList, UserString\nexcept ImportError:\n    from UserDict import UserDict\n    from UserList import UserList\n    from UserString import UserString\n\ntry:\n    from collections.abc import Iterable, MappingView\nexcept ImportError:\n    from collections import Iterable\n\nfrom collections import OrderedDict\n\n# Don't \"from types import ...\" these because we need to get at the\n# types module later to look for UnicodeType.\n\n# Below not used?\n# InstanceType    = types.InstanceType\n\nMethodType      = types.MethodType\nFunctionType    = types.FunctionType\n\ntry:\n    _ = type(unicode)\nexcept NameError:\n    UnicodeType = str\nelse:\n    UnicodeType = unicode\n\ndef dictify(keys, values, result={}):\n    for k, v in zip(keys, values):\n        result[k] = v\n    return result\n\n_altsep = os.altsep\nif _altsep is None and sys.platform == 'win32':\n    # My ActivePython 2.0.1 doesn't set os.altsep!  What gives?\n    _altsep = '/'\nif _altsep:\n    def rightmost_separator(path, sep):\n        return max(path.rfind(sep), path.rfind(_altsep))\nelse:\n    def rightmost_separator(path, sep):\n        return path.rfind(sep)\n\n# First two from the Python Cookbook, just for completeness.\n# (Yeah, yeah, YAGNI...)\ndef containsAny(str, set):\n    \"\"\"Check whether sequence str contains ANY of the items in set.\"\"\"\n    for c in set:\n        if c in str: return 1\n    return 0\n\ndef containsAll(str, set):\n    \"\"\"Check whether sequence str contains ALL of the items in set.\"\"\"\n    for c in set:\n        if c not in str: return 0\n    return 1\n\ndef containsOnly(str, set):\n    \"\"\"Check whether sequence str contains ONLY items in set.\"\"\"\n    for c in str:\n        if c not in set: return 0\n    return 1\n\ndef splitext(path):\n    \"\"\"Same as os.path.splitext() but faster.\"\"\"\n    sep = rightmost_separator(path, os.sep)\n    dot = path.rfind('.')\n    # An ext is only real if it has at least one non-digit char\n    if dot > sep and not containsOnly(path[dot:], \"0123456789.\"):\n        return path[:dot],path[dot:]\n    else:\n        return path,\"\"\n\ndef updrive(path):\n    \"\"\"\n    Make the drive letter (if any) upper case.\n    This is useful because Windows is inconsistent on the case\n    of the drive letter, which can cause inconsistencies when\n    calculating command signatures.\n    \"\"\"\n    drive, rest = os.path.splitdrive(path)\n    if drive:\n        path = drive.upper() + rest\n    return path\n\nclass NodeList(UserList):\n    \"\"\"This class is almost exactly like a regular list of Nodes\n    (actually it can hold any object), with one important difference.\n    If you try to get an attribute from this list, it will return that\n    attribute from every item in the list.  For example:\n\n    >>> someList = NodeList([ '  foo  ', '  bar  ' ])\n    >>> someList.strip()\n    [ 'foo', 'bar' ]\n    \"\"\"\n\n#     def __init__(self, initlist=None):\n#         self.data = []\n# #        print(\"TYPE:%s\"%type(initlist))\n#         if initlist is not None:\n#             # XXX should this accept an arbitrary sequence?\n#             if type(initlist) == type(self.data):\n#                 self.data[:] = initlist\n#             elif isinstance(initlist, (UserList, NodeList)):\n#                 self.data[:] = initlist.data[:]\n#             elif isinstance(initlist, Iterable):\n#                 self.data = list(initlist)\n#             else:\n#                 self.data = [ initlist,]\n\n\n    def __nonzero__(self):\n        return len(self.data) != 0\n\n    def __bool__(self):\n        return self.__nonzero__()\n\n    def __str__(self):\n        return ' '.join(map(str, self.data))\n\n    def __iter__(self):\n        return iter(self.data)\n\n    def __call__(self, *args, **kwargs):\n        result = [x(*args, **kwargs) for x in self.data]\n        return self.__class__(result)\n\n    def __getattr__(self, name):\n        result = [getattr(x, name) for x in self.data]\n        return self.__class__(result)\n\n    def __getitem__(self, index):\n        \"\"\"\n        This comes for free on py2,\n        but py3 slices of NodeList are returning a list\n        breaking slicing nodelist and refering to\n        properties and methods on contained object\n        \"\"\"\n#        return self.__class__(self.data[index])\n\n        if isinstance(index, slice):\n            # Expand the slice object using range()\n            # limited by number of items in self.data\n            indices = index.indices(len(self.data))\n            return self.__class__([self[x] for x in\n                    range(*indices)])\n        else:\n            # Return one item of the tart\n            return self.data[index]\n\n\n_get_env_var = re.compile(r'^\\$([_a-zA-Z]\\w*|{[_a-zA-Z]\\w*})$')\n\ndef get_environment_var(varstr):\n    \"\"\"Given a string, first determine if it looks like a reference\n    to a single environment variable, like \"$FOO\" or \"${FOO}\".\n    If so, return that variable with no decorations (\"FOO\").\n    If not, return None.\"\"\"\n    mo=_get_env_var.match(to_String(varstr))\n    if mo:\n        var = mo.group(1)\n        if var[0] == '{':\n            return var[1:-1]\n        else:\n            return var\n    else:\n        return None\n\nclass DisplayEngine(object):\n    print_it = True\n    def __call__(self, text, append_newline=1):\n        if not self.print_it:\n            return\n        if append_newline: text = text + '\\n'\n        try:\n            sys.stdout.write(UnicodeType(text))\n        except IOError:\n            # Stdout might be connected to a pipe that has been closed\n            # by now. The most likely reason for the pipe being closed\n            # is that the user has press ctrl-c. It this is the case,\n            # then SCons is currently shutdown. We therefore ignore\n            # IOError's here so that SCons can continue and shutdown\n            # properly so that the .sconsign is correctly written\n            # before SCons exits.\n            pass\n\n    def set_mode(self, mode):\n        self.print_it = mode\n\n\ndef render_tree(root, child_func, prune=0, margin=[0], visited=None):\n    \"\"\"\n    Render a tree of nodes into an ASCII tree view.\n\n    :Parameters:\n        - `root`:       the root node of the tree\n        - `child_func`: the function called to get the children of a node\n        - `prune`:      don't visit the same node twice\n        - `margin`:     the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.\n        - `visited`:    a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.\n    \"\"\"\n\n    rname = str(root)\n\n    # Initialize 'visited' dict, if required\n    if visited is None:\n        visited = {}\n\n    children = child_func(root)\n    retval = \"\"\n    for pipe in margin[:-1]:\n        if pipe:\n            retval = retval + \"| \"\n        else:\n            retval = retval + \"  \"\n\n    if rname in visited:\n        return retval + \"+-[\" + rname + \"]\\n\"\n\n    retval = retval + \"+-\" + rname + \"\\n\"\n    if not prune:\n        visited = copy.copy(visited)\n    visited[rname] = 1\n\n    for i in range(len(children)):\n        margin.append(i < len(children)-1)\n        retval = retval + render_tree(children[i], child_func, prune, margin, visited)\n        margin.pop()\n\n    return retval\n\nIDX = lambda N: N and 1 or 0\n\n\ndef print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):\n    \"\"\"\n    Print a tree of nodes.  This is like render_tree, except it prints\n    lines directly instead of creating a string representation in memory,\n    so that huge trees can be printed.\n\n    :Parameters:\n        - `root`       - the root node of the tree\n        - `child_func` - the function called to get the children of a node\n        - `prune`      - don't visit the same node twice\n        - `showtags`   - print status information to the left of each node line\n        - `margin`     - the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.\n        - `visited`    - a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.\n    \"\"\"\n\n    rname = str(root)\n\n\n    # Initialize 'visited' dict, if required\n    if visited is None:\n        visited = {}\n\n    if showtags:\n\n        if showtags == 2:\n            legend = (' E         = exists\\n' +\n                      '  R        = exists in repository only\\n' +\n                      '   b       = implicit builder\\n' +\n                      '   B       = explicit builder\\n' +\n                      '    S      = side effect\\n' +\n                      '     P     = precious\\n' +\n                      '      A    = always build\\n' +\n                      '       C   = current\\n' +\n                      '        N  = no clean\\n' +\n                      '         H = no cache\\n' +\n                      '\\n')\n            sys.stdout.write(legend)\n\n        tags = ['[']\n        tags.append(' E'[IDX(root.exists())])\n        tags.append(' R'[IDX(root.rexists() and not root.exists())])\n        tags.append(' BbB'[[0,1][IDX(root.has_explicit_builder())] +\n                           [0,2][IDX(root.has_builder())]])\n        tags.append(' S'[IDX(root.side_effect)])\n        tags.append(' P'[IDX(root.precious)])\n        tags.append(' A'[IDX(root.always_build)])\n        tags.append(' C'[IDX(root.is_up_to_date())])\n        tags.append(' N'[IDX(root.noclean)])\n        tags.append(' H'[IDX(root.nocache)])\n        tags.append(']')\n\n    else:\n        tags = []\n\n    def MMM(m):\n        return [\"  \",\"| \"][m]\n    margins = list(map(MMM, margin[:-1]))\n\n    children = child_func(root)\n\n    if prune and rname in visited and children:\n        sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + '\\n')\n        return\n\n    sys.stdout.write(''.join(tags + margins + ['+-', rname]) + '\\n')\n\n    visited[rname] = 1\n\n    if children:\n        margin.append(1)\n        idx = IDX(showtags)\n        for C in children[:-1]:\n            print_tree(C, child_func, prune, idx, margin, visited)\n        margin[-1] = 0\n        print_tree(children[-1], child_func, prune, idx, margin, visited)\n        margin.pop()\n\n\n\n# Functions for deciding if things are like various types, mainly to\n# handle UserDict, UserList and UserString like their underlying types.\n#\n# Yes, all of this manual testing breaks polymorphism, and the real\n# Pythonic way to do all of this would be to just try it and handle the\n# exception, but handling the exception when it's not the right type is\n# often too slow.\n\n# We are using the following trick to speed up these\n# functions. Default arguments are used to take a snapshot of\n# the global functions and constants used by these functions. This\n# transforms accesses to global variable into local variables\n# accesses (i.e. LOAD_FAST instead of LOAD_GLOBAL).\n\nDictTypes = (dict, UserDict)\nListTypes = (list, UserList)\n\ntry:\n    # Handle getting dictionary views.\n    SequenceTypes = (list, tuple, UserList, MappingView)\nexcept NameError:\n    SequenceTypes = (list, tuple, UserList)\n\n\n# Note that profiling data shows a speed-up when comparing\n# explicitly with str and unicode instead of simply comparing\n# with basestring. (at least on Python 2.5.1)\ntry:\n    StringTypes = (str, unicode, UserString)\nexcept NameError:\n    StringTypes = (str, UserString)\n\n# Empirically, it is faster to check explicitly for str and\n# unicode than for basestring.\ntry:\n    BaseStringTypes = (str, unicode)\nexcept NameError:\n    BaseStringTypes = (str)\n\ndef is_Dict(obj, isinstance=isinstance, DictTypes=DictTypes):\n    return isinstance(obj, DictTypes)\n\ndef is_List(obj, isinstance=isinstance, ListTypes=ListTypes):\n    return isinstance(obj, ListTypes)\n\ndef is_Sequence(obj, isinstance=isinstance, SequenceTypes=SequenceTypes):\n    return isinstance(obj, SequenceTypes)\n\ndef is_Tuple(obj, isinstance=isinstance, tuple=tuple):\n    return isinstance(obj, tuple)\n\ndef is_String(obj, isinstance=isinstance, StringTypes=StringTypes):\n    return isinstance(obj, StringTypes)\n\ndef is_Scalar(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes):\n    # Profiling shows that there is an impressive speed-up of 2x\n    # when explicitly checking for strings instead of just not\n    # sequence when the argument (i.e. obj) is already a string.\n    # But, if obj is a not string then it is twice as fast to\n    # check only for 'not sequence'. The following code therefore\n    # assumes that the obj argument is a string most of the time.\n    return isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes)\n\ndef do_flatten(sequence, result, isinstance=isinstance,\n               StringTypes=StringTypes, SequenceTypes=SequenceTypes):\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n\ndef flatten(obj, isinstance=isinstance, StringTypes=StringTypes,\n            SequenceTypes=SequenceTypes, do_flatten=do_flatten):\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Flatten() converts either a single scalar or a nested sequence\n    to a non-nested list. Note that flatten() considers strings\n    to be scalars instead of sequences like Python would.\n    \"\"\"\n    if isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes):\n        return [obj]\n    result = []\n    for item in obj:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\ndef flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes,\n                     SequenceTypes=SequenceTypes, do_flatten=do_flatten):\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Same as flatten(), but it does not handle the single scalar\n    case. This is slightly more efficient when one knows that\n    the sequence to flatten can not be a scalar.\n    \"\"\"\n    result = []\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\n# Generic convert-to-string functions that abstract away whether or\n# not the Python we're executing has Unicode support.  The wrapper\n# to_String_for_signature() will use a for_signature() method if the\n# specified object has one.\n#\ndef to_String(s,\n              isinstance=isinstance, str=str,\n              UserString=UserString, BaseStringTypes=BaseStringTypes):\n    if isinstance(s,BaseStringTypes):\n        # Early out when already a string!\n        return s\n    elif isinstance(s, UserString):\n        # s.data can only be either a unicode or a regular\n        # string. Please see the UserString initializer.\n        return s.data\n    else:\n        return str(s)\n\ndef to_String_for_subst(s,\n                        isinstance=isinstance, str=str, to_String=to_String,\n                        BaseStringTypes=BaseStringTypes, SequenceTypes=SequenceTypes,\n                        UserString=UserString):\n\n    # Note that the test cases are sorted by order of probability.\n    if isinstance(s, BaseStringTypes):\n        return s\n    elif isinstance(s, SequenceTypes):\n        return ' '.join([to_String_for_subst(e) for e in s])\n    elif isinstance(s, UserString):\n        # s.data can only be either a unicode or a regular\n        # string. Please see the UserString initializer.\n        return s.data\n    else:\n        return str(s)\n\ndef to_String_for_signature(obj, to_String_for_subst=to_String_for_subst,\n                            AttributeError=AttributeError):\n    try:\n        f = obj.for_signature\n    except AttributeError:\n        if isinstance(obj, dict):\n            # pprint will output dictionary in key sorted order\n            # with py3.5 the order was randomized. In general depending on dictionary order\n            # which was undefined until py3.6 (where it's by insertion order) was not wise.\n            return pprint.pformat(obj, width=1000000)\n        else:\n            return to_String_for_subst(obj)\n    else:\n        return f()\n\n\n# The SCons \"semi-deep\" copy.\n#\n# This makes separate copies of lists (including UserList objects)\n# dictionaries (including UserDict objects) and tuples, but just copies\n# references to anything else it finds.\n#\n# A special case is any object that has a __semi_deepcopy__() method,\n# which we invoke to create the copy. Currently only used by\n# BuilderDict to actually prevent the copy operation (as invalid on that object).\n#\n# The dispatch table approach used here is a direct rip-off from the\n# normal Python copy module.\n\n_semi_deepcopy_dispatch = d = {}\n\ndef semi_deepcopy_dict(x, exclude = [] ):\n    copy = {}\n    for key, val in x.items():\n        # The regular Python copy.deepcopy() also deepcopies the key,\n        # as follows:\n        #\n        #    copy[semi_deepcopy(key)] = semi_deepcopy(val)\n        #\n        # Doesn't seem like we need to, but we'll comment it just in case.\n        if key not in exclude:\n            copy[key] = semi_deepcopy(val)\n    return copy\nd[dict] = semi_deepcopy_dict\n\ndef _semi_deepcopy_list(x):\n    return list(map(semi_deepcopy, x))\nd[list] = _semi_deepcopy_list\n\ndef _semi_deepcopy_tuple(x):\n    return tuple(map(semi_deepcopy, x))\nd[tuple] = _semi_deepcopy_tuple\n\ndef semi_deepcopy(x):\n    copier = _semi_deepcopy_dispatch.get(type(x))\n    if copier:\n        return copier(x)\n    else:\n        if hasattr(x, '__semi_deepcopy__') and callable(x.__semi_deepcopy__):\n            return x.__semi_deepcopy__()\n        elif isinstance(x, UserDict):\n            return x.__class__(semi_deepcopy_dict(x))\n        elif isinstance(x, UserList):\n            return x.__class__(_semi_deepcopy_list(x))\n\n        return x\n\n\nclass Proxy(object):\n    \"\"\"A simple generic Proxy class, forwarding all calls to\n    subject.  So, for the benefit of the python newbie, what does\n    this really mean?  Well, it means that you can take an object, let's\n    call it 'objA', and wrap it in this Proxy class, with a statement\n    like this\n\n                 proxyObj = Proxy(objA),\n\n    Then, if in the future, you do something like this\n\n                 x = proxyObj.var1,\n\n    since Proxy does not have a 'var1' attribute (but presumably objA does),\n    the request actually is equivalent to saying\n\n                 x = objA.var1\n\n    Inherit from this class to create a Proxy.\n\n    Note that, with new-style classes, this does *not* work transparently\n    for Proxy subclasses that use special .__*__() method names, because\n    those names are now bound to the class, not the individual instances.\n    You now need to know in advance which .__*__() method names you want\n    to pass on to the underlying Proxy object, and specifically delegate\n    their calls like this:\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n\n    def __init__(self, subject):\n        \"\"\"Wrap an object as a Proxy object\"\"\"\n        self._subject = subject\n\n    def __getattr__(self, name):\n        \"\"\"Retrieve an attribute from the wrapped object.  If the named\n           attribute doesn't exist, AttributeError is raised\"\"\"\n        return getattr(self._subject, name)\n\n    def get(self):\n        \"\"\"Retrieve the entire wrapped object\"\"\"\n        return self._subject\n\n    def __eq__(self, other):\n        if issubclass(other.__class__, self._subject.__class__):\n            return self._subject == other\n        return self.__dict__ == other.__dict__\n\nclass Delegate(object):\n    \"\"\"A Python Descriptor class that delegates attribute fetches\n    to an underlying wrapped subject of a Proxy.  Typical use:\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n    def __init__(self, attribute):\n        self.attribute = attribute\n    def __get__(self, obj, cls):\n        if isinstance(obj, cls):\n            return getattr(obj._subject, self.attribute)\n        else:\n            return self\n\n# attempt to load the windows registry module:\ncan_read_reg = 0\ntry:\n    import winreg\n\n    can_read_reg = 1\n    hkey_mod = winreg\n\n    RegOpenKeyEx    = winreg.OpenKeyEx\n    RegEnumKey      = winreg.EnumKey\n    RegEnumValue    = winreg.EnumValue\n    RegQueryValueEx = winreg.QueryValueEx\n    RegError        = winreg.error\n\nexcept ImportError:\n    try:\n        import win32api\n        import win32con\n        can_read_reg = 1\n        hkey_mod = win32con\n\n        RegOpenKeyEx    = win32api.RegOpenKeyEx\n        RegEnumKey      = win32api.RegEnumKey\n        RegEnumValue    = win32api.RegEnumValue\n        RegQueryValueEx = win32api.RegQueryValueEx\n        RegError        = win32api.error\n\n    except ImportError:\n        class _NoError(Exception):\n            pass\n        RegError = _NoError\n\n\n# Make sure we have a definition of WindowsError so we can\n# run platform-independent tests of Windows functionality on\n# platforms other than Windows.  (WindowsError is, in fact, an\n# OSError subclass on Windows.)\n\nclass PlainWindowsError(OSError):\n    pass\n\ntry:\n    WinError = WindowsError\nexcept NameError:\n    WinError = PlainWindowsError\n\n\nif can_read_reg:\n    HKEY_CLASSES_ROOT  = hkey_mod.HKEY_CLASSES_ROOT\n    HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE\n    HKEY_CURRENT_USER  = hkey_mod.HKEY_CURRENT_USER\n    HKEY_USERS         = hkey_mod.HKEY_USERS\n\n    def RegGetValue(root, key):\n        r\"\"\"This utility function returns a value in the registry\n        without having to open the key first.  Only available on\n        Windows platforms with a version of Python that can read the\n        registry.  Returns the same thing as\n        SCons.Util.RegQueryValueEx, except you just specify the entire\n        path to the value, and don't have to bother opening the key\n        first.  So:\n\n        Instead of:\n          k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion')\n          out = SCons.Util.RegQueryValueEx(k,\n                'ProgramFilesDir')\n\n        You can write:\n          out = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir')\n        \"\"\"\n        # I would use os.path.split here, but it's not a filesystem\n        # path...\n        p = key.rfind('\\\\') + 1\n        keyp = key[:p-1]          # -1 to omit trailing slash\n        val = key[p:]\n        k = RegOpenKeyEx(root, keyp)\n        return RegQueryValueEx(k,val)\nelse:\n    HKEY_CLASSES_ROOT = None\n    HKEY_LOCAL_MACHINE = None\n    HKEY_CURRENT_USER = None\n    HKEY_USERS = None\n\n    def RegGetValue(root, key):\n        raise WinError\n\n    def RegOpenKeyEx(root, key):\n        raise WinError\n\nif sys.platform == 'win32':\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            try:\n                pathext = os.environ['PATHEXT']\n            except KeyError:\n                pathext = '.COM;.EXE;.BAT;.CMD'\n        if is_String(pathext):\n            pathext = pathext.split(os.pathsep)\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for dir in path:\n            f = os.path.join(dir, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelif os.name == 'os2':\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            pathext = ['.exe', '.cmd']\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for dir in path:\n            f = os.path.join(dir, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelse:\n\n    def WhereIs(file, path=None, pathext=None, reject=[]):\n        import stat\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for d in path:\n            f = os.path.join(d, file)\n            if os.path.isfile(f):\n                try:\n                    st = os.stat(f)\n                except OSError:\n                    # os.stat() raises OSError, not IOError if the file\n                    # doesn't exist, so in this case we let IOError get\n                    # raised so as to not mask possibly serious disk or\n                    # network issues.\n                    continue\n                if stat.S_IMODE(st[stat.ST_MODE]) & 0o111:\n                    try:\n                        reject.index(f)\n                    except ValueError:\n                        return os.path.normpath(f)\n                    continue\n        return None\n\ndef PrependPath(oldpath, newpath, sep = os.pathsep,\n                delete_existing=1, canonicalize=None):\n    \"\"\"This prepends newpath elements to the given oldpath.  Will only\n    add any particular path once (leaving the first one it encounters\n    and ignoring the rest, to preserve path order), and will\n    os.path.normpath and os.path.normcase all paths to help assure\n    this.  This can also handle the case where the given old path\n    variable is a list instead of a string, in which case a list will\n    be returned instead of a string.\n\n    Example:\n      Old Path: \"/foo/bar:/foo\"\n      New Path: \"/biz/boom:/foo\"\n      Result:   \"/biz/boom:/foo:/foo/bar\"\n\n    If delete_existing is 0, then adding a path that exists will\n    not move it to the beginning; it will stay where it is in the\n    list.\n\n    If canonicalize is not None, it is applied to each element of\n    newpath before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = 1\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = 0\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [ newpath ]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # First uniquify the old paths, making sure to\n        # preserve the first instance (in Unix/Linux,\n        # the first one wins), and remembering them in normpaths.\n        # Then insert the new paths at the head of the list\n        # if they're not already in the normpaths list.\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        newpaths.reverse()      # since we're inserting at the head\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.insert(0, path)\n                normpaths.append(normpath)\n        paths = result\n\n    else:\n        newpaths = newpaths + paths # prepend new paths\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and normpath not in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n\n    if is_list:\n        return paths\n    else:\n        return sep.join(paths)\n\ndef AppendPath(oldpath, newpath, sep = os.pathsep,\n               delete_existing=1, canonicalize=None):\n    \"\"\"This appends new path elements to the given old path.  Will\n    only add any particular path once (leaving the last one it\n    encounters and ignoring the rest, to preserve path order), and\n    will os.path.normpath and os.path.normcase all paths to help\n    assure this.  This can also handle the case where the given old\n    path variable is a list instead of a string, in which case a list\n    will be returned instead of a string.\n\n    Example:\n      Old Path: \"/foo/bar:/foo\"\n      New Path: \"/biz/boom:/foo\"\n      Result:   \"/foo/bar:/biz/boom:/foo\"\n\n    If delete_existing is 0, then adding a path that exists\n    will not move it to the end; it will stay where it is in the list.\n\n    If canonicalize is not None, it is applied to each element of\n    newpath before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = 1\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = 0\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [ newpath ]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # add old paths to result, then\n        # add new paths if not already present\n        # (I thought about using a dict for normpaths for speed,\n        # but it's not clear hashing the strings would be faster\n        # than linear searching these typically short lists.)\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            result.append(path)\n            normpaths.append(os.path.normpath(os.path.normcase(path)))\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        paths = result\n    else:\n        # start w/ new paths, add old ones if not present,\n        # then reverse.\n        newpaths = paths + newpaths # append new paths\n        newpaths.reverse()\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and normpath not in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n        paths.reverse()\n\n    if is_list:\n        return paths\n    else:\n        return sep.join(paths)\n\ndef AddPathIfNotExists(env_dict, key, path, sep=os.pathsep):\n    \"\"\"This function will take 'key' out of the dictionary\n    'env_dict', then add the path 'path' to that key if it is not\n    already there.  This treats the value of env_dict[key] as if it\n    has a similar format to the PATH variable...a list of paths\n    separated by tokens.  The 'path' will get added to the list if it\n    is not already there.\"\"\"\n    try:\n        is_list = 1\n        paths = env_dict[key]\n        if not is_List(env_dict[key]):\n            paths = paths.split(sep)\n            is_list = 0\n        if os.path.normcase(path) not in list(map(os.path.normcase, paths)):\n            paths = [ path ] + paths\n        if is_list:\n            env_dict[key] = paths\n        else:\n            env_dict[key] = sep.join(paths)\n    except KeyError:\n        env_dict[key] = path\n\nif sys.platform == 'cygwin':\n    def get_native_path(path):\n        \"\"\"Transforms an absolute path into a native path for the system.  In\n        Cygwin, this converts from a Cygwin path to a Windows one.\"\"\"\n        with os.popen('cygpath -w ' + path) as p:\n            npath = p.read().replace('\\n', '')\n        return npath\nelse:\n    def get_native_path(path):\n        \"\"\"Transforms an absolute path into a native path for the system.\n        Non-Cygwin version, just leave the path alone.\"\"\"\n        return path\n\ndisplay = DisplayEngine()\n\ndef Split(arg):\n    if is_List(arg) or is_Tuple(arg):\n        return arg\n    elif is_String(arg):\n        return arg.split()\n    else:\n        return [arg]\n\nclass CLVar(UserList):\n    \"\"\"A class for command-line construction variables.\n\n    This is a list that uses Split() to split an initial string along\n    white-space arguments, and similarly to split any strings that get\n    added.  This allows us to Do the Right Thing with Append() and\n    Prepend() (as well as straight Python foo = env['VAR'] + 'arg1\n    arg2') regardless of whether a user adds a list or a string to a\n    command-line construction variable.\n    \"\"\"\n    def __init__(self, seq = []):\n        UserList.__init__(self, Split(seq))\n    def __add__(self, other):\n        return UserList.__add__(self, CLVar(other))\n    def __radd__(self, other):\n        return UserList.__radd__(self, CLVar(other))\n    def __str__(self):\n        return ' '.join(self.data)\n\n\nclass Selector(OrderedDict):\n    \"\"\"A callable ordered dictionary that maps file suffixes to\n    dictionary values.  We preserve the order in which items are added\n    so that get_suffix() calls always return the first suffix added.\"\"\"\n    def __call__(self, env, source, ext=None):\n        if ext is None:\n            try:\n                ext = source[0].get_suffix()\n            except IndexError:\n                ext = \"\"\n        try:\n            return self[ext]\n        except KeyError:\n            # Try to perform Environment substitution on the keys of\n            # the dictionary before giving up.\n            s_dict = {}\n            for (k,v) in self.items():\n                if k is not None:\n                    s_k = env.subst(k)\n                    if s_k in s_dict:\n                        # We only raise an error when variables point\n                        # to the same suffix.  If one suffix is literal\n                        # and a variable suffix contains this literal,\n                        # the literal wins and we don't raise an error.\n                        raise KeyError(s_dict[s_k][0], k, s_k)\n                    s_dict[s_k] = (k,v)\n            try:\n                return s_dict[ext][1]\n            except KeyError:\n                try:\n                    return self[None]\n                except KeyError:\n                    return None\n\n\nif sys.platform == 'cygwin':\n    # On Cygwin, os.path.normcase() lies, so just report back the\n    # fact that the underlying Windows OS is case-insensitive.\n    def case_sensitive_suffixes(s1, s2):\n        return 0\nelse:\n    def case_sensitive_suffixes(s1, s2):\n        return (os.path.normcase(s1) != os.path.normcase(s2))\n\ndef adjustixes(fname, pre, suf, ensure_suffix=False):\n    if pre:\n        path, fn = os.path.split(os.path.normpath(fname))\n        if fn[:len(pre)] != pre:\n            fname = os.path.join(path, pre + fn)\n    # Only append a suffix if the suffix we're going to add isn't already\n    # there, and if either we've been asked to ensure the specific suffix\n    # is present or there's no suffix on it at all.\n    if suf and fname[-len(suf):] != suf and \\\n       (ensure_suffix or not splitext(fname)[1]):\n            fname = fname + suf\n    return fname\n\n\n\n# From Tim Peters,\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# (Also in the printed Python Cookbook.)\n\ndef unique(s):\n    \"\"\"Return a list of the elements in s, but without duplicates.\n\n    For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],\n    unique(\"abcabc\") some permutation of [\"a\", \"b\", \"c\"], and\n    unique(([1, 2], [2, 3], [1, 2])) some permutation of\n    [[2, 3], [1, 2]].\n\n    For best speed, all sequence elements should be hashable.  Then\n    unique() will usually work in linear time.\n\n    If not possible, the sequence elements should enjoy a total\n    ordering, and if list(s).sort() doesn't raise TypeError it's\n    assumed that they do enjoy a total ordering.  Then unique() will\n    usually work in O(N*log2(N)) time.\n\n    If that's not possible either, the sequence elements must support\n    equality-testing.  Then unique() will usually work in quadratic\n    time.\n    \"\"\"\n\n    n = len(s)\n    if n == 0:\n        return []\n\n    # Try using a dict first, as that's the fastest and will usually\n    # work.  If it doesn't work, it will usually fail quickly, so it\n    # usually doesn't cost much to *try* it.  It requires that all the\n    # sequence elements be hashable, and support equality comparison.\n    u = {}\n    try:\n        for x in s:\n            u[x] = 1\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        return list(u.keys())\n    del u\n\n    # We can't hash all the elements.  Second fastest is to sort,\n    # which brings the equal elements together; then duplicates are\n    # easy to weed out in a single pass.\n    # NOTE:  Python's list.sort() was designed to be efficient in the\n    # presence of many duplicate elements.  This isn't true of all\n    # sort functions in all languages or libraries, so this approach\n    # is more effective in Python than it may be elsewhere.\n    try:\n        t = sorted(s)\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        assert n > 0\n        last = t[0]\n        lasti = i = 1\n        while i < n:\n            if t[i] != last:\n                t[lasti] = last = t[i]\n                lasti = lasti + 1\n            i = i + 1\n        return t[:lasti]\n    del t\n\n    # Brute force is all that's left.\n    u = []\n    for x in s:\n        if x not in u:\n            u.append(x)\n    return u\n\n\n\n# From Alex Martelli,\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# First comment, dated 2001/10/13.\n# (Also in the printed Python Cookbook.)\n# This not currently used, in favor of the next function...\n\ndef uniquer(seq, idfun=None):\n    def default_idfun(x):\n        return x\n    if not idfun:\n        idfun = default_idfun\n    seen = {}\n    result = []\n    for item in seq:\n        marker = idfun(item)\n        # in old Python versions:\n        # if seen.has_key(marker)\n        # but in new ones:\n        if marker in seen: continue\n        seen[marker] = 1\n        result.append(item)\n    return result\n\n# A more efficient implementation of Alex's uniquer(), this avoids the\n# idfun() argument and function-call overhead by assuming that all\n# items in the sequence are hashable.\n\ndef uniquer_hashables(seq):\n    seen = {}\n    result = []\n    for item in seq:\n        #if not item in seen:\n        if item not in seen:\n            seen[item] = 1\n            result.append(item)\n    return result\n\n\n# Recipe 19.11 \"Reading Lines with Continuation Characters\",\n# by Alex Martelli, straight from the Python CookBook (2nd edition).\ndef logical_lines(physical_lines, joiner=''.join):\n    logical_line = []\n    for line in physical_lines:\n        stripped = line.rstrip()\n        if stripped.endswith('\\\\'):\n            # a line which continues w/the next physical line\n            logical_line.append(stripped[:-1])\n        else:\n            # a line which does not continue, end of logical line\n            logical_line.append(line)\n            yield joiner(logical_line)\n            logical_line = []\n    if logical_line:\n        # end of sequence implies end of last logical line\n        yield joiner(logical_line)\n\n\nclass LogicalLines(object):\n    \"\"\" Wrapper class for the logical_lines method.\n\n        Allows us to read all \"logical\" lines at once from a\n        given file object.\n    \"\"\"\n\n    def __init__(self, fileobj):\n        self.fileobj = fileobj\n\n    def readlines(self):\n        result = [l for l in logical_lines(self.fileobj)]\n        return result\n\n\nclass UniqueList(UserList):\n    def __init__(self, seq = []):\n        UserList.__init__(self, seq)\n        self.unique = True\n    def __make_unique(self):\n        if not self.unique:\n            self.data = uniquer_hashables(self.data)\n            self.unique = True\n    def __lt__(self, other):\n        self.__make_unique()\n        return UserList.__lt__(self, other)\n    def __le__(self, other):\n        self.__make_unique()\n        return UserList.__le__(self, other)\n    def __eq__(self, other):\n        self.__make_unique()\n        return UserList.__eq__(self, other)\n    def __ne__(self, other):\n        self.__make_unique()\n        return UserList.__ne__(self, other)\n    def __gt__(self, other):\n        self.__make_unique()\n        return UserList.__gt__(self, other)\n    def __ge__(self, other):\n        self.__make_unique()\n        return UserList.__ge__(self, other)\n    def __cmp__(self, other):\n        self.__make_unique()\n        return UserList.__cmp__(self, other)\n    def __len__(self):\n        self.__make_unique()\n        return UserList.__len__(self)\n    def __getitem__(self, i):\n        self.__make_unique()\n        return UserList.__getitem__(self, i)\n    def __setitem__(self, i, item):\n        UserList.__setitem__(self, i, item)\n        self.unique = False\n    def __getslice__(self, i, j):\n        self.__make_unique()\n        return UserList.__getslice__(self, i, j)\n    def __setslice__(self, i, j, other):\n        UserList.__setslice__(self, i, j, other)\n        self.unique = False\n    def __add__(self, other):\n        result = UserList.__add__(self, other)\n        result.unique = False\n        return result\n    def __radd__(self, other):\n        result = UserList.__radd__(self, other)\n        result.unique = False\n        return result\n    def __iadd__(self, other):\n        result = UserList.__iadd__(self, other)\n        result.unique = False\n        return result\n    def __mul__(self, other):\n        result = UserList.__mul__(self, other)\n        result.unique = False\n        return result\n    def __rmul__(self, other):\n        result = UserList.__rmul__(self, other)\n        result.unique = False\n        return result\n    def __imul__(self, other):\n        result = UserList.__imul__(self, other)\n        result.unique = False\n        return result\n    def append(self, item):\n        UserList.append(self, item)\n        self.unique = False\n    def insert(self, i):\n        UserList.insert(self, i)\n        self.unique = False\n    def count(self, item):\n        self.__make_unique()\n        return UserList.count(self, item)\n    def index(self, item):\n        self.__make_unique()\n        return UserList.index(self, item)\n    def reverse(self):\n        self.__make_unique()\n        UserList.reverse(self)\n    def sort(self, *args, **kwds):\n        self.__make_unique()\n        return UserList.sort(self, *args, **kwds)\n    def extend(self, other):\n        UserList.extend(self, other)\n        self.unique = False\n\n\nclass Unbuffered(object):\n    \"\"\"\n    A proxy class that wraps a file object, flushing after every write,\n    and delegating everything else to the wrapped object.\n    \"\"\"\n    def __init__(self, file):\n        self.file = file\n        self.softspace = 0  ## backward compatibility; not supported in Py3k\n    def write(self, arg):\n        try:\n            self.file.write(arg)\n            self.file.flush()\n        except IOError:\n            # Stdout might be connected to a pipe that has been closed\n            # by now. The most likely reason for the pipe being closed\n            # is that the user has press ctrl-c. It this is the case,\n            # then SCons is currently shutdown. We therefore ignore\n            # IOError's here so that SCons can continue and shutdown\n            # properly so that the .sconsign is correctly written\n            # before SCons exits.\n            pass\n    def __getattr__(self, attr):\n        return getattr(self.file, attr)\n\ndef make_path_relative(path):\n    \"\"\" makes an absolute path name to a relative pathname.\n    \"\"\"\n    if os.path.isabs(path):\n        drive_s,path = os.path.splitdrive(path)\n\n        import re\n        if not drive_s:\n            path=re.compile(\"/*(.*)\").findall(path)[0]\n        else:\n            path=path[1:]\n\n    assert( not os.path.isabs( path ) ), path\n    return path\n\n\n\n# The original idea for AddMethod() and RenameFunction() come from the\n# following post to the ActiveState Python Cookbook:\n#\n#   ASPN: Python Cookbook : Install bound methods in an instance\n#   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613\n#\n# That code was a little fragile, though, so the following changes\n# have been wrung on it:\n#\n# * Switched the installmethod() \"object\" and \"function\" arguments,\n#   so the order reflects that the left-hand side is the thing being\n#   \"assigned to\" and the right-hand side is the value being assigned.\n#\n# * Changed explicit type-checking to the \"try: klass = object.__class__\"\n#   block in installmethod() below so that it still works with the\n#   old-style classes that SCons uses.\n#\n# * Replaced the by-hand creation of methods and functions with use of\n#   the \"new\" module, as alluded to in Alex Martelli's response to the\n#   following Cookbook post:\n#\n#   ASPN: Python Cookbook : Dynamically added methods to a class\n#   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732\n\ndef AddMethod(obj, function, name=None):\n    \"\"\"\n    Adds either a bound method to an instance or the function itself (or an unbound method in Python 2) to a class.\n    If name is ommited the name of the specified function\n    is used by default.\n\n    Example::\n\n        a = A()\n        def f(self, x, y):\n        self.z = x + y\n        AddMethod(f, A, \"add\")\n        a.add(2, 4)\n        print(a.z)\n        AddMethod(lambda self, i: self.l[i], a, \"listIndex\")\n        print(a.listIndex(5))\n    \"\"\"\n    if name is None:\n        name = function.__name__\n    else:\n        function = RenameFunction(function, name)\n\n    # Note the Python version checks - WLB\n    # Python 3.3 dropped the 3rd parameter from types.MethodType\n    if hasattr(obj, '__class__') and obj.__class__ is not type:\n        # \"obj\" is an instance, so it gets a bound method.\n        if sys.version_info[:2] > (3, 2):\n            method = MethodType(function, obj)\n        else:\n            method = MethodType(function, obj, obj.__class__)\n    else:\n        # Handle classes\n        method = function\n\n    setattr(obj, name, method)\n\ndef RenameFunction(function, name):\n    \"\"\"\n    Returns a function identical to the specified function, but with\n    the specified name.\n    \"\"\"\n    return FunctionType(function.__code__,\n                        function.__globals__,\n                        name,\n                        function.__defaults__)\n\n\nif hasattr(hashlib, 'md5'):\n    md5 = True\n\n    def MD5signature(s):\n        \"\"\"\n        Generate md5 signature of a string\n\n        :param s: either string or bytes. Normally should be bytes\n        :return: String of hex digits representing the signature\n        \"\"\"\n        m = hashlib.md5()\n\n        try:\n            m.update(to_bytes(s))\n        except TypeError as e:\n            m.update(to_bytes(str(s)))\n\n        return m.hexdigest()\n\n    def MD5filesignature(fname, chunksize=65536):\n        \"\"\"\n        Generate the md5 signature of a file\n\n        :param fname: file to hash\n        :param chunksize: chunk size to read\n        :return: String of Hex digits representing the signature\n        \"\"\"\n        m = hashlib.md5()\n        with open(fname, \"rb\") as f:\n            while True:\n                blck = f.read(chunksize)\n                if not blck:\n                    break\n                m.update(to_bytes(blck))\n        return m.hexdigest()\nelse:\n    # if md5 algorithm not available, just return data unmodified\n    # could add alternative signature scheme here\n    md5 = False\n\n    def MD5signature(s):\n        return str(s)\n\n    def MD5filesignature(fname, chunksize=65536):\n        with open(fname, \"rb\") as f:\n            result = f.read()\n        return result\n\n\ndef MD5collect(signatures):\n    \"\"\"\n    Collects a list of signatures into an aggregate signature.\n\n    signatures - a list of signatures\n    returns - the aggregate signature\n    \"\"\"\n    if len(signatures) == 1:\n        return signatures[0]\n    else:\n        return MD5signature(', '.join(signatures))\n\n\ndef silent_intern(x):\n    \"\"\"\n    Perform sys.intern() on the passed argument and return the result.\n    If the input is ineligible (e.g. a unicode string) the original argument is\n    returned and no exception is thrown.\n    \"\"\"\n    try:\n        return sys.intern(x)\n    except TypeError:\n        return x\n\n\n\n# From Dinu C. Gherman,\n# Python Cookbook, second edition, recipe 6.17, p. 277.\n# Also:\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/68205\n# ASPN: Python Cookbook: Null Object Design Pattern\n\n#TODO??? class Null(object):\nclass Null(object):\n    \"\"\" Null objects always and reliably \"do nothing.\" \"\"\"\n    def __new__(cls, *args, **kwargs):\n        if '_instance' not in vars(cls):\n            cls._instance = super(Null, cls).__new__(cls, *args, **kwargs)\n        return cls._instance\n    def __init__(self, *args, **kwargs):\n        pass\n    def __call__(self, *args, **kwargs):\n        return self\n    def __repr__(self):\n        return \"Null(0x%08X)\" % id(self)\n    def __nonzero__(self):\n        return False\n    def __bool__(self):\n        return False\n    def __getattr__(self, name):\n        return self\n    def __setattr__(self, name, value):\n        return self\n    def __delattr__(self, name):\n        return self\n\nclass NullSeq(Null):\n    def __len__(self):\n        return 0\n    def __iter__(self):\n        return iter(())\n    def __getitem__(self, i):\n        return self\n    def __delitem__(self, i):\n        return self\n    def __setitem__(self, i, v):\n        return self\n\n\ndel __revision__\n\n\ndef to_bytes(s):\n    if s is None:\n        return b'None'\n    if not PY3 and isinstance(s, UnicodeType):\n        # PY2, must encode unicode\n        return bytearray(s, 'utf-8')\n    if isinstance (s, (bytes, bytearray)) or bytes is str:\n        # Above case not covered here as py2 bytes and strings are the same\n        return s\n    return bytes(s, 'utf-8')\n\n\ndef to_str(s):\n    if s is None:\n        return 'None'\n    if bytes is str or is_String(s):\n        return s\n    return str (s, 'utf-8')\n\n\ndef cmp(a, b):\n    \"\"\"\n    Define cmp because it's no longer available in python3\n    Works under python 2 as well\n    \"\"\"\n    return (a > b) - (a < b)\n\n\ndef get_env_bool(env, name, default=False):\n    \"\"\"Get a value of env[name] converted to boolean. The value of env[name] is\n    interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and\n    anything convertible to int that yields non-zero integer are True values;\n    '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For\n    all other cases, default value is returned.\n\n    :Parameters:\n        - `env`     - dict or dict-like object, a convainer with variables\n        - `name`    - name of the variable in env to be returned\n        - `default` - returned when env[name] does not exist or can't be converted to bool\n    \"\"\"\n    try:\n        var = env[name]\n    except KeyError:\n        return default\n    try:\n        return bool(int(var))\n    except ValueError:\n        if str(var).lower() in ('true', 'yes', 'y', 'on'):\n            return True\n        elif str(var).lower() in ('false', 'no', 'n', 'off'):\n            return False\n        else:\n            return default\n\n\ndef get_os_env_bool(name, default=False):\n    \"\"\"Same as get_env_bool(os.environ, name, default).\"\"\"\n    return get_env_bool(os.environ, name, default)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/BoolVariable.py",
    "content": "\"\"\"engine.SCons.Variables.BoolVariable\n\nThis file defines the option type for SCons implementing true/false values.\n\nUsage example::\n\n    opts = Variables()\n    opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))\n    ...\n    if env['embedded'] == 1:\n    ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/BoolVariable.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__all__ = ['BoolVariable',]\n\nimport SCons.Errors\n\n__true_strings  = ('y', 'yes', 'true', 't', '1', 'on' , 'all' )\n__false_strings = ('n', 'no', 'false', 'f', '0', 'off', 'none')\n\n\ndef _text2bool(val):\n    \"\"\"\n    Converts strings to True/False depending on the 'truth' expressed by\n    the string. If the string can't be converted, the original value\n    will be returned.\n\n    See '__true_strings' and '__false_strings' for values considered\n    'true' or 'false respectively.\n\n    This is usable as 'converter' for SCons' Variables.\n    \"\"\"\n    lval = val.lower()\n    if lval in __true_strings: return True\n    if lval in __false_strings: return False\n    raise ValueError(\"Invalid value for boolean option: %s\" % val)\n\n\ndef _validator(key, val, env):\n    \"\"\"\n    Validates the given value to be either '0' or '1'.\n    \n    This is usable as 'validator' for SCons' Variables.\n    \"\"\"\n    if not env[key] in (True, False):\n        raise SCons.Errors.UserError(\n            'Invalid value for boolean option %s: %s' % (key, env[key]))\n\n\ndef BoolVariable(key, help, default):\n    \"\"\"\n    The input parameters describe a boolean option, thus they are\n    returned with the correct converter and validator appended. The\n    'help' text will by appended by '(yes|no) to show the valid\n    valued. The result is usable for input to opts.Add().\n    \"\"\"\n    return (key, '%s (yes|no)' % help, default,\n            _validator, _text2bool)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/EnumVariable.py",
    "content": "\"\"\"engine.SCons.Variables.EnumVariable\n\nThis file defines the option type for SCons allowing only specified\ninput-values.\n\nUsage example::\n\n    opts = Variables()\n    opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',\n                      allowed_values=('yes', 'no', 'full'),\n                      map={}, ignorecase=2))\n    ...\n    if env['debug'] == 'full':\n    ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/EnumVariable.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__all__ = ['EnumVariable',]\n\n\nimport SCons.Errors\n\ndef _validator(key, val, env, vals):\n    if val not in vals:\n        raise SCons.Errors.UserError(\n            'Invalid value for option %s: %s.  Valid values are: %s' % (key, val, vals))\n\n\ndef EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):\n    \"\"\"\n    The input parameters describe an option with only certain values\n    allowed. They are returned with an appropriate converter and\n    validator appended. The result is usable for input to\n    Variables.Add().\n\n    'key' and 'default' are the values to be passed on to Variables.Add().\n\n    'help' will be appended by the allowed values automatically\n\n    'allowed_values' is a list of strings, which are allowed as values\n    for this option.\n\n    The 'map'-dictionary may be used for converting the input value\n    into canonical values (e.g. for aliases).\n\n    'ignorecase' defines the behaviour of the validator:\n\n        If ignorecase == 0, the validator/converter are case-sensitive.\n        If ignorecase == 1, the validator/converter are case-insensitive.\n        If ignorecase == 2, the validator/converter is case-insensitive and the converted value will always be lower-case.\n\n    The 'validator' tests whether the value is in the list of allowed values. The 'converter' converts input values\n    according to the given 'map'-dictionary (unmapped input values are returned unchanged).\n    \"\"\"\n\n    help = '%s (%s)' % (help, '|'.join(allowed_values))\n    # define validator\n    if ignorecase >= 1:\n        validator = lambda key, val, env: \\\n                    _validator(key, val.lower(), env, allowed_values)\n    else:\n        validator = lambda key, val, env: \\\n                    _validator(key, val, env, allowed_values)\n    # define converter\n    if ignorecase == 2:\n        converter = lambda val: map.get(val.lower(), val).lower()\n    elif ignorecase == 1:\n        converter = lambda val: map.get(val.lower(), val)\n    else:\n        converter = lambda val: map.get(val, val)\n    return (key, help, default, validator, converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/ListVariable.py",
    "content": "\"\"\"engine.SCons.Variables.ListVariable\n\nThis file defines the option type for SCons implementing 'lists'.\n\nA 'list' option may either be 'all', 'none' or a list of names\nseparated by comma. After the option has been processed, the option\nvalue holds either the named list elements, all list elements or no\nlist elements at all.\n\nUsage example::\n\n    list_of_libs = Split('x11 gl qt ical')\n\n    opts = Variables()\n    opts.Add(ListVariable('shared',\n                      'libraries to build as shared libraries',\n                      'all',\n                      elems = list_of_libs))\n    ...\n    for lib in list_of_libs:\n     if lib in env['shared']:\n         env.SharedObject(...)\n     else:\n         env.Object(...)\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Variables/ListVariable.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n# Known Bug: This should behave like a Set-Type, but does not really,\n# since elements can occur twice.\n\n__all__ = ['ListVariable',]\n\nimport collections\n\nimport SCons.Util\n\n\nclass _ListVariable(collections.UserList):\n    def __init__(self, initlist=[], allowedElems=[]):\n        collections.UserList.__init__(self, [_f for _f in initlist if _f])\n        self.allowedElems = sorted(allowedElems)\n\n    def __cmp__(self, other):\n        return NotImplemented\n    def __eq__(self, other):\n        return NotImplemented\n    def __ge__(self, other):\n        return NotImplemented\n    def __gt__(self, other):\n        return NotImplemented\n    def __le__(self, other):\n        return NotImplemented\n    def __lt__(self, other):\n        return NotImplemented\n    def __str__(self):\n        if len(self) == 0:\n            return 'none'\n        self.data.sort()\n        if self.data == self.allowedElems:\n            return 'all'\n        else:\n            return ','.join(self)\n    def prepare_to_store(self):\n        return self.__str__()\n\ndef _converter(val, allowedElems, mapdict):\n    \"\"\"\n    \"\"\"\n    if val == 'none':\n        val = []\n    elif val == 'all':\n        val = allowedElems\n    else:\n        val = [_f for _f in val.split(',') if _f]\n        val = [mapdict.get(v, v) for v in val]\n        notAllowed = [v for v in val if v not in allowedElems]\n        if notAllowed:\n            raise ValueError(\"Invalid value(s) for option: %s\" %\n                             ','.join(notAllowed))\n    return _ListVariable(val, allowedElems)\n\n\n## def _validator(key, val, env):\n##     \"\"\"\n##     \"\"\"\n##     # todo: write validator for pgk list\n##     return 1\n\n\ndef ListVariable(key, help, default, names, map={}):\n    \"\"\"\n    The input parameters describe a 'package list' option, thus they\n    are returned with the correct converter and validator appended. The\n    result is usable for input to opts.Add() .\n\n    A 'package list' option may either be 'all', 'none' or a list of\n    package names (separated by space).\n    \"\"\"\n    names_str = 'allowed names: %s' % ' '.join(names)\n    if SCons.Util.is_List(default):\n        default = ','.join(default)\n    help = '\\n    '.join(\n        (help, '(all|none|comma-separated list of names)', names_str))\n    return (key, help, default,\n            None, #_validator,\n            lambda val: _converter(val, names, map))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/PackageVariable.py",
    "content": "\"\"\"engine.SCons.Variables.PackageVariable\n\nThis file defines the option type for SCons implementing 'package\nactivation'.\n\nTo be used whenever a 'package' may be enabled/disabled and the\npackage path may be specified.\n\nUsage example:\n\n  Examples:\n      x11=no   (disables X11 support)\n      x11=yes  (will search for the package installation dir)\n      x11=/usr/local/X11 (will check this path for existence)\n\n  To replace autoconf's --with-xxx=yyy ::\n\n      opts = Variables()\n      opts.Add(PackageVariable('x11',\n                             'use X11 installed here (yes = search some places',\n                             'yes'))\n      ...\n      if env['x11'] == True:\n          dir = ... search X11 in some standard places ...\n          env['x11'] = dir\n      if env['x11']:\n          ... build with x11 ...\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/PackageVariable.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__all__ = ['PackageVariable',]\n\nimport SCons.Errors\n\n__enable_strings  = ('1', 'yes', 'true',  'on', 'enable', 'search')\n__disable_strings = ('0', 'no',  'false', 'off', 'disable')\n\ndef _converter(val):\n    \"\"\"\n    \"\"\"\n    lval = val.lower()\n    if lval in __enable_strings: return True\n    if lval in __disable_strings: return False\n    #raise ValueError(\"Invalid value for boolean option: %s\" % val)\n    return val\n\n\ndef _validator(key, val, env, searchfunc):\n    # NB: searchfunc is currently undocumented and unsupported\n    \"\"\"\n    \"\"\"\n    # TODO write validator, check for path\n    import os\n    if env[key] is True:\n        if searchfunc:\n            env[key] = searchfunc(key, val)\n    elif env[key] and not os.path.exists(val):\n        raise SCons.Errors.UserError(\n            'Path does not exist for option %s: %s' % (key, val))\n\n\ndef PackageVariable(key, help, default, searchfunc=None):\n    # NB: searchfunc is currently undocumented and unsupported\n    \"\"\"\n    The input parameters describe a 'package list' option, thus they\n    are returned with the correct converter and validator appended. The\n    result is usable for input to opts.Add() .\n\n    A 'package list' option may either be 'all', 'none' or a list of\n    package names (separated by space).\n    \"\"\"\n    help = '\\n    '.join(\n        (help, '( yes | no | /path/to/%s )' % key))\n    return (key, help, default,\n            lambda k, v, e: _validator(k,v,e,searchfunc),\n            _converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/PathVariable.py",
    "content": "\"\"\"SCons.Variables.PathVariable\n\nThis file defines an option type for SCons implementing path settings.\n\nTo be used whenever a user-specified path override should be allowed.\n\nArguments to PathVariable are:\n  option-name  = name of this option on the command line (e.g. \"prefix\")\n  option-help  = help string for option\n  option-dflt  = default value for this option\n  validator    = [optional] validator for option value.  Predefined validators are:\n\n                     PathAccept -- accepts any path setting; no validation\n                     PathIsDir  -- path must be an existing directory\n                     PathIsDirCreate -- path must be a dir; will create\n                     PathIsFile -- path must be a file\n                     PathExists -- path must exist (any type) [default]\n\n                 The validator is a function that is called and which\n                 should return True or False to indicate if the path\n                 is valid.  The arguments to the validator function\n                 are: (key, val, env).  The key is the name of the\n                 option, the val is the path specified for the option,\n                 and the env is the env to which the Options have been\n                 added.\n\nUsage example::\n\n  Examples:\n      prefix=/usr/local\n\n  opts = Variables()\n\n  opts = Variables()\n  opts.Add(PathVariable('qtdir',\n                        'where the root of Qt is installed',\n                        qtdir, PathIsDir))\n  opts.Add(PathVariable('qt_includes',\n                      'where the Qt includes are installed',\n                      '$qtdir/includes', PathIsDirCreate))\n  opts.Add(PathVariable('qt_libraries',\n                      'where the Qt library is installed',\n                      '$qtdir/lib'))\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/Variables/PathVariable.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__all__ = ['PathVariable',]\n\nimport os\nimport os.path\n\nimport SCons.Errors\n\nclass _PathVariableClass(object):\n\n    def PathAccept(self, key, val, env):\n        \"\"\"Accepts any path, no checking done.\"\"\"\n        pass\n    \n    def PathIsDir(self, key, val, env):\n        \"\"\"Validator to check if Path is a directory.\"\"\"\n        if not os.path.isdir(val):\n            if os.path.isfile(val):\n                m = 'Directory path for option %s is a file: %s'\n            else:\n                m = 'Directory path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def PathIsDirCreate(self, key, val, env):\n        \"\"\"Validator to check if Path is a directory,\n           creating it if it does not exist.\"\"\"\n        if os.path.isfile(val):\n            m = 'Path for option %s is a file, not a directory: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n        if not os.path.isdir(val):\n            os.makedirs(val)\n\n    def PathIsFile(self, key, val, env):\n        \"\"\"Validator to check if Path is a file\"\"\"\n        if not os.path.isfile(val):\n            if os.path.isdir(val):\n                m = 'File path for option %s is a directory: %s'\n            else:\n                m = 'File path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def PathExists(self, key, val, env):\n        \"\"\"Validator to check if Path exists\"\"\"\n        if not os.path.exists(val):\n            m = 'Path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def __call__(self, key, help, default, validator=None):\n        \"\"\"\n        The input parameters describe a 'path list' option, thus they\n        are returned with the correct converter and validator appended. The\n        result is usable for input to opts.Add() .\n\n        The 'default' option specifies the default path to use if the\n        user does not specify an override with this option.\n\n        validator is a validator, see this file for examples\n        \"\"\"\n        if validator is None:\n            validator = self.PathExists\n\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            return (key, '%s ( /path/to/%s )' % (help, key[0]), default,\n                    validator, None)\n        else:\n            return (key, '%s ( /path/to/%s )' % (help, key), default,\n                    validator, None)\n\nPathVariable = _PathVariableClass()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Variables/__init__.py",
    "content": "\"\"\"engine.SCons.Variables\n\nThis file defines the Variables class that is used to add user-friendly\ncustomizable variables to an SCons build.\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"src/engine/SCons/Variables/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os.path\nimport sys\nfrom functools import cmp_to_key\n\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Util\nimport SCons.Warnings\n\nfrom .BoolVariable import BoolVariable  # okay\nfrom .EnumVariable import EnumVariable  # okay\nfrom .ListVariable import ListVariable  # naja\nfrom .PackageVariable import PackageVariable # naja\nfrom .PathVariable import PathVariable # okay\n\n\nclass Variables(object):\n    instance=None\n\n    \"\"\"\n    Holds all the options, updates the environment with the variables,\n    and renders the help text.\n    \"\"\"\n    def __init__(self, files=None, args=None, is_global=1):\n        \"\"\"\n        files - [optional] List of option configuration files to load\n            (backward compatibility) If a single string is passed it is\n                                     automatically placed in a file list\n        \"\"\"\n        # initialize arguments\n        if files is None:\n            files = []\n        if args is None:\n            args = {}\n        self.options = []\n        self.args = args\n        if not SCons.Util.is_List(files):\n            if files:\n                files = [ files ]\n            else:\n                files = []\n        self.files = files\n        self.unknown = {}\n\n        # create the singleton instance\n        if is_global:\n            self=Variables.instance\n\n            if not Variables.instance:\n                Variables.instance=self\n\n    def _do_add(self, key, help=\"\", default=None, validator=None, converter=None):\n        class Variable(object):\n            pass\n\n        option = Variable()\n\n        # if we get a list or a tuple, we take the first element as the\n        # option key and store the remaining in aliases.\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            option.key     = key[0]\n            option.aliases = key[1:]\n        else:\n            option.key     = key\n            option.aliases = [ key ]\n        option.help = help\n        option.default = default\n        option.validator = validator\n        option.converter = converter\n\n        self.options.append(option)\n\n        # options might be added after the 'unknown' dict has been set up,\n        # so we remove the key and all its aliases from that dict\n        for alias in list(option.aliases) + [ option.key ]:\n            if alias in self.unknown:\n                del self.unknown[alias]\n\n    def keys(self):\n        \"\"\"\n        Returns the keywords for the options\n        \"\"\"\n        return [o.key for o in self.options]\n\n    def Add(self, key, help=\"\", default=None, validator=None, converter=None, **kw):\n        \"\"\"\n        Add an option.\n\n\n        @param key: the name of the variable, or a list or tuple of arguments\n        @param help: optional help text for the options\n        @param default: optional default value\n        @param validator: optional function that is called to validate the option's value\n        @type validator: Called with (key, value, environment)\n        @param converter: optional function that is called to convert the option's value before putting it in the environment.\n        \"\"\"\n\n        if SCons.Util.is_List(key) or isinstance(key, tuple):\n            self._do_add(*key)\n            return\n\n        if not SCons.Util.is_String(key) or \\\n            not SCons.Environment.is_valid_construction_var(key):\n                raise SCons.Errors.UserError(\"Illegal Variables.Add() key `%s'\" % str(key))\n\n        self._do_add(key, help, default, validator, converter)\n\n    def AddVariables(self, *optlist):\n        \"\"\"\n        Add a list of options.\n\n        Each list element is a tuple/list of arguments to be passed on\n        to the underlying method for adding options.\n\n        Example::\n\n            opt.AddVariables(\n            ('debug', '', 0),\n            ('CC', 'The C compiler'),\n            ('VALIDATE', 'An option for testing validation', 'notset',\n             validator, None),\n            )\n\n        \"\"\"\n\n        for o in optlist:\n            self._do_add(*o)\n\n\n    def Update(self, env, args=None):\n        \"\"\"\n        Update an environment with the option variables.\n\n        env - the environment to update.\n        \"\"\"\n\n        values = {}\n\n        # first set the defaults:\n        for option in self.options:\n            if option.default is not None:\n                values[option.key] = option.default\n\n        # next set the value specified in the options file\n        for filename in self.files:\n            if os.path.exists(filename):\n                dir = os.path.split(os.path.abspath(filename))[0]\n                if dir:\n                    sys.path.insert(0, dir)\n                try:\n                    values['__name__'] = filename\n                    with open(filename, 'r') as f:\n                        contents = f.read()\n                    exec(contents, {}, values)\n                finally:\n                    if dir:\n                        del sys.path[0]\n                    del values['__name__']\n\n        # set the values specified on the command line\n        if args is None:\n            args = self.args\n\n        for arg, value in args.items():\n            added = False\n            for option in self.options:\n                if arg in list(option.aliases) + [ option.key ]:\n                    values[option.key] = value\n                    added = True\n            if not added:\n                self.unknown[arg] = value\n\n        # put the variables in the environment:\n        # (don't copy over variables that are not declared as options)\n        for option in self.options:\n            try:\n                env[option.key] = values[option.key]\n            except KeyError:\n                pass\n\n        # Call the convert functions:\n        for option in self.options:\n            if option.converter and option.key in values:\n                value = env.subst('${%s}'%option.key)\n                try:\n                    try:\n                        env[option.key] = option.converter(value)\n                    except TypeError:\n                        env[option.key] = option.converter(value, env)\n                except ValueError as x:\n                    raise SCons.Errors.UserError('Error converting option: %s\\n%s'%(option.key, x))\n\n\n        # Finally validate the values:\n        for option in self.options:\n            if option.validator and option.key in values:\n                option.validator(option.key, env.subst('${%s}'%option.key), env)\n\n    def UnknownVariables(self):\n        \"\"\"\n        Returns any options in the specified arguments lists that\n        were not known, declared options in this object.\n        \"\"\"\n        return self.unknown\n\n    def Save(self, filename, env):\n        \"\"\"\n        Saves all the options in the given file.  This file can\n        then be used to load the options next run.  This can be used\n        to create an option cache file.\n\n        filename - Name of the file to save into\n        env - the environment get the option values from\n        \"\"\"\n\n        # Create the file and write out the header\n        try:\n            fh = open(filename, 'w')\n\n            try:\n                # Make an assignment in the file for each option\n                # within the environment that was assigned a value\n                # other than the default.\n                for option in self.options:\n                    try:\n                        value = env[option.key]\n                        try:\n                            prepare = value.prepare_to_store\n                        except AttributeError:\n                            try:\n                                eval(repr(value))\n                            except KeyboardInterrupt:\n                                raise\n                            except:\n                                # Convert stuff that has a repr() that\n                                # cannot be evaluated into a string\n                                value = SCons.Util.to_String(value)\n                        else:\n                            value = prepare()\n\n                        defaultVal = env.subst(SCons.Util.to_String(option.default))\n                        if option.converter:\n                            defaultVal = option.converter(defaultVal)\n\n                        if str(env.subst('${%s}' % option.key)) != str(defaultVal):\n                            fh.write('%s = %s\\n' % (option.key, repr(value)))\n                    except KeyError:\n                        pass\n            finally:\n                fh.close()\n\n        except IOError as x:\n            raise SCons.Errors.UserError('Error writing options to file: %s\\n%s' % (filename, x))\n\n    def GenerateHelpText(self, env, sort=None):\n        \"\"\"\n        Generate the help text for the options.\n\n        env - an environment that is used to get the current values\n              of the options.\n        cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1\n              or a boolean to indicate if it should be sorted.\n        \"\"\"\n\n        if callable(sort):\n            options = sorted(self.options, key=cmp_to_key(lambda x,y: sort(x.key,y.key)))\n        elif sort is True:\n            options = sorted(self.options, key=lambda x: x.key)\n        else:\n            options = self.options\n\n        def format(opt, self=self, env=env):\n            if opt.key in env:\n                actual = env.subst('${%s}' % opt.key)\n            else:\n                actual = None\n            return self.FormatVariableHelpText(env, opt.key, opt.help, opt.default, actual, opt.aliases)\n        lines = [_f for _f in map(format, options) if _f]\n\n        return ''.join(lines)\n\n    format  = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n'\n    format_ = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n    aliases: %s\\n'\n\n    def FormatVariableHelpText(self, env, key, help, default, actual, aliases=[]):\n        # Don't display the key name itself as an alias.\n        aliases = [a for a in aliases if a != key]\n        if len(aliases)==0:\n            return self.format % (key, help, default, actual)\n        else:\n            return self.format_ % (key, help, default, actual, aliases)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Warnings.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\"\"\"SCons.Warnings\n\nThis file implements the warnings framework for SCons.\n\n\"\"\"\n\n__revision__ = \"src/engine/SCons/Warnings.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport sys\n\nimport SCons.Errors\n\nclass Warning(SCons.Errors.UserError):\n    pass\n\nclass WarningOnByDefault(Warning):\n    pass\n\n\n# NOTE:  If you add a new warning class, add it to the man page, too!\nclass TargetNotBuiltWarning(Warning): # Should go to OnByDefault\n    pass\n\nclass CacheVersionWarning(WarningOnByDefault):\n    pass\n\nclass CacheWriteErrorWarning(Warning):\n    pass\n\nclass CorruptSConsignWarning(WarningOnByDefault):\n    pass\n\nclass DependencyWarning(Warning):\n    pass\n\nclass DevelopmentVersionWarning(WarningOnByDefault):\n    pass\n\nclass DuplicateEnvironmentWarning(WarningOnByDefault):\n    pass\n\nclass FutureReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass LinkWarning(WarningOnByDefault):\n    pass\n\nclass MisleadingKeywordsWarning(WarningOnByDefault):\n    pass\n\nclass MissingSConscriptWarning(WarningOnByDefault):\n    pass\n\nclass NoObjectCountWarning(WarningOnByDefault):\n    pass\n\nclass NoParallelSupportWarning(WarningOnByDefault):\n    pass\n\nclass ReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass StackSizeWarning(WarningOnByDefault):\n    pass\n\nclass VisualCMissingWarning(WarningOnByDefault):\n    pass\n\n# Used when MSVC_VERSION and MSVS_VERSION do not point to the\n# same version (MSVS_VERSION is deprecated)\nclass VisualVersionMismatch(WarningOnByDefault):\n    pass\n\nclass VisualStudioMissingWarning(Warning):\n    pass\n\nclass FortranCxxMixWarning(LinkWarning):\n    pass\n\n\n# Deprecation warnings\n\nclass FutureDeprecatedWarning(Warning):\n    pass\n\nclass DeprecatedWarning(Warning):\n    pass\n\nclass MandatoryDeprecatedWarning(DeprecatedWarning):\n    pass\n\n\n# Special case; base always stays DeprecatedWarning\nclass PythonVersionWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedSourceCodeWarning(FutureDeprecatedWarning):\n    pass\n\nclass TaskmasterNeedsExecuteWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedMissingSConscriptWarning(DeprecatedWarning):\n    pass\n\n\n# The below is a list of 2-tuples.  The first element is a class object.\n# The second element is true if that class is enabled, false if it is disabled.\n_enabled = []\n\n# If set, raise the warning as an exception\n_warningAsException = 0\n\n# If not None, a function to call with the warning\n_warningOut = None\n\ndef suppressWarningClass(clazz):\n    \"\"\"Suppresses all warnings that are of type clazz or\n    derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, 0))\n\ndef enableWarningClass(clazz):\n    \"\"\"Enables all warnings that are of type clazz or\n    derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, 1))\n\ndef warningAsException(flag=1):\n    \"\"\"Turn warnings into exceptions.  Returns the old value of the flag.\"\"\"\n    global _warningAsException\n    old = _warningAsException\n    _warningAsException = flag\n    return old\n\ndef warn(clazz, *args):\n    global _enabled, _warningAsException, _warningOut\n\n    warning = clazz(args)\n    for cls, flag in _enabled:\n        if isinstance(warning, cls):\n            if flag:\n                if _warningAsException:\n                    raise warning\n\n                if _warningOut:\n                    _warningOut(warning)\n            break\n\ndef process_warn_strings(arguments):\n    \"\"\"Process requests to enable/disable warnings.\n\n    The requests are strings passed to the --warn option or the\n    SetOption('warn') function.\n\n    An argument to this option should be of the form <warning-class>\n    or no-<warning-class>.  The warning class is munged in order\n    to get an actual class name from the classes above, which we\n    need to pass to the {enable,disable}WarningClass() functions.\n    The supplied <warning-class> is split on hyphens, each element\n    is capitalized, then smushed back together.  Then the string\n    \"Warning\" is appended to get the class name.\n\n    For example, 'deprecated' will enable the DeprecatedWarning\n    class.  'no-dependency' will disable the DependencyWarning class.\n\n    As a special case, --warn=all and --warn=no-all will enable or\n    disable (respectively) the base Warning class of all warnings.\n    \"\"\"\n\n    def _capitalize(s):\n        if s[:5] == \"scons\":\n            return \"SCons\" + s[5:]\n        else:\n            return s.capitalize()\n\n    for arg in arguments:\n\n        elems = arg.lower().split('-')\n        enable = 1\n        if elems[0] == 'no':\n            enable = 0\n            del elems[0]\n\n        if len(elems) == 1 and elems[0] == 'all':\n            class_name = \"Warning\"\n        else:\n            class_name = ''.join(map(_capitalize, elems)) + \"Warning\"\n        try:\n            clazz = globals()[class_name]\n        except KeyError:\n            sys.stderr.write(\"No warning type: '%s'\\n\" % arg)\n        else:\n            if enable:\n                enableWarningClass(clazz)\n            elif issubclass(clazz, MandatoryDeprecatedWarning):\n                fmt = \"Can not disable mandataory warning: '%s'\\n\"\n                sys.stderr.write(fmt % arg)\n            else:\n                suppressWarningClass(clazz)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/__init__.py",
    "content": "\"\"\"SCons\n\nThe main package for the SCons software construction utility.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__version__ = \"3.1.2\"\n\n__build__ = \"bee7caf9defd6e108fc2998a2520ddb36a967691\"\n\n__buildsys__ = \"octodog\"\n\n__date__ = \"2019-12-17 02:07:09\"\n\n__developer__ = \"bdeegan\"\n\n# make sure compatibility is always in place\nimport SCons.compat\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/compat/__init__.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\nSCons compatibility package for old Python versions\n\nThis subpackage holds modules that provide backwards-compatible\nimplementations of various things that we'd like to use in SCons but which\nonly show up in later versions of Python than the early, old version(s)\nwe still support.\n\nOther code will not generally reference things in this package through\nthe SCons.compat namespace.  The modules included here add things to\nthe builtins namespace or the global module list so that the rest\nof our code can use the objects and names imported here regardless of\nPython version.\n\nThe rest of the things here will be in individual compatibility modules\nthat are either: 1) suitably modified copies of the future modules that\nwe want to use; or 2) backwards compatible re-implementations of the\nspecific portions of a future module's API that we want to use.\n\nGENERAL WARNINGS:  Implementations of functions in the SCons.compat\nmodules are *NOT* guaranteed to be fully compliant with these functions in\nlater versions of Python.  We are only concerned with adding functionality\nthat we actually use in SCons, so be wary if you lift this code for\nother uses.  (That said, making these more nearly the same as later,\nofficial versions is still a desirable goal, we just don't need to be\nobsessive about it.)\n\nWe name the compatibility modules with an initial '_scons_' (for example,\n_scons_subprocess.py is our compatibility module for subprocess) so\nthat we can still try to import the real module name and fall back to\nour compatibility module if we get an ImportError.  The import_as()\nfunction defined below loads the module as the \"real\" name (without the\n'_scons'), after which all of the \"import {module}\" statements in the\nrest of our code will find our pre-loaded compatibility module.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/__init__.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nimport os\nimport sys\nimport importlib\n\nPYPY = hasattr(sys, 'pypy_translation_info')\n\n\ndef rename_module(new, old):\n    \"\"\"\n    Attempt to import the old module and load it under the new name.\n    Used for purely cosmetic name changes in Python 3.x.\n    \"\"\"\n    try:\n        sys.modules[new] = importlib.import_module(old)\n        return True\n    except ImportError:\n        return False\n\n\n# TODO: FIXME\n# In 3.x, 'pickle' automatically loads the fast version if available.\nrename_module('pickle', 'cPickle')\n\n# Default pickle protocol. Higher protocols are more efficient/featureful\n# but incompatible with older Python versions. On Python 2.7 this is 2.\n# Negative numbers choose the highest available protocol.\nimport pickle\n\n# Was pickle.HIGHEST_PROTOCOL\n# Changed to 2 so py3.5+'s pickle will be compatible with py2.7.\nPICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL\n\n# TODO: FIXME\n# In 3.x, 'profile' automatically loads the fast version if available.\nrename_module('profile', 'cProfile')\n\n# TODO: FIXME\n# Before Python 3.0, the 'queue' module was named 'Queue'.\nrename_module('queue', 'Queue')\n\n# TODO: FIXME\n# Before Python 3.0, the 'winreg' module was named '_winreg'\nrename_module('winreg', '_winreg')\n\n# Python 3 moved builtin intern() to sys package\n# To make porting easier, make intern always live\n# in sys package (for python 2.7.x)\ntry:\n    sys.intern\nexcept AttributeError:\n    # We must be using python 2.7.x so monkey patch\n    # intern into the sys package\n    sys.intern = intern\n\n# UserDict, UserList, UserString are in # collections for 3.x,\n# but standalone in 2.7.x. Monkey-patch into collections for 2.7.\nimport collections\n\ntry:\n    collections.UserDict\nexcept AttributeError:\n    from UserDict import UserDict as _UserDict\n    collections.UserDict = _UserDict\n    del _UserDict\n\ntry:\n    collections.UserList\nexcept AttributeError:\n    from UserList import UserList as _UserList\n    collections.UserList = _UserList\n    del _UserList\n\ntry:\n    collections.UserString\nexcept AttributeError:\n    from UserString import UserString as _UserString\n    collections.UserString = _UserString\n    del _UserString\n\n\nimport shutil\ntry:\n    shutil.SameFileError\nexcept AttributeError:\n    class SameFileError(Exception):\n        pass\n\n    shutil.SameFileError = SameFileError\n\ndef with_metaclass(meta, *bases):\n    \"\"\"\n    Function from jinja2/_compat.py. License: BSD.\n\n    Use it like this::\n\n        class BaseForm(object):\n            pass\n\n        class FormType(type):\n            pass\n\n        class Form(with_metaclass(FormType, BaseForm)):\n            pass\n\n    This requires a bit of explanation: the basic idea is to make a\n    dummy metaclass for one level of class instantiation that replaces\n    itself with the actual metaclass.  Because of internal type checks\n    we also need to make sure that we downgrade the custom metaclass\n    for one level to something closer to type (that's why __call__ and\n    __init__ comes back from type etc.).\n\n    This has the advantage over six.with_metaclass of not introducing\n    dummy classes into the final MRO.\n    \"\"\"\n\n    class metaclass(meta):\n        __call__ = type.__call__\n        __init__ = type.__init__\n\n        def __new__(cls, name, this_bases, d):\n            if this_bases is None:\n                return type.__new__(cls, name, (), d)\n            return meta(name, bases, d)\n\n    return metaclass('temporary_class', None, {})\n\n\nclass NoSlotsPyPy(type):\n    \"\"\"\n    Workaround for PyPy not working well with __slots__ and __class__ assignment.\n    \"\"\"\n\n    def __new__(meta, name, bases, dct):\n        if PYPY and '__slots__' in dct:\n            dct.pop('__slots__')\n        return super(NoSlotsPyPy, meta).__new__(meta, name, bases, dct)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/compat/_scons_dbm.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__doc__ = \"\"\"\ndbm compatibility module for Python versions that don't have dbm.\n\nThis does not not NOT (repeat, *NOT*) provide complete dbm functionality.\nIt's just a stub on which to hang just enough pieces of dbm functionality\nthat the whichdb.whichdb() implementstation in the various 2.X versions of\nPython won't blow up even if dbm wasn't compiled in.\n\"\"\"\n\n__revision__ = \"src/engine/SCons/compat/_scons_dbm.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\nclass error(Exception):\n    pass\n\ndef open(*args, **kw):\n    raise error()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/cpp.py",
    "content": "#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/cpp.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n__doc__ = \"\"\"\nSCons C Pre-Processor module\n\"\"\"\nimport SCons.compat\n\nimport os\nimport re\n\n#\n# First \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to turn the C preprocessor directives in a file's contents into\n# a list of tuples that we can process easily.\n#\n\n# A table of regular expressions that fetch the arguments from the rest of\n# a C preprocessor line.  Different directives have different arguments\n# that we want to fetch, using the regular expressions to which the lists\n# of preprocessor directives map.\ncpp_lines_dict = {\n    # Fetch the rest of a #if/#elif as one argument,\n    # with white space optional.\n    ('if', 'elif')      : r'\\s*(.+)',\n\n    # Fetch the rest of a #ifdef/#ifndef as one argument,\n    # separated from the keyword by white space.\n    ('ifdef', 'ifndef',): r'\\s+(.+)',\n\n    # Fetch the rest of a #import/#include/#include_next line as one\n    # argument, with white space optional.\n    ('import', 'include', 'include_next',)\n                        : r'\\s*(.+)',\n\n    # We don't care what comes after a #else or #endif line.\n    ('else', 'endif',)  : '',\n\n    # Fetch three arguments from a #define line:\n    #   1) The #defined keyword.\n    #   2) The optional parentheses and arguments (if it's a function-like\n    #      macro, '' if it's not).\n    #   3) The expansion value.\n    ('define',)         : r'\\s+([_A-Za-z][_A-Za-z0-9_]*)(\\([^)]*\\))?\\s*(.*)',\n\n    # Fetch the #undefed keyword from a #undef line.\n    ('undef',)          : r'\\s+([_A-Za-z][A-Za-z0-9_]*)',\n}\n\n# Create a table that maps each individual C preprocessor directive to\n# the corresponding compiled regular expression that fetches the arguments\n# we care about.\nTable = {}\nfor op_list, expr in cpp_lines_dict.items():\n    e = re.compile(expr)\n    for op in op_list:\n        Table[op] = e\ndel e\ndel op\ndel op_list\n\n# Create a list of the expressions we'll use to match all of the\n# preprocessor directives.  These are the same as the directives\n# themselves *except* that we must use a negative lookahead assertion\n# when matching \"if\" so it doesn't match the \"if\" in \"ifdef\" or \"ifndef\".\noverride = {\n    'if'                        : 'if(?!n?def)',\n}\nl = [override.get(x, x) for x in list(Table.keys())]\n\n\n# Turn the list of expressions into one big honkin' regular expression\n# that will match all the preprocessor lines at once.  This will return\n# a list of tuples, one for each preprocessor line.  The preprocessor\n# directive will be the first element in each tuple, and the rest of\n# the line will be the second element.\ne = r'^\\s*#\\s*(' + '|'.join(l) + ')(.*)$'\n\n# And last but not least, compile the expression.\nCPP_Expression = re.compile(e, re.M)\n\n\n\n\n#\n# Second \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to translate a C preprocessor expression (as found on a #if or\n# #elif line) into an equivalent Python expression that we can eval().\n#\n\n# A dictionary that maps the C representation of Boolean operators\n# to their Python equivalents.\nCPP_to_Python_Ops_Dict = {\n    '!'         : ' not ',\n    '!='        : ' != ',\n    '&&'        : ' and ',\n    '||'        : ' or ',\n    '?'         : ' and ',\n    ':'         : ' or ',\n    '\\r'        : '',\n}\n\nCPP_to_Python_Ops_Sub = lambda m: CPP_to_Python_Ops_Dict[m.group(0)]\n\n# We have to sort the keys by length so that longer expressions\n# come *before* shorter expressions--in particular, \"!=\" must\n# come before \"!\" in the alternation.  Without this, the Python\n# re module, as late as version 2.2.2, empirically matches the\n# \"!\" in \"!=\" first, instead of finding the longest match.\n# What's up with that?\nl = sorted(list(CPP_to_Python_Ops_Dict.keys()), key=lambda a: len(a), reverse=True)\n\n# Turn the list of keys into one regular expression that will allow us\n# to substitute all of the operators at once.\nexpr = '|'.join(map(re.escape, l))\n\n# ...and compile the expression.\nCPP_to_Python_Ops_Expression = re.compile(expr)\n\n# A separate list of expressions to be evaluated and substituted\n# sequentially, not all at once.\nCPP_to_Python_Eval_List = [\n    [r'defined\\s+(\\w+)',         '\"\\\\1\" in __dict__'],\n    [r'defined\\s*\\((\\w+)\\)',     '\"\\\\1\" in __dict__'],\n    [r'/\\*.*\\*/',                ''],\n    [r'/\\*.*',                   ''],\n    [r'//.*',                    ''],\n    [r'(0x[0-9A-Fa-f]*)[UL]+',   '\\\\1'],\n]\n\n# Replace the string representations of the regular expressions in the\n# list with compiled versions.\nfor l in CPP_to_Python_Eval_List:\n    l[0] = re.compile(l[0])\n\n# Wrap up all of the above into a handy function.\ndef CPP_to_Python(s):\n    \"\"\"\n    Converts a C pre-processor expression into an equivalent\n    Python expression that can be evaluated.\n    \"\"\"\n    s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)\n    for expr, repl in CPP_to_Python_Eval_List:\n        s = re.sub(expr, repl, s)\n    return s\n\n\n\ndel expr\ndel l\ndel override\n\n\n\nclass FunctionEvaluator(object):\n    \"\"\"\n    Handles delayed evaluation of a #define function call.\n    \"\"\"\n    def __init__(self, name, args, expansion):\n        \"\"\"\n        Squirrels away the arguments and expansion value of a #define\n        macro function for later evaluation when we must actually expand\n        a value that uses it.\n        \"\"\"\n        self.name = name\n        self.args = function_arg_separator.split(args)\n        try:\n            expansion = expansion.split('##')\n        except AttributeError:\n            pass\n        self.expansion = expansion\n    def __call__(self, *values):\n        \"\"\"\n        Evaluates the expansion of a #define macro function called\n        with the specified values.\n        \"\"\"\n        if len(self.args) != len(values):\n            raise ValueError(\"Incorrect number of arguments to `%s'\" % self.name)\n        # Create a dictionary that maps the macro arguments to the\n        # corresponding values in this \"call.\"  We'll use this when we\n        # eval() the expansion so that arguments will get expanded to\n        # the right values.\n        locals = {}\n        for k, v in zip(self.args, values):\n            locals[k] = v\n\n        parts = []\n        for s in self.expansion:\n            if s not in self.args:\n                s = repr(s)\n            parts.append(s)\n        statement = ' + '.join(parts)\n\n        return eval(statement, globals(), locals)\n\n\n\n# Find line continuations.\nline_continuations = re.compile('\\\\\\\\\\r?\\n')\n\n# Search for a \"function call\" macro on an expansion.  Returns the\n# two-tuple of the \"function\" name itself, and a string containing the\n# arguments within the call parentheses.\nfunction_name = re.compile(r'(\\S+)\\(([^)]*)\\)')\n\n# Split a string containing comma-separated function call arguments into\n# the separate arguments.\nfunction_arg_separator = re.compile(r',\\s*')\n\n\n\nclass PreProcessor(object):\n    \"\"\"\n    The main workhorse class for handling C pre-processing.\n    \"\"\"\n    def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0):\n        global Table\n\n        cpppath = tuple(cpppath)\n\n        self.searchpath = {\n            '\"' :       (current,) + cpppath,\n            '<' :       cpppath + (current,),\n        }\n\n        # Initialize our C preprocessor namespace for tracking the\n        # values of #defined keywords.  We use this namespace to look\n        # for keywords on #ifdef/#ifndef lines, and to eval() the\n        # expressions on #if/#elif lines (after massaging them from C to\n        # Python).\n        self.cpp_namespace = dict.copy()\n        self.cpp_namespace['__dict__'] = self.cpp_namespace\n\n        if all:\n           self.do_include = self.all_include\n\n        # For efficiency, a dispatch table maps each C preprocessor\n        # directive (#if, #define, etc.) to the method that should be\n        # called when we see it.  We accomodate state changes (#if,\n        # #ifdef, #ifndef) by pushing the current dispatch table on a\n        # stack and changing what method gets called for each relevant\n        # directive we might see next at this level (#else, #elif).\n        # #endif will simply pop the stack.\n        d = {\n            'scons_current_file'    : self.scons_current_file\n        }\n        for op in list(Table.keys()):\n            d[op] = getattr(self, 'do_' + op)\n        self.default_table = d\n\n    # Controlling methods.\n\n    def tupleize(self, contents):\n        \"\"\"\n        Turns the contents of a file into a list of easily-processed\n        tuples describing the CPP lines in the file.\n\n        The first element of each tuple is the line's preprocessor\n        directive (#if, #include, #define, etc., minus the initial '#').\n        The remaining elements are specific to the type of directive, as\n        pulled apart by the regular expression.\n        \"\"\"\n        global CPP_Expression, Table\n        contents = line_continuations.sub('', contents)\n        cpp_tuples = CPP_Expression.findall(contents)\n        return  [(m[0],) + Table[m[0]].match(m[1]).groups() for m in cpp_tuples]\n\n    def __call__(self, file):\n        \"\"\"\n        Pre-processes a file.\n\n        This is the main public entry point.\n        \"\"\"\n        self.current_file = file\n        return self.process_contents(self.read_file(file), file)\n\n    def process_contents(self, contents, fname=None):\n        \"\"\"\n        Pre-processes a file contents.\n\n        This is the main internal entry point.\n        \"\"\"\n        self.stack = []\n        self.dispatch_table = self.default_table.copy()\n        self.current_file = fname\n        self.tuples = self.tupleize(contents)\n\n        self.initialize_result(fname)\n        while self.tuples:\n            t = self.tuples.pop(0)\n            # Uncomment to see the list of tuples being processed (e.g.,\n            # to validate the CPP lines are being translated correctly).\n            #print(t)\n            self.dispatch_table[t[0]](t)\n        return self.finalize_result(fname)\n\n    # Dispatch table stack manipulation methods.\n\n    def save(self):\n        \"\"\"\n        Pushes the current dispatch table on the stack and re-initializes\n        the current dispatch table to the default.\n        \"\"\"\n        self.stack.append(self.dispatch_table)\n        self.dispatch_table = self.default_table.copy()\n\n    def restore(self):\n        \"\"\"\n        Pops the previous dispatch table off the stack and makes it the\n        current one.\n        \"\"\"\n        try: self.dispatch_table = self.stack.pop()\n        except IndexError: pass\n\n    # Utility methods.\n\n    def do_nothing(self, t):\n        \"\"\"\n        Null method for when we explicitly want the action for a\n        specific preprocessor directive to do nothing.\n        \"\"\"\n        pass\n\n    def scons_current_file(self, t):\n        self.current_file = t[1]\n\n    def eval_expression(self, t):\n        \"\"\"\n        Evaluates a C preprocessor expression.\n\n        This is done by converting it to a Python equivalent and\n        eval()ing it in the C preprocessor namespace we use to\n        track #define values.\n        \"\"\"\n        t = CPP_to_Python(' '.join(t[1:]))\n        try: return eval(t, self.cpp_namespace)\n        except (NameError, TypeError): return 0\n\n    def initialize_result(self, fname):\n        self.result = [fname]\n\n    def finalize_result(self, fname):\n        return self.result[1:]\n\n    def find_include_file(self, t):\n        \"\"\"\n        Finds the #include file for a given preprocessor tuple.\n        \"\"\"\n        fname = t[2]\n        for d in self.searchpath[t[1]]:\n            if d == os.curdir:\n                f = fname\n            else:\n                f = os.path.join(d, fname)\n            if os.path.isfile(f):\n                return f\n        return None\n\n    def read_file(self, file):\n        with open(file) as f:\n            return f.read()\n\n    # Start and stop processing include lines.\n\n    def start_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to start processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates True, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated\n        False.\n\n        \"\"\"\n        d = self.dispatch_table\n        p = self.stack[-1] if self.stack else self.default_table\n\n        for k in ('import', 'include', 'include_next'):\n            d[k] = p[k]\n\n    def stop_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to stop processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates False, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated True.\n        \"\"\"\n        d = self.dispatch_table\n        d['import'] = self.do_nothing\n        d['include'] =  self.do_nothing\n        d['include_next'] =  self.do_nothing\n\n    # Default methods for handling all of the preprocessor directives.\n    # (Note that what actually gets called for a given directive at any\n    # point in time is really controlled by the dispatch_table.)\n\n    def _do_if_else_condition(self, condition):\n        \"\"\"\n        Common logic for evaluating the conditions on #if, #ifdef and\n        #ifndef lines.\n        \"\"\"\n        self.save()\n        d = self.dispatch_table\n        if condition:\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n        else:\n            self.stop_handling_includes()\n            d['elif'] = self.do_elif\n            d['else'] = self.start_handling_includes\n\n    def do_ifdef(self, t):\n        \"\"\"\n        Default handling of a #ifdef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] in self.cpp_namespace)\n\n    def do_ifndef(self, t):\n        \"\"\"\n        Default handling of a #ifndef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] not in self.cpp_namespace)\n\n    def do_if(self, t):\n        \"\"\"\n        Default handling of a #if line.\n        \"\"\"\n        self._do_if_else_condition(self.eval_expression(t))\n\n    def do_elif(self, t):\n        \"\"\"\n        Default handling of a #elif line.\n        \"\"\"\n        d = self.dispatch_table\n        if self.eval_expression(t):\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n\n    def do_else(self, t):\n        \"\"\"\n        Default handling of a #else line.\n        \"\"\"\n        pass\n\n    def do_endif(self, t):\n        \"\"\"\n        Default handling of a #endif line.\n        \"\"\"\n        self.restore()\n\n    def do_define(self, t):\n        \"\"\"\n        Default handling of a #define line.\n        \"\"\"\n        _, name, args, expansion = t\n        try:\n            expansion = int(expansion)\n        except (TypeError, ValueError):\n            pass\n        if args:\n            evaluator = FunctionEvaluator(name, args[1:-1], expansion)\n            self.cpp_namespace[name] = evaluator\n        else:\n            self.cpp_namespace[name] = expansion\n\n    def do_undef(self, t):\n        \"\"\"\n        Default handling of a #undef line.\n        \"\"\"\n        try: del self.cpp_namespace[t[1]]\n        except KeyError: pass\n\n    def do_import(self, t):\n        \"\"\"\n        Default handling of a #import line.\n        \"\"\"\n        # XXX finish this -- maybe borrow/share logic from do_include()...?\n        pass\n\n    def do_include(self, t):\n        \"\"\"\n        Default handling of a #include line.\n        \"\"\"\n        t = self.resolve_include(t)\n        include_file = self.find_include_file(t)\n        if include_file:\n            #print(\"include_file =\", include_file)\n            self.result.append(include_file)\n            contents = self.read_file(include_file)\n            new_tuples = [('scons_current_file', include_file)] + \\\n                         self.tupleize(contents) + \\\n                         [('scons_current_file', self.current_file)]\n            self.tuples[:] = new_tuples + self.tuples\n\n    # Date: Tue, 22 Nov 2005 20:26:09 -0500\n    # From: Stefan Seefeld <seefeld@sympatico.ca>\n    #\n    # By the way, #include_next is not the same as #include. The difference\n    # being that #include_next starts its search in the path following the\n    # path that let to the including file. In other words, if your system\n    # include paths are ['/foo', '/bar'], and you are looking at a header\n    # '/foo/baz.h', it might issue an '#include_next <baz.h>' which would\n    # correctly resolve to '/bar/baz.h' (if that exists), but *not* see\n    # '/foo/baz.h' again. See http://www.delorie.com/gnu/docs/gcc/cpp_11.html\n    # for more reasoning.\n    #\n    # I have no idea in what context 'import' might be used.\n\n    # XXX is #include_next really the same as #include ?\n    do_include_next = do_include\n\n    # Utility methods for handling resolution of include files.\n\n    def resolve_include(self, t):\n        \"\"\"Resolve a tuple-ized #include line.\n\n        This handles recursive expansion of values without \"\" or <>\n        surrounding the name until an initial \" or < is found, to handle\n\n                #include FILE\n\n        where FILE is a #define somewhere else.\"\"\"\n\n        s = t[1]\n        while not s[0] in '<\"':\n            #print(\"s =\", s)\n            try:\n                s = self.cpp_namespace[s]\n            except KeyError:\n                m = function_name.search(s)\n                s = self.cpp_namespace[m.group(1)]\n                if callable(s):\n                    args = function_arg_separator.split(m.group(2))\n                    s = s(*args)\n            if not s:\n                return None\n        return (t[0], s[0], s[1:-1])\n\n    def all_include(self, t):\n        \"\"\"\n        \"\"\"\n        self.result.append(self.resolve_include(t))\n\nclass DumbPreProcessor(PreProcessor):\n    \"\"\"A preprocessor that ignores all #if/#elif/#else/#endif directives\n    and just reports back *all* of the #include files (like the classic\n    SCons scanner did).\n\n    This is functionally equivalent to using a regular expression to\n    find all of the #include lines, only slower.  It exists mainly as\n    an example of how the main PreProcessor class can be sub-classed\n    to tailor its behavior.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        PreProcessor.__init__(self, *args, **kw)\n        d = self.default_table\n        for func in ['if', 'elif', 'else', 'endif', 'ifdef', 'ifndef']:\n            d[func] = d[func] = self.do_nothing\n\ndel __revision__\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/dblite.py",
    "content": "# dblite.py module contributed by Ralf W. Grosse-Kunstleve.\n# Extended for Unicode by Steven Knight.\nfrom __future__ import print_function\n\nimport os\nimport pickle\nimport shutil\nimport time\n\nfrom SCons.compat import PICKLE_PROTOCOL\n\nkeep_all_files = 00000\nignore_corrupt_dbfiles = 0\n\n\ndef corruption_warning(filename):\n    print(\"Warning: Discarding corrupt database:\", filename)\n\n\ntry:\n    unicode\nexcept NameError:\n    def is_string(s):\n        return isinstance(s, str)\nelse:\n    def is_string(s):\n        return type(s) in (str, unicode)\n\n\ndef is_bytes(s):\n    return isinstance(s, bytes)\n\n\ntry:\n    unicode('a')\nexcept NameError:\n    def unicode(s):\n        return s\n\ndblite_suffix = '.dblite'\n\n# TODO: Does commenting this out break switching from py2/3?\n# if bytes is not str:\n#     dblite_suffix += '.p3'\ntmp_suffix = '.tmp'\n\n\nclass dblite(object):\n    \"\"\"\n    Squirrel away references to the functions in various modules\n    that we'll use when our __del__() method calls our sync() method\n    during shutdown.  We might get destroyed when Python is in the midst\n    of tearing down the different modules we import in an essentially\n    arbitrary order, and some of the various modules's global attributes\n    may already be wiped out from under us.\n\n    See the discussion at:\n      http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html\n    \"\"\"\n\n    _open = open\n    _pickle_dump = staticmethod(pickle.dump)\n    _pickle_protocol = PICKLE_PROTOCOL\n    _os_chmod = os.chmod\n\n    try:\n        _os_chown = os.chown\n    except AttributeError:\n        _os_chown = None\n\n    _os_rename = os.rename\n    _os_unlink = os.unlink\n    _shutil_copyfile = shutil.copyfile\n    _time_time = time.time\n\n    def __init__(self, file_base_name, flag, mode):\n        assert flag in (None, \"r\", \"w\", \"c\", \"n\")\n        if flag is None:\n            flag = \"r\"\n\n        base, ext = os.path.splitext(file_base_name)\n        if ext == dblite_suffix:\n            # There's already a suffix on the file name, don't add one.\n            self._file_name = file_base_name\n            self._tmp_name = base + tmp_suffix\n        else:\n            self._file_name = file_base_name + dblite_suffix\n            self._tmp_name = file_base_name + tmp_suffix\n\n        self._flag = flag\n        self._mode = mode\n        self._dict = {}\n        self._needs_sync = 00000\n\n        if self._os_chown is not None and (os.geteuid() == 0 or os.getuid() == 0):\n            # running as root; chown back to current owner/group when done\n            try:\n                statinfo = os.stat(self._file_name)\n                self._chown_to = statinfo.st_uid\n                self._chgrp_to = statinfo.st_gid\n            except OSError as e:\n                # db file doesn't exist yet.\n                # Check os.environ for SUDO_UID, use if set\n                self._chown_to = int(os.environ.get('SUDO_UID', -1))\n                self._chgrp_to = int(os.environ.get('SUDO_GID', -1))\n        else:\n            self._chown_to = -1  # don't chown\n            self._chgrp_to = -1  # don't chgrp\n\n        if self._flag == \"n\":\n            with self._open(self._file_name, \"wb\", self._mode):\n                pass  # just make sure it exists\n        else:\n            try:\n                f = self._open(self._file_name, \"rb\")\n            except IOError as e:\n                if self._flag != \"c\":\n                    raise e\n                with self._open(self._file_name, \"wb\", self._mode):\n                    pass  # just make sure it exists\n            else:\n                p = f.read()\n                f.close()\n                if len(p) > 0:\n                    try:\n                        if bytes is not str:\n                            self._dict = pickle.loads(p, encoding='bytes')\n                        else:\n                            self._dict = pickle.loads(p)\n                    except (pickle.UnpicklingError, EOFError, KeyError):\n                        # Note how we catch KeyErrors too here, which might happen\n                        # when we don't have cPickle available (default pickle\n                        # throws it).\n                        if (ignore_corrupt_dbfiles == 0): raise\n                        if (ignore_corrupt_dbfiles == 1):\n                            corruption_warning(self._file_name)\n\n    def close(self):\n        if self._needs_sync:\n            self.sync()\n\n    def __del__(self):\n        self.close()\n\n    def sync(self):\n        self._check_writable()\n        f = self._open(self._tmp_name, \"wb\", self._mode)\n        self._pickle_dump(self._dict, f, self._pickle_protocol)\n        f.close()\n\n        # Windows doesn't allow renaming if the file exists, so unlink\n        # it first, chmod'ing it to make sure we can do so.  On UNIX, we\n        # may not be able to chmod the file if it's owned by someone else\n        # (e.g. from a previous run as root).  We should still be able to\n        # unlink() the file if the directory's writable, though, so ignore\n        # any OSError exception  thrown by the chmod() call.\n        try:\n            self._os_chmod(self._file_name, 0o777)\n        except OSError:\n            pass\n        self._os_unlink(self._file_name)\n        self._os_rename(self._tmp_name, self._file_name)\n        if self._os_chown is not None and self._chown_to > 0:  # don't chown to root or -1\n            try:\n                self._os_chown(self._file_name, self._chown_to, self._chgrp_to)\n            except OSError:\n                pass\n        self._needs_sync = 00000\n        if (keep_all_files):\n            self._shutil_copyfile(\n                self._file_name,\n                self._file_name + \"_\" + str(int(self._time_time())))\n\n    def _check_writable(self):\n        if (self._flag == \"r\"):\n            raise IOError(\"Read-only database: %s\" % self._file_name)\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __setitem__(self, key, value):\n        self._check_writable()\n        if (not is_string(key)):\n            raise TypeError(\"key `%s' must be a string but is %s\" % (key, type(key)))\n        if (not is_bytes(value)):\n            raise TypeError(\"value `%s' must be a bytes but is %s\" % (value, type(value)))\n        self._dict[key] = value\n        self._needs_sync = 0o001\n\n    def keys(self):\n        return list(self._dict.keys())\n\n    def has_key(self, key):\n        return key in self._dict\n\n    def __contains__(self, key):\n        return key in self._dict\n\n    def iterkeys(self):\n        # Wrapping name in () prevents fixer from \"fixing\" this\n        return (self._dict.iterkeys)()\n\n    __iter__ = iterkeys\n\n    def __len__(self):\n        return len(self._dict)\n\n\ndef open(file, flag=None, mode=0o666):\n    return dblite(file, flag, mode)\n\n\ndef _exercise():\n    db = open(\"tmp\", \"n\")\n    assert len(db) == 0\n    db[\"foo\"] = \"bar\"\n    assert db[\"foo\"] == \"bar\"\n    db[unicode(\"ufoo\")] = unicode(\"ubar\")\n    assert db[unicode(\"ufoo\")] == unicode(\"ubar\")\n    db.sync()\n    db = open(\"tmp\", \"c\")\n    assert len(db) == 2, len(db)\n    assert db[\"foo\"] == \"bar\"\n    db[\"bar\"] = \"foo\"\n    assert db[\"bar\"] == \"foo\"\n    db[unicode(\"ubar\")] = unicode(\"ufoo\")\n    assert db[unicode(\"ubar\")] == unicode(\"ufoo\")\n    db.sync()\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 4, len(db)\n    assert db[\"foo\"] == \"bar\"\n    assert db[\"bar\"] == \"foo\"\n    assert db[unicode(\"ufoo\")] == unicode(\"ubar\")\n    assert db[unicode(\"ubar\")] == unicode(\"ufoo\")\n    try:\n        db.sync()\n    except IOError as e:\n        assert str(e) == \"Read-only database: tmp.dblite\"\n    else:\n        raise RuntimeError(\"IOError expected.\")\n    db = open(\"tmp\", \"w\")\n    assert len(db) == 4\n    db[\"ping\"] = \"pong\"\n    db.sync()\n    try:\n        db[(1, 2)] = \"tuple\"\n    except TypeError as e:\n        assert str(e) == \"key `(1, 2)' must be a string but is <type 'tuple'>\", str(e)\n    else:\n        raise RuntimeError(\"TypeError exception expected\")\n    try:\n        db[\"list\"] = [1, 2]\n    except TypeError as e:\n        assert str(e) == \"value `[1, 2]' must be a string but is <type 'list'>\", str(e)\n    else:\n        raise RuntimeError(\"TypeError exception expected\")\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 5\n    db = open(\"tmp\", \"n\")\n    assert len(db) == 0\n    dblite._open(\"tmp.dblite\", \"w\")\n    db = open(\"tmp\", \"r\")\n    dblite._open(\"tmp.dblite\", \"w\").write(\"x\")\n    try:\n        db = open(\"tmp\", \"r\")\n    except pickle.UnpicklingError:\n        pass\n    else:\n        raise RuntimeError(\"pickle exception expected.\")\n    global ignore_corrupt_dbfiles\n    ignore_corrupt_dbfiles = 2\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 0\n    os.unlink(\"tmp.dblite\")\n    try:\n        db = open(\"tmp\", \"w\")\n    except IOError as e:\n        assert str(e) == \"[Errno 2] No such file or directory: 'tmp.dblite'\", str(e)\n    else:\n        raise RuntimeError(\"IOError expected.\")\n\n\nif (__name__ == \"__main__\"):\n    _exercise()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-3.1.2/SCons/exitfuncs.py",
    "content": "\"\"\"SCons.exitfuncs\n\nRegister functions which are executed when SCons exits for any reason.\n\n\"\"\"\n\n#\n# Copyright (c) 2001 - 2019 The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"src/engine/SCons/exitfuncs.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan\"\n\n\nimport atexit\n\n_exithandlers = []\ndef _run_exitfuncs():\n    \"\"\"run any registered exit functions\n\n    _exithandlers is traversed in reverse order so functions are executed\n    last in, first out.\n    \"\"\"\n\n    while _exithandlers:\n        func, targs, kargs =  _exithandlers.pop()\n        func(*targs, **kargs)\n\ndef register(func, *targs, **kargs):\n    \"\"\"register a function to be executed upon normal program termination\n\n    func - function to be called at exit\n    targs - optional arguments to pass to func\n    kargs - optional keyword arguments to pass to func\n    \"\"\"\n    _exithandlers.append((func, targs, kargs))\n\n\n# make our exit function get run by python when it exits\natexit.register(_run_exitfuncs)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons Actions.\n\nInformation about executing any sort of action that\ncan build one or more target Nodes (typically files) from one or more\nsource Nodes (also typically files) given a specific Environment.\n\nThe base class here is ActionBase.  The base class supplies just a few\nutility methods and some generic methods for displaying information\nabout an Action in response to the various commands that control printing.\n\nA second-level base class is _ActionAction.  This extends ActionBase\nby providing the methods that can be used to show and perform an\naction.  True Action objects will subclass _ActionAction; Action\nfactory class objects will subclass ActionBase.\n\nThe heavy lifting is handled by subclasses for the different types of\nactions we might execute:\n\n    CommandAction\n    CommandGeneratorAction\n    FunctionAction\n    ListAction\n\nThe subclasses supply the following public interface methods used by\nother modules:\n\n    __call__()\n        THE public interface, \"calling\" an Action object executes the\n        command or Python function.  This also takes care of printing\n        a pre-substitution command for debugging purposes.\n\n    get_contents()\n        Fetches the \"contents\" of an Action for signature calculation\n        plus the varlist.  This is what gets checksummed to decide\n        if a target needs to be rebuilt because its action changed.\n\n    genstring()\n        Returns a string representation of the Action *without*\n        command substitution, but allows a CommandGeneratorAction to\n        generate the right action based on the specified target,\n        source and env.  This is used by the Signature subsystem\n        (through the Executor) to obtain an (imprecise) representation\n        of the Action operation for informative purposes.\n\n\nSubclasses also supply the following methods for internal use within\nthis module:\n\n    __str__()\n        Returns a string approximation of the Action; no variable\n        substitution is performed.\n\n    execute()\n        The internal method that really, truly, actually handles the\n        execution of a command or Python function.  This is used so\n        that the __call__() methods can take care of displaying any\n        pre-substitution representations, and *then* execute an action\n        without worrying about the specific Actions involved.\n\n    get_presig()\n        Fetches the \"contents\" of a subclass for signature calculation.\n        The varlist is added to this to produce the Action's contents.\n        TODO(?): Change this to always return bytes and not str?\n\n    strfunction()\n        Returns a substituted string representation of the Action.\n        This is used by the _ActionAction.show() command to display the\n        command/function that will be executed to generate the target(s).\n\nThere is a related independent ActionCaller class that looks like a\nregular Action, and which serves as a wrapper for arbitrary functions\nthat we want to let the user specify the arguments to now, but actually\nexecute later (when an out-of-date check determines that it's needed to\nbe executed, for example).  Objects of this class are returned by an\nActionFactory class that provides a __call__() method as a convenient\nway for wrapping up the functions.\n\n\"\"\"\n\nimport os\nimport pickle\nimport re\nimport sys\nimport subprocess\nfrom subprocess import DEVNULL\nimport inspect\nfrom collections import OrderedDict\n\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Errors\nimport SCons.Util\nimport SCons.Subst\n\n# we use these a lot, so try to optimize them\nfrom SCons.Util import is_String, is_List\n\nclass _null:\n    pass\n\nprint_actions = True\nexecute_actions = True\nprint_actions_presub = False\n\n# Use pickle protocol 1 when pickling functions for signature\n# otherwise python3 and python2 will yield different pickles\n# for the same object.\n# This is due to default being 1 for python 2.7, and 3 for 3.x\n# TODO: We can roll this forward to 2 (if it has value), but not\n# before a deprecation cycle as the sconsigns will change\nACTION_SIGNATURE_PICKLE_PROTOCOL = 1\n\n\ndef rfile(n):\n    try:\n        return n.rfile()\n    except AttributeError:\n        return n\n\n\ndef default_exitstatfunc(s):\n    return s\n\nstrip_quotes = re.compile(r'^[\\'\"](.*)[\\'\"]$')\n\n\ndef _callable_contents(obj):\n    \"\"\"Return the signature contents of a callable Python object.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.__func__)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.__func__)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                # Test if obj is a function object.\n                return _function_contents(obj)\n\n\ndef _object_contents(obj):\n    \"\"\"Return the signature contents of any Python object.\n\n    We have to handle the case where object contains a code object\n    since it can be pickled directly.\n    \"\"\"\n    try:\n        # Test if obj is a method.\n        return _function_contents(obj.__func__)\n\n    except AttributeError:\n        try:\n            # Test if obj is a callable object.\n            return _function_contents(obj.__call__.__func__)\n\n        except AttributeError:\n            try:\n                # Test if obj is a code object.\n                return _code_contents(obj)\n\n            except AttributeError:\n                try:\n                    # Test if obj is a function object.\n                    return _function_contents(obj)\n\n                except AttributeError as ae:\n                    # Should be a pickle-able Python object.\n                    try:\n                        return _object_instance_content(obj)\n                        # pickling an Action instance or object doesn't yield a stable\n                        # content as instance property may be dumped in different orders\n                        # return pickle.dumps(obj, ACTION_SIGNATURE_PICKLE_PROTOCOL)\n                    except (pickle.PicklingError, TypeError, AttributeError) as ex:\n                        # This is weird, but it seems that nested classes\n                        # are unpickable. The Python docs say it should\n                        # always be a PicklingError, but some Python\n                        # versions seem to return TypeError.  Just do\n                        # the best we can.\n                        return bytearray(repr(obj), 'utf-8')\n\n\ndef _code_contents(code, docstring=None):\n    r\"\"\"Return the signature contents of a code object.\n\n    By providing direct access to the code object of the\n    function, Python makes this extremely easy.  Hooray!\n\n    Unfortunately, older versions of Python include line\n    number indications in the compiled byte code.  Boo!\n    So we remove the line number byte codes to prevent\n    recompilations from moving a Python function.\n\n    See:\n      - https://docs.python.org/2/library/inspect.html\n      - http://python-reference.readthedocs.io/en/latest/docs/code/index.html\n\n    For info on what each co\\_ variable provides\n\n    The signature is as follows (should be byte/chars):\n    co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars),\n    ( comma separated signature for each object in co_consts ),\n    ( comma separated signature for each object in co_names ),\n    ( The bytecode with line number bytecodes removed from  co_code )\n\n    co_argcount - Returns the number of positional arguments (including arguments with default values).\n    co_varnames - Returns a tuple containing the names of the local variables (starting with the argument names).\n    co_cellvars - Returns a tuple containing the names of local variables that are referenced by nested functions.\n    co_freevars - Returns a tuple containing the names of free variables. (?)\n    co_consts   - Returns a tuple containing the literals used by the bytecode.\n    co_names    - Returns a tuple containing the names used by the bytecode.\n    co_code     - Returns a string representing the sequence of bytecode instructions.\n\n    \"\"\"\n\n    # contents = []\n\n    # The code contents depends on the number of local variables\n    # but not their actual names.\n    contents = bytearray(\"{}, {}\".format(code.co_argcount, len(code.co_varnames)), 'utf-8')\n\n    contents.extend(b\", \")\n    contents.extend(bytearray(str(len(code.co_cellvars)), 'utf-8'))\n    contents.extend(b\", \")\n    contents.extend(bytearray(str(len(code.co_freevars)), 'utf-8'))\n\n    # The code contents depends on any constants accessed by the\n    # function. Note that we have to call _object_contents on each\n    # constants because the code object of nested functions can\n    # show-up among the constants.\n    z = [_object_contents(cc) for cc in code.co_consts if cc != docstring]\n    contents.extend(b',(')\n    contents.extend(bytearray(',', 'utf-8').join(z))\n    contents.extend(b')')\n\n    # The code contents depends on the variable names used to\n    # accessed global variable, as changing the variable name changes\n    # the variable actually accessed and therefore changes the\n    # function result.\n    z= [bytearray(_object_contents(cc)) for cc in code.co_names]\n    contents.extend(b',(')\n    contents.extend(bytearray(',','utf-8').join(z))\n    contents.extend(b')')\n\n    # The code contents depends on its actual code!!!\n    contents.extend(b',(')\n    contents.extend(code.co_code)\n    contents.extend(b')')\n\n    return contents\n\n\ndef _function_contents(func):\n    \"\"\"\n    The signature is as follows (should be byte/chars):\n    < _code_contents (see above) from func.__code__ >\n    ,( comma separated _object_contents for function argument defaults)\n    ,( comma separated _object_contents for any closure contents )\n\n\n    See also: https://docs.python.org/3/reference/datamodel.html\n      - func.__code__     - The code object representing the compiled function body.\n      - func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value\n      - func.__closure__  - None or a tuple of cells that contain bindings for the function's free variables.\n\n    :Returns:\n      Signature contents of a function. (in bytes)\n    \"\"\"\n\n    contents = [_code_contents(func.__code__, func.__doc__)]\n\n    # The function contents depends on the value of defaults arguments\n    if func.__defaults__:\n\n        function_defaults_contents = [_object_contents(cc) for cc in func.__defaults__]\n\n        defaults = bytearray(b',(')\n        defaults.extend(bytearray(b',').join(function_defaults_contents))\n        defaults.extend(b')')\n\n        contents.append(defaults)\n    else:\n        contents.append(b',()')\n\n    # The function contents depends on the closure captured cell values.\n    closure = func.__closure__ or []\n\n    try:\n        closure_contents = [_object_contents(x.cell_contents) for x in closure]\n    except AttributeError:\n        closure_contents = []\n\n    contents.append(b',(')\n    contents.append(bytearray(b',').join(closure_contents))\n    contents.append(b')')\n\n    retval = bytearray(b'').join(contents)\n    return retval\n\n\ndef _object_instance_content(obj):\n    \"\"\"\n    Returns consistant content for a action class or an instance thereof\n\n    :Parameters:\n      - `obj` Should be either and action class or an instance thereof\n\n    :Returns:\n      bytearray or bytes representing the obj suitable for generating a signature from.\n    \"\"\"\n    retval = bytearray()\n\n    if obj is None:\n        return b'N.'\n\n    if isinstance(obj, SCons.Util.BaseStringTypes):\n        return SCons.Util.to_bytes(obj)\n\n    inst_class = obj.__class__\n    inst_class_name = bytearray(obj.__class__.__name__,'utf-8')\n    inst_class_module = bytearray(obj.__class__.__module__,'utf-8')\n    inst_class_hierarchy = bytearray(repr(inspect.getclasstree([obj.__class__,])),'utf-8')\n    # print(\"ICH:%s : %s\"%(inst_class_hierarchy, repr(obj)))\n\n    properties = [(p, getattr(obj, p, \"None\")) for p in dir(obj) if not (p[:2] == '__' or inspect.ismethod(getattr(obj, p)) or inspect.isbuiltin(getattr(obj,p))) ]\n    properties.sort()\n    properties_str = ','.join([\"%s=%s\"%(p[0],p[1]) for p in properties])\n    properties_bytes = bytearray(properties_str,'utf-8')\n\n    methods = [p for p in dir(obj) if inspect.ismethod(getattr(obj, p))]\n    methods.sort()\n\n    method_contents = []\n    for m in methods:\n        # print(\"Method:%s\"%m)\n        v = _function_contents(getattr(obj, m))\n        # print(\"[%s->]V:%s [%s]\"%(m,v,type(v)))\n        method_contents.append(v)\n\n    retval = bytearray(b'{')\n    retval.extend(inst_class_name)\n    retval.extend(b\":\")\n    retval.extend(inst_class_module)\n    retval.extend(b'}[[')\n    retval.extend(inst_class_hierarchy)\n    retval.extend(b']]{{')\n    retval.extend(bytearray(b\",\").join(method_contents))\n    retval.extend(b\"}}{{{\")\n    retval.extend(properties_bytes)\n    retval.extend(b'}}}')\n    return retval\n\n    # print(\"class          :%s\"%inst_class)\n    # print(\"class_name     :%s\"%inst_class_name)\n    # print(\"class_module   :%s\"%inst_class_module)\n    # print(\"Class hier     :\\n%s\"%pp.pformat(inst_class_hierarchy))\n    # print(\"Inst Properties:\\n%s\"%pp.pformat(properties))\n    # print(\"Inst Methods   :\\n%s\"%pp.pformat(methods))\n\ndef _actionAppend(act1, act2):\n    # This function knows how to slap two actions together.\n    # Mainly, it handles ListActions by concatenating into\n    # a single ListAction.\n    a1 = Action(act1)\n    a2 = Action(act2)\n    if a1 is None:\n        return a2\n    if a2 is None:\n        return a1\n    if isinstance(a1, ListAction):\n        if isinstance(a2, ListAction):\n            return ListAction(a1.list + a2.list)\n        else:\n            return ListAction(a1.list + [ a2 ])\n    else:\n        if isinstance(a2, ListAction):\n            return ListAction([ a1 ] + a2.list)\n        else:\n            return ListAction([ a1, a2 ])\n\n\ndef _do_create_keywords(args, kw):\n    \"\"\"This converts any arguments after the action argument into\n    their equivalent keywords and adds them to the kw argument.\n    \"\"\"\n    v = kw.get('varlist', ())\n    # prevent varlist=\"FOO\" from being interpreted as ['F', 'O', 'O']\n    if is_String(v): v = (v,)\n    kw['varlist'] = tuple(v)\n    if args:\n        # turn positional args into equivalent keywords\n        cmdstrfunc = args[0]\n        if cmdstrfunc is None or is_String(cmdstrfunc):\n            kw['cmdstr'] = cmdstrfunc\n        elif callable(cmdstrfunc):\n            kw['strfunction'] = cmdstrfunc\n        else:\n            raise SCons.Errors.UserError(\n                'Invalid command display variable type. '\n                'You must either pass a string or a callback which '\n                'accepts (target, source, env) as parameters.')\n        if len(args) > 1:\n            kw['varlist'] = tuple(SCons.Util.flatten(args[1:])) + kw['varlist']\n    if kw.get('strfunction', _null) is not _null \\\n                      and kw.get('cmdstr', _null) is not _null:\n        raise SCons.Errors.UserError(\n            'Cannot have both strfunction and cmdstr args to Action()')\n\n\ndef _do_create_action(act, kw):\n    \"\"\"This is the actual \"implementation\" for the\n    Action factory method, below.  This handles the\n    fact that passing lists to Action() itself has\n    different semantics than passing lists as elements\n    of lists.\n\n    The former will create a ListAction, the latter\n    will create a CommandAction by converting the inner\n    list elements to strings.\"\"\"\n\n    if isinstance(act, ActionBase):\n        return act\n\n    if is_String(act):\n        var=SCons.Util.get_environment_var(act)\n        if var:\n            # This looks like a string that is purely an Environment\n            # variable reference, like \"$FOO\" or \"${FOO}\".  We do\n            # something special here...we lazily evaluate the contents\n            # of that Environment variable, so a user could put something\n            # like a function or a CommandGenerator in that variable\n            # instead of a string.\n            return LazyAction(var, kw)\n        commands = str(act).split('\\n')\n        if len(commands) == 1:\n            return CommandAction(commands[0], **kw)\n        # The list of string commands may include a LazyAction, so we\n        # reprocess them via _do_create_list_action.\n        return _do_create_list_action(commands, kw)\n\n    if is_List(act):\n        return CommandAction(act, **kw)\n\n    if callable(act):\n        try:\n            gen = kw['generator']\n            del kw['generator']\n        except KeyError:\n            gen = 0\n        if gen:\n            action_type = CommandGeneratorAction\n        else:\n            action_type = FunctionAction\n        return action_type(act, kw)\n\n    # Catch a common error case with a nice message:\n    if isinstance(act, int) or isinstance(act, float):\n        raise TypeError(\"Don't know how to create an Action from a number (%s)\"%act)\n    # Else fail silently (???)\n    return None\n\n\ndef _do_create_list_action(act, kw):\n    \"\"\"A factory for list actions.  Convert the input list into Actions\n    and then wrap them in a ListAction.\"\"\"\n    acts = []\n    for a in act:\n        aa = _do_create_action(a, kw)\n        if aa is not None: acts.append(aa)\n    if not acts:\n        return ListAction([])\n    elif len(acts) == 1:\n        return acts[0]\n    else:\n        return ListAction(acts)\n\n\ndef Action(act, *args, **kw):\n    \"\"\"A factory for action objects.\"\"\"\n    # Really simple: the _do_create_* routines do the heavy lifting.\n    _do_create_keywords(args, kw)\n    if is_List(act):\n        return _do_create_list_action(act, kw)\n    return _do_create_action(act, kw)\n\n\nclass ActionBase:\n    \"\"\"Base class for all types of action objects that can be held by\n    other objects (Builders, Executors, etc.)  This provides the\n    common methods for manipulating and combining those actions.\"\"\"\n\n    def __eq__(self, other):\n        return self.__dict__ == other\n\n    def no_batch_key(self, env, target, source):\n        return None\n\n    batch_key = no_batch_key\n\n    def genstring(self, target, source, env):\n        return str(self)\n\n    def get_contents(self, target, source, env):\n        result = self.get_presig(target, source, env)\n\n        if not isinstance(result,(bytes, bytearray)):\n            result = bytearray(result, 'utf-8')\n        else:\n            # Make a copy and put in bytearray, without this the contents returned by get_presig\n            # can be changed by the logic below, appending with each call and causing very\n            # hard to track down issues...\n            result = bytearray(result)\n\n        # At this point everything should be a bytearray\n\n        # This should never happen, as the Action() factory should wrap\n        # the varlist, but just in case an action is created directly,\n        # we duplicate this check here.\n        vl = self.get_varlist(target, source, env)\n        if is_String(vl): vl = (vl,)\n        for v in vl:\n            # do the subst this way to ignore $(...$) parts:\n            if isinstance(result, bytearray):\n                result.extend(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))\n            else:\n                raise Exception(\"WE SHOULD NEVER GET HERE result should be bytearray not:%s\"%type(result))\n                # result.append(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))\n\n\n        if isinstance(result, (bytes,bytearray)):\n            return result\n        else:\n            raise Exception(\"WE SHOULD NEVER GET HERE - #2 result should be bytearray not:%s\" % type(result))\n            # return b''.join(result)\n\n    def __add__(self, other):\n        return _actionAppend(self, other)\n\n    def __radd__(self, other):\n        return _actionAppend(other, self)\n\n    def presub_lines(self, env):\n        # CommandGeneratorAction needs a real environment\n        # in order to return the proper string here, since\n        # it may call LazyAction, which looks up a key\n        # in that env.  So we temporarily remember the env here,\n        # and CommandGeneratorAction will use this env\n        # when it calls its _generate method.\n        self.presub_env = env\n        lines = str(self).split('\\n')\n        self.presub_env = None      # don't need this any more\n        return lines\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self.varlist\n\n    def get_targets(self, env, executor):\n        \"\"\"\n        Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used\n        by this action.\n        \"\"\"\n        return self.targets\n\n\nclass _ActionAction(ActionBase):\n    \"\"\"Base class for actions that create output objects.\"\"\"\n    def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),\n                       presub=_null, chdir=None, exitstatfunc=None,\n                       batch_key=None, targets='$TARGETS',\n                 **kw):\n        self.cmdstr = cmdstr\n        if strfunction is not _null:\n            if strfunction is None:\n                self.cmdstr = None\n            else:\n                self.strfunction = strfunction\n        self.varlist = varlist\n        self.presub = presub\n        self.chdir = chdir\n        if not exitstatfunc:\n            exitstatfunc = default_exitstatfunc\n        self.exitstatfunc = exitstatfunc\n\n        self.targets = targets\n\n        if batch_key:\n            if not callable(batch_key):\n                # They have set batch_key, but not to their own\n                # callable.  The default behavior here will batch\n                # *all* targets+sources using this action, separated\n                # for each construction environment.\n                def default_batch_key(self, env, target, source):\n                    return (id(self), id(env))\n                batch_key = default_batch_key\n            SCons.Util.AddMethod(self, batch_key, 'batch_key')\n\n    def print_cmd_line(self, s, target, source, env):\n        \"\"\"\n        In python 3, and in some of our tests, sys.stdout is\n        a String io object, and it takes unicode strings only\n        This code assumes s is a regular string.\n        \"\"\"\n        sys.stdout.write(s + \"\\n\")\n\n    def __call__(self, target, source, env,\n                               exitstatfunc=_null,\n                               presub=_null,\n                               show=_null,\n                               execute=_null,\n                               chdir=_null,\n                               executor=None):\n        if not is_List(target):\n            target = [target]\n        if not is_List(source):\n            source = [source]\n\n        if presub is _null:\n            presub = self.presub\n            if presub is _null:\n                presub = print_actions_presub\n        if exitstatfunc is _null:\n            exitstatfunc = self.exitstatfunc\n        if show is _null:\n            show = print_actions\n        if execute is _null:\n            execute = execute_actions\n        if chdir is _null:\n            chdir = self.chdir\n        save_cwd = None\n        if chdir:\n            save_cwd = os.getcwd()\n            try:\n                chdir = str(chdir.get_abspath())\n            except AttributeError:\n                if not is_String(chdir):\n                    if executor:\n                        chdir = str(executor.batches[0].targets[0].dir)\n                    else:\n                        chdir = str(target[0].dir)\n        if presub:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            t = ' and '.join(map(str, target))\n            l = '\\n  '.join(self.presub_lines(env))\n            out = \"Building %s with action:\\n  %s\\n\" % (t, l)\n            sys.stdout.write(out)\n        cmd = None\n        if show and self.strfunction:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            try:\n                cmd = self.strfunction(target, source, env, executor)\n            except TypeError:\n                cmd = self.strfunction(target, source, env)\n            if cmd:\n                if chdir:\n                    cmd = ('os.chdir(%s)\\n' % repr(chdir)) + cmd\n                try:\n                    get = env.get\n                except AttributeError:\n                    print_func = self.print_cmd_line\n                else:\n                    print_func = get('PRINT_CMD_LINE_FUNC')\n                    if not print_func:\n                        print_func = self.print_cmd_line\n                print_func(cmd, target, source, env)\n        stat = 0\n        if execute:\n            if chdir:\n                os.chdir(chdir)\n            try:\n                stat = self.execute(target, source, env, executor=executor)\n                if isinstance(stat, SCons.Errors.BuildError):\n                    s = exitstatfunc(stat.status)\n                    if s:\n                        stat.status = s\n                    else:\n                        stat = s\n                else:\n                    stat = exitstatfunc(stat)\n            finally:\n                if save_cwd:\n                    os.chdir(save_cwd)\n        if cmd and save_cwd:\n            print_func('os.chdir(%s)' % repr(save_cwd), target, source, env)\n\n        return stat\n\n\ndef _string_from_cmd_list(cmd_list):\n    \"\"\"Takes a list of command line arguments and returns a pretty\n    representation for printing.\"\"\"\n    cl = []\n    for arg in map(str, cmd_list):\n        if ' ' in arg or '\\t' in arg:\n            arg = '\"' + arg + '\"'\n        cl.append(arg)\n    return ' '.join(cl)\n\ndefault_ENV = None\n\n\ndef get_default_ENV(env):\n    \"\"\"\n    A fiddlin' little function that has an 'import SCons.Environment' which\n    can't be moved to the top level without creating an import loop.  Since\n    this import creates a local variable named 'SCons', it blocks access to\n    the global variable, so we move it here to prevent complaints about local\n    variables being used uninitialized.\n    \"\"\"\n    global default_ENV\n    try:\n        return env['ENV']\n    except KeyError:\n        if not default_ENV:\n            import SCons.Environment\n            # This is a hideously expensive way to get a default shell\n            # environment.  What it really should do is run the platform\n            # setup to get the default ENV.  Fortunately, it's incredibly\n            # rare for an Environment not to have a shell environment, so\n            # we're not going to worry about it overmuch.\n            default_ENV = SCons.Environment.Environment()['ENV']\n        return default_ENV\n\n\ndef _subproc(scons_env, cmd, error='ignore', **kw):\n    \"\"\"Wrapper for subprocess which pulls from construction env.\n\n    Use for calls to subprocess which need to interpolate values from\n    an SCons construction environment into the environment passed to\n    subprocess.  Adds an an error-handling argument.  Adds ability\n    to specify std{in,out,err} with \"'devnull'\" tag.\n    \"\"\"\n    # TODO: just uses subprocess.DEVNULL now, we can drop the \"devnull\"\n    # string now - it is a holdover from Py2, which didn't have DEVNULL.\n    for stream in 'stdin', 'stdout', 'stderr':\n        io = kw.get(stream)\n        if is_String(io) and io == 'devnull':\n            kw[stream] = DEVNULL\n\n    # Figure out what shell environment to use\n    ENV = kw.get('env', None)\n    if ENV is None: ENV = get_default_ENV(scons_env)\n\n    # Ensure that the ENV values are all strings:\n    new_env = {}\n    for key, value in ENV.items():\n        if is_List(value):\n            # If the value is a list, then we assume it is a path list,\n            # because that's a pretty common list-like value to stick\n            # in an environment variable:\n            value = SCons.Util.flatten_sequence(value)\n            new_env[key] = os.pathsep.join(map(str, value))\n        else:\n            # It's either a string or something else.  If it's a string,\n            # we still want to call str() because it might be a *Unicode*\n            # string, which makes subprocess.Popen() gag.  If it isn't a\n            # string or a list, then we just coerce it to a string, which\n            # is the proper way to handle Dir and File instances and will\n            # produce something reasonable for just about everything else:\n            new_env[key] = str(value)\n    kw['env'] = new_env\n\n    try:\n        pobj = subprocess.Popen(cmd, **kw)\n    except EnvironmentError as e:\n        if error == 'raise': raise\n        # return a dummy Popen instance that only returns error\n        class dummyPopen:\n            def __init__(self, e): self.exception = e\n            def communicate(self, input=None): return ('', '')\n            def wait(self): return -self.exception.errno\n            stdin = None\n            class f:\n                def read(self): return ''\n                def readline(self): return ''\n                def __iter__(self): return iter(())\n            stdout = stderr = f()\n        pobj = dummyPopen(e)\n    finally:\n        # clean up open file handles stored in parent's kw\n        for k, v in kw.items():\n            if inspect.ismethod(getattr(v, 'close', None)):\n                v.close()\n\n    return pobj\n\n\nclass CommandAction(_ActionAction):\n    \"\"\"Class for command-execution actions.\"\"\"\n    def __init__(self, cmd, **kw):\n        # Cmd can actually be a list or a single item; if it's a\n        # single item it should be the command string to execute; if a\n        # list then it should be the words of the command string to\n        # execute.  Only a single command should be executed by this\n        # object; lists of commands should be handled by embedding\n        # these objects in a ListAction object (which the Action()\n        # factory above does).  cmd will be passed to\n        # Environment.subst_list() for substituting environment\n        # variables.\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')\n\n        _ActionAction.__init__(self, **kw)\n        if is_List(cmd):\n            if [c for c in cmd if is_List(c)]:\n                raise TypeError(\"CommandAction should be given only \"\n                                \"a single command\")\n        self.cmd_list = cmd\n\n    def __str__(self):\n        if is_List(self.cmd_list):\n            return ' '.join(map(str, self.cmd_list))\n        return str(self.cmd_list)\n\n    def process(self, target, source, env, executor=None):\n        if executor:\n            result = env.subst_list(self.cmd_list, 0, executor=executor)\n        else:\n            result = env.subst_list(self.cmd_list, 0, target, source)\n        silent = None\n        ignore = None\n        while True:\n            try: c = result[0][0][0]\n            except IndexError: c = None\n            if c == '@': silent = 1\n            elif c == '-': ignore = 1\n            else: break\n            result[0][0] = result[0][0][1:]\n        try:\n            if not result[0][0]:\n                result[0] = result[0][1:]\n        except IndexError:\n            pass\n        return result, ignore, silent\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n        cmd_list, ignore, silent = self.process(target, source, env, executor)\n        if silent:\n            return ''\n        return _string_from_cmd_list(cmd_list[0])\n\n    def execute(self, target, source, env, executor=None):\n        \"\"\"Execute a command action.\n\n        This will handle lists of commands as well as individual commands,\n        because construction variable substitution may turn a single\n        \"command\" into a list.  This means that this class can actually\n        handle lists of commands, even though that's not how we use it\n        externally.\n        \"\"\"\n        escape_list = SCons.Subst.escape_list\n        flatten_sequence = SCons.Util.flatten_sequence\n\n        try:\n            shell = env['SHELL']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SHELL construction variable.')\n\n        try:\n            spawn = env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n        else:\n            if is_String(spawn):\n                spawn = env.subst(spawn, raw=1, conv=lambda x: x)\n\n        escape = env.get('ESCAPE', lambda x: x)\n\n        ENV = get_default_ENV(env)\n\n        # Ensure that the ENV values are all strings:\n        for key, value in ENV.items():\n            if not is_String(value):\n                if is_List(value):\n                    # If the value is a list, then we assume it is a\n                    # path list, because that's a pretty common list-like\n                    # value to stick in an environment variable:\n                    value = flatten_sequence(value)\n                    ENV[key] = os.pathsep.join(map(str, value))\n                else:\n                    # If it isn't a string or a list, then we just coerce\n                    # it to a string, which is the proper way to handle\n                    # Dir and File instances and will produce something\n                    # reasonable for just about everything else:\n                    ENV[key] = str(value)\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        cmd_list, ignore, silent = self.process(target, list(map(rfile, source)), env, executor)\n\n        # Use len() to filter out any \"command\" that's zero-length.\n        for cmd_line in filter(len, cmd_list):\n            # Escape the command line for the interpreter we are using.\n            cmd_line = escape_list(cmd_line, escape)\n            result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)\n            if not ignore and result:\n                msg = \"Error %s\" % result\n                return SCons.Errors.BuildError(errstr=msg,\n                                               status=result,\n                                               action=self,\n                                               command=cmd_line)\n        return 0\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        from SCons.Subst import SUBST_SIG\n        cmd = self.cmd_list\n        if is_List(cmd):\n            cmd = ' '.join(map(str, cmd))\n        else:\n            cmd = str(cmd)\n        if executor:\n            return env.subst_target_source(cmd, SUBST_SIG, executor=executor)\n        else:\n            return env.subst_target_source(cmd, SUBST_SIG, target, source)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        \"\"\"Return the implicit dependencies of this action's command line.\"\"\"\n        icd = env.get('IMPLICIT_COMMAND_DEPENDENCIES', True)\n        if is_String(icd) and icd[:1] == '$':\n            icd = env.subst(icd)\n\n        if not icd or str(icd).lower() in ('0', 'none', 'false', 'no', 'off'):\n            return []\n\n        try:\n            icd_int = int(icd)\n        except ValueError:\n            icd_int = None\n\n        if (icd_int and icd_int > 1) or str(icd).lower() == 'all':\n            # An integer value greater than 1 specifies the number of entries\n            # to scan. \"all\" means to scan all.\n            return self._get_implicit_deps_heavyweight(target, source, env, executor, icd_int)\n        else:\n            # Everything else (usually 1 or True) means that we want\n            # lightweight dependency scanning.\n            return self._get_implicit_deps_lightweight(target, source, env, executor)\n\n    def _get_implicit_deps_lightweight(self, target, source, env, executor):\n        \"\"\"\n        Lightweight dependency scanning involves only scanning the first entry\n        in an action string, even if it contains &&.\n        \"\"\"\n        from SCons.Subst import SUBST_SIG\n        if executor:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, executor=executor)\n        else:\n            cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, target, source)\n        res = []\n        for cmd_line in cmd_list:\n            if cmd_line:\n                d = str(cmd_line[0])\n                m = strip_quotes.match(d)\n                if m:\n                    d = m.group(1)\n                d = env.WhereIs(d)\n                if d:\n                    res.append(env.fs.File(d))\n        return res\n\n    def _get_implicit_deps_heavyweight(self, target, source, env, executor,\n                                       icd_int):\n        \"\"\"\n        Heavyweight dependency scanning involves scanning more than just the\n        first entry in an action string. The exact behavior depends on the\n        value of icd_int. Only files are taken as implicit dependencies;\n        directories are ignored.\n\n        If icd_int is an integer value, it specifies the number of entries to\n        scan for implicit dependencies. Action strings are also scanned after\n        a &&. So for example, if icd_int=2 and the action string is\n        \"cd <some_dir> && $PYTHON $SCRIPT_PATH <another_path>\", the implicit\n        dependencies would be the path to the python binary and the path to the\n        script.\n\n        If icd_int is None, all entries are scanned for implicit dependencies.\n        \"\"\"\n\n        # Avoid circular and duplicate dependencies by not providing source,\n        # target, or executor to subst_list. This causes references to\n        # $SOURCES, $TARGETS, and all related variables to disappear.\n        from SCons.Subst import SUBST_SIG\n        cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, conv=lambda x: x)\n        res = []\n\n        for cmd_line in cmd_list:\n            if cmd_line:\n                entry_count = 0\n                for entry in cmd_line:\n                    d = str(entry)\n                    if ((icd_int is None or entry_count < icd_int) and\n                            not d.startswith(('&', '-', '/') if os.name == 'nt'\n                                             else ('&', '-'))):\n                        m = strip_quotes.match(d)\n                        if m:\n                            d = m.group(1)\n\n                        if d:\n                            # Resolve the first entry in the command string using\n                            # PATH, which env.WhereIs() looks in.\n                            # For now, only match files, not directories.\n                            p = os.path.abspath(d) if os.path.isfile(d) else None\n                            if not p and entry_count == 0:\n                                p = env.WhereIs(d)\n\n                            if p:\n                                res.append(env.fs.File(p))\n\n                        entry_count = entry_count + 1\n                    else:\n                        entry_count = 0 if d == '&&' else entry_count + 1\n\n        # Despite not providing source and target to env.subst() above, we\n        # can still end up with sources in this list. For example, files in\n        # LIBS will still resolve in env.subst(). This won't result in\n        # circular dependencies, but it causes problems with cache signatures\n        # changing between full and incremental builds.\n        return [r for r in res if r not in target and r not in source]\n\n\nclass CommandGeneratorAction(ActionBase):\n    \"\"\"Class for command-generator actions.\"\"\"\n    def __init__(self, generator, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')\n        self.generator = generator\n        self.gen_kw = kw\n        self.varlist = kw.get('varlist', ())\n        self.targets = kw.get('targets', '$TARGETS')\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        # ensure that target is a list, to make it easier to write\n        # generator functions:\n        if not is_List(target):\n            target = [target]\n\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        ret = self.generator(target=target,\n                             source=source,\n                             env=env,\n                             for_signature=for_signature)\n        gen_cmd = Action(ret, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"Object returned from command generator: %s cannot be used to create an Action.\" % repr(ret))\n        return gen_cmd\n\n    def __str__(self):\n        try:\n            env = self.presub_env\n        except AttributeError:\n            env = None\n        if env is None:\n            env = SCons.Defaults.DefaultEnvironment()\n        act = self._generate([], [], env, 1)\n        return str(act)\n\n    def batch_key(self, env, target, source):\n        return self._generate(target, source, env, 1).batch_key(env, target, source)\n\n    def genstring(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).genstring(target, source, env)\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        act = self._generate(target, source, env, 0, executor)\n        if act is None:\n            raise SCons.Errors.UserError(\n                \"While building `%s': \"\n                \"Cannot deduce file extension from source files: %s\"\n                % (repr(list(map(str, target))), repr(list(map(str, source))))\n            )\n        return act(\n            target, source, env, exitstatfunc, presub, show, execute, chdir, executor\n        )\n\n    def get_presig(self, target, source, env, executor=None):\n        \"\"\"Return the signature contents of this action's command line.\n\n        This strips $(-$) and everything in between the string,\n        since those parts don't affect signatures.\n        \"\"\"\n        return self._generate(target, source, env, 1, executor).get_presig(target, source, env)\n\n    def get_implicit_deps(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor)\n\n    def get_targets(self, env, executor):\n        return self._generate(None, None, env, 1, executor).get_targets(env, executor)\n\n\nclass LazyAction(CommandGeneratorAction, CommandAction):\n    \"\"\"\n    A LazyAction is a kind of hybrid generator and command action for\n    strings of the form \"$VAR\".  These strings normally expand to other\n    strings (think \"$CCCOM\" to \"$CC -c -o $TARGET $SOURCE\"), but we also\n    want to be able to replace them with functions in the construction\n    environment.  Consequently, we want lazy evaluation and creation of\n    an Action in the case of the function, but that's overkill in the more\n    normal case of expansion to other strings.\n\n    So we do this with a subclass that's both a generator *and*\n    a command action.  The overridden methods all do a quick check\n    of the construction variable, and if it's a string we just call\n    the corresponding CommandAction method to do the heavy lifting.\n    If not, then we call the same-named CommandGeneratorAction method.\n    The CommandGeneratorAction methods work by using the overridden\n    _generate() method, that is, our own way of handling \"generation\" of\n    an action based on what's in the construction variable.\n    \"\"\"\n\n    def __init__(self, var, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')\n        CommandAction.__init__(self, '${'+var+'}', **kw)\n        self.var = SCons.Util.to_String(var)\n        self.gen_kw = kw\n\n    def get_parent_class(self, env):\n        c = env.get(self.var)\n        if is_String(c) and '\\n' not in c:\n            return CommandAction\n        return CommandGeneratorAction\n\n    def _generate_cache(self, env):\n        if env:\n            c = env.get(self.var, '')\n        else:\n            c = ''\n        gen_cmd = Action(c, **self.gen_kw)\n        if not gen_cmd:\n            raise SCons.Errors.UserError(\"$%s value %s cannot be used to create an Action.\" % (self.var, repr(c)))\n        return gen_cmd\n\n    def _generate(self, target, source, env, for_signature, executor=None):\n        return self._generate_cache(env)\n\n    def __call__(self, target, source, env, *args, **kw):\n        c = self.get_parent_class(env)\n        return c.__call__(self, target, source, env, *args, **kw)\n\n    def get_presig(self, target, source, env):\n        c = self.get_parent_class(env)\n        return c.get_presig(self, target, source, env)\n\n    def get_varlist(self, target, source, env, executor=None):\n        c = self.get_parent_class(env)\n        return c.get_varlist(self, target, source, env, executor)\n\n\nclass FunctionAction(_ActionAction):\n    \"\"\"Class for Python function actions.\"\"\"\n\n    def __init__(self, execfunction, kw):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction')\n\n        self.execfunction = execfunction\n        try:\n            self.funccontents = _callable_contents(execfunction)\n        except AttributeError:\n            try:\n                # See if execfunction will do the heavy lifting for us.\n                self.gc = execfunction.get_contents\n            except AttributeError:\n                # This is weird, just do the best we can.\n                self.funccontents = _object_contents(execfunction)\n\n        _ActionAction.__init__(self, **kw)\n\n    def function_name(self):\n        try:\n            return self.execfunction.__name__\n        except AttributeError:\n            try:\n                return self.execfunction.__class__.__name__\n            except AttributeError:\n                return \"unknown_python_function\"\n\n    def strfunction(self, target, source, env, executor=None):\n        if self.cmdstr is None:\n            return None\n        if self.cmdstr is not _null:\n            from SCons.Subst import SUBST_RAW\n            if executor:\n                c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n            else:\n                c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n            if c:\n                return c\n\n        def array(a):\n            def quote(s):\n                try:\n                    str_for_display = s.str_for_display\n                except AttributeError:\n                    s = repr(s)\n                else:\n                    s = str_for_display()\n                return s\n            return '[' + \", \".join(map(quote, a)) + ']'\n        try:\n            strfunc = self.execfunction.strfunction\n        except AttributeError:\n            pass\n        else:\n            if strfunc is None:\n                return None\n            if callable(strfunc):\n                return strfunc(target, source, env)\n        name = self.function_name()\n        tstr = array(target)\n        sstr = array(source)\n        return \"%s(%s, %s)\" % (name, tstr, sstr)\n\n    def __str__(self):\n        name = self.function_name()\n        if name == 'ActionCaller':\n            return str(self.execfunction)\n        return \"%s(target, source, env)\" % name\n\n    def execute(self, target, source, env, executor=None):\n        exc_info = (None,None,None)\n        try:\n            if executor:\n                target = executor.get_all_targets()\n                source = executor.get_all_sources()\n            rsources = list(map(rfile, source))\n            try:\n                result = self.execfunction(target=target, source=rsources, env=env)\n            except KeyboardInterrupt as e:\n                raise\n            except SystemExit as e:\n                raise\n            except Exception as e:\n                result = e\n                exc_info = sys.exc_info()\n\n            if result:\n                result = SCons.Errors.convert_to_BuildError(result, exc_info)\n                result.node=target\n                result.action=self\n                try:\n                    result.command=self.strfunction(target, source, env, executor)\n                except TypeError:\n                    result.command=self.strfunction(target, source, env)\n\n                # FIXME: This maintains backward compatibility with respect to\n                # which type of exceptions were returned by raising an\n                # exception and which ones were returned by value. It would\n                # probably be best to always return them by value here, but\n                # some codes do not check the return value of Actions and I do\n                # not have the time to modify them at this point.\n                if (exc_info[1] and\n                    not isinstance(exc_info[1],EnvironmentError)):\n                    raise result\n\n            return result\n        finally:\n            # Break the cycle between the traceback object and this\n            # function stack frame. See the sys.exc_info() doc info for\n            # more information about this issue.\n            del exc_info\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this callable action.\"\"\"\n        try:\n            return self.gc(target, source, env)\n        except AttributeError:\n            return self.funccontents\n\n    def get_implicit_deps(self, target, source, env):\n        return []\n\nclass ListAction(ActionBase):\n    \"\"\"Class for lists of other actions.\"\"\"\n    def __init__(self, actionlist):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction')\n        def list_of_actions(x):\n            if isinstance(x, ActionBase):\n                return x\n            return Action(x)\n        self.list = list(map(list_of_actions, actionlist))\n        # our children will have had any varlist\n        # applied; we don't need to do it again\n        self.varlist = ()\n        self.targets = '$TARGETS'\n\n    def genstring(self, target, source, env):\n        return '\\n'.join([a.genstring(target, source, env) for a in self.list])\n\n    def __str__(self):\n        return '\\n'.join(map(str, self.list))\n\n    def presub_lines(self, env):\n        return SCons.Util.flatten_sequence(\n            [a.presub_lines(env) for a in self.list])\n\n    def get_presig(self, target, source, env):\n        \"\"\"Return the signature contents of this action list.\n\n        Simple concatenation of the signatures of the elements.\n        \"\"\"\n        return b\"\".join([bytes(x.get_contents(target, source, env)) for x in self.list])\n\n    def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n                 show=_null, execute=_null, chdir=_null, executor=None):\n        if executor:\n            target = executor.get_all_targets()\n            source = executor.get_all_sources()\n        for act in self.list:\n            stat = act(target, source, env, exitstatfunc, presub,\n                       show, execute, chdir, executor)\n            if stat:\n                return stat\n        return 0\n\n    def get_implicit_deps(self, target, source, env):\n        result = []\n        for act in self.list:\n            result.extend(act.get_implicit_deps(target, source, env))\n        return result\n\n    def get_varlist(self, target, source, env, executor=None):\n        result = OrderedDict()\n        for act in self.list:\n            for var in act.get_varlist(target, source, env, executor):\n                result[var] = True\n        return list(result.keys())\n\n\nclass ActionCaller:\n    \"\"\"A class for delaying calling an Action function with specific\n    (positional and keyword) arguments until the Action is actually\n    executed.\n\n    This class looks to the rest of the world like a normal Action object,\n    but what it's really doing is hanging on to the arguments until we\n    have a target, source and env to use for the expansion.\n    \"\"\"\n    def __init__(self, parent, args, kw):\n        self.parent = parent\n        self.args = args\n        self.kw = kw\n\n    def get_contents(self, target, source, env):\n        actfunc = self.parent.actfunc\n        try:\n            # \"self.actfunc\" is a function.\n            contents = actfunc.__code__.co_code\n        except AttributeError:\n            # \"self.actfunc\" is a callable object.\n            try:\n                contents = actfunc.__call__.__func__.__code__.co_code\n            except AttributeError:\n                # No __call__() method, so it might be a builtin\n                # or something like that.  Do the best we can.\n                contents = repr(actfunc)\n\n        return contents\n\n    def subst(self, s, target, source, env):\n        # If s is a list, recursively apply subst()\n        # to every element in the list\n        if is_List(s):\n            result = []\n            for elem in s:\n                result.append(self.subst(elem, target, source, env))\n            return self.parent.convert(result)\n\n        # Special-case hack:  Let a custom function wrapped in an\n        # ActionCaller get at the environment through which the action\n        # was called by using this hard-coded value as a special return.\n        if s == '$__env__':\n            return env\n        elif is_String(s):\n            return env.subst(s, 1, target, source)\n        return self.parent.convert(s)\n\n    def subst_args(self, target, source, env):\n        return [self.subst(x, target, source, env) for x in self.args]\n\n    def subst_kw(self, target, source, env):\n        kw = {}\n        for key in list(self.kw.keys()):\n            kw[key] = self.subst(self.kw[key], target, source, env)\n        return kw\n\n    def __call__(self, target, source, env, executor=None):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.actfunc(*args, **kw)\n\n    def strfunction(self, target, source, env):\n        args = self.subst_args(target, source, env)\n        kw = self.subst_kw(target, source, env)\n        return self.parent.strfunc(*args, **kw)\n\n    def __str__(self):\n        return self.parent.strfunc(*self.args, **self.kw)\n\n\nclass ActionFactory:\n    \"\"\"A factory class that will wrap up an arbitrary function\n    as an SCons-executable Action object.\n\n    The real heavy lifting here is done by the ActionCaller class.\n    We just collect the (positional and keyword) arguments that we're\n    called with and give them to the ActionCaller object we create,\n    so it can hang onto them until it needs them.\n    \"\"\"\n    def __init__(self, actfunc, strfunc, convert=lambda x: x):\n        self.actfunc = actfunc\n        self.strfunc = strfunc\n        self.convert = convert\n\n    def __call__(self, *args, **kw):\n        ac = ActionCaller(self, args, kw)\n        action = Action(ac, strfunction=ac.strfunction)\n        return action\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\nSCons.Builder\n\nBuilder object subsystem.\n\nA Builder object is a callable that encapsulates information about how\nto execute actions to create a target Node (file) from source Nodes\n(files), and how to create those dependencies for tracking.\n\nThe main entry point here is the Builder() factory method.  This provides\na procedural interface that creates the right underlying Builder object\nbased on the keyword arguments supplied and the types of the arguments.\n\nThe goal is for this external interface to be simple enough that the\nvast majority of users can create new Builders as necessary to support\nbuilding new types of files in their configurations, without having to\ndive any deeper into this subsystem.\n\nThe base class here is BuilderBase.  This is a concrete base class which\ndoes, in fact, represent the Builder objects that we (or users) create.\n\nThere is also a proxy that looks like a Builder:\n\n    CompositeBuilder\n\n        This proxies for a Builder with an action that is actually a\n        dictionary that knows how to map file suffixes to a specific\n        action.  This is so that we can invoke different actions\n        (compilers, compile options) for different flavors of source\n        files.\n\nBuilders and their proxies have the following public interface methods\nused by other modules:\n\n    - __call__()\n        THE public interface.  Calling a Builder object (with the\n        use of internal helper methods) sets up the target and source\n        dependencies, appropriate mapping to a specific action, and the\n        environment manipulation necessary for overridden construction\n        variable.  This also takes care of warning about possible mistakes\n        in keyword arguments.\n\n    - add_emitter()\n        Adds an emitter for a specific file suffix, used by some Tool\n        modules to specify that (for example) a yacc invocation on a .y\n        can create a .h *and* a .c file.\n\n    - add_action()\n        Adds an action for a specific file suffix, heavily used by\n        Tool modules to add their specific action(s) for turning\n        a source file into an object file to the global static\n        and shared object file Builders.\n\nThere are the following methods for internal use within this module:\n\n    - _execute()\n        The internal method that handles the heavily lifting when a\n        Builder is called.  This is used so that the __call__() methods\n        can set up warning about possible mistakes in keyword-argument\n        overrides, and *then* execute all of the steps necessary so that\n        the warnings only occur once.\n\n    - get_name()\n        Returns the Builder's name within a specific Environment,\n        primarily used to try to return helpful information in error\n        messages.\n\n    - adjust_suffix()\n    - get_prefix()\n    - get_suffix()\n    - get_src_suffix()\n    - set_src_suffix()\n        Miscellaneous stuff for handling the prefix and suffix\n        manipulation we use in turning source file names into target\n        file names.\n\n\"\"\"\n\nfrom collections import UserDict, UserList\n\nimport SCons.Action\nimport SCons.Debug\nimport SCons.Executor\nimport SCons.Memoize\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Debug import logInstanceCreation\nfrom SCons.Errors import InternalError, UserError\n\nclass _Null:\n    pass\n\n_null = _Null\n\ndef match_splitext(path, suffixes = []):\n    if suffixes:\n        matchsuf = [S for S in suffixes if path[-len(S):] == S]\n        if matchsuf:\n            suf = max([(len(_f),_f) for _f in matchsuf])[1]\n            return [path[:-len(suf)], path[-len(suf):]]\n    return SCons.Util.splitext(path)\n\nclass DictCmdGenerator(SCons.Util.Selector):\n    \"\"\"This is a callable class that can be used as a\n    command generator function.  It holds on to a dictionary\n    mapping file suffixes to Actions.  It uses that dictionary\n    to return the proper action based on the file suffix of\n    the source file.\"\"\"\n\n    def __init__(self, dict=None, source_ext_match=1):\n        SCons.Util.Selector.__init__(self, dict)\n        self.source_ext_match = source_ext_match\n\n    def src_suffixes(self):\n        return list(self.keys())\n\n    def add_action(self, suffix, action):\n        \"\"\"Add a suffix-action pair to the mapping.\n        \"\"\"\n        self[suffix] = action\n\n    def __call__(self, target, source, env, for_signature):\n        if not source:\n            return []\n\n        if self.source_ext_match:\n            suffixes = self.src_suffixes()\n            ext = None\n            for src in map(str, source):\n                my_ext = match_splitext(src, suffixes)[1]\n                if ext and my_ext != ext:\n                    raise UserError(\"While building `%s' from `%s': Cannot build multiple sources with different extensions: %s, %s\"\n                             % (repr(list(map(str, target))), src, ext, my_ext))\n                ext = my_ext\n        else:\n            ext = match_splitext(str(source[0]), self.src_suffixes())[1]\n\n        if not ext:\n            #return ext\n            raise UserError(\"While building `%s': \"\n                            \"Cannot deduce file extension from source files: %s\"\n                 % (repr(list(map(str, target))), repr(list(map(str, source)))))\n\n        try:\n            ret = SCons.Util.Selector.__call__(self, env, source, ext)\n        except KeyError as e:\n            raise UserError(\"Ambiguous suffixes after environment substitution: %s == %s == %s\" % (e.args[0], e.args[1], e.args[2]))\n        if ret is None:\n            raise UserError(\"While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'.  Expected a suffix in this list: %s.\" % \\\n                            (repr(list(map(str, target))), repr(list(map(str, source))), ext, repr(list(self.keys()))))\n        return ret\n\nclass CallableSelector(SCons.Util.Selector):\n    \"\"\"A callable dictionary that will, in turn, call the value it\n    finds if it can.\"\"\"\n    def __call__(self, env, source):\n        value = SCons.Util.Selector.__call__(self, env, source)\n        if callable(value):\n            value = value(env, source)\n        return value\n\nclass DictEmitter(SCons.Util.Selector):\n    \"\"\"A callable dictionary that maps file suffixes to emitters.\n    When called, it finds the right emitter in its dictionary for the\n    suffix of the first source file, and calls that emitter to get the\n    right lists of targets and sources to return.  If there's no emitter\n    for the suffix in its dictionary, the original target and source are\n    returned.\n    \"\"\"\n    def __call__(self, target, source, env):\n        emitter = SCons.Util.Selector.__call__(self, env, source)\n        if emitter:\n            target, source = emitter(target, source, env)\n        return (target, source)\n\nclass ListEmitter(UserList):\n    \"\"\"A callable list of emitters that calls each in sequence,\n    returning the result.\n    \"\"\"\n    def __call__(self, target, source, env):\n        for e in self.data:\n            target, source = e(target, source, env)\n        return (target, source)\n\n# These are a common errors when calling a Builder;\n# they are similar to the 'target' and 'source' keyword args to builders,\n# so we issue warnings when we see them.  The warnings can, of course,\n# be disabled.\nmisleading_keywords = {\n    'targets'   : 'target',\n    'sources'   : 'source',\n}\n\nclass OverrideWarner(UserDict):\n    \"\"\"A class for warning about keyword arguments that we use as\n    overrides in a Builder call.\n\n    This class exists to handle the fact that a single Builder call\n    can actually invoke multiple builders.  This class only emits the\n    warnings once, no matter how many Builders are invoked.\n    \"\"\"\n    def __init__(self, dict):\n        UserDict.__init__(self, dict)\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner')\n        self.already_warned = None\n    def warn(self):\n        if self.already_warned:\n            return\n        for k in self.keys():\n            if k in misleading_keywords:\n                alt = misleading_keywords[k]\n                msg = \"Did you mean to use `%s' instead of `%s'?\" % (alt, k)\n                SCons.Warnings.warn(SCons.Warnings.MisleadingKeywordsWarning, msg)\n        self.already_warned = 1\n\ndef Builder(**kw):\n    \"\"\"A factory for builder objects.\"\"\"\n    composite = None\n    if 'generator' in kw:\n        if 'action' in kw:\n            raise UserError(\"You must not specify both an action and a generator.\")\n        kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {})\n        del kw['generator']\n    elif 'action' in kw:\n        source_ext_match = kw.get('source_ext_match', 1)\n        if 'source_ext_match' in kw:\n            del kw['source_ext_match']\n        if SCons.Util.is_Dict(kw['action']):\n            composite = DictCmdGenerator(kw['action'], source_ext_match)\n            kw['action'] = SCons.Action.CommandGeneratorAction(composite, {})\n            kw['src_suffix'] = composite.src_suffixes()\n        else:\n            kw['action'] = SCons.Action.Action(kw['action'])\n\n    if 'emitter' in kw:\n        emitter = kw['emitter']\n        if SCons.Util.is_String(emitter):\n            # This allows users to pass in an Environment\n            # variable reference (like \"$FOO\") as an emitter.\n            # We will look in that Environment variable for\n            # a callable to use as the actual emitter.\n            var = SCons.Util.get_environment_var(emitter)\n            if not var:\n                raise UserError(\"Supplied emitter '%s' does not appear to refer to an Environment variable\" % emitter)\n            kw['emitter'] = EmitterProxy(var)\n        elif SCons.Util.is_Dict(emitter):\n            kw['emitter'] = DictEmitter(emitter)\n        elif SCons.Util.is_List(emitter):\n            kw['emitter'] = ListEmitter(emitter)\n\n    result = BuilderBase(**kw)\n\n    if composite is not None:\n        result = CompositeBuilder(result, composite)\n\n    return result\n\ndef _node_errors(builder, env, tlist, slist):\n    \"\"\"Validate that the lists of target and source nodes are\n    legal for this builder and environment.  Raise errors or\n    issue warnings as appropriate.\n    \"\"\"\n\n    # First, figure out if there are any errors in the way the targets\n    # were specified.\n    for t in tlist:\n        if t.side_effect:\n            raise UserError(\"Multiple ways to build the same target were specified for: %s\" % t)\n        if t.has_explicit_builder():\n            # Check for errors when the environments are different\n            # No error if environments are the same Environment instance\n            if (t.env is not None and t.env is not env and\n                    # Check OverrideEnvironment case - no error if wrapped Environments\n                    # are the same instance, and overrides lists match\n                    not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and\n                         getattr(t.env, 'overrides', 0) == getattr(env, 'overrides', 1) and\n                         not builder.multi)):\n                action = t.builder.action\n                t_contents = t.builder.action.get_contents(tlist, slist, t.env)\n                contents = builder.action.get_contents(tlist, slist, env)\n\n                if t_contents == contents:\n                    msg = \"Two different environments were specified for target %s,\\n\\tbut they appear to have the same action: %s\" % (t, action.genstring(tlist, slist, t.env))\n                    SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)\n                else:\n                    try:\n                        msg = \"Two environments with different actions were specified for the same target: %s\\n(action 1: %s)\\n(action 2: %s)\" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))\n                    except UnicodeDecodeError:\n                        msg = \"Two environments with different actions were specified for the same target: %s\"%t\n                    raise UserError(msg)\n            if builder.multi:\n                if t.builder != builder:\n                    msg = \"Two different builders (%s and %s) were specified for the same target: %s\" % (t.builder.get_name(env), builder.get_name(env), t)\n                    raise UserError(msg)\n                # TODO(batch):  list constructed each time!\n                if t.get_executor().get_all_targets() != tlist:\n                    msg = \"Two different target lists have a target in common: %s  (from %s and from %s)\" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist)))\n                    raise UserError(msg)\n            elif t.sources != slist:\n                msg = \"Multiple ways to build the same target were specified for: %s  (from %s and from %s)\" % (t, list(map(str, t.sources)), list(map(str, slist)))\n                raise UserError(msg)\n\n    if builder.single_source:\n        if len(slist) > 1:\n            raise UserError(\"More than one source given for single-source builder: targets=%s sources=%s\" % (list(map(str,tlist)), list(map(str,slist))))\n\nclass EmitterProxy:\n    \"\"\"This is a callable class that can act as a\n    Builder emitter.  It holds on to a string that\n    is a key into an Environment dictionary, and will\n    look there at actual build time to see if it holds\n    a callable.  If so, we will call that as the actual\n    emitter.\"\"\"\n    def __init__(self, var):\n        self.var = SCons.Util.to_String(var)\n\n    def __call__(self, target, source, env):\n        emitter = self.var\n\n        # Recursively substitute the variable.\n        # We can't use env.subst() because it deals only\n        # in strings.  Maybe we should change that?\n        while SCons.Util.is_String(emitter) and emitter in env:\n            emitter = env[emitter]\n        if callable(emitter):\n            target, source = emitter(target, source, env)\n        elif SCons.Util.is_List(emitter):\n            for e in emitter:\n                target, source = e(target, source, env)\n\n        return (target, source)\n\n    def __eq__(self, other):\n        return self.var == other.var\n\n    def __lt__(self, other):\n        return self.var < other.var\n\n    def __le__(self, other):\n        return self.var <= other.var\n\n    def __gt__(self, other):\n        return self.var > other.var\n\n    def __ge__(self, other):\n        return self.var >= other.var\n\nclass BuilderBase:\n    \"\"\"Base class for Builders, objects that create output\n    nodes (files) from input nodes (files).\n    \"\"\"\n\n    def __init__(self,  action = None,\n                        prefix = '',\n                        suffix = '',\n                        src_suffix = '',\n                        target_factory = None,\n                        source_factory = None,\n                        target_scanner = None,\n                        source_scanner = None,\n                        emitter = None,\n                        multi = 0,\n                        env = None,\n                        single_source = 0,\n                        name = None,\n                        chdir = _null,\n                        is_explicit = 1,\n                        src_builder = None,\n                        ensure_suffix = False,\n                        **overrides):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase')\n        self._memo = {}\n        self.action = action\n        self.multi = multi\n        if SCons.Util.is_Dict(prefix):\n            prefix = CallableSelector(prefix)\n        self.prefix = prefix\n        if SCons.Util.is_Dict(suffix):\n            suffix = CallableSelector(suffix)\n        self.env = env\n        self.single_source = single_source\n        if 'overrides' in overrides:\n            msg =  \"The \\\"overrides\\\" keyword to Builder() creation has been removed;\\n\" +\\\n                \"\\tspecify the items as keyword arguments to the Builder() call instead.\"\n            raise TypeError(msg)\n        if 'scanner' in overrides:\n            msg = \"The \\\"scanner\\\" keyword to Builder() creation has been removed;\\n\" +\\\n                \"\\tuse: source_scanner or target_scanner as appropriate.\"\n            raise TypeError(msg)\n        self.overrides = overrides\n\n        self.set_suffix(suffix)\n        self.set_src_suffix(src_suffix)\n        self.ensure_suffix = ensure_suffix\n\n        self.target_factory = target_factory\n        self.source_factory = source_factory\n        self.target_scanner = target_scanner\n        self.source_scanner = source_scanner\n\n        self.emitter = emitter\n\n        # Optional Builder name should only be used for Builders\n        # that don't get attached to construction environments.\n        if name:\n            self.name = name\n        self.executor_kw = {}\n        if chdir is not _null:\n            self.executor_kw['chdir'] = chdir\n        self.is_explicit = is_explicit\n\n        if src_builder is None:\n            src_builder = []\n        elif not SCons.Util.is_List(src_builder):\n            src_builder = [ src_builder ]\n        self.src_builder = src_builder\n\n    def __bool__(self):\n        raise InternalError(\"Do not test for the Node.builder attribute directly; use Node.has_builder() instead\")\n\n    def get_name(self, env):\n        \"\"\"Attempts to get the name of the Builder.\n\n        Look at the BUILDERS variable of env, expecting it to be a\n        dictionary containing this Builder, and return the key of the\n        dictionary.  If there's no key, then return a directly-configured\n        name (if there is one) or the name of the class (by default).\"\"\"\n\n        try:\n            index = list(env['BUILDERS'].values()).index(self)\n            return list(env['BUILDERS'].keys())[index]\n        except (AttributeError, KeyError, TypeError, ValueError):\n            try:\n                return self.name\n            except AttributeError:\n                return str(self.__class__)\n\n    def __eq__(self, other):\n        return self.__dict__ == other.__dict__\n\n    def splitext(self, path, env=None):\n        if not env:\n            env = self.env\n        if env:\n            suffixes = self.src_suffixes(env)\n        else:\n            suffixes = []\n        return match_splitext(path, suffixes)\n\n    def _adjustixes(self, files, pre, suf, ensure_suffix=False):\n        if not files:\n            return []\n        result = []\n        if not SCons.Util.is_List(files):\n            files = [files]\n\n        for f in files:\n            if SCons.Util.is_String(f):\n                f = SCons.Util.adjustixes(f, pre, suf, ensure_suffix)\n            result.append(f)\n        return result\n\n    def _create_nodes(self, env, target = None, source = None):\n        \"\"\"Create and return lists of target and source nodes.\n        \"\"\"\n        src_suf = self.get_src_suffix(env)\n\n        target_factory = env.get_factory(self.target_factory)\n        source_factory = env.get_factory(self.source_factory)\n\n        source = self._adjustixes(source, None, src_suf)\n        slist = env.arg2nodes(source, source_factory)\n\n        pre = self.get_prefix(env, slist)\n        suf = self.get_suffix(env, slist)\n\n        if target is None:\n            try:\n                t_from_s = slist[0].target_from_source\n            except AttributeError:\n                raise UserError(\"Do not know how to create a target from source `%s'\" % slist[0])\n            except IndexError:\n                tlist = []\n            else:\n                splitext = lambda S: self.splitext(S,env)\n                tlist = [ t_from_s(pre, suf, splitext) ]\n        else:\n            # orig_target = target\n            target = self._adjustixes(target, pre, suf, self.ensure_suffix)\n            tlist = env.arg2nodes(target, target_factory, target=target, source=source)\n\n        if self.emitter:\n            # The emitter is going to do str(node), but because we're\n            # being called *from* a builder invocation, the new targets\n            # don't yet have a builder set on them and will look like\n            # source files.  Fool the emitter's str() calls by setting\n            # up a temporary builder on the new targets.\n            new_targets = []\n            for t in tlist:\n                if not t.is_derived():\n                    t.builder_set(self)\n                    new_targets.append(t)\n\n            orig_tlist = tlist[:]\n            orig_slist = slist[:]\n\n            target, source = self.emitter(target=tlist, source=slist, env=env)\n\n            # Now delete the temporary builders that we attached to any\n            # new targets, so that _node_errors() doesn't do weird stuff\n            # to them because it thinks they already have builders.\n            for t in new_targets:\n                if t.builder is self:\n                    # Only delete the temporary builder if the emitter\n                    # didn't change it on us.\n                    t.builder_set(None)\n\n            # Have to call arg2nodes yet again, since it is legal for\n            # emitters to spit out strings as well as Node instances.\n            tlist = env.arg2nodes(target, target_factory,\n                                  target=orig_tlist, source=orig_slist)\n            slist = env.arg2nodes(source, source_factory,\n                                  target=orig_tlist, source=orig_slist)\n\n        return tlist, slist\n\n    def _execute(self, env, target, source, overwarn={}, executor_kw={}):\n        # We now assume that target and source are lists or None.\n        if self.src_builder:\n            source = self.src_builder_sources(env, source, overwarn)\n\n        if self.single_source and len(source) > 1 and target is None:\n            result = []\n            if target is None: target = [None]*len(source)\n            for tgt, src in zip(target, source):\n                if tgt is not None:\n                    tgt = [tgt]\n                if src is not None:\n                    src = [src]\n                result.extend(self._execute(env, tgt, src, overwarn))\n            return SCons.Node.NodeList(result)\n\n        overwarn.warn()\n\n        tlist, slist = self._create_nodes(env, target, source)\n\n        # If there is more than one target ensure that if we need to reset\n        # the implicit list to new scan of dependency all targets implicit lists\n        # are cleared. (SCons GH Issue #2811 and MongoDB SERVER-33111)\n        if len(tlist) > 1:\n            for t in tlist:\n                t.target_peers = tlist\n\n        # Check for errors with the specified target/source lists.\n        _node_errors(self, env, tlist, slist)\n\n        # The targets are fine, so find or make the appropriate Executor to\n        # build this particular list of targets from this particular list of\n        # sources.\n\n        executor = None\n        key = None\n\n        if self.multi:\n            try:\n                executor = tlist[0].get_executor(create = 0)\n            except (AttributeError, IndexError):\n                pass\n            else:\n                executor.add_sources(slist)\n\n        if executor is None:\n            if not self.action:\n                fmt = \"Builder %s must have an action to build %s.\"\n                raise UserError(fmt % (self.get_name(env or self.env),\n                                        list(map(str,tlist))))\n            key = self.action.batch_key(env or self.env, tlist, slist)\n            if key:\n                try:\n                    executor = SCons.Executor.GetBatchExecutor(key)\n                except KeyError:\n                    pass\n                else:\n                    executor.add_batch(tlist, slist)\n\n        if executor is None:\n            executor = SCons.Executor.Executor(self.action, env, [],\n                                               tlist, slist, executor_kw)\n            if key:\n                SCons.Executor.AddBatchExecutor(key, executor)\n\n        # Now set up the relevant information in the target Nodes themselves.\n        for t in tlist:\n            t.cwd = env.fs.getcwd()\n            t.builder_set(self)\n            t.env_set(env)\n            t.add_source(slist)\n            t.set_executor(executor)\n            t.set_explicit(self.is_explicit)\n\n        if env.get(\"SCONF_NODE\"):\n            for node in tlist:\n                node.attributes.conftest_node = 1\n\n        return SCons.Node.NodeList(tlist)\n\n    def __call__(self, env, target=None, source=None, chdir=_null, **kw):\n        # We now assume that target and source are lists or None.\n        # The caller (typically Environment.BuilderWrapper) is\n        # responsible for converting any scalar values to lists.\n        if chdir is _null:\n            ekw = self.executor_kw\n        else:\n            ekw = self.executor_kw.copy()\n            ekw['chdir'] = chdir\n        if 'chdir' in ekw and SCons.Util.is_String(ekw['chdir']):\n            ekw['chdir'] = env.subst(ekw['chdir'])\n        if kw:\n            if 'srcdir' in kw:\n                def prependDirIfRelative(f, srcdir=kw['srcdir']):\n                    import os.path\n                    if SCons.Util.is_String(f) and not os.path.isabs(f):\n                        f = os.path.join(srcdir, f)\n                    return f\n                if not SCons.Util.is_List(source):\n                    source = [source]\n                source = list(map(prependDirIfRelative, source))\n                del kw['srcdir']\n            if self.overrides:\n                env_kw = self.overrides.copy()\n                env_kw.update(kw)\n            else:\n                env_kw = kw\n        else:\n            env_kw = self.overrides\n\n        # TODO if env_kw: then the following line. there's no purpose in calling if no overrides.\n        env = env.Override(env_kw)\n        return self._execute(env, target, source, OverrideWarner(kw), ekw)\n\n    def adjust_suffix(self, suff):\n        if suff and not suff[0] in [ '.', '_', '$' ]:\n            return '.' + suff\n        return suff\n\n    def get_prefix(self, env, sources=[]):\n        prefix = self.prefix\n        if callable(prefix):\n            prefix = prefix(env, sources)\n        return env.subst(prefix)\n\n    def set_suffix(self, suffix):\n        if not callable(suffix):\n            suffix = self.adjust_suffix(suffix)\n        self.suffix = suffix\n\n    def get_suffix(self, env, sources=[]):\n        suffix = self.suffix\n        if callable(suffix):\n            suffix = suffix(env, sources)\n        return env.subst(suffix)\n\n    def set_src_suffix(self, src_suffix):\n        if not src_suffix:\n            src_suffix = []\n        elif not SCons.Util.is_List(src_suffix):\n            src_suffix = [ src_suffix ]\n        self.src_suffix = [callable(suf) and suf or self.adjust_suffix(suf) for suf in src_suffix]\n\n    def get_src_suffix(self, env):\n        \"\"\"Get the first src_suffix in the list of src_suffixes.\"\"\"\n        ret = self.src_suffixes(env)\n        if not ret:\n            return ''\n        return ret[0]\n\n    def add_emitter(self, suffix, emitter):\n        \"\"\"Add a suffix-emitter mapping to this Builder.\n\n        This assumes that emitter has been initialized with an\n        appropriate dictionary type, and will throw a TypeError if\n        not, so the caller is responsible for knowing that this is an\n        appropriate method to call for the Builder in question.\n        \"\"\"\n        self.emitter[suffix] = emitter\n\n    def add_src_builder(self, builder):\n        \"\"\"\n        Add a new Builder to the list of src_builders.\n\n        This requires wiping out cached values so that the computed\n        lists of source suffixes get re-calculated.\n        \"\"\"\n        self._memo = {}\n        self.src_builder.append(builder)\n\n    def _get_sdict(self, env):\n        \"\"\"\n        Returns a dictionary mapping all of the source suffixes of all\n        src_builders of this Builder to the underlying Builder that\n        should be called first.\n\n        This dictionary is used for each target specified, so we save a\n        lot of extra computation by memoizing it for each construction\n        environment.\n\n        Note that this is re-computed each time, not cached, because there\n        might be changes to one of our source Builders (or one of their\n        source Builders, and so on, and so on...) that we can't \"see.\"\n\n        The underlying methods we call cache their computed values,\n        though, so we hope repeatedly aggregating them into a dictionary\n        like this won't be too big a hit.  We may need to look for a\n        better way to do this if performance data show this has turned\n        into a significant bottleneck.\n        \"\"\"\n        sdict = {}\n        for bld in self.get_src_builders(env):\n            for suf in bld.src_suffixes(env):\n                sdict[suf] = bld\n        return sdict\n\n    def src_builder_sources(self, env, source, overwarn={}):\n        sdict = self._get_sdict(env)\n\n        src_suffixes = self.src_suffixes(env)\n\n        lengths = list(set(map(len, src_suffixes)))\n\n        def match_src_suffix(name, src_suffixes=src_suffixes, lengths=lengths):\n            node_suffixes = [name[-l:] for l in lengths]\n            for suf in src_suffixes:\n                if suf in node_suffixes:\n                    return suf\n            return None\n\n        result = []\n        for s in SCons.Util.flatten(source):\n            if SCons.Util.is_String(s):\n                match_suffix = match_src_suffix(env.subst(s))\n                if not match_suffix and '.' not in s:\n                    src_suf = self.get_src_suffix(env)\n                    s = self._adjustixes(s, None, src_suf)[0]\n            else:\n                match_suffix = match_src_suffix(s.name)\n            if match_suffix:\n                try:\n                    bld = sdict[match_suffix]\n                except KeyError:\n                    result.append(s)\n                else:\n                    tlist = bld._execute(env, None, [s], overwarn)\n                    # If the subsidiary Builder returned more than one\n                    # target, then filter out any sources that this\n                    # Builder isn't capable of building.\n                    if len(tlist) > 1:\n                        tlist = [t for t in tlist if match_src_suffix(t.name)]\n                    result.extend(tlist)\n            else:\n                result.append(s)\n\n        source_factory = env.get_factory(self.source_factory)\n\n        return env.arg2nodes(result, source_factory)\n\n    def _get_src_builders_key(self, env):\n        return id(env)\n\n    @SCons.Memoize.CountDictCall(_get_src_builders_key)\n    def get_src_builders(self, env):\n        \"\"\"\n        Returns the list of source Builders for this Builder.\n\n        This exists mainly to look up Builders referenced as\n        strings in the 'BUILDER' variable of the construction\n        environment and cache the result.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['get_src_builders']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_src_builders'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        builders = []\n        for bld in self.src_builder:\n            if SCons.Util.is_String(bld):\n                try:\n                    bld = env['BUILDERS'][bld]\n                except KeyError:\n                    continue\n            builders.append(bld)\n\n        memo_dict[memo_key] = builders\n        return builders\n\n    def _subst_src_suffixes_key(self, env):\n        return id(env)\n\n    @SCons.Memoize.CountDictCall(_subst_src_suffixes_key)\n    def subst_src_suffixes(self, env):\n        \"\"\"\n        The suffix list may contain construction variable expansions,\n        so we have to evaluate the individual strings.  To avoid doing\n        this over and over, we memoize the results for each construction\n        environment.\n        \"\"\"\n        memo_key = id(env)\n        try:\n            memo_dict = self._memo['subst_src_suffixes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['subst_src_suffixes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n        suffixes = [env.subst(x) for x in self.src_suffix]\n        memo_dict[memo_key] = suffixes\n        return suffixes\n\n    def src_suffixes(self, env):\n        \"\"\"\n        Returns the list of source suffixes for all src_builders of this\n        Builder.\n\n        This is essentially a recursive descent of the src_builder \"tree.\"\n        (This value isn't cached because there may be changes in a\n        src_builder many levels deep that we can't see.)\n        \"\"\"\n        sdict = {}\n        suffixes = self.subst_src_suffixes(env)\n        for s in suffixes:\n            sdict[s] = 1\n        for builder in self.get_src_builders(env):\n            for s in builder.src_suffixes(env):\n                if s not in sdict:\n                    sdict[s] = 1\n                    suffixes.append(s)\n        return suffixes\n\nclass CompositeBuilder(SCons.Util.Proxy):\n    \"\"\"A Builder Proxy whose main purpose is to always have\n    a DictCmdGenerator as its action, and to provide access\n    to the DictCmdGenerator's add_action() method.\n    \"\"\"\n\n    def __init__(self, builder, cmdgen):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder')\n        SCons.Util.Proxy.__init__(self, builder)\n\n        # cmdgen should always be an instance of DictCmdGenerator.\n        self.cmdgen = cmdgen\n        self.builder = builder\n\n    __call__ = SCons.Util.Delegate('__call__')\n\n    def add_action(self, suffix, action):\n        self.cmdgen.add_action(suffix, action)\n        self.set_src_suffix(self.cmdgen.src_suffixes())\n\ndef is_a_Builder(obj):\n    \"\"\"\"Returns True if the specified obj is one of our Builder classes.\n\n    The test is complicated a bit by the fact that CompositeBuilder\n    is a proxy, not a subclass of BuilderBase.\n    \"\"\"\n    return (isinstance(obj, BuilderBase)\n            or isinstance(obj, CompositeBuilder)\n            or callable(obj))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"CacheDir support\n\"\"\"\n\nimport atexit\nimport json\nimport os\nimport stat\nimport sys\nimport uuid\n\nimport SCons.Action\nimport SCons.Errors\nimport SCons.Warnings\nimport SCons\n\ncache_enabled = True\ncache_debug = False\ncache_force = False\ncache_show = False\ncache_readonly = False\ncache_tmp_uuid = uuid.uuid4().hex\n\ndef CacheRetrieveFunc(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cd.requests += 1\n    cachedir, cachefile = cd.cachepath(t)\n    if not fs.exists(cachefile):\n        cd.CacheDebug('CacheRetrieve(%s):  %s not in cache\\n', t, cachefile)\n        return 1\n    cd.hits += 1\n    cd.CacheDebug('CacheRetrieve(%s):  retrieving from %s\\n', t, cachefile)\n    if SCons.Action.execute_actions:\n        if fs.islink(cachefile):\n            fs.symlink(fs.readlink(cachefile), t.get_internal_path())\n        else:\n            cd.copy_from_cache(env, cachefile, t.get_internal_path())\n            try:\n                os.utime(cachefile, None)\n            except OSError:\n                pass\n        st = fs.stat(cachefile)\n        fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n    return 0\n\ndef CacheRetrieveString(target, source, env):\n    t = target[0]\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if t.fs.exists(cachefile):\n        return \"Retrieved `%s' from cache\" % t.get_internal_path()\n    return None\n\nCacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)\n\nCacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)\n\ndef CachePushFunc(target, source, env):\n    if cache_readonly:\n        return\n\n    t = target[0]\n    if t.nocache:\n        return\n    fs = t.fs\n    cd = env.get_CacheDir()\n    cachedir, cachefile = cd.cachepath(t)\n    if fs.exists(cachefile):\n        # Don't bother copying it if it's already there.  Note that\n        # usually this \"shouldn't happen\" because if the file already\n        # existed in cache, we'd have retrieved the file from there,\n        # not built it.  This can happen, though, in a race, if some\n        # other person running the same build pushes their copy to\n        # the cache after we decide we need to build it but before our\n        # build completes.\n        cd.CacheDebug('CachePush(%s):  %s already exists in cache\\n', t, cachefile)\n        return\n\n    cd.CacheDebug('CachePush(%s):  pushing to %s\\n', t, cachefile)\n\n    tempfile = \"%s.tmp%s\"%(cachefile,cache_tmp_uuid)\n    errfmt = \"Unable to copy %s to cache. Cache file is %s\"\n\n    try:\n        fs.makedirs(cachedir, exist_ok=True)\n    except OSError:\n        msg = errfmt % (str(target), cachefile)\n        raise SCons.Errors.SConsEnvironmentError(msg)\n    try:\n        if fs.islink(t.get_internal_path()):\n            fs.symlink(fs.readlink(t.get_internal_path()), tempfile)\n        else:\n            cd.copy_to_cache(env, t.get_internal_path(), tempfile)\n        fs.rename(tempfile, cachefile)\n\n    except EnvironmentError:\n        # It's possible someone else tried writing the file at the\n        # same time we did, or else that there was some problem like\n        # the CacheDir being on a separate file system that's full.\n        # In any case, inability to push a file to cache doesn't affect\n        # the correctness of the build, so just print a warning.\n        msg = errfmt % (str(target), cachefile)\n        SCons.Warnings.warn(SCons.Warnings.CacheWriteErrorWarning, msg)\n\nCachePush = SCons.Action.Action(CachePushFunc, None)\n\n\nclass CacheDir:\n\n    def __init__(self, path):\n        \"\"\"\n        Initialize a CacheDir object.\n\n        The cache configuration is stored in the object. It\n        is read from the config file in the supplied path if\n        one exists,  if not the config file is created and\n        the default config is written, as well as saved in the object.\n        \"\"\"\n        self.requests = 0\n        self.hits = 0\n        self.path = path\n        self.current_cache_debug = None\n        self.debugFP = None\n        self.config = dict()\n        if path is None:\n            return\n\n        self._readconfig(path)\n\n\n    def _readconfig(self, path):\n        \"\"\"\n        Read the cache config.\n\n        If directory or config file do not exist, create.  Take advantage\n        of Py3 capability in os.makedirs() and in file open(): just try\n        the operation and handle failure appropriately.\n\n        Omit the check for old cache format, assume that's old enough\n        there will be none of those left to worry about.\n\n        :param path: path to the cache directory\n        \"\"\"\n        config_file = os.path.join(path, 'config')\n        try:\n            os.makedirs(path, exist_ok=True)\n        except FileExistsError:\n            pass\n        except OSError:\n            msg = \"Failed to create cache directory \" + path\n            raise SCons.Errors.SConsEnvironmentError(msg)\n\n        try:\n            with open(config_file, 'x') as config:\n                self.config['prefix_len'] = 2\n                try:\n                    json.dump(self.config, config)\n                except Exception:\n                    msg = \"Failed to write cache configuration for \" + path\n                    raise SCons.Errors.SConsEnvironmentError(msg)\n        except FileExistsError:\n            try:\n                with open(config_file) as config:\n                    self.config = json.load(config)\n            except ValueError:\n                msg = \"Failed to read cache configuration for \" + path\n                raise SCons.Errors.SConsEnvironmentError(msg)\n\n    def CacheDebug(self, fmt, target, cachefile):\n        if cache_debug != self.current_cache_debug:\n            if cache_debug == '-':\n                self.debugFP = sys.stdout\n            elif cache_debug:\n                def debug_cleanup(debugFP):\n                    debugFP.close()\n\n                self.debugFP = open(cache_debug, 'w')\n                atexit.register(debug_cleanup, self.debugFP)\n            else:\n                self.debugFP = None\n            self.current_cache_debug = cache_debug\n        if self.debugFP:\n            self.debugFP.write(fmt % (target, os.path.split(cachefile)[1]))\n            self.debugFP.write(\"requests: %d, hits: %d, misses: %d, hit rate: %.2f%%\\n\" %\n                               (self.requests, self.hits, self.misses, self.hit_ratio))\n\n    @classmethod\n    def copy_from_cache(cls, env, src, dst):\n        if env.cache_timestamp_newer:\n            return env.fs.copy(src, dst)\n        else:\n            return env.fs.copy2(src, dst)\n\n    @classmethod\n    def copy_to_cache(cls, env, src, dst):\n        try:\n            result = env.fs.copy2(src, dst)\n            fs = env.File(src).fs\n            st = fs.stat(src)\n            fs.chmod(dst, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n            return result\n        except AttributeError as ex:\n            raise EnvironmentError from ex\n\n    @property\n    def hit_ratio(self):\n        return (100.0 * self.hits / self.requests if self.requests > 0 else 100)\n\n    @property\n    def misses(self):\n        return self.requests - self.hits\n\n    def is_enabled(self):\n        return cache_enabled and self.path is not None\n\n    def is_readonly(self):\n        return cache_readonly\n\n    def get_cachedir_csig(self, node):\n        cachedir, cachefile = self.cachepath(node)\n        if cachefile and os.path.exists(cachefile):\n            return SCons.Util.hash_file_signature(cachefile, SCons.Node.FS.File.hash_chunksize)\n\n    def cachepath(self, node):\n        \"\"\"\n        \"\"\"\n        if not self.is_enabled():\n            return None, None\n\n        sig = node.get_cachedir_bsig()\n\n        subdir = sig[:self.config['prefix_len']].upper()\n\n        dir = os.path.join(self.path, subdir)\n        return dir, os.path.join(dir, sig)\n\n    def retrieve(self, node):\n        \"\"\"\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Note that there's a special trick here with the execute flag\n        (one that's not normally done for other actions).  Basically\n        if the user requested a no_exec (-n) build, then\n        SCons.Action.execute_actions is set to 0 and when any action\n        is called, it does its showing but then just returns zero\n        instead of actually calling the action execution operation.\n        The problem for caching is that if the file does NOT exist in\n        cache then the CacheRetrieveString won't return anything to\n        show for the task, but the Action.__call__ won't call\n        CacheRetrieveFunc; instead it just returns zero, which makes\n        the code below think that the file *was* successfully\n        retrieved from the cache, therefore it doesn't do any\n        subsequent building.  However, the CacheRetrieveString didn't\n        print anything because it didn't actually exist in the cache,\n        and no more build actions will be performed, so the user just\n        sees nothing.  The fix is to tell Action.__call__ to always\n        execute the CacheRetrieveFunc and then have the latter\n        explicitly check SCons.Action.execute_actions itself.\n        \"\"\"\n        if not self.is_enabled():\n            return False\n\n        env = node.get_build_env()\n        if cache_show:\n            if CacheRetrieveSilent(node, [], env, execute=1) == 0:\n                node.build(presub=0, execute=0)\n                return True\n        else:\n            if CacheRetrieve(node, [], env, execute=1) == 0:\n                return True\n\n        return False\n\n    def push(self, node):\n        if self.is_readonly() or not self.is_enabled():\n            return\n        return CachePush(node, [], node.get_build_env())\n\n    def push_if_forced(self, node):\n        if cache_force:\n            return self.push(node)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n# Copyright (c) 2003 Stichting NLnet Labs\n# Copyright (c) 2001, 2002, 2003 Steven Knight\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Autoconf-like configuration support\n\nThe purpose of this module is to define how a check is to be performed.\n\nA context class is used that defines functions for carrying out the tests,\nlogging and messages.  The following methods and members must be present:\n\ncontext.Display(msg)\n    Function called to print messages that are normally displayed\n    for the user.  Newlines are explicitly used.  The text should\n    also be written to the logfile!\n\ncontext.Log(msg)\n    Function called to write to a log file.\n\ncontext.BuildProg(text, ext)\n    Function called to build a program, using \"ext\" for the file\n    extension.  Must return an empty string for success, an error\n    message for failure.  For reliable test results building should\n    be done just like an actual program would be build, using the\n    same command and arguments (including configure results so far).\n\ncontext.CompileProg(text, ext)\n    Function called to compile a program, using \"ext\" for the file\n    extension.  Must return an empty string for success, an error\n    message for failure.  For reliable test results compiling should be\n    done just like an actual source file would be compiled, using the\n    same command and arguments (including configure results so far).\n\ncontext.AppendLIBS(lib_name_list)\n    Append \"lib_name_list\" to the value of LIBS.  \"lib_namelist\" is\n    a list of strings.  Return the value of LIBS before changing it\n    (any type can be used, it is passed to SetLIBS() later.)\n\ncontext.PrependLIBS(lib_name_list)\n    Prepend \"lib_name_list\" to the value of LIBS.  \"lib_namelist\" is\n    a list of strings.  Return the value of LIBS before changing it\n    (any type can be used, it is passed to SetLIBS() later.)\n\ncontext.SetLIBS(value)\n    Set LIBS to \"value\".  The type of \"value\" is what AppendLIBS()\n    returned.  Return the value of LIBS before changing it (any type\n    can be used, it is passed to SetLIBS() later.)\n\ncontext.headerfilename\n    Name of file to append configure results to, usually \"confdefs.h\".\n    The file must not exist or be empty when starting.  Empty or None\n    to skip this (some tests will not work!).\n\ncontext.config_h  (may be missing).\n    If present, must be a string, which will be filled with the\n    contents of a config_h file.\n\ncontext.vardict\n    Dictionary holding variables used for the tests and stores results\n    from the tests, used for the build commands.  Normally contains\n    \"CC\", \"LIBS\", \"CPPFLAGS\", etc.\n\ncontext.havedict\n    Dictionary holding results from the tests that are to be used\n    inside a program.  Names often start with \"HAVE_\".  These are zero\n    (feature not present) or one (feature present).  Other variables\n    may have any value, e.g., \"PERLVERSION\" can be a number and\n    \"SYSTEMNAME\" a string.\n\"\"\"\n\nimport re\n\n#\n# PUBLIC VARIABLES\n#\n\nLogInputFiles = 1    # Set that to log the input files in case of a failed test\nLogErrorMessages = 1 # Set that to log Conftest-generated error messages\n\n#\n# PUBLIC FUNCTIONS\n#\n\n# Generic remarks:\n# - When a language is specified which is not supported the test fails.  The\n#   message is a bit different, because not all the arguments for the normal\n#   message are available yet (chicken-egg problem).\n\n\ndef CheckBuilder(context, text = None, language = None):\n    \"\"\"\n    Configure check to see if the compiler works.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    \"text\" may be used to specify the code to be build.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"%s\\n\" % msg)\n        return msg\n\n    if not text:\n        text = \"\"\"\nint main(void) {\n    return 0;\n}\n\"\"\"\n\n    context.Display(\"Checking if building a %s file works... \" % lang)\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCC(context):\n    \"\"\"\n    Configure check for a working C compiler.\n\n    This checks whether the C compiler, as defined in the $CC construction\n    variable, can compile a C source file. It uses the current $CCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CC', text, 'C')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCC(context):\n    \"\"\"\n    Configure check for a working shared C compiler.\n\n    This checks whether the C compiler, as defined in the $SHCC construction\n    variable, can compile a C source file. It uses the current $SHCCCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C compiler works... \")\n    text = \"\"\"\nint foo(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCC', text, 'C', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckCXX(context):\n    \"\"\"\n    Configure check for a working CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $CXX construction\n    variable, can compile a CXX source file. It uses the current $CXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the C++ compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'CXX', text, 'C++')\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef CheckSHCXX(context):\n    \"\"\"\n    Configure check for a working shared CXX compiler.\n\n    This checks whether the CXX compiler, as defined in the $SHCXX construction\n    variable, can compile a CXX source file. It uses the current $SHCXXCOM value\n    too, so that it can test against non working flags.\n\n    \"\"\"\n    context.Display(\"Checking whether the (shared) C++ compiler works... \")\n    text = \"\"\"\nint main(void)\n{\n    return 0;\n}\n\"\"\"\n    ret = _check_empty_program(context, 'SHCXX', text, 'C++', use_shared = True)\n    _YesNoResult(context, ret, None, text)\n    return ret\n\ndef _check_empty_program(context, comp, text, language, use_shared = False):\n    \"\"\"Return 0 on success, 1 otherwise.\"\"\"\n    if comp not in context.env or not context.env[comp]:\n        # The compiler construction variable is not set or empty\n        return 1\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        return 1\n\n    if use_shared:\n        return context.CompileSharedObject(text, suffix)\n    else:\n        return context.CompileProg(text, suffix)\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    \"\"\"\n    Configure check for a function \"function_name\".\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Optional \"header\" can be defined to define a function prototype, include a\n    header file or anything else that comes before main().\n    Sets HAVE_function_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Remarks from autoconf:\n    # - Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>\n    #   which includes <sys/select.h> which contains a prototype for select.\n    #   Similarly for bzero.\n    # - assert.h is included to define __stub macros and hopefully few\n    #   prototypes, which can conflict with char $1(); below.\n    # - Override any gcc2 internal prototype to avoid an error.\n    # - We use char for the function declaration because int might match the\n    #   return type of a gcc2 builtin and then its argument prototype would\n    #   still apply.\n    # - The GNU C library defines this for functions which it implements to\n    #   always fail with ENOSYS.  Some functions are actually named something\n    #   starting with __ and the normal name is an alias.\n\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\"\"\" % function_name\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s(): %s\\n\" % (function_name, msg))\n        return msg\n\n    text = \"\"\"\n%(include)s\n#include <assert.h>\n%(hdr)s\n\n#if _MSC_VER && !__INTEL_COMPILER\n    #pragma function(%(name)s)\n#endif\n\nint main(void) {\n#if defined (__stub_%(name)s) || defined (__stub___%(name)s)\n  fail fail fail\n#else\n  %(name)s();\n#endif\n\n  return 0;\n}\n\"\"\" % { 'name': function_name,\n        'include': includetext,\n        'hdr': header }\n\n    context.Display(\"Checking for %s function %s()... \" % (lang, function_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + function_name, text,\n                 \"Define to 1 if the system has the function `%s'.\" %\\\n                 function_name)\n    return ret\n\n\ndef CheckHeader(context, header_name, header=None, language=None,\n                include_quotes=None):\n    \"\"\"\n    Configure check for a C or C++ header file \"header_name\".\n    Optional \"header\" can be defined to do something before including the\n    header file (unusual, supported for consistency).\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_header_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS and $CPPFLAGS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Why compile the program instead of just running the preprocessor?\n    # It is possible that the header file exists, but actually using it may\n    # fail (e.g., because it depends on other header files).  Thus this test is\n    # more strict.  It may require using the \"header\" argument.\n    #\n    # Use <> by default, because the check is normally used for system header\n    # files.  SCons passes '\"\"' to overrule this.\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"\\n' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for header file %s: %s\\n\"\n                                                          % (header_name, msg))\n        return msg\n\n    if not include_quotes:\n        include_quotes = \"<>\"\n\n    text = \"%s%s\\n#include %s%s%s\\n\\n\" % (includetext, header,\n                             include_quotes[0], header_name, include_quotes[1])\n\n    context.Display(\"Checking for %s header file %s... \" % (lang, header_name))\n    ret = context.CompileProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + header_name, text,\n                 \"Define to 1 if you have the <%s> header file.\" % header_name)\n    return ret\n\n\ndef CheckType(context, type_name, fallback = None,\n                                               header = None, language = None):\n    \"\"\"\n    Configure check for a C or C++ type \"type_name\".\n    Optional \"header\" can be defined to include a header file.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Sets HAVE_type_name in context.havedict according to the result.\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    # Remarks from autoconf about this test:\n    # - Grepping for the type in include files is not reliable (grep isn't\n    #   portable anyway).\n    # - Using \"TYPE my_var;\" doesn't work for const qualified types in C++.\n    #   Adding an initializer is not valid for some C++ classes.\n    # - Using the type as parameter to a function either fails for K&$ C or for\n    #   C++.\n    # - Using \"TYPE *my_var;\" is valid in C for some types that are not\n    #   declared (struct something).\n    # - Using \"sizeof(TYPE)\" is valid when TYPE is actually a variable.\n    # - Using the previous two together works reliably.\n    text = \"\"\"\n%(include)s\n%(header)s\n\nint main(void) {\n  if ((%(name)s *) 0)\n    return 0;\n  if (sizeof (%(name)s))\n    return 0;\n}\n\"\"\" % { 'include': includetext,\n        'header': header,\n        'name': type_name }\n\n    context.Display(\"Checking for %s type %s... \" % (lang, type_name))\n    ret = context.BuildProg(text, suffix)\n    _YesNoResult(context, ret, \"HAVE_\" + type_name, text,\n                 \"Define to 1 if the system has the type `%s'.\" % type_name)\n    if ret and fallback and context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(\"typedef %s %s;\\n\" % (fallback, type_name))\n        f.close()\n\n    return ret\n\ndef CheckTypeSize(context, type_name, header = None, language = None, expect = None):\n    \"\"\"This check can be used to get the size of a given type, or to check whether\n    the type is of expected size.\n\n    Arguments:\n        - type : str\n            the type to check\n        - includes : sequence\n            list of headers to include in the test code before testing the type\n        - language : str\n            'C' or 'C++'\n        - expect : int\n            if given, will test wether the type has the given number of bytes.\n            If not given, will automatically find the size.\n\n        Returns:\n            status : int\n                0 if the check failed, or the found size of the type if the check succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not header:\n        header = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for %s type: %s\\n\" % (type_name, msg))\n        return msg\n\n    src = includetext + header\n    if expect is not None:\n        # Only check if the given size is the right one\n        context.Display('Checking %s is %d bytes... ' % (type_name, expect))\n\n        # test code taken from autoconf: this is a pretty clever hack to find that\n        # a type is of a given size using only compilation. This speeds things up\n        # quite a bit compared to straightforward code using TryRun\n        src = src + r\"\"\"\ntypedef %s scons_check_type;\n\nint main(void)\n{\n    static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)];\n    test_array[0] = 0;\n\n    return 0;\n}\n\"\"\"\n\n        st = context.CompileProg(src % (type_name, expect), suffix)\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, expect,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return expect\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n    else:\n        # Only check if the given size is the right one\n        context.Message('Checking size of %s ... ' % type_name)\n\n        # We have to be careful with the program we wish to test here since\n        # compilation will be attempted using the current environment's flags.\n        # So make sure that the program will compile without any warning. For\n        # example using: 'int main(int argc, char** argv)' will fail with the\n        # '-Wall -Werror' flags since the variables argc and argv would not be\n        # used in the program...\n        #\n        src = src + \"\"\"\n#include <stdlib.h>\n#include <stdio.h>\nint main(void) {\n    printf(\"%d\", (int)sizeof(\"\"\" + type_name + \"\"\"));\n    return 0;\n}\n    \"\"\"\n        st, out = context.RunProg(src, suffix)\n        try:\n            size = int(out)\n        except ValueError:\n            # If cannot convert output of test prog to an integer (the size),\n            # something went wront, so just fail\n            st = 1\n            size = 0\n\n        if not st:\n            context.Display(\"yes\\n\")\n            _Have(context, \"SIZEOF_%s\" % type_name, size,\n                  \"The size of `%s', as computed by sizeof.\" % type_name)\n            return size\n        else:\n            context.Display(\"no\\n\")\n            _LogFailed(context, src, st)\n            return 0\n\n    return 0\n\ndef CheckDeclaration(context, symbol, includes = None, language = None):\n    \"\"\"Checks whether symbol is declared.\n\n    Use the same test as autoconf, that is test whether the symbol is defined\n    as a macro or can be used as an r-value.\n\n    Arguments:\n        symbol : str\n            the symbol to check\n        includes : str\n            Optional \"header\" can be defined to include a header file.\n        language : str\n            only C and C++ supported.\n\n    Returns:\n        status : bool\n            True if the check failed, False if succeeded.\"\"\"\n\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n\n    if not includes:\n        includes = \"\"\n\n    lang, suffix, msg = _lang2suffix(language)\n    if msg:\n        context.Display(\"Cannot check for declaration %s: %s\\n\" % (symbol, msg))\n        return msg\n\n    src = includetext + includes\n    context.Display('Checking whether %s is declared... ' % symbol)\n\n    src = src + r\"\"\"\nint main(void)\n{\n#ifndef %s\n    (void) %s;\n#endif\n    ;\n    return 0;\n}\n\"\"\" % (symbol, symbol)\n\n    st = context.CompileProg(src, suffix)\n    _YesNoResult(context, st, \"HAVE_DECL_\" + symbol, src,\n                 \"Set to 1 if %s is defined.\" % symbol)\n    return st\n\ndef CheckLib(context, libs, func_name = None, header = None,\n             extra_libs = None, call = None, language = None, autoadd = 1,\n             append = True):\n    \"\"\"\n    Configure check for a C or C++ libraries \"libs\".  Searches through\n    the list of libraries, until one is found where the test succeeds.\n    Tests if \"func_name\" or \"call\" exists in the library.  Note: if it exists\n    in another library the test succeeds anyway!\n    Optional \"header\" can be defined to include a header file.  If not given a\n    default prototype for \"func_name\" is added.\n    Optional \"extra_libs\" is a list of library names to be added after\n    \"lib_name\" in the build command.  To be used for libraries that \"lib_name\"\n    depends on.\n    Optional \"call\" replaces the call to \"func_name\" in the test code.  It must\n    consist of complete C statements, including a trailing \";\".\n    Both \"func_name\" and \"call\" arguments are optional, and in that case, just\n    linking against the libs is tested.\n    \"language\" should be \"C\" or \"C++\" and is used to select the compiler.\n    Default is \"C\".\n    Note that this uses the current value of compiler and linker flags, make\n    sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.\n    Returns an empty string for success, an error message for failure.\n    \"\"\"\n    # Include \"confdefs.h\" first, so that the header can use HAVE_HEADER_H.\n    if context.headerfilename:\n        includetext = '#include \"%s\"' % context.headerfilename\n    else:\n        includetext = ''\n    if not header:\n        header = \"\"\n\n    text = \"\"\"\n%s\n%s\"\"\" % (includetext, header)\n\n    # Add a function declaration if needed.\n    if func_name and func_name != \"main\":\n        if not header:\n            text = text + \"\"\"\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar %s();\n\"\"\" % func_name\n\n        # The actual test code.\n        if not call:\n            call = \"%s();\" % func_name\n\n    # if no function to test, leave main() blank\n    text = text + \"\"\"\nint\nmain() {\n  %s\nreturn 0;\n}\n\"\"\" % (call or \"\")\n\n    if call:\n        i = call.find(\"\\n\")\n        if i > 0:\n            calltext = call[:i] + \"..\"\n        elif call[-1] == ';':\n            calltext = call[:-1]\n        else:\n            calltext = call\n\n    for lib_name in libs:\n\n        lang, suffix, msg = _lang2suffix(language)\n        if msg:\n            context.Display(\"Cannot check for library %s: %s\\n\" % (lib_name, msg))\n            return msg\n\n        # if a function was specified to run in main(), say it\n        if call:\n                context.Display(\"Checking for %s in %s library %s... \"\n                                % (calltext, lang, lib_name))\n        # otherwise, just say the name of library and language\n        else:\n                context.Display(\"Checking for %s library %s... \"\n                                % (lang, lib_name))\n\n        if lib_name:\n            l = [ lib_name ]\n            if extra_libs:\n                l.extend(extra_libs)\n            if append:\n                oldLIBS = context.AppendLIBS(l)\n            else:\n                oldLIBS = context.PrependLIBS(l)\n            sym = \"HAVE_LIB\" + lib_name\n        else:\n            oldLIBS = -1\n            sym = None\n\n        ret = context.BuildProg(text, suffix)\n\n        _YesNoResult(context, ret, sym, text,\n                     \"Define to 1 if you have the `%s' library.\" % lib_name)\n        if oldLIBS != -1 and (ret or not autoadd):\n            context.SetLIBS(oldLIBS)\n\n        if not ret:\n            return ret\n\n    return ret\n\ndef CheckProg(context, prog_name):\n    \"\"\"\n    Configure check for a specific program.\n\n    Check whether program prog_name exists in path.  If it is found,\n    returns the path for it, otherwise returns None.\n    \"\"\"\n    context.Display(\"Checking whether %s program exists...\" % prog_name)\n    path = context.env.WhereIs(prog_name)\n    if path:\n        context.Display(path + \"\\n\")\n    else:\n        context.Display(\"no\\n\")\n    return path\n\n\n#\n# END OF PUBLIC FUNCTIONS\n#\n\ndef _YesNoResult(context, ret, key, text, comment = None):\n    r\"\"\"\n    Handle the result of a test with a \"yes\" or \"no\" result.\n\n    :Parameters:\n      - `ret` is the return value: empty if OK, error message when not.\n      - `key` is the name of the symbol to be defined (HAVE_foo).\n      - `text` is the source code of the program used for testing.\n      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\\* \\*/). If None, no comment is added.\n    \"\"\"\n    if key:\n        _Have(context, key, not ret, comment)\n    if ret:\n        context.Display(\"no\\n\")\n        _LogFailed(context, text, ret)\n    else:\n        context.Display(\"yes\\n\")\n\n\ndef _Have(context, key, have, comment = None):\n    r\"\"\"\n    Store result of a test in context.havedict and context.headerfilename.\n\n    :Parameters:\n      - `key` - is a \"HAVE_abc\" name.  It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.\n      - `have`   - value as it should appear in the header file, include quotes when desired and escape special characters!\n      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\\* \\*/). If None, no comment is added.\n\n\n    The value of \"have\" can be:\n      - 1      - Feature is defined, add \"#define key\".\n      - 0      - Feature is not defined, add \"/\\* #undef key \\*/\". Adding \"undef\" is what autoconf does.  Not useful for the compiler, but it shows that the test was done.\n      - number - Feature is defined to this number \"#define key have\". Doesn't work for 0 or 1, use a string then.\n      - string - Feature is defined to this string \"#define key have\".\n\n\n    \"\"\"\n    key_up = key.upper()\n    key_up = re.sub('[^A-Z0-9_]', '_', key_up)\n    context.havedict[key_up] = have\n    if have == 1:\n        line = \"#define %s 1\\n\" % key_up\n    elif have == 0:\n        line = \"/* #undef %s */\\n\" % key_up\n    elif isinstance(have, int):\n        line = \"#define %s %d\\n\" % (key_up, have)\n    else:\n        line = \"#define %s %s\\n\" % (key_up, str(have))\n\n    if comment is not None:\n        lines = \"\\n/* %s */\\n\" % comment + line\n    else:\n        lines = \"\\n\" + line\n\n    if context.headerfilename:\n        f = open(context.headerfilename, \"a\")\n        f.write(lines)\n        f.close()\n    elif hasattr(context,'config_h'):\n        context.config_h = context.config_h + lines\n\n\ndef _LogFailed(context, text, msg):\n    \"\"\"\n    Write to the log about a failed program.\n    Add line numbers, so that error messages can be understood.\n    \"\"\"\n    if LogInputFiles:\n        context.Log(\"Failed program was:\\n\")\n        lines = text.split('\\n')\n        if len(lines) and lines[-1] == '':\n            lines = lines[:-1]              # remove trailing empty line\n        n = 1\n        for line in lines:\n            context.Log(\"%d: %s\\n\" % (n, line))\n            n = n + 1\n    if LogErrorMessages:\n        context.Log(\"Error message: %s\\n\" % msg)\n\n\ndef _lang2suffix(lang):\n    \"\"\"\n    Convert a language name to a suffix.\n    When \"lang\" is empty or None C is assumed.\n    Returns a tuple (lang, suffix, None) when it works.\n    For an unrecognized language returns (None, None, msg).\n\n    Where:\n      - lang   = the unified language name\n      - suffix = the suffix, including the leading dot\n      - msg    = an error message\n    \"\"\"\n    if not lang or lang in [\"C\", \"c\"]:\n        return (\"C\", \".c\", None)\n    if lang in [\"c++\", \"C++\", \"cpp\", \"CXX\", \"cxx\"]:\n        return (\"C++\", \".cpp\", None)\n\n    return None, None, \"Unsupported language: %s\" % lang\n\n\n# vim: set sw=4 et sts=4 tw=79 fo+=l:\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Code for debugging SCons internal things.\n\nShouldn't be needed by most users. Quick shortcuts:\n\nfrom SCons.Debug import caller_trace\ncaller_trace()\n\"\"\"\n\nimport atexit\nimport os\nimport sys\nimport time\nimport weakref\nimport inspect\n\n# Global variable that gets set to 'True' by the Main script,\n# when the creation of class instances should get tracked.\ntrack_instances = False\n# List of currently tracked classes\ntracked_classes = {}\n\ndef logInstanceCreation(instance, name=None):\n    if name is None:\n        name = instance.__class__.__name__\n    if name not in tracked_classes:\n        tracked_classes[name] = []\n    if hasattr(instance, '__dict__'):\n        tracked_classes[name].append(weakref.ref(instance))\n    else:\n        # weakref doesn't seem to work when the instance\n        # contains only slots...\n        tracked_classes[name].append(instance)\n\ndef string_to_classes(s):\n    if s == '*':\n        return sorted(tracked_classes.keys())\n    else:\n        return s.split()\n\ndef fetchLoggedInstances(classes=\"*\"):\n    classnames = string_to_classes(classes)\n    return [(cn, len(tracked_classes[cn])) for cn in classnames]\n\ndef countLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write(\"%s: %d\\n\" % (classname, len(tracked_classes[classname])))\n\ndef listLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            if inspect.isclass(ref):\n                obj = ref()\n            else:\n                obj = ref\n            if obj is not None:\n                file.write('    %s\\n' % repr(obj))\n\ndef dumpLoggedInstances(classes, file=sys.stdout):\n    for classname in string_to_classes(classes):\n        file.write('\\n%s:\\n' % classname)\n        for ref in tracked_classes[classname]:\n            obj = ref()\n            if obj is not None:\n                file.write('    %s:\\n' % obj)\n                for key, value in obj.__dict__.items():\n                    file.write('        %20s : %s\\n' % (key, value))\n\n\nif sys.platform[:5] == \"linux\":\n    # Linux doesn't actually support memory usage stats from getrusage().\n    def memory():\n        with open('/proc/self/stat') as f:\n            mstr = f.read()\n        mstr = mstr.split()[22]\n        return int(mstr)\nelif sys.platform[:6] == 'darwin':\n    #TODO really get memory stats for OS X\n    def memory():\n        return 0\nelif sys.platform == 'win32':\n    from SCons.compat.win32 import get_peak_memory_usage\n    memory = get_peak_memory_usage\nelse:\n    try:\n        import resource\n    except ImportError:\n        def memory():\n            return 0\n    else:\n        def memory():\n            res = resource.getrusage(resource.RUSAGE_SELF)\n            return res[4]\n\n\ndef caller_stack():\n    \"\"\"return caller's stack\"\"\"\n    import traceback\n    tb = traceback.extract_stack()\n    # strip itself and the caller from the output\n    tb = tb[:-2]\n    result = []\n    for back in tb:\n        # (filename, line number, function name, text)\n        key = back[:3]\n        result.append('%s:%d(%s)' % func_shorten(key))\n    return result\n\ncaller_bases = {}\ncaller_dicts = {}\n\ndef caller_trace(back=0):\n    \"\"\"\n    Trace caller stack and save info into global dicts, which\n    are printed automatically at the end of SCons execution.\n    \"\"\"\n    global caller_bases, caller_dicts\n    import traceback\n    tb = traceback.extract_stack(limit=3+back)\n    tb.reverse()\n    callee = tb[1][:3]\n    caller_bases[callee] = caller_bases.get(callee, 0) + 1\n    for caller in tb[2:]:\n        caller = callee + caller[:3]\n        try:\n            entry = caller_dicts[callee]\n        except KeyError:\n            caller_dicts[callee] = entry = {}\n        entry[caller] = entry.get(caller, 0) + 1\n        callee = caller\n\n# print a single caller and its callers, if any\ndef _dump_one_caller(key, file, level=0):\n    leader = '      '*level\n    for v,c in sorted([(-v,c) for c,v in caller_dicts[key].items()]):\n        file.write(\"%s  %6d %s:%d(%s)\\n\" % ((leader,-v) + func_shorten(c[-3:])))\n        if c in caller_dicts:\n            _dump_one_caller(c, file, level+1)\n\n# print each call tree\ndef dump_caller_counts(file=sys.stdout):\n    for k in sorted(caller_bases.keys()):\n        file.write(\"Callers of %s:%d(%s), %d calls:\\n\"\n                    % (func_shorten(k) + (caller_bases[k],)))\n        _dump_one_caller(k, file)\n\nshorten_list = [\n    ( '/scons/SCons/',          1),\n    ( '/src/engine/SCons/',     1),\n    ( '/usr/lib/python',        0),\n]\n\nif os.sep != '/':\n    shorten_list = [(t[0].replace('/', os.sep), t[1]) for t in shorten_list]\n\ndef func_shorten(func_tuple):\n    f = func_tuple[0]\n    for t in shorten_list:\n        i = f.find(t[0])\n        if i >= 0:\n            if t[1]:\n                i = i + len(t[0])\n            return (f[i:],)+func_tuple[1:]\n    return func_tuple\n\n\nTraceFP = {}\nif sys.platform == 'win32':\n    TraceDefault = 'con'\nelse:\n    TraceDefault = '/dev/tty'\nTimeStampDefault = False\nStartTime = time.perf_counter()\nPreviousTime = StartTime\n\ndef Trace(msg, tracefile=None, mode='w', tstamp=False):\n    \"\"\"Write a trace message.\n\n    Write messages when debugging which do not interfere with stdout.\n    Useful in tests, which monitor stdout and would break with\n    unexpected output. Trace messages can go to the console (which is\n    opened as a file), or to a disk file; the tracefile argument persists\n    across calls unless overridden.\n\n    Args:\n        tracefile: file to write trace message to. If omitted,\n          write to the previous trace file (default: console).\n        mode: file open mode (default: 'w')\n        tstamp: write relative timestamps with trace. Outputs time since\n          scons was started, and time since last trace (default: False)\n\n    \"\"\"\n    global TraceDefault\n    global TimeStampDefault\n    global PreviousTime\n\n    def trace_cleanup(traceFP):\n        traceFP.close()\n\n    if tracefile is None:\n        tracefile = TraceDefault\n    else:\n        TraceDefault = tracefile\n    if not tstamp:\n        tstamp = TimeStampDefault\n    else:\n        TimeStampDefault = tstamp\n    try:\n        fp = TraceFP[tracefile]\n    except KeyError:\n        try:\n            fp = TraceFP[tracefile] = open(tracefile, mode)\n            atexit.register(trace_cleanup, fp)\n        except TypeError:\n            # Assume we were passed an open file pointer.\n            fp = tracefile\n    if tstamp:\n        now = time.perf_counter()\n        fp.write('%8.4f %8.4f:  ' % (now - StartTime, now - PreviousTime))\n        PreviousTime = now\n    fp.write(msg)\n    fp.flush()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\"\"\"Builders and other things for the local site.\n\nHere's where we'll duplicate the functionality of autoconf until we\nmove it into the installation procedure or use something like qmconf.\n\nThe code that reads the registry to find MSVC components was borrowed\nfrom distutils.msvccompiler.\n\"\"\"\n\nimport os\nimport shutil\nimport stat\nimport sys\nimport time\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.CacheDir\nimport SCons.Environment\nimport SCons.PathList\nimport SCons.Scanner.Dir\nimport SCons.Subst\nimport SCons.Tool\n\n# A placeholder for a default Environment (for fetching source files\n# from source code management systems and the like).  This must be\n# initialized later, after the top-level directory is set by the calling\n# interface.\n_default_env = None\n\n\n# Lazily instantiate the default environment so the overhead of creating\n# it doesn't apply when it's not needed.\ndef _fetch_DefaultEnvironment(*args, **kw):\n    \"\"\"Returns the already-created default construction environment.\"\"\"\n    global _default_env\n    return _default_env\n\n\ndef DefaultEnvironment(*args, **kw):\n    \"\"\"\n    Initial public entry point for creating the default construction\n    Environment.\n\n    After creating the environment, we overwrite our name\n    (DefaultEnvironment) with the _fetch_DefaultEnvironment() function,\n    which more efficiently returns the initialized default construction\n    environment without checking for its existence.\n\n    (This function still exists with its _default_check because someone\n    else (*cough* Script/__init__.py *cough*) may keep a reference\n    to this function.  So we can't use the fully functional idiom of\n    having the name originally be a something that *only* creates the\n    construction environment and then overwrites the name.)\n    \"\"\"\n    global _default_env\n    if not _default_env:\n        import SCons.Util\n        _default_env = SCons.Environment.Environment(*args, **kw)\n        _default_env.Decider('content')\n        global DefaultEnvironment\n        DefaultEnvironment = _fetch_DefaultEnvironment\n        _default_env._CacheDir_path = None\n    return _default_env\n\n\n# Emitters for setting the shared attribute on object files,\n# and an action for checking that all of the source files\n# going into a shared library are, in fact, shared.\ndef StaticObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = None\n    return target, source\n\n\ndef SharedObjectEmitter(target, source, env):\n    for tgt in target:\n        tgt.attributes.shared = 1\n    return target, source\n\n\ndef SharedFlagChecker(source, target, env):\n    same = env.subst('$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME')\n    if same == '0' or same == '' or same == 'False':\n        for src in source:\n            try:\n                shared = src.attributes.shared\n            except AttributeError:\n                shared = None\n            if not shared:\n                raise SCons.Errors.UserError(\n                    \"Source file: %s is static and is not compatible with shared target: %s\" % (src, target[0]))\n\n\nSharedCheck = SCons.Action.Action(SharedFlagChecker, None)\n\n# Some people were using these variable name before we made\n# SourceFileScanner part of the public interface.  Don't break their\n# SConscript files until we've given them some fair warning and a\n# transition period.\nCScan = SCons.Tool.CScanner\n# Nuitka: Avoid unused tools\n# DScan = SCons.Tool.DScanner\n# LaTeXScan = SCons.Tool.LaTeXScanner\n# ObjSourceScan = SCons.Tool.SourceFileScanner\nProgScan = SCons.Tool.ProgramScanner\n\n# These aren't really tool scanners, so they don't quite belong with\n# the rest of those in Tool/__init__.py, but I'm not sure where else\n# they should go.  Leave them here for now.\n\nDirScanner = SCons.Scanner.Dir.DirScanner()\nDirEntryScanner = SCons.Scanner.Dir.DirEntryScanner()\n\n# Actions for common languages.\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\")\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\")\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\")\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\")\n\nDAction = SCons.Action.Action(\"$DCOM\", \"$DCOMSTR\")\nShDAction = SCons.Action.Action(\"$SHDCOM\", \"$SHDCOMSTR\")\n\nASAction = SCons.Action.Action(\"$ASCOM\", \"$ASCOMSTR\")\nASPPAction = SCons.Action.Action(\"$ASPPCOM\", \"$ASPPCOMSTR\")\n\nLinkAction = SCons.Action.Action(\"$LINKCOM\", \"$LINKCOMSTR\")\nShLinkAction = SCons.Action.Action(\"$SHLINKCOM\", \"$SHLINKCOMSTR\")\n\nLdModuleLinkAction = SCons.Action.Action(\"$LDMODULECOM\", \"$LDMODULECOMSTR\")\n\n# Common tasks that we allow users to perform in platform-independent\n# ways by creating ActionFactory instances.\nActionFactory = SCons.Action.ActionFactory\n\n\ndef get_paths_str(dest):\n    # If dest is a list, we need to manually call str() on each element\n    if SCons.Util.is_List(dest):\n        elem_strs = []\n        for element in dest:\n            elem_strs.append('\"' + str(element) + '\"')\n        return '[' + ', '.join(elem_strs) + ']'\n    else:\n        return '\"' + str(dest) + '\"'\n\n\npermission_dic = {\n    'u': {\n        'r': stat.S_IRUSR,\n        'w': stat.S_IWUSR,\n        'x': stat.S_IXUSR\n    },\n    'g': {\n        'r': stat.S_IRGRP,\n        'w': stat.S_IWGRP,\n        'x': stat.S_IXGRP\n    },\n    'o': {\n        'r': stat.S_IROTH,\n        'w': stat.S_IWOTH,\n        'x': stat.S_IXOTH\n    }\n}\n\n\ndef chmod_func(dest, mode):\n    import SCons.Util\n    from string import digits\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    if SCons.Util.is_String(mode) and 0 not in [i in digits for i in mode]:\n        mode = int(mode, 8)\n    if not SCons.Util.is_String(mode):\n        for element in dest:\n            os.chmod(str(element), mode)\n    else:\n        mode = str(mode)\n        for operation in mode.split(\",\"):\n            if \"=\" in operation:\n                operator = \"=\"\n            elif \"+\" in operation:\n                operator = \"+\"\n            elif \"-\" in operation:\n                operator = \"-\"\n            else:\n                raise SyntaxError(\"Could not find +, - or =\")\n            operation_list = operation.split(operator)\n            if len(operation_list) != 2:\n                raise SyntaxError(\"More than one operator found\")\n            user = operation_list[0].strip().replace(\"a\", \"ugo\")\n            permission = operation_list[1].strip()\n            new_perm = 0\n            for u in user:\n                for p in permission:\n                    try:\n                        new_perm = new_perm | permission_dic[u][p]\n                    except KeyError:\n                        raise SyntaxError(\"Unrecognized user or permission format\")\n            for element in dest:\n                curr_perm = os.stat(str(element)).st_mode\n                if operator == \"=\":\n                    os.chmod(str(element), new_perm)\n                elif operator == \"+\":\n                    os.chmod(str(element), curr_perm | new_perm)\n                elif operator == \"-\":\n                    os.chmod(str(element), curr_perm & ~new_perm)\n\n\ndef chmod_strfunc(dest, mode):\n    import SCons.Util\n    if not SCons.Util.is_String(mode):\n        return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)\n    else:\n        return 'Chmod(%s, \"%s\")' % (get_paths_str(dest), str(mode))\n\n\nChmod = ActionFactory(chmod_func, chmod_strfunc)\n\n\ndef copy_func(dest, src, symlinks=True):\n    \"\"\"\n    If symlinks (is true), then a symbolic link will be\n    shallow copied and recreated as a symbolic link; otherwise, copying\n    a symbolic link will be equivalent to copying the symbolic link's\n    final target regardless of symbolic link depth.\n    \"\"\"\n\n    dest = str(dest)\n    src = str(src)\n\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if SCons.Util.is_List(src) and os.path.isdir(dest):\n        for file in src:\n            shutil.copy2(file, dest)\n        return 0\n    elif os.path.islink(src):\n        if symlinks:\n            return os.symlink(os.readlink(src), dest)\n        else:\n            return copy_func(dest, os.path.realpath(src))\n    elif os.path.isfile(src):\n        shutil.copy2(src, dest)\n        return 0\n    else:\n        shutil.copytree(src, dest, symlinks)\n        # copytree returns None in python2 and destination string in python3\n        # A error is raised in both cases, so we can just return 0 for success\n        return 0\n\n\nCopy = ActionFactory(\n    copy_func,\n    lambda dest, src, symlinks=True: 'Copy(\"%s\", \"%s\")' % (dest, src)\n)\n\n\ndef delete_func(dest, must_exist=0):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        entry = str(entry)\n        # os.path.exists returns False with broken links that exist\n        entry_exists = os.path.exists(entry) or os.path.islink(entry)\n        if not entry_exists and not must_exist:\n            continue\n        # os.path.isdir returns True when entry is a link to a dir\n        if os.path.isdir(entry) and not os.path.islink(entry):\n            shutil.rmtree(entry, True)\n            continue\n        os.unlink(entry)\n\n\ndef delete_strfunc(dest, must_exist=0):\n    return 'Delete(%s)' % get_paths_str(dest)\n\n\nDelete = ActionFactory(delete_func, delete_strfunc)\n\n\ndef mkdir_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for entry in dest:\n        os.makedirs(str(entry), exist_ok=True)\n\n\nMkdir = ActionFactory(mkdir_func,\n                      lambda _dir: 'Mkdir(%s)' % get_paths_str(_dir))\n\n\ndef move_func(dest, src):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    SCons.Node.FS.invalidate_node_memos(src)\n    shutil.move(src, dest)\n\n\nMove = ActionFactory(move_func,\n                     lambda dest, src: 'Move(\"%s\", \"%s\")' % (dest, src),\n                     convert=str)\n\n\ndef touch_func(dest):\n    SCons.Node.FS.invalidate_node_memos(dest)\n    if not SCons.Util.is_List(dest):\n        dest = [dest]\n    for file in dest:\n        file = str(file)\n        mtime = int(time.time())\n        if os.path.exists(file):\n            atime = os.path.getatime(file)\n        else:\n            with open(file, 'w'):\n                atime = mtime\n        os.utime(file, (atime, mtime))\n\n\nTouch = ActionFactory(touch_func,\n                      lambda file: 'Touch(%s)' % get_paths_str(file))\n\n\n# Internal utility functions\n\n# pylint: disable-msg=too-many-arguments\ndef _concat(prefix, items_iter, suffix, env, f=lambda x: x, target=None, source=None, affect_signature=True):\n    \"\"\"\n    Creates a new list from 'items_iter' by first interpolating each element\n    in the list using the 'env' dictionary and then calling f on the\n    list, and finally calling _concat_ixes to concatenate 'prefix' and\n    'suffix' onto each element of the list.\n    \"\"\"\n\n    if not items_iter:\n        return items_iter\n\n    l = f(SCons.PathList.PathList(items_iter).subst_path(env, target, source))\n    if l is not None:\n        items_iter = l\n\n    if not affect_signature:\n        value = ['$(']\n    else:\n        value = []\n    value += _concat_ixes(prefix, items_iter, suffix, env)\n\n    if not affect_signature:\n        value += [\"$)\"]\n\n    return value\n# pylint: enable-msg=too-many-arguments\n\n\ndef _concat_ixes(prefix, items_iter, suffix, env):\n    \"\"\"\n    Creates a new list from 'items_iter' by concatenating the 'prefix' and\n    'suffix' arguments onto each element of the list.  A trailing space\n    on 'prefix' or leading space on 'suffix' will cause them to be put\n    into separate list elements rather than being concatenated.\n    \"\"\"\n\n    result = []\n\n    # ensure that prefix and suffix are strings\n    prefix = str(env.subst(prefix, SCons.Subst.SUBST_RAW))\n    suffix = str(env.subst(suffix, SCons.Subst.SUBST_RAW))\n\n    for x in SCons.Util.flatten(items_iter):\n        if isinstance(x, SCons.Node.FS.File):\n            result.append(x)\n            continue\n        x = str(x)\n        if x:\n\n            if prefix:\n                if prefix[-1] == ' ':\n                    result.append(prefix[:-1])\n                elif x[:len(prefix)] != prefix:\n                    x = prefix + x\n\n            result.append(x)\n\n            if suffix:\n                if suffix[0] == ' ':\n                    result.append(suffix[1:])\n                elif x[-len(suffix):] != suffix:\n                    result[-1] = result[-1] + suffix\n\n    return result\n\n\ndef _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):\n    \"\"\"\n    This is a wrapper around _concat()/_concat_ixes() that checks for\n    the existence of prefixes or suffixes on list items and strips them\n    where it finds them.  This is used by tools (like the GNU linker)\n    that need to turn something like 'libfoo.a' into '-lfoo'.\n    \"\"\"\n\n    if not itms:\n        return itms\n\n    if not callable(c):\n        env_c = env['_concat']\n        if env_c != _concat and callable(env_c):\n            # There's a custom _concat() method in the construction\n            # environment, and we've allowed people to set that in\n            # the past (see test/custom-concat.py), so preserve the\n            # backwards compatibility.\n            c = env_c\n        else:\n            c = _concat_ixes\n\n    stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes)))\n    stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes)))\n\n    stripped = []\n    for l in SCons.PathList.PathList(itms).subst_path(env, None, None):\n        if isinstance(l, SCons.Node.FS.File):\n            stripped.append(l)\n            continue\n\n        if not SCons.Util.is_String(l):\n            l = str(l)\n\n        for stripprefix in stripprefixes:\n            lsp = len(stripprefix)\n            if l[:lsp] == stripprefix:\n                l = l[lsp:]\n                # Do not strip more than one prefix\n                break\n\n        for stripsuffix in stripsuffixes:\n            lss = len(stripsuffix)\n            if l[-lss:] == stripsuffix:\n                l = l[:-lss]\n                # Do not strip more than one suffix\n                break\n\n        stripped.append(l)\n\n    return c(prefix, stripped, suffix, env)\n\n\ndef processDefines(defs):\n    \"\"\"process defines, resolving strings, lists, dictionaries, into a list of\n    strings\n    \"\"\"\n    if SCons.Util.is_List(defs):\n        l = []\n        for d in defs:\n            if d is None:\n                continue\n            elif SCons.Util.is_List(d) or isinstance(d, tuple):\n                if len(d) >= 2:\n                    l.append(str(d[0]) + '=' + str(d[1]))\n                else:\n                    l.append(str(d[0]))\n            elif SCons.Util.is_Dict(d):\n                for macro, value in d.items():\n                    if value is not None:\n                        l.append(str(macro) + '=' + str(value))\n                    else:\n                        l.append(str(macro))\n            elif SCons.Util.is_String(d):\n                l.append(str(d))\n            else:\n                raise SCons.Errors.UserError(\"DEFINE %s is not a list, dict, string or None.\" % repr(d))\n    elif SCons.Util.is_Dict(defs):\n        # The items in a dictionary are stored in random order, but\n        # if the order of the command-line options changes from\n        # invocation to invocation, then the signature of the command\n        # line will change and we'll get random unnecessary rebuilds.\n        # Consequently, we have to sort the keys to ensure a\n        # consistent order...\n        l = []\n        for k, v in sorted(defs.items()):\n            if v is None:\n                l.append(str(k))\n            else:\n                l.append(str(k) + '=' + str(v))\n    else:\n        l = [str(defs)]\n    return l\n\n\ndef _defines(prefix, defs, suffix, env, target, source, c=_concat_ixes):\n    \"\"\"A wrapper around _concat_ixes that turns a list or string\n    into a list of C preprocessor command-line definitions.\n    \"\"\"\n\n    return c(prefix, env.subst_list(processDefines(defs), target=target, source=source), suffix, env)\n\n\nclass NullCmdGenerator:\n    \"\"\"This is a callable class that can be used in place of other\n    command generators if you don't want them to do anything.\n\n    The __call__ method for this class simply returns the thing\n    you instantiated it with.\n\n    Example usage:\n    env[\"DO_NOTHING\"] = NullCmdGenerator\n    env[\"LINKCOM\"] = \"${DO_NOTHING('$LINK $SOURCES $TARGET')}\"\n    \"\"\"\n\n    def __init__(self, cmd):\n        self.cmd = cmd\n\n    def __call__(self, target, source, env, for_signature=None):\n        return self.cmd\n\n\nclass Variable_Method_Caller:\n    \"\"\"A class for finding a construction variable on the stack and\n    calling one of its methods.\n\n    We use this to support \"construction variables\" in our string\n    eval()s that actually stand in for methods--specifically, use\n    of \"RDirs\" in call to _concat that should actually execute the\n    \"TARGET.RDirs\" method.  (We used to support this by creating a little\n    \"build dictionary\" that mapped RDirs to the method, but this got in\n    the way of Memoizing construction environments, because we had to\n    create new environment objects to hold the variables.)\n    \"\"\"\n\n    def __init__(self, variable, method):\n        self.variable = variable\n        self.method = method\n\n    def __call__(self, *args, **kw):\n        try:\n            1 // 0\n        except ZeroDivisionError:\n            # Don't start iterating with the current stack-frame to\n            # prevent creating reference cycles (f_back is safe).\n            frame = sys.exc_info()[2].tb_frame.f_back\n        variable = self.variable\n        while frame:\n            if variable in frame.f_locals:\n                v = frame.f_locals[variable]\n                if v:\n                    method = getattr(v, self.method)\n                    return method(*args, **kw)\n            frame = frame.f_back\n        return None\n\n\ndef __libversionflags(env, version_var, flags_var):\n    \"\"\"\n    if version_var is not empty, returns env[flags_var], otherwise returns None\n    :param env:\n    :param version_var:\n    :param flags_var:\n    :return:\n    \"\"\"\n    try:\n        if env.subst('$' + version_var):\n            return env[flags_var]\n    except KeyError:\n        pass\n    return None\n\n\ndef __lib_either_version_flag(env, version_var1, version_var2, flags_var):\n    \"\"\"\n    if $version_var1 or $version_var2 is not empty, returns env[flags_var], otherwise returns None\n    :param env:\n    :param version_var1:\n    :param version_var2:\n    :param flags_var:\n    :return:\n    \"\"\"\n    try:\n        if env.subst('$' + version_var1) or env.subst('$' + version_var2):\n            return env[flags_var]\n    except KeyError:\n        pass\n    return None\n\n\nConstructionEnvironment = {\n    'BUILDERS': {},\n    'SCANNERS': [SCons.Tool.SourceFileScanner],\n    'CONFIGUREDIR': '#/.sconf_temp',\n    'CONFIGURELOG': '#/config.log',\n    'CPPSUFFIXES': SCons.Tool.CSuffixes,\n    'DSUFFIXES': SCons.Tool.DSuffixes,\n    'ENV': {},\n    'IDLSUFFIXES': SCons.Tool.IDLSuffixes,\n    '_concat': _concat,\n    '_defines': _defines,\n    '_stripixes': _stripixes,\n    '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',\n\n    '_LIBDIRFLAGS': '${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}',\n    '_CPPINCFLAGS': '${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}',\n\n    '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__, TARGET, SOURCE)}',\n\n    '__libversionflags': __libversionflags,\n    '__SHLIBVERSIONFLAGS': '${__libversionflags(__env__,\"SHLIBVERSION\",\"_SHLIBVERSIONFLAGS\")}',\n    '__LDMODULEVERSIONFLAGS': '${__libversionflags(__env__,\"LDMODULEVERSION\",\"_LDMODULEVERSIONFLAGS\")}',\n    '__DSHLIBVERSIONFLAGS': '${__libversionflags(__env__,\"DSHLIBVERSION\",\"_DSHLIBVERSIONFLAGS\")}',\n    '__lib_either_version_flag': __lib_either_version_flag,\n\n    'TEMPFILE': NullCmdGenerator,\n    'TEMPFILEARGJOIN': ' ',\n    'TEMPFILEARGESCFUNC': SCons.Subst.quote_spaces,\n    'Dir': Variable_Method_Caller('TARGET', 'Dir'),\n    'Dirs': Variable_Method_Caller('TARGET', 'Dirs'),\n    'File': Variable_Method_Caller('TARGET', 'File'),\n    'RDirs': Variable_Method_Caller('TARGET', 'RDirs'),\n}\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Base class for construction Environments.\n\nThese are the primary objects used to communicate dependency and\nconstruction information to the build engine.\n\nKeyword arguments supplied when the construction Environment is created\nare construction variables used to initialize the Environment.\n\"\"\"\n\nimport copy\nimport os\nimport sys\nimport re\nimport shlex\nfrom collections import UserDict\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\nimport SCons.Defaults\nfrom SCons.Errors import UserError, BuildError\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Node.Python\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.SConsign\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Warnings\nfrom SCons.Util import (\n    AppendPath,\n    CLVar,\n    LogicalLines,\n    MethodWrapper,\n    PrependPath,\n    Split,\n    WhereIs,\n    flatten,\n    is_Dict,\n    is_List,\n    is_Sequence,\n    is_String,\n    is_Tuple,\n    semi_deepcopy,\n    semi_deepcopy_dict,\n    to_String_for_subst,\n    uniquer_hashables,\n)\n\nclass _Null:\n    pass\n\n_null = _Null\n\n_warn_copy_deprecated = True\n_warn_source_signatures_deprecated = True\n_warn_target_signatures_deprecated = True\n\nCleanTargets = {}\nCalculatorArgs = {}\n\ndef alias_builder(env, target, source):\n    pass\n\nAliasBuilder = SCons.Builder.Builder(\n    action=alias_builder,\n    target_factory=SCons.Node.Alias.default_ans.Alias,\n    source_factory=SCons.Node.FS.Entry,\n    multi=True,\n    is_explicit=None,\n    name='AliasBuilder',\n)\n\ndef apply_tools(env, tools, toolpath):\n    # Store the toolpath in the Environment.\n    # This is expected to work even if no tools are given, so do this first.\n    if toolpath is not None:\n        env['toolpath'] = toolpath\n    if not tools:\n        return\n\n    # Filter out null tools from the list.\n    for tool in [_f for _f in tools if _f]:\n        if is_List(tool) or is_Tuple(tool):\n            # toolargs should be a dict of kw args\n            toolname, toolargs, *rest = tool\n            _ = env.Tool(toolname, **toolargs)\n        else:\n            _ = env.Tool(tool)\n\n# These names are (or will be) controlled by SCons; users should never\n# set or override them.  The warning can optionally be turned off,\n# but scons will still ignore the illegal variable names even if it's off.\nreserved_construction_var_names = [\n    'CHANGED_SOURCES',\n    'CHANGED_TARGETS',\n    'SOURCE',\n    'SOURCES',\n    'TARGET',\n    'TARGETS',\n    'UNCHANGED_SOURCES',\n    'UNCHANGED_TARGETS',\n]\n\nfuture_reserved_construction_var_names = [\n    #'HOST_OS',\n    #'HOST_ARCH',\n    #'HOST_CPU',\n]\n\ndef copy_non_reserved_keywords(dict):\n    result = semi_deepcopy(dict)\n    for k in result.copy().keys():\n        if k in reserved_construction_var_names:\n            msg = \"Ignoring attempt to set reserved variable `$%s'\"\n            SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k)\n            del result[k]\n    return result\n\ndef _set_reserved(env, key, value):\n    msg = \"Ignoring attempt to set reserved variable `$%s'\"\n    SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key)\n\ndef _set_future_reserved(env, key, value):\n    env._dict[key] = value\n    msg = \"`$%s' will be reserved in a future release and setting it will become ignored\"\n    SCons.Warnings.warn(SCons.Warnings.FutureReservedVariableWarning, msg % key)\n\ndef _set_BUILDERS(env, key, value):\n    try:\n        bd = env._dict[key]\n        for k in bd.copy().keys():\n            del bd[k]\n    except KeyError:\n        bd = BuilderDict(bd, env)\n        env._dict[key] = bd\n    for k, v in value.items():\n        if not SCons.Builder.is_a_Builder(v):\n            raise UserError('%s is not a Builder.' % repr(v))\n    bd.update(value)\n\ndef _del_SCANNERS(env, key):\n    del env._dict[key]\n    env.scanner_map_delete()\n\ndef _set_SCANNERS(env, key, value):\n    env._dict[key] = value\n    env.scanner_map_delete()\n\ndef _delete_duplicates(l, keep_last):\n    \"\"\"Delete duplicates from a sequence, keeping the first or last.\"\"\"\n    seen=set()\n    result=[]\n    if keep_last:           # reverse in & out, then keep first\n        l.reverse()\n    for i in l:\n        try:\n            if i not in seen:\n                result.append(i)\n                seen.add(i)\n        except TypeError:\n            # probably unhashable.  Just keep it.\n            result.append(i)\n    if keep_last:\n        result.reverse()\n    return result\n\n\n\n# The following is partly based on code in a comment added by Peter\n# Shannon at the following page (there called the \"transplant\" class):\n#\n# ASPN : Python Cookbook : Dynamically added methods to a class\n# https://code.activestate.com/recipes/81732/\n#\n# We had independently been using the idiom as BuilderWrapper, but\n# factoring out the common parts into this base class, and making\n# BuilderWrapper a subclass that overrides __call__() to enforce specific\n# Builder calling conventions, simplified some of our higher-layer code.\n#\n# Note: MethodWrapper moved to SCons.Util as it was needed there\n# and otherwise we had a circular import problem.\n\nclass BuilderWrapper(MethodWrapper):\n    \"\"\"\n    A MethodWrapper subclass that that associates an environment with\n    a Builder.\n\n    This mainly exists to wrap the __call__() function so that all calls\n    to Builders can have their argument lists massaged in the same way\n    (treat a lone argument as the source, treat two arguments as target\n    then source, make sure both target and source are lists) without\n    having to have cut-and-paste code to do it.\n\n    As a bit of obsessive backwards compatibility, we also intercept\n    attempts to get or set the \"env\" or \"builder\" attributes, which were\n    the names we used before we put the common functionality into the\n    MethodWrapper base class.  We'll keep this around for a while in case\n    people shipped Tool modules that reached into the wrapper (like the\n    Tool/qt.py module does, or did).  There shouldn't be a lot attribute\n    fetching or setting on these, so a little extra work shouldn't hurt.\n    \"\"\"\n    def __call__(self, target=None, source=_null, *args, **kw):\n        if source is _null:\n            source = target\n            target = None\n        if target is not None and not is_List(target):\n            target = [target]\n        if source is not None and not is_List(source):\n            source = [source]\n        return super().__call__(target, source, *args, **kw)\n\n    def __repr__(self):\n        return '<BuilderWrapper %s>' % repr(self.name)\n\n    def __str__(self):\n        return self.__repr__()\n\n    def __getattr__(self, name):\n        if name == 'env':\n            return self.object\n        elif name == 'builder':\n            return self.method\n        else:\n            raise AttributeError(name)\n\n    def __setattr__(self, name, value):\n        if name == 'env':\n            self.object = value\n        elif name == 'builder':\n            self.method = value\n        else:\n            self.__dict__[name] = value\n\n    # This allows a Builder to be executed directly\n    # through the Environment to which it's attached.\n    # In practice, we shouldn't need this, because\n    # builders actually get executed through a Node.\n    # But we do have a unit test for this, and can't\n    # yet rule out that it would be useful in the\n    # future, so leave it for now.\n    #def execute(self, **kw):\n    #    kw['env'] = self.env\n    #    self.builder.execute(**kw)\n\nclass BuilderDict(UserDict):\n    \"\"\"This is a dictionary-like class used by an Environment to hold\n    the Builders.  We need to do this because every time someone changes\n    the Builders in the Environment's BUILDERS dictionary, we must\n    update the Environment's attributes.\"\"\"\n    def __init__(self, dict, env):\n        # Set self.env before calling the superclass initialization,\n        # because it will end up calling our other methods, which will\n        # need to point the values in this dictionary to self.env.\n        self.env = env\n        UserDict.__init__(self, dict)\n\n    def __semi_deepcopy__(self):\n        # These cannot be copied since they would both modify the same builder object, and indeed\n        # just copying would modify the original builder\n        raise TypeError( 'cannot semi_deepcopy a BuilderDict' )\n\n    def __setitem__(self, item, val):\n        try:\n            method = getattr(self.env, item).method\n        except AttributeError:\n            pass\n        else:\n            self.env.RemoveMethod(method)\n        UserDict.__setitem__(self, item, val)\n        BuilderWrapper(self.env, val, item)\n\n    def __delitem__(self, item):\n        UserDict.__delitem__(self, item)\n        delattr(self.env, item)\n\n    def update(self, dict):\n        for i, v in dict.items():\n            self.__setitem__(i, v)\n\n\n\n_is_valid_var = re.compile(r'[_a-zA-Z]\\w*$')\n\ndef is_valid_construction_var(varstr):\n    \"\"\"Return if the specified string is a legitimate construction\n    variable.\n    \"\"\"\n    return _is_valid_var.match(varstr)\n\n\n\nclass SubstitutionEnvironment:\n    \"\"\"Base class for different flavors of construction environments.\n\n    This class contains a minimal set of methods that handle construction\n    variable expansion and conversion of strings to Nodes, which may or\n    may not be actually useful as a stand-alone class.  Which methods\n    ended up in this class is pretty arbitrary right now.  They're\n    basically the ones which we've empirically determined are common to\n    the different construction environment subclasses, and most of the\n    others that use or touch the underlying dictionary of construction\n    variables.\n\n    Eventually, this class should contain all the methods that we\n    determine are necessary for a \"minimal\" interface to the build engine.\n    A full \"native Python\" SCons environment has gotten pretty heavyweight\n    with all of the methods and Tools and construction variables we've\n    jammed in there, so it would be nice to have a lighter weight\n    alternative for interfaces that don't need all of the bells and\n    whistles.  (At some point, we'll also probably rename this class\n    \"Base,\" since that more reflects what we want this class to become,\n    but because we've released comments that tell people to subclass\n    Environment.Base to create their own flavors of construction\n    environment, we'll save that for a future refactoring when this\n    class actually becomes useful.)\n    \"\"\"\n\n    def __init__(self, **kw):\n        \"\"\"Initialization of an underlying SubstitutionEnvironment class.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = kw.copy()\n        self._init_special()\n        self.added_methods = []\n        #self._memo = {}\n\n    def _init_special(self):\n        \"\"\"Initial the dispatch tables for special handling of\n        special construction variables.\"\"\"\n        self._special_del = {}\n        self._special_del['SCANNERS'] = _del_SCANNERS\n\n        self._special_set = {}\n        for key in reserved_construction_var_names:\n            self._special_set[key] = _set_reserved\n        for key in future_reserved_construction_var_names:\n            self._special_set[key] = _set_future_reserved\n        self._special_set['BUILDERS'] = _set_BUILDERS\n        self._special_set['SCANNERS'] = _set_SCANNERS\n\n        # Freeze the keys of self._special_set in a list for use by\n        # methods that need to check.\n        self._special_set_keys = list(self._special_set.keys())\n\n    def __eq__(self, other):\n        return self._dict == other._dict\n\n    def __delitem__(self, key):\n        special = self._special_del.get(key)\n        if special:\n            special(self, key)\n        else:\n            del self._dict[key]\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __setitem__(self, key, value):\n        # This is heavily used.  This implementation is the best we have\n        # according to the timings in bench/env.__setitem__.py.\n        #\n        # The \"key in self._special_set_keys\" test here seems to perform\n        # pretty well for the number of keys we have.  A hard-coded\n        # list worked a little better in Python 2.5, but that has the\n        # disadvantage of maybe getting out of sync if we ever add more\n        # variable names.\n        # So right now it seems like a good trade-off, but feel free to\n        # revisit this with bench/env.__setitem__.py as needed (and\n        # as newer versions of Python come out).\n        if key in self._special_set_keys:\n            self._special_set[key](self, key, value)\n        else:\n            # If we already have the entry, then it's obviously a valid\n            # key and we don't need to check.  If we do check, using a\n            # global, pre-compiled regular expression directly is more\n            # efficient than calling another function or a method.\n            if key not in self._dict and not _is_valid_var.match(key):\n                raise UserError(\"Illegal construction variable `%s'\" % key)\n            self._dict[key] = value\n\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        return self._dict.get(key, default)\n\n    def __contains__(self, key):\n        return key in self._dict\n\n    def keys(self):\n        \"\"\"Emulates the keys() method of dictionaries.\"\"\"\n        return self._dict.keys()\n\n    def values(self):\n        \"\"\"Emulates the values() method of dictionaries.\"\"\"\n        return self._dict.values()\n\n    def items(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        return self._dict.items()\n\n    def setdefault(self, key, default=None):\n        \"\"\"Emulates the setdefault() method of dictionaries.\"\"\"\n        return self._dict.setdefault(key, default)\n\n    def arg2nodes(self, args, node_factory=_null, lookup_list=_null, **kw):\n        if node_factory is _null:\n            node_factory = self.fs.File\n        if lookup_list is _null:\n            lookup_list = self.lookup_list\n\n        if not args:\n            return []\n\n        args = flatten(args)\n\n        nodes = []\n        for v in args:\n            if is_String(v):\n                n = None\n                for l in lookup_list:\n                    n = l(v)\n                    if n is not None:\n                        break\n                if n is not None:\n                    if is_String(n):\n                        # n = self.subst(n, raw=1, **kw)\n                        kw['raw'] = 1\n                        n = self.subst(n, **kw)\n                        if node_factory:\n                            n = node_factory(n)\n                    if is_List(n):\n                        nodes.extend(n)\n                    else:\n                        nodes.append(n)\n                elif node_factory:\n                    # v = node_factory(self.subst(v, raw=1, **kw))\n                    kw['raw'] = 1\n                    v = node_factory(self.subst(v, **kw))\n                    if is_List(v):\n                        nodes.extend(v)\n                    else:\n                        nodes.append(v)\n            else:\n                nodes.append(v)\n\n        return nodes\n\n    def gvars(self):\n        return self._dict\n\n    def lvars(self):\n        return {}\n\n    def subst(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Recursively interpolates construction variables from the\n        Environment into the specified string, returning the expanded\n        result.  Construction variables are specified by a $ prefix\n        in the string and begin with an initial underscore or\n        alphabetic character followed by any number of underscores\n        or alphanumeric characters.  The construction variable names\n        may be surrounded by curly braces to separate the name from\n        trailing characters.\n        \"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_kw(self, kw, raw=0, target=None, source=None):\n        nkw = {}\n        for k, v in kw.items():\n            k = self.subst(k, raw, target, source)\n            if is_String(v):\n                v = self.subst(v, raw, target, source)\n            nkw[k] = v\n        return nkw\n\n    def subst_list(self, string, raw=0, target=None, source=None, conv=None, executor=None):\n        \"\"\"Calls through to SCons.Subst.scons_subst_list().  See\n        the documentation for that function.\"\"\"\n        gvars = self.gvars()\n        lvars = self.lvars()\n        lvars['__env__'] = self\n        if executor:\n            lvars.update(executor.get_lvars())\n        return SCons.Subst.scons_subst_list(string, self, raw, target, source, gvars, lvars, conv)\n\n    def subst_path(self, path, target=None, source=None):\n        \"\"\"Substitute a path list, turning EntryProxies into Nodes\n        and leaving Nodes (and other objects) as-is.\"\"\"\n\n        if not is_List(path):\n            path = [path]\n\n        def s(obj):\n            \"\"\"This is the \"string conversion\" routine that we have our\n            substitutions use to return Nodes, not strings.  This relies\n            on the fact that an EntryProxy object has a get() method that\n            returns the underlying Node that it wraps, which is a bit of\n            architectural dependence that we might need to break or modify\n            in the future in response to additional requirements.\"\"\"\n            try:\n                get = obj.get\n            except AttributeError:\n                obj = to_String_for_subst(obj)\n            else:\n                obj = get()\n            return obj\n\n        r = []\n        for p in path:\n            if is_String(p):\n                p = self.subst(p, target=target, source=source, conv=s)\n                if is_List(p):\n                    if len(p) == 1:\n                        p = p[0]\n                    else:\n                        # We have an object plus a string, or multiple\n                        # objects that we need to smush together.  No choice\n                        # but to make them into a string.\n                        p = ''.join(map(to_String_for_subst, p))\n            else:\n                p = s(p)\n            r.append(p)\n        return r\n\n    subst_target_source = subst\n\n    def backtick(self, command):\n        import subprocess\n        # common arguments\n        kw = { 'stdin' : 'devnull',\n               'stdout' : subprocess.PIPE,\n               'stderr' : subprocess.PIPE,\n               'universal_newlines' : True,\n             }\n        # if the command is a list, assume it's been quoted\n        # othewise force a shell\n        if not is_List(command): kw['shell'] = True\n        # run constructed command\n        p = SCons.Action._subproc(self, command, **kw)\n        out,err = p.communicate()\n        status = p.wait()\n        if err:\n            sys.stderr.write(\"\" + err)\n        if status:\n            raise OSError(\"'%s' exited %d\" % (command, status))\n        return out\n\n    def AddMethod(self, function, name=None):\n        \"\"\"\n        Adds the specified function as a method of this construction\n        environment with the specified name.  If the name is omitted,\n        the default name is the name of the function itself.\n        \"\"\"\n        method = MethodWrapper(self, function, name)\n        self.added_methods.append(method)\n\n    def RemoveMethod(self, function):\n        \"\"\"\n        Removes the specified function's MethodWrapper from the\n        added_methods list, so we don't re-bind it when making a clone.\n        \"\"\"\n        self.added_methods = [dm for dm in self.added_methods if dm.method is not function]\n\n    def Override(self, overrides):\n        \"\"\"\n        Produce a modified environment whose variables are overridden by\n        the overrides dictionaries.  \"overrides\" is a dictionary that\n        will override the variables of this environment.\n\n        This function is much more efficient than Clone() or creating\n        a new Environment because it doesn't copy the construction\n        environment dictionary, it just wraps the underlying construction\n        environment, and doesn't even create a wrapper object if there\n        are no overrides.\n        \"\"\"\n        if not overrides: return self\n        o = copy_non_reserved_keywords(overrides)\n        if not o: return self\n        overrides = {}\n        merges = None\n        for key, value in o.items():\n            if key == 'parse_flags':\n                merges = value\n            else:\n                overrides[key] = SCons.Subst.scons_subst_once(value, self, key)\n        env = OverrideEnvironment(self, overrides)\n        if merges:\n            env.MergeFlags(merges)\n        return env\n\n    def ParseFlags(self, *flags):\n        \"\"\"Return a dict of parsed flags.\n\n        Parse ``flags`` and return a dict with the flags distributed into\n        the appropriate construction variable names.  The flags are treated\n        as a typical set of command-line flags for a GNU-like toolchain,\n        such as might have been generated by one of the {foo}-config scripts,\n        and used to populate the entries based on knowledge embedded in\n        this method - the choices are not expected to be portable to other\n        toolchains.\n\n        If one of the ``flags`` strings begins with a bang (exclamation mark),\n        it is assumed to be a command and the rest of the string is executed;\n        the result of that evaluation is then added to the dict.\n        \"\"\"\n        dict = {\n            'ASFLAGS'       : CLVar(''),\n            'CFLAGS'        : CLVar(''),\n            'CCFLAGS'       : CLVar(''),\n            'CXXFLAGS'      : CLVar(''),\n            'CPPDEFINES'    : [],\n            'CPPFLAGS'      : CLVar(''),\n            'CPPPATH'       : [],\n            'FRAMEWORKPATH' : CLVar(''),\n            'FRAMEWORKS'    : CLVar(''),\n            'LIBPATH'       : [],\n            'LIBS'          : [],\n            'LINKFLAGS'     : CLVar(''),\n            'RPATH'         : [],\n        }\n\n        def do_parse(arg):\n            # if arg is a sequence, recurse with each element\n            if not arg:\n                return\n\n            if not is_String(arg):\n                for t in arg: do_parse(t)\n                return\n\n            # if arg is a command, execute it\n            if arg[0] == '!':\n                arg = self.backtick(arg[1:])\n\n            # utility function to deal with -D option\n            def append_define(name, dict = dict):\n                t = name.split('=')\n                if len(t) == 1:\n                    dict['CPPDEFINES'].append(name)\n                else:\n                    dict['CPPDEFINES'].append([t[0], '='.join(t[1:])])\n\n            # Loop through the flags and add them to the appropriate option.\n            # This tries to strike a balance between checking for all possible\n            # flags and keeping the logic to a finite size, so it doesn't\n            # check for some that don't occur often.  It particular, if the\n            # flag is not known to occur in a config script and there's a way\n            # of passing the flag to the right place (by wrapping it in a -W\n            # flag, for example) we don't check for it.  Note that most\n            # preprocessor options are not handled, since unhandled options\n            # are placed in CCFLAGS, so unless the preprocessor is invoked\n            # separately, these flags will still get to the preprocessor.\n            # Other options not currently handled:\n            #  -iqoutedir      (preprocessor search path)\n            #  -u symbol       (linker undefined symbol)\n            #  -s              (linker strip files)\n            #  -static*        (linker static binding)\n            #  -shared*        (linker dynamic binding)\n            #  -symbolic       (linker global binding)\n            #  -R dir          (deprecated linker rpath)\n            # IBM compilers may also accept -qframeworkdir=foo\n\n            params = shlex.split(arg)\n            append_next_arg_to = None   # for multi-word args\n            for arg in params:\n                if append_next_arg_to:\n                    if append_next_arg_to == 'CPPDEFINES':\n                        append_define(arg)\n                    elif append_next_arg_to == '-include':\n                        t = ('-include', self.fs.File(arg))\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-imacros':\n                        t = ('-imacros', self.fs.File(arg))\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-isysroot':\n                        t = ('-isysroot', arg)\n                        dict['CCFLAGS'].append(t)\n                        dict['LINKFLAGS'].append(t)\n                    elif append_next_arg_to == '-isystem':\n                        t = ('-isystem', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-iquote':\n                        t = ('-iquote', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-idirafter':\n                        t = ('-idirafter', arg)\n                        dict['CCFLAGS'].append(t)\n                    elif append_next_arg_to == '-arch':\n                        t = ('-arch', arg)\n                        dict['CCFLAGS'].append(t)\n                        dict['LINKFLAGS'].append(t)\n                    elif append_next_arg_to == '--param':\n                        t = ('--param', arg)\n                        dict['CCFLAGS'].append(t)\n                    else:\n                        dict[append_next_arg_to].append(arg)\n                    append_next_arg_to = None\n                elif not arg[0] in ['-', '+']:\n                    dict['LIBS'].append(self.fs.File(arg))\n                elif arg == '-dylib_file':\n                    dict['LINKFLAGS'].append(arg)\n                    append_next_arg_to = 'LINKFLAGS'\n                elif arg[:2] == '-L':\n                    if arg[2:]:\n                        dict['LIBPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBPATH'\n                elif arg[:2] == '-l':\n                    if arg[2:]:\n                        dict['LIBS'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'LIBS'\n                elif arg[:2] == '-I':\n                    if arg[2:]:\n                        dict['CPPPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPPATH'\n                elif arg[:4] == '-Wa,':\n                    dict['ASFLAGS'].append(arg[4:])\n                    dict['CCFLAGS'].append(arg)\n                elif arg[:4] == '-Wl,':\n                    if arg[:11] == '-Wl,-rpath=':\n                        dict['RPATH'].append(arg[11:])\n                    elif arg[:7] == '-Wl,-R,':\n                        dict['RPATH'].append(arg[7:])\n                    elif arg[:6] == '-Wl,-R':\n                        dict['RPATH'].append(arg[6:])\n                    else:\n                        dict['LINKFLAGS'].append(arg)\n                elif arg[:4] == '-Wp,':\n                    dict['CPPFLAGS'].append(arg)\n                elif arg[:2] == '-D':\n                    if arg[2:]:\n                        append_define(arg[2:])\n                    else:\n                        append_next_arg_to = 'CPPDEFINES'\n                elif arg == '-framework':\n                    append_next_arg_to = 'FRAMEWORKS'\n                elif arg[:14] == '-frameworkdir=':\n                    dict['FRAMEWORKPATH'].append(arg[14:])\n                elif arg[:2] == '-F':\n                    if arg[2:]:\n                        dict['FRAMEWORKPATH'].append(arg[2:])\n                    else:\n                        append_next_arg_to = 'FRAMEWORKPATH'\n                elif arg in [\n                    '-mno-cygwin',\n                    '-pthread',\n                    '-openmp',\n                    '-fmerge-all-constants',\n                    '-fopenmp',\n                ]:\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg == '-mwindows':\n                    dict['LINKFLAGS'].append(arg)\n                elif arg[:5] == '-std=':\n                    if '++' in arg[5:]:\n                        key='CXXFLAGS'\n                    else:\n                        key='CFLAGS'\n                    dict[key].append(arg)\n                elif arg[0] == '+':\n                    dict['CCFLAGS'].append(arg)\n                    dict['LINKFLAGS'].append(arg)\n                elif arg in [\n                    '-include',\n                    '-imacros',\n                    '-isysroot',\n                    '-isystem',\n                    '-iquote',\n                    '-idirafter',\n                    '-arch',\n                    '--param',\n                ]:\n                    append_next_arg_to = arg\n                else:\n                    dict['CCFLAGS'].append(arg)\n\n        for arg in flags:\n            do_parse(arg)\n        return dict\n\n    def MergeFlags(self, args, unique=True):\n        \"\"\"Merge flags into construction variables.\n\n        Merges the flags from ``args`` into this construction environent.\n        If ``args`` is not a dict, it is first converted to a dictionary with\n        flags distributed into appropriate construction variables.\n        See :meth:`ParseFlags`.\n\n        Args:\n            args: flags to merge\n            unique: merge flags rather than appending (default: True)\n\n        \"\"\"\n        if not is_Dict(args):\n            args = self.ParseFlags(args)\n\n        if not unique:\n            self.Append(**args)\n            return\n\n        for key, value in args.items():\n            if not value:\n                continue\n            value = Split(value)\n            try:\n                orig = self[key]\n            except KeyError:\n                orig = value\n            else:\n                if not orig:\n                    orig = value\n                elif value:\n                    # Add orig and value.  The logic here was lifted from\n                    # part of env.Append() (see there for a lot of comments\n                    # about the order in which things are tried) and is\n                    # used mainly to handle coercion of strings to CLVar to\n                    # \"do the right thing\" given (e.g.) an original CCFLAGS\n                    # string variable like '-pipe -Wall'.\n                    try:\n                        orig = orig + value\n                    except (KeyError, TypeError):\n                        try:\n                            add_to_orig = orig.append\n                        except AttributeError:\n                            value.insert(0, orig)\n                            orig = value\n                        else:\n                            add_to_orig(value)\n            t = []\n            if key[-4:] == 'PATH':\n                ### keep left-most occurence\n                for v in orig:\n                    if v not in t:\n                        t.append(v)\n            else:\n                ### keep right-most occurence\n                for v in orig[::-1]:\n                    if v not in t:\n                        t.insert(0, v)\n            self[key] = t\n\n\ndef default_decide_source(dependency, target, prev_ni, repo_node=None):\n    f = SCons.Defaults.DefaultEnvironment().decide_source\n    return f(dependency, target, prev_ni, repo_node)\n\n\ndef default_decide_target(dependency, target, prev_ni, repo_node=None):\n    f = SCons.Defaults.DefaultEnvironment().decide_target\n    return f(dependency, target, prev_ni, repo_node)\n\n\ndef default_copy_from_cache(env, src, dst):\n    return SCons.CacheDir.CacheDir.copy_from_cache(env, src, dst)\n\n\ndef default_copy_to_cache(env, src, dst):\n    return SCons.CacheDir.CacheDir.copy_to_cache(env, src, dst)\n\n\nclass Base(SubstitutionEnvironment):\n    \"\"\"Base class for \"real\" construction Environments.\n\n    These are the primary objects used to communicate dependency\n    and construction information to the build engine.\n\n    Keyword arguments supplied when the construction Environment\n    is created are construction variables used to initialize the\n    Environment.\n    \"\"\"\n\n    #######################################################################\n    # This is THE class for interacting with the SCons build engine,\n    # and it contains a lot of stuff, so we're going to try to keep this\n    # a little organized by grouping the methods.\n    #######################################################################\n\n    #######################################################################\n    # Methods that make an Environment act like a dictionary.  These have\n    # the expected standard names for Python mapping objects.  Note that\n    # we don't actually make an Environment a subclass of UserDict for\n    # performance reasons.  Note also that we only supply methods for\n    # dictionary functionality that we actually need and use.\n    #######################################################################\n\n    def __init__(\n        self,\n        platform=None,\n        tools=None,\n        toolpath=None,\n        variables=None,\n        parse_flags=None,\n        **kw\n    ):\n        \"\"\"Initialization of a basic SCons construction environment.\n\n        Sets up special construction variables like BUILDER,\n        PLATFORM, etc., and searches for and applies available Tools.\n\n        Note that we do *not* call the underlying base class\n        (SubsitutionEnvironment) initialization, because we need to\n        initialize things in a very specific order that doesn't work\n        with the much simpler base class initialization.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base')\n        self._memo = {}\n        self.fs = SCons.Node.FS.get_default_fs()\n        self.ans = SCons.Node.Alias.default_ans\n        self.lookup_list = SCons.Node.arg2nodes_lookups\n        self._dict = semi_deepcopy(SCons.Defaults.ConstructionEnvironment)\n        self._init_special()\n        self.added_methods = []\n\n        # We don't use AddMethod, or define these as methods in this\n        # class, because we *don't* want these functions to be bound\n        # methods.  They need to operate independently so that the\n        # settings will work properly regardless of whether a given\n        # target ends up being built with a Base environment or an\n        # OverrideEnvironment or what have you.\n        self.decide_target = default_decide_target\n        self.decide_source = default_decide_source\n\n        self.cache_timestamp_newer = False\n\n        self._dict['BUILDERS'] = BuilderDict(self._dict['BUILDERS'], self)\n\n        if platform is None:\n            platform = self._dict.get('PLATFORM', None)\n            if platform is None:\n                platform = SCons.Platform.Platform()\n        if is_String(platform):\n            platform = SCons.Platform.Platform(platform)\n        self._dict['PLATFORM'] = str(platform)\n        platform(self)\n\n        # these should be set by the platform, backstop just in case\n        self._dict['HOST_OS'] = self._dict.get('HOST_OS', None)\n        self._dict['HOST_ARCH'] = self._dict.get('HOST_ARCH', None)\n\n        # these are not currently set by the platform, give them a default\n        self._dict['TARGET_OS'] = self._dict.get('TARGET_OS', None)\n        self._dict['TARGET_ARCH'] = self._dict.get('TARGET_ARCH', None)\n\n        # Apply the passed-in and customizable variables to the\n        # environment before calling the tools, because they may use\n        # some of them during initialization.\n        if 'options' in kw:\n            # Backwards compatibility:  they may stll be using the\n            # old \"options\" keyword.\n            variables = kw['options']\n            del kw['options']\n        self.Replace(**kw)\n        keys = list(kw.keys())\n        if variables:\n            keys = keys + list(variables.keys())\n            variables.Update(self)\n\n        save = {}\n        for k in keys:\n            try:\n                save[k] = self._dict[k]\n            except KeyError:\n                # No value may have been set if they tried to pass in a\n                # reserved variable name like TARGETS.\n                pass\n\n        SCons.Tool.Initializers(self)\n\n        if tools is None:\n            tools = self._dict.get('TOOLS', None)\n            if tools is None:\n                tools = ['default']\n        apply_tools(self, tools, toolpath)\n\n        # Now restore the passed-in and customized variables\n        # to the environment, since the values the user set explicitly\n        # should override any values set by the tools.\n        for key, val in save.items():\n            self._dict[key] = val\n\n        # Finally, apply any flags to be merged in\n        if parse_flags:\n            self.MergeFlags(parse_flags)\n\n    #######################################################################\n    # Utility methods that are primarily for internal use by SCons.\n    # These begin with lower-case letters.\n    #######################################################################\n\n    def get_builder(self, name):\n        \"\"\"Fetch the builder with the specified name from the environment.\n        \"\"\"\n        try:\n            return self._dict['BUILDERS'][name]\n        except KeyError:\n            return None\n\n    def validate_CacheDir_class(self, custom_class=None):\n        \"\"\"Validate the passed custom CacheDir class, or if no args are passed,\n        validate the custom CacheDir class from the environment.\n        \"\"\"\n\n        if custom_class is None:\n            custom_class = self.get(\"CACHEDIR_CLASS\", SCons.CacheDir.CacheDir)\n        if not issubclass(custom_class, SCons.CacheDir.CacheDir):\n            raise UserError(\"Custom CACHEDIR_CLASS %s not derived from CacheDir\" % str(custom_class))\n        return custom_class\n\n    def get_CacheDir(self):\n        try:\n            path = self._CacheDir_path\n        except AttributeError:\n            path = SCons.Defaults.DefaultEnvironment()._CacheDir_path\n\n        cachedir_class = self.validate_CacheDir_class()\n        try:\n            if (path == self._last_CacheDir_path\n                    # this checks if the cachedir class type has changed from what the\n                    # instantiated cache dir type is. If the are exactly the same we\n                    # can just keep using the existing one, otherwise the user is requesting\n                    # something new, so we will re-instantiate below.\n                    and type(self._last_CacheDir) is cachedir_class):\n                return self._last_CacheDir\n        except AttributeError:\n            pass\n\n        cd = cachedir_class(path)\n        self._last_CacheDir_path = path\n        self._last_CacheDir = cd\n        return cd\n\n    def get_factory(self, factory, default='File'):\n        \"\"\"Return a factory function for creating Nodes for this\n        construction environment.\n        \"\"\"\n        name = default\n        try:\n            is_node = issubclass(factory, SCons.Node.FS.Base)\n        except TypeError:\n            # The specified factory isn't a Node itself--it's\n            # most likely None, or possibly a callable.\n            pass\n        else:\n            if is_node:\n                # The specified factory is a Node (sub)class.  Try to\n                # return the FS method that corresponds to the Node's\n                # name--that is, we return self.fs.Dir if they want a Dir,\n                # self.fs.File for a File, etc.\n                try: name = factory.__name__\n                except AttributeError: pass\n                else: factory = None\n        if not factory:\n            # They passed us None, or we picked up a name from a specified\n            # class, so return the FS method.  (Note that we *don't*\n            # use our own self.{Dir,File} methods because that would\n            # cause env.subst() to be called twice on the file name,\n            # interfering with files that have $$ in them.)\n            factory = getattr(self.fs, name)\n        return factory\n\n    @SCons.Memoize.CountMethodCall\n    def _gsm(self):\n        try:\n            return self._memo['_gsm']\n        except KeyError:\n            pass\n\n        result = {}\n\n        try:\n            scanners = self._dict['SCANNERS']\n        except KeyError:\n            pass\n        else:\n            # Reverse the scanner list so that, if multiple scanners\n            # claim they can scan the same suffix, earlier scanners\n            # in the list will overwrite later scanners, so that\n            # the result looks like a \"first match\" to the user.\n            if not is_List(scanners):\n                scanners = [scanners]\n            else:\n                scanners = scanners[:] # copy so reverse() doesn't mod original\n            scanners.reverse()\n            for scanner in scanners:\n                for k in scanner.get_skeys(self):\n                    if k and self['PLATFORM'] == 'win32':\n                        k = k.lower()\n                    result[k] = scanner\n\n        self._memo['_gsm'] = result\n\n        return result\n\n    def get_scanner(self, skey):\n        \"\"\"Find the appropriate scanner given a key (usually a file suffix).\n        \"\"\"\n        if skey and self['PLATFORM'] == 'win32':\n            skey = skey.lower()\n        return self._gsm().get(skey)\n\n    def scanner_map_delete(self, kw=None):\n        \"\"\"Delete the cached scanner map (if we need to).\n        \"\"\"\n        try:\n            del self._memo['_gsm']\n        except KeyError:\n            pass\n\n    def _update(self, other):\n        \"\"\"Private method to update an environment's consvar dict directly.\n\n        Bypasses the normal checks that occur when users try to set items.\n        \"\"\"\n        self._dict.update(other)\n\n    def _update_onlynew(self, other):\n        \"\"\"Private method to add new items to an environment's consvar dict.\n\n        Only adds items from `other` whose keys do not already appear in\n        the existing dict; values from `other` are not used for replacement.\n        Bypasses the normal checks that occur when users try to set items.\n        \"\"\"\n        for k, v in other.items():\n            if k not in self._dict:\n                self._dict[k] = v\n\n\n    def get_src_sig_type(self):\n        try:\n            return self.src_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().src_sig_type\n            self.src_sig_type = t\n            return t\n\n    def get_tgt_sig_type(self):\n        try:\n            return self.tgt_sig_type\n        except AttributeError:\n            t = SCons.Defaults.DefaultEnvironment().tgt_sig_type\n            self.tgt_sig_type = t\n            return t\n\n    #######################################################################\n    # Public methods for manipulating an Environment.  These begin with\n    # upper-case letters.  The essential characteristic of methods in\n    # this section is that they do *not* have corresponding same-named\n    # global functions.  For example, a stand-alone Append() function\n    # makes no sense, because Append() is all about appending values to\n    # an Environment's construction variables.\n    #######################################################################\n\n    def Append(self, **kw):\n        \"\"\"Append values to construction variables in an Environment.\n\n        The variable is created if it is not already present.\n        \"\"\"\n\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            try:\n                if key == 'CPPDEFINES' and is_String(self._dict[key]):\n                    self._dict[key] = [self._dict[key]]\n                orig = self._dict[key]\n            except KeyError:\n                # No existing var in the environment, so set to the new value.\n                if key == 'CPPDEFINES' and is_String(val):\n                    self._dict[key] = [val]\n                else:\n                    self._dict[key] = val\n                continue\n\n            try:\n                # Check if the original looks like a dict: has .update?\n                update_dict = orig.update\n            except AttributeError:\n                try:\n                    # Just try to add them together.  This will work\n                    # in most cases, when the original and new values\n                    # are compatible types.\n                    self._dict[key] = orig + val\n                except (KeyError, TypeError):\n                    try:\n                        # Check if the original is a list: has .append?\n                        add_to_orig = orig.append\n                    except AttributeError:\n                        # The original isn't a list, but the new\n                        # value is (by process of elimination),\n                        # so insert the original in the new value\n                        # (if there's one to insert) and replace\n                        # the variable with it.\n                        if orig:\n                            val.insert(0, orig)\n                        self._dict[key] = val\n                    else:\n                        # The original is a list, so append the new\n                        # value to it (if there's a value to append).\n                        if val:\n                            add_to_orig(val)\n                continue\n\n            # The original looks like a dictionary, so update it\n            # based on what we think the value looks like.\n            # We can't just try adding the value because\n            # dictionaries don't have __add__() methods, and\n            # things like UserList will incorrectly coerce the\n            # original dict to a list (which we don't want).\n            if is_List(val):\n                if key == 'CPPDEFINES':\n                    tmp = []\n                    for (k, v) in orig.items():\n                        if v is not None:\n                            tmp.append((k, v))\n                        else:\n                            tmp.append((k,))\n                    orig = tmp\n                    orig += val\n                    self._dict[key] = orig\n                else:\n                    for v in val:\n                        orig[v] = None\n            else:\n                try:\n                    update_dict(val)\n                except (AttributeError, TypeError, ValueError):\n                    if is_Dict(val):\n                        for k, v in val.items():\n                            orig[k] = v\n                    else:\n                        orig[val] = None\n\n        self.scanner_map_delete(kw)\n\n    def _canonicalize(self, path):\n        \"\"\"Allow Dirs and strings beginning with # for top-relative.\n\n        Note this uses the current env's fs (in self).\n        \"\"\"\n        if not is_String(path):  # typically a Dir\n            path = str(path)\n        if path and path[0] == '#':\n            path = str(self.fs.Dir(path))\n        return path\n\n    def AppendENVPath(self, name, newpath, envname = 'ENV',\n                      sep = os.pathsep, delete_existing=0):\n        \"\"\"Append path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the end (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = AppendPath(orig, newpath, sep, delete_existing, canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def AppendUnique(self, delete_existing=0, **kw):\n        \"\"\"Append values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to end.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if is_List(val):\n                val = _delete_duplicates(val, delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif is_Dict(self._dict[key]) and is_Dict(val):\n                self._dict[key].update(val)\n            elif is_List(val):\n                dk = self._dict[key]\n                if key == 'CPPDEFINES':\n                    tmp = []\n                    for i in val:\n                        if is_List(i):\n                            if len(i) >= 2:\n                                tmp.append((i[0], i[1]))\n                            else:\n                                tmp.append((i[0],))\n                        elif is_Tuple(i):\n                            tmp.append(i)\n                        else:\n                            tmp.append((i,))\n                    val = tmp\n                    # Construct a list of (key, value) tuples.\n                    if is_Dict(dk):\n                        tmp = []\n                        for (k, v) in dk.items():\n                            if v is not None:\n                                tmp.append((k, v))\n                            else:\n                                tmp.append((k,))\n                        dk = tmp\n                    elif is_String(dk):\n                        dk = [(dk,)]\n                    else:\n                        tmp = []\n                        for i in dk:\n                            if is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                else:\n                    if not is_List(dk):\n                        dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = dk + val\n            else:\n                dk = self._dict[key]\n                if is_List(dk):\n                    if key == 'CPPDEFINES':\n                        tmp = []\n                        for i in dk:\n                            if is_List(i):\n                                if len(i) >= 2:\n                                    tmp.append((i[0], i[1]))\n                                else:\n                                    tmp.append((i[0],))\n                            elif is_Tuple(i):\n                                tmp.append(i)\n                            else:\n                                tmp.append((i,))\n                        dk = tmp\n                        # Construct a list of (key, value) tuples.\n                        if is_Dict(val):\n                            tmp = []\n                            for (k, v) in val.items():\n                                if v is not None:\n                                    tmp.append((k, v))\n                                else:\n                                    tmp.append((k,))\n                            val = tmp\n                        elif is_String(val):\n                            val = [(val,)]\n                        if delete_existing:\n                            dk = list(filter(lambda x, val=val: x not in val, dk))\n                            self._dict[key] = dk + val\n                        else:\n                            dk = [x for x in dk if x not in val]\n                            self._dict[key] = dk + val\n                    else:\n                        # By elimination, val is not a list.  Since dk is a\n                        # list, wrap val in a list first.\n                        if delete_existing:\n                            dk = list(filter(lambda x, val=val: x not in val, dk))\n                            self._dict[key] = dk + [val]\n                        else:\n                            if val not in dk:\n                                self._dict[key] = dk + [val]\n                else:\n                    if key == 'CPPDEFINES':\n                        if is_String(dk):\n                            dk = [dk]\n                        elif is_Dict(dk):\n                            tmp = []\n                            for (k, v) in dk.items():\n                                if v is not None:\n                                    tmp.append((k, v))\n                                else:\n                                    tmp.append((k,))\n                            dk = tmp\n                        if is_String(val):\n                            if val in dk:\n                                val = []\n                            else:\n                                val = [val]\n                        elif is_Dict(val):\n                            tmp = []\n                            for i,j in val.items():\n                                if j is not None:\n                                    tmp.append((i,j))\n                                else:\n                                    tmp.append(i)\n                            val = tmp\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = dk + val\n        self.scanner_map_delete(kw)\n\n    def Clone(self, tools=[], toolpath=None, parse_flags = None, **kw):\n        \"\"\"Return a copy of a construction Environment.\n\n        The copy is like a Python \"deep copy\"--that is, independent\n        copies are made recursively of each objects--except that\n        a reference is copied when an object is not deep-copyable\n        (like a function).  There are no references to any mutable\n        objects in the original Environment.\n        \"\"\"\n\n        builders = self._dict.get('BUILDERS', {})\n\n        clone = copy.copy(self)\n        # BUILDERS is not safe to do a simple copy\n        clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])\n        clone._dict['BUILDERS'] = BuilderDict(builders, clone)\n\n        # Check the methods added via AddMethod() and re-bind them to\n        # the cloned environment.  Only do this if the attribute hasn't\n        # been overwritten by the user explicitly and still points to\n        # the added method.\n        clone.added_methods = []\n        for mw in self.added_methods:\n            if mw == getattr(self, mw.name):\n                clone.added_methods.append(mw.clone(clone))\n\n        clone._memo = {}\n\n        # Apply passed-in variables before the tools\n        # so the tools can use the new variables\n        kw = copy_non_reserved_keywords(kw)\n        new = {}\n        for key, value in kw.items():\n            new[key] = SCons.Subst.scons_subst_once(value, self, key)\n        clone.Replace(**new)\n\n        apply_tools(clone, tools, toolpath)\n\n        # apply them again in case the tools overwrote them\n        clone.Replace(**new)\n\n        # Finally, apply any flags to be merged in\n        if parse_flags:\n            clone.MergeFlags(parse_flags)\n\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone')\n        return clone\n\n    def _changed_build(self, dependency, target, prev_ni, repo_node=None):\n        if dependency.changed_state(target, prev_ni, repo_node):\n            return 1\n        return self.decide_source(dependency, target, prev_ni, repo_node)\n\n    def _changed_content(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_content(target, prev_ni, repo_node)\n\n    def _changed_source(self, dependency, target, prev_ni, repo_node=None):\n        target_env = dependency.get_build_env()\n        type = target_env.get_tgt_sig_type()\n        if type == 'source':\n            return target_env.decide_source(dependency, target, prev_ni, repo_node)\n        else:\n            return target_env.decide_target(dependency, target, prev_ni, repo_node)\n\n    def _changed_timestamp_then_content(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_then_content(target, prev_ni, repo_node)\n\n    def _changed_timestamp_newer(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_newer(target, prev_ni, repo_node)\n\n    def _changed_timestamp_match(self, dependency, target, prev_ni, repo_node=None):\n        return dependency.changed_timestamp_match(target, prev_ni, repo_node)\n\n    def Decider(self, function):\n        self.cache_timestamp_newer = False\n        if function in ('MD5', 'content'):\n            # TODO: Handle if user requests MD5 and not content with deprecation notice\n            function = self._changed_content\n        elif function in ('MD5-timestamp', 'content-timestamp'):\n            function = self._changed_timestamp_then_content\n        elif function in ('timestamp-newer', 'make'):\n            function = self._changed_timestamp_newer\n            self.cache_timestamp_newer = True\n        elif function == 'timestamp-match':\n            function = self._changed_timestamp_match\n        elif not callable(function):\n            raise UserError(\"Unknown Decider value %s\" % repr(function))\n\n        # We don't use AddMethod because we don't want to turn the\n        # function, which only expects three arguments, into a bound\n        # method, which would add self as an initial, fourth argument.\n        self.decide_target = function\n        self.decide_source = function\n\n\n    def Detect(self, progs):\n        \"\"\"Return the first available program from one or more possibilities.\n\n        Args:\n            progs (str or list): one or more command names to check for\n\n        \"\"\"\n        if not is_List(progs):\n            progs = [progs]\n        for prog in progs:\n            path = self.WhereIs(prog)\n            if path: return prog\n        return None\n\n\n    def Dictionary(self, *args):\n        r\"\"\"Return construction variables from an environment.\n\n        Args:\n          \\*args (optional): variable names to look up\n\n        Returns:\n          If `args` omitted, the dictionary of all construction variables.\n          If one arg, the corresponding value is returned.\n          If more than one arg, a list of values is returned.\n\n        Raises:\n          KeyError: if any of `args` is not in the construction environment.\n\n        \"\"\"\n        if not args:\n            return self._dict\n        dlist = [self._dict[x] for x in args]\n        if len(dlist) == 1:\n            dlist = dlist[0]\n        return dlist\n\n\n    def Dump(self, key=None, format='pretty'):\n        \"\"\" Return construction variables serialized to a string.\n\n        Args:\n          key (optional): if None, format the whole dict of variables.\n            Else format the value of `key` (Default value = None)\n          format (str, optional): specify the format to serialize to.\n            `\"pretty\"` generates a pretty-printed string,\n            `\"json\"` a JSON-formatted string.\n            (Default value = `\"pretty\"`)\n\n        \"\"\"\n        if key:\n            cvars = self.Dictionary(key)\n        else:\n            cvars = self.Dictionary()\n\n        fmt = format.lower()\n\n        if fmt == 'pretty':\n            import pprint\n            pp = pprint.PrettyPrinter(indent=2)\n\n            # TODO: pprint doesn't do a nice job on path-style values\n            # if the paths contain spaces (i.e. Windows), because the\n            # algorithm tries to break lines on spaces, while breaking\n            # on the path-separator would be more \"natural\". Is there\n            # a better way to format those?\n            return pp.pformat(cvars)\n\n        elif fmt == 'json':\n            import json\n            def non_serializable(obj):\n                return str(type(obj).__qualname__)\n            return json.dumps(cvars, indent=4, default=non_serializable)\n        else:\n            raise ValueError(\"Unsupported serialization format: %s.\" % fmt)\n\n\n    def FindIxes(self, paths, prefix, suffix):\n        \"\"\"Search a list of paths for something that matches the prefix and suffix.\n\n        Args:\n          paths: the list of paths or nodes.\n          prefix: construction variable for the prefix.\n          suffix: construction variable for the suffix.\n\n        Returns: the matched path or None\n\n        \"\"\"\n\n        suffix = self.subst('$'+suffix)\n        prefix = self.subst('$'+prefix)\n\n        for path in paths:\n            name = os.path.basename(str(path))\n            if name[:len(prefix)] == prefix and name[-len(suffix):] == suffix:\n                return path\n\n    def ParseConfig(self, command, function=None, unique=True):\n        \"\"\"\n        Use the specified function to parse the output of the command\n        in order to modify the current environment.  The 'command' can\n        be a string or a list of strings representing a command and\n        its arguments.  'Function' is an optional argument that takes\n        the environment, the output of the command, and the unique flag.\n        If no function is specified, MergeFlags, which treats the output\n        as the result of a typical 'X-config' command (i.e. gtk-config),\n        will merge the output into the appropriate variables.\n        \"\"\"\n        if function is None:\n            def parse_conf(env, cmd, unique=unique):\n                return env.MergeFlags(cmd, unique)\n            function = parse_conf\n        if is_List(command):\n            command = ' '.join(command)\n        command = self.subst(command)\n        return function(self, self.backtick(command))\n\n    def ParseDepends(self, filename, must_exist=None, only_one=False):\n        \"\"\"\n        Parse a mkdep-style file for explicit dependencies.  This is\n        completely abusable, and should be unnecessary in the \"normal\"\n        case of proper SCons configuration, but it may help make\n        the transition from a Make hierarchy easier for some people\n        to swallow.  It can also be genuinely useful when using a tool\n        that can write a .d file, but for which writing a scanner would\n        be too complicated.\n        \"\"\"\n        filename = self.subst(filename)\n        try:\n            with open(filename, 'r') as fp:\n                lines = LogicalLines(fp).readlines()\n        except IOError:\n            if must_exist:\n                raise\n            return\n        lines = [l for l in lines if l[0] != '#']\n        tdlist = []\n        for line in lines:\n            try:\n                target, depends = line.split(':', 1)\n            except (AttributeError, ValueError):\n                # Throws AttributeError if line isn't a string.  Can throw\n                # ValueError if line doesn't split into two or more elements.\n                pass\n            else:\n                tdlist.append((target.split(), depends.split()))\n        if only_one:\n            targets = []\n            for td in tdlist:\n                targets.extend(td[0])\n            if len(targets) > 1:\n                raise UserError(\n                            \"More than one dependency target found in `%s':  %s\"\n                                            % (filename, targets))\n        for target, depends in tdlist:\n            self.Depends(target, depends)\n\n    def Platform(self, platform):\n        platform = self.subst(platform)\n        return SCons.Platform.Platform(platform)(self)\n\n    def Prepend(self, **kw):\n        \"\"\"Prepend values to construction variables in an Environment.\n\n        The variable is created if it is not already present.\n        \"\"\"\n\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            try:\n                orig = self._dict[key]\n            except KeyError:\n                # No existing var in the environment so set to the new value.\n                self._dict[key] = val\n                continue\n\n            try:\n                # Check if the original looks like a dict: has .update?\n                update_dict = orig.update\n            except AttributeError:\n                try:\n                    # Just try to add them together.  This will work\n                    # in most cases, when the original and new values\n                    # are compatible types.\n                    self._dict[key] = val + orig\n                except (KeyError, TypeError):\n                    try:\n                        # Check if the added value is a list: has .append?\n                        add_to_val = val.append\n                    except AttributeError:\n                        # The added value isn't a list, but the\n                        # original is (by process of elimination),\n                        # so insert the the new value in the original\n                        # (if there's one to insert).\n                        if val:\n                            orig.insert(0, val)\n                    else:\n                        # The added value is a list, so append\n                        # the original to it (if there's a value\n                        # to append) and replace the original.\n                        if orig:\n                            add_to_val(orig)\n                        self._dict[key] = val\n                continue\n\n            # The original looks like a dictionary, so update it\n            # based on what we think the value looks like.\n            # We can't just try adding the value because\n            # dictionaries don't have __add__() methods, and\n            # things like UserList will incorrectly coerce the\n            # original dict to a list (which we don't want).\n            if is_List(val):\n                for v in val:\n                    orig[v] = None\n            else:\n                try:\n                    update_dict(val)\n                except (AttributeError, TypeError, ValueError):\n                    if is_Dict(val):\n                        for k, v in val.items():\n                            orig[k] = v\n                    else:\n                        orig[val] = None\n\n        self.scanner_map_delete(kw)\n\n    def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,\n                       delete_existing=1):\n        \"\"\"Prepend path elements to the path 'name' in the 'ENV'\n        dictionary for this environment.  Will only add any particular\n        path once, and will normpath and normcase all paths to help\n        assure this.  This can also handle the case where the env\n        variable is a list instead of a string.\n\n        If delete_existing is 0, a newpath which is already in the path\n        will not be moved to the front (it will be left where it is).\n        \"\"\"\n\n        orig = ''\n        if envname in self._dict and name in self._dict[envname]:\n            orig = self._dict[envname][name]\n\n        nv = PrependPath(orig, newpath, sep, delete_existing,\n                                    canonicalize=self._canonicalize)\n\n        if envname not in self._dict:\n            self._dict[envname] = {}\n\n        self._dict[envname][name] = nv\n\n    def PrependUnique(self, delete_existing=0, **kw):\n        \"\"\"Prepend values to existing construction variables\n        in an Environment, if they're not already there.\n        If delete_existing is 1, removes existing values first, so\n        values move to front.\n        \"\"\"\n        kw = copy_non_reserved_keywords(kw)\n        for key, val in kw.items():\n            if is_List(val):\n                val = _delete_duplicates(val, not delete_existing)\n            if key not in self._dict or self._dict[key] in ('', None):\n                self._dict[key] = val\n            elif is_Dict(self._dict[key]) and is_Dict(val):\n                self._dict[key].update(val)\n            elif is_List(val):\n                dk = self._dict[key]\n                if not is_List(dk):\n                    dk = [dk]\n                if delete_existing:\n                    dk = [x for x in dk if x not in val]\n                else:\n                    val = [x for x in val if x not in dk]\n                self._dict[key] = val + dk\n            else:\n                dk = self._dict[key]\n                if is_List(dk):\n                    # By elimination, val is not a list.  Since dk is a\n                    # list, wrap val in a list first.\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                        self._dict[key] = [val] + dk\n                    else:\n                        if val not in dk:\n                            self._dict[key] = [val] + dk\n                else:\n                    if delete_existing:\n                        dk = [x for x in dk if x not in val]\n                    self._dict[key] = val + dk\n        self.scanner_map_delete(kw)\n\n    def Replace(self, **kw):\n        \"\"\"Replace existing construction variables in an Environment\n        with new construction variables and/or values.\n        \"\"\"\n        try:\n            kwbd = kw['BUILDERS']\n        except KeyError:\n            pass\n        else:\n            kwbd = BuilderDict(kwbd,self)\n            del kw['BUILDERS']\n            self.__setitem__('BUILDERS', kwbd)\n        kw = copy_non_reserved_keywords(kw)\n        self._update(semi_deepcopy(kw))\n        self.scanner_map_delete(kw)\n\n    def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):\n        \"\"\"\n        Replace old_prefix with new_prefix and old_suffix with new_suffix.\n\n        env - Environment used to interpolate variables.\n        path - the path that will be modified.\n        old_prefix - construction variable for the old prefix.\n        old_suffix - construction variable for the old suffix.\n        new_prefix - construction variable for the new prefix.\n        new_suffix - construction variable for the new suffix.\n        \"\"\"\n        old_prefix = self.subst('$'+old_prefix)\n        old_suffix = self.subst('$'+old_suffix)\n\n        new_prefix = self.subst('$'+new_prefix)\n        new_suffix = self.subst('$'+new_suffix)\n\n        dir,name = os.path.split(str(path))\n        if name[:len(old_prefix)] == old_prefix:\n            name = name[len(old_prefix):]\n        if name[-len(old_suffix):] == old_suffix:\n            name = name[:-len(old_suffix)]\n        return os.path.join(dir, new_prefix+name+new_suffix)\n\n    def SetDefault(self, **kw):\n        for k in list(kw.keys()):\n            if k in self._dict:\n                del kw[k]\n        self.Replace(**kw)\n\n    def _find_toolpath_dir(self, tp):\n        return self.fs.Dir(self.subst(tp)).srcnode().get_abspath()\n\n    def Tool(self, tool, toolpath=None, **kwargs) -> SCons.Tool.Tool:\n        if is_String(tool):\n            tool = self.subst(tool)\n            if toolpath is None:\n                toolpath = self.get('toolpath', [])\n            toolpath = list(map(self._find_toolpath_dir, toolpath))\n            tool = SCons.Tool.Tool(tool, toolpath, **kwargs)\n        tool(self)\n        return tool\n\n    def WhereIs(self, prog, path=None, pathext=None, reject=None):\n        \"\"\"Find prog in the path. \"\"\"\n        if not prog:  # nothing to search for, just give up\n            return None\n        if path is None:\n            try:\n                path = self['ENV']['PATH']\n            except KeyError:\n                pass\n        elif is_String(path):\n            path = self.subst(path)\n        if pathext is None:\n            try:\n                pathext = self['ENV']['PATHEXT']\n            except KeyError:\n                pass\n        elif is_String(pathext):\n            pathext = self.subst(pathext)\n        prog = CLVar(self.subst(prog))  # support \"program --with-args\"\n        path = WhereIs(prog[0], path, pathext, reject)\n        if path:\n            return path\n        return None\n\n    #######################################################################\n    # Public methods for doing real \"SCons stuff\" (manipulating\n    # dependencies, setting attributes on targets, etc.).  These begin\n    # with upper-case letters.  The essential characteristic of methods\n    # in this section is that they all *should* have corresponding\n    # same-named global functions.\n    #######################################################################\n\n    def Action(self, *args, **kw):\n        def subst_string(a, self=self):\n            if is_String(a):\n                a = self.subst(a)\n            return a\n        nargs = list(map(subst_string, args))\n        nkw = self.subst_kw(kw)\n        return SCons.Action.Action(*nargs, **nkw)\n\n    def AddPreAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in uniq.keys():\n            executor.add_pre_action(action)\n        return nodes\n\n    def AddPostAction(self, files, action):\n        nodes = self.arg2nodes(files, self.fs.Entry)\n        action = SCons.Action.Action(action)\n        uniq = {}\n        for executor in [n.get_executor() for n in nodes]:\n            uniq[executor] = 1\n        for executor in uniq.keys():\n            executor.add_post_action(action)\n        return nodes\n\n    def Alias(self, target, source=[], action=None, **kw):\n        tlist = self.arg2nodes(target, self.ans.Alias)\n        if not is_List(source):\n            source = [source]\n        source = [_f for _f in source if _f]\n\n        if not action:\n            if not source:\n                # There are no source files and no action, so just\n                # return a target list of classic Alias Nodes, without\n                # any builder.  The externally visible effect is that\n                # this will make the wrapping Script.BuildTask class\n                # say that there's \"Nothing to be done\" for this Alias,\n                # instead of that it's \"up to date.\"\n                return tlist\n\n            # No action, but there are sources.  Re-call all the target\n            # builders to add the sources to each target.\n            result = []\n            for t in tlist:\n                bld = t.get_builder(AliasBuilder)\n                result.extend(bld(self, t, source))\n            return result\n\n        nkw = self.subst_kw(kw)\n        nkw.update({\n            'action'            : SCons.Action.Action(action),\n            'source_factory'    : self.fs.Entry,\n            'multi'             : 1,\n            'is_explicit'       : None,\n        })\n        bld = SCons.Builder.Builder(**nkw)\n\n        # Apply the Builder separately to each target so that the Aliases\n        # stay separate.  If we did one \"normal\" Builder call with the\n        # whole target list, then all of the target Aliases would be\n        # associated under a single Executor.\n        result = []\n        for t in tlist:\n            # Calling the convert() method will cause a new Executor to be\n            # created from scratch, so we have to explicitly initialize\n            # it with the target's existing sources, plus our new ones,\n            # so nothing gets lost.\n            b = t.get_builder()\n            if b is None or b is AliasBuilder:\n                b = bld\n            else:\n                nkw['action'] = b.action + action\n                b = SCons.Builder.Builder(**nkw)\n            t.convert()\n            result.extend(b(self, t, t.sources + source))\n        return result\n\n    def AlwaysBuild(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_always_build()\n        return tlist\n\n    def Builder(self, **kw):\n        nkw = self.subst_kw(kw)\n        return SCons.Builder.Builder(**nkw)\n\n    def CacheDir(self, path, custom_class=None):\n        if path is not None:\n            path = self.subst(path)\n        self._CacheDir_path = path\n\n        if custom_class:\n            self['CACHEDIR_CLASS'] = self.validate_CacheDir_class(custom_class)\n\n        if SCons.Action.execute_actions:\n            # Only initialize the CacheDir if  -n/-no_exec was NOT specified.\n            # Now initialized the CacheDir and prevent a race condition which can\n            # happen when there's no existing cache dir and you are building with\n            # multiple threads, but initializing it before the task walk starts\n            self.get_CacheDir()\n\n    def Clean(self, targets, files):\n        global CleanTargets\n        tlist = self.arg2nodes(targets, self.fs.Entry)\n        flist = self.arg2nodes(files, self.fs.Entry)\n        for t in tlist:\n            try:\n                CleanTargets[t].extend(flist)\n            except KeyError:\n                CleanTargets[t] = flist\n\n    def Configure(self, *args, **kw):\n        nargs = [self]\n        if args:\n            nargs = nargs + self.subst_list(args)[0]\n        nkw = self.subst_kw(kw)\n        nkw['_depth'] = kw.get('_depth', 0) + 1\n        try:\n            nkw['custom_tests'] = self.subst_kw(nkw['custom_tests'])\n        except KeyError:\n            pass\n        return SCons.SConf.SConf(*nargs, **nkw)\n\n    def Command(self, target, source, action, **kw):\n        \"\"\"Builds the supplied target files from the supplied\n        source files using the supplied action.  Action may\n        be any type that the Builder constructor will accept\n        for an action.\"\"\"\n        bkw = {\n            'action': action,\n            'target_factory': self.fs.Entry,\n            'source_factory': self.fs.Entry,\n        }\n        # source scanner\n        try:\n            bkw['source_scanner'] = kw['source_scanner']\n        except KeyError:\n            pass\n        else:\n            del kw['source_scanner']\n\n        # target scanner\n        try:\n            bkw['target_scanner'] = kw['target_scanner']\n        except KeyError:\n            pass\n        else:\n            del kw['target_scanner']\n\n        # source factory\n        try:\n            bkw['source_factory'] = kw['source_factory']\n        except KeyError:\n            pass\n        else:\n            del kw['source_factory']\n\n        # target factory\n        try:\n            bkw['target_factory'] = kw['target_factory']\n        except KeyError:\n            pass\n        else:\n            del kw['target_factory']\n\n        bld = SCons.Builder.Builder(**bkw)\n        return bld(self, target, source, **kw)\n\n    def Depends(self, target, dependency):\n        \"\"\"Explicity specify that 'target's depend on 'dependency'.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_dependency(dlist)\n        return tlist\n\n    def Dir(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Dir(e, *args, **kw))\n            return result\n        return self.fs.Dir(s, *args, **kw)\n\n    def PyPackageDir(self, modulename):\n        s = self.subst(modulename)\n        if is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.PyPackageDir(e))\n            return result\n        return self.fs.PyPackageDir(s)\n\n    def NoClean(self, *targets):\n        \"\"\"Tags a target so that it will not be cleaned by -c\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_noclean()\n        return tlist\n\n    def NoCache(self, *targets):\n        \"\"\"Tags a target so that it will not be cached\"\"\"\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_nocache()\n        return tlist\n\n    def Entry(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.Entry(e, *args, **kw))\n            return result\n        return self.fs.Entry(s, *args, **kw)\n\n    def Environment(self, **kw):\n        return SCons.Environment.Environment(**self.subst_kw(kw))\n\n    def Execute(self, action, *args, **kw):\n        \"\"\"Directly execute an action through an Environment\n        \"\"\"\n        action = self.Action(action, *args, **kw)\n        result = action([], [], self)\n        if isinstance(result, BuildError):\n            errstr = result.errstr\n            if result.filename:\n                errstr = result.filename + ': ' + errstr\n            sys.stderr.write(\"scons: *** %s\\n\" % errstr)\n            return result.status\n        else:\n            return result\n\n    def File(self, name, *args, **kw):\n        \"\"\"\n        \"\"\"\n        s = self.subst(name)\n        if is_Sequence(s):\n            result=[]\n            for e in s:\n                result.append(self.fs.File(e, *args, **kw))\n            return result\n        return self.fs.File(s, *args, **kw)\n\n    def FindFile(self, file, dirs):\n        file = self.subst(file)\n        nodes = self.arg2nodes(dirs, self.fs.Dir)\n        return SCons.Node.FS.find_file(file, tuple(nodes))\n\n    def Flatten(self, sequence):\n        return flatten(sequence)\n\n    def GetBuildPath(self, files):\n        result = list(map(str, self.arg2nodes(files, self.fs.Entry)))\n        if is_List(files):\n            return result\n        else:\n            return result[0]\n\n    def Glob(self, pattern, ondisk=True, source=False, strings=False, exclude=None):\n        return self.fs.Glob(self.subst(pattern), ondisk, source, strings, exclude)\n\n    def Ignore(self, target, dependency):\n        \"\"\"Ignore a dependency.\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        dlist = self.arg2nodes(dependency, self.fs.Entry)\n        for t in tlist:\n            t.add_ignore(dlist)\n        return tlist\n\n    def Literal(self, string):\n        return SCons.Subst.Literal(string)\n\n    def Local(self, *targets):\n        ret = []\n        for targ in targets:\n            if isinstance(targ, SCons.Node.Node):\n                targ.set_local()\n                ret.append(targ)\n            else:\n                for t in self.arg2nodes(targ, self.fs.Entry):\n                   t.set_local()\n                   ret.append(t)\n        return ret\n\n    def Precious(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_precious()\n        return tlist\n\n    def Pseudo(self, *targets):\n        tlist = []\n        for t in targets:\n            tlist.extend(self.arg2nodes(t, self.fs.Entry))\n        for t in tlist:\n            t.set_pseudo()\n        return tlist\n\n    def Repository(self, *dirs, **kw):\n        dirs = self.arg2nodes(list(dirs), self.fs.Dir)\n        self.fs.Repository(*dirs, **kw)\n\n    def Requires(self, target, prerequisite):\n        \"\"\"Specify that 'prerequisite' must be built before 'target',\n        (but 'target' does not actually depend on 'prerequisite'\n        and need not be rebuilt if it changes).\"\"\"\n        tlist = self.arg2nodes(target, self.fs.Entry)\n        plist = self.arg2nodes(prerequisite, self.fs.Entry)\n        for t in tlist:\n            t.add_prerequisite(plist)\n        return tlist\n\n    def Scanner(self, *args, **kw):\n        nargs = []\n        for arg in args:\n            if is_String(arg):\n                arg = self.subst(arg)\n            nargs.append(arg)\n        nkw = self.subst_kw(kw)\n        return SCons.Scanner.ScannerBase(*nargs, **nkw)\n\n    def SConsignFile(self, name=SCons.SConsign.current_sconsign_filename(), dbm_module=None):\n        if name is not None:\n            name = self.subst(name)\n            if not os.path.isabs(name):\n                name = os.path.join(str(self.fs.SConstruct_dir), name)\n        if name:\n            name = os.path.normpath(name)\n            sconsign_dir = os.path.dirname(name)\n            if sconsign_dir and not os.path.exists(sconsign_dir):\n                self.Execute(SCons.Defaults.Mkdir(sconsign_dir))\n        SCons.SConsign.File(name, dbm_module)\n\n    def SideEffect(self, side_effect, target):\n        \"\"\"Tell scons that side_effects are built as side\n        effects of building targets.\"\"\"\n        side_effects = self.arg2nodes(side_effect, self.fs.Entry)\n        targets = self.arg2nodes(target, self.fs.Entry)\n\n        added_side_effects = []\n        for side_effect in side_effects:\n            if side_effect.multiple_side_effect_has_builder():\n                raise UserError(\"Multiple ways to build the same target were specified for: %s\" % str(side_effect))\n            side_effect.add_source(targets)\n            side_effect.side_effect = 1\n            self.Precious(side_effect)\n            added = False\n            for target in targets:\n                if side_effect not in target.side_effects:\n                    target.side_effects.append(side_effect)\n                    added = True\n            if added:\n                added_side_effects.append(side_effect)\n        return added_side_effects\n\n    def Split(self, arg):\n        \"\"\"This function converts a string or list into a list of strings\n        or Nodes.  This makes things easier for users by allowing files to\n        be specified as a white-space separated list to be split.\n\n        The input rules are:\n            - A single string containing names separated by spaces. These will be\n              split apart at the spaces.\n            - A single Node instance\n            - A list containing either strings or Node instances. Any strings\n              in the list are not split at spaces.\n\n        In all cases, the function returns a list of Nodes and strings.\"\"\"\n\n        if is_List(arg):\n            return list(map(self.subst, arg))\n        elif is_String(arg):\n            return self.subst(arg).split()\n        else:\n            return [self.subst(arg)]\n\n    def Value(self, value, built_value=None, name=None):\n        \"\"\"\n        \"\"\"\n        return SCons.Node.Python.ValueWithMemo(value, built_value, name)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        variant_dir = self.arg2nodes(variant_dir, self.fs.Dir)[0]\n        src_dir = self.arg2nodes(src_dir, self.fs.Dir)[0]\n        self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n    def FindSourceFiles(self, node='.'):\n        \"\"\" returns a list of all source files.\n        \"\"\"\n        node = self.arg2nodes(node, self.fs.Entry)[0]\n\n        sources = []\n        def build_source(ss):\n            for s in ss:\n                if isinstance(s, SCons.Node.FS.Dir):\n                    build_source(s.all_children())\n                elif s.has_builder():\n                    build_source(s.sources)\n                elif isinstance(s.disambiguate(), SCons.Node.FS.File):\n                    sources.append(s)\n        build_source(node.all_children())\n\n        def final_source(node):\n            while node != node.srcnode():\n              node = node.srcnode()\n            return node\n        sources = list(map(final_source, sources))\n        # remove duplicates\n        return list(set(sources))\n\n    def FindInstalledFiles(self):\n        \"\"\" returns the list of all targets of the Install and InstallAs Builder.\n        \"\"\"\n        from SCons.Tool import install\n        if install._UNIQUE_INSTALLED_FILES is None:\n            install._UNIQUE_INSTALLED_FILES = uniquer_hashables(install._INSTALLED_FILES)\n        return install._UNIQUE_INSTALLED_FILES\n\n\nclass OverrideEnvironment(Base):\n    \"\"\"A proxy that overrides variables in a wrapped construction\n    environment by returning values from an overrides dictionary in\n    preference to values from the underlying subject environment.\n\n    This is a lightweight (I hope) proxy that passes through most use of\n    attributes to the underlying Environment.Base class, but has just\n    enough additional methods defined to act like a real construction\n    environment with overridden values.  It can wrap either a Base\n    construction environment, or another OverrideEnvironment, which\n    can in turn nest arbitrary OverrideEnvironments...\n\n    Note that we do *not* call the underlying base class\n    (SubsitutionEnvironment) initialization, because we get most of those\n    from proxying the attributes of the subject construction environment.\n    But because we subclass SubstitutionEnvironment, this class also\n    has inherited arg2nodes() and subst*() methods; those methods can't\n    be proxied because they need *this* object's methods to fetch the\n    values from the overrides dictionary.\n    \"\"\"\n\n    def __init__(self, subject, overrides=None):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment')\n        self.__dict__['__subject'] = subject\n        if overrides is None:\n            self.__dict__['overrides'] = dict()\n        else:\n            self.__dict__['overrides'] = overrides\n\n    # Methods that make this class act like a proxy.\n    def __getattr__(self, name):\n        attr = getattr(self.__dict__['__subject'], name)\n        # Here we check if attr is one of the Wrapper classes. For\n        # example when a pseudo-builder is being called from an\n        # OverrideEnvironment.\n        #\n        # These wrappers when they're constructed capture the\n        # Environment they are being constructed with and so will not\n        # have access to overrided values. So we rebuild them with the\n        # OverrideEnvironment so they have access to overrided values.\n        if isinstance(attr, MethodWrapper):\n            return attr.clone(self)\n        else:\n            return attr\n\n    def __setattr__(self, name, value):\n        setattr(self.__dict__['__subject'], name, value)\n\n    # Methods that make this class act like a dictionary.\n    def __getitem__(self, key):\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].__getitem__(key)\n\n    def __setitem__(self, key, value):\n        if not is_valid_construction_var(key):\n            raise UserError(\"Illegal construction variable `%s'\" % key)\n        self.__dict__['overrides'][key] = value\n\n    def __delitem__(self, key):\n        try:\n            del self.__dict__['overrides'][key]\n        except KeyError:\n            deleted = 0\n        else:\n            deleted = 1\n        try:\n            result = self.__dict__['__subject'].__delitem__(key)\n        except KeyError:\n            if not deleted:\n                raise\n            result = None\n        return result\n\n    def get(self, key, default=None):\n        \"\"\"Emulates the get() method of dictionaries.\"\"\"\n        try:\n            return self.__dict__['overrides'][key]\n        except KeyError:\n            return self.__dict__['__subject'].get(key, default)\n\n    def __contains__(self, key):\n        if key in self.__dict__['overrides']:\n            return True\n        return key in self.__dict__['__subject']\n\n    def Dictionary(self, *args):\n        d = self.__dict__['__subject'].Dictionary().copy()\n        d.update(self.__dict__['overrides'])\n        if not args:\n            return d\n        dlist = [d[x] for x in args]\n        if len(dlist) == 1:\n            dlist = dlist[0]\n        return dlist\n\n    def items(self):\n        \"\"\"Emulates the items() method of dictionaries.\"\"\"\n        return self.Dictionary().items()\n\n    def keys(self):\n        \"\"\"Emulates the keys() method of dictionaries.\"\"\"\n        return self.Dictionary().keys()\n\n    def values(self):\n        \"\"\"Emulates the values() method of dictionaries.\"\"\"\n        return self.Dictionary().values()\n\n    def setdefault(self, key, default=None):\n        \"\"\"Emulates the setdefault() method of dictionaries.\"\"\"\n        try:\n            return self.__getitem__(key)\n        except KeyError:\n            self.__dict__['overrides'][key] = default\n            return default\n\n    # Overridden private construction environment methods.\n    def _update(self, other):\n        self.__dict__['overrides'].update(other)\n\n    def _update_onlynew(self, other):\n        for k, v in other.items():\n            if k not in self.__dict__['overrides']:\n                self.__dict__['overrides'][k] = v\n\n    def gvars(self):\n        return self.__dict__['__subject'].gvars()\n\n    def lvars(self):\n        lvars = self.__dict__['__subject'].lvars()\n        lvars.update(self.__dict__['overrides'])\n        return lvars\n\n    # Overridden public construction environment methods.\n    def Replace(self, **kw):\n        kw = copy_non_reserved_keywords(kw)\n        self.__dict__['overrides'].update(semi_deepcopy(kw))\n\n\n# The entry point that will be used by the external world\n# to refer to a construction environment.  This allows the wrapper\n# interface to extend a construction environment for its own purposes\n# by subclassing SCons.Environment.Base and then assigning the\n# class to SCons.Environment.Environment.\n\nEnvironment = Base\n\n\ndef NoSubstitutionProxy(subject):\n    \"\"\"\n    An entry point for returning a proxy subclass instance that overrides\n    the subst*() methods so they don't actually perform construction\n    variable substitution.  This is specifically intended to be the shim\n    layer in between global function calls (which don't want construction\n    variable substitution) and the DefaultEnvironment() (which would\n    substitute variables if left to its own devices).\n\n    We have to wrap this in a function that allows us to delay definition of\n    the class until it's necessary, so that when it subclasses Environment\n    it will pick up whatever Environment subclass the wrapper interface\n    might have assigned to SCons.Environment.Environment.\n    \"\"\"\n    class _NoSubstitutionProxy(Environment):\n        def __init__(self, subject):\n            self.__dict__['__subject'] = subject\n        def __getattr__(self, name):\n            return getattr(self.__dict__['__subject'], name)\n        def __setattr__(self, name, value):\n            return setattr(self.__dict__['__subject'], name, value)\n        def executor_to_lvars(self, kwdict):\n            if 'executor' in kwdict:\n                kwdict['lvars'] = kwdict['executor'].get_lvars()\n                del kwdict['executor']\n            else:\n                kwdict['lvars'] = {}\n        def raw_to_mode(self, dict):\n            try:\n                raw = dict['raw']\n            except KeyError:\n                pass\n            else:\n                del dict['raw']\n                dict['mode'] = raw\n        def subst(self, string, *args, **kwargs):\n            return string\n        def subst_kw(self, kw, *args, **kwargs):\n            return kw\n        def subst_list(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst_list(*nargs, **nkw)\n        def subst_target_source(self, string, *args, **kwargs):\n            nargs = (string, self,) + args\n            nkw = kwargs.copy()\n            nkw['gvars'] = {}\n            self.executor_to_lvars(nkw)\n            self.raw_to_mode(nkw)\n            return SCons.Subst.scons_subst(*nargs, **nkw)\n    return _NoSubstitutionProxy(subject)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport re\n\n_is_valid_var = re.compile(r'[_a-zA-Z]\\w*$')\n\n_rm = re.compile(r'\\$[()]')\n_remove = re.compile(r'\\$\\([^$]*(\\$[^)][^$]*)*\\$\\)')\n\n# Regular expressions for splitting strings and handling substitutions,\n# for use by the scons_subst() and scons_subst_list() functions:\n#\n# The first expression compiled matches all of the $-introduced tokens\n# that we need to process in some way, and is used for substitutions.\n# The expressions it matches are:\n#\n#       \"$$\"\n#       \"$(\"\n#       \"$)\"\n#       \"$variable\"             [must begin with alphabetic or underscore]\n#       \"${any stuff}\"\n#\n# The second expression compiled is used for splitting strings into tokens\n# to be processed, and it matches all of the tokens listed above, plus\n# the following that affect how arguments do or don't get joined together:\n#\n#       \"   \"                   [white space]\n#       \"non-white-space\"       [without any dollar signs]\n#       \"$\"                     [single dollar sign]\n#\n_dollar_exps_str = r'\\$[\\$\\(\\)]|\\$[_a-zA-Z][\\.\\w]*|\\${[^}]*}'\n_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)\n_separate_args = re.compile(r'(%s|\\s+|[^\\s$]+|\\$)' % _dollar_exps_str)\n\n# This regular expression is used to replace strings of multiple white\n# space characters in the string result from the scons_subst() function.\n_space_sep = re.compile(r'[\\t ]+(?![^{]*})')\n\nclass ValueTypes:\n    \"\"\"\n    Enum to store what type of value the variable holds.\n    \"\"\"\n    UNKNOWN = 0\n    STRING = 1\n    CALLABLE = 2\n    VARIABLE = 3\n\n\nclass EnvironmentValue:\n    \"\"\"\n    Hold a single value. We're going to cache parsed version of the file\n    We're going to keep track of variables which feed into this values evaluation\n    \"\"\"\n    def __init__(self, value):\n        self.value = value\n        self.var_type = ValueTypes.UNKNOWN\n\n        if callable(self.value):\n            self.var_type = ValueTypes.CALLABLE\n        else:\n            self.parse_value()\n\n\n    def parse_value(self):\n        \"\"\"\n        Scan the string and break into component values\n        \"\"\"\n\n        try:\n            if '$' not in self.value:\n                self._parsed = self.value\n                self.var_type = ValueTypes.STRING\n            else:\n                # Now we need to parse the specified string\n                result = _dollar_exps.sub(sub_match, args)\n                print(result)\n        except TypeError:\n            # likely callable? either way we don't parse\n            self._parsed = self.value\n\n    def parse_trial(self):\n        \"\"\"\n        Try alternate parsing methods.\n        :return:\n        \"\"\"\n        parts = []\n        for c in self.value:\n            pass\n\n\nclass EnvironmentValues:\n    \"\"\"\n    A class to hold all the environment variables\n    \"\"\"\n    def __init__(self, **kw):\n        self._dict = {}\n        for k in kw:\n            self._dict[k] = EnvironmentValue(kw[k])\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons exception classes.\n\nUsed to handle internal and user errors in SCons.\n\n\"\"\"\n\nimport shutil\nimport SCons.Util\n\n\nclass BuildError(Exception):\n    \"\"\"SCons Errors that can occur while building.\n\n    Attributes:\n      Information about the cause of the build error :\n\n      errstr: a description of the error message\n\n      status: the return code of the action that caused the build error.\n        Must be set to a non-zero value even if the build error is not due\n        to an action returning a non-zero returned code.\n\n      exitstatus: SCons exit status due to this build error.\n        Must be nonzero unless due to an explicit Exit()\n        call.  Not always the same as status, since\n        actions return a status code that should be\n        respected, but SCons typically exits with 2\n        irrespective of the return value of the failed\n        action.\n\n      filename: The name of the file or directory that caused the\n        build error. Set to None if no files are associated with\n        this error. This might be different from the target\n        being built. For example, failure to create the\n        directory in which the target file will appear. It\n        can be None if the error is not due to a particular\n        filename.\n\n      exc_info: Info about exception that caused the build\n        error. Set to (None, None, None) if this build\n        error is not due to an exception.\n\n      Information about the what caused the build error :\n\n      node: the error occurred while building this target node(s)\n\n      executor: the executor that caused the build to fail (might\n        be None if the build failures is not due to the\n        executor failing)\n\n      action: the action that caused the build to fail (might be\n        None if the build failures is not due to the an\n        action failure)\n\n      command: the command line for the action that caused the\n        build to fail (might be None if the build failures\n        is not due to the an action failure)\n\n    \"\"\"\n\n    def __init__(self,\n                 node=None, errstr=\"Unknown error\", status=2, exitstatus=2,\n                 filename=None, executor=None, action=None, command=None,\n                 exc_info=(None, None, None)):\n\n        # py3: errstr should be string and not bytes.\n\n        self.errstr = SCons.Util.to_String(errstr)\n        self.status = status\n        self.exitstatus = exitstatus\n        self.filename = filename\n        self.exc_info = exc_info\n\n        self.node = node\n        self.executor = executor\n        self.action = action\n        self.command = command\n\n        Exception.__init__(self, node, errstr, status, exitstatus, filename,\n                           executor, action, command, exc_info)\n\n    def __str__(self):\n        if self.filename:\n            return self.filename + ': ' + self.errstr\n        else:\n            return self.errstr\n\nclass InternalError(Exception):\n    pass\n\nclass UserError(Exception):\n    pass\n\nclass StopError(Exception):\n    pass\n\nclass SConsEnvironmentError(Exception):\n    pass\n\nclass MSVCError(IOError):\n    pass\n\nclass ExplicitExit(Exception):\n    def __init__(self, node=None, status=None, *args):\n        self.node = node\n        self.status = status\n        self.exitstatus = status\n        Exception.__init__(self, *args)\n\ndef convert_to_BuildError(status, exc_info=None):\n    \"\"\"Convert a return code to a BuildError Exception.\n\n    The `buildError.status` we set here will normally be\n    used as the exit status of the \"scons\" process.\n\n    Args:\n      status: can either be a return code or an Exception.\n      exc_info (tuple, optional): explicit exception information.\n\n    \"\"\"\n\n    if not exc_info and isinstance(status, Exception):\n        exc_info = (status.__class__, status, None)\n\n\n    if isinstance(status, BuildError):\n        buildError = status\n        buildError.exitstatus = 2   # always exit with 2 on build errors\n    elif isinstance(status, ExplicitExit):\n        status = status.status\n        errstr = 'Explicit exit, status %s' % status\n        buildError = BuildError(\n            errstr=errstr,\n            status=status,      # might be 0, OK here\n            exitstatus=status,      # might be 0, OK here\n            exc_info=exc_info)\n    elif isinstance(status, (StopError, UserError)):\n        buildError = BuildError(\n            errstr=str(status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif isinstance(status, shutil.SameFileError):\n        # PY3 has a exception for when copying file to itself\n        # It's object provides info differently than below\n        try:\n            filename = status.filename\n        except AttributeError:\n            filename = None\n\n        buildError = BuildError(\n            errstr=status.args[0],\n            status=status.errno,\n            exitstatus=2,\n            filename=filename,\n            exc_info=exc_info)\n\n    elif isinstance(status, (SConsEnvironmentError, OSError, IOError)):\n        # If an IOError/OSError happens, raise a BuildError.\n        # Report the name of the file or directory that caused the\n        # error, which might be different from the target being built\n        # (for example, failure to create the directory in which the\n        # target file will appear).\n        filename = getattr(status, 'filename', None)\n        strerror = getattr(status, 'strerror', str(status))\n        errno = getattr(status, 'errno', 2)\n\n        buildError = BuildError(\n            errstr=strerror,\n            status=errno,\n            exitstatus=2,\n            filename=filename,\n            exc_info=exc_info)\n    elif isinstance(status, Exception):\n        buildError = BuildError(\n            errstr='%s : %s' % (status.__class__.__name__, status),\n            status=2,\n            exitstatus=2,\n            exc_info=exc_info)\n    elif SCons.Util.is_String(status):\n        buildError = BuildError(\n            errstr=status,\n            status=2,\n            exitstatus=2)\n    else:\n        buildError = BuildError(\n            errstr=\"Error %s\" % status,\n            status=status,\n            exitstatus=2)\n\n    #import sys\n    #sys.stderr.write(\"convert_to_BuildError: status %s => (errstr %s, status %s)\\n\"%(status,buildError.errstr, buildError.status))\n    return buildError\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Execute actions with specific lists of target and source Nodes.\"\"\"\n\nimport collections\n\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Util\nfrom SCons.compat import NoSlotsPyPy\nimport SCons.Debug\nfrom SCons.Debug import logInstanceCreation\n\nclass Batch:\n    \"\"\"Remembers exact association between targets\n    and sources of executor.\"\"\"\n\n    __slots__ = ('targets',\n                 'sources')\n\n    def __init__(self, targets=[], sources=[]):\n        self.targets = targets\n        self.sources = sources\n\n\n\nclass TSList(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by wrapping\n    an executor Method.  This class is used in the Executor.lvars()\n    to delay creation of NodeList objects until they're needed.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        nl = self.func()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.func()\n        return nl[i]\n    def __str__(self):\n        nl = self.func()\n        return str(nl)\n    def __repr__(self):\n        nl = self.func()\n        return repr(nl)\n\nclass TSObject:\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by wrapping\n    an Executor method.\n    \"\"\"\n    def __init__(self, func):\n        self.func = func\n    def __getattr__(self, attr):\n        n = self.func()\n        return getattr(n, attr)\n    def __str__(self):\n        n = self.func()\n        if n:\n            return str(n)\n        return ''\n    def __repr__(self):\n        n = self.func()\n        if n:\n            return repr(n)\n        return ''\n\ndef rfile(node):\n    \"\"\"\n    A function to return the results of a Node's rfile() method,\n    if it exists, and the Node itself otherwise (if it's a Value\n    Node, e.g.).\n    \"\"\"\n    try:\n        rfile = node.rfile\n    except AttributeError:\n        return node\n    else:\n        return rfile()\n\n\ndef execute_nothing(obj, target, kw):\n    return 0\n\ndef execute_action_list(obj, target, kw):\n    \"\"\"Actually execute the action list.\"\"\"\n    env = obj.get_build_env()\n    kw = obj.get_kw(kw)\n    status = 0\n    for act in obj.get_action_list():\n        args = ([], [], env)\n        status = act(*args, **kw)\n        if isinstance(status, SCons.Errors.BuildError):\n            status.executor = obj\n            raise status    # TODO pylint E0702: raising int not allowed\n        elif status:\n            msg = \"Error %s\" % status\n            raise SCons.Errors.BuildError(\n                errstr=msg,\n                node=obj.batches[0].targets,\n                executor=obj,\n                action=act)\n    return status\n\n_do_execute_map = {0 : execute_nothing,\n                   1 : execute_action_list}\n\n\ndef execute_actions_str(obj):\n    env = obj.get_build_env()\n    return \"\\n\".join([action.genstring(obj.get_all_targets(),\n                                       obj.get_all_sources(),\n                                       env)\n                      for action in obj.get_action_list()])\n\ndef execute_null_str(obj):\n    return ''\n\n_execute_str_map = {0 : execute_null_str,\n                    1 : execute_actions_str}\n\n\nclass Executor(object, metaclass=NoSlotsPyPy):\n    \"\"\"A class for controlling instances of executing an action.\n\n    This largely exists to hold a single association of an action,\n    environment, list of environment override dictionaries, targets\n    and sources for later processing as needed.\n    \"\"\"\n\n    __slots__ = ('pre_actions',\n                 'post_actions',\n                 'env',\n                 'overridelist',\n                 'batches',\n                 'builder_kw',\n                 '_memo',\n                 'lvars',\n                 '_changed_sources_list',\n                 '_changed_targets_list',\n                 '_unchanged_sources_list',\n                 '_unchanged_targets_list',\n                 'action_list',\n                 '_do_execute',\n                 '_execute_str')\n\n    def __init__(self, action, env=None, overridelist=[{}],\n                 targets=[], sources=[], builder_kw={}):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor')\n        self.set_action_list(action)\n        self.pre_actions = []\n        self.post_actions = []\n        self.env = env\n        self.overridelist = overridelist\n        if targets or sources:\n            self.batches = [Batch(targets[:], sources[:])]\n        else:\n            self.batches = []\n        self.builder_kw = builder_kw\n        self._do_execute = 1\n        self._execute_str = 1\n        self._memo = {}\n\n    def get_lvars(self):\n        try:\n            return self.lvars\n        except AttributeError:\n            self.lvars = {\n                'CHANGED_SOURCES' : TSList(self._get_changed_sources),\n                'CHANGED_TARGETS' : TSList(self._get_changed_targets),\n                'SOURCE' : TSObject(self._get_source),\n                'SOURCES' : TSList(self._get_sources),\n                'TARGET' : TSObject(self._get_target),\n                'TARGETS' : TSList(self._get_targets),\n                'UNCHANGED_SOURCES' : TSList(self._get_unchanged_sources),\n                'UNCHANGED_TARGETS' : TSList(self._get_unchanged_targets),\n            }\n            return self.lvars\n\n    def _get_changes(self):\n        cs = []\n        ct = []\n        us = []\n        ut = []\n        for b in self.batches:\n            # don't add targets marked always build to unchanged lists\n            # add to changed list as they always need to build\n            if not b.targets[0].always_build and b.targets[0].is_up_to_date():\n                us.extend(list(map(rfile, b.sources)))\n                ut.extend(b.targets)\n            else:\n                cs.extend(list(map(rfile, b.sources)))\n                ct.extend(b.targets)\n        self._changed_sources_list = SCons.Util.NodeList(cs)\n        self._changed_targets_list = SCons.Util.NodeList(ct)\n        self._unchanged_sources_list = SCons.Util.NodeList(us)\n        self._unchanged_targets_list = SCons.Util.NodeList(ut)\n\n    def _get_changed_sources(self, *args, **kw):\n        try:\n            return self._changed_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_sources_list\n\n    def _get_changed_targets(self, *args, **kw):\n        try:\n            return self._changed_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._changed_targets_list\n\n    def _get_source(self, *args, **kw):\n        return rfile(self.batches[0].sources[0]).get_subst_proxy()\n\n    def _get_sources(self, *args, **kw):\n        return SCons.Util.NodeList([rfile(n).get_subst_proxy() for n in self.get_all_sources()])\n\n    def _get_target(self, *args, **kw):\n        return self.batches[0].targets[0].get_subst_proxy()\n\n    def _get_targets(self, *args, **kw):\n        return SCons.Util.NodeList([n.get_subst_proxy() for n in self.get_all_targets()])\n\n    def _get_unchanged_sources(self, *args, **kw):\n        try:\n            return self._unchanged_sources_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_sources_list\n\n    def _get_unchanged_targets(self, *args, **kw):\n        try:\n            return self._unchanged_targets_list\n        except AttributeError:\n            self._get_changes()\n            return self._unchanged_targets_list\n\n    def get_action_targets(self):\n        if not self.action_list:\n            return []\n        targets_string = self.action_list[0].get_targets(self.env, self)\n        if targets_string[0] == '$':\n            targets_string = targets_string[1:]\n        return self.get_lvars()[targets_string]\n\n    def set_action_list(self, action):\n        if not SCons.Util.is_List(action):\n            if not action:\n                raise SCons.Errors.UserError(\"Executor must have an action.\")\n            action = [action]\n        self.action_list = action\n\n    def get_action_list(self):\n        if self.action_list is None:\n            return []\n        return self.pre_actions + self.action_list + self.post_actions\n\n    def get_all_targets(self):\n        \"\"\"Returns all targets for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.targets)\n        return result\n\n    def get_all_sources(self):\n        \"\"\"Returns all sources for all batches of this Executor.\"\"\"\n        result = []\n        for batch in self.batches:\n            result.extend(batch.sources)\n        return result\n\n    def get_all_children(self):\n        \"\"\"Returns all unique children (dependencies) for all batches\n        of this Executor.\n\n        The Taskmaster can recognize when it's already evaluated a\n        Node, so we don't have to make this list unique for its intended\n        canonical use case, but we expect there to be a lot of redundancy\n        (long lists of batched .cc files #including the same .h files\n        over and over), so removing the duplicates once up front should\n        save the Taskmaster a lot of work.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            result.extend(target.children())\n        return result\n\n    def get_all_prerequisites(self):\n        \"\"\"Returns all unique (order-only) prerequisites for all batches\n        of this Executor.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_all_targets():\n            if target.prerequisites is not None:\n                result.extend(target.prerequisites)\n        return result\n\n    def get_action_side_effects(self):\n\n        \"\"\"Returns all side effects for all batches of this\n        Executor used by the underlying Action.\n        \"\"\"\n        result = SCons.Util.UniqueList([])\n        for target in self.get_action_targets():\n            result.extend(target.side_effects)\n        return result\n\n    @SCons.Memoize.CountMethodCall\n    def get_build_env(self):\n        \"\"\"Fetch or create the appropriate build Environment\n        for this Executor.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n\n        # Create the build environment instance with appropriate\n        # overrides.  These get evaluated against the current\n        # environment's construction variables so that users can\n        # add to existing values by referencing the variable in\n        # the expansion.\n        overrides = {}\n        for odict in self.overridelist:\n            overrides.update(odict)\n\n        import SCons.Defaults\n        env = self.env or SCons.Defaults.DefaultEnvironment()\n        build_env = env.Override(overrides)\n\n        self._memo['get_build_env'] = build_env\n\n        return build_env\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the scanner path for this executor's targets and sources.\n        \"\"\"\n        env = self.get_build_env()\n        try:\n            cwd = self.batches[0].targets[0].cwd\n        except (IndexError, AttributeError):\n            cwd = None\n        return scanner.path(env, cwd,\n                            self.get_all_targets(),\n                            self.get_all_sources())\n\n    def get_kw(self, kw={}):\n        result = self.builder_kw.copy()\n        result.update(kw)\n        result['executor'] = self\n        return result\n\n    # use extra indirection because with new-style objects (Python 2.2\n    # and above) we can't override special methods, and nullify() needs\n    # to be able to do this.\n\n    def __call__(self, target, **kw):\n        return _do_execute_map[self._do_execute](self, target, kw)\n\n    def cleanup(self):\n        self._memo = {}\n\n    def add_sources(self, sources):\n        \"\"\"Add source files to this Executor's list.  This is necessary\n        for \"multi\" Builders that can be called repeatedly to build up\n        a source file list for a given target.\"\"\"\n        # TODO(batch):  extend to multiple batches\n        assert (len(self.batches) == 1)\n        # TODO(batch):  remove duplicates?\n        sources = [x for x in sources if x not in self.batches[0].sources]\n        self.batches[0].sources.extend(sources)\n\n    def get_sources(self):\n        return self.batches[0].sources\n\n    def add_batch(self, targets, sources):\n        \"\"\"Add pair of associated target and source to this Executor's list.\n        This is necessary for \"batch\" Builders that can be called repeatedly\n        to build up a list of matching target and source files that will be\n        used in order to update multiple target files at once from multiple\n        corresponding source files, for tools like MSVC that support it.\"\"\"\n        self.batches.append(Batch(targets, sources))\n\n    def prepare(self):\n        \"\"\"\n        Preparatory checks for whether this Executor can go ahead\n        and (try to) build its targets.\n        \"\"\"\n        for s in self.get_all_sources():\n            if s.missing():\n                msg = \"Source `%s' not found, needed by target `%s'.\"\n                raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))\n\n    def add_pre_action(self, action):\n        self.pre_actions.append(action)\n\n    def add_post_action(self, action):\n        self.post_actions.append(action)\n\n    # another extra indirection for new-style objects and nullify...\n\n    def __str__(self):\n        return _execute_str_map[self._execute_str](self)\n\n    def nullify(self):\n        self.cleanup()\n        self._do_execute = 0\n        self._execute_str = 0\n\n    @SCons.Memoize.CountMethodCall\n    def get_contents(self):\n        \"\"\"Fetch the signature contents.  This is the main reason this\n        class exists, so we can compute this once and cache it regardless\n        of how many target or source Nodes there are.\n\n        Returns bytes\n        \"\"\"\n        try:\n            return self._memo['get_contents']\n        except KeyError:\n            pass\n        env = self.get_build_env()\n\n        action_list = self.get_action_list()\n        all_targets = self.get_all_targets()\n        all_sources = self.get_all_sources()\n\n        result = bytearray(\"\",'utf-8').join([action.get_contents(all_targets,\n                                                                 all_sources,\n                                                                 env)\n                                             for action in action_list])\n\n        self._memo['get_contents'] = result\n        return result\n\n    def get_timestamp(self):\n        \"\"\"Fetch a time stamp for this Executor.  We don't have one, of\n        course (only files do), but this is the interface used by the\n        timestamp module.\n        \"\"\"\n        return 0\n\n    def scan_targets(self, scanner):\n        # TODO(batch):  scan by batches\n        self.scan(scanner, self.get_all_targets())\n\n    def scan_sources(self, scanner):\n        # TODO(batch):  scan by batches\n        if self.batches[0].sources:\n            self.scan(scanner, self.get_all_sources())\n\n    def scan(self, scanner, node_list):\n        \"\"\"Scan a list of this Executor's files (targets or sources) for\n        implicit dependencies and update all of the targets with them.\n        This essentially short-circuits an N*M scan of the sources for\n        each individual target, which is a hell of a lot more efficient.\n        \"\"\"\n        env = self.get_build_env()\n        path = self.get_build_scanner_path\n        kw = self.get_kw()\n\n        # TODO(batch):  scan by batches)\n        deps = []\n\n        for node in node_list:\n            node.disambiguate()\n            deps.extend(node.get_implicit_deps(env, scanner, path, kw))\n\n        deps.extend(self.get_implicit_deps())\n\n        for tgt in self.get_all_targets():\n            tgt.add_to_implicit(deps)\n\n    def _get_unignored_sources_key(self, node, ignore=()):\n        return (node,) + tuple(ignore)\n\n    @SCons.Memoize.CountDictCall(_get_unignored_sources_key)\n    def get_unignored_sources(self, node, ignore=()):\n        key = (node,) + tuple(ignore)\n        try:\n            memo_dict = self._memo['get_unignored_sources']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_unignored_sources'] = memo_dict\n        else:\n            try:\n                return memo_dict[key]\n            except KeyError:\n                pass\n\n        if node:\n            # TODO:  better way to do this (it's a linear search,\n            # but it may not be critical path)?\n            sourcelist = []\n            for b in self.batches:\n                if node in b.targets:\n                    sourcelist = b.sources\n                    break\n        else:\n            sourcelist = self.get_all_sources()\n        if ignore:\n            idict = {}\n            for i in ignore:\n                idict[i] = 1\n            sourcelist = [s for s in sourcelist if s not in idict]\n\n        memo_dict[key] = sourcelist\n\n        return sourcelist\n\n    def get_implicit_deps(self):\n        \"\"\"Return the executor's implicit dependencies, i.e. the nodes of\n        the commands to be executed.\"\"\"\n        result = []\n        build_env = self.get_build_env()\n        for act in self.get_action_list():\n            deps = act.get_implicit_deps(self.get_all_targets(),\n                                         self.get_all_sources(),\n                                         build_env)\n            result.extend(deps)\n        return result\n\n\n\n_batch_executors = {}\n\ndef GetBatchExecutor(key):\n    return _batch_executors[key]\n\ndef AddBatchExecutor(key, executor):\n    assert key not in _batch_executors\n    _batch_executors[key] = executor\n\nnullenv = None\n\n\nclass NullEnvironment(SCons.Util.Null):\n    import SCons.CacheDir\n    _CacheDir_path = None\n    _CacheDir = SCons.CacheDir.CacheDir(None)\n    def get_CacheDir(self):\n        return self._CacheDir\n\n\ndef get_NullEnvironment():\n    \"\"\"Use singleton pattern for Null Environments.\"\"\"\n    global nullenv\n\n    if nullenv is None:\n        nullenv = NullEnvironment()\n    return nullenv\n\nclass Null(object, metaclass=NoSlotsPyPy):\n    \"\"\"A null Executor, with a null build Environment, that does\n    nothing when the rest of the methods call it.\n\n    This might be able to disappear when we refactor things to\n    disassociate Builders from Nodes entirely, so we're not\n    going to worry about unit tests for this--at least for now.\n    \"\"\"\n\n    __slots__ = ('pre_actions',\n                 'post_actions',\n                 'env',\n                 'overridelist',\n                 'batches',\n                 'builder_kw',\n                 '_memo',\n                 'lvars',\n                 '_changed_sources_list',\n                 '_changed_targets_list',\n                 '_unchanged_sources_list',\n                 '_unchanged_targets_list',\n                 'action_list',\n                 '_do_execute',\n                 '_execute_str')\n\n    def __init__(self, *args, **kw):\n        if SCons.Debug.track_instances:\n            logInstanceCreation(self, 'Executor.Null')\n        self.batches = [Batch(kw['targets'][:], [])]\n    def get_build_env(self):\n        return get_NullEnvironment()\n    def get_build_scanner_path(self):\n        return None\n    def cleanup(self):\n        pass\n    def prepare(self):\n        pass\n    def get_unignored_sources(self, *args, **kw):\n        return tuple(())\n    def get_action_targets(self):\n        return []\n    def get_action_list(self):\n        return []\n    def get_all_targets(self):\n        return self.batches[0].targets\n    def get_all_sources(self):\n        return self.batches[0].targets[0].sources\n    def get_all_children(self):\n        return self.batches[0].targets[0].children()\n    def get_all_prerequisites(self):\n        return []\n    def get_action_side_effects(self):\n        return []\n    def __call__(self, *args, **kw):\n        return 0\n    def get_contents(self):\n        return ''\n    def _morph(self):\n        \"\"\"Morph this Null executor to a real Executor object.\"\"\"\n        batches = self.batches\n        self.__class__ = Executor\n        self.__init__([])\n        self.batches = batches\n\n    # The following methods require morphing this Null Executor to a\n    # real Executor object.\n\n    def add_pre_action(self, action):\n        self._morph()\n        self.add_pre_action(action)\n    def add_post_action(self, action):\n        self._morph()\n        self.add_post_action(action)\n    def set_action_list(self, action):\n        self._morph()\n        self.set_action_list(action)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Serial and Parallel classes to execute build tasks.\n\nThe Jobs class provides a higher level interface to start,\nstop, and wait on jobs.\n\"\"\"\n\nimport SCons.compat\n\nimport os\nimport signal\n\nimport SCons.Errors\nimport SCons.Warnings\n\n# The default stack size (in kilobytes) of the threads used to execute\n# jobs in parallel.\n#\n# We use a stack size of 256 kilobytes. The default on some platforms\n# is too large and prevents us from creating enough threads to fully\n# parallelized the build. For example, the default stack size on linux\n# is 8 MBytes.\n\nexplicit_stack_size = None\ndefault_stack_size = 256\n\ninterrupt_msg = 'Build interrupted.'\n\n\nclass InterruptState:\n    def __init__(self):\n        self.interrupted = False\n\n    def set(self):\n        self.interrupted = True\n\n    def __call__(self):\n        return self.interrupted\n\n\nclass Jobs:\n    \"\"\"An instance of this class initializes N jobs, and provides\n    methods for starting, stopping, and waiting on all N jobs.\n    \"\"\"\n\n    def __init__(self, num, taskmaster):\n        \"\"\"\n        Create 'num' jobs using the given taskmaster.\n\n        If 'num' is 1 or less, then a serial job will be used,\n        otherwise a parallel job with 'num' worker threads will\n        be used.\n\n        The 'num_jobs' attribute will be set to the actual number of jobs\n        allocated.  If more than one job is requested but the Parallel\n        class can't do it, it gets reset to 1.  Wrapping interfaces that\n        care should check the value of 'num_jobs' after initialization.\n        \"\"\"\n\n        self.job = None\n        if num > 1:\n            stack_size = explicit_stack_size\n            if stack_size is None:\n                stack_size = default_stack_size\n\n            try:\n                self.job = Parallel(taskmaster, num, stack_size)\n                self.num_jobs = num\n            except NameError:\n                pass\n        if self.job is None:\n            self.job = Serial(taskmaster)\n            self.num_jobs = 1\n\n    def run(self, postfunc=lambda: None):\n        \"\"\"Run the jobs.\n\n        postfunc() will be invoked after the jobs has run. It will be\n        invoked even if the jobs are interrupted by a keyboard\n        interrupt (well, in fact by a signal such as either SIGINT,\n        SIGTERM or SIGHUP). The execution of postfunc() is protected\n        against keyboard interrupts and is guaranteed to run to\n        completion.\"\"\"\n        self._setup_sig_handler()\n        try:\n            self.job.start()\n        finally:\n            postfunc()\n            self._reset_sig_handler()\n\n    def were_interrupted(self):\n        \"\"\"Returns whether the jobs were interrupted by a signal.\"\"\"\n        return self.job.interrupted()\n\n    def _setup_sig_handler(self):\n        \"\"\"Setup an interrupt handler so that SCons can shutdown cleanly in\n        various conditions:\n\n          a) SIGINT: Keyboard interrupt\n          b) SIGTERM: kill or system shutdown\n          c) SIGHUP: Controlling shell exiting\n\n        We handle all of these cases by stopping the taskmaster. It\n        turns out that it's very difficult to stop the build process\n        by throwing asynchronously an exception such as\n        KeyboardInterrupt. For example, the python Condition\n        variables (threading.Condition) and queues do not seem to be\n        asynchronous-exception-safe. It would require adding a whole\n        bunch of try/finally block and except KeyboardInterrupt all\n        over the place.\n\n        Note also that we have to be careful to handle the case when\n        SCons forks before executing another process. In that case, we\n        want the child to exit immediately.\n        \"\"\"\n        def handler(signum, stack, self=self, parentpid=os.getpid()):\n            if os.getpid() == parentpid:\n                self.job.taskmaster.stop()\n                self.job.interrupted.set()\n            else:\n                os._exit(2)  # pylint: disable=protected-access\n\n        self.old_sigint  = signal.signal(signal.SIGINT, handler)\n        self.old_sigterm = signal.signal(signal.SIGTERM, handler)\n        try:\n            self.old_sighup = signal.signal(signal.SIGHUP, handler)\n        except AttributeError:\n            pass\n        if (self.old_sigint is None) or (self.old_sigterm is None) or \\\n                (hasattr(self, \"old_sighup\") and self.old_sighup is None):\n            msg = \"Overwritting previous signal handler which was not installed from Python. \" + \\\n                \"Will not be able to reinstate and so will return to default handler.\"\n            SCons.Warnings.warn(SCons.Warnings.SConsWarning, msg)\n\n    def _reset_sig_handler(self):\n        \"\"\"Restore the signal handlers to their previous state (before the\n         call to _setup_sig_handler().\"\"\"\n        sigint_to_use = self.old_sigint if self.old_sigint is not None else signal.SIG_DFL\n        sigterm_to_use = self.old_sigterm if self.old_sigterm is not None else signal.SIG_DFL\n        signal.signal(signal.SIGINT, sigint_to_use)\n        signal.signal(signal.SIGTERM, sigterm_to_use)\n        try:\n            sigterm_to_use = self.old_sighup if self.old_sighup is not None else signal.SIG_DFL\n            signal.signal(signal.SIGHUP, sigterm_to_use)\n        except AttributeError:\n            pass\n\nclass Serial:\n    \"\"\"This class is used to execute tasks in series, and is more efficient\n    than Parallel, but is only appropriate for non-parallel builds. Only\n    one instance of this class should be in existence at a time.\n\n    This class is not thread safe.\n    \"\"\"\n\n    def __init__(self, taskmaster):\n        \"\"\"Create a new serial job given a taskmaster.\n\n        The taskmaster's next_task() method should return the next task\n        that needs to be executed, or None if there are no more tasks. The\n        taskmaster's executed() method will be called for each task when it\n        is successfully executed, or failed() will be called if it failed to\n        execute (e.g. execute() raised an exception).\"\"\"\n\n        self.taskmaster = taskmaster\n        self.interrupted = InterruptState()\n\n    def start(self):\n        \"\"\"Start the job. This will begin pulling tasks from the taskmaster\n        and executing them, and return when there are no more tasks. If a task\n        fails to execute (i.e. execute() raises an exception), then the job will\n        stop.\"\"\"\n\n        while True:\n            task = self.taskmaster.next_task()\n\n            if task is None:\n                break\n\n            try:\n                task.prepare()\n                if task.needs_execute():\n                    task.execute()\n            except Exception:\n                if self.interrupted():\n                    try:\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    except:\n                        task.exception_set()\n                else:\n                    task.exception_set()\n\n                # Let the failed() callback function arrange for the\n                # build to stop if that's appropriate.\n                task.failed()\n            else:\n                task.executed()\n\n            task.postprocess()\n        self.taskmaster.cleanup()\n\n\n# Trap import failure so that everything in the Job module but the\n# Parallel class (and its dependent classes) will work if the interpreter\n# doesn't support threads.\ntry:\n    import queue\n    import threading\nexcept ImportError:\n    pass\nelse:\n    class Worker(threading.Thread):\n        \"\"\"A worker thread waits on a task to be posted to its request queue,\n        dequeues the task, executes it, and posts a tuple including the task\n        and a boolean indicating whether the task executed successfully. \"\"\"\n\n        def __init__(self, requestQueue, resultsQueue, interrupted):\n            threading.Thread.__init__(self)\n            self.daemon = True\n            self.requestQueue = requestQueue\n            self.resultsQueue = resultsQueue\n            self.interrupted = interrupted\n            self.start()\n\n        def run(self):\n            while True:\n                task = self.requestQueue.get()\n\n                if task is None:\n                    # The \"None\" value is used as a sentinel by\n                    # ThreadPool.cleanup().  This indicates that there\n                    # are no more tasks, so we should quit.\n                    break\n\n                try:\n                    if self.interrupted():\n                        raise SCons.Errors.BuildError(\n                            task.targets[0], errstr=interrupt_msg)\n                    task.execute()\n                except:\n                    task.exception_set()\n                    ok = False\n                else:\n                    ok = True\n\n                self.resultsQueue.put((task, ok))\n\n    class ThreadPool:\n        \"\"\"This class is responsible for spawning and managing worker threads.\"\"\"\n\n        def __init__(self, num, stack_size, interrupted):\n            \"\"\"Create the request and reply queues, and 'num' worker threads.\n\n            One must specify the stack size of the worker threads. The\n            stack size is specified in kilobytes.\n            \"\"\"\n            self.requestQueue = queue.Queue(0)\n            self.resultsQueue = queue.Queue(0)\n\n            try:\n                prev_size = threading.stack_size(stack_size*1024)\n            except AttributeError as e:\n                # Only print a warning if the stack size has been\n                # explicitly set.\n                if explicit_stack_size is not None:\n                    msg = \"Setting stack size is unsupported by this version of Python:\\n    \" + \\\n                        e.args[0]\n                    SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n            except ValueError as e:\n                msg = \"Setting stack size failed:\\n    \" + str(e)\n                SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)\n\n            # Create worker threads\n            self.workers = []\n            for _ in range(num):\n                worker = Worker(self.requestQueue, self.resultsQueue, interrupted)\n                self.workers.append(worker)\n\n            if 'prev_size' in locals():\n                threading.stack_size(prev_size)\n\n        def put(self, task):\n            \"\"\"Put task into request queue.\"\"\"\n            self.requestQueue.put(task)\n\n        def get(self):\n            \"\"\"Remove and return a result tuple from the results queue.\"\"\"\n            return self.resultsQueue.get()\n\n        def preparation_failed(self, task):\n            self.resultsQueue.put((task, False))\n\n        def cleanup(self):\n            \"\"\"\n            Shuts down the thread pool, giving each worker thread a\n            chance to shut down gracefully.\n            \"\"\"\n            # For each worker thread, put a sentinel \"None\" value\n            # on the requestQueue (indicating that there's no work\n            # to be done) so that each worker thread will get one and\n            # terminate gracefully.\n            for _ in self.workers:\n                self.requestQueue.put(None)\n\n            # Wait for all of the workers to terminate.\n            #\n            # If we don't do this, later Python versions (2.4, 2.5) often\n            # seem to raise exceptions during shutdown.  This happens\n            # in requestQueue.get(), as an assertion failure that\n            # requestQueue.not_full is notified while not acquired,\n            # seemingly because the main thread has shut down (or is\n            # in the process of doing so) while the workers are still\n            # trying to pull sentinels off the requestQueue.\n            #\n            # Normally these terminations should happen fairly quickly,\n            # but we'll stick a one-second timeout on here just in case\n            # someone gets hung.\n            for worker in self.workers:\n                worker.join(1.0)\n            self.workers = []\n\n    class Parallel:\n        \"\"\"This class is used to execute tasks in parallel, and is somewhat\n        less efficient than Serial, but is appropriate for parallel builds.\n\n        This class is thread safe.\n        \"\"\"\n\n        def __init__(self, taskmaster, num, stack_size):\n            \"\"\"Create a new parallel job given a taskmaster.\n\n            The taskmaster's next_task() method should return the next\n            task that needs to be executed, or None if there are no more\n            tasks. The taskmaster's executed() method will be called\n            for each task when it is successfully executed, or failed()\n            will be called if the task failed to execute (i.e. execute()\n            raised an exception).\n\n            Note: calls to taskmaster are serialized, but calls to\n            execute() on distinct tasks are not serialized, because\n            that is the whole point of parallel jobs: they can execute\n            multiple tasks simultaneously. \"\"\"\n\n            self.taskmaster = taskmaster\n            self.interrupted = InterruptState()\n            self.tp = ThreadPool(num, stack_size, self.interrupted)\n\n            self.maxjobs = num\n\n        def start(self):\n            \"\"\"Start the job. This will begin pulling tasks from the\n            taskmaster and executing them, and return when there are no\n            more tasks. If a task fails to execute (i.e. execute() raises\n            an exception), then the job will stop.\"\"\"\n\n            jobs = 0\n\n            while True:\n                # Start up as many available tasks as we're\n                # allowed to.\n                while jobs < self.maxjobs:\n                    task = self.taskmaster.next_task()\n                    if task is None:\n                        break\n\n                    try:\n                        # prepare task for execution\n                        task.prepare()\n                    except:\n                        task.exception_set()\n                        task.failed()\n                        task.postprocess()\n                    else:\n                        if task.needs_execute():\n                            # dispatch task\n                            self.tp.put(task)\n                            jobs += 1\n                        else:\n                            task.executed()\n                            task.postprocess()\n\n                if not task and not jobs: break\n\n                # Let any/all completed tasks finish up before we go\n                # back and put the next batch of tasks on the queue.\n                while True:\n                    task, ok = self.tp.get()\n                    jobs -= 1\n\n                    if ok:\n                        task.executed()\n                    else:\n                        if self.interrupted():\n                            try:\n                                raise SCons.Errors.BuildError(\n                                    task.targets[0], errstr=interrupt_msg)\n                            except:\n                                task.exception_set()\n\n                        # Let the failed() callback function arrange\n                        # for the build to stop if that's appropriate.\n                        task.failed()\n\n                    task.postprocess()\n\n                    if self.tp.resultsQueue.empty():\n                        break\n\n            self.tp.cleanup()\n            self.taskmaster.cleanup()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Decorator-based memoizer to count caching stats.\n\nA decorator-based implementation to count hits and misses of the computed\nvalues that various methods cache in memory.\n\nUse of this modules assumes that wrapped methods be coded to cache their\nvalues in a consistent way. In particular, it requires that the class uses a\ndictionary named \"_memo\" to store the cached values.\n\nHere is an example of wrapping a method that returns a computed value,\nwith no input parameters::\n\n    @SCons.Memoize.CountMethodCall\n    def foo(self):\n\n        try:                                                    # Memoization\n            return self._memo['foo']                            # Memoization\n        except KeyError:                                        # Memoization\n            pass                                                # Memoization\n\n        result = self.compute_foo_value()\n\n        self._memo['foo'] = result                              # Memoization\n\n        return result\n\nHere is an example of wrapping a method that will return different values\nbased on one or more input arguments::\n\n    def _bar_key(self, argument):                               # Memoization\n        return argument                                         # Memoization\n\n    @SCons.Memoize.CountDictCall(_bar_key)\n    def bar(self, argument):\n\n        memo_key = argument                                     # Memoization\n        try:                                                    # Memoization\n            memo_dict = self._memo['bar']                       # Memoization\n        except KeyError:                                        # Memoization\n            memo_dict = {}                                      # Memoization\n            self._memo['dict'] = memo_dict                      # Memoization\n        else:                                                   # Memoization\n            try:                                                # Memoization\n                return memo_dict[memo_key]                      # Memoization\n            except KeyError:                                    # Memoization\n                pass                                            # Memoization\n\n        result = self.compute_bar_value(argument)\n\n        memo_dict[memo_key] = result                            # Memoization\n\n        return result\n\nDeciding what to cache is tricky, because different configurations\ncan have radically different performance tradeoffs, and because the\ntradeoffs involved are often so non-obvious.  Consequently, deciding\nwhether or not to cache a given method will likely be more of an art than\na science, but should still be based on available data from this module.\nHere are some VERY GENERAL guidelines about deciding whether or not to\ncache return values from a method that's being called a lot:\n\n    --  The first question to ask is, \"Can we change the calling code\n        so this method isn't called so often?\"  Sometimes this can be\n        done by changing the algorithm.  Sometimes the *caller* should\n        be memoized, not the method you're looking at.\n\n    --  The memoized function should be timed with multiple configurations\n        to make sure it doesn't inadvertently slow down some other\n        configuration.\n\n    --  When memoizing values based on a dictionary key composed of\n        input arguments, you don't need to use all of the arguments\n        if some of them don't affect the return values.\n\n\"\"\"\n\n# A flag controlling whether or not we actually use memoization.\nuse_memoizer = None\n\n# Global list of counter objects\nCounterList = {}\n\nclass Counter:\n    \"\"\"\n    Base class for counting memoization hits and misses.\n\n    We expect that the initialization in a matching decorator will\n    fill in the correct class name and method name that represents\n    the name of the function being counted.\n    \"\"\"\n    def __init__(self, cls_name, method_name):\n        \"\"\"\n        \"\"\"\n        self.cls_name = cls_name\n        self.method_name = method_name\n        self.hit = 0\n        self.miss = 0\n    def key(self):\n        return self.cls_name+'.'+self.method_name\n    def display(self):\n        print(\"    {:7d} hits {:7d} misses    {}()\".format(self.hit, self.miss, self.key()))\n    def __eq__(self, other):\n        try:\n            return self.key() == other.key()\n        except AttributeError:\n            return True\n\nclass CountValue(Counter):\n    \"\"\"\n    A counter class for simple, atomic memoized values.\n\n    A CountValue object should be instantiated in a decorator for each of\n    the class's methods that memoizes its return value by simply storing\n    the return value in its _memo dictionary.\n    \"\"\"\n    def count(self, *args, **kw):\n        \"\"\" Counts whether the memoized value has already been\n            set (a hit) or not (a miss).\n        \"\"\"\n        obj = args[0]\n        if self.method_name in obj._memo:\n            self.hit = self.hit + 1\n        else:\n            self.miss = self.miss + 1\n\nclass CountDict(Counter):\n    \"\"\"\n    A counter class for memoized values stored in a dictionary, with\n    keys based on the method's input arguments.\n\n    A CountDict object is instantiated in a decorator for each of the\n    class's methods that memoizes its return value in a dictionary,\n    indexed by some key that can be computed from one or more of\n    its input arguments.\n    \"\"\"\n    def __init__(self, cls_name, method_name, keymaker):\n        \"\"\"\n        \"\"\"\n        Counter.__init__(self, cls_name, method_name)\n        self.keymaker = keymaker\n    def count(self, *args, **kw):\n        \"\"\" Counts whether the computed key value is already present\n           in the memoization dictionary (a hit) or not (a miss).\n        \"\"\"\n        obj = args[0]\n        try:\n            memo_dict = obj._memo[self.method_name]\n        except KeyError:\n            self.miss = self.miss + 1\n        else:\n            key = self.keymaker(*args, **kw)\n            if key in memo_dict:\n                self.hit = self.hit + 1\n            else:\n                self.miss = self.miss + 1\n\ndef Dump(title=None):\n    \"\"\" Dump the hit/miss count for all the counters\n        collected so far.\n    \"\"\"\n    if title:\n        print(title)\n    for counter in sorted(CounterList):\n        CounterList[counter].display()\n\ndef EnableMemoization():\n    global use_memoizer\n    use_memoizer = 1\n\ndef CountMethodCall(fn):\n    \"\"\" Decorator for counting memoizer hits/misses while retrieving\n        a simple value in a class method. It wraps the given method\n        fn and uses a CountValue object to keep track of the\n        caching statistics.\n        Wrapping gets enabled by calling EnableMemoization().\n    \"\"\"\n    if use_memoizer:\n        def wrapper(self, *args, **kwargs):\n            global CounterList\n            key = self.__class__.__name__+'.'+fn.__name__\n            if key not in CounterList:\n                CounterList[key] = CountValue(self.__class__.__name__, fn.__name__)\n            CounterList[key].count(self, *args, **kwargs)\n            return fn(self, *args, **kwargs)\n        wrapper.__name__= fn.__name__\n        return wrapper\n    else:\n        return fn\n\ndef CountDictCall(keyfunc):\n    \"\"\" Decorator for counting memoizer hits/misses while accessing\n        dictionary values with a key-generating function. Like\n        CountMethodCall above, it wraps the given method\n        fn and uses a CountDict object to keep track of the\n        caching statistics. The dict-key function keyfunc has to\n        get passed in the decorator call and gets stored in the\n        CountDict instance.\n        Wrapping gets enabled by calling EnableMemoization().\n    \"\"\"\n    def decorator(fn):\n        if use_memoizer:\n            def wrapper(self, *args, **kwargs):\n                global CounterList\n                key = self.__class__.__name__+'.'+fn.__name__\n                if key not in CounterList:\n                    CounterList[key] = CountDict(self.__class__.__name__, fn.__name__, keyfunc)\n                CounterList[key].count(self, *args, **kwargs)\n                return fn(self, *args, **kwargs)\n            wrapper.__name__= fn.__name__\n            return wrapper\n        else:\n            return fn\n    return decorator\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Alias nodes.\n\nThis creates a hash of global Aliases (dummy targets).\n\"\"\"\n\nimport collections\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Util\nfrom SCons.Util import hash_signature\n\nclass AliasNameSpace(collections.UserDict):\n    def Alias(self, name, **kw):\n        if isinstance(name, SCons.Node.Alias.Alias):\n            return name\n        try:\n            a = self[name]\n        except KeyError:\n            a = SCons.Node.Alias.Alias(name, **kw)\n            self[name] = a\n        return a\n\n    def lookup(self, name, **kw):\n        try:\n            return self[name]\n        except KeyError:\n            return None\n\nclass AliasNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig',)\n    current_version_id = 2\n    field_list = ['csig']\n    def str_to_node(self, s):\n        return default_ans.Alias(s)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n          \n\nclass AliasBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\nclass Alias(SCons.Node.Node):\n\n    NodeInfo = AliasNodeInfo\n    BuildInfo = AliasBuildInfo\n\n    def __init__(self, name):\n        SCons.Node.Node.__init__(self)\n        self.name = name\n        self.changed_since_last_build = 1\n        self.store_info = 0\n        \n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def __str__(self):\n        return self.name\n\n    def make_ready(self):\n        self.get_csig()\n\n    really_build = SCons.Node.Node.build\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Alias nodes get built regardless of\n        # what directory scons was run from. Alias nodes\n        # are outside the filesystem:\n        return 1\n\n    def get_contents(self):\n        \"\"\"The contents of an alias is the concatenation\n        of the content signatures of all its sources.\"\"\"\n        childsigs = [n.get_csig() for n in self.children()]\n        return ''.join(childsigs)\n\n    def sconsign(self):\n        \"\"\"An Alias is not recorded in .sconsign files\"\"\"\n        pass\n\n    #\n    #\n    #\n\n    def build(self):\n        \"\"\"A \"builder\" for aliases.\"\"\"\n        pass\n\n    def convert(self):\n        try: del self.builder\n        except AttributeError: pass\n        self.reset_executor()\n        self.build = self.really_build\n\n    def get_csig(self):\n        \"\"\"\n        Generate a node's content signature, the digested signature\n        of its content.\n\n        node - the node\n        cache - alternate node to use for the signature cache\n        returns - the content signature\n        \"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n\n        contents = self.get_contents()\n        csig = hash_signature(contents)\n        self.get_ninfo().csig = csig\n        return csig\n\ndefault_ans = AliasNameSpace()\n\nSCons.Node.arg2nodes_lookups.append(default_ans.lookup)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"File system nodes.\n\nThese Nodes represent the canonical external objects that people think\nof when they think of building software: files and directories.\n\nThis holds a \"default_fs\" variable that should be initialized with an FS\nthat can be used by scripts or modules looking for the canonical default.\n\"\"\"\n\nimport codecs\nimport fnmatch\nimport importlib.util\nimport os\nimport re\nimport shutil\nimport stat\nimport sys\nimport time\nfrom itertools import chain\nfrom typing import Optional\n\nimport SCons.Action\nimport SCons.Debug\nimport SCons.Errors\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Subst\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Debug import logInstanceCreation, Trace\nfrom SCons.Util import hash_signature, hash_file_signature, hash_collect\n\nprint_duplicate = 0\n\nMD5_TIMESTAMP_DEBUG = False\n\n\ndef sconsign_none(node):\n    raise NotImplementedError\n\ndef sconsign_dir(node):\n    \"\"\"Return the .sconsign file info for this directory,\n    creating it first if necessary.\"\"\"\n    if not node._sconsign:\n        import SCons.SConsign\n        node._sconsign = SCons.SConsign.ForDirectory(node)\n    return node._sconsign\n\n_sconsign_map = {0 : sconsign_none,\n                 1 : sconsign_dir}\n\nclass FileBuildInfoFileToCsigMappingError(Exception):\n    pass\n\nclass EntryProxyAttributeError(AttributeError):\n    \"\"\"\n    An AttributeError subclass for recording and displaying the name\n    of the underlying Entry involved in an AttributeError exception.\n    \"\"\"\n    def __init__(self, entry_proxy, attribute):\n        AttributeError.__init__(self)\n        self.entry_proxy = entry_proxy\n        self.attribute = attribute\n    def __str__(self):\n        entry = self.entry_proxy.get()\n        fmt = \"%s instance %s has no attribute %s\"\n        return fmt % (entry.__class__.__name__,\n                      repr(entry.name),\n                      repr(self.attribute))\n\n# The max_drift value:  by default, use a cached signature value for\n# any file that's been untouched for more than two days.\ndefault_max_drift = 2*24*60*60\n\n#\n# We stringify these file system Nodes a lot.  Turning a file system Node\n# into a string is non-trivial, because the final string representation\n# can depend on a lot of factors:  whether it's a derived target or not,\n# whether it's linked to a repository or source directory, and whether\n# there's duplication going on.  The normal technique for optimizing\n# calculations like this is to memoize (cache) the string value, so you\n# only have to do the calculation once.\n#\n# A number of the above factors, however, can be set after we've already\n# been asked to return a string for a Node, because a Repository() or\n# VariantDir() call or the like may not occur until later in SConscript\n# files.  So this variable controls whether we bother trying to save\n# string values for Nodes.  The wrapper interface can set this whenever\n# they're done mucking with Repository and VariantDir and the other stuff,\n# to let this module know it can start returning saved string values\n# for Nodes.\n#\nSave_Strings = None\n\ndef save_strings(val):\n    global Save_Strings\n    Save_Strings = val\n\n#\n# Avoid unnecessary function calls by recording a Boolean value that\n# tells us whether or not os.path.splitdrive() actually does anything\n# on this system, and therefore whether we need to bother calling it\n# when looking up path names in various methods below.\n#\n\ndo_splitdrive = None\n_my_splitdrive =None\n\ndef initialize_do_splitdrive():\n    global do_splitdrive\n    global has_unc\n    drive, path = os.path.splitdrive('X:/foo')\n    # splitunc is removed from python 3.7 and newer\n    # so we can also just test if splitdrive works with UNC\n    has_unc = (hasattr(os.path, 'splitunc')\n        or os.path.splitdrive(r'\\\\split\\drive\\test')[0] == r'\\\\split\\drive')\n\n    do_splitdrive = not not drive or has_unc\n\n    global _my_splitdrive\n    if has_unc:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            if p[0:2] == '//':\n                # Note that we leave a leading slash in the path\n                # because UNC paths are always absolute.\n                return '//', p[1:]\n            return '', p\n    else:\n        def splitdrive(p):\n            if p[1:2] == ':':\n                return p[:2], p[2:]\n            return '', p\n    _my_splitdrive = splitdrive\n\n    # Keep some commonly used values in global variables to skip to\n    # module look-up costs.\n    global OS_SEP\n    global UNC_PREFIX\n    global os_sep_is_slash\n\n    OS_SEP = os.sep\n    UNC_PREFIX = OS_SEP + OS_SEP\n    os_sep_is_slash = OS_SEP == '/'\n\ninitialize_do_splitdrive()\n\n# Used to avoid invoking os.path.normpath if not necessary.\nneeds_normpath_check = re.compile(\n    r'''\n      # We need to renormalize the path if it contains any consecutive\n      # '/' characters.\n      .*// |\n\n      # We need to renormalize the path if it contains a '..' directory.\n      # Note that we check for all the following cases:\n      #\n      #    a) The path is a single '..'\n      #    b) The path starts with '..'. E.g. '../' or '../moredirs'\n      #       but we not match '..abc/'.\n      #    c) The path ends with '..'. E.g. '/..' or 'dirs/..'\n      #    d) The path contains a '..' in the middle.\n      #       E.g. dirs/../moredirs\n\n      (.*/)?\\.\\.(?:/|$) |\n\n      # We need to renormalize the path if it contains a '.'\n      # directory, but NOT if it is a single '.'  '/' characters. We\n      # do not want to match a single '.' because this case is checked\n      # for explicitly since this is common enough case.\n      #\n      # Note that we check for all the following cases:\n      #\n      #    a) We don't match a single '.'\n      #    b) We match if the path starts with '.'. E.g. './' or\n      #       './moredirs' but we not match '.abc/'.\n      #    c) We match if the path ends with '.'. E.g. '/.' or\n      #    'dirs/.'\n      #    d) We match if the path contains a '.' in the middle.\n      #       E.g. dirs/./moredirs\n\n      \\./|.*/\\.(?:/|$)\n\n    ''',\n    re.VERBOSE\n    )\nneeds_normpath_match = needs_normpath_check.match\n\n#\n# SCons.Action objects for interacting with the outside world.\n#\n# The Node.FS methods in this module should use these actions to\n# create and/or remove files and directories; they should *not* use\n# os.{link,symlink,unlink,mkdir}(), etc., directly.\n#\n# Using these SCons.Action objects ensures that descriptions of these\n# external activities are properly displayed, that the displays are\n# suppressed when the -s (silent) option is used, and (most importantly)\n# the actions are disabled when the the -n option is used, in which case\n# there should be *no* changes to the external file system(s)...\n#\n\n# For Now disable hard & softlinks for win32\n# PY3 supports them, but the rest of SCons is not ready for this\n# in some cases user permissions may be required.\n# TODO: See if theres a reasonable way to enable using links on win32/64\n\nif hasattr(os, 'link') and sys.platform != 'win32':\n    def _hardlink_func(fs, src, dst):\n        # If the source is a symlink, we can't just hard-link to it\n        # because a relative symlink may point somewhere completely\n        # different.  We must disambiguate the symlink and then\n        # hard-link the final destination file.\n        while fs.islink(src):\n            link = fs.readlink(src)\n            if not os.path.isabs(link):\n                src = link\n            else:\n                src = os.path.join(os.path.dirname(src), link)\n        fs.link(src, dst)\nelse:\n    _hardlink_func = None\n\nif hasattr(os, 'symlink') and sys.platform != 'win32':\n    def _softlink_func(fs, src, dst):\n        fs.symlink(src, dst)\nelse:\n    _softlink_func = None\n\ndef _copy_func(fs, src, dest):\n    shutil.copy2(src, dest)\n    st = fs.stat(src)\n    fs.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n\nValid_Duplicates = ['hard-soft-copy', 'soft-hard-copy',\n                    'hard-copy', 'soft-copy', 'copy']\n\nLink_Funcs = [] # contains the callables of the specified duplication style\n\ndef set_duplicate(duplicate):\n    # Fill in the Link_Funcs list according to the argument\n    # (discarding those not available on the platform).\n\n    # Set up the dictionary that maps the argument names to the\n    # underlying implementations.  We do this inside this function,\n    # not in the top-level module code, so that we can remap os.link\n    # and os.symlink for testing purposes.\n    link_dict = {\n        'hard' : _hardlink_func,\n        'soft' : _softlink_func,\n        'copy' : _copy_func\n    }\n\n    if duplicate not in Valid_Duplicates:\n        raise SCons.Errors.InternalError(\"The argument of set_duplicate \"\n                                           \"should be in Valid_Duplicates\")\n    global Link_Funcs\n    Link_Funcs = []\n    for func in duplicate.split('-'):\n        if link_dict[func]:\n            Link_Funcs.append(link_dict[func])\n\ndef LinkFunc(target, source, env):\n    \"\"\"\n    Relative paths cause problems with symbolic links, so\n    we use absolute paths, which may be a problem for people\n    who want to move their soft-linked src-trees around. Those\n    people should use the 'hard-copy' mode, softlinks cannot be\n    used for that; at least I have no idea how ...\n    \"\"\"\n    src = source[0].get_abspath()\n    dest = target[0].get_abspath()\n    dir, file = os.path.split(dest)\n    if dir and not target[0].fs.isdir(dir):\n        os.makedirs(dir)\n    if not Link_Funcs:\n        # Set a default order of link functions.\n        set_duplicate('hard-soft-copy')\n    fs = source[0].fs\n    # Now link the files with the previously specified order.\n    for func in Link_Funcs:\n        try:\n            func(fs, src, dest)\n            break\n        except (IOError, OSError):\n            # An OSError indicates something happened like a permissions\n            # problem or an attempt to symlink across file-system\n            # boundaries.  An IOError indicates something like the file\n            # not existing.  In either case, keeping trying additional\n            # functions in the list and only raise an error if the last\n            # one failed.\n            if func == Link_Funcs[-1]:\n                # exception of the last link method (copy) are fatal\n                raise\n    return 0\n\nLink = SCons.Action.Action(LinkFunc, None)\ndef LocalString(target, source, env):\n    return 'Local copy of %s from %s' % (target[0], source[0])\n\nLocalCopy = SCons.Action.Action(LinkFunc, LocalString)\n\ndef UnlinkFunc(target, source, env):\n    t = target[0]\n    t.fs.unlink(t.get_abspath())\n    return 0\n\nUnlink = SCons.Action.Action(UnlinkFunc, None)\n\ndef MkdirFunc(target, source, env):\n    t = target[0]\n    # This os.path.exists test looks redundant, but it's possible\n    # when using Install() to install multiple dirs outside the\n    # source tree to get a case where t.exists() is true but\n    # the path does already exist, so this prevents spurious\n    # build failures in that case. See test/Install/multi-dir.\n    if not t.exists() and not os.path.exists(t.get_abspath()):\n        t.fs.mkdir(t.get_abspath())\n    return 0\n\nMkdir = SCons.Action.Action(MkdirFunc, None, presub=None)\n\nMkdirBuilder = None\n\ndef get_MkdirBuilder():\n    global MkdirBuilder\n    if MkdirBuilder is None:\n        import SCons.Builder\n        import SCons.Defaults\n        # \"env\" will get filled in by Executor.get_build_env()\n        # calling SCons.Defaults.DefaultEnvironment() when necessary.\n        MkdirBuilder = SCons.Builder.Builder(action = Mkdir,\n                                             env = None,\n                                             explain = None,\n                                             is_explicit = None,\n                                             target_scanner = SCons.Defaults.DirEntryScanner,\n                                             name = \"MkdirBuilder\")\n    return MkdirBuilder\n\nclass _Null:\n    pass\n\n_null = _Null()\n\n# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.\n_is_cygwin = sys.platform == \"cygwin\"\nif os.path.normcase(\"TeSt\") == os.path.normpath(\"TeSt\") and not _is_cygwin:\n    def _my_normcase(x):\n        return x\nelse:\n    def _my_normcase(x):\n        return x.upper()\n\n\n\nclass DiskChecker:\n    def __init__(self, type, do, ignore):\n        self.type = type\n        self.do = do\n        self.ignore = ignore\n        self.func = do\n    def __call__(self, *args, **kw):\n        return self.func(*args, **kw)\n    def set(self, list):\n        if self.type in list:\n            self.func = self.do\n        else:\n            self.func = self.ignore\n\ndef do_diskcheck_match(node, predicate, errorfmt):\n    result = predicate()\n    try:\n        # If calling the predicate() cached a None value from stat(),\n        # remove it so it doesn't interfere with later attempts to\n        # build this Node as we walk the DAG.  (This isn't a great way\n        # to do this, we're reaching into an interface that doesn't\n        # really belong to us, but it's all about performance, so\n        # for now we'll just document the dependency...)\n        if node._memo['stat'] is None:\n            del node._memo['stat']\n    except (AttributeError, KeyError):\n        pass\n    if result:\n        raise TypeError(errorfmt % node.get_abspath())\n\ndef ignore_diskcheck_match(node, predicate, errorfmt):\n    pass\n\n\n\ndiskcheck_match = DiskChecker('match', do_diskcheck_match, ignore_diskcheck_match)\n\ndiskcheckers = [\n    diskcheck_match,\n]\n\ndef set_diskcheck(list):\n    for dc in diskcheckers:\n        dc.set(list)\n\ndef diskcheck_types():\n    return [dc.type for dc in diskcheckers]\n\n\n\nclass EntryProxy(SCons.Util.Proxy):\n\n    __str__ = SCons.Util.Delegate('__str__')\n\n    # In PY3 if a class defines __eq__, then it must explicitly provide\n    # __hash__.  Since SCons.Util.Proxy provides __eq__ we need the following\n    # see: https://docs.python.org/3/reference/datamodel.html#object.__hash__\n    __hash__ = SCons.Util.Delegate('__hash__')\n\n    def __get_abspath(self):\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(),\n                                             entry.name + \"_abspath\")\n\n    def __get_relpath(self):\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(entry.get_relpath(),\n                                             entry.name + \"_relpath\")\n\n    def __get_filebase(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[0],\n                                             name + \"_filebase\")\n\n    def __get_suffix(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[1],\n                                             name + \"_suffix\")\n\n    def __get_file(self):\n        name = self.get().name\n        return SCons.Subst.SpecialAttrWrapper(name, name + \"_file\")\n\n    def __get_base_path(self):\n        \"\"\"Return the file's directory and file name, with the\n        suffix stripped.\"\"\"\n        entry = self.get()\n        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],\n                                             entry.name + \"_base\")\n\n    def __get_posix_path(self):\n        \"\"\"Return the path with / as the path separator,\n        regardless of platform.\"\"\"\n        if os_sep_is_slash:\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '/')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_posix\")\n\n    def __get_windows_path(self):\n        r\"\"\"Return the path with \\ as the path separator,\n        regardless of platform.\"\"\"\n        if OS_SEP == '\\\\':\n            return self\n        else:\n            entry = self.get()\n            r = entry.get_path().replace(OS_SEP, '\\\\')\n            return SCons.Subst.SpecialAttrWrapper(r, entry.name + \"_windows\")\n\n    def __get_srcnode(self):\n        return EntryProxy(self.get().srcnode())\n\n    def __get_srcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().dir)\n\n    def __get_rsrcnode(self):\n        return EntryProxy(self.get().srcnode().rfile())\n\n    def __get_rsrcdir(self):\n        \"\"\"Returns the directory containing the source node linked to this\n        node via VariantDir(), or the directory of this node if not linked.\"\"\"\n        return EntryProxy(self.get().srcnode().rfile().dir)\n\n    def __get_dir(self):\n        return EntryProxy(self.get().dir)\n\n    dictSpecialAttrs = { \"base\"     : __get_base_path,\n                         \"posix\"    : __get_posix_path,\n                         \"windows\"  : __get_windows_path,\n                         \"win32\"    : __get_windows_path,\n                         \"srcpath\"  : __get_srcnode,\n                         \"srcdir\"   : __get_srcdir,\n                         \"dir\"      : __get_dir,\n                         \"abspath\"  : __get_abspath,\n                         \"relpath\"  : __get_relpath,\n                         \"filebase\" : __get_filebase,\n                         \"suffix\"   : __get_suffix,\n                         \"file\"     : __get_file,\n                         \"rsrcpath\" : __get_rsrcnode,\n                         \"rsrcdir\"  : __get_rsrcdir,\n                       }\n\n    def __getattr__(self, name):\n        # This is how we implement the \"special\" attributes\n        # such as base, posix, srcdir, etc.\n        try:\n            attr_function = self.dictSpecialAttrs[name]\n        except KeyError:\n            try:\n                attr = SCons.Util.Proxy.__getattr__(self, name)\n            except AttributeError:\n                # Raise our own AttributeError subclass with an\n                # overridden __str__() method that identifies the\n                # name of the entry that caused the exception.\n                raise EntryProxyAttributeError(self, name)\n            return attr\n        else:\n            return attr_function(self)\n\n\nclass Base(SCons.Node.Node):\n    \"\"\"A generic class for file system entries.  This class is for\n    when we don't know yet whether the entry being looked up is a file\n    or a directory.  Instances of this class can morph into either\n    Dir or File objects by a later, more precise lookup.\n\n    Note: this class does not define __cmp__ and __hash__ for\n    efficiency reasons.  SCons does a lot of comparing of\n    Node.FS.{Base,Entry,File,Dir} objects, so those operations must be\n    as fast as possible, which means we want to use Python's built-in\n    object identity comparisons.\n    \"\"\"\n\n    __slots__ = ['name',\n                 'fs',\n                 '_abspath',\n                 '_labspath',\n                 '_path',\n                 '_tpath',\n                 '_path_elements',\n                 'dir',\n                 'cwd',\n                 'duplicate',\n                 '_local',\n                 'sbuilder',\n                 '_proxy',\n                 '_func_sconsign']\n\n    def __init__(self, name, directory, fs):\n        \"\"\"Initialize a generic Node.FS.Base object.\n\n        Call the superclass initialization, take care of setting up\n        our relative and absolute paths, identify our parent\n        directory, and indicate that this node should use\n        signatures.\"\"\"\n\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')\n        SCons.Node.Node.__init__(self)\n\n        # Filenames and paths are probably reused and are intern'ed to save some memory.\n        # Filename with extension as it was specified when the object was\n        # created; to obtain filesystem path, use Python str() function\n        self.name = SCons.Util.silent_intern(name)\n        self.fs = fs #: Reference to parent Node.FS object\n\n        assert directory, \"A directory must be provided\"\n\n        self._abspath = None\n        self._labspath = None\n        self._path = None\n        self._tpath = None\n        self._path_elements = None\n\n        self.dir = directory\n        self.cwd = None # will hold the SConscript directory for target nodes\n        self.duplicate = directory.duplicate\n        self.changed_since_last_build = 2\n        self._func_sconsign = 0\n        self._func_exists = 2\n        self._func_rexists = 2\n        self._func_get_contents = 0\n        self._func_target_from_source = 1\n        self.store_info = 1\n\n    def str_for_display(self):\n        return '\"' + self.__str__() + '\"'\n\n    def must_be_same(self, klass):\n        \"\"\"\n        This node, which already existed, is being looked up as the\n        specified klass.  Raise an exception if it isn't.\n        \"\"\"\n        if isinstance(self, klass) or klass is Entry:\n            return\n        raise TypeError(\"Tried to lookup %s '%s' as a %s.\" %\\\n              (self.__class__.__name__, self.get_internal_path(), klass.__name__))\n\n    def get_dir(self):\n        return self.dir\n\n    def get_suffix(self):\n        return SCons.Util.splitext(self.name)[1]\n\n    def rfile(self):\n        return self\n\n    def __getattr__(self, attr):\n        \"\"\" Together with the node_bwcomp dict defined below,\n            this method provides a simple backward compatibility\n            layer for the Node attributes 'abspath', 'labspath',\n            'path', 'tpath', 'suffix' and 'path_elements'. These Node\n            attributes used to be directly available in v2.3 and earlier, but\n            have been replaced by getter methods that initialize the\n            single variables lazily when required, in order to save memory.\n            The redirection to the getters lets older Tools and\n            SConstruct continue to work without any additional changes,\n            fully transparent to the user.\n            Note, that __getattr__ is only called as fallback when the\n            requested attribute can't be found, so there should be no\n            speed performance penalty involved for standard builds.\n        \"\"\"\n        if attr in node_bwcomp:\n            return node_bwcomp[attr](self)\n\n        raise AttributeError(\"%r object has no attribute %r\" %\n                         (self.__class__, attr))\n\n    def __str__(self):\n        \"\"\"A Node.FS.Base object's string representation is its path\n        name.\"\"\"\n        global Save_Strings\n        if Save_Strings:\n            return self._save_str()\n        return self._get_str()\n\n    def __lt__(self, other):\n        \"\"\" less than operator used by sorting on py3\"\"\"\n        return str(self) < str(other)\n\n    @SCons.Memoize.CountMethodCall\n    def _save_str(self):\n        try:\n            return self._memo['_save_str']\n        except KeyError:\n            pass\n        result = SCons.Util.silent_intern(self._get_str())\n        self._memo['_save_str'] = result\n        return result\n\n    def _get_str(self):\n        global Save_Strings\n        if self.duplicate or self.is_derived():\n            return self.get_path()\n        srcnode = self.srcnode()\n        if srcnode.stat() is None and self.stat() is not None:\n            result = self.get_path()\n        else:\n            result = srcnode.get_path()\n        if not Save_Strings:\n            # We're not at the point where we're saving the string\n            # representations of FS Nodes (because we haven't finished\n            # reading the SConscript files and need to have str() return\n            # things relative to them).  That also means we can't yet\n            # cache values returned (or not returned) by stat(), since\n            # Python code in the SConscript files might still create\n            # or otherwise affect the on-disk file.  So get rid of the\n            # values that the underlying stat() method saved.\n            try: del self._memo['stat']\n            except KeyError: pass\n            if self is not srcnode:\n                try: del srcnode._memo['stat']\n                except KeyError: pass\n        return result\n\n    rstr = __str__\n\n    @SCons.Memoize.CountMethodCall\n    def stat(self):\n        try:\n            return self._memo['stat']\n        except KeyError:\n            pass\n        try:\n            result = self.fs.stat(self.get_abspath())\n        except os.error:\n            result = None\n\n        self._memo['stat'] = result\n        return result\n\n    @SCons.Memoize.CountMethodCall\n    def lstat(self):\n        try:\n            return self._memo['lstat']\n        except KeyError:\n            pass\n        try:\n            result = self.fs.lstat(self.get_abspath())\n        except os.error:\n            result = None\n\n        self._memo['lstat'] = result\n        return result\n\n    def exists(self):\n        return SCons.Node._exists_map[self._func_exists](self)\n\n    def rexists(self):\n        return SCons.Node._rexists_map[self._func_rexists](self)\n\n    def getmtime(self):\n        if self.islink():\n            st = self.lstat()\n        else:\n            st = self.stat()\n\n        if st:\n            return st[stat.ST_MTIME]\n        else:\n            return None\n\n    def getsize(self):\n        if self.islink():\n            st = self.lstat()\n        else:\n            st = self.stat()\n\n        if st:\n            return st[stat.ST_SIZE]\n        else:\n            return None\n\n    def isdir(self):\n        st = self.stat()\n        return st is not None and stat.S_ISDIR(st[stat.ST_MODE])\n\n    def isfile(self):\n        st = self.stat()\n        return st is not None and stat.S_ISREG(st[stat.ST_MODE])\n\n    if hasattr(os, 'symlink'):\n        def islink(self):\n            st = self.lstat()\n            return st is not None and stat.S_ISLNK(st[stat.ST_MODE])\n    else:\n        def islink(self):\n            return False                    # no symlinks\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return self.dir.is_under(dir)\n\n    def set_local(self):\n        self._local = 1\n\n    def srcnode(self):\n        \"\"\"If this node is in a build path, return the node\n        corresponding to its source file.  Otherwise, return\n        ourself.\n        \"\"\"\n        srcdir_list = self.dir.srcdir_list()\n        if srcdir_list:\n            srcnode = srcdir_list[0].Entry(self.name)\n            srcnode.must_be_same(self.__class__)\n            return srcnode\n        return self\n\n    def get_path(self, dir=None):\n        \"\"\"Return path relative to the current working directory of the\n        Node.FS.Base object that owns us.\"\"\"\n        if not dir:\n            dir = self.fs.getcwd()\n        if self == dir:\n            return '.'\n        path_elems = self.get_path_elements()\n        pathname = ''\n        try: i = path_elems.index(dir)\n        except ValueError:\n            for p in path_elems[:-1]:\n                pathname += p.dirname\n        else:\n            for p in path_elems[i+1:-1]:\n                pathname += p.dirname\n        return pathname + path_elems[-1].name\n\n    def set_src_builder(self, builder):\n        \"\"\"Set the source code builder for this node.\"\"\"\n        self.sbuilder = builder\n        if not self.has_builder():\n            self.builder_set(builder)\n\n    def src_builder(self):\n        \"\"\"Fetch the source code builder for this node.\n\n        If there isn't one, we cache the source code builder specified\n        for the directory (which in turn will cache the value from its\n        parent directory, and so on up to the file system root).\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.dir.src_builder()\n            self.sbuilder = scb\n        return scb\n\n    def get_abspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self.dir.entry_abspath(self.name)\n\n    def get_labspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self.dir.entry_labspath(self.name)\n\n    def get_relpath(self):\n        \"\"\"Get the path of the file relative to the root SConstruct file's directory.\"\"\"\n        return os.path.relpath(self.dir.entry_abspath(self.name), self.fs.SConstruct_dir.get_abspath())\n\n    def get_internal_path(self):\n        if self.dir._path == '.':\n            return self.name\n        else:\n            return self.dir.entry_path(self.name)\n\n    def get_tpath(self):\n        if self.dir._tpath == '.':\n            return self.name\n        else:\n            return self.dir.entry_tpath(self.name)\n\n    def get_path_elements(self):\n        return self.dir._path_elements + [self]\n\n    def for_signature(self):\n        # Return just our name.  Even an absolute path would not work,\n        # because that can change thanks to symlinks or remapped network\n        # paths.\n        return self.name\n\n    def get_subst_proxy(self):\n        try:\n            return self._proxy\n        except AttributeError:\n            ret = EntryProxy(self)\n            self._proxy = ret\n            return ret\n\n    def target_from_source(self, prefix, suffix, splitext=SCons.Util.splitext):\n        \"\"\"\n\n        Generates a target entry that corresponds to this entry (usually\n        a source file) with the specified prefix and suffix.\n\n        Note that this method can be overridden dynamically for generated\n        files that need different behavior.  See Tool/swig.py for\n        an example.\n        \"\"\"\n        return SCons.Node._target_from_source_map[self._func_target_from_source](self, prefix, suffix, splitext)\n\n    def _Rfindalldirs_key(self, pathlist):\n        return pathlist\n\n    @SCons.Memoize.CountDictCall(_Rfindalldirs_key)\n    def Rfindalldirs(self, pathlist):\n        \"\"\"\n        Return all of the directories for a given path list, including\n        corresponding \"backing\" directories in any repositories.\n\n        The Node lookups are relative to this Node (typically a\n        directory), so memoizing result saves cycles from looking\n        up the same path for each target in a given directory.\n        \"\"\"\n        try:\n            memo_dict = self._memo['Rfindalldirs']\n        except KeyError:\n            memo_dict = {}\n            self._memo['Rfindalldirs'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        create_dir_relative_to_self = self.Dir\n        result = []\n        for path in pathlist:\n            if isinstance(path, SCons.Node.Node):\n                result.append(path)\n            else:\n                dir = create_dir_relative_to_self(path)\n                result.extend(dir.get_all_rdirs())\n\n        memo_dict[pathlist] = result\n\n        return result\n\n    def RDirs(self, pathlist):\n        \"\"\"Search for a list of directories in the Repository list.\"\"\"\n        cwd = self.cwd or self.fs._cwd\n        return cwd.Rfindalldirs(pathlist)\n\n    @SCons.Memoize.CountMethodCall\n    def rentry(self):\n        try:\n            return self._memo['rentry']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try:\n                    node = dir.entries[norm_name]\n                except KeyError:\n                    if dir.entry_exists_on_disk(self.name):\n                        result = dir.Entry(self.name)\n                        break\n        self._memo['rentry'] = result\n        return result\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return []\n\n# Dict that provides a simple backward compatibility\n# layer for the Node attributes 'abspath', 'labspath',\n# 'relpath', 'path', 'tpath' and 'path_elements'.\n# @see Base.__getattr__ above\nnode_bwcomp = {'abspath' : Base.get_abspath,\n               'labspath' : Base.get_labspath,\n               'relpath' : Base.get_relpath,\n               'path' : Base.get_internal_path,\n               'tpath' : Base.get_tpath,\n               'path_elements' : Base.get_path_elements,\n               'suffix' : Base.get_suffix}\n\nclass Entry(Base):\n    \"\"\"This is the class for generic Node.FS entries--that is, things\n    that could be a File or a Dir, but we're just not sure yet.\n    Consequently, the methods in this class really exist just to\n    transform their associated object into the right class when the\n    time comes, and then call the same-named method in the transformed\n    class.\"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    def __init__(self, name, directory, fs):\n        Base.__init__(self, name, directory, fs)\n        self._func_exists = 3\n        self._func_get_contents = 1\n\n    def diskcheck_match(self):\n        pass\n\n    def disambiguate(self, must_exist=None):\n        \"\"\"\n        \"\"\"\n        if self.isfile():\n            self.__class__ = File\n            self._morph()\n            self.clear()\n        elif self.isdir():\n            self.__class__ = Dir\n            self._morph()\n        else:\n            # There was nothing on-disk at this location, so look in\n            # the src directory.\n            #\n            # We can't just use self.srcnode() straight away because\n            # that would create an actual Node for this file in the src\n            # directory, and there might not be one.  Instead, use the\n            # dir_on_disk() method to see if there's something on-disk\n            # with that name, in which case we can go ahead and call\n            # self.srcnode() to create the right type of entry.\n            srcdir = self.dir.srcnode()\n            if srcdir != self.dir and \\\n               srcdir.entry_exists_on_disk(self.name) and \\\n               self.srcnode().isdir():\n                self.__class__ = Dir\n                self._morph()\n            elif must_exist:\n                msg = \"No such file or directory: '%s'\" % self.get_abspath()\n                raise SCons.Errors.UserError(msg)\n            else:\n                self.__class__ = File\n                self._morph()\n                self.clear()\n        return self\n\n    def rfile(self):\n        \"\"\"We're a generic Entry, but the caller is actually looking for\n        a File at this point, so morph into one.\"\"\"\n        self.__class__ = File\n        self._morph()\n        self.clear()\n        return File.rfile(self)\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self):\n        \"\"\"Fetch the contents of the entry.  Returns the exact binary\n        contents of the file.\"\"\"\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_text_contents(self):\n        \"\"\"Fetch the decoded text contents of a Unicode encoded Entry.\n\n        Since this should return the text contents from the file\n        system, we check to see into what sort of subclass we should\n        morph this Entry.\"\"\"\n        try:\n            self = self.disambiguate(must_exist=1)\n        except SCons.Errors.UserError:\n            # There was nothing on disk with which to disambiguate\n            # this entry.  Leave it as an Entry, but return a null\n            # string so calls to get_text_contents() in emitters and\n            # the like (e.g. in qt.py) don't have to disambiguate by\n            # hand or catch the exception.\n            return ''\n        else:\n            return self.get_text_contents()\n\n    def must_be_same(self, klass):\n        \"\"\"Called to make sure a Node is a Dir.  Since we're an\n        Entry, we can morph into one.\"\"\"\n        if self.__class__ is not klass:\n            self.__class__ = klass\n            self._morph()\n            self.clear()\n\n    # The following methods can get called before the Taskmaster has\n    # had a chance to call disambiguate() directly to see if this Entry\n    # should really be a Dir or a File.  We therefore use these to call\n    # disambiguate() transparently (from our caller's point of view).\n    #\n    # Right now, this minimal set of methods has been derived by just\n    # looking at some of the methods that will obviously be called early\n    # in any of the various Taskmasters' calling sequences, and then\n    # empirically figuring out which additional methods are necessary\n    # to make various tests pass.\n\n    def exists(self):\n        return SCons.Node._exists_map[self._func_exists](self)\n\n    def rel_path(self, other):\n        d = self.disambiguate()\n        if d.__class__ is Entry:\n            raise Exception(\"rel_path() could not disambiguate File/Dir\")\n        return d.rel_path(other)\n\n    def new_ninfo(self):\n        return self.disambiguate().new_ninfo()\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        return self.disambiguate()._glob1(pattern, ondisk, source, strings)\n\n    def get_subst_proxy(self):\n        return self.disambiguate().get_subst_proxy()\n\n# This is for later so we can differentiate between Entry the class and Entry\n# the method of the FS class.\n_classEntry = Entry\n\n\nclass LocalFS:\n    \"\"\"\n    This class implements an abstraction layer for operations involving\n    a local file system.  Essentially, this wraps any function in\n    the os, os.path or shutil modules that we use to actually go do\n    anything with or to the local file system.\n\n    Note that there's a very good chance we'll refactor this part of\n    the architecture in some way as we really implement the interface(s)\n    for remote file system Nodes.  For example, the right architecture\n    might be to have this be a subclass instead of a base class.\n    Nevertheless, we're using this as a first step in that direction.\n\n    We're not using chdir() yet because the calling subclass method\n    needs to use os.chdir() directly to avoid recursion.  Will we\n    really need this one?\n    \"\"\"\n\n    def chmod(self, path, mode):\n        return os.chmod(path, mode)\n\n    def copy(self, src, dst):\n        return shutil.copy(src, dst)\n\n    def copy2(self, src, dst):\n        return shutil.copy2(src, dst)\n\n    def exists(self, path):\n        return os.path.exists(path)\n\n    def getmtime(self, path):\n        return os.path.getmtime(path)\n\n    def getsize(self, path):\n        return os.path.getsize(path)\n\n    def isdir(self, path):\n        return os.path.isdir(path)\n\n    def isfile(self, path):\n        return os.path.isfile(path)\n\n    def link(self, src, dst):\n        return os.link(src, dst)\n\n    def lstat(self, path):\n        return os.lstat(path)\n\n    def listdir(self, path):\n        return os.listdir(path)\n\n    def scandir(self, path):\n        return os.scandir(path)\n\n    def makedirs(self, path, mode=0o777, exist_ok=False):\n        return os.makedirs(path, mode=mode, exist_ok=exist_ok)\n\n    def mkdir(self, path, mode=0o777):\n        return os.mkdir(path, mode=mode)\n\n    def rename(self, old, new):\n        return os.rename(old, new)\n\n    def stat(self, path):\n        return os.stat(path)\n\n    def symlink(self, src, dst):\n        return os.symlink(src, dst)\n\n    def open(self, path):\n        return open(path)\n\n    def unlink(self, path):\n        return os.unlink(path)\n\n    if hasattr(os, 'symlink'):\n\n        def islink(self, path):\n            return os.path.islink(path)\n\n    else:\n\n        def islink(self, path):\n            return False  # no symlinks\n\n    if hasattr(os, 'readlink'):\n\n        def readlink(self, file):\n            return os.readlink(file)\n\n    else:\n\n        def readlink(self, file):\n            return ''\n\n\nclass FS(LocalFS):\n\n    def __init__(self, path = None):\n        \"\"\"Initialize the Node.FS subsystem.\n\n        The supplied path is the top of the source tree, where we\n        expect to find the top-level build file.  If no path is\n        supplied, the current directory is the default.\n\n        The path argument must be a valid absolute path.\n        \"\"\"\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS')\n\n        self._memo = {}\n\n        self.Root = {}\n        self.SConstruct_dir = None\n        self.max_drift = default_max_drift\n\n        self.Top = None\n        if path is None:\n            self.pathTop = os.getcwd()\n        else:\n            self.pathTop = path\n        self.defaultDrive = _my_normcase(_my_splitdrive(self.pathTop)[0])\n\n        self.Top = self.Dir(self.pathTop)\n        self.Top._path = '.'\n        self.Top._tpath = '.'\n        self._cwd = self.Top\n\n        DirNodeInfo.fs = self\n        FileNodeInfo.fs = self\n\n    def set_SConstruct_dir(self, dir):\n        self.SConstruct_dir = dir\n\n    def get_max_drift(self):\n        return self.max_drift\n\n    def set_max_drift(self, max_drift):\n        self.max_drift = max_drift\n\n    def getcwd(self):\n        if hasattr(self, \"_cwd\"):\n            return self._cwd\n        else:\n            return \"<no cwd>\"\n\n    def chdir(self, dir, change_os_dir=0):\n        \"\"\"Change the current working directory for lookups.\n        If change_os_dir is true, we will also change the \"real\" cwd\n        to match.\n        \"\"\"\n        curr=self._cwd\n        try:\n            if dir is not None:\n                self._cwd = dir\n                if change_os_dir:\n                    os.chdir(dir.get_abspath())\n        except OSError:\n            self._cwd = curr\n            raise\n\n    def get_root(self, drive):\n        \"\"\"\n        Returns the root directory for the specified drive, creating\n        it if necessary.\n        \"\"\"\n        drive = _my_normcase(drive)\n        try:\n            return self.Root[drive]\n        except KeyError:\n            root = RootDir(drive, self)\n            self.Root[drive] = root\n            if not drive:\n                self.Root[self.defaultDrive] = root\n            elif drive == self.defaultDrive:\n                self.Root[''] = root\n            return root\n\n    def _lookup(self, p, directory, fsclass, create=1):\n        \"\"\"\n        The generic entry point for Node lookup with user-supplied data.\n\n        This translates arbitrary input into a canonical Node.FS object\n        of the specified fsclass.  The general approach for strings is\n        to turn it into a fully normalized absolute path and then call\n        the root directory's lookup_abs() method for the heavy lifting.\n\n        If the path name begins with '#', it is unconditionally\n        interpreted relative to the top-level directory of this FS.  '#'\n        is treated as a synonym for the top-level SConstruct directory,\n        much like '~' is treated as a synonym for the user's home\n        directory in a UNIX shell.  So both '#foo' and '#/foo' refer\n        to the 'foo' subdirectory underneath the top-level SConstruct\n        directory.\n\n        If the path name is relative, then the path is looked up relative\n        to the specified directory, or the current directory (self._cwd,\n        typically the SConscript directory) if the specified directory\n        is None.\n        \"\"\"\n        if isinstance(p, Base):\n            # It's already a Node.FS object.  Make sure it's the right\n            # class and return.\n            p.must_be_same(fsclass)\n            return p\n        # str(p) in case it's something like a proxy object\n        p = str(p)\n\n        if not os_sep_is_slash:\n            p = p.replace(OS_SEP, '/')\n\n        if p[0:1] == '#':\n            # There was an initial '#', so we strip it and override\n            # whatever directory they may have specified with the\n            # top-level SConstruct directory.\n            p = p[1:]\n            directory = self.Top\n\n            # There might be a drive letter following the\n            # '#'. Although it is not described in the SCons man page,\n            # the regression test suite explicitly tests for that\n            # syntax. It seems to mean the following thing:\n            #\n            #   Assuming the the SCons top dir is in C:/xxx/yyy,\n            #   '#X:/toto' means X:/xxx/yyy/toto.\n            #\n            # i.e. it assumes that the X: drive has a directory\n            # structure similar to the one found on drive C:.\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n            else:\n                root = directory.root\n\n            # We can only strip trailing after splitting the drive\n            # since the drive might the UNC '//' prefix.\n            p = p.strip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            # The path is relative to the top-level SCons directory.\n            if p in ('', '.'):\n                p = directory.get_labspath()\n            else:\n                p = directory.get_labspath() + '/' + p\n        else:\n            if do_splitdrive:\n                drive, p = _my_splitdrive(p)\n                if drive and not p:\n                    # This causes a naked drive letter to be treated\n                    # as a synonym for the root directory on that\n                    # drive.\n                    p = '/'\n            else:\n                drive = ''\n\n            # We can only strip trailing '/' since the drive might the\n            # UNC '//' prefix.\n            if p != '/':\n                p = p.rstrip('/')\n\n            needs_normpath = needs_normpath_match(p)\n\n            if p[0:1] == '/':\n                # Absolute path\n                root = self.get_root(drive)\n            else:\n                # This is a relative lookup or to the current directory\n                # (the path name is not absolute).  Add the string to the\n                # appropriate directory lookup path, after which the whole\n                # thing gets normalized.\n                if directory:\n                    if not isinstance(directory, Dir):\n                        directory = self.Dir(directory)\n                else:\n                    directory = self._cwd\n\n                if p in ('', '.'):\n                    p = directory.get_labspath()\n                else:\n                    p = directory.get_labspath() + '/' + p\n\n                if drive:\n                    root = self.get_root(drive)\n                else:\n                    root = directory.root\n\n        if needs_normpath is not None:\n            # Normalize a pathname. Will return the same result for\n            # equivalent paths.\n            #\n            # We take advantage of the fact that we have an absolute\n            # path here for sure. In addition, we know that the\n            # components of lookup path are separated by slashes at\n            # this point. Because of this, this code is about 2X\n            # faster than calling os.path.normpath() followed by\n            # replacing os.sep with '/' again.\n            ins = p.split('/')[1:]\n            outs = []\n            for d in ins:\n                if d == '..':\n                    try:\n                        outs.pop()\n                    except IndexError:\n                        pass\n                elif d not in ('', '.'):\n                    outs.append(d)\n            p = '/' + '/'.join(outs)\n\n        return root._lookup_abs(p, fsclass, create)\n\n    def Entry(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a generic Entry node with the specified name.\n        If the name is a relative path (begins with ./, ../, or a file\n        name), then it is looked up relative to the supplied directory\n        node, or to the top level directory of the FS (supplied at\n        construction time) if no directory is supplied.\n        \"\"\"\n        return self._lookup(name, directory, Entry, create)\n\n    def File(self, name, directory = None, create = 1):\n        \"\"\"Look up or create a File node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a directory is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, File, create)\n\n    def Dir(self, name, directory = None, create = True):\n        \"\"\"Look up or create a Dir node with the specified name.  If\n        the name is a relative path (begins with ./, ../, or a file name),\n        then it is looked up relative to the supplied directory node,\n        or to the top level directory of the FS (supplied at construction\n        time) if no directory is supplied.\n\n        This method will raise TypeError if a normal file is found at the\n        specified path.\n        \"\"\"\n        return self._lookup(name, directory, Dir, create)\n\n    def VariantDir(self, variant_dir, src_dir, duplicate=1):\n        \"\"\"Link the supplied variant directory to the source directory\n        for purposes of building files.\"\"\"\n\n        if not isinstance(src_dir, SCons.Node.Node):\n            src_dir = self.Dir(src_dir)\n        if not isinstance(variant_dir, SCons.Node.Node):\n            variant_dir = self.Dir(variant_dir)\n        if src_dir.is_under(variant_dir):\n            raise SCons.Errors.UserError(\"Source directory cannot be under variant directory.\")\n        if variant_dir.srcdir:\n            if variant_dir.srcdir == src_dir:\n                return # We already did this.\n            raise SCons.Errors.UserError(\"'%s' already has a source directory: '%s'.\"%(variant_dir, variant_dir.srcdir))\n        variant_dir.link(src_dir, duplicate)\n\n    def Repository(self, *dirs):\n        \"\"\"Specify Repository directories to search.\"\"\"\n        for d in dirs:\n            if not isinstance(d, SCons.Node.Node):\n                d = self.Dir(d)\n            self.Top.addRepository(d)\n\n    def PyPackageDir(self, modulename):\n        r\"\"\"Locate the directory of a given python module name\n\n        For example scons might resolve to\n        Windows: C:\\Python27\\Lib\\site-packages\\scons-2.5.1\n        Linux: /usr/lib/scons\n\n        This can be useful when we want to determine a toolpath based on a python module name\"\"\"\n\n        dirpath = ''\n\n        # Python3 Code\n        modspec = importlib.util.find_spec(modulename)\n        dirpath = os.path.dirname(modspec.origin)\n        return self._lookup(dirpath, None, Dir, True)\n\n\n    def variant_dir_target_climb(self, orig, dir, tail):\n        \"\"\"Create targets in corresponding variant directories\n\n        Climb the directory tree, and look up path names\n        relative to any linked variant directories we find.\n\n        Even though this loops and walks up the tree, we don't memoize\n        the return value because this is really only used to process\n        the command-line targets.\n        \"\"\"\n        targets = []\n        message = None\n        fmt = \"building associated VariantDir targets: %s\"\n        start_dir = dir\n        while dir:\n            for bd in dir.variant_dirs:\n                if start_dir.is_under(bd):\n                    # If already in the build-dir location, don't reflect\n                    return [orig], fmt % str(orig)\n                p = os.path.join(bd._path, *tail)\n                targets.append(self.Entry(p))\n            tail = [dir.name] + tail\n            dir = dir.up()\n        if targets:\n            message = fmt % ' '.join(map(str, targets))\n        return targets, message\n\n    def Glob(self, pathname, ondisk=True, source=True, strings=False, exclude=None, cwd=None):\n        \"\"\"\n        Globs\n\n        This is mainly a shim layer\n        \"\"\"\n        if cwd is None:\n            cwd = self.getcwd()\n        return cwd.glob(pathname, ondisk, source, strings, exclude)\n\nclass DirNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ()\n    # This should get reset by the FS initialization.\n    current_version_id = 2\n\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.get_labspath() + '/' + s\n        return root._lookup_abs(s, Entry)\n\nclass DirBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\nglob_magic_check = re.compile('[*?[]')\n\ndef has_glob_magic(s):\n    return glob_magic_check.search(s) is not None\n\nclass Dir(Base):\n    \"\"\"A class for directories in a file system.\n    \"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    NodeInfo = DirNodeInfo\n    BuildInfo = DirBuildInfo\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def _morph(self):\n        \"\"\"Turn a file system Node (either a freshly initialized directory\n        object or a separate Entry object) into a proper directory object.\n\n        Set up this directory's entries and hook it into the file\n        system tree.  Specify that directories (this Node) don't use\n        signatures for calculating whether they're current.\n        \"\"\"\n\n        self.repositories = []\n        self.srcdir = None\n\n        self.entries = {'.': self, '..': self.dir}\n        self.cwd = self\n        self.searched = 0\n        self._sconsign = None\n        self.variant_dirs = []\n        self.root = self.dir.root\n        self.changed_since_last_build = 3\n        self._func_sconsign = 1\n        self._func_exists = 2\n        self._func_get_contents = 2\n\n        self._abspath = SCons.Util.silent_intern(self.dir.entry_abspath(self.name))\n        self._labspath = SCons.Util.silent_intern(self.dir.entry_labspath(self.name))\n        if self.dir._path == '.':\n            self._path = SCons.Util.silent_intern(self.name)\n        else:\n            self._path = SCons.Util.silent_intern(self.dir.entry_path(self.name))\n        if self.dir._tpath == '.':\n            self._tpath = SCons.Util.silent_intern(self.name)\n        else:\n            self._tpath = SCons.Util.silent_intern(self.dir.entry_tpath(self.name))\n        self._path_elements = self.dir._path_elements + [self]\n\n        # For directories, we make a difference between the directory\n        # 'name' and the directory 'dirname'. The 'name' attribute is\n        # used when we need to print the 'name' of the directory or\n        # when we it is used as the last part of a path. The 'dirname'\n        # is used when the directory is not the last element of the\n        # path. The main reason for making that distinction is that\n        # for RoorDir's the dirname can not be easily inferred from\n        # the name. For example, we have to add a '/' after a drive\n        # letter but not after a UNC path prefix ('//').\n        self.dirname = self.name + OS_SEP\n\n        # Don't just reset the executor, replace its action list,\n        # because it might have some pre-or post-actions that need to\n        # be preserved.\n        #\n        # But don't reset the executor if there is a non-null executor\n        # attached already. The existing executor might have other\n        # targets, in which case replacing the action list with a\n        # Mkdir action is a big mistake.\n        if not hasattr(self, 'executor'):\n            self.builder = get_MkdirBuilder()\n            self.get_executor().set_action_list(self.builder.action)\n        else:\n            # Prepend MkdirBuilder action to existing action list\n            l = self.get_executor().action_list\n            a = get_MkdirBuilder().action\n            l.insert(0, a)\n            self.get_executor().set_action_list(l)\n\n    def diskcheck_match(self):\n        diskcheck_match(self, self.isfile,\n                        \"File %s found where directory expected.\")\n\n    def __clearRepositoryCache(self, duplicate=None):\n        \"\"\"Called when we change the repository(ies) for a directory.\n        This clears any cached information that is invalidated by changing\n        the repository.\"\"\"\n\n        for node in self.entries.values():\n            if node != self.dir:\n                if node != self and isinstance(node, Dir):\n                    node.__clearRepositoryCache(duplicate)\n                else:\n                    node.clear()\n                    try:\n                        del node._srcreps\n                    except AttributeError:\n                        pass\n                    if duplicate is not None:\n                        node.duplicate = duplicate\n\n    def __resetDuplicate(self, node):\n        if node != self:\n            node.duplicate = node.get_dir().duplicate\n\n    def Entry(self, name):\n        \"\"\"\n        Looks up or creates an entry node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Entry(name, self)\n\n    def Dir(self, name, create=True):\n        \"\"\"\n        Looks up or creates a directory node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.Dir(name, self, create)\n\n    def File(self, name):\n        \"\"\"\n        Looks up or creates a file node named 'name' relative to\n        this directory.\n        \"\"\"\n        return self.fs.File(name, self)\n\n    def link(self, srcdir, duplicate):\n        \"\"\"Set this directory as the variant directory for the\n        supplied source directory.\"\"\"\n        self.srcdir = srcdir\n        self.duplicate = duplicate\n        self.__clearRepositoryCache(duplicate)\n        srcdir.variant_dirs.append(self)\n\n    def getRepositories(self):\n        \"\"\"Returns a list of repositories for this directory.\n        \"\"\"\n        if self.srcdir and not self.duplicate:\n            return self.srcdir.get_all_rdirs() + self.repositories\n        return self.repositories\n\n    @SCons.Memoize.CountMethodCall\n    def get_all_rdirs(self):\n        try:\n            return list(self._memo['get_all_rdirs'])\n        except KeyError:\n            pass\n\n        result = [self]\n        fname = '.'\n        dir = self\n        while dir:\n            for rep in dir.getRepositories():\n                result.append(rep.Dir(fname))\n            if fname == '.':\n                fname = dir.name\n            else:\n                fname = dir.name + OS_SEP + fname\n            dir = dir.up()\n\n        self._memo['get_all_rdirs'] = list(result)\n\n        return result\n\n    def addRepository(self, dir):\n        if dir != self and dir not in self.repositories:\n            self.repositories.append(dir)\n            dir._tpath = '.'\n            self.__clearRepositoryCache()\n\n    def up(self):\n        return self.dir\n\n    def _rel_path_key(self, other):\n        return str(other)\n\n    @SCons.Memoize.CountDictCall(_rel_path_key)\n    def rel_path(self, other):\n        \"\"\"Return a path to \"other\" relative to this directory.\n        \"\"\"\n\n        # This complicated and expensive method, which constructs relative\n        # paths between arbitrary Node.FS objects, is no longer used\n        # by SCons itself.  It was introduced to store dependency paths\n        # in .sconsign files relative to the target, but that ended up\n        # being significantly inefficient.\n        #\n        # We're continuing to support the method because some SConstruct\n        # files out there started using it when it was available, and\n        # we're all about backwards compatibility..\n\n        try:\n            memo_dict = self._memo['rel_path']\n        except KeyError:\n            memo_dict = {}\n            self._memo['rel_path'] = memo_dict\n        else:\n            try:\n                return memo_dict[other]\n            except KeyError:\n                pass\n\n        if self is other:\n            result = '.'\n\n        elif other not in self._path_elements:\n            try:\n                other_dir = other.get_dir()\n            except AttributeError:\n                result = str(other)\n            else:\n                if other_dir is None:\n                    result = other.name\n                else:\n                    dir_rel_path = self.rel_path(other_dir)\n                    if dir_rel_path == '.':\n                        result = other.name\n                    else:\n                        result = dir_rel_path + OS_SEP + other.name\n        else:\n            i = self._path_elements.index(other) + 1\n\n            path_elems = ['..'] * (len(self._path_elements) - i) \\\n                         + [n.name for n in other._path_elements[i:]]\n\n            result = OS_SEP.join(path_elems)\n\n        memo_dict[other] = result\n\n        return result\n\n    def get_env_scanner(self, env, kw={}):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_target_scanner(self):\n        import SCons.Defaults\n        return SCons.Defaults.DirEntryScanner\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return this directory's implicit dependencies.\n\n        We don't bother caching the results because the scan typically\n        shouldn't be requested more than once (as opposed to scanning\n        .h file contents, which can be requested as many times as the\n        files is #included by other files).\n        \"\"\"\n        if not scanner:\n            return []\n        # Clear cached info for this Dir.  If we already visited this\n        # directory on our walk down the tree (because we didn't know at\n        # that point it was being used as the source for another Node)\n        # then we may have calculated build signature before realizing\n        # we had to scan the disk.  Now that we have to, though, we need\n        # to invalidate the old calculated signature so that any node\n        # dependent on our directory structure gets one that includes\n        # info about everything on disk.\n        self.clear()\n        return scanner(self, env, path)\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def prepare(self):\n        pass\n\n    def build(self, **kw):\n        \"\"\"A null \"builder\" for directories.\"\"\"\n        global MkdirBuilder\n        if self.builder is not MkdirBuilder:\n            SCons.Node.Node.build(self, **kw)\n\n    #\n    #\n    #\n\n    def _create(self):\n        \"\"\"Create this directory, silently and without worrying about\n        whether the builder is the default or not.\"\"\"\n        listDirs = []\n        parent = self\n        while parent:\n            if parent.exists():\n                break\n            listDirs.append(parent)\n            p = parent.up()\n            if p is None:\n                # Don't use while: - else: for this condition because\n                # if so, then parent is None and has no .path attribute.\n                raise SCons.Errors.StopError(parent._path)\n            parent = p\n        listDirs.reverse()\n        for dirnode in listDirs:\n            try:\n                # Don't call dirnode.build(), call the base Node method\n                # directly because we definitely *must* create this\n                # directory.  The dirnode.build() method will suppress\n                # the build if it's the default builder.\n                SCons.Node.Node.build(dirnode)\n                dirnode.get_executor().nullify()\n                # The build() action may or may not have actually\n                # created the directory, depending on whether the -n\n                # option was used or not.  Delete the _exists and\n                # _rexists attributes so they can be reevaluated.\n                dirnode.clear()\n            except OSError:\n                pass\n\n    def multiple_side_effect_has_builder(self):\n        global MkdirBuilder\n        return self.builder is not MkdirBuilder and self.has_builder()\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        return self.fs.variant_dir_target_climb(self, self, [])\n\n    def scanner_key(self):\n        \"\"\"A directory does not get scanned.\"\"\"\n        return None\n\n    def get_text_contents(self):\n        \"\"\"We already emit things in text, so just return the binary\n        version.\"\"\"\n        return self.get_contents()\n\n    def get_contents(self):\n        \"\"\"Return content signatures and names of all our children\n        separated by new-lines. Ensure that the nodes are sorted.\"\"\"\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_csig(self):\n        \"\"\"Compute the content signature for Directory nodes. In\n        general, this is not needed and the content signature is not\n        stored in the DirNodeInfo. However, if get_contents on a Dir\n        node is called which has a child directory, the child\n        directory should return the hash of its contents.\"\"\"\n        contents = self.get_contents()\n        return hash_signature(contents)\n\n    def do_duplicate(self, src):\n        pass\n\n    def is_up_to_date(self):\n        \"\"\"If any child is not up-to-date, then this directory isn't,\n        either.\"\"\"\n        if self.builder is not MkdirBuilder and not self.exists():\n            return 0\n        up_to_date = SCons.Node.up_to_date\n        for kid in self.children():\n            if kid.get_state() > up_to_date:\n                return 0\n        return 1\n\n    def rdir(self):\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for dir in self.dir.get_all_rdirs():\n                try: node = dir.entries[norm_name]\n                except KeyError: node = dir.dir_on_disk(self.name)\n                if node and node.exists() and \\\n                    (isinstance(dir, Dir) or isinstance(dir, Entry)):\n                        return node\n        return self\n\n    def sconsign(self):\n        \"\"\"Return the .sconsign file info for this directory. \"\"\"\n        return _sconsign_map[self._func_sconsign](self)\n\n    def srcnode(self):\n        \"\"\"Dir has a special need for srcnode()...if we\n        have a srcdir attribute set, then that *is* our srcnode.\"\"\"\n        if self.srcdir:\n            return self.srcdir\n        return Base.srcnode(self)\n\n    def get_timestamp(self):\n        \"\"\"Return the latest timestamp from among our children\"\"\"\n        stamp = 0\n        for kid in self.children():\n            if kid.get_timestamp() > stamp:\n                stamp = kid.get_timestamp()\n        return stamp\n\n    def get_abspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self._abspath\n\n    def get_labspath(self):\n        \"\"\"Get the absolute path of the file.\"\"\"\n        return self._labspath\n\n    def get_internal_path(self):\n        return self._path\n\n    def get_tpath(self):\n        return self._tpath\n\n    def get_path_elements(self):\n        return self._path_elements\n\n    def entry_abspath(self, name):\n        return self._abspath + OS_SEP + name\n\n    def entry_labspath(self, name):\n        return self._labspath + '/' + name\n\n    def entry_path(self, name):\n        return self._path + OS_SEP + name\n\n    def entry_tpath(self, name):\n        return self._tpath + OS_SEP + name\n\n    def entry_exists_on_disk(self, name):\n        \"\"\" Searches through the file/dir entries of the current\n            directory, and returns True if a physical entry with the given\n            name could be found.\n\n            @see rentry_exists_on_disk\n        \"\"\"\n        try:\n            d = self.on_disk_entries\n        except AttributeError:\n            d = {}\n            try:\n                entries = os.listdir(self._abspath)\n            except OSError:\n                pass\n            else:\n                for entry in map(_my_normcase, entries):\n                    d[entry] = True\n            self.on_disk_entries = d\n        if sys.platform == 'win32' or sys.platform == 'cygwin':\n            name = _my_normcase(name)\n            result = d.get(name)\n            if result is None:\n                # Belt-and-suspenders for Windows:  check directly for\n                # 8.3 file names that don't show up in os.listdir().\n                result = os.path.exists(self._abspath + OS_SEP + name)\n                d[name] = result\n            return result\n        else:\n            return name in d\n\n    def rentry_exists_on_disk(self, name):\n        \"\"\" Searches through the file/dir entries of the current\n            *and* all its remote directories (repos), and returns\n            True if a physical entry with the given name could be found.\n            The local directory (self) gets searched first, so\n            repositories take a lower precedence regarding the\n            searching order.\n\n            @see entry_exists_on_disk\n        \"\"\"\n\n        rentry_exists = self.entry_exists_on_disk(name)\n        if not rentry_exists:\n            # Search through the repository folders\n            norm_name = _my_normcase(name)\n            for rdir in self.get_all_rdirs():\n                try:\n                    node = rdir.entries[norm_name]\n                    if node:\n                        rentry_exists = True\n                        break\n                except KeyError:\n                    if rdir.entry_exists_on_disk(name):\n                        rentry_exists = True\n                        break\n        return rentry_exists\n\n    @SCons.Memoize.CountMethodCall\n    def srcdir_list(self):\n        try:\n            return self._memo['srcdir_list']\n        except KeyError:\n            pass\n\n        result = []\n\n        dirname = '.'\n        dir = self\n        while dir:\n            if dir.srcdir:\n                result.append(dir.srcdir.Dir(dirname))\n            dirname = dir.name + OS_SEP + dirname\n            dir = dir.up()\n\n        self._memo['srcdir_list'] = result\n\n        return result\n\n    def srcdir_duplicate(self, name):\n        for dir in self.srcdir_list():\n            if self.is_under(dir):\n                # We shouldn't source from something in the build path;\n                # variant_dir is probably under src_dir, in which case\n                # we are reflecting.\n                break\n            if dir.entry_exists_on_disk(name):\n                srcnode = dir.Entry(name).disambiguate()\n                if self.duplicate:\n                    node = self.Entry(name).disambiguate()\n                    node.do_duplicate(srcnode)\n                    return node\n                else:\n                    return srcnode\n        return None\n\n    def _srcdir_find_file_key(self, filename):\n        return filename\n\n    @SCons.Memoize.CountDictCall(_srcdir_find_file_key)\n    def srcdir_find_file(self, filename):\n        try:\n            memo_dict = self._memo['srcdir_find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['srcdir_find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[filename]\n            except KeyError:\n                pass\n\n        def func(node):\n            if (isinstance(node, File) or isinstance(node, Entry)) and \\\n               (node.is_derived() or node.exists()):\n                    return node\n            return None\n\n        norm_name = _my_normcase(filename)\n\n        for rdir in self.get_all_rdirs():\n            try: node = rdir.entries[norm_name]\n            except KeyError: node = rdir.file_on_disk(filename)\n            else: node = func(node)\n            if node:\n                result = (node, self)\n                memo_dict[filename] = result\n                return result\n\n        for srcdir in self.srcdir_list():\n            for rdir in srcdir.get_all_rdirs():\n                try: node = rdir.entries[norm_name]\n                except KeyError: node = rdir.file_on_disk(filename)\n                else: node = func(node)\n                if node:\n                    result = (File(filename, self, self.fs), srcdir)\n                    memo_dict[filename] = result\n                    return result\n\n        result = (None, None)\n        memo_dict[filename] = result\n        return result\n\n    def dir_on_disk(self, name):\n        if self.entry_exists_on_disk(name):\n            try: return self.Dir(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, File):\n            return None\n        return node\n\n    def file_on_disk(self, name):\n        if self.entry_exists_on_disk(name):\n            try: return self.File(name)\n            except TypeError: pass\n        node = self.srcdir_duplicate(name)\n        if isinstance(node, Dir):\n            return None\n        return node\n\n    def walk(self, func, arg):\n        \"\"\"\n        Walk this directory tree by calling the specified function\n        for each directory in the tree.\n\n        This behaves like the os.path.walk() function, but for in-memory\n        Node.FS.Dir objects.  The function takes the same arguments as\n        the functions passed to os.path.walk():\n\n                func(arg, dirname, fnames)\n\n        Except that \"dirname\" will actually be the directory *Node*,\n        not the string.  The '.' and '..' entries are excluded from\n        fnames.  The fnames list may be modified in-place to filter the\n        subdirectories visited or otherwise impose a specific order.\n        The \"arg\" argument is always passed to func() and may be used\n        in any way (or ignored, passing None is common).\n        \"\"\"\n        entries = self.entries\n        names = list(entries.keys())\n        names.remove('.')\n        names.remove('..')\n        func(arg, self, names)\n        for dirname in [n for n in names if isinstance(entries[n], Dir)]:\n            entries[dirname].walk(func, arg)\n\n    def glob(self, pathname, ondisk=True, source=False, strings=False, exclude=None):\n        \"\"\"\n        Returns a list of Nodes (or strings) matching a specified\n        pathname pattern.\n\n        Pathname patterns follow UNIX shell semantics:  * matches\n        any-length strings of any characters, ? matches any character,\n        and [] can enclose lists or ranges of characters.  Matches do\n        not span directory separators.\n\n        The matches take into account Repositories, returning local\n        Nodes if a corresponding entry exists in a Repository (either\n        an in-memory Node or something on disk).\n\n        By defafult, the glob() function matches entries that exist\n        on-disk, in addition to in-memory Nodes.  Setting the \"ondisk\"\n        argument to False (or some other non-true value) causes the glob()\n        function to only match in-memory Nodes.  The default behavior is\n        to return both the on-disk and in-memory Nodes.\n\n        The \"source\" argument, when true, specifies that corresponding\n        source Nodes must be returned if you're globbing in a build\n        directory (initialized with VariantDir()).  The default behavior\n        is to return Nodes local to the VariantDir().\n\n        The \"strings\" argument, when true, returns the matches as strings,\n        not Nodes.  The strings are path names relative to this directory.\n\n        The \"exclude\" argument, if not None, must be a pattern or a list\n        of patterns following the same UNIX shell semantics.\n        Elements matching a least one pattern of this list will be excluded\n        from the result.\n\n        The underlying algorithm is adapted from the glob.glob() function\n        in the Python library (but heavily modified), and uses fnmatch()\n        under the covers.\n        \"\"\"\n        dirname, basename = os.path.split(pathname)\n        if not dirname:\n            result = self._glob1(basename, ondisk, source, strings)\n        else:\n            if has_glob_magic(dirname):\n                list = self.glob(dirname, ondisk, source, False, exclude)\n            else:\n                list = [self.Dir(dirname, create=True)]\n            result = []\n            for dir in list:\n                r = dir._glob1(basename, ondisk, source, strings)\n                if strings:\n                    r = [os.path.join(str(dir), x) for x in r]\n                result.extend(r)\n        if exclude:\n            excludes = []\n            excludeList = SCons.Util.flatten(exclude)\n            for x in excludeList:\n                r = self.glob(x, ondisk, source, strings)\n                excludes.extend(r)\n            result = [x for x in result if not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes))]\n        return sorted(result, key=lambda a: str(a))\n\n    def _glob1(self, pattern, ondisk=True, source=False, strings=False):\n        \"\"\"\n        Globs for and returns a list of entry names matching a single\n        pattern in this directory.\n\n        This searches any repositories and source directories for\n        corresponding entries and returns a Node (or string) relative\n        to the current directory if an entry is found anywhere.\n\n        TODO: handle pattern with no wildcard\n        \"\"\"\n        search_dir_list = self.get_all_rdirs()\n        for srcdir in self.srcdir_list():\n            search_dir_list.extend(srcdir.get_all_rdirs())\n\n        selfEntry = self.Entry\n        names = []\n        for dir in search_dir_list:\n            # We use the .name attribute from the Node because the keys of\n            # the dir.entries dictionary are normalized (that is, all upper\n            # case) on case-insensitive systems like Windows.\n            node_names = [ v.name for k, v in dir.entries.items()\n                           if k not in ('.', '..') ]\n            names.extend(node_names)\n            if not strings:\n                # Make sure the working directory (self) actually has\n                # entries for all Nodes in repositories or variant dirs.\n                for name in node_names: selfEntry(name)\n            if ondisk:\n                try:\n                    disk_names = os.listdir(dir._abspath)\n                except os.error:\n                    continue\n                names.extend(disk_names)\n                if not strings:\n                    # We're going to return corresponding Nodes in\n                    # the local directory, so we need to make sure\n                    # those Nodes exist.  We only want to create\n                    # Nodes for the entries that will match the\n                    # specified pattern, though, which means we\n                    # need to filter the list here, even though\n                    # the overall list will also be filtered later,\n                    # after we exit this loop.\n                    if pattern[0] != '.':\n                        disk_names = [x for x in disk_names if x[0] != '.']\n                    disk_names = fnmatch.filter(disk_names, pattern)\n                    dirEntry = dir.Entry\n                    for name in disk_names:\n                        # Add './' before disk filename so that '#' at\n                        # beginning of filename isn't interpreted.\n                        name = './' + name\n                        node = dirEntry(name).disambiguate()\n                        n = selfEntry(name)\n                        if n.__class__ != node.__class__:\n                            n.__class__ = node.__class__\n                            n._morph()\n\n        names = set(names)\n        if pattern[0] != '.':\n            names = [x for x in names if x[0] != '.']\n        names = fnmatch.filter(names, pattern)\n\n        if strings:\n            return names\n\n        return [self.entries[_my_normcase(n)] for n in names]\n\nclass RootDir(Dir):\n    \"\"\"A class for the root directory of a file system.\n\n    This is the same as a Dir class, except that the path separator\n    ('/' or '\\\\') is actually part of the name, so we don't need to\n    add a separator when creating the path names of entries within\n    this directory.\n    \"\"\"\n\n    __slots__ = ('_lookupDict', 'abspath', 'path')\n\n    def __init__(self, drive, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')\n        SCons.Node.Node.__init__(self)\n\n        # Handle all the types of drives:\n        if drive == '':\n            # No drive, regular UNIX root or Windows default drive.\n            name = OS_SEP\n            dirname = OS_SEP\n        elif drive == '//':\n            # UNC path\n            name = UNC_PREFIX\n            dirname = UNC_PREFIX\n        else:\n            # Windows drive letter\n            name = drive\n            dirname = drive + OS_SEP\n\n        # Filename with extension as it was specified when the object was\n        # created; to obtain filesystem path, use Python str() function\n        self.name = SCons.Util.silent_intern(name)\n        self.fs = fs #: Reference to parent Node.FS object\n\n        self._path_elements = [self]\n        self.dir = self\n        self._func_rexists = 2\n        self._func_target_from_source = 1\n        self.store_info = 1\n\n        # Now set our paths to what we really want them to be. The\n        # name should already contain any necessary separators, such\n        # as the initial drive letter (the name) plus the directory\n        # separator, except for the \"lookup abspath,\" which does not\n        # have the drive letter.\n        self._abspath = dirname\n        self._labspath = ''\n        self._path = dirname\n        self._tpath = dirname\n        self.dirname = dirname\n\n        # EntryProxy interferes with this class and turns drive paths on\n        # Windows such as \"C:\" into \"C:\\C:\". Avoid this problem by setting\n        # commonly-accessed attributes directly.\n        self.abspath = self._abspath\n        self.path = self._path\n\n        self._morph()\n\n        self.duplicate = 0\n        self._lookupDict = {'': self, '/': self}\n\n        self.root = self\n        # The // entry is necessary because os.path.normpath()\n        # preserves double slashes at the beginning of a path on Posix\n        # platforms.\n        if not has_unc:\n            self._lookupDict['//'] = self\n\n    def _morph(self):\n        \"\"\"Turn a file system Node (either a freshly initialized directory\n        object or a separate Entry object) into a proper directory object.\n\n        Set up this directory's entries and hook it into the file\n        system tree.  Specify that directories (this Node) don't use\n        signatures for calculating whether they're current.\n        \"\"\"\n\n        self.repositories = []\n        self.srcdir = None\n\n        self.entries = {'.': self, '..': self.dir}\n        self.cwd = self\n        self.searched = 0\n        self._sconsign = None\n        self.variant_dirs = []\n        self.changed_since_last_build = 3\n        self._func_sconsign = 1\n        self._func_exists = 2\n        self._func_get_contents = 2\n\n        # Don't just reset the executor, replace its action list,\n        # because it might have some pre-or post-actions that need to\n        # be preserved.\n        #\n        # But don't reset the executor if there is a non-null executor\n        # attached already. The existing executor might have other\n        # targets, in which case replacing the action list with a\n        # Mkdir action is a big mistake.\n        if not hasattr(self, 'executor'):\n            self.builder = get_MkdirBuilder()\n            self.get_executor().set_action_list(self.builder.action)\n        else:\n            # Prepend MkdirBuilder action to existing action list\n            l = self.get_executor().action_list\n            a = get_MkdirBuilder().action\n            l.insert(0, a)\n            self.get_executor().set_action_list(l)\n\n\n    def must_be_same(self, klass):\n        if klass is Dir:\n            return\n        Base.must_be_same(self, klass)\n\n    def _lookup_abs(self, p, klass, create=1):\n        \"\"\"\n        Fast (?) lookup of a *normalized* absolute path.\n\n        This method is intended for use by internal lookups with\n        already-normalized path data.  For general-purpose lookups,\n        use the FS.Entry(), FS.Dir() or FS.File() methods.\n\n        The caller is responsible for making sure we're passed a\n        normalized absolute path; we merely let Python's dictionary look\n        up and return the One True Node.FS object for the path.\n\n        If a Node for the specified \"p\" doesn't already exist, and\n        \"create\" is specified, the Node may be created after recursive\n        invocation to find or create the parent directory or directories.\n        \"\"\"\n        k = _my_normcase(p)\n        try:\n            result = self._lookupDict[k]\n        except KeyError:\n            if not create:\n                msg = \"No such file or directory: '%s' in '%s' (and create is False)\" % (p, str(self))\n                raise SCons.Errors.UserError(msg)\n            # There is no Node for this path name, and we're allowed\n            # to create it.\n            dir_name, file_name = p.rsplit('/',1)\n            dir_node = self._lookup_abs(dir_name, Dir)\n            result = klass(file_name, dir_node, self.fs)\n\n            # Double-check on disk (as configured) that the Node we\n            # created matches whatever is out there in the real world.\n            result.diskcheck_match()\n\n            self._lookupDict[k] = result\n            dir_node.entries[_my_normcase(file_name)] = result\n            dir_node.implicit = None\n        else:\n            # There is already a Node for this path name.  Allow it to\n            # complain if we were looking for an inappropriate type.\n            result.must_be_same(klass)\n        return result\n\n    def __str__(self):\n        return self._abspath\n\n    def entry_abspath(self, name):\n        return self._abspath + name\n\n    def entry_labspath(self, name):\n        return '/' + name\n\n    def entry_path(self, name):\n        return self._path + name\n\n    def entry_tpath(self, name):\n        return self._tpath + name\n\n    def is_under(self, dir):\n        if self is dir:\n            return 1\n        else:\n            return 0\n\n    def up(self):\n        return None\n\n    def get_dir(self):\n        return None\n\n    def src_builder(self):\n        return _null\n\n\nclass FileNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig', 'timestamp', 'size')\n    current_version_id = 2\n\n    field_list = ['csig', 'timestamp', 'size']\n\n    # This should get reset by the FS initialization.\n    fs = None\n\n    def str_to_node(self, s):\n        top = self.fs.Top\n        root = top.root\n        if do_splitdrive:\n            drive, s = _my_splitdrive(s)\n            if drive:\n                root = self.fs.get_root(drive)\n        if not os.path.isabs(s):\n            s = top.get_labspath() + '/' + s\n        return root._lookup_abs(s, Entry)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj, '__slots__', ()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n    def __eq__(self, other):\n        return self.csig == other.csig and self.timestamp == other.timestamp and self.size == other.size\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n\nclass FileBuildInfo(SCons.Node.BuildInfoBase):\n    \"\"\"\n    This is info loaded from sconsign.\n\n    Attributes unique to FileBuildInfo:\n        dependency_map : Caches file->csig mapping\n            for all dependencies.  Currently this is only used when using\n            MD5-timestamp decider.\n            It's used to ensure that we copy the correct csig from the\n            previous build to be written to .sconsign when current build\n            is done. Previously the matching of csig to file was strictly\n            by order they appeared in bdepends, bsources, or bimplicit,\n            and so a change in order or count of any of these could\n            yield writing wrong csig, and then false positive rebuilds\n    \"\"\"\n    __slots__ = ['dependency_map', ]\n    current_version_id = 2\n\n    def __setattr__(self, key, value):\n\n        # If any attributes are changed in FileBuildInfo, we need to\n        # invalidate the cached map of file name to content signature\n        # heald in dependency_map. Currently only used with\n        # MD5-timestamp decider\n        if key != 'dependency_map' and hasattr(self, 'dependency_map'):\n            del self.dependency_map\n\n        return super(FileBuildInfo, self).__setattr__(key, value)\n\n    def convert_to_sconsign(self):\n        \"\"\"\n        Converts this FileBuildInfo object for writing to a .sconsign file\n\n        This replaces each Node in our various dependency lists with its\n        usual string representation: relative to the top-level SConstruct\n        directory, or an absolute path if it's outside.\n        \"\"\"\n        if os_sep_is_slash:\n            node_to_str = str\n        else:\n            def node_to_str(n):\n                try:\n                    s = n.get_internal_path()\n                except AttributeError:\n                    s = str(n)\n                else:\n                    s = s.replace(OS_SEP, '/')\n                return s\n        for attr in ['bsources', 'bdepends', 'bimplicit']:\n            try:\n                val = getattr(self, attr)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, attr, list(map(node_to_str, val)))\n\n    def convert_from_sconsign(self, dir, name):\n        \"\"\"\n        Converts a newly-read FileBuildInfo object for in-SCons use\n\n        For normal up-to-date checking, we don't have any conversion to\n        perform--but we're leaving this method here to make that clear.\n        \"\"\"\n        pass\n\n    def prepare_dependencies(self):\n        \"\"\"\n        Prepares a FileBuildInfo object for explaining what changed\n\n        The bsources, bdepends and bimplicit lists have all been\n        stored on disk as paths relative to the top-level SConstruct\n        directory.  Convert the strings to actual Nodes (for use by the\n        --debug=explain code and --implicit-cache).\n        \"\"\"\n        attrs = [\n            ('bsources', 'bsourcesigs'),\n            ('bdepends', 'bdependsigs'),\n            ('bimplicit', 'bimplicitsigs'),\n        ]\n        for (nattr, sattr) in attrs:\n            try:\n                strings = getattr(self, nattr)\n                nodeinfos = getattr(self, sattr)\n            except AttributeError:\n                continue\n            if strings is None or nodeinfos is None:\n                continue\n            nodes = []\n            for s, ni in zip(strings, nodeinfos):\n                if not isinstance(s, SCons.Node.Node):\n                    s = ni.str_to_node(s)\n                nodes.append(s)\n            setattr(self, nattr, nodes)\n\n    def format(self, names=0):\n        result = []\n        bkids = self.bsources + self.bdepends + self.bimplicit\n        bkidsigs = self.bsourcesigs + self.bdependsigs + self.bimplicitsigs\n        for bkid, bkidsig in zip(bkids, bkidsigs):\n            result.append(str(bkid) + ': ' +\n                          ' '.join(bkidsig.format(names=names)))\n        if not hasattr(self,'bact'):\n            self.bact = \"none\"\n        result.append('%s [%s]' % (self.bactsig, self.bact))\n        return '\\n'.join(result)\n\n\nclass File(Base):\n    \"\"\"A class for files in a file system.\n    \"\"\"\n\n    __slots__ = ['scanner_paths',\n                 'cachedir_csig',\n                 'cachesig',\n                 'repositories',\n                 'srcdir',\n                 'entries',\n                 'searched',\n                 '_sconsign',\n                 'variant_dirs',\n                 'root',\n                 'dirname',\n                 'on_disk_entries',\n                 'released_target_info',\n                 'contentsig']\n\n    NodeInfo = FileNodeInfo\n    BuildInfo = FileBuildInfo\n\n    # Although the command-line argument is in kilobytes, this is in bytes.\n    hash_chunksize = 65536\n\n    def diskcheck_match(self):\n        diskcheck_match(self, self.isdir,\n                        \"Directory %s found where file expected.\")\n\n    def __init__(self, name, directory, fs):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File')\n        Base.__init__(self, name, directory, fs)\n        self._morph()\n\n    def Entry(self, name):\n        \"\"\"Create an entry node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Entry(name)\n\n    def Dir(self, name, create=True):\n        \"\"\"Create a directory node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.Dir(name, create=create)\n\n    def Dirs(self, pathlist):\n        \"\"\"Create a list of directories relative to the SConscript\n        directory of this file.\"\"\"\n        return [self.Dir(p) for p in pathlist]\n\n    def File(self, name):\n        \"\"\"Create a file node named 'name' relative to\n        the directory of this file.\"\"\"\n        return self.dir.File(name)\n\n    def _morph(self):\n        \"\"\"Turn a file system node into a File object.\"\"\"\n        self.scanner_paths = {}\n        if not hasattr(self, '_local'):\n            self._local = 0\n        if not hasattr(self, 'released_target_info'):\n            self.released_target_info = False\n\n        self.store_info = 1\n        self._func_exists = 4\n        self._func_get_contents = 3\n\n        # Initialize this Node's decider function to decide_source() because\n        # every file is a source file until it has a Builder attached...\n        self.changed_since_last_build = 4\n\n        # If there was already a Builder set on this entry, then\n        # we need to make sure we call the target-decider function,\n        # not the source-decider.  Reaching in and doing this by hand\n        # is a little bogus.  We'd prefer to handle this by adding\n        # an Entry.builder_set() method that disambiguates like the\n        # other methods, but that starts running into problems with the\n        # fragile way we initialize Dir Nodes with their Mkdir builders,\n        # yet still allow them to be overridden by the user.  Since it's\n        # not clear right now how to fix that, stick with what works\n        # until it becomes clear...\n        if self.has_builder():\n            self.changed_since_last_build = 5\n\n    def scanner_key(self):\n        return self.get_suffix()\n\n    def get_contents(self) -> bytes:\n        \"\"\"Return the contents of the file as bytes.\"\"\"\n        return SCons.Node._get_contents_map[self._func_get_contents](self)\n\n    def get_text_contents(self) -> str:\n        \"\"\"Return the contents of the file in text form.\n\n        This attempts to figure out what the encoding of the text is\n        based upon the BOM bytes, and then decodes the contents so that\n        it's a valid python string.\n        \"\"\"\n        contents = self.get_contents()\n        # The behavior of various decode() methods and functions\n        # w.r.t. the initial BOM bytes is different for different\n        # encodings and/or Python versions.  ('utf-8' does not strip\n        # them, but has a 'utf-8-sig' which does; 'utf-16' seems to\n        # strip them; etc.)  Just sidestep all the complication by\n        # explicitly stripping the BOM before we decode().\n        if contents[:len(codecs.BOM_UTF8)] == codecs.BOM_UTF8:\n            return contents[len(codecs.BOM_UTF8):].decode('utf-8')\n        if contents[:len(codecs.BOM_UTF16_LE)] == codecs.BOM_UTF16_LE:\n            return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le')\n        if contents[:len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE:\n            return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')\n        try:\n            return contents.decode('utf-8')\n        except UnicodeDecodeError as e:\n            try:\n                return contents.decode('latin-1')\n            except UnicodeDecodeError as e:\n                return contents.decode('utf-8', errors='backslashreplace')\n\n    def get_content_hash(self) -> str:\n        \"\"\"\n        Compute and return the hash for this file.\n        \"\"\"\n        if not self.rexists():\n            return hash_signature(SCons.Util.NOFILE)\n        fname = self.rfile().get_abspath()\n        try:\n            cs = hash_file_signature(fname, chunksize=File.hash_chunksize)\n        except EnvironmentError as e:\n            if not e.filename:\n                e.filename = fname\n            raise\n        return cs\n\n    @SCons.Memoize.CountMethodCall\n    def get_size(self) -> int:\n        try:\n            return self._memo['get_size']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            size = self.rfile().getsize()\n        else:\n            # sentinel value for doesn't exist, even in repository\n            size = -1\n\n        self._memo['get_size'] = size\n        return size\n\n    @SCons.Memoize.CountMethodCall\n    def get_timestamp(self) -> int:\n        try:\n            return self._memo['get_timestamp']\n        except KeyError:\n            pass\n\n        if self.rexists():\n            timestamp = self.rfile().getmtime()\n        else:\n            timestamp = 0\n\n        self._memo['get_timestamp'] = timestamp\n        return timestamp\n\n    convert_copy_attrs = [\n        'bsources',\n        'bimplicit',\n        'bdepends',\n        'bact',\n        'bactsig',\n        'ninfo',\n    ]\n\n    convert_sig_attrs = [\n        'bsourcesigs',\n        'bimplicitsigs',\n        'bdependsigs',\n    ]\n\n    def convert_old_entry(self, old_entry):\n        # Convert a .sconsign entry from before the Big Signature\n        # Refactoring, doing what we can to convert its information\n        # to the new .sconsign entry format.\n        #\n        # The old format looked essentially like this:\n        #\n        #   BuildInfo\n        #       .ninfo (NodeInfo)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bsources\n        #       .bsourcesigs (\"signature\" list)\n        #       .bdepends\n        #       .bdependsigs (\"signature\" list)\n        #       .bimplicit\n        #       .bimplicitsigs (\"signature\" list)\n        #       .bact\n        #       .bactsig\n        #\n        # The new format looks like this:\n        #\n        #   .ninfo (NodeInfo)\n        #       .bsig\n        #       .csig\n        #       .timestamp\n        #       .size\n        #   .binfo (BuildInfo)\n        #       .bsources\n        #       .bsourcesigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bdepends\n        #       .bdependsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bimplicit\n        #       .bimplicitsigs (NodeInfo list)\n        #           .bsig\n        #           .csig\n        #           .timestamp\n        #           .size\n        #       .bact\n        #       .bactsig\n        #\n        # The basic idea of the new structure is that a NodeInfo always\n        # holds all available information about the state of a given Node\n        # at a certain point in time.  The various .b*sigs lists can just\n        # be a list of pointers to the .ninfo attributes of the different\n        # dependent nodes, without any copying of information until it's\n        # time to pickle it for writing out to a .sconsign file.\n        #\n        # The complicating issue is that the *old* format only stored one\n        # \"signature\" per dependency, based on however the *last* build\n        # was configured.  We don't know from just looking at it whether\n        # it was a build signature, a content signature, or a timestamp\n        # \"signature\".  Since we no longer use build signatures, the\n        # best we can do is look at the length and if it's thirty two,\n        # assume that it was (or might have been) a content signature.\n        # If it was actually a build signature, then it will cause a\n        # rebuild anyway when it doesn't match the new content signature,\n        # but that's probably the best we can do.\n        import SCons.SConsign\n        new_entry = SCons.SConsign.SConsignEntry()\n        new_entry.binfo = self.new_binfo()\n        binfo = new_entry.binfo\n        for attr in self.convert_copy_attrs:\n            try:\n                value = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        for attr in self.convert_sig_attrs:\n            try:\n                sig_list = getattr(old_entry, attr)\n            except AttributeError:\n                continue\n            value = []\n            for sig in sig_list:\n                ninfo = self.new_ninfo()\n                if len(sig) == 32:\n                    ninfo.csig = sig\n                else:\n                    ninfo.timestamp = sig\n                value.append(ninfo)\n            setattr(binfo, attr, value)\n            delattr(old_entry, attr)\n        return new_entry\n\n    @SCons.Memoize.CountMethodCall\n    def get_stored_info(self):\n        try:\n            return self._memo['get_stored_info']\n        except KeyError:\n            pass\n\n        try:\n            sconsign_entry = self.dir.sconsign().get_entry(self.name)\n        except (KeyError, EnvironmentError):\n            import SCons.SConsign\n            sconsign_entry = SCons.SConsign.SConsignEntry()\n            sconsign_entry.binfo = self.new_binfo()\n            sconsign_entry.ninfo = self.new_ninfo()\n        else:\n            if isinstance(sconsign_entry, FileBuildInfo):\n                # This is a .sconsign file from before the Big Signature\n                # Refactoring; convert it as best we can.\n                sconsign_entry = self.convert_old_entry(sconsign_entry)\n            try:\n                delattr(sconsign_entry.ninfo, 'bsig')\n            except AttributeError:\n                pass\n\n        self._memo['get_stored_info'] = sconsign_entry\n\n        return sconsign_entry\n\n    def get_stored_implicit(self):\n        binfo = self.get_stored_info().binfo\n        binfo.prepare_dependencies()\n        try: return binfo.bimplicit\n        except AttributeError: return None\n\n    def rel_path(self, other):\n        return self.dir.rel_path(other)\n\n    def _get_found_includes_key(self, env, scanner, path):\n        return (id(env), id(scanner), path)\n\n    @SCons.Memoize.CountDictCall(_get_found_includes_key)\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the included implicit dependencies in this file.\n        Cache results so we only scan the file once per path\n        regardless of how many times this information is requested.\n        \"\"\"\n        memo_key = (id(env), id(scanner), path)\n        try:\n            memo_dict = self._memo['get_found_includes']\n        except KeyError:\n            memo_dict = {}\n            self._memo['get_found_includes'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if scanner:\n            result = [n.disambiguate() for n in scanner(self, env, path)]\n        else:\n            result = []\n\n        memo_dict[memo_key] = result\n\n        return result\n\n    def _createDir(self):\n        # ensure that the directories for this node are\n        # created.\n        self.dir._create()\n\n    def push_to_cache(self):\n        \"\"\"Try to push the node into a cache\n        \"\"\"\n        # This should get called before the Nodes' .built() method is\n        # called, which would clear the build signature if the file has\n        # a source scanner.\n        #\n        # We have to clear the local memoized values *before* we push\n        # the node to cache so that the memoization of the self.exists()\n        # return value doesn't interfere.\n        if self.nocache:\n            return\n        self.clear_memoized_values()\n        if self.exists():\n            self.get_build_env().get_CacheDir().push(self)\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        if self.nocache:\n            return None\n        if not self.is_derived():\n            return None\n        return self.get_build_env().get_CacheDir().retrieve(self)\n\n    def visited(self):\n        if self.exists() and self.executor is not None:\n            self.get_build_env().get_CacheDir().push_if_forced(self)\n\n        ninfo = self.get_ninfo()\n\n        csig = self.get_max_drift_csig()\n        if csig:\n            ninfo.csig = csig\n\n        ninfo.timestamp = self.get_timestamp()\n        ninfo.size      = self.get_size()\n\n        if not self.has_builder():\n            # This is a source file, but it might have been a target file\n            # in another build that included more of the DAG.  Copy\n            # any build information that's stored in the .sconsign file\n            # into our binfo object so it doesn't get lost.\n            old = self.get_stored_info()\n            self.get_binfo().merge(old.binfo)\n\n        SCons.Node.store_info_map[self.store_info](self)\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n         up-to-date or was built completely.\n\n         This is where we try to release as many target node infos\n         as possible for clean builds and update runs, in order\n         to minimize the overall memory consumption.\n\n         We'd like to remove a lot more attributes like self.sources\n         and self.sources_set, but they might get used\n         in a next build step. For example, during configuration\n         the source files for a built E{*}.o file are used to figure out\n         which linker to use for the resulting Program (gcc vs. g++)!\n         That's why we check for the 'keep_targetinfo' attribute,\n         config Nodes and the Interactive mode just don't allow\n         an early release of most variables.\n\n         In the same manner, we can't simply remove the self.attributes\n         here. The smart linking relies on the shared flag, and some\n         parts of the java Tool use it to transport information\n         about nodes...\n\n         @see: built() and Node.release_target_info()\n         \"\"\"\n        if self.released_target_info or SCons.Node.interactive:\n            return\n\n        if not hasattr(self.attributes, 'keep_targetinfo'):\n            # Cache some required values, before releasing\n            # stuff like env, executor and builder...\n            self.changed(allowcache=True)\n            self.get_contents_sig()\n            self.get_build_env()\n            # Now purge unneeded stuff to free memory...\n            self.executor = None\n            self._memo.pop('rfile', None)\n            self.prerequisites = None\n            # Cleanup lists, but only if they're empty\n            if not len(self.ignore_set):\n                self.ignore_set = None\n            if not len(self.implicit_set):\n                self.implicit_set = None\n            if not len(self.depends_set):\n                self.depends_set = None\n            if not len(self.ignore):\n                self.ignore = None\n            if not len(self.depends):\n                self.depends = None\n            # Mark this node as done, we only have to release\n            # the memory once...\n            self.released_target_info = True\n\n    def find_src_builder(self):\n        if self.rexists():\n            return None\n        scb = self.dir.src_builder()\n        if scb is _null:\n            scb = None\n        if scb is not None:\n            try:\n                b = self.builder\n            except AttributeError:\n                b = None\n            if b is None:\n                self.builder_set(scb)\n        return scb\n\n    def has_src_builder(self):\n        \"\"\"Return whether this Node has a source builder or not.\n\n        If this Node doesn't have an explicit source code builder, this\n        is where we figure out, on the fly, if there's a transparent\n        source code builder for it.\n\n        Note that if we found a source builder, we also set the\n        self.builder attribute, so that all of the methods that actually\n        *build* this file don't have to do anything different.\n        \"\"\"\n        try:\n            scb = self.sbuilder\n        except AttributeError:\n            scb = self.sbuilder = self.find_src_builder()\n        return scb is not None\n\n    def alter_targets(self):\n        \"\"\"Return any corresponding targets in a variant directory.\n        \"\"\"\n        if self.is_derived():\n            return [], None\n        return self.fs.variant_dir_target_climb(self, self.dir, [self.name])\n\n    def _rmv_existing(self):\n        self.clear_memoized_values()\n        if SCons.Node.print_duplicate:\n            print(\"dup: removing existing target {}\".format(self))\n        e = Unlink(self, [], None)\n        if isinstance(e, SCons.Errors.BuildError):\n            raise e\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        self.has_src_builder()\n        self.get_binfo()\n\n    def prepare(self):\n        \"\"\"Prepare for this file to be created.\"\"\"\n        SCons.Node.Node.prepare(self)\n\n        if self.get_state() != SCons.Node.up_to_date:\n            # Exists will report False for dangling symlinks so if it\n            # exists or is a link (which would mean it's a dangling\n            # link) then we should remove it as appropriate.\n            if self.exists() or self.islink():\n                if self.is_derived() and not self.precious:\n                    self._rmv_existing()\n            else:\n                try:\n                    self._createDir()\n                except SCons.Errors.StopError as drive:\n                    raise SCons.Errors.StopError(\"No drive `{}' for target `{}'.\".format(drive, self))\n\n    #\n    #\n    #\n\n    def remove(self):\n        \"\"\"Remove this file.\"\"\"\n        if self.exists() or self.islink():\n            self.fs.unlink(self.get_internal_path())\n            return 1\n        return None\n\n    def do_duplicate(self, src):\n        self._createDir()\n        if SCons.Node.print_duplicate:\n            print(\"dup: relinking variant '{}' from '{}'\".format(self, src))\n        Unlink(self, None, None)\n        e = Link(self, src, None)\n        if isinstance(e, SCons.Errors.BuildError):\n            raise SCons.Errors.StopError(\"Cannot duplicate `{}' in `{}': {}.\".format(src.get_internal_path(), self.dir._path, e.errstr))\n        self.linked = 1\n        # The Link() action may or may not have actually\n        # created the file, depending on whether the -n\n        # option was used or not.  Delete the _exists and\n        # _rexists attributes so they can be reevaluated.\n        self.clear()\n\n    @SCons.Memoize.CountMethodCall\n    def exists(self):\n        try:\n            return self._memo['exists']\n        except KeyError:\n            pass\n        result = SCons.Node._exists_map[self._func_exists](self)\n        self._memo['exists'] = result\n        return result\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    def get_max_drift_csig(self) -> Optional[str]:\n        \"\"\"\n        Returns the content signature currently stored for this node\n        if it's been unmodified longer than the max_drift value, or the\n        max_drift value is 0.  Returns None otherwise.\n        \"\"\"\n        old = self.get_stored_info()\n        mtime = self.get_timestamp()\n\n        max_drift = self.fs.max_drift\n        if max_drift > 0:\n            if (time.time() - mtime) > max_drift:\n                try:\n                    n = old.ninfo\n                    if n.timestamp and n.csig and n.timestamp == mtime:\n                        return n.csig\n                except AttributeError:\n                    pass\n        elif max_drift == 0:\n            try:\n                return old.ninfo.csig\n            except AttributeError:\n                pass\n\n        return None\n\n    def get_csig(self) -> str:\n        \"\"\"Generate a node's content signature.\"\"\"\n        ninfo = self.get_ninfo()\n        try:\n            return ninfo.csig\n        except AttributeError:\n            pass\n\n        csig = self.get_max_drift_csig()\n        if csig is None:\n            try:\n                size = self.get_size()\n                if size == -1:\n                    contents = SCons.Util.NOFILE\n                elif size < File.hash_chunksize:\n                    contents = self.get_contents()\n                else:\n                    csig = self.get_content_hash()\n            except IOError:\n                # This can happen if there's actually a directory on-disk,\n                # which can be the case if they've disabled disk checks,\n                # or if an action with a File target actually happens to\n                # create a same-named directory by mistake.\n                csig = ''\n            else:\n                if not csig:\n                    csig = SCons.Util.hash_signature(contents)\n\n        ninfo.csig = csig\n\n        return csig\n\n    #\n    # DECISION SUBSYSTEM\n    #\n\n    def builder_set(self, builder):\n        SCons.Node.Node.builder_set(self, builder)\n        self.changed_since_last_build = 5\n\n    def built(self):\n        \"\"\"Called just after this File node is successfully built.\n\n         Just like for 'release_target_info' we try to release\n         some more target node attributes in order to minimize the\n         overall memory consumption.\n\n         @see: release_target_info\n        \"\"\"\n\n        SCons.Node.Node.built(self)\n\n        if (not SCons.Node.interactive and\n            not hasattr(self.attributes, 'keep_targetinfo')):\n            # Ensure that the build infos get computed and cached...\n            SCons.Node.store_info_map[self.store_info](self)\n            # ... then release some more variables.\n            self._specific_sources = False\n            self._labspath = None\n            self._save_str()\n            self.cwd = None\n\n            self.scanner_paths = None\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.\n\n        For File nodes this is basically a wrapper around Node.changed(),\n        but we allow the return value to get cached after the reference\n        to the Executor got released in release_target_info().\n\n        @see: Node.changed()\n        \"\"\"\n        if node is None:\n            try:\n                return self._memo['changed']\n            except KeyError:\n                pass\n\n        has_changed = SCons.Node.Node.changed(self, node)\n        if allowcache:\n            self._memo['changed'] = has_changed\n        return has_changed\n\n    def changed_content(self, target, prev_ni, repo_node=None):\n        cur_csig = self.get_csig()\n        try:\n            return cur_csig != prev_ni.csig\n        except AttributeError:\n            return 1\n\n    def changed_state(self, target, prev_ni, repo_node=None):\n        return self.state != SCons.Node.up_to_date\n\n\n    # Caching node -> string mapping for the below method\n    __dmap_cache = {}\n    __dmap_sig_cache = {}\n\n\n    def _build_dependency_map(self, binfo):\n        \"\"\"\n        Build mapping from file -> signature\n\n        Args:\n            self - self\n            binfo - buildinfo from node being considered\n\n        Returns:\n            dictionary of file->signature mappings\n        \"\"\"\n\n        # For an \"empty\" binfo properties like bsources\n        # do not exist: check this to avoid exception.\n        if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) +\n            len(binfo.bimplicitsigs)) == 0:\n            return {}\n\n        binfo.dependency_map = { child:signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit),\n                                     chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))}\n\n        return binfo.dependency_map\n\n    # @profile\n    def _add_strings_to_dependency_map(self, dmap):\n        \"\"\"\n        In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map\n        :return:\n        \"\"\"\n\n        first_string = str(next(iter(dmap)))\n\n        # print(\"DMAP:%s\"%id(dmap))\n        if first_string not in dmap:\n                string_dict = {str(child): signature for child, signature in dmap.items()}\n                dmap.update(string_dict)\n        return dmap\n\n    def _get_previous_signatures(self, dmap):\n        \"\"\"\n        Return a list of corresponding csigs from previous\n        build in order of the node/files in children.\n\n        Args:\n            self - self\n            dmap - Dictionary of file -> csig\n\n        Returns:\n            List of csigs for provided list of children\n        \"\"\"\n        prev = []\n        # MD5_TIMESTAMP_DEBUG = False\n\n        if len(dmap) == 0:\n            if MD5_TIMESTAMP_DEBUG: print(\"Nothing dmap shortcutting\")\n            return None\n        elif MD5_TIMESTAMP_DEBUG: print(\"len(dmap):%d\"%len(dmap))\n\n\n        # First try retrieving via Node\n        if MD5_TIMESTAMP_DEBUG: print(\"Checking if self is in  map:%s id:%s type:%s\"%(str(self), id(self), type(self)))\n        df = dmap.get(self, False)\n        if df:\n            return df\n\n        # Now check if self's repository file is in map.\n        rf = self.rfile()\n        if MD5_TIMESTAMP_DEBUG: print(\"Checking if self.rfile  is in  map:%s id:%s type:%s\"%(str(rf), id(rf), type(rf)))\n        rfm = dmap.get(rf, False)\n        if rfm:\n            return rfm\n\n        # get default string for node and then also string swapping os.altsep for os.sep (/ for \\)\n        c_strs = [str(self)]\n\n        if os.altsep:\n            c_strs.append(c_strs[0].replace(os.sep, os.altsep))\n\n        # In some cases the dependency_maps' keys are already strings check.\n        # Check if either string is now in dmap.\n        for s in c_strs:\n            if MD5_TIMESTAMP_DEBUG: print(\"Checking if str(self) is in map  :%s\" % s)\n            df = dmap.get(s, False)\n            if df:\n                return df\n\n        # Strings don't exist in map, add them and try again\n        # If there are no strings in this dmap, then add them.\n        # This may not be necessary, we could walk the nodes in the dmap and check each string\n        # rather than adding ALL the strings to dmap. In theory that would be n/2 vs 2n str() calls on node\n        # if not dmap.has_strings:\n        dmap = self._add_strings_to_dependency_map(dmap)\n\n        # In some cases the dependency_maps' keys are already strings check.\n        # Check if either string is now in dmap.\n        for s in c_strs:\n            if MD5_TIMESTAMP_DEBUG: print(\"Checking if str(self) is in map (now with strings)  :%s\" % s)\n            df = dmap.get(s, False)\n            if df:\n                return df\n\n        # Lastly use nodes get_path() to generate string and see if that's in dmap\n        if not df:\n            try:\n                # this should yield a path which matches what's in the sconsign\n                c_str = self.get_path()\n                if os.altsep:\n                    c_str = c_str.replace(os.sep, os.altsep)\n\n                if MD5_TIMESTAMP_DEBUG: print(\"Checking if self.get_path is in map (now with strings)  :%s\" % s)\n\n                df = dmap.get(c_str, None)\n\n            except AttributeError as e:\n                raise FileBuildInfoFileToCsigMappingError(\"No mapping from file name to content signature for :%s\"%c_str)\n\n        return df\n\n    def changed_timestamp_then_content(self, target, prev_ni, node=None):\n        \"\"\"\n        Used when decider for file is Timestamp-MD5\n\n        NOTE: If the timestamp hasn't changed this will skip md5'ing the\n              file and just copy the prev_ni provided.  If the prev_ni\n              is wrong. It will propagate it.\n              See: https://github.com/SCons/scons/issues/2980\n\n        Args:\n            self - dependency\n            target - target\n            prev_ni - The NodeInfo object loaded from previous builds .sconsign\n            node - Node instance.  Check this node for file existence/timestamp\n                   if specified.\n\n        Returns:\n            Boolean - Indicates if node(File) has changed.\n        \"\"\"\n\n        if node is None:\n            node = self\n        # Now get sconsign name -> csig map and then get proper prev_ni if possible\n        bi = node.get_stored_info().binfo\n        rebuilt = False\n        try:\n            dependency_map = bi.dependency_map\n        except AttributeError as e:\n            dependency_map = self._build_dependency_map(bi)\n            rebuilt = True\n\n        if len(dependency_map) == 0:\n            # If there's no dependency map, there's no need to find the\n            # prev_ni as there aren't any\n            # shortcut the rest of the logic\n            if MD5_TIMESTAMP_DEBUG: print(\"Skipping checks len(dmap)=0\")\n\n            # We still need to get the current file's csig\n            # This should be slightly faster than calling self.changed_content(target, new_prev_ni)\n            self.get_csig()\n            return True\n\n        new_prev_ni = self._get_previous_signatures(dependency_map)\n        new = self.changed_timestamp_match(target, new_prev_ni)\n\n        if MD5_TIMESTAMP_DEBUG:\n            old = self.changed_timestamp_match(target, prev_ni)\n\n            if old != new:\n                print(\"Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s\"%(str(target), old, new))\n                new_prev_ni = self._get_previous_signatures(dependency_map)\n\n        if not new:\n            try:\n                # NOTE: We're modifying the current node's csig in a query.\n                self.get_ninfo().csig = new_prev_ni.csig\n            except AttributeError:\n                pass\n            return False\n        return self.changed_content(target, new_prev_ni)\n\n    def changed_timestamp_newer(self, target, prev_ni, repo_node=None):\n        try:\n            return self.get_timestamp() > target.get_timestamp()\n        except AttributeError:\n            return 1\n\n    def changed_timestamp_match(self, target, prev_ni, repo_node=None):\n        \"\"\"\n        Return True if the timestamps don't match or if there is no previous timestamp\n        :param target:\n        :param prev_ni: Information about the node from the previous build\n        :return:\n        \"\"\"\n        try:\n            return self.get_timestamp() != prev_ni.timestamp\n        except AttributeError:\n            return 1\n\n    def is_up_to_date(self):\n        \"\"\"Check for whether the Node is current\n           In all cases self is the target we're checking to see if it's up to date\n        \"\"\"\n\n        T = 0\n        if T: Trace('is_up_to_date(%s):' % self)\n        if not self.exists():\n            if T: Trace(' not self.exists():')\n            # The file (always a target) doesn't exist locally...\n            r = self.rfile()\n            if r != self:\n                # ...but there is one (always a target) in a Repository...\n                if not self.changed(r):\n                    if T: Trace(' changed(%s):' % r)\n                    # ...and it's even up-to-date...\n                    if self._local:\n                        # ...and they'd like a local copy.\n                        e = LocalCopy(self, r, None)\n                        if isinstance(e, SCons.Errors.BuildError):\n                            # Likely this should be re-raising exception e\n                            # (which would be BuildError)\n                            raise e\n                        SCons.Node.store_info_map[self.store_info](self)\n                    if T: Trace(' 1\\n')\n                    return 1\n            self.changed()\n            if T: Trace(' None\\n')\n            return None\n        else:\n            r = self.changed()\n            if T: Trace(' self.exists():  %s\\n' % r)\n            return not r\n\n    @SCons.Memoize.CountMethodCall\n    def rfile(self):\n        try:\n            return self._memo['rfile']\n        except KeyError:\n            pass\n        result = self\n        if not self.exists():\n            norm_name = _my_normcase(self.name)\n            for repo_dir in self.dir.get_all_rdirs():\n                try:\n                    node = repo_dir.entries[norm_name]\n                except KeyError:\n                    node = repo_dir.file_on_disk(self.name)\n\n                if node and node.exists() and \\\n                   (isinstance(node, File) or isinstance(node, Entry)\n                    or not node.is_derived()):\n                        result = node\n                        # Copy over our local attributes to the repository\n                        # Node so we identify shared object files in the\n                        # repository and don't assume they're static.\n                        #\n                        # This isn't perfect; the attribute would ideally\n                        # be attached to the object in the repository in\n                        # case it was built statically in the repository\n                        # and we changed it to shared locally, but that's\n                        # rarely the case and would only occur if you\n                        # intentionally used the same suffix for both\n                        # shared and static objects anyway.  So this\n                        # should work well in practice.\n                        result.attributes = self.attributes\n                        break\n        self._memo['rfile'] = result\n        return result\n\n    def find_repo_file(self):\n        \"\"\"\n        For this node, find if there exists a corresponding file in one or more repositories\n        :return: list of corresponding files in repositories\n        \"\"\"\n        retvals = []\n\n        norm_name = _my_normcase(self.name)\n        for repo_dir in self.dir.get_all_rdirs():\n            try:\n                node = repo_dir.entries[norm_name]\n            except KeyError:\n                node = repo_dir.file_on_disk(self.name)\n\n            if node and node.exists() and \\\n                    (isinstance(node, File) or isinstance(node, Entry)\n                     or not node.is_derived()):\n                retvals.append(node)\n\n        return retvals\n\n\n    def rstr(self):\n        return str(self.rfile())\n\n    def get_cachedir_csig(self):\n        \"\"\"\n        Fetch a Node's content signature for purposes of computing\n        another Node's cachesig.\n\n        This is a wrapper around the normal get_csig() method that handles\n        the somewhat obscure case of using CacheDir with the -n option.\n        Any files that don't exist would normally be \"built\" by fetching\n        them from the cache, but the normal get_csig() method will try\n        to open up the local file, which doesn't exist because the -n\n        option meant we didn't actually pull the file from cachedir.\n        But since the file *does* actually exist in the cachedir, we\n        can use its contents for the csig.\n        \"\"\"\n        try:\n            return self.cachedir_csig\n        except AttributeError:\n            pass\n\n        cache = self.get_build_env().get_CacheDir()\n        cachedir, cachefile = cache.cachepath(self)\n        if not self.exists() and cachefile and os.path.exists(cachefile):\n            self.cachedir_csig = cache.get_cachedir_csig(self)\n        else:\n            self.cachedir_csig = self.get_csig()\n        return self.cachedir_csig\n\n    def get_contents_sig(self):\n        \"\"\"\n        A helper method for get_cachedir_bsig.\n\n        It computes and returns the signature for this\n        node's contents.\n        \"\"\"\n\n        try:\n            return self.contentsig\n        except AttributeError:\n            pass\n\n        executor = self.get_executor()\n\n        result = self.contentsig = hash_signature(executor.get_contents())\n        return result\n\n    def get_cachedir_bsig(self):\n        \"\"\"\n        Return the signature for a cached file, including\n        its children.\n\n        It adds the path of the cached file to the cache signature,\n        because multiple targets built by the same action will all\n        have the same build signature, and we have to differentiate\n        them somehow.\n\n        Signature should normally be string of hex digits.\n        \"\"\"\n        try:\n            return self.cachesig\n        except AttributeError:\n            pass\n\n        # Collect signatures for all children\n        children = self.children()\n        sigs = [n.get_cachedir_csig() for n in children]\n\n        # Append this node's signature...\n        sigs.append(self.get_contents_sig())\n\n        # ...and it's path\n        sigs.append(self.get_internal_path())\n\n        # Merge this all into a single signature\n        result = self.cachesig = hash_collect(sigs)\n        return result\n\ndefault_fs = None\n\ndef get_default_fs():\n    global default_fs\n    if not default_fs:\n        default_fs = FS()\n    return default_fs\n\nclass FileFinder:\n    \"\"\"\n    \"\"\"\n\n    def __init__(self):\n        self._memo = {}\n\n    def filedir_lookup(self, p, fd=None):\n        \"\"\"\n        A helper method for find_file() that looks up a directory for\n        a file we're trying to find.  This only creates the Dir Node if\n        it exists on-disk, since if the directory doesn't exist we know\n        we won't find any files in it...  :-)\n\n        It would be more compact to just use this as a nested function\n        with a default keyword argument (see the commented-out version\n        below), but that doesn't work unless you have nested scopes,\n        so we define it here just so this work under Python 1.5.2.\n        \"\"\"\n        if fd is None:\n            fd = self.default_filedir\n        dir, name = os.path.split(fd)\n        drive, d = _my_splitdrive(dir)\n        if not name and d[:1] in ('/', OS_SEP):\n            #return p.fs.get_root(drive).dir_on_disk(name)\n            return p.fs.get_root(drive)\n        if dir:\n            p = self.filedir_lookup(p, dir)\n            if not p:\n                return None\n        norm_name = _my_normcase(name)\n        try:\n            node = p.entries[norm_name]\n        except KeyError:\n            return p.dir_on_disk(name)\n        if isinstance(node, Dir):\n            return node\n        if isinstance(node, Entry):\n            node.must_be_same(Dir)\n            return node\n        return None\n\n    def _find_file_key(self, filename, paths, verbose=None):\n        # Note: paths could be a list, which is not hashable. If it is, convert\n        # it to a tuple, which is hashable.\n        paths_entry = tuple(paths) if isinstance(paths, list) else paths\n        return (filename, paths_entry)\n\n    @SCons.Memoize.CountDictCall(_find_file_key)\n    def find_file(self, filename, paths, verbose=None):\n        \"\"\"\n        Find a node corresponding to either a derived file or a file that exists already.\n\n        Only the first file found is returned, and none is returned if no file is found.\n\n        filename: A filename to find\n        paths: A list of directory path *nodes* to search in.  Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple.\n\n        returns The node created from the found file.\n\n        \"\"\"\n        memo_key = self._find_file_key(filename, paths)\n        try:\n            memo_dict = self._memo['find_file']\n        except KeyError:\n            memo_dict = {}\n            self._memo['find_file'] = memo_dict\n        else:\n            try:\n                return memo_dict[memo_key]\n            except KeyError:\n                pass\n\n        if verbose and not callable(verbose):\n            if not SCons.Util.is_String(verbose):\n                verbose = \"find_file\"\n            _verbose = '  %s: ' % verbose\n            verbose = lambda s: sys.stdout.write(_verbose + s)\n\n        filedir, filename = os.path.split(filename)\n        if filedir:\n            self.default_filedir = filedir\n            paths = [_f for _f in map(self.filedir_lookup, paths) if _f]\n\n        result = None\n        for dir in paths:\n            if verbose:\n                verbose(\"looking for '%s' in '%s' ...\\n\" % (filename, dir))\n            node, d = dir.srcdir_find_file(filename)\n            if node:\n                if verbose:\n                    verbose(\"... FOUND '%s' in '%s'\\n\" % (filename, d))\n                result = node\n                break\n\n        memo_dict[memo_key] = result\n\n        return result\n\nfind_file = FileFinder().find_file\n\n\ndef invalidate_node_memos(targets):\n    \"\"\"\n    Invalidate the memoized values of all Nodes (files or directories)\n    that are associated with the given entries. Has been added to\n    clear the cache of nodes affected by a direct execution of an\n    action (e.g.  Delete/Copy/Chmod). Existing Node caches become\n    inconsistent if the action is run through Execute().  The argument\n    `targets` can be a single Node object or filename, or a sequence\n    of Nodes/filenames.\n    \"\"\"\n    from traceback import extract_stack\n\n    # First check if the cache really needs to be flushed. Only\n    # actions run in the SConscript with Execute() seem to be\n    # affected. XXX The way to check if Execute() is in the stacktrace\n    # is a very dirty hack and should be replaced by a more sensible\n    # solution.\n    for f in extract_stack():\n        if f[2] == 'Execute' and f[0][-14:] == 'Environment.py':\n            break\n    else:\n        # Dont have to invalidate, so return\n        return\n\n    if not SCons.Util.is_List(targets):\n        targets = [targets]\n\n    for entry in targets:\n        # If the target is a Node object, clear the cache. If it is a\n        # filename, look up potentially existing Node object first.\n        try:\n            entry.clear_memoized_values()\n        except AttributeError:\n            # Not a Node object, try to look up Node by filename.  XXX\n            # This creates Node objects even for those filenames which\n            # do not correspond to an existing Node object.\n            node = get_default_fs().Entry(entry)\n            if node:\n                node.clear_memoized_values()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Python nodes.\"\"\"\n\nimport SCons.Node\n\n_memo_lookup_map = {}\n\n\nclass ValueNodeInfo(SCons.Node.NodeInfoBase):\n    __slots__ = ('csig',)\n    current_version_id = 2\n\n    field_list = ['csig']\n\n    def str_to_node(self, s):\n        return ValueWithMemo(s)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot\n        is available, copy all entries to the dictionary. Also include the\n        version id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj, '__slots__', ()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass ValueBuildInfo(SCons.Node.BuildInfoBase):\n    __slots__ = ()\n    current_version_id = 2\n\n\nclass Value(SCons.Node.Node):\n    \"\"\"A class for Python variables, typically passed on the command line\n    or generated by a script, but not from a file or some other source.\n    \"\"\"\n\n    NodeInfo = ValueNodeInfo\n    BuildInfo = ValueBuildInfo\n\n    def __init__(self, value, built_value=None, name=None):\n        SCons.Node.Node.__init__(self)\n        self.value = value\n        self.changed_since_last_build = 6\n        self.store_info = 0\n        if built_value is not None:\n            self.built_value = built_value\n\n        # Set a name so it can be a child of a node and not break\n        # its parent's implementation of Node.get_contents.\n        if name:\n            self.name = name\n        else:\n            self.name = str(value)\n\n    def str_for_display(self):\n        return repr(self.value)\n\n    def __str__(self):\n        return str(self.value)\n\n    def make_ready(self):\n        self.get_csig()\n\n    def build(self, **kw):\n        if not hasattr(self, 'built_value'):\n            SCons.Node.Node.build(self, **kw)\n\n    is_up_to_date = SCons.Node.Node.children_are_up_to_date\n\n    def is_under(self, dir):\n        # Make Value nodes get built regardless of\n        # what directory scons was run from. Value nodes\n        # are outside the filesystem:\n        return 1\n\n    def write(self, built_value):\n        \"\"\"Set the value of the node.\"\"\"\n        self.built_value = built_value\n\n    def read(self):\n        \"\"\"Return the value. If necessary, the value is built.\"\"\"\n        self.build()\n        if not hasattr(self, 'built_value'):\n            self.built_value = self.value\n        return self.built_value\n\n    def get_text_contents(self) -> str:\n        \"\"\"By the assumption that the node.built_value is a\n        deterministic product of the sources, the contents of a Value\n        are the concatenation of all the contents of its sources.  As\n        the value need not be built when get_contents() is called, we\n        cannot use the actual node.built_value.\"\"\"\n        ###TODO: something reasonable about universal newlines\n        contents = str(self.value)\n        for kid in self.children(None):\n            # Get csig() value of child as this is more efficent\n            contents = contents + kid.get_csig()\n        return contents\n\n    def get_contents(self) -> bytes:\n        \"\"\"Get contents for signature calculations.\"\"\"\n        return self.get_text_contents().encode()\n\n    def get_csig(self, calc=None):\n        \"\"\"Because we're a Python value node and don't have a real\n        timestamp, we get to ignore the calculator and just use the\n        value contents.\n\n        Returns string. Ideally string of hex digits. (Not bytes)\n        \"\"\"\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            pass\n\n        contents = self.get_text_contents()\n\n        self.get_ninfo().csig = contents\n        return contents\n\n\ndef ValueWithMemo(value, built_value=None, name=None):\n    \"\"\"\n    Memoized Value() node factory.\n    \"\"\"\n    global _memo_lookup_map\n\n    # No current support for memoizing a value that needs to be built.\n    if built_value:\n        return Value(value, built_value, name=name)\n\n    try:\n        memo_lookup_key = hash((value, name))\n    except TypeError:\n        # Non-primitive types will hit this codepath.\n        return Value(value, name=name)\n\n    try:\n        return _memo_lookup_map[memo_lookup_key]\n    except KeyError:\n        v = Value(value, built_value, name)\n        _memo_lookup_map[memo_lookup_key] = v\n        return v\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"The Node package for the SCons software construction utility.\n\nThis is, in many ways, the heart of SCons.\n\nA Node is where we encapsulate all of the dependency information about\nany thing that SCons can build, or about any thing which SCons can use\nto build some other thing.  The canonical \"thing,\" of course, is a file,\nbut a Node can also represent something remote (like a web page) or\nsomething completely abstract (like an Alias).\n\nEach specific type of \"thing\" is specifically represented by a subclass\nof the Node base class:  Node.FS.File for files, Node.Alias for aliases,\netc.  Dependency information is kept here in the base class, and\ninformation specific to files/aliases/etc. is in the subclass.  The\ngoal, if we've done this correctly, is that any type of \"thing\" should\nbe able to depend on any other type of \"thing.\"\n\n\"\"\"\n\nimport collections\nimport copy\nfrom itertools import chain, zip_longest\n\nimport SCons.Debug\nimport SCons.Executor\nimport SCons.Memoize\nfrom SCons.compat import NoSlotsPyPy\nfrom SCons.Debug import logInstanceCreation, Trace\nfrom SCons.Util import hash_signature, is_List, UniqueList, render_tree\n\nprint_duplicate = 0\n\ndef classname(obj):\n    return str(obj.__class__).split('.')[-1]\n\n# Set to false if we're doing a dry run. There's more than one of these\n# little treats\ndo_store_info = True\n\n# Node states\n#\n# These are in \"priority\" order, so that the maximum value for any\n# child/dependency of a node represents the state of that node if\n# it has no builder of its own.  The canonical example is a file\n# system directory, which is only up to date if all of its children\n# were up to date.\nno_state = 0\npending = 1\nexecuting = 2\nup_to_date = 3\nexecuted = 4\nfailed = 5\n\nStateString = {\n    0 : \"no_state\",\n    1 : \"pending\",\n    2 : \"executing\",\n    3 : \"up_to_date\",\n    4 : \"executed\",\n    5 : \"failed\",\n}\n\n# controls whether implicit dependencies are cached:\nimplicit_cache = 0\n\n# controls whether implicit dep changes are ignored:\nimplicit_deps_unchanged = 0\n\n# controls whether the cached implicit deps are ignored:\nimplicit_deps_changed = 0\n\n# A variable that can be set to an interface-specific function be called\n# to annotate a Node with information about its creation.\ndef do_nothing_node(node): pass\n\nAnnotate = do_nothing_node\n\n# global set for recording all processed SContruct/SConscript nodes\nSConscriptNodes = set()\n\n# Gets set to 'True' if we're running in interactive mode. Is\n# currently used to release parts of a target's info during\n# clean builds and update runs (see release_target_info).\ninteractive = False\n\ndef is_derived_none(node):\n    raise NotImplementedError\n\ndef is_derived_node(node):\n    \"\"\"\n        Returns true if this node is derived (i.e. built).\n    \"\"\"\n    return node.has_builder() or node.side_effect\n\n_is_derived_map = {0 : is_derived_none,\n                   1 : is_derived_node}\n\ndef exists_none(node):\n    raise NotImplementedError\n\ndef exists_always(node):\n    return 1\n\ndef exists_base(node):\n    return node.stat() is not None\n\ndef exists_entry(node):\n    \"\"\"Return if the Entry exists.  Check the file system to see\n    what we should turn into first.  Assume a file if there's no\n    directory.\"\"\"\n    node.disambiguate()\n    return _exists_map[node._func_exists](node)\n\n\ndef exists_file(node):\n    # Duplicate from source path if we are set up to do this.\n    if node.duplicate and not node.is_derived() and not node.linked:\n        src = node.srcnode()\n        if src is not node:\n            # At this point, src is meant to be copied in a variant directory.\n            src = src.rfile()\n            if src.get_abspath() != node.get_abspath():\n                if src.exists():\n                    node.do_duplicate(src)\n                    # Can't return 1 here because the duplication might\n                    # not actually occur if the -n option is being used.\n                else:\n                    # The source file does not exist.  Make sure no old\n                    # copy remains in the variant directory.\n                    if print_duplicate:\n                        print(\"dup: no src for %s, unlinking old variant copy\" % node)\n                    if exists_base(node) or node.islink():\n                        node.fs.unlink(node.get_internal_path())\n                    # Return None explicitly because the Base.exists() call\n                    # above will have cached its value if the file existed.\n                    return None\n    return exists_base(node)\n\n_exists_map = {0 : exists_none,\n               1 : exists_always,\n               2 : exists_base,\n               3 : exists_entry,\n               4 : exists_file}\n\n\ndef rexists_none(node):\n    raise NotImplementedError\n\ndef rexists_node(node):\n    return node.exists()\n\ndef rexists_base(node):\n    return node.rfile().exists()\n\n_rexists_map = {0 : rexists_none,\n                1 : rexists_node,\n                2 : rexists_base}\n\ndef get_contents_none(node):\n    raise NotImplementedError\n\ndef get_contents_entry(node):\n    \"\"\"Fetch the contents of the entry.  Returns the exact binary\n    contents of the file.\"\"\"\n    try:\n        node = node.disambiguate(must_exist=1)\n    except SCons.Errors.UserError:\n        # There was nothing on disk with which to disambiguate\n        # this entry.  Leave it as an Entry, but return a null\n        # string so calls to get_contents() in emitters and the\n        # like (e.g. in qt.py) don't have to disambiguate by hand\n        # or catch the exception.\n        return ''\n    else:\n        return _get_contents_map[node._func_get_contents](node)\n\ndef get_contents_dir(node):\n    \"\"\"Return content signatures and names of all our children\n    separated by new-lines. Ensure that the nodes are sorted.\"\"\"\n    contents = []\n    for n in sorted(node.children(), key=lambda t: t.name):\n        contents.append('%s %s\\n' % (n.get_csig(), n.name))\n    return ''.join(contents)\n\ndef get_contents_file(node):\n    if not node.rexists():\n        return b''\n    fname = node.rfile().get_abspath()\n    try:\n        with open(fname, \"rb\") as fp:\n            contents = fp.read()\n    except EnvironmentError as e:\n        if not e.filename:\n            e.filename = fname\n        raise\n    return contents\n\n_get_contents_map = {0 : get_contents_none,\n                     1 : get_contents_entry,\n                     2 : get_contents_dir,\n                     3 : get_contents_file}\n\ndef target_from_source_none(node, prefix, suffix, splitext):\n    raise NotImplementedError\n\ndef target_from_source_base(node, prefix, suffix, splitext):\n    return node.dir.Entry(prefix + splitext(node.name)[0] + suffix)\n\n_target_from_source_map = {0 : target_from_source_none,\n                           1 : target_from_source_base}\n\n#\n# The new decider subsystem for Nodes\n#\n# We would set and overwrite the changed_since_last_build function\n# before, but for being able to use slots (less memory!) we now have\n# a dictionary of the different decider functions. Then in the Node\n# subclasses we simply store the index to the decider that should be\n# used by it.\n#\n\n#\n# First, the single decider functions\n#\ndef changed_since_last_build_node(node, target, prev_ni, repo_node=None):\n    \"\"\"\n\n    Must be overridden in a specific subclass to return True if this\n    Node (a dependency) has changed since the last time it was used\n    to build the specified target.  prev_ni is this Node's state (for\n    example, its file timestamp, length, maybe content signature)\n    as of the last time the target was built.\n\n    Note that this method is called through the dependency, not the\n    target, because a dependency Node must be able to use its own\n    logic to decide if it changed.  For example, File Nodes need to\n    obey if we're configured to use timestamps, but Python Value Nodes\n    never use timestamps and always use the content.  If this method\n    were called through the target, then each Node's implementation\n    of this method would have to have more complicated logic to\n    handle all the different Node types on which it might depend.\n    \"\"\"\n    raise NotImplementedError\n\n\ndef changed_since_last_build_alias(node, target, prev_ni, repo_node=None):\n    cur_csig = node.get_csig()\n    try:\n        return cur_csig != prev_ni.csig\n    except AttributeError:\n        return 1\n\n\ndef changed_since_last_build_entry(node, target, prev_ni, repo_node=None):\n    node.disambiguate()\n    return _decider_map[node.changed_since_last_build](node, target, prev_ni, repo_node)\n\n\ndef changed_since_last_build_state_changed(node, target, prev_ni, repo_node=None):\n    return node.state != SCons.Node.up_to_date\n\n\ndef decide_source(node, target, prev_ni, repo_node=None):\n    return target.get_build_env().decide_source(node, target, prev_ni, repo_node)\n\n\ndef decide_target(node, target, prev_ni, repo_node=None):\n    return target.get_build_env().decide_target(node, target, prev_ni, repo_node)\n\n\ndef changed_since_last_build_python(node, target, prev_ni, repo_node=None):\n    cur_csig = node.get_csig()\n    try:\n        return cur_csig != prev_ni.csig\n    except AttributeError:\n        return 1\n\n\n#\n# Now, the mapping from indices to decider functions\n#\n_decider_map = {0 : changed_since_last_build_node,\n               1 : changed_since_last_build_alias,\n               2 : changed_since_last_build_entry,\n               3 : changed_since_last_build_state_changed,\n               4 : decide_source,\n               5 : decide_target,\n               6 : changed_since_last_build_python}\n\ndo_store_info = True\n\n#\n# The new store_info subsystem for Nodes\n#\n# We would set and overwrite the store_info function\n# before, but for being able to use slots (less memory!) we now have\n# a dictionary of the different functions. Then in the Node\n# subclasses we simply store the index to the info method that should be\n# used by it.\n#\n\n#\n# First, the single info functions\n#\n\ndef store_info_pass(node):\n    pass\n\ndef store_info_file(node):\n    # Merge our build information into the already-stored entry.\n    # This accommodates \"chained builds\" where a file that's a target\n    # in one build (SConstruct file) is a source in a different build.\n    # See test/chained-build.py for the use case.\n    if do_store_info:\n        node.dir.sconsign().store_info(node.name, node)\n\n\nstore_info_map = {0 : store_info_pass,\n                  1 : store_info_file}\n\n# Classes for signature info for Nodes.\n\nclass NodeInfoBase:\n    \"\"\"\n    The generic base class for signature information for a Node.\n\n    Node subclasses should subclass NodeInfoBase to provide their own\n    logic for dealing with their own Node-specific signature information.\n    \"\"\"\n    __slots__ = ('__weakref__',)\n    current_version_id = 2\n\n    def update(self, node):\n        try:\n            field_list = self.field_list\n        except AttributeError:\n            return\n        for f in field_list:\n            try:\n                delattr(self, f)\n            except AttributeError:\n                pass\n            try:\n                func = getattr(node, 'get_' + f)\n            except AttributeError:\n                pass\n            else:\n                setattr(self, f, func())\n\n    def convert(self, node, val):\n        pass\n\n    def merge(self, other):\n        \"\"\"\n        Merge the fields of another object into this object. Already existing\n        information is overwritten by the other instance's data.\n        WARNING: If a '__dict__' slot is added, it should be updated instead of\n        replaced.\n        \"\"\"\n        state = other.__getstate__()\n        self.__setstate__(state)\n\n    def format(self, field_list=None, names=0):\n        if field_list is None:\n            try:\n                field_list = self.field_list\n            except AttributeError:\n                field_list = list(getattr(self, '__dict__', {}).keys())\n                for obj in type(self).mro():\n                    for slot in getattr(obj, '__slots__', ()):\n                        if slot not in ('__weakref__', '__dict__'):\n                            field_list.append(slot)\n                field_list.sort()\n        fields = []\n        for field in field_list:\n            try:\n                f = getattr(self, field)\n            except AttributeError:\n                f = None\n            f = str(f)\n            if names:\n                f = field + ': ' + f\n            fields.append(f)\n        return fields\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state. The version is discarded.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass BuildInfoBase:\n    \"\"\"\n    The generic base class for build information for a Node.\n\n    This is what gets stored in a .sconsign file for each target file.\n    It contains a NodeInfo instance for this node (signature information\n    that's specific to the type of Node) and direct attributes for the\n    generic build stuff we have to track:  sources, explicit dependencies,\n    implicit dependencies, and action information.\n    \"\"\"\n    __slots__ = (\"bsourcesigs\", \"bdependsigs\", \"bimplicitsigs\", \"bactsig\",\n                 \"bsources\", \"bdepends\", \"bact\", \"bimplicit\", \"__weakref__\")\n    current_version_id = 2\n\n    def __init__(self):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        self.bsourcesigs = []\n        self.bdependsigs = []\n        self.bimplicitsigs = []\n        self.bactsig = None\n\n    def merge(self, other):\n        \"\"\"\n        Merge the fields of another object into this object. Already existing\n        information is overwritten by the other instance's data.\n        WARNING: If a '__dict__' slot is added, it should be updated instead of\n        replaced.\n        \"\"\"\n        state = other.__getstate__()\n        self.__setstate__(state)\n\n    def __getstate__(self):\n        \"\"\"\n        Return all fields that shall be pickled. Walk the slots in the class\n        hierarchy and add those to the state dictionary. If a '__dict__' slot is\n        available, copy all entries to the dictionary. Also include the version\n        id, which is fixed for all instances of a class.\n        \"\"\"\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj,'__slots__',()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        \"\"\"\n        Restore the attributes from a pickled state.\n        \"\"\"\n        # TODO check or discard version\n        del state['_version_id']\n        for key, value in state.items():\n            if key not in ('__weakref__',):\n                setattr(self, key, value)\n\n\nclass Node(object, metaclass=NoSlotsPyPy):\n    \"\"\"The base Node class, for entities that we know how to\n    build, or use to build other Nodes.\n    \"\"\"\n\n    __slots__ = ['sources',\n                 'sources_set',\n                 'target_peers',\n                 '_specific_sources',\n                 'depends',\n                 'depends_set',\n                 'ignore',\n                 'ignore_set',\n                 'prerequisites',\n                 'implicit',\n                 'waiting_parents',\n                 'waiting_s_e',\n                 'ref_count',\n                 'wkids',\n                 'env',\n                 'state',\n                 'precious',\n                 'noclean',\n                 'nocache',\n                 'cached',\n                 'always_build',\n                 'includes',\n                 'attributes',\n                 'side_effect',\n                 'side_effects',\n                 'linked',\n                 '_memo',\n                 'executor',\n                 'binfo',\n                 'ninfo',\n                 'builder',\n                 'is_explicit',\n                 'implicit_set',\n                 'changed_since_last_build',\n                 'store_info',\n                 'pseudo',\n                 '_tags',\n                 '_func_is_derived',\n                 '_func_exists',\n                 '_func_rexists',\n                 '_func_get_contents',\n                 '_func_target_from_source']\n\n    class Attrs:\n        __slots__ = ('shared', '__dict__')\n\n\n    def __init__(self):\n        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')\n        # Note that we no longer explicitly initialize a self.builder\n        # attribute to None here.  That's because the self.builder\n        # attribute may be created on-the-fly later by a subclass (the\n        # canonical example being a builder to fetch a file from a\n        # source code system like CVS or Subversion).\n\n        # Each list of children that we maintain is accompanied by a\n        # dictionary used to look up quickly whether a node is already\n        # present in the list.  Empirical tests showed that it was\n        # fastest to maintain them as side-by-side Node attributes in\n        # this way, instead of wrapping up each list+dictionary pair in\n        # a class.  (Of course, we could always still do that in the\n        # future if we had a good reason to...).\n        self.sources = []       # source files used to build node\n        self.sources_set = set()\n        self._specific_sources = False\n        self.depends = []       # explicit dependencies (from Depends)\n        self.depends_set = set()\n        self.ignore = []        # dependencies to ignore\n        self.ignore_set = set()\n        self.prerequisites = None\n        self.implicit = None    # implicit (scanned) dependencies (None means not scanned yet)\n        self.waiting_parents = set()\n        self.waiting_s_e = set()\n        self.ref_count = 0\n        self.wkids = None       # Kids yet to walk, when it's an array\n\n        self.env = None\n        self.state = no_state\n        self.precious = None\n        self.pseudo = False\n        self.noclean = 0\n        self.nocache = 0\n        self.cached = 0 # is this node pulled from cache?\n        self.always_build = None\n        self.includes = None\n        self.attributes = self.Attrs() # Generic place to stick information about the Node.\n        self.side_effect = 0 # true iff this node is a side effect\n        self.side_effects = [] # the side effects of building this target\n        self.linked = 0 # is this node linked to the variant directory?\n        self.changed_since_last_build = 0\n        self.store_info = 0\n        self._tags = None\n        self._func_is_derived = 1\n        self._func_exists = 1\n        self._func_rexists = 1\n        self._func_get_contents = 0\n        self._func_target_from_source = 0\n        self.ninfo = None\n\n        self.clear_memoized_values()\n\n        # Let the interface in which the build engine is embedded\n        # annotate this Node with its own info (like a description of\n        # what line in what file created the node, for example).\n        Annotate(self)\n\n    def disambiguate(self, must_exist=None):\n        return self\n\n    def get_suffix(self):\n        return ''\n\n    @SCons.Memoize.CountMethodCall\n    def get_build_env(self):\n        \"\"\"Fetch the appropriate Environment to build this node.\n        \"\"\"\n        try:\n            return self._memo['get_build_env']\n        except KeyError:\n            pass\n        result = self.get_executor().get_build_env()\n        self._memo['get_build_env'] = result\n        return result\n\n    def get_build_scanner_path(self, scanner):\n        \"\"\"Fetch the appropriate scanner path for this node.\"\"\"\n        return self.get_executor().get_build_scanner_path(scanner)\n\n    def set_executor(self, executor):\n        \"\"\"Set the action executor for this node.\"\"\"\n        self.executor = executor\n\n    def get_executor(self, create=1):\n        \"\"\"Fetch the action executor for this node.  Create one if\n        there isn't already one, and requested to do so.\"\"\"\n        try:\n            executor = self.executor\n        except AttributeError:\n            if not create:\n                raise\n            try:\n                act = self.builder.action\n            except AttributeError:\n                executor = SCons.Executor.Null(targets=[self])\n            else:\n                executor = SCons.Executor.Executor(act,\n                                                   self.env or self.builder.env,\n                                                   [self.builder.overrides],\n                                                   [self],\n                                                   self.sources)\n            self.executor = executor\n        return executor\n\n    def executor_cleanup(self):\n        \"\"\"Let the executor clean up any cached information.\"\"\"\n        try:\n            executor = self.get_executor(create=None)\n        except AttributeError:\n            pass\n        else:\n            if executor is not None:\n                executor.cleanup()\n\n    def reset_executor(self):\n        \"\"\"Remove cached executor; forces recompute when needed.\"\"\"\n        try:\n            delattr(self, 'executor')\n        except AttributeError:\n            pass\n\n    def push_to_cache(self):\n        \"\"\"Try to push a node into a cache\n        \"\"\"\n        pass\n\n    def retrieve_from_cache(self):\n        \"\"\"Try to retrieve the node's content from a cache\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff in\n        built().\n\n        Returns true if the node was successfully retrieved.\n        \"\"\"\n        return 0\n\n    #\n    # Taskmaster interface subsystem\n    #\n\n    def make_ready(self):\n        \"\"\"Get a Node ready for evaluation.\n\n        This is called before the Taskmaster decides if the Node is\n        up-to-date or not.  Overriding this method allows for a Node\n        subclass to be disambiguated if necessary, or for an implicit\n        source builder to be attached.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"Prepare for this Node to be built.\n\n        This is called after the Taskmaster has decided that the Node\n        is out-of-date and must be rebuilt, but before actually calling\n        the method to build the Node.\n\n        This default implementation checks that explicit or implicit\n        dependencies either exist or are derived, and initializes the\n        BuildInfo structure that will hold the information about how\n        this node is, uh, built.\n\n        (The existence of source files is checked separately by the\n        Executor, which aggregates checks for all of the targets built\n        by a specific action.)\n\n        Overriding this method allows for for a Node subclass to remove\n        the underlying file from the file system.  Note that subclass\n        methods should call this base class method to get the child\n        check and the BuildInfo structure.\n        \"\"\"\n        if self.depends is not None:\n            for d in self.depends:\n                if d.missing():\n                    msg = \"Explicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (d, self))\n        if self.implicit is not None:\n            for i in self.implicit:\n                if i.missing():\n                    msg = \"Implicit dependency `%s' not found, needed by target `%s'.\"\n                    raise SCons.Errors.StopError(msg % (i, self))\n        self.binfo = self.get_binfo()\n\n    def build(self, **kw):\n        \"\"\"Actually build the node.\n\n        This is called by the Taskmaster after it's decided that the\n        Node is out-of-date and must be rebuilt, and after the prepare()\n        method has gotten everything, uh, prepared.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here. Do thread unsafe stuff\n        in built().\n\n        \"\"\"\n        try:\n            self.get_executor()(self, **kw)\n        except SCons.Errors.BuildError as e:\n            e.node = self\n            raise\n\n    def built(self):\n        \"\"\"Called just after this node is successfully built.\"\"\"\n\n        # Clear the implicit dependency caches of any Nodes\n        # waiting for this Node to be built.\n        for parent in self.waiting_parents:\n            parent.implicit = None\n\n            # Handle issue where builder emits more than one target and\n            # the source file for the builder is generated.\n            # in that case only the first target was getting it's .implicit\n            # cleared when the source file is built (second scan).\n            # leaving only partial implicits from scan before source file is generated\n            # typically the compiler only. Then scanned files are appended\n            # This is persisted to sconsign and rebuild causes false rebuilds\n            # because the ordering of the implicit list then changes to what it\n            # should have been.\n            # This is at least the following bugs\n            # https://github.com/SCons/scons/issues/2811\n            # https://jira.mongodb.org/browse/SERVER-33111\n            try:\n                for peer in parent.target_peers:\n                    peer.implicit = None\n            except AttributeError:\n                pass\n\n\n        self.clear()\n\n        if self.pseudo:\n            if self.exists():\n                raise SCons.Errors.UserError(\"Pseudo target \" + str(self) + \" must not exist\")\n        else:\n            if not self.exists() and do_store_info:\n                SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,\n                                    \"Cannot find target \" + str(self) + \" after building\")\n        self.ninfo.update(self)\n\n    def visited(self):\n        \"\"\"Called just after this node has been visited (with or\n        without a build).\"\"\"\n        try:\n            binfo = self.binfo\n        except AttributeError:\n            # Apparently this node doesn't need build info, so\n            # don't bother calculating or storing it.\n            pass\n        else:\n            self.ninfo.update(self)\n            SCons.Node.store_info_map[self.store_info](self)\n\n    def release_target_info(self):\n        \"\"\"Called just after this node has been marked\n        up-to-date or was built completely.\n\n        This is where we try to release as many target node infos\n        as possible for clean builds and update runs, in order\n        to minimize the overall memory consumption.\n\n        By purging attributes that aren't needed any longer after\n        a Node (=File) got built, we don't have to care that much how\n        many KBytes a Node actually requires...as long as we free\n        the memory shortly afterwards.\n\n        @see: built() and File.release_target_info()\n        \"\"\"\n        pass\n\n    def add_to_waiting_s_e(self, node):\n        self.waiting_s_e.add(node)\n\n    def add_to_waiting_parents(self, node):\n        \"\"\"\n        Returns the number of nodes added to our waiting parents list:\n        1 if we add a unique waiting parent, 0 if not.  (Note that the\n        returned values are intended to be used to increment a reference\n        count, so don't think you can \"clean up\" this function by using\n        True and False instead...)\n        \"\"\"\n        wp = self.waiting_parents\n        if node in wp:\n            return 0\n        wp.add(node)\n        return 1\n\n    def postprocess(self):\n        \"\"\"Clean up anything we don't need to hang onto after we've\n        been built.\"\"\"\n        self.executor_cleanup()\n        self.waiting_parents = set()\n\n    def clear(self):\n        \"\"\"Completely clear a Node of all its cached state (so that it\n        can be re-evaluated by interfaces that do continuous integration\n        builds).\n        \"\"\"\n        # The del_binfo() call here isn't necessary for normal execution,\n        # but is for interactive mode, where we might rebuild the same\n        # target and need to start from scratch.\n        self.del_binfo()\n        self.clear_memoized_values()\n        self.ninfo = self.new_ninfo()\n        self.executor_cleanup()\n        for attr in ['cachedir_csig', 'cachesig', 'contentsig']:\n            try:\n                delattr(self, attr)\n            except AttributeError:\n                pass\n        self.cached = 0\n        self.includes = None\n\n    def clear_memoized_values(self):\n        self._memo = {}\n\n    def builder_set(self, builder):\n        self.builder = builder\n        try:\n            del self.executor\n        except AttributeError:\n            pass\n\n    def has_builder(self):\n        \"\"\"Return whether this Node has a builder or not.\n\n        In Boolean tests, this turns out to be a *lot* more efficient\n        than simply examining the builder attribute directly (\"if\n        node.builder: ...\"). When the builder attribute is examined\n        directly, it ends up calling __getattr__ for both the __len__\n        and __bool__ attributes on instances of our Builder Proxy\n        class(es), generating a bazillion extra calls and slowing\n        things down immensely.\n        \"\"\"\n        try:\n            b = self.builder\n        except AttributeError:\n            # There was no explicit builder for this Node, so initialize\n            # the self.builder attribute to None now.\n            b = self.builder = None\n        return b is not None\n\n    def set_explicit(self, is_explicit):\n        self.is_explicit = is_explicit\n\n    def has_explicit_builder(self):\n        \"\"\"Return whether this Node has an explicit builder\n\n        This allows an internal Builder created by SCons to be marked\n        non-explicit, so that it can be overridden by an explicit\n        builder that the user supplies (the canonical example being\n        directories).\"\"\"\n        try:\n            return self.is_explicit\n        except AttributeError:\n            self.is_explicit = None\n            return self.is_explicit\n\n    def get_builder(self, default_builder=None):\n        \"\"\"Return the set builder, or a specified default value\"\"\"\n        try:\n            return self.builder\n        except AttributeError:\n            return default_builder\n\n    multiple_side_effect_has_builder = has_builder\n\n    def is_derived(self):\n        \"\"\"\n        Returns true if this node is derived (i.e. built).\n\n        This should return true only for nodes whose path should be in\n        the variant directory when duplicate=0 and should contribute their build\n        signatures when they are used as source files to other derived files. For\n        example: source with source builders are not derived in this sense,\n        and hence should not return true.\n        \"\"\"\n        return _is_derived_map[self._func_is_derived](self)\n\n    def is_sconscript(self):\n        \"\"\" Returns true if this node is an sconscript \"\"\"\n        return self in SConscriptNodes\n\n    def is_conftest(self):\n        \"\"\" Returns true if this node is an conftest node\"\"\"\n        try:\n            self.attributes.conftest_node\n        except AttributeError:\n            return False\n        return True\n\n    def check_attributes(self, name):\n        \"\"\" Simple API to check if the node.attributes for name has been set\"\"\"\n        return getattr(getattr(self, \"attributes\", None), name, None)\n\n\n    def alter_targets(self):\n        \"\"\"Return a list of alternate targets for this Node.\n        \"\"\"\n        return [], None\n\n    def get_found_includes(self, env, scanner, path):\n        \"\"\"Return the scanned include lines (implicit dependencies)\n        found in this node.\n\n        The default is no implicit dependencies.  We expect this method\n        to be overridden by any subclass that can be scanned for\n        implicit dependencies.\n        \"\"\"\n        return []\n\n    def get_implicit_deps(self, env, initial_scanner, path_func, kw = {}):\n        \"\"\"Return a list of implicit dependencies for this node.\n\n        This method exists to handle recursive invocation of the scanner\n        on the implicit dependencies returned by the scanner, if the\n        scanner's recursive flag says that we should.\n        \"\"\"\n        nodes = [self]\n        seen = set(nodes)\n        dependencies = []\n        path_memo = {}\n\n        root_node_scanner = self._get_scanner(env, initial_scanner, None, kw)\n\n        while nodes:\n            node = nodes.pop(0)\n\n            scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw)\n            if not scanner:\n                continue\n\n            try:\n                path = path_memo[scanner]\n            except KeyError:\n                path = path_func(scanner)\n                path_memo[scanner] = path\n\n            included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen]\n            if included_deps:\n                dependencies.extend(included_deps)\n                seen.update(included_deps)\n                nodes.extend(scanner.recurse_nodes(included_deps))\n\n        return dependencies\n\n    def _get_scanner(self, env, initial_scanner, root_node_scanner, kw):\n        if initial_scanner:\n            # handle explicit scanner case\n            scanner = initial_scanner.select(self)\n        else:\n            # handle implicit scanner case\n            scanner = self.get_env_scanner(env, kw)\n            if scanner:\n                scanner = scanner.select(self)\n\n        if not scanner:\n            # no scanner could be found for the given node's scanner key;\n            # thus, make an attempt at using a default.\n            scanner = root_node_scanner\n\n        return scanner\n\n    def get_env_scanner(self, env, kw={}):\n        return env.get_scanner(self.scanner_key())\n\n    def get_target_scanner(self):\n        return self.builder.target_scanner\n\n    def get_source_scanner(self, node):\n        \"\"\"Fetch the source scanner for the specified node\n\n        NOTE:  \"self\" is the target being built, \"node\" is\n        the source file for which we want to fetch the scanner.\n\n        Implies self.has_builder() is true; again, expect to only be\n        called from locations where this is already verified.\n\n        This function may be called very often; it attempts to cache\n        the scanner found to improve performance.\n        \"\"\"\n        scanner = None\n        try:\n            scanner = self.builder.source_scanner\n        except AttributeError:\n            pass\n        if not scanner:\n            # The builder didn't have an explicit scanner, so go look up\n            # a scanner from env['SCANNERS'] based on the node's scanner\n            # key (usually the file extension).\n            scanner = self.get_env_scanner(self.get_build_env())\n        if scanner:\n            scanner = scanner.select(node)\n        return scanner\n\n    def add_to_implicit(self, deps):\n        if not hasattr(self, 'implicit') or self.implicit is None:\n            self.implicit = []\n            self.implicit_set = set()\n            self._children_reset()\n        self._add_child(self.implicit, self.implicit_set, deps)\n\n    def scan(self):\n        \"\"\"Scan this node's dependents for implicit dependencies.\"\"\"\n        # Don't bother scanning non-derived files, because we don't\n        # care what their dependencies are.\n        # Don't scan again, if we already have scanned.\n        if self.implicit is not None:\n            return\n        self.implicit = []\n        self.implicit_set = set()\n        self._children_reset()\n        if not self.has_builder():\n            return\n\n        build_env = self.get_build_env()\n        executor = self.get_executor()\n\n        # Here's where we implement --implicit-cache.\n        if implicit_cache and not implicit_deps_changed:\n            implicit = self.get_stored_implicit()\n            if implicit is not None:\n                # We now add the implicit dependencies returned from the\n                # stored .sconsign entry to have already been converted\n                # to Nodes for us.  (We used to run them through a\n                # source_factory function here.)\n\n                # Update all of the targets with them.  This\n                # essentially short-circuits an N*M scan of the\n                # sources for each individual target, which is a hell\n                # of a lot more efficient.\n                for tgt in executor.get_all_targets():\n                    tgt.add_to_implicit(implicit)\n\n                if implicit_deps_unchanged or self.is_up_to_date():\n                    return\n                # one of this node's sources has changed,\n                # so we must recalculate the implicit deps for all targets\n                for tgt in executor.get_all_targets():\n                    tgt.implicit = []\n                    tgt.implicit_set = set()\n\n        # Have the executor scan the sources.\n        executor.scan_sources(self.builder.source_scanner)\n\n        # If there's a target scanner, have the executor scan the target\n        # node itself and associated targets that might be built.\n        scanner = self.get_target_scanner()\n        if scanner:\n            executor.scan_targets(scanner)\n\n    def scanner_key(self):\n        return None\n\n    def select_scanner(self, scanner):\n        \"\"\"Selects a scanner for this Node.\n\n        This is a separate method so it can be overridden by Node\n        subclasses (specifically, Node.FS.Dir) that *must* use their\n        own Scanner and don't select one the Scanner.Selector that's\n        configured for the target.\n        \"\"\"\n        return scanner.select(self)\n\n    def env_set(self, env, safe=0):\n        if safe and self.env:\n            return\n        self.env = env\n\n    #\n    # SIGNATURE SUBSYSTEM\n    #\n\n    NodeInfo = NodeInfoBase\n    BuildInfo = BuildInfoBase\n\n    def new_ninfo(self):\n        ninfo = self.NodeInfo()\n        return ninfo\n\n    def get_ninfo(self):\n        if self.ninfo is not None:\n            return self.ninfo\n        self.ninfo = self.new_ninfo()\n        return self.ninfo\n\n    def new_binfo(self):\n        binfo = self.BuildInfo()\n        return binfo\n\n    def get_binfo(self):\n        \"\"\"\n        Fetch a node's build information.\n\n        node - the node whose sources will be collected\n        cache - alternate node to use for the signature cache\n        returns - the build signature\n\n        This no longer handles the recursive descent of the\n        node's children's signatures.  We expect that they're\n        already built and updated by someone else, if that's\n        what's wanted.\n        \"\"\"\n        try:\n            return self.binfo\n        except AttributeError:\n            pass\n\n        binfo = self.new_binfo()\n        self.binfo = binfo\n\n        executor = self.get_executor()\n        ignore_set = self.ignore_set\n\n        if self.has_builder():\n            binfo.bact = str(executor)\n            binfo.bactsig = hash_signature(executor.get_contents())\n\n        if self._specific_sources:\n            sources = [s for s in self.sources if s not in ignore_set]\n\n        else:\n            sources = executor.get_unignored_sources(self, self.ignore)\n\n        seen = set()\n        binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)]\n        binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources]\n\n        binfo.bdepends = [d for d in self.depends if d not in ignore_set]\n        binfo.bdependsigs = [d.get_ninfo() for d in self.depends]\n\n        # Because self.implicit is initialized to None (and not empty list [])\n        # we have to handle this case\n        if not self.implicit:\n            binfo.bimplicit = []\n            binfo.bimplicitsigs = []\n        else:\n            binfo.bimplicit = [i for i in self.implicit if i not in ignore_set]\n            binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit]\n\n        return binfo\n\n    def del_binfo(self):\n        \"\"\"Delete the build info from this node.\"\"\"\n        try:\n            delattr(self, 'binfo')\n        except AttributeError:\n            pass\n\n    def get_csig(self):\n        try:\n            return self.ninfo.csig\n        except AttributeError:\n            ninfo = self.get_ninfo()\n            ninfo.csig = hash_signature(self.get_contents())\n            return self.ninfo.csig\n\n    def get_cachedir_csig(self):\n        return self.get_csig()\n\n    def get_stored_info(self):\n        return None\n\n    def get_stored_implicit(self):\n        \"\"\"Fetch the stored implicit dependencies\"\"\"\n        return None\n\n    #\n    #\n    #\n\n    def set_precious(self, precious = 1):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.precious = precious\n\n    def set_pseudo(self, pseudo = True):\n        \"\"\"Set the Node's precious value.\"\"\"\n        self.pseudo = pseudo\n\n    def set_noclean(self, noclean = 1):\n        \"\"\"Set the Node's noclean value.\"\"\"\n        # Make sure noclean is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.noclean = noclean and 1 or 0\n\n    def set_nocache(self, nocache = 1):\n        \"\"\"Set the Node's nocache value.\"\"\"\n        # Make sure nocache is an integer so the --debug=stree\n        # output in Util.py can use it as an index.\n        self.nocache = nocache and 1 or 0\n\n    def set_always_build(self, always_build = 1):\n        \"\"\"Set the Node's always_build value.\"\"\"\n        self.always_build = always_build\n\n    def exists(self):\n        \"\"\"Does this node exists?\"\"\"\n        return _exists_map[self._func_exists](self)\n\n    def rexists(self):\n        \"\"\"Does this node exist locally or in a repository?\"\"\"\n        # There are no repositories by default:\n        return _rexists_map[self._func_rexists](self)\n\n    def get_contents(self):\n        \"\"\"Fetch the contents of the entry.\"\"\"\n        return _get_contents_map[self._func_get_contents](self)\n\n    def missing(self):\n        return not self.is_derived() and \\\n               not self.linked and \\\n               not self.rexists()\n\n    def remove(self):\n        \"\"\"Remove this Node:  no-op by default.\"\"\"\n        return None\n\n    def add_dependency(self, depend):\n        \"\"\"Adds dependencies.\"\"\"\n        try:\n            self._add_child(self.depends, self.depends_set, depend)\n        except TypeError as e:\n            e = e.args[0]\n            if is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node dependency to %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_prerequisite(self, prerequisite):\n        \"\"\"Adds prerequisites\"\"\"\n        if self.prerequisites is None:\n            self.prerequisites = UniqueList()\n        self.prerequisites.extend(prerequisite)\n        self._children_reset()\n\n    def add_ignore(self, depend):\n        \"\"\"Adds dependencies to ignore.\"\"\"\n        try:\n            self._add_child(self.ignore, self.ignore_set, depend)\n        except TypeError as e:\n            e = e.args[0]\n            if is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to ignore a non-Node dependency of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def add_source(self, source):\n        \"\"\"Adds sources.\"\"\"\n        if self._specific_sources:\n            return\n        try:\n            self._add_child(self.sources, self.sources_set, source)\n        except TypeError as e:\n            e = e.args[0]\n            if is_List(e):\n                s = list(map(str, e))\n            else:\n                s = str(e)\n            raise SCons.Errors.UserError(\"attempted to add a non-Node as source of %s:\\n\\t%s is a %s, not a Node\" % (str(self), s, type(e)))\n\n    def _add_child(self, collection, set, child):\n        \"\"\"Adds 'child' to 'collection', first checking 'set' to see if it's\n        already present.\"\"\"\n        added = None\n        for c in child:\n            if c not in set:\n                set.add(c)\n                collection.append(c)\n                added = 1\n        if added:\n            self._children_reset()\n\n    def set_specific_source(self, source):\n        self.add_source(source)\n        self._specific_sources = True\n\n    def add_wkid(self, wkid):\n        \"\"\"Add a node to the list of kids waiting to be evaluated\"\"\"\n        if self.wkids is not None:\n            self.wkids.append(wkid)\n\n    def _children_reset(self):\n        self.clear_memoized_values()\n        # We need to let the Executor clear out any calculated\n        # build info that it's cached so we can re-calculate it.\n        self.executor_cleanup()\n\n    @SCons.Memoize.CountMethodCall\n    def _children_get(self):\n        try:\n            return self._memo['_children_get']\n        except KeyError:\n            pass\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        if self.ignore_set:\n            iter = chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f])\n\n            children = []\n            for i in iter:\n                if i not in self.ignore_set:\n                    children.append(i)\n        else:\n            children = self.all_children(scan=0)\n\n        self._memo['_children_get'] = children\n        return children\n\n    def all_children(self, scan=1):\n        \"\"\"Return a list of all the node's direct children.\"\"\"\n        if scan:\n            self.scan()\n\n        # The return list may contain duplicate Nodes, especially in\n        # source trees where there are a lot of repeated #includes\n        # of a tangle of .h files.  Profiling shows, however, that\n        # eliminating the duplicates with a brute-force approach that\n        # preserves the order (that is, something like:\n        #\n        #       u = []\n        #       for n in list:\n        #           if n not in u:\n        #               u.append(n)\"\n        #\n        # takes more cycles than just letting the underlying methods\n        # hand back cached values if a Node's information is requested\n        # multiple times.  (Other methods of removing duplicates, like\n        # using dictionary keys, lose the order, and the only ordered\n        # dictionary patterns I found all ended up using \"not in\"\n        # internally anyway...)\n        return list(chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f]))\n\n    def children(self, scan=1):\n        \"\"\"Return a list of the node's direct children, minus those\n        that are ignored by this node.\"\"\"\n        if scan:\n            self.scan()\n        return self._children_get()\n\n    def set_state(self, state):\n        self.state = state\n\n    def get_state(self):\n        return self.state\n\n    def get_env(self):\n        env = self.env\n        if not env:\n            import SCons.Defaults\n            env = SCons.Defaults.DefaultEnvironment()\n        return env\n\n    def Decider(self, function):\n        foundkey = None\n        for k, v in _decider_map.items():\n            if v == function:\n                foundkey = k\n                break\n        if not foundkey:\n            foundkey = len(_decider_map)\n            _decider_map[foundkey] = function\n        self.changed_since_last_build = foundkey\n\n    def Tag(self, key, value):\n        \"\"\" Add a user-defined tag. \"\"\"\n        if not self._tags:\n            self._tags = {}\n        self._tags[key] = value\n\n    def GetTag(self, key):\n        \"\"\" Return a user-defined tag. \"\"\"\n        if not self._tags:\n            return None\n        return self._tags.get(key, None)\n\n    def changed(self, node=None, allowcache=False):\n        \"\"\"\n        Returns if the node is up-to-date with respect to the BuildInfo\n        stored last time it was built.  The default behavior is to compare\n        it against our own previously stored BuildInfo, but the stored\n        BuildInfo from another Node (typically one in a Repository)\n        can be used instead.\n\n        Note that we now *always* check every dependency.  We used to\n        short-circuit the check by returning as soon as we detected\n        any difference, but we now rely on checking every dependency\n        to make sure that any necessary Node information (for example,\n        the content signature of an #included .h file) is updated.\n\n        The allowcache option was added for supporting the early\n        release of the executor/builder structures, right after\n        a File target was built. When set to true, the return\n        value of this changed method gets cached for File nodes.\n        Like this, the executor isn't needed any longer for subsequent\n        calls to changed().\n\n        @see: FS.File.changed(), FS.File.release_target_info()\n        \"\"\"\n        t = 0\n        if t: Trace('changed(%s [%s], %s)' % (self, classname(self), node))\n        if node is None:\n            node = self\n\n        result = False\n\n        bi = node.get_stored_info().binfo\n        then = bi.bsourcesigs + bi.bdependsigs + bi.bimplicitsigs\n        children = self.children()\n\n        diff = len(children) - len(then)\n        if diff:\n            # The old and new dependency lists are different lengths.\n            # This always indicates that the Node must be rebuilt.\n            # We also extend the old dependency list with enough None\n            # entries to equal the new dependency list, for the benefit\n            # of the loop below that updates node information.\n            then.extend([None] * diff)\n            if t: Trace(': old %s new %s' % (len(then), len(children)))\n            result = True\n\n        for child, prev_ni in zip(children, then):\n            if _decider_map[child.changed_since_last_build](child, self, prev_ni, node):\n                if t: Trace(': %s changed' % child)\n                result = True\n\n        if self.has_builder():\n            contents = self.get_executor().get_contents()\n            newsig = hash_signature(contents)\n            if bi.bactsig != newsig:\n                if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig))\n                result = True\n\n        if not result:\n            if t: Trace(': up to date')\n\n        if t: Trace('\\n')\n\n        return result\n\n    def is_up_to_date(self):\n        \"\"\"Default check for whether the Node is current: unknown Node\n        subtypes are always out of date, so they will always get built.\"\"\"\n        return None\n\n    def children_are_up_to_date(self):\n        \"\"\"Alternate check for whether the Node is current:  If all of\n        our children were up-to-date, then this Node was up-to-date, too.\n\n        The SCons.Node.Alias and SCons.Node.Python.Value subclasses\n        rebind their current() method to this method.\"\"\"\n        # Allow the children to calculate their signatures.\n        self.binfo = self.get_binfo()\n        if self.always_build:\n            return None\n        state = 0\n        for kid in self.children(None):\n            s = kid.get_state()\n            if s and (not state or s > state):\n                state = s\n        return (state == 0 or state == SCons.Node.up_to_date)\n\n    def is_literal(self):\n        \"\"\"Always pass the string representation of a Node to\n        the command interpreter literally.\"\"\"\n        return 1\n\n    def render_include_tree(self):\n        \"\"\"\n        Return a text representation, suitable for displaying to the\n        user, of the include tree for the sources of this node.\n        \"\"\"\n        if self.is_derived():\n            env = self.get_build_env()\n            if env:\n                for s in self.sources:\n                    scanner = self.get_source_scanner(s)\n                    if scanner:\n                        path = self.get_build_scanner_path(scanner)\n                    else:\n                        path = None\n                    def f(node, env=env, scanner=scanner, path=path):\n                        return node.get_found_includes(env, scanner, path)\n                    return render_tree(s, f, 1)\n        else:\n            return None\n\n    def get_abspath(self):\n        \"\"\"\n        Return an absolute path to the Node.  This will return simply\n        str(Node) by default, but for Node types that have a concept of\n        relative path, this might return something different.\n        \"\"\"\n        return str(self)\n\n    def for_signature(self):\n        \"\"\"\n        Return a string representation of the Node that will always\n        be the same for this particular Node, no matter what.  This\n        is by contrast to the __str__() method, which might, for\n        instance, return a relative path for a file Node.  The purpose\n        of this method is to generate a value to be used in signature\n        calculation for the command line used to build a target, and\n        we use this method instead of str() to avoid unnecessary\n        rebuilds.  This method does not need to return something that\n        would actually work in a command line; it can return any kind of\n        nonsense, so long as it does not change.\n        \"\"\"\n        return str(self)\n\n    def get_string(self, for_signature):\n        \"\"\"This is a convenience function designed primarily to be\n        used in command generators (i.e., CommandGeneratorActions or\n        Environment variables that are callable), which are called\n        with a for_signature argument that is nonzero if the command\n        generator is being called to generate a signature for the\n        command line, which determines if we should rebuild or not.\n\n        Such command generators should use this method in preference\n        to str(Node) when converting a Node to a string, passing\n        in the for_signature parameter, such that we will call\n        Node.for_signature() or str(Node) properly, depending on whether\n        we are calculating a signature or actually constructing a\n        command line.\"\"\"\n        if for_signature:\n            return self.for_signature()\n        return str(self)\n\n    def get_subst_proxy(self):\n        \"\"\"\n        This method is expected to return an object that will function\n        exactly like this Node, except that it implements any additional\n        special features that we would like to be in effect for\n        Environment variable substitution.  The principle use is that\n        some Nodes would like to implement a __getattr__() method,\n        but putting that in the Node type itself has a tendency to kill\n        performance.  We instead put it in a proxy and return it from\n        this method.  It is legal for this method to return self\n        if no new functionality is needed for Environment substitution.\n        \"\"\"\n        return self\n\n    def explain(self):\n        if not self.exists():\n            return \"building `%s' because it doesn't exist\\n\" % self\n\n        if self.always_build:\n            return \"rebuilding `%s' because AlwaysBuild() is specified\\n\" % self\n\n        old = self.get_stored_info()\n        if old is None:\n            return None\n\n        old = old.binfo\n        old.prepare_dependencies()\n\n        try:\n            old_bkids    = old.bsources    + old.bdepends    + old.bimplicit\n            old_bkidsigs = old.bsourcesigs + old.bdependsigs + old.bimplicitsigs\n        except AttributeError:\n            return \"Cannot explain why `%s' is being rebuilt: No previous build information found\\n\" % self\n\n        new = self.get_binfo()\n\n        new_bkids    = new.bsources    + new.bdepends    + new.bimplicit\n        new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs\n\n        osig = dict(list(zip(old_bkids, old_bkidsigs)))\n        nsig = dict(list(zip(new_bkids, new_bkidsigs)))\n\n        # The sources and dependencies we'll want to report are all stored\n        # as relative paths to this target's directory, but we want to\n        # report them relative to the top-level SConstruct directory,\n        # so we only print them after running them through this lambda\n        # to turn them into the right relative Node and then return\n        # its string.\n        def stringify( s, E=self.dir.Entry):\n            if hasattr( s, 'dir' ) :\n                return str(E(s))\n            return str(s)\n\n        lines = []\n\n        removed = [x for x in old_bkids if x not in new_bkids]\n        if removed:\n            removed = [stringify(r) for r in removed]\n            fmt = \"`%s' is no longer a dependency\\n\"\n            lines.extend([fmt % s for s in removed])\n\n        for k in new_bkids:\n            if k not in old_bkids:\n                lines.append(\"`%s' is a new dependency\\n\" % stringify(k))\n            else:\n                changed = _decider_map[k.changed_since_last_build](k, self, osig[k])\n\n                if changed:\n                    lines.append(\"`%s' changed\\n\" % stringify(k))\n\n        if len(lines) == 0 and old_bkids != new_bkids:\n            lines.append(\"the dependency order changed:\\n\")\n            lines.append(\"->Sources\\n\")\n            for (o,n) in zip_longest(old.bsources, new.bsources, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n            lines.append(\"->Depends\\n\")\n            for (o,n) in zip_longest(old.bdepends, new.bdepends, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n            lines.append(\"->Implicit\\n\")\n            for (o,n) in zip_longest(old.bimplicit, new.bimplicit, fillvalue=None):\n                lines.append(\"Old:%s\\tNew:%s\\n\"%(o,n))\n\n        if len(lines) == 0:\n            def fmt_with_title(title, strlines):\n                lines = strlines.split('\\n')\n                sep = '\\n' + ' '*(15 + len(title))\n                return ' '*15 + title + sep.join(lines) + '\\n'\n            if old.bactsig != new.bactsig:\n                if old.bact == new.bact:\n                    lines.append(\"the contents of the build action changed\\n\" +\n                                 fmt_with_title('action: ', new.bact))\n\n                    # lines.append(\"the contents of the build action changed [%s] [%s]\\n\"%(old.bactsig,new.bactsig) +\n                    #              fmt_with_title('action: ', new.bact))\n                else:\n                    lines.append(\"the build action changed:\\n\" +\n                                 fmt_with_title('old: ', old.bact) +\n                                 fmt_with_title('new: ', new.bact))\n\n        if len(lines) == 0:\n            return \"rebuilding `%s' for unknown reasons\\n\" % self\n\n        preamble = \"rebuilding `%s' because\" % self\n        if len(lines) == 1:\n            return \"%s %s\"  % (preamble, lines[0])\n        else:\n            lines = [\"%s:\\n\" % preamble] + lines\n            return ( ' '*11).join(lines)\n\nclass NodeList(collections.UserList):\n    def __str__(self):\n        return str(list(map(str, self.data)))\n\ndef get_children(node, parent): return node.children()\ndef ignore_cycle(node, stack): pass\ndef do_nothing(node, parent): pass\n\nclass Walker:\n    \"\"\"An iterator for walking a Node tree.\n\n    This is depth-first, children are visited before the parent.\n    The Walker object can be initialized with any node, and\n    returns the next node on the descent with each get_next() call.\n    get the children of a node instead of calling 'children'.\n    'cycle_func' is an optional function that will be called\n    when a cycle is detected.\n\n    This class does not get caught in node cycles caused, for example,\n    by C header file include loops.\n    \"\"\"\n    def __init__(self, node, kids_func=get_children,\n                             cycle_func=ignore_cycle,\n                             eval_func=do_nothing):\n        self.kids_func = kids_func\n        self.cycle_func = cycle_func\n        self.eval_func = eval_func\n        node.wkids = copy.copy(kids_func(node, None))\n        self.stack = [node]\n        self.history = {} # used to efficiently detect and avoid cycles\n        self.history[node] = None\n\n    def get_next(self):\n        \"\"\"Return the next node for this walk of the tree.\n\n        This function is intentionally iterative, not recursive,\n        to sidestep any issues of stack size limitations.\n        \"\"\"\n\n        while self.stack:\n            if self.stack[-1].wkids:\n                node = self.stack[-1].wkids.pop(0)\n                if not self.stack[-1].wkids:\n                    self.stack[-1].wkids = None\n                if node in self.history:\n                    self.cycle_func(node, self.stack)\n                else:\n                    node.wkids = copy.copy(self.kids_func(node, self.stack[-1]))\n                    self.stack.append(node)\n                    self.history[node] = None\n            else:\n                node = self.stack.pop()\n                del self.history[node]\n                if node:\n                    if self.stack:\n                        parent = self.stack[-1]\n                    else:\n                        parent = None\n                    self.eval_func(node, parent)\n                return node\n        return None\n\n    def is_done(self):\n        return not self.stack\n\n\narg2nodes_lookups = []\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Handle lists of directory paths.\n\nThese are the path lists that get set as CPPPATH, LIBPATH,\netc.) with as much caching of data and efficiency as we can, while\nstill keeping the evaluation delayed so that we Do the Right Thing\n(almost) regardless of how the variable is specified.\n\"\"\"\n\nimport os\n\nimport SCons.Memoize\nimport SCons.Node\nimport SCons.Util\n\n#\n# Variables to specify the different types of entries in a PathList object:\n#\n\nTYPE_STRING_NO_SUBST = 0        # string with no '$'\nTYPE_STRING_SUBST = 1           # string containing '$'\nTYPE_OBJECT = 2                 # other object\n\ndef node_conv(obj):\n    \"\"\"\n    This is the \"string conversion\" routine that we have our substitutions\n    use to return Nodes, not strings.  This relies on the fact that an\n    EntryProxy object has a get() method that returns the underlying\n    Node that it wraps, which is a bit of architectural dependence\n    that we might need to break or modify in the future in response to\n    additional requirements.\n    \"\"\"\n    try:\n        get = obj.get\n    except AttributeError:\n        if isinstance(obj, SCons.Node.Node) or SCons.Util.is_Sequence( obj ):\n            result = obj\n        else:\n            result = str(obj)\n    else:\n        result = get()\n    return result\n\nclass _PathList:\n    \"\"\"\n    An actual PathList object.\n    \"\"\"\n    def __init__(self, pathlist):\n        \"\"\"\n        Initializes a PathList object, canonicalizing the input and\n        pre-processing it for quicker substitution later.\n\n        The stored representation of the PathList is a list of tuples\n        containing (type, value), where the \"type\" is one of the TYPE_*\n        variables defined above.  We distinguish between:\n\n            strings that contain no '$' and therefore need no\n            delayed-evaluation string substitution (we expect that there\n            will be many of these and that we therefore get a pretty\n            big win from avoiding string substitution)\n\n            strings that contain '$' and therefore need substitution\n            (the hard case is things like '${TARGET.dir}/include',\n            which require re-evaluation for every target + source)\n\n            other objects (which may be something like an EntryProxy\n            that needs a method called to return a Node)\n\n        Pre-identifying the type of each element in the PathList up-front\n        and storing the type in the list of tuples is intended to reduce\n        the amount of calculation when we actually do the substitution\n        over and over for each target.\n        \"\"\"\n        if SCons.Util.is_String(pathlist):\n            pathlist = pathlist.split(os.pathsep)\n        elif not SCons.Util.is_Sequence(pathlist):\n            pathlist = [pathlist]\n\n        pl = []\n        for p in pathlist:\n            try:\n                found = '$' in p\n            except (AttributeError, TypeError):\n                type = TYPE_OBJECT\n            else:\n                if not found:\n                    type = TYPE_STRING_NO_SUBST\n                else:\n                    type = TYPE_STRING_SUBST\n            pl.append((type, p))\n\n        self.pathlist = tuple(pl)\n\n    def __len__(self): return len(self.pathlist)\n\n    def __getitem__(self, i): return self.pathlist[i]\n\n    def subst_path(self, env, target, source):\n        \"\"\"\n        Performs construction variable substitution on a pre-digested\n        PathList for a specific target and source.\n        \"\"\"\n        result = []\n        for type, value in self.pathlist:\n            if type == TYPE_STRING_SUBST:\n                value = env.subst(value, target=target, source=source,\n                                  conv=node_conv)\n                if SCons.Util.is_Sequence(value):\n                    result.extend(SCons.Util.flatten(value))\n                elif value:\n                    result.append(value)\n            elif type == TYPE_OBJECT:\n                value = node_conv(value)\n                if value:\n                    result.append(value)\n            elif value:\n                result.append(value)\n        return tuple(result)\n\n\nclass PathListCache:\n    \"\"\"\n    A class to handle caching of PathList lookups.\n\n    This class gets instantiated once and then deleted from the namespace,\n    so it's used as a Singleton (although we don't enforce that in the\n    usual Pythonic ways).  We could have just made the cache a dictionary\n    in the module namespace, but putting it in this class allows us to\n    use the same Memoizer pattern that we use elsewhere to count cache\n    hits and misses, which is very valuable.\n\n    Lookup keys in the cache are computed by the _PathList_key() method.\n    Cache lookup should be quick, so we don't spend cycles canonicalizing\n    all forms of the same lookup key.  For example, 'x:y' and ['x',\n    'y'] logically represent the same list, but we don't bother to\n    split string representations and treat those two equivalently.\n    (Note, however, that we do, treat lists and tuples the same.)\n\n    The main type of duplication we're trying to catch will come from\n    looking up the same path list from two different clones of the\n    same construction environment.  That is, given\n    \n        env2 = env1.Clone()\n\n    both env1 and env2 will have the same CPPPATH value, and we can\n    cheaply avoid re-parsing both values of CPPPATH by using the\n    common value from this cache.\n    \"\"\"\n    def __init__(self):\n        self._memo = {}\n\n    def _PathList_key(self, pathlist):\n        \"\"\"\n        Returns the key for memoization of PathLists.\n\n        Note that we want this to be pretty quick, so we don't completely\n        canonicalize all forms of the same list.  For example,\n        'dir1:$ROOT/dir2' and ['$ROOT/dir1', 'dir'] may logically\n        represent the same list if you're executing from $ROOT, but\n        we're not going to bother splitting strings into path elements,\n        or massaging strings into Nodes, to identify that equivalence.\n        We just want to eliminate obvious redundancy from the normal\n        case of re-using exactly the same cloned value for a path.\n        \"\"\"\n        if SCons.Util.is_Sequence(pathlist):\n            pathlist = tuple(SCons.Util.flatten(pathlist))\n        return pathlist\n\n    @SCons.Memoize.CountDictCall(_PathList_key)\n    def PathList(self, pathlist):\n        \"\"\"\n        Returns the cached _PathList object for the specified pathlist,\n        creating and caching a new object as necessary.\n        \"\"\"\n        pathlist = self._PathList_key(pathlist)\n        try:\n            memo_dict = self._memo['PathList']\n        except KeyError:\n            memo_dict = {}\n            self._memo['PathList'] = memo_dict\n        else:\n            try:\n                return memo_dict[pathlist]\n            except KeyError:\n                pass\n\n        result = _PathList(pathlist)\n\n        memo_dict[pathlist] = result\n\n        return result\n\nPathList = PathListCache().PathList\n\n\ndel PathListCache\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons platform selection.\n\nLooks for modules that define a callable object that can modify a\nconstruction environment as appropriate for a given platform.\n\nNote that we take a more simplistic view of \"platform\" than Python does.\nWe're looking for a single string that determines a set of\ntool-independent variables with which to initialize a construction\nenvironment.  Consequently, we'll examine both sys.platform and os.name\n(and anything else that might come in to play) in order to return some\nspecification which is unique enough for our purposes.\n\nNote that because this subsystem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"platform specification\" in an arbitrary callable function.\nNo one needs to use or tie in to this subsystem in order to roll\ntheir own platform definition.\n\"\"\"\n\nimport SCons.compat\n\nimport importlib\nimport os\nimport sys\nimport tempfile\n\nimport SCons.Errors\nimport SCons.Subst\nimport SCons.Tool\n\n\ndef platform_default():\n    r\"\"\"Return the platform string for our execution environment.\n\n    The returned value should map to one of the SCons/Platform/\\*.py\n    files.  Since scons is architecture independent, though, we don't\n    care about the machine architecture.\n    \"\"\"\n    osname = os.name\n    if osname == 'java':\n        osname = os._osType\n    if osname == 'posix':\n        if sys.platform == 'cygwin':\n            return 'cygwin'\n        elif sys.platform.find('irix') != -1:\n            return 'irix'\n        elif sys.platform.find('sunos') != -1:\n            return 'sunos'\n        elif sys.platform.find('hp-ux') != -1:\n            return 'hpux'\n        elif sys.platform.find('aix') != -1:\n            return 'aix'\n        elif sys.platform.find('darwin') != -1:\n            return 'darwin'\n        else:\n            return 'posix'\n    elif os.name == 'os2':\n        return 'os2'\n    else:\n        return sys.platform\n\n\ndef platform_module(name = platform_default()):\n    \"\"\"Return the imported module for the platform.\n\n    This looks for a module name that matches the specified argument.\n    If the name is unspecified, we fetch the appropriate default for\n    our execution environment.\n    \"\"\"\n    full_name = 'SCons.Platform.' + name\n    if full_name not in sys.modules:\n        if os.name == 'java':\n            eval(full_name)\n        else:\n            try:\n                # the specific platform module is a relative import\n                mod = importlib.import_module(\".\" + name, __name__)\n            except ImportError:\n                try:\n                    import zipimport\n                    importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] )\n                    mod = importer.load_module(full_name)\n                except ImportError:\n                    raise SCons.Errors.UserError(\"No platform named '%s'\" % name)\n            setattr(SCons.Platform, name, mod)\n    return sys.modules[full_name]\n\n\ndef DefaultToolList(platform, env):\n    \"\"\"Select a default tool list for the specified platform.\n    \"\"\"\n    return SCons.Tool.tool_list(platform, env)\n\n\nclass PlatformSpec:\n    def __init__(self, name, generate):\n        self.name = name\n        self.generate = generate\n\n    def __call__(self, *args, **kw):\n        return self.generate(*args, **kw)\n\n    def __str__(self):\n        return self.name\n\n\nclass TempFileMunge:\n    \"\"\"Convert long command lines to use a temporary file.\n\n    You can set an Environment variable (usually ``TEMPFILE``) to this,\n    then call it with a string argument, and it will perform temporary\n    file substitution on it.  This is used to circumvent limitations on\n    the length of command lines. Example::\n\n        env[\"TEMPFILE\"] = TempFileMunge\n        env[\"LINKCOM\"] = \"${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}\"\n\n    By default, the name of the temporary file used begins with a\n    prefix of '@'.  This may be configured for other tool chains by\n    setting the ``TEMPFILEPREFIX`` variable. Example::\n\n        env[\"TEMPFILEPREFIX\"] = '-@'        # diab compiler\n        env[\"TEMPFILEPREFIX\"] = '-via'      # arm tool chain\n        env[\"TEMPFILEPREFIX\"] = ''          # (the empty string) PC Lint\n\n    You can configure the extension of the temporary file through the\n    ``TEMPFILESUFFIX`` variable, which defaults to '.lnk' (see comments\n    in the code below). Example::\n\n        env[\"TEMPFILESUFFIX\"] = '.lnt'   # PC Lint\n\n    Entries in the temporary file are separated by the value of the\n    ``TEMPFILEARGJOIN`` variable, which defaults to an OS-appropriate value.\n\n    A default argument escape function is ``SCons.Subst.quote_spaces``.\n    If you need to apply extra operations on a command argument before\n    writing to a temporary file(fix Windows slashes, normalize paths, etc.),\n    please set `TEMPFILEARGESCFUNC` variable to a custom function. Example::\n\n        import sys\n        import re\n        from SCons.Subst import quote_spaces\n\n        WINPATHSEP_RE = re.compile(r\"\\\\([^\\\"'\\\\]|$)\")\n\n\n        def tempfile_arg_esc_func(arg):\n            arg = quote_spaces(arg)\n            if sys.platform != \"win32\":\n                return arg\n            # GCC requires double Windows slashes, let's use UNIX separator\n            return WINPATHSEP_RE.sub(r\"/\\1\", arg)\n\n\n        env[\"TEMPFILEARGESCFUNC\"] = tempfile_arg_esc_func\n\n    \"\"\"\n    def __init__(self, cmd, cmdstr = None):\n        self.cmd = cmd\n        self.cmdstr = cmdstr\n\n    def __call__(self, target, source, env, for_signature):\n        if for_signature:\n            # If we're being called for signature calculation, it's\n            # because we're being called by the string expansion in\n            # Subst.py, which has the logic to strip any $( $) that\n            # may be in the command line we squirreled away.  So we\n            # just return the raw command line and let the upper\n            # string substitution layers do their thing.\n            return self.cmd\n\n        # Now we're actually being called because someone is actually\n        # going to try to execute the command, so we have to do our\n        # own expansion.\n        cmd = env.subst_list(self.cmd, SCons.Subst.SUBST_CMD, target, source)[0]\n        try:\n            maxline = int(env.subst('$MAXLINELENGTH'))\n        except ValueError:\n            maxline = 2048\n\n        length = 0\n        for c in cmd:\n            length += len(c)\n        length += len(cmd) - 1\n        if length <= maxline:\n            return self.cmd\n\n        # Check if we already created the temporary file for this target\n        # It should have been previously done by Action.strfunction() call\n        if SCons.Util.is_List(target):\n            node = target[0]\n        else:\n            node = target\n\n        cmdlist = None\n\n        if SCons.Util.is_List(self.cmd):\n            cmdlist_key = tuple(self.cmd)\n        else:\n            cmdlist_key = self.cmd\n\n        if node and hasattr(node.attributes, 'tempfile_cmdlist'):\n            cmdlist = node.attributes.tempfile_cmdlist.get(cmdlist_key, None)\n        if cmdlist is not None:\n            return cmdlist\n\n        # Default to the .lnk suffix for the benefit of the Phar Lap\n        # linkloc linker, which likes to append an .lnk suffix if\n        # none is given.\n        if 'TEMPFILESUFFIX' in env:\n            suffix = env.subst('$TEMPFILESUFFIX')\n        else:\n            suffix = '.lnk'\n\n        if 'TEMPFILEDIR' in env:\n            tempfile_dir = env.subst('$TEMPFILEDIR')\n            os.makedirs(tempfile_dir, exist_ok=True)\n        else:\n            tempfile_dir = None\n\n        fd, tmp = tempfile.mkstemp(suffix, dir=tempfile_dir, text=True)\n        native_tmp = SCons.Util.get_native_path(tmp)\n\n        if env.get('SHELL', None) == 'sh':\n            # The sh shell will try to escape the backslashes in the\n            # path, so unescape them.\n            native_tmp = native_tmp.replace('\\\\', r'\\\\\\\\')\n            # In Cygwin, we want to use rm to delete the temporary\n            # file, because del does not exist in the sh shell.\n            rm = env.Detect('rm') or 'del'\n        else:\n            # Don't use 'rm' if the shell is not sh, because rm won't\n            # work with the Windows shells (cmd.exe or command.com) or\n            # Windows path names.\n            rm = 'del'\n\n        if 'TEMPFILEPREFIX' in env:\n            prefix = env.subst('$TEMPFILEPREFIX')\n        else:\n            prefix = '@'\n\n        tempfile_esc_func = env.get('TEMPFILEARGESCFUNC', SCons.Subst.quote_spaces)\n        args = [\n            tempfile_esc_func(arg)\n            for arg in cmd[1:]\n        ]\n        join_char = env.get('TEMPFILEARGJOIN', ' ')\n        os.write(fd, bytearray(join_char.join(args) + \"\\n\", 'utf-8'))\n        os.close(fd)\n\n        # XXX Using the SCons.Action.print_actions value directly\n        # like this is bogus, but expedient.  This class should\n        # really be rewritten as an Action that defines the\n        # __call__() and strfunction() methods and lets the\n        # normal action-execution logic handle whether or not to\n        # print/execute the action.  The problem, though, is all\n        # of that is decided before we execute this method as\n        # part of expanding the $TEMPFILE construction variable.\n        # Consequently, refactoring this will have to wait until\n        # we get more flexible with allowing Actions to exist\n        # independently and get strung together arbitrarily like\n        # Ant tasks.  In the meantime, it's going to be more\n        # user-friendly to not let obsession with architectural\n        # purity get in the way of just being helpful, so we'll\n        # reach into SCons.Action directly.\n        if SCons.Action.print_actions:\n            cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,\n                               source) if self.cmdstr is not None else ''\n            # Print our message only if XXXCOMSTR returns an empty string\n            if len(cmdstr) == 0 :\n                cmdstr = (\"Using tempfile \"+native_tmp+\" for command line:\\n\"+\n                    str(cmd[0]) + \" \" + \" \".join(args))\n                self._print_cmd_str(target, source, env, cmdstr)\n\n        cmdlist = [cmd[0], prefix + native_tmp + '\\n' + rm, native_tmp]\n\n        # Store the temporary file command list into the target Node.attributes\n        # to avoid creating two temporary files one for print and one for execute.\n        if node is not None:\n            try:\n                # Storing in tempfile_cmdlist by self.cmd provided when intializing\n                # $TEMPFILE{} fixes issue raised in PR #3140 and #3553\n                node.attributes.tempfile_cmdlist[cmdlist_key] = cmdlist\n            except AttributeError:\n                node.attributes.tempfile_cmdlist = {cmdlist_key: cmdlist}\n\n        return cmdlist\n\n    def _print_cmd_str(self, target, source, env, cmdstr):\n        # check if the user has specified a cmd line print function\n        print_func = None\n        try:\n            get = env.get\n        except AttributeError:\n            pass\n        else:\n            print_func = get('PRINT_CMD_LINE_FUNC')\n\n        # use the default action cmd line print if user did not supply one\n        if not print_func:\n            action = SCons.Action._ActionAction()\n            action.print_cmd_line(cmdstr, target, source, env)\n        else:\n            print_func(cmdstr, target, source, env)\n\n\ndef Platform(name = platform_default()):\n    \"\"\"Select a canned Platform specification.\n    \"\"\"\n    module = platform_module(name)\n    spec = PlatformSpec(name, module.generate)\n    return spec\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for IBM AIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nimport subprocess\n\nfrom . import posix\n\nimport SCons.Util\nimport SCons.Action\n\ndef get_xlc(env, xlc=None, packages=[]):\n    # Use the AIX package installer tool lslpp to figure out where a\n    # given xl* compiler is installed and what version it is.\n    xlcPath = None\n    xlcVersion = None\n\n    if xlc is None:\n        xlc = env.get('CC', 'xlc')\n    if SCons.Util.is_List(xlc):\n        xlc = xlc[0]\n    for package in packages:\n        # find the installed filename, which may be a symlink as well\n        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],\n                stdin = 'devnull',\n                stderr = 'devnull',\n                universal_newlines=True,\n                stdout = subprocess.PIPE)\n        # output of lslpp is something like this:\n        #     #Path:Fileset:File\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp\n        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc\n        for line in pipe.stdout:\n            if xlcPath:\n                continue # read everything to let lslpp terminate\n            fileset, filename = line.split(':')[1:3]\n            filename = filename.split()[0]\n            if ('/' in xlc and filename == xlc) \\\n            or ('/' not in xlc and filename.endswith('/' + xlc)):\n                xlcVersion = fileset.split()[1]\n                xlcPath, sep, xlc = filename.rpartition('/')\n    return (xlcPath, xlc, xlcVersion)\n\ndef generate(env):\n    posix.generate(env)\n    #Based on AIX 5.2: ARG_MAX=24576 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 21576\n    env['SHLIBSUFFIX'] = '.a'\n    env['HOST_OS'] = 'aix'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for Cygwin systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nimport sys\n\nfrom . import posix\nfrom SCons.Platform import TempFileMunge\n\nCYGWIN_DEFAULT_PATHS = []\nif sys.platform == 'win32':\n    CYGWIN_DEFAULT_PATHS = [\n        r'C:\\cygwin64\\bin',\n        r'C:\\cygwin\\bin'\n    ]\n\ndef generate(env):\n    posix.generate(env)\n\n    env['PROGPREFIX']  = ''\n    env['PROGSUFFIX']  = '.exe'\n    env['SHLIBPREFIX'] = ''\n    env['SHLIBSUFFIX'] = '.dll'\n    env['LIBPREFIXES'] = [ '$LIBPREFIX', '$SHLIBPREFIX', '$IMPLIBPREFIX' ]\n    env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX', '$IMPLIBSUFFIX' ]\n    env['TEMPFILE']    = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n    env['HOST_OS'] = 'cygwin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for Mac OS X systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nfrom . import posix\nimport os\n\ndef generate(env):\n    posix.generate(env)\n    env['SHLIBSUFFIX'] = '.dylib'\n    env['HOST_OS'] = 'darwin'\n    # put macports paths at front to override Apple's versions, fink path is after\n    # For now let people who want Macports or Fink tools specify it!\n    # env['ENV']['PATH'] = '/opt/local/bin:/opt/local/sbin:' + env['ENV']['PATH'] + ':/sw/bin'\n    \n    # Store extra system paths in env['ENV']['PATHOSX']\n    \n    filelist = ['/etc/paths',]\n    # make sure this works on Macs with Tiger or earlier\n    try:\n        dirlist = os.listdir('/etc/paths.d')\n    except FileNotFoundError:\n        dirlist = []\n\n    for file in dirlist:\n        filelist.append('/etc/paths.d/'+file)\n\n    for file in filelist:\n        if os.path.isfile(file):\n            with open(file, 'r') as f:\n                lines = f.readlines()\n                for line in lines:\n                    if line:\n                        env.AppendENVPath('PATHOSX', line.strip('\\n'))\n\n    # Not sure why this wasn't the case all along?\n    if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False):\n        env.AppendENVPath('PATH',env['ENV']['PATHOSX'])\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for HP-UX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n    #Based on HP-UX11i: ARG_MAX=2048000 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 2045000\n\n    env['SHLIBSUFFIX'] = '.sl'\n    env['HOST_OS'] = 'hpux'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for SGI IRIX systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n    env['HOST_OS'] = 'irix'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for the MinGW system.\"\"\"\n\nimport sys\n\nMINGW_DEFAULT_PATHS = []\nif sys.platform == 'win32':\n    MINGW_DEFAULT_PATHS = [\n        r'C:\\msys64',\n        r'C:\\msys'\n    ]\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for OS/2 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nfrom . import win32\n\ndef generate(env):\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = '$LIBPREFIX'\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['HOST_OS']        = 'os2'\n    env['HOST_ARCH']      = win32.get_architecture().arch\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nimport platform\nimport subprocess\n\nfrom SCons.Platform import TempFileMunge\nfrom SCons.Platform.virtualenv import ImportVirtualenv\nfrom SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv\n\nexitvalmap = {\n    2 : 127,\n    13 : 126,\n}\n\ndef escape(arg):\n    \"\"\"escape shell special characters\"\"\"\n    slash = '\\\\'\n    special = '\"$'\n\n    arg = arg.replace(slash, slash+slash)\n    for c in special:\n        arg = arg.replace(c, slash+c)\n\n    # print(\"ESCAPE RESULT: %s\" % arg)\n    return '\"' + arg + '\"'\n\n\ndef exec_subprocess(l, env):\n    proc = subprocess.Popen(l, env = env, close_fds = True)\n    return proc.wait()\n\ndef subprocess_spawn(sh, escape, cmd, args, env):\n    return exec_subprocess([sh, '-c', ' '.join(args)], env)\n\ndef exec_popen3(l, env, stdout, stderr):\n    proc = subprocess.Popen(l, env = env, close_fds = True,\n                            stdout = stdout,\n                            stderr = stderr)\n    return proc.wait()\n\ndef piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # spawn using Popen3 combined with the env command\n    # the command name and the command's stdout is written to stdout\n    # the command's stderr is written to stderr\n    return exec_popen3([sh, '-c', ' '.join(args)],\n                       env, stdout, stderr)\n\n\ndef generate(env):\n    # Bearing in mind we have python 2.4 as a baseline, we can just do this:\n    spawn = subprocess_spawn\n    pspawn = piped_env_spawn\n    # Note that this means that 'escape' is no longer used\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n    env['ENV']['PATH']    = '/usr/local/bin:/opt/bin:/bin:/usr/bin:/snap/bin'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.o'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = ''\n    env['LIBPREFIX']      = 'lib'\n    env['LIBSUFFIX']      = '.a'\n    env['SHLIBPREFIX']    = '$LIBPREFIX'\n    env['SHLIBSUFFIX']    = '.so'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]\n    env['HOST_OS']        = 'posix'\n    env['HOST_ARCH']      = platform.machine()\n    env['PSPAWN']         = pspawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = 'sh'\n    env['ESCAPE']         = escape\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion\n    #Note: specific platforms might rise or lower this value\n    env['MAXLINELENGTH']  = 128072\n\n    # This platform supports RPATH specifications.\n    env['__RPATH'] = '$_RPATH'\n\n    # GDC is GCC family, but DMD and LDC have different options.\n    # Must be able to have GCC and DMD work in the same build, so:\n    env['__DRPATH'] = '$_DRPATH'\n\n    if enable_virtualenv and not ignore_virtualenv:\n        ImportVirtualenv(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for Sun systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nfrom . import posix\n\ndef generate(env):\n    posix.generate(env)\n    # Based on sunSparc 8:32bit\n    # ARG_MAX=1048320 - 3000 for environment expansion\n    env['MAXLINELENGTH']  = 1045320\n    env['PKGINFO'] = 'pkginfo'\n    env['PKGCHK'] = '/usr/sbin/pkgchk'\n    env['ENV']['PATH'] = env['ENV']['PATH'] + ':/opt/SUNWspro/bin:/usr/ccs/bin'\n    env['HOST_OS'] = 'sunos'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"'Platform\" support for a Python virtualenv.\"\"\"\n\nimport os\nimport sys\nimport SCons.Util\n\n\nvirtualenv_enabled_by_default = False\n\n\ndef _enable_virtualenv_default():\n    return SCons.Util.get_os_env_bool('SCONS_ENABLE_VIRTUALENV', virtualenv_enabled_by_default)\n\n\ndef _ignore_virtualenv_default():\n    return SCons.Util.get_os_env_bool('SCONS_IGNORE_VIRTUALENV', False)\n\n\nenable_virtualenv = _enable_virtualenv_default()\nignore_virtualenv = _ignore_virtualenv_default()\nvirtualenv_variables = ['VIRTUAL_ENV', 'PIPENV_ACTIVE']\n\n\ndef _running_in_virtualenv():\n    \"\"\"Returns True if scons is executed within a virtualenv\"\"\"\n    # see https://stackoverflow.com/a/42580137\n    return (hasattr(sys, 'real_prefix') or\n            (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))\n\n\ndef _is_path_in(path, base):\n    \"\"\"Returns true if **path** is located under the **base** directory.\"\"\"\n    if not path or not base: # empty path may happen, base too\n        return False\n    rp = os.path.relpath(path, base)\n    return (not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir)\n\n\ndef _inject_venv_variables(env):\n    if 'ENV' not in env:\n        env['ENV'] = {}\n    ENV = env['ENV']\n    for name in virtualenv_variables:\n        try:\n            ENV[name] = os.environ[name]\n        except KeyError:\n            pass\n\ndef _inject_venv_path(env, path_list=None):\n    \"\"\"Modify environment such that SCons will take into account its virtualenv\n    when running external tools.\"\"\"\n    if path_list is None:\n        path_list = os.getenv('PATH')\n    env.PrependENVPath('PATH', select_paths_in_venv(path_list))\n\n\ndef select_paths_in_venv(path_list):\n    \"\"\"Returns a list of paths from **path_list** which are under virtualenv's\n    home directory.\"\"\"\n    if SCons.Util.is_String(path_list):\n        path_list = path_list.split(os.path.pathsep)\n    # Find in path_list the paths under the virtualenv's home\n    return [path for path in path_list if IsInVirtualenv(path)]\n\n\ndef ImportVirtualenv(env):\n    \"\"\"Copies virtualenv-related environment variables from OS environment\n    to ``env['ENV']`` and prepends virtualenv's PATH to ``env['ENV']['PATH']``.\n    \"\"\"\n    _inject_venv_variables(env)\n    _inject_venv_path(env)\n\n\ndef Virtualenv():\n    \"\"\"Returns path to the virtualenv home if scons is executing within a\n    virtualenv or None, if not.\"\"\"\n    if _running_in_virtualenv():\n        return sys.prefix\n    return None\n\n\ndef IsInVirtualenv(path):\n    \"\"\"Returns True, if **path** is under virtualenv's home directory. If not,\n    or if we don't use virtualenv, returns False.\"\"\"\n    return _is_path_in(path, Virtualenv())\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Platform-specific initialization for Win32 systems.\n\nThere normally shouldn't be any need to import this module directly.  It\nwill usually be imported through the generic SCons.Platform.Platform()\nselection method.\n\"\"\"\n\nimport os\nimport os.path\nimport platform\nimport sys\nimport tempfile\n\nfrom SCons.Platform.posix import exitvalmap\nfrom SCons.Platform import TempFileMunge\nfrom SCons.Platform.virtualenv import ImportVirtualenv\nfrom SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv\nimport SCons.Util\n\nCHOCO_DEFAULT_PATH = [\n    r'C:\\ProgramData\\chocolatey\\bin'\n]\n\nif False:\n    # Now swap out shutil.filecopy and filecopy2 for win32 api native CopyFile\n    try:\n        from ctypes import windll\n        import shutil\n\n        CopyFile = windll.kernel32.CopyFileA\n        SetFileTime = windll.kernel32.SetFileTime\n\n        _shutil_copy = shutil.copy\n        _shutil_copy2 = shutil.copy2\n\n        shutil.copy2 = CopyFile\n\n        def win_api_copyfile(src,dst):\n            CopyFile(src,dst)\n            os.utime(dst)\n\n        shutil.copy = win_api_copyfile\n\n    except AttributeError:\n        parallel_msg = \\\n            \"Couldn't override shutil.copy or shutil.copy2 falling back to shutil defaults\"\n\n\n\n\n\n\n\ntry:\n    import threading\n    spawn_lock = threading.Lock()\n\n    # This locked version of spawnve works around a Windows\n    # MSVCRT bug, because its spawnve is not thread-safe.\n    # Without this, python can randomly crash while using -jN.\n    # See the python bug at http://bugs.python.org/issue6476\n    # and SCons issue at\n    # https://github.com/SCons/scons/issues/2449\n    def spawnve(mode, file, args, env):\n        spawn_lock.acquire()\n        try:\n            if mode == os.P_WAIT:\n                ret = os.spawnve(os.P_NOWAIT, file, args, env)\n            else:\n                ret = os.spawnve(mode, file, args, env)\n        finally:\n            spawn_lock.release()\n        if mode == os.P_WAIT:\n            pid, status = os.waitpid(ret, 0)\n            ret = status >> 8\n        return ret\nexcept ImportError:\n    # Use the unsafe method of spawnve.\n    # Please, don't try to optimize this try-except block\n    # away by assuming that the threading module is always present.\n    # In the test test/option-j.py we intentionally call SCons with\n    # a fake threading.py that raises an import exception right away,\n    # simulating a non-existent package.\n    def spawnve(mode, file, args, env):\n        return os.spawnve(mode, file, args, env)\n\n# The upshot of all this is that, if you are using Python 1.5.2,\n# you had better have cmd or command.com in your PATH when you run\n# scons.\n\n\ndef piped_spawn(sh, escape, cmd, args, env, stdout, stderr):\n    # There is no direct way to do that in python. What we do\n    # here should work for most cases:\n    #   In case stdout (stderr) is not redirected to a file,\n    #   we redirect it into a temporary file tmpFileStdout\n    #   (tmpFileStderr) and copy the contents of this file\n    #   to stdout (stderr) given in the argument\n    # Note that because this will paste shell redirection syntax\n    # into the cmdline, we have to call a shell to run the command,\n    # even though that's a bit of a performance hit.\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n\n    # one temporary file for stdout and stderr\n    tmpFileStdout, tmpFileStdoutName = tempfile.mkstemp(text=True)\n    os.close(tmpFileStdout)  # don't need open until the subproc is done\n    tmpFileStderr, tmpFileStderrName = tempfile.mkstemp(text=True)\n    os.close(tmpFileStderr)\n\n    # check if output is redirected\n    stdoutRedirected = False\n    stderrRedirected = False\n    for arg in args:\n        # are there more possibilities to redirect stdout ?\n        if arg.find(\">\", 0, 1) != -1 or arg.find(\"1>\", 0, 2) != -1:\n            stdoutRedirected = True\n        # are there more possibilities to redirect stderr ?\n        if arg.find(\"2>\", 0, 2) != -1:\n            stderrRedirected = True\n\n    # redirect output of non-redirected streams to our tempfiles\n    if not stdoutRedirected:\n        args.append(\">\" + tmpFileStdoutName)\n    if not stderrRedirected:\n        args.append(\"2>\" + tmpFileStderrName)\n\n    # actually do the spawn\n    try:\n        args = [sh, '/C', escape(' '.join(args))]\n        ret = spawnve(os.P_WAIT, sh, args, env)\n    except OSError as e:\n        # catch any error\n        try:\n            ret = exitvalmap[e.errno]\n        except KeyError:\n            sys.stderr.write(\"scons: unknown OSError exception code %d - %s: %s\\n\" % (e.errno, cmd, e.strerror))\n        if stderr is not None:\n            stderr.write(\"scons: %s: %s\\n\" % (cmd, e.strerror))\n\n    # copy child output from tempfiles to our streams\n    # and do clean up stuff\n    if stdout is not None and not stdoutRedirected:\n        try:\n            with open(tmpFileStdoutName, \"r\") as tmpFileStdout:\n                stdout.write(tmpFileStdout.read())\n            os.remove(tmpFileStdoutName)\n        except (IOError, OSError):\n            pass\n\n    if stderr is not None and not stderrRedirected:\n        try:\n            with open(tmpFileStderrName, \"r\") as tmpFileStderr:\n                stderr.write(tmpFileStderr.read())\n            os.remove(tmpFileStderrName)\n        except (IOError, OSError):\n            pass\n\n    return ret\n\n\ndef exec_spawn(l, env):\n    try:\n        result = spawnve(os.P_WAIT, l[0], l, env)\n    except (OSError, EnvironmentError) as e:\n        try:\n            result = exitvalmap[e.errno]\n            sys.stderr.write(\"scons: %s: %s\\n\" % (l[0], e.strerror))\n        except KeyError:\n            result = 127\n            if len(l) > 2:\n                if len(l[2]) < 1000:\n                    command = ' '.join(l[0:3])\n                else:\n                    command = l[0]\n            else:\n                command = l[0]\n            sys.stderr.write(\"scons: unknown OSError exception code %d - '%s': %s\\n\" % (e.errno, command, e.strerror))\n    return result\n\n\ndef spawn(sh, escape, cmd, args, env):\n    if not sh:\n        sys.stderr.write(\"scons: Could not find command interpreter, is it in your PATH?\\n\")\n        return 127\n    return exec_spawn([sh, '/C', escape(' '.join(args))], env)\n\n# Windows does not allow special characters in file names anyway, so no\n# need for a complex escape function, we will just quote the arg, except\n# that \"cmd /c\" requires that if an argument ends with a backslash it\n# needs to be escaped so as not to interfere with closing double quote\n# that we add.\ndef escape(x):\n    if x[-1] == '\\\\':\n        x = x + '\\\\'\n    return '\"' + x + '\"'\n\n# Get the windows system directory name\n_system_root = None\n\n\ndef get_system_root():\n    global _system_root\n    if _system_root is not None:\n        return _system_root\n\n    # A resonable default if we can't read the registry\n    val = os.environ.get('SystemRoot', \"C:\\\\WINDOWS\")\n\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n\n    _system_root = val\n    return val\n\n\ndef get_program_files_dir():\n    \"\"\"\n    Get the location of the program files directory\n    Returns\n    -------\n\n    \"\"\"\n    # Now see if we can look in the registry...\n    val = ''\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows Program Files directory\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                      'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir')\n        except SCons.Util.RegError:\n            val = ''\n\n    if val == '':\n        # A reasonable default if we can't read the registry\n        # (Actually, it's pretty reasonable even if we can :-)\n        val = os.path.join(os.path.dirname(get_system_root()),\"Program Files\")\n\n    return val\n\n\nclass ArchDefinition:\n    \"\"\"\n    Determine which windows CPU were running on.\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\n\ndef get_architecture(arch=None):\n    \"\"\"Returns the definition for the specified architecture string.\n\n    If no string is specified, the system default is returned (as defined\n    by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment\n    variables).\n    \"\"\"\n    if arch is None:\n        arch = os.environ.get('PROCESSOR_ARCHITEW6432')\n        if not arch:\n            arch = os.environ.get('PROCESSOR_ARCHITECTURE')\n    return SupportedArchitectureMap.get(arch, ArchDefinition(platform.machine(), [platform.machine()]))\n\n\ndef generate(env):\n    # Attempt to find cmd.exe (for WinNT/2k/XP) or\n    # command.com for Win9x\n    cmd_interp = ''\n    # First see if we can look in the registry...\n    if SCons.Util.can_read_reg:\n        try:\n            # Look for Windows NT system root\n            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                          'Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion')\n            val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n            cmd_interp = os.path.join(val, 'System32\\\\cmd.exe')\n        except SCons.Util.RegError:\n            try:\n                # Okay, try the Windows 9x system root\n                k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,\n                                              'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion')\n                val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot')\n                cmd_interp = os.path.join(val, 'command.com')\n            except KeyboardInterrupt:\n                raise\n            except:\n                pass\n\n    # For the special case of not having access to the registry, we\n    # use a temporary path and pathext to attempt to find the command\n    # interpreter.  If we fail, we try to find the interpreter through\n    # the env's PATH.  The problem with that is that it might not\n    # contain an ENV and a PATH.\n    if not cmd_interp:\n        systemroot = get_system_root()\n        tmp_path = systemroot + os.pathsep + \\\n                   os.path.join(systemroot,'System32')\n        tmp_pathext = '.com;.exe;.bat;.cmd'\n        if 'PATHEXT' in os.environ:\n            tmp_pathext = os.environ['PATHEXT']\n        cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext)\n        if not cmd_interp:\n            cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext)\n\n    if not cmd_interp:\n        cmd_interp = env.Detect('cmd')\n        if not cmd_interp:\n            cmd_interp = env.Detect('command')\n\n    if 'ENV' not in env:\n        env['ENV']        = {}\n\n    # Import things from the external environment to the construction\n    # environment's ENV.  This is a potential slippery slope, because we\n    # *don't* want to make builds dependent on the user's environment by\n    # default.  We're doing this for SystemRoot, though, because it's\n    # needed for anything that uses sockets, and seldom changes, and\n    # for SystemDrive because it's related.\n    #\n    # Weigh the impact carefully before adding other variables to this list.\n    import_env = ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]\n    for var in import_env:\n        v = os.environ.get(var)\n        if v:\n            env['ENV'][var] = v\n\n    if 'COMSPEC' not in env['ENV']:\n        v = os.environ.get(\"COMSPEC\")\n        if v:\n            env['ENV']['COMSPEC'] = v\n\n    env.AppendENVPath('PATH', get_system_root() + '\\\\System32')\n\n    env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n    env['PROGPREFIX']     = ''\n    env['PROGSUFFIX']     = '.exe'\n    env['LIBPREFIX']      = ''\n    env['LIBSUFFIX']      = '.lib'\n    env['SHLIBPREFIX']    = ''\n    env['SHLIBSUFFIX']    = '.dll'\n    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]\n    env['LIBSUFFIXES']    = [ '$LIBSUFFIX' ]\n    env['PSPAWN']         = piped_spawn\n    env['SPAWN']          = spawn\n    env['SHELL']          = cmd_interp\n    env['TEMPFILE']       = TempFileMunge\n    env['TEMPFILEPREFIX'] = '@'\n    env['MAXLINELENGTH']  = 2048\n    env['ESCAPE']         = escape\n\n    env['HOST_OS']        = 'win32'\n    env['HOST_ARCH']      = get_architecture().arch\n\n    if enable_virtualenv and not ignore_virtualenv:\n        ImportVirtualenv(env)\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Autoconf-like configuration support.\n\nIn other words, SConf allows to run tests on the build machine to detect\ncapabilities of system and do some things based on result: generate config\nfiles, header files for C/C++, update variables in environment.\n\nTests on the build system can detect if compiler sees header files, if\nlibraries are installed, if some command line options are supported etc.\n\"\"\"\n\nimport SCons.compat\n\nimport atexit\nimport io\nimport os\nimport re\nimport sys\nimport traceback\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node.FS\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Conftest\n\nfrom SCons.Debug import Trace\nfrom collections import defaultdict\n\n# Turn off the Conftest error logging\nSCons.Conftest.LogInputFiles = 0\nSCons.Conftest.LogErrorMessages = 0\n\n# Set\nbuild_type = None\nbuild_types = ['clean', 'help']\n\ndef SetBuildType(buildtype):\n    global build_type\n    build_type = buildtype\n\n# to be set, if we are in dry-run mode\ndryrun = 0\n\nAUTO=0  # use SCons dependency scanning for up-to-date checks\nFORCE=1 # force all tests to be rebuilt\nCACHE=2 # force all tests to be taken from cache (raise an error, if necessary)\ncache_mode = AUTO\n\ndef _set_conftest_node(node):\n    node.attributes.conftest_node = 1\n\ndef SetCacheMode(mode):\n    \"\"\"Set the Configure cache mode. mode must be one of \"auto\", \"force\",\n    or \"cache\".\"\"\"\n    global cache_mode\n    if mode == \"auto\":\n        cache_mode = AUTO\n    elif mode == \"force\":\n        cache_mode = FORCE\n    elif mode == \"cache\":\n        cache_mode = CACHE\n    else:\n        raise ValueError(\"SCons.SConf.SetCacheMode: Unknown mode \" + mode)\n\nprogress_display = SCons.Util.display # will be overwritten by SCons.Script\ndef SetProgressDisplay(display):\n    \"\"\"Set the progress display to use (called from SCons.Script)\"\"\"\n    global progress_display\n    progress_display = display\n\nSConfFS = None\n\n_ac_build_counter = defaultdict(int)\n_ac_config_logs = {}  # all config.log files created in this build\n_ac_config_hs   = {}  # all config.h files created in this build\nsconf_global = None   # current sconf object\n\ndef _createConfigH(target, source, env):\n    t = open(str(target[0]), \"w\")\n    defname = re.sub('[^A-Za-z0-9_]', '_', str(target[0]).upper())\n    t.write(\"\"\"#ifndef %(DEFNAME)s_SEEN\n#define %(DEFNAME)s_SEEN\n\n\"\"\" % {'DEFNAME' : defname})\n    t.write(source[0].get_contents().decode())\n    t.write(\"\"\"\n#endif /* %(DEFNAME)s_SEEN */\n\"\"\" % {'DEFNAME' : defname})\n    t.close()\n\ndef _stringConfigH(target, source, env):\n    return \"scons: Configure: creating \" + str(target[0])\n\n\ndef NeedConfigHBuilder():\n    if len(_ac_config_hs) == 0:\n       return False\n    else:\n       return True\n\ndef CreateConfigHBuilder(env):\n    \"\"\"Called if necessary just before the building targets phase begins.\"\"\"\n    action = SCons.Action.Action(_createConfigH,\n                                 _stringConfigH)\n    sconfigHBld = SCons.Builder.Builder(action=action)\n    env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )\n    for k, v in _ac_config_hs.items():\n        env.SConfigHBuilder(k, env.Value(v))\n\n\nclass SConfWarning(SCons.Warnings.SConsWarning):\n    pass\nSCons.Warnings.enableWarningClass(SConfWarning)\n\n# some error definitions\nclass SConfError(SCons.Errors.UserError):\n    def __init__(self,msg):\n        SCons.Errors.UserError.__init__(self,msg)\n\nclass ConfigureDryRunError(SConfError):\n    \"\"\"Raised when a file or directory needs to be updated during a Configure\n    process, but the user requested a dry-run\"\"\"\n    def __init__(self,target):\n        if not isinstance(target, SCons.Node.FS.File):\n            msg = 'Cannot create configure directory \"%s\" within a dry-run.' % str(target)\n        else:\n            msg = 'Cannot update configure test \"%s\" within a dry-run.' % str(target)\n        SConfError.__init__(self,msg)\n\nclass ConfigureCacheError(SConfError):\n    \"\"\"Raised when a use explicitely requested the cache feature, but the test\n    is run the first time.\"\"\"\n    def __init__(self,target):\n        SConfError.__init__(self, '\"%s\" is not yet built and cache is forced.' % str(target))\n\n\n# define actions for building text files\ndef _createSource(target, source, env):\n    fd = open(str(target[0]), \"w\")\n    fd.write(source[0].get_contents().decode())\n    fd.close()\n\n\ndef _stringSource( target, source, env ):\n    return (str(target[0]) + ' <-\\n  |' +\n            source[0].get_contents().decode().replace( '\\n', \"\\n  |\" ) )\n\nclass SConfBuildInfo(SCons.Node.FS.FileBuildInfo):\n    \"\"\"\n    Special build info for targets of configure tests. Additional members\n    are result (did the builder succeed last time?) and string, which\n    contains messages of the original build phase.\n    \"\"\"\n    __slots__ = ('result', 'string')\n\n    def __init__(self):\n        self.result = None # -> 0/None -> no error, != 0 error\n        self.string = None # the stdout / stderr output when building the target\n\n    def set_build_result(self, result, string):\n        self.result = result\n        self.string = string\n\n\nclass Streamer:\n    \"\"\"\n    'Sniffer' for a file-like writable object. Similar to the unix tool tee.\n    \"\"\"\n    def __init__(self, orig):\n        self.orig = orig\n        self.s = io.StringIO()\n\n    def write(self, str):\n        if self.orig:\n            self.orig.write(str)\n        try:\n            self.s.write(str)\n        except TypeError as e:\n            # \"unicode argument expected\" bug in IOStream (python 2.x)\n            self.s.write(str.decode())\n\n    def writelines(self, lines):\n        for l in lines:\n            self.write(l + '\\n')\n\n    def getvalue(self):\n        \"\"\"\n        Return everything written to orig since the Streamer was created.\n        \"\"\"\n        return self.s.getvalue()\n\n    def flush(self):\n        if self.orig:\n            self.orig.flush()\n        self.s.flush()\n\n\nclass SConfBuildTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"\n    This is almost the same as SCons.Script.BuildTask. Handles SConfErrors\n    correctly and knows about the current cache_mode.\n    \"\"\"\n    def display(self, message):\n        if sconf_global.logstream:\n            sconf_global.logstream.write(\"scons: Configure: \" + message + \"\\n\")\n\n    def display_cached_string(self, bi):\n        \"\"\"\n        Logs the original builder messages, given the SConfBuildInfo instance\n        bi.\n        \"\"\"\n        if not isinstance(bi, SConfBuildInfo):\n            SCons.Warnings.warn(\n                SConfWarning,\n                \"The stored build information has an unexpected class: %s\" % bi.__class__\n            )\n        else:\n            self.display(\"The original builder output was:\\n\" +\n                         (\"  |\" + str(bi.string)).replace(\"\\n\", \"\\n  |\"))\n\n    def failed(self):\n        # check, if the reason was a ConfigureDryRunError or a\n        # ConfigureCacheError and if yes, reraise the exception\n        exc_type = self.exc_info()[0]\n        if issubclass(exc_type, SConfError):\n            # TODO pylint E0704: bare raise not inside except\n            raise\n        elif issubclass(exc_type, SCons.Errors.BuildError):\n            # we ignore Build Errors (occurs, when a test doesn't pass)\n            # Clear the exception to prevent the contained traceback\n            # to build a reference cycle.\n            self.exc_clear()\n        else:\n            self.display('Caught exception while building \"%s\":\\n' %\n                         self.targets[0])\n            sys.excepthook(*self.exc_info())\n        return SCons.Taskmaster.Task.failed(self)\n\n    def collect_node_states(self):\n        # returns (is_up_to_date, cached_error, cachable)\n        # where is_up_to_date is 1, if the node(s) are up_to_date\n        #       cached_error  is 1, if the node(s) are up_to_date, but the\n        #                           build will fail\n        #       cachable      is 0, if some nodes are not in our cache\n        T = 0\n        changed = False\n        cached_error = False\n        cachable = True\n        for t in self.targets:\n            if T: Trace('%s' % t)\n            bi = t.get_stored_info().binfo\n            if isinstance(bi, SConfBuildInfo):\n                if T: Trace(': SConfBuildInfo')\n                if cache_mode == CACHE:\n                    t.set_state(SCons.Node.up_to_date)\n                    if T: Trace(': set_state(up_to-date)')\n                else:\n                    if T: Trace(': get_state() %s' % t.get_state())\n                    if T: Trace(': changed() %s' % t.changed())\n                    if t.get_state() != SCons.Node.up_to_date and t.changed():\n                        changed = True\n                    if T: Trace(': changed %s' % changed)\n                cached_error = cached_error or bi.result\n            else:\n                if T: Trace(': else')\n                # the node hasn't been built in a SConf context or doesn't\n                # exist\n                cachable = False\n                changed = ( t.get_state() != SCons.Node.up_to_date )\n                if T: Trace(': changed %s' % changed)\n        if T: Trace('\\n')\n        return (not changed, cached_error, cachable)\n\n    def execute(self):\n        if not self.targets[0].has_builder():\n            return\n\n        sconf = sconf_global\n\n        is_up_to_date, cached_error, cachable = self.collect_node_states()\n\n        if cache_mode == CACHE and not cachable:\n            raise ConfigureCacheError(self.targets[0])\n        elif cache_mode == FORCE:\n            is_up_to_date = 0\n\n        if cached_error and is_up_to_date:\n            self.display(\"Building \\\"%s\\\" failed in a previous run and all \"\n                         \"its sources are up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n            raise SCons.Errors.BuildError # will be 'caught' in self.failed\n        elif is_up_to_date:\n            self.display(\"\\\"%s\\\" is up to date.\" % str(self.targets[0]))\n            binfo = self.targets[0].get_stored_info().binfo\n            self.display_cached_string(binfo)\n        elif dryrun:\n            raise ConfigureDryRunError(self.targets[0])\n        else:\n            # note stdout and stderr are the same here\n            s = sys.stdout = sys.stderr = Streamer(sys.stdout)\n            try:\n                env = self.targets[0].get_build_env()\n                env['PSTDOUT'] = env['PSTDERR'] = s\n                try:\n                    sconf.cached = 0\n                    self.targets[0].build()\n                finally:\n                    sys.stdout = sys.stderr = env['PSTDOUT'] = \\\n                                 env['PSTDERR'] = sconf.logstream\n            except KeyboardInterrupt:\n                raise\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code)\n            except Exception as e:\n                for t in self.targets:\n                    binfo = SConfBuildInfo()\n                    binfo.merge(t.get_binfo())\n                    binfo.set_build_result(1, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n                raise e\n            else:\n                for t in self.targets:\n                    binfo = SConfBuildInfo()\n                    binfo.merge(t.get_binfo())\n                    binfo.set_build_result(0, s.getvalue())\n                    sconsign_entry = SCons.SConsign.SConsignEntry()\n                    sconsign_entry.binfo = binfo\n                    #sconsign_entry.ninfo = self.get_ninfo()\n                    # We'd like to do this as follows:\n                    #    t.store_info(binfo)\n                    # However, we need to store it as an SConfBuildInfo\n                    # object, and store_info() will turn it into a\n                    # regular FileNodeInfo if the target is itself a\n                    # regular File.\n                    sconsign = t.dir.sconsign()\n                    sconsign.set_entry(t.name, sconsign_entry)\n                    sconsign.merge()\n\nclass SConfBase:\n    \"\"\"This is simply a class to represent a configure context. After\n    creating a SConf object, you can call any tests. After finished with your\n    tests, be sure to call the Finish() method, which returns the modified\n    environment.\n    Some words about caching: In most cases, it is not necessary to cache\n    Test results explicitly. Instead, we use the scons dependency checking\n    mechanism. For example, if one wants to compile a test program\n    (SConf.TryLink), the compiler is only called, if the program dependencies\n    have changed. However, if the program could not be compiled in a former\n    SConf run, we need to explicitly cache this error.\n    \"\"\"\n\n    def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR',\n                 log_file='$CONFIGURELOG', config_h = None, _depth = 0):\n        \"\"\"Constructor. Pass additional tests in the custom_tests-dictionary,\n        e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest\n        defines a custom test.\n        Note also the conf_dir and log_file arguments (you may want to\n        build tests in the VariantDir, not in the SourceDir)\n        \"\"\"\n        global SConfFS\n\n        # Now create isolated override so setting source_decider doesn't affect parent Environment\n        if cache_mode == FORCE:\n            self.original_env = env\n            self.env = env.Clone()\n\n            # Set up the Decider() to force rebuilds by saying\n            # that every source has changed.  Note that we still\n            # call the environment's underlying source decider so\n            # that the correct .sconsign info will get calculated\n            # and keep the build state consistent.\n            def force_build(dependency, target, prev_ni,\n                            repo_node=None,\n                            env_decider=env.decide_source):\n                try:\n                    env_decider(dependency, target, prev_ni, repo_node)\n                except Exception as e:\n                    raise e\n                return True\n\n            if self.env.decide_source.__code__ is not force_build.__code__:\n                self.env.Decider(force_build)\n\n        else:\n            self.env = env\n\n        # print(\"Override env:%s\"%env)\n\n        if not SConfFS:\n            SConfFS = SCons.Node.FS.default_fs or \\\n                      SCons.Node.FS.FS(env.fs.pathTop)\n        if sconf_global is not None:\n            raise SCons.Errors.UserError(\"\"\"Configure() called while another Configure() exists.\n            Please call .Finish() before creating and second Configure() context\"\"\")\n\n        if log_file is not None:\n            log_file = SConfFS.File(env.subst(log_file))\n        self.logfile = log_file\n        self.logstream = None\n        self.lastTarget = None\n        self.depth = _depth\n        self.cached = 0 # will be set, if all test results are cached\n\n        # add default tests\n        default_tests = {\n                 'CheckCC'            : CheckCC,\n                 'CheckCXX'           : CheckCXX,\n                 'CheckSHCC'          : CheckSHCC,\n                 'CheckSHCXX'         : CheckSHCXX,\n                 'CheckFunc'          : CheckFunc,\n                 'CheckType'          : CheckType,\n                 'CheckTypeSize'      : CheckTypeSize,\n                 'CheckDeclaration'   : CheckDeclaration,\n                 'CheckHeader'        : CheckHeader,\n                 'CheckCHeader'       : CheckCHeader,\n                 'CheckCXXHeader'     : CheckCXXHeader,\n                 'CheckLib'           : CheckLib,\n                 'CheckLibWithHeader' : CheckLibWithHeader,\n                 'CheckProg'          : CheckProg,\n               }\n        self.AddTests(default_tests)\n        self.AddTests(custom_tests)\n        self.confdir = SConfFS.Dir(env.subst(conf_dir))\n        if config_h is not None:\n            config_h = SConfFS.File(config_h)\n        self.config_h = config_h\n        self._startup()\n\n    def Finish(self):\n        \"\"\"Call this method after finished with your tests:\n                env = sconf.Finish()\n        \"\"\"\n        self._shutdown()\n\n        return self.env\n\n    def Define(self, name, value = None, comment = None):\n        \"\"\"\n        Define a pre processor symbol name, with the optional given value in the\n        current config header.\n\n        If value is None (default), then #define name is written. If value is not\n        none, then #define name value is written.\n\n        comment is a string which will be put as a C comment in the header, to explain the meaning of the value\n        (appropriate C comments will be added automatically).\n        \"\"\"\n        lines = []\n        if comment:\n            comment_str = \"/* %s */\" % comment\n            lines.append(comment_str)\n\n        if value is not None:\n            define_str = \"#define %s %s\" % (name, value)\n        else:\n            define_str = \"#define %s\" % name\n        lines.append(define_str)\n        lines.append('')\n\n        self.config_h_text = self.config_h_text + '\\n'.join(lines)\n\n    def BuildNodes(self, nodes):\n        \"\"\"\n        Tries to build the given nodes immediately. Returns 1 on success,\n        0 on error.\n        \"\"\"\n        if self.logstream is not None:\n            # override stdout / stderr to write in log file\n            oldStdout = sys.stdout\n            sys.stdout = self.logstream\n            oldStderr = sys.stderr\n            sys.stderr = self.logstream\n\n        # the engine assumes the current path is the SConstruct directory ...\n        old_fs_dir = SConfFS.getcwd()\n        old_os_dir = os.getcwd()\n        SConfFS.chdir(SConfFS.Top, change_os_dir=1)\n\n        # Because we take responsibility here for writing out our\n        # own .sconsign info (see SConfBuildTask.execute(), above),\n        # we override the store_info() method with a null place-holder\n        # so we really control how it gets written.\n        for n in nodes:\n            _set_conftest_node(n)\n            n.store_info = 0\n            if not hasattr(n, 'attributes'):\n                n.attributes = SCons.Node.Node.Attrs()\n            n.attributes.keep_targetinfo = 1\n\n            if True:\n                # Some checkers have intermediate files (for example anything that compiles a c file into a program to run\n                # Those files need to be set to not release their target info, otherwise taskmaster will throw a\n                # Nonetype not callable\n                for c in n.children(scan=False):\n                    # Keep debug code here.\n                    # print(\"Checking [%s] for builders and then setting keep_targetinfo\"%c)\n                    _set_conftest_node(c)\n                    if  c.has_builder():\n                        n.store_info = 0\n                        if not hasattr(c, 'attributes'):\n                            c.attributes = SCons.Node.Node.Attrs()\n                        c.attributes.keep_targetinfo = 1\n                    # pass\n\n        ret = 1\n\n        try:\n            # ToDo: use user options for calc\n            save_max_drift = SConfFS.get_max_drift()\n            SConfFS.set_max_drift(0)\n            tm = SCons.Taskmaster.Taskmaster(nodes, SConfBuildTask)\n            # we don't want to build tests in parallel\n            jobs = SCons.Job.Jobs(1, tm )\n            jobs.run()\n            for n in nodes:\n                state = n.get_state()\n                if (state != SCons.Node.executed and\n                    state != SCons.Node.up_to_date):\n                    # the node could not be built. we return 0 in this case\n                    ret = 0\n        finally:\n            SConfFS.set_max_drift(save_max_drift)\n            os.chdir(old_os_dir)\n            SConfFS.chdir(old_fs_dir, change_os_dir=0)\n            if self.logstream is not None:\n                # restore stdout / stderr\n                sys.stdout = oldStdout\n                sys.stderr = oldStderr\n        return ret\n\n    def pspawn_wrapper(self, sh, escape, cmd, args, env):\n        \"\"\"Wrapper function for handling piped spawns.\n\n        This looks to the calling interface (in Action.py) like a \"normal\"\n        spawn, but associates the call with the PSPAWN variable from\n        the construction environment and with the streams to which we\n        want the output logged.  This gets slid into the construction\n        environment as the SPAWN variable so Action.py doesn't have to\n        know or care whether it's spawning a piped command or not.\n        \"\"\"\n        return self.pspawn(sh, escape, cmd, args, env, self.logstream, self.logstream)\n\n    def TryBuild(self, builder, text=None, extension=\"\"):\n        \"\"\"Low level TryBuild implementation. Normally you don't need to\n        call that - you can use TryCompile / TryLink / TryRun instead\n        \"\"\"\n        global _ac_build_counter\n\n        # Make sure we have a PSPAWN value, and save the current\n        # SPAWN value.\n        try:\n            self.pspawn = self.env['PSPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing PSPAWN construction variable.')\n        try:\n            save_spawn = self.env['SPAWN']\n        except KeyError:\n            raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n\n        nodesToBeBuilt = []\n        sourcetext = self.env.Value(text)\n        _set_conftest_node(sourcetext)\n        f = \"conftest\"\n\n        if text is not None:\n            textSig = SCons.Util.hash_signature(sourcetext)\n            textSigCounter = str(_ac_build_counter[textSig])\n            _ac_build_counter[textSig] += 1\n\n            f = \"_\".join([f, textSig, textSigCounter])\n            textFile = self.confdir.File(f + extension)\n            _set_conftest_node(textFile)\n            textFileNode = self.env.SConfSourceBuilder(target=textFile,\n                                                       source=sourcetext)\n            nodesToBeBuilt.extend(textFileNode)\n\n            source = textFile\n            target = textFile.File(f + \"SConfActionsContentDummyTarget\")\n            _set_conftest_node(target)\n        else:\n            source = None\n            target = None\n\n        action = builder.builder.action.get_contents(target=target, source=[source], env=self.env)\n        actionsig = SCons.Util.hash_signature(action)\n        f = \"_\".join([f, actionsig])\n\n        pref = self.env.subst( builder.builder.prefix )\n        suff = self.env.subst( builder.builder.suffix )\n        target = self.confdir.File(pref + f + suff)\n        _set_conftest_node(target)\n\n        try:\n            # Slide our wrapper into the construction environment as\n            # the SPAWN function.\n            self.env['SPAWN'] = self.pspawn_wrapper\n\n            nodes = builder(target = target, source = source, SCONF_NODE=True)\n            if not SCons.Util.is_List(nodes):\n                nodes = [nodes]\n            nodesToBeBuilt.extend(nodes)\n            result = self.BuildNodes(nodesToBeBuilt)\n\n        finally:\n            self.env['SPAWN'] = save_spawn\n\n        if result:\n            self.lastTarget = nodes[0]\n        else:\n            self.lastTarget = None\n\n        return result\n\n    def TryAction(self, action, text = None, extension = \"\"):\n        \"\"\"Tries to execute the given action with optional source file\n        contents <text> and optional source file extension <extension>,\n        Returns the status (0 : failed, 1 : ok) and the contents of the\n        output file.\n        \"\"\"\n        builder = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS = {'SConfActionBuilder' : builder} )\n        ok = self.TryBuild(self.env.SConfActionBuilder, text, extension)\n        del self.env['BUILDERS']['SConfActionBuilder']\n        if ok:\n            outputStr = self.lastTarget.get_text_contents()\n            return (1, outputStr)\n        return (0, \"\")\n\n    def TryCompile( self, text, extension):\n        \"\"\"Compiles the program given in text to an env.Object, using extension\n        as file extension (e.g. '.c'). Returns 1, if compilation was\n        successful, 0 otherwise. The target is saved in self.lastTarget (for\n        further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Object, text, extension)\n\n    def TryLink( self, text, extension ):\n        \"\"\"Compiles the program given in text to an executable env.Program,\n        using extension as file extension (e.g. '.c'). Returns 1, if\n        compilation was successful, 0 otherwise. The target is saved in\n        self.lastTarget (for further processing).\n        \"\"\"\n        return self.TryBuild(self.env.Program, text, extension )\n\n    def TryRun(self, text, extension ):\n        \"\"\"Compiles and runs the program given in text, using extension\n        as file extension (e.g. '.c'). Returns (1, outputStr) on success,\n        (0, '') otherwise. The target (a file containing the program's stdout)\n        is saved in self.lastTarget (for further processing).\n        \"\"\"\n        ok = self.TryLink(text, extension)\n        if ok:\n            prog = self.lastTarget\n            pname = prog.get_internal_path()\n            output = self.confdir.File(os.path.basename(pname)+'.out')\n            node = self.env.Command(output, prog, [ [ pname, \">\", \"${TARGET}\"] ])\n            ok = self.BuildNodes(node)\n            if ok:\n                outputStr = SCons.Util.to_str(output.get_contents())\n                return( 1, outputStr)\n        return (0, \"\")\n\n    class TestWrapper:\n        \"\"\"A wrapper around Tests (to ensure sanity)\"\"\"\n        def __init__(self, test, sconf):\n            self.test = test\n            self.sconf = sconf\n        def __call__(self, *args, **kw):\n            if not self.sconf.active:\n                raise SCons.Errors.UserError\n            context = CheckContext(self.sconf)\n            ret = self.test(context, *args, **kw)\n            if self.sconf.config_h is not None:\n                self.sconf.config_h_text = self.sconf.config_h_text + context.config_h\n            context.Result(\"error: no result\")\n            return ret\n\n    def AddTest(self, test_name, test_instance):\n        \"\"\"Adds test_class to this SConf instance. It can be called with\n        self.test_name(...)\"\"\"\n        setattr(self, test_name, SConfBase.TestWrapper(test_instance, self))\n\n    def AddTests(self, tests):\n        \"\"\"Adds all the tests given in the tests dictionary to this SConf\n        instance\n        \"\"\"\n        for name in tests.keys():\n            self.AddTest(name, tests[name])\n\n    def _createDir( self, node ):\n        dirName = str(node)\n        if dryrun:\n            if not os.path.isdir( dirName ):\n                raise ConfigureDryRunError(dirName)\n        else:\n            if not os.path.isdir( dirName ):\n                os.makedirs( dirName )\n\n    def _startup(self):\n        \"\"\"Private method. Set up logstream, and set the environment\n        variables necessary for a piped build\n        \"\"\"\n        global _ac_config_logs\n        global sconf_global\n        global SConfFS\n\n        self.lastEnvFs = self.env.fs\n        self.env.fs = SConfFS\n        self._createDir(self.confdir)\n        self.confdir.up().add_ignore( [self.confdir] )\n\n        if self.logfile is not None and not dryrun:\n            # truncate logfile, if SConf.Configure is called for the first time\n            # in a build\n            if self.logfile in _ac_config_logs:\n                log_mode = \"a\"\n            else:\n                _ac_config_logs[self.logfile] = None\n                log_mode = \"w\"\n            fp = open(str(self.logfile), log_mode)\n\n            def conflog_cleanup(logf):\n                logf.close()\n\n            atexit.register(conflog_cleanup, fp)\n            self.logstream = SCons.Util.Unbuffered(fp)\n            # logfile may stay in a build directory, so we tell\n            # the build system not to override it with an eventually\n            # existing file with the same name in the source directory\n            self.logfile.dir.add_ignore([self.logfile])\n\n            tb = traceback.extract_stack()[-3-self.depth]\n            old_fs_dir = SConfFS.getcwd()\n            SConfFS.chdir(SConfFS.Top, change_os_dir=0)\n            self.logstream.write('file %s,line %d:\\n\\tConfigure(confdir = %s)\\n' %\n                                 (tb[0], tb[1], str(self.confdir)) )\n            SConfFS.chdir(old_fs_dir)\n        else:\n            self.logstream = None\n        # we use a special builder to create source files from TEXT\n        action = SCons.Action.Action(_createSource,\n                                     _stringSource)\n        sconfSrcBld = SCons.Builder.Builder(action=action)\n        self.env.Append( BUILDERS={'SConfSourceBuilder':sconfSrcBld} )\n        self.config_h_text = _ac_config_hs.get(self.config_h, \"\")\n        self.active = 1\n        # only one SConf instance should be active at a time ...\n        sconf_global = self\n\n    def _shutdown(self):\n        \"\"\"Private method. Reset to non-piped spawn\"\"\"\n        global sconf_global, _ac_config_hs\n\n        if not self.active:\n            raise SCons.Errors.UserError(\"Finish may be called only once!\")\n        if self.logstream is not None and not dryrun:\n            self.logstream.write(\"\\n\")\n            self.logstream.close()\n            self.logstream = None\n\n        # Now reset the decider if we changed it due to --config=force\n        # We saved original Environment passed in and cloned it to isolate\n        # it from being changed.\n        if cache_mode == FORCE:\n            self.env.Decider(self.original_env.decide_source)\n\n            # remove the SConfSourceBuilder from the environment\n            blds = self.env['BUILDERS']\n            del blds['SConfSourceBuilder']\n            self.env.Replace( BUILDERS=blds )\n\n        self.active = 0\n        sconf_global = None\n        if self.config_h is not None:\n            _ac_config_hs[self.config_h] = self.config_h_text\n        self.env.fs = self.lastEnvFs\n\nclass CheckContext:\n    \"\"\"Provides a context for configure tests. Defines how a test writes to the\n    screen and log file.\n\n    A typical test is just a callable with an instance of CheckContext as\n    first argument:\n\n        def CheckCustom(context, ...):\n            context.Message('Checking my weird test ... ')\n            ret = myWeirdTestFunction(...)\n            context.Result(ret)\n\n    Often, myWeirdTestFunction will be one of\n    context.TryCompile/context.TryLink/context.TryRun. The results of\n    those are cached, for they are only rebuild, if the dependencies have\n    changed.\n    \"\"\"\n\n    def __init__(self, sconf):\n        \"\"\"Constructor. Pass the corresponding SConf instance.\"\"\"\n        self.sconf = sconf\n        self.did_show_result = 0\n\n        # for Conftest.py:\n        self.vardict = {}\n        self.havedict = {}\n        self.headerfilename = None\n        self.config_h = \"\" # config_h text will be stored here\n        # we don't regenerate the config.h file after each test. That means,\n        # that tests won't be able to include the config.h file, and so\n        # they can't do an #ifdef HAVE_XXX_H. This shouldn't be a major\n        # issue, though. If it turns out, that we need to include config.h\n        # in tests, we must ensure, that the dependencies are worked out\n        # correctly. Note that we can't use Conftest.py's support for config.h,\n        # cause we will need to specify a builder for the config.h file ...\n\n    def Message(self, text):\n        \"\"\"Inform about what we are doing right now, e.g.\n        'Checking for SOMETHING ... '\n        \"\"\"\n        self.Display(text)\n        self.sconf.cached = 1\n        self.did_show_result = 0\n\n    def Result(self, res):\n        \"\"\"Inform about the result of the test. If res is not a string, displays\n        'yes' or 'no' depending on whether res is evaluated as true or false.\n        The result is only displayed when self.did_show_result is not set.\n        \"\"\"\n        if isinstance(res, str):\n            text = res\n        elif res:\n            text = \"yes\"\n        else:\n            text = \"no\"\n\n        if self.did_show_result == 0:\n            # Didn't show result yet, do it now.\n            self.Display(text + \"\\n\")\n            self.did_show_result = 1\n\n    def TryBuild(self, *args, **kw):\n        return self.sconf.TryBuild(*args, **kw)\n\n    def TryAction(self, *args, **kw):\n        return self.sconf.TryAction(*args, **kw)\n\n    def TryCompile(self, *args, **kw):\n        return self.sconf.TryCompile(*args, **kw)\n\n    def TryLink(self, *args, **kw):\n        return self.sconf.TryLink(*args, **kw)\n\n    def TryRun(self, *args, **kw):\n        return self.sconf.TryRun(*args, **kw)\n\n    def __getattr__( self, attr ):\n        if attr == 'env':\n            return self.sconf.env\n        elif attr == 'lastTarget':\n            return self.sconf.lastTarget\n        else:\n            raise AttributeError(\"CheckContext instance has no attribute '%s'\" % attr)\n\n    #### Stuff used by Conftest.py (look there for explanations).\n\n    def BuildProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Program, text, ext)\n\n    def CompileProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.Object, text, ext)\n\n    def CompileSharedObject(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $SHCC, $CPPFLAGS, etc.\n        return not self.TryBuild(self.env.SharedObject, text, ext)\n\n    def RunProg(self, text, ext):\n        self.sconf.cached = 1\n        # TODO: should use self.vardict for $CC, $CPPFLAGS, etc.\n        st, out = self.TryRun(text, ext)\n        return not st, out\n\n    def AppendLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Append(LIBS = lib_name_list)\n        return oldLIBS\n\n    def PrependLIBS(self, lib_name_list):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Prepend(LIBS = lib_name_list)\n        return oldLIBS\n\n    def SetLIBS(self, val):\n        oldLIBS = self.env.get( 'LIBS', [] )\n        self.env.Replace(LIBS = val)\n        return oldLIBS\n\n    def Display(self, msg):\n        if self.sconf.cached:\n            # We assume that Display is called twice for each test here\n            # once for the Checking for ... message and once for the result.\n            # The self.sconf.cached flag can only be set between those calls\n            msg = \"(cached) \" + msg\n            self.sconf.cached = 0\n        progress_display(msg, append_newline=0)\n        self.Log(\"scons: Configure: \" + msg + \"\\n\")\n\n    def Log(self, msg):\n        if self.sconf.logstream is not None:\n            self.sconf.logstream.write(msg)\n\n    #### End of stuff used by Conftest.py.\n\n\ndef SConf(*args, **kw):\n    if kw.get(build_type, True):\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        for bt in build_types:\n            try:\n                del kw[bt]\n            except KeyError:\n                pass\n        return SConfBase(*args, **kw)\n    else:\n        return SCons.Util.Null()\n\n\ndef CheckFunc(context, function_name, header = None, language = None):\n    res = SCons.Conftest.CheckFunc(context, function_name, header = header, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckType(context, type_name, includes = \"\", language = None):\n    res = SCons.Conftest.CheckType(context, type_name,\n                                   header = includes, language = language)\n    context.did_show_result = 1\n    return not res\n\ndef CheckTypeSize(context, type_name, includes = \"\", language = None, expect = None):\n    res = SCons.Conftest.CheckTypeSize(context, type_name,\n                                       header = includes, language = language,\n                                       expect = expect)\n    context.did_show_result = 1\n    return res\n\ndef CheckDeclaration(context, declaration, includes = \"\", language = None):\n    res = SCons.Conftest.CheckDeclaration(context, declaration,\n                                          includes = includes,\n                                          language = language)\n    context.did_show_result = 1\n    return not res\n\ndef createIncludesFromHeaders(headers, leaveLast, include_quotes = '\"\"'):\n    # used by CheckHeader and CheckLibWithHeader to produce C - #include\n    # statements from the specified header (list)\n    if not SCons.Util.is_List(headers):\n        headers = [headers]\n    l = []\n    if leaveLast:\n        lastHeader = headers[-1]\n        headers = headers[:-1]\n    else:\n        lastHeader = None\n    for s in headers:\n        l.append(\"#include %s%s%s\\n\"\n                 % (include_quotes[0], s, include_quotes[1]))\n    return ''.join(l), lastHeader\n\ndef CheckHeader(context, header, include_quotes = '<>', language = None):\n    \"\"\"\n    A test for a C or C++ header file.\n    \"\"\"\n    prog_prefix, hdr_to_check = \\\n                 createIncludesFromHeaders(header, 1, include_quotes)\n    res = SCons.Conftest.CheckHeader(context, hdr_to_check, prog_prefix,\n                                     language = language,\n                                     include_quotes = include_quotes)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCC(context):\n    res = SCons.Conftest.CheckCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckCXX(context):\n    res = SCons.Conftest.CheckCXX(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCC(context):\n    res = SCons.Conftest.CheckSHCC(context)\n    context.did_show_result = 1\n    return not res\n\ndef CheckSHCXX(context):\n    res = SCons.Conftest.CheckSHCXX(context)\n    context.did_show_result = 1\n    return not res\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C\")\n\n\n# Bram: Make this function obsolete?  CheckHeader() is more generic.\n\ndef CheckCXXHeader(context, header, include_quotes = '\"\"'):\n    \"\"\"\n    A test for a C++ header file.\n    \"\"\"\n    return CheckHeader(context, header, include_quotes, language = \"C++\")\n\n\ndef CheckLib(context, library = None, symbol = \"main\",\n             header = None, language = None, autoadd = 1):\n    \"\"\"\n    A test for a library. See also CheckLibWithHeader.\n    Note that library may also be None to test whether the given symbol\n    compiles without flags.\n    \"\"\"\n\n    if not library:\n        library = [None]\n\n    if not SCons.Util.is_List(library):\n        library = [library]\n\n    # ToDo: accept path for the library\n    res = SCons.Conftest.CheckLib(context, library, symbol, header = header,\n                                        language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\n# XXX\n# Bram: Can only include one header and can't use #ifdef HAVE_HEADER_H.\n\ndef CheckLibWithHeader(context, libs, header, language,\n                       call = None, autoadd = 1):\n    # ToDo: accept path for library. Support system header files.\n    \"\"\"\n    Another (more sophisticated) test for a library.\n    Checks, if library and header is available for language (may be 'C'\n    or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'.\n    As in CheckLib, we support library=None, to test if the call compiles\n    without extra link flags.\n    \"\"\"\n    prog_prefix, dummy = \\\n                 createIncludesFromHeaders(header, 0)\n    if not libs:\n        libs = [None]\n\n    if not SCons.Util.is_List(libs):\n        libs = [libs]\n\n    res = SCons.Conftest.CheckLib(context, libs, None, prog_prefix,\n            call = call, language = language, autoadd = autoadd)\n    context.did_show_result = 1\n    return not res\n\ndef CheckProg(context, prog_name):\n    \"\"\"Simple check if a program exists in the path.  Returns the path\n    for the application, or None if not found.\n    \"\"\"\n    res = SCons.Conftest.CheckProg(context, prog_name)\n    context.did_show_result = 1\n    return res\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Operations on signature database files (.sconsign). \"\"\"\n\nimport SCons.compat\n\nimport os\nimport pickle\nimport time\n\nimport SCons.dblite\nimport SCons.Warnings\nfrom SCons.compat import PICKLE_PROTOCOL\nfrom SCons.Util import print_time\n\n\ndef corrupt_dblite_warning(filename):\n    SCons.Warnings.warn(\n        SCons.Warnings.CorruptSConsignWarning,\n        \"Ignoring corrupt .sconsign file: %s\" % filename,\n    )\n\nSCons.dblite.IGNORE_CORRUPT_DBFILES = True\nSCons.dblite.corruption_warning = corrupt_dblite_warning\n\n# XXX Get rid of the global array so this becomes re-entrant.\nsig_files = []\n\n# Info for the database SConsign implementation (now the default):\n# \"DataBase\" is a dictionary that maps top-level SConstruct directories\n# to open database handles.\n# \"DB_Module\" is the Python database module to create the handles.\n# \"DB_Name\" is the base name of the database file (minus any\n# extension the underlying DB module will add).\nDataBase = {}\nDB_Module = SCons.dblite\nDB_Name = None\nDB_sync_list = []\n\ndef current_sconsign_filename():\n    hash_format = SCons.Util.get_hash_format()\n    current_hash_algorithm = SCons.Util.get_current_hash_algorithm_used()\n    # if the user left the options defaulted AND the default algorithm set by\n    # SCons is md5, then set the database name to be the special default name\n    #\n    # otherwise, if it defaults to something like 'sha1' or the user explicitly\n    # set 'md5' as the hash format, set the database name to .sconsign_<algorithm>\n    # eg .sconsign_sha1, etc.\n    if hash_format is None and current_hash_algorithm == 'md5':\n        return \".sconsign\"\n    else:\n        return \".sconsign_\" + current_hash_algorithm\n\ndef Get_DataBase(dir):\n    global DataBase, DB_Module, DB_Name\n\n    if DB_Name is None:\n        DB_Name = current_sconsign_filename()\n\n    top = dir.fs.Top\n    if not os.path.isabs(DB_Name) and top.repositories:\n        mode = \"c\"\n        for d in [top] + top.repositories:\n            if dir.is_under(d):\n                try:\n                    return DataBase[d], mode\n                except KeyError:\n                    path = d.entry_abspath(DB_Name)\n                    try: db = DataBase[d] = DB_Module.open(path, mode)\n                    except (IOError, OSError):\n                        pass\n                    else:\n                        if mode != \"r\":\n                            DB_sync_list.append(db)\n                        return db, mode\n            mode = \"r\"\n    try:\n        return DataBase[top], \"c\"\n    except KeyError:\n        db = DataBase[top] = DB_Module.open(DB_Name, \"c\")\n        DB_sync_list.append(db)\n        return db, \"c\"\n    except TypeError:\n        print(\"DataBase =\", DataBase)\n        raise\n\n\ndef Reset():\n    \"\"\"Reset global state.  Used by unit tests that end up using\n    SConsign multiple times to get a clean slate for each test.\"\"\"\n    global sig_files, DB_sync_list\n    sig_files = []\n    DB_sync_list = []\n\nnormcase = os.path.normcase\n\n\ndef write():\n    global sig_files\n\n    if print_time():\n        start_time = time.perf_counter()\n\n    for sig_file in sig_files:\n        sig_file.write(sync=0)\n    for db in DB_sync_list:\n        try:\n            syncmethod = db.sync\n        except AttributeError:\n            pass # Not all dbm modules have sync() methods.\n        else:\n            syncmethod()\n        try:\n            closemethod = db.close\n        except AttributeError:\n            pass # Not all dbm modules have close() methods.\n        else:\n            closemethod()\n\n    if print_time():\n        elapsed = time.perf_counter() - start_time\n        print('Total SConsign sync time: %f seconds' % elapsed)\n\n\nclass SConsignEntry:\n    \"\"\"\n    Wrapper class for the generic entry in a .sconsign file.\n    The Node subclass populates it with attributes as it pleases.\n\n    XXX As coded below, we do expect a '.binfo' attribute to be added,\n    but we'll probably generalize this in the next refactorings.\n    \"\"\"\n    __slots__ = (\"binfo\", \"ninfo\", \"__weakref__\")\n    current_version_id = 2\n\n    def __init__(self):\n        # Create an object attribute from the class attribute so it ends up\n        # in the pickled data in the .sconsign file.\n        #_version_id = self.current_version_id\n        pass\n\n    def convert_to_sconsign(self):\n        self.binfo.convert_to_sconsign()\n\n    def convert_from_sconsign(self, dir, name):\n        self.binfo.convert_from_sconsign(dir, name)\n\n    def __getstate__(self):\n        state = getattr(self, '__dict__', {}).copy()\n        for obj in type(self).mro():\n            for name in getattr(obj, '__slots__', ()):\n                if hasattr(self, name):\n                    state[name] = getattr(self, name)\n\n        state['_version_id'] = self.current_version_id\n        try:\n            del state['__weakref__']\n        except KeyError:\n            pass\n        return state\n\n    def __setstate__(self, state):\n        for key, value in state.items():\n            if key not in ('_version_id', '__weakref__'):\n                setattr(self, key, value)\n\n\nclass Base:\n    \"\"\"\n    This is the controlling class for the signatures for the collection of\n    entries associated with a specific directory.  The actual directory\n    association will be maintained by a subclass that is specific to\n    the underlying storage method.  This class provides a common set of\n    methods for fetching and storing the individual bits of information\n    that make up signature entry.\n    \"\"\"\n    def __init__(self):\n        self.entries = {}\n        self.dirty = False\n        self.to_be_merged = {}\n\n    def get_entry(self, filename):\n        \"\"\"\n        Fetch the specified entry attribute.\n        \"\"\"\n        return self.entries[filename]\n\n    def set_entry(self, filename, obj):\n        \"\"\"\n        Set the entry.\n        \"\"\"\n        self.entries[filename] = obj\n        self.dirty = True\n\n    def do_not_set_entry(self, filename, obj):\n        pass\n\n    def store_info(self, filename, node):\n        entry = node.get_stored_info()\n        entry.binfo.merge(node.get_binfo())\n        self.to_be_merged[filename] = node\n        self.dirty = True\n\n    def do_not_store_info(self, filename, node):\n        pass\n\n    def merge(self):\n        for key, node in self.to_be_merged.items():\n            entry = node.get_stored_info()\n            try:\n                ninfo = entry.ninfo\n            except AttributeError:\n                # This happens with SConf Nodes, because the configuration\n                # subsystem takes direct control over how the build decision\n                # is made and its information stored.\n                pass\n            else:\n                ninfo.merge(node.get_ninfo())\n            self.entries[key] = entry\n        self.to_be_merged = {}\n\n\nclass DB(Base):\n    \"\"\"\n    A Base subclass that reads and writes signature information\n    from a global .sconsign.db* file--the actual file suffix is\n    determined by the database module.\n    \"\"\"\n    def __init__(self, dir):\n        Base.__init__(self)\n\n        self.dir = dir\n\n        db, mode = Get_DataBase(dir)\n\n        # Read using the path relative to the top of the Repository\n        # (self.dir.tpath) from which we're fetching the signature\n        # information.\n        path = normcase(dir.get_tpath())\n        try:\n            rawentries = db[path]\n        except KeyError:\n            pass\n        else:\n            try:\n                self.entries = pickle.loads(rawentries)\n                if not isinstance(self.entries, dict):\n                    self.entries = {}\n                    raise TypeError\n            except KeyboardInterrupt:\n                raise\n            except Exception as e:\n                SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                    \"Ignoring corrupt sconsign entry : %s (%s)\\n\"%(self.dir.get_tpath(), e))\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\n        if mode == \"r\":\n            # This directory is actually under a repository, which means\n            # likely they're reaching in directly for a dependency on\n            # a file there.  Don't actually set any entry info, so we\n            # won't try to write to that .sconsign.dblite file.\n            self.set_entry = self.do_not_set_entry\n            self.store_info = self.do_not_store_info\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        db, mode = Get_DataBase(self.dir)\n\n        # Write using the path relative to the top of the SConstruct\n        # directory (self.dir.path), not relative to the top of\n        # the Repository; we only write to our own .sconsign file,\n        # not to .sconsign files in Repositories.\n        path = normcase(self.dir.get_internal_path())\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        db[path] = pickle.dumps(self.entries, PICKLE_PROTOCOL)\n\n        if sync:\n            try:\n                syncmethod = db.sync\n            except AttributeError:\n                # Not all anydbm modules have sync() methods.\n                pass\n            else:\n                syncmethod()\n\n\nclass Dir(Base):\n    def __init__(self, fp=None, dir=None):\n        \"\"\"\n        fp - file pointer to read entries from\n        \"\"\"\n        Base.__init__(self)\n\n        if not fp:\n            return\n\n        self.entries = pickle.load(fp)\n        if not isinstance(self.entries, dict):\n            self.entries = {}\n            raise TypeError\n\n        if dir:\n            for key, entry in self.entries.items():\n                entry.convert_from_sconsign(dir, key)\n\n\nclass DirFile(Dir):\n    \"\"\"\n    Encapsulates reading and writing a per-directory .sconsign file.\n    \"\"\"\n    def __init__(self, dir):\n        \"\"\"\n        dir - the directory for the file\n        \"\"\"\n\n        self.dir = dir\n        self.sconsign = os.path.join(dir.get_internal_path(), current_sconsign_filename())\n\n        try:\n            fp = open(self.sconsign, 'rb')\n        except IOError:\n            fp = None\n\n        try:\n            Dir.__init__(self, fp, dir)\n        except KeyboardInterrupt:\n            raise\n        except Exception:\n            SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,\n                                \"Ignoring corrupt .sconsign file: %s\"%self.sconsign)\n\n        try:\n            fp.close()\n        except AttributeError:\n            pass\n\n        global sig_files\n        sig_files.append(self)\n\n    def write(self, sync=1):\n        \"\"\"\n        Write the .sconsign file to disk.\n\n        Try to write to a temporary file first, and rename it if we\n        succeed.  If we can't write to the temporary file, it's\n        probably because the directory isn't writable (and if so,\n        how did we build anything in this directory, anyway?), so\n        try to write directly to the .sconsign file as a backup.\n        If we can't rename, try to copy the temporary contents back\n        to the .sconsign file.  Either way, always try to remove\n        the temporary file at the end.\n        \"\"\"\n        if not self.dirty:\n            return\n\n        self.merge()\n\n        temp = os.path.join(self.dir.get_internal_path(), '.scons%d' % os.getpid())\n        try:\n            file = open(temp, 'wb')\n            fname = temp\n        except IOError:\n            try:\n                file = open(self.sconsign, 'wb')\n                fname = self.sconsign\n            except IOError:\n                return\n        for key, entry in self.entries.items():\n            entry.convert_to_sconsign()\n        pickle.dump(self.entries, file, PICKLE_PROTOCOL)\n        file.close()\n        if fname != self.sconsign:\n            try:\n                mode = os.stat(self.sconsign)[0]\n                os.chmod(self.sconsign, 0o666)\n                os.unlink(self.sconsign)\n            except (IOError, OSError):\n                # Try to carry on in the face of either OSError\n                # (things like permission issues) or IOError (disk\n                # or network issues).  If there's a really dangerous\n                # issue, it should get re-raised by the calls below.\n                pass\n            try:\n                os.rename(fname, self.sconsign)\n            except OSError:\n                # An OSError failure to rename may indicate something\n                # like the directory has no write permission, but\n                # the .sconsign file itself might still be writable,\n                # so try writing on top of it directly.  An IOError\n                # here, or in any of the following calls, would get\n                # raised, indicating something like a potentially\n                # serious disk or network issue.\n                with open(self.sconsign, 'wb') as f, open(fname, 'rb') as f2:\n                    f.write(f2.read())\n                os.chmod(self.sconsign, mode)\n        try:\n            os.unlink(temp)\n        except (IOError, OSError):\n            pass\n\nForDirectory = DB\n\n\ndef File(name, dbm_module=None):\n    \"\"\"\n    Arrange for all signatures to be stored in a global .sconsign.db*\n    file.\n    \"\"\"\n    global ForDirectory, DB_Name, DB_Module\n    if name is None:\n        ForDirectory = DirFile\n        DB_Module = None\n    else:\n        ForDirectory = DB\n        DB_Name = name\n        if dbm_module is not None:\n            DB_Module = dbm_module\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Dependency scanner for C/C++ code.\"\"\"\n\nimport SCons.Node.FS\nimport SCons.cpp\nimport SCons.Util\nfrom . import ClassicCPP, FindPathDirs\n\n\nclass SConsCPPScanner(SCons.cpp.PreProcessor):\n    \"\"\"SCons-specific subclass of the cpp.py module's processing.\n\n    We subclass this so that: 1) we can deal with files represented\n    by Nodes, not strings; 2) we can keep track of the files that are\n    missing.\n    \"\"\"\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.missing = []\n\n    def initialize_result(self, fname):\n        self.result = SCons.Util.UniqueList([fname])\n\n    def finalize_result(self, fname):\n        return self.result[1:]\n\n    def find_include_file(self, t):\n        keyword, quote, fname = t\n        result = SCons.Node.FS.find_file(fname, self.searchpath[quote])\n        if not result:\n            self.missing.append((fname, self.current_file))\n        return result\n\n    def read_file(self, file):\n        try:\n            with open(str(file.rfile())) as fp:\n                return fp.read()\n        except EnvironmentError as e:\n            self.missing.append((file, self.current_file))\n            return ''\n\ndef dictify_CPPDEFINES(env):\n    cppdefines = env.get('CPPDEFINES', {})\n    if cppdefines is None:\n        return {}\n    if SCons.Util.is_Sequence(cppdefines):\n        result = {}\n        for c in cppdefines:\n            if SCons.Util.is_Sequence(c):\n                result[c[0]] = c[1]\n            else:\n                result[c] = None\n        return result\n    if not SCons.Util.is_Dict(cppdefines):\n        return {cppdefines : None}\n    return cppdefines\n\nclass SConsCPPScannerWrapper:\n    \"\"\"The SCons wrapper around a cpp.py scanner.\n\n    This is the actual glue between the calling conventions of generic\n    SCons scanners, and the (subclass of) cpp.py class that knows how\n    to look for #include lines with reasonably real C-preprocessor-like\n    evaluation of #if/#ifdef/#else/#elif lines.\n    \"\"\"\n\n    def __init__(self, name, variable):\n        self.name = name\n        self.path = FindPathDirs(variable)\n\n    def __call__(self, node, env, path=()):\n        cpp = SConsCPPScanner(\n            current=node.get_dir(), cpppath=path, dict=dictify_CPPDEFINES(env)\n        )\n        result = cpp(node)\n        for included, includer in cpp.missing:\n            SCons.Warnings.warn(\n                SCons.Warnings.DependencyWarning,\n                \"No dependency generated for file: %s (included from: %s) \"\n                \"-- file not found\" % (included, includer),\n            )\n        return result\n\n    def recurse_nodes(self, nodes):\n        return nodes\n    def select(self, node):\n        return self\n\ndef CScanner():\n    \"\"\"Return a prototype Scanner instance for scanning source files\n    that use the C pre-processor\"\"\"\n\n    # Here's how we would (or might) use the CPP scanner code above that\n    # knows how to evaluate #if/#ifdef/#else/#elif lines when searching\n    # for #includes.  This is commented out for now until we add the\n    # right configurability to let users pick between the scanners.\n    # return SConsCPPScannerWrapper(\"CScanner\", \"CPPPATH\")\n\n    cs = ClassicCPP(\n        \"CScanner\",\n        \"$CPPSUFFIXES\",\n        \"CPPPATH\",\n        r'^[ \\t]*#[ \\t]*(?:include|import)[ \\t]*(<|\")([^>\"]+)(>|\")',\n    )\n    return cs\n\n\n#\n# ConditionalScanner\n#\n\n\nclass SConsCPPConditionalScanner(SCons.cpp.PreProcessor):\n    \"\"\"SCons-specific subclass of the cpp.py module's processing.\n\n    We subclass this so that: 1) we can deal with files represented\n    by Nodes, not strings; 2) we can keep track of the files that are\n    missing.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.missing = []\n        self._known_paths = []\n\n    def initialize_result(self, fname):\n        self.result = SCons.Util.UniqueList([fname])\n\n    def find_include_file(self, t):\n        keyword, quote, fname = t\n        paths = tuple(self._known_paths) + self.searchpath[quote]\n        if quote == '\"':\n            paths = (self.current_file.dir,) + paths\n        result = SCons.Node.FS.find_file(fname, paths)\n        if result:\n            result_path = result.get_abspath()\n            for p in self.searchpath[quote]:\n                if result_path.startswith(p.get_abspath()):\n                    self._known_paths.append(p)\n                    break\n        else:\n            self.missing.append((fname, self.current_file))\n        return result\n\n    def read_file(self, file):\n        try:\n            with open(str(file.rfile())) as fp:\n                return fp.read()\n        except EnvironmentError:\n            self.missing.append((file, self.current_file))\n            return \"\"\n\n\nclass SConsCPPConditionalScannerWrapper:\n    \"\"\"\n    The SCons wrapper around a cpp.py scanner.\n\n    This is the actual glue between the calling conventions of generic\n    SCons scanners, and the (subclass of) cpp.py class that knows how\n    to look for #include lines with reasonably real C-preprocessor-like\n    evaluation of #if/#ifdef/#else/#elif lines.\n    \"\"\"\n\n    def __init__(self, name, variable):\n        self.name = name\n        self.path = FindPathDirs(variable)\n\n    def __call__(self, node, env, path=(), depth=-1):\n        cpp = SConsCPPConditionalScanner(\n            current=node.get_dir(),\n            cpppath=path,\n            dict=dictify_CPPDEFINES(env),\n            depth=depth,\n        )\n        result = cpp(node)\n        for included, includer in cpp.missing:\n            fmt = \"No dependency generated for file: %s (included from: %s) -- file not found\"\n            SCons.Warnings.warn(\n                SCons.Warnings.DependencyWarning, fmt % (included, includer)\n            )\n        return result\n\n    def recurse_nodes(self, nodes):\n        return nodes\n\n    def select(self, node):\n        return self\n\n\ndef CConditionalScanner():\n    \"\"\"\n    Return an advanced conditional Scanner instance for scanning source files\n\n    Interprets C/C++ Preprocessor conditional syntax\n    (#ifdef, #if, defined, #else, #elif, etc.).\n    \"\"\"\n    return SConsCPPConditionalScannerWrapper(\"CConditionalScanner\", \"CPPPATH\")\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport SCons.Node.FS\nfrom . import ScannerBase\n\ndef only_dirs(nodes):\n    is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir)\n    return [node for node in nodes if is_Dir(node)]\n\ndef DirScanner(**kwargs):\n    \"\"\"Return a prototype Scanner instance for scanning\n    directories for on-disk files\"\"\"\n    kwargs['node_factory'] = SCons.Node.FS.Entry\n    kwargs['recursive'] = only_dirs\n    return ScannerBase(scan_on_disk, \"DirScanner\", **kwargs)\n\ndef DirEntryScanner(**kwargs):\n    \"\"\"Return a prototype Scanner instance for \"scanning\"\n    directory Nodes for their in-memory entries\"\"\"\n    kwargs['node_factory'] = SCons.Node.FS.Entry\n    kwargs['recursive'] = None\n    return ScannerBase(scan_in_memory, \"DirEntryScanner\", **kwargs)\n\nskip_entry = {}\n\nskip_entry_list = [\n   '.',\n   '..',\n   '.sconsign',\n   # Used by the native dblite.py module.\n   '.sconsign.dblite',\n   # Used by dbm and dumbdbm.\n   '.sconsign.dir',\n   # Used by dbm.\n   '.sconsign.pag',\n   # Used by dumbdbm.\n   '.sconsign.dat',\n   '.sconsign.bak',\n   # Used by some dbm emulations using Berkeley DB.\n   '.sconsign.db',\n   # new filenames since multiple hash formats allowed:\n   '.sconsign_md5.dblite',\n   '.sconsign_sha1.dblite',\n   '.sconsign_sha256.dblite',\n   # and all the duplicate files for each sub-sconsfile type\n   '.sconsign_md5',\n   '.sconsign_md5.dir',\n   '.sconsign_md5.pag',\n   '.sconsign_md5.dat',\n   '.sconsign_md5.bak',\n   '.sconsign_md5.db',\n   '.sconsign_sha1',\n   '.sconsign_sha1.dir',\n   '.sconsign_sha1.pag',\n   '.sconsign_sha1.dat',\n   '.sconsign_sha1.bak',\n   '.sconsign_sha1.db',\n   '.sconsign_sha256',\n   '.sconsign_sha256.dir',\n   '.sconsign_sha256.pag',\n   '.sconsign_sha256.dat',\n   '.sconsign_sha256.bak',\n   '.sconsign_sha256.db',\n]\n\nfor skip in skip_entry_list:\n    skip_entry[skip] = 1\n    skip_entry[SCons.Node.FS._my_normcase(skip)] = 1\n\ndo_not_scan = lambda k: k not in skip_entry\n\ndef scan_on_disk(node, env, path=()):\n    \"\"\"\n    Scans a directory for on-disk files and directories therein.\n\n    Looking up the entries will add these to the in-memory Node tree\n    representation of the file system, so all we have to do is just\n    that and then call the in-memory scanning function.\n    \"\"\"\n    try:\n        flist = node.fs.listdir(node.get_abspath())\n    except (IOError, OSError):\n        return []\n    e = node.Entry\n    for f in  filter(do_not_scan, flist):\n        # Add ./ to the beginning of the file name so if it begins with a\n        # '#' we don't look it up relative to the top-level directory.\n        e('./' + f)\n    return scan_in_memory(node, env, path)\n\ndef scan_in_memory(node, env, path=()):\n    \"\"\"\n    \"Scans\" a Node.FS.Dir for its in-memory entries.\n    \"\"\"\n    try:\n        entries = node.entries\n    except AttributeError:\n        # It's not a Node.FS.Dir (or doesn't look enough like one for\n        # our purposes), which can happen if a target list containing\n        # mixed Node types (Dirs and Files, for example) has a Dir as\n        # the first entry.\n        return []\n    entry_list = sorted(filter(do_not_scan, list(entries.keys())))\n    return [entries[n] for n in entry_list]\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Dependency scanner for program files.\"\"\"\n\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Util\nfrom . import ScannerBase, FindPathDirs\n\n# global, set by --debug=findlibs\nprint_find_libs = None\n\ndef ProgramScanner(**kwargs):\n    \"\"\"Return a prototype Scanner instance for scanning executable\n    files for static-lib dependencies\"\"\"\n    kwargs['path_function'] = FindPathDirs('LIBPATH')\n    ps = ScannerBase(scan, \"ProgramScanner\", **kwargs)\n    return ps\n\ndef _subst_libs(env, libs):\n    \"\"\"Substitute environment variables and split into list.\"\"\"\n    if SCons.Util.is_String(libs):\n        libs = env.subst(libs)\n        if SCons.Util.is_String(libs):\n            libs = libs.split()\n    elif SCons.Util.is_Sequence(libs):\n        _libs = []\n        for l in libs:\n            _libs += _subst_libs(env, l)\n        libs = _libs\n    else:\n        # libs is an object (Node, for example)\n        libs = [libs]\n    return libs\n\ndef scan(node, env, libpath = ()):\n    \"\"\"Scans program files for static-library dependencies.\n\n    It will search the LIBPATH environment variable\n    for libraries specified in the LIBS variable, returning any\n    files it finds as dependencies.\n    \"\"\"\n    try:\n        libs = env['LIBS']\n    except KeyError:\n        # There are no LIBS in this environment, so just return a null list:\n        return []\n\n    libs = _subst_libs(env, libs)\n\n    try:\n        prefix = env['LIBPREFIXES']\n        if not SCons.Util.is_List(prefix):\n            prefix = [ prefix ]\n    except KeyError:\n        prefix = [ '' ]\n\n    try:\n        suffix = env['LIBSUFFIXES']\n        if not SCons.Util.is_List(suffix):\n            suffix = [ suffix ]\n    except KeyError:\n        suffix = [ '' ]\n\n    pairs = []\n    for suf in map(env.subst, suffix):\n        for pref in map(env.subst, prefix):\n            pairs.append((pref, suf))\n\n    result = []\n\n    if callable(libpath):\n        libpath = libpath()\n\n    find_file = SCons.Node.FS.find_file\n    adjustixes = SCons.Util.adjustixes\n    for lib in libs:\n        if SCons.Util.is_String(lib):\n            for pref, suf in pairs:\n                l = adjustixes(lib, pref, suf)\n                l = find_file(l, libpath, verbose=print_find_libs)\n                if l:\n                    result.append(l)\n        else:\n            result.append(lib)\n\n    return result\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Dependency scanner for RC (Interface Definition Language) files.\"\"\"\n\n\nimport SCons.Node.FS\nfrom . import ClassicCPP\n\n\ndef no_tlb(nodes):\n    \"\"\"Filter out .tlb files as they are binary and shouldn't be scanned.\"\"\"\n\n    # print(\"Nodes:%s\"%[str(n) for n in nodes])\n    return [n for n in nodes if str(n)[-4:] != '.tlb']\n\n\ndef RCScan():\n    \"\"\"Return a prototype Scanner instance for scanning RC source files\"\"\"\n\n    res_re = (\n        r'^(?:\\s*#\\s*(?:include)|'\n        r'.*?\\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)'\n        r'\\s*.*?)'\n        r'\\s*(<|\"| )([^>\"\\s]+)(?:[>\"\\s])*$'\n    )\n    resScanner = ClassicCPP(\n        \"ResourceScanner\", \"$RCSUFFIXES\", \"CPPPATH\", res_re, recursive=no_tlb\n    )\n\n    return resScanner\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"The Scanner package for the SCons software construction utility.\"\"\"\n\nimport re\n\nimport SCons.Node.FS\nimport SCons.PathList\nimport SCons.Util\n\n\nclass _Null:\n    pass\n\n# This is used instead of None as a default argument value so None can be\n# used as an actual argument value.\n_null = _Null\n\ndef Scanner(function, *args, **kwargs):\n    \"\"\"Factory function to create a Scanner Object.\n\n    Creates the appropriate Scanner based on the type of \"function\".\n\n    TODO:  Deprecate this some day.  We've moved the functionality\n    inside the ScannerBase class and really don't need this factory function\n    any more.  It was, however, used by some of our Tool modules, so\n    the call probably ended up in various people's custom modules\n    patterned on SCons code.\n\n    \"\"\"\n    if SCons.Util.is_Dict(function):\n        return Selector(function, *args, **kwargs)\n\n    return ScannerBase(function, *args, **kwargs)\n\n\nclass FindPathDirs:\n    \"\"\"Class to bind a specific E{*}PATH variable name to a function that\n    will return all of the E{*}path directories.\n    \"\"\"\n    def __init__(self, variable):\n        self.variable = variable\n\n    def __call__(self, env, dir=None, target=None, source=None, argument=None):\n        try:\n            path = env[self.variable]\n        except KeyError:\n            return ()\n\n        dir = dir or env.fs._cwd\n        path = SCons.PathList.PathList(path).subst_path(env, target, source)\n        return tuple(dir.Rfindalldirs(path))\n\n\nclass ScannerBase:\n    \"\"\"Base class for dependency scanners.\n\n    Implements straightforward, single-pass scanning of a single file.\n\n    A Scanner is usually set up with a scanner function (and optionally\n    a path function), but can also be a kind of dispatcher which\n    passes control to other Scanners.\n\n    A scanner function takes three arguments: a Node to scan for\n    dependecies, the construction environment to use, and an optional\n    tuple of paths (as generated by the optional path function).\n    It must return a list containing the Nodes for all the direct\n    dependencies of the file.\n\n    The optional path function is called to return paths that can be\n    searched for implicit dependency files. It takes five arguments:\n    a construction environment, a Node for the directory containing\n    the SConscript file that defined the primary target, a list of\n    target nodes, a list of source nodes, and the optional argument\n    for this instance.\n\n    Examples::\n\n        s = Scanner(my_scanner_function)\n        s = Scanner(function=my_scanner_function)\n        s = Scanner(function=my_scanner_function, argument='foo')\n\n    Args:\n        function: either a scanner function taking two or three arguments\n          and returning a list of File Nodes; or a mapping of keys to\n          other Scanner objects.\n\n        name: an optional name for identifying this scanner object\n          (defaults to \"NONE\").\n\n        argument: an optional argument that will be passed to both\n          *function* and *path_function*.\n\n        skeys: an optional list argument that can be used\n          to determine if this scanner can be used for a given Node.\n          In the case of File nodes, for example, the *skeys*\n          would be file suffixes.\n\n        path_function: an optional function which returns a tuple\n          of the directories that can be searched for implicit\n          dependency files.  May also return a callable which\n          is called with no args and returns the tuple (supporting\n          Bindable class).\n\n        node_class: optional class of Nodes which this scan will return.\n          If not specified, defaults to :class:`SCons.Node.FS.Base`.\n          If *node_class* is ``None``, then this scanner will not enforce\n          any Node conversion and will return the raw results from *function*.\n\n        node_factory: optional factory function to be called to\n          translate the raw results returned by *function*\n          into the expected *node_class* objects.\n\n        scan_check: optional function to be called to first check whether\n          this node really needs to be scanned.\n\n        recursive: optional specifier of whether this scanner should be\n          invoked recursively on all of the implicit dependencies it returns\n          (for example `#include` lines in C source files, which may refer\n          to header files which should themselves be scanned).\n          May be a callable, which will be called to filter\n          the list of nodes found to select a subset for recursive\n          scanning (the canonical example being only recursively\n          scanning subdirectories within a directory). The default\n          is to not do recursive scanning.\n    \"\"\"\n\n    def __init__(\n        self,\n        function,\n        name=\"NONE\",\n        argument=_null,\n        skeys=_null,\n        path_function=None,\n        # Node.FS.Base so that, by default, it's okay for a\n        # scanner to return a Dir, File or Entry.\n        node_class=SCons.Node.FS.Base,\n        node_factory=None,\n        scan_check=None,\n        recursive=None,\n    ):\n        \"\"\"Construct a new scanner object given a scanner function.\"\"\"\n        # Note: this class could easily work with scanner functions that take\n        # something other than a filename as an argument (e.g. a database\n        # node) and a dependencies list that aren't file names. All that\n        # would need to be changed is the documentation.\n\n        self.function = function\n        self.path_function = path_function\n        self.name = name\n        self.argument = argument\n\n        if skeys is _null:\n            if SCons.Util.is_Dict(function):\n                skeys = list(function.keys())\n            else:\n                skeys = []\n        self.skeys = skeys\n\n        self.node_class = node_class\n        self.node_factory = node_factory\n        self.scan_check = scan_check\n        if callable(recursive):\n            self.recurse_nodes = recursive\n        elif recursive:\n            self.recurse_nodes = self._recurse_all_nodes\n        else:\n            self.recurse_nodes = self._recurse_no_nodes\n\n    def path(self, env, dir=None, target=None, source=None):\n        if not self.path_function:\n            return ()\n\n        if self.argument is not _null:\n            return self.path_function(env, dir, target, source, self.argument)\n\n        return self.path_function(env, dir, target, source)\n\n    def __call__(self, node, env, path=()) -> list:\n        \"\"\"Scans a single object.\n\n        Args:\n          node: the node that will be passed to the scanner function\n          env: the environment that will be passed to the scanner function.\n          path: tuple of paths from the `path_function`\n\n        Returns:\n          A list of direct dependency nodes for the specified node.\n\n        \"\"\"\n        if self.scan_check and not self.scan_check(node, env):\n            return []\n\n        # here we may morph into a different Scanner instance:\n        self = self.select(node)  # pylint: disable=self-cls-assignment\n\n        if self.argument is not _null:\n            node_list = self.function(node, env, path, self.argument)\n        else:\n            node_list = self.function(node, env, path)\n\n        kw = {}\n        if hasattr(node, 'dir'):\n            kw['directory'] = node.dir\n        conv = env.get_factory(self.node_factory)\n        cls = self.node_class\n        nl = [conv(n, **kw) if cls and not isinstance(n, cls) else n for n in node_list]\n        return nl\n\n    def __eq__(self, other):\n        try:\n            return self.__dict__ == other.__dict__\n        except AttributeError:\n            # other probably doesn't have a __dict__\n            return self.__dict__ == other\n\n    def __hash__(self):\n        return id(self)\n\n    def __str__(self):\n        return self.name\n\n    def add_skey(self, skey):\n        \"\"\"Add a skey to the list of skeys\"\"\"\n        self.skeys.append(skey)\n\n    def get_skeys(self, env=None):\n        if env and SCons.Util.is_String(self.skeys):\n            return env.subst_list(self.skeys)[0]\n        return self.skeys\n\n    def select(self, node):\n        if SCons.Util.is_Dict(self.function):\n            key = node.scanner_key()\n            try:\n                return self.function[key]\n            except KeyError:\n                return None\n        else:\n            return self\n\n    @staticmethod\n    def _recurse_all_nodes(nodes):\n        return nodes\n\n    @staticmethod\n    def _recurse_no_nodes(nodes):\n        return []\n\n    # recurse_nodes = _recurse_no_nodes\n\n    def add_scanner(self, skey, scanner):\n        self.function[skey] = scanner\n        self.add_skey(skey)\n\n\n# keep the old name for a while in case external users are using.\n# there are no more internal uses of this class by the name \"Base\"\nBase = ScannerBase\n\n\nclass Selector(ScannerBase):\n    \"\"\"\n    A class for selecting a more specific scanner based on the\n    :func:`scanner_key` (suffix) for a specific Node.\n\n    TODO:  This functionality has been moved into the inner workings of\n    the ScannerBase class, and this class will be deprecated at some point.\n    (It was never exposed directly as part of the public interface,\n    although it is used by the :func:`Scanner` factory function that was\n    used by various Tool modules and therefore was likely a template\n    for custom modules that may be out there.)\n    \"\"\"\n    def __init__(self, mapping, *args, **kwargs):\n        super().__init__(None, *args, **kwargs)\n        self.mapping = mapping\n        self.skeys = list(mapping.keys())\n\n    def __call__(self, node, env, path=()):\n        return self.select(node)(node, env, path)\n\n    def select(self, node):\n        try:\n            return self.mapping[node.scanner_key()]\n        except KeyError:\n            return None\n\n    def add_scanner(self, skey, scanner):\n        self.mapping[skey] = scanner\n        self.add_skey(skey)\n\n\nclass Current(ScannerBase):\n    \"\"\"\n    A class for scanning files that are source files (have no builder)\n    or are derived files and are current (which implies that they exist,\n    either locally or in a repository).\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        def current_check(node, env):\n            return not node.has_builder() or node.is_up_to_date()\n\n        kwargs['scan_check'] = current_check\n        super().__init__(*args, **kwargs)\n\nclass Classic(Current):\n    \"\"\"\n    A Scanner subclass to contain the common logic for classic CPP-style\n    include scanning, but which can be customized to use different\n    regular expressions to find the includes.\n\n    Note that in order for this to work \"out of the box\" (without\n    overriding the :meth:`find_include` and :meth:`sort_key1` methods),\n    the regular expression passed to the constructor must return the\n    name of the include file in group 0.\n    \"\"\"\n\n    def __init__(self, name, suffixes, path_variable, regex, *args, **kwargs):\n        self.cre = re.compile(regex, re.M)\n\n        def _scan(node, _, path=(), self=self):\n            node = node.rfile()\n            if not node.exists():\n                return []\n            return self.scan(node, path)\n\n        kwargs['function'] = _scan\n        kwargs['path_function'] = FindPathDirs(path_variable)\n\n        # Allow recursive to propagate if child class specifies.\n        # In this case resource scanner needs to specify a filter on which files\n        # get recursively processed.  Previously was hardcoded to 1 instead of\n        # defaulted to 1.\n        kwargs['recursive'] = kwargs.get('recursive', True)\n        kwargs['skeys'] = suffixes\n        kwargs['name'] = name\n\n        super().__init__(*args, **kwargs)\n\n    @staticmethod\n    def find_include(include, source_dir, path):\n        n = SCons.Node.FS.find_file(include, (source_dir,) + tuple(path))\n        return n, include\n\n    @staticmethod\n    def sort_key(include):\n        return SCons.Node.FS._my_normcase(include)\n\n    def find_include_names(self, node):\n        return self.cre.findall(node.get_text_contents())\n\n    def scan(self, node, path=()):\n        # cache the includes list in node so we only scan it once:\n        if node.includes is not None:\n            includes = node.includes\n        else:\n            includes = self.find_include_names(node)\n            # Intern the names of the include files. Saves some memory\n            # if the same header is included many times.\n            node.includes = list(map(SCons.Util.silent_intern, includes))\n\n        # This is a hand-coded DSU (decorate-sort-undecorate, or\n        # Schwartzian transform) pattern.  The sort key is the raw name\n        # of the file as specifed on the #include line (including the\n        # \" or <, since that may affect what file is found), which lets\n        # us keep the sort order constant regardless of whether the file\n        # is actually found in a Repository or locally.\n        nodes = []\n        source_dir = node.get_dir()\n        if callable(path):\n            path = path()\n        for include in includes:\n            n, i = self.find_include(include, source_dir, path)\n\n            if n is None:\n                SCons.Warnings.warn(\n                    SCons.Warnings.DependencyWarning,\n                    \"No dependency generated for file: %s \"\n                    \"(included from: %s) -- file not found\" % (i, node),\n                )\n            else:\n                nodes.append((self.sort_key(include), n))\n\n        return [pair[1] for pair in sorted(nodes)]\n\nclass ClassicCPP(Classic):\n    \"\"\"\n    A Classic Scanner subclass which takes into account the type of\n    bracketing used to include the file, and uses classic CPP rules\n    for searching for the files based on the bracketing.\n\n    Note that in order for this to work, the regular expression passed\n    to the constructor must return the leading bracket in group 0, and\n    the contained filename in group 1.\n    \"\"\"\n    def find_include(self, include, source_dir, path):\n        include = list(map(SCons.Util.to_str, include))\n        if include[0] == '\"':\n            paths = (source_dir,) + tuple(path)\n        else:\n            paths = tuple(path) + (source_dir,)\n\n        n = SCons.Node.FS.find_file(include[1], paths)\n        i = SCons.Util.silent_intern(include[1])\n        return n, i\n\n    def sort_key(self, include):\n        return SCons.Node.FS._my_normcase(' '.join(include))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons interactive mode. \"\"\"\n\n# TODO:\n#\n# This has the potential to grow into something with a really big life\n# of its own, which might or might not be a good thing.  Nevertheless,\n# here are some enhancements that will probably be requested some day\n# and are worth keeping in mind (assuming this takes off):\n# \n# - A command to re-read / re-load the SConscript files.  This may\n#   involve allowing people to specify command-line options (e.g. -f,\n#   -I, --no-site-dir) that affect how the SConscript files are read.\n#\n# - Additional command-line options on the \"build\" command.\n#\n#   Of the supported options that seemed to make sense (after a quick\n#   pass through the list), the ones that seemed likely enough to be\n#   used are listed in the man page and have explicit test scripts.\n#\n#   These had code changed in Script/Main.py to support them, but didn't\n#   seem likely to be used regularly, so had no test scripts added:\n#\n#       build --diskcheck=*\n#       build --implicit-cache=*\n#       build --implicit-deps-changed=*\n#       build --implicit-deps-unchanged=*\n#\n#   These look like they should \"just work\" with no changes to the\n#   existing code, but like those above, look unlikely to be used and\n#   therefore had no test scripts added:\n#\n#       build --random\n#\n#   These I'm not sure about.  They might be useful for individual\n#   \"build\" commands, and may even work, but they seem unlikely enough\n#   that we'll wait until they're requested before spending any time on\n#   writing test scripts for them, or investigating whether they work.\n#\n#       build -q [???  is there a useful analog to the exit status?]\n#       build --duplicate=\n#       build --profile=\n#       build --max-drift=\n#       build --warn=*\n#       build --Y\n#\n# - Most of the SCons command-line options that the \"build\" command\n#   supports should be settable as default options that apply to all\n#   subsequent \"build\" commands.  Maybe a \"set {option}\" command that\n#   maps to \"SetOption('{option}')\".\n#\n# - Need something in the 'help' command that prints the -h output.\n#\n# - A command to run the configure subsystem separately (must see how\n#   this interacts with the new automake model).\n#\n# - Command-line completion of target names; maybe even of SCons options?\n#   Completion is something that's supported by the Python cmd module,\n#   so this should be doable without too much trouble.\n#\n\nimport cmd\nimport copy\nimport os\nimport re\nimport shlex\nimport sys\n\ntry:\n    import readline\nexcept ImportError:\n    pass\n\nclass SConsInteractiveCmd(cmd.Cmd):\n    \"\"\"\\\n\nbuild [TARGETS]         Build the specified TARGETS and their dependencies. 'b' is a synonym.\nclean [TARGETS]         Clean (remove) the specified TARGETS and their dependencies.  'c' is a synonym.\nexit                    Exit SCons interactive mode.\nhelp [COMMAND]          Prints help for the specified COMMAND.  'h' and '?' are synonyms.\nshell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!' are synonyms.\nversion                 Prints SCons version information.\n\"\"\"\n\n    synonyms = {\n        'b'     : 'build',\n        'c'     : 'clean',\n        'h'     : 'help',\n        'scons' : 'build',\n        'sh'    : 'shell',\n    }\n\n    def __init__(self, **kw):\n        cmd.Cmd.__init__(self)\n        for key, val in kw.items():\n            setattr(self, key, val)\n\n        if sys.platform == 'win32':\n            self.shell_variable = 'COMSPEC'\n        else:\n            self.shell_variable = 'SHELL'\n\n    def default(self, argv):\n        print(\"*** Unknown command: %s\" % argv[0])\n\n    def onecmd(self, line):\n        line = line.strip()\n        if not line:\n            print(self.lastcmd)\n            return self.emptyline()\n        self.lastcmd = line\n        if line[0] == '!':\n            line = 'shell ' + line[1:]\n        elif line[0] == '?':\n            line = 'help ' + line[1:]\n        if os.sep == '\\\\':\n            line = line.replace('\\\\', '\\\\\\\\')\n        argv = shlex.split(line)\n        argv[0] = self.synonyms.get(argv[0], argv[0])\n        if not argv[0]:\n            return self.default(line)\n        else:\n            try:\n                func = getattr(self, 'do_' + argv[0])\n            except AttributeError:\n                return self.default(argv)\n            return func(argv)\n\n    def do_build(self, argv):\n        \"\"\"\\\n        build [TARGETS]         Build the specified TARGETS and their\n                                dependencies.  'b' is a synonym.\n        \"\"\"\n        import SCons.Node\n        import SCons.SConsign\n        import SCons.Script.Main\n\n        options = copy.deepcopy(self.options)\n\n        options, targets = self.parser.parse_args(argv[1:], values=options)\n\n        SCons.Script.COMMAND_LINE_TARGETS = targets\n\n        if targets:\n            SCons.Script.BUILD_TARGETS = targets\n        else:\n            # If the user didn't specify any targets on the command line,\n            # use the list of default targets.\n            SCons.Script.BUILD_TARGETS = SCons.Script._build_plus_default\n\n        nodes = SCons.Script.Main._build_targets(self.fs,\n                                                 options,\n                                                 targets,\n                                                 self.target_top)\n\n        if not nodes:\n            return\n\n        # Call each of the Node's alter_targets() methods, which may\n        # provide additional targets that ended up as part of the build\n        # (the canonical example being a VariantDir() when we're building\n        # from a source directory) and which we therefore need their\n        # state cleared, too.\n        x = []\n        for n in nodes:\n            x.extend(n.alter_targets()[0])\n        nodes.extend(x)\n\n        # Clean up so that we can perform the next build correctly.\n        #\n        # We do this by walking over all the children of the targets,\n        # and clearing their state.\n        #\n        # We currently have to re-scan each node to find their\n        # children, because built nodes have already been partially\n        # cleared and don't remember their children.  (In scons\n        # 0.96.1 and earlier, this wasn't the case, and we didn't\n        # have to re-scan the nodes.)\n        #\n        # Because we have to re-scan each node, we can't clear the\n        # nodes as we walk over them, because we may end up rescanning\n        # a cleared node as we scan a later node.  Therefore, only\n        # store the list of nodes that need to be cleared as we walk\n        # the tree, and clear them in a separate pass.\n        #\n        # XXX: Someone more familiar with the inner workings of scons\n        # may be able to point out a more efficient way to do this.\n\n        SCons.Script.Main.progress_display(\"scons: Clearing cached node information ...\")\n\n        seen_nodes = {}\n\n        def get_unseen_children(node, parent, seen_nodes=seen_nodes):\n            def is_unseen(node, seen_nodes=seen_nodes):\n                return node not in seen_nodes\n            return [child for child in node.children(scan=1) if is_unseen(child)]\n\n        def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):\n            seen_nodes[node] = 1\n\n            # If this file is in a VariantDir and has a\n            # corresponding source file in the source tree, remember the\n            # node in the source tree, too.  This is needed in\n            # particular to clear cached implicit dependencies on the\n            # source file, since the scanner will scan it if the\n            # VariantDir was created with duplicate=0.\n            try:\n                rfile_method = node.rfile\n            except AttributeError:\n                return\n            else:\n                rfile = rfile_method()\n            if rfile != node:\n                seen_nodes[rfile] = 1\n\n        for node in nodes:\n            walker = SCons.Node.Walker(node,\n                                        kids_func=get_unseen_children,\n                                        eval_func=add_to_seen_nodes)\n            n = walker.get_next()\n            while n:\n                n = walker.get_next()\n\n        for node in seen_nodes.keys():\n            # Call node.clear() to clear most of the state\n            node.clear()\n            # node.clear() doesn't reset node.state, so call\n            # node.set_state() to reset it manually\n            node.set_state(SCons.Node.no_state)\n            node.implicit = None\n\n            # Debug:  Uncomment to verify that all Taskmaster reference\n            # counts have been reset to zero.\n            #if node.ref_count != 0:\n            #    from SCons.Debug import Trace\n            #    Trace('node %s, ref_count %s !!!\\n' % (node, node.ref_count))\n\n        SCons.SConsign.Reset()\n        SCons.Script.Main.progress_display(\"scons: done clearing node information.\")\n\n    def do_clean(self, argv):\n        \"\"\"\\\n        clean [TARGETS]         Clean (remove) the specified TARGETS\n                                and their dependencies.  'c' is a synonym.\n        \"\"\"\n        return self.do_build(['build', '--clean'] + argv[1:])\n\n    def do_EOF(self, argv):\n        print()\n        self.do_exit(argv)\n\n    def _do_one_help(self, arg):\n        try:\n            # If help_<arg>() exists, then call it.\n            func = getattr(self, 'help_' + arg)\n        except AttributeError:\n            try:\n                func = getattr(self, 'do_' + arg)\n            except AttributeError:\n                doc = None\n            else:\n                doc = self._doc_to_help(func)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n        else:\n            doc = self.strip_initial_spaces(func())\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def _doc_to_help(self, obj):\n        doc = obj.__doc__\n        if doc is None:\n            return ''\n        return self._strip_initial_spaces(doc)\n\n    def _strip_initial_spaces(self, s):\n        lines = s.split('\\n')\n        spaces = re.match(' *', lines[0]).group(0)\n        def strip_spaces(l, spaces=spaces):\n            if l[:len(spaces)] == spaces:\n                l = l[len(spaces):]\n            return l\n        lines = list(map(strip_spaces, lines))\n        return '\\n'.join(lines)\n\n    def do_exit(self, argv):\n        \"\"\"\\\n        exit                    Exit SCons interactive mode.\n        \"\"\"\n        sys.exit(0)\n\n    def do_help(self, argv):\n        \"\"\"\\\n        help [COMMAND]          Prints help for the specified COMMAND.  'h'\n                                and '?' are synonyms.\n        \"\"\"\n        if argv[1:]:\n            for arg in argv[1:]:\n                if self._do_one_help(arg):\n                    break\n        else:\n            # If bare 'help' is called, print this class's doc\n            # string (if it has one).\n            doc = self._doc_to_help(self.__class__)\n            if doc:\n                sys.stdout.write(doc + '\\n')\n                sys.stdout.flush()\n\n    def do_shell(self, argv):\n        \"\"\"\\\n        shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and\n                                '!' are synonyms.\n        \"\"\"\n        import subprocess\n        argv = argv[1:]\n        if not argv:\n            argv = os.environ[self.shell_variable]\n        try:\n            # Per \"[Python-Dev] subprocess insufficiently platform-independent?\"\n            # http://mail.python.org/pipermail/python-dev/2008-August/081979.html \"+\n            # Doing the right thing with an argument list currently\n            # requires different shell= values on Windows and Linux.\n            p = subprocess.Popen(argv, shell=(sys.platform=='win32'))\n        except EnvironmentError as e:\n            sys.stderr.write('scons: %s: %s\\n' % (argv[0], e.strerror))\n        else:\n            p.wait()\n\n    def do_version(self, argv):\n        \"\"\"\\\n        version                 Prints SCons version information.\n        \"\"\"\n        sys.stdout.write(self.parser.version + '\\n')\n\ndef interact(fs, parser, options, targets, target_top):\n    c = SConsInteractiveCmd(prompt = 'scons>>> ',\n                            fs = fs,\n                            parser = parser,\n                            options = options,\n                            targets = targets,\n                            target_top = target_top)\n    c.cmdloop()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"The main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\"\"\"\n\n# these define the range of versions SCons supports\nunsupported_python_version = (3, 5, 0)\ndeprecated_python_version = (3, 6, 0)\n\nimport SCons.compat\n\nimport atexit\nimport importlib.util\nimport os\nimport re\nimport sys\nimport time\nimport traceback\nimport platform\nimport threading\n\nimport SCons.CacheDir\nimport SCons.Debug\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Job\nimport SCons.Node\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.Platform.virtualenv\nimport SCons.SConf\nimport SCons.Script\nimport SCons.Taskmaster\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Script.Interactive\n\n# Global variables\nfirst_command_start = None\nlast_command_end = None\nprint_objects = False\nprint_memoizer = False\nprint_stacktrace = False\nprint_time = False\nprint_action_timestamps = False\nsconscript_time = 0\ncumulative_command_time = 0\nexit_status = 0   # final exit status, assume success by default\nthis_build_status = 0   # \"exit status\" of an individual build\nnum_jobs = None\ndelayed_warnings = []\n\n\ndef revert_io():\n    # This call is added to revert stderr and stdout to the original\n    # ones just in case some build rule or something else in the system\n    # has redirected them elsewhere.\n    sys.stderr = sys.__stderr__\n    sys.stdout = sys.__stdout__\n\n\nclass SConsPrintHelpException(Exception):\n    pass\n\n\ndisplay = SCons.Util.display\nprogress_display = SCons.Util.DisplayEngine()\n\n\nclass Progressor:\n    prev = ''\n    count = 0\n    target_string = '$TARGET'\n\n    def __init__(self, obj, interval=1, file=None, overwrite=False):\n        if file is None:\n            file = sys.stdout\n\n        self.obj = obj\n        self.file = file\n        self.interval = interval\n        self.overwrite = overwrite\n\n        if callable(obj):\n            self.func = obj\n        elif SCons.Util.is_List(obj):\n            self.func = self.spinner\n        elif obj.find(self.target_string) != -1:\n            self.func = self.replace_string\n        else:\n            self.func = self.string\n\n    def write(self, s):\n        self.file.write(s)\n        self.file.flush()\n        self.prev = s\n\n    def erase_previous(self):\n        if self.prev:\n            length = len(self.prev)\n            if self.prev[-1] in ('\\n', '\\r'):\n                length = length - 1\n            self.write(' ' * length + '\\r')\n            self.prev = ''\n\n    def spinner(self, node):\n        self.write(self.obj[self.count % len(self.obj)])\n\n    def string(self, node):\n        self.write(self.obj)\n\n    def replace_string(self, node):\n        self.write(self.obj.replace(self.target_string, str(node)))\n\n    def __call__(self, node):\n        self.count = self.count + 1\n        if (self.count % self.interval) == 0:\n            if self.overwrite:\n                self.erase_previous()\n            self.func(node)\n\nProgressObject = SCons.Util.Null()\n\ndef Progress(*args, **kw):\n    global ProgressObject\n    ProgressObject = Progressor(*args, **kw)\n\n# Task control.\n#\n\n_BuildFailures = []\n\n\ndef GetBuildFailures():\n    return _BuildFailures\n\n\nclass BuildTask(SCons.Taskmaster.OutOfDateTask):\n    \"\"\"An SCons build task.\"\"\"\n    progress = ProgressObject\n\n    def display(self, message):\n        display('scons: ' + message)\n\n    def prepare(self):\n        if not isinstance(self.progress, SCons.Util.Null):\n            for target in self.targets:\n                self.progress(target)\n        return SCons.Taskmaster.OutOfDateTask.prepare(self)\n\n    def needs_execute(self):\n        if SCons.Taskmaster.OutOfDateTask.needs_execute(self):\n            return True\n        if self.top and self.targets[0].has_builder():\n            display(\"scons: `%s' is up to date.\" % str(self.node))\n        return False\n\n    def execute(self):\n        if print_time:\n            start_time = time.time()\n            global first_command_start\n            if first_command_start is None:\n                first_command_start = start_time\n        SCons.Taskmaster.OutOfDateTask.execute(self)\n        if print_time:\n            global cumulative_command_time\n            global last_command_end\n            finish_time = time.time()\n            last_command_end = finish_time\n            cumulative_command_time += finish_time - start_time\n            if print_action_timestamps:\n                sys.stdout.write(\n                    \"Command execution start timestamp: %s: %f\\n\"\n                    % (str(self.node), start_time)\n                )\n                sys.stdout.write(\n                    \"Command execution end timestamp: %s: %f\\n\"\n                    % (str(self.node), finish_time)\n                )\n            sys.stdout.write(\n                \"Command execution time: %s: %f seconds\\n\"\n                % (str(self.node), (finish_time - start_time))\n            )\n\n    def do_failed(self, status=2):\n        _BuildFailures.append(self.exception[1])\n        global exit_status\n        global this_build_status\n        if self.options.ignore_errors:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n        elif self.options.keep_going:\n            SCons.Taskmaster.OutOfDateTask.fail_continue(self)\n            exit_status = status\n            this_build_status = status\n        else:\n            SCons.Taskmaster.OutOfDateTask.fail_stop(self)\n            exit_status = status\n            this_build_status = status\n\n    def executed(self):\n        t = self.targets[0]\n        if self.top and not t.has_builder() and not t.side_effect:\n            if not t.exists():\n                if t.__class__.__name__ in ('File', 'Dir', 'Entry'):\n                    errstr=\"Do not know how to make %s target `%s' (%s).\" % (t.__class__.__name__, t, t.get_abspath())\n                else: # Alias or Python or ...\n                    errstr=\"Do not know how to make %s target `%s'.\" % (t.__class__.__name__, t)\n                sys.stderr.write(\"scons: *** \" + errstr)\n                if not self.options.keep_going:\n                    sys.stderr.write(\"  Stop.\")\n                sys.stderr.write(\"\\n\")\n                try:\n                    raise SCons.Errors.BuildError(t, errstr)\n                except KeyboardInterrupt:\n                    raise\n                except:\n                    self.exception_set()\n                self.do_failed()\n            else:\n                print(\"scons: Nothing to be done for `%s'.\" % t)\n                SCons.Taskmaster.OutOfDateTask.executed(self)\n        else:\n            SCons.Taskmaster.OutOfDateTask.executed(self)\n\n    def failed(self):\n        # Handle the failure of a build task.  The primary purpose here\n        # is to display the various types of Errors and Exceptions\n        # appropriately.\n        exc_info = self.exc_info()\n        try:\n            t, e, tb = exc_info\n        except ValueError:\n            t, e = exc_info\n            tb = None\n\n        if t is None:\n            # The Taskmaster didn't record an exception for this Task;\n            # see if the sys module has one.\n            try:\n                t, e, tb = sys.exc_info()[:]\n            except ValueError:\n                t, e = exc_info\n                tb = None\n\n        # Deprecated string exceptions will have their string stored\n        # in the first entry of the tuple.\n        if e is None:\n            e = t\n\n        buildError = SCons.Errors.convert_to_BuildError(e)\n        if not buildError.node:\n            buildError.node = self.node\n\n        node = buildError.node\n        if not SCons.Util.is_List(node):\n                node = [ node ]\n        nodename = ', '.join(map(str, node))\n\n        errfmt = \"scons: *** [%s] %s\\n\"\n        sys.stderr.write(errfmt % (nodename, buildError))\n\n        if (buildError.exc_info[2] and buildError.exc_info[1] and\n           not isinstance(\n               buildError.exc_info[1],\n               (EnvironmentError, SCons.Errors.StopError,\n                            SCons.Errors.UserError))):\n            type, value, trace = buildError.exc_info\n            if tb and print_stacktrace:\n                sys.stderr.write(\"scons: internal stack trace:\\n\")\n                traceback.print_tb(tb, file=sys.stderr)\n            traceback.print_exception(type, value, trace)\n        elif tb and print_stacktrace:\n            sys.stderr.write(\"scons: internal stack trace:\\n\")\n            traceback.print_tb(tb, file=sys.stderr)\n\n        self.exception = (e, buildError, tb) # type, value, traceback\n        self.do_failed(buildError.exitstatus)\n\n        self.exc_clear()\n\n    def postprocess(self):\n        if self.top:\n            t = self.targets[0]\n            for tp in self.options.tree_printers:\n                tp.display(t)\n            if self.options.debug_includes:\n                tree = t.render_include_tree()\n                if tree:\n                    print()\n                    print(tree)\n        SCons.Taskmaster.OutOfDateTask.postprocess(self)\n\n    def make_ready(self):\n        \"\"\"Make a task ready for execution\"\"\"\n        SCons.Taskmaster.OutOfDateTask.make_ready(self)\n        if self.out_of_date and self.options.debug_explain:\n            explanation = self.out_of_date[0].explain()\n            if explanation:\n                sys.stdout.write(\"scons: \" + explanation)\n\n\nclass CleanTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons clean task.\"\"\"\n    def fs_delete(self, path, pathstr, remove=True):\n        try:\n            if os.path.lexists(path):\n                if os.path.isfile(path) or os.path.islink(path):\n                    if remove: os.unlink(path)\n                    display(\"Removed \" + pathstr)\n                elif os.path.isdir(path) and not os.path.islink(path):\n                    # delete everything in the dir\n                    for e in sorted(os.listdir(path)):\n                        p = os.path.join(path, e)\n                        s = os.path.join(pathstr, e)\n                        if os.path.isfile(p):\n                            if remove: os.unlink(p)\n                            display(\"Removed \" + s)\n                        else:\n                            self.fs_delete(p, s, remove)\n                    # then delete dir itself\n                    if remove: os.rmdir(path)\n                    display(\"Removed directory \" + pathstr)\n                else:\n                    errstr = \"Path '%s' exists but isn't a file or directory.\"\n                    raise SCons.Errors.UserError(errstr % pathstr)\n        except SCons.Errors.UserError as e:\n            print(e)\n        except (IOError, OSError) as e:\n            print(\"scons: Could not remove '%s':\" % pathstr, e.strerror)\n\n    def _get_files_to_clean(self):\n        result = []\n        target = self.targets[0]\n        if target.has_builder() or target.side_effect:\n            result = [t for t in self.targets if not t.noclean]\n        return result\n\n    def _clean_targets(self, remove=True):\n        target = self.targets[0]\n        if target in SCons.Environment.CleanTargets:\n            files = SCons.Environment.CleanTargets[target]\n            for f in files:\n                self.fs_delete(f.get_abspath(), str(f), remove)\n\n    def show(self):\n        for t in self._get_files_to_clean():\n            if not t.isdir():\n                display(\"Removed \" + str(t))\n        self._clean_targets(remove=False)\n\n    def remove(self):\n        for t in self._get_files_to_clean():\n            try:\n                removed = t.remove()\n            except OSError as e:\n                # An OSError may indicate something like a permissions\n                # issue, an IOError would indicate something like\n                # the file not existing.  In either case, print a\n                # message and keep going to try to remove as many\n                # targets as possible.\n                print(\"scons: Could not remove '{0}'\".format(str(t)), e.strerror)\n            else:\n                if removed:\n                    display(\"Removed \" + str(t))\n        self._clean_targets(remove=True)\n\n    execute = remove\n\n    # We want the Taskmaster to update the Node states (and therefore\n    # handle reference counts, etc.), but we don't want to call\n    # back to the Node's post-build methods, which would do things\n    # we don't want, like store .sconsign information.\n    executed = SCons.Taskmaster.Task.executed_without_callbacks\n\n    # Have the Taskmaster arrange to \"execute\" all of the targets, because\n    # we'll figure out ourselves (in remove() or show() above) whether\n    # anything really needs to be done.\n    make_ready = SCons.Taskmaster.Task.make_ready_all\n\n    def prepare(self):\n        pass\n\nclass QuestionTask(SCons.Taskmaster.AlwaysTask):\n    \"\"\"An SCons task for the -q (question) option.\"\"\"\n    def prepare(self):\n        pass\n\n    def execute(self):\n        if self.targets[0].get_state() != SCons.Node.up_to_date or \\\n           (self.top and not self.targets[0].exists()):\n            global exit_status\n            global this_build_status\n            exit_status = 1\n            this_build_status = 1\n            self.tm.stop()\n\n    def executed(self):\n        pass\n\n\nclass TreePrinter:\n    def __init__(self, derived=False, prune=False, status=False, sLineDraw=False):\n        self.derived = derived\n        self.prune = prune\n        self.status = status\n        self.sLineDraw = sLineDraw\n    def get_all_children(self, node):\n        return node.all_children()\n    def get_derived_children(self, node):\n        children = node.all_children(None)\n        return [x for x in children if x.has_builder()]\n    def display(self, t):\n        if self.derived:\n            func = self.get_derived_children\n        else:\n            func = self.get_all_children\n        s = self.status and 2 or 0\n        SCons.Util.print_tree(t, func, prune=self.prune, showtags=s, lastChild=True, singleLineDraw=self.sLineDraw)\n\n\ndef python_version_string():\n    return sys.version.split()[0]\n\ndef python_version_unsupported(version=sys.version_info):\n    return version < unsupported_python_version\n\ndef python_version_deprecated(version=sys.version_info):\n    return version < deprecated_python_version\n\n\nclass FakeOptionParser:\n    \"\"\"\n    A do-nothing option parser, used for the initial OptionsParser variable.\n\n    During normal SCons operation, the OptionsParser is created right\n    away by the main() function.  Certain tests scripts however, can\n    introspect on different Tool modules, the initialization of which\n    can try to add a new, local option to an otherwise uninitialized\n    OptionsParser object.  This allows that introspection to happen\n    without blowing up.\n\n    \"\"\"\n    class FakeOptionValues:\n        def __getattr__(self, attr):\n            return None\n    values = FakeOptionValues()\n    def add_local_option(self, *args, **kw):\n        pass\n\nOptionsParser = FakeOptionParser()\n\ndef AddOption(*args, **kw):\n    if 'default' not in kw:\n        kw['default'] = None\n    result = OptionsParser.add_local_option(*args, **kw)\n    return result\n\ndef GetOption(name):\n    return getattr(OptionsParser.values, name)\n\ndef SetOption(name, value):\n    return OptionsParser.values.set_option(name, value)\n\ndef PrintHelp(file=None):\n    OptionsParser.print_help(file=file)\n\nclass Stats:\n    def __init__(self):\n        self.stats = []\n        self.labels = []\n        self.append = self.do_nothing\n        self.print_stats = self.do_nothing\n    def enable(self, outfp):\n        self.outfp = outfp\n        self.append = self.do_append\n        self.print_stats = self.do_print\n    def do_nothing(self, *args, **kw):\n        pass\n\nclass CountStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.fetchLoggedInstances())\n    def do_print(self):\n        stats_table = {}\n        for s in self.stats:\n            for n in [t[0] for t in s]:\n                stats_table[n] = [0, 0, 0, 0]\n        i = 0\n        for s in self.stats:\n            for n, c in s:\n                stats_table[n][i] = c\n            i = i + 1\n        self.outfp.write(\"Object counts:\\n\")\n        pre = [\"   \"]\n        post = [\"   %s\\n\"]\n        l = len(self.stats)\n        fmt1 = ''.join(pre + [' %7s']*l + post)\n        fmt2 = ''.join(pre + [' %7d']*l + post)\n        labels = self.labels[:l]\n        labels.append((\"\", \"Class\"))\n        self.outfp.write(fmt1 % tuple([x[0] for x in labels]))\n        self.outfp.write(fmt1 % tuple([x[1] for x in labels]))\n        for k in sorted(stats_table.keys()):\n            r = stats_table[k][:l] + [k]\n            self.outfp.write(fmt2 % tuple(r))\n\ncount_stats = CountStats()\n\nclass MemStats(Stats):\n    def do_append(self, label):\n        self.labels.append(label)\n        self.stats.append(SCons.Debug.memory())\n    def do_print(self):\n        fmt = 'Memory %-32s %12d\\n'\n        for label, stats in zip(self.labels, self.stats):\n            self.outfp.write(fmt % (label, stats))\n\nmemory_stats = MemStats()\n\n# utility functions\n\ndef _scons_syntax_error(e):\n    \"\"\"Handle syntax errors. Print out a message and show where the error\n    occurred.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    lines = traceback.format_exception_only(etype, value)\n    for line in lines:\n        sys.stderr.write(line+'\\n')\n    sys.exit(2)\n\ndef find_deepest_user_frame(tb):\n    \"\"\"\n    Find the deepest stack frame that is not part of SCons.\n\n    Input is a \"pre-processed\" stack trace in the form\n    returned by traceback.extract_tb() or traceback.extract_stack()\n    \"\"\"\n\n    tb.reverse()\n\n    # find the deepest traceback frame that is not part\n    # of SCons:\n    for frame in tb:\n        filename = frame[0]\n        if filename.find(os.sep+'SCons'+os.sep) == -1:\n            return frame\n    return tb[0]\n\ndef _scons_user_error(e):\n    \"\"\"Handle user errors. Print out a message and a description of the\n    error, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    global print_stacktrace\n    etype, value, tb = sys.exc_info()\n    if print_stacktrace:\n        traceback.print_exception(etype, value, tb)\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: *** %s\\n\" % value)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n    sys.exit(2)\n\ndef _scons_user_warning(e):\n    \"\"\"Handle user warnings. Print out a message and a description of\n    the warning, along with the line number and routine where it occured.\n    The file and line number will be the deepest stack frame that is\n    not part of SCons itself.\n    \"\"\"\n    etype, value, tb = sys.exc_info()\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e)\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_warning(e):\n    \"\"\"Slightly different from _scons_user_warning in that we use the\n    *current call stack* rather than sys.exc_info() to get our stack trace.\n    This is used by the warnings framework to print warnings.\"\"\"\n    filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack())\n    sys.stderr.write(\"\\nscons: warning: %s\\n\" % e.args[0])\n    sys.stderr.write('File \"%s\", line %d, in %s\\n' % (filename, lineno, routine))\n\ndef _scons_internal_error():\n    \"\"\"Handle all errors but user errors. Print out a message telling\n    the user what to do in this case and print a normal trace.\n    \"\"\"\n    print('internal error')\n    traceback.print_exc()\n    sys.exit(2)\n\ndef _SConstruct_exists(dirname='', repositories=[], filelist=None):\n    \"\"\"This function checks that an SConstruct file exists in a directory.\n    If so, it returns the path of the file. By default, it checks the\n    current directory.\n    \"\"\"\n    if not filelist:\n        filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py']\n    for file in filelist:\n        sfile = os.path.join(dirname, file)\n        if os.path.isfile(sfile):\n            return sfile\n        if not os.path.isabs(sfile):\n            for rep in repositories:\n                if os.path.isfile(os.path.join(rep, sfile)):\n                    return sfile\n    return None\n\ndef _set_debug_values(options):\n    global print_memoizer, print_objects, print_stacktrace, print_time, print_action_timestamps\n\n    debug_values = options.debug\n\n    if \"count\" in debug_values:\n        # All of the object counts are within \"if track_instances:\" blocks,\n        # which get stripped when running optimized (with python -O or\n        # from compiled *.pyo files).  Provide a warning if __debug__ is\n        # stripped, so it doesn't just look like --debug=count is broken.\n        enable_count = False\n        if __debug__: enable_count = True\n        if enable_count:\n            count_stats.enable(sys.stdout)\n            SCons.Debug.track_instances = True\n        else:\n            msg = \"--debug=count is not supported when running SCons\\n\" + \\\n                  \"\\twith the python -O option or optimized (.pyo) modules.\"\n            SCons.Warnings.warn(SCons.Warnings.NoObjectCountWarning, msg)\n    if \"dtree\" in debug_values:\n        options.tree_printers.append(TreePrinter(derived=True))\n    options.debug_explain = (\"explain\" in debug_values)\n    if \"findlibs\" in debug_values:\n        SCons.Scanner.Prog.print_find_libs = \"findlibs\"\n    options.debug_includes = (\"includes\" in debug_values)\n    print_memoizer = (\"memoizer\" in debug_values)\n    if \"memory\" in debug_values:\n        memory_stats.enable(sys.stdout)\n    print_objects = (\"objects\" in debug_values)\n    if print_objects:\n        SCons.Debug.track_instances = True\n    if \"presub\" in debug_values:\n        SCons.Action.print_actions_presub = True\n    if \"stacktrace\" in debug_values:\n        print_stacktrace = True\n    if \"stree\" in debug_values:\n        options.tree_printers.append(TreePrinter(status=True))\n    if \"time\" in debug_values:\n        print_time = True\n    if \"action-timestamps\" in debug_values:\n        print_time = True\n        print_action_timestamps = True\n    if \"tree\" in debug_values:\n        options.tree_printers.append(TreePrinter())\n    if \"prepare\" in debug_values:\n        SCons.Taskmaster.print_prepare = True\n    if \"duplicate\" in debug_values:\n        SCons.Node.print_duplicate = True\n\ndef _create_path(plist):\n    path = '.'\n    for d in plist:\n        if os.path.isabs(d):\n            path = d\n        else:\n            path = path + '/' + d\n    return path\n\ndef _load_site_scons_dir(topdir, site_dir_name=None):\n    \"\"\"Load the site directory under topdir.\n\n    If a site dir name is supplied use it, else use default \"site_scons\"\n    Prepend site dir to sys.path.\n    If a \"site_tools\" subdir exists, prepend to toolpath.\n    Import \"site_init.py\" from site dir if it exists.\n    \"\"\"\n    if site_dir_name:\n        err_if_not_found = True       # user specified: err if missing\n    else:\n        site_dir_name = \"site_scons\"\n        err_if_not_found = False      # scons default: okay to be missing\n    site_dir = os.path.join(topdir, site_dir_name)\n\n    if not os.path.exists(site_dir):\n        if err_if_not_found:\n            raise SCons.Errors.UserError(\"site dir %s not found.\" % site_dir)\n        return\n    sys.path.insert(0, os.path.abspath(site_dir))\n\n    site_init_filename = \"site_init.py\"\n    site_init_modname = \"site_init\"\n    site_tools_dirname = \"site_tools\"\n    site_init_file = os.path.join(site_dir, site_init_filename)\n    site_tools_dir = os.path.join(site_dir, site_tools_dirname)\n\n    if os.path.exists(site_tools_dir):\n        SCons.Tool.DefaultToolpath.insert(0, os.path.abspath(site_tools_dir))\n\n    if not os.path.exists(site_init_file):\n        return\n\n    # \"import\" the site_init.py file into the SCons.Script namespace.\n    # This is a variant on the basic Python import flow in that the globals\n    # dict for the compile step is prepopulated from the SCons.Script\n    # module object; on success the SCons.Script globals are refilled\n    # from the site_init globals so it all appears in SCons.Script\n    # instead of as a separate module.\n    try:\n        try:\n            m = sys.modules['SCons.Script']\n        except KeyError:\n            fmt = 'cannot import {}: missing SCons.Script module'\n            raise SCons.Errors.InternalError(fmt.format(site_init_file))\n\n        spec = importlib.util.spec_from_file_location(site_init_modname, site_init_file)\n        site_m = {\n            \"__file__\": spec.origin,\n            \"__name__\": spec.name,\n            \"__doc__\": None,\n        }\n        re_dunder = re.compile(r\"__[^_]+__\")\n        # update site dict with all but magic (dunder) methods\n        for k, v in m.__dict__.items():\n            if not re_dunder.match(k):\n                site_m[k] = v\n\n        with open(spec.origin, 'r') as f:\n            code = f.read()\n        try:\n            codeobj = compile(code, spec.name, \"exec\")\n            exec(codeobj, site_m)\n        except KeyboardInterrupt:\n            raise\n        except Exception:\n            fmt = \"*** Error loading site_init file {}:\\n\"\n            sys.stderr.write(fmt.format(site_init_file))\n            raise\n        else:\n            # now refill globals with site_init's symbols\n            for k, v in site_m.items():\n                if not re_dunder.match(k):\n                    m.__dict__[k] = v\n    except KeyboardInterrupt:\n        raise\n    except Exception:\n        fmt = \"*** cannot import site init file {}:\\n\"\n        sys.stderr.write(fmt.format(site_init_file))\n        raise\n\n\ndef _load_all_site_scons_dirs(topdir, verbose=False):\n    \"\"\"Load all of the predefined site_scons dir.\n    Order is significant; we load them in order from most generic\n    (machine-wide) to most specific (topdir).\n    The verbose argument is only for testing.\n    \"\"\"\n    platform = SCons.Platform.platform_default()\n\n    def homedir(d):\n        return os.path.expanduser('~/'+d)\n\n    if platform == 'win32' or platform == 'cygwin':\n        # Note we use $ here instead of %...% because older\n        # pythons (prior to 2.6?) didn't expand %...% on Windows.\n        # This set of dirs should work on XP, Vista, 7 and later.\n        sysdirs=[\n            os.path.expandvars('$ALLUSERSPROFILE\\\\Application Data\\\\scons'),\n            os.path.expandvars('$USERPROFILE\\\\Local Settings\\\\Application Data\\\\scons')]\n        appdatadir = os.path.expandvars('$APPDATA\\\\scons')\n        if appdatadir not in sysdirs:\n            sysdirs.append(appdatadir)\n        sysdirs.append(homedir('.scons'))\n\n    elif platform == 'darwin':  # MacOS X\n        sysdirs=['/Library/Application Support/SCons',\n                 '/opt/local/share/scons', # (for MacPorts)\n                 '/sw/share/scons', # (for Fink)\n                  homedir('Library/Application Support/SCons'),\n                  homedir('.scons')]\n    elif platform == 'sunos':   # Solaris\n        sysdirs=['/opt/sfw/scons',\n                 '/usr/share/scons',\n                 homedir('.scons')]\n    else:                       # Linux, HPUX, etc.\n        # assume posix-like, i.e. platform == 'posix'\n        sysdirs=['/usr/share/scons',\n                 homedir('.scons')]\n\n    dirs = sysdirs + [topdir]\n    for d in dirs:\n        if verbose:    # this is used by unit tests.\n            print(\"Loading site dir \", d)\n        _load_site_scons_dir(d)\n\ndef test_load_all_site_scons_dirs(d):\n    _load_all_site_scons_dirs(d, True)\n\ndef version_string(label, module):\n    version = module.__version__\n    build = module.__build__\n    if build:\n        if build[0] != '.':\n            build = '.' + build\n        version = version + build\n    fmt = \"\\t%s: v%s, %s, by %s on %s\\n\"\n    return fmt % (label,\n                  version,\n                  module.__date__,\n                  module.__developer__,\n                  module.__buildsys__)\n\ndef path_string(label, module):\n    path = module.__path__\n    return \"\\t%s path: %s\\n\"%(label,path)\n\ndef _main(parser):\n    global exit_status\n    global this_build_status\n\n    options = parser.values\n\n    # Here's where everything really happens.\n\n    # First order of business:  set up default warnings and then\n    # handle the user's warning options, so that we can issue (or\n    # suppress) appropriate warnings about anything that might happen,\n    # as configured by the user.\n\n    default_warnings = [ SCons.Warnings.WarningOnByDefault,\n                         SCons.Warnings.DeprecatedWarning,\n                       ]\n\n    for warning in default_warnings:\n        SCons.Warnings.enableWarningClass(warning)\n    SCons.Warnings._warningOut = _scons_internal_warning\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we have the warnings configuration set up, we can actually\n    # issue (or suppress) any warnings about warning-worthy things that\n    # occurred while the command-line options were getting parsed.\n    try:\n        dw = options.delayed_warnings\n    except AttributeError:\n        pass\n    else:\n        delayed_warnings.extend(dw)\n    for warning_type, message in delayed_warnings:\n        SCons.Warnings.warn(warning_type, message)\n\n    if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:\n        if options.enable_virtualenv:\n            SCons.Platform.virtualenv.enable_virtualenv = True\n\n    if options.ignore_virtualenv:\n        SCons.Platform.virtualenv.ignore_virtualenv = True\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    # Next, we want to create the FS object that represents the outside\n    # world's file system, as that's central to a lot of initialization.\n    # To do this, however, we need to be in the directory from which we\n    # want to start everything, which means first handling any relevant\n    # options that might cause us to chdir somewhere (-C, -D, -U, -u).\n    if options.directory:\n        script_dir = os.path.abspath(_create_path(options.directory))\n    else:\n        script_dir = os.getcwd()\n\n    target_top = None\n    if options.climb_up:\n        target_top = '.'  # directory to prepend to targets\n        while script_dir and not _SConstruct_exists(script_dir,\n                                                    options.repository,\n                                                    options.file):\n            script_dir, last_part = os.path.split(script_dir)\n            if last_part:\n                target_top = os.path.join(last_part, target_top)\n            else:\n                script_dir = ''\n\n    if script_dir and script_dir != os.getcwd():\n        if not options.silent:\n            display(\"scons: Entering directory `%s'\" % script_dir)\n        try:\n            os.chdir(script_dir)\n        except OSError:\n            sys.stderr.write(\"Could not change directory to %s\\n\" % script_dir)\n\n    # Now that we're in the top-level SConstruct directory, go ahead\n    # and initialize the FS object that represents the file system,\n    # and make it the build engine default.\n    fs = SCons.Node.FS.get_default_fs()\n\n    for rep in options.repository:\n        fs.Repository(rep)\n\n    # Now that we have the FS object, the next order of business is to\n    # check for an SConstruct file (or other specified config file).\n    # If there isn't one, we can bail before doing any more work.\n    scripts = []\n    if options.file:\n        scripts.extend(options.file)\n    if not scripts:\n        sfile = _SConstruct_exists(repositories=options.repository,\n                                   filelist=options.file)\n        if sfile:\n            scripts.append(sfile)\n\n    if not scripts:\n        if options.help:\n            # There's no SConstruct, but they specified -h.\n            # Give them the options usage now, before we fail\n            # trying to read a non-existent SConstruct file.\n            raise SConsPrintHelpException\n        raise SCons.Errors.UserError(\"No SConstruct file found.\")\n\n    if scripts[0] == \"-\":\n        d = fs.getcwd()\n    else:\n        d = fs.File(scripts[0]).dir\n    fs.set_SConstruct_dir(d)\n\n    _set_debug_values(options)\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.implicit_deps_changed = options.implicit_deps_changed\n    SCons.Node.implicit_deps_unchanged = options.implicit_deps_unchanged\n\n    if options.no_exec:\n        SCons.SConf.dryrun = 1\n        SCons.Action.execute_actions = None\n    if options.question:\n        SCons.SConf.dryrun = 1\n    if options.clean:\n        SCons.SConf.SetBuildType('clean')\n    if options.help:\n        SCons.SConf.SetBuildType('help')\n    SCons.SConf.SetCacheMode(options.config)\n    SCons.SConf.SetProgressDisplay(progress_display)\n\n    if options.no_progress or options.silent:\n        progress_display.set_mode(0)\n\n    # if site_dir unchanged from default None, neither --site-dir\n    # nor --no-site-dir was seen, use SCons default\n    if options.site_dir is None:\n        _load_all_site_scons_dirs(d.get_internal_path())\n    elif options.site_dir:  # if a dir was set, use it\n        _load_site_scons_dir(d.get_internal_path(), options.site_dir)\n\n    if options.include_dir:\n        sys.path = options.include_dir + sys.path\n\n    # If we're about to start SCons in the interactive mode,\n    # inform the FS about this right here. Else, the release_target_info\n    # method could get called on some nodes, like the used \"gcc\" compiler,\n    # when using the Configure methods within the SConscripts.\n    # This would then cause subtle bugs, as already happened in #2971.\n    if options.interactive:\n        SCons.Node.interactive = True\n\n    # That should cover (most of) the options.\n    # Next, set up the variables that hold command-line arguments,\n    # so the SConscript files that we read and execute have access to them.\n    # TODO: for options defined via AddOption which take space-separated\n    # option-args, the option-args will collect into targets here,\n    # because we don't yet know to do any different.\n    targets = []\n    xmit_args = []\n    for a in parser.largs:\n        # Skip so-far unrecognized options, and empty string args\n        if a.startswith('-') or a in ('', '\"\"', \"''\"):\n            continue\n        if '=' in a:\n            xmit_args.append(a)\n        else:\n            targets.append(a)\n    SCons.Script._Add_Targets(targets + parser.rargs)\n    SCons.Script._Add_Arguments(xmit_args)\n\n    # If stdout is not a tty, replace it with a wrapper object to call flush\n    # after every write.\n    #\n    # Tty devices automatically flush after every newline, so the replacement\n    # isn't necessary.  Furthermore, if we replace sys.stdout, the readline\n    # module will no longer work.  This affects the behavior during\n    # --interactive mode.  --interactive should only be used when stdin and\n    # stdout refer to a tty.\n    if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():\n        sys.stdout = SCons.Util.Unbuffered(sys.stdout)\n    if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty():\n        sys.stderr = SCons.Util.Unbuffered(sys.stderr)\n\n    memory_stats.append('before reading SConscript files:')\n    count_stats.append(('pre-', 'read'))\n\n    # And here's where we (finally) read the SConscript files.\n\n    progress_display(\"scons: Reading SConscript files ...\")\n\n    if print_time:\n        start_time = time.time()\n    try:\n        for script in scripts:\n            SCons.Script._SConscript._SConscript(fs, script)\n    except SCons.Errors.StopError as e:\n        # We had problems reading an SConscript file, such as it\n        # couldn't be copied in to the VariantDir.  Since we're just\n        # reading SConscript files and haven't started building\n        # things yet, stop regardless of whether they used -i or -k\n        # or anything else.\n        revert_io()\n        sys.stderr.write(\"scons: *** %s  Stop.\\n\" % e)\n        sys.exit(2)\n    if print_time:\n        global sconscript_time\n        sconscript_time = time.time() - start_time\n\n    progress_display(\"scons: done reading SConscript files.\")\n\n    memory_stats.append('after reading SConscript files:')\n    count_stats.append(('post-', 'read'))\n\n    # Re-{enable,disable} warnings in case they disabled some in\n    # the SConscript file.\n    #\n    # We delay enabling the PythonVersionWarning class until here so that,\n    # if they explicitly disabled it in either in the command line or in\n    # $SCONSFLAGS, or in the SConscript file, then the search through\n    # the list of deprecated warning classes will find that disabling\n    # first and not issue the warning.\n    #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)\n    SCons.Warnings.process_warn_strings(options.warn)\n\n    # Now that we've read the SConscript files, we can check for the\n    # warning about deprecated Python versions--delayed until here\n    # in case they disabled the warning in the SConscript files.\n    if python_version_deprecated():\n        msg = \"Support for pre-%s Python version (%s) is deprecated.\\n\" + \\\n              \"    If this will cause hardship, contact scons-dev@scons.org\"\n        deprecated_version_string = \".\".join(map(str, deprecated_python_version))\n        SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,\n                            msg % (deprecated_version_string, python_version_string()))\n\n    if not options.help:\n        # [ ] Clarify why we need to create Builder here at all, and\n        #     why it is created in DefaultEnvironment\n        # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30\n        if SCons.SConf.NeedConfigHBuilder():\n            SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())\n\n    # Now re-parse the command-line options (any to the left of a '--'\n    # argument, that is) with any user-defined command-line options that\n    # the SConscript files may have added to the parser object.  This will\n    # emit the appropriate error message and exit if any unknown option\n    # was specified on the command line.\n\n    parser.preserve_unknown_options = False\n    parser.parse_args(parser.largs, options)\n\n    if options.help:\n        help_text = SCons.Script.help_text\n        if help_text is None:\n            # They specified -h, but there was no Help() inside the\n            # SConscript files.  Give them the options usage.\n            raise SConsPrintHelpException\n        else:\n            print(help_text)\n            print(\"Use scons -H for help about command-line options.\")\n        exit_status = 0\n        return\n\n    # Change directory to the top-level SConstruct directory, then tell\n    # the Node.FS subsystem that we're all done reading the SConscript\n    # files and calling Repository() and VariantDir() and changing\n    # directories and the like, so it can go ahead and start memoizing\n    # the string values of file system nodes.\n\n    fs.chdir(fs.Top)\n\n    SCons.Node.FS.save_strings(1)\n\n    # Now that we've read the SConscripts we can set the options\n    # that are SConscript settable:\n    SCons.Node.implicit_cache = options.implicit_cache\n    SCons.Node.FS.set_duplicate(options.duplicate)\n    fs.set_max_drift(options.max_drift)\n\n    SCons.Job.explicit_stack_size = options.stack_size\n\n    # Hash format and chunksize are set late to support SetOption being called\n    # in a SConscript or SConstruct file.\n    SCons.Util.set_hash_format(options.hash_format)\n    if options.md5_chunksize:\n        SCons.Node.FS.File.hash_chunksize = options.md5_chunksize * 1024\n\n    platform = SCons.Platform.platform_module()\n\n    if options.interactive:\n        SCons.Script.Interactive.interact(fs, OptionsParser, options,\n                                          targets, target_top)\n\n    else:\n\n        # Build the targets\n        nodes = _build_targets(fs, options, targets, target_top)\n        if not nodes:\n            revert_io()\n            print('Found nothing to build')\n            exit_status = 2\n\ndef _build_targets(fs, options, targets, target_top):\n\n    global this_build_status\n    this_build_status = 0\n\n    progress_display.set_mode(not (options.no_progress or options.silent))\n    display.set_mode(not options.silent)\n    SCons.Action.print_actions          = not options.silent\n    SCons.Action.execute_actions        = not options.no_exec\n    SCons.Node.do_store_info            = not options.no_exec\n    SCons.SConf.dryrun                  = options.no_exec\n\n    if options.diskcheck:\n        SCons.Node.FS.set_diskcheck(options.diskcheck)\n\n    SCons.CacheDir.cache_enabled = not options.cache_disable\n    SCons.CacheDir.cache_readonly = options.cache_readonly\n    SCons.CacheDir.cache_debug = options.cache_debug\n    SCons.CacheDir.cache_force = options.cache_force\n    SCons.CacheDir.cache_show = options.cache_show\n\n    if options.no_exec:\n        CleanTask.execute = CleanTask.show\n    else:\n        CleanTask.execute = CleanTask.remove\n\n    lookup_top = None\n    if targets or SCons.Script.BUILD_TARGETS != SCons.Script._build_plus_default:\n        # They specified targets on the command line or modified\n        # BUILD_TARGETS in the SConscript file(s), so if they used -u,\n        # -U or -D, we have to look up targets relative to the top,\n        # but we build whatever they specified.\n        if target_top:\n            lookup_top = fs.Dir(target_top)\n            target_top = None\n\n        targets = SCons.Script.BUILD_TARGETS\n    else:\n        # There are no targets specified on the command line,\n        # so if they used -u, -U or -D, we may have to restrict\n        # what actually gets built.\n        d = None\n        if target_top:\n            if options.climb_up == 1:\n                # -u, local directory and below\n                target_top = fs.Dir(target_top)\n                lookup_top = target_top\n            elif options.climb_up == 2:\n                # -D, all Default() targets\n                target_top = None\n                lookup_top = None\n            elif options.climb_up == 3:\n                # -U, local SConscript Default() targets\n                target_top = fs.Dir(target_top)\n                def check_dir(x, target_top=target_top):\n                    if hasattr(x, 'cwd') and x.cwd is not None:\n                        cwd = x.cwd.srcnode()\n                        return cwd == target_top\n                    else:\n                        # x doesn't have a cwd, so it's either not a target,\n                        # or not a file, so go ahead and keep it as a default\n                        # target and let the engine sort it out:\n                        return 1\n                d = [tgt for tgt in SCons.Script.DEFAULT_TARGETS if check_dir(tgt)]\n                SCons.Script.DEFAULT_TARGETS[:] = d\n                target_top = None\n                lookup_top = None\n\n        targets = SCons.Script._Get_Default_Targets(d, fs)\n\n    if not targets:\n        sys.stderr.write(\"scons: *** No targets specified and no Default() targets found.  Stop.\\n\")\n        return None\n\n    def Entry(x, ltop=lookup_top, ttop=target_top, fs=fs):\n        if isinstance(x, SCons.Node.Node):\n            node = x\n        else:\n            node = None\n            # Why would ltop be None? Unfortunately this happens.\n            if ltop is None: ltop = ''\n            # Curdir becomes important when SCons is called with -u, -C,\n            # or similar option that changes directory, and so the paths\n            # of targets given on the command line need to be adjusted.\n            curdir = os.path.join(os.getcwd(), str(ltop))\n            for lookup in SCons.Node.arg2nodes_lookups:\n                node = lookup(x, curdir=curdir)\n                if node is not None:\n                    break\n            if node is None:\n                node = fs.Entry(x, directory=ltop, create=1)\n        if ttop and not node.is_under(ttop):\n            if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node):\n                node = ttop\n            else:\n                node = None\n        return node\n\n    nodes = [_f for _f in map(Entry, targets) if _f]\n\n    task_class = BuildTask      # default action is to build targets\n    opening_message = \"Building targets ...\"\n    closing_message = \"done building targets.\"\n    if options.keep_going:\n        failure_message = \"done building targets (errors occurred during build).\"\n    else:\n        failure_message = \"building terminated because of errors.\"\n    if options.question:\n        task_class = QuestionTask\n    try:\n        if options.clean:\n            task_class = CleanTask\n            opening_message = \"Cleaning targets ...\"\n            closing_message = \"done cleaning targets.\"\n            if options.keep_going:\n                failure_message = \"done cleaning targets (errors occurred during clean).\"\n            else:\n                failure_message = \"cleaning terminated because of errors.\"\n    except AttributeError:\n        pass\n\n    task_class.progress = ProgressObject\n\n    if options.random:\n        def order(dependencies):\n            \"\"\"Randomize the dependencies.\"\"\"\n            import random\n            random.shuffle(dependencies)\n            return dependencies\n    else:\n        def order(dependencies):\n            \"\"\"Leave the order of dependencies alone.\"\"\"\n            return dependencies\n\n    def tmtrace_cleanup(tfile):\n        tfile.close()\n\n    if options.taskmastertrace_file == '-':\n        tmtrace = sys.stdout\n    elif options.taskmastertrace_file:\n        tmtrace = open(options.taskmastertrace_file, 'w')\n        atexit.register(tmtrace_cleanup, tmtrace)\n    else:\n        tmtrace = None\n    taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace)\n\n    # Let the BuildTask objects get at the options to respond to the\n    # various print_* settings, tree_printer list, etc.\n    BuildTask.options = options\n\n\n    is_pypy = platform.python_implementation() == 'PyPy'\n    # As of 3.7, python removed support for threadless platforms.\n    # See https://www.python.org/dev/peps/pep-0011/\n    is_37_or_later = sys.version_info >= (3, 7)\n    # python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later\n\n    # As of python 3.4 threading has a dummy_threading module for use when there is no threading\n    # it's get_ident() will allways return -1, while real threading modules get_ident() will\n    # always return a positive integer\n    python_has_threads = threading.get_ident() != -1\n    # to check if python configured with threads.\n    global num_jobs\n    num_jobs = options.num_jobs\n    jobs = SCons.Job.Jobs(num_jobs, taskmaster)\n    if num_jobs > 1:\n        msg = None\n        if jobs.num_jobs == 1 or not python_has_threads:\n            msg = \"parallel builds are unsupported by this version of Python;\\n\" + \\\n                  \"\\tignoring -j or num_jobs option.\\n\"\n\n        # Nuitka: We know we are not affected.\n        if False and msg:\n            SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg)\n\n    memory_stats.append('before building targets:')\n    count_stats.append(('pre-', 'build'))\n\n    def jobs_postfunc(\n        jobs=jobs,\n        options=options,\n        closing_message=closing_message,\n        failure_message=failure_message\n        ):\n        if jobs.were_interrupted():\n            if not options.no_progress and not options.silent:\n                sys.stderr.write(\"scons: Build interrupted.\\n\")\n            global exit_status\n            global this_build_status\n            exit_status = 2\n            this_build_status = 2\n\n        if this_build_status:\n            progress_display(\"scons: \" + failure_message)\n        else:\n            progress_display(\"scons: \" + closing_message)\n        if not options.no_exec:\n            if jobs.were_interrupted():\n                progress_display(\"scons: writing .sconsign file.\")\n            SCons.SConsign.write()\n\n    progress_display(\"scons: \" + opening_message)\n    jobs.run(postfunc = jobs_postfunc)\n\n    memory_stats.append('after building targets:')\n    count_stats.append(('post-', 'build'))\n\n    return nodes\n\ndef _exec_main(parser, values):\n    sconsflags = os.environ.get('SCONSFLAGS', '')\n    all_args = sconsflags.split() + sys.argv[1:]\n\n    options, args = parser.parse_args(all_args, values)\n\n    if isinstance(options.debug, list) and \"pdb\" in options.debug:\n        import pdb\n        pdb.Pdb().runcall(_main, parser)\n    elif options.profile_file:\n        from cProfile import Profile\n\n        prof = Profile()\n        try:\n            prof.runcall(_main, parser)\n        finally:\n            prof.dump_stats(options.profile_file)\n    else:\n        _main(parser)\n\ndef main():\n    global OptionsParser\n    global exit_status\n    global first_command_start\n\n    # Check up front for a Python version we do not support.  We\n    # delay the check for deprecated Python versions until later,\n    # after the SConscript files have been read, in case they\n    # disable that warning.\n    if python_version_unsupported():\n        msg = \"scons: *** SCons version %s does not run under Python version %s.\\n\"\n        sys.stderr.write(msg % (SCons.__version__, python_version_string()))\n        sys.exit(1)\n\n    parts = [\"SCons by Steven Knight et al.:\\n\"]\n    try:\n        import SCons\n        parts.append(version_string(\"SCons\", SCons))\n    except (ImportError, AttributeError):\n        # On Windows there is no scons.py, so there is no\n        # __main__.__version__, hence there is no script version.\n        pass\n    parts.append(path_string(\"SCons\", SCons))\n    parts.append(SCons.__copyright__)\n    version = ''.join(parts)\n\n    from . import SConsOptions\n    parser = SConsOptions.Parser(version)\n    values = SConsOptions.SConsValues(parser.get_default_values())\n\n    OptionsParser = parser\n\n    try:\n        try:\n            _exec_main(parser, values)\n        finally:\n            revert_io()\n    except SystemExit as s:\n        if s:\n            exit_status = s.code\n    except KeyboardInterrupt:\n        print(\"scons: Build interrupted.\")\n        sys.exit(2)\n    except SyntaxError as e:\n        _scons_syntax_error(e)\n    except SCons.Errors.InternalError:\n        _scons_internal_error()\n    except SCons.Errors.UserError as e:\n        _scons_user_error(e)\n    except SConsPrintHelpException:\n        parser.print_help()\n        exit_status = 0\n    except SCons.Errors.BuildError as e:\n        print(e)\n        exit_status = e.exitstatus\n    except:\n        # An exception here is likely a builtin Python exception Python\n        # code in an SConscript file.  Show them precisely what the\n        # problem was and where it happened.\n        SCons.Script._SConscript.SConscript_exception()\n        sys.exit(2)\n\n    memory_stats.print_stats()\n    count_stats.print_stats()\n\n    if print_objects:\n        SCons.Debug.listLoggedInstances('*')\n        #SCons.Debug.dumpLoggedInstances('*')\n\n    if print_memoizer:\n        SCons.Memoize.Dump(\"Memoizer (memory cache) hits and misses:\")\n\n    # Dump any development debug info that may have been enabled.\n    # These are purely for internal debugging during development, so\n    # there's no need to control them with --debug= options; they're\n    # controlled by changing the source code.\n    SCons.Debug.dump_caller_counts()\n    SCons.Taskmaster.dump_stats()\n\n    if print_time:\n        total_time = time.time() - SCons.Script.start_time\n        if num_jobs == 1:\n            ct = cumulative_command_time\n        else:\n            if last_command_end is None or first_command_start is None:\n                ct = 0.0\n            else:\n                ct = last_command_end - first_command_start\n        scons_time = total_time - sconscript_time - ct\n        print(\"Total build time: %f seconds\"%total_time)\n        print(\"Total SConscript file execution time: %f seconds\"%sconscript_time)\n        print(\"Total SCons execution time: %f seconds\"%scons_time)\n        print(\"Total command execution time: %f seconds\"%ct)\n\n    sys.exit(exit_status)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport gettext\nimport optparse\nimport re\nimport sys\nimport textwrap\n\nimport SCons.Node.FS\nimport SCons.Platform.virtualenv\nimport SCons.Warnings\nfrom . import Main\n\nno_hyphen_re = re.compile(r'(\\s+|(?<=[\\w!\\\"\\'&.,?])-{2,}(?=\\w))')\n_ = gettext.gettext\nOptionValueError = optparse.OptionValueError\nSUPPRESS_HELP = optparse.SUPPRESS_HELP\n\ndiskcheck_all = SCons.Node.FS.diskcheck_types()\n\nexperimental_features = {'warp_speed', 'transporter', 'ninja'}\n\n\ndef diskcheck_convert(value):\n    if value is None:\n        return []\n    if not SCons.Util.is_List(value):\n        value = value.split(',')\n    result = []\n    for v in value:\n        v = v.lower()\n        if v == 'all':\n            result = diskcheck_all\n        elif v == 'none':\n            result = []\n        elif v in diskcheck_all:\n            result.append(v)\n        else:\n            raise ValueError(v)\n    return result\n\n\nclass SConsValues(optparse.Values):\n    \"\"\"\n    Holder class for uniform access to SCons options, regardless\n    of whether or not they can be set on the command line or in the\n    SConscript files (using the SetOption() function).\n\n    A SCons option value can originate three different ways:\n\n        1)  set on the command line;\n        2)  set in an SConscript file;\n        3)  the default setting (from the the op.add_option()\n            calls in the Parser() function, below).\n\n    The command line always overrides a value set in a SConscript file,\n    which in turn always overrides default settings.  Because we want\n    to support user-specified options in the SConscript file itself,\n    though, we may not know about all of the options when the command\n    line is first parsed, so we can't make all the necessary precedence\n    decisions at the time the option is configured.\n\n    The solution implemented in this class is to keep these different sets\n    of settings separate (command line, SConscript file, and default)\n    and to override the __getattr__() method to check them in turn.\n    This should allow the rest of the code to just fetch values as\n    attributes of an instance of this class, without having to worry\n    about where they came from.\n\n    Note that not all command line options are settable from SConscript\n    files, and the ones that are must be explicitly added to the\n    \"settable\" list in this class, and optionally validated and coerced\n    in the set_option() method.\n    \"\"\"\n\n    def __init__(self, defaults):\n        self.__defaults__ = defaults\n        self.__SConscript_settings__ = {}\n\n    def __getattr__(self, attr):\n        \"\"\"\n        Fetches an options value, checking first for explicit settings\n        from the command line (which are direct attributes), then the\n        SConscript file settings, then the default values.\n        \"\"\"\n        try:\n            return self.__dict__[attr]\n        except KeyError:\n            try:\n                return self.__dict__['__SConscript_settings__'][attr]\n            except KeyError:\n                try:\n                    return getattr(self.__dict__['__defaults__'], attr)\n                except KeyError:\n                    # Added because with py3 this is a new class,\n                    # not a classic class, and due to the way\n                    # In that case it will create an object without\n                    # __defaults__, and then query for __setstate__\n                    # which will throw an exception of KeyError\n                    # deepcopy() is expecting AttributeError if __setstate__\n                    # is not available.\n                    raise AttributeError(attr)\n\n    # keep this list in sync with the SetOption doc in SCons/Script/Main.xml\n    # search for UPDATE_SETOPTION_DOCS there.\n    settable = [\n        'clean',\n        'diskcheck',\n        'duplicate',\n        'experimental',\n        'hash_chunksize',\n        'hash_format',\n        'help',\n        'implicit_cache',\n        'implicit_deps_changed',\n        'implicit_deps_unchanged',\n        'max_drift',\n        'md5_chunksize',\n        'no_exec',\n        'no_progress',\n        'num_jobs',\n        'random',\n        'silent',\n        'stack_size',\n        'warn',\n\n        # TODO: Remove these once we update the AddOption() API to allow setting\n        #       added flag as setable.\n        # Requested setable flag in : https://github.com/SCons/scons/issues/3983\n        # From experimental ninja\n        'disable_execute_ninja',\n        'disable_ninja'\n    ]\n\n    def set_option(self, name, value):\n        \"\"\"Sets an option from an SConscript file.\n\n        Raises:\n            UserError: invalid or malformed option (\"error in your script\")\n        \"\"\"\n\n        if name not in self.settable:\n            raise SCons.Errors.UserError(\n                \"This option is not settable from a SConscript file: %s\" % name\n            )\n\n        # the following are for options that need some extra processing\n        if name == 'num_jobs':\n            try:\n                value = int(value)\n                if value < 1:\n                    raise ValueError\n            except ValueError:\n                raise SCons.Errors.UserError(\"A positive integer is required: %s\" % repr(value))\n        elif name == 'max_drift':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\n                    \"An integer is required: %s\" % repr(value))\n        elif name == 'duplicate':\n            try:\n                value = str(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\n                    \"A string is required: %s\" % repr(value))\n            if value not in SCons.Node.FS.Valid_Duplicates:\n                raise SCons.Errors.UserError(\n                    \"Not a valid duplication style: %s\" % value\n                )\n            # Set the duplicate style right away so it can affect linking\n            # of SConscript files.\n            SCons.Node.FS.set_duplicate(value)\n        elif name == 'diskcheck':\n            try:\n                value = diskcheck_convert(value)\n            except ValueError as v:\n                raise SCons.Errors.UserError(\n                    \"Not a valid diskcheck value: %s\" % v)\n            if 'diskcheck' not in self.__dict__:\n                # No --diskcheck= option was specified on the command line.\n                # Set this right away so it can affect the rest of the\n                # file/Node lookups while processing the SConscript files.\n                SCons.Node.FS.set_diskcheck(value)\n        elif name == 'stack_size':\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\n                    \"An integer is required: %s\" % repr(value))\n        elif name in ('md5_chunksize', 'hash_chunksize'):\n            try:\n                value = int(value)\n            except ValueError:\n                raise SCons.Errors.UserError(\n                    \"An integer is required: %s\" % repr(value))\n            name = 'md5_chunksize'  # for now, the old name is used\n        elif name == 'warn':\n            if SCons.Util.is_String(value):\n                value = [value]\n            value = self.__SConscript_settings__.get(name, []) + value\n            SCons.Warnings.process_warn_strings(value)\n        elif name == 'no_progress':\n            SCons.Script.Main.progress_display.set_mode(False)\n        elif name == 'experimental':\n            if SCons.Util.is_String(value):\n                value = [value]\n            value = self.__SConscript_settings__.get(name, []) + value\n        elif name in ('implicit_deps_changed', 'implicit_deps_unchanged'):\n            if value:\n                self.__SConscript_settings__['implicit_cache'] = True\n\n        self.__SConscript_settings__[name] = value\n\n\nclass SConsOption(optparse.Option):\n    def convert_value(self, opt, value):\n        if value is not None:\n            if self.nargs in (1, '?'):\n                return self.check_value(opt, value)\n            else:\n                return tuple([self.check_value(opt, v) for v in value])\n\n    def process(self, opt, value, values, parser):\n\n        # First, convert the value(s) to the right type.  Howl if any\n        # value(s) are bogus.\n        value = self.convert_value(opt, value)\n\n        # And then take whatever action is expected of us.\n        # This is a separate method to make life easier for\n        # subclasses to add new actions.\n        return self.take_action(\n            self.action, self.dest, opt, value, values, parser)\n\n    def _check_nargs_optional(self):\n        if self.nargs == '?' and self._short_opts:\n            fmt = \"option %s: nargs='?' is incompatible with short options\"\n            raise SCons.Errors.UserError(fmt % self._short_opts[0])\n\n    CHECK_METHODS = optparse.Option.CHECK_METHODS\n    if CHECK_METHODS is None:\n        CHECK_METHODS = []\n    CHECK_METHODS = CHECK_METHODS + [_check_nargs_optional]\n    CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS\n\n\nclass SConsOptionGroup(optparse.OptionGroup):\n    \"\"\"\n    A subclass for SCons-specific option groups.\n\n    The only difference between this and the base class is that we print\n    the group's help text flush left, underneath their own title but\n    lined up with the normal \"SCons Options\".\n    \"\"\"\n\n    def format_help(self, formatter):\n        \"\"\"\n        Format an option group's help text, outdenting the title so it's\n        flush with the \"SCons Options\" title we print at the top.\n        \"\"\"\n        formatter.dedent()\n        result = formatter.format_heading(self.title)\n        formatter.indent()\n        result = result + optparse.OptionContainer.format_help(self, formatter)\n        return result\n\n\nclass SConsOptionParser(optparse.OptionParser):\n    preserve_unknown_options = False\n\n    def error(self, msg):\n        # overridden OptionValueError exception handler\n        self.print_usage(sys.stderr)\n        sys.stderr.write(\"SCons Error: %s\\n\" % msg)\n        sys.exit(2)\n\n    def _process_long_opt(self, rargs, values):\n        \"\"\"\n        SCons-specific processing of long options.\n\n        This is copied directly from the normal\n        optparse._process_long_opt() method, except that, if configured\n        to do so, we catch the exception thrown when an unknown option\n        is encountered and just stick it back on the \"leftover\" arguments\n        for later (re-)processing.\n        \"\"\"\n        arg = rargs.pop(0)\n\n        # Value explicitly attached to arg?  Pretend it's the next argument.\n        if \"=\" in arg:\n            (opt, next_arg) = arg.split(\"=\", 1)\n            rargs.insert(0, next_arg)\n            had_explicit_value = True\n        else:\n            opt = arg\n            had_explicit_value = False\n\n        try:\n            if opt != self._match_long_opt(opt):\n                raise optparse.BadOptionError(\n                    \"'%s'. Did you mean '%s'?\"\n                    % (opt, self._match_long_opt(opt))\n                )\n        except optparse.BadOptionError:\n            if self.preserve_unknown_options:\n                # SCons-specific:  if requested, add unknown options to\n                # the \"leftover arguments\" list for later processing.\n                self.largs.append(arg)\n                if had_explicit_value:\n                    # The unknown option will be re-processed later,\n                    # so undo the insertion of the explicit value.\n                    rargs.pop(0)\n                return\n            raise\n\n        option = self._long_opt[opt]\n        if option.takes_value():\n            nargs = option.nargs\n            if nargs == '?':\n                if had_explicit_value:\n                    value = rargs.pop(0)\n                else:\n                    value = option.const\n            elif len(rargs) < nargs:\n                if nargs == 1:\n                    if not option.choices:\n                        self.error(_(\"%s option requires an argument\") % opt)\n                    else:\n                        msg = _(\"%s option requires an argument \" % opt)\n                        msg += _(\"(choose from %s)\"\n                                 % ', '.join(option.choices))\n                        self.error(msg)\n                else:\n                    self.error(_(\"%s option requires %d arguments\")\n                               % (opt, nargs))\n            elif nargs == 1:\n                value = rargs.pop(0)\n            else:\n                value = tuple(rargs[0:nargs])\n                del rargs[0:nargs]\n\n        elif had_explicit_value:\n            self.error(_(\"%s option does not take a value\") % opt)\n\n        else:\n            value = None\n\n        option.process(opt, value, values, self)\n\n    def reparse_local_options(self):\n        \"\"\" Re-parse the leftover command-line options.\n\n        Parse options stored in `self.largs`, so that any value\n        overridden on the command line is immediately available\n        if the user turns around and does a :func:`GetOption` right away.\n\n        We mimic the processing of the single args\n        in the original OptionParser :func:`_process_args`, but here we\n        allow exact matches for long-opts only (no partial argument names!).\n        Otherwise there could be  problems in :func:`add_local_option`\n        below. When called from there, we try to reparse the\n        command-line arguments that\n\n        1. haven't been processed so far (`self.largs`), but\n        2. are possibly not added to the list of options yet.\n\n        So, when we only have a value for \"--myargument\" so far,\n        a command-line argument of \"--myarg=test\" would set it,\n        per the behaviour of :func:`_match_long_opt`,\n        which allows for partial matches of the option name,\n        as long as the common prefix appears to be unique.\n        This would lead to further confusion, because we might want\n        to add another option \"--myarg\" later on (see issue #2929).\n\n        \"\"\"\n        rargs = []\n        largs_restore = []\n        # Loop over all remaining arguments\n        skip = False\n        for l in self.largs:\n            if skip:\n                # Accept all remaining arguments as they are\n                largs_restore.append(l)\n            else:\n                if len(l) > 2 and l[0:2] == \"--\":\n                    # Check long option\n                    lopt = (l,)\n                    if \"=\" in l:\n                        # Split into option and value\n                        lopt = l.split(\"=\", 1)\n\n                    if lopt[0] in self._long_opt:\n                        # Argument is already known\n                        rargs.append('='.join(lopt))\n                    else:\n                        # Not known yet, so reject for now\n                        largs_restore.append('='.join(lopt))\n                else:\n                    if l == \"--\" or l == \"-\":\n                        # Stop normal processing and don't\n                        # process the rest of the command-line opts\n                        largs_restore.append(l)\n                        skip = True\n                    else:\n                        rargs.append(l)\n\n        # Parse the filtered list\n        self.parse_args(rargs, self.values)\n        # Restore the list of remaining arguments for the\n        # next call of AddOption/add_local_option...\n        self.largs = self.largs + largs_restore\n\n    def add_local_option(self, *args, **kw):\n        \"\"\"\n        Adds a local option to the parser.\n\n        This is initiated by an AddOption() call to add a user-defined\n        command-line option.  We add the option to a separate option\n        group for the local options, creating the group if necessary.\n        \"\"\"\n        try:\n            group = self.local_option_group\n        except AttributeError:\n            group = SConsOptionGroup(self, 'Local Options')\n            group = self.add_option_group(group)\n            self.local_option_group = group\n\n        result = group.add_option(*args, **kw)\n\n        if result:\n            # The option was added successfully.  We now have to add the\n            # default value to our object that holds the default values\n            # (so that an attempt to fetch the option's attribute will\n            # yield the default value when not overridden) and then\n            # we re-parse the leftover command-line options, so that\n            # any value overridden on the command line is immediately\n            # available if the user turns around and does a GetOption()\n            # right away.\n            setattr(self.values.__defaults__, result.dest, result.default)\n            self.reparse_local_options()\n\n        return result\n\n\nclass SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter):\n    def format_usage(self, usage):\n        return \"usage: %s\\n\" % usage\n\n    def format_heading(self, heading):\n        \"\"\"\n        This translates any heading of \"options\" or \"Options\" into\n        \"SCons Options.\"  Unfortunately, we have to do this here,\n        because those titles are hard-coded in the optparse calls.\n        \"\"\"\n        if heading == 'Options':\n            heading = \"SCons Options\"\n        return optparse.IndentedHelpFormatter.format_heading(self, heading)\n\n    def format_option(self, option):\n        \"\"\"\n        A copy of the normal optparse.IndentedHelpFormatter.format_option()\n        method.  This has been snarfed so we can modify text wrapping to\n        out liking:\n\n        --  add our own regular expression that doesn't break on hyphens\n            (so things like --no-print-directory don't get broken);\n\n        --  wrap the list of options themselves when it's too long\n            (the wrapper.fill(opts) call below);\n\n        --  set the subsequent_indent when wrapping the help_text.\n        \"\"\"\n        # The help for each option consists of two parts:\n        #   * the opt strings and metavars\n        #     eg. (\"-x\", or \"-fFILENAME, --file=FILENAME\")\n        #   * the user-supplied help string\n        #     eg. (\"turn on expert mode\", \"read data from FILENAME\")\n        #\n        # If possible, we write both of these on the same line:\n        #   -x      turn on expert mode\n        #\n        # But if the opt string list is too long, we put the help\n        # string on a second line, indented to the same column it would\n        # start in if it fit on the first line.\n        #   -fFILENAME, --file=FILENAME\n        #           read data from FILENAME\n        result = []\n\n        opts = self.option_strings[option]\n        opt_width = self.help_position - self.current_indent - 2\n        if len(opts) > opt_width:\n            wrapper = textwrap.TextWrapper(width=self.width,\n                                           initial_indent='  ',\n                                           subsequent_indent='  ')\n            wrapper.wordsep_re = no_hyphen_re\n            opts = wrapper.fill(opts) + '\\n'\n            indent_first = self.help_position\n        else:                       # start help on same line as opts\n            opts = \"%*s%-*s  \" % (self.current_indent, \"\", opt_width, opts)\n            indent_first = 0\n        result.append(opts)\n        if option.help:\n\n            help_text = self.expand_default(option)\n\n            # SCons:  indent every line of the help text but the first.\n            wrapper = textwrap.TextWrapper(width=self.help_width,\n                                           subsequent_indent='  ')\n            wrapper.wordsep_re = no_hyphen_re\n            help_lines = wrapper.wrap(help_text)\n            result.append(\"%*s%s\\n\" % (indent_first, \"\", help_lines[0]))\n            for line in help_lines[1:]:\n                result.append(\"%*s%s\\n\" % (self.help_position, \"\", line))\n        elif opts[-1] != \"\\n\":\n            result.append(\"\\n\")\n        return \"\".join(result)\n\n\ndef Parser(version):\n    \"\"\"\n    Returns an options parser object initialized with the standard\n    SCons options.\n    \"\"\"\n\n    formatter = SConsIndentedHelpFormatter(max_help_position=30)\n\n    op = SConsOptionParser(option_class=SConsOption,\n                           add_help_option=False,\n                           formatter=formatter,\n                           usage=\"usage: scons [OPTION] [TARGET] ...\",)\n\n    op.preserve_unknown_options = True\n    op.version = version\n\n    # Add the options to the parser we just created.\n    #\n    # These are in the order we want them to show up in the -H help\n    # text, basically alphabetical.  Each op.add_option() call below\n    # should have a consistent format:\n    #\n    #   op.add_option(\"-L\", \"--long-option-name\",\n    #                 nargs=1, type=\"string\",\n    #                 dest=\"long_option_name\", default='foo',\n    #                 action=\"callback\", callback=opt_long_option,\n    #                 help=\"help text goes here\",\n    #                 metavar=\"VAR\")\n    #\n    # Even though the optparse module constructs reasonable default\n    # destination names from the long option names, we're going to be\n    # explicit about each one for easier readability and so this code\n    # will at least show up when grepping the source for option attribute\n    # names, or otherwise browsing the source code.\n\n    # options ignored for compatibility\n    def opt_ignore(option, opt, value, parser):\n        sys.stderr.write(\"Warning:  ignoring %s option\\n\" % opt)\n    op.add_option(\"-b\", \"-d\", \"-e\", \"-m\", \"-S\", \"-t\", \"-w\",\n                  \"--environment-overrides\",\n                  \"--no-keep-going\",\n                  \"--no-print-directory\",\n                  \"--print-directory\",\n                  \"--stop\",\n                  \"--touch\",\n                  action=\"callback\", callback=opt_ignore,\n                  help=\"Ignored for compatibility.\")\n\n    op.add_option('-c', '--clean', '--remove',\n                  dest=\"clean\", default=False,\n                  action=\"store_true\",\n                  help=\"Remove specified targets and dependencies.\")\n\n    op.add_option('-C', '--directory',\n                  nargs=1, type=\"string\",\n                  dest=\"directory\", default=[],\n                  action=\"append\",\n                  help=\"Change to DIR before doing anything.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--cache-debug',\n                  nargs=1,\n                  dest=\"cache_debug\", default=None,\n                  action=\"store\",\n                  help=\"Print CacheDir debug info to FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('--cache-disable', '--no-cache',\n                  dest='cache_disable', default=False,\n                  action=\"store_true\",\n                  help=\"Do not retrieve built targets from CacheDir.\")\n\n    op.add_option('--cache-force', '--cache-populate',\n                  dest='cache_force', default=False,\n                  action=\"store_true\",\n                  help=\"Copy already-built targets into the CacheDir.\")\n\n    op.add_option('--cache-readonly',\n                  dest='cache_readonly', default=False,\n                  action=\"store_true\",\n                  help=\"Do not update CacheDir with built targets.\")\n\n    op.add_option('--cache-show',\n                  dest='cache_show', default=False,\n                  action=\"store_true\",\n                  help=\"Print build actions for files from CacheDir.\")\n\n    def opt_invalid(group, value, options):\n        \"\"\"report an invalid option from a group\"\"\"\n        errmsg = \"`%s' is not a valid %s option type, try:\\n\" % (value, group)\n        return errmsg + \"    %s\" % \", \".join(options)\n\n    def opt_invalid_rm(group, value, msg):\n        \"\"\"report an invalid option from a group: recognized but removed\"\"\"\n        errmsg = \"`%s' is not a valid %s option type \" % (value, group)\n        return errmsg + msg\n\n    config_options = [\"auto\", \"force\", \"cache\"]\n\n    opt_config_help = \"Controls Configure subsystem: %s.\" \\\n                      % \", \".join(config_options)\n\n    op.add_option('--config',\n                  nargs=1, choices=config_options,\n                  dest=\"config\", default=\"auto\",\n                  help=opt_config_help,\n                  metavar=\"MODE\")\n\n    op.add_option('-D',\n                  dest=\"climb_up\", default=None,\n                  action=\"store_const\", const=2,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build all Default() targets.\")\n\n    deprecated_debug_options = {}\n\n    removed_debug_options = {\n        \"dtree\": '; please use --tree=derived instead',\n        \"nomemoizer\": '; there is no replacement',\n        \"stree\": '; please use --tree=all,status instead',\n        \"tree\": '; please use --tree=all instead',\n    }\n\n    debug_options = [\"count\", \"duplicate\", \"explain\", \"findlibs\",\n                     \"includes\", \"memoizer\", \"memory\", \"objects\",\n                     \"pdb\", \"prepare\", \"presub\", \"stacktrace\",\n                     \"time\", \"action-timestamps\"]\n\n    def opt_debug(option, opt, value__, parser,\n                  debug_options=debug_options,\n                  deprecated_debug_options=deprecated_debug_options,\n                  removed_debug_options=removed_debug_options):\n        for value in value__.split(','):\n            if value in debug_options:\n                parser.values.debug.append(value)\n            elif value in deprecated_debug_options:\n                parser.values.debug.append(value)\n                try:\n                    parser.values.delayed_warnings\n                except AttributeError:\n                    parser.values.delayed_warnings = []\n                msg = deprecated_debug_options[value]\n                w = \"The --debug=%s option is deprecated%s.\" % (value, msg)\n                t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)\n                parser.values.delayed_warnings.append(t)\n            elif value in removed_debug_options:\n                msg = removed_debug_options[value]\n                raise OptionValueError(opt_invalid_rm('debug', value, msg))\n            else:\n                raise OptionValueError(opt_invalid(\n                    'debug', value, debug_options))\n\n    opt_debug_help = \"Print various types of debugging information: %s.\" \\\n                     % \", \".join(debug_options)\n    op.add_option('--debug',\n                  nargs=1, type=\"string\",\n                  dest=\"debug\", default=[],\n                  action=\"callback\", callback=opt_debug,\n                  help=opt_debug_help,\n                  metavar=\"TYPE\")\n\n    def opt_diskcheck(option, opt, value, parser):\n        try:\n            diskcheck_value = diskcheck_convert(value)\n        except ValueError as e:\n            raise OptionValueError(\"`%s' is not a valid diskcheck type\" % e)\n        setattr(parser.values, option.dest, diskcheck_value)\n\n    op.add_option('--diskcheck',\n                  nargs=1, type=\"string\",\n                  dest='diskcheck', default=None,\n                  action=\"callback\", callback=opt_diskcheck,\n                  help=\"Enable specific on-disk checks.\",\n                  metavar=\"TYPE\")\n\n    def opt_duplicate(option, opt, value, parser):\n        if value not in SCons.Node.FS.Valid_Duplicates:\n            raise OptionValueError(opt_invalid('duplication', value,\n                                               SCons.Node.FS.Valid_Duplicates))\n        setattr(parser.values, option.dest, value)\n        # Set the duplicate style right away so it can affect linking\n        # of SConscript files.\n        SCons.Node.FS.set_duplicate(value)\n\n    opt_duplicate_help = \"Set the preferred duplication methods. Must be one of \" \\\n                         + \", \".join(SCons.Node.FS.Valid_Duplicates)\n\n    op.add_option('--duplicate',\n                  nargs=1, type=\"string\",\n                  dest=\"duplicate\", default='hard-soft-copy',\n                  action=\"callback\", callback=opt_duplicate,\n                  help=opt_duplicate_help)\n\n    if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:\n        op.add_option('--enable-virtualenv',\n                      dest=\"enable_virtualenv\",\n                      action=\"store_true\",\n                      help=\"Import certain virtualenv variables to SCons\")\n\n    def experimental_callback(option, opt, value, parser):\n        experimental = getattr(parser.values, option.dest)\n\n        if ',' in value:\n            value = value.split(',')\n        else:\n            value = [value]\n\n        for v in value:\n            if v == 'none':\n                experimental = set()\n            elif v == 'all':\n                experimental = experimental_features\n            elif v not in experimental_features:\n                raise OptionValueError(\n                    \"option --experimental: invalid choice: '%s' \"\n                    \"(choose from 'all','none',%s)\"\n                    % (v, ','.join([\"'%s'\" % e for e in sorted(experimental_features)]))\n                )\n            else:\n                experimental |= {v}\n\n        setattr(parser.values, option.dest, experimental)\n\n    op.add_option('--experimental',\n                  dest='experimental',\n                  action='callback',\n                  default=set(),  # empty set\n                  type='str',\n                  # choices=experimental_options+experimental_features,\n                  callback=experimental_callback,\n                  help='Enable experimental features')\n\n    op.add_option('-f', '--file', '--makefile', '--sconstruct',\n                  nargs=1, type=\"string\",\n                  dest=\"file\", default=[],\n                  action=\"append\",\n                  help=\"Read FILE as the top-level SConstruct file.\")\n\n    op.add_option('-h', '--help',\n                  dest=\"help\", default=False,\n                  action=\"store_true\",\n                  help=\"Print defined help message, or this one.\")\n\n    op.add_option(\"-H\", \"--help-options\",\n                  action=\"help\",\n                  help=\"Print this message and exit.\")\n\n    def warn_md5_chunksize_deprecated(option, opt, value, parser):\n        if opt == '--md5-chunksize':\n            SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning,\n                                \"Parameter %s is deprecated. Use \"\n                                \"--hash-chunksize instead.\" % opt)\n\n        setattr(parser.values, option.dest, value)\n\n    op.add_option('--hash-chunksize', '--md5-chunksize',\n                  nargs=1, type=\"int\",\n                  dest='md5_chunksize', default=SCons.Node.FS.File.hash_chunksize,\n                  action=\"callback\",\n                  help=\"Set chunk-size for hash signature computation to N kilobytes.\",\n                  callback=warn_md5_chunksize_deprecated,\n                  metavar=\"N\")\n\n    op.add_option('--hash-format',\n                  dest='hash_format',\n                  action='store',\n                  help='Hash format (e.g. md5, sha1, or sha256).')\n\n    op.add_option('-i', '--ignore-errors',\n                  dest='ignore_errors', default=False,\n                  action=\"store_true\",\n                  help=\"Ignore errors from build actions.\")\n\n    op.add_option('-I', '--include-dir',\n                  nargs=1,\n                  dest='include_dir', default=[],\n                  action=\"append\",\n                  help=\"Search DIR for imported Python modules.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--ignore-virtualenv',\n                  dest=\"ignore_virtualenv\",\n                  action=\"store_true\",\n                  help=\"Do not import virtualenv variables to SCons\")\n\n    op.add_option('--implicit-cache',\n                  dest='implicit_cache', default=False,\n                  action=\"store_true\",\n                  help=\"Cache implicit dependencies\")\n\n    def opt_implicit_deps(option, opt, value, parser):\n        setattr(parser.values, 'implicit_cache', True)\n        setattr(parser.values, option.dest, True)\n\n    op.add_option('--implicit-deps-changed',\n                  dest=\"implicit_deps_changed\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore cached implicit dependencies.\")\n\n    op.add_option('--implicit-deps-unchanged',\n                  dest=\"implicit_deps_unchanged\", default=False,\n                  action=\"callback\", callback=opt_implicit_deps,\n                  help=\"Ignore changes in implicit dependencies.\")\n\n    op.add_option('--interact', '--interactive',\n                  dest='interactive', default=False,\n                  action=\"store_true\",\n                  help=\"Run in interactive mode.\")\n\n    op.add_option('-j', '--jobs',\n                  nargs=1, type=\"int\",\n                  dest=\"num_jobs\", default=1,\n                  action=\"store\",\n                  help=\"Allow N jobs at once.\",\n                  metavar=\"N\")\n\n    op.add_option('-k', '--keep-going',\n                  dest='keep_going', default=False,\n                  action=\"store_true\",\n                  help=\"Keep going when a target can't be made.\")\n\n    op.add_option('--max-drift',\n                  nargs=1, type=\"int\",\n                  dest='max_drift', default=SCons.Node.FS.default_max_drift,\n                  action=\"store\",\n                  help=\"Set maximum system clock drift to N seconds.\",\n                  metavar=\"N\")\n\n    op.add_option('-n', '--no-exec', '--just-print', '--dry-run', '--recon',\n                  dest='no_exec', default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; just print commands.\")\n\n    op.add_option('--no-site-dir',\n                  dest='site_dir',\n                  action=\"store_false\",\n                  help=\"Don't search or use the usual site_scons dir.\")\n\n    op.add_option('--profile',\n                  nargs=1,\n                  dest=\"profile_file\", default=None,\n                  action=\"store\",\n                  help=\"Profile SCons and put results in FILE.\",\n                  metavar=\"FILE\")\n\n    op.add_option('-q', '--question',\n                  dest=\"question\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't build; exit status says if up to date.\")\n\n    op.add_option('-Q',\n                  dest='no_progress', default=False,\n                  action=\"store_true\",\n                  help=\"Suppress \\\"Reading/Building\\\" progress messages.\")\n\n    op.add_option('--random',\n                  dest=\"random\", default=False,\n                  action=\"store_true\",\n                  help=\"Build dependencies in random order.\")\n\n    op.add_option('-s', '--silent', '--quiet',\n                  dest=\"silent\", default=False,\n                  action=\"store_true\",\n                  help=\"Don't print commands.\")\n\n    op.add_option('--site-dir',\n                  nargs=1,\n                  dest='site_dir', default=None,\n                  action=\"store\",\n                  help=\"Use DIR instead of the usual site_scons dir.\",\n                  metavar=\"DIR\")\n\n    op.add_option('--stack-size',\n                  nargs=1, type=\"int\",\n                  dest='stack_size',\n                  action=\"store\",\n                  help=\"Set the stack size of the threads used to run jobs to N kilobytes.\",\n                  metavar=\"N\")\n\n    op.add_option('--taskmastertrace',\n                  nargs=1,\n                  dest=\"taskmastertrace_file\", default=None,\n                  action=\"store\",\n                  help=\"Trace Node evaluation to FILE.\",\n                  metavar=\"FILE\")\n\n    tree_options = [\"all\", \"derived\", \"prune\", \"status\", \"linedraw\"]\n\n    def opt_tree(option, opt, value, parser, tree_options=tree_options):\n        tp = Main.TreePrinter()\n        for o in value.split(','):\n            if o == 'all':\n                tp.derived = False\n            elif o == 'derived':\n                tp.derived = True\n            elif o == 'prune':\n                tp.prune = True\n            elif o == 'status':\n                tp.status = True\n            elif o == 'linedraw':\n                tp.sLineDraw = True\n            else:\n                raise OptionValueError(opt_invalid('--tree', o, tree_options))\n        parser.values.tree_printers.append(tp)\n\n    opt_tree_help = \"Print a dependency tree in various formats: %s.\" \\\n                    % \", \".join(tree_options)\n\n    op.add_option('--tree',\n                  nargs=1, type=\"string\",\n                  dest=\"tree_printers\", default=[],\n                  action=\"callback\", callback=opt_tree,\n                  help=opt_tree_help,\n                  metavar=\"OPTIONS\")\n\n    op.add_option('-u', '--up', '--search-up',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=1,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build targets at or below current directory.\")\n\n    op.add_option('-U',\n                  dest=\"climb_up\", default=0,\n                  action=\"store_const\", const=3,\n                  help=\"Search up directory tree for SConstruct,       \"\n                       \"build Default() targets from local SConscript.\")\n\n    def opt_version(option, opt, value, parser):\n        sys.stdout.write(parser.version + '\\n')\n        sys.exit(0)\n    op.add_option(\"-v\", \"--version\",\n                  action=\"callback\", callback=opt_version,\n                  help=\"Print the SCons version number and exit.\")\n\n    def opt_warn(option, opt, value, parser, tree_options=tree_options):\n        if SCons.Util.is_String(value):\n            value = value.split(',')\n        parser.values.warn.extend(value)\n\n    op.add_option('--warn', '--warning',\n                  nargs=1, type=\"string\",\n                  dest=\"warn\", default=[],\n                  action=\"callback\", callback=opt_warn,\n                  help=\"Enable or disable warnings.\",\n                  metavar=\"WARNING-SPEC\")\n\n    op.add_option('-Y', '--repository', '--srcdir',\n                  nargs=1,\n                  dest=\"repository\", default=[],\n                  action=\"append\",\n                  help=\"Search REPOSITORY for source and target files.\")\n\n    # Options from Make and Cons classic that we do not yet support,\n    # but which we may support someday and whose (potential) meanings\n    # we don't want to change.  These all get a \"the -X option is not\n    # yet implemented\" message and don't show up in the help output.\n\n    def opt_not_yet(option, opt, value, parser):\n        msg = \"Warning:  the %s option is not yet implemented\\n\" % opt\n        sys.stderr.write(msg)\n\n    op.add_option('-l', '--load-average', '--max-load',\n                  nargs=1, type=\"float\",\n                  dest=\"load_average\", default=0,\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"store\",\n                  # help=\"Don't start multiple jobs unless load is below \"\n                  #      \"LOAD-AVERAGE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-actions',\n                  dest=\"list_actions\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and build actions.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-derived',\n                  dest=\"list_derived\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files that would be built.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--list-where',\n                  dest=\"list_where\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Don't build; list files and where defined.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-o', '--old-file', '--assume-old',\n                  nargs=1, type=\"string\",\n                  dest=\"old_file\", default=[],\n                  action=\"callback\", callback=opt_not_yet,\n                  # action=\"append\",\n                  # help = \"Consider FILE to be old; don't rebuild it.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--override',\n                  nargs=1, type=\"string\",\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"override\",\n                  # help=\"Override variables as specified in FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-p',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"p\",\n                  # help=\"Print internal environments/objects.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-r', '-R', '--no-builtin-rules', '--no-builtin-variables',\n                  action=\"callback\", callback=opt_not_yet,\n                  dest=\"no_builtin_rules\",\n                  # help=\"Clear default environments and variables.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--write-filenames',\n                  nargs=1, type=\"string\",\n                  dest=\"write_filenames\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Write all filenames examined into FILE.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('-W', '--new-file', '--assume-new', '--what-if',\n                  nargs=1, type=\"string\",\n                  dest=\"new_file\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Consider FILE to be changed.\"\n                  help=SUPPRESS_HELP)\n    op.add_option('--warn-undefined-variables',\n                  dest=\"warn_undefined_variables\",\n                  action=\"callback\", callback=opt_not_yet,\n                  # help=\"Warn when an undefined variable is referenced.\"\n                  help=SUPPRESS_HELP)\n    return op\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"This module defines the Python API provided to SConscript files.\"\"\"\n\nimport SCons\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Node.Alias\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.SConf\nimport SCons.Tool\nfrom SCons.Util import is_List, is_String, is_Dict, flatten\nfrom SCons.Node import SConscriptNodes\nfrom . import Main\n\nimport os\nimport os.path\nimport re\nimport sys\nimport traceback\nimport time\n\nclass SConscriptReturn(Exception):\n    pass\n\nlaunch_dir = os.path.abspath(os.curdir)\n\nGlobalDict = None\n\n# global exports set by Export():\nglobal_exports = {}\n\n# chdir flag\nsconscript_chdir = 1\n\ndef get_calling_namespaces():\n    \"\"\"Return the locals and globals for the function that called\n    into this module in the current call stack.\"\"\"\n    try: 1//0\n    except ZeroDivisionError:\n        # Don't start iterating with the current stack-frame to\n        # prevent creating reference cycles (f_back is safe).\n        frame = sys.exc_info()[2].tb_frame.f_back\n\n    # Find the first frame that *isn't* from this file.  This means\n    # that we expect all of the SCons frames that implement an Export()\n    # or SConscript() call to be in this file, so that we can identify\n    # the first non-Script.SConscript frame as the user's local calling\n    # environment, and the locals and globals dictionaries from that\n    # frame as the calling namespaces.  See the comment below preceding\n    # the DefaultEnvironmentCall block for even more explanation.\n    while frame.f_globals.get(\"__name__\") == __name__:\n        frame = frame.f_back\n\n    return frame.f_locals, frame.f_globals\n\n\ndef compute_exports(exports):\n    \"\"\"Compute a dictionary of exports given one of the parameters\n    to the Export() function or the exports argument to SConscript().\"\"\"\n\n    loc, glob = get_calling_namespaces()\n\n    retval = {}\n    try:\n        for export in exports:\n            if is_Dict(export):\n                retval.update(export)\n            else:\n                try:\n                    retval[export] = loc[export]\n                except KeyError:\n                    retval[export] = glob[export]\n    except KeyError as x:\n        raise SCons.Errors.UserError(\"Export of non-existent variable '%s'\"%x)\n\n    return retval\n\nclass Frame:\n    \"\"\"A frame on the SConstruct/SConscript call stack\"\"\"\n    def __init__(self, fs, exports, sconscript):\n        self.globals = BuildDefaultGlobals()\n        self.retval = None\n        self.prev_dir = fs.getcwd()\n        self.exports = compute_exports(exports)  # exports from the calling SConscript\n        # make sure the sconscript attr is a Node.\n        if isinstance(sconscript, SCons.Node.Node):\n            self.sconscript = sconscript\n        elif sconscript == '-':\n            self.sconscript = None\n        else:\n            self.sconscript = fs.File(str(sconscript))\n\n# the SConstruct/SConscript call stack:\ncall_stack = []\n\n# For documentation on the methods in this file, see the scons man-page\n\ndef Return(*vars, **kw):\n    retval = []\n    try:\n        fvars = flatten(vars)\n        for var in fvars:\n            for v in var.split():\n                retval.append(call_stack[-1].globals[v])\n    except KeyError as x:\n        raise SCons.Errors.UserError(\"Return of non-existent variable '%s'\"%x)\n\n    if len(retval) == 1:\n        call_stack[-1].retval = retval[0]\n    else:\n        call_stack[-1].retval = tuple(retval)\n\n    stop = kw.get('stop', True)\n\n    if stop:\n        raise SConscriptReturn\n\n\nstack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)\n\ndef handle_missing_SConscript(f, must_exist=None):\n    \"\"\"Take appropriate action on missing file in SConscript() call.\n\n    Print a warning or raise an exception on missing file, unless\n    missing is explicitly allowed by the *must_exist* value.\n    On first warning, print a deprecation message.\n\n    Args:\n        f (str): path of missing configuration file\n        must_exist (bool): if true, fail.  If false, but not ``None``,\n          allow the file to be missing.  The default is ``None``,\n          which means issue the warning.  The default is deprecated.\n\n    Raises:\n        UserError: if *must_exist* is true or if global\n          :data:`SCons.Script._no_missing_sconscript` is true.\n    \"\"\"\n\n    if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False):\n        msg = \"Fatal: missing SConscript '%s'\" % f.get_internal_path()\n        raise SCons.Errors.UserError(msg)\n\n    if must_exist is None:\n        if SCons.Script._warn_missing_sconscript_deprecated:\n            msg = (\n                \"Calling missing SConscript without error is deprecated.\\n\"\n                \"Transition by adding must_exist=False to SConscript calls.\\n\"\n                \"Missing SConscript '%s'\" % f.get_internal_path()\n            )\n            SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)\n            SCons.Script._warn_missing_sconscript_deprecated = False\n        else:\n            msg = \"Ignoring missing SConscript '%s'\" % f.get_internal_path()\n            SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)\n\ndef _SConscript(fs, *files, **kw):\n    top = fs.Top\n    sd = fs.SConstruct_dir.rdir()\n    exports = kw.get('exports', [])\n\n    # evaluate each SConscript file\n    results = []\n    for fn in files:\n        call_stack.append(Frame(fs, exports, fn))\n        old_sys_path = sys.path\n        try:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1\n            if fn == \"-\":\n                exec(sys.stdin.read(), call_stack[-1].globals)\n            else:\n                if isinstance(fn, SCons.Node.Node):\n                    f = fn\n                else:\n                    f = fs.File(str(fn))\n                _file_ = None\n                SConscriptNodes.add(f)\n\n                # Change directory to the top of the source\n                # tree to make sure the os's cwd and the cwd of\n                # fs match so we can open the SConscript.\n                fs.chdir(top, change_os_dir=1)\n                if f.rexists():\n                    actual = f.rfile()\n                    _file_ = open(actual.get_abspath(), \"rb\")\n                elif f.srcnode().rexists():\n                    actual = f.srcnode().rfile()\n                    _file_ = open(actual.get_abspath(), \"rb\")\n                elif f.has_src_builder():\n                    # The SConscript file apparently exists in a source\n                    # code management system.  Build it, but then clear\n                    # the builder so that it doesn't get built *again*\n                    # during the actual build phase.\n                    f.build()\n                    f.built()\n                    f.builder_set(None)\n                    if f.exists():\n                        _file_ = open(f.get_abspath(), \"rb\")\n                if _file_:\n                    # Chdir to the SConscript directory.  Use a path\n                    # name relative to the SConstruct file so that if\n                    # we're using the -f option, we're essentially\n                    # creating a parallel SConscript directory structure\n                    # in our local directory tree.\n                    #\n                    # XXX This is broken for multiple-repository cases\n                    # where the SConstruct and SConscript files might be\n                    # in different Repositories.  For now, cross that\n                    # bridge when someone comes to it.\n                    try:\n                        src_dir = kw['src_dir']\n                    except KeyError:\n                        ldir = fs.Dir(f.dir.get_path(sd))\n                    else:\n                        ldir = fs.Dir(src_dir)\n                        if not ldir.is_under(f.dir):\n                            # They specified a source directory, but\n                            # it's above the SConscript directory.\n                            # Do the sensible thing and just use the\n                            # SConcript directory.\n                            ldir = fs.Dir(f.dir.get_path(sd))\n                    try:\n                        fs.chdir(ldir, change_os_dir=sconscript_chdir)\n                    except OSError:\n                        # There was no local directory, so we should be\n                        # able to chdir to the Repository directory.\n                        # Note that we do this directly, not through\n                        # fs.chdir(), because we still need to\n                        # interpret the stuff within the SConscript file\n                        # relative to where we are logically.\n                        fs.chdir(ldir, change_os_dir=0)\n                        os.chdir(actual.dir.get_abspath())\n\n                    # Append the SConscript directory to the beginning\n                    # of sys.path so Python modules in the SConscript\n                    # directory can be easily imported.\n                    sys.path = [ f.dir.get_abspath() ] + sys.path\n\n                    # This is the magic line that actually reads up\n                    # and executes the stuff in the SConscript file.\n                    # The locals for this frame contain the special\n                    # bottom-of-the-stack marker so that any\n                    # exceptions that occur when processing this\n                    # SConscript can base the printed frames at this\n                    # level and not show SCons internals as well.\n                    call_stack[-1].globals.update({stack_bottom:1})\n                    old_file = call_stack[-1].globals.get('__file__')\n                    try:\n                        del call_stack[-1].globals['__file__']\n                    except KeyError:\n                        pass\n                    try:\n                        try:\n                            if Main.print_time:\n                                start_time = time.perf_counter()\n                            scriptdata = _file_.read()\n                            scriptname = _file_.name\n                            _file_.close()\n                            exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)\n                        except SConscriptReturn:\n                            pass\n                    finally:\n                        if Main.print_time:\n                            elapsed = time.perf_counter() - start_time\n                            print('SConscript:%s  took %0.3f ms' % (f.get_abspath(), elapsed * 1000.0))\n\n                        if old_file is not None:\n                            call_stack[-1].globals.update({__file__:old_file})\n                            \n                else:\n                    handle_missing_SConscript(f, kw.get('must_exist', None))\n\n        finally:\n            SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1\n            sys.path = old_sys_path\n            frame = call_stack.pop()\n            try:\n                fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir)\n            except OSError:\n                # There was no local directory, so chdir to the\n                # Repository directory.  Like above, we do this\n                # directly.\n                fs.chdir(frame.prev_dir, change_os_dir=0)\n                rdir = frame.prev_dir.rdir()\n                rdir._create()  # Make sure there's a directory there.\n                try:\n                    os.chdir(rdir.get_abspath())\n                except OSError as e:\n                    # We still couldn't chdir there, so raise the error,\n                    # but only if actions are being executed.\n                    #\n                    # If the -n option was used, the directory would *not*\n                    # have been created and we should just carry on and\n                    # let things muddle through.  This isn't guaranteed\n                    # to work if the SConscript files are reading things\n                    # from disk (for example), but it should work well\n                    # enough for most configurations.\n                    if SCons.Action.execute_actions:\n                        raise e\n\n            results.append(frame.retval)\n\n    # if we only have one script, don't return a tuple\n    if len(results) == 1:\n        return results[0]\n    else:\n        return tuple(results)\n\ndef SConscript_exception(file=sys.stderr):\n    \"\"\"Print an exception stack trace just for the SConscript file(s).\n    This will show users who have Python errors where the problem is,\n    without cluttering the output with all of the internal calls leading\n    up to where we exec the SConscript.\"\"\"\n    exc_type, exc_value, exc_tb = sys.exc_info()\n    tb = exc_tb\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find our exec statement, so this was actually a bug\n        # in SCons itself.  Show the whole stack.\n        tb = exc_tb\n    stack = traceback.extract_tb(tb)\n    try:\n        type = exc_type.__name__\n    except AttributeError:\n        type = str(exc_type)\n        if type[:11] == \"exceptions.\":\n            type = type[11:]\n    file.write('%s: %s:\\n' % (type, exc_value))\n    for fname, line, func, text in stack:\n        file.write('  File \"%s\", line %d:\\n' % (fname, line))\n        file.write('    %s\\n' % text)\n\ndef annotate(node):\n    \"\"\"Annotate a node with the stack frame describing the\n    SConscript file and line number that created it.\"\"\"\n    tb = sys.exc_info()[2]\n    while tb and stack_bottom not in tb.tb_frame.f_locals:\n        tb = tb.tb_next\n    if not tb:\n        # We did not find any exec of an SConscript file: what?!\n        raise SCons.Errors.InternalError(\"could not find SConscript stack frame\")\n    node.creator = traceback.extract_stack(tb)[0]\n\n# The following line would cause each Node to be annotated using the\n# above function.  Unfortunately, this is a *huge* performance hit, so\n# leave this disabled until we find a more efficient mechanism.\n#SCons.Node.Annotate = annotate\n\nclass SConsEnvironment(SCons.Environment.Base):\n    \"\"\"An Environment subclass that contains all of the methods that\n    are particular to the wrapper SCons interface and which aren't\n    (or shouldn't be) part of the build engine itself.\n\n    Note that not all of the methods of this class have corresponding\n    global functions, there are some private methods.\n    \"\"\"\n\n    #\n    # Private methods of an SConsEnvironment.\n    #\n    def _exceeds_version(self, major, minor, v_major, v_minor):\n        \"\"\"Return 1 if 'major' and 'minor' are greater than the version\n        in 'v_major' and 'v_minor', and 0 otherwise.\"\"\"\n        return (major > v_major or (major == v_major and minor > v_minor))\n\n    def _get_major_minor_revision(self, version_string):\n        \"\"\"Split a version string into major, minor and (optionally)\n        revision parts.\n\n        This is complicated by the fact that a version string can be\n        something like 3.2b1.\"\"\"\n        version = version_string.split(' ')[0].split('.')\n        v_major = int(version[0])\n        v_minor = int(re.match(r'\\d+', version[1]).group())\n        if len(version) >= 3:\n            v_revision = int(re.match(r'\\d+', version[2]).group())\n        else:\n            v_revision = 0\n        return v_major, v_minor, v_revision\n\n    def _get_SConscript_filenames(self, ls, kw):\n        \"\"\"\n        Convert the parameters passed to SConscript() calls into a list\n        of files and export variables.  If the parameters are invalid,\n        throws SCons.Errors.UserError. Returns a tuple (l, e) where l\n        is a list of SConscript filenames and e is a list of exports.\n        \"\"\"\n        exports = []\n\n        if len(ls) == 0:\n            try:\n                dirs = kw[\"dirs\"]\n            except KeyError:\n                raise SCons.Errors.UserError(\"Invalid SConscript usage - no parameters\")\n\n            if not is_List(dirs):\n                dirs = [ dirs ]\n            dirs = list(map(str, dirs))\n\n            name = kw.get('name', 'SConscript')\n\n            files = [os.path.join(n, name) for n in dirs]\n\n        elif len(ls) == 1:\n\n            files = ls[0]\n\n        elif len(ls) == 2:\n\n            files   = ls[0]\n            exports = self.Split(ls[1])\n\n        else:\n\n            raise SCons.Errors.UserError(\"Invalid SConscript() usage - too many arguments\")\n\n        if not is_List(files):\n            files = [ files ]\n\n        if kw.get('exports'):\n            exports.extend(self.Split(kw['exports']))\n\n        variant_dir = kw.get('variant_dir')\n        if variant_dir:\n            if len(files) != 1:\n                raise SCons.Errors.UserError(\"Invalid SConscript() usage - can only specify one SConscript with a variant_dir\")\n            duplicate = kw.get('duplicate', 1)\n            src_dir = kw.get('src_dir')\n            if not src_dir:\n                src_dir, fname = os.path.split(str(files[0]))\n                files = [os.path.join(str(variant_dir), fname)]\n            else:\n                if not isinstance(src_dir, SCons.Node.Node):\n                    src_dir = self.fs.Dir(src_dir)\n                fn = files[0]\n                if not isinstance(fn, SCons.Node.Node):\n                    fn = self.fs.File(fn)\n                if fn.is_under(src_dir):\n                    # Get path relative to the source directory.\n                    fname = fn.get_path(src_dir)\n                    files = [os.path.join(str(variant_dir), fname)]\n                else:\n                    files = [fn.get_abspath()]\n                kw['src_dir'] = variant_dir\n            self.fs.VariantDir(variant_dir, src_dir, duplicate)\n\n        return (files, exports)\n\n    #\n    # Public methods of an SConsEnvironment.  These get\n    # entry points in the global namespace so they can be called\n    # as global functions.\n    #\n\n    def Configure(self, *args, **kw):\n        if not SCons.Script.sconscript_reading:\n            raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n        kw['_depth'] = kw.get('_depth', 0) + 1\n        return SCons.Environment.Base.Configure(self, *args, **kw)\n\n    def Default(self, *targets):\n        SCons.Script._Set_Default_Targets(self, targets)\n\n    def EnsureSConsVersion(self, major, minor, revision=0):\n        \"\"\"Exit abnormally if the SCons version is not late enough.\"\"\"\n        # split string to avoid replacement during build process\n        if SCons.__version__ == '__' + 'VERSION__':\n            SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning,\n                \"EnsureSConsVersion is ignored for development version\")\n            return\n        scons_ver = self._get_major_minor_revision(SCons.__version__)\n        if scons_ver < (major, minor, revision):\n            if revision:\n                scons_ver_string = '%d.%d.%d' % (major, minor, revision)\n            else:\n                scons_ver_string = '%d.%d' % (major, minor)\n            print(\"SCons %s or greater required, but you have SCons %s\" % \\\n                  (scons_ver_string, SCons.__version__))\n            sys.exit(2)\n\n    def EnsurePythonVersion(self, major, minor):\n        \"\"\"Exit abnormally if the Python version is not late enough.\"\"\"\n        if sys.version_info < (major, minor):\n            v = sys.version.split()[0]\n            print(\"Python %d.%d or greater required, but you have Python %s\" %(major,minor,v))\n            sys.exit(2)\n\n    def Exit(self, value=0):\n        sys.exit(value)\n\n    def Export(self, *vars, **kw):\n        for var in vars:\n            global_exports.update(compute_exports(self.Split(var)))\n        global_exports.update(kw)\n\n    def GetLaunchDir(self):\n        global launch_dir\n        return launch_dir\n\n    def GetOption(self, name):\n        name = self.subst(name)\n        return SCons.Script.Main.GetOption(name)\n\n    def Help(self, text, append=False):\n        text = self.subst(text, raw=1)\n        SCons.Script.HelpFunction(text, append=append)\n\n    def Import(self, *vars):\n        try:\n            frame = call_stack[-1]\n            globals = frame.globals\n            exports = frame.exports\n            for var in vars:\n                var = self.Split(var)\n                for v in var:\n                    if v == '*':\n                        globals.update(global_exports)\n                        globals.update(exports)\n                    else:\n                        if v in exports:\n                            globals[v] = exports[v]\n                        else:\n                            globals[v] = global_exports[v]\n        except KeyError as x:\n            raise SCons.Errors.UserError(\"Import of non-existent variable '%s'\"%x)\n\n    def SConscript(self, *ls, **kw):\n        \"\"\"Execute SCons configuration files.\n\n        Parameters:\n            *ls (str or list): configuration file(s) to execute.\n\n        Keyword arguments:\n            dirs (list): execute SConscript in each listed directory.\n            name (str): execute script 'name' (used only with 'dirs').\n            exports (list or dict): locally export variables the\n              called script(s) can import.\n            variant_dir (str): mirror sources needed for the build in\n             a variant directory to allow building in it.\n            duplicate (bool): physically duplicate sources instead of just\n              adjusting paths of derived files (used only with 'variant_dir')\n              (default is True).\n            must_exist (bool): fail if a requested script is missing\n              (default is False, default is deprecated).\n\n        Returns:\n            list of variables returned by the called script\n\n        Raises:\n            UserError: a script is not found and such exceptions are enabled.\n        \"\"\"\n\n        def subst_element(x, subst=self.subst):\n            if SCons.Util.is_List(x):\n                x = list(map(subst, x))\n            else:\n                x = subst(x)\n            return x\n        ls = list(map(subst_element, ls))\n        subst_kw = {}\n        for key, val in kw.items():\n            if is_String(val):\n                val = self.subst(val)\n            elif SCons.Util.is_List(val):\n                val = [self.subst(v) if is_String(v) else v for v in val]\n            subst_kw[key] = val\n\n        files, exports = self._get_SConscript_filenames(ls, subst_kw)\n        subst_kw['exports'] = exports\n        return _SConscript(self.fs, *files, **subst_kw)\n\n    def SConscriptChdir(self, flag):\n        global sconscript_chdir\n        sconscript_chdir = flag\n\n    def SetOption(self, name, value):\n        name = self.subst(name)\n        SCons.Script.Main.SetOption(name, value)\n\n#\n#\n#\nSCons.Environment.Environment = SConsEnvironment\n\ndef Configure(*args, **kw):\n    if not SCons.Script.sconscript_reading:\n        raise SCons.Errors.UserError(\"Calling Configure from Builders is not supported.\")\n    kw['_depth'] = 1\n    return SCons.SConf.SConf(*args, **kw)\n\n# It's very important that the DefaultEnvironmentCall() class stay in this\n# file, with the get_calling_namespaces() function, the compute_exports()\n# function, the Frame class and the SConsEnvironment.Export() method.\n# These things make up the calling stack leading up to the actual global\n# Export() or SConscript() call that the user issued.  We want to allow\n# users to export local variables that they define, like so:\n#\n#       def func():\n#           x = 1\n#           Export('x')\n#\n# To support this, the get_calling_namespaces() function assumes that\n# the *first* stack frame that's not from this file is the local frame\n# for the Export() or SConscript() call.\n\n_DefaultEnvironmentProxy = None\n\ndef get_DefaultEnvironmentProxy():\n    global _DefaultEnvironmentProxy\n    if not _DefaultEnvironmentProxy:\n        default_env = SCons.Defaults.DefaultEnvironment()\n        _DefaultEnvironmentProxy = SCons.Environment.NoSubstitutionProxy(default_env)\n    return _DefaultEnvironmentProxy\n\nclass DefaultEnvironmentCall:\n    \"\"\"A class that implements \"global function\" calls of\n    Environment methods by fetching the specified method from the\n    DefaultEnvironment's class.  Note that this uses an intermediate\n    proxy class instead of calling the DefaultEnvironment method\n    directly so that the proxy can override the subst() method and\n    thereby prevent expansion of construction variables (since from\n    the user's point of view this was called as a global function,\n    with no associated construction environment).\"\"\"\n    def __init__(self, method_name, subst=0):\n        self.method_name = method_name\n        if subst:\n            self.factory = SCons.Defaults.DefaultEnvironment\n        else:\n            self.factory = get_DefaultEnvironmentProxy\n    def __call__(self, *args, **kw):\n        env = self.factory()\n        method = getattr(env, self.method_name)\n        return method(*args, **kw)\n\n\ndef BuildDefaultGlobals():\n    \"\"\"\n    Create a dictionary containing all the default globals for\n    SConstruct and SConscript files.\n    \"\"\"\n\n    global GlobalDict\n    if GlobalDict is None:\n        GlobalDict = {}\n\n        import SCons.Script\n        d = SCons.Script.__dict__\n        def not_a_module(m, d=d, mtype=type(SCons.Script)):\n             return not isinstance(d[m], mtype)\n        for m in filter(not_a_module, dir(SCons.Script)):\n             GlobalDict[m] = d[m]\n\n    return GlobalDict.copy()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"The main() function used by the scons script.\n\nArchitecturally, this *is* the scons script, and will likely only be\ncalled from the external \"scons\" wrapper.  Consequently, anything here\nshould not be, or be considered, part of the build engine.  If it's\nsomething that we expect other software to want to use, it should go in\nsome other module.  If it's specific to the \"scons\" script invocation,\nit goes here.\n\"\"\"\n\nimport time\nstart_time = time.time()\n\nimport collections\nimport os\nfrom io import StringIO\n\nimport sys\n\n# Special chicken-and-egg handling of the \"--debug=memoizer\" flag:\n#\n# SCons.Memoize contains a metaclass implementation that affects how\n# the other classes are instantiated.  The Memoizer may add shim methods\n# to classes that have methods that cache computed values in order to\n# count and report the hits and misses.\n#\n# If we wait to enable the Memoization until after we've parsed the\n# command line options normally, it will be too late, because the Memoizer\n# will have already analyzed the classes that it's Memoizing and decided\n# to not add the shims.  So we use a special-case, up-front check for\n# the \"--debug=memoizer\" flag and enable Memoizer before we import any\n# of the other modules that use it.\n\n_args = sys.argv + os.environ.get('SCONSFLAGS', '').split()\nif \"--debug=memoizer\" in _args:\n    import SCons.Memoize\n    import SCons.Warnings\n    try:\n        SCons.Memoize.EnableMemoization()\n    except SCons.Warnings.SConsWarning:\n        # Some warning was thrown.  Arrange for it to be displayed\n        # or not after warnings are configured.\n        from . import Main\n        exc_type, exc_value, tb = sys.exc_info()\n        Main.delayed_warnings.append((exc_type, exc_value))\ndel _args\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Environment\nimport SCons.Node.FS\nimport SCons.Platform\nimport SCons.Platform.virtualenv\nimport SCons.Scanner\nimport SCons.SConf\nimport SCons.Subst\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Variables\nimport SCons.Defaults\n\nfrom . import Main\n\nmain                    = Main.main\n\n# The following are global class definitions and variables that used to\n# live directly in this module back before 0.96.90, when it contained\n# a lot of code.  Some SConscript files in widely-distributed packages\n# (Blender is the specific example) actually reached into SCons.Script\n# directly to use some of these.  Rather than break those SConscript\n# files, we're going to propagate these names into the SCons.Script\n# namespace here.\n#\n# Some of these are commented out because it's *really* unlikely anyone\n# used them, but we're going to leave the comment here to try to make\n# it obvious what to do if the situation arises.\nBuildTask               = Main.BuildTask\nCleanTask               = Main.CleanTask\nQuestionTask            = Main.QuestionTask\n#PrintHelp               = Main.PrintHelp\n#SConscriptSettableOptions = Main.SConscriptSettableOptions\n\nAddOption               = Main.AddOption\nPrintHelp               = Main.PrintHelp\nGetOption               = Main.GetOption\nSetOption               = Main.SetOption\nProgress                = Main.Progress\nGetBuildFailures        = Main.GetBuildFailures\n\n#keep_going_on_error     = Main.keep_going_on_error\n#print_dtree             = Main.print_dtree\n#print_explanations      = Main.print_explanations\n#print_includes          = Main.print_includes\n#print_objects           = Main.print_objects\n#print_time              = Main.print_time\n#print_tree              = Main.print_tree\n#memory_stats            = Main.memory_stats\n#ignore_errors           = Main.ignore_errors\n#sconscript_time         = Main.sconscript_time\n#command_time            = Main.command_time\n#exit_status             = Main.exit_status\n#profiling               = Main.profiling\n#repositories            = Main.repositories\n\nfrom . import SConscript\n_SConscript = SConscript\n\ncall_stack              = _SConscript.call_stack\n\n#\nAction                  = SCons.Action.Action\nAddMethod               = SCons.Util.AddMethod\nAllowSubstExceptions    = SCons.Subst.SetAllowableExceptions\nBuilder                 = SCons.Builder.Builder\nConfigure               = _SConscript.Configure\nEnvironment             = SCons.Environment.Environment\n#OptParser               = SCons.SConsOptions.OptParser\nFindPathDirs            = SCons.Scanner.FindPathDirs\nPlatform                = SCons.Platform.Platform\nVirtualenv              = SCons.Platform.virtualenv.Virtualenv\nReturn                  = _SConscript.Return\nScanner                 = SCons.Scanner.ScannerBase\nTool                    = SCons.Tool.Tool\nWhereIs                 = SCons.Util.WhereIs\n\n#\nBoolVariable            = SCons.Variables.BoolVariable\nEnumVariable            = SCons.Variables.EnumVariable\nListVariable            = SCons.Variables.ListVariable\nPackageVariable         = SCons.Variables.PackageVariable\nPathVariable            = SCons.Variables.PathVariable\n\n\n# Action factories.\nChmod                   = SCons.Defaults.Chmod\nCopy                    = SCons.Defaults.Copy\nDelete                  = SCons.Defaults.Delete\nMkdir                   = SCons.Defaults.Mkdir\nMove                    = SCons.Defaults.Move\nTouch                   = SCons.Defaults.Touch\n\n# Pre-made, public scanners.\nCScanner                = SCons.Tool.CScanner\n# Nuitka: Avoid unused tools\n# DScanner                = SCons.Tool.DScanner\nDirScanner              = SCons.Defaults.DirScanner\nProgramScanner          = SCons.Tool.ProgramScanner\nSourceFileScanner       = SCons.Tool.SourceFileScanner\n\n# Functions we might still convert to Environment methods.\nCScan                   = SCons.Defaults.CScan\nDefaultEnvironment      = SCons.Defaults.DefaultEnvironment\n\n# Other variables we provide.\nclass TargetList(collections.UserList):\n    def _do_nothing(self, *args, **kw):\n        pass\n    def _add_Default(self, list):\n        self.extend(list)\n    def _clear(self):\n        del self[:]\n\nARGUMENTS               = {}\nARGLIST                 = []\nBUILD_TARGETS           = TargetList()\nCOMMAND_LINE_TARGETS    = []\nDEFAULT_TARGETS         = []\n\n# BUILD_TARGETS can be modified in the SConscript files.  If so, we\n# want to treat the modified BUILD_TARGETS list as if they specified\n# targets on the command line.  To do that, though, we need to know if\n# BUILD_TARGETS was modified through \"official\" APIs or by hand.  We do\n# this by updating two lists in parallel, the documented BUILD_TARGETS\n# list, above, and this internal _build_plus_default targets list which\n# should only have \"official\" API changes.  Then Script/Main.py can\n# compare these two afterwards to figure out if the user added their\n# own targets to BUILD_TARGETS.\n_build_plus_default = TargetList()\n\ndef _Add_Arguments(alist):\n    for arg in alist:\n        a, b = arg.split('=', 1)\n        ARGUMENTS[a] = b\n        ARGLIST.append((a, b))\n\ndef _Add_Targets(tlist):\n    if tlist:\n        COMMAND_LINE_TARGETS.extend(tlist)\n        BUILD_TARGETS.extend(tlist)\n        BUILD_TARGETS._add_Default = BUILD_TARGETS._do_nothing\n        BUILD_TARGETS._clear = BUILD_TARGETS._do_nothing\n        _build_plus_default.extend(tlist)\n        _build_plus_default._add_Default = _build_plus_default._do_nothing\n        _build_plus_default._clear = _build_plus_default._do_nothing\n\ndef _Set_Default_Targets_Has_Been_Called(d, fs):\n    return DEFAULT_TARGETS\n\ndef _Set_Default_Targets_Has_Not_Been_Called(d, fs):\n    if d is None:\n        d = [fs.Dir('.')]\n    return d\n\n_Get_Default_Targets = _Set_Default_Targets_Has_Not_Been_Called\n\ndef _Set_Default_Targets(env, tlist):\n    global DEFAULT_TARGETS\n    global _Get_Default_Targets\n    _Get_Default_Targets = _Set_Default_Targets_Has_Been_Called\n    for t in tlist:\n        if t is None:\n            # Delete the elements from the list in-place, don't\n            # reassign an empty list to DEFAULT_TARGETS, so that the\n            # variables will still point to the same object we point to.\n            del DEFAULT_TARGETS[:]\n            BUILD_TARGETS._clear()\n            _build_plus_default._clear()\n        elif isinstance(t, SCons.Node.Node):\n            DEFAULT_TARGETS.append(t)\n            BUILD_TARGETS._add_Default([t])\n            _build_plus_default._add_Default([t])\n        else:\n            nodes = env.arg2nodes(t, env.fs.Entry)\n            DEFAULT_TARGETS.extend(nodes)\n            BUILD_TARGETS._add_Default(nodes)\n            _build_plus_default._add_Default(nodes)\n\n#\nhelp_text = None\n\ndef HelpFunction(text, append=False):\n    global help_text\n    if help_text is None:\n        if append:\n            s = StringIO()\n            PrintHelp(s)\n            help_text = s.getvalue()\n            s.close()\n        else:\n            help_text = \"\"\n\n    help_text= help_text + text\n\n\n#\n# Will be non-zero if we are reading an SConscript file.\nsconscript_reading = 0\n\n_no_missing_sconscript = False\n_warn_missing_sconscript_deprecated = True\n\ndef set_missing_sconscript_error(flag=1):\n    \"\"\"Set behavior on missing file in SConscript() call.\n\n    Returns:\n        previous value\n    \"\"\"\n    global _no_missing_sconscript\n    old = _no_missing_sconscript\n    _no_missing_sconscript = flag\n    return old\n\n\ndef Variables(files=None, args=ARGUMENTS):\n    return SCons.Variables.Variables(files, args)\n\n\n# The list of global functions to add to the SConscript name space\n# that end up calling corresponding methods or Builders in the\n# DefaultEnvironment().\nGlobalDefaultEnvironmentFunctions = [\n    # Methods from the SConsEnvironment class, above.\n    'Default',\n    'EnsurePythonVersion',\n    'EnsureSConsVersion',\n    'Exit',\n    'Export',\n    'GetLaunchDir',\n    'Help',\n    'Import',\n    #'SConscript', is handled separately, below.\n    'SConscriptChdir',\n\n    # Methods from the Environment.Base class.\n    'AddPostAction',\n    'AddPreAction',\n    'Alias',\n    'AlwaysBuild',\n    'CacheDir',\n    'Clean',\n    #The Command() method is handled separately, below.\n    'Decider',\n    'Depends',\n    'Dir',\n    'NoClean',\n    'NoCache',\n    'Entry',\n    'Execute',\n    'File',\n    'FindFile',\n    'FindInstalledFiles',\n    'FindSourceFiles',\n    'Flatten',\n    'GetBuildPath',\n    'Glob',\n    'Ignore',\n    'Install',\n    'InstallAs',\n    'InstallVersionedLib',\n    'Literal',\n    'Local',\n    'ParseDepends',\n    'Precious',\n    'PyPackageDir',\n    'Repository',\n    'Requires',\n    'SConsignFile',\n    'SideEffect',\n    'Split',\n    'Tag',\n    'Value',\n    'VariantDir',\n]\n\nGlobalDefaultBuilders = [\n    # Supported builders.\n    'CFile',\n    'CXXFile',\n    'DVI',\n    'Jar',\n    'Java',\n    'JavaH',\n    'Library',\n    'LoadableModule',\n    'M4',\n    'MSVSProject',\n    'Object',\n    'PCH',\n    'PDF',\n    'PostScript',\n    'Program',\n    'RES',\n    'RMIC',\n    'SharedLibrary',\n    'SharedObject',\n    'StaticLibrary',\n    'StaticObject',\n    'Substfile',\n    'Tar',\n    'Textfile',\n    'TypeLibrary',\n    'Zip',\n    'Package',\n]\n\nfor name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders:\n    exec (\"%s = _SConscript.DefaultEnvironmentCall(%s)\" % (name, repr(name)))\ndel name\n\n# There are a handful of variables that used to live in the\n# Script/SConscript.py module that some SConscript files out there were\n# accessing directly as SCons.Script.SConscript.*.  The problem is that\n# \"SConscript\" in this namespace is no longer a module, it's a global\n# function call--or more precisely, an object that implements a global\n# function call through the default Environment.  Nevertheless, we can\n# maintain backwards compatibility for SConscripts that were reaching in\n# this way by hanging some attributes off the \"SConscript\" object here.\nSConscript = _SConscript.DefaultEnvironmentCall('SConscript')\n\n# Make SConscript look enough like the module it used to be so\n# that pychecker doesn't barf.\nSConscript.__name__ = 'SConscript'\n\nSConscript.Arguments = ARGUMENTS\nSConscript.ArgList = ARGLIST\nSConscript.BuildTargets = BUILD_TARGETS\nSConscript.CommandLineTargets = COMMAND_LINE_TARGETS\nSConscript.DefaultTargets = DEFAULT_TARGETS\n\n# The global Command() function must be handled differently than the\n# global functions for other construction environment methods because\n# we want people to be able to use Actions that must expand $TARGET\n# and $SOURCE later, when (and if) the Action is invoked to build\n# the target(s).  We do this with the subst=1 argument, which creates\n# a DefaultEnvironmentCall instance that wraps up a normal default\n# construction environment that performs variable substitution, not a\n# proxy that doesn't.\n#\n# There's a flaw here, though, because any other $-variables on a command\n# line will *also* be expanded, each to a null string, but that should\n# only be a problem in the unusual case where someone was passing a '$'\n# on a command line and *expected* the $ to get through to the shell\n# because they were calling Command() and not env.Command()...  This is\n# unlikely enough that we're going to leave this as is and cross that\n# bridge if someone actually comes to it.\nCommand = _SConscript.DefaultEnvironmentCall('Command', subst=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons string substitution.\"\"\"\n\nimport collections\nimport re\nfrom inspect import signature, Parameter\n\nimport SCons.Errors\nfrom SCons.Util import is_String, is_Sequence\n\n# Indexed by the SUBST_* constants below.\n_strconv = [\n    SCons.Util.to_String_for_subst,\n    SCons.Util.to_String_for_subst,\n    SCons.Util.to_String_for_signature,\n]\n\nAllowableExceptions = (IndexError, NameError)\n\n\ndef SetAllowableExceptions(*excepts):\n    global AllowableExceptions\n    AllowableExceptions = [_f for _f in excepts if _f]\n\n\ndef raise_exception(exception, target, s):\n    name = exception.__class__.__name__\n    msg = \"%s `%s' trying to evaluate `%s'\" % (name, exception, s)\n    if target:\n        raise SCons.Errors.BuildError(target[0], msg)\n    else:\n        raise SCons.Errors.UserError(msg)\n\n\nclass Literal:\n    \"\"\"A wrapper for a string.  If you use this object wrapped\n    around a string, then it will be interpreted as literal.\n    When passed to the command interpreter, all special\n    characters will be escaped.\"\"\"\n    def __init__(self, lstr):\n        self.lstr = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.lstr\n\n    def is_literal(self):\n        return 1\n\n    def __eq__(self, other):\n        if not isinstance(other, Literal):\n            return False\n        return self.lstr == other.lstr\n\n    def __neq__(self, other):\n        return not self.__eq__(other)\n\n    def __hash__(self):\n        return hash(self.lstr)\n\nclass SpecialAttrWrapper:\n    \"\"\"This is a wrapper for what we call a 'Node special attribute.'\n    This is any of the attributes of a Node that we can reference from\n    Environment variable substitution, such as $TARGET.abspath or\n    $SOURCES[1].filebase.  We implement the same methods as Literal\n    so we can handle special characters, plus a for_signature method,\n    such that we can return some canonical string during signature\n    calculation to avoid unnecessary rebuilds.\"\"\"\n\n    def __init__(self, lstr, for_signature=None):\n        \"\"\"The for_signature parameter, if supplied, will be the\n        canonical string we return from for_signature().  Else\n        we will simply return lstr.\"\"\"\n        self.lstr = lstr\n        if for_signature:\n            self.forsig = for_signature\n        else:\n            self.forsig = lstr\n\n    def __str__(self):\n        return self.lstr\n\n    def escape(self, escape_func):\n        return escape_func(self.lstr)\n\n    def for_signature(self):\n        return self.forsig\n\n    def is_literal(self):\n        return 1\n\ndef quote_spaces(arg):\n    \"\"\"Generic function for putting double quotes around any string that\n    has white space in it.\"\"\"\n    if ' ' in arg or '\\t' in arg:\n        return '\"%s\"' % arg\n    else:\n        return str(arg)\n\nclass CmdStringHolder(collections.UserString):\n    \"\"\"This is a special class used to hold strings generated by\n    scons_subst() and scons_subst_list().  It defines a special method\n    escape().  When passed a function with an escape algorithm for a\n    particular platform, it will return the contained string with the\n    proper escape sequences inserted.\n    \"\"\"\n    def __init__(self, cmd, literal=None):\n        collections.UserString.__init__(self, cmd)\n        self.literal = literal\n\n    def is_literal(self):\n        return self.literal\n\n    def escape(self, escape_func, quote_func=quote_spaces):\n        \"\"\"Escape the string with the supplied function.  The\n        function is expected to take an arbitrary string, then\n        return it with all special characters escaped and ready\n        for passing to the command interpreter.\n\n        After calling this function, the next call to str() will\n        return the escaped string.\n        \"\"\"\n\n        if self.is_literal():\n            return escape_func(self.data)\n        elif ' ' in self.data or '\\t' in self.data:\n            return quote_func(self.data)\n        else:\n            return self.data\n\ndef escape_list(mylist, escape_func):\n    \"\"\"Escape a list of arguments by running the specified escape_func\n    on every object in the list that has an escape() method.\"\"\"\n    def escape(obj, escape_func=escape_func):\n        try:\n            e = obj.escape\n        except AttributeError:\n            return obj\n        else:\n            return e(escape_func)\n    return list(map(escape, mylist))\n\nclass NLWrapper:\n    \"\"\"A wrapper class that delays turning a list of sources or targets\n    into a NodeList until it's needed.  The specified function supplied\n    when the object is initialized is responsible for turning raw nodes\n    into proxies that implement the special attributes like .abspath,\n    .source, etc.  This way, we avoid creating those proxies just\n    \"in case\" someone is going to use $TARGET or the like, and only\n    go through the trouble if we really have to.\n\n    In practice, this might be a wash performance-wise, but it's a little\n    cleaner conceptually...\n    \"\"\"\n\n    def __init__(self, list, func):\n        self.list = list\n        self.func = func\n    def _return_nodelist(self):\n        return self.nodelist\n    def _gen_nodelist(self):\n        mylist = self.list\n        if mylist is None:\n            mylist = []\n        elif not is_Sequence(mylist):\n            mylist = [mylist]\n        # The map(self.func) call is what actually turns\n        # a list into appropriate proxies.\n        self.nodelist = SCons.Util.NodeList(list(map(self.func, mylist)))\n        self._create_nodelist = self._return_nodelist\n        return self.nodelist\n    _create_nodelist = _gen_nodelist\n\n\nclass Targets_or_Sources(collections.UserList):\n    \"\"\"A class that implements $TARGETS or $SOURCES expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access the list, calling the NLWrapper to create proxies on demand.\n\n    Note that we subclass collections.UserList purely so that the\n    is_Sequence() function will identify an object of this class as\n    a list during variable expansion.  We're not really using any\n    collections.UserList methods in practice.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        return getattr(nl, attr)\n    def __getitem__(self, i):\n        nl = self.nl._create_nodelist()\n        return nl[i]\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        return str(nl)\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        return repr(nl)\n\nclass Target_or_Source:\n    \"\"\"A class that implements $TARGET or $SOURCE expansions by in turn\n    wrapping a NLWrapper.  This class handles the different methods used\n    to access an individual proxy Node, calling the NLWrapper to create\n    a proxy on demand.\n    \"\"\"\n    def __init__(self, nl):\n        self.nl = nl\n    def __getattr__(self, attr):\n        nl = self.nl._create_nodelist()\n        try:\n            nl0 = nl[0]\n        except IndexError:\n            # If there is nothing in the list, then we have no attributes to\n            # pass through, so raise AttributeError for everything.\n            raise AttributeError(\"NodeList has no attribute: %s\" % attr)\n        return getattr(nl0, attr)\n    def __str__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return str(nl[0])\n        return ''\n    def __repr__(self):\n        nl = self.nl._create_nodelist()\n        if nl:\n            return repr(nl[0])\n        return ''\n\nclass NullNodeList(SCons.Util.NullSeq):\n  def __call__(self, *args, **kwargs): return ''\n  def __str__(self): return ''\n\nNullNodesList = NullNodeList()\n\ndef subst_dict(target, source):\n    \"\"\"Create a dictionary for substitution of special\n    construction variables.\n\n    This translates the following special arguments:\n\n    target - the target (object or array of objects),\n             used to generate the TARGET and TARGETS\n             construction variables\n\n    source - the source (object or array of objects),\n             used to generate the SOURCES and SOURCE\n             construction variables\n    \"\"\"\n    dict = {}\n\n    if target:\n        def get_tgt_subst_proxy(thing):\n            try:\n                subst_proxy = thing.get_subst_proxy()\n            except AttributeError:\n                subst_proxy = thing # probably a string, just return it\n            return subst_proxy\n        tnl = NLWrapper(target, get_tgt_subst_proxy)\n        dict['TARGETS'] = Targets_or_Sources(tnl)\n        dict['TARGET'] = Target_or_Source(tnl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_TARGETS'] = '$TARGETS'\n        dict['UNCHANGED_TARGETS'] = '$TARGETS'\n    else:\n        dict['TARGETS'] = NullNodesList\n        dict['TARGET'] = NullNodesList\n\n    if source:\n        def get_src_subst_proxy(node):\n            try:\n                rfile = node.rfile\n            except AttributeError:\n                pass\n            else:\n                node = rfile()\n            try:\n                return node.get_subst_proxy()\n            except AttributeError:\n                return node     # probably a String, just return it\n        snl = NLWrapper(source, get_src_subst_proxy)\n        dict['SOURCES'] = Targets_or_Sources(snl)\n        dict['SOURCE'] = Target_or_Source(snl)\n\n        # This is a total cheat, but hopefully this dictionary goes\n        # away soon anyway.  We just let these expand to $TARGETS\n        # because that's \"good enough\" for the use of ToolSurrogates\n        # (see test/ToolSurrogate.py) to generate documentation.\n        dict['CHANGED_SOURCES'] = '$SOURCES'\n        dict['UNCHANGED_SOURCES'] = '$SOURCES'\n    else:\n        dict['SOURCES'] = NullNodesList\n        dict['SOURCE'] = NullNodesList\n\n    return dict\n\n\n_callable_args_set = {'target', 'source', 'env', 'for_signature'}\n\nclass StringSubber:\n    \"\"\"A class to construct the results of a scons_subst() call.\n\n    This binds a specific construction environment, mode, target and\n    source with two methods (substitute() and expand()) that handle\n    the expansion.\n    \"\"\"\n\n\n    def __init__(self, env, mode, conv, gvars):\n        self.env = env\n        self.mode = mode\n        self.conv = conv\n        self.gvars = gvars\n\n    def expand(self, s, lvars):\n        \"\"\"Expand a single \"token\" as necessary, returning an\n        appropriate string containing the expansion.\n\n        This handles expanding different types of things (strings,\n        lists, callables) appropriately.  It calls the wrapper\n        substitute() method to re-expand things as necessary, so that\n        the results of expansions of side-by-side strings still get\n        re-evaluated separately, not smushed together.\n        \"\"\"\n        if is_String(s):\n            try:\n                s0, s1 = s[:2]\n            except (IndexError, ValueError):\n                return s\n            if s0 != '$':\n                return s\n            if s1 == '$':\n                # In this case keep the double $'s which we'll later\n                # swap for a single dollar sign as we need to retain\n                # this information to properly avoid matching \"$(\"\" when\n                # the actual text was \"$$(\"\"  (or \"$)\"\" when \"$$)\"\" )\n                return '$$'\n            elif s1 in '()':\n                return s\n            else:\n                key = s[1:]\n                if key[0] == '{' or '.' in key:\n                    if key[0] == '{':\n                        key = key[1:-1]\n\n                # Store for error messages if we fail to expand the\n                # value\n                old_s = s\n                s = None\n                if key in lvars:\n                     s = lvars[key]\n                elif key in self.gvars:\n                     s = self.gvars[key]\n                else:\n                     try:\n                          s = eval(key, self.gvars, lvars)\n                     except KeyboardInterrupt:\n                          raise\n                     except Exception as e:\n                          if e.__class__ in AllowableExceptions:\n                               return ''\n                          raise_exception(e, lvars['TARGETS'], old_s)\n\n                if s is None and NameError not in AllowableExceptions:\n                     raise_exception(NameError(key), lvars['TARGETS'], old_s)\n                elif s is None:\n                     return ''\n\n                # Before re-expanding the result, handle\n                # recursive expansion by copying the local\n                # variable dictionary and overwriting a null\n                # string for the value of the variable name\n                # we just expanded.\n                #\n                # This could potentially be optimized by only\n                # copying lvars when s contains more expansions,\n                # but lvars is usually supposed to be pretty\n                # small, and deeply nested variable expansions\n                # are probably more the exception than the norm,\n                # so it should be tolerable for now.\n                lv = lvars.copy()\n                var = key.split('.')[0]\n                lv[var] = ''\n                return self.substitute(s, lv)\n        elif is_Sequence(s):\n            def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars):\n                return conv(substitute(l, lvars))\n            return list(map(func, s))\n        elif callable(s):\n\n            # SCons has the unusual Null class where any __getattr__ call returns it's self, \n            # which does not work the signature module, and the Null class returns an empty\n            # string if called on, so we make an exception in this condition for Null class\n            # Also allow callables where the only non default valued args match the expected defaults\n            # this should also allow functools.partial's to work.\n            if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).parameters.items() if\n                                                  k in _callable_args_set or v.default == Parameter.empty} == _callable_args_set:\n\n                s = s(target=lvars['TARGETS'],\n                     source=lvars['SOURCES'],\n                     env=self.env,\n                     for_signature=(self.mode == SUBST_SIG))\n            else:\n                # This probably indicates that it's a callable\n                # object that doesn't match our calling arguments\n                # (like an Action).\n                if self.mode == SUBST_RAW:\n                    return s\n                s = self.conv(s)\n            return self.substitute(s, lvars)\n        elif s is None:\n            return ''\n        else:\n            return s\n\n    def substitute(self, args, lvars):\n        \"\"\"Substitute expansions in an argument or list of arguments.\n\n        This serves as a wrapper for splitting up a string into\n        separate tokens.\n        \"\"\"\n        if is_String(args) and not isinstance(args, CmdStringHolder):\n            args = str(args)        # In case it's a UserString.\n            try:\n                def sub_match(match):\n                    return self.conv(self.expand(match.group(1), lvars))\n                result = _dollar_exps.sub(sub_match, args)\n            except TypeError:\n                # If the internal conversion routine doesn't return\n                # strings (it could be overridden to return Nodes, for\n                # example), then the 1.5.2 re module will throw this\n                # exception.  Back off to a slower, general-purpose\n                # algorithm that works for all data types.\n                args = _separate_args.findall(args)\n                result = []\n                for a in args:\n                    result.append(self.conv(self.expand(a, lvars)))\n                if len(result) == 1:\n                    result = result[0]\n                else:\n                    result = ''.join(map(str, result))\n            return result\n        else:\n            return self.expand(args, lvars)\n\n\nclass ListSubber(collections.UserList):\n    \"\"\"A class to construct the results of a scons_subst_list() call.\n\n    Like StringSubber, this class binds a specific construction\n    environment, mode, target and source with two methods\n    (substitute() and expand()) that handle the expansion.\n\n    In addition, however, this class is used to track the state of\n    the result(s) we're gathering so we can do the appropriate thing\n    whenever we have to append another word to the result--start a new\n    line, start a new word, append to the current word, etc.  We do\n    this by setting the \"append\" attribute to the right method so\n    that our wrapper methods only need ever call ListSubber.append(),\n    and the rest of the object takes care of doing the right thing\n    internally.\n    \"\"\"\n    def __init__(self, env, mode, conv, gvars):\n        collections.UserList.__init__(self, [])\n        self.env = env\n        self.mode = mode\n        self.conv = conv\n        self.gvars = gvars\n\n        if self.mode == SUBST_RAW:\n            self.add_strip = lambda x: self.append(x)\n        else:\n            self.add_strip = lambda x: None\n        self.in_strip = None\n        self.next_line()\n\n    def expanded(self, s):\n        \"\"\"Determines if the string s requires further expansion.\n\n        Due to the implementation of ListSubber expand will call\n        itself 2 additional times for an already expanded string. This\n        method is used to determine if a string is already fully\n        expanded and if so exit the loop early to prevent these\n        recursive calls.\n        \"\"\"\n        if not is_String(s) or isinstance(s, CmdStringHolder):\n            return False\n\n        s = str(s)  # in case it's a UserString\n        return _separate_args.findall(s) is None\n\n    def expand(self, s, lvars, within_list):\n        \"\"\"Expand a single \"token\" as necessary, appending the\n        expansion to the current result.\n\n        This handles expanding different types of things (strings,\n        lists, callables) appropriately.  It calls the wrapper\n        substitute() method to re-expand things as necessary, so that\n        the results of expansions of side-by-side strings still get\n        re-evaluated separately, not smushed together.\n        \"\"\"\n\n        if is_String(s):\n            try:\n                s0, s1 = s[:2]\n            except (IndexError, ValueError):\n                self.append(s)\n                return\n            if s0 != '$':\n                self.append(s)\n                return\n            if s1 == '$':\n                self.append('$')\n            elif s1 == '(':\n                self.open_strip('$(')\n            elif s1 == ')':\n                self.close_strip('$)')\n            else:\n                key = s[1:]\n                if key[0] == '{' or key.find('.') >= 0:\n                    if key[0] == '{':\n                        key = key[1:-1]\n\n                # Store for error messages if we fail to expand the\n                # value\n                old_s = s\n                s = None\n                if key in lvars:\n                     s = lvars[key]\n                elif key in self.gvars:\n                     s = self.gvars[key]\n                else:\n                     try:\n                         s = eval(key, self.gvars, lvars)\n                     except KeyboardInterrupt:\n                         raise\n                     except Exception as e:\n                         if e.__class__ in AllowableExceptions:\n                             return\n                         raise_exception(e, lvars['TARGETS'], old_s)\n\n                if s is None and NameError not in AllowableExceptions:\n                     raise_exception(NameError(), lvars['TARGETS'], old_s)\n                elif s is None:\n                     return\n\n                # If the string is already full expanded there's no\n                # need to continue recursion.\n                if self.expanded(s):\n                    self.append(s)\n                    return\n\n                # Before re-expanding the result, handle\n                # recursive expansion by copying the local\n                # variable dictionary and overwriting a null\n                # string for the value of the variable name\n                # we just expanded.\n                lv = lvars.copy()\n                var = key.split('.')[0]\n                lv[var] = ''\n                self.substitute(s, lv, 0)\n                self.this_word()\n        elif is_Sequence(s):\n            for a in s:\n                self.substitute(a, lvars, 1)\n                self.next_word()\n        elif callable(s):\n            # SCons has the unusual Null class where any __getattr__ call returns it's self, \n            # which does not work the signature module, and the Null class returns an empty\n            # string if called on, so we make an exception in this condition for Null class\n            # Also allow callables where the only non default valued args match the expected defaults\n            # this should also allow functools.partial's to work.\n            if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).parameters.items() if\n                                                  k in _callable_args_set or v.default == Parameter.empty} == _callable_args_set:\n\n                s = s(target=lvars['TARGETS'],\n                     source=lvars['SOURCES'],\n                     env=self.env,\n                     for_signature=(self.mode != SUBST_CMD))\n            else:\n                # This probably indicates that it's a callable\n                # object that doesn't match our calling arguments\n                # (like an Action).\n                if self.mode == SUBST_RAW:\n                    self.append(s)\n                    return\n                s = self.conv(s)\n            self.substitute(s, lvars, within_list)\n        elif s is None:\n            self.this_word()\n        else:\n            self.append(s)\n\n    def substitute(self, args, lvars, within_list):\n        \"\"\"Substitute expansions in an argument or list of arguments.\n\n        This serves as a wrapper for splitting up a string into\n        separate tokens.\n        \"\"\"\n\n        if is_String(args) and not isinstance(args, CmdStringHolder):\n            args = str(args)        # In case it's a UserString.\n            args = _separate_args.findall(args)\n            for a in args:\n                if a[0] in ' \\t\\n\\r\\f\\v':\n                    if '\\n' in a:\n                        self.next_line()\n                    elif within_list:\n                        self.append(a)\n                    else:\n                        self.next_word()\n                else:\n                    self.expand(a, lvars, within_list)\n        else:\n            self.expand(args, lvars, within_list)\n\n    def next_line(self):\n        \"\"\"Arrange for the next word to start a new line.  This\n        is like starting a new word, except that we have to append\n        another line to the result.\"\"\"\n        collections.UserList.append(self, [])\n        self.next_word()\n\n    def this_word(self):\n        \"\"\"Arrange for the next word to append to the end of the\n        current last word in the result.\"\"\"\n        self.append = self.add_to_current_word\n\n    def next_word(self):\n        \"\"\"Arrange for the next word to start a new word.\"\"\"\n        self.append = self.add_new_word\n\n    def add_to_current_word(self, x):\n        \"\"\"Append the string x to the end of the current last word\n        in the result.  If that is not possible, then just add\n        it as a new word.  Make sure the entire concatenated string\n        inherits the object attributes of x (in particular, the\n        escape function) by wrapping it as CmdStringHolder.\"\"\"\n\n        if not self.in_strip or self.mode != SUBST_SIG:\n            try:\n                current_word = self[-1][-1]\n            except IndexError:\n                self.add_new_word(x)\n            else:\n                # All right, this is a hack and it should probably\n                # be refactored out of existence in the future.\n                # The issue is that we want to smoosh words together\n                # and make one file name that gets escaped if\n                # we're expanding something like foo$EXTENSION,\n                # but we don't want to smoosh them together if\n                # it's something like >$TARGET, because then we'll\n                # treat the '>' like it's part of the file name.\n                # So for now, just hard-code looking for the special\n                # command-line redirection characters...\n                try:\n                    last_char = str(current_word)[-1]\n                except IndexError:\n                    last_char = '\\0'\n                if last_char in '<>|':\n                    self.add_new_word(x)\n                else:\n                    y = current_word + x\n\n                    # We used to treat a word appended to a literal\n                    # as a literal itself, but this caused problems\n                    # with interpreting quotes around space-separated\n                    # targets on command lines.  Removing this makes\n                    # none of the \"substantive\" end-to-end tests fail,\n                    # so we'll take this out but leave it commented\n                    # for now in case there's a problem not covered\n                    # by the test cases and we need to resurrect this.\n                    #literal1 = self.literal(self[-1][-1])\n                    #literal2 = self.literal(x)\n                    y = self.conv(y)\n                    if is_String(y):\n                        #y = CmdStringHolder(y, literal1 or literal2)\n                        y = CmdStringHolder(y, None)\n                    self[-1][-1] = y\n\n    def add_new_word(self, x):\n        if not self.in_strip or self.mode != SUBST_SIG:\n            literal = self.literal(x)\n            x = self.conv(x)\n            if is_String(x):\n                x = CmdStringHolder(x, literal)\n            self[-1].append(x)\n        self.append = self.add_to_current_word\n\n    def literal(self, x):\n        try:\n            l = x.is_literal\n        except AttributeError:\n            return None\n        else:\n            return l()\n\n    def open_strip(self, x):\n        \"\"\"Handle the \"open strip\" $( token.\"\"\"\n        self.add_strip(x)\n        self.in_strip = 1\n\n    def close_strip(self, x):\n        \"\"\"Handle the \"close strip\" $) token.\"\"\"\n        self.add_strip(x)\n        self.in_strip = None\n\n\n# Constants for the \"mode\" parameter to scons_subst_list() and\n# scons_subst().  SUBST_RAW gives the raw command line.  SUBST_CMD\n# gives a command line suitable for passing to a shell.  SUBST_SIG\n# gives a command line appropriate for calculating the signature\n# of a command line...if this changes, we should rebuild.\nSUBST_CMD = 0\nSUBST_RAW = 1\nSUBST_SIG = 2\n\n_rm = re.compile(r'\\$[()]')\n\n# Note the pattern below only matches $( or $) when there is no\n# preceeding $. (Thus the (?<!\\$))\n_rm_split = re.compile(r'(?<!\\$)(\\$[()])')\n\n# Indexed by the SUBST_* constants above.\n_regex_remove = [ _rm, None, _rm_split ]\n\ndef _rm_list(list):\n    return [l for l in list if l not in ('$(', '$)')]\n\ndef _remove_list(list):\n    result = []\n    depth = 0\n    for l in list:\n        if l == '$(':\n            depth += 1\n        elif l == '$)':\n            depth -= 1\n            if depth < 0:\n                break\n        elif depth == 0:\n            result.append(l)\n    if depth != 0:\n        return None\n    return result\n\n# Indexed by the SUBST_* constants above.\n_list_remove = [ _rm_list, None, _remove_list ]\n\n# Regular expressions for splitting strings and handling substitutions,\n# for use by the scons_subst() and scons_subst_list() functions:\n#\n# The first expression compiled matches all of the $-introduced tokens\n# that we need to process in some way, and is used for substitutions.\n# The expressions it matches are:\n#\n#       \"$$\"\n#       \"$(\"\n#       \"$)\"\n#       \"$variable\"             [must begin with alphabetic or underscore]\n#       \"${any stuff}\"\n#\n# The second expression compiled is used for splitting strings into tokens\n# to be processed, and it matches all of the tokens listed above, plus\n# the following that affect how arguments do or don't get joined together:\n#\n#       \"   \"                   [white space]\n#       \"non-white-space\"       [without any dollar signs]\n#       \"$\"                     [single dollar sign]\n#\n_dollar_exps_str = r'\\$[\\$\\(\\)]|\\$[_a-zA-Z][\\.\\w]*|\\${[^}]*}'\n_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)\n_separate_args = re.compile(r'(%s|\\s+|[^\\s$]+|\\$)' % _dollar_exps_str)\n\n# This regular expression is used to replace strings of multiple white\n# space characters in the string result from the scons_subst() function.\n_space_sep = re.compile(r'[\\t ]+(?![^{]*})')\n\ndef scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Expand a string or list containing construction variable\n    substitutions.\n\n    This is the work-horse function for substitutions in file names\n    and the like.  The companion scons_subst_list() function (below)\n    handles separating command lines into lists of arguments, so see\n    that function if that's what you're looking for.\n    \"\"\"\n    if (isinstance(strSubst, str) and '$' not in strSubst) or isinstance(strSubst, CmdStringHolder):\n        return strSubst\n\n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ss = StringSubber(env, mode, conv, gvars)\n    result = ss.substitute(strSubst, lvars)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    res = result\n    if is_String(result):\n        # Remove $(-$) pairs and any stuff in between,\n        # if that's appropriate.\n        remove = _regex_remove[mode]\n        if remove:\n            if mode == SUBST_SIG:\n                result = _list_remove[mode](remove.split(result))\n                if result is None:\n                    raise SCons.Errors.UserError(\"Unbalanced $(/$) in: \" + res)\n                result = ' '.join(result)\n            else:\n                result = remove.sub('', result)\n        if mode != SUBST_RAW:\n            # Compress strings of white space characters into\n            # a single space.\n            result = _space_sep.sub(' ', result).strip()\n\n        # Now replace escaped $'s currently \"$$\"\n        # This is needed because we now retain $$ instead of\n        # replacing them during substition to avoid\n        # improperly trying to escape \"$$(\" as being \"$(\"\n        result = result.replace('$$','$')\n    elif is_Sequence(result):\n        remove = _list_remove[mode]\n        if remove:\n            result = remove(result)\n            if result is None:\n                raise SCons.Errors.UserError(\"Unbalanced $(/$) in: \" + str(res))\n\n    return result\n\ndef scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):\n    \"\"\"Substitute construction variables in a string (or list or other\n    object) and separate the arguments into a command list.\n\n    The companion scons_subst() function (above) handles basic\n    substitutions within strings, so see that function instead\n    if that's what you're looking for.\n    \"\"\" \n    if conv is None:\n        conv = _strconv[mode]\n\n    # Doing this every time is a bit of a waste, since the Executor\n    # has typically already populated the OverrideEnvironment with\n    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,\n    # because it supports existing behavior that allows us to call\n    # an Action directly with an arbitrary target+source pair, which\n    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.\n    # If we dropped that behavior (or found another way to cover it),\n    # we could get rid of this call completely and just rely on the\n    # Executor setting the variables.\n    if 'TARGET' not in lvars:\n        d = subst_dict(target, source)\n        if d:\n            lvars = lvars.copy()\n            lvars.update(d)\n\n    # We're (most likely) going to eval() things.  If Python doesn't\n    # find a __builtins__ value in the global dictionary used for eval(),\n    # it copies the current global values for you.  Avoid this by\n    # setting it explicitly and then deleting, so we don't pollute the\n    # construction environment Dictionary(ies) that are typically used\n    # for expansion.\n    gvars['__builtins__'] = __builtins__\n\n    ls = ListSubber(env, mode, conv, gvars)\n    ls.substitute(strSubst, lvars, 0)\n\n    try:\n        del gvars['__builtins__']\n    except KeyError:\n        pass\n\n    return ls.data\n\ndef scons_subst_once(strSubst, env, key):\n    \"\"\"Perform single (non-recursive) substitution of a single\n    construction variable keyword.\n\n    This is used when setting a variable when copying or overriding values\n    in an Environment.  We want to capture (expand) the old value before\n    we override it, so people can do things like:\n\n        env2 = env.Clone(CCFLAGS = '$CCFLAGS -g')\n\n    We do this with some straightforward, brute-force code here...\n    \"\"\"\n    if isinstance(strSubst, str) and strSubst.find('$') < 0:\n        return strSubst\n\n    matchlist = ['$' + key, '${' + key + '}']\n    val = env.get(key, '')\n    def sub_match(match, val=val, matchlist=matchlist):\n        a = match.group(1)\n        if a in matchlist:\n            a = val\n        if is_Sequence(a):\n            return ' '.join(map(str, a))\n        else:\n            return str(a)\n\n    if is_Sequence(strSubst):\n        result = []\n        for arg in strSubst:\n            if is_String(arg):\n                if arg in matchlist:\n                    arg = val\n                    if is_Sequence(arg):\n                        result.extend(arg)\n                    else:\n                        result.append(arg)\n                else:\n                    result.append(_dollar_exps.sub(sub_match, arg))\n            else:\n                result.append(arg)\n        return result\n    elif is_String(strSubst):\n        return _dollar_exps.sub(sub_match, strSubst)\n    else:\n        return strSubst\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Generic Taskmaster module for the SCons build engine.\n\nThis module contains the primary interface(s) between a wrapping user\ninterface and the SCons build engine.  There are two key classes here:\n\nTaskmaster\n    This is the main engine for walking the dependency graph and\n    calling things to decide what does or doesn't need to be built.\n\nTask\n    This is the base class for allowing a wrapping interface to\n    decide what does or doesn't actually need to be done.  The\n    intention is for a wrapping interface to subclass this as\n    appropriate for different types of behavior it may need.\n\n    The canonical example is the SCons native Python interface,\n    which has Task subclasses that handle its specific behavior,\n    like printing \"'foo' is up to date\" when a top-level target\n    doesn't need to be built, and handling the -c option by removing\n    targets as its \"build\" action.  There is also a separate subclass\n    for suppressing this output when the -q option is used.\n\n    The Taskmaster instantiates a Task object for each (set of)\n    target(s) that it decides need to be evaluated and/or built.\n\"\"\"\n\nimport sys\nfrom abc import ABC, abstractmethod\nfrom itertools import chain\n\nimport SCons.Errors\nimport SCons.Node\nimport SCons.Warnings\n\nStateString = SCons.Node.StateString\nNODE_NO_STATE = SCons.Node.no_state\nNODE_PENDING = SCons.Node.pending\nNODE_EXECUTING = SCons.Node.executing\nNODE_UP_TO_DATE = SCons.Node.up_to_date\nNODE_EXECUTED = SCons.Node.executed\nNODE_FAILED = SCons.Node.failed\n\nprint_prepare = False               # set by option --debug=prepare\n\n# A subsystem for recording stats about how different Nodes are handled by\n# the main Taskmaster loop.  There's no external control here (no need for\n# a --debug= option); enable it by changing the value of CollectStats.\n\nCollectStats = None\n\nclass Stats:\n    \"\"\"\n    A simple class for holding statistics about the disposition of a\n    Node by the Taskmaster.  If we're collecting statistics, each Node\n    processed by the Taskmaster gets one of these attached, in which case\n    the Taskmaster records its decision each time it processes the Node.\n    (Ideally, that's just once per Node.)\n    \"\"\"\n    def __init__(self):\n        \"\"\"\n        Instantiates a Taskmaster.Stats object, initializing all\n        appropriate counters to zero.\n        \"\"\"\n        self.considered  = 0\n        self.already_handled  = 0\n        self.problem  = 0\n        self.child_failed  = 0\n        self.not_built  = 0\n        self.side_effects  = 0\n        self.build  = 0\n\nStatsNodes = []\n\nfmt = \"%(considered)3d \"\\\n      \"%(already_handled)3d \" \\\n      \"%(problem)3d \" \\\n      \"%(child_failed)3d \" \\\n      \"%(not_built)3d \" \\\n      \"%(side_effects)3d \" \\\n      \"%(build)3d \"\n\ndef dump_stats():\n    for n in sorted(StatsNodes, key=lambda a: str(a)):\n        print((fmt % n.attributes.stats.__dict__) + str(n))\n\n\nclass Task(ABC):\n    \"\"\" SCons build engine abstract task class.\n\n    This controls the interaction of the actual building of node\n    and the rest of the engine.\n\n    This is expected to handle all of the normally-customizable\n    aspects of controlling a build, so any given application\n    *should* be able to do what it wants by sub-classing this\n    class and overriding methods as appropriate.  If an application\n    needs to customize something by sub-classing Taskmaster (or\n    some other build engine class), we should first try to migrate\n    that functionality into this class.\n\n    Note that it's generally a good idea for sub-classes to call\n    these methods explicitly to update state, etc., rather than\n    roll their own interaction with Taskmaster from scratch.\n    \"\"\"\n    def __init__(self, tm, targets, top, node):\n        self.tm = tm\n        self.targets = targets\n        self.top = top\n        self.node = node\n        self.exc_clear()\n\n    def trace_message(self, method, node, description='node'):\n        fmt = '%-20s %s %s\\n'\n        return fmt % (method + ':', description, self.tm.trace_node(node))\n\n    def display(self, message):\n        \"\"\"\n        Hook to allow the calling interface to display a message.\n\n        This hook gets called as part of preparing a task for execution\n        (that is, a Node to be built).  As part of figuring out what Node\n        should be built next, the actual target list may be altered,\n        along with a message describing the alteration.  The calling\n        interface can subclass Task and provide a concrete implementation\n        of this method to see those messages.\n        \"\"\"\n        pass\n\n    def prepare(self):\n        \"\"\"\n        Called just before the task is executed.\n\n        This is mainly intended to give the target Nodes a chance to\n        unlink underlying files and make all necessary directories before\n        the Action is actually called to build the targets.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.prepare()', self.node))\n\n        # Now that it's the appropriate time, give the TaskMaster a\n        # chance to raise any exceptions it encountered while preparing\n        # this task.\n        self.exception_raise()\n\n        if self.tm.message:\n            self.display(self.tm.message)\n            self.tm.message = None\n\n        # Let the targets take care of any necessary preparations.\n        # This includes verifying that all of the necessary sources\n        # and dependencies exist, removing the target file(s), etc.\n        #\n        # As of April 2008, the get_executor().prepare() method makes\n        # sure that all of the aggregate sources necessary to build this\n        # Task's target(s) exist in one up-front check.  The individual\n        # target t.prepare() methods check that each target's explicit\n        # or implicit dependencies exists, and also initialize the\n        # .sconsign info.\n        executor = self.targets[0].get_executor()\n        if executor is None:\n            return\n        executor.prepare()\n        for t in executor.get_action_targets():\n            if print_prepare:\n                print(\"Preparing target %s...\"%t)\n                for s in t.side_effects:\n                    print(\"...with side-effect %s...\"%s)\n            t.prepare()\n            for s in t.side_effects:\n                if print_prepare:\n                    print(\"...Preparing side-effect %s...\"%s)\n                s.prepare()\n\n    def get_target(self):\n        \"\"\"Fetch the target being built or updated by this task.\n        \"\"\"\n        return self.node\n\n    @abstractmethod\n    def needs_execute(self):\n        return\n\n    def execute(self):\n        \"\"\"\n        Called to execute the task.\n\n        This method is called from multiple threads in a parallel build,\n        so only do thread safe stuff here.  Do thread unsafe stuff in\n        prepare(), executed() or failed().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.execute()', self.node))\n\n        try:\n            cached_targets = []\n            for t in self.targets:\n                if not t.retrieve_from_cache():\n                    break\n                cached_targets.append(t)\n            if len(cached_targets) < len(self.targets):\n                # Remove targets before building. It's possible that we\n                # partially retrieved targets from the cache, leaving\n                # them in read-only mode. That might cause the command\n                # to fail.\n                #\n                for t in cached_targets:\n                    try:\n                        t.fs.unlink(t.get_internal_path())\n                    except (IOError, OSError):\n                        pass\n                self.targets[0].build()\n            else:\n                for t in cached_targets:\n                    t.cached = 1\n        except SystemExit:\n            exc_value = sys.exc_info()[1]\n            raise SCons.Errors.ExplicitExit(self.targets[0], exc_value.code)\n        except SCons.Errors.UserError:\n            raise\n        except SCons.Errors.BuildError:\n            raise\n        except Exception as e:\n            # Nuitka: This is only bug hiding, e.g. in case of clcache.\n            raise\n\n            buildError = SCons.Errors.convert_to_BuildError(e)\n            buildError.node = self.targets[0]\n            buildError.exc_info = sys.exc_info()\n            raise buildError\n\n    def executed_without_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed\n        and the Taskmaster instance doesn't want to call\n        the Node's callback methods.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_without_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n\n    def executed_with_callbacks(self):\n        \"\"\"\n        Called when the task has been successfully executed and\n        the Taskmaster instance wants to call the Node's callback\n        methods.\n\n        This may have been a do-nothing operation (to preserve build\n        order), so we must check the node's state before deciding whether\n        it was \"built\", in which case we call the appropriate Node method.\n        In any event, we always call \"visited()\", which will handle any\n        post-visit actions that must take place regardless of whether\n        or not the target was an actual built target or a source Node.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.executed_with_callbacks()',\n                                         self.node))\n\n        for t in self.targets:\n            if t.get_state() == NODE_EXECUTING:\n                for side_effect in t.side_effects:\n                    side_effect.set_state(NODE_NO_STATE)\n                t.set_state(NODE_EXECUTED)\n                if not t.cached:\n                    t.push_to_cache()\n                t.built()\n                t.visited()\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n            else:\n                t.visited()\n\n    executed = executed_with_callbacks\n\n    def failed(self):\n        \"\"\"\n        Default action when a task fails:  stop the build.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        self.fail_stop()\n\n    def fail_stop(self):\n        \"\"\"\n        Explicit stop-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_stop()', self.node))\n\n        # Invoke will_not_build() to clean-up the pending children\n        # list.\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n        # Tell the taskmaster to not start any new tasks\n        self.tm.stop()\n\n        # We're stopping because of a build failure, but give the\n        # calling Task class a chance to postprocess() the top-level\n        # target under which the build failure occurred.\n        self.targets = [self.tm.current_top]\n        self.top = 1\n\n    def fail_continue(self):\n        \"\"\"\n        Explicit continue-the-build failure.\n\n        This sets failure status on the target nodes and all of\n        their dependent parent nodes.\n\n        Note: Although this function is normally invoked on nodes in\n        the executing state, it might also be invoked on up-to-date\n        nodes when using Configure().\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.failed_continue()', self.node))\n\n        self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED))\n\n    def make_ready_all(self):\n        \"\"\"\n        Marks all targets in a task ready for execution.\n\n        This is used when the interface needs every target Node to be\n        visited--the canonical example being the \"scons -c\" option.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.make_ready_all()', self.node))\n\n        self.out_of_date = self.targets[:]\n        for t in self.targets:\n            t.disambiguate().set_state(NODE_EXECUTING)\n            for s in t.side_effects:\n                # add disambiguate here to mirror the call on targets above\n                s.disambiguate().set_state(NODE_EXECUTING)\n\n    def make_ready_current(self):\n        \"\"\"\n        Marks all targets in a task ready for execution if any target\n        is not current.\n\n        This is the default behavior for building only what's necessary.\n        \"\"\"\n        global print_prepare\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.make_ready_current()',\n                                         self.node))\n\n        self.out_of_date = []\n        needs_executing = False\n        for t in self.targets:\n            try:\n                t.disambiguate().make_ready()\n                is_up_to_date = not t.has_builder() or \\\n                                (not t.always_build and t.is_up_to_date())\n            except EnvironmentError as e:\n                raise SCons.Errors.BuildError(node=t, errstr=e.strerror, filename=e.filename)\n\n            if not is_up_to_date:\n                self.out_of_date.append(t)\n                needs_executing = True\n\n        if needs_executing:\n            for t in self.targets:\n                t.set_state(NODE_EXECUTING)\n                for s in t.side_effects:\n                    # add disambiguate here to mirror the call on targets in first loop above\n                    s.disambiguate().set_state(NODE_EXECUTING)\n        else:\n            for t in self.targets:\n                # We must invoke visited() to ensure that the node\n                # information has been computed before allowing the\n                # parent nodes to execute. (That could occur in a\n                # parallel build...)\n                t.visited()\n                t.set_state(NODE_UP_TO_DATE)\n                if (not print_prepare and\n                    (not hasattr(self, 'options') or not self.options.debug_includes)):\n                    t.release_target_info()\n\n    make_ready = make_ready_current\n\n    def postprocess(self):\n        \"\"\"\n        Post-processes a task after it's been executed.\n\n        This examines all the targets just built (or not, we don't care\n        if the build was successful, or even if there was no build\n        because everything was up-to-date) to see if they have any\n        waiting parent Nodes, or Nodes waiting on a common side effect,\n        that can be put back on the candidates list.\n        \"\"\"\n        T = self.tm.trace\n        if T: T.write(self.trace_message('Task.postprocess()', self.node))\n\n        # We may have built multiple targets, some of which may have\n        # common parents waiting for this build.  Count up how many\n        # targets each parent was waiting for so we can subtract the\n        # values later, and so we *don't* put waiting side-effect Nodes\n        # back on the candidates list if the Node is also a waiting\n        # parent.\n\n        targets = set(self.targets)\n\n        pending_children = self.tm.pending_children\n        parents = {}\n        for t in targets:\n            # A node can only be in the pending_children set if it has\n            # some waiting_parents.\n            if t.waiting_parents:\n                if T: T.write(self.trace_message('Task.postprocess()',\n                                                 t,\n                                                 'removing'))\n                pending_children.discard(t)\n            for p in t.waiting_parents:\n                parents[p] = parents.get(p, 0) + 1\n            t.waiting_parents = set()\n\n        for t in targets:\n            if t.side_effects is not None:\n                for s in t.side_effects:\n                    if s.get_state() == NODE_EXECUTING:\n                        s.set_state(NODE_NO_STATE)\n\n                    # The side-effects may have been transferred to\n                    # NODE_NO_STATE by executed_with{,out}_callbacks, but was\n                    # not taken out of the waiting parents/pending children\n                    # data structures. Check for that now.\n                    if s.get_state() == NODE_NO_STATE and s.waiting_parents:\n                        pending_children.discard(s)\n                        for p in s.waiting_parents:\n                            parents[p] = parents.get(p, 0) + 1\n                        s.waiting_parents = set()\n                    for p in s.waiting_s_e:\n                        if p.ref_count == 0:\n                            self.tm.candidates.append(p)\n\n        for p, subtract in parents.items():\n            p.ref_count = p.ref_count - subtract\n            if T: T.write(self.trace_message('Task.postprocess()',\n                                             p,\n                                             'adjusted parent ref count'))\n            if p.ref_count == 0:\n                self.tm.candidates.append(p)\n\n        for t in targets:\n            t.postprocess()\n\n    # Exception handling subsystem.\n    #\n    # Exceptions that occur while walking the DAG or examining Nodes\n    # must be raised, but must be raised at an appropriate time and in\n    # a controlled manner so we can, if necessary, recover gracefully,\n    # possibly write out signature information for Nodes we've updated,\n    # etc.  This is done by having the Taskmaster tell us about the\n    # exception, and letting\n\n    def exc_info(self):\n        \"\"\"\n        Returns info about a recorded exception.\n        \"\"\"\n        return self.exception\n\n    def exc_clear(self):\n        \"\"\"\n        Clears any recorded exception.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the appropriate do-nothing method.\n        \"\"\"\n        self.exception = (None, None, None)\n        self.exception_raise = self._no_exception_to_raise\n\n    def exception_set(self, exception=None):\n        \"\"\"\n        Records an exception to be raised at the appropriate time.\n\n        This also changes the \"exception_raise\" attribute to point\n        to the method that will, in fact\n        \"\"\"\n        if not exception:\n            exception = sys.exc_info()\n        self.exception = exception\n        self.exception_raise = self._exception_raise\n\n    def _no_exception_to_raise(self):\n        pass\n\n    def _exception_raise(self):\n        \"\"\"\n        Raises a pending exception that was recorded while getting a\n        Task ready for execution.\n        \"\"\"\n        exc = self.exc_info()[:]\n        try:\n            exc_type, exc_value, exc_traceback = exc\n        except ValueError:\n            exc_type, exc_value = exc  # pylint: disable=unbalanced-tuple-unpacking\n            exc_traceback = None\n\n        # raise exc_type(exc_value).with_traceback(exc_traceback)\n        if isinstance(exc_value, Exception): #hasattr(exc_value, 'with_traceback'):\n            # If exc_value is an exception, then just reraise\n            raise exc_value.with_traceback(exc_traceback)\n        else:\n            # else we'll create an exception using the value and raise that\n            raise exc_type(exc_value).with_traceback(exc_traceback)\n\n\n        # raise e.__class__, e.__class__(e), sys.exc_info()[2]\n        #     exec(\"raise exc_type(exc_value).with_traceback(exc_traceback)\")\n\n\n\nclass AlwaysTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Always returns True (indicating this Task should always\n        be executed).\n\n        Subclasses that need this behavior (as opposed to the default\n        of only executing Nodes that are out of date w.r.t. their\n        dependencies) can use this as follows:\n\n            class MyTaskSubclass(SCons.Taskmaster.Task):\n                needs_execute = SCons.Taskmaster.AlwaysTask.needs_execute\n        \"\"\"\n        return True\n\nclass OutOfDateTask(Task):\n    def needs_execute(self):\n        \"\"\"\n        Returns True (indicating this Task should be executed) if this\n        Task's target state indicates it needs executing, which has\n        already been determined by an earlier up-to-date check.\n        \"\"\"\n        return self.targets[0].get_state() == SCons.Node.executing\n\n\ndef find_cycle(stack, visited):\n    if stack[-1] in visited:\n        return None\n    visited.add(stack[-1])\n    for n in stack[-1].waiting_parents:\n        stack.append(n)\n        if stack[0] == stack[-1]:\n            return stack\n        if find_cycle(stack, visited):\n            return stack\n        stack.pop()\n    return None\n\n\nclass Taskmaster:\n    \"\"\"\n    The Taskmaster for walking the dependency DAG.\n    \"\"\"\n\n    def __init__(self, targets=[], tasker=None, order=None, trace=None):\n        self.original_top = targets\n        self.top_targets_left = targets[:]\n        self.top_targets_left.reverse()\n        self.candidates = []\n        if tasker is None:\n            tasker = OutOfDateTask\n        self.tasker = tasker\n        if not order:\n            order = lambda l: l\n        self.order = order\n        self.message = None\n        self.trace = trace\n        self.next_candidate = self.find_next_candidate\n        self.pending_children = set()\n\n    def find_next_candidate(self):\n        \"\"\"\n        Returns the next candidate Node for (potential) evaluation.\n\n        The candidate list (really a stack) initially consists of all of\n        the top-level (command line) targets provided when the Taskmaster\n        was initialized.  While we walk the DAG, visiting Nodes, all the\n        children that haven't finished processing get pushed on to the\n        candidate list.  Each child can then be popped and examined in\n        turn for whether *their* children are all up-to-date, in which\n        case a Task will be created for their actual evaluation and\n        potential building.\n\n        Here is where we also allow candidate Nodes to alter the list of\n        Nodes that should be examined.  This is used, for example, when\n        invoking SCons in a source directory.  A source directory Node can\n        return its corresponding build directory Node, essentially saying,\n        \"Hey, you really need to build this thing over here instead.\"\n        \"\"\"\n        try:\n            return self.candidates.pop()\n        except IndexError:\n            pass\n        try:\n            node = self.top_targets_left.pop()\n        except IndexError:\n            return None\n        self.current_top = node\n        alt, message = node.alter_targets()\n        if alt:\n            self.message = message\n            self.candidates.append(node)\n            self.candidates.extend(self.order(alt))\n            node = self.candidates.pop()\n        return node\n\n    def no_next_candidate(self):\n        \"\"\"\n        Stops Taskmaster processing by not returning a next candidate.\n\n        Note that we have to clean-up the Taskmaster candidate list\n        because the cycle detection depends on the fact all nodes have\n        been processed somehow.\n        \"\"\"\n        while self.candidates:\n            candidates = self.candidates\n            self.candidates = []\n            self.will_not_build(candidates)\n        return None\n\n    def _validate_pending_children(self):\n        \"\"\"\n        Validate the content of the pending_children set. Assert if an\n        internal error is found.\n\n        This function is used strictly for debugging the taskmaster by\n        checking that no invariants are violated. It is not used in\n        normal operation.\n\n        The pending_children set is used to detect cycles in the\n        dependency graph. We call a \"pending child\" a child that is\n        found in the \"pending\" state when checking the dependencies of\n        its parent node.\n\n        A pending child can occur when the Taskmaster completes a loop\n        through a cycle. For example, let's imagine a graph made of\n        three nodes (A, B and C) making a cycle. The evaluation starts\n        at node A. The Taskmaster first considers whether node A's\n        child B is up-to-date. Then, recursively, node B needs to\n        check whether node C is up-to-date. This leaves us with a\n        dependency graph looking like::\n\n                                          Next candidate \\\n                                                          \\\n            Node A (Pending) --> Node B(Pending) --> Node C (NoState)\n                    ^                                     |\n                    |                                     |\n                    +-------------------------------------+\n\n        Now, when the Taskmaster examines the Node C's child Node A,\n        it finds that Node A is in the \"pending\" state. Therefore,\n        Node A is a pending child of node C.\n\n        Pending children indicate that the Taskmaster has potentially\n        loop back through a cycle. We say potentially because it could\n        also occur when a DAG is evaluated in parallel. For example,\n        consider the following graph::\n\n            Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...\n                    |                                     ^\n                    |                                     |\n                    +----------> Node D (NoState) --------+\n                                      /\n                      Next candidate /\n\n        The Taskmaster first evaluates the nodes A, B, and C and\n        starts building some children of node C. Assuming, that the\n        maximum parallel level has not been reached, the Taskmaster\n        will examine Node D. It will find that Node C is a pending\n        child of Node D.\n\n        In summary, evaluating a graph with a cycle will always\n        involve a pending child at one point. A pending child might\n        indicate either a cycle or a diamond-shaped DAG. Only a\n        fraction of the nodes ends-up being a \"pending child\" of\n        another node. This keeps the pending_children set small in\n        practice.\n\n        We can differentiate between the two cases if we wait until\n        the end of the build. At this point, all the pending children\n        nodes due to a diamond-shaped DAG will have been properly\n        built (or will have failed to build). But, the pending\n        children involved in a cycle will still be in the pending\n        state.\n\n        The taskmaster removes nodes from the pending_children set as\n        soon as a pending_children node moves out of the pending\n        state. This also helps to keep the pending_children set small.\n        \"\"\"\n\n        for n in self.pending_children:\n            assert n.state in (NODE_PENDING, NODE_EXECUTING), \\\n                (str(n), StateString[n.state])\n            assert len(n.waiting_parents) != 0, (str(n), len(n.waiting_parents))\n            for p in n.waiting_parents:\n                assert p.ref_count > 0, (str(n), str(p), p.ref_count)\n\n\n    def trace_message(self, message):\n        return 'Taskmaster: %s\\n' % message\n\n    def trace_node(self, node):\n        return '<%-10s %-3s %s>' % (StateString[node.get_state()],\n                                    node.ref_count,\n                                    repr(str(node)))\n\n    def _find_next_ready_node(self):\n        \"\"\"\n        Finds the next node that is ready to be built.\n\n        This is *the* main guts of the DAG walk.  We loop through the\n        list of candidates, looking for something that has no un-built\n        children (i.e., that is a leaf Node or has dependencies that are\n        all leaf Nodes or up-to-date).  Candidate Nodes are re-scanned\n        (both the target Node itself and its sources, which are always\n        scanned in the context of a given target) to discover implicit\n        dependencies.  A Node that must wait for some children to be\n        built will be put back on the candidates list after the children\n        have finished building.  A Node that has been put back on the\n        candidates list in this way may have itself (or its sources)\n        re-scanned, in order to handle generated header files (e.g.) and\n        the implicit dependencies therein.\n\n        Note that this method does not do any signature calculation or\n        up-to-date check itself.  All of that is handled by the Task\n        class.  This is purely concerned with the dependency graph walk.\n        \"\"\"\n\n        self.ready_exc = None\n\n        T = self.trace\n        if T: T.write('\\n' + self.trace_message('Looking for a node to evaluate'))\n\n        while True:\n            node = self.next_candidate()\n            if node is None:\n                if T: T.write(self.trace_message('No candidate anymore.') + '\\n')\n                return None\n\n            node = node.disambiguate()\n            state = node.get_state()\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            if CollectStats:\n                if not hasattr(node.attributes, 'stats'):\n                    node.attributes.stats = Stats()\n                    StatsNodes.append(node)\n                S = node.attributes.stats\n                S.considered = S.considered + 1\n            else:\n                S = None\n\n            if T: T.write(self.trace_message('    Considering node %s and its children:' % self.trace_node(node)))\n\n            if state == NODE_NO_STATE:\n                # Mark this node as being on the execution stack:\n                node.set_state(NODE_PENDING)\n            elif state > NODE_PENDING:\n                # Skip this node if it has already been evaluated:\n                if S: S.already_handled = S.already_handled + 1\n                if T: T.write(self.trace_message('       already handled (executed)'))\n                continue\n\n            executor = node.get_executor()\n\n            try:\n                children = executor.get_all_children()\n            except SystemExit:\n                exc_value = sys.exc_info()[1]\n                e = SCons.Errors.ExplicitExit(node, exc_value.code)\n                self.ready_exc = (SCons.Errors.ExplicitExit, e)\n                if T: T.write(self.trace_message('       SystemExit'))\n                return node\n            except Exception as e:\n                # We had a problem just trying to figure out the\n                # children (like a child couldn't be linked in to a\n                # VariantDir, or a Scanner threw something).  Arrange to\n                # raise the exception when the Task is \"executed.\"\n                self.ready_exc = sys.exc_info()\n                if S: S.problem = S.problem + 1\n                if T: T.write(self.trace_message('       exception %s while scanning children.\\n' % e))\n                return node\n\n            children_not_visited = []\n            children_pending = set()\n            children_not_ready = []\n            children_failed = False\n\n            for child in chain(executor.get_all_prerequisites(), children):\n                childstate = child.get_state()\n\n                if T: T.write(self.trace_message('       ' + self.trace_node(child)))\n\n                if childstate == NODE_NO_STATE:\n                    children_not_visited.append(child)\n                elif childstate == NODE_PENDING:\n                    children_pending.add(child)\n                elif childstate == NODE_FAILED:\n                    children_failed = True\n\n                if childstate <= NODE_EXECUTING:\n                    children_not_ready.append(child)\n\n            # These nodes have not even been visited yet.  Add\n            # them to the list so that on some next pass we can\n            # take a stab at evaluating them (or their children).\n            if children_not_visited:\n                if len(children_not_visited) > 1:\n                    children_not_visited.reverse()\n                self.candidates.extend(self.order(children_not_visited))\n\n            # if T and children_not_visited:\n            #    T.write(self.trace_message('     adding to candidates: %s' % map(str, children_not_visited)))\n            #    T.write(self.trace_message('     candidates now: %s\\n' % map(str, self.candidates)))\n\n            # Skip this node if any of its children have failed.\n            #\n            # This catches the case where we're descending a top-level\n            # target and one of our children failed while trying to be\n            # built by a *previous* descent of an earlier top-level\n            # target.\n            #\n            # It can also occur if a node is reused in multiple\n            # targets. One first descends though the one of the\n            # target, the next time occurs through the other target.\n            #\n            # Note that we can only have failed_children if the\n            # --keep-going flag was used, because without it the build\n            # will stop before diving in the other branch.\n            #\n            # Note that even if one of the children fails, we still\n            # added the other children to the list of candidate nodes\n            # to keep on building (--keep-going).\n            if children_failed:\n                for n in executor.get_action_targets():\n                    n.set_state(NODE_FAILED)\n\n                if S: S.child_failed = S.child_failed + 1\n                if T: T.write(self.trace_message('****** %s\\n' % self.trace_node(node)))\n                continue\n\n            if children_not_ready:\n                for child in children_not_ready:\n                    # We're waiting on one or more derived targets\n                    # that have not yet finished building.\n                    if S: S.not_built = S.not_built + 1\n\n                    # Add this node to the waiting parents lists of\n                    # anything we're waiting on, with a reference\n                    # count so we can be put back on the list for\n                    # re-evaluation when they've all finished.\n                    node.ref_count =  node.ref_count + child.add_to_waiting_parents(node)\n                    if T: T.write(self.trace_message('     adjusted ref count: %s, child %s' %\n                                  (self.trace_node(node), repr(str(child)))))\n\n                if T:\n                    for pc in children_pending:\n                        T.write(self.trace_message('       adding %s to the pending children set\\n' %\n                                self.trace_node(pc)))\n                self.pending_children = self.pending_children | children_pending\n\n                continue\n\n            # Skip this node if it has side-effects that are\n            # currently being built:\n            wait_side_effects = False\n            for se in executor.get_action_side_effects():\n                if se.get_state() == NODE_EXECUTING:\n                    se.add_to_waiting_s_e(node)\n                    wait_side_effects = True\n\n            if wait_side_effects:\n                if S: S.side_effects = S.side_effects + 1\n                continue\n\n            # The default when we've gotten through all of the checks above:\n            # this node is ready to be built.\n            if S: S.build = S.build + 1\n            if T: T.write(self.trace_message('Evaluating %s\\n' %\n                                             self.trace_node(node)))\n\n            # For debugging only:\n            #\n            # try:\n            #     self._validate_pending_children()\n            # except:\n            #     self.ready_exc = sys.exc_info()\n            #     return node\n\n            return node\n\n        return None\n\n    def next_task(self):\n        \"\"\"\n        Returns the next task to be executed.\n\n        This simply asks for the next Node to be evaluated, and then wraps\n        it in the specific Task subclass with which we were initialized.\n        \"\"\"\n        node = self._find_next_ready_node()\n\n        if node is None:\n            return None\n\n        executor = node.get_executor()\n        if executor is None:\n            return None\n\n        tlist = executor.get_all_targets()\n\n        task = self.tasker(self, tlist, node in self.original_top, node)\n        try:\n            task.make_ready()\n        except Exception as e :\n            # We had a problem just trying to get this task ready (like\n            # a child couldn't be linked to a VariantDir when deciding\n            # whether this node is current).  Arrange to raise the\n            # exception when the Task is \"executed.\"\n            self.ready_exc = sys.exc_info()\n\n        if self.ready_exc:\n            task.exception_set(self.ready_exc)\n\n        self.ready_exc = None\n\n        return task\n\n    def will_not_build(self, nodes, node_func=lambda n: None):\n        \"\"\"\n        Perform clean-up about nodes that will never be built. Invokes\n        a user defined function on all of these nodes (including all\n        of their parents).\n        \"\"\"\n\n        T = self.trace\n\n        pending_children = self.pending_children\n\n        to_visit = set(nodes)\n        pending_children = pending_children - to_visit\n\n        if T:\n            for n in nodes:\n                T.write(self.trace_message('       removing node %s from the pending children set\\n' %\n                        self.trace_node(n)))\n        try:\n            while len(to_visit):\n                node = to_visit.pop()\n                node_func(node)\n\n                # Prune recursion by flushing the waiting children\n                # list immediately.\n                parents = node.waiting_parents\n                node.waiting_parents = set()\n\n                to_visit = to_visit | parents\n                pending_children = pending_children - parents\n\n                for p in parents:\n                    p.ref_count = p.ref_count - 1\n                    if T: T.write(self.trace_message('       removing parent %s from the pending children set\\n' %\n                                  self.trace_node(p)))\n        except KeyError:\n            # The container to_visit has been emptied.\n            pass\n\n        # We have the stick back the pending_children list into the\n        # taskmaster because the python 1.5.2 compatibility does not\n        # allow us to use in-place updates\n        self.pending_children = pending_children\n\n    def stop(self):\n        \"\"\"\n        Stops the current build completely.\n        \"\"\"\n        self.next_candidate = self.no_next_candidate\n\n    def cleanup(self):\n        \"\"\"\n        Check for dependency cycles.\n        \"\"\"\n        if not self.pending_children:\n            return\n\n        nclist = [(n, find_cycle([n], set())) for n in self.pending_children]\n\n        genuine_cycles = [\n            node for node,cycle in nclist\n                     if cycle or node.get_state() != NODE_EXECUTED\n        ]\n        if not genuine_cycles:\n            # All of the \"cycles\" found were single nodes in EXECUTED state,\n            # which is to say, they really weren't cycles.  Just return.\n            return\n\n        desc = 'Found dependency cycle(s):\\n'\n        for node, cycle in nclist:\n            if cycle:\n                desc = desc + \"  \" + \" -> \".join(map(str, cycle)) + \"\\n\"\n            else:\n                desc = desc + \\\n                    \"  Internal Error: no cycle found for node %s (%s) in state %s\\n\" %  \\\n                    (node, repr(node), StateString[node.get_state()])\n\n        raise SCons.Errors.UserError(desc)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py",
    "content": "\"\"\"SCons.Tool.386asm\n\nTool specification for the 386ASM assembler for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\nimport SCons.Util\n\nas_module = __import__('as', globals(), locals(), [], 1)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = '386asm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS $SOURCES -o $TARGET'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES -o $TARGET'\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    return env.Detect('386asm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Common routines for gettext tools\n\nUsed by several tools of `gettext` toolset.\n\"\"\"\n\nimport os\nimport re\n\nimport SCons.Util\nimport SCons.Warnings\n\nclass XgettextToolWarning(SCons.Warnings.SConsWarning):\n    pass\n\n\nclass XgettextNotFound(XgettextToolWarning):\n    pass\n\n\nclass MsginitToolWarning(SCons.Warnings.SConsWarning):\n    pass\n\n\nclass MsginitNotFound(MsginitToolWarning):\n    pass\n\n\nclass MsgmergeToolWarning(SCons.Warnings.SConsWarning):\n    pass\n\n\nclass MsgmergeNotFound(MsgmergeToolWarning):\n    pass\n\n\nclass MsgfmtToolWarning(SCons.Warnings.SConsWarning):\n    pass\n\n\nclass MsgfmtNotFound(MsgfmtToolWarning):\n    pass\n\n\nSCons.Warnings.enableWarningClass(XgettextToolWarning)\nSCons.Warnings.enableWarningClass(XgettextNotFound)\nSCons.Warnings.enableWarningClass(MsginitToolWarning)\nSCons.Warnings.enableWarningClass(MsginitNotFound)\nSCons.Warnings.enableWarningClass(MsgmergeToolWarning)\nSCons.Warnings.enableWarningClass(MsgmergeNotFound)\nSCons.Warnings.enableWarningClass(MsgfmtToolWarning)\nSCons.Warnings.enableWarningClass(MsgfmtNotFound)\n\n\nclass _POTargetFactory:\n    \"\"\" A factory of `PO` target files.\n\n    Factory defaults differ from these of `SCons.Node.FS.FS`.  We set `precious`\n    (this is required by builders and actions gettext) and `noclean` flags by\n    default for all produced nodes.\n    \"\"\"\n\n    def __init__(self, env, nodefault=True, alias=None, precious=True\n                 , noclean=True):\n        \"\"\" Object constructor.\n\n        **Arguments**\n\n            - *env* (`SCons.Environment.Environment`)\n            - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored\n              from default target `'.'`\n            - *alias* (`string`) - if provided, produced nodes will be automatically\n              added to this alias, and alias will be set as `AlwaysBuild`\n            - *precious* (`boolean`) - if `True`, the produced nodes will be set as\n              `Precious`.\n            - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded\n              from `Clean`.\n        \"\"\"\n        self.env = env\n        self.alias = alias\n        self.precious = precious\n        self.noclean = noclean\n        self.nodefault = nodefault\n\n    def _create_node(self, name, factory, directory=None, create=1):\n        \"\"\" Create node, and set it up to factory settings. \"\"\"\n        node = factory(name, directory, create)\n        node.set_noclean(self.noclean)\n        node.set_precious(self.precious)\n        if self.nodefault:\n            self.env.Ignore('.', node)\n        if self.alias:\n            self.env.AlwaysBuild(self.env.Alias(self.alias, node))\n        return node\n\n    def Entry(self, name, directory=None, create=1):\n        \"\"\" Create `SCons.Node.FS.Entry` \"\"\"\n        return self._create_node(name, self.env.fs.Entry, directory, create)\n\n    def File(self, name, directory=None, create=1):\n        \"\"\" Create `SCons.Node.FS.File` \"\"\"\n        return self._create_node(name, self.env.fs.File, directory, create)\n\n\n_re_comment = re.compile(r'(#[^\\n\\r]+)$', re.M)\n_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)\n\n\ndef _read_linguas_from_files(env, linguas_files=None):\n    \"\"\" Parse `LINGUAS` file and return list of extracted languages \"\"\"\n    global _re_comment\n    global _re_lang\n    if not SCons.Util.is_List(linguas_files) \\\n            and not SCons.Util.is_String(linguas_files) \\\n            and not isinstance(linguas_files, SCons.Node.FS.Base) \\\n            and linguas_files:\n        # If, linguas_files==True or such, then read 'LINGUAS' file.\n        linguas_files = ['LINGUAS']\n    if linguas_files is None:\n        return []\n    fnodes = env.arg2nodes(linguas_files)\n    linguas = []\n    for fnode in fnodes:\n        contents = _re_comment.sub(\"\", fnode.get_text_contents())\n        ls = [l for l in _re_lang.findall(contents) if l]\n        linguas.extend(ls)\n    return linguas\n\n\nfrom SCons.Builder import BuilderBase\n\n\nclass _POFileBuilder(BuilderBase):\n    \"\"\" `PO` file builder.\n\n    This is multi-target single-source builder. In typical situation the source\n    is single `POT` file, e.g. `messages.pot`, and there are multiple `PO`\n    targets to be updated from this `POT`. We must run\n    `SCons.Builder.BuilderBase._execute()` separatelly for each target to track\n    dependencies separatelly for each target file.\n\n    **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)`\n    with target being list of all targets, all targets would be rebuilt each time\n    one of the targets from this list is missing. This would happen, for example,\n    when new language `ll` enters `LINGUAS_FILE` (at this moment there is no\n    `ll.po` file yet). To avoid this, we override\n    `SCons.Builder.BuilerBase._execute()` and call it separatelly for each\n    target. Here we also append to the target list the languages read from\n    `LINGUAS_FILE`.\n    \"\"\"\n\n    #\n    # * The argument for overriding _execute(): We must use environment with\n    #  builder overrides applied (see BuilderBase.__init__(). Here it comes for\n    #  free.\n    # * The argument against using 'emitter': The emitter is called too late\n    #  by BuilderBase._execute(). If user calls, for example:\n    #\n    #    env.POUpdate(LINGUAS_FILE = 'LINGUAS')\n    #\n    #  the builder throws error, because it is called with target=None,\n    #  source=None and is trying to \"generate\" sources or target list first.\n    #  If user calls\n    #\n    #    env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS')\n    #\n    #  the env.BuilderWrapper() calls our builder with target=None,\n    #  source=['foo', 'baz']. The BuilderBase._execute() then splits execution\n    #  and execute iterativelly (recursion) self._execute(None, source[i]).\n    #  After that it calls emitter (which is quite too late). The emitter is\n    #  also called in each iteration, what makes things yet worse.\n    def __init__(self, env, **kw):\n        if 'suffix' not in kw:\n            kw['suffix'] = '$POSUFFIX'\n        if 'src_suffix' not in kw:\n            kw['src_suffix'] = '$POTSUFFIX'\n        if 'src_builder' not in kw:\n            kw['src_builder'] = '_POTUpdateBuilder'\n        if 'single_source' not in kw:\n            kw['single_source'] = True\n        alias = None\n        if 'target_alias' in kw:\n            alias = kw['target_alias']\n            del kw['target_alias']\n        if 'target_factory' not in kw:\n            kw['target_factory'] = _POTargetFactory(env, alias=alias).File\n        BuilderBase.__init__(self, **kw)\n\n    def _execute(self, env, target, source, *args, **kw):\n        \"\"\" Execute builder's actions.\n\n        Here we append to `target` the languages read from `$LINGUAS_FILE` and\n        apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.\n        The arguments and return value are same as for\n        `SCons.Builder.BuilderBase._execute()`.\n        \"\"\"\n        import SCons.Node\n        linguas_files = None\n        if 'LINGUAS_FILE' in env and env['LINGUAS_FILE']:\n            linguas_files = env['LINGUAS_FILE']\n            # This prevents endless recursion loop (we'll be invoked once for\n            # each target appended here, we must not extend the list again).\n            env['LINGUAS_FILE'] = None\n            linguas = _read_linguas_from_files(env, linguas_files)\n            if SCons.Util.is_List(target):\n                target.extend(linguas)\n            elif target is not None:\n                target = [target] + linguas\n            else:\n                target = linguas\n        if not target:\n            # Let the SCons.BuilderBase to handle this patologic situation\n            return BuilderBase._execute(self, env, target, source, *args, **kw)\n        # The rest is ours\n        if not SCons.Util.is_List(target):\n            target = [target]\n        result = []\n        for tgt in target:\n            r = BuilderBase._execute(self, env, [tgt], source, *args, **kw)\n            result.extend(r)\n        if linguas_files is not None:\n            env['LINGUAS_FILE'] = linguas_files\n        return SCons.Node.NodeList(result)\n\n\ndef _translate(env, target=None, source=SCons.Environment._null, *args, **kw):\n    \"\"\" Function for `Translate()` pseudo-builder \"\"\"\n    if target is None: target = []\n    pot = env.POTUpdate(None, source, *args, **kw)\n    po = env.POUpdate(target, pot, *args, **kw)\n    return po\n\n\nclass RPaths:\n    \"\"\" Callable object, which returns pathnames relative to SCons current\n    working directory.\n\n    It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths\n    for nodes that are outside of current working directory (`env.fs.getcwd()`).\n    Here, we often have `SConscript`, `POT` and `PO` files within `po/`\n    directory and source files (e.g. `*.c`) outside of it. When generating `POT`\n    template file, references to source files are written to `POT` template, so\n    a translator may later quickly jump to appropriate source file and line from\n    its `PO` editor (e.g. `poedit`).  Relative paths in  `PO` file are usually\n    interpreted by `PO` editor as paths relative to the place, where `PO` file\n    lives. The absolute paths would make resultant `POT` file nonportable, as\n    the references would be correct only on the machine, where `POT` file was\n    recently re-created. For such reason, we need a function, which always\n    returns relative paths. This is the purpose of `RPaths` callable object.\n\n    The `__call__` method returns paths relative to current working directory, but\n    we assume, that *xgettext(1)* is run from the directory, where target file is\n    going to be created.\n\n    Note, that this may not work for files distributed over several hosts or\n    across different drives on windows. We assume here, that single local\n    filesystem holds both source files and target `POT` templates.\n\n    Intended use of `RPaths` - in `xgettext.py`::\n\n      def generate(env):\n          from GettextCommon import RPaths\n          ...\n          sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET, SOURCES)} $)'\n          env.Append(\n            ...\n            XGETTEXTCOM = 'XGETTEXT ... ' + sources,\n            ...\n            XgettextRPaths = RPaths(env)\n          )\n    \"\"\"\n\n    # NOTE: This callable object returns pathnames of dirs/files relative to\n    # current working directory. The pathname remains relative also for entries\n    # that are outside of current working directory (node, that\n    # SCons.Node.FS.File and siblings return absolute path in such case). For\n    # simplicity we compute path relative to current working directory, this\n    # seems be enough for our purposes (don't need TARGET variable and\n    # SCons.Defaults.Variable_Caller stuff).\n\n    def __init__(self, env):\n        \"\"\" Initialize `RPaths` callable object.\n\n          **Arguments**:\n\n            - *env* - a `SCons.Environment.Environment` object, defines *current\n              working dir*.\n        \"\"\"\n        self.env = env\n\n    # FIXME: I'm not sure, how it should be implemented (what the *args are in\n    # general, what is **kw).\n    def __call__(self, nodes, *args, **kw):\n        \"\"\" Return nodes' paths (strings) relative to current working directory.\n\n          **Arguments**:\n\n            - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.\n            - *args* -  currently unused.\n            - *kw* - currently unused.\n\n          **Returns**:\n\n           - Tuple of strings, which represent paths relative to current working\n             directory (for given environment).\n        \"\"\"\n        import SCons.Node.FS\n        rpaths = ()\n        cwd = self.env.fs.getcwd().get_abspath()\n        for node in nodes:\n            rpath = None\n            if isinstance(node, SCons.Node.FS.Base):\n                rpath = os.path.relpath(node.get_abspath(), cwd)\n            # FIXME: Other types possible here?\n            if rpath is not None:\n                rpaths += (rpath,)\n        return rpaths\n\n\ndef _init_po_files(target, source, env):\n    \"\"\" Action function for `POInit` builder. \"\"\"\n    nop = lambda target, source, env: 0\n    if 'POAUTOINIT' in env:\n        autoinit = env['POAUTOINIT']\n    else:\n        autoinit = False\n    # Well, if everything outside works well, this loop should do single\n    # iteration. Otherwise we are rebuilding all the targets even, if just\n    # one has changed (but is this our fault?).\n    for tgt in target:\n        if not tgt.exists():\n            if autoinit:\n                action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR')\n            else:\n                msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \\\n                      + 'If you are a translator, you can create it through: \\n' \\\n                      + '$MSGINITCOM'\n                action = SCons.Action.Action(nop, msg)\n            status = action([tgt], source, env)\n            if status: return status\n    return 0\n\n\ndef _detect_xgettext(env):\n    \"\"\" Detects *xgettext(1)* binary \"\"\"\n    if 'XGETTEXT' in env:\n        return env['XGETTEXT']\n    xgettext = env.Detect('xgettext')\n    if xgettext:\n        return xgettext\n    raise SCons.Errors.StopError(XgettextNotFound, \"Could not detect xgettext\")\n    return None\n\n\ndef _xgettext_exists(env):\n    return _detect_xgettext(env)\n\n\ndef _detect_msginit(env):\n    \"\"\" Detects *msginit(1)* program. \"\"\"\n    if 'MSGINIT' in env:\n        return env['MSGINIT']\n    msginit = env.Detect('msginit')\n    if msginit:\n        return msginit\n    raise SCons.Errors.StopError(MsginitNotFound, \"Could not detect msginit\")\n    return None\n\n\ndef _msginit_exists(env):\n    return _detect_msginit(env)\n\n\ndef _detect_msgmerge(env):\n    \"\"\" Detects *msgmerge(1)* program. \"\"\"\n    if 'MSGMERGE' in env:\n        return env['MSGMERGE']\n    msgmerge = env.Detect('msgmerge')\n    if msgmerge:\n        return msgmerge\n    raise SCons.Errors.StopError(MsgmergeNotFound, \"Could not detect msgmerge\")\n    return None\n\n\ndef _msgmerge_exists(env):\n    return _detect_msgmerge(env)\n\n\ndef _detect_msgfmt(env):\n    \"\"\" Detects *msgmfmt(1)* program. \"\"\"\n    if 'MSGFMT' in env:\n        return env['MSGFMT']\n    msgfmt = env.Detect('msgfmt')\n    if msgfmt:\n        return msgfmt\n    raise SCons.Errors.StopError(MsgfmtNotFound, \"Could not detect msgfmt\")\n    return None\n\n\ndef _msgfmt_exists(env):\n    return _detect_msgfmt(env)\n\n\ndef tool_list(platform, env):\n    \"\"\" List tools that shall be generated by top-level `gettext` tool \"\"\"\n    return ['xgettext', 'msginit', 'msgmerge', 'msgfmt']\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\nCommon functions for Microsoft Visual Studio and Visual C/C++.\n\"\"\"\n\n\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon.sdk import mssdk_exists, \\\n                                    mssdk_setup_env\n\nfrom SCons.Tool.MSCommon.vc import msvc_exists, \\\n                                   msvc_setup_env, \\\n                                   msvc_setup_env_once, \\\n                                   msvc_version_to_maj_min, \\\n                                   msvc_find_vswhere\n\nfrom SCons.Tool.MSCommon.vs import get_default_version, \\\n                                   get_vs_by_version, \\\n                                   merge_default_version, \\\n                                   msvs_exists, \\\n                                   query_versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py",
    "content": "#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n__doc__ = \"\"\"Module to define supported Windows chip architectures.\n\"\"\"\n\n\nclass ArchDefinition:\n    \"\"\"\n    A class for defining architecture-specific settings and logic.\n    \"\"\"\n    def __init__(self, arch, synonyms=[]):\n        self.arch = arch\n        self.synonyms = synonyms\n\nSupportedArchitectureList = [\n    ArchDefinition(\n        'x86',\n        ['i386', 'i486', 'i586', 'i686'],\n    ),\n\n    ArchDefinition(\n        'x86_64',\n        ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],\n    ),\n\n    ArchDefinition(\n        'ia64',\n        ['IA64'],\n    ),\n    \n    ArchDefinition(\n        'arm',\n        ['ARM'],\n    ),\n\n]\n\nSupportedArchitectureMap = {}\nfor a in SupportedArchitectureList:\n    SupportedArchitectureMap[a.arch] = a\n    for s in a.synonyms:\n        SupportedArchitectureMap[s] = a\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py",
    "content": "\"\"\"\nCommon helper functions for working with the Microsoft tool chain.\n\"\"\"\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport copy\nimport json\nimport os\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Util\n\n# SCONS_MSCOMMON_DEBUG is internal-use so undocumented:\n# set to '-' to print to console, else set to filename to log to\nLOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG')\nif LOGFILE == '-':\n    def debug(message):\n        print(message)\nelif LOGFILE:\n    import logging\n    modulelist = (\n        # root module and parent/root module\n        'MSCommon', 'Tool',\n        # python library and below: correct iff scons does not have a lib folder\n        'lib',\n        # scons modules\n        'SCons', 'test', 'scons'\n    )\n    def get_relative_filename(filename, module_list):\n        if not filename:\n            return filename\n        for module in module_list:\n            try:\n                ind = filename.rindex(module)\n                return filename[ind:]\n            except ValueError:\n                pass\n        return filename\n    class _Debug_Filter(logging.Filter):\n        # custom filter for module relative filename\n        def filter(self, record):\n            relfilename = get_relative_filename(record.pathname, modulelist)\n            relfilename = relfilename.replace('\\\\', '/')\n            record.relfilename = relfilename\n            return True\n    logging.basicConfig(\n        # This looks like:\n        #   00109ms:MSCommon/vc.py:find_vc_pdir#447:\n        format=(\n            '%(relativeCreated)05dms'\n            ':%(relfilename)s'\n            ':%(funcName)s'\n            '#%(lineno)s'\n            ':%(message)s: '\n        ),\n        filename=LOGFILE,\n        level=logging.DEBUG)\n    logger = logging.getLogger(name=__name__)\n    logger.addFilter(_Debug_Filter())\n    debug = logger.debug\nelse:\n    def debug(x): return None\n\n\n# SCONS_CACHE_MSVC_CONFIG is public, and is documented.\nCONFIG_CACHE = os.environ.get('SCONS_CACHE_MSVC_CONFIG')\nif CONFIG_CACHE in ('1', 'true', 'True'):\n    CONFIG_CACHE = os.path.join(os.path.expanduser('~'), '.scons_msvc_cache')\n\n\ndef read_script_env_cache():\n    \"\"\" fetch cached msvc env vars if requested, else return empty dict \"\"\"\n    envcache = {}\n    if CONFIG_CACHE:\n        try:\n            with open(CONFIG_CACHE, 'r') as f:\n                envcache = json.load(f)\n        except FileNotFoundError:\n            # don't fail if no cache file, just proceed without it\n            pass\n    return envcache\n\n\ndef write_script_env_cache(cache):\n    \"\"\" write out cache of msvc env vars if requested \"\"\"\n    if CONFIG_CACHE:\n        try:\n            with open(CONFIG_CACHE, 'w') as f:\n                json.dump(cache, f, indent=2)\n        except TypeError:\n            # data can't serialize to json, don't leave partial file\n            os.remove(CONFIG_CACHE)\n        except IOError:\n            # can't write the file, just skip\n            pass\n\n\n_is_win64 = None\n\n\ndef is_win64():\n    \"\"\"Return true if running on windows 64 bits.\n\n    Works whether python itself runs in 64 bits or 32 bits.\"\"\"\n    # Unfortunately, python does not provide a useful way to determine\n    # if the underlying Windows OS is 32-bit or 64-bit.  Worse, whether\n    # the Python itself is 32-bit or 64-bit affects what it returns,\n    # so nothing in sys.* or os.* help.\n\n    # Apparently the best solution is to use env vars that Windows\n    # sets.  If PROCESSOR_ARCHITECTURE is not x86, then the python\n    # process is running in 64 bit mode (on a 64-bit OS, 64-bit\n    # hardware, obviously).\n    # If this python is 32-bit but the OS is 64, Windows will set\n    # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null.\n    # (Checking for HKLM\\Software\\Wow6432Node in the registry doesn't\n    # work, because some 32-bit installers create it.)\n    global _is_win64\n    if _is_win64 is None:\n        # I structured these tests to make it easy to add new ones or\n        # add exceptions in the future, because this is a bit fragile.\n        _is_win64 = False\n        if os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') != 'x86':\n            _is_win64 = True\n        if os.environ.get('PROCESSOR_ARCHITEW6432'):\n            _is_win64 = True\n        if os.environ.get('ProgramW6432'):\n            _is_win64 = True\n    return _is_win64\n\n\ndef read_reg(value, hkroot=SCons.Util.HKEY_LOCAL_MACHINE):\n    return SCons.Util.RegGetValue(hkroot, value)[0]\n\n\ndef has_reg(value):\n    \"\"\"Return True if the given key exists in HKEY_LOCAL_MACHINE, False\n    otherwise.\"\"\"\n    try:\n        SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)\n        ret = True\n    except OSError:\n        ret = False\n    return ret\n\n# Functions for fetching environment variable settings from batch files.\n\n\ndef normalize_env(env, keys, force=False):\n    \"\"\"Given a dictionary representing a shell environment, add the variables\n    from os.environ needed for the processing of .bat files; the keys are\n    controlled by the keys argument.\n\n    It also makes sure the environment values are correctly encoded.\n\n    If force=True, then all of the key values that exist are copied\n    into the returned dictionary.  If force=false, values are only\n    copied if the key does not already exist in the copied dictionary.\n\n    Note: the environment is copied.\"\"\"\n    normenv = {}\n    if env:\n        for k, v in env.items():\n            normenv[k] = copy.deepcopy(v)\n\n        for k in keys:\n            if k in os.environ and (force or k not in normenv):\n                normenv[k] = os.environ[k]\n\n    # add some things to PATH to prevent problems:\n    # Shouldn't be necessary to add system32, since the default environment\n    # should include it, but keep this here to be safe (needed for reg.exe)\n    sys32_dir = os.path.join(\n        os.environ.get(\"SystemRoot\", os.environ.get(\"windir\", r\"C:\\Windows\")), \"System32\"\n)\n    if sys32_dir not in normenv[\"PATH\"]:\n        normenv[\"PATH\"] = normenv[\"PATH\"] + os.pathsep + sys32_dir\n\n    # Without Wbem in PATH, vcvarsall.bat has a \"'wmic' is not recognized\"\n    # error starting with Visual Studio 2017, although the script still\n    # seems to work anyway.\n    sys32_wbem_dir = os.path.join(sys32_dir, 'Wbem')\n    if sys32_wbem_dir not in normenv['PATH']:\n        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir\n\n    # Without Powershell in PATH, an internal call to a telemetry\n    # function (starting with a VS2019 update) can fail\n    # Note can also set VSCMD_SKIP_SENDTELEMETRY to avoid this.\n    sys32_ps_dir = os.path.join(sys32_dir, r'WindowsPowerShell\\v1.0')\n    if sys32_ps_dir not in normenv['PATH']:\n        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_ps_dir\n\n    debug(\"PATH: %s\" % normenv['PATH'])\n    return normenv\n\n\ndef get_output(vcbat, args=None, env=None):\n    \"\"\"Parse the output of given bat file, with given args.\"\"\"\n\n    if env is None:\n        # Create a blank environment, for use in launching the tools\n        env = SCons.Environment.Environment(tools=[])\n\n    # TODO:  Hard-coded list of the variables that (may) need to be\n    # imported from os.environ[] for the chain of development batch\n    # files to execute correctly. One call to vcvars*.bat may\n    # end up running a dozen or more scripts, changes not only with\n    # each release but with what is installed at the time. We think\n    # in modern installations most are set along the way and don't\n    # need to be picked from the env, but include these for safety's sake.\n    # Any VSCMD variables definitely are picked from the env and\n    # control execution in interesting ways.\n    # Note these really should be unified - either controlled by vs.py,\n    # or synced with the the common_tools_var # settings in vs.py.\n    vs_vc_vars = [\n        'COMSPEC',  # path to \"shell\"\n        'VS170COMNTOOLS',  # path to common tools for given version\n        'VS160COMNTOOLS',\n        'VS150COMNTOOLS',\n        'VS140COMNTOOLS',\n        'VS120COMNTOOLS',\n        'VS110COMNTOOLS',\n        'VS100COMNTOOLS',\n        'VS90COMNTOOLS',\n        'VS80COMNTOOLS',\n        'VS71COMNTOOLS',\n        'VS70COMNTOOLS',\n        'VS60COMNTOOLS',\n        'VSCMD_DEBUG',   # enable logging and other debug aids\n        'VSCMD_SKIP_SENDTELEMETRY',\n    ]\n    env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False)\n\n    if args:\n        debug(\"Calling '%s %s'\" % (vcbat, args))\n        popen = SCons.Action._subproc(env,\n                                      '\"%s\" %s & set' % (vcbat, args),\n                                      stdin='devnull',\n                                      stdout=subprocess.PIPE,\n                                      stderr=subprocess.PIPE)\n    else:\n        debug(\"Calling '%s'\" % vcbat)\n        popen = SCons.Action._subproc(env,\n                                      '\"%s\" & set' % vcbat,\n                                      stdin='devnull',\n                                      stdout=subprocess.PIPE,\n                                      stderr=subprocess.PIPE)\n\n    # Use the .stdout and .stderr attributes directly because the\n    # .communicate() method uses the threading module on Windows\n    # and won't work under Pythons not built with threading.\n    with popen.stdout:\n        stdout = popen.stdout.read()\n    with popen.stderr:\n        stderr = popen.stderr.read()\n\n    # Extra debug logic, uncomment if necessary\n    # debug('stdout:%s' % stdout)\n    # debug('stderr:%s' % stderr)\n\n    # Ongoing problems getting non-corrupted text led to this\n    # changing to \"oem\" from \"mbcs\" - the scripts run presumably\n    # attached to a console, so some particular rules apply.\n    # Unfortunately, \"oem\" not defined in Python 3.5, so get another way\n    if sys.version_info.major == 3 and sys.version_info.minor < 6:\n        from ctypes import windll\n\n        OEM = \"cp{}\".format(windll.kernel32.GetConsoleOutputCP())\n    else:\n        OEM = \"oem\"\n    if stderr:\n        # TODO: find something better to do with stderr;\n        # this at least prevents errors from getting swallowed.\n        sys.stderr.write(stderr.decode(OEM))\n    if popen.wait() != 0:\n        raise IOError(stderr.decode(OEM))\n\n    return stdout.decode(OEM)\n\n\nKEEPLIST = (\n    \"INCLUDE\",\n    \"LIB\",\n    \"LIBPATH\",\n    \"PATH\",\n    \"VSCMD_ARG_app_plat\",\n    \"VCINSTALLDIR\",  # needed by clang -VS 2017 and newer\n    \"VCToolsInstallDir\",  # needed by clang - VS 2015 and older\n)\n# Nuitka: Keep the Windows SDK version too\nKEEPLIST += (\"WindowsSDKVersion\",)\n\n\ndef parse_output(output, keep=KEEPLIST):\n    \"\"\"\n    Parse output from running visual c++/studios vcvarsall.bat and running set\n    To capture the values listed in keep\n    \"\"\"\n\n    # dkeep is a dict associating key: path_list, where key is one item from\n    # keep, and path_list the associated list of paths\n    dkeep = dict([(i, []) for i in keep])\n\n    # rdk will  keep the regex to match the .bat file output line starts\n    rdk = {}\n    for i in keep:\n        rdk[i] = re.compile('%s=(.*)' % i, re.I)\n\n    def add_env(rmatch, key, dkeep=dkeep):\n        path_list = rmatch.group(1).split(os.pathsep)\n        for path in path_list:\n            # Do not add empty paths (when a var ends with ;)\n            if path:\n                # XXX: For some reason, VC98 .bat file adds \"\" around the PATH\n                # values, and it screws up the environment later, so we strip\n                # it.\n                path = path.strip('\"')\n                dkeep[key].append(str(path))\n\n    for line in output.splitlines():\n        for k, value in rdk.items():\n            match = value.match(line)\n            if match:\n                add_env(match, k)\n\n    return dkeep\n\ndef get_pch_node(env, target, source):\n    \"\"\"\n    Get the actual PCH file node\n    \"\"\"\n    pch_subst = env.get('PCH', False) and env.subst('$PCH',target=target, source=source, conv=lambda x:x)\n\n    if not pch_subst:\n        return \"\"\n\n    if SCons.Util.is_String(pch_subst):\n        pch_subst = target[0].dir.File(pch_subst)\n\n    return pch_subst\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py",
    "content": "#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n__doc__ = \"\"\"\n\"\"\"\n\nimport os\nimport re\nimport SCons.Util\n\nfrom .common import read_reg, debug\n\n# Original value recorded by dcournapeau\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\.NETFramework\\InstallRoot'\n# On SGK's system\n_FRAMEWORKDIR_HKEY_ROOT = r'Software\\Microsoft\\Microsoft SDKs\\.NETFramework\\v2.0\\InstallationFolder'\n\ndef find_framework_root():\n    # XXX: find it from environment (FrameworkDir)\n    try:\n        froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT)\n        debug(\"Found framework install root in registry: {}\".format(froot))\n    except OSError:\n        debug(\"Could not read reg key {}\".format(_FRAMEWORKDIR_HKEY_ROOT))\n        return None\n\n    if not os.path.exists(froot):\n        debug(\"{} not found on fs\".format(froot))\n        return None\n\n    return froot\n\ndef query_versions():\n    froot = find_framework_root()\n    if froot:\n        contents = os.listdir(froot)\n\n        l = re.compile('v[0-9]+.*')\n        versions = [e for e in contents if l.match(e)]\n\n        def versrt(a,b):\n            # since version numbers aren't really floats...\n            aa = a[1:]\n            bb = b[1:]\n            aal = aa.split('.')\n            bbl = bb.split('.')\n            # sequence comparison in python is lexicographical\n            # which is exactly what we want.\n            # Note we sort backwards so the highest version is first.\n            return (aal > bbl) - (aal < bbl)\n\n        versions.sort(versrt)\n    else:\n        versions = []\n\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py",
    "content": "#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n__doc__ = \"\"\"Module to detect the Platform/Windows SDK\n\nPSDK 2003 R1 is the earliest version detected.\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nfrom .common import debug, read_reg\n\n# SDK Checks. This is of course a mess as everything else on MS platforms. Here\n# is what we do to detect the SDK:\n#\n# For Windows SDK >= 6.0: just look into the registry entries:\n#   HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows\n# All the keys in there are the available versions.\n#\n# For Platform SDK before 6.0 (2003 server R1 and R2, etc...), there does not\n# seem to be any sane registry key, so the precise location is hardcoded.\n#\n# For versions below 2003R1, it seems the PSDK is included with Visual Studio?\n#\n# Also, per the following:\n#     http://benjamin.smedbergs.us/blog/tag/atl/\n# VC++ Professional comes with the SDK, VC++ Express does not.\n\n# Location of the SDK (checked for 6.1 only)\n_CURINSTALLED_SDK_HKEY_ROOT = \\\n        r\"Software\\Microsoft\\Microsoft SDKs\\Windows\\CurrentInstallFolder\"\n\n\nclass SDKDefinition:\n    \"\"\"\n    An abstract base class for trying to find installed SDK directories.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        self.__dict__.update(kw)\n\n    def find_sdk_dir(self):\n        \"\"\"Try to find the MS SDK from the registry.\n\n        Return None if failed or the directory does not exist.\n        \"\"\"\n        if not SCons.Util.can_read_reg:\n            debug('find_sdk_dir(): can not read registry')\n            return None\n\n        hkey = self.HKEY_FMT % self.hkey_data\n        debug('find_sdk_dir(): checking registry:{}'.format(hkey))\n\n        try:\n            sdk_dir = read_reg(hkey)\n        except OSError:\n            debug('find_sdk_dir(): no SDK registry key {}'.format(repr(hkey)))\n            return None\n\n        debug('find_sdk_dir(): Trying SDK Dir: {}'.format(sdk_dir))\n\n        if not os.path.exists(sdk_dir):\n            debug('find_sdk_dir():  {} not on file system'.format(sdk_dir))\n            return None\n\n        ftc = os.path.join(sdk_dir, self.sanity_check_file)\n        if not os.path.exists(ftc):\n            debug(\"find_sdk_dir(): sanity check {} not found\".format(ftc))\n            return None\n\n        return sdk_dir\n\n    def get_sdk_dir(self):\n        \"\"\"Return the MSSSDK given the version string.\"\"\"\n        try:\n            return self._sdk_dir\n        except AttributeError:\n            sdk_dir = self.find_sdk_dir()\n            self._sdk_dir = sdk_dir\n            return sdk_dir\n\n    def get_sdk_vc_script(self,host_arch, target_arch):\n        \"\"\" Return the script to initialize the VC compiler installed by SDK\n        \"\"\"\n\n        if host_arch == 'amd64' and target_arch == 'x86':\n            # No cross tools needed compiling 32 bits on 64 bit machine\n            host_arch=target_arch\n\n        arch_string=target_arch\n        if host_arch != target_arch:\n            arch_string='%s_%s'%(host_arch,target_arch)\n\n        debug(\"get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s\"%(arch_string,\n                                                           host_arch,\n                                                           target_arch))\n        file=self.vc_setup_scripts.get(arch_string,None)\n        debug(\"get_sdk_vc_script():file:%s\"%file)\n        return file\n\nclass WindowsSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Windows SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\Microsoft SDKs\\Windows\\v%s\\InstallationFolder'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.version\n\nclass PlatformSDK(SDKDefinition):\n    \"\"\"\n    A subclass for trying to find installed Platform SDK directories.\n    \"\"\"\n    HKEY_FMT = r'Software\\Microsoft\\MicrosoftSDK\\InstalledSDKS\\%s\\Install Dir'\n    def __init__(self, *args, **kw):\n        SDKDefinition.__init__(self, *args, **kw)\n        self.hkey_data = self.uuid\n\n#\n# The list of VC initialization scripts installed by the SDK\n# These should be tried if the vcvarsall.bat TARGET_ARCH fails\npreSDK61VCSetupScripts = { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvarsamd64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\nSDK61VCSetupScripts = {'x86'      : r'bin\\vcvars32.bat',\n                       'amd64'    : r'bin\\amd64\\vcvarsamd64.bat',\n                       'x86_amd64': r'bin\\x86_amd64\\vcvarsx86_amd64.bat',\n                       'x86_ia64' : r'bin\\x86_ia64\\vcvarsx86_ia64.bat',\n                       'ia64'     : r'bin\\ia64\\vcvarsia64.bat'}\n\nSDK70VCSetupScripts =    { 'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvars64.bat',\n                           'x86_amd64': r'bin\\vcvarsx86_amd64.bat',\n                           'x86_ia64' : r'bin\\vcvarsx86_ia64.bat',\n                           'ia64'     : r'bin\\vcvarsia64.bat'}\n\nSDK100VCSetupScripts =    {'x86'      : r'bin\\vcvars32.bat',\n                           'amd64'    : r'bin\\vcvars64.bat',\n                           'x86_amd64': r'bin\\x86_amd64\\vcvarsx86_amd64.bat',\n                           'x86_arm'  : r'bin\\x86_arm\\vcvarsx86_arm.bat'}\n\n\n# The list of support SDKs which we know how to detect.\n#\n# The first SDK found in the list is the one used by default if there\n# are multiple SDKs installed.  Barring good reasons to the contrary,\n# this means we should list SDKs from most recent to oldest.\n#\n# If you update this list, update the documentation in Tool/mssdk.xml.\nSupportedSDKList = [\n    WindowsSDK('10.0A',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('10.0',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0A',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('7.0',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK70VCSetupScripts,\n              ),\n    WindowsSDK('6.1',\n               sanity_check_file=r'bin\\SetEnv.Cmd',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = SDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0A',\n               sanity_check_file=r'include\\windows.h',\n               include_subdir='include',\n               lib_subdir={\n                   'x86'       : ['lib'],\n                   'x86_64'    : [r'lib\\x64'],\n                   'ia64'      : [r'lib\\ia64'],\n               },\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    WindowsSDK('6.0',\n               sanity_check_file=r'bin\\gacutil.exe',\n               include_subdir='include',\n               lib_subdir='lib',\n               vc_setup_scripts = preSDK61VCSetupScripts,\n              ),\n\n    PlatformSDK('2003R2',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n\n    PlatformSDK('2003R1',\n                sanity_check_file=r'SetEnv.Cmd',\n                uuid=\"8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3\",\n                vc_setup_scripts = preSDK61VCSetupScripts,\n               ),\n]\n\nSupportedSDKMap = {}\nfor sdk in SupportedSDKList:\n    SupportedSDKMap[sdk.version] = sdk\n\n\n# Finding installed SDKs isn't cheap, because it goes not only to the\n# registry but also to the disk to sanity-check that there is, in fact,\n# an SDK installed there and that the registry entry isn't just stale.\n# Find this information once, when requested, and cache it.\n\nInstalledSDKList = None\nInstalledSDKMap = None\n\ndef get_installed_sdks():\n    global InstalledSDKList\n    global InstalledSDKMap\n    debug('get_installed_sdks()')\n    if InstalledSDKList is None:\n        InstalledSDKList = []\n        InstalledSDKMap = {}\n        for sdk in SupportedSDKList:\n            debug('trying to find SDK %s' % sdk.version)\n            if sdk.get_sdk_dir():\n                debug('found SDK %s' % sdk.version)\n                InstalledSDKList.append(sdk)\n                InstalledSDKMap[sdk.version] = sdk\n    return InstalledSDKList\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\nSDKEnvironmentUpdates = {}\n\ndef set_sdk_by_directory(env, sdk_dir):\n    global SDKEnvironmentUpdates\n    debug('set_sdk_by_directory: Using dir:%s'%sdk_dir)\n    try:\n        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n    except KeyError:\n        env_tuple_list = []\n        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n\n        include_path = os.path.join(sdk_dir, 'include')\n        mfc_path = os.path.join(include_path, 'mfc')\n        atl_path = os.path.join(include_path, 'atl')\n\n        if os.path.exists(mfc_path):\n            env_tuple_list.append(('INCLUDE', mfc_path))\n        if os.path.exists(atl_path):\n            env_tuple_list.append(('INCLUDE', atl_path))\n        env_tuple_list.append(('INCLUDE', include_path))\n\n        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n\n    for variable, directory in env_tuple_list:\n        env.PrependENVPath(variable, directory)\n\ndef get_sdk_by_version(mssdk):\n    if mssdk not in SupportedSDKMap:\n        raise SCons.Errors.UserError(\"SDK version {} is not supported\".format(repr(mssdk)))\n    get_installed_sdks()\n    return InstalledSDKMap.get(mssdk)\n\ndef get_default_sdk():\n    \"\"\"Set up the default Platform/Windows SDK.\"\"\"\n    get_installed_sdks()\n    if not InstalledSDKList:\n        return None\n    return InstalledSDKList[0]\n\ndef mssdk_setup_env(env):\n    debug('mssdk_setup_env()')\n    if 'MSSDK_DIR' in env:\n        sdk_dir = env['MSSDK_DIR']\n        if sdk_dir is None:\n            return\n        sdk_dir = env.subst(sdk_dir)\n        debug('mssdk_setup_env: Using MSSDK_DIR:{}'.format(sdk_dir))\n    elif 'MSSDK_VERSION' in env:\n        sdk_version = env['MSSDK_VERSION']\n        if sdk_version is None:\n            msg = \"SDK version is specified as None\"\n            raise SCons.Errors.UserError(msg)\n        sdk_version = env.subst(sdk_version)\n        mssdk = get_sdk_by_version(sdk_version)\n        if mssdk is None:\n            msg = \"SDK version %s is not installed\" % sdk_version\n            raise SCons.Errors.UserError(msg)\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir)\n    elif 'MSVS_VERSION' in env:\n        msvs_version = env['MSVS_VERSION']\n        debug('mssdk_setup_env:Getting MSVS_VERSION from env:%s'%msvs_version)\n        if msvs_version is None:\n            debug('mssdk_setup_env thinks msvs_version is None')\n            return\n        msvs_version = env.subst(msvs_version)\n        from . import vs\n        msvs = vs.get_vs_by_version(msvs_version)\n        debug('mssdk_setup_env:msvs is :%s'%msvs)\n        if not msvs:\n            debug('mssdk_setup_env: no VS version detected, bailingout:%s'%msvs)\n            return\n        sdk_version = msvs.sdk_version\n        debug('msvs.sdk_version is %s'%sdk_version)\n        if not sdk_version:\n            return\n        mssdk = get_sdk_by_version(sdk_version)\n        if not mssdk:\n            mssdk = get_default_sdk()\n            if not mssdk:\n                return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: Using MSVS_VERSION:%s'%sdk_dir)\n    else:\n        mssdk = get_default_sdk()\n        if not mssdk:\n            return\n        sdk_dir = mssdk.get_sdk_dir()\n        debug('mssdk_setup_env: not using any env values. sdk_dir:%s'%sdk_dir)\n\n    set_sdk_by_directory(env, sdk_dir)\n\n    #print \"No MSVS_VERSION: this is likely to be a bug\"\n\ndef mssdk_exists(version=None):\n    sdks = get_installed_sdks()\n    if version is None:\n        return len(sdks) > 0\n    return version in sdks\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py",
    "content": "#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\"\"\"Module for Visual C/C++ detection and configuration.\n\n# TODO:\n#   * gather all the information from a single vswhere call instead\n#     of calling repeatedly (use json format?)\n#   * support passing/setting location for vswhere in env.\n#   * supported arch for versions: for old versions of batch file without\n#     argument, giving bogus argument cannot be detected, so we have to hardcode\n#     this here\n#   * print warning when msvc version specified but not found\n#   * find out why warning do not print\n#   * test on 64 bits XP +  VS 2005 (and VS 6 if possible)\n#   * SDK\n#   * Assembly\n\"\"\"\n\nimport SCons.compat\nimport SCons.Util\n\nimport subprocess\nimport os\nimport platform\nfrom string import digits as string_digits\nfrom subprocess import PIPE\n\nimport SCons.Warnings\nfrom SCons.Tool import find_program_path\n\nfrom . import common\nfrom .common import CONFIG_CACHE, debug\nfrom .sdk import get_installed_sdks\n\n\nclass VisualCException(Exception):\n    pass\n\nclass UnsupportedVersion(VisualCException):\n    pass\n\nclass MSVCUnsupportedHostArch(VisualCException):\n    pass\n\nclass MSVCUnsupportedTargetArch(VisualCException):\n    pass\n\nclass MissingConfiguration(VisualCException):\n    pass\n\nclass NoVersionFound(VisualCException):\n    pass\n\nclass BatchFileExecutionError(VisualCException):\n    pass\n\n# Dict to 'canonalize' the arch\n_ARCH_TO_CANONICAL = {\n    \"amd64\"     : \"amd64\",\n    \"emt64\"     : \"amd64\",\n    \"i386\"      : \"x86\",\n    \"i486\"      : \"x86\",\n    \"i586\"      : \"x86\",\n    \"i686\"      : \"x86\",\n    \"ia64\"      : \"ia64\",      # deprecated\n    \"itanium\"   : \"ia64\",      # deprecated\n    \"x86\"       : \"x86\",\n    \"x86_64\"    : \"amd64\",\n    \"arm\"       : \"arm\",\n    \"arm64\"     : \"arm64\",\n    \"aarch64\"   : \"arm64\",\n}\n\n# Starting with 14.1 (aka VS2017), the tools are organized by host directory.\n# subdirs for each target. They are now in .../VC/Auxuiliary/Build.\n# Note 2017 Express uses Hostx86 even if it's on 64-bit Windows,\n# not reflected in this table.\n_HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = {\n    (\"arm64\",\"arm64\")  : (\"Hostarm64\",\"arm64\"),\n    (\"amd64\",\"amd64\")  : (\"Hostx64\",\"x64\"),\n    (\"amd64\",\"x86\")    : (\"Hostx64\",\"x86\"),\n    (\"amd64\",\"arm\")    : (\"Hostx64\",\"arm\"),\n    (\"amd64\",\"arm64\")  : (\"Hostx64\",\"arm64\"),\n    (\"x86\",\"amd64\")    : (\"Hostx86\",\"x64\"),\n    (\"x86\",\"x86\")      : (\"Hostx86\",\"x86\"),\n    (\"x86\",\"arm\")      : (\"Hostx86\",\"arm\"),\n    (\"x86\",\"arm64\")    : (\"Hostx86\",\"arm64\"),\n}\n\n# before 14.1 (VS2017): the original x86 tools are in the tools dir,\n# any others are in a subdir named by the host/target pair,\n# or just a single word if host==target\n_HOST_TARGET_TO_CL_DIR = {\n    (\"amd64\",\"amd64\")  : \"amd64\",\n    (\"amd64\",\"x86\")    : \"amd64_x86\",\n    (\"amd64\",\"arm\")    : \"amd64_arm\",\n    (\"amd64\",\"arm64\")  : \"amd64_arm64\",\n    (\"x86\",\"amd64\")    : \"x86_amd64\",\n    (\"x86\",\"x86\")      : \"\",\n    (\"x86\",\"arm\")      : \"x86_arm\",\n    (\"x86\",\"arm64\")    : \"x86_arm64\",\n    (\"arm\",\"arm\")      : \"arm\",\n}\n\n# 14.1 (VS2017) and later:\n# Given a (host, target) tuple, return the batch file to look for.\n# We can't rely on returning an arg to use for vcvarsall.bat,\n# because that script will run even if given a pair that isn't installed.\n# Targets that already look like a pair are pseudo targets that\n# effectively mean to skip whatever the host was specified as.\n_HOST_TARGET_TO_BAT_ARCH_GT14 = {\n    (\"arm64\", \"arm64\"): \"vcvarsarm64.bat\",\n    (\"amd64\", \"amd64\"): \"vcvars64.bat\",\n    (\"amd64\", \"x86\"): \"vcvarsamd64_x86.bat\",\n    (\"amd64\", \"x86_amd64\"): \"vcvarsx86_amd64.bat\",\n    (\"amd64\", \"x86_x86\"): \"vcvars32.bat\",\n    (\"amd64\", \"arm\"): \"vcvarsamd64_arm.bat\",\n    (\"amd64\", \"x86_arm\"): \"vcvarsx86_arm.bat\",\n    (\"amd64\", \"arm64\"): \"vcvarsamd64_arm64.bat\",\n    (\"amd64\", \"x86_arm64\"): \"vcvarsx86_arm64.bat\",\n    (\"x86\", \"x86\"): \"vcvars32.bat\",\n    (\"x86\", \"amd64\"): \"vcvarsx86_amd64.bat\",\n    (\"x86\", \"x86_amd64\"): \"vcvarsx86_amd64.bat\",\n    (\"x86\", \"arm\"): \"vcvarsx86_arm.bat\",\n    (\"x86\", \"x86_arm\"): \"vcvarsx86_arm.bat\",\n    (\"x86\", \"arm64\"): \"vcvarsx86_arm64.bat\",\n    (\"x86\", \"x86_arm64\"): \"vcvarsx86_arm64.bat\",\n}\n\n# before 14.1 (VS2017):\n# Given a (host, target) tuple, return the argument for the bat file;\n# Both host and target should be canoncalized.\n# If the target already looks like a pair, return it - these are\n# pseudo targets (mainly used by Express versions)\n_HOST_TARGET_ARCH_TO_BAT_ARCH = {\n    (\"x86\", \"x86\"): \"x86\",\n    (\"x86\", \"amd64\"): \"x86_amd64\",\n    (\"x86\", \"x86_amd64\"): \"x86_amd64\",\n    (\"amd64\", \"x86_amd64\"): \"x86_amd64\", # This is present in (at least) VS2012 express\n    (\"amd64\", \"amd64\"): \"amd64\",\n    (\"amd64\", \"x86\"): \"x86\",\n    (\"amd64\", \"x86_x86\"): \"x86\",\n    (\"x86\", \"ia64\"): \"x86_ia64\",         # gone since 14.0\n    (\"x86\", \"arm\"): \"x86_arm\",          # since 14.0\n    (\"x86\", \"arm64\"): \"x86_arm64\",      # since 14.1\n    (\"amd64\", \"arm\"): \"amd64_arm\",      # since 14.0\n    (\"amd64\", \"arm64\"): \"amd64_arm64\",  # since 14.1\n    (\"x86\", \"x86_arm\"): \"x86_arm\",      # since 14.0\n    (\"x86\", \"x86_arm64\"): \"x86_arm64\",  # since 14.1\n    (\"amd64\", \"x86_arm\"): \"x86_arm\",      # since 14.0\n    (\"amd64\", \"x86_arm64\"): \"x86_arm64\",  # since 14.1\n    (\"arm64\", \"arm64\"): \"arm64_arm64\",  # since 14.3\n\n}\n\n_CL_EXE_NAME = 'cl.exe'\n\ndef get_msvc_version_numeric(msvc_version):\n    \"\"\"Get the raw version numbers from a MSVC_VERSION string, so it\n    could be cast to float or other numeric values. For example, '14.0Exp'\n    would get converted to '14.0'.\n\n    Args:\n        msvc_version: str\n            string representing the version number, could contain non\n            digit characters\n\n    Returns:\n        str: the value converted to a numeric only string\n\n    \"\"\"\n    return ''.join([x for  x in msvc_version if x in string_digits + '.'])\n\ndef get_host_target(env):\n    host_platform = env.get('HOST_ARCH')\n    debug(\"HOST_ARCH:\" + str(host_platform))\n    if not host_platform:\n        host_platform = platform.machine()\n\n    # Solaris returns i86pc for both 32 and 64 bit architectures\n    if host_platform == \"i86pc\":\n        if platform.architecture()[0] == \"64bit\":\n            host_platform = \"amd64\"\n        else:\n            host_platform = \"x86\"\n\n    # Retain user requested TARGET_ARCH\n    req_target_platform = env.get('TARGET_ARCH')\n    debug(\"TARGET_ARCH:\" + str(req_target_platform))\n    if req_target_platform:\n        # If user requested a specific platform then only try that one.\n        target_platform = req_target_platform\n    else:\n        target_platform = host_platform\n\n    try:\n        host = _ARCH_TO_CANONICAL[host_platform.lower()]\n    except KeyError:\n        msg = \"Unrecognized host architecture %s\"\n        raise MSVCUnsupportedHostArch(msg % repr(host_platform))\n\n    try:\n        target = _ARCH_TO_CANONICAL[target_platform.lower()]\n    except KeyError:\n        all_archs = str(list(_ARCH_TO_CANONICAL.keys()))\n        raise MSVCUnsupportedTargetArch(\n            \"Unrecognized target architecture %s\\n\\tValid architectures: %s\"\n            % (target_platform, all_archs)\n        )\n\n    return (host, target, req_target_platform)\n\n# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the\n# MSVC_VERSION documentation in Tool/msvc.xml.\n_VCVER = [\n    \"14.3\",\n    \"14.2\",\n    \"14.1\", \"14.1Exp\",\n    \"14.0\", \"14.0Exp\",\n    \"12.0\", \"12.0Exp\",\n    \"11.0\", \"11.0Exp\",\n    \"10.0\", \"10.0Exp\",\n    \"9.0\", \"9.0Exp\",\n    \"8.0\", \"8.0Exp\",\n    \"7.1\",\n    \"7.0\",\n    \"6.0\"]\n\n# if using vswhere, configure command line arguments to probe for installed VC editions\n_VCVER_TO_VSWHERE_VER = {\n    '14.3': [\n        [\"-version\", \"[17.0, 18.0)\"],  # default: Enterprise, Professional, Community  (order unpredictable?)\n        [\"-version\", \"[17.0, 18.0)\", \"-products\", \"Microsoft.VisualStudio.Product.BuildTools\"],  # BuildTools\n    ],\n    '14.2': [\n        [\"-version\", \"[16.0, 17.0)\"],  # default: Enterprise, Professional, Community  (order unpredictable?)\n        [\"-version\", \"[16.0, 17.0)\", \"-products\", \"Microsoft.VisualStudio.Product.BuildTools\"],  # BuildTools\n    ],\n    '14.1': [\n        [\"-version\", \"[15.0, 16.0)\"],  # default: Enterprise, Professional, Community (order unpredictable?)\n        [\"-version\", \"[15.0, 16.0)\", \"-products\", \"Microsoft.VisualStudio.Product.BuildTools\"],  # BuildTools\n    ],\n    '14.1Exp': [\n        [\"-version\", \"[15.0, 16.0)\", \"-products\", \"Microsoft.VisualStudio.Product.WDExpress\"],  # Express\n    ],\n}\n\n_VCVER_TO_PRODUCT_DIR = {\n    '14.3': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')],  # not set by this version\n    '14.2': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')],  # not set by this version\n    '14.1': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')],  # not set by this version\n    '14.1Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'')],  # not set by this version\n    '14.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir')],\n    '14.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\14.0\\Setup\\VC\\ProductDir')],\n    '12.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir'),\n    ],\n    '12.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir'),\n    ],\n    '11.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir'),\n    ],\n    '11.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir'),\n    ],\n    '10.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir'),\n    ],\n    '10.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir'),\n    ],\n    '9.0': [\n        (SCons.Util.HKEY_CURRENT_USER, r'Microsoft\\DevDiv\\VCForPython\\9.0\\installdir',),\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir',),\n    ],\n    '9.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir'),\n    ],\n    '8.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir'),\n    ],\n    '8.0Exp': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir'),\n    ],\n    '7.1': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir'),\n    ],\n    '7.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir'),\n    ],\n    '6.0': [\n        (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir'),\n    ]\n}\n\n\ndef msvc_version_to_maj_min(msvc_version):\n    msvc_version_numeric = get_msvc_version_numeric(msvc_version)\n\n    t = msvc_version_numeric.split(\".\")\n    if not len(t) == 2:\n        raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n    try:\n        maj = int(t[0])\n        min = int(t[1])\n        return maj, min\n    except ValueError as e:\n        raise ValueError(\"Unrecognized version %s (%s)\" % (msvc_version,msvc_version_numeric))\n\n\ndef is_host_target_supported(host_target, msvc_version):\n    \"\"\"Check if (host, target) pair is supported for a VC version.\n\n    Only checks whether a given version *may* support the given\n    (host, target) pair, not that the toolchain is actually on the machine.\n\n    Args:\n        host_target: canonalized host-target pair, e.g.\n          (\"x86\", \"amd64\") for cross compilation from 32- to 64-bit Windows.\n        msvc_version: Visual C++ version (major.minor), e.g. \"10.0\"\n\n    Returns:\n        True or False\n\n    \"\"\"\n    # We assume that any Visual Studio version supports x86 as a target\n    if host_target[1] != \"x86\":\n        maj, min = msvc_version_to_maj_min(msvc_version)\n        if maj < 8:\n            return False\n    return True\n\n\nVSWHERE_PATHS = [os.path.join(p,'vswhere.exe') for p in  [\n    os.path.expandvars(r\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\"),\n    os.path.expandvars(r\"%ProgramFiles%\\Microsoft Visual Studio\\Installer\"),\n    os.path.expandvars(r\"%ChocolateyInstall%\\bin\"),\n]]\n\ndef msvc_find_vswhere():\n    \"\"\" Find the location of vswhere \"\"\"\n    # For bug 3333: support default location of vswhere for both\n    # 64 and 32 bit windows installs.\n    # For bug 3542: also accommodate not being on C: drive.\n    # NB: this gets called from testsuite on non-Windows platforms.\n    # Whether that makes sense or not, don't break it for those.\n    vswhere_path = None\n    for pf in VSWHERE_PATHS:\n        if os.path.exists(pf):\n            vswhere_path = pf\n            break\n\n    return vswhere_path\n\ndef find_vc_pdir_vswhere(msvc_version, env=None):\n    \"\"\" Find the MSVC product directory using the vswhere program.\n\n    Args:\n        msvc_version: MSVC version to search for\n        env: optional to look up VSWHERE variable\n\n    Returns:\n        MSVC install dir or None\n\n    Raises:\n        UnsupportedVersion: if the version is not known by this file\n\n    \"\"\"\n    try:\n        vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version]\n    except KeyError:\n        debug(\"Unknown version of MSVC: %s\" % msvc_version)\n        raise UnsupportedVersion(\"Unknown version %s\" % msvc_version)\n\n    if env is None or not env.get('VSWHERE'):\n        vswhere_path = msvc_find_vswhere()\n    else:\n        vswhere_path = env.subst('$VSWHERE')\n\n    if vswhere_path is None:\n        return None\n\n    debug('VSWHERE: %s' % vswhere_path)\n    for vswhere_version_args in vswhere_version:\n\n        vswhere_cmd = [vswhere_path] + vswhere_version_args + [\"-property\", \"installationPath\"]\n\n        debug(\"running: %s\" % vswhere_cmd)\n\n        #cp = subprocess.run(vswhere_cmd, capture_output=True)  # 3.7+ only\n        cp = subprocess.run(vswhere_cmd, stdout=PIPE, stderr=PIPE)\n\n        if cp.stdout:\n            # vswhere could return multiple lines, e.g. if Build Tools\n            # and {Community,Professional,Enterprise} are both installed.\n            # We could define a way to pick the one we prefer, but since\n            # this data is currently only used to make a check for existence,\n            # returning the first hit should be good enough.\n            lines = cp.stdout.decode(\"mbcs\").splitlines()\n            return os.path.join(lines[0], 'VC')\n        else:\n            # We found vswhere, but no install info available for this version\n            pass\n\n    return None\n\n\ndef find_vc_pdir(env, msvc_version):\n    \"\"\"Find the MSVC product directory for the given version.\n\n    Tries to look up the path using a registry key from the table\n    _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere\n    for help instead.\n\n    Args:\n        msvc_version: str\n            msvc version (major.minor, e.g. 10.0)\n\n    Returns:\n        str: Path found in registry, or None\n\n    Raises:\n        UnsupportedVersion: if the version is not known by this file.\n        MissingConfiguration: found version but the directory is missing.\n\n        Both exceptions inherit from VisualCException.\n\n    \"\"\"\n    root = 'Software\\\\'\n    try:\n        hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version]\n    except KeyError:\n        debug(\"Unknown version of MSVC: %s\" % msvc_version)\n        raise UnsupportedVersion(\"Unknown version %s\" % msvc_version)\n\n    for hkroot, key in hkeys:\n        try:\n            comps = None\n            if not key:\n                comps = find_vc_pdir_vswhere(msvc_version, env)\n                if not comps:\n                    debug('no VC found for version {}'.format(repr(msvc_version)))\n                    raise OSError\n                debug('VC found: {}'.format(repr(msvc_version)))\n                return comps\n            else:\n                if common.is_win64():\n                    try:\n                        # ordinarily at win64, try Wow6432Node first.\n                        comps = common.read_reg(root + 'Wow6432Node\\\\' + key, hkroot)\n                    except OSError:\n                        # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node\n                        pass\n                if not comps:\n                    # not Win64, or Microsoft Visual Studio for Python 2.7\n                    comps = common.read_reg(root + key, hkroot)\n        except OSError:\n            debug('no VC registry key {}'.format(repr(key)))\n        else:\n            debug('found VC in registry: {}'.format(comps))\n            if os.path.exists(comps):\n                return comps\n            else:\n                debug('reg says dir is {}, but it does not exist. (ignoring)'.format(comps))\n                raise MissingConfiguration(\"registry dir {} not found on the filesystem\".format(comps))\n    return None\n\ndef find_batch_file(env,msvc_version,host_arch,target_arch):\n    \"\"\"\n    Find the location of the batch script which should set up the compiler\n    for any TARGET_ARCH whose compilers were installed by Visual Studio/VCExpress\n\n    In newer (2017+) compilers, make use of the fact there are vcvars\n    scripts named with a host_target pair that calls vcvarsall.bat properly,\n    so use that and return an indication we don't need the argument\n    we would have computed to run vcvarsall.bat.\n    \"\"\"\n    pdir = find_vc_pdir(env, msvc_version)\n    if pdir is None:\n        raise NoVersionFound(\"No version of Visual Studio found\")\n    debug('looking in {}'.format(pdir))\n\n    # filter out e.g. \"Exp\" from the version name\n    msvc_ver_numeric = get_msvc_version_numeric(msvc_version)\n    use_arg = True\n    vernum = float(msvc_ver_numeric)\n    if 7 <= vernum < 8:\n        pdir = os.path.join(pdir, os.pardir, \"Common7\", \"Tools\")\n        batfilename = os.path.join(pdir, \"vsvars32.bat\")\n    elif vernum < 7:\n        pdir = os.path.join(pdir, \"Bin\")\n        batfilename = os.path.join(pdir, \"vcvars32.bat\")\n    elif 8 <= vernum <= 14:\n        batfilename = os.path.join(pdir, \"vcvarsall.bat\")\n    else:  # vernum >= 14.1  VS2017 and above\n        batfiledir = os.path.join(pdir, \"Auxiliary\", \"Build\")\n        targ  = _HOST_TARGET_TO_BAT_ARCH_GT14[(host_arch, target_arch)]\n        batfilename = os.path.join(batfiledir, targ)\n        use_arg = False\n\n    if not os.path.exists(batfilename):\n        debug(\"Not found: %s\" % batfilename)\n        batfilename = None\n\n    installed_sdks = get_installed_sdks()\n    for _sdk in installed_sdks:\n        sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)\n        if not sdk_bat_file:\n            debug(\"batch file not found:%s\" % _sdk)\n        else:\n            sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)\n            if os.path.exists(sdk_bat_file_path):\n                debug('sdk_bat_file_path:%s' % sdk_bat_file_path)\n                return (batfilename, use_arg, sdk_bat_file_path)\n\n    return (batfilename, use_arg, None)\n\n\n__INSTALLED_VCS_RUN = None\n_VC_TOOLS_VERSION_FILE_PATH = ['Auxiliary', 'Build', 'Microsoft.VCToolsVersion.default.txt']\n_VC_TOOLS_VERSION_FILE = os.sep.join(_VC_TOOLS_VERSION_FILE_PATH)\n\ndef _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version):\n    \"\"\"Return status of finding a cl.exe to use.\n\n    Locates cl in the vc_dir depending on TARGET_ARCH, HOST_ARCH and the\n    msvc version. TARGET_ARCH and HOST_ARCH can be extracted from the\n    passed env, unless it is None, in which case the native platform is\n    assumed for both host and target.\n\n    Args:\n        env: Environment\n            a construction environment, usually if this is passed its\n            because there is a desired TARGET_ARCH to be used when searching\n            for a cl.exe\n        vc_dir: str\n            the path to the VC dir in the MSVC installation\n        msvc_version: str\n            msvc version (major.minor, e.g. 10.0)\n\n    Returns:\n        bool:\n\n    \"\"\"\n\n    # determine if there is a specific target platform we want to build for and\n    # use that to find a list of valid VCs, default is host platform == target platform\n    # and same for if no env is specified to extract target platform from\n    if env:\n        (host_platform, target_platform, req_target_platform) = get_host_target(env)\n    else:\n        host_platform = platform.machine().lower()\n        target_platform = host_platform\n\n    host_platform = _ARCH_TO_CANONICAL[host_platform]\n    target_platform = _ARCH_TO_CANONICAL[target_platform]\n\n    debug('host platform %s, target platform %s for version %s' % (host_platform, target_platform, msvc_version))\n\n    ver_num = float(get_msvc_version_numeric(msvc_version))\n\n    # make sure the cl.exe exists meaning the tool is installed\n    if ver_num > 14:\n        # 2017 and newer allowed multiple versions of the VC toolset to be\n        # installed at the same time. This changes the layout.\n        # Just get the default tool version for now\n        #TODO: support setting a specific minor VC version\n        default_toolset_file = os.path.join(vc_dir, _VC_TOOLS_VERSION_FILE)\n        try:\n            with open(default_toolset_file) as f:\n                vc_specific_version = f.readlines()[0].strip()\n        except IOError:\n            debug('failed to read ' + default_toolset_file)\n            return False\n        except IndexError:\n            debug('failed to find MSVC version in ' + default_toolset_file)\n            return False\n\n        host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None)\n        if host_trgt_dir is None:\n            debug('unsupported host/target platform combo: (%s,%s)'%(host_platform, target_platform))\n            return False\n\n        cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin',  host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME)\n        debug('checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n        if os.path.exists(cl_path):\n            debug('found ' + _CL_EXE_NAME + '!')\n            return True\n\n        elif host_platform == \"amd64\" and host_trgt_dir[0] == \"Hostx64\":\n            # Special case: fallback to Hostx86 if Hostx64 was tried\n            # and failed.  This is because VS 2017 Express running on amd64\n            # will look to our probe like the host dir should be Hostx64,\n            # but Express uses Hostx86 anyway.\n            # We should key this off the \"x86_amd64\" and related pseudo\n            # targets, but we don't see those in this function.\n            host_trgt_dir = (\"Hostx86\", host_trgt_dir[1])\n            cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin',  host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME)\n            debug('checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n            if os.path.exists(cl_path):\n                debug('found ' + _CL_EXE_NAME + '!')\n                return True\n\n    elif 14 >= ver_num >= 8:\n        # Set default value to be -1 as \"\", which is the value for x86/x86,\n        # yields true when tested if not host_trgt_dir\n        host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None)\n        if host_trgt_dir is None:\n            debug('unsupported host/target platform combo')\n            return False\n\n        cl_path = os.path.join(vc_dir, 'bin',  host_trgt_dir, _CL_EXE_NAME)\n        debug('checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n\n        cl_path_exists = os.path.exists(cl_path)\n        if not cl_path_exists and host_platform == 'amd64':\n            # older versions of visual studio only had x86 binaries,\n            # so if the host platform is amd64, we need to check cross\n            # compile options (x86 binary compiles some other target on a 64 bit os)\n\n            # Set default value to be -1 as \"\" which is the value for x86/x86 yields true when tested\n            # if not host_trgt_dir\n            host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None)\n            if host_trgt_dir is None:\n                return False\n\n            cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME)\n            debug('checking for ' + _CL_EXE_NAME + ' at ' + cl_path)\n            cl_path_exists = os.path.exists(cl_path)\n\n        if cl_path_exists:\n            debug('found ' + _CL_EXE_NAME + '!')\n            return True\n\n    elif 8 > ver_num >= 6:\n        # quick check for vc_dir/bin and vc_dir/ before walk\n        # need to check root as the walk only considers subdirectories\n        for cl_dir in ('bin', ''):\n            cl_path = os.path.join(vc_dir, cl_dir, _CL_EXE_NAME)\n            if os.path.exists(cl_path):\n                debug(_CL_EXE_NAME + ' found %s' % cl_path)\n                return True\n        # not in bin or root: must be in a subdirectory\n        for cl_root, cl_dirs, _ in os.walk(vc_dir):\n            for cl_dir in cl_dirs:\n                cl_path = os.path.join(cl_root, cl_dir, _CL_EXE_NAME)\n                if os.path.exists(cl_path):\n                    debug(_CL_EXE_NAME + ' found %s' % cl_path)\n                    return True\n        return False\n    else:\n        # version not support return false\n        debug('unsupported MSVC version: ' + str(ver_num))\n\n    return False\n\ndef get_installed_vcs(env=None):\n    global __INSTALLED_VCS_RUN\n\n    if __INSTALLED_VCS_RUN is not None:\n        return __INSTALLED_VCS_RUN\n\n    installed_versions = []\n\n    for ver in _VCVER:\n        debug('trying to find VC %s' % ver)\n        try:\n            VC_DIR = find_vc_pdir(env, ver)\n\n            if VC_DIR:\n                debug('found VC %s' % ver)\n                if _check_cl_exists_in_vc_dir(env, VC_DIR, ver):\n                    installed_versions.append(ver)\n                else:\n                    debug('no compiler found %s' % ver)\n            else:\n                debug('return None for ver %s' % ver)\n        except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch):\n            # Allow this exception to propagate further as it should cause\n            # SCons to exit with an error code\n            raise\n        except VisualCException as e:\n            debug('did not find VC %s: caught exception %s' % (ver, str(e)))\n\n    __INSTALLED_VCS_RUN = installed_versions\n    return __INSTALLED_VCS_RUN\n\ndef reset_installed_vcs():\n    \"\"\"Make it try again to find VC.  This is just for the tests.\"\"\"\n    global __INSTALLED_VCS_RUN\n    __INSTALLED_VCS_RUN = None\n\n# Running these batch files isn't cheap: most of the time spent in\n# msvs.generate() is due to vcvars*.bat.  In a build that uses \"tools='msvs'\"\n# in multiple environments, for example:\n#    env1 = Environment(tools='msvs')\n#    env2 = Environment(tools='msvs')\n# we can greatly improve the speed of the second and subsequent Environment\n# (or Clone) calls by memoizing the environment variables set by vcvars*.bat.\n#\n# Updated: by 2018, vcvarsall.bat had gotten so expensive (vs2017 era)\n# it was breaking CI builds because the test suite starts scons so many\n# times and the existing memo logic only helped with repeated calls\n# within the same scons run. Windows builds on the CI system were split\n# into chunks to get around single-build time limits.\n# With VS2019 it got even slower and an optional persistent cache file\n# was introduced. The cache now also stores only the parsed vars,\n# not the entire output of running the batch file - saves a bit\n# of time not parsing every time.\n\nscript_env_cache = None\n\ndef script_env(script, args=None):\n    global script_env_cache\n\n    if script_env_cache is None:\n        script_env_cache = common.read_script_env_cache()\n    cache_key = \"{}--{}\".format(script, args)\n    cache_data = script_env_cache.get(cache_key, None)\n    if cache_data is None:\n        stdout = common.get_output(script, args)\n\n        # Stupid batch files do not set return code: we take a look at the\n        # beginning of the output for an error message instead\n        olines = stdout.splitlines()\n        if olines[0].startswith(\"The specified configuration type is missing\"):\n            raise BatchFileExecutionError(\"\\n\".join(olines[:2]))\n\n        cache_data = common.parse_output(stdout)\n        script_env_cache[cache_key] = cache_data\n        # once we updated cache, give a chance to write out if user wanted\n        common.write_script_env_cache(script_env_cache)\n\n    return cache_data\n\ndef get_default_version(env):\n    msvc_version = env.get('MSVC_VERSION')\n    msvs_version = env.get('MSVS_VERSION')\n    debug('msvc_version:%s msvs_version:%s' % (msvc_version, msvs_version))\n\n    if msvs_version and not msvc_version:\n        SCons.Warnings.warn(\n                SCons.Warnings.DeprecatedWarning,\n                \"MSVS_VERSION is deprecated: please use MSVC_VERSION instead \")\n        return msvs_version\n    elif msvc_version and msvs_version:\n        if not msvc_version == msvs_version:\n            SCons.Warnings.warn(\n                    SCons.Warnings.VisualVersionMismatch,\n                    \"Requested msvc version (%s) and msvs version (%s) do \" \\\n                    \"not match: please use MSVC_VERSION only to request a \" \\\n                    \"visual studio version, MSVS_VERSION is deprecated\" \\\n                    % (msvc_version, msvs_version))\n        return msvs_version\n\n    if not msvc_version:\n        installed_vcs = get_installed_vcs(env)\n        debug('installed_vcs:%s' % installed_vcs)\n        if not installed_vcs:\n            #msg = 'No installed VCs'\n            #debug('msv %s' % repr(msg))\n            #SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg)\n            debug('No installed VCs')\n            return None\n        msvc_version = installed_vcs[0]\n        debug('using default installed MSVC version %s' % repr(msvc_version))\n    else:\n        debug('using specified MSVC version %s' % repr(msvc_version))\n\n    return msvc_version\n\ndef msvc_setup_env_once(env):\n    try:\n        has_run  = env[\"MSVC_SETUP_RUN\"]\n    except KeyError:\n        has_run = False\n\n    if not has_run:\n        msvc_setup_env(env)\n        env[\"MSVC_SETUP_RUN\"] = True\n\ndef msvc_find_valid_batch_script(env, version):\n    \"\"\"Find and execute appropriate batch script to set up build env.\n\n    The MSVC build environment depends heavily on having the shell\n    environment set.  SCons does not inherit that, and does not count\n    on that being set up correctly anyway, so it tries to find the right\n    MSVC batch script, or the right arguments to the generic batch script\n    vcvarsall.bat, and run that, so we have a valid environment to build in.\n    There are dragons here: the batch scripts don't fail (see comments\n    elsewhere), they just leave you with a bad setup, so try hard to\n    get it right.\n    \"\"\"\n\n    # Find the host, target, and if present the requested target:\n    platforms = get_host_target(env)\n    debug(\"host_platform %s, target_platform %s req_target_platform %s\" % platforms)\n    host_platform, target_platform, req_target_platform = platforms\n\n    # Most combinations of host + target are straightforward.\n    # While all MSVC / Visual Studio tools are pysically 32-bit, they\n    # make it look like there are 64-bit tools if the host is 64-bit,\n    # so you can invoke the environment batch script to set up to build,\n    # say, amd64 host -> x86 target. Express versions are an exception:\n    # they always look 32-bit, so the batch scripts with 64-bit\n    # host parts are absent. We try to fix that up in a couple of ways.\n    # One is here: we make a table of \"targets\" to try, with the extra\n    # targets being tags that tell us to try a different \"host\" instead\n    # of the deduced host.\n    try_target_archs = [target_platform]\n    if req_target_platform in ('amd64', 'x86_64'):\n        try_target_archs.append('x86_amd64')\n    elif req_target_platform in ('x86',):\n        try_target_archs.append('x86_x86')\n    elif req_target_platform in ('arm',):\n        try_target_archs.append('x86_arm')\n    elif req_target_platform in ('arm64',):\n        try_target_archs.append('x86_arm64')\n    elif not req_target_platform:\n        if target_platform in ('amd64', 'x86_64'):\n            try_target_archs.append('x86_amd64')\n            # If the user hasn't specifically requested a TARGET_ARCH,\n            # and the TARGET_ARCH is amd64 then also try 32 bits\n            # if there are no viable 64 bit tools installed\n            try_target_archs.append('x86')\n\n    debug(\"host_platform: %s, try_target_archs: %s\"%(host_platform, try_target_archs))\n\n    d = None\n    for tp in try_target_archs:\n        # Set to current arch.\n        env['TARGET_ARCH'] = tp\n\n        debug(\"trying target_platform:%s\" % tp)\n        host_target = (host_platform, tp)\n        if not is_host_target_supported(host_target, version):\n            warn_msg = \"host, target = %s not supported for MSVC version %s\" % \\\n                (host_target, version)\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target]\n\n        # Try to locate a batch file for this host/target platform combo\n        try:\n            (vc_script, use_arg, sdk_script) = find_batch_file(env, version, host_platform, tp)\n            debug('vc_script:%s sdk_script:%s'%(vc_script,sdk_script))\n        except VisualCException as e:\n            msg = str(e)\n            debug('Caught exception while looking for batch file (%s)' % msg)\n            warn_msg = \"VC version %s not installed.  \" + \\\n                       \"C/C++ compilers are most likely not set correctly.\\n\" + \\\n                       \" Installed versions are: %s\"\n            warn_msg = warn_msg % (version, get_installed_vcs(env))\n            SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n            continue\n\n        # Try to use the located batch file for this host/target platform combo\n        debug('use_script 2 %s, args:%s' % (repr(vc_script), arg))\n        found = None\n        if vc_script:\n            if not use_arg:\n                arg = ''  # bat file will supply platform type\n            # Get just version numbers\n            maj, min = msvc_version_to_maj_min(version)\n            # VS2015+\n            if maj >= 14:\n                if env.get('MSVC_UWP_APP') == '1':\n                    # Initialize environment variables with store/UWP paths\n                    arg = (arg + ' store').lstrip()\n\n            try:\n                d = script_env(vc_script, args=arg)\n                found = vc_script\n            except BatchFileExecutionError as e:\n                debug('use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e))\n                vc_script=None\n                continue\n        if not vc_script and sdk_script:\n            debug('use_script 4: trying sdk script: %s' % sdk_script)\n            try:\n                d = script_env(sdk_script)\n                found = sdk_script\n            except BatchFileExecutionError as e:\n                debug('use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script), e))\n                continue\n        elif not vc_script and not sdk_script:\n            debug('use_script 6: Neither VC script nor SDK script found')\n            continue\n\n        debug(\"Found a working script/target: %s/%s\"%(repr(found),arg))\n        break # We've found a working target_platform, so stop looking\n\n    # If we cannot find a viable installed compiler, reset the TARGET_ARCH\n    # To it's initial value\n    if not d:\n        env['TARGET_ARCH']=req_target_platform\n\n    return d\n\n\ndef msvc_setup_env(env):\n    debug('called')\n    version = get_default_version(env)\n    if version is None:\n        warn_msg = \"No version of Visual Studio compiler found - C/C++ \" \\\n                   \"compilers most likely not set correctly\"\n\n        # Nuitka: Useless warning for us.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n\n    # XXX: we set-up both MSVS version for backward\n    # compatibility with the msvs tool\n    env['MSVC_VERSION'] = version\n    env['MSVS_VERSION'] = version\n    env['MSVS'] = {}\n\n\n    use_script = env.get('MSVC_USE_SCRIPT', True)\n    if SCons.Util.is_String(use_script):\n        debug('use_script 1 %s' % repr(use_script))\n        d = script_env(use_script)\n    elif use_script:\n        d = msvc_find_valid_batch_script(env,version)\n        debug('use_script 2 %s' % d)\n        if not d:\n            return d\n    else:\n        debug('MSVC_USE_SCRIPT set to False')\n        warn_msg = \"MSVC_USE_SCRIPT set to False, assuming environment \" \\\n                   \"set correctly.\"\n        # Nuitka: We use this on purpose.\n        # SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n        return None\n\n    for k, v in d.items():\n        # Nuitka: Make the Windows SDK version visible in environment.\n        if k == \"WindowsSDKVersion\":\n            # Always just a single version if any.\n            if len(v) == 1:\n                env[\"WindowsSDKVersion\"] = v[0].rstrip('\\\\')\n            elif len(v) == 0:\n                env[\"WindowsSDKVersion\"] = None\n            else:\n                assert False, v\n\n            continue\n\n        env.PrependENVPath(k, v, delete_existing=True)\n        debug(\"env['ENV']['%s'] = %s\" % (k, env['ENV'][k]))\n\n    # final check to issue a warning if the compiler is not present\n    if not find_program_path(env, 'cl'):\n        debug(\"did not find \" + _CL_EXE_NAME)\n        if CONFIG_CACHE:\n            propose = \"SCONS_CACHE_MSVC_CONFIG caching enabled, remove cache file {} if out of date.\".format(CONFIG_CACHE)\n        else:\n            propose = \"It may need to be installed separately with Visual Studio.\"\n        warn_msg = \"Could not find MSVC compiler 'cl'. {}\".format(propose)\n        SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)\n\ndef msvc_exists(env=None, version=None):\n    vcs = get_installed_vcs(env)\n    if version is None:\n        return len(vcs) > 0\n    return version in vcs\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py",
    "content": "#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n__doc__ = \"\"\"Module to detect Visual Studio and/or Visual C/C++\n\"\"\"\n\nimport os\n\nimport SCons.Errors\nimport SCons.Util\n\nfrom .common import debug, \\\n                   get_output, \\\n                   is_win64, \\\n                   normalize_env, \\\n                   parse_output, \\\n                   read_reg\n\nimport SCons.Tool.MSCommon.vc\n\nclass VisualStudio:\n    \"\"\"\n    An abstract base class for trying to find installed versions of\n    Visual Studio.\n    \"\"\"\n    def __init__(self, version, **kw):\n        self.version = version\n        kw['vc_version']  = kw.get('vc_version', version)\n        kw['sdk_version'] = kw.get('sdk_version', version)\n        self.__dict__.update(kw)\n        self._cache = {}\n\n    def find_batch_file(self):\n        vs_dir = self.get_vs_dir()\n        if not vs_dir:\n            debug('no vs_dir')\n            return None\n        batch_file = os.path.join(vs_dir, self.batch_file_path)\n        batch_file = os.path.normpath(batch_file)\n        if not os.path.isfile(batch_file):\n            debug('%s not on file system' % batch_file)\n            return None\n        return batch_file\n\n    def find_vs_dir_by_vc(self, env):\n        dir = SCons.Tool.MSCommon.vc.find_vc_pdir(env, self.vc_version)\n        if not dir:\n            debug('no installed VC %s' % self.vc_version)\n            return None\n        return os.path.abspath(os.path.join(dir, os.pardir))\n\n    def find_vs_dir_by_reg(self, env):\n        root = 'Software\\\\'\n\n        if is_win64():\n            root = root + 'Wow6432Node\\\\'\n        for key in self.hkeys:\n            if key=='use_dir':\n                return self.find_vs_dir_by_vc(env)\n            key = root + key\n            try:\n                comps = read_reg(key)\n            except OSError:\n                debug('no VS registry key {}'.format(repr(key)))\n            else:\n                debug('found VS in registry: {}'.format(comps))\n                return comps\n        return None\n\n    def find_vs_dir(self, env):\n        \"\"\" Can use registry or location of VC to find vs dir\n        First try to find by registry, and if that fails find via VC dir\n        \"\"\"\n\n        vs_dir=self.find_vs_dir_by_reg(env)\n        if not vs_dir:\n            vs_dir = self.find_vs_dir_by_vc(env)\n        debug('found VS in ' + str(vs_dir ))\n        return vs_dir\n\n    def find_executable(self, env):\n        vs_dir = self.get_vs_dir(env)\n        if not vs_dir:\n            debug('no vs_dir ({})'.format(vs_dir))\n            return None\n        executable = os.path.join(vs_dir, self.executable_path)\n        executable = os.path.normpath(executable)\n        if not os.path.isfile(executable):\n            debug('{} not on file system'.format(executable))\n            return None\n        return executable\n\n    def get_batch_file(self):\n        try:\n            return self._cache['batch_file']\n        except KeyError:\n            batch_file = self.find_batch_file()\n            self._cache['batch_file'] = batch_file\n            return batch_file\n\n    def get_executable(self, env=None):\n        try:\n            debug('using cache:%s'%self._cache['executable'])\n            return self._cache['executable']\n        except KeyError:\n            executable = self.find_executable(env)\n            self._cache['executable'] = executable\n            debug('not in cache:%s'%executable)\n            return executable\n\n    def get_vs_dir(self, env):\n        try:\n            return self._cache['vs_dir']\n        except KeyError:\n            vs_dir = self.find_vs_dir(env)\n            self._cache['vs_dir'] = vs_dir\n            return vs_dir\n\n    def get_supported_arch(self):\n        try:\n            return self._cache['supported_arch']\n        except KeyError:\n            # RDEVE: for the time being use hardcoded lists\n            # supported_arch = self.find_supported_arch()\n            self._cache['supported_arch'] = self.supported_arch\n            return self.supported_arch\n\n    def reset(self):\n        self._cache = {}\n\n# The list of supported Visual Studio versions we know how to detect.\n#\n# How to look for .bat file ?\n#  - VS 2008 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS90COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2008 Express (WoW6432: 32 bits on windows x64):\n#         Software\\Wow6432Node\\Microsoft\\VCEpress\\9.0\\Setup\\VC\\productdir\n#\n#  - VS 2005 Express (x86):\n#     * from registry key productdir, gives the full path to vsvarsall.bat. In\n#     HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VCEpress\\8.0\\Setup\\VC\\productdir\n#     * from environmnent variable VS80COMNTOOLS: the path is then ..\\..\\VC\n#     relatively to the path given by the variable.\n#\n#  - VS 2005 Express (WoW6432: 32 bits on windows x64): does not seem to have a\n#  productdir ?\n#\n#  - VS 2003 .Net (pro edition ? x86):\n#     * from registry key productdir. The path is then ..\\Common7\\Tools\\\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\productdir\n#     * from environmnent variable VS71COMNTOOLS: the path is the full path to\n#     vsvars32.bat\n#\n#  - VS 98 (VS 6):\n#     * from registry key productdir. The path is then Bin\n#     relatively to the key. The key is in HKEY_LOCAL_MACHINE):\n#         Software\\Microsoft\\VisualStudio\\6.0\\Setup\\VC98\\productdir\n#\n# The first version found in the list is the one used by default if\n# there are multiple versions installed.  Barring good reasons to\n# the contrary, this means we should list versions from most recent\n# to oldest.  Pro versions get listed before Express versions on the\n# assumption that, by default, you'd rather use the version you paid\n# good money for in preference to whatever Microsoft makes available\n# for free.\n#\n# If you update this list, update _VCVER and _VCVER_TO_PRODUCT_DIR in\n# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.\n\nSupportedVSList = [\n    # Visual Studio 2022\n    VisualStudio('14.3',\n                 vc_version='14.3',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS170COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 # should be a fallback, prefer use vswhere installationPath\n                 batch_file_path=r'Common7\\Tools\\VsDevCmd.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n                 ),\n\n    # Visual Studio 2019\n    VisualStudio('14.2',\n                 vc_version='14.2',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS160COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 # should be a fallback, prefer use vswhere installationPath\n                 batch_file_path=r'Common7\\Tools\\VsDevCmd.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n                 ),\n\n    # Visual Studio 2017\n    VisualStudio('14.1',\n                 vc_version='14.1',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS150COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 # should be a fallback, prefer use vswhere installationPath\n                 batch_file_path=r'Common7\\Tools\\VsDevCmd.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n                 ),\n\n    # Visual C++ 2017 Express Edition (for Desktop)\n    VisualStudio('14.1Exp',\n                 vc_version='14.1',\n                 sdk_version='10.0A',\n                 hkeys=[],\n                 common_tools_var='VS150COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 # should be a fallback, prefer use vswhere installationPath\n                 batch_file_path=r'Common7\\Tools\\VsDevCmd.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual Studio 2015\n    VisualStudio('14.0',\n                 vc_version='14.0',\n                 sdk_version='10.0',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual C++ 2015 Express Edition (for Desktop)\n    VisualStudio('14.0Exp',\n                 vc_version='14.0',\n                 sdk_version='10.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\14.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS140COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64', \"arm\"],\n    ),\n\n    # Visual Studio 2013\n    VisualStudio('12.0',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2013 Express Edition (for Desktop)\n    VisualStudio('12.0Exp',\n                 vc_version='12.0',\n                 sdk_version='8.1A',\n                 hkeys=[r'Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS120COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2012\n    VisualStudio('11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2012 Express Edition (for Desktop)\n    VisualStudio('11.0Exp',\n                 vc_version='11.0',\n                 sdk_version='8.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\11.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS110COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\WDExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual Studio 2010\n    VisualStudio('10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2010 Express Edition\n    VisualStudio('10.0Exp',\n                 vc_version='10.0',\n                 sdk_version='7.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\10.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS100COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2008\n    VisualStudio('9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2008 Express Edition\n    VisualStudio('9.0Exp',\n                 vc_version='9.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\9.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS90COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 2005\n    VisualStudio('8.0',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VisualStudio\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86', 'amd64'],\n    ),\n\n    # Visual C++ 2005 Express Edition\n    VisualStudio('8.0Exp',\n                 vc_version='8.0Exp',\n                 sdk_version='6.0A',\n                 hkeys=[r'Microsoft\\VCExpress\\8.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS80COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\VCExpress.exe',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio 8',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET 2003\n    VisualStudio('7.1',\n                 sdk_version='6.0',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.1\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS71COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET 2003',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio .NET\n    VisualStudio('7.0',\n                 sdk_version='2003R2',\n                 hkeys=[r'Microsoft\\VisualStudio\\7.0\\Setup\\VS\\ProductDir'],\n                 common_tools_var='VS70COMNTOOLS',\n                 executable_path=r'Common7\\IDE\\devenv.com',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio .NET',\n                 supported_arch=['x86'],\n    ),\n\n    # Visual Studio 6.0\n    VisualStudio('6.0',\n                 sdk_version='2003R1',\n                 hkeys=[r'Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual Studio\\ProductDir',\n                        'use_dir'],\n                 common_tools_var='VS60COMNTOOLS',\n                 executable_path=r'Common\\MSDev98\\Bin\\MSDEV.COM',\n                 batch_file_path=r'Common7\\Tools\\vsvars32.bat',\n                 default_dirname='Microsoft Visual Studio',\n                 supported_arch=['x86'],\n    ),\n]\n\nSupportedVSMap = {}\nfor vs in SupportedVSList:\n    SupportedVSMap[vs.version] = vs\n\n\n# Finding installed versions of Visual Studio isn't cheap, because it\n# goes not only to the registry but also to the disk to sanity-check\n# that there is, in fact, a Visual Studio directory there and that the\n# registry entry isn't just stale.  Find this information once, when\n# requested, and cache it.\n\nInstalledVSList = None\nInstalledVSMap  = None\n\ndef get_installed_visual_studios(env=None):\n    global InstalledVSList\n    global InstalledVSMap\n    if InstalledVSList is None:\n        InstalledVSList = []\n        InstalledVSMap = {}\n        for vs in SupportedVSList:\n            debug('trying to find VS %s' % vs.version)\n            if vs.get_executable(env):\n                debug('found VS %s' % vs.version)\n                InstalledVSList.append(vs)\n                InstalledVSMap[vs.version] = vs\n    return InstalledVSList\n\ndef reset_installed_visual_studios():\n    global InstalledVSList\n    global InstalledVSMap\n    InstalledVSList = None\n    InstalledVSMap  = None\n    for vs in SupportedVSList:\n        vs.reset()\n\n    # Need to clear installed VC's as well as they are used in finding\n    # installed VS's\n    SCons.Tool.MSCommon.vc.reset_installed_vcs()\n\n\n# We may be asked to update multiple construction environments with\n# SDK information.  When doing this, we check on-disk for whether\n# the SDK has 'mfc' and 'atl' subdirectories.  Since going to disk\n# is expensive, cache results by directory.\n\n#SDKEnvironmentUpdates = {}\n#\n#def set_sdk_by_directory(env, sdk_dir):\n#    global SDKEnvironmentUpdates\n#    try:\n#        env_tuple_list = SDKEnvironmentUpdates[sdk_dir]\n#    except KeyError:\n#        env_tuple_list = []\n#        SDKEnvironmentUpdates[sdk_dir] = env_tuple_list\n#\n#        include_path = os.path.join(sdk_dir, 'include')\n#        mfc_path = os.path.join(include_path, 'mfc')\n#        atl_path = os.path.join(include_path, 'atl')\n#\n#        if os.path.exists(mfc_path):\n#            env_tuple_list.append(('INCLUDE', mfc_path))\n#        if os.path.exists(atl_path):\n#            env_tuple_list.append(('INCLUDE', atl_path))\n#        env_tuple_list.append(('INCLUDE', include_path))\n#\n#        env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib')))\n#        env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin')))\n#\n#    for variable, directory in env_tuple_list:\n#        env.PrependENVPath(variable, directory)\n\ndef msvs_exists(env=None):\n    return (len(get_installed_visual_studios(env)) > 0)\n\ndef get_vs_by_version(msvs):\n    global InstalledVSMap\n    global SupportedVSMap\n\n    debug('called')\n    if msvs not in SupportedVSMap:\n        msg = \"Visual Studio version %s is not supported\" % repr(msvs)\n        raise SCons.Errors.UserError(msg)\n    get_installed_visual_studios()\n    vs = InstalledVSMap.get(msvs)\n    debug('InstalledVSMap:%s' % InstalledVSMap)\n    debug('found vs:%s' % vs)\n    # Some check like this would let us provide a useful error message\n    # if they try to set a Visual Studio version that's not installed.\n    # However, we also want to be able to run tests (like the unit\n    # tests) on systems that don't, or won't ever, have it installed.\n    # It might be worth resurrecting this, with some configurable\n    # setting that the tests can use to bypass the check.\n    #if not vs:\n    #    msg = \"Visual Studio version %s is not installed\" % repr(msvs)\n    #    raise SCons.Errors.UserError, msg\n    return vs\n\ndef get_default_version(env):\n    \"\"\"Returns the default version string to use for MSVS.\n\n    If no version was requested by the user through the MSVS environment\n    variable, query all the available visual studios through\n    get_installed_visual_studios, and take the highest one.\n\n    Return\n    ------\n    version: str\n        the default version.\n    \"\"\"\n    if 'MSVS' not in env or not SCons.Util.is_Dict(env['MSVS']):\n        # get all versions, and remember them for speed later\n        versions = [vs.version for vs in get_installed_visual_studios()]\n        env['MSVS'] = {'VERSIONS' : versions}\n    else:\n        versions = env['MSVS'].get('VERSIONS', [])\n\n    if 'MSVS_VERSION' not in env:\n        if versions:\n            env['MSVS_VERSION'] = versions[0] #use highest version by default\n        else:\n            debug('WARNING: no installed versions found, '\n                  'using first in SupportedVSList (%s)' % SupportedVSList[0].version)\n            env['MSVS_VERSION'] = SupportedVSList[0].version\n\n    env['MSVS']['VERSION'] = env['MSVS_VERSION']\n\n    return env['MSVS_VERSION']\n\ndef get_default_arch(env):\n    \"\"\"Return the default arch to use for MSVS\n\n    if no version was requested by the user through the MSVS_ARCH environment\n    variable, select x86\n\n    Return\n    ------\n    arch: str\n    \"\"\"\n    arch = env.get('MSVS_ARCH', 'x86')\n\n    msvs = InstalledVSMap.get(env['MSVS_VERSION'])\n\n    if not msvs:\n        arch = 'x86'\n    elif arch not in msvs.get_supported_arch():\n        fmt = \"Visual Studio version %s does not support architecture %s\"\n        raise SCons.Errors.UserError(fmt % (env['MSVS_VERSION'], arch))\n\n    return arch\n\ndef merge_default_version(env):\n    version = get_default_version(env)\n    arch = get_default_arch(env)\n\ndef msvs_setup_env(env):\n    batfilename = msvs.get_batch_file()\n    msvs = get_vs_by_version(version)\n    if msvs is None:\n        return\n\n    # XXX: I think this is broken. This will silently set a bogus tool instead\n    # of failing, but there is no other way with the current scons tool\n    # framework\n    if batfilename is not None:\n\n        vars = ('LIB', 'LIBPATH', 'PATH', 'INCLUDE')\n\n        msvs_list = get_installed_visual_studios()\n        vscommonvarnames = [vs.common_tools_var for vs in msvs_list]\n        save_ENV = env['ENV']\n        nenv = normalize_env(env['ENV'],\n                             ['COMSPEC'] + vscommonvarnames,\n                             force=True)\n        try:\n            output = get_output(batfilename, arch, env=nenv)\n        finally:\n            env['ENV'] = save_ENV\n        vars = parse_output(output, vars)\n\n        for k, v in vars.items():\n            env.PrependENVPath(k, v, delete_existing=1)\n\ndef query_versions():\n    \"\"\"Query the system to get available versions of VS. A version is\n    considered when a batfile is found.\"\"\"\n    msvs_list = get_installed_visual_studios()\n    versions = [msvs.version for msvs in msvs_list]\n    return versions\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py",
    "content": "\"\"\"SCons.Tool.PharLapCommon\n\nThis module contains common code used by all Tools for the\nPhar Lap ETS tool chain.  Right now, this is linkloc and\n386asm.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os\nimport os.path\nimport SCons.Errors\nimport SCons.Util\nimport re\n\ndef getPharLapPath():\n    \"\"\"Reads the registry to find the installed path of the Phar Lap ETS\n    development kit.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    if not SCons.Util.can_read_reg:\n        raise SCons.Errors.InternalError(\"No Windows registry module was found\")\n    try:\n        k=SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                  'SOFTWARE\\\\Pharlap\\\\ETS')\n        val, type = SCons.Util.RegQueryValueEx(k, 'BaseDir')\n\n        # The following is a hack...there is (not surprisingly)\n        # an odd issue in the Phar Lap plug in that inserts\n        # a bunch of junk data after the phar lap path in the\n        # registry.  We must trim it.\n        idx=val.find('\\0')\n        if idx >= 0:\n            val = val[:idx]\n                    \n        return os.path.normpath(val)\n    except SCons.Util.RegError:\n        raise SCons.Errors.UserError(\"Cannot find Phar Lap ETS path in the registry.  Is it installed properly?\")\n\nREGEX_ETS_VER = re.compile(r'#define\\s+ETS_VER\\s+([0-9]+)')\n\ndef getPharLapVersion():\n    \"\"\"Returns the version of the installed ETS Tool Suite as a\n    decimal number.  This version comes from the ETS_VER #define in\n    the embkern.h header.  For example, '#define ETS_VER 1010' (which\n    is what Phar Lap 10.1 defines) would cause this method to return\n    1010. Phar Lap 9.1 does not have such a #define, but this method\n    will return 910 as a default.\n\n    Raises UserError if no installed version of Phar Lap can\n    be found.\"\"\"\n\n    include_path = os.path.join(getPharLapPath(), os.path.normpath(\"include/embkern.h\"))\n    if not os.path.exists(include_path):\n        raise SCons.Errors.UserError(\"Cannot find embkern.h in ETS include directory.\\nIs Phar Lap ETS installed properly?\")\n    with open(include_path, 'r') as f:\n        mo = REGEX_ETS_VER.search(f.read())\n    if mo:\n        return int(mo.group(1))\n    # Default return for Phar Lap 9.1\n    return 910\n\ndef addPharLapPaths(env):\n    \"\"\"This function adds the path to the Phar Lap binaries, includes,\n    and libraries, if they are not already there.\"\"\"\n    ph_path = getPharLapPath()\n\n    try:\n        env_dict = env['ENV']\n    except KeyError:\n        env_dict = {}\n        env['ENV'] = env_dict\n    SCons.Util.AddPathIfNotExists(env_dict, 'PATH',\n                                  os.path.join(ph_path, 'bin'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'INCLUDE',\n                                  os.path.join(ph_path, 'include'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',\n                                  os.path.join(ph_path, 'lib'))\n    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',\n                                  os.path.join(ph_path, os.path.normpath('lib/vclib')))\n    \n    env['PHARLAP_PATH'] = getPharLapPath()\n    env['PHARLAP_VERSION'] = str(getPharLapVersion())\n    \n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons.Tool\n\nSCons tool selection.\n\nThis looks for modules that define a callable object that can modify\na construction environment as appropriate for a given tool (or tool\nchain).\n\nNote that because this subsystem just *selects* a callable that can\nmodify a construction environment, it's possible for people to define\ntheir own \"tool specification\" in an arbitrary callable function.  No\none needs to use or tie in to this subsystem in order to roll their own\ntool specifications.\n\"\"\"\n\n\n\nimport sys\nimport os\nimport importlib.util\n\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Node.FS\nimport SCons.Scanner\nimport SCons.Scanner.C\n# Nuitka: Avoid ununused tools\n# import SCons.Scanner.D\n# import SCons.Scanner.LaTeX\nimport SCons.Scanner.Prog\n# import SCons.Scanner.SWIG\nfrom SCons.Tool.linkCommon import LibSymlinksActionFunction, LibSymlinksStrFun\n\nDefaultToolpath = []\n\nCScanner = SCons.Scanner.C.CScanner()\n# Nuitka: Avoid ununused tools\n# DScanner = SCons.Scanner.D.DScanner()\n# LaTeXScanner = SCons.Scanner.LaTeX.LaTeXScanner()\n# PDFLaTeXScanner = SCons.Scanner.LaTeX.PDFLaTeXScanner()\nProgramScanner = SCons.Scanner.Prog.ProgramScanner()\nSourceFileScanner = SCons.Scanner.ScannerBase({}, name='SourceFileScanner')\n# SWIGScanner = SCons.Scanner.SWIG.SWIGScanner()\n\nCSuffixes = [\".c\", \".C\", \".cxx\", \".cpp\", \".c++\", \".cc\",\n             \".h\", \".H\", \".hxx\", \".hpp\", \".hh\",\n             \".F\", \".fpp\", \".FPP\",\n             \".m\", \".mm\",\n             \".S\", \".spp\", \".SPP\", \".sx\"]\n\nDSuffixes = ['.d']\n\nIDLSuffixes = [\".idl\", \".IDL\"]\n\nLaTeXSuffixes = [\".tex\", \".ltx\", \".latex\"]\n\nSWIGSuffixes = ['.i']\n\nfor suffix in CSuffixes:\n    SourceFileScanner.add_scanner(suffix, CScanner)\n\n# Nuitka: Avoid ununused tools\n# for suffix in DSuffixes:\n#     SourceFileScanner.add_scanner(suffix, DScanner)\n#\n# for suffix in SWIGSuffixes:\n#    SourceFileScanner.add_scanner(suffix, SWIGScanner)\n\n# FIXME: what should be done here? Two scanners scan the same extensions,\n# but look for different files, e.g., \"picture.eps\" vs. \"picture.pdf\".\n# The builders for DVI and PDF explicitly reference their scanners\n# I think that means this is not needed???\n\n# Nuitka: Avoid ununused tools\n# for suffix in LaTeXSuffixes:\n# for suffix in LaTeXSuffixes:\n#    SourceFileScanner.add_scanner(suffix, LaTeXScanner)\n#    SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner)\n\n# Tool aliases are needed for those tools whose module names also\n# occur in the python standard library (This causes module shadowing and\n# can break using python library functions under python3)  or if the current tool/file names\n# are not legal module names (violate python's identifier rules or are\n# python language keywords).\nTOOL_ALIASES = {\n    'gettext': 'gettext_tool',\n    'clang++': 'clangxx',\n    'as': 'asm',\n}\n\n\nclass Tool:\n    def __init__(self, name, toolpath=None, **kwargs):\n        if toolpath is None:\n            toolpath = []\n\n        # Rename if there's a TOOL_ALIAS for this tool\n        self.name = TOOL_ALIASES.get(name, name)\n        self.toolpath = toolpath + DefaultToolpath\n        # remember these so we can merge them into the call\n        self.init_kw = kwargs\n\n        module = self._tool_module()\n        self.generate = module.generate\n        self.exists = module.exists\n        if hasattr(module, 'options'):\n            self.options = module.options\n\n    def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None):\n        import imp\n\n        splitname = short_name.split('.')\n        index = 0\n        srchpths = searchpaths\n        for item in splitname:\n            file, path, desc = imp.find_module(item, srchpths)\n            mod = imp.load_module(full_name, file, path, desc)\n            srchpths = [path]\n        return mod, file\n\n    def _tool_module(self):\n        oldpythonpath = sys.path\n        sys.path = self.toolpath + sys.path\n        # sys.stderr.write(\"Tool:%s\\nPATH:%s\\n\"%(self.name,sys.path))\n\n        # From: http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692\n        # import importlib.util\n        # spec = importlib.util.spec_from_file_location(\"module.name\", \"/path/to/file.py\")\n        # foo = importlib.util.module_from_spec(spec)\n        # spec.loader.exec_module(foo)\n        # foo.MyClass()\n        # Py 3 code\n\n\n        # sys.stderr.write(\"toolpath:%s\\n\" % self.toolpath)\n        # sys.stderr.write(\"SCONS.TOOL path:%s\\n\" % sys.modules['SCons.Tool'].__path__)\n        debug = False\n        spec = None\n        found_name = self.name\n        add_to_scons_tools_namespace = False\n        for path in self.toolpath:\n            sepname = self.name.replace('.', os.path.sep)\n            file_path = os.path.join(path, \"%s.py\" % sepname)\n            file_package = os.path.join(path, sepname)\n\n            if debug: sys.stderr.write(\"Trying:%s %s\\n\" % (file_path, file_package))\n\n            if os.path.isfile(file_path):\n                spec = importlib.util.spec_from_file_location(self.name, file_path)\n                if debug: print(\"file_Path:%s FOUND\" % file_path)\n                break\n            elif os.path.isdir(file_package):\n                file_package = os.path.join(file_package, '__init__.py')\n                spec = importlib.util.spec_from_file_location(self.name, file_package)\n                if debug: print(\"PACKAGE:%s Found\" % file_package)\n                break\n\n            else:\n                continue\n\n        if spec is None:\n            if debug: sys.stderr.write(\"NO SPEC :%s\\n\" % self.name)\n            spec = importlib.util.find_spec(\".\" + self.name, package='SCons.Tool')\n            if spec:\n                found_name = 'SCons.Tool.' + self.name\n                add_to_scons_tools_namespace = True\n            if debug: sys.stderr.write(\"Spec Found? .%s :%s\\n\" % (self.name, spec))\n\n        if spec is None:\n            sconstools = os.path.normpath(sys.modules['SCons.Tool'].__path__[0])\n            if self.toolpath:\n                sconstools = \", \".join(self.toolpath) + \", \" + sconstools\n            error_string = \"No tool module '%s' found in %s\" % (self.name, sconstools)\n            raise SCons.Errors.UserError(error_string)\n\n        module = importlib.util.module_from_spec(spec)\n        if module is None:\n            if debug: print(\"MODULE IS NONE:%s\" % self.name)\n            error_string = \"Tool module '%s' failed import\" % self.name\n            raise SCons.Errors.SConsEnvironmentError(error_string)\n\n        # Don't reload a tool we already loaded.\n        sys_modules_value = sys.modules.get(found_name, False)\n\n        found_module = None\n        if sys_modules_value and sys_modules_value.__file__ == spec.origin:\n            found_module = sys.modules[found_name]\n        else:\n            # Not sure what to do in the case that there already\n            # exists sys.modules[self.name] but the source file is\n            # different.. ?\n            module = spec.loader.load_module(spec.name)\n\n            sys.modules[found_name] = module\n            if add_to_scons_tools_namespace:\n                # If we found it in SCons.Tool, then add it to the module\n                setattr(SCons.Tool, self.name, module)\n\n            found_module = module\n\n        if found_module is not None:\n            sys.path = oldpythonpath\n            return found_module\n\n        sys.path = oldpythonpath\n\n        full_name = 'SCons.Tool.' + self.name\n        try:\n            return sys.modules[full_name]\n        except KeyError:\n            try:\n                smpath = sys.modules['SCons.Tool'].__path__\n                try:\n                    module, file = self._load_dotted_module_py2(self.name, full_name, smpath)\n                    setattr(SCons.Tool, self.name, module)\n                    if file:\n                        file.close()\n                    return module\n                except ImportError as e:\n                    if str(e) != \"No module named %s\" % self.name:\n                        raise SCons.Errors.SConsEnvironmentError(e)\n                    try:\n                        import zipimport\n                        importer = zipimport.zipimporter(sys.modules['SCons.Tool'].__path__[0])\n                        module = importer.load_module(full_name)\n                        setattr(SCons.Tool, self.name, module)\n                        return module\n                    except ImportError as e:\n                        m = \"No tool named '%s': %s\" % (self.name, e)\n                        raise SCons.Errors.SConsEnvironmentError(m)\n            except ImportError as e:\n                m = \"No tool named '%s': %s\" % (self.name, e)\n                raise SCons.Errors.SConsEnvironmentError(m)\n\n    def __call__(self, env, *args, **kw):\n        if self.init_kw is not None:\n            # Merge call kws into init kws;\n            # but don't bash self.init_kw.\n            if kw is not None:\n                call_kw = kw\n                kw = self.init_kw.copy()\n                kw.update(call_kw)\n            else:\n                kw = self.init_kw\n        env.Append(TOOLS=[self.name])\n        if hasattr(self, 'options'):\n            import SCons.Variables\n            if 'options' not in env:\n                from SCons.Script import ARGUMENTS\n                env['options'] = SCons.Variables.Variables(args=ARGUMENTS)\n            opts = env['options']\n\n            self.options(opts)\n            opts.Update(env)\n\n        self.generate(env, *args, **kw)\n\n    def __str__(self):\n        return self.name\n\n\nLibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun)\n\n\n##########################################################################\n#  Create common executable program / library / object builders\n\ndef createProgBuilder(env):\n    \"\"\"This is a utility function that creates the Program\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        program = env['BUILDERS']['Program']\n    except KeyError:\n        import SCons.Defaults\n        program = SCons.Builder.Builder(action=SCons.Defaults.LinkAction,\n                                        emitter='$PROGEMITTER',\n                                        prefix='$PROGPREFIX',\n                                        suffix='$PROGSUFFIX',\n                                        src_suffix='$OBJSUFFIX',\n                                        src_builder='Object',\n                                        target_scanner=ProgramScanner)\n        env['BUILDERS']['Program'] = program\n\n    return program\n\n\ndef createStaticLibBuilder(env):\n    \"\"\"This is a utility function that creates the StaticLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n    \"\"\"\n\n    try:\n        static_lib = env['BUILDERS']['StaticLibrary']\n    except KeyError:\n        action_list = [SCons.Action.Action(\"$ARCOM\", \"$ARCOMSTR\")]\n        if env.get('RANLIB', False) or env.Detect('ranlib'):\n            ranlib_action = SCons.Action.Action(\"$RANLIBCOM\", \"$RANLIBCOMSTR\")\n            action_list.append(ranlib_action)\n\n        static_lib = SCons.Builder.Builder(action=action_list,\n                                           emitter='$LIBEMITTER',\n                                           prefix='$LIBPREFIX',\n                                           suffix='$LIBSUFFIX',\n                                           src_suffix='$OBJSUFFIX',\n                                           src_builder='StaticObject')\n        env['BUILDERS']['StaticLibrary'] = static_lib\n        env['BUILDERS']['Library'] = static_lib\n\n    return static_lib\n\n\ndef createSharedLibBuilder(env, shlib_suffix='$_SHLIBSUFFIX'):\n    \"\"\"This is a utility function that creates the SharedLibrary\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n\n    Args:\n        shlib_suffix: The suffix specified for the shared library builder\n\n    \"\"\"\n\n    try:\n        shared_lib = env['BUILDERS']['SharedLibrary']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [SCons.Defaults.SharedCheck,\n                       SCons.Defaults.ShLinkAction,\n                       LibSymlinksAction]\n        shared_lib = SCons.Builder.Builder(action=action_list,\n                                           emitter=\"$SHLIBEMITTER\",\n                                           prefix=\"$SHLIBPREFIX\",\n                                           suffix=shlib_suffix,\n                                           target_scanner=ProgramScanner,\n                                           src_suffix='$SHOBJSUFFIX',\n                                           src_builder='SharedObject')\n        env['BUILDERS']['SharedLibrary'] = shared_lib\n\n    return shared_lib\n\n\ndef createLoadableModuleBuilder(env, loadable_module_suffix='$_LDMODULESUFFIX'):\n    \"\"\"This is a utility function that creates the LoadableModule\n    Builder in an Environment if it is not there already.\n\n    If it is already there, we return the existing one.\n\n    Args:\n        loadable_module_suffix: The suffix specified for the loadable module builder\n\n    \"\"\"\n\n    try:\n        ld_module = env['BUILDERS']['LoadableModule']\n    except KeyError:\n        import SCons.Defaults\n        action_list = [SCons.Defaults.SharedCheck,\n                       SCons.Defaults.LdModuleLinkAction,\n                       LibSymlinksAction]\n        ld_module = SCons.Builder.Builder(action=action_list,\n                                          emitter=\"$LDMODULEEMITTER\",\n                                          prefix=\"$LDMODULEPREFIX\",\n                                          suffix=loadable_module_suffix,\n                                          target_scanner=ProgramScanner,\n                                          src_suffix='$SHOBJSUFFIX',\n                                          src_builder='SharedObject')\n        env['BUILDERS']['LoadableModule'] = ld_module\n\n    return ld_module\n\n\ndef createObjBuilders(env):\n    \"\"\"This is a utility function that creates the StaticObject\n    and SharedObject Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (StaticObject, SharedObject)\n    \"\"\"\n\n    try:\n        static_obj = env['BUILDERS']['StaticObject']\n    except KeyError:\n        static_obj = SCons.Builder.Builder(action={},\n                                           emitter={},\n                                           prefix='$OBJPREFIX',\n                                           suffix='$OBJSUFFIX',\n                                           src_builder=['CFile', 'CXXFile'],\n                                           source_scanner=SourceFileScanner,\n                                           single_source=1)\n        env['BUILDERS']['StaticObject'] = static_obj\n        env['BUILDERS']['Object'] = static_obj\n\n    try:\n        shared_obj = env['BUILDERS']['SharedObject']\n    except KeyError:\n        shared_obj = SCons.Builder.Builder(action={},\n                                           emitter={},\n                                           prefix='$SHOBJPREFIX',\n                                           suffix='$SHOBJSUFFIX',\n                                           src_builder=['CFile', 'CXXFile'],\n                                           source_scanner=SourceFileScanner,\n                                           single_source=1)\n        env['BUILDERS']['SharedObject'] = shared_obj\n\n    return (static_obj, shared_obj)\n\n\ndef createCFileBuilders(env):\n    \"\"\"This is a utility function that creates the CFile/CXXFile\n    Builders in an Environment if they\n    are not there already.\n\n    If they are there already, we return the existing ones.\n\n    This is a separate function because soooo many Tools\n    use this functionality.\n\n    The return is a 2-tuple of (CFile, CXXFile)\n    \"\"\"\n\n    try:\n        c_file = env['BUILDERS']['CFile']\n    except KeyError:\n        c_file = SCons.Builder.Builder(action={},\n                                       emitter={},\n                                       suffix={None: '$CFILESUFFIX'})\n        env['BUILDERS']['CFile'] = c_file\n\n        env.SetDefault(CFILESUFFIX='.c')\n\n    try:\n        cxx_file = env['BUILDERS']['CXXFile']\n    except KeyError:\n        cxx_file = SCons.Builder.Builder(action={},\n                                         emitter={},\n                                         suffix={None: '$CXXFILESUFFIX'})\n        env['BUILDERS']['CXXFile'] = cxx_file\n        env.SetDefault(CXXFILESUFFIX='.cc')\n\n    return (c_file, cxx_file)\n\n\n##########################################################################\n#  Create common Java builders\n\ndef CreateJarBuilder(env):\n    \"\"\"The Jar builder expects a list of class files\n    which it can package into a jar file.\n\n    The jar tool provides an interface for passing other types\n    of java files such as .java, directories or swig interfaces\n    and will build them to class files in which it can package\n    into the jar.\n    \"\"\"\n    try:\n        java_jar = env['BUILDERS']['JarFile']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')\n        java_jar = SCons.Builder.Builder(action=jar_com,\n                                         suffix='$JARSUFFIX',\n                                         src_suffix='$JAVACLASSSUFFIX',\n                                         src_builder='JavaClassFile',\n                                         source_factory=fs.Entry)\n        env['BUILDERS']['JarFile'] = java_jar\n    return java_jar\n\n\ndef CreateJavaHBuilder(env):\n    try:\n        java_javah = env['BUILDERS']['JavaH']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR')\n        java_javah = SCons.Builder.Builder(action=java_javah_com,\n                                           src_suffix='$JAVACLASSSUFFIX',\n                                           target_factory=fs.Entry,\n                                           source_factory=fs.File,\n                                           src_builder='JavaClassFile')\n        env['BUILDERS']['JavaH'] = java_javah\n    return java_javah\n\n\ndef CreateJavaClassFileBuilder(env):\n    try:\n        java_class_file = env['BUILDERS']['JavaClassFile']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_file = SCons.Builder.Builder(action=javac_com,\n                                                emitter={},\n                                                # suffix = '$JAVACLASSSUFFIX',\n                                                src_suffix='$JAVASUFFIX',\n                                                src_builder=['JavaFile'],\n                                                target_factory=fs.Entry,\n                                                source_factory=fs.File)\n        env['BUILDERS']['JavaClassFile'] = java_class_file\n    return java_class_file\n\n\ndef CreateJavaClassDirBuilder(env):\n    try:\n        java_class_dir = env['BUILDERS']['JavaClassDir']\n    except KeyError:\n        fs = SCons.Node.FS.get_default_fs()\n        javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')\n        java_class_dir = SCons.Builder.Builder(action=javac_com,\n                                               emitter={},\n                                               target_factory=fs.Dir,\n                                               source_factory=fs.Dir)\n        env['BUILDERS']['JavaClassDir'] = java_class_dir\n    return java_class_dir\n\n\ndef CreateJavaFileBuilder(env):\n    try:\n        java_file = env['BUILDERS']['JavaFile']\n    except KeyError:\n        java_file = SCons.Builder.Builder(action={},\n                                          emitter={},\n                                          suffix={None: '$JAVASUFFIX'})\n        env['BUILDERS']['JavaFile'] = java_file\n        env['JAVASUFFIX'] = '.java'\n    return java_file\n\n\nclass ToolInitializerMethod:\n    \"\"\"\n    This is added to a construction environment in place of a\n    method(s) normally called for a Builder (env.Object, env.StaticObject,\n    etc.).  When called, it has its associated ToolInitializer\n    object search the specified list of tools and apply the first\n    one that exists to the construction environment.  It then calls\n    whatever builder was (presumably) added to the construction\n    environment in place of this particular instance.\n    \"\"\"\n\n    def __init__(self, name, initializer):\n        \"\"\"\n        Note:  we store the tool name as __name__ so it can be used by\n        the class that attaches this to a construction environment.\n        \"\"\"\n        self.__name__ = name\n        self.initializer = initializer\n\n    def get_builder(self, env):\n        \"\"\"\n        Returns the appropriate real Builder for this method name\n        after having the associated ToolInitializer object apply\n        the appropriate Tool module.\n        \"\"\"\n        builder = getattr(env, self.__name__)\n\n        self.initializer.apply_tools(env)\n\n        builder = getattr(env, self.__name__)\n        if builder is self:\n            # There was no Builder added, which means no valid Tool\n            # for this name was found (or possibly there's a mismatch\n            # between the name we were called by and the Builder name\n            # added by the Tool module).\n            return None\n\n        self.initializer.remove_methods(env)\n\n        return builder\n\n    def __call__(self, env, *args, **kw):\n        \"\"\"\n        \"\"\"\n        builder = self.get_builder(env)\n        if builder is None:\n            return [], []\n        return builder(*args, **kw)\n\n\nclass ToolInitializer:\n    \"\"\"\n    A class for delayed initialization of Tools modules.\n\n    Instances of this class associate a list of Tool modules with\n    a list of Builder method names that will be added by those Tool\n    modules.  As part of instantiating this object for a particular\n    construction environment, we also add the appropriate\n    ToolInitializerMethod objects for the various Builder methods\n    that we want to use to delay Tool searches until necessary.\n    \"\"\"\n\n    def __init__(self, env, tools, names):\n        if not SCons.Util.is_List(tools):\n            tools = [tools]\n        if not SCons.Util.is_List(names):\n            names = [names]\n        self.env = env\n        self.tools = tools\n        self.names = names\n        self.methods = {}\n        for name in names:\n            method = ToolInitializerMethod(name, self)\n            self.methods[name] = method\n            env.AddMethod(method)\n\n    def remove_methods(self, env):\n        \"\"\"\n        Removes the methods that were added by the tool initialization\n        so we no longer copy and re-bind them when the construction\n        environment gets cloned.\n        \"\"\"\n        for method in self.methods.values():\n            env.RemoveMethod(method)\n\n    def apply_tools(self, env):\n        \"\"\"\n        Searches the list of associated Tool modules for one that\n        exists, and applies that to the construction environment.\n        \"\"\"\n        for t in self.tools:\n            tool = SCons.Tool.Tool(t)\n            if tool.exists(env):\n                env.Tool(tool)\n                return\n\n        # If we fall through here, there was no tool module found.\n        # This is where we can put an informative error message\n        # about the inability to find the tool.   We'll start doing\n        # this as we cut over more pre-defined Builder+Tools to use\n        # the ToolInitializer class.\n\n\ndef Initializers(env):\n    ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib'])\n\n    def Install(self, *args, **kw):\n        return self._InternalInstall(*args, **kw)\n\n    def InstallAs(self, *args, **kw):\n        return self._InternalInstallAs(*args, **kw)\n\n    def InstallVersionedLib(self, *args, **kw):\n        return self._InternalInstallVersionedLib(*args, **kw)\n\n    env.AddMethod(Install)\n    env.AddMethod(InstallAs)\n    env.AddMethod(InstallVersionedLib)\n\n\ndef FindTool(tools, env):\n    for tool in tools:\n        t = Tool(tool)\n        if t.exists(env):\n            return tool\n    return None\n\n\ndef FindAllTools(tools, env):\n    def ToolExists(tool, env=env):\n        return Tool(tool).exists(env)\n\n    return list(filter(ToolExists, tools))\n\n\ndef tool_list(platform, env):\n    other_plat_tools = []\n    # XXX this logic about what tool to prefer on which platform\n    #     should be moved into either the platform files or\n    #     the tool files themselves.\n    # The search orders here are described in the man page.  If you\n    # change these search orders, update the man page as well.\n    if str(platform) == 'win32':\n        \"prefer Microsoft tools on Windows\"\n        linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32']\n        c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32']\n        cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32']\n        assemblers = ['masm', 'nasm', 'gas', '386asm']\n        fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']\n        ars = ['mslib', 'ar', 'tlib']\n        # Nuitka: Do not use \"midl\" tool.\n        other_plat_tools = ['msvs']\n    elif str(platform) == 'os2':\n        \"prefer IBM tools on OS/2\"\n        linkers = ['ilink', 'gnulink', ]  # 'mslink']\n        c_compilers = ['icc', 'gcc', ]  # 'msvc', 'cc']\n        cxx_compilers = ['icc', 'g++', ]  # 'msvc', 'cxx']\n        assemblers = ['nasm', ]  # 'masm', 'gas']\n        fortran_compilers = ['ifl', 'g77']\n        ars = ['ar', ]  # 'mslib']\n    elif str(platform) == 'irix':\n        \"prefer MIPSPro on IRIX\"\n        linkers = ['sgilink', 'gnulink']\n        c_compilers = ['sgicc', 'gcc', 'cc']\n        cxx_compilers = ['sgicxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['sgiar']\n    elif str(platform) == 'sunos':\n        \"prefer Forte tools on SunOS\"\n        linkers = ['sunlink', 'gnulink']\n        c_compilers = ['suncc', 'gcc', 'cc']\n        cxx_compilers = ['suncxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77',\n                             'gfortran', 'g77', 'fortran']\n        ars = ['sunar']\n    elif str(platform) == 'hpux':\n        \"prefer aCC tools on HP-UX\"\n        linkers = ['hplink', 'gnulink']\n        c_compilers = ['hpcc', 'gcc', 'cc']\n        cxx_compilers = ['hpcxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']\n        ars = ['ar']\n    elif str(platform) == 'aix':\n        \"prefer AIX Visual Age tools on AIX\"\n        linkers = ['aixlink', 'gnulink']\n        c_compilers = ['aixcc', 'gcc', 'cc']\n        cxx_compilers = ['aixcxx', 'g++', 'cxx']\n        assemblers = ['as', 'gas']\n        fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran']\n        ars = ['ar']\n    elif str(platform) == 'darwin':\n        \"prefer GNU tools on Mac OS X, except for some linkers and IBM tools\"\n        linkers = ['applelink', 'gnulink']\n        c_compilers = ['gcc', 'cc']\n        cxx_compilers = ['g++', 'cxx']\n        assemblers = ['as']\n        fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']\n        ars = ['ar']\n    elif str(platform) == 'cygwin':\n        \"prefer GNU tools on Cygwin, except for a platform-specific linker\"\n        linkers = ['cyglink', 'mslink', 'ilink']\n        c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']\n        cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx']\n        assemblers = ['gas', 'nasm', 'masm']\n        fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']\n        ars = ['ar', 'mslib']\n    else:\n        \"prefer GNU tools on all other platforms\"\n        linkers = ['gnulink', 'ilink']\n        c_compilers = ['gcc', 'intelc', 'icc', 'cc']\n        cxx_compilers = ['g++', 'intelc', 'icc', 'cxx']\n        assemblers = ['gas', 'nasm', 'masm']\n        fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']\n        ars = ['ar', ]\n\n    if not str(platform) == 'win32':\n        other_plat_tools += ['m4', 'rpm']\n\n    c_compiler = FindTool(c_compilers, env) or c_compilers[0]\n\n    # XXX this logic about what tool provides what should somehow be\n    #     moved into the tool files themselves.\n    if c_compiler and c_compiler == 'mingw':\n        # MinGW contains a linker, C compiler, C++ compiler,\n        # Fortran compiler, archiver and assembler:\n        cxx_compiler = None\n        linker = None\n        assembler = None\n        fortran_compiler = None\n        ar = None\n    else:\n        # Don't use g++ if the C compiler has built-in C++ support:\n        if c_compiler in ('msvc', 'intelc', 'icc'):\n            cxx_compiler = None\n        else:\n            cxx_compiler = FindTool(cxx_compilers, env) or cxx_compilers[0]\n        linker = FindTool(linkers, env) or linkers[0]\n        # Nuitka: Avoid ununused tools\n        # assembler = FindTool(assemblers, env) or assemblers[0]\n        # fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0]\n        # ar = FindTool(ars, env) or ars[0]\n        assembler = None\n        fortran_compiler = None\n        ar = None\n\n    d_compilers = ['dmd', 'ldc', 'gdc']\n    # Nuitka: Avoid ununused tools\n    # d_compiler = FindTool(d_compilers, env) or d_compilers[0]\n    d_compiler = []\n\n    other_tools = FindAllTools(other_plat_tools, env)\n# Nuitka: Avoid ununused tools + [\n    #     # TODO: merge 'install' into 'filesystem' and\n    #     # make 'filesystem' the default\n    #     'filesystem',\n    #     # Parser generators\n    #     'lex', 'yacc',\n    #     # Foreign function interface\n    #     'rpcgen', 'swig',\n    #     # Java\n    #     'jar', 'javac', 'javah', 'rmic',\n    #     # TeX\n    #     'dvipdf', 'dvips', 'gs',\n    #     'tex', 'latex', 'pdflatex', 'pdftex',\n    #     # Archivers\n    #     'tar', 'zip',\n    #     # File builders (text)\n    #     'textfile',\n    # ], env)\n\n    tools = [\n        linker,\n        c_compiler,\n        cxx_compiler,\n        fortran_compiler,\n        assembler,\n        ar,\n        d_compiler,\n    ] + other_tools\n\n    return [x for x in tools if x]\n\n\ndef find_program_path(env, key_program, default_paths=None):\n    \"\"\"\n    Find the location of a tool using various means.\n\n    Mainly for windows where tools aren't all installed in /usr/bin, etc.\n\n    :param env: Current Construction Environment.\n    :param key_program: Tool to locate.\n    :param default_paths: List of additional paths this tool might be found in.\n    \"\"\"\n    # First search in the SCons path\n    path = env.WhereIs(key_program)\n    if path:\n        return path\n\n    # Then in the OS path\n    path = SCons.Util.WhereIs(key_program)\n    if path:\n        return path\n\n    # Finally, add the defaults and check again. Do not change\n    # ['ENV']['PATH'] permananetly, the caller can do that if needed.\n    if default_paths is None:\n        return path\n    save_path = env['ENV']['PATH']\n    for p in default_paths:\n        env.AppendENVPath('PATH', p)\n    path = env.WhereIs(key_program)\n    env['ENV']['PATH'] = save_path\n    return path\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py",
    "content": "\"\"\"SCons.Tool.aixc++\n\nTool-specific initialization for IBM xlC / Visual Age C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.aixcxx import *\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py",
    "content": "\"\"\"SCons.Tool.aixcc\n\nTool-specific initialization for IBM xlc / Visual Age C compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\nfrom . import cc\n\npackages = ['vac.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CC', 'xlc')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlc / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        _cc = os.path.join(path, _cc)\n\n    if 'CC' not in env:\n        env['CC'] = _cc\n\n    cc.generate(env)\n\n    if version:\n        env['CCVERSION'] = version\n\ndef exists(env):\n    path, _cc, version = get_xlc(env)\n    if path and _cc:\n        xlc = os.path.join(path, _cc)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py",
    "content": "\"\"\"SCons.Tool.aixc++\n\nTool-specific initialization for IBM xlC / Visual Age C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os.path\n\nimport SCons.Platform.aix\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\npackages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']\n\ndef get_xlc(env):\n    xlc = env.get('CXX', 'xlC')\n    return SCons.Platform.aix.get_xlc(env, xlc, packages)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for xlC / Visual Age\n    suite to an Environment.\"\"\"\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        _cxx = os.path.join(path, _cxx)\n\n    if 'CXX' not in env:\n        env['CXX'] = _cxx\n\n    cplusplus.generate(env)\n\n    if version:\n        env['CXXVERSION'] = version\n    \ndef exists(env):\n    path, _cxx, version = get_xlc(env)\n    if path and _cxx:\n        xlc = os.path.join(path, _cxx)\n        if os.path.exists(xlc):\n            return xlc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py",
    "content": "\"\"\"SCons.Tool.aixlink\n\nTool-specific initialization for the IBM Visual Age linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os\nimport os.path\n\nimport SCons.Util\n\nfrom . import aixcc\nfrom . import link\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n\n\ndef smart_linkflags(source, target, env, for_signature):\n    if cplusplus.iscplusplus(source):\n        build_dir = env.subst('$BUILDDIR', target=target, source=source)\n        if build_dir:\n            return '-qtempinc=' + os.path.join(build_dir, 'tempinc')\n    return ''\n\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n\n    env['SMARTLINKFLAGS'] = smart_linkflags\n    env['LINKFLAGS']      = SCons.Util.CLVar('$SMARTLINKFLAGS')\n    env['SHLINKFLAGS']    = SCons.Util.CLVar('$LINKFLAGS -qmkshrobj -qsuppress=1501-218')\n    env['SHLIBSUFFIX']    = '.a'\n\n\ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] }\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env:  # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py",
    "content": "\"\"\"SCons.Tool.applelink\n\nTool-specific initialization for Apple's gnu-like linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n# Even though the Mac is based on the GNU toolchain, it doesn't understand\n# the -rpath option, so we use the \"link\" tool instead of \"gnulink\".\nfrom SCons.Util import CLVar\nfrom SCons.Errors import UserError\nfrom . import link\n\n# User programmatically describes how SHLIBVERSION maps to values for compat/current.\n_APPLELIB_MAX_VERSION_VALUES = (65535, 255, 255)\n\n\nclass AppleLinkInvalidCurrentVersionException(Exception):\n    pass\n\n\nclass AppleLinkInvalidCompatibilityVersionException(Exception):\n    pass\n\n\ndef _applelib_check_valid_version(version_string):\n    \"\"\"\n    Check that the version # is valid.\n    X[.Y[.Z]]\n    where X 0-65535\n    where Y either not specified or 0-255\n    where Z either not specified or 0-255\n    :param version_string:\n    :return:\n    \"\"\"\n    parts = version_string.split('.')\n    if len(parts) > 3:\n        return False, \"Version string has too many periods [%s]\" % version_string\n    if len(parts) <= 0:\n        return False, \"Version string unspecified [%s]\" % version_string\n\n    for (i, p) in enumerate(parts):\n        try:\n            p_i = int(p)\n        except ValueError:\n            return False, \"Version component %s (from %s) is not a number\" % (p, version_string)\n        if p_i < 0 or p_i > _APPLELIB_MAX_VERSION_VALUES[i]:\n            return False, \"Version component %s (from %s) is not valid value should be between 0 and %d\" % (\n                p, version_string, _APPLELIB_MAX_VERSION_VALUES[i])\n\n    return True, \"\"\n\n\ndef _applelib_currentVersionFromSoVersion(source, target, env, for_signature):\n    \"\"\"\n    A generator function to create the -Wl,-current_version flag if needed.\n    If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated\n    Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']\n    will be used.\n\n    :param source:\n    :param target:\n    :param env:\n    :param for_signature:\n    :return: A string providing the flag to specify the current_version of the shared library\n    \"\"\"\n    if env.get('APPLELINK_NO_CURRENT_VERSION', False):\n        return \"\"\n    elif env.get('APPLELINK_CURRENT_VERSION', False):\n        version_string = env['APPLELINK_CURRENT_VERSION']\n    elif env.get('SHLIBVERSION', False):\n        version_string = env['SHLIBVERSION']\n    else:\n        return \"\"\n\n    version_string = \".\".join(version_string.split('.')[:3])\n\n    valid, reason = _applelib_check_valid_version(version_string)\n    if not valid:\n        raise AppleLinkInvalidCurrentVersionException(reason)\n\n    return \"-Wl,-current_version,%s\" % version_string\n\n\ndef _applelib_compatVersionFromSoVersion(source, target, env, for_signature):\n    \"\"\"\n    A generator function to create the -Wl,-compatibility_version flag if needed.\n    If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated\n    Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified\n    the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.\n\n    :param source:\n    :param target:\n    :param env:\n    :param for_signature:\n    :return: A string providing the flag to specify the compatibility_version of the shared library\n    \"\"\"\n    if env.get('APPLELINK_NO_COMPATIBILITY_VERSION', False):\n        return \"\"\n    elif env.get('APPLELINK_COMPATIBILITY_VERSION', False):\n        version_string = env['APPLELINK_COMPATIBILITY_VERSION']\n    elif env.get('SHLIBVERSION', False):\n        version_string = \".\".join(env['SHLIBVERSION'].split('.')[:2] + ['0'])\n    else:\n        return \"\"\n\n    if version_string is None:\n        return \"\"\n\n    valid, reason = _applelib_check_valid_version(version_string)\n    if not valid:\n        raise AppleLinkInvalidCompatibilityVersionException(reason)\n\n    return \"-Wl,-compatibility_version,%s\" % version_string\n\ndef _applelib_soname(target, source, env, for_signature):\n    \"\"\"\n    Override default _soname() function from SCons.Tools.linkCommon.SharedLibrary.\n    Apple's file naming for versioned shared libraries puts the version string before\n    the shared library suffix (.dylib), instead of after.\n    \"\"\"\n    if \"SONAME\" in env:\n        # Now verify that SOVERSION is not also set as that is not allowed\n        if \"SOVERSION\" in env:\n            raise UserError(\n                \"Ambiguous library .so naming, both SONAME: %s and SOVERSION: %s are defined. \"\n                \"Only one can be defined for a target library.\"\n                % (env[\"SONAME\"], env[\"SOVERSION\"])\n            )\n        return \"$SONAME\"\n    else:\n        return \"$SHLIBPREFIX$_get_shlib_stem$_SHLIBSOVERSION${SHLIBSUFFIX}\"\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for applelink to an\n    Environment.\"\"\"\n    link.generate(env)\n\n    env['FRAMEWORKPATHPREFIX'] = '-F'\n    env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, \"\", __env__, RDirs)}'\n\n    env['_FRAMEWORKS'] = '${_concat(\"-framework \", FRAMEWORKS, \"\", __env__)}'\n    env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n    env['SHLINKFLAGS'] = CLVar('$LINKFLAGS -dynamiclib')\n    env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n    env['_APPLELINK_CURRENT_VERSION'] = _applelib_currentVersionFromSoVersion\n    env['_APPLELINK_COMPATIBILITY_VERSION'] = _applelib_compatVersionFromSoVersion\n    env['_SHLIBVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '\n    env['_LDMODULEVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '\n\n    # override the default for loadable modules, which are different\n    # on OS X than dynamic shared libs.  echoing what XCode does for\n    # pre/suffixes:\n    env['LDMODULEPREFIX'] = ''\n    env['LDMODULESUFFIX'] = ''\n    env['LDMODULEFLAGS'] = CLVar('$LINKFLAGS -bundle')\n    env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS' \\\n                         ' $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'\n\n    # New stuff\n    #\n    env['_SHLIBSUFFIX'] = '${_SHLIBVERSION}${SHLIBSUFFIX}'\n\n    env['__SHLIBVERSIONFLAGS'] = '${__lib_either_version_flag(__env__,' \\\n                                 '\"SHLIBVERSION\",\"_APPLELINK_CURRENT_VERSION\", \"_SHLIBVERSIONFLAGS\")}'\n    env['__LDMODULEVERSIONFLAGS'] = '${__lib_either_version_flag(__env__,' \\\n                                    '\"LDMODULEVERSION\",\"_APPLELINK_CURRENT_VERSION\", \"_LDMODULEVERSIONFLAGS\")}'\n\n    env[\"_SHLIBSONAME\"] = _applelib_soname\n\n\ndef exists(env):\n    return env['PLATFORM'] == 'darwin'\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py",
    "content": "\"\"\"SCons.Tool.ar\n\nTool-specific initialization for ar (library archive).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    env['AR']          = 'ar'\n    env['ARFLAGS']     = SCons.Util.CLVar('rc')\n    env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\n    if env.get('RANLIB',env.Detect('ranlib')) :\n        env['RANLIB']      = env.get('RANLIB','ranlib')\n        env['RANLIBFLAGS'] = SCons.Util.CLVar('')\n        env['RANLIBCOM']   = '$RANLIB $RANLIBFLAGS $TARGET'\n\ndef exists(env):\n    return env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py",
    "content": "\"\"\"SCons.Tool.as\n\nTool-specific initialization for generic assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n#\n# forward proxy to the preferred asm version\n#\nimport SCons.Tool.asm\n\n# Resolve FLAKE8 F401 (make sider happy)\ngenerate = SCons.Tool.asm.generate\nexists = SCons.Tool.asm.exists\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py",
    "content": "\"\"\"SCons.Tool.as\n\nTool-specific initialization for as, the generic Posix assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nassemblers = ['as']\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py",
    "content": "\"\"\"SCons.Tool.bcc32\n\nXXX\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os\nimport os.path\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef findIt(program, env):\n    # First search in the SCons path and then the OS path:\n    borwin = env.WhereIs(program) or SCons.Util.WhereIs(program)\n    if borwin:\n        dir = os.path.dirname(borwin)\n        env.PrependENVPath('PATH', dir)\n    return borwin\n\ndef generate(env):\n    findIt('bcc32', env)\n    \"\"\"Add Builders and construction variables for bcc to an\n    Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n    for suffix in ['.c', '.cpp']:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['CC']        = 'bcc32'\n    env['CCFLAGS']   = SCons.Util.CLVar('')\n    env['CFLAGS']   = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -q $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -WD $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.dll'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n    env['CFILESUFFIX'] = '.cpp'\n\ndef exists(env):\n    return findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py",
    "content": "\"\"\"SCons.Tool.c++\n\nTool-specific initialization for generic Posix C++ compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.cxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py",
    "content": "\"\"\"SCons.Tool.cc\n\nTool-specific initialization for generic Posix C compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool\nimport SCons.Defaults\nimport SCons.Util\n\nCSuffixes = ['.c', '.m']\nif not SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CSuffixes.append('.C')\n\ndef add_common_cc_variables(env):\n    \"\"\"\n    Add underlying common \"C compiler\" variables that\n    are used by multiple tools (specifically, c++).\n    \"\"\"\n    if '_CCCOMCOM' not in env:\n        env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS'\n        # It's a hack to test for darwin here, but the alternative\n        # of creating an applecc.py to contain this seems overkill.\n        # Maybe someday the Apple platform will require more setup and\n        # this logic will be moved.\n        env['FRAMEWORKS'] = SCons.Util.CLVar('')\n        env['FRAMEWORKPATH'] = SCons.Util.CLVar('')\n        if env['PLATFORM'] == 'darwin':\n            env['_CCCOMCOM'] = env['_CCCOMCOM'] + ' $_FRAMEWORKPATH'\n\n    if 'CCFLAGS' not in env:\n        env['CCFLAGS']   = SCons.Util.CLVar('')\n\n    if 'SHCCFLAGS' not in env:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n\ncompilers = ['cc']\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for C compilers to an Environment.\n    \"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    add_common_cc_variables(env)\n\n    if 'CC' not in env:\n        env['CC']    = env.Detect(compilers) or compilers[0]\n    env['CFLAGS']    = SCons.Util.CLVar('')\n    env['CCCOM']     = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCC']      = '$CC'\n    env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']   = '$SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CFILESUFFIX'] = '.c'\n\ndef exists(env):\n    return env.Detect(env.get('CC', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool-specific initialization for clang.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n# Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool.\n# Brought into the SCons mainline by Russel Winder 2017.\n\nimport os\nimport re\nimport subprocess\n\nimport SCons.Util\nimport SCons.Tool.cc\nfrom SCons.Tool.clangCommon import get_clang_install_dirs\nfrom SCons.Tool.MSCommon import msvc_setup_env_once\n\n\ncompilers = ['clang']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for clang to an Environment.\"\"\"\n    SCons.Tool.cc.generate(env)\n\n    if env['PLATFORM'] == 'win32':\n        # Ensure that we have a proper path for clang\n        clang = SCons.Tool.find_program_path(env, compilers[0], \n                                             default_paths=get_clang_install_dirs(env['PLATFORM']))\n        if clang:\n            clang_bin_dir = os.path.dirname(clang)\n            env.AppendENVPath('PATH', clang_bin_dir)\n\n            # Set-up ms tools paths\n            msvc_setup_env_once(env)\n\n\n    env['CC'] = env.Detect(compilers) or 'clang'\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    else:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')\n\n    # determine compiler version\n    if env['CC']:\n        #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],\n        pipe = SCons.Action._subproc(env, [env['CC'], '--version'],\n                                     stdin='devnull',\n                                     stderr='devnull',\n                                     stdout=subprocess.PIPE)\n        if pipe.wait() != 0: return\n        # clang -dumpversion is of no use\n        with pipe.stdout:\n            line = pipe.stdout.readline()\n        line = line.decode()\n        match = re.search(r'clang +version +([0-9]+(?:\\.[0-9]+)+)', line)\n        if match:\n            env['CCVERSION'] = match.group(1)\n\ndef exists(env):\n    return env.Detect(compilers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py",
    "content": "\"\"\"\nCommon routines and data for clang tools\n\"\"\"\n\nclang_win32_dirs = [\n    r'C:\\Program Files\\LLVM\\bin',\n    r'C:\\cygwin64\\bin',\n    r'C:\\msys64',\n    r'C:\\msys64\\mingw64\\bin',\n    r'C:\\cygwin\\bin',\n    r'C:\\msys',\n]\n\ndef get_clang_install_dirs(platform):\n    if platform == 'win32':\n        return clang_win32_dirs\n    else:\n        return []"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool-specific initialization for clang++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n# Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool.\n# Brought into the SCons mainline by Russel Winder 2017.\n\nimport os.path\nimport re\nimport subprocess\n\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Tool.cxx\nfrom SCons.Tool.clangCommon import get_clang_install_dirs\nfrom SCons.Tool.MSCommon import msvc_setup_env_once\n\n\ncompilers = ['clang++']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for clang++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    SCons.Tool.cxx.generate(env)\n\n    env['CXX']        = env.Detect(compilers) or 'clang++'\n\n    # platform specific settings\n    if env['PLATFORM'] == 'aix':\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')\n        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n        env['SHOBJSUFFIX'] = '$OBJSUFFIX'\n    elif env['PLATFORM'] == 'hpux':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'sunos':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'win32':\n        # Ensure that we have a proper path for clang++\n        clangxx = SCons.Tool.find_program_path(env, compilers[0], default_paths=get_clang_install_dirs(env['PLATFORM']))\n        if clangxx:\n            clangxx_bin_dir = os.path.dirname(clangxx)\n            env.AppendENVPath('PATH', clangxx_bin_dir)\n\n            # Set-up ms tools paths\n            msvc_setup_env_once(env)\n\n\n    # determine compiler version\n    if env['CXX']:\n        pipe = SCons.Action._subproc(env, [env['CXX'], '--version'],\n                                     stdin='devnull',\n                                     stderr='devnull',\n                                     stdout=subprocess.PIPE)\n        if pipe.wait() != 0: \n            return\n        \n        # clang -dumpversion is of no use\n        with pipe.stdout:\n            line = pipe.stdout.readline()\n        line = line.decode()\n        match = re.search(r'clang +version +([0-9]+(?:\\.[0-9]+)+)', line)\n        if match:\n            env['CXXVERSION'] = match.group(1)\n\ndef exists(env):\n    return env.Detect(compilers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py",
    "content": "\"\"\"SCons.Tool.c++\n\nTool-specific initialization for generic Posix C++ compilers.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os.path\n\nimport SCons.Defaults\nimport SCons.Util\n\ncompilers = ['CC', 'c++']\n\nCXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']\nif SCons.Util.case_sensitive_suffixes('.c', '.C'):\n    CXXSuffixes.append('.C')\n\ndef iscplusplus(source):\n    if not source:\n        # Source might be None for unusual cases like SConf.\n        return 0\n    for s in source:\n        if s.sources:\n            ext = os.path.splitext(str(s.sources[0]))[1]\n            if ext in CXXSuffixes:\n                return 1\n    return 0\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age C++ compilers\n    to an Environment.\n    \"\"\"\n    import SCons.Tool\n    import SCons.Tool.cc\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    SCons.Tool.cc.add_common_cc_variables(env)\n\n    if 'CXX' not in env:\n        env['CXX']    = env.Detect(compilers) or compilers[0]\n    env['CXXFLAGS']   = SCons.Util.CLVar('')\n    env['CXXCOM']     = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'\n\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n    env['SHOBJSUFFIX'] = '.os'\n    env['OBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0\n\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect(env.get('CXX', compilers))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py",
    "content": "\"\"\"SCons.Tool.cyglink\n\nCustomization of gnulink for Cygwin (http://www.cygwin.com/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nfrom SCons.Tool.linkCommon import StringizeLibSymlinks, EmitLibSymlinks\nfrom SCons.Util import CLVar, is_String\nfrom . import gnulink\n\n\ndef cyglink_lib_emitter(target, source, env, **kw):\n    verbose = True\n\n    if 'variable_prefix' in kw:\n        var_prefix = kw['variable_prefix']\n    else:\n        var_prefix = 'SHLIB'\n\n    no_import_lib = env.get('no_import_lib', False)\n\n    if verbose:\n        print(\"cyglink_lib_emitter: target[0]={!r}\".format(target[0].get_path()))\n\n    if not no_import_lib:\n        # Specify import lib and add to targets\n\n        import_lib = env.subst('$%s_IMPLIBNAME' % var_prefix, target=target, source=source)\n        import_lib_target = env.fs.File(import_lib)\n        import_lib_target.attributes.shared = 1\n        target.append(import_lib_target)\n\n        if verbose:\n            print(\"cyglink_lib_emitter: import_lib={}\".format(import_lib))\n            print(\"cyglink_lib_emitter: target=%s\" % target)\n\n    for tgt in target:\n        if is_String(tgt):\n            tgt = env.File(tgt)\n        tgt.attributes.shared = 1\n\n    return target, source\n\n\ndef cyglink_ldmodule_emitter(target, source, env, **kw):\n    return cyglink_lib_emitter(target, source, env, variable_prefix='LDMODULE')\n\n\ndef cyglink_shlib_symlink_emitter(target, source, env, **kw):\n    \"\"\"\n    On cygwin, we only create a symlink from the non-versioned implib to the versioned implib.\n    We don't version the shared library itself.\n    :param target:\n    :param source:\n    :param env:\n    :param kw:\n    :return:\n    \"\"\"\n    verbose = True\n\n    if 'variable_prefix' in kw:\n        var_prefix = kw['variable_prefix']\n    else:\n        var_prefix = 'SHLIB'\n\n    no_import_lib = env.get('no_import_lib', False)\n    if no_import_lib in ['1', 'True', 'true', True]:\n        if verbose:\n            print(\"cyglink_shlib_symlink_emitter: no_import_lib=%s\" % no_import_lib)\n        return target, source\n\n    no_symlinks = env.subst('$%sNOVERSIONSYMLINKS' % var_prefix)\n    if no_symlinks in ['1', 'True', 'true', True]:\n        return target, source\n\n    shlibversion = env.subst('$%sVERSION' % var_prefix)\n    if shlibversion:\n        if verbose:\n            print(\"cyglink_shlib_symlink_emitter: %sVERSION=%s\" % (var_prefix, shlibversion))\n\n        # The implib (added by the cyglink_lib_emitter)\n        imp_lib_node = target[1]\n        shlib_noversion_symlink = env.subst('$%s_NOVERSION_SYMLINK' % var_prefix, target=target[0], source=source)\n\n        if verbose:\n            print(\"cyglink_shlib_symlink_emitter: shlib_noversion_symlink :%s\" % shlib_noversion_symlink)\n            print(\"cyglink_shlib_symlink_emitter: imp_lib_node            :%s\" % imp_lib_node)\n\n        symlinks = [(env.File(shlib_noversion_symlink), imp_lib_node)]\n\n        if verbose:\n            print(\"cyglink_shlib_symlink_emitter: symlinks={!r}\".format(\n                ', '.join([\"%r->%r\" % (k, v) for k, v in StringizeLibSymlinks(symlinks)])\n            ))\n\n        if symlinks:\n            # This does the actual symlinking\n            EmitLibSymlinks(env, symlinks, target[0])\n\n            # This saves the information so if the versioned shared library is installed\n            # it can faithfully reproduce the correct symlinks\n            target[0].attributes.shliblinks = symlinks\n\n    return target, source\n\n\ndef cyglink_ldmod_symlink_emitter(target, source, env, **kw):\n    return cyglink_shlib_symlink_emitter(target, source, env, variable_prefix='LDMODULE')\n\n\ndef cyglink_shlibversion(target, source, env, for_signature):\n    var_prefix = 'SHLIB'\n    var = '%sVERSION' % var_prefix\n    if var not in env:\n        return ''\n\n    version = env.subst(\"$%s\" % var, target=target, source=source)\n    version = version.replace('.', '-')\n    return \".\" + version\n\n\ndef cyglink_ldmodule_version(target, source, env, for_signature):\n    var_prefix = 'LDMODULE'\n    var = '%sVERSION' % var_prefix\n    if var not in env:\n        return ''\n\n    version = env.subst(\"$%s\" % var, target=target, source=source)\n    version = version.replace('.', '-')\n    return \".\" + version\n\n\ndef _implib_pre_flags(target, source, env, for_signature):\n    no_import_lib = env.get('no_import_lib', False)\n    if no_import_lib in ['1', 'True', 'true', True]:\n        return ''\n    else:\n        return '-Wl,--out-implib=${TARGETS[1]} -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'\n\n\ndef _implib_post_flags(target, source, env, for_signature):\n    no_import_lib = env.get('no_import_lib', False)\n    if no_import_lib in ['1', 'True', 'true', True]:\n        return ''\n    else:\n        return '-Wl,--no-whole-archive'\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for cyglink to an Environment.\"\"\"\n    gnulink.generate(env)\n\n    env['LINKFLAGS'] = CLVar('-Wl,-no-undefined')\n\n    env['SHLIBPREFIX'] = 'cyg'\n    env['SHLIBSUFFIX'] = '.dll'\n\n    env['IMPLIBPREFIX'] = 'lib'\n    env['IMPLIBSUFFIX'] = '.dll.a'\n\n    # Variables used by versioned shared libraries\n    # SHLIBVERSIONFLAGS and LDMODULEVERSIONFLAGS are same as in gnulink...\n    env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'\n    env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS'\n\n    env['_IMPLIB_PRE_SOURCES'] = _implib_pre_flags\n    env['_IMPLIB_POST_SOURCES'] = _implib_post_flags\n    env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH ' \\\n                       '$_IMPLIB_PRE_SOURCES $SOURCES  $_IMPLIB_POST_SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $SHLINKFLAGS $__LDMODULEVERSIONFLAGS $__RPATH ' \\\n                         '$_IMPLIB_PRE_SOURCES $SOURCES $_IMPLIB_POST_SOURCES $_LIBDIRFLAGS  $_LIBFLAGS'\n\n    # Overwrite emitters. Cyglink does things differently when creating symlinks\n    env['SHLIBEMITTER'] = [cyglink_lib_emitter, cyglink_shlib_symlink_emitter]\n    env['LDMODULEEMITTER'] = [cyglink_ldmodule_emitter, cyglink_ldmod_symlink_emitter]\n\n    # This is the non versioned shlib filename\n    # If SHLIBVERSION is defined then this will symlink to $SHLIBNAME\n    env['SHLIB_NOVERSION_SYMLINK'] = '${IMPLIBPREFIX}$_get_shlib_stem${IMPLIBSUFFIX}'\n    env['LDMODULE_NOVERSION_SYMLINK'] = '${IMPLIBPREFIX}$_get_ldmodule_stem${IMPLIBSUFFIX}'\n\n    env['SHLIB_IMPLIBNAME'] = '${IMPLIBPREFIX}$_get_shlib_stem${_SHLIB_IMPLIBSUFFIX}'\n    env['LDMODULE_IMPLIBNAME'] = '${IMPLIBPREFIX}$_get_ldmodule_stem${_LDMODULE_IMPLIBSUFFIX}'\n\n    env['_cyglink_shlibversion'] = cyglink_shlibversion\n    env['_SHLIB_IMPLIBSUFFIX'] = '${_cyglink_shlibversion}${IMPLIBSUFFIX}'\n    env['_SHLIBSUFFIX'] = '${_cyglink_shlibversion}${SHLIBSUFFIX}'\n\n    env['_cyglink_ldmodule_version'] = cyglink_ldmodule_version\n\n    env['_LDMODULESUFFIX'] = '${_cyglink_ldmodule_version}${LDMODULESUFFIX}'\n    env['_LDMODULE_IMPLIBSUFFIX'] = '${_cyglink_ldmodule_version}${IMPLIBSUFFIX}'\n\n    # Remove variables set by default initialization which aren't needed/used by cyglink\n    # these variables were set by gnulink but are not used in cyglink\n    for rv in ['_SHLIBSONAME', '_LDMODULESONAME']:\n        if rv in env:\n            del env[rv]\n\n\ndef exists(env):\n    return gnulink.exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py",
    "content": "\"\"\"SCons.Tool.default\n\nInitialization with a default tool list.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool\n\ndef generate(env):\n    \"\"\"Add default tools.\"\"\"\n    for t in SCons.Tool.tool_list(env['PLATFORM'], env):\n        SCons.Tool.Tool(t)(env)\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py",
    "content": "\"\"\"SCons.Tool.filesystem\n\nTool-specific initialization for the filesystem tools.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons\nfrom SCons.Tool.install import copyFunc\n\ncopyToBuilder, copyAsBuilder = None, None\n\ndef copyto_emitter(target, source, env):\n    \"\"\" changes the path of the source to be under the target (which\n    are assumed to be directories.\n    \"\"\"\n    n_target = []\n\n    for t in target:\n        n_target = n_target + [t.File( str( s ) ) for s in source]\n\n    return (n_target, source)\n\ndef copy_action_func(target, source, env):\n    assert( len(target) == len(source) ), \"\\ntarget: %s\\nsource: %s\" %(list(map(str, target)),list(map(str, source)))\n\n    for t, s in zip(target, source):\n        if copyFunc(t.get_path(), s.get_path(), env):\n            return 1\n\n    return 0\n\ndef copy_action_str(target, source, env):\n    return env.subst_target_source(env['COPYSTR'], 0, target, source)\n\ncopy_action = SCons.Action.Action( copy_action_func, copy_action_str )\n\ndef generate(env):\n    try:\n        env['BUILDERS']['CopyTo']\n        env['BUILDERS']['CopyAs']\n    except KeyError as e:\n        global copyToBuilder\n        if copyToBuilder is None:\n            copyToBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Dir,\n                             source_factory = env.fs.Entry,\n                             multi          = 1,\n                             emitter        = [ copyto_emitter, ] )\n\n        global copyAsBuilder\n        if copyAsBuilder is None:\n            copyAsBuilder = SCons.Builder.Builder(\n                             action         = copy_action,\n                             target_factory = env.fs.Entry,\n                             source_factory = env.fs.Entry )\n\n        env['BUILDERS']['CopyTo'] = copyToBuilder\n        env['BUILDERS']['CopyAs'] = copyAsBuilder\n\n        env['COPYSTR'] = 'Copy file(s): \"$SOURCES\" to \"$TARGETS\"'\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py",
    "content": "\"\"\"SCons.Tool.g++\n\nTool-specific initialization for g++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.gxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py",
    "content": "\"\"\"SCons.Tool.gas\n\nTool-specific initialization for as, the Gnu assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\ntry:\n    as_module = __import__('as', globals(), locals(), [])\nexcept:\n    as_module = __import__(__package__+'.as', globals(), locals(), ['*'])\n\nassemblers = ['as', 'gas']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for as to an Environment.\"\"\"\n    as_module.generate(env)\n\n    env['AS']        = env.Detect(assemblers) or 'as'\n\ndef exists(env):\n    return env.Detect(assemblers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for gcc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nfrom . import cc\nimport re\nimport subprocess\n\nimport SCons.Util\n\ncompilers = ['gcc', 'cc']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n\n    if 'CC' not in env:\n        env['CC'] = env.Detect(compilers) or compilers[0]\n\n    cc.generate(env)\n\n    if env['PLATFORM'] in ['cygwin', 'win32']:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    else:\n        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')\n    # determine compiler version\n    version = detect_version(env, env['CC'])\n    if version:\n        env['CCVERSION'] = version\n\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return detect_version(env, env.Detect(env.get('CC', compilers)))\n\n\ndef detect_version(env, cc):\n    \"\"\"Return the version of the GNU compiler, or None if it is not a GNU compiler.\"\"\"\n    version = None\n    cc = env.subst(cc)\n    if not cc:\n        return version\n\n    # -dumpversion was added in GCC 3.0.  As long as we're supporting\n    # GCC versions older than that, we should use --version and a\n    # regular expression.\n    # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],\n    pipe=SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],\n                                 stdin='devnull',\n                                 stderr='devnull',\n                                 stdout=subprocess.PIPE)\n    if pipe.wait() != 0:\n        return version\n\n    with pipe.stdout:\n        # -dumpversion variant:\n        # line = pipe.stdout.read().strip()\n        # --version variant:\n        line = SCons.Util.to_str(pipe.stdout.readline())\n        # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer:\n        # So continue with reading to let the child process actually terminate.\n        # We don't need to know the rest of the data, so don't bother decoding.\n        while pipe.stdout.readline():\n            pass\n\n\n    # -dumpversion variant:\n    # if line:\n    #     version = line\n    # --version variant:\n    match = re.search(r'[0-9]+(\\.[0-9]+)+', line)\n    if match:\n        version = match.group(0)\n\n    return version\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"gettext tool\"\"\"\n\nimport sys\nimport os\n\nimport SCons.Tool\nimport SCons.Warnings\nfrom SCons.Errors import StopError\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import (\n    _msgfmt_exists,\n    _msginit_exists,\n    _msgmerge_exists,\n    tool_list,\n    _translate,\n    _xgettext_exists,\n)\n\ndef generate(env, **kw):\n    for t in tool_list(env['PLATFORM'], env):\n        if sys.platform == 'win32':\n            tool = SCons.Tool.find_program_path(\n                env, t, default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS\n            )\n            if tool:\n                tool_bin_dir = os.path.dirname(tool)\n                env.AppendENVPath('PATH', tool_bin_dir)\n            else:\n                SCons.Warnings.warn(\n                    SCons.Warnings.SConsWarning,\n                    t + ' tool requested, but binary not found in ENV PATH',\n                )\n        env.Tool(t)\n    env.AddMethod(_translate, 'Translate')\n\ndef exists(env):\n    try:\n        return (\n            _xgettext_exists(env)\n            and _msginit_exists(env)\n            and _msgmerge_exists(env)\n            and _msgfmt_exists(env)\n        )\n    except StopError:\n        return False\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py",
    "content": "#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\"\"\"SCons.Tool.gnulink\n\nTool-specific initialization for the gnu linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport SCons.Tool.linkCommon\nimport SCons.Util\nimport SCons.Tool\n\nfrom . import link\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    link.generate(env)\n\n    if env['PLATFORM'] == 'hpux':\n        env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared -fPIC')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-Wl,-rpath='\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\n\ndef exists(env):\n    # TODO: sync with link.smart_link() to choose a linker\n    linkers = {'CXX': ['g++'], 'CC': ['gcc']}\n    alltools = []\n    for langvar, linktools in linkers.items():\n        if langvar in env:  # use CC over CXX when user specified CC but not CXX\n            return SCons.Tool.FindTool(linktools, env)\n        alltools.extend(linktools)\n    return SCons.Tool.FindTool(alltools, env)  # find CXX or CC\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py",
    "content": "\"\"\"SCons.Tool.g++\n\nTool-specific initialization for g++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\nimport SCons.Tool\nimport SCons.Util\n\nfrom . import gcc\nfrom . import cxx\n\ncompilers = ['g++']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    if 'CXX' not in env:\n        env['CXX'] = env.Detect(compilers) or compilers[0]\n\n    cxx.generate(env)\n\n    # platform specific settings\n    if env['PLATFORM'] == 'aix':\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')\n        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n        env['SHOBJSUFFIX'] = '$OBJSUFFIX'\n    elif env['PLATFORM'] == 'hpux':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    elif env['PLATFORM'] == 'sunos':\n        env['SHOBJSUFFIX'] = '.pic.o'\n    # determine compiler version\n    version = gcc.detect_version(env, env['CXX'])\n    if version:\n        env['CXXVERSION'] = version\n\n\ndef exists(env):\n    # is executable, and is a GNU compiler (or accepts '--version' at least)\n    return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py",
    "content": "\"\"\"SCons.Tool.hpc++\n\nTool-specific initialization for c++ on HP/UX.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.hpcxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py",
    "content": "\"\"\"SCons.Tool.hpcc\n\nTool-specific initialization for HP aCC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Util\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for aCC & cc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'aCC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS +Z')\n\ndef exists(env):\n    return env.Detect('aCC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py",
    "content": "\"\"\"SCons.Tool.hpc++\n\nTool-specific initialization for c++ on HP/UX.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os.path\n\nimport SCons.Util\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\n\nacc = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    cc = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(cc):\n        acc = cc\n        break\n\n        \ndef generate(env):\n    \"\"\"Add Builders and construction variables for g++ to an Environment.\"\"\"\n    cplusplus.generate(env)\n\n    if acc:\n        env['CXX']        = acc or 'aCC'\n        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n        # determine version of aCC\n        with os.popen(acc + ' -V 2>&1') as p:\n            line = p.readline().rstrip()\n        if line.find('aCC: HP ANSI C++') == 0:\n            env['CXXVERSION'] = line.split()[-1]\n\n        if env['PLATFORM'] == 'cygwin':\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n        else:\n            env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')\n\ndef exists(env):\n    return acc\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py",
    "content": "\"\"\"SCons.Tool.hplink\n\nTool-specific initialization for the HP linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os.path\n\nimport SCons.Util\n\nfrom . import link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor dir in dirs:\n    linker = '/opt/' + dir + '/bin/aCC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Visual Age linker to\n    an Environment.\n    \"\"\"\n    link.generate(env)\n    \n    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,+s -Wl,+vnocompatwarnings')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -b')\n    env['SHLIBSUFFIX'] = '.sl'\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py",
    "content": "\"\"\"SCons.Tool.icc\n\nTool-specific initialization for the OS/2 icc compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the OS/2 to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CC']         = 'icc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\ndef exists(env):\n    return env.Detect('icc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py",
    "content": "\"\"\"SCons.Tool.icl\n\nTool-specific initialization for the Intel C/C++ compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool.intelc\n\n# This has been completely superseded by intelc.py, which can\n# handle both Windows and Linux versions.\n\ndef generate(*args, **kw):\n    \"\"\"Add Builders and construction variables for icl to an Environment.\"\"\"\n    return SCons.Tool.intelc.generate(*args, **kw)\n\ndef exists(*args, **kw):\n    return SCons.Tool.intelc.exists(*args, **kw)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py",
    "content": "\"\"\"SCons.Tool.ilink\n\nTool-specific initialization for the OS/2 ilink linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ilink to an Environment.\"\"\"\n    SCons.Tool.createProgBuilder(env)\n    \n    env['LINK']        = 'ilink'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK $LINKFLAGS /O:$TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX']='/LIBPATH:'\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\ndef exists(env):\n    return env.Detect('ilink')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py",
    "content": "\"\"\"SCons.Tool.ilink32\n\nXXX\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Borland ilink to an\n    Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['LINK']        = '$CC'\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '$LINK -q $LINKFLAGS -e$TARGET $SOURCES $LIBS'\n    env['LIBDIRPREFIX']=''\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']=''\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n\ndef exists(env):\n    # Uses bcc32 to do linking as it generally knows where the standard\n    # LIBS are and set up the linking correctly\n    return SCons.Tool.bcc32.findIt('bcc32', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\" Tool-specific initialization for the install tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nimport os\nimport stat\nfrom shutil import copy2, copystat\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Util\nfrom SCons.Subst import SUBST_RAW\nfrom SCons.Tool.linkCommon import (\n    StringizeLibSymlinks,\n    CreateLibSymlinks,\n    EmitLibSymlinks,\n)\n\n# We keep track of *all* installed files.\n_INSTALLED_FILES = []\n_UNIQUE_INSTALLED_FILES = None\n\nclass CopytreeError(OSError):\n    pass\n\n\ndef scons_copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,\n                   ignore_dangling_symlinks=False, dirs_exist_ok=False):\n    \"\"\"Recursively copy a directory tree, SCons version.\n\n    This is a modified copy of the Python 3.7 shutil.copytree function.\n    SCons update: dirs_exist_ok dictates whether to raise an\n    exception in case dst or any missing parent directory already\n    exists. Implementation depends on os.makedirs having a similar\n    flag, which it has since Python 3.2.  This version also raises an\n    SCons-defined exception rather than the one defined locally to shtuil.\n    This version uses a change from Python 3.8.\n    TODO: we can remove this forked copy once the minimum Py version is 3.8.\n\n    If exception(s) occur, an Error is raised with a list of reasons.\n\n    If the optional symlinks flag is true, symbolic links in the\n    source tree result in symbolic links in the destination tree; if\n    it is false, the contents of the files pointed to by symbolic\n    links are copied. If the file pointed by the symlink doesn't\n    exist, an exception will be added in the list of errors raised in\n    an Error exception at the end of the copy process.\n\n    You can set the optional ignore_dangling_symlinks flag to true if you\n    want to silence this exception. Notice that this has no effect on\n    platforms that don't support os.symlink.\n\n    The optional ignore argument is a callable. If given, it\n    is called with the `src` parameter, which is the directory\n    being visited by copytree(), and `names` which is the list of\n    `src` contents, as returned by os.listdir():\n\n        callable(src, names) -> ignored_names\n\n    Since copytree() is called recursively, the callable will be\n    called once for each directory that is copied. It returns a\n    list of names relative to the `src` directory that should\n    not be copied.\n\n    The optional copy_function argument is a callable that will be used\n    to copy each file. It will be called with the source path and the\n    destination path as arguments. By default, copy2() is used, but any\n    function that supports the same signature (like copy()) can be used.\n\n    \"\"\"\n    names = os.listdir(src)\n    if ignore is not None:\n        ignored_names = ignore(src, names)\n    else:\n        ignored_names = set()\n\n    os.makedirs(dst, exist_ok=dirs_exist_ok)\n    errors = []\n    for name in names:\n        if name in ignored_names:\n            continue\n        srcname = os.path.join(src, name)\n        dstname = os.path.join(dst, name)\n        try:\n            if os.path.islink(srcname):\n                linkto = os.readlink(srcname)\n                if symlinks:\n                    # We can't just leave it to `copy_function` because legacy\n                    # code with a custom `copy_function` may rely on copytree\n                    # doing the right thing.\n                    os.symlink(linkto, dstname)\n                    copystat(srcname, dstname, follow_symlinks=not symlinks)\n                else:\n                    # ignore dangling symlink if the flag is on\n                    if not os.path.exists(linkto) and ignore_dangling_symlinks:\n                        continue\n                    # otherwise let the copy occurs. copy2 will raise an error\n                    if os.path.isdir(srcname):\n                        scons_copytree(srcname, dstname, symlinks=symlinks,\n                                       ignore=ignore, copy_function=copy_function,\n                                       ignore_dangling_symlinks=ignore_dangling_symlinks,\n                                       dirs_exist_ok=dirs_exist_ok)\n                    else:\n                        copy_function(srcname, dstname)\n            elif os.path.isdir(srcname):\n                scons_copytree(srcname, dstname, symlinks=symlinks,\n                               ignore=ignore, copy_function=copy_function,\n                               ignore_dangling_symlinks=ignore_dangling_symlinks,\n                               dirs_exist_ok=dirs_exist_ok)\n            else:\n                # Will raise a SpecialFileError for unsupported file types\n                copy_function(srcname, dstname)\n        # catch the Error from the recursive copytree so that we can\n        # continue with other files\n        except CopytreeError as err:  # SCons change\n            errors.extend(err.args[0])\n        except OSError as why:\n            errors.append((srcname, dstname, str(why)))\n    try:\n        copystat(src, dst)\n    except OSError as why:\n        # Copying file access times may fail on Windows\n        if getattr(why, 'winerror', None) is None:\n            errors.append((src, dst, str(why)))\n    if errors:\n        raise CopytreeError(errors)  # SCons change\n    return dst\n\n#\n# Functions doing the actual work of the Install Builder.\n#\ndef copyFunc(dest, source, env) -> int:\n    \"\"\"Install a source file or directory into a destination by copying.\n\n    Mode/permissions bits will be copied as well, except that the target\n    will be made writable.\n\n    Returns:\n        POSIX-style error code - 0 for success, non-zero for fail\n    \"\"\"\n    if os.path.isdir(source):\n        if os.path.exists(dest):\n            if not os.path.isdir(dest):\n                raise SCons.Errors.UserError(\"cannot overwrite non-directory `%s' with a directory `%s'\" % (str(dest), str(source)))\n        else:\n            parent = os.path.split(dest)[0]\n            if not os.path.exists(parent):\n                os.makedirs(parent)\n        scons_copytree(source, dest, dirs_exist_ok=True)\n    else:\n        copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n\n    return 0\n\n#\n# Functions doing the actual work of the InstallVersionedLib Builder.\n#\ndef copyFuncVersionedLib(dest, source, env) -> int:\n    \"\"\"Install a versioned library into a destination by copying.\n\n    Any required symbolic links for other library names are created.\n\n    Mode/permissions bits will be copied as well, except that the target\n    will be made writable.\n\n    Returns:\n        POSIX-style error code - 0 for success, non-zero for fail\n    \"\"\"\n    if os.path.isdir(source):\n        raise SCons.Errors.UserError(\"cannot install directory `%s' as a version library\" % str(source) )\n    else:\n        # remove the link if it is already there\n        try:\n            os.remove(dest)\n        except:\n            pass\n        copy2(source, dest)\n        st = os.stat(source)\n        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)\n        installShlibLinks(dest, source, env)\n\n    return 0\n\ndef listShlibLinksToInstall(dest, source, env):\n    install_links = []\n    source = env.arg2nodes(source)\n    dest = env.fs.File(dest)\n    install_dir = dest.get_dir()\n    for src in source:\n        symlinks = getattr(getattr(src, 'attributes', None), 'shliblinks', None)\n        if symlinks:\n            for link, linktgt in symlinks:\n                link_base = os.path.basename(link.get_path())\n                linktgt_base = os.path.basename(linktgt.get_path())\n                install_link = env.fs.File(link_base, install_dir)\n                install_linktgt = env.fs.File(linktgt_base, install_dir)\n                install_links.append((install_link, install_linktgt))\n    return install_links\n\ndef installShlibLinks(dest, source, env):\n    \"\"\"If we are installing a versioned shared library create the required links.\"\"\"\n    Verbose = False\n    symlinks = listShlibLinksToInstall(dest, source, env)\n    if Verbose:\n        print('installShlibLinks: symlinks={!r}'.format(StringizeLibSymlinks(symlinks)))\n    if symlinks:\n        CreateLibSymlinks(env, symlinks)\n    return\n\ndef installFunc(target, source, env) -> int:\n    \"\"\"Install a source file into a target.\n\n    Uses the function specified in the INSTALL construction variable.\n\n    Returns:\n        POSIX-style error code - 0 for success, non-zero for fail\n    \"\"\"\n\n    try:\n        install = env['INSTALL']\n    except KeyError:\n        raise SCons.Errors.UserError('Missing INSTALL construction variable.')\n\n    assert len(target) == len(source), (\n        \"Installing source %s into target %s: \"\n        \"target and source lists must have same length.\"\n        % (list(map(str, source)), list(map(str, target)))\n    )\n    for t, s in zip(target, source):\n        if install(t.get_path(), s.get_path(), env):\n            return 1\n\n    return 0\n\ndef installFuncVersionedLib(target, source, env) -> int:\n    \"\"\"Install a versioned library into a target.\n\n    Uses the function specified in the INSTALL construction variable.\n\n    Returns:\n        POSIX-style error code - 0 for success, non-zero for fail\n    \"\"\"\n\n    try:\n        install = env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        raise SCons.Errors.UserError(\n            'Missing INSTALLVERSIONEDLIB construction variable.'\n        )\n\n    assert len(target) == len(source), (\n        \"Installing source %s into target %s: \"\n        \"target and source lists must have same length.\"\n        % (list(map(str, source)), list(map(str, target)))\n    )\n    for t, s in zip(target, source):\n        if hasattr(t.attributes, 'shlibname'):\n            tpath = os.path.join(t.get_dir(), t.attributes.shlibname)\n        else:\n            tpath = t.get_path()\n        if install(tpath, s.get_path(), env):\n            return 1\n\n    return 0\n\ndef stringFunc(target, source, env):\n    installstr = env.get('INSTALLSTR')\n    if installstr:\n        return env.subst_target_source(installstr, SUBST_RAW, target, source)\n    target = str(target[0])\n    source = str(source[0])\n    if os.path.isdir(source):\n        type = 'directory'\n    else:\n        type = 'file'\n    return 'Install %s: \"%s\" as \"%s\"' % (type, source, target)\n\n#\n# Emitter functions\n#\ndef add_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" An emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    _INSTALLED_FILES.extend(target)\n\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\ndef add_versioned_targets_to_INSTALLED_FILES(target, source, env):\n    \"\"\" An emitter that adds all target files to the list stored in the\n    _INSTALLED_FILES global variable. This way all installed files of one\n    scons call will be collected.\n    \"\"\"\n    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES\n    Verbose = False\n    _INSTALLED_FILES.extend(target)\n    if Verbose:\n        print(\"add_versioned_targets_to_INSTALLED_FILES: target={!r}\".format(list(map(str, target))))\n    symlinks = listShlibLinksToInstall(target[0], source, env)\n    if symlinks:\n        EmitLibSymlinks(env, symlinks, target[0])\n    _UNIQUE_INSTALLED_FILES = None\n    return (target, source)\n\nclass DESTDIR_factory:\n    \"\"\" A node factory, where all files will be relative to the dir supplied\n    in the constructor.\n    \"\"\"\n    def __init__(self, env, dir):\n        self.env = env\n        self.dir = env.arg2nodes( dir, env.fs.Dir )[0]\n\n    def Entry(self, name):\n        name = SCons.Util.make_path_relative(name)\n        return self.dir.Entry(name)\n\n    def Dir(self, name):\n        name = SCons.Util.make_path_relative(name)\n        return self.dir.Dir(name)\n\n#\n# The Builder Definition\n#\ninstall_action       = SCons.Action.Action(installFunc, stringFunc)\ninstallas_action     = SCons.Action.Action(installFunc, stringFunc)\ninstallVerLib_action = SCons.Action.Action(installFuncVersionedLib, stringFunc)\n\nBaseInstallBuilder               = None\n\ndef InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            tgt.extend(BaseInstallBuilder(env, target, src, **kw))\n    return tgt\n\n\ndef InstallAsBuilderWrapper(env, target=None, source=None, **kw):\n    result = []\n    for src, tgt in map(lambda x, y: (x, y), source, target):\n        result.extend(BaseInstallBuilder(env, tgt, src, **kw))\n    return result\n\nBaseVersionedInstallBuilder = None\n\n\ndef InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw):\n    if target and dir:\n        import SCons.Errors\n        raise SCons.Errors.UserError(\"Both target and dir defined for Install(), only one may be defined.\")\n    if not dir:\n        dir=target\n\n    import SCons.Script\n    install_sandbox = SCons.Script.GetOption('install_sandbox')\n    if install_sandbox:\n        target_factory = DESTDIR_factory(env, install_sandbox)\n    else:\n        target_factory = env.fs\n\n    try:\n        dnodes = env.arg2nodes(dir, target_factory.Dir)\n    except TypeError:\n        raise SCons.Errors.UserError(\"Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?\" % str(dir))\n    sources = env.arg2nodes(source, env.fs.Entry)\n    tgt = []\n    for dnode in dnodes:\n        for src in sources:\n            # Prepend './' so the lookup doesn't interpret an initial\n            # '#' on the file name portion as meaning the Node should\n            # be relative to the top-level SConstruct directory.\n            target = env.fs.Entry('.'+os.sep+src.name, dnode)\n            tgt.extend(BaseVersionedInstallBuilder(env, target, src, **kw))\n    return tgt\n\nadded = None\n\n\ndef generate(env):\n\n    from SCons.Script import AddOption, GetOption\n    global added\n    if not added:\n        added = 1\n        AddOption('--install-sandbox',\n                  dest='install_sandbox',\n                  type=\"string\",\n                  action=\"store\",\n                  help='A directory under which all installed files will be placed.')\n\n    global BaseInstallBuilder\n    if BaseInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseInstallBuilder = SCons.Builder.Builder(\n                              action         = install_action,\n                              target_factory = target_factory.Entry,\n                              source_factory = env.fs.Entry,\n                              multi          = True,\n                              emitter        = [ add_targets_to_INSTALLED_FILES, ],\n                              source_scanner = SCons.Scanner.ScannerBase({}, name='Install', recursive=False),\n                              name           = 'InstallBuilder')\n\n    global BaseVersionedInstallBuilder\n    if BaseVersionedInstallBuilder is None:\n        install_sandbox = GetOption('install_sandbox')\n        if install_sandbox:\n            target_factory = DESTDIR_factory(env, install_sandbox)\n        else:\n            target_factory = env.fs\n\n        BaseVersionedInstallBuilder = SCons.Builder.Builder(\n                                       action         = installVerLib_action,\n                                       target_factory = target_factory.Entry,\n                                       source_factory = env.fs.Entry,\n                                       multi          = True,\n                                       emitter        = [ add_versioned_targets_to_INSTALLED_FILES, ],\n                                       name           = 'InstallVersionedBuilder')\n\n    env['BUILDERS']['_InternalInstall'] = InstallBuilderWrapper\n    env['BUILDERS']['_InternalInstallAs'] = InstallAsBuilderWrapper\n    env['BUILDERS']['_InternalInstallVersionedLib'] = InstallVersionedBuilderWrapper\n\n    # We'd like to initialize this doing something like the following,\n    # but there isn't yet support for a ${SOURCE.type} expansion that\n    # will print \"file\" or \"directory\" depending on what's being\n    # installed.  For now we punt by not initializing it, and letting\n    # the stringFunc() that we put in the action fall back to the\n    # hand-crafted default string if it's not set.\n    #\n    #try:\n    #    env['INSTALLSTR']\n    #except KeyError:\n    #    env['INSTALLSTR'] = 'Install ${SOURCE.type}: \"$SOURCES\" as \"$TARGETS\"'\n\n    try:\n        env['INSTALL']\n    except KeyError:\n        env['INSTALL'] = copyFunc\n\n    try:\n        env['INSTALLVERSIONEDLIB']\n    except KeyError:\n        env['INSTALLVERSIONEDLIB'] = copyFuncVersionedLib\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool-specific initialization for the Intel C/C++ compiler.\n\nSupports Linux and Windows compilers, v7 and up.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nimport glob\nimport math\nimport os.path\nimport re\nimport sys\n\nis_windows = sys.platform == 'win32'\nis_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or\n                           ('PROCESSOR_ARCHITEW6432' in os.environ and\n                            os.environ['PROCESSOR_ARCHITEW6432'] == 'AMD64'))\nis_linux = sys.platform.startswith('linux')\nis_mac     = sys.platform == 'darwin'\n\nif is_windows:\n    import SCons.Tool.msvc\nelif is_linux:\n    import SCons.Tool.gcc\nelif is_mac:\n    import SCons.Tool.gcc\nimport SCons.Util\nimport SCons.Warnings\n\n# Exceptions for this tool\nclass IntelCError(SCons.Errors.InternalError):\n    pass\nclass MissingRegistryError(IntelCError): # missing registry entry\n    pass\nclass MissingDirError(IntelCError):     # dir not found\n    pass\nclass NoRegistryModuleError(IntelCError): # can't read registry at all\n    pass\n\ndef linux_ver_normalize(vstr):\n    \"\"\"Normalize a Linux compiler version number.\n    Intel changed from \"80\" to \"9.0\" in 2005, so we assume if the number\n    is greater than 60 it's an old-style number and otherwise new-style.\n    Always returns an old-style float like 80 or 90 for compatibility with Windows.\n    Shades of Y2K!\"\"\"\n    # Check for version number like 9.1.026: return 91.026\n    # XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5)\n    m = re.match(r'([0-9]+)\\.([0-9]+)\\.([0-9]+)', vstr)\n    if m:\n        vmaj,vmin,build = m.groups()\n        return float(vmaj) * 10. + float(vmin) + float(build) / 1000.\n    else:\n        f = float(vstr)\n        if is_windows:\n            return f\n        else:\n            if f < 60: return f * 10.0\n            else: return f\n\ndef check_abi(abi):\n    \"\"\"Check for valid ABI (application binary interface) name,\n    and map into canonical one\"\"\"\n    if not abi:\n        return None\n    abi = abi.lower()\n    # valid_abis maps input name to canonical name\n    if is_windows:\n        valid_abis = {'ia32'  : 'ia32',\n                      'x86'   : 'ia32',\n                      'ia64'  : 'ia64',\n                      'em64t' : 'em64t',\n                      'amd64' : 'em64t'}\n    if is_linux:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64',\n                      'amd64'  : 'x86_64'}\n    if is_mac:\n        valid_abis = {'ia32'   : 'ia32',\n                      'x86'    : 'ia32',\n                      'x86_64' : 'x86_64',\n                      'em64t'  : 'x86_64'}\n    try:\n        abi = valid_abis[abi]\n    except KeyError:\n        raise SCons.Errors.UserError(\"Intel compiler: Invalid ABI %s, valid values are %s\"% \\\n              (abi, list(valid_abis.keys())))\n    return abi\n\ndef get_version_from_list(v, vlist):\n    \"\"\"See if we can match v (string) in vlist (list of strings)\n    Linux has to match in a fuzzy way.\"\"\"\n    if is_windows:\n        # Simple case, just find it in the list\n        if v in vlist: return v\n        else: return None\n    else:\n        # Fuzzy match: normalize version number first, but still return\n        # original non-normalized form.\n        fuzz = 0.001\n        for vi in vlist:\n            if math.fabs(linux_ver_normalize(vi) - linux_ver_normalize(v)) < fuzz:\n                return vi\n        # Not found\n        return None\n\ndef get_intel_registry_value(valuename, version=None, abi=None):\n    \"\"\"\n    Return a value from the Intel compiler registry tree. (Windows only)\n    \"\"\"\n    # Open the key:\n    if is_win64:\n        K = 'Software\\\\Wow6432Node\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    else:\n        K = 'Software\\\\Intel\\\\Compilers\\\\C++\\\\' + version + '\\\\'+abi.upper()\n    try:\n        k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n    except SCons.Util.RegError:\n        # For version 13 and later, check UUID subkeys for valuename\n        if is_win64:\n            K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        else:\n            K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\Defaults\\\\C++\\\\\" + abi.upper()\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            uuid = SCons.Util.RegQueryValueEx(k, 'SubKey')[0]\n\n            if is_win64:\n                K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            else:\n                K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\"\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                if abi.upper() == 'EM64T':\n                    abi = 'em64t_native'\n                if is_win64:\n                    K = 'Software\\\\Wow6432Node\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                else:\n                    K = 'Software\\\\Intel\\\\Suites\\\\' + version + \"\\\\\" + uuid + \"\\\\C++\\\\\" + abi.upper()\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n\n            try:\n                v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n            except SCons.Util.RegError:\n                raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n        except (SCons.Util.RegError, OSError):\n            raise MissingRegistryError(\"%s was not found in the registry, for Intel compiler version %s, abi='%s'\"%(K, version,abi))\n\n    # Get the value:\n    try:\n        v = SCons.Util.RegQueryValueEx(k, valuename)[0]\n        return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?\n    except SCons.Util.RegError:\n        raise MissingRegistryError(\"%s\\\\%s was not found in the registry.\"%(K, valuename))\n\n\ndef get_all_compiler_versions():\n    \"\"\"Returns a sorted list of strings, like \"70\" or \"80\" or \"9.0\"\n    with most recent compiler version first.\n    \"\"\"\n    versions=[]\n    if is_windows:\n        if is_win64:\n            keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Compilers\\\\C++'\n        else:\n            keyname = 'Software\\\\Intel\\\\Compilers\\\\C++'\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                        keyname)\n        except OSError:\n            # For version 13 or later, check for default instance UUID\n            if is_win64:\n                keyname = 'Software\\\\WoW6432Node\\\\Intel\\\\Suites'\n            else:\n                keyname = 'Software\\\\Intel\\\\Suites'\n            try:\n                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                                            keyname)\n            except OSError:\n                return []\n        i = 0\n        versions = []\n        try:\n            while i < 100:\n                subkey = SCons.Util.RegEnumKey(k, i) # raises SConsEnvironmentError\n                # Check that this refers to an existing dir.\n                # This is not 100% perfect but should catch common\n                # installation issues like when the compiler was installed\n                # and then the install directory deleted or moved (rather\n                # than uninstalling properly), so the registry values\n                # are still there.\n                if subkey == 'Defaults': # Ignore default instances\n                    i = i + 1\n                    continue\n                ok = False\n                for try_abi in ('IA32', 'IA32e',  'IA64', 'EM64T'):\n                    try:\n                        d = get_intel_registry_value('ProductDir', subkey, try_abi)\n                    except MissingRegistryError:\n                        continue  # not found in reg, keep going\n                    if os.path.exists(d): ok = True\n                if ok:\n                    versions.append(subkey)\n                else:\n                    try:\n                        # Registry points to nonexistent dir.  Ignore this\n                        # version.\n                        value = get_intel_registry_value('ProductDir', subkey, 'IA32')\n                    except MissingRegistryError as e:\n\n                        # Registry key is left dangling (potentially\n                        # after uninstalling).\n\n                        print(\"scons: *** Ignoring the registry key for the Intel compiler version %s.\\n\" \\\n                            \"scons: *** It seems that the compiler was uninstalled and that the registry\\n\" \\\n                            \"scons: *** was not cleaned up properly.\\n\" % subkey)\n                    else:\n                        print(\"scons: *** Ignoring \"+str(value))\n\n                i = i + 1\n        except EnvironmentError:\n            # no more subkeys\n            pass\n    elif is_linux or is_mac:\n        for d in glob.glob('/opt/intel_cc_*'):\n            # Typical dir here is /opt/intel_cc_80.\n            m = re.search(r'cc_(.*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/cc*/*'):\n            # Typical dir here is /opt/intel/cc/9.0 for IA32,\n            # /opt/intel/cce/9.0 for EMT64 (AMD64)\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/Compiler/*'):\n            # Typical dir here is /opt/intel/Compiler/11.1\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composerxe-*'):\n            # Typical dir here is /opt/intel/composerxe-2011.4.184\n            m = re.search(r'([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(m.group(1))\n        for d in glob.glob('/opt/intel/composer_xe_*'):\n            # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n            # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n            m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(\"%s.%s\"%(m.group(1), m.group(2)))\n        for d in glob.glob('/opt/intel/compilers_and_libraries_*'):\n            # JPA: For the new version of Intel compiler 2016.1.\n            m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n            if m:\n                versions.append(\"%s.%s\"%(m.group(1), m.group(2)))\n\n    def keyfunc(str):\n        \"\"\"Given a dot-separated version string, return a tuple of ints representing it.\"\"\"\n        return [int(x) for x in str.split('.')]\n    # split into ints, sort, then remove dups\n    return sorted(SCons.Util.unique(versions), key=keyfunc, reverse=True)\n\ndef get_intel_compiler_top(version, abi):\n    \"\"\"\n    Return the main path to the top-level dir of the Intel compiler,\n    using the given version.\n    The compiler will be in <top>/bin/icl.exe (icc on linux),\n    the include dir is <top>/include, etc.\n    \"\"\"\n\n    if is_windows:\n        if not SCons.Util.can_read_reg:\n            raise NoRegistryModuleError(\"No Windows registry module was found\")\n        top = get_intel_registry_value('ProductDir', version, abi)\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        # pre-11, icl was in Bin.  11 and later, it's in Bin/<abi> apparently.\n        if not os.path.exists(os.path.join(top, \"Bin\", \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", abi, \"icl.exe\")) \\\n              and not os.path.exists(os.path.join(top, \"Bin\", archdir, \"icl.exe\")):\n            raise MissingDirError(\"Can't find Intel compiler in %s\" % top)\n    elif is_mac or is_linux:\n        def find_in_2008style_dir(version):\n            # first dir is new (>=9.0) style, second is old (8.0) style.\n            dirs=('/opt/intel/cc/%s', '/opt/intel_cc_%s')\n            if abi == 'x86_64':\n                dirs=('/opt/intel/cce/%s',)  # 'e' stands for 'em64t', aka x86_64 aka amd64\n            top=None\n            for d in dirs:\n                if os.path.exists(os.path.join(d%version, \"bin\", \"icc\")):\n                    top = d%version\n                    break\n            return top\n        def find_in_2010style_dir(version):\n            dirs=('/opt/intel/Compiler/%s/*'%version)\n            # typically /opt/intel/Compiler/11.1/064 (then bin/intel64/icc)\n            dirs=glob.glob(dirs)\n            # find highest sub-version number by reverse sorting and picking first existing one.\n            dirs.sort()\n            dirs.reverse()\n            top=None\n            for d in dirs:\n                if (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                    os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                    top = d\n                    break\n            return top\n        def find_in_2011style_dir(version):\n            # The 2011 (compiler v12) dirs are inconsistent, so just redo the search from\n            # get_all_compiler_versions and look for a match (search the newest form first)\n            top=None\n            for d in glob.glob('/opt/intel/composer_xe_*'):\n                # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344\n                # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x\n                m = re.search(r'([0-9]{0,4})(?:_sp\\d*)?\\.([0-9][0-9.]*)$', d)\n                if m:\n                    cur_ver = \"%s.%s\"%(m.group(1), m.group(2))\n                    if cur_ver == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                        top = d\n                        break\n            if not top:\n                for d in glob.glob('/opt/intel/composerxe-*'):\n                    # Typical dir here is /opt/intel/composerxe-2011.4.184\n                    m = re.search(r'([0-9][0-9.]*)$', d)\n                    if m and m.group(1) == version and \\\n                        (os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or\n                        os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\"))):\n                            top = d\n                            break\n            return top\n        def find_in_2016style_dir(version):\n            # The 2016 (compiler v16) dirs are inconsistent from previous.\n            top = None\n            for d in glob.glob('/opt/intel/compilers_and_libraries_%s/linux'%version):\n                if os.path.exists(os.path.join(d, \"bin\", \"ia32\", \"icc\")) or os.path.exists(os.path.join(d, \"bin\", \"intel64\", \"icc\")):\n                    top = d\n                    break\n            return top\n\n        top = find_in_2016style_dir(version) or find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version)\n        # print \"INTELC: top=\",top\n        if not top:\n            raise MissingDirError(\"Can't find version %s Intel compiler in %s (abi='%s')\"%(version,top, abi))\n    return top\n\n\ndef generate(env, version=None, abi=None, topdir=None, verbose=0):\n    r\"\"\"Add Builders and construction variables for Intel C/C++ compiler\n    to an Environment.\n\n    Args:\n      version (str): compiler version to use, like \"80\"\n      abi (str): 'win32' or whatever Itanium version wants\n      topdir (str): directory containing compiler tree, e.g.\n        \"c:\\\\Program Files\\\\Intel\\\\Compiler70\".\n        If `topdir` is used, `version` and `abi` are ignored.\n      verbose: if >0, prints compiler version used.\n\n    \"\"\"\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return\n\n    if is_windows:\n        SCons.Tool.msvc.generate(env)\n    elif is_linux:\n        SCons.Tool.gcc.generate(env)\n    elif is_mac:\n        SCons.Tool.gcc.generate(env)\n\n    # if version is unspecified, use latest\n    vlist = get_all_compiler_versions()\n    if not version:\n        if vlist:\n            version = vlist[0]\n    else:\n        # User may have specified '90' but we need to get actual dirname '9.0'.\n        # get_version_from_list does that mapping.\n        v = get_version_from_list(version, vlist)\n        if not v:\n            raise SCons.Errors.UserError(\"Invalid Intel compiler version %s: \"%version + \\\n                  \"installed versions are %s\"%(', '.join(vlist)))\n        version = v\n\n    # if abi is unspecified, use ia32\n    # alternatives are ia64 for Itanium, or amd64 or em64t or x86_64 (all synonyms here)\n    abi = check_abi(abi)\n    if abi is None:\n        if is_mac or is_linux:\n            # Check if we are on 64-bit linux, default to 64 then.\n            uname_m = os.uname()[4]\n            if uname_m == 'x86_64':\n                abi = 'x86_64'\n            else:\n                abi = 'ia32'\n        else:\n            if is_win64:\n                abi = 'em64t'\n            else:\n                abi = 'ia32'\n\n    if version and not topdir:\n        try:\n            topdir = get_intel_compiler_top(version, abi)\n        except (SCons.Util.RegError, IntelCError):\n            topdir = None\n\n    if not topdir:\n        # Normally this is an error, but it might not be if the compiler is\n        # on $PATH and the user is importing their env.\n        class ICLTopDirWarning(SCons.Warnings.SConsWarning):\n            pass\n\n        if (\n            ((is_mac or is_linux) and not env.Detect('icc'))\n            or (is_windows and not env.Detect('icl'))\n        ):\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(\n                ICLTopDirWarning,\n                \"Failed to find Intel compiler for version='%s', abi='%s'\"\n                % (str(version), str(abi)),\n            )\n        else:\n            # should be cleaned up to say what this other version is\n            # since in this case we have some other Intel compiler installed\n            SCons.Warnings.enableWarningClass(ICLTopDirWarning)\n            SCons.Warnings.warn(\n                ICLTopDirWarning,\n                \"Can't find Intel compiler top dir for version='%s', abi='%s'\"\n                % (str(version), str(abi)),\n            )\n\n    if topdir:\n        archdir={'x86_64': 'intel64',\n                 'amd64' : 'intel64',\n                 'em64t' : 'intel64',\n                 'x86'   : 'ia32',\n                 'i386'  : 'ia32',\n                 'ia32'  : 'ia32'\n        }[abi] # for v11 and greater\n        if os.path.exists(os.path.join(topdir, 'bin', archdir)):\n            bindir=\"bin/%s\"%archdir\n            libdir=\"lib/%s\"%archdir\n        else:\n            bindir=\"bin\"\n            libdir=\"lib\"\n        if verbose:\n            print(\"Intel C compiler: using version %s (%g), abi %s, in '%s/%s'\"%\\\n                  (repr(version), linux_ver_normalize(version),abi,topdir,bindir))\n            if is_linux:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n            if is_mac:\n                # Show the actual compiler version by running the compiler.\n                os.system('%s/%s/icc --version'%(topdir,bindir))\n\n        env['INTEL_C_COMPILER_TOP'] = topdir\n        if is_linux:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p, v in paths.items():\n                env.PrependENVPath(p, os.path.join(topdir, v))\n        if is_mac:\n            paths={'INCLUDE'         : 'include',\n                   'LIB'             : libdir,\n                   'PATH'            : bindir,\n                   'LD_LIBRARY_PATH' : libdir}\n            for p, v in paths.items():\n                env.PrependENVPath(p, os.path.join(topdir, v))\n        if is_windows:\n            #       env key    reg valname   default subdir of top\n            paths=(('INCLUDE', 'IncludeDir', 'Include'),\n                   ('LIB'    , 'LibDir',     'Lib'),\n                   ('PATH'   , 'BinDir',     'Bin'))\n            # We are supposed to ignore version if topdir is set, so set\n            # it to the emptry string if it's not already set.\n            if version is None:\n                version = ''\n            # Each path has a registry entry, use that or default to subdir\n            for p in paths:\n                try:\n                    path=get_intel_registry_value(p[1], version, abi)\n                    # These paths may have $(ICInstallDir)\n                    # which needs to be substituted with the topdir.\n                    path=path.replace('$(ICInstallDir)', topdir + os.sep)\n                except IntelCError:\n                    # Couldn't get it from registry: use default subdir of topdir\n                    env.PrependENVPath(p[0], os.path.join(topdir, p[2]))\n                else:\n                    env.PrependENVPath(p[0], path.split(os.pathsep))\n                    # print \"ICL %s: %s, final=%s\"%(p[0], path, str(env['ENV'][p[0]]))\n\n    if is_windows:\n        env['CC']        = 'icl'\n        env['CXX']       = 'icl'\n        env['LINK']      = 'xilink'\n    else:\n        env['CC']        = 'icc'\n        env['CXX']       = 'icpc'\n        # Don't reset LINK here;\n        # use smart_link which should already be here from link.py.\n        #env['LINK']      = '$CC'\n        env['AR']        = 'xiar'\n        env['LD']        = 'xild' # not used by default\n\n    # This is not the exact (detailed) compiler version,\n    # just the major version as determined above or specified\n    # by the user.  It is a float like 80 or 90, in normalized form for Linux\n    # (i.e. even for Linux 9.0 compiler, still returns 90 rather than 9.0)\n    if version:\n        env['INTEL_C_COMPILER_VERSION']=linux_ver_normalize(version)\n\n    if is_windows:\n        # Look for license file dir\n        # in system environment, registry, and default location.\n        envlicdir = os.environ.get(\"INTEL_LICENSE_FILE\", '')\n        K = r'SOFTWARE\\Intel\\Licenses'\n        try:\n            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)\n            reglicdir = SCons.Util.RegQueryValueEx(k, \"w_cpp\")[0]\n        except (AttributeError, SCons.Util.RegError):\n            reglicdir = \"\"\n        defaultlicdir = r'C:\\Program Files\\Common Files\\Intel\\Licenses'\n\n        licdir = None\n        for ld in [envlicdir, reglicdir]:\n            # If the string contains an '@', then assume it's a network\n            # license (port@system) and good by definition.\n            if ld and (ld.find('@') != -1 or os.path.exists(ld)):\n                licdir = ld\n                break\n        if not licdir:\n            licdir = defaultlicdir\n            if not os.path.exists(licdir):\n                class ICLLicenseDirWarning(SCons.Warnings.SConsWarning):\n                    pass\n                SCons.Warnings.enableWarningClass(ICLLicenseDirWarning)\n                SCons.Warnings.warn(\n                    ICLLicenseDirWarning,\n                    \"Intel license dir was not found.  \"\n                    \"Tried using the INTEL_LICENSE_FILE environment variable \"\n                    \"(%s), the registry (%s) and the default path (%s).  \"\n                    \"Using the default path as a last resort.\"\n                    % (envlicdir, reglicdir, defaultlicdir)\n                )\n        env['ENV']['INTEL_LICENSE_FILE'] = licdir\n\ndef exists(env):\n    if not (is_mac or is_linux or is_windows):\n        # can't handle this platform\n        return 0\n\n    try:\n        versions = get_all_compiler_versions()\n    except (SCons.Util.RegError, IntelCError):\n        versions = None\n    detected = versions is not None and len(versions) > 0\n    if not detected:\n        # try env.Detect, maybe that will work\n        if is_windows:\n            return env.Detect('icl')\n        elif is_linux:\n            return env.Detect('icc')\n        elif is_mac:\n            return env.Detect('icc')\n    return detected\n\n# end of file\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py",
    "content": "#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\nTool-specific initialization for the generic POSIX linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Tool import createProgBuilder\nfrom SCons.Tool.linkCommon import smart_link\nfrom SCons.Tool.linkCommon.LoadableModule import setup_loadable_module_logic\nfrom SCons.Tool.linkCommon.SharedLibrary import setup_shared_lib_logic\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gnulink to an Environment.\"\"\"\n    createProgBuilder(env)\n\n    setup_shared_lib_logic(env)\n    setup_loadable_module_logic(env)\n\n    env['SMARTLINK'] = smart_link\n    env['LINK'] = \"$SMARTLINK\"\n    env['LINKFLAGS'] = SCons.Util.CLVar('')\n\n    # __RPATH is only set to something ($_RPATH typically) on platforms that support it.\n    env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBDIRPREFIX'] = '-L'\n    env['LIBDIRSUFFIX'] = ''\n    env['_LIBFLAGS'] = '${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'\n    env['LIBLINKPREFIX'] = '-l'\n    env['LIBLINKSUFFIX'] = ''\n\n\ndef exists(env):\n    # This module isn't really a Tool on its own, it's common logic for\n    # other linkers.\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom SCons.Tool import createLoadableModuleBuilder\nfrom .SharedLibrary import shlib_symlink_emitter\nfrom . import lib_emitter\n\n\ndef ldmod_symlink_emitter(target, source, env, **kw):\n    return shlib_symlink_emitter(target, source, env, variable_prefix='LDMODULE')\n\n\ndef _get_ldmodule_stem(target, source, env, for_signature):\n    \"\"\"\n    Get the basename for a library (so for libxyz.so, return xyz)\n    :param target:\n    :param source:\n    :param env:\n    :param for_signature:\n    :return:\n    \"\"\"\n    target_name = str(target)\n    ldmodule_prefix = env.subst('$LDMODULEPREFIX')\n    ldmodule_suffix = env.subst(\"$_LDMODULESUFFIX\")\n\n    if target_name.startswith(ldmodule_prefix):\n        target_name = target_name[len(ldmodule_prefix):]\n\n    if target_name.endswith(ldmodule_suffix):\n        target_name = target_name[:-len(ldmodule_suffix)]\n\n    return target_name\n\n\ndef _ldmodule_soversion(target, source, env, for_signature):\n    \"\"\"Function to determine what to use for SOVERSION\"\"\"\n\n    if 'SOVERSION' in env:\n        return '.$SOVERSION'\n    elif 'LDMODULEVERSION' in env:\n        ldmod_version = env.subst('$LDMODULEVERSION')\n        # We use only the most significant digit of LDMODULEVERSION\n        return '.' + ldmod_version.split('.')[0]\n    else:\n        return ''\n\n\ndef _ldmodule_soname(target, source, env, for_signature):\n    if 'SONAME' in env:\n        return '$SONAME'\n    else:\n        return \"$LDMODULEPREFIX$_get_ldmodule_stem${LDMODULESUFFIX}$_LDMODULESOVERSION\"\n\ndef _LDMODULEVERSION(target, source, env, for_signature):\n    \"\"\"\n    Return \".\" + version if it's set, otherwise just a blank\n    \"\"\"\n    value = env.subst('$LDMODULEVERSION', target=target, source=source)\n    # print(\"_has_LDMODULEVERSION:%s\"%value)\n    if value:\n        return \".\"+value\n    else:\n        return \"\"\n\ndef setup_loadable_module_logic(env):\n    \"\"\"\n    Just the logic for loadable modules\n\n    For most platforms, a loadable module is the same as a shared\n    library.  Platforms which are different can override these, but\n    setting them the same means that LoadableModule works everywhere.\n\n    :param env:\n    :return:\n    \"\"\"\n\n    createLoadableModuleBuilder(env)\n\n    env['_get_ldmodule_stem'] = _get_ldmodule_stem\n    env['_LDMODULESOVERSION'] = _ldmodule_soversion\n    env['_LDMODULESONAME'] = _ldmodule_soname\n\n    env['LDMODULENAME'] = '${LDMODULEPREFIX}$_get_ldmodule_stem${_LDMODULESUFFIX}'\n\n    # This is the non versioned LDMODULE filename\n    # If LDMODULEVERSION is defined then this will symlink to $LDMODULENAME\n    env['LDMODULE_NOVERSION_SYMLINK'] = '$_get_shlib_dir${LDMODULEPREFIX}$_get_ldmodule_stem${LDMODULESUFFIX}'\n\n    # This is the sonamed file name\n    # If LDMODULEVERSION is defined then this will symlink to $LDMODULENAME\n    env['LDMODULE_SONAME_SYMLINK'] = '$_get_shlib_dir$_LDMODULESONAME'\n\n    env['_LDMODULEVERSION'] =  _LDMODULEVERSION\n\n    env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -Wl,-soname=$_LDMODULESONAME'\n\n    env['LDMODULEEMITTER'] = [lib_emitter, ldmod_symlink_emitter]\n\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['_LDMODULESUFFIX'] = '${LDMODULESUFFIX}${_LDMODULEVERSION}'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n\n    env['LDMODULE'] = '$SHLINK'\n\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n\n    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES ' \\\n                         '$_LIBDIRFLAGS $_LIBFLAGS '\n\n    env['LDMODULEVERSION'] = '$SHLIBVERSION'\n    env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS'"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom SCons.Errors import UserError\nfrom SCons.Tool import createSharedLibBuilder\nfrom SCons.Util import CLVar\nfrom . import lib_emitter, EmitLibSymlinks, StringizeLibSymlinks\n\n\ndef shlib_symlink_emitter(target, source, env, **kw):\n    verbose = False\n\n    if \"variable_prefix\" in kw:\n        var_prefix = kw[\"variable_prefix\"]\n    else:\n        var_prefix = \"SHLIB\"\n\n    do_symlinks = env.subst(\"$%sNOVERSIONSYMLINKS\" % var_prefix)\n    if do_symlinks in [\"1\", \"True\", \"true\", True]:\n        return target, source\n\n    shlibversion = env.subst(\"$%sVERSION\" % var_prefix)\n    if shlibversion:\n        if verbose:\n            print(\"shlib_symlink_emitter: %sVERSION=%s\" % (var_prefix, shlibversion))\n\n        libnode = target[0]\n        shlib_soname_symlink = env.subst(\n            \"$%s_SONAME_SYMLINK\" % var_prefix, target=target, source=source\n        )\n        shlib_noversion_symlink = env.subst(\n            \"$%s_NOVERSION_SYMLINK\" % var_prefix, target=target, source=source\n        )\n\n        if verbose:\n            print(\"shlib_soname_symlink    :%s\" % shlib_soname_symlink)\n            print(\"shlib_noversion_symlink :%s\" % shlib_noversion_symlink)\n            print(\"libnode                 :%s\" % libnode)\n\n        shlib_soname_symlink = env.File(shlib_soname_symlink)\n        shlib_noversion_symlink = env.File(shlib_noversion_symlink)\n\n        symlinks = []\n        if shlib_soname_symlink != libnode:\n            # If soname and library name machine, don't symlink them together\n            symlinks.append((env.File(shlib_soname_symlink), libnode))\n\n        symlinks.append((env.File(shlib_noversion_symlink), libnode))\n\n        if verbose:\n            print(\n                \"_lib_emitter: symlinks={!r}\".format(\n                    \", \".join(\n                        [\"%r->%r\" % (k, v) for k, v in StringizeLibSymlinks(symlinks)]\n                    )\n                )\n            )\n\n        if symlinks:\n            # This does the actual symlinking\n            EmitLibSymlinks(env, symlinks, target[0])\n\n            # This saves the information so if the versioned shared library is installed\n            # it can faithfully reproduce the correct symlinks\n            target[0].attributes.shliblinks = symlinks\n\n    return target, source\n\n\ndef _soversion(target, source, env, for_signature):\n    \"\"\"Function to determine what to use for SOVERSION\"\"\"\n\n    if \"SOVERSION\" in env:\n        return \".$SOVERSION\"\n    elif \"SHLIBVERSION\" in env:\n        shlibversion = env.subst(\"$SHLIBVERSION\")\n        # We use only the most significant digit of SHLIBVERSION\n        return \".\" + shlibversion.split(\".\")[0]\n    else:\n        return \"\"\n\n\ndef _soname(target, source, env, for_signature):\n    if \"SONAME\" in env:\n        # Now verify that SOVERSION is not also set as that is not allowed\n        if \"SOVERSION\" in env:\n            raise UserError(\n                \"Ambiguous library .so naming, both SONAME: %s and SOVERSION: %s are defined. \"\n                \"Only one can be defined for a target library.\"\n                % (env[\"SONAME\"], env[\"SOVERSION\"])\n            )\n        return \"$SONAME\"\n    else:\n        return \"$SHLIBPREFIX$_get_shlib_stem${SHLIBSUFFIX}$_SHLIBSOVERSION\"\n\n\ndef _get_shlib_stem(target, source, env, for_signature: bool) -> str:\n    \"\"\"Get the base name of a shared library.\n\n    Args:\n        target: target node containing the lib name\n        source: source node, not used\n        env: environment context for running subst\n        for_signature: whether this is being done for signature generation\n\n    Returns:\n        the library name without prefix/suffix\n    \"\"\"\n    verbose = False\n\n    target_name = str(target.name)\n    shlibprefix = env.subst(\"$SHLIBPREFIX\")\n    shlibsuffix = env.subst(\"$_SHLIBSUFFIX\")\n\n    if verbose and not for_signature:\n        print(\n            \"_get_shlib_stem: target_name:%s shlibprefix:%s shlibsuffix:%s\"\n            % (target_name, shlibprefix, shlibsuffix)\n        )\n\n\n    if shlibsuffix and target_name.endswith(shlibsuffix):\n        target_name = target_name[: -len(shlibsuffix)]\n\n    if shlibprefix and target_name.startswith(shlibprefix):\n        # skip pathological case were target _is_ the prefix\n        if target_name != shlibprefix:\n            target_name = target_name[len(shlibprefix) :]\n\n\n    if verbose and not for_signature:\n        print(\"_get_shlib_stem: target_name:%s AFTER\" % (target_name,))\n\n    return target_name\n\n\ndef _get_shlib_dir(target, source, env, for_signature: bool) -> str:\n    \"\"\"Get the directory the shared library is in.\n\n    Args:\n        target: target node\n        source: source node, not used\n        env: environment context, not used\n        for_signature: whether this is being done for signature generation\n\n    Returns:\n        the directory the library will be in (empty string if '.')\n    \"\"\"\n    verbose = False\n\n    if target.dir and str(target.dir) != \".\":\n        if verbose:\n            print(\"_get_shlib_dir: target.dir:%s\" % target.dir)\n\n        return \"%s/\" % str(target.dir)\n    else:\n        return \"\"\n\n\ndef setup_shared_lib_logic(env):\n    \"\"\"Initialize an environment for shared library building.\n\n    Args:\n        env: environment to set up\n    \"\"\"\n    createSharedLibBuilder(env)\n\n    env[\"_get_shlib_stem\"] = _get_shlib_stem\n    env[\"_get_shlib_dir\"] = _get_shlib_dir\n    env[\"_SHLIBSOVERSION\"] = _soversion\n    env[\"_SHLIBSONAME\"] = _soname\n\n    env[\"SHLIBNAME\"] = \"${_get_shlib_dir}${SHLIBPREFIX}$_get_shlib_stem${_SHLIBSUFFIX}\"\n\n    # This is the non versioned shlib filename\n    # If SHLIBVERSION is defined then this will symlink to $SHLIBNAME\n    env[\"SHLIB_NOVERSION_SYMLINK\"] = \"${_get_shlib_dir}${SHLIBPREFIX}$_get_shlib_stem${SHLIBSUFFIX}\"\n\n    # This is the sonamed file name\n    # If SHLIBVERSION is defined then this will symlink to $SHLIBNAME\n    env[\"SHLIB_SONAME_SYMLINK\"] = \"${_get_shlib_dir}$_SHLIBSONAME\"\n\n    # Note this is gnu style\n    env[\"SHLIBSONAMEFLAGS\"] = \"-Wl,-soname=$_SHLIBSONAME\"\n    env[\"_SHLIBVERSION\"] = \"${SHLIBVERSION and '.'+SHLIBVERSION or ''}\"\n    env[\"_SHLIBVERSIONFLAGS\"] = \"$SHLIBVERSIONFLAGS -Wl,-soname=$_SHLIBSONAME\"\n\n    env[\"SHLIBEMITTER\"] = [lib_emitter, shlib_symlink_emitter]\n\n    # If it's already set, then don't overwrite.\n    env[\"SHLIBPREFIX\"] = env.get('SHLIBPREFIX', \"lib\")\n    env[\"_SHLIBSUFFIX\"] = \"${SHLIBSUFFIX}${_SHLIBVERSION}\"\n\n    env[\"SHLINKFLAGS\"] = CLVar(\"$LINKFLAGS -shared\")\n\n    env[\"SHLINKCOM\"] = \"$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS\"\n\n    env[\"SHLINK\"] = \"$LINK\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\nCommon link/shared library logic\n\"\"\"\n\nimport SCons.Util\nimport SCons.Warnings\n# Nuitka: Disable unused tools\n# from SCons.Tool.DCommon import isD\ndef isD(env,source): return False\n\nfrom SCons.Util import is_List\n\nissued_mixed_link_warning = False\n\n\ndef StringizeLibSymlinks(symlinks):\n    \"\"\"Converts list with pairs of nodes to list with pairs of node paths\n    (strings). Used mainly for debugging.\"\"\"\n    if is_List(symlinks):\n        try:\n            return [(k.get_path(), v.get_path()) for k, v in symlinks]\n        except (TypeError, ValueError):\n            return symlinks\n    else:\n        return symlinks\n\n\ndef EmitLibSymlinks(env, symlinks, libnode, **kw):\n    \"\"\"Used by emitters to handle (shared/versioned) library symlinks\"\"\"\n    Verbose = False\n\n    # nodes involved in process... all symlinks + library\n    nodes = list(set([x for x, y in symlinks] + [libnode]))\n\n    clean_targets = kw.get('clean_targets', [])\n    if not is_List(clean_targets):\n        clean_targets = [clean_targets]\n\n    for link, linktgt in symlinks:\n        env.SideEffect(link, linktgt)\n        if Verbose:\n            print(\"EmitLibSymlinks: SideEffect(%r,%r)\" % (link.get_path(), linktgt.get_path()))\n        clean_list = [x for x in nodes if x != linktgt]\n        env.Clean(list(set([linktgt] + clean_targets)), clean_list)\n        if Verbose:\n            print(\"EmitLibSymlinks: Clean(%r,%r)\" % (linktgt.get_path(), [x.get_path() for x in clean_list]))\n\n\ndef CreateLibSymlinks(env, symlinks):\n    \"\"\"Physically creates symlinks. The symlinks argument must be a list in\n    form [ (link, linktarget), ... ], where link and linktarget are SCons\n    nodes.\n    \"\"\"\n    Verbose = False\n\n    for link, linktgt in symlinks:\n        linktgt = link.get_dir().rel_path(linktgt)\n        link = link.get_path()\n        if Verbose:\n            print(\"CreateLibSymlinks: preparing to add symlink %r -> %r\" % (link, linktgt))\n        # Delete the (previously created) symlink if exists. Let only symlinks\n        # to be deleted to prevent accidental deletion of source files...\n        if env.fs.islink(link):\n            env.fs.unlink(link)\n            if Verbose:\n                print(\"CreateLibSymlinks: removed old symlink %r\" % link)\n        # If a file or directory exists with the same name as link, an OSError\n        # will be thrown, which should be enough, I think.\n        env.fs.symlink(linktgt, link)\n        if Verbose:\n            print(\"CreateLibSymlinks: add symlink %r -> %r\" % (link, linktgt))\n    return 0\n\n\ndef LibSymlinksActionFunction(target, source, env):\n    for tgt in target:\n        symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)\n        if symlinks:\n            CreateLibSymlinks(env, symlinks)\n    return 0\n\n\ndef LibSymlinksStrFun(target, source, env, *args):\n    cmd = None\n    for tgt in target:\n        symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)\n        if symlinks:\n            if cmd is None: cmd = \"\"\n            if cmd: cmd += \"\\n\"\n            cmd += \"Create symlinks for: %r\\n    \" % tgt.get_path()\n            try:\n                linkstr = '\\n    '.join([\"%r->%r\" % (k, v) for k, v in StringizeLibSymlinks(symlinks)])\n            except (KeyError, ValueError):\n                pass\n            else:\n                cmd += \"%s\" % linkstr\n    return cmd\n\n\ndef _call_env_subst(env, string, *args, **kw):\n    kw2 = {}\n    for k in ('raw', 'target', 'source', 'conv', 'executor'):\n        try:\n            kw2[k] = kw[k]\n        except KeyError:\n            pass\n    return env.subst(string, *args, **kw2)\n\n\ndef smart_link(source, target, env, for_signature):\n    import SCons.Tool.cxx\n    # Nuitka: Avoid ununused tools\n    # import SCons.Tool.FortranCommon\n\n    has_cplusplus = SCons.Tool.cxx.iscplusplus(source)\n    has_fortran = False\n    has_d = isD(env, source)\n    if has_cplusplus and has_fortran and not has_d:\n        global issued_mixed_link_warning\n        if not issued_mixed_link_warning:\n            msg = \"Using $CXX to link Fortran and C++ code together.\\n\\t\" + \\\n                  \"This may generate a buggy executable if the '%s'\\n\\t\" + \\\n                  \"compiler does not know how to deal with Fortran runtimes.\"\n            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,\n                                msg % env.subst('$CXX'))\n            issued_mixed_link_warning = True\n        return '$CXX'\n    elif has_d:\n        env['LINKCOM'] = env['DLINKCOM']\n        env['SHLINKCOM'] = env['SHDLINKCOM']\n        return '$DC'\n    elif has_fortran:\n        return '$FORTRAN'\n    elif has_cplusplus:\n        return '$CXX'\n    return '$CC'\n\n\ndef lib_emitter(target, source, env, **kw):\n    verbose = False\n    if verbose:\n        print(\"_lib_emitter: target[0]={!r}\".format(target[0].get_path()))\n    for tgt in target:\n        if SCons.Util.is_String(tgt):\n            tgt = env.File(tgt)\n        tgt.attributes.shared = 1\n\n    return target, source\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py",
    "content": "\"\"\"SCons.Tool.linkloc\n\nTool specification for the LinkLoc linker for the Phar Lap ETS embedded\noperating system.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport re\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Tool\nimport SCons.Util\n\nfrom SCons.Tool.MSCommon import msvs_exists, merge_default_version\nfrom SCons.Tool.PharLapCommon import addPharLapPaths\n\n_re_linker_command = re.compile(r'(\\s)@\\s*([^\\s]+)')\n\ndef repl_linker_command(m):\n    # Replaces any linker command file directives (e.g. \"@foo.lnk\") with\n    # the actual contents of the file.\n    try:\n        with open(m.group(2), \"r\") as f:\n            return m.group(1) + f.read()\n    except IOError:\n        # the linker should return an error if it can't\n        # find the linker command file so we will remain quiet.\n        # However, we will replace the @ with a # so we will not continue\n        # to find it with recursive substitution\n        return m.group(1) + '#' + m.group(2)\n\nclass LinklocGenerator:\n    def __init__(self, cmdline):\n        self.cmdline = cmdline\n\n    def __call__(self, env, target, source, for_signature):\n        if for_signature:\n            # Expand the contents of any linker command files recursively\n            subs = 1\n            strsub = env.subst(self.cmdline, target=target, source=source)\n            while subs:\n                strsub, subs = _re_linker_command.subn(repl_linker_command, strsub)\n            return strsub\n        else:\n            return \"${TEMPFILE('\" + self.cmdline + \"')}\"\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['SUBST_CMD_FILE'] = LinklocGenerator\n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS')\n    env['SHLINKCOM']   = '${SUBST_CMD_FILE(\"$SHLINK $SHLINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -dll $TARGET $SOURCES\")}'\n    env['SHLIBEMITTER']= None\n    env['LDMODULEEMITTER']= None\n    env['LINK']        = \"linkloc\"\n    env['LINKFLAGS']   = SCons.Util.CLVar('')\n    env['LINKCOM']     = '${SUBST_CMD_FILE(\"$LINK $LINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -exe $TARGET $SOURCES\")}'\n    env['LIBDIRPREFIX']='-libpath '\n    env['LIBDIRSUFFIX']=''\n    env['LIBLINKPREFIX']='-lib '\n    env['LIBLINKSUFFIX']='$LIBSUFFIX'\n\n    # Set-up ms tools paths for default version\n    merge_default_version(env)\n\n    addPharLapPaths(env)\n\ndef exists(env):\n    if msvs_exists(env):\n        return env.Detect('linkloc')\n    else:\n        return 0\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py",
    "content": "\"\"\"SCons.Tool.m4\n\nTool-specific initialization for m4.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for m4 to an Environment.\"\"\"\n    M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR')\n    bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4')\n\n    env['BUILDERS']['M4'] = bld\n\n    # .m4 files might include other files, and it would be pretty hard\n    # to write a scanner for it, so let's just cd to the dir of the m4\n    # file and run from there.\n    # The src_suffix setup is like so: file.c.m4 -> file.c,\n    # file.cpp.m4 -> file.cpp etc.\n    env['M4']      = 'm4'\n    env['M4FLAGS'] = SCons.Util.CLVar('-E')\n    env['M4COM']   = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}'\n\ndef exists(env):\n    return env.Detect('m4')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py",
    "content": "\"\"\"SCons.Tool.masm\n\nTool-specific initialization for the Microsoft Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for masm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)\n\n    env['AS']        = 'ml'\n    env['ASFLAGS']   = SCons.Util.CLVar('/nologo')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('ml')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons.Tool.gcc\n\nTool-specific initialization for MinGW (http://www.mingw.org/)\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport os\nimport os.path\nimport glob\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\n# Nuitka: Only use version specific paths if possible.\n# Cygwin and msys2 should be avoided.\nmingw_paths = []\n\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    # Nuitka: Use linker file\n    tmp_linker_filename = \"@%s\" % (\n        os.path.join(env.source_dir, \"@link_input.txt\").replace(os.path.sep, \"/\"),\n    )\n    cmd.extend([tmp_linker_filename, '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    # Nuitka: Disable implib here, we do it manually.\n    # implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    # if implib: cmd.append('-Wl,--out-implib,' + implib.get_string(for_signature))\n\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if insert_def not in ['', '0', 0] and def_target: \\\n            cmd.append('-Wl,--output-def,' + def_target.get_string(for_signature))\n\n    return [cmd]\n\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\n            \"A shared library should have exactly one target with the suffix: %s Target(s) are:%s\" % \\\n            (env.subst(\"$SHLIBSUFFIX\"), \",\".join([str(t) for t in target])))\n\n    if not no_import_lib and \\\n            not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n        # Create list of target libraries as strings\n        targetStrings = env.ReplaceIxes(dll,\n                                        'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                        'LIBPREFIX', 'LIBSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    # Append a def file target if there isn't already a def file target\n    # or a def file source or the user has explicitly asked for the target\n    # to be emitted.\n    def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n    skip_def_insert = env.subst(\"$WINDOWS_INSERT_DEF\") in ['', '0', 0]\n    if not def_source and not def_target and not skip_def_insert:\n        # Create list of target libraries and def files as strings\n        targetStrings = env.ReplaceIxes(dll,\n                                        'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                        'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')\n\n        # Now add file nodes to target list\n        target.append(env.fs.File(targetStrings))\n\n    return (target, source)\n\n\nshlib_action = SCons.Action.Action(shlib_generator, '$SHLINKCOMSTR', generator=1)\nldmodule_action = SCons.Action.Action(shlib_generator, '$LDMODULECOMSTR', generator=1)\n\nres_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\n\nres_builder = SCons.Builder.Builder(action=res_action, suffix='.o',\n                                    source_scanner=SCons.Tool.SourceFileScanner)\nSCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)\n\n# This is what we search for to find mingw:\n# key_program = 'mingw32-gcc'\nkey_program = 'mingw32-make'\n\n\n# Nuitka: We try to find matching ones only.\ndef find_version_specific_mingw_paths(env):\n    r\"\"\"\n    One example of default mingw install paths is:\n    C:\\mingw-w64\\x86_64-6.3.0-posix-seh-rt_v5-rev2\\mingw64\\bin\n\n    Use glob'ing to find such and add to mingw_paths\n    \"\"\"\n    # new_paths = glob.glob(r\"C:\\mingw-w64\\*\\mingw64\\bin\")\n\n    if env[\"TARGET_ARCH\"] == \"x86_64\":\n        new_paths = glob.glob(r'c:\\MinGW64\\mingw64\\bin')\n        new_paths += glob.glob(r'\\MinGW64\\mingw64\\bin')\n    else:\n        new_paths = glob.glob(r'c:\\MinGW64\\mingw64\\bin')\n        new_paths += glob.glob(r'\\MinGW64\\mingw64\\bin')\n\n    # Older versions of MinGW just has this.\n    new_paths += glob.glob(r'c:\\MinGW64\\bin')\n    new_paths += glob.glob(r'\\MinGW64\\bin')\n\n    return new_paths\n\n\ndef generate(env):\n    global mingw_paths\n    # Check for reasoanble mingw default paths\n    # Nuitks: Pass env for decision\n    mingw_paths += find_version_specific_mingw_paths(env)\n\n    mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)\n    if mingw:\n        mingw_bin_dir = os.path.dirname(mingw)\n\n        # Adjust path if we found it in a chocolatey install\n        if mingw_bin_dir == r'C:\\ProgramData\\chocolatey\\bin':\n            mingw_bin_dir = r'C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin'\n\n        env.AppendENVPath('PATH', mingw_bin_dir)\n\n    # Most of mingw is the same as gcc and friends...\n    # Nuitka: We need less than these:\n    # gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4']\n    gnu_tools = ['gcc', 'g++', 'gnulink']\n    for tool in gnu_tools:\n        SCons.Tool.Tool(tool)(env)\n\n    # ... but a few things differ:\n    env['CC'] = 'gcc'\n    # make sure the msvc tool doesnt break us, it added a /flag\n    if 'CCFLAGS' in env:\n        # make sure its a CLVar to handle list or str cases\n        if type(env['CCFLAGS']) is not SCons.Util.CLVar:\n            env['CCFLAGS'] = SCons.Util.CLVar(env['CCFLAGS'])\n        env['CCFLAGS'] = SCons.Util.CLVar(str(env['CCFLAGS']).replace('/nologo', ''))\n    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')\n    env['CXX'] = 'g++'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM'] = shlib_action\n    env['SHLINKCOMSTR'] = shlib_generator\n    env['LDMODULECOM'] = ldmodule_action\n    env.Append(SHLIBEMITTER=[shlib_emitter])\n    env.Append(LDMODULEEMITTER=[shlib_emitter])\n    env['AS'] = 'as'\n\n    env['WINDOWSDEFPREFIX'] = ''\n    env['WINDOWSDEFSUFFIX'] = '.def'\n\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n    env['RC'] = 'windres'\n    env['RCFLAGS'] = SCons.Util.CLVar('')\n    env['RCINCFLAGS'] = '${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}'\n    env['RCINCPREFIX'] = '--include-dir '\n    env['RCINCSUFFIX'] = ''\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'\n    env['BUILDERS']['RES'] = res_builder\n\n    # Some setting from the platform also have to be overridden:\n    env['OBJSUFFIX'] = '.o'\n    env['LIBPREFIX'] = 'lib'\n    env['LIBSUFFIX'] = '.a'\n    env['PROGSUFFIX'] = '.exe'\n\n    # Handle new versioned shared library logic\n    env['_SHLIBSUFFIX'] = '$SHLIBSUFFIX'\n    env[\"SHLIBPREFIX\"] = \"\"\n\n    # Disable creating symlinks for versioned shared library.\n    env['SHLIBNOVERSIONSYMLINKS'] = True\n    env['LDMODULENOVERSIONSYMLINKS'] = True\n    env['IMPLIBNOVERSIONSYMLINKS'] = True\n\n\n\ndef exists(env):\n    mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)\n    if mingw:\n        mingw_bin_dir = os.path.dirname(mingw)\n        env.AppendENVPath('PATH', mingw_bin_dir)\n\n    return mingw\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\" msgfmt tool \"\"\"\n\nimport sys\nimport os\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Builder import BuilderBase\nfrom SCons.Errors import StopError\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import (\n    _detect_msgfmt,\n    _msgfmt_exists,\n    # MsgfmtToolWarning,\n    _read_linguas_from_files,\n)\n\nclass _MOFileBuilder(BuilderBase):\n    \"\"\"The builder class for `MO` files.\n\n    The reason for this builder to exists and its purpose is quite simillar\n    as for `_POFileBuilder`. This time, we extend list of sources, not targets,\n    and call `BuilderBase._execute()` only once (as we assume single-target\n    here).\n    \"\"\"\n\n    def _execute(self, env, target, source, *args, **kw):\n        # Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable\n        # in this case, as it is called too late (after multiple sources\n        # are handled single_source builder.\n\n        linguas_files = None\n        if 'LINGUAS_FILE' in env and env['LINGUAS_FILE'] is not None:\n            linguas_files = env['LINGUAS_FILE']\n            # This should prevent from endless recursion.\n            env['LINGUAS_FILE'] = None\n            # We read only languages. Suffixes shall be added automatically.\n            linguas = _read_linguas_from_files(env, linguas_files)\n            if SCons.Util.is_List(source):\n                source.extend(linguas)\n            elif source is not None:\n                source = [source] + linguas\n            else:\n                source = linguas\n        result = BuilderBase._execute(self, env, target, source, *args, **kw)\n        if linguas_files is not None:\n            env['LINGUAS_FILE'] = linguas_files\n        return result\n\n\ndef _create_mo_file_builder(env, **kw):\n    \"\"\" Create builder object for `MOFiles` builder \"\"\"\n\n    # FIXME: What factory use for source? Ours or their?\n    kw['action'] = SCons.Action.Action('$MSGFMTCOM', '$MSGFMTCOMSTR')\n    kw['suffix'] = '$MOSUFFIX'\n    kw['src_suffix'] = '$POSUFFIX'\n    kw['src_builder'] = '_POUpdateBuilder'\n    kw['single_source'] = True\n    return _MOFileBuilder(**kw)\n\n\ndef generate(env, **kw):\n    \"\"\" Generate `msgfmt` tool \"\"\"\n\n    if sys.platform == 'win32':\n        msgfmt = SCons.Tool.find_program_path(\n            env, 'msgfmt', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS\n        )\n        if msgfmt:\n            msgfmt_bin_dir = os.path.dirname(msgfmt)\n            env.AppendENVPath('PATH', msgfmt_bin_dir)\n        else:\n            SCons.Warnings.warn(\n                # MsgfmtToolWarning,  # using this breaks test, so keep:\n                SCons.Warnings.SConsWarning,\n                'msgfmt tool requested, but binary not found in ENV PATH',\n            )\n\n    try:\n        env['MSGFMT'] = _detect_msgfmt(env)\n    except StopError:\n        env['MSGFMT'] = 'msgfmt'\n    env.SetDefault(\n        MSGFMTFLAGS=[SCons.Util.CLVar('-c')],\n        MSGFMTCOM='$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',\n        MSGFMTCOMSTR='',\n        MOSUFFIX=['.mo'],\n        POSUFFIX=['.po'],\n    )\n    env.Append(BUILDERS={'MOFiles': _create_mo_file_builder(env)})\n\n\ndef exists(env):\n    \"\"\" Check if the tool exists \"\"\"\n\n    try:\n        return _msgfmt_exists(env)\n    except StopError:\n        return False\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool specific initialization of msginit tool.\"\"\"\n\nimport sys\nimport os\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Environment import _null\nfrom SCons.Errors import StopError\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import (\n    _detect_msginit,\n    _init_po_files,\n    _msginit_exists,\n    # MsginitToolWarning,\n    _POFileBuilder,\n)\n\n\ndef _optional_no_translator_flag(env):\n    \"\"\"Return '--no-translator' flag if we run *msginit(1)*  in non-interactive\n    mode.\"\"\"\n    if 'POAUTOINIT' in env:\n        autoinit = env['POAUTOINIT']\n    else:\n        autoinit = False\n    if autoinit:\n        return [SCons.Util.CLVar('--no-translator')]\n    else:\n        return [SCons.Util.CLVar('')]\n\n\ndef _POInitBuilder(env, **kw):\n    \"\"\" Create builder object for `POInit` builder. \"\"\"\n\n    action = SCons.Action.Action(_init_po_files, None)\n    return _POFileBuilder(env, action=action, target_alias='$POCREATE_ALIAS')\n\n\ndef _POInitBuilderWrapper(env, target=None, source=_null, **kw):\n    \"\"\"Wrapper for _POFileBuilder. We use it to make user's life easier.\n\n    This wrapper checks for `$POTDOMAIN` construction variable (or override in\n    `**kw`) and treats it appropriatelly.\n    \"\"\"\n    if source is _null:\n        if 'POTDOMAIN' in kw:\n            domain = kw['POTDOMAIN']\n        elif 'POTDOMAIN' in env:\n            domain = env['POTDOMAIN']\n        else:\n            domain = 'messages'\n        source = [domain]  # NOTE: Suffix shall be appended automatically\n    return env._POInitBuilder(target, source, **kw)\n\ndef generate(env, **kw):\n    \"\"\" Generate the `msginit` tool \"\"\"\n\n    if sys.platform == 'win32':\n        msginit = SCons.Tool.find_program_path(\n            env, 'msginit', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS\n        )\n        if msginit:\n            msginit_bin_dir = os.path.dirname(msginit)\n            env.AppendENVPath('PATH', msginit_bin_dir)\n        else:\n            SCons.Warnings.warn(\n                # MsginitToolWarning,  # using this breaks test, so keep:\n                SCons.Warnings.SConsWarning,\n                'msginit tool requested, but binary not found in ENV PATH',\n            )\n\n    try:\n        env['MSGINIT'] = _detect_msginit(env)\n    except StopError:\n        env['MSGINIT'] = 'msginit'\n    msginitcom = (\n        '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}'\n        + ' $MSGINITFLAGS -i $SOURCE -o $TARGET'\n    )\n    # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded\n    #       (sometimes we really don't need it)\n    env.SetDefault(\n        POSUFFIX=['.po'],\n        POTSUFFIX=['.pot'],\n        _MSGINITLOCALE='${TARGET.filebase}',\n        _MSGNoTranslator=_optional_no_translator_flag,\n        MSGINITCOM=msginitcom,\n        MSGINITCOMSTR='',\n        MSGINITFLAGS=[],\n        POAUTOINIT=False,\n        POCREATE_ALIAS='po-create',\n    )\n    env.Append(BUILDERS={'_POInitBuilder': _POInitBuilder(env)})\n    env.AddMethod(_POInitBuilderWrapper, 'POInit')\n    env.AlwaysBuild(env.Alias('$POCREATE_ALIAS'))\n\n\ndef exists(env):\n    \"\"\" Check if the tool exists \"\"\"\n\n    try:\n        return _msginit_exists(env)\n    except StopError:\n        return False\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool specific initialization for `msgmerge` tool.\"\"\"\n\nimport sys\nimport os\n\nimport SCons.Action\nimport SCons.Tool\nimport SCons.Warnings\nfrom SCons.Errors import StopError\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import (\n    _detect_msgmerge,\n    _init_po_files,\n    _msgmerge_exists,\n    # MsgmergeToolWarning,\n    _POFileBuilder,\n)\n\ndef _update_or_init_po_files(target, source, env):\n    \"\"\" Action function for `POUpdate` builder \"\"\"\n\n    for tgt in target:\n        if tgt.rexists():\n            action = SCons.Action.Action('$MSGMERGECOM', '$MSGMERGECOMSTR')\n        else:\n            action = _init_po_files\n        status = action([tgt], source, env)\n        if status:\n            return status\n    return 0\n\n\ndef _POUpdateBuilder(env, **kw):\n    \"\"\" Create an object of `POUpdate` builder \"\"\"\n\n    action = SCons.Action.Action(_update_or_init_po_files, None)\n    return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS')\n\n\nfrom SCons.Environment import _null\n\n\ndef _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n    \"\"\" Wrapper for `POUpdate` builder - make user's life easier \"\"\"\n    if source is _null:\n        if 'POTDOMAIN' in kw:\n            domain = kw['POTDOMAIN']\n        elif 'POTDOMAIN' in env and env['POTDOMAIN']:\n            domain = env['POTDOMAIN']\n        else:\n            domain = 'messages'\n        source = [domain]  # NOTE: Suffix shall be appended automatically\n    return env._POUpdateBuilder(target, source, **kw)\n\n\ndef generate(env, **kw):\n    \"\"\" Generate the `msgmerge` tool \"\"\"\n\n    if sys.platform == 'win32':\n        msgmerge = SCons.Tool.find_program_path(\n            env, 'msgmerge', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS\n        )\n        if msgmerge:\n            msgmerge_bin_dir = os.path.dirname(msgmerge)\n            env.AppendENVPath('PATH', msgmerge_bin_dir)\n        else:\n            SCons.Warnings.warn(\n                # MsgmergeToolWarning,  # using this breaks test, so keep:\n                SCons.Warnings.SConsWarning,\n                'msgmerge tool requested, but binary not found in ENV PATH',\n            )\n    try:\n        env['MSGMERGE'] = _detect_msgmerge(env)\n    except StopError:\n        env['MSGMERGE'] = 'msgmerge'\n    env.SetDefault(\n        POTSUFFIX=['.pot'],\n        POSUFFIX=['.po'],\n        MSGMERGECOM='$MSGMERGE  $MSGMERGEFLAGS --update $TARGET $SOURCE',\n        MSGMERGECOMSTR='',\n        MSGMERGEFLAGS=[],\n        POUPDATE_ALIAS='po-update',\n    )\n    env.Append(BUILDERS={'_POUpdateBuilder': _POUpdateBuilder(env)})\n    env.AddMethod(_POUpdateBuilderWrapper, 'POUpdate')\n    env.AlwaysBuild(env.Alias('$POUPDATE_ALIAS'))\n\n\ndef exists(env):\n    \"\"\" Check if the tool exists \"\"\"\n\n    try:\n        return _msgmerge_exists(env)\n    except StopError:\n        return False\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py",
    "content": "\"\"\"SCons.Tool.mslib\n\nTool-specific initialization for lib (MicroSoft library archiver).\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Tool.msvc\nimport SCons.Util\n\nfrom .MSCommon import msvc_exists, msvc_setup_env_once\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['AR']          = 'lib'\n    env['ARFLAGS']     = SCons.Util.CLVar('/nologo')\n    env['ARCOM']       = \"${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES','$ARCOMSTR')}\"\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons.Tool.mslink\n\nTool-specific initialization for the Microsoft linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport os\nimport os.path\n\nimport SCons.Action\nimport SCons.Defaults\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvc\nimport SCons.Tool.msvs\nimport SCons.Util\n\nfrom .MSCommon import msvc_setup_env_once, msvc_exists\nfrom .MSCommon.common import get_pch_node\n\ndef pdbGenerator(env, target, source, for_signature):\n    try:\n        return ['/PDB:%s' % target[0].attributes.pdb, '/DEBUG']\n    except (AttributeError, IndexError):\n        return None\n\ndef _dllTargets(target, source, env, for_signature, paramtp):\n    listCmd = []\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    if dll: listCmd.append(\"/out:%s\"%dll.get_string(for_signature))\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: listCmd.append(\"/implib:%s\"%implib.get_string(for_signature))\n\n    return listCmd\n\ndef _dllSources(target, source, env, for_signature, paramtp):\n    listCmd = []\n\n    deffile = env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\")\n    for src in source:\n        # Check explicitly for a non-None deffile so that the __cmp__\n        # method of the base SCons.Util.Proxy class used for some Node\n        # proxies doesn't try to use a non-existent __dict__ attribute.\n        if deffile and src == deffile:\n            # Treat this source as a .def file.\n            listCmd.append(\"/def:%s\" % src.get_string(for_signature))\n        else:\n            # Just treat it as a generic source file.\n            listCmd.append(src)\n    return listCmd\n\ndef windowsShlinkTargets(target, source, env, for_signature):\n    return _dllTargets(target, source, env, for_signature, 'SHLIB')\n\ndef windowsShlinkSources(target, source, env, for_signature):\n    return _dllSources(target, source, env, for_signature, 'SHLIB')\n\ndef _windowsLdmodTargets(target, source, env, for_signature):\n    \"\"\"Get targets for loadable modules.\"\"\"\n    return _dllTargets(target, source, env, for_signature, 'LDMODULE')\n\ndef _windowsLdmodSources(target, source, env, for_signature):\n    \"\"\"Get sources for loadable modules.\"\"\"\n    return _dllSources(target, source, env, for_signature, 'LDMODULE')\n\ndef _dllEmitter(target, source, env, paramtp):\n    \"\"\"Common implementation of dll emitter.\"\"\"\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError('A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp))\n\n    insert_def = env.subst(\"$WINDOWS_INSERT_DEF\")\n    if insert_def not in ['', '0', 0] and \\\n       not env.FindIxes(source, \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"):\n\n        # append a def file to the list of sources\n        extrasources.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSDEFPREFIX\", \"WINDOWSDEFSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that must be installed\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSSHLIBMANIFESTPREFIX\", \"WINDOWSSHLIBMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    pch_node = get_pch_node(env, target, source)\n    if version_num >= 11.0 and pch_node:\n        # MSVC 11 and above need the PCH object file to be added to the link line,\n        # otherwise you get link error LNK2011.\n        pchobj = SCons.Util.splitext(str(pch_node))[0] + '.obj'\n        # print \"prog_emitter, version %s, appending pchobj %s\"%(version_num, pchobj)\n        if pchobj not in extrasources:\n            extrasources.append(pchobj)\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, \"LIBPREFIX\", \"LIBSUFFIX\"):\n        # Append an import library to the list of targets.\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"LIBPREFIX\", \"LIBSUFFIX\"))\n        # and .exp file is created if there are exports from a DLL\n        extratargets.append(\n            env.ReplaceIxes(dll,\n                            '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,\n                            \"WINDOWSEXPPREFIX\", \"WINDOWSEXPSUFFIX\"))\n\n    return (target+extratargets, source+extrasources)\n\ndef windowsLibEmitter(target, source, env):\n    return _dllEmitter(target, source, env, 'SHLIB')\n\ndef ldmodEmitter(target, source, env):\n    \"\"\"Emitter for loadable modules.\n\n    Loadable modules are identical to shared libraries on Windows, but building\n    them is subject to different parameters (LDMODULE*).\n    \"\"\"\n    return _dllEmitter(target, source, env, 'LDMODULE')\n\ndef prog_emitter(target, source, env):\n    SCons.Tool.msvc.validate_vars(env)\n\n    extratargets = []\n    extrasources = []\n\n    exe = env.FindIxes(target, \"PROGPREFIX\", \"PROGSUFFIX\")\n    if not exe:\n        raise SCons.Errors.UserError(\"An executable should have exactly one target with the suffix: %s\" % env.subst(\"$PROGSUFFIX\"))\n\n    version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))\n    if version_num >= 8.0 and \\\n            (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):\n        # MSVC 8 and above automatically generate .manifest files that have to be installed\n        extratargets.append(\n            env.ReplaceIxes(exe,\n                            \"PROGPREFIX\", \"PROGSUFFIX\",\n                            \"WINDOWSPROGMANIFESTPREFIX\", \"WINDOWSPROGMANIFESTSUFFIX\"))\n\n    if 'PDB' in env and env['PDB']:\n        pdb = env.arg2nodes('$PDB', target=target, source=source)[0]\n        extratargets.append(pdb)\n        target[0].attributes.pdb = pdb\n\n    pch_node = get_pch_node(env, target, source)\n    if version_num >= 11.0 and pch_node:\n        # MSVC 11 and above need the PCH object file to be added to the link line,\n        # otherwise you get link error LNK2011.\n        pchobj = SCons.Util.splitext(str(pch_node))[0] + '.obj'\n        # print \"prog_emitter, version %s, appending pchobj %s\"%(version_num, pchobj)\n        if pchobj not in extrasources:\n            extrasources.append(pchobj)\n\n    return (target+extratargets,source+extrasources)\n\ndef RegServerFunc(target, source, env):\n    if 'register' in env and env['register']:\n        ret = regServerAction([target[0]], [source[0]], env)\n        if ret:\n            raise SCons.Errors.UserError(\"Unable to register %s\" % target[0])\n        else:\n            print(\"Registered %s sucessfully\" % target[0])\n        return ret\n    return 0\n\n# These are the actual actions run to embed the manifest.\n# They are only called from the Check versions below.\nembedManifestExeAction = SCons.Action.Action('$MTEXECOM')\nembedManifestDllAction = SCons.Action.Action('$MTSHLIBCOM')\n\ndef embedManifestDllCheck(target, source, env):\n    \"\"\"Function run by embedManifestDllCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestDllAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].get_abspath() + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = embedManifestDllAction([target[0]], None, env)\n            if ret:\n                raise SCons.Errors.UserError(\"Unable to embed manifest into %s\" % (target[0]))\n            return ret\n        else:\n            print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))\n    return 0\n\ndef embedManifestExeCheck(target, source, env):\n    \"\"\"Function run by embedManifestExeCheckAction to check for existence of manifest\n    and other conditions, and embed the manifest by calling embedManifestExeAction if so.\"\"\"\n    if env.get('WINDOWS_EMBED_MANIFEST', 0):\n        manifestSrc = target[0].get_abspath() + '.manifest'\n        if os.path.exists(manifestSrc):\n            ret = embedManifestExeAction([target[0]], None, env)\n            if ret:\n                raise SCons.Errors.UserError(\"Unable to embed manifest into %s\" % (target[0]))\n            return ret\n        else:\n            print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))\n    return 0\n\nembedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None)\nembedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)\n\nregServerAction = SCons.Action.Action(\"$REGSVRCOM\", \"$REGSVRCOMSTR\")\nregServerCheck = SCons.Action.Action(RegServerFunc, None)\nshlibLinkAction = SCons.Action.Action('${TEMPFILE(\"$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES\", \"$SHLINKCOMSTR\")}', '$SHLINKCOMSTR')\ncompositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction\nldmodLinkAction = SCons.Action.Action('${TEMPFILE(\"$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES\", \"$LDMODULECOMSTR\")}', '$LDMODULECOMSTR')\ncompositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction\nexeLinkAction = SCons.Action.Action('${TEMPFILE(\"$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows\", \"$LINKCOMSTR\")}', '$LINKCOMSTR')\ncompositeLinkAction = exeLinkAction + embedManifestExeCheckAction\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createSharedLibBuilder(env, shlib_suffix='$SHLIBSUFFIX')\n    SCons.Tool.createProgBuilder(env)\n\n    env['SHLINK'] = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')\n    env['_SHLINK_TARGETS'] = windowsShlinkTargets\n    env['_SHLINK_SOURCES'] = windowsShlinkSources\n    env['SHLINKCOM'] = compositeShLinkAction\n    env.Append(SHLIBEMITTER=[windowsLibEmitter])\n    env.Append(LDMODULEEMITTER=[windowsLibEmitter])\n    env['LINK'] = 'link'\n    env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')\n    env['_PDB'] = pdbGenerator\n    env['LINKCOM'] = compositeLinkAction\n    env.Append(PROGEMITTER=[prog_emitter])\n    env['LIBDIRPREFIX'] = '/LIBPATH:'\n    env['LIBDIRSUFFIX'] = ''\n    env['LIBLINKPREFIX'] = ''\n    env['LIBLINKSUFFIX'] = '$LIBSUFFIX'\n\n    env['WINDOWSDEFPREFIX'] = ''\n    env['WINDOWSDEFSUFFIX'] = '.def'\n    env['WINDOWSEXPPREFIX'] = ''\n    env['WINDOWSEXPSUFFIX'] = '.exp'\n    env['WINDOWS_INSERT_DEF'] = 0\n\n    env['WINDOWSSHLIBMANIFESTPREFIX'] = ''\n    env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest'\n    env['WINDOWSPROGMANIFESTPREFIX'] = ''\n    env['WINDOWSPROGMANIFESTSUFFIX'] = '${PROGSUFFIX}.manifest'\n\n    env['REGSVRACTION'] = regServerCheck\n    env['REGSVR'] = os.path.join(\n        SCons.Platform.win32.get_system_root(), 'System32', 'regsvr32'\n    )\n    env['REGSVRFLAGS'] = '/s '\n    env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'\n\n    env['WINDOWS_EMBED_MANIFEST'] = 0\n    env['MT'] = 'mt'\n    # env['MTFLAGS'] = ['-hashupdate']\n    env['MTFLAGS'] = SCons.Util.CLVar('/nologo')\n    # Note: use - here to prevent build failure if no manifest produced.\n    # This seems much simpler than a fancy system using a function action to see\n    # if the manifest actually exists before trying to run mt with it.\n    env['MTEXECOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1'\n    env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2'\n    # TODO Future work garyo 27-Feb-11\n    env['_MANIFEST_SOURCES'] = None  # _windowsManifestSources\n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    # Loadable modules are on Windows the same as shared libraries, but they\n    # are subject to different build parameters (LDMODULE* variables).\n    # Therefore LDMODULE* variables correspond as much as possible to\n    # SHLINK*/SHLIB* ones.\n    SCons.Tool.createLoadableModuleBuilder(env, loadable_module_suffix='$LDMODULESUFFIX')\n    env['LDMODULE'] = '$SHLINK'\n    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'\n    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'\n    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'\n    env['_LDMODULE_TARGETS'] = _windowsLdmodTargets\n    env['_LDMODULE_SOURCES'] = _windowsLdmodSources\n    env['LDMODULEEMITTER'] = [ldmodEmitter]\n    env['LDMODULECOM'] = compositeLdmodAction\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py",
    "content": "#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\"\"\"SCons.Tool.mssdk\n\nTool-specific initialization for Microsoft SDKs, both Platform\nSDKs and Windows SDKs.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nfrom .MSCommon import mssdk_exists, \\\n                     mssdk_setup_env\n\ndef generate(env):\n    \"\"\"Add construction variables for an MS SDK to an Environment.\"\"\"\n    mssdk_setup_env(env)\n\ndef exists(env):\n    return mssdk_exists()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons.Tool.msvc\n\nTool-specific initialization for Microsoft Visual C/C++.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\nimport os.path\nimport os\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Errors\nimport SCons.Platform.win32\nimport SCons.Tool\nimport SCons.Tool.msvs\nimport SCons.Util\nimport SCons.Warnings\nimport SCons.Scanner.RC\n\nfrom .MSCommon import msvc_exists, msvc_setup_env_once, msvc_version_to_maj_min, msvc_find_vswhere\nfrom .MSCommon.common import get_pch_node\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\ndef validate_vars(env):\n    \"\"\"Validate the PCH and PCHSTOP construction variables.\"\"\"\n    if 'PCH' in env and env['PCH']:\n        if 'PCHSTOP' not in env:\n            raise SCons.Errors.UserError(\"The PCHSTOP construction must be defined if PCH is defined.\")\n        if not SCons.Util.is_String(env['PCHSTOP']):\n            raise SCons.Errors.UserError(\"The PCHSTOP construction variable must be a string: %r\"%env['PCHSTOP'])\n\ndef msvc_set_PCHPDBFLAGS(env):\n    \"\"\"\n    Set appropriate PCHPDBFLAGS for the MSVC version being used.\n    \"\"\"\n    if env.get('MSVC_VERSION',False):\n        maj, min = msvc_version_to_maj_min(env['MSVC_VERSION'])\n        if maj < 8:\n            env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Yd\") or \"\"}'])\n        else:\n            env['PCHPDBFLAGS'] = ''\n    else:\n        # Default if we can't determine which version of MSVC we're using\n        env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Yd\") or \"\"}'])\n\n\ndef pch_emitter(target, source, env):\n    \"\"\"Adds the object file target.\"\"\"\n\n    validate_vars(env)\n\n    pch = None\n    obj = None\n\n    for t in target:\n        if SCons.Util.splitext(str(t))[1] == '.pch':\n            pch = t\n        if SCons.Util.splitext(str(t))[1] == '.obj':\n            obj = t\n\n    if not obj:\n        obj = SCons.Util.splitext(str(pch))[0]+'.obj'\n\n    target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work\n\n    return (target, source)\n\n\ndef object_emitter(target, source, env, parent_emitter):\n    \"\"\"Sets up the PCH dependencies for an object file.\"\"\"\n\n    validate_vars(env)\n\n    parent_emitter(target, source, env)\n\n    # Add a dependency, but only if the target (e.g. 'Source1.obj')\n    # doesn't correspond to the pre-compiled header ('Source1.pch').\n    # If the basenames match, then this was most likely caused by\n    # someone adding the source file to both the env.PCH() and the\n    # env.Program() calls, and adding the explicit dependency would\n    # cause a cycle on the .pch file itself.\n    #\n    # See issue #2505 for a discussion of what to do if it turns\n    # out this assumption causes trouble in the wild:\n    # https://github.com/SCons/scons/issues/2505\n    pch=get_pch_node(env, target, source)\n    if pch:\n        if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':\n            env.Depends(target, pch)\n\n    return (target, source)\n\ndef static_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.StaticObjectEmitter)\n\ndef shared_object_emitter(target, source, env):\n    return object_emitter(target, source, env,\n                          SCons.Defaults.SharedObjectEmitter)\n\n\ndef gen_ccpchflags(env, target, source, for_signature):\n    \"\"\"\n    Generator for CCPCHFLAGS\n    if PCH is not defined or evaluates to a false value, then return empty string.\n    \"\"\"\n    pch_node = get_pch_node(env, target, source)\n    if not pch_node:\n        return ''\n        \n    return SCons.Util.CLVar([\"/Yu$PCHSTOP\", \"/Fp%s\" % pch_node])\n\npch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')\npch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',\n                                    emitter=pch_emitter,\n                                    source_scanner=SCons.Tool.SourceFileScanner)\n\n\n# Logic to build .rc files into .res files (resource files)\nres_scanner = SCons.Scanner.RC.RCScan()\nres_action  = SCons.Action.Action('$RCCOM', '$RCCOMSTR')\nres_builder = SCons.Builder.Builder(action=res_action,\n                                    src_suffix='.rc',\n                                    suffix='.res',\n                                    src_builder=[],\n                                    source_scanner=res_scanner)\n\ndef msvc_batch_key(action, env, target, source):\n    \"\"\"\n    Returns a key to identify unique batches of sources for compilation.\n\n    If batching is enabled (via the $MSVC_BATCH setting), then all\n    target+source pairs that use the same action, defined by the same\n    environment, and have the same target and source directories, will\n    be batched.\n\n    Returning None specifies that the specified target+source should not\n    be batched with other compilations.\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better.\n    # Note we need to do the env.subst so $MSVC_BATCH can be a reference to\n    # another construction variable, which is why we test for False and 0\n    # as strings.\n    if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        # We're not using batching; return no key.\n        return None\n    t = target[0]\n    s = source[0]\n    if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]:\n        # The base names are different, so this *must* be compiled\n        # separately; return no key.\n        return None\n    return (id(action), id(env), t.dir, s.dir)\n\ndef msvc_output_flag(target, source, env, for_signature):\n    \"\"\"\n    Returns the correct /Fo flag for batching.\n\n    If batching is disabled or there's only one source file, then we\n    return an /Fo string that specifies the target explicitly.  Otherwise,\n    we return an /Fo string that just specifies the first target's\n    directory (where the Visual C/C++ compiler will put the .obj files).\n    \"\"\"\n\n    # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH\n    # was set to False. This new version should work better. Removed\n    # len(source)==1 as batch mode can compile only one file\n    # (and it also fixed problem with compiling only one changed file\n    # with batch mode enabled)\n    if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):\n        return '/Fo$TARGET'\n    else:\n        # The Visual C/C++ compiler requires a \\ at the end of the /Fo\n        # option to indicate an output directory.  We use os.sep here so\n        # that the test(s) for this can be run on non-Windows systems\n        # without having a hard-coded backslash mess up command-line\n        # argument parsing.\n        # Adding double os.sep's as if the TARGET.dir has a space or otherwise\n        # needs to be quoted they are needed per MSVC's odd behavior\n        # See: https://github.com/SCons/scons/issues/3106\n        return '/Fo${TARGET.dir}' + os.sep*2\n\nCAction = SCons.Action.Action(\"$CCCOM\", \"$CCCOMSTR\",\n                              batch_key=msvc_batch_key,\n                              targets='$CHANGED_TARGETS')\nShCAction = SCons.Action.Action(\"$SHCCCOM\", \"$SHCCCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nCXXAction = SCons.Action.Action(\"$CXXCOM\", \"$CXXCOMSTR\",\n                                batch_key=msvc_batch_key,\n                                targets='$CHANGED_TARGETS')\nShCXXAction = SCons.Action.Action(\"$SHCXXCOM\", \"$SHCXXCOMSTR\",\n                                  batch_key=msvc_batch_key,\n                                  targets='$CHANGED_TARGETS')\n\n\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MSVC++ to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    # TODO(batch):  shouldn't reach in to cmdgen this way; necessary\n    # for now to bypass the checks in Builder.DictCmdGenerator.__call__()\n    # and allow .cc and .cpp to be compiled in the same command line.\n    static_obj.cmdgen.source_ext_match = False\n    shared_obj.cmdgen.source_ext_match = False\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, CAction)\n        shared_obj.add_action(suffix, ShCAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, CXXAction)\n        shared_obj.add_action(suffix, ShCXXAction)\n        static_obj.add_emitter(suffix, static_object_emitter)\n        shared_obj.add_emitter(suffix, shared_object_emitter)\n\n    env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and \"/Z7\") or \"\"}'])\n    env['CCPCHFLAGS'] = gen_ccpchflags\n    env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag\n    env['_CCCOMCOM']  = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'\n    env['CC']         = 'cl'\n    env['CCFLAGS']    = SCons.Util.CLVar('/nologo')\n    env['CFLAGS']     = SCons.Util.CLVar('')\n    env['CCCOM']      = '${TEMPFILE(\"$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM\",\"$CCCOMSTR\")}'\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')\n    env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')\n    env['SHCCCOM']    = '${TEMPFILE(\"$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM\",\"$SHCCCOMSTR\")}'\n    env['CXX']        = '$CC'\n    env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')\n    env['CXXCOM']     = '${TEMPFILE(\"$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM\",\"$CXXCOMSTR\")}'\n    env['SHCXX']      = '$CXX'\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')\n    env['SHCXXCOM']   = '${TEMPFILE(\"$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM\",\"$SHCXXCOMSTR\")}'\n    env['CPPDEFPREFIX']  = '/D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '/I'\n    env['INCSUFFIX']  = ''\n#    env.Append(OBJEMITTER = [static_object_emitter])\n#    env.Append(SHOBJEMITTER = [shared_object_emitter])\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\n    env['RC'] = 'rc'\n    env['RCFLAGS'] = SCons.Util.CLVar('/nologo')\n    env['RCSUFFIXES']=['.rc','.rc2']\n    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'\n    env['BUILDERS']['RES'] = res_builder\n    env['OBJPREFIX']      = ''\n    env['OBJSUFFIX']      = '.obj'\n    env['SHOBJPREFIX']    = '$OBJPREFIX'\n    env['SHOBJSUFFIX']    = '$OBJSUFFIX'\n\n    # MSVC probably wont support unistd.h so default\n    # without it for lex generation\n    env[\"LEXUNISTD\"] = SCons.Util.CLVar(\"--nounistd\")\n\n    # Get user specified vswhere location or locate.\n    env['VSWHERE'] = env.get('VSWHERE', msvc_find_vswhere()) \n\n    # Set-up ms tools paths\n    msvc_setup_env_once(env)\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cc'\n\n    msvc_set_PCHPDBFLAGS(env)\n\n    # Issue #3350\n    # Change tempfile argument joining character from a space to a newline\n    # mslink will fail if any single line is too long, but is fine with many lines\n    # in a tempfile\n    env['TEMPFILEARGJOIN'] = os.linesep\n\n\n    env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'\n    env['BUILDERS']['PCH'] = pch_builder\n\n    if 'ENV' not in env:\n        env['ENV'] = {}\n    if 'SystemRoot' not in env['ENV']:    # required for dlls in the winsxs folders\n        env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\" Tool-specific initialization for Microsoft Visual Studio project files.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\nimport base64\nimport uuid\nimport ntpath\nimport os\nimport pickle\nimport re\nimport sys\n\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Platform.win32\nimport SCons.Script.SConscript\nimport SCons.PathList\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Defaults import processDefines\nfrom SCons.compat import PICKLE_PROTOCOL\nfrom .MSCommon import msvc_exists, msvc_setup_env_once\n\n##############################################################################\n# Below here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef xmlify(s):\n    s = s.replace(\"&\", \"&amp;\") # do this first\n    s = s.replace(\"'\", \"&apos;\")\n    s = s.replace('\"', \"&quot;\")\n    s = s.replace('<', \"&lt;\")\n    s = s.replace('>', \"&gt;\")\n    s = s.replace('\\n', '&#x0A;')\n    return s\n\n\ndef processIncludes(includes, env, target, source):\n    \"\"\"\n    Process a CPPPATH list in includes, given the env, target and source.\n    Returns a list of directory paths. These paths are absolute so we avoid\n    putting pound-prefixed paths in a Visual Studio project file.\n    \"\"\"\n    return [env.Dir(i).abspath for i in\n            SCons.PathList.PathList(includes).subst_path(env, target, source)]\n\n# Work-in-progress\n# individual elements each get a globally unique identifier.\n# however, there also are some \"well known\" guids that either\n# represent something, or are used as a namespace to base\n# generating guids that should be \"in\" the namespace\n#NAMESPACE_PROJECT   = uuid.UUID(\"{D9BD5916-F055-4D77-8C69-9448E02BF433}\")\n#NAMESPACE_SLN_GROUP = uuid.UUID(\"{2D0C29E0-512F-47BE-9AC4-F4CAE74AE16E}\")\n#NAMESPACE_INTERNAL  = uuid.UUID(\"{BAA4019E-6D67-4EF1-B3CB-AE6CD82E4060}\")\n\n# Kinds of projects, as used in solution files\n#PROJECT_KIND_C      = \"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\"\n#PROJECT_KIND_PCL    = \"{786C830F-07A1-408B-BD7F-6EE04809D6DB}\"\n#NAMESPACE_PRJ_FOLDER = \"{66A26720-8FB5-11D2-AA7E-00C04F688DDE}\"\n#NAMESPACE_SLN_FOLDER = \"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\n#NAMESPACE_TEST       = \"{3AC096D0-A1C2-E12C-1390-A8335801FDAB}\"\n\ndef processFlags(flags, env):\n    \"\"\"\n    If /std:c++XX is in flags then we need to ensure /Zc:__cplusplus is in\n    flags to tell intellisense to respect our specified standard\n    \"\"\"\n    if any(f.startswith('/std:c++') for f in flags) and \\\n       not any(f == '/Zc:__cplusplus' for f in flags):\n        flags.append('/Zc:__cplusplus')\n    return [env.subst(f) for f in flags]\n\n\nexternal_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'\n\ndef _generateGUID(slnfile, name, namespace=external_makefile_guid):\n    \"\"\"Generates a GUID for the sln file to use.\n\n    The uuid5 function is used to combine an existing namespace uuid -\n    the one VS uses for C projects (external_makedile_guid) -\n    and a combination of the solution file name (slnfile) and the\n    project name (name).  We just need uniqueness/repeatability.\n\n    Returns (str) \"displayable\" GUID, already wrapped in braces\n    \"\"\"\n\n    # Normalize the slnfile path to a Windows path (\\ separators) so\n    # the generated file has a consistent GUID even if we generate\n    # it on a non-Windows platform.\n    slnfile = ntpath.normpath(str(slnfile))\n    solution = uuid.uuid5(uuid.UUID(namespace), \"%s-%s\" %(slnfile, name))\n    return '{' + str(solution).upper() + '}'\n\n\nversion_re = re.compile(r'(\\d+\\.\\d+)(.*)')\n\n\ndef msvs_parse_version(s):\n    \"\"\"\n    Split a Visual Studio version, which may in fact be something like\n    '7.0Exp', into is version number (returned as a float) and trailing\n    \"suite\" portion.\n    \"\"\"\n    num, suite = version_re.match(s).groups()\n    return float(num), suite\n\n# This is how we re-invoke SCons from inside MSVS Project files.\n# The problem is that we might have been invoked as either scons.bat\n# or scons.py.  If we were invoked directly as scons.py, then we could\n# use sys.argv[0] to find the SCons \"executable,\" but that doesn't work\n# if we were invoked as scons.bat, which uses \"python -c\" to execute\n# things and ends up with \"-c\" as sys.argv[0].  Consequently, we have\n# the MSVS Project file invoke SCons the same way that scons.bat does,\n# which works regardless of how we were invoked.\ndef getExecScriptMain(env, xml=None):\n    scons_home = env.get('SCONS_HOME')\n    if not scons_home and 'SCONS_LIB_DIR' in os.environ:\n        scons_home = os.environ['SCONS_LIB_DIR']\n    if scons_home:\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()\" % scons_home\n    else:\n        version = SCons.__version__\n        exec_script_main = \"from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()\" % locals()\n    if xml:\n        exec_script_main = xmlify(exec_script_main)\n    return exec_script_main\n\n# The string for the Python executable we tell the Project file to use\n# is either sys.executable or, if an external PYTHON_ROOT environment\n# variable exists, $(PYTHON)ROOT\\\\python.exe (generalized a little to\n# pluck the actual executable name from sys.executable).\ntry:\n    python_root = os.environ['PYTHON_ROOT']\nexcept KeyError:\n    python_executable = sys.executable\nelse:\n    python_executable = os.path.join('$$(PYTHON_ROOT)',\n                                     os.path.split(sys.executable)[1])\n\nclass Config:\n    pass\n\ndef splitFully(path):\n    dir, base = os.path.split(path)\n    if dir and dir != '' and dir != path:\n        return splitFully(dir)+[base]\n    if base == '':\n        return []\n    return [base]\n\ndef makeHierarchy(sources):\n    \"\"\"Break a list of files into a hierarchy; for each value, if it is a string,\n       then it is a file.  If it is a dictionary, it is a folder.  The string is\n       the original path of the file.\"\"\"\n\n    hierarchy = {}\n    for file in sources:\n        path = splitFully(file)\n        if len(path):\n            dict = hierarchy\n            for part in path[:-1]:\n                if part not in dict:\n                    dict[part] = {}\n                dict = dict[part]\n            dict[path[-1]] = file\n        #else:\n        #    print 'Warning: failed to decompose path for '+str(file)\n    return hierarchy\n\nclass _UserGenerator:\n    \"\"\"\n    Base class for .dsp.user file generator\n    \"\"\"\n    # Default instance values.\n    # Ok ... a bit defensive, but it does not seem reasonable to crash the\n    # build for a workspace user file. :-)\n    usrhead = None\n    usrdebg = None\n    usrconf = None\n    createfile = False\n    def __init__(self, dspfile, source, env):\n        # DebugSettings should be a list of debug dictionary sorted in the same order\n        # as the target list and variants\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVSProject.\")\n        elif SCons.Util.is_String(env['variant']):\n            variants = [env['variant']]\n        elif SCons.Util.is_List(env['variant']):\n            variants = env['variant']\n\n        if 'DebugSettings' not in env or env['DebugSettings'] is None:\n            dbg_settings = []\n        elif SCons.Util.is_Dict(env['DebugSettings']):\n            dbg_settings = [env['DebugSettings']]\n        elif SCons.Util.is_List(env['DebugSettings']):\n            if len(env['DebugSettings']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'DebugSettings' and 'variant' lists must be the same.\")\n            dbg_settings = []\n            for ds in env['DebugSettings']:\n                if SCons.Util.is_Dict(ds):\n                    dbg_settings.append(ds)\n                else:\n                    dbg_settings.append({})\n        else:\n            dbg_settings = []\n\n        if len(dbg_settings) == 1:\n            dbg_settings = dbg_settings * len(variants)\n\n        self.createfile = self.usrhead and self.usrdebg and self.usrconf and \\\n                            dbg_settings and bool([ds for ds in dbg_settings if ds])\n\n        if self.createfile:\n            dbg_settings = dict(list(zip(variants, dbg_settings)))\n            for var, src in dbg_settings.items():\n                # Update only expected keys\n                trg = {}\n                for key in [k for k in self.usrdebg.keys() if k in src]:\n                    trg[key] = str(src[key])\n                self.configs[var].debug = trg\n\n    def UserHeader(self):\n        encoding = self.env.subst('$MSVSENCODING')\n        versionstr = self.versionstr\n        self.usrfile.write(self.usrhead % locals())\n\n    def UserProject(self):\n        pass\n\n    def Build(self):\n        if not self.createfile:\n            return\n        try:\n            filename = self.dspabs +'.user'\n            self.usrfile = open(filename, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + filename + '\" for writing:' + str(detail))\n        else:\n            self.UserHeader()\n            self.UserProject()\n            self.usrfile.close()\n\nV9UserHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioUserFile\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tShowAllFiles=\"false\"\n\\t>\n\\t<Configurations>\n\"\"\"\n\nV9UserConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\t>\n\\t\\t\\t<DebugSettings\n%(debug_settings)s\n\\t\\t\\t/>\n\\t\\t</Configuration>\n\"\"\"\n\nV9DebugSettings = {\n'Command':'$(TargetPath)',\n'WorkingDirectory': None,\n'CommandArguments': None,\n'Attach':'false',\n'DebuggerType':'3',\n'Remote':'1',\n'RemoteMachine': None,\n'RemoteCommand': None,\n'HttpUrl': None,\n'PDBPath': None,\n'SQLDebugging': None,\n'Environment': None,\n'EnvironmentMerge':'true',\n'DebuggerFlavor': None,\n'MPIRunCommand': None,\n'MPIRunArguments': None,\n'MPIRunWorkingDirectory': None,\n'ApplicationCommand': None,\n'ApplicationArguments': None,\n'ShimCommand': None,\n'MPIAcceptMode': None,\n'MPIAcceptFilter': None,\n}\n\nclass _GenerateV7User(_UserGenerator):\n    \"\"\"Generates a Project file for MSVS .NET\"\"\"\n    def __init__(self, dspfile, source, env):\n        if self.version_num >= 9.0:\n            self.usrhead = V9UserHeader\n            self.usrconf = V9UserConfiguration\n            self.usrdebg = V9DebugSettings\n        _UserGenerator.__init__(self, dspfile, source, env)\n\n    def UserProject(self):\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            debug = self.configs[kind].debug\n            if debug:\n                debug_settings = '\\n'.join(['\\t\\t\\t\\t%s=\"%s\"' % (key, xmlify(value))\n                                            for key, value in debug.items()\n                                            if value is not None])\n                self.usrfile.write(self.usrconf % locals())\n        self.usrfile.write('\\t</Configurations>\\n</VisualStudioUserFile>')\n\nV10UserHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project ToolsVersion=\"%(versionstr)s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nV10UserConfiguration = \"\"\"\\\n\\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">\n%(debug_settings)s\n\\t</PropertyGroup>\n\"\"\"\n\nV10DebugSettings = {\n'LocalDebuggerCommand': None,\n'LocalDebuggerCommandArguments': None,\n'LocalDebuggerEnvironment': None,\n'DebuggerFlavor': 'WindowsLocalDebugger',\n'LocalDebuggerWorkingDirectory': None,\n'LocalDebuggerAttach': None,\n'LocalDebuggerDebuggerType': None,\n'LocalDebuggerMergeEnvironment': None,\n'LocalDebuggerSQLDebugging': None,\n'RemoteDebuggerCommand': None,\n'RemoteDebuggerCommandArguments': None,\n'RemoteDebuggerWorkingDirectory': None,\n'RemoteDebuggerServerName': None,\n'RemoteDebuggerConnection': None,\n'RemoteDebuggerDebuggerType': None,\n'RemoteDebuggerAttach': None,\n'RemoteDebuggerSQLDebugging': None,\n'DeploymentDirectory': None,\n'AdditionalFiles': None,\n'RemoteDebuggerDeployDebugCppRuntime': None,\n'WebBrowserDebuggerHttpUrl': None,\n'WebBrowserDebuggerDebuggerType': None,\n'WebServiceDebuggerHttpUrl': None,\n'WebServiceDebuggerDebuggerType': None,\n'WebServiceDebuggerSQLDebugging': None,\n}\n\nclass _GenerateV10User(_UserGenerator):\n    \"\"\"Generates a Project'user file for MSVS 2010 or later\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n        if version_num >= 14.3:\n            # Visual Studio 2022 is considered to be version 17.\n            self.versionstr = '17.0'\n        elif version_num >= 14.2:\n            # Visual Studio 2019 is considered to be version 16.\n            self.versionstr = '16.0'\n        elif version_num >= 14.1:\n            # Visual Studio 2017 is considered to be version 15.\n            self.versionstr = '15.0'\n        elif version_num == 14.0:\n            self.versionstr = '14.0'\n        else:\n            self.versionstr = '4.0'\n        self.usrhead = V10UserHeader\n        self.usrconf = V10UserConfiguration\n        self.usrdebg = V10DebugSettings\n        _UserGenerator.__init__(self, dspfile, source, env)\n\n    def UserProject(self):\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            debug = self.configs[kind].debug\n            if debug:\n                debug_settings = '\\n'.join(['\\t\\t<%s>%s</%s>' % (key, xmlify(value), key)\n                                            for key, value in debug.items()\n                                            if value is not None])\n                self.usrfile.write(self.usrconf % locals())\n        self.usrfile.write('</Project>')\n\nclass _DSPGenerator:\n    \"\"\" Base class for DSP generators \"\"\"\n\n    srcargs = [\n        'srcs',\n        'incs',\n        'localincs',\n        'resources',\n        'misc']\n\n    def __init__(self, dspfile, source, env):\n        self.dspfile = str(dspfile)\n        try:\n            get_abspath = dspfile.get_abspath\n        except AttributeError:\n            self.dspabs = os.path.abspath(dspfile)\n        else:\n            self.dspabs = get_abspath()\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVSProject.\")\n        elif SCons.Util.is_String(env['variant']):\n            variants = [env['variant']]\n        elif SCons.Util.is_List(env['variant']):\n            variants = env['variant']\n\n        if 'buildtarget' not in env or env['buildtarget'] is None:\n            buildtarget = ['']\n        elif SCons.Util.is_String(env['buildtarget']):\n            buildtarget = [env['buildtarget']]\n        elif SCons.Util.is_List(env['buildtarget']):\n            if len(env['buildtarget']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'buildtarget' and 'variant' lists must be the same.\")\n            buildtarget = []\n            for bt in env['buildtarget']:\n                if SCons.Util.is_String(bt):\n                    buildtarget.append(bt)\n                else:\n                    buildtarget.append(bt.get_abspath())\n        else:\n            buildtarget = [env['buildtarget'].get_abspath()]\n        if len(buildtarget) == 1:\n            bt = buildtarget[0]\n            buildtarget = []\n            for _ in variants:\n                buildtarget.append(bt)\n\n        if 'outdir' not in env or env['outdir'] is None:\n            outdir = ['']\n        elif SCons.Util.is_String(env['outdir']):\n            outdir = [env['outdir']]\n        elif SCons.Util.is_List(env['outdir']):\n            if len(env['outdir']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'outdir' and 'variant' lists must be the same.\")\n            outdir = []\n            for s in env['outdir']:\n                if SCons.Util.is_String(s):\n                    outdir.append(s)\n                else:\n                    outdir.append(s.get_abspath())\n        else:\n            outdir = [env['outdir'].get_abspath()]\n        if len(outdir) == 1:\n            s = outdir[0]\n            outdir = []\n            for v in variants:\n                outdir.append(s)\n\n        if 'runfile' not in env or env['runfile'] is None:\n            runfile = buildtarget[-1:]\n        elif SCons.Util.is_String(env['runfile']):\n            runfile = [env['runfile']]\n        elif SCons.Util.is_List(env['runfile']):\n            if len(env['runfile']) != len(variants):\n                raise SCons.Errors.InternalError(\"Sizes of 'runfile' and 'variant' lists must be the same.\")\n            runfile = []\n            for s in env['runfile']:\n                if SCons.Util.is_String(s):\n                    runfile.append(s)\n                else:\n                    runfile.append(s.get_abspath())\n        else:\n            runfile = [env['runfile'].get_abspath()]\n        if len(runfile) == 1:\n            s = runfile[0]\n            runfile = []\n            for v in variants:\n                runfile.append(s)\n\n        self.sconscript = env['MSVSSCONSCRIPT']\n\n        def GetKeyFromEnv(env, key, variants):\n            \"\"\"\n            Retrieves a specific key from the environment. If the key is\n            present, it is expected to either be a string or a list with length\n            equal to the number of variants. The function returns a list of\n            the desired value (e.g. cpp include paths) guaranteed to be of\n            length equal to the length of the variants list.\n            \"\"\"\n            if key not in env or env[key] is None:\n                return [''] * len(variants)\n            elif SCons.Util.is_String(env[key]):\n                return [env[key]] * len(variants)\n            elif SCons.Util.is_List(env[key]):\n                if len(env[key]) != len(variants):\n                    raise SCons.Errors.InternalError(\"Sizes of '%s' and 'variant' lists must be the same.\" % key)\n                else:\n                    return env[key]\n            else:\n                raise SCons.Errors.InternalError(\"Unsupported type for key '%s' in environment: %s\" %\n                                                 (key, type(env[key])))\n\n        cmdargs = GetKeyFromEnv(env, 'cmdargs', variants)\n\n        # The caller is allowed to put 'cppdefines' and/or 'cpppaths' in the\n        # environment, which is useful if they want to provide per-variant\n        # values for these. Otherwise, we fall back to using the global\n        # 'CPPDEFINES' and 'CPPPATH' functions.\n        if 'cppdefines' in env:\n            cppdefines = GetKeyFromEnv(env, 'cppdefines', variants)\n        else:\n            cppdefines = [env.get('CPPDEFINES', [])] * len(variants)\n        if 'cpppaths' in env:\n            cpppaths = GetKeyFromEnv(env, 'cpppaths', variants)\n        else:\n            cpppaths = [env.get('CPPPATH', [])] * len(variants)\n        if 'cppflags' in env:\n            cppflags = GetKeyFromEnv(env, 'cppflags', variants)\n        else:\n            cppflags = [env.get('CCFLAGS', []) + env.get('CXXFLAGS', []) + env.get('CPPFLAGS', [])] * len(variants)\n\n        self.env = env\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0])\n        self.name = self.env.subst(self.name)\n\n        sourcenames = [\n            'Source Files',\n            'Header Files',\n            'Local Headers',\n            'Resource Files',\n            'Other Files']\n\n        self.sources = {}\n        for n in sourcenames:\n            self.sources[n] = []\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dspabs):\n            self.Parse()\n\n        for t in zip(sourcenames,self.srcargs):\n            if t[1] in self.env:\n                if SCons.Util.is_List(self.env[t[1]]):\n                    for i in self.env[t[1]]:\n                        if i not in self.sources[t[0]]:\n                            self.sources[t[0]].append(i)\n                else:\n                    if not self.env[t[1]] in self.sources[t[0]]:\n                        self.sources[t[0]].append(self.env[t[1]])\n\n        for n in sourcenames:\n            self.sources[n].sort(key=lambda a: a.lower())\n\n        def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines, cpppaths, cppflags, dspfile=dspfile, env=env):\n            config = Config()\n            config.buildtarget = buildtarget\n            config.outdir = outdir\n            config.cmdargs = cmdargs\n            config.cppdefines = cppdefines\n            config.cppflags = cppflags\n            config.runfile = runfile\n\n            # Dir objects can't be pickled, so we need an absolute path here.\n            config.cpppaths = processIncludes(cpppaths, env, None, None)\n\n            match = re.match(r'(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            # DEBUG: leave enabled, test/MSVS/CPPPATH-dirs.py expects this\n            print(\"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dspfile) + \"'\")\n\n        for i in range(len(variants)):\n            AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i], cppdefines[i], cpppaths[i], cppflags[i])\n\n        seen = set()\n        self.platforms = [p.platform for p in self.configs.values()\n                          if not (p.platform in seen or seen.add(p.platform))]\n\n\n    def Build(self):\n        pass\n\nV6DSPHeader = \"\"\"\\\n# Microsoft Developer Studio Project File - Name=\"%(name)s\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) External Target\" 0x0106\n\nCFG=%(name)s - Win32 %(confkey)s\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"%(name)s.mak\" CFG=\"%(name)s - Win32 %(confkey)s\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n\"\"\"\n\nclass _GenerateV6DSP(_DSPGenerator):\n    \"\"\"Generates a Project file for MSVS 6.0\"\"\"\n\n    def PrintHeader(self):\n        # pick a default config\n        confkeys = sorted(self.configs.keys())\n\n        name = self.name\n        confkey = confkeys[0]\n\n        self.file.write(V6DSPHeader % locals())\n\n        for kind in confkeys:\n            self.file.write('!MESSAGE \"%s - Win32 %s\" (based on \"Win32 (x86) External Target\")\\n' % (name, kind))\n\n        self.file.write('!MESSAGE\\n\\n')\n\n    def PrintProject(self):\n        name = self.name\n        self.file.write('# Begin Project\\n'\n                        '# PROP AllowPerConfigDependencies 0\\n'\n                        '# PROP Scc_ProjName \"\"\\n'\n                        '# PROP Scc_LocalPath \"\"\\n\\n')\n\n        first = 1\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            if first == 1:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n                first = 0\n            else:\n                self.file.write('\\n!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name, kind))\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            # have to write this twice, once with the BASE settings, and once without\n            for base in (\"BASE \",\"\"):\n                self.file.write('# PROP %sUse_MFC 0\\n'\n                                '# PROP %sUse_Debug_Libraries ' % (base, base))\n                if 'debug' not in kind.lower():\n                    self.file.write('0\\n')\n                else:\n                    self.file.write('1\\n')\n                self.file.write('# PROP %sOutput_Dir \"%s\"\\n'\n                                '# PROP %sIntermediate_Dir \"%s\"\\n' % (base,outdir,base,outdir))\n                cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1)\n                self.file.write('# PROP %sCmd_Line \"%s\"\\n'\n                                '# PROP %sRebuild_Opt \"-c && %s\"\\n'\n                                '# PROP %sTarget_File \"%s\"\\n'\n                                '# PROP %sBsc_Name \"\"\\n'\n                                '# PROP %sTarget_Dir \"\"\\n'\\\n                                %(base,cmd,base,cmd,base,buildtarget,base,base))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n        self.file.write('\\n!ENDIF\\n\\n'\n                        '# Begin Target\\n\\n')\n        for kind in confkeys:\n            self.file.write('# Name \"%s - Win32 %s\"\\n' % (name,kind))\n        self.file.write('\\n')\n        first = 0\n        for kind in confkeys:\n            if first == 0:\n                self.file.write('!IF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n                first = 1\n            else:\n                self.file.write('!ELSEIF  \"$(CFG)\" == \"%s - Win32 %s\"\\n\\n' % (name,kind))\n        self.file.write('!ENDIF\\n\\n')\n        self.PrintSourceFiles()\n        self.file.write('# End Target\\n'\n                        '# End Project\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '\\n')\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat',\n                      'Header Files': 'h|hpp|hxx|hm|inl',\n                      'Local Headers': 'h|hpp|hxx|hm|inl',\n                      'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',\n                      'Other Files': ''}\n\n        for kind in sorted(categories.keys(), key=lambda a: a.lower()):\n            if not self.sources[kind]:\n                continue # skip empty groups\n\n            self.file.write('# Begin Group \"' + kind + '\"\\n\\n')\n            typelist = categories[kind].replace('|', ';')\n            self.file.write('# PROP Default_Filter \"' + typelist + '\"\\n')\n\n            for file in self.sources[kind]:\n                file = os.path.normpath(file)\n                self.file.write('# Begin Source File\\n\\n'\n                                'SOURCE=\"' + file + '\"\\n'\n                                '# End Source File\\n')\n            self.file.write('# End Group\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('# Begin Source File\\n\\n'\n                        'SOURCE=\"' + str(self.sconscript) + '\"\\n'\n                        '# End Source File\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        # skip until marker\n        while line:\n            if \"# End Project\" in line:\n                break\n            line = dspfile.readline()\n\n        # read to get configs\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except Exception:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        # keep reading to get sources\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n        dspfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        # it has a \"# \" in front of it, so we strip that.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\nV7DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV7DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tOutputDirectory=\"%(outdir)s\"\n\\t\\t\\tIntermediateDirectory=\"%(outdir)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\">\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"/>\n\\t\\t</Configuration>\n\"\"\"\n\nV8DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<VisualStudioProject\n\\tProjectType=\"Visual C++\"\n\\tVersion=\"%(versionstr)s\"\n\\tName=\"%(name)s\"\n\\tProjectGUID=\"%(project_guid)s\"\n\\tRootNamespace=\"%(name)s\"\n%(scc_attrs)s\n\\tKeyword=\"MakeFileProj\">\n\"\"\"\n\nV8DSPConfiguration = \"\"\"\\\n\\t\\t<Configuration\n\\t\\t\\tName=\"%(variant)s|%(platform)s\"\n\\t\\t\\tConfigurationType=\"0\"\n\\t\\t\\tUseOfMFC=\"0\"\n\\t\\t\\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\\t\\t\\t>\n\\t\\t\\t<Tool\n\\t\\t\\t\\tName=\"VCNMakeTool\"\n\\t\\t\\t\\tBuildCommandLine=\"%(buildcmd)s\"\n\\t\\t\\t\\tReBuildCommandLine=\"%(rebuildcmd)s\"\n\\t\\t\\t\\tCleanCommandLine=\"%(cleancmd)s\"\n\\t\\t\\t\\tOutput=\"%(runfile)s\"\n\\t\\t\\t\\tPreprocessorDefinitions=\"%(preprocdefs)s\"\n\\t\\t\\t\\tIncludeSearchPath=\"%(includepath)s\"\n\\t\\t\\t\\tForcedIncludes=\"\"\n\\t\\t\\t\\tAssemblySearchPath=\"\"\n\\t\\t\\t\\tForcedUsingAssemblies=\"\"\n\\t\\t\\t\\tCompileAsManaged=\"\"\n\\t\\t\\t/>\n\\t\\t</Configuration>\n\"\"\"\nclass _GenerateV7DSP(_DSPGenerator, _GenerateV7User):\n    \"\"\"Generates a Project file for MSVS .NET\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n        self.version = env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        if self.version_num >= 9.0:\n            self.versionstr = '9.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        elif self.version_num >= 8.0:\n            self.versionstr = '8.00'\n            self.dspheader = V8DSPHeader\n            self.dspconfiguration = V8DSPConfiguration\n        else:\n            if self.version_num >= 7.1:\n                self.versionstr = '7.10'\n            else:\n                self.versionstr = '7.00'\n            self.dspheader = V7DSPHeader\n            self.dspconfiguration = V7DSPConfiguration\n        self.file = None\n\n        _GenerateV7User.__init__(self, dspfile, source, env)\n\n    def PrintHeader(self):\n        env = self.env\n        versionstr = self.versionstr\n        name = self.name\n        encoding = self.env.subst('$MSVSENCODING')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\tSccProjectName=\"%s\"\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\tSccAuxPath=\"%s\"\\n' % scc_aux_path\n            scc_attrs += ('\\tSccLocalPath=\"%s\"\\n'\n                          '\\tSccProvider=\"%s\"' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\tSccProjectName=\"%s\"\\n'\n                         '\\tSccLocalPath=\"%s\"' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspheader = self.dspheader.replace('%(scc_attrs)s\\n', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<Platforms>\\n')\n        for platform in self.platforms:\n            self.file.write(\n                        '\\t\\t<Platform\\n'\n                        '\\t\\t\\tName=\"%s\"/>\\n' % platform)\n        self.file.write('\\t</Platforms>\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\t<ToolFiles>\\n'\n                            '\\t</ToolFiles>\\n')\n\n    def PrintProject(self):\n        self.file.write('\\t<Configurations>\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n            cpppaths = self.configs[kind].cpppaths\n            cppdefines = self.configs[kind].cppdefines\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(cppdefines)))\n            includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</Configurations>\\n')\n\n        if self.version_num >= 7.1:\n            self.file.write('\\t<References>\\n'\n                            '\\t</References>\\n')\n\n        self.PrintSourceFiles()\n\n        self.file.write('</VisualStudioProject>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '-->\\n')\n\n    def printSources(self, hierarchy, commonprefix):\n        sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.file.write('\\t\\t\\t<Filter\\n'\n                                '\\t\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\t\\tFilter=\"\">\\n' % key)\n                self.printSources(value, commonprefix)\n                self.file.write('\\t\\t\\t</Filter>\\n')\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n                self.file.write('\\t\\t\\t<File\\n'\n                                '\\t\\t\\t\\tRelativePath=\"%s\">\\n'\n                                '\\t\\t\\t</File>\\n' % file)\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        self.file.write('\\t<Files>\\n')\n\n        cats = sorted([k for k in categories.keys() if self.sources[k]],\n                      key=lambda a: a.lower())\n        for kind in cats:\n            if len(cats) > 1:\n                self.file.write('\\t\\t<Filter\\n'\n                                '\\t\\t\\tName=\"%s\"\\n'\n                                '\\t\\t\\tFilter=\"%s\">\\n' % (kind, categories[kind]))\n\n            sources = self.sources[kind]\n\n            # First remove any common prefix\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, commonprefix=commonprefix)\n\n            if len(cats)>1:\n                self.file.write('\\t\\t</Filter>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t\\t<File\\n'\n                        '\\t\\t\\tRelativePath=\"%s\">\\n'\n                        '\\t\\t</File>\\n' % str(self.sconscript))\n\n        self.file.write('\\t</Files>\\n'\n                        '\\t<Globals>\\n'\n                        '\\t</Globals>\\n')\n\n    def Parse(self):\n        try:\n            dspfile = open(self.dspabs,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dspfile.readline()\n        # skip until marker\n        while line:\n            if '<!-- SCons Data:' in line:\n                break\n            line = dspfile.readline()\n\n        # read to get configs\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n        # keep reading to get sources\n        data = None\n        line = dspfile.readline()\n        datas = line\n        while line and line != '\\n':\n            line = dspfile.readline()\n            datas = datas + line\n        dspfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.sources.update(data)\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\n        _GenerateV7User.Build(self)\n\nV10DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"%(versionstr)s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nV10DSPProjectConfiguration = \"\"\"\\\n\\t\\t<ProjectConfiguration Include=\"%(variant)s|%(platform)s\">\n\\t\\t\\t<Configuration>%(variant)s</Configuration>\n\\t\\t\\t<Platform>%(platform)s</Platform>\n\\t\\t</ProjectConfiguration>\n\"\"\"\n\nV10DSPGlobals = \"\"\"\\\n\\t<PropertyGroup Label=\"Globals\">\n\\t\\t<ProjectGuid>%(project_guid)s</ProjectGuid>\n%(scc_attrs)s\\t\\t<RootNamespace>%(name)s</RootNamespace>\n\\t\\t<Keyword>MakeFileProj</Keyword>\n\\t\\t<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPPropertyGroupCondition = \"\"\"\\\n\\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"Configuration\">\n\\t\\t<ConfigurationType>Makefile</ConfigurationType>\n\\t\\t<UseOfMfc>false</UseOfMfc>\n\\t\\t<PlatformToolset>%(toolset)s</PlatformToolset>\n\\t</PropertyGroup>\n\"\"\"\n\nV10DSPImportGroupCondition = \"\"\"\\\n\\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\" Label=\"PropertySheets\">\n\\t\\t<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n\\t</ImportGroup>\n\"\"\"\n\nV10DSPCommandLine = \"\"\"\\\n\\t\\t<NMakeBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(buildcmd)s</NMakeBuildCommandLine>\n\\t\\t<NMakeReBuildCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(rebuildcmd)s</NMakeReBuildCommandLine>\n\\t\\t<NMakeCleanCommandLine Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(cleancmd)s</NMakeCleanCommandLine>\n\\t\\t<NMakeOutput Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(runfile)s</NMakeOutput>\n\\t\\t<NMakePreprocessorDefinitions Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(preprocdefs)s</NMakePreprocessorDefinitions>\n\\t\\t<NMakeIncludeSearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(includepath)s</NMakeIncludeSearchPath>\n\\t\\t<NMakeForcedIncludes Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedIncludes)</NMakeForcedIncludes>\n\\t\\t<NMakeAssemblySearchPath Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\n\\t\\t<NMakeForcedUsingAssemblies Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\n\\t\\t<AdditionalOptions Condition=\"'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'\">%(additionaloptions)s</AdditionalOptions>\n\"\"\"\n\nV15DSPHeader = \"\"\"\\\n<?xml version=\"1.0\" encoding=\"%(encoding)s\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\"\"\"\n\nclass _GenerateV10DSP(_DSPGenerator, _GenerateV10User):\n    \"\"\"Generates a Project file for MSVS 2010\"\"\"\n\n    def __init__(self, dspfile, source, env):\n        _DSPGenerator.__init__(self, dspfile, source, env)\n        self.dspheader = V10DSPHeader\n        self.dspconfiguration = V10DSPProjectConfiguration\n        self.dspglobals = V10DSPGlobals\n\n        _GenerateV10User.__init__(self, dspfile, source, env)\n\n    def PrintHeader(self):\n        env = self.env\n        name = self.name\n        versionstr = self.versionstr\n        encoding = env.subst('$MSVSENCODING')\n        project_guid = env.get('MSVS_PROJECT_GUID', '')\n        scc_provider = env.get('MSVS_SCC_PROVIDER', '')\n        scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')\n        scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')\n        # MSVS_SCC_LOCAL_PATH is kept  for backwards compatibility purpose and should\n        # be deprecated as soon as possible.\n        scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')\n        scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n        scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))\n        if not project_guid:\n            project_guid = _generateGUID(self.dspfile, '')\n        if scc_provider != '':\n            scc_attrs = '\\t\\t<SccProjectName>%s</SccProjectName>\\n' % scc_project_name\n            if scc_aux_path != '':\n                scc_attrs += '\\t\\t<SccAuxPath>%s</SccAuxPath>\\n' % scc_aux_path\n            scc_attrs += ('\\t\\t<SccLocalPath>%s</SccLocalPath>\\n'\n                          '\\t\\t<SccProvider>%s</SccProvider>\\n' % (scc_local_path, scc_provider))\n        elif scc_local_path_legacy != '':\n            # This case is kept for backwards compatibility purpose and should\n            # be deprecated as soon as possible.\n            scc_attrs = ('\\t\\t<SccProjectName>%s</SccProjectName>\\n'\n                         '\\t\\t<SccLocalPath>%s</SccLocalPath>\\n' % (scc_project_name, scc_local_path_legacy))\n        else:\n            self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')\n\n        self.file.write(self.dspheader % locals())\n\n        self.file.write('\\t<ItemGroup Label=\"ProjectConfigurations\">\\n')\n\n        confkeys = sorted(self.configs.keys())\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(self.dspconfiguration % locals())\n\n        self.file.write('\\t</ItemGroup>\\n')\n\n        self.file.write(self.dspglobals % locals())\n\n    def PrintProject(self):\n        name = self.name\n        confkeys = sorted(self.configs.keys())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\\n')\n\n        toolset = ''\n        if 'MSVC_VERSION' in self.env:\n            version_num, suite = msvs_parse_version(self.env['MSVC_VERSION'])\n            toolset = 'v%d' % (version_num * 10)\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPPropertyGroupCondition % locals())\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />\\n')\n        self.file.write('\\t<ImportGroup Label=\"ExtensionSettings\">\\n')\n        self.file.write('\\t</ImportGroup>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            self.file.write(V10DSPImportGroupCondition % locals())\n\n        self.file.write('\\t<PropertyGroup Label=\"UserMacros\" />\\n')\n        self.file.write('\\t<PropertyGroup>\\n')\n        self.file.write('\\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\\n')\n\n        for kind in confkeys:\n            variant = self.configs[kind].variant\n            platform = self.configs[kind].platform\n            outdir = self.configs[kind].outdir\n            buildtarget = self.configs[kind].buildtarget\n            runfile     = self.configs[kind].runfile\n            cmdargs = self.configs[kind].cmdargs\n            cpppaths = self.configs[kind].cpppaths\n            cppdefines = self.configs[kind].cppdefines\n            cppflags = self.configs[kind].cppflags\n\n            env_has_buildtarget = 'MSVSBUILDTARGET' in self.env\n            if not env_has_buildtarget:\n                self.env['MSVSBUILDTARGET'] = buildtarget\n\n            starting = 'echo Starting SCons && '\n            if cmdargs:\n                cmdargs = ' ' + cmdargs\n            else:\n                cmdargs = ''\n            buildcmd    = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)\n            rebuildcmd  = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)\n            cleancmd    = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)\n\n            # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,\n            # so they could vary depending on the command being generated.  This code\n            # assumes they don't.\n            preprocdefs = xmlify(';'.join(processDefines(cppdefines)))\n            includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))\n            additionaloptions = xmlify(' '.join(processFlags(cppflags, self.env)))\n\n            if not env_has_buildtarget:\n                del self.env['MSVSBUILDTARGET']\n\n            self.file.write(V10DSPCommandLine % locals())\n\n        self.file.write('\\t</PropertyGroup>\\n')\n\n        #filter settings in MSVS 2010 are stored in separate file\n        self.filtersabs = self.dspabs + '.filters'\n        try:\n            self.filters_file = open(self.filtersabs, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.filtersabs + '\" for writing:' + str(detail))\n\n        self.filters_file.write('<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n'\n                                '<Project ToolsVersion=\"%s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\\n' %\n                                self.versionstr)\n\n        self.PrintSourceFiles()\n\n        self.filters_file.write('</Project>')\n        self.filters_file.close()\n\n        self.file.write('\\t<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />\\n'\n                        '\\t<ImportGroup Label=\"ExtensionTargets\">\\n'\n                        '\\t</ImportGroup>\\n'\n                        '</Project>\\n')\n\n        if self.nokeep == 0:\n            # now we pickle some data and add it to the file -- MSDEV will ignore it.\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write('<!-- SCons Data:\\n' + pdata + '\\n')\n            pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata + '-->\\n')\n\n    def printFilters(self, hierarchy, name):\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                filter_name = name + '\\\\' + key\n                self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                        '\\t\\t\\t<UniqueIdentifier>%s</UniqueIdentifier>\\n'\n                                        '\\t\\t</Filter>\\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))\n                self.printFilters(value, filter_name)\n\n    def printSources(self, hierarchy, kind, commonprefix, filter_name):\n        keywords = {'Source Files': 'ClCompile',\n                    'Header Files': 'ClInclude',\n                    'Local Headers': 'ClInclude',\n                    'Resource Files': 'None',\n                    'Other Files': 'None'}\n\n        sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())\n\n        # First folders, then files\n        for key, value in sorteditems:\n            if SCons.Util.is_Dict(value):\n                self.printSources(value, kind, commonprefix, filter_name + '\\\\' + key)\n\n        for key, value in sorteditems:\n            if SCons.Util.is_String(value):\n                file = value\n                if commonprefix:\n                    file = os.path.join(commonprefix, value)\n                file = os.path.normpath(file)\n\n                self.file.write('\\t\\t<%s Include=\"%s\" />\\n' % (keywords[kind], file))\n                self.filters_file.write('\\t\\t<%s Include=\"%s\">\\n'\n                                        '\\t\\t\\t<Filter>%s</Filter>\\n'\n                                        '\\t\\t</%s>\\n' % (keywords[kind], file, filter_name, keywords[kind]))\n\n    def PrintSourceFiles(self):\n        categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',\n                      'Header Files': 'h;hpp;hxx;hm;inl',\n                      'Local Headers': 'h;hpp;hxx;hm;inl',\n                      'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',\n                      'Other Files': ''}\n\n        cats = sorted([k for k in categories.keys() if self.sources[k]],\n                      key = lambda a: a.lower())\n\n        # print vcxproj.filters file first\n        self.filters_file.write('\\t<ItemGroup>\\n')\n        for kind in cats:\n            self.filters_file.write('\\t\\t<Filter Include=\"%s\">\\n'\n                                    '\\t\\t\\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\\n'\n                                    '\\t\\t\\t<Extensions>%s</Extensions>\\n'\n                                    '\\t\\t</Filter>\\n' % (kind, categories[kind]))\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printFilters(hierarchy, kind)\n\n        self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # then print files and filters\n        for kind in cats:\n            self.file.write('\\t<ItemGroup>\\n')\n            self.filters_file.write('\\t<ItemGroup>\\n')\n\n            # First remove any common prefix\n            sources = self.sources[kind]\n            commonprefix = None\n            s = list(map(os.path.normpath, sources))\n            # take the dirname because the prefix may include parts\n            # of the filenames (e.g. if you have 'dir\\abcd' and\n            # 'dir\\acde' then the cp will be 'dir\\a' )\n            cp = os.path.dirname( os.path.commonprefix(s) )\n            if cp and s[0][len(cp)] == os.sep:\n                # +1 because the filename starts after the separator\n                sources = [s[len(cp)+1:] for s in sources]\n                commonprefix = cp\n\n            hierarchy = makeHierarchy(sources)\n            self.printSources(hierarchy, kind, commonprefix, kind)\n\n            self.file.write('\\t</ItemGroup>\\n')\n            self.filters_file.write('\\t</ItemGroup>\\n')\n\n        # add the SConscript file outside of the groups\n        self.file.write('\\t<ItemGroup>\\n'\n                        '\\t\\t<None Include=\"%s\" />\\n'\n                        #'\\t\\t<None Include=\"SConstruct\" />\\n'\n                        '\\t</ItemGroup>\\n' % str(self.sconscript))\n\n    def Parse(self):\n        # DEBUG\n        # print(\"_GenerateV10DSP.Parse()\")\n        pass\n\n    def Build(self):\n        try:\n            self.file = open(self.dspabs, 'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dspabs + '\" for writing:' + str(detail))\n        else:\n            self.PrintHeader()\n            self.PrintProject()\n            self.file.close()\n\n        _GenerateV10User.Build(self)\n\nclass _DSWGenerator:\n    \"\"\" Base class for DSW generators \"\"\"\n    def __init__(self, dswfile, source, env):\n        self.dswfile = os.path.normpath(str(dswfile))\n        self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile))\n        self.env = env\n\n        if 'projects' not in env:\n            raise SCons.Errors.UserError(\"You must specify a 'projects' argument to create an MSVSSolution.\")\n        projects = env['projects']\n        if not SCons.Util.is_List(projects):\n            raise SCons.Errors.InternalError(\"The 'projects' argument must be a list of nodes.\")\n        projects = SCons.Util.flatten(projects)\n        if len(projects) < 1:\n            raise SCons.Errors.UserError(\"You must specify at least one project to create an MSVSSolution.\")\n        self.dspfiles = list(map(str, projects))\n\n        if 'name' in self.env:\n            self.name = self.env['name']\n        else:\n            self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0])\n        self.name = self.env.subst(self.name)\n\n    def Build(self):\n        pass\n\nclass _GenerateV7DSW(_DSWGenerator):\n    \"\"\"Generates a Solution file for MSVS .NET\"\"\"\n    def __init__(self, dswfile, source, env):\n        _DSWGenerator.__init__(self, dswfile, source, env)\n\n        self.file = None\n        self.version = self.env['MSVS_VERSION']\n        self.version_num, self.suite = msvs_parse_version(self.version)\n        self.versionstr = '7.00'\n        if self.version_num >= 11.0:\n            self.versionstr = '12.00'\n        elif self.version_num >= 10.0:\n            self.versionstr = '11.00'\n        elif self.version_num >= 9.0:\n            self.versionstr = '10.00'\n        elif self.version_num >= 8.0:\n            self.versionstr = '9.00'\n        elif self.version_num >= 7.1:\n            self.versionstr = '8.00'\n\n        if 'slnguid' in env and env['slnguid']:\n            self.slnguid = env['slnguid']\n        else:\n            self.slnguid = _generateGUID(dswfile, self.name)\n\n        self.configs = {}\n\n        self.nokeep = 0\n        if 'nokeep' in env and env['variant'] != 0:\n            self.nokeep = 1\n\n        if self.nokeep == 0 and os.path.exists(self.dswfile):\n            self.Parse()\n\n        def AddConfig(self, variant, dswfile=dswfile):\n            config = Config()\n\n            match = re.match(r'(.*)\\|(.*)', variant)\n            if match:\n                config.variant = match.group(1)\n                config.platform = match.group(2)\n            else:\n                config.variant = variant\n                config.platform = 'Win32'\n\n            self.configs[variant] = config\n            # DEBUG\n            # print(\"Adding '\" + self.name + ' - ' + config.variant + '|' + config.platform + \"' to '\" + str(dswfile) + \"'\")\n\n        if 'variant' not in env:\n            raise SCons.Errors.InternalError(\"You must specify a 'variant' argument (i.e. 'Debug' or \" +\\\n                  \"'Release') to create an MSVS Solution File.\")\n        elif SCons.Util.is_String(env['variant']):\n            AddConfig(self, env['variant'])\n        elif SCons.Util.is_List(env['variant']):\n            for variant in env['variant']:\n                AddConfig(self, variant)\n\n        seen = set()\n        self.platforms = [p.platform for p in self.configs.values()\n                          if not (p.platform in seen or seen.add(p.platform))]\n\n        def GenerateProjectFilesInfo(self):\n            for dspfile in self.dspfiles:\n                dsp_folder_path, name = os.path.split(dspfile)\n                dsp_folder_path = os.path.abspath(dsp_folder_path)\n                if SCons.Util.splitext(name)[1] == '.filters':\n                    # Ignore .filters project files\n                    continue\n                dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path)\n                if dsp_relative_folder_path == os.curdir:\n                    dsp_relative_file_path = name\n                else:\n                    dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)\n                dspfile_info = {'NAME': name,\n                                'GUID': _generateGUID(dspfile, ''),\n                                'FOLDER_PATH': dsp_folder_path,\n                                'FILE_PATH': dspfile,\n                                'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,\n                                'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}\n                self.dspfiles_info.append(dspfile_info)\n\n        self.dspfiles_info = []\n        GenerateProjectFilesInfo(self)\n\n    def Parse(self):\n        try:\n            dswfile = open(self.dswfile,'r')\n        except IOError:\n            return # doesn't exist yet, so can't add anything to configs.\n\n        line = dswfile.readline()\n        while line:\n            if line[:9] == \"EndGlobal\":\n                break\n            line = dswfile.readline()\n\n        line = dswfile.readline()\n        datas = line\n        while line:\n            line = dswfile.readline()\n            datas = datas + line\n        dswfile.close()\n\n        # OK, we've found our little pickled cache of data.\n        try:\n            datas = base64.decodestring(datas)\n            data = pickle.loads(datas)\n        except KeyboardInterrupt:\n            raise\n        except:\n            return # unable to unpickle any data for some reason\n\n        self.configs.update(data)\n\n    def PrintSolution(self):\n        \"\"\"Writes a solution file\"\"\"\n        self.file.write('Microsoft Visual Studio Solution File, Format Version %s\\n' % self.versionstr)\n        if self.version_num >= 14.3:\n            # Visual Studio 2022 is considered to be version 17.\n            self.file.write('# Visual Studio 17\\n')\n        elif self.version_num >= 14.2:\n            # Visual Studio 2019 is considered to be version 16.\n            self.file.write('# Visual Studio 16\\n')\n        elif self.version_num > 14.0:\n            # Visual Studio 2015 and 2017 are both considered to be version 15.\n            self.file.write('# Visual Studio 15\\n')\n        elif self.version_num >= 12.0:\n            self.file.write('# Visual Studio 14\\n')\n        elif self.version_num >= 11.0:\n            self.file.write('# Visual Studio 11\\n')\n        elif self.version_num >= 10.0:\n            self.file.write('# Visual Studio 2010\\n')\n        elif self.version_num >= 9.0:\n            self.file.write('# Visual Studio 2008\\n')\n        elif self.version_num >= 8.0:\n            self.file.write('# Visual Studio 2005\\n')\n\n        for dspinfo in self.dspfiles_info:\n            name = dspinfo['NAME']\n            base, suffix = SCons.Util.splitext(name)\n            if suffix == '.vcproj':\n                name = base\n            self.file.write('Project(\"%s\") = \"%s\", \"%s\", \"%s\"\\n'\n                            % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))\n            if 7.1 <= self.version_num < 8.0:\n                self.file.write('\\tProjectSection(ProjectDependencies) = postProject\\n'\n                                '\\tEndProjectSection\\n')\n            self.file.write('EndProject\\n')\n\n        self.file.write('Global\\n')\n\n        env = self.env\n        if 'MSVS_SCC_PROVIDER' in env:\n            scc_number_of_projects = len(self.dspfiles) + 1\n            slnguid = self.slnguid\n            scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\\u0020')\n            scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\\u0020')\n            scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)\n            scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\\\', '\\\\\\\\')\n            self.file.write('\\tGlobalSection(SourceCodeControl) = preSolution\\n'\n                            '\\t\\tSccNumberOfProjects = %(scc_number_of_projects)d\\n'\n                            '\\t\\tSccProjectName0 = %(scc_project_name)s\\n'\n                            '\\t\\tSccLocalPath0 = %(scc_local_path)s\\n'\n                            '\\t\\tSccProvider0 = %(scc_provider)s\\n'\n                            '\\t\\tCanCheckoutShared = true\\n'  % locals())\n            sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root)\n            if sln_relative_path_from_scc != os.curdir:\n                self.file.write('\\t\\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\\\\\\n'\n                                % sln_relative_path_from_scc.replace('\\\\', '\\\\\\\\'))\n            if self.version_num < 8.0:\n                # When present, SolutionUniqueID is automatically removed by VS 2005\n                # TODO: check for Visual Studio versions newer than 2005\n                self.file.write('\\t\\tSolutionUniqueID = %s\\n' % slnguid)\n            for dspinfo in self.dspfiles_info:\n                i = self.dspfiles_info.index(dspinfo) + 1\n                dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\\\', '\\\\\\\\')\n                dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\\\', '\\\\\\\\')\n                self.file.write('\\t\\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\\n'\n                                '\\t\\tSccLocalPath%(i)d = %(scc_local_path)s\\n'\n                                '\\t\\tCanCheckoutShared = true\\n'\n                                '\\t\\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\\\\\\n'\n                                % locals())\n            self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(SolutionConfiguration) = preSolution\\n')\n\n        confkeys = sorted(self.configs.keys())\n        cnt = 0\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                self.file.write('\\t\\t%s|%s = %s|%s\\n' % (variant, platform, variant, platform))\n            else:\n                self.file.write('\\t\\tConfigName.%d = %s\\n' % (cnt, variant))\n            cnt = cnt + 1\n        self.file.write('\\tEndGlobalSection\\n')\n        if self.version_num <= 7.1:\n            self.file.write('\\tGlobalSection(ProjectDependencies) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\\n')\n        else:\n            self.file.write('\\tGlobalSection(ProjectConfiguration) = postSolution\\n')\n\n        for name in confkeys:\n            variant = self.configs[name].variant\n            platform = self.configs[name].platform\n            if self.version_num >= 8.0:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s|%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s|%s.Build.0 = %s|%s\\n'  % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))\n            else:\n                for dspinfo in self.dspfiles_info:\n                    guid = dspinfo['GUID']\n                    self.file.write('\\t\\t%s.%s.ActiveCfg = %s|%s\\n'\n                                    '\\t\\t%s.%s.Build.0 = %s|%s\\n'  %(guid,variant,variant,platform,guid,variant,variant,platform))\n\n        self.file.write('\\tEndGlobalSection\\n')\n\n        if self.version_num >= 8.0:\n            self.file.write('\\tGlobalSection(SolutionProperties) = preSolution\\n'\n                            '\\t\\tHideSolutionNode = FALSE\\n'\n                            '\\tEndGlobalSection\\n')\n        else:\n            self.file.write('\\tGlobalSection(ExtensibilityGlobals) = postSolution\\n'\n                            '\\tEndGlobalSection\\n'\n                            '\\tGlobalSection(ExtensibilityAddIns) = postSolution\\n'\n                            '\\tEndGlobalSection\\n')\n        self.file.write('EndGlobal\\n')\n        if self.nokeep == 0:\n            pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)\n            pdata = base64.b64encode(pdata).decode()\n            self.file.write(pdata)\n            self.file.write('\\n')\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintSolution()\n            self.file.close()\n\nV6DSWHeader = \"\"\"\\\nMicrosoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"%(name)s\"=\"%(dspfile)s\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\"\"\"\n\nclass _GenerateV6DSW(_DSWGenerator):\n    \"\"\"Generates a Workspace file for MSVS 6.0\"\"\"\n\n    def PrintWorkspace(self):\n        \"\"\" writes a DSW file \"\"\"\n        name = self.name\n        dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path)\n        self.file.write(V6DSWHeader % locals())\n\n    def Build(self):\n        try:\n            self.file = open(self.dswfile,'w')\n        except IOError as detail:\n            raise SCons.Errors.InternalError('Unable to open \"' + self.dswfile + '\" for writing:' + str(detail))\n        else:\n            self.PrintWorkspace()\n            self.file.close()\n\n\ndef GenerateDSP(dspfile, source, env):\n    \"\"\"Generates a Project file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 10.0:\n        g = _GenerateV10DSP(dspfile, source, env)\n        g.Build()\n    elif version_num >= 7.0:\n        g = _GenerateV7DSP(dspfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSP(dspfile, source, env)\n        g.Build()\n\ndef GenerateDSW(dswfile, source, env):\n    \"\"\"Generates a Solution/Workspace file based on the version of MSVS that is being used\"\"\"\n\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 7.0:\n        g = _GenerateV7DSW(dswfile, source, env)\n        g.Build()\n    else:\n        g = _GenerateV6DSW(dswfile, source, env)\n        g.Build()\n\n\n##############################################################################\n# Above here are the classes and functions for generation of\n# DSP/DSW/SLN/VCPROJ files.\n##############################################################################\n\ndef GetMSVSProjectSuffix(target, source, env, for_signature):\n    return env['MSVS']['PROJECTSUFFIX']\n\ndef GetMSVSSolutionSuffix(target, source, env, for_signature):\n    return env['MSVS']['SOLUTIONSUFFIX']\n\ndef GenerateProject(target, source, env):\n    # generate the dsp file, according to the version of MSVS.\n    builddspfile = target[0]\n    dspfile = builddspfile.srcnode()\n\n    # this detects whether or not we're using a VariantDir\n    if dspfile is not builddspfile:\n        try:\n            bdsp = open(str(builddspfile), \"w+\")\n        except IOError as detail:\n            print('Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n')\n            raise\n\n        bdsp.write(\"This is just a placeholder file.\\nThe real project file is here:\\n%s\\n\" % dspfile.get_abspath())\n        bdsp.close()\n\n    GenerateDSP(dspfile, source, env)\n\n    if env.get('auto_build_solution', 1):\n        builddswfile = target[1]\n        dswfile = builddswfile.srcnode()\n\n        if dswfile is not builddswfile:\n\n            try:\n                bdsw = open(str(builddswfile), \"w+\")\n            except IOError as detail:\n                print('Unable to open \"' + str(dspfile) + '\" for writing:',detail,'\\n')\n                raise\n\n            bdsw.write(\"This is just a placeholder file.\\nThe real workspace file is here:\\n%s\\n\" % dswfile.get_abspath())\n            bdsw.close()\n\n        GenerateDSW(dswfile, source, env)\n\ndef GenerateSolution(target, source, env):\n    GenerateDSW(target[0], source, env)\n\ndef projectEmitter(target, source, env):\n    \"\"\"Sets up the DSP dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSPROJECTSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSPROJECTSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'prj_inputs:'\n        source = source + env.subst('$MSVSSCONSCOM', 1)\n        source = source + env.subst('$MSVSENCODING', 1)\n\n        # Project file depends on CPPDEFINES and CPPPATH\n        preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', []))))\n        includepath = xmlify(';'.join(processIncludes(env.get('CPPPATH', []), env, None, None)))\n        source = source + \"; ppdefs:%s incpath:%s\"%(preprocdefs, includepath)\n\n        if 'buildtarget' in env and env['buildtarget'] is not None:\n            if SCons.Util.is_String(env['buildtarget']):\n                source = source + ' \"%s\"' % env['buildtarget']\n            elif SCons.Util.is_List(env['buildtarget']):\n                for bt in env['buildtarget']:\n                    if SCons.Util.is_String(bt):\n                        source = source + ' \"%s\"' % bt\n                    else:\n                        try: source = source + ' \"%s\"' % bt.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['buildtarget'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"buildtarget can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'outdir' in env and env['outdir'] is not None:\n            if SCons.Util.is_String(env['outdir']):\n                source = source + ' \"%s\"' % env['outdir']\n            elif SCons.Util.is_List(env['outdir']):\n                for s in env['outdir']:\n                    if SCons.Util.is_String(s):\n                        source = source + ' \"%s\"' % s\n                    else:\n                        try: source = source + ' \"%s\"' % s.get_abspath()\n                        except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n            else:\n                try: source = source + ' \"%s\"' % env['outdir'].get_abspath()\n                except AttributeError: raise SCons.Errors.InternalError(\"outdir can be a string, a node, a list of strings or nodes, or None\")\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        for s in _DSPGenerator.srcargs:\n            if s in env:\n                if SCons.Util.is_String(env[s]):\n                    source = source + ' \"%s' % env[s]\n                elif SCons.Util.is_List(env[s]):\n                    for t in env[s]:\n                        if SCons.Util.is_String(t):\n                            source = source + ' \"%s\"' % t\n                        else:\n                            raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n                else:\n                    raise SCons.Errors.InternalError(s + \" must be a string or a list of strings\")\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    targetlist = [target[0]]\n    sourcelist = source\n\n    if env.get('auto_build_solution', 1):\n        env['projects'] = [env.File(t).srcnode() for t in targetlist]\n        t, s = solutionEmitter(target, target, env)\n        targetlist = targetlist + t\n\n    # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)\n    version_num = 6.0\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    if version_num >= 10.0:\n        targetlist.append(targetlist[0] + '.filters')\n\n    return (targetlist, sourcelist)\n\ndef solutionEmitter(target, source, env):\n    \"\"\"Sets up the DSW dependencies.\"\"\"\n\n    # todo: Not sure what sets source to what user has passed as target,\n    # but this is what happens. When that is fixed, we also won't have\n    # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target.\n    if source[0] == target[0]:\n        source = []\n\n    # make sure the suffix is correct for the version of MSVS we're running.\n    (base, suff) = SCons.Util.splitext(str(target[0]))\n    suff = env.subst('$MSVSSOLUTIONSUFFIX')\n    target[0] = base + suff\n\n    if not source:\n        source = 'sln_inputs:'\n\n        if 'name' in env:\n            if SCons.Util.is_String(env['name']):\n                source = source + ' \"%s\"' % env['name']\n            else:\n                raise SCons.Errors.InternalError(\"name must be a string\")\n\n        if 'variant' in env:\n            if SCons.Util.is_String(env['variant']):\n                source = source + ' \"%s\"' % env['variant']\n            elif SCons.Util.is_List(env['variant']):\n                for variant in env['variant']:\n                    if SCons.Util.is_String(variant):\n                        source = source + ' \"%s\"' % variant\n                    else:\n                        raise SCons.Errors.InternalError(\"name must be a string or a list of strings\")\n            else:\n                raise SCons.Errors.InternalError(\"variant must be a string or a list of strings\")\n        else:\n            raise SCons.Errors.InternalError(\"variant must be specified\")\n\n        if 'slnguid' in env:\n            if SCons.Util.is_String(env['slnguid']):\n                source = source + ' \"%s\"' % env['slnguid']\n            else:\n                raise SCons.Errors.InternalError(\"slnguid must be a string\")\n\n        if 'projects' in env:\n            if SCons.Util.is_String(env['projects']):\n                source = source + ' \"%s\"' % env['projects']\n            elif SCons.Util.is_List(env['projects']):\n                for t in env['projects']:\n                    if SCons.Util.is_String(t):\n                        source = source + ' \"%s\"' % t\n\n        source = source + ' \"%s\"' % str(target[0])\n        source = [SCons.Node.Python.Value(source)]\n\n    return ([target[0]], source)\n\nprojectAction = SCons.Action.Action(GenerateProject, None)\n\nsolutionAction = SCons.Action.Action(GenerateSolution, None)\n\nprojectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM',\n                                       suffix = '$MSVSPROJECTSUFFIX',\n                                       emitter = projectEmitter)\n\nsolutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM',\n                                        suffix = '$MSVSSOLUTIONSUFFIX',\n                                        emitter = solutionEmitter)\n\ndefault_MSVS_SConscript = None\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Microsoft Visual\n    Studio project files to an Environment.\"\"\"\n    try:\n        env['BUILDERS']['MSVSProject']\n    except KeyError:\n        env['BUILDERS']['MSVSProject'] = projectBuilder\n\n    try:\n        env['BUILDERS']['MSVSSolution']\n    except KeyError:\n        env['BUILDERS']['MSVSSolution'] = solutionBuilder\n\n    env['MSVSPROJECTCOM'] = projectAction\n    env['MSVSSOLUTIONCOM'] = solutionAction\n\n    if SCons.Script.call_stack:\n        # XXX Need to find a way to abstract this; the build engine\n        # shouldn't depend on anything in SCons.Script.\n        env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript\n    else:\n        global default_MSVS_SConscript\n        if default_MSVS_SConscript is None:\n            default_MSVS_SConscript = env.File('SConstruct')\n        env['MSVSSCONSCRIPT'] = default_MSVS_SConscript\n\n    # Allow consumers to provide their own versions of MSVSSCONS and\n    # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to\n    # invoke scons.\n    if 'MSVSSCONS' not in env:\n        env['MSVSSCONS'] = '\"%s\" -c \"%s\"' % (python_executable, getExecScriptMain(env))\n    if 'MSVSSCONSFLAGS' not in env:\n        env['MSVSSCONSFLAGS'] = '-C \"${MSVSSCONSCRIPT.dir.get_abspath()}\" -f ${MSVSSCONSCRIPT.name}'\n\n    env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'\n    env['MSVSBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM \"$MSVSBUILDTARGET\"'\n    env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c \"$MSVSBUILDTARGET\"'\n\n    # Set-up ms tools paths for default version\n    msvc_setup_env_once(env)\n\n    if 'MSVS_VERSION' in env:\n        version_num, suite = msvs_parse_version(env['MSVS_VERSION'])\n    else:\n        (version_num, suite) = (7.0, None) # guess at a default\n    if 'MSVS' not in env:\n        env['MSVS'] = {}\n    if version_num < 7.0:\n        env['MSVS']['PROJECTSUFFIX']  = '.dsp'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'\n    elif version_num < 10.0:\n        env['MSVS']['PROJECTSUFFIX']  = '.vcproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n    else:\n        env['MSVS']['PROJECTSUFFIX']  = '.vcxproj'\n        env['MSVS']['SOLUTIONSUFFIX'] = '.sln'\n\n    if version_num >= 10.0:\n        env['MSVSENCODING'] = 'utf-8'\n    else:\n        env['MSVSENCODING'] = 'Windows-1252'\n\n    env['GET_MSVSPROJECTSUFFIX']  = GetMSVSProjectSuffix\n    env['GET_MSVSSOLUTIONSUFFIX']  = GetMSVSSolutionSuffix\n    env['MSVSPROJECTSUFFIX']  = '${GET_MSVSPROJECTSUFFIX}'\n    env['MSVSSOLUTIONSUFFIX']  = '${GET_MSVSSOLUTIONSUFFIX}'\n    env['SCONS_HOME'] = os.environ.get('SCONS_HOME')\n\ndef exists(env):\n    return msvc_exists(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py",
    "content": "\"\"\"SCons.Tool.mwcc\n\nTool-specific initialization for the Metrowerks CodeWarrior compiler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os\nimport os.path\n\nimport SCons.Util\n\ndef set_vars(env):\n    \"\"\"Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars\n\n    MWCW_VERSIONS is set to a list of objects representing installed versions\n\n    MWCW_VERSION  is set to the version object that will be used for building.\n                  MWCW_VERSION can be set to a string during Environment\n                  construction to influence which version is chosen, otherwise\n                  the latest one from MWCW_VERSIONS is used.\n\n    Returns true if at least one version is found, false otherwise\n    \"\"\"\n    desired = env.get('MWCW_VERSION', '')\n\n    # return right away if the variables are already set\n    if isinstance(desired, MWVersion):\n        return 1\n    elif desired is None:\n        return 0\n\n    versions = find_versions()\n    version = None\n\n    if desired:\n        for v in versions:\n            if str(v) == desired:\n                version = v\n    elif versions:\n        version = versions[-1]\n\n    env['MWCW_VERSIONS'] = versions\n    env['MWCW_VERSION'] = version\n\n    if version is None:\n      return 0\n\n    env.PrependENVPath('PATH', version.clpath)\n    env.PrependENVPath('PATH', version.dllpath)\n    ENV = env['ENV']\n    ENV['CWFolder'] = version.path\n    ENV['LM_LICENSE_FILE'] = version.license\n    plus = lambda x: '+%s' % x\n    ENV['MWCIncludes'] = os.pathsep.join(map(plus, version.includes))\n    ENV['MWLibraries'] = os.pathsep.join(map(plus, version.libs))\n    return 1\n\n\ndef find_versions():\n    \"\"\"Return a list of MWVersion objects representing installed versions\"\"\"\n    versions = []\n\n    ### This function finds CodeWarrior by reading from the registry on\n    ### Windows. Some other method needs to be implemented for other\n    ### platforms, maybe something that calls env.WhereIs('mwcc')\n\n    if SCons.Util.can_read_reg:\n        try:\n            HLM = SCons.Util.HKEY_LOCAL_MACHINE\n            product = 'SOFTWARE\\\\Metrowerks\\\\CodeWarrior\\\\Product Versions'\n            product_key = SCons.Util.RegOpenKeyEx(HLM, product)\n\n            i = 0\n            while True:\n                name = product + '\\\\' + SCons.Util.RegEnumKey(product_key, i)\n                name_key = SCons.Util.RegOpenKeyEx(HLM, name)\n\n                try:\n                    version = SCons.Util.RegQueryValueEx(name_key, 'VERSION')\n                    path = SCons.Util.RegQueryValueEx(name_key, 'PATH')\n                    mwv = MWVersion(version[0], path[0], 'Win32-X86')\n                    versions.append(mwv)\n                except SCons.Util.RegError:\n                    pass\n\n                i = i + 1\n\n        except SCons.Util.RegError:\n            pass\n\n    return versions\n\n\nclass MWVersion:\n    def __init__(self, version, path, platform):\n        self.version = version\n        self.path = path\n        self.platform = platform\n        self.clpath = os.path.join(path, 'Other Metrowerks Tools',\n                                   'Command Line Tools')\n        self.dllpath = os.path.join(path, 'Bin')\n\n        # The Metrowerks tools don't store any configuration data so they\n        # are totally dumb when it comes to locating standard headers,\n        # libraries, and other files, expecting all the information\n        # to be handed to them in environment variables. The members set\n        # below control what information scons injects into the environment\n\n        ### The paths below give a normal build environment in CodeWarrior for\n        ### Windows, other versions of CodeWarrior might need different paths.\n\n        msl = os.path.join(path, 'MSL')\n        support = os.path.join(path, '%s Support' % platform)\n\n        self.license = os.path.join(path, 'license.dat')\n        self.includes = [msl, support]\n        self.libs = [msl, support]\n\n    def __str__(self):\n        return self.version\n\n\nCSuffixes = ['.c', '.C']\nCXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for the mwcc to an Environment.\"\"\"\n    import SCons.Defaults\n    import SCons.Tool\n\n    set_vars(env)\n\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in CSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)\n\n    for suffix in CXXSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.CXXAction)\n        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)\n\n    env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -nolink -o $TARGET $SOURCES'\n\n    env['CC']         = 'mwcc'\n    env['CCCOM']      = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS'\n\n    env['CXX']        = 'mwcc'\n    env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'\n\n    env['SHCC']       = '$CC'\n    env['SHCCFLAGS']  = '$CCFLAGS'\n    env['SHCFLAGS']   = '$CFLAGS'\n    env['SHCCCOM']    = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS'\n\n    env['SHCXX']       = '$CXX'\n    env['SHCXXFLAGS']  = '$CXXFLAGS'\n    env['SHCXXCOM']    = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'\n\n    env['CFILESUFFIX'] = '.c'\n    env['CXXFILESUFFIX'] = '.cpp'\n    env['CPPDEFPREFIX']  = '-D'\n    env['CPPDEFSUFFIX']  = ''\n    env['INCPREFIX']  = '-I'\n    env['INCSUFFIX']  = ''\n\n    #env['PCH'] = ?\n    #env['PCHSTOP'] = ?\n\n\ndef exists(env):\n    return set_vars(env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py",
    "content": "\"\"\"SCons.Tool.mwld\n\nTool-specific initialization for the Metrowerks CodeWarrior linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for lib to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    SCons.Tool.createSharedLibBuilder(env)\n    SCons.Tool.createProgBuilder(env)\n\n    env['AR'] = 'mwld'\n    env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES'\n\n    env['LIBDIRPREFIX'] = '-L'\n    env['LIBDIRSUFFIX'] = ''\n    env['LIBLINKPREFIX'] = '-l'\n    env['LIBLINKSUFFIX'] = '.lib'\n\n    env['LINK'] = 'mwld'\n    env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n\n    env['SHLINK'] = '$LINK'\n    env['SHLINKFLAGS'] = '$LINKFLAGS'\n    env['SHLINKCOM']   = shlib_action\n    env['SHLIBEMITTER']= shlib_emitter\n    env['LDMODULEEMITTER']= shlib_emitter\n\n\ndef exists(env):\n    import SCons.Tool.mwcc\n    return SCons.Tool.mwcc.set_vars(env)\n\n\ndef shlib_generator(target, source, env, for_signature):\n    cmd = ['$SHLINK', '$SHLINKFLAGS', '-shared']\n\n    no_import_lib = env.get('no_import_lib', 0)\n    if no_import_lib: cmd.extend('-noimplib')\n\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    if dll: cmd.extend(['-o', dll])\n\n    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')\n    if implib: cmd.extend(['-implib', implib.get_string(for_signature)])\n\n    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])\n\n    return [cmd]\n\n\ndef shlib_emitter(target, source, env):\n    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')\n    no_import_lib = env.get('no_import_lib', 0)\n\n    if not dll:\n        raise SCons.Errors.UserError(\"A shared library should have exactly one target with the suffix: %s\" % env.subst(\"$SHLIBSUFFIX\"))\n\n    if not no_import_lib and \\\n       not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):\n\n        # Append an import library to the list of targets.\n        target.append(env.ReplaceIxes(dll,\n                                      'SHLIBPREFIX', 'SHLIBSUFFIX',\n                                      'LIBPREFIX', 'LIBSUFFIX'))\n\n    return target, source\n\n\nshlib_action = SCons.Action.Action(shlib_generator, generator=1)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py",
    "content": "\"\"\"SCons.Tool.nasm\n\nTool-specific initialization for nasm, the famous Netwide Assembler.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\nASSuffixes = ['.s', '.asm', '.ASM']\nASPPSuffixes = ['.spp', '.SPP', '.sx']\nif SCons.Util.case_sensitive_suffixes('.s', '.S'):\n    ASPPSuffixes.extend(['.S'])\nelse:\n    ASSuffixes.extend(['.S'])\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for nasm to an Environment.\"\"\"\n    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)\n\n    for suffix in ASSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    for suffix in ASPPSuffixes:\n        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)\n        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)\n\n    env['AS']        = 'nasm'\n    env['ASFLAGS']   = SCons.Util.CLVar('')\n    env['ASPPFLAGS'] = '$ASFLAGS'\n    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'\n    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'\n\ndef exists(env):\n    return env.Detect('nasm')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py",
    "content": "\"\"\"SCons.Tool.rmic\n\nTool-specific initialization for rmic.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport os.path\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Util\n\nfrom SCons.Tool.JavaCommon import get_java_install_dirs\n\n\ndef emit_rmic_classes(target, source, env):\n    \"\"\"Create and return lists of Java RMI stub and skeleton\n    class files to be created from a set of class files.\n    \"\"\"\n    class_suffix = env.get('JAVACLASSSUFFIX', '.class')\n    classdir = env.get('JAVACLASSDIR')\n\n    if not classdir:\n        try:\n            s = source[0]\n        except IndexError:\n            classdir = '.'\n        else:\n            try:\n                classdir = s.attributes.java_classdir\n            except AttributeError:\n                classdir = '.'\n    classdir = env.Dir(classdir).rdir()\n    if str(classdir) == '.':\n        c_ = None\n    else:\n        c_ = str(classdir) + os.sep\n\n    slist = []\n    for src in source:\n        try:\n            classname = src.attributes.java_classname\n        except AttributeError:\n            classname = str(src)\n            if c_ and classname[:len(c_)] == c_:\n                classname = classname[len(c_):]\n            if class_suffix and classname[:-len(class_suffix)] == class_suffix:\n                classname = classname[-len(class_suffix):]\n        s = src.rfile()\n        s.attributes.java_classdir = classdir\n        s.attributes.java_classname = classname\n        slist.append(s)\n\n    stub_suffixes = ['_Stub']\n    if env.get('JAVAVERSION') == '1.4':\n        stub_suffixes.append('_Skel')\n\n    tlist = []\n    for s in source:\n        for suff in stub_suffixes:\n            fname = s.attributes.java_classname.replace('.', os.sep) + \\\n                    suff + class_suffix\n            t = target[0].File(fname)\n            t.attributes.java_lookupdir = target[0]\n            tlist.append(t)\n\n    return tlist, source\n\nRMICAction = SCons.Action.Action('$RMICCOM', '$RMICCOMSTR')\n\nRMICBuilder = SCons.Builder.Builder(action = RMICAction,\n                     emitter = emit_rmic_classes,\n                     src_suffix = '$JAVACLASSSUFFIX',\n                     target_factory = SCons.Node.FS.Dir,\n                     source_factory = SCons.Node.FS.File)\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for rmic to an Environment.\"\"\"\n    env['BUILDERS']['RMIC'] = RMICBuilder\n\n    if env['PLATFORM'] == 'win32':\n        version = env.get('JAVAVERSION', None)\n        # Ensure that we have a proper path for rmic\n        paths = get_java_install_dirs('win32', version=version)\n        rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=paths)\n        # print(\"RMIC: %s\"%rmic)\n        if rmic:\n            rmic_bin_dir = os.path.dirname(rmic)\n            env.AppendENVPath('PATH', rmic_bin_dir)\n\n    env['RMIC']            = 'rmic'\n    env['RMICFLAGS']       = SCons.Util.CLVar('')\n    env['RMICCOM']         = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}'\n    env['JAVACLASSSUFFIX']  = '.class'\n\ndef exists(env):\n    # As reported by Jan Nijtmans in issue #2730, the simple\n    #    return env.Detect('rmic')\n    # doesn't always work during initialization. For now, we\n    # stop trying to detect an executable (analogous to the\n    # javac Builder).\n    # TODO: Come up with a proper detect() routine...and enable it.\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py",
    "content": "\"\"\"SCons.Tool.rpcgen\n\nTool-specific initialization for RPCGEN tools.\n\nThree normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nfrom SCons.Builder import Builder\nimport SCons.Util\n\ncmd = \"cd ${SOURCE.dir} && $RPCGEN -%s $RPCGENFLAGS %s -o ${TARGET.abspath} ${SOURCE.file}\"\n\nrpcgen_client   = cmd % ('l', '$RPCGENCLIENTFLAGS')\nrpcgen_header   = cmd % ('h', '$RPCGENHEADERFLAGS')\nrpcgen_service  = cmd % ('m', '$RPCGENSERVICEFLAGS')\nrpcgen_xdr      = cmd % ('c', '$RPCGENXDRFLAGS')\n\ndef generate(env):\n    \"\"\"Add RPCGEN Builders and construction variables for an Environment.\"\"\"\n    \n    client  = Builder(action=rpcgen_client,  suffix='_clnt.c', src_suffix='.x')\n    header  = Builder(action=rpcgen_header,  suffix='.h',      src_suffix='.x')\n    service = Builder(action=rpcgen_service, suffix='_svc.c',  src_suffix='.x')\n    xdr     = Builder(action=rpcgen_xdr,     suffix='_xdr.c',  src_suffix='.x')\n    env.Append(BUILDERS={'RPCGenClient'  : client,\n                         'RPCGenHeader'  : header,\n                         'RPCGenService' : service,\n                         'RPCGenXDR'     : xdr})\n    env['RPCGEN'] = 'rpcgen'\n    env['RPCGENFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENCLIENTFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENHEADERFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENSERVICEFLAGS'] = SCons.Util.CLVar('')\n    env['RPCGENXDRFLAGS'] = SCons.Util.CLVar('')\n\ndef exists(env):\n    return env.Detect('rpcgen')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py",
    "content": "\"\"\"SCons.Tool.sgiar\n\nTool-specific initialization for SGI ar (library archive).  If CC\nexists, static libraries should be built with it, so the prelinker has\na chance to resolve C++ template instantiations.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    \n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-ar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n        \n    env['SHLINK']      = '$LINK'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py",
    "content": "\"\"\"SCons.Tool.sgic++\n\nTool-specific initialization for MIPSpro C++ on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.sgicxx import *\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py",
    "content": "\"\"\"SCons.Tool.sgicc\n\nTool-specific initialization for MIPSPro cc on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for gcc to an Environment.\"\"\"\n    cc.generate(env)\n\n    env['CXX']        = 'CC'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n\ndef exists(env):\n    return env.Detect('cc')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py",
    "content": "\"\"\"SCons.Tool.sgic++\n\nTool-specific initialization for MIPSpro C++ on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Util\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n#cplusplus = __import__('cxx', globals(), locals(), [])\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SGI MIPS C++ to an Environment.\"\"\"\n\n    cplusplus.generate(env)\n\n    env['CXX']         = 'CC'\n    env['CXXFLAGS']    = SCons.Util.CLVar('-LANG:std')\n    env['SHCXX']       = '$CXX'\n    env['SHOBJSUFFIX'] = '.o'\n    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1\n    \ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py",
    "content": "\"\"\"SCons.Tool.sgilink\n\nTool-specific initialization for the SGI MIPSPro linker on SGI.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n\nimport SCons.Util\n\nfrom . import link\n\nlinkers = ['CC', 'cc']\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for MIPSPro to an Environment.\"\"\"\n    link.generate(env)\n    \n    env['LINK'] = env.Detect(linkers) or 'cc'\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')\n\n    # __RPATH is set to $_RPATH in the platform specification if that\n    # platform supports it.\n    env['RPATHPREFIX'] = '-rpath '\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\ndef exists(env):\n    return env.Detect(linkers)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py",
    "content": "\"\"\"SCons.Tool.sunar\n\nTool-specific initialization for Solaris (Forte) ar (library archive). If CC\nexists, static libraries should be built with it, so that template\ninstantiations can be resolved.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Defaults\nimport SCons.Tool\nimport SCons.Util\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    \n    if env.Detect('CC'):\n        env['AR']          = 'CC'\n        env['ARFLAGS']     = SCons.Util.CLVar('-xar')\n        env['ARCOM']       = '$AR $ARFLAGS -o $TARGET $SOURCES'\n    else:\n        env['AR']          = 'ar'\n        env['ARFLAGS']     = SCons.Util.CLVar('r')\n        env['ARCOM']       = '$AR $ARFLAGS $TARGET $SOURCES'\n\n    env['LIBPREFIX']   = 'lib'\n    env['LIBSUFFIX']   = '.a'\n\ndef exists(env):\n    return env.Detect('CC') or env.Detect('ar')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py",
    "content": "\"\"\"SCons.Tool.sunc++\n\nTool-specific initialization for C++ on SunOS / Solaris.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\n\n#forward proxy to the preffered cxx version\nfrom SCons.Tool.suncxx import *\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py",
    "content": "\"\"\"SCons.Tool.suncc\n\nTool-specific initialization for Sun Solaris (Forte) CC and cc.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Util\n\nfrom . import cc\n\ndef generate(env):\n    \"\"\"\n    Add Builders and construction variables for Forte C and C++ compilers\n    to an Environment.\n    \"\"\"\n    cc.generate(env)\n\n    env['CXX']          = 'CC'\n    env['SHCCFLAGS']    = SCons.Util.CLVar('$CCFLAGS -KPIC')\n    env['SHOBJPREFIX']  = 'so_'\n    env['SHOBJSUFFIX']  = '.o'\n\ndef exists(env):\n    return env.Detect('CC')\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py",
    "content": "\"\"\"SCons.Tool.sunc++\n\nTool-specific initialization for C++ on SunOS / Solaris.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons\n\nimport os\nimport re\nimport subprocess\n\nimport SCons.Tool.cxx\ncplusplus = SCons.Tool.cxx\n# cplusplus = __import__('c++', globals(), locals(), [])\n\npackage_info = {}\n\n\ndef get_package_info(package_name, pkginfo, pkgchk):\n    try:\n        return package_info[package_name]\n    except KeyError:\n        version = None\n        pathname = None\n        from subprocess import DEVNULL \n\n        try:\n            with open('/var/sadm/install/contents', 'r', encoding='UTF-8') as f:\n                sadm_contents = f.read()\n        except EnvironmentError:\n            pass\n        else:\n            sadm_re = re.compile(r'^(\\S*/bin/CC)(=\\S*)? %s$' % package_name, re.M)\n            sadm_match = sadm_re.search(sadm_contents)\n            if sadm_match:\n                pathname = os.path.dirname(sadm_match.group(1))\n\n        try:\n            p = subprocess.Popen([pkginfo, '-l', package_name],\n                                 universal_newlines=True,\n                                 stdout=subprocess.PIPE,\n                                 stderr=DEVNULL)\n        except EnvironmentError:\n            pass\n        else:\n            pkginfo_contents = p.communicate()[0]\n            version_re = re.compile(r'^ *VERSION:\\s*(.*)$', re.M)\n            version_match = version_re.search(pkginfo_contents)\n            if version_match:\n                version = version_match.group(1)\n\n        if pathname is None:\n            try:\n                p = subprocess.Popen([pkgchk, '-l', package_name],\n                                     universal_newlines=True,\n                                     stdout=subprocess.PIPE,\n                                     stderr=DEVNULL)\n            except EnvironmentError:\n                pass\n            else:\n                pkgchk_contents = p.communicate()[0]\n                pathname_re = re.compile(r'^Pathname:\\s*(.*/bin/CC)$', re.M)\n                pathname_match = pathname_re.search(pkgchk_contents)\n                if pathname_match:\n                    pathname = os.path.dirname(pathname_match.group(1))\n\n        package_info[package_name] = (pathname, version)\n        return package_info[package_name]\n\n\n# use the package installer tool \"pkg\" to figure out where cppc and what\n# version of it is installed\ndef get_cppc(env):\n    cxx = env.subst('$CXX')\n    if cxx:\n        cppcPath = os.path.dirname(cxx)\n    else:\n        cppcPath = None\n\n    cppcVersion = None\n\n    pkginfo = env.subst('$PKGINFO')\n    pkgchk = env.subst('$PKGCHK')\n\n    for package in ['SPROcpl']:\n        path, version = get_package_info(package, pkginfo, pkgchk)\n        if path and version:\n            cppcPath, cppcVersion = path, version\n            break\n\n    return (cppcPath, 'CC', 'CC', cppcVersion)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for SunPRO C++.\"\"\"\n    path, cxx, shcxx, version = get_cppc(env)\n    if path:\n        cxx = os.path.join(path, cxx)\n        shcxx = os.path.join(path, shcxx)\n\n    cplusplus.generate(env)\n\n    env['CXX'] = cxx\n    env['SHCXX'] = shcxx\n    env['CXXVERSION'] = version\n    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')\n    env['SHOBJPREFIX'] = 'so_'\n    env['SHOBJSUFFIX'] = '.o'\n\n\ndef exists(env):\n    path, cxx, shcxx, version = get_cppc(env)\n    if path and cxx:\n        cppc = os.path.join(path, cxx)\n        if os.path.exists(cppc):\n            return cppc\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py",
    "content": "\"\"\"SCons.Tool.sunlink\n\nTool-specific initialization for the Sun Solaris (Forte) linker.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nimport os.path\n\nimport SCons.Util\nfrom . import link\n\nccLinker = None\n\n# search for the acc compiler and linker front end\n\ntry:\n    dirs = os.listdir('/opt')\nexcept (IOError, OSError):\n    # Not being able to read the directory because it doesn't exist\n    # (IOError) or isn't readable (OSError) is okay.\n    dirs = []\n\nfor d in dirs:\n    linker = '/opt/' + d + '/bin/CC'\n    if os.path.exists(linker):\n        ccLinker = linker\n        break\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for Forte to an Environment.\"\"\"\n    link.generate(env)\n\n    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')\n\n    env['RPATHPREFIX'] = '-R'\n    env['RPATHSUFFIX'] = ''\n    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'\n\n    env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -h $_SHLIBSONAME'\n    env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -h $_LDMODULESONAME'\n\n\ndef exists(env):\n    return ccLinker\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py",
    "content": "\"\"\"SCons.Tool.tar\n\nTool-specific initialization for tar.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Action\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\ntars = ['tar', 'gtar']\n\nTarAction = SCons.Action.Action('$TARCOM', '$TARCOMSTR')\n\nTarBuilder = SCons.Builder.Builder(action = TarAction,\n                                   source_factory = SCons.Node.FS.Entry,\n                                   source_scanner = SCons.Defaults.DirScanner,\n                                   suffix = '$TARSUFFIX',\n                                   multi = 1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for tar to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Tar']\n    except KeyError:\n        bld = TarBuilder\n        env['BUILDERS']['Tar'] = bld\n\n    env['TAR']        = env.Detect(tars) or 'gtar'\n    env['TARFLAGS']   = SCons.Util.CLVar('-c')\n    env['TARCOM']     = '$TAR $TARFLAGS -f $TARGET $SOURCES'\n    env['TARSUFFIX']  = '.tar'\n\ndef exists(env):\n    return env.Detect(tars)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\nTextfile/Substfile builder for SCons.\n\n    Create file 'target' which typically is a textfile.  The 'source'\n    may be any combination of strings, Nodes, or lists of same.  A\n    'linesep' will be put between any part written and defaults to\n    os.linesep.\n\n    The only difference between the Textfile builder and the Substfile\n    builder is that strings are converted to Value() nodes for the\n    former and File() nodes for the latter.  To insert files in the\n    former or strings in the latter, wrap them in a File() or Value(),\n    respectively.\n\n    The values of SUBST_DICT first have any construction variables\n    expanded (its keys are not expanded).  If a value of SUBST_DICT is\n    a python callable function, it is called and the result is expanded\n    as the value.  Values are substituted in a \"random\" order; if any\n    substitution could be further expanded by another substitution, it\n    is unpredictable whether the expansion will occur.\n\"\"\"\n\nimport SCons\n\n\nfrom SCons.Node import Node\nfrom SCons.Node.Python import Value\nfrom SCons.Util import is_String, is_Sequence, is_Dict, to_bytes\n\n\nTEXTFILE_FILE_WRITE_MODE = 'w'\n\nLINESEP = '\\n'\n\n\ndef _do_subst(node, subs):\n    \"\"\"\n    Fetch the node contents and replace all instances of the keys with\n    their values.  For example, if subs is\n        {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'},\n    then all instances of %VERSION% in the file will be replaced with\n    1.2345 and so forth.\n    \"\"\"\n    contents = node.get_text_contents()\n    if subs:\n        for (k, val) in subs:\n            contents = contents.replace(k, val)\n\n    if 'b' in TEXTFILE_FILE_WRITE_MODE:\n        try:\n            contents = bytearray(contents, 'utf-8')\n        except TypeError:\n            # TODO: this should not happen, get_text_contents returns text\n            contents = bytearray(contents)\n\n    return contents\n\n\ndef _action(target, source, env):\n\n    # prepare the line separator\n    linesep = env['LINESEPARATOR']\n    if linesep is None:\n        linesep = LINESEP  # os.linesep\n    elif is_String(linesep):\n        pass\n    elif isinstance(linesep, Value):\n        linesep = linesep.get_text_contents()\n    else:\n        raise SCons.Errors.UserError('unexpected type/class for LINESEPARATOR: %s'\n                                     % repr(linesep), None)\n\n    if 'b' in TEXTFILE_FILE_WRITE_MODE:\n        linesep = to_bytes(linesep)\n\n    # create a dictionary to use for the substitutions\n    if 'SUBST_DICT' not in env:\n        subs = None    # no substitutions\n    else:\n        subst_dict = env['SUBST_DICT']\n        if is_Dict(subst_dict):\n            subst_dict = list(subst_dict.items())\n        elif is_Sequence(subst_dict):\n            pass\n        else:\n            raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence')\n        subs = []\n        for (k, value) in subst_dict:\n            if callable(value):\n                value = value()\n            if is_String(value):\n                value = env.subst(value, raw=1)\n            else:\n                value = str(value)\n            subs.append((k, value))\n\n    # write the file\n    try:\n        target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')\n    except (OSError, IOError) as e:\n        raise SCons.Errors.UserError(\"Can't write target file %s [%s]\" % (target[0],e))\n\n    # separate lines by 'linesep' only if linesep is not empty\n    lsep = None\n    for line in source:\n        if lsep:\n            target_file.write(lsep)\n\n        target_file.write(_do_subst(line, subs))\n        lsep = linesep\n    target_file.close()\n\n\ndef _strfunc(target, source, env):\n    return \"Creating '%s'\" % target[0]\n\n\ndef _convert_list_R(newlist, sources):\n    for elem in sources:\n        if is_Sequence(elem):\n            _convert_list_R(newlist, elem)\n        elif isinstance(elem, Node):\n            newlist.append(elem)\n        else:\n            newlist.append(Value(elem))\n\n\ndef _convert_list(target, source, env):\n    if len(target) != 1:\n        raise SCons.Errors.UserError(\"Only one target file allowed\")\n    newlist = []\n    _convert_list_R(newlist, source)\n    return target, newlist\n\n\n_common_varlist = ['SUBST_DICT', 'LINESEPARATOR']\n\n_text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']\n_text_builder = SCons.Builder.Builder(\n    action=SCons.Action.Action(_action, _strfunc, varlist=_text_varlist),\n    source_factory=Value,\n    emitter=_convert_list,\n    prefix='$TEXTFILEPREFIX',\n    suffix='$TEXTFILESUFFIX',\n)\n\n_subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'SUBSTFILESUFFIX']\n_subst_builder = SCons.Builder.Builder(\n    action=SCons.Action.Action(_action, _strfunc, varlist=_subst_varlist),\n    source_factory=SCons.Node.FS.File,\n    emitter=_convert_list,\n    prefix='$SUBSTFILEPREFIX',\n    suffix='$SUBSTFILESUFFIX',\n    src_suffix=['.in'],\n)\n\n\ndef generate(env):\n    env['LINESEPARATOR'] = LINESEP # os.linesep\n    env['BUILDERS']['Textfile'] = _text_builder\n    env['TEXTFILEPREFIX'] = ''\n    env['TEXTFILESUFFIX'] = '.txt'\n    env['BUILDERS']['Substfile'] = _subst_builder\n    env['SUBSTFILEPREFIX'] = ''\n    env['SUBSTFILESUFFIX'] = ''\n\n\ndef exists(env):\n    return 1\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py",
    "content": "\"\"\"SCons.Tool.tlib\n\nXXX\n\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Tool\nimport SCons.Tool.bcc32\nimport SCons.Util\n\ndef generate(env):\n    SCons.Tool.bcc32.findIt('tlib', env)\n    \"\"\"Add Builders and construction variables for ar to an Environment.\"\"\"\n    SCons.Tool.createStaticLibBuilder(env)\n    env['AR']          = 'tlib'\n    env['ARFLAGS']     = SCons.Util.CLVar('')\n    env['ARCOM']       = '$AR $TARGET $ARFLAGS /a $SOURCES'\n    env['LIBPREFIX']   = ''\n    env['LIBSUFFIX']   = '.lib'\n\ndef exists(env):\n    return SCons.Tool.bcc32.findIt('tlib', env)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py",
    "content": "\"\"\"SCons.Tool.wix\n\nTool-specific initialization for wix, the Windows Installer XML Tool.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\"\"\"\n\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\n__revision__ = \"__FILE__ __REVISION__ __DATE__ __DEVELOPER__\"\n\nimport SCons.Builder\nimport SCons.Action\nimport os\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for WiX to an Environment.\"\"\"\n    if not exists(env):\n      return\n\n    env['WIXCANDLEFLAGS'] = ['-nologo']\n    env['WIXCANDLEINCLUDE'] = []\n    env['WIXCANDLECOM'] = '$WIXCANDLE $WIXCANDLEFLAGS -I $WIXCANDLEINCLUDE -o ${TARGET} ${SOURCE}'\n\n    env['WIXLIGHTFLAGS'].append( '-nologo' )\n    env['WIXLIGHTCOM'] = \"$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}\"\n    env['WIXSRCSUF'] = '.wxs'\n    env['WIXOBJSUF'] = '.wixobj'\n\n    object_builder = SCons.Builder.Builder(\n        action      = '$WIXCANDLECOM',\n        suffix      = '$WIXOBJSUF',\n        src_suffix  = '$WIXSRCSUF')\n\n    linker_builder = SCons.Builder.Builder(\n        action      = '$WIXLIGHTCOM',\n        src_suffix  = '$WIXOBJSUF',\n        src_builder = object_builder)\n\n    env['BUILDERS']['WiX'] = linker_builder\n\ndef exists(env):\n    env['WIXCANDLE'] = 'candle.exe'\n    env['WIXLIGHT']  = 'light.exe'\n\n    # try to find the candle.exe and light.exe tools and \n    # add the install directory to light libpath.\n    for path in os.environ['PATH'].split(os.pathsep):\n        if not path:\n            continue\n\n        # workaround for some weird python win32 bug.\n        if path[0] == '\"' and path[-1:]=='\"':\n            path = path[1:-1]\n\n        # normalize the path\n        path = os.path.normpath(path)\n\n        # search for the tools in the PATH environment variable\n        try:\n            files = os.listdir(path)\n            if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:\n                env.PrependENVPath('PATH', path)\n                # include appropriate flags if running WiX 2.0\n                if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:\n                    env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),\n                                             '-loc',\n                                             os.path.join( path, 'WixUI_en-us.wxl' ) ]\n                else:\n                    env['WIXLIGHTFLAGS'] = []\n                return 1\n        except OSError:\n            pass # ignore this, could be a stale PATH entry.\n\n    return None\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Tool specific initialization of `xgettext` tool.\"\"\"\n\nimport os\nimport re\nimport subprocess\nimport sys\n\nimport SCons.Action\nimport SCons.Node.FS\nimport SCons.Tool\nimport SCons.Util\nimport SCons.Warnings\nfrom SCons.Builder import BuilderBase\nfrom SCons.Environment import _null\nfrom SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS\nfrom SCons.Platform.mingw import MINGW_DEFAULT_PATHS\nfrom SCons.Tool.GettextCommon import (\n    _detect_xgettext,\n    _POTargetFactory,\n    RPaths,\n    _xgettext_exists,\n    # XgettextToolWarning,\n)\n\n\nclass _CmdRunner:\n    \"\"\" Callable object, which runs shell command storing its stdout and stderr to\n    variables. It also provides `strfunction()` method, which shall be used by\n    scons Action objects to print command string. \"\"\"\n\n    def __init__(self, command, commandstr=None):\n        self.out = None\n        self.err = None\n        self.status = None\n        self.command = command\n        self.commandstr = commandstr\n\n    def __call__(self, target, source, env):\n        kw = {\n            'stdin': 'devnull',\n            'stdout': subprocess.PIPE,\n            'stderr': subprocess.PIPE,\n            'universal_newlines': True,\n            'shell': True\n        }\n        command = env.subst(self.command, target=target, source=source)\n        proc = SCons.Action._subproc(env, command, **kw)\n        self.out, self.err = proc.communicate()\n        self.status = proc.wait()\n        if self.err:\n            sys.stderr.write(str(self.err))\n        return self.status\n\n    def strfunction(self, target, source, env):\n        comstr = self.commandstr\n        if env.subst(comstr, target=target, source=source) == \"\":\n            comstr = self.command\n        s = env.subst(comstr, target=target, source=source)\n        return s\n\n\ndef _update_pot_file(target, source, env):\n    \"\"\" Action function for `POTUpdate` builder \"\"\"\n    nop = lambda target, source, env: 0\n\n    # Save scons cwd and os cwd (NOTE: they may be different. After the job, we\n    # revert each one to its original state).\n    save_cwd = env.fs.getcwd()\n    save_os_cwd = os.getcwd()\n    chdir = target[0].dir\n    chdir_str = repr(chdir.get_abspath())\n    # Print chdir message (employ SCons.Action.Action for that. It knows better\n    # than me how to to this correctly).\n    env.Execute(SCons.Action.Action(nop, \"Entering \" + chdir_str))\n    # Go to target's directory and do our job\n    env.fs.chdir(chdir, 1)  # Go into target's directory\n    try:\n        cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR')\n        action = SCons.Action.Action(cmd, strfunction=cmd.strfunction)\n        status = action([target[0]], source, env)\n    except:\n        # Something went wrong.\n        env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n        # Revert working dirs to previous state and re-throw exception.\n        env.fs.chdir(save_cwd, 0)\n        os.chdir(save_os_cwd)\n        raise\n    # Print chdir message.\n    env.Execute(SCons.Action.Action(nop, \"Leaving \" + chdir_str))\n    # Revert working dirs to previous state.\n    env.fs.chdir(save_cwd, 0)\n    os.chdir(save_os_cwd)\n    # If the command was not successfull, return error code.\n    if status: return status\n\n    new_content = cmd.out\n\n    if not new_content:\n        # When xgettext finds no internationalized messages, no *.pot is created\n        # (because we don't want to bother translators with empty POT files).\n        needs_update = False\n        explain = \"no internationalized messages encountered\"\n    else:\n        if target[0].exists():\n            # If the file already exists, it's left unaltered unless its messages\n            # are outdated (w.r.t. to these recovered by xgettext from sources).\n            old_content = target[0].get_text_contents()\n            re_cdate = re.compile(r'^\"POT-Creation-Date: .*\"$[\\r\\n]?', re.M)\n            old_content_nocdate = re.sub(re_cdate, \"\", old_content)\n            new_content_nocdate = re.sub(re_cdate, \"\", new_content)\n            if old_content_nocdate == new_content_nocdate:\n                # Messages are up-to-date\n                needs_update = False\n                explain = \"messages in file found to be up-to-date\"\n            else:\n                # Messages are outdated\n                needs_update = True\n                explain = \"messages in file were outdated\"\n        else:\n            # No POT file found, create new one\n            needs_update = True\n            explain = \"new file\"\n    if needs_update:\n        # Print message employing SCons.Action.Action for that.\n        msg = \"Writing \" + repr(str(target[0])) + \" (\" + explain + \")\"\n        env.Execute(SCons.Action.Action(nop, msg))\n        f = open(str(target[0]), \"w\")\n        f.write(new_content)\n        f.close()\n        return 0\n    else:\n        # Print message employing SCons.Action.Action for that.\n        msg = \"Not writing \" + repr(str(target[0])) + \" (\" + explain + \")\"\n        env.Execute(SCons.Action.Action(nop, msg))\n        return 0\n\n\nclass _POTBuilder(BuilderBase):\n    def _execute(self, env, target, source, *args):\n        if not target:\n            if 'POTDOMAIN' in env and env['POTDOMAIN']:\n                domain = env['POTDOMAIN']\n            else:\n                domain = 'messages'\n            target = [domain]\n        return BuilderBase._execute(self, env, target, source, *args)\n\n\ndef _scan_xgettext_from_files(target, source, env, files=None, path=None):\n    \"\"\" Parses `POTFILES.in`-like file and returns list of extracted file names.\n    \"\"\"\n    if files is None:\n        return 0\n    if not SCons.Util.is_List(files):\n        files = [files]\n\n    if path is None:\n        if 'XGETTEXTPATH' in env:\n            path = env['XGETTEXTPATH']\n        else:\n            path = []\n    if not SCons.Util.is_List(path):\n        path = [path]\n\n    path = SCons.Util.flatten(path)\n\n    dirs = ()\n    for p in path:\n        if not isinstance(p, SCons.Node.FS.Base):\n            if SCons.Util.is_String(p):\n                p = env.subst(p, source=source, target=target)\n            p = env.arg2nodes(p, env.fs.Dir)\n        dirs += tuple(p)\n    # cwd is the default search path (when no path is defined by user)\n    if not dirs:\n        dirs = (env.fs.getcwd(),)\n\n    # Parse 'POTFILE.in' files.\n    re_comment = re.compile(r'^#[^\\n\\r]*$\\r?\\n?', re.M)\n    re_emptyln = re.compile(r'^[ \\t\\r]*$\\r?\\n?', re.M)\n    re_trailws = re.compile(r'[ \\t\\r]+$')\n    for f in files:\n        # Find files in search path $XGETTEXTPATH\n        if isinstance(f, SCons.Node.FS.Base) and f.rexists():\n            contents = f.get_text_contents()\n            contents = re_comment.sub(\"\", contents)\n            contents = re_emptyln.sub(\"\", contents)\n            contents = re_trailws.sub(\"\", contents)\n            depnames = contents.splitlines()\n            for depname in depnames:\n                depfile = SCons.Node.FS.find_file(depname, dirs)\n                if not depfile:\n                    depfile = env.arg2nodes(depname, dirs[0].File)\n                env.Depends(target, depfile)\n    return 0\n\n\ndef _pot_update_emitter(target, source, env):\n    \"\"\" Emitter function for `POTUpdate` builder \"\"\"\n    if 'XGETTEXTFROM' in env:\n        xfrom = env['XGETTEXTFROM']\n    else:\n        return target, source\n    if not SCons.Util.is_List(xfrom):\n        xfrom = [xfrom]\n\n    xfrom = SCons.Util.flatten(xfrom)\n\n    # Prepare list of 'POTFILE.in' files.\n    files = []\n    for xf in xfrom:\n        if not isinstance(xf, SCons.Node.FS.Base):\n            if SCons.Util.is_String(xf):\n                # Interpolate variables in strings\n                xf = env.subst(xf, source=source, target=target)\n            xf = env.arg2nodes(xf)\n        files.extend(xf)\n    if files:\n        env.Depends(target, files)\n        _scan_xgettext_from_files(target, source, env, files)\n    return target, source\n\n\ndef _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):\n    return env._POTUpdateBuilder(target, source, **kw)\n\n\ndef _POTUpdateBuilder(env, **kw):\n    \"\"\" Creates `POTUpdate` builder object \"\"\"\n    kw['action'] = SCons.Action.Action(_update_pot_file, None)\n    kw['suffix'] = '$POTSUFFIX'\n    kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File\n    kw['emitter'] = _pot_update_emitter\n    return _POTBuilder(**kw)\n\n\ndef generate(env, **kw):\n    \"\"\" Generate `xgettext` tool \"\"\"\n\n    if sys.platform == 'win32':\n        xgettext = SCons.Tool.find_program_path(env, 'xgettext', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )\n        if xgettext:\n            xgettext_bin_dir = os.path.dirname(xgettext)\n            env.AppendENVPath('PATH', xgettext_bin_dir)\n        else:\n            SCons.Warnings.warn(\n                # XgettextToolWarning,  # using this breaks test, so keep:\n                SCons.Warnings.SConsWarning,\n                'xgettext tool requested, but binary not found in ENV PATH'\n            )\n    try:\n        env['XGETTEXT'] = _detect_xgettext(env)\n    except:\n        env['XGETTEXT'] = 'xgettext'\n    # NOTE: sources=\"$SOURCES\" would work as well. However, we use following\n    # construction to convert absolute paths provided by scons onto paths\n    # relative to current working dir. Note, that scons expands $SOURCE(S) to\n    # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in\n    # \"../\"). With source=$SOURCE these absolute paths would be written to the\n    # resultant *.pot file (and its derived *.po files) as references to lines in\n    # source code (e.g. referring lines in *.c files). Such references would be\n    # correct (e.g. in poedit) only on machine on which *.pot was generated and\n    # would be of no use on other hosts (having a copy of source code located\n    # in different place in filesystem).\n    sources = '$( ${_concat( \"\", SOURCES, \"\", __env__, XgettextRPaths, TARGET' \\\n              + ', SOURCES)} $)'\n\n    # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file.\n    # This is required by the POTUpdate builder's action.\n    xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \\\n                  + ' $_XGETTEXTFROMFLAGS -o - ' + sources\n\n    xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \\\n                        + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)'\n    xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \\\n                        + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)'\n\n    env.SetDefault(\n        _XGETTEXTDOMAIN='${TARGET.filebase}',\n        XGETTEXTFLAGS=[],\n        XGETTEXTCOM=xgettextcom,\n        XGETTEXTCOMSTR='',\n        XGETTEXTPATH=[],\n        XGETTEXTPATHPREFIX='-D',\n        XGETTEXTPATHSUFFIX='',\n        XGETTEXTFROM=None,\n        XGETTEXTFROMPREFIX='-f',\n        XGETTEXTFROMSUFFIX='',\n        _XGETTEXTPATHFLAGS=xgettextpathflags,\n        _XGETTEXTFROMFLAGS=xgettextfromflags,\n        POTSUFFIX=['.pot'],\n        POTUPDATE_ALIAS='pot-update',\n        XgettextRPaths=RPaths(env)\n    )\n    env.Append(BUILDERS={\n        '_POTUpdateBuilder': _POTUpdateBuilder(env)\n    })\n    env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate')\n    env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))\n\n\ndef exists(env):\n    \"\"\" Check, whether the tool exists \"\"\"\n    try:\n        return _xgettext_exists(env)\n    except:\n        return False\n\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py",
    "content": "\"\"\"SCons.Tool.zip\n\nTool-specific initialization for zip.\n\nThere normally shouldn't be any need to import this module directly.\nIt will usually be imported through the generic SCons.Tool.Tool()\nselection method.\n\n\"\"\"\n\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport os\n\nimport SCons.Builder\nimport SCons.Defaults\nimport SCons.Node.FS\nimport SCons.Util\n\nimport time\nimport zipfile\n\n\nzip_compression = zipfile.ZIP_DEFLATED\n\n\ndef _create_zipinfo_for_file(fname, arcname, date_time, compression):\n    st = os.stat(fname)\n    if not date_time:\n        mtime = time.localtime(st.st_mtime)\n        date_time = mtime[0:6]\n    zinfo = zipfile.ZipInfo(filename=arcname, date_time=date_time)\n    zinfo.external_attr = (st.st_mode & 0xFFFF) << 16  # Unix attributes\n    zinfo.compress_type = compression\n    zinfo.file_size = st.st_size\n    return zinfo\n\n\ndef zip_builder(target, source, env):\n    compression = env.get('ZIPCOMPRESSION', zipfile.ZIP_STORED)\n    zip_root = str(env.get('ZIPROOT', ''))\n    date_time = env.get('ZIP_OVERRIDE_TIMESTAMP')\n\n    files = []\n    for s in source:\n        if s.isdir():\n            for dirpath, dirnames, filenames in os.walk(str(s)):\n                for fname in filenames:\n                    path = os.path.join(dirpath, fname)\n                    if os.path.isfile(path):\n                        files.append(path)\n        else:\n            files.append(str(s))\n\n    with zipfile.ZipFile(str(target[0]), 'w', compression) as zf:\n        for fname in files:\n            arcname = os.path.relpath(fname, zip_root)\n            # TODO: Switch to ZipInfo.from_file when 3.6 becomes the base python version\n            zinfo = _create_zipinfo_for_file(fname, arcname, date_time, compression)\n            with open(fname, \"rb\") as f:\n                zf.writestr(zinfo, f.read())\n\n\n# Fix PR #3569 - If you don't specify ZIPCOM and ZIPCOMSTR when creating\n# env, then it will ignore ZIPCOMSTR set afterwards.\nzipAction = SCons.Action.Action(zip_builder, \"$ZIPCOMSTR\",\n                                varlist=['ZIPCOMPRESSION', 'ZIPROOT', 'ZIP_OVERRIDE_TIMESTAMP'])\n\nZipBuilder = SCons.Builder.Builder(action=SCons.Action.Action('$ZIPCOM', '$ZIPCOMSTR'),\n                                   source_factory=SCons.Node.FS.Entry,\n                                   source_scanner=SCons.Defaults.DirScanner,\n                                   suffix='$ZIPSUFFIX',\n                                   multi=1)\n\n\ndef generate(env):\n    \"\"\"Add Builders and construction variables for zip to an Environment.\"\"\"\n    try:\n        bld = env['BUILDERS']['Zip']\n    except KeyError:\n        bld = ZipBuilder\n        env['BUILDERS']['Zip'] = bld\n\n    env['ZIP'] = 'zip'\n    env['ZIPFLAGS'] = SCons.Util.CLVar('')\n    env['ZIPCOM'] = zipAction\n    env['ZIPCOMPRESSION'] = zip_compression\n    env['ZIPSUFFIX'] = '.zip'\n    env['ZIPROOT'] = SCons.Util.CLVar('')\n\n\ndef exists(env):\n    return True\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Various SCons utility functions.\"\"\"\n\nimport copy\nimport hashlib\nimport os\nimport pprint\nimport re\nimport sys\nfrom collections import UserDict, UserList, UserString, OrderedDict\nfrom collections.abc import MappingView\nfrom contextlib import suppress\nfrom types import MethodType, FunctionType\nfrom typing import Optional, Union\n\n# Note: Util module cannot import other bits of SCons globally without getting\n# into import loops. Both the below modules import SCons.Util early on.\n# --> SCons.Warnings\n# --> SCons.Errors\n# Thus the local imports, which are annotated for pylint to show we mean it.\n\n\nPYPY = hasattr(sys, 'pypy_translation_info')\n\n# this string will be hashed if a Node refers to a file that doesn't exist\n# in order to distinguish from a file that exists but is empty.\nNOFILE = \"SCONS_MAGIC_MISSING_FILE_STRING\"\n\n# unused?\ndef dictify(keys, values, result=None) -> dict:\n    if result is None:\n        result = {}\n    result.update(dict(zip(keys, values)))\n    return result\n\n_ALTSEP = os.altsep\nif _ALTSEP is None and sys.platform == 'win32':\n    # My ActivePython 2.0.1 doesn't set os.altsep!  What gives?\n    _ALTSEP = '/'\nif _ALTSEP:\n    def rightmost_separator(path, sep):\n        return max(path.rfind(sep), path.rfind(_ALTSEP))\nelse:\n    def rightmost_separator(path, sep):\n        return path.rfind(sep)\n\n# First two from the Python Cookbook, just for completeness.\n# (Yeah, yeah, YAGNI...)\ndef containsAny(s, pat) -> bool:\n    \"\"\"Check whether string `s` contains ANY of the items in `pat`.\"\"\"\n    for c in pat:\n        if c in s:\n            return True\n    return False\n\ndef containsAll(s, pat) -> bool:\n    \"\"\"Check whether string `s` contains ALL of the items in `pat`.\"\"\"\n    for c in pat:\n        if c not in s:\n            return False\n    return True\n\ndef containsOnly(s, pat) -> bool:\n    \"\"\"Check whether string `s` contains ONLY items in `pat`.\"\"\"\n    for c in s:\n        if c not in pat:\n            return False\n    return True\n\n\n# TODO: Verify this method is STILL faster than os.path.splitext\ndef splitext(path) -> tuple:\n    \"\"\"Split `path` into a (root, ext) pair.\n\n    Same as :mod:`os.path.splitext` but faster.\n    \"\"\"\n    sep = rightmost_separator(path, os.sep)\n    dot = path.rfind('.')\n    # An ext is only real if it has at least one non-digit char\n    if dot > sep and not containsOnly(path[dot:], \"0123456789.\"):\n        return path[:dot], path[dot:]\n\n    return path, \"\"\n\ndef updrive(path) -> str:\n    \"\"\"Make the drive letter (if any) upper case.\n\n    This is useful because Windows is inconsistent on the case\n    of the drive letter, which can cause inconsistencies when\n    calculating command signatures.\n    \"\"\"\n    drive, rest = os.path.splitdrive(path)\n    if drive:\n        path = drive.upper() + rest\n    return path\n\nclass NodeList(UserList):\n    \"\"\"A list of Nodes with special attribute retrieval.\n\n    Unlike an ordinary list, access to a member's attribute returns a\n    `NodeList` containing the same attribute for each member.  Although\n    this can hold any object, it is intended for use when processing\n    Nodes, where fetching an attribute of each member is very commone,\n    for example getting the content signature of each node.  The term\n    \"attribute\" here includes the string representation.\n\n    Example:\n\n    >>> someList = NodeList(['  foo  ', '  bar  '])\n    >>> someList.strip()\n    ['foo', 'bar']\n    \"\"\"\n\n    def __bool__(self):\n        return bool(self.data)\n\n    def __str__(self):\n        return ' '.join(map(str, self.data))\n\n    def __iter__(self):\n        return iter(self.data)\n\n    def __call__(self, *args, **kwargs) -> 'NodeList':\n        result = [x(*args, **kwargs) for x in self.data]\n        return self.__class__(result)\n\n    def __getattr__(self, name) -> 'NodeList':\n        \"\"\"Returns a NodeList of `name` from each member.\"\"\"\n        result = [getattr(x, name) for x in self.data]\n        return self.__class__(result)\n\n    def __getitem__(self, index):\n        \"\"\"Returns one item, forces a `NodeList` if `index` is a slice.\"\"\"\n        # TODO: annotate return how? Union[] - don't know type of single item\n        if isinstance(index, slice):\n            return self.__class__(self.data[index])\n        return self.data[index]\n\n\n_get_env_var = re.compile(r'^\\$([_a-zA-Z]\\w*|{[_a-zA-Z]\\w*})$')\n\ndef get_environment_var(varstr) -> Optional[str]:\n    \"\"\"Return undecorated construction variable string.\n\n    Determine if `varstr` looks like a reference\n    to a single environment variable, like `\"$FOO\"` or `\"${FOO}\"`.\n    If so, return that variable with no decorations, like `\"FOO\"`.\n    If not, return `None`.\n    \"\"\"\n\n    mo = _get_env_var.match(to_String(varstr))\n    if mo:\n        var = mo.group(1)\n        if var[0] == '{':\n            return var[1:-1]\n        return var\n\n    return None\n\n\nclass DisplayEngine:\n    \"\"\"A callable class used to display SCons messages.\"\"\"\n\n    print_it = True\n\n    def __call__(self, text, append_newline=1):\n        if not self.print_it:\n            return\n\n        if append_newline:\n            text = text + '\\n'\n\n        try:\n            sys.stdout.write(str(text))\n        except IOError:\n            # Stdout might be connected to a pipe that has been closed\n            # by now. The most likely reason for the pipe being closed\n            # is that the user has press ctrl-c. It this is the case,\n            # then SCons is currently shutdown. We therefore ignore\n            # IOError's here so that SCons can continue and shutdown\n            # properly so that the .sconsign is correctly written\n            # before SCons exits.\n            pass\n\n    def set_mode(self, mode):\n        self.print_it = mode\n\n\n# TODO: W0102: Dangerous default value [] as argument (dangerous-default-value)\ndef render_tree(root, child_func, prune=0, margin=[0], visited=None):\n    \"\"\"Render a tree of nodes into an ASCII tree view.\n\n    Args:\n        root: the root node of the tree\n        child_func: the function called to get the children of a node\n        prune: don't visit the same node twice\n        margin: the format of the left margin to use for children of `root`.\n          1 results in a pipe, and 0 results in no pipe.\n        visited: a dictionary of visited nodes in the current branch if\n          `prune` is 0, or in the whole tree if `prune` is 1.\n    \"\"\"\n\n    rname = str(root)\n\n    # Initialize 'visited' dict, if required\n    if visited is None:\n        visited = {}\n\n    children = child_func(root)\n    retval = \"\"\n    for pipe in margin[:-1]:\n        if pipe:\n            retval = retval + \"| \"\n        else:\n            retval = retval + \"  \"\n\n    if rname in visited:\n        return retval + \"+-[\" + rname + \"]\\n\"\n\n    retval = retval + \"+-\" + rname + \"\\n\"\n    if not prune:\n        visited = copy.copy(visited)\n    visited[rname] = True\n\n    for i, child in enumerate(children):\n        margin.append(i < len(children)-1)\n        retval = retval + render_tree(child, child_func, prune, margin, visited)\n        margin.pop()\n\n    return retval\n\ndef IDX(n) -> bool:\n    \"\"\"Generate in index into strings from the tree legends.\n\n    These are always a choice between two, so bool works fine.\n    \"\"\"\n    return bool(n)\n\n# unicode line drawing chars:\nBOX_HORIZ = chr(0x2500)  # '─'\nBOX_VERT = chr(0x2502)  # '│'\nBOX_UP_RIGHT = chr(0x2514)  # '└'\nBOX_DOWN_RIGHT = chr(0x250c)  # '┌'\nBOX_DOWN_LEFT = chr(0x2510)   # '┐'\nBOX_UP_LEFT = chr(0x2518)  # '┘'\nBOX_VERT_RIGHT = chr(0x251c)  # '├'\nBOX_HORIZ_DOWN = chr(0x252c)  # '┬'\n\n\n# TODO: W0102: Dangerous default value [] as argument (dangerous-default-value)\ndef print_tree(\n    root,\n    child_func,\n    prune=0,\n    showtags=False,\n    margin=[0],\n    visited=None,\n    lastChild=False,\n    singleLineDraw=False,\n):\n    \"\"\"Print a tree of nodes.\n\n    This is like func:`render_tree`, except it prints lines directly instead\n    of creating a string representation in memory, so that huge trees can\n    be handled.\n\n    Args:\n        root: the root node of the tree\n        child_func: the function called to get the children of a node\n        prune: don't visit the same node twice\n        showtags: print status information to the left of each node line\n        margin: the format of the left margin to use for children of `root`.\n          1 results in a pipe, and 0 results in no pipe.\n        visited: a dictionary of visited nodes in the current branch if\n          prune` is 0, or in the whole tree if `prune` is 1.\n        singleLineDraw: use line-drawing characters rather than ASCII.\n    \"\"\"\n\n    rname = str(root)\n\n    # Initialize 'visited' dict, if required\n    if visited is None:\n        visited = {}\n\n    if showtags:\n\n        if showtags == 2:\n            legend = (' E         = exists\\n' +\n                      '  R        = exists in repository only\\n' +\n                      '   b       = implicit builder\\n' +\n                      '   B       = explicit builder\\n' +\n                      '    S      = side effect\\n' +\n                      '     P     = precious\\n' +\n                      '      A    = always build\\n' +\n                      '       C   = current\\n' +\n                      '        N  = no clean\\n' +\n                      '         H = no cache\\n' +\n                      '\\n')\n            sys.stdout.write(legend)\n\n        tags = [\n            '[',\n            ' E'[IDX(root.exists())],\n            ' R'[IDX(root.rexists() and not root.exists())],\n            ' BbB'[\n                [0, 1][IDX(root.has_explicit_builder())] +\n                [0, 2][IDX(root.has_builder())]\n            ],\n            ' S'[IDX(root.side_effect)],\n            ' P'[IDX(root.precious)],\n            ' A'[IDX(root.always_build)],\n            ' C'[IDX(root.is_up_to_date())],\n            ' N'[IDX(root.noclean)],\n            ' H'[IDX(root.nocache)],\n            ']'\n        ]\n\n    else:\n        tags = []\n\n    def MMM(m):\n        if singleLineDraw:\n            return [\"  \", BOX_VERT + \" \"][m]\n\n        return [\"  \", \"| \"][m]\n\n    margins = list(map(MMM, margin[:-1]))\n    children = child_func(root)\n    cross = \"+-\"\n    if singleLineDraw:\n        cross = BOX_VERT_RIGHT + BOX_HORIZ   # sign used to point to the leaf.\n        # check if this is the last leaf of the branch\n        if lastChild:\n            #if this if the last leaf, then terminate:\n            cross = BOX_UP_RIGHT + BOX_HORIZ  # sign for the last leaf\n\n        # if this branch has children then split it\n        if children:\n            # if it's a leaf:\n            if prune and rname in visited and children:\n                cross += BOX_HORIZ\n            else:\n                cross += BOX_HORIZ_DOWN\n\n    if prune and rname in visited and children:\n        sys.stdout.write(''.join(tags + margins + [cross,'[', rname, ']']) + '\\n')\n        return\n\n    sys.stdout.write(''.join(tags + margins + [cross, rname]) + '\\n')\n\n    visited[rname] = 1\n\n    # if this item has children:\n    if children:\n        margin.append(1)  # Initialize margin with 1 for vertical bar.\n        idx = IDX(showtags)\n        _child = 0  # Initialize this for the first child.\n        for C in children[:-1]:\n            _child = _child + 1  # number the children\n            print_tree(\n                C,\n                child_func,\n                prune,\n                idx,\n                margin,\n                visited,\n                (len(children) - _child) <= 0,\n                singleLineDraw,\n            )\n        # margins are with space (index 0) because we arrived to the last child.\n        margin[-1] = 0\n        # for this call child and nr of children needs to be set 0, to signal the second phase.\n        print_tree(children[-1], child_func, prune, idx, margin, visited, True, singleLineDraw)\n        margin.pop()  # destroy the last margin added\n\n\n# Functions for deciding if things are like various types, mainly to\n# handle UserDict, UserList and UserString like their underlying types.\n#\n# Yes, all of this manual testing breaks polymorphism, and the real\n# Pythonic way to do all of this would be to just try it and handle the\n# exception, but handling the exception when it's not the right type is\n# often too slow.\n\n# We are using the following trick to speed up these\n# functions. Default arguments are used to take a snapshot of\n# the global functions and constants used by these functions. This\n# transforms accesses to global variable into local variables\n# accesses (i.e. LOAD_FAST instead of LOAD_GLOBAL).\n# Since checkers dislike this, it's now annotated for pylint to flag\n# (mostly for other readers of this code) we're doing this intentionally.\n# TODO: PY3 check these are still valid choices for all of these funcs.\n\nDictTypes = (dict, UserDict)\nListTypes = (list, UserList)\n\n# Handle getting dictionary views.\nSequenceTypes = (list, tuple, UserList, MappingView)\n\n# Note that profiling data shows a speed-up when comparing\n# explicitly with str instead of simply comparing\n# with basestring. (at least on Python 2.5.1)\n# TODO: PY3 check this benchmarking is still correct.\nStringTypes = (str, UserString)\n\n# Empirically, it is faster to check explicitly for str than for basestring.\nBaseStringTypes = str\n\ndef is_Dict(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, isinstance=isinstance, DictTypes=DictTypes\n) -> bool:\n    return isinstance(obj, DictTypes)\n\n\ndef is_List(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, isinstance=isinstance, ListTypes=ListTypes\n) -> bool:\n    return isinstance(obj, ListTypes)\n\n\ndef is_Sequence(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, isinstance=isinstance, SequenceTypes=SequenceTypes\n) -> bool:\n    return isinstance(obj, SequenceTypes)\n\n\ndef is_Tuple(  # pylint: disable=redefined-builtin\n    obj, isinstance=isinstance, tuple=tuple\n) -> bool:\n    return isinstance(obj, tuple)\n\n\ndef is_String(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, isinstance=isinstance, StringTypes=StringTypes\n) -> bool:\n    return isinstance(obj, StringTypes)\n\n\ndef is_Scalar(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes\n) -> bool:\n\n    # Profiling shows that there is an impressive speed-up of 2x\n    # when explicitly checking for strings instead of just not\n    # sequence when the argument (i.e. obj) is already a string.\n    # But, if obj is a not string then it is twice as fast to\n    # check only for 'not sequence'. The following code therefore\n    # assumes that the obj argument is a string most of the time.\n    return isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes)\n\n\ndef do_flatten(\n    sequence,\n    result,\n    isinstance=isinstance,\n    StringTypes=StringTypes,\n    SequenceTypes=SequenceTypes,\n):  # pylint: disable=redefined-outer-name,redefined-builtin\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n\n\ndef flatten(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj,\n    isinstance=isinstance,\n    StringTypes=StringTypes,\n    SequenceTypes=SequenceTypes,\n    do_flatten=do_flatten,\n) -> list:\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Converts either a single scalar or a nested sequence to a non-nested list.\n    Note that :func:`flatten` considers strings\n    to be scalars instead of sequences like pure Python would.\n    \"\"\"\n    if isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes):\n        return [obj]\n    result = []\n    for item in obj:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\n\ndef flatten_sequence(  # pylint: disable=redefined-outer-name,redefined-builtin\n    sequence,\n    isinstance=isinstance,\n    StringTypes=StringTypes,\n    SequenceTypes=SequenceTypes,\n    do_flatten=do_flatten,\n) -> list:\n    \"\"\"Flatten a sequence to a non-nested list.\n\n    Same as :func:`flatten`, but it does not handle the single scalar case.\n    This is slightly more efficient when one knows that the sequence\n    to flatten can not be a scalar.\n    \"\"\"\n    result = []\n    for item in sequence:\n        if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):\n            result.append(item)\n        else:\n            do_flatten(item, result)\n    return result\n\n# Generic convert-to-string functions.  The wrapper\n# to_String_for_signature() will use a for_signature() method if the\n# specified object has one.\n\ndef to_String(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj,\n    isinstance=isinstance,\n    str=str,\n    UserString=UserString,\n    BaseStringTypes=BaseStringTypes,\n) -> str:\n    \"\"\"Return a string version of obj.\"\"\"\n\n    if isinstance(obj, BaseStringTypes):\n        # Early out when already a string!\n        return obj\n\n    if isinstance(obj, UserString):\n        # obj.data can only be a regular string. Please see the UserString initializer.\n        return obj.data\n\n    return str(obj)\n\ndef to_String_for_subst(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj,\n    isinstance=isinstance,\n    str=str,\n    BaseStringTypes=BaseStringTypes,\n    SequenceTypes=SequenceTypes,\n    UserString=UserString,\n) -> str:\n    \"\"\"Return a string version of obj for subst usage.\"\"\"\n\n    # Note that the test cases are sorted by order of probability.\n    if isinstance(obj, BaseStringTypes):\n        return obj\n\n    if isinstance(obj, SequenceTypes):\n        return ' '.join([to_String_for_subst(e) for e in obj])\n\n    if isinstance(obj, UserString):\n        # obj.data can only a regular string. Please see the UserString initializer.\n        return obj.data\n\n    return str(obj)\n\ndef to_String_for_signature(  # pylint: disable=redefined-outer-name,redefined-builtin\n    obj, to_String_for_subst=to_String_for_subst, AttributeError=AttributeError\n) -> str:\n    \"\"\"Return a string version of obj for signature usage.\n\n    Like :func:`to_String_for_subst` but has special handling for\n    scons objects that have a :meth:`for_signature` method, and for dicts.\n    \"\"\"\n\n    try:\n        f = obj.for_signature\n    except AttributeError:\n        if isinstance(obj, dict):\n            # pprint will output dictionary in key sorted order\n            # with py3.5 the order was randomized. In general depending on dictionary order\n            # which was undefined until py3.6 (where it's by insertion order) was not wise.\n            # TODO: Change code when floor is raised to PY36\n            return pprint.pformat(obj, width=1000000)\n        return to_String_for_subst(obj)\n    else:\n        return f()\n\n\n# The SCons \"semi-deep\" copy.\n#\n# This makes separate copies of lists (including UserList objects)\n# dictionaries (including UserDict objects) and tuples, but just copies\n# references to anything else it finds.\n#\n# A special case is any object that has a __semi_deepcopy__() method,\n# which we invoke to create the copy. Currently only used by\n# BuilderDict to actually prevent the copy operation (as invalid on that object).\n#\n# The dispatch table approach used here is a direct rip-off from the\n# normal Python copy module.\n\ndef semi_deepcopy_dict(obj, exclude=None) -> dict:\n    if exclude is None:\n        exclude = []\n    return {k: semi_deepcopy(v) for k, v in obj.items() if k not in exclude}\n\ndef _semi_deepcopy_list(obj) -> list:\n    return [semi_deepcopy(item) for item in obj]\n\ndef _semi_deepcopy_tuple(obj) -> tuple:\n    return tuple(map(semi_deepcopy, obj))\n\n_semi_deepcopy_dispatch = {\n    dict: semi_deepcopy_dict,\n    list: _semi_deepcopy_list,\n    tuple: _semi_deepcopy_tuple,\n}\n\ndef semi_deepcopy(obj):\n    copier = _semi_deepcopy_dispatch.get(type(obj))\n    if copier:\n        return copier(obj)\n\n    if hasattr(obj, '__semi_deepcopy__') and callable(obj.__semi_deepcopy__):\n        return obj.__semi_deepcopy__()\n\n    if isinstance(obj, UserDict):\n        return obj.__class__(semi_deepcopy_dict(obj))\n\n    if isinstance(obj, UserList):\n        return obj.__class__(_semi_deepcopy_list(obj))\n\n    return obj\n\n\nclass Proxy:\n    \"\"\"A simple generic Proxy class, forwarding all calls to subject.\n\n    This means you can take an object, let's call it `'obj_a`,\n    and wrap it in this Proxy class, with a statement like this::\n\n        proxy_obj = Proxy(obj_a)\n\n    Then, if in the future, you do something like this::\n\n        x = proxy_obj.var1\n\n    since the :class:`Proxy` class does not have a :attr:`var1` attribute\n    (but presumably `objA` does), the request actually is equivalent to saying::\n\n        x = obj_a.var1\n\n    Inherit from this class to create a Proxy.\n\n    With Python 3.5+ this does *not* work transparently\n    for :class:`Proxy` subclasses that use special .__*__() method names,\n    because those names are now bound to the class, not the individual\n    instances.  You now need to know in advance which special method names you\n    want to pass on to the underlying Proxy object, and specifically delegate\n    their calls like this::\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n\n    def __init__(self, subject):\n        \"\"\"Wrap an object as a Proxy object\"\"\"\n        self._subject = subject\n\n    def __getattr__(self, name):\n        \"\"\"Retrieve an attribute from the wrapped object.\n\n        Raises:\n           AttributeError: if attribute `name` doesn't exist.\n        \"\"\"\n        return getattr(self._subject, name)\n\n    def get(self):\n        \"\"\"Retrieve the entire wrapped object\"\"\"\n        return self._subject\n\n    def __eq__(self, other):\n        if issubclass(other.__class__, self._subject.__class__):\n            return self._subject == other\n        return self.__dict__ == other.__dict__\n\n\nclass Delegate:\n    \"\"\"A Python Descriptor class that delegates attribute fetches\n    to an underlying wrapped subject of a Proxy.  Typical use::\n\n        class Foo(Proxy):\n            __str__ = Delegate('__str__')\n    \"\"\"\n    def __init__(self, attribute):\n        self.attribute = attribute\n\n    def __get__(self, obj, cls):\n        if isinstance(obj, cls):\n            return getattr(obj._subject, self.attribute)\n\n        return self\n\n\nclass MethodWrapper:\n    \"\"\"A generic Wrapper class that associates a method with an object.\n\n    As part of creating this MethodWrapper object an attribute with the\n    specified name (by default, the name of the supplied method) is added\n    to the underlying object.  When that new \"method\" is called, our\n    :meth:`__call__` method adds the object as the first argument, simulating\n    the Python behavior of supplying \"self\" on method calls.\n\n    We hang on to the name by which the method was added to the underlying\n    base class so that we can provide a method to \"clone\" ourselves onto\n    a new underlying object being copied (without which we wouldn't need\n    to save that info).\n    \"\"\"\n    def __init__(self, obj, method, name=None):\n        if name is None:\n            name = method.__name__\n        self.object = obj\n        self.method = method\n        self.name = name\n        setattr(self.object, name, self)\n\n    def __call__(self, *args, **kwargs):\n        nargs = (self.object,) + args\n        return self.method(*nargs, **kwargs)\n\n    def clone(self, new_object):\n        \"\"\"\n        Returns an object that re-binds the underlying \"method\" to\n        the specified new object.\n        \"\"\"\n        return self.__class__(new_object, self.method, self.name)\n\n\n# attempt to load the windows registry module:\ncan_read_reg = False\ntry:\n    import winreg\n\n    can_read_reg = True\n    hkey_mod = winreg\n\nexcept ImportError:\n    class _NoError(Exception):\n        pass\n    RegError = _NoError\n\nif can_read_reg:\n    HKEY_CLASSES_ROOT = hkey_mod.HKEY_CLASSES_ROOT\n    HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE\n    HKEY_CURRENT_USER = hkey_mod.HKEY_CURRENT_USER\n    HKEY_USERS = hkey_mod.HKEY_USERS\n\n    RegOpenKeyEx = winreg.OpenKeyEx\n    RegEnumKey = winreg.EnumKey\n    RegEnumValue = winreg.EnumValue\n    RegQueryValueEx = winreg.QueryValueEx\n    RegError = winreg.error\n\n    def RegGetValue(root, key):\n        r\"\"\"Returns a registry value without having to open the key first.\n\n        Only available on Windows platforms with a version of Python that\n        can read the registry.\n\n        Returns the same thing as :func:`RegQueryValueEx`, except you just\n        specify the entire path to the value, and don't have to bother\n        opening the key first.  So, instead of::\n\n          k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion')\n          out = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir')\n\n        You can write::\n\n          out = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE,\n                r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir')\n        \"\"\"\n        # I would use os.path.split here, but it's not a filesystem\n        # path...\n        p = key.rfind('\\\\') + 1\n        keyp = key[: p - 1]  # -1 to omit trailing slash\n        val = key[p:]\n        k = RegOpenKeyEx(root, keyp)\n        return RegQueryValueEx(k, val)\n\n\nelse:\n    HKEY_CLASSES_ROOT = None\n    HKEY_LOCAL_MACHINE = None\n    HKEY_CURRENT_USER = None\n    HKEY_USERS = None\n\n    def RegGetValue(root, key):\n        raise OSError\n\n    def RegOpenKeyEx(root, key):\n        raise OSError\n\n\nif sys.platform == 'win32':\n\n    def WhereIs(file, path=None, pathext=None, reject=None) -> Optional[str]:\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            try:\n                pathext = os.environ['PATHEXT']\n            except KeyError:\n                pathext = '.COM;.EXE;.BAT;.CMD'\n        if is_String(pathext):\n            pathext = pathext.split(os.pathsep)\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if reject is None:\n            reject = []\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for p in path:\n            f = os.path.join(p, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelif os.name == 'os2':\n\n    def WhereIs(file, path=None, pathext=None, reject=None) -> Optional[str]:\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if pathext is None:\n            pathext = ['.exe', '.cmd']\n        for ext in pathext:\n            if ext.lower() == file[-len(ext):].lower():\n                pathext = ['']\n                break\n        if reject is None:\n            reject = []\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for p in path:\n            f = os.path.join(p, file)\n            for ext in pathext:\n                fext = f + ext\n                if os.path.isfile(fext):\n                    try:\n                        reject.index(fext)\n                    except ValueError:\n                        return os.path.normpath(fext)\n                    continue\n        return None\n\nelse:\n\n    def WhereIs(file, path=None, pathext=None, reject=None) -> Optional[str]:\n        import stat  # pylint: disable=import-outside-toplevel\n\n        if path is None:\n            try:\n                path = os.environ['PATH']\n            except KeyError:\n                return None\n        if is_String(path):\n            path = path.split(os.pathsep)\n        if reject is None:\n            reject = []\n        if not is_List(reject) and not is_Tuple(reject):\n            reject = [reject]\n        for p in path:\n            f = os.path.join(p, file)\n            if os.path.isfile(f):\n                try:\n                    st = os.stat(f)\n                except OSError:\n                    # os.stat() raises OSError, not IOError if the file\n                    # doesn't exist, so in this case we let IOError get\n                    # raised so as to not mask possibly serious disk or\n                    # network issues.\n                    continue\n                if stat.S_IMODE(st[stat.ST_MODE]) & 0o111:\n                    try:\n                        reject.index(f)\n                    except ValueError:\n                        return os.path.normpath(f)\n                    continue\n        return None\n\nWhereIs.__doc__ = \"\"\"\\\nReturn the path to an executable that matches `file`.\n\nSearches the given `path` for `file`, respecting any filename\nextensions `pathext` (on the Windows platform only), and\nreturns the full path to the matching command.  If no\ncommand is found, return ``None``.\n\nIf `path` is not specified, :attr:`os.environ[PATH]` is used.\nIf `pathext` is not specified, :attr:`os.environ[PATHEXT]`\nis used. Will not select any path name or names in the optional\n`reject` list.\n\"\"\"\n\ndef PrependPath(\n    oldpath, newpath, sep=os.pathsep, delete_existing=True, canonicalize=None\n) -> Union[list, str]:\n    \"\"\"Prepends `newpath` path elements to `oldpath`.\n\n    Will only add any particular path once (leaving the first one it\n    encounters and ignoring the rest, to preserve path order), and will\n    :mod:`os.path.normpath` and :mod:`os.path.normcase` all paths to help\n    assure this.  This can also handle the case where `oldpath`\n    is a list instead of a string, in which case a list will be returned\n    instead of a string. For example:\n\n    >>> p = PrependPath(\"/foo/bar:/foo\", \"/biz/boom:/foo\")\n    >>> print(p)\n    /biz/boom:/foo:/foo/bar\n\n    If `delete_existing` is ``False``, then adding a path that exists will\n    not move it to the beginning; it will stay where it is in the list.\n\n    >>> p = PrependPath(\"/foo/bar:/foo\", \"/biz/boom:/foo\", delete_existing=False)\n    >>> print(p)\n    /biz/boom:/foo/bar:/foo\n\n    If `canonicalize` is not ``None``, it is applied to each element of\n    `newpath` before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = True\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = False\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [ newpath ]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # First uniquify the old paths, making sure to\n        # preserve the first instance (in Unix/Linux,\n        # the first one wins), and remembering them in normpaths.\n        # Then insert the new paths at the head of the list\n        # if they're not already in the normpaths list.\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        newpaths.reverse()      # since we're inserting at the head\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.insert(0, path)\n                normpaths.append(normpath)\n        paths = result\n\n    else:\n        newpaths = newpaths + paths # prepend new paths\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and normpath not in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n\n    if is_list:\n        return paths\n\n    return sep.join(paths)\n\ndef AppendPath(\n    oldpath, newpath, sep=os.pathsep, delete_existing=True, canonicalize=None\n) -> Union[list, str]:\n    \"\"\"Appends `newpath` path elements to `oldpath`.\n\n    Will only add any particular path once (leaving the last one it\n    encounters and ignoring the rest, to preserve path order), and will\n    :mod:`os.path.normpath` and :mod:`os.path.normcase` all paths to help\n    assure this.  This can also handle the case where `oldpath`\n    is a list instead of a string, in which case a list will be returned\n    instead of a string. For example:\n\n    >>> p = AppendPath(\"/foo/bar:/foo\", \"/biz/boom:/foo\")\n    >>> print(p)\n    /foo/bar:/biz/boom:/foo\n\n    If `delete_existing` is ``False``, then adding a path that exists\n    will not move it to the end; it will stay where it is in the list.\n\n    >>> p = AppendPath(\"/foo/bar:/foo\", \"/biz/boom:/foo\", delete_existing=False)\n    >>> print(p)\n    /foo/bar:/foo:/biz/boom\n\n    If `canonicalize` is not ``None``, it is applied to each element of\n    `newpath` before use.\n    \"\"\"\n\n    orig = oldpath\n    is_list = True\n    paths = orig\n    if not is_List(orig) and not is_Tuple(orig):\n        paths = paths.split(sep)\n        is_list = False\n\n    if is_String(newpath):\n        newpaths = newpath.split(sep)\n    elif not is_List(newpath) and not is_Tuple(newpath):\n        newpaths = [newpath]  # might be a Dir\n    else:\n        newpaths = newpath\n\n    if canonicalize:\n        newpaths=list(map(canonicalize, newpaths))\n\n    if not delete_existing:\n        # add old paths to result, then\n        # add new paths if not already present\n        # (I thought about using a dict for normpaths for speed,\n        # but it's not clear hashing the strings would be faster\n        # than linear searching these typically short lists.)\n        result = []\n        normpaths = []\n        for path in paths:\n            if not path:\n                continue\n            result.append(path)\n            normpaths.append(os.path.normpath(os.path.normcase(path)))\n        for path in newpaths:\n            if not path:\n                continue\n            normpath = os.path.normpath(os.path.normcase(path))\n            if normpath not in normpaths:\n                result.append(path)\n                normpaths.append(normpath)\n        paths = result\n    else:\n        # start w/ new paths, add old ones if not present,\n        # then reverse.\n        newpaths = paths + newpaths # append new paths\n        newpaths.reverse()\n\n        normpaths = []\n        paths = []\n        # now we add them only if they are unique\n        for path in newpaths:\n            normpath = os.path.normpath(os.path.normcase(path))\n            if path and normpath not in normpaths:\n                paths.append(path)\n                normpaths.append(normpath)\n        paths.reverse()\n\n    if is_list:\n        return paths\n\n    return sep.join(paths)\n\ndef AddPathIfNotExists(env_dict, key, path, sep=os.pathsep):\n    \"\"\"Add a path element to a construction variable.\n\n    `key` is looked up in `env_dict`, and `path` is added to it if it\n    is not already present. `env_dict[key]` is assumed to be in the\n    format of a PATH variable: a list of paths separated by `sep` tokens.\n    Example:\n\n    >>> env = {'PATH': '/bin:/usr/bin:/usr/local/bin'}\n    >>> AddPathIfNotExists(env, 'PATH', '/opt/bin')\n    >>> print(env['PATH'])\n    /opt/bin:/bin:/usr/bin:/usr/local/bin\n    \"\"\"\n\n    try:\n        is_list = True\n        paths = env_dict[key]\n        if not is_List(env_dict[key]):\n            paths = paths.split(sep)\n            is_list = False\n        if os.path.normcase(path) not in list(map(os.path.normcase, paths)):\n            paths = [ path ] + paths\n        if is_list:\n            env_dict[key] = paths\n        else:\n            env_dict[key] = sep.join(paths)\n    except KeyError:\n        env_dict[key] = path\n\nif sys.platform == 'cygwin':\n    import subprocess  # pylint: disable=import-outside-toplevel\n\n    def get_native_path(path) -> str:\n        cp = subprocess.run(('cygpath', '-w', path), check=False, stdout=subprocess.PIPE)\n        return cp.stdout.decode().replace('\\n', '')\nelse:\n    def get_native_path(path) -> str:\n        return path\n\nget_native_path.__doc__ = \"\"\"\\\nTransform an absolute path into a native path for the system.\n\nIn Cygwin, this converts from a Cygwin path to a Windows path,\nwithout regard to whether `path` refers to an existing file\nsystem object.  For other platforms, `path` is unchanged.\n\"\"\"\n\n\ndisplay = DisplayEngine()\n\ndef Split(arg) -> list:\n    \"\"\"Returns a list of file names or other objects.\n\n    If `arg` is a string, it will be split on strings of white-space\n    characters within the string.  If `arg` is already a list, the list\n    will be returned untouched. If `arg` is any other type of object,\n    it will be returned as a list containing just the object.\n\n    >>> print(Split(\" this  is  a  string  \"))\n    ['this', 'is', 'a', 'string']\n    >>> print(Split([\"stringlist\", \" preserving \", \" spaces \"]))\n    ['stringlist', ' preserving ', ' spaces ']\n    \"\"\"\n    if is_List(arg) or is_Tuple(arg):\n        return arg\n\n    if is_String(arg):\n        return arg.split()\n\n    return [arg]\n\n\nclass CLVar(UserList):\n    \"\"\"A container for command-line construction variables.\n\n    Forces the use of a list of strings intended as command-line\n    arguments.  Like :class:`collections.UserList`, but the argument\n    passed to the initializter will be processed by the :func:`Split`\n    function, which includes special handling for string types: they\n    will be split into a list of words, not coereced directly to a list.\n    The same happens if a string is added to a :class:`CLVar`,\n    which allows doing the right thing with both\n    :func:`Append`/:func:`Prepend` methods,\n    as well as with pure Python addition, regardless of whether adding\n    a list or a string to a construction variable.\n\n    Side effect: spaces will be stripped from individual string\n    arguments. If you need spaces preserved, pass strings containing\n    spaces inside a list argument.\n\n    >>> u = UserList(\"--some --opts and args\")\n    >>> print(len(u), repr(u))\n    22 ['-', '-', 's', 'o', 'm', 'e', ' ', '-', '-', 'o', 'p', 't', 's', ' ', 'a', 'n', 'd', ' ', 'a', 'r', 'g', 's']\n    >>> c = CLVar(\"--some --opts and args\")\n    >>> print(len(c), repr(c))\n    4 ['--some', '--opts', 'and', 'args']\n    >>> c += \"    strips spaces    \"\n    >>> print(len(c), repr(c))\n    6 ['--some', '--opts', 'and', 'args', 'strips', 'spaces']\n    \"\"\"\n\n    def __init__(self, initlist=None):\n        super().__init__(Split(initlist if initlist is not None else []))\n\n    def __add__(self, other):\n        return super().__add__(CLVar(other))\n\n    def __radd__(self, other):\n        return super().__radd__(CLVar(other))\n\n    def __iadd__(self, other):\n        return super().__iadd__(CLVar(other))\n\n    def __str__(self):\n        return ' '.join(self.data)\n\n\nclass Selector(OrderedDict):\n    \"\"\"A callable ordered dictionary that maps file suffixes to\n    dictionary values.  We preserve the order in which items are added\n    so that :func:`get_suffix` calls always return the first suffix added.\n    \"\"\"\n    def __call__(self, env, source, ext=None):\n        if ext is None:\n            try:\n                ext = source[0].get_suffix()\n            except IndexError:\n                ext = \"\"\n        try:\n            return self[ext]\n        except KeyError:\n            # Try to perform Environment substitution on the keys of\n            # the dictionary before giving up.\n            s_dict = {}\n            for (k,v) in self.items():\n                if k is not None:\n                    s_k = env.subst(k)\n                    if s_k in s_dict:\n                        # We only raise an error when variables point\n                        # to the same suffix.  If one suffix is literal\n                        # and a variable suffix contains this literal,\n                        # the literal wins and we don't raise an error.\n                        raise KeyError(s_dict[s_k][0], k, s_k)\n                    s_dict[s_k] = (k,v)\n            try:\n                return s_dict[ext][1]\n            except KeyError:\n                try:\n                    return self[None]\n                except KeyError:\n                    return None\n\n\nif sys.platform == 'cygwin':\n    # On Cygwin, os.path.normcase() lies, so just report back the\n    # fact that the underlying Windows OS is case-insensitive.\n    def case_sensitive_suffixes(s1, s2) -> bool:  # pylint: disable=unused-argument\n        return False\n\nelse:\n    def case_sensitive_suffixes(s1, s2) -> bool:\n        return os.path.normcase(s1) != os.path.normcase(s2)\n\n\ndef adjustixes(fname, pre, suf, ensure_suffix=False) -> str:\n    \"\"\"Adjust filename prefixes and suffixes as needed.\n\n    Add `prefix` to `fname` if specified.\n    Add `suffix` to `fname` if specified and if `ensure_suffix` is ``True``\n    \"\"\"\n\n    if pre:\n        path, fn = os.path.split(os.path.normpath(fname))\n\n        # Handle the odd case where the filename = the prefix.\n        # In that case, we still want to add the prefix to the file\n        if not fn.startswith(pre) or fn == pre:\n            fname = os.path.join(path, pre + fn)\n    # Only append a suffix if the suffix we're going to add isn't already\n    # there, and if either we've been asked to ensure the specific suffix\n    # is present or there's no suffix on it at all.\n    # Also handle the odd case where the filename = the suffix.\n    # in that case we still want to append the suffix\n    if suf and not fname.endswith(suf) and \\\n            (ensure_suffix or not splitext(fname)[1]):\n        fname = fname + suf\n    return fname\n\n\n\n# From Tim Peters,\n# https://code.activestate.com/recipes/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# (Also in the printed Python Cookbook.)\n# Updated. This algorithm is used by some scanners and tools.\n\ndef unique(seq):\n    \"\"\"Return a list of the elements in seq without duplicates, ignoring order.\n\n    >>> mylist = unique([1, 2, 3, 1, 2, 3])\n    >>> print(sorted(mylist))\n    [1, 2, 3]\n    >>> mylist = unique(\"abcabc\")\n    >>> print(sorted(mylist))\n    ['a', 'b', 'c']\n    >>> mylist = unique(([1, 2], [2, 3], [1, 2]))\n    >>> print(sorted(mylist))\n    [[1, 2], [2, 3]]\n\n    For best speed, all sequence elements should be hashable.  Then\n    unique() will usually work in linear time.\n\n    If not possible, the sequence elements should enjoy a total\n    ordering, and if list(s).sort() doesn't raise TypeError it's\n    assumed that they do enjoy a total ordering.  Then unique() will\n    usually work in O(N*log2(N)) time.\n\n    If that's not possible either, the sequence elements must support\n    equality-testing.  Then unique() will usually work in quadratic time.\n    \"\"\"\n\n    if not seq:\n        return []\n\n    # Try using a dict first, as that's the fastest and will usually\n    # work.  If it doesn't work, it will usually fail quickly, so it\n    # usually doesn't cost much to *try* it.  It requires that all the\n    # sequence elements be hashable, and support equality comparison.\n    # TODO: should be even faster: return(list(set(seq)))\n    with suppress(TypeError):\n        return list(dict.fromkeys(seq))\n\n    # We couldn't hash all the elements (got a TypeError).\n    # Next fastest is to sort, which brings the equal elements together;\n    # then duplicates are easy to weed out in a single pass.\n    # NOTE:  Python's list.sort() was designed to be efficient in the\n    # presence of many duplicate elements.  This isn't true of all\n    # sort functions in all languages or libraries, so this approach\n    # is more effective in Python than it may be elsewhere.\n    n = len(seq)\n    try:\n        t = sorted(seq)\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        last = t[0]\n        lasti = i = 1\n        while i < n:\n            if t[i] != last:\n                t[lasti] = last = t[i]\n                lasti = lasti + 1\n            i = i + 1\n        return t[:lasti]\n\n    # Brute force is all that's left.\n    u = []\n    for x in seq:\n        if x not in u:\n            u.append(x)\n    return u\n\n\n# From Alex Martelli,\n# https://code.activestate.com/recipes/52560\n# ASPN: Python Cookbook: Remove duplicates from a sequence\n# First comment, dated 2001/10/13.\n# (Also in the printed Python Cookbook.)\n# This not currently used, in favor of the next function...\n\ndef uniquer(seq, idfun=None):\n    def default_idfun(x):\n        return x\n    if not idfun:\n        idfun = default_idfun\n    seen = {}\n    result = []\n    result_append = result.append  # perf: avoid repeated method lookups\n    for item in seq:\n        marker = idfun(item)\n        if marker in seen:\n            continue\n        seen[marker] = 1\n        result_append(item)\n    return result\n\n# A more efficient implementation of Alex's uniquer(), this avoids the\n# idfun() argument and function-call overhead by assuming that all\n# items in the sequence are hashable.  Order-preserving.\n\ndef uniquer_hashables(seq):\n    seen = {}\n    result = []\n    result_append = result.append  # perf: avoid repeated method lookups\n    for item in seq:\n        if item not in seen:\n            seen[item] = 1\n            result_append(item)\n    return result\n\n\n# Recipe 19.11 \"Reading Lines with Continuation Characters\",\n# by Alex Martelli, straight from the Python CookBook (2nd edition).\ndef logical_lines(physical_lines, joiner=''.join):\n    logical_line = []\n    for line in physical_lines:\n        stripped = line.rstrip()\n        if stripped.endswith('\\\\'):\n            # a line which continues w/the next physical line\n            logical_line.append(stripped[:-1])\n        else:\n            # a line which does not continue, end of logical line\n            logical_line.append(line)\n            yield joiner(logical_line)\n            logical_line = []\n    if logical_line:\n        # end of sequence implies end of last logical line\n        yield joiner(logical_line)\n\n\nclass LogicalLines:\n    \"\"\" Wrapper class for the logical_lines method.\n\n    Allows us to read all \"logical\" lines at once from a given file object.\n    \"\"\"\n\n    def __init__(self, fileobj):\n        self.fileobj = fileobj\n\n    def readlines(self):\n        return list(logical_lines(self.fileobj))\n\n\nclass UniqueList(UserList):\n    \"\"\"A list which maintains uniqueness.\n\n    Uniquing is lazy: rather than being assured on list changes, it is fixed\n    up on access by those methods which need to act on a uniqe list to be\n    correct. That means things like \"in\" don't have to eat the uniquing time.\n    \"\"\"\n    def __init__(self, initlist=None):\n        super().__init__(initlist)\n        self.unique = True\n\n    def __make_unique(self):\n        if not self.unique:\n            self.data = uniquer_hashables(self.data)\n            self.unique = True\n\n    def __repr__(self):\n        self.__make_unique()\n        return super().__repr__()\n\n    def __lt__(self, other):\n        self.__make_unique()\n        return super().__lt__(other)\n\n    def __le__(self, other):\n        self.__make_unique()\n        return super().__le__(other)\n\n    def __eq__(self, other):\n        self.__make_unique()\n        return super().__eq__(other)\n\n    def __ne__(self, other):\n        self.__make_unique()\n        return super().__ne__(other)\n\n    def __gt__(self, other):\n        self.__make_unique()\n        return super().__gt__(other)\n\n    def __ge__(self, other):\n        self.__make_unique()\n        return super().__ge__(other)\n\n    # __contains__ doesn't need to worry about uniquing, inherit\n\n    def __len__(self):\n        self.__make_unique()\n        return super().__len__()\n\n    def __getitem__(self, i):\n        self.__make_unique()\n        return super().__getitem__(i)\n\n    def __setitem__(self, i, item):\n        super().__setitem__(i, item)\n        self.unique = False\n\n    # __delitem__ doesn't need to worry about uniquing, inherit\n\n    def __add__(self, other):\n        result = super().__add__(other)\n        result.unique = False\n        return result\n\n    def __radd__(self, other):\n        result = super().__radd__(other)\n        result.unique = False\n        return result\n\n    def __iadd__(self, other):\n        result = super().__iadd__(other)\n        result.unique = False\n        return result\n\n    def __mul__(self, other):\n        result = super().__mul__(other)\n        result.unique = False\n        return result\n\n    def __rmul__(self, other):\n        result = super().__rmul__(other)\n        result.unique = False\n        return result\n\n    def __imul__(self, other):\n        result = super().__imul__(other)\n        result.unique = False\n        return result\n\n    def append(self, item):\n        super().append(item)\n        self.unique = False\n\n    def insert(self, i, item):\n        super().insert(i, item)\n        self.unique = False\n\n    def count(self, item):\n        self.__make_unique()\n        return super().count(item)\n\n    def index(self, item, *args):\n        self.__make_unique()\n        return super().index(item, *args)\n\n    def reverse(self):\n        self.__make_unique()\n        super().reverse()\n\n    # TODO: Py3.8: def sort(self, /, *args, **kwds):\n    def sort(self, *args, **kwds):\n        self.__make_unique()\n        return super().sort(*args, **kwds)\n\n    def extend(self, other):\n        super().extend(other)\n        self.unique = False\n\n\nclass Unbuffered:\n    \"\"\"A proxy  that wraps a file object, flushing after every write.\n\n    Delegates everything else to the wrapped object.\n    \"\"\"\n    def __init__(self, file):\n        self.file = file\n\n    def write(self, arg):\n        # Stdout might be connected to a pipe that has been closed\n        # by now. The most likely reason for the pipe being closed\n        # is that the user has press ctrl-c. It this is the case,\n        # then SCons is currently shutdown. We therefore ignore\n        # IOError's here so that SCons can continue and shutdown\n        # properly so that the .sconsign is correctly written\n        # before SCons exits.\n        with suppress(IOError):\n            self.file.write(arg)\n            self.file.flush()\n\n    def writelines(self, arg):\n        with suppress(IOError):\n            self.file.writelines(arg)\n            self.file.flush()\n\n    def __getattr__(self, attr):\n        return getattr(self.file, attr)\n\ndef make_path_relative(path) -> str:\n    \"\"\"Converts an absolute path name to a relative pathname.\"\"\"\n\n    if os.path.isabs(path):\n        drive_s, path = os.path.splitdrive(path)\n\n        if not drive_s:\n            path=re.compile(r\"/*(.*)\").findall(path)[0]\n        else:\n            path=path[1:]\n\n    assert not os.path.isabs(path), path\n    return path\n\n\n# The original idea for AddMethod() came from the\n# following post to the ActiveState Python Cookbook:\n#\n# ASPN: Python Cookbook : Install bound methods in an instance\n# https://code.activestate.com/recipes/223613\n#\n# Changed as follows:\n# * Switched the installmethod() \"object\" and \"function\" arguments,\n#   so the order reflects that the left-hand side is the thing being\n#   \"assigned to\" and the right-hand side is the value being assigned.\n# * The instance/class detection is changed a bit, as it's all\n#   new-style classes now with Py3.\n# * The by-hand construction of the function object from renamefunction()\n#   is not needed, the remaining bit is now used inline in AddMethod.\n\ndef AddMethod(obj, function, name=None):\n    \"\"\"Adds a method to an object.\n\n    Adds `function` to `obj` if `obj` is a class object.\n    Adds `function` as a bound method if `obj` is an instance object.\n    If `obj` looks like an environment instance, use `MethodWrapper`\n    to add it.  If `name` is supplied it is used as the name of `function`.\n\n    Although this works for any class object, the intent as a public\n    API is to be used on Environment, to be able to add a method to all\n    construction environments; it is preferred to use env.AddMethod\n    to add to an individual environment.\n\n    >>> class A:\n    ...    ...\n\n    >>> a = A()\n\n    >>> def f(self, x, y):\n    ...    self.z = x + y\n\n    >>> AddMethod(A, f, \"add\")\n    >>> a.add(2, 4)\n    >>> print(a.z)\n    6\n    >>> a.data = ['a', 'b', 'c', 'd', 'e', 'f']\n    >>> AddMethod(a, lambda self, i: self.data[i], \"listIndex\")\n    >>> print(a.listIndex(3))\n    d\n\n    \"\"\"\n    if name is None:\n        name = function.__name__\n    else:\n        # \"rename\"\n        function = FunctionType(\n            function.__code__, function.__globals__, name, function.__defaults__\n        )\n\n    if hasattr(obj, '__class__') and obj.__class__ is not type:\n        # obj is an instance, so it gets a bound method.\n        if hasattr(obj, \"added_methods\"):\n            method = MethodWrapper(obj, function, name)\n            obj.added_methods.append(method)\n        else:\n            method = MethodType(function, obj)\n    else:\n        # obj is a class\n        method = function\n\n    setattr(obj, name, method)\n\n\n# Default hash function and format. SCons-internal.\nDEFAULT_HASH_FORMATS = ['md5', 'sha1', 'sha256']\nALLOWED_HASH_FORMATS = []\n_HASH_FUNCTION = None\n_HASH_FORMAT = None\n\ndef _attempt_init_of_python_3_9_hash_object(hash_function_object, sys_used=sys):\n    \"\"\"Python 3.9 and onwards lets us initialize the hash function object with the\n    key \"usedforsecurity\"=false. This lets us continue to use algorithms that have\n    been deprecated either by FIPS or by Python itself, as the MD5 algorithm SCons\n    prefers is not being used for security purposes as much as a short, 32 char\n    hash that is resistant to accidental collisions.\n\n    In prior versions of python, hashlib returns a native function wrapper, which\n    errors out when it's queried for the optional parameter, so this function\n    wraps that call.\n\n    It can still throw a ValueError if the initialization fails due to FIPS\n    compliance issues, but that is assumed to be the responsibility of the caller.\n    \"\"\"\n    if hash_function_object is None:\n        return None\n    \n    # https://stackoverflow.com/a/11887885 details how to check versions with the \"packaging\" library.\n    # however, for our purposes checking the version is greater than or equal to 3.9 is good enough, as\n    # the API is guaranteed to have support for the 'usedforsecurity' flag in 3.9. See \n    # https://docs.python.org/3/library/hashlib.html#:~:text=usedforsecurity for the version support notes.\n    if (sys_used.version_info.major > 3) or (sys_used.version_info.major == 3 and sys_used.version_info.minor >= 9):\n        return hash_function_object(usedforsecurity=False)\n\n    # note that this can throw a ValueError in FIPS-enabled versions of Linux prior to 3.9\n    # the OpenSSL hashlib will throw on first init here, but that is assumed to be responsibility of\n    # the caller to diagnose the ValueError & potentially display the error to screen.\n    return hash_function_object()\n\ndef _set_allowed_viable_default_hashes(hashlib_used, sys_used=sys):\n    \"\"\"Checks if SCons has ability to call the default algorithms normally supported.\n\n    This util class is sometimes called prior to setting the user-selected hash algorithm,\n    meaning that on FIPS-compliant systems the library would default-initialize MD5\n    and throw an exception in set_hash_format. A common case is using the SConf options,\n    which can run prior to main, and thus ignore the options.hash_format variable.\n\n    This function checks the DEFAULT_HASH_FORMATS and sets the ALLOWED_HASH_FORMATS\n    to only the ones that can be called. In Python >= 3.9 this will always default to\n    MD5 as in Python 3.9 there is an optional attribute \"usedforsecurity\" set for the method.\n\n    Throws if no allowed hash formats are detected.\n    \"\"\"\n    global ALLOWED_HASH_FORMATS\n    _last_error = None\n    # note: if you call this method repeatedly, example using timeout, this is needed.\n    # otherwise it keeps appending valid formats to the string\n    ALLOWED_HASH_FORMATS = []\n    \n    for test_algorithm in DEFAULT_HASH_FORMATS:\n        _test_hash = getattr(hashlib_used, test_algorithm, None)\n        # we know hashlib claims to support it... check to see if we can call it.\n        if _test_hash is not None:\n            # the hashing library will throw an exception on initialization in FIPS mode,\n            # meaning if we call the default algorithm returned with no parameters, it'll\n            # throw if it's a bad algorithm, otherwise it will append it to the known\n            # good formats.\n            try:\n                _attempt_init_of_python_3_9_hash_object(_test_hash, sys_used)\n                ALLOWED_HASH_FORMATS.append(test_algorithm)\n            except ValueError as e:\n                _last_error = e\n                continue\n    \n    if len(ALLOWED_HASH_FORMATS) == 0:\n        from SCons.Errors import SConsEnvironmentError  # pylint: disable=import-outside-toplevel\n        # chain the exception thrown with the most recent error from hashlib.\n        raise SConsEnvironmentError(\n            'No usable hash algorithms found.'\n            'Most recent error from hashlib attached in trace.'\n        ) from _last_error\n    return\n\n_set_allowed_viable_default_hashes(hashlib)\n\n\ndef get_hash_format():\n    \"\"\"Retrieves the hash format or ``None`` if not overridden.\n\n    A return value of ``None``\n    does not guarantee that MD5 is being used; instead, it means that the\n    default precedence order documented in :func:`SCons.Util.set_hash_format`\n    is respected.\n    \"\"\"\n    return _HASH_FORMAT\n\ndef _attempt_get_hash_function(hash_name, hashlib_used=hashlib, sys_used=sys):\n    \"\"\"Wrapper used to try to initialize a hash function given.\n\n    If successful, returns the name of the hash function back to the user.\n\n    Otherwise returns None.\n    \"\"\"\n    try:\n        _fetch_hash = getattr(hashlib_used, hash_name, None)\n        if _fetch_hash is None:\n            return None\n        _attempt_init_of_python_3_9_hash_object(_fetch_hash, sys_used)\n        return hash_name\n    except ValueError:\n        # if attempt_init_of_python_3_9 throws, this is typically due to FIPS being enabled\n        # however, if we get to this point, the viable hash function check has either been\n        # bypassed or otherwise failed to properly restrict the user to only the supported\n        # functions. As such throw the UserError as an internal assertion-like error.\n        return None\n\ndef set_hash_format(hash_format, hashlib_used=hashlib, sys_used=sys):\n    \"\"\"Sets the default hash format used by SCons.\n\n    If `hash_format` is ``None`` or\n    an empty string, the default is determined by this function.\n\n    Currently the default behavior is to use the first available format of\n    the following options: MD5, SHA1, SHA256.\n    \"\"\"\n    global _HASH_FORMAT, _HASH_FUNCTION\n\n    _HASH_FORMAT = hash_format\n    if hash_format:\n        hash_format_lower = hash_format.lower()\n        if hash_format_lower not in ALLOWED_HASH_FORMATS:\n            from SCons.Errors import UserError  # pylint: disable=import-outside-toplevel\n\n            # user can select something not supported by their OS but normally supported by\n            # SCons, example, selecting MD5 in an OS with FIPS-mode turned on. Therefore we first\n            # check if SCons supports it, and then if their local OS supports it.\n            if hash_format_lower in DEFAULT_HASH_FORMATS:\n                raise UserError('While hash format \"%s\" is supported by SCons, the '\n                        'local system indicates only the following hash '\n                        'formats are supported by the hashlib library: %s' %\n                        (hash_format_lower,\n                        ', '.join(ALLOWED_HASH_FORMATS))\n                )\n            else:\n                # the hash format isn't supported by SCons in any case. Warn the user, and\n                # if we detect that SCons supports more algorithms than their local system\n                # supports, warn the user about that too.\n                if ALLOWED_HASH_FORMATS == DEFAULT_HASH_FORMATS:\n                    raise UserError('Hash format \"%s\" is not supported by SCons. Only '\n                            'the following hash formats are supported: %s' %\n                            (hash_format_lower,\n                             ', '.join(ALLOWED_HASH_FORMATS))\n                    )\n                else:\n                    raise UserError('Hash format \"%s\" is not supported by SCons. '\n                            'SCons supports more hash formats than your local system '\n                            'is reporting; SCons supports: %s. Your local system only '\n                            'supports: %s' %\n                            (hash_format_lower,\n                             ', '.join(DEFAULT_HASH_FORMATS), \n                             ', '.join(ALLOWED_HASH_FORMATS))\n                    )\n\n        # this is not expected to fail. If this fails it means the set_allowed_viable_default_hashes\n        # function did not throw, or when it threw, the exception was caught and ignored, or\n        # the global ALLOWED_HASH_FORMATS was changed by an external user.\n        _HASH_FUNCTION = _attempt_get_hash_function(hash_format_lower, hashlib_used, sys_used)\n        \n        if _HASH_FUNCTION is None:\n            from SCons.Errors import UserError  # pylint: disable=import-outside-toplevel\n\n            raise UserError(\n                'Hash format \"%s\" is not available in your Python interpreter. '\n                'Expected to be supported algorithm by set_allowed_viable_default_hashes, '\n                'Assertion error in SCons.'\n                % hash_format_lower\n            )\n    else:\n        # Set the default hash format based on what is available, defaulting\n        # to the first supported hash algorithm (usually md5) for backwards compatibility.\n        # in FIPS-compliant systems this usually defaults to SHA1, unless that too has been\n        # disabled.\n        for choice in ALLOWED_HASH_FORMATS:\n            _HASH_FUNCTION = _attempt_get_hash_function(choice, hashlib_used, sys_used)\n            \n            if _HASH_FUNCTION is not None:\n                break\n        else:\n            # This is not expected to happen in practice.\n            from SCons.Errors import UserError  # pylint: disable=import-outside-toplevel\n\n            raise UserError(\n                'Your Python interpreter does not have MD5, SHA1, or SHA256. '\n                'SCons requires at least one. Expected to support one or more '\n                'during set_allowed_viable_default_hashes.'\n            )\n\n# Ensure that this is initialized in case either:\n#    1. This code is running in a unit test.\n#    2. This code is running in a consumer that does hash operations while\n#       SConscript files are being loaded.\nset_hash_format(None)\n\n\ndef get_current_hash_algorithm_used():\n    \"\"\"Returns the current hash algorithm name used.\n    \n    Where the python version >= 3.9, this is expected to return md5.\n    If python's version is <= 3.8, this returns md5 on non-FIPS-mode platforms, and\n    sha1 or sha256 on FIPS-mode Linux platforms.\n\n    This function is primarily useful for testing, where one expects a value to be\n    one of N distinct hashes, and therefore the test needs to know which hash to select.\n    \"\"\"\n    return _HASH_FUNCTION\n\ndef _get_hash_object(hash_format, hashlib_used=hashlib, sys_used=sys):\n    \"\"\"Allocates a hash object using the requested hash format.\n\n    Args:\n        hash_format: Hash format to use.\n\n    Returns:\n        hashlib object.\n    \"\"\"\n    if hash_format is None:\n        if _HASH_FUNCTION is None:\n            from SCons.Errors import UserError  # pylint: disable=import-outside-toplevel\n\n            raise UserError('There is no default hash function. Did you call '\n                            'a hashing function before SCons was initialized?')\n        return _attempt_init_of_python_3_9_hash_object(getattr(hashlib_used, _HASH_FUNCTION, None), sys_used)\n\n    if not hasattr(hashlib, hash_format):\n        from SCons.Errors import UserError  # pylint: disable=import-outside-toplevel\n\n        raise UserError(\n            'Hash format \"%s\" is not available in your Python interpreter.' %\n            hash_format)\n\n    return _attempt_init_of_python_3_9_hash_object(getattr(hashlib, hash_format), sys_used)\n\n\ndef hash_signature(s, hash_format=None):\n    \"\"\"\n    Generate hash signature of a string\n\n    Args:\n        s: either string or bytes. Normally should be bytes\n        hash_format: Specify to override default hash format\n\n    Returns:\n        String of hex digits representing the signature\n    \"\"\"\n    m = _get_hash_object(hash_format)\n    try:\n        m.update(to_bytes(s))\n    except TypeError:\n        m.update(to_bytes(str(s)))\n\n    return m.hexdigest()\n\n\ndef hash_file_signature(fname, chunksize=65536, hash_format=None):\n    \"\"\"\n    Generate the md5 signature of a file\n\n    Args:\n        fname: file to hash\n        chunksize: chunk size to read\n        hash_format: Specify to override default hash format\n\n    Returns:\n        String of Hex digits representing the signature\n    \"\"\"\n\n    m = _get_hash_object(hash_format)\n    with open(fname, \"rb\") as f:\n        while True:\n            blck = f.read(chunksize)\n            if not blck:\n                break\n            m.update(to_bytes(blck))\n    return m.hexdigest()\n\n\ndef hash_collect(signatures, hash_format=None):\n    \"\"\"\n    Collects a list of signatures into an aggregate signature.\n\n    Args:\n        signatures: a list of signatures\n        hash_format: Specify to override default hash format\n\n    Returns:\n        the aggregate signature\n    \"\"\"\n\n    if len(signatures) == 1:\n        return signatures[0]\n\n    return hash_signature(', '.join(signatures), hash_format)\n\n\n_MD5_WARNING_SHOWN = False\n\ndef _show_md5_warning(function_name):\n    \"\"\"Shows a deprecation warning for various MD5 functions.\"\"\"\n\n    global _MD5_WARNING_SHOWN\n\n    if not _MD5_WARNING_SHOWN:\n        import SCons.Warnings  # pylint: disable=import-outside-toplevel\n\n        SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning,\n                            \"Function %s is deprecated\" % function_name)\n        _MD5_WARNING_SHOWN = True\n\n\ndef MD5signature(s):\n    \"\"\"Deprecated. Use :func:`hash_signature` instead.\"\"\"\n\n    _show_md5_warning(\"MD5signature\")\n    return hash_signature(s)\n\n\ndef MD5filesignature(fname, chunksize=65536):\n    \"\"\"Deprecated. Use :func:`hash_file_signature` instead.\"\"\"\n\n    _show_md5_warning(\"MD5filesignature\")\n    return hash_file_signature(fname, chunksize)\n\n\ndef MD5collect(signatures):\n    \"\"\"Deprecated. Use :func:`hash_collect` instead.\"\"\"\n\n    _show_md5_warning(\"MD5collect\")\n    return hash_collect(signatures)\n\n\ndef silent_intern(x):\n    \"\"\"\n    Perform :mod:`sys.intern` on the passed argument and return the result.\n    If the input is ineligible for interning the original argument is\n    returned and no exception is thrown.\n    \"\"\"\n    try:\n        return sys.intern(x)\n    except TypeError:\n        return x\n\n\n# From Dinu C. Gherman,\n# Python Cookbook, second edition, recipe 6.17, p. 277.\n# Also: https://code.activestate.com/recipes/68205\n# ASPN: Python Cookbook: Null Object Design Pattern\n\nclass Null:\n    \"\"\" Null objects always and reliably \"do nothing.\" \"\"\"\n    def __new__(cls, *args, **kwargs):\n        if '_instance' not in vars(cls):\n            cls._instance = super(Null, cls).__new__(cls, *args, **kwargs)\n        return cls._instance\n    def __init__(self, *args, **kwargs):\n        pass\n    def __call__(self, *args, **kwargs):\n        return self\n    def __repr__(self):\n        return \"Null(0x%08X)\" % id(self)\n    def __bool__(self):\n        return False\n    def __getattr__(self, name):\n        return self\n    def __setattr__(self, name, value):\n        return self\n    def __delattr__(self, name):\n        return self\n\n\nclass NullSeq(Null):\n    \"\"\" A Null object that can also be iterated over. \"\"\"\n    def __len__(self):\n        return 0\n    def __iter__(self):\n        return iter(())\n    def __getitem__(self, i):\n        return self\n    def __delitem__(self, i):\n        return self\n    def __setitem__(self, i, v):\n        return self\n\n\ndef to_bytes(s) -> bytes:\n    if s is None:\n        return b'None'\n    if isinstance(s, (bytes, bytearray)):\n        # if already bytes return.\n        return s\n    return bytes(s, 'utf-8')\n\n\ndef to_str(s) -> str:\n    if s is None:\n        return 'None'\n    if is_String(s):\n        return s\n    return str(s, 'utf-8')\n\n\ndef cmp(a, b) -> bool:\n    \"\"\"A cmp function because one is no longer available in python3.\"\"\"\n    return (a > b) - (a < b)\n\n\ndef get_env_bool(env, name, default=False) -> bool:\n    \"\"\"Convert a construction variable to bool.\n\n    If the value of `name` in `env` is 'true', 'yes', 'y', 'on' (case\n    insensitive) or anything convertible to int that yields non-zero then\n    return ``True``; if 'false', 'no', 'n', 'off' (case insensitive)\n    or a number that converts to integer zero return ``False``.\n    Otherwise, return `default`.\n\n    Args:\n        env: construction environment, or any dict-like object\n        name: name of the variable\n        default: value to return if `name` not in `env` or cannot\n          be converted (default: False)\n\n    Returns:\n        the \"truthiness\" of `name`\n    \"\"\"\n    try:\n        var = env[name]\n    except KeyError:\n        return default\n    try:\n        return bool(int(var))\n    except ValueError:\n        if str(var).lower() in ('true', 'yes', 'y', 'on'):\n            return True\n\n        if str(var).lower() in ('false', 'no', 'n', 'off'):\n            return False\n\n        return default\n\n\ndef get_os_env_bool(name, default=False) -> bool:\n    \"\"\"Convert an environment variable to bool.\n\n    Conversion is the same as for :func:`get_env_bool`.\n    \"\"\"\n    return get_env_bool(os.environ, name, default)\n\n\ndef print_time():\n    \"\"\"Hack to return a value from Main if can't import Main.\"\"\"\n    # pylint: disable=redefined-outer-name,import-outside-toplevel\n    from SCons.Script.Main import print_time\n    return print_time\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py",
    "content": "#! /usr/bin/env python\n#\n# SCons - a Software Constructor\n#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Show or convert the configuration of an SCons cache directory.\n\nA cache of derived files is stored by file signature.\nThe files are split into directories named by the first few\ndigits of the signature. The prefix length used for directory\nnames can be changed by this script.\n\"\"\"\n\nimport argparse\nimport glob\nimport json\nimport os\n\ndef rearrange_cache_entries(current_prefix_len, new_prefix_len):\n    \"\"\"Move cache files if prefix length changed.\n\n    Move the existing cache files to new directories of the\n    appropriate name length and clean up the old directories.\n    \"\"\"\n    print('Changing prefix length from', current_prefix_len,\n          'to', new_prefix_len)\n    dirs = set()\n    old_dirs = set()\n    for file in glob.iglob(os.path.join('*', '*')):\n        name = os.path.basename(file)\n        dname = name[:current_prefix_len].upper()\n        if dname not in old_dirs:\n            print('Migrating', dname)\n            old_dirs.add(dname)\n        dname = name[:new_prefix_len].upper()\n        if dname not in dirs:\n            os.mkdir(dname)\n            dirs.add(dname)\n        os.rename(file, os.path.join(dname, name))\n\n    # Now delete the original directories\n    for dname in old_dirs:\n        os.rmdir(dname)\n\n\n# The configuration dictionary should have one entry per entry in the\n# cache config. The value of each entry should include the following:\n#   implicit - (optional) This is to allow adding a new config entry and also\n#              changing the behaviour of the system at the same time. This\n#              indicates the value the config entry would have had if it had\n#              been specified.\n#   default - The value the config entry should have if it wasn't previously\n#             specified\n#   command-line - parameters to pass to ArgumentParser.add_argument\n#   converter - (optional) Function to call if conversion is required\n#               if this configuration entry changes\nconfig_entries = {\n    'prefix_len': {\n        'implicit': 1,\n        'default': 2,\n        'command-line': {\n            'help': 'Length of cache file name used as subdirectory prefix',\n            'metavar': '<number>',\n            'type': int\n        },\n        'converter': rearrange_cache_entries\n    }\n}\n\n\ndef main():\n    parser = argparse.ArgumentParser(\n        description='Modify the configuration of an scons cache directory',\n        epilog='''\n               Unspecified options will not be changed unless they are not\n               set at all, in which case they are set to an appropriate default.\n               ''')\n\n    parser.add_argument('cache-dir', help='Path to scons cache directory')\n    for param in config_entries:\n        parser.add_argument('--' + param.replace('_', '-'),\n                            **config_entries[param]['command-line'])\n    parser.add_argument('--version',\n                        action='version',\n                        version='%(prog)s 1.0')\n    parser.add_argument('--show',\n                        action=\"store_true\",\n                        help=\"show current configuration\")\n\n    # Get the command line as a dict without any of the unspecified entries.\n    args = dict([x for x in vars(parser.parse_args()).items() if x[1]])\n\n    # It seems somewhat strange to me, but positional arguments don't get the -\n    # in the name changed to _, whereas optional arguments do...\n    cache = args['cache-dir']\n    if not os.path.isdir(cache):\n        raise RuntimeError(\"There is no cache directory named %s\" % cache)\n    os.chdir(cache)\n    del args['cache-dir']\n\n    if not os.path.exists('config'):\n        # old config dirs did not have a 'config' file. Try to update.\n        # Validate the only files in the directory are directories 0-9, a-f\n        expected = ['{:X}'.format(x) for x in range(0, 16)]\n        if not set(os.listdir('.')).issubset(expected):\n            raise RuntimeError(\n                \"%s does not look like a valid version 1 cache directory\" % cache)\n        config = dict()\n    else:\n        with open('config') as conf:\n            config = json.load(conf)\n\n    if args.get('show', None):\n        print(\"Current configuration in '%s':\" % cache)\n        print(json.dumps(config, sort_keys=True,\n                         indent=4, separators=(',', ': ')))\n        # in case of the show argument, emit some stats as well\n        file_count = 0\n        for _, _, files in os.walk('.'):\n            file_count += len(files)\n        if file_count:  # skip config file if it exists\n            file_count -= 1\n        print(\"Cache contains %s files\" % file_count)\n        del args['show']\n\n    # Find any keys that are not currently set but should be\n    for key in config_entries:\n        if key not in config:\n            if 'implicit' in config_entries[key]:\n                config[key] = config_entries[key]['implicit']\n            else:\n                config[key] = config_entries[key]['default']\n            if key not in args:\n                args[key] = config_entries[key]['default']\n\n    # Now go through each entry in args to see if it changes an existing config\n    # setting.\n    for key in args:\n        if args[key] != config[key]:\n            if 'converter' in config_entries[key]:\n                config_entries[key]['converter'](config[key], args[key])\n            config[key] = args[key]\n\n    # and write the updated config file\n    with open('config', 'w') as conf:\n        json.dump(config, conf)\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py",
    "content": ""
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py",
    "content": "#! /usr/bin/env python\n#\n# SCons - a Software Constructor\n#\n# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Utility script to dump information from SCons signature database.\"\"\"\n\nimport getopt\nimport os\nimport sys\nfrom dbm import whichdb\n\nimport time\nimport pickle\n\nimport SCons.compat\nimport SCons.SConsign\n\n\ndef my_whichdb(filename):\n    if filename[-7:] == \".dblite\":\n        return \"SCons.dblite\"\n    try:\n        with open(filename + \".dblite\", \"rb\"):\n            return \"SCons.dblite\"\n    except IOError:\n        pass\n    return whichdb(filename)\n\n\ndef my_import(mname):\n    import imp\n\n    if '.' in mname:\n        i = mname.rfind('.')\n        parent = my_import(mname[:i])\n        fp, pathname, description = imp.find_module(mname[i+1:],\n                                                    parent.__path__)\n    else:\n        fp, pathname, description = imp.find_module(mname)\n    return imp.load_module(mname, fp, pathname, description)\n\n\nclass Flagger:\n    default_value = 1\n\n    def __setitem__(self, item, value):\n        self.__dict__[item] = value\n        self.default_value = 0\n\n    def __getitem__(self, item):\n        return self.__dict__.get(item, self.default_value)\n\n\nDo_Call = None\nPrint_Directories = []\nPrint_Entries = []\nPrint_Flags = Flagger()\nVerbose = 0\nReadable = 0\nWarns = 0\n\n\ndef default_mapper(entry, name):\n    \"\"\"\n    Stringify an entry that doesn't have an explicit mapping.\n\n    Args:\n        entry:  entry\n        name: field name\n\n    Returns: str\n\n    \"\"\"\n    try:\n        val = eval(\"entry.\" + name)\n    except AttributeError:\n        val = None\n    return str(val)\n\n\ndef map_action(entry, _):\n    \"\"\"\n    Stringify an action entry and signature.\n\n    Args:\n        entry: action entry\n        second argument is not used\n\n    Returns: str\n\n    \"\"\"\n    try:\n        bact = entry.bact\n        bactsig = entry.bactsig\n    except AttributeError:\n        return None\n    return '%s [%s]' % (bactsig, bact)\n\n\ndef map_timestamp(entry, _):\n    \"\"\"\n    Stringify a timestamp entry.\n\n    Args:\n        entry: timestamp entry\n        second argument is not used\n\n    Returns: str\n\n    \"\"\"\n    try:\n        timestamp = entry.timestamp\n    except AttributeError:\n        timestamp = None\n    if Readable and timestamp:\n        return \"'\" + time.ctime(timestamp) + \"'\"\n    else:\n        return str(timestamp)\n\n\ndef map_bkids(entry, _):\n    \"\"\"\n    Stringify an implicit entry.\n\n    Args:\n        entry:\n        second argument is not used\n\n    Returns: str\n\n    \"\"\"\n    try:\n        bkids = entry.bsources + entry.bdepends + entry.bimplicit\n        bkidsigs = entry.bsourcesigs + entry.bdependsigs + entry.bimplicitsigs\n    except AttributeError:\n        return None\n\n    if len(bkids) != len(bkidsigs):\n        global Warns\n        Warns += 1\n        # add warning to result rather than direct print so it will line up\n        msg = \"Warning: missing information, {} ids but {} sigs\"\n        result = [msg.format(len(bkids), len(bkidsigs))]\n    else:\n        result = []\n    result += [nodeinfo_string(bkid, bkidsig, \"        \")\n               for bkid, bkidsig in zip(bkids, bkidsigs)]\n    if not result:\n        return None\n    return \"\\n        \".join(result)\n\n\nmap_field = {\n    'action'    : map_action,\n    'timestamp' : map_timestamp,\n    'bkids'     : map_bkids,\n}\n\nmap_name = {\n    'implicit'  : 'bkids',\n}\n\n\ndef field(name, entry, verbose=Verbose):\n    if not Print_Flags[name]:\n        return None\n    fieldname = map_name.get(name, name)\n    mapper = map_field.get(fieldname, default_mapper)\n    val = mapper(entry, name)\n    if verbose:\n        val = name + \": \" + val\n    return val\n\n\ndef nodeinfo_raw(name, ninfo, prefix=\"\"):\n    \"\"\"\n    This just formats the dictionary, which we would normally use str()\n    to do, except that we want the keys sorted for deterministic output.\n    \"\"\"\n    d = ninfo.__getstate__()\n    try:\n        keys = ninfo.field_list + ['_version_id']\n    except AttributeError:\n        keys = sorted(d.keys())\n    values = []\n    for key in keys:\n        values.append('%s: %s' % (repr(key), repr(d.get(key))))\n    if '\\n' in name:\n        name = repr(name)\n    return name + ': {' + ', '.join(values) + '}'\n\n\ndef nodeinfo_cooked(name, ninfo, prefix=\"\"):\n    try:\n        field_list = ninfo.field_list\n    except AttributeError:\n        field_list = []\n    if '\\n' in name:\n        name = repr(name)\n    outlist = [name + ':'] + [\n        f for f in [field(x, ninfo, Verbose) for x in field_list] if f\n    ]\n    if Verbose:\n        sep = '\\n    ' + prefix\n    else:\n        sep = ' '\n    return sep.join(outlist)\n\n\nnodeinfo_string = nodeinfo_cooked\n\n\ndef printfield(name, entry, prefix=\"\"):\n    outlist = field(\"implicit\", entry, 0)\n    if outlist:\n        if Verbose:\n            print(\"    implicit:\")\n        print(\"        \" + outlist)\n    outact = field(\"action\", entry, 0)\n    if outact:\n        if Verbose:\n            print(\"    action: \" + outact)\n        else:\n            print(\"        \" + outact)\n\n\ndef printentries(entries, location):\n    if Print_Entries:\n        for name in Print_Entries:\n            try:\n                entry = entries[name]\n            except KeyError:\n                err = \"sconsign: no entry `%s' in `%s'\\n\" % (name, location)\n                sys.stderr.write(err)\n            else:\n                try:\n                    ninfo = entry.ninfo\n                except AttributeError:\n                    print(name + \":\")\n                else:\n                    print(nodeinfo_string(name, entry.ninfo))\n                printfield(name, entry.binfo)\n    else:\n        for name in sorted(entries.keys()):\n            entry = entries[name]\n            try:\n                entry.ninfo\n            except AttributeError:\n                print(name + \":\")\n            else:\n                print(nodeinfo_string(name, entry.ninfo))\n            printfield(name, entry.binfo)\n\n\nclass Do_SConsignDB:\n    def __init__(self, dbm_name, dbm):\n        self.dbm_name = dbm_name\n        self.dbm = dbm\n\n    def __call__(self, fname):\n        # The *dbm modules stick their own file suffixes on the names\n        # that are passed in.  This causes us to jump through some\n        # hoops here.\n        try:\n            # Try opening the specified file name.  Example:\n            #   SPECIFIED                  OPENED BY self.dbm.open()\n            #   ---------                  -------------------------\n            #   .sconsign               => .sconsign.dblite\n            #   .sconsign.dblite        => .sconsign.dblite.dblite\n            db = self.dbm.open(fname, \"r\")\n        except (IOError, OSError) as e:\n            print_e = e\n            try:\n                # That didn't work, so try opening the base name,\n                # so that if they actually passed in 'sconsign.dblite'\n                # (for example), the dbm module will put the suffix back\n                # on for us and open it anyway.\n                db = self.dbm.open(os.path.splitext(fname)[0], \"r\")\n            except (IOError, OSError):\n                # That didn't work either.  See if the file name\n                # they specified even exists (independent of the dbm\n                # suffix-mangling).\n                try:\n                    with open(fname, \"rb\"):\n                        pass  # this is a touch only, we don't use it here.\n                except (IOError, OSError) as e:\n                    # Nope, that file doesn't even exist, so report that\n                    # fact back.\n                    print_e = e\n                sys.stderr.write(\"sconsign: %s\\n\" % print_e)\n                return\n        except KeyboardInterrupt:\n            raise\n        except pickle.UnpicklingError:\n            sys.stderr.write(\"sconsign: ignoring invalid `%s' file `%s'\\n\"\n                             % (self.dbm_name, fname))\n            return\n        except Exception as e:\n            sys.stderr.write(\"sconsign: ignoring invalid `%s' file `%s': %s\\n\"\n                             % (self.dbm_name, fname, e))\n            exc_type, _, _ = sys.exc_info()\n            if exc_type.__name__ == \"ValueError\":\n                sys.stderr.write(\"unrecognized pickle protocol.\\n\")\n            return\n\n        if Print_Directories:\n            for dir in Print_Directories:\n                try:\n                    val = db[dir]\n                except KeyError:\n                    err = \"sconsign: no dir `%s' in `%s'\\n\" % (dir, args[0])\n                    sys.stderr.write(err)\n                else:\n                    self.printentries(dir, val)\n        else:\n            for dir in sorted(db.keys()):\n                self.printentries(dir, db[dir])\n\n    @staticmethod\n    def printentries(dir, val):\n        try:\n            print('=== ' + dir + ':')\n        except TypeError:\n            print('=== ' + dir.decode() + ':')\n        printentries(pickle.loads(val), dir)\n\n\ndef Do_SConsignDir(name):\n    try:\n        with open(name, 'rb') as fp:\n            try:\n                sconsign = SCons.SConsign.Dir(fp)\n            except KeyboardInterrupt:\n                raise\n            except pickle.UnpicklingError:\n                err = \"sconsign: ignoring invalid .sconsign file `%s'\\n\" % name\n                sys.stderr.write(err)\n                return\n            except Exception as e:\n                err = \"sconsign: ignoring invalid .sconsign file `%s': %s\\n\" % (name, e)\n                sys.stderr.write(err)\n                return\n            printentries(sconsign.entries, args[0])\n    except (IOError, OSError) as e:\n        sys.stderr.write(\"sconsign: %s\\n\" % e)\n        return\n\n\n##############################################################################\ndef main():\n    global  Do_Call\n    global nodeinfo_string\n    global args\n    global Verbose\n    global Readable\n\n    helpstr = \"\"\"\\\n    Usage: sconsign [OPTIONS] [FILE ...]\n    Options:\n      -a, --act, --action         Print build action information.\n      -c, --csig                  Print content signature information.\n      -d DIR, --dir=DIR           Print only info about DIR.\n      -e ENTRY, --entry=ENTRY     Print only info about ENTRY.\n      -f FORMAT, --format=FORMAT  FILE is in the specified FORMAT.\n      -h, --help                  Print this message and exit.\n      -i, --implicit              Print implicit dependency information.\n      -r, --readable              Print timestamps in human-readable form.\n      --raw                       Print raw Python object representations.\n      -s, --size                  Print file sizes.\n      -t, --timestamp             Print timestamp information.\n      -v, --verbose               Verbose, describe each field.\n    \"\"\"\n\n    try:\n        opts, args = getopt.getopt(sys.argv[1:], \"acd:e:f:hirstv\",\n                                   ['act', 'action',\n                                    'csig', 'dir=', 'entry=',\n                                    'format=', 'help', 'implicit',\n                                    'raw', 'readable',\n                                    'size', 'timestamp', 'verbose'])\n    except getopt.GetoptError as err:\n        sys.stderr.write(str(err) + '\\n')\n        print(helpstr)\n        sys.exit(2)\n\n    for o, a in opts:\n        if o in ('-a', '--act', '--action'):\n            Print_Flags['action'] = 1\n        elif o in ('-c', '--csig'):\n            Print_Flags['csig'] = 1\n        elif o in ('-d', '--dir'):\n            Print_Directories.append(a)\n        elif o in ('-e', '--entry'):\n            Print_Entries.append(a)\n        elif o in ('-f', '--format'):\n            # Try to map the given DB format to a known module\n            # name, that we can then try to import...\n            Module_Map = {'dblite': 'SCons.dblite', 'sconsign': None}\n            dbm_name = Module_Map.get(a, a)\n            if dbm_name:\n                try:\n                    if dbm_name != \"SCons.dblite\":\n                        dbm = my_import(dbm_name)\n                    else:\n                        import SCons.dblite\n\n                        dbm = SCons.dblite\n                        # Ensure that we don't ignore corrupt DB files,\n                        # this was handled by calling my_import('SCons.dblite')\n                        # again in earlier versions...\n                        SCons.dblite.IGNORE_CORRUPT_DBFILES = False\n                except ImportError:\n                    sys.stderr.write(\"sconsign: illegal file format `%s'\\n\" % a)\n                    print(helpstr)\n                    sys.exit(2)\n                Do_Call = Do_SConsignDB(a, dbm)\n            else:\n                Do_Call = Do_SConsignDir\n        elif o in ('-h', '--help'):\n            print(helpstr)\n            sys.exit(0)\n        elif o in ('-i', '--implicit'):\n            Print_Flags['implicit'] = 1\n        elif o in ('--raw',):\n            nodeinfo_string = nodeinfo_raw\n        elif o in ('-r', '--readable'):\n            Readable = 1\n        elif o in ('-s', '--size'):\n            Print_Flags['size'] = 1\n        elif o in ('-t', '--timestamp'):\n            Print_Flags['timestamp'] = 1\n        elif o in ('-v', '--verbose'):\n            Verbose = 1\n\n    if Do_Call:\n        for a in args:\n            Do_Call(a)\n    else:\n        if not args:\n            args = [\".sconsign.dblite\"]\n        for a in args:\n            dbm_name = my_whichdb(a)\n            if dbm_name:\n                Map_Module = {'SCons.dblite': 'dblite'}\n                if dbm_name != \"SCons.dblite\":\n                    dbm = my_import(dbm_name)\n                else:\n                    import SCons.dblite\n\n                    dbm = SCons.dblite\n                    # Ensure that we don't ignore corrupt DB files,\n                    # this was handled by calling my_import('SCons.dblite')\n                    # again in earlier versions...\n                    SCons.dblite.IGNORE_CORRUPT_DBFILES = False\n                Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a)\n            else:\n                Do_SConsignDir(a)\n\n        if Warns:\n            print(\"NOTE: there were %d warnings, please check output\" % Warns)\n\n\nif __name__ == \"__main__\":\n    main()\n    sys.exit(0)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Variable type for true/false Variables.\n\nUsage example::\n\n    opts = Variables()\n    opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))\n    ...\n    if env['embedded'] == 1:\n    ...\n\"\"\"\n\nfrom typing import Tuple, Callable\n\nimport SCons.Errors\n\n__all__ = ['BoolVariable',]\n\nTRUE_STRINGS = ('y', 'yes', 'true', 't', '1', 'on' , 'all')\nFALSE_STRINGS = ('n', 'no', 'false', 'f', '0', 'off', 'none')\n\n\ndef _text2bool(val) -> bool:\n    \"\"\"Converts strings to True/False.\n\n    If *val* looks like it expresses a bool-like value, based on\n    the :data:`TRUE_STRINGS` and :data:`FALSE_STRINGS` tuples,\n    return the appropriate value.\n\n    This is usable as a converter function for SCons Variables.\n\n    Raises:\n        ValueError: if the string cannot be converted.\n    \"\"\"\n\n    lval = val.lower()\n    if lval in TRUE_STRINGS:\n        return True\n    if lval in FALSE_STRINGS:\n        return False\n    raise ValueError(\"Invalid value for boolean option: %s\" % val)\n\n\ndef _validator(key, val, env) -> None:\n    \"\"\"Validates the given value to be either true or false.\n\n    This is usable as a validator function for SCons Variables.\n\n    Raises:\n        KeyError: if key is not set in env\n        UserError: if key does not validate.\n    \"\"\"\n    if not env[key] in (True, False):\n        raise SCons.Errors.UserError(\n            'Invalid value for boolean option %s: %s' % (key, env[key])\n        )\n\n\ndef BoolVariable(key, help, default) -> Tuple[str, str, str, Callable, Callable]:\n    \"\"\"Return a tuple describing a boolean SCons Variable.\n\n    The input parameters describe a boolean option. Returns a tuple\n    including the correct converter and validator.\n    The *help* text will have ``(yes|no)`` automatically appended to show the\n    valid values. The result is usable as input to :meth:`Add`.\n    \"\"\"\n    help = '%s (yes|no)' % help\n    return (key, help, default, _validator, _text2bool)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Variable type for enumeration Variables.\n\nEnumeration variables allow selection of one from a specified set of values.\n\nUsage example::\n\n    opts = Variables()\n    opts.Add(\n        EnumVariable(\n            'debug',\n            help='debug output and symbols',\n            default='no',\n            allowed_values=('yes', 'no', 'full'),\n            map={},\n            ignorecase=2,\n        )\n    )\n    ...\n    if env['debug'] == 'full':\n    ...\n\"\"\"\n\nfrom typing import Tuple, Callable\n\nimport SCons.Errors\n\n__all__ = ['EnumVariable',]\n\n\ndef _validator(key, val, env, vals) -> None:\n    if val not in vals:\n        raise SCons.Errors.UserError(\n            'Invalid value for option %s: %s.  Valid values are: %s' % (key, val, vals))\n\n\ndef EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0) -> Tuple[str, str, str, Callable, Callable]:\n    \"\"\"Return a tuple describing an enumaration SCons Variable.\n\n    The input parameters describe an option with only certain values\n    allowed. Returns A tuple including an appropriate converter and\n    validator. The result is usable as input to :meth:`Add`.\n\n    *key* and *default* are passed directly on to :meth:`Add`.\n\n    *help* is the descriptive part of the help text,\n    and will have the allowed values automatically appended.\n\n    *allowed_values* is a list of strings, which are the allowed values\n    for this option.\n\n    The *map*-dictionary may be used for converting the input value\n    into canonical values (e.g. for aliases).\n\n    The value of *ignorecase* defines the behaviour of the validator:\n\n        * 0: the validator/converter are case-sensitive.\n        * 1: the validator/converter are case-insensitive.\n        * 2: the validator/converter is case-insensitive and the\n          converted value will always be lower-case.\n\n    The *validator* tests whether the value is in the list of allowed values.\n    The *converter* converts input values according to the given\n    *map*-dictionary (unmapped input values are returned unchanged).\n    \"\"\"\n\n    help = '%s (%s)' % (help, '|'.join(allowed_values))\n    # define validator\n    if ignorecase:\n        validator = lambda key, val, env: \\\n                    _validator(key, val.lower(), env, allowed_values)\n    else:\n        validator = lambda key, val, env: \\\n                    _validator(key, val, env, allowed_values)\n    # define converter\n    if ignorecase == 2:\n        converter = lambda val: map.get(val.lower(), val).lower()\n    elif ignorecase == 1:\n        converter = lambda val: map.get(val.lower(), val)\n    else:\n        converter = lambda val: map.get(val, val)\n    return (key, help, default, validator, converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Variable type for list Variables.\n\nA 'list' option may either be 'all', 'none' or a list of names\nseparated by comma. After the option has been processed, the option\nvalue holds either the named list elements, all list elements or no\nlist elements at all.\n\nUsage example::\n\n    list_of_libs = Split('x11 gl qt ical')\n\n    opts = Variables()\n    opts.Add(\n        ListVariable(\n            'shared',\n            help='libraries to build as shared libraries',\n            default='all',\n            elems=list_of_libs,\n        )\n    )\n    ...\n    for lib in list_of_libs:\n        if lib in env['shared']:\n            env.SharedObject(...)\n        else:\n            env.Object(...)\n\"\"\"\n\n# Known Bug: This should behave like a Set-Type, but does not really,\n# since elements can occur twice.\n\nimport collections\nfrom typing import Tuple, Callable\n\nimport SCons.Util\n\n__all__ = ['ListVariable',]\n\n\nclass _ListVariable(collections.UserList):\n    def __init__(self, initlist=None, allowedElems=None):\n        if initlist is None:\n            initlist = []\n        if allowedElems is None:\n            allowedElems = []\n        super().__init__([_f for _f in initlist if _f])\n        self.allowedElems = sorted(allowedElems)\n\n    def __cmp__(self, other):\n        return NotImplemented\n\n    def __eq__(self, other):\n        return NotImplemented\n\n    def __ge__(self, other):\n        return NotImplemented\n\n    def __gt__(self, other):\n        return NotImplemented\n\n    def __le__(self, other):\n        return NotImplemented\n\n    def __lt__(self, other):\n        return NotImplemented\n\n    def __str__(self):\n        if not len(self):\n            return 'none'\n        self.data.sort()\n        if self.data == self.allowedElems:\n            return 'all'\n        else:\n            return ','.join(self)\n\n    def prepare_to_store(self):\n        return self.__str__()\n\ndef _converter(val, allowedElems, mapdict) -> _ListVariable:\n    \"\"\" \"\"\"\n    if val == 'none':\n        val = []\n    elif val == 'all':\n        val = allowedElems\n    else:\n        val = [_f for _f in val.split(',') if _f]\n        val = [mapdict.get(v, v) for v in val]\n        notAllowed = [v for v in val if v not in allowedElems]\n        if notAllowed:\n            raise ValueError(\n                \"Invalid value(s) for option: %s\" % ','.join(notAllowed)\n            )\n    return _ListVariable(val, allowedElems)\n\n\n# def _validator(key, val, env) -> None:\n#     \"\"\" \"\"\"\n#     # TODO: write validator for pgk list\n#     pass\n\n\ndef ListVariable(key, help, default, names, map={}) -> Tuple[str, str, str, None, Callable]:\n    \"\"\"Return a tuple describing a list SCons Variable.\n\n    The input parameters describe a 'list' option. Returns\n    a tuple including the correct converter and validator.\n    The result is usable for input to :meth:`Add`.\n\n    *help* will have text appended indicating the legal values\n    (not including any extra names from *map*).\n\n    *map* can be used to map alternative names to the ones in *names* -\n    that is, a form of alias.\n\n    A 'list' option may either be 'all', 'none' or a list of\n    names (separated by commas).\n    \"\"\"\n    names_str = 'allowed names: %s' % ' '.join(names)\n    if SCons.Util.is_List(default):\n        default = ','.join(default)\n    help = '\\n    '.join(\n        (help, '(all|none|comma-separated list of names)', names_str))\n    return (key, help, default, None, lambda val: _converter(val, names, map))\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Variable type for package Variables.\n\nTo be used whenever a 'package' may be enabled/disabled and the\npackage path may be specified.\n\nGiven these options ::\n\n   x11=no   (disables X11 support)\n   x11=yes  (will search for the package installation dir)\n   x11=/usr/local/X11 (will check this path for existence)\n\nCan be used as a replacement for autoconf's ``--with-xxx=yyy`` ::\n\n    opts = Variables()\n    opts.Add(\n        PackageVariable(\n            key='x11',\n            help='use X11 installed here (yes = search some places)',\n            default='yes'\n        )\n    )\n    ...\n    if env['x11'] == True:\n        dir = ...  # search X11 in some standard places ...\n        env['x11'] = dir\n    if env['x11']:\n        ...  # build with x11 ...\n\"\"\"\n\nfrom typing import Tuple, Callable\n\nimport SCons.Errors\n\n__all__ = ['PackageVariable',]\n\nENABLE_STRINGS = ('1', 'yes', 'true',  'on', 'enable', 'search')\nDISABLE_STRINGS = ('0', 'no',  'false', 'off', 'disable')\n\ndef _converter(val):\n    \"\"\" \"\"\"\n    lval = val.lower()\n    if lval in ENABLE_STRINGS:\n        return True\n    if lval in DISABLE_STRINGS:\n        return False\n    return val\n\n\ndef _validator(key, val, env, searchfunc) -> None:\n    \"\"\" \"\"\"\n    # NB: searchfunc is currently undocumented and unsupported\n    # TODO write validator, check for path\n    import os\n\n    if env[key] is True:\n        if searchfunc:\n            env[key] = searchfunc(key, val)\n    elif env[key] and not os.path.exists(val):\n        raise SCons.Errors.UserError(\n            'Path does not exist for option %s: %s' % (key, val))\n\n\ndef PackageVariable(key, help, default, searchfunc=None) -> Tuple[str, str, str, Callable, Callable]:\n    \"\"\"Return a tuple describing a package list SCons Variable.\n\n    The input parameters describe a 'package list' option. Returns\n    a tuple including the correct converter and validator appended.\n    The result is usable as input to :meth:`Add` .\n\n    A 'package list' option may either be 'all', 'none' or a pathname\n    string. This information is appended to *help*.\n    \"\"\"\n    # NB: searchfunc is currently undocumented and unsupported\n    help = '\\n    '.join(\n        (help, '( yes | no | /path/to/%s )' % key))\n    return (key, help, default,\n            lambda k, v, e: _validator(k, v, e, searchfunc),\n            _converter)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Variable type for path Variables.\n\nTo be used whenever a user-specified path override setting should be allowed.\n\nArguments to PathVariable are:\n  * *key* - name of this option on the command line (e.g. \"prefix\")\n  * *help* - help string for option\n  * *default* - default value for this option\n  * *validator* - [optional] validator for option value.  Predefined are:\n\n    * *PathAccept* - accepts any path setting; no validation\n    * *PathIsDir* - path must be an existing directory\n    * *PathIsDirCreate* - path must be a dir; will create\n    * *PathIsFile* - path must be a file\n    * *PathExists* - path must exist (any type) [default]\n\n  The *validator* is a function that is called and which should return\n  True or False to indicate if the path is valid.  The arguments\n  to the validator function are: (*key*, *val*, *env*).  *key* is the\n  name of the option, *val* is the path specified for the option,\n  and *env* is the environment to which the Options have been added.\n\nUsage example::\n\n    opts = Variables()\n    opts.Add(\n        PathVariable(\n            'qtdir',\n            help='where the root of Qt is installed',\n            default=qtdir,\n            validator=PathIsDir,\n        )\n    )\n    opts.Add(\n        PathVariable(\n            'qt_includes',\n            help='where the Qt includes are installed',\n            default='$qtdir/includes',\n            validator=PathIsDirCreate,\n        )\n    )\n    opts.Add(\n        PathVariable(\n            'qt_libraries',\n            help='where the Qt library is installed',\n            default='$qtdir/lib',\n        )\n    )\n\"\"\"\n\n\nimport os\nimport os.path\nfrom typing import Tuple, Callable\n\nimport SCons.Errors\n\n__all__ = ['PathVariable',]\n\nclass _PathVariableClass:\n\n    @staticmethod\n    def PathAccept(key, val, env) -> None:\n        \"\"\"Accepts any path, no checking done.\"\"\"\n        pass\n\n    @staticmethod\n    def PathIsDir(key, val, env) -> None:\n        \"\"\"Validator to check if Path is a directory.\"\"\"\n        if not os.path.isdir(val):\n            if os.path.isfile(val):\n                m = 'Directory path for option %s is a file: %s'\n            else:\n                m = 'Directory path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    @staticmethod\n    def PathIsDirCreate(key, val, env) -> None:\n        \"\"\"Validator to check if Path is a directory,\n           creating it if it does not exist.\"\"\"\n        try:\n            os.makedirs(val, exist_ok=True)\n        except FileExistsError:\n            m = 'Path for option %s is a file, not a directory: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n        except PermissionError:\n            m = 'Path for option %s could not be created: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    @staticmethod\n    def PathIsFile(key, val, env) -> None:\n        \"\"\"Validator to check if Path is a file\"\"\"\n        if not os.path.isfile(val):\n            if os.path.isdir(val):\n                m = 'File path for option %s is a directory: %s'\n            else:\n                m = 'File path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    @staticmethod\n    def PathExists(key, val, env) -> None:\n        \"\"\"Validator to check if Path exists\"\"\"\n        if not os.path.exists(val):\n            m = 'Path for option %s does not exist: %s'\n            raise SCons.Errors.UserError(m % (key, val))\n\n    def __call__(self, key, help, default, validator=None) -> Tuple[str, str, str, Callable, None]:\n        \"\"\"Return a tuple describing a path list SCons Variable.\n\n        The input parameters describe a 'path list' option. Returns\n        a tuple with the correct converter and validator appended. The\n        result is usable for input to :meth:`Add`.\n\n        The *default* option specifies the default path to use if the\n        user does not specify an override with this option.\n\n        *validator* is a validator, see this file for examples\n        \"\"\"\n        if validator is None:\n            validator = self.PathExists\n\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            helpmsg = '%s ( /path/to/%s )' % (help, key[0])\n        else:\n            helpmsg = '%s ( /path/to/%s )' % (help, key)\n        return (key, helpmsg, default, validator, None)\n\n\nPathVariable = _PathVariableClass()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Add user-friendly customizable variables to an SCons build. \"\"\"\n\nimport os.path\nimport sys\nfrom functools import cmp_to_key\n\nimport SCons.Environment\nimport SCons.Errors\nimport SCons.Util\nimport SCons.Warnings\n\nfrom .BoolVariable import BoolVariable  # okay\nfrom .EnumVariable import EnumVariable  # okay\nfrom .ListVariable import ListVariable  # naja\nfrom .PackageVariable import PackageVariable # naja\nfrom .PathVariable import PathVariable # okay\n\n\nclass Variables:\n    \"\"\"\n    Holds all the options, updates the environment with the variables,\n    and renders the help text.\n\n    If *is_global* is true, this is a singleton, create only once.\n\n    Args:\n      files (optional): List of option configuration files to load\n        (backward compatibility). If a single string is passed it is\n        automatically placed in a file list (Default value = None)\n      args (optional): dictionary to override values set from *files*.\n        (Default value = None)\n      is_global (optional): global instance? (Default value = True)\n\n    \"\"\"\n    instance = None\n\n    def __init__(self, files=None, args=None, is_global=True):\n        if args is None:\n            args = {}\n        self.options = []\n        self.args = args\n        if not SCons.Util.is_List(files):\n            if files:\n                files = [files,]\n            else:\n                files = []\n        self.files = files\n        self.unknown = {}\n\n        # create the singleton instance\n        if is_global:\n            self = Variables.instance\n\n            if not Variables.instance:\n                Variables.instance=self\n\n    def _do_add(self, key, help=\"\", default=None, validator=None, converter=None, **kwargs) -> None:\n        class Variable:\n            pass\n\n        option = Variable()\n\n        # If we get a list or a tuple, we take the first element as the\n        # option key and store the remaining in aliases.\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            option.key = key[0]\n            option.aliases = list(key[1:])\n        else:\n            option.key = key\n            # TODO: normalize to not include key in aliases. Currently breaks tests.\n            option.aliases = [key,]\n        if not SCons.Environment.is_valid_construction_var(option.key):\n            raise SCons.Errors.UserError(\"Illegal Variables key `%s'\" % str(option.key))\n        option.help = help\n        option.default = default\n        option.validator = validator\n        option.converter = converter\n\n        self.options.append(option)\n\n        # options might be added after the 'unknown' dict has been set up,\n        # so we remove the key and all its aliases from that dict\n        for alias in option.aliases + [option.key,]:\n            if alias in self.unknown:\n                del self.unknown[alias]\n\n    def keys(self) -> list:\n        \"\"\"Returns the keywords for the options.\"\"\"\n        return [o.key for o in self.options]\n\n    def Add(self, key, *args, **kwargs) -> None:\n        r\"\"\" Add an option.\n\n        Args:\n          key: the name of the variable, or a 5-tuple (or list).\n            If a tuple, and there are no additional arguments,\n            the tuple is unpacked into help, default, validator, converter.\n            If there are additional arguments, the first word of the tuple\n            is taken as the key, and the remainder as aliases.\n          \\*args: optional positional arguments\n            help: optional help text for the options (Default value = \"\")\n            default: optional default value for option (Default value = None)\n            validator: optional function called to validate the option's value\n              (Default value = None)\n            converter: optional function to be called to convert the option's\n              value before putting it in the environment. (Default value = None)\n          \\*\\*kwargs: keyword args, can be the arguments from \\*args or\n            arbitrary kwargs used by a variable itself\n\n        \"\"\"\n        if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key):\n            if not (len(args) or len(kwargs)):\n                return self._do_add(*key)\n\n        return self._do_add(key, *args, **kwargs)\n\n    def AddVariables(self, *optlist) -> None:\n        \"\"\" Add a list of options.\n\n        Each list element is a tuple/list of arguments to be passed on\n        to the underlying method for adding options.\n\n        Example::\n\n            opt.AddVariables(\n                ('debug', '', 0),\n                ('CC', 'The C compiler'),\n                ('VALIDATE', 'An option for testing validation', 'notset', validator, None),\n            )\n\n        \"\"\"\n\n        for o in optlist:\n            self._do_add(*o)\n\n    def Update(self, env, args=None) -> None:\n        \"\"\" Update an environment with the option variables.\n\n        Args:\n            env: the environment to update.\n            args: [optional] a dictionary of keys and values to update\n                in *env*. If omitted, uses the variables from the commandline.\n        \"\"\"\n\n        values = {}\n\n        # first set the defaults:\n        for option in self.options:\n            if option.default is not None:\n                values[option.key] = option.default\n\n        # next set the value specified in the options file\n        for filename in self.files:\n            if os.path.exists(filename):\n                dir = os.path.split(os.path.abspath(filename))[0]\n                if dir:\n                    sys.path.insert(0, dir)\n                try:\n                    values['__name__'] = filename\n                    with open(filename, 'r') as f:\n                        contents = f.read()\n                    exec(contents, {}, values)\n                finally:\n                    if dir:\n                        del sys.path[0]\n                    del values['__name__']\n\n        # set the values specified on the command line\n        if args is None:\n            args = self.args\n\n        for arg, value in args.items():\n            added = False\n            for option in self.options:\n                if arg in option.aliases + [option.key,]:\n                    values[option.key] = value\n                    added = True\n            if not added:\n                self.unknown[arg] = value\n\n        # put the variables in the environment:\n        # (don't copy over variables that are not declared as options)\n        for option in self.options:\n            try:\n                env[option.key] = values[option.key]\n            except KeyError:\n                pass\n\n        # apply converters\n        for option in self.options:\n            if option.converter and option.key in values:\n                value = env.subst('${%s}'%option.key)\n                try:\n                    try:\n                        env[option.key] = option.converter(value)\n                    except TypeError:\n                        env[option.key] = option.converter(value, env)\n                except ValueError as x:\n                    raise SCons.Errors.UserError('Error converting option: %s\\n%s'%(option.key, x))\n\n\n        # apply validators\n        for option in self.options:\n            if option.validator and option.key in values:\n                option.validator(option.key, env.subst('${%s}'%option.key), env)\n\n    def UnknownVariables(self) -> dict:\n        \"\"\" Returns unknown variables.\n\n        Identifies options that were not known, declared options in this object.\n        \"\"\"\n        return self.unknown\n\n    def Save(self, filename, env) -> None:\n        \"\"\" Save the options to a file.\n\n        Saves all the options which have non-default settings\n        to the given file as Python expressions.  This file can\n        then be used to load the options for a subsequent run.\n        This can be used to create an option cache file.\n\n        Args:\n            filename: Name of the file to save into\n            env: the environment get the option values from\n        \"\"\"\n\n        # Create the file and write out the header\n        try:\n            with open(filename, 'w') as fh:\n                # Make an assignment in the file for each option\n                # within the environment that was assigned a value\n                # other than the default. We don't want to save the\n                # ones set to default: in case the SConscript settings\n                # change you would then pick up old defaults.\n                for option in self.options:\n                    try:\n                        value = env[option.key]\n                        try:\n                            prepare = value.prepare_to_store\n                        except AttributeError:\n                            try:\n                                eval(repr(value))\n                            except KeyboardInterrupt:\n                                raise\n                            except:\n                                # Convert stuff that has a repr() that\n                                # cannot be evaluated into a string\n                                value = SCons.Util.to_String(value)\n                        else:\n                            value = prepare()\n\n                        defaultVal = env.subst(SCons.Util.to_String(option.default))\n                        if option.converter:\n                            try:\n                                defaultVal = option.converter(defaultVal)\n                            except TypeError:\n                                defaultVal = option.converter(defaultVal, env)\n\n                        if str(env.subst('${%s}' % option.key)) != str(defaultVal):\n                            fh.write('%s = %s\\n' % (option.key, repr(value)))\n                    except KeyError:\n                        pass\n        except IOError as x:\n            raise SCons.Errors.UserError('Error writing options to file: %s\\n%s' % (filename, x))\n\n    def GenerateHelpText(self, env, sort=None) -> str:\n        \"\"\" Generate the help text for the options.\n\n        Args:\n            env: an environment that is used to get the current values\n                of the options.\n            cmp: Either a comparison function used for sorting\n                (must take two arguments and return -1, 0 or 1)\n                or a boolean to indicate if it should be sorted.\n        \"\"\"\n\n        if callable(sort):\n            options = sorted(self.options, key=cmp_to_key(lambda x, y: sort(x.key, y.key)))\n        elif sort is True:\n            options = sorted(self.options, key=lambda x: x.key)\n        else:\n            options = self.options\n\n        def format_opt(opt, self=self, env=env) -> str:\n            if opt.key in env:\n                actual = env.subst('${%s}' % opt.key)\n            else:\n                actual = None\n            return self.FormatVariableHelpText(env, opt.key, opt.help, opt.default, actual, opt.aliases)\n\n        lines = [_f for _f in map(format_opt, options) if _f]\n        return ''.join(lines)\n\n    fmt = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n'\n    aliasfmt = '\\n%s: %s\\n    default: %s\\n    actual: %s\\n    aliases: %s\\n'\n\n    def FormatVariableHelpText(self, env, key, help, default, actual, aliases=None) -> str:\n        if aliases is None:\n            aliases = []\n        # Don't display the key name itself as an alias.\n        aliases = [a for a in aliases if a != key]\n        if aliases:\n            return self.aliasfmt % (key, help, default, actual, aliases)\n        else:\n            return self.fmt % (key, help, default, actual)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"The SCons warnings framework.\"\"\"\n\nimport sys\n\nimport SCons.Errors\n\nclass SConsWarning(SCons.Errors.UserError):\n    pass\n\nclass WarningOnByDefault(SConsWarning):\n    pass\n\n\n# NOTE:  If you add a new warning class, add it to the man page, too!\n# Not all warnings are defined here, some are defined in the location of use\n\nclass TargetNotBuiltWarning(SConsWarning): # Should go to OnByDefault\n    pass\n\nclass CacheVersionWarning(WarningOnByDefault):\n    pass\n\nclass CacheWriteErrorWarning(SConsWarning):\n    pass\n\nclass CorruptSConsignWarning(WarningOnByDefault):\n    pass\n\nclass DependencyWarning(SConsWarning):\n    pass\n\nclass DevelopmentVersionWarning(WarningOnByDefault):\n    pass\n\nclass DuplicateEnvironmentWarning(WarningOnByDefault):\n    pass\n\nclass FutureReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass LinkWarning(WarningOnByDefault):\n    pass\n\nclass MisleadingKeywordsWarning(WarningOnByDefault):\n    pass\n\nclass MissingSConscriptWarning(WarningOnByDefault):\n    pass\n\nclass NoObjectCountWarning(WarningOnByDefault):\n    pass\n\nclass NoParallelSupportWarning(WarningOnByDefault):\n    pass\n\nclass ReservedVariableWarning(WarningOnByDefault):\n    pass\n\nclass StackSizeWarning(WarningOnByDefault):\n    pass\n\nclass VisualCMissingWarning(WarningOnByDefault):\n    pass\n\n# Used when MSVC_VERSION and MSVS_VERSION do not point to the\n# same version (MSVS_VERSION is deprecated)\nclass VisualVersionMismatch(WarningOnByDefault):\n    pass\n\nclass VisualStudioMissingWarning(SConsWarning):\n    pass\n\nclass FortranCxxMixWarning(LinkWarning):\n    pass\n\n\n# Deprecation warnings\n\nclass FutureDeprecatedWarning(SConsWarning):\n    pass\n\nclass DeprecatedWarning(SConsWarning):\n    pass\n\nclass MandatoryDeprecatedWarning(DeprecatedWarning):\n    pass\n\n\n# Special case; base always stays DeprecatedWarning\nclass PythonVersionWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedSourceCodeWarning(FutureDeprecatedWarning):\n    pass\n\nclass TaskmasterNeedsExecuteWarning(DeprecatedWarning):\n    pass\n\nclass DeprecatedOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning):\n    pass\n\nclass DeprecatedMissingSConscriptWarning(DeprecatedWarning):\n    pass\n\nclass ToolQtDeprecatedWarning(FutureDeprecatedWarning):\n    pass\n\n# The below is a list of 2-tuples.  The first element is a class object.\n# The second element is true if that class is enabled, false if it is disabled.\n_enabled = []\n\n# If set, raise the warning as an exception\n_warningAsException = False\n\n# If not None, a function to call with the warning\n_warningOut = None\n\ndef suppressWarningClass(clazz):\n    \"\"\"Suppresses all warnings of type clazz or derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, False))\n\ndef enableWarningClass(clazz):\n    \"\"\"Enables all warnings of type clazz or derived from clazz.\"\"\"\n    _enabled.insert(0, (clazz, True))\n\ndef warningAsException(flag=True):\n    \"\"\"Set global _warningAsExeption flag.\n\n    Args:\n        flag: value to set warnings-as-exceptions to [default: True]\n\n    Returns:\n        The previous value.\n    \"\"\"\n    global _warningAsException\n    old = _warningAsException\n    _warningAsException = flag\n    return old\n\ndef warn(clazz, *args):\n    \"\"\"Issue a warning, accounting for SCons rules.\n\n    Check if warnings for this class are enabled.\n    If warnings are treated as exceptions, raise exception.\n    Use the global warning-emitter _warningOut, which allows selecting\n    different ways of presenting a traceback (see Script/Main.py)\n    \"\"\"\n    warning = clazz(args)\n    for cls, flag in _enabled:\n        if isinstance(warning, cls):\n            if flag:\n                if _warningAsException:\n                    raise warning\n\n                if _warningOut:\n                    _warningOut(warning)\n            break\n\ndef process_warn_strings(arguments):\n    \"\"\"Process requests to enable/disable warnings.\n\n    The requests are strings passed to the --warn option or the\n    SetOption('warn') function.\n\n    An argument to this option should be of the form \"warning-class\"\n    or \"no-warning-class\".  The warning class is munged and has\n    the suffix \"Warning\" added in order to get an actual class name\n    from the classes above, which we need to pass to the\n    {enable,disable}WarningClass() functions.\n\n    For example, \"deprecated\" will enable the DeprecatedWarning class.\n    \"no-dependency\" will disable the DependencyWarning class.\n\n    As a special case, --warn=all and --warn=no-all will enable or\n    disable (respectively) the base class of all SCons warnings.\n    \"\"\"\n\n    def _classmunge(s):\n        \"\"\"Convert a warning argument to SConsCase.\n\n        The result is CamelCase, except \"Scons\" is changed to \"SCons\"\n        \"\"\"\n        s = s.replace(\"-\", \" \").title().replace(\" \", \"\")\n        return s.replace(\"Scons\", \"SCons\")\n\n    for arg in arguments:\n        enable = True\n        if arg.startswith(\"no-\"):\n            enable = False\n            arg = arg[len(\"no-\") :]\n        if arg == 'all':\n            class_name = \"SConsWarning\"\n        else:\n            class_name = _classmunge(arg) + 'Warning'\n        try:\n            clazz = globals()[class_name]\n        except KeyError:\n            sys.stderr.write(\"No warning type: '%s'\\n\" % arg)\n        else:\n            if enable:\n                enableWarningClass(clazz)\n            elif issubclass(clazz, MandatoryDeprecatedWarning):\n                fmt = \"Can not disable mandataory warning: '%s'\\n\"\n                sys.stderr.write(fmt % arg)\n            else:\n                suppressWarningClass(clazz)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py",
    "content": "__version__=\"4.3.0\"\n__copyright__=\"Copyright (c) 2001 - 2021 The SCons Foundation\"\n__developer__=\"bdeegan\"\n__date__=\"Tue, 16 Nov 2021 19:09:21 +0000\"\n__buildsys__=\"octodog\"\n__revision__=\"559790274f66fa55251f5754de34820a29c7327a\"\n__build__=\"559790274f66fa55251f5754de34820a29c7327a\"\n# make sure compatibility is always in place\nimport SCons.compat # noqa"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons compatibility package for old Python versions\n\nThis subpackage holds modules that provide backwards-compatible\nimplementations of various things from newer Python versions\nthat we cannot count on because SCons still supported older Pythons.\n\nOther code will not generally reference things in this package through\nthe SCons.compat namespace.  The modules included here add things to\nthe builtins namespace or the global module list so that the rest\nof our code can use the objects and names imported here regardless of\nPython version. As a result, if this module is used, it should violate\nthe normal convention for imports (standard library imports first,\nthen program-specific imports, each ordered aplhabetically)\nand needs to be listed first.\n\nThe rest of the things here will be in individual compatibility modules\nthat are either: 1) suitably modified copies of the future modules that\nwe want to use; or 2) backwards compatible re-implementations of the\nspecific portions of a future module's API that we want to use.\n\nGENERAL WARNINGS:  Implementations of functions in the SCons.compat\nmodules are *NOT* guaranteed to be fully compliant with these functions in\nlater versions of Python.  We are only concerned with adding functionality\nthat we actually use in SCons, so be wary if you lift this code for\nother uses.  (That said, making these more nearly the same as later,\nofficial versions is still a desirable goal, we just don't need to be\nobsessive about it.)\n\nWe name the compatibility modules with an initial '_scons_' (for example,\n_scons_subprocess.py is our compatibility module for subprocess) so\nthat we can still try to import the real module name and fall back to\nour compatibility module if we get an ImportError.  The import_as()\nfunction defined below loads the module as the \"real\" name (without the\n'_scons'), after which all of the \"import {module}\" statements in the\nrest of our code will find our pre-loaded compatibility module.\n\"\"\"\n\nimport sys\nimport importlib\n\nPYPY = hasattr(sys, 'pypy_translation_info')\n\n\ndef rename_module(new, old):\n    \"\"\"\n    Attempt to import the old module and load it under the new name.\n    Used for purely cosmetic name changes in Python 3.x.\n    \"\"\"\n    try:\n        sys.modules[new] = importlib.import_module(old)\n        return True\n    except ImportError:\n        return False\n\n\n# Default pickle protocol. Higher protocols are more efficient/featured\n# but incompatible with older Python versions.\n# Negative numbers choose the highest available protocol.\n\n# Was pickle.HIGHEST_PROTOCOL\n# Changed to 4 so that python 3.8's not incompatible with previous versions\n# Python 3.8 introduced protocol 5 which is mainly an improvement for for out-of-band data buffers\nPICKLE_PROTOCOL = 4\n\n\nclass NoSlotsPyPy(type):\n    \"\"\" Metaclass for PyPy compatitbility.\n\n    PyPy does not work well with __slots__ and __class__ assignment.\n    \"\"\"\n\n    def __new__(meta, name, bases, dct):\n        if PYPY and '__slots__' in dct:\n            dct.pop('__slots__')\n        return super(NoSlotsPyPy, meta).__new__(meta, name, bases, dct)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"dbm compatibility module for Python versions that don't have dbm.\n\nThis does not not NOT (repeat, *NOT*) provide complete dbm functionality.\nIt's just a stub on which to hang just enough pieces of dbm functionality\nthat the whichdb.whichdb() implementstation in the various 2.X versions of\nPython won't blow up even if dbm wasn't compiled in.\n\"\"\"\n\nclass error(Exception):\n    pass\n\ndef open(*args, **kw):\n    raise error()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"Logic to replicate parts of pywin32 SCons uses.\"\"\"\n\n__all__ = ['get_current_process', 'get_memory_info', 'get_memory_usage', 'get_peak_memory_usage']\n\nimport ctypes\nfrom ctypes import wintypes\n\n#\n# From Activestate Recipe\n# https://code.activestate.com/recipes/578513-get-memory-usage-of-windows-processes-using-getpro/\n# MIT licensed\n#\nGetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess\nGetCurrentProcess.argtypes = []\nGetCurrentProcess.restype = wintypes.HANDLE\n\nSIZE_T = ctypes.c_size_t\n\n\nclass PROCESS_MEMORY_COUNTERS_EX(ctypes.Structure):\n    _fields_ = [\n        ('cb', wintypes.DWORD),\n        ('PageFaultCount', wintypes.DWORD),\n        ('PeakWorkingSetSize', SIZE_T),\n        ('WorkingSetSize', SIZE_T),\n        ('QuotaPeakPagedPoolUsage', SIZE_T),\n        ('QuotaPagedPoolUsage', SIZE_T),\n        ('QuotaPeakNonPagedPoolUsage', SIZE_T),\n        ('QuotaNonPagedPoolUsage', SIZE_T),\n        ('PagefileUsage', SIZE_T),\n        ('PeakPagefileUsage', SIZE_T),\n        ('PrivateUsage', SIZE_T),\n    ]\n\n\nGetProcessMemoryInfo = ctypes.windll.psapi.GetProcessMemoryInfo\nGetProcessMemoryInfo.argtypes = [\n    wintypes.HANDLE,\n    ctypes.POINTER(PROCESS_MEMORY_COUNTERS_EX),\n    wintypes.DWORD,\n]\nGetProcessMemoryInfo.restype = wintypes.BOOL\n\n\ndef get_current_process():\n    \"\"\"Return handle to current process.\"\"\"\n    return GetCurrentProcess()\n\n\ndef get_memory_info(process=None):\n    \"\"\"Return Win32 process memory counters structure as a dict.\"\"\"\n    if process is None:\n        process = get_current_process()\n    counters = PROCESS_MEMORY_COUNTERS_EX()\n    ret = GetProcessMemoryInfo(process, ctypes.byref(counters),\n                               ctypes.sizeof(counters))\n    if not ret:\n        raise ctypes.WinError()\n    info = dict((name, getattr(counters, name))\n                for name, _ in counters._fields_)\n    return info\n\n\ndef get_memory_usage(process=None):\n    \"\"\"Return this process's memory usage in bytes.\"\"\"\n    info = get_memory_info(process=process)\n    return info['PrivateUsage']\n\n\ndef get_peak_memory_usage(process=None):\n    \"\"\"Return this process's memory usage in bytes.\"\"\"\n    info = get_memory_info(process=process)\n    return info['PeakWorkingSetSize']\n\n\nif __name__ == '__main__':\n    import pprint\n\n    pprint.pprint(get_memory_info())\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"SCons C Pre-Processor module\"\"\"\n\nimport os\nimport re\n\n# First \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to turn the C preprocessor directives in a file's contents into\n# a list of tuples that we can process easily.\n#\n# A table of regular expressions that fetch the arguments from the rest of\n# a C preprocessor line.  Different directives have different arguments\n# that we want to fetch, using the regular expressions to which the lists\n# of preprocessor directives map.\ncpp_lines_dict = {\n    # Fetch the rest of a #if/#elif as one argument,\n    # with white space optional.\n    ('if', 'elif')      : r'\\s*(.+)',\n\n    # Fetch the rest of a #ifdef/#ifndef as one argument,\n    # separated from the keyword by white space.\n    ('ifdef', 'ifndef',): r'\\s+(.+)',\n\n    # Fetch the rest of a #import/#include/#include_next line as one\n    # argument, with white space optional.\n    ('import', 'include', 'include_next',)\n                        : r'\\s*(.+)',\n\n    # We don't care what comes after a #else or #endif line.\n    ('else', 'endif',)  : '',\n\n    # Fetch three arguments from a #define line:\n    #   1) The #defined keyword.\n    #   2) The optional parentheses and arguments (if it's a function-like\n    #      macro, '' if it's not).\n    #   3) The expansion value.\n    ('define',)         : r'\\s+([_A-Za-z][_A-Za-z0-9_]*)(\\([^)]*\\))?\\s*(.*)',\n\n    # Fetch the #undefed keyword from a #undef line.\n    ('undef',)          : r'\\s+([_A-Za-z][A-Za-z0-9_]*)',\n}\n\n# Create a table that maps each individual C preprocessor directive to\n# the corresponding compiled regular expression that fetches the arguments\n# we care about.\nTable = {}\nfor op_list, expr in cpp_lines_dict.items():\n    e = re.compile(expr)\n    for op in op_list:\n        Table[op] = e\ndel e\ndel op\ndel op_list\n\n# Create a list of the expressions we'll use to match all of the\n# preprocessor directives.  These are the same as the directives\n# themselves *except* that we must use a negative lookahead assertion\n# when matching \"if\" so it doesn't match the \"if\" in \"ifdef\" or \"ifndef\".\noverride = {\n    'if'                        : 'if(?!n?def)',\n}\nl = [override.get(x, x) for x in Table.keys()]\n\n\n# Turn the list of expressions into one big honkin' regular expression\n# that will match all the preprocessor lines at once.  This will return\n# a list of tuples, one for each preprocessor line.  The preprocessor\n# directive will be the first element in each tuple, and the rest of\n# the line will be the second element.\ne = r'^\\s*#\\s*(' + '|'.join(l) + ')(.*)$'\n\n# And last but not least, compile the expression.\nCPP_Expression = re.compile(e, re.M)\n\n# A list with RE to cleanup CPP Expressions (tuples)\n# We should remove all comments and carriage returns (\\r) before evaluating\nCPP_Expression_Cleaner_List = [\n    r\"/\\*.*\\*/\",\n    r\"/\\*.*\",\n    r\"//.*\",\n    r\"\\r\"\n]\nCPP_Expression_Cleaner_RE = re.compile(\n    r\"\\s*(\" + \"|\".join(CPP_Expression_Cleaner_List) + \")\")\n\ndef Cleanup_CPP_Expressions(ts):\n    return [(t[0], CPP_Expression_Cleaner_RE.sub(\"\", t[1])) for t in ts]\n\n#\n# Second \"subsystem\" of regular expressions that we set up:\n#\n# Stuff to translate a C preprocessor expression (as found on a #if or\n# #elif line) into an equivalent Python expression that we can eval().\n#\n\n# A dictionary that maps the C representation of Boolean operators\n# to their Python equivalents.\nCPP_to_Python_Ops_Dict = {\n    '!'         : ' not ',\n    '!='        : ' != ',\n    '&&'        : ' and ',\n    '||'        : ' or ',\n    '?'         : ' and ',\n    ':'         : ' or ',\n}\n\nCPP_to_Python_Ops_Sub = lambda m: CPP_to_Python_Ops_Dict[m.group(0)]\n\n# We have to sort the keys by length so that longer expressions\n# come *before* shorter expressions--in particular, \"!=\" must\n# come before \"!\" in the alternation.  Without this, the Python\n# re module, as late as version 2.2.2, empirically matches the\n# \"!\" in \"!=\" first, instead of finding the longest match.\n# What's up with that?\nl = sorted(list(CPP_to_Python_Ops_Dict.keys()), key=lambda a: len(a), reverse=True)\n\n# Turn the list of keys into one regular expression that will allow us\n# to substitute all of the operators at once.\nexpr = '|'.join(map(re.escape, l))\n\n# ...and compile the expression.\nCPP_to_Python_Ops_Expression = re.compile(expr)\n\n# A separate list of expressions to be evaluated and substituted\n# sequentially, not all at once.\nCPP_to_Python_Eval_List = [\n    [r'defined\\s+(\\w+)',                 '\"\\\\1\" in __dict__'],\n    [r'defined\\s*\\((\\w+)\\)',             '\"\\\\1\" in __dict__'],\n    [r'(0x[0-9A-Fa-f]+)(?:L|UL)?',  '\\\\1'],\n    [r'(\\d+)(?:L|UL)?',  '\\\\1'],\n]\n\n# Replace the string representations of the regular expressions in the\n# list with compiled versions.\nfor l in CPP_to_Python_Eval_List:\n    l[0] = re.compile(l[0])\n\n# Wrap up all of the above into a handy function.\ndef CPP_to_Python(s):\n    \"\"\"\n    Converts a C pre-processor expression into an equivalent\n    Python expression that can be evaluated.\n    \"\"\"\n    s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)\n    for expr, repl in CPP_to_Python_Eval_List:\n        s = re.sub(expr, repl, s)\n    return s\n\n\n\ndel expr\ndel l\ndel override\n\n\n\nclass FunctionEvaluator:\n    \"\"\"Handles delayed evaluation of a #define function call.\"\"\"\n\n    def __init__(self, name, args, expansion):\n        \"\"\"\n        Squirrels away the arguments and expansion value of a #define\n        macro function for later evaluation when we must actually expand\n        a value that uses it.\n        \"\"\"\n        self.name = name\n        self.args = function_arg_separator.split(args)\n        try:\n            expansion = expansion.split('##')\n        except AttributeError:\n            pass\n        self.expansion = expansion\n\n    def __call__(self, *values):\n        \"\"\"\n        Evaluates the expansion of a #define macro function called\n        with the specified values.\n        \"\"\"\n        if len(self.args) != len(values):\n            raise ValueError(\"Incorrect number of arguments to `%s'\" % self.name)\n        # Create a dictionary that maps the macro arguments to the\n        # corresponding values in this \"call.\"  We'll use this when we\n        # eval() the expansion so that arguments will get expanded to\n        # the right values.\n        args = self.args\n        localvars = {k: v for k, v in zip(args, values)}\n        parts = [s if s in args else repr(s) for s in self.expansion]\n        statement = ' + '.join(parts)\n\n        return eval(statement, globals(), localvars)\n\n\n# Find line continuations.\nline_continuations = re.compile('\\\\\\\\\\r?\\n')\n\n# Search for a \"function call\" macro on an expansion.  Returns the\n# two-tuple of the \"function\" name itself, and a string containing the\n# arguments within the call parentheses.\nfunction_name = re.compile(r'(\\S+)\\(([^)]*)\\)')\n\n# Split a string containing comma-separated function call arguments into\n# the separate arguments.\nfunction_arg_separator = re.compile(r',\\s*')\n\n\n\nclass PreProcessor:\n    \"\"\"The main workhorse class for handling C pre-processing.\"\"\"\n\n    def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0, depth=-1):\n        global Table\n\n        cpppath = tuple(cpppath)\n\n        self.searchpath = {\n            '\"': (current,) + cpppath,\n            '<': cpppath + (current,),\n        }\n\n        # Initialize our C preprocessor namespace for tracking the\n        # values of #defined keywords.  We use this namespace to look\n        # for keywords on #ifdef/#ifndef lines, and to eval() the\n        # expressions on #if/#elif lines (after massaging them from C to\n        # Python).\n        self.cpp_namespace = dict.copy()\n        self.cpp_namespace['__dict__'] = self.cpp_namespace\n\n        # Return all includes without resolving\n        if all:\n            self.do_include = self.all_include\n\n        # Max depth of nested includes:\n        # -1 = unlimited\n        # 0 - disabled nesting\n        # >0 - number of allowed nested includes\n        self.depth = depth\n\n        # For efficiency, a dispatch table maps each C preprocessor\n        # directive (#if, #define, etc.) to the method that should be\n        # called when we see it.  We accomodate state changes (#if,\n        # #ifdef, #ifndef) by pushing the current dispatch table on a\n        # stack and changing what method gets called for each relevant\n        # directive we might see next at this level (#else, #elif).\n        # #endif will simply pop the stack.\n        d = {'scons_current_file': self.scons_current_file}\n        for op in Table.keys():\n            d[op] = getattr(self, 'do_' + op)\n        self.default_table = d\n\n    def __call__(self, file):\n        \"\"\"\n        Pre-processes a file.\n\n        This is the main public entry point.\n        \"\"\"\n        self.current_file = file\n        return self.process_file(file)\n\n    def process_file(self, file):\n        \"\"\"\n        Pre-processes a file.\n\n        This is the main internal entry point.\n        \"\"\"\n        return self._process_tuples(self.tupleize(self.read_file(file)), file)\n\n    def process_contents(self, contents):\n        \"\"\"\n        Pre-processes a file contents.\n\n        Is used by tests\n        \"\"\"\n        return self._process_tuples(self.tupleize(contents))\n\n    def _process_tuples(self, tuples, file=None):\n        self.stack = []\n        self.dispatch_table = self.default_table.copy()\n        self.current_file = file\n        self.tuples = tuples\n\n        self.initialize_result(file)\n        while self.tuples:\n            t = self.tuples.pop(0)\n            # Uncomment to see the list of tuples being processed (e.g.,\n            # to validate the CPP lines are being translated correctly).\n            # print(t)\n            self.dispatch_table[t[0]](t)\n        return self.finalize_result(file)\n\n    def tupleize(self, contents):\n        \"\"\"\n        Turns the contents of a file into a list of easily-processed\n        tuples describing the CPP lines in the file.\n\n        The first element of each tuple is the line's preprocessor\n        directive (#if, #include, #define, etc., minus the initial '#').\n        The remaining elements are specific to the type of directive, as\n        pulled apart by the regular expression.\n        \"\"\"\n        return self._match_tuples(self._parse_tuples(contents))\n\n    def _parse_tuples(self, contents):\n        global CPP_Expression\n        contents = line_continuations.sub('', contents)\n        tuples = CPP_Expression.findall(contents)\n        return Cleanup_CPP_Expressions(tuples)\n\n    def _match_tuples(self, tuples):\n        global Table\n        result = []\n        for t in tuples:\n            m = Table[t[0]].match(t[1])\n            if m:\n                result.append((t[0],) + m.groups())\n        return result\n\n    # Dispatch table stack manipulation methods.\n\n    def save(self):\n        \"\"\"\n        Pushes the current dispatch table on the stack and re-initializes\n        the current dispatch table to the default.\n        \"\"\"\n        self.stack.append(self.dispatch_table)\n        self.dispatch_table = self.default_table.copy()\n\n    def restore(self):\n        \"\"\"\n        Pops the previous dispatch table off the stack and makes it the\n        current one.\n        \"\"\"\n        try: self.dispatch_table = self.stack.pop()\n        except IndexError: pass\n\n    # Utility methods.\n\n    def do_nothing(self, t):\n        \"\"\"\n        Null method for when we explicitly want the action for a\n        specific preprocessor directive to do nothing.\n        \"\"\"\n        pass\n\n    def scons_current_file(self, t):\n        self.current_file = t[1]\n\n    def eval_expression(self, t):\n        \"\"\"\n        Evaluates a C preprocessor expression.\n\n        This is done by converting it to a Python equivalent and\n        eval()ing it in the C preprocessor namespace we use to\n        track #define values.\n        \"\"\"\n        t = CPP_to_Python(' '.join(t[1:]))\n        try:\n            return eval(t, self.cpp_namespace)\n        except (NameError, TypeError, SyntaxError):\n            return 0\n\n    def initialize_result(self, fname):\n        self.result = [fname]\n\n    def finalize_result(self, fname):\n        return self.result[1:]\n\n    def find_include_file(self, t):\n        \"\"\"\n        Finds the #include file for a given preprocessor tuple.\n        \"\"\"\n        fname = t[2]\n        for d in self.searchpath[t[1]]:\n            if d == os.curdir:\n                f = fname\n            else:\n                f = os.path.join(d, fname)\n            if os.path.isfile(f):\n                return f\n        return None\n\n    def read_file(self, file):\n        with open(file) as f:\n            return f.read()\n\n    # Start and stop processing include lines.\n\n    def start_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to start processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates True, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated\n        False.\n\n        \"\"\"\n        d = self.dispatch_table\n        p = self.stack[-1] if self.stack else self.default_table\n\n        for k in ('import', 'include', 'include_next', 'define', 'undef'):\n            d[k] = p[k]\n\n    def stop_handling_includes(self, t=None):\n        \"\"\"\n        Causes the PreProcessor object to stop processing #import,\n        #include and #include_next lines.\n\n        This method will be called when a #if, #ifdef, #ifndef or #elif\n        evaluates False, or when we reach the #else in a #if, #ifdef,\n        #ifndef or #elif block where a condition already evaluated True.\n        \"\"\"\n        d = self.dispatch_table\n        d['import'] = self.do_nothing\n        d['include'] =  self.do_nothing\n        d['include_next'] =  self.do_nothing\n        d['define'] =  self.do_nothing\n        d['undef'] =  self.do_nothing\n\n    # Default methods for handling all of the preprocessor directives.\n    # (Note that what actually gets called for a given directive at any\n    # point in time is really controlled by the dispatch_table.)\n\n    def _do_if_else_condition(self, condition):\n        \"\"\"\n        Common logic for evaluating the conditions on #if, #ifdef and\n        #ifndef lines.\n        \"\"\"\n        self.save()\n        d = self.dispatch_table\n        if condition:\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n        else:\n            self.stop_handling_includes()\n            d['elif'] = self.do_elif\n            d['else'] = self.start_handling_includes\n\n    def do_ifdef(self, t):\n        \"\"\"\n        Default handling of a #ifdef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] in self.cpp_namespace)\n\n    def do_ifndef(self, t):\n        \"\"\"\n        Default handling of a #ifndef line.\n        \"\"\"\n        self._do_if_else_condition(t[1] not in self.cpp_namespace)\n\n    def do_if(self, t):\n        \"\"\"\n        Default handling of a #if line.\n        \"\"\"\n        self._do_if_else_condition(self.eval_expression(t))\n\n    def do_elif(self, t):\n        \"\"\"\n        Default handling of a #elif line.\n        \"\"\"\n        d = self.dispatch_table\n        if self.eval_expression(t):\n            self.start_handling_includes()\n            d['elif'] = self.stop_handling_includes\n            d['else'] = self.stop_handling_includes\n\n    def do_else(self, t):\n        \"\"\"\n        Default handling of a #else line.\n        \"\"\"\n        pass\n\n    def do_endif(self, t):\n        \"\"\"\n        Default handling of a #endif line.\n        \"\"\"\n        self.restore()\n\n    def do_define(self, t):\n        \"\"\"\n        Default handling of a #define line.\n        \"\"\"\n        _, name, args, expansion = t\n        try:\n            expansion = int(expansion)\n        except (TypeError, ValueError):\n            # handle \"defined\" chain \"! (defined (A) || defined (B)\" ...\n            if \"defined \" in expansion:\n                self.cpp_namespace[name] = self.eval_expression(t[2:])\n                return\n\n        if args:\n            evaluator = FunctionEvaluator(name, args[1:-1], expansion)\n            self.cpp_namespace[name] = evaluator\n        else:\n            self.cpp_namespace[name] = expansion\n\n    def do_undef(self, t):\n        \"\"\"\n        Default handling of a #undef line.\n        \"\"\"\n        try: del self.cpp_namespace[t[1]]\n        except KeyError: pass\n\n    def do_import(self, t):\n        \"\"\"\n        Default handling of a #import line.\n        \"\"\"\n        # XXX finish this -- maybe borrow/share logic from do_include()...?\n        pass\n\n    def do_include(self, t):\n        \"\"\"\n        Default handling of a #include line.\n        \"\"\"\n        t = self.resolve_include(t)\n        if not t:\n            return\n        include_file = self.find_include_file(t)\n        # avoid infinite recursion\n        if not include_file or include_file in self.result:\n            return\n        self.result.append(include_file)\n        # print include_file, len(self.tuples)\n\n        # Handle maximum depth of nested includes\n        if self.depth != -1:\n            current_depth = 0\n            for t in self.tuples:\n                if t[0] == \"scons_current_file\":\n                    current_depth += 1\n            if current_depth >= self.depth:\n                return\n\n        new_tuples = [('scons_current_file', include_file)] + \\\n                      self.tupleize(self.read_file(include_file)) + \\\n                     [('scons_current_file', self.current_file)]\n        self.tuples[:] = new_tuples + self.tuples\n\n    # Date: Tue, 22 Nov 2005 20:26:09 -0500\n    # From: Stefan Seefeld <seefeld@sympatico.ca>\n    #\n    # By the way, #include_next is not the same as #include. The difference\n    # being that #include_next starts its search in the path following the\n    # path that let to the including file. In other words, if your system\n    # include paths are ['/foo', '/bar'], and you are looking at a header\n    # '/foo/baz.h', it might issue an '#include_next <baz.h>' which would\n    # correctly resolve to '/bar/baz.h' (if that exists), but *not* see\n    # '/foo/baz.h' again. See http://www.delorie.com/gnu/docs/gcc/cpp_11.html\n    # for more reasoning.\n    #\n    # I have no idea in what context 'import' might be used.\n\n    # XXX is #include_next really the same as #include ?\n    do_include_next = do_include\n\n    # Utility methods for handling resolution of include files.\n\n    def resolve_include(self, t):\n        \"\"\"Resolve a tuple-ized #include line.\n\n        This handles recursive expansion of values without \"\" or <>\n        surrounding the name until an initial \" or < is found, to handle\n        #include FILE where FILE is a #define somewhere else.\n        \"\"\"\n        s = t[1].strip()\n        while not s[0] in '<\"':\n            try:\n                s = self.cpp_namespace[s]\n            except KeyError:\n                m = function_name.search(s)\n\n                # Date: Mon, 28 Nov 2016 17:47:13 UTC\n                # From: Ivan Kravets <ikravets@platformio.org>\n                #\n                # Ignore `#include` directive that depends on dynamic macro\n                # which is not located in state TABLE\n                # For example, `#include MYCONFIG_FILE`\n                if not m:\n                    return None\n\n                s = self.cpp_namespace[m.group(1)]\n                if callable(s):\n                    args = function_arg_separator.split(m.group(2))\n                    s = s(*args)\n            if not s:\n                return None\n        return (t[0], s[0], s[1:-1])\n\n    def all_include(self, t):\n        \"\"\"\n        \"\"\"\n        self.result.append(self.resolve_include(t))\n\n\nclass DumbPreProcessor(PreProcessor):\n    \"\"\"A preprocessor that ignores all #if/#elif/#else/#endif directives\n    and just reports back *all* of the #include files (like the classic\n    SCons scanner did).\n\n    This is functionally equivalent to using a regular expression to\n    find all of the #include lines, only slower.  It exists mainly as\n    an example of how the main PreProcessor class can be sub-classed\n    to tailor its behavior.\n    \"\"\"\n    def __init__(self, *args, **kw):\n        PreProcessor.__init__(self, *args, **kw)\n        d = self.default_table\n        for func in ['if', 'elif', 'else', 'endif', 'ifdef', 'ifndef']:\n            d[func] = d[func] = self.do_nothing\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"\ndblite.py module contributed by Ralf W. Grosse-Kunstleve.\nExtended for Unicode by Steven Knight.\n\"\"\"\n\nimport os\nimport pickle\nimport shutil\nimport time\n\nfrom SCons.compat import PICKLE_PROTOCOL\n\nKEEP_ALL_FILES = False\nIGNORE_CORRUPT_DBFILES = False\n\n\ndef corruption_warning(filename):\n    \"\"\"Local warning for corrupt db.\n\n    Used for self-tests. SCons overwrites this with a\n    different warning function in SConsign.py.\n    \"\"\"\n    print(\"Warning: Discarding corrupt database:\", filename)\n\nDBLITE_SUFFIX = '.dblite'\nTMP_SUFFIX = '.tmp'\n\n\nclass dblite:\n    \"\"\"\n    Squirrel away references to the functions in various modules\n    that we'll use when our __del__() method calls our sync() method\n    during shutdown.  We might get destroyed when Python is in the midst\n    of tearing down the different modules we import in an essentially\n    arbitrary order, and some of the various modules's global attributes\n    may already be wiped out from under us.\n\n    See the discussion at:\n      http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html\n\n    \"\"\"\n\n    _open = open\n    _pickle_dump = staticmethod(pickle.dump)\n    _pickle_protocol = PICKLE_PROTOCOL\n\n    try:\n        _os_chown = os.chown\n    except AttributeError:\n        _os_chown = None\n    _os_replace = os.replace\n    _os_chmod = os.chmod\n    _shutil_copyfile = shutil.copyfile\n    _time_time = time.time\n\n    def __init__(self, file_base_name, flag, mode):\n        assert flag in (None, \"r\", \"w\", \"c\", \"n\")\n        if flag is None:\n            flag = \"r\"\n\n        base, ext = os.path.splitext(file_base_name)\n        if ext == DBLITE_SUFFIX:\n            # There's already a suffix on the file name, don't add one.\n            self._file_name = file_base_name\n            self._tmp_name = base + TMP_SUFFIX\n        else:\n            self._file_name = file_base_name + DBLITE_SUFFIX\n            self._tmp_name = file_base_name + TMP_SUFFIX\n\n        self._flag = flag\n        self._mode = mode\n        self._dict = {}\n        self._needs_sync = False\n\n        if self._os_chown is not None and (os.geteuid() == 0 or os.getuid() == 0):\n            # running as root; chown back to current owner/group when done\n            try:\n                statinfo = os.stat(self._file_name)\n                self._chown_to = statinfo.st_uid\n                self._chgrp_to = statinfo.st_gid\n            except OSError:\n                # db file doesn't exist yet.\n                # Check os.environ for SUDO_UID, use if set\n                self._chown_to = int(os.environ.get('SUDO_UID', -1))\n                self._chgrp_to = int(os.environ.get('SUDO_GID', -1))\n        else:\n            self._chown_to = -1  # don't chown\n            self._chgrp_to = -1  # don't chgrp\n\n        if self._flag == \"n\":\n            with self._open(self._file_name, \"wb\", self._mode):\n                pass  # just make sure it exists\n        else:\n            try:\n                f = self._open(self._file_name, \"rb\")\n            except IOError as e:\n                if self._flag != \"c\":\n                    raise e\n                with self._open(self._file_name, \"wb\", self._mode):\n                    pass  # just make sure it exists\n            else:\n                p = f.read()\n                f.close()\n                if len(p) > 0:\n                    try:\n                        self._dict = pickle.loads(p, encoding='bytes')\n                    except (pickle.UnpicklingError, EOFError, KeyError):\n                        # Note how we catch KeyErrors too here, which might happen\n                        # when we don't have cPickle available (default pickle\n                        # throws it).\n                        if IGNORE_CORRUPT_DBFILES:\n                            corruption_warning(self._file_name)\n                        else:\n                            raise\n\n    def close(self):\n        if self._needs_sync:\n            self.sync()\n\n    def __del__(self):\n        self.close()\n\n    def sync(self):\n        self._check_writable()\n        with self._open(self._tmp_name, \"wb\", self._mode) as f:\n            self._pickle_dump(self._dict, f, self._pickle_protocol)\n\n        try:\n            self._os_replace(self._tmp_name, self._file_name)\n        except PermissionError:\n            # If we couldn't replace due to perms, try to change and retry.\n            # This is mainly for Windows - on POSIX the file permissions\n            # don't matter, the os.replace would have worked anyway.\n            # We're giving up if the retry fails, just let the Python\n            # exception abort us.\n            try:\n                self._os_chmod(self._file_name, 0o777)\n            except PermissionError:\n                pass\n            self._os_replace(self._tmp_name, self._file_name)\n\n        if self._os_chown is not None and self._chown_to > 0:  # don't chown to root or -1\n            try:\n                self._os_chown(self._file_name, self._chown_to, self._chgrp_to)\n            except OSError:\n                pass\n\n        self._needs_sync = False\n        if KEEP_ALL_FILES:\n            self._shutil_copyfile(\n                self._file_name,\n                self._file_name + \"_\" + str(int(self._time_time()))\n            )\n\n    def _check_writable(self):\n        if self._flag == \"r\":\n            raise IOError(\"Read-only database: %s\" % self._file_name)\n\n    def __getitem__(self, key):\n        return self._dict[key]\n\n    def __setitem__(self, key, value):\n        self._check_writable()\n\n        if not isinstance(key, str):\n            raise TypeError(\"key `%s' must be a string but is %s\" % (key, type(key)))\n\n        if not isinstance(value, bytes):\n            raise TypeError(\"value `%s' must be a bytes but is %s\" % (value, type(value)))\n\n        self._dict[key] = value\n        self._needs_sync = True\n\n    def keys(self):\n        return list(self._dict.keys())\n\n    def __contains__(self, key):\n        return key in self._dict\n\n    def __iter__(self):\n        return iter(self._dict)\n\n    def __len__(self):\n        return len(self._dict)\n\n\ndef open(file, flag=None, mode=0o666):\n    return dblite(file, flag, mode)\n\n\ndef _exercise():\n    db = open(\"tmp\", \"n\")\n    assert len(db) == 0\n    db[\"foo\"] = b\"bar\"\n    assert db[\"foo\"] == b\"bar\"\n    db.sync()\n\n    db = open(\"tmp\", \"c\")\n    assert len(db) == 1, len(db)\n    assert db[\"foo\"] == b\"bar\"\n    db[\"bar\"] = b\"foo\"\n    assert db[\"bar\"] == b\"foo\"\n    db.sync()\n\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 2, len(db)\n    assert db[\"foo\"] == b\"bar\"\n    assert db[\"bar\"] == b\"foo\"\n    try:\n        db.sync()\n    except IOError as e:\n        assert str(e) == \"Read-only database: tmp.dblite\"\n    else:\n        raise RuntimeError(\"IOError expected.\")\n    db = open(\"tmp\", \"w\")\n    assert len(db) == 2, len(db)\n    db[\"ping\"] = b\"pong\"\n    db.sync()\n\n    try:\n        db[(1, 2)] = \"tuple\"\n    except TypeError as e:\n        assert str(e) == \"key `(1, 2)' must be a string but is <class 'tuple'>\", str(e)\n    else:\n        raise RuntimeError(\"TypeError exception expected\")\n\n    try:\n        db[\"list\"] = [1, 2]\n    except TypeError as e:\n        assert str(e) == \"value `[1, 2]' must be a bytes but is <class 'list'>\", str(e)\n    else:\n        raise RuntimeError(\"TypeError exception expected\")\n\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 3, len(db)\n\n    db = open(\"tmp\", \"n\")\n    assert len(db) == 0, len(db)\n    dblite._open(\"tmp.dblite\", \"w\")\n\n    db = open(\"tmp\", \"r\")\n    dblite._open(\"tmp.dblite\", \"w\").write(\"x\")\n    try:\n        db = open(\"tmp\", \"r\")\n    except pickle.UnpicklingError:\n        pass\n    else:\n        raise RuntimeError(\"pickle exception expected.\")\n\n    global IGNORE_CORRUPT_DBFILES\n    IGNORE_CORRUPT_DBFILES = True\n    db = open(\"tmp\", \"r\")\n    assert len(db) == 0, len(db)\n    os.unlink(\"tmp.dblite\")\n    try:\n        db = open(\"tmp\", \"w\")\n    except IOError as e:\n        assert str(e) == \"[Errno 2] No such file or directory: 'tmp.dblite'\", str(e)\n    else:\n        raise RuntimeError(\"IOError expected.\")\n\n    print(\"Completed _exercise()\")\n\n\nif __name__ == \"__main__\":\n    _exercise()\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py",
    "content": "# MIT License\n#\n# Copyright The SCons Foundation\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\"\"\"Register functions which are executed when SCons exits for any reason.\"\"\"\n\n# This is obsolete now\n\nimport atexit\n\n_exithandlers = []\ndef _run_exitfuncs():\n    \"\"\"run any registered exit functions\n\n    _exithandlers is traversed in reverse order so functions are executed\n    last in, first out.\n    \"\"\"\n\n    while _exithandlers:\n        func, targs, kargs =  _exithandlers.pop()\n        func(*targs, **kargs)\n\ndef register(func, *targs, **kargs):\n    \"\"\"register a function to be executed upon normal program termination\n\n    func - function to be called at exit\n    targs - optional arguments to pass to func\n    kargs - optional keyword arguments to pass to func\n    \"\"\"\n    _exithandlers.append((func, targs, kargs))\n\n\n# make our exit function get run by python when it exits\natexit.register(_run_exitfuncs)\n\n# Local Variables:\n# tab-width:4\n# indent-tabs-mode:nil\n# End:\n# vim: set expandtab tabstop=4 shiftwidth=4:\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/LICENSE",
    "content": "# Copyright (C) 2012-2016 Free Software Foundation, Inc.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n\n#     (1) Redistributions of source code must retain the above copyright\n#     notice, this list of conditions and the following disclaimer. \n\n#     (2) Redistributions in binary form must reproduce the above copyright\n#     notice, this list of conditions and the following disclaimer in\n#     the documentation and/or other materials provided with the\n#     distribution.  \n    \n#     (3) The name of the author may not be used to\n#     endorse or promote products derived from this software without\n#     specific prior written permission.\n\n# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\n# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\n# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/README.md",
    "content": "# libbacktrace\nA C library that may be linked into a C/C++ program to produce symbolic backtraces\n\nInitially written by Ian Lance Taylor <iant@golang.org>.\n\nThis is version 1.0.\nIt is likely that this will always be version 1.0.\n\nThe libbacktrace library may be linked into a program or library and\nused to produce symbolic backtraces.\nSample uses would be to print a detailed backtrace when an error\noccurs or to gather detailed profiling information.\nIn general the functions provided by this library are async-signal-safe,\nmeaning that they may be safely called from a signal handler.\n\nThe libbacktrace library is provided under a BSD license.\nSee the source files for the exact license text.\n\nThe public functions are declared and documented in the header file\nbacktrace.h, which should be #include'd by a user of the library.\n\nBuilding libbacktrace will generate a file backtrace-supported.h,\nwhich a user of the library may use to determine whether backtraces\nwill work.\nSee the source file backtrace-supported.h.in for the macros that it\ndefines.\n\nAs of October 2020, libbacktrace supports ELF, PE/COFF, Mach-O, and\nXCOFF executables with DWARF debugging information.\nIn other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.\nThe library is written to make it straightforward to add support for\nother object file and debugging formats.\n\nThe library relies on the C++ unwind API defined at\nhttps://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\nThis API is provided by GCC and clang.\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/alloc.c",
    "content": "/* alloc.c -- Memory allocation without mmap.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n#include <sys/types.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* Allocation routines to use on systems that do not support anonymous\n   mmap.  This implementation just uses malloc, which means that the\n   backtrace functions may not be safely invoked from a signal\n   handler.  */\n\n/* Allocate memory like malloc.  If ERROR_CALLBACK is NULL, don't\n   report an error.  */\n\nvoid *\nbacktrace_alloc (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t\t size_t size, backtrace_error_callback error_callback,\n\t\t void *data)\n{\n  void *ret;\n\n  ret = malloc (size);\n  if (ret == NULL)\n    {\n      if (error_callback)\n\terror_callback (data, \"malloc\", errno);\n    }\n  return ret;\n}\n\n/* Free memory.  */\n\nvoid\nbacktrace_free (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t\tvoid *p, size_t size ATTRIBUTE_UNUSED,\n\t\tbacktrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t\tvoid *data ATTRIBUTE_UNUSED)\n{\n  free (p);\n}\n\n/* Grow VEC by SIZE bytes.  */\n\nvoid *\nbacktrace_vector_grow (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t\t       size_t size, backtrace_error_callback error_callback,\n\t\t       void *data, struct backtrace_vector *vec)\n{\n  void *ret;\n\n  if (size > vec->alc)\n    {\n      size_t alc;\n      void *base;\n\n      if (vec->size == 0)\n\talc = 32 * size;\n      else if (vec->size >= 4096)\n\talc = vec->size + 4096;\n      else\n\talc = 2 * vec->size;\n\n      if (alc < vec->size + size)\n\talc = vec->size + size;\n\n      base = realloc (vec->base, alc);\n      if (base == NULL)\n\t{\n\t  error_callback (data, \"realloc\", errno);\n\t  return NULL;\n\t}\n\n      vec->base = base;\n      vec->alc = alc - vec->size;\n    }\n\n  ret = (char *) vec->base + vec->size;\n  vec->size += size;\n  vec->alc -= size;\n  return ret;\n}\n\n/* Finish the current allocation on VEC.  */\n\nvoid *\nbacktrace_vector_finish (struct backtrace_state *state,\n\t\t\t struct backtrace_vector *vec,\n\t\t\t backtrace_error_callback error_callback,\n\t\t\t void *data)\n{\n  void *ret;\n\n  /* With this allocator we call realloc in backtrace_vector_grow,\n     which means we can't easily reuse the memory here.  So just\n     release it.  */\n  if (!backtrace_vector_release (state, vec, error_callback, data))\n    return NULL;\n  ret = vec->base;\n  vec->base = NULL;\n  vec->size = 0;\n  vec->alc = 0;\n  return ret;\n}\n\n/* Release any extra space allocated for VEC.  */\n\nint\nbacktrace_vector_release (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t\t\t  struct backtrace_vector *vec,\n\t\t\t  backtrace_error_callback error_callback,\n\t\t\t  void *data)\n{\n  vec->alc = 0;\n\n  if (vec->size == 0)\n    {\n      /* As of C17, realloc with size 0 is marked as an obsolescent feature, use\n\t free instead.  */\n      free (vec->base);\n      vec->base = NULL;\n      return 1;\n    }\n\n  vec->base = realloc (vec->base, vec->size);\n  if (vec->base == NULL)\n    {\n      error_callback (data, \"realloc\", errno);\n      return 0;\n    }\n\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/backtrace-supported.h",
    "content": "/* backtrace-supported.h.in -- Whether stack backtrace is supported.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n/* The file backtrace-supported.h.in is used by configure to generate\n   the file backtrace-supported.h.  The file backtrace-supported.h may\n   be #include'd to see whether the backtrace library will be able to\n   get a backtrace and produce symbolic information.  */\n\n\n/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library\n   should work, 0 if it will not.  Libraries may #include this to make\n   other arrangements.  */\n\n#define BACKTRACE_SUPPORTED 1\n\n/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace\n   library will call malloc as it works, 0 if it will call mmap\n   instead.  This may be used to determine whether it is safe to call\n   the backtrace functions from a signal handler.  In general this\n   only applies to calls like backtrace and backtrace_pcinfo.  It does\n   not apply to backtrace_simple, which never calls malloc.  It does\n   not apply to backtrace_print, which always calls fprintf and\n   therefore malloc.  */\n\n#define BACKTRACE_USES_MALLOC 0\n\n/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace\n   library is configured with threading support, 0 if not.  If this is\n   0, the threaded parameter to backtrace_create_state must be passed\n   as 0.  */\n\n#define BACKTRACE_SUPPORTS_THREADS 1\n\n/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo\n   will work for variables.  It will always work for functions.  */\n\n#define BACKTRACE_SUPPORTS_DATA 1\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/backtrace.c",
    "content": "/* backtrace.c -- Entry point for stack backtrace library.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <sys/types.h>\n\n#include \"unwind.h\"\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* The main backtrace_full routine.  */\n\n/* Data passed through _Unwind_Backtrace.  */\n\nstruct backtrace_data\n{\n  /* Number of frames to skip.  */\n  int skip;\n  /* Library state.  */\n  struct backtrace_state *state;\n  /* Callback routine.  */\n  backtrace_full_callback callback;\n  /* Error callback routine.  */\n  backtrace_error_callback error_callback;\n  /* Data to pass to callback routines.  */\n  void *data;\n  /* Value to return from backtrace_full.  */\n  int ret;\n  /* Whether there is any memory available.  */\n  int can_alloc;\n};\n\n/* Unwind library callback routine.  This is passed to\n   _Unwind_Backtrace.  */\n\nstatic _Unwind_Reason_Code\nunwind (struct _Unwind_Context *context, void *vdata)\n{\n  struct backtrace_data *bdata = (struct backtrace_data *) vdata;\n  uintptr_t pc;\n  int ip_before_insn = 0;\n\n#ifdef HAVE_GETIPINFO\n  pc = _Unwind_GetIPInfo (context, &ip_before_insn);\n#else\n  pc = _Unwind_GetIP (context);\n#endif\n\n  if (bdata->skip > 0)\n    {\n      --bdata->skip;\n      return _URC_NO_REASON;\n    }\n\n  if (!ip_before_insn)\n    --pc;\n\n  if (!bdata->can_alloc)\n    bdata->ret = bdata->callback (bdata->data, pc, NULL, 0, NULL);\n  else\n    bdata->ret = backtrace_pcinfo (bdata->state, pc, bdata->callback,\n\t\t\t\t   bdata->error_callback, bdata->data);\n  if (bdata->ret != 0)\n    return _URC_END_OF_STACK;\n\n  return _URC_NO_REASON;\n}\n\n/* Get a stack backtrace.  */\n\nint __attribute__((noinline))\nbacktrace_full (struct backtrace_state *state, int skip,\n\t\tbacktrace_full_callback callback,\n\t\tbacktrace_error_callback error_callback, void *data)\n{\n  struct backtrace_data bdata;\n  void *p;\n\n  bdata.skip = skip + 1;\n  bdata.state = state;\n  bdata.callback = callback;\n  bdata.error_callback = error_callback;\n  bdata.data = data;\n  bdata.ret = 0;\n\n  /* If we can't allocate any memory at all, don't try to produce\n     file/line information.  */\n  p = backtrace_alloc (state, 4096, NULL, NULL);\n  if (p == NULL)\n    bdata.can_alloc = 0;\n  else\n    {\n      backtrace_free (state, p, 4096, NULL, NULL);\n      bdata.can_alloc = 1;\n    }\n\n  _Unwind_Backtrace (unwind, &bdata);\n  return bdata.ret;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/backtrace.h",
    "content": "/* backtrace.h -- Public header file for stack backtrace library.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#ifndef BACKTRACE_H\n#define BACKTRACE_H\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* The backtrace state.  This struct is intentionally not defined in\n   the public interface.  */\n\nstruct backtrace_state;\n\n/* The type of the error callback argument to backtrace functions.\n   This function, if not NULL, will be called for certain error cases.\n   The DATA argument is passed to the function that calls this one.\n   The MSG argument is an error message.  The ERRNUM argument, if\n   greater than 0, holds an errno value.  The MSG buffer may become\n   invalid after this function returns.\n\n   As a special case, the ERRNUM argument will be passed as -1 if no\n   debug info can be found for the executable, or if the debug info\n   exists but has an unsupported version, but the function requires\n   debug info (e.g., backtrace_full, backtrace_pcinfo).  The MSG in\n   this case will be something along the lines of \"no debug info\".\n   Similarly, ERRNUM will be passed as -1 if there is no symbol table,\n   but the function requires a symbol table (e.g., backtrace_syminfo).\n   This may be used as a signal that some other approach should be\n   tried.  */\n\ntypedef void (*backtrace_error_callback) (void *data, const char *msg,\n\t\t\t\t\t  int errnum);\n\n/* Create state information for the backtrace routines.  This must be\n   called before any of the other routines, and its return value must\n   be passed to all of the other routines.  FILENAME is the path name\n   of the executable file; if it is NULL the library will try\n   system-specific path names.  If not NULL, FILENAME must point to a\n   permanent buffer.  If THREADED is non-zero the state may be\n   accessed by multiple threads simultaneously, and the library will\n   use appropriate atomic operations.  If THREADED is zero the state\n   may only be accessed by one thread at a time.  This returns a state\n   pointer on success, NULL on error.  If an error occurs, this will\n   call the ERROR_CALLBACK routine.\n\n   Calling this function allocates resources that cannot be freed.\n   There is no backtrace_free_state function.  The state is used to\n   cache information that is expensive to recompute.  Programs are\n   expected to call this function at most once and to save the return\n   value for all later calls to backtrace functions.  */\n\nextern struct backtrace_state *backtrace_create_state (\n    const char *filename, int threaded,\n    backtrace_error_callback error_callback, void *data);\n\n/* The type of the callback argument to the backtrace_full function.\n   DATA is the argument passed to backtrace_full.  PC is the program\n   counter.  FILENAME is the name of the file containing PC, or NULL\n   if not available.  LINENO is the line number in FILENAME containing\n   PC, or 0 if not available.  FUNCTION is the name of the function\n   containing PC, or NULL if not available.  This should return 0 to\n   continuing tracing.  The FILENAME and FUNCTION buffers may become\n   invalid after this function returns.  */\n\ntypedef int (*backtrace_full_callback) (void *data, uintptr_t pc,\n\t\t\t\t\tconst char *filename, int lineno,\n\t\t\t\t\tconst char *function);\n\n/* Get a full stack backtrace.  SKIP is the number of frames to skip;\n   passing 0 will start the trace with the function calling\n   backtrace_full.  DATA is passed to the callback routine.  If any\n   call to CALLBACK returns a non-zero value, the stack backtrace\n   stops, and backtrace returns that value; this may be used to limit\n   the number of stack frames desired.  If all calls to CALLBACK\n   return 0, backtrace returns 0.  The backtrace_full function will\n   make at least one call to either CALLBACK or ERROR_CALLBACK.  This\n   function requires debug info for the executable.  */\n\nextern int backtrace_full (struct backtrace_state *state, int skip,\n\t\t\t   backtrace_full_callback callback,\n\t\t\t   backtrace_error_callback error_callback,\n\t\t\t   void *data);\n\n/* The type of the callback argument to the backtrace_simple function.\n   DATA is the argument passed to simple_backtrace.  PC is the program\n   counter.  This should return 0 to continue tracing.  */\n\ntypedef int (*backtrace_simple_callback) (void *data, uintptr_t pc);\n\n/* Get a simple backtrace.  SKIP is the number of frames to skip, as\n   in backtrace.  DATA is passed to the callback routine.  If any call\n   to CALLBACK returns a non-zero value, the stack backtrace stops,\n   and backtrace_simple returns that value.  Otherwise\n   backtrace_simple returns 0.  The backtrace_simple function will\n   make at least one call to either CALLBACK or ERROR_CALLBACK.  This\n   function does not require any debug info for the executable.  */\n\nextern int backtrace_simple (struct backtrace_state *state, int skip,\n\t\t\t     backtrace_simple_callback callback,\n\t\t\t     backtrace_error_callback error_callback,\n\t\t\t     void *data);\n\n/* Print the current backtrace in a user readable format to a FILE.\n   SKIP is the number of frames to skip, as in backtrace_full.  Any\n   error messages are printed to stderr.  This function requires debug\n   info for the executable.  */\n\nextern void backtrace_print (struct backtrace_state *state, int skip, FILE *);\n\n/* Given PC, a program counter in the current program, call the\n   callback function with filename, line number, and function name\n   information.  This will normally call the callback function exactly\n   once.  However, if the PC happens to describe an inlined call, and\n   the debugging information contains the necessary information, then\n   this may call the callback function multiple times.  This will make\n   at least one call to either CALLBACK or ERROR_CALLBACK.  This\n   returns the first non-zero value returned by CALLBACK, or 0.  */\n\nextern int backtrace_pcinfo (struct backtrace_state *state, uintptr_t pc,\n\t\t\t     backtrace_full_callback callback,\n\t\t\t     backtrace_error_callback error_callback,\n\t\t\t     void *data);\n\n/* The type of the callback argument to backtrace_syminfo.  DATA and\n   PC are the arguments passed to backtrace_syminfo.  SYMNAME is the\n   name of the symbol for the corresponding code.  SYMVAL is the\n   value and SYMSIZE is the size of the symbol.  SYMNAME will be NULL\n   if no error occurred but the symbol could not be found.  */\n\ntypedef void (*backtrace_syminfo_callback) (void *data, uintptr_t pc,\n\t\t\t\t\t    const char *symname,\n\t\t\t\t\t    uintptr_t symval,\n\t\t\t\t\t    uintptr_t symsize);\n\n/* Given ADDR, an address or program counter in the current program,\n   call the callback information with the symbol name and value\n   describing the function or variable in which ADDR may be found.\n   This will call either CALLBACK or ERROR_CALLBACK exactly once.\n   This returns 1 on success, 0 on failure.  This function requires\n   the symbol table but does not require the debug info.  Note that if\n   the symbol table is present but ADDR could not be found in the\n   table, CALLBACK will be called with a NULL SYMNAME argument.\n   Returns 1 on success, 0 on error.  */\n\nextern int backtrace_syminfo (struct backtrace_state *state, uintptr_t addr,\n\t\t\t      backtrace_syminfo_callback callback,\n\t\t\t      backtrace_error_callback error_callback,\n\t\t\t      void *data);\n\n#ifdef __cplusplus\n} /* End extern \"C\".  */\n#endif\n\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/config.h",
    "content": "/* config.h.  Generated from config.h.in by configure.  */\n/* config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* ELF size: 32 or 64 */\n#define BACKTRACE_ELF_SIZE 64\n\n/* XCOFF size: 32 or 64 */\n#define BACKTRACE_XCOFF_SIZE unused\n\n/* Define to 1 if you have the __atomic functions */\n#define HAVE_ATOMIC_FUNCTIONS 1\n\n/* Define to 1 if you have the `clock_gettime' function. */\n#define HAVE_CLOCK_GETTIME 1\n\n/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you\n   don't. */\n#define HAVE_DECL_GETPAGESIZE 1\n\n/* Define to 1 if you have the declaration of `strnlen', and to 0 if you\n   don't. */\n#define HAVE_DECL_STRNLEN 1\n\n/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you\n   don't. */\n#if defined(_WIN32)\n#define HAVE_DECL__PGMPTR 1\n#else\n#define HAVE_DECL__PGMPTR 0\n#endif\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#define HAVE_DLFCN_H 1\n\n/* Define if dl_iterate_phdr is available. */\n#if !defined(_WIN32)\n#define HAVE_DL_ITERATE_PHDR 1\n#endif\n\n/* Define to 1 if you have the fcntl function */\n#if !defined(_WIN32)\n#define HAVE_FCNTL 1\n#endif\n/* Define if getexecname is available. */\n/* #undef HAVE_GETEXECNAME */\n\n/* Define if _Unwind_GetIPInfo is available. */\n#define HAVE_GETIPINFO 1\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in <sys/sysctl.h>.\n   */\n/* #undef HAVE_KERN_PROC */\n\n/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in\n   <sys/sysctl.h>. */\n/* #undef HAVE_KERN_PROC_ARGS */\n\n/* Define if -llzma is available. */\n#define HAVE_LIBLZMA 1\n\n/* Define to 1 if you have the <link.h> header file. */\n#define HAVE_LINK_H 1\n\n/* Define if AIX loadquery is available. */\n/* #undef HAVE_LOADQUERY */\n\n/* Define to 1 if you have the `lstat' function. */\n#define HAVE_LSTAT 1\n\n/* Define to 1 if you have the <mach-o/dyld.h> header file. */\n/* #undef HAVE_MACH_O_DYLD_H */\n\n/* Define to 1 if you have the <memory.h> header file. */\n#define HAVE_MEMORY_H 1\n\n/* Define to 1 if you have the `readlink' function. */\n#define HAVE_READLINK 1\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#define HAVE_STDINT_H 1\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#define HAVE_STDLIB_H 1\n\n/* Define to 1 if you have the <strings.h> header file. */\n#define HAVE_STRINGS_H 1\n\n/* Define to 1 if you have the <string.h> header file. */\n#define HAVE_STRING_H 1\n\n/* Define to 1 if you have the __sync functions */\n#define HAVE_SYNC_FUNCTIONS 1\n\n/* Define to 1 if you have the <sys/ldr.h> header file. */\n/* #undef HAVE_SYS_LDR_H */\n\n/* Define to 1 if you have the <sys/link.h> header file. */\n/* #undef HAVE_SYS_LINK_H */\n\n/* Define to 1 if you have the <sys/mman.h> header file. */\n#define HAVE_SYS_MMAN_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if you have the <windows.h> header file. */\n#ifdef _WIN32\n#define HAVE_WINDOWS_H\n#endif\n/* Define if -lz is available. */\n#define HAVE_ZLIB 1\n\n/* Define if -lzstd is available. */\n#define HAVE_ZSTD 1\n\n/* Define to the sub-directory in which libtool stores uninstalled libraries.\n   */\n#define LT_OBJDIR \".libs/\"\n\n/* Define to the address where bug reports for this package should be sent. */\n#define PACKAGE_BUGREPORT \"\"\n\n/* Define to the full name of this package. */\n#define PACKAGE_NAME \"package-unused\"\n\n/* Define to the full name and version of this package. */\n#define PACKAGE_STRING \"package-unused version-unused\"\n\n/* Define to the one symbol short name of this package. */\n#define PACKAGE_TARNAME \"libbacktrace\"\n\n/* Define to the home page for this package. */\n#define PACKAGE_URL \"\"\n\n/* Define to the version of this package. */\n#define PACKAGE_VERSION \"version-unused\"\n\n/* Define to 1 if you have the ANSI C header files. */\n#define STDC_HEADERS 1\n\n/* Enable extensions on AIX 3, Interix.  */\n#ifndef _ALL_SOURCE\n# define _ALL_SOURCE 1\n#endif\n/* Enable GNU extensions on systems that have them.  */\n#ifndef _GNU_SOURCE\n# define _GNU_SOURCE 1\n#endif\n/* Enable threading extensions on Solaris.  */\n#ifndef _POSIX_PTHREAD_SEMANTICS\n# define _POSIX_PTHREAD_SEMANTICS 1\n#endif\n/* Enable extensions on HP NonStop.  */\n#ifndef _TANDEM_SOURCE\n# define _TANDEM_SOURCE 1\n#endif\n/* Enable general extensions on Solaris.  */\n#ifndef __EXTENSIONS__\n# define __EXTENSIONS__ 1\n#endif\n\n\n/* Enable large inode numbers on Mac OS X 10.5.  */\n#ifndef _DARWIN_USE_64_BIT_INODE\n# define _DARWIN_USE_64_BIT_INODE 1\n#endif\n\n/* Number of bits in a file offset, on hosts where this is settable. */\n/* #undef _FILE_OFFSET_BITS */\n\n/* Define for large files, on AIX-style hosts. */\n/* #undef _LARGE_FILES */\n\n/* Define to 1 if on MINIX. */\n/* #undef _MINIX */\n\n/* Define to 2 if the system does not provide POSIX.1 features except with\n   this defined. */\n/* #undef _POSIX_1_SOURCE */\n\n/* Define to 1 if you need to in order for `stat' and other things to work. */\n/* #undef _POSIX_SOURCE */\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/dwarf.c",
    "content": "/* dwarf.c -- Get file/line information from DWARF for backtraces.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"filenames.h\"\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* DWARF constants.  */\n\nenum dwarf_tag {\n  DW_TAG_entry_point = 0x3,\n  DW_TAG_compile_unit = 0x11,\n  DW_TAG_inlined_subroutine = 0x1d,\n  DW_TAG_subprogram = 0x2e,\n  DW_TAG_skeleton_unit = 0x4a,\n};\n\nenum dwarf_form {\n  DW_FORM_addr = 0x01,\n  DW_FORM_block2 = 0x03,\n  DW_FORM_block4 = 0x04,\n  DW_FORM_data2 = 0x05,\n  DW_FORM_data4 = 0x06,\n  DW_FORM_data8 = 0x07,\n  DW_FORM_string = 0x08,\n  DW_FORM_block = 0x09,\n  DW_FORM_block1 = 0x0a,\n  DW_FORM_data1 = 0x0b,\n  DW_FORM_flag = 0x0c,\n  DW_FORM_sdata = 0x0d,\n  DW_FORM_strp = 0x0e,\n  DW_FORM_udata = 0x0f,\n  DW_FORM_ref_addr = 0x10,\n  DW_FORM_ref1 = 0x11,\n  DW_FORM_ref2 = 0x12,\n  DW_FORM_ref4 = 0x13,\n  DW_FORM_ref8 = 0x14,\n  DW_FORM_ref_udata = 0x15,\n  DW_FORM_indirect = 0x16,\n  DW_FORM_sec_offset = 0x17,\n  DW_FORM_exprloc = 0x18,\n  DW_FORM_flag_present = 0x19,\n  DW_FORM_ref_sig8 = 0x20,\n  DW_FORM_strx = 0x1a,\n  DW_FORM_addrx = 0x1b,\n  DW_FORM_ref_sup4 = 0x1c,\n  DW_FORM_strp_sup = 0x1d,\n  DW_FORM_data16 = 0x1e,\n  DW_FORM_line_strp = 0x1f,\n  DW_FORM_implicit_const = 0x21,\n  DW_FORM_loclistx = 0x22,\n  DW_FORM_rnglistx = 0x23,\n  DW_FORM_ref_sup8 = 0x24,\n  DW_FORM_strx1 = 0x25,\n  DW_FORM_strx2 = 0x26,\n  DW_FORM_strx3 = 0x27,\n  DW_FORM_strx4 = 0x28,\n  DW_FORM_addrx1 = 0x29,\n  DW_FORM_addrx2 = 0x2a,\n  DW_FORM_addrx3 = 0x2b,\n  DW_FORM_addrx4 = 0x2c,\n  DW_FORM_GNU_addr_index = 0x1f01,\n  DW_FORM_GNU_str_index = 0x1f02,\n  DW_FORM_GNU_ref_alt = 0x1f20,\n  DW_FORM_GNU_strp_alt = 0x1f21\n};\n\nenum dwarf_attribute {\n  DW_AT_sibling = 0x01,\n  DW_AT_location = 0x02,\n  DW_AT_name = 0x03,\n  DW_AT_ordering = 0x09,\n  DW_AT_subscr_data = 0x0a,\n  DW_AT_byte_size = 0x0b,\n  DW_AT_bit_offset = 0x0c,\n  DW_AT_bit_size = 0x0d,\n  DW_AT_element_list = 0x0f,\n  DW_AT_stmt_list = 0x10,\n  DW_AT_low_pc = 0x11,\n  DW_AT_high_pc = 0x12,\n  DW_AT_language = 0x13,\n  DW_AT_member = 0x14,\n  DW_AT_discr = 0x15,\n  DW_AT_discr_value = 0x16,\n  DW_AT_visibility = 0x17,\n  DW_AT_import = 0x18,\n  DW_AT_string_length = 0x19,\n  DW_AT_common_reference = 0x1a,\n  DW_AT_comp_dir = 0x1b,\n  DW_AT_const_value = 0x1c,\n  DW_AT_containing_type = 0x1d,\n  DW_AT_default_value = 0x1e,\n  DW_AT_inline = 0x20,\n  DW_AT_is_optional = 0x21,\n  DW_AT_lower_bound = 0x22,\n  DW_AT_producer = 0x25,\n  DW_AT_prototyped = 0x27,\n  DW_AT_return_addr = 0x2a,\n  DW_AT_start_scope = 0x2c,\n  DW_AT_bit_stride = 0x2e,\n  DW_AT_upper_bound = 0x2f,\n  DW_AT_abstract_origin = 0x31,\n  DW_AT_accessibility = 0x32,\n  DW_AT_address_class = 0x33,\n  DW_AT_artificial = 0x34,\n  DW_AT_base_types = 0x35,\n  DW_AT_calling_convention = 0x36,\n  DW_AT_count = 0x37,\n  DW_AT_data_member_location = 0x38,\n  DW_AT_decl_column = 0x39,\n  DW_AT_decl_file = 0x3a,\n  DW_AT_decl_line = 0x3b,\n  DW_AT_declaration = 0x3c,\n  DW_AT_discr_list = 0x3d,\n  DW_AT_encoding = 0x3e,\n  DW_AT_external = 0x3f,\n  DW_AT_frame_base = 0x40,\n  DW_AT_friend = 0x41,\n  DW_AT_identifier_case = 0x42,\n  DW_AT_macro_info = 0x43,\n  DW_AT_namelist_items = 0x44,\n  DW_AT_priority = 0x45,\n  DW_AT_segment = 0x46,\n  DW_AT_specification = 0x47,\n  DW_AT_static_link = 0x48,\n  DW_AT_type = 0x49,\n  DW_AT_use_location = 0x4a,\n  DW_AT_variable_parameter = 0x4b,\n  DW_AT_virtuality = 0x4c,\n  DW_AT_vtable_elem_location = 0x4d,\n  DW_AT_allocated = 0x4e,\n  DW_AT_associated = 0x4f,\n  DW_AT_data_location = 0x50,\n  DW_AT_byte_stride = 0x51,\n  DW_AT_entry_pc = 0x52,\n  DW_AT_use_UTF8 = 0x53,\n  DW_AT_extension = 0x54,\n  DW_AT_ranges = 0x55,\n  DW_AT_trampoline = 0x56,\n  DW_AT_call_column = 0x57,\n  DW_AT_call_file = 0x58,\n  DW_AT_call_line = 0x59,\n  DW_AT_description = 0x5a,\n  DW_AT_binary_scale = 0x5b,\n  DW_AT_decimal_scale = 0x5c,\n  DW_AT_small = 0x5d,\n  DW_AT_decimal_sign = 0x5e,\n  DW_AT_digit_count = 0x5f,\n  DW_AT_picture_string = 0x60,\n  DW_AT_mutable = 0x61,\n  DW_AT_threads_scaled = 0x62,\n  DW_AT_explicit = 0x63,\n  DW_AT_object_pointer = 0x64,\n  DW_AT_endianity = 0x65,\n  DW_AT_elemental = 0x66,\n  DW_AT_pure = 0x67,\n  DW_AT_recursive = 0x68,\n  DW_AT_signature = 0x69,\n  DW_AT_main_subprogram = 0x6a,\n  DW_AT_data_bit_offset = 0x6b,\n  DW_AT_const_expr = 0x6c,\n  DW_AT_enum_class = 0x6d,\n  DW_AT_linkage_name = 0x6e,\n  DW_AT_string_length_bit_size = 0x6f,\n  DW_AT_string_length_byte_size = 0x70,\n  DW_AT_rank = 0x71,\n  DW_AT_str_offsets_base = 0x72,\n  DW_AT_addr_base = 0x73,\n  DW_AT_rnglists_base = 0x74,\n  DW_AT_dwo_name = 0x76,\n  DW_AT_reference = 0x77,\n  DW_AT_rvalue_reference = 0x78,\n  DW_AT_macros = 0x79,\n  DW_AT_call_all_calls = 0x7a,\n  DW_AT_call_all_source_calls = 0x7b,\n  DW_AT_call_all_tail_calls = 0x7c,\n  DW_AT_call_return_pc = 0x7d,\n  DW_AT_call_value = 0x7e,\n  DW_AT_call_origin = 0x7f,\n  DW_AT_call_parameter = 0x80,\n  DW_AT_call_pc = 0x81,\n  DW_AT_call_tail_call = 0x82,\n  DW_AT_call_target = 0x83,\n  DW_AT_call_target_clobbered = 0x84,\n  DW_AT_call_data_location = 0x85,\n  DW_AT_call_data_value = 0x86,\n  DW_AT_noreturn = 0x87,\n  DW_AT_alignment = 0x88,\n  DW_AT_export_symbols = 0x89,\n  DW_AT_deleted = 0x8a,\n  DW_AT_defaulted = 0x8b,\n  DW_AT_loclists_base = 0x8c,\n  DW_AT_lo_user = 0x2000,\n  DW_AT_hi_user = 0x3fff,\n  DW_AT_MIPS_fde = 0x2001,\n  DW_AT_MIPS_loop_begin = 0x2002,\n  DW_AT_MIPS_tail_loop_begin = 0x2003,\n  DW_AT_MIPS_epilog_begin = 0x2004,\n  DW_AT_MIPS_loop_unroll_factor = 0x2005,\n  DW_AT_MIPS_software_pipeline_depth = 0x2006,\n  DW_AT_MIPS_linkage_name = 0x2007,\n  DW_AT_MIPS_stride = 0x2008,\n  DW_AT_MIPS_abstract_name = 0x2009,\n  DW_AT_MIPS_clone_origin = 0x200a,\n  DW_AT_MIPS_has_inlines = 0x200b,\n  DW_AT_HP_block_index = 0x2000,\n  DW_AT_HP_unmodifiable = 0x2001,\n  DW_AT_HP_prologue = 0x2005,\n  DW_AT_HP_epilogue = 0x2008,\n  DW_AT_HP_actuals_stmt_list = 0x2010,\n  DW_AT_HP_proc_per_section = 0x2011,\n  DW_AT_HP_raw_data_ptr = 0x2012,\n  DW_AT_HP_pass_by_reference = 0x2013,\n  DW_AT_HP_opt_level = 0x2014,\n  DW_AT_HP_prof_version_id = 0x2015,\n  DW_AT_HP_opt_flags = 0x2016,\n  DW_AT_HP_cold_region_low_pc = 0x2017,\n  DW_AT_HP_cold_region_high_pc = 0x2018,\n  DW_AT_HP_all_variables_modifiable = 0x2019,\n  DW_AT_HP_linkage_name = 0x201a,\n  DW_AT_HP_prof_flags = 0x201b,\n  DW_AT_HP_unit_name = 0x201f,\n  DW_AT_HP_unit_size = 0x2020,\n  DW_AT_HP_widened_byte_size = 0x2021,\n  DW_AT_HP_definition_points = 0x2022,\n  DW_AT_HP_default_location = 0x2023,\n  DW_AT_HP_is_result_param = 0x2029,\n  DW_AT_sf_names = 0x2101,\n  DW_AT_src_info = 0x2102,\n  DW_AT_mac_info = 0x2103,\n  DW_AT_src_coords = 0x2104,\n  DW_AT_body_begin = 0x2105,\n  DW_AT_body_end = 0x2106,\n  DW_AT_GNU_vector = 0x2107,\n  DW_AT_GNU_guarded_by = 0x2108,\n  DW_AT_GNU_pt_guarded_by = 0x2109,\n  DW_AT_GNU_guarded = 0x210a,\n  DW_AT_GNU_pt_guarded = 0x210b,\n  DW_AT_GNU_locks_excluded = 0x210c,\n  DW_AT_GNU_exclusive_locks_required = 0x210d,\n  DW_AT_GNU_shared_locks_required = 0x210e,\n  DW_AT_GNU_odr_signature = 0x210f,\n  DW_AT_GNU_template_name = 0x2110,\n  DW_AT_GNU_call_site_value = 0x2111,\n  DW_AT_GNU_call_site_data_value = 0x2112,\n  DW_AT_GNU_call_site_target = 0x2113,\n  DW_AT_GNU_call_site_target_clobbered = 0x2114,\n  DW_AT_GNU_tail_call = 0x2115,\n  DW_AT_GNU_all_tail_call_sites = 0x2116,\n  DW_AT_GNU_all_call_sites = 0x2117,\n  DW_AT_GNU_all_source_call_sites = 0x2118,\n  DW_AT_GNU_macros = 0x2119,\n  DW_AT_GNU_deleted = 0x211a,\n  DW_AT_GNU_dwo_name = 0x2130,\n  DW_AT_GNU_dwo_id = 0x2131,\n  DW_AT_GNU_ranges_base = 0x2132,\n  DW_AT_GNU_addr_base = 0x2133,\n  DW_AT_GNU_pubnames = 0x2134,\n  DW_AT_GNU_pubtypes = 0x2135,\n  DW_AT_GNU_discriminator = 0x2136,\n  DW_AT_GNU_locviews = 0x2137,\n  DW_AT_GNU_entry_view = 0x2138,\n  DW_AT_VMS_rtnbeg_pd_address = 0x2201,\n  DW_AT_use_GNAT_descriptive_type = 0x2301,\n  DW_AT_GNAT_descriptive_type = 0x2302,\n  DW_AT_GNU_numerator = 0x2303,\n  DW_AT_GNU_denominator = 0x2304,\n  DW_AT_GNU_bias = 0x2305,\n  DW_AT_upc_threads_scaled = 0x3210,\n  DW_AT_PGI_lbase = 0x3a00,\n  DW_AT_PGI_soffset = 0x3a01,\n  DW_AT_PGI_lstride = 0x3a02,\n  DW_AT_APPLE_optimized = 0x3fe1,\n  DW_AT_APPLE_flags = 0x3fe2,\n  DW_AT_APPLE_isa = 0x3fe3,\n  DW_AT_APPLE_block = 0x3fe4,\n  DW_AT_APPLE_major_runtime_vers = 0x3fe5,\n  DW_AT_APPLE_runtime_class = 0x3fe6,\n  DW_AT_APPLE_omit_frame_ptr = 0x3fe7,\n  DW_AT_APPLE_property_name = 0x3fe8,\n  DW_AT_APPLE_property_getter = 0x3fe9,\n  DW_AT_APPLE_property_setter = 0x3fea,\n  DW_AT_APPLE_property_attribute = 0x3feb,\n  DW_AT_APPLE_objc_complete_type = 0x3fec,\n  DW_AT_APPLE_property = 0x3fed\n};\n\nenum dwarf_line_number_op {\n  DW_LNS_extended_op = 0x0,\n  DW_LNS_copy = 0x1,\n  DW_LNS_advance_pc = 0x2,\n  DW_LNS_advance_line = 0x3,\n  DW_LNS_set_file = 0x4,\n  DW_LNS_set_column = 0x5,\n  DW_LNS_negate_stmt = 0x6,\n  DW_LNS_set_basic_block = 0x7,\n  DW_LNS_const_add_pc = 0x8,\n  DW_LNS_fixed_advance_pc = 0x9,\n  DW_LNS_set_prologue_end = 0xa,\n  DW_LNS_set_epilogue_begin = 0xb,\n  DW_LNS_set_isa = 0xc,\n};\n\nenum dwarf_extended_line_number_op {\n  DW_LNE_end_sequence = 0x1,\n  DW_LNE_set_address = 0x2,\n  DW_LNE_define_file = 0x3,\n  DW_LNE_set_discriminator = 0x4,\n};\n\nenum dwarf_line_number_content_type {\n  DW_LNCT_path = 0x1,\n  DW_LNCT_directory_index = 0x2,\n  DW_LNCT_timestamp = 0x3,\n  DW_LNCT_size = 0x4,\n  DW_LNCT_MD5 = 0x5,\n  DW_LNCT_lo_user = 0x2000,\n  DW_LNCT_hi_user = 0x3fff\n};\n\nenum dwarf_range_list_entry {\n  DW_RLE_end_of_list = 0x00,\n  DW_RLE_base_addressx = 0x01,\n  DW_RLE_startx_endx = 0x02,\n  DW_RLE_startx_length = 0x03,\n  DW_RLE_offset_pair = 0x04,\n  DW_RLE_base_address = 0x05,\n  DW_RLE_start_end = 0x06,\n  DW_RLE_start_length = 0x07\n};\n\nenum dwarf_unit_type {\n  DW_UT_compile = 0x01,\n  DW_UT_type = 0x02,\n  DW_UT_partial = 0x03,\n  DW_UT_skeleton = 0x04,\n  DW_UT_split_compile = 0x05,\n  DW_UT_split_type = 0x06,\n  DW_UT_lo_user = 0x80,\n  DW_UT_hi_user = 0xff\n};\n\n#if !defined(HAVE_DECL_STRNLEN) || !HAVE_DECL_STRNLEN\n\n/* If strnlen is not declared, provide our own version.  */\n\nstatic size_t\nxstrnlen (const char *s, size_t maxlen)\n{\n  size_t i;\n\n  for (i = 0; i < maxlen; ++i)\n    if (s[i] == '\\0')\n      break;\n  return i;\n}\n\n#define strnlen xstrnlen\n\n#endif\n\n/* A buffer to read DWARF info.  */\n\nstruct dwarf_buf\n{\n  /* Buffer name for error messages.  */\n  const char *name;\n  /* Start of the buffer.  */\n  const unsigned char *start;\n  /* Next byte to read.  */\n  const unsigned char *buf;\n  /* The number of bytes remaining.  */\n  size_t left;\n  /* Whether the data is big-endian.  */\n  int is_bigendian;\n  /* Error callback routine.  */\n  backtrace_error_callback error_callback;\n  /* Data for error_callback.  */\n  void *data;\n  /* Non-zero if we've reported an underflow error.  */\n  int reported_underflow;\n};\n\n/* A single attribute in a DWARF abbreviation.  */\n\nstruct attr\n{\n  /* The attribute name.  */\n  enum dwarf_attribute name;\n  /* The attribute form.  */\n  enum dwarf_form form;\n  /* The attribute value, for DW_FORM_implicit_const.  */\n  int64_t val;\n};\n\n/* A single DWARF abbreviation.  */\n\nstruct abbrev\n{\n  /* The abbrev code--the number used to refer to the abbrev.  */\n  uint64_t code;\n  /* The entry tag.  */\n  enum dwarf_tag tag;\n  /* Non-zero if this abbrev has child entries.  */\n  int has_children;\n  /* The number of attributes.  */\n  size_t num_attrs;\n  /* The attributes.  */\n  struct attr *attrs;\n};\n\n/* The DWARF abbreviations for a compilation unit.  This structure\n   only exists while reading the compilation unit.  Most DWARF readers\n   seem to a hash table to map abbrev ID's to abbrev entries.\n   However, we primarily care about GCC, and GCC simply issues ID's in\n   numerical order starting at 1.  So we simply keep a sorted vector,\n   and try to just look up the code.  */\n\nstruct abbrevs\n{\n  /* The number of abbrevs in the vector.  */\n  size_t num_abbrevs;\n  /* The abbrevs, sorted by the code field.  */\n  struct abbrev *abbrevs;\n};\n\n/* The different kinds of attribute values.  */\n\nenum attr_val_encoding\n{\n  /* No attribute value.  */\n  ATTR_VAL_NONE,\n  /* An address.  */\n  ATTR_VAL_ADDRESS,\n  /* An index into the .debug_addr section, whose value is relative to\n     the DW_AT_addr_base attribute of the compilation unit.  */\n  ATTR_VAL_ADDRESS_INDEX,\n  /* A unsigned integer.  */\n  ATTR_VAL_UINT,\n  /* A sigd integer.  */\n  ATTR_VAL_SINT,\n  /* A string.  */\n  ATTR_VAL_STRING,\n  /* An index into the .debug_str_offsets section.  */\n  ATTR_VAL_STRING_INDEX,\n  /* An offset to other data in the containing unit.  */\n  ATTR_VAL_REF_UNIT,\n  /* An offset to other data within the .debug_info section.  */\n  ATTR_VAL_REF_INFO,\n  /* An offset to other data within the alt .debug_info section.  */\n  ATTR_VAL_REF_ALT_INFO,\n  /* An offset to data in some other section.  */\n  ATTR_VAL_REF_SECTION,\n  /* A type signature.  */\n  ATTR_VAL_REF_TYPE,\n  /* An index into the .debug_rnglists section.  */\n  ATTR_VAL_RNGLISTS_INDEX,\n  /* A block of data (not represented).  */\n  ATTR_VAL_BLOCK,\n  /* An expression (not represented).  */\n  ATTR_VAL_EXPR,\n};\n\n/* An attribute value.  */\n\nstruct attr_val\n{\n  /* How the value is stored in the field u.  */\n  enum attr_val_encoding encoding;\n  union\n  {\n    /* ATTR_VAL_ADDRESS*, ATTR_VAL_UINT, ATTR_VAL_REF*.  */\n    uint64_t uint;\n    /* ATTR_VAL_SINT.  */\n    int64_t sint;\n    /* ATTR_VAL_STRING.  */\n    const char *string;\n    /* ATTR_VAL_BLOCK not stored.  */\n  } u;\n};\n\n/* The line number program header.  */\n\nstruct line_header\n{\n  /* The version of the line number information.  */\n  int version;\n  /* Address size.  */\n  int addrsize;\n  /* The minimum instruction length.  */\n  unsigned int min_insn_len;\n  /* The maximum number of ops per instruction.  */\n  unsigned int max_ops_per_insn;\n  /* The line base for special opcodes.  */\n  int line_base;\n  /* The line range for special opcodes.  */\n  unsigned int line_range;\n  /* The opcode base--the first special opcode.  */\n  unsigned int opcode_base;\n  /* Opcode lengths, indexed by opcode - 1.  */\n  const unsigned char *opcode_lengths;\n  /* The number of directory entries.  */\n  size_t dirs_count;\n  /* The directory entries.  */\n  const char **dirs;\n  /* The number of filenames.  */\n  size_t filenames_count;\n  /* The filenames.  */\n  const char **filenames;\n};\n\n/* A format description from a line header.  */\n\nstruct line_header_format\n{\n  int lnct;\t\t/* LNCT code.  */\n  enum dwarf_form form;\t/* Form of entry data.  */\n};\n\n/* Map a single PC value to a file/line.  We will keep a vector of\n   these sorted by PC value.  Each file/line will be correct from the\n   PC up to the PC of the next entry if there is one.  We allocate one\n   extra entry at the end so that we can use bsearch.  */\n\nstruct line\n{\n  /* PC.  */\n  uintptr_t pc;\n  /* File name.  Many entries in the array are expected to point to\n     the same file name.  */\n  const char *filename;\n  /* Line number.  */\n  int lineno;\n  /* Index of the object in the original array read from the DWARF\n     section, before it has been sorted.  The index makes it possible\n     to use Quicksort and maintain stability.  */\n  int idx;\n};\n\n/* A growable vector of line number information.  This is used while\n   reading the line numbers.  */\n\nstruct line_vector\n{\n  /* Memory.  This is an array of struct line.  */\n  struct backtrace_vector vec;\n  /* Number of valid mappings.  */\n  size_t count;\n};\n\n/* A function described in the debug info.  */\n\nstruct function\n{\n  /* The name of the function.  */\n  const char *name;\n  /* If this is an inlined function, the filename of the call\n     site.  */\n  const char *caller_filename;\n  /* If this is an inlined function, the line number of the call\n     site.  */\n  int caller_lineno;\n  /* Map PC ranges to inlined functions.  */\n  struct function_addrs *function_addrs;\n  size_t function_addrs_count;\n};\n\n/* An address range for a function.  This maps a PC value to a\n   specific function.  */\n\nstruct function_addrs\n{\n  /* Range is LOW <= PC < HIGH.  */\n  uintptr_t low;\n  uintptr_t high;\n  /* Function for this address range.  */\n  struct function *function;\n};\n\n/* A growable vector of function address ranges.  */\n\nstruct function_vector\n{\n  /* Memory.  This is an array of struct function_addrs.  */\n  struct backtrace_vector vec;\n  /* Number of address ranges present.  */\n  size_t count;\n};\n\n/* A DWARF compilation unit.  This only holds the information we need\n   to map a PC to a file and line.  */\n\nstruct unit\n{\n  /* The first entry for this compilation unit.  */\n  const unsigned char *unit_data;\n  /* The length of the data for this compilation unit.  */\n  size_t unit_data_len;\n  /* The offset of UNIT_DATA from the start of the information for\n     this compilation unit.  */\n  size_t unit_data_offset;\n  /* Offset of the start of the compilation unit from the start of the\n     .debug_info section.  */\n  size_t low_offset;\n  /* Offset of the end of the compilation unit from the start of the\n     .debug_info section.  */\n  size_t high_offset;\n  /* DWARF version.  */\n  int version;\n  /* Whether unit is DWARF64.  */\n  int is_dwarf64;\n  /* Address size.  */\n  int addrsize;\n  /* Offset into line number information.  */\n  off_t lineoff;\n  /* Offset of compilation unit in .debug_str_offsets.  */\n  uint64_t str_offsets_base;\n  /* Offset of compilation unit in .debug_addr.  */\n  uint64_t addr_base;\n  /* Offset of compilation unit in .debug_rnglists.  */\n  uint64_t rnglists_base;\n  /* Primary source file.  */\n  const char *filename;\n  /* Compilation command working directory.  */\n  const char *comp_dir;\n  /* Absolute file name, only set if needed.  */\n  const char *abs_filename;\n  /* The abbreviations for this unit.  */\n  struct abbrevs abbrevs;\n\n  /* The fields above this point are read in during initialization and\n     may be accessed freely.  The fields below this point are read in\n     as needed, and therefore require care, as different threads may\n     try to initialize them simultaneously.  */\n\n  /* PC to line number mapping.  This is NULL if the values have not\n     been read.  This is (struct line *) -1 if there was an error\n     reading the values.  */\n  struct line *lines;\n  /* Number of entries in lines.  */\n  size_t lines_count;\n  /* PC ranges to function.  */\n  struct function_addrs *function_addrs;\n  size_t function_addrs_count;\n};\n\n/* An address range for a compilation unit.  This maps a PC value to a\n   specific compilation unit.  Note that we invert the representation\n   in DWARF: instead of listing the units and attaching a list of\n   ranges, we list the ranges and have each one point to the unit.\n   This lets us do a binary search to find the unit.  */\n\nstruct unit_addrs\n{\n  /* Range is LOW <= PC < HIGH.  */\n  uintptr_t low;\n  uintptr_t high;\n  /* Compilation unit for this address range.  */\n  struct unit *u;\n};\n\n/* A growable vector of compilation unit address ranges.  */\n\nstruct unit_addrs_vector\n{\n  /* Memory.  This is an array of struct unit_addrs.  */\n  struct backtrace_vector vec;\n  /* Number of address ranges present.  */\n  size_t count;\n};\n\n/* A growable vector of compilation unit pointer.  */\n\nstruct unit_vector\n{\n  struct backtrace_vector vec;\n  size_t count;\n};\n\n/* The information we need to map a PC to a file and line.  */\n\nstruct dwarf_data\n{\n  /* The data for the next file we know about.  */\n  struct dwarf_data *next;\n  /* The data for .gnu_debugaltlink.  */\n  struct dwarf_data *altlink;\n  /* The base address for this file.  */\n  uintptr_t base_address;\n  /* A sorted list of address ranges.  */\n  struct unit_addrs *addrs;\n  /* Number of address ranges in list.  */\n  size_t addrs_count;\n  /* A sorted list of units.  */\n  struct unit **units;\n  /* Number of units in the list.  */\n  size_t units_count;\n  /* The unparsed DWARF debug data.  */\n  struct dwarf_sections dwarf_sections;\n  /* Whether the data is big-endian or not.  */\n  int is_bigendian;\n  /* A vector used for function addresses.  We keep this here so that\n     we can grow the vector as we read more functions.  */\n  struct function_vector fvec;\n};\n\n/* Report an error for a DWARF buffer.  */\n\nstatic void\ndwarf_buf_error (struct dwarf_buf *buf, const char *msg, int errnum)\n{\n  char b[200];\n\n  snprintf (b, sizeof b, \"%s in %s at %d\",\n\t    msg, buf->name, (int) (buf->buf - buf->start));\n  buf->error_callback (buf->data, b, errnum);\n}\n\n/* Require at least COUNT bytes in BUF.  Return 1 if all is well, 0 on\n   error.  */\n\nstatic int\nrequire (struct dwarf_buf *buf, size_t count)\n{\n  if (buf->left >= count)\n    return 1;\n\n  if (!buf->reported_underflow)\n    {\n      dwarf_buf_error (buf, \"DWARF underflow\", 0);\n      buf->reported_underflow = 1;\n    }\n\n  return 0;\n}\n\n/* Advance COUNT bytes in BUF.  Return 1 if all is well, 0 on\n   error.  */\n\nstatic int\nadvance (struct dwarf_buf *buf, size_t count)\n{\n  if (!require (buf, count))\n    return 0;\n  buf->buf += count;\n  buf->left -= count;\n  return 1;\n}\n\n/* Read one zero-terminated string from BUF and advance past the string.  */\n\nstatic const char *\nread_string (struct dwarf_buf *buf)\n{\n  const char *p = (const char *)buf->buf;\n  size_t len = strnlen (p, buf->left);\n\n  /* - If len == left, we ran out of buffer before finding the zero terminator.\n       Generate an error by advancing len + 1.\n     - If len < left, advance by len + 1 to skip past the zero terminator.  */\n  size_t count = len + 1;\n\n  if (!advance (buf, count))\n    return NULL;\n\n  return p;\n}\n\n/* Read one byte from BUF and advance 1 byte.  */\n\nstatic unsigned char\nread_byte (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 1))\n    return 0;\n  return p[0];\n}\n\n/* Read a signed char from BUF and advance 1 byte.  */\n\nstatic signed char\nread_sbyte (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 1))\n    return 0;\n  return (*p ^ 0x80) - 0x80;\n}\n\n/* Read a uint16 from BUF and advance 2 bytes.  */\n\nstatic uint16_t\nread_uint16 (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 2))\n    return 0;\n  if (buf->is_bigendian)\n    return ((uint16_t) p[0] << 8) | (uint16_t) p[1];\n  else\n    return ((uint16_t) p[1] << 8) | (uint16_t) p[0];\n}\n\n/* Read a 24 bit value from BUF and advance 3 bytes.  */\n\nstatic uint32_t\nread_uint24 (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 3))\n    return 0;\n  if (buf->is_bigendian)\n    return (((uint32_t) p[0] << 16) | ((uint32_t) p[1] << 8)\n\t    | (uint32_t) p[2]);\n  else\n    return (((uint32_t) p[2] << 16) | ((uint32_t) p[1] << 8)\n\t    | (uint32_t) p[0]);\n}\n\n/* Read a uint32 from BUF and advance 4 bytes.  */\n\nstatic uint32_t\nread_uint32 (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 4))\n    return 0;\n  if (buf->is_bigendian)\n    return (((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16)\n\t    | ((uint32_t) p[2] << 8) | (uint32_t) p[3]);\n  else\n    return (((uint32_t) p[3] << 24) | ((uint32_t) p[2] << 16)\n\t    | ((uint32_t) p[1] << 8) | (uint32_t) p[0]);\n}\n\n/* Read a uint64 from BUF and advance 8 bytes.  */\n\nstatic uint64_t\nread_uint64 (struct dwarf_buf *buf)\n{\n  const unsigned char *p = buf->buf;\n\n  if (!advance (buf, 8))\n    return 0;\n  if (buf->is_bigendian)\n    return (((uint64_t) p[0] << 56) | ((uint64_t) p[1] << 48)\n\t    | ((uint64_t) p[2] << 40) | ((uint64_t) p[3] << 32)\n\t    | ((uint64_t) p[4] << 24) | ((uint64_t) p[5] << 16)\n\t    | ((uint64_t) p[6] << 8) | (uint64_t) p[7]);\n  else\n    return (((uint64_t) p[7] << 56) | ((uint64_t) p[6] << 48)\n\t    | ((uint64_t) p[5] << 40) | ((uint64_t) p[4] << 32)\n\t    | ((uint64_t) p[3] << 24) | ((uint64_t) p[2] << 16)\n\t    | ((uint64_t) p[1] << 8) | (uint64_t) p[0]);\n}\n\n/* Read an offset from BUF and advance the appropriate number of\n   bytes.  */\n\nstatic uint64_t\nread_offset (struct dwarf_buf *buf, int is_dwarf64)\n{\n  if (is_dwarf64)\n    return read_uint64 (buf);\n  else\n    return read_uint32 (buf);\n}\n\n/* Read an address from BUF and advance the appropriate number of\n   bytes.  */\n\nstatic uint64_t\nread_address (struct dwarf_buf *buf, int addrsize)\n{\n  switch (addrsize)\n    {\n    case 1:\n      return read_byte (buf);\n    case 2:\n      return read_uint16 (buf);\n    case 4:\n      return read_uint32 (buf);\n    case 8:\n      return read_uint64 (buf);\n    default:\n      dwarf_buf_error (buf, \"unrecognized address size\", 0);\n      return 0;\n    }\n}\n\n/* Return whether a value is the highest possible address, given the\n   address size.  */\n\nstatic int\nis_highest_address (uint64_t address, int addrsize)\n{\n  switch (addrsize)\n    {\n    case 1:\n      return address == (unsigned char) -1;\n    case 2:\n      return address == (uint16_t) -1;\n    case 4:\n      return address == (uint32_t) -1;\n    case 8:\n      return address == (uint64_t) -1;\n    default:\n      return 0;\n    }\n}\n\n/* Read an unsigned LEB128 number.  */\n\nstatic uint64_t\nread_uleb128 (struct dwarf_buf *buf)\n{\n  uint64_t ret;\n  unsigned int shift;\n  int overflow;\n  unsigned char b;\n\n  ret = 0;\n  shift = 0;\n  overflow = 0;\n  do\n    {\n      const unsigned char *p;\n\n      p = buf->buf;\n      if (!advance (buf, 1))\n\treturn 0;\n      b = *p;\n      if (shift < 64)\n\tret |= ((uint64_t) (b & 0x7f)) << shift;\n      else if (!overflow)\n\t{\n\t  dwarf_buf_error (buf, \"LEB128 overflows uint64_t\", 0);\n\t  overflow = 1;\n\t}\n      shift += 7;\n    }\n  while ((b & 0x80) != 0);\n\n  return ret;\n}\n\n/* Read a signed LEB128 number.  */\n\nstatic int64_t\nread_sleb128 (struct dwarf_buf *buf)\n{\n  uint64_t val;\n  unsigned int shift;\n  int overflow;\n  unsigned char b;\n\n  val = 0;\n  shift = 0;\n  overflow = 0;\n  do\n    {\n      const unsigned char *p;\n\n      p = buf->buf;\n      if (!advance (buf, 1))\n\treturn 0;\n      b = *p;\n      if (shift < 64)\n\tval |= ((uint64_t) (b & 0x7f)) << shift;\n      else if (!overflow)\n\t{\n\t  dwarf_buf_error (buf, \"signed LEB128 overflows uint64_t\", 0);\n\t  overflow = 1;\n\t}\n      shift += 7;\n    }\n  while ((b & 0x80) != 0);\n\n  if ((b & 0x40) != 0 && shift < 64)\n    val |= ((uint64_t) -1) << shift;\n\n  return (int64_t) val;\n}\n\n/* Return the length of an LEB128 number.  */\n\nstatic size_t\nleb128_len (const unsigned char *p)\n{\n  size_t ret;\n\n  ret = 1;\n  while ((*p & 0x80) != 0)\n    {\n      ++p;\n      ++ret;\n    }\n  return ret;\n}\n\n/* Read initial_length from BUF and advance the appropriate number of bytes.  */\n\nstatic uint64_t\nread_initial_length (struct dwarf_buf *buf, int *is_dwarf64)\n{\n  uint64_t len;\n\n  len = read_uint32 (buf);\n  if (len == 0xffffffff)\n    {\n      len = read_uint64 (buf);\n      *is_dwarf64 = 1;\n    }\n  else\n    *is_dwarf64 = 0;\n\n  return len;\n}\n\n/* Free an abbreviations structure.  */\n\nstatic void\nfree_abbrevs (struct backtrace_state *state, struct abbrevs *abbrevs,\n\t      backtrace_error_callback error_callback, void *data)\n{\n  size_t i;\n\n  for (i = 0; i < abbrevs->num_abbrevs; ++i)\n    backtrace_free (state, abbrevs->abbrevs[i].attrs,\n\t\t    abbrevs->abbrevs[i].num_attrs * sizeof (struct attr),\n\t\t    error_callback, data);\n  backtrace_free (state, abbrevs->abbrevs,\n\t\t  abbrevs->num_abbrevs * sizeof (struct abbrev),\n\t\t  error_callback, data);\n  abbrevs->num_abbrevs = 0;\n  abbrevs->abbrevs = NULL;\n}\n\n/* Read an attribute value.  Returns 1 on success, 0 on failure.  If\n   the value can be represented as a uint64_t, sets *VAL and sets\n   *IS_VALID to 1.  We don't try to store the value of other attribute\n   forms, because we don't care about them.  */\n\nstatic int\nread_attribute (enum dwarf_form form, uint64_t implicit_val,\n\t\tstruct dwarf_buf *buf, int is_dwarf64, int version,\n\t\tint addrsize, const struct dwarf_sections *dwarf_sections,\n\t\tstruct dwarf_data *altlink, struct attr_val *val)\n{\n  /* Avoid warnings about val.u.FIELD may be used uninitialized if\n     this function is inlined.  The warnings aren't valid but can\n     occur because the different fields are set and used\n     conditionally.  */\n  memset (val, 0, sizeof *val);\n\n  switch (form)\n    {\n    case DW_FORM_addr:\n      val->encoding = ATTR_VAL_ADDRESS;\n      val->u.uint = read_address (buf, addrsize);\n      return 1;\n    case DW_FORM_block2:\n      val->encoding = ATTR_VAL_BLOCK;\n      return advance (buf, read_uint16 (buf));\n    case DW_FORM_block4:\n      val->encoding = ATTR_VAL_BLOCK;\n      return advance (buf, read_uint32 (buf));\n    case DW_FORM_data2:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_uint16 (buf);\n      return 1;\n    case DW_FORM_data4:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_uint32 (buf);\n      return 1;\n    case DW_FORM_data8:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_uint64 (buf);\n      return 1;\n    case DW_FORM_data16:\n      val->encoding = ATTR_VAL_BLOCK;\n      return advance (buf, 16);\n    case DW_FORM_string:\n      val->encoding = ATTR_VAL_STRING;\n      val->u.string = read_string (buf);\n      return val->u.string == NULL ? 0 : 1;\n    case DW_FORM_block:\n      val->encoding = ATTR_VAL_BLOCK;\n      return advance (buf, read_uleb128 (buf));\n    case DW_FORM_block1:\n      val->encoding = ATTR_VAL_BLOCK;\n      return advance (buf, read_byte (buf));\n    case DW_FORM_data1:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_byte (buf);\n      return 1;\n    case DW_FORM_flag:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_byte (buf);\n      return 1;\n    case DW_FORM_sdata:\n      val->encoding = ATTR_VAL_SINT;\n      val->u.sint = read_sleb128 (buf);\n      return 1;\n    case DW_FORM_strp:\n      {\n\tuint64_t offset;\n\n\toffset = read_offset (buf, is_dwarf64);\n\tif (offset >= dwarf_sections->size[DEBUG_STR])\n\t  {\n\t    dwarf_buf_error (buf, \"DW_FORM_strp out of range\", 0);\n\t    return 0;\n\t  }\n\tval->encoding = ATTR_VAL_STRING;\n\tval->u.string =\n\t  (const char *) dwarf_sections->data[DEBUG_STR] + offset;\n\treturn 1;\n      }\n    case DW_FORM_line_strp:\n      {\n\tuint64_t offset;\n\n\toffset = read_offset (buf, is_dwarf64);\n\tif (offset >= dwarf_sections->size[DEBUG_LINE_STR])\n\t  {\n\t    dwarf_buf_error (buf, \"DW_FORM_line_strp out of range\", 0);\n\t    return 0;\n\t  }\n\tval->encoding = ATTR_VAL_STRING;\n\tval->u.string =\n\t  (const char *) dwarf_sections->data[DEBUG_LINE_STR] + offset;\n\treturn 1;\n      }\n    case DW_FORM_udata:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_ref_addr:\n      val->encoding = ATTR_VAL_REF_INFO;\n      if (version == 2)\n\tval->u.uint = read_address (buf, addrsize);\n      else\n\tval->u.uint = read_offset (buf, is_dwarf64);\n      return 1;\n    case DW_FORM_ref1:\n      val->encoding = ATTR_VAL_REF_UNIT;\n      val->u.uint = read_byte (buf);\n      return 1;\n    case DW_FORM_ref2:\n      val->encoding = ATTR_VAL_REF_UNIT;\n      val->u.uint = read_uint16 (buf);\n      return 1;\n    case DW_FORM_ref4:\n      val->encoding = ATTR_VAL_REF_UNIT;\n      val->u.uint = read_uint32 (buf);\n      return 1;\n    case DW_FORM_ref8:\n      val->encoding = ATTR_VAL_REF_UNIT;\n      val->u.uint = read_uint64 (buf);\n      return 1;\n    case DW_FORM_ref_udata:\n      val->encoding = ATTR_VAL_REF_UNIT;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_indirect:\n      {\n\tuint64_t form;\n\n\tform = read_uleb128 (buf);\n\tif (form == DW_FORM_implicit_const)\n\t  {\n\t    dwarf_buf_error (buf,\n\t\t\t     \"DW_FORM_indirect to DW_FORM_implicit_const\",\n\t\t\t     0);\n\t    return 0;\n\t  }\n\treturn read_attribute ((enum dwarf_form) form, 0, buf, is_dwarf64,\n\t\t\t       version, addrsize, dwarf_sections, altlink,\n\t\t\t       val);\n      }\n    case DW_FORM_sec_offset:\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_offset (buf, is_dwarf64);\n      return 1;\n    case DW_FORM_exprloc:\n      val->encoding = ATTR_VAL_EXPR;\n      return advance (buf, read_uleb128 (buf));\n    case DW_FORM_flag_present:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = 1;\n      return 1;\n    case DW_FORM_ref_sig8:\n      val->encoding = ATTR_VAL_REF_TYPE;\n      val->u.uint = read_uint64 (buf);\n      return 1;\n    case DW_FORM_strx: case DW_FORM_strx1: case DW_FORM_strx2:\n    case DW_FORM_strx3: case DW_FORM_strx4:\n      {\n\tuint64_t offset;\n\n\tswitch (form)\n\t  {\n\t  case DW_FORM_strx:\n\t    offset = read_uleb128 (buf);\n\t    break;\n\t  case DW_FORM_strx1:\n\t    offset = read_byte (buf);\n\t    break;\n\t  case DW_FORM_strx2:\n\t    offset = read_uint16 (buf);\n\t    break;\n\t  case DW_FORM_strx3:\n\t    offset = read_uint24 (buf);\n\t    break;\n\t  case DW_FORM_strx4:\n\t    offset = read_uint32 (buf);\n\t    break;\n\t  default:\n\t    /* This case can't happen.  */\n\t    return 0;\n\t  }\n\tval->encoding = ATTR_VAL_STRING_INDEX;\n\tval->u.uint = offset;\n\treturn 1;\n      }\n    case DW_FORM_addrx: case DW_FORM_addrx1: case DW_FORM_addrx2:\n    case DW_FORM_addrx3: case DW_FORM_addrx4:\n      {\n\tuint64_t offset;\n\n\tswitch (form)\n\t  {\n\t  case DW_FORM_addrx:\n\t    offset = read_uleb128 (buf);\n\t    break;\n\t  case DW_FORM_addrx1:\n\t    offset = read_byte (buf);\n\t    break;\n\t  case DW_FORM_addrx2:\n\t    offset = read_uint16 (buf);\n\t    break;\n\t  case DW_FORM_addrx3:\n\t    offset = read_uint24 (buf);\n\t    break;\n\t  case DW_FORM_addrx4:\n\t    offset = read_uint32 (buf);\n\t    break;\n\t  default:\n\t    /* This case can't happen.  */\n\t    return 0;\n\t  }\n\tval->encoding = ATTR_VAL_ADDRESS_INDEX;\n\tval->u.uint = offset;\n\treturn 1;\n      }\n    case DW_FORM_ref_sup4:\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_uint32 (buf);\n      return 1;\n    case DW_FORM_ref_sup8:\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_uint64 (buf);\n      return 1;\n    case DW_FORM_implicit_const:\n      val->encoding = ATTR_VAL_UINT;\n      val->u.uint = implicit_val;\n      return 1;\n    case DW_FORM_loclistx:\n      /* We don't distinguish this from DW_FORM_sec_offset.  It\n       * shouldn't matter since we don't care about loclists.  */\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_rnglistx:\n      val->encoding = ATTR_VAL_RNGLISTS_INDEX;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_GNU_addr_index:\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_GNU_str_index:\n      val->encoding = ATTR_VAL_REF_SECTION;\n      val->u.uint = read_uleb128 (buf);\n      return 1;\n    case DW_FORM_GNU_ref_alt:\n      val->u.uint = read_offset (buf, is_dwarf64);\n      if (altlink == NULL)\n\t{\n\t  val->encoding = ATTR_VAL_NONE;\n\t  return 1;\n\t}\n      val->encoding = ATTR_VAL_REF_ALT_INFO;\n      return 1;\n    case DW_FORM_strp_sup: case DW_FORM_GNU_strp_alt:\n      {\n\tuint64_t offset;\n\n\toffset = read_offset (buf, is_dwarf64);\n\tif (altlink == NULL)\n\t  {\n\t    val->encoding = ATTR_VAL_NONE;\n\t    return 1;\n\t  }\n\tif (offset >= altlink->dwarf_sections.size[DEBUG_STR])\n\t  {\n\t    dwarf_buf_error (buf, \"DW_FORM_strp_sup out of range\", 0);\n\t    return 0;\n\t  }\n\tval->encoding = ATTR_VAL_STRING;\n\tval->u.string =\n\t  (const char *) altlink->dwarf_sections.data[DEBUG_STR] + offset;\n\treturn 1;\n      }\n    default:\n      dwarf_buf_error (buf, \"unrecognized DWARF form\", -1);\n      return 0;\n    }\n}\n\n/* If we can determine the value of a string attribute, set *STRING to\n   point to the string.  Return 1 on success, 0 on error.  If we don't\n   know the value, we consider that a success, and we don't change\n   *STRING.  An error is only reported for some sort of out of range\n   offset.  */\n\nstatic int\nresolve_string (const struct dwarf_sections *dwarf_sections, int is_dwarf64,\n\t\tint is_bigendian, uint64_t str_offsets_base,\n\t\tconst struct attr_val *val,\n\t\tbacktrace_error_callback error_callback, void *data,\n\t\tconst char **string)\n{\n  switch (val->encoding)\n    {\n    case ATTR_VAL_STRING:\n      *string = val->u.string;\n      return 1;\n\n    case ATTR_VAL_STRING_INDEX:\n      {\n\tuint64_t offset;\n\tstruct dwarf_buf offset_buf;\n\n\toffset = val->u.uint * (is_dwarf64 ? 8 : 4) + str_offsets_base;\n\tif (offset + (is_dwarf64 ? 8 : 4)\n\t    > dwarf_sections->size[DEBUG_STR_OFFSETS])\n\t  {\n\t    error_callback (data, \"DW_FORM_strx value out of range\", 0);\n\t    return 0;\n\t  }\n\n\toffset_buf.name = \".debug_str_offsets\";\n\toffset_buf.start = dwarf_sections->data[DEBUG_STR_OFFSETS];\n\toffset_buf.buf = dwarf_sections->data[DEBUG_STR_OFFSETS] + offset;\n\toffset_buf.left = dwarf_sections->size[DEBUG_STR_OFFSETS] - offset;\n\toffset_buf.is_bigendian = is_bigendian;\n\toffset_buf.error_callback = error_callback;\n\toffset_buf.data = data;\n\toffset_buf.reported_underflow = 0;\n\n\toffset = read_offset (&offset_buf, is_dwarf64);\n\tif (offset >= dwarf_sections->size[DEBUG_STR])\n\t  {\n\t    dwarf_buf_error (&offset_buf,\n\t\t\t     \"DW_FORM_strx offset out of range\",\n\t\t\t     0);\n\t    return 0;\n\t  }\n\t*string = (const char *) dwarf_sections->data[DEBUG_STR] + offset;\n\treturn 1;\n      }\n\n    default:\n      return 1;\n    }\n}\n\n/* Set *ADDRESS to the real address for a ATTR_VAL_ADDRESS_INDEX.\n   Return 1 on success, 0 on error.  */\n\nstatic int\nresolve_addr_index (const struct dwarf_sections *dwarf_sections,\n\t\t    uint64_t addr_base, int addrsize, int is_bigendian,\n\t\t    uint64_t addr_index,\n\t\t    backtrace_error_callback error_callback, void *data,\n\t\t    uintptr_t *address)\n{\n  uint64_t offset;\n  struct dwarf_buf addr_buf;\n\n  offset = addr_index * addrsize + addr_base;\n  if (offset + addrsize > dwarf_sections->size[DEBUG_ADDR])\n    {\n      error_callback (data, \"DW_FORM_addrx value out of range\", 0);\n      return 0;\n    }\n\n  addr_buf.name = \".debug_addr\";\n  addr_buf.start = dwarf_sections->data[DEBUG_ADDR];\n  addr_buf.buf = dwarf_sections->data[DEBUG_ADDR] + offset;\n  addr_buf.left = dwarf_sections->size[DEBUG_ADDR] - offset;\n  addr_buf.is_bigendian = is_bigendian;\n  addr_buf.error_callback = error_callback;\n  addr_buf.data = data;\n  addr_buf.reported_underflow = 0;\n\n  *address = (uintptr_t) read_address (&addr_buf, addrsize);\n  return 1;\n}\n\n/* Compare a unit offset against a unit for bsearch.  */\n\nstatic int\nunits_search (const void *vkey, const void *ventry)\n{\n  const size_t *key = (const size_t *) vkey;\n  const struct unit *entry = *((const struct unit *const *) ventry);\n  size_t offset;\n\n  offset = *key;\n  if (offset < entry->low_offset)\n    return -1;\n  else if (offset >= entry->high_offset)\n    return 1;\n  else\n    return 0;\n}\n\n/* Find a unit in PU containing OFFSET.  */\n\nstatic struct unit *\nfind_unit (struct unit **pu, size_t units_count, size_t offset)\n{\n  struct unit **u;\n  u = bsearch (&offset, pu, units_count, sizeof (struct unit *), units_search);\n  return u == NULL ? NULL : *u;\n}\n\n/* Compare function_addrs for qsort.  When ranges are nested, make the\n   smallest one sort last.  */\n\nstatic int\nfunction_addrs_compare (const void *v1, const void *v2)\n{\n  const struct function_addrs *a1 = (const struct function_addrs *) v1;\n  const struct function_addrs *a2 = (const struct function_addrs *) v2;\n\n  if (a1->low < a2->low)\n    return -1;\n  if (a1->low > a2->low)\n    return 1;\n  if (a1->high < a2->high)\n    return 1;\n  if (a1->high > a2->high)\n    return -1;\n  return strcmp (a1->function->name, a2->function->name);\n}\n\n/* Compare a PC against a function_addrs for bsearch.  We always\n   allocate an entra entry at the end of the vector, so that this\n   routine can safely look at the next entry.  Note that if there are\n   multiple ranges containing PC, which one will be returned is\n   unpredictable.  We compensate for that in dwarf_fileline.  */\n\nstatic int\nfunction_addrs_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct function_addrs *entry = (const struct function_addrs *) ventry;\n  uintptr_t pc;\n\n  pc = *key;\n  if (pc < entry->low)\n    return -1;\n  else if (pc > (entry + 1)->low)\n    return 1;\n  else\n    return 0;\n}\n\n/* Add a new compilation unit address range to a vector.  This is\n   called via add_ranges.  Returns 1 on success, 0 on failure.  */\n\nstatic int\nadd_unit_addr (struct backtrace_state *state, void *rdata,\n\t       uintptr_t lowpc, uintptr_t highpc,\n\t       backtrace_error_callback error_callback, void *data,\n\t       void *pvec)\n{\n  struct unit *u = (struct unit *) rdata;\n  struct unit_addrs_vector *vec = (struct unit_addrs_vector *) pvec;\n  struct unit_addrs *p;\n\n  /* Try to merge with the last entry.  */\n  if (vec->count > 0)\n    {\n      p = (struct unit_addrs *) vec->vec.base + (vec->count - 1);\n      if ((lowpc == p->high || lowpc == p->high + 1)\n\t  && u == p->u)\n\t{\n\t  if (highpc > p->high)\n\t    p->high = highpc;\n\t  return 1;\n\t}\n    }\n\n  p = ((struct unit_addrs *)\n       backtrace_vector_grow (state, sizeof (struct unit_addrs),\n\t\t\t      error_callback, data, &vec->vec));\n  if (p == NULL)\n    return 0;\n\n  p->low = lowpc;\n  p->high = highpc;\n  p->u = u;\n\n  ++vec->count;\n\n  return 1;\n}\n\n/* Compare unit_addrs for qsort.  When ranges are nested, make the\n   smallest one sort last.  */\n\nstatic int\nunit_addrs_compare (const void *v1, const void *v2)\n{\n  const struct unit_addrs *a1 = (const struct unit_addrs *) v1;\n  const struct unit_addrs *a2 = (const struct unit_addrs *) v2;\n\n  if (a1->low < a2->low)\n    return -1;\n  if (a1->low > a2->low)\n    return 1;\n  if (a1->high < a2->high)\n    return 1;\n  if (a1->high > a2->high)\n    return -1;\n  if (a1->u->lineoff < a2->u->lineoff)\n    return -1;\n  if (a1->u->lineoff > a2->u->lineoff)\n    return 1;\n  return 0;\n}\n\n/* Compare a PC against a unit_addrs for bsearch.  We always allocate\n   an entry entry at the end of the vector, so that this routine can\n   safely look at the next entry.  Note that if there are multiple\n   ranges containing PC, which one will be returned is unpredictable.\n   We compensate for that in dwarf_fileline.  */\n\nstatic int\nunit_addrs_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct unit_addrs *entry = (const struct unit_addrs *) ventry;\n  uintptr_t pc;\n\n  pc = *key;\n  if (pc < entry->low)\n    return -1;\n  else if (pc > (entry + 1)->low)\n    return 1;\n  else\n    return 0;\n}\n\n/* Sort the line vector by PC.  We want a stable sort here to maintain\n   the order of lines for the same PC values.  Since the sequence is\n   being sorted in place, their addresses cannot be relied on to\n   maintain stability.  That is the purpose of the index member.  */\n\nstatic int\nline_compare (const void *v1, const void *v2)\n{\n  const struct line *ln1 = (const struct line *) v1;\n  const struct line *ln2 = (const struct line *) v2;\n\n  if (ln1->pc < ln2->pc)\n    return -1;\n  else if (ln1->pc > ln2->pc)\n    return 1;\n  else if (ln1->idx < ln2->idx)\n    return -1;\n  else if (ln1->idx > ln2->idx)\n    return 1;\n  else\n    return 0;\n}\n\n/* Find a PC in a line vector.  We always allocate an extra entry at\n   the end of the lines vector, so that this routine can safely look\n   at the next entry.  Note that when there are multiple mappings for\n   the same PC value, this will return the last one.  */\n\nstatic int\nline_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct line *entry = (const struct line *) ventry;\n  uintptr_t pc;\n\n  pc = *key;\n  if (pc < entry->pc)\n    return -1;\n  else if (pc >= (entry + 1)->pc)\n    return 1;\n  else\n    return 0;\n}\n\n/* Sort the abbrevs by the abbrev code.  This function is passed to\n   both qsort and bsearch.  */\n\nstatic int\nabbrev_compare (const void *v1, const void *v2)\n{\n  const struct abbrev *a1 = (const struct abbrev *) v1;\n  const struct abbrev *a2 = (const struct abbrev *) v2;\n\n  if (a1->code < a2->code)\n    return -1;\n  else if (a1->code > a2->code)\n    return 1;\n  else\n    {\n      /* This really shouldn't happen.  It means there are two\n\t different abbrevs with the same code, and that means we don't\n\t know which one lookup_abbrev should return.  */\n      return 0;\n    }\n}\n\n/* Read the abbreviation table for a compilation unit.  Returns 1 on\n   success, 0 on failure.  */\n\nstatic int\nread_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset,\n\t      const unsigned char *dwarf_abbrev, size_t dwarf_abbrev_size,\n\t      int is_bigendian, backtrace_error_callback error_callback,\n\t      void *data, struct abbrevs *abbrevs)\n{\n  struct dwarf_buf abbrev_buf;\n  struct dwarf_buf count_buf;\n  size_t num_abbrevs;\n\n  abbrevs->num_abbrevs = 0;\n  abbrevs->abbrevs = NULL;\n\n  if (abbrev_offset >= dwarf_abbrev_size)\n    {\n      error_callback (data, \"abbrev offset out of range\", 0);\n      return 0;\n    }\n\n  abbrev_buf.name = \".debug_abbrev\";\n  abbrev_buf.start = dwarf_abbrev;\n  abbrev_buf.buf = dwarf_abbrev + abbrev_offset;\n  abbrev_buf.left = dwarf_abbrev_size - abbrev_offset;\n  abbrev_buf.is_bigendian = is_bigendian;\n  abbrev_buf.error_callback = error_callback;\n  abbrev_buf.data = data;\n  abbrev_buf.reported_underflow = 0;\n\n  /* Count the number of abbrevs in this list.  */\n\n  count_buf = abbrev_buf;\n  num_abbrevs = 0;\n  while (read_uleb128 (&count_buf) != 0)\n    {\n      if (count_buf.reported_underflow)\n\treturn 0;\n      ++num_abbrevs;\n      // Skip tag.\n      read_uleb128 (&count_buf);\n      // Skip has_children.\n      read_byte (&count_buf);\n      // Skip attributes.\n      while (read_uleb128 (&count_buf) != 0)\n\t{\n\t  uint64_t form;\n\n\t  form = read_uleb128 (&count_buf);\n\t  if ((enum dwarf_form) form == DW_FORM_implicit_const)\n\t    read_sleb128 (&count_buf);\n\t}\n      // Skip form of last attribute.\n      read_uleb128 (&count_buf);\n    }\n\n  if (count_buf.reported_underflow)\n    return 0;\n\n  if (num_abbrevs == 0)\n    return 1;\n\n  abbrevs->abbrevs = ((struct abbrev *)\n\t\t      backtrace_alloc (state,\n\t\t\t\t       num_abbrevs * sizeof (struct abbrev),\n\t\t\t\t       error_callback, data));\n  if (abbrevs->abbrevs == NULL)\n    return 0;\n  abbrevs->num_abbrevs = num_abbrevs;\n  memset (abbrevs->abbrevs, 0, num_abbrevs * sizeof (struct abbrev));\n\n  num_abbrevs = 0;\n  while (1)\n    {\n      uint64_t code;\n      struct abbrev a;\n      size_t num_attrs;\n      struct attr *attrs;\n\n      if (abbrev_buf.reported_underflow)\n\tgoto fail;\n\n      code = read_uleb128 (&abbrev_buf);\n      if (code == 0)\n\tbreak;\n\n      a.code = code;\n      a.tag = (enum dwarf_tag) read_uleb128 (&abbrev_buf);\n      a.has_children = read_byte (&abbrev_buf);\n\n      count_buf = abbrev_buf;\n      num_attrs = 0;\n      while (read_uleb128 (&count_buf) != 0)\n\t{\n\t  uint64_t form;\n\n\t  ++num_attrs;\n\t  form = read_uleb128 (&count_buf);\n\t  if ((enum dwarf_form) form == DW_FORM_implicit_const)\n\t    read_sleb128 (&count_buf);\n\t}\n\n      if (num_attrs == 0)\n\t{\n\t  attrs = NULL;\n\t  read_uleb128 (&abbrev_buf);\n\t  read_uleb128 (&abbrev_buf);\n\t}\n      else\n\t{\n\t  attrs = ((struct attr *)\n\t\t   backtrace_alloc (state, num_attrs * sizeof *attrs,\n\t\t\t\t    error_callback, data));\n\t  if (attrs == NULL)\n\t    goto fail;\n\t  num_attrs = 0;\n\t  while (1)\n\t    {\n\t      uint64_t name;\n\t      uint64_t form;\n\n\t      name = read_uleb128 (&abbrev_buf);\n\t      form = read_uleb128 (&abbrev_buf);\n\t      if (name == 0)\n\t\tbreak;\n\t      attrs[num_attrs].name = (enum dwarf_attribute) name;\n\t      attrs[num_attrs].form = (enum dwarf_form) form;\n\t      if ((enum dwarf_form) form == DW_FORM_implicit_const)\n\t\tattrs[num_attrs].val = read_sleb128 (&abbrev_buf);\n\t      else\n\t\tattrs[num_attrs].val = 0;\n\t      ++num_attrs;\n\t    }\n\t}\n\n      a.num_attrs = num_attrs;\n      a.attrs = attrs;\n\n      abbrevs->abbrevs[num_abbrevs] = a;\n      ++num_abbrevs;\n    }\n\n  backtrace_qsort (abbrevs->abbrevs, abbrevs->num_abbrevs,\n\t\t   sizeof (struct abbrev), abbrev_compare);\n\n  return 1;\n\n fail:\n  free_abbrevs (state, abbrevs, error_callback, data);\n  return 0;\n}\n\n/* Return the abbrev information for an abbrev code.  */\n\nstatic const struct abbrev *\nlookup_abbrev (struct abbrevs *abbrevs, uint64_t code,\n\t       backtrace_error_callback error_callback, void *data)\n{\n  struct abbrev key;\n  void *p;\n\n  /* With GCC, where abbrevs are simply numbered in order, we should\n     be able to just look up the entry.  */\n  if (code - 1 < abbrevs->num_abbrevs\n      && abbrevs->abbrevs[code - 1].code == code)\n    return &abbrevs->abbrevs[code - 1];\n\n  /* Otherwise we have to search.  */\n  memset (&key, 0, sizeof key);\n  key.code = code;\n  p = bsearch (&key, abbrevs->abbrevs, abbrevs->num_abbrevs,\n\t       sizeof (struct abbrev), abbrev_compare);\n  if (p == NULL)\n    {\n      error_callback (data, \"invalid abbreviation code\", 0);\n      return NULL;\n    }\n  return (const struct abbrev *) p;\n}\n\n/* This struct is used to gather address range information while\n   reading attributes.  We use this while building a mapping from\n   address ranges to compilation units and then again while mapping\n   from address ranges to function entries.  Normally either\n   lowpc/highpc is set or ranges is set.  */\n\nstruct pcrange {\n  uintptr_t lowpc;             /* The low PC value.  */\n  int have_lowpc;\t\t/* Whether a low PC value was found.  */\n  int lowpc_is_addr_index;\t/* Whether lowpc is in .debug_addr.  */\n  uintptr_t highpc;            /* The high PC value.  */\n  int have_highpc;\t\t/* Whether a high PC value was found.  */\n  int highpc_is_relative;\t/* Whether highpc is relative to lowpc.  */\n  int highpc_is_addr_index;\t/* Whether highpc is in .debug_addr.  */\n  uint64_t ranges;\t\t/* Offset in ranges section.  */\n  int have_ranges;\t\t/* Whether ranges is valid.  */\n  int ranges_is_index;\t\t/* Whether ranges is DW_FORM_rnglistx.  */\n};\n\n/* Update PCRANGE from an attribute value.  */\n\nstatic void\nupdate_pcrange (const struct attr* attr, const struct attr_val* val,\n\t\tstruct pcrange *pcrange)\n{\n  switch (attr->name)\n    {\n    case DW_AT_low_pc:\n      if (val->encoding == ATTR_VAL_ADDRESS)\n\t{\n\t  pcrange->lowpc = (uintptr_t) val->u.uint;\n\t  pcrange->have_lowpc = 1;\n\t}\n      else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)\n\t{\n\t  pcrange->lowpc = (uintptr_t) val->u.uint;\n\t  pcrange->have_lowpc = 1;\n\t  pcrange->lowpc_is_addr_index = 1;\n\t}\n      break;\n\n    case DW_AT_high_pc:\n      if (val->encoding == ATTR_VAL_ADDRESS)\n\t{\n\t  pcrange->highpc = (uintptr_t) val->u.uint;\n\t  pcrange->have_highpc = 1;\n\t}\n      else if (val->encoding == ATTR_VAL_UINT)\n\t{\n\t  pcrange->highpc = (uintptr_t) val->u.uint;\n\t  pcrange->have_highpc = 1;\n\t  pcrange->highpc_is_relative = 1;\n\t}\n      else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)\n\t{\n\t  pcrange->highpc = (uintptr_t) val->u.uint;\n\t  pcrange->have_highpc = 1;\n\t  pcrange->highpc_is_addr_index = 1;\n\t}\n      break;\n\n    case DW_AT_ranges:\n      if (val->encoding == ATTR_VAL_UINT\n\t  || val->encoding == ATTR_VAL_REF_SECTION)\n\t{\n\t  pcrange->ranges = val->u.uint;\n\t  pcrange->have_ranges = 1;\n\t}\n      else if (val->encoding == ATTR_VAL_RNGLISTS_INDEX)\n\t{\n\t  pcrange->ranges = val->u.uint;\n\t  pcrange->have_ranges = 1;\n\t  pcrange->ranges_is_index = 1;\n\t}\n      break;\n\n    default:\n      break;\n    }\n}\n\n/* Call ADD_RANGE for a low/high PC pair.  Returns 1 on success, 0 on\n  error.  */\n\nstatic int\nadd_low_high_range (struct backtrace_state *state,\n\t\t    const struct dwarf_sections *dwarf_sections,\n\t\t    uintptr_t base_address, int is_bigendian,\n\t\t    struct unit *u, const struct pcrange *pcrange,\n\t\t    int (*add_range) (struct backtrace_state *state,\n\t\t\t\t      void *rdata, uintptr_t lowpc,\n\t\t\t\t      uintptr_t highpc,\n\t\t\t\t      backtrace_error_callback error_callback,\n\t\t\t\t      void *data, void *vec),\n\t\t    void *rdata,\n\t\t    backtrace_error_callback error_callback, void *data,\n\t\t    void *vec)\n{\n  uintptr_t lowpc;\n  uintptr_t highpc;\n\n  lowpc = pcrange->lowpc;\n  if (pcrange->lowpc_is_addr_index)\n    {\n      if (!resolve_addr_index (dwarf_sections, u->addr_base, u->addrsize,\n\t\t\t       is_bigendian, lowpc, error_callback, data,\n\t\t\t       &lowpc))\n\treturn 0;\n    }\n\n  highpc = pcrange->highpc;\n  if (pcrange->highpc_is_addr_index)\n    {\n      if (!resolve_addr_index (dwarf_sections, u->addr_base, u->addrsize,\n\t\t\t       is_bigendian, highpc, error_callback, data,\n\t\t\t       &highpc))\n\treturn 0;\n    }\n  if (pcrange->highpc_is_relative)\n    highpc += lowpc;\n\n  /* Add in the base address of the module when recording PC values,\n     so that we can look up the PC directly.  */\n  lowpc += base_address;\n  highpc += base_address;\n\n  return add_range (state, rdata, lowpc, highpc, error_callback, data, vec);\n}\n\n/* Call ADD_RANGE for each range read from .debug_ranges, as used in\n   DWARF versions 2 through 4.  */\n\nstatic int\nadd_ranges_from_ranges (\n    struct backtrace_state *state,\n    const struct dwarf_sections *dwarf_sections,\n    uintptr_t base_address, int is_bigendian,\n    struct unit *u, uintptr_t base,\n    const struct pcrange *pcrange,\n    int (*add_range) (struct backtrace_state *state, void *rdata,\n\t\t      uintptr_t lowpc, uintptr_t highpc,\n\t\t      backtrace_error_callback error_callback, void *data,\n\t\t      void *vec),\n    void *rdata,\n    backtrace_error_callback error_callback, void *data,\n    void *vec)\n{\n  struct dwarf_buf ranges_buf;\n\n  if (pcrange->ranges >= dwarf_sections->size[DEBUG_RANGES])\n    {\n      error_callback (data, \"ranges offset out of range\", 0);\n      return 0;\n    }\n\n  ranges_buf.name = \".debug_ranges\";\n  ranges_buf.start = dwarf_sections->data[DEBUG_RANGES];\n  ranges_buf.buf = dwarf_sections->data[DEBUG_RANGES] + pcrange->ranges;\n  ranges_buf.left = dwarf_sections->size[DEBUG_RANGES] - pcrange->ranges;\n  ranges_buf.is_bigendian = is_bigendian;\n  ranges_buf.error_callback = error_callback;\n  ranges_buf.data = data;\n  ranges_buf.reported_underflow = 0;\n\n  while (1)\n    {\n      uint64_t low;\n      uint64_t high;\n\n      if (ranges_buf.reported_underflow)\n\treturn 0;\n\n      low = read_address (&ranges_buf, u->addrsize);\n      high = read_address (&ranges_buf, u->addrsize);\n\n      if (low == 0 && high == 0)\n\tbreak;\n\n      if (is_highest_address (low, u->addrsize))\n\tbase = (uintptr_t) high;\n      else\n\t{\n\t  if (!add_range (state, rdata, \n\t\t\t  (uintptr_t) low + base + base_address,\n\t\t\t  (uintptr_t) high + base + base_address,\n\t\t\t  error_callback, data, vec))\n\t    return 0;\n\t}\n    }\n\n  if (ranges_buf.reported_underflow)\n    return 0;\n\n  return 1;\n}\n\n/* Call ADD_RANGE for each range read from .debug_rnglists, as used in\n   DWARF version 5.  */\n\nstatic int\nadd_ranges_from_rnglists (\n    struct backtrace_state *state,\n    const struct dwarf_sections *dwarf_sections,\n    uintptr_t base_address, int is_bigendian,\n    struct unit *u, uintptr_t base,\n    const struct pcrange *pcrange,\n    int (*add_range) (struct backtrace_state *state, void *rdata,\n\t\t      uintptr_t lowpc, uintptr_t highpc,\n\t\t      backtrace_error_callback error_callback, void *data,\n\t\t      void *vec),\n    void *rdata,\n    backtrace_error_callback error_callback, void *data,\n    void *vec)\n{\n  uint64_t offset;\n  struct dwarf_buf rnglists_buf;\n\n  if (!pcrange->ranges_is_index)\n    offset = pcrange->ranges;\n  else\n    offset = u->rnglists_base + pcrange->ranges * (u->is_dwarf64 ? 8 : 4);\n  if (offset >= dwarf_sections->size[DEBUG_RNGLISTS])\n    {\n      error_callback (data, \"rnglists offset out of range\", 0);\n      return 0;\n    }\n\n  rnglists_buf.name = \".debug_rnglists\";\n  rnglists_buf.start = dwarf_sections->data[DEBUG_RNGLISTS];\n  rnglists_buf.buf = dwarf_sections->data[DEBUG_RNGLISTS] + offset;\n  rnglists_buf.left = dwarf_sections->size[DEBUG_RNGLISTS] - offset;\n  rnglists_buf.is_bigendian = is_bigendian;\n  rnglists_buf.error_callback = error_callback;\n  rnglists_buf.data = data;\n  rnglists_buf.reported_underflow = 0;\n\n  if (pcrange->ranges_is_index)\n    {\n      offset = read_offset (&rnglists_buf, u->is_dwarf64);\n      offset += u->rnglists_base;\n      if (offset >= dwarf_sections->size[DEBUG_RNGLISTS])\n\t{\n\t  error_callback (data, \"rnglists index offset out of range\", 0);\n\t  return 0;\n\t}\n      rnglists_buf.buf = dwarf_sections->data[DEBUG_RNGLISTS] + offset;\n      rnglists_buf.left = dwarf_sections->size[DEBUG_RNGLISTS] - offset;\n    }\n\n  while (1)\n    {\n      unsigned char rle;\n\n      rle = read_byte (&rnglists_buf);\n      if (rle == DW_RLE_end_of_list)\n\tbreak;\n      switch (rle)\n\t{\n\tcase DW_RLE_base_addressx:\n\t  {\n\t    uint64_t index;\n\n\t    index = read_uleb128 (&rnglists_buf);\n\t    if (!resolve_addr_index (dwarf_sections, u->addr_base,\n\t\t\t\t     u->addrsize, is_bigendian, index,\n\t\t\t\t     error_callback, data, &base))\n\t      return 0;\n\t  }\n\t  break;\n\n\tcase DW_RLE_startx_endx:\n\t  {\n\t    uint64_t index;\n\t    uintptr_t low;\n\t    uintptr_t high;\n\n\t    index = read_uleb128 (&rnglists_buf);\n\t    if (!resolve_addr_index (dwarf_sections, u->addr_base,\n\t\t\t\t     u->addrsize, is_bigendian, index,\n\t\t\t\t     error_callback, data, &low))\n\t      return 0;\n\t    index = read_uleb128 (&rnglists_buf);\n\t    if (!resolve_addr_index (dwarf_sections, u->addr_base,\n\t\t\t\t     u->addrsize, is_bigendian, index,\n\t\t\t\t     error_callback, data, &high))\n\t      return 0;\n\t    if (!add_range (state, rdata, low + base_address,\n\t\t\t    high + base_address, error_callback, data,\n\t\t\t    vec))\n\t      return 0;\n\t  }\n\t  break;\n\n\tcase DW_RLE_startx_length:\n\t  {\n\t    uint64_t index;\n\t    uintptr_t low;\n\t    uintptr_t length;\n\n\t    index = read_uleb128 (&rnglists_buf);\n\t    if (!resolve_addr_index (dwarf_sections, u->addr_base,\n\t\t\t\t     u->addrsize, is_bigendian, index,\n\t\t\t\t     error_callback, data, &low))\n\t      return 0;\n\t    length = read_uleb128 (&rnglists_buf);\n\t    low += base_address;\n\t    if (!add_range (state, rdata, low, low + length,\n\t\t\t    error_callback, data, vec))\n\t      return 0;\n\t  }\n\t  break;\n\n\tcase DW_RLE_offset_pair:\n\t  {\n\t    uint64_t low;\n\t    uint64_t high;\n\n\t    low = read_uleb128 (&rnglists_buf);\n\t    high = read_uleb128 (&rnglists_buf);\n\t    if (!add_range (state, rdata, low + base + base_address,\n\t\t\t    high + base + base_address,\n\t\t\t    error_callback, data, vec))\n\t      return 0;\n\t  }\n\t  break;\n\n\tcase DW_RLE_base_address:\n\t  base = (uintptr_t) read_address (&rnglists_buf, u->addrsize);\n\t  break;\n\n\tcase DW_RLE_start_end:\n\t  {\n\t    uintptr_t low;\n\t    uintptr_t high;\n\n\t    low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);\n\t    high = (uintptr_t) read_address (&rnglists_buf, u->addrsize);\n\t    if (!add_range (state, rdata, low + base_address,\n\t\t\t    high + base_address, error_callback, data,\n\t\t\t    vec))\n\t      return 0;\n\t  }\n\t  break;\n\n\tcase DW_RLE_start_length:\n\t  {\n\t    uintptr_t low;\n\t    uintptr_t length;\n\n\t    low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);\n\t    length = (uintptr_t) read_uleb128 (&rnglists_buf);\n\t    low += base_address;\n\t    if (!add_range (state, rdata, low, low + length,\n\t\t\t    error_callback, data, vec))\n\t      return 0;\n\t  }\n\t  break;\n\n\tdefault:\n\t  dwarf_buf_error (&rnglists_buf, \"unrecognized DW_RLE value\", -1);\n\t  return 0;\n\t}\n    }\n\n  if (rnglists_buf.reported_underflow)\n    return 0;\n\n  return 1;\n}\n\n/* Call ADD_RANGE for each lowpc/highpc pair in PCRANGE.  RDATA is\n   passed to ADD_RANGE, and is either a struct unit * or a struct\n   function *.  VEC is the vector we are adding ranges to, and is\n   either a struct unit_addrs_vector * or a struct function_vector *.\n   Returns 1 on success, 0 on error.  */\n\nstatic int\nadd_ranges (struct backtrace_state *state,\n\t    const struct dwarf_sections *dwarf_sections,\n\t    uintptr_t base_address, int is_bigendian,\n\t    struct unit *u, uintptr_t base, const struct pcrange *pcrange,\n\t    int (*add_range) (struct backtrace_state *state, void *rdata, \n\t\t\t      uintptr_t lowpc, uintptr_t highpc,\n\t\t\t      backtrace_error_callback error_callback,\n\t\t\t      void *data, void *vec),\n\t    void *rdata,\n\t    backtrace_error_callback error_callback, void *data,\n\t    void *vec)\n{\n  if (pcrange->have_lowpc && pcrange->have_highpc)\n    return add_low_high_range (state, dwarf_sections, base_address,\n\t\t\t       is_bigendian, u, pcrange, add_range, rdata,\n\t\t\t       error_callback, data, vec);\n\n  if (!pcrange->have_ranges)\n    {\n      /* Did not find any address ranges to add.  */\n      return 1;\n    }\n\n  if (u->version < 5)\n    return add_ranges_from_ranges (state, dwarf_sections, base_address,\n\t\t\t\t   is_bigendian, u, base, pcrange, add_range,\n\t\t\t\t   rdata, error_callback, data, vec);\n  else\n    return add_ranges_from_rnglists (state, dwarf_sections, base_address,\n\t\t\t\t     is_bigendian, u, base, pcrange, add_range,\n\t\t\t\t     rdata, error_callback, data, vec);\n}\n\n/* Find the address range covered by a compilation unit, reading from\n   UNIT_BUF and adding values to U.  Returns 1 if all data could be\n   read, 0 if there is some error.  */\n\nstatic int\nfind_address_ranges (struct backtrace_state *state, uintptr_t base_address,\n\t\t     struct dwarf_buf *unit_buf,\n\t\t     const struct dwarf_sections *dwarf_sections,\n\t\t     int is_bigendian, struct dwarf_data *altlink,\n\t\t     backtrace_error_callback error_callback, void *data,\n\t\t     struct unit *u, struct unit_addrs_vector *addrs,\n\t\t     enum dwarf_tag *unit_tag)\n{\n  while (unit_buf->left > 0)\n    {\n      uint64_t code;\n      const struct abbrev *abbrev;\n      struct pcrange pcrange;\n      struct attr_val name_val;\n      int have_name_val;\n      struct attr_val comp_dir_val;\n      int have_comp_dir_val;\n      size_t i;\n\n      code = read_uleb128 (unit_buf);\n      if (code == 0)\n\treturn 1;\n\n      abbrev = lookup_abbrev (&u->abbrevs, code, error_callback, data);\n      if (abbrev == NULL)\n\treturn 0;\n\n      if (unit_tag != NULL)\n\t*unit_tag = abbrev->tag;\n\n      memset (&pcrange, 0, sizeof pcrange);\n      memset (&name_val, 0, sizeof name_val);\n      have_name_val = 0;\n      memset (&comp_dir_val, 0, sizeof comp_dir_val);\n      have_comp_dir_val = 0;\n      for (i = 0; i < abbrev->num_attrs; ++i)\n\t{\n\t  struct attr_val val;\n\n\t  if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val,\n\t\t\t       unit_buf, u->is_dwarf64, u->version,\n\t\t\t       u->addrsize, dwarf_sections, altlink, &val))\n\t    return 0;\n\n\t  switch (abbrev->attrs[i].name)\n\t    {\n\t    case DW_AT_low_pc: case DW_AT_high_pc: case DW_AT_ranges:\n\t      update_pcrange (&abbrev->attrs[i], &val, &pcrange);\n\t      break;\n\n\t    case DW_AT_stmt_list:\n\t      if ((abbrev->tag == DW_TAG_compile_unit\n\t\t   || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t  && (val.encoding == ATTR_VAL_UINT\n\t\t      || val.encoding == ATTR_VAL_REF_SECTION))\n\t\tu->lineoff = val.u.uint;\n\t      break;\n\n\t    case DW_AT_name:\n\t      if (abbrev->tag == DW_TAG_compile_unit\n\t\t  || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t{\n\t\t  name_val = val;\n\t\t  have_name_val = 1;\n\t\t}\n\t      break;\n\n\t    case DW_AT_comp_dir:\n\t      if (abbrev->tag == DW_TAG_compile_unit\n\t\t  || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t{\n\t\t  comp_dir_val = val;\n\t\t  have_comp_dir_val = 1;\n\t\t}\n\t      break;\n\n\t    case DW_AT_str_offsets_base:\n\t      if ((abbrev->tag == DW_TAG_compile_unit\n\t\t   || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t  && val.encoding == ATTR_VAL_REF_SECTION)\n\t\tu->str_offsets_base = val.u.uint;\n\t      break;\n\n\t    case DW_AT_addr_base:\n\t      if ((abbrev->tag == DW_TAG_compile_unit\n\t\t   || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t  && val.encoding == ATTR_VAL_REF_SECTION)\n\t\tu->addr_base = val.u.uint;\n\t      break;\n\n\t    case DW_AT_rnglists_base:\n\t      if ((abbrev->tag == DW_TAG_compile_unit\n\t\t   || abbrev->tag == DW_TAG_skeleton_unit)\n\t\t  && val.encoding == ATTR_VAL_REF_SECTION)\n\t\tu->rnglists_base = val.u.uint;\n\t      break;\n\n\t    default:\n\t      break;\n\t    }\n\t}\n\n      // Resolve strings after we're sure that we have seen\n      // DW_AT_str_offsets_base.\n      if (have_name_val)\n\t{\n\t  if (!resolve_string (dwarf_sections, u->is_dwarf64, is_bigendian,\n\t\t\t       u->str_offsets_base, &name_val,\n\t\t\t       error_callback, data, &u->filename))\n\t    return 0;\n\t}\n      if (have_comp_dir_val)\n\t{\n\t  if (!resolve_string (dwarf_sections, u->is_dwarf64, is_bigendian,\n\t\t\t       u->str_offsets_base, &comp_dir_val,\n\t\t\t       error_callback, data, &u->comp_dir))\n\t    return 0;\n\t}\n\n      if (abbrev->tag == DW_TAG_compile_unit\n\t  || abbrev->tag == DW_TAG_subprogram\n\t  || abbrev->tag == DW_TAG_skeleton_unit)\n\t{\n\t  if (!add_ranges (state, dwarf_sections, base_address,\n\t\t\t   is_bigendian, u, pcrange.lowpc, &pcrange,\n\t\t\t   add_unit_addr, (void *) u, error_callback, data,\n\t\t\t   (void *) addrs))\n\t    return 0;\n\n\t  /* If we found the PC range in the DW_TAG_compile_unit or\n\t     DW_TAG_skeleton_unit, we can stop now.  */\n\t  if ((abbrev->tag == DW_TAG_compile_unit\n\t       || abbrev->tag == DW_TAG_skeleton_unit)\n\t      && (pcrange.have_ranges\n\t\t  || (pcrange.have_lowpc && pcrange.have_highpc)))\n\t    return 1;\n\t}\n\n      if (abbrev->has_children)\n\t{\n\t  if (!find_address_ranges (state, base_address, unit_buf,\n\t\t\t\t    dwarf_sections, is_bigendian, altlink,\n\t\t\t\t    error_callback, data, u, addrs, NULL))\n\t    return 0;\n\t}\n    }\n\n  return 1;\n}\n\n/* Build a mapping from address ranges to the compilation units where\n   the line number information for that range can be found.  Returns 1\n   on success, 0 on failure.  */\n\nstatic int\nbuild_address_map (struct backtrace_state *state, uintptr_t base_address,\n\t\t   const struct dwarf_sections *dwarf_sections,\n\t\t   int is_bigendian, struct dwarf_data *altlink,\n\t\t   backtrace_error_callback error_callback, void *data,\n\t\t   struct unit_addrs_vector *addrs,\n\t\t   struct unit_vector *unit_vec)\n{\n  struct dwarf_buf info;\n  struct backtrace_vector units;\n  size_t units_count;\n  size_t i;\n  struct unit **pu;\n  size_t unit_offset = 0;\n  struct unit_addrs *pa;\n\n  memset (&addrs->vec, 0, sizeof addrs->vec);\n  memset (&unit_vec->vec, 0, sizeof unit_vec->vec);\n  addrs->count = 0;\n  unit_vec->count = 0;\n\n  /* Read through the .debug_info section.  FIXME: Should we use the\n     .debug_aranges section?  gdb and addr2line don't use it, but I'm\n     not sure why.  */\n\n  info.name = \".debug_info\";\n  info.start = dwarf_sections->data[DEBUG_INFO];\n  info.buf = info.start;\n  info.left = dwarf_sections->size[DEBUG_INFO];\n  info.is_bigendian = is_bigendian;\n  info.error_callback = error_callback;\n  info.data = data;\n  info.reported_underflow = 0;\n\n  memset (&units, 0, sizeof units);\n  units_count = 0;\n\n  while (info.left > 0)\n    {\n      const unsigned char *unit_data_start;\n      uint64_t len;\n      int is_dwarf64;\n      struct dwarf_buf unit_buf;\n      int version;\n      int unit_type;\n      uint64_t abbrev_offset;\n      int addrsize;\n      struct unit *u;\n      enum dwarf_tag unit_tag;\n\n      if (info.reported_underflow)\n\tgoto fail;\n\n      unit_data_start = info.buf;\n\n      len = read_initial_length (&info, &is_dwarf64);\n      unit_buf = info;\n      unit_buf.left = len;\n\n      if (!advance (&info, len))\n\tgoto fail;\n\n      version = read_uint16 (&unit_buf);\n      if (version < 2 || version > 5)\n\t{\n\t  dwarf_buf_error (&unit_buf, \"unrecognized DWARF version\", -1);\n\t  goto fail;\n\t}\n\n      if (version < 5)\n\tunit_type = 0;\n      else\n\t{\n\t  unit_type = read_byte (&unit_buf);\n\t  if (unit_type == DW_UT_type || unit_type == DW_UT_split_type)\n\t    {\n\t      /* This unit doesn't have anything we need.  */\n\t      continue;\n\t    }\n\t}\n\n      pu = ((struct unit **)\n\t    backtrace_vector_grow (state, sizeof (struct unit *),\n\t\t\t\t   error_callback, data, &units));\n      if (pu == NULL)\n\t  goto fail;\n\n      u = ((struct unit *)\n\t   backtrace_alloc (state, sizeof *u, error_callback, data));\n      if (u == NULL)\n\tgoto fail;\n\n      *pu = u;\n      ++units_count;\n\n      if (version < 5)\n\taddrsize = 0; /* Set below.  */\n      else\n\taddrsize = read_byte (&unit_buf);\n\n      memset (&u->abbrevs, 0, sizeof u->abbrevs);\n      abbrev_offset = read_offset (&unit_buf, is_dwarf64);\n      if (!read_abbrevs (state, abbrev_offset,\n\t\t\t dwarf_sections->data[DEBUG_ABBREV],\n\t\t\t dwarf_sections->size[DEBUG_ABBREV],\n\t\t\t is_bigendian, error_callback, data, &u->abbrevs))\n\tgoto fail;\n\n      if (version < 5)\n\taddrsize = read_byte (&unit_buf);\n\n      switch (unit_type)\n\t{\n\tcase 0:\n\t  break;\n\tcase DW_UT_compile: case DW_UT_partial:\n\t  break;\n\tcase DW_UT_skeleton: case DW_UT_split_compile:\n\t  read_uint64 (&unit_buf); /* dwo_id */\n\t  break;\n\tdefault:\n\t  break;\n\t}\n\n      u->low_offset = unit_offset;\n      unit_offset += len + (is_dwarf64 ? 12 : 4);\n      u->high_offset = unit_offset;\n      u->unit_data = unit_buf.buf;\n      u->unit_data_len = unit_buf.left;\n      u->unit_data_offset = unit_buf.buf - unit_data_start;\n      u->version = version;\n      u->is_dwarf64 = is_dwarf64;\n      u->addrsize = addrsize;\n      u->filename = NULL;\n      u->comp_dir = NULL;\n      u->abs_filename = NULL;\n      u->lineoff = 0;\n      u->str_offsets_base = 0;\n      u->addr_base = 0;\n      u->rnglists_base = 0;\n\n      /* The actual line number mappings will be read as needed.  */\n      u->lines = NULL;\n      u->lines_count = 0;\n      u->function_addrs = NULL;\n      u->function_addrs_count = 0;\n\n      if (!find_address_ranges (state, base_address, &unit_buf, dwarf_sections,\n\t\t\t\tis_bigendian, altlink, error_callback, data,\n\t\t\t\tu, addrs, &unit_tag))\n\tgoto fail;\n\n      if (unit_buf.reported_underflow)\n\tgoto fail;\n    }\n  if (info.reported_underflow)\n    goto fail;\n\n  /* Add a trailing addrs entry, but don't include it in addrs->count.  */\n  pa = ((struct unit_addrs *)\n\tbacktrace_vector_grow (state, sizeof (struct unit_addrs),\n\t\t\t       error_callback, data, &addrs->vec));\n  if (pa == NULL)\n    goto fail;\n  pa->low = 0;\n  --pa->low;\n  pa->high = pa->low;\n  pa->u = NULL;\n\n  unit_vec->vec = units;\n  unit_vec->count = units_count;\n  return 1;\n\n fail:\n  if (units_count > 0)\n    {\n      pu = (struct unit **) units.base;\n      for (i = 0; i < units_count; i++)\n\t{\n\t  free_abbrevs (state, &pu[i]->abbrevs, error_callback, data);\n\t  backtrace_free (state, pu[i], sizeof **pu, error_callback, data);\n\t}\n      backtrace_vector_free (state, &units, error_callback, data);\n    }\n  if (addrs->count > 0)\n    {\n      backtrace_vector_free (state, &addrs->vec, error_callback, data);\n      addrs->count = 0;\n    }\n  return 0;\n}\n\n/* Add a new mapping to the vector of line mappings that we are\n   building.  Returns 1 on success, 0 on failure.  */\n\nstatic int\nadd_line (struct backtrace_state *state, struct dwarf_data *ddata,\n\t  uintptr_t pc, const char *filename, int lineno,\n\t  backtrace_error_callback error_callback, void *data,\n\t  struct line_vector *vec)\n{\n  struct line *ln;\n\n  /* If we are adding the same mapping, ignore it.  This can happen\n     when using discriminators.  */\n  if (vec->count > 0)\n    {\n      ln = (struct line *) vec->vec.base + (vec->count - 1);\n      if (pc == ln->pc && filename == ln->filename && lineno == ln->lineno)\n\treturn 1;\n    }\n\n  ln = ((struct line *)\n\tbacktrace_vector_grow (state, sizeof (struct line), error_callback,\n\t\t\t       data, &vec->vec));\n  if (ln == NULL)\n    return 0;\n\n  /* Add in the base address here, so that we can look up the PC\n     directly.  */\n  ln->pc = pc + ddata->base_address;\n\n  ln->filename = filename;\n  ln->lineno = lineno;\n  ln->idx = vec->count;\n\n  ++vec->count;\n\n  return 1;\n}\n\n/* Free the line header information.  */\n\nstatic void\nfree_line_header (struct backtrace_state *state, struct line_header *hdr,\n\t\t  backtrace_error_callback error_callback, void *data)\n{\n  if (hdr->dirs_count != 0)\n    backtrace_free (state, hdr->dirs, hdr->dirs_count * sizeof (const char *),\n\t\t    error_callback, data);\n  backtrace_free (state, hdr->filenames,\n\t\t  hdr->filenames_count * sizeof (char *),\n\t\t  error_callback, data);\n}\n\n/* Read the directories and file names for a line header for version\n   2, setting fields in HDR.  Return 1 on success, 0 on failure.  */\n\nstatic int\nread_v2_paths (struct backtrace_state *state, struct unit *u,\n\t       struct dwarf_buf *hdr_buf, struct line_header *hdr)\n{\n  const unsigned char *p;\n  const unsigned char *pend;\n  size_t i;\n\n  /* Count the number of directory entries.  */\n  hdr->dirs_count = 0;\n  p = hdr_buf->buf;\n  pend = p + hdr_buf->left;\n  while (p < pend && *p != '\\0')\n    {\n      p += strnlen((const char *) p, pend - p) + 1;\n      ++hdr->dirs_count;\n    }\n\n  /* The index of the first entry in the list of directories is 1.  Index 0 is\n     used for the current directory of the compilation.  To simplify index\n     handling, we set entry 0 to the compilation unit directory.  */\n  ++hdr->dirs_count;\n  hdr->dirs = ((const char **)\n\t       backtrace_alloc (state,\n\t\t\t\thdr->dirs_count * sizeof (const char *),\n\t\t\t\thdr_buf->error_callback,\n\t\t\t\thdr_buf->data));\n  if (hdr->dirs == NULL)\n    return 0;\n\n  hdr->dirs[0] = u->comp_dir;\n  i = 1;\n  while (*hdr_buf->buf != '\\0')\n    {\n      if (hdr_buf->reported_underflow)\n\treturn 0;\n\n      hdr->dirs[i] = read_string (hdr_buf);\n      if (hdr->dirs[i] == NULL)\n\treturn 0;\n      ++i;\n    }\n  if (!advance (hdr_buf, 1))\n    return 0;\n\n  /* Count the number of file entries.  */\n  hdr->filenames_count = 0;\n  p = hdr_buf->buf;\n  pend = p + hdr_buf->left;\n  while (p < pend && *p != '\\0')\n    {\n      p += strnlen ((const char *) p, pend - p) + 1;\n      p += leb128_len (p);\n      p += leb128_len (p);\n      p += leb128_len (p);\n      ++hdr->filenames_count;\n    }\n\n  /* The index of the first entry in the list of file names is 1.  Index 0 is\n     used for the DW_AT_name of the compilation unit.  To simplify index\n     handling, we set entry 0 to the compilation unit file name.  */\n  ++hdr->filenames_count;\n  hdr->filenames = ((const char **)\n\t\t    backtrace_alloc (state,\n\t\t\t\t     hdr->filenames_count * sizeof (char *),\n\t\t\t\t     hdr_buf->error_callback,\n\t\t\t\t     hdr_buf->data));\n  if (hdr->filenames == NULL)\n    return 0;\n  hdr->filenames[0] = u->filename;\n  i = 1;\n  while (*hdr_buf->buf != '\\0')\n    {\n      const char *filename;\n      uint64_t dir_index;\n\n      if (hdr_buf->reported_underflow)\n\treturn 0;\n\n      filename = read_string (hdr_buf);\n      if (filename == NULL)\n\treturn 0;\n      dir_index = read_uleb128 (hdr_buf);\n      if (IS_ABSOLUTE_PATH (filename)\n\t  || (dir_index < hdr->dirs_count && hdr->dirs[dir_index] == NULL))\n\thdr->filenames[i] = filename;\n      else\n\t{\n\t  const char *dir;\n\t  size_t dir_len;\n\t  size_t filename_len;\n\t  char *s;\n\n\t  if (dir_index < hdr->dirs_count)\n\t    dir = hdr->dirs[dir_index];\n\t  else\n\t    {\n\t      dwarf_buf_error (hdr_buf,\n\t\t\t       (\"invalid directory index in \"\n\t\t\t\t\"line number program header\"),\n\t\t\t       0);\n\t      return 0;\n\t    }\n\t  dir_len = strlen (dir);\n\t  filename_len = strlen (filename);\n\t  s = ((char *) backtrace_alloc (state, dir_len + filename_len + 2,\n\t\t\t\t\t hdr_buf->error_callback,\n\t\t\t\t\t hdr_buf->data));\n\t  if (s == NULL)\n\t    return 0;\n\t  memcpy (s, dir, dir_len);\n\t  /* FIXME: If we are on a DOS-based file system, and the\n\t     directory or the file name use backslashes, then we\n\t     should use a backslash here.  */\n\t  s[dir_len] = '/';\n\t  memcpy (s + dir_len + 1, filename, filename_len + 1);\n\t  hdr->filenames[i] = s;\n\t}\n\n      /* Ignore the modification time and size.  */\n      read_uleb128 (hdr_buf);\n      read_uleb128 (hdr_buf);\n\n      ++i;\n    }\n\n  return 1;\n}\n\n/* Read a single version 5 LNCT entry for a directory or file name in a\n   line header.  Sets *STRING to the resulting name, ignoring other\n   data.  Return 1 on success, 0 on failure.  */\n\nstatic int\nread_lnct (struct backtrace_state *state, struct dwarf_data *ddata,\n\t   struct unit *u, struct dwarf_buf *hdr_buf,\n\t   const struct line_header *hdr, size_t formats_count,\n\t   const struct line_header_format *formats, const char **string)\n{\n  size_t i;\n  const char *dir;\n  const char *path;\n\n  dir = NULL;\n  path = NULL;\n  for (i = 0; i < formats_count; i++)\n    {\n      struct attr_val val;\n\n      if (!read_attribute (formats[i].form, 0, hdr_buf, u->is_dwarf64,\n\t\t\t   u->version, hdr->addrsize, &ddata->dwarf_sections,\n\t\t\t   ddata->altlink, &val))\n\treturn 0;\n      switch (formats[i].lnct)\n\t{\n\tcase DW_LNCT_path:\n\t  if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64,\n\t\t\t       ddata->is_bigendian, u->str_offsets_base,\n\t\t\t       &val, hdr_buf->error_callback, hdr_buf->data,\n\t\t\t       &path))\n\t    return 0;\n\t  break;\n\tcase DW_LNCT_directory_index:\n\t  if (val.encoding == ATTR_VAL_UINT)\n\t    {\n\t      if (val.u.uint >= hdr->dirs_count)\n\t\t{\n\t\t  dwarf_buf_error (hdr_buf,\n\t\t\t\t   (\"invalid directory index in \"\n\t\t\t\t    \"line number program header\"),\n\t\t\t\t   0);\n\t\t  return 0;\n\t\t}\n\t      dir = hdr->dirs[val.u.uint];\n\t    }\n\t  break;\n\tdefault:\n\t  /* We don't care about timestamps or sizes or hashes.  */\n\t  break;\n\t}\n    }\n\n  if (path == NULL)\n    {\n      dwarf_buf_error (hdr_buf,\n\t\t       \"missing file name in line number program header\",\n\t\t       0);\n      return 0;\n    }\n\n  if (dir == NULL)\n    *string = path;\n  else\n    {\n      size_t dir_len;\n      size_t path_len;\n      char *s;\n\n      dir_len = strlen (dir);\n      path_len = strlen (path);\n      s = (char *) backtrace_alloc (state, dir_len + path_len + 2,\n\t\t\t\t    hdr_buf->error_callback, hdr_buf->data);\n      if (s == NULL)\n\treturn 0;\n      memcpy (s, dir, dir_len);\n      /* FIXME: If we are on a DOS-based file system, and the\n\t directory or the path name use backslashes, then we should\n\t use a backslash here.  */\n      s[dir_len] = '/';\n      memcpy (s + dir_len + 1, path, path_len + 1);\n      *string = s;\n    }\n\n  return 1;\n}\n\n/* Read a set of DWARF 5 line header format entries, setting *PCOUNT\n   and *PPATHS.  Return 1 on success, 0 on failure.  */\n\nstatic int\nread_line_header_format_entries (struct backtrace_state *state,\n\t\t\t\t struct dwarf_data *ddata,\n\t\t\t\t struct unit *u,\n\t\t\t\t struct dwarf_buf *hdr_buf,\n\t\t\t\t struct line_header *hdr,\n\t\t\t\t size_t *pcount,\n\t\t\t\t const char ***ppaths)\n{\n  size_t formats_count;\n  struct line_header_format *formats;\n  size_t paths_count;\n  const char **paths;\n  size_t i;\n  int ret;\n\n  formats_count = read_byte (hdr_buf);\n  if (formats_count == 0)\n    formats = NULL;\n  else\n    {\n      formats = ((struct line_header_format *)\n\t\t backtrace_alloc (state,\n\t\t\t\t  (formats_count\n\t\t\t\t   * sizeof (struct line_header_format)),\n\t\t\t\t  hdr_buf->error_callback,\n\t\t\t\t  hdr_buf->data));\n      if (formats == NULL)\n\treturn 0;\n\n      for (i = 0; i < formats_count; i++)\n\t{\n\t  formats[i].lnct = (int) read_uleb128(hdr_buf);\n\t  formats[i].form = (enum dwarf_form) read_uleb128 (hdr_buf);\n\t}\n    }\n\n  paths_count = read_uleb128 (hdr_buf);\n  if (paths_count == 0)\n    {\n      *pcount = 0;\n      *ppaths = NULL;\n      ret = 1;\n      goto exit;\n    }\n\n  paths = ((const char **)\n\t   backtrace_alloc (state, paths_count * sizeof (const char *),\n\t\t\t    hdr_buf->error_callback, hdr_buf->data));\n  if (paths == NULL)\n    {\n      ret = 0;\n      goto exit;\n    }\n  for (i = 0; i < paths_count; i++)\n    {\n      if (!read_lnct (state, ddata, u, hdr_buf, hdr, formats_count,\n\t\t      formats, &paths[i]))\n\t{\n\t  backtrace_free (state, paths,\n\t\t\t  paths_count * sizeof (const char *),\n\t\t\t  hdr_buf->error_callback, hdr_buf->data);\n\t  ret = 0;\n\t  goto exit;\n\t}\n    }\n\n  *pcount = paths_count;\n  *ppaths = paths;\n\n  ret = 1;\n\n exit:\n  if (formats != NULL)\n    backtrace_free (state, formats,\n\t\t    formats_count * sizeof (struct line_header_format),\n\t\t    hdr_buf->error_callback, hdr_buf->data);\n\n  return  ret;\n}\n\n/* Read the line header.  Return 1 on success, 0 on failure.  */\n\nstatic int\nread_line_header (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\t  struct unit *u, int is_dwarf64, struct dwarf_buf *line_buf,\n\t\t  struct line_header *hdr)\n{\n  uint64_t hdrlen;\n  struct dwarf_buf hdr_buf;\n\n  hdr->version = read_uint16 (line_buf);\n  if (hdr->version < 2 || hdr->version > 5)\n    {\n      dwarf_buf_error (line_buf, \"unsupported line number version\", -1);\n      return 0;\n    }\n\n  if (hdr->version < 5)\n    hdr->addrsize = u->addrsize;\n  else\n    {\n      hdr->addrsize = read_byte (line_buf);\n      /* We could support a non-zero segment_selector_size but I doubt\n\t we'll ever see it.  */\n      if (read_byte (line_buf) != 0)\n\t{\n\t  dwarf_buf_error (line_buf,\n\t\t\t   \"non-zero segment_selector_size not supported\",\n\t\t\t   -1);\n\t  return 0;\n\t}\n    }\n\n  hdrlen = read_offset (line_buf, is_dwarf64);\n\n  hdr_buf = *line_buf;\n  hdr_buf.left = hdrlen;\n\n  if (!advance (line_buf, hdrlen))\n    return 0;\n\n  hdr->min_insn_len = read_byte (&hdr_buf);\n  if (hdr->version < 4)\n    hdr->max_ops_per_insn = 1;\n  else\n    hdr->max_ops_per_insn = read_byte (&hdr_buf);\n\n  /* We don't care about default_is_stmt.  */\n  read_byte (&hdr_buf);\n\n  hdr->line_base = read_sbyte (&hdr_buf);\n  hdr->line_range = read_byte (&hdr_buf);\n\n  hdr->opcode_base = read_byte (&hdr_buf);\n  hdr->opcode_lengths = hdr_buf.buf;\n  if (!advance (&hdr_buf, hdr->opcode_base - 1))\n    return 0;\n\n  if (hdr->version < 5)\n    {\n      if (!read_v2_paths (state, u, &hdr_buf, hdr))\n\treturn 0;\n    }\n  else\n    {\n      if (!read_line_header_format_entries (state, ddata, u, &hdr_buf, hdr,\n\t\t\t\t\t    &hdr->dirs_count,\n\t\t\t\t\t    &hdr->dirs))\n\treturn 0;\n      if (!read_line_header_format_entries (state, ddata, u, &hdr_buf, hdr,\n\t\t\t\t\t    &hdr->filenames_count,\n\t\t\t\t\t    &hdr->filenames))\n\treturn 0;\n    }\n\n  if (hdr_buf.reported_underflow)\n    return 0;\n\n  return 1;\n}\n\n/* Read the line program, adding line mappings to VEC.  Return 1 on\n   success, 0 on failure.  */\n\nstatic int\nread_line_program (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\t   const struct line_header *hdr, struct dwarf_buf *line_buf,\n\t\t   struct line_vector *vec)\n{\n  uint64_t address;\n  unsigned int op_index;\n  const char *reset_filename;\n  const char *filename;\n  int lineno;\n\n  address = 0;\n  op_index = 0;\n  if (hdr->filenames_count > 1)\n    reset_filename = hdr->filenames[1];\n  else\n    reset_filename = \"\";\n  filename = reset_filename;\n  lineno = 1;\n  while (line_buf->left > 0)\n    {\n      unsigned int op;\n\n      op = read_byte (line_buf);\n      if (op >= hdr->opcode_base)\n\t{\n\t  unsigned int advance;\n\n\t  /* Special opcode.  */\n\t  op -= hdr->opcode_base;\n\t  advance = op / hdr->line_range;\n\t  address += (hdr->min_insn_len * (op_index + advance)\n\t\t      / hdr->max_ops_per_insn);\n\t  op_index = (op_index + advance) % hdr->max_ops_per_insn;\n\t  lineno += hdr->line_base + (int) (op % hdr->line_range);\n\t  add_line (state, ddata, address, filename, lineno,\n\t\t    line_buf->error_callback, line_buf->data, vec);\n\t}\n      else if (op == DW_LNS_extended_op)\n\t{\n\t  uint64_t len;\n\n\t  len = read_uleb128 (line_buf);\n\t  op = read_byte (line_buf);\n\t  switch (op)\n\t    {\n\t    case DW_LNE_end_sequence:\n\t      /* FIXME: Should we mark the high PC here?  It seems\n\t\t that we already have that information from the\n\t\t compilation unit.  */\n\t      address = 0;\n\t      op_index = 0;\n\t      filename = reset_filename;\n\t      lineno = 1;\n\t      break;\n\t    case DW_LNE_set_address:\n\t      address = read_address (line_buf, hdr->addrsize);\n\t      break;\n\t    case DW_LNE_define_file:\n\t      {\n\t\tconst char *f;\n\t\tunsigned int dir_index;\n\n\t\tf = read_string (line_buf);\n\t\tif (f == NULL)\n\t\t  return 0;\n\t\tdir_index = read_uleb128 (line_buf);\n\t\t/* Ignore that time and length.  */\n\t\tread_uleb128 (line_buf);\n\t\tread_uleb128 (line_buf);\n\t\tif (IS_ABSOLUTE_PATH (f))\n\t\t  filename = f;\n\t\telse\n\t\t  {\n\t\t    const char *dir;\n\t\t    size_t dir_len;\n\t\t    size_t f_len;\n\t\t    char *p;\n\n\t\t    if (dir_index < hdr->dirs_count)\n\t\t      dir = hdr->dirs[dir_index];\n\t\t    else\n\t\t      {\n\t\t\tdwarf_buf_error (line_buf,\n\t\t\t\t\t (\"invalid directory index \"\n\t\t\t\t\t  \"in line number program\"),\n\t\t\t\t\t 0);\n\t\t\treturn 0;\n\t\t      }\n\t\t    dir_len = strlen (dir);\n\t\t    f_len = strlen (f);\n\t\t    p = ((char *)\n\t\t\t backtrace_alloc (state, dir_len + f_len + 2,\n\t\t\t\t\t  line_buf->error_callback,\n\t\t\t\t\t  line_buf->data));\n\t\t    if (p == NULL)\n\t\t      return 0;\n\t\t    memcpy (p, dir, dir_len);\n\t\t    /* FIXME: If we are on a DOS-based file system,\n\t\t       and the directory or the file name use\n\t\t       backslashes, then we should use a backslash\n\t\t       here.  */\n\t\t    p[dir_len] = '/';\n\t\t    memcpy (p + dir_len + 1, f, f_len + 1);\n\t\t    filename = p;\n\t\t  }\n\t      }\n\t      break;\n\t    case DW_LNE_set_discriminator:\n\t      /* We don't care about discriminators.  */\n\t      read_uleb128 (line_buf);\n\t      break;\n\t    default:\n\t      if (!advance (line_buf, len - 1))\n\t\treturn 0;\n\t      break;\n\t    }\n\t}\n      else\n\t{\n\t  switch (op)\n\t    {\n\t    case DW_LNS_copy:\n\t      add_line (state, ddata, address, filename, lineno,\n\t\t\tline_buf->error_callback, line_buf->data, vec);\n\t      break;\n\t    case DW_LNS_advance_pc:\n\t      {\n\t\tuint64_t advance;\n\n\t\tadvance = read_uleb128 (line_buf);\n\t\taddress += (hdr->min_insn_len * (op_index + advance)\n\t\t\t    / hdr->max_ops_per_insn);\n\t\top_index = (op_index + advance) % hdr->max_ops_per_insn;\n\t      }\n\t      break;\n\t    case DW_LNS_advance_line:\n\t      lineno += (int) read_sleb128 (line_buf);\n\t      break;\n\t    case DW_LNS_set_file:\n\t      {\n\t\tuint64_t fileno;\n\n\t\tfileno = read_uleb128 (line_buf);\n\t\tif (fileno >= hdr->filenames_count)\n\t\t  {\n\t\t    dwarf_buf_error (line_buf,\n\t\t\t\t     (\"invalid file number in \"\n\t\t\t\t      \"line number program\"),\n\t\t\t\t     0);\n\t\t    return 0;\n\t\t  }\n\t\tfilename = hdr->filenames[fileno];\n\t      }\n\t      break;\n\t    case DW_LNS_set_column:\n\t      read_uleb128 (line_buf);\n\t      break;\n\t    case DW_LNS_negate_stmt:\n\t      break;\n\t    case DW_LNS_set_basic_block:\n\t      break;\n\t    case DW_LNS_const_add_pc:\n\t      {\n\t\tunsigned int advance;\n\n\t\top = 255 - hdr->opcode_base;\n\t\tadvance = op / hdr->line_range;\n\t\taddress += (hdr->min_insn_len * (op_index + advance)\n\t\t\t    / hdr->max_ops_per_insn);\n\t\top_index = (op_index + advance) % hdr->max_ops_per_insn;\n\t      }\n\t      break;\n\t    case DW_LNS_fixed_advance_pc:\n\t      address += read_uint16 (line_buf);\n\t      op_index = 0;\n\t      break;\n\t    case DW_LNS_set_prologue_end:\n\t      break;\n\t    case DW_LNS_set_epilogue_begin:\n\t      break;\n\t    case DW_LNS_set_isa:\n\t      read_uleb128 (line_buf);\n\t      break;\n\t    default:\n\t      {\n\t\tunsigned int i;\n\n\t\tfor (i = hdr->opcode_lengths[op - 1]; i > 0; --i)\n\t\t  read_uleb128 (line_buf);\n\t      }\n\t      break;\n\t    }\n\t}\n    }\n\n  return 1;\n}\n\n/* Read the line number information for a compilation unit.  Returns 1\n   on success, 0 on failure.  */\n\nstatic int\nread_line_info (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\tbacktrace_error_callback error_callback, void *data,\n\t\tstruct unit *u, struct line_header *hdr, struct line **lines,\n\t\tsize_t *lines_count)\n{\n  struct line_vector vec;\n  struct dwarf_buf line_buf;\n  uint64_t len;\n  int is_dwarf64;\n  struct line *ln;\n\n  memset (&vec.vec, 0, sizeof vec.vec);\n  vec.count = 0;\n\n  memset (hdr, 0, sizeof *hdr);\n\n  if (u->lineoff != (off_t) (size_t) u->lineoff\n      || (size_t) u->lineoff >= ddata->dwarf_sections.size[DEBUG_LINE])\n    {\n      error_callback (data, \"unit line offset out of range\", 0);\n      goto fail;\n    }\n\n  line_buf.name = \".debug_line\";\n  line_buf.start = ddata->dwarf_sections.data[DEBUG_LINE];\n  line_buf.buf = ddata->dwarf_sections.data[DEBUG_LINE] + u->lineoff;\n  line_buf.left = ddata->dwarf_sections.size[DEBUG_LINE] - u->lineoff;\n  line_buf.is_bigendian = ddata->is_bigendian;\n  line_buf.error_callback = error_callback;\n  line_buf.data = data;\n  line_buf.reported_underflow = 0;\n\n  len = read_initial_length (&line_buf, &is_dwarf64);\n  line_buf.left = len;\n\n  if (!read_line_header (state, ddata, u, is_dwarf64, &line_buf, hdr))\n    goto fail;\n\n  if (!read_line_program (state, ddata, hdr, &line_buf, &vec))\n    goto fail;\n\n  if (line_buf.reported_underflow)\n    goto fail;\n\n  if (vec.count == 0)\n    {\n      /* This is not a failure in the sense of a generating an error,\n\t but it is a failure in that sense that we have no useful\n\t information.  */\n      goto fail;\n    }\n\n  /* Allocate one extra entry at the end.  */\n  ln = ((struct line *)\n\tbacktrace_vector_grow (state, sizeof (struct line), error_callback,\n\t\t\t       data, &vec.vec));\n  if (ln == NULL)\n    goto fail;\n  ln->pc = (uintptr_t) -1;\n  ln->filename = NULL;\n  ln->lineno = 0;\n  ln->idx = 0;\n\n  if (!backtrace_vector_release (state, &vec.vec, error_callback, data))\n    goto fail;\n\n  ln = (struct line *) vec.vec.base;\n  backtrace_qsort (ln, vec.count, sizeof (struct line), line_compare);\n\n  *lines = ln;\n  *lines_count = vec.count;\n\n  return 1;\n\n fail:\n  backtrace_vector_free (state, &vec.vec, error_callback, data);\n  free_line_header (state, hdr, error_callback, data);\n  *lines = (struct line *) (uintptr_t) -1;\n  *lines_count = 0;\n  return 0;\n}\n\nstatic const char *read_referenced_name (struct dwarf_data *, struct unit *,\n\t\t\t\t\t uint64_t, backtrace_error_callback,\n\t\t\t\t\t void *);\n\n/* Read the name of a function from a DIE referenced by ATTR with VAL.  */\n\nstatic const char *\nread_referenced_name_from_attr (struct dwarf_data *ddata, struct unit *u,\n\t\t\t\tstruct attr *attr, struct attr_val *val,\n\t\t\t\tbacktrace_error_callback error_callback,\n\t\t\t\tvoid *data)\n{\n  switch (attr->name)\n    {\n    case DW_AT_abstract_origin:\n    case DW_AT_specification:\n      break;\n    default:\n      return NULL;\n    }\n\n  if (attr->form == DW_FORM_ref_sig8)\n    return NULL;\n\n  if (val->encoding == ATTR_VAL_REF_INFO)\n    {\n      struct unit *unit\n\t= find_unit (ddata->units, ddata->units_count,\n\t\t     val->u.uint);\n      if (unit == NULL)\n\treturn NULL;\n\n      uint64_t offset = val->u.uint - unit->low_offset;\n      return read_referenced_name (ddata, unit, offset, error_callback, data);\n    }\n\n  if (val->encoding == ATTR_VAL_UINT\n      || val->encoding == ATTR_VAL_REF_UNIT)\n    return read_referenced_name (ddata, u, val->u.uint, error_callback, data);\n\n  if (val->encoding == ATTR_VAL_REF_ALT_INFO)\n    {\n      struct unit *alt_unit\n\t= find_unit (ddata->altlink->units, ddata->altlink->units_count,\n\t\t     val->u.uint);\n      if (alt_unit == NULL)\n\treturn NULL;\n\n      uint64_t offset = val->u.uint - alt_unit->low_offset;\n      return read_referenced_name (ddata->altlink, alt_unit, offset,\n\t\t\t\t   error_callback, data);\n    }\n\n  return NULL;\n}\n\n/* Read the name of a function from a DIE referenced by a\n   DW_AT_abstract_origin or DW_AT_specification tag.  OFFSET is within\n   the same compilation unit.  */\n\nstatic const char *\nread_referenced_name (struct dwarf_data *ddata, struct unit *u,\n\t\t      uint64_t offset, backtrace_error_callback error_callback,\n\t\t      void *data)\n{\n  struct dwarf_buf unit_buf;\n  uint64_t code;\n  const struct abbrev *abbrev;\n  const char *ret;\n  size_t i;\n\n  /* OFFSET is from the start of the data for this compilation unit.\n     U->unit_data is the data, but it starts U->unit_data_offset bytes\n     from the beginning.  */\n\n  if (offset < u->unit_data_offset\n      || offset - u->unit_data_offset >= u->unit_data_len)\n    {\n      error_callback (data,\n\t\t      \"abstract origin or specification out of range\",\n\t\t      0);\n      return NULL;\n    }\n\n  offset -= u->unit_data_offset;\n\n  unit_buf.name = \".debug_info\";\n  unit_buf.start = ddata->dwarf_sections.data[DEBUG_INFO];\n  unit_buf.buf = u->unit_data + offset;\n  unit_buf.left = u->unit_data_len - offset;\n  unit_buf.is_bigendian = ddata->is_bigendian;\n  unit_buf.error_callback = error_callback;\n  unit_buf.data = data;\n  unit_buf.reported_underflow = 0;\n\n  code = read_uleb128 (&unit_buf);\n  if (code == 0)\n    {\n      dwarf_buf_error (&unit_buf,\n\t\t       \"invalid abstract origin or specification\",\n\t\t       0);\n      return NULL;\n    }\n\n  abbrev = lookup_abbrev (&u->abbrevs, code, error_callback, data);\n  if (abbrev == NULL)\n    return NULL;\n\n  ret = NULL;\n  for (i = 0; i < abbrev->num_attrs; ++i)\n    {\n      struct attr_val val;\n\n      if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val,\n\t\t\t   &unit_buf, u->is_dwarf64, u->version, u->addrsize,\n\t\t\t   &ddata->dwarf_sections, ddata->altlink, &val))\n\treturn NULL;\n\n      switch (abbrev->attrs[i].name)\n\t{\n\tcase DW_AT_name:\n\t  /* Third name preference: don't override.  A name we found in some\n\t     other way, will normally be more useful -- e.g., this name is\n\t     normally not mangled.  */\n\t  if (ret != NULL)\n\t    break;\n\t  if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64,\n\t\t\t       ddata->is_bigendian, u->str_offsets_base,\n\t\t\t       &val, error_callback, data, &ret))\n\t    return NULL;\n\t  break;\n\n\tcase DW_AT_linkage_name:\n\tcase DW_AT_MIPS_linkage_name:\n\t  /* First name preference: override all.  */\n\t  {\n\t    const char *s;\n\n\t    s = NULL;\n\t    if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64,\n\t\t\t\t ddata->is_bigendian, u->str_offsets_base,\n\t\t\t\t &val, error_callback, data, &s))\n\t      return NULL;\n\t    if (s != NULL)\n\t      return s;\n\t  }\n\t  break;\n\n\tcase DW_AT_specification:\n\t  /* Second name preference: override DW_AT_name, don't override\n\t     DW_AT_linkage_name.  */\n\t  {\n\t    const char *name;\n\n\t    name = read_referenced_name_from_attr (ddata, u, &abbrev->attrs[i],\n\t\t\t\t\t\t   &val, error_callback, data);\n\t    if (name != NULL)\n\t      ret = name;\n\t  }\n\t  break;\n\n\tdefault:\n\t  break;\n\t}\n    }\n\n  return ret;\n}\n\n/* Add a range to a unit that maps to a function.  This is called via\n   add_ranges.  Returns 1 on success, 0 on error.  */\n\nstatic int\nadd_function_range (struct backtrace_state *state, void *rdata,\n\t\t    uintptr_t lowpc, uintptr_t highpc,\n\t\t    backtrace_error_callback error_callback, void *data,\n\t\t    void *pvec)\n{\n  struct function *function = (struct function *) rdata;\n  struct function_vector *vec = (struct function_vector *) pvec;\n  struct function_addrs *p;\n\n  if (vec->count > 0)\n    {\n      p = (struct function_addrs *) vec->vec.base + (vec->count - 1);\n      if ((lowpc == p->high || lowpc == p->high + 1)\n\t  && function == p->function)\n\t{\n\t  if (highpc > p->high)\n\t    p->high = highpc;\n\t  return 1;\n\t}\n    }\n\n  p = ((struct function_addrs *)\n       backtrace_vector_grow (state, sizeof (struct function_addrs),\n\t\t\t      error_callback, data, &vec->vec));\n  if (p == NULL)\n    return 0;\n\n  p->low = lowpc;\n  p->high = highpc;\n  p->function = function;\n\n  ++vec->count;\n\n  return 1;\n}\n\n/* Read one entry plus all its children.  Add function addresses to\n   VEC.  Returns 1 on success, 0 on error.  */\n\nstatic int\nread_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\t     struct unit *u, uintptr_t base, struct dwarf_buf *unit_buf,\n\t\t     const struct line_header *lhdr,\n\t\t     backtrace_error_callback error_callback, void *data,\n\t\t     struct function_vector *vec_function,\n\t\t     struct function_vector *vec_inlined)\n{\n  while (unit_buf->left > 0)\n    {\n      uint64_t code;\n      const struct abbrev *abbrev;\n      int is_function;\n      struct function *function;\n      struct function_vector *vec;\n      size_t i;\n      struct pcrange pcrange;\n      int have_linkage_name;\n\n      code = read_uleb128 (unit_buf);\n      if (code == 0)\n\treturn 1;\n\n      abbrev = lookup_abbrev (&u->abbrevs, code, error_callback, data);\n      if (abbrev == NULL)\n\treturn 0;\n\n      is_function = (abbrev->tag == DW_TAG_subprogram\n\t\t     || abbrev->tag == DW_TAG_entry_point\n\t\t     || abbrev->tag == DW_TAG_inlined_subroutine);\n\n      if (abbrev->tag == DW_TAG_inlined_subroutine)\n\tvec = vec_inlined;\n      else\n\tvec = vec_function;\n\n      function = NULL;\n      if (is_function)\n\t{\n\t  function = ((struct function *)\n\t\t      backtrace_alloc (state, sizeof *function,\n\t\t\t\t       error_callback, data));\n\t  if (function == NULL)\n\t    return 0;\n\t  memset (function, 0, sizeof *function);\n\t}\n\n      memset (&pcrange, 0, sizeof pcrange);\n      have_linkage_name = 0;\n      for (i = 0; i < abbrev->num_attrs; ++i)\n\t{\n\t  struct attr_val val;\n\n\t  if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val,\n\t\t\t       unit_buf, u->is_dwarf64, u->version,\n\t\t\t       u->addrsize, &ddata->dwarf_sections,\n\t\t\t       ddata->altlink, &val))\n\t    return 0;\n\n\t  /* The compile unit sets the base address for any address\n\t     ranges in the function entries.  */\n\t  if ((abbrev->tag == DW_TAG_compile_unit\n\t       || abbrev->tag == DW_TAG_skeleton_unit)\n\t      && abbrev->attrs[i].name == DW_AT_low_pc)\n\t    {\n\t      if (val.encoding == ATTR_VAL_ADDRESS)\n\t\tbase = (uintptr_t) val.u.uint;\n\t      else if (val.encoding == ATTR_VAL_ADDRESS_INDEX)\n\t\t{\n\t\t  if (!resolve_addr_index (&ddata->dwarf_sections,\n\t\t\t\t\t   u->addr_base, u->addrsize,\n\t\t\t\t\t   ddata->is_bigendian, val.u.uint,\n\t\t\t\t\t   error_callback, data, &base))\n\t\t    return 0;\n\t\t}\n\t    }\n\n\t  if (is_function)\n\t    {\n\t      switch (abbrev->attrs[i].name)\n\t\t{\n\t\tcase DW_AT_call_file:\n\t\t  if (val.encoding == ATTR_VAL_UINT)\n\t\t    {\n\t\t      if (val.u.uint >= lhdr->filenames_count)\n\t\t\t{\n\t\t\t  dwarf_buf_error (unit_buf,\n\t\t\t\t\t   (\"invalid file number in \"\n\t\t\t\t\t    \"DW_AT_call_file attribute\"),\n\t\t\t\t\t   0);\n\t\t\t  return 0;\n\t\t\t}\n\t\t      function->caller_filename = lhdr->filenames[val.u.uint];\n\t\t    }\n\t\t  break;\n\n\t\tcase DW_AT_call_line:\n\t\t  if (val.encoding == ATTR_VAL_UINT)\n\t\t    function->caller_lineno = val.u.uint;\n\t\t  break;\n\n\t\tcase DW_AT_abstract_origin:\n\t\tcase DW_AT_specification:\n\t\t  /* Second name preference: override DW_AT_name, don't override\n\t\t     DW_AT_linkage_name.  */\n\t\t  if (have_linkage_name)\n\t\t    break;\n\t\t  {\n\t\t    const char *name;\n\n\t\t    name\n\t\t      = read_referenced_name_from_attr (ddata, u,\n\t\t\t\t\t\t\t&abbrev->attrs[i], &val,\n\t\t\t\t\t\t\terror_callback, data);\n\t\t    if (name != NULL)\n\t\t      function->name = name;\n\t\t  }\n\t\t  break;\n\n\t\tcase DW_AT_name:\n\t\t  /* Third name preference: don't override.  */\n\t\t  if (function->name != NULL)\n\t\t    break;\n\t\t  if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64,\n\t\t\t\t       ddata->is_bigendian,\n\t\t\t\t       u->str_offsets_base, &val,\n\t\t\t\t       error_callback, data, &function->name))\n\t\t    return 0;\n\t\t  break;\n\n\t\tcase DW_AT_linkage_name:\n\t\tcase DW_AT_MIPS_linkage_name:\n\t\t  /* First name preference: override all.  */\n\t\t  {\n\t\t    const char *s;\n\n\t\t    s = NULL;\n\t\t    if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64,\n\t\t\t\t\t ddata->is_bigendian,\n\t\t\t\t\t u->str_offsets_base, &val,\n\t\t\t\t\t error_callback, data, &s))\n\t\t      return 0;\n\t\t    if (s != NULL)\n\t\t      {\n\t\t\tfunction->name = s;\n\t\t\thave_linkage_name = 1;\n\t\t      }\n\t\t  }\n\t\t  break;\n\n\t\tcase DW_AT_low_pc: case DW_AT_high_pc: case DW_AT_ranges:\n\t\t  update_pcrange (&abbrev->attrs[i], &val, &pcrange);\n\t\t  break;\n\n\t\tdefault:\n\t\t  break;\n\t\t}\n\t    }\n\t}\n\n      /* If we couldn't find a name for the function, we have no use\n\t for it.  */\n      if (is_function && function->name == NULL)\n\t{\n\t  backtrace_free (state, function, sizeof *function,\n\t\t\t  error_callback, data);\n\t  is_function = 0;\n\t}\n\n      if (is_function)\n\t{\n\t  if (pcrange.have_ranges\n\t      || (pcrange.have_lowpc && pcrange.have_highpc))\n\t    {\n\t      if (!add_ranges (state, &ddata->dwarf_sections,\n\t\t\t       ddata->base_address, ddata->is_bigendian,\n\t\t\t       u, base, &pcrange, add_function_range,\n\t\t\t       (void *) function, error_callback, data,\n\t\t\t       (void *) vec))\n\t\treturn 0;\n\t    }\n\t  else\n\t    {\n\t      backtrace_free (state, function, sizeof *function,\n\t\t\t      error_callback, data);\n\t      is_function = 0;\n\t    }\n\t}\n\n      if (abbrev->has_children)\n\t{\n\t  if (!is_function)\n\t    {\n\t      if (!read_function_entry (state, ddata, u, base, unit_buf, lhdr,\n\t\t\t\t\terror_callback, data, vec_function,\n\t\t\t\t\tvec_inlined))\n\t\treturn 0;\n\t    }\n\t  else\n\t    {\n\t      struct function_vector fvec;\n\n\t      /* Gather any information for inlined functions in\n\t\t FVEC.  */\n\n\t      memset (&fvec, 0, sizeof fvec);\n\n\t      if (!read_function_entry (state, ddata, u, base, unit_buf, lhdr,\n\t\t\t\t\terror_callback, data, vec_function,\n\t\t\t\t\t&fvec))\n\t\treturn 0;\n\n\t      if (fvec.count > 0)\n\t\t{\n\t\t  struct function_addrs *p;\n\t\t  struct function_addrs *faddrs;\n\n\t\t  /* Allocate a trailing entry, but don't include it\n\t\t     in fvec.count.  */\n\t\t  p = ((struct function_addrs *)\n\t\t       backtrace_vector_grow (state,\n\t\t\t\t\t      sizeof (struct function_addrs),\n\t\t\t\t\t      error_callback, data,\n\t\t\t\t\t      &fvec.vec));\n\t\t  if (p == NULL)\n\t\t    return 0;\n\t\t  p->low = 0;\n\t\t  --p->low;\n\t\t  p->high = p->low;\n\t\t  p->function = NULL;\n\n\t\t  if (!backtrace_vector_release (state, &fvec.vec,\n\t\t\t\t\t\t error_callback, data))\n\t\t    return 0;\n\n\t\t  faddrs = (struct function_addrs *) fvec.vec.base;\n\t\t  backtrace_qsort (faddrs, fvec.count,\n\t\t\t\t   sizeof (struct function_addrs),\n\t\t\t\t   function_addrs_compare);\n\n\t\t  function->function_addrs = faddrs;\n\t\t  function->function_addrs_count = fvec.count;\n\t\t}\n\t    }\n\t}\n    }\n\n  return 1;\n}\n\n/* Read function name information for a compilation unit.  We look\n   through the whole unit looking for function tags.  */\n\nstatic void\nread_function_info (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\t    const struct line_header *lhdr,\n\t\t    backtrace_error_callback error_callback, void *data,\n\t\t    struct unit *u, struct function_vector *fvec,\n\t\t    struct function_addrs **ret_addrs,\n\t\t    size_t *ret_addrs_count)\n{\n  struct function_vector lvec;\n  struct function_vector *pfvec;\n  struct dwarf_buf unit_buf;\n  struct function_addrs *p;\n  struct function_addrs *addrs;\n  size_t addrs_count;\n\n  /* Use FVEC if it is not NULL.  Otherwise use our own vector.  */\n  if (fvec != NULL)\n    pfvec = fvec;\n  else\n    {\n      memset (&lvec, 0, sizeof lvec);\n      pfvec = &lvec;\n    }\n\n  unit_buf.name = \".debug_info\";\n  unit_buf.start = ddata->dwarf_sections.data[DEBUG_INFO];\n  unit_buf.buf = u->unit_data;\n  unit_buf.left = u->unit_data_len;\n  unit_buf.is_bigendian = ddata->is_bigendian;\n  unit_buf.error_callback = error_callback;\n  unit_buf.data = data;\n  unit_buf.reported_underflow = 0;\n\n  while (unit_buf.left > 0)\n    {\n      if (!read_function_entry (state, ddata, u, 0, &unit_buf, lhdr,\n\t\t\t\terror_callback, data, pfvec, pfvec))\n\treturn;\n    }\n\n  if (pfvec->count == 0)\n    return;\n\n  /* Allocate a trailing entry, but don't include it in\n     pfvec->count.  */\n  p = ((struct function_addrs *)\n       backtrace_vector_grow (state, sizeof (struct function_addrs),\n\t\t\t      error_callback, data, &pfvec->vec));\n  if (p == NULL)\n    return;\n  p->low = 0;\n  --p->low;\n  p->high = p->low;\n  p->function = NULL;\n\n  addrs_count = pfvec->count;\n\n  if (fvec == NULL)\n    {\n      if (!backtrace_vector_release (state, &lvec.vec, error_callback, data))\n\treturn;\n      addrs = (struct function_addrs *) pfvec->vec.base;\n    }\n  else\n    {\n      /* Finish this list of addresses, but leave the remaining space in\n\t the vector available for the next function unit.  */\n      addrs = ((struct function_addrs *)\n\t       backtrace_vector_finish (state, &fvec->vec,\n\t\t\t\t\terror_callback, data));\n      if (addrs == NULL)\n\treturn;\n      fvec->count = 0;\n    }\n\n  backtrace_qsort (addrs, addrs_count, sizeof (struct function_addrs),\n\t\t   function_addrs_compare);\n\n  *ret_addrs = addrs;\n  *ret_addrs_count = addrs_count;\n}\n\n/* See if PC is inlined in FUNCTION.  If it is, print out the inlined\n   information, and update FILENAME and LINENO for the caller.\n   Returns whatever CALLBACK returns, or 0 to keep going.  */\n\nstatic int\nreport_inlined_functions (uintptr_t pc, struct function *function,\n\t\t\t  backtrace_full_callback callback, void *data,\n\t\t\t  const char **filename, int *lineno)\n{\n  struct function_addrs *p;\n  struct function_addrs *match;\n  struct function *inlined;\n  int ret;\n\n  if (function->function_addrs_count == 0)\n    return 0;\n\n  /* Our search isn't safe if pc == -1, as that is the sentinel\n     value.  */\n  if (pc + 1 == 0)\n    return 0;\n\n  p = ((struct function_addrs *)\n       bsearch (&pc, function->function_addrs,\n\t\tfunction->function_addrs_count,\n\t\tsizeof (struct function_addrs),\n\t\tfunction_addrs_search));\n  if (p == NULL)\n    return 0;\n\n  /* Here pc >= p->low && pc < (p + 1)->low.  The function_addrs are\n     sorted by low, so if pc > p->low we are at the end of a range of\n     function_addrs with the same low value.  If pc == p->low walk\n     forward to the end of the range with that low value.  Then walk\n     backward and use the first range that includes pc.  */\n  while (pc == (p + 1)->low)\n    ++p;\n  match = NULL;\n  while (1)\n    {\n      if (pc < p->high)\n\t{\n\t  match = p;\n\t  break;\n\t}\n      if (p == function->function_addrs)\n\tbreak;\n      if ((p - 1)->low < p->low)\n\tbreak;\n      --p;\n    }\n  if (match == NULL)\n    return 0;\n\n  /* We found an inlined call.  */\n\n  inlined = match->function;\n\n  /* Report any calls inlined into this one.  */\n  ret = report_inlined_functions (pc, inlined, callback, data,\n\t\t\t\t  filename, lineno);\n  if (ret != 0)\n    return ret;\n\n  /* Report this inlined call.  */\n  ret = callback (data, pc, *filename, *lineno, inlined->name);\n  if (ret != 0)\n    return ret;\n\n  /* Our caller will report the caller of the inlined function; tell\n     it the appropriate filename and line number.  */\n  *filename = inlined->caller_filename;\n  *lineno = inlined->caller_lineno;\n\n  return 0;\n}\n\n/* Look for a PC in the DWARF mapping for one module.  On success,\n   call CALLBACK and return whatever it returns.  On error, call\n   ERROR_CALLBACK and return 0.  Sets *FOUND to 1 if the PC is found,\n   0 if not.  */\n\nstatic int\ndwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata,\n\t\t uintptr_t pc, backtrace_full_callback callback,\n\t\t backtrace_error_callback error_callback, void *data,\n\t\t int *found)\n{\n  struct unit_addrs *entry;\n  int found_entry;\n  struct unit *u;\n  int new_data;\n  struct line *lines;\n  struct line *ln;\n  struct function_addrs *p;\n  struct function_addrs *fmatch;\n  struct function *function;\n  const char *filename;\n  int lineno;\n  int ret;\n\n  *found = 1;\n\n  /* Find an address range that includes PC.  Our search isn't safe if\n     PC == -1, as we use that as a sentinel value, so skip the search\n     in that case.  */\n  entry = (ddata->addrs_count == 0 || pc + 1 == 0\n\t   ? NULL\n\t   : bsearch (&pc, ddata->addrs, ddata->addrs_count,\n\t\t      sizeof (struct unit_addrs), unit_addrs_search));\n\n  if (entry == NULL)\n    {\n      *found = 0;\n      return 0;\n    }\n\n  /* Here pc >= entry->low && pc < (entry + 1)->low.  The unit_addrs\n     are sorted by low, so if pc > p->low we are at the end of a range\n     of unit_addrs with the same low value.  If pc == p->low walk\n     forward to the end of the range with that low value.  Then walk\n     backward and use the first range that includes pc.  */\n  while (pc == (entry + 1)->low)\n    ++entry;\n  found_entry = 0;\n  while (1)\n    {\n      if (pc < entry->high)\n\t{\n\t  found_entry = 1;\n\t  break;\n\t}\n      if (entry == ddata->addrs)\n\tbreak;\n      if ((entry - 1)->low < entry->low)\n\tbreak;\n      --entry;\n    }\n  if (!found_entry)\n    {\n      *found = 0;\n      return 0;\n    }\n\n  /* We need the lines, lines_count, function_addrs,\n     function_addrs_count fields of u.  If they are not set, we need\n     to set them.  When running in threaded mode, we need to allow for\n     the possibility that some other thread is setting them\n     simultaneously.  */\n\n  u = entry->u;\n  lines = u->lines;\n\n  /* Skip units with no useful line number information by walking\n     backward.  Useless line number information is marked by setting\n     lines == -1.  */\n  while (entry > ddata->addrs\n\t && pc >= (entry - 1)->low\n\t && pc < (entry - 1)->high)\n    {\n      if (state->threaded)\n\tlines = (struct line *) backtrace_atomic_load_pointer (&u->lines);\n\n      if (lines != (struct line *) (uintptr_t) -1)\n\tbreak;\n\n      --entry;\n\n      u = entry->u;\n      lines = u->lines;\n    }\n\n  if (state->threaded)\n    lines = backtrace_atomic_load_pointer (&u->lines);\n\n  new_data = 0;\n  if (lines == NULL)\n    {\n      struct function_addrs *function_addrs;\n      size_t function_addrs_count;\n      struct line_header lhdr;\n      size_t count;\n\n      /* We have never read the line information for this unit.  Read\n\t it now.  */\n\n      function_addrs = NULL;\n      function_addrs_count = 0;\n      if (read_line_info (state, ddata, error_callback, data, entry->u, &lhdr,\n\t\t\t  &lines, &count))\n\t{\n\t  struct function_vector *pfvec;\n\n\t  /* If not threaded, reuse DDATA->FVEC for better memory\n\t     consumption.  */\n\t  if (state->threaded)\n\t    pfvec = NULL;\n\t  else\n\t    pfvec = &ddata->fvec;\n\t  read_function_info (state, ddata, &lhdr, error_callback, data,\n\t\t\t      entry->u, pfvec, &function_addrs,\n\t\t\t      &function_addrs_count);\n\t  free_line_header (state, &lhdr, error_callback, data);\n\t  new_data = 1;\n\t}\n\n      /* Atomically store the information we just read into the unit.\n\t If another thread is simultaneously writing, it presumably\n\t read the same information, and we don't care which one we\n\t wind up with; we just leak the other one.  We do have to\n\t write the lines field last, so that the acquire-loads above\n\t ensure that the other fields are set.  */\n\n      if (!state->threaded)\n\t{\n\t  u->lines_count = count;\n\t  u->function_addrs = function_addrs;\n\t  u->function_addrs_count = function_addrs_count;\n\t  u->lines = lines;\n\t}\n      else\n\t{\n\t  backtrace_atomic_store_size_t (&u->lines_count, count);\n\t  backtrace_atomic_store_pointer (&u->function_addrs, function_addrs);\n\t  backtrace_atomic_store_size_t (&u->function_addrs_count,\n\t\t\t\t\t function_addrs_count);\n\t  backtrace_atomic_store_pointer (&u->lines, lines);\n\t}\n    }\n\n  /* Now all fields of U have been initialized.  */\n\n  if (lines == (struct line *) (uintptr_t) -1)\n    {\n      /* If reading the line number information failed in some way,\n\t try again to see if there is a better compilation unit for\n\t this PC.  */\n      if (new_data)\n\treturn dwarf_lookup_pc (state, ddata, pc, callback, error_callback,\n\t\t\t\tdata, found);\n      return callback (data, pc, NULL, 0, NULL);\n    }\n\n  /* Search for PC within this unit.  */\n\n  ln = (struct line *) bsearch (&pc, lines, entry->u->lines_count,\n\t\t\t\tsizeof (struct line), line_search);\n  if (ln == NULL)\n    {\n      /* The PC is between the low_pc and high_pc attributes of the\n\t compilation unit, but no entry in the line table covers it.\n\t This implies that the start of the compilation unit has no\n\t line number information.  */\n\n      if (entry->u->abs_filename == NULL)\n\t{\n\t  const char *filename;\n\n\t  filename = entry->u->filename;\n\t  if (filename != NULL\n\t      && !IS_ABSOLUTE_PATH (filename)\n\t      && entry->u->comp_dir != NULL)\n\t    {\n\t      size_t filename_len;\n\t      const char *dir;\n\t      size_t dir_len;\n\t      char *s;\n\n\t      filename_len = strlen (filename);\n\t      dir = entry->u->comp_dir;\n\t      dir_len = strlen (dir);\n\t      s = (char *) backtrace_alloc (state, dir_len + filename_len + 2,\n\t\t\t\t\t    error_callback, data);\n\t      if (s == NULL)\n\t\t{\n\t\t  *found = 0;\n\t\t  return 0;\n\t\t}\n\t      memcpy (s, dir, dir_len);\n\t      /* FIXME: Should use backslash if DOS file system.  */\n\t      s[dir_len] = '/';\n\t      memcpy (s + dir_len + 1, filename, filename_len + 1);\n\t      filename = s;\n\t    }\n\t  entry->u->abs_filename = filename;\n\t}\n\n      return callback (data, pc, entry->u->abs_filename, 0, NULL);\n    }\n\n  /* Search for function name within this unit.  */\n\n  if (entry->u->function_addrs_count == 0)\n    return callback (data, pc, ln->filename, ln->lineno, NULL);\n\n  p = ((struct function_addrs *)\n       bsearch (&pc, entry->u->function_addrs,\n\t\tentry->u->function_addrs_count,\n\t\tsizeof (struct function_addrs),\n\t\tfunction_addrs_search));\n  if (p == NULL)\n    return callback (data, pc, ln->filename, ln->lineno, NULL);\n\n  /* Here pc >= p->low && pc < (p + 1)->low.  The function_addrs are\n     sorted by low, so if pc > p->low we are at the end of a range of\n     function_addrs with the same low value.  If pc == p->low walk\n     forward to the end of the range with that low value.  Then walk\n     backward and use the first range that includes pc.  */\n  while (pc == (p + 1)->low)\n    ++p;\n  fmatch = NULL;\n  while (1)\n    {\n      if (pc < p->high)\n\t{\n\t  fmatch = p;\n\t  break;\n\t}\n      if (p == entry->u->function_addrs)\n\tbreak;\n      if ((p - 1)->low < p->low)\n\tbreak;\n      --p;\n    }\n  if (fmatch == NULL)\n    return callback (data, pc, ln->filename, ln->lineno, NULL);\n\n  function = fmatch->function;\n\n  filename = ln->filename;\n  lineno = ln->lineno;\n\n  ret = report_inlined_functions (pc, function, callback, data,\n\t\t\t\t  &filename, &lineno);\n  if (ret != 0)\n    return ret;\n\n  return callback (data, pc, filename, lineno, function->name);\n}\n\n\n/* Return the file/line information for a PC using the DWARF mapping\n   we built earlier.  */\n\nstatic int\ndwarf_fileline (struct backtrace_state *state, uintptr_t pc,\n\t\tbacktrace_full_callback callback,\n\t\tbacktrace_error_callback error_callback, void *data)\n{\n  struct dwarf_data *ddata;\n  int found;\n  int ret;\n\n  if (!state->threaded)\n    {\n      for (ddata = (struct dwarf_data *) state->fileline_data;\n\t   ddata != NULL;\n\t   ddata = ddata->next)\n\t{\n\t  ret = dwarf_lookup_pc (state, ddata, pc, callback, error_callback,\n\t\t\t\t data, &found);\n\t  if (ret != 0 || found)\n\t    return ret;\n\t}\n    }\n  else\n    {\n      struct dwarf_data **pp;\n\n      pp = (struct dwarf_data **) (void *) &state->fileline_data;\n      while (1)\n\t{\n\t  ddata = backtrace_atomic_load_pointer (pp);\n\t  if (ddata == NULL)\n\t    break;\n\n\t  ret = dwarf_lookup_pc (state, ddata, pc, callback, error_callback,\n\t\t\t\t data, &found);\n\t  if (ret != 0 || found)\n\t    return ret;\n\n\t  pp = &ddata->next;\n\t}\n    }\n\n  /* FIXME: See if any libraries have been dlopen'ed.  */\n\n  return callback (data, pc, NULL, 0, NULL);\n}\n\n/* Initialize our data structures from the DWARF debug info for a\n   file.  Return NULL on failure.  */\n\nstatic struct dwarf_data *\nbuild_dwarf_data (struct backtrace_state *state,\n\t\t  uintptr_t base_address,\n\t\t  const struct dwarf_sections *dwarf_sections,\n\t\t  int is_bigendian,\n\t\t  struct dwarf_data *altlink,\n\t\t  backtrace_error_callback error_callback,\n\t\t  void *data)\n{\n  struct unit_addrs_vector addrs_vec;\n  struct unit_addrs *addrs;\n  size_t addrs_count;\n  struct unit_vector units_vec;\n  struct unit **units;\n  size_t units_count;\n  struct dwarf_data *fdata;\n\n  if (!build_address_map (state, base_address, dwarf_sections, is_bigendian,\n\t\t\t  altlink, error_callback, data, &addrs_vec,\n\t\t\t  &units_vec))\n    return NULL;\n\n  if (!backtrace_vector_release (state, &addrs_vec.vec, error_callback, data))\n    return NULL;\n  if (!backtrace_vector_release (state, &units_vec.vec, error_callback, data))\n    return NULL;\n  addrs = (struct unit_addrs *) addrs_vec.vec.base;\n  units = (struct unit **) units_vec.vec.base;\n  addrs_count = addrs_vec.count;\n  units_count = units_vec.count;\n  backtrace_qsort (addrs, addrs_count, sizeof (struct unit_addrs),\n\t\t   unit_addrs_compare);\n  /* No qsort for units required, already sorted.  */\n\n  fdata = ((struct dwarf_data *)\n\t   backtrace_alloc (state, sizeof (struct dwarf_data),\n\t\t\t    error_callback, data));\n  if (fdata == NULL)\n    return NULL;\n\n  fdata->next = NULL;\n  fdata->altlink = altlink;\n  fdata->base_address = base_address;\n  fdata->addrs = addrs;\n  fdata->addrs_count = addrs_count;\n  fdata->units = units;\n  fdata->units_count = units_count;\n  fdata->dwarf_sections = *dwarf_sections;\n  fdata->is_bigendian = is_bigendian;\n  memset (&fdata->fvec, 0, sizeof fdata->fvec);\n\n  return fdata;\n}\n\n/* Build our data structures from the DWARF sections for a module.\n   Set FILELINE_FN and STATE->FILELINE_DATA.  Return 1 on success, 0\n   on failure.  */\n\nint\nbacktrace_dwarf_add (struct backtrace_state *state,\n\t\t     uintptr_t base_address,\n\t\t     const struct dwarf_sections *dwarf_sections,\n\t\t     int is_bigendian,\n\t\t     struct dwarf_data *fileline_altlink,\n\t\t     backtrace_error_callback error_callback,\n\t\t     void *data, fileline *fileline_fn,\n\t\t     struct dwarf_data **fileline_entry)\n{\n  struct dwarf_data *fdata;\n\n  fdata = build_dwarf_data (state, base_address, dwarf_sections, is_bigendian,\n\t\t\t    fileline_altlink, error_callback, data);\n  if (fdata == NULL)\n    return 0;\n\n  if (fileline_entry != NULL)\n    *fileline_entry = fdata;\n\n  if (!state->threaded)\n    {\n      struct dwarf_data **pp;\n\n      for (pp = (struct dwarf_data **) (void *) &state->fileline_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = fdata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct dwarf_data **pp;\n\n\t  pp = (struct dwarf_data **) (void *) &state->fileline_data;\n\n\t  while (1)\n\t    {\n\t      struct dwarf_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, fdata))\n\t    break;\n\t}\n    }\n\n  *fileline_fn = dwarf_fileline;\n\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/elf.c",
    "content": "/* elf.c -- Get debug data from an ELF file for backtraces.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#ifdef HAVE_DL_ITERATE_PHDR\n #ifdef HAVE_LINK_H\n  #include <link.h>\n #endif\n #ifdef HAVE_SYS_LINK_H\n  #include <sys/link.h>\n #endif\n#endif\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n#ifndef S_ISLNK\n #ifndef S_IFLNK\n  #define S_IFLNK 0120000\n #endif\n #ifndef S_IFMT\n  #define S_IFMT 0170000\n #endif\n #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)\n#endif\n\n#ifndef unlikely\n#ifndef __GNUC__\n#define __builtin_prefetch(p, r, l)\n#define unlikely(x) (x)\n#else\n#define unlikely(x) __builtin_expect(!!(x), 0)\n#endif\n#endif\n\n#if !defined(HAVE_DECL_STRNLEN) || !HAVE_DECL_STRNLEN\n\n/* If strnlen is not declared, provide our own version.  */\n\nstatic size_t\nxstrnlen (const char *s, size_t maxlen)\n{\n  size_t i;\n\n  for (i = 0; i < maxlen; ++i)\n    if (s[i] == '\\0')\n      break;\n  return i;\n}\n\n#define strnlen xstrnlen\n\n#endif\n\n#ifndef HAVE_LSTAT\n\n/* Dummy version of lstat for systems that don't have it.  */\n\nstatic int\nxlstat (const char *path ATTRIBUTE_UNUSED, struct stat *st ATTRIBUTE_UNUSED)\n{\n  return -1;\n}\n\n#define lstat xlstat\n\n#endif\n\n#ifndef HAVE_READLINK\n\n/* Dummy version of readlink for systems that don't have it.  */\n\nstatic ssize_t\nxreadlink (const char *path ATTRIBUTE_UNUSED, char *buf ATTRIBUTE_UNUSED,\n\t   size_t bufsz ATTRIBUTE_UNUSED)\n{\n  return -1;\n}\n\n#define readlink xreadlink\n\n#endif\n\n#ifndef HAVE_DL_ITERATE_PHDR\n\n/* Dummy version of dl_iterate_phdr for systems that don't have it.  */\n\n#define dl_phdr_info x_dl_phdr_info\n#define dl_iterate_phdr x_dl_iterate_phdr\n\nstruct dl_phdr_info\n{\n  uintptr_t dlpi_addr;\n  const char *dlpi_name;\n};\n\nstatic int\ndl_iterate_phdr (int (*callback) (struct dl_phdr_info *,\n\t\t\t\t  size_t, void *) ATTRIBUTE_UNUSED,\n\t\t void *data ATTRIBUTE_UNUSED)\n{\n  return 0;\n}\n\n#endif /* ! defined (HAVE_DL_ITERATE_PHDR) */\n\n/* The configure script must tell us whether we are 32-bit or 64-bit\n   ELF.  We could make this code test and support either possibility,\n   but there is no point.  This code only works for the currently\n   running executable, which means that we know the ELF mode at\n   configure time.  */\n\n#if BACKTRACE_ELF_SIZE != 32 && BACKTRACE_ELF_SIZE != 64\n#error \"Unknown BACKTRACE_ELF_SIZE\"\n#endif\n\n/* <link.h> might #include <elf.h> which might define our constants\n   with slightly different values.  Undefine them to be safe.  */\n\n#undef EI_NIDENT\n#undef EI_MAG0\n#undef EI_MAG1\n#undef EI_MAG2\n#undef EI_MAG3\n#undef EI_CLASS\n#undef EI_DATA\n#undef EI_VERSION\n#undef ELF_MAG0\n#undef ELF_MAG1\n#undef ELF_MAG2\n#undef ELF_MAG3\n#undef ELFCLASS32\n#undef ELFCLASS64\n#undef ELFDATA2LSB\n#undef ELFDATA2MSB\n#undef EV_CURRENT\n#undef ET_DYN\n#undef EM_PPC64\n#undef EF_PPC64_ABI\n#undef SHN_LORESERVE\n#undef SHN_XINDEX\n#undef SHN_UNDEF\n#undef SHT_PROGBITS\n#undef SHT_SYMTAB\n#undef SHT_STRTAB\n#undef SHT_DYNSYM\n#undef SHF_COMPRESSED\n#undef STT_OBJECT\n#undef STT_FUNC\n#undef NT_GNU_BUILD_ID\n#undef ELFCOMPRESS_ZLIB\n#undef ELFCOMPRESS_ZSTD\n\n/* Basic types.  */\n\ntypedef uint16_t b_elf_half;    /* Elf_Half.  */\ntypedef uint32_t b_elf_word;    /* Elf_Word.  */\ntypedef int32_t  b_elf_sword;   /* Elf_Sword.  */\n\n#if BACKTRACE_ELF_SIZE == 32\n\ntypedef uint32_t b_elf_addr;    /* Elf_Addr.  */\ntypedef uint32_t b_elf_off;     /* Elf_Off.  */\n\ntypedef uint32_t b_elf_wxword;  /* 32-bit Elf_Word, 64-bit ELF_Xword.  */\n\n#else\n\ntypedef uint64_t b_elf_addr;    /* Elf_Addr.  */\ntypedef uint64_t b_elf_off;     /* Elf_Off.  */\ntypedef uint64_t b_elf_xword;   /* Elf_Xword.  */\ntypedef int64_t  b_elf_sxword;  /* Elf_Sxword.  */\n\ntypedef uint64_t b_elf_wxword;  /* 32-bit Elf_Word, 64-bit ELF_Xword.  */\n\n#endif\n\n/* Data structures and associated constants.  */\n\n#define EI_NIDENT 16\n\ntypedef struct {\n  unsigned char\te_ident[EI_NIDENT];\t/* ELF \"magic number\" */\n  b_elf_half\te_type;\t\t\t/* Identifies object file type */\n  b_elf_half\te_machine;\t\t/* Specifies required architecture */\n  b_elf_word\te_version;\t\t/* Identifies object file version */\n  b_elf_addr\te_entry;\t\t/* Entry point virtual address */\n  b_elf_off\te_phoff;\t\t/* Program header table file offset */\n  b_elf_off\te_shoff;\t\t/* Section header table file offset */\n  b_elf_word\te_flags;\t\t/* Processor-specific flags */\n  b_elf_half\te_ehsize;\t\t/* ELF header size in bytes */\n  b_elf_half\te_phentsize;\t\t/* Program header table entry size */\n  b_elf_half\te_phnum;\t\t/* Program header table entry count */\n  b_elf_half\te_shentsize;\t\t/* Section header table entry size */\n  b_elf_half\te_shnum;\t\t/* Section header table entry count */\n  b_elf_half\te_shstrndx;\t\t/* Section header string table index */\n} b_elf_ehdr;  /* Elf_Ehdr.  */\n\n#define EI_MAG0 0\n#define EI_MAG1 1\n#define EI_MAG2 2\n#define EI_MAG3 3\n#define EI_CLASS 4\n#define EI_DATA 5\n#define EI_VERSION 6\n\n#define ELFMAG0 0x7f\n#define ELFMAG1 'E'\n#define ELFMAG2 'L'\n#define ELFMAG3 'F'\n\n#define ELFCLASS32 1\n#define ELFCLASS64 2\n\n#define ELFDATA2LSB 1\n#define ELFDATA2MSB 2\n\n#define EV_CURRENT 1\n\n#define ET_DYN 3\n\n#define EM_PPC64 21\n#define EF_PPC64_ABI 3\n\ntypedef struct {\n  b_elf_word\tsh_name;\t\t/* Section name, index in string tbl */\n  b_elf_word\tsh_type;\t\t/* Type of section */\n  b_elf_wxword\tsh_flags;\t\t/* Miscellaneous section attributes */\n  b_elf_addr\tsh_addr;\t\t/* Section virtual addr at execution */\n  b_elf_off\tsh_offset;\t\t/* Section file offset */\n  b_elf_wxword\tsh_size;\t\t/* Size of section in bytes */\n  b_elf_word\tsh_link;\t\t/* Index of another section */\n  b_elf_word\tsh_info;\t\t/* Additional section information */\n  b_elf_wxword\tsh_addralign;\t\t/* Section alignment */\n  b_elf_wxword\tsh_entsize;\t\t/* Entry size if section holds table */\n} b_elf_shdr;  /* Elf_Shdr.  */\n\n#define SHN_UNDEF\t0x0000\t\t/* Undefined section */\n#define SHN_LORESERVE\t0xFF00\t\t/* Begin range of reserved indices */\n#define SHN_XINDEX\t0xFFFF\t\t/* Section index is held elsewhere */\n\n#define SHT_PROGBITS 1\n#define SHT_SYMTAB 2\n#define SHT_STRTAB 3\n#define SHT_DYNSYM 11\n\n#define SHF_COMPRESSED 0x800\n\n#if BACKTRACE_ELF_SIZE == 32\n\ntypedef struct\n{\n  b_elf_word\tst_name;\t\t/* Symbol name, index in string tbl */\n  b_elf_addr\tst_value;\t\t/* Symbol value */\n  b_elf_word\tst_size;\t\t/* Symbol size */\n  unsigned char\tst_info;\t\t/* Symbol binding and type */\n  unsigned char\tst_other;\t\t/* Visibility and other data */\n  b_elf_half\tst_shndx;\t\t/* Symbol section index */\n} b_elf_sym;  /* Elf_Sym.  */\n\n#else /* BACKTRACE_ELF_SIZE != 32 */\n\ntypedef struct\n{\n  b_elf_word\tst_name;\t\t/* Symbol name, index in string tbl */\n  unsigned char\tst_info;\t\t/* Symbol binding and type */\n  unsigned char\tst_other;\t\t/* Visibility and other data */\n  b_elf_half\tst_shndx;\t\t/* Symbol section index */\n  b_elf_addr\tst_value;\t\t/* Symbol value */\n  b_elf_xword\tst_size;\t\t/* Symbol size */\n} b_elf_sym;  /* Elf_Sym.  */\n\n#endif /* BACKTRACE_ELF_SIZE != 32 */\n\n#define STT_OBJECT 1\n#define STT_FUNC 2\n\ntypedef struct\n{\n  uint32_t namesz;\n  uint32_t descsz;\n  uint32_t type;\n  char name[1];\n} b_elf_note;\n\n#define NT_GNU_BUILD_ID 3\n\n#if BACKTRACE_ELF_SIZE == 32\n\ntypedef struct\n{\n  b_elf_word\tch_type;\t\t/* Compresstion algorithm */\n  b_elf_word\tch_size;\t\t/* Uncompressed size */\n  b_elf_word\tch_addralign;\t\t/* Alignment for uncompressed data */\n} b_elf_chdr;  /* Elf_Chdr */\n\n#else /* BACKTRACE_ELF_SIZE != 32 */\n\ntypedef struct\n{\n  b_elf_word\tch_type;\t\t/* Compression algorithm */\n  b_elf_word\tch_reserved;\t\t/* Reserved */\n  b_elf_xword\tch_size;\t\t/* Uncompressed size */\n  b_elf_xword\tch_addralign;\t\t/* Alignment for uncompressed data */\n} b_elf_chdr;  /* Elf_Chdr */\n\n#endif /* BACKTRACE_ELF_SIZE != 32 */\n\n#define ELFCOMPRESS_ZLIB 1\n#define ELFCOMPRESS_ZSTD 2\n\n/* Names of sections, indexed by enum dwarf_section in internal.h.  */\n\nstatic const char * const dwarf_section_names[DEBUG_MAX] =\n{\n  \".debug_info\",\n  \".debug_line\",\n  \".debug_abbrev\",\n  \".debug_ranges\",\n  \".debug_str\",\n  \".debug_addr\",\n  \".debug_str_offsets\",\n  \".debug_line_str\",\n  \".debug_rnglists\"\n};\n\n/* Information we gather for the sections we care about.  */\n\nstruct debug_section_info\n{\n  /* Section file offset.  */\n  off_t offset;\n  /* Section size.  */\n  size_t size;\n  /* Section contents, after read from file.  */\n  const unsigned char *data;\n  /* Whether the SHF_COMPRESSED flag is set for the section.  */\n  int compressed;\n};\n\n/* Information we keep for an ELF symbol.  */\n\nstruct elf_symbol\n{\n  /* The name of the symbol.  */\n  const char *name;\n  /* The address of the symbol.  */\n  uintptr_t address;\n  /* The size of the symbol.  */\n  size_t size;\n};\n\n/* Information to pass to elf_syminfo.  */\n\nstruct elf_syminfo_data\n{\n  /* Symbols for the next module.  */\n  struct elf_syminfo_data *next;\n  /* The ELF symbols, sorted by address.  */\n  struct elf_symbol *symbols;\n  /* The number of symbols.  */\n  size_t count;\n};\n\n/* A view that works for either a file or memory.  */\n\nstruct elf_view\n{\n  struct backtrace_view view;\n  int release; /* If non-zero, must call backtrace_release_view.  */\n};\n\n/* Information about PowerPC64 ELFv1 .opd section.  */\n\nstruct elf_ppc64_opd_data\n{\n  /* Address of the .opd section.  */\n  b_elf_addr addr;\n  /* Section data.  */\n  const char *data;\n  /* Size of the .opd section.  */\n  size_t size;\n  /* Corresponding section view.  */\n  struct elf_view view;\n};\n\n/* Create a view of SIZE bytes from DESCRIPTOR/MEMORY at OFFSET.  */\n\nstatic int\nelf_get_view (struct backtrace_state *state, int descriptor,\n\t      const unsigned char *memory, size_t memory_size, off_t offset,\n\t      uint64_t size, backtrace_error_callback error_callback,\n\t      void *data, struct elf_view *view)\n{\n  if (memory == NULL)\n    {\n      view->release = 1;\n      return backtrace_get_view (state, descriptor, offset, size,\n\t\t\t\t error_callback, data, &view->view);\n    }\n  else\n    {\n      if ((uint64_t) offset + size > (uint64_t) memory_size)\n\t{\n\t  error_callback (data, \"out of range for in-memory file\", 0);\n\t  return 0;\n\t}\n      view->view.data = (const void *) (memory + offset);\n      view->view.base = NULL;\n      view->view.len = size;\n      view->release = 0;\n      return 1;\n    }\n}\n\n/* Release a view read by elf_get_view.  */\n\nstatic void\nelf_release_view (struct backtrace_state *state, struct elf_view *view,\n\t\t  backtrace_error_callback error_callback, void *data)\n{\n  if (view->release)\n    backtrace_release_view (state, &view->view, error_callback, data);\n}\n\n/* Compute the CRC-32 of BUF/LEN.  This uses the CRC used for\n   .gnu_debuglink files.  */\n\nstatic uint32_t\nelf_crc32 (uint32_t crc, const unsigned char *buf, size_t len)\n{\n  static const uint32_t crc32_table[256] =\n    {\n      0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n      0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n      0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n      0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n      0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n      0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n      0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n      0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n      0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n      0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n      0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n      0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n      0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n      0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n      0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n      0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n      0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n      0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n      0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n      0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n      0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n      0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n      0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n      0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n      0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n      0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n      0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n      0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n      0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n      0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n      0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n      0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n      0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n      0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n      0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n      0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n      0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n      0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n      0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n      0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n      0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n      0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n      0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n      0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n      0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n      0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n      0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n      0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n      0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n      0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n      0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n      0x2d02ef8d\n    };\n  const unsigned char *end;\n\n  crc = ~crc;\n  for (end = buf + len; buf < end; ++ buf)\n    crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);\n  return ~crc;\n}\n\n/* Return the CRC-32 of the entire file open at DESCRIPTOR.  */\n\nstatic uint32_t\nelf_crc32_file (struct backtrace_state *state, int descriptor,\n\t\tbacktrace_error_callback error_callback, void *data)\n{\n  struct stat st;\n  struct backtrace_view file_view;\n  uint32_t ret;\n\n  if (fstat (descriptor, &st) < 0)\n    {\n      error_callback (data, \"fstat\", errno);\n      return 0;\n    }\n\n  if (!backtrace_get_view (state, descriptor, 0, st.st_size, error_callback,\n\t\t\t   data, &file_view))\n    return 0;\n\n  ret = elf_crc32 (0, (const unsigned char *) file_view.data, st.st_size);\n\n  backtrace_release_view (state, &file_view, error_callback, data);\n\n  return ret;\n}\n\n/* A dummy callback function used when we can't find a symbol\n   table.  */\n\nstatic void\nelf_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t    uintptr_t addr ATTRIBUTE_UNUSED,\n\t    backtrace_syminfo_callback callback ATTRIBUTE_UNUSED,\n\t    backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no symbol table in ELF executable\", -1);\n}\n\n/* A callback function used when we can't find any debug info.  */\n\nstatic int\nelf_nodebug (struct backtrace_state *state, uintptr_t pc,\n\t     backtrace_full_callback callback,\n\t     backtrace_error_callback error_callback, void *data)\n{\n  if (state->syminfo_fn != NULL && state->syminfo_fn != elf_nosyms)\n    {\n      struct backtrace_call_full bdata;\n\n      /* Fetch symbol information so that we can least get the\n\t function name.  */\n\n      bdata.full_callback = callback;\n      bdata.full_error_callback = error_callback;\n      bdata.full_data = data;\n      bdata.ret = 0;\n      state->syminfo_fn (state, pc, backtrace_syminfo_to_full_callback,\n\t\t\t backtrace_syminfo_to_full_error_callback, &bdata);\n      return bdata.ret;\n    }\n\n  error_callback (data, \"no debug info in ELF executable\", -1);\n  return 0;\n}\n\n/* Compare struct elf_symbol for qsort.  */\n\nstatic int\nelf_symbol_compare (const void *v1, const void *v2)\n{\n  const struct elf_symbol *e1 = (const struct elf_symbol *) v1;\n  const struct elf_symbol *e2 = (const struct elf_symbol *) v2;\n\n  if (e1->address < e2->address)\n    return -1;\n  else if (e1->address > e2->address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Compare an ADDR against an elf_symbol for bsearch.  We allocate one\n   extra entry in the array so that this can look safely at the next\n   entry.  */\n\nstatic int\nelf_symbol_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct elf_symbol *entry = (const struct elf_symbol *) ventry;\n  uintptr_t addr;\n\n  addr = *key;\n  if (addr < entry->address)\n    return -1;\n  else if (addr >= entry->address + entry->size)\n    return 1;\n  else\n    return 0;\n}\n\n/* Initialize the symbol table info for elf_syminfo.  */\n\nstatic int\nelf_initialize_syminfo (struct backtrace_state *state,\n\t\t\tuintptr_t base_address,\n\t\t\tconst unsigned char *symtab_data, size_t symtab_size,\n\t\t\tconst unsigned char *strtab, size_t strtab_size,\n\t\t\tbacktrace_error_callback error_callback,\n\t\t\tvoid *data, struct elf_syminfo_data *sdata,\n\t\t\tstruct elf_ppc64_opd_data *opd)\n{\n  size_t sym_count;\n  const b_elf_sym *sym;\n  size_t elf_symbol_count;\n  size_t elf_symbol_size;\n  struct elf_symbol *elf_symbols;\n  size_t i;\n  unsigned int j;\n\n  sym_count = symtab_size / sizeof (b_elf_sym);\n\n  /* We only care about function symbols.  Count them.  */\n  sym = (const b_elf_sym *) symtab_data;\n  elf_symbol_count = 0;\n  for (i = 0; i < sym_count; ++i, ++sym)\n    {\n      int info;\n\n      info = sym->st_info & 0xf;\n      if ((info == STT_FUNC || info == STT_OBJECT)\n\t  && sym->st_shndx != SHN_UNDEF)\n\t++elf_symbol_count;\n    }\n\n  elf_symbol_size = elf_symbol_count * sizeof (struct elf_symbol);\n  elf_symbols = ((struct elf_symbol *)\n\t\t backtrace_alloc (state, elf_symbol_size, error_callback,\n\t\t\t\t  data));\n  if (elf_symbols == NULL)\n    return 0;\n\n  sym = (const b_elf_sym *) symtab_data;\n  j = 0;\n  for (i = 0; i < sym_count; ++i, ++sym)\n    {\n      int info;\n\n      info = sym->st_info & 0xf;\n      if (info != STT_FUNC && info != STT_OBJECT)\n\tcontinue;\n      if (sym->st_shndx == SHN_UNDEF)\n\tcontinue;\n      if (sym->st_name >= strtab_size)\n\t{\n\t  error_callback (data, \"symbol string index out of range\", 0);\n\t  backtrace_free (state, elf_symbols, elf_symbol_size, error_callback,\n\t\t\t  data);\n\t  return 0;\n\t}\n      elf_symbols[j].name = (const char *) strtab + sym->st_name;\n      /* Special case PowerPC64 ELFv1 symbols in .opd section, if the symbol\n\t is a function descriptor, read the actual code address from the\n\t descriptor.  */\n      if (opd\n\t  && sym->st_value >= opd->addr\n\t  && sym->st_value < opd->addr + opd->size)\n\telf_symbols[j].address\n\t  = *(const b_elf_addr *) (opd->data + (sym->st_value - opd->addr));\n      else\n\telf_symbols[j].address = sym->st_value;\n      elf_symbols[j].address += base_address;\n      elf_symbols[j].size = sym->st_size;\n      ++j;\n    }\n\n  backtrace_qsort (elf_symbols, elf_symbol_count, sizeof (struct elf_symbol),\n\t\t   elf_symbol_compare);\n\n  sdata->next = NULL;\n  sdata->symbols = elf_symbols;\n  sdata->count = elf_symbol_count;\n\n  return 1;\n}\n\n/* Add EDATA to the list in STATE.  */\n\nstatic void\nelf_add_syminfo_data (struct backtrace_state *state,\n\t\t      struct elf_syminfo_data *edata)\n{\n  if (!state->threaded)\n    {\n      struct elf_syminfo_data **pp;\n\n      for (pp = (struct elf_syminfo_data **) (void *) &state->syminfo_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = edata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct elf_syminfo_data **pp;\n\n\t  pp = (struct elf_syminfo_data **) (void *) &state->syminfo_data;\n\n\t  while (1)\n\t    {\n\t      struct elf_syminfo_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, edata))\n\t    break;\n\t}\n    }\n}\n\n/* Return the symbol name and value for an ADDR.  */\n\nstatic void\nelf_syminfo (struct backtrace_state *state, uintptr_t addr,\n\t     backtrace_syminfo_callback callback,\n\t     backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t     void *data)\n{\n  struct elf_syminfo_data *edata;\n  struct elf_symbol *sym = NULL;\n\n  if (!state->threaded)\n    {\n      for (edata = (struct elf_syminfo_data *) state->syminfo_data;\n\t   edata != NULL;\n\t   edata = edata->next)\n\t{\n\t  sym = ((struct elf_symbol *)\n\t\t bsearch (&addr, edata->symbols, edata->count,\n\t\t\t  sizeof (struct elf_symbol), elf_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\t}\n    }\n  else\n    {\n      struct elf_syminfo_data **pp;\n\n      pp = (struct elf_syminfo_data **) (void *) &state->syminfo_data;\n      while (1)\n\t{\n\t  edata = backtrace_atomic_load_pointer (pp);\n\t  if (edata == NULL)\n\t    break;\n\n\t  sym = ((struct elf_symbol *)\n\t\t bsearch (&addr, edata->symbols, edata->count,\n\t\t\t  sizeof (struct elf_symbol), elf_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\n\t  pp = &edata->next;\n\t}\n    }\n\n  if (sym == NULL)\n    callback (data, addr, NULL, 0, 0);\n  else\n    callback (data, addr, sym->name, sym->address, sym->size);\n}\n\n/* Return whether FILENAME is a symlink.  */\n\nstatic int\nelf_is_symlink (const char *filename)\n{\n  struct stat st;\n\n  if (lstat (filename, &st) < 0)\n    return 0;\n  return S_ISLNK (st.st_mode);\n}\n\n/* Return the results of reading the symlink FILENAME in a buffer\n   allocated by backtrace_alloc.  Return the length of the buffer in\n   *LEN.  */\n\nstatic char *\nelf_readlink (struct backtrace_state *state, const char *filename,\n\t      backtrace_error_callback error_callback, void *data,\n\t      size_t *plen)\n{\n  size_t len;\n  char *buf;\n\n  len = 128;\n  while (1)\n    {\n      ssize_t rl;\n\n      buf = backtrace_alloc (state, len, error_callback, data);\n      if (buf == NULL)\n\treturn NULL;\n      rl = readlink (filename, buf, len);\n      if (rl < 0)\n\t{\n\t  backtrace_free (state, buf, len, error_callback, data);\n\t  return NULL;\n\t}\n      if ((size_t) rl < len - 1)\n\t{\n\t  buf[rl] = '\\0';\n\t  *plen = len;\n\t  return buf;\n\t}\n      backtrace_free (state, buf, len, error_callback, data);\n      len *= 2;\n    }\n}\n\n#define SYSTEM_BUILD_ID_DIR \"/usr/lib/debug/.build-id/\"\n\n/* Open a separate debug info file, using the build ID to find it.\n   Returns an open file descriptor, or -1.\n\n   The GDB manual says that the only place gdb looks for a debug file\n   when the build ID is known is in /usr/lib/debug/.build-id.  */\n\nstatic int\nelf_open_debugfile_by_buildid (struct backtrace_state *state,\n\t\t\t       const char *buildid_data, size_t buildid_size,\n\t\t\t       backtrace_error_callback error_callback,\n\t\t\t       void *data)\n{\n  const char * const prefix = SYSTEM_BUILD_ID_DIR;\n  const size_t prefix_len = strlen (prefix);\n  const char * const suffix = \".debug\";\n  const size_t suffix_len = strlen (suffix);\n  size_t len;\n  char *bd_filename;\n  char *t;\n  size_t i;\n  int ret;\n  int does_not_exist;\n\n  len = prefix_len + buildid_size * 2 + suffix_len + 2;\n  bd_filename = backtrace_alloc (state, len, error_callback, data);\n  if (bd_filename == NULL)\n    return -1;\n\n  t = bd_filename;\n  memcpy (t, prefix, prefix_len);\n  t += prefix_len;\n  for (i = 0; i < buildid_size; i++)\n    {\n      unsigned char b;\n      unsigned char nib;\n\n      b = (unsigned char) buildid_data[i];\n      nib = (b & 0xf0) >> 4;\n      *t++ = nib < 10 ? '0' + nib : 'a' + nib - 10;\n      nib = b & 0x0f;\n      *t++ = nib < 10 ? '0' + nib : 'a' + nib - 10;\n      if (i == 0)\n\t*t++ = '/';\n    }\n  memcpy (t, suffix, suffix_len);\n  t[suffix_len] = '\\0';\n\n  ret = backtrace_open (bd_filename, error_callback, data, &does_not_exist);\n\n  backtrace_free (state, bd_filename, len, error_callback, data);\n\n  /* gdb checks that the debuginfo file has the same build ID note.\n     That seems kind of pointless to me--why would it have the right\n     name but not the right build ID?--so skipping the check.  */\n\n  return ret;\n}\n\n/* Try to open a file whose name is PREFIX (length PREFIX_LEN)\n   concatenated with PREFIX2 (length PREFIX2_LEN) concatenated with\n   DEBUGLINK_NAME.  Returns an open file descriptor, or -1.  */\n\nstatic int\nelf_try_debugfile (struct backtrace_state *state, const char *prefix,\n\t\t   size_t prefix_len, const char *prefix2, size_t prefix2_len,\n\t\t   const char *debuglink_name,\n\t\t   backtrace_error_callback error_callback, void *data)\n{\n  size_t debuglink_len;\n  size_t try_len;\n  char *try;\n  int does_not_exist;\n  int ret;\n\n  debuglink_len = strlen (debuglink_name);\n  try_len = prefix_len + prefix2_len + debuglink_len + 1;\n  try = backtrace_alloc (state, try_len, error_callback, data);\n  if (try == NULL)\n    return -1;\n\n  memcpy (try, prefix, prefix_len);\n  memcpy (try + prefix_len, prefix2, prefix2_len);\n  memcpy (try + prefix_len + prefix2_len, debuglink_name, debuglink_len);\n  try[prefix_len + prefix2_len + debuglink_len] = '\\0';\n\n  ret = backtrace_open (try, error_callback, data, &does_not_exist);\n\n  backtrace_free (state, try, try_len, error_callback, data);\n\n  return ret;\n}\n\n/* Find a separate debug info file, using the debuglink section data\n   to find it.  Returns an open file descriptor, or -1.  */\n\nstatic int\nelf_find_debugfile_by_debuglink (struct backtrace_state *state,\n\t\t\t\t const char *filename,\n\t\t\t\t const char *debuglink_name,\n\t\t\t\t backtrace_error_callback error_callback,\n\t\t\t\t void *data)\n{\n  int ret;\n  char *alc;\n  size_t alc_len;\n  const char *slash;\n  int ddescriptor;\n  const char *prefix;\n  size_t prefix_len;\n\n  /* Resolve symlinks in FILENAME.  Since FILENAME is fairly likely to\n     be /proc/self/exe, symlinks are common.  We don't try to resolve\n     the whole path name, just the base name.  */\n  ret = -1;\n  alc = NULL;\n  alc_len = 0;\n  while (elf_is_symlink (filename))\n    {\n      char *new_buf;\n      size_t new_len;\n\n      new_buf = elf_readlink (state, filename, error_callback, data, &new_len);\n      if (new_buf == NULL)\n\tbreak;\n\n      if (new_buf[0] == '/')\n\tfilename = new_buf;\n      else\n\t{\n\t  slash = strrchr (filename, '/');\n\t  if (slash == NULL)\n\t    filename = new_buf;\n\t  else\n\t    {\n\t      size_t clen;\n\t      char *c;\n\n\t      slash++;\n\t      clen = slash - filename + strlen (new_buf) + 1;\n\t      c = backtrace_alloc (state, clen, error_callback, data);\n\t      if (c == NULL)\n\t\tgoto done;\n\n\t      memcpy (c, filename, slash - filename);\n\t      memcpy (c + (slash - filename), new_buf, strlen (new_buf));\n\t      c[slash - filename + strlen (new_buf)] = '\\0';\n\t      backtrace_free (state, new_buf, new_len, error_callback, data);\n\t      filename = c;\n\t      new_buf = c;\n\t      new_len = clen;\n\t    }\n\t}\n\n      if (alc != NULL)\n\tbacktrace_free (state, alc, alc_len, error_callback, data);\n      alc = new_buf;\n      alc_len = new_len;\n    }\n\n  /* Look for DEBUGLINK_NAME in the same directory as FILENAME.  */\n\n  slash = strrchr (filename, '/');\n  if (slash == NULL)\n    {\n      prefix = \"\";\n      prefix_len = 0;\n    }\n  else\n    {\n      slash++;\n      prefix = filename;\n      prefix_len = slash - filename;\n    }\n\n  ddescriptor = elf_try_debugfile (state, prefix, prefix_len, \"\", 0,\n\t\t\t\t   debuglink_name, error_callback, data);\n  if (ddescriptor >= 0)\n    {\n      ret = ddescriptor;\n      goto done;\n    }\n\n  /* Look for DEBUGLINK_NAME in a .debug subdirectory of FILENAME.  */\n\n  ddescriptor = elf_try_debugfile (state, prefix, prefix_len, \".debug/\",\n\t\t\t\t   strlen (\".debug/\"), debuglink_name,\n\t\t\t\t   error_callback, data);\n  if (ddescriptor >= 0)\n    {\n      ret = ddescriptor;\n      goto done;\n    }\n\n  /* Look for DEBUGLINK_NAME in /usr/lib/debug.  */\n\n  ddescriptor = elf_try_debugfile (state, \"/usr/lib/debug/\",\n\t\t\t\t   strlen (\"/usr/lib/debug/\"), prefix,\n\t\t\t\t   prefix_len, debuglink_name,\n\t\t\t\t   error_callback, data);\n  if (ddescriptor >= 0)\n    ret = ddescriptor;\n\n done:\n  if (alc != NULL && alc_len > 0)\n    backtrace_free (state, alc, alc_len, error_callback, data);\n  return ret;\n}\n\n/* Open a separate debug info file, using the debuglink section data\n   to find it.  Returns an open file descriptor, or -1.  */\n\nstatic int\nelf_open_debugfile_by_debuglink (struct backtrace_state *state,\n\t\t\t\t const char *filename,\n\t\t\t\t const char *debuglink_name,\n\t\t\t\t uint32_t debuglink_crc,\n\t\t\t\t backtrace_error_callback error_callback,\n\t\t\t\t void *data)\n{\n  int ddescriptor;\n\n  ddescriptor = elf_find_debugfile_by_debuglink (state, filename,\n\t\t\t\t\t\t debuglink_name,\n\t\t\t\t\t\t error_callback, data);\n  if (ddescriptor < 0)\n    return -1;\n\n  if (debuglink_crc != 0)\n    {\n      uint32_t got_crc;\n\n      got_crc = elf_crc32_file (state, ddescriptor, error_callback, data);\n      if (got_crc != debuglink_crc)\n\t{\n\t  backtrace_close (ddescriptor, error_callback, data);\n\t  return -1;\n\t}\n    }\n\n  return ddescriptor;\n}\n\n/* A function useful for setting a breakpoint for an inflation failure\n   when this code is compiled with -g.  */\n\nstatic void\nelf_uncompress_failed(void)\n{\n}\n\n/* *PVAL is the current value being read from the stream, and *PBITS\n   is the number of valid bits.  Ensure that *PVAL holds at least 15\n   bits by reading additional bits from *PPIN, up to PINEND, as\n   needed.  Updates *PPIN, *PVAL and *PBITS.  Returns 1 on success, 0\n   on error.  */\n\nstatic int\nelf_fetch_bits (const unsigned char **ppin, const unsigned char *pinend,\n\t\tuint64_t *pval, unsigned int *pbits)\n{\n  unsigned int bits;\n  const unsigned char *pin;\n  uint64_t val;\n  uint32_t next;\n\n  bits = *pbits;\n  if (bits >= 15)\n    return 1;\n  pin = *ppin;\n  val = *pval;\n\n  if (unlikely (pinend - pin < 4))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) \\\n    && defined(__ORDER_BIG_ENDIAN__) \\\n    && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ \\\n        || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n  /* We've ensured that PIN is aligned.  */\n  next = *(const uint32_t *)pin;\n\n#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n  next = __builtin_bswap32 (next);\n#endif\n#else\n  next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24);\n#endif\n\n  val |= (uint64_t)next << bits;\n  bits += 32;\n  pin += 4;\n\n  /* We will need the next four bytes soon.  */\n  __builtin_prefetch (pin, 0, 0);\n\n  *ppin = pin;\n  *pval = val;\n  *pbits = bits;\n  return 1;\n}\n\n/* This is like elf_fetch_bits, but it fetchs the bits backward, and ensures at\n   least 16 bits.  This is for zstd.  */\n\nstatic int\nelf_fetch_bits_backward (const unsigned char **ppin,\n\t\t\t const unsigned char *pinend,\n\t\t\t uint64_t *pval, unsigned int *pbits)\n{\n  unsigned int bits;\n  const unsigned char *pin;\n  uint64_t val;\n  uint32_t next;\n\n  bits = *pbits;\n  if (bits >= 16)\n    return 1;\n  pin = *ppin;\n  val = *pval;\n\n  if (unlikely (pin <= pinend))\n    {\n      if (bits == 0)\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      return 1;\n    }\n\n  pin -= 4;\n\n#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) \\\n  && defined(__ORDER_BIG_ENDIAN__)\t\t\t\t\\\n  && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\t\t\t\\\n      || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n  /* We've ensured that PIN is aligned.  */\n  next = *(const uint32_t *)pin;\n\n#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n  next = __builtin_bswap32 (next);\n#endif\n#else\n  next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24);\n#endif\n\n  val <<= 32;\n  val |= next;\n  bits += 32;\n\n  if (unlikely (pin < pinend))\n    {\n      val >>= (pinend - pin) * 8;\n      bits -= (pinend - pin) * 8;\n    }\n\n  *ppin = pin;\n  *pval = val;\n  *pbits = bits;\n  return 1;\n}\n\n/* Initialize backward fetching when the bitstream starts with a 1 bit in the\n   last byte in memory (which is the first one that we read).  This is used by\n   zstd decompression.  Returns 1 on success, 0 on error.  */\n\nstatic int\nelf_fetch_backward_init (const unsigned char **ppin,\n\t\t\t const unsigned char *pinend,\n\t\t\t uint64_t *pval, unsigned int *pbits)\n{\n  const unsigned char *pin;\n  unsigned int stream_start;\n  uint64_t val;\n  unsigned int bits;\n\n  pin = *ppin;\n  stream_start = (unsigned int)*pin;\n  if (unlikely (stream_start == 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  val = 0;\n  bits = 0;\n\n  /* Align to a 32-bit boundary.  */\n  while ((((uintptr_t)pin) & 3) != 0)\n    {\n      val <<= 8;\n      val |= (uint64_t)*pin;\n      bits += 8;\n      --pin;\n    }\n\n  val <<= 8;\n  val |= (uint64_t)*pin;\n  bits += 8;\n\n  *ppin = pin;\n  *pval = val;\n  *pbits = bits;\n  if (!elf_fetch_bits_backward (ppin, pinend, pval, pbits))\n    return 0;\n\n  *pbits -= __builtin_clz (stream_start) - (sizeof (unsigned int) - 1) * 8 + 1;\n\n  if (!elf_fetch_bits_backward (ppin, pinend, pval, pbits))\n    return 0;\n\n  return 1;\n}\n\n/* Huffman code tables, like the rest of the zlib format, are defined\n   by RFC 1951.  We store a Huffman code table as a series of tables\n   stored sequentially in memory.  Each entry in a table is 16 bits.\n   The first, main, table has 256 entries.  It is followed by a set of\n   secondary tables of length 2 to 128 entries.  The maximum length of\n   a code sequence in the deflate format is 15 bits, so that is all we\n   need.  Each secondary table has an index, which is the offset of\n   the table in the overall memory storage.\n\n   The deflate format says that all codes of a given bit length are\n   lexicographically consecutive.  Perhaps we could have 130 values\n   that require a 15-bit code, perhaps requiring three secondary\n   tables of size 128.  I don't know if this is actually possible, but\n   it suggests that the maximum size required for secondary tables is\n   3 * 128 + 3 * 64 ... == 768.  The zlib enough program reports 660\n   as the maximum.  We permit 768, since in addition to the 256 for\n   the primary table, with two bytes per entry, and with the two\n   tables we need, that gives us a page.\n\n   A single table entry needs to store a value or (for the main table\n   only) the index and size of a secondary table.  Values range from 0\n   to 285, inclusive.  Secondary table indexes, per above, range from\n   0 to 510.  For a value we need to store the number of bits we need\n   to determine that value (one value may appear multiple times in the\n   table), which is 1 to 8.  For a secondary table we need to store\n   the number of bits used to index into the table, which is 1 to 7.\n   And of course we need 1 bit to decide whether we have a value or a\n   secondary table index.  So each entry needs 9 bits for value/table\n   index, 3 bits for size, 1 bit what it is.  For simplicity we use 16\n   bits per entry.  */\n\n/* Number of entries we allocate to for one code table.  We get a page\n   for the two code tables we need.  */\n\n#define ZLIB_HUFFMAN_TABLE_SIZE (1024)\n\n/* Bit masks and shifts for the values in the table.  */\n\n#define ZLIB_HUFFMAN_VALUE_MASK 0x01ff\n#define ZLIB_HUFFMAN_BITS_SHIFT 9\n#define ZLIB_HUFFMAN_BITS_MASK 0x7\n#define ZLIB_HUFFMAN_SECONDARY_SHIFT 12\n\n/* For working memory while inflating we need two code tables, we need\n   an array of code lengths (max value 15, so we use unsigned char),\n   and an array of unsigned shorts used while building a table.  The\n   latter two arrays must be large enough to hold the maximum number\n   of code lengths, which RFC 1951 defines as 286 + 30.  */\n\n#define ZLIB_TABLE_SIZE \\\n  (2 * ZLIB_HUFFMAN_TABLE_SIZE * sizeof (uint16_t) \\\n   + (286 + 30) * sizeof (uint16_t)\t      \\\n   + (286 + 30) * sizeof (unsigned char))\n\n#define ZLIB_TABLE_CODELEN_OFFSET \\\n  (2 * ZLIB_HUFFMAN_TABLE_SIZE * sizeof (uint16_t) \\\n   + (286 + 30) * sizeof (uint16_t))\n\n#define ZLIB_TABLE_WORK_OFFSET \\\n  (2 * ZLIB_HUFFMAN_TABLE_SIZE * sizeof (uint16_t))\n\n#ifdef BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE\n\n/* Used by the main function that generates the fixed table to learn\n   the table size.  */\nstatic size_t final_next_secondary;\n\n#endif\n\n/* Build a Huffman code table from an array of lengths in CODES of\n   length CODES_LEN.  The table is stored into *TABLE.  ZDEBUG_TABLE\n   is the same as for elf_zlib_inflate, used to find some work space.\n   Returns 1 on success, 0 on error.  */\n\nstatic int\nelf_zlib_inflate_table (unsigned char *codes, size_t codes_len,\n\t\t\tuint16_t *zdebug_table, uint16_t *table)\n{\n  uint16_t count[16];\n  uint16_t start[16];\n  uint16_t prev[16];\n  uint16_t firstcode[7];\n  uint16_t *next;\n  size_t i;\n  size_t j;\n  unsigned int code;\n  size_t next_secondary;\n\n  /* Count the number of code of each length.  Set NEXT[val] to be the\n     next value after VAL with the same bit length.  */\n\n  next = (uint16_t *) (((unsigned char *) zdebug_table)\n\t\t       + ZLIB_TABLE_WORK_OFFSET);\n\n  memset (&count[0], 0, 16 * sizeof (uint16_t));\n  for (i = 0; i < codes_len; ++i)\n    {\n      if (unlikely (codes[i] >= 16))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      if (count[codes[i]] == 0)\n\t{\n\t  start[codes[i]] = i;\n\t  prev[codes[i]] = i;\n\t}\n      else\n\t{\n\t  next[prev[codes[i]]] = i;\n\t  prev[codes[i]] = i;\n\t}\n\n      ++count[codes[i]];\n    }\n\n  /* For each length, fill in the table for the codes of that\n     length.  */\n\n  memset (table, 0, ZLIB_HUFFMAN_TABLE_SIZE * sizeof (uint16_t));\n\n  /* Handle the values that do not require a secondary table.  */\n\n  code = 0;\n  for (j = 1; j <= 8; ++j)\n    {\n      unsigned int jcnt;\n      unsigned int val;\n\n      jcnt = count[j];\n      if (jcnt == 0)\n\tcontinue;\n\n      if (unlikely (jcnt > (1U << j)))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      /* There are JCNT values that have this length, the values\n\t starting from START[j] continuing through NEXT[VAL].  Those\n\t values are assigned consecutive values starting at CODE.  */\n\n      val = start[j];\n      for (i = 0; i < jcnt; ++i)\n\t{\n\t  uint16_t tval;\n\t  size_t ind;\n\t  unsigned int incr;\n\n\t  /* In the compressed bit stream, the value VAL is encoded as\n\t     J bits with the value C.  */\n\n\t  if (unlikely ((val & ~ZLIB_HUFFMAN_VALUE_MASK) != 0))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  tval = val | ((j - 1) << ZLIB_HUFFMAN_BITS_SHIFT);\n\n\t  /* The table lookup uses 8 bits.  If J is less than 8, we\n\t     don't know what the other bits will be.  We need to fill\n\t     in all possibilities in the table.  Since the Huffman\n\t     code is unambiguous, those entries can't be used for any\n\t     other code.  */\n\n\t  for (ind = code; ind < 0x100; ind += 1 << j)\n\t    {\n\t      if (unlikely (table[ind] != 0))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      table[ind] = tval;\n\t    }\n\n\t  /* Advance to the next value with this length.  */\n\t  if (i + 1 < jcnt)\n\t    val = next[val];\n\n\t  /* The Huffman codes are stored in the bitstream with the\n\t     most significant bit first, as is required to make them\n\t     unambiguous.  The effect is that when we read them from\n\t     the bitstream we see the bit sequence in reverse order:\n\t     the most significant bit of the Huffman code is the least\n\t     significant bit of the value we read from the bitstream.\n\t     That means that to make our table lookups work, we need\n\t     to reverse the bits of CODE.  Since reversing bits is\n\t     tedious and in general requires using a table, we instead\n\t     increment CODE in reverse order.  That is, if the number\n\t     of bits we are currently using, here named J, is 3, we\n\t     count as 000, 100, 010, 110, 001, 101, 011, 111, which is\n\t     to say the numbers from 0 to 7 but with the bits\n\t     reversed.  Going to more bits, aka incrementing J,\n\t     effectively just adds more zero bits as the beginning,\n\t     and as such does not change the numeric value of CODE.\n\n\t     To increment CODE of length J in reverse order, find the\n\t     most significant zero bit and set it to one while\n\t     clearing all higher bits.  In other words, add 1 modulo\n\t     2^J, only reversed.  */\n\n\t  incr = 1U << (j - 1);\n\t  while ((code & incr) != 0)\n\t    incr >>= 1;\n\t  if (incr == 0)\n\t    code = 0;\n\t  else\n\t    {\n\t      code &= incr - 1;\n\t      code += incr;\n\t    }\n\t}\n    }\n\n  /* Handle the values that require a secondary table.  */\n\n  /* Set FIRSTCODE, the number at which the codes start, for each\n     length.  */\n\n  for (j = 9; j < 16; j++)\n    {\n      unsigned int jcnt;\n      unsigned int k;\n\n      jcnt = count[j];\n      if (jcnt == 0)\n\tcontinue;\n\n      /* There are JCNT values that have this length, the values\n\t starting from START[j].  Those values are assigned\n\t consecutive values starting at CODE.  */\n\n      firstcode[j - 9] = code;\n\n      /* Reverse add JCNT to CODE modulo 2^J.  */\n      for (k = 0; k < j; ++k)\n\t{\n\t  if ((jcnt & (1U << k)) != 0)\n\t    {\n\t      unsigned int m;\n\t      unsigned int bit;\n\n\t      bit = 1U << (j - k - 1);\n\t      for (m = 0; m < j - k; ++m, bit >>= 1)\n\t\t{\n\t\t  if ((code & bit) == 0)\n\t\t    {\n\t\t      code += bit;\n\t\t      break;\n\t\t    }\n\t\t  code &= ~bit;\n\t\t}\n\t      jcnt &= ~(1U << k);\n\t    }\n\t}\n      if (unlikely (jcnt != 0))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n    }\n\n  /* For J from 9 to 15, inclusive, we store COUNT[J] consecutive\n     values starting at START[J] with consecutive codes starting at\n     FIRSTCODE[J - 9].  In the primary table we need to point to the\n     secondary table, and the secondary table will be indexed by J - 9\n     bits.  We count down from 15 so that we install the larger\n     secondary tables first, as the smaller ones may be embedded in\n     the larger ones.  */\n\n  next_secondary = 0; /* Index of next secondary table (after primary).  */\n  for (j = 15; j >= 9; j--)\n    {\n      unsigned int jcnt;\n      unsigned int val;\n      size_t primary; /* Current primary index.  */\n      size_t secondary; /* Offset to current secondary table.  */\n      size_t secondary_bits; /* Bit size of current secondary table.  */\n\n      jcnt = count[j];\n      if (jcnt == 0)\n\tcontinue;\n\n      val = start[j];\n      code = firstcode[j - 9];\n      primary = 0x100;\n      secondary = 0;\n      secondary_bits = 0;\n      for (i = 0; i < jcnt; ++i)\n\t{\n\t  uint16_t tval;\n\t  size_t ind;\n\t  unsigned int incr;\n\n\t  if ((code & 0xff) != primary)\n\t    {\n\t      uint16_t tprimary;\n\n\t      /* Fill in a new primary table entry.  */\n\n\t      primary = code & 0xff;\n\n\t      tprimary = table[primary];\n\t      if (tprimary == 0)\n\t\t{\n\t\t  /* Start a new secondary table.  */\n\n\t\t  if (unlikely ((next_secondary & ZLIB_HUFFMAN_VALUE_MASK)\n\t\t\t\t!= next_secondary))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\n\t\t  secondary = next_secondary;\n\t\t  secondary_bits = j - 8;\n\t\t  next_secondary += 1 << secondary_bits;\n\t\t  table[primary] = (secondary\n\t\t\t\t    + ((j - 8) << ZLIB_HUFFMAN_BITS_SHIFT)\n\t\t\t\t    + (1U << ZLIB_HUFFMAN_SECONDARY_SHIFT));\n\t\t}\n\t      else\n\t\t{\n\t\t  /* There is an existing entry.  It had better be a\n\t\t     secondary table with enough bits.  */\n\t\t  if (unlikely ((tprimary\n\t\t\t\t & (1U << ZLIB_HUFFMAN_SECONDARY_SHIFT))\n\t\t\t\t== 0))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t  secondary = tprimary & ZLIB_HUFFMAN_VALUE_MASK;\n\t\t  secondary_bits = ((tprimary >> ZLIB_HUFFMAN_BITS_SHIFT)\n\t\t\t\t    & ZLIB_HUFFMAN_BITS_MASK);\n\t\t  if (unlikely (secondary_bits < j - 8))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t}\n\t    }\n\n\t  /* Fill in secondary table entries.  */\n\n\t  tval = val | ((j - 8) << ZLIB_HUFFMAN_BITS_SHIFT);\n\n\t  for (ind = code >> 8;\n\t       ind < (1U << secondary_bits);\n\t       ind += 1U << (j - 8))\n\t    {\n\t      if (unlikely (table[secondary + 0x100 + ind] != 0))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      table[secondary + 0x100 + ind] = tval;\n\t    }\n\n\t  if (i + 1 < jcnt)\n\t    val = next[val];\n\n\t  incr = 1U << (j - 1);\n\t  while ((code & incr) != 0)\n\t    incr >>= 1;\n\t  if (incr == 0)\n\t    code = 0;\n\t  else\n\t    {\n\t      code &= incr - 1;\n\t      code += incr;\n\t    }\n\t}\n    }\n\n#ifdef BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE\n  final_next_secondary = next_secondary;\n#endif\n\n  return 1;\n}\n\n#ifdef BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE\n\n/* Used to generate the fixed Huffman table for block type 1.  */\n\n#include <stdio.h>\n\nstatic uint16_t table[ZLIB_TABLE_SIZE];\nstatic unsigned char codes[288];\n\nint\nmain ()\n{\n  size_t i;\n\n  for (i = 0; i <= 143; ++i)\n    codes[i] = 8;\n  for (i = 144; i <= 255; ++i)\n    codes[i] = 9;\n  for (i = 256; i <= 279; ++i)\n    codes[i] = 7;\n  for (i = 280; i <= 287; ++i)\n    codes[i] = 8;\n  if (!elf_zlib_inflate_table (&codes[0], 288, &table[0], &table[0]))\n    {\n      fprintf (stderr, \"elf_zlib_inflate_table failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  printf (\"static const uint16_t elf_zlib_default_table[%#zx] =\\n\",\n\t  final_next_secondary + 0x100);\n  printf (\"{\\n\");\n  for (i = 0; i < final_next_secondary + 0x100; i += 8)\n    {\n      size_t j;\n\n      printf (\" \");\n      for (j = i; j < final_next_secondary + 0x100 && j < i + 8; ++j)\n\tprintf (\" %#x,\", table[j]);\n      printf (\"\\n\");\n    }\n  printf (\"};\\n\");\n  printf (\"\\n\");\n\n  for (i = 0; i < 32; ++i)\n    codes[i] = 5;\n  if (!elf_zlib_inflate_table (&codes[0], 32, &table[0], &table[0]))\n    {\n      fprintf (stderr, \"elf_zlib_inflate_table failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  printf (\"static const uint16_t elf_zlib_default_dist_table[%#zx] =\\n\",\n\t  final_next_secondary + 0x100);\n  printf (\"{\\n\");\n  for (i = 0; i < final_next_secondary + 0x100; i += 8)\n    {\n      size_t j;\n\n      printf (\" \");\n      for (j = i; j < final_next_secondary + 0x100 && j < i + 8; ++j)\n\tprintf (\" %#x,\", table[j]);\n      printf (\"\\n\");\n    }\n  printf (\"};\\n\");\n\n  return 0;\n}\n\n#endif\n\n/* The fixed tables generated by the #ifdef'ed out main function\n   above.  */\n\nstatic const uint16_t elf_zlib_default_table[0x170] =\n{\n  0xd00, 0xe50, 0xe10, 0xf18, 0xd10, 0xe70, 0xe30, 0x1230,\n  0xd08, 0xe60, 0xe20, 0x1210, 0xe00, 0xe80, 0xe40, 0x1250,\n  0xd04, 0xe58, 0xe18, 0x1200, 0xd14, 0xe78, 0xe38, 0x1240,\n  0xd0c, 0xe68, 0xe28, 0x1220, 0xe08, 0xe88, 0xe48, 0x1260,\n  0xd02, 0xe54, 0xe14, 0xf1c, 0xd12, 0xe74, 0xe34, 0x1238,\n  0xd0a, 0xe64, 0xe24, 0x1218, 0xe04, 0xe84, 0xe44, 0x1258,\n  0xd06, 0xe5c, 0xe1c, 0x1208, 0xd16, 0xe7c, 0xe3c, 0x1248,\n  0xd0e, 0xe6c, 0xe2c, 0x1228, 0xe0c, 0xe8c, 0xe4c, 0x1268,\n  0xd01, 0xe52, 0xe12, 0xf1a, 0xd11, 0xe72, 0xe32, 0x1234,\n  0xd09, 0xe62, 0xe22, 0x1214, 0xe02, 0xe82, 0xe42, 0x1254,\n  0xd05, 0xe5a, 0xe1a, 0x1204, 0xd15, 0xe7a, 0xe3a, 0x1244,\n  0xd0d, 0xe6a, 0xe2a, 0x1224, 0xe0a, 0xe8a, 0xe4a, 0x1264,\n  0xd03, 0xe56, 0xe16, 0xf1e, 0xd13, 0xe76, 0xe36, 0x123c,\n  0xd0b, 0xe66, 0xe26, 0x121c, 0xe06, 0xe86, 0xe46, 0x125c,\n  0xd07, 0xe5e, 0xe1e, 0x120c, 0xd17, 0xe7e, 0xe3e, 0x124c,\n  0xd0f, 0xe6e, 0xe2e, 0x122c, 0xe0e, 0xe8e, 0xe4e, 0x126c,\n  0xd00, 0xe51, 0xe11, 0xf19, 0xd10, 0xe71, 0xe31, 0x1232,\n  0xd08, 0xe61, 0xe21, 0x1212, 0xe01, 0xe81, 0xe41, 0x1252,\n  0xd04, 0xe59, 0xe19, 0x1202, 0xd14, 0xe79, 0xe39, 0x1242,\n  0xd0c, 0xe69, 0xe29, 0x1222, 0xe09, 0xe89, 0xe49, 0x1262,\n  0xd02, 0xe55, 0xe15, 0xf1d, 0xd12, 0xe75, 0xe35, 0x123a,\n  0xd0a, 0xe65, 0xe25, 0x121a, 0xe05, 0xe85, 0xe45, 0x125a,\n  0xd06, 0xe5d, 0xe1d, 0x120a, 0xd16, 0xe7d, 0xe3d, 0x124a,\n  0xd0e, 0xe6d, 0xe2d, 0x122a, 0xe0d, 0xe8d, 0xe4d, 0x126a,\n  0xd01, 0xe53, 0xe13, 0xf1b, 0xd11, 0xe73, 0xe33, 0x1236,\n  0xd09, 0xe63, 0xe23, 0x1216, 0xe03, 0xe83, 0xe43, 0x1256,\n  0xd05, 0xe5b, 0xe1b, 0x1206, 0xd15, 0xe7b, 0xe3b, 0x1246,\n  0xd0d, 0xe6b, 0xe2b, 0x1226, 0xe0b, 0xe8b, 0xe4b, 0x1266,\n  0xd03, 0xe57, 0xe17, 0xf1f, 0xd13, 0xe77, 0xe37, 0x123e,\n  0xd0b, 0xe67, 0xe27, 0x121e, 0xe07, 0xe87, 0xe47, 0x125e,\n  0xd07, 0xe5f, 0xe1f, 0x120e, 0xd17, 0xe7f, 0xe3f, 0x124e,\n  0xd0f, 0xe6f, 0xe2f, 0x122e, 0xe0f, 0xe8f, 0xe4f, 0x126e,\n  0x290, 0x291, 0x292, 0x293, 0x294, 0x295, 0x296, 0x297,\n  0x298, 0x299, 0x29a, 0x29b, 0x29c, 0x29d, 0x29e, 0x29f,\n  0x2a0, 0x2a1, 0x2a2, 0x2a3, 0x2a4, 0x2a5, 0x2a6, 0x2a7,\n  0x2a8, 0x2a9, 0x2aa, 0x2ab, 0x2ac, 0x2ad, 0x2ae, 0x2af,\n  0x2b0, 0x2b1, 0x2b2, 0x2b3, 0x2b4, 0x2b5, 0x2b6, 0x2b7,\n  0x2b8, 0x2b9, 0x2ba, 0x2bb, 0x2bc, 0x2bd, 0x2be, 0x2bf,\n  0x2c0, 0x2c1, 0x2c2, 0x2c3, 0x2c4, 0x2c5, 0x2c6, 0x2c7,\n  0x2c8, 0x2c9, 0x2ca, 0x2cb, 0x2cc, 0x2cd, 0x2ce, 0x2cf,\n  0x2d0, 0x2d1, 0x2d2, 0x2d3, 0x2d4, 0x2d5, 0x2d6, 0x2d7,\n  0x2d8, 0x2d9, 0x2da, 0x2db, 0x2dc, 0x2dd, 0x2de, 0x2df,\n  0x2e0, 0x2e1, 0x2e2, 0x2e3, 0x2e4, 0x2e5, 0x2e6, 0x2e7,\n  0x2e8, 0x2e9, 0x2ea, 0x2eb, 0x2ec, 0x2ed, 0x2ee, 0x2ef,\n  0x2f0, 0x2f1, 0x2f2, 0x2f3, 0x2f4, 0x2f5, 0x2f6, 0x2f7,\n  0x2f8, 0x2f9, 0x2fa, 0x2fb, 0x2fc, 0x2fd, 0x2fe, 0x2ff,\n};\n\nstatic const uint16_t elf_zlib_default_dist_table[0x100] =\n{\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n  0x800, 0x810, 0x808, 0x818, 0x804, 0x814, 0x80c, 0x81c,\n  0x802, 0x812, 0x80a, 0x81a, 0x806, 0x816, 0x80e, 0x81e,\n  0x801, 0x811, 0x809, 0x819, 0x805, 0x815, 0x80d, 0x81d,\n  0x803, 0x813, 0x80b, 0x81b, 0x807, 0x817, 0x80f, 0x81f,\n};\n\n/* Inflate a zlib stream from PIN/SIN to POUT/SOUT.  Return 1 on\n   success, 0 on some error parsing the stream.  */\n\nstatic int\nelf_zlib_inflate (const unsigned char *pin, size_t sin, uint16_t *zdebug_table,\n\t\t  unsigned char *pout, size_t sout)\n{\n  unsigned char *porigout;\n  const unsigned char *pinend;\n  unsigned char *poutend;\n\n  /* We can apparently see multiple zlib streams concatenated\n     together, so keep going as long as there is something to read.\n     The last 4 bytes are the checksum.  */\n  porigout = pout;\n  pinend = pin + sin;\n  poutend = pout + sout;\n  while ((pinend - pin) > 4)\n    {\n      uint64_t val;\n      unsigned int bits;\n      int last;\n\n      /* Read the two byte zlib header.  */\n\n      if (unlikely ((pin[0] & 0xf) != 8)) /* 8 is zlib encoding.  */\n\t{\n\t  /* Unknown compression method.  */\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      if (unlikely ((pin[0] >> 4) > 7))\n\t{\n\t  /* Window size too large.  Other than this check, we don't\n\t     care about the window size.  */\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      if (unlikely ((pin[1] & 0x20) != 0))\n\t{\n\t  /* Stream expects a predefined dictionary, but we have no\n\t     dictionary.  */\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      val = (pin[0] << 8) | pin[1];\n      if (unlikely (val % 31 != 0))\n\t{\n\t  /* Header check failure.  */\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      pin += 2;\n\n      /* Align PIN to a 32-bit boundary.  */\n\n      val = 0;\n      bits = 0;\n      while ((((uintptr_t) pin) & 3) != 0)\n\t{\n\t  val |= (uint64_t)*pin << bits;\n\t  bits += 8;\n\t  ++pin;\n\t}\n\n      /* Read blocks until one is marked last.  */\n\n      last = 0;\n\n      while (!last)\n\t{\n\t  unsigned int type;\n\t  const uint16_t *tlit;\n\t  const uint16_t *tdist;\n\n\t  if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t    return 0;\n\n\t  last = val & 1;\n\t  type = (val >> 1) & 3;\n\t  val >>= 3;\n\t  bits -= 3;\n\n\t  if (unlikely (type == 3))\n\t    {\n\t      /* Invalid block type.  */\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  if (type == 0)\n\t    {\n\t      uint16_t len;\n\t      uint16_t lenc;\n\n\t      /* An uncompressed block.  */\n\n\t      /* If we've read ahead more than a byte, back up.  */\n\t      while (bits >= 8)\n\t\t{\n\t\t  --pin;\n\t\t  bits -= 8;\n\t\t}\n\n\t      val = 0;\n\t      bits = 0;\n\t      if (unlikely ((pinend - pin) < 4))\n\t\t{\n\t\t  /* Missing length.  */\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      len = pin[0] | (pin[1] << 8);\n\t      lenc = pin[2] | (pin[3] << 8);\n\t      pin += 4;\n\t      lenc = ~lenc;\n\t      if (unlikely (len != lenc))\n\t\t{\n\t\t  /* Corrupt data.  */\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      if (unlikely (len > (unsigned int) (pinend - pin)\n\t\t\t    || len > (unsigned int) (poutend - pout)))\n\t\t{\n\t\t  /* Not enough space in buffers.  */\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      memcpy (pout, pin, len);\n\t      pout += len;\n\t      pin += len;\n\n\t      /* Align PIN.  */\n\t      while ((((uintptr_t) pin) & 3) != 0)\n\t\t{\n\t\t  val |= (uint64_t)*pin << bits;\n\t\t  bits += 8;\n\t\t  ++pin;\n\t\t}\n\n\t      /* Go around to read the next block.  */\n\t      continue;\n\t    }\n\n\t  if (type == 1)\n\t    {\n\t      tlit = elf_zlib_default_table;\n\t      tdist = elf_zlib_default_dist_table;\n\t    }\n\t  else\n\t    {\n\t      unsigned int nlit;\n\t      unsigned int ndist;\n\t      unsigned int nclen;\n\t      unsigned char codebits[19];\n\t      unsigned char *plenbase;\n\t      unsigned char *plen;\n\t      unsigned char *plenend;\n\n\t      /* Read a Huffman encoding table.  The various magic\n\t\t numbers here are from RFC 1951.  */\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      nlit = (val & 0x1f) + 257;\n\t      val >>= 5;\n\t      ndist = (val & 0x1f) + 1;\n\t      val >>= 5;\n\t      nclen = (val & 0xf) + 4;\n\t      val >>= 4;\n\t      bits -= 14;\n\t      if (unlikely (nlit > 286 || ndist > 30))\n\t\t{\n\t\t  /* Values out of range.  */\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\n\t      /* Read and build the table used to compress the\n\t\t literal, length, and distance codes.  */\n\n\t      memset(&codebits[0], 0, 19);\n\n\t      /* There are always at least 4 elements in the\n\t\t table.  */\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      codebits[16] = val & 7;\n\t      codebits[17] = (val >> 3) & 7;\n\t      codebits[18] = (val >> 6) & 7;\n\t      codebits[0] = (val >> 9) & 7;\n\t      val >>= 12;\n\t      bits -= 12;\n\n\t      if (nclen == 4)\n\t\tgoto codebitsdone;\n\n\t      codebits[8] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 5)\n\t\tgoto codebitsdone;\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      codebits[7] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 6)\n\t\tgoto codebitsdone;\n\n\t      codebits[9] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 7)\n\t\tgoto codebitsdone;\n\n\t      codebits[6] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 8)\n\t\tgoto codebitsdone;\n\n\t      codebits[10] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 9)\n\t\tgoto codebitsdone;\n\n\t      codebits[5] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 10)\n\t\tgoto codebitsdone;\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      codebits[11] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 11)\n\t\tgoto codebitsdone;\n\n\t      codebits[4] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 12)\n\t\tgoto codebitsdone;\n\n\t      codebits[12] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 13)\n\t\tgoto codebitsdone;\n\n\t      codebits[3] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 14)\n\t\tgoto codebitsdone;\n\n\t      codebits[13] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 15)\n\t\tgoto codebitsdone;\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      codebits[2] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 16)\n\t\tgoto codebitsdone;\n\n\t      codebits[14] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 17)\n\t\tgoto codebitsdone;\n\n\t      codebits[1] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t      if (nclen == 18)\n\t\tgoto codebitsdone;\n\n\t      codebits[15] = val & 7;\n\t      val >>= 3;\n\t      bits -= 3;\n\n\t    codebitsdone:\n\n\t      if (!elf_zlib_inflate_table (codebits, 19, zdebug_table,\n\t\t\t\t\t   zdebug_table))\n\t\treturn 0;\n\n\t      /* Read the compressed bit lengths of the literal,\n\t\t length, and distance codes.  We have allocated space\n\t\t at the end of zdebug_table to hold them.  */\n\n\t      plenbase = (((unsigned char *) zdebug_table)\n\t\t\t  + ZLIB_TABLE_CODELEN_OFFSET);\n\t      plen = plenbase;\n\t      plenend = plen + nlit + ndist;\n\t      while (plen < plenend)\n\t\t{\n\t\t  uint16_t t;\n\t\t  unsigned int b;\n\t\t  uint16_t v;\n\n\t\t  if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\t    return 0;\n\n\t\t  t = zdebug_table[val & 0xff];\n\n\t\t  /* The compression here uses bit lengths up to 7, so\n\t\t     a secondary table is never necessary.  */\n\t\t  if (unlikely ((t & (1U << ZLIB_HUFFMAN_SECONDARY_SHIFT))\n\t\t\t\t!= 0))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\n\t\t  b = (t >> ZLIB_HUFFMAN_BITS_SHIFT) & ZLIB_HUFFMAN_BITS_MASK;\n\t\t  val >>= b + 1;\n\t\t  bits -= b + 1;\n\n\t\t  v = t & ZLIB_HUFFMAN_VALUE_MASK;\n\t\t  if (v < 16)\n\t\t    *plen++ = v;\n\t\t  else if (v == 16)\n\t\t    {\n\t\t      unsigned int c;\n\t\t      unsigned int prev;\n\n\t\t      /* Copy previous entry 3 to 6 times.  */\n\n\t\t      if (unlikely (plen == plenbase))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      /* We used up to 7 bits since the last\n\t\t\t elf_fetch_bits, so we have at least 8 bits\n\t\t\t available here.  */\n\n\t\t      c = 3 + (val & 0x3);\n\t\t      val >>= 2;\n\t\t      bits -= 2;\n\t\t      if (unlikely ((unsigned int) (plenend - plen) < c))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      prev = plen[-1];\n\t\t      switch (c)\n\t\t\t{\n\t\t\tcase 6:\n\t\t\t  *plen++ = prev;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 5:\n\t\t\t  *plen++ = prev;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 4:\n\t\t\t  *plen++ = prev;\n\t\t\t}\n\t\t      *plen++ = prev;\n\t\t      *plen++ = prev;\n\t\t      *plen++ = prev;\n\t\t    }\n\t\t  else if (v == 17)\n\t\t    {\n\t\t      unsigned int c;\n\n\t\t      /* Store zero 3 to 10 times.  */\n\n\t\t      /* We used up to 7 bits since the last\n\t\t\t elf_fetch_bits, so we have at least 8 bits\n\t\t\t available here.  */\n\n\t\t      c = 3 + (val & 0x7);\n\t\t      val >>= 3;\n\t\t      bits -= 3;\n\t\t      if (unlikely ((unsigned int) (plenend - plen) < c))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      switch (c)\n\t\t\t{\n\t\t\tcase 10:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 9:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 8:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 7:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 6:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 5:\n\t\t\t  *plen++ = 0;\n\t\t\t  ATTRIBUTE_FALLTHROUGH;\n\t\t\tcase 4:\n\t\t\t  *plen++ = 0;\n\t\t\t}\n\t\t      *plen++ = 0;\n\t\t      *plen++ = 0;\n\t\t      *plen++ = 0;\n\t\t    }\n\t\t  else if (v == 18)\n\t\t    {\n\t\t      unsigned int c;\n\n\t\t      /* Store zero 11 to 138 times.  */\n\n\t\t      /* We used up to 7 bits since the last\n\t\t\t elf_fetch_bits, so we have at least 8 bits\n\t\t\t available here.  */\n\n\t\t      c = 11 + (val & 0x7f);\n\t\t      val >>= 7;\n\t\t      bits -= 7;\n\t\t      if (unlikely ((unsigned int) (plenend - plen) < c))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      memset (plen, 0, c);\n\t\t      plen += c;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t}\n\n\t      /* Make sure that the stop code can appear.  */\n\n\t      plen = plenbase;\n\t      if (unlikely (plen[256] == 0))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\n\t      /* Build the decompression tables.  */\n\n\t      if (!elf_zlib_inflate_table (plen, nlit, zdebug_table,\n\t\t\t\t\t   zdebug_table))\n\t\treturn 0;\n\t      if (!elf_zlib_inflate_table (plen + nlit, ndist, zdebug_table,\n\t\t\t\t\t   (zdebug_table\n\t\t\t\t\t    + ZLIB_HUFFMAN_TABLE_SIZE)))\n\t\treturn 0;\n\t      tlit = zdebug_table;\n\t      tdist = zdebug_table + ZLIB_HUFFMAN_TABLE_SIZE;\n\t    }\n\n\t  /* Inflate values until the end of the block.  This is the\n\t     main loop of the inflation code.  */\n\n\t  while (1)\n\t    {\n\t      uint16_t t;\n\t      unsigned int b;\n\t      uint16_t v;\n\t      unsigned int lit;\n\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\n\t      t = tlit[val & 0xff];\n\t      b = (t >> ZLIB_HUFFMAN_BITS_SHIFT) & ZLIB_HUFFMAN_BITS_MASK;\n\t      v = t & ZLIB_HUFFMAN_VALUE_MASK;\n\n\t      if ((t & (1U << ZLIB_HUFFMAN_SECONDARY_SHIFT)) == 0)\n\t\t{\n\t\t  lit = v;\n\t\t  val >>= b + 1;\n\t\t  bits -= b + 1;\n\t\t}\n\t      else\n\t\t{\n\t\t  t = tlit[v + 0x100 + ((val >> 8) & ((1U << b) - 1))];\n\t\t  b = (t >> ZLIB_HUFFMAN_BITS_SHIFT) & ZLIB_HUFFMAN_BITS_MASK;\n\t\t  lit = t & ZLIB_HUFFMAN_VALUE_MASK;\n\t\t  val >>= b + 8;\n\t\t  bits -= b + 8;\n\t\t}\n\n\t      if (lit < 256)\n\t\t{\n\t\t  if (unlikely (pout == poutend))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\n\t\t  *pout++ = lit;\n\n\t\t  /* We will need to write the next byte soon.  We ask\n\t\t     for high temporal locality because we will write\n\t\t     to the whole cache line soon.  */\n\t\t  __builtin_prefetch (pout, 1, 3);\n\t\t}\n\t      else if (lit == 256)\n\t\t{\n\t\t  /* The end of the block.  */\n\t\t  break;\n\t\t}\n\t      else\n\t\t{\n\t\t  unsigned int dist;\n\t\t  unsigned int len;\n\n\t\t  /* Convert lit into a length.  */\n\n\t\t  if (lit < 265)\n\t\t    len = lit - 257 + 3;\n\t\t  else if (lit == 285)\n\t\t    len = 258;\n\t\t  else if (unlikely (lit > 285))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      unsigned int extra;\n\n\t\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\t\treturn 0;\n\n\t\t      /* This is an expression for the table of length\n\t\t\t codes in RFC 1951 3.2.5.  */\n\t\t      lit -= 265;\n\t\t      extra = (lit >> 2) + 1;\n\t\t      len = (lit & 3) << extra;\n\t\t      len += 11;\n\t\t      len += ((1U << (extra - 1)) - 1) << 3;\n\t\t      len += val & ((1U << extra) - 1);\n\t\t      val >>= extra;\n\t\t      bits -= extra;\n\t\t    }\n\n\t\t  if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\t    return 0;\n\n\t\t  t = tdist[val & 0xff];\n\t\t  b = (t >> ZLIB_HUFFMAN_BITS_SHIFT) & ZLIB_HUFFMAN_BITS_MASK;\n\t\t  v = t & ZLIB_HUFFMAN_VALUE_MASK;\n\n\t\t  if ((t & (1U << ZLIB_HUFFMAN_SECONDARY_SHIFT)) == 0)\n\t\t    {\n\t\t      dist = v;\n\t\t      val >>= b + 1;\n\t\t      bits -= b + 1;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      t = tdist[v + 0x100 + ((val >> 8) & ((1U << b) - 1))];\n\t\t      b = ((t >> ZLIB_HUFFMAN_BITS_SHIFT)\n\t\t\t   & ZLIB_HUFFMAN_BITS_MASK);\n\t\t      dist = t & ZLIB_HUFFMAN_VALUE_MASK;\n\t\t      val >>= b + 8;\n\t\t      bits -= b + 8;\n\t\t    }\n\n\t\t  /* Convert dist to a distance.  */\n\n\t\t  if (dist == 0)\n\t\t    {\n\t\t      /* A distance of 1.  A common case, meaning\n\t\t\t repeat the last character LEN times.  */\n\n\t\t      if (unlikely (pout == porigout))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      if (unlikely ((unsigned int) (poutend - pout) < len))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      memset (pout, pout[-1], len);\n\t\t      pout += len;\n\t\t    }\n\t\t  else if (unlikely (dist > 29))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      if (dist < 4)\n\t\t\tdist = dist + 1;\n\t\t      else\n\t\t\t{\n\t\t\t  unsigned int extra;\n\n\t\t\t  if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\t\t    return 0;\n\n\t\t\t  /* This is an expression for the table of\n\t\t\t     distance codes in RFC 1951 3.2.5.  */\n\t\t\t  dist -= 4;\n\t\t\t  extra = (dist >> 1) + 1;\n\t\t\t  dist = (dist & 1) << extra;\n\t\t\t  dist += 5;\n\t\t\t  dist += ((1U << (extra - 1)) - 1) << 2;\n\t\t\t  dist += val & ((1U << extra) - 1);\n\t\t\t  val >>= extra;\n\t\t\t  bits -= extra;\n\t\t\t}\n\n\t\t      /* Go back dist bytes, and copy len bytes from\n\t\t\t there.  */\n\n\t\t      if (unlikely ((unsigned int) (pout - porigout) < dist))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      if (unlikely ((unsigned int) (poutend - pout) < len))\n\t\t\t{\n\t\t\t  elf_uncompress_failed ();\n\t\t\t  return 0;\n\t\t\t}\n\n\t\t      if (dist >= len)\n\t\t\t{\n\t\t\t  memcpy (pout, pout - dist, len);\n\t\t\t  pout += len;\n\t\t\t}\n\t\t      else\n\t\t\t{\n\t\t\t  while (len > 0)\n\t\t\t    {\n\t\t\t      unsigned int copy;\n\n\t\t\t      copy = len < dist ? len : dist;\n\t\t\t      memcpy (pout, pout - dist, copy);\n\t\t\t      len -= copy;\n\t\t\t      pout += copy;\n\t\t\t    }\n\t\t\t}\n\t\t    }\n\t\t}\n\t    }\n\t}\n    }\n\n  /* We should have filled the output buffer.  */\n  if (unlikely (pout != poutend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  return 1;\n}\n\n/* Verify the zlib checksum.  The checksum is in the 4 bytes at\n   CHECKBYTES, and the uncompressed data is at UNCOMPRESSED /\n   UNCOMPRESSED_SIZE.  Returns 1 on success, 0 on failure.  */\n\nstatic int\nelf_zlib_verify_checksum (const unsigned char *checkbytes,\n\t\t\t  const unsigned char *uncompressed,\n\t\t\t  size_t uncompressed_size)\n{\n  unsigned int i;\n  unsigned int cksum;\n  const unsigned char *p;\n  uint32_t s1;\n  uint32_t s2;\n  size_t hsz;\n\n  cksum = 0;\n  for (i = 0; i < 4; i++)\n    cksum = (cksum << 8) | checkbytes[i];\n\n  s1 = 1;\n  s2 = 0;\n\n  /* Minimize modulo operations.  */\n\n  p = uncompressed;\n  hsz = uncompressed_size;\n  while (hsz >= 5552)\n    {\n      for (i = 0; i < 5552; i += 16)\n\t{\n\t  /* Manually unroll loop 16 times.  */\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t  s1 = s1 + *p++;\n\t  s2 = s2 + s1;\n\t}\n      hsz -= 5552;\n      s1 %= 65521;\n      s2 %= 65521;\n    }\n\n  while (hsz >= 16)\n    {\n      /* Manually unroll loop 16 times.  */\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n\n      hsz -= 16;\n    }\n\n  for (i = 0; i < hsz; ++i)\n    {\n      s1 = s1 + *p++;\n      s2 = s2 + s1;\n    }\n\n  s1 %= 65521;\n  s2 %= 65521;\n\n  if (unlikely ((s2 << 16) + s1 != cksum))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  return 1;\n}\n\n/* Inflate a zlib stream from PIN/SIN to POUT/SOUT, and verify the\n   checksum.  Return 1 on success, 0 on error.  */\n\nstatic int\nelf_zlib_inflate_and_verify (const unsigned char *pin, size_t sin,\n\t\t\t     uint16_t *zdebug_table, unsigned char *pout,\n\t\t\t     size_t sout)\n{\n  if (!elf_zlib_inflate (pin, sin, zdebug_table, pout, sout))\n    return 0;\n  if (!elf_zlib_verify_checksum (pin + sin - 4, pout, sout))\n    return 0;\n  return 1;\n}\n\n/* For working memory during zstd compression, we need\n   - a literal length FSE table: 512 64-bit values == 4096 bytes\n   - a match length FSE table: 512 64-bit values == 4096 bytes\n   - a offset FSE table: 256 64-bit values == 2048 bytes\n   - a Huffman tree: 2048 uint16_t values == 4096 bytes\n   - scratch space, one of\n     - to build an FSE table: 512 uint16_t values == 1024 bytes\n     - to build a Huffman tree: 512 uint16_t + 256 uint32_t == 2048 bytes\n*/\n\n#define ZSTD_TABLE_SIZE\t\t\t\t\t\\\n  (2 * 512 * sizeof (struct elf_zstd_fse_baseline_entry)\t\\\n   + 256 * sizeof (struct elf_zstd_fse_baseline_entry)\t\t\\\n   + 2048 * sizeof (uint16_t)\t\t\t\t\t\\\n   + 512 * sizeof (uint16_t) + 256 * sizeof (uint32_t))\n\n#define ZSTD_TABLE_LITERAL_FSE_OFFSET (0)\n\n#define ZSTD_TABLE_MATCH_FSE_OFFSET\t\t\t\\\n  (512 * sizeof (struct elf_zstd_fse_baseline_entry))\n\n#define ZSTD_TABLE_OFFSET_FSE_OFFSET\t\t\t\\\n  (ZSTD_TABLE_MATCH_FSE_OFFSET\t\t\t\t\\\n   + 512 * sizeof (struct elf_zstd_fse_baseline_entry))\n\n#define ZSTD_TABLE_HUFFMAN_OFFSET\t\t\t\t\t\\\n  (ZSTD_TABLE_OFFSET_FSE_OFFSET\t\t\t\t\t\t\\\n   + 256 * sizeof (struct elf_zstd_fse_baseline_entry))\n\n#define ZSTD_TABLE_WORK_OFFSET \\\n  (ZSTD_TABLE_HUFFMAN_OFFSET + 2048 * sizeof (uint16_t))\n\n/* An entry in a zstd FSE table.  */\n\nstruct elf_zstd_fse_entry\n{\n  /* The value that this FSE entry represents.  */\n  unsigned char symbol;\n  /* The number of bits to read to determine the next state.  */\n  unsigned char bits;\n  /* Add the bits to this base to get the next state.  */\n  uint16_t base;\n};\n\nstatic int\nelf_zstd_build_fse (const int16_t *, int, uint16_t *, int,\n\t\t    struct elf_zstd_fse_entry *);\n\n/* Read a zstd FSE table and build the decoding table in *TABLE, updating *PPIN\n   as it reads.  ZDEBUG_TABLE is scratch space; it must be enough for 512\n   uint16_t values (1024 bytes).  MAXIDX is the maximum number of symbols\n   permitted. *TABLE_BITS is the maximum number of bits for symbols in the\n   table: the size of *TABLE is at least 1 << *TABLE_BITS.  This updates\n   *TABLE_BITS to the actual number of bits.  Returns 1 on success, 0 on\n   error.  */\n\nstatic int\nelf_zstd_read_fse (const unsigned char **ppin, const unsigned char *pinend,\n\t\t   uint16_t *zdebug_table, int maxidx,\n\t\t   struct elf_zstd_fse_entry *table, int *table_bits)\n{\n  const unsigned char *pin;\n  int16_t *norm;\n  uint16_t *next;\n  uint64_t val;\n  unsigned int bits;\n  int accuracy_log;\n  uint32_t remaining;\n  uint32_t threshold;\n  int bits_needed;\n  int idx;\n  int prev0;\n\n  pin = *ppin;\n\n  norm = (int16_t *) zdebug_table;\n  next = zdebug_table + 256;\n\n  if (unlikely (pin + 3 >= pinend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Align PIN to a 32-bit boundary.  */\n\n  val = 0;\n  bits = 0;\n  while ((((uintptr_t) pin) & 3) != 0)\n    {\n      val |= (uint64_t)*pin << bits;\n      bits += 8;\n      ++pin;\n    }\n\n  if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n    return 0;\n\n  accuracy_log = (val & 0xf) + 5;\n  if (accuracy_log > *table_bits)\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  *table_bits = accuracy_log;\n  val >>= 4;\n  bits -= 4;\n\n  /* This code is mostly copied from the reference implementation.  */\n\n  /* The number of remaining probabilities, plus 1.  This sets the number of\n     bits that need to be read for the next value.  */\n  remaining = (1 << accuracy_log) + 1;\n\n  /* The current difference between small and large values, which depends on\n     the number of remaining values.  Small values use one less bit.  */\n  threshold = 1 << accuracy_log;\n\n  /* The number of bits used to compute threshold.  */\n  bits_needed = accuracy_log + 1;\n\n  /* The next character value.  */\n  idx = 0;\n\n  /* Whether the last count was 0.  */\n  prev0 = 0;\n\n  while (remaining > 1 && idx <= maxidx)\n    {\n      uint32_t max;\n      int32_t count;\n\n      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\treturn 0;\n\n      if (prev0)\n\t{\n\t  int zidx;\n\n\t  /* Previous count was 0, so there is a 2-bit repeat flag.  If the\n\t     2-bit flag is 0b11, it adds 3 and then there is another repeat\n\t     flag.  */\n\t  zidx = idx;\n\t  while ((val & 0xfff) == 0xfff)\n\t    {\n\t      zidx += 3 * 6;\n\t      val >>= 12;\n\t      bits -= 12;\n\t      if  (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\t    }\n\t  while ((val & 3) == 3)\n\t    {\n\t      zidx += 3;\n\t      val >>= 2;\n\t      bits -= 2;\n\t      if (!elf_fetch_bits (&pin, pinend, &val, &bits))\n\t\treturn 0;\n\t    }\n\t  /* We have at least 13 bits here, don't need to fetch.  */\n\t  zidx += val & 3;\n\t  val >>= 2;\n\t  bits -= 2;\n\n\t  if (unlikely (zidx > maxidx))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  for (; idx < zidx; idx++)\n\t    norm[idx] = 0;\n\n\t  prev0 = 0;\n\t  continue;\n\t}\n\n      max = (2 * threshold - 1) - remaining;\n      if ((val & (threshold - 1)) < max)\n\t{\n\t  /* A small value.  */\n\t  count = (int32_t) ((uint32_t) val & (threshold - 1));\n\t  val >>= bits_needed - 1;\n\t  bits -= bits_needed - 1;\n\t}\n      else\n\t{\n\t  /* A large value.  */\n\t  count = (int32_t) ((uint32_t) val & (2 * threshold - 1));\n\t  if (count >= (int32_t) threshold)\n\t    count -= (int32_t) max;\n\t  val >>= bits_needed;\n\t  bits -= bits_needed;\n\t}\n\n      count--;\n      if (count >= 0)\n\tremaining -= count;\n      else\n\tremaining--;\n      if (unlikely (idx >= 256))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      norm[idx] = (int16_t) count;\n      ++idx;\n\n      prev0 = count == 0;\n\n      while (remaining < threshold)\n\t{\n\t  bits_needed--;\n\t  threshold >>= 1;\n\t}\n    }\n\n  if (unlikely (remaining != 1))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* If we've read ahead more than a byte, back up.  */\n  while (bits >= 8)\n    {\n      --pin;\n      bits -= 8;\n    }\n\n  *ppin = pin;\n\n  for (; idx <= maxidx; idx++)\n    norm[idx] = 0;\n\n  return elf_zstd_build_fse (norm, idx, next, *table_bits, table);\n}\n\n/* Build the FSE decoding table from a list of probabilities.  This reads from\n   NORM of length IDX, uses NEXT as scratch space, and writes to *TABLE, whose\n   size is TABLE_BITS.  */\n\nstatic int\nelf_zstd_build_fse (const int16_t *norm, int idx, uint16_t *next,\n\t\t    int table_bits, struct elf_zstd_fse_entry *table)\n{\n  int table_size;\n  int high_threshold;\n  int i;\n  int pos;\n  int step;\n  int mask;\n\n  table_size = 1 << table_bits;\n  high_threshold = table_size - 1;\n  for (i = 0; i < idx; i++)\n    {\n      int16_t n;\n\n      n = norm[i];\n      if (n >= 0)\n\tnext[i] = (uint16_t) n;\n      else\n\t{\n\t  table[high_threshold].symbol = (unsigned char) i;\n\t  high_threshold--;\n\t  next[i] = 1;\n\t}\n    }\n\n  pos = 0;\n  step = (table_size >> 1) + (table_size >> 3) + 3;\n  mask = table_size - 1;\n  for (i = 0; i < idx; i++)\n    {\n      int n;\n      int j;\n\n      n = (int) norm[i];\n      for (j = 0; j < n; j++)\n\t{\n\t  table[pos].symbol = (unsigned char) i;\n\t  pos = (pos + step) & mask;\n\t  while (unlikely (pos > high_threshold))\n\t    pos = (pos + step) & mask;\n\t}\n    }\n  if (unlikely (pos != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  for (i = 0; i < table_size; i++)\n    {\n      unsigned char sym;\n      uint16_t next_state;\n      int high_bit;\n      int bits;\n\n      sym = table[i].symbol;\n      next_state = next[sym];\n      ++next[sym];\n\n      if (next_state == 0)\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      high_bit = 31 - __builtin_clz (next_state);\n\n      bits = table_bits - high_bit;\n      table[i].bits = (unsigned char) bits;\n      table[i].base = (uint16_t) ((next_state << bits) - table_size);\n    }\n\n  return 1;\n}\n\n/* Encode the baseline and bits into a single 32-bit value.  */\n\n#define ZSTD_ENCODE_BASELINE_BITS(baseline, basebits)\t\\\n  ((uint32_t)(baseline) | ((uint32_t)(basebits) << 24))\n\n#define ZSTD_DECODE_BASELINE(baseline_basebits)\t\\\n  ((uint32_t)(baseline_basebits) & 0xffffff)\n\n#define ZSTD_DECODE_BASEBITS(baseline_basebits)\t\\\n  ((uint32_t)(baseline_basebits) >> 24)\n\n/* Given a literal length code, we need to read a number of bits and add that\n   to a baseline.  For states 0 to 15 the baseline is the state and the number\n   of bits is zero.  */\n\n#define ZSTD_LITERAL_LENGTH_BASELINE_OFFSET (16)\n\nstatic const uint32_t elf_zstd_literal_length_base[] =\n{\n  ZSTD_ENCODE_BASELINE_BITS(16, 1),\n  ZSTD_ENCODE_BASELINE_BITS(18, 1),\n  ZSTD_ENCODE_BASELINE_BITS(20, 1),\n  ZSTD_ENCODE_BASELINE_BITS(22, 1),\n  ZSTD_ENCODE_BASELINE_BITS(24, 2),\n  ZSTD_ENCODE_BASELINE_BITS(28, 2),\n  ZSTD_ENCODE_BASELINE_BITS(32, 3),\n  ZSTD_ENCODE_BASELINE_BITS(40, 3),\n  ZSTD_ENCODE_BASELINE_BITS(48, 4),\n  ZSTD_ENCODE_BASELINE_BITS(64, 6),\n  ZSTD_ENCODE_BASELINE_BITS(128, 7),\n  ZSTD_ENCODE_BASELINE_BITS(256, 8),\n  ZSTD_ENCODE_BASELINE_BITS(512, 9),\n  ZSTD_ENCODE_BASELINE_BITS(1024, 10),\n  ZSTD_ENCODE_BASELINE_BITS(2048, 11),\n  ZSTD_ENCODE_BASELINE_BITS(4096, 12),\n  ZSTD_ENCODE_BASELINE_BITS(8192, 13),\n  ZSTD_ENCODE_BASELINE_BITS(16384, 14),\n  ZSTD_ENCODE_BASELINE_BITS(32768, 15),\n  ZSTD_ENCODE_BASELINE_BITS(65536, 16)\n};\n\n/* The same applies to match length codes.  For states 0 to 31 the baseline is\n   the state + 3 and the number of bits is zero.  */\n\n#define ZSTD_MATCH_LENGTH_BASELINE_OFFSET (32)\n\nstatic const uint32_t elf_zstd_match_length_base[] =\n{\n  ZSTD_ENCODE_BASELINE_BITS(35, 1),\n  ZSTD_ENCODE_BASELINE_BITS(37, 1),\n  ZSTD_ENCODE_BASELINE_BITS(39, 1),\n  ZSTD_ENCODE_BASELINE_BITS(41, 1),\n  ZSTD_ENCODE_BASELINE_BITS(43, 2),\n  ZSTD_ENCODE_BASELINE_BITS(47, 2),\n  ZSTD_ENCODE_BASELINE_BITS(51, 3),\n  ZSTD_ENCODE_BASELINE_BITS(59, 3),\n  ZSTD_ENCODE_BASELINE_BITS(67, 4),\n  ZSTD_ENCODE_BASELINE_BITS(83, 4),\n  ZSTD_ENCODE_BASELINE_BITS(99, 5),\n  ZSTD_ENCODE_BASELINE_BITS(131, 7),\n  ZSTD_ENCODE_BASELINE_BITS(259, 8),\n  ZSTD_ENCODE_BASELINE_BITS(515, 9),\n  ZSTD_ENCODE_BASELINE_BITS(1027, 10),\n  ZSTD_ENCODE_BASELINE_BITS(2051, 11),\n  ZSTD_ENCODE_BASELINE_BITS(4099, 12),\n  ZSTD_ENCODE_BASELINE_BITS(8195, 13),\n  ZSTD_ENCODE_BASELINE_BITS(16387, 14),\n  ZSTD_ENCODE_BASELINE_BITS(32771, 15),\n  ZSTD_ENCODE_BASELINE_BITS(65539, 16)\n};\n\n/* An entry in an FSE table used for literal/match/length values.  For these we\n   have to map the symbol to a baseline value, and we have to read zero or more\n   bits and add that value to the baseline value.  Rather than look the values\n   up in a separate table, we grow the FSE table so that we get better memory\n   caching.  */\n\nstruct elf_zstd_fse_baseline_entry\n{\n  /* The baseline for the value that this FSE entry represents..  */\n  uint32_t baseline;\n  /* The number of bits to read to add to the baseline.  */\n  unsigned char basebits;\n  /* The number of bits to read to determine the next state.  */\n  unsigned char bits;\n  /* Add the bits to this base to get the next state.  */\n  uint16_t base;\n};\n\n/* Convert the literal length FSE table FSE_TABLE to an FSE baseline table at\n   BASELINE_TABLE.  Note that FSE_TABLE and BASELINE_TABLE will overlap.  */\n\nstatic int\nelf_zstd_make_literal_baseline_fse (\n    const struct elf_zstd_fse_entry *fse_table,\n    int table_bits,\n    struct elf_zstd_fse_baseline_entry *baseline_table)\n{\n  size_t count;\n  const struct elf_zstd_fse_entry *pfse;\n  struct elf_zstd_fse_baseline_entry *pbaseline;\n\n  /* Convert backward to avoid overlap.  */\n\n  count = 1U << table_bits;\n  pfse = fse_table + count;\n  pbaseline = baseline_table + count;\n  while (pfse > fse_table)\n    {\n      unsigned char symbol;\n      unsigned char bits;\n      uint16_t base;\n\n      --pfse;\n      --pbaseline;\n      symbol = pfse->symbol;\n      bits = pfse->bits;\n      base = pfse->base;\n      if (symbol < ZSTD_LITERAL_LENGTH_BASELINE_OFFSET)\n\t{\n\t  pbaseline->baseline = (uint32_t)symbol;\n\t  pbaseline->basebits = 0;\n\t}\n      else\n\t{\n\t  unsigned int idx;\n\t  uint32_t basebits;\n\n\t  if (unlikely (symbol > 35))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  idx = symbol - ZSTD_LITERAL_LENGTH_BASELINE_OFFSET;\n\t  basebits = elf_zstd_literal_length_base[idx];\n\t  pbaseline->baseline = ZSTD_DECODE_BASELINE(basebits);\n\t  pbaseline->basebits = ZSTD_DECODE_BASEBITS(basebits);\n\t}\n      pbaseline->bits = bits;\n      pbaseline->base = base;\n    }\n\n  return 1;\n}\n\n/* Convert the offset length FSE table FSE_TABLE to an FSE baseline table at\n   BASELINE_TABLE.  Note that FSE_TABLE and BASELINE_TABLE will overlap.  */\n\nstatic int\nelf_zstd_make_offset_baseline_fse (\n    const struct elf_zstd_fse_entry *fse_table,\n    int table_bits,\n    struct elf_zstd_fse_baseline_entry *baseline_table)\n{\n  size_t count;\n  const struct elf_zstd_fse_entry *pfse;\n  struct elf_zstd_fse_baseline_entry *pbaseline;\n\n  /* Convert backward to avoid overlap.  */\n\n  count = 1U << table_bits;\n  pfse = fse_table + count;\n  pbaseline = baseline_table + count;\n  while (pfse > fse_table)\n    {\n      unsigned char symbol;\n      unsigned char bits;\n      uint16_t base;\n\n      --pfse;\n      --pbaseline;\n      symbol = pfse->symbol;\n      bits = pfse->bits;\n      base = pfse->base;\n      if (unlikely (symbol > 31))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      /* The simple way to write this is\n\n\t   pbaseline->baseline = (uint32_t)1 << symbol;\n\t   pbaseline->basebits = symbol;\n\n\t That will give us an offset value that corresponds to the one\n\t described in the RFC.  However, for offset values > 3, we have to\n\t subtract 3.  And for offset values 1, 2, 3 we use a repeated offset.\n\t The baseline is always a power of 2, and is never 0, so for these low\n\t values we will see one entry that is baseline 1, basebits 0, and one\n\t entry that is baseline 2, basebits 1.  All other entries will have\n\t baseline >= 4 and basebits >= 2.\n\n\t So we can check for RFC offset <= 3 by checking for basebits <= 1.\n\t And that means that we can subtract 3 here and not worry about doing\n\t it in the hot loop.  */\n\n      pbaseline->baseline = (uint32_t)1 << symbol;\n      if (symbol >= 2)\n\tpbaseline->baseline -= 3;\n      pbaseline->basebits = symbol;\n      pbaseline->bits = bits;\n      pbaseline->base = base;\n    }\n\n  return 1;\n}\n\n/* Convert the match length FSE table FSE_TABLE to an FSE baseline table at\n   BASELINE_TABLE.  Note that FSE_TABLE and BASELINE_TABLE will overlap.  */\n\nstatic int\nelf_zstd_make_match_baseline_fse (\n    const struct elf_zstd_fse_entry *fse_table,\n    int table_bits,\n    struct elf_zstd_fse_baseline_entry *baseline_table)\n{\n  size_t count;\n  const struct elf_zstd_fse_entry *pfse;\n  struct elf_zstd_fse_baseline_entry *pbaseline;\n\n  /* Convert backward to avoid overlap.  */\n\n  count = 1U << table_bits;\n  pfse = fse_table + count;\n  pbaseline = baseline_table + count;\n  while (pfse > fse_table)\n    {\n      unsigned char symbol;\n      unsigned char bits;\n      uint16_t base;\n\n      --pfse;\n      --pbaseline;\n      symbol = pfse->symbol;\n      bits = pfse->bits;\n      base = pfse->base;\n      if (symbol < ZSTD_MATCH_LENGTH_BASELINE_OFFSET)\n\t{\n\t  pbaseline->baseline = (uint32_t)symbol + 3;\n\t  pbaseline->basebits = 0;\n\t}\n      else\n\t{\n\t  unsigned int idx;\n\t  uint32_t basebits;\n\n\t  if (unlikely (symbol > 52))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  idx = symbol - ZSTD_MATCH_LENGTH_BASELINE_OFFSET;\n\t  basebits = elf_zstd_match_length_base[idx];\n\t  pbaseline->baseline = ZSTD_DECODE_BASELINE(basebits);\n\t  pbaseline->basebits = ZSTD_DECODE_BASEBITS(basebits);\n\t}\n      pbaseline->bits = bits;\n      pbaseline->base = base;\n    }\n\n  return 1;\n}\n\n#ifdef BACKTRACE_GENERATE_ZSTD_FSE_TABLES\n\n/* Used to generate the predefined FSE decoding tables for zstd.  */\n\n#include <stdio.h>\n\n/* These values are straight from RFC 8878.  */\n\nstatic int16_t lit[36] =\n{\n   4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,\n   2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1,\n  -1,-1,-1,-1\n};\n\nstatic int16_t match[53] =\n{\n   1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,\n   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1,-1,\n  -1,-1,-1,-1,-1\n};\n\nstatic int16_t offset[29] =\n{\n  1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1\n};\n\nstatic uint16_t next[256];\n\nstatic void\nprint_table (const struct elf_zstd_fse_baseline_entry *table, size_t size)\n{\n  size_t i;\n\n  printf (\"{\\n\");\n  for (i = 0; i < size; i += 3)\n    {\n      int j;\n\n      printf (\" \");\n      for (j = 0; j < 3 && i + j < size; ++j)\n\tprintf (\" { %u, %d, %d, %d },\", table[i + j].baseline,\n\t\ttable[i + j].basebits, table[i + j].bits,\n\t\ttable[i + j].base);\n      printf (\"\\n\");\n    }\n  printf (\"};\\n\");\n}\n\nint\nmain ()\n{\n  struct elf_zstd_fse_entry lit_table[64];\n  struct elf_zstd_fse_baseline_entry lit_baseline[64];\n  struct elf_zstd_fse_entry match_table[64];\n  struct elf_zstd_fse_baseline_entry match_baseline[64];\n  struct elf_zstd_fse_entry offset_table[32];\n  struct elf_zstd_fse_baseline_entry offset_baseline[32];\n\n  if (!elf_zstd_build_fse (lit, sizeof lit / sizeof lit[0], next,\n\t\t\t   6, lit_table))\n    {\n      fprintf (stderr, \"elf_zstd_build_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  if (!elf_zstd_make_literal_baseline_fse (lit_table, 6, lit_baseline))\n    {\n      fprintf (stderr, \"elf_zstd_make_literal_baseline_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  printf (\"static const struct elf_zstd_fse_baseline_entry \"\n\t  \"elf_zstd_lit_table[64] =\\n\");\n  print_table (lit_baseline,\n\t       sizeof lit_baseline / sizeof lit_baseline[0]);\n  printf (\"\\n\");\n\n  if (!elf_zstd_build_fse (match, sizeof match / sizeof match[0], next,\n\t\t\t   6, match_table))\n    {\n      fprintf (stderr, \"elf_zstd_build_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  if (!elf_zstd_make_match_baseline_fse (match_table, 6, match_baseline))\n    {\n      fprintf (stderr, \"elf_zstd_make_match_baseline_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  printf (\"static const struct elf_zstd_fse_baseline_entry \"\n\t  \"elf_zstd_match_table[64] =\\n\");\n  print_table (match_baseline,\n\t       sizeof match_baseline / sizeof match_baseline[0]);\n  printf (\"\\n\");\n\n  if (!elf_zstd_build_fse (offset, sizeof offset / sizeof offset[0], next,\n\t\t\t   5, offset_table))\n    {\n      fprintf (stderr, \"elf_zstd_build_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  if (!elf_zstd_make_offset_baseline_fse (offset_table, 5, offset_baseline))\n    {\n      fprintf (stderr, \"elf_zstd_make_offset_baseline_fse failed\\n\");\n      exit (EXIT_FAILURE);\n    }\n\n  printf (\"static const struct elf_zstd_fse_baseline_entry \"\n\t  \"elf_zstd_offset_table[32] =\\n\");\n  print_table (offset_baseline,\n\t       sizeof offset_baseline / sizeof offset_baseline[0]);\n  printf (\"\\n\");\n\n  return 0;\n}\n\n#endif\n\n/* The fixed tables generated by the #ifdef'ed out main function\n   above.  */\n\nstatic const struct elf_zstd_fse_baseline_entry elf_zstd_lit_table[64] =\n{\n  { 0, 0, 4, 0 }, { 0, 0, 4, 16 }, { 1, 0, 5, 32 },\n  { 3, 0, 5, 0 }, { 4, 0, 5, 0 }, { 6, 0, 5, 0 },\n  { 7, 0, 5, 0 }, { 9, 0, 5, 0 }, { 10, 0, 5, 0 },\n  { 12, 0, 5, 0 }, { 14, 0, 6, 0 }, { 16, 1, 5, 0 },\n  { 20, 1, 5, 0 }, { 22, 1, 5, 0 }, { 28, 2, 5, 0 },\n  { 32, 3, 5, 0 }, { 48, 4, 5, 0 }, { 64, 6, 5, 32 },\n  { 128, 7, 5, 0 }, { 256, 8, 6, 0 }, { 1024, 10, 6, 0 },\n  { 4096, 12, 6, 0 }, { 0, 0, 4, 32 }, { 1, 0, 4, 0 },\n  { 2, 0, 5, 0 }, { 4, 0, 5, 32 }, { 5, 0, 5, 0 },\n  { 7, 0, 5, 32 }, { 8, 0, 5, 0 }, { 10, 0, 5, 32 },\n  { 11, 0, 5, 0 }, { 13, 0, 6, 0 }, { 16, 1, 5, 32 },\n  { 18, 1, 5, 0 }, { 22, 1, 5, 32 }, { 24, 2, 5, 0 },\n  { 32, 3, 5, 32 }, { 40, 3, 5, 0 }, { 64, 6, 4, 0 },\n  { 64, 6, 4, 16 }, { 128, 7, 5, 32 }, { 512, 9, 6, 0 },\n  { 2048, 11, 6, 0 }, { 0, 0, 4, 48 }, { 1, 0, 4, 16 },\n  { 2, 0, 5, 32 }, { 3, 0, 5, 32 }, { 5, 0, 5, 32 },\n  { 6, 0, 5, 32 }, { 8, 0, 5, 32 }, { 9, 0, 5, 32 },\n  { 11, 0, 5, 32 }, { 12, 0, 5, 32 }, { 15, 0, 6, 0 },\n  { 18, 1, 5, 32 }, { 20, 1, 5, 32 }, { 24, 2, 5, 32 },\n  { 28, 2, 5, 32 }, { 40, 3, 5, 32 }, { 48, 4, 5, 32 },\n  { 65536, 16, 6, 0 }, { 32768, 15, 6, 0 }, { 16384, 14, 6, 0 },\n  { 8192, 13, 6, 0 },\n};\n\nstatic const struct elf_zstd_fse_baseline_entry elf_zstd_match_table[64] =\n{\n  { 3, 0, 6, 0 }, { 4, 0, 4, 0 }, { 5, 0, 5, 32 },\n  { 6, 0, 5, 0 }, { 8, 0, 5, 0 }, { 9, 0, 5, 0 },\n  { 11, 0, 5, 0 }, { 13, 0, 6, 0 }, { 16, 0, 6, 0 },\n  { 19, 0, 6, 0 }, { 22, 0, 6, 0 }, { 25, 0, 6, 0 },\n  { 28, 0, 6, 0 }, { 31, 0, 6, 0 }, { 34, 0, 6, 0 },\n  { 37, 1, 6, 0 }, { 41, 1, 6, 0 }, { 47, 2, 6, 0 },\n  { 59, 3, 6, 0 }, { 83, 4, 6, 0 }, { 131, 7, 6, 0 },\n  { 515, 9, 6, 0 }, { 4, 0, 4, 16 }, { 5, 0, 4, 0 },\n  { 6, 0, 5, 32 }, { 7, 0, 5, 0 }, { 9, 0, 5, 32 },\n  { 10, 0, 5, 0 }, { 12, 0, 6, 0 }, { 15, 0, 6, 0 },\n  { 18, 0, 6, 0 }, { 21, 0, 6, 0 }, { 24, 0, 6, 0 },\n  { 27, 0, 6, 0 }, { 30, 0, 6, 0 }, { 33, 0, 6, 0 },\n  { 35, 1, 6, 0 }, { 39, 1, 6, 0 }, { 43, 2, 6, 0 },\n  { 51, 3, 6, 0 }, { 67, 4, 6, 0 }, { 99, 5, 6, 0 },\n  { 259, 8, 6, 0 }, { 4, 0, 4, 32 }, { 4, 0, 4, 48 },\n  { 5, 0, 4, 16 }, { 7, 0, 5, 32 }, { 8, 0, 5, 32 },\n  { 10, 0, 5, 32 }, { 11, 0, 5, 32 }, { 14, 0, 6, 0 },\n  { 17, 0, 6, 0 }, { 20, 0, 6, 0 }, { 23, 0, 6, 0 },\n  { 26, 0, 6, 0 }, { 29, 0, 6, 0 }, { 32, 0, 6, 0 },\n  { 65539, 16, 6, 0 }, { 32771, 15, 6, 0 }, { 16387, 14, 6, 0 },\n  { 8195, 13, 6, 0 }, { 4099, 12, 6, 0 }, { 2051, 11, 6, 0 },\n  { 1027, 10, 6, 0 },\n};\n\nstatic const struct elf_zstd_fse_baseline_entry elf_zstd_offset_table[32] =\n{\n  { 1, 0, 5, 0 }, { 61, 6, 4, 0 }, { 509, 9, 5, 0 },\n  { 32765, 15, 5, 0 }, { 2097149, 21, 5, 0 }, { 5, 3, 5, 0 },\n  { 125, 7, 4, 0 }, { 4093, 12, 5, 0 }, { 262141, 18, 5, 0 },\n  { 8388605, 23, 5, 0 }, { 29, 5, 5, 0 }, { 253, 8, 4, 0 },\n  { 16381, 14, 5, 0 }, { 1048573, 20, 5, 0 }, { 1, 2, 5, 0 },\n  { 125, 7, 4, 16 }, { 2045, 11, 5, 0 }, { 131069, 17, 5, 0 },\n  { 4194301, 22, 5, 0 }, { 13, 4, 5, 0 }, { 253, 8, 4, 16 },\n  { 8189, 13, 5, 0 }, { 524285, 19, 5, 0 }, { 2, 1, 5, 0 },\n  { 61, 6, 4, 16 }, { 1021, 10, 5, 0 }, { 65533, 16, 5, 0 },\n  { 268435453, 28, 5, 0 }, { 134217725, 27, 5, 0 }, { 67108861, 26, 5, 0 },\n  { 33554429, 25, 5, 0 }, { 16777213, 24, 5, 0 },\n};\n\n/* Read a zstd Huffman table and build the decoding table in *TABLE, reading\n   and updating *PPIN.  This sets *PTABLE_BITS to the number of bits of the\n   table, such that the table length is 1 << *TABLE_BITS.  ZDEBUG_TABLE is\n   scratch space; it must be enough for 512 uint16_t values + 256 32-bit values\n   (2048 bytes).  Returns 1 on success, 0 on error.  */\n\nstatic int\nelf_zstd_read_huff (const unsigned char **ppin, const unsigned char *pinend,\n\t\t    uint16_t *zdebug_table, uint16_t *table, int *ptable_bits)\n{\n  const unsigned char *pin;\n  unsigned char hdr;\n  unsigned char *weights;\n  size_t count;\n  uint32_t *weight_mark;\n  size_t i;\n  uint32_t weight_mask;\n  size_t table_bits;\n\n  pin = *ppin;\n  if (unlikely (pin >= pinend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  hdr = *pin;\n  ++pin;\n\n  weights = (unsigned char *) zdebug_table;\n\n  if (hdr < 128)\n    {\n      /* Table is compressed using FSE.  */\n\n      struct elf_zstd_fse_entry *fse_table;\n      int fse_table_bits;\n      uint16_t *scratch;\n      const unsigned char *pfse;\n      const unsigned char *pback;\n      uint64_t val;\n      unsigned int bits;\n      unsigned int state1, state2;\n\n      /* SCRATCH is used temporarily by elf_zstd_read_fse.  It overlaps\n\t WEIGHTS.  */\n      scratch = zdebug_table;\n      fse_table = (struct elf_zstd_fse_entry *) (scratch + 512);\n      fse_table_bits = 6;\n\n      pfse = pin;\n      if (!elf_zstd_read_fse (&pfse, pinend, scratch, 255, fse_table,\n\t\t\t      &fse_table_bits))\n\treturn 0;\n\n      if (unlikely (pin + hdr > pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      /* We no longer need SCRATCH.  Start recording weights.  We need up to\n\t 256 bytes of weights and 64 bytes of rank counts, so it won't overlap\n\t FSE_TABLE.  */\n\n      pback = pin + hdr - 1;\n\n      if (!elf_fetch_backward_init (&pback, pfse, &val, &bits))\n\treturn 0;\n\n      bits -= fse_table_bits;\n      state1 = (val >> bits) & ((1U << fse_table_bits) - 1);\n      bits -= fse_table_bits;\n      state2 = (val >> bits) & ((1U << fse_table_bits) - 1);\n\n      /* There are two independent FSE streams, tracked by STATE1 and STATE2.\n\t We decode them alternately.  */\n\n      count = 0;\n      while (1)\n\t{\n\t  struct elf_zstd_fse_entry *pt;\n\t  uint64_t v;\n\n\t  pt = &fse_table[state1];\n\n\t  if (unlikely (pin < pinend) && bits < pt->bits)\n\t    {\n\t      if (unlikely (count >= 254))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      weights[count] = (unsigned char) pt->symbol;\n\t      weights[count + 1] = (unsigned char) fse_table[state2].symbol;\n\t      count += 2;\n\t      break;\n\t    }\n\n\t  if (unlikely (pt->bits == 0))\n\t    v = 0;\n\t  else\n\t    {\n\t      if (!elf_fetch_bits_backward (&pback, pfse, &val, &bits))\n\t\treturn 0;\n\n\t      bits -= pt->bits;\n\t      v = (val >> bits) & (((uint64_t)1 << pt->bits) - 1);\n\t    }\n\n\t  state1 = pt->base + v;\n\n\t  if (unlikely (count >= 255))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  weights[count] = pt->symbol;\n\t  ++count;\n\n\t  pt = &fse_table[state2];\n\n\t  if (unlikely (pin < pinend && bits < pt->bits))\n\t    {\n\t      if (unlikely (count >= 254))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      weights[count] = (unsigned char) pt->symbol;\n\t      weights[count + 1] = (unsigned char) fse_table[state1].symbol;\n\t      count += 2;\n\t      break;\n\t    }\n\n\t  if (unlikely (pt->bits == 0))\n\t    v = 0;\n\t  else\n\t    {\n\t      if (!elf_fetch_bits_backward (&pback, pfse, &val, &bits))\n\t\treturn 0;\n\n\t      bits -= pt->bits;\n\t      v = (val >> bits) & (((uint64_t)1 << pt->bits) - 1);\n\t    }\n\n\t  state2 = pt->base + v;\n\n\t  if (unlikely (count >= 255))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  weights[count] = pt->symbol;\n\t  ++count;\n\t}\n\n      pin += hdr;\n    }\n  else\n    {\n      /* Table is not compressed.  Each weight is 4 bits.  */\n\n      count = hdr - 127;\n      if (unlikely (pin + ((count + 1) / 2) >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      for (i = 0; i < count; i += 2)\n\t{\n\t  unsigned char b;\n\n\t  b = *pin;\n\t  ++pin;\n\t  weights[i] = b >> 4;\n\t  weights[i + 1] = b & 0xf;\n\t}\n    }\n\n  weight_mark = (uint32_t *) (weights + 256);\n  memset (weight_mark, 0, 13 * sizeof (uint32_t));\n  weight_mask = 0;\n  for (i = 0; i < count; ++i)\n    {\n      unsigned char w;\n\n      w = weights[i];\n      if (unlikely (w > 12))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      ++weight_mark[w];\n      if (w > 0)\n\tweight_mask += 1U << (w - 1);\n    }\n  if (unlikely (weight_mask == 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  table_bits = 32 - __builtin_clz (weight_mask);\n  if (unlikely (table_bits > 11))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Work out the last weight value, which is omitted because the weights must\n     sum to a power of two.  */\n  {\n    uint32_t left;\n    uint32_t high_bit;\n\n    left = ((uint32_t)1 << table_bits) - weight_mask;\n    if (left == 0)\n      {\n\telf_uncompress_failed ();\n\treturn 0;\n      }\n    high_bit = 31 - __builtin_clz (left);\n    if (((uint32_t)1 << high_bit) != left)\n      {\n\telf_uncompress_failed ();\n\treturn 0;\n      }\n\n    if (unlikely (count >= 256))\n      {\n\telf_uncompress_failed ();\n\treturn 0;\n      }\n\n    weights[count] = high_bit + 1;\n    ++count;\n    ++weight_mark[high_bit + 1];\n  }\n\n  if (weight_mark[1] < 2 || (weight_mark[1] & 1) != 0)\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Change WEIGHT_MARK from a count of weights to the index of the first\n     symbol for that weight.  We shift the indexes to also store how many we\n     have seen so far, below.  */\n  {\n    uint32_t next;\n\n    next = 0;\n    for (i = 0; i < table_bits; ++i)\n      {\n\tuint32_t cur;\n\n\tcur = next;\n\tnext += weight_mark[i + 1] << i;\n\tweight_mark[i + 1] = cur;\n      }\n  }\n\n  for (i = 0; i < count; ++i)\n    {\n      unsigned char weight;\n      uint32_t length;\n      uint16_t tval;\n      size_t start;\n      uint32_t j;\n\n      weight = weights[i];\n      if (weight == 0)\n\tcontinue;\n\n      length = 1U << (weight - 1);\n      tval = (i << 8) | (table_bits + 1 - weight);\n      start = weight_mark[weight];\n      for (j = 0; j < length; ++j)\n\ttable[start + j] = tval;\n      weight_mark[weight] += length;\n    }\n\n  *ppin = pin;\n  *ptable_bits = (int)table_bits;\n\n  return 1;\n}\n\n/* Read and decompress the literals and store them ending at POUTEND.  This\n   works because we are going to use all the literals in the output, so they\n   must fit into the output buffer.  HUFFMAN_TABLE, and PHUFFMAN_TABLE_BITS\n   store the Huffman table across calls.  SCRATCH is used to read a Huffman\n   table.  Store the start of the decompressed literals in *PPLIT.  Update\n   *PPIN.  Return 1 on success, 0 on error.  */\n\nstatic int\nelf_zstd_read_literals (const unsigned char **ppin,\n\t\t\tconst unsigned char *pinend,\n\t\t\tunsigned char *pout,\n\t\t\tunsigned char *poutend,\n\t\t\tuint16_t *scratch,\n\t\t\tuint16_t *huffman_table,\n\t\t\tint *phuffman_table_bits,\n\t\t\tunsigned char **pplit)\n{\n  const unsigned char *pin;\n  unsigned char *plit;\n  unsigned char hdr;\n  uint32_t regenerated_size;\n  uint32_t compressed_size;\n  int streams;\n  uint32_t total_streams_size;\n  unsigned int huffman_table_bits;\n  uint64_t huffman_mask;\n\n  pin = *ppin;\n  if (unlikely (pin >= pinend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  hdr = *pin;\n  ++pin;\n\n  if ((hdr & 3) == 0 || (hdr & 3) == 1)\n    {\n      int raw;\n\n      /* Raw_Literals_Block or RLE_Literals_Block */\n\n      raw = (hdr & 3) == 0;\n\n      switch ((hdr >> 2) & 3)\n\t{\n\tcase 0: case 2:\n\t  regenerated_size = hdr >> 3;\n\t  break;\n\tcase 1:\n\t  if (unlikely (pin >= pinend))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  regenerated_size = (hdr >> 4) + ((uint32_t)(*pin) << 4);\n\t  ++pin;\n\t  break;\n\tcase 3:\n\t  if (unlikely (pin + 1 >= pinend))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  regenerated_size = ((hdr >> 4)\n\t\t\t      + ((uint32_t)*pin << 4)\n\t\t\t      + ((uint32_t)pin[1] << 12));\n\t  pin += 2;\n\t  break;\n\tdefault:\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      if (unlikely ((size_t)(poutend - pout) < regenerated_size))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      plit = poutend - regenerated_size;\n\n      if (raw)\n\t{\n\t  if (unlikely (pin + regenerated_size >= pinend))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  memcpy (plit, pin, regenerated_size);\n\t  pin += regenerated_size;\n\t}\n      else\n\t{\n\t  if (pin >= pinend)\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  memset (plit, *pin, regenerated_size);\n\t  ++pin;\n\t}\n\n      *ppin = pin;\n      *pplit = plit;\n\n      return 1;\n    }\n\n  /* Compressed_Literals_Block or Treeless_Literals_Block */\n\n  switch ((hdr >> 2) & 3)\n    {\n    case 0: case 1:\n      if (unlikely (pin + 1 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      regenerated_size = (hdr >> 4) | ((uint32_t)(*pin & 0x3f) << 4);\n      compressed_size = (uint32_t)*pin >> 6 | ((uint32_t)pin[1] << 2);\n      pin += 2;\n      streams = ((hdr >> 2) & 3) == 0 ? 1 : 4;\n      break;\n    case 2:\n      if (unlikely (pin + 2 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      regenerated_size = (((uint32_t)hdr >> 4)\n\t\t\t  | ((uint32_t)*pin << 4)\n\t\t\t  | (((uint32_t)pin[1] & 3) << 12));\n      compressed_size = (((uint32_t)pin[1] >> 2)\n\t\t\t | ((uint32_t)pin[2] << 6));\n      pin += 3;\n      streams = 4;\n      break;\n    case 3:\n      if (unlikely (pin + 3 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      regenerated_size = (((uint32_t)hdr >> 4)\n\t\t\t  | ((uint32_t)*pin << 4)\n\t\t\t  | (((uint32_t)pin[1] & 0x3f) << 12));\n      compressed_size = (((uint32_t)pin[1] >> 6)\n\t\t\t | ((uint32_t)pin[2] << 2)\n\t\t\t | ((uint32_t)pin[3] << 10));\n      pin += 4;\n      streams = 4;\n      break;\n    default:\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  if (unlikely (pin + compressed_size > pinend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  pinend = pin + compressed_size;\n  *ppin = pinend;\n\n  if (unlikely ((size_t)(poutend - pout) < regenerated_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  plit = poutend - regenerated_size;\n\n  *pplit = plit;\n\n  total_streams_size = compressed_size;\n  if ((hdr & 3) == 2)\n    {\n      const unsigned char *ptable;\n\n      /* Compressed_Literals_Block.  Read Huffman tree.  */\n\n      ptable = pin;\n      if (!elf_zstd_read_huff (&ptable, pinend, scratch, huffman_table,\n\t\t\t       phuffman_table_bits))\n\treturn 0;\n\n      if (unlikely (total_streams_size < (size_t)(ptable - pin)))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      total_streams_size -= ptable - pin;\n      pin = ptable;\n    }\n  else\n    {\n      /* Treeless_Literals_Block.  Reuse previous Huffman tree.  */\n      if (unlikely (*phuffman_table_bits == 0))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n    }\n\n  /* Decompress COMPRESSED_SIZE bytes of data at PIN using the huffman table,\n     storing REGENERATED_SIZE bytes of decompressed data at PLIT.  */\n\n  huffman_table_bits = (unsigned int)*phuffman_table_bits;\n  huffman_mask = ((uint64_t)1 << huffman_table_bits) - 1;\n\n  if (streams == 1)\n    {\n      const unsigned char *pback;\n      const unsigned char *pbackend;\n      uint64_t val;\n      unsigned int bits;\n      uint32_t i;\n\n      pback = pin + total_streams_size - 1;\n      pbackend = pin;\n      if (!elf_fetch_backward_init (&pback, pbackend, &val, &bits))\n\treturn 0;\n\n      /* This is one of the inner loops of the decompression algorithm, so we\n\t put some effort into optimization.  We can't get more than 64 bytes\n\t from a single call to elf_fetch_bits_backward, and we can't subtract\n\t more than 11 bits at a time.  */\n\n      if (regenerated_size >= 64)\n\t{\n\t  unsigned char *plitstart;\n\t  unsigned char *plitstop;\n\n\t  plitstart = plit;\n\t  plitstop = plit + regenerated_size - 64;\n\t  while (plit < plitstop)\n\t    {\n\t      uint16_t t;\n\n\t      if (!elf_fetch_bits_backward (&pback, pbackend, &val, &bits))\n\t\treturn 0;\n\n\t      if (bits < 16)\n\t\tbreak;\n\n\t      while (bits >= 33)\n\t\t{\n\t\t  t = huffman_table[(val >> (bits - huffman_table_bits))\n\t\t\t\t    & huffman_mask];\n\t\t  *plit = t >> 8;\n\t\t  ++plit;\n\t\t  bits -= t & 0xff;\n\n\t\t  t = huffman_table[(val >> (bits - huffman_table_bits))\n\t\t\t\t    & huffman_mask];\n\t\t  *plit = t >> 8;\n\t\t  ++plit;\n\t\t  bits -= t & 0xff;\n\n\t\t  t = huffman_table[(val >> (bits - huffman_table_bits))\n\t\t\t\t    & huffman_mask];\n\t\t  *plit = t >> 8;\n\t\t  ++plit;\n\t\t  bits -= t & 0xff;\n\t\t}\n\n\t      while (bits > 11)\n\t\t{\n\t\t  t = huffman_table[(val >> (bits - huffman_table_bits))\n\t\t\t\t    & huffman_mask];\n\t\t  *plit = t >> 8;\n\t\t  ++plit;\n\t\t  bits -= t & 0xff;\n\t\t}\n\t    }\n\n\t  regenerated_size -= plit - plitstart;\n\t}\n\n      for (i = 0; i < regenerated_size; ++i)\n\t{\n\t  uint16_t t;\n\n\t  if (!elf_fetch_bits_backward (&pback, pbackend, &val, &bits))\n\t    return 0;\n\n\t  if (unlikely (bits < huffman_table_bits))\n\t    {\n\t      t = huffman_table[(val << (huffman_table_bits - bits))\n\t\t\t\t& huffman_mask];\n\t      if (unlikely (bits < (t & 0xff)))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t    }\n\t  else\n\t    t = huffman_table[(val >> (bits - huffman_table_bits))\n\t\t\t      & huffman_mask];\n\n\t  *plit = t >> 8;\n\t  ++plit;\n\t  bits -= t & 0xff;\n\t}\n\n      return 1;\n    }\n\n  {\n    uint32_t stream_size1, stream_size2, stream_size3, stream_size4;\n    uint32_t tot;\n    const unsigned char *pback1, *pback2, *pback3, *pback4;\n    const unsigned char *pbackend1, *pbackend2, *pbackend3, *pbackend4;\n    uint64_t val1, val2, val3, val4;\n    unsigned int bits1, bits2, bits3, bits4;\n    unsigned char *plit1, *plit2, *plit3, *plit4;\n    uint32_t regenerated_stream_size;\n    uint32_t regenerated_stream_size4;\n    uint16_t t1, t2, t3, t4;\n    uint32_t i;\n    uint32_t limit;\n\n    /* Read jump table.  */\n    if (unlikely (pin + 5 >= pinend))\n      {\n\telf_uncompress_failed ();\n\treturn 0;\n      }\n    stream_size1 = (uint32_t)*pin | ((uint32_t)pin[1] << 8);\n    pin += 2;\n    stream_size2 = (uint32_t)*pin | ((uint32_t)pin[1] << 8);\n    pin += 2;\n    stream_size3 = (uint32_t)*pin | ((uint32_t)pin[1] << 8);\n    pin += 2;\n    tot = stream_size1 + stream_size2 + stream_size3;\n    if (unlikely (tot > total_streams_size - 6))\n      {\n\telf_uncompress_failed ();\n\treturn 0;\n      }\n    stream_size4 = total_streams_size - 6 - tot;\n\n    pback1 = pin + stream_size1 - 1;\n    pbackend1 = pin;\n\n    pback2 = pback1 + stream_size2;\n    pbackend2 = pback1 + 1;\n\n    pback3 = pback2 + stream_size3;\n    pbackend3 = pback2 + 1;\n\n    pback4 = pback3 + stream_size4;\n    pbackend4 = pback3 + 1;\n\n    if (!elf_fetch_backward_init (&pback1, pbackend1, &val1, &bits1))\n      return 0;\n    if (!elf_fetch_backward_init (&pback2, pbackend2, &val2, &bits2))\n      return 0;\n    if (!elf_fetch_backward_init (&pback3, pbackend3, &val3, &bits3))\n      return 0;\n    if (!elf_fetch_backward_init (&pback4, pbackend4, &val4, &bits4))\n      return 0;\n\n    regenerated_stream_size = (regenerated_size + 3) / 4;\n\n    plit1 = plit;\n    plit2 = plit1 + regenerated_stream_size;\n    plit3 = plit2 + regenerated_stream_size;\n    plit4 = plit3 + regenerated_stream_size;\n\n    regenerated_stream_size4 = regenerated_size - regenerated_stream_size * 3;\n\n    /* We can't get more than 64 literal bytes from a single call to\n       elf_fetch_bits_backward.  The fourth stream can be up to 3 bytes less,\n       so use as the limit.  */\n\n    limit = regenerated_stream_size4 <= 64 ? 0 : regenerated_stream_size4 - 64;\n    i = 0;\n    while (i < limit)\n      {\n\tif (!elf_fetch_bits_backward (&pback1, pbackend1, &val1, &bits1))\n\t  return 0;\n\tif (!elf_fetch_bits_backward (&pback2, pbackend2, &val2, &bits2))\n\t  return 0;\n\tif (!elf_fetch_bits_backward (&pback3, pbackend3, &val3, &bits3))\n\t  return 0;\n\tif (!elf_fetch_bits_backward (&pback4, pbackend4, &val4, &bits4))\n\t  return 0;\n\n\t/* We can't subtract more than 11 bits at a time.  */\n\n\tdo\n\t  {\n\t    t1 = huffman_table[(val1 >> (bits1 - huffman_table_bits))\n\t\t\t       & huffman_mask];\n\t    t2 = huffman_table[(val2 >> (bits2 - huffman_table_bits))\n\t\t\t       & huffman_mask];\n\t    t3 = huffman_table[(val3 >> (bits3 - huffman_table_bits))\n\t\t\t       & huffman_mask];\n\t    t4 = huffman_table[(val4 >> (bits4 - huffman_table_bits))\n\t\t\t       & huffman_mask];\n\n\t    *plit1 = t1 >> 8;\n\t    ++plit1;\n\t    bits1 -= t1 & 0xff;\n\n\t    *plit2 = t2 >> 8;\n\t    ++plit2;\n\t    bits2 -= t2 & 0xff;\n\n\t    *plit3 = t3 >> 8;\n\t    ++plit3;\n\t    bits3 -= t3 & 0xff;\n\n\t    *plit4 = t4 >> 8;\n\t    ++plit4;\n\t    bits4 -= t4 & 0xff;\n\n\t    ++i;\n\t  }\n\twhile (bits1 > 11 && bits2 > 11 && bits3 > 11 && bits4 > 11);\n      }\n\n    while (i < regenerated_stream_size)\n      {\n\tint use4;\n\n\tuse4 = i < regenerated_stream_size4;\n\n\tif (!elf_fetch_bits_backward (&pback1, pbackend1, &val1, &bits1))\n\t  return 0;\n\tif (!elf_fetch_bits_backward (&pback2, pbackend2, &val2, &bits2))\n\t  return 0;\n\tif (!elf_fetch_bits_backward (&pback3, pbackend3, &val3, &bits3))\n\t  return 0;\n\tif (use4)\n\t  {\n\t    if (!elf_fetch_bits_backward (&pback4, pbackend4, &val4, &bits4))\n\t      return 0;\n\t  }\n\n\tif (unlikely (bits1 < huffman_table_bits))\n\t  {\n\t    t1 = huffman_table[(val1 << (huffman_table_bits - bits1))\n\t\t\t       & huffman_mask];\n\t    if (unlikely (bits1 < (t1 & 0xff)))\n\t      {\n\t\telf_uncompress_failed ();\n\t\treturn 0;\n\t      }\n\t  }\n\telse\n\t  t1 = huffman_table[(val1 >> (bits1 - huffman_table_bits))\n\t\t\t     & huffman_mask];\n\n\tif (unlikely (bits2 < huffman_table_bits))\n\t  {\n\t    t2 = huffman_table[(val2 << (huffman_table_bits - bits2))\n\t\t\t       & huffman_mask];\n\t    if (unlikely (bits2 < (t2 & 0xff)))\n\t      {\n\t\telf_uncompress_failed ();\n\t\treturn 0;\n\t      }\n\t  }\n\telse\n\t  t2 = huffman_table[(val2 >> (bits2 - huffman_table_bits))\n\t\t\t     & huffman_mask];\n\n\tif (unlikely (bits3 < huffman_table_bits))\n\t  {\n\t    t3 = huffman_table[(val3 << (huffman_table_bits - bits3))\n\t\t\t       & huffman_mask];\n\t    if (unlikely (bits3 < (t3 & 0xff)))\n\t      {\n\t\telf_uncompress_failed ();\n\t\treturn 0;\n\t      }\n\t  }\n\telse\n\t  t3 = huffman_table[(val3 >> (bits3 - huffman_table_bits))\n\t\t\t     & huffman_mask];\n\n\tif (use4)\n\t  {\n\t    if (unlikely (bits4 < huffman_table_bits))\n\t      {\n\t\tt4 = huffman_table[(val4 << (huffman_table_bits - bits4))\n\t\t\t\t   & huffman_mask];\n\t\tif (unlikely (bits4 < (t4 & 0xff)))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\t      }\n\t    else\n\t      t4 = huffman_table[(val4 >> (bits4 - huffman_table_bits))\n\t\t\t\t & huffman_mask];\n\n\t    *plit4 = t4 >> 8;\n\t    ++plit4;\n\t    bits4 -= t4 & 0xff;\n\t  }\n\n\t*plit1 = t1 >> 8;\n\t++plit1;\n\tbits1 -= t1 & 0xff;\n\n\t*plit2 = t2 >> 8;\n\t++plit2;\n\tbits2 -= t2 & 0xff;\n\n\t*plit3 = t3 >> 8;\n\t++plit3;\n\tbits3 -= t3 & 0xff;\n\n\t++i;\n      }\n  }\n\n  return 1;\n}\n\n/* The information used to decompress a sequence code, which can be a literal\n   length, an offset, or a match length.  */\n\nstruct elf_zstd_seq_decode\n{\n  const struct elf_zstd_fse_baseline_entry *table;\n  int table_bits;\n};\n\n/* Unpack a sequence code compression mode.  */\n\nstatic int\nelf_zstd_unpack_seq_decode (int mode,\n\t\t\t    const unsigned char **ppin,\n\t\t\t    const unsigned char *pinend,\n\t\t\t    const struct elf_zstd_fse_baseline_entry *predef,\n\t\t\t    int predef_bits,\n\t\t\t    uint16_t *scratch,\n\t\t\t    int maxidx,\n\t\t\t    struct elf_zstd_fse_baseline_entry *table,\n\t\t\t    int table_bits,\n\t\t\t    int (*conv)(const struct elf_zstd_fse_entry *,\n\t\t\t\t\tint,\n\t\t\t\t\tstruct elf_zstd_fse_baseline_entry *),\n\t\t\t    struct elf_zstd_seq_decode *decode)\n{\n  switch (mode)\n    {\n    case 0:\n      decode->table = predef;\n      decode->table_bits = predef_bits;\n      break;\n\n    case 1:\n      {\n\tstruct elf_zstd_fse_entry entry;\n\n\tif (unlikely (*ppin >= pinend))\n\t  {\n\t    elf_uncompress_failed ();\n\t    return 0;\n\t  }\n\tentry.symbol = **ppin;\n\t++*ppin;\n\tentry.bits = 0;\n\tentry.base = 0;\n\tdecode->table_bits = 0;\n\tif (!conv (&entry, 0, table))\n\t  return 0;\n      }\n      break;\n\n    case 2:\n      {\n\tstruct elf_zstd_fse_entry *fse_table;\n\n\t/* We use the same space for the simple FSE table and the baseline\n\t   table.  */\n\tfse_table = (struct elf_zstd_fse_entry *)table;\n\tdecode->table_bits = table_bits;\n\tif (!elf_zstd_read_fse (ppin, pinend, scratch, maxidx, fse_table,\n\t\t\t\t&decode->table_bits))\n\t  return 0;\n\tif (!conv (fse_table, decode->table_bits, table))\n\t  return 0;\n\tdecode->table = table;\n      }\n      break;\n\n    case 3:\n      if (unlikely (decode->table_bits == -1))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      break;\n\n    default:\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  return 1;\n}\n\n/* Decompress a zstd stream from PIN/SIN to POUT/SOUT.  Code based on RFC 8878.\n   Return 1 on success, 0 on error.  */\n\nstatic int\nelf_zstd_decompress (const unsigned char *pin, size_t sin,\n\t\t     unsigned char *zdebug_table, unsigned char *pout,\n\t\t     size_t sout)\n{\n  const unsigned char *pinend;\n  unsigned char *poutstart;\n  unsigned char *poutend;\n  struct elf_zstd_seq_decode literal_decode;\n  struct elf_zstd_fse_baseline_entry *literal_fse_table;\n  struct elf_zstd_seq_decode match_decode;\n  struct elf_zstd_fse_baseline_entry *match_fse_table;\n  struct elf_zstd_seq_decode offset_decode;\n  struct elf_zstd_fse_baseline_entry *offset_fse_table;\n  uint16_t *huffman_table;\n  int huffman_table_bits;\n  uint32_t repeated_offset1;\n  uint32_t repeated_offset2;\n  uint32_t repeated_offset3;\n  uint16_t *scratch;\n  unsigned char hdr;\n  int has_checksum;\n  uint64_t content_size;\n  int last_block;\n\n  pinend = pin + sin;\n  poutstart = pout;\n  poutend = pout + sout;\n\n  literal_decode.table = NULL;\n  literal_decode.table_bits = -1;\n  literal_fse_table = ((struct elf_zstd_fse_baseline_entry *)\n\t\t       (zdebug_table + ZSTD_TABLE_LITERAL_FSE_OFFSET));\n\n  match_decode.table = NULL;\n  match_decode.table_bits = -1;\n  match_fse_table = ((struct elf_zstd_fse_baseline_entry *)\n\t\t     (zdebug_table + ZSTD_TABLE_MATCH_FSE_OFFSET));\n\n  offset_decode.table = NULL;\n  offset_decode.table_bits = -1;\n  offset_fse_table = ((struct elf_zstd_fse_baseline_entry *)\n\t\t      (zdebug_table + ZSTD_TABLE_OFFSET_FSE_OFFSET));\n  huffman_table = ((uint16_t *)\n\t\t   (zdebug_table + ZSTD_TABLE_HUFFMAN_OFFSET));\n  huffman_table_bits = 0;\n  scratch = ((uint16_t *)\n\t     (zdebug_table + ZSTD_TABLE_WORK_OFFSET));\n\n  repeated_offset1 = 1;\n  repeated_offset2 = 4;\n  repeated_offset3 = 8;\n\n  if (unlikely (sin < 4))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* These values are the zstd magic number.  */\n  if (unlikely (pin[0] != 0x28\n\t\t|| pin[1] != 0xb5\n\t\t|| pin[2] != 0x2f\n\t\t|| pin[3] != 0xfd))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  pin += 4;\n\n  if (unlikely (pin >= pinend))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  hdr = *pin++;\n\n  /* We expect a single frame.  */\n  if (unlikely ((hdr & (1 << 5)) == 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  /* Reserved bit must be zero.  */\n  if (unlikely ((hdr & (1 << 3)) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  /* We do not expect a dictionary.  */\n  if (unlikely ((hdr & 3) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  has_checksum = (hdr & (1 << 2)) != 0;\n  switch (hdr >> 6)\n    {\n    case 0:\n      if (unlikely (pin >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      content_size = (uint64_t) *pin++;\n      break;\n    case 1:\n      if (unlikely (pin + 1 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      content_size = (((uint64_t) pin[0]) | (((uint64_t) pin[1]) << 8)) + 256;\n      pin += 2;\n      break;\n    case 2:\n      if (unlikely (pin + 3 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      content_size = ((uint64_t) pin[0]\n\t\t      | (((uint64_t) pin[1]) << 8)\n\t\t      | (((uint64_t) pin[2]) << 16)\n\t\t      | (((uint64_t) pin[3]) << 24));\n      pin += 4;\n      break;\n    case 3:\n      if (unlikely (pin + 7 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      content_size = ((uint64_t) pin[0]\n\t\t      | (((uint64_t) pin[1]) << 8)\n\t\t      | (((uint64_t) pin[2]) << 16)\n\t\t      | (((uint64_t) pin[3]) << 24)\n\t\t      | (((uint64_t) pin[4]) << 32)\n\t\t      | (((uint64_t) pin[5]) << 40)\n\t\t      | (((uint64_t) pin[6]) << 48)\n\t\t      | (((uint64_t) pin[7]) << 56));\n      pin += 8;\n      break;\n    default:\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  if (unlikely (content_size != (size_t) content_size\n\t\t|| (size_t) content_size != sout))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  last_block = 0;\n  while (!last_block)\n    {\n      uint32_t block_hdr;\n      int block_type;\n      uint32_t block_size;\n\n      if (unlikely (pin + 2 >= pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      block_hdr = ((uint32_t) pin[0]\n\t\t   | (((uint32_t) pin[1]) << 8)\n\t\t   | (((uint32_t) pin[2]) << 16));\n      pin += 3;\n\n      last_block = block_hdr & 1;\n      block_type = (block_hdr >> 1) & 3;\n      block_size = block_hdr >> 3;\n\n      switch (block_type)\n\t{\n\tcase 0:\n\t  /* Raw_Block */\n\t  if (unlikely ((size_t) block_size > (size_t) (pinend - pin)))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  if (unlikely ((size_t) block_size > (size_t) (poutend - pout)))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  memcpy (pout, pin, block_size);\n\t  pout += block_size;\n\t  pin += block_size;\n\t  break;\n\n\tcase 1:\n\t  /* RLE_Block */\n\t  if (unlikely (pin >= pinend))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  if (unlikely ((size_t) block_size > (size_t) (poutend - pout)))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  memset (pout, *pin, block_size);\n\t  pout += block_size;\n\t  pin++;\n\t  break;\n\n\tcase 2:\n\t  {\n\t    const unsigned char *pblockend;\n\t    unsigned char *plitstack;\n\t    unsigned char *plit;\n\t    uint32_t literal_count;\n\t    unsigned char seq_hdr;\n\t    size_t seq_count;\n\t    size_t seq;\n\t    const unsigned char *pback;\n\t    uint64_t val;\n\t    unsigned int bits;\n\t    unsigned int literal_state;\n\t    unsigned int offset_state;\n\t    unsigned int match_state;\n\n\t    /* Compressed_Block */\n\t    if (unlikely ((size_t) block_size > (size_t) (pinend - pin)))\n\t      {\n\t\telf_uncompress_failed ();\n\t\treturn 0;\n\t      }\n\n\t    pblockend = pin + block_size;\n\n\t    /* Read the literals into the end of the output space, and leave\n\t       PLIT pointing at them.  */\n\n\t    if (!elf_zstd_read_literals (&pin, pblockend, pout, poutend,\n\t\t\t\t\t scratch, huffman_table,\n\t\t\t\t\t &huffman_table_bits,\n\t\t\t\t\t &plitstack))\n\t      return 0;\n\t    plit = plitstack;\n\t    literal_count = poutend - plit;\n\n\t    seq_hdr = *pin;\n\t    pin++;\n\t    if (seq_hdr < 128)\n\t      seq_count = seq_hdr;\n\t    else if (seq_hdr < 255)\n\t      {\n\t\tif (unlikely (pin >= pinend))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\t\tseq_count = ((seq_hdr - 128) << 8) + *pin;\n\t\tpin++;\n\t      }\n\t    else\n\t      {\n\t\tif (unlikely (pin + 1 >= pinend))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\t\tseq_count = *pin + (pin[1] << 8) + 0x7f00;\n\t\tpin += 2;\n\t      }\n\n\t    if (seq_count > 0)\n\t      {\n\t\tint (*pfn)(const struct elf_zstd_fse_entry *,\n\t\t\t   int, struct elf_zstd_fse_baseline_entry *);\n\n\t\tif (unlikely (pin >= pinend))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\t\tseq_hdr = *pin;\n\t\t++pin;\n\n\t\tpfn = elf_zstd_make_literal_baseline_fse;\n\t\tif (!elf_zstd_unpack_seq_decode ((seq_hdr >> 6) & 3,\n\t\t\t\t\t\t &pin, pinend,\n\t\t\t\t\t\t &elf_zstd_lit_table[0], 6,\n\t\t\t\t\t\t scratch, 35,\n\t\t\t\t\t\t literal_fse_table, 9, pfn,\n\t\t\t\t\t\t &literal_decode))\n\t\t  return 0;\n\n\t\tpfn = elf_zstd_make_offset_baseline_fse;\n\t\tif (!elf_zstd_unpack_seq_decode ((seq_hdr >> 4) & 3,\n\t\t\t\t\t\t &pin, pinend,\n\t\t\t\t\t\t &elf_zstd_offset_table[0], 5,\n\t\t\t\t\t\t scratch, 31,\n\t\t\t\t\t\t offset_fse_table, 8, pfn,\n\t\t\t\t\t\t &offset_decode))\n\t\t  return 0;\n\n\t\tpfn = elf_zstd_make_match_baseline_fse;\n\t\tif (!elf_zstd_unpack_seq_decode ((seq_hdr >> 2) & 3,\n\t\t\t\t\t\t &pin, pinend,\n\t\t\t\t\t\t &elf_zstd_match_table[0], 6,\n\t\t\t\t\t\t scratch, 52,\n\t\t\t\t\t\t match_fse_table, 9, pfn,\n\t\t\t\t\t\t &match_decode))\n\t\t  return 0;\n\t      }\n\n\t    pback = pblockend - 1;\n\t    if (!elf_fetch_backward_init (&pback, pin, &val, &bits))\n\t      return 0;\n\n\t    bits -= literal_decode.table_bits;\n\t    literal_state = ((val >> bits)\n\t\t\t     & ((1U << literal_decode.table_bits) - 1));\n\n\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t      return 0;\n\t    bits -= offset_decode.table_bits;\n\t    offset_state = ((val >> bits)\n\t\t\t    & ((1U << offset_decode.table_bits) - 1));\n\n\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t      return 0;\n\t    bits -= match_decode.table_bits;\n\t    match_state = ((val >> bits)\n\t\t\t   & ((1U << match_decode.table_bits) - 1));\n\n\t    seq = 0;\n\t    while (1)\n\t      {\n\t\tconst struct elf_zstd_fse_baseline_entry *pt;\n\t\tuint32_t offset_basebits;\n\t\tuint32_t offset_baseline;\n\t\tuint32_t offset_bits;\n\t\tuint32_t offset_base;\n\t\tuint32_t offset;\n\t\tuint32_t match_baseline;\n\t\tuint32_t match_bits;\n\t\tuint32_t match_base;\n\t\tuint32_t match;\n\t\tuint32_t literal_baseline;\n\t\tuint32_t literal_bits;\n\t\tuint32_t literal_base;\n\t\tuint32_t literal;\n\t\tuint32_t need;\n\t\tuint32_t add;\n\n\t\tpt = &offset_decode.table[offset_state];\n\t\toffset_basebits = pt->basebits;\n\t\toffset_baseline = pt->baseline;\n\t\toffset_bits = pt->bits;\n\t\toffset_base = pt->base;\n\n\t\t/* This case can be more than 16 bits, which is all that\n\t\t   elf_fetch_bits_backward promises.  */\n\t\tneed = offset_basebits;\n\t\tadd = 0;\n\t\tif (unlikely (need > 16))\n\t\t  {\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\t\t    bits -= 16;\n\t\t    add = (val >> bits) & ((1U << 16) - 1);\n\t\t    need -= 16;\n\t\t    add <<= need;\n\t\t  }\n\t\tif (need > 0)\n\t\t  {\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\t\t    bits -= need;\n\t\t    add += (val >> bits) & ((1U << need) - 1);\n\t\t  }\n\n\t\toffset = offset_baseline + add;\n\n\t\tpt = &match_decode.table[match_state];\n\t\tneed = pt->basebits;\n\t\tmatch_baseline = pt->baseline;\n\t\tmatch_bits = pt->bits;\n\t\tmatch_base = pt->base;\n\n\t\tadd = 0;\n\t\tif (need > 0)\n\t\t  {\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\t\t    bits -= need;\n\t\t    add = (val >> bits) & ((1U << need) - 1);\n\t\t  }\n\n\t\tmatch = match_baseline + add;\n\n\t\tpt = &literal_decode.table[literal_state];\n\t\tneed = pt->basebits;\n\t\tliteral_baseline = pt->baseline;\n\t\tliteral_bits = pt->bits;\n\t\tliteral_base = pt->base;\n\n\t\tadd = 0;\n\t\tif (need > 0)\n\t\t  {\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\t\t    bits -= need;\n\t\t    add = (val >> bits) & ((1U << need) - 1);\n\t\t  }\n\n\t\tliteral = literal_baseline + add;\n\n\t\t/* See the comment in elf_zstd_make_offset_baseline_fse.  */\n\t\tif (offset_basebits > 1)\n\t\t  {\n\t\t    repeated_offset3 = repeated_offset2;\n\t\t    repeated_offset2 = repeated_offset1;\n\t\t    repeated_offset1 = offset;\n\t\t  }\n\t\telse\n\t\t  {\n\t\t    if (unlikely (literal == 0))\n\t\t      ++offset;\n\t\t    switch (offset)\n\t\t      {\n\t\t      case 1:\n\t\t\toffset = repeated_offset1;\n\t\t\tbreak;\n\t\t      case 2:\n\t\t\toffset = repeated_offset2;\n\t\t\trepeated_offset2 = repeated_offset1;\n\t\t\trepeated_offset1 = offset;\n\t\t\tbreak;\n\t\t      case 3:\n\t\t\toffset = repeated_offset3;\n\t\t\trepeated_offset3 = repeated_offset2;\n\t\t\trepeated_offset2 = repeated_offset1;\n\t\t\trepeated_offset1 = offset;\n\t\t\tbreak;\n\t\t      case 4:\n\t\t\toffset = repeated_offset1 - 1;\n\t\t\trepeated_offset3 = repeated_offset2;\n\t\t\trepeated_offset2 = repeated_offset1;\n\t\t\trepeated_offset1 = offset;\n\t\t\tbreak;\n\t\t      }\n\t\t  }\n\n\t\t++seq;\n\t\tif (seq < seq_count)\n\t\t  {\n\t\t    uint32_t v;\n\n\t\t    /* Update the three states.  */\n\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\n\t\t    need = literal_bits;\n\t\t    bits -= need;\n\t\t    v = (val >> bits) & (((uint32_t)1 << need) - 1);\n\n\t\t    literal_state = literal_base + v;\n\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\n\t\t    need = match_bits;\n\t\t    bits -= need;\n\t\t    v = (val >> bits) & (((uint32_t)1 << need) - 1);\n\n\t\t    match_state = match_base + v;\n\n\t\t    if (!elf_fetch_bits_backward (&pback, pin, &val, &bits))\n\t\t      return 0;\n\n\t\t    need = offset_bits;\n\t\t    bits -= need;\n\t\t    v = (val >> bits) & (((uint32_t)1 << need) - 1);\n\n\t\t    offset_state = offset_base + v;\n\t\t  }\n\n\t\t/* The next sequence is now in LITERAL, OFFSET, MATCH.  */\n\n\t\t/* Copy LITERAL bytes from the literals.  */\n\n\t\tif (unlikely ((size_t)(poutend - pout) < literal))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\n\t\tif (unlikely (literal_count < literal))\n\t\t  {\n\t\t    elf_uncompress_failed ();\n\t\t    return 0;\n\t\t  }\n\n\t\tliteral_count -= literal;\n\n\t\t/* Often LITERAL is small, so handle small cases quickly.  */\n\t\tswitch (literal)\n\t\t  {\n\t\t  case 8:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 7:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 6:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 5:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 4:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 3:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 2:\n\t\t    *pout++ = *plit++;\n\t\t    /* FALLTHROUGH */\n\t\t  case 1:\n\t\t    *pout++ = *plit++;\n\t\t    break;\n\n\t\t  case 0:\n\t\t    break;\n\n\t\t  default:\n\t\t    if (unlikely ((size_t)(plit - pout) < literal))\n\t\t      {\n\t\t\tuint32_t move;\n\n\t\t\tmove = plit - pout;\n\t\t\twhile (literal > move)\n\t\t\t  {\n\t\t\t    memcpy (pout, plit, move);\n\t\t\t    pout += move;\n\t\t\t    plit += move;\n\t\t\t    literal -= move;\n\t\t\t  }\n\t\t      }\n\n\t\t    memcpy (pout, plit, literal);\n\t\t    pout += literal;\n\t\t    plit += literal;\n\t\t  }\n\n\t\tif (match > 0)\n\t\t  {\n\t\t    /* Copy MATCH bytes from the decoded output at OFFSET.  */\n\n\t\t    if (unlikely ((size_t)(poutend - pout) < match))\n\t\t      {\n\t\t\telf_uncompress_failed ();\n\t\t\treturn 0;\n\t\t      }\n\n\t\t    if (unlikely ((size_t)(pout - poutstart) < offset))\n\t\t      {\n\t\t\telf_uncompress_failed ();\n\t\t\treturn 0;\n\t\t      }\n\n\t\t    if (offset >= match)\n\t\t      {\n\t\t\tmemcpy (pout, pout - offset, match);\n\t\t\tpout += match;\n\t\t      }\n\t\t    else\n\t\t      {\n\t\t\twhile (match > 0)\n\t\t\t  {\n\t\t\t    uint32_t copy;\n\n\t\t\t    copy = match < offset ? match : offset;\n\t\t\t    memcpy (pout, pout - offset, copy);\n\t\t\t    match -= copy;\n\t\t\t    pout += copy;\n\t\t\t  }\n\t\t      }\n\t\t  }\n\n\t\tif (unlikely (seq >= seq_count))\n\t\t  {\n\t\t    /* Copy remaining literals.  */\n\t\t    if (literal_count > 0 && plit != pout)\n\t\t      {\n\t\t\tif (unlikely ((size_t)(poutend - pout)\n\t\t\t\t      < literal_count))\n\t\t\t  {\n\t\t\t    elf_uncompress_failed ();\n\t\t\t    return 0;\n\t\t\t  }\n\n\t\t\tif ((size_t)(plit - pout) < literal_count)\n\t\t\t  {\n\t\t\t    uint32_t move;\n\n\t\t\t    move = plit - pout;\n\t\t\t    while (literal_count > move)\n\t\t\t      {\n\t\t\t\tmemcpy (pout, plit, move);\n\t\t\t\tpout += move;\n\t\t\t\tplit += move;\n\t\t\t\tliteral_count -= move;\n\t\t\t      }\n\t\t\t  }\n\n\t\t\tmemcpy (pout, plit, literal_count);\n\t\t      }\n\n\t\t    pout += literal_count;\n\n\t\t    break;\n\t\t  }\n\t      }\n\n\t    pin = pblockend;\n\t  }\n\t  break;\n\n\tcase 3:\n\tdefault:\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n    }\n\n  if (has_checksum)\n    {\n      if (unlikely (pin + 4 > pinend))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n\n      /* We don't currently verify the checksum.  Currently running GNU ld with\n\t --compress-debug-sections=zstd does not seem to generate a\n\t checksum.  */\n\n      pin += 4;\n    }\n\n  if (pin != pinend)\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  return 1;\n}\n\n#define ZDEBUG_TABLE_SIZE \\\n  (ZLIB_TABLE_SIZE > ZSTD_TABLE_SIZE ? ZLIB_TABLE_SIZE : ZSTD_TABLE_SIZE)\n\n/* Uncompress the old compressed debug format, the one emitted by\n   --compress-debug-sections=zlib-gnu.  The compressed data is in\n   COMPRESSED / COMPRESSED_SIZE, and the function writes to\n   *UNCOMPRESSED / *UNCOMPRESSED_SIZE.  ZDEBUG_TABLE is work space to\n   hold Huffman tables.  Returns 0 on error, 1 on successful\n   decompression or if something goes wrong.  In general we try to\n   carry on, by returning 1, even if we can't decompress.  */\n\nstatic int\nelf_uncompress_zdebug (struct backtrace_state *state,\n\t\t       const unsigned char *compressed, size_t compressed_size,\n\t\t       uint16_t *zdebug_table,\n\t\t       backtrace_error_callback error_callback, void *data,\n\t\t       unsigned char **uncompressed, size_t *uncompressed_size)\n{\n  size_t sz;\n  size_t i;\n  unsigned char *po;\n\n  *uncompressed = NULL;\n  *uncompressed_size = 0;\n\n  /* The format starts with the four bytes ZLIB, followed by the 8\n     byte length of the uncompressed data in big-endian order,\n     followed by a zlib stream.  */\n\n  if (compressed_size < 12 || memcmp (compressed, \"ZLIB\", 4) != 0)\n    return 1;\n\n  sz = 0;\n  for (i = 0; i < 8; i++)\n    sz = (sz << 8) | compressed[i + 4];\n\n  if (*uncompressed != NULL && *uncompressed_size >= sz)\n    po = *uncompressed;\n  else\n    {\n      po = (unsigned char *) backtrace_alloc (state, sz, error_callback, data);\n      if (po == NULL)\n\treturn 0;\n    }\n\n  if (!elf_zlib_inflate_and_verify (compressed + 12, compressed_size - 12,\n\t\t\t\t    zdebug_table, po, sz))\n    return 1;\n\n  *uncompressed = po;\n  *uncompressed_size = sz;\n\n  return 1;\n}\n\n/* Uncompress the new compressed debug format, the official standard\n   ELF approach emitted by --compress-debug-sections=zlib-gabi.  The\n   compressed data is in COMPRESSED / COMPRESSED_SIZE, and the\n   function writes to *UNCOMPRESSED / *UNCOMPRESSED_SIZE.\n   ZDEBUG_TABLE is work space as for elf_uncompress_zdebug.  Returns 0\n   on error, 1 on successful decompression or if something goes wrong.\n   In general we try to carry on, by returning 1, even if we can't\n   decompress.  */\n\nstatic int\nelf_uncompress_chdr (struct backtrace_state *state,\n\t\t     const unsigned char *compressed, size_t compressed_size,\n\t\t     uint16_t *zdebug_table,\n\t\t     backtrace_error_callback error_callback, void *data,\n\t\t     unsigned char **uncompressed, size_t *uncompressed_size)\n{\n  const b_elf_chdr *chdr;\n  char *alc;\n  size_t alc_len;\n  unsigned char *po;\n\n  *uncompressed = NULL;\n  *uncompressed_size = 0;\n\n  /* The format starts with an ELF compression header.  */\n  if (compressed_size < sizeof (b_elf_chdr))\n    return 1;\n\n  chdr = (const b_elf_chdr *) compressed;\n\n  alc = NULL;\n  alc_len = 0;\n  if (*uncompressed != NULL && *uncompressed_size >= chdr->ch_size)\n    po = *uncompressed;\n  else\n    {\n      alc_len = chdr->ch_size;\n      alc = backtrace_alloc (state, alc_len, error_callback, data);\n      if (alc == NULL)\n\treturn 0;\n      po = (unsigned char *) alc;\n    }\n\n  switch (chdr->ch_type)\n    {\n    case ELFCOMPRESS_ZLIB:\n      if (!elf_zlib_inflate_and_verify (compressed + sizeof (b_elf_chdr),\n\t\t\t\t\tcompressed_size - sizeof (b_elf_chdr),\n\t\t\t\t\tzdebug_table, po, chdr->ch_size))\n\tgoto skip;\n      break;\n\n    case ELFCOMPRESS_ZSTD:\n      if (!elf_zstd_decompress (compressed + sizeof (b_elf_chdr),\n\t\t\t\tcompressed_size - sizeof (b_elf_chdr),\n\t\t\t\t(unsigned char *)zdebug_table, po,\n\t\t\t\tchdr->ch_size))\n\tgoto skip;\n      break;\n\n    default:\n      /* Unsupported compression algorithm.  */\n      goto skip;\n    }\n\n  *uncompressed = po;\n  *uncompressed_size = chdr->ch_size;\n\n  return 1;\n\n skip:\n  if (alc != NULL && alc_len > 0)\n    backtrace_free (state, alc, alc_len, error_callback, data);\n  return 1;\n}\n\n/* This function is a hook for testing the zlib support.  It is only\n   used by tests.  */\n\nint\nbacktrace_uncompress_zdebug (struct backtrace_state *state,\n\t\t\t     const unsigned char *compressed,\n\t\t\t     size_t compressed_size,\n\t\t\t     backtrace_error_callback error_callback,\n\t\t\t     void *data, unsigned char **uncompressed,\n\t\t\t     size_t *uncompressed_size)\n{\n  uint16_t *zdebug_table;\n  int ret;\n\n  zdebug_table = ((uint16_t *) backtrace_alloc (state, ZDEBUG_TABLE_SIZE,\n\t\t\t\t\t\terror_callback, data));\n  if (zdebug_table == NULL)\n    return 0;\n  ret = elf_uncompress_zdebug (state, compressed, compressed_size,\n\t\t\t       zdebug_table, error_callback, data,\n\t\t\t       uncompressed, uncompressed_size);\n  backtrace_free (state, zdebug_table, ZDEBUG_TABLE_SIZE,\n\t\t  error_callback, data);\n  return ret;\n}\n\n/* This function is a hook for testing the zstd support.  It is only used by\n   tests.  */\n\nint\nbacktrace_uncompress_zstd (struct backtrace_state *state,\n\t\t\t   const unsigned char *compressed,\n\t\t\t   size_t compressed_size,\n\t\t\t   backtrace_error_callback error_callback,\n\t\t\t   void *data, unsigned char *uncompressed,\n\t\t\t   size_t uncompressed_size)\n{\n  unsigned char *zdebug_table;\n  int ret;\n\n  zdebug_table = ((unsigned char *) backtrace_alloc (state, ZDEBUG_TABLE_SIZE,\n\t\t\t\t\t\t     error_callback, data));\n  if (zdebug_table == NULL)\n    return 0;\n  ret = elf_zstd_decompress (compressed, compressed_size,\n\t\t\t     zdebug_table, uncompressed, uncompressed_size);\n  backtrace_free (state, zdebug_table, ZDEBUG_TABLE_SIZE,\n\t\t  error_callback, data);\n  return ret;\n}\n\n/* Number of LZMA states.  */\n#define LZMA_STATES (12)\n\n/* Number of LZMA position states.  The pb value of the property byte\n   is the number of bits to include in these states, and the maximum\n   value of pb is 4.  */\n#define LZMA_POS_STATES (16)\n\n/* Number of LZMA distance states.  These are used match distances\n   with a short match length: up to 4 bytes.  */\n#define LZMA_DIST_STATES (4)\n\n/* Number of LZMA distance slots.  LZMA uses six bits to encode larger\n   match lengths, so 1 << 6 possible probabilities.  */\n#define LZMA_DIST_SLOTS (64)\n\n/* LZMA distances 0 to 3 are encoded directly, larger values use a\n   probability model.  */\n#define LZMA_DIST_MODEL_START (4)\n\n/* The LZMA probability model ends at 14.  */\n#define LZMA_DIST_MODEL_END (14)\n\n/* LZMA distance slots for distances less than 127.  */\n#define LZMA_FULL_DISTANCES (128)\n\n/* LZMA uses four alignment bits.  */\n#define LZMA_ALIGN_SIZE (16)\n\n/* LZMA match length is encoded with 4, 5, or 10 bits, some of which\n   are already known.  */\n#define LZMA_LEN_LOW_SYMBOLS (8)\n#define LZMA_LEN_MID_SYMBOLS (8)\n#define LZMA_LEN_HIGH_SYMBOLS (256)\n\n/* LZMA literal encoding.  */\n#define LZMA_LITERAL_CODERS_MAX (16)\n#define LZMA_LITERAL_CODER_SIZE (0x300)\n\n/* LZMA is based on a large set of probabilities, each managed\n   independently.  Each probability is an 11 bit number that we store\n   in a uint16_t.  We use a single large array of probabilities.  */\n\n/* Lengths of entries in the LZMA probabilities array.  The names used\n   here are copied from the Linux kernel implementation.  */\n\n#define LZMA_PROB_IS_MATCH_LEN (LZMA_STATES * LZMA_POS_STATES)\n#define LZMA_PROB_IS_REP_LEN LZMA_STATES\n#define LZMA_PROB_IS_REP0_LEN LZMA_STATES\n#define LZMA_PROB_IS_REP1_LEN LZMA_STATES\n#define LZMA_PROB_IS_REP2_LEN LZMA_STATES\n#define LZMA_PROB_IS_REP0_LONG_LEN (LZMA_STATES * LZMA_POS_STATES)\n#define LZMA_PROB_DIST_SLOT_LEN (LZMA_DIST_STATES * LZMA_DIST_SLOTS)\n#define LZMA_PROB_DIST_SPECIAL_LEN (LZMA_FULL_DISTANCES - LZMA_DIST_MODEL_END)\n#define LZMA_PROB_DIST_ALIGN_LEN LZMA_ALIGN_SIZE\n#define LZMA_PROB_MATCH_LEN_CHOICE_LEN 1\n#define LZMA_PROB_MATCH_LEN_CHOICE2_LEN 1\n#define LZMA_PROB_MATCH_LEN_LOW_LEN (LZMA_POS_STATES * LZMA_LEN_LOW_SYMBOLS)\n#define LZMA_PROB_MATCH_LEN_MID_LEN (LZMA_POS_STATES * LZMA_LEN_MID_SYMBOLS)\n#define LZMA_PROB_MATCH_LEN_HIGH_LEN LZMA_LEN_HIGH_SYMBOLS\n#define LZMA_PROB_REP_LEN_CHOICE_LEN 1\n#define LZMA_PROB_REP_LEN_CHOICE2_LEN 1\n#define LZMA_PROB_REP_LEN_LOW_LEN (LZMA_POS_STATES * LZMA_LEN_LOW_SYMBOLS)\n#define LZMA_PROB_REP_LEN_MID_LEN (LZMA_POS_STATES * LZMA_LEN_MID_SYMBOLS)\n#define LZMA_PROB_REP_LEN_HIGH_LEN LZMA_LEN_HIGH_SYMBOLS\n#define LZMA_PROB_LITERAL_LEN \\\n  (LZMA_LITERAL_CODERS_MAX * LZMA_LITERAL_CODER_SIZE)\n\n/* Offsets into the LZMA probabilities array.  This is mechanically\n   generated from the above lengths.  */\n\n#define LZMA_PROB_IS_MATCH_OFFSET 0\n#define LZMA_PROB_IS_REP_OFFSET \\\n  (LZMA_PROB_IS_MATCH_OFFSET + LZMA_PROB_IS_MATCH_LEN)\n#define LZMA_PROB_IS_REP0_OFFSET \\\n  (LZMA_PROB_IS_REP_OFFSET + LZMA_PROB_IS_REP_LEN)\n#define LZMA_PROB_IS_REP1_OFFSET \\\n  (LZMA_PROB_IS_REP0_OFFSET + LZMA_PROB_IS_REP0_LEN)\n#define LZMA_PROB_IS_REP2_OFFSET \\\n  (LZMA_PROB_IS_REP1_OFFSET + LZMA_PROB_IS_REP1_LEN)\n#define LZMA_PROB_IS_REP0_LONG_OFFSET \\\n  (LZMA_PROB_IS_REP2_OFFSET + LZMA_PROB_IS_REP2_LEN)\n#define LZMA_PROB_DIST_SLOT_OFFSET \\\n  (LZMA_PROB_IS_REP0_LONG_OFFSET + LZMA_PROB_IS_REP0_LONG_LEN)\n#define LZMA_PROB_DIST_SPECIAL_OFFSET \\\n  (LZMA_PROB_DIST_SLOT_OFFSET + LZMA_PROB_DIST_SLOT_LEN)\n#define LZMA_PROB_DIST_ALIGN_OFFSET \\\n  (LZMA_PROB_DIST_SPECIAL_OFFSET + LZMA_PROB_DIST_SPECIAL_LEN)\n#define LZMA_PROB_MATCH_LEN_CHOICE_OFFSET \\\n  (LZMA_PROB_DIST_ALIGN_OFFSET + LZMA_PROB_DIST_ALIGN_LEN)\n#define LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET \\\n  (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET + LZMA_PROB_MATCH_LEN_CHOICE_LEN)\n#define LZMA_PROB_MATCH_LEN_LOW_OFFSET \\\n  (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET + LZMA_PROB_MATCH_LEN_CHOICE2_LEN)\n#define LZMA_PROB_MATCH_LEN_MID_OFFSET \\\n  (LZMA_PROB_MATCH_LEN_LOW_OFFSET + LZMA_PROB_MATCH_LEN_LOW_LEN)\n#define LZMA_PROB_MATCH_LEN_HIGH_OFFSET \\\n  (LZMA_PROB_MATCH_LEN_MID_OFFSET + LZMA_PROB_MATCH_LEN_MID_LEN)\n#define LZMA_PROB_REP_LEN_CHOICE_OFFSET \\\n  (LZMA_PROB_MATCH_LEN_HIGH_OFFSET + LZMA_PROB_MATCH_LEN_HIGH_LEN)\n#define LZMA_PROB_REP_LEN_CHOICE2_OFFSET \\\n  (LZMA_PROB_REP_LEN_CHOICE_OFFSET + LZMA_PROB_REP_LEN_CHOICE_LEN)\n#define LZMA_PROB_REP_LEN_LOW_OFFSET \\\n  (LZMA_PROB_REP_LEN_CHOICE2_OFFSET + LZMA_PROB_REP_LEN_CHOICE2_LEN)\n#define LZMA_PROB_REP_LEN_MID_OFFSET \\\n  (LZMA_PROB_REP_LEN_LOW_OFFSET + LZMA_PROB_REP_LEN_LOW_LEN)\n#define LZMA_PROB_REP_LEN_HIGH_OFFSET \\\n  (LZMA_PROB_REP_LEN_MID_OFFSET + LZMA_PROB_REP_LEN_MID_LEN)\n#define LZMA_PROB_LITERAL_OFFSET \\\n  (LZMA_PROB_REP_LEN_HIGH_OFFSET + LZMA_PROB_REP_LEN_HIGH_LEN)\n\n#define LZMA_PROB_TOTAL_COUNT \\\n  (LZMA_PROB_LITERAL_OFFSET + LZMA_PROB_LITERAL_LEN)\n\n/* Check that the number of LZMA probabilities is the same as the\n   Linux kernel implementation.  */\n\n#if LZMA_PROB_TOTAL_COUNT != 1846 + (1 << 4) * 0x300\n #error Wrong number of LZMA probabilities\n#endif\n\n/* Expressions for the offset in the LZMA probabilities array of a\n   specific probability.  */\n\n#define LZMA_IS_MATCH(state, pos) \\\n  (LZMA_PROB_IS_MATCH_OFFSET + (state) * LZMA_POS_STATES + (pos))\n#define LZMA_IS_REP(state) \\\n  (LZMA_PROB_IS_REP_OFFSET + (state))\n#define LZMA_IS_REP0(state) \\\n  (LZMA_PROB_IS_REP0_OFFSET + (state))\n#define LZMA_IS_REP1(state) \\\n  (LZMA_PROB_IS_REP1_OFFSET + (state))\n#define LZMA_IS_REP2(state) \\\n  (LZMA_PROB_IS_REP2_OFFSET + (state))\n#define LZMA_IS_REP0_LONG(state, pos) \\\n  (LZMA_PROB_IS_REP0_LONG_OFFSET + (state) * LZMA_POS_STATES + (pos))\n#define LZMA_DIST_SLOT(dist, slot) \\\n  (LZMA_PROB_DIST_SLOT_OFFSET + (dist) * LZMA_DIST_SLOTS + (slot))\n#define LZMA_DIST_SPECIAL(dist) \\\n  (LZMA_PROB_DIST_SPECIAL_OFFSET + (dist))\n#define LZMA_DIST_ALIGN(dist) \\\n  (LZMA_PROB_DIST_ALIGN_OFFSET + (dist))\n#define LZMA_MATCH_LEN_CHOICE \\\n  LZMA_PROB_MATCH_LEN_CHOICE_OFFSET\n#define LZMA_MATCH_LEN_CHOICE2 \\\n  LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET\n#define LZMA_MATCH_LEN_LOW(pos, sym) \\\n  (LZMA_PROB_MATCH_LEN_LOW_OFFSET + (pos) * LZMA_LEN_LOW_SYMBOLS + (sym))\n#define LZMA_MATCH_LEN_MID(pos, sym) \\\n  (LZMA_PROB_MATCH_LEN_MID_OFFSET + (pos) * LZMA_LEN_MID_SYMBOLS + (sym))\n#define LZMA_MATCH_LEN_HIGH(sym) \\\n  (LZMA_PROB_MATCH_LEN_HIGH_OFFSET + (sym))\n#define LZMA_REP_LEN_CHOICE \\\n  LZMA_PROB_REP_LEN_CHOICE_OFFSET\n#define LZMA_REP_LEN_CHOICE2 \\\n  LZMA_PROB_REP_LEN_CHOICE2_OFFSET\n#define LZMA_REP_LEN_LOW(pos, sym) \\\n  (LZMA_PROB_REP_LEN_LOW_OFFSET + (pos) * LZMA_LEN_LOW_SYMBOLS + (sym))\n#define LZMA_REP_LEN_MID(pos, sym) \\\n  (LZMA_PROB_REP_LEN_MID_OFFSET + (pos) * LZMA_LEN_MID_SYMBOLS + (sym))\n#define LZMA_REP_LEN_HIGH(sym) \\\n  (LZMA_PROB_REP_LEN_HIGH_OFFSET + (sym))\n#define LZMA_LITERAL(code, size) \\\n  (LZMA_PROB_LITERAL_OFFSET + (code) * LZMA_LITERAL_CODER_SIZE + (size))\n\n/* Read an LZMA varint from BUF, reading and updating *POFFSET,\n   setting *VAL.  Returns 0 on error, 1 on success.  */\n\nstatic int\nelf_lzma_varint (const unsigned char *compressed, size_t compressed_size,\n\t\t size_t *poffset, uint64_t *val)\n{\n  size_t off;\n  int i;\n  uint64_t v;\n  unsigned char b;\n\n  off = *poffset;\n  i = 0;\n  v = 0;\n  while (1)\n    {\n      if (unlikely (off >= compressed_size))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      b = compressed[off];\n      v |= (b & 0x7f) << (i * 7);\n      ++off;\n      if ((b & 0x80) == 0)\n\t{\n\t  *poffset = off;\n\t  *val = v;\n\t  return 1;\n\t}\n      ++i;\n      if (unlikely (i >= 9))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n    }\n}\n\n/* Normalize the LZMA range decoder, pulling in an extra input byte if\n   needed.  */\n\nstatic void\nelf_lzma_range_normalize (const unsigned char *compressed,\n\t\t\t  size_t compressed_size, size_t *poffset,\n\t\t\t  uint32_t *prange, uint32_t *pcode)\n{\n  if (*prange < (1U << 24))\n    {\n      if (unlikely (*poffset >= compressed_size))\n\t{\n\t  /* We assume this will be caught elsewhere.  */\n\t  elf_uncompress_failed ();\n\t  return;\n\t}\n      *prange <<= 8;\n      *pcode <<= 8;\n      *pcode += compressed[*poffset];\n      ++*poffset;\n    }\n}\n\n/* Read and return a single bit from the LZMA stream, reading and\n   updating *PROB.  Each bit comes from the range coder.  */\n\nstatic int\nelf_lzma_bit (const unsigned char *compressed, size_t compressed_size,\n\t      uint16_t *prob, size_t *poffset, uint32_t *prange,\n\t      uint32_t *pcode)\n{\n  uint32_t bound;\n\n  elf_lzma_range_normalize (compressed, compressed_size, poffset,\n\t\t\t    prange, pcode);\n  bound = (*prange >> 11) * (uint32_t) *prob;\n  if (*pcode < bound)\n    {\n      *prange = bound;\n      *prob += ((1U << 11) - *prob) >> 5;\n      return 0;\n    }\n  else\n    {\n      *prange -= bound;\n      *pcode -= bound;\n      *prob -= *prob >> 5;\n      return 1;\n    }\n}\n\n/* Read an integer of size BITS from the LZMA stream, most significant\n   bit first.  The bits are predicted using PROBS.  */\n\nstatic uint32_t\nelf_lzma_integer (const unsigned char *compressed, size_t compressed_size,\n\t\t  uint16_t *probs, uint32_t bits, size_t *poffset,\n\t\t  uint32_t *prange, uint32_t *pcode)\n{\n  uint32_t sym;\n  uint32_t i;\n\n  sym = 1;\n  for (i = 0; i < bits; i++)\n    {\n      int bit;\n\n      bit = elf_lzma_bit (compressed, compressed_size, probs + sym, poffset,\n\t\t\t  prange, pcode);\n      sym <<= 1;\n      sym += bit;\n    }\n  return sym - (1 << bits);\n}\n\n/* Read an integer of size BITS from the LZMA stream, least\n   significant bit first.  The bits are predicted using PROBS.  */\n\nstatic uint32_t\nelf_lzma_reverse_integer (const unsigned char *compressed,\n\t\t\t  size_t compressed_size, uint16_t *probs,\n\t\t\t  uint32_t bits, size_t *poffset, uint32_t *prange,\n\t\t\t  uint32_t *pcode)\n{\n  uint32_t sym;\n  uint32_t val;\n  uint32_t i;\n\n  sym = 1;\n  val = 0;\n  for (i = 0; i < bits; i++)\n    {\n      int bit;\n\n      bit = elf_lzma_bit (compressed, compressed_size, probs + sym, poffset,\n\t\t\t  prange, pcode);\n      sym <<= 1;\n      sym += bit;\n      val += bit << i;\n    }\n  return val;\n}\n\n/* Read a length from the LZMA stream.  IS_REP picks either LZMA_MATCH\n   or LZMA_REP probabilities.  */\n\nstatic uint32_t\nelf_lzma_len (const unsigned char *compressed, size_t compressed_size,\n\t      uint16_t *probs, int is_rep, unsigned int pos_state,\n\t      size_t *poffset, uint32_t *prange, uint32_t *pcode)\n{\n  uint16_t *probs_choice;\n  uint16_t *probs_sym;\n  uint32_t bits;\n  uint32_t len;\n\n  probs_choice = probs + (is_rep\n\t\t\t  ? LZMA_REP_LEN_CHOICE\n\t\t\t  : LZMA_MATCH_LEN_CHOICE);\n  if (elf_lzma_bit (compressed, compressed_size, probs_choice, poffset,\n\t\t    prange, pcode))\n    {\n      probs_choice = probs + (is_rep\n\t\t\t      ? LZMA_REP_LEN_CHOICE2\n\t\t\t      : LZMA_MATCH_LEN_CHOICE2);\n      if (elf_lzma_bit (compressed, compressed_size, probs_choice,\n\t\t\tpoffset, prange, pcode))\n\t{\n\t  probs_sym = probs + (is_rep\n\t\t\t       ? LZMA_REP_LEN_HIGH (0)\n\t\t\t       : LZMA_MATCH_LEN_HIGH (0));\n\t  bits = 8;\n\t  len = 2 + 8 + 8;\n\t}\n      else\n\t{\n\t  probs_sym = probs + (is_rep\n\t\t\t       ? LZMA_REP_LEN_MID (pos_state, 0)\n\t\t\t       : LZMA_MATCH_LEN_MID (pos_state, 0));\n\t  bits = 3;\n\t  len = 2 + 8;\n\t}\n    }\n  else\n    {\n      probs_sym = probs + (is_rep\n\t\t\t   ? LZMA_REP_LEN_LOW (pos_state, 0)\n\t\t\t   : LZMA_MATCH_LEN_LOW (pos_state, 0));\n      bits = 3;\n      len = 2;\n    }\n\n  len += elf_lzma_integer (compressed, compressed_size, probs_sym, bits,\n\t\t\t   poffset, prange, pcode);\n  return len;\n}\n\n/* Uncompress one LZMA block from a minidebug file.  The compressed\n   data is at COMPRESSED + *POFFSET.  Update *POFFSET.  Store the data\n   into the memory at UNCOMPRESSED, size UNCOMPRESSED_SIZE.  CHECK is\n   the stream flag from the xz header.  Return 1 on successful\n   decompression.  */\n\nstatic int\nelf_uncompress_lzma_block (const unsigned char *compressed,\n\t\t\t   size_t compressed_size, unsigned char check,\n\t\t\t   uint16_t *probs, unsigned char *uncompressed,\n\t\t\t   size_t uncompressed_size, size_t *poffset)\n{\n  size_t off;\n  size_t block_header_offset;\n  size_t block_header_size;\n  unsigned char block_flags;\n  uint64_t header_compressed_size;\n  uint64_t header_uncompressed_size;\n  unsigned char lzma2_properties;\n  uint32_t computed_crc;\n  uint32_t stream_crc;\n  size_t uncompressed_offset;\n  size_t dict_start_offset;\n  unsigned int lc;\n  unsigned int lp;\n  unsigned int pb;\n  uint32_t range;\n  uint32_t code;\n  uint32_t lstate;\n  uint32_t dist[4];\n\n  off = *poffset;\n  block_header_offset = off;\n\n  /* Block header size is a single byte.  */\n  if (unlikely (off >= compressed_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  block_header_size = (compressed[off] + 1) * 4;\n  if (unlikely (off + block_header_size > compressed_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Block flags.  */\n  block_flags = compressed[off + 1];\n  if (unlikely ((block_flags & 0x3c) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  off += 2;\n\n  /* Optional compressed size.  */\n  header_compressed_size = 0;\n  if ((block_flags & 0x40) != 0)\n    {\n      *poffset = off;\n      if (!elf_lzma_varint (compressed, compressed_size, poffset,\n\t\t\t    &header_compressed_size))\n\treturn 0;\n      off = *poffset;\n    }\n\n  /* Optional uncompressed size.  */\n  header_uncompressed_size = 0;\n  if ((block_flags & 0x80) != 0)\n    {\n      *poffset = off;\n      if (!elf_lzma_varint (compressed, compressed_size, poffset,\n\t\t\t    &header_uncompressed_size))\n\treturn 0;\n      off = *poffset;\n    }\n\n  /* The recipe for creating a minidebug file is to run the xz program\n     with no arguments, so we expect exactly one filter: lzma2.  */\n\n  if (unlikely ((block_flags & 0x3) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  if (unlikely (off + 2 >= block_header_offset + block_header_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* The filter ID for LZMA2 is 0x21.  */\n  if (unlikely (compressed[off] != 0x21))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  ++off;\n\n  /* The size of the filter properties for LZMA2 is 1.  */\n  if (unlikely (compressed[off] != 1))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  ++off;\n\n  lzma2_properties = compressed[off];\n  ++off;\n\n  if (unlikely (lzma2_properties > 40))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* The properties describe the dictionary size, but we don't care\n     what that is.  */\n\n  /* Block header padding.  */\n  if (unlikely (off + 4 > compressed_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  off = (off + 3) &~ (size_t) 3;\n\n  if (unlikely (off + 4 > compressed_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Block header CRC.  */\n  computed_crc = elf_crc32 (0, compressed + block_header_offset,\n\t\t\t    block_header_size - 4);\n  stream_crc = (compressed[off]\n\t\t| (compressed[off + 1] << 8)\n\t\t| (compressed[off + 2] << 16)\n\t\t| (compressed[off + 3] << 24));\n  if (unlikely (computed_crc != stream_crc))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  off += 4;\n\n  /* Read a sequence of LZMA2 packets.  */\n\n  uncompressed_offset = 0;\n  dict_start_offset = 0;\n  lc = 0;\n  lp = 0;\n  pb = 0;\n  lstate = 0;\n  while (off < compressed_size)\n    {\n      unsigned char control;\n\n      range = 0xffffffff;\n      code = 0;\n\n      control = compressed[off];\n      ++off;\n      if (unlikely (control == 0))\n\t{\n\t  /* End of packets.  */\n\t  break;\n\t}\n\n      if (control == 1 || control >= 0xe0)\n\t{\n\t  /* Reset dictionary to empty.  */\n\t  dict_start_offset = uncompressed_offset;\n\t}\n\n      if (control < 0x80)\n\t{\n\t  size_t chunk_size;\n\n\t  /* The only valid values here are 1 or 2.  A 1 means to\n\t     reset the dictionary (done above).  Then we see an\n\t     uncompressed chunk.  */\n\n\t  if (unlikely (control > 2))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  /* An uncompressed chunk is a two byte size followed by\n\t     data.  */\n\n\t  if (unlikely (off + 2 > compressed_size))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  chunk_size = compressed[off] << 8;\n\t  chunk_size += compressed[off + 1];\n\t  ++chunk_size;\n\n\t  off += 2;\n\n\t  if (unlikely (off + chunk_size > compressed_size))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\t  if (unlikely (uncompressed_offset + chunk_size > uncompressed_size))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  memcpy (uncompressed + uncompressed_offset, compressed + off,\n\t\t  chunk_size);\n\t  uncompressed_offset += chunk_size;\n\t  off += chunk_size;\n\t}\n      else\n\t{\n\t  size_t uncompressed_chunk_start;\n\t  size_t uncompressed_chunk_size;\n\t  size_t compressed_chunk_size;\n\t  size_t limit;\n\n\t  /* An LZMA chunk.  This starts with an uncompressed size and\n\t     a compressed size.  */\n\n\t  if (unlikely (off + 4 >= compressed_size))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  uncompressed_chunk_start = uncompressed_offset;\n\n\t  uncompressed_chunk_size = (control & 0x1f) << 16;\n\t  uncompressed_chunk_size += compressed[off] << 8;\n\t  uncompressed_chunk_size += compressed[off + 1];\n\t  ++uncompressed_chunk_size;\n\n\t  compressed_chunk_size = compressed[off + 2] << 8;\n\t  compressed_chunk_size += compressed[off + 3];\n\t  ++compressed_chunk_size;\n\n\t  off += 4;\n\n\t  /* Bit 7 (0x80) is set.\n\t     Bits 6 and 5 (0x40 and 0x20) are as follows:\n\t     0: don't reset anything\n\t     1: reset state\n\t     2: reset state, read properties\n\t     3: reset state, read properties, reset dictionary (done above) */\n\n\t  if (control >= 0xc0)\n\t    {\n\t      unsigned char props;\n\n\t      /* Bit 6 is set, read properties.  */\n\n\t      if (unlikely (off >= compressed_size))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      props = compressed[off];\n\t      ++off;\n\t      if (unlikely (props > (4 * 5 + 4) * 9 + 8))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t      pb = 0;\n\t      while (props >= 9 * 5)\n\t\t{\n\t\t  props -= 9 * 5;\n\t\t  ++pb;\n\t\t}\n\t      lp = 0;\n\t      while (props > 9)\n\t\t{\n\t\t  props -= 9;\n\t\t  ++lp;\n\t\t}\n\t      lc = props;\n\t      if (unlikely (lc + lp > 4))\n\t\t{\n\t\t  elf_uncompress_failed ();\n\t\t  return 0;\n\t\t}\n\t    }\n\n\t  if (control >= 0xa0)\n\t    {\n\t      size_t i;\n\n\t      /* Bit 5 or 6 is set, reset LZMA state.  */\n\n\t      lstate = 0;\n\t      memset (&dist, 0, sizeof dist);\n\t      for (i = 0; i < LZMA_PROB_TOTAL_COUNT; i++)\n\t\tprobs[i] = 1 << 10;\n\t      range = 0xffffffff;\n\t      code = 0;\n\t    }\n\n\t  /* Read the range code.  */\n\n\t  if (unlikely (off + 5 > compressed_size))\n\t    {\n\t      elf_uncompress_failed ();\n\t      return 0;\n\t    }\n\n\t  /* The byte at compressed[off] is ignored for some\n\t     reason.  */\n\n\t  code = ((compressed[off + 1] << 24)\n\t\t  + (compressed[off + 2] << 16)\n\t\t  + (compressed[off + 3] << 8)\n\t\t  + compressed[off + 4]);\n\t  off += 5;\n\n\t  /* This is the main LZMA decode loop.  */\n\n\t  limit = off + compressed_chunk_size;\n\t  *poffset = off;\n\t  while (*poffset < limit)\n\t    {\n\t      unsigned int pos_state;\n\n\t      if (unlikely (uncompressed_offset\n\t\t\t    == (uncompressed_chunk_start\n\t\t\t\t+ uncompressed_chunk_size)))\n\t\t{\n\t\t  /* We've decompressed all the expected bytes.  */\n\t\t  break;\n\t\t}\n\n\t      pos_state = ((uncompressed_offset - dict_start_offset)\n\t\t\t   & ((1 << pb) - 1));\n\n\t      if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\tprobs + LZMA_IS_MATCH (lstate, pos_state),\n\t\t\t\tpoffset, &range, &code))\n\t\t{\n\t\t  uint32_t len;\n\n\t\t  if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t    probs + LZMA_IS_REP (lstate),\n\t\t\t\t    poffset, &range, &code))\n\t\t    {\n\t\t      int short_rep;\n\t\t      uint32_t next_dist;\n\n\t\t      /* Repeated match.  */\n\n\t\t      short_rep = 0;\n\t\t      if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t\tprobs + LZMA_IS_REP0 (lstate),\n\t\t\t\t\tpoffset, &range, &code))\n\t\t\t{\n\t\t\t  if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t\t    probs + LZMA_IS_REP1 (lstate),\n\t\t\t\t\t    poffset, &range, &code))\n\t\t\t    {\n\t\t\t      if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t\t\tprobs + LZMA_IS_REP2 (lstate),\n\t\t\t\t\t\tpoffset, &range, &code))\n\t\t\t\t{\n\t\t\t\t  next_dist = dist[3];\n\t\t\t\t  dist[3] = dist[2];\n\t\t\t\t}\n\t\t\t      else\n\t\t\t\t{\n\t\t\t\t  next_dist = dist[2];\n\t\t\t\t}\n\t\t\t      dist[2] = dist[1];\n\t\t\t    }\n\t\t\t  else\n\t\t\t    {\n\t\t\t      next_dist = dist[1];\n\t\t\t    }\n\n\t\t\t  dist[1] = dist[0];\n\t\t\t  dist[0] = next_dist;\n\t\t\t}\n\t\t      else\n\t\t\t{\n\t\t\t  if (!elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t\t    (probs\n\t\t\t\t\t     + LZMA_IS_REP0_LONG (lstate,\n\t\t\t\t\t\t\t\t  pos_state)),\n\t\t\t\t\t    poffset, &range, &code))\n\t\t\t    short_rep = 1;\n\t\t\t}\n\n\t\t      if (lstate < 7)\n\t\t\tlstate = short_rep ? 9 : 8;\n\t\t      else\n\t\t\tlstate = 11;\n\n\t\t      if (short_rep)\n\t\t\tlen = 1;\n\t\t      else\n\t\t\tlen = elf_lzma_len (compressed, compressed_size,\n\t\t\t\t\t    probs, 1, pos_state, poffset,\n\t\t\t\t\t    &range, &code);\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      uint32_t dist_state;\n\t\t      uint32_t dist_slot;\n\t\t      uint16_t *probs_dist;\n\n\t\t      /* Match.  */\n\n\t\t      if (lstate < 7)\n\t\t\tlstate = 7;\n\t\t      else\n\t\t\tlstate = 10;\n\t\t      dist[3] = dist[2];\n\t\t      dist[2] = dist[1];\n\t\t      dist[1] = dist[0];\n\t\t      len = elf_lzma_len (compressed, compressed_size,\n\t\t\t\t\t  probs, 0, pos_state, poffset,\n\t\t\t\t\t  &range, &code);\n\n\t\t      if (len < 4 + 2)\n\t\t\tdist_state = len - 2;\n\t\t      else\n\t\t\tdist_state = 3;\n\t\t      probs_dist = probs + LZMA_DIST_SLOT (dist_state, 0);\n\t\t      dist_slot = elf_lzma_integer (compressed,\n\t\t\t\t\t\t    compressed_size,\n\t\t\t\t\t\t    probs_dist, 6,\n\t\t\t\t\t\t    poffset, &range,\n\t\t\t\t\t\t    &code);\n\t\t      if (dist_slot < LZMA_DIST_MODEL_START)\n\t\t\tdist[0] = dist_slot;\n\t\t      else\n\t\t\t{\n\t\t\t  uint32_t limit;\n\n\t\t\t  limit = (dist_slot >> 1) - 1;\n\t\t\t  dist[0] = 2 + (dist_slot & 1);\n\t\t\t  if (dist_slot < LZMA_DIST_MODEL_END)\n\t\t\t    {\n\t\t\t      dist[0] <<= limit;\n\t\t\t      probs_dist = (probs\n\t\t\t\t\t    + LZMA_DIST_SPECIAL(dist[0]\n\t\t\t\t\t\t\t\t- dist_slot\n\t\t\t\t\t\t\t\t- 1));\n\t\t\t      dist[0] +=\n\t\t\t\telf_lzma_reverse_integer (compressed,\n\t\t\t\t\t\t\t  compressed_size,\n\t\t\t\t\t\t\t  probs_dist,\n\t\t\t\t\t\t\t  limit, poffset,\n\t\t\t\t\t\t\t  &range, &code);\n\t\t\t    }\n\t\t\t  else\n\t\t\t    {\n\t\t\t      uint32_t dist0;\n\t\t\t      uint32_t i;\n\n\t\t\t      dist0 = dist[0];\n\t\t\t      for (i = 0; i < limit - 4; i++)\n\t\t\t\t{\n\t\t\t\t  uint32_t mask;\n\n\t\t\t\t  elf_lzma_range_normalize (compressed,\n\t\t\t\t\t\t\t    compressed_size,\n\t\t\t\t\t\t\t    poffset,\n\t\t\t\t\t\t\t    &range, &code);\n\t\t\t\t  range >>= 1;\n\t\t\t\t  code -= range;\n\t\t\t\t  mask = -(code >> 31);\n\t\t\t\t  code += range & mask;\n\t\t\t\t  dist0 <<= 1;\n\t\t\t\t  dist0 += mask + 1;\n\t\t\t\t}\n\t\t\t      dist0 <<= 4;\n\t\t\t      probs_dist = probs + LZMA_DIST_ALIGN (0);\n\t\t\t      dist0 +=\n\t\t\t\telf_lzma_reverse_integer (compressed,\n\t\t\t\t\t\t\t  compressed_size,\n\t\t\t\t\t\t\t  probs_dist, 4,\n\t\t\t\t\t\t\t  poffset,\n\t\t\t\t\t\t\t  &range, &code);\n\t\t\t      dist[0] = dist0;\n\t\t\t    }\n\t\t\t}\n\t\t    }\n\n\t\t  if (unlikely (uncompressed_offset\n\t\t\t\t- dict_start_offset < dist[0] + 1))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\t\t  if (unlikely (uncompressed_offset + len > uncompressed_size))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\n\t\t  if (dist[0] == 0)\n\t\t    {\n\t\t      /* A common case, meaning repeat the last\n\t\t\t character LEN times.  */\n\t\t      memset (uncompressed + uncompressed_offset,\n\t\t\t      uncompressed[uncompressed_offset - 1],\n\t\t\t      len);\n\t\t      uncompressed_offset += len;\n\t\t    }\n\t\t  else if (dist[0] + 1 >= len)\n\t\t    {\n\t\t      memcpy (uncompressed + uncompressed_offset,\n\t\t\t      uncompressed + uncompressed_offset - dist[0] - 1,\n\t\t\t      len);\n\t\t      uncompressed_offset += len;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      while (len > 0)\n\t\t\t{\n\t\t\t  uint32_t copy;\n\n\t\t\t  copy = len < dist[0] + 1 ? len : dist[0] + 1;\n\t\t\t  memcpy (uncompressed + uncompressed_offset,\n\t\t\t\t  (uncompressed + uncompressed_offset\n\t\t\t\t   - dist[0] - 1),\n\t\t\t\t  copy);\n\t\t\t  len -= copy;\n\t\t\t  uncompressed_offset += copy;\n\t\t\t}\n\t\t    }\n\t\t}\n\t      else\n\t\t{\n\t\t  unsigned char prev;\n\t\t  unsigned char low;\n\t\t  size_t high;\n\t\t  uint16_t *lit_probs;\n\t\t  unsigned int sym;\n\n\t\t  /* Literal value.  */\n\n\t\t  if (uncompressed_offset > 0)\n\t\t    prev = uncompressed[uncompressed_offset - 1];\n\t\t  else\n\t\t    prev = 0;\n\t\t  low = prev >> (8 - lc);\n\t\t  high = (((uncompressed_offset - dict_start_offset)\n\t\t\t   & ((1 << lp) - 1))\n\t\t\t  << lc);\n\t\t  lit_probs = probs + LZMA_LITERAL (low + high, 0);\n\t\t  if (lstate < 7)\n\t\t    sym = elf_lzma_integer (compressed, compressed_size,\n\t\t\t\t\t    lit_probs, 8, poffset, &range,\n\t\t\t\t\t    &code);\n\t\t  else\n\t\t    {\n\t\t      unsigned int match;\n\t\t      unsigned int bit;\n\t\t      unsigned int match_bit;\n\t\t      unsigned int idx;\n\n\t\t      sym = 1;\n\t\t      if (uncompressed_offset >= dist[0] + 1)\n\t\t\tmatch = uncompressed[uncompressed_offset - dist[0] - 1];\n\t\t      else\n\t\t\tmatch = 0;\n\t\t      match <<= 1;\n\t\t      bit = 0x100;\n\t\t      do\n\t\t\t{\n\t\t\t  match_bit = match & bit;\n\t\t\t  match <<= 1;\n\t\t\t  idx = bit + match_bit + sym;\n\t\t\t  sym <<= 1;\n\t\t\t  if (elf_lzma_bit (compressed, compressed_size,\n\t\t\t\t\t    lit_probs + idx, poffset,\n\t\t\t\t\t    &range, &code))\n\t\t\t    {\n\t\t\t      ++sym;\n\t\t\t      bit &= match_bit;\n\t\t\t    }\n\t\t\t  else\n\t\t\t    {\n\t\t\t      bit &= ~ match_bit;\n\t\t\t    }\n\t\t\t}\n\t\t      while (sym < 0x100);\n\t\t    }\n\n\t\t  if (unlikely (uncompressed_offset >= uncompressed_size))\n\t\t    {\n\t\t      elf_uncompress_failed ();\n\t\t      return 0;\n\t\t    }\n\n\t\t  uncompressed[uncompressed_offset] = (unsigned char) sym;\n\t\t  ++uncompressed_offset;\n\t\t  if (lstate <= 3)\n\t\t    lstate = 0;\n\t\t  else if (lstate <= 9)\n\t\t    lstate -= 3;\n\t\t  else\n\t\t    lstate -= 6;\n\t\t}\n\t    }\n\n\t  elf_lzma_range_normalize (compressed, compressed_size, poffset,\n\t\t\t\t    &range, &code);\n\n\t  off = *poffset;\n\t}\n    }\n\n  /* We have reached the end of the block.  Pad to four byte\n     boundary.  */\n  off = (off + 3) &~ (size_t) 3;\n  if (unlikely (off > compressed_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  switch (check)\n    {\n    case 0:\n      /* No check.  */\n      break;\n\n    case 1:\n      /* CRC32 */\n      if (unlikely (off + 4 > compressed_size))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      computed_crc = elf_crc32 (0, uncompressed, uncompressed_offset);\n      stream_crc = (compressed[off]\n\t\t    | (compressed[off + 1] << 8)\n\t\t    | (compressed[off + 2] << 16)\n\t\t    | (compressed[off + 3] << 24));\n      if (computed_crc != stream_crc)\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      off += 4;\n      break;\n\n    case 4:\n      /* CRC64.  We don't bother computing a CRC64 checksum.  */\n      if (unlikely (off + 8 > compressed_size))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      off += 8;\n      break;\n\n    case 10:\n      /* SHA.  We don't bother computing a SHA checksum.  */\n      if (unlikely (off + 32 > compressed_size))\n\t{\n\t  elf_uncompress_failed ();\n\t  return 0;\n\t}\n      off += 32;\n      break;\n\n    default:\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  *poffset = off;\n\n  return 1;\n}\n\n/* Uncompress LZMA data found in a minidebug file.  The minidebug\n   format is described at\n   https://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html.\n   Returns 0 on error, 1 on successful decompression.  For this\n   function we return 0 on failure to decompress, as the calling code\n   will carry on in that case.  */\n\nstatic int\nelf_uncompress_lzma (struct backtrace_state *state,\n\t\t     const unsigned char *compressed, size_t compressed_size,\n\t\t     backtrace_error_callback error_callback, void *data,\n\t\t     unsigned char **uncompressed, size_t *uncompressed_size)\n{\n  size_t header_size;\n  size_t footer_size;\n  unsigned char check;\n  uint32_t computed_crc;\n  uint32_t stream_crc;\n  size_t offset;\n  size_t index_size;\n  size_t footer_offset;\n  size_t index_offset;\n  uint64_t index_compressed_size;\n  uint64_t index_uncompressed_size;\n  unsigned char *mem;\n  uint16_t *probs;\n  size_t compressed_block_size;\n\n  /* The format starts with a stream header and ends with a stream\n     footer.  */\n  header_size = 12;\n  footer_size = 12;\n  if (unlikely (compressed_size < header_size + footer_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* The stream header starts with a magic string.  */\n  if (unlikely (memcmp (compressed, \"\\375\" \"7zXZ\\0\", 6) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Next come stream flags.  The first byte is zero, the second byte\n     is the check.  */\n  if (unlikely (compressed[6] != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  check = compressed[7];\n  if (unlikely ((check & 0xf8) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Next comes a CRC of the stream flags.  */\n  computed_crc = elf_crc32 (0, compressed + 6, 2);\n  stream_crc = (compressed[8]\n\t\t| (compressed[9] << 8)\n\t\t| (compressed[10] << 16)\n\t\t| (compressed[11] << 24));\n  if (unlikely (computed_crc != stream_crc))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Now that we've parsed the header, parse the footer, so that we\n     can get the uncompressed size.  */\n\n  /* The footer ends with two magic bytes.  */\n\n  offset = compressed_size;\n  if (unlikely (memcmp (compressed + offset - 2, \"YZ\", 2) != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  offset -= 2;\n\n  /* Before that are the stream flags, which should be the same as the\n     flags in the header.  */\n  if (unlikely (compressed[offset - 2] != 0\n\t\t|| compressed[offset - 1] != check))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  offset -= 2;\n\n  /* Before that is the size of the index field, which precedes the\n     footer.  */\n  index_size = (compressed[offset - 4]\n\t\t| (compressed[offset - 3] << 8)\n\t\t| (compressed[offset - 2] << 16)\n\t\t| (compressed[offset - 1] << 24));\n  index_size = (index_size + 1) * 4;\n  offset -= 4;\n\n  /* Before that is a footer CRC.  */\n  computed_crc = elf_crc32 (0, compressed + offset, 6);\n  stream_crc = (compressed[offset - 4]\n\t\t| (compressed[offset - 3] << 8)\n\t\t| (compressed[offset - 2] << 16)\n\t\t| (compressed[offset - 1] << 24));\n  if (unlikely (computed_crc != stream_crc))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  offset -= 4;\n\n  /* The index comes just before the footer.  */\n  if (unlikely (offset < index_size + header_size))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  footer_offset = offset;\n  offset -= index_size;\n  index_offset = offset;\n\n  /* The index starts with a zero byte.  */\n  if (unlikely (compressed[offset] != 0))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  ++offset;\n\n  /* Next is the number of blocks.  We expect zero blocks for an empty\n     stream, and otherwise a single block.  */\n  if (unlikely (compressed[offset] == 0))\n    {\n      *uncompressed = NULL;\n      *uncompressed_size = 0;\n      return 1;\n    }\n  if (unlikely (compressed[offset] != 1))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  ++offset;\n\n  /* Next is the compressed size and the uncompressed size.  */\n  if (!elf_lzma_varint (compressed, compressed_size, &offset,\n\t\t\t&index_compressed_size))\n    return 0;\n  if (!elf_lzma_varint (compressed, compressed_size, &offset,\n\t\t\t&index_uncompressed_size))\n    return 0;\n\n  /* Pad to a four byte boundary.  */\n  offset = (offset + 3) &~ (size_t) 3;\n\n  /* Next is a CRC of the index.  */\n  computed_crc = elf_crc32 (0, compressed + index_offset,\n\t\t\t    offset - index_offset);\n  stream_crc = (compressed[offset]\n\t\t| (compressed[offset + 1] << 8)\n\t\t| (compressed[offset + 2] << 16)\n\t\t| (compressed[offset + 3] << 24));\n  if (unlikely (computed_crc != stream_crc))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n  offset += 4;\n\n  /* We should now be back at the footer.  */\n  if (unlikely (offset != footer_offset))\n    {\n      elf_uncompress_failed ();\n      return 0;\n    }\n\n  /* Allocate space to hold the uncompressed data.  If we succeed in\n     uncompressing the LZMA data, we never free this memory.  */\n  mem = (unsigned char *) backtrace_alloc (state, index_uncompressed_size,\n\t\t\t\t\t   error_callback, data);\n  if (unlikely (mem == NULL))\n    return 0;\n  *uncompressed = mem;\n  *uncompressed_size = index_uncompressed_size;\n\n  /* Allocate space for probabilities.  */\n  probs = ((uint16_t *)\n\t   backtrace_alloc (state,\n\t\t\t    LZMA_PROB_TOTAL_COUNT * sizeof (uint16_t),\n\t\t\t    error_callback, data));\n  if (unlikely (probs == NULL))\n    {\n      backtrace_free (state, mem, index_uncompressed_size, error_callback,\n\t\t      data);\n      return 0;\n    }\n\n  /* Uncompress the block, which follows the header.  */\n  offset = 12;\n  if (!elf_uncompress_lzma_block (compressed, compressed_size, check, probs,\n\t\t\t\t  mem, index_uncompressed_size, &offset))\n    {\n      backtrace_free (state, mem, index_uncompressed_size, error_callback,\n\t\t      data);\n      return 0;\n    }\n\n  compressed_block_size = offset - 12;\n  if (unlikely (compressed_block_size\n\t\t!= ((index_compressed_size + 3) &~ (size_t) 3)))\n    {\n      elf_uncompress_failed ();\n      backtrace_free (state, mem, index_uncompressed_size, error_callback,\n\t\t      data);\n      return 0;\n    }\n\n  offset = (offset + 3) &~ (size_t) 3;\n  if (unlikely (offset != index_offset))\n    {\n      elf_uncompress_failed ();\n      backtrace_free (state, mem, index_uncompressed_size, error_callback,\n\t\t      data);\n      return 0;\n    }\n\n  return 1;\n}\n\n/* This function is a hook for testing the LZMA support.  It is only\n   used by tests.  */\n\nint\nbacktrace_uncompress_lzma (struct backtrace_state *state,\n\t\t\t   const unsigned char *compressed,\n\t\t\t   size_t compressed_size,\n\t\t\t   backtrace_error_callback error_callback,\n\t\t\t   void *data, unsigned char **uncompressed,\n\t\t\t   size_t *uncompressed_size)\n{\n  return elf_uncompress_lzma (state, compressed, compressed_size,\n\t\t\t      error_callback, data, uncompressed,\n\t\t\t      uncompressed_size);\n}\n\n/* Add the backtrace data for one ELF file.  Returns 1 on success,\n   0 on failure (in both cases descriptor is closed) or -1 if exe\n   is non-zero and the ELF file is ET_DYN, which tells the caller that\n   elf_add will need to be called on the descriptor again after\n   base_address is determined.  */\n\nstatic int\nelf_add (struct backtrace_state *state, const char *filename, int descriptor,\n\t const unsigned char *memory, size_t memory_size,\n\t uintptr_t base_address, backtrace_error_callback error_callback,\n\t void *data, fileline *fileline_fn, int *found_sym, int *found_dwarf,\n\t struct dwarf_data **fileline_entry, int exe, int debuginfo,\n\t const char *with_buildid_data, uint32_t with_buildid_size)\n{\n  struct elf_view ehdr_view;\n  b_elf_ehdr ehdr;\n  off_t shoff;\n  unsigned int shnum;\n  unsigned int shstrndx;\n  struct elf_view shdrs_view;\n  int shdrs_view_valid;\n  const b_elf_shdr *shdrs;\n  const b_elf_shdr *shstrhdr;\n  size_t shstr_size;\n  off_t shstr_off;\n  struct elf_view names_view;\n  int names_view_valid;\n  const char *names;\n  unsigned int symtab_shndx;\n  unsigned int dynsym_shndx;\n  unsigned int i;\n  struct debug_section_info sections[DEBUG_MAX];\n  struct debug_section_info zsections[DEBUG_MAX];\n  struct elf_view symtab_view;\n  int symtab_view_valid;\n  struct elf_view strtab_view;\n  int strtab_view_valid;\n  struct elf_view buildid_view;\n  int buildid_view_valid;\n  const char *buildid_data;\n  uint32_t buildid_size;\n  struct elf_view debuglink_view;\n  int debuglink_view_valid;\n  const char *debuglink_name;\n  uint32_t debuglink_crc;\n  struct elf_view debugaltlink_view;\n  int debugaltlink_view_valid;\n  const char *debugaltlink_name;\n  const char *debugaltlink_buildid_data;\n  uint32_t debugaltlink_buildid_size;\n  struct elf_view gnu_debugdata_view;\n  int gnu_debugdata_view_valid;\n  size_t gnu_debugdata_size;\n  unsigned char *gnu_debugdata_uncompressed;\n  size_t gnu_debugdata_uncompressed_size;\n  off_t min_offset;\n  off_t max_offset;\n  off_t debug_size;\n  struct elf_view debug_view;\n  int debug_view_valid;\n  unsigned int using_debug_view;\n  uint16_t *zdebug_table;\n  struct elf_view split_debug_view[DEBUG_MAX];\n  unsigned char split_debug_view_valid[DEBUG_MAX];\n  struct elf_ppc64_opd_data opd_data, *opd;\n  struct dwarf_sections dwarf_sections;\n\n  if (!debuginfo)\n    {\n      *found_sym = 0;\n      *found_dwarf = 0;\n    }\n\n  shdrs_view_valid = 0;\n  names_view_valid = 0;\n  symtab_view_valid = 0;\n  strtab_view_valid = 0;\n  buildid_view_valid = 0;\n  buildid_data = NULL;\n  buildid_size = 0;\n  debuglink_view_valid = 0;\n  debuglink_name = NULL;\n  debuglink_crc = 0;\n  debugaltlink_view_valid = 0;\n  debugaltlink_name = NULL;\n  debugaltlink_buildid_data = NULL;\n  debugaltlink_buildid_size = 0;\n  gnu_debugdata_view_valid = 0;\n  gnu_debugdata_size = 0;\n  debug_view_valid = 0;\n  memset (&split_debug_view_valid[0], 0, sizeof split_debug_view_valid);\n  opd = NULL;\n\n  if (!elf_get_view (state, descriptor, memory, memory_size, 0, sizeof ehdr,\n\t\t     error_callback, data, &ehdr_view))\n    goto fail;\n\n  memcpy (&ehdr, ehdr_view.view.data, sizeof ehdr);\n\n  elf_release_view (state, &ehdr_view, error_callback, data);\n\n  if (ehdr.e_ident[EI_MAG0] != ELFMAG0\n      || ehdr.e_ident[EI_MAG1] != ELFMAG1\n      || ehdr.e_ident[EI_MAG2] != ELFMAG2\n      || ehdr.e_ident[EI_MAG3] != ELFMAG3)\n    {\n      error_callback (data, \"executable file is not ELF\", 0);\n      goto fail;\n    }\n  if (ehdr.e_ident[EI_VERSION] != EV_CURRENT)\n    {\n      error_callback (data, \"executable file is unrecognized ELF version\", 0);\n      goto fail;\n    }\n\n#if BACKTRACE_ELF_SIZE == 32\n#define BACKTRACE_ELFCLASS ELFCLASS32\n#else\n#define BACKTRACE_ELFCLASS ELFCLASS64\n#endif\n\n  if (ehdr.e_ident[EI_CLASS] != BACKTRACE_ELFCLASS)\n    {\n      error_callback (data, \"executable file is unexpected ELF class\", 0);\n      goto fail;\n    }\n\n  if (ehdr.e_ident[EI_DATA] != ELFDATA2LSB\n      && ehdr.e_ident[EI_DATA] != ELFDATA2MSB)\n    {\n      error_callback (data, \"executable file has unknown endianness\", 0);\n      goto fail;\n    }\n\n  /* If the executable is ET_DYN, it is either a PIE, or we are running\n     directly a shared library with .interp.  We need to wait for\n     dl_iterate_phdr in that case to determine the actual base_address.  */\n  if (exe && ehdr.e_type == ET_DYN)\n    return -1;\n\n  shoff = ehdr.e_shoff;\n  shnum = ehdr.e_shnum;\n  shstrndx = ehdr.e_shstrndx;\n\n  if ((shnum == 0 || shstrndx == SHN_XINDEX)\n      && shoff != 0)\n    {\n      struct elf_view shdr_view;\n      const b_elf_shdr *shdr;\n\n      if (!elf_get_view (state, descriptor, memory, memory_size, shoff,\n\t\t\t sizeof shdr, error_callback, data, &shdr_view))\n\tgoto fail;\n\n      shdr = (const b_elf_shdr *) shdr_view.view.data;\n\n      if (shnum == 0)\n\tshnum = shdr->sh_size;\n\n      if (shstrndx == SHN_XINDEX)\n\t{\n\t  shstrndx = shdr->sh_link;\n\n\t  /* Versions of the GNU binutils between 2.12 and 2.18 did\n\t     not handle objects with more than SHN_LORESERVE sections\n\t     correctly.  All large section indexes were offset by\n\t     0x100.  There is more information at\n\t     http://sourceware.org/bugzilla/show_bug.cgi?id-5900 .\n\t     Fortunately these object files are easy to detect, as the\n\t     GNU binutils always put the section header string table\n\t     near the end of the list of sections.  Thus if the\n\t     section header string table index is larger than the\n\t     number of sections, then we know we have to subtract\n\t     0x100 to get the real section index.  */\n\t  if (shstrndx >= shnum && shstrndx >= SHN_LORESERVE + 0x100)\n\t    shstrndx -= 0x100;\n\t}\n\n      elf_release_view (state, &shdr_view, error_callback, data);\n    }\n\n  if (shnum == 0 || shstrndx == 0)\n    goto fail;\n\n  /* To translate PC to file/line when using DWARF, we need to find\n     the .debug_info and .debug_line sections.  */\n\n  /* Read the section headers, skipping the first one.  */\n\n  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t     shoff + sizeof (b_elf_shdr),\n\t\t     (shnum - 1) * sizeof (b_elf_shdr),\n\t\t     error_callback, data, &shdrs_view))\n    goto fail;\n  shdrs_view_valid = 1;\n  shdrs = (const b_elf_shdr *) shdrs_view.view.data;\n\n  /* Read the section names.  */\n\n  shstrhdr = &shdrs[shstrndx - 1];\n  shstr_size = shstrhdr->sh_size;\n  shstr_off = shstrhdr->sh_offset;\n\n  if (!elf_get_view (state, descriptor, memory, memory_size, shstr_off,\n\t\t     shstrhdr->sh_size, error_callback, data, &names_view))\n    goto fail;\n  names_view_valid = 1;\n  names = (const char *) names_view.view.data;\n\n  symtab_shndx = 0;\n  dynsym_shndx = 0;\n\n  memset (sections, 0, sizeof sections);\n  memset (zsections, 0, sizeof zsections);\n\n  /* Look for the symbol table.  */\n  for (i = 1; i < shnum; ++i)\n    {\n      const b_elf_shdr *shdr;\n      unsigned int sh_name;\n      const char *name;\n      int j;\n\n      shdr = &shdrs[i - 1];\n\n      if (shdr->sh_type == SHT_SYMTAB)\n\tsymtab_shndx = i;\n      else if (shdr->sh_type == SHT_DYNSYM)\n\tdynsym_shndx = i;\n\n      sh_name = shdr->sh_name;\n      if (sh_name >= shstr_size)\n\t{\n\t  error_callback (data, \"ELF section name out of range\", 0);\n\t  goto fail;\n\t}\n\n      name = names + sh_name;\n\n      for (j = 0; j < (int) DEBUG_MAX; ++j)\n\t{\n\t  if (strcmp (name, dwarf_section_names[j]) == 0)\n\t    {\n\t      sections[j].offset = shdr->sh_offset;\n\t      sections[j].size = shdr->sh_size;\n\t      sections[j].compressed = (shdr->sh_flags & SHF_COMPRESSED) != 0;\n\t      break;\n\t    }\n\t}\n\n      if (name[0] == '.' && name[1] == 'z')\n\t{\n\t  for (j = 0; j < (int) DEBUG_MAX; ++j)\n\t    {\n\t      if (strcmp (name + 2, dwarf_section_names[j] + 1) == 0)\n\t\t{\n\t\t  zsections[j].offset = shdr->sh_offset;\n\t\t  zsections[j].size = shdr->sh_size;\n\t\t  break;\n\t\t}\n\t    }\n\t}\n\n      /* Read the build ID if present.  This could check for any\n\t SHT_NOTE section with the right note name and type, but gdb\n\t looks for a specific section name.  */\n      if ((!debuginfo || with_buildid_data != NULL)\n\t  && !buildid_view_valid\n\t  && strcmp (name, \".note.gnu.build-id\") == 0)\n\t{\n\t  const b_elf_note *note;\n\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     shdr->sh_offset, shdr->sh_size, error_callback,\n\t\t\t     data, &buildid_view))\n\t    goto fail;\n\n\t  buildid_view_valid = 1;\n\t  note = (const b_elf_note *) buildid_view.view.data;\n\t  if (note->type == NT_GNU_BUILD_ID\n\t      && note->namesz == 4\n\t      && strncmp (note->name, \"GNU\", 4) == 0\n\t      && shdr->sh_size <= 12 + ((note->namesz + 3) & ~ 3) + note->descsz)\n\t    {\n\t      buildid_data = &note->name[0] + ((note->namesz + 3) & ~ 3);\n\t      buildid_size = note->descsz;\n\t    }\n\n\t  if (with_buildid_size != 0)\n\t    {\n\t      if (buildid_size != with_buildid_size)\n\t\tgoto fail;\n\n\t      if (memcmp (buildid_data, with_buildid_data, buildid_size) != 0)\n\t\tgoto fail;\n\t    }\n\t}\n\n      /* Read the debuglink file if present.  */\n      if (!debuginfo\n\t  && !debuglink_view_valid\n\t  && strcmp (name, \".gnu_debuglink\") == 0)\n\t{\n\t  const char *debuglink_data;\n\t  size_t crc_offset;\n\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     shdr->sh_offset, shdr->sh_size, error_callback,\n\t\t\t     data, &debuglink_view))\n\t    goto fail;\n\n\t  debuglink_view_valid = 1;\n\t  debuglink_data = (const char *) debuglink_view.view.data;\n\t  crc_offset = strnlen (debuglink_data, shdr->sh_size);\n\t  crc_offset = (crc_offset + 3) & ~3;\n\t  if (crc_offset + 4 <= shdr->sh_size)\n\t    {\n\t      debuglink_name = debuglink_data;\n\t      debuglink_crc = *(const uint32_t*)(debuglink_data + crc_offset);\n\t    }\n\t}\n\n      if (!debugaltlink_view_valid\n\t  && strcmp (name, \".gnu_debugaltlink\") == 0)\n\t{\n\t  const char *debugaltlink_data;\n\t  size_t debugaltlink_name_len;\n\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     shdr->sh_offset, shdr->sh_size, error_callback,\n\t\t\t     data, &debugaltlink_view))\n\t    goto fail;\n\n\t  debugaltlink_view_valid = 1;\n\t  debugaltlink_data = (const char *) debugaltlink_view.view.data;\n\t  debugaltlink_name = debugaltlink_data;\n\t  debugaltlink_name_len = strnlen (debugaltlink_data, shdr->sh_size);\n\t  if (debugaltlink_name_len < shdr->sh_size)\n\t    {\n\t      /* Include terminating zero.  */\n\t      debugaltlink_name_len += 1;\n\n\t      debugaltlink_buildid_data\n\t\t= debugaltlink_data + debugaltlink_name_len;\n\t      debugaltlink_buildid_size = shdr->sh_size - debugaltlink_name_len;\n\t    }\n\t}\n\n      if (!gnu_debugdata_view_valid\n\t  && strcmp (name, \".gnu_debugdata\") == 0)\n\t{\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     shdr->sh_offset, shdr->sh_size, error_callback,\n\t\t\t     data, &gnu_debugdata_view))\n\t    goto fail;\n\n\t  gnu_debugdata_size = shdr->sh_size;\n\t  gnu_debugdata_view_valid = 1;\n\t}\n\n      /* Read the .opd section on PowerPC64 ELFv1.  */\n      if (ehdr.e_machine == EM_PPC64\n\t  && (ehdr.e_flags & EF_PPC64_ABI) < 2\n\t  && shdr->sh_type == SHT_PROGBITS\n\t  && strcmp (name, \".opd\") == 0)\n\t{\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     shdr->sh_offset, shdr->sh_size, error_callback,\n\t\t\t     data, &opd_data.view))\n\t    goto fail;\n\n\t  opd = &opd_data;\n\t  opd->addr = shdr->sh_addr;\n\t  opd->data = (const char *) opd_data.view.view.data;\n\t  opd->size = shdr->sh_size;\n\t}\n    }\n\n  if (symtab_shndx == 0)\n    symtab_shndx = dynsym_shndx;\n  if (symtab_shndx != 0 && !debuginfo)\n    {\n      const b_elf_shdr *symtab_shdr;\n      unsigned int strtab_shndx;\n      const b_elf_shdr *strtab_shdr;\n      struct elf_syminfo_data *sdata;\n\n      symtab_shdr = &shdrs[symtab_shndx - 1];\n      strtab_shndx = symtab_shdr->sh_link;\n      if (strtab_shndx >= shnum)\n\t{\n\t  error_callback (data,\n\t\t\t  \"ELF symbol table strtab link out of range\", 0);\n\t  goto fail;\n\t}\n      strtab_shdr = &shdrs[strtab_shndx - 1];\n\n      if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t symtab_shdr->sh_offset, symtab_shdr->sh_size,\n\t\t\t error_callback, data, &symtab_view))\n\tgoto fail;\n      symtab_view_valid = 1;\n\n      if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t strtab_shdr->sh_offset, strtab_shdr->sh_size,\n\t\t\t error_callback, data, &strtab_view))\n\tgoto fail;\n      strtab_view_valid = 1;\n\n      sdata = ((struct elf_syminfo_data *)\n\t       backtrace_alloc (state, sizeof *sdata, error_callback, data));\n      if (sdata == NULL)\n\tgoto fail;\n\n      if (!elf_initialize_syminfo (state, base_address,\n\t\t\t\t   symtab_view.view.data, symtab_shdr->sh_size,\n\t\t\t\t   strtab_view.view.data, strtab_shdr->sh_size,\n\t\t\t\t   error_callback, data, sdata, opd))\n\t{\n\t  backtrace_free (state, sdata, sizeof *sdata, error_callback, data);\n\t  goto fail;\n\t}\n\n      /* We no longer need the symbol table, but we hold on to the\n\t string table permanently.  */\n      elf_release_view (state, &symtab_view, error_callback, data);\n      symtab_view_valid = 0;\n      strtab_view_valid = 0;\n\n      *found_sym = 1;\n\n      elf_add_syminfo_data (state, sdata);\n    }\n\n  elf_release_view (state, &shdrs_view, error_callback, data);\n  shdrs_view_valid = 0;\n  elf_release_view (state, &names_view, error_callback, data);\n  names_view_valid = 0;\n\n  /* If the debug info is in a separate file, read that one instead.  */\n\n  if (buildid_data != NULL)\n    {\n      int d;\n\n      d = elf_open_debugfile_by_buildid (state, buildid_data, buildid_size,\n\t\t\t\t\t error_callback, data);\n      if (d >= 0)\n\t{\n\t  int ret;\n\n\t  elf_release_view (state, &buildid_view, error_callback, data);\n\t  if (debuglink_view_valid)\n\t    elf_release_view (state, &debuglink_view, error_callback, data);\n\t  if (debugaltlink_view_valid)\n\t    elf_release_view (state, &debugaltlink_view, error_callback, data);\n\t  ret = elf_add (state, \"\", d, NULL, 0, base_address, error_callback,\n\t\t\t data, fileline_fn, found_sym, found_dwarf, NULL, 0,\n\t\t\t 1, NULL, 0);\n\t  if (ret < 0)\n\t    backtrace_close (d, error_callback, data);\n\t  else if (descriptor >= 0)\n\t    backtrace_close (descriptor, error_callback, data);\n\t  return ret;\n\t}\n    }\n\n  if (buildid_view_valid)\n    {\n      elf_release_view (state, &buildid_view, error_callback, data);\n      buildid_view_valid = 0;\n    }\n\n  if (opd)\n    {\n      elf_release_view (state, &opd->view, error_callback, data);\n      opd = NULL;\n    }\n\n  if (debuglink_name != NULL)\n    {\n      int d;\n\n      d = elf_open_debugfile_by_debuglink (state, filename, debuglink_name,\n\t\t\t\t\t   debuglink_crc, error_callback,\n\t\t\t\t\t   data);\n      if (d >= 0)\n\t{\n\t  int ret;\n\n\t  elf_release_view (state, &debuglink_view, error_callback, data);\n\t  if (debugaltlink_view_valid)\n\t    elf_release_view (state, &debugaltlink_view, error_callback, data);\n\t  ret = elf_add (state, \"\", d, NULL, 0, base_address, error_callback,\n\t\t\t data, fileline_fn, found_sym, found_dwarf, NULL, 0,\n\t\t\t 1, NULL, 0);\n\t  if (ret < 0)\n\t    backtrace_close (d, error_callback, data);\n\t  else if (descriptor >= 0)\n\t    backtrace_close(descriptor, error_callback, data);\n\t  return ret;\n\t}\n    }\n\n  if (debuglink_view_valid)\n    {\n      elf_release_view (state, &debuglink_view, error_callback, data);\n      debuglink_view_valid = 0;\n    }\n\n  struct dwarf_data *fileline_altlink = NULL;\n  if (debugaltlink_name != NULL)\n    {\n      int d;\n\n      d = elf_open_debugfile_by_debuglink (state, filename, debugaltlink_name,\n\t\t\t\t\t   0, error_callback, data);\n      if (d >= 0)\n\t{\n\t  int ret;\n\n\t  ret = elf_add (state, filename, d, NULL, 0, base_address,\n\t\t\t error_callback, data, fileline_fn, found_sym,\n\t\t\t found_dwarf, &fileline_altlink, 0, 1,\n\t\t\t debugaltlink_buildid_data, debugaltlink_buildid_size);\n\t  elf_release_view (state, &debugaltlink_view, error_callback, data);\n\t  debugaltlink_view_valid = 0;\n\t  if (ret < 0)\n\t    {\n\t      backtrace_close (d, error_callback, data);\n\t      return ret;\n\t    }\n\t}\n    }\n\n  if (debugaltlink_view_valid)\n    {\n      elf_release_view (state, &debugaltlink_view, error_callback, data);\n      debugaltlink_view_valid = 0;\n    }\n\n  if (gnu_debugdata_view_valid)\n    {\n      int ret;\n\n      ret = elf_uncompress_lzma (state,\n\t\t\t\t ((const unsigned char *)\n\t\t\t\t  gnu_debugdata_view.view.data),\n\t\t\t\t gnu_debugdata_size, error_callback, data,\n\t\t\t\t &gnu_debugdata_uncompressed,\n\t\t\t\t &gnu_debugdata_uncompressed_size);\n\n      elf_release_view (state, &gnu_debugdata_view, error_callback, data);\n      gnu_debugdata_view_valid = 0;\n\n      if (ret)\n\t{\n\t  ret = elf_add (state, filename, -1, gnu_debugdata_uncompressed,\n\t\t\t gnu_debugdata_uncompressed_size, base_address,\n\t\t\t error_callback, data, fileline_fn, found_sym,\n\t\t\t found_dwarf, NULL, 0, 0, NULL, 0);\n\t  if (ret >= 0 && descriptor >= 0)\n\t    backtrace_close(descriptor, error_callback, data);\n\t  return ret;\n\t}\n    }\n\n  /* Read all the debug sections in a single view, since they are\n     probably adjacent in the file.  If any of sections are\n     uncompressed, we never release this view.  */\n\n  min_offset = 0;\n  max_offset = 0;\n  debug_size = 0;\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      off_t end;\n\n      if (sections[i].size != 0)\n\t{\n\t  if (min_offset == 0 || sections[i].offset < min_offset)\n\t    min_offset = sections[i].offset;\n\t  end = sections[i].offset + sections[i].size;\n\t  if (end > max_offset)\n\t    max_offset = end;\n\t  debug_size += sections[i].size;\n\t}\n      if (zsections[i].size != 0)\n\t{\n\t  if (min_offset == 0 || zsections[i].offset < min_offset)\n\t    min_offset = zsections[i].offset;\n\t  end = zsections[i].offset + zsections[i].size;\n\t  if (end > max_offset)\n\t    max_offset = end;\n\t  debug_size += zsections[i].size;\n\t}\n    }\n  if (min_offset == 0 || max_offset == 0)\n    {\n      if (descriptor >= 0)\n\t{\n\t  if (!backtrace_close (descriptor, error_callback, data))\n\t    goto fail;\n\t}\n      return 1;\n    }\n\n  /* If the total debug section size is large, assume that there are\n     gaps between the sections, and read them individually.  */\n\n  if (max_offset - min_offset < 0x20000000\n      || max_offset - min_offset < debug_size + 0x10000)\n    {\n      if (!elf_get_view (state, descriptor, memory, memory_size, min_offset,\n\t\t\t max_offset - min_offset, error_callback, data,\n\t\t\t &debug_view))\n\tgoto fail;\n      debug_view_valid = 1;\n    }\n  else\n    {\n      memset (&split_debug_view[0], 0, sizeof split_debug_view);\n      for (i = 0; i < (int) DEBUG_MAX; ++i)\n\t{\n\t  struct debug_section_info *dsec;\n\n\t  if (sections[i].size != 0)\n\t    dsec = &sections[i];\n\t  else if (zsections[i].size != 0)\n\t    dsec = &zsections[i];\n\t  else\n\t    continue;\n\n\t  if (!elf_get_view (state, descriptor, memory, memory_size,\n\t\t\t     dsec->offset, dsec->size, error_callback, data,\n\t\t\t     &split_debug_view[i]))\n\t    goto fail;\n\t  split_debug_view_valid[i] = 1;\n\n\t  if (sections[i].size != 0)\n\t    sections[i].data = ((const unsigned char *)\n\t\t\t\tsplit_debug_view[i].view.data);\n\t  else\n\t    zsections[i].data = ((const unsigned char *)\n\t\t\t\t split_debug_view[i].view.data);\n\t}\n    }\n\n  /* We've read all we need from the executable.  */\n  if (descriptor >= 0)\n    {\n      if (!backtrace_close (descriptor, error_callback, data))\n\tgoto fail;\n      descriptor = -1;\n    }\n\n  using_debug_view = 0;\n  if (debug_view_valid)\n    {\n      for (i = 0; i < (int) DEBUG_MAX; ++i)\n\t{\n\t  if (sections[i].size == 0)\n\t    sections[i].data = NULL;\n\t  else\n\t    {\n\t      sections[i].data = ((const unsigned char *) debug_view.view.data\n\t\t\t\t  + (sections[i].offset - min_offset));\n\t      ++using_debug_view;\n\t    }\n\n\t  if (zsections[i].size == 0)\n\t    zsections[i].data = NULL;\n\t  else\n\t    zsections[i].data = ((const unsigned char *) debug_view.view.data\n\t\t\t\t + (zsections[i].offset - min_offset));\n\t}\n    }\n\n  /* Uncompress the old format (--compress-debug-sections=zlib-gnu).  */\n\n  zdebug_table = NULL;\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      if (sections[i].size == 0 && zsections[i].size > 0)\n\t{\n\t  unsigned char *uncompressed_data;\n\t  size_t uncompressed_size;\n\n\t  if (zdebug_table == NULL)\n\t    {\n\t      zdebug_table = ((uint16_t *)\n\t\t\t      backtrace_alloc (state, ZLIB_TABLE_SIZE,\n\t\t\t\t\t       error_callback, data));\n\t      if (zdebug_table == NULL)\n\t\tgoto fail;\n\t    }\n\n\t  uncompressed_data = NULL;\n\t  uncompressed_size = 0;\n\t  if (!elf_uncompress_zdebug (state, zsections[i].data,\n\t\t\t\t      zsections[i].size, zdebug_table,\n\t\t\t\t      error_callback, data,\n\t\t\t\t      &uncompressed_data, &uncompressed_size))\n\t    goto fail;\n\t  sections[i].data = uncompressed_data;\n\t  sections[i].size = uncompressed_size;\n\t  sections[i].compressed = 0;\n\n\t  if (split_debug_view_valid[i])\n\t    {\n\t      elf_release_view (state, &split_debug_view[i],\n\t\t\t\terror_callback, data);\n\t      split_debug_view_valid[i] = 0;\n\t    }\n\t}\n    }\n\n  if (zdebug_table != NULL)\n    {\n      backtrace_free (state, zdebug_table, ZLIB_TABLE_SIZE,\n\t\t      error_callback, data);\n      zdebug_table = NULL;\n    }\n\n  /* Uncompress the official ELF format\n     (--compress-debug-sections=zlib-gabi, --compress-debug-sections=zstd).  */\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      unsigned char *uncompressed_data;\n      size_t uncompressed_size;\n\n      if (sections[i].size == 0 || !sections[i].compressed)\n\tcontinue;\n\n      if (zdebug_table == NULL)\n\t{\n\t  zdebug_table = ((uint16_t *)\n\t\t\t  backtrace_alloc (state, ZDEBUG_TABLE_SIZE,\n\t\t\t\t\t   error_callback, data));\n\t  if (zdebug_table == NULL)\n\t    goto fail;\n\t}\n\n      uncompressed_data = NULL;\n      uncompressed_size = 0;\n      if (!elf_uncompress_chdr (state, sections[i].data, sections[i].size,\n\t\t\t\tzdebug_table, error_callback, data,\n\t\t\t\t&uncompressed_data, &uncompressed_size))\n\tgoto fail;\n      sections[i].data = uncompressed_data;\n      sections[i].size = uncompressed_size;\n      sections[i].compressed = 0;\n\n      if (debug_view_valid)\n\t--using_debug_view;\n      else if (split_debug_view_valid[i])\n\t{\n\t  elf_release_view (state, &split_debug_view[i], error_callback, data);\n\t  split_debug_view_valid[i] = 0;\n\t}\n    }\n\n  if (zdebug_table != NULL)\n    backtrace_free (state, zdebug_table, ZDEBUG_TABLE_SIZE,\n\t\t    error_callback, data);\n\n  if (debug_view_valid && using_debug_view == 0)\n    {\n      elf_release_view (state, &debug_view, error_callback, data);\n      debug_view_valid = 0;\n    }\n\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      dwarf_sections.data[i] = sections[i].data;\n      dwarf_sections.size[i] = sections[i].size;\n    }\n\n  if (!backtrace_dwarf_add (state, base_address, &dwarf_sections,\n\t\t\t    ehdr.e_ident[EI_DATA] == ELFDATA2MSB,\n\t\t\t    fileline_altlink,\n\t\t\t    error_callback, data, fileline_fn,\n\t\t\t    fileline_entry))\n    goto fail;\n\n  *found_dwarf = 1;\n\n  return 1;\n\n fail:\n  if (shdrs_view_valid)\n    elf_release_view (state, &shdrs_view, error_callback, data);\n  if (names_view_valid)\n    elf_release_view (state, &names_view, error_callback, data);\n  if (symtab_view_valid)\n    elf_release_view (state, &symtab_view, error_callback, data);\n  if (strtab_view_valid)\n    elf_release_view (state, &strtab_view, error_callback, data);\n  if (debuglink_view_valid)\n    elf_release_view (state, &debuglink_view, error_callback, data);\n  if (debugaltlink_view_valid)\n    elf_release_view (state, &debugaltlink_view, error_callback, data);\n  if (gnu_debugdata_view_valid)\n    elf_release_view (state, &gnu_debugdata_view, error_callback, data);\n  if (buildid_view_valid)\n    elf_release_view (state, &buildid_view, error_callback, data);\n  if (debug_view_valid)\n    elf_release_view (state, &debug_view, error_callback, data);\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      if (split_debug_view_valid[i])\n\telf_release_view (state, &split_debug_view[i], error_callback, data);\n    }\n  if (opd)\n    elf_release_view (state, &opd->view, error_callback, data);\n  if (descriptor >= 0)\n    backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n/* Data passed to phdr_callback.  */\n\nstruct phdr_data\n{\n  struct backtrace_state *state;\n  backtrace_error_callback error_callback;\n  void *data;\n  fileline *fileline_fn;\n  int *found_sym;\n  int *found_dwarf;\n  const char *exe_filename;\n  int exe_descriptor;\n};\n\n/* Callback passed to dl_iterate_phdr.  Load debug info from shared\n   libraries.  */\n\nstatic int\n#ifdef __i386__\n__attribute__ ((__force_align_arg_pointer__))\n#endif\nphdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,\n\t       void *pdata)\n{\n  struct phdr_data *pd = (struct phdr_data *) pdata;\n  const char *filename;\n  int descriptor;\n  int does_not_exist;\n  fileline elf_fileline_fn;\n  int found_dwarf;\n\n  /* There is not much we can do if we don't have the module name,\n     unless executable is ET_DYN, where we expect the very first\n     phdr_callback to be for the PIE.  */\n  if (info->dlpi_name == NULL || info->dlpi_name[0] == '\\0')\n    {\n      if (pd->exe_descriptor == -1)\n\treturn 0;\n      filename = pd->exe_filename;\n      descriptor = pd->exe_descriptor;\n      pd->exe_descriptor = -1;\n    }\n  else\n    {\n      if (pd->exe_descriptor != -1)\n\t{\n\t  backtrace_close (pd->exe_descriptor, pd->error_callback, pd->data);\n\t  pd->exe_descriptor = -1;\n\t}\n\n      filename = info->dlpi_name;\n      descriptor = backtrace_open (info->dlpi_name, pd->error_callback,\n\t\t\t\t   pd->data, &does_not_exist);\n      if (descriptor < 0)\n\treturn 0;\n    }\n\n  if (elf_add (pd->state, filename, descriptor, NULL, 0, info->dlpi_addr,\n\t       pd->error_callback, pd->data, &elf_fileline_fn, pd->found_sym,\n\t       &found_dwarf, NULL, 0, 0, NULL, 0))\n    {\n      if (found_dwarf)\n\t{\n\t  *pd->found_dwarf = 1;\n\t  *pd->fileline_fn = elf_fileline_fn;\n\t}\n    }\n\n  return 0;\n}\n\n/* Initialize the backtrace data we need from an ELF executable.  At\n   the ELF level, all we need to do is find the debug info\n   sections.  */\n\nint\nbacktrace_initialize (struct backtrace_state *state, const char *filename,\n\t\t      int descriptor, backtrace_error_callback error_callback,\n\t\t      void *data, fileline *fileline_fn)\n{\n  int ret;\n  int found_sym;\n  int found_dwarf;\n  fileline elf_fileline_fn = elf_nodebug;\n  struct phdr_data pd;\n\n  ret = elf_add (state, filename, descriptor, NULL, 0, 0, error_callback, data,\n\t\t &elf_fileline_fn, &found_sym, &found_dwarf, NULL, 1, 0, NULL,\n\t\t 0);\n  if (!ret)\n    return 0;\n\n  pd.state = state;\n  pd.error_callback = error_callback;\n  pd.data = data;\n  pd.fileline_fn = &elf_fileline_fn;\n  pd.found_sym = &found_sym;\n  pd.found_dwarf = &found_dwarf;\n  pd.exe_filename = filename;\n  pd.exe_descriptor = ret < 0 ? descriptor : -1;\n\n  dl_iterate_phdr (phdr_callback, (void *) &pd);\n\n  if (!state->threaded)\n    {\n      if (found_sym)\n\tstate->syminfo_fn = elf_syminfo;\n      else if (state->syminfo_fn == NULL)\n\tstate->syminfo_fn = elf_nosyms;\n    }\n  else\n    {\n      if (found_sym)\n\tbacktrace_atomic_store_pointer (&state->syminfo_fn, elf_syminfo);\n      else\n\t(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,\n\t\t\t\t\t     elf_nosyms);\n    }\n\n  if (!state->threaded)\n    *fileline_fn = state->fileline_fn;\n  else\n    *fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n\n  if (*fileline_fn == NULL || *fileline_fn == elf_nodebug)\n    *fileline_fn = elf_fileline_fn;\n\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/fileline.c",
    "content": "/* fileline.c -- Get file and line number information in a backtrace.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#if defined (HAVE_KERN_PROC_ARGS) || defined (HAVE_KERN_PROC)\n#include <sys/sysctl.h>\n#endif\n\n#ifdef HAVE_MACH_O_DYLD_H\n#include <mach-o/dyld.h>\n#endif\n\n#ifdef HAVE_WINDOWS_H\n#ifndef WIN32_MEAN_AND_LEAN\n#define WIN32_MEAN_AND_LEAN\n#endif\n\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n\n#include <windows.h>\n#endif\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n#ifndef HAVE_GETEXECNAME\n#define getexecname() NULL\n#endif\n\n#if !defined (HAVE_KERN_PROC_ARGS) && !defined (HAVE_KERN_PROC)\n\n#define sysctl_exec_name1(state, error_callback, data) NULL\n#define sysctl_exec_name2(state, error_callback, data) NULL\n\n#else /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */\n\nstatic char *\nsysctl_exec_name (struct backtrace_state *state,\n\t\t  int mib0, int mib1, int mib2, int mib3,\n\t\t  backtrace_error_callback error_callback, void *data)\n{\n  int mib[4];\n  size_t len;\n  char *name;\n  size_t rlen;\n\n  mib[0] = mib0;\n  mib[1] = mib1;\n  mib[2] = mib2;\n  mib[3] = mib3;\n\n  if (sysctl (mib, 4, NULL, &len, NULL, 0) < 0)\n    return NULL;\n  name = (char *) backtrace_alloc (state, len, error_callback, data);\n  if (name == NULL)\n    return NULL;\n  rlen = len;\n  if (sysctl (mib, 4, name, &rlen, NULL, 0) < 0)\n    {\n      backtrace_free (state, name, len, error_callback, data);\n      return NULL;\n    }\n  return name;\n}\n\n#ifdef HAVE_KERN_PROC_ARGS\n\nstatic char *\nsysctl_exec_name1 (struct backtrace_state *state,\n\t\t   backtrace_error_callback error_callback, void *data)\n{\n  /* This variant is used on NetBSD.  */\n  return sysctl_exec_name (state, CTL_KERN, KERN_PROC_ARGS, -1,\n\t\t\t   KERN_PROC_PATHNAME, error_callback, data);\n}\n\n#else\n\n#define sysctl_exec_name1(state, error_callback, data) NULL\n\n#endif\n\n#ifdef HAVE_KERN_PROC\n\nstatic char *\nsysctl_exec_name2 (struct backtrace_state *state,\n\t\t   backtrace_error_callback error_callback, void *data)\n{\n  /* This variant is used on FreeBSD.  */\n  return sysctl_exec_name (state, CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1,\n\t\t\t   error_callback, data);\n}\n\n#else\n\n#define sysctl_exec_name2(state, error_callback, data) NULL\n\n#endif\n\n#endif /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */\n\n#ifdef HAVE_MACH_O_DYLD_H\n\nstatic char *\nmacho_get_executable_path (struct backtrace_state *state,\n\t\t\t   backtrace_error_callback error_callback, void *data)\n{\n  uint32_t len;\n  char *name;\n\n  len = 0;\n  if (_NSGetExecutablePath (NULL, &len) == 0)\n    return NULL;\n  name = (char *) backtrace_alloc (state, len, error_callback, data);\n  if (name == NULL)\n    return NULL;\n  if (_NSGetExecutablePath (name, &len) != 0)\n    {\n      backtrace_free (state, name, len, error_callback, data);\n      return NULL;\n    }\n  return name;\n}\n\n#else /* !defined (HAVE_MACH_O_DYLD_H) */\n\n#define macho_get_executable_path(state, error_callback, data) NULL\n\n#endif /* !defined (HAVE_MACH_O_DYLD_H) */\n\n#if HAVE_DECL__PGMPTR\n\n#define windows_executable_filename() _pgmptr\n\n#else /* !HAVE_DECL__PGMPTR */\n\n#define windows_executable_filename() NULL\n\n#endif /* !HAVE_DECL__PGMPTR */\n\n#ifdef HAVE_WINDOWS_H\n\n#define FILENAME_BUF_SIZE (MAX_PATH)\n\nstatic char *\nwindows_get_executable_path (char *buf, backtrace_error_callback error_callback,\n\t\t\t     void *data)\n{\n  size_t got;\n  int error;\n\n  got = GetModuleFileNameA (NULL, buf, FILENAME_BUF_SIZE - 1);\n  error = GetLastError ();\n  if (got == 0\n      || (got == FILENAME_BUF_SIZE - 1 && error == ERROR_INSUFFICIENT_BUFFER))\n    {\n      error_callback (data,\n\t\t      \"could not get the filename of the current executable\",\n\t\t      error);\n      return NULL;\n    }\n  return buf;\n}\n\n#else /* !defined (HAVE_WINDOWS_H) */\n\n#define windows_get_executable_path(buf, error_callback, data) NULL\n#define FILENAME_BUF_SIZE 64\n\n#endif /* !defined (HAVE_WINDOWS_H) */\n\n/* Initialize the fileline information from the executable.  Returns 1\n   on success, 0 on failure.  */\n\nstatic int\nfileline_initialize (struct backtrace_state *state,\n\t\t     backtrace_error_callback error_callback, void *data)\n{\n  int failed;\n  fileline fileline_fn;\n  int pass;\n  int called_error_callback;\n  int descriptor;\n  const char *filename;\n  char buf[FILENAME_BUF_SIZE];\n\n  if (!state->threaded)\n    failed = state->fileline_initialization_failed;\n  else\n    failed = backtrace_atomic_load_int (&state->fileline_initialization_failed);\n\n  if (failed)\n    {\n      error_callback (data, \"failed to read executable information\", -1);\n      return 0;\n    }\n\n  if (!state->threaded)\n    fileline_fn = state->fileline_fn;\n  else\n    fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n  if (fileline_fn != NULL)\n    return 1;\n\n  /* We have not initialized the information.  Do it now.  */\n\n  descriptor = -1;\n  called_error_callback = 0;\n  for (pass = 0; pass < 10; ++pass)\n    {\n      int does_not_exist;\n\n      switch (pass)\n\t{\n\tcase 0:\n\t  filename = state->filename;\n\t  break;\n\tcase 1:\n\t  filename = getexecname ();\n\t  break;\n\tcase 2:\n\t  /* Test this before /proc/self/exe, as the latter exists but points\n\t     to the wine binary (and thus doesn't work).  */\n\t  filename = windows_executable_filename ();\n\t  break;\n\tcase 3:\n\t  filename = \"/proc/self/exe\";\n\t  break;\n\tcase 4:\n\t  filename = \"/proc/curproc/file\";\n\t  break;\n\tcase 5:\n\t  snprintf (buf, sizeof (buf), \"/proc/%ld/object/a.out\",\n\t\t    (long) getpid ());\n\t  filename = buf;\n\t  break;\n\tcase 6:\n\t  filename = sysctl_exec_name1 (state, error_callback, data);\n\t  break;\n\tcase 7:\n\t  filename = sysctl_exec_name2 (state, error_callback, data);\n\t  break;\n\tcase 8:\n\t  filename = macho_get_executable_path (state, error_callback, data);\n\t  break;\n\tcase 9:\n\t  filename = windows_get_executable_path (buf, error_callback, data);\n\t  break;\n\tdefault:\n\t  abort ();\n\t}\n\n      if (filename == NULL)\n\tcontinue;\n\n      descriptor = backtrace_open (filename, error_callback, data,\n\t\t\t\t   &does_not_exist);\n      if (descriptor < 0 && !does_not_exist)\n\t{\n\t  called_error_callback = 1;\n\t  break;\n\t}\n      if (descriptor >= 0)\n\tbreak;\n    }\n\n  if (descriptor < 0)\n    {\n      if (!called_error_callback)\n\t{\n\t  if (state->filename != NULL)\n\t    error_callback (data, state->filename, ENOENT);\n\t  else\n\t    error_callback (data,\n\t\t\t    \"libbacktrace could not find executable to open\",\n\t\t\t    0);\n\t}\n      failed = 1;\n    }\n\n  if (!failed)\n    {\n      if (!backtrace_initialize (state, filename, descriptor, error_callback,\n\t\t\t\t data, &fileline_fn))\n\tfailed = 1;\n    }\n\n  if (failed)\n    {\n      if (!state->threaded)\n\tstate->fileline_initialization_failed = 1;\n      else\n\tbacktrace_atomic_store_int (&state->fileline_initialization_failed, 1);\n      return 0;\n    }\n\n  if (!state->threaded)\n    state->fileline_fn = fileline_fn;\n  else\n    {\n      backtrace_atomic_store_pointer (&state->fileline_fn, fileline_fn);\n\n      /* Note that if two threads initialize at once, one of the data\n\t sets may be leaked.  */\n    }\n\n  return 1;\n}\n\n/* Given a PC, find the file name, line number, and function name.  */\n\nint\nbacktrace_pcinfo (struct backtrace_state *state, uintptr_t pc,\n\t\t  backtrace_full_callback callback,\n\t\t  backtrace_error_callback error_callback, void *data)\n{\n  if (!fileline_initialize (state, error_callback, data))\n    return 0;\n\n  if (state->fileline_initialization_failed)\n    return 0;\n\n  return state->fileline_fn (state, pc, callback, error_callback, data);\n}\n\n/* Given a PC, find the symbol for it, and its value.  */\n\nint\nbacktrace_syminfo (struct backtrace_state *state, uintptr_t pc,\n\t\t   backtrace_syminfo_callback callback,\n\t\t   backtrace_error_callback error_callback, void *data)\n{\n  if (!fileline_initialize (state, error_callback, data))\n    return 0;\n\n  if (state->fileline_initialization_failed)\n    return 0;\n\n  state->syminfo_fn (state, pc, callback, error_callback, data);\n  return 1;\n}\n\n/* A backtrace_syminfo_callback that can call into a\n   backtrace_full_callback, used when we have a symbol table but no\n   debug info.  */\n\nvoid\nbacktrace_syminfo_to_full_callback (void *data, uintptr_t pc,\n\t\t\t\t    const char *symname,\n\t\t\t\t    uintptr_t symval ATTRIBUTE_UNUSED,\n\t\t\t\t    uintptr_t symsize ATTRIBUTE_UNUSED)\n{\n  struct backtrace_call_full *bdata = (struct backtrace_call_full *) data;\n\n  bdata->ret = bdata->full_callback (bdata->full_data, pc, NULL, 0, symname);\n}\n\n/* An error callback that corresponds to\n   backtrace_syminfo_to_full_callback.  */\n\nvoid\nbacktrace_syminfo_to_full_error_callback (void *data, const char *msg,\n\t\t\t\t\t  int errnum)\n{\n  struct backtrace_call_full *bdata = (struct backtrace_call_full *) data;\n\n  bdata->full_error_callback (bdata->full_data, msg, errnum);\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/filenames.h",
    "content": "/* btest.c -- Filename header for libbacktrace library\n   Copyright (C) 2012-2018 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#ifndef GCC_VERSION\n# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)\n#endif\n\n#if (GCC_VERSION < 2007)\n# define __attribute__(x)\n#endif\n\n#ifndef ATTRIBUTE_UNUSED\n# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))\n#endif\n\n#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)\n# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\\\')\n# define HAS_DRIVE_SPEC(f) ((f)[0] != '\\0' && (f)[1] == ':')\n# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || HAS_DRIVE_SPEC(f))\n#else\n# define IS_DIR_SEPARATOR(c) ((c) == '/')\n# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]))\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/internal.h",
    "content": "/* internal.h -- Internal header file for stack backtrace library.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#ifndef BACKTRACE_INTERNAL_H\n#define BACKTRACE_INTERNAL_H\n\n/* We assume that <sys/types.h> and \"backtrace.h\" have already been\n   included.  */\n\n#ifndef GCC_VERSION\n# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)\n#endif\n\n#if (GCC_VERSION < 2007)\n# define __attribute__(x)\n#endif\n\n#ifndef ATTRIBUTE_UNUSED\n# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))\n#endif\n\n#ifndef ATTRIBUTE_MALLOC\n# if (GCC_VERSION >= 2096)\n#  define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))\n# else\n#  define ATTRIBUTE_MALLOC\n# endif\n#endif\n\n#ifndef ATTRIBUTE_FALLTHROUGH\n# if (GCC_VERSION >= 7000)\n#  define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))\n# else\n#  define ATTRIBUTE_FALLTHROUGH\n# endif\n#endif\n\n#ifndef HAVE_SYNC_FUNCTIONS\n\n/* Define out the sync functions.  These should never be called if\n   they are not available.  */\n\n#define __sync_bool_compare_and_swap(A, B, C) (abort(), 1)\n#define __sync_lock_test_and_set(A, B) (abort(), 0)\n#define __sync_lock_release(A) abort()\n\n#endif /* !defined (HAVE_SYNC_FUNCTIONS) */\n\n#ifdef HAVE_ATOMIC_FUNCTIONS\n\n/* We have the atomic builtin functions.  */\n\n#define backtrace_atomic_load_pointer(p) \\\n    __atomic_load_n ((p), __ATOMIC_ACQUIRE)\n#define backtrace_atomic_load_int(p) \\\n    __atomic_load_n ((p), __ATOMIC_ACQUIRE)\n#define backtrace_atomic_store_pointer(p, v) \\\n    __atomic_store_n ((p), (v), __ATOMIC_RELEASE)\n#define backtrace_atomic_store_size_t(p, v) \\\n    __atomic_store_n ((p), (v), __ATOMIC_RELEASE)\n#define backtrace_atomic_store_int(p, v) \\\n    __atomic_store_n ((p), (v), __ATOMIC_RELEASE)\n\n#else /* !defined (HAVE_ATOMIC_FUNCTIONS) */\n#ifdef HAVE_SYNC_FUNCTIONS\n\n/* We have the sync functions but not the atomic functions.  Define\n   the atomic ones in terms of the sync ones.  */\n\nextern void *backtrace_atomic_load_pointer (void *);\nextern int backtrace_atomic_load_int (int *);\nextern void backtrace_atomic_store_pointer (void *, void *);\nextern void backtrace_atomic_store_size_t (size_t *, size_t);\nextern void backtrace_atomic_store_int (int *, int);\n\n#else /* !defined (HAVE_SYNC_FUNCTIONS) */\n\n/* We have neither the sync nor the atomic functions.  These will\n   never be called.  */\n\n#define backtrace_atomic_load_pointer(p) (abort(), (void *) NULL)\n#define backtrace_atomic_load_int(p) (abort(), 0)\n#define backtrace_atomic_store_pointer(p, v) abort()\n#define backtrace_atomic_store_size_t(p, v) abort()\n#define backtrace_atomic_store_int(p, v) abort()\n\n#endif /* !defined (HAVE_SYNC_FUNCTIONS) */\n#endif /* !defined (HAVE_ATOMIC_FUNCTIONS) */\n\n/* The type of the function that collects file/line information.  This\n   is like backtrace_pcinfo.  */\n\ntypedef int (*fileline) (struct backtrace_state *state, uintptr_t pc,\n\t\t\t backtrace_full_callback callback,\n\t\t\t backtrace_error_callback error_callback, void *data);\n\n/* The type of the function that collects symbol information.  This is\n   like backtrace_syminfo.  */\n\ntypedef void (*syminfo) (struct backtrace_state *state, uintptr_t pc,\n\t\t\t backtrace_syminfo_callback callback,\n\t\t\t backtrace_error_callback error_callback, void *data);\n\n/* What the backtrace state pointer points to.  */\n\nstruct backtrace_state\n{\n  /* The name of the executable.  */\n  const char *filename;\n  /* Non-zero if threaded.  */\n  int threaded;\n  /* The master lock for fileline_fn, fileline_data, syminfo_fn,\n     syminfo_data, fileline_initialization_failed and everything the\n     data pointers point to.  */\n  void *lock;\n  /* The function that returns file/line information.  */\n  fileline fileline_fn;\n  /* The data to pass to FILELINE_FN.  */\n  void *fileline_data;\n  /* The function that returns symbol information.  */\n  syminfo syminfo_fn;\n  /* The data to pass to SYMINFO_FN.  */\n  void *syminfo_data;\n  /* Whether initializing the file/line information failed.  */\n  int fileline_initialization_failed;\n  /* The lock for the freelist.  */\n  int lock_alloc;\n  /* The freelist when using mmap.  */\n  struct backtrace_freelist_struct *freelist;\n};\n\n/* Open a file for reading.  Returns -1 on error.  If DOES_NOT_EXIST\n   is not NULL, *DOES_NOT_EXIST will be set to 0 normally and set to 1\n   if the file does not exist.  If the file does not exist and\n   DOES_NOT_EXIST is not NULL, the function will return -1 and will\n   not call ERROR_CALLBACK.  On other errors, or if DOES_NOT_EXIST is\n   NULL, the function will call ERROR_CALLBACK before returning.  */\nextern int backtrace_open (const char *filename,\n\t\t\t   backtrace_error_callback error_callback,\n\t\t\t   void *data,\n\t\t\t   int *does_not_exist);\n\n/* A view of the contents of a file.  This supports mmap when\n   available.  A view will remain in memory even after backtrace_close\n   is called on the file descriptor from which the view was\n   obtained.  */\n\nstruct backtrace_view\n{\n  /* The data that the caller requested.  */\n  const void *data;\n  /* The base of the view.  */\n  void *base;\n  /* The total length of the view.  */\n  size_t len;\n};\n\n/* Create a view of SIZE bytes from DESCRIPTOR at OFFSET.  Store the\n   result in *VIEW.  Returns 1 on success, 0 on error.  */\nextern int backtrace_get_view (struct backtrace_state *state, int descriptor,\n\t\t\t       off_t offset, uint64_t size,\n\t\t\t       backtrace_error_callback error_callback,\n\t\t\t       void *data, struct backtrace_view *view);\n\n/* Release a view created by backtrace_get_view.  */\nextern void backtrace_release_view (struct backtrace_state *state,\n\t\t\t\t    struct backtrace_view *view,\n\t\t\t\t    backtrace_error_callback error_callback,\n\t\t\t\t    void *data);\n\n/* Close a file opened by backtrace_open.  Returns 1 on success, 0 on\n   error.  */\n\nextern int backtrace_close (int descriptor,\n\t\t\t    backtrace_error_callback error_callback,\n\t\t\t    void *data);\n\n/* Sort without using memory.  */\n\nextern void backtrace_qsort (void *base, size_t count, size_t size,\n\t\t\t     int (*compar) (const void *, const void *));\n\n/* Allocate memory.  This is like malloc.  If ERROR_CALLBACK is NULL,\n   this does not report an error, it just returns NULL.  */\n\nextern void *backtrace_alloc (struct backtrace_state *state, size_t size,\n\t\t\t      backtrace_error_callback error_callback,\n\t\t\t      void *data) ATTRIBUTE_MALLOC;\n\n/* Free memory allocated by backtrace_alloc.  If ERROR_CALLBACK is\n   NULL, this does not report an error.  */\n\nextern void backtrace_free (struct backtrace_state *state, void *mem,\n\t\t\t    size_t size,\n\t\t\t    backtrace_error_callback error_callback,\n\t\t\t    void *data);\n\n/* A growable vector of some struct.  This is used for more efficient\n   allocation when we don't know the final size of some group of data\n   that we want to represent as an array.  */\n\nstruct backtrace_vector\n{\n  /* The base of the vector.  */\n  void *base;\n  /* The number of bytes in the vector.  */\n  size_t size;\n  /* The number of bytes available at the current allocation.  */\n  size_t alc;\n};\n\n/* Grow VEC by SIZE bytes.  Return a pointer to the newly allocated\n   bytes.  Note that this may move the entire vector to a new memory\n   location.  Returns NULL on failure.  */\n\nextern void *backtrace_vector_grow (struct backtrace_state *state, size_t size,\n\t\t\t\t    backtrace_error_callback error_callback,\n\t\t\t\t    void *data,\n\t\t\t\t    struct backtrace_vector *vec);\n\n/* Finish the current allocation on VEC.  Prepare to start a new\n   allocation.  The finished allocation will never be freed.  Returns\n   a pointer to the base of the finished entries, or NULL on\n   failure.  */\n\nextern void* backtrace_vector_finish (struct backtrace_state *state,\n\t\t\t\t      struct backtrace_vector *vec,\n\t\t\t\t      backtrace_error_callback error_callback,\n\t\t\t\t      void *data);\n\n/* Release any extra space allocated for VEC.  This may change\n   VEC->base.  Returns 1 on success, 0 on failure.  */\n\nextern int backtrace_vector_release (struct backtrace_state *state,\n\t\t\t\t     struct backtrace_vector *vec,\n\t\t\t\t     backtrace_error_callback error_callback,\n\t\t\t\t     void *data);\n\n/* Free the space managed by VEC.  This will reset VEC.  */\n\nstatic inline void\nbacktrace_vector_free (struct backtrace_state *state,\n\t\t       struct backtrace_vector *vec,\n\t\t       backtrace_error_callback error_callback, void *data)\n{\n  vec->alc += vec->size;\n  vec->size = 0;\n  backtrace_vector_release (state, vec, error_callback, data);\n}\n\n/* Read initial debug data from a descriptor, and set the\n   fileline_data, syminfo_fn, and syminfo_data fields of STATE.\n   Return the fileln_fn field in *FILELN_FN--this is done this way so\n   that the synchronization code is only implemented once.  This is\n   called after the descriptor has first been opened.  It will close\n   the descriptor if it is no longer needed.  Returns 1 on success, 0\n   on error.  There will be multiple implementations of this function,\n   for different file formats.  Each system will compile the\n   appropriate one.  */\n\nextern int backtrace_initialize (struct backtrace_state *state,\n\t\t\t\t const char *filename,\n\t\t\t\t int descriptor,\n\t\t\t\t backtrace_error_callback error_callback,\n\t\t\t\t void *data,\n\t\t\t\t fileline *fileline_fn);\n\n/* An enum for the DWARF sections we care about.  */\n\nenum dwarf_section\n{\n  DEBUG_INFO,\n  DEBUG_LINE,\n  DEBUG_ABBREV,\n  DEBUG_RANGES,\n  DEBUG_STR,\n  DEBUG_ADDR,\n  DEBUG_STR_OFFSETS,\n  DEBUG_LINE_STR,\n  DEBUG_RNGLISTS,\n\n  DEBUG_MAX\n};\n\n/* Data for the DWARF sections we care about.  */\n\nstruct dwarf_sections\n{\n  const unsigned char *data[DEBUG_MAX];\n  size_t size[DEBUG_MAX];\n};\n\n/* DWARF data read from a file, used for .gnu_debugaltlink.  */\n\nstruct dwarf_data;\n\n/* Add file/line information for a DWARF module.  */\n\nextern int backtrace_dwarf_add (struct backtrace_state *state,\n\t\t\t\tuintptr_t base_address,\n\t\t\t\tconst struct dwarf_sections *dwarf_sections,\n\t\t\t\tint is_bigendian,\n\t\t\t\tstruct dwarf_data *fileline_altlink,\n\t\t\t\tbacktrace_error_callback error_callback,\n\t\t\t\tvoid *data, fileline *fileline_fn,\n\t\t\t\tstruct dwarf_data **fileline_entry);\n\n/* A data structure to pass to backtrace_syminfo_to_full.  */\n\nstruct backtrace_call_full\n{\n  backtrace_full_callback full_callback;\n  backtrace_error_callback full_error_callback;\n  void *full_data;\n  int ret;\n};\n\n/* A backtrace_syminfo_callback that can call into a\n   backtrace_full_callback, used when we have a symbol table but no\n   debug info.  */\n\nextern void backtrace_syminfo_to_full_callback (void *data, uintptr_t pc,\n\t\t\t\t\t\tconst char *symname,\n\t\t\t\t\t\tuintptr_t symval,\n\t\t\t\t\t\tuintptr_t symsize);\n\n/* An error callback that corresponds to\n   backtrace_syminfo_to_full_callback.  */\n\nextern void backtrace_syminfo_to_full_error_callback (void *, const char *,\n\t\t\t\t\t\t      int);\n\n/* A test-only hook for elf_uncompress_zdebug.  */\n\nextern int backtrace_uncompress_zdebug (struct backtrace_state *,\n\t\t\t\t\tconst unsigned char *compressed,\n\t\t\t\t\tsize_t compressed_size,\n\t\t\t\t\tbacktrace_error_callback, void *data,\n\t\t\t\t\tunsigned char **uncompressed,\n\t\t\t\t\tsize_t *uncompressed_size);\n\n/* A test-only hook for elf_zstd_decompress.  */\n\nextern int backtrace_uncompress_zstd (struct backtrace_state *,\n\t\t\t\t      const unsigned char *compressed,\n\t\t\t\t      size_t compressed_size,\n\t\t\t\t      backtrace_error_callback, void *data,\n\t\t\t\t      unsigned char *uncompressed,\n\t\t\t\t      size_t uncompressed_size);\n\n/* A test-only hook for elf_uncompress_lzma.  */\n\nextern int backtrace_uncompress_lzma (struct backtrace_state *,\n\t\t\t\t      const unsigned char *compressed,\n\t\t\t\t      size_t compressed_size,\n\t\t\t\t      backtrace_error_callback, void *data,\n\t\t\t\t      unsigned char **uncompressed,\n\t\t\t\t      size_t *uncompressed_size);\n\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/macho.c",
    "content": "/* elf.c -- Get debug data from a Mach-O file for backtraces.\n   Copyright (C) 2020-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <sys/types.h>\n#include <dirent.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef HAVE_MACH_O_DYLD_H\n#include <mach-o/dyld.h>\n#endif\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* Mach-O file header for a 32-bit executable.  */\n\nstruct macho_header_32\n{\n  uint32_t magic;\t/* Magic number (MACH_O_MAGIC_32) */\n  uint32_t cputype;\t/* CPU type */\n  uint32_t cpusubtype;\t/* CPU subtype */\n  uint32_t filetype;\t/* Type of file (object, executable) */\n  uint32_t ncmds;\t/* Number of load commands */\n  uint32_t sizeofcmds;\t/* Total size of load commands */\n  uint32_t flags;\t/* Flags for special features */\n};\n\n/* Mach-O file header for a 64-bit executable.  */\n\nstruct macho_header_64\n{\n  uint32_t magic;\t/* Magic number (MACH_O_MAGIC_64) */\n  uint32_t cputype;\t/* CPU type */\n  uint32_t cpusubtype;\t/* CPU subtype */\n  uint32_t filetype;\t/* Type of file (object, executable) */\n  uint32_t ncmds;\t/* Number of load commands */\n  uint32_t sizeofcmds;\t/* Total size of load commands */\n  uint32_t flags;\t/* Flags for special features */\n  uint32_t reserved;\t/* Reserved */\n};\n\n/* Mach-O file header for a fat executable.  */\n\nstruct macho_header_fat\n{\n  uint32_t magic;\t/* Magic number (MACH_O_MH_(MAGIC|CIGAM)_FAT(_64)?) */\n  uint32_t nfat_arch;   /* Number of components */\n};\n\n/* Values for the header magic field.  */\n\n#define MACH_O_MH_MAGIC_32\t0xfeedface\n#define MACH_O_MH_MAGIC_64\t0xfeedfacf\n#define MACH_O_MH_MAGIC_FAT\t0xcafebabe\n#define MACH_O_MH_CIGAM_FAT\t0xbebafeca\n#define MACH_O_MH_MAGIC_FAT_64\t0xcafebabf\n#define MACH_O_MH_CIGAM_FAT_64\t0xbfbafeca\n\n/* Value for the header filetype field.  */\n\n#define MACH_O_MH_EXECUTE\t0x02\n#define MACH_O_MH_DYLIB\t\t0x06\n#define MACH_O_MH_DSYM\t\t0x0a\n\n/* A component of a fat file.  A fat file starts with a\n   macho_header_fat followed by nfat_arch instances of this\n   struct.  */\n\nstruct macho_fat_arch\n{\n  uint32_t cputype;\t/* CPU type */\n  uint32_t cpusubtype;\t/* CPU subtype */\n  uint32_t offset;\t/* File offset of this entry */\n  uint32_t size;\t/* Size of this entry */\n  uint32_t align;\t/* Alignment of this entry */\n};\n\n/* A component of a 64-bit fat file.  This is used if the magic field\n   is MAGIC_FAT_64.  This is only used when some file size or file\n   offset is too large to represent in the 32-bit format.  */\n\nstruct macho_fat_arch_64\n{\n  uint32_t cputype;\t/* CPU type */\n  uint32_t cpusubtype;\t/* CPU subtype */\n  uint64_t offset;\t/* File offset of this entry */\n  uint64_t size;\t/* Size of this entry */\n  uint32_t align;\t/* Alignment of this entry */\n  uint32_t reserved;\t/* Reserved */\n};\n\n/* Values for the fat_arch cputype field (and the header cputype\n   field).  */\n\n#define MACH_O_CPU_ARCH_ABI64 0x01000000\n\n#define MACH_O_CPU_TYPE_X86 7\n#define MACH_O_CPU_TYPE_ARM 12\n#define MACH_O_CPU_TYPE_PPC 18\n\n#define MACH_O_CPU_TYPE_X86_64 (MACH_O_CPU_TYPE_X86 | MACH_O_CPU_ARCH_ABI64)\n#define MACH_O_CPU_TYPE_ARM64  (MACH_O_CPU_TYPE_ARM | MACH_O_CPU_ARCH_ABI64)\n#define MACH_O_CPU_TYPE_PPC64  (MACH_O_CPU_TYPE_PPC | MACH_O_CPU_ARCH_ABI64)\n\n/* The header of a load command.  */\n\nstruct macho_load_command\n{\n  uint32_t cmd;\t\t/* The type of load command */\n  uint32_t cmdsize;\t/* Size in bytes of the entire command */\n};\n\n/* Values for the load_command cmd field.  */\n\n#define MACH_O_LC_SEGMENT\t0x01\n#define MACH_O_LC_SYMTAB\t0x02\n#define MACH_O_LC_SEGMENT_64\t0x19\n#define MACH_O_LC_UUID\t\t0x1b\n\n/* The length of a section of segment name.  */\n\n#define MACH_O_NAMELEN (16)\n\n/* LC_SEGMENT load command.  */\n\nstruct macho_segment_command\n{\n  uint32_t cmd;\t\t\t/* The type of load command (LC_SEGMENT) */\n  uint32_t cmdsize;\t\t/* Size in bytes of the entire command */\n  char segname[MACH_O_NAMELEN];\t/* Segment name */\n  uint32_t vmaddr;\t\t/* Virtual memory address */\n  uint32_t vmsize;\t\t/* Virtual memory size */\n  uint32_t fileoff;\t\t/* Offset of data to be mapped */\n  uint32_t filesize;\t\t/* Size of data in file */\n  uint32_t maxprot;\t\t/* Maximum permitted virtual protection */\n  uint32_t initprot;\t\t/* Initial virtual memory protection */\n  uint32_t nsects;\t\t/* Number of sections in this segment */\n  uint32_t flags;\t\t/* Flags */\n};\n\n/* LC_SEGMENT_64 load command.  */\n\nstruct macho_segment_64_command\n{\n  uint32_t cmd;\t\t\t/* The type of load command (LC_SEGMENT) */\n  uint32_t cmdsize;\t\t/* Size in bytes of the entire command */\n  char segname[MACH_O_NAMELEN];\t/* Segment name */\n  uint64_t vmaddr;\t\t/* Virtual memory address */\n  uint64_t vmsize;\t\t/* Virtual memory size */\n  uint64_t fileoff;\t\t/* Offset of data to be mapped */\n  uint64_t filesize;\t\t/* Size of data in file */\n  uint32_t maxprot;\t\t/* Maximum permitted virtual protection */\n  uint32_t initprot;\t\t/* Initial virtual memory protection */\n  uint32_t nsects;\t\t/* Number of sections in this segment */\n  uint32_t flags;\t\t/* Flags */\n};\n\n/* LC_SYMTAB load command.  */\n\nstruct macho_symtab_command\n{\n  uint32_t cmd;\t\t/* The type of load command (LC_SEGMENT) */\n  uint32_t cmdsize;\t/* Size in bytes of the entire command */\n  uint32_t symoff;\t/* File offset of symbol table */\n  uint32_t nsyms;\t/* Number of symbols */\n  uint32_t stroff;\t/* File offset of string table */\n  uint32_t strsize;\t/* String table size */\n};\n\n/* The length of a Mach-O uuid.  */\n\n#define MACH_O_UUID_LEN (16)\n\n/* LC_UUID load command.  */\n\nstruct macho_uuid_command\n{\n  uint32_t cmd;\t\t\t\t/* Type of load command (LC_UUID) */\n  uint32_t cmdsize;\t\t\t/* Size in bytes of command */\n  unsigned char uuid[MACH_O_UUID_LEN];\t/* UUID */\n};\n\n/* 32-bit section header within a LC_SEGMENT segment.  */\n\nstruct macho_section\n{\n  char sectname[MACH_O_NAMELEN];\t/* Section name */\n  char segment[MACH_O_NAMELEN];\t\t/* Segment of this section */\n  uint32_t addr;\t\t\t/* Address in memory */\n  uint32_t size;\t\t\t/* Section size */\n  uint32_t offset;\t\t\t/* File offset */\n  uint32_t align;\t\t\t/* Log2 of section alignment */\n  uint32_t reloff;\t\t\t/* File offset of relocations */\n  uint32_t nreloc;\t\t\t/* Number of relocs for this section */\n  uint32_t flags;\t\t\t/* Flags */\n  uint32_t reserved1;\n  uint32_t reserved2;\n};\n\n/* 64-bit section header within a LC_SEGMENT_64 segment.   */\n\nstruct macho_section_64\n{\n  char sectname[MACH_O_NAMELEN];\t/* Section name */\n  char segment[MACH_O_NAMELEN];\t\t/* Segment of this section */\n  uint64_t addr;\t\t\t/* Address in memory */\n  uint64_t size;\t\t\t/* Section size */\n  uint32_t offset;\t\t\t/* File offset */\n  uint32_t align;\t\t\t/* Log2 of section alignment */\n  uint32_t reloff;\t\t\t/* File offset of section relocations */\n  uint32_t nreloc;\t\t\t/* Number of relocs for this section */\n  uint32_t flags;\t\t\t/* Flags */\n  uint32_t reserved1;\n  uint32_t reserved2;\n  uint32_t reserved3;\n};\n\n/* 32-bit symbol data.  */\n\nstruct macho_nlist\n{\n  uint32_t n_strx;\t/* Index of name in string table */\n  uint8_t n_type;\t/* Type flag */\n  uint8_t n_sect;\t/* Section number */\n  uint16_t n_desc;\t/* Stabs description field */\n  uint32_t n_value;\t/* Value */\n};\n\n/* 64-bit symbol data.  */\n\nstruct macho_nlist_64\n{\n  uint32_t n_strx;\t/* Index of name in string table */\n  uint8_t n_type;\t/* Type flag */\n  uint8_t n_sect;\t/* Section number */\n  uint16_t n_desc;\t/* Stabs description field */\n  uint64_t n_value;\t/* Value */\n};\n\n/* Value found in nlist n_type field.  */\n\n#define MACH_O_N_EXT\t0x01\t/* Extern symbol */\n#define MACH_O_N_ABS\t0x02\t/* Absolute symbol */\n#define MACH_O_N_SECT\t0x0e\t/* Defined in section */\n\n#define MACH_O_N_TYPE\t0x0e\t/* Mask for type bits */\n#define MACH_O_N_STAB\t0xe0\t/* Stabs debugging symbol */\n\n/* Information we keep for a Mach-O symbol.  */\n\nstruct macho_symbol\n{\n  const char *name;\t/* Symbol name */\n  uintptr_t address;\t/* Symbol address */\n};\n\n/* Information to pass to macho_syminfo.  */\n\nstruct macho_syminfo_data\n{\n  struct macho_syminfo_data *next;\t/* Next module */\n  struct macho_symbol *symbols;\t\t/* Symbols sorted by address */\n  size_t count;\t\t\t\t/* Number of symbols */\n};\n\n/* Names of sections, indexed by enum dwarf_section in internal.h.  */\n\nstatic const char * const dwarf_section_names[DEBUG_MAX] =\n{\n  \"__debug_info\",\n  \"__debug_line\",\n  \"__debug_abbrev\",\n  \"__debug_ranges\",\n  \"__debug_str\",\n  \"\", /* DEBUG_ADDR */\n  \"__debug_str_offs\",\n  \"\", /* DEBUG_LINE_STR */\n  \"__debug_rnglists\"\n};\n\n/* Forward declaration.  */\n\nstatic int macho_add (struct backtrace_state *, const char *, int, off_t,\n\t\t      const unsigned char *, uintptr_t, int,\n\t\t      backtrace_error_callback, void *, fileline *, int *);\n\n/* A dummy callback function used when we can't find any debug info.  */\n\nstatic int\nmacho_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t       uintptr_t pc ATTRIBUTE_UNUSED,\n\t       backtrace_full_callback callback ATTRIBUTE_UNUSED,\n\t       backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no debug info in Mach-O executable\", -1);\n  return 0;\n}\n\n/* A dummy callback function used when we can't find a symbol\n   table.  */\n\nstatic void\nmacho_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t      uintptr_t addr ATTRIBUTE_UNUSED,\n\t      backtrace_syminfo_callback callback ATTRIBUTE_UNUSED,\n\t      backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no symbol table in Mach-O executable\", -1);\n}\n\n/* Add a single DWARF section to DWARF_SECTIONS, if we need the\n   section.  Returns 1 on success, 0 on failure.  */\n\nstatic int\nmacho_add_dwarf_section (struct backtrace_state *state, int descriptor,\n\t\t\t const char *sectname, uint32_t offset, uint64_t size,\n\t\t\t backtrace_error_callback error_callback, void *data,\n\t\t\t struct dwarf_sections *dwarf_sections)\n{\n  int i;\n\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      if (dwarf_section_names[i][0] != '\\0'\n\t  && strncmp (sectname, dwarf_section_names[i], MACH_O_NAMELEN) == 0)\n\t{\n\t  struct backtrace_view section_view;\n\n\t  /* FIXME: Perhaps it would be better to try to use a single\n\t     view to read all the DWARF data, as we try to do for\n\t     ELF.  */\n\n\t  if (!backtrace_get_view (state, descriptor, offset, size,\n\t\t\t\t   error_callback, data, &section_view))\n\t    return 0;\n\t  dwarf_sections->data[i] = (const unsigned char *) section_view.data;\n\t  dwarf_sections->size[i] = size;\n\t  break;\n\t}\n    }\n  return 1;\n}\n\n/* Collect DWARF sections from a DWARF segment.  Returns 1 on success,\n   0 on failure.  */\n\nstatic int\nmacho_add_dwarf_segment (struct backtrace_state *state, int descriptor,\n\t\t\t off_t offset, unsigned int cmd, const char *psecs,\n\t\t\t size_t sizesecs, unsigned int nsects,\n\t\t\t backtrace_error_callback error_callback, void *data,\n\t\t\t struct dwarf_sections *dwarf_sections)\n{\n  size_t sec_header_size;\n  size_t secoffset;\n  unsigned int i;\n\n  switch (cmd)\n    {\n    case MACH_O_LC_SEGMENT:\n      sec_header_size = sizeof (struct macho_section);\n      break;\n    case MACH_O_LC_SEGMENT_64:\n      sec_header_size = sizeof (struct macho_section_64);\n      break;\n    default:\n      abort ();\n    }\n\n  secoffset = 0;\n  for (i = 0; i < nsects; ++i)\n    {\n      if (secoffset + sec_header_size > sizesecs)\n\t{\n\t  error_callback (data, \"section overflow withing segment\", 0);\n\t  return 0;\n\t}\n\n      switch (cmd)\n\t{\n\tcase MACH_O_LC_SEGMENT:\n\t  {\n\t    struct macho_section section;\n\n\t    memcpy (&section, psecs + secoffset, sizeof section);\n\t    macho_add_dwarf_section (state, descriptor, section.sectname,\n\t\t\t\t     offset + section.offset, section.size,\n\t\t\t\t     error_callback, data, dwarf_sections);\n\t  }\n\t  break;\n\n\tcase MACH_O_LC_SEGMENT_64:\n\t  {\n\t    struct macho_section_64 section;\n\n\t    memcpy (&section, psecs + secoffset, sizeof section);\n\t    macho_add_dwarf_section (state, descriptor, section.sectname,\n\t\t\t\t     offset + section.offset, section.size,\n\t\t\t\t     error_callback, data, dwarf_sections);\n\t  }\n\t  break;\n\n\tdefault:\n\t  abort ();\n\t}\n\n      secoffset += sec_header_size;\n    }\n\n  return 1;\n}\n\n/* Compare struct macho_symbol for qsort.  */\n\nstatic int\nmacho_symbol_compare (const void *v1, const void *v2)\n{\n  const struct macho_symbol *m1 = (const struct macho_symbol *) v1;\n  const struct macho_symbol *m2 = (const struct macho_symbol *) v2;\n\n  if (m1->address < m2->address)\n    return -1;\n  else if (m1->address > m2->address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Compare an address against a macho_symbol for bsearch.  We allocate\n   one extra entry in the array so that this can safely look at the\n   next entry.  */\n\nstatic int\nmacho_symbol_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct macho_symbol *entry = (const struct macho_symbol *) ventry;\n  uintptr_t addr;\n\n  addr = *key;\n  if (addr < entry->address)\n    return -1;\n  else if (entry->name[0] == '\\0'\n\t   && entry->address == ~(uintptr_t) 0)\n    return -1;\n  else if ((entry + 1)->name[0] == '\\0'\n\t   && (entry + 1)->address == ~(uintptr_t) 0)\n    return -1;\n  else if (addr >= (entry + 1)->address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Return whether the symbol type field indicates a symbol table entry\n   that we care about: a function or data symbol.  */\n\nstatic int\nmacho_defined_symbol (uint8_t type)\n{\n  if ((type & MACH_O_N_STAB) != 0)\n    return 0;\n  if ((type & MACH_O_N_EXT) != 0)\n    return 0;\n  switch (type & MACH_O_N_TYPE)\n    {\n    case MACH_O_N_ABS:\n      return 1;\n    case MACH_O_N_SECT:\n      return 1;\n    default:\n      return 0;\n    }\n}\n\n/* Add symbol table information for a Mach-O file.  */\n\nstatic int\nmacho_add_symtab (struct backtrace_state *state, int descriptor,\n\t\t  uintptr_t base_address, int is_64,\n\t\t  off_t symoff, unsigned int nsyms, off_t stroff,\n\t\t  unsigned int strsize,\n\t\t  backtrace_error_callback error_callback, void *data)\n{\n  size_t symsize;\n  struct backtrace_view sym_view;\n  int sym_view_valid;\n  struct backtrace_view str_view;\n  int str_view_valid;\n  size_t ndefs;\n  size_t symtaboff;\n  unsigned int i;\n  size_t macho_symbol_size;\n  struct macho_symbol *macho_symbols;\n  unsigned int j;\n  struct macho_syminfo_data *sdata;\n\n  sym_view_valid = 0;\n  str_view_valid = 0;\n  macho_symbol_size = 0;\n  macho_symbols = NULL;\n\n  if (is_64)\n    symsize = sizeof (struct macho_nlist_64);\n  else\n    symsize = sizeof (struct macho_nlist);\n\n  if (!backtrace_get_view (state, descriptor, symoff, nsyms * symsize,\n\t\t\t   error_callback, data, &sym_view))\n    goto fail;\n  sym_view_valid = 1;\n\n  if (!backtrace_get_view (state, descriptor, stroff, strsize,\n\t\t\t   error_callback, data, &str_view))\n    return 0;\n  str_view_valid = 1;\n\n  ndefs = 0;\n  symtaboff = 0;\n  for (i = 0; i < nsyms; ++i, symtaboff += symsize)\n    {\n      if (is_64)\n\t{\n\t  struct macho_nlist_64 nlist;\n\n\t  memcpy (&nlist, (const char *) sym_view.data + symtaboff,\n\t\t  sizeof nlist);\n\t  if (macho_defined_symbol (nlist.n_type))\n\t    ++ndefs;\n\t}\n      else\n\t{\n\t  struct macho_nlist nlist;\n\n\t  memcpy (&nlist, (const char *) sym_view.data + symtaboff,\n\t\t  sizeof nlist);\n\t  if (macho_defined_symbol (nlist.n_type))\n\t    ++ndefs;\n\t}\n    }\n\n  /* Add 1 to ndefs to make room for a sentinel.  */\n  macho_symbol_size = (ndefs + 1) * sizeof (struct macho_symbol);\n  macho_symbols = ((struct macho_symbol *)\n\t\t   backtrace_alloc (state, macho_symbol_size, error_callback,\n\t\t\t\t    data));\n  if (macho_symbols == NULL)\n    goto fail;\n\n  j = 0;\n  symtaboff = 0;\n  for (i = 0; i < nsyms; ++i, symtaboff += symsize)\n    {\n      uint32_t strx;\n      uint64_t value;\n      const char *name;\n\n      strx = 0;\n      value = 0;\n      if (is_64)\n\t{\n\t  struct macho_nlist_64 nlist;\n\n\t  memcpy (&nlist, (const char *) sym_view.data + symtaboff,\n\t\t  sizeof nlist);\n\t  if (!macho_defined_symbol (nlist.n_type))\n\t    continue;\n\n\t  strx = nlist.n_strx;\n\t  value = nlist.n_value;\n\t}\n      else\n\t{\n\t  struct macho_nlist nlist;\n\n\t  memcpy (&nlist, (const char *) sym_view.data + symtaboff,\n\t\t  sizeof nlist);\n\t  if (!macho_defined_symbol (nlist.n_type))\n\t    continue;\n\n\t  strx = nlist.n_strx;\n\t  value = nlist.n_value;\n\t}\n\n      if (strx >= strsize)\n\t{\n\t  error_callback (data, \"symbol string index out of range\", 0);\n\t  goto fail;\n\t}\n\n      name = (const char *) str_view.data + strx;\n      if (name[0] == '_')\n\t++name;\n      macho_symbols[j].name = name;\n      macho_symbols[j].address = value + base_address;\n      ++j;\n    }\n\n  sdata = ((struct macho_syminfo_data *)\n\t   backtrace_alloc (state, sizeof *sdata, error_callback, data));\n  if (sdata == NULL)\n    goto fail;\n\n  /* We need to keep the string table since it holds the names, but we\n     can release the symbol table.  */\n\n  backtrace_release_view (state, &sym_view, error_callback, data);\n  sym_view_valid = 0;\n  str_view_valid = 0;\n\n  /* Add a trailing sentinel symbol.  */\n  macho_symbols[j].name = \"\";\n  macho_symbols[j].address = ~(uintptr_t) 0;\n\n  backtrace_qsort (macho_symbols, ndefs + 1, sizeof (struct macho_symbol),\n\t\t   macho_symbol_compare);\n\n  sdata->next = NULL;\n  sdata->symbols = macho_symbols;\n  sdata->count = ndefs;\n\n  if (!state->threaded)\n    {\n      struct macho_syminfo_data **pp;\n\n      for (pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = sdata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct macho_syminfo_data **pp;\n\n\t  pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data;\n\n\t  while (1)\n\t    {\n\t      struct macho_syminfo_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\t      \n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, sdata))\n\t    break;\n\t}\n    }\n\n  return 1;\n\n fail:\n  if (macho_symbols != NULL)\n    backtrace_free (state, macho_symbols, macho_symbol_size,\n\t\t    error_callback, data);\n  if (sym_view_valid)\n    backtrace_release_view (state, &sym_view, error_callback, data);\n  if (str_view_valid)\n    backtrace_release_view (state, &str_view, error_callback, data);\n  return 0;\n}\n\n/* Return the symbol name and value for an ADDR.  */\n\nstatic void\nmacho_syminfo (struct backtrace_state *state, uintptr_t addr,\n\t       backtrace_syminfo_callback callback,\n\t       backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t       void *data)\n{\n  struct macho_syminfo_data *sdata;\n  struct macho_symbol *sym;\n\n  sym = NULL;\n  if (!state->threaded)\n    {\n      for (sdata = (struct macho_syminfo_data *) state->syminfo_data;\n\t   sdata != NULL;\n\t   sdata = sdata->next)\n\t{\n\t  sym = ((struct macho_symbol *)\n\t\t bsearch (&addr, sdata->symbols, sdata->count,\n\t\t\t  sizeof (struct macho_symbol), macho_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\t}\n    }\n  else\n    {\n      struct macho_syminfo_data **pp;\n\n      pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data;\n      while (1)\n\t{\n\t  sdata = backtrace_atomic_load_pointer (pp);\n\t  if (sdata == NULL)\n\t    break;\n\n\t  sym = ((struct macho_symbol *)\n\t\t bsearch (&addr, sdata->symbols, sdata->count,\n\t\t\t  sizeof (struct macho_symbol), macho_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\n\t  pp = &sdata->next;\n\t}\n    }\n\n  if (sym == NULL)\n    callback (data, addr, NULL, 0, 0);\n  else\n    callback (data, addr, sym->name, sym->address, 0);\n}\n\n/* Look through a fat file to find the relevant executable.  Returns 1\n   on success, 0 on failure (in both cases descriptor is closed).  */\n\nstatic int\nmacho_add_fat (struct backtrace_state *state, const char *filename,\n\t       int descriptor, int swapped, off_t offset,\n\t       const unsigned char *match_uuid, uintptr_t base_address,\n\t       int skip_symtab, uint32_t nfat_arch, int is_64,\n\t       backtrace_error_callback error_callback, void *data,\n\t       fileline *fileline_fn, int *found_sym)\n{\n  int arch_view_valid;\n  unsigned int cputype;\n  size_t arch_size;\n  struct backtrace_view arch_view;\n  unsigned int i;\n\n  arch_view_valid = 0;\n\n#if defined (__x86_64__)\n  cputype = MACH_O_CPU_TYPE_X86_64;\n#elif defined (__i386__)\n  cputype = MACH_O_CPU_TYPE_X86;\n#elif defined (__aarch64__)\n  cputype = MACH_O_CPU_TYPE_ARM64;\n#elif defined (__arm__)\n  cputype = MACH_O_CPU_TYPE_ARM;\n#elif defined (__ppc__)\n  cputype = MACH_O_CPU_TYPE_PPC;\n#elif defined (__ppc64__)\n  cputype = MACH_O_CPU_TYPE_PPC64;\n#else\n  error_callback (data, \"unknown Mach-O architecture\", 0);\n  goto fail;\n#endif\n\n  if (is_64)\n    arch_size = sizeof (struct macho_fat_arch_64);\n  else\n    arch_size = sizeof (struct macho_fat_arch);\n\n  if (!backtrace_get_view (state, descriptor, offset,\n\t\t\t   nfat_arch * arch_size,\n\t\t\t   error_callback, data, &arch_view))\n    goto fail;\n\n  for (i = 0; i < nfat_arch; ++i)\n    {\n      uint32_t fcputype;\n      uint64_t foffset;\n\n      if (is_64)\n\t{\n\t  struct macho_fat_arch_64 fat_arch_64;\n\n\t  memcpy (&fat_arch_64,\n\t\t  (const char *) arch_view.data + i * arch_size,\n\t\t  arch_size);\n\t  fcputype = fat_arch_64.cputype;\n\t  foffset = fat_arch_64.offset;\n\t  if (swapped)\n\t    {\n\t      fcputype = __builtin_bswap32 (fcputype);\n\t      foffset = __builtin_bswap64 (foffset);\n\t    }\n\t}\n      else\n\t{\n\t  struct macho_fat_arch fat_arch_32;\n\n\t  memcpy (&fat_arch_32,\n\t\t  (const char *) arch_view.data + i * arch_size,\n\t\t  arch_size);\n\t  fcputype = fat_arch_32.cputype;\n\t  foffset = (uint64_t) fat_arch_32.offset;\n\t  if (swapped)\n\t    {\n\t      fcputype = __builtin_bswap32 (fcputype);\n\t      foffset = (uint64_t) __builtin_bswap32 ((uint32_t) foffset);\n\t    }\n\t}\n\n      if (fcputype == cputype)\n\t{\n\t  /* FIXME: What about cpusubtype?  */\n\t  backtrace_release_view (state, &arch_view, error_callback, data);\n\t  return macho_add (state, filename, descriptor, foffset, match_uuid,\n\t\t\t    base_address, skip_symtab, error_callback, data,\n\t\t\t    fileline_fn, found_sym);\n\t}\n    }\n\n  error_callback (data, \"could not find executable in fat file\", 0);\n\n fail:\n  if (arch_view_valid)\n    backtrace_release_view (state, &arch_view, error_callback, data);\n  if (descriptor != -1)\n    backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n/* Look for the dsym file for FILENAME.  This is called if FILENAME\n   does not have debug info or a symbol table.  Returns 1 on success,\n   0 on failure.  */\n\nstatic int\nmacho_add_dsym (struct backtrace_state *state, const char *filename,\n\t\tuintptr_t base_address, const unsigned char *uuid,\n\t\tbacktrace_error_callback error_callback, void *data,\n\t\tfileline* fileline_fn)\n{\n  const char *p;\n  const char *dirname;\n  char *diralc;\n  size_t dirnamelen;\n  const char *basename;\n  size_t basenamelen;\n  const char *dsymsuffixdir;\n  size_t dsymsuffixdirlen;\n  size_t dsymlen;\n  char *dsym;\n  char *ps;\n  int d;\n  int does_not_exist;\n  int dummy_found_sym;\n\n  diralc = NULL;\n  dirnamelen = 0;\n  dsym = NULL;\n  dsymlen = 0;\n\n  p = strrchr (filename, '/');\n  if (p == NULL)\n    {\n      dirname = \".\";\n      dirnamelen = 1;\n      basename = filename;\n      basenamelen = strlen (basename);\n      diralc = NULL;\n    }\n  else\n    {\n      dirnamelen = p - filename;\n      diralc = backtrace_alloc (state, dirnamelen + 1, error_callback, data);\n      if (diralc == NULL)\n\tgoto fail;\n      memcpy (diralc, filename, dirnamelen);\n      diralc[dirnamelen] = '\\0';\n      dirname = diralc;\n      basename = p + 1;\n      basenamelen = strlen (basename);\n    }\n\n  dsymsuffixdir = \".dSYM/Contents/Resources/DWARF/\";\n  dsymsuffixdirlen = strlen (dsymsuffixdir);\n\n  dsymlen = (dirnamelen\n\t     + 1\n\t     + basenamelen\n\t     + dsymsuffixdirlen\n\t     + basenamelen\n\t     + 1);\n  dsym = backtrace_alloc (state, dsymlen, error_callback, data);\n  if (dsym == NULL)\n    goto fail;\n\n  ps = dsym;\n  memcpy (ps, dirname, dirnamelen);\n  ps += dirnamelen;\n  *ps++ = '/';\n  memcpy (ps, basename, basenamelen);\n  ps += basenamelen;\n  memcpy (ps, dsymsuffixdir, dsymsuffixdirlen);\n  ps += dsymsuffixdirlen;\n  memcpy (ps, basename, basenamelen);\n  ps += basenamelen;\n  *ps = '\\0';\n\n  if (diralc != NULL)\n    {\n      backtrace_free (state, diralc, dirnamelen + 1, error_callback, data);\n      diralc = NULL;\n    }\n\n  d = backtrace_open (dsym, error_callback, data, &does_not_exist);\n  if (d < 0)\n    {\n      /* The file does not exist, so we can't read the debug info.\n\t Just return success.  */\n      backtrace_free (state, dsym, dsymlen, error_callback, data);\n      return 1;\n    }\n\n  if (!macho_add (state, dsym, d, 0, uuid, base_address, 1,\n\t\t  error_callback, data, fileline_fn, &dummy_found_sym))\n    goto fail;\n\n  backtrace_free (state, dsym, dsymlen, error_callback, data);\n\n  return 1;\n\n fail:\n  if (dsym != NULL)\n    backtrace_free (state, dsym, dsymlen, error_callback, data);\n  if (diralc != NULL)\n    backtrace_free (state, diralc, dirnamelen, error_callback, data);\n  return 0;\n}\n\n/* Add the backtrace data for a Macho-O file.  Returns 1 on success, 0\n   on failure (in both cases descriptor is closed).\n\n   FILENAME: the name of the executable.\n   DESCRIPTOR: an open descriptor for the executable, closed here.\n   OFFSET: the offset within the file of this executable, for fat files.\n   MATCH_UUID: if not NULL, UUID that must match.\n   BASE_ADDRESS: the load address of the executable.\n   SKIP_SYMTAB: if non-zero, ignore the symbol table; used for dSYM files.\n   FILELINE_FN: set to the fileline function, by backtrace_dwarf_add.\n   FOUND_SYM: set to non-zero if we found the symbol table.\n*/\n\nstatic int\nmacho_add (struct backtrace_state *state, const char *filename, int descriptor,\n\t   off_t offset, const unsigned char *match_uuid,\n\t   uintptr_t base_address, int skip_symtab,\n\t   backtrace_error_callback error_callback, void *data,\n\t   fileline *fileline_fn, int *found_sym)\n{\n  struct backtrace_view header_view;\n  struct macho_header_32 header;\n  off_t hdroffset;\n  int is_64;\n  struct backtrace_view cmds_view;\n  int cmds_view_valid;\n  struct dwarf_sections dwarf_sections;\n  int have_dwarf;\n  unsigned char uuid[MACH_O_UUID_LEN];\n  int have_uuid;\n  size_t cmdoffset;\n  unsigned int i;\n\n  *found_sym = 0;\n\n  cmds_view_valid = 0;\n\n  /* The 32-bit and 64-bit file headers start out the same, so we can\n     just always read the 32-bit version.  A fat header is shorter but\n     it will always be followed by data, so it's OK to read extra.  */\n\n  if (!backtrace_get_view (state, descriptor, offset,\n\t\t\t   sizeof (struct macho_header_32),\n\t\t\t   error_callback, data, &header_view))\n    goto fail;\n\n  memcpy (&header, header_view.data, sizeof header);\n\n  backtrace_release_view (state, &header_view, error_callback, data);\n\n  switch (header.magic)\n    {\n    case MACH_O_MH_MAGIC_32:\n      is_64 = 0;\n      hdroffset = offset + sizeof (struct macho_header_32);\n      break;\n    case MACH_O_MH_MAGIC_64:\n      is_64 = 1;\n      hdroffset = offset + sizeof (struct macho_header_64);\n      break;\n    case MACH_O_MH_MAGIC_FAT:\n    case MACH_O_MH_MAGIC_FAT_64:\n      {\n\tstruct macho_header_fat fat_header;\n\n\thdroffset = offset + sizeof (struct macho_header_fat);\n\tmemcpy (&fat_header, &header, sizeof fat_header);\n\treturn macho_add_fat (state, filename, descriptor, 0, hdroffset,\n\t\t\t      match_uuid, base_address, skip_symtab,\n\t\t\t      fat_header.nfat_arch,\n\t\t\t      header.magic == MACH_O_MH_MAGIC_FAT_64,\n\t\t\t      error_callback, data, fileline_fn, found_sym);\n      }\n    case MACH_O_MH_CIGAM_FAT:\n    case MACH_O_MH_CIGAM_FAT_64:\n      {\n\tstruct macho_header_fat fat_header;\n\tuint32_t nfat_arch;\n\n\thdroffset = offset + sizeof (struct macho_header_fat);\n\tmemcpy (&fat_header, &header, sizeof fat_header);\n\tnfat_arch = __builtin_bswap32 (fat_header.nfat_arch);\n\treturn macho_add_fat (state, filename, descriptor, 1, hdroffset,\n\t\t\t      match_uuid, base_address, skip_symtab,\n\t\t\t      nfat_arch,\n\t\t\t      header.magic == MACH_O_MH_CIGAM_FAT_64,\n\t\t\t      error_callback, data, fileline_fn, found_sym);\n      }\n    default:\n      error_callback (data, \"executable file is not in Mach-O format\", 0);\n      goto fail;\n    }\n\n  switch (header.filetype)\n    {\n    case MACH_O_MH_EXECUTE:\n    case MACH_O_MH_DYLIB:\n    case MACH_O_MH_DSYM:\n      break;\n    default:\n      error_callback (data, \"executable file is not an executable\", 0);\n      goto fail;\n    }\n\n  if (!backtrace_get_view (state, descriptor, hdroffset, header.sizeofcmds,\n\t\t\t   error_callback, data, &cmds_view))\n    goto fail;\n  cmds_view_valid = 1;\n\n  memset (&dwarf_sections, 0, sizeof dwarf_sections);\n  have_dwarf = 0;\n  memset (&uuid, 0, sizeof uuid);\n  have_uuid = 0;\n\n  cmdoffset = 0;\n  for (i = 0; i < header.ncmds; ++i)\n    {\n      const char *pcmd;\n      struct macho_load_command load_command;\n\n      if (cmdoffset + sizeof load_command > header.sizeofcmds)\n\tbreak;\n\n      pcmd = (const char *) cmds_view.data + cmdoffset;\n      memcpy (&load_command, pcmd, sizeof load_command);\n\n      switch (load_command.cmd)\n\t{\n\tcase MACH_O_LC_SEGMENT:\n\t  {\n\t    struct macho_segment_command segcmd;\n\n\t    memcpy (&segcmd, pcmd, sizeof segcmd);\n\t    if (memcmp (segcmd.segname,\n\t\t\t\"__DWARF\\0\\0\\0\\0\\0\\0\\0\\0\\0\",\n\t\t\tMACH_O_NAMELEN) == 0)\n\t      {\n\t\tif (!macho_add_dwarf_segment (state, descriptor, offset,\n\t\t\t\t\t      load_command.cmd,\n\t\t\t\t\t      pcmd + sizeof segcmd,\n\t\t\t\t\t      (load_command.cmdsize\n\t\t\t\t\t       - sizeof segcmd),\n\t\t\t\t\t      segcmd.nsects, error_callback,\n\t\t\t\t\t      data, &dwarf_sections))\n\t\t  goto fail;\n\t\thave_dwarf = 1;\n\t      }\n\t  }\n\t  break;\n\n\tcase MACH_O_LC_SEGMENT_64:\n\t  {\n\t    struct macho_segment_64_command segcmd;\n\n\t    memcpy (&segcmd, pcmd, sizeof segcmd);\n\t    if (memcmp (segcmd.segname,\n\t\t\t\"__DWARF\\0\\0\\0\\0\\0\\0\\0\\0\\0\",\n\t\t\tMACH_O_NAMELEN) == 0)\n\t      {\n\t\tif (!macho_add_dwarf_segment (state, descriptor, offset,\n\t\t\t\t\t      load_command.cmd,\n\t\t\t\t\t      pcmd + sizeof segcmd,\n\t\t\t\t\t      (load_command.cmdsize\n\t\t\t\t\t       - sizeof segcmd),\n\t\t\t\t\t      segcmd.nsects, error_callback,\n\t\t\t\t\t      data, &dwarf_sections))\n\t\t  goto fail;\n\t\thave_dwarf = 1;\n\t      }\n\t  }\n\t  break;\n\n\tcase MACH_O_LC_SYMTAB:\n\t  if (!skip_symtab)\n\t    {\n\t      struct macho_symtab_command symcmd;\n\n\t      memcpy (&symcmd, pcmd, sizeof symcmd);\n\t      if (!macho_add_symtab (state, descriptor, base_address, is_64,\n\t\t\t\t     offset + symcmd.symoff, symcmd.nsyms,\n\t\t\t\t     offset + symcmd.stroff, symcmd.strsize,\n\t\t\t\t     error_callback, data))\n\t\tgoto fail;\n\n\t      *found_sym = 1;\n\t    }\n\t  break;\n\n\tcase MACH_O_LC_UUID:\n\t  {\n\t    struct macho_uuid_command uuidcmd;\n\n\t    memcpy (&uuidcmd, pcmd, sizeof uuidcmd);\n\t    memcpy (&uuid[0], &uuidcmd.uuid[0], MACH_O_UUID_LEN);\n\t    have_uuid = 1;\n\t  }\n\t  break;\n\n\tdefault:\n\t  break;\n\t}\n\n      cmdoffset += load_command.cmdsize;\n    }\n\n  if (!backtrace_close (descriptor, error_callback, data))\n    goto fail;\n  descriptor = -1;\n\n  backtrace_release_view (state, &cmds_view, error_callback, data);\n  cmds_view_valid = 0;\n\n  if (match_uuid != NULL)\n    {\n      /* If we don't have a UUID, or it doesn't match, just ignore\n\t this file.  */\n      if (!have_uuid\n\t  || memcmp (match_uuid, &uuid[0], MACH_O_UUID_LEN) != 0)\n\treturn 1;\n    }\n\n  if (have_dwarf)\n    {\n      int is_big_endian;\n\n      is_big_endian = 0;\n#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)\n#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n      is_big_endian = 1;\n#endif\n#endif\n\n      if (!backtrace_dwarf_add (state, base_address, &dwarf_sections,\n\t\t\t\tis_big_endian, NULL, error_callback, data,\n\t\t\t\tfileline_fn, NULL))\n\tgoto fail;\n    }\n\n  if (!have_dwarf && have_uuid)\n    {\n      if (!macho_add_dsym (state, filename, base_address, &uuid[0],\n\t\t\t   error_callback, data, fileline_fn))\n\tgoto fail;\n    }\n\n  return 1;\n\n fail:\n  if (cmds_view_valid)\n    backtrace_release_view (state, &cmds_view, error_callback, data);\n  if (descriptor != -1)\n    backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n#ifdef HAVE_MACH_O_DYLD_H\n\n/* Initialize the backtrace data we need from a Mach-O executable\n   using the dyld support functions.  This closes descriptor.  */\n\nint\nbacktrace_initialize (struct backtrace_state *state, const char *filename,\n\t\t      int descriptor, backtrace_error_callback error_callback,\n\t\t      void *data, fileline *fileline_fn)\n{\n  uint32_t c;\n  uint32_t i;\n  int closed_descriptor;\n  int found_sym;\n  fileline macho_fileline_fn;\n\n  closed_descriptor = 0;\n  found_sym = 0;\n  macho_fileline_fn = macho_nodebug;\n\n  c = _dyld_image_count ();\n  for (i = 0; i < c; ++i)\n    {\n      uintptr_t base_address;\n      const char *name;\n      int d;\n      fileline mff;\n      int mfs;\n\n      name = _dyld_get_image_name (i);\n      if (name == NULL)\n\tcontinue;\n\n      if (strcmp (name, filename) == 0 && !closed_descriptor)\n\t{\n\t  d = descriptor;\n\t  closed_descriptor = 1;\n\t}\n      else\n\t{\n\t  int does_not_exist;\n\n\t  d = backtrace_open (name, error_callback, data, &does_not_exist);\n\t  if (d < 0)\n\t    continue;\n\t}\n\n      base_address = _dyld_get_image_vmaddr_slide (i);\n\n      mff = macho_nodebug;\n      if (!macho_add (state, name, d, 0, NULL, base_address, 0,\n\t\t      error_callback, data, &mff, &mfs))\n\tcontinue;\n\n      if (mff != macho_nodebug)\n\tmacho_fileline_fn = mff;\n      if (mfs)\n\tfound_sym = 1;\n    }\n\n  if (!closed_descriptor)\n    backtrace_close (descriptor, error_callback, data);\n\n  if (!state->threaded)\n    {\n      if (found_sym)\n\tstate->syminfo_fn = macho_syminfo;\n      else if (state->syminfo_fn == NULL)\n\tstate->syminfo_fn = macho_nosyms;\n    }\n  else\n    {\n      if (found_sym)\n\tbacktrace_atomic_store_pointer (&state->syminfo_fn, macho_syminfo);\n      else\n\t(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,\n\t\t\t\t\t     macho_nosyms);\n    }\n\n  if (!state->threaded)\n    *fileline_fn = state->fileline_fn;\n  else\n    *fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n\n  if (*fileline_fn == NULL || *fileline_fn == macho_nodebug)\n    *fileline_fn = macho_fileline_fn;\n\n  return 1;\n}\n\n#else /* !defined (HAVE_MACH_O_DYLD_H) */\n\n/* Initialize the backtrace data we need from a Mach-O executable\n   without using the dyld support functions.  This closes\n   descriptor.  */\n\nint\nbacktrace_initialize (struct backtrace_state *state, const char *filename,\n\t\t      int descriptor, backtrace_error_callback error_callback,\n\t\t      void *data, fileline *fileline_fn)\n{\n  fileline macho_fileline_fn;\n  int found_sym;\n\n  macho_fileline_fn = macho_nodebug;\n  if (!macho_add (state, filename, descriptor, 0, NULL, 0, 0,\n\t\t  error_callback, data, &macho_fileline_fn, &found_sym))\n    return 0;\n\n  if (!state->threaded)\n    {\n      if (found_sym)\n\tstate->syminfo_fn = macho_syminfo;\n      else if (state->syminfo_fn == NULL)\n\tstate->syminfo_fn = macho_nosyms;\n    }\n  else\n    {\n      if (found_sym)\n\tbacktrace_atomic_store_pointer (&state->syminfo_fn, macho_syminfo);\n      else\n\t(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,\n\t\t\t\t\t     macho_nosyms);\n    }\n\n  if (!state->threaded)\n    *fileline_fn = state->fileline_fn;\n  else\n    *fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n\n  if (*fileline_fn == NULL || *fileline_fn == macho_nodebug)\n    *fileline_fn = macho_fileline_fn;\n\n  return 1;\n}\n\n#endif /* !defined (HAVE_MACH_O_DYLD_H) */\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/mmap.c",
    "content": "/* mmap.c -- Memory allocation with mmap.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <string.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <sys/types.h>\n#include <sys/mman.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n#ifndef HAVE_DECL_GETPAGESIZE\nextern int getpagesize (void);\n#endif\n\n/* Memory allocation on systems that provide anonymous mmap.  This\n   permits the backtrace functions to be invoked from a signal\n   handler, assuming that mmap is async-signal safe.  */\n\n#ifndef MAP_ANONYMOUS\n#define MAP_ANONYMOUS MAP_ANON\n#endif\n\n#ifndef MAP_FAILED\n#define MAP_FAILED ((void *)-1)\n#endif\n\n/* A list of free memory blocks.  */\n\nstruct backtrace_freelist_struct\n{\n  /* Next on list.  */\n  struct backtrace_freelist_struct *next;\n  /* Size of this block, including this structure.  */\n  size_t size;\n};\n\n/* Free memory allocated by backtrace_alloc.  */\n\nstatic void\nbacktrace_free_locked (struct backtrace_state *state, void *addr, size_t size)\n{\n  /* Just leak small blocks.  We don't have to be perfect.  Don't put\n     more than 16 entries on the free list, to avoid wasting time\n     searching when allocating a block.  If we have more than 16\n     entries, leak the smallest entry.  */\n\n  if (size >= sizeof (struct backtrace_freelist_struct))\n    {\n      size_t c;\n      struct backtrace_freelist_struct **ppsmall;\n      struct backtrace_freelist_struct **pp;\n      struct backtrace_freelist_struct *p;\n\n      c = 0;\n      ppsmall = NULL;\n      for (pp = &state->freelist; *pp != NULL; pp = &(*pp)->next)\n\t{\n\t  if (ppsmall == NULL || (*pp)->size < (*ppsmall)->size)\n\t    ppsmall = pp;\n\t  ++c;\n\t}\n      if (c >= 16)\n\t{\n\t  if (size <= (*ppsmall)->size)\n\t    return;\n\t  *ppsmall = (*ppsmall)->next;\n\t}\n\n      p = (struct backtrace_freelist_struct *) addr;\n      p->next = state->freelist;\n      p->size = size;\n      state->freelist = p;\n    }\n}\n\n/* Allocate memory like malloc.  If ERROR_CALLBACK is NULL, don't\n   report an error.  */\n\nvoid *\nbacktrace_alloc (struct backtrace_state *state,\n\t\t size_t size, backtrace_error_callback error_callback,\n\t\t void *data)\n{\n  void *ret;\n  int locked;\n  struct backtrace_freelist_struct **pp;\n  size_t pagesize;\n  size_t asksize;\n  void *page;\n\n  ret = NULL;\n\n  /* If we can acquire the lock, then see if there is space on the\n     free list.  If we can't acquire the lock, drop straight into\n     using mmap.  __sync_lock_test_and_set returns the old state of\n     the lock, so we have acquired it if it returns 0.  */\n\n  if (!state->threaded)\n    locked = 1;\n  else\n    locked = __sync_lock_test_and_set (&state->lock_alloc, 1) == 0;\n\n  if (locked)\n    {\n      for (pp = &state->freelist; *pp != NULL; pp = &(*pp)->next)\n\t{\n\t  if ((*pp)->size >= size)\n\t    {\n\t      struct backtrace_freelist_struct *p;\n\n\t      p = *pp;\n\t      *pp = p->next;\n\n\t      /* Round for alignment; we assume that no type we care about\n\t\t is more than 8 bytes.  */\n\t      size = (size + 7) & ~ (size_t) 7;\n\t      if (size < p->size)\n\t\tbacktrace_free_locked (state, (char *) p + size,\n\t\t\t\t       p->size - size);\n\n\t      ret = (void *) p;\n\n\t      break;\n\t    }\n\t}\n\n      if (state->threaded)\n\t__sync_lock_release (&state->lock_alloc);\n    }\n\n  if (ret == NULL)\n    {\n      /* Allocate a new page.  */\n\n      pagesize = getpagesize ();\n      asksize = (size + pagesize - 1) & ~ (pagesize - 1);\n      page = mmap (NULL, asksize, PROT_READ | PROT_WRITE,\n\t\t   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);\n      if (page == MAP_FAILED)\n\t{\n\t  if (error_callback)\n\t    error_callback (data, \"mmap\", errno);\n\t}\n      else\n\t{\n\t  size = (size + 7) & ~ (size_t) 7;\n\t  if (size < asksize)\n\t    backtrace_free (state, (char *) page + size, asksize - size,\n\t\t\t    error_callback, data);\n\n\t  ret = page;\n\t}\n    }\n\n  return ret;\n}\n\n/* Free memory allocated by backtrace_alloc.  */\n\nvoid\nbacktrace_free (struct backtrace_state *state, void *addr, size_t size,\n\t\tbacktrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t\tvoid *data ATTRIBUTE_UNUSED)\n{\n  int locked;\n\n  /* If we are freeing a large aligned block, just release it back to\n     the system.  This case arises when growing a vector for a large\n     binary with lots of debug info.  Calling munmap here may cause us\n     to call mmap again if there is also a large shared library; we\n     just live with that.  */\n  if (size >= 16 * 4096)\n    {\n      size_t pagesize;\n\n      pagesize = getpagesize ();\n      if (((uintptr_t) addr & (pagesize - 1)) == 0\n\t  && (size & (pagesize - 1)) == 0)\n\t{\n\t  /* If munmap fails for some reason, just add the block to\n\t     the freelist.  */\n\t  if (munmap (addr, size) == 0)\n\t    return;\n\t}\n    }\n\n  /* If we can acquire the lock, add the new space to the free list.\n     If we can't acquire the lock, just leak the memory.\n     __sync_lock_test_and_set returns the old state of the lock, so we\n     have acquired it if it returns 0.  */\n\n  if (!state->threaded)\n    locked = 1;\n  else\n    locked = __sync_lock_test_and_set (&state->lock_alloc, 1) == 0;\n\n  if (locked)\n    {\n      backtrace_free_locked (state, addr, size);\n\n      if (state->threaded)\n\t__sync_lock_release (&state->lock_alloc);\n    }\n}\n\n/* Grow VEC by SIZE bytes.  */\n\nvoid *\nbacktrace_vector_grow (struct backtrace_state *state,size_t size,\n\t\t       backtrace_error_callback error_callback,\n\t\t       void *data, struct backtrace_vector *vec)\n{\n  void *ret;\n\n  if (size > vec->alc)\n    {\n      size_t pagesize;\n      size_t alc;\n      void *base;\n\n      pagesize = getpagesize ();\n      alc = vec->size + size;\n      if (vec->size == 0)\n\talc = 16 * size;\n      else if (alc < pagesize)\n\t{\n\t  alc *= 2;\n\t  if (alc > pagesize)\n\t    alc = pagesize;\n\t}\n      else\n\t{\n\t  alc *= 2;\n\t  alc = (alc + pagesize - 1) & ~ (pagesize - 1);\n\t}\n      base = backtrace_alloc (state, alc, error_callback, data);\n      if (base == NULL)\n\treturn NULL;\n      if (vec->base != NULL)\n\t{\n\t  memcpy (base, vec->base, vec->size);\n\t  backtrace_free (state, vec->base, vec->size + vec->alc,\n\t\t\t  error_callback, data);\n\t}\n      vec->base = base;\n      vec->alc = alc - vec->size;\n    }\n\n  ret = (char *) vec->base + vec->size;\n  vec->size += size;\n  vec->alc -= size;\n  return ret;\n}\n\n/* Finish the current allocation on VEC.  */\n\nvoid *\nbacktrace_vector_finish (\n  struct backtrace_state *state ATTRIBUTE_UNUSED,\n  struct backtrace_vector *vec,\n  backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n  void *data ATTRIBUTE_UNUSED)\n{\n  void *ret;\n\n  ret = vec->base;\n  vec->base = (char *) vec->base + vec->size;\n  vec->size = 0;\n  return ret;\n}\n\n/* Release any extra space allocated for VEC.  */\n\nint\nbacktrace_vector_release (struct backtrace_state *state,\n\t\t\t  struct backtrace_vector *vec,\n\t\t\t  backtrace_error_callback error_callback,\n\t\t\t  void *data)\n{\n  size_t size;\n  size_t alc;\n  size_t aligned;\n\n  /* Make sure that the block that we free is aligned on an 8-byte\n     boundary.  */\n  size = vec->size;\n  alc = vec->alc;\n  aligned = (size + 7) & ~ (size_t) 7;\n  alc -= aligned - size;\n\n  backtrace_free (state, (char *) vec->base + aligned, alc,\n\t\t  error_callback, data);\n  vec->alc = 0;\n  if (vec->size == 0)\n    vec->base = NULL;\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/pecoff.c",
    "content": "/* pecoff.c -- Get debug data from a PE/COFFF file for backtraces.\n   Copyright (C) 2015-2021 Free Software Foundation, Inc.\n   Adapted from elf.c by Tristan Gingold, AdaCore.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n#ifdef HAVE_WINDOWS_H\n#ifndef WIN32_MEAN_AND_LEAN\n#define WIN32_MEAN_AND_LEAN\n#endif\n\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n\n#include <windows.h>\n#endif\n\n/* Coff file header.  */\n\ntypedef struct {\n  uint16_t machine;\n  uint16_t number_of_sections;\n  uint32_t time_date_stamp;\n  uint32_t pointer_to_symbol_table;\n  uint32_t number_of_symbols;\n  uint16_t size_of_optional_header;\n  uint16_t characteristics;\n} b_coff_file_header;\n\n/* Coff optional header.  */\n\ntypedef struct {\n  uint16_t magic;\n  uint8_t  major_linker_version;\n  uint8_t  minor_linker_version;\n  uint32_t size_of_code;\n  uint32_t size_of_initialized_data;\n  uint32_t size_of_uninitialized_data;\n  uint32_t address_of_entry_point;\n  uint32_t base_of_code;\n  union {\n    struct {\n      uint32_t base_of_data;\n      uint32_t image_base;\n    } pe;\n    struct {\n      uint64_t image_base;\n    } pep;\n  } u;\n} b_coff_optional_header;\n\n/* Values of magic in optional header.  */\n\n#define PE_MAGIC 0x10b\t\t/* PE32 executable.  */\n#define PEP_MAGIC 0x20b\t\t/* PE32+ executable (for 64bit targets).  */\n\n/* Coff section header.  */\n\ntypedef struct {\n  char name[8];\n  uint32_t virtual_size;\n  uint32_t virtual_address;\n  uint32_t size_of_raw_data;\n  uint32_t pointer_to_raw_data;\n  uint32_t pointer_to_relocations;\n  uint32_t pointer_to_line_numbers;\n  uint16_t number_of_relocations;\n  uint16_t number_of_line_numbers;\n  uint32_t characteristics;\n} b_coff_section_header;\n\n/* Coff symbol name.  */\n\ntypedef union {\n  char short_name[8];\n  struct {\n    unsigned char zeroes[4];\n    unsigned char off[4];\n  } long_name;\n} b_coff_name;\n\n/* Coff symbol (external representation which is unaligned).  */\n\ntypedef struct {\n  b_coff_name name;\n  unsigned char value[4];\n  unsigned char section_number[2];\n  unsigned char type[2];\n  unsigned char storage_class;\n  unsigned char number_of_aux_symbols;\n} b_coff_external_symbol;\n\n/* Symbol types.  */\n\n#define N_TBSHFT 4\t\t\t/* Shift for the derived type.  */\n#define IMAGE_SYM_DTYPE_FUNCTION 2\t/* Function derived type.  */\n\n/* Size of a coff symbol.  */\n\n#define SYM_SZ 18\n\n/* Coff symbol, internal representation (aligned).  */\n\ntypedef struct {\n  const char *name;\n  uint32_t value;\n  int16_t sec;\n  uint16_t type;\n  uint16_t sc;\n} b_coff_internal_symbol;\n\n/* Names of sections, indexed by enum dwarf_section in internal.h.  */\n\nstatic const char * const debug_section_names[DEBUG_MAX] =\n{\n  \".debug_info\",\n  \".debug_line\",\n  \".debug_abbrev\",\n  \".debug_ranges\",\n  \".debug_str\",\n  \".debug_addr\",\n  \".debug_str_offsets\",\n  \".debug_line_str\",\n  \".debug_rnglists\"\n};\n\n/* Information we gather for the sections we care about.  */\n\nstruct debug_section_info\n{\n  /* Section file offset.  */\n  off_t offset;\n  /* Section size.  */\n  size_t size;\n};\n\n/* Information we keep for an coff symbol.  */\n\nstruct coff_symbol\n{\n  /* The name of the symbol.  */\n  const char *name;\n  /* The address of the symbol.  */\n  uintptr_t address;\n};\n\n/* Information to pass to coff_syminfo.  */\n\nstruct coff_syminfo_data\n{\n  /* Symbols for the next module.  */\n  struct coff_syminfo_data *next;\n  /* The COFF symbols, sorted by address.  */\n  struct coff_symbol *symbols;\n  /* The number of symbols.  */\n  size_t count;\n};\n\n/* A dummy callback function used when we can't find any debug info.  */\n\nstatic int\ncoff_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t      uintptr_t pc ATTRIBUTE_UNUSED,\n\t      backtrace_full_callback callback ATTRIBUTE_UNUSED,\n\t      backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no debug info in PE/COFF executable\", -1);\n  return 0;\n}\n\n/* A dummy callback function used when we can't find a symbol\n   table.  */\n\nstatic void\ncoff_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t     uintptr_t addr ATTRIBUTE_UNUSED,\n\t     backtrace_syminfo_callback callback ATTRIBUTE_UNUSED,\n\t     backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no symbol table in PE/COFF executable\", -1);\n}\n\n/* Read a potentially unaligned 4 byte word at P, using native endianness.  */\n\nstatic uint32_t\ncoff_read4 (const unsigned char *p)\n{\n  uint32_t res;\n\n  memcpy (&res, p, 4);\n  return res;\n}\n\n/* Read a potentially unaligned 2 byte word at P, using native endianness.\n   All 2 byte word in symbols are always aligned, but for coherency all\n   fields are declared as char arrays.  */\n\nstatic uint16_t\ncoff_read2 (const unsigned char *p)\n{\n  uint16_t res;\n\n  memcpy (&res, p, sizeof (res));\n  return res;\n}\n\n/* Return the length (without the trailing 0) of a COFF short name.  */\n\nstatic size_t\ncoff_short_name_len (const char *name)\n{\n  int i;\n\n  for (i = 0; i < 8; i++)\n    if (name[i] == 0)\n      return i;\n  return 8;\n}\n\n/* Return true iff COFF short name CNAME is the same as NAME (a NUL-terminated\n   string).  */\n\nstatic int\ncoff_short_name_eq (const char *name, const char *cname)\n{\n  int i;\n\n  for (i = 0; i < 8; i++)\n    {\n      if (name[i] != cname[i])\n\treturn 0;\n      if (name[i] == 0)\n\treturn 1;\n    }\n  return name[8] == 0;\n}\n\n/* Return true iff NAME is the same as string at offset OFF.  */\n\nstatic int\ncoff_long_name_eq (const char *name, unsigned int off,\n\t\t   struct backtrace_view *str_view)\n{\n  if (off >= str_view->len)\n    return 0;\n  return strcmp (name, (const char *)str_view->data + off) == 0;\n}\n\n/* Compare struct coff_symbol for qsort.  */\n\nstatic int\ncoff_symbol_compare (const void *v1, const void *v2)\n{\n  const struct coff_symbol *e1 = (const struct coff_symbol *) v1;\n  const struct coff_symbol *e2 = (const struct coff_symbol *) v2;\n\n  if (e1->address < e2->address)\n    return -1;\n  else if (e1->address > e2->address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Convert SYM to internal (and aligned) format ISYM, using string table\n   from STRTAB and STRTAB_SIZE, and number of sections SECTS_NUM.\n   Return -1 in case of error (invalid section number or string index).  */\n\nstatic int\ncoff_expand_symbol (b_coff_internal_symbol *isym,\n\t\t    const b_coff_external_symbol *sym,\n\t\t    uint16_t sects_num,\n\t\t    const unsigned char *strtab, size_t strtab_size)\n{\n  isym->type = coff_read2 (sym->type);\n  isym->sec = coff_read2 (sym->section_number);\n  isym->sc = sym->storage_class;\n\n  if (isym->sec > 0 && (uint16_t) isym->sec > sects_num)\n    return -1;\n  if (sym->name.short_name[0] != 0)\n    isym->name = sym->name.short_name;\n  else\n    {\n      uint32_t off = coff_read4 (sym->name.long_name.off);\n\n      if (off >= strtab_size)\n\treturn -1;\n      isym->name = (const char *) strtab + off;\n    }\n  return 0;\n}\n\n/* Return true iff SYM is a defined symbol for a function.  Data symbols\n   aren't considered because they aren't easily identified (same type as\n   section names, presence of symbols defined by the linker script).  */\n\nstatic int\ncoff_is_function_symbol (const b_coff_internal_symbol *isym)\n{\n  return (isym->type >> N_TBSHFT) == IMAGE_SYM_DTYPE_FUNCTION\n    && isym->sec > 0;\n}\n\n/* Initialize the symbol table info for coff_syminfo.  */\n\nstatic int\ncoff_initialize_syminfo (struct backtrace_state *state,\n\t\t\t uintptr_t base_address, int is_64,\n\t\t\t const b_coff_section_header *sects, size_t sects_num,\n\t\t\t const b_coff_external_symbol *syms, size_t syms_size,\n\t\t\t const unsigned char *strtab, size_t strtab_size,\n\t\t\t backtrace_error_callback error_callback,\n\t\t\t void *data, struct coff_syminfo_data *sdata)\n{\n  size_t syms_count;\n  char *coff_symstr;\n  size_t coff_symstr_len;\n  size_t coff_symbol_count;\n  size_t coff_symbol_size;\n  struct coff_symbol *coff_symbols;\n  struct coff_symbol *coff_sym;\n  char *coff_str;\n  size_t i;\n\n  syms_count = syms_size / SYM_SZ;\n\n  /* We only care about function symbols.  Count them.  Also count size of\n     strings for in-symbol names.  */\n  coff_symbol_count = 0;\n  coff_symstr_len = 0;\n  for (i = 0; i < syms_count; ++i)\n    {\n      const b_coff_external_symbol *asym = &syms[i];\n      b_coff_internal_symbol isym;\n\n      if (coff_expand_symbol (&isym, asym, sects_num, strtab, strtab_size) < 0)\n\t{\n\t  error_callback (data, \"invalid section or offset in coff symbol\", 0);\n\t  return 0;\n\t}\n      if (coff_is_function_symbol (&isym))\n\t{\n\t  ++coff_symbol_count;\n\t  if (asym->name.short_name[0] != 0)\n\t    coff_symstr_len += coff_short_name_len (asym->name.short_name) + 1;\n\t}\n\n      i += asym->number_of_aux_symbols;\n    }\n\n  coff_symbol_size = (coff_symbol_count + 1) * sizeof (struct coff_symbol);\n  coff_symbols = ((struct coff_symbol *)\n\t\t  backtrace_alloc (state, coff_symbol_size, error_callback,\n\t\t\t\t   data));\n  if (coff_symbols == NULL)\n    return 0;\n\n  /* Allocate memory for symbols strings.  */\n  if (coff_symstr_len > 0)\n    {\n      coff_symstr = ((char *)\n\t\t     backtrace_alloc (state, coff_symstr_len, error_callback,\n\t\t\t\t      data));\n      if (coff_symstr == NULL)\n\t{\n\t  backtrace_free (state, coff_symbols, coff_symbol_size,\n\t\t\t  error_callback, data);\n\t  return 0;\n\t}\n    }\n  else\n    coff_symstr = NULL;\n\n  /* Copy symbols.  */\n  coff_sym = coff_symbols;\n  coff_str = coff_symstr;\n  for (i = 0; i < syms_count; ++i)\n    {\n      const b_coff_external_symbol *asym = &syms[i];\n      b_coff_internal_symbol isym;\n\n      if (coff_expand_symbol (&isym, asym, sects_num, strtab, strtab_size))\n\t{\n\t  /* Should not fail, as it was already tested in the previous\n\t     loop.  */\n\t  abort ();\n\t}\n      if (coff_is_function_symbol (&isym))\n\t{\n\t  const char *name;\n\t  int16_t secnum;\n\n\t  if (asym->name.short_name[0] != 0)\n\t    {\n\t      size_t len = coff_short_name_len (isym.name);\n\t      name = coff_str;\n\t      memcpy (coff_str, isym.name, len);\n\t      coff_str[len] = 0;\n\t      coff_str += len + 1;\n\t    }\n\t  else\n\t    name = isym.name;\n\n\t  if (!is_64)\n\t    {\n\t      /* Strip leading '_'.  */\n\t      if (name[0] == '_')\n\t\tname++;\n\t    }\n\n\t  /* Symbol value is section relative, so we need to read the address\n\t     of its section.  */\n\t  secnum = coff_read2 (asym->section_number);\n\n\t  coff_sym->name = name;\n\t  coff_sym->address = (coff_read4 (asym->value)\n\t\t\t       + sects[secnum - 1].virtual_address\n\t\t\t       + base_address);\n\t  coff_sym++;\n\t}\n\n      i += asym->number_of_aux_symbols;\n    }\n\n  /* End of symbols marker.  */\n  coff_sym->name = NULL;\n  coff_sym->address = -1;\n\n  backtrace_qsort (coff_symbols, coff_symbol_count,\n\t\t   sizeof (struct coff_symbol), coff_symbol_compare);\n\n  sdata->next = NULL;\n  sdata->symbols = coff_symbols;\n  sdata->count = coff_symbol_count;\n\n  return 1;\n}\n\n/* Add EDATA to the list in STATE.  */\n\nstatic void\ncoff_add_syminfo_data (struct backtrace_state *state,\n\t\t       struct coff_syminfo_data *sdata)\n{\n  if (!state->threaded)\n    {\n      struct coff_syminfo_data **pp;\n\n      for (pp = (struct coff_syminfo_data **) (void *) &state->syminfo_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = sdata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct coff_syminfo_data **pp;\n\n\t  pp = (struct coff_syminfo_data **) (void *) &state->syminfo_data;\n\n\t  while (1)\n\t    {\n\t      struct coff_syminfo_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, sdata))\n\t    break;\n\t}\n    }\n}\n\n/* Compare an ADDR against an elf_symbol for bsearch.  We allocate one\n   extra entry in the array so that this can look safely at the next\n   entry.  */\n\nstatic int\ncoff_symbol_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct coff_symbol *entry = (const struct coff_symbol *) ventry;\n  uintptr_t addr;\n\n  addr = *key;\n  if (addr < entry->address)\n    return -1;\n  else if (addr >= entry[1].address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Return the symbol name and value for an ADDR.  */\n\nstatic void\ncoff_syminfo (struct backtrace_state *state, uintptr_t addr,\n\t      backtrace_syminfo_callback callback,\n\t      backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t      void *data)\n{\n  struct coff_syminfo_data *sdata;\n  struct coff_symbol *sym = NULL;\n\n  if (!state->threaded)\n    {\n      for (sdata = (struct coff_syminfo_data *) state->syminfo_data;\n\t   sdata != NULL;\n\t   sdata = sdata->next)\n\t{\n\t  sym = ((struct coff_symbol *)\n\t\t bsearch (&addr, sdata->symbols, sdata->count,\n\t\t\t  sizeof (struct coff_symbol), coff_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\t}\n    }\n  else\n    {\n      struct coff_syminfo_data **pp;\n\n      pp = (struct coff_syminfo_data **) (void *) &state->syminfo_data;\n      while (1)\n\t{\n\t  sdata = backtrace_atomic_load_pointer (pp);\n\t  if (sdata == NULL)\n\t    break;\n\n\t  sym = ((struct coff_symbol *)\n\t\t bsearch (&addr, sdata->symbols, sdata->count,\n\t\t\t  sizeof (struct coff_symbol), coff_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\n\t  pp = &sdata->next;\n\t}\n    }\n\n  if (sym == NULL)\n    callback (data, addr, NULL, 0, 0);\n  else\n    callback (data, addr, sym->name, sym->address, 0);\n}\n\n/* Add the backtrace data for one PE/COFF file.  Returns 1 on success,\n   0 on failure (in both cases descriptor is closed).  */\n\nstatic int\ncoff_add (struct backtrace_state *state, int descriptor,\n\t  backtrace_error_callback error_callback, void *data,\n\t  fileline *fileline_fn, int *found_sym, int *found_dwarf)\n{\n  struct backtrace_view fhdr_view;\n  off_t fhdr_off;\n  int magic_ok;\n  b_coff_file_header fhdr;\n  off_t opt_sects_off;\n  size_t opt_sects_size;\n  unsigned int sects_num;\n  struct backtrace_view sects_view;\n  int sects_view_valid;\n  const b_coff_optional_header *opt_hdr;\n  const b_coff_section_header *sects;\n  struct backtrace_view str_view;\n  int str_view_valid;\n  size_t str_size;\n  off_t str_off;\n  struct backtrace_view syms_view;\n  off_t syms_off;\n  size_t syms_size;\n  int syms_view_valid;\n  unsigned int syms_num;\n  unsigned int i;\n  struct debug_section_info sections[DEBUG_MAX];\n  off_t min_offset;\n  off_t max_offset;\n  struct backtrace_view debug_view;\n  int debug_view_valid;\n  int is_64;\n  uintptr_t image_base;\n  uintptr_t base_address = 0;\n  struct dwarf_sections dwarf_sections;\n\n  *found_sym = 0;\n  *found_dwarf = 0;\n\n  sects_view_valid = 0;\n  syms_view_valid = 0;\n  str_view_valid = 0;\n  debug_view_valid = 0;\n\n  /* Map the MS-DOS stub (if any) and extract file header offset.  */\n  if (!backtrace_get_view (state, descriptor, 0, 0x40, error_callback,\n\t\t\t   data, &fhdr_view))\n    goto fail;\n\n  {\n    const unsigned char *vptr = fhdr_view.data;\n\n    if (vptr[0] == 'M' && vptr[1] == 'Z')\n      fhdr_off = coff_read4 (vptr + 0x3c);\n    else\n      fhdr_off = 0;\n  }\n\n  backtrace_release_view (state, &fhdr_view, error_callback, data);\n\n  /* Map the coff file header.  */\n  if (!backtrace_get_view (state, descriptor, fhdr_off,\n\t\t\t   sizeof (b_coff_file_header) + 4,\n\t\t\t   error_callback, data, &fhdr_view))\n    goto fail;\n\n  if (fhdr_off != 0)\n    {\n      const char *magic = (const char *) fhdr_view.data;\n      magic_ok = memcmp (magic, \"PE\\0\", 4) == 0;\n      fhdr_off += 4;\n\n      memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);\n    }\n  else\n    {\n      memcpy (&fhdr, fhdr_view.data, sizeof fhdr);\n      /* TODO: test fhdr.machine for coff but non-PE platforms.  */\n      magic_ok = 0;\n    }\n  backtrace_release_view (state, &fhdr_view, error_callback, data);\n\n  if (!magic_ok)\n    {\n      error_callback (data, \"executable file is not COFF\", 0);\n      goto fail;\n    }\n\n  sects_num = fhdr.number_of_sections;\n  syms_num = fhdr.number_of_symbols;\n\n  opt_sects_off = fhdr_off + sizeof (fhdr);\n  opt_sects_size = (fhdr.size_of_optional_header\n\t\t    + sects_num * sizeof (b_coff_section_header));\n\n  /* To translate PC to file/line when using DWARF, we need to find\n     the .debug_info and .debug_line sections.  */\n\n  /* Read the optional header and the section headers.  */\n\n  if (!backtrace_get_view (state, descriptor, opt_sects_off, opt_sects_size,\n\t\t\t   error_callback, data, &sects_view))\n    goto fail;\n  sects_view_valid = 1;\n  opt_hdr = (const b_coff_optional_header *) sects_view.data;\n  sects = (const b_coff_section_header *)\n    (sects_view.data + fhdr.size_of_optional_header);\n\n  is_64 = 0;\n  if (fhdr.size_of_optional_header > sizeof (*opt_hdr))\n    {\n      if (opt_hdr->magic == PE_MAGIC)\n\timage_base = opt_hdr->u.pe.image_base;\n      else if (opt_hdr->magic == PEP_MAGIC)\n\t{\n\t  image_base = opt_hdr->u.pep.image_base;\n\t  is_64 = 1;\n\t}\n      else\n\t{\n\t  error_callback (data, \"bad magic in PE optional header\", 0);\n\t  goto fail;\n\t}\n    }\n  else\n    image_base = 0;\n\n  /* Read the symbol table and the string table.  */\n\n  if (fhdr.pointer_to_symbol_table == 0)\n    {\n      /* No symbol table, no string table.  */\n      str_off = 0;\n      str_size = 0;\n      syms_num = 0;\n      syms_size = 0;\n    }\n  else\n    {\n      /* Symbol table is followed by the string table.  The string table\n\t starts with its length (on 4 bytes).\n\t Map the symbol table and the length of the string table.  */\n      syms_off = fhdr.pointer_to_symbol_table;\n      syms_size = syms_num * SYM_SZ;\n\n      if (!backtrace_get_view (state, descriptor, syms_off, syms_size + 4,\n\t\t\t       error_callback, data, &syms_view))\n\tgoto fail;\n      syms_view_valid = 1;\n\n      str_size = coff_read4 (syms_view.data + syms_size);\n\n      str_off = syms_off + syms_size;\n\n      if (str_size > 4)\n\t{\n\t  /* Map string table (including the length word).  */\n\n\t  if (!backtrace_get_view (state, descriptor, str_off, str_size,\n\t\t\t\t   error_callback, data, &str_view))\n\t    goto fail;\n\t  str_view_valid = 1;\n\t}\n    }\n\n  memset (sections, 0, sizeof sections);\n\n  /* Look for the symbol table.  */\n  for (i = 0; i < sects_num; ++i)\n    {\n      const b_coff_section_header *s = sects + i;\n      unsigned int str_off;\n      int j;\n\n      if (s->name[0] == '/')\n\t{\n\t  /* Extended section name.  */\n\t  str_off = atoi (s->name + 1);\n\t}\n      else\n\tstr_off = 0;\n\n      for (j = 0; j < (int) DEBUG_MAX; ++j)\n\t{\n\t  const char *dbg_name = debug_section_names[j];\n\t  int match;\n\n\t  if (str_off != 0)\n\t    match = coff_long_name_eq (dbg_name, str_off, &str_view);\n\t  else\n\t    match = coff_short_name_eq (dbg_name, s->name);\n\t  if (match)\n\t    {\n\t      sections[j].offset = s->pointer_to_raw_data;\n\t      sections[j].size = s->virtual_size <= s->size_of_raw_data ?\n\t\ts->virtual_size : s->size_of_raw_data;\n\t      break;\n\t    }\n\t}\n    }\n\n  if (syms_num != 0)\n    {\n      struct coff_syminfo_data *sdata;\n\n      sdata = ((struct coff_syminfo_data *)\n\t       backtrace_alloc (state, sizeof *sdata, error_callback, data));\n      if (sdata == NULL)\n\tgoto fail;\n\n      if (!coff_initialize_syminfo (state, image_base, is_64,\n\t\t\t\t    sects, sects_num,\n\t\t\t\t    syms_view.data, syms_size,\n\t\t\t\t    str_view.data, str_size,\n\t\t\t\t    error_callback, data, sdata))\n\t{\n\t  backtrace_free (state, sdata, sizeof *sdata, error_callback, data);\n\t  goto fail;\n\t}\n\n      *found_sym = 1;\n\n      coff_add_syminfo_data (state, sdata);\n    }\n\n  backtrace_release_view (state, &sects_view, error_callback, data);\n  sects_view_valid = 0;\n  if (syms_view_valid)\n    {\n      backtrace_release_view (state, &syms_view, error_callback, data);\n      syms_view_valid = 0;\n    }\n\n  /* Read all the debug sections in a single view, since they are\n     probably adjacent in the file.  We never release this view.  */\n\n  min_offset = 0;\n  max_offset = 0;\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      off_t end;\n\n      if (sections[i].size == 0)\n\tcontinue;\n      if (min_offset == 0 || sections[i].offset < min_offset)\n\tmin_offset = sections[i].offset;\n      end = sections[i].offset + sections[i].size;\n      if (end > max_offset)\n\tmax_offset = end;\n    }\n  if (min_offset == 0 || max_offset == 0)\n    {\n      if (!backtrace_close (descriptor, error_callback, data))\n\tgoto fail;\n      *fileline_fn = coff_nodebug;\n      return 1;\n    }\n\n  if (!backtrace_get_view (state, descriptor, min_offset,\n\t\t\t   max_offset - min_offset,\n\t\t\t   error_callback, data, &debug_view))\n    goto fail;\n  debug_view_valid = 1;\n\n  /* We've read all we need from the executable.  */\n  if (!backtrace_close (descriptor, error_callback, data))\n    goto fail;\n  descriptor = -1;\n\n  for (i = 0; i < (int) DEBUG_MAX; ++i)\n    {\n      size_t size = sections[i].size;\n      dwarf_sections.size[i] = size;\n      if (size == 0)\n\tdwarf_sections.data[i] = NULL;\n      else\n\tdwarf_sections.data[i] = ((const unsigned char *) debug_view.data\n\t\t\t\t  + (sections[i].offset - min_offset));\n    }\n\n#ifdef HAVE_WINDOWS_H\n  {\n    uintptr_t module_handle;\n\n    module_handle = (uintptr_t) GetModuleHandle (NULL);\n    base_address = module_handle - image_base;\n  }\n#endif\n\n  if (!backtrace_dwarf_add (state, base_address, &dwarf_sections,\n\t\t\t    0, /* FIXME: is_bigendian */\n\t\t\t    NULL, /* altlink */\n\t\t\t    error_callback, data, fileline_fn,\n\t\t\t    NULL /* returned fileline_entry */))\n    goto fail;\n\n  *found_dwarf = 1;\n\n  return 1;\n\n fail:\n  if (sects_view_valid)\n    backtrace_release_view (state, &sects_view, error_callback, data);\n  if (str_view_valid)\n    backtrace_release_view (state, &str_view, error_callback, data);\n  if (syms_view_valid)\n    backtrace_release_view (state, &syms_view, error_callback, data);\n  if (debug_view_valid)\n    backtrace_release_view (state, &debug_view, error_callback, data);\n  if (descriptor != -1)\n    backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n/* Initialize the backtrace data we need from an ELF executable.  At\n   the ELF level, all we need to do is find the debug info\n   sections.  */\n\nint\nbacktrace_initialize (struct backtrace_state *state,\n\t\t      const char *filename ATTRIBUTE_UNUSED, int descriptor,\n\t\t      backtrace_error_callback error_callback,\n\t\t      void *data, fileline *fileline_fn)\n{\n  int ret;\n  int found_sym;\n  int found_dwarf;\n  fileline coff_fileline_fn;\n\n  ret = coff_add (state, descriptor, error_callback, data,\n\t\t  &coff_fileline_fn, &found_sym, &found_dwarf);\n  if (!ret)\n    return 0;\n\n  if (!state->threaded)\n    {\n      if (found_sym)\n\tstate->syminfo_fn = coff_syminfo;\n      else if (state->syminfo_fn == NULL)\n\tstate->syminfo_fn = coff_nosyms;\n    }\n  else\n    {\n      if (found_sym)\n\tbacktrace_atomic_store_pointer (&state->syminfo_fn, coff_syminfo);\n      else\n\t(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,\n\t\t\t\t\t     coff_nosyms);\n    }\n\n  if (!state->threaded)\n    {\n      if (state->fileline_fn == NULL || state->fileline_fn == coff_nodebug)\n\t*fileline_fn = coff_fileline_fn;\n    }\n  else\n    {\n      fileline current_fn;\n\n      current_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n      if (current_fn == NULL || current_fn == coff_nodebug)\n\t*fileline_fn = coff_fileline_fn;\n    }\n\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/posix.c",
    "content": "/* posix.c -- POSIX file I/O routines for the backtrace library.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <unistd.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n#ifndef O_BINARY\n#define O_BINARY 0\n#endif\n\n#ifndef O_CLOEXEC\n#define O_CLOEXEC 0\n#endif\n\n#ifndef FD_CLOEXEC\n#define FD_CLOEXEC 1\n#endif\n\n/* Open a file for reading.  */\n\nint\nbacktrace_open (const char *filename, backtrace_error_callback error_callback,\n\t\tvoid *data, int *does_not_exist)\n{\n  int descriptor;\n\n  if (does_not_exist != NULL)\n    *does_not_exist = 0;\n\n  descriptor = open (filename, (int) (O_RDONLY | O_BINARY | O_CLOEXEC));\n  if (descriptor < 0)\n    {\n      /* If DOES_NOT_EXIST is not NULL, then don't call ERROR_CALLBACK\n\t if the file does not exist.  We treat lacking permission to\n\t open the file as the file not existing; this case arises when\n\t running the libgo syscall package tests as root.  */\n      if (does_not_exist != NULL && (errno == ENOENT || errno == EACCES))\n\t*does_not_exist = 1;\n      else\n\terror_callback (data, filename, errno);\n      return -1;\n    }\n\n#ifdef HAVE_FCNTL\n  /* Set FD_CLOEXEC just in case the kernel does not support\n     O_CLOEXEC. It doesn't matter if this fails for some reason.\n     FIXME: At some point it should be safe to only do this if\n     O_CLOEXEC == 0.  */\n  fcntl (descriptor, F_SETFD, FD_CLOEXEC);\n#endif\n\n  return descriptor;\n}\n\n/* Close DESCRIPTOR.  */\n\nint\nbacktrace_close (int descriptor, backtrace_error_callback error_callback,\n\t\t void *data)\n{\n  if (close (descriptor) < 0)\n    {\n      error_callback (data, \"close\", errno);\n      return 0;\n    }\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/read.c",
    "content": "/* read.c -- File views without mmap.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* This file implements file views when mmap is not available.  */\n\n/* Create a view of SIZE bytes from DESCRIPTOR at OFFSET.  */\n\nint\nbacktrace_get_view (struct backtrace_state *state, int descriptor,\n\t\t    off_t offset, uint64_t size,\n\t\t    backtrace_error_callback error_callback,\n\t\t    void *data, struct backtrace_view *view)\n{\n  uint64_t got;\n  ssize_t r;\n\n  if ((uint64_t) (size_t) size != size)\n    {\n      error_callback (data, \"file size too large\", 0);\n      return 0;\n    }\n\n  if (lseek (descriptor, offset, SEEK_SET) < 0)\n    {\n      error_callback (data, \"lseek\", errno);\n      return 0;\n    }\n\n  view->base = backtrace_alloc (state, size, error_callback, data);\n  if (view->base == NULL)\n    return 0;\n  view->data = view->base;\n  view->len = size;\n\n  got = 0;\n  while (got < size)\n    {\n      r = read (descriptor, view->base, size - got);\n      if (r < 0)\n\t{\n\t  error_callback (data, \"read\", errno);\n\t  free (view->base);\n\t  return 0;\n\t}\n      if (r == 0)\n\tbreak;\n      got += (uint64_t) r;\n    }\n\n  if (got < size)\n    {\n      error_callback (data, \"file too short\", 0);\n      free (view->base);\n      return 0;\n    }\n\n  return 1;\n}\n\n/* Release a view read by backtrace_get_view.  */\n\nvoid\nbacktrace_release_view (struct backtrace_state *state,\n\t\t\tstruct backtrace_view *view,\n\t\t\tbacktrace_error_callback error_callback,\n\t\t\tvoid *data)\n{\n  backtrace_free (state, view->base, view->len, error_callback, data);\n  view->data = NULL;\n  view->base = NULL;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/sort.c",
    "content": "/* sort.c -- Sort without allocating memory\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <stddef.h>\n#include <sys/types.h>\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* The GNU glibc version of qsort allocates memory, which we must not\n   do if we are invoked by a signal handler.  So provide our own\n   sort.  */\n\nstatic void\nswap (char *a, char *b, size_t size)\n{\n  size_t i;\n\n  for (i = 0; i < size; i++, a++, b++)\n    {\n      char t;\n\n      t = *a;\n      *a = *b;\n      *b = t;\n    }\n}\n\nvoid\nbacktrace_qsort (void *basearg, size_t count, size_t size,\n\t\t int (*compar) (const void *, const void *))\n{\n  char *base = (char *) basearg;\n  size_t i;\n  size_t mid;\n\n tail_recurse:\n  if (count < 2)\n    return;\n\n  /* The symbol table and DWARF tables, which is all we use this\n     routine for, tend to be roughly sorted.  Pick the middle element\n     in the array as our pivot point, so that we are more likely to\n     cut the array in half for each recursion step.  */\n  swap (base, base + (count / 2) * size, size);\n\n  mid = 0;\n  for (i = 1; i < count; i++)\n    {\n      if ((*compar) (base, base + i * size) > 0)\n\t{\n\t  ++mid;\n\t  if (i != mid)\n\t    swap (base + mid * size, base + i * size, size);\n\t}\n    }\n\n  if (mid > 0)\n    swap (base, base + mid * size, size);\n\n  /* Recurse with the smaller array, loop with the larger one.  That\n     ensures that our maximum stack depth is log count.  */\n  if (2 * mid < count)\n    {\n      backtrace_qsort (base, mid, size, compar);\n      base += (mid + 1) * size;\n      count -= mid + 1;\n      goto tail_recurse;\n    }\n  else\n    {\n      backtrace_qsort (base + (mid + 1) * size, count - (mid + 1),\n\t\t       size, compar);\n      count = mid;\n      goto tail_recurse;\n    }\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/state.c",
    "content": "/* state.c -- Create the backtrace state.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Written by Ian Lance Taylor, Google.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <string.h>\n#include <sys/types.h>\n\n#include \"backtrace/backtrace.h\"\n#include \"backtrace/backtrace-supported.h\"\n#include \"backtrace/internal.h\"\n\n/* Create the backtrace state.  This will then be passed to all the\n   other routines.  */\n\nstruct backtrace_state *\nbacktrace_create_state (const char *filename, int threaded,\n\t\t\tbacktrace_error_callback error_callback,\n\t\t\tvoid *data)\n{\n  struct backtrace_state init_state;\n  struct backtrace_state *state;\n\n#ifndef HAVE_SYNC_FUNCTIONS\n  if (threaded)\n    {\n      error_callback (data, \"backtrace library does not support threads\", 0);\n      return NULL;\n    }\n#endif\n\n  memset (&init_state, 0, sizeof init_state);\n  init_state.filename = filename;\n  init_state.threaded = threaded;\n\n  state = ((struct backtrace_state *)\n\t   backtrace_alloc (&init_state, sizeof *state, error_callback, data));\n  if (state == NULL)\n    return NULL;\n  *state = init_state;\n\n  return state;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/libbacktrace/backtrace/xcoff.c",
    "content": "/* xcoff.c -- Get debug data from an XCOFF file for backtraces.\n   Copyright (C) 2012-2021 Free Software Foundation, Inc.\n   Adapted from elf.c.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    (1) Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    (2) Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    (3) The name of the author may not be used to\n    endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.  */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n#ifdef HAVE_LOADQUERY\n#include <sys/ldr.h>\n#endif\n\n#include \"backtrace.h\"\n#include \"internal.h\"\n\n/* The configure script must tell us whether we are 32-bit or 64-bit\n   XCOFF.  We could make this code test and support either possibility,\n   but there is no point.  This code only works for the currently\n   running executable, which means that we know the XCOFF mode at\n   configure time.  */\n\n#if BACKTRACE_XCOFF_SIZE != 32 && BACKTRACE_XCOFF_SIZE != 64\n#error \"Unknown BACKTRACE_XCOFF_SIZE\"\n#endif\n\n/* XCOFF file header.  */\n\n#if BACKTRACE_XCOFF_SIZE == 32\n\ntypedef struct {\n  uint16_t f_magic;\n  uint16_t f_nscns;\n  uint32_t f_timdat;\n  uint32_t f_symptr;\n  uint32_t f_nsyms;\n  uint16_t f_opthdr;\n  uint16_t f_flags;\n} b_xcoff_filhdr;\n\n#define XCOFF_MAGIC\t0737\n\n#else /* BACKTRACE_XCOFF_SIZE != 32 */\n\ntypedef struct {\n  uint16_t f_magic;\n  uint16_t f_nscns;\n  uint32_t f_timdat;\n  uint64_t f_symptr;\n  uint16_t f_opthdr;\n  uint16_t f_flags;\n  uint32_t f_nsyms;\n} b_xcoff_filhdr;\n\n#define XCOFF_MAGIC\t0767\n\n#endif /* BACKTRACE_XCOFF_SIZE != 32 */\n\n#define F_SHROBJ\t0x2000\t/* File is a shared object.  */\n\n/* XCOFF section header.  */\n\n#if BACKTRACE_XCOFF_SIZE == 32\n\ntypedef struct {\n  char s_name[8];\n  uint32_t s_paddr;\n  uint32_t s_vaddr;\n  uint32_t s_size;\n  uint32_t s_scnptr;\n  uint32_t s_relptr;\n  uint32_t s_lnnoptr;\n  uint16_t s_nreloc;\n  uint16_t s_nlnno;\n  uint32_t s_flags;\n} b_xcoff_scnhdr;\n\n#define _OVERFLOW_MARKER\t65535\n\n#else /* BACKTRACE_XCOFF_SIZE != 32 */\n\ntypedef struct {\n  char name[8];\n  uint64_t s_paddr;\n  uint64_t s_vaddr;\n  uint64_t s_size;\n  uint64_t s_scnptr;\n  uint64_t s_relptr;\n  uint64_t s_lnnoptr;\n  uint32_t s_nreloc;\n  uint32_t s_nlnno;\n  uint32_t s_flags;\n} b_xcoff_scnhdr;\n\n#endif /* BACKTRACE_XCOFF_SIZE != 32 */\n\n#define STYP_DWARF\t0x10\t/* DWARF debugging section.  */\n#define STYP_TEXT\t0x20\t/* Executable text (code) section.  */\n#define STYP_OVRFLO\t0x8000\t/* Line-number field overflow section.  */\n\n#define SSUBTYP_DWINFO\t0x10000\t/* DWARF info section.  */\n#define SSUBTYP_DWLINE\t0x20000\t/* DWARF line-number section.  */\n#define SSUBTYP_DWARNGE\t0x50000\t/* DWARF aranges section.  */\n#define SSUBTYP_DWABREV\t0x60000\t/* DWARF abbreviation section.  */\n#define SSUBTYP_DWSTR\t0x70000\t/* DWARF strings section.  */\n\n/* XCOFF symbol.  */\n\n#define SYMNMLEN\t8\n\n#if BACKTRACE_XCOFF_SIZE == 32\n\ntypedef struct {\n  union {\n    char _name[SYMNMLEN];\n    struct {\n      uint32_t _zeroes;\n      uint32_t _offset;\n    } _s;\n  } _u;\n#define n_name\t\t_u._name\n#define n_zeroes\t_u._s._zeroes\n#define n_offset_\t_u._s._offset\n\n  uint32_t n_value;\n  int16_t  n_scnum;\n  uint16_t n_type;\n  uint8_t  n_sclass;\n  uint8_t  n_numaux;\n} __attribute__ ((packed)) b_xcoff_syment;\n\n#else /* BACKTRACE_XCOFF_SIZE != 32 */\n\ntypedef struct {\n  uint64_t n_value;\n  uint32_t n_offset_;\n  int16_t  n_scnum;\n  uint16_t n_type;\n  uint8_t  n_sclass;\n  uint8_t  n_numaux;\n} __attribute__ ((packed)) b_xcoff_syment;\n\n#endif /* BACKTRACE_XCOFF_SIZE != 32 */\n\n#define SYMESZ\t18\n\n#define C_EXT\t\t2\t/* External symbol.  */\n#define C_FCN\t\t101\t/* Beginning or end of function.  */\n#define C_FILE\t\t103\t/* Source file name.  */\n#define C_HIDEXT\t107\t/* Unnamed external symbol.  */\n#define C_BINCL\t\t108\t/* Beginning of include file.  */\n#define C_EINCL\t\t109\t/* End of include file.  */\n#define C_WEAKEXT\t111\t/* Weak external symbol.  */\n\n#define ISFCN(x)\t((x) & 0x0020)\n\n/* XCOFF AUX entry.  */\n\n#define AUXESZ\t\t18\n#define FILNMLEN\t14\n\ntypedef union {\n#if BACKTRACE_XCOFF_SIZE == 32\n  struct {\n    uint16_t pad;\n    uint16_t x_lnnohi;\n    uint16_t x_lnno;\n  } x_block;\n#else\n  struct {\n    uint32_t x_lnno;\n  } x_block;\n#endif\n  union {\n    char x_fname[FILNMLEN];\n    struct {\n      uint32_t x_zeroes;\n      uint32_t x_offset;\n      char     pad[FILNMLEN-8];\n      uint8_t  x_ftype;\n    } _x;\n  } x_file;\n#if BACKTRACE_XCOFF_SIZE == 32\n  struct {\n    uint32_t x_exptr;\n    uint32_t x_fsize;\n    uint32_t x_lnnoptr;\n    uint32_t x_endndx;\n  } x_fcn;\n#else\n  struct {\n    uint64_t x_lnnoptr;\n    uint32_t x_fsize;\n    uint32_t x_endndx;\n  } x_fcn;\n#endif\n  struct {\n    uint8_t pad[AUXESZ-1];\n    uint8_t x_auxtype;\n  } x_auxtype;\n} __attribute__ ((packed)) b_xcoff_auxent;\n\n/* XCOFF line number entry.  */\n\n#if BACKTRACE_XCOFF_SIZE == 32\n\ntypedef struct {\n  union {\n    uint32_t l_symndx;\n    uint32_t l_paddr;\n  } l_addr;\n  uint16_t l_lnno;\n} b_xcoff_lineno;\n\n#define LINESZ\t6\n\n#else /* BACKTRACE_XCOFF_SIZE != 32 */\n\ntypedef struct {\n  union {\n    uint32_t l_symndx;\n    uint64_t l_paddr;\n  } l_addr;\n  uint32_t l_lnno;\n} b_xcoff_lineno;\n\n#define LINESZ\t12\n\n#endif /* BACKTRACE_XCOFF_SIZE != 32 */\n\n#if BACKTRACE_XCOFF_SIZE == 32\n#define XCOFF_AIX_TEXTBASE\t0x10000000u\n#else\n#define XCOFF_AIX_TEXTBASE\t0x100000000ul\n#endif\n\n/* AIX big archive fixed-length header.  */\n\n#define AIAMAGBIG\t\"<bigaf>\\n\"\n\ntypedef struct {\n  char fl_magic[8];\t/* Archive magic string.  */\n  char fl_memoff[20];\t/* Offset to member table.  */\n  char fl_gstoff[20];\t/* Offset to global symbol table.  */\n  char fl_gst64off[20];\t/* Offset to global symbol table for 64-bit objects.  */\n  char fl_fstmoff[20];\t/* Offset to first archive member.  */\n  char fl_freeoff[20];\t/* Offset to first member on free list.  */\n} b_ar_fl_hdr;\n\n/* AIX big archive file member header.  */\n\ntypedef struct {\n  char ar_size[20];\t/* File member size - decimal.  */\n  char ar_nxtmem[20];\t/* Next member offset - decimal.  */\n  char ar_prvmem[20];\t/* Previous member offset - decimal.  */\n  char ar_date[12];\t/* File member date - decimal.  */\n  char ar_uid[12];\t/* File member userid - decimal.  */\n  char ar_gid[12];\t/* File member group id - decimal.  */\n  char ar_mode[12];\t/* File member mode - octal.  */\n  char ar_namlen[4];\t/* File member name length - decimal.  */\n  char ar_name[2];\t/* Start of member name.  */\n} b_ar_hdr;\n\n\n/* Information we keep for an XCOFF symbol.  */\n\nstruct xcoff_symbol\n{\n  /* The name of the symbol.  */\n  const char *name;\n  /* The address of the symbol.  */\n  uintptr_t address;\n  /* The size of the symbol.  */\n  size_t size;\n};\n\n/* Information to pass to xcoff_syminfo.  */\n\nstruct xcoff_syminfo_data\n{\n  /* Symbols for the next module.  */\n  struct xcoff_syminfo_data *next;\n  /* The XCOFF symbols, sorted by address.  */\n  struct xcoff_symbol *symbols;\n  /* The number of symbols.  */\n  size_t count;\n};\n\n/* Information about an include file.  */\n\nstruct xcoff_incl\n{\n  /* File name.  */\n  const char *filename;\n  /* Offset to first line number from the include file.  */\n  uintptr_t begin;\n  /* Offset to last line number from the include file.  */\n  uintptr_t end;\n};\n\n/* A growable vector of include files information.  */\n\nstruct xcoff_incl_vector\n{\n  /* Memory.  This is an array of struct xcoff_incl.  */\n  struct backtrace_vector vec;\n  /* Number of include files.  */\n  size_t count;\n};\n\n/* A growable vector of functions information.  */\n\nstruct xcoff_func\n{\n  /* PC.  */\n  uintptr_t pc;\n  /* The size of the function.  */\n  size_t size;\n  /* Function name.  */\n  const char *name;\n  /* File name.  */\n  const char *filename;\n  /* Pointer to first lnno entry.  */\n  uintptr_t lnnoptr;\n  /* Base address of containing section.  */\n  uintptr_t sect_base;\n  /* Starting source line number.  */\n  int lnno;\n};\n\n/* A growable vector of function information.  This is used while\n   reading the function symbols.  */\n\nstruct xcoff_func_vector\n{\n  /* Memory.  This is an array of struct xcoff_func.  */\n  struct backtrace_vector vec;\n  /* Number of valid mappings.  */\n  size_t count;\n};\n\n/* The information we need to map a PC to a file and line.  */\n\nstruct xcoff_fileline_data\n{\n  /* The data for the next file we know about.  */\n  struct xcoff_fileline_data *next;\n  /* Functions information.  */\n  struct xcoff_func_vector func_vec;\n  /* Include files information.  */\n  struct xcoff_incl_vector incl_vec;\n  /* Line numbers information.  */\n  const unsigned char *linenos;\n  size_t linenos_size;\n  uint64_t lnnoptr0;\n  /* Loader address.  */\n  uintptr_t base_address;\n};\n\n/* Information we gather for the DWARF sections we care about.  */\n\nstruct dwsect_info\n{\n  /* Section file offset.  */\n  off_t offset;\n  /* Section size.  */\n  size_t size;\n  /* Section contents, after read from file.  */\n  const unsigned char *data;\n};\n\n/* A dummy callback function used when we can't find any debug info.  */\n\nstatic int\nxcoff_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t       uintptr_t pc ATTRIBUTE_UNUSED,\n\t       backtrace_full_callback callback ATTRIBUTE_UNUSED,\n\t       backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no debug info in XCOFF executable\", -1);\n  return 0;\n}\n\n/* A dummy callback function used when we can't find a symbol\n   table.  */\n\nstatic void\nxcoff_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t      uintptr_t addr ATTRIBUTE_UNUSED,\n\t      backtrace_syminfo_callback callback ATTRIBUTE_UNUSED,\n\t      backtrace_error_callback error_callback, void *data)\n{\n  error_callback (data, \"no symbol table in XCOFF executable\", -1);\n}\n\n/* Compare struct xcoff_symbol for qsort.  */\n\nstatic int\nxcoff_symbol_compare (const void *v1, const void *v2)\n{\n  const struct xcoff_symbol *e1 = (const struct xcoff_symbol *) v1;\n  const struct xcoff_symbol *e2 = (const struct xcoff_symbol *) v2;\n\n  if (e1->address < e2->address)\n    return -1;\n  else if (e1->address > e2->address)\n    return 1;\n  else\n    return 0;\n}\n\n/* Compare an ADDR against an xcoff_symbol for bsearch.  */\n\nstatic int\nxcoff_symbol_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct xcoff_symbol *entry = (const struct xcoff_symbol *) ventry;\n  uintptr_t addr;\n\n  addr = *key;\n  if (addr < entry->address)\n    return -1;\n  else if ((entry->size == 0 && addr > entry->address)\n\t   || (entry->size > 0 && addr >= entry->address + entry->size))\n    return 1;\n  else\n    return 0;\n}\n\n/* Add XDATA to the list in STATE.  */\n\nstatic void\nxcoff_add_syminfo_data (struct backtrace_state *state,\n\t\t\tstruct xcoff_syminfo_data *xdata)\n{\n  if (!state->threaded)\n    {\n      struct xcoff_syminfo_data **pp;\n\n      for (pp = (struct xcoff_syminfo_data **) (void *) &state->syminfo_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = xdata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct xcoff_syminfo_data **pp;\n\n\t  pp = (struct xcoff_syminfo_data **) (void *) &state->syminfo_data;\n\n\t  while (1)\n\t    {\n\t      struct xcoff_syminfo_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, xdata))\n\t    break;\n\t}\n    }\n}\n\n/* Return the symbol name and value for an ADDR.  */\n\nstatic void\nxcoff_syminfo (struct backtrace_state *state ATTRIBUTE_UNUSED, uintptr_t addr,\n\t       backtrace_syminfo_callback callback,\n\t       backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t       void *data)\n{\n  struct xcoff_syminfo_data *edata;\n  struct xcoff_symbol *sym = NULL;\n  const char *name;\n\n  if (!state->threaded)\n    {\n      for (edata = (struct xcoff_syminfo_data *) state->syminfo_data;\n\t   edata != NULL;\n\t   edata = edata->next)\n\t{\n\t  sym = ((struct xcoff_symbol *)\n\t\t bsearch (&addr, edata->symbols, edata->count,\n\t\t\t  sizeof (struct xcoff_symbol), xcoff_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\t}\n    }\n  else\n    {\n      struct xcoff_syminfo_data **pp;\n\n      pp = (struct xcoff_syminfo_data **) (void *) &state->syminfo_data;\n      while (1)\n\t{\n\t  edata = backtrace_atomic_load_pointer (pp);\n\t  if (edata == NULL)\n\t    break;\n\n\t  sym = ((struct xcoff_symbol *)\n\t\t bsearch (&addr, edata->symbols, edata->count,\n\t\t\t  sizeof (struct xcoff_symbol), xcoff_symbol_search));\n\t  if (sym != NULL)\n\t    break;\n\n\t  pp = &edata->next;\n\t}\n    }\n\n  if (sym == NULL)\n    callback (data, addr, NULL, 0, 0);\n  else\n    {\n      name = sym->name;\n      /* AIX prepends a '.' to function entry points, remove it.  */\n      if (name && *name == '.')\n\t++name;\n      callback (data, addr, name, sym->address, sym->size);\n    }\n}\n\n/* Return the name of an XCOFF symbol.  */\n\nstatic const char *\nxcoff_symname (const b_xcoff_syment *asym,\n\t       const unsigned char *strtab, size_t strtab_size)\n{\n#if BACKTRACE_XCOFF_SIZE == 32\n  if (asym->n_zeroes != 0)\n    {\n      /* Make a copy as we will release the symtab view.  */\n      char name[SYMNMLEN+1];\n      strncpy (name, asym->n_name, SYMNMLEN);\n      name[SYMNMLEN] = '\\0';\n      return strdup (name);\n    }\n#endif\n  if (asym->n_sclass & 0x80)\n    return NULL; /* .debug */\n  if (asym->n_offset_ >= strtab_size)\n    return NULL;\n  return (const char *) strtab + asym->n_offset_;\n}\n\n/* Initialize the symbol table info for xcoff_syminfo.  */\n\nstatic int\nxcoff_initialize_syminfo (struct backtrace_state *state,\n\t\t\t  uintptr_t base_address,\n\t\t\t  const b_xcoff_scnhdr *sects,\n\t\t\t  const b_xcoff_syment *syms, size_t nsyms,\n\t\t\t  const unsigned char *strtab, size_t strtab_size,\n\t\t\t  backtrace_error_callback error_callback, void *data,\n\t\t\t  struct xcoff_syminfo_data *sdata)\n{\n  size_t xcoff_symbol_count;\n  size_t xcoff_symbol_size;\n  struct xcoff_symbol *xcoff_symbols;\n  size_t i;\n  unsigned int j;\n\n  /* We only care about function symbols.  Count them.  */\n  xcoff_symbol_count = 0;\n  for (i = 0; i < nsyms; ++i)\n    {\n      const b_xcoff_syment *asym = &syms[i];\n      if ((asym->n_sclass == C_EXT || asym->n_sclass == C_HIDEXT\n\t    || asym->n_sclass == C_WEAKEXT)\n\t  && ISFCN (asym->n_type) && asym->n_numaux > 0 && asym->n_scnum > 0)\n\t++xcoff_symbol_count;\n\n      i += asym->n_numaux;\n    }\n\n  xcoff_symbol_size = xcoff_symbol_count * sizeof (struct xcoff_symbol);\n  xcoff_symbols = ((struct xcoff_symbol *)\n\t\t   backtrace_alloc (state, xcoff_symbol_size, error_callback,\n\t\t\t\t    data));\n  if (xcoff_symbols == NULL)\n    return 0;\n\n  j = 0;\n  for (i = 0; i < nsyms; ++i)\n    {\n      const b_xcoff_syment *asym = &syms[i];\n      if ((asym->n_sclass == C_EXT || asym->n_sclass == C_HIDEXT\n\t    || asym->n_sclass == C_WEAKEXT)\n\t  && ISFCN (asym->n_type) && asym->n_numaux > 0 && asym->n_scnum > 0)\n\t{\n\t  const b_xcoff_auxent *aux = (const b_xcoff_auxent *) (asym + 1);\n\t  xcoff_symbols[j].name = xcoff_symname (asym, strtab, strtab_size);\n\t  xcoff_symbols[j].address = base_address + asym->n_value\n\t\t\t\t   - sects[asym->n_scnum - 1].s_paddr;\n\t  /* x_fsize will be 0 if there is no debug information.  */\n\t  xcoff_symbols[j].size = aux->x_fcn.x_fsize;\n\t  ++j;\n\t}\n\n      i += asym->n_numaux;\n    }\n\n  backtrace_qsort (xcoff_symbols, xcoff_symbol_count,\n\t\t   sizeof (struct xcoff_symbol), xcoff_symbol_compare);\n\n  sdata->next = NULL;\n  sdata->symbols = xcoff_symbols;\n  sdata->count = xcoff_symbol_count;\n\n  return 1;\n}\n\n/* Compare struct xcoff_func for qsort.  */\n\nstatic int\nxcoff_func_compare (const void *v1, const void *v2)\n{\n  const struct xcoff_func *fn1 = (const struct xcoff_func *) v1;\n  const struct xcoff_func *fn2 = (const struct xcoff_func *) v2;\n\n  if (fn1->pc < fn2->pc)\n    return -1;\n  else if (fn1->pc > fn2->pc)\n    return 1;\n  else\n    return 0;\n}\n\n/* Compare a PC against an xcoff_func for bsearch.  */\n\nstatic int\nxcoff_func_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct xcoff_func *entry = (const struct xcoff_func *) ventry;\n  uintptr_t pc;\n\n  pc = *key;\n  if (pc < entry->pc)\n    return -1;\n  else if ((entry->size == 0 && pc > entry->pc)\n\t   || (entry->size > 0 && pc >= entry->pc + entry->size))\n    return 1;\n  else\n    return 0;\n}\n\n/* Compare struct xcoff_incl for qsort.  */\n\nstatic int\nxcoff_incl_compare (const void *v1, const void *v2)\n{\n  const struct xcoff_incl *in1 = (const struct xcoff_incl *) v1;\n  const struct xcoff_incl *in2 = (const struct xcoff_incl *) v2;\n\n  if (in1->begin < in2->begin)\n    return -1;\n  else if (in1->begin > in2->begin)\n    return 1;\n  else\n    return 0;\n}\n\n/* Find a lnnoptr in an include file.  */\n\nstatic int\nxcoff_incl_search (const void *vkey, const void *ventry)\n{\n  const uintptr_t *key = (const uintptr_t *) vkey;\n  const struct xcoff_incl *entry = (const struct xcoff_incl *) ventry;\n  uintptr_t lnno;\n\n  lnno = *key;\n  if (lnno < entry->begin)\n    return -1;\n  else if (lnno > entry->end)\n    return 1;\n  else\n    return 0;\n}\n\n/* Look for a PC in the function vector for one module.  On success,\n   call CALLBACK and return whatever it returns.  On error, call\n   ERROR_CALLBACK and return 0.  Sets *FOUND to 1 if the PC is found,\n   0 if not.  */\n\nstatic int\nxcoff_lookup_pc (struct backtrace_state *state ATTRIBUTE_UNUSED,\n\t\t struct xcoff_fileline_data *fdata, uintptr_t pc,\n\t\t backtrace_full_callback callback,\n\t\t backtrace_error_callback error_callback ATTRIBUTE_UNUSED,\n\t\t void *data, int *found)\n{\n  const struct xcoff_incl *incl, *bincl;\n  const struct xcoff_func *fn;\n  const b_xcoff_lineno *lineno;\n  const unsigned char *lineptr;\n  const char *function;\n  const char *filename;\n  uintptr_t lnnoptr, match;\n  uint32_t lnno = 0;\n\n  *found = 1;\n\n  if ((pc & 3) != 0)\n    ++pc;\n\n  /* Find the function first.  */\n  fn = ((struct xcoff_func *)\n\tbsearch (&pc, fdata->func_vec.vec.base, fdata->func_vec.count,\n\t\t sizeof (struct xcoff_func), xcoff_func_search));\n  if (fn == NULL)\n    {\n      *found = 0;\n      return 0;\n    }\n\n  filename = fn->filename;\n\n  /* Find the line number next.  */\n\n  /* Skip first entry that points to symtab.  */\n  lnnoptr = fn->lnnoptr + LINESZ;\n  match = lnnoptr;\n\n  lineptr = fdata->linenos + (lnnoptr - fdata->lnnoptr0);\n  while (lineptr + LINESZ <= fdata->linenos + fdata->linenos_size)\n    {\n      lineno = (const b_xcoff_lineno *) lineptr;\n      if (lineno->l_lnno == 0)\n\tbreak;\n      if (pc <= fdata->base_address + lineno->l_addr.l_paddr - fn->sect_base)\n\tbreak;\n      match = lnnoptr;\n      lnno = lineno->l_lnno;\n\n      lnnoptr += LINESZ;\n      lineptr += LINESZ;\n    }\n\n  /* If part of a function other than the beginning comes from an\n     include file, the line numbers are absolute, rather than\n     relative to the beginning of the function.  */\n  incl = ((struct xcoff_incl *)\n\t  bsearch (&match, fdata->incl_vec.vec.base,\n\t\t   fdata->incl_vec.count, sizeof (struct xcoff_incl),\n\t\t   xcoff_incl_search));\n  if (incl != NULL)\n    {\n      bincl = ((struct xcoff_incl *)\n\t       bsearch (&fn->lnnoptr, fdata->incl_vec.vec.base,\n\t\t\tfdata->incl_vec.count, sizeof (struct xcoff_incl),\n\t\t\txcoff_incl_search));\n      if (bincl != NULL && strcmp (incl->filename, bincl->filename) == 0)\n\t{\n\t  lnno += fn->lnno - 1;\n\t}\n      filename = incl->filename;\n    }\n  else\n    {\n      lnno += fn->lnno - 1;\n    }\n\n  function = fn->name;\n  /* AIX prepends a '.' to function entry points, remove it.  */\n  if (function != NULL && *function == '.')\n    ++function;\n  return callback (data, pc, filename, lnno, function);\n}\n\n/* Return the file/line information for a PC using the XCOFF lineno\n   mapping we built earlier.  */\n\nstatic int\nxcoff_fileline (struct backtrace_state *state, uintptr_t pc,\n\t\tbacktrace_full_callback callback,\n\t\tbacktrace_error_callback error_callback, void *data)\n\n{\n  struct xcoff_fileline_data *fdata;\n  int found;\n  int ret;\n\n  if (!state->threaded)\n    {\n      for (fdata = (struct xcoff_fileline_data *) state->fileline_data;\n\t   fdata != NULL;\n\t   fdata = fdata->next)\n\t{\n\t  ret = xcoff_lookup_pc (state, fdata, pc, callback, error_callback,\n\t\t\t\t data, &found);\n\t  if (ret != 0 || found)\n\t    return ret;\n\t}\n    }\n  else\n    {\n      struct xcoff_fileline_data **pp;\n\n      pp = (struct xcoff_fileline_data **) (void *) &state->fileline_data;\n      while (1)\n\t{\n\t  fdata = backtrace_atomic_load_pointer (pp);\n\t  if (fdata == NULL)\n\t    break;\n\n\t  ret = xcoff_lookup_pc (state, fdata, pc, callback, error_callback,\n\t\t\t\t data, &found);\n\t  if (ret != 0 || found)\n\t    return ret;\n\n\t  pp = &fdata->next;\n\t}\n    }\n\n  /* FIXME: See if any libraries have been dlopen'ed.  */\n\n  return callback (data, pc, NULL, 0, NULL);\n}\n\n/* Initialize the function vector info for xcoff_fileline.  */\n\nstatic int\nxcoff_initialize_fileline (struct backtrace_state *state,\n\t\t\t   uintptr_t base_address,\n\t\t\t   const b_xcoff_scnhdr *sects,\n\t\t\t   const b_xcoff_syment *syms, size_t nsyms,\n\t\t\t   const unsigned char *strtab, size_t strtab_size,\n\t\t\t   const unsigned char *linenos, size_t linenos_size,\n\t\t\t   uint64_t lnnoptr0,\n\t\t\t   backtrace_error_callback error_callback, void *data)\n{\n  struct xcoff_fileline_data *fdata;\n  struct xcoff_func *fn;\n  const b_xcoff_syment *fsym;\n  const b_xcoff_auxent *aux;\n  const char *filename;\n  const char *name;\n  struct xcoff_incl *incl;\n  uintptr_t begin, end;\n  uintptr_t lnno, lnnoptr;\n  uint32_t fsize;\n  size_t i;\n\n  fdata = ((struct xcoff_fileline_data *)\n\t   backtrace_alloc (state, sizeof (struct xcoff_fileline_data),\n\t\t\t    error_callback, data));\n  if (fdata == NULL)\n    return 0;\n  memset (fdata, 0, sizeof *fdata);\n  fdata->base_address = base_address;\n  fdata->linenos = linenos;\n  fdata->linenos_size = linenos_size;\n  fdata->lnnoptr0 = lnnoptr0;\n\n  begin = 0;\n  filename = NULL;\n  fsym = NULL;\n  lnnoptr = 0;\n  fsize = 0;\n  for (i = 0; i < nsyms; ++i)\n    {\n      const b_xcoff_syment *asym = &syms[i];\n\n      switch (asym->n_sclass)\n\t{\n\t  case C_BINCL:\n\t    begin = asym->n_value;\n\t    break;\n\n\t  case C_EINCL:\n\t    if (begin == 0)\n\t      break;\n\t    end = asym->n_value;\n\t    incl = ((struct xcoff_incl *)\n\t\t    backtrace_vector_grow (state, sizeof (struct xcoff_incl),\n\t\t\t\t\t   error_callback, data,\n\t\t\t\t\t   &fdata->incl_vec.vec));\n\t    if (incl != NULL)\n\t      {\n\t\tincl->filename = xcoff_symname (asym, strtab, strtab_size);\n\t\tincl->begin = begin;\n\t\tincl->end = end;\n\t\t++fdata->incl_vec.count;\n\t      }\n\t    begin = 0;\n\t    break;\n\n\t  case C_FILE:\n\t    filename = xcoff_symname (asym, strtab, strtab_size);\n\t    if (filename == NULL)\n\t      break;\n\n\t    /* If the file auxiliary entry is not used, the symbol name is\n\t       the name of the source file. If the file auxiliary entry is\n\t       used, then the symbol name should be .file, and the first\n\t       file auxiliary entry (by convention) contains the source\n\t       file name.  */\n\n\t    if (asym->n_numaux > 0 && strcmp (filename, \".file\") == 0)\n\t      {\n\t\taux = (const b_xcoff_auxent *) (asym + 1);\n\t\tif (aux->x_file._x.x_zeroes != 0)\n\t\t  {\n\t\t    /* Make a copy as we will release the symtab view.  */\n\t\t    char name[FILNMLEN+1];\n\t\t    strncpy (name, aux->x_file.x_fname, FILNMLEN);\n\t\t    name[FILNMLEN] = '\\0';\n\t\t    filename = strdup (name);\n\t\t  }\n\t\telse if (aux->x_file._x.x_offset < strtab_size)\n\t\t  filename = (const char *) strtab + aux->x_file._x.x_offset;\n\t\telse\n\t\t  filename = NULL;\n\t      }\n\t    break;\n\n\t  case C_EXT:\n\t  case C_HIDEXT:\n\t  case C_WEAKEXT:\n\t    fsym = NULL;\n\t    lnnoptr = 0;\n\t    fsize = 0;\n\t    if (!ISFCN (asym->n_type) || asym->n_numaux == 0\n\t\t|| asym->n_scnum <= 0)\n\t      break;\n\t    if (filename == NULL)\n\t      break;\n\t    aux = (const b_xcoff_auxent *) (asym + 1);\n\t    lnnoptr = aux->x_fcn.x_lnnoptr;\n\t    if (lnnoptr < lnnoptr0\n\t\t|| lnnoptr + LINESZ > lnnoptr0 + linenos_size)\n\t      break;\n\t    /* x_fsize will be 0 if there is no debug information.  */\n\t    fsize = aux->x_fcn.x_fsize;\n\t    fsym = asym;\n\t    break;\n\n\t  case C_FCN:\n\t    if (asym->n_numaux == 0)\n\t      break;\n\t    if (fsym == NULL)\n\t      break;\n\t    name = xcoff_symname (asym, strtab, strtab_size);\n\t    if (name == NULL || strcmp (name, \".bf\") != 0)\n\t      {\n\t\tfsym = NULL;\n\t\tbreak;\n\t      }\n\t    aux = (const b_xcoff_auxent *) (asym + 1);\n#if BACKTRACE_XCOFF_SIZE == 32\n\t    lnno = (uint32_t) aux->x_block.x_lnnohi << 16\n\t\t | aux->x_block.x_lnno;\n#else\n\t    lnno = aux->x_block.x_lnno;\n#endif\n\t    fn = ((struct xcoff_func *)\n\t\t  backtrace_vector_grow (state, sizeof (struct xcoff_func),\n\t\t\t\t\t error_callback, data,\n\t\t\t\t\t &fdata->func_vec.vec));\n\t    if (fn == NULL)\n\t      break;\n\t    fn->name = xcoff_symname (fsym, strtab, strtab_size);\n\t    fn->filename = filename;\n\t    fn->sect_base = sects[fsym->n_scnum - 1].s_paddr;\n\t    fn->pc = base_address + fsym->n_value - fn->sect_base;\n\t    fn->size = fsize;\n\t    fn->lnno = lnno;\n\t    fn->lnnoptr = lnnoptr;\n\t    ++fdata->func_vec.count;\n\t    break;\n\t}\n\n      i += asym->n_numaux;\n    }\n\n  if (!backtrace_vector_release (state, &fdata->func_vec.vec, error_callback,\n\t\t\t\t data))\n    goto fail;\n  backtrace_qsort (fdata->func_vec.vec.base, fdata->func_vec.count,\n\t\t   sizeof (struct xcoff_func), xcoff_func_compare);\n\n  if (!backtrace_vector_release (state, &fdata->incl_vec.vec, error_callback,\n\t\t\t\t data))\n    goto fail;\n  backtrace_qsort (fdata->incl_vec.vec.base, fdata->incl_vec.count,\n\t\t   sizeof (struct xcoff_incl), xcoff_incl_compare);\n\n  if (!state->threaded)\n    {\n      struct xcoff_fileline_data **pp;\n\n      for (pp = (struct xcoff_fileline_data **) (void *) &state->fileline_data;\n\t   *pp != NULL;\n\t   pp = &(*pp)->next)\n\t;\n      *pp = fdata;\n    }\n  else\n    {\n      while (1)\n\t{\n\t  struct xcoff_fileline_data **pp;\n\n\t  pp = (struct xcoff_fileline_data **) (void *) &state->fileline_data;\n\n\t  while (1)\n\t    {\n\t      struct xcoff_fileline_data *p;\n\n\t      p = backtrace_atomic_load_pointer (pp);\n\n\t      if (p == NULL)\n\t\tbreak;\n\n\t      pp = &p->next;\n\t    }\n\n\t  if (__sync_bool_compare_and_swap (pp, NULL, fdata))\n\t    break;\n\t}\n    }\n\n  return 1;\n\nfail:\n  return 0;\n}\n\n/* Add the backtrace data for one XCOFF file.  Returns 1 on success,\n   0 on failure (in both cases descriptor is closed).  */\n\nstatic int\nxcoff_add (struct backtrace_state *state, int descriptor, off_t offset,\n\t   uintptr_t base_address, backtrace_error_callback error_callback,\n\t   void *data, fileline *fileline_fn, int *found_sym, int exe)\n{\n  struct backtrace_view fhdr_view;\n  struct backtrace_view sects_view;\n  struct backtrace_view linenos_view;\n  struct backtrace_view syms_view;\n  struct backtrace_view str_view;\n  struct backtrace_view dwarf_view;\n  b_xcoff_filhdr fhdr;\n  const b_xcoff_scnhdr *sects;\n  const b_xcoff_scnhdr *stext;\n  uint64_t lnnoptr;\n  uint32_t nlnno;\n  off_t str_off;\n  off_t min_offset;\n  off_t max_offset;\n  struct dwsect_info dwsect[DEBUG_MAX];\n  size_t sects_size;\n  size_t syms_size;\n  int32_t str_size;\n  int sects_view_valid;\n  int linenos_view_valid;\n  int syms_view_valid;\n  int str_view_valid;\n  int dwarf_view_valid;\n  int magic_ok;\n  int i;\n  struct dwarf_sections dwarf_sections;\n\n  *found_sym = 0;\n\n  sects_view_valid = 0;\n  linenos_view_valid = 0;\n  syms_view_valid = 0;\n  str_view_valid = 0;\n  dwarf_view_valid = 0;\n\n  str_size = 0;\n\n  /* Map the XCOFF file header.  */\n  if (!backtrace_get_view (state, descriptor, offset, sizeof (b_xcoff_filhdr),\n\t\t\t   error_callback, data, &fhdr_view))\n    goto fail;\n\n  memcpy (&fhdr, fhdr_view.data, sizeof fhdr);\n  magic_ok = (fhdr.f_magic == XCOFF_MAGIC);\n\n  backtrace_release_view (state, &fhdr_view, error_callback, data);\n\n  if (!magic_ok)\n    {\n      if (exe)\n\terror_callback (data, \"executable file is not XCOFF\", 0);\n      goto fail;\n    }\n\n  /* Verify object is of expected type.  */\n  if ((exe && (fhdr.f_flags & F_SHROBJ))\n      || (!exe && !(fhdr.f_flags & F_SHROBJ)))\n    goto fail;\n\n  /* Read the section headers.  */\n\n  sects_size = fhdr.f_nscns * sizeof (b_xcoff_scnhdr);\n\n  if (!backtrace_get_view (state, descriptor,\n\t\t\t   offset + sizeof (fhdr) + fhdr.f_opthdr,\n\t\t\t   sects_size, error_callback, data, &sects_view))\n    goto fail;\n  sects_view_valid = 1;\n  sects = (const b_xcoff_scnhdr *) sects_view.data;\n\n  /* FIXME: assumes only one .text section.  */\n  for (i = 0; i < fhdr.f_nscns; ++i)\n    if ((sects[i].s_flags & 0xffff) == STYP_TEXT)\n      break;\n  if (i == fhdr.f_nscns)\n    goto fail;\n\n  stext = &sects[i];\n\n  /* AIX ldinfo_textorg includes the XCOFF headers.  */\n  base_address = (exe ? XCOFF_AIX_TEXTBASE : base_address) + stext->s_scnptr;\n\n  lnnoptr = stext->s_lnnoptr;\n  nlnno = stext->s_nlnno;\n\n#if BACKTRACE_XCOFF_SIZE == 32\n  if (nlnno == _OVERFLOW_MARKER)\n    {\n      int sntext = i + 1;\n      /* Find the matching .ovrflo section.  */\n      for (i = 0; i < fhdr.f_nscns; ++i)\n\t{\n\t  if (((sects[i].s_flags & 0xffff) == STYP_OVRFLO)\n\t      && sects[i].s_nlnno == sntext)\n\t    {\n\t      nlnno = sects[i].s_vaddr;\n\t      break;\n\t    }\n\t}\n    }\n#endif\n\n  /* Read the symbol table and the string table.  */\n\n  if (fhdr.f_symptr != 0)\n    {\n      struct xcoff_syminfo_data *sdata;\n\n      /* Symbol table is followed by the string table.  The string table\n\t starts with its length (on 4 bytes).\n\t Map the symbol table and the length of the string table.  */\n      syms_size = fhdr.f_nsyms * sizeof (b_xcoff_syment);\n\n      if (!backtrace_get_view (state, descriptor, offset + fhdr.f_symptr,\n\t\t\t       syms_size + 4, error_callback, data,\n\t\t\t       &syms_view))\n\tgoto fail;\n      syms_view_valid = 1;\n\n      memcpy (&str_size, syms_view.data + syms_size, 4);\n\n      str_off = fhdr.f_symptr + syms_size;\n\n      if (str_size > 4)\n\t{\n\t  /* Map string table (including the length word).  */\n\n\t  if (!backtrace_get_view (state, descriptor, offset + str_off,\n\t\t\t\t   str_size, error_callback, data, &str_view))\n\t    goto fail;\n\t  str_view_valid = 1;\n\t}\n\n      sdata = ((struct xcoff_syminfo_data *)\n\t       backtrace_alloc (state, sizeof *sdata, error_callback, data));\n      if (sdata == NULL)\n\tgoto fail;\n\n      if (!xcoff_initialize_syminfo (state, base_address, sects,\n\t\t\t\t     syms_view.data, fhdr.f_nsyms,\n\t\t\t\t     str_view.data, str_size,\n\t\t\t\t     error_callback, data, sdata))\n\t{\n\t  backtrace_free (state, sdata, sizeof *sdata, error_callback, data);\n\t  goto fail;\n\t}\n\n      *found_sym = 1;\n\n      xcoff_add_syminfo_data (state, sdata);\n    }\n\n  /* Read all the DWARF sections in a single view, since they are\n     probably adjacent in the file.  We never release this view.  */\n\n  min_offset = 0;\n  max_offset = 0;\n  memset (dwsect, 0, sizeof dwsect);\n  for (i = 0; i < fhdr.f_nscns; ++i)\n    {\n      off_t end;\n      int idx;\n\n      if ((sects[i].s_flags & 0xffff) != STYP_DWARF\n\t  || sects[i].s_size == 0)\n\tcontinue;\n      /* Map DWARF section to array index.  */\n      switch (sects[i].s_flags & 0xffff0000)\n\t{\n\t  case SSUBTYP_DWINFO:\n\t    idx = DEBUG_INFO;\n\t    break;\n\t  case SSUBTYP_DWLINE:\n\t    idx = DEBUG_LINE;\n\t    break;\n\t  case SSUBTYP_DWABREV:\n\t    idx = DEBUG_ABBREV;\n\t    break;\n\t  case SSUBTYP_DWARNGE:\n\t    idx = DEBUG_RANGES;\n\t    break;\n\t  case SSUBTYP_DWSTR:\n\t    idx = DEBUG_STR;\n\t    break;\n\t  default:\n\t    continue;\n\t}\n      if (min_offset == 0 || (off_t) sects[i].s_scnptr < min_offset)\n\tmin_offset = sects[i].s_scnptr;\n      end = sects[i].s_scnptr + sects[i].s_size;\n      if (end > max_offset)\n\tmax_offset = end;\n      dwsect[idx].offset = sects[i].s_scnptr;\n      dwsect[idx].size = sects[i].s_size;\n    }\n  if (min_offset != 0 && max_offset != 0)\n    {\n      if (!backtrace_get_view (state, descriptor, offset + min_offset,\n\t\t\t       max_offset - min_offset,\n\t\t\t       error_callback, data, &dwarf_view))\n\tgoto fail;\n      dwarf_view_valid = 1;\n\n      for (i = 0; i < (int) DEBUG_MAX; ++i)\n\t{\n\t  if (dwsect[i].offset == 0)\n\t    dwsect[i].data = NULL;\n\t  else\n\t    dwsect[i].data = ((const unsigned char *) dwarf_view.data\n\t\t\t      + (dwsect[i].offset - min_offset));\n\t}\n\n      memset (&dwarf_sections, 0, sizeof dwarf_sections);\n\n      dwarf_sections.data[DEBUG_INFO] = dwsect[DEBUG_INFO].data;\n      dwarf_sections.size[DEBUG_INFO] = dwsect[DEBUG_INFO].size;\n#if BACKTRACE_XCOFF_SIZE == 32\n      /* XXX workaround for broken lineoff */\n      dwarf_sections.data[DEBUG_LINE] = dwsect[DEBUG_LINE].data - 4;\n#else\n      /* XXX workaround for broken lineoff */\n      dwarf_sections.data[DEBUG_LINE] = dwsect[DEBUG_LINE].data - 12;\n#endif\n      dwarf_sections.size[DEBUG_LINE] = dwsect[DEBUG_LINE].size;\n      dwarf_sections.data[DEBUG_ABBREV] = dwsect[DEBUG_ABBREV].data;\n      dwarf_sections.size[DEBUG_ABBREV] = dwsect[DEBUG_ABBREV].size;\n      dwarf_sections.data[DEBUG_RANGES] = dwsect[DEBUG_RANGES].data;\n      dwarf_sections.size[DEBUG_RANGES] = dwsect[DEBUG_RANGES].size;\n      dwarf_sections.data[DEBUG_STR] = dwsect[DEBUG_STR].data;\n      dwarf_sections.size[DEBUG_STR] = dwsect[DEBUG_STR].size;\n\n      if (!backtrace_dwarf_add (state, 0, &dwarf_sections,\n\t\t\t\t1, /* big endian */\n\t\t\t\tNULL, /* altlink */\n\t\t\t\terror_callback, data, fileline_fn,\n\t\t\t\tNULL /* returned fileline_entry */))\n\tgoto fail;\n    }\n\n  /* Read the XCOFF line number entries if DWARF sections not found.  */\n\n  if (!dwarf_view_valid && fhdr.f_symptr != 0 && lnnoptr != 0)\n    {\n      size_t linenos_size = (size_t) nlnno * LINESZ;\n\n      /* We never release this view.  */\n      if (!backtrace_get_view (state, descriptor, offset + lnnoptr,\n\t\t\t       linenos_size,\n\t\t\t       error_callback, data, &linenos_view))\n\tgoto fail;\n      linenos_view_valid = 1;\n\n      if (xcoff_initialize_fileline (state, base_address, sects,\n\t\t\t\t     syms_view.data, fhdr.f_nsyms,\n\t\t\t\t     str_view.data, str_size,\n\t\t\t\t     linenos_view.data, linenos_size,\n\t\t\t\t     lnnoptr, error_callback, data))\n\t*fileline_fn = xcoff_fileline;\n    }\n\n  backtrace_release_view (state, &sects_view, error_callback, data);\n  sects_view_valid = 0;\n  if (syms_view_valid)\n    backtrace_release_view (state, &syms_view, error_callback, data);\n  syms_view_valid = 0;\n\n  /* We've read all we need from the executable.  */\n  if (!backtrace_close (descriptor, error_callback, data))\n    goto fail;\n  descriptor = -1;\n\n  return 1;\n\n fail:\n  if (sects_view_valid)\n    backtrace_release_view (state, &sects_view, error_callback, data);\n  if (str_view_valid)\n    backtrace_release_view (state, &str_view, error_callback, data);\n  if (syms_view_valid)\n    backtrace_release_view (state, &syms_view, error_callback, data);\n  if (linenos_view_valid)\n    backtrace_release_view (state, &linenos_view, error_callback, data);\n  if (dwarf_view_valid)\n    backtrace_release_view (state, &dwarf_view, error_callback, data);\n  if (descriptor != -1 && offset == 0)\n    backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n#ifdef HAVE_LOADQUERY\n\n/* Read an integer value in human-readable format from an AIX\n   big archive fixed-length or member header.  */\n\nstatic int\nxcoff_parse_decimal (const char *buf, size_t size, off_t *off)\n{\n  char str[32];\n  char *end;\n\n  if (size >= sizeof str)\n    return 0;\n  memcpy (str, buf, size);\n  str[size] = '\\0';\n  *off = strtol (str, &end, 10);\n  if (*end != '\\0' && *end != ' ')\n    return 0;\n\n  return 1;\n}\n\n/* Add the backtrace data for a member of an AIX big archive.\n   Returns 1 on success, 0 on failure.  */\n\nstatic int\nxcoff_armem_add (struct backtrace_state *state, int descriptor,\n\t\t uintptr_t base_address, const char *member,\n\t\t backtrace_error_callback error_callback, void *data,\n\t\t fileline *fileline_fn, int *found_sym)\n{\n  struct backtrace_view view;\n  b_ar_fl_hdr fl_hdr;\n  const b_ar_hdr *ar_hdr;\n  off_t off;\n  off_t len;\n  int memlen;\n\n  *found_sym = 0;\n\n  /* Map archive fixed-length header.  */\n\n  if (!backtrace_get_view (state, descriptor, 0, sizeof (b_ar_fl_hdr),\n\t\t\t   error_callback, data, &view))\n    goto fail;\n\n  memcpy (&fl_hdr, view.data, sizeof (b_ar_fl_hdr));\n\n  backtrace_release_view (state, &view, error_callback, data);\n\n  if (memcmp (fl_hdr.fl_magic, AIAMAGBIG, 8) != 0)\n    goto fail;\n\n  memlen = strlen (member);\n\n  /* Read offset of first archive member.  */\n  if (!xcoff_parse_decimal (fl_hdr.fl_fstmoff, sizeof fl_hdr.fl_fstmoff, &off))\n    goto fail;\n  while (off != 0)\n    {\n      /* Map archive member header and member name.  */\n\n      if (!backtrace_get_view (state, descriptor, off,\n\t\t\t       sizeof (b_ar_hdr) + memlen,\n\t\t\t       error_callback, data, &view))\n\tbreak;\n\n      ar_hdr = (const b_ar_hdr *) view.data;\n\n      /* Read archive member name length.  */\n      if (!xcoff_parse_decimal (ar_hdr->ar_namlen, sizeof ar_hdr->ar_namlen,\n\t\t\t\t&len))\n\t{\n\t  backtrace_release_view (state, &view, error_callback, data);\n\t  break;\n\t}\n      if (len == memlen && !memcmp (ar_hdr->ar_name, member, memlen))\n\t{\n\t  off = (off + sizeof (b_ar_hdr) + memlen + 1) & ~1;\n\n\t  /* The archive can contain several members with the same name\n\t     (e.g. 32-bit and 64-bit), so continue if not ok.  */\n\n\t  if (xcoff_add (state, descriptor, off, base_address, error_callback,\n\t\t\t data, fileline_fn, found_sym, 0))\n\t    {\n\t      backtrace_release_view (state, &view, error_callback, data);\n\t      return 1;\n\t    }\n\t}\n\n      /* Read offset of next archive member.  */\n      if (!xcoff_parse_decimal (ar_hdr->ar_nxtmem, sizeof ar_hdr->ar_nxtmem,\n\t\t\t\t&off))\n\t{\n\t  backtrace_release_view (state, &view, error_callback, data);\n\t  break;\n\t}\n      backtrace_release_view (state, &view, error_callback, data);\n    }\n\n fail:\n  /* No matching member found.  */\n  backtrace_close (descriptor, error_callback, data);\n  return 0;\n}\n\n/* Add the backtrace data for dynamically loaded libraries.  */\n\nstatic void\nxcoff_add_shared_libs (struct backtrace_state *state,\n\t\t       backtrace_error_callback error_callback,\n\t\t       void *data, fileline *fileline_fn, int *found_sym)\n{\n  const struct ld_info *ldinfo;\n  void *buf;\n  unsigned int buflen;\n  const char *member;\n  int descriptor;\n  int does_not_exist;\n  int lib_found_sym;\n  int ret;\n\n  /* Retrieve the list of loaded libraries.  */\n\n  buf = NULL;\n  buflen = 512;\n  do\n    {\n      buf = realloc (buf, buflen);\n      if (buf == NULL)\n\t{\n\t  ret = -1;\n\t  break;\n\t}\n      ret = loadquery (L_GETINFO, buf, buflen);\n      if (ret == 0)\n\tbreak;\n      buflen *= 2;\n    }\n  while (ret == -1 && errno == ENOMEM);\n  if (ret != 0)\n    {\n      free (buf);\n      return;\n    }\n\n  ldinfo = (const struct ld_info *) buf;\n  while ((const char *) ldinfo < (const char *) buf + buflen)\n    {\n      if (*ldinfo->ldinfo_filename != '/')\n\tgoto next;\n\n      descriptor = backtrace_open (ldinfo->ldinfo_filename, error_callback,\n\t\t\t\t   data, &does_not_exist);\n      if (descriptor < 0)\n\tgoto next;\n\n      /* Check if it is an archive (member name not empty).  */\n\n      member = ldinfo->ldinfo_filename + strlen (ldinfo->ldinfo_filename) + 1;\n      if (*member)\n\t{\n\t  xcoff_armem_add (state, descriptor,\n\t\t\t   (uintptr_t) ldinfo->ldinfo_textorg, member,\n\t\t\t   error_callback, data, fileline_fn, &lib_found_sym);\n\t}\n      else\n\t{\n\t  xcoff_add (state, descriptor, 0, (uintptr_t) ldinfo->ldinfo_textorg,\n\t\t     error_callback, data, fileline_fn, &lib_found_sym, 0);\n\t}\n      if (lib_found_sym)\n\t*found_sym = 1;\n\n next:\n      if (ldinfo->ldinfo_next == 0)\n\tbreak;\n      ldinfo = (const struct ld_info *) ((const char *) ldinfo\n\t\t\t\t\t + ldinfo->ldinfo_next);\n    }\n\n    free (buf);\n}\n#endif /* HAVE_LOADQUERY */\n\n/* Initialize the backtrace data we need from an XCOFF executable.\n   Returns 1 on success, 0 on failure.  */\n\nint\nbacktrace_initialize (struct backtrace_state *state,\n\t\t      const char *filename ATTRIBUTE_UNUSED, int descriptor,\n\t\t      backtrace_error_callback error_callback,\n\t\t      void *data, fileline *fileline_fn)\n{\n  int ret;\n  int found_sym;\n  fileline xcoff_fileline_fn = xcoff_nodebug;\n\n  ret = xcoff_add (state, descriptor, 0, 0, error_callback, data,\n\t\t   &xcoff_fileline_fn, &found_sym, 1);\n  if (!ret)\n    return 0;\n\n#ifdef HAVE_LOADQUERY\n  xcoff_add_shared_libs (state, error_callback, data, &xcoff_fileline_fn,\n\t\t\t &found_sym);\n#endif\n\n  if (!state->threaded)\n    {\n      if (found_sym)\n\tstate->syminfo_fn = xcoff_syminfo;\n      else if (state->syminfo_fn == NULL)\n\tstate->syminfo_fn = xcoff_nosyms;\n    }\n  else\n    {\n      if (found_sym)\n\tbacktrace_atomic_store_pointer (&state->syminfo_fn, xcoff_syminfo);\n      else\n\t(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,\n\t\t\t\t\t     xcoff_nosyms);\n    }\n\n  if (!state->threaded)\n    {\n      if (state->fileline_fn == NULL || state->fileline_fn == xcoff_nodebug)\n\t*fileline_fn = xcoff_fileline_fn;\n    }\n  else\n    {\n      fileline current_fn;\n\n      current_fn = backtrace_atomic_load_pointer (&state->fileline_fn);\n      if (current_fn == NULL || current_fn == xcoff_nodebug)\n\t*fileline_fn = xcoff_fileline_fn;\n    }\n\n  return 1;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/markupsafe/LICENSE.rst",
    "content": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n#. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n#. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n\n#. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nmarkupsafe\n~~~~~~~~~~\n\nImplements an escape function and a Markup string to replace HTML\nspecial characters with safe representations.\n\n:copyright: 2010 Pallets\n:license: BSD-3-Clause\n\"\"\"\nimport re\nimport string\n\nfrom ._compat import int_types\nfrom ._compat import iteritems\nfrom ._compat import Mapping\nfrom ._compat import PY2\nfrom ._compat import string_types\nfrom ._compat import text_type\nfrom ._compat import unichr\n\n__version__ = \"1.1.1\"\n\n__all__ = [\"Markup\", \"soft_unicode\", \"escape\", \"escape_silent\"]\n\n_striptags_re = re.compile(r\"(<!--.*?-->|<[^>]*>)\")\n_entity_re = re.compile(r\"&([^& ;]+);\")\n\n\nclass Markup(text_type):\n    \"\"\"A string that is ready to be safely inserted into an HTML or XML\n    document, either because it was escaped or because it was marked\n    safe.\n\n    Passing an object to the constructor converts it to text and wraps\n    it to mark it safe without escaping. To escape the text, use the\n    :meth:`escape` class method instead.\n\n    >>> Markup('Hello, <em>World</em>!')\n    Markup('Hello, <em>World</em>!')\n    >>> Markup(42)\n    Markup('42')\n    >>> Markup.escape('Hello, <em>World</em>!')\n    Markup('Hello &lt;em&gt;World&lt;/em&gt;!')\n\n    This implements the ``__html__()`` interface that some frameworks\n    use. Passing an object that implements ``__html__()`` will wrap the\n    output of that method, marking it safe.\n\n    >>> class Foo:\n    ...     def __html__(self):\n    ...         return '<a href=\"/foo\">foo</a>'\n    ...\n    >>> Markup(Foo())\n    Markup('<a href=\"/foo\">foo</a>')\n\n    This is a subclass of the text type (``str`` in Python 3,\n    ``unicode`` in Python 2). It has the same methods as that type, but\n    all methods escape their arguments and return a ``Markup`` instance.\n\n    >>> Markup('<em>%s</em>') % 'foo & bar'\n    Markup('<em>foo &amp; bar</em>')\n    >>> Markup('<em>Hello</em> ') + '<foo>'\n    Markup('<em>Hello</em> &lt;foo&gt;')\n    \"\"\"\n\n    __slots__ = ()\n\n    def __new__(cls, base=u\"\", encoding=None, errors=\"strict\"):\n        if hasattr(base, \"__html__\"):\n            base = base.__html__()\n        if encoding is None:\n            return text_type.__new__(cls, base)\n        return text_type.__new__(cls, base, encoding, errors)\n\n    def __html__(self):\n        return self\n\n    def __add__(self, other):\n        if isinstance(other, string_types) or hasattr(other, \"__html__\"):\n            return self.__class__(super(Markup, self).__add__(self.escape(other)))\n        return NotImplemented\n\n    def __radd__(self, other):\n        if hasattr(other, \"__html__\") or isinstance(other, string_types):\n            return self.escape(other).__add__(self)\n        return NotImplemented\n\n    def __mul__(self, num):\n        if isinstance(num, int_types):\n            return self.__class__(text_type.__mul__(self, num))\n        return NotImplemented\n\n    __rmul__ = __mul__\n\n    def __mod__(self, arg):\n        if isinstance(arg, tuple):\n            arg = tuple(_MarkupEscapeHelper(x, self.escape) for x in arg)\n        else:\n            arg = _MarkupEscapeHelper(arg, self.escape)\n        return self.__class__(text_type.__mod__(self, arg))\n\n    def __repr__(self):\n        return \"%s(%s)\" % (self.__class__.__name__, text_type.__repr__(self))\n\n    def join(self, seq):\n        return self.__class__(text_type.join(self, map(self.escape, seq)))\n\n    join.__doc__ = text_type.join.__doc__\n\n    def split(self, *args, **kwargs):\n        return list(map(self.__class__, text_type.split(self, *args, **kwargs)))\n\n    split.__doc__ = text_type.split.__doc__\n\n    def rsplit(self, *args, **kwargs):\n        return list(map(self.__class__, text_type.rsplit(self, *args, **kwargs)))\n\n    rsplit.__doc__ = text_type.rsplit.__doc__\n\n    def splitlines(self, *args, **kwargs):\n        return list(map(self.__class__, text_type.splitlines(self, *args, **kwargs)))\n\n    splitlines.__doc__ = text_type.splitlines.__doc__\n\n    def unescape(self):\n        \"\"\"Convert escaped markup back into a text string. This replaces\n        HTML entities with the characters they represent.\n\n        >>> Markup('Main &raquo; <em>About</em>').unescape()\n        'Main » <em>About</em>'\n        \"\"\"\n        from ._constants import HTML_ENTITIES\n\n        def handle_match(m):\n            name = m.group(1)\n            if name in HTML_ENTITIES:\n                return unichr(HTML_ENTITIES[name])\n            try:\n                if name[:2] in (\"#x\", \"#X\"):\n                    return unichr(int(name[2:], 16))\n                elif name.startswith(\"#\"):\n                    return unichr(int(name[1:]))\n            except ValueError:\n                pass\n            # Don't modify unexpected input.\n            return m.group()\n\n        return _entity_re.sub(handle_match, text_type(self))\n\n    def striptags(self):\n        \"\"\":meth:`unescape` the markup, remove tags, and normalize\n        whitespace to single spaces.\n\n        >>> Markup('Main &raquo;\\t<em>About</em>').striptags()\n        'Main » About'\n        \"\"\"\n        stripped = u\" \".join(_striptags_re.sub(\"\", self).split())\n        return Markup(stripped).unescape()\n\n    @classmethod\n    def escape(cls, s):\n        \"\"\"Escape a string. Calls :func:`escape` and ensures that for\n        subclasses the correct type is returned.\n        \"\"\"\n        rv = escape(s)\n        if rv.__class__ is not cls:\n            return cls(rv)\n        return rv\n\n    def make_simple_escaping_wrapper(name):  # noqa: B902\n        orig = getattr(text_type, name)\n\n        def func(self, *args, **kwargs):\n            args = _escape_argspec(list(args), enumerate(args), self.escape)\n            _escape_argspec(kwargs, iteritems(kwargs), self.escape)\n            return self.__class__(orig(self, *args, **kwargs))\n\n        func.__name__ = orig.__name__\n        func.__doc__ = orig.__doc__\n        return func\n\n    for method in (\n        \"__getitem__\",\n        \"capitalize\",\n        \"title\",\n        \"lower\",\n        \"upper\",\n        \"replace\",\n        \"ljust\",\n        \"rjust\",\n        \"lstrip\",\n        \"rstrip\",\n        \"center\",\n        \"strip\",\n        \"translate\",\n        \"expandtabs\",\n        \"swapcase\",\n        \"zfill\",\n    ):\n        locals()[method] = make_simple_escaping_wrapper(method)\n\n    def partition(self, sep):\n        return tuple(map(self.__class__, text_type.partition(self, self.escape(sep))))\n\n    def rpartition(self, sep):\n        return tuple(map(self.__class__, text_type.rpartition(self, self.escape(sep))))\n\n    def format(self, *args, **kwargs):\n        formatter = EscapeFormatter(self.escape)\n        kwargs = _MagicFormatMapping(args, kwargs)\n        return self.__class__(formatter.vformat(self, args, kwargs))\n\n    def __html_format__(self, format_spec):\n        if format_spec:\n            raise ValueError(\"Unsupported format specification \" \"for Markup.\")\n        return self\n\n    # not in python 3\n    if hasattr(text_type, \"__getslice__\"):\n        __getslice__ = make_simple_escaping_wrapper(\"__getslice__\")\n\n    del method, make_simple_escaping_wrapper\n\n\nclass _MagicFormatMapping(Mapping):\n    \"\"\"This class implements a dummy wrapper to fix a bug in the Python\n    standard library for string formatting.\n\n    See http://bugs.python.org/issue13598 for information about why\n    this is necessary.\n    \"\"\"\n\n    def __init__(self, args, kwargs):\n        self._args = args\n        self._kwargs = kwargs\n        self._last_index = 0\n\n    def __getitem__(self, key):\n        if key == \"\":\n            idx = self._last_index\n            self._last_index += 1\n            try:\n                return self._args[idx]\n            except LookupError:\n                pass\n            key = str(idx)\n        return self._kwargs[key]\n\n    def __iter__(self):\n        return iter(self._kwargs)\n\n    def __len__(self):\n        return len(self._kwargs)\n\n\nif hasattr(text_type, \"format\"):\n\n    class EscapeFormatter(string.Formatter):\n        def __init__(self, escape):\n            self.escape = escape\n\n        def format_field(self, value, format_spec):\n            if hasattr(value, \"__html_format__\"):\n                rv = value.__html_format__(format_spec)\n            elif hasattr(value, \"__html__\"):\n                if format_spec:\n                    raise ValueError(\n                        \"Format specifier {0} given, but {1} does not\"\n                        \" define __html_format__. A class that defines\"\n                        \" __html__ must define __html_format__ to work\"\n                        \" with format specifiers.\".format(format_spec, type(value))\n                    )\n                rv = value.__html__()\n            else:\n                # We need to make sure the format spec is unicode here as\n                # otherwise the wrong callback methods are invoked.  For\n                # instance a byte string there would invoke __str__ and\n                # not __unicode__.\n                rv = string.Formatter.format_field(self, value, text_type(format_spec))\n            return text_type(self.escape(rv))\n\n\ndef _escape_argspec(obj, iterable, escape):\n    \"\"\"Helper for various string-wrapped functions.\"\"\"\n    for key, value in iterable:\n        if hasattr(value, \"__html__\") or isinstance(value, string_types):\n            obj[key] = escape(value)\n    return obj\n\n\nclass _MarkupEscapeHelper(object):\n    \"\"\"Helper for Markup.__mod__\"\"\"\n\n    def __init__(self, obj, escape):\n        self.obj = obj\n        self.escape = escape\n\n    def __getitem__(self, item):\n        return _MarkupEscapeHelper(self.obj[item], self.escape)\n\n    def __str__(self):\n        return text_type(self.escape(self.obj))\n\n    __unicode__ = __str__\n\n    def __repr__(self):\n        return str(self.escape(repr(self.obj)))\n\n    def __int__(self):\n        return int(self.obj)\n\n    def __float__(self):\n        return float(self.obj)\n\n\n# we have to import it down here as the speedups and native\n# modules imports the markup type which is define above.\ntry:\n    from ._speedups import escape, escape_silent, soft_unicode\nexcept ImportError:\n    from ._native import escape, escape_silent, soft_unicode\n\nif not PY2:\n    soft_str = soft_unicode\n    __all__.append(\"soft_str\")\n"
  },
  {
    "path": "nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nmarkupsafe._compat\n~~~~~~~~~~~~~~~~~~\n\n:copyright: 2010 Pallets\n:license: BSD-3-Clause\n\"\"\"\nimport sys\n\nPY2 = sys.version_info[0] == 2\n\nif not PY2:\n    text_type = str\n    string_types = (str,)\n    unichr = chr\n    int_types = (int,)\n\n    def iteritems(x):\n        return iter(x.items())\n\n    from collections.abc import Mapping\n\nelse:\n    text_type = unicode\n    string_types = (str, unicode)\n    unichr = unichr\n    int_types = (int, long)\n\n    def iteritems(x):\n        return x.iteritems()\n\n    from collections import Mapping\n"
  },
  {
    "path": "nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nmarkupsafe._constants\n~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: 2010 Pallets\n:license: BSD-3-Clause\n\"\"\"\n\nHTML_ENTITIES = {\n    \"AElig\": 198,\n    \"Aacute\": 193,\n    \"Acirc\": 194,\n    \"Agrave\": 192,\n    \"Alpha\": 913,\n    \"Aring\": 197,\n    \"Atilde\": 195,\n    \"Auml\": 196,\n    \"Beta\": 914,\n    \"Ccedil\": 199,\n    \"Chi\": 935,\n    \"Dagger\": 8225,\n    \"Delta\": 916,\n    \"ETH\": 208,\n    \"Eacute\": 201,\n    \"Ecirc\": 202,\n    \"Egrave\": 200,\n    \"Epsilon\": 917,\n    \"Eta\": 919,\n    \"Euml\": 203,\n    \"Gamma\": 915,\n    \"Iacute\": 205,\n    \"Icirc\": 206,\n    \"Igrave\": 204,\n    \"Iota\": 921,\n    \"Iuml\": 207,\n    \"Kappa\": 922,\n    \"Lambda\": 923,\n    \"Mu\": 924,\n    \"Ntilde\": 209,\n    \"Nu\": 925,\n    \"OElig\": 338,\n    \"Oacute\": 211,\n    \"Ocirc\": 212,\n    \"Ograve\": 210,\n    \"Omega\": 937,\n    \"Omicron\": 927,\n    \"Oslash\": 216,\n    \"Otilde\": 213,\n    \"Ouml\": 214,\n    \"Phi\": 934,\n    \"Pi\": 928,\n    \"Prime\": 8243,\n    \"Psi\": 936,\n    \"Rho\": 929,\n    \"Scaron\": 352,\n    \"Sigma\": 931,\n    \"THORN\": 222,\n    \"Tau\": 932,\n    \"Theta\": 920,\n    \"Uacute\": 218,\n    \"Ucirc\": 219,\n    \"Ugrave\": 217,\n    \"Upsilon\": 933,\n    \"Uuml\": 220,\n    \"Xi\": 926,\n    \"Yacute\": 221,\n    \"Yuml\": 376,\n    \"Zeta\": 918,\n    \"aacute\": 225,\n    \"acirc\": 226,\n    \"acute\": 180,\n    \"aelig\": 230,\n    \"agrave\": 224,\n    \"alefsym\": 8501,\n    \"alpha\": 945,\n    \"amp\": 38,\n    \"and\": 8743,\n    \"ang\": 8736,\n    \"apos\": 39,\n    \"aring\": 229,\n    \"asymp\": 8776,\n    \"atilde\": 227,\n    \"auml\": 228,\n    \"bdquo\": 8222,\n    \"beta\": 946,\n    \"brvbar\": 166,\n    \"bull\": 8226,\n    \"cap\": 8745,\n    \"ccedil\": 231,\n    \"cedil\": 184,\n    \"cent\": 162,\n    \"chi\": 967,\n    \"circ\": 710,\n    \"clubs\": 9827,\n    \"cong\": 8773,\n    \"copy\": 169,\n    \"crarr\": 8629,\n    \"cup\": 8746,\n    \"curren\": 164,\n    \"dArr\": 8659,\n    \"dagger\": 8224,\n    \"darr\": 8595,\n    \"deg\": 176,\n    \"delta\": 948,\n    \"diams\": 9830,\n    \"divide\": 247,\n    \"eacute\": 233,\n    \"ecirc\": 234,\n    \"egrave\": 232,\n    \"empty\": 8709,\n    \"emsp\": 8195,\n    \"ensp\": 8194,\n    \"epsilon\": 949,\n    \"equiv\": 8801,\n    \"eta\": 951,\n    \"eth\": 240,\n    \"euml\": 235,\n    \"euro\": 8364,\n    \"exist\": 8707,\n    \"fnof\": 402,\n    \"forall\": 8704,\n    \"frac12\": 189,\n    \"frac14\": 188,\n    \"frac34\": 190,\n    \"frasl\": 8260,\n    \"gamma\": 947,\n    \"ge\": 8805,\n    \"gt\": 62,\n    \"hArr\": 8660,\n    \"harr\": 8596,\n    \"hearts\": 9829,\n    \"hellip\": 8230,\n    \"iacute\": 237,\n    \"icirc\": 238,\n    \"iexcl\": 161,\n    \"igrave\": 236,\n    \"image\": 8465,\n    \"infin\": 8734,\n    \"int\": 8747,\n    \"iota\": 953,\n    \"iquest\": 191,\n    \"isin\": 8712,\n    \"iuml\": 239,\n    \"kappa\": 954,\n    \"lArr\": 8656,\n    \"lambda\": 955,\n    \"lang\": 9001,\n    \"laquo\": 171,\n    \"larr\": 8592,\n    \"lceil\": 8968,\n    \"ldquo\": 8220,\n    \"le\": 8804,\n    \"lfloor\": 8970,\n    \"lowast\": 8727,\n    \"loz\": 9674,\n    \"lrm\": 8206,\n    \"lsaquo\": 8249,\n    \"lsquo\": 8216,\n    \"lt\": 60,\n    \"macr\": 175,\n    \"mdash\": 8212,\n    \"micro\": 181,\n    \"middot\": 183,\n    \"minus\": 8722,\n    \"mu\": 956,\n    \"nabla\": 8711,\n    \"nbsp\": 160,\n    \"ndash\": 8211,\n    \"ne\": 8800,\n    \"ni\": 8715,\n    \"not\": 172,\n    \"notin\": 8713,\n    \"nsub\": 8836,\n    \"ntilde\": 241,\n    \"nu\": 957,\n    \"oacute\": 243,\n    \"ocirc\": 244,\n    \"oelig\": 339,\n    \"ograve\": 242,\n    \"oline\": 8254,\n    \"omega\": 969,\n    \"omicron\": 959,\n    \"oplus\": 8853,\n    \"or\": 8744,\n    \"ordf\": 170,\n    \"ordm\": 186,\n    \"oslash\": 248,\n    \"otilde\": 245,\n    \"otimes\": 8855,\n    \"ouml\": 246,\n    \"para\": 182,\n    \"part\": 8706,\n    \"permil\": 8240,\n    \"perp\": 8869,\n    \"phi\": 966,\n    \"pi\": 960,\n    \"piv\": 982,\n    \"plusmn\": 177,\n    \"pound\": 163,\n    \"prime\": 8242,\n    \"prod\": 8719,\n    \"prop\": 8733,\n    \"psi\": 968,\n    \"quot\": 34,\n    \"rArr\": 8658,\n    \"radic\": 8730,\n    \"rang\": 9002,\n    \"raquo\": 187,\n    \"rarr\": 8594,\n    \"rceil\": 8969,\n    \"rdquo\": 8221,\n    \"real\": 8476,\n    \"reg\": 174,\n    \"rfloor\": 8971,\n    \"rho\": 961,\n    \"rlm\": 8207,\n    \"rsaquo\": 8250,\n    \"rsquo\": 8217,\n    \"sbquo\": 8218,\n    \"scaron\": 353,\n    \"sdot\": 8901,\n    \"sect\": 167,\n    \"shy\": 173,\n    \"sigma\": 963,\n    \"sigmaf\": 962,\n    \"sim\": 8764,\n    \"spades\": 9824,\n    \"sub\": 8834,\n    \"sube\": 8838,\n    \"sum\": 8721,\n    \"sup\": 8835,\n    \"sup1\": 185,\n    \"sup2\": 178,\n    \"sup3\": 179,\n    \"supe\": 8839,\n    \"szlig\": 223,\n    \"tau\": 964,\n    \"there4\": 8756,\n    \"theta\": 952,\n    \"thetasym\": 977,\n    \"thinsp\": 8201,\n    \"thorn\": 254,\n    \"tilde\": 732,\n    \"times\": 215,\n    \"trade\": 8482,\n    \"uArr\": 8657,\n    \"uacute\": 250,\n    \"uarr\": 8593,\n    \"ucirc\": 251,\n    \"ugrave\": 249,\n    \"uml\": 168,\n    \"upsih\": 978,\n    \"upsilon\": 965,\n    \"uuml\": 252,\n    \"weierp\": 8472,\n    \"xi\": 958,\n    \"yacute\": 253,\n    \"yen\": 165,\n    \"yuml\": 255,\n    \"zeta\": 950,\n    \"zwj\": 8205,\n    \"zwnj\": 8204,\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/markupsafe/markupsafe/_native.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nmarkupsafe._native\n~~~~~~~~~~~~~~~~~~\n\nNative Python implementation used when the C module is not compiled.\n\n:copyright: 2010 Pallets\n:license: BSD-3-Clause\n\"\"\"\nfrom . import Markup\nfrom ._compat import text_type\n\n\ndef escape(s):\n    \"\"\"Replace the characters ``&``, ``<``, ``>``, ``'``, and ``\"`` in\n    the string with HTML-safe sequences. Use this if you need to display\n    text that might contain such characters in HTML.\n\n    If the object has an ``__html__`` method, it is called and the\n    return value is assumed to already be safe for HTML.\n\n    :param s: An object to be converted to a string and escaped.\n    :return: A :class:`Markup` string with the escaped text.\n    \"\"\"\n    if hasattr(s, \"__html__\"):\n        return Markup(s.__html__())\n    return Markup(\n        text_type(s)\n        .replace(\"&\", \"&amp;\")\n        .replace(\">\", \"&gt;\")\n        .replace(\"<\", \"&lt;\")\n        .replace(\"'\", \"&#39;\")\n        .replace('\"', \"&#34;\")\n    )\n\n\ndef escape_silent(s):\n    \"\"\"Like :func:`escape` but treats ``None`` as the empty string.\n    Useful with optional values, as otherwise you get the string\n    ``'None'`` when the value is ``None``.\n\n    >>> escape(None)\n    Markup('None')\n    >>> escape_silent(None)\n    Markup('')\n    \"\"\"\n    if s is None:\n        return Markup()\n    return escape(s)\n\n\ndef soft_unicode(s):\n    \"\"\"Convert an object to a string if it isn't already. This preserves\n    a :class:`Markup` string rather than converting it back to a basic\n    string, so it will still be marked as safe and won't be escaped\n    again.\n\n    >>> value = escape('<User 1>')\n    >>> value\n    Markup('&lt;User 1&gt;')\n    >>> escape(str(value))\n    Markup('&amp;lt;User 1&amp;gt;')\n    >>> escape(soft_unicode(value))\n    Markup('&lt;User 1&gt;')\n    \"\"\"\n    if not isinstance(s, text_type):\n        s = text_type(s)\n    return s\n"
  },
  {
    "path": "nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py",
    "content": "# coding: utf-8\n\"\"\"\nPackage resource API\n--------------------\n\nA resource is a logical file contained within a package, or a logical\nsubdirectory thereof.  The package resource API expects resource names\nto have their path parts separated with ``/``, *not* whatever the local\npath separator is.  Do not use os.path operations to manipulate resource\nnames being passed into the API.\n\nThe package resource API is designed to work with normal filesystem packages,\n.egg files, and unpacked .egg files.  It can also work in a limited way with\n.zip files and with custom PEP 302 loaders that support the ``get_data()``\nmethod.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport sys\nimport os\nimport io\nimport time\nimport re\nimport types\nimport zipfile\nimport zipimport\nimport warnings\nimport stat\nimport functools\nimport pkgutil\nimport operator\nimport platform\nimport collections\nimport plistlib\nimport email.parser\nimport errno\nimport tempfile\nimport textwrap\nimport itertools\nimport inspect\nimport ntpath\nimport posixpath\nfrom pkgutil import get_importer\n\ntry:\n    import _imp\nexcept ImportError:\n    # Python 3.2 compatibility\n    import imp as _imp\n\ntry:\n    FileExistsError\nexcept NameError:\n    FileExistsError = OSError\n\n# Nuitka: Do not use six, we don't have these extern\n# packages included.\n# from pkg_resources.extern import six\n# from pkg_resources.extern.six.moves import urllib, map, filter\n\n# capture these to bypass sandboxing\nfrom os import utime\ntry:\n    from os import mkdir, rename, unlink\n    WRITE_SUPPORT = True\nexcept ImportError:\n    # no write support, probably under GAE\n    WRITE_SUPPORT = False\n\nfrom os import open as os_open\nfrom os.path import isdir, split\n\ntry:\n    import importlib.machinery as importlib_machinery\n    # access attribute to force import under delayed import mechanisms.\n    importlib_machinery.__name__\nexcept ImportError:\n    importlib_machinery = None\n\nfrom . import py31compat\n# Nuitka: Do not use extern, we don't have these extern\n# packages included.\n# from pkg_resources.extern import appdirs\n# from pkg_resources.extern import packaging\n# __import__('pkg_resources.extern.packaging.version')\n# __import__('pkg_resources.extern.packaging.specifiers')\n# __import__('pkg_resources.extern.packaging.requirements')\n# __import__('pkg_resources.extern.packaging.markers')\n\n\n\n__metaclass__ = type\n\n\n# Nuitka: For our Jinja2 purposes, 3.3 seems to work just fine.\nif (3, 0) < sys.version_info < (3, 3):\n    raise RuntimeError(\"Python 3.4 or later is required\")\n\nif str is bytes:\n    # Those builtin exceptions are only defined in Python 3\n    PermissionError = None\n    NotADirectoryError = None\n\n# declare some globals that will be defined later to\n# satisfy the linters.\nrequire = None\nworking_set = None\nadd_activation_listener = None\nresources_stream = None\ncleanup_resources = None\nresource_dir = None\nresource_stream = None\nset_extraction_path = None\nresource_isdir = None\nresource_string = None\niter_entry_points = None\nresource_listdir = None\nresource_filename = None\nresource_exists = None\n_distribution_finders = None\n_namespace_handlers = None\n_namespace_packages = None\n\n\nclass PEP440Warning(RuntimeWarning):\n    \"\"\"\n    Used when there is an issue with a version or specifier not complying with\n    PEP 440.\n    \"\"\"\n\n\ndef parse_version(v):\n    try:\n        return packaging.version.Version(v)\n    except packaging.version.InvalidVersion:\n        return packaging.version.LegacyVersion(v)\n\n\n_state_vars = {}\n\n\ndef _declare_state(vartype, **kw):\n    assert \"sys\" not in kw\n\n    globals().update(kw)\n    _state_vars.update(dict.fromkeys(kw, vartype))\n\n\ndef __getstate__():\n    state = {}\n    g = globals()\n    for k, v in _state_vars.items():\n        state[k] = g['_sget_' + v](g[k])\n    return state\n\n\ndef __setstate__(state):\n    g = globals()\n    for k, v in state.items():\n        g['_sset_' + _state_vars[k]](k, g[k], v)\n    return state\n\n\ndef _sget_dict(val):\n    return val.copy()\n\n\ndef _sset_dict(key, ob, state):\n    ob.clear()\n    ob.update(state)\n\n\ndef _sget_object(val):\n    return val.__getstate__()\n\n\ndef _sset_object(key, ob, state):\n    ob.__setstate__(state)\n\n\n_sget_none = _sset_none = lambda *args: None\n\n\ndef get_supported_platform():\n    \"\"\"Return this platform's maximum compatible version.\n\n    distutils.util.get_platform() normally reports the minimum version\n    of Mac OS X that would be required to *use* extensions produced by\n    distutils.  But what we want when checking compatibility is to know the\n    version of Mac OS X that we are *running*.  To allow usage of packages that\n    explicitly require a newer version of Mac OS X, we must also know the\n    current version of the OS.\n\n    If this condition occurs for any other platform with a version in its\n    platform strings, this function should be extended accordingly.\n    \"\"\"\n    plat = get_build_platform()\n    m = macosVersionString.match(plat)\n    if m is not None and sys.platform == \"darwin\":\n        try:\n            plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))\n        except ValueError:\n            # not Mac OS X\n            pass\n    return plat\n\n\n__all__ = [\n    # Basic resource access and distribution/entry point discovery\n    'require', 'run_script', 'get_provider', 'get_distribution',\n    'load_entry_point', 'get_entry_map', 'get_entry_info',\n    'iter_entry_points',\n    'resource_string', 'resource_stream', 'resource_filename',\n    'resource_listdir', 'resource_exists', 'resource_isdir',\n\n    # Environmental control\n    'declare_namespace', 'working_set', 'add_activation_listener',\n    'find_distributions', 'set_extraction_path', 'cleanup_resources',\n    'get_default_cache',\n\n    # Primary implementation classes\n    'Environment', 'WorkingSet', 'ResourceManager',\n    'Distribution', 'Requirement', 'EntryPoint',\n\n    # Exceptions\n    'ResolutionError', 'VersionConflict', 'DistributionNotFound',\n    'UnknownExtra', 'ExtractionError',\n\n    # Warnings\n    'PEP440Warning',\n\n    # Parsing functions and string utilities\n    'parse_requirements', 'parse_version', 'safe_name', 'safe_version',\n    'get_platform', 'compatible_platforms', 'yield_lines', 'split_sections',\n    'safe_extra', 'to_filename', 'invalid_marker', 'evaluate_marker',\n\n    # filesystem utilities\n    'ensure_directory', 'normalize_path',\n\n    # Distribution \"precedence\" constants\n    'EGG_DIST', 'BINARY_DIST', 'SOURCE_DIST', 'CHECKOUT_DIST', 'DEVELOP_DIST',\n\n    # \"Provider\" interfaces, implementations, and registration/lookup APIs\n    'IMetadataProvider', 'IResourceProvider', 'FileMetadata',\n    'PathMetadata', 'EggMetadata', 'EmptyProvider', 'empty_provider',\n    'NullProvider', 'EggProvider', 'DefaultProvider', 'ZipProvider',\n    'register_finder', 'register_namespace_handler', 'register_loader_type',\n    'fixup_namespace_packages', 'get_importer',\n\n    # Warnings\n    'PkgResourcesDeprecationWarning',\n\n    # Deprecated/backward compatibility only\n    'run_main', 'AvailableDistributions',\n]\n\n\nclass ResolutionError(Exception):\n    \"\"\"Abstract base for dependency resolution errors\"\"\"\n\n    def __repr__(self):\n        return self.__class__.__name__ + repr(self.args)\n\n\nclass VersionConflict(ResolutionError):\n    \"\"\"\n    An already-installed version conflicts with the requested version.\n\n    Should be initialized with the installed Distribution and the requested\n    Requirement.\n    \"\"\"\n\n    _template = \"{self.dist} is installed but {self.req} is required\"\n\n    @property\n    def dist(self):\n        return self.args[0]\n\n    @property\n    def req(self):\n        return self.args[1]\n\n    def report(self):\n        return self._template.format(**locals())\n\n    def with_context(self, required_by):\n        \"\"\"\n        If required_by is non-empty, return a version of self that is a\n        ContextualVersionConflict.\n        \"\"\"\n        if not required_by:\n            return self\n        args = self.args + (required_by,)\n        return ContextualVersionConflict(*args)\n\n\nclass ContextualVersionConflict(VersionConflict):\n    \"\"\"\n    A VersionConflict that accepts a third parameter, the set of the\n    requirements that required the installed Distribution.\n    \"\"\"\n\n    _template = VersionConflict._template + ' by {self.required_by}'\n\n    @property\n    def required_by(self):\n        return self.args[2]\n\n\nclass DistributionNotFound(ResolutionError):\n    \"\"\"A requested distribution was not found\"\"\"\n\n    _template = (\"The '{self.req}' distribution was not found \"\n                 \"and is required by {self.requirers_str}\")\n\n    @property\n    def req(self):\n        return self.args[0]\n\n    @property\n    def requirers(self):\n        return self.args[1]\n\n    @property\n    def requirers_str(self):\n        if not self.requirers:\n            return 'the application'\n        return ', '.join(self.requirers)\n\n    def report(self):\n        return self._template.format(**locals())\n\n    def __str__(self):\n        return self.report()\n\n\nclass UnknownExtra(ResolutionError):\n    \"\"\"Distribution doesn't have an \"extra feature\" of the given name\"\"\"\n\n\n_provider_factories = {}\n\n# Nuitka: That is to make it 2.6 compatible.\ntry:\n   PY_MAJOR = '{}.{}'.format(*sys.version_info)\nexcept ValueError:\n   PY_MAHOR = '2.6'\n\nEGG_DIST = 3\nBINARY_DIST = 2\nSOURCE_DIST = 1\nCHECKOUT_DIST = 0\nDEVELOP_DIST = -1\n\n\ndef register_loader_type(loader_type, provider_factory):\n    \"\"\"Register `provider_factory` to make providers for `loader_type`\n\n    `loader_type` is the type or class of a PEP 302 ``module.__loader__``,\n    and `provider_factory` is a function that, passed a *module* object,\n    returns an ``IResourceProvider`` for that module.\n    \"\"\"\n    _provider_factories[loader_type] = provider_factory\n\n\ndef get_provider(moduleOrReq):\n    \"\"\"Return an IResourceProvider for the named module or requirement\"\"\"\n    # Nuitka: We don't need that\n    # if isinstance(moduleOrReq, Requirement):\n    #     return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]\n\n    # Nuitka: No idea why, but something can erase the globals sys.\n    import sys\n    try:\n        module = sys.modules[moduleOrReq]\n    except KeyError:\n        __import__(moduleOrReq)\n        module = sys.modules[moduleOrReq]\n    except AttributeError:\n        # For debugging\n        print(sys)\n        raise\n    loader = getattr(module, '__loader__', None)\n    return _find_adapter(_provider_factories, loader)(module)\n\n\ndef _macosx_vers(_cache=[]):\n    if not _cache:\n        version = platform.mac_ver()[0]\n        # fallback for MacPorts\n        if version == '':\n            plist = '/System/Library/CoreServices/SystemVersion.plist'\n            if os.path.exists(plist):\n                if hasattr(plistlib, 'readPlist'):\n                    plist_content = plistlib.readPlist(plist)\n                    if 'ProductVersion' in plist_content:\n                        version = plist_content['ProductVersion']\n\n        _cache.append(version.split('.'))\n    return _cache[0]\n\n\ndef _macosx_arch(machine):\n    return {'PowerPC': 'ppc', 'Power_Macintosh': 'ppc'}.get(machine, machine)\n\n\ndef get_build_platform():\n    \"\"\"Return this platform's string for platform-specific distributions\n\n    XXX Currently this is the same as ``distutils.util.get_platform()``, but it\n    needs some hacks for Linux and Mac OS X.\n    \"\"\"\n    from sysconfig import get_platform\n\n    plat = get_platform()\n    if sys.platform == \"darwin\" and not plat.startswith('macosx-'):\n        try:\n            version = _macosx_vers()\n            machine = os.uname()[4].replace(\" \", \"_\")\n            return \"macosx-%d.%d-%s\" % (\n                int(version[0]), int(version[1]),\n                _macosx_arch(machine),\n            )\n        except ValueError:\n            # if someone is running a non-Mac darwin system, this will fall\n            # through to the default implementation\n            pass\n    return plat\n\n\nmacosVersionString = re.compile(r\"macosx-(\\d+)\\.(\\d+)-(.*)\")\ndarwinVersionString = re.compile(r\"darwin-(\\d+)\\.(\\d+)\\.(\\d+)-(.*)\")\n# XXX backward compat\nget_platform = get_build_platform\n\n\ndef compatible_platforms(provided, required):\n    \"\"\"Can code for the `provided` platform run on the `required` platform?\n\n    Returns true if either platform is ``None``, or the platforms are equal.\n\n    XXX Needs compatibility checks for Linux and other unixy OSes.\n    \"\"\"\n    if provided is None or required is None or provided == required:\n        # easy case\n        return True\n\n    # Mac OS X special cases\n    reqMac = macosVersionString.match(required)\n    if reqMac:\n        provMac = macosVersionString.match(provided)\n\n        # is this a Mac package?\n        if not provMac:\n            # this is backwards compatibility for packages built before\n            # setuptools 0.6. All packages built after this point will\n            # use the new macosx designation.\n            provDarwin = darwinVersionString.match(provided)\n            if provDarwin:\n                dversion = int(provDarwin.group(1))\n                macosversion = \"%s.%s\" % (reqMac.group(1), reqMac.group(2))\n                if dversion == 7 and macosversion >= \"10.3\" or \\\n                        dversion == 8 and macosversion >= \"10.4\":\n                    return True\n            # egg isn't macosx or legacy darwin\n            return False\n\n        # are they the same major version and machine type?\n        if provMac.group(1) != reqMac.group(1) or \\\n                provMac.group(3) != reqMac.group(3):\n            return False\n\n        # is the required OS major update >= the provided one?\n        if int(provMac.group(2)) > int(reqMac.group(2)):\n            return False\n\n        return True\n\n    # XXX Linux and other platforms' special cases should go here\n    return False\n\n\ndef run_script(dist_spec, script_name):\n    \"\"\"Locate distribution `dist_spec` and run its `script_name` script\"\"\"\n    # Nuitka: This seems to pollute globals\n    assert False\n\n    ns = sys._getframe(1).f_globals\n    name = ns['__name__']\n    ns.clear()\n    ns['__name__'] = name\n    require(dist_spec)[0].run_script(script_name, ns)\n\n\n# backward compatibility\nrun_main = run_script\n\n\ndef get_distribution(dist):\n    \"\"\"Return a current distribution object for a Requirement or string\"\"\"\n    if isinstance(dist, six.string_types):\n        dist = Requirement.parse(dist)\n    if isinstance(dist, Requirement):\n        dist = get_provider(dist)\n    if not isinstance(dist, Distribution):\n        raise TypeError(\"Expected string, Requirement, or Distribution\", dist)\n    return dist\n\n\ndef load_entry_point(dist, group, name):\n    \"\"\"Return `name` entry point of `group` for `dist` or raise ImportError\"\"\"\n    return get_distribution(dist).load_entry_point(group, name)\n\n\ndef get_entry_map(dist, group=None):\n    \"\"\"Return the entry point map for `group`, or the full entry map\"\"\"\n    return get_distribution(dist).get_entry_map(group)\n\n\ndef get_entry_info(dist, group, name):\n    \"\"\"Return the EntryPoint object for `group`+`name`, or ``None``\"\"\"\n    return get_distribution(dist).get_entry_info(group, name)\n\n\nclass IMetadataProvider:\n    def has_metadata(name):\n        \"\"\"Does the package's distribution contain the named metadata?\"\"\"\n\n    def get_metadata(name):\n        \"\"\"The named metadata resource as a string\"\"\"\n\n    def get_metadata_lines(name):\n        \"\"\"Yield named metadata resource as list of non-blank non-comment lines\n\n       Leading and trailing whitespace is stripped from each line, and lines\n       with ``#`` as the first non-blank character are omitted.\"\"\"\n\n    def metadata_isdir(name):\n        \"\"\"Is the named metadata a directory?  (like ``os.path.isdir()``)\"\"\"\n\n    def metadata_listdir(name):\n        \"\"\"List of metadata names in the directory (like ``os.listdir()``)\"\"\"\n\n    def run_script(script_name, namespace):\n        \"\"\"Execute the named script in the supplied namespace dictionary\"\"\"\n\n\nclass IResourceProvider(IMetadataProvider):\n    \"\"\"An object that provides access to package resources\"\"\"\n\n    def get_resource_filename(manager, resource_name):\n        \"\"\"Return a true filesystem path for `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def get_resource_stream(manager, resource_name):\n        \"\"\"Return a readable file-like object for `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def get_resource_string(manager, resource_name):\n        \"\"\"Return a string containing the contents of `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def has_resource(resource_name):\n        \"\"\"Does the package contain the named resource?\"\"\"\n\n    def resource_isdir(resource_name):\n        \"\"\"Is the named resource a directory?  (like ``os.path.isdir()``)\"\"\"\n\n    def resource_listdir(resource_name):\n        \"\"\"List of resource names in the directory (like ``os.listdir()``)\"\"\"\n\n\nclass WorkingSet:\n    \"\"\"A collection of active distributions on sys.path (or a similar list)\"\"\"\n\n    def __init__(self, entries=None):\n        \"\"\"Create working set from list of path entries (default=sys.path)\"\"\"\n        self.entries = []\n        self.entry_keys = {}\n        self.by_key = {}\n        self.callbacks = []\n\n        if entries is None:\n            entries = sys.path\n\n        for entry in entries:\n            self.add_entry(entry)\n\n    @classmethod\n    def _build_master(cls):\n        \"\"\"\n        Prepare the master working set.\n        \"\"\"\n        ws = cls()\n        try:\n            from __main__ import __requires__\n        except ImportError:\n            # The main program does not list any requirements\n            return ws\n\n        # ensure the requirements are met\n        try:\n            ws.require(__requires__)\n        except VersionConflict:\n            return cls._build_from_requirements(__requires__)\n\n        return ws\n\n    @classmethod\n    def _build_from_requirements(cls, req_spec):\n        \"\"\"\n        Build a working set from a requirement spec. Rewrites sys.path.\n        \"\"\"\n        # try it without defaults already on sys.path\n        # by starting with an empty path\n        ws = cls([])\n        reqs = parse_requirements(req_spec)\n        dists = ws.resolve(reqs, Environment())\n        for dist in dists:\n            ws.add(dist)\n\n        # add any missing entries from sys.path\n        for entry in sys.path:\n            if entry not in ws.entries:\n                ws.add_entry(entry)\n\n        # then copy back to sys.path\n        sys.path[:] = ws.entries\n        return ws\n\n    def add_entry(self, entry):\n        \"\"\"Add a path item to ``.entries``, finding any distributions on it\n\n        ``find_distributions(entry, True)`` is used to find distributions\n        corresponding to the path entry, and they are added.  `entry` is\n        always appended to ``.entries``, even if it is already present.\n        (This is because ``sys.path`` can contain the same value more than\n        once, and the ``.entries`` of the ``sys.path`` WorkingSet should always\n        equal ``sys.path``.)\n        \"\"\"\n        self.entry_keys.setdefault(entry, [])\n        self.entries.append(entry)\n        for dist in find_distributions(entry, True):\n            self.add(dist, entry, False)\n\n    def __contains__(self, dist):\n        \"\"\"True if `dist` is the active distribution for its project\"\"\"\n        return self.by_key.get(dist.key) == dist\n\n    def find(self, req):\n        \"\"\"Find a distribution matching requirement `req`\n\n        If there is an active distribution for the requested project, this\n        returns it as long as it meets the version requirement specified by\n        `req`.  But, if there is an active distribution for the project and it\n        does *not* meet the `req` requirement, ``VersionConflict`` is raised.\n        If there is no active distribution for the requested project, ``None``\n        is returned.\n        \"\"\"\n        dist = self.by_key.get(req.key)\n        if dist is not None and dist not in req:\n            # XXX add more info\n            raise VersionConflict(dist, req)\n        return dist\n\n    def iter_entry_points(self, group, name=None):\n        \"\"\"Yield entry point objects from `group` matching `name`\n\n        If `name` is None, yields all entry points in `group` from all\n        distributions in the working set, otherwise only ones matching\n        both `group` and `name` are yielded (in distribution order).\n        \"\"\"\n        return (\n            entry\n            for dist in self\n            for entry in dist.get_entry_map(group).values()\n            if name is None or name == entry.name\n        )\n\n    def run_script(self, requires, script_name):\n        \"\"\"Locate distribution for `requires` and run `script_name` script\"\"\"\n        # Nuitka: This seems to pollute globals\n        assert False\n\n        ns = sys._getframe(1).f_globals\n        name = ns['__name__']\n        ns.clear()\n        ns['__name__'] = name\n        self.require(requires)[0].run_script(script_name, ns)\n\n    def __iter__(self):\n        \"\"\"Yield distributions for non-duplicate projects in the working set\n\n        The yield order is the order in which the items' path entries were\n        added to the working set.\n        \"\"\"\n        seen = {}\n        for item in self.entries:\n            if item not in self.entry_keys:\n                # workaround a cache issue\n                continue\n\n            for key in self.entry_keys[item]:\n                if key not in seen:\n                    seen[key] = 1\n                    yield self.by_key[key]\n\n    def add(self, dist, entry=None, insert=True, replace=False):\n        \"\"\"Add `dist` to working set, associated with `entry`\n\n        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.\n        On exit from this routine, `entry` is added to the end of the working\n        set's ``.entries`` (if it wasn't already present).\n\n        `dist` is only added to the working set if it's for a project that\n        doesn't already have a distribution in the set, unless `replace=True`.\n        If it's added, any callbacks registered with the ``subscribe()`` method\n        will be called.\n        \"\"\"\n        if insert:\n            dist.insert_on(self.entries, entry, replace=replace)\n\n        if entry is None:\n            entry = dist.location\n        keys = self.entry_keys.setdefault(entry, [])\n        keys2 = self.entry_keys.setdefault(dist.location, [])\n        if not replace and dist.key in self.by_key:\n            # ignore hidden distros\n            return\n\n        self.by_key[dist.key] = dist\n        if dist.key not in keys:\n            keys.append(dist.key)\n        if dist.key not in keys2:\n            keys2.append(dist.key)\n        self._added_new(dist)\n\n    def resolve(self, requirements, env=None, installer=None,\n                replace_conflicting=False, extras=None):\n        \"\"\"List all distributions needed to (recursively) meet `requirements`\n\n        `requirements` must be a sequence of ``Requirement`` objects.  `env`,\n        if supplied, should be an ``Environment`` instance.  If\n        not supplied, it defaults to all distributions available within any\n        entry or distribution in the working set.  `installer`, if supplied,\n        will be invoked with each requirement that cannot be met by an\n        already-installed distribution; it should return a ``Distribution`` or\n        ``None``.\n\n        Unless `replace_conflicting=True`, raises a VersionConflict exception\n        if\n        any requirements are found on the path that have the correct name but\n        the wrong version.  Otherwise, if an `installer` is supplied it will be\n        invoked to obtain the correct version of the requirement and activate\n        it.\n\n        `extras` is a list of the extras to be used with these requirements.\n        This is important because extra requirements may look like `my_req;\n        extra = \"my_extra\"`, which would otherwise be interpreted as a purely\n        optional requirement.  Instead, we want to be able to assert that these\n        requirements are truly required.\n        \"\"\"\n\n        # set up the stack\n        requirements = list(requirements)[::-1]\n        # set of processed requirements\n        processed = {}\n        # key -> dist\n        best = {}\n        to_activate = []\n\n        req_extras = _ReqExtras()\n\n        # Mapping of requirement to set of distributions that required it;\n        # useful for reporting info about conflicts.\n        required_by = collections.defaultdict(set)\n\n        while requirements:\n            # process dependencies breadth-first\n            req = requirements.pop(0)\n            if req in processed:\n                # Ignore cyclic or redundant dependencies\n                continue\n\n            if not req_extras.markers_pass(req, extras):\n                continue\n\n            dist = best.get(req.key)\n            if dist is None:\n                # Find the best distribution and add it to the map\n                dist = self.by_key.get(req.key)\n                if dist is None or (dist not in req and replace_conflicting):\n                    ws = self\n                    if env is None:\n                        if dist is None:\n                            env = Environment(self.entries)\n                        else:\n                            # Use an empty environment and workingset to avoid\n                            # any further conflicts with the conflicting\n                            # distribution\n                            env = Environment([])\n                            ws = WorkingSet([])\n                    dist = best[req.key] = env.best_match(\n                        req, ws, installer,\n                        replace_conflicting=replace_conflicting\n                    )\n                    if dist is None:\n                        requirers = required_by.get(req, None)\n                        raise DistributionNotFound(req, requirers)\n                to_activate.append(dist)\n            if dist not in req:\n                # Oops, the \"best\" so far conflicts with a dependency\n                dependent_req = required_by[req]\n                raise VersionConflict(dist, req).with_context(dependent_req)\n\n            # push the new requirements onto the stack\n            new_requirements = dist.requires(req.extras)[::-1]\n            requirements.extend(new_requirements)\n\n            # Register the new requirements needed by req\n            for new_requirement in new_requirements:\n                required_by[new_requirement].add(req.project_name)\n                req_extras[new_requirement] = req.extras\n\n            processed[req] = True\n\n        # return list of distros to activate\n        return to_activate\n\n    def find_plugins(\n            self, plugin_env, full_env=None, installer=None, fallback=True):\n        \"\"\"Find all activatable distributions in `plugin_env`\n\n        Example usage::\n\n            distributions, errors = working_set.find_plugins(\n                Environment(plugin_dirlist)\n            )\n            # add plugins+libs to sys.path\n            map(working_set.add, distributions)\n            # display errors\n            print('Could not load', errors)\n\n        The `plugin_env` should be an ``Environment`` instance that contains\n        only distributions that are in the project's \"plugin directory\" or\n        directories. The `full_env`, if supplied, should be an ``Environment``\n        contains all currently-available distributions.  If `full_env` is not\n        supplied, one is created automatically from the ``WorkingSet`` this\n        method is called on, which will typically mean that every directory on\n        ``sys.path`` will be scanned for distributions.\n\n        `installer` is a standard installer callback as used by the\n        ``resolve()`` method. The `fallback` flag indicates whether we should\n        attempt to resolve older versions of a plugin if the newest version\n        cannot be resolved.\n\n        This method returns a 2-tuple: (`distributions`, `error_info`), where\n        `distributions` is a list of the distributions found in `plugin_env`\n        that were loadable, along with any other distributions that are needed\n        to resolve their dependencies.  `error_info` is a dictionary mapping\n        unloadable plugin distributions to an exception instance describing the\n        error that occurred. Usually this will be a ``DistributionNotFound`` or\n        ``VersionConflict`` instance.\n        \"\"\"\n\n        plugin_projects = list(plugin_env)\n        # scan project names in alphabetic order\n        plugin_projects.sort()\n\n        error_info = {}\n        distributions = {}\n\n        if full_env is None:\n            env = Environment(self.entries)\n            env += plugin_env\n        else:\n            env = full_env + plugin_env\n\n        shadow_set = self.__class__([])\n        # put all our entries in shadow_set\n        list(map(shadow_set.add, self))\n\n        for project_name in plugin_projects:\n\n            for dist in plugin_env[project_name]:\n\n                req = [dist.as_requirement()]\n\n                try:\n                    resolvees = shadow_set.resolve(req, env, installer)\n\n                except ResolutionError as v:\n                    # save error info\n                    error_info[dist] = v\n                    if fallback:\n                        # try the next older version of project\n                        continue\n                    else:\n                        # give up on this project, keep going\n                        break\n\n                else:\n                    list(map(shadow_set.add, resolvees))\n                    distributions.update(dict.fromkeys(resolvees))\n\n                    # success, no need to try any more versions of this project\n                    break\n\n        distributions = list(distributions)\n        distributions.sort()\n\n        return distributions, error_info\n\n    def require(self, *requirements):\n        \"\"\"Ensure that distributions matching `requirements` are activated\n\n        `requirements` must be a string or a (possibly-nested) sequence\n        thereof, specifying the distributions and versions required.  The\n        return value is a sequence of the distributions that needed to be\n        activated to fulfill the requirements; all relevant distributions are\n        included, even if they were already activated in this working set.\n        \"\"\"\n        needed = self.resolve(parse_requirements(requirements))\n\n        for dist in needed:\n            self.add(dist)\n\n        return needed\n\n    def subscribe(self, callback, existing=True):\n        \"\"\"Invoke `callback` for all distributions\n\n        If `existing=True` (default),\n        call on all existing ones, as well.\n        \"\"\"\n        if callback in self.callbacks:\n            return\n        self.callbacks.append(callback)\n        if not existing:\n            return\n        for dist in self:\n            callback(dist)\n\n    def _added_new(self, dist):\n        for callback in self.callbacks:\n            callback(dist)\n\n    def __getstate__(self):\n        return (\n            self.entries[:], self.entry_keys.copy(), self.by_key.copy(),\n            self.callbacks[:]\n        )\n\n    def __setstate__(self, e_k_b_c):\n        entries, keys, by_key, callbacks = e_k_b_c\n        self.entries = entries[:]\n        self.entry_keys = keys.copy()\n        self.by_key = by_key.copy()\n        self.callbacks = callbacks[:]\n\n\nclass _ReqExtras(dict):\n    \"\"\"\n    Map each requirement to the extras that demanded it.\n    \"\"\"\n\n    def markers_pass(self, req, extras=None):\n        \"\"\"\n        Evaluate markers for req against each extra that\n        demanded it.\n\n        Return False if the req has a marker and fails\n        evaluation. Otherwise, return True.\n        \"\"\"\n        extra_evals = (\n            req.marker.evaluate({'extra': extra})\n            for extra in self.get(req, ()) + (extras or (None,))\n        )\n        return not req.marker or any(extra_evals)\n\n\nclass Environment:\n    \"\"\"Searchable snapshot of distributions on a search path\"\"\"\n\n    def __init__(\n            self, search_path=None, platform=get_supported_platform(),\n            python=PY_MAJOR):\n        \"\"\"Snapshot distributions available on a search path\n\n        Any distributions found on `search_path` are added to the environment.\n        `search_path` should be a sequence of ``sys.path`` items.  If not\n        supplied, ``sys.path`` is used.\n\n        `platform` is an optional string specifying the name of the platform\n        that platform-specific distributions must be compatible with.  If\n        unspecified, it defaults to the current platform.  `python` is an\n        optional string naming the desired version of Python (e.g. ``'3.6'``);\n        it defaults to the current version.\n\n        You may explicitly set `platform` (and/or `python`) to ``None`` if you\n        wish to map *all* distributions, not just those compatible with the\n        running platform or Python version.\n        \"\"\"\n        self._distmap = {}\n        self.platform = platform\n        self.python = python\n        self.scan(search_path)\n\n    def can_add(self, dist):\n        \"\"\"Is distribution `dist` acceptable for this environment?\n\n        The distribution must match the platform and python version\n        requirements specified when this environment was created, or False\n        is returned.\n        \"\"\"\n        py_compat = (\n            self.python is None\n            or dist.py_version is None\n            or dist.py_version == self.python\n        )\n        return py_compat and compatible_platforms(dist.platform, self.platform)\n\n    def remove(self, dist):\n        \"\"\"Remove `dist` from the environment\"\"\"\n        self._distmap[dist.key].remove(dist)\n\n    def scan(self, search_path=None):\n        \"\"\"Scan `search_path` for distributions usable in this environment\n\n        Any distributions found are added to the environment.\n        `search_path` should be a sequence of ``sys.path`` items.  If not\n        supplied, ``sys.path`` is used.  Only distributions conforming to\n        the platform/python version defined at initialization are added.\n        \"\"\"\n        if search_path is None:\n            search_path = sys.path\n\n        for item in search_path:\n            for dist in find_distributions(item):\n                self.add(dist)\n\n    def __getitem__(self, project_name):\n        \"\"\"Return a newest-to-oldest list of distributions for `project_name`\n\n        Uses case-insensitive `project_name` comparison, assuming all the\n        project's distributions use their project's name converted to all\n        lowercase as their key.\n\n        \"\"\"\n        distribution_key = project_name.lower()\n        return self._distmap.get(distribution_key, [])\n\n    def add(self, dist):\n        \"\"\"Add `dist` if we ``can_add()`` it and it has not already been added\n        \"\"\"\n        if self.can_add(dist) and dist.has_version():\n            dists = self._distmap.setdefault(dist.key, [])\n            if dist not in dists:\n                dists.append(dist)\n                dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)\n\n    def best_match(\n            self, req, working_set, installer=None, replace_conflicting=False):\n        \"\"\"Find distribution best matching `req` and usable on `working_set`\n\n        This calls the ``find(req)`` method of the `working_set` to see if a\n        suitable distribution is already active.  (This may raise\n        ``VersionConflict`` if an unsuitable version of the project is already\n        active in the specified `working_set`.)  If a suitable distribution\n        isn't active, this method returns the newest distribution in the\n        environment that meets the ``Requirement`` in `req`.  If no suitable\n        distribution is found, and `installer` is supplied, then the result of\n        calling the environment's ``obtain(req, installer)`` method will be\n        returned.\n        \"\"\"\n        try:\n            dist = working_set.find(req)\n        except VersionConflict:\n            if not replace_conflicting:\n                raise\n            dist = None\n        if dist is not None:\n            return dist\n        for dist in self[req.key]:\n            if dist in req:\n                return dist\n        # try to download/install\n        return self.obtain(req, installer)\n\n    def obtain(self, requirement, installer=None):\n        \"\"\"Obtain a distribution matching `requirement` (e.g. via download)\n\n        Obtain a distro that matches requirement (e.g. via download).  In the\n        base ``Environment`` class, this routine just returns\n        ``installer(requirement)``, unless `installer` is None, in which case\n        None is returned instead.  This method is a hook that allows subclasses\n        to attempt other ways of obtaining a distribution before falling back\n        to the `installer` argument.\"\"\"\n        if installer is not None:\n            return installer(requirement)\n\n    def __iter__(self):\n        \"\"\"Yield the unique project names of the available distributions\"\"\"\n        for key in self._distmap.keys():\n            if self[key]:\n                yield key\n\n    def __iadd__(self, other):\n        \"\"\"In-place addition of a distribution or environment\"\"\"\n        if isinstance(other, Distribution):\n            self.add(other)\n        elif isinstance(other, Environment):\n            for project in other:\n                for dist in other[project]:\n                    self.add(dist)\n        else:\n            raise TypeError(\"Can't add %r to environment\" % (other,))\n        return self\n\n    def __add__(self, other):\n        \"\"\"Add an environment or distribution to an environment\"\"\"\n        new = self.__class__([], platform=None, python=None)\n        for env in self, other:\n            new += env\n        return new\n\n\n# XXX backward compatibility\nAvailableDistributions = Environment\n\n\nclass ExtractionError(RuntimeError):\n    \"\"\"An error occurred extracting a resource\n\n    The following attributes are available from instances of this exception:\n\n    manager\n        The resource manager that raised this exception\n\n    cache_path\n        The base directory for resource extraction\n\n    original_error\n        The exception instance that caused extraction to fail\n    \"\"\"\n\n\nclass ResourceManager:\n    \"\"\"Manage resource extraction and packages\"\"\"\n    extraction_path = None\n\n    def __init__(self):\n        self.cached_files = {}\n\n    def resource_exists(self, package_or_requirement, resource_name):\n        \"\"\"Does the named resource exist?\"\"\"\n        return get_provider(package_or_requirement).has_resource(resource_name)\n\n    def resource_isdir(self, package_or_requirement, resource_name):\n        \"\"\"Is the named resource an existing directory?\"\"\"\n        return get_provider(package_or_requirement).resource_isdir(\n            resource_name\n        )\n\n    def resource_filename(self, package_or_requirement, resource_name):\n        \"\"\"Return a true filesystem path for specified resource\"\"\"\n        return get_provider(package_or_requirement).get_resource_filename(\n            self, resource_name\n        )\n\n    def resource_stream(self, package_or_requirement, resource_name):\n        \"\"\"Return a readable file-like object for specified resource\"\"\"\n        return get_provider(package_or_requirement).get_resource_stream(\n            self, resource_name\n        )\n\n    def resource_string(self, package_or_requirement, resource_name):\n        \"\"\"Return specified resource as a string\"\"\"\n        return get_provider(package_or_requirement).get_resource_string(\n            self, resource_name\n        )\n\n    def resource_listdir(self, package_or_requirement, resource_name):\n        \"\"\"List the contents of the named resource directory\"\"\"\n        return get_provider(package_or_requirement).resource_listdir(\n            resource_name\n        )\n\n    def extraction_error(self):\n        \"\"\"Give an error message for problems extracting file(s)\"\"\"\n\n        old_exc = sys.exc_info()[1]\n        cache_path = self.extraction_path or get_default_cache()\n\n        tmpl = textwrap.dedent(\"\"\"\n            Can't extract file(s) to egg cache\n\n            The following error occurred while trying to extract file(s)\n            to the Python egg cache:\n\n              {old_exc}\n\n            The Python egg cache directory is currently set to:\n\n              {cache_path}\n\n            Perhaps your account does not have write access to this directory?\n            You can change the cache directory by setting the PYTHON_EGG_CACHE\n            environment variable to point to an accessible directory.\n            \"\"\").lstrip()\n        err = ExtractionError(tmpl.format(**locals()))\n        err.manager = self\n        err.cache_path = cache_path\n        err.original_error = old_exc\n        raise err\n\n    def get_cache_path(self, archive_name, names=()):\n        \"\"\"Return absolute location in cache for `archive_name` and `names`\n\n        The parent directory of the resulting path will be created if it does\n        not already exist.  `archive_name` should be the base filename of the\n        enclosing egg (which may not be the name of the enclosing zipfile!),\n        including its \".egg\" extension.  `names`, if provided, should be a\n        sequence of path name parts \"under\" the egg's extraction location.\n\n        This method should only be called by resource providers that need to\n        obtain an extraction location, and only for names they intend to\n        extract, as it tracks the generated names for possible cleanup later.\n        \"\"\"\n        extract_path = self.extraction_path or get_default_cache()\n        target_path = os.path.join(extract_path, archive_name + '-tmp', *names)\n        try:\n            _bypass_ensure_directory(target_path)\n        except Exception:\n            self.extraction_error()\n\n        self._warn_unsafe_extraction_path(extract_path)\n\n        self.cached_files[target_path] = 1\n        return target_path\n\n    @staticmethod\n    def _warn_unsafe_extraction_path(path):\n        \"\"\"\n        If the default extraction path is overridden and set to an insecure\n        location, such as /tmp, it opens up an opportunity for an attacker to\n        replace an extracted file with an unauthorized payload. Warn the user\n        if a known insecure location is used.\n\n        See Distribute #375 for more details.\n        \"\"\"\n        if os.name == 'nt' and not path.startswith(os.environ['windir']):\n            # On Windows, permissions are generally restrictive by default\n            #  and temp directories are not writable by other users, so\n            #  bypass the warning.\n            return\n        mode = os.stat(path).st_mode\n        if mode & stat.S_IWOTH or mode & stat.S_IWGRP:\n            msg = (\n                \"%s is writable by group/others and vulnerable to attack \"\n                \"when \"\n                \"used with get_resource_filename. Consider a more secure \"\n                \"location (set with .set_extraction_path or the \"\n                \"PYTHON_EGG_CACHE environment variable).\" % path\n            )\n            warnings.warn(msg, UserWarning)\n\n    def postprocess(self, tempname, filename):\n        \"\"\"Perform any platform-specific postprocessing of `tempname`\n\n        This is where Mac header rewrites should be done; other platforms don't\n        have anything special they should do.\n\n        Resource providers should call this method ONLY after successfully\n        extracting a compressed resource.  They must NOT call it on resources\n        that are already in the filesystem.\n\n        `tempname` is the current (temporary) name of the file, and `filename`\n        is the name it will be renamed to by the caller after this routine\n        returns.\n        \"\"\"\n\n        if os.name == 'posix':\n            # Make the resource executable\n            mode = ((os.stat(tempname).st_mode) | 0o555) & 0o7777\n            os.chmod(tempname, mode)\n\n    def set_extraction_path(self, path):\n        \"\"\"Set the base path where resources will be extracted to, if needed.\n\n        If you do not call this routine before any extractions take place, the\n        path defaults to the return value of ``get_default_cache()``.  (Which\n        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various\n        platform-specific fallbacks.  See that routine's documentation for more\n        details.)\n\n        Resources are extracted to subdirectories of this path based upon\n        information given by the ``IResourceProvider``.  You may set this to a\n        temporary directory, but then you must call ``cleanup_resources()`` to\n        delete the extracted files when done.  There is no guarantee that\n        ``cleanup_resources()`` will be able to remove all extracted files.\n\n        (Note: you may not change the extraction path for a given resource\n        manager once resources have been extracted, unless you first call\n        ``cleanup_resources()``.)\n        \"\"\"\n        if self.cached_files:\n            raise ValueError(\n                \"Can't change extraction path, files already extracted\"\n            )\n\n        self.extraction_path = path\n\n    def cleanup_resources(self, force=False):\n        \"\"\"\n        Delete all extracted resource files and directories, returning a list\n        of the file and directory names that could not be successfully removed.\n        This function does not have any concurrency protection, so it should\n        generally only be called when the extraction path is a temporary\n        directory exclusive to a single process.  This method is not\n        automatically called; you must call it explicitly or register it as an\n        ``atexit`` function if you wish to ensure cleanup of a temporary\n        directory used for extractions.\n        \"\"\"\n        # XXX\n\n\ndef get_default_cache():\n    \"\"\"\n    Return the ``PYTHON_EGG_CACHE`` environment variable\n    or a platform-relevant user cache dir for an app\n    named \"Python-Eggs\".\n    \"\"\"\n    return (\n        os.environ.get('PYTHON_EGG_CACHE')\n        or appdirs.user_cache_dir(appname='Python-Eggs')\n    )\n\n\ndef safe_name(name):\n    \"\"\"Convert an arbitrary string to a standard distribution name\n\n    Any runs of non-alphanumeric/. characters are replaced with a single '-'.\n    \"\"\"\n    return re.sub('[^A-Za-z0-9.]+', '-', name)\n\n\ndef safe_version(version):\n    \"\"\"\n    Convert an arbitrary string to a standard version string\n    \"\"\"\n    try:\n        # normalize the version\n        return str(packaging.version.Version(version))\n    except packaging.version.InvalidVersion:\n        version = version.replace(' ', '.')\n        return re.sub('[^A-Za-z0-9.]+', '-', version)\n\n\ndef safe_extra(extra):\n    \"\"\"Convert an arbitrary string to a standard 'extra' name\n\n    Any runs of non-alphanumeric characters are replaced with a single '_',\n    and the result is always lowercased.\n    \"\"\"\n    return re.sub('[^A-Za-z0-9.-]+', '_', extra).lower()\n\n\ndef to_filename(name):\n    \"\"\"Convert a project or version name to its filename-escaped form\n\n    Any '-' characters are currently replaced with '_'.\n    \"\"\"\n    return name.replace('-', '_')\n\n\ndef invalid_marker(text):\n    \"\"\"\n    Validate text as a PEP 508 environment marker; return an exception\n    if invalid or False otherwise.\n    \"\"\"\n    try:\n        evaluate_marker(text)\n    except SyntaxError as e:\n        e.filename = None\n        e.lineno = None\n        return e\n    return False\n\n\ndef evaluate_marker(text, extra=None):\n    \"\"\"\n    Evaluate a PEP 508 environment marker.\n    Return a boolean indicating the marker result in this environment.\n    Raise SyntaxError if marker is invalid.\n\n    This implementation uses the 'pyparsing' module.\n    \"\"\"\n    try:\n        marker = packaging.markers.Marker(text)\n        return marker.evaluate()\n    except packaging.markers.InvalidMarker as e:\n        raise SyntaxError(e)\n\n\nclass NullProvider:\n    \"\"\"Try to implement resources and metadata for arbitrary PEP 302 loaders\"\"\"\n\n    egg_name = None\n    egg_info = None\n    loader = None\n\n    def __init__(self, module):\n        self.loader = getattr(module, '__loader__', None)\n        self.module_path = os.path.dirname(getattr(module, '__file__', ''))\n\n    def get_resource_filename(self, manager, resource_name):\n        return self._fn(self.module_path, resource_name)\n\n    def get_resource_stream(self, manager, resource_name):\n        return io.BytesIO(self.get_resource_string(manager, resource_name))\n\n    def get_resource_string(self, manager, resource_name):\n        return self._get(self._fn(self.module_path, resource_name))\n\n    def has_resource(self, resource_name):\n        return self._has(self._fn(self.module_path, resource_name))\n\n    def _get_metadata_path(self, name):\n        return self._fn(self.egg_info, name)\n\n    def has_metadata(self, name):\n        if not self.egg_info:\n            return self.egg_info\n\n        path = self._get_metadata_path(name)\n        return self._has(path)\n\n    def get_metadata(self, name):\n        if not self.egg_info:\n            return \"\"\n        path = self._get_metadata_path(name)\n        value = self._get(path)\n        if six.PY2:\n            return value\n        try:\n            return value.decode('utf-8')\n        except UnicodeDecodeError as exc:\n            # Include the path in the error message to simplify\n            # troubleshooting, and without changing the exception type.\n            exc.reason += ' in {} file at path: {}'.format(name, path)\n            raise\n\n    def get_metadata_lines(self, name):\n        return yield_lines(self.get_metadata(name))\n\n    def resource_isdir(self, resource_name):\n        return self._isdir(self._fn(self.module_path, resource_name))\n\n    def metadata_isdir(self, name):\n        return self.egg_info and self._isdir(self._fn(self.egg_info, name))\n\n    def resource_listdir(self, resource_name):\n        return self._listdir(self._fn(self.module_path, resource_name))\n\n    def metadata_listdir(self, name):\n        if self.egg_info:\n            return self._listdir(self._fn(self.egg_info, name))\n        return []\n\n    def run_script(self, script_name, namespace):\n        script = 'scripts/' + script_name\n        if not self.has_metadata(script):\n            raise ResolutionError(\n                \"Script {script!r} not found in metadata at {self.egg_info!r}\"\n                .format(**locals()),\n            )\n        script_text = self.get_metadata(script).replace('\\r\\n', '\\n')\n        script_text = script_text.replace('\\r', '\\n')\n        script_filename = self._fn(self.egg_info, script)\n        namespace['__file__'] = script_filename\n        if os.path.exists(script_filename):\n            source = open(script_filename).read()\n            code = compile(source, script_filename, 'exec')\n            exec(code, namespace, namespace)\n        else:\n            from linecache import cache\n            cache[script_filename] = (\n                len(script_text), 0, script_text.split('\\n'), script_filename\n            )\n            script_code = compile(script_text, script_filename, 'exec')\n            exec(script_code, namespace, namespace)\n\n    def _has(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _isdir(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _listdir(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _fn(self, base, resource_name):\n        self._validate_resource_path(resource_name)\n        if resource_name:\n            return os.path.join(base, *resource_name.split('/'))\n        return base\n\n    @staticmethod\n    def _validate_resource_path(path):\n        \"\"\"\n        Validate the resource paths according to the docs.\n        https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access\n\n        >>> warned = getfixture('recwarn')\n        >>> warnings.simplefilter('always')\n        >>> vrp = NullProvider._validate_resource_path\n        >>> vrp('foo/bar.txt')\n        >>> bool(warned)\n        False\n        >>> vrp('../foo/bar.txt')\n        >>> bool(warned)\n        True\n        >>> warned.clear()\n        >>> vrp('/foo/bar.txt')\n        >>> bool(warned)\n        True\n        >>> vrp('foo/../../bar.txt')\n        >>> bool(warned)\n        True\n        >>> warned.clear()\n        >>> vrp('foo/f../bar.txt')\n        >>> bool(warned)\n        False\n\n        Windows path separators are straight-up disallowed.\n        >>> vrp(r'\\\\foo/bar.txt')\n        Traceback (most recent call last):\n        ...\n        ValueError: Use of .. or absolute path in a resource path \\\nis not allowed.\n\n        >>> vrp(r'C:\\\\foo/bar.txt')\n        Traceback (most recent call last):\n        ...\n        ValueError: Use of .. or absolute path in a resource path \\\nis not allowed.\n\n        Blank values are allowed\n\n        >>> vrp('')\n        >>> bool(warned)\n        False\n\n        Non-string values are not.\n\n        >>> vrp(None)\n        Traceback (most recent call last):\n        ...\n        AttributeError: ...\n        \"\"\"\n        invalid = (\n            os.path.pardir in path.split(posixpath.sep) or\n            posixpath.isabs(path) or\n            ntpath.isabs(path)\n        )\n        if not invalid:\n            return\n\n        msg = \"Use of .. or absolute path in a resource path is not allowed.\"\n\n        # Aggressively disallow Windows absolute paths\n        if ntpath.isabs(path) and not posixpath.isabs(path):\n            raise ValueError(msg)\n\n        # for compatibility, warn; in future\n        # raise ValueError(msg)\n        warnings.warn(\n            msg[:-1] + \" and will raise exceptions in a future release.\",\n            DeprecationWarning,\n            stacklevel=4,\n        )\n\n    def _get(self, path):\n        if hasattr(self.loader, 'get_data'):\n            return self.loader.get_data(path)\n        raise NotImplementedError(\n            \"Can't perform this operation for loaders without 'get_data()'\"\n        )\n\n\nregister_loader_type(object, NullProvider)\n\n\nclass EggProvider(NullProvider):\n    \"\"\"Provider based on a virtual filesystem\"\"\"\n\n    def __init__(self, module):\n        NullProvider.__init__(self, module)\n        self._setup_prefix()\n\n    def _setup_prefix(self):\n        # we assume here that our metadata may be nested inside a \"basket\"\n        # of multiple eggs; that's why we use module_path instead of .archive\n        path = self.module_path\n        old = None\n        while path != old:\n            if _is_egg_path(path):\n                self.egg_name = os.path.basename(path)\n                self.egg_info = os.path.join(path, 'EGG-INFO')\n                self.egg_root = path\n                break\n            old = path\n            path, base = os.path.split(path)\n\n\nclass DefaultProvider(EggProvider):\n    \"\"\"Provides access to package resources in the filesystem\"\"\"\n\n    def _has(self, path):\n        return os.path.exists(path)\n\n    def _isdir(self, path):\n        return os.path.isdir(path)\n\n    def _listdir(self, path):\n        return os.listdir(path)\n\n    def get_resource_stream(self, manager, resource_name):\n        return open(self._fn(self.module_path, resource_name), 'rb')\n\n    def _get(self, path):\n        with open(path, 'rb') as stream:\n            return stream.read()\n\n    @classmethod\n    def _register(cls):\n        loader_names = 'SourceFileLoader', 'SourcelessFileLoader',\n        for name in loader_names:\n            loader_cls = getattr(importlib_machinery, name, type(None))\n            register_loader_type(loader_cls, cls)\n\n\nDefaultProvider._register()\n\n\nclass EmptyProvider(NullProvider):\n    \"\"\"Provider that returns nothing for all requests\"\"\"\n\n    module_path = None\n\n    _isdir = _has = lambda self, path: False\n\n    def _get(self, path):\n        return ''\n\n    def _listdir(self, path):\n        return []\n\n    def __init__(self):\n        pass\n\n\nempty_provider = EmptyProvider()\n\n\nclass ZipManifests(dict):\n    \"\"\"\n    zip manifest builder\n    \"\"\"\n\n    @classmethod\n    def build(cls, path):\n        \"\"\"\n        Build a dictionary similar to the zipimport directory\n        caches, except instead of tuples, store ZipInfo objects.\n\n        Use a platform-specific path separator (os.sep) for the path keys\n        for compatibility with pypy on Windows.\n        \"\"\"\n        with zipfile.ZipFile(path) as zfile:\n            items = (\n                (\n                    name.replace('/', os.sep),\n                    zfile.getinfo(name),\n                )\n                for name in zfile.namelist()\n            )\n            return dict(items)\n\n    load = build\n\n\nclass MemoizedZipManifests(ZipManifests):\n    \"\"\"\n    Memoized zipfile manifests.\n    \"\"\"\n    manifest_mod = collections.namedtuple('manifest_mod', 'manifest mtime')\n\n    def load(self, path):\n        \"\"\"\n        Load a manifest at path or return a suitable manifest already loaded.\n        \"\"\"\n        path = os.path.normpath(path)\n        mtime = os.stat(path).st_mtime\n\n        if path not in self or self[path].mtime != mtime:\n            manifest = self.build(path)\n            self[path] = self.manifest_mod(manifest, mtime)\n\n        return self[path].manifest\n\n\nclass ZipProvider(EggProvider):\n    \"\"\"Resource support for zips and eggs\"\"\"\n\n    eagers = None\n    _zip_manifests = MemoizedZipManifests()\n\n    def __init__(self, module):\n        EggProvider.__init__(self, module)\n        self.zip_pre = self.loader.archive + os.sep\n\n    def _zipinfo_name(self, fspath):\n        # Convert a virtual filename (full path to file) into a zipfile subpath\n        # usable with the zipimport directory cache for our target archive\n        fspath = fspath.rstrip(os.sep)\n        if fspath == self.loader.archive:\n            return ''\n        if fspath.startswith(self.zip_pre):\n            return fspath[len(self.zip_pre):]\n        raise AssertionError(\n            \"%s is not a subpath of %s\" % (fspath, self.zip_pre)\n        )\n\n    def _parts(self, zip_path):\n        # Convert a zipfile subpath into an egg-relative path part list.\n        # pseudo-fs path\n        fspath = self.zip_pre + zip_path\n        if fspath.startswith(self.egg_root + os.sep):\n            return fspath[len(self.egg_root) + 1:].split(os.sep)\n        raise AssertionError(\n            \"%s is not a subpath of %s\" % (fspath, self.egg_root)\n        )\n\n    @property\n    def zipinfo(self):\n        return self._zip_manifests.load(self.loader.archive)\n\n    def get_resource_filename(self, manager, resource_name):\n        if not self.egg_name:\n            raise NotImplementedError(\n                \"resource_filename() only supported for .egg, not .zip\"\n            )\n        # no need to lock for extraction, since we use temp names\n        zip_path = self._resource_to_zip(resource_name)\n        eagers = self._get_eager_resources()\n        if '/'.join(self._parts(zip_path)) in eagers:\n            for name in eagers:\n                self._extract_resource(manager, self._eager_to_zip(name))\n        return self._extract_resource(manager, zip_path)\n\n    @staticmethod\n    def _get_date_and_size(zip_stat):\n        size = zip_stat.file_size\n        # ymdhms+wday, yday, dst\n        date_time = zip_stat.date_time + (0, 0, -1)\n        # 1980 offset already done\n        timestamp = time.mktime(date_time)\n        return timestamp, size\n\n    def _extract_resource(self, manager, zip_path):\n\n        if zip_path in self._index():\n            for name in self._index()[zip_path]:\n                last = self._extract_resource(\n                    manager, os.path.join(zip_path, name)\n                )\n            # return the extracted directory name\n            return os.path.dirname(last)\n\n        timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])\n\n        if not WRITE_SUPPORT:\n            raise IOError('\"os.rename\" and \"os.unlink\" are not supported '\n                          'on this platform')\n        try:\n\n            real_path = manager.get_cache_path(\n                self.egg_name, self._parts(zip_path)\n            )\n\n            if self._is_current(real_path, zip_path):\n                return real_path\n\n            outf, tmpnam = _mkstemp(\n                \".$extract\",\n                dir=os.path.dirname(real_path),\n            )\n            os.write(outf, self.loader.get_data(zip_path))\n            os.close(outf)\n            utime(tmpnam, (timestamp, timestamp))\n            manager.postprocess(tmpnam, real_path)\n\n            try:\n                rename(tmpnam, real_path)\n\n            except os.error:\n                if os.path.isfile(real_path):\n                    if self._is_current(real_path, zip_path):\n                        # the file became current since it was checked above,\n                        #  so proceed.\n                        return real_path\n                    # Windows, del old file and retry\n                    elif os.name == 'nt':\n                        unlink(real_path)\n                        rename(tmpnam, real_path)\n                        return real_path\n                raise\n\n        except os.error:\n            # report a user-friendly error\n            manager.extraction_error()\n\n        return real_path\n\n    def _is_current(self, file_path, zip_path):\n        \"\"\"\n        Return True if the file_path is current for this zip_path\n        \"\"\"\n        timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])\n        if not os.path.isfile(file_path):\n            return False\n        stat = os.stat(file_path)\n        if stat.st_size != size or stat.st_mtime != timestamp:\n            return False\n        # check that the contents match\n        zip_contents = self.loader.get_data(zip_path)\n        with open(file_path, 'rb') as f:\n            file_contents = f.read()\n        return zip_contents == file_contents\n\n    def _get_eager_resources(self):\n        if self.eagers is None:\n            eagers = []\n            for name in ('native_libs.txt', 'eager_resources.txt'):\n                if self.has_metadata(name):\n                    eagers.extend(self.get_metadata_lines(name))\n            self.eagers = eagers\n        return self.eagers\n\n    def _index(self):\n        try:\n            return self._dirindex\n        except AttributeError:\n            ind = {}\n            for path in self.zipinfo:\n                parts = path.split(os.sep)\n                while parts:\n                    parent = os.sep.join(parts[:-1])\n                    if parent in ind:\n                        ind[parent].append(parts[-1])\n                        break\n                    else:\n                        ind[parent] = [parts.pop()]\n            self._dirindex = ind\n            return ind\n\n    def _has(self, fspath):\n        zip_path = self._zipinfo_name(fspath)\n        return zip_path in self.zipinfo or zip_path in self._index()\n\n    def _isdir(self, fspath):\n        return self._zipinfo_name(fspath) in self._index()\n\n    def _listdir(self, fspath):\n        return list(self._index().get(self._zipinfo_name(fspath), ()))\n\n    def _eager_to_zip(self, resource_name):\n        return self._zipinfo_name(self._fn(self.egg_root, resource_name))\n\n    def _resource_to_zip(self, resource_name):\n        return self._zipinfo_name(self._fn(self.module_path, resource_name))\n\n\nregister_loader_type(zipimport.zipimporter, ZipProvider)\n\n\nclass FileMetadata(EmptyProvider):\n    \"\"\"Metadata handler for standalone PKG-INFO files\n\n    Usage::\n\n        metadata = FileMetadata(\"/path/to/PKG-INFO\")\n\n    This provider rejects all data and metadata requests except for PKG-INFO,\n    which is treated as existing, and will be the contents of the file at\n    the provided location.\n    \"\"\"\n\n    def __init__(self, path):\n        self.path = path\n\n    def _get_metadata_path(self, name):\n        return self.path\n\n    def has_metadata(self, name):\n        return name == 'PKG-INFO' and os.path.isfile(self.path)\n\n    def get_metadata(self, name):\n        if name != 'PKG-INFO':\n            raise KeyError(\"No metadata except PKG-INFO is available\")\n\n        with io.open(self.path, encoding='utf-8', errors=\"replace\") as f:\n            metadata = f.read()\n        self._warn_on_replacement(metadata)\n        return metadata\n\n    def _warn_on_replacement(self, metadata):\n        # Python 2.7 compat for: replacement_char = '�'\n        replacement_char = b'\\xef\\xbf\\xbd'.decode('utf-8')\n        if replacement_char in metadata:\n            tmpl = \"{self.path} could not be properly decoded in UTF-8\"\n            msg = tmpl.format(**locals())\n            warnings.warn(msg)\n\n    def get_metadata_lines(self, name):\n        return yield_lines(self.get_metadata(name))\n\n\nclass PathMetadata(DefaultProvider):\n    \"\"\"Metadata provider for egg directories\n\n    Usage::\n\n        # Development eggs:\n\n        egg_info = \"/path/to/PackageName.egg-info\"\n        base_dir = os.path.dirname(egg_info)\n        metadata = PathMetadata(base_dir, egg_info)\n        dist_name = os.path.splitext(os.path.basename(egg_info))[0]\n        dist = Distribution(basedir, project_name=dist_name, metadata=metadata)\n\n        # Unpacked egg directories:\n\n        egg_path = \"/path/to/PackageName-ver-pyver-etc.egg\"\n        metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))\n        dist = Distribution.from_filename(egg_path, metadata=metadata)\n    \"\"\"\n\n    def __init__(self, path, egg_info):\n        self.module_path = path\n        self.egg_info = egg_info\n\n\nclass EggMetadata(ZipProvider):\n    \"\"\"Metadata provider for .egg files\"\"\"\n\n    def __init__(self, importer):\n        \"\"\"Create a metadata provider from a zipimporter\"\"\"\n\n        self.zip_pre = importer.archive + os.sep\n        self.loader = importer\n        if importer.prefix:\n            self.module_path = os.path.join(importer.archive, importer.prefix)\n        else:\n            self.module_path = importer.archive\n        self._setup_prefix()\n\n\n_declare_state('dict', _distribution_finders={})\n\n\ndef register_finder(importer_type, distribution_finder):\n    \"\"\"Register `distribution_finder` to find distributions in sys.path items\n\n    `importer_type` is the type or class of a PEP 302 \"Importer\" (sys.path item\n    handler), and `distribution_finder` is a callable that, passed a path\n    item and the importer instance, yields ``Distribution`` instances found on\n    that path item.  See ``pkg_resources.find_on_path`` for an example.\"\"\"\n    _distribution_finders[importer_type] = distribution_finder\n\n\ndef find_distributions(path_item, only=False):\n    \"\"\"Yield distributions accessible via `path_item`\"\"\"\n    importer = get_importer(path_item)\n    finder = _find_adapter(_distribution_finders, importer)\n    return finder(importer, path_item, only)\n\n\ndef find_eggs_in_zip(importer, path_item, only=False):\n    \"\"\"\n    Find eggs in zip files; possibly multiple nested eggs.\n    \"\"\"\n    if importer.archive.endswith('.whl'):\n        # wheels are not supported with this finder\n        # they don't have PKG-INFO metadata, and won't ever contain eggs\n        return\n    metadata = EggMetadata(importer)\n    if metadata.has_metadata('PKG-INFO'):\n        yield Distribution.from_filename(path_item, metadata=metadata)\n    if only:\n        # don't yield nested distros\n        return\n    for subitem in metadata.resource_listdir(''):\n        if _is_egg_path(subitem):\n            subpath = os.path.join(path_item, subitem)\n            dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)\n            for dist in dists:\n                yield dist\n        elif subitem.lower().endswith('.dist-info'):\n            subpath = os.path.join(path_item, subitem)\n            submeta = EggMetadata(zipimport.zipimporter(subpath))\n            submeta.egg_info = subpath\n            yield Distribution.from_location(path_item, subitem, submeta)\n\n\nregister_finder(zipimport.zipimporter, find_eggs_in_zip)\n\n\ndef find_nothing(importer, path_item, only=False):\n    return ()\n\n\nregister_finder(object, find_nothing)\n\n\ndef _by_version_descending(names):\n    \"\"\"\n    Given a list of filenames, return them in descending order\n    by version number.\n\n    >>> names = 'bar', 'foo', 'Python-2.7.10.egg', 'Python-2.7.2.egg'\n    >>> _by_version_descending(names)\n    ['Python-2.7.10.egg', 'Python-2.7.2.egg', 'foo', 'bar']\n    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.egg'\n    >>> _by_version_descending(names)\n    ['Setuptools-1.2.3.egg', 'Setuptools-1.2.3b1.egg']\n    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.post1.egg'\n    >>> _by_version_descending(names)\n    ['Setuptools-1.2.3.post1.egg', 'Setuptools-1.2.3b1.egg']\n    \"\"\"\n    def _by_version(name):\n        \"\"\"\n        Parse each component of the filename\n        \"\"\"\n        name, ext = os.path.splitext(name)\n        parts = itertools.chain(name.split('-'), [ext])\n        return [packaging.version.parse(part) for part in parts]\n\n    return sorted(names, key=_by_version, reverse=True)\n\n\ndef find_on_path(importer, path_item, only=False):\n    \"\"\"Yield distributions accessible on a sys.path directory\"\"\"\n    path_item = _normalize_cached(path_item)\n\n    if _is_unpacked_egg(path_item):\n        yield Distribution.from_filename(\n            path_item, metadata=PathMetadata(\n                path_item, os.path.join(path_item, 'EGG-INFO')\n            )\n        )\n        return\n\n    entries = safe_listdir(path_item)\n\n    # for performance, before sorting by version,\n    # screen entries for only those that will yield\n    # distributions\n    filtered = (\n        entry\n        for entry in entries\n        if dist_factory(path_item, entry, only)\n    )\n\n    # scan for .egg and .egg-info in directory\n    path_item_entries = _by_version_descending(filtered)\n    for entry in path_item_entries:\n        fullpath = os.path.join(path_item, entry)\n        factory = dist_factory(path_item, entry, only)\n        for dist in factory(fullpath):\n            yield dist\n\n\ndef dist_factory(path_item, entry, only):\n    \"\"\"\n    Return a dist_factory for a path_item and entry\n    \"\"\"\n    lower = entry.lower()\n    is_meta = any(map(lower.endswith, ('.egg-info', '.dist-info')))\n    return (\n        distributions_from_metadata\n        if is_meta else\n        find_distributions\n        if not only and _is_egg_path(entry) else\n        resolve_egg_link\n        if not only and lower.endswith('.egg-link') else\n        NoDists()\n    )\n\n\nclass NoDists:\n    \"\"\"\n    >>> bool(NoDists())\n    False\n\n    >>> list(NoDists()('anything'))\n    []\n    \"\"\"\n    def __bool__(self):\n        return False\n    if str is bytes:\n        __nonzero__ = __bool__\n\n    def __call__(self, fullpath):\n        return iter(())\n\n\ndef safe_listdir(path):\n    \"\"\"\n    Attempt to list contents of path, but suppress some exceptions.\n    \"\"\"\n    try:\n        return os.listdir(path)\n    except (PermissionError, NotADirectoryError):\n        pass\n    except OSError as e:\n        # Ignore the directory if does not exist, not a directory or\n        # permission denied\n        ignorable = (\n            e.errno in (errno.ENOTDIR, errno.EACCES, errno.ENOENT)\n            # Python 2 on Windows needs to be handled this way :(\n            or getattr(e, \"winerror\", None) == 267\n        )\n        if not ignorable:\n            raise\n    return ()\n\n\ndef distributions_from_metadata(path):\n    root = os.path.dirname(path)\n    if os.path.isdir(path):\n        if len(os.listdir(path)) == 0:\n            # empty metadata dir; skip\n            return\n        metadata = PathMetadata(root, path)\n    else:\n        metadata = FileMetadata(path)\n    entry = os.path.basename(path)\n    yield Distribution.from_location(\n        root, entry, metadata, precedence=DEVELOP_DIST,\n    )\n\n\ndef non_empty_lines(path):\n    \"\"\"\n    Yield non-empty lines from file at path\n    \"\"\"\n    with open(path) as f:\n        for line in f:\n            line = line.strip()\n            if line:\n                yield line\n\n\ndef resolve_egg_link(path):\n    \"\"\"\n    Given a path to an .egg-link, resolve distributions\n    present in the referenced path.\n    \"\"\"\n    referenced_paths = non_empty_lines(path)\n    resolved_paths = (\n        os.path.join(os.path.dirname(path), ref)\n        for ref in referenced_paths\n    )\n    dist_groups = map(find_distributions, resolved_paths)\n    return next(dist_groups, ())\n\n\nregister_finder(pkgutil.ImpImporter, find_on_path)\n\nif hasattr(importlib_machinery, 'FileFinder'):\n    register_finder(importlib_machinery.FileFinder, find_on_path)\n\n_declare_state('dict', _namespace_handlers={})\n_declare_state('dict', _namespace_packages={})\n\n\ndef register_namespace_handler(importer_type, namespace_handler):\n    \"\"\"Register `namespace_handler` to declare namespace packages\n\n    `importer_type` is the type or class of a PEP 302 \"Importer\" (sys.path item\n    handler), and `namespace_handler` is a callable like this::\n\n        def namespace_handler(importer, path_entry, moduleName, module):\n            # return a path_entry to use for child packages\n\n    Namespace handlers are only called if the importer object has already\n    agreed that it can handle the relevant path item, and they should only\n    return a subpath if the module __path__ does not already contain an\n    equivalent subpath.  For an example namespace handler, see\n    ``pkg_resources.file_ns_handler``.\n    \"\"\"\n    _namespace_handlers[importer_type] = namespace_handler\n\n\ndef _handle_ns(packageName, path_item):\n    \"\"\"Ensure that named package includes a subpath of path_item (if needed)\"\"\"\n\n    importer = get_importer(path_item)\n    if importer is None:\n        return None\n\n    # capture warnings due to #1111\n    with warnings.catch_warnings():\n        warnings.simplefilter(\"ignore\")\n        loader = importer.find_module(packageName)\n\n    if loader is None:\n        return None\n    module = sys.modules.get(packageName)\n    if module is None:\n        module = sys.modules[packageName] = types.ModuleType(packageName)\n        module.__path__ = []\n        _set_parent_ns(packageName)\n    elif not hasattr(module, '__path__'):\n        raise TypeError(\"Not a package:\", packageName)\n    handler = _find_adapter(_namespace_handlers, importer)\n    subpath = handler(importer, path_item, packageName, module)\n    if subpath is not None:\n        path = module.__path__\n        path.append(subpath)\n        loader.load_module(packageName)\n        _rebuild_mod_path(path, packageName, module)\n    return subpath\n\n\ndef _rebuild_mod_path(orig_path, package_name, module):\n    \"\"\"\n    Rebuild module.__path__ ensuring that all entries are ordered\n    corresponding to their sys.path order\n    \"\"\"\n    sys_path = [_normalize_cached(p) for p in sys.path]\n\n    def safe_sys_path_index(entry):\n        \"\"\"\n        Workaround for #520 and #513.\n        \"\"\"\n        try:\n            return sys_path.index(entry)\n        except ValueError:\n            return float('inf')\n\n    def position_in_sys_path(path):\n        \"\"\"\n        Return the ordinal of the path based on its position in sys.path\n        \"\"\"\n        path_parts = path.split(os.sep)\n        module_parts = package_name.count('.') + 1\n        parts = path_parts[:-module_parts]\n        return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))\n\n    new_path = sorted(orig_path, key=position_in_sys_path)\n    new_path = [_normalize_cached(p) for p in new_path]\n\n    if isinstance(module.__path__, list):\n        module.__path__[:] = new_path\n    else:\n        module.__path__ = new_path\n\n\ndef declare_namespace(packageName):\n    \"\"\"Declare that package 'packageName' is a namespace package\"\"\"\n\n    _imp.acquire_lock()\n    try:\n        if packageName in _namespace_packages:\n            return\n\n        path = sys.path\n        parent, _, _ = packageName.rpartition('.')\n\n        if parent:\n            declare_namespace(parent)\n            if parent not in _namespace_packages:\n                __import__(parent)\n            try:\n                path = sys.modules[parent].__path__\n            except AttributeError:\n                raise TypeError(\"Not a package:\", parent)\n\n        # Track what packages are namespaces, so when new path items are added,\n        # they can be updated\n        _namespace_packages.setdefault(parent or None, []).append(packageName)\n        _namespace_packages.setdefault(packageName, [])\n\n        for path_item in path:\n            # Ensure all the parent's path items are reflected in the child,\n            # if they apply\n            _handle_ns(packageName, path_item)\n\n    finally:\n        _imp.release_lock()\n\n\ndef fixup_namespace_packages(path_item, parent=None):\n    \"\"\"Ensure that previously-declared namespace packages include path_item\"\"\"\n    _imp.acquire_lock()\n    try:\n        for package in _namespace_packages.get(parent, ()):\n            subpath = _handle_ns(package, path_item)\n            if subpath:\n                fixup_namespace_packages(subpath, package)\n    finally:\n        _imp.release_lock()\n\n\ndef file_ns_handler(importer, path_item, packageName, module):\n    \"\"\"Compute an ns-package subpath for a filesystem or zipfile importer\"\"\"\n\n    subpath = os.path.join(path_item, packageName.split('.')[-1])\n    normalized = _normalize_cached(subpath)\n    for item in module.__path__:\n        if _normalize_cached(item) == normalized:\n            break\n    else:\n        # Only return the path if it's not already there\n        return subpath\n\n\nregister_namespace_handler(pkgutil.ImpImporter, file_ns_handler)\nregister_namespace_handler(zipimport.zipimporter, file_ns_handler)\n\nif hasattr(importlib_machinery, 'FileFinder'):\n    register_namespace_handler(importlib_machinery.FileFinder, file_ns_handler)\n\n\ndef null_ns_handler(importer, path_item, packageName, module):\n    return None\n\n\nregister_namespace_handler(object, null_ns_handler)\n\n\ndef normalize_path(filename):\n    \"\"\"Normalize a file/dir name for comparison purposes\"\"\"\n    return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename))))\n\n\ndef _cygwin_patch(filename):  # pragma: nocover\n    \"\"\"\n    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains\n    symlink components. Using\n    os.path.abspath() works around this limitation. A fix in os.getcwd()\n    would probably better, in Cygwin even more so, except\n    that this seems to be by design...\n    \"\"\"\n    return os.path.abspath(filename) if sys.platform == 'cygwin' else filename\n\n\ndef _normalize_cached(filename, _cache={}):\n    try:\n        return _cache[filename]\n    except KeyError:\n        _cache[filename] = result = normalize_path(filename)\n        return result\n\n\ndef _is_egg_path(path):\n    \"\"\"\n    Determine if given path appears to be an egg.\n    \"\"\"\n    return path.lower().endswith('.egg')\n\n\ndef _is_unpacked_egg(path):\n    \"\"\"\n    Determine if given path appears to be an unpacked egg.\n    \"\"\"\n    return (\n        _is_egg_path(path) and\n        os.path.isfile(os.path.join(path, 'EGG-INFO', 'PKG-INFO'))\n    )\n\n\ndef _set_parent_ns(packageName):\n    parts = packageName.split('.')\n    name = parts.pop()\n    if parts:\n        parent = '.'.join(parts)\n        setattr(sys.modules[parent], name, sys.modules[packageName])\n\n\ndef yield_lines(strs):\n    \"\"\"Yield non-empty/non-comment lines of a string or sequence\"\"\"\n    if isinstance(strs, six.string_types):\n        for s in strs.splitlines():\n            s = s.strip()\n            # skip blank lines/comments\n            if s and not s.startswith('#'):\n                yield s\n    else:\n        for ss in strs:\n            for s in yield_lines(ss):\n                yield s\n\n\nMODULE = re.compile(r\"\\w+(\\.\\w+)*$\").match\nEGG_NAME = re.compile(\n    r\"\"\"\n    (?P<name>[^-]+) (\n        -(?P<ver>[^-]+) (\n            -py(?P<pyver>[^-]+) (\n                -(?P<plat>.+)\n            )?\n        )?\n    )?\n    \"\"\",\n    re.VERBOSE | re.IGNORECASE,\n).match\n\n\nclass EntryPoint:\n    \"\"\"Object representing an advertised importable object\"\"\"\n\n    def __init__(self, name, module_name, attrs=(), extras=(), dist=None):\n        if not MODULE(module_name):\n            raise ValueError(\"Invalid module name\", module_name)\n        self.name = name\n        self.module_name = module_name\n        self.attrs = tuple(attrs)\n        self.extras = tuple(extras)\n        self.dist = dist\n\n    def __str__(self):\n        s = \"%s = %s\" % (self.name, self.module_name)\n        if self.attrs:\n            s += ':' + '.'.join(self.attrs)\n        if self.extras:\n            s += ' [%s]' % ','.join(self.extras)\n        return s\n\n    def __repr__(self):\n        return \"EntryPoint.parse(%r)\" % str(self)\n\n    def load(self, require=True, *args, **kwargs):\n        \"\"\"\n        Require packages for this EntryPoint, then resolve it.\n        \"\"\"\n        if not require or args or kwargs:\n            warnings.warn(\n                \"Parameters to load are deprecated.  Call .resolve and \"\n                \".require separately.\",\n                PkgResourcesDeprecationWarning,\n                stacklevel=2,\n            )\n        if require:\n            self.require(*args, **kwargs)\n        return self.resolve()\n\n    def resolve(self):\n        \"\"\"\n        Resolve the entry point from its module and attrs.\n        \"\"\"\n        module = __import__(self.module_name, fromlist=['__name__'], level=0)\n        try:\n            return functools.reduce(getattr, self.attrs, module)\n        except AttributeError as exc:\n            raise ImportError(str(exc))\n\n    def require(self, env=None, installer=None):\n        if self.extras and not self.dist:\n            raise UnknownExtra(\"Can't require() without a distribution\", self)\n\n        # Get the requirements for this entry point with all its extras and\n        # then resolve them. We have to pass `extras` along when resolving so\n        # that the working set knows what extras we want. Otherwise, for\n        # dist-info distributions, the working set will assume that the\n        # requirements for that extra are purely optional and skip over them.\n        reqs = self.dist.requires(self.extras)\n        items = working_set.resolve(reqs, env, installer, extras=self.extras)\n        list(map(working_set.add, items))\n\n    pattern = re.compile(\n        r'\\s*'\n        r'(?P<name>.+?)\\s*'\n        r'=\\s*'\n        r'(?P<module>[\\w.]+)\\s*'\n        r'(:\\s*(?P<attr>[\\w.]+))?\\s*'\n        r'(?P<extras>\\[.*\\])?\\s*$'\n    )\n\n    @classmethod\n    def parse(cls, src, dist=None):\n        \"\"\"Parse a single entry point from string `src`\n\n        Entry point syntax follows the form::\n\n            name = some.module:some.attr [extra1, extra2]\n\n        The entry name and module name are required, but the ``:attrs`` and\n        ``[extras]`` parts are optional\n        \"\"\"\n        m = cls.pattern.match(src)\n        if not m:\n            msg = \"EntryPoint must be in 'name=module:attrs [extras]' format\"\n            raise ValueError(msg, src)\n        res = m.groupdict()\n        extras = cls._parse_extras(res['extras'])\n        attrs = res['attr'].split('.') if res['attr'] else ()\n        return cls(res['name'], res['module'], attrs, extras, dist)\n\n    @classmethod\n    def _parse_extras(cls, extras_spec):\n        if not extras_spec:\n            return ()\n        req = Requirement.parse('x' + extras_spec)\n        if req.specs:\n            raise ValueError()\n        return req.extras\n\n    @classmethod\n    def parse_group(cls, group, lines, dist=None):\n        \"\"\"Parse an entry point group\"\"\"\n        if not MODULE(group):\n            raise ValueError(\"Invalid group name\", group)\n        this = {}\n        for line in yield_lines(lines):\n            ep = cls.parse(line, dist)\n            if ep.name in this:\n                raise ValueError(\"Duplicate entry point\", group, ep.name)\n            this[ep.name] = ep\n        return this\n\n    @classmethod\n    def parse_map(cls, data, dist=None):\n        \"\"\"Parse a map of entry point groups\"\"\"\n        if isinstance(data, dict):\n            data = data.items()\n        else:\n            data = split_sections(data)\n        maps = {}\n        for group, lines in data:\n            if group is None:\n                if not lines:\n                    continue\n                raise ValueError(\"Entry points must be listed in groups\")\n            group = group.strip()\n            if group in maps:\n                raise ValueError(\"Duplicate group name\", group)\n            maps[group] = cls.parse_group(group, lines, dist)\n        return maps\n\n\ndef _remove_md5_fragment(location):\n    if not location:\n        return ''\n    parsed = urllib.parse.urlparse(location)\n    if parsed[-1].startswith('md5='):\n        return urllib.parse.urlunparse(parsed[:-1] + ('',))\n    return location\n\n\ndef _version_from_file(lines):\n    \"\"\"\n    Given an iterable of lines from a Metadata file, return\n    the value of the Version field, if present, or None otherwise.\n    \"\"\"\n    def is_version_line(line):\n        return line.lower().startswith('version:')\n    version_lines = filter(is_version_line, lines)\n    line = next(iter(version_lines), '')\n    _, _, value = line.partition(':')\n    return safe_version(value.strip()) or None\n\n\nclass Distribution:\n    \"\"\"Wrap an actual or potential sys.path entry w/metadata\"\"\"\n    PKG_INFO = 'PKG-INFO'\n\n    def __init__(\n            self, location=None, metadata=None, project_name=None,\n            version=None, py_version=PY_MAJOR, platform=None,\n            precedence=EGG_DIST):\n        self.project_name = safe_name(project_name or 'Unknown')\n        if version is not None:\n            self._version = safe_version(version)\n        self.py_version = py_version\n        self.platform = platform\n        self.location = location\n        self.precedence = precedence\n        self._provider = metadata or empty_provider\n\n    @classmethod\n    def from_location(cls, location, basename, metadata=None, **kw):\n        project_name, version, py_version, platform = [None] * 4\n        basename, ext = os.path.splitext(basename)\n        if ext.lower() in _distributionImpl:\n            cls = _distributionImpl[ext.lower()]\n\n            match = EGG_NAME(basename)\n            if match:\n                project_name, version, py_version, platform = match.group(\n                    'name', 'ver', 'pyver', 'plat'\n                )\n        return cls(\n            location, metadata, project_name=project_name, version=version,\n            py_version=py_version, platform=platform, **kw\n        )._reload_version()\n\n    def _reload_version(self):\n        return self\n\n    @property\n    def hashcmp(self):\n        return (\n            self.parsed_version,\n            self.precedence,\n            self.key,\n            _remove_md5_fragment(self.location),\n            self.py_version or '',\n            self.platform or '',\n        )\n\n    def __hash__(self):\n        return hash(self.hashcmp)\n\n    def __lt__(self, other):\n        return self.hashcmp < other.hashcmp\n\n    def __le__(self, other):\n        return self.hashcmp <= other.hashcmp\n\n    def __gt__(self, other):\n        return self.hashcmp > other.hashcmp\n\n    def __ge__(self, other):\n        return self.hashcmp >= other.hashcmp\n\n    def __eq__(self, other):\n        if not isinstance(other, self.__class__):\n            # It's not a Distribution, so they are not equal\n            return False\n        return self.hashcmp == other.hashcmp\n\n    def __ne__(self, other):\n        return not self == other\n\n    # These properties have to be lazy so that we don't have to load any\n    # metadata until/unless it's actually needed.  (i.e., some distributions\n    # may not know their name or version without loading PKG-INFO)\n\n    @property\n    def key(self):\n        try:\n            return self._key\n        except AttributeError:\n            self._key = key = self.project_name.lower()\n            return key\n\n    @property\n    def parsed_version(self):\n        if not hasattr(self, \"_parsed_version\"):\n            self._parsed_version = parse_version(self.version)\n\n        return self._parsed_version\n\n    def _warn_legacy_version(self):\n        LV = packaging.version.LegacyVersion\n        is_legacy = isinstance(self._parsed_version, LV)\n        if not is_legacy:\n            return\n\n        # While an empty version is technically a legacy version and\n        # is not a valid PEP 440 version, it's also unlikely to\n        # actually come from someone and instead it is more likely that\n        # it comes from setuptools attempting to parse a filename and\n        # including it in the list. So for that we'll gate this warning\n        # on if the version is anything at all or not.\n        if not self.version:\n            return\n\n        tmpl = textwrap.dedent(\"\"\"\n            '{project_name} ({version})' is being parsed as a legacy,\n            non PEP 440,\n            version. You may find odd behavior and sort order.\n            In particular it will be sorted as less than 0.0. It\n            is recommended to migrate to PEP 440 compatible\n            versions.\n            \"\"\").strip().replace('\\n', ' ')\n\n        warnings.warn(tmpl.format(**vars(self)), PEP440Warning)\n\n    @property\n    def version(self):\n        try:\n            return self._version\n        except AttributeError:\n            version = self._get_version()\n            if version is None:\n                path = self._get_metadata_path_for_display(self.PKG_INFO)\n                msg = (\n                    \"Missing 'Version:' header and/or {} file at path: {}\"\n                ).format(self.PKG_INFO, path)\n                raise ValueError(msg, self)\n\n            return version\n\n    @property\n    def _dep_map(self):\n        \"\"\"\n        A map of extra to its list of (direct) requirements\n        for this distribution, including the null extra.\n        \"\"\"\n        try:\n            return self.__dep_map\n        except AttributeError:\n            self.__dep_map = self._filter_extras(self._build_dep_map())\n        return self.__dep_map\n\n    @staticmethod\n    def _filter_extras(dm):\n        \"\"\"\n        Given a mapping of extras to dependencies, strip off\n        environment markers and filter out any dependencies\n        not matching the markers.\n        \"\"\"\n        for extra in list(filter(None, dm)):\n            new_extra = extra\n            reqs = dm.pop(extra)\n            new_extra, _, marker = extra.partition(':')\n            fails_marker = marker and (\n                invalid_marker(marker)\n                or not evaluate_marker(marker)\n            )\n            if fails_marker:\n                reqs = []\n            new_extra = safe_extra(new_extra) or None\n\n            dm.setdefault(new_extra, []).extend(reqs)\n        return dm\n\n    def _build_dep_map(self):\n        dm = {}\n        for name in 'requires.txt', 'depends.txt':\n            for extra, reqs in split_sections(self._get_metadata(name)):\n                dm.setdefault(extra, []).extend(parse_requirements(reqs))\n        return dm\n\n    def requires(self, extras=()):\n        \"\"\"List of Requirements needed for this distro if `extras` are used\"\"\"\n        dm = self._dep_map\n        deps = []\n        deps.extend(dm.get(None, ()))\n        for ext in extras:\n            try:\n                deps.extend(dm[safe_extra(ext)])\n            except KeyError:\n                raise UnknownExtra(\n                    \"%s has no such extra feature %r\" % (self, ext)\n                )\n        return deps\n\n    def _get_metadata_path_for_display(self, name):\n        \"\"\"\n        Return the path to the given metadata file, if available.\n        \"\"\"\n        try:\n            # We need to access _get_metadata_path() on the provider object\n            # directly rather than through this class's __getattr__()\n            # since _get_metadata_path() is marked private.\n            path = self._provider._get_metadata_path(name)\n\n        # Handle exceptions e.g. in case the distribution's metadata\n        # provider doesn't support _get_metadata_path().\n        except Exception:\n            return '[could not detect]'\n\n        return path\n\n    def _get_metadata(self, name):\n        if self.has_metadata(name):\n            for line in self.get_metadata_lines(name):\n                yield line\n\n    def _get_version(self):\n        lines = self._get_metadata(self.PKG_INFO)\n        version = _version_from_file(lines)\n\n        return version\n\n    def activate(self, path=None, replace=False):\n        \"\"\"Ensure distribution is importable on `path` (default=sys.path)\"\"\"\n        if path is None:\n            path = sys.path\n        self.insert_on(path, replace=replace)\n        if path is sys.path:\n            fixup_namespace_packages(self.location)\n            for pkg in self._get_metadata('namespace_packages.txt'):\n                if pkg in sys.modules:\n                    declare_namespace(pkg)\n\n    def egg_name(self):\n        \"\"\"Return what this distribution's standard .egg filename should be\"\"\"\n        filename = \"%s-%s-py%s\" % (\n            to_filename(self.project_name), to_filename(self.version),\n            self.py_version or PY_MAJOR\n        )\n\n        if self.platform:\n            filename += '-' + self.platform\n        return filename\n\n    def __repr__(self):\n        if self.location:\n            return \"%s (%s)\" % (self, self.location)\n        else:\n            return str(self)\n\n    def __str__(self):\n        try:\n            version = getattr(self, 'version', None)\n        except ValueError:\n            version = None\n        version = version or \"[unknown version]\"\n        return \"%s %s\" % (self.project_name, version)\n\n    def __getattr__(self, attr):\n        \"\"\"Delegate all unrecognized public attributes to .metadata provider\"\"\"\n        if attr.startswith('_'):\n            raise AttributeError(attr)\n        return getattr(self._provider, attr)\n\n    def __dir__(self):\n        return list(\n            set(super(Distribution, self).__dir__())\n            | set(\n                attr for attr in self._provider.__dir__()\n                if not attr.startswith('_')\n            )\n        )\n\n    if not hasattr(object, '__dir__'):\n        # python 2.7 not supported\n        del __dir__\n\n    @classmethod\n    def from_filename(cls, filename, metadata=None, **kw):\n        return cls.from_location(\n            _normalize_cached(filename), os.path.basename(filename), metadata,\n            **kw\n        )\n\n    def as_requirement(self):\n        \"\"\"Return a ``Requirement`` that matches this distribution exactly\"\"\"\n        if isinstance(self.parsed_version, packaging.version.Version):\n            spec = \"%s==%s\" % (self.project_name, self.parsed_version)\n        else:\n            spec = \"%s===%s\" % (self.project_name, self.parsed_version)\n\n        return Requirement.parse(spec)\n\n    def load_entry_point(self, group, name):\n        \"\"\"Return the `name` entry point of `group` or raise ImportError\"\"\"\n        ep = self.get_entry_info(group, name)\n        if ep is None:\n            raise ImportError(\"Entry point %r not found\" % ((group, name),))\n        return ep.load()\n\n    def get_entry_map(self, group=None):\n        \"\"\"Return the entry point map for `group`, or the full entry map\"\"\"\n        try:\n            ep_map = self._ep_map\n        except AttributeError:\n            ep_map = self._ep_map = EntryPoint.parse_map(\n                self._get_metadata('entry_points.txt'), self\n            )\n        if group is not None:\n            return ep_map.get(group, {})\n        return ep_map\n\n    def get_entry_info(self, group, name):\n        \"\"\"Return the EntryPoint object for `group`+`name`, or ``None``\"\"\"\n        return self.get_entry_map(group).get(name)\n\n    def insert_on(self, path, loc=None, replace=False):\n        \"\"\"Ensure self.location is on path\n\n        If replace=False (default):\n            - If location is already in path anywhere, do nothing.\n            - Else:\n              - If it's an egg and its parent directory is on path,\n                insert just ahead of the parent.\n              - Else: add to the end of path.\n        If replace=True:\n            - If location is already on path anywhere (not eggs)\n              or higher priority than its parent (eggs)\n              do nothing.\n            - Else:\n              - If it's an egg and its parent directory is on path,\n                insert just ahead of the parent,\n                removing any lower-priority entries.\n              - Else: add it to the front of path.\n        \"\"\"\n\n        loc = loc or self.location\n        if not loc:\n            return\n\n        nloc = _normalize_cached(loc)\n        bdir = os.path.dirname(nloc)\n        npath = [(p and _normalize_cached(p) or p) for p in path]\n\n        for p, item in enumerate(npath):\n            if item == nloc:\n                if replace:\n                    break\n                else:\n                    # don't modify path (even removing duplicates) if\n                    # found and not replace\n                    return\n            elif item == bdir and self.precedence == EGG_DIST:\n                # if it's an .egg, give it precedence over its directory\n                # UNLESS it's already been added to sys.path and replace=False\n                if (not replace) and nloc in npath[p:]:\n                    return\n                if path is sys.path:\n                    self.check_version_conflict()\n                path.insert(p, loc)\n                npath.insert(p, nloc)\n                break\n        else:\n            if path is sys.path:\n                self.check_version_conflict()\n            if replace:\n                path.insert(0, loc)\n            else:\n                path.append(loc)\n            return\n\n        # p is the spot where we found or inserted loc; now remove duplicates\n        while True:\n            try:\n                np = npath.index(nloc, p + 1)\n            except ValueError:\n                break\n            else:\n                del npath[np], path[np]\n                # ha!\n                p = np\n\n        return\n\n    def check_version_conflict(self):\n        if self.key == 'setuptools':\n            # ignore the inevitable setuptools self-conflicts  :(\n            return\n\n        nsp = dict.fromkeys(self._get_metadata('namespace_packages.txt'))\n        loc = normalize_path(self.location)\n        for modname in self._get_metadata('top_level.txt'):\n            if (modname not in sys.modules or modname in nsp\n                    or modname in _namespace_packages):\n                continue\n            if modname in ('pkg_resources', 'setuptools', 'site'):\n                continue\n            fn = getattr(sys.modules[modname], '__file__', None)\n            if fn and (normalize_path(fn).startswith(loc) or\n                       fn.startswith(self.location)):\n                continue\n            issue_warning(\n                \"Module %s was already imported from %s, but %s is being added\"\n                \" to sys.path\" % (modname, fn, self.location),\n            )\n\n    def has_version(self):\n        try:\n            self.version\n        except ValueError:\n            issue_warning(\"Unbuilt egg for \" + repr(self))\n            return False\n        return True\n\n    def clone(self, **kw):\n        \"\"\"Copy this distribution, substituting in any changed keyword args\"\"\"\n        names = 'project_name version py_version platform location precedence'\n        for attr in names.split():\n            kw.setdefault(attr, getattr(self, attr, None))\n        kw.setdefault('metadata', self._provider)\n        return self.__class__(**kw)\n\n    @property\n    def extras(self):\n        return [dep for dep in self._dep_map if dep]\n\n\nclass EggInfoDistribution(Distribution):\n    def _reload_version(self):\n        \"\"\"\n        Packages installed by distutils (e.g. numpy or scipy),\n        which uses an old safe_version, and so\n        their version numbers can get mangled when\n        converted to filenames (e.g., 1.11.0.dev0+2329eae to\n        1.11.0.dev0_2329eae). These distributions will not be\n        parsed properly\n        downstream by Distribution and safe_version, so\n        take an extra step and try to get the version number from\n        the metadata file itself instead of the filename.\n        \"\"\"\n        md_version = self._get_version()\n        if md_version:\n            self._version = md_version\n        return self\n\n\nclass DistInfoDistribution(Distribution):\n    \"\"\"\n    Wrap an actual or potential sys.path entry\n    w/metadata, .dist-info style.\n    \"\"\"\n    PKG_INFO = 'METADATA'\n    EQEQ = re.compile(r\"([\\(,])\\s*(\\d.*?)\\s*([,\\)])\")\n\n    @property\n    def _parsed_pkg_info(self):\n        \"\"\"Parse and cache metadata\"\"\"\n        try:\n            return self._pkg_info\n        except AttributeError:\n            metadata = self.get_metadata(self.PKG_INFO)\n            self._pkg_info = email.parser.Parser().parsestr(metadata)\n            return self._pkg_info\n\n    @property\n    def _dep_map(self):\n        try:\n            return self.__dep_map\n        except AttributeError:\n            self.__dep_map = self._compute_dependencies()\n            return self.__dep_map\n\n    def _compute_dependencies(self):\n        \"\"\"Recompute this distribution's dependencies.\"\"\"\n        dm = self.__dep_map = {None: []}\n\n        reqs = []\n        # Including any condition expressions\n        for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:\n            reqs.extend(parse_requirements(req))\n\n        def reqs_for_extra(extra):\n            for req in reqs:\n                if not req.marker or req.marker.evaluate({'extra': extra}):\n                    yield req\n\n        common = frozenset(reqs_for_extra(None))\n        dm[None].extend(common)\n\n        for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []:\n            s_extra = safe_extra(extra.strip())\n            dm[s_extra] = list(frozenset(reqs_for_extra(extra)) - common)\n\n        return dm\n\n\n_distributionImpl = {\n    '.egg': Distribution,\n    '.egg-info': EggInfoDistribution,\n    '.dist-info': DistInfoDistribution,\n}\n\n\ndef issue_warning(*args, **kw):\n    level = 1\n    g = globals()\n    try:\n        # find the first stack frame that is *not* code in\n        # the pkg_resources module, to use for the warning\n        while sys._getframe(level).f_globals is g:\n            level += 1\n    except ValueError:\n        pass\n    warnings.warn(stacklevel=level + 1, *args, **kw)\n\n\nclass RequirementParseError(ValueError):\n    def __str__(self):\n        return ' '.join(self.args)\n\n\ndef parse_requirements(strs):\n    \"\"\"Yield ``Requirement`` objects for each specification in `strs`\n\n    `strs` must be a string, or a (possibly-nested) iterable thereof.\n    \"\"\"\n    # create a steppable iterator, so we can handle \\-continuations\n    lines = iter(yield_lines(strs))\n\n    for line in lines:\n        # Drop comments -- a hash without a space may be in a URL.\n        if ' #' in line:\n            line = line[:line.find(' #')]\n        # If there is a line continuation, drop it, and append the next line.\n        if line.endswith('\\\\'):\n            line = line[:-2].strip()\n            try:\n                line += next(lines)\n            except StopIteration:\n                return\n        yield Requirement(line)\n\ndef _always_object(classes):\n    \"\"\"\n    Ensure object appears in the mro even\n    for old-style classes.\n    \"\"\"\n    if object not in classes:\n        return classes + (object,)\n    return classes\n\n\ndef _find_adapter(registry, ob):\n    \"\"\"Return an adapter factory for `ob` from `registry`\"\"\"\n    types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob))))\n    for t in types:\n        if t in registry:\n            return registry[t]\n\n\ndef ensure_directory(path):\n    \"\"\"Ensure that the parent directory of `path` exists\"\"\"\n    dirname = os.path.dirname(path)\n    py31compat.makedirs(dirname, exist_ok=True)\n\n\ndef _bypass_ensure_directory(path):\n    \"\"\"Sandbox-bypassing version of ensure_directory()\"\"\"\n    if not WRITE_SUPPORT:\n        raise IOError('\"os.mkdir\" not supported on this platform.')\n    dirname, filename = split(path)\n    if dirname and filename and not isdir(dirname):\n        _bypass_ensure_directory(dirname)\n        try:\n            mkdir(dirname, 0o755)\n        except FileExistsError:\n            pass\n\n\ndef split_sections(s):\n    \"\"\"Split a string or iterable thereof into (section, content) pairs\n\n    Each ``section`` is a stripped version of the section header (\"[section]\")\n    and each ``content`` is a list of stripped lines excluding blank lines and\n    comment-only lines.  If there are any such lines before the first section\n    header, they're returned in a first ``section`` of ``None``.\n    \"\"\"\n    section = None\n    content = []\n    for line in yield_lines(s):\n        if line.startswith(\"[\"):\n            if line.endswith(\"]\"):\n                if section or content:\n                    yield section, content\n                section = line[1:-1].strip()\n                content = []\n            else:\n                raise ValueError(\"Invalid section heading\", line)\n        else:\n            content.append(line)\n\n    # wrap up last segment\n    yield section, content\n\n\ndef _mkstemp(*args, **kw):\n    old_open = os.open\n    try:\n        # temporarily bypass sandboxing\n        os.open = os_open\n        return tempfile.mkstemp(*args, **kw)\n    finally:\n        # and then put it back\n        os.open = old_open\n\n\n# Silence the PEP440Warning by default, so that end users don't get hit by it\n# randomly just because they use pkg_resources. We want to append the rule\n# because we want earlier uses of filterwarnings to take precedence over this\n# one.\nwarnings.filterwarnings(\"ignore\", category=PEP440Warning, append=True)\n\n\n# from jaraco.functools 1.3\ndef _call_aside(f, *args, **kwargs):\n    f(*args, **kwargs)\n    return f\n\n\n@_call_aside\ndef _initialize(g=globals()):\n    \"Set up global resource manager (deliberately not state-saved)\"\n    manager = ResourceManager()\n\n    assert \"sys\" not in dir(manager), manager\n\n    g['_manager'] = manager\n    g.update(\n        (name, getattr(manager, name))\n        for name in dir(manager)\n        if not name.startswith('_')\n    )\n\n\n@_call_aside\ndef _initialize_master_working_set():\n    \"\"\"\n    Prepare the master working set and make the ``require()``\n    API available.\n\n    This function has explicit effects on the global state\n    of pkg_resources. It is intended to be invoked once at\n    the initialization of this module.\n\n    Invocation by other packages is unsupported and done\n    at their own risk.\n    \"\"\"\n\n    # Nuitka: We do not care for this bit in Jinja2, which is the only reason the\n    # inline copy is there.\n    return\n\n    working_set = WorkingSet._build_master()\n    _declare_state('object', working_set=working_set)\n\n    require = working_set.require\n    iter_entry_points = working_set.iter_entry_points\n    add_activation_listener = working_set.subscribe\n    run_script = working_set.run_script\n    # backward compatibility\n    run_main = run_script\n    # Activate all distributions already on sys.path with replace=False and\n    # ensure that all distributions added to the working set in the future\n    # (e.g. by calling ``require()``) will get activated as well,\n    # with higher priority (replace=True).\n    tuple(\n        dist.activate(replace=False)\n        for dist in working_set\n    )\n    add_activation_listener(\n        lambda dist: dist.activate(replace=True),\n        existing=False,\n    )\n    working_set.entries = []\n    # match order\n    list(map(working_set.add_entry, sys.path))\n    globals().update(locals())\n\nclass PkgResourcesDeprecationWarning(Warning):\n    \"\"\"\n    Base class for warning about deprecations in ``pkg_resources``\n\n    This class is not derived from ``DeprecationWarning``, and as such is\n    visible by default.\n    \"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py",
    "content": "import os\nimport errno\nimport sys\n\n\ndef _makedirs_31(path, exist_ok=False):\n    try:\n        os.makedirs(path)\n    except OSError as exc:\n        if not exist_ok or exc.errno != errno.EEXIST:\n            raise\n\n\n# rely on compatibility behavior until mode considerations\n#  and exists_ok considerations are disentangled.\n# See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663\nneeds_makedirs = (\n    str is bytes or\n    (3, 4) <= sys.version_info < (3, 4, 1)\n)\nmakedirs = _makedirs_31 if needs_makedirs else os.makedirs\n"
  },
  {
    "path": "nuitka/build/inline_copy/pkg_resources_27/pkg_resources/__init__.py",
    "content": "# coding: utf-8\n\"\"\"\nPackage resource API\n--------------------\n\nA resource is a logical file contained within a package, or a logical\nsubdirectory thereof.  The package resource API expects resource names\nto have their path parts separated with ``/``, *not* whatever the local\npath separator is.  Do not use os.path operations to manipulate resource\nnames being passed into the API.\n\nThe package resource API is designed to work with normal filesystem packages,\n.egg files, and unpacked .egg files.  It can also work in a limited way with\n.zip files and with custom PEP 302 loaders that support the ``get_data()``\nmethod.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport sys\nimport os\nimport io\nimport time\nimport re\nimport types\nimport zipfile\nimport zipimport\nimport warnings\nimport stat\nimport functools\nimport pkgutil\nimport operator\nimport platform\nimport collections\nimport plistlib\nimport email.parser\nimport errno\nimport tempfile\nimport textwrap\nimport itertools\nimport inspect\nimport ntpath\nimport posixpath\nfrom pkgutil import get_importer\n\ntry:\n    import _imp\nexcept ImportError:\n    # Python 3.2 compatibility\n    import imp as _imp\n\ntry:\n    FileExistsError\nexcept NameError:\n    FileExistsError = OSError\n\n# Nuitka: Do not use six, we don't have these extern\n# packages included.\n# from pkg_resources.extern import six\n# from pkg_resources.extern.six.moves import urllib, map, filter\n\n# capture these to bypass sandboxing\nfrom os import utime\ntry:\n    from os import mkdir, rename, unlink\n    WRITE_SUPPORT = True\nexcept ImportError:\n    # no write support, probably under GAE\n    WRITE_SUPPORT = False\n\nfrom os import open as os_open\nfrom os.path import isdir, split\n\ntry:\n    import importlib.machinery as importlib_machinery\n    # access attribute to force import under delayed import mechanisms.\n    importlib_machinery.__name__\nexcept ImportError:\n    importlib_machinery = None\n\n# Nuitka: Only used for Python2\n# from . import py31compat\n# Nuitka: Do not use extern, we don't have these extern\n# packages included.\n# from pkg_resources.extern import appdirs\n# from pkg_resources.extern import packaging\n# __import__('pkg_resources.extern.packaging.version')\n# __import__('pkg_resources.extern.packaging.specifiers')\n# __import__('pkg_resources.extern.packaging.requirements')\n# __import__('pkg_resources.extern.packaging.markers')\n\n__metaclass__ = type\n\n\nif (3, 0) < sys.version_info < (3, 4):\n    raise RuntimeError(\"Python 3.4 or later is required\")\n\nif str is bytes:\n    # Those builtin exceptions are only defined in Python 3\n    PermissionError = None\n    NotADirectoryError = None\n\n# declare some globals that will be defined later to\n# satisfy the linters.\nrequire = None\nworking_set = None\nadd_activation_listener = None\nresources_stream = None\ncleanup_resources = None\nresource_dir = None\nresource_stream = None\nset_extraction_path = None\nresource_isdir = None\nresource_string = None\niter_entry_points = None\nresource_listdir = None\nresource_filename = None\nresource_exists = None\n_distribution_finders = None\n_namespace_handlers = None\n_namespace_packages = None\n\n\nclass PEP440Warning(RuntimeWarning):\n    \"\"\"\n    Used when there is an issue with a version or specifier not complying with\n    PEP 440.\n    \"\"\"\n\n\ndef parse_version(v):\n    try:\n        return packaging.version.Version(v)\n    except packaging.version.InvalidVersion:\n        return packaging.version.LegacyVersion(v)\n\n\n_state_vars = {}\n\n\ndef _declare_state(vartype, **kw):\n    assert False\n\n    globals().update(kw)\n    _state_vars.update(dict.fromkeys(kw, vartype))\n\n\ndef __getstate__():\n    assert False\n    state = {}\n    g = globals()\n    for k, v in _state_vars.items():\n        state[k] = g['_sget_' + v](g[k])\n    return state\n\n\ndef __setstate__(state):\n    assert False\n    g = globals()\n    for k, v in state.items():\n        g['_sset_' + _state_vars[k]](k, g[k], v)\n    return state\n\n\ndef _sget_dict(val):\n    return val.copy()\n\n\ndef _sset_dict(key, ob, state):\n    ob.clear()\n    ob.update(state)\n\n\ndef _sget_object(val):\n    return val.__getstate__()\n\n\ndef _sset_object(key, ob, state):\n    ob.__setstate__(state)\n\n\n_sget_none = _sset_none = lambda *args: None\n\n\ndef get_supported_platform():\n    \"\"\"Return this platform's maximum compatible version.\n\n    distutils.util.get_platform() normally reports the minimum version\n    of Mac OS X that would be required to *use* extensions produced by\n    distutils.  But what we want when checking compatibility is to know the\n    version of Mac OS X that we are *running*.  To allow usage of packages that\n    explicitly require a newer version of Mac OS X, we must also know the\n    current version of the OS.\n\n    If this condition occurs for any other platform with a version in its\n    platform strings, this function should be extended accordingly.\n    \"\"\"\n    plat = get_build_platform()\n    m = macosVersionString.match(plat)\n    if m is not None and sys.platform == \"darwin\":\n        try:\n            plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))\n        except ValueError:\n            # not Mac OS X\n            pass\n    return plat\n\n\n__all__ = [\n    # Basic resource access and distribution/entry point discovery\n    'require', 'run_script', 'get_provider', 'get_distribution',\n    'load_entry_point', 'get_entry_map', 'get_entry_info',\n    'iter_entry_points',\n    'resource_string', 'resource_stream', 'resource_filename',\n    'resource_listdir', 'resource_exists', 'resource_isdir',\n\n    # Environmental control\n    'declare_namespace', 'working_set', 'add_activation_listener',\n    'find_distributions', 'set_extraction_path', 'cleanup_resources',\n    'get_default_cache',\n\n    # Primary implementation classes\n    'Environment', 'WorkingSet', 'ResourceManager',\n    'Distribution', 'Requirement', 'EntryPoint',\n\n    # Exceptions\n    'ResolutionError', 'VersionConflict', 'DistributionNotFound',\n    'UnknownExtra', 'ExtractionError',\n\n    # Warnings\n    'PEP440Warning',\n\n    # Parsing functions and string utilities\n    'parse_requirements', 'parse_version', 'safe_name', 'safe_version',\n    'get_platform', 'compatible_platforms', 'yield_lines', 'split_sections',\n    'safe_extra', 'to_filename', 'invalid_marker', 'evaluate_marker',\n\n    # filesystem utilities\n    'ensure_directory', 'normalize_path',\n\n    # Distribution \"precedence\" constants\n    'EGG_DIST', 'BINARY_DIST', 'SOURCE_DIST', 'CHECKOUT_DIST', 'DEVELOP_DIST',\n\n    # \"Provider\" interfaces, implementations, and registration/lookup APIs\n    'IMetadataProvider', 'IResourceProvider', 'FileMetadata',\n    'PathMetadata', 'EggMetadata', 'EmptyProvider', 'empty_provider',\n    'NullProvider', 'EggProvider', 'DefaultProvider', 'ZipProvider',\n    'register_finder', 'register_namespace_handler', 'register_loader_type',\n    'fixup_namespace_packages', 'get_importer',\n\n    # Warnings\n    'PkgResourcesDeprecationWarning',\n\n    # Deprecated/backward compatibility only\n    'run_main', 'AvailableDistributions',\n]\n\n\nclass ResolutionError(Exception):\n    \"\"\"Abstract base for dependency resolution errors\"\"\"\n\n    def __repr__(self):\n        return self.__class__.__name__ + repr(self.args)\n\n\nclass VersionConflict(ResolutionError):\n    \"\"\"\n    An already-installed version conflicts with the requested version.\n\n    Should be initialized with the installed Distribution and the requested\n    Requirement.\n    \"\"\"\n\n    _template = \"{self.dist} is installed but {self.req} is required\"\n\n    @property\n    def dist(self):\n        return self.args[0]\n\n    @property\n    def req(self):\n        return self.args[1]\n\n    def report(self):\n        return self._template.format(**locals())\n\n    def with_context(self, required_by):\n        \"\"\"\n        If required_by is non-empty, return a version of self that is a\n        ContextualVersionConflict.\n        \"\"\"\n        if not required_by:\n            return self\n        args = self.args + (required_by,)\n        return ContextualVersionConflict(*args)\n\n\nclass ContextualVersionConflict(VersionConflict):\n    \"\"\"\n    A VersionConflict that accepts a third parameter, the set of the\n    requirements that required the installed Distribution.\n    \"\"\"\n\n    _template = VersionConflict._template + ' by {self.required_by}'\n\n    @property\n    def required_by(self):\n        return self.args[2]\n\n\nclass DistributionNotFound(ResolutionError):\n    \"\"\"A requested distribution was not found\"\"\"\n\n    _template = (\"The '{self.req}' distribution was not found \"\n                 \"and is required by {self.requirers_str}\")\n\n    @property\n    def req(self):\n        return self.args[0]\n\n    @property\n    def requirers(self):\n        return self.args[1]\n\n    @property\n    def requirers_str(self):\n        if not self.requirers:\n            return 'the application'\n        return ', '.join(self.requirers)\n\n    def report(self):\n        return self._template.format(**locals())\n\n    def __str__(self):\n        return self.report()\n\n\nclass UnknownExtra(ResolutionError):\n    \"\"\"Distribution doesn't have an \"extra feature\" of the given name\"\"\"\n\n\n_provider_factories = {}\n\n# Nuitka: That is to make it 2.6 compatible.\ntry:\n   PY_MAJOR = '{}.{}'.format(*sys.version_info)\nexcept ValueError:\n   PY_MAJOR = '2.6'\n\nEGG_DIST = 3\nBINARY_DIST = 2\nSOURCE_DIST = 1\nCHECKOUT_DIST = 0\nDEVELOP_DIST = -1\n\n\ndef register_loader_type(loader_type, provider_factory):\n    \"\"\"Register `provider_factory` to make providers for `loader_type`\n\n    `loader_type` is the type or class of a PEP 302 ``module.__loader__``,\n    and `provider_factory` is a function that, passed a *module* object,\n    returns an ``IResourceProvider`` for that module.\n    \"\"\"\n    _provider_factories[loader_type] = provider_factory\n\n\ndef get_provider(moduleOrReq):\n    \"\"\"Return an IResourceProvider for the named module or requirement\"\"\"\n    # Nuitka: We don't need that\n    # if isinstance(moduleOrReq, Requirement):\n    #     return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]\n    # Nuitka: No idea why, but something can erase the globals sys.\n    import sys\n    try:\n        module = sys.modules[moduleOrReq]\n    except KeyError:\n        __import__(moduleOrReq)\n        module = sys.modules[moduleOrReq]\n    loader = getattr(module, '__loader__', None)\n    return _find_adapter(_provider_factories, loader)(module)\n\n\ndef _macosx_vers(_cache=[]):\n    if not _cache:\n        version = platform.mac_ver()[0]\n        # fallback for MacPorts\n        if version == '':\n            plist = '/System/Library/CoreServices/SystemVersion.plist'\n            if os.path.exists(plist):\n                if hasattr(plistlib, 'readPlist'):\n                    plist_content = plistlib.readPlist(plist)\n                    if 'ProductVersion' in plist_content:\n                        version = plist_content['ProductVersion']\n\n        _cache.append(version.split('.'))\n    return _cache[0]\n\n\ndef _macosx_arch(machine):\n    return {'PowerPC': 'ppc', 'Power_Macintosh': 'ppc'}.get(machine, machine)\n\n\ndef get_build_platform():\n    \"\"\"Return this platform's string for platform-specific distributions\n\n    XXX Currently this is the same as ``distutils.util.get_platform()``, but it\n    needs some hacks for Linux and Mac OS X.\n    \"\"\"\n    try:\n        from sysconfig import get_platform\n    except ImportError:\n        # Nuitka 2.6 Python in Windows does this.\n        from distutils.util import get_platform\n\n    plat = get_platform()\n    if sys.platform == \"darwin\" and not plat.startswith('macosx-'):\n        try:\n            version = _macosx_vers()\n            machine = os.uname()[4].replace(\" \", \"_\")\n            return \"macosx-%d.%d-%s\" % (\n                int(version[0]), int(version[1]),\n                _macosx_arch(machine),\n            )\n        except ValueError:\n            # if someone is running a non-Mac darwin system, this will fall\n            # through to the default implementation\n            pass\n    return plat\n\n\nmacosVersionString = re.compile(r\"macosx-(\\d+)\\.(\\d+)-(.*)\")\ndarwinVersionString = re.compile(r\"darwin-(\\d+)\\.(\\d+)\\.(\\d+)-(.*)\")\n# XXX backward compat\nget_platform = get_build_platform\n\n\ndef compatible_platforms(provided, required):\n    \"\"\"Can code for the `provided` platform run on the `required` platform?\n\n    Returns true if either platform is ``None``, or the platforms are equal.\n\n    XXX Needs compatibility checks for Linux and other unixy OSes.\n    \"\"\"\n    if provided is None or required is None or provided == required:\n        # easy case\n        return True\n\n    # Mac OS X special cases\n    reqMac = macosVersionString.match(required)\n    if reqMac:\n        provMac = macosVersionString.match(provided)\n\n        # is this a Mac package?\n        if not provMac:\n            # this is backwards compatibility for packages built before\n            # setuptools 0.6. All packages built after this point will\n            # use the new macosx designation.\n            provDarwin = darwinVersionString.match(provided)\n            if provDarwin:\n                dversion = int(provDarwin.group(1))\n                macosversion = \"%s.%s\" % (reqMac.group(1), reqMac.group(2))\n                if dversion == 7 and macosversion >= \"10.3\" or \\\n                        dversion == 8 and macosversion >= \"10.4\":\n                    return True\n            # egg isn't macosx or legacy darwin\n            return False\n\n        # are they the same major version and machine type?\n        if provMac.group(1) != reqMac.group(1) or \\\n                provMac.group(3) != reqMac.group(3):\n            return False\n\n        # is the required OS major update >= the provided one?\n        if int(provMac.group(2)) > int(reqMac.group(2)):\n            return False\n\n        return True\n\n    # XXX Linux and other platforms' special cases should go here\n    return False\n\n\ndef run_script(dist_spec, script_name):\n    \"\"\"Locate distribution `dist_spec` and run its `script_name` script\"\"\"\n    # Nuitka: This seems to pollute globals\n    assert False\n\n    ns = sys._getframe(1).f_globals\n    name = ns['__name__']\n    ns.clear()\n    ns['__name__'] = name\n    require(dist_spec)[0].run_script(script_name, ns)\n\n\n# backward compatibility\nrun_main = run_script\n\n\ndef get_distribution(dist):\n    \"\"\"Return a current distribution object for a Requirement or string\"\"\"\n    if isinstance(dist, six.string_types):\n        dist = Requirement.parse(dist)\n    if isinstance(dist, Requirement):\n        dist = get_provider(dist)\n    if not isinstance(dist, Distribution):\n        raise TypeError(\"Expected string, Requirement, or Distribution\", dist)\n    return dist\n\n\ndef load_entry_point(dist, group, name):\n    \"\"\"Return `name` entry point of `group` for `dist` or raise ImportError\"\"\"\n    return get_distribution(dist).load_entry_point(group, name)\n\n\ndef get_entry_map(dist, group=None):\n    \"\"\"Return the entry point map for `group`, or the full entry map\"\"\"\n    return get_distribution(dist).get_entry_map(group)\n\n\ndef get_entry_info(dist, group, name):\n    \"\"\"Return the EntryPoint object for `group`+`name`, or ``None``\"\"\"\n    return get_distribution(dist).get_entry_info(group, name)\n\n\nclass IMetadataProvider:\n    def has_metadata(name):\n        \"\"\"Does the package's distribution contain the named metadata?\"\"\"\n\n    def get_metadata(name):\n        \"\"\"The named metadata resource as a string\"\"\"\n\n    def get_metadata_lines(name):\n        \"\"\"Yield named metadata resource as list of non-blank non-comment lines\n\n       Leading and trailing whitespace is stripped from each line, and lines\n       with ``#`` as the first non-blank character are omitted.\"\"\"\n\n    def metadata_isdir(name):\n        \"\"\"Is the named metadata a directory?  (like ``os.path.isdir()``)\"\"\"\n\n    def metadata_listdir(name):\n        \"\"\"List of metadata names in the directory (like ``os.listdir()``)\"\"\"\n\n    def run_script(script_name, namespace):\n        \"\"\"Execute the named script in the supplied namespace dictionary\"\"\"\n\n\nclass IResourceProvider(IMetadataProvider):\n    \"\"\"An object that provides access to package resources\"\"\"\n\n    def get_resource_filename(manager, resource_name):\n        \"\"\"Return a true filesystem path for `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def get_resource_stream(manager, resource_name):\n        \"\"\"Return a readable file-like object for `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def get_resource_string(manager, resource_name):\n        \"\"\"Return a string containing the contents of `resource_name`\n\n        `manager` must be an ``IResourceManager``\"\"\"\n\n    def has_resource(resource_name):\n        \"\"\"Does the package contain the named resource?\"\"\"\n\n    def resource_isdir(resource_name):\n        \"\"\"Is the named resource a directory?  (like ``os.path.isdir()``)\"\"\"\n\n    def resource_listdir(resource_name):\n        \"\"\"List of resource names in the directory (like ``os.listdir()``)\"\"\"\n\n\nclass WorkingSet:\n    \"\"\"A collection of active distributions on sys.path (or a similar list)\"\"\"\n\n    def __init__(self, entries=None):\n        \"\"\"Create working set from list of path entries (default=sys.path)\"\"\"\n        self.entries = []\n        self.entry_keys = {}\n        self.by_key = {}\n        self.callbacks = []\n\n        if entries is None:\n            entries = sys.path\n\n        for entry in entries:\n            self.add_entry(entry)\n\n    @classmethod\n    def _build_master(cls):\n        \"\"\"\n        Prepare the master working set.\n        \"\"\"\n        ws = cls()\n        try:\n            from __main__ import __requires__\n        except ImportError:\n            # The main program does not list any requirements\n            return ws\n\n        # ensure the requirements are met\n        try:\n            ws.require(__requires__)\n        except VersionConflict:\n            return cls._build_from_requirements(__requires__)\n\n        return ws\n\n    @classmethod\n    def _build_from_requirements(cls, req_spec):\n        \"\"\"\n        Build a working set from a requirement spec. Rewrites sys.path.\n        \"\"\"\n        # try it without defaults already on sys.path\n        # by starting with an empty path\n        ws = cls([])\n        reqs = parse_requirements(req_spec)\n        dists = ws.resolve(reqs, Environment())\n        for dist in dists:\n            ws.add(dist)\n\n        # add any missing entries from sys.path\n        for entry in sys.path:\n            if entry not in ws.entries:\n                ws.add_entry(entry)\n\n        # then copy back to sys.path\n        sys.path[:] = ws.entries\n        return ws\n\n    def add_entry(self, entry):\n        \"\"\"Add a path item to ``.entries``, finding any distributions on it\n\n        ``find_distributions(entry, True)`` is used to find distributions\n        corresponding to the path entry, and they are added.  `entry` is\n        always appended to ``.entries``, even if it is already present.\n        (This is because ``sys.path`` can contain the same value more than\n        once, and the ``.entries`` of the ``sys.path`` WorkingSet should always\n        equal ``sys.path``.)\n        \"\"\"\n        self.entry_keys.setdefault(entry, [])\n        self.entries.append(entry)\n        for dist in find_distributions(entry, True):\n            self.add(dist, entry, False)\n\n    def __contains__(self, dist):\n        \"\"\"True if `dist` is the active distribution for its project\"\"\"\n        return self.by_key.get(dist.key) == dist\n\n    def find(self, req):\n        \"\"\"Find a distribution matching requirement `req`\n\n        If there is an active distribution for the requested project, this\n        returns it as long as it meets the version requirement specified by\n        `req`.  But, if there is an active distribution for the project and it\n        does *not* meet the `req` requirement, ``VersionConflict`` is raised.\n        If there is no active distribution for the requested project, ``None``\n        is returned.\n        \"\"\"\n        dist = self.by_key.get(req.key)\n        if dist is not None and dist not in req:\n            # XXX add more info\n            raise VersionConflict(dist, req)\n        return dist\n\n    def iter_entry_points(self, group, name=None):\n        \"\"\"Yield entry point objects from `group` matching `name`\n\n        If `name` is None, yields all entry points in `group` from all\n        distributions in the working set, otherwise only ones matching\n        both `group` and `name` are yielded (in distribution order).\n        \"\"\"\n        return (\n            entry\n            for dist in self\n            for entry in dist.get_entry_map(group).values()\n            if name is None or name == entry.name\n        )\n\n    def run_script(self, requires, script_name):\n        \"\"\"Locate distribution for `requires` and run `script_name` script\"\"\"\n        # Nuitka: This seems to pollute globals\n        assert False\n\n        ns = sys._getframe(1).f_globals\n        name = ns['__name__']\n        ns.clear()\n        ns['__name__'] = name\n        self.require(requires)[0].run_script(script_name, ns)\n\n    def __iter__(self):\n        \"\"\"Yield distributions for non-duplicate projects in the working set\n\n        The yield order is the order in which the items' path entries were\n        added to the working set.\n        \"\"\"\n        seen = {}\n        for item in self.entries:\n            if item not in self.entry_keys:\n                # workaround a cache issue\n                continue\n\n            for key in self.entry_keys[item]:\n                if key not in seen:\n                    seen[key] = 1\n                    yield self.by_key[key]\n\n    def add(self, dist, entry=None, insert=True, replace=False):\n        \"\"\"Add `dist` to working set, associated with `entry`\n\n        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.\n        On exit from this routine, `entry` is added to the end of the working\n        set's ``.entries`` (if it wasn't already present).\n\n        `dist` is only added to the working set if it's for a project that\n        doesn't already have a distribution in the set, unless `replace=True`.\n        If it's added, any callbacks registered with the ``subscribe()`` method\n        will be called.\n        \"\"\"\n        if insert:\n            dist.insert_on(self.entries, entry, replace=replace)\n\n        if entry is None:\n            entry = dist.location\n        keys = self.entry_keys.setdefault(entry, [])\n        keys2 = self.entry_keys.setdefault(dist.location, [])\n        if not replace and dist.key in self.by_key:\n            # ignore hidden distros\n            return\n\n        self.by_key[dist.key] = dist\n        if dist.key not in keys:\n            keys.append(dist.key)\n        if dist.key not in keys2:\n            keys2.append(dist.key)\n        self._added_new(dist)\n\n    def resolve(self, requirements, env=None, installer=None,\n                replace_conflicting=False, extras=None):\n        \"\"\"List all distributions needed to (recursively) meet `requirements`\n\n        `requirements` must be a sequence of ``Requirement`` objects.  `env`,\n        if supplied, should be an ``Environment`` instance.  If\n        not supplied, it defaults to all distributions available within any\n        entry or distribution in the working set.  `installer`, if supplied,\n        will be invoked with each requirement that cannot be met by an\n        already-installed distribution; it should return a ``Distribution`` or\n        ``None``.\n\n        Unless `replace_conflicting=True`, raises a VersionConflict exception\n        if\n        any requirements are found on the path that have the correct name but\n        the wrong version.  Otherwise, if an `installer` is supplied it will be\n        invoked to obtain the correct version of the requirement and activate\n        it.\n\n        `extras` is a list of the extras to be used with these requirements.\n        This is important because extra requirements may look like `my_req;\n        extra = \"my_extra\"`, which would otherwise be interpreted as a purely\n        optional requirement.  Instead, we want to be able to assert that these\n        requirements are truly required.\n        \"\"\"\n\n        # set up the stack\n        requirements = list(requirements)[::-1]\n        # set of processed requirements\n        processed = {}\n        # key -> dist\n        best = {}\n        to_activate = []\n\n        req_extras = _ReqExtras()\n\n        # Mapping of requirement to set of distributions that required it;\n        # useful for reporting info about conflicts.\n        required_by = collections.defaultdict(set)\n\n        while requirements:\n            # process dependencies breadth-first\n            req = requirements.pop(0)\n            if req in processed:\n                # Ignore cyclic or redundant dependencies\n                continue\n\n            if not req_extras.markers_pass(req, extras):\n                continue\n\n            dist = best.get(req.key)\n            if dist is None:\n                # Find the best distribution and add it to the map\n                dist = self.by_key.get(req.key)\n                if dist is None or (dist not in req and replace_conflicting):\n                    ws = self\n                    if env is None:\n                        if dist is None:\n                            env = Environment(self.entries)\n                        else:\n                            # Use an empty environment and workingset to avoid\n                            # any further conflicts with the conflicting\n                            # distribution\n                            env = Environment([])\n                            ws = WorkingSet([])\n                    dist = best[req.key] = env.best_match(\n                        req, ws, installer,\n                        replace_conflicting=replace_conflicting\n                    )\n                    if dist is None:\n                        requirers = required_by.get(req, None)\n                        raise DistributionNotFound(req, requirers)\n                to_activate.append(dist)\n            if dist not in req:\n                # Oops, the \"best\" so far conflicts with a dependency\n                dependent_req = required_by[req]\n                raise VersionConflict(dist, req).with_context(dependent_req)\n\n            # push the new requirements onto the stack\n            new_requirements = dist.requires(req.extras)[::-1]\n            requirements.extend(new_requirements)\n\n            # Register the new requirements needed by req\n            for new_requirement in new_requirements:\n                required_by[new_requirement].add(req.project_name)\n                req_extras[new_requirement] = req.extras\n\n            processed[req] = True\n\n        # return list of distros to activate\n        return to_activate\n\n    def find_plugins(\n            self, plugin_env, full_env=None, installer=None, fallback=True):\n        \"\"\"Find all activatable distributions in `plugin_env`\n\n        Example usage::\n\n            distributions, errors = working_set.find_plugins(\n                Environment(plugin_dirlist)\n            )\n            # add plugins+libs to sys.path\n            map(working_set.add, distributions)\n            # display errors\n            print('Could not load', errors)\n\n        The `plugin_env` should be an ``Environment`` instance that contains\n        only distributions that are in the project's \"plugin directory\" or\n        directories. The `full_env`, if supplied, should be an ``Environment``\n        contains all currently-available distributions.  If `full_env` is not\n        supplied, one is created automatically from the ``WorkingSet`` this\n        method is called on, which will typically mean that every directory on\n        ``sys.path`` will be scanned for distributions.\n\n        `installer` is a standard installer callback as used by the\n        ``resolve()`` method. The `fallback` flag indicates whether we should\n        attempt to resolve older versions of a plugin if the newest version\n        cannot be resolved.\n\n        This method returns a 2-tuple: (`distributions`, `error_info`), where\n        `distributions` is a list of the distributions found in `plugin_env`\n        that were loadable, along with any other distributions that are needed\n        to resolve their dependencies.  `error_info` is a dictionary mapping\n        unloadable plugin distributions to an exception instance describing the\n        error that occurred. Usually this will be a ``DistributionNotFound`` or\n        ``VersionConflict`` instance.\n        \"\"\"\n\n        plugin_projects = list(plugin_env)\n        # scan project names in alphabetic order\n        plugin_projects.sort()\n\n        error_info = {}\n        distributions = {}\n\n        if full_env is None:\n            env = Environment(self.entries)\n            env += plugin_env\n        else:\n            env = full_env + plugin_env\n\n        shadow_set = self.__class__([])\n        # put all our entries in shadow_set\n        list(map(shadow_set.add, self))\n\n        for project_name in plugin_projects:\n\n            for dist in plugin_env[project_name]:\n\n                req = [dist.as_requirement()]\n\n                try:\n                    resolvees = shadow_set.resolve(req, env, installer)\n\n                except ResolutionError as v:\n                    # save error info\n                    error_info[dist] = v\n                    if fallback:\n                        # try the next older version of project\n                        continue\n                    else:\n                        # give up on this project, keep going\n                        break\n\n                else:\n                    list(map(shadow_set.add, resolvees))\n                    distributions.update(dict.fromkeys(resolvees))\n\n                    # success, no need to try any more versions of this project\n                    break\n\n        distributions = list(distributions)\n        distributions.sort()\n\n        return distributions, error_info\n\n    def require(self, *requirements):\n        \"\"\"Ensure that distributions matching `requirements` are activated\n\n        `requirements` must be a string or a (possibly-nested) sequence\n        thereof, specifying the distributions and versions required.  The\n        return value is a sequence of the distributions that needed to be\n        activated to fulfill the requirements; all relevant distributions are\n        included, even if they were already activated in this working set.\n        \"\"\"\n        needed = self.resolve(parse_requirements(requirements))\n\n        for dist in needed:\n            self.add(dist)\n\n        return needed\n\n    def subscribe(self, callback, existing=True):\n        \"\"\"Invoke `callback` for all distributions\n\n        If `existing=True` (default),\n        call on all existing ones, as well.\n        \"\"\"\n        if callback in self.callbacks:\n            return\n        self.callbacks.append(callback)\n        if not existing:\n            return\n        for dist in self:\n            callback(dist)\n\n    def _added_new(self, dist):\n        for callback in self.callbacks:\n            callback(dist)\n\n    def __getstate__(self):\n        return (\n            self.entries[:], self.entry_keys.copy(), self.by_key.copy(),\n            self.callbacks[:]\n        )\n\n    def __setstate__(self, e_k_b_c):\n        entries, keys, by_key, callbacks = e_k_b_c\n        self.entries = entries[:]\n        self.entry_keys = keys.copy()\n        self.by_key = by_key.copy()\n        self.callbacks = callbacks[:]\n\n\nclass _ReqExtras(dict):\n    \"\"\"\n    Map each requirement to the extras that demanded it.\n    \"\"\"\n\n    def markers_pass(self, req, extras=None):\n        \"\"\"\n        Evaluate markers for req against each extra that\n        demanded it.\n\n        Return False if the req has a marker and fails\n        evaluation. Otherwise, return True.\n        \"\"\"\n        extra_evals = (\n            req.marker.evaluate({'extra': extra})\n            for extra in self.get(req, ()) + (extras or (None,))\n        )\n        return not req.marker or any(extra_evals)\n\n\nclass Environment:\n    \"\"\"Searchable snapshot of distributions on a search path\"\"\"\n\n    def __init__(\n            self, search_path=None, platform=get_supported_platform(),\n            python=PY_MAJOR):\n        \"\"\"Snapshot distributions available on a search path\n\n        Any distributions found on `search_path` are added to the environment.\n        `search_path` should be a sequence of ``sys.path`` items.  If not\n        supplied, ``sys.path`` is used.\n\n        `platform` is an optional string specifying the name of the platform\n        that platform-specific distributions must be compatible with.  If\n        unspecified, it defaults to the current platform.  `python` is an\n        optional string naming the desired version of Python (e.g. ``'3.6'``);\n        it defaults to the current version.\n\n        You may explicitly set `platform` (and/or `python`) to ``None`` if you\n        wish to map *all* distributions, not just those compatible with the\n        running platform or Python version.\n        \"\"\"\n        self._distmap = {}\n        self.platform = platform\n        self.python = python\n        self.scan(search_path)\n\n    def can_add(self, dist):\n        \"\"\"Is distribution `dist` acceptable for this environment?\n\n        The distribution must match the platform and python version\n        requirements specified when this environment was created, or False\n        is returned.\n        \"\"\"\n        py_compat = (\n            self.python is None\n            or dist.py_version is None\n            or dist.py_version == self.python\n        )\n        return py_compat and compatible_platforms(dist.platform, self.platform)\n\n    def remove(self, dist):\n        \"\"\"Remove `dist` from the environment\"\"\"\n        self._distmap[dist.key].remove(dist)\n\n    def scan(self, search_path=None):\n        \"\"\"Scan `search_path` for distributions usable in this environment\n\n        Any distributions found are added to the environment.\n        `search_path` should be a sequence of ``sys.path`` items.  If not\n        supplied, ``sys.path`` is used.  Only distributions conforming to\n        the platform/python version defined at initialization are added.\n        \"\"\"\n        if search_path is None:\n            search_path = sys.path\n\n        for item in search_path:\n            for dist in find_distributions(item):\n                self.add(dist)\n\n    def __getitem__(self, project_name):\n        \"\"\"Return a newest-to-oldest list of distributions for `project_name`\n\n        Uses case-insensitive `project_name` comparison, assuming all the\n        project's distributions use their project's name converted to all\n        lowercase as their key.\n\n        \"\"\"\n        distribution_key = project_name.lower()\n        return self._distmap.get(distribution_key, [])\n\n    def add(self, dist):\n        \"\"\"Add `dist` if we ``can_add()`` it and it has not already been added\n        \"\"\"\n        if self.can_add(dist) and dist.has_version():\n            dists = self._distmap.setdefault(dist.key, [])\n            if dist not in dists:\n                dists.append(dist)\n                dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)\n\n    def best_match(\n            self, req, working_set, installer=None, replace_conflicting=False):\n        \"\"\"Find distribution best matching `req` and usable on `working_set`\n\n        This calls the ``find(req)`` method of the `working_set` to see if a\n        suitable distribution is already active.  (This may raise\n        ``VersionConflict`` if an unsuitable version of the project is already\n        active in the specified `working_set`.)  If a suitable distribution\n        isn't active, this method returns the newest distribution in the\n        environment that meets the ``Requirement`` in `req`.  If no suitable\n        distribution is found, and `installer` is supplied, then the result of\n        calling the environment's ``obtain(req, installer)`` method will be\n        returned.\n        \"\"\"\n        try:\n            dist = working_set.find(req)\n        except VersionConflict:\n            if not replace_conflicting:\n                raise\n            dist = None\n        if dist is not None:\n            return dist\n        for dist in self[req.key]:\n            if dist in req:\n                return dist\n        # try to download/install\n        return self.obtain(req, installer)\n\n    def obtain(self, requirement, installer=None):\n        \"\"\"Obtain a distribution matching `requirement` (e.g. via download)\n\n        Obtain a distro that matches requirement (e.g. via download).  In the\n        base ``Environment`` class, this routine just returns\n        ``installer(requirement)``, unless `installer` is None, in which case\n        None is returned instead.  This method is a hook that allows subclasses\n        to attempt other ways of obtaining a distribution before falling back\n        to the `installer` argument.\"\"\"\n        if installer is not None:\n            return installer(requirement)\n\n    def __iter__(self):\n        \"\"\"Yield the unique project names of the available distributions\"\"\"\n        for key in self._distmap.keys():\n            if self[key]:\n                yield key\n\n    def __iadd__(self, other):\n        \"\"\"In-place addition of a distribution or environment\"\"\"\n        if isinstance(other, Distribution):\n            self.add(other)\n        elif isinstance(other, Environment):\n            for project in other:\n                for dist in other[project]:\n                    self.add(dist)\n        else:\n            raise TypeError(\"Can't add %r to environment\" % (other,))\n        return self\n\n    def __add__(self, other):\n        \"\"\"Add an environment or distribution to an environment\"\"\"\n        new = self.__class__([], platform=None, python=None)\n        for env in self, other:\n            new += env\n        return new\n\n\n# XXX backward compatibility\nAvailableDistributions = Environment\n\n\nclass ExtractionError(RuntimeError):\n    \"\"\"An error occurred extracting a resource\n\n    The following attributes are available from instances of this exception:\n\n    manager\n        The resource manager that raised this exception\n\n    cache_path\n        The base directory for resource extraction\n\n    original_error\n        The exception instance that caused extraction to fail\n    \"\"\"\n\n\nclass ResourceManager:\n    \"\"\"Manage resource extraction and packages\"\"\"\n    extraction_path = None\n\n    def __init__(self):\n        self.cached_files = {}\n\n    def resource_exists(self, package_or_requirement, resource_name):\n        \"\"\"Does the named resource exist?\"\"\"\n        return get_provider(package_or_requirement).has_resource(resource_name)\n\n    def resource_isdir(self, package_or_requirement, resource_name):\n        \"\"\"Is the named resource an existing directory?\"\"\"\n        return get_provider(package_or_requirement).resource_isdir(\n            resource_name\n        )\n\n    def resource_filename(self, package_or_requirement, resource_name):\n        \"\"\"Return a true filesystem path for specified resource\"\"\"\n        return get_provider(package_or_requirement).get_resource_filename(\n            self, resource_name\n        )\n\n    def resource_stream(self, package_or_requirement, resource_name):\n        \"\"\"Return a readable file-like object for specified resource\"\"\"\n        return get_provider(package_or_requirement).get_resource_stream(\n            self, resource_name\n        )\n\n    def resource_string(self, package_or_requirement, resource_name):\n        \"\"\"Return specified resource as a string\"\"\"\n        return get_provider(package_or_requirement).get_resource_string(\n            self, resource_name\n        )\n\n    def resource_listdir(self, package_or_requirement, resource_name):\n        \"\"\"List the contents of the named resource directory\"\"\"\n        return get_provider(package_or_requirement).resource_listdir(\n            resource_name\n        )\n\n    def extraction_error(self):\n        \"\"\"Give an error message for problems extracting file(s)\"\"\"\n\n        old_exc = sys.exc_info()[1]\n        cache_path = self.extraction_path or get_default_cache()\n\n        tmpl = textwrap.dedent(\"\"\"\n            Can't extract file(s) to egg cache\n\n            The following error occurred while trying to extract file(s)\n            to the Python egg cache:\n\n              {old_exc}\n\n            The Python egg cache directory is currently set to:\n\n              {cache_path}\n\n            Perhaps your account does not have write access to this directory?\n            You can change the cache directory by setting the PYTHON_EGG_CACHE\n            environment variable to point to an accessible directory.\n            \"\"\").lstrip()\n        err = ExtractionError(tmpl.format(**locals()))\n        err.manager = self\n        err.cache_path = cache_path\n        err.original_error = old_exc\n        raise err\n\n    def get_cache_path(self, archive_name, names=()):\n        \"\"\"Return absolute location in cache for `archive_name` and `names`\n\n        The parent directory of the resulting path will be created if it does\n        not already exist.  `archive_name` should be the base filename of the\n        enclosing egg (which may not be the name of the enclosing zipfile!),\n        including its \".egg\" extension.  `names`, if provided, should be a\n        sequence of path name parts \"under\" the egg's extraction location.\n\n        This method should only be called by resource providers that need to\n        obtain an extraction location, and only for names they intend to\n        extract, as it tracks the generated names for possible cleanup later.\n        \"\"\"\n        extract_path = self.extraction_path or get_default_cache()\n        target_path = os.path.join(extract_path, archive_name + '-tmp', *names)\n        try:\n            _bypass_ensure_directory(target_path)\n        except Exception:\n            self.extraction_error()\n\n        self._warn_unsafe_extraction_path(extract_path)\n\n        self.cached_files[target_path] = 1\n        return target_path\n\n    @staticmethod\n    def _warn_unsafe_extraction_path(path):\n        \"\"\"\n        If the default extraction path is overridden and set to an insecure\n        location, such as /tmp, it opens up an opportunity for an attacker to\n        replace an extracted file with an unauthorized payload. Warn the user\n        if a known insecure location is used.\n\n        See Distribute #375 for more details.\n        \"\"\"\n        if os.name == 'nt' and not path.startswith(os.environ['windir']):\n            # On Windows, permissions are generally restrictive by default\n            #  and temp directories are not writable by other users, so\n            #  bypass the warning.\n            return\n        mode = os.stat(path).st_mode\n        if mode & stat.S_IWOTH or mode & stat.S_IWGRP:\n            msg = (\n                \"%s is writable by group/others and vulnerable to attack \"\n                \"when \"\n                \"used with get_resource_filename. Consider a more secure \"\n                \"location (set with .set_extraction_path or the \"\n                \"PYTHON_EGG_CACHE environment variable).\" % path\n            )\n            warnings.warn(msg, UserWarning)\n\n    def postprocess(self, tempname, filename):\n        \"\"\"Perform any platform-specific postprocessing of `tempname`\n\n        This is where Mac header rewrites should be done; other platforms don't\n        have anything special they should do.\n\n        Resource providers should call this method ONLY after successfully\n        extracting a compressed resource.  They must NOT call it on resources\n        that are already in the filesystem.\n\n        `tempname` is the current (temporary) name of the file, and `filename`\n        is the name it will be renamed to by the caller after this routine\n        returns.\n        \"\"\"\n\n        if os.name == 'posix':\n            # Make the resource executable\n            mode = ((os.stat(tempname).st_mode) | 0o555) & 0o7777\n            os.chmod(tempname, mode)\n\n    def set_extraction_path(self, path):\n        \"\"\"Set the base path where resources will be extracted to, if needed.\n\n        If you do not call this routine before any extractions take place, the\n        path defaults to the return value of ``get_default_cache()``.  (Which\n        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various\n        platform-specific fallbacks.  See that routine's documentation for more\n        details.)\n\n        Resources are extracted to subdirectories of this path based upon\n        information given by the ``IResourceProvider``.  You may set this to a\n        temporary directory, but then you must call ``cleanup_resources()`` to\n        delete the extracted files when done.  There is no guarantee that\n        ``cleanup_resources()`` will be able to remove all extracted files.\n\n        (Note: you may not change the extraction path for a given resource\n        manager once resources have been extracted, unless you first call\n        ``cleanup_resources()``.)\n        \"\"\"\n        if self.cached_files:\n            raise ValueError(\n                \"Can't change extraction path, files already extracted\"\n            )\n\n        self.extraction_path = path\n\n    def cleanup_resources(self, force=False):\n        \"\"\"\n        Delete all extracted resource files and directories, returning a list\n        of the file and directory names that could not be successfully removed.\n        This function does not have any concurrency protection, so it should\n        generally only be called when the extraction path is a temporary\n        directory exclusive to a single process.  This method is not\n        automatically called; you must call it explicitly or register it as an\n        ``atexit`` function if you wish to ensure cleanup of a temporary\n        directory used for extractions.\n        \"\"\"\n        # XXX\n\n\ndef get_default_cache():\n    \"\"\"\n    Return the ``PYTHON_EGG_CACHE`` environment variable\n    or a platform-relevant user cache dir for an app\n    named \"Python-Eggs\".\n    \"\"\"\n    return (\n        os.environ.get('PYTHON_EGG_CACHE')\n        or appdirs.user_cache_dir(appname='Python-Eggs')\n    )\n\n\ndef safe_name(name):\n    \"\"\"Convert an arbitrary string to a standard distribution name\n\n    Any runs of non-alphanumeric/. characters are replaced with a single '-'.\n    \"\"\"\n    return re.sub('[^A-Za-z0-9.]+', '-', name)\n\n\ndef safe_version(version):\n    \"\"\"\n    Convert an arbitrary string to a standard version string\n    \"\"\"\n    try:\n        # normalize the version\n        return str(packaging.version.Version(version))\n    except packaging.version.InvalidVersion:\n        version = version.replace(' ', '.')\n        return re.sub('[^A-Za-z0-9.]+', '-', version)\n\n\ndef safe_extra(extra):\n    \"\"\"Convert an arbitrary string to a standard 'extra' name\n\n    Any runs of non-alphanumeric characters are replaced with a single '_',\n    and the result is always lowercased.\n    \"\"\"\n    return re.sub('[^A-Za-z0-9.-]+', '_', extra).lower()\n\n\ndef to_filename(name):\n    \"\"\"Convert a project or version name to its filename-escaped form\n\n    Any '-' characters are currently replaced with '_'.\n    \"\"\"\n    return name.replace('-', '_')\n\n\ndef invalid_marker(text):\n    \"\"\"\n    Validate text as a PEP 508 environment marker; return an exception\n    if invalid or False otherwise.\n    \"\"\"\n    try:\n        evaluate_marker(text)\n    except SyntaxError as e:\n        e.filename = None\n        e.lineno = None\n        return e\n    return False\n\n\ndef evaluate_marker(text, extra=None):\n    \"\"\"\n    Evaluate a PEP 508 environment marker.\n    Return a boolean indicating the marker result in this environment.\n    Raise SyntaxError if marker is invalid.\n\n    This implementation uses the 'pyparsing' module.\n    \"\"\"\n    try:\n        marker = packaging.markers.Marker(text)\n        return marker.evaluate()\n    except packaging.markers.InvalidMarker as e:\n        raise SyntaxError(e)\n\n\nclass NullProvider:\n    \"\"\"Try to implement resources and metadata for arbitrary PEP 302 loaders\"\"\"\n\n    egg_name = None\n    egg_info = None\n    loader = None\n\n    def __init__(self, module):\n        self.loader = getattr(module, '__loader__', None)\n        self.module_path = os.path.dirname(getattr(module, '__file__', ''))\n\n    def get_resource_filename(self, manager, resource_name):\n        return self._fn(self.module_path, resource_name)\n\n    def get_resource_stream(self, manager, resource_name):\n        return io.BytesIO(self.get_resource_string(manager, resource_name))\n\n    def get_resource_string(self, manager, resource_name):\n        return self._get(self._fn(self.module_path, resource_name))\n\n    def has_resource(self, resource_name):\n        return self._has(self._fn(self.module_path, resource_name))\n\n    def _get_metadata_path(self, name):\n        return self._fn(self.egg_info, name)\n\n    def has_metadata(self, name):\n        if not self.egg_info:\n            return self.egg_info\n\n        path = self._get_metadata_path(name)\n        return self._has(path)\n\n    def get_metadata(self, name):\n        if not self.egg_info:\n            return \"\"\n        path = self._get_metadata_path(name)\n        value = self._get(path)\n        if six.PY2:\n            return value\n        try:\n            return value.decode('utf-8')\n        except UnicodeDecodeError as exc:\n            # Include the path in the error message to simplify\n            # troubleshooting, and without changing the exception type.\n            exc.reason += ' in {} file at path: {}'.format(name, path)\n            raise\n\n    def get_metadata_lines(self, name):\n        return yield_lines(self.get_metadata(name))\n\n    def resource_isdir(self, resource_name):\n        return self._isdir(self._fn(self.module_path, resource_name))\n\n    def metadata_isdir(self, name):\n        return self.egg_info and self._isdir(self._fn(self.egg_info, name))\n\n    def resource_listdir(self, resource_name):\n        return self._listdir(self._fn(self.module_path, resource_name))\n\n    def metadata_listdir(self, name):\n        if self.egg_info:\n            return self._listdir(self._fn(self.egg_info, name))\n        return []\n\n    def run_script(self, script_name, namespace):\n        script = 'scripts/' + script_name\n        if not self.has_metadata(script):\n            raise ResolutionError(\n                \"Script {script!r} not found in metadata at {self.egg_info!r}\"\n                .format(**locals()),\n            )\n        script_text = self.get_metadata(script).replace('\\r\\n', '\\n')\n        script_text = script_text.replace('\\r', '\\n')\n        script_filename = self._fn(self.egg_info, script)\n        namespace['__file__'] = script_filename\n        if os.path.exists(script_filename):\n            source = open(script_filename).read()\n            code = compile(source, script_filename, 'exec')\n            exec(code, namespace, namespace)\n        else:\n            from linecache import cache\n            cache[script_filename] = (\n                len(script_text), 0, script_text.split('\\n'), script_filename\n            )\n            script_code = compile(script_text, script_filename, 'exec')\n            exec(script_code, namespace, namespace)\n\n    def _has(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _isdir(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _listdir(self, path):\n        raise NotImplementedError(\n            \"Can't perform this operation for unregistered loader type\"\n        )\n\n    def _fn(self, base, resource_name):\n        self._validate_resource_path(resource_name)\n        if resource_name:\n            return os.path.join(base, *resource_name.split('/'))\n        return base\n\n    @staticmethod\n    def _validate_resource_path(path):\n        \"\"\"\n        Validate the resource paths according to the docs.\n        https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access\n\n        >>> warned = getfixture('recwarn')\n        >>> warnings.simplefilter('always')\n        >>> vrp = NullProvider._validate_resource_path\n        >>> vrp('foo/bar.txt')\n        >>> bool(warned)\n        False\n        >>> vrp('../foo/bar.txt')\n        >>> bool(warned)\n        True\n        >>> warned.clear()\n        >>> vrp('/foo/bar.txt')\n        >>> bool(warned)\n        True\n        >>> vrp('foo/../../bar.txt')\n        >>> bool(warned)\n        True\n        >>> warned.clear()\n        >>> vrp('foo/f../bar.txt')\n        >>> bool(warned)\n        False\n\n        Windows path separators are straight-up disallowed.\n        >>> vrp(r'\\\\foo/bar.txt')\n        Traceback (most recent call last):\n        ...\n        ValueError: Use of .. or absolute path in a resource path \\\nis not allowed.\n\n        >>> vrp(r'C:\\\\foo/bar.txt')\n        Traceback (most recent call last):\n        ...\n        ValueError: Use of .. or absolute path in a resource path \\\nis not allowed.\n\n        Blank values are allowed\n\n        >>> vrp('')\n        >>> bool(warned)\n        False\n\n        Non-string values are not.\n\n        >>> vrp(None)\n        Traceback (most recent call last):\n        ...\n        AttributeError: ...\n        \"\"\"\n        invalid = (\n            os.path.pardir in path.split(posixpath.sep) or\n            posixpath.isabs(path) or\n            ntpath.isabs(path)\n        )\n        if not invalid:\n            return\n\n        msg = \"Use of .. or absolute path in a resource path is not allowed.\"\n\n        # Aggressively disallow Windows absolute paths\n        if ntpath.isabs(path) and not posixpath.isabs(path):\n            raise ValueError(msg)\n\n        # for compatibility, warn; in future\n        # raise ValueError(msg)\n        warnings.warn(\n            msg[:-1] + \" and will raise exceptions in a future release.\",\n            DeprecationWarning,\n            stacklevel=4,\n        )\n\n    def _get(self, path):\n        if hasattr(self.loader, 'get_data'):\n            return self.loader.get_data(path)\n        raise NotImplementedError(\n            \"Can't perform this operation for loaders without 'get_data()'\"\n        )\n\n\nregister_loader_type(object, NullProvider)\n\n\nclass EggProvider(NullProvider):\n    \"\"\"Provider based on a virtual filesystem\"\"\"\n\n    def __init__(self, module):\n        NullProvider.__init__(self, module)\n        self._setup_prefix()\n\n    def _setup_prefix(self):\n        # we assume here that our metadata may be nested inside a \"basket\"\n        # of multiple eggs; that's why we use module_path instead of .archive\n        path = self.module_path\n        old = None\n        while path != old:\n            if _is_egg_path(path):\n                self.egg_name = os.path.basename(path)\n                self.egg_info = os.path.join(path, 'EGG-INFO')\n                self.egg_root = path\n                break\n            old = path\n            path, base = os.path.split(path)\n\n\nclass DefaultProvider(EggProvider):\n    \"\"\"Provides access to package resources in the filesystem\"\"\"\n\n    def _has(self, path):\n        return os.path.exists(path)\n\n    def _isdir(self, path):\n        return os.path.isdir(path)\n\n    def _listdir(self, path):\n        return os.listdir(path)\n\n    def get_resource_stream(self, manager, resource_name):\n        return open(self._fn(self.module_path, resource_name), 'rb')\n\n    def _get(self, path):\n        with open(path, 'rb') as stream:\n            return stream.read()\n\n    @classmethod\n    def _register(cls):\n        loader_names = 'SourceFileLoader', 'SourcelessFileLoader',\n        for name in loader_names:\n            loader_cls = getattr(importlib_machinery, name, type(None))\n            register_loader_type(loader_cls, cls)\n\n\nDefaultProvider._register()\n\n\nclass EmptyProvider(NullProvider):\n    \"\"\"Provider that returns nothing for all requests\"\"\"\n\n    module_path = None\n\n    _isdir = _has = lambda self, path: False\n\n    def _get(self, path):\n        return ''\n\n    def _listdir(self, path):\n        return []\n\n    def __init__(self):\n        pass\n\n\nempty_provider = EmptyProvider()\n\n\nclass ZipManifests(dict):\n    \"\"\"\n    zip manifest builder\n    \"\"\"\n\n    @classmethod\n    def build(cls, path):\n        \"\"\"\n        Build a dictionary similar to the zipimport directory\n        caches, except instead of tuples, store ZipInfo objects.\n\n        Use a platform-specific path separator (os.sep) for the path keys\n        for compatibility with pypy on Windows.\n        \"\"\"\n        with zipfile.ZipFile(path) as zfile:\n            items = (\n                (\n                    name.replace('/', os.sep),\n                    zfile.getinfo(name),\n                )\n                for name in zfile.namelist()\n            )\n            return dict(items)\n\n    load = build\n\n\nclass MemoizedZipManifests(ZipManifests):\n    \"\"\"\n    Memoized zipfile manifests.\n    \"\"\"\n    manifest_mod = collections.namedtuple('manifest_mod', 'manifest mtime')\n\n    def load(self, path):\n        \"\"\"\n        Load a manifest at path or return a suitable manifest already loaded.\n        \"\"\"\n        path = os.path.normpath(path)\n        mtime = os.stat(path).st_mtime\n\n        if path not in self or self[path].mtime != mtime:\n            manifest = self.build(path)\n            self[path] = self.manifest_mod(manifest, mtime)\n\n        return self[path].manifest\n\n\nclass ZipProvider(EggProvider):\n    \"\"\"Resource support for zips and eggs\"\"\"\n\n    eagers = None\n    _zip_manifests = MemoizedZipManifests()\n\n    def __init__(self, module):\n        EggProvider.__init__(self, module)\n        self.zip_pre = self.loader.archive + os.sep\n\n    def _zipinfo_name(self, fspath):\n        # Convert a virtual filename (full path to file) into a zipfile subpath\n        # usable with the zipimport directory cache for our target archive\n        fspath = fspath.rstrip(os.sep)\n        if fspath == self.loader.archive:\n            return ''\n        if fspath.startswith(self.zip_pre):\n            return fspath[len(self.zip_pre):]\n        raise AssertionError(\n            \"%s is not a subpath of %s\" % (fspath, self.zip_pre)\n        )\n\n    def _parts(self, zip_path):\n        # Convert a zipfile subpath into an egg-relative path part list.\n        # pseudo-fs path\n        fspath = self.zip_pre + zip_path\n        if fspath.startswith(self.egg_root + os.sep):\n            return fspath[len(self.egg_root) + 1:].split(os.sep)\n        raise AssertionError(\n            \"%s is not a subpath of %s\" % (fspath, self.egg_root)\n        )\n\n    @property\n    def zipinfo(self):\n        return self._zip_manifests.load(self.loader.archive)\n\n    def get_resource_filename(self, manager, resource_name):\n        if not self.egg_name:\n            raise NotImplementedError(\n                \"resource_filename() only supported for .egg, not .zip\"\n            )\n        # no need to lock for extraction, since we use temp names\n        zip_path = self._resource_to_zip(resource_name)\n        eagers = self._get_eager_resources()\n        if '/'.join(self._parts(zip_path)) in eagers:\n            for name in eagers:\n                self._extract_resource(manager, self._eager_to_zip(name))\n        return self._extract_resource(manager, zip_path)\n\n    @staticmethod\n    def _get_date_and_size(zip_stat):\n        size = zip_stat.file_size\n        # ymdhms+wday, yday, dst\n        date_time = zip_stat.date_time + (0, 0, -1)\n        # 1980 offset already done\n        timestamp = time.mktime(date_time)\n        return timestamp, size\n\n    def _extract_resource(self, manager, zip_path):\n\n        if zip_path in self._index():\n            for name in self._index()[zip_path]:\n                last = self._extract_resource(\n                    manager, os.path.join(zip_path, name)\n                )\n            # return the extracted directory name\n            return os.path.dirname(last)\n\n        timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])\n\n        if not WRITE_SUPPORT:\n            raise IOError('\"os.rename\" and \"os.unlink\" are not supported '\n                          'on this platform')\n        try:\n\n            real_path = manager.get_cache_path(\n                self.egg_name, self._parts(zip_path)\n            )\n\n            if self._is_current(real_path, zip_path):\n                return real_path\n\n            outf, tmpnam = _mkstemp(\n                \".$extract\",\n                dir=os.path.dirname(real_path),\n            )\n            os.write(outf, self.loader.get_data(zip_path))\n            os.close(outf)\n            utime(tmpnam, (timestamp, timestamp))\n            manager.postprocess(tmpnam, real_path)\n\n            try:\n                rename(tmpnam, real_path)\n\n            except os.error:\n                if os.path.isfile(real_path):\n                    if self._is_current(real_path, zip_path):\n                        # the file became current since it was checked above,\n                        #  so proceed.\n                        return real_path\n                    # Windows, del old file and retry\n                    elif os.name == 'nt':\n                        unlink(real_path)\n                        rename(tmpnam, real_path)\n                        return real_path\n                raise\n\n        except os.error:\n            # report a user-friendly error\n            manager.extraction_error()\n\n        return real_path\n\n    def _is_current(self, file_path, zip_path):\n        \"\"\"\n        Return True if the file_path is current for this zip_path\n        \"\"\"\n        timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])\n        if not os.path.isfile(file_path):\n            return False\n        stat = os.stat(file_path)\n        if stat.st_size != size or stat.st_mtime != timestamp:\n            return False\n        # check that the contents match\n        zip_contents = self.loader.get_data(zip_path)\n        with open(file_path, 'rb') as f:\n            file_contents = f.read()\n        return zip_contents == file_contents\n\n    def _get_eager_resources(self):\n        if self.eagers is None:\n            eagers = []\n            for name in ('native_libs.txt', 'eager_resources.txt'):\n                if self.has_metadata(name):\n                    eagers.extend(self.get_metadata_lines(name))\n            self.eagers = eagers\n        return self.eagers\n\n    def _index(self):\n        try:\n            return self._dirindex\n        except AttributeError:\n            ind = {}\n            for path in self.zipinfo:\n                parts = path.split(os.sep)\n                while parts:\n                    parent = os.sep.join(parts[:-1])\n                    if parent in ind:\n                        ind[parent].append(parts[-1])\n                        break\n                    else:\n                        ind[parent] = [parts.pop()]\n            self._dirindex = ind\n            return ind\n\n    def _has(self, fspath):\n        zip_path = self._zipinfo_name(fspath)\n        return zip_path in self.zipinfo or zip_path in self._index()\n\n    def _isdir(self, fspath):\n        return self._zipinfo_name(fspath) in self._index()\n\n    def _listdir(self, fspath):\n        return list(self._index().get(self._zipinfo_name(fspath), ()))\n\n    def _eager_to_zip(self, resource_name):\n        return self._zipinfo_name(self._fn(self.egg_root, resource_name))\n\n    def _resource_to_zip(self, resource_name):\n        return self._zipinfo_name(self._fn(self.module_path, resource_name))\n\n\nregister_loader_type(zipimport.zipimporter, ZipProvider)\n\n\nclass FileMetadata(EmptyProvider):\n    \"\"\"Metadata handler for standalone PKG-INFO files\n\n    Usage::\n\n        metadata = FileMetadata(\"/path/to/PKG-INFO\")\n\n    This provider rejects all data and metadata requests except for PKG-INFO,\n    which is treated as existing, and will be the contents of the file at\n    the provided location.\n    \"\"\"\n\n    def __init__(self, path):\n        self.path = path\n\n    def _get_metadata_path(self, name):\n        return self.path\n\n    def has_metadata(self, name):\n        return name == 'PKG-INFO' and os.path.isfile(self.path)\n\n    def get_metadata(self, name):\n        if name != 'PKG-INFO':\n            raise KeyError(\"No metadata except PKG-INFO is available\")\n\n        with io.open(self.path, encoding='utf-8', errors=\"replace\") as f:\n            metadata = f.read()\n        self._warn_on_replacement(metadata)\n        return metadata\n\n    def _warn_on_replacement(self, metadata):\n        # Python 2.7 compat for: replacement_char = '�'\n        replacement_char = b'\\xef\\xbf\\xbd'.decode('utf-8')\n        if replacement_char in metadata:\n            tmpl = \"{self.path} could not be properly decoded in UTF-8\"\n            msg = tmpl.format(**locals())\n            warnings.warn(msg)\n\n    def get_metadata_lines(self, name):\n        return yield_lines(self.get_metadata(name))\n\n\nclass PathMetadata(DefaultProvider):\n    \"\"\"Metadata provider for egg directories\n\n    Usage::\n\n        # Development eggs:\n\n        egg_info = \"/path/to/PackageName.egg-info\"\n        base_dir = os.path.dirname(egg_info)\n        metadata = PathMetadata(base_dir, egg_info)\n        dist_name = os.path.splitext(os.path.basename(egg_info))[0]\n        dist = Distribution(basedir, project_name=dist_name, metadata=metadata)\n\n        # Unpacked egg directories:\n\n        egg_path = \"/path/to/PackageName-ver-pyver-etc.egg\"\n        metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))\n        dist = Distribution.from_filename(egg_path, metadata=metadata)\n    \"\"\"\n\n    def __init__(self, path, egg_info):\n        self.module_path = path\n        self.egg_info = egg_info\n\n\nclass EggMetadata(ZipProvider):\n    \"\"\"Metadata provider for .egg files\"\"\"\n\n    def __init__(self, importer):\n        \"\"\"Create a metadata provider from a zipimporter\"\"\"\n\n        self.zip_pre = importer.archive + os.sep\n        self.loader = importer\n        if importer.prefix:\n            self.module_path = os.path.join(importer.archive, importer.prefix)\n        else:\n            self.module_path = importer.archive\n        self._setup_prefix()\n\n\n_distribution_finders={}\n\n\ndef register_finder(importer_type, distribution_finder):\n    \"\"\"Register `distribution_finder` to find distributions in sys.path items\n\n    `importer_type` is the type or class of a PEP 302 \"Importer\" (sys.path item\n    handler), and `distribution_finder` is a callable that, passed a path\n    item and the importer instance, yields ``Distribution`` instances found on\n    that path item.  See ``pkg_resources.find_on_path`` for an example.\"\"\"\n    _distribution_finders[importer_type] = distribution_finder\n\n\ndef find_distributions(path_item, only=False):\n    \"\"\"Yield distributions accessible via `path_item`\"\"\"\n    importer = get_importer(path_item)\n    finder = _find_adapter(_distribution_finders, importer)\n    return finder(importer, path_item, only)\n\n\ndef find_eggs_in_zip(importer, path_item, only=False):\n    \"\"\"\n    Find eggs in zip files; possibly multiple nested eggs.\n    \"\"\"\n    if importer.archive.endswith('.whl'):\n        # wheels are not supported with this finder\n        # they don't have PKG-INFO metadata, and won't ever contain eggs\n        return\n    metadata = EggMetadata(importer)\n    if metadata.has_metadata('PKG-INFO'):\n        yield Distribution.from_filename(path_item, metadata=metadata)\n    if only:\n        # don't yield nested distros\n        return\n    for subitem in metadata.resource_listdir(''):\n        if _is_egg_path(subitem):\n            subpath = os.path.join(path_item, subitem)\n            dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)\n            for dist in dists:\n                yield dist\n        elif subitem.lower().endswith('.dist-info'):\n            subpath = os.path.join(path_item, subitem)\n            submeta = EggMetadata(zipimport.zipimporter(subpath))\n            submeta.egg_info = subpath\n            yield Distribution.from_location(path_item, subitem, submeta)\n\n\nregister_finder(zipimport.zipimporter, find_eggs_in_zip)\n\n\ndef find_nothing(importer, path_item, only=False):\n    return ()\n\n\nregister_finder(object, find_nothing)\n\n\ndef _by_version_descending(names):\n    \"\"\"\n    Given a list of filenames, return them in descending order\n    by version number.\n\n    >>> names = 'bar', 'foo', 'Python-2.7.10.egg', 'Python-2.7.2.egg'\n    >>> _by_version_descending(names)\n    ['Python-2.7.10.egg', 'Python-2.7.2.egg', 'foo', 'bar']\n    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.egg'\n    >>> _by_version_descending(names)\n    ['Setuptools-1.2.3.egg', 'Setuptools-1.2.3b1.egg']\n    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.post1.egg'\n    >>> _by_version_descending(names)\n    ['Setuptools-1.2.3.post1.egg', 'Setuptools-1.2.3b1.egg']\n    \"\"\"\n    def _by_version(name):\n        \"\"\"\n        Parse each component of the filename\n        \"\"\"\n        name, ext = os.path.splitext(name)\n        parts = itertools.chain(name.split('-'), [ext])\n        return [packaging.version.parse(part) for part in parts]\n\n    return sorted(names, key=_by_version, reverse=True)\n\n\ndef find_on_path(importer, path_item, only=False):\n    \"\"\"Yield distributions accessible on a sys.path directory\"\"\"\n    path_item = _normalize_cached(path_item)\n\n    if _is_unpacked_egg(path_item):\n        yield Distribution.from_filename(\n            path_item, metadata=PathMetadata(\n                path_item, os.path.join(path_item, 'EGG-INFO')\n            )\n        )\n        return\n\n    entries = safe_listdir(path_item)\n\n    # for performance, before sorting by version,\n    # screen entries for only those that will yield\n    # distributions\n    filtered = (\n        entry\n        for entry in entries\n        if dist_factory(path_item, entry, only)\n    )\n\n    # scan for .egg and .egg-info in directory\n    path_item_entries = _by_version_descending(filtered)\n    for entry in path_item_entries:\n        fullpath = os.path.join(path_item, entry)\n        factory = dist_factory(path_item, entry, only)\n        for dist in factory(fullpath):\n            yield dist\n\n\ndef dist_factory(path_item, entry, only):\n    \"\"\"\n    Return a dist_factory for a path_item and entry\n    \"\"\"\n    lower = entry.lower()\n    is_meta = any(map(lower.endswith, ('.egg-info', '.dist-info')))\n    return (\n        distributions_from_metadata\n        if is_meta else\n        find_distributions\n        if not only and _is_egg_path(entry) else\n        resolve_egg_link\n        if not only and lower.endswith('.egg-link') else\n        NoDists()\n    )\n\n\nclass NoDists:\n    \"\"\"\n    >>> bool(NoDists())\n    False\n\n    >>> list(NoDists()('anything'))\n    []\n    \"\"\"\n    def __bool__(self):\n        return False\n    if str is bytes:\n        __nonzero__ = __bool__\n\n    def __call__(self, fullpath):\n        return iter(())\n\n\ndef safe_listdir(path):\n    \"\"\"\n    Attempt to list contents of path, but suppress some exceptions.\n    \"\"\"\n    try:\n        return os.listdir(path)\n    except (PermissionError, NotADirectoryError):\n        pass\n    except OSError as e:\n        # Ignore the directory if does not exist, not a directory or\n        # permission denied\n        ignorable = (\n            e.errno in (errno.ENOTDIR, errno.EACCES, errno.ENOENT)\n            # Python 2 on Windows needs to be handled this way :(\n            or getattr(e, \"winerror\", None) == 267\n        )\n        if not ignorable:\n            raise\n    return ()\n\n\ndef distributions_from_metadata(path):\n    root = os.path.dirname(path)\n    if os.path.isdir(path):\n        if len(os.listdir(path)) == 0:\n            # empty metadata dir; skip\n            return\n        metadata = PathMetadata(root, path)\n    else:\n        metadata = FileMetadata(path)\n    entry = os.path.basename(path)\n    yield Distribution.from_location(\n        root, entry, metadata, precedence=DEVELOP_DIST,\n    )\n\n\ndef non_empty_lines(path):\n    \"\"\"\n    Yield non-empty lines from file at path\n    \"\"\"\n    with open(path) as f:\n        for line in f:\n            line = line.strip()\n            if line:\n                yield line\n\n\ndef resolve_egg_link(path):\n    \"\"\"\n    Given a path to an .egg-link, resolve distributions\n    present in the referenced path.\n    \"\"\"\n    referenced_paths = non_empty_lines(path)\n    resolved_paths = (\n        os.path.join(os.path.dirname(path), ref)\n        for ref in referenced_paths\n    )\n    dist_groups = map(find_distributions, resolved_paths)\n    return next(dist_groups, ())\n\n\nregister_finder(pkgutil.ImpImporter, find_on_path)\n\nif hasattr(importlib_machinery, 'FileFinder'):\n    register_finder(importlib_machinery.FileFinder, find_on_path)\n\n_namespace_handlers={}\n_namespace_packages={}\n\n\ndef register_namespace_handler(importer_type, namespace_handler):\n    \"\"\"Register `namespace_handler` to declare namespace packages\n\n    `importer_type` is the type or class of a PEP 302 \"Importer\" (sys.path item\n    handler), and `namespace_handler` is a callable like this::\n\n        def namespace_handler(importer, path_entry, moduleName, module):\n            # return a path_entry to use for child packages\n\n    Namespace handlers are only called if the importer object has already\n    agreed that it can handle the relevant path item, and they should only\n    return a subpath if the module __path__ does not already contain an\n    equivalent subpath.  For an example namespace handler, see\n    ``pkg_resources.file_ns_handler``.\n    \"\"\"\n    _namespace_handlers[importer_type] = namespace_handler\n\n\ndef _handle_ns(packageName, path_item):\n    \"\"\"Ensure that named package includes a subpath of path_item (if needed)\"\"\"\n    assert False\n\n    importer = get_importer(path_item)\n    if importer is None:\n        return None\n\n    # capture warnings due to #1111\n    with warnings.catch_warnings():\n        warnings.simplefilter(\"ignore\")\n        loader = importer.find_module(packageName)\n\n    if loader is None:\n        return None\n    module = sys.modules.get(packageName)\n    if module is None:\n        module = sys.modules[packageName] = types.ModuleType(packageName)\n        module.__path__ = []\n        _set_parent_ns(packageName)\n    elif not hasattr(module, '__path__'):\n        raise TypeError(\"Not a package:\", packageName)\n    handler = _find_adapter(_namespace_handlers, importer)\n    subpath = handler(importer, path_item, packageName, module)\n    if subpath is not None:\n        path = module.__path__\n        path.append(subpath)\n        loader.load_module(packageName)\n        _rebuild_mod_path(path, packageName, module)\n    return subpath\n\n\ndef _rebuild_mod_path(orig_path, package_name, module):\n    \"\"\"\n    Rebuild module.__path__ ensuring that all entries are ordered\n    corresponding to their sys.path order\n    \"\"\"\n    sys_path = [_normalize_cached(p) for p in sys.path]\n\n    def safe_sys_path_index(entry):\n        \"\"\"\n        Workaround for #520 and #513.\n        \"\"\"\n        try:\n            return sys_path.index(entry)\n        except ValueError:\n            return float('inf')\n\n    def position_in_sys_path(path):\n        \"\"\"\n        Return the ordinal of the path based on its position in sys.path\n        \"\"\"\n        path_parts = path.split(os.sep)\n        module_parts = package_name.count('.') + 1\n        parts = path_parts[:-module_parts]\n        return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))\n\n    new_path = sorted(orig_path, key=position_in_sys_path)\n    new_path = [_normalize_cached(p) for p in new_path]\n\n    if isinstance(module.__path__, list):\n        module.__path__[:] = new_path\n    else:\n        module.__path__ = new_path\n\n\ndef declare_namespace(packageName):\n    \"\"\"Declare that package 'packageName' is a namespace package\"\"\"\n\n    _imp.acquire_lock()\n    try:\n        if packageName in _namespace_packages:\n            return\n\n        path = sys.path\n        parent, _, _ = packageName.rpartition('.')\n\n        if parent:\n            declare_namespace(parent)\n            if parent not in _namespace_packages:\n                __import__(parent)\n            try:\n                path = sys.modules[parent].__path__\n            except AttributeError:\n                raise TypeError(\"Not a package:\", parent)\n\n        # Track what packages are namespaces, so when new path items are added,\n        # they can be updated\n        _namespace_packages.setdefault(parent or None, []).append(packageName)\n        _namespace_packages.setdefault(packageName, [])\n\n        for path_item in path:\n            # Ensure all the parent's path items are reflected in the child,\n            # if they apply\n            _handle_ns(packageName, path_item)\n\n    finally:\n        _imp.release_lock()\n\n\ndef fixup_namespace_packages(path_item, parent=None):\n    \"\"\"Ensure that previously-declared namespace packages include path_item\"\"\"\n    _imp.acquire_lock()\n    try:\n        for package in _namespace_packages.get(parent, ()):\n            subpath = _handle_ns(package, path_item)\n            if subpath:\n                fixup_namespace_packages(subpath, package)\n    finally:\n        _imp.release_lock()\n\n\ndef file_ns_handler(importer, path_item, packageName, module):\n    \"\"\"Compute an ns-package subpath for a filesystem or zipfile importer\"\"\"\n\n    subpath = os.path.join(path_item, packageName.split('.')[-1])\n    normalized = _normalize_cached(subpath)\n    for item in module.__path__:\n        if _normalize_cached(item) == normalized:\n            break\n    else:\n        # Only return the path if it's not already there\n        return subpath\n\n\nregister_namespace_handler(pkgutil.ImpImporter, file_ns_handler)\nregister_namespace_handler(zipimport.zipimporter, file_ns_handler)\n\nif hasattr(importlib_machinery, 'FileFinder'):\n    register_namespace_handler(importlib_machinery.FileFinder, file_ns_handler)\n\n\ndef null_ns_handler(importer, path_item, packageName, module):\n    return None\n\n\nregister_namespace_handler(object, null_ns_handler)\n\n\ndef normalize_path(filename):\n    \"\"\"Normalize a file/dir name for comparison purposes\"\"\"\n    return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename))))\n\n\ndef _cygwin_patch(filename):  # pragma: nocover\n    \"\"\"\n    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains\n    symlink components. Using\n    os.path.abspath() works around this limitation. A fix in os.getcwd()\n    would probably better, in Cygwin even more so, except\n    that this seems to be by design...\n    \"\"\"\n    return os.path.abspath(filename) if sys.platform == 'cygwin' else filename\n\n\ndef _normalize_cached(filename, _cache={}):\n    try:\n        return _cache[filename]\n    except KeyError:\n        _cache[filename] = result = normalize_path(filename)\n        return result\n\n\ndef _is_egg_path(path):\n    \"\"\"\n    Determine if given path appears to be an egg.\n    \"\"\"\n    return path.lower().endswith('.egg')\n\n\ndef _is_unpacked_egg(path):\n    \"\"\"\n    Determine if given path appears to be an unpacked egg.\n    \"\"\"\n    return (\n        _is_egg_path(path) and\n        os.path.isfile(os.path.join(path, 'EGG-INFO', 'PKG-INFO'))\n    )\n\n\ndef _set_parent_ns(packageName):\n    parts = packageName.split('.')\n    name = parts.pop()\n    if parts:\n        parent = '.'.join(parts)\n        setattr(sys.modules[parent], name, sys.modules[packageName])\n\n\ndef yield_lines(strs):\n    \"\"\"Yield non-empty/non-comment lines of a string or sequence\"\"\"\n    if isinstance(strs, six.string_types):\n        for s in strs.splitlines():\n            s = s.strip()\n            # skip blank lines/comments\n            if s and not s.startswith('#'):\n                yield s\n    else:\n        for ss in strs:\n            for s in yield_lines(ss):\n                yield s\n\n\nMODULE = re.compile(r\"\\w+(\\.\\w+)*$\").match\nEGG_NAME = re.compile(\n    r\"\"\"\n    (?P<name>[^-]+) (\n        -(?P<ver>[^-]+) (\n            -py(?P<pyver>[^-]+) (\n                -(?P<plat>.+)\n            )?\n        )?\n    )?\n    \"\"\",\n    re.VERBOSE | re.IGNORECASE,\n).match\n\n\nclass EntryPoint:\n    \"\"\"Object representing an advertised importable object\"\"\"\n\n    def __init__(self, name, module_name, attrs=(), extras=(), dist=None):\n        if not MODULE(module_name):\n            raise ValueError(\"Invalid module name\", module_name)\n        self.name = name\n        self.module_name = module_name\n        self.attrs = tuple(attrs)\n        self.extras = tuple(extras)\n        self.dist = dist\n\n    def __str__(self):\n        s = \"%s = %s\" % (self.name, self.module_name)\n        if self.attrs:\n            s += ':' + '.'.join(self.attrs)\n        if self.extras:\n            s += ' [%s]' % ','.join(self.extras)\n        return s\n\n    def __repr__(self):\n        return \"EntryPoint.parse(%r)\" % str(self)\n\n    def load(self, require=True, *args, **kwargs):\n        \"\"\"\n        Require packages for this EntryPoint, then resolve it.\n        \"\"\"\n        if not require or args or kwargs:\n            warnings.warn(\n                \"Parameters to load are deprecated.  Call .resolve and \"\n                \".require separately.\",\n                PkgResourcesDeprecationWarning,\n                stacklevel=2,\n            )\n        if require:\n            self.require(*args, **kwargs)\n        return self.resolve()\n\n    def resolve(self):\n        \"\"\"\n        Resolve the entry point from its module and attrs.\n        \"\"\"\n        module = __import__(self.module_name, fromlist=['__name__'], level=0)\n        try:\n            return functools.reduce(getattr, self.attrs, module)\n        except AttributeError as exc:\n            raise ImportError(str(exc))\n\n    def require(self, env=None, installer=None):\n        if self.extras and not self.dist:\n            raise UnknownExtra(\"Can't require() without a distribution\", self)\n\n        # Get the requirements for this entry point with all its extras and\n        # then resolve them. We have to pass `extras` along when resolving so\n        # that the working set knows what extras we want. Otherwise, for\n        # dist-info distributions, the working set will assume that the\n        # requirements for that extra are purely optional and skip over them.\n        reqs = self.dist.requires(self.extras)\n        items = working_set.resolve(reqs, env, installer, extras=self.extras)\n        list(map(working_set.add, items))\n\n    pattern = re.compile(\n        r'\\s*'\n        r'(?P<name>.+?)\\s*'\n        r'=\\s*'\n        r'(?P<module>[\\w.]+)\\s*'\n        r'(:\\s*(?P<attr>[\\w.]+))?\\s*'\n        r'(?P<extras>\\[.*\\])?\\s*$'\n    )\n\n    @classmethod\n    def parse(cls, src, dist=None):\n        \"\"\"Parse a single entry point from string `src`\n\n        Entry point syntax follows the form::\n\n            name = some.module:some.attr [extra1, extra2]\n\n        The entry name and module name are required, but the ``:attrs`` and\n        ``[extras]`` parts are optional\n        \"\"\"\n        m = cls.pattern.match(src)\n        if not m:\n            msg = \"EntryPoint must be in 'name=module:attrs [extras]' format\"\n            raise ValueError(msg, src)\n        res = m.groupdict()\n        extras = cls._parse_extras(res['extras'])\n        attrs = res['attr'].split('.') if res['attr'] else ()\n        return cls(res['name'], res['module'], attrs, extras, dist)\n\n    @classmethod\n    def _parse_extras(cls, extras_spec):\n        if not extras_spec:\n            return ()\n        req = Requirement.parse('x' + extras_spec)\n        if req.specs:\n            raise ValueError()\n        return req.extras\n\n    @classmethod\n    def parse_group(cls, group, lines, dist=None):\n        \"\"\"Parse an entry point group\"\"\"\n        if not MODULE(group):\n            raise ValueError(\"Invalid group name\", group)\n        this = {}\n        for line in yield_lines(lines):\n            ep = cls.parse(line, dist)\n            if ep.name in this:\n                raise ValueError(\"Duplicate entry point\", group, ep.name)\n            this[ep.name] = ep\n        return this\n\n    @classmethod\n    def parse_map(cls, data, dist=None):\n        \"\"\"Parse a map of entry point groups\"\"\"\n        if isinstance(data, dict):\n            data = data.items()\n        else:\n            data = split_sections(data)\n        maps = {}\n        for group, lines in data:\n            if group is None:\n                if not lines:\n                    continue\n                raise ValueError(\"Entry points must be listed in groups\")\n            group = group.strip()\n            if group in maps:\n                raise ValueError(\"Duplicate group name\", group)\n            maps[group] = cls.parse_group(group, lines, dist)\n        return maps\n\n\ndef _remove_md5_fragment(location):\n    if not location:\n        return ''\n    parsed = urllib.parse.urlparse(location)\n    if parsed[-1].startswith('md5='):\n        return urllib.parse.urlunparse(parsed[:-1] + ('',))\n    return location\n\n\ndef _version_from_file(lines):\n    \"\"\"\n    Given an iterable of lines from a Metadata file, return\n    the value of the Version field, if present, or None otherwise.\n    \"\"\"\n    def is_version_line(line):\n        return line.lower().startswith('version:')\n    version_lines = filter(is_version_line, lines)\n    line = next(iter(version_lines), '')\n    _, _, value = line.partition(':')\n    return safe_version(value.strip()) or None\n\n\nclass Distribution:\n    \"\"\"Wrap an actual or potential sys.path entry w/metadata\"\"\"\n    PKG_INFO = 'PKG-INFO'\n\n    def __init__(\n            self, location=None, metadata=None, project_name=None,\n            version=None, py_version=PY_MAJOR, platform=None,\n            precedence=EGG_DIST):\n        self.project_name = safe_name(project_name or 'Unknown')\n        if version is not None:\n            self._version = safe_version(version)\n        self.py_version = py_version\n        self.platform = platform\n        self.location = location\n        self.precedence = precedence\n        self._provider = metadata or empty_provider\n\n    @classmethod\n    def from_location(cls, location, basename, metadata=None, **kw):\n        project_name, version, py_version, platform = [None] * 4\n        basename, ext = os.path.splitext(basename)\n        if ext.lower() in _distributionImpl:\n            cls = _distributionImpl[ext.lower()]\n\n            match = EGG_NAME(basename)\n            if match:\n                project_name, version, py_version, platform = match.group(\n                    'name', 'ver', 'pyver', 'plat'\n                )\n        return cls(\n            location, metadata, project_name=project_name, version=version,\n            py_version=py_version, platform=platform, **kw\n        )._reload_version()\n\n    def _reload_version(self):\n        return self\n\n    @property\n    def hashcmp(self):\n        return (\n            self.parsed_version,\n            self.precedence,\n            self.key,\n            _remove_md5_fragment(self.location),\n            self.py_version or '',\n            self.platform or '',\n        )\n\n    def __hash__(self):\n        return hash(self.hashcmp)\n\n    def __lt__(self, other):\n        return self.hashcmp < other.hashcmp\n\n    def __le__(self, other):\n        return self.hashcmp <= other.hashcmp\n\n    def __gt__(self, other):\n        return self.hashcmp > other.hashcmp\n\n    def __ge__(self, other):\n        return self.hashcmp >= other.hashcmp\n\n    def __eq__(self, other):\n        if not isinstance(other, self.__class__):\n            # It's not a Distribution, so they are not equal\n            return False\n        return self.hashcmp == other.hashcmp\n\n    def __ne__(self, other):\n        return not self == other\n\n    # These properties have to be lazy so that we don't have to load any\n    # metadata until/unless it's actually needed.  (i.e., some distributions\n    # may not know their name or version without loading PKG-INFO)\n\n    @property\n    def key(self):\n        try:\n            return self._key\n        except AttributeError:\n            self._key = key = self.project_name.lower()\n            return key\n\n    @property\n    def parsed_version(self):\n        if not hasattr(self, \"_parsed_version\"):\n            self._parsed_version = parse_version(self.version)\n\n        return self._parsed_version\n\n    def _warn_legacy_version(self):\n        LV = packaging.version.LegacyVersion\n        is_legacy = isinstance(self._parsed_version, LV)\n        if not is_legacy:\n            return\n\n        # While an empty version is technically a legacy version and\n        # is not a valid PEP 440 version, it's also unlikely to\n        # actually come from someone and instead it is more likely that\n        # it comes from setuptools attempting to parse a filename and\n        # including it in the list. So for that we'll gate this warning\n        # on if the version is anything at all or not.\n        if not self.version:\n            return\n\n        tmpl = textwrap.dedent(\"\"\"\n            '{project_name} ({version})' is being parsed as a legacy,\n            non PEP 440,\n            version. You may find odd behavior and sort order.\n            In particular it will be sorted as less than 0.0. It\n            is recommended to migrate to PEP 440 compatible\n            versions.\n            \"\"\").strip().replace('\\n', ' ')\n\n        warnings.warn(tmpl.format(**vars(self)), PEP440Warning)\n\n    @property\n    def version(self):\n        try:\n            return self._version\n        except AttributeError:\n            version = self._get_version()\n            if version is None:\n                path = self._get_metadata_path_for_display(self.PKG_INFO)\n                msg = (\n                    \"Missing 'Version:' header and/or {} file at path: {}\"\n                ).format(self.PKG_INFO, path)\n                raise ValueError(msg, self)\n\n            return version\n\n    @property\n    def _dep_map(self):\n        \"\"\"\n        A map of extra to its list of (direct) requirements\n        for this distribution, including the null extra.\n        \"\"\"\n        try:\n            return self.__dep_map\n        except AttributeError:\n            self.__dep_map = self._filter_extras(self._build_dep_map())\n        return self.__dep_map\n\n    @staticmethod\n    def _filter_extras(dm):\n        \"\"\"\n        Given a mapping of extras to dependencies, strip off\n        environment markers and filter out any dependencies\n        not matching the markers.\n        \"\"\"\n        for extra in list(filter(None, dm)):\n            new_extra = extra\n            reqs = dm.pop(extra)\n            new_extra, _, marker = extra.partition(':')\n            fails_marker = marker and (\n                invalid_marker(marker)\n                or not evaluate_marker(marker)\n            )\n            if fails_marker:\n                reqs = []\n            new_extra = safe_extra(new_extra) or None\n\n            dm.setdefault(new_extra, []).extend(reqs)\n        return dm\n\n    def _build_dep_map(self):\n        dm = {}\n        for name in 'requires.txt', 'depends.txt':\n            for extra, reqs in split_sections(self._get_metadata(name)):\n                dm.setdefault(extra, []).extend(parse_requirements(reqs))\n        return dm\n\n    def requires(self, extras=()):\n        \"\"\"List of Requirements needed for this distro if `extras` are used\"\"\"\n        dm = self._dep_map\n        deps = []\n        deps.extend(dm.get(None, ()))\n        for ext in extras:\n            try:\n                deps.extend(dm[safe_extra(ext)])\n            except KeyError:\n                raise UnknownExtra(\n                    \"%s has no such extra feature %r\" % (self, ext)\n                )\n        return deps\n\n    def _get_metadata_path_for_display(self, name):\n        \"\"\"\n        Return the path to the given metadata file, if available.\n        \"\"\"\n        try:\n            # We need to access _get_metadata_path() on the provider object\n            # directly rather than through this class's __getattr__()\n            # since _get_metadata_path() is marked private.\n            path = self._provider._get_metadata_path(name)\n\n        # Handle exceptions e.g. in case the distribution's metadata\n        # provider doesn't support _get_metadata_path().\n        except Exception:\n            return '[could not detect]'\n\n        return path\n\n    def _get_metadata(self, name):\n        if self.has_metadata(name):\n            for line in self.get_metadata_lines(name):\n                yield line\n\n    def _get_version(self):\n        lines = self._get_metadata(self.PKG_INFO)\n        version = _version_from_file(lines)\n\n        return version\n\n    def activate(self, path=None, replace=False):\n        \"\"\"Ensure distribution is importable on `path` (default=sys.path)\"\"\"\n        if path is None:\n            path = sys.path\n        self.insert_on(path, replace=replace)\n        if path is sys.path:\n            fixup_namespace_packages(self.location)\n            for pkg in self._get_metadata('namespace_packages.txt'):\n                if pkg in sys.modules:\n                    declare_namespace(pkg)\n\n    def egg_name(self):\n        \"\"\"Return what this distribution's standard .egg filename should be\"\"\"\n        filename = \"%s-%s-py%s\" % (\n            to_filename(self.project_name), to_filename(self.version),\n            self.py_version or PY_MAJOR\n        )\n\n        if self.platform:\n            filename += '-' + self.platform\n        return filename\n\n    def __repr__(self):\n        if self.location:\n            return \"%s (%s)\" % (self, self.location)\n        else:\n            return str(self)\n\n    def __str__(self):\n        try:\n            version = getattr(self, 'version', None)\n        except ValueError:\n            version = None\n        version = version or \"[unknown version]\"\n        return \"%s %s\" % (self.project_name, version)\n\n    def __getattr__(self, attr):\n        \"\"\"Delegate all unrecognized public attributes to .metadata provider\"\"\"\n        if attr.startswith('_'):\n            raise AttributeError(attr)\n        return getattr(self._provider, attr)\n\n    def __dir__(self):\n        return list(\n            set(super(Distribution, self).__dir__())\n            | set(\n                attr for attr in self._provider.__dir__()\n                if not attr.startswith('_')\n            )\n        )\n\n    if not hasattr(object, '__dir__'):\n        # python 2.7 not supported\n        del __dir__\n\n    @classmethod\n    def from_filename(cls, filename, metadata=None, **kw):\n        return cls.from_location(\n            _normalize_cached(filename), os.path.basename(filename), metadata,\n            **kw\n        )\n\n    def as_requirement(self):\n        \"\"\"Return a ``Requirement`` that matches this distribution exactly\"\"\"\n        if isinstance(self.parsed_version, packaging.version.Version):\n            spec = \"%s==%s\" % (self.project_name, self.parsed_version)\n        else:\n            spec = \"%s===%s\" % (self.project_name, self.parsed_version)\n\n        return Requirement.parse(spec)\n\n    def load_entry_point(self, group, name):\n        \"\"\"Return the `name` entry point of `group` or raise ImportError\"\"\"\n        ep = self.get_entry_info(group, name)\n        if ep is None:\n            raise ImportError(\"Entry point %r not found\" % ((group, name),))\n        return ep.load()\n\n    def get_entry_map(self, group=None):\n        \"\"\"Return the entry point map for `group`, or the full entry map\"\"\"\n        try:\n            ep_map = self._ep_map\n        except AttributeError:\n            ep_map = self._ep_map = EntryPoint.parse_map(\n                self._get_metadata('entry_points.txt'), self\n            )\n        if group is not None:\n            return ep_map.get(group, {})\n        return ep_map\n\n    def get_entry_info(self, group, name):\n        \"\"\"Return the EntryPoint object for `group`+`name`, or ``None``\"\"\"\n        return self.get_entry_map(group).get(name)\n\n    def insert_on(self, path, loc=None, replace=False):\n        \"\"\"Ensure self.location is on path\n\n        If replace=False (default):\n            - If location is already in path anywhere, do nothing.\n            - Else:\n              - If it's an egg and its parent directory is on path,\n                insert just ahead of the parent.\n              - Else: add to the end of path.\n        If replace=True:\n            - If location is already on path anywhere (not eggs)\n              or higher priority than its parent (eggs)\n              do nothing.\n            - Else:\n              - If it's an egg and its parent directory is on path,\n                insert just ahead of the parent,\n                removing any lower-priority entries.\n              - Else: add it to the front of path.\n        \"\"\"\n\n        loc = loc or self.location\n        if not loc:\n            return\n\n        nloc = _normalize_cached(loc)\n        bdir = os.path.dirname(nloc)\n        npath = [(p and _normalize_cached(p) or p) for p in path]\n\n        for p, item in enumerate(npath):\n            if item == nloc:\n                if replace:\n                    break\n                else:\n                    # don't modify path (even removing duplicates) if\n                    # found and not replace\n                    return\n            elif item == bdir and self.precedence == EGG_DIST:\n                # if it's an .egg, give it precedence over its directory\n                # UNLESS it's already been added to sys.path and replace=False\n                if (not replace) and nloc in npath[p:]:\n                    return\n                if path is sys.path:\n                    self.check_version_conflict()\n                path.insert(p, loc)\n                npath.insert(p, nloc)\n                break\n        else:\n            if path is sys.path:\n                self.check_version_conflict()\n            if replace:\n                path.insert(0, loc)\n            else:\n                path.append(loc)\n            return\n\n        # p is the spot where we found or inserted loc; now remove duplicates\n        while True:\n            try:\n                np = npath.index(nloc, p + 1)\n            except ValueError:\n                break\n            else:\n                del npath[np], path[np]\n                # ha!\n                p = np\n\n        return\n\n    def check_version_conflict(self):\n        if self.key == 'setuptools':\n            # ignore the inevitable setuptools self-conflicts  :(\n            return\n\n        nsp = dict.fromkeys(self._get_metadata('namespace_packages.txt'))\n        loc = normalize_path(self.location)\n        for modname in self._get_metadata('top_level.txt'):\n            if (modname not in sys.modules or modname in nsp\n                    or modname in _namespace_packages):\n                continue\n            if modname in ('pkg_resources', 'setuptools', 'site'):\n                continue\n            fn = getattr(sys.modules[modname], '__file__', None)\n            if fn and (normalize_path(fn).startswith(loc) or\n                       fn.startswith(self.location)):\n                continue\n            issue_warning(\n                \"Module %s was already imported from %s, but %s is being added\"\n                \" to sys.path\" % (modname, fn, self.location),\n            )\n\n    def has_version(self):\n        try:\n            self.version\n        except ValueError:\n            issue_warning(\"Unbuilt egg for \" + repr(self))\n            return False\n        return True\n\n    def clone(self, **kw):\n        \"\"\"Copy this distribution, substituting in any changed keyword args\"\"\"\n        names = 'project_name version py_version platform location precedence'\n        for attr in names.split():\n            kw.setdefault(attr, getattr(self, attr, None))\n        kw.setdefault('metadata', self._provider)\n        return self.__class__(**kw)\n\n    @property\n    def extras(self):\n        return [dep for dep in self._dep_map if dep]\n\n\nclass EggInfoDistribution(Distribution):\n    def _reload_version(self):\n        \"\"\"\n        Packages installed by distutils (e.g. numpy or scipy),\n        which uses an old safe_version, and so\n        their version numbers can get mangled when\n        converted to filenames (e.g., 1.11.0.dev0+2329eae to\n        1.11.0.dev0_2329eae). These distributions will not be\n        parsed properly\n        downstream by Distribution and safe_version, so\n        take an extra step and try to get the version number from\n        the metadata file itself instead of the filename.\n        \"\"\"\n        md_version = self._get_version()\n        if md_version:\n            self._version = md_version\n        return self\n\n\nclass DistInfoDistribution(Distribution):\n    \"\"\"\n    Wrap an actual or potential sys.path entry\n    w/metadata, .dist-info style.\n    \"\"\"\n    PKG_INFO = 'METADATA'\n    EQEQ = re.compile(r\"([\\(,])\\s*(\\d.*?)\\s*([,\\)])\")\n\n    @property\n    def _parsed_pkg_info(self):\n        \"\"\"Parse and cache metadata\"\"\"\n        try:\n            return self._pkg_info\n        except AttributeError:\n            metadata = self.get_metadata(self.PKG_INFO)\n            self._pkg_info = email.parser.Parser().parsestr(metadata)\n            return self._pkg_info\n\n    @property\n    def _dep_map(self):\n        try:\n            return self.__dep_map\n        except AttributeError:\n            self.__dep_map = self._compute_dependencies()\n            return self.__dep_map\n\n    def _compute_dependencies(self):\n        \"\"\"Recompute this distribution's dependencies.\"\"\"\n        dm = self.__dep_map = {None: []}\n\n        reqs = []\n        # Including any condition expressions\n        for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:\n            reqs.extend(parse_requirements(req))\n\n        def reqs_for_extra(extra):\n            for req in reqs:\n                if not req.marker or req.marker.evaluate({'extra': extra}):\n                    yield req\n\n        common = frozenset(reqs_for_extra(None))\n        dm[None].extend(common)\n\n        for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []:\n            s_extra = safe_extra(extra.strip())\n            dm[s_extra] = list(frozenset(reqs_for_extra(extra)) - common)\n\n        return dm\n\n\n_distributionImpl = {\n    '.egg': Distribution,\n    '.egg-info': EggInfoDistribution,\n    '.dist-info': DistInfoDistribution,\n}\n\n\ndef issue_warning(*args, **kw):\n    return\n    level = 1\n    g = globals()\n    try:\n        # find the first stack frame that is *not* code in\n        # the pkg_resources module, to use for the warning\n        while sys._getframe(level).f_globals is g:\n            level += 1\n    except ValueError:\n        pass\n    warnings.warn(stacklevel=level + 1, *args, **kw)\n\n\nclass RequirementParseError(ValueError):\n    def __str__(self):\n        return ' '.join(self.args)\n\n\ndef parse_requirements(strs):\n    \"\"\"Yield ``Requirement`` objects for each specification in `strs`\n\n    `strs` must be a string, or a (possibly-nested) iterable thereof.\n    \"\"\"\n    # create a steppable iterator, so we can handle \\-continuations\n    lines = iter(yield_lines(strs))\n\n    for line in lines:\n        # Drop comments -- a hash without a space may be in a URL.\n        if ' #' in line:\n            line = line[:line.find(' #')]\n        # If there is a line continuation, drop it, and append the next line.\n        if line.endswith('\\\\'):\n            line = line[:-2].strip()\n            try:\n                line += next(lines)\n            except StopIteration:\n                return\n        yield Requirement(line)\n\ndef _always_object(classes):\n    \"\"\"\n    Ensure object appears in the mro even\n    for old-style classes.\n    \"\"\"\n    if object not in classes:\n        return classes + (object,)\n    return classes\n\n\ndef _find_adapter(registry, ob):\n    \"\"\"Return an adapter factory for `ob` from `registry`\"\"\"\n    types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob))))\n    for t in types:\n        if t in registry:\n            return registry[t]\n\n\ndef split_sections(s):\n    \"\"\"Split a string or iterable thereof into (section, content) pairs\n\n    Each ``section`` is a stripped version of the section header (\"[section]\")\n    and each ``content`` is a list of stripped lines excluding blank lines and\n    comment-only lines.  If there are any such lines before the first section\n    header, they're returned in a first ``section`` of ``None``.\n    \"\"\"\n    section = None\n    content = []\n    for line in yield_lines(s):\n        if line.startswith(\"[\"):\n            if line.endswith(\"]\"):\n                if section or content:\n                    yield section, content\n                section = line[1:-1].strip()\n                content = []\n            else:\n                raise ValueError(\"Invalid section heading\", line)\n        else:\n            content.append(line)\n\n    # wrap up last segment\n    yield section, content\n\n\ndef _mkstemp(*args, **kw):\n    old_open = os.open\n    try:\n        # temporarily bypass sandboxing\n        os.open = os_open\n        return tempfile.mkstemp(*args, **kw)\n    finally:\n        # and then put it back\n        os.open = old_open\n\n\n# Silence the PEP440Warning by default, so that end users don't get hit by it\n# randomly just because they use pkg_resources. We want to append the rule\n# because we want earlier uses of filterwarnings to take precedence over this\n# one.\nwarnings.filterwarnings(\"ignore\", category=PEP440Warning, append=True)\n\n\n# from jaraco.functools 1.3\ndef _call_aside(f, *args, **kwargs):\n    f(*args, **kwargs)\n    return f\n\n\n@_call_aside\ndef _initialize(g=globals()):\n    \"Set up global resource manager (deliberately not state-saved)\"\n\n    return\n    manager = ResourceManager()\n    g['_manager'] = manager\n    g.update(\n        (name, getattr(manager, name))\n        for name in dir(manager)\n        if not name.startswith('_')\n    )\n\n\n@_call_aside\ndef _initialize_master_working_set():\n    \"\"\"\n    Prepare the master working set and make the ``require()``\n    API available.\n\n    This function has explicit effects on the global state\n    of pkg_resources. It is intended to be invoked once at\n    the initialization of this module.\n\n    Invocation by other packages is unsupported and done\n    at their own risk.\n    \"\"\"\n\n    # Nuitka: We do not care for this bit in Jinja2, which is the only reason the\n    # inline copy is there.\n    return\n\n    working_set = WorkingSet._build_master()\n    _declare_state('object', working_set=working_set)\n\n    require = working_set.require\n    iter_entry_points = working_set.iter_entry_points\n    add_activation_listener = working_set.subscribe\n    run_script = working_set.run_script\n    # backward compatibility\n    run_main = run_script\n    # Activate all distributions already on sys.path with replace=False and\n    # ensure that all distributions added to the working set in the future\n    # (e.g. by calling ``require()``) will get activated as well,\n    # with higher priority (replace=True).\n    tuple(\n        dist.activate(replace=False)\n        for dist in working_set\n    )\n    add_activation_listener(\n        lambda dist: dist.activate(replace=True),\n        existing=False,\n    )\n    working_set.entries = []\n    # match order\n    list(map(working_set.add_entry, sys.path))\n    globals().update(locals())\n\nclass PkgResourcesDeprecationWarning(Warning):\n    \"\"\"\n    Base class for warning about deprecations in ``pkg_resources``\n\n    This class is not derived from ``DeprecationWarning``, and as such is\n    visible by default.\n    \"\"\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/LICENCE",
    "content": "`tqdm` is a product of collaborative work.\nUnless otherwise stated, all authors (see commit logs) retain copyright\nfor their respective work, and release the work under the MIT licence\n(text below).\n\nExceptions or notable authors are listed below\nin reverse chronological order:\n\n* files: *\n  MPLv2.0 2015-2021 (c) Casper da Costa-Luis\n  [casperdcl](https://github.com/casperdcl).\n* files: tqdm/_tqdm.py\n  MIT 2016 (c) [PR #96] on behalf of Google Inc.\n* files: tqdm/_tqdm.py setup.py README.rst MANIFEST.in .gitignore\n  MIT 2013 (c) Noam Yorav-Raphael, original author.\n\n[PR #96]: https://github.com/tqdm/tqdm/pull/96\n\n\nMozilla Public Licence (MPL) v. 2.0 - Exhibit A\n-----------------------------------------------\n\nThis Source Code Form is subject to the terms of the\nMozilla Public License, v. 2.0.\nIf a copy of the MPL was not distributed with this file,\nYou can obtain one at https://mozilla.org/MPL/2.0/.\n\n\nMIT License (MIT)\n-----------------\n\nCopyright (c) 2013 noamraph\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/__init__.py",
    "content": "from ._monitor import TMonitor, TqdmSynchronisationWarning\nfrom ._tqdm_pandas import tqdm_pandas\n# from .gui import tqdm as tqdm_gui  # TODO: remove in v5.0.0\n# from .gui import trange as tgrange  # TODO: remove in v5.0.0\nfrom .std import (\n    TqdmDeprecationWarning, TqdmExperimentalWarning, TqdmKeyError, TqdmMonitorWarning,\n    TqdmTypeError, TqdmWarning, tqdm, trange)\nfrom .version import __version__\n\n__all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',\n           'tqdm_notebook', 'tnrange', 'main', 'TMonitor',\n           'TqdmTypeError', 'TqdmKeyError',\n           'TqdmWarning', 'TqdmDeprecationWarning',\n           'TqdmExperimentalWarning',\n           'TqdmMonitorWarning', 'TqdmSynchronisationWarning',\n           '__version__']\n\n\ndef tqdm_notebook(*args, **kwargs):  # pragma: no cover\n    \"\"\"See tqdm.notebook.tqdm for full documentation\"\"\"\n    from warnings import warn\n\n    from .notebook import tqdm as _tqdm_notebook\n    warn(\"This function will be removed in tqdm==5.0.0\\n\"\n         \"Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`\",\n         TqdmDeprecationWarning, stacklevel=2)\n    return _tqdm_notebook(*args, **kwargs)\n\n\ndef tnrange(*args, **kwargs):  # pragma: no cover\n    \"\"\"\n    A shortcut for `tqdm.notebook.tqdm(xrange(*args), **kwargs)`.\n    On Python3+, `range` is used instead of `xrange`.\n    \"\"\"\n    from warnings import warn\n\n    from .notebook import trange as _tnrange\n    warn(\"Please use `tqdm.notebook.trange` instead of `tqdm.tnrange`\",\n         TqdmDeprecationWarning, stacklevel=2)\n    return _tnrange(*args, **kwargs)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_main.py",
    "content": "from warnings import warn\n\nfrom .cli import *  # NOQA\nfrom .cli import __all__  # NOQA\nfrom .std import TqdmDeprecationWarning\n\nwarn(\"This function will be removed in tqdm==5.0.0\\n\"\n     \"Please use `tqdm.cli.*` instead of `tqdm._main.*`\",\n     TqdmDeprecationWarning, stacklevel=2)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_monitor.py",
    "content": "import atexit\nfrom threading import Event, Thread, current_thread\nfrom time import time\nfrom warnings import warn\n\n__all__ = [\"TMonitor\", \"TqdmSynchronisationWarning\"]\n\n\nclass TqdmSynchronisationWarning(RuntimeWarning):\n    \"\"\"tqdm multi-thread/-process errors which may cause incorrect nesting\n    but otherwise no adverse effects\"\"\"\n    pass\n\n\nclass TMonitor(Thread):\n    \"\"\"\n    Monitoring thread for tqdm bars.\n    Monitors if tqdm bars are taking too much time to display\n    and readjusts miniters automatically if necessary.\n\n    Parameters\n    ----------\n    tqdm_cls  : class\n        tqdm class to use (can be core tqdm or a submodule).\n    sleep_interval  : fload\n        Time to sleep between monitoring checks.\n    \"\"\"\n    _test = {}  # internal vars for unit testing\n\n    def __init__(self, tqdm_cls, sleep_interval):\n        Thread.__init__(self)\n        self.daemon = True  # kill thread when main killed (KeyboardInterrupt)\n        self.woken = 0  # last time woken up, to sync with monitor\n        self.tqdm_cls = tqdm_cls\n        self.sleep_interval = sleep_interval\n        self._time = self._test.get(\"time\", time)\n        self.was_killed = self._test.get(\"Event\", Event)()\n        atexit.register(self.exit)\n        self.start()\n\n    def exit(self):\n        self.was_killed.set()\n        if self is not current_thread():\n            self.join()\n        return self.report()\n\n    def get_instances(self):\n        # returns a copy of started `tqdm_cls` instances\n        return [i for i in self.tqdm_cls._instances.copy()\n                # Avoid race by checking that the instance started\n                if hasattr(i, 'start_t')]\n\n    def run(self):\n        cur_t = self._time()\n        while True:\n            # After processing and before sleeping, notify that we woke\n            # Need to be done just before sleeping\n            self.woken = cur_t\n            # Sleep some time...\n            self.was_killed.wait(self.sleep_interval)\n            # Quit if killed\n            if self.was_killed.is_set():\n                return\n            # Then monitor!\n            # Acquire lock (to access _instances)\n            with self.tqdm_cls.get_lock():\n                cur_t = self._time()\n                # Check tqdm instances are waiting too long to print\n                instances = self.get_instances()\n                for instance in instances:\n                    # Check event in loop to reduce blocking time on exit\n                    if self.was_killed.is_set():\n                        return\n                    # Only if mininterval > 1 (else iterations are just slow)\n                    # and last refresh exceeded maxinterval\n                    if instance.miniters > 1 and \\\n                            (cur_t - instance.last_print_t) >= \\\n                            instance.maxinterval:\n                        # force bypassing miniters on next iteration\n                        # (dynamic_miniters adjusts mininterval automatically)\n                        instance.miniters = 1\n                        # Refresh now! (works only for manual tqdm)\n                        instance.refresh(nolock=True)\n                    # Remove accidental long-lived strong reference\n                    del instance\n                if instances != self.get_instances():  # pragma: nocover\n                    warn(\"Set changed size during iteration\" +\n                         \" (see https://github.com/tqdm/tqdm/issues/481)\",\n                         TqdmSynchronisationWarning, stacklevel=2)\n                # Remove accidental long-lived strong references\n                del instances\n\n    def report(self):\n        return not self.was_killed.is_set()\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py",
    "content": "from warnings import warn\n\nfrom .std import *  # NOQA\nfrom .std import __all__  # NOQA\nfrom .std import TqdmDeprecationWarning\n\nwarn(\"This function will be removed in tqdm==5.0.0\\n\"\n     \"Please use `tqdm.std.*` instead of `tqdm._tqdm.*`\",\n     TqdmDeprecationWarning, stacklevel=2)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py",
    "content": "from warnings import warn\n\nfrom .notebook import *  # NOQA\nfrom .notebook import __all__  # NOQA\nfrom .std import TqdmDeprecationWarning\n\nwarn(\"This function will be removed in tqdm==5.0.0\\n\"\n     \"Please use `tqdm.notebook.*` instead of `tqdm._tqdm_notebook.*`\",\n     TqdmDeprecationWarning, stacklevel=2)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py",
    "content": "import sys\n\n__author__ = \"github.com/casperdcl\"\n__all__ = ['tqdm_pandas']\n\n\ndef tqdm_pandas(tclass, **tqdm_kwargs):\n    \"\"\"\n    Registers the given `tqdm` instance with\n    `pandas.core.groupby.DataFrameGroupBy.progress_apply`.\n    \"\"\"\n    from tqdm import TqdmDeprecationWarning\n\n    if isinstance(tclass, type) or (getattr(tclass, '__name__', '').startswith(\n            'tqdm_')):  # delayed adapter case\n        TqdmDeprecationWarning(\n            \"Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm, ...)`.\",\n            fp_write=getattr(tqdm_kwargs.get('file', None), 'write', sys.stderr.write))\n        tclass.pandas(**tqdm_kwargs)\n    else:\n        TqdmDeprecationWarning(\n            \"Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm(...))`.\",\n            fp_write=getattr(tclass.fp, 'write', sys.stderr.write))\n        type(tclass).pandas(deprecated_t=tclass)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/_utils.py",
    "content": "from warnings import warn\n\nfrom .std import TqdmDeprecationWarning\nfrom .utils import (  # NOQA, pylint: disable=unused-import\n    CUR_OS, IS_NIX, IS_WIN, RE_ANSI, Comparable, FormatReplace, SimpleTextIOWrapper,\n    _basestring, _environ_cols_wrapper, _is_ascii, _is_utf, _range, _screen_shape_linux,\n    _screen_shape_tput, _screen_shape_windows, _screen_shape_wrapper, _supports_unicode,\n    _term_move_up, _unich, _unicode, colorama)\n\nwarn(\"This function will be removed in tqdm==5.0.0\\n\"\n     \"Please use `tqdm.utils.*` instead of `tqdm._utils.*`\",\n     TqdmDeprecationWarning, stacklevel=2)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/auto.py",
    "content": "\"\"\"\nEnables multiple commonly used features.\n\nMethod resolution order:\n\n- `tqdm.autonotebook` without import warnings\n- `tqdm.asyncio` on Python3.6+\n- `tqdm.std` base class\n\nUsage:\n>>> from tqdm.auto import trange, tqdm\n>>> for i in trange(10):\n...     ...\n\"\"\"\nimport sys\nimport warnings\n\nfrom .std import TqdmExperimentalWarning\n\nwith warnings.catch_warnings():\n    warnings.simplefilter(\"ignore\", category=TqdmExperimentalWarning)\n    from .autonotebook import tqdm as notebook_tqdm\n    from .autonotebook import trange as notebook_trange\n\nif sys.version_info[:2] < (3, 6):\n    tqdm = notebook_tqdm\n    trange = notebook_trange\nelse:  # Python3.6+\n    from .asyncio import tqdm as asyncio_tqdm\n    from .std import tqdm as std_tqdm\n\n    if notebook_tqdm != std_tqdm:\n        class tqdm(notebook_tqdm, asyncio_tqdm):  # pylint: disable=inconsistent-mro\n            pass\n    else:\n        tqdm = asyncio_tqdm\n\n    def trange(*args, **kwargs):\n        \"\"\"\n        A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`.\n        \"\"\"\n        return tqdm(range(*args), **kwargs)\n\n__all__ = [\"tqdm\", \"trange\"]\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py",
    "content": "\"\"\"\nAutomatically choose between `tqdm.notebook` and `tqdm.std`.\n\nUsage:\n>>> from tqdm.autonotebook import trange, tqdm\n>>> for i in trange(10):\n...     ...\n\"\"\"\nimport os\nimport sys\n\ntry:\n    get_ipython = sys.modules['IPython'].get_ipython\n    if 'IPKernelApp' not in get_ipython().config:  # pragma: no cover\n        raise ImportError(\"console\")\n    if 'VSCODE_PID' in os.environ:  # pragma: no cover\n        raise ImportError(\"vscode\")\nexcept Exception:\n    from .std import tqdm, trange\nelse:  # pragma: no cover\n    from warnings import warn\n\n    from .notebook import tqdm, trange\n    from .std import TqdmExperimentalWarning\n    warn(\"Using `tqdm.autonotebook.tqdm` in notebook mode.\"\n         \" Use `tqdm.tqdm` instead to force console mode\"\n         \" (e.g. in jupyter console)\", TqdmExperimentalWarning, stacklevel=2)\n__all__ = [\"tqdm\", \"trange\"]\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/dask.py",
    "content": "from __future__ import absolute_import\n\nfrom functools import partial\n\nfrom dask.callbacks import Callback\n\nfrom .auto import tqdm as tqdm_auto\n\n__author__ = {\"github.com/\": [\"casperdcl\"]}\n__all__ = ['TqdmCallback']\n\n\nclass TqdmCallback(Callback):\n    \"\"\"Dask callback for task progress.\"\"\"\n    def __init__(self, start=None, pretask=None, tqdm_class=tqdm_auto,\n                 **tqdm_kwargs):\n        \"\"\"\n        Parameters\n        ----------\n        tqdm_class : optional\n            `tqdm` class to use for bars [default: `tqdm.auto.tqdm`].\n        tqdm_kwargs  : optional\n            Any other arguments used for all bars.\n        \"\"\"\n        super(TqdmCallback, self).__init__(start=start, pretask=pretask)\n        if tqdm_kwargs:\n            tqdm_class = partial(tqdm_class, **tqdm_kwargs)\n        self.tqdm_class = tqdm_class\n\n    def _start_state(self, _, state):\n        self.pbar = self.tqdm_class(total=sum(\n            len(state[k]) for k in ['ready', 'waiting', 'running', 'finished']))\n\n    def _posttask(self, *_, **__):\n        self.pbar.update()\n\n    def _finish(self, *_, **__):\n        self.pbar.close()\n\n    def display(self):\n        \"\"\"Displays in the current cell in Notebooks.\"\"\"\n        container = getattr(self.bar, 'container', None)\n        if container is None:\n            return\n        from .notebook import display\n        display(container)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/notebook.py",
    "content": "\"\"\"\nIPython/Jupyter Notebook progressbar decorator for iterators.\nIncludes a default `range` iterator printing to `stderr`.\n\nUsage:\n>>> from tqdm.notebook import trange, tqdm\n>>> for i in trange(10):\n...     ...\n\"\"\"\n# future division is important to divide integers and get as\n# a result precise floating numbers (instead of truncated int)\nfrom __future__ import absolute_import, division\n\n# import compatibility functions and utilities\nimport re\nimport sys\n\n# to inherit from the tqdm class\nfrom .std import tqdm as std_tqdm\nfrom .utils import _range\n\nif True:  # pragma: no cover\n    # import IPython/Jupyter base widget and display utilities\n    IPY = 0\n    try:  # IPython 4.x\n        import ipywidgets\n        IPY = 4\n    except ImportError:  # IPython 3.x / 2.x\n        IPY = 32\n        import warnings\n        with warnings.catch_warnings():\n            warnings.filterwarnings(\n                'ignore', message=\".*The `IPython.html` package has been deprecated.*\")\n            try:\n                import IPython.html.widgets as ipywidgets  # NOQA: F401\n            except ImportError:\n                pass\n\n    try:  # IPython 4.x / 3.x\n        if IPY == 32:\n            from IPython.html.widgets import HTML\n            from IPython.html.widgets import FloatProgress as IProgress\n            from IPython.html.widgets import HBox\n            IPY = 3\n        else:\n            from ipywidgets import HTML\n            from ipywidgets import FloatProgress as IProgress\n            from ipywidgets import HBox\n    except ImportError:\n        try:  # IPython 2.x\n            from IPython.html.widgets import HTML\n            from IPython.html.widgets import ContainerWidget as HBox\n            from IPython.html.widgets import FloatProgressWidget as IProgress\n            IPY = 2\n        except ImportError:\n            IPY = 0\n            IProgress = None\n            HBox = object\n\n    try:\n        from IPython.display import display  # , clear_output\n    except ImportError:\n        pass\n\n    # HTML encoding\n    try:  # Py3\n        from html import escape\n    except ImportError:  # Py2\n        from cgi import escape\n\n__author__ = {\"github.com/\": [\"lrq3000\", \"casperdcl\", \"alexanderkuk\"]}\n__all__ = ['tqdm_notebook', 'tnrange', 'tqdm', 'trange']\n\n\nclass TqdmHBox(HBox):\n    \"\"\"`ipywidgets.HBox` with a pretty representation\"\"\"\n    def _repr_json_(self, pretty=None):\n        if not hasattr(self, \"pbar\"):\n            return {}\n        d = self.pbar.format_dict\n        if pretty is not None:\n            d[\"ascii\"] = not pretty\n        return d\n\n    def __repr__(self, pretty=False):\n        if not hasattr(self, \"pbar\"):\n            return super(TqdmHBox, self).__repr__()\n        return self.pbar.format_meter(**self._repr_json_(pretty))\n\n    def _repr_pretty_(self, pp, *_, **__):\n        pp.text(self.__repr__(True))\n\n\nclass tqdm_notebook(std_tqdm):\n    \"\"\"\n    Experimental IPython/Jupyter Notebook widget using tqdm!\n    \"\"\"\n    @staticmethod\n    def status_printer(_, total=None, desc=None, ncols=None):\n        \"\"\"\n        Manage the printing of an IPython/Jupyter Notebook progress bar widget.\n        \"\"\"\n        # Fallback to text bar if there's no total\n        # DEPRECATED: replaced with an 'info' style bar\n        # if not total:\n        #    return super(tqdm_notebook, tqdm_notebook).status_printer(file)\n\n        # fp = file\n\n        # Prepare IPython progress bar\n        if IProgress is None:  # #187 #451 #558 #872\n            raise ImportError(\n                \"IProgress not found. Please update jupyter and ipywidgets.\"\n                \" See https://ipywidgets.readthedocs.io/en/stable\"\n                \"/user_install.html\")\n        if total:\n            pbar = IProgress(min=0, max=total)\n        else:  # No total? Show info style bar with no progress tqdm status\n            pbar = IProgress(min=0, max=1)\n            pbar.value = 1\n            pbar.bar_style = 'info'\n            if ncols is None:\n                pbar.layout.width = \"20px\"\n\n        ltext = HTML()\n        rtext = HTML()\n        if desc:\n            ltext.value = desc\n        container = TqdmHBox(children=[ltext, pbar, rtext])\n        # Prepare layout\n        if ncols is not None:  # use default style of ipywidgets\n            # ncols could be 100, \"100px\", \"100%\"\n            ncols = str(ncols)  # ipywidgets only accepts string\n            try:\n                if int(ncols) > 0:  # isnumeric and positive\n                    ncols += 'px'\n            except ValueError:\n                pass\n            pbar.layout.flex = '2'\n            container.layout.width = ncols\n            container.layout.display = 'inline-flex'\n            container.layout.flex_flow = 'row wrap'\n\n        return container\n\n    def display(self, msg=None, pos=None,\n                # additional signals\n                close=False, bar_style=None):\n        # Note: contrary to native tqdm, msg='' does NOT clear bar\n        # goal is to keep all infos if error happens so user knows\n        # at which iteration the loop failed.\n\n        # Clear previous output (really necessary?)\n        # clear_output(wait=1)\n\n        if not msg and not close:\n            d = self.format_dict\n            # remove {bar}\n            d['bar_format'] = (d['bar_format'] or \"{l_bar}<bar/>{r_bar}\").replace(\n                \"{bar}\", \"<bar/>\")\n            msg = self.format_meter(**d)\n\n        ltext, pbar, rtext = self.container.children\n        pbar.value = self.n\n\n        if msg:\n            # html escape special characters (like '&')\n            if '<bar/>' in msg:\n                left, right = map(escape, re.split(r'\\|?<bar/>\\|?', msg, 1))\n            else:\n                left, right = '', escape(msg)\n\n            # Update description\n            ltext.value = left\n            # never clear the bar (signal: msg='')\n            if right:\n                rtext.value = right\n\n        # Change bar style\n        if bar_style:\n            # Hack-ish way to avoid the danger bar_style being overridden by\n            # success because the bar gets closed after the error...\n            if pbar.bar_style != 'danger' or bar_style != 'success':\n                pbar.bar_style = bar_style\n\n        # Special signal to close the bar\n        if close and pbar.bar_style != 'danger':  # hide only if no error\n            try:\n                self.container.close()\n            except AttributeError:\n                self.container.visible = False\n\n    @property\n    def colour(self):\n        if hasattr(self, 'container'):\n            return self.container.children[-2].style.bar_color\n\n    @colour.setter\n    def colour(self, bar_color):\n        if hasattr(self, 'container'):\n            self.container.children[-2].style.bar_color = bar_color\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"\n        Supports the usual `tqdm.tqdm` parameters as well as those listed below.\n\n        Parameters\n        ----------\n        display  : Whether to call `display(self.container)` immediately\n            [default: True].\n        \"\"\"\n        kwargs = kwargs.copy()\n        # Setup default output\n        file_kwarg = kwargs.get('file', sys.stderr)\n        if file_kwarg is sys.stderr or file_kwarg is None:\n            kwargs['file'] = sys.stdout  # avoid the red block in IPython\n\n        # Initialize parent class + avoid printing by using gui=True\n        kwargs['gui'] = True\n        # convert disable = None to False\n        kwargs['disable'] = bool(kwargs.get('disable', False))\n        colour = kwargs.pop('colour', None)\n        display_here = kwargs.pop('display', True)\n        super(tqdm_notebook, self).__init__(*args, **kwargs)\n        if self.disable or not kwargs['gui']:\n            self.disp = lambda *_, **__: None\n            return\n\n        # Get bar width\n        self.ncols = '100%' if self.dynamic_ncols else kwargs.get(\"ncols\", None)\n\n        # Replace with IPython progress bar display (with correct total)\n        unit_scale = 1 if self.unit_scale is True else self.unit_scale or 1\n        total = self.total * unit_scale if self.total else self.total\n        self.container = self.status_printer(self.fp, total, self.desc, self.ncols)\n        self.container.pbar = self\n        if display_here:\n            display(self.container)\n        self.disp = self.display\n        self.colour = colour\n\n        # Print initial bar state\n        if not self.disable:\n            self.display()\n\n    def __iter__(self):\n        try:\n            for obj in super(tqdm_notebook, self).__iter__():\n                # return super(tqdm...) will not catch exception\n                yield obj\n        # NB: except ... [ as ...] breaks IPython async KeyboardInterrupt\n        except:  # NOQA\n            self.disp(bar_style='danger')\n            raise\n        # NB: don't `finally: close()`\n        # since this could be a shared bar which the user will `reset()`\n\n    def update(self, n=1):\n        try:\n            return super(tqdm_notebook, self).update(n=n)\n        # NB: except ... [ as ...] breaks IPython async KeyboardInterrupt\n        except:  # NOQA\n            # cannot catch KeyboardInterrupt when using manual tqdm\n            # as the interrupt will most likely happen on another statement\n            self.disp(bar_style='danger')\n            raise\n        # NB: don't `finally: close()`\n        # since this could be a shared bar which the user will `reset()`\n\n    def close(self):\n        super(tqdm_notebook, self).close()\n        # Try to detect if there was an error or KeyboardInterrupt\n        # in manual mode: if n < total, things probably got wrong\n        if self.total and self.n < self.total:\n            self.disp(bar_style='danger')\n        else:\n            if self.leave:\n                self.disp(bar_style='success')\n            else:\n                self.disp(close=True)\n\n    def clear(self, *_, **__):\n        pass\n\n    def reset(self, total=None):\n        \"\"\"\n        Resets to 0 iterations for repeated use.\n\n        Consider combining with `leave=True`.\n\n        Parameters\n        ----------\n        total  : int or float, optional. Total to use for the new bar.\n        \"\"\"\n        if self.disable:\n            return super(tqdm_notebook, self).reset(total=total)\n        _, pbar, _ = self.container.children\n        pbar.bar_style = ''\n        if total is not None:\n            pbar.max = total\n            if not self.total and self.ncols is None:  # no longer unknown total\n                pbar.layout.width = None  # reset width\n        return super(tqdm_notebook, self).reset(total=total)\n\n\ndef tnrange(*args, **kwargs):\n    \"\"\"\n    A shortcut for `tqdm.notebook.tqdm(xrange(*args), **kwargs)`.\n    On Python3+, `range` is used instead of `xrange`.\n    \"\"\"\n    return tqdm_notebook(_range(*args), **kwargs)\n\n\n# Aliases\ntqdm = tqdm_notebook\ntrange = tnrange\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/std.py",
    "content": "\"\"\"\nCustomisable progressbar decorator for iterators.\nIncludes a default `range` iterator printing to `stderr`.\n\nUsage:\n>>> from tqdm import trange, tqdm\n>>> for i in trange(10):\n...     ...\n\"\"\"\nfrom __future__ import absolute_import, division\n\nimport sys\nfrom collections import OrderedDict, defaultdict\nfrom contextlib import contextmanager\nfrom datetime import datetime, timedelta\nfrom numbers import Number\nfrom time import time\nfrom warnings import warn\nfrom weakref import WeakSet\n\nfrom ._monitor import TMonitor\nfrom .utils import (\n    CallbackIOWrapper, Comparable, DisableOnWriteError, FormatReplace,\n    SimpleTextIOWrapper, _basestring, _is_ascii, _range, _screen_shape_wrapper,\n    _supports_unicode, _term_move_up, _unich, _unicode, disp_len, disp_trim)\n\n__author__ = \"https://github.com/tqdm/tqdm#contributions\"\n__all__ = ['tqdm', 'trange',\n           'TqdmTypeError', 'TqdmKeyError', 'TqdmWarning',\n           'TqdmExperimentalWarning', 'TqdmDeprecationWarning',\n           'TqdmMonitorWarning']\n\n\nclass TqdmTypeError(TypeError):\n    pass\n\n\nclass TqdmKeyError(KeyError):\n    pass\n\n\nclass TqdmWarning(Warning):\n    \"\"\"base class for all tqdm warnings.\n\n    Used for non-external-code-breaking errors, such as garbled printing.\n    \"\"\"\n    def __init__(self, msg, fp_write=None, *a, **k):\n        if fp_write is not None:\n            fp_write(\"\\n\" + self.__class__.__name__ + \": \" + str(msg).rstrip() + '\\n')\n        else:\n            super(TqdmWarning, self).__init__(msg, *a, **k)\n\n\nclass TqdmExperimentalWarning(TqdmWarning, FutureWarning):\n    \"\"\"beta feature, unstable API and behaviour\"\"\"\n    pass\n\n\nclass TqdmDeprecationWarning(TqdmWarning, DeprecationWarning):\n    # not suppressed if raised\n    pass\n\n\nclass TqdmMonitorWarning(TqdmWarning, RuntimeWarning):\n    \"\"\"tqdm monitor errors which do not affect external functionality\"\"\"\n    pass\n\n\ndef TRLock(*args, **kwargs):\n    \"\"\"threading RLock\"\"\"\n    try:\n        from threading import RLock\n        return RLock(*args, **kwargs)\n    except (ImportError, OSError):  # pragma: no cover\n        pass\n\n\nclass TqdmDefaultWriteLock(object):\n    \"\"\"\n    Provide a default write lock for thread and multiprocessing safety.\n    Works only on platforms supporting `fork` (so Windows is excluded).\n    You must initialise a `tqdm` or `TqdmDefaultWriteLock` instance\n    before forking in order for the write lock to work.\n    On Windows, you need to supply the lock from the parent to the children as\n    an argument to joblib or the parallelism lib you use.\n    \"\"\"\n    # global thread lock so no setup required for multithreading.\n    # NB: Do not create multiprocessing lock as it sets the multiprocessing\n    # context, disallowing `spawn()`/`forkserver()`\n    th_lock = TRLock()\n\n    def __init__(self):\n        # Create global parallelism locks to avoid racing issues with parallel\n        # bars works only if fork available (Linux/MacOSX, but not Windows)\n        cls = type(self)\n        root_lock = cls.th_lock\n        if root_lock is not None:\n            root_lock.acquire()\n        cls.create_mp_lock()\n        self.locks = [lk for lk in [cls.mp_lock, cls.th_lock] if lk is not None]\n        if root_lock is not None:\n            root_lock.release()\n\n    def acquire(self, *a, **k):\n        for lock in self.locks:\n            lock.acquire(*a, **k)\n\n    def release(self):\n        for lock in self.locks[::-1]:  # Release in inverse order of acquisition\n            lock.release()\n\n    def __enter__(self):\n        self.acquire()\n\n    def __exit__(self, *exc):\n        self.release()\n\n    @classmethod\n    def create_mp_lock(cls):\n        if not hasattr(cls, 'mp_lock'):\n            try:\n                from multiprocessing import RLock\n                cls.mp_lock = RLock()\n            except (ImportError, OSError):  # pragma: no cover\n                cls.mp_lock = None\n\n    @classmethod\n    def create_th_lock(cls):\n        assert hasattr(cls, 'th_lock')\n        warn(\"create_th_lock not needed anymore\", TqdmDeprecationWarning, stacklevel=2)\n\n\nclass Bar(object):\n    \"\"\"\n    `str.format`-able bar with format specifiers: `[width][type]`\n\n    - `width`\n      + unspecified (default): use `self.default_len`\n      + `int >= 0`: overrides `self.default_len`\n      + `int < 0`: subtract from `self.default_len`\n    - `type`\n      + `a`: ascii (`charset=self.ASCII` override)\n      + `u`: unicode (`charset=self.UTF` override)\n      + `b`: blank (`charset=\"  \"` override)\n    \"\"\"\n    ASCII = \" 123456789#\"\n    UTF = u\" \" + u''.join(map(_unich, range(0x258F, 0x2587, -1)))\n    BLANK = \"  \"\n    COLOUR_RESET = '\\x1b[0m'\n    COLOUR_RGB = '\\x1b[38;2;%d;%d;%dm'\n    COLOURS = {'BLACK': '\\x1b[30m', 'RED': '\\x1b[31m', 'GREEN': '\\x1b[32m',\n               'YELLOW': '\\x1b[33m', 'BLUE': '\\x1b[34m', 'MAGENTA': '\\x1b[35m',\n               'CYAN': '\\x1b[36m', 'WHITE': '\\x1b[37m'}\n\n    def __init__(self, frac, default_len=10, charset=UTF, colour=None):\n        if not 0 <= frac <= 1:\n            warn(\"clamping frac to range [0, 1]\", TqdmWarning, stacklevel=2)\n            frac = max(0, min(1, frac))\n        assert default_len > 0\n        self.frac = frac\n        self.default_len = default_len\n        self.charset = charset\n        self.colour = colour\n\n    @property\n    def colour(self):\n        return self._colour\n\n    @colour.setter\n    def colour(self, value):\n        if not value:\n            self._colour = None\n            return\n        try:\n            if value.upper() in self.COLOURS:\n                self._colour = self.COLOURS[value.upper()]\n            elif value[0] == '#' and len(value) == 7:\n                self._colour = self.COLOUR_RGB % tuple(\n                    int(i, 16) for i in (value[1:3], value[3:5], value[5:7]))\n            else:\n                raise KeyError\n        except (KeyError, AttributeError):\n            warn(\"Unknown colour (%s); valid choices: [hex (#00ff00), %s]\" % (\n                 value, \", \".join(self.COLOURS)),\n                 TqdmWarning, stacklevel=2)\n            self._colour = None\n\n    def __format__(self, format_spec):\n        if format_spec:\n            _type = format_spec[-1].lower()\n            try:\n                charset = {'a': self.ASCII, 'u': self.UTF, 'b': self.BLANK}[_type]\n            except KeyError:\n                charset = self.charset\n            else:\n                format_spec = format_spec[:-1]\n            if format_spec:\n                N_BARS = int(format_spec)\n                if N_BARS < 0:\n                    N_BARS += self.default_len\n            else:\n                N_BARS = self.default_len\n        else:\n            charset = self.charset\n            N_BARS = self.default_len\n\n        nsyms = len(charset) - 1\n        bar_length, frac_bar_length = divmod(int(self.frac * N_BARS * nsyms), nsyms)\n\n        res = charset[-1] * bar_length\n        if bar_length < N_BARS:  # whitespace padding\n            res = res + charset[frac_bar_length] + \\\n                charset[0] * (N_BARS - bar_length - 1)\n        return self.colour + res + self.COLOUR_RESET if self.colour else res\n\n\nclass EMA(object):\n    \"\"\"\n    Exponential moving average: smoothing to give progressively lower\n    weights to older values.\n\n    Parameters\n    ----------\n    smoothing  : float, optional\n        Smoothing factor in range [0, 1], [default: 0.3].\n        Increase to give more weight to recent values.\n        Ranges from 0 (yields old value) to 1 (yields new value).\n    \"\"\"\n    def __init__(self, smoothing=0.3):\n        self.alpha = smoothing\n        self.last = 0\n        self.calls = 0\n\n    def __call__(self, x=None):\n        \"\"\"\n        Parameters\n        ----------\n        x  : float\n            New value to include in EMA.\n        \"\"\"\n        beta = 1 - self.alpha\n        if x is not None:\n            self.last = self.alpha * x + beta * self.last\n            self.calls += 1\n        return self.last / (1 - beta ** self.calls) if self.calls else self.last\n\n\nclass tqdm(Comparable):\n    \"\"\"\n    Decorate an iterable object, returning an iterator which acts exactly\n    like the original iterable, but prints a dynamically updating\n    progressbar every time a value is requested.\n    \"\"\"\n\n    monitor_interval = 10  # set to 0 to disable the thread\n    monitor = None\n    _instances = WeakSet()\n\n    @staticmethod\n    def format_sizeof(num, suffix='', divisor=1000):\n        \"\"\"\n        Formats a number (greater than unity) with SI Order of Magnitude\n        prefixes.\n\n        Parameters\n        ----------\n        num  : float\n            Number ( >= 1) to format.\n        suffix  : str, optional\n            Post-postfix [default: ''].\n        divisor  : float, optional\n            Divisor between prefixes [default: 1000].\n\n        Returns\n        -------\n        out  : str\n            Number with Order of Magnitude SI unit postfix.\n        \"\"\"\n        for unit in ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z']:\n            if abs(num) < 999.5:\n                if abs(num) < 99.95:\n                    if abs(num) < 9.995:\n                        return '{0:1.2f}'.format(num) + unit + suffix\n                    return '{0:2.1f}'.format(num) + unit + suffix\n                return '{0:3.0f}'.format(num) + unit + suffix\n            num /= divisor\n        return '{0:3.1f}Y'.format(num) + suffix\n\n    @staticmethod\n    def format_interval(t):\n        \"\"\"\n        Formats a number of seconds as a clock time, [H:]MM:SS\n\n        Parameters\n        ----------\n        t  : int\n            Number of seconds.\n\n        Returns\n        -------\n        out  : str\n            [H:]MM:SS\n        \"\"\"\n        mins, s = divmod(int(t), 60)\n        h, m = divmod(mins, 60)\n        if h:\n            return '{0:d}:{1:02d}:{2:02d}'.format(h, m, s)\n        else:\n            return '{0:02d}:{1:02d}'.format(m, s)\n\n    @staticmethod\n    def format_num(n):\n        \"\"\"\n        Intelligent scientific notation (.3g).\n\n        Parameters\n        ----------\n        n  : int or float or Numeric\n            A Number.\n\n        Returns\n        -------\n        out  : str\n            Formatted number.\n        \"\"\"\n        f = '{0:.3g}'.format(n).replace('+0', '+').replace('-0', '-')\n        n = str(n)\n        return f if len(f) < len(n) else n\n\n    @staticmethod\n    def status_printer(file):\n        \"\"\"\n        Manage the printing and in-place updating of a line of characters.\n        Note that if the string is longer than a line, then in-place\n        updating may not work (it will print a new line at each refresh).\n        \"\"\"\n        fp = file\n        fp_flush = getattr(fp, 'flush', lambda: None)  # pragma: no cover\n\n        def fp_write(s):\n            fp.write(_unicode(s))\n            fp_flush()\n\n        last_len = [0]\n\n        def print_status(s):\n            len_s = disp_len(s)\n            fp_write('\\r' + s + (' ' * max(last_len[0] - len_s, 0)))\n            last_len[0] = len_s\n\n        return print_status\n\n    @staticmethod\n    def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False, unit='it',\n                     unit_scale=False, rate=None, bar_format=None, postfix=None,\n                     unit_divisor=1000, initial=0, colour=None, **extra_kwargs):\n        \"\"\"\n        Return a string-based progress bar given some parameters\n\n        Parameters\n        ----------\n        n  : int or float\n            Number of finished iterations.\n        total  : int or float\n            The expected total number of iterations. If meaningless (None),\n            only basic progress statistics are displayed (no ETA).\n        elapsed  : float\n            Number of seconds passed since start.\n        ncols  : int, optional\n            The width of the entire output message. If specified,\n            dynamically resizes `{bar}` to stay within this bound\n            [default: None]. If `0`, will not print any bar (only stats).\n            The fallback is `{bar:10}`.\n        prefix  : str, optional\n            Prefix message (included in total width) [default: ''].\n            Use as {desc} in bar_format string.\n        ascii  : bool, optional or str, optional\n            If not set, use unicode (smooth blocks) to fill the meter\n            [default: False]. The fallback is to use ASCII characters\n            \" 123456789#\".\n        unit  : str, optional\n            The iteration unit [default: 'it'].\n        unit_scale  : bool or int or float, optional\n            If 1 or True, the number of iterations will be printed with an\n            appropriate SI metric prefix (k = 10^3, M = 10^6, etc.)\n            [default: False]. If any other non-zero number, will scale\n            `total` and `n`.\n        rate  : float, optional\n            Manual override for iteration rate.\n            If [default: None], uses n/elapsed.\n        bar_format  : str, optional\n            Specify a custom bar string formatting. May impact performance.\n            [default: '{l_bar}{bar}{r_bar}'], where\n            l_bar='{desc}: {percentage:3.0f}%|' and\n            r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '\n              '{rate_fmt}{postfix}]'\n            Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt,\n              percentage, elapsed, elapsed_s, ncols, nrows, desc, unit,\n              rate, rate_fmt, rate_noinv, rate_noinv_fmt,\n              rate_inv, rate_inv_fmt, postfix, unit_divisor,\n              remaining, remaining_s, eta.\n            Note that a trailing \": \" is automatically removed after {desc}\n            if the latter is empty.\n        postfix  : *, optional\n            Similar to `prefix`, but placed at the end\n            (e.g. for additional stats).\n            Note: postfix is usually a string (not a dict) for this method,\n            and will if possible be set to postfix = ', ' + postfix.\n            However other types are supported (#382).\n        unit_divisor  : float, optional\n            [default: 1000], ignored unless `unit_scale` is True.\n        initial  : int or float, optional\n            The initial counter value [default: 0].\n        colour  : str, optional\n            Bar colour (e.g. 'green', '#00ff00').\n\n        Returns\n        -------\n        out  : Formatted meter and stats, ready to display.\n        \"\"\"\n\n        # sanity check: total\n        if total and n >= (total + 0.5):  # allow float imprecision (#849)\n            total = None\n\n        # apply custom scale if necessary\n        if unit_scale and unit_scale not in (True, 1):\n            if total:\n                total *= unit_scale\n            n *= unit_scale\n            if rate:\n                rate *= unit_scale  # by default rate = self.avg_dn / self.avg_dt\n            unit_scale = False\n\n        elapsed_str = tqdm.format_interval(elapsed)\n\n        # if unspecified, attempt to use rate = average speed\n        # (we allow manual override since predicting time is an arcane art)\n        if rate is None and elapsed:\n            rate = (n - initial) / elapsed\n        inv_rate = 1 / rate if rate else None\n        format_sizeof = tqdm.format_sizeof\n        rate_noinv_fmt = ((format_sizeof(rate) if unit_scale else\n                           '{0:5.2f}'.format(rate)) if rate else '?') + unit + '/s'\n        rate_inv_fmt = (\n            (format_sizeof(inv_rate) if unit_scale else '{0:5.2f}'.format(inv_rate))\n            if inv_rate else '?') + 's/' + unit\n        rate_fmt = rate_inv_fmt if inv_rate and inv_rate > 1 else rate_noinv_fmt\n\n        if unit_scale:\n            n_fmt = format_sizeof(n, divisor=unit_divisor)\n            total_fmt = format_sizeof(total, divisor=unit_divisor) \\\n                if total is not None else '?'\n        else:\n            n_fmt = str(n)\n            total_fmt = str(total) if total is not None else '?'\n\n        try:\n            postfix = ', ' + postfix if postfix else ''\n        except TypeError:\n            pass\n\n        remaining = (total - n) / rate if rate and total else 0\n        remaining_str = tqdm.format_interval(remaining) if rate else '?'\n        try:\n            eta_dt = datetime.now() + timedelta(seconds=remaining) \\\n                if rate and total else datetime.utcfromtimestamp(0)\n        except OverflowError:\n            eta_dt = datetime.max\n\n        # format the stats displayed to the left and right sides of the bar\n        if prefix:\n            # old prefix setup work around\n            bool_prefix_colon_already = (prefix[-2:] == \": \")\n            l_bar = prefix if bool_prefix_colon_already else prefix + \": \"\n        else:\n            l_bar = ''\n\n        r_bar = '| {0}/{1} [{2}<{3}, {4}{5}]'.format(\n            n_fmt, total_fmt, elapsed_str, remaining_str, rate_fmt, postfix)\n\n        # Custom bar formatting\n        # Populate a dict with all available progress indicators\n        format_dict = dict(\n            # slight extension of self.format_dict\n            n=n, n_fmt=n_fmt, total=total, total_fmt=total_fmt,\n            elapsed=elapsed_str, elapsed_s=elapsed,\n            ncols=ncols, desc=prefix or '', unit=unit,\n            rate=inv_rate if inv_rate and inv_rate > 1 else rate,\n            rate_fmt=rate_fmt, rate_noinv=rate,\n            rate_noinv_fmt=rate_noinv_fmt, rate_inv=inv_rate,\n            rate_inv_fmt=rate_inv_fmt,\n            postfix=postfix, unit_divisor=unit_divisor,\n            colour=colour,\n            # plus more useful definitions\n            remaining=remaining_str, remaining_s=remaining,\n            l_bar=l_bar, r_bar=r_bar, eta=eta_dt,\n            **extra_kwargs)\n\n        # total is known: we can predict some stats\n        if total:\n            # fractional and percentage progress\n            frac = n / total\n            percentage = frac * 100\n\n            l_bar += '{0:3.0f}%|'.format(percentage)\n\n            if ncols == 0:\n                return l_bar[:-1] + r_bar[1:]\n\n            format_dict.update(l_bar=l_bar)\n            if bar_format:\n                format_dict.update(percentage=percentage)\n\n                # auto-remove colon for empty `desc`\n                if not prefix:\n                    bar_format = bar_format.replace(\"{desc}: \", '')\n            else:\n                bar_format = \"{l_bar}{bar}{r_bar}\"\n\n            full_bar = FormatReplace()\n            try:\n                nobar = bar_format.format(bar=full_bar, **format_dict)\n            except UnicodeEncodeError:\n                bar_format = _unicode(bar_format)\n                nobar = bar_format.format(bar=full_bar, **format_dict)\n            if not full_bar.format_called:\n                # no {bar}, we can just format and return\n                return nobar\n\n            # Formatting progress bar space available for bar's display\n            full_bar = Bar(frac,\n                           max(1, ncols - disp_len(nobar)) if ncols else 10,\n                           charset=Bar.ASCII if ascii is True else ascii or Bar.UTF,\n                           colour=colour)\n            if not _is_ascii(full_bar.charset) and _is_ascii(bar_format):\n                bar_format = _unicode(bar_format)\n            res = bar_format.format(bar=full_bar, **format_dict)\n            return disp_trim(res, ncols) if ncols else res\n\n        elif bar_format:\n            # user-specified bar_format but no total\n            l_bar += '|'\n            format_dict.update(l_bar=l_bar, percentage=0)\n            full_bar = FormatReplace()\n            nobar = bar_format.format(bar=full_bar, **format_dict)\n            if not full_bar.format_called:\n                return nobar\n            full_bar = Bar(0,\n                           max(1, ncols - disp_len(nobar)) if ncols else 10,\n                           charset=Bar.BLANK, colour=colour)\n            res = bar_format.format(bar=full_bar, **format_dict)\n            return disp_trim(res, ncols) if ncols else res\n        else:\n            # no total: no progressbar, ETA, just progress stats\n            return ((prefix + \": \") if prefix else '') + \\\n                '{0}{1} [{2}, {3}{4}]'.format(\n                    n_fmt, unit, elapsed_str, rate_fmt, postfix)\n\n    def __new__(cls, *_, **__):\n        instance = object.__new__(cls)\n        with cls.get_lock():  # also constructs lock if non-existent\n            cls._instances.add(instance)\n            # create monitoring thread\n            if cls.monitor_interval and (cls.monitor is None\n                                         or not cls.monitor.report()):\n                try:\n                    cls.monitor = TMonitor(cls, cls.monitor_interval)\n                except Exception as e:  # pragma: nocover\n                    warn(\"tqdm:disabling monitor support\"\n                         \" (monitor_interval = 0) due to:\\n\" + str(e),\n                         TqdmMonitorWarning, stacklevel=2)\n                    cls.monitor_interval = 0\n        return instance\n\n    @classmethod\n    def _get_free_pos(cls, instance=None):\n        \"\"\"Skips specified instance.\"\"\"\n        positions = {abs(inst.pos) for inst in cls._instances\n                     if inst is not instance and hasattr(inst, \"pos\")}\n        return min(set(range(len(positions) + 1)).difference(positions))\n\n    @classmethod\n    def _decr_instances(cls, instance):\n        \"\"\"\n        Remove from list and reposition another unfixed bar\n        to fill the new gap.\n\n        This means that by default (where all nested bars are unfixed),\n        order is not maintained but screen flicker/blank space is minimised.\n        (tqdm<=4.44.1 moved ALL subsequent unfixed bars up.)\n        \"\"\"\n        with cls._lock:\n            try:\n                cls._instances.remove(instance)\n            except KeyError:\n                # if not instance.gui:  # pragma: no cover\n                #     raise\n                pass  # py2: maybe magically removed already\n            # else:\n            if not instance.gui:\n                last = (instance.nrows or 20) - 1\n                # find unfixed (`pos >= 0`) overflow (`pos >= nrows - 1`)\n                instances = list(filter(\n                    lambda i: hasattr(i, \"pos\") and last <= i.pos,\n                    cls._instances))\n                # set first found to current `pos`\n                if instances:\n                    inst = min(instances, key=lambda i: i.pos)\n                    inst.clear(nolock=True)\n                    inst.pos = abs(instance.pos)\n\n    @classmethod\n    def write(cls, s, file=None, end=\"\\n\", nolock=False):\n        \"\"\"Print a message via tqdm (without overlap with bars).\"\"\"\n        fp = file if file is not None else sys.stdout\n        with cls.external_write_mode(file=file, nolock=nolock):\n            # Write the message\n            fp.write(s)\n            fp.write(end)\n\n    @classmethod\n    @contextmanager\n    def external_write_mode(cls, file=None, nolock=False):\n        \"\"\"\n        Disable tqdm within context and refresh tqdm when exits.\n        Useful when writing to standard output stream\n        \"\"\"\n        fp = file if file is not None else sys.stdout\n\n        try:\n            if not nolock:\n                cls.get_lock().acquire()\n            # Clear all bars\n            inst_cleared = []\n            for inst in getattr(cls, '_instances', []):\n                # Clear instance if in the target output file\n                # or if write output + tqdm output are both either\n                # sys.stdout or sys.stderr (because both are mixed in terminal)\n                if hasattr(inst, \"start_t\") and (inst.fp == fp or all(\n                        f in (sys.stdout, sys.stderr) for f in (fp, inst.fp))):\n                    inst.clear(nolock=True)\n                    inst_cleared.append(inst)\n            yield\n            # Force refresh display of bars we cleared\n            for inst in inst_cleared:\n                inst.refresh(nolock=True)\n        finally:\n            if not nolock:\n                cls._lock.release()\n\n    @classmethod\n    def set_lock(cls, lock):\n        \"\"\"Set the global lock.\"\"\"\n        cls._lock = lock\n\n    @classmethod\n    def get_lock(cls):\n        \"\"\"Get the global lock. Construct it if it does not exist.\"\"\"\n        if not hasattr(cls, '_lock'):\n            cls._lock = TqdmDefaultWriteLock()\n        return cls._lock\n\n    @classmethod\n    def pandas(cls, **tqdm_kwargs):\n        \"\"\"\n        Registers the current `tqdm` class with\n            pandas.core.\n            ( frame.DataFrame\n            | series.Series\n            | groupby.(generic.)DataFrameGroupBy\n            | groupby.(generic.)SeriesGroupBy\n            ).progress_apply\n\n        A new instance will be create every time `progress_apply` is called,\n        and each instance will automatically `close()` upon completion.\n\n        Parameters\n        ----------\n        tqdm_kwargs  : arguments for the tqdm instance\n\n        Examples\n        --------\n        >>> import pandas as pd\n        >>> import numpy as np\n        >>> from tqdm import tqdm\n        >>> from tqdm.gui import tqdm as tqdm_gui\n        >>>\n        >>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))\n        >>> tqdm.pandas(ncols=50)  # can use tqdm_gui, optional kwargs, etc\n        >>> # Now you can use `progress_apply` instead of `apply`\n        >>> df.groupby(0).progress_apply(lambda x: x**2)\n\n        References\n        ----------\n        <https://stackoverflow.com/questions/18603270/\\\n        progress-indicator-during-pandas-operations-python>\n        \"\"\"\n        from warnings import catch_warnings, simplefilter\n\n        from pandas.core.frame import DataFrame\n        from pandas.core.series import Series\n        try:\n            with catch_warnings():\n                simplefilter(\"ignore\", category=FutureWarning)\n                from pandas import Panel\n        except ImportError:  # pandas>=1.2.0\n            Panel = None\n        Rolling, Expanding = None, None\n        try:  # pandas>=1.0.0\n            from pandas.core.window.rolling import _Rolling_and_Expanding\n        except ImportError:\n            try:  # pandas>=0.18.0\n                from pandas.core.window import _Rolling_and_Expanding\n            except ImportError:  # pandas>=1.2.0\n                try:  # pandas>=1.2.0\n                    from pandas.core.window.expanding import Expanding\n                    from pandas.core.window.rolling import Rolling\n                    _Rolling_and_Expanding = Rolling, Expanding\n                except ImportError:  # pragma: no cover\n                    _Rolling_and_Expanding = None\n        try:  # pandas>=0.25.0\n            from pandas.core.groupby.generic import SeriesGroupBy  # , NDFrameGroupBy\n            from pandas.core.groupby.generic import DataFrameGroupBy\n        except ImportError:  # pragma: no cover\n            try:  # pandas>=0.23.0\n                from pandas.core.groupby.groupby import DataFrameGroupBy, SeriesGroupBy\n            except ImportError:\n                from pandas.core.groupby import DataFrameGroupBy, SeriesGroupBy\n        try:  # pandas>=0.23.0\n            from pandas.core.groupby.groupby import GroupBy\n        except ImportError:  # pragma: no cover\n            from pandas.core.groupby import GroupBy\n\n        try:  # pandas>=0.23.0\n            from pandas.core.groupby.groupby import PanelGroupBy\n        except ImportError:\n            try:\n                from pandas.core.groupby import PanelGroupBy\n            except ImportError:  # pandas>=0.25.0\n                PanelGroupBy = None\n\n        tqdm_kwargs = tqdm_kwargs.copy()\n        deprecated_t = [tqdm_kwargs.pop('deprecated_t', None)]\n\n        def inner_generator(df_function='apply'):\n            def inner(df, func, *args, **kwargs):\n                \"\"\"\n                Parameters\n                ----------\n                df  : (DataFrame|Series)[GroupBy]\n                    Data (may be grouped).\n                func  : function\n                    To be applied on the (grouped) data.\n                **kwargs  : optional\n                    Transmitted to `df.apply()`.\n                \"\"\"\n\n                # Precompute total iterations\n                total = tqdm_kwargs.pop(\"total\", getattr(df, 'ngroups', None))\n                if total is None:  # not grouped\n                    if df_function == 'applymap':\n                        total = df.size\n                    elif isinstance(df, Series):\n                        total = len(df)\n                    elif _Rolling_and_Expanding is None or \\\n                            not isinstance(df, _Rolling_and_Expanding):\n                        # DataFrame or Panel\n                        axis = kwargs.get('axis', 0)\n                        if axis == 'index':\n                            axis = 0\n                        elif axis == 'columns':\n                            axis = 1\n                        # when axis=0, total is shape[axis1]\n                        total = df.size // df.shape[axis]\n\n                # Init bar\n                if deprecated_t[0] is not None:\n                    t = deprecated_t[0]\n                    deprecated_t[0] = None\n                else:\n                    t = cls(total=total, **tqdm_kwargs)\n\n                if len(args) > 0:\n                    # *args intentionally not supported (see #244, #299)\n                    TqdmDeprecationWarning(\n                        \"Except func, normal arguments are intentionally\" +\n                        \" not supported by\" +\n                        \" `(DataFrame|Series|GroupBy).progress_apply`.\" +\n                        \" Use keyword arguments instead.\",\n                        fp_write=getattr(t.fp, 'write', sys.stderr.write))\n\n                try:\n                    func = df._is_builtin_func(func)\n                except TypeError:\n                    pass\n\n                # Define bar updating wrapper\n                def wrapper(*args, **kwargs):\n                    # update tbar correctly\n                    # it seems `pandas apply` calls `func` twice\n                    # on the first column/row to decide whether it can\n                    # take a fast or slow code path; so stop when t.total==t.n\n                    t.update(n=1 if not t.total or t.n < t.total else 0)\n                    return func(*args, **kwargs)\n\n                # Apply the provided function (in **kwargs)\n                # on the df using our wrapper (which provides bar updating)\n                try:\n                    return getattr(df, df_function)(wrapper, **kwargs)\n                finally:\n                    t.close()\n\n            return inner\n\n        # Monkeypatch pandas to provide easy methods\n        # Enable custom tqdm progress in pandas!\n        Series.progress_apply = inner_generator()\n        SeriesGroupBy.progress_apply = inner_generator()\n        Series.progress_map = inner_generator('map')\n        SeriesGroupBy.progress_map = inner_generator('map')\n\n        DataFrame.progress_apply = inner_generator()\n        DataFrameGroupBy.progress_apply = inner_generator()\n        DataFrame.progress_applymap = inner_generator('applymap')\n\n        if Panel is not None:\n            Panel.progress_apply = inner_generator()\n        if PanelGroupBy is not None:\n            PanelGroupBy.progress_apply = inner_generator()\n\n        GroupBy.progress_apply = inner_generator()\n        GroupBy.progress_aggregate = inner_generator('aggregate')\n        GroupBy.progress_transform = inner_generator('transform')\n\n        if Rolling is not None and Expanding is not None:\n            Rolling.progress_apply = inner_generator()\n            Expanding.progress_apply = inner_generator()\n        elif _Rolling_and_Expanding is not None:\n            _Rolling_and_Expanding.progress_apply = inner_generator()\n\n    def __init__(self, iterable=None, desc=None, total=None, leave=True, file=None,\n                 ncols=None, mininterval=0.1, maxinterval=10.0, miniters=None,\n                 ascii=None, disable=False, unit='it', unit_scale=False,\n                 dynamic_ncols=False, smoothing=0.3, bar_format=None, initial=0,\n                 position=None, postfix=None, unit_divisor=1000, write_bytes=None,\n                 lock_args=None, nrows=None, colour=None, delay=0, gui=False,\n                 **kwargs):\n        \"\"\"\n        Parameters\n        ----------\n        iterable  : iterable, optional\n            Iterable to decorate with a progressbar.\n            Leave blank to manually manage the updates.\n        desc  : str, optional\n            Prefix for the progressbar.\n        total  : int or float, optional\n            The number of expected iterations. If unspecified,\n            len(iterable) is used if possible. If float(\"inf\") or as a last\n            resort, only basic progress statistics are displayed\n            (no ETA, no progressbar).\n            If `gui` is True and this parameter needs subsequent updating,\n            specify an initial arbitrary large positive number,\n            e.g. 9e9.\n        leave  : bool, optional\n            If [default: True], keeps all traces of the progressbar\n            upon termination of iteration.\n            If `None`, will leave only if `position` is `0`.\n        file  : `io.TextIOWrapper` or `io.StringIO`, optional\n            Specifies where to output the progress messages\n            (default: sys.stderr). Uses `file.write(str)` and `file.flush()`\n            methods.  For encoding, see `write_bytes`.\n        ncols  : int, optional\n            The width of the entire output message. If specified,\n            dynamically resizes the progressbar to stay within this bound.\n            If unspecified, attempts to use environment width. The\n            fallback is a meter width of 10 and no limit for the counter and\n            statistics. If 0, will not print any meter (only stats).\n        mininterval  : float, optional\n            Minimum progress display update interval [default: 0.1] seconds.\n        maxinterval  : float, optional\n            Maximum progress display update interval [default: 10] seconds.\n            Automatically adjusts `miniters` to correspond to `mininterval`\n            after long display update lag. Only works if `dynamic_miniters`\n            or monitor thread is enabled.\n        miniters  : int or float, optional\n            Minimum progress display update interval, in iterations.\n            If 0 and `dynamic_miniters`, will automatically adjust to equal\n            `mininterval` (more CPU efficient, good for tight loops).\n            If > 0, will skip display of specified number of iterations.\n            Tweak this and `mininterval` to get very efficient loops.\n            If your progress is erratic with both fast and slow iterations\n            (network, skipping items, etc) you should set miniters=1.\n        ascii  : bool or str, optional\n            If unspecified or False, use unicode (smooth blocks) to fill\n            the meter. The fallback is to use ASCII characters \" 123456789#\".\n        disable  : bool, optional\n            Whether to disable the entire progressbar wrapper\n            [default: False]. If set to None, disable on non-TTY.\n        unit  : str, optional\n            String that will be used to define the unit of each iteration\n            [default: it].\n        unit_scale  : bool or int or float, optional\n            If 1 or True, the number of iterations will be reduced/scaled\n            automatically and a metric prefix following the\n            International System of Units standard will be added\n            (kilo, mega, etc.) [default: False]. If any other non-zero\n            number, will scale `total` and `n`.\n        dynamic_ncols  : bool, optional\n            If set, constantly alters `ncols` and `nrows` to the\n            environment (allowing for window resizes) [default: False].\n        smoothing  : float, optional\n            Exponential moving average smoothing factor for speed estimates\n            (ignored in GUI mode). Ranges from 0 (average speed) to 1\n            (current/instantaneous speed) [default: 0.3].\n        bar_format  : str, optional\n            Specify a custom bar string formatting. May impact performance.\n            [default: '{l_bar}{bar}{r_bar}'], where\n            l_bar='{desc}: {percentage:3.0f}%|' and\n            r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '\n              '{rate_fmt}{postfix}]'\n            Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt,\n              percentage, elapsed, elapsed_s, ncols, nrows, desc, unit,\n              rate, rate_fmt, rate_noinv, rate_noinv_fmt,\n              rate_inv, rate_inv_fmt, postfix, unit_divisor,\n              remaining, remaining_s, eta.\n            Note that a trailing \": \" is automatically removed after {desc}\n            if the latter is empty.\n        initial  : int or float, optional\n            The initial counter value. Useful when restarting a progress\n            bar [default: 0]. If using float, consider specifying `{n:.3f}`\n            or similar in `bar_format`, or specifying `unit_scale`.\n        position  : int, optional\n            Specify the line offset to print this bar (starting from 0)\n            Automatic if unspecified.\n            Useful to manage multiple bars at once (eg, from threads).\n        postfix  : dict or *, optional\n            Specify additional stats to display at the end of the bar.\n            Calls `set_postfix(**postfix)` if possible (dict).\n        unit_divisor  : float, optional\n            [default: 1000], ignored unless `unit_scale` is True.\n        write_bytes  : bool, optional\n            If (default: None) and `file` is unspecified,\n            bytes will be written in Python 2. If `True` will also write\n            bytes. In all other cases will default to unicode.\n        lock_args  : tuple, optional\n            Passed to `refresh` for intermediate output\n            (initialisation, iterating, and updating).\n        nrows  : int, optional\n            The screen height. If specified, hides nested bars outside this\n            bound. If unspecified, attempts to use environment height.\n            The fallback is 20.\n        colour  : str, optional\n            Bar colour (e.g. 'green', '#00ff00').\n        delay  : float, optional\n            Don't display until [default: 0] seconds have elapsed.\n        gui  : bool, optional\n            WARNING: internal parameter - do not use.\n            Use tqdm.gui.tqdm(...) instead. If set, will attempt to use\n            matplotlib animations for a graphical output [default: False].\n\n        Returns\n        -------\n        out  : decorated iterator.\n        \"\"\"\n        if write_bytes is None:\n            write_bytes = file is None and sys.version_info < (3,)\n\n        if file is None:\n            file = sys.stderr\n\n        if write_bytes:\n            # Despite coercing unicode into bytes, py2 sys.std* streams\n            # should have bytes written to them.\n            file = SimpleTextIOWrapper(\n                file, encoding=getattr(file, 'encoding', None) or 'utf-8')\n\n        file = DisableOnWriteError(file, tqdm_instance=self)\n\n        if disable is None and hasattr(file, \"isatty\") and not file.isatty():\n            disable = True\n\n        if total is None and iterable is not None:\n            try:\n                total = len(iterable)\n            except (TypeError, AttributeError):\n                total = None\n        if total == float(\"inf\"):\n            # Infinite iterations, behave same as unknown\n            total = None\n\n        if disable:\n            self.iterable = iterable\n            self.disable = disable\n            with self._lock:\n                self.pos = self._get_free_pos(self)\n                self._instances.remove(self)\n            self.n = initial\n            self.total = total\n            self.leave = leave\n            return\n\n        if kwargs:\n            self.disable = True\n            with self._lock:\n                self.pos = self._get_free_pos(self)\n                self._instances.remove(self)\n            raise (\n                TqdmDeprecationWarning(\n                    \"`nested` is deprecated and automated.\\n\"\n                    \"Use `position` instead for manual control.\\n\",\n                    fp_write=getattr(file, 'write', sys.stderr.write))\n                if \"nested\" in kwargs else\n                TqdmKeyError(\"Unknown argument(s): \" + str(kwargs)))\n\n        # Preprocess the arguments\n        if ((ncols is None or nrows is None) and\n            (file in (sys.stderr, sys.stdout))) or \\\n                dynamic_ncols:  # pragma: no cover\n            if dynamic_ncols:\n                dynamic_ncols = _screen_shape_wrapper()\n                if dynamic_ncols:\n                    ncols, nrows = dynamic_ncols(file)\n            else:\n                _dynamic_ncols = _screen_shape_wrapper()\n                if _dynamic_ncols:\n                    _ncols, _nrows = _dynamic_ncols(file)\n                    if ncols is None:\n                        ncols = _ncols\n                    if nrows is None:\n                        nrows = _nrows\n\n        if miniters is None:\n            miniters = 0\n            dynamic_miniters = True\n        else:\n            dynamic_miniters = False\n\n        if mininterval is None:\n            mininterval = 0\n\n        if maxinterval is None:\n            maxinterval = 0\n\n        if ascii is None:\n            ascii = not _supports_unicode(file)\n\n        if bar_format and not ((ascii is True) or _is_ascii(ascii)):\n            # Convert bar format into unicode since terminal uses unicode\n            bar_format = _unicode(bar_format)\n\n        if smoothing is None:\n            smoothing = 0\n\n        # Store the arguments\n        self.iterable = iterable\n        self.desc = desc or ''\n        self.total = total\n        self.leave = leave\n        self.fp = file\n        self.ncols = ncols\n        self.nrows = nrows\n        self.mininterval = mininterval\n        self.maxinterval = maxinterval\n        self.miniters = miniters\n        self.dynamic_miniters = dynamic_miniters\n        self.ascii = ascii\n        self.disable = disable\n        self.unit = unit\n        self.unit_scale = unit_scale\n        self.unit_divisor = unit_divisor\n        self.initial = initial\n        self.lock_args = lock_args\n        self.delay = delay\n        self.gui = gui\n        self.dynamic_ncols = dynamic_ncols\n        self.smoothing = smoothing\n        self._ema_dn = EMA(smoothing)\n        self._ema_dt = EMA(smoothing)\n        self._ema_miniters = EMA(smoothing)\n        self.bar_format = bar_format\n        self.postfix = None\n        self.colour = colour\n        self._time = time\n        if postfix:\n            try:\n                self.set_postfix(refresh=False, **postfix)\n            except TypeError:\n                self.postfix = postfix\n\n        # Init the iterations counters\n        self.last_print_n = initial\n        self.n = initial\n\n        # if nested, at initial sp() call we replace '\\r' by '\\n' to\n        # not overwrite the outer progress bar\n        with self._lock:\n            if position is None:\n                self.pos = self._get_free_pos(self)\n            else:  # mark fixed positions as negative\n                self.pos = -position\n\n        if not gui:\n            # Initialize the screen printer\n            self.sp = self.status_printer(self.fp)\n            if delay <= 0:\n                self.refresh(lock_args=self.lock_args)\n\n        # Init the time counter\n        self.last_print_t = self._time()\n        # NB: Avoid race conditions by setting start_t at the very end of init\n        self.start_t = self.last_print_t\n\n    def __bool__(self):\n        if self.total is not None:\n            return self.total > 0\n        if self.iterable is None:\n            raise TypeError('bool() undefined when iterable == total == None')\n        return bool(self.iterable)\n\n    def __nonzero__(self):\n        return self.__bool__()\n\n    def __len__(self):\n        return self.total if self.iterable is None else \\\n            (self.iterable.shape[0] if hasattr(self.iterable, \"shape\")\n             else len(self.iterable) if hasattr(self.iterable, \"__len__\")\n             else self.iterable.__length_hint__()\n             if hasattr(self.iterable, \"__length_hint__\")\n             else getattr(self, \"total\", None))\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        try:\n            self.close()\n        except AttributeError:\n            # maybe eager thread cleanup upon external error\n            if (exc_type, exc_value, traceback) == (None, None, None):\n                raise\n            warn(\"AttributeError ignored\", TqdmWarning, stacklevel=2)\n\n    def __del__(self):\n        self.close()\n\n    def __str__(self):\n        return self.format_meter(**self.format_dict)\n\n    @property\n    def _comparable(self):\n        return abs(getattr(self, \"pos\", 1 << 31))\n\n    def __hash__(self):\n        return id(self)\n\n    def __iter__(self):\n        \"\"\"Backward-compatibility to use: for x in tqdm(iterable)\"\"\"\n\n        # Inlining instance variables as locals (speed optimisation)\n        iterable = self.iterable\n\n        # If the bar is disabled, then just walk the iterable\n        # (note: keep this check outside the loop for performance)\n        if self.disable:\n            for obj in iterable:\n                yield obj\n            return\n\n        mininterval = self.mininterval\n        last_print_t = self.last_print_t\n        last_print_n = self.last_print_n\n        min_start_t = self.start_t + self.delay\n        n = self.n\n        time = self._time\n\n        try:\n            for obj in iterable:\n                yield obj\n                # Update and possibly print the progressbar.\n                # Note: does not call self.update(1) for speed optimisation.\n                n += 1\n\n                if n - last_print_n >= self.miniters:\n                    cur_t = time()\n                    dt = cur_t - last_print_t\n                    if dt >= mininterval and cur_t >= min_start_t:\n                        self.update(n - last_print_n)\n                        last_print_n = self.last_print_n\n                        last_print_t = self.last_print_t\n        finally:\n            self.n = n\n            self.close()\n\n    def update(self, n=1):\n        \"\"\"\n        Manually update the progress bar, useful for streams\n        such as reading files.\n        E.g.:\n        >>> t = tqdm(total=filesize) # Initialise\n        >>> for current_buffer in stream:\n        ...    ...\n        ...    t.update(len(current_buffer))\n        >>> t.close()\n        The last line is highly recommended, but possibly not necessary if\n        `t.update()` will be called in such a way that `filesize` will be\n        exactly reached and printed.\n\n        Parameters\n        ----------\n        n  : int or float, optional\n            Increment to add to the internal counter of iterations\n            [default: 1]. If using float, consider specifying `{n:.3f}`\n            or similar in `bar_format`, or specifying `unit_scale`.\n\n        Returns\n        -------\n        out  : bool or None\n            True if a `display()` was triggered.\n        \"\"\"\n        if self.disable:\n            return\n\n        if n < 0:\n            self.last_print_n += n  # for auto-refresh logic to work\n        self.n += n\n\n        # check counter first to reduce calls to time()\n        if self.n - self.last_print_n >= self.miniters:\n            cur_t = self._time()\n            dt = cur_t - self.last_print_t\n            if dt >= self.mininterval and cur_t >= self.start_t + self.delay:\n                cur_t = self._time()\n                dn = self.n - self.last_print_n  # >= n\n                if self.smoothing and dt and dn:\n                    # EMA (not just overall average)\n                    self._ema_dn(dn)\n                    self._ema_dt(dt)\n                self.refresh(lock_args=self.lock_args)\n                if self.dynamic_miniters:\n                    # If no `miniters` was specified, adjust automatically to the\n                    # maximum iteration rate seen so far between two prints.\n                    # e.g.: After running `tqdm.update(5)`, subsequent\n                    # calls to `tqdm.update()` will only cause an update after\n                    # at least 5 more iterations.\n                    if self.maxinterval and dt >= self.maxinterval:\n                        self.miniters = dn * (self.mininterval or self.maxinterval) / dt\n                    elif self.smoothing:\n                        # EMA miniters update\n                        self.miniters = self._ema_miniters(\n                            dn * (self.mininterval / dt if self.mininterval and dt\n                                  else 1))\n                    else:\n                        # max iters between two prints\n                        self.miniters = max(self.miniters, dn)\n\n                # Store old values for next call\n                self.last_print_n = self.n\n                self.last_print_t = cur_t\n                return True\n\n    def close(self):\n        \"\"\"Cleanup and (if leave=False) close the progressbar.\"\"\"\n        if self.disable:\n            return\n\n        # Prevent multiple closures\n        self.disable = True\n\n        # decrement instance pos and remove from internal set\n        pos = abs(self.pos)\n        self._decr_instances(self)\n\n        if self.last_print_t < self.start_t + self.delay:\n            # haven't ever displayed; nothing to clear\n            return\n\n        # GUI mode\n        if getattr(self, 'sp', None) is None:\n            return\n\n        # annoyingly, _supports_unicode isn't good enough\n        def fp_write(s):\n            self.fp.write(_unicode(s))\n\n        try:\n            fp_write('')\n        except ValueError as e:\n            if 'closed' in str(e):\n                return\n            raise  # pragma: no cover\n\n        leave = pos == 0 if self.leave is None else self.leave\n\n        with self._lock:\n            if leave:\n                # stats for overall rate (no weighted average)\n                self._ema_dt = lambda: None\n                self.display(pos=0)\n                fp_write('\\n')\n            else:\n                # clear previous display\n                if self.display(msg='', pos=pos) and not pos:\n                    fp_write('\\r')\n\n    def clear(self, nolock=False):\n        \"\"\"Clear current bar display.\"\"\"\n        if self.disable:\n            return\n\n        if not nolock:\n            self._lock.acquire()\n        pos = abs(self.pos)\n        if pos < (self.nrows or 20):\n            self.moveto(pos)\n            self.sp('')\n            self.fp.write('\\r')  # place cursor back at the beginning of line\n            self.moveto(-pos)\n        if not nolock:\n            self._lock.release()\n\n    def refresh(self, nolock=False, lock_args=None):\n        \"\"\"\n        Force refresh the display of this bar.\n\n        Parameters\n        ----------\n        nolock  : bool, optional\n            If `True`, does not lock.\n            If [default: `False`]: calls `acquire()` on internal lock.\n        lock_args  : tuple, optional\n            Passed to internal lock's `acquire()`.\n            If specified, will only `display()` if `acquire()` returns `True`.\n        \"\"\"\n        if self.disable:\n            return\n\n        if not nolock:\n            if lock_args:\n                if not self._lock.acquire(*lock_args):\n                    return False\n            else:\n                self._lock.acquire()\n        self.display()\n        if not nolock:\n            self._lock.release()\n        return True\n\n    def unpause(self):\n        \"\"\"Restart tqdm timer from last print time.\"\"\"\n        if self.disable:\n            return\n        cur_t = self._time()\n        self.start_t += cur_t - self.last_print_t\n        self.last_print_t = cur_t\n\n    def reset(self, total=None):\n        \"\"\"\n        Resets to 0 iterations for repeated use.\n\n        Consider combining with `leave=True`.\n\n        Parameters\n        ----------\n        total  : int or float, optional. Total to use for the new bar.\n        \"\"\"\n        self.n = 0\n        if total is not None:\n            self.total = total\n        if self.disable:\n            return\n        self.last_print_n = 0\n        self.last_print_t = self.start_t = self._time()\n        self._ema_dn = EMA(self.smoothing)\n        self._ema_dt = EMA(self.smoothing)\n        self._ema_miniters = EMA(self.smoothing)\n        self.refresh()\n\n    def set_description(self, desc=None, refresh=True):\n        \"\"\"\n        Set/modify description of the progress bar.\n\n        Parameters\n        ----------\n        desc  : str, optional\n        refresh  : bool, optional\n            Forces refresh [default: True].\n        \"\"\"\n        self.desc = desc + ': ' if desc else ''\n        if refresh:\n            self.refresh()\n\n    def set_description_str(self, desc=None, refresh=True):\n        \"\"\"Set/modify description without ': ' appended.\"\"\"\n        self.desc = desc or ''\n        if refresh:\n            self.refresh()\n\n    def set_postfix(self, ordered_dict=None, refresh=True, **kwargs):\n        \"\"\"\n        Set/modify postfix (additional stats)\n        with automatic formatting based on datatype.\n\n        Parameters\n        ----------\n        ordered_dict  : dict or OrderedDict, optional\n        refresh  : bool, optional\n            Forces refresh [default: True].\n        kwargs  : dict, optional\n        \"\"\"\n        # Sort in alphabetical order to be more deterministic\n        postfix = OrderedDict([] if ordered_dict is None else ordered_dict)\n        for key in sorted(kwargs.keys()):\n            postfix[key] = kwargs[key]\n        # Preprocess stats according to datatype\n        for key in postfix.keys():\n            # Number: limit the length of the string\n            if isinstance(postfix[key], Number):\n                postfix[key] = self.format_num(postfix[key])\n            # Else for any other type, try to get the string conversion\n            elif not isinstance(postfix[key], _basestring):\n                postfix[key] = str(postfix[key])\n            # Else if it's a string, don't need to preprocess anything\n        # Stitch together to get the final postfix\n        self.postfix = ', '.join(key + '=' + postfix[key].strip()\n                                 for key in postfix.keys())\n        if refresh:\n            self.refresh()\n\n    def set_postfix_str(self, s='', refresh=True):\n        \"\"\"\n        Postfix without dictionary expansion, similar to prefix handling.\n        \"\"\"\n        self.postfix = str(s)\n        if refresh:\n            self.refresh()\n\n    def moveto(self, n):\n        # TODO: private method\n        self.fp.write(_unicode('\\n' * n + _term_move_up() * -n))\n        self.fp.flush()\n\n    @property\n    def format_dict(self):\n        \"\"\"Public API for read-only member access.\"\"\"\n        if self.disable and not hasattr(self, 'unit'):\n            return defaultdict(lambda: None, {\n                'n': self.n, 'total': self.total, 'elapsed': 0, 'unit': 'it'})\n        if self.dynamic_ncols:\n            self.ncols, self.nrows = self.dynamic_ncols(self.fp)\n        return {\n            'n': self.n, 'total': self.total,\n            'elapsed': self._time() - self.start_t if hasattr(self, 'start_t') else 0,\n            'ncols': self.ncols, 'nrows': self.nrows, 'prefix': self.desc,\n            'ascii': self.ascii, 'unit': self.unit, 'unit_scale': self.unit_scale,\n            'rate': self._ema_dn() / self._ema_dt() if self._ema_dt() else None,\n            'bar_format': self.bar_format, 'postfix': self.postfix,\n            'unit_divisor': self.unit_divisor, 'initial': self.initial,\n            'colour': self.colour}\n\n    def display(self, msg=None, pos=None):\n        \"\"\"\n        Use `self.sp` to display `msg` in the specified `pos`.\n\n        Consider overloading this function when inheriting to use e.g.:\n        `self.some_frontend(**self.format_dict)` instead of `self.sp`.\n\n        Parameters\n        ----------\n        msg  : str, optional. What to display (default: `repr(self)`).\n        pos  : int, optional. Position to `moveto`\n          (default: `abs(self.pos)`).\n        \"\"\"\n        if pos is None:\n            pos = abs(self.pos)\n\n        nrows = self.nrows or 20\n        if pos >= nrows - 1:\n            if pos >= nrows:\n                return False\n            if msg or msg is None:  # override at `nrows - 1`\n                msg = \" ... (more hidden) ...\"\n\n        if not hasattr(self, \"sp\"):\n            raise TqdmDeprecationWarning(\n                \"Please use `tqdm.gui.tqdm(...)`\"\n                \" instead of `tqdm(..., gui=True)`\\n\",\n                fp_write=getattr(self.fp, 'write', sys.stderr.write))\n\n        if pos:\n            self.moveto(pos)\n        self.sp(self.__str__() if msg is None else msg)\n        if pos:\n            self.moveto(-pos)\n        return True\n\n    @classmethod\n    @contextmanager\n    def wrapattr(cls, stream, method, total=None, bytes=True, **tqdm_kwargs):\n        \"\"\"\n        stream  : file-like object.\n        method  : str, \"read\" or \"write\". The result of `read()` and\n            the first argument of `write()` should have a `len()`.\n\n        >>> with tqdm.wrapattr(file_obj, \"read\", total=file_obj.size) as fobj:\n        ...     while True:\n        ...         chunk = fobj.read(chunk_size)\n        ...         if not chunk:\n        ...             break\n        \"\"\"\n        with cls(total=total, **tqdm_kwargs) as t:\n            if bytes:\n                t.unit = \"B\"\n                t.unit_scale = True\n                t.unit_divisor = 1024\n            yield CallbackIOWrapper(t.update, stream, method)\n\n\ndef trange(*args, **kwargs):\n    \"\"\"\n    A shortcut for tqdm(xrange(*args), **kwargs).\n    On Python3+ range is used instead of xrange.\n    \"\"\"\n    return tqdm(_range(*args), **kwargs)\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/tk.py",
    "content": "\"\"\"\nTkinter GUI progressbar decorator for iterators.\n\nUsage:\n>>> from tqdm.tk import trange, tqdm\n>>> for i in trange(10):\n...     ...\n\"\"\"\nfrom __future__ import absolute_import, division\n\nimport re\nimport sys\nfrom warnings import warn\n\ntry:\n    import tkinter\n    import tkinter.ttk as ttk\nexcept ImportError:\n    import Tkinter as tkinter\n    import ttk as ttk\n\nfrom .std import TqdmExperimentalWarning, TqdmWarning\nfrom .std import tqdm as std_tqdm\nfrom .utils import _range\n\n__author__ = {\"github.com/\": [\"richardsheridan\", \"casperdcl\"]}\n__all__ = ['tqdm_tk', 'ttkrange', 'tqdm', 'trange']\n\n\nclass tqdm_tk(std_tqdm):  # pragma: no cover\n    \"\"\"\n    Experimental Tkinter GUI version of tqdm!\n\n    Note: Window interactivity suffers if `tqdm_tk` is not running within\n    a Tkinter mainloop and values are generated infrequently. In this case,\n    consider calling `tqdm_tk.refresh()` frequently in the Tk thread.\n    \"\"\"\n\n    # TODO: @classmethod: write()?\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"\n        This class accepts the following parameters *in addition* to\n        the parameters accepted by `tqdm`.\n\n        Parameters\n        ----------\n        grab  : bool, optional\n            Grab the input across all windows of the process.\n        tk_parent  : `tkinter.Wm`, optional\n            Parent Tk window.\n        cancel_callback  : Callable, optional\n            Create a cancel button and set `cancel_callback` to be called\n            when the cancel or window close button is clicked.\n        \"\"\"\n        kwargs = kwargs.copy()\n        kwargs['gui'] = True\n        # convert disable = None to False\n        kwargs['disable'] = bool(kwargs.get('disable', False))\n        self._warn_leave = 'leave' in kwargs\n        grab = kwargs.pop('grab', False)\n        tk_parent = kwargs.pop('tk_parent', None)\n        self._cancel_callback = kwargs.pop('cancel_callback', None)\n        super(tqdm_tk, self).__init__(*args, **kwargs)\n\n        if self.disable:\n            return\n\n        if tk_parent is None:  # Discover parent widget\n            try:\n                tk_parent = tkinter._default_root\n            except AttributeError:\n                raise AttributeError(\n                    \"`tk_parent` required when using `tkinter.NoDefaultRoot()`\")\n            if tk_parent is None:  # use new default root window as display\n                self._tk_window = tkinter.Tk()\n            else:  # some other windows already exist\n                self._tk_window = tkinter.Toplevel()\n        else:\n            self._tk_window = tkinter.Toplevel(tk_parent)\n\n        warn(\"GUI is experimental/alpha\", TqdmExperimentalWarning, stacklevel=2)\n        self._tk_dispatching = self._tk_dispatching_helper()\n\n        self._tk_window.protocol(\"WM_DELETE_WINDOW\", self.cancel)\n        self._tk_window.wm_title(self.desc)\n        self._tk_window.wm_attributes(\"-topmost\", 1)\n        self._tk_window.after(0, lambda: self._tk_window.wm_attributes(\"-topmost\", 0))\n        self._tk_n_var = tkinter.DoubleVar(self._tk_window, value=0)\n        self._tk_text_var = tkinter.StringVar(self._tk_window)\n        pbar_frame = ttk.Frame(self._tk_window, padding=5)\n        pbar_frame.pack()\n        _tk_label = ttk.Label(pbar_frame, textvariable=self._tk_text_var,\n                              wraplength=600, anchor=\"center\", justify=\"center\")\n        _tk_label.pack()\n        self._tk_pbar = ttk.Progressbar(\n            pbar_frame, variable=self._tk_n_var, length=450)\n        if self.total is not None:\n            self._tk_pbar.configure(maximum=self.total)\n        else:\n            self._tk_pbar.configure(mode=\"indeterminate\")\n        self._tk_pbar.pack()\n        if self._cancel_callback is not None:\n            _tk_button = ttk.Button(pbar_frame, text=\"Cancel\", command=self.cancel)\n            _tk_button.pack()\n        if grab:\n            self._tk_window.grab_set()\n\n    def close(self):\n        if self.disable:\n            return\n\n        self.disable = True\n\n        with self.get_lock():\n            self._instances.remove(self)\n\n        def _close():\n            self._tk_window.after('idle', self._tk_window.destroy)\n            if not self._tk_dispatching:\n                self._tk_window.update()\n\n        self._tk_window.protocol(\"WM_DELETE_WINDOW\", _close)\n\n        # if leave is set but we are self-dispatching, the left window is\n        # totally unresponsive unless the user manually dispatches\n        if not self.leave:\n            _close()\n        elif not self._tk_dispatching:\n            if self._warn_leave:\n                warn(\"leave flag ignored if not in tkinter mainloop\",\n                     TqdmWarning, stacklevel=2)\n            _close()\n\n    def clear(self, *_, **__):\n        pass\n\n    def display(self, *_, **__):\n        self._tk_n_var.set(self.n)\n        d = self.format_dict\n        # remove {bar}\n        d['bar_format'] = (d['bar_format'] or \"{l_bar}<bar/>{r_bar}\").replace(\n            \"{bar}\", \"<bar/>\")\n        msg = self.format_meter(**d)\n        if '<bar/>' in msg:\n            msg = \"\".join(re.split(r'\\|?<bar/>\\|?', msg, 1))\n        self._tk_text_var.set(msg)\n        if not self._tk_dispatching:\n            self._tk_window.update()\n\n    def set_description(self, desc=None, refresh=True):\n        self.set_description_str(desc, refresh)\n\n    def set_description_str(self, desc=None, refresh=True):\n        self.desc = desc\n        if not self.disable:\n            self._tk_window.wm_title(desc)\n            if refresh and not self._tk_dispatching:\n                self._tk_window.update()\n\n    def cancel(self):\n        \"\"\"\n        `cancel_callback()` followed by `close()`\n        when close/cancel buttons clicked.\n        \"\"\"\n        if self._cancel_callback is not None:\n            self._cancel_callback()\n        self.close()\n\n    def reset(self, total=None):\n        \"\"\"\n        Resets to 0 iterations for repeated use.\n\n        Parameters\n        ----------\n        total  : int or float, optional. Total to use for the new bar.\n        \"\"\"\n        if hasattr(self, '_tk_pbar'):\n            if total is None:\n                self._tk_pbar.configure(maximum=100, mode=\"indeterminate\")\n            else:\n                self._tk_pbar.configure(maximum=total, mode=\"determinate\")\n        super(tqdm_tk, self).reset(total=total)\n\n    @staticmethod\n    def _tk_dispatching_helper():\n        \"\"\"determine if Tkinter mainloop is dispatching events\"\"\"\n        codes = {tkinter.mainloop.__code__, tkinter.Misc.mainloop.__code__}\n        for frame in sys._current_frames().values():\n            while frame:\n                if frame.f_code in codes:\n                    return True\n                frame = frame.f_back\n        return False\n\n\ndef ttkrange(*args, **kwargs):\n    \"\"\"\n    A shortcut for `tqdm.tk.tqdm(xrange(*args), **kwargs)`.\n    On Python3+, `range` is used instead of `xrange`.\n    \"\"\"\n    return tqdm_tk(_range(*args), **kwargs)\n\n\n# Aliases\ntqdm = tqdm_tk\ntrange = ttkrange\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/utils.py",
    "content": "\"\"\"\nGeneral helpers required for `tqdm.std`.\n\"\"\"\nimport os\nimport re\nimport sys\nfrom functools import wraps\nimport warnings\n\n# py2/3 compat\ntry:\n    _range = xrange\nexcept NameError:\n    _range = range\n\ntry:\n    _unich = unichr\nexcept NameError:\n    _unich = chr\n\ntry:\n    _unicode = unicode\nexcept NameError:\n    _unicode = str\n\ntry:\n    _basestring = basestring\nexcept NameError:\n    _basestring = str\n\nCUR_OS = sys.platform\nIS_WIN = any(CUR_OS.startswith(i) for i in ['win32', 'cygwin'])\nIS_NIX = any(CUR_OS.startswith(i) for i in ['aix', 'linux', 'darwin'])\nRE_ANSI = re.compile(r\"\\x1b\\[[;\\d]*[A-Za-z]\")\n\ntry:\n    if IS_WIN:\n        import colorama\n    else:\n        raise ImportError\nexcept ImportError:\n    colorama = None\nelse:\n    try:\n        colorama.init(strip=False)\n    except TypeError:\n        colorama.init()\n\n\nclass FormatReplace(object):\n    \"\"\"\n    >>> a = FormatReplace('something')\n    >>> \"{:5d}\".format(a)\n    'something'\n    \"\"\"  # NOQA: P102\n    def __init__(self, replace=''):\n        self.replace = replace\n        self.format_called = 0\n\n    def __format__(self, _):\n        self.format_called += 1\n        return self.replace\n\n\nclass Comparable(object):\n    \"\"\"Assumes child has self._comparable attr/@property\"\"\"\n    def __lt__(self, other):\n        return self._comparable < other._comparable\n\n    def __le__(self, other):\n        return (self < other) or (self == other)\n\n    def __eq__(self, other):\n        return self._comparable == other._comparable\n\n    def __ne__(self, other):\n        return not self == other\n\n    def __gt__(self, other):\n        return not self <= other\n\n    def __ge__(self, other):\n        return not self < other\n\n\nclass ObjectWrapper(object):\n    def __getattr__(self, name):\n        return getattr(self._wrapped, name)\n\n    def __setattr__(self, name, value):\n        return setattr(self._wrapped, name, value)\n\n    def wrapper_getattr(self, name):\n        \"\"\"Actual `self.getattr` rather than self._wrapped.getattr\"\"\"\n        try:\n            return object.__getattr__(self, name)\n        except AttributeError:  # py2\n            return getattr(self, name)\n\n    def wrapper_setattr(self, name, value):\n        \"\"\"Actual `self.setattr` rather than self._wrapped.setattr\"\"\"\n        return object.__setattr__(self, name, value)\n\n    def __init__(self, wrapped):\n        \"\"\"\n        Thin wrapper around a given object\n        \"\"\"\n        self.wrapper_setattr('_wrapped', wrapped)\n\n\nclass SimpleTextIOWrapper(ObjectWrapper):\n    \"\"\"\n    Change only `.write()` of the wrapped object by encoding the passed\n    value and passing the result to the wrapped object's `.write()` method.\n    \"\"\"\n    # pylint: disable=too-few-public-methods\n    def __init__(self, wrapped, encoding):\n        super(SimpleTextIOWrapper, self).__init__(wrapped)\n        self.wrapper_setattr('encoding', encoding)\n\n    def write(self, s):\n        \"\"\"\n        Encode `s` and pass to the wrapped object's `.write()` method.\n        \"\"\"\n        return self._wrapped.write(s.encode(self.wrapper_getattr('encoding')))\n\n    def __eq__(self, other):\n        return self._wrapped == getattr(other, '_wrapped', other)\n\n\nclass DisableOnWriteError(ObjectWrapper):\n    \"\"\"\n    Disable the given `tqdm_instance` upon `write()` or `flush()` errors.\n    \"\"\"\n    @staticmethod\n    def disable_on_exception(tqdm_instance, func):\n        \"\"\"\n        Quietly set `tqdm_instance.miniters=inf` if `func` raises `errno=5`.\n        \"\"\"\n        def inner(*args, **kwargs):\n            try:\n                return func(*args, **kwargs)\n            except OSError as e:\n                if e.errno != 5:\n                    raise\n                tqdm_instance.miniters = float('inf')\n            except ValueError as e:\n                if 'closed' not in str(e):\n                    raise\n                tqdm_instance.miniters = float('inf')\n        return inner\n\n    def __init__(self, wrapped, tqdm_instance):\n        super(DisableOnWriteError, self).__init__(wrapped)\n        if hasattr(wrapped, 'write'):\n            self.wrapper_setattr(\n                'write', self.disable_on_exception(tqdm_instance, wrapped.write))\n        if hasattr(wrapped, 'flush'):\n            self.wrapper_setattr(\n                'flush', self.disable_on_exception(tqdm_instance, wrapped.flush))\n\n    def __eq__(self, other):\n        return self._wrapped == getattr(other, '_wrapped', other)\n\n\nclass CallbackIOWrapper(ObjectWrapper):\n    def __init__(self, callback, stream, method=\"read\"):\n        \"\"\"\n        Wrap a given `file`-like object's `read()` or `write()` to report\n        lengths to the given `callback`\n        \"\"\"\n        super(CallbackIOWrapper, self).__init__(stream)\n        func = getattr(stream, method)\n        if method == \"write\":\n            @wraps(func)\n            def write(data, *args, **kwargs):\n                res = func(data, *args, **kwargs)\n                callback(len(data))\n                return res\n            self.wrapper_setattr('write', write)\n        elif method == \"read\":\n            @wraps(func)\n            def read(*args, **kwargs):\n                data = func(*args, **kwargs)\n                callback(len(data))\n                return data\n            self.wrapper_setattr('read', read)\n        else:\n            raise KeyError(\"Can only wrap read/write methods\")\n\n\ndef _is_utf(encoding):\n    try:\n        u'\\u2588\\u2589'.encode(encoding)\n    except UnicodeEncodeError:\n        return False\n    except Exception:\n        try:\n            return encoding.lower().startswith('utf-') or ('U8' == encoding)\n        except Exception:\n            return False\n    else:\n        return True\n\n\ndef _supports_unicode(fp):\n    try:\n        return _is_utf(fp.encoding)\n    except AttributeError:\n        return False\n\n\ndef _is_ascii(s):\n    if isinstance(s, str):\n        for c in s:\n            if ord(c) > 255:\n                return False\n        return True\n    return _supports_unicode(s)\n\n\ndef _screen_shape_wrapper():  # pragma: no cover\n    \"\"\"\n    Return a function which returns console dimensions (width, height).\n    Supported: linux, osx, windows, cygwin.\n    \"\"\"\n    _screen_shape = None\n    if IS_WIN:\n        _screen_shape = _screen_shape_windows\n        if _screen_shape is None:\n            _screen_shape = _screen_shape_tput\n    if IS_NIX:\n        _screen_shape = _screen_shape_linux\n    return _screen_shape\n\n\ndef _screen_shape_windows(fp):  # pragma: no cover\n    try:\n        with warnings.catch_warnings():\n            warnings.simplefilter(\"ignore\")\n\n            import struct\n            from ctypes import create_string_buffer, windll\n            from sys import stdin, stdout\n\n        io_handle = -12  # assume stderr\n        if fp == stdin:\n            io_handle = -10\n        elif fp == stdout:\n            io_handle = -11\n\n        h = windll.kernel32.GetStdHandle(io_handle)\n        csbi = create_string_buffer(22)\n        res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)\n        if res:\n            (_bufx, _bufy, _curx, _cury, _wattr, left, top, right, bottom,\n             _maxx, _maxy) = struct.unpack(\"hhhhHhhhhhh\", csbi.raw)\n            return right - left, bottom - top  # +1\n    except Exception:  # nosec\n        pass\n    return None, None\n\n\ndef _screen_shape_tput(*_):  # pragma: no cover\n    \"\"\"cygwin xterm (windows)\"\"\"\n    try:\n        import shlex\n        from subprocess import check_call  # nosec\n        return [int(check_call(shlex.split('tput ' + i))) - 1\n                for i in ('cols', 'lines')]\n    except Exception:  # nosec\n        pass\n    return None, None\n\n\ndef _screen_shape_linux(fp):  # pragma: no cover\n\n    try:\n        with warnings.catch_warnings():\n            warnings.simplefilter(\"ignore\")\n\n            from array import array\n            from fcntl import ioctl\n            from termios import TIOCGWINSZ\n    except ImportError:\n        return None\n    else:\n        try:\n            rows, cols = array('h', ioctl(fp, TIOCGWINSZ, '\\0' * 8))[:2]\n            return cols, rows\n        except Exception:\n            try:\n                return [int(os.environ[i]) - 1 for i in (\"COLUMNS\", \"LINES\")]\n            except KeyError:\n                return None, None\n\n\ndef _environ_cols_wrapper():  # pragma: no cover\n    \"\"\"\n    Return a function which returns console width.\n    Supported: linux, osx, windows, cygwin.\n    \"\"\"\n    warnings.warn(\"Use `_screen_shape_wrapper()(file)[0]` instead of\"\n         \" `_environ_cols_wrapper()(file)`\", DeprecationWarning, stacklevel=2)\n    shape = _screen_shape_wrapper()\n    if not shape:\n        return None\n\n    @wraps(shape)\n    def inner(fp):\n        return shape(fp)[0]\n\n    return inner\n\n\ndef _term_move_up():  # pragma: no cover\n    return '' if (os.name == 'nt') and (colorama is None) else '\\x1b[A'\n\n\ntry:\n    # TODO consider using wcswidth third-party package for 0-width characters\n    from unicodedata import east_asian_width\nexcept ImportError:\n    _text_width = len\nelse:\n    def _text_width(s):\n        return sum(2 if east_asian_width(ch) in 'FW' else 1 for ch in _unicode(s))\n\n\ndef disp_len(data):\n    \"\"\"\n    Returns the real on-screen length of a string which may contain\n    ANSI control codes and wide chars.\n    \"\"\"\n    return _text_width(RE_ANSI.sub('', data))\n\n\ndef disp_trim(data, length):\n    \"\"\"\n    Trim a string which may contain ANSI control characters.\n    \"\"\"\n    if len(data) == disp_len(data):\n        return data[:length]\n\n    ansi_present = bool(RE_ANSI.search(data))\n    while disp_len(data) > length:  # carefully delete one char at a time\n        data = data[:-1]\n    if ansi_present and bool(RE_ANSI.search(data)):\n        # assume ANSI reset is required\n        return data if data.endswith(\"\\033[0m\") else data + \"\\033[0m\"\n    return data\n"
  },
  {
    "path": "nuitka/build/inline_copy/tqdm/tqdm/version.py",
    "content": "\"\"\"`tqdm` version detector. Precedence: installed dist, git, 'UNKNOWN'.\"\"\"\n__version__ = \"UNKNOWN\"\n"
  },
  {
    "path": "nuitka/build/inline_copy/wax_off/LICENSE",
    "content": "MIT License\n\nCopyright (c) 1997-2021 by Edward K. Ream.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n################\nOther Copyrights\n################\n\nPortions of Leo's pygments interface use code from the Jupyter qtconsole package.\n\nThese parts are are clearly marked in Leo's code as follows:\n\n    Copyright (c) Jupyter Development Team.\n    Distributed under the terms of the Modified BSD License.\n    \nPortions of Leo's pyzo interface uses code from pyzo:\n\n    Copyright (C) 2013-2020, the Pyzo development team\n    \n    Pyzo is distributed under the terms of the (new) BSD License.\n    The full license can be found in 'license.txt'.\n    \n    Yoton is distributed under the terms of the (new) BSD License.\n    The full license can be found in 'license.txt'.\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/wax_off/wax_off.py",
    "content": "#@+leo-ver=5-thin\n#@+node:ekr.20210709045755.1: * @file ../scripts/wax_off.py\n#@+<< docstring >>\n#@+node:ekr.20210710050822.1: ** << docstring >>\n\"\"\"\nThe \"wax-off\" utility.\n\nCreate stub files from existing annotation, then remove all function annotations.\n\nSo called because having created annotations in the python sources (wax-on)\nwe now want to remove them again (wax-off).\n\n**Important**: In most cases it will be better to use make_stub_files (msb)\nto create stub files. Unlike simplistic wax-on scripts, msb does a good job\nof annotating the return values of functions.\n\nStub files provide the benefits of mypy with minimal clutter. The remaining\n\"clutter\" (annotations of var types) turns out to be excellent\ndocumentation.\n\n**Tweaking the stub files**\n\nThe wax_off script knows very little about python. wax_off is just a\npattern matcher. wax_off moves def lines (and class lines) to the stub file\nwith the *existing* indentation. So mypy may complain about syntax errors\nin the stub file:\n\n1. If a class (like an exception class) has no methods, the class line\n   should be followed by '...'. You must do that yourself.\n\n2. If a function/method contains an inner def, mypy will also complain. You\n   can just comment out those inner defs. They aren't needed anyway: mypy\n   handles local attributes very well.\n\n**Summary**\n\nThe wax_off script allows you to add full annotations for functions and\nmethods directly in the source files. When mypy is happy, just run wax_off\nto move the def lines into stub files. wax_off then \"declutters\" the def\nlines.\n\"\"\"\n#@-<< docstring >>\nimport argparse\nimport difflib\nimport glob\nimport os\nimport re\nimport sys\n\n# Match class definitions.\nclass_pat = re.compile(r'^[ ]*class\\s+[\\w_]+.*?:', re.MULTILINE)\n\n# Match function/method definitions.\ndef_pat = re.compile(r'^([ ]*)def\\s+([\\w_]+)\\s*\\((.*?)\\)(.*?):', re.MULTILINE + re.DOTALL)\n\n__version__ = 'wax_off.py version 1.0'\n\nclass WaxOff:\n    diff = False\n    trace = False\n    #@+others\n    #@+node:ekr.20210709065306.1: ** wax_off.do_file\n    def do_file(self, input_fn):\n        \"\"\"Handle one file\"\"\"\n        # Define output files.\n        short_input_fn = os.path.basename(input_fn)\n        stub_fn = os.path.join(self.output_directory, short_input_fn + 'i')\n        new_fn = os.path.join(self.output_directory, short_input_fn)\n        # Read the input file.\n        with open(input_fn, 'r') as f:\n            contents = f.read()\n        # Find all the class defs.\n        n = 0\n        file_stubs, replacements = [], []\n        for m in class_pat.finditer(contents):\n            class_stub = m.group(0).rstrip() + '\\n'\n            file_stubs.append((m.start(), class_stub))\n        # Find all the defs.\n        for m in def_pat.finditer(contents):\n            n += 1\n            stub = f\"{m.group(0)} ...\\n\"\n            lws = m.group(1)\n            name = m.group(2)\n            args = self.stripped_args(m.group(3))\n            # ret = m.group(4)\n            stripped = f\"{lws}def {name}({args}):\"\n            assert not stripped.startswith('\\n'), stripped\n            if 0:\n                print(f\"{n:>3} original: {m.group(0).rstrip()}\")\n                print(f\"{n:>3}     stub: {stub.rstrip()}\")\n                print(f\"{n:>3} stripped: {stripped}\")\n                print('')\n            # Append the results.\n            replacements.append((m.start(), m.group(0), stripped))\n            file_stubs.append((m.start(), stub))\n        # Dump the replacements:\n        if 0:\n            for i, data in enumerate(replacements):\n                start, old, new = data\n                print(i, start)\n                print(f\"{old!r}\")\n                print(f\"{new!r}\")\n        # Sort the stubs.\n        file_stubs.sort()\n        # Dump the sorted stubs.\n        if 0:\n            for data in file_stubs:\n                start, s = data\n                print(s.rstrip())\n        # Write the stub file.\n        print(f\"\\nWriting {stub_fn}\")\n        with open(stub_fn, 'w') as f:\n            f.write(''.join(z[1] for z in file_stubs))\n        # Compute the new contents.\n        new_contents = contents\n        for data in reversed(replacements):\n            start, old, new = data\n            assert new_contents[start:].startswith(old), (start, old, new_contents[start:start+50])\n            new_contents = new_contents[:start] + new + new_contents[start+len(old):]\n        # Diff or write the file.\n        if self.diff:  # Diff the old and new contents.\n            lines = list(difflib.unified_diff(\n                contents.splitlines(True), new_contents.splitlines(True),\n                fromfile=input_fn, tofile=new_fn, n=0))\n            print(f\"Diff: {new_fn}\")\n            for line in lines:\n                print(repr(line))\n        else:  # Write the new file.\n            print(f\"Writing: {new_fn}\")\n            with open(new_fn, 'w') as f:\n                f.write(new_contents)\n        print(f\"{len(replacements)} replacements\")\n    #@+node:ekr.20210709052929.3: ** wax_off.get_next_arg\n    name_pat = re.compile(r'\\s*([\\w_]+)\\s*')\n\n    def get_next_arg(self, s, i):\n        \"\"\"\n        Scan the next argument, retaining initializers, stripped of annotations.\n\n        Return (arg, i):\n        - arg: The next argument.\n        - i:   The index of the character after arg.\n        \"\"\"\n        assert i < len(s), (i, len(s))\n        m = self.name_pat.match(s[i:])\n        if not m:\n            return (None, len(s))\n        name = m.group(0).strip()\n        i += len(m.group(0))\n        if i >= len(s):\n            return (name, i)\n        if s[i] == ':':\n            # Skip the annotation.\n            i += 1\n            j = self.skip_to_outer_delim(s, i, delims=\"=,\")\n            i = self.skip_ws(s, j)\n        if i >= len(s):\n            return name, i\n        if s[i] == ',':\n            return name, i + 1\n        # Skip the initializer.\n        assert s[i] == '=', (i, s[i:])\n        i += 1\n        j = self.skip_to_outer_delim(s, i, delims=\",\")\n        initializer = s[i:j].strip()\n        if j < len(s) and s[j] == ',':\n            j += 1\n        i = self.skip_ws(s, j)\n        return f\"{name}={initializer}\", i\n\n    #@+node:ekr.20210709102722.1: ** wax_off.main\n    def main(self):\n        \"\"\"The main line of the wax_off script.\"\"\"\n        # Handle command-line options & set ivars.\n        self.scan_options()\n        # Handle each file.\n        for fn in self.files:\n            path = os.path.join(self.input_directory, fn)\n            self.do_file(path)\n    #@+node:ekr.20210709055018.1: ** wax_off.scan_options\n    def scan_options(self):\n        \"\"\"Run commands specified by sys.argv.\"\"\"\n\n        def dir_path(s):\n            if os.path.isdir(s):\n                return s\n            print(f\"\\nNot a directory: {s!r}\")\n            sys.exit(1)\n\n        parser = argparse.ArgumentParser(\n            description=\"wax_off.py: create stub files, then remove function annotations\")\n        add = parser.add_argument\n        add('FILES', nargs='*', help='list of files or directories')\n        add('-d', '--diff', dest='d', action='store_true', help='Show diff without writing files')\n        add('-i', '--input-directory', dest='i_dir', metavar=\"DIR\", type=dir_path, help='Input directory')\n        add('-o', '--output-directory', dest='o_dir', metavar=\"DIR\", type=dir_path, help='Output directory')\n        add('-t', '--trace', dest='t', action='store_true', help='Show debug traces')\n        add('-v', '--version', dest='v', action='store_true', help='show version and exit')\n        args = parser.parse_args()\n        # Handle all args.\n        if args.v:\n            print(__version__)\n            sys.exit(0)\n        # Set flags.\n        self.diff = bool(args.d)\n        self.trace = bool(args.t)\n        # Compute directories. They are known to exist.\n        self.input_directory = args.i_dir or os.getcwd()\n        self.output_directory = args.o_dir or os.getcwd()\n        # Get files.\n        files = []\n        for fn in args.FILES:\n            path = os.path.join(self.input_directory, fn)\n            files.extend(glob.glob(path))\n        # Warn if files do not exist.\n        self.files = []\n        for path in files:\n            if not path.endswith('.py'):\n                print(f\"Not a .py file: {path}\")\n            elif os.path.exists(path):\n                self.files.append(path)\n            else:\n                print(f\"File not found: {path}\")\n        # Trace, if requested.\n        if self.trace:\n            print('')\n            print(f\"  Input directory: {self.input_directory}\")\n            print(f\" Output directory: {self.output_directory}\")\n            print('')\n            print('Files...')\n            for fn in self.files:\n                print(f\"  {fn}\")\n            print('')\n        # Check the arguments.\n        if not self.files:\n            print('No input files')\n            sys.exit(1)\n\n    #@+node:ekr.20210709052929.4: ** wax_off.skip_to_outer_delim & helpers\n    def skip_to_outer_delim(self, s, i, delims):\n        \"\"\"\n        Skip to next *outer*, ignoring inner delimis contained in strings, etc.\n\n        It is valid to reach the end of s before seeing the expected delim.\n\n        Return i, the character after the delim, or len(s) if the delim has not been seen.\n        \"\"\"\n        assert i < len(s), i\n        # Type annotations only use [], but initializers can use anything.\n        c_level, p_level, s_level = 0, 0, 0  # Levels for {}, (), []\n        while i < len(s):\n            ch = s[i]\n            progress = i\n            i += 1\n            if ch in delims:\n                if (c_level, p_level, s_level) == (0, 0, 0):\n                    return i - 1  # Let caller handle ending delim.\n            elif ch == '{':\n                c_level += 1\n            elif ch == '}':\n                c_level -= 1\n            elif ch == '(':\n                p_level += 1\n            elif ch == ')':\n                p_level -= 1\n            elif ch == '[':\n                s_level += 1\n            elif ch == ']':\n                s_level -= 1\n            elif ch in \"'\\\"\":\n                i = self.skip_string(s, i-1)\n            elif ch == \"#\":\n                i = self.skip_comment(s, i-1)\n            else:\n                pass\n            assert progress < i, (i, repr(s[i:]))\n        assert (c_level, p_level, s_level) == (0, 0, 0), (c_level, p_level, s_level)\n        return len(s)\n    #@+node:ekr.20210709052929.5: *3* wax_off.skip_comment\n    def skip_comment(self, s, i):\n        \"\"\"Scan forward to the end of a comment.\"\"\"\n        assert s[i] == '#'\n        while i < len(s) and s[i] != '\\n':\n            i += 1\n        return i\n    #@+node:ekr.20210709052929.6: *3* wax_off.skip_string\n    def skip_string(self, s, i):\n        \"\"\"Scan forward to the end of a string.\"\"\"\n        delim = s[i]\n        i += 1\n        assert(delim == '\"' or delim == '\\'')\n        n = len(s)\n        while i < n and s[i] != delim:\n            if s[i] == '\\\\':\n                i += 2\n            else:\n                i += 1\n        assert i < len(s) and s[i] == delim, (i, delim)\n        i += 1\n        return i\n    #@+node:ekr.20210709053410.1: *3* wax_off.skip_ws\n    def skip_ws(self, s, i):\n        while i < len(s) and s[i] in ' \\t':\n            i += 1\n        return i\n    #@+node:ekr.20210709052929.2: ** wax_off.stripped_args\n    def stripped_args(self, s):\n        \"\"\"\n        s is the argument list, without parens, possibly containing annotations.\n\n        Return the argument list without annotations.\n        \"\"\"\n        s = s.replace('\\n',' ').replace('  ','').rstrip().rstrip(',')\n        args, i = [], 0\n        while i < len(s):\n            progress = i\n            arg, i = self.get_next_arg(s, i)\n            if not arg:\n                break\n            args.append(arg)\n            assert progress < i, (i, repr(s[i:]))\n        return ', '.join(args)\n    #@-others\n\nif __name__ == '__main__':\n    WaxOff().main()\n#@-leo\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/LICENSE",
    "content": "Copyright (c) 2017-2021 Ingy döt Net\nCopyright (c) 2006-2016 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/__init__.py",
    "content": "\nfrom .error import *\n\nfrom .tokens import *\nfrom .events import *\nfrom .nodes import *\n\nfrom .loader import *\nfrom .dumper import *\n\n__version__ = '5.4.1'\ntry:\n    from .cyaml import *\n    __with_libyaml__ = True\nexcept ImportError:\n    __with_libyaml__ = False\n\nimport io\n\n#------------------------------------------------------------------------------\n# Warnings control\n#------------------------------------------------------------------------------\n\n# 'Global' warnings state:\n_warnings_enabled = {\n    'YAMLLoadWarning': True,\n}\n\n# Get or set global warnings' state\ndef warnings(settings=None):\n    if settings is None:\n        return _warnings_enabled\n\n    if type(settings) is dict:\n        for key in settings:\n            if key in _warnings_enabled:\n                _warnings_enabled[key] = settings[key]\n\n# Warn when load() is called without Loader=...\nclass YAMLLoadWarning(RuntimeWarning):\n    pass\n\ndef load_warning(method):\n    if _warnings_enabled['YAMLLoadWarning'] is False:\n        return\n\n    import warnings\n\n    message = (\n        \"calling yaml.%s() without Loader=... is deprecated, as the \"\n        \"default Loader is unsafe. Please read \"\n        \"https://msg.pyyaml.org/load for full details.\"\n    ) % method\n\n    warnings.warn(message, YAMLLoadWarning, stacklevel=3)\n\n#------------------------------------------------------------------------------\ndef scan(stream, Loader=Loader):\n    \"\"\"\n    Scan a YAML stream and produce scanning tokens.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_token():\n            yield loader.get_token()\n    finally:\n        loader.dispose()\n\ndef parse(stream, Loader=Loader):\n    \"\"\"\n    Parse a YAML stream and produce parsing events.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_event():\n            yield loader.get_event()\n    finally:\n        loader.dispose()\n\ndef compose(stream, Loader=Loader):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding representation tree.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        return loader.get_single_node()\n    finally:\n        loader.dispose()\n\ndef compose_all(stream, Loader=Loader):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding representation trees.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_node():\n            yield loader.get_node()\n    finally:\n        loader.dispose()\n\ndef load(stream, Loader=None):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n    \"\"\"\n    if Loader is None:\n        load_warning('load')\n        Loader = FullLoader\n\n    loader = Loader(stream)\n    try:\n        return loader.get_single_data()\n    finally:\n        loader.dispose()\n\ndef load_all(stream, Loader=None):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n    \"\"\"\n    if Loader is None:\n        load_warning('load_all')\n        Loader = FullLoader\n\n    loader = Loader(stream)\n    try:\n        while loader.check_data():\n            yield loader.get_data()\n    finally:\n        loader.dispose()\n\ndef full_load(stream):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n\n    Resolve all tags except those known to be\n    unsafe on untrusted input.\n    \"\"\"\n    return load(stream, FullLoader)\n\ndef full_load_all(stream):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n\n    Resolve all tags except those known to be\n    unsafe on untrusted input.\n    \"\"\"\n    return load_all(stream, FullLoader)\n\ndef safe_load(stream):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n\n    Resolve only basic YAML tags. This is known\n    to be safe for untrusted input.\n    \"\"\"\n    return load(stream, SafeLoader)\n\ndef safe_load_all(stream):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n\n    Resolve only basic YAML tags. This is known\n    to be safe for untrusted input.\n    \"\"\"\n    return load_all(stream, SafeLoader)\n\ndef unsafe_load(stream):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n\n    Resolve all tags, even those known to be\n    unsafe on untrusted input.\n    \"\"\"\n    return load(stream, UnsafeLoader)\n\ndef unsafe_load_all(stream):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n\n    Resolve all tags, even those known to be\n    unsafe on untrusted input.\n    \"\"\"\n    return load_all(stream, UnsafeLoader)\n\ndef emit(events, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None):\n    \"\"\"\n    Emit YAML parsing events into a stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        stream = io.StringIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break)\n    try:\n        for event in events:\n            dumper.emit(event)\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize_all(nodes, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding=None, explicit_start=None, explicit_end=None,\n        version=None, tags=None):\n    \"\"\"\n    Serialize a sequence of representation trees into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            stream = io.StringIO()\n        else:\n            stream = io.BytesIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end)\n    try:\n        dumper.open()\n        for node in nodes:\n            dumper.serialize(node)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize(node, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a representation tree into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return serialize_all([node], stream, Dumper=Dumper, **kwds)\n\ndef dump_all(documents, stream=None, Dumper=Dumper,\n        default_style=None, default_flow_style=False,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding=None, explicit_start=None, explicit_end=None,\n        version=None, tags=None, sort_keys=True):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            stream = io.StringIO()\n        else:\n            stream = io.BytesIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, default_style=default_style,\n            default_flow_style=default_flow_style,\n            canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end, sort_keys=sort_keys)\n    try:\n        dumper.open()\n        for data in documents:\n            dumper.represent(data)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef dump(data, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=Dumper, **kwds)\n\ndef safe_dump_all(documents, stream=None, **kwds):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all(documents, stream, Dumper=SafeDumper, **kwds)\n\ndef safe_dump(data, stream=None, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=SafeDumper, **kwds)\n\ndef add_implicit_resolver(tag, regexp, first=None,\n        Loader=None, Dumper=Dumper):\n    \"\"\"\n    Add an implicit scalar detector.\n    If an implicit scalar value matches the given regexp,\n    the corresponding tag is assigned to the scalar.\n    first is a sequence of possible initial characters or None.\n    \"\"\"\n    if Loader is None:\n        loader.Loader.add_implicit_resolver(tag, regexp, first)\n        loader.FullLoader.add_implicit_resolver(tag, regexp, first)\n        loader.UnsafeLoader.add_implicit_resolver(tag, regexp, first)\n    else:\n        Loader.add_implicit_resolver(tag, regexp, first)\n    Dumper.add_implicit_resolver(tag, regexp, first)\n\ndef add_path_resolver(tag, path, kind=None, Loader=None, Dumper=Dumper):\n    \"\"\"\n    Add a path based resolver for the given tag.\n    A path is a list of keys that forms a path\n    to a node in the representation tree.\n    Keys can be string values, integers, or None.\n    \"\"\"\n    if Loader is None:\n        loader.Loader.add_path_resolver(tag, path, kind)\n        loader.FullLoader.add_path_resolver(tag, path, kind)\n        loader.UnsafeLoader.add_path_resolver(tag, path, kind)\n    else:\n        Loader.add_path_resolver(tag, path, kind)\n    Dumper.add_path_resolver(tag, path, kind)\n\ndef add_constructor(tag, constructor, Loader=None):\n    \"\"\"\n    Add a constructor for the given tag.\n    Constructor is a function that accepts a Loader instance\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    if Loader is None:\n        loader.Loader.add_constructor(tag, constructor)\n        loader.FullLoader.add_constructor(tag, constructor)\n        loader.UnsafeLoader.add_constructor(tag, constructor)\n    else:\n        Loader.add_constructor(tag, constructor)\n\ndef add_multi_constructor(tag_prefix, multi_constructor, Loader=None):\n    \"\"\"\n    Add a multi-constructor for the given tag prefix.\n    Multi-constructor is called for a node if its tag starts with tag_prefix.\n    Multi-constructor accepts a Loader instance, a tag suffix,\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    if Loader is None:\n        loader.Loader.add_multi_constructor(tag_prefix, multi_constructor)\n        loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor)\n        loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor)\n    else:\n        Loader.add_multi_constructor(tag_prefix, multi_constructor)\n\ndef add_representer(data_type, representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Representer is a function accepting a Dumper instance\n    and an instance of the given data type\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_representer(data_type, representer)\n\ndef add_multi_representer(data_type, multi_representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Multi-representer is a function accepting a Dumper instance\n    and an instance of the given data type or subtype\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_multi_representer(data_type, multi_representer)\n\nclass YAMLObjectMetaclass(type):\n    \"\"\"\n    The metaclass for YAMLObject.\n    \"\"\"\n    def __init__(cls, name, bases, kwds):\n        super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds)\n        if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None:\n            if isinstance(cls.yaml_loader, list):\n                for loader in cls.yaml_loader:\n                    loader.add_constructor(cls.yaml_tag, cls.from_yaml)\n            else:\n                cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml)\n\n            cls.yaml_dumper.add_representer(cls, cls.to_yaml)\n\nclass YAMLObject(metaclass=YAMLObjectMetaclass):\n    \"\"\"\n    An object that can dump itself to a YAML stream\n    and load itself from a YAML stream.\n    \"\"\"\n\n    __slots__ = ()  # no direct instantiation, so allow immutable subclasses\n\n    yaml_loader = [Loader, FullLoader, UnsafeLoader]\n    yaml_dumper = Dumper\n\n    yaml_tag = None\n    yaml_flow_style = None\n\n    @classmethod\n    def from_yaml(cls, loader, node):\n        \"\"\"\n        Convert a representation node to a Python object.\n        \"\"\"\n        return loader.construct_yaml_object(node, cls)\n\n    @classmethod\n    def to_yaml(cls, dumper, data):\n        \"\"\"\n        Convert a Python object to a representation node.\n        \"\"\"\n        return dumper.represent_yaml_object(cls.yaml_tag, data, cls,\n                flow_style=cls.yaml_flow_style)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/composer.py",
    "content": "\n__all__ = ['Composer', 'ComposerError']\n\nfrom .error import MarkedYAMLError\nfrom .events import *\nfrom .nodes import *\n\nclass ComposerError(MarkedYAMLError):\n    pass\n\nclass Composer:\n\n    def __init__(self):\n        self.anchors = {}\n\n    def check_node(self):\n        # Drop the STREAM-START event.\n        if self.check_event(StreamStartEvent):\n            self.get_event()\n\n        # If there are more documents available?\n        return not self.check_event(StreamEndEvent)\n\n    def get_node(self):\n        # Get the root node of the next document.\n        if not self.check_event(StreamEndEvent):\n            return self.compose_document()\n\n    def get_single_node(self):\n        # Drop the STREAM-START event.\n        self.get_event()\n\n        # Compose a document if the stream is not empty.\n        document = None\n        if not self.check_event(StreamEndEvent):\n            document = self.compose_document()\n\n        # Ensure that the stream contains no more documents.\n        if not self.check_event(StreamEndEvent):\n            event = self.get_event()\n            raise ComposerError(\"expected a single document in the stream\",\n                    document.start_mark, \"but found another document\",\n                    event.start_mark)\n\n        # Drop the STREAM-END event.\n        self.get_event()\n\n        return document\n\n    def compose_document(self):\n        # Drop the DOCUMENT-START event.\n        self.get_event()\n\n        # Compose the root node.\n        node = self.compose_node(None, None)\n\n        # Drop the DOCUMENT-END event.\n        self.get_event()\n\n        self.anchors = {}\n        return node\n\n    def compose_node(self, parent, index):\n        if self.check_event(AliasEvent):\n            event = self.get_event()\n            anchor = event.anchor\n            if anchor not in self.anchors:\n                raise ComposerError(None, None, \"found undefined alias %r\"\n                        % anchor, event.start_mark)\n            return self.anchors[anchor]\n        event = self.peek_event()\n        anchor = event.anchor\n        if anchor is not None:\n            if anchor in self.anchors:\n                raise ComposerError(\"found duplicate anchor %r; first occurrence\"\n                        % anchor, self.anchors[anchor].start_mark,\n                        \"second occurrence\", event.start_mark)\n        self.descend_resolver(parent, index)\n        if self.check_event(ScalarEvent):\n            node = self.compose_scalar_node(anchor)\n        elif self.check_event(SequenceStartEvent):\n            node = self.compose_sequence_node(anchor)\n        elif self.check_event(MappingStartEvent):\n            node = self.compose_mapping_node(anchor)\n        self.ascend_resolver()\n        return node\n\n    def compose_scalar_node(self, anchor):\n        event = self.get_event()\n        tag = event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(ScalarNode, event.value, event.implicit)\n        node = ScalarNode(tag, event.value,\n                event.start_mark, event.end_mark, style=event.style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        return node\n\n    def compose_sequence_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(SequenceNode, None, start_event.implicit)\n        node = SequenceNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        index = 0\n        while not self.check_event(SequenceEndEvent):\n            node.value.append(self.compose_node(node, index))\n            index += 1\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n    def compose_mapping_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(MappingNode, None, start_event.implicit)\n        node = MappingNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        while not self.check_event(MappingEndEvent):\n            #key_event = self.peek_event()\n            item_key = self.compose_node(node, None)\n            #if item_key in node.value:\n            #    raise ComposerError(\"while composing a mapping\", start_event.start_mark,\n            #            \"found duplicate key\", key_event.start_mark)\n            item_value = self.compose_node(node, item_key)\n            #node.value[item_key] = item_value\n            node.value.append((item_key, item_value))\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/constructor.py",
    "content": "\n__all__ = [\n    'BaseConstructor',\n    'SafeConstructor',\n    'FullConstructor',\n    'UnsafeConstructor',\n    'Constructor',\n    'ConstructorError'\n]\n\nfrom .error import *\nfrom .nodes import *\n\nimport collections.abc, datetime, base64, binascii, re, sys, types\n\nclass ConstructorError(MarkedYAMLError):\n    pass\n\nclass BaseConstructor:\n\n    yaml_constructors = {}\n    yaml_multi_constructors = {}\n\n    def __init__(self):\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.state_generators = []\n        self.deep_construct = False\n\n    def check_data(self):\n        # If there are more documents available?\n        return self.check_node()\n\n    def check_state_key(self, key):\n        \"\"\"Block special attributes/methods from being set in a newly created\n        object, to prevent user-controlled methods from being called during\n        deserialization\"\"\"\n        if self.get_state_keys_blacklist_regexp().match(key):\n            raise ConstructorError(None, None,\n                \"blacklisted key '%s' in instance state found\" % (key,), None)\n\n    def get_data(self):\n        # Construct and return the next document.\n        if self.check_node():\n            return self.construct_document(self.get_node())\n\n    def get_single_data(self):\n        # Ensure that the stream contains a single document and construct it.\n        node = self.get_single_node()\n        if node is not None:\n            return self.construct_document(node)\n        return None\n\n    def construct_document(self, node):\n        data = self.construct_object(node)\n        while self.state_generators:\n            state_generators = self.state_generators\n            self.state_generators = []\n            for generator in state_generators:\n                for dummy in generator:\n                    pass\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.deep_construct = False\n        return data\n\n    def construct_object(self, node, deep=False):\n        if node in self.constructed_objects:\n            return self.constructed_objects[node]\n        if deep:\n            old_deep = self.deep_construct\n            self.deep_construct = True\n        if node in self.recursive_objects:\n            raise ConstructorError(None, None,\n                    \"found unconstructable recursive node\", node.start_mark)\n        self.recursive_objects[node] = None\n        constructor = None\n        tag_suffix = None\n        if node.tag in self.yaml_constructors:\n            constructor = self.yaml_constructors[node.tag]\n        else:\n            for tag_prefix in self.yaml_multi_constructors:\n                if tag_prefix is not None and node.tag.startswith(tag_prefix):\n                    tag_suffix = node.tag[len(tag_prefix):]\n                    constructor = self.yaml_multi_constructors[tag_prefix]\n                    break\n            else:\n                if None in self.yaml_multi_constructors:\n                    tag_suffix = node.tag\n                    constructor = self.yaml_multi_constructors[None]\n                elif None in self.yaml_constructors:\n                    constructor = self.yaml_constructors[None]\n                elif isinstance(node, ScalarNode):\n                    constructor = self.__class__.construct_scalar\n                elif isinstance(node, SequenceNode):\n                    constructor = self.__class__.construct_sequence\n                elif isinstance(node, MappingNode):\n                    constructor = self.__class__.construct_mapping\n        if tag_suffix is None:\n            data = constructor(self, node)\n        else:\n            data = constructor(self, tag_suffix, node)\n        if isinstance(data, types.GeneratorType):\n            generator = data\n            data = next(generator)\n            if self.deep_construct:\n                for dummy in generator:\n                    pass\n            else:\n                self.state_generators.append(generator)\n        self.constructed_objects[node] = data\n        del self.recursive_objects[node]\n        if deep:\n            self.deep_construct = old_deep\n        return data\n\n    def construct_scalar(self, node):\n        if not isinstance(node, ScalarNode):\n            raise ConstructorError(None, None,\n                    \"expected a scalar node, but found %s\" % node.id,\n                    node.start_mark)\n        return node.value\n\n    def construct_sequence(self, node, deep=False):\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(None, None,\n                    \"expected a sequence node, but found %s\" % node.id,\n                    node.start_mark)\n        return [self.construct_object(child, deep=deep)\n                for child in node.value]\n\n    def construct_mapping(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        mapping = {}\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            if not isinstance(key, collections.abc.Hashable):\n                raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                        \"found unhashable key\", key_node.start_mark)\n            value = self.construct_object(value_node, deep=deep)\n            mapping[key] = value\n        return mapping\n\n    def construct_pairs(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        pairs = []\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            value = self.construct_object(value_node, deep=deep)\n            pairs.append((key, value))\n        return pairs\n\n    @classmethod\n    def add_constructor(cls, tag, constructor):\n        if not 'yaml_constructors' in cls.__dict__:\n            cls.yaml_constructors = cls.yaml_constructors.copy()\n        cls.yaml_constructors[tag] = constructor\n\n    @classmethod\n    def add_multi_constructor(cls, tag_prefix, multi_constructor):\n        if not 'yaml_multi_constructors' in cls.__dict__:\n            cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy()\n        cls.yaml_multi_constructors[tag_prefix] = multi_constructor\n\nclass SafeConstructor(BaseConstructor):\n\n    def construct_scalar(self, node):\n        if isinstance(node, MappingNode):\n            for key_node, value_node in node.value:\n                if key_node.tag == 'tag:yaml.org,2002:value':\n                    return self.construct_scalar(value_node)\n        return super().construct_scalar(node)\n\n    def flatten_mapping(self, node):\n        merge = []\n        index = 0\n        while index < len(node.value):\n            key_node, value_node = node.value[index]\n            if key_node.tag == 'tag:yaml.org,2002:merge':\n                del node.value[index]\n                if isinstance(value_node, MappingNode):\n                    self.flatten_mapping(value_node)\n                    merge.extend(value_node.value)\n                elif isinstance(value_node, SequenceNode):\n                    submerge = []\n                    for subnode in value_node.value:\n                        if not isinstance(subnode, MappingNode):\n                            raise ConstructorError(\"while constructing a mapping\",\n                                    node.start_mark,\n                                    \"expected a mapping for merging, but found %s\"\n                                    % subnode.id, subnode.start_mark)\n                        self.flatten_mapping(subnode)\n                        submerge.append(subnode.value)\n                    submerge.reverse()\n                    for value in submerge:\n                        merge.extend(value)\n                else:\n                    raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                            \"expected a mapping or list of mappings for merging, but found %s\"\n                            % value_node.id, value_node.start_mark)\n            elif key_node.tag == 'tag:yaml.org,2002:value':\n                key_node.tag = 'tag:yaml.org,2002:str'\n                index += 1\n            else:\n                index += 1\n        if merge:\n            node.value = merge + node.value\n\n    def construct_mapping(self, node, deep=False):\n        if isinstance(node, MappingNode):\n            self.flatten_mapping(node)\n        return super().construct_mapping(node, deep=deep)\n\n    def construct_yaml_null(self, node):\n        self.construct_scalar(node)\n        return None\n\n    bool_values = {\n        'yes':      True,\n        'no':       False,\n        'true':     True,\n        'false':    False,\n        'on':       True,\n        'off':      False,\n    }\n\n    def construct_yaml_bool(self, node):\n        value = self.construct_scalar(node)\n        return self.bool_values[value.lower()]\n\n    def construct_yaml_int(self, node):\n        value = self.construct_scalar(node)\n        value = value.replace('_', '')\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '0':\n            return 0\n        elif value.startswith('0b'):\n            return sign*int(value[2:], 2)\n        elif value.startswith('0x'):\n            return sign*int(value[2:], 16)\n        elif value[0] == '0':\n            return sign*int(value, 8)\n        elif ':' in value:\n            digits = [int(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*int(value)\n\n    inf_value = 1e300\n    while inf_value != inf_value*inf_value:\n        inf_value *= inf_value\n    nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).\n\n    def construct_yaml_float(self, node):\n        value = self.construct_scalar(node)\n        value = value.replace('_', '').lower()\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '.inf':\n            return sign*self.inf_value\n        elif value == '.nan':\n            return self.nan_value\n        elif ':' in value:\n            digits = [float(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0.0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*float(value)\n\n    def construct_yaml_binary(self, node):\n        try:\n            value = self.construct_scalar(node).encode('ascii')\n        except UnicodeEncodeError as exc:\n            raise ConstructorError(None, None,\n                    \"failed to convert base64 data into ascii: %s\" % exc,\n                    node.start_mark)\n        try:\n            if hasattr(base64, 'decodebytes'):\n                return base64.decodebytes(value)\n            else:\n                return base64.decodestring(value)\n        except binascii.Error as exc:\n            raise ConstructorError(None, None,\n                    \"failed to decode base64 data: %s\" % exc, node.start_mark)\n\n    timestamp_regexp = re.compile(\n            r'''^(?P<year>[0-9][0-9][0-9][0-9])\n                -(?P<month>[0-9][0-9]?)\n                -(?P<day>[0-9][0-9]?)\n                (?:(?:[Tt]|[ \\t]+)\n                (?P<hour>[0-9][0-9]?)\n                :(?P<minute>[0-9][0-9])\n                :(?P<second>[0-9][0-9])\n                (?:\\.(?P<fraction>[0-9]*))?\n                (?:[ \\t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)\n                (?::(?P<tz_minute>[0-9][0-9]))?))?)?$''', re.X)\n\n    def construct_yaml_timestamp(self, node):\n        value = self.construct_scalar(node)\n        match = self.timestamp_regexp.match(node.value)\n        values = match.groupdict()\n        year = int(values['year'])\n        month = int(values['month'])\n        day = int(values['day'])\n        if not values['hour']:\n            return datetime.date(year, month, day)\n        hour = int(values['hour'])\n        minute = int(values['minute'])\n        second = int(values['second'])\n        fraction = 0\n        tzinfo = None\n        if values['fraction']:\n            fraction = values['fraction'][:6]\n            while len(fraction) < 6:\n                fraction += '0'\n            fraction = int(fraction)\n        if values['tz_sign']:\n            tz_hour = int(values['tz_hour'])\n            tz_minute = int(values['tz_minute'] or 0)\n            delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute)\n            if values['tz_sign'] == '-':\n                delta = -delta\n            tzinfo = datetime.timezone(delta)\n        elif values['tz']:\n            tzinfo = datetime.timezone.utc\n        return datetime.datetime(year, month, day, hour, minute, second, fraction,\n                                 tzinfo=tzinfo)\n\n    def construct_yaml_omap(self, node):\n        # Note: we do not check for duplicate keys, because it's too\n        # CPU-expensive.\n        omap = []\n        yield omap\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            omap.append((key, value))\n\n    def construct_yaml_pairs(self, node):\n        # Note: the same code as `construct_yaml_omap`.\n        pairs = []\n        yield pairs\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            pairs.append((key, value))\n\n    def construct_yaml_set(self, node):\n        data = set()\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_str(self, node):\n        return self.construct_scalar(node)\n\n    def construct_yaml_seq(self, node):\n        data = []\n        yield data\n        data.extend(self.construct_sequence(node))\n\n    def construct_yaml_map(self, node):\n        data = {}\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_object(self, node, cls):\n        data = cls.__new__(cls)\n        yield data\n        if hasattr(data, '__setstate__'):\n            state = self.construct_mapping(node, deep=True)\n            data.__setstate__(state)\n        else:\n            state = self.construct_mapping(node)\n            data.__dict__.update(state)\n\n    def construct_undefined(self, node):\n        raise ConstructorError(None, None,\n                \"could not determine a constructor for the tag %r\" % node.tag,\n                node.start_mark)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:null',\n        SafeConstructor.construct_yaml_null)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:bool',\n        SafeConstructor.construct_yaml_bool)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:int',\n        SafeConstructor.construct_yaml_int)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:float',\n        SafeConstructor.construct_yaml_float)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:binary',\n        SafeConstructor.construct_yaml_binary)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:timestamp',\n        SafeConstructor.construct_yaml_timestamp)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:omap',\n        SafeConstructor.construct_yaml_omap)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:pairs',\n        SafeConstructor.construct_yaml_pairs)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:set',\n        SafeConstructor.construct_yaml_set)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:str',\n        SafeConstructor.construct_yaml_str)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:seq',\n        SafeConstructor.construct_yaml_seq)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:map',\n        SafeConstructor.construct_yaml_map)\n\nSafeConstructor.add_constructor(None,\n        SafeConstructor.construct_undefined)\n\nclass FullConstructor(SafeConstructor):\n    # 'extend' is blacklisted because it is used by\n    # construct_python_object_apply to add `listitems` to a newly generate\n    # python instance\n    def get_state_keys_blacklist(self):\n        return ['^extend$', '^__.*__$']\n\n    def get_state_keys_blacklist_regexp(self):\n        if not hasattr(self, 'state_keys_blacklist_regexp'):\n            self.state_keys_blacklist_regexp = re.compile('(' + '|'.join(self.get_state_keys_blacklist()) + ')')\n        return self.state_keys_blacklist_regexp\n\n    def construct_python_str(self, node):\n        return self.construct_scalar(node)\n\n    def construct_python_unicode(self, node):\n        return self.construct_scalar(node)\n\n    def construct_python_bytes(self, node):\n        try:\n            value = self.construct_scalar(node).encode('ascii')\n        except UnicodeEncodeError as exc:\n            raise ConstructorError(None, None,\n                    \"failed to convert base64 data into ascii: %s\" % exc,\n                    node.start_mark)\n        try:\n            if hasattr(base64, 'decodebytes'):\n                return base64.decodebytes(value)\n            else:\n                return base64.decodestring(value)\n        except binascii.Error as exc:\n            raise ConstructorError(None, None,\n                    \"failed to decode base64 data: %s\" % exc, node.start_mark)\n\n    def construct_python_long(self, node):\n        return self.construct_yaml_int(node)\n\n    def construct_python_complex(self, node):\n       return complex(self.construct_scalar(node))\n\n    def construct_python_tuple(self, node):\n        return tuple(self.construct_sequence(node))\n\n    def find_python_module(self, name, mark, unsafe=False):\n        if not name:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        if unsafe:\n            try:\n                __import__(name)\n            except ImportError as exc:\n                raise ConstructorError(\"while constructing a Python module\", mark,\n                        \"cannot find module %r (%s)\" % (name, exc), mark)\n        if name not in sys.modules:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"module %r is not imported\" % name, mark)\n        return sys.modules[name]\n\n    def find_python_name(self, name, mark, unsafe=False):\n        if not name:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        if '.' in name:\n            module_name, object_name = name.rsplit('.', 1)\n        else:\n            module_name = 'builtins'\n            object_name = name\n        if unsafe:\n            try:\n                __import__(module_name)\n            except ImportError as exc:\n                raise ConstructorError(\"while constructing a Python object\", mark,\n                        \"cannot find module %r (%s)\" % (module_name, exc), mark)\n        if module_name not in sys.modules:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"module %r is not imported\" % module_name, mark)\n        module = sys.modules[module_name]\n        if not hasattr(module, object_name):\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"cannot find %r in the module %r\"\n                    % (object_name, module.__name__), mark)\n        return getattr(module, object_name)\n\n    def construct_python_name(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python name\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value, node.start_mark)\n        return self.find_python_name(suffix, node.start_mark)\n\n    def construct_python_module(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python module\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value, node.start_mark)\n        return self.find_python_module(suffix, node.start_mark)\n\n    def make_python_instance(self, suffix, node,\n            args=None, kwds=None, newobj=False, unsafe=False):\n        if not args:\n            args = []\n        if not kwds:\n            kwds = {}\n        cls = self.find_python_name(suffix, node.start_mark)\n        if not (unsafe or isinstance(cls, type)):\n            raise ConstructorError(\"while constructing a Python instance\", node.start_mark,\n                    \"expected a class, but found %r\" % type(cls),\n                    node.start_mark)\n        if newobj and isinstance(cls, type):\n            return cls.__new__(cls, *args, **kwds)\n        else:\n            return cls(*args, **kwds)\n\n    def set_python_instance_state(self, instance, state, unsafe=False):\n        if hasattr(instance, '__setstate__'):\n            instance.__setstate__(state)\n        else:\n            slotstate = {}\n            if isinstance(state, tuple) and len(state) == 2:\n                state, slotstate = state\n            if hasattr(instance, '__dict__'):\n                if not unsafe and state:\n                    for key in state.keys():\n                        self.check_state_key(key)\n                instance.__dict__.update(state)\n            elif state:\n                slotstate.update(state)\n            for key, value in slotstate.items():\n                if not unsafe:\n                    self.check_state_key(key)\n                setattr(instance, key, value)\n\n    def construct_python_object(self, suffix, node):\n        # Format:\n        #   !!python/object:module.name { ... state ... }\n        instance = self.make_python_instance(suffix, node, newobj=True)\n        yield instance\n        deep = hasattr(instance, '__setstate__')\n        state = self.construct_mapping(node, deep=deep)\n        self.set_python_instance_state(instance, state)\n\n    def construct_python_object_apply(self, suffix, node, newobj=False):\n        # Format:\n        #   !!python/object/apply       # (or !!python/object/new)\n        #   args: [ ... arguments ... ]\n        #   kwds: { ... keywords ... }\n        #   state: ... state ...\n        #   listitems: [ ... listitems ... ]\n        #   dictitems: { ... dictitems ... }\n        # or short format:\n        #   !!python/object/apply [ ... arguments ... ]\n        # The difference between !!python/object/apply and !!python/object/new\n        # is how an object is created, check make_python_instance for details.\n        if isinstance(node, SequenceNode):\n            args = self.construct_sequence(node, deep=True)\n            kwds = {}\n            state = {}\n            listitems = []\n            dictitems = {}\n        else:\n            value = self.construct_mapping(node, deep=True)\n            args = value.get('args', [])\n            kwds = value.get('kwds', {})\n            state = value.get('state', {})\n            listitems = value.get('listitems', [])\n            dictitems = value.get('dictitems', {})\n        instance = self.make_python_instance(suffix, node, args, kwds, newobj)\n        if state:\n            self.set_python_instance_state(instance, state)\n        if listitems:\n            instance.extend(listitems)\n        if dictitems:\n            for key in dictitems:\n                instance[key] = dictitems[key]\n        return instance\n\n    def construct_python_object_new(self, suffix, node):\n        return self.construct_python_object_apply(suffix, node, newobj=True)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/none',\n    FullConstructor.construct_yaml_null)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/bool',\n    FullConstructor.construct_yaml_bool)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/str',\n    FullConstructor.construct_python_str)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/unicode',\n    FullConstructor.construct_python_unicode)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/bytes',\n    FullConstructor.construct_python_bytes)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/int',\n    FullConstructor.construct_yaml_int)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/long',\n    FullConstructor.construct_python_long)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/float',\n    FullConstructor.construct_yaml_float)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/complex',\n    FullConstructor.construct_python_complex)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/list',\n    FullConstructor.construct_yaml_seq)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/tuple',\n    FullConstructor.construct_python_tuple)\n\nFullConstructor.add_constructor(\n    'tag:yaml.org,2002:python/dict',\n    FullConstructor.construct_yaml_map)\n\nFullConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/name:',\n    FullConstructor.construct_python_name)\n\nclass UnsafeConstructor(FullConstructor):\n\n    def find_python_module(self, name, mark):\n        return super(UnsafeConstructor, self).find_python_module(name, mark, unsafe=True)\n\n    def find_python_name(self, name, mark):\n        return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True)\n\n    def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False):\n        return super(UnsafeConstructor, self).make_python_instance(\n            suffix, node, args, kwds, newobj, unsafe=True)\n\n    def set_python_instance_state(self, instance, state):\n        return super(UnsafeConstructor, self).set_python_instance_state(\n            instance, state, unsafe=True)\n\nUnsafeConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/module:',\n    UnsafeConstructor.construct_python_module)\n\nUnsafeConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object:',\n    UnsafeConstructor.construct_python_object)\n\nUnsafeConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object/new:',\n    UnsafeConstructor.construct_python_object_new)\n\nUnsafeConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object/apply:',\n    UnsafeConstructor.construct_python_object_apply)\n\n# Constructor is same as UnsafeConstructor. Need to leave this in place in case\n# people have extended it directly.\nclass Constructor(UnsafeConstructor):\n    pass\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/cyaml.py",
    "content": "\n__all__ = [\n    'CBaseLoader', 'CSafeLoader', 'CFullLoader', 'CUnsafeLoader', 'CLoader',\n    'CBaseDumper', 'CSafeDumper', 'CDumper'\n]\n\nfrom yaml._yaml import CParser, CEmitter\n\nfrom .constructor import *\n\nfrom .serializer import *\nfrom .representer import *\n\nfrom .resolver import *\n\nclass CBaseLoader(CParser, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass CSafeLoader(CParser, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CFullLoader(CParser, FullConstructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        FullConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CUnsafeLoader(CParser, UnsafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        UnsafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CLoader(CParser, Constructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\nclass CSafeDumper(CEmitter, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\nclass CDumper(CEmitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/dumper.py",
    "content": "\n__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']\n\nfrom .emitter import *\nfrom .serializer import *\nfrom .representer import *\nfrom .resolver import *\n\nclass BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\nclass SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\nclass Dumper(Emitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=False,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None, sort_keys=True):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style, sort_keys=sort_keys)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/emitter.py",
    "content": "\n# Emitter expects events obeying the following grammar:\n# stream ::= STREAM-START document* STREAM-END\n# document ::= DOCUMENT-START node DOCUMENT-END\n# node ::= SCALAR | sequence | mapping\n# sequence ::= SEQUENCE-START node* SEQUENCE-END\n# mapping ::= MAPPING-START (node node)* MAPPING-END\n\n__all__ = ['Emitter', 'EmitterError']\n\nfrom .error import YAMLError\nfrom .events import *\n\nclass EmitterError(YAMLError):\n    pass\n\nclass ScalarAnalysis:\n    def __init__(self, scalar, empty, multiline,\n            allow_flow_plain, allow_block_plain,\n            allow_single_quoted, allow_double_quoted,\n            allow_block):\n        self.scalar = scalar\n        self.empty = empty\n        self.multiline = multiline\n        self.allow_flow_plain = allow_flow_plain\n        self.allow_block_plain = allow_block_plain\n        self.allow_single_quoted = allow_single_quoted\n        self.allow_double_quoted = allow_double_quoted\n        self.allow_block = allow_block\n\nclass Emitter:\n\n    DEFAULT_TAG_PREFIXES = {\n        '!' : '!',\n        'tag:yaml.org,2002:' : '!!',\n    }\n\n    def __init__(self, stream, canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None):\n\n        # The stream should have the methods `write` and possibly `flush`.\n        self.stream = stream\n\n        # Encoding can be overridden by STREAM-START.\n        self.encoding = None\n\n        # Emitter is a state machine with a stack of states to handle nested\n        # structures.\n        self.states = []\n        self.state = self.expect_stream_start\n\n        # Current event and the event queue.\n        self.events = []\n        self.event = None\n\n        # The current indentation level and the stack of previous indents.\n        self.indents = []\n        self.indent = None\n\n        # Flow level.\n        self.flow_level = 0\n\n        # Contexts.\n        self.root_context = False\n        self.sequence_context = False\n        self.mapping_context = False\n        self.simple_key_context = False\n\n        # Characteristics of the last emitted character:\n        #  - current position.\n        #  - is it a whitespace?\n        #  - is it an indention character\n        #    (indentation space, '-', '?', or ':')?\n        self.line = 0\n        self.column = 0\n        self.whitespace = True\n        self.indention = True\n\n        # Whether the document requires an explicit document indicator\n        self.open_ended = False\n\n        # Formatting details.\n        self.canonical = canonical\n        self.allow_unicode = allow_unicode\n        self.best_indent = 2\n        if indent and 1 < indent < 10:\n            self.best_indent = indent\n        self.best_width = 80\n        if width and width > self.best_indent*2:\n            self.best_width = width\n        self.best_line_break = '\\n'\n        if line_break in ['\\r', '\\n', '\\r\\n']:\n            self.best_line_break = line_break\n\n        # Tag prefixes.\n        self.tag_prefixes = None\n\n        # Prepared anchor and tag.\n        self.prepared_anchor = None\n        self.prepared_tag = None\n\n        # Scalar analysis and style.\n        self.analysis = None\n        self.style = None\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def emit(self, event):\n        self.events.append(event)\n        while not self.need_more_events():\n            self.event = self.events.pop(0)\n            self.state()\n            self.event = None\n\n    # In some cases, we wait for a few next events before emitting.\n\n    def need_more_events(self):\n        if not self.events:\n            return True\n        event = self.events[0]\n        if isinstance(event, DocumentStartEvent):\n            return self.need_events(1)\n        elif isinstance(event, SequenceStartEvent):\n            return self.need_events(2)\n        elif isinstance(event, MappingStartEvent):\n            return self.need_events(3)\n        else:\n            return False\n\n    def need_events(self, count):\n        level = 0\n        for event in self.events[1:]:\n            if isinstance(event, (DocumentStartEvent, CollectionStartEvent)):\n                level += 1\n            elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)):\n                level -= 1\n            elif isinstance(event, StreamEndEvent):\n                level = -1\n            if level < 0:\n                return False\n        return (len(self.events) < count+1)\n\n    def increase_indent(self, flow=False, indentless=False):\n        self.indents.append(self.indent)\n        if self.indent is None:\n            if flow:\n                self.indent = self.best_indent\n            else:\n                self.indent = 0\n        elif not indentless:\n            self.indent += self.best_indent\n\n    # States.\n\n    # Stream handlers.\n\n    def expect_stream_start(self):\n        if isinstance(self.event, StreamStartEvent):\n            if self.event.encoding and not hasattr(self.stream, 'encoding'):\n                self.encoding = self.event.encoding\n            self.write_stream_start()\n            self.state = self.expect_first_document_start\n        else:\n            raise EmitterError(\"expected StreamStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_nothing(self):\n        raise EmitterError(\"expected nothing, but got %s\" % self.event)\n\n    # Document handlers.\n\n    def expect_first_document_start(self):\n        return self.expect_document_start(first=True)\n\n    def expect_document_start(self, first=False):\n        if isinstance(self.event, DocumentStartEvent):\n            if (self.event.version or self.event.tags) and self.open_ended:\n                self.write_indicator('...', True)\n                self.write_indent()\n            if self.event.version:\n                version_text = self.prepare_version(self.event.version)\n                self.write_version_directive(version_text)\n            self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy()\n            if self.event.tags:\n                handles = sorted(self.event.tags.keys())\n                for handle in handles:\n                    prefix = self.event.tags[handle]\n                    self.tag_prefixes[prefix] = handle\n                    handle_text = self.prepare_tag_handle(handle)\n                    prefix_text = self.prepare_tag_prefix(prefix)\n                    self.write_tag_directive(handle_text, prefix_text)\n            implicit = (first and not self.event.explicit and not self.canonical\n                    and not self.event.version and not self.event.tags\n                    and not self.check_empty_document())\n            if not implicit:\n                self.write_indent()\n                self.write_indicator('---', True)\n                if self.canonical:\n                    self.write_indent()\n            self.state = self.expect_document_root\n        elif isinstance(self.event, StreamEndEvent):\n            if self.open_ended:\n                self.write_indicator('...', True)\n                self.write_indent()\n            self.write_stream_end()\n            self.state = self.expect_nothing\n        else:\n            raise EmitterError(\"expected DocumentStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_end(self):\n        if isinstance(self.event, DocumentEndEvent):\n            self.write_indent()\n            if self.event.explicit:\n                self.write_indicator('...', True)\n                self.write_indent()\n            self.flush_stream()\n            self.state = self.expect_document_start\n        else:\n            raise EmitterError(\"expected DocumentEndEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_root(self):\n        self.states.append(self.expect_document_end)\n        self.expect_node(root=True)\n\n    # Node handlers.\n\n    def expect_node(self, root=False, sequence=False, mapping=False,\n            simple_key=False):\n        self.root_context = root\n        self.sequence_context = sequence\n        self.mapping_context = mapping\n        self.simple_key_context = simple_key\n        if isinstance(self.event, AliasEvent):\n            self.expect_alias()\n        elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)):\n            self.process_anchor('&')\n            self.process_tag()\n            if isinstance(self.event, ScalarEvent):\n                self.expect_scalar()\n            elif isinstance(self.event, SequenceStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_sequence():\n                    self.expect_flow_sequence()\n                else:\n                    self.expect_block_sequence()\n            elif isinstance(self.event, MappingStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_mapping():\n                    self.expect_flow_mapping()\n                else:\n                    self.expect_block_mapping()\n        else:\n            raise EmitterError(\"expected NodeEvent, but got %s\" % self.event)\n\n    def expect_alias(self):\n        if self.event.anchor is None:\n            raise EmitterError(\"anchor is not specified for alias\")\n        self.process_anchor('*')\n        self.state = self.states.pop()\n\n    def expect_scalar(self):\n        self.increase_indent(flow=True)\n        self.process_scalar()\n        self.indent = self.indents.pop()\n        self.state = self.states.pop()\n\n    # Flow sequence handlers.\n\n    def expect_flow_sequence(self):\n        self.write_indicator('[', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_sequence_item\n\n    def expect_first_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator(']', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    def expect_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(',', False)\n                self.write_indent()\n            self.write_indicator(']', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Flow mapping handlers.\n\n    def expect_flow_mapping(self):\n        self.write_indicator('{', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_mapping_key\n\n    def expect_first_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator('}', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(',', False)\n                self.write_indent()\n            self.write_indicator('}', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_simple_value(self):\n        self.write_indicator(':', False)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_flow_mapping_value(self):\n        if self.canonical or self.column > self.best_width:\n            self.write_indent()\n        self.write_indicator(':', True)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Block sequence handlers.\n\n    def expect_block_sequence(self):\n        indentless = (self.mapping_context and not self.indention)\n        self.increase_indent(flow=False, indentless=indentless)\n        self.state = self.expect_first_block_sequence_item\n\n    def expect_first_block_sequence_item(self):\n        return self.expect_block_sequence_item(first=True)\n\n    def expect_block_sequence_item(self, first=False):\n        if not first and isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            self.write_indicator('-', True, indention=True)\n            self.states.append(self.expect_block_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Block mapping handlers.\n\n    def expect_block_mapping(self):\n        self.increase_indent(flow=False)\n        self.state = self.expect_first_block_mapping_key\n\n    def expect_first_block_mapping_key(self):\n        return self.expect_block_mapping_key(first=True)\n\n    def expect_block_mapping_key(self, first=False):\n        if not first and isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            if self.check_simple_key():\n                self.states.append(self.expect_block_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True, indention=True)\n                self.states.append(self.expect_block_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_block_mapping_simple_value(self):\n        self.write_indicator(':', False)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_block_mapping_value(self):\n        self.write_indent()\n        self.write_indicator(':', True, indention=True)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Checkers.\n\n    def check_empty_sequence(self):\n        return (isinstance(self.event, SequenceStartEvent) and self.events\n                and isinstance(self.events[0], SequenceEndEvent))\n\n    def check_empty_mapping(self):\n        return (isinstance(self.event, MappingStartEvent) and self.events\n                and isinstance(self.events[0], MappingEndEvent))\n\n    def check_empty_document(self):\n        if not isinstance(self.event, DocumentStartEvent) or not self.events:\n            return False\n        event = self.events[0]\n        return (isinstance(event, ScalarEvent) and event.anchor is None\n                and event.tag is None and event.implicit and event.value == '')\n\n    def check_simple_key(self):\n        length = 0\n        if isinstance(self.event, NodeEvent) and self.event.anchor is not None:\n            if self.prepared_anchor is None:\n                self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n            length += len(self.prepared_anchor)\n        if isinstance(self.event, (ScalarEvent, CollectionStartEvent))  \\\n                and self.event.tag is not None:\n            if self.prepared_tag is None:\n                self.prepared_tag = self.prepare_tag(self.event.tag)\n            length += len(self.prepared_tag)\n        if isinstance(self.event, ScalarEvent):\n            if self.analysis is None:\n                self.analysis = self.analyze_scalar(self.event.value)\n            length += len(self.analysis.scalar)\n        return (length < 128 and (isinstance(self.event, AliasEvent)\n            or (isinstance(self.event, ScalarEvent)\n                    and not self.analysis.empty and not self.analysis.multiline)\n            or self.check_empty_sequence() or self.check_empty_mapping()))\n\n    # Anchor, Tag, and Scalar processors.\n\n    def process_anchor(self, indicator):\n        if self.event.anchor is None:\n            self.prepared_anchor = None\n            return\n        if self.prepared_anchor is None:\n            self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n        if self.prepared_anchor:\n            self.write_indicator(indicator+self.prepared_anchor, True)\n        self.prepared_anchor = None\n\n    def process_tag(self):\n        tag = self.event.tag\n        if isinstance(self.event, ScalarEvent):\n            if self.style is None:\n                self.style = self.choose_scalar_style()\n            if ((not self.canonical or tag is None) and\n                ((self.style == '' and self.event.implicit[0])\n                        or (self.style != '' and self.event.implicit[1]))):\n                self.prepared_tag = None\n                return\n            if self.event.implicit[0] and tag is None:\n                tag = '!'\n                self.prepared_tag = None\n        else:\n            if (not self.canonical or tag is None) and self.event.implicit:\n                self.prepared_tag = None\n                return\n        if tag is None:\n            raise EmitterError(\"tag is not specified\")\n        if self.prepared_tag is None:\n            self.prepared_tag = self.prepare_tag(tag)\n        if self.prepared_tag:\n            self.write_indicator(self.prepared_tag, True)\n        self.prepared_tag = None\n\n    def choose_scalar_style(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.event.style == '\"' or self.canonical:\n            return '\"'\n        if not self.event.style and self.event.implicit[0]:\n            if (not (self.simple_key_context and\n                    (self.analysis.empty or self.analysis.multiline))\n                and (self.flow_level and self.analysis.allow_flow_plain\n                    or (not self.flow_level and self.analysis.allow_block_plain))):\n                return ''\n        if self.event.style and self.event.style in '|>':\n            if (not self.flow_level and not self.simple_key_context\n                    and self.analysis.allow_block):\n                return self.event.style\n        if not self.event.style or self.event.style == '\\'':\n            if (self.analysis.allow_single_quoted and\n                    not (self.simple_key_context and self.analysis.multiline)):\n                return '\\''\n        return '\"'\n\n    def process_scalar(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.style is None:\n            self.style = self.choose_scalar_style()\n        split = (not self.simple_key_context)\n        #if self.analysis.multiline and split    \\\n        #        and (not self.style or self.style in '\\'\\\"'):\n        #    self.write_indent()\n        if self.style == '\"':\n            self.write_double_quoted(self.analysis.scalar, split)\n        elif self.style == '\\'':\n            self.write_single_quoted(self.analysis.scalar, split)\n        elif self.style == '>':\n            self.write_folded(self.analysis.scalar)\n        elif self.style == '|':\n            self.write_literal(self.analysis.scalar)\n        else:\n            self.write_plain(self.analysis.scalar, split)\n        self.analysis = None\n        self.style = None\n\n    # Analyzers.\n\n    def prepare_version(self, version):\n        major, minor = version\n        if major != 1:\n            raise EmitterError(\"unsupported YAML version: %d.%d\" % (major, minor))\n        return '%d.%d' % (major, minor)\n\n    def prepare_tag_handle(self, handle):\n        if not handle:\n            raise EmitterError(\"tag handle must not be empty\")\n        if handle[0] != '!' or handle[-1] != '!':\n            raise EmitterError(\"tag handle must start and end with '!': %r\" % handle)\n        for ch in handle[1:-1]:\n            if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'    \\\n                    or ch in '-_'):\n                raise EmitterError(\"invalid character %r in the tag handle: %r\"\n                        % (ch, handle))\n        return handle\n\n    def prepare_tag_prefix(self, prefix):\n        if not prefix:\n            raise EmitterError(\"tag prefix must not be empty\")\n        chunks = []\n        start = end = 0\n        if prefix[0] == '!':\n            end = 1\n        while end < len(prefix):\n            ch = prefix[end]\n            if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \\\n                    or ch in '-;/?!:@&=+$,_.~*\\'()[]':\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(prefix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append('%%%02X' % ord(ch))\n        if start < end:\n            chunks.append(prefix[start:end])\n        return ''.join(chunks)\n\n    def prepare_tag(self, tag):\n        if not tag:\n            raise EmitterError(\"tag must not be empty\")\n        if tag == '!':\n            return tag\n        handle = None\n        suffix = tag\n        prefixes = sorted(self.tag_prefixes.keys())\n        for prefix in prefixes:\n            if tag.startswith(prefix)   \\\n                    and (prefix == '!' or len(prefix) < len(tag)):\n                handle = self.tag_prefixes[prefix]\n                suffix = tag[len(prefix):]\n        chunks = []\n        start = end = 0\n        while end < len(suffix):\n            ch = suffix[end]\n            if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \\\n                    or ch in '-;/?:@&=+$,_.~*\\'()[]'   \\\n                    or (ch == '!' and handle != '!'):\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(suffix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append('%%%02X' % ch)\n        if start < end:\n            chunks.append(suffix[start:end])\n        suffix_text = ''.join(chunks)\n        if handle:\n            return '%s%s' % (handle, suffix_text)\n        else:\n            return '!<%s>' % suffix_text\n\n    def prepare_anchor(self, anchor):\n        if not anchor:\n            raise EmitterError(\"anchor must not be empty\")\n        for ch in anchor:\n            if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'    \\\n                    or ch in '-_'):\n                raise EmitterError(\"invalid character %r in the anchor: %r\"\n                        % (ch, anchor))\n        return anchor\n\n    def analyze_scalar(self, scalar):\n\n        # Empty scalar is a special case.\n        if not scalar:\n            return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,\n                    allow_flow_plain=False, allow_block_plain=True,\n                    allow_single_quoted=True, allow_double_quoted=True,\n                    allow_block=False)\n\n        # Indicators and special characters.\n        block_indicators = False\n        flow_indicators = False\n        line_breaks = False\n        special_characters = False\n\n        # Important whitespace combinations.\n        leading_space = False\n        leading_break = False\n        trailing_space = False\n        trailing_break = False\n        break_space = False\n        space_break = False\n\n        # Check document indicators.\n        if scalar.startswith('---') or scalar.startswith('...'):\n            block_indicators = True\n            flow_indicators = True\n\n        # First character or preceded by a whitespace.\n        preceded_by_whitespace = True\n\n        # Last character or followed by a whitespace.\n        followed_by_whitespace = (len(scalar) == 1 or\n                scalar[1] in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # The previous character is a space.\n        previous_space = False\n\n        # The previous character is a break.\n        previous_break = False\n\n        index = 0\n        while index < len(scalar):\n            ch = scalar[index]\n\n            # Check for indicators.\n            if index == 0:\n                # Leading indicators are special characters.\n                if ch in '#,[]{}&*!|>\\'\\\"%@`':\n                    flow_indicators = True\n                    block_indicators = True\n                if ch in '?:':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == '-' and followed_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n            else:\n                # Some indicators cannot appear within a scalar as well.\n                if ch in ',?[]{}':\n                    flow_indicators = True\n                if ch == ':':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == '#' and preceded_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n\n            # Check for line breaks, special, and unicode characters.\n            if ch in '\\n\\x85\\u2028\\u2029':\n                line_breaks = True\n            if not (ch == '\\n' or '\\x20' <= ch <= '\\x7E'):\n                if (ch == '\\x85' or '\\xA0' <= ch <= '\\uD7FF'\n                        or '\\uE000' <= ch <= '\\uFFFD'\n                        or '\\U00010000' <= ch < '\\U0010ffff') and ch != '\\uFEFF':\n                    unicode_characters = True\n                    if not self.allow_unicode:\n                        special_characters = True\n                else:\n                    special_characters = True\n\n            # Detect important whitespace combinations.\n            if ch == ' ':\n                if index == 0:\n                    leading_space = True\n                if index == len(scalar)-1:\n                    trailing_space = True\n                if previous_break:\n                    break_space = True\n                previous_space = True\n                previous_break = False\n            elif ch in '\\n\\x85\\u2028\\u2029':\n                if index == 0:\n                    leading_break = True\n                if index == len(scalar)-1:\n                    trailing_break = True\n                if previous_space:\n                    space_break = True\n                previous_space = False\n                previous_break = True\n            else:\n                previous_space = False\n                previous_break = False\n\n            # Prepare for the next character.\n            index += 1\n            preceded_by_whitespace = (ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n            followed_by_whitespace = (index+1 >= len(scalar) or\n                    scalar[index+1] in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # Let's decide what styles are allowed.\n        allow_flow_plain = True\n        allow_block_plain = True\n        allow_single_quoted = True\n        allow_double_quoted = True\n        allow_block = True\n\n        # Leading and trailing whitespaces are bad for plain scalars.\n        if (leading_space or leading_break\n                or trailing_space or trailing_break):\n            allow_flow_plain = allow_block_plain = False\n\n        # We do not permit trailing spaces for block scalars.\n        if trailing_space:\n            allow_block = False\n\n        # Spaces at the beginning of a new line are only acceptable for block\n        # scalars.\n        if break_space:\n            allow_flow_plain = allow_block_plain = allow_single_quoted = False\n\n        # Spaces followed by breaks, as well as special character are only\n        # allowed for double quoted scalars.\n        if space_break or special_characters:\n            allow_flow_plain = allow_block_plain =  \\\n            allow_single_quoted = allow_block = False\n\n        # Although the plain scalar writer supports breaks, we never emit\n        # multiline plain scalars.\n        if line_breaks:\n            allow_flow_plain = allow_block_plain = False\n\n        # Flow indicators are forbidden for flow plain scalars.\n        if flow_indicators:\n            allow_flow_plain = False\n\n        # Block indicators are forbidden for block plain scalars.\n        if block_indicators:\n            allow_block_plain = False\n\n        return ScalarAnalysis(scalar=scalar,\n                empty=False, multiline=line_breaks,\n                allow_flow_plain=allow_flow_plain,\n                allow_block_plain=allow_block_plain,\n                allow_single_quoted=allow_single_quoted,\n                allow_double_quoted=allow_double_quoted,\n                allow_block=allow_block)\n\n    # Writers.\n\n    def flush_stream(self):\n        if hasattr(self.stream, 'flush'):\n            self.stream.flush()\n\n    def write_stream_start(self):\n        # Write BOM if needed.\n        if self.encoding and self.encoding.startswith('utf-16'):\n            self.stream.write('\\uFEFF'.encode(self.encoding))\n\n    def write_stream_end(self):\n        self.flush_stream()\n\n    def write_indicator(self, indicator, need_whitespace,\n            whitespace=False, indention=False):\n        if self.whitespace or not need_whitespace:\n            data = indicator\n        else:\n            data = ' '+indicator\n        self.whitespace = whitespace\n        self.indention = self.indention and indention\n        self.column += len(data)\n        self.open_ended = False\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_indent(self):\n        indent = self.indent or 0\n        if not self.indention or self.column > indent   \\\n                or (self.column == indent and not self.whitespace):\n            self.write_line_break()\n        if self.column < indent:\n            self.whitespace = True\n            data = ' '*(indent-self.column)\n            self.column = indent\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n\n    def write_line_break(self, data=None):\n        if data is None:\n            data = self.best_line_break\n        self.whitespace = True\n        self.indention = True\n        self.line += 1\n        self.column = 0\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_version_directive(self, version_text):\n        data = '%%YAML %s' % version_text\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    def write_tag_directive(self, handle_text, prefix_text):\n        data = '%%TAG %s %s' % (handle_text, prefix_text)\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    # Scalar streams.\n\n    def write_single_quoted(self, text, split=True):\n        self.write_indicator('\\'', True)\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch is None or ch != ' ':\n                    if start+1 == end and self.column > self.best_width and split   \\\n                            and start != 0 and end != len(text):\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    if text[start] == '\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029' or ch == '\\'':\n                    if start < end:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                        start = end\n            if ch == '\\'':\n                data = '\\'\\''\n                self.column += 2\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                start = end + 1\n            if ch is not None:\n                spaces = (ch == ' ')\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n        self.write_indicator('\\'', False)\n\n    ESCAPE_REPLACEMENTS = {\n        '\\0':       '0',\n        '\\x07':     'a',\n        '\\x08':     'b',\n        '\\x09':     't',\n        '\\x0A':     'n',\n        '\\x0B':     'v',\n        '\\x0C':     'f',\n        '\\x0D':     'r',\n        '\\x1B':     'e',\n        '\\\"':       '\\\"',\n        '\\\\':       '\\\\',\n        '\\x85':     'N',\n        '\\xA0':     '_',\n        '\\u2028':   'L',\n        '\\u2029':   'P',\n    }\n\n    def write_double_quoted(self, text, split=True):\n        self.write_indicator('\"', True)\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if ch is None or ch in '\"\\\\\\x85\\u2028\\u2029\\uFEFF' \\\n                    or not ('\\x20' <= ch <= '\\x7E'\n                        or (self.allow_unicode\n                            and ('\\xA0' <= ch <= '\\uD7FF'\n                                or '\\uE000' <= ch <= '\\uFFFD'))):\n                if start < end:\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n                if ch is not None:\n                    if ch in self.ESCAPE_REPLACEMENTS:\n                        data = '\\\\'+self.ESCAPE_REPLACEMENTS[ch]\n                    elif ch <= '\\xFF':\n                        data = '\\\\x%02X' % ord(ch)\n                    elif ch <= '\\uFFFF':\n                        data = '\\\\u%04X' % ord(ch)\n                    else:\n                        data = '\\\\U%08X' % ord(ch)\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end+1\n            if 0 < end < len(text)-1 and (ch == ' ' or start >= end)    \\\n                    and self.column+(end-start) > self.best_width and split:\n                data = text[start:end]+'\\\\'\n                if start < end:\n                    start = end\n                self.column += len(data)\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                self.write_indent()\n                self.whitespace = False\n                self.indention = False\n                if text[start] == ' ':\n                    data = '\\\\'\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n            end += 1\n        self.write_indicator('\"', False)\n\n    def determine_block_hints(self, text):\n        hints = ''\n        if text:\n            if text[0] in ' \\n\\x85\\u2028\\u2029':\n                hints += str(self.best_indent)\n            if text[-1] not in '\\n\\x85\\u2028\\u2029':\n                hints += '-'\n            elif len(text) == 1 or text[-2] in '\\n\\x85\\u2028\\u2029':\n                hints += '+'\n        return hints\n\n    def write_folded(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator('>'+hints, True)\n        if hints[-1:] == '+':\n            self.open_ended = True\n        self.write_line_break()\n        leading_space = True\n        spaces = False\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    if not leading_space and ch is not None and ch != ' '   \\\n                            and text[start] == '\\n':\n                        self.write_line_break()\n                    leading_space = (ch == ' ')\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            elif spaces:\n                if ch != ' ':\n                    if start+1 == end and self.column > self.best_width:\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n                spaces = (ch == ' ')\n            end += 1\n\n    def write_literal(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator('|'+hints, True)\n        if hints[-1:] == '+':\n            self.open_ended = True\n        self.write_line_break()\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in '\\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n\n    def write_plain(self, text, split=True):\n        if self.root_context:\n            self.open_ended = True\n        if not text:\n            return\n        if not self.whitespace:\n            data = ' '\n            self.column += len(data)\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n        self.whitespace = False\n        self.indention = False\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch != ' ':\n                    if start+1 == end and self.column > self.best_width and split:\n                        self.write_indent()\n                        self.whitespace = False\n                        self.indention = False\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch not in '\\n\\x85\\u2028\\u2029':\n                    if text[start] == '\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    self.whitespace = False\n                    self.indention = False\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n            if ch is not None:\n                spaces = (ch == ' ')\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/error.py",
    "content": "\n__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']\n\nclass Mark:\n\n    def __init__(self, name, index, line, column, buffer, pointer):\n        self.name = name\n        self.index = index\n        self.line = line\n        self.column = column\n        self.buffer = buffer\n        self.pointer = pointer\n\n    def get_snippet(self, indent=4, max_length=75):\n        if self.buffer is None:\n            return None\n        head = ''\n        start = self.pointer\n        while start > 0 and self.buffer[start-1] not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            start -= 1\n            if self.pointer-start > max_length/2-1:\n                head = ' ... '\n                start += 5\n                break\n        tail = ''\n        end = self.pointer\n        while end < len(self.buffer) and self.buffer[end] not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            end += 1\n            if end-self.pointer > max_length/2-1:\n                tail = ' ... '\n                end -= 5\n                break\n        snippet = self.buffer[start:end]\n        return ' '*indent + head + snippet + tail + '\\n'  \\\n                + ' '*(indent+self.pointer-start+len(head)) + '^'\n\n    def __str__(self):\n        snippet = self.get_snippet()\n        where = \"  in \\\"%s\\\", line %d, column %d\"   \\\n                % (self.name, self.line+1, self.column+1)\n        if snippet is not None:\n            where += \":\\n\"+snippet\n        return where\n\nclass YAMLError(Exception):\n    pass\n\nclass MarkedYAMLError(YAMLError):\n\n    def __init__(self, context=None, context_mark=None,\n            problem=None, problem_mark=None, note=None):\n        self.context = context\n        self.context_mark = context_mark\n        self.problem = problem\n        self.problem_mark = problem_mark\n        self.note = note\n\n    def __str__(self):\n        lines = []\n        if self.context is not None:\n            lines.append(self.context)\n        if self.context_mark is not None  \\\n            and (self.problem is None or self.problem_mark is None\n                    or self.context_mark.name != self.problem_mark.name\n                    or self.context_mark.line != self.problem_mark.line\n                    or self.context_mark.column != self.problem_mark.column):\n            lines.append(str(self.context_mark))\n        if self.problem is not None:\n            lines.append(self.problem)\n        if self.problem_mark is not None:\n            lines.append(str(self.problem_mark))\n        if self.note is not None:\n            lines.append(self.note)\n        return '\\n'.join(lines)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/events.py",
    "content": "\n# Abstract classes.\n\nclass Event(object):\n    def __init__(self, start_mark=None, end_mark=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']\n                if hasattr(self, key)]\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\nclass NodeEvent(Event):\n    def __init__(self, anchor, start_mark=None, end_mark=None):\n        self.anchor = anchor\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass CollectionStartEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,\n            flow_style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass CollectionEndEvent(Event):\n    pass\n\n# Implementations.\n\nclass StreamStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None, encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndEvent(Event):\n    pass\n\nclass DocumentStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None, version=None, tags=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n        self.version = version\n        self.tags = tags\n\nclass DocumentEndEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n\nclass AliasEvent(NodeEvent):\n    pass\n\nclass ScalarEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, value,\n            start_mark=None, end_mark=None, style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass SequenceStartEvent(CollectionStartEvent):\n    pass\n\nclass SequenceEndEvent(CollectionEndEvent):\n    pass\n\nclass MappingStartEvent(CollectionStartEvent):\n    pass\n\nclass MappingEndEvent(CollectionEndEvent):\n    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/loader.py",
    "content": "\n__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader']\n\nfrom .reader import *\nfrom .scanner import *\nfrom .parser import *\nfrom .composer import *\nfrom .constructor import *\nfrom .resolver import *\n\nclass BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        FullConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\n# UnsafeLoader is the same as Loader (which is and was always unsafe on\n# untrusted input). Use of either Loader or UnsafeLoader should be rare, since\n# FullLoad should be able to load almost all YAML safely. Loader is left intact\n# to ensure backwards compatibility.\nclass UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/nodes.py",
    "content": "\nclass Node(object):\n    def __init__(self, tag, value, start_mark, end_mark):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        value = self.value\n        #if isinstance(value, list):\n        #    if len(value) == 0:\n        #        value = '<empty>'\n        #    elif len(value) == 1:\n        #        value = '<1 item>'\n        #    else:\n        #        value = '<%d items>' % len(value)\n        #else:\n        #    if len(value) > 75:\n        #        value = repr(value[:70]+u' ... ')\n        #    else:\n        #        value = repr(value)\n        value = repr(value)\n        return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)\n\nclass ScalarNode(Node):\n    id = 'scalar'\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass CollectionNode(Node):\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, flow_style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass SequenceNode(CollectionNode):\n    id = 'sequence'\n\nclass MappingNode(CollectionNode):\n    id = 'mapping'\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/parser.py",
    "content": "\n# The following YAML grammar is LL(1) and is parsed by a recursive descent\n# parser.\n#\n# stream            ::= STREAM-START implicit_document? explicit_document* STREAM-END\n# implicit_document ::= block_node DOCUMENT-END*\n# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n# block_node_or_indentless_sequence ::=\n#                       ALIAS\n#                       | properties (block_content | indentless_block_sequence)?\n#                       | block_content\n#                       | indentless_block_sequence\n# block_node        ::= ALIAS\n#                       | properties block_content?\n#                       | block_content\n# flow_node         ::= ALIAS\n#                       | properties flow_content?\n#                       | flow_content\n# properties        ::= TAG ANCHOR? | ANCHOR TAG?\n# block_content     ::= block_collection | flow_collection | SCALAR\n# flow_content      ::= flow_collection | SCALAR\n# block_collection  ::= block_sequence | block_mapping\n# flow_collection   ::= flow_sequence | flow_mapping\n# block_sequence    ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n# indentless_sequence   ::= (BLOCK-ENTRY block_node?)+\n# block_mapping     ::= BLOCK-MAPPING_START\n#                       ((KEY block_node_or_indentless_sequence?)?\n#                       (VALUE block_node_or_indentless_sequence?)?)*\n#                       BLOCK-END\n# flow_sequence     ::= FLOW-SEQUENCE-START\n#                       (flow_sequence_entry FLOW-ENTRY)*\n#                       flow_sequence_entry?\n#                       FLOW-SEQUENCE-END\n# flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n# flow_mapping      ::= FLOW-MAPPING-START\n#                       (flow_mapping_entry FLOW-ENTRY)*\n#                       flow_mapping_entry?\n#                       FLOW-MAPPING-END\n# flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n#\n# FIRST sets:\n#\n# stream: { STREAM-START }\n# explicit_document: { DIRECTIVE DOCUMENT-START }\n# implicit_document: FIRST(block_node)\n# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_sequence: { BLOCK-SEQUENCE-START }\n# block_mapping: { BLOCK-MAPPING-START }\n# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY }\n# indentless_sequence: { ENTRY }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_sequence: { FLOW-SEQUENCE-START }\n# flow_mapping: { FLOW-MAPPING-START }\n# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n\n__all__ = ['Parser', 'ParserError']\n\nfrom .error import MarkedYAMLError\nfrom .tokens import *\nfrom .events import *\nfrom .scanner import *\n\nclass ParserError(MarkedYAMLError):\n    pass\n\nclass Parser:\n    # Since writing a recursive-descendant parser is a straightforward task, we\n    # do not give many comments here.\n\n    DEFAULT_TAGS = {\n        '!':   '!',\n        '!!':  'tag:yaml.org,2002:',\n    }\n\n    def __init__(self):\n        self.current_event = None\n        self.yaml_version = None\n        self.tag_handles = {}\n        self.states = []\n        self.marks = []\n        self.state = self.parse_stream_start\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def check_event(self, *choices):\n        # Check the type of the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        if self.current_event is not None:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.current_event, choice):\n                    return True\n        return False\n\n    def peek_event(self):\n        # Get the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        return self.current_event\n\n    def get_event(self):\n        # Get the next event and proceed further.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        value = self.current_event\n        self.current_event = None\n        return value\n\n    # stream    ::= STREAM-START implicit_document? explicit_document* STREAM-END\n    # implicit_document ::= block_node DOCUMENT-END*\n    # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n\n    def parse_stream_start(self):\n\n        # Parse the stream start.\n        token = self.get_token()\n        event = StreamStartEvent(token.start_mark, token.end_mark,\n                encoding=token.encoding)\n\n        # Prepare the next state.\n        self.state = self.parse_implicit_document_start\n\n        return event\n\n    def parse_implicit_document_start(self):\n\n        # Parse an implicit document.\n        if not self.check_token(DirectiveToken, DocumentStartToken,\n                StreamEndToken):\n            self.tag_handles = self.DEFAULT_TAGS\n            token = self.peek_token()\n            start_mark = end_mark = token.start_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=False)\n\n            # Prepare the next state.\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_block_node\n\n            return event\n\n        else:\n            return self.parse_document_start()\n\n    def parse_document_start(self):\n\n        # Parse any extra document end indicators.\n        while self.check_token(DocumentEndToken):\n            self.get_token()\n\n        # Parse an explicit document.\n        if not self.check_token(StreamEndToken):\n            token = self.peek_token()\n            start_mark = token.start_mark\n            version, tags = self.process_directives()\n            if not self.check_token(DocumentStartToken):\n                raise ParserError(None, None,\n                        \"expected '<document start>', but found %r\"\n                        % self.peek_token().id,\n                        self.peek_token().start_mark)\n            token = self.get_token()\n            end_mark = token.end_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=True, version=version, tags=tags)\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_document_content\n        else:\n            # Parse the end of the stream.\n            token = self.get_token()\n            event = StreamEndEvent(token.start_mark, token.end_mark)\n            assert not self.states\n            assert not self.marks\n            self.state = None\n        return event\n\n    def parse_document_end(self):\n\n        # Parse the document end.\n        token = self.peek_token()\n        start_mark = end_mark = token.start_mark\n        explicit = False\n        if self.check_token(DocumentEndToken):\n            token = self.get_token()\n            end_mark = token.end_mark\n            explicit = True\n        event = DocumentEndEvent(start_mark, end_mark,\n                explicit=explicit)\n\n        # Prepare the next state.\n        self.state = self.parse_document_start\n\n        return event\n\n    def parse_document_content(self):\n        if self.check_token(DirectiveToken,\n                DocumentStartToken, DocumentEndToken, StreamEndToken):\n            event = self.process_empty_scalar(self.peek_token().start_mark)\n            self.state = self.states.pop()\n            return event\n        else:\n            return self.parse_block_node()\n\n    def process_directives(self):\n        self.yaml_version = None\n        self.tag_handles = {}\n        while self.check_token(DirectiveToken):\n            token = self.get_token()\n            if token.name == 'YAML':\n                if self.yaml_version is not None:\n                    raise ParserError(None, None,\n                            \"found duplicate YAML directive\", token.start_mark)\n                major, minor = token.value\n                if major != 1:\n                    raise ParserError(None, None,\n                            \"found incompatible YAML document (version 1.* is required)\",\n                            token.start_mark)\n                self.yaml_version = token.value\n            elif token.name == 'TAG':\n                handle, prefix = token.value\n                if handle in self.tag_handles:\n                    raise ParserError(None, None,\n                            \"duplicate tag handle %r\" % handle,\n                            token.start_mark)\n                self.tag_handles[handle] = prefix\n        if self.tag_handles:\n            value = self.yaml_version, self.tag_handles.copy()\n        else:\n            value = self.yaml_version, None\n        for key in self.DEFAULT_TAGS:\n            if key not in self.tag_handles:\n                self.tag_handles[key] = self.DEFAULT_TAGS[key]\n        return value\n\n    # block_node_or_indentless_sequence ::= ALIAS\n    #               | properties (block_content | indentless_block_sequence)?\n    #               | block_content\n    #               | indentless_block_sequence\n    # block_node    ::= ALIAS\n    #                   | properties block_content?\n    #                   | block_content\n    # flow_node     ::= ALIAS\n    #                   | properties flow_content?\n    #                   | flow_content\n    # properties    ::= TAG ANCHOR? | ANCHOR TAG?\n    # block_content     ::= block_collection | flow_collection | SCALAR\n    # flow_content      ::= flow_collection | SCALAR\n    # block_collection  ::= block_sequence | block_mapping\n    # flow_collection   ::= flow_sequence | flow_mapping\n\n    def parse_block_node(self):\n        return self.parse_node(block=True)\n\n    def parse_flow_node(self):\n        return self.parse_node()\n\n    def parse_block_node_or_indentless_sequence(self):\n        return self.parse_node(block=True, indentless_sequence=True)\n\n    def parse_node(self, block=False, indentless_sequence=False):\n        if self.check_token(AliasToken):\n            token = self.get_token()\n            event = AliasEvent(token.value, token.start_mark, token.end_mark)\n            self.state = self.states.pop()\n        else:\n            anchor = None\n            tag = None\n            start_mark = end_mark = tag_mark = None\n            if self.check_token(AnchorToken):\n                token = self.get_token()\n                start_mark = token.start_mark\n                end_mark = token.end_mark\n                anchor = token.value\n                if self.check_token(TagToken):\n                    token = self.get_token()\n                    tag_mark = token.start_mark\n                    end_mark = token.end_mark\n                    tag = token.value\n            elif self.check_token(TagToken):\n                token = self.get_token()\n                start_mark = tag_mark = token.start_mark\n                end_mark = token.end_mark\n                tag = token.value\n                if self.check_token(AnchorToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    anchor = token.value\n            if tag is not None:\n                handle, suffix = tag\n                if handle is not None:\n                    if handle not in self.tag_handles:\n                        raise ParserError(\"while parsing a node\", start_mark,\n                                \"found undefined tag handle %r\" % handle,\n                                tag_mark)\n                    tag = self.tag_handles[handle]+suffix\n                else:\n                    tag = suffix\n            #if tag == '!':\n            #    raise ParserError(\"while parsing a node\", start_mark,\n            #            \"found non-specific tag '!'\", tag_mark,\n            #            \"Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.\")\n            if start_mark is None:\n                start_mark = end_mark = self.peek_token().start_mark\n            event = None\n            implicit = (tag is None or tag == '!')\n            if indentless_sequence and self.check_token(BlockEntryToken):\n                end_mark = self.peek_token().end_mark\n                event = SequenceStartEvent(anchor, tag, implicit,\n                        start_mark, end_mark)\n                self.state = self.parse_indentless_sequence_entry\n            else:\n                if self.check_token(ScalarToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    if (token.plain and tag is None) or tag == '!':\n                        implicit = (True, False)\n                    elif tag is None:\n                        implicit = (False, True)\n                    else:\n                        implicit = (False, False)\n                    event = ScalarEvent(anchor, tag, implicit, token.value,\n                            start_mark, end_mark, style=token.style)\n                    self.state = self.states.pop()\n                elif self.check_token(FlowSequenceStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_sequence_first_entry\n                elif self.check_token(FlowMappingStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_mapping_first_key\n                elif block and self.check_token(BlockSequenceStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_sequence_first_entry\n                elif block and self.check_token(BlockMappingStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_mapping_first_key\n                elif anchor is not None or tag is not None:\n                    # Empty scalars are allowed even if a tag or an anchor is\n                    # specified.\n                    event = ScalarEvent(anchor, tag, (implicit, False), '',\n                            start_mark, end_mark)\n                    self.state = self.states.pop()\n                else:\n                    if block:\n                        node = 'block'\n                    else:\n                        node = 'flow'\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a %s node\" % node, start_mark,\n                            \"expected the node content, but found %r\" % token.id,\n                            token.start_mark)\n        return event\n\n    # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n\n    def parse_block_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_sequence_entry()\n\n    def parse_block_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken, BlockEndToken):\n                self.states.append(self.parse_block_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_block_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block collection\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    # indentless_sequence ::= (BLOCK-ENTRY block_node?)+\n\n    def parse_indentless_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken,\n                    KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_indentless_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_indentless_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        token = self.peek_token()\n        event = SequenceEndEvent(token.start_mark, token.start_mark)\n        self.state = self.states.pop()\n        return event\n\n    # block_mapping     ::= BLOCK-MAPPING_START\n    #                       ((KEY block_node_or_indentless_sequence?)?\n    #                       (VALUE block_node_or_indentless_sequence?)?)*\n    #                       BLOCK-END\n\n    def parse_block_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_mapping_key()\n\n    def parse_block_mapping_key(self):\n        if self.check_token(KeyToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_value)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_value\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block mapping\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_block_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_key)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_block_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    # flow_sequence     ::= FLOW-SEQUENCE-START\n    #                       (flow_sequence_entry FLOW-ENTRY)*\n    #                       flow_sequence_entry?\n    #                       FLOW-SEQUENCE-END\n    # flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n    #\n    # Note that while production rules for both flow_sequence_entry and\n    # flow_mapping_entry are equal, their interpretations are different.\n    # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?`\n    # generate an inline mapping (set syntax).\n\n    def parse_flow_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_sequence_entry(first=True)\n\n    def parse_flow_sequence_entry(self, first=False):\n        if not self.check_token(FlowSequenceEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow sequence\", self.marks[-1],\n                            \"expected ',' or ']', but got %r\" % token.id, token.start_mark)\n            \n            if self.check_token(KeyToken):\n                token = self.peek_token()\n                event = MappingStartEvent(None, None, True,\n                        token.start_mark, token.end_mark,\n                        flow_style=True)\n                self.state = self.parse_flow_sequence_entry_mapping_key\n                return event\n            elif not self.check_token(FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_sequence_entry_mapping_key(self):\n        token = self.get_token()\n        if not self.check_token(ValueToken,\n                FlowEntryToken, FlowSequenceEndToken):\n            self.states.append(self.parse_flow_sequence_entry_mapping_value)\n            return self.parse_flow_node()\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_value\n            return self.process_empty_scalar(token.end_mark)\n\n    def parse_flow_sequence_entry_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry_mapping_end)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_sequence_entry_mapping_end\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_end\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_sequence_entry_mapping_end(self):\n        self.state = self.parse_flow_sequence_entry\n        token = self.peek_token()\n        return MappingEndEvent(token.start_mark, token.start_mark)\n\n    # flow_mapping  ::= FLOW-MAPPING-START\n    #                   (flow_mapping_entry FLOW-ENTRY)*\n    #                   flow_mapping_entry?\n    #                   FLOW-MAPPING-END\n    # flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n\n    def parse_flow_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_mapping_key(first=True)\n\n    def parse_flow_mapping_key(self, first=False):\n        if not self.check_token(FlowMappingEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow mapping\", self.marks[-1],\n                            \"expected ',' or '}', but got %r\" % token.id, token.start_mark)\n            if self.check_token(KeyToken):\n                token = self.get_token()\n                if not self.check_token(ValueToken,\n                        FlowEntryToken, FlowMappingEndToken):\n                    self.states.append(self.parse_flow_mapping_value)\n                    return self.parse_flow_node()\n                else:\n                    self.state = self.parse_flow_mapping_value\n                    return self.process_empty_scalar(token.end_mark)\n            elif not self.check_token(FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_empty_value)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_key)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_mapping_empty_value(self):\n        self.state = self.parse_flow_mapping_key\n        return self.process_empty_scalar(self.peek_token().start_mark)\n\n    def process_empty_scalar(self, mark):\n        return ScalarEvent(None, None, (True, False), '', mark, mark)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/reader.py",
    "content": "# This module contains abstractions for the input stream. You don't have to\n# looks further, there are no pretty code.\n#\n# We define two classes here.\n#\n#   Mark(source, line, column)\n# It's just a record and its only use is producing nice error messages.\n# Parser does not use it for any other purposes.\n#\n#   Reader(source, data)\n# Reader determines the encoding of `data` and converts it to unicode.\n# Reader provides the following methods and attributes:\n#   reader.peek(length=1) - return the next `length` characters\n#   reader.forward(length=1) - move the current position to `length` characters.\n#   reader.index - the number of the current character.\n#   reader.line, stream.column - the line and the column of the current character.\n\n__all__ = ['Reader', 'ReaderError']\n\nfrom .error import YAMLError, Mark\n\nimport codecs, re\n\nclass ReaderError(YAMLError):\n\n    def __init__(self, name, position, character, encoding, reason):\n        self.name = name\n        self.character = character\n        self.position = position\n        self.encoding = encoding\n        self.reason = reason\n\n    def __str__(self):\n        if isinstance(self.character, bytes):\n            return \"'%s' codec can't decode byte #x%02x: %s\\n\"  \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.encoding, ord(self.character), self.reason,\n                            self.name, self.position)\n        else:\n            return \"unacceptable character #x%04x: %s\\n\"    \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.character, self.reason,\n                            self.name, self.position)\n\nclass Reader(object):\n    # Reader:\n    # - determines the data encoding and converts it to a unicode string,\n    # - checks if characters are in allowed range,\n    # - adds '\\0' to the end.\n\n    # Reader accepts\n    #  - a `bytes` object,\n    #  - a `str` object,\n    #  - a file-like object with its `read` method returning `str`,\n    #  - a file-like object with its `read` method returning `unicode`.\n\n    # Yeah, it's ugly and slow.\n\n    def __init__(self, stream):\n        self.name = None\n        self.stream = None\n        self.stream_pointer = 0\n        self.eof = True\n        self.buffer = ''\n        self.pointer = 0\n        self.raw_buffer = None\n        self.raw_decode = None\n        self.encoding = None\n        self.index = 0\n        self.line = 0\n        self.column = 0\n        if isinstance(stream, str):\n            self.name = \"<unicode string>\"\n            self.check_printable(stream)\n            self.buffer = stream+'\\0'\n        elif isinstance(stream, bytes):\n            self.name = \"<byte string>\"\n            self.raw_buffer = stream\n            self.determine_encoding()\n        else:\n            self.stream = stream\n            self.name = getattr(stream, 'name', \"<file>\")\n            self.eof = False\n            self.raw_buffer = None\n            self.determine_encoding()\n\n    def peek(self, index=0):\n        try:\n            return self.buffer[self.pointer+index]\n        except IndexError:\n            self.update(index+1)\n            return self.buffer[self.pointer+index]\n\n    def prefix(self, length=1):\n        if self.pointer+length >= len(self.buffer):\n            self.update(length)\n        return self.buffer[self.pointer:self.pointer+length]\n\n    def forward(self, length=1):\n        if self.pointer+length+1 >= len(self.buffer):\n            self.update(length+1)\n        while length:\n            ch = self.buffer[self.pointer]\n            self.pointer += 1\n            self.index += 1\n            if ch in '\\n\\x85\\u2028\\u2029'  \\\n                    or (ch == '\\r' and self.buffer[self.pointer] != '\\n'):\n                self.line += 1\n                self.column = 0\n            elif ch != '\\uFEFF':\n                self.column += 1\n            length -= 1\n\n    def get_mark(self):\n        if self.stream is None:\n            return Mark(self.name, self.index, self.line, self.column,\n                    self.buffer, self.pointer)\n        else:\n            return Mark(self.name, self.index, self.line, self.column,\n                    None, None)\n\n    def determine_encoding(self):\n        while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2):\n            self.update_raw()\n        if isinstance(self.raw_buffer, bytes):\n            if self.raw_buffer.startswith(codecs.BOM_UTF16_LE):\n                self.raw_decode = codecs.utf_16_le_decode\n                self.encoding = 'utf-16-le'\n            elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE):\n                self.raw_decode = codecs.utf_16_be_decode\n                self.encoding = 'utf-16-be'\n            else:\n                self.raw_decode = codecs.utf_8_decode\n                self.encoding = 'utf-8'\n        self.update(1)\n\n    NON_PRINTABLE = re.compile('[^\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010ffff]')\n    def check_printable(self, data):\n        match = self.NON_PRINTABLE.search(data)\n        if match:\n            character = match.group()\n            position = self.index+(len(self.buffer)-self.pointer)+match.start()\n            raise ReaderError(self.name, position, ord(character),\n                    'unicode', \"special characters are not allowed\")\n\n    def update(self, length):\n        if self.raw_buffer is None:\n            return\n        self.buffer = self.buffer[self.pointer:]\n        self.pointer = 0\n        while len(self.buffer) < length:\n            if not self.eof:\n                self.update_raw()\n            if self.raw_decode is not None:\n                try:\n                    data, converted = self.raw_decode(self.raw_buffer,\n                            'strict', self.eof)\n                except UnicodeDecodeError as exc:\n                    character = self.raw_buffer[exc.start]\n                    if self.stream is not None:\n                        position = self.stream_pointer-len(self.raw_buffer)+exc.start\n                    else:\n                        position = exc.start\n                    raise ReaderError(self.name, position, character,\n                            exc.encoding, exc.reason)\n            else:\n                data = self.raw_buffer\n                converted = len(data)\n            self.check_printable(data)\n            self.buffer += data\n            self.raw_buffer = self.raw_buffer[converted:]\n            if self.eof:\n                self.buffer += '\\0'\n                self.raw_buffer = None\n                break\n\n    def update_raw(self, size=4096):\n        data = self.stream.read(size)\n        if self.raw_buffer is None:\n            self.raw_buffer = data\n        else:\n            self.raw_buffer += data\n        self.stream_pointer += len(data)\n        if not data:\n            self.eof = True\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/representer.py",
    "content": "\n__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',\n    'RepresenterError']\n\nfrom .error import *\nfrom .nodes import *\n\nimport datetime, copyreg, types, base64, collections\n\nclass RepresenterError(YAMLError):\n    pass\n\nclass BaseRepresenter:\n\n    yaml_representers = {}\n    yaml_multi_representers = {}\n\n    def __init__(self, default_style=None, default_flow_style=False, sort_keys=True):\n        self.default_style = default_style\n        self.sort_keys = sort_keys\n        self.default_flow_style = default_flow_style\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def represent(self, data):\n        node = self.represent_data(data)\n        self.serialize(node)\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def represent_data(self, data):\n        if self.ignore_aliases(data):\n            self.alias_key = None\n        else:\n            self.alias_key = id(data)\n        if self.alias_key is not None:\n            if self.alias_key in self.represented_objects:\n                node = self.represented_objects[self.alias_key]\n                #if node is None:\n                #    raise RepresenterError(\"recursive objects are not allowed: %r\" % data)\n                return node\n            #self.represented_objects[alias_key] = None\n            self.object_keeper.append(data)\n        data_types = type(data).__mro__\n        if data_types[0] in self.yaml_representers:\n            node = self.yaml_representers[data_types[0]](self, data)\n        else:\n            for data_type in data_types:\n                if data_type in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[data_type](self, data)\n                    break\n            else:\n                if None in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[None](self, data)\n                elif None in self.yaml_representers:\n                    node = self.yaml_representers[None](self, data)\n                else:\n                    node = ScalarNode(None, str(data))\n        #if alias_key is not None:\n        #    self.represented_objects[alias_key] = node\n        return node\n\n    @classmethod\n    def add_representer(cls, data_type, representer):\n        if not 'yaml_representers' in cls.__dict__:\n            cls.yaml_representers = cls.yaml_representers.copy()\n        cls.yaml_representers[data_type] = representer\n\n    @classmethod\n    def add_multi_representer(cls, data_type, representer):\n        if not 'yaml_multi_representers' in cls.__dict__:\n            cls.yaml_multi_representers = cls.yaml_multi_representers.copy()\n        cls.yaml_multi_representers[data_type] = representer\n\n    def represent_scalar(self, tag, value, style=None):\n        if style is None:\n            style = self.default_style\n        node = ScalarNode(tag, value, style=style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        return node\n\n    def represent_sequence(self, tag, sequence, flow_style=None):\n        value = []\n        node = SequenceNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        for item in sequence:\n            node_item = self.represent_data(item)\n            if not (isinstance(node_item, ScalarNode) and not node_item.style):\n                best_style = False\n            value.append(node_item)\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def represent_mapping(self, tag, mapping, flow_style=None):\n        value = []\n        node = MappingNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        if hasattr(mapping, 'items'):\n            mapping = list(mapping.items())\n            if self.sort_keys:\n                try:\n                    mapping = sorted(mapping)\n                except TypeError:\n                    pass\n        for item_key, item_value in mapping:\n            node_key = self.represent_data(item_key)\n            node_value = self.represent_data(item_value)\n            if not (isinstance(node_key, ScalarNode) and not node_key.style):\n                best_style = False\n            if not (isinstance(node_value, ScalarNode) and not node_value.style):\n                best_style = False\n            value.append((node_key, node_value))\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def ignore_aliases(self, data):\n        return False\n\nclass SafeRepresenter(BaseRepresenter):\n\n    def ignore_aliases(self, data):\n        if data is None:\n            return True\n        if isinstance(data, tuple) and data == ():\n            return True\n        if isinstance(data, (str, bytes, bool, int, float)):\n            return True\n\n    def represent_none(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:null', 'null')\n\n    def represent_str(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:str', data)\n\n    def represent_binary(self, data):\n        if hasattr(base64, 'encodebytes'):\n            data = base64.encodebytes(data).decode('ascii')\n        else:\n            data = base64.encodestring(data).decode('ascii')\n        return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|')\n\n    def represent_bool(self, data):\n        if data:\n            value = 'true'\n        else:\n            value = 'false'\n        return self.represent_scalar('tag:yaml.org,2002:bool', value)\n\n    def represent_int(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:int', str(data))\n\n    inf_value = 1e300\n    while repr(inf_value) != repr(inf_value*inf_value):\n        inf_value *= inf_value\n\n    def represent_float(self, data):\n        if data != data or (data == 0.0 and data == 1.0):\n            value = '.nan'\n        elif data == self.inf_value:\n            value = '.inf'\n        elif data == -self.inf_value:\n            value = '-.inf'\n        else:\n            value = repr(data).lower()\n            # Note that in some cases `repr(data)` represents a float number\n            # without the decimal parts.  For instance:\n            #   >>> repr(1e17)\n            #   '1e17'\n            # Unfortunately, this is not a valid float representation according\n            # to the definition of the `!!float` tag.  We fix this by adding\n            # '.0' before the 'e' symbol.\n            if '.' not in value and 'e' in value:\n                value = value.replace('e', '.0e', 1)\n        return self.represent_scalar('tag:yaml.org,2002:float', value)\n\n    def represent_list(self, data):\n        #pairs = (len(data) > 0 and isinstance(data, list))\n        #if pairs:\n        #    for item in data:\n        #        if not isinstance(item, tuple) or len(item) != 2:\n        #            pairs = False\n        #            break\n        #if not pairs:\n            return self.represent_sequence('tag:yaml.org,2002:seq', data)\n        #value = []\n        #for item_key, item_value in data:\n        #    value.append(self.represent_mapping(u'tag:yaml.org,2002:map',\n        #        [(item_key, item_value)]))\n        #return SequenceNode(u'tag:yaml.org,2002:pairs', value)\n\n    def represent_dict(self, data):\n        return self.represent_mapping('tag:yaml.org,2002:map', data)\n\n    def represent_set(self, data):\n        value = {}\n        for key in data:\n            value[key] = None\n        return self.represent_mapping('tag:yaml.org,2002:set', value)\n\n    def represent_date(self, data):\n        value = data.isoformat()\n        return self.represent_scalar('tag:yaml.org,2002:timestamp', value)\n\n    def represent_datetime(self, data):\n        value = data.isoformat(' ')\n        return self.represent_scalar('tag:yaml.org,2002:timestamp', value)\n\n    def represent_yaml_object(self, tag, data, cls, flow_style=None):\n        if hasattr(data, '__getstate__'):\n            state = data.__getstate__()\n        else:\n            state = data.__dict__.copy()\n        return self.represent_mapping(tag, state, flow_style=flow_style)\n\n    def represent_undefined(self, data):\n        raise RepresenterError(\"cannot represent an object\", data)\n\nSafeRepresenter.add_representer(type(None),\n        SafeRepresenter.represent_none)\n\nSafeRepresenter.add_representer(str,\n        SafeRepresenter.represent_str)\n\nSafeRepresenter.add_representer(bytes,\n        SafeRepresenter.represent_binary)\n\nSafeRepresenter.add_representer(bool,\n        SafeRepresenter.represent_bool)\n\nSafeRepresenter.add_representer(int,\n        SafeRepresenter.represent_int)\n\nSafeRepresenter.add_representer(float,\n        SafeRepresenter.represent_float)\n\nSafeRepresenter.add_representer(list,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(tuple,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(dict,\n        SafeRepresenter.represent_dict)\n\nSafeRepresenter.add_representer(set,\n        SafeRepresenter.represent_set)\n\nSafeRepresenter.add_representer(datetime.date,\n        SafeRepresenter.represent_date)\n\nSafeRepresenter.add_representer(datetime.datetime,\n        SafeRepresenter.represent_datetime)\n\nSafeRepresenter.add_representer(None,\n        SafeRepresenter.represent_undefined)\n\nclass Representer(SafeRepresenter):\n\n    def represent_complex(self, data):\n        if data.imag == 0.0:\n            data = '%r' % data.real\n        elif data.real == 0.0:\n            data = '%rj' % data.imag\n        elif data.imag > 0:\n            data = '%r+%rj' % (data.real, data.imag)\n        else:\n            data = '%r%rj' % (data.real, data.imag)\n        return self.represent_scalar('tag:yaml.org,2002:python/complex', data)\n\n    def represent_tuple(self, data):\n        return self.represent_sequence('tag:yaml.org,2002:python/tuple', data)\n\n    def represent_name(self, data):\n        name = '%s.%s' % (data.__module__, data.__name__)\n        return self.represent_scalar('tag:yaml.org,2002:python/name:'+name, '')\n\n    def represent_module(self, data):\n        return self.represent_scalar(\n                'tag:yaml.org,2002:python/module:'+data.__name__, '')\n\n    def represent_object(self, data):\n        # We use __reduce__ API to save the data. data.__reduce__ returns\n        # a tuple of length 2-5:\n        #   (function, args, state, listitems, dictitems)\n\n        # For reconstructing, we calls function(*args), then set its state,\n        # listitems, and dictitems if they are not None.\n\n        # A special case is when function.__name__ == '__newobj__'. In this\n        # case we create the object with args[0].__new__(*args).\n\n        # Another special case is when __reduce__ returns a string - we don't\n        # support it.\n\n        # We produce a !!python/object, !!python/object/new or\n        # !!python/object/apply node.\n\n        cls = type(data)\n        if cls in copyreg.dispatch_table:\n            reduce = copyreg.dispatch_table[cls](data)\n        elif hasattr(data, '__reduce_ex__'):\n            reduce = data.__reduce_ex__(2)\n        elif hasattr(data, '__reduce__'):\n            reduce = data.__reduce__()\n        else:\n            raise RepresenterError(\"cannot represent an object\", data)\n        reduce = (list(reduce)+[None]*5)[:5]\n        function, args, state, listitems, dictitems = reduce\n        args = list(args)\n        if state is None:\n            state = {}\n        if listitems is not None:\n            listitems = list(listitems)\n        if dictitems is not None:\n            dictitems = dict(dictitems)\n        if function.__name__ == '__newobj__':\n            function = args[0]\n            args = args[1:]\n            tag = 'tag:yaml.org,2002:python/object/new:'\n            newobj = True\n        else:\n            tag = 'tag:yaml.org,2002:python/object/apply:'\n            newobj = False\n        function_name = '%s.%s' % (function.__module__, function.__name__)\n        if not args and not listitems and not dictitems \\\n                and isinstance(state, dict) and newobj:\n            return self.represent_mapping(\n                    'tag:yaml.org,2002:python/object:'+function_name, state)\n        if not listitems and not dictitems  \\\n                and isinstance(state, dict) and not state:\n            return self.represent_sequence(tag+function_name, args)\n        value = {}\n        if args:\n            value['args'] = args\n        if state or not isinstance(state, dict):\n            value['state'] = state\n        if listitems:\n            value['listitems'] = listitems\n        if dictitems:\n            value['dictitems'] = dictitems\n        return self.represent_mapping(tag+function_name, value)\n\n    def represent_ordered_dict(self, data):\n        # Provide uniform representation across different Python versions.\n        data_type = type(data)\n        tag = 'tag:yaml.org,2002:python/object/apply:%s.%s' \\\n                % (data_type.__module__, data_type.__name__)\n        items = [[key, value] for key, value in data.items()]\n        return self.represent_sequence(tag, [items])\n\nRepresenter.add_representer(complex,\n        Representer.represent_complex)\n\nRepresenter.add_representer(tuple,\n        Representer.represent_tuple)\n\nRepresenter.add_representer(type,\n        Representer.represent_name)\n\nRepresenter.add_representer(collections.OrderedDict,\n        Representer.represent_ordered_dict)\n\nRepresenter.add_representer(types.FunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.BuiltinFunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.ModuleType,\n        Representer.represent_module)\n\nRepresenter.add_multi_representer(object,\n        Representer.represent_object)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/resolver.py",
    "content": "\n__all__ = ['BaseResolver', 'Resolver']\n\nfrom .error import *\nfrom .nodes import *\n\nimport re\n\nclass ResolverError(YAMLError):\n    pass\n\nclass BaseResolver:\n\n    DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str'\n    DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq'\n    DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map'\n\n    yaml_implicit_resolvers = {}\n    yaml_path_resolvers = {}\n\n    def __init__(self):\n        self.resolver_exact_paths = []\n        self.resolver_prefix_paths = []\n\n    @classmethod\n    def add_implicit_resolver(cls, tag, regexp, first):\n        if not 'yaml_implicit_resolvers' in cls.__dict__:\n            implicit_resolvers = {}\n            for key in cls.yaml_implicit_resolvers:\n                implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:]\n            cls.yaml_implicit_resolvers = implicit_resolvers\n        if first is None:\n            first = [None]\n        for ch in first:\n            cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp))\n\n    @classmethod\n    def add_path_resolver(cls, tag, path, kind=None):\n        # Note: `add_path_resolver` is experimental.  The API could be changed.\n        # `new_path` is a pattern that is matched against the path from the\n        # root to the node that is being considered.  `node_path` elements are\n        # tuples `(node_check, index_check)`.  `node_check` is a node class:\n        # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`.  `None`\n        # matches any kind of a node.  `index_check` could be `None`, a boolean\n        # value, a string value, or a number.  `None` and `False` match against\n        # any _value_ of sequence and mapping nodes.  `True` matches against\n        # any _key_ of a mapping node.  A string `index_check` matches against\n        # a mapping value that corresponds to a scalar key which content is\n        # equal to the `index_check` value.  An integer `index_check` matches\n        # against a sequence value with the index equal to `index_check`.\n        if not 'yaml_path_resolvers' in cls.__dict__:\n            cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy()\n        new_path = []\n        for element in path:\n            if isinstance(element, (list, tuple)):\n                if len(element) == 2:\n                    node_check, index_check = element\n                elif len(element) == 1:\n                    node_check = element[0]\n                    index_check = True\n                else:\n                    raise ResolverError(\"Invalid path element: %s\" % element)\n            else:\n                node_check = None\n                index_check = element\n            if node_check is str:\n                node_check = ScalarNode\n            elif node_check is list:\n                node_check = SequenceNode\n            elif node_check is dict:\n                node_check = MappingNode\n            elif node_check not in [ScalarNode, SequenceNode, MappingNode]  \\\n                    and not isinstance(node_check, str) \\\n                    and node_check is not None:\n                raise ResolverError(\"Invalid node checker: %s\" % node_check)\n            if not isinstance(index_check, (str, int))  \\\n                    and index_check is not None:\n                raise ResolverError(\"Invalid index checker: %s\" % index_check)\n            new_path.append((node_check, index_check))\n        if kind is str:\n            kind = ScalarNode\n        elif kind is list:\n            kind = SequenceNode\n        elif kind is dict:\n            kind = MappingNode\n        elif kind not in [ScalarNode, SequenceNode, MappingNode]    \\\n                and kind is not None:\n            raise ResolverError(\"Invalid node kind: %s\" % kind)\n        cls.yaml_path_resolvers[tuple(new_path), kind] = tag\n\n    def descend_resolver(self, current_node, current_index):\n        if not self.yaml_path_resolvers:\n            return\n        exact_paths = {}\n        prefix_paths = []\n        if current_node:\n            depth = len(self.resolver_prefix_paths)\n            for path, kind in self.resolver_prefix_paths[-1]:\n                if self.check_resolver_prefix(depth, path, kind,\n                        current_node, current_index):\n                    if len(path) > depth:\n                        prefix_paths.append((path, kind))\n                    else:\n                        exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n        else:\n            for path, kind in self.yaml_path_resolvers:\n                if not path:\n                    exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n                else:\n                    prefix_paths.append((path, kind))\n        self.resolver_exact_paths.append(exact_paths)\n        self.resolver_prefix_paths.append(prefix_paths)\n\n    def ascend_resolver(self):\n        if not self.yaml_path_resolvers:\n            return\n        self.resolver_exact_paths.pop()\n        self.resolver_prefix_paths.pop()\n\n    def check_resolver_prefix(self, depth, path, kind,\n            current_node, current_index):\n        node_check, index_check = path[depth-1]\n        if isinstance(node_check, str):\n            if current_node.tag != node_check:\n                return\n        elif node_check is not None:\n            if not isinstance(current_node, node_check):\n                return\n        if index_check is True and current_index is not None:\n            return\n        if (index_check is False or index_check is None)    \\\n                and current_index is None:\n            return\n        if isinstance(index_check, str):\n            if not (isinstance(current_index, ScalarNode)\n                    and index_check == current_index.value):\n                return\n        elif isinstance(index_check, int) and not isinstance(index_check, bool):\n            if index_check != current_index:\n                return\n        return True\n\n    def resolve(self, kind, value, implicit):\n        if kind is ScalarNode and implicit[0]:\n            if value == '':\n                resolvers = self.yaml_implicit_resolvers.get('', [])\n            else:\n                resolvers = self.yaml_implicit_resolvers.get(value[0], [])\n            wildcard_resolvers = self.yaml_implicit_resolvers.get(None, [])\n            for tag, regexp in resolvers + wildcard_resolvers:\n                if regexp.match(value):\n                    return tag\n            implicit = implicit[1]\n        if self.yaml_path_resolvers:\n            exact_paths = self.resolver_exact_paths[-1]\n            if kind in exact_paths:\n                return exact_paths[kind]\n            if None in exact_paths:\n                return exact_paths[None]\n        if kind is ScalarNode:\n            return self.DEFAULT_SCALAR_TAG\n        elif kind is SequenceNode:\n            return self.DEFAULT_SEQUENCE_TAG\n        elif kind is MappingNode:\n            return self.DEFAULT_MAPPING_TAG\n\nclass Resolver(BaseResolver):\n    pass\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:bool',\n        re.compile(r'''^(?:yes|Yes|YES|no|No|NO\n                    |true|True|TRUE|false|False|FALSE\n                    |on|On|ON|off|Off|OFF)$''', re.X),\n        list('yYnNtTfFoO'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:float',\n        re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?\n                    |\\.[0-9_]+(?:[eE][-+][0-9]+)?\n                    |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*\n                    |[-+]?\\.(?:inf|Inf|INF)\n                    |\\.(?:nan|NaN|NAN))$''', re.X),\n        list('-+0123456789.'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:int',\n        re.compile(r'''^(?:[-+]?0b[0-1_]+\n                    |[-+]?0[0-7_]+\n                    |[-+]?(?:0|[1-9][0-9_]*)\n                    |[-+]?0x[0-9a-fA-F_]+\n                    |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X),\n        list('-+0123456789'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:merge',\n        re.compile(r'^(?:<<)$'),\n        ['<'])\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:null',\n        re.compile(r'''^(?: ~\n                    |null|Null|NULL\n                    | )$''', re.X),\n        ['~', 'n', 'N', ''])\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:timestamp',\n        re.compile(r'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\n                    |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]?\n                     (?:[Tt]|[ \\t]+)[0-9][0-9]?\n                     :[0-9][0-9] :[0-9][0-9] (?:\\.[0-9]*)?\n                     (?:[ \\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X),\n        list('0123456789'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:value',\n        re.compile(r'^(?:=)$'),\n        ['='])\n\n# The following resolver is only for documentation purposes. It cannot work\n# because plain scalars cannot start with '!', '&', or '*'.\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:yaml',\n        re.compile(r'^(?:!|&|\\*)$'),\n        list('!&*'))\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/scanner.py",
    "content": "\n# Scanner produces tokens of the following types:\n# STREAM-START\n# STREAM-END\n# DIRECTIVE(name, value)\n# DOCUMENT-START\n# DOCUMENT-END\n# BLOCK-SEQUENCE-START\n# BLOCK-MAPPING-START\n# BLOCK-END\n# FLOW-SEQUENCE-START\n# FLOW-MAPPING-START\n# FLOW-SEQUENCE-END\n# FLOW-MAPPING-END\n# BLOCK-ENTRY\n# FLOW-ENTRY\n# KEY\n# VALUE\n# ALIAS(value)\n# ANCHOR(value)\n# TAG(value)\n# SCALAR(value, plain, style)\n#\n# Read comments in the Scanner code for more details.\n#\n\n__all__ = ['Scanner', 'ScannerError']\n\nfrom .error import MarkedYAMLError\nfrom .tokens import *\n\nclass ScannerError(MarkedYAMLError):\n    pass\n\nclass SimpleKey:\n    # See below simple keys treatment.\n\n    def __init__(self, token_number, required, index, line, column, mark):\n        self.token_number = token_number\n        self.required = required\n        self.index = index\n        self.line = line\n        self.column = column\n        self.mark = mark\n\nclass Scanner:\n\n    def __init__(self):\n        \"\"\"Initialize the scanner.\"\"\"\n        # It is assumed that Scanner and Reader will have a common descendant.\n        # Reader do the dirty work of checking for BOM and converting the\n        # input data to Unicode. It also adds NUL to the end.\n        #\n        # Reader supports the following methods\n        #   self.peek(i=0)       # peek the next i-th character\n        #   self.prefix(l=1)     # peek the next l characters\n        #   self.forward(l=1)    # read the next l characters and move the pointer.\n\n        # Had we reached the end of the stream?\n        self.done = False\n\n        # The number of unclosed '{' and '['. `flow_level == 0` means block\n        # context.\n        self.flow_level = 0\n\n        # List of processed tokens that are not yet emitted.\n        self.tokens = []\n\n        # Add the STREAM-START token.\n        self.fetch_stream_start()\n\n        # Number of tokens that were emitted through the `get_token` method.\n        self.tokens_taken = 0\n\n        # The current indentation level.\n        self.indent = -1\n\n        # Past indentation levels.\n        self.indents = []\n\n        # Variables related to simple keys treatment.\n\n        # A simple key is a key that is not denoted by the '?' indicator.\n        # Example of simple keys:\n        #   ---\n        #   block simple key: value\n        #   ? not a simple key:\n        #   : { flow simple key: value }\n        # We emit the KEY token before all keys, so when we find a potential\n        # simple key, we try to locate the corresponding ':' indicator.\n        # Simple keys should be limited to a single line and 1024 characters.\n\n        # Can a simple key start at the current position? A simple key may\n        # start:\n        # - at the beginning of the line, not counting indentation spaces\n        #       (in block context),\n        # - after '{', '[', ',' (in the flow context),\n        # - after '?', ':', '-' (in the block context).\n        # In the block context, this flag also signifies if a block collection\n        # may start at the current position.\n        self.allow_simple_key = True\n\n        # Keep track of possible simple keys. This is a dictionary. The key\n        # is `flow_level`; there can be no more that one possible simple key\n        # for each level. The value is a SimpleKey record:\n        #   (token_number, required, index, line, column, mark)\n        # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow),\n        # '[', or '{' tokens.\n        self.possible_simple_keys = {}\n\n    # Public methods.\n\n    def check_token(self, *choices):\n        # Check if the next token is one of the given types.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.tokens[0], choice):\n                    return True\n        return False\n\n    def peek_token(self):\n        # Return the next token, but do not delete if from the queue.\n        # Return None if no more tokens.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            return self.tokens[0]\n        else:\n            return None\n\n    def get_token(self):\n        # Return the next token.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            self.tokens_taken += 1\n            return self.tokens.pop(0)\n\n    # Private methods.\n\n    def need_more_tokens(self):\n        if self.done:\n            return False\n        if not self.tokens:\n            return True\n        # The current token may be a potential simple key, so we\n        # need to look further.\n        self.stale_possible_simple_keys()\n        if self.next_possible_simple_key() == self.tokens_taken:\n            return True\n\n    def fetch_more_tokens(self):\n\n        # Eat whitespaces and comments until we reach the next token.\n        self.scan_to_next_token()\n\n        # Remove obsolete possible simple keys.\n        self.stale_possible_simple_keys()\n\n        # Compare the current indentation and column. It may add some tokens\n        # and decrease the current indentation level.\n        self.unwind_indent(self.column)\n\n        # Peek the next character.\n        ch = self.peek()\n\n        # Is it the end of stream?\n        if ch == '\\0':\n            return self.fetch_stream_end()\n\n        # Is it a directive?\n        if ch == '%' and self.check_directive():\n            return self.fetch_directive()\n\n        # Is it the document start?\n        if ch == '-' and self.check_document_start():\n            return self.fetch_document_start()\n\n        # Is it the document end?\n        if ch == '.' and self.check_document_end():\n            return self.fetch_document_end()\n\n        # TODO: support for BOM within a stream.\n        #if ch == '\\uFEFF':\n        #    return self.fetch_bom()    <-- issue BOMToken\n\n        # Note: the order of the following checks is NOT significant.\n\n        # Is it the flow sequence start indicator?\n        if ch == '[':\n            return self.fetch_flow_sequence_start()\n\n        # Is it the flow mapping start indicator?\n        if ch == '{':\n            return self.fetch_flow_mapping_start()\n\n        # Is it the flow sequence end indicator?\n        if ch == ']':\n            return self.fetch_flow_sequence_end()\n\n        # Is it the flow mapping end indicator?\n        if ch == '}':\n            return self.fetch_flow_mapping_end()\n\n        # Is it the flow entry indicator?\n        if ch == ',':\n            return self.fetch_flow_entry()\n\n        # Is it the block entry indicator?\n        if ch == '-' and self.check_block_entry():\n            return self.fetch_block_entry()\n\n        # Is it the key indicator?\n        if ch == '?' and self.check_key():\n            return self.fetch_key()\n\n        # Is it the value indicator?\n        if ch == ':' and self.check_value():\n            return self.fetch_value()\n\n        # Is it an alias?\n        if ch == '*':\n            return self.fetch_alias()\n\n        # Is it an anchor?\n        if ch == '&':\n            return self.fetch_anchor()\n\n        # Is it a tag?\n        if ch == '!':\n            return self.fetch_tag()\n\n        # Is it a literal scalar?\n        if ch == '|' and not self.flow_level:\n            return self.fetch_literal()\n\n        # Is it a folded scalar?\n        if ch == '>' and not self.flow_level:\n            return self.fetch_folded()\n\n        # Is it a single quoted scalar?\n        if ch == '\\'':\n            return self.fetch_single()\n\n        # Is it a double quoted scalar?\n        if ch == '\\\"':\n            return self.fetch_double()\n\n        # It must be a plain scalar then.\n        if self.check_plain():\n            return self.fetch_plain()\n\n        # No? It's an error. Let's produce a nice error message.\n        raise ScannerError(\"while scanning for the next token\", None,\n                \"found character %r that cannot start any token\" % ch,\n                self.get_mark())\n\n    # Simple keys treatment.\n\n    def next_possible_simple_key(self):\n        # Return the number of the nearest possible simple key. Actually we\n        # don't need to loop through the whole dictionary. We may replace it\n        # with the following code:\n        #   if not self.possible_simple_keys:\n        #       return None\n        #   return self.possible_simple_keys[\n        #           min(self.possible_simple_keys.keys())].token_number\n        min_token_number = None\n        for level in self.possible_simple_keys:\n            key = self.possible_simple_keys[level]\n            if min_token_number is None or key.token_number < min_token_number:\n                min_token_number = key.token_number\n        return min_token_number\n\n    def stale_possible_simple_keys(self):\n        # Remove entries that are no longer possible simple keys. According to\n        # the YAML specification, simple keys\n        # - should be limited to a single line,\n        # - should be no longer than 1024 characters.\n        # Disabling this procedure will allow simple keys of any length and\n        # height (may cause problems if indentation is broken though).\n        for level in list(self.possible_simple_keys):\n            key = self.possible_simple_keys[level]\n            if key.line != self.line  \\\n                    or self.index-key.index > 1024:\n                if key.required:\n                    raise ScannerError(\"while scanning a simple key\", key.mark,\n                            \"could not find expected ':'\", self.get_mark())\n                del self.possible_simple_keys[level]\n\n    def save_possible_simple_key(self):\n        # The next token may start a simple key. We check if it's possible\n        # and save its position. This function is called for\n        #   ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'.\n\n        # Check if a simple key is required at the current position.\n        required = not self.flow_level and self.indent == self.column\n\n        # The next token might be a simple key. Let's save it's number and\n        # position.\n        if self.allow_simple_key:\n            self.remove_possible_simple_key()\n            token_number = self.tokens_taken+len(self.tokens)\n            key = SimpleKey(token_number, required,\n                    self.index, self.line, self.column, self.get_mark())\n            self.possible_simple_keys[self.flow_level] = key\n\n    def remove_possible_simple_key(self):\n        # Remove the saved possible key position at the current flow level.\n        if self.flow_level in self.possible_simple_keys:\n            key = self.possible_simple_keys[self.flow_level]\n            \n            if key.required:\n                raise ScannerError(\"while scanning a simple key\", key.mark,\n                        \"could not find expected ':'\", self.get_mark())\n\n            del self.possible_simple_keys[self.flow_level]\n\n    # Indentation functions.\n\n    def unwind_indent(self, column):\n\n        ## In flow context, tokens should respect indentation.\n        ## Actually the condition should be `self.indent >= column` according to\n        ## the spec. But this condition will prohibit intuitively correct\n        ## constructions such as\n        ## key : {\n        ## }\n        #if self.flow_level and self.indent > column:\n        #    raise ScannerError(None, None,\n        #            \"invalid indentation or unclosed '[' or '{'\",\n        #            self.get_mark())\n\n        # In the flow context, indentation is ignored. We make the scanner less\n        # restrictive then specification requires.\n        if self.flow_level:\n            return\n\n        # In block context, we may need to issue the BLOCK-END tokens.\n        while self.indent > column:\n            mark = self.get_mark()\n            self.indent = self.indents.pop()\n            self.tokens.append(BlockEndToken(mark, mark))\n\n    def add_indent(self, column):\n        # Check if we need to increase indentation.\n        if self.indent < column:\n            self.indents.append(self.indent)\n            self.indent = column\n            return True\n        return False\n\n    # Fetchers.\n\n    def fetch_stream_start(self):\n        # We always add STREAM-START as the first token and STREAM-END as the\n        # last token.\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-START.\n        self.tokens.append(StreamStartToken(mark, mark,\n            encoding=self.encoding))\n        \n\n    def fetch_stream_end(self):\n\n        # Set the current indentation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n        self.possible_simple_keys = {}\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-END.\n        self.tokens.append(StreamEndToken(mark, mark))\n\n        # The steam is finished.\n        self.done = True\n\n    def fetch_directive(self):\n        \n        # Set the current indentation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Scan and add DIRECTIVE.\n        self.tokens.append(self.scan_directive())\n\n    def fetch_document_start(self):\n        self.fetch_document_indicator(DocumentStartToken)\n\n    def fetch_document_end(self):\n        self.fetch_document_indicator(DocumentEndToken)\n\n    def fetch_document_indicator(self, TokenClass):\n\n        # Set the current indentation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys. Note that there could not be a block collection\n        # after '---'.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Add DOCUMENT-START or DOCUMENT-END.\n        start_mark = self.get_mark()\n        self.forward(3)\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_start(self):\n        self.fetch_flow_collection_start(FlowSequenceStartToken)\n\n    def fetch_flow_mapping_start(self):\n        self.fetch_flow_collection_start(FlowMappingStartToken)\n\n    def fetch_flow_collection_start(self, TokenClass):\n\n        # '[' and '{' may start a simple key.\n        self.save_possible_simple_key()\n\n        # Increase the flow level.\n        self.flow_level += 1\n\n        # Simple keys are allowed after '[' and '{'.\n        self.allow_simple_key = True\n\n        # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_end(self):\n        self.fetch_flow_collection_end(FlowSequenceEndToken)\n\n    def fetch_flow_mapping_end(self):\n        self.fetch_flow_collection_end(FlowMappingEndToken)\n\n    def fetch_flow_collection_end(self, TokenClass):\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Decrease the flow level.\n        self.flow_level -= 1\n\n        # No simple keys after ']' or '}'.\n        self.allow_simple_key = False\n\n        # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_entry(self):\n\n        # Simple keys are allowed after ','.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add FLOW-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(FlowEntryToken(start_mark, end_mark))\n\n    def fetch_block_entry(self):\n\n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a new entry?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"sequence entries are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-SEQUENCE-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockSequenceStartToken(mark, mark))\n\n        # It's an error for the block entry to occur in the flow context,\n        # but we let the parser detect this.\n        else:\n            pass\n\n        # Simple keys are allowed after '-'.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add BLOCK-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(BlockEntryToken(start_mark, end_mark))\n\n    def fetch_key(self):\n        \n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a key (not necessary a simple)?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"mapping keys are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-MAPPING-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockMappingStartToken(mark, mark))\n\n        # Simple keys are allowed after '?' in the block context.\n        self.allow_simple_key = not self.flow_level\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add KEY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(KeyToken(start_mark, end_mark))\n\n    def fetch_value(self):\n\n        # Do we determine a simple key?\n        if self.flow_level in self.possible_simple_keys:\n\n            # Add KEY.\n            key = self.possible_simple_keys[self.flow_level]\n            del self.possible_simple_keys[self.flow_level]\n            self.tokens.insert(key.token_number-self.tokens_taken,\n                    KeyToken(key.mark, key.mark))\n\n            # If this key starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.\n            if not self.flow_level:\n                if self.add_indent(key.column):\n                    self.tokens.insert(key.token_number-self.tokens_taken,\n                            BlockMappingStartToken(key.mark, key.mark))\n\n            # There cannot be two simple keys one after another.\n            self.allow_simple_key = False\n\n        # It must be a part of a complex key.\n        else:\n            \n            # Block context needs additional checks.\n            # (Do we really need them? They will be caught by the parser\n            # anyway.)\n            if not self.flow_level:\n\n                # We are allowed to start a complex value if and only if\n                # we can start a simple key.\n                if not self.allow_simple_key:\n                    raise ScannerError(None, None,\n                            \"mapping values are not allowed here\",\n                            self.get_mark())\n\n            # If this value starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.  It will be detected as an error later by\n            # the parser.\n            if not self.flow_level:\n                if self.add_indent(self.column):\n                    mark = self.get_mark()\n                    self.tokens.append(BlockMappingStartToken(mark, mark))\n\n            # Simple keys are allowed after ':' in the block context.\n            self.allow_simple_key = not self.flow_level\n\n            # Reset possible simple key on the current level.\n            self.remove_possible_simple_key()\n\n        # Add VALUE.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(ValueToken(start_mark, end_mark))\n\n    def fetch_alias(self):\n\n        # ALIAS could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ALIAS.\n        self.allow_simple_key = False\n\n        # Scan and add ALIAS.\n        self.tokens.append(self.scan_anchor(AliasToken))\n\n    def fetch_anchor(self):\n\n        # ANCHOR could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ANCHOR.\n        self.allow_simple_key = False\n\n        # Scan and add ANCHOR.\n        self.tokens.append(self.scan_anchor(AnchorToken))\n\n    def fetch_tag(self):\n\n        # TAG could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after TAG.\n        self.allow_simple_key = False\n\n        # Scan and add TAG.\n        self.tokens.append(self.scan_tag())\n\n    def fetch_literal(self):\n        self.fetch_block_scalar(style='|')\n\n    def fetch_folded(self):\n        self.fetch_block_scalar(style='>')\n\n    def fetch_block_scalar(self, style):\n\n        # A simple key may follow a block scalar.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_block_scalar(style))\n\n    def fetch_single(self):\n        self.fetch_flow_scalar(style='\\'')\n\n    def fetch_double(self):\n        self.fetch_flow_scalar(style='\"')\n\n    def fetch_flow_scalar(self, style):\n\n        # A flow scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after flow scalars.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_flow_scalar(style))\n\n    def fetch_plain(self):\n\n        # A plain scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after plain scalars. But note that `scan_plain` will\n        # change this flag if the scan is finished at the beginning of the\n        # line.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR. May change `allow_simple_key`.\n        self.tokens.append(self.scan_plain())\n\n    # Checkers.\n\n    def check_directive(self):\n\n        # DIRECTIVE:        ^ '%' ...\n        # The '%' indicator is already checked.\n        if self.column == 0:\n            return True\n\n    def check_document_start(self):\n\n        # DOCUMENT-START:   ^ '---' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == '---'  \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_document_end(self):\n\n        # DOCUMENT-END:     ^ '...' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == '...'  \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_block_entry(self):\n\n        # BLOCK-ENTRY:      '-' (' '|'\\n')\n        return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_key(self):\n\n        # KEY(flow context):    '?'\n        if self.flow_level:\n            return True\n\n        # KEY(block context):   '?' (' '|'\\n')\n        else:\n            return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_value(self):\n\n        # VALUE(flow context):  ':'\n        if self.flow_level:\n            return True\n\n        # VALUE(block context): ':' (' '|'\\n')\n        else:\n            return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_plain(self):\n\n        # A plain scalar may start with any non-space character except:\n        #   '-', '?', ':', ',', '[', ']', '{', '}',\n        #   '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n        #   '%', '@', '`'.\n        #\n        # It may also start with\n        #   '-', '?', ':'\n        # if it is followed by a non-space character.\n        #\n        # Note that we limit the last rule to the block context (except the\n        # '-' character) because we want the flow context to be space\n        # independent.\n        ch = self.peek()\n        return ch not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029-?:,[]{}#&*!|>\\'\\\"%@`'  \\\n                or (self.peek(1) not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n                        and (ch == '-' or (not self.flow_level and ch in '?:')))\n\n    # Scanners.\n\n    def scan_to_next_token(self):\n        # We ignore spaces, line breaks and comments.\n        # If we find a line break in the block context, we set the flag\n        # `allow_simple_key` on.\n        # The byte order mark is stripped if it's the first character in the\n        # stream. We do not yet support BOM inside the stream as the\n        # specification requires. Any such mark will be considered as a part\n        # of the document.\n        #\n        # TODO: We need to make tab handling rules more sane. A good rule is\n        #   Tabs cannot precede tokens\n        #   BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END,\n        #   KEY(block), VALUE(block), BLOCK-ENTRY\n        # So the checking code is\n        #   if <TAB>:\n        #       self.allow_simple_keys = False\n        # We also need to add the check for `allow_simple_keys == True` to\n        # `unwind_indent` before issuing BLOCK-END.\n        # Scanners for block, flow, and plain scalars need to be modified.\n\n        if self.index == 0 and self.peek() == '\\uFEFF':\n            self.forward()\n        found = False\n        while not found:\n            while self.peek() == ' ':\n                self.forward()\n            if self.peek() == '#':\n                while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                    self.forward()\n            if self.scan_line_break():\n                if not self.flow_level:\n                    self.allow_simple_key = True\n            else:\n                found = True\n\n    def scan_directive(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        self.forward()\n        name = self.scan_directive_name(start_mark)\n        value = None\n        if name == 'YAML':\n            value = self.scan_yaml_directive_value(start_mark)\n            end_mark = self.get_mark()\n        elif name == 'TAG':\n            value = self.scan_tag_directive_value(start_mark)\n            end_mark = self.get_mark()\n        else:\n            end_mark = self.get_mark()\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        self.scan_directive_ignored_line(start_mark)\n        return DirectiveToken(name, value, start_mark, end_mark)\n\n    def scan_directive_name(self, start_mark):\n        # See the specification for details.\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        return value\n\n    def scan_yaml_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        major = self.scan_yaml_directive_number(start_mark)\n        if self.peek() != '.':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or '.', but found %r\" % self.peek(),\n                    self.get_mark())\n        self.forward()\n        minor = self.scan_yaml_directive_number(start_mark)\n        if self.peek() not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or ' ', but found %r\" % self.peek(),\n                    self.get_mark())\n        return (major, minor)\n\n    def scan_yaml_directive_number(self, start_mark):\n        # See the specification for details.\n        ch = self.peek()\n        if not ('0' <= ch <= '9'):\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit, but found %r\" % ch, self.get_mark())\n        length = 0\n        while '0' <= self.peek(length) <= '9':\n            length += 1\n        value = int(self.prefix(length))\n        self.forward(length)\n        return value\n\n    def scan_tag_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        handle = self.scan_tag_directive_handle(start_mark)\n        while self.peek() == ' ':\n            self.forward()\n        prefix = self.scan_tag_directive_prefix(start_mark)\n        return (handle, prefix)\n\n    def scan_tag_directive_handle(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_handle('directive', start_mark)\n        ch = self.peek()\n        if ch != ' ':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        return value\n\n    def scan_tag_directive_prefix(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_uri('directive', start_mark)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        return value\n\n    def scan_directive_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        if self.peek() == '#':\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a comment or a line break, but found %r\"\n                        % ch, self.get_mark())\n        self.scan_line_break()\n\n    def scan_anchor(self, TokenClass):\n        # The specification does not restrict characters for anchors and\n        # aliases. This may lead to problems, for instance, the document:\n        #   [ *alias, value ]\n        # can be interpreted in two ways, as\n        #   [ \"value\" ]\n        # and\n        #   [ *alias , \"value\" ]\n        # Therefore we restrict aliases to numbers and ASCII letters.\n        start_mark = self.get_mark()\n        indicator = self.peek()\n        if indicator == '*':\n            name = 'alias'\n        else:\n            name = 'anchor'\n        self.forward()\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029?:,]}%@`':\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        end_mark = self.get_mark()\n        return TokenClass(value, start_mark, end_mark)\n\n    def scan_tag(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        ch = self.peek(1)\n        if ch == '<':\n            handle = None\n            self.forward(2)\n            suffix = self.scan_tag_uri('tag', start_mark)\n            if self.peek() != '>':\n                raise ScannerError(\"while parsing a tag\", start_mark,\n                        \"expected '>', but found %r\" % self.peek(),\n                        self.get_mark())\n            self.forward()\n        elif ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n            handle = None\n            suffix = '!'\n            self.forward()\n        else:\n            length = 1\n            use_handle = False\n            while ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n                if ch == '!':\n                    use_handle = True\n                    break\n                length += 1\n                ch = self.peek(length)\n            handle = '!'\n            if use_handle:\n                handle = self.scan_tag_handle('tag', start_mark)\n            else:\n                handle = '!'\n                self.forward()\n            suffix = self.scan_tag_uri('tag', start_mark)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a tag\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        value = (handle, suffix)\n        end_mark = self.get_mark()\n        return TagToken(value, start_mark, end_mark)\n\n    def scan_block_scalar(self, style):\n        # See the specification for details.\n\n        if style == '>':\n            folded = True\n        else:\n            folded = False\n\n        chunks = []\n        start_mark = self.get_mark()\n\n        # Scan the header.\n        self.forward()\n        chomping, increment = self.scan_block_scalar_indicators(start_mark)\n        self.scan_block_scalar_ignored_line(start_mark)\n\n        # Determine the indentation level and go to the first non-empty line.\n        min_indent = self.indent+1\n        if min_indent < 1:\n            min_indent = 1\n        if increment is None:\n            breaks, max_indent, end_mark = self.scan_block_scalar_indentation()\n            indent = max(min_indent, max_indent)\n        else:\n            indent = min_indent+increment-1\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n        line_break = ''\n\n        # Scan the inner part of the block scalar.\n        while self.column == indent and self.peek() != '\\0':\n            chunks.extend(breaks)\n            leading_non_space = self.peek() not in ' \\t'\n            length = 0\n            while self.peek(length) not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            line_break = self.scan_line_break()\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n            if self.column == indent and self.peek() != '\\0':\n\n                # Unfortunately, folding rules are ambiguous.\n                #\n                # This is the folding according to the specification:\n                \n                if folded and line_break == '\\n'    \\\n                        and leading_non_space and self.peek() not in ' \\t':\n                    if not breaks:\n                        chunks.append(' ')\n                else:\n                    chunks.append(line_break)\n                \n                # This is Clark Evans's interpretation (also in the spec\n                # examples):\n                #\n                #if folded and line_break == '\\n':\n                #    if not breaks:\n                #        if self.peek() not in ' \\t':\n                #            chunks.append(' ')\n                #        else:\n                #            chunks.append(line_break)\n                #else:\n                #    chunks.append(line_break)\n            else:\n                break\n\n        # Chomp the tail.\n        if chomping is not False:\n            chunks.append(line_break)\n        if chomping is True:\n            chunks.extend(breaks)\n\n        # We are done.\n        return ScalarToken(''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    def scan_block_scalar_indicators(self, start_mark):\n        # See the specification for details.\n        chomping = None\n        increment = None\n        ch = self.peek()\n        if ch in '+-':\n            if ch == '+':\n                chomping = True\n            else:\n                chomping = False\n            self.forward()\n            ch = self.peek()\n            if ch in '0123456789':\n                increment = int(ch)\n                if increment == 0:\n                    raise ScannerError(\"while scanning a block scalar\", start_mark,\n                            \"expected indentation indicator in the range 1-9, but found 0\",\n                            self.get_mark())\n                self.forward()\n        elif ch in '0123456789':\n            increment = int(ch)\n            if increment == 0:\n                raise ScannerError(\"while scanning a block scalar\", start_mark,\n                        \"expected indentation indicator in the range 1-9, but found 0\",\n                        self.get_mark())\n            self.forward()\n            ch = self.peek()\n            if ch in '+-':\n                if ch == '+':\n                    chomping = True\n                else:\n                    chomping = False\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected chomping or indentation indicators, but found %r\"\n                    % ch, self.get_mark())\n        return chomping, increment\n\n    def scan_block_scalar_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        if self.peek() == '#':\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected a comment or a line break, but found %r\" % ch,\n                    self.get_mark())\n        self.scan_line_break()\n\n    def scan_block_scalar_indentation(self):\n        # See the specification for details.\n        chunks = []\n        max_indent = 0\n        end_mark = self.get_mark()\n        while self.peek() in ' \\r\\n\\x85\\u2028\\u2029':\n            if self.peek() != ' ':\n                chunks.append(self.scan_line_break())\n                end_mark = self.get_mark()\n            else:\n                self.forward()\n                if self.column > max_indent:\n                    max_indent = self.column\n        return chunks, max_indent, end_mark\n\n    def scan_block_scalar_breaks(self, indent):\n        # See the specification for details.\n        chunks = []\n        end_mark = self.get_mark()\n        while self.column < indent and self.peek() == ' ':\n            self.forward()\n        while self.peek() in '\\r\\n\\x85\\u2028\\u2029':\n            chunks.append(self.scan_line_break())\n            end_mark = self.get_mark()\n            while self.column < indent and self.peek() == ' ':\n                self.forward()\n        return chunks, end_mark\n\n    def scan_flow_scalar(self, style):\n        # See the specification for details.\n        # Note that we loose indentation rules for quoted scalars. Quoted\n        # scalars don't need to adhere indentation because \" and ' clearly\n        # mark the beginning and the end of them. Therefore we are less\n        # restrictive then the specification requires. We only need to check\n        # that document separators are not included in scalars.\n        if style == '\"':\n            double = True\n        else:\n            double = False\n        chunks = []\n        start_mark = self.get_mark()\n        quote = self.peek()\n        self.forward()\n        chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        while self.peek() != quote:\n            chunks.extend(self.scan_flow_scalar_spaces(double, start_mark))\n            chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        self.forward()\n        end_mark = self.get_mark()\n        return ScalarToken(''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    ESCAPE_REPLACEMENTS = {\n        '0':    '\\0',\n        'a':    '\\x07',\n        'b':    '\\x08',\n        't':    '\\x09',\n        '\\t':   '\\x09',\n        'n':    '\\x0A',\n        'v':    '\\x0B',\n        'f':    '\\x0C',\n        'r':    '\\x0D',\n        'e':    '\\x1B',\n        ' ':    '\\x20',\n        '\\\"':   '\\\"',\n        '\\\\':   '\\\\',\n        '/':    '/',\n        'N':    '\\x85',\n        '_':    '\\xA0',\n        'L':    '\\u2028',\n        'P':    '\\u2029',\n    }\n\n    ESCAPE_CODES = {\n        'x':    2,\n        'u':    4,\n        'U':    8,\n    }\n\n    def scan_flow_scalar_non_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            length = 0\n            while self.peek(length) not in '\\'\\\"\\\\\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            if length:\n                chunks.append(self.prefix(length))\n                self.forward(length)\n            ch = self.peek()\n            if not double and ch == '\\'' and self.peek(1) == '\\'':\n                chunks.append('\\'')\n                self.forward(2)\n            elif (double and ch == '\\'') or (not double and ch in '\\\"\\\\'):\n                chunks.append(ch)\n                self.forward()\n            elif double and ch == '\\\\':\n                self.forward()\n                ch = self.peek()\n                if ch in self.ESCAPE_REPLACEMENTS:\n                    chunks.append(self.ESCAPE_REPLACEMENTS[ch])\n                    self.forward()\n                elif ch in self.ESCAPE_CODES:\n                    length = self.ESCAPE_CODES[ch]\n                    self.forward()\n                    for k in range(length):\n                        if self.peek(k) not in '0123456789ABCDEFabcdef':\n                            raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                                    \"expected escape sequence of %d hexdecimal numbers, but found %r\" %\n                                        (length, self.peek(k)), self.get_mark())\n                    code = int(self.prefix(length), 16)\n                    chunks.append(chr(code))\n                    self.forward(length)\n                elif ch in '\\r\\n\\x85\\u2028\\u2029':\n                    self.scan_line_break()\n                    chunks.extend(self.scan_flow_scalar_breaks(double, start_mark))\n                else:\n                    raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                            \"found unknown escape character %r\" % ch, self.get_mark())\n            else:\n                return chunks\n\n    def scan_flow_scalar_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        length = 0\n        while self.peek(length) in ' \\t':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch == '\\0':\n            raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                    \"found unexpected end of stream\", self.get_mark())\n        elif ch in '\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            breaks = self.scan_flow_scalar_breaks(double, start_mark)\n            if line_break != '\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(' ')\n            chunks.extend(breaks)\n        else:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_flow_scalar_breaks(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            # Instead of checking indentation, we check for document\n            # separators.\n            prefix = self.prefix(3)\n            if (prefix == '---' or prefix == '...')   \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                        \"found unexpected document separator\", self.get_mark())\n            while self.peek() in ' \\t':\n                self.forward()\n            if self.peek() in '\\r\\n\\x85\\u2028\\u2029':\n                chunks.append(self.scan_line_break())\n            else:\n                return chunks\n\n    def scan_plain(self):\n        # See the specification for details.\n        # We add an additional restriction for the flow context:\n        #   plain scalars in the flow context cannot contain ',' or '?'.\n        # We also keep track of the `allow_simple_key` flag here.\n        # Indentation rules are loosed for the flow context.\n        chunks = []\n        start_mark = self.get_mark()\n        end_mark = start_mark\n        indent = self.indent+1\n        # We allow zero indentation for scalars, but then we need to check for\n        # document separators at the beginning of the line.\n        #if indent == 0:\n        #    indent = 1\n        spaces = []\n        while True:\n            length = 0\n            if self.peek() == '#':\n                break\n            while True:\n                ch = self.peek(length)\n                if ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'    \\\n                        or (ch == ':' and\n                                self.peek(length+1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n                                      + (u',[]{}' if self.flow_level else u''))\\\n                        or (self.flow_level and ch in ',?[]{}'):\n                    break\n                length += 1\n            if length == 0:\n                break\n            self.allow_simple_key = False\n            chunks.extend(spaces)\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            end_mark = self.get_mark()\n            spaces = self.scan_plain_spaces(indent, start_mark)\n            if not spaces or self.peek() == '#' \\\n                    or (not self.flow_level and self.column < indent):\n                break\n        return ScalarToken(''.join(chunks), True, start_mark, end_mark)\n\n    def scan_plain_spaces(self, indent, start_mark):\n        # See the specification for details.\n        # The specification is really confusing about tabs in plain scalars.\n        # We just forbid them completely. Do not use tabs in YAML!\n        chunks = []\n        length = 0\n        while self.peek(length) in ' ':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch in '\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            self.allow_simple_key = True\n            prefix = self.prefix(3)\n            if (prefix == '---' or prefix == '...')   \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return\n            breaks = []\n            while self.peek() in ' \\r\\n\\x85\\u2028\\u2029':\n                if self.peek() == ' ':\n                    self.forward()\n                else:\n                    breaks.append(self.scan_line_break())\n                    prefix = self.prefix(3)\n                    if (prefix == '---' or prefix == '...')   \\\n                            and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                        return\n            if line_break != '\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(' ')\n            chunks.extend(breaks)\n        elif whitespaces:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_tag_handle(self, name, start_mark):\n        # See the specification for details.\n        # For some strange reasons, the specification does not allow '_' in\n        # tag handles. I have allowed it anyway.\n        ch = self.peek()\n        if ch != '!':\n            raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                    \"expected '!', but found %r\" % ch, self.get_mark())\n        length = 1\n        ch = self.peek(length)\n        if ch != ' ':\n            while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                    or ch in '-_':\n                length += 1\n                ch = self.peek(length)\n            if ch != '!':\n                self.forward(length)\n                raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                        \"expected '!', but found %r\" % ch, self.get_mark())\n            length += 1\n        value = self.prefix(length)\n        self.forward(length)\n        return value\n\n    def scan_tag_uri(self, name, start_mark):\n        # See the specification for details.\n        # Note: we do not check if URI is well-formed.\n        chunks = []\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-;/?:@&=+$,_.!~*\\'()[]%':\n            if ch == '%':\n                chunks.append(self.prefix(length))\n                self.forward(length)\n                length = 0\n                chunks.append(self.scan_uri_escapes(name, start_mark))\n            else:\n                length += 1\n            ch = self.peek(length)\n        if length:\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            length = 0\n        if not chunks:\n            raise ScannerError(\"while parsing a %s\" % name, start_mark,\n                    \"expected URI, but found %r\" % ch, self.get_mark())\n        return ''.join(chunks)\n\n    def scan_uri_escapes(self, name, start_mark):\n        # See the specification for details.\n        codes = []\n        mark = self.get_mark()\n        while self.peek() == '%':\n            self.forward()\n            for k in range(2):\n                if self.peek(k) not in '0123456789ABCDEFabcdef':\n                    raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                            \"expected URI escape sequence of 2 hexdecimal numbers, but found %r\"\n                            % self.peek(k), self.get_mark())\n            codes.append(int(self.prefix(2), 16))\n            self.forward(2)\n        try:\n            value = bytes(codes).decode('utf-8')\n        except UnicodeDecodeError as exc:\n            raise ScannerError(\"while scanning a %s\" % name, start_mark, str(exc), mark)\n        return value\n\n    def scan_line_break(self):\n        # Transforms:\n        #   '\\r\\n'      :   '\\n'\n        #   '\\r'        :   '\\n'\n        #   '\\n'        :   '\\n'\n        #   '\\x85'      :   '\\n'\n        #   '\\u2028'    :   '\\u2028'\n        #   '\\u2029     :   '\\u2029'\n        #   default     :   ''\n        ch = self.peek()\n        if ch in '\\r\\n\\x85':\n            if self.prefix(2) == '\\r\\n':\n                self.forward(2)\n            else:\n                self.forward()\n            return '\\n'\n        elif ch in '\\u2028\\u2029':\n            self.forward()\n            return ch\n        return ''\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/serializer.py",
    "content": "\n__all__ = ['Serializer', 'SerializerError']\n\nfrom .error import YAMLError\nfrom .events import *\nfrom .nodes import *\n\nclass SerializerError(YAMLError):\n    pass\n\nclass Serializer:\n\n    ANCHOR_TEMPLATE = 'id%03d'\n\n    def __init__(self, encoding=None,\n            explicit_start=None, explicit_end=None, version=None, tags=None):\n        self.use_encoding = encoding\n        self.use_explicit_start = explicit_start\n        self.use_explicit_end = explicit_end\n        self.use_version = version\n        self.use_tags = tags\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n        self.closed = None\n\n    def open(self):\n        if self.closed is None:\n            self.emit(StreamStartEvent(encoding=self.use_encoding))\n            self.closed = False\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        else:\n            raise SerializerError(\"serializer is already opened\")\n\n    def close(self):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif not self.closed:\n            self.emit(StreamEndEvent())\n            self.closed = True\n\n    #def __del__(self):\n    #    self.close()\n\n    def serialize(self, node):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        self.emit(DocumentStartEvent(explicit=self.use_explicit_start,\n            version=self.use_version, tags=self.use_tags))\n        self.anchor_node(node)\n        self.serialize_node(node, None, None)\n        self.emit(DocumentEndEvent(explicit=self.use_explicit_end))\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n\n    def anchor_node(self, node):\n        if node in self.anchors:\n            if self.anchors[node] is None:\n                self.anchors[node] = self.generate_anchor(node)\n        else:\n            self.anchors[node] = None\n            if isinstance(node, SequenceNode):\n                for item in node.value:\n                    self.anchor_node(item)\n            elif isinstance(node, MappingNode):\n                for key, value in node.value:\n                    self.anchor_node(key)\n                    self.anchor_node(value)\n\n    def generate_anchor(self, node):\n        self.last_anchor_id += 1\n        return self.ANCHOR_TEMPLATE % self.last_anchor_id\n\n    def serialize_node(self, node, parent, index):\n        alias = self.anchors[node]\n        if node in self.serialized_nodes:\n            self.emit(AliasEvent(alias))\n        else:\n            self.serialized_nodes[node] = True\n            self.descend_resolver(parent, index)\n            if isinstance(node, ScalarNode):\n                detected_tag = self.resolve(ScalarNode, node.value, (True, False))\n                default_tag = self.resolve(ScalarNode, node.value, (False, True))\n                implicit = (node.tag == detected_tag), (node.tag == default_tag)\n                self.emit(ScalarEvent(alias, node.tag, implicit, node.value,\n                    style=node.style))\n            elif isinstance(node, SequenceNode):\n                implicit = (node.tag\n                            == self.resolve(SequenceNode, node.value, True))\n                self.emit(SequenceStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                index = 0\n                for item in node.value:\n                    self.serialize_node(item, node, index)\n                    index += 1\n                self.emit(SequenceEndEvent())\n            elif isinstance(node, MappingNode):\n                implicit = (node.tag\n                            == self.resolve(MappingNode, node.value, True))\n                self.emit(MappingStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                for key, value in node.value:\n                    self.serialize_node(key, node, None)\n                    self.serialize_node(value, node, key)\n                self.emit(MappingEndEvent())\n            self.ascend_resolver()\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml/yaml/tokens.py",
    "content": "\nclass Token(object):\n    def __init__(self, start_mark, end_mark):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in self.__dict__\n                if not key.endswith('_mark')]\n        attributes.sort()\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\n#class BOMToken(Token):\n#    id = '<byte order mark>'\n\nclass DirectiveToken(Token):\n    id = '<directive>'\n    def __init__(self, name, value, start_mark, end_mark):\n        self.name = name\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass DocumentStartToken(Token):\n    id = '<document start>'\n\nclass DocumentEndToken(Token):\n    id = '<document end>'\n\nclass StreamStartToken(Token):\n    id = '<stream start>'\n    def __init__(self, start_mark=None, end_mark=None,\n            encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndToken(Token):\n    id = '<stream end>'\n\nclass BlockSequenceStartToken(Token):\n    id = '<block sequence start>'\n\nclass BlockMappingStartToken(Token):\n    id = '<block mapping start>'\n\nclass BlockEndToken(Token):\n    id = '<block end>'\n\nclass FlowSequenceStartToken(Token):\n    id = '['\n\nclass FlowMappingStartToken(Token):\n    id = '{'\n\nclass FlowSequenceEndToken(Token):\n    id = ']'\n\nclass FlowMappingEndToken(Token):\n    id = '}'\n\nclass KeyToken(Token):\n    id = '?'\n\nclass ValueToken(Token):\n    id = ':'\n\nclass BlockEntryToken(Token):\n    id = '-'\n\nclass FlowEntryToken(Token):\n    id = ','\n\nclass AliasToken(Token):\n    id = '<alias>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass AnchorToken(Token):\n    id = '<anchor>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass TagToken(Token):\n    id = '<tag>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass ScalarToken(Token):\n    id = '<scalar>'\n    def __init__(self, value, plain, start_mark, end_mark, style=None):\n        self.value = value\n        self.plain = plain\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/LICENSE",
    "content": "Copyright (c) 2017-2018 Ingy döt Net\nCopyright (c) 2006-2016 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/__init__.py",
    "content": "\nfrom error import *\n\nfrom tokens import *\nfrom events import *\nfrom nodes import *\n\nfrom loader import *\nfrom dumper import *\n\n__version__ = '3.13'\n\ntry:\n    from cyaml import *\n    __with_libyaml__ = True\nexcept ImportError:\n    __with_libyaml__ = False\n\ndef scan(stream, Loader=Loader):\n    \"\"\"\n    Scan a YAML stream and produce scanning tokens.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_token():\n            yield loader.get_token()\n    finally:\n        loader.dispose()\n\ndef parse(stream, Loader=Loader):\n    \"\"\"\n    Parse a YAML stream and produce parsing events.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_event():\n            yield loader.get_event()\n    finally:\n        loader.dispose()\n\ndef compose(stream, Loader=Loader):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding representation tree.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        return loader.get_single_node()\n    finally:\n        loader.dispose()\n\ndef compose_all(stream, Loader=Loader):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding representation trees.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_node():\n            yield loader.get_node()\n    finally:\n        loader.dispose()\n\ndef load(stream, Loader=Loader):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        return loader.get_single_data()\n    finally:\n        loader.dispose()\n\ndef load_all(stream, Loader=Loader):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_data():\n            yield loader.get_data()\n    finally:\n        loader.dispose()\n\ndef safe_load(stream):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n    Resolve only basic YAML tags.\n    \"\"\"\n    return load(stream, SafeLoader)\n\ndef safe_load_all(stream):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n    Resolve only basic YAML tags.\n    \"\"\"\n    return load_all(stream, SafeLoader)\n\ndef emit(events, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None):\n    \"\"\"\n    Emit YAML parsing events into a stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        from StringIO import StringIO\n        stream = StringIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break)\n    try:\n        for event in events:\n            dumper.emit(event)\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize_all(nodes, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding='utf-8', explicit_start=None, explicit_end=None,\n        version=None, tags=None):\n    \"\"\"\n    Serialize a sequence of representation trees into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            from StringIO import StringIO\n        else:\n            from cStringIO import StringIO\n        stream = StringIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end)\n    try:\n        dumper.open()\n        for node in nodes:\n            dumper.serialize(node)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize(node, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a representation tree into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return serialize_all([node], stream, Dumper=Dumper, **kwds)\n\ndef dump_all(documents, stream=None, Dumper=Dumper,\n        default_style=None, default_flow_style=None,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding='utf-8', explicit_start=None, explicit_end=None,\n        version=None, tags=None):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            from StringIO import StringIO\n        else:\n            from cStringIO import StringIO\n        stream = StringIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, default_style=default_style,\n            default_flow_style=default_flow_style,\n            canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end)\n    try:\n        dumper.open()\n        for data in documents:\n            dumper.represent(data)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef dump(data, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=Dumper, **kwds)\n\ndef safe_dump_all(documents, stream=None, **kwds):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all(documents, stream, Dumper=SafeDumper, **kwds)\n\ndef safe_dump(data, stream=None, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=SafeDumper, **kwds)\n\ndef add_implicit_resolver(tag, regexp, first=None,\n        Loader=Loader, Dumper=Dumper):\n    \"\"\"\n    Add an implicit scalar detector.\n    If an implicit scalar value matches the given regexp,\n    the corresponding tag is assigned to the scalar.\n    first is a sequence of possible initial characters or None.\n    \"\"\"\n    Loader.add_implicit_resolver(tag, regexp, first)\n    Dumper.add_implicit_resolver(tag, regexp, first)\n\ndef add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):\n    \"\"\"\n    Add a path based resolver for the given tag.\n    A path is a list of keys that forms a path\n    to a node in the representation tree.\n    Keys can be string values, integers, or None.\n    \"\"\"\n    Loader.add_path_resolver(tag, path, kind)\n    Dumper.add_path_resolver(tag, path, kind)\n\ndef add_constructor(tag, constructor, Loader=Loader):\n    \"\"\"\n    Add a constructor for the given tag.\n    Constructor is a function that accepts a Loader instance\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    Loader.add_constructor(tag, constructor)\n\ndef add_multi_constructor(tag_prefix, multi_constructor, Loader=Loader):\n    \"\"\"\n    Add a multi-constructor for the given tag prefix.\n    Multi-constructor is called for a node if its tag starts with tag_prefix.\n    Multi-constructor accepts a Loader instance, a tag suffix,\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    Loader.add_multi_constructor(tag_prefix, multi_constructor)\n\ndef add_representer(data_type, representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Representer is a function accepting a Dumper instance\n    and an instance of the given data type\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_representer(data_type, representer)\n\ndef add_multi_representer(data_type, multi_representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Multi-representer is a function accepting a Dumper instance\n    and an instance of the given data type or subtype\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_multi_representer(data_type, multi_representer)\n\nclass YAMLObjectMetaclass(type):\n    \"\"\"\n    The metaclass for YAMLObject.\n    \"\"\"\n    def __init__(cls, name, bases, kwds):\n        super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds)\n        if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None:\n            cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml)\n            cls.yaml_dumper.add_representer(cls, cls.to_yaml)\n\nclass YAMLObject(object):\n    \"\"\"\n    An object that can dump itself to a YAML stream\n    and load itself from a YAML stream.\n    \"\"\"\n\n    __metaclass__ = YAMLObjectMetaclass\n    __slots__ = ()  # no direct instantiation, so allow immutable subclasses\n\n    yaml_loader = Loader\n    yaml_dumper = Dumper\n\n    yaml_tag = None\n    yaml_flow_style = None\n\n    def from_yaml(cls, loader, node):\n        \"\"\"\n        Convert a representation node to a Python object.\n        \"\"\"\n        return loader.construct_yaml_object(node, cls)\n    from_yaml = classmethod(from_yaml)\n\n    def to_yaml(cls, dumper, data):\n        \"\"\"\n        Convert a Python object to a representation node.\n        \"\"\"\n        return dumper.represent_yaml_object(cls.yaml_tag, data, cls,\n                flow_style=cls.yaml_flow_style)\n    to_yaml = classmethod(to_yaml)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/composer.py",
    "content": "\n__all__ = ['Composer', 'ComposerError']\n\nfrom error import MarkedYAMLError\nfrom events import *\nfrom nodes import *\n\nclass ComposerError(MarkedYAMLError):\n    pass\n\nclass Composer(object):\n\n    def __init__(self):\n        self.anchors = {}\n\n    def check_node(self):\n        # Drop the STREAM-START event.\n        if self.check_event(StreamStartEvent):\n            self.get_event()\n\n        # If there are more documents available?\n        return not self.check_event(StreamEndEvent)\n\n    def get_node(self):\n        # Get the root node of the next document.\n        if not self.check_event(StreamEndEvent):\n            return self.compose_document()\n\n    def get_single_node(self):\n        # Drop the STREAM-START event.\n        self.get_event()\n\n        # Compose a document if the stream is not empty.\n        document = None\n        if not self.check_event(StreamEndEvent):\n            document = self.compose_document()\n\n        # Ensure that the stream contains no more documents.\n        if not self.check_event(StreamEndEvent):\n            event = self.get_event()\n            raise ComposerError(\"expected a single document in the stream\",\n                    document.start_mark, \"but found another document\",\n                    event.start_mark)\n\n        # Drop the STREAM-END event.\n        self.get_event()\n\n        return document\n\n    def compose_document(self):\n        # Drop the DOCUMENT-START event.\n        self.get_event()\n\n        # Compose the root node.\n        node = self.compose_node(None, None)\n\n        # Drop the DOCUMENT-END event.\n        self.get_event()\n\n        self.anchors = {}\n        return node\n\n    def compose_node(self, parent, index):\n        if self.check_event(AliasEvent):\n            event = self.get_event()\n            anchor = event.anchor\n            if anchor not in self.anchors:\n                raise ComposerError(None, None, \"found undefined alias %r\"\n                        % anchor.encode('utf-8'), event.start_mark)\n            return self.anchors[anchor]\n        event = self.peek_event()\n        anchor = event.anchor\n        if anchor is not None:\n            if anchor in self.anchors:\n                raise ComposerError(\"found duplicate anchor %r; first occurence\"\n                        % anchor.encode('utf-8'), self.anchors[anchor].start_mark,\n                        \"second occurence\", event.start_mark)\n        self.descend_resolver(parent, index)\n        if self.check_event(ScalarEvent):\n            node = self.compose_scalar_node(anchor)\n        elif self.check_event(SequenceStartEvent):\n            node = self.compose_sequence_node(anchor)\n        elif self.check_event(MappingStartEvent):\n            node = self.compose_mapping_node(anchor)\n        self.ascend_resolver()\n        return node\n\n    def compose_scalar_node(self, anchor):\n        event = self.get_event()\n        tag = event.tag\n        if tag is None or tag == u'!':\n            tag = self.resolve(ScalarNode, event.value, event.implicit)\n        node = ScalarNode(tag, event.value,\n                event.start_mark, event.end_mark, style=event.style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        return node\n\n    def compose_sequence_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == u'!':\n            tag = self.resolve(SequenceNode, None, start_event.implicit)\n        node = SequenceNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        index = 0\n        while not self.check_event(SequenceEndEvent):\n            node.value.append(self.compose_node(node, index))\n            index += 1\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n    def compose_mapping_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == u'!':\n            tag = self.resolve(MappingNode, None, start_event.implicit)\n        node = MappingNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        while not self.check_event(MappingEndEvent):\n            #key_event = self.peek_event()\n            item_key = self.compose_node(node, None)\n            #if item_key in node.value:\n            #    raise ComposerError(\"while composing a mapping\", start_event.start_mark,\n            #            \"found duplicate key\", key_event.start_mark)\n            item_value = self.compose_node(node, item_key)\n            #node.value[item_key] = item_value\n            node.value.append((item_key, item_value))\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/constructor.py",
    "content": "\n__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',\n    'ConstructorError']\n\nfrom error import *\nfrom nodes import *\n\nimport datetime\n\nimport binascii, re, sys, types\n\nclass ConstructorError(MarkedYAMLError):\n    pass\n\nclass BaseConstructor(object):\n\n    yaml_constructors = {}\n    yaml_multi_constructors = {}\n\n    def __init__(self):\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.state_generators = []\n        self.deep_construct = False\n\n    def check_data(self):\n        # If there are more documents available?\n        return self.check_node()\n\n    def get_data(self):\n        # Construct and return the next document.\n        if self.check_node():\n            return self.construct_document(self.get_node())\n\n    def get_single_data(self):\n        # Ensure that the stream contains a single document and construct it.\n        node = self.get_single_node()\n        if node is not None:\n            return self.construct_document(node)\n        return None\n\n    def construct_document(self, node):\n        data = self.construct_object(node)\n        while self.state_generators:\n            state_generators = self.state_generators\n            self.state_generators = []\n            for generator in state_generators:\n                for dummy in generator:\n                    pass\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.deep_construct = False\n        return data\n\n    def construct_object(self, node, deep=False):\n        if node in self.constructed_objects:\n            return self.constructed_objects[node]\n        if deep:\n            old_deep = self.deep_construct\n            self.deep_construct = True\n        if node in self.recursive_objects:\n            raise ConstructorError(None, None,\n                    \"found unconstructable recursive node\", node.start_mark)\n        self.recursive_objects[node] = None\n        constructor = None\n        tag_suffix = None\n        if node.tag in self.yaml_constructors:\n            constructor = self.yaml_constructors[node.tag]\n        else:\n            for tag_prefix in self.yaml_multi_constructors:\n                if node.tag.startswith(tag_prefix):\n                    tag_suffix = node.tag[len(tag_prefix):]\n                    constructor = self.yaml_multi_constructors[tag_prefix]\n                    break\n            else:\n                if None in self.yaml_multi_constructors:\n                    tag_suffix = node.tag\n                    constructor = self.yaml_multi_constructors[None]\n                elif None in self.yaml_constructors:\n                    constructor = self.yaml_constructors[None]\n                elif isinstance(node, ScalarNode):\n                    constructor = self.__class__.construct_scalar\n                elif isinstance(node, SequenceNode):\n                    constructor = self.__class__.construct_sequence\n                elif isinstance(node, MappingNode):\n                    constructor = self.__class__.construct_mapping\n        if tag_suffix is None:\n            data = constructor(self, node)\n        else:\n            data = constructor(self, tag_suffix, node)\n        if isinstance(data, types.GeneratorType):\n            generator = data\n            data = generator.next()\n            if self.deep_construct:\n                for dummy in generator:\n                    pass\n            else:\n                self.state_generators.append(generator)\n        self.constructed_objects[node] = data\n        del self.recursive_objects[node]\n        if deep:\n            self.deep_construct = old_deep\n        return data\n\n    def construct_scalar(self, node):\n        if not isinstance(node, ScalarNode):\n            raise ConstructorError(None, None,\n                    \"expected a scalar node, but found %s\" % node.id,\n                    node.start_mark)\n        return node.value\n\n    def construct_sequence(self, node, deep=False):\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(None, None,\n                    \"expected a sequence node, but found %s\" % node.id,\n                    node.start_mark)\n        return [self.construct_object(child, deep=deep)\n                for child in node.value]\n\n    def construct_mapping(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        mapping = {}\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            try:\n                hash(key)\n            except TypeError, exc:\n                raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                        \"found unacceptable key (%s)\" % exc, key_node.start_mark)\n            value = self.construct_object(value_node, deep=deep)\n            mapping[key] = value\n        return mapping\n\n    def construct_pairs(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        pairs = []\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            value = self.construct_object(value_node, deep=deep)\n            pairs.append((key, value))\n        return pairs\n\n    def add_constructor(cls, tag, constructor):\n        if not 'yaml_constructors' in cls.__dict__:\n            cls.yaml_constructors = cls.yaml_constructors.copy()\n        cls.yaml_constructors[tag] = constructor\n    add_constructor = classmethod(add_constructor)\n\n    def add_multi_constructor(cls, tag_prefix, multi_constructor):\n        if not 'yaml_multi_constructors' in cls.__dict__:\n            cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy()\n        cls.yaml_multi_constructors[tag_prefix] = multi_constructor\n    add_multi_constructor = classmethod(add_multi_constructor)\n\nclass SafeConstructor(BaseConstructor):\n\n    def construct_scalar(self, node):\n        if isinstance(node, MappingNode):\n            for key_node, value_node in node.value:\n                if key_node.tag == u'tag:yaml.org,2002:value':\n                    return self.construct_scalar(value_node)\n        return BaseConstructor.construct_scalar(self, node)\n\n    def flatten_mapping(self, node):\n        merge = []\n        index = 0\n        while index < len(node.value):\n            key_node, value_node = node.value[index]\n            if key_node.tag == u'tag:yaml.org,2002:merge':\n                del node.value[index]\n                if isinstance(value_node, MappingNode):\n                    self.flatten_mapping(value_node)\n                    merge.extend(value_node.value)\n                elif isinstance(value_node, SequenceNode):\n                    submerge = []\n                    for subnode in value_node.value:\n                        if not isinstance(subnode, MappingNode):\n                            raise ConstructorError(\"while constructing a mapping\",\n                                    node.start_mark,\n                                    \"expected a mapping for merging, but found %s\"\n                                    % subnode.id, subnode.start_mark)\n                        self.flatten_mapping(subnode)\n                        submerge.append(subnode.value)\n                    submerge.reverse()\n                    for value in submerge:\n                        merge.extend(value)\n                else:\n                    raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                            \"expected a mapping or list of mappings for merging, but found %s\"\n                            % value_node.id, value_node.start_mark)\n            elif key_node.tag == u'tag:yaml.org,2002:value':\n                key_node.tag = u'tag:yaml.org,2002:str'\n                index += 1\n            else:\n                index += 1\n        if merge:\n            node.value = merge + node.value\n\n    def construct_mapping(self, node, deep=False):\n        if isinstance(node, MappingNode):\n            self.flatten_mapping(node)\n        return BaseConstructor.construct_mapping(self, node, deep=deep)\n\n    def construct_yaml_null(self, node):\n        self.construct_scalar(node)\n        return None\n\n    bool_values = {\n        u'yes':     True,\n        u'no':      False,\n        u'true':    True,\n        u'false':   False,\n        u'on':      True,\n        u'off':     False,\n    }\n\n    def construct_yaml_bool(self, node):\n        value = self.construct_scalar(node)\n        return self.bool_values[value.lower()]\n\n    def construct_yaml_int(self, node):\n        value = str(self.construct_scalar(node))\n        value = value.replace('_', '')\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '0':\n            return 0\n        elif value.startswith('0b'):\n            return sign*int(value[2:], 2)\n        elif value.startswith('0x'):\n            return sign*int(value[2:], 16)\n        elif value[0] == '0':\n            return sign*int(value, 8)\n        elif ':' in value:\n            digits = [int(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*int(value)\n\n    inf_value = 1e300\n    while inf_value != inf_value*inf_value:\n        inf_value *= inf_value\n    nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).\n\n    def construct_yaml_float(self, node):\n        value = str(self.construct_scalar(node))\n        value = value.replace('_', '').lower()\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '.inf':\n            return sign*self.inf_value\n        elif value == '.nan':\n            return self.nan_value\n        elif ':' in value:\n            digits = [float(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0.0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*float(value)\n\n    def construct_yaml_binary(self, node):\n        value = self.construct_scalar(node)\n        try:\n            return str(value).decode('base64')\n        except (binascii.Error, UnicodeEncodeError), exc:\n            raise ConstructorError(None, None,\n                    \"failed to decode base64 data: %s\" % exc, node.start_mark) \n\n    timestamp_regexp = re.compile(\n            ur'''^(?P<year>[0-9][0-9][0-9][0-9])\n                -(?P<month>[0-9][0-9]?)\n                -(?P<day>[0-9][0-9]?)\n                (?:(?:[Tt]|[ \\t]+)\n                (?P<hour>[0-9][0-9]?)\n                :(?P<minute>[0-9][0-9])\n                :(?P<second>[0-9][0-9])\n                (?:\\.(?P<fraction>[0-9]*))?\n                (?:[ \\t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)\n                (?::(?P<tz_minute>[0-9][0-9]))?))?)?$''', re.X)\n\n    def construct_yaml_timestamp(self, node):\n        value = self.construct_scalar(node)\n        match = self.timestamp_regexp.match(node.value)\n        values = match.groupdict()\n        year = int(values['year'])\n        month = int(values['month'])\n        day = int(values['day'])\n        if not values['hour']:\n            return datetime.date(year, month, day)\n        hour = int(values['hour'])\n        minute = int(values['minute'])\n        second = int(values['second'])\n        fraction = 0\n        if values['fraction']:\n            fraction = values['fraction'][:6]\n            while len(fraction) < 6:\n                fraction += '0'\n            fraction = int(fraction)\n        delta = None\n        if values['tz_sign']:\n            tz_hour = int(values['tz_hour'])\n            tz_minute = int(values['tz_minute'] or 0)\n            delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute)\n            if values['tz_sign'] == '-':\n                delta = -delta\n        data = datetime.datetime(year, month, day, hour, minute, second, fraction)\n        if delta:\n            data -= delta\n        return data\n\n    def construct_yaml_omap(self, node):\n        # Note: we do not check for duplicate keys, because it's too\n        # CPU-expensive.\n        omap = []\n        yield omap\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            omap.append((key, value))\n\n    def construct_yaml_pairs(self, node):\n        # Note: the same code as `construct_yaml_omap`.\n        pairs = []\n        yield pairs\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            pairs.append((key, value))\n\n    def construct_yaml_set(self, node):\n        data = set()\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_str(self, node):\n        value = self.construct_scalar(node)\n        try:\n            return value.encode('ascii')\n        except UnicodeEncodeError:\n            return value\n\n    def construct_yaml_seq(self, node):\n        data = []\n        yield data\n        data.extend(self.construct_sequence(node))\n\n    def construct_yaml_map(self, node):\n        data = {}\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_object(self, node, cls):\n        data = cls.__new__(cls)\n        yield data\n        if hasattr(data, '__setstate__'):\n            state = self.construct_mapping(node, deep=True)\n            data.__setstate__(state)\n        else:\n            state = self.construct_mapping(node)\n            data.__dict__.update(state)\n\n    def construct_undefined(self, node):\n        raise ConstructorError(None, None,\n                \"could not determine a constructor for the tag %r\" % node.tag.encode('utf-8'),\n                node.start_mark)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:null',\n        SafeConstructor.construct_yaml_null)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:bool',\n        SafeConstructor.construct_yaml_bool)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:int',\n        SafeConstructor.construct_yaml_int)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:float',\n        SafeConstructor.construct_yaml_float)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:binary',\n        SafeConstructor.construct_yaml_binary)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:timestamp',\n        SafeConstructor.construct_yaml_timestamp)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:omap',\n        SafeConstructor.construct_yaml_omap)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:pairs',\n        SafeConstructor.construct_yaml_pairs)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:set',\n        SafeConstructor.construct_yaml_set)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:str',\n        SafeConstructor.construct_yaml_str)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:seq',\n        SafeConstructor.construct_yaml_seq)\n\nSafeConstructor.add_constructor(\n        u'tag:yaml.org,2002:map',\n        SafeConstructor.construct_yaml_map)\n\nSafeConstructor.add_constructor(None,\n        SafeConstructor.construct_undefined)\n\nclass Constructor(SafeConstructor):\n\n    def construct_python_str(self, node):\n        return self.construct_scalar(node).encode('utf-8')\n\n    def construct_python_unicode(self, node):\n        return self.construct_scalar(node)\n\n    def construct_python_long(self, node):\n        return long(self.construct_yaml_int(node))\n\n    def construct_python_complex(self, node):\n       return complex(self.construct_scalar(node))\n\n    def construct_python_tuple(self, node):\n        return tuple(self.construct_sequence(node))\n\n    def find_python_module(self, name, mark):\n        if not name:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        try:\n            __import__(name)\n        except ImportError, exc:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"cannot find module %r (%s)\" % (name.encode('utf-8'), exc), mark)\n        return sys.modules[name]\n\n    def find_python_name(self, name, mark):\n        if not name:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        if u'.' in name:\n            module_name, object_name = name.rsplit('.', 1)\n        else:\n            module_name = '__builtin__'\n            object_name = name\n        try:\n            __import__(module_name)\n        except ImportError, exc:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"cannot find module %r (%s)\" % (module_name.encode('utf-8'), exc), mark)\n        module = sys.modules[module_name]\n        if not hasattr(module, object_name):\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"cannot find %r in the module %r\" % (object_name.encode('utf-8'),\n                        module.__name__), mark)\n        return getattr(module, object_name)\n\n    def construct_python_name(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python name\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value.encode('utf-8'),\n                    node.start_mark)\n        return self.find_python_name(suffix, node.start_mark)\n\n    def construct_python_module(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python module\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value.encode('utf-8'),\n                    node.start_mark)\n        return self.find_python_module(suffix, node.start_mark)\n\n    class classobj: pass\n\n    def make_python_instance(self, suffix, node,\n            args=None, kwds=None, newobj=False):\n        if not args:\n            args = []\n        if not kwds:\n            kwds = {}\n        cls = self.find_python_name(suffix, node.start_mark)\n        if newobj and isinstance(cls, type(self.classobj))  \\\n                and not args and not kwds:\n            instance = self.classobj()\n            instance.__class__ = cls\n            return instance\n        elif newobj and isinstance(cls, type):\n            return cls.__new__(cls, *args, **kwds)\n        else:\n            return cls(*args, **kwds)\n\n    def set_python_instance_state(self, instance, state):\n        if hasattr(instance, '__setstate__'):\n            instance.__setstate__(state)\n        else:\n            slotstate = {}\n            if isinstance(state, tuple) and len(state) == 2:\n                state, slotstate = state\n            if hasattr(instance, '__dict__'):\n                instance.__dict__.update(state)\n            elif state:\n                slotstate.update(state)\n            for key, value in slotstate.items():\n                setattr(object, key, value)\n\n    def construct_python_object(self, suffix, node):\n        # Format:\n        #   !!python/object:module.name { ... state ... }\n        instance = self.make_python_instance(suffix, node, newobj=True)\n        yield instance\n        deep = hasattr(instance, '__setstate__')\n        state = self.construct_mapping(node, deep=deep)\n        self.set_python_instance_state(instance, state)\n\n    def construct_python_object_apply(self, suffix, node, newobj=False):\n        # Format:\n        #   !!python/object/apply       # (or !!python/object/new)\n        #   args: [ ... arguments ... ]\n        #   kwds: { ... keywords ... }\n        #   state: ... state ...\n        #   listitems: [ ... listitems ... ]\n        #   dictitems: { ... dictitems ... }\n        # or short format:\n        #   !!python/object/apply [ ... arguments ... ]\n        # The difference between !!python/object/apply and !!python/object/new\n        # is how an object is created, check make_python_instance for details.\n        if isinstance(node, SequenceNode):\n            args = self.construct_sequence(node, deep=True)\n            kwds = {}\n            state = {}\n            listitems = []\n            dictitems = {}\n        else:\n            value = self.construct_mapping(node, deep=True)\n            args = value.get('args', [])\n            kwds = value.get('kwds', {})\n            state = value.get('state', {})\n            listitems = value.get('listitems', [])\n            dictitems = value.get('dictitems', {})\n        instance = self.make_python_instance(suffix, node, args, kwds, newobj)\n        if state:\n            self.set_python_instance_state(instance, state)\n        if listitems:\n            instance.extend(listitems)\n        if dictitems:\n            for key in dictitems:\n                instance[key] = dictitems[key]\n        return instance\n\n    def construct_python_object_new(self, suffix, node):\n        return self.construct_python_object_apply(suffix, node, newobj=True)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/none',\n    Constructor.construct_yaml_null)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/bool',\n    Constructor.construct_yaml_bool)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/str',\n    Constructor.construct_python_str)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/unicode',\n    Constructor.construct_python_unicode)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/int',\n    Constructor.construct_yaml_int)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/long',\n    Constructor.construct_python_long)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/float',\n    Constructor.construct_yaml_float)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/complex',\n    Constructor.construct_python_complex)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/list',\n    Constructor.construct_yaml_seq)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/tuple',\n    Constructor.construct_python_tuple)\n\nConstructor.add_constructor(\n    u'tag:yaml.org,2002:python/dict',\n    Constructor.construct_yaml_map)\n\nConstructor.add_multi_constructor(\n    u'tag:yaml.org,2002:python/name:',\n    Constructor.construct_python_name)\n\nConstructor.add_multi_constructor(\n    u'tag:yaml.org,2002:python/module:',\n    Constructor.construct_python_module)\n\nConstructor.add_multi_constructor(\n    u'tag:yaml.org,2002:python/object:',\n    Constructor.construct_python_object)\n\nConstructor.add_multi_constructor(\n    u'tag:yaml.org,2002:python/object/apply:',\n    Constructor.construct_python_object_apply)\n\nConstructor.add_multi_constructor(\n    u'tag:yaml.org,2002:python/object/new:',\n    Constructor.construct_python_object_new)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/cyaml.py",
    "content": "\n__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',\n        'CBaseDumper', 'CSafeDumper', 'CDumper']\n\nfrom _yaml import CParser, CEmitter\n\nfrom constructor import *\n\nfrom serializer import *\nfrom representer import *\n\nfrom resolver import *\n\nclass CBaseLoader(CParser, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass CSafeLoader(CParser, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CLoader(CParser, Constructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass CSafeDumper(CEmitter, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass CDumper(CEmitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/dumper.py",
    "content": "\n__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']\n\nfrom emitter import *\nfrom serializer import *\nfrom representer import *\nfrom resolver import *\n\nclass BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass Dumper(Emitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/emitter.py",
    "content": "\n# Emitter expects events obeying the following grammar:\n# stream ::= STREAM-START document* STREAM-END\n# document ::= DOCUMENT-START node DOCUMENT-END\n# node ::= SCALAR | sequence | mapping\n# sequence ::= SEQUENCE-START node* SEQUENCE-END\n# mapping ::= MAPPING-START (node node)* MAPPING-END\n\n__all__ = ['Emitter', 'EmitterError']\n\nfrom error import YAMLError\nfrom events import *\n\nclass EmitterError(YAMLError):\n    pass\n\nclass ScalarAnalysis(object):\n    def __init__(self, scalar, empty, multiline,\n            allow_flow_plain, allow_block_plain,\n            allow_single_quoted, allow_double_quoted,\n            allow_block):\n        self.scalar = scalar\n        self.empty = empty\n        self.multiline = multiline\n        self.allow_flow_plain = allow_flow_plain\n        self.allow_block_plain = allow_block_plain\n        self.allow_single_quoted = allow_single_quoted\n        self.allow_double_quoted = allow_double_quoted\n        self.allow_block = allow_block\n\nclass Emitter(object):\n\n    DEFAULT_TAG_PREFIXES = {\n        u'!' : u'!',\n        u'tag:yaml.org,2002:' : u'!!',\n    }\n\n    def __init__(self, stream, canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None):\n\n        # The stream should have the methods `write` and possibly `flush`.\n        self.stream = stream\n\n        # Encoding can be overriden by STREAM-START.\n        self.encoding = None\n\n        # Emitter is a state machine with a stack of states to handle nested\n        # structures.\n        self.states = []\n        self.state = self.expect_stream_start\n\n        # Current event and the event queue.\n        self.events = []\n        self.event = None\n\n        # The current indentation level and the stack of previous indents.\n        self.indents = []\n        self.indent = None\n\n        # Flow level.\n        self.flow_level = 0\n\n        # Contexts.\n        self.root_context = False\n        self.sequence_context = False\n        self.mapping_context = False\n        self.simple_key_context = False\n\n        # Characteristics of the last emitted character:\n        #  - current position.\n        #  - is it a whitespace?\n        #  - is it an indention character\n        #    (indentation space, '-', '?', or ':')?\n        self.line = 0\n        self.column = 0\n        self.whitespace = True\n        self.indention = True\n\n        # Whether the document requires an explicit document indicator\n        self.open_ended = False\n\n        # Formatting details.\n        self.canonical = canonical\n        self.allow_unicode = allow_unicode\n        self.best_indent = 2\n        if indent and 1 < indent < 10:\n            self.best_indent = indent\n        self.best_width = 80\n        if width and width > self.best_indent*2:\n            self.best_width = width\n        self.best_line_break = u'\\n'\n        if line_break in [u'\\r', u'\\n', u'\\r\\n']:\n            self.best_line_break = line_break\n\n        # Tag prefixes.\n        self.tag_prefixes = None\n\n        # Prepared anchor and tag.\n        self.prepared_anchor = None\n        self.prepared_tag = None\n\n        # Scalar analysis and style.\n        self.analysis = None\n        self.style = None\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def emit(self, event):\n        self.events.append(event)\n        while not self.need_more_events():\n            self.event = self.events.pop(0)\n            self.state()\n            self.event = None\n\n    # In some cases, we wait for a few next events before emitting.\n\n    def need_more_events(self):\n        if not self.events:\n            return True\n        event = self.events[0]\n        if isinstance(event, DocumentStartEvent):\n            return self.need_events(1)\n        elif isinstance(event, SequenceStartEvent):\n            return self.need_events(2)\n        elif isinstance(event, MappingStartEvent):\n            return self.need_events(3)\n        else:\n            return False\n\n    def need_events(self, count):\n        level = 0\n        for event in self.events[1:]:\n            if isinstance(event, (DocumentStartEvent, CollectionStartEvent)):\n                level += 1\n            elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)):\n                level -= 1\n            elif isinstance(event, StreamEndEvent):\n                level = -1\n            if level < 0:\n                return False\n        return (len(self.events) < count+1)\n\n    def increase_indent(self, flow=False, indentless=False):\n        self.indents.append(self.indent)\n        if self.indent is None:\n            if flow:\n                self.indent = self.best_indent\n            else:\n                self.indent = 0\n        elif not indentless:\n            self.indent += self.best_indent\n\n    # States.\n\n    # Stream handlers.\n\n    def expect_stream_start(self):\n        if isinstance(self.event, StreamStartEvent):\n            if self.event.encoding and not getattr(self.stream, 'encoding', None):\n                self.encoding = self.event.encoding\n            self.write_stream_start()\n            self.state = self.expect_first_document_start\n        else:\n            raise EmitterError(\"expected StreamStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_nothing(self):\n        raise EmitterError(\"expected nothing, but got %s\" % self.event)\n\n    # Document handlers.\n\n    def expect_first_document_start(self):\n        return self.expect_document_start(first=True)\n\n    def expect_document_start(self, first=False):\n        if isinstance(self.event, DocumentStartEvent):\n            if (self.event.version or self.event.tags) and self.open_ended:\n                self.write_indicator(u'...', True)\n                self.write_indent()\n            if self.event.version:\n                version_text = self.prepare_version(self.event.version)\n                self.write_version_directive(version_text)\n            self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy()\n            if self.event.tags:\n                handles = self.event.tags.keys()\n                handles.sort()\n                for handle in handles:\n                    prefix = self.event.tags[handle]\n                    self.tag_prefixes[prefix] = handle\n                    handle_text = self.prepare_tag_handle(handle)\n                    prefix_text = self.prepare_tag_prefix(prefix)\n                    self.write_tag_directive(handle_text, prefix_text)\n            implicit = (first and not self.event.explicit and not self.canonical\n                    and not self.event.version and not self.event.tags\n                    and not self.check_empty_document())\n            if not implicit:\n                self.write_indent()\n                self.write_indicator(u'---', True)\n                if self.canonical:\n                    self.write_indent()\n            self.state = self.expect_document_root\n        elif isinstance(self.event, StreamEndEvent):\n            if self.open_ended:\n                self.write_indicator(u'...', True)\n                self.write_indent()\n            self.write_stream_end()\n            self.state = self.expect_nothing\n        else:\n            raise EmitterError(\"expected DocumentStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_end(self):\n        if isinstance(self.event, DocumentEndEvent):\n            self.write_indent()\n            if self.event.explicit:\n                self.write_indicator(u'...', True)\n                self.write_indent()\n            self.flush_stream()\n            self.state = self.expect_document_start\n        else:\n            raise EmitterError(\"expected DocumentEndEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_root(self):\n        self.states.append(self.expect_document_end)\n        self.expect_node(root=True)\n\n    # Node handlers.\n\n    def expect_node(self, root=False, sequence=False, mapping=False,\n            simple_key=False):\n        self.root_context = root\n        self.sequence_context = sequence\n        self.mapping_context = mapping\n        self.simple_key_context = simple_key\n        if isinstance(self.event, AliasEvent):\n            self.expect_alias()\n        elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)):\n            self.process_anchor(u'&')\n            self.process_tag()\n            if isinstance(self.event, ScalarEvent):\n                self.expect_scalar()\n            elif isinstance(self.event, SequenceStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_sequence():\n                    self.expect_flow_sequence()\n                else:\n                    self.expect_block_sequence()\n            elif isinstance(self.event, MappingStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_mapping():\n                    self.expect_flow_mapping()\n                else:\n                    self.expect_block_mapping()\n        else:\n            raise EmitterError(\"expected NodeEvent, but got %s\" % self.event)\n\n    def expect_alias(self):\n        if self.event.anchor is None:\n            raise EmitterError(\"anchor is not specified for alias\")\n        self.process_anchor(u'*')\n        self.state = self.states.pop()\n\n    def expect_scalar(self):\n        self.increase_indent(flow=True)\n        self.process_scalar()\n        self.indent = self.indents.pop()\n        self.state = self.states.pop()\n\n    # Flow sequence handlers.\n\n    def expect_flow_sequence(self):\n        self.write_indicator(u'[', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_sequence_item\n\n    def expect_first_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator(u']', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    def expect_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(u',', False)\n                self.write_indent()\n            self.write_indicator(u']', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(u',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Flow mapping handlers.\n\n    def expect_flow_mapping(self):\n        self.write_indicator(u'{', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_mapping_key\n\n    def expect_first_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator(u'}', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator(u'?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(u',', False)\n                self.write_indent()\n            self.write_indicator(u'}', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(u',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator(u'?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_simple_value(self):\n        self.write_indicator(u':', False)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_flow_mapping_value(self):\n        if self.canonical or self.column > self.best_width:\n            self.write_indent()\n        self.write_indicator(u':', True)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Block sequence handlers.\n\n    def expect_block_sequence(self):\n        indentless = (self.mapping_context and not self.indention)\n        self.increase_indent(flow=False, indentless=indentless)\n        self.state = self.expect_first_block_sequence_item\n\n    def expect_first_block_sequence_item(self):\n        return self.expect_block_sequence_item(first=True)\n\n    def expect_block_sequence_item(self, first=False):\n        if not first and isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            self.write_indicator(u'-', True, indention=True)\n            self.states.append(self.expect_block_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Block mapping handlers.\n\n    def expect_block_mapping(self):\n        self.increase_indent(flow=False)\n        self.state = self.expect_first_block_mapping_key\n\n    def expect_first_block_mapping_key(self):\n        return self.expect_block_mapping_key(first=True)\n\n    def expect_block_mapping_key(self, first=False):\n        if not first and isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            if self.check_simple_key():\n                self.states.append(self.expect_block_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator(u'?', True, indention=True)\n                self.states.append(self.expect_block_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_block_mapping_simple_value(self):\n        self.write_indicator(u':', False)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_block_mapping_value(self):\n        self.write_indent()\n        self.write_indicator(u':', True, indention=True)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Checkers.\n\n    def check_empty_sequence(self):\n        return (isinstance(self.event, SequenceStartEvent) and self.events\n                and isinstance(self.events[0], SequenceEndEvent))\n\n    def check_empty_mapping(self):\n        return (isinstance(self.event, MappingStartEvent) and self.events\n                and isinstance(self.events[0], MappingEndEvent))\n\n    def check_empty_document(self):\n        if not isinstance(self.event, DocumentStartEvent) or not self.events:\n            return False\n        event = self.events[0]\n        return (isinstance(event, ScalarEvent) and event.anchor is None\n                and event.tag is None and event.implicit and event.value == u'')\n\n    def check_simple_key(self):\n        length = 0\n        if isinstance(self.event, NodeEvent) and self.event.anchor is not None:\n            if self.prepared_anchor is None:\n                self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n            length += len(self.prepared_anchor)\n        if isinstance(self.event, (ScalarEvent, CollectionStartEvent))  \\\n                and self.event.tag is not None:\n            if self.prepared_tag is None:\n                self.prepared_tag = self.prepare_tag(self.event.tag)\n            length += len(self.prepared_tag)\n        if isinstance(self.event, ScalarEvent):\n            if self.analysis is None:\n                self.analysis = self.analyze_scalar(self.event.value)\n            length += len(self.analysis.scalar)\n        return (length < 128 and (isinstance(self.event, AliasEvent)\n            or (isinstance(self.event, ScalarEvent)\n                    and not self.analysis.empty and not self.analysis.multiline)\n            or self.check_empty_sequence() or self.check_empty_mapping()))\n\n    # Anchor, Tag, and Scalar processors.\n\n    def process_anchor(self, indicator):\n        if self.event.anchor is None:\n            self.prepared_anchor = None\n            return\n        if self.prepared_anchor is None:\n            self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n        if self.prepared_anchor:\n            self.write_indicator(indicator+self.prepared_anchor, True)\n        self.prepared_anchor = None\n\n    def process_tag(self):\n        tag = self.event.tag\n        if isinstance(self.event, ScalarEvent):\n            if self.style is None:\n                self.style = self.choose_scalar_style()\n            if ((not self.canonical or tag is None) and\n                ((self.style == '' and self.event.implicit[0])\n                        or (self.style != '' and self.event.implicit[1]))):\n                self.prepared_tag = None\n                return\n            if self.event.implicit[0] and tag is None:\n                tag = u'!'\n                self.prepared_tag = None\n        else:\n            if (not self.canonical or tag is None) and self.event.implicit:\n                self.prepared_tag = None\n                return\n        if tag is None:\n            raise EmitterError(\"tag is not specified\")\n        if self.prepared_tag is None:\n            self.prepared_tag = self.prepare_tag(tag)\n        if self.prepared_tag:\n            self.write_indicator(self.prepared_tag, True)\n        self.prepared_tag = None\n\n    def choose_scalar_style(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.event.style == '\"' or self.canonical:\n            return '\"'\n        if not self.event.style and self.event.implicit[0]:\n            if (not (self.simple_key_context and\n                    (self.analysis.empty or self.analysis.multiline))\n                and (self.flow_level and self.analysis.allow_flow_plain\n                    or (not self.flow_level and self.analysis.allow_block_plain))):\n                return ''\n        if self.event.style and self.event.style in '|>':\n            if (not self.flow_level and not self.simple_key_context\n                    and self.analysis.allow_block):\n                return self.event.style\n        if not self.event.style or self.event.style == '\\'':\n            if (self.analysis.allow_single_quoted and\n                    not (self.simple_key_context and self.analysis.multiline)):\n                return '\\''\n        return '\"'\n\n    def process_scalar(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.style is None:\n            self.style = self.choose_scalar_style()\n        split = (not self.simple_key_context)\n        #if self.analysis.multiline and split    \\\n        #        and (not self.style or self.style in '\\'\\\"'):\n        #    self.write_indent()\n        if self.style == '\"':\n            self.write_double_quoted(self.analysis.scalar, split)\n        elif self.style == '\\'':\n            self.write_single_quoted(self.analysis.scalar, split)\n        elif self.style == '>':\n            self.write_folded(self.analysis.scalar)\n        elif self.style == '|':\n            self.write_literal(self.analysis.scalar)\n        else:\n            self.write_plain(self.analysis.scalar, split)\n        self.analysis = None\n        self.style = None\n\n    # Analyzers.\n\n    def prepare_version(self, version):\n        major, minor = version\n        if major != 1:\n            raise EmitterError(\"unsupported YAML version: %d.%d\" % (major, minor))\n        return u'%d.%d' % (major, minor)\n\n    def prepare_tag_handle(self, handle):\n        if not handle:\n            raise EmitterError(\"tag handle must not be empty\")\n        if handle[0] != u'!' or handle[-1] != u'!':\n            raise EmitterError(\"tag handle must start and end with '!': %r\"\n                    % (handle.encode('utf-8')))\n        for ch in handle[1:-1]:\n            if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'  \\\n                    or ch in u'-_'):\n                raise EmitterError(\"invalid character %r in the tag handle: %r\"\n                        % (ch.encode('utf-8'), handle.encode('utf-8')))\n        return handle\n\n    def prepare_tag_prefix(self, prefix):\n        if not prefix:\n            raise EmitterError(\"tag prefix must not be empty\")\n        chunks = []\n        start = end = 0\n        if prefix[0] == u'!':\n            end = 1\n        while end < len(prefix):\n            ch = prefix[end]\n            if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'   \\\n                    or ch in u'-;/?!:@&=+$,_.~*\\'()[]':\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(prefix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append(u'%%%02X' % ord(ch))\n        if start < end:\n            chunks.append(prefix[start:end])\n        return u''.join(chunks)\n\n    def prepare_tag(self, tag):\n        if not tag:\n            raise EmitterError(\"tag must not be empty\")\n        if tag == u'!':\n            return tag\n        handle = None\n        suffix = tag\n        prefixes = self.tag_prefixes.keys()\n        prefixes.sort()\n        for prefix in prefixes:\n            if tag.startswith(prefix)   \\\n                    and (prefix == u'!' or len(prefix) < len(tag)):\n                handle = self.tag_prefixes[prefix]\n                suffix = tag[len(prefix):]\n        chunks = []\n        start = end = 0\n        while end < len(suffix):\n            ch = suffix[end]\n            if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'   \\\n                    or ch in u'-;/?:@&=+$,_.~*\\'()[]'   \\\n                    or (ch == u'!' and handle != u'!'):\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(suffix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append(u'%%%02X' % ord(ch))\n        if start < end:\n            chunks.append(suffix[start:end])\n        suffix_text = u''.join(chunks)\n        if handle:\n            return u'%s%s' % (handle, suffix_text)\n        else:\n            return u'!<%s>' % suffix_text\n\n    def prepare_anchor(self, anchor):\n        if not anchor:\n            raise EmitterError(\"anchor must not be empty\")\n        for ch in anchor:\n            if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'  \\\n                    or ch in u'-_'):\n                raise EmitterError(\"invalid character %r in the anchor: %r\"\n                        % (ch.encode('utf-8'), anchor.encode('utf-8')))\n        return anchor\n\n    def analyze_scalar(self, scalar):\n\n        # Empty scalar is a special case.\n        if not scalar:\n            return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,\n                    allow_flow_plain=False, allow_block_plain=True,\n                    allow_single_quoted=True, allow_double_quoted=True,\n                    allow_block=False)\n\n        # Indicators and special characters.\n        block_indicators = False\n        flow_indicators = False\n        line_breaks = False\n        special_characters = False\n\n        # Important whitespace combinations.\n        leading_space = False\n        leading_break = False\n        trailing_space = False\n        trailing_break = False\n        break_space = False\n        space_break = False\n\n        # Check document indicators.\n        if scalar.startswith(u'---') or scalar.startswith(u'...'):\n            block_indicators = True\n            flow_indicators = True\n\n        # First character or preceded by a whitespace.\n        preceeded_by_whitespace = True\n\n        # Last character or followed by a whitespace.\n        followed_by_whitespace = (len(scalar) == 1 or\n                scalar[1] in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # The previous character is a space.\n        previous_space = False\n\n        # The previous character is a break.\n        previous_break = False\n\n        index = 0\n        while index < len(scalar):\n            ch = scalar[index]\n\n            # Check for indicators.\n            if index == 0:\n                # Leading indicators are special characters.\n                if ch in u'#,[]{}&*!|>\\'\\\"%@`': \n                    flow_indicators = True\n                    block_indicators = True\n                if ch in u'?:':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == u'-' and followed_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n            else:\n                # Some indicators cannot appear within a scalar as well.\n                if ch in u',?[]{}':\n                    flow_indicators = True\n                if ch == u':':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == u'#' and preceeded_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n\n            # Check for line breaks, special, and unicode characters.\n            if ch in u'\\n\\x85\\u2028\\u2029':\n                line_breaks = True\n            if not (ch == u'\\n' or u'\\x20' <= ch <= u'\\x7E'):\n                if (ch == u'\\x85' or u'\\xA0' <= ch <= u'\\uD7FF'\n                        or u'\\uE000' <= ch <= u'\\uFFFD') and ch != u'\\uFEFF':\n                    unicode_characters = True\n                    if not self.allow_unicode:\n                        special_characters = True\n                else:\n                    special_characters = True\n\n            # Detect important whitespace combinations.\n            if ch == u' ':\n                if index == 0:\n                    leading_space = True\n                if index == len(scalar)-1:\n                    trailing_space = True\n                if previous_break:\n                    break_space = True\n                previous_space = True\n                previous_break = False\n            elif ch in u'\\n\\x85\\u2028\\u2029':\n                if index == 0:\n                    leading_break = True\n                if index == len(scalar)-1:\n                    trailing_break = True\n                if previous_space:\n                    space_break = True\n                previous_space = False\n                previous_break = True\n            else:\n                previous_space = False\n                previous_break = False\n\n            # Prepare for the next character.\n            index += 1\n            preceeded_by_whitespace = (ch in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n            followed_by_whitespace = (index+1 >= len(scalar) or\n                    scalar[index+1] in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # Let's decide what styles are allowed.\n        allow_flow_plain = True\n        allow_block_plain = True\n        allow_single_quoted = True\n        allow_double_quoted = True\n        allow_block = True\n\n        # Leading and trailing whitespaces are bad for plain scalars.\n        if (leading_space or leading_break\n                or trailing_space or trailing_break):\n            allow_flow_plain = allow_block_plain = False\n\n        # We do not permit trailing spaces for block scalars.\n        if trailing_space:\n            allow_block = False\n\n        # Spaces at the beginning of a new line are only acceptable for block\n        # scalars.\n        if break_space:\n            allow_flow_plain = allow_block_plain = allow_single_quoted = False\n\n        # Spaces followed by breaks, as well as special character are only\n        # allowed for double quoted scalars.\n        if space_break or special_characters:\n            allow_flow_plain = allow_block_plain =  \\\n            allow_single_quoted = allow_block = False\n\n        # Although the plain scalar writer supports breaks, we never emit\n        # multiline plain scalars.\n        if line_breaks:\n            allow_flow_plain = allow_block_plain = False\n\n        # Flow indicators are forbidden for flow plain scalars.\n        if flow_indicators:\n            allow_flow_plain = False\n\n        # Block indicators are forbidden for block plain scalars.\n        if block_indicators:\n            allow_block_plain = False\n\n        return ScalarAnalysis(scalar=scalar,\n                empty=False, multiline=line_breaks,\n                allow_flow_plain=allow_flow_plain,\n                allow_block_plain=allow_block_plain,\n                allow_single_quoted=allow_single_quoted,\n                allow_double_quoted=allow_double_quoted,\n                allow_block=allow_block)\n\n    # Writers.\n\n    def flush_stream(self):\n        if hasattr(self.stream, 'flush'):\n            self.stream.flush()\n\n    def write_stream_start(self):\n        # Write BOM if needed.\n        if self.encoding and self.encoding.startswith('utf-16'):\n            self.stream.write(u'\\uFEFF'.encode(self.encoding))\n\n    def write_stream_end(self):\n        self.flush_stream()\n\n    def write_indicator(self, indicator, need_whitespace,\n            whitespace=False, indention=False):\n        if self.whitespace or not need_whitespace:\n            data = indicator\n        else:\n            data = u' '+indicator\n        self.whitespace = whitespace\n        self.indention = self.indention and indention\n        self.column += len(data)\n        self.open_ended = False\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_indent(self):\n        indent = self.indent or 0\n        if not self.indention or self.column > indent   \\\n                or (self.column == indent and not self.whitespace):\n            self.write_line_break()\n        if self.column < indent:\n            self.whitespace = True\n            data = u' '*(indent-self.column)\n            self.column = indent\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n\n    def write_line_break(self, data=None):\n        if data is None:\n            data = self.best_line_break\n        self.whitespace = True\n        self.indention = True\n        self.line += 1\n        self.column = 0\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_version_directive(self, version_text):\n        data = u'%%YAML %s' % version_text\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    def write_tag_directive(self, handle_text, prefix_text):\n        data = u'%%TAG %s %s' % (handle_text, prefix_text)\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    # Scalar streams.\n\n    def write_single_quoted(self, text, split=True):\n        self.write_indicator(u'\\'', True)\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch is None or ch != u' ':\n                    if start+1 == end and self.column > self.best_width and split   \\\n                            and start != 0 and end != len(text):\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch is None or ch not in u'\\n\\x85\\u2028\\u2029':\n                    if text[start] == u'\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == u'\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in u' \\n\\x85\\u2028\\u2029' or ch == u'\\'':\n                    if start < end:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                        start = end\n            if ch == u'\\'':\n                data = u'\\'\\''\n                self.column += 2\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                start = end + 1\n            if ch is not None:\n                spaces = (ch == u' ')\n                breaks = (ch in u'\\n\\x85\\u2028\\u2029')\n            end += 1\n        self.write_indicator(u'\\'', False)\n\n    ESCAPE_REPLACEMENTS = {\n        u'\\0':      u'0',\n        u'\\x07':    u'a',\n        u'\\x08':    u'b',\n        u'\\x09':    u't',\n        u'\\x0A':    u'n',\n        u'\\x0B':    u'v',\n        u'\\x0C':    u'f',\n        u'\\x0D':    u'r',\n        u'\\x1B':    u'e',\n        u'\\\"':      u'\\\"',\n        u'\\\\':      u'\\\\',\n        u'\\x85':    u'N',\n        u'\\xA0':    u'_',\n        u'\\u2028':  u'L',\n        u'\\u2029':  u'P',\n    }\n\n    def write_double_quoted(self, text, split=True):\n        self.write_indicator(u'\"', True)\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if ch is None or ch in u'\"\\\\\\x85\\u2028\\u2029\\uFEFF' \\\n                    or not (u'\\x20' <= ch <= u'\\x7E'\n                        or (self.allow_unicode\n                            and (u'\\xA0' <= ch <= u'\\uD7FF'\n                                or u'\\uE000' <= ch <= u'\\uFFFD'))):\n                if start < end:\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n                if ch is not None:\n                    if ch in self.ESCAPE_REPLACEMENTS:\n                        data = u'\\\\'+self.ESCAPE_REPLACEMENTS[ch]\n                    elif ch <= u'\\xFF':\n                        data = u'\\\\x%02X' % ord(ch)\n                    elif ch <= u'\\uFFFF':\n                        data = u'\\\\u%04X' % ord(ch)\n                    else:\n                        data = u'\\\\U%08X' % ord(ch)\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end+1\n            if 0 < end < len(text)-1 and (ch == u' ' or start >= end)   \\\n                    and self.column+(end-start) > self.best_width and split:\n                data = text[start:end]+u'\\\\'\n                if start < end:\n                    start = end\n                self.column += len(data)\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                self.write_indent()\n                self.whitespace = False\n                self.indention = False\n                if text[start] == u' ':\n                    data = u'\\\\'\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n            end += 1\n        self.write_indicator(u'\"', False)\n\n    def determine_block_hints(self, text):\n        hints = u''\n        if text:\n            if text[0] in u' \\n\\x85\\u2028\\u2029':\n                hints += unicode(self.best_indent)\n            if text[-1] not in u'\\n\\x85\\u2028\\u2029':\n                hints += u'-'\n            elif len(text) == 1 or text[-2] in u'\\n\\x85\\u2028\\u2029':\n                hints += u'+'\n        return hints\n\n    def write_folded(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator(u'>'+hints, True)\n        if hints[-1:] == u'+':\n            self.open_ended = True\n        self.write_line_break()\n        leading_space = True\n        spaces = False\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in u'\\n\\x85\\u2028\\u2029':\n                    if not leading_space and ch is not None and ch != u' '  \\\n                            and text[start] == u'\\n':\n                        self.write_line_break()\n                    leading_space = (ch == u' ')\n                    for br in text[start:end]:\n                        if br == u'\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            elif spaces:\n                if ch != u' ':\n                    if start+1 == end and self.column > self.best_width:\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            else:\n                if ch is None or ch in u' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in u'\\n\\x85\\u2028\\u2029')\n                spaces = (ch == u' ')\n            end += 1\n\n    def write_literal(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator(u'|'+hints, True)\n        if hints[-1:] == u'+':\n            self.open_ended = True\n        self.write_line_break()\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in u'\\n\\x85\\u2028\\u2029':\n                    for br in text[start:end]:\n                        if br == u'\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in u'\\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in u'\\n\\x85\\u2028\\u2029')\n            end += 1\n\n    def write_plain(self, text, split=True):\n        if self.root_context:\n            self.open_ended = True\n        if not text:\n            return\n        if not self.whitespace:\n            data = u' '\n            self.column += len(data)\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n        self.whitespace = False\n        self.indention = False\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch != u' ':\n                    if start+1 == end and self.column > self.best_width and split:\n                        self.write_indent()\n                        self.whitespace = False\n                        self.indention = False\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch not in u'\\n\\x85\\u2028\\u2029':\n                    if text[start] == u'\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == u'\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    self.whitespace = False\n                    self.indention = False\n                    start = end\n            else:\n                if ch is None or ch in u' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n            if ch is not None:\n                spaces = (ch == u' ')\n                breaks = (ch in u'\\n\\x85\\u2028\\u2029')\n            end += 1\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/error.py",
    "content": "\n__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']\n\nclass Mark(object):\n\n    def __init__(self, name, index, line, column, buffer, pointer):\n        self.name = name\n        self.index = index\n        self.line = line\n        self.column = column\n        self.buffer = buffer\n        self.pointer = pointer\n\n    def get_snippet(self, indent=4, max_length=75):\n        if self.buffer is None:\n            return None\n        head = ''\n        start = self.pointer\n        while start > 0 and self.buffer[start-1] not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n            start -= 1\n            if self.pointer-start > max_length/2-1:\n                head = ' ... '\n                start += 5\n                break\n        tail = ''\n        end = self.pointer\n        while end < len(self.buffer) and self.buffer[end] not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n            end += 1\n            if end-self.pointer > max_length/2-1:\n                tail = ' ... '\n                end -= 5\n                break\n        snippet = self.buffer[start:end].encode('utf-8')\n        return ' '*indent + head + snippet + tail + '\\n'  \\\n                + ' '*(indent+self.pointer-start+len(head)) + '^'\n\n    def __str__(self):\n        snippet = self.get_snippet()\n        where = \"  in \\\"%s\\\", line %d, column %d\"   \\\n                % (self.name, self.line+1, self.column+1)\n        if snippet is not None:\n            where += \":\\n\"+snippet\n        return where\n\nclass YAMLError(Exception):\n    pass\n\nclass MarkedYAMLError(YAMLError):\n\n    def __init__(self, context=None, context_mark=None,\n            problem=None, problem_mark=None, note=None):\n        self.context = context\n        self.context_mark = context_mark\n        self.problem = problem\n        self.problem_mark = problem_mark\n        self.note = note\n\n    def __str__(self):\n        lines = []\n        if self.context is not None:\n            lines.append(self.context)\n        if self.context_mark is not None  \\\n            and (self.problem is None or self.problem_mark is None\n                    or self.context_mark.name != self.problem_mark.name\n                    or self.context_mark.line != self.problem_mark.line\n                    or self.context_mark.column != self.problem_mark.column):\n            lines.append(str(self.context_mark))\n        if self.problem is not None:\n            lines.append(self.problem)\n        if self.problem_mark is not None:\n            lines.append(str(self.problem_mark))\n        if self.note is not None:\n            lines.append(self.note)\n        return '\\n'.join(lines)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/events.py",
    "content": "\n# Abstract classes.\n\nclass Event(object):\n    def __init__(self, start_mark=None, end_mark=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']\n                if hasattr(self, key)]\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\nclass NodeEvent(Event):\n    def __init__(self, anchor, start_mark=None, end_mark=None):\n        self.anchor = anchor\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass CollectionStartEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,\n            flow_style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass CollectionEndEvent(Event):\n    pass\n\n# Implementations.\n\nclass StreamStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None, encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndEvent(Event):\n    pass\n\nclass DocumentStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None, version=None, tags=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n        self.version = version\n        self.tags = tags\n\nclass DocumentEndEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n\nclass AliasEvent(NodeEvent):\n    pass\n\nclass ScalarEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, value,\n            start_mark=None, end_mark=None, style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass SequenceStartEvent(CollectionStartEvent):\n    pass\n\nclass SequenceEndEvent(CollectionEndEvent):\n    pass\n\nclass MappingStartEvent(CollectionStartEvent):\n    pass\n\nclass MappingEndEvent(CollectionEndEvent):\n    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/loader.py",
    "content": "\n__all__ = ['BaseLoader', 'SafeLoader', 'Loader']\n\nfrom reader import *\nfrom scanner import *\nfrom parser import *\nfrom composer import *\nfrom constructor import *\nfrom resolver import *\n\nclass BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/nodes.py",
    "content": "\nclass Node(object):\n    def __init__(self, tag, value, start_mark, end_mark):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        value = self.value\n        #if isinstance(value, list):\n        #    if len(value) == 0:\n        #        value = '<empty>'\n        #    elif len(value) == 1:\n        #        value = '<1 item>'\n        #    else:\n        #        value = '<%d items>' % len(value)\n        #else:\n        #    if len(value) > 75:\n        #        value = repr(value[:70]+u' ... ')\n        #    else:\n        #        value = repr(value)\n        value = repr(value)\n        return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)\n\nclass ScalarNode(Node):\n    id = 'scalar'\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass CollectionNode(Node):\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, flow_style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass SequenceNode(CollectionNode):\n    id = 'sequence'\n\nclass MappingNode(CollectionNode):\n    id = 'mapping'\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/parser.py",
    "content": "\n# The following YAML grammar is LL(1) and is parsed by a recursive descent\n# parser.\n#\n# stream            ::= STREAM-START implicit_document? explicit_document* STREAM-END\n# implicit_document ::= block_node DOCUMENT-END*\n# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n# block_node_or_indentless_sequence ::=\n#                       ALIAS\n#                       | properties (block_content | indentless_block_sequence)?\n#                       | block_content\n#                       | indentless_block_sequence\n# block_node        ::= ALIAS\n#                       | properties block_content?\n#                       | block_content\n# flow_node         ::= ALIAS\n#                       | properties flow_content?\n#                       | flow_content\n# properties        ::= TAG ANCHOR? | ANCHOR TAG?\n# block_content     ::= block_collection | flow_collection | SCALAR\n# flow_content      ::= flow_collection | SCALAR\n# block_collection  ::= block_sequence | block_mapping\n# flow_collection   ::= flow_sequence | flow_mapping\n# block_sequence    ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n# indentless_sequence   ::= (BLOCK-ENTRY block_node?)+\n# block_mapping     ::= BLOCK-MAPPING_START\n#                       ((KEY block_node_or_indentless_sequence?)?\n#                       (VALUE block_node_or_indentless_sequence?)?)*\n#                       BLOCK-END\n# flow_sequence     ::= FLOW-SEQUENCE-START\n#                       (flow_sequence_entry FLOW-ENTRY)*\n#                       flow_sequence_entry?\n#                       FLOW-SEQUENCE-END\n# flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n# flow_mapping      ::= FLOW-MAPPING-START\n#                       (flow_mapping_entry FLOW-ENTRY)*\n#                       flow_mapping_entry?\n#                       FLOW-MAPPING-END\n# flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n#\n# FIRST sets:\n#\n# stream: { STREAM-START }\n# explicit_document: { DIRECTIVE DOCUMENT-START }\n# implicit_document: FIRST(block_node)\n# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_sequence: { BLOCK-SEQUENCE-START }\n# block_mapping: { BLOCK-MAPPING-START }\n# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY }\n# indentless_sequence: { ENTRY }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_sequence: { FLOW-SEQUENCE-START }\n# flow_mapping: { FLOW-MAPPING-START }\n# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n\n__all__ = ['Parser', 'ParserError']\n\nfrom error import MarkedYAMLError\nfrom tokens import *\nfrom events import *\nfrom scanner import *\n\nclass ParserError(MarkedYAMLError):\n    pass\n\nclass Parser(object):\n    # Since writing a recursive-descendant parser is a straightforward task, we\n    # do not give many comments here.\n\n    DEFAULT_TAGS = {\n        u'!':   u'!',\n        u'!!':  u'tag:yaml.org,2002:',\n    }\n\n    def __init__(self):\n        self.current_event = None\n        self.yaml_version = None\n        self.tag_handles = {}\n        self.states = []\n        self.marks = []\n        self.state = self.parse_stream_start\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def check_event(self, *choices):\n        # Check the type of the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        if self.current_event is not None:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.current_event, choice):\n                    return True\n        return False\n\n    def peek_event(self):\n        # Get the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        return self.current_event\n\n    def get_event(self):\n        # Get the next event and proceed further.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        value = self.current_event\n        self.current_event = None\n        return value\n\n    # stream    ::= STREAM-START implicit_document? explicit_document* STREAM-END\n    # implicit_document ::= block_node DOCUMENT-END*\n    # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n\n    def parse_stream_start(self):\n\n        # Parse the stream start.\n        token = self.get_token()\n        event = StreamStartEvent(token.start_mark, token.end_mark,\n                encoding=token.encoding)\n\n        # Prepare the next state.\n        self.state = self.parse_implicit_document_start\n\n        return event\n\n    def parse_implicit_document_start(self):\n\n        # Parse an implicit document.\n        if not self.check_token(DirectiveToken, DocumentStartToken,\n                StreamEndToken):\n            self.tag_handles = self.DEFAULT_TAGS\n            token = self.peek_token()\n            start_mark = end_mark = token.start_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=False)\n\n            # Prepare the next state.\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_block_node\n\n            return event\n\n        else:\n            return self.parse_document_start()\n\n    def parse_document_start(self):\n\n        # Parse any extra document end indicators.\n        while self.check_token(DocumentEndToken):\n            self.get_token()\n\n        # Parse an explicit document.\n        if not self.check_token(StreamEndToken):\n            token = self.peek_token()\n            start_mark = token.start_mark\n            version, tags = self.process_directives()\n            if not self.check_token(DocumentStartToken):\n                raise ParserError(None, None,\n                        \"expected '<document start>', but found %r\"\n                        % self.peek_token().id,\n                        self.peek_token().start_mark)\n            token = self.get_token()\n            end_mark = token.end_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=True, version=version, tags=tags)\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_document_content\n        else:\n            # Parse the end of the stream.\n            token = self.get_token()\n            event = StreamEndEvent(token.start_mark, token.end_mark)\n            assert not self.states\n            assert not self.marks\n            self.state = None\n        return event\n\n    def parse_document_end(self):\n\n        # Parse the document end.\n        token = self.peek_token()\n        start_mark = end_mark = token.start_mark\n        explicit = False\n        if self.check_token(DocumentEndToken):\n            token = self.get_token()\n            end_mark = token.end_mark\n            explicit = True\n        event = DocumentEndEvent(start_mark, end_mark,\n                explicit=explicit)\n\n        # Prepare the next state.\n        self.state = self.parse_document_start\n\n        return event\n\n    def parse_document_content(self):\n        if self.check_token(DirectiveToken,\n                DocumentStartToken, DocumentEndToken, StreamEndToken):\n            event = self.process_empty_scalar(self.peek_token().start_mark)\n            self.state = self.states.pop()\n            return event\n        else:\n            return self.parse_block_node()\n\n    def process_directives(self):\n        self.yaml_version = None\n        self.tag_handles = {}\n        while self.check_token(DirectiveToken):\n            token = self.get_token()\n            if token.name == u'YAML':\n                if self.yaml_version is not None:\n                    raise ParserError(None, None,\n                            \"found duplicate YAML directive\", token.start_mark)\n                major, minor = token.value\n                if major != 1:\n                    raise ParserError(None, None,\n                            \"found incompatible YAML document (version 1.* is required)\",\n                            token.start_mark)\n                self.yaml_version = token.value\n            elif token.name == u'TAG':\n                handle, prefix = token.value\n                if handle in self.tag_handles:\n                    raise ParserError(None, None,\n                            \"duplicate tag handle %r\" % handle.encode('utf-8'),\n                            token.start_mark)\n                self.tag_handles[handle] = prefix\n        if self.tag_handles:\n            value = self.yaml_version, self.tag_handles.copy()\n        else:\n            value = self.yaml_version, None\n        for key in self.DEFAULT_TAGS:\n            if key not in self.tag_handles:\n                self.tag_handles[key] = self.DEFAULT_TAGS[key]\n        return value\n\n    # block_node_or_indentless_sequence ::= ALIAS\n    #               | properties (block_content | indentless_block_sequence)?\n    #               | block_content\n    #               | indentless_block_sequence\n    # block_node    ::= ALIAS\n    #                   | properties block_content?\n    #                   | block_content\n    # flow_node     ::= ALIAS\n    #                   | properties flow_content?\n    #                   | flow_content\n    # properties    ::= TAG ANCHOR? | ANCHOR TAG?\n    # block_content     ::= block_collection | flow_collection | SCALAR\n    # flow_content      ::= flow_collection | SCALAR\n    # block_collection  ::= block_sequence | block_mapping\n    # flow_collection   ::= flow_sequence | flow_mapping\n\n    def parse_block_node(self):\n        return self.parse_node(block=True)\n\n    def parse_flow_node(self):\n        return self.parse_node()\n\n    def parse_block_node_or_indentless_sequence(self):\n        return self.parse_node(block=True, indentless_sequence=True)\n\n    def parse_node(self, block=False, indentless_sequence=False):\n        if self.check_token(AliasToken):\n            token = self.get_token()\n            event = AliasEvent(token.value, token.start_mark, token.end_mark)\n            self.state = self.states.pop()\n        else:\n            anchor = None\n            tag = None\n            start_mark = end_mark = tag_mark = None\n            if self.check_token(AnchorToken):\n                token = self.get_token()\n                start_mark = token.start_mark\n                end_mark = token.end_mark\n                anchor = token.value\n                if self.check_token(TagToken):\n                    token = self.get_token()\n                    tag_mark = token.start_mark\n                    end_mark = token.end_mark\n                    tag = token.value\n            elif self.check_token(TagToken):\n                token = self.get_token()\n                start_mark = tag_mark = token.start_mark\n                end_mark = token.end_mark\n                tag = token.value\n                if self.check_token(AnchorToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    anchor = token.value\n            if tag is not None:\n                handle, suffix = tag\n                if handle is not None:\n                    if handle not in self.tag_handles:\n                        raise ParserError(\"while parsing a node\", start_mark,\n                                \"found undefined tag handle %r\" % handle.encode('utf-8'),\n                                tag_mark)\n                    tag = self.tag_handles[handle]+suffix\n                else:\n                    tag = suffix\n            #if tag == u'!':\n            #    raise ParserError(\"while parsing a node\", start_mark,\n            #            \"found non-specific tag '!'\", tag_mark,\n            #            \"Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.\")\n            if start_mark is None:\n                start_mark = end_mark = self.peek_token().start_mark\n            event = None\n            implicit = (tag is None or tag == u'!')\n            if indentless_sequence and self.check_token(BlockEntryToken):\n                end_mark = self.peek_token().end_mark\n                event = SequenceStartEvent(anchor, tag, implicit,\n                        start_mark, end_mark)\n                self.state = self.parse_indentless_sequence_entry\n            else:\n                if self.check_token(ScalarToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    if (token.plain and tag is None) or tag == u'!':\n                        implicit = (True, False)\n                    elif tag is None:\n                        implicit = (False, True)\n                    else:\n                        implicit = (False, False)\n                    event = ScalarEvent(anchor, tag, implicit, token.value,\n                            start_mark, end_mark, style=token.style)\n                    self.state = self.states.pop()\n                elif self.check_token(FlowSequenceStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_sequence_first_entry\n                elif self.check_token(FlowMappingStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_mapping_first_key\n                elif block and self.check_token(BlockSequenceStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_sequence_first_entry\n                elif block and self.check_token(BlockMappingStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_mapping_first_key\n                elif anchor is not None or tag is not None:\n                    # Empty scalars are allowed even if a tag or an anchor is\n                    # specified.\n                    event = ScalarEvent(anchor, tag, (implicit, False), u'',\n                            start_mark, end_mark)\n                    self.state = self.states.pop()\n                else:\n                    if block:\n                        node = 'block'\n                    else:\n                        node = 'flow'\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a %s node\" % node, start_mark,\n                            \"expected the node content, but found %r\" % token.id,\n                            token.start_mark)\n        return event\n\n    # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n\n    def parse_block_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_sequence_entry()\n\n    def parse_block_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken, BlockEndToken):\n                self.states.append(self.parse_block_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_block_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block collection\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    # indentless_sequence ::= (BLOCK-ENTRY block_node?)+\n\n    def parse_indentless_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken,\n                    KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_indentless_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_indentless_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        token = self.peek_token()\n        event = SequenceEndEvent(token.start_mark, token.start_mark)\n        self.state = self.states.pop()\n        return event\n\n    # block_mapping     ::= BLOCK-MAPPING_START\n    #                       ((KEY block_node_or_indentless_sequence?)?\n    #                       (VALUE block_node_or_indentless_sequence?)?)*\n    #                       BLOCK-END\n\n    def parse_block_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_mapping_key()\n\n    def parse_block_mapping_key(self):\n        if self.check_token(KeyToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_value)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_value\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block mapping\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_block_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_key)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_block_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    # flow_sequence     ::= FLOW-SEQUENCE-START\n    #                       (flow_sequence_entry FLOW-ENTRY)*\n    #                       flow_sequence_entry?\n    #                       FLOW-SEQUENCE-END\n    # flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n    #\n    # Note that while production rules for both flow_sequence_entry and\n    # flow_mapping_entry are equal, their interpretations are different.\n    # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?`\n    # generate an inline mapping (set syntax).\n\n    def parse_flow_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_sequence_entry(first=True)\n\n    def parse_flow_sequence_entry(self, first=False):\n        if not self.check_token(FlowSequenceEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow sequence\", self.marks[-1],\n                            \"expected ',' or ']', but got %r\" % token.id, token.start_mark)\n            \n            if self.check_token(KeyToken):\n                token = self.peek_token()\n                event = MappingStartEvent(None, None, True,\n                        token.start_mark, token.end_mark,\n                        flow_style=True)\n                self.state = self.parse_flow_sequence_entry_mapping_key\n                return event\n            elif not self.check_token(FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_sequence_entry_mapping_key(self):\n        token = self.get_token()\n        if not self.check_token(ValueToken,\n                FlowEntryToken, FlowSequenceEndToken):\n            self.states.append(self.parse_flow_sequence_entry_mapping_value)\n            return self.parse_flow_node()\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_value\n            return self.process_empty_scalar(token.end_mark)\n\n    def parse_flow_sequence_entry_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry_mapping_end)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_sequence_entry_mapping_end\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_end\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_sequence_entry_mapping_end(self):\n        self.state = self.parse_flow_sequence_entry\n        token = self.peek_token()\n        return MappingEndEvent(token.start_mark, token.start_mark)\n\n    # flow_mapping  ::= FLOW-MAPPING-START\n    #                   (flow_mapping_entry FLOW-ENTRY)*\n    #                   flow_mapping_entry?\n    #                   FLOW-MAPPING-END\n    # flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n\n    def parse_flow_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_mapping_key(first=True)\n\n    def parse_flow_mapping_key(self, first=False):\n        if not self.check_token(FlowMappingEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow mapping\", self.marks[-1],\n                            \"expected ',' or '}', but got %r\" % token.id, token.start_mark)\n            if self.check_token(KeyToken):\n                token = self.get_token()\n                if not self.check_token(ValueToken,\n                        FlowEntryToken, FlowMappingEndToken):\n                    self.states.append(self.parse_flow_mapping_value)\n                    return self.parse_flow_node()\n                else:\n                    self.state = self.parse_flow_mapping_value\n                    return self.process_empty_scalar(token.end_mark)\n            elif not self.check_token(FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_empty_value)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_key)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_mapping_empty_value(self):\n        self.state = self.parse_flow_mapping_key\n        return self.process_empty_scalar(self.peek_token().start_mark)\n\n    def process_empty_scalar(self, mark):\n        return ScalarEvent(None, None, (True, False), u'', mark, mark)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/reader.py",
    "content": "# This module contains abstractions for the input stream. You don't have to\n# looks further, there are no pretty code.\n#\n# We define two classes here.\n#\n#   Mark(source, line, column)\n# It's just a record and its only use is producing nice error messages.\n# Parser does not use it for any other purposes.\n#\n#   Reader(source, data)\n# Reader determines the encoding of `data` and converts it to unicode.\n# Reader provides the following methods and attributes:\n#   reader.peek(length=1) - return the next `length` characters\n#   reader.forward(length=1) - move the current position to `length` characters.\n#   reader.index - the number of the current character.\n#   reader.line, stream.column - the line and the column of the current character.\n\n__all__ = ['Reader', 'ReaderError']\n\nfrom error import YAMLError, Mark\n\nimport codecs, re\n\nclass ReaderError(YAMLError):\n\n    def __init__(self, name, position, character, encoding, reason):\n        self.name = name\n        self.character = character\n        self.position = position\n        self.encoding = encoding\n        self.reason = reason\n\n    def __str__(self):\n        if isinstance(self.character, str):\n            return \"'%s' codec can't decode byte #x%02x: %s\\n\"  \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.encoding, ord(self.character), self.reason,\n                            self.name, self.position)\n        else:\n            return \"unacceptable character #x%04x: %s\\n\"    \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.character, self.reason,\n                            self.name, self.position)\n\nclass Reader(object):\n    # Reader:\n    # - determines the data encoding and converts it to unicode,\n    # - checks if characters are in allowed range,\n    # - adds '\\0' to the end.\n\n    # Reader accepts\n    #  - a `str` object,\n    #  - a `unicode` object,\n    #  - a file-like object with its `read` method returning `str`,\n    #  - a file-like object with its `read` method returning `unicode`.\n\n    # Yeah, it's ugly and slow.\n\n    def __init__(self, stream):\n        self.name = None\n        self.stream = None\n        self.stream_pointer = 0\n        self.eof = True\n        self.buffer = u''\n        self.pointer = 0\n        self.raw_buffer = None\n        self.raw_decode = None\n        self.encoding = None\n        self.index = 0\n        self.line = 0\n        self.column = 0\n        if isinstance(stream, unicode):\n            self.name = \"<unicode string>\"\n            self.check_printable(stream)\n            self.buffer = stream+u'\\0'\n        elif isinstance(stream, str):\n            self.name = \"<string>\"\n            self.raw_buffer = stream\n            self.determine_encoding()\n        else:\n            self.stream = stream\n            self.name = getattr(stream, 'name', \"<file>\")\n            self.eof = False\n            self.raw_buffer = ''\n            self.determine_encoding()\n\n    def peek(self, index=0):\n        try:\n            return self.buffer[self.pointer+index]\n        except IndexError:\n            self.update(index+1)\n            return self.buffer[self.pointer+index]\n\n    def prefix(self, length=1):\n        if self.pointer+length >= len(self.buffer):\n            self.update(length)\n        return self.buffer[self.pointer:self.pointer+length]\n\n    def forward(self, length=1):\n        if self.pointer+length+1 >= len(self.buffer):\n            self.update(length+1)\n        while length:\n            ch = self.buffer[self.pointer]\n            self.pointer += 1\n            self.index += 1\n            if ch in u'\\n\\x85\\u2028\\u2029'  \\\n                    or (ch == u'\\r' and self.buffer[self.pointer] != u'\\n'):\n                self.line += 1\n                self.column = 0\n            elif ch != u'\\uFEFF':\n                self.column += 1\n            length -= 1\n\n    def get_mark(self):\n        if self.stream is None:\n            return Mark(self.name, self.index, self.line, self.column,\n                    self.buffer, self.pointer)\n        else:\n            return Mark(self.name, self.index, self.line, self.column,\n                    None, None)\n\n    def determine_encoding(self):\n        while not self.eof and len(self.raw_buffer) < 2:\n            self.update_raw()\n        if not isinstance(self.raw_buffer, unicode):\n            if self.raw_buffer.startswith(codecs.BOM_UTF16_LE):\n                self.raw_decode = codecs.utf_16_le_decode\n                self.encoding = 'utf-16-le'\n            elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE):\n                self.raw_decode = codecs.utf_16_be_decode\n                self.encoding = 'utf-16-be'\n            else:\n                self.raw_decode = codecs.utf_8_decode\n                self.encoding = 'utf-8'\n        self.update(1)\n\n    NON_PRINTABLE = re.compile(u'[^\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD]')\n    def check_printable(self, data):\n        match = self.NON_PRINTABLE.search(data)\n        if match:\n            character = match.group()\n            position = self.index+(len(self.buffer)-self.pointer)+match.start()\n            raise ReaderError(self.name, position, ord(character),\n                    'unicode', \"special characters are not allowed\")\n\n    def update(self, length):\n        if self.raw_buffer is None:\n            return\n        self.buffer = self.buffer[self.pointer:]\n        self.pointer = 0\n        while len(self.buffer) < length:\n            if not self.eof:\n                self.update_raw()\n            if self.raw_decode is not None:\n                try:\n                    data, converted = self.raw_decode(self.raw_buffer,\n                            'strict', self.eof)\n                except UnicodeDecodeError, exc:\n                    character = exc.object[exc.start]\n                    if self.stream is not None:\n                        position = self.stream_pointer-len(self.raw_buffer)+exc.start\n                    else:\n                        position = exc.start\n                    raise ReaderError(self.name, position, character,\n                            exc.encoding, exc.reason)\n            else:\n                data = self.raw_buffer\n                converted = len(data)\n            self.check_printable(data)\n            self.buffer += data\n            self.raw_buffer = self.raw_buffer[converted:]\n            if self.eof:\n                self.buffer += u'\\0'\n                self.raw_buffer = None\n                break\n\n    def update_raw(self, size=1024):\n        data = self.stream.read(size)\n        if data:\n            self.raw_buffer += data\n            self.stream_pointer += len(data)\n        else:\n            self.eof = True\n\n#try:\n#    import psyco\n#    psyco.bind(Reader)\n#except ImportError:\n#    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/representer.py",
    "content": "\n__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',\n    'RepresenterError']\n\nfrom error import *\nfrom nodes import *\n\nimport datetime\n\nimport sys, copy_reg, types\n\nclass RepresenterError(YAMLError):\n    pass\n\nclass BaseRepresenter(object):\n\n    yaml_representers = {}\n    yaml_multi_representers = {}\n\n    def __init__(self, default_style=None, default_flow_style=None):\n        self.default_style = default_style\n        self.default_flow_style = default_flow_style\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def represent(self, data):\n        node = self.represent_data(data)\n        self.serialize(node)\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def get_classobj_bases(self, cls):\n        bases = [cls]\n        for base in cls.__bases__:\n            bases.extend(self.get_classobj_bases(base))\n        return bases\n\n    def represent_data(self, data):\n        if self.ignore_aliases(data):\n            self.alias_key = None\n        else:\n            self.alias_key = id(data)\n        if self.alias_key is not None:\n            if self.alias_key in self.represented_objects:\n                node = self.represented_objects[self.alias_key]\n                #if node is None:\n                #    raise RepresenterError(\"recursive objects are not allowed: %r\" % data)\n                return node\n            #self.represented_objects[alias_key] = None\n            self.object_keeper.append(data)\n        data_types = type(data).__mro__\n        if type(data) is types.InstanceType:\n            data_types = self.get_classobj_bases(data.__class__)+list(data_types)\n        if data_types[0] in self.yaml_representers:\n            node = self.yaml_representers[data_types[0]](self, data)\n        else:\n            for data_type in data_types:\n                if data_type in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[data_type](self, data)\n                    break\n            else:\n                if None in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[None](self, data)\n                elif None in self.yaml_representers:\n                    node = self.yaml_representers[None](self, data)\n                else:\n                    node = ScalarNode(None, unicode(data))\n        #if alias_key is not None:\n        #    self.represented_objects[alias_key] = node\n        return node\n\n    def add_representer(cls, data_type, representer):\n        if not 'yaml_representers' in cls.__dict__:\n            cls.yaml_representers = cls.yaml_representers.copy()\n        cls.yaml_representers[data_type] = representer\n    add_representer = classmethod(add_representer)\n\n    def add_multi_representer(cls, data_type, representer):\n        if not 'yaml_multi_representers' in cls.__dict__:\n            cls.yaml_multi_representers = cls.yaml_multi_representers.copy()\n        cls.yaml_multi_representers[data_type] = representer\n    add_multi_representer = classmethod(add_multi_representer)\n\n    def represent_scalar(self, tag, value, style=None):\n        if style is None:\n            style = self.default_style\n        node = ScalarNode(tag, value, style=style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        return node\n\n    def represent_sequence(self, tag, sequence, flow_style=None):\n        value = []\n        node = SequenceNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        for item in sequence:\n            node_item = self.represent_data(item)\n            if not (isinstance(node_item, ScalarNode) and not node_item.style):\n                best_style = False\n            value.append(node_item)\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def represent_mapping(self, tag, mapping, flow_style=None):\n        value = []\n        node = MappingNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        if hasattr(mapping, 'items'):\n            mapping = mapping.items()\n            mapping.sort()\n        for item_key, item_value in mapping:\n            node_key = self.represent_data(item_key)\n            node_value = self.represent_data(item_value)\n            if not (isinstance(node_key, ScalarNode) and not node_key.style):\n                best_style = False\n            if not (isinstance(node_value, ScalarNode) and not node_value.style):\n                best_style = False\n            value.append((node_key, node_value))\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def ignore_aliases(self, data):\n        return False\n\nclass SafeRepresenter(BaseRepresenter):\n\n    def ignore_aliases(self, data):\n        if data is None:\n            return True\n        if isinstance(data, tuple) and data == ():\n            return True\n        if isinstance(data, (str, unicode, bool, int, float)):\n            return True\n\n    def represent_none(self, data):\n        return self.represent_scalar(u'tag:yaml.org,2002:null',\n                u'null')\n\n    def represent_str(self, data):\n        tag = None\n        style = None\n        try:\n            data = unicode(data, 'ascii')\n            tag = u'tag:yaml.org,2002:str'\n        except UnicodeDecodeError:\n            try:\n                data = unicode(data, 'utf-8')\n                tag = u'tag:yaml.org,2002:str'\n            except UnicodeDecodeError:\n                data = data.encode('base64')\n                tag = u'tag:yaml.org,2002:binary'\n                style = '|'\n        return self.represent_scalar(tag, data, style=style)\n\n    def represent_unicode(self, data):\n        return self.represent_scalar(u'tag:yaml.org,2002:str', data)\n\n    def represent_bool(self, data):\n        if data:\n            value = u'true'\n        else:\n            value = u'false'\n        return self.represent_scalar(u'tag:yaml.org,2002:bool', value)\n\n    def represent_int(self, data):\n        return self.represent_scalar(u'tag:yaml.org,2002:int', unicode(data))\n\n    def represent_long(self, data):\n        return self.represent_scalar(u'tag:yaml.org,2002:int', unicode(data))\n\n    inf_value = 1e300\n    while repr(inf_value) != repr(inf_value*inf_value):\n        inf_value *= inf_value\n\n    def represent_float(self, data):\n        if data != data or (data == 0.0 and data == 1.0):\n            value = u'.nan'\n        elif data == self.inf_value:\n            value = u'.inf'\n        elif data == -self.inf_value:\n            value = u'-.inf'\n        else:\n            value = unicode(repr(data)).lower()\n            # Note that in some cases `repr(data)` represents a float number\n            # without the decimal parts.  For instance:\n            #   >>> repr(1e17)\n            #   '1e17'\n            # Unfortunately, this is not a valid float representation according\n            # to the definition of the `!!float` tag.  We fix this by adding\n            # '.0' before the 'e' symbol.\n            if u'.' not in value and u'e' in value:\n                value = value.replace(u'e', u'.0e', 1)\n        return self.represent_scalar(u'tag:yaml.org,2002:float', value)\n\n    def represent_list(self, data):\n        #pairs = (len(data) > 0 and isinstance(data, list))\n        #if pairs:\n        #    for item in data:\n        #        if not isinstance(item, tuple) or len(item) != 2:\n        #            pairs = False\n        #            break\n        #if not pairs:\n            return self.represent_sequence(u'tag:yaml.org,2002:seq', data)\n        #value = []\n        #for item_key, item_value in data:\n        #    value.append(self.represent_mapping(u'tag:yaml.org,2002:map',\n        #        [(item_key, item_value)]))\n        #return SequenceNode(u'tag:yaml.org,2002:pairs', value)\n\n    def represent_dict(self, data):\n        return self.represent_mapping(u'tag:yaml.org,2002:map', data)\n\n    def represent_set(self, data):\n        value = {}\n        for key in data:\n            value[key] = None\n        return self.represent_mapping(u'tag:yaml.org,2002:set', value)\n\n    def represent_date(self, data):\n        value = unicode(data.isoformat())\n        return self.represent_scalar(u'tag:yaml.org,2002:timestamp', value)\n\n    def represent_datetime(self, data):\n        value = unicode(data.isoformat(' '))\n        return self.represent_scalar(u'tag:yaml.org,2002:timestamp', value)\n\n    def represent_yaml_object(self, tag, data, cls, flow_style=None):\n        if hasattr(data, '__getstate__'):\n            state = data.__getstate__()\n        else:\n            state = data.__dict__.copy()\n        return self.represent_mapping(tag, state, flow_style=flow_style)\n\n    def represent_undefined(self, data):\n        raise RepresenterError(\"cannot represent an object: %s\" % data)\n\nSafeRepresenter.add_representer(type(None),\n        SafeRepresenter.represent_none)\n\nSafeRepresenter.add_representer(str,\n        SafeRepresenter.represent_str)\n\nSafeRepresenter.add_representer(unicode,\n        SafeRepresenter.represent_unicode)\n\nSafeRepresenter.add_representer(bool,\n        SafeRepresenter.represent_bool)\n\nSafeRepresenter.add_representer(int,\n        SafeRepresenter.represent_int)\n\nSafeRepresenter.add_representer(long,\n        SafeRepresenter.represent_long)\n\nSafeRepresenter.add_representer(float,\n        SafeRepresenter.represent_float)\n\nSafeRepresenter.add_representer(list,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(tuple,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(dict,\n        SafeRepresenter.represent_dict)\n\nSafeRepresenter.add_representer(set,\n        SafeRepresenter.represent_set)\n\nSafeRepresenter.add_representer(datetime.date,\n        SafeRepresenter.represent_date)\n\nSafeRepresenter.add_representer(datetime.datetime,\n        SafeRepresenter.represent_datetime)\n\nSafeRepresenter.add_representer(None,\n        SafeRepresenter.represent_undefined)\n\nclass Representer(SafeRepresenter):\n\n    def represent_str(self, data):\n        tag = None\n        style = None\n        try:\n            data = unicode(data, 'ascii')\n            tag = u'tag:yaml.org,2002:str'\n        except UnicodeDecodeError:\n            try:\n                data = unicode(data, 'utf-8')\n                tag = u'tag:yaml.org,2002:python/str'\n            except UnicodeDecodeError:\n                data = data.encode('base64')\n                tag = u'tag:yaml.org,2002:binary'\n                style = '|'\n        return self.represent_scalar(tag, data, style=style)\n\n    def represent_unicode(self, data):\n        tag = None\n        try:\n            data.encode('ascii')\n            tag = u'tag:yaml.org,2002:python/unicode'\n        except UnicodeEncodeError:\n            tag = u'tag:yaml.org,2002:str'\n        return self.represent_scalar(tag, data)\n\n    def represent_long(self, data):\n        tag = u'tag:yaml.org,2002:int'\n        if int(data) is not data:\n            tag = u'tag:yaml.org,2002:python/long'\n        return self.represent_scalar(tag, unicode(data))\n\n    def represent_complex(self, data):\n        if data.imag == 0.0:\n            data = u'%r' % data.real\n        elif data.real == 0.0:\n            data = u'%rj' % data.imag\n        elif data.imag > 0:\n            data = u'%r+%rj' % (data.real, data.imag)\n        else:\n            data = u'%r%rj' % (data.real, data.imag)\n        return self.represent_scalar(u'tag:yaml.org,2002:python/complex', data)\n\n    def represent_tuple(self, data):\n        return self.represent_sequence(u'tag:yaml.org,2002:python/tuple', data)\n\n    def represent_name(self, data):\n        name = u'%s.%s' % (data.__module__, data.__name__)\n        return self.represent_scalar(u'tag:yaml.org,2002:python/name:'+name, u'')\n\n    def represent_module(self, data):\n        return self.represent_scalar(\n                u'tag:yaml.org,2002:python/module:'+data.__name__, u'')\n\n    def represent_instance(self, data):\n        # For instances of classic classes, we use __getinitargs__ and\n        # __getstate__ to serialize the data.\n\n        # If data.__getinitargs__ exists, the object must be reconstructed by\n        # calling cls(**args), where args is a tuple returned by\n        # __getinitargs__. Otherwise, the cls.__init__ method should never be\n        # called and the class instance is created by instantiating a trivial\n        # class and assigning to the instance's __class__ variable.\n\n        # If data.__getstate__ exists, it returns the state of the object.\n        # Otherwise, the state of the object is data.__dict__.\n\n        # We produce either a !!python/object or !!python/object/new node.\n        # If data.__getinitargs__ does not exist and state is a dictionary, we\n        # produce a !!python/object node . Otherwise we produce a\n        # !!python/object/new node.\n\n        cls = data.__class__\n        class_name = u'%s.%s' % (cls.__module__, cls.__name__)\n        args = None\n        state = None\n        if hasattr(data, '__getinitargs__'):\n            args = list(data.__getinitargs__())\n        if hasattr(data, '__getstate__'):\n            state = data.__getstate__()\n        else:\n            state = data.__dict__\n        if args is None and isinstance(state, dict):\n            return self.represent_mapping(\n                    u'tag:yaml.org,2002:python/object:'+class_name, state)\n        if isinstance(state, dict) and not state:\n            return self.represent_sequence(\n                    u'tag:yaml.org,2002:python/object/new:'+class_name, args)\n        value = {}\n        if args:\n            value['args'] = args\n        value['state'] = state\n        return self.represent_mapping(\n                u'tag:yaml.org,2002:python/object/new:'+class_name, value)\n\n    def represent_object(self, data):\n        # We use __reduce__ API to save the data. data.__reduce__ returns\n        # a tuple of length 2-5:\n        #   (function, args, state, listitems, dictitems)\n\n        # For reconstructing, we calls function(*args), then set its state,\n        # listitems, and dictitems if they are not None.\n\n        # A special case is when function.__name__ == '__newobj__'. In this\n        # case we create the object with args[0].__new__(*args).\n\n        # Another special case is when __reduce__ returns a string - we don't\n        # support it.\n\n        # We produce a !!python/object, !!python/object/new or\n        # !!python/object/apply node.\n\n        cls = type(data)\n        if cls in copy_reg.dispatch_table:\n            reduce = copy_reg.dispatch_table[cls](data)\n        elif hasattr(data, '__reduce_ex__'):\n            reduce = data.__reduce_ex__(2)\n        elif hasattr(data, '__reduce__'):\n            reduce = data.__reduce__()\n        else:\n            raise RepresenterError(\"cannot represent object: %r\" % data)\n        reduce = (list(reduce)+[None]*5)[:5]\n        function, args, state, listitems, dictitems = reduce\n        args = list(args)\n        if state is None:\n            state = {}\n        if listitems is not None:\n            listitems = list(listitems)\n        if dictitems is not None:\n            dictitems = dict(dictitems)\n        if function.__name__ == '__newobj__':\n            function = args[0]\n            args = args[1:]\n            tag = u'tag:yaml.org,2002:python/object/new:'\n            newobj = True\n        else:\n            tag = u'tag:yaml.org,2002:python/object/apply:'\n            newobj = False\n        function_name = u'%s.%s' % (function.__module__, function.__name__)\n        if not args and not listitems and not dictitems \\\n                and isinstance(state, dict) and newobj:\n            return self.represent_mapping(\n                    u'tag:yaml.org,2002:python/object:'+function_name, state)\n        if not listitems and not dictitems  \\\n                and isinstance(state, dict) and not state:\n            return self.represent_sequence(tag+function_name, args)\n        value = {}\n        if args:\n            value['args'] = args\n        if state or not isinstance(state, dict):\n            value['state'] = state\n        if listitems:\n            value['listitems'] = listitems\n        if dictitems:\n            value['dictitems'] = dictitems\n        return self.represent_mapping(tag+function_name, value)\n\nRepresenter.add_representer(str,\n        Representer.represent_str)\n\nRepresenter.add_representer(unicode,\n        Representer.represent_unicode)\n\nRepresenter.add_representer(long,\n        Representer.represent_long)\n\nRepresenter.add_representer(complex,\n        Representer.represent_complex)\n\nRepresenter.add_representer(tuple,\n        Representer.represent_tuple)\n\nRepresenter.add_representer(type,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.ClassType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.FunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.BuiltinFunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.ModuleType,\n        Representer.represent_module)\n\nRepresenter.add_multi_representer(types.InstanceType,\n        Representer.represent_instance)\n\nRepresenter.add_multi_representer(object,\n        Representer.represent_object)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/resolver.py",
    "content": "\n__all__ = ['BaseResolver', 'Resolver']\n\nfrom error import *\nfrom nodes import *\n\nimport re\n\nclass ResolverError(YAMLError):\n    pass\n\nclass BaseResolver(object):\n\n    DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'\n    DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'\n    DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'\n\n    yaml_implicit_resolvers = {}\n    yaml_path_resolvers = {}\n\n    def __init__(self):\n        self.resolver_exact_paths = []\n        self.resolver_prefix_paths = []\n\n    def add_implicit_resolver(cls, tag, regexp, first):\n        if not 'yaml_implicit_resolvers' in cls.__dict__:\n            implicit_resolvers = {}\n            for key in cls.yaml_implicit_resolvers:\n                implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:]\n            cls.yaml_implicit_resolvers = implicit_resolvers\n        if first is None:\n            first = [None]\n        for ch in first:\n            cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp))\n    add_implicit_resolver = classmethod(add_implicit_resolver)\n\n    def add_path_resolver(cls, tag, path, kind=None):\n        # Note: `add_path_resolver` is experimental.  The API could be changed.\n        # `new_path` is a pattern that is matched against the path from the\n        # root to the node that is being considered.  `node_path` elements are\n        # tuples `(node_check, index_check)`.  `node_check` is a node class:\n        # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`.  `None`\n        # matches any kind of a node.  `index_check` could be `None`, a boolean\n        # value, a string value, or a number.  `None` and `False` match against\n        # any _value_ of sequence and mapping nodes.  `True` matches against\n        # any _key_ of a mapping node.  A string `index_check` matches against\n        # a mapping value that corresponds to a scalar key which content is\n        # equal to the `index_check` value.  An integer `index_check` matches\n        # against a sequence value with the index equal to `index_check`.\n        if not 'yaml_path_resolvers' in cls.__dict__:\n            cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy()\n        new_path = []\n        for element in path:\n            if isinstance(element, (list, tuple)):\n                if len(element) == 2:\n                    node_check, index_check = element\n                elif len(element) == 1:\n                    node_check = element[0]\n                    index_check = True\n                else:\n                    raise ResolverError(\"Invalid path element: %s\" % element)\n            else:\n                node_check = None\n                index_check = element\n            if node_check is str:\n                node_check = ScalarNode\n            elif node_check is list:\n                node_check = SequenceNode\n            elif node_check is dict:\n                node_check = MappingNode\n            elif node_check not in [ScalarNode, SequenceNode, MappingNode]  \\\n                    and not isinstance(node_check, basestring)  \\\n                    and node_check is not None:\n                raise ResolverError(\"Invalid node checker: %s\" % node_check)\n            if not isinstance(index_check, (basestring, int))   \\\n                    and index_check is not None:\n                raise ResolverError(\"Invalid index checker: %s\" % index_check)\n            new_path.append((node_check, index_check))\n        if kind is str:\n            kind = ScalarNode\n        elif kind is list:\n            kind = SequenceNode\n        elif kind is dict:\n            kind = MappingNode\n        elif kind not in [ScalarNode, SequenceNode, MappingNode]    \\\n                and kind is not None:\n            raise ResolverError(\"Invalid node kind: %s\" % kind)\n        cls.yaml_path_resolvers[tuple(new_path), kind] = tag\n    add_path_resolver = classmethod(add_path_resolver)\n\n    def descend_resolver(self, current_node, current_index):\n        if not self.yaml_path_resolvers:\n            return\n        exact_paths = {}\n        prefix_paths = []\n        if current_node:\n            depth = len(self.resolver_prefix_paths)\n            for path, kind in self.resolver_prefix_paths[-1]:\n                if self.check_resolver_prefix(depth, path, kind,\n                        current_node, current_index):\n                    if len(path) > depth:\n                        prefix_paths.append((path, kind))\n                    else:\n                        exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n        else:\n            for path, kind in self.yaml_path_resolvers:\n                if not path:\n                    exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n                else:\n                    prefix_paths.append((path, kind))\n        self.resolver_exact_paths.append(exact_paths)\n        self.resolver_prefix_paths.append(prefix_paths)\n\n    def ascend_resolver(self):\n        if not self.yaml_path_resolvers:\n            return\n        self.resolver_exact_paths.pop()\n        self.resolver_prefix_paths.pop()\n\n    def check_resolver_prefix(self, depth, path, kind,\n            current_node, current_index):\n        node_check, index_check = path[depth-1]\n        if isinstance(node_check, basestring):\n            if current_node.tag != node_check:\n                return\n        elif node_check is not None:\n            if not isinstance(current_node, node_check):\n                return\n        if index_check is True and current_index is not None:\n            return\n        if (index_check is False or index_check is None)    \\\n                and current_index is None:\n            return\n        if isinstance(index_check, basestring):\n            if not (isinstance(current_index, ScalarNode)\n                    and index_check == current_index.value):\n                return\n        elif isinstance(index_check, int) and not isinstance(index_check, bool):\n            if index_check != current_index:\n                return\n        return True\n\n    def resolve(self, kind, value, implicit):\n        if kind is ScalarNode and implicit[0]:\n            if value == u'':\n                resolvers = self.yaml_implicit_resolvers.get(u'', [])\n            else:\n                resolvers = self.yaml_implicit_resolvers.get(value[0], [])\n            resolvers += self.yaml_implicit_resolvers.get(None, [])\n            for tag, regexp in resolvers:\n                if regexp.match(value):\n                    return tag\n            implicit = implicit[1]\n        if self.yaml_path_resolvers:\n            exact_paths = self.resolver_exact_paths[-1]\n            if kind in exact_paths:\n                return exact_paths[kind]\n            if None in exact_paths:\n                return exact_paths[None]\n        if kind is ScalarNode:\n            return self.DEFAULT_SCALAR_TAG\n        elif kind is SequenceNode:\n            return self.DEFAULT_SEQUENCE_TAG\n        elif kind is MappingNode:\n            return self.DEFAULT_MAPPING_TAG\n\nclass Resolver(BaseResolver):\n    pass\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:bool',\n        re.compile(ur'''^(?:yes|Yes|YES|no|No|NO\n                    |true|True|TRUE|false|False|FALSE\n                    |on|On|ON|off|Off|OFF)$''', re.X),\n        list(u'yYnNtTfFoO'))\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:float',\n        re.compile(ur'''^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?\n                    |\\.[0-9_]+(?:[eE][-+][0-9]+)?\n                    |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*\n                    |[-+]?\\.(?:inf|Inf|INF)\n                    |\\.(?:nan|NaN|NAN))$''', re.X),\n        list(u'-+0123456789.'))\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:int',\n        re.compile(ur'''^(?:[-+]?0b[0-1_]+\n                    |[-+]?0[0-7_]+\n                    |[-+]?(?:0|[1-9][0-9_]*)\n                    |[-+]?0x[0-9a-fA-F_]+\n                    |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X),\n        list(u'-+0123456789'))\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:merge',\n        re.compile(ur'^(?:<<)$'),\n        [u'<'])\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:null',\n        re.compile(ur'''^(?: ~\n                    |null|Null|NULL\n                    | )$''', re.X),\n        [u'~', u'n', u'N', u''])\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:timestamp',\n        re.compile(ur'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\n                    |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]?\n                     (?:[Tt]|[ \\t]+)[0-9][0-9]?\n                     :[0-9][0-9] :[0-9][0-9] (?:\\.[0-9]*)?\n                     (?:[ \\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X),\n        list(u'0123456789'))\n\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:value',\n        re.compile(ur'^(?:=)$'),\n        [u'='])\n\n# The following resolver is only for documentation purposes. It cannot work\n# because plain scalars cannot start with '!', '&', or '*'.\nResolver.add_implicit_resolver(\n        u'tag:yaml.org,2002:yaml',\n        re.compile(ur'^(?:!|&|\\*)$'),\n        list(u'!&*'))\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/scanner.py",
    "content": "\n# Scanner produces tokens of the following types:\n# STREAM-START\n# STREAM-END\n# DIRECTIVE(name, value)\n# DOCUMENT-START\n# DOCUMENT-END\n# BLOCK-SEQUENCE-START\n# BLOCK-MAPPING-START\n# BLOCK-END\n# FLOW-SEQUENCE-START\n# FLOW-MAPPING-START\n# FLOW-SEQUENCE-END\n# FLOW-MAPPING-END\n# BLOCK-ENTRY\n# FLOW-ENTRY\n# KEY\n# VALUE\n# ALIAS(value)\n# ANCHOR(value)\n# TAG(value)\n# SCALAR(value, plain, style)\n#\n# Read comments in the Scanner code for more details.\n#\n\n__all__ = ['Scanner', 'ScannerError']\n\nfrom error import MarkedYAMLError\nfrom tokens import *\n\nclass ScannerError(MarkedYAMLError):\n    pass\n\nclass SimpleKey(object):\n    # See below simple keys treatment.\n\n    def __init__(self, token_number, required, index, line, column, mark):\n        self.token_number = token_number\n        self.required = required\n        self.index = index\n        self.line = line\n        self.column = column\n        self.mark = mark\n\nclass Scanner(object):\n\n    def __init__(self):\n        \"\"\"Initialize the scanner.\"\"\"\n        # It is assumed that Scanner and Reader will have a common descendant.\n        # Reader do the dirty work of checking for BOM and converting the\n        # input data to Unicode. It also adds NUL to the end.\n        #\n        # Reader supports the following methods\n        #   self.peek(i=0)       # peek the next i-th character\n        #   self.prefix(l=1)     # peek the next l characters\n        #   self.forward(l=1)    # read the next l characters and move the pointer.\n\n        # Had we reached the end of the stream?\n        self.done = False\n\n        # The number of unclosed '{' and '['. `flow_level == 0` means block\n        # context.\n        self.flow_level = 0\n\n        # List of processed tokens that are not yet emitted.\n        self.tokens = []\n\n        # Add the STREAM-START token.\n        self.fetch_stream_start()\n\n        # Number of tokens that were emitted through the `get_token` method.\n        self.tokens_taken = 0\n\n        # The current indentation level.\n        self.indent = -1\n\n        # Past indentation levels.\n        self.indents = []\n\n        # Variables related to simple keys treatment.\n\n        # A simple key is a key that is not denoted by the '?' indicator.\n        # Example of simple keys:\n        #   ---\n        #   block simple key: value\n        #   ? not a simple key:\n        #   : { flow simple key: value }\n        # We emit the KEY token before all keys, so when we find a potential\n        # simple key, we try to locate the corresponding ':' indicator.\n        # Simple keys should be limited to a single line and 1024 characters.\n\n        # Can a simple key start at the current position? A simple key may\n        # start:\n        # - at the beginning of the line, not counting indentation spaces\n        #       (in block context),\n        # - after '{', '[', ',' (in the flow context),\n        # - after '?', ':', '-' (in the block context).\n        # In the block context, this flag also signifies if a block collection\n        # may start at the current position.\n        self.allow_simple_key = True\n\n        # Keep track of possible simple keys. This is a dictionary. The key\n        # is `flow_level`; there can be no more that one possible simple key\n        # for each level. The value is a SimpleKey record:\n        #   (token_number, required, index, line, column, mark)\n        # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow),\n        # '[', or '{' tokens.\n        self.possible_simple_keys = {}\n\n    # Public methods.\n\n    def check_token(self, *choices):\n        # Check if the next token is one of the given types.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.tokens[0], choice):\n                    return True\n        return False\n\n    def peek_token(self):\n        # Return the next token, but do not delete if from the queue.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            return self.tokens[0]\n\n    def get_token(self):\n        # Return the next token.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            self.tokens_taken += 1\n            return self.tokens.pop(0)\n\n    # Private methods.\n\n    def need_more_tokens(self):\n        if self.done:\n            return False\n        if not self.tokens:\n            return True\n        # The current token may be a potential simple key, so we\n        # need to look further.\n        self.stale_possible_simple_keys()\n        if self.next_possible_simple_key() == self.tokens_taken:\n            return True\n\n    def fetch_more_tokens(self):\n\n        # Eat whitespaces and comments until we reach the next token.\n        self.scan_to_next_token()\n\n        # Remove obsolete possible simple keys.\n        self.stale_possible_simple_keys()\n\n        # Compare the current indentation and column. It may add some tokens\n        # and decrease the current indentation level.\n        self.unwind_indent(self.column)\n\n        # Peek the next character.\n        ch = self.peek()\n\n        # Is it the end of stream?\n        if ch == u'\\0':\n            return self.fetch_stream_end()\n\n        # Is it a directive?\n        if ch == u'%' and self.check_directive():\n            return self.fetch_directive()\n\n        # Is it the document start?\n        if ch == u'-' and self.check_document_start():\n            return self.fetch_document_start()\n\n        # Is it the document end?\n        if ch == u'.' and self.check_document_end():\n            return self.fetch_document_end()\n\n        # TODO: support for BOM within a stream.\n        #if ch == u'\\uFEFF':\n        #    return self.fetch_bom()    <-- issue BOMToken\n\n        # Note: the order of the following checks is NOT significant.\n\n        # Is it the flow sequence start indicator?\n        if ch == u'[':\n            return self.fetch_flow_sequence_start()\n\n        # Is it the flow mapping start indicator?\n        if ch == u'{':\n            return self.fetch_flow_mapping_start()\n\n        # Is it the flow sequence end indicator?\n        if ch == u']':\n            return self.fetch_flow_sequence_end()\n\n        # Is it the flow mapping end indicator?\n        if ch == u'}':\n            return self.fetch_flow_mapping_end()\n\n        # Is it the flow entry indicator?\n        if ch == u',':\n            return self.fetch_flow_entry()\n\n        # Is it the block entry indicator?\n        if ch == u'-' and self.check_block_entry():\n            return self.fetch_block_entry()\n\n        # Is it the key indicator?\n        if ch == u'?' and self.check_key():\n            return self.fetch_key()\n\n        # Is it the value indicator?\n        if ch == u':' and self.check_value():\n            return self.fetch_value()\n\n        # Is it an alias?\n        if ch == u'*':\n            return self.fetch_alias()\n\n        # Is it an anchor?\n        if ch == u'&':\n            return self.fetch_anchor()\n\n        # Is it a tag?\n        if ch == u'!':\n            return self.fetch_tag()\n\n        # Is it a literal scalar?\n        if ch == u'|' and not self.flow_level:\n            return self.fetch_literal()\n\n        # Is it a folded scalar?\n        if ch == u'>' and not self.flow_level:\n            return self.fetch_folded()\n\n        # Is it a single quoted scalar?\n        if ch == u'\\'':\n            return self.fetch_single()\n\n        # Is it a double quoted scalar?\n        if ch == u'\\\"':\n            return self.fetch_double()\n\n        # It must be a plain scalar then.\n        if self.check_plain():\n            return self.fetch_plain()\n\n        # No? It's an error. Let's produce a nice error message.\n        raise ScannerError(\"while scanning for the next token\", None,\n                \"found character %r that cannot start any token\"\n                % ch.encode('utf-8'), self.get_mark())\n\n    # Simple keys treatment.\n\n    def next_possible_simple_key(self):\n        # Return the number of the nearest possible simple key. Actually we\n        # don't need to loop through the whole dictionary. We may replace it\n        # with the following code:\n        #   if not self.possible_simple_keys:\n        #       return None\n        #   return self.possible_simple_keys[\n        #           min(self.possible_simple_keys.keys())].token_number\n        min_token_number = None\n        for level in self.possible_simple_keys:\n            key = self.possible_simple_keys[level]\n            if min_token_number is None or key.token_number < min_token_number:\n                min_token_number = key.token_number\n        return min_token_number\n\n    def stale_possible_simple_keys(self):\n        # Remove entries that are no longer possible simple keys. According to\n        # the YAML specification, simple keys\n        # - should be limited to a single line,\n        # - should be no longer than 1024 characters.\n        # Disabling this procedure will allow simple keys of any length and\n        # height (may cause problems if indentation is broken though).\n        for level in self.possible_simple_keys.keys():\n            key = self.possible_simple_keys[level]\n            if key.line != self.line  \\\n                    or self.index-key.index > 1024:\n                if key.required:\n                    raise ScannerError(\"while scanning a simple key\", key.mark,\n                            \"could not find expected ':'\", self.get_mark())\n                del self.possible_simple_keys[level]\n\n    def save_possible_simple_key(self):\n        # The next token may start a simple key. We check if it's possible\n        # and save its position. This function is called for\n        #   ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'.\n\n        # Check if a simple key is required at the current position.\n        required = not self.flow_level and self.indent == self.column\n\n        # The next token might be a simple key. Let's save it's number and\n        # position.\n        if self.allow_simple_key:\n            self.remove_possible_simple_key()\n            token_number = self.tokens_taken+len(self.tokens)\n            key = SimpleKey(token_number, required,\n                    self.index, self.line, self.column, self.get_mark())\n            self.possible_simple_keys[self.flow_level] = key\n\n    def remove_possible_simple_key(self):\n        # Remove the saved possible key position at the current flow level.\n        if self.flow_level in self.possible_simple_keys:\n            key = self.possible_simple_keys[self.flow_level]\n            \n            if key.required:\n                raise ScannerError(\"while scanning a simple key\", key.mark,\n                        \"could not find expected ':'\", self.get_mark())\n\n            del self.possible_simple_keys[self.flow_level]\n\n    # Indentation functions.\n\n    def unwind_indent(self, column):\n\n        ## In flow context, tokens should respect indentation.\n        ## Actually the condition should be `self.indent >= column` according to\n        ## the spec. But this condition will prohibit intuitively correct\n        ## constructions such as\n        ## key : {\n        ## }\n        #if self.flow_level and self.indent > column:\n        #    raise ScannerError(None, None,\n        #            \"invalid intendation or unclosed '[' or '{'\",\n        #            self.get_mark())\n\n        # In the flow context, indentation is ignored. We make the scanner less\n        # restrictive then specification requires.\n        if self.flow_level:\n            return\n\n        # In block context, we may need to issue the BLOCK-END tokens.\n        while self.indent > column:\n            mark = self.get_mark()\n            self.indent = self.indents.pop()\n            self.tokens.append(BlockEndToken(mark, mark))\n\n    def add_indent(self, column):\n        # Check if we need to increase indentation.\n        if self.indent < column:\n            self.indents.append(self.indent)\n            self.indent = column\n            return True\n        return False\n\n    # Fetchers.\n\n    def fetch_stream_start(self):\n        # We always add STREAM-START as the first token and STREAM-END as the\n        # last token.\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-START.\n        self.tokens.append(StreamStartToken(mark, mark,\n            encoding=self.encoding))\n        \n\n    def fetch_stream_end(self):\n\n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n        self.possible_simple_keys = {}\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-END.\n        self.tokens.append(StreamEndToken(mark, mark))\n\n        # The steam is finished.\n        self.done = True\n\n    def fetch_directive(self):\n        \n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Scan and add DIRECTIVE.\n        self.tokens.append(self.scan_directive())\n\n    def fetch_document_start(self):\n        self.fetch_document_indicator(DocumentStartToken)\n\n    def fetch_document_end(self):\n        self.fetch_document_indicator(DocumentEndToken)\n\n    def fetch_document_indicator(self, TokenClass):\n\n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys. Note that there could not be a block collection\n        # after '---'.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Add DOCUMENT-START or DOCUMENT-END.\n        start_mark = self.get_mark()\n        self.forward(3)\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_start(self):\n        self.fetch_flow_collection_start(FlowSequenceStartToken)\n\n    def fetch_flow_mapping_start(self):\n        self.fetch_flow_collection_start(FlowMappingStartToken)\n\n    def fetch_flow_collection_start(self, TokenClass):\n\n        # '[' and '{' may start a simple key.\n        self.save_possible_simple_key()\n\n        # Increase the flow level.\n        self.flow_level += 1\n\n        # Simple keys are allowed after '[' and '{'.\n        self.allow_simple_key = True\n\n        # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_end(self):\n        self.fetch_flow_collection_end(FlowSequenceEndToken)\n\n    def fetch_flow_mapping_end(self):\n        self.fetch_flow_collection_end(FlowMappingEndToken)\n\n    def fetch_flow_collection_end(self, TokenClass):\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Decrease the flow level.\n        self.flow_level -= 1\n\n        # No simple keys after ']' or '}'.\n        self.allow_simple_key = False\n\n        # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_entry(self):\n\n        # Simple keys are allowed after ','.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add FLOW-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(FlowEntryToken(start_mark, end_mark))\n\n    def fetch_block_entry(self):\n\n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a new entry?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"sequence entries are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-SEQUENCE-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockSequenceStartToken(mark, mark))\n\n        # It's an error for the block entry to occur in the flow context,\n        # but we let the parser detect this.\n        else:\n            pass\n\n        # Simple keys are allowed after '-'.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add BLOCK-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(BlockEntryToken(start_mark, end_mark))\n\n    def fetch_key(self):\n        \n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a key (not nessesary a simple)?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"mapping keys are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-MAPPING-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockMappingStartToken(mark, mark))\n\n        # Simple keys are allowed after '?' in the block context.\n        self.allow_simple_key = not self.flow_level\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add KEY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(KeyToken(start_mark, end_mark))\n\n    def fetch_value(self):\n\n        # Do we determine a simple key?\n        if self.flow_level in self.possible_simple_keys:\n\n            # Add KEY.\n            key = self.possible_simple_keys[self.flow_level]\n            del self.possible_simple_keys[self.flow_level]\n            self.tokens.insert(key.token_number-self.tokens_taken,\n                    KeyToken(key.mark, key.mark))\n\n            # If this key starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.\n            if not self.flow_level:\n                if self.add_indent(key.column):\n                    self.tokens.insert(key.token_number-self.tokens_taken,\n                            BlockMappingStartToken(key.mark, key.mark))\n\n            # There cannot be two simple keys one after another.\n            self.allow_simple_key = False\n\n        # It must be a part of a complex key.\n        else:\n            \n            # Block context needs additional checks.\n            # (Do we really need them? They will be catched by the parser\n            # anyway.)\n            if not self.flow_level:\n\n                # We are allowed to start a complex value if and only if\n                # we can start a simple key.\n                if not self.allow_simple_key:\n                    raise ScannerError(None, None,\n                            \"mapping values are not allowed here\",\n                            self.get_mark())\n\n            # If this value starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.  It will be detected as an error later by\n            # the parser.\n            if not self.flow_level:\n                if self.add_indent(self.column):\n                    mark = self.get_mark()\n                    self.tokens.append(BlockMappingStartToken(mark, mark))\n\n            # Simple keys are allowed after ':' in the block context.\n            self.allow_simple_key = not self.flow_level\n\n            # Reset possible simple key on the current level.\n            self.remove_possible_simple_key()\n\n        # Add VALUE.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(ValueToken(start_mark, end_mark))\n\n    def fetch_alias(self):\n\n        # ALIAS could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ALIAS.\n        self.allow_simple_key = False\n\n        # Scan and add ALIAS.\n        self.tokens.append(self.scan_anchor(AliasToken))\n\n    def fetch_anchor(self):\n\n        # ANCHOR could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ANCHOR.\n        self.allow_simple_key = False\n\n        # Scan and add ANCHOR.\n        self.tokens.append(self.scan_anchor(AnchorToken))\n\n    def fetch_tag(self):\n\n        # TAG could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after TAG.\n        self.allow_simple_key = False\n\n        # Scan and add TAG.\n        self.tokens.append(self.scan_tag())\n\n    def fetch_literal(self):\n        self.fetch_block_scalar(style='|')\n\n    def fetch_folded(self):\n        self.fetch_block_scalar(style='>')\n\n    def fetch_block_scalar(self, style):\n\n        # A simple key may follow a block scalar.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_block_scalar(style))\n\n    def fetch_single(self):\n        self.fetch_flow_scalar(style='\\'')\n\n    def fetch_double(self):\n        self.fetch_flow_scalar(style='\"')\n\n    def fetch_flow_scalar(self, style):\n\n        # A flow scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after flow scalars.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_flow_scalar(style))\n\n    def fetch_plain(self):\n\n        # A plain scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after plain scalars. But note that `scan_plain` will\n        # change this flag if the scan is finished at the beginning of the\n        # line.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR. May change `allow_simple_key`.\n        self.tokens.append(self.scan_plain())\n\n    # Checkers.\n\n    def check_directive(self):\n\n        # DIRECTIVE:        ^ '%' ...\n        # The '%' indicator is already checked.\n        if self.column == 0:\n            return True\n\n    def check_document_start(self):\n\n        # DOCUMENT-START:   ^ '---' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == u'---'  \\\n                    and self.peek(3) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_document_end(self):\n\n        # DOCUMENT-END:     ^ '...' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == u'...'  \\\n                    and self.peek(3) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_block_entry(self):\n\n        # BLOCK-ENTRY:      '-' (' '|'\\n')\n        return self.peek(1) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_key(self):\n\n        # KEY(flow context):    '?'\n        if self.flow_level:\n            return True\n\n        # KEY(block context):   '?' (' '|'\\n')\n        else:\n            return self.peek(1) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_value(self):\n\n        # VALUE(flow context):  ':'\n        if self.flow_level:\n            return True\n\n        # VALUE(block context): ':' (' '|'\\n')\n        else:\n            return self.peek(1) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_plain(self):\n\n        # A plain scalar may start with any non-space character except:\n        #   '-', '?', ':', ',', '[', ']', '{', '}',\n        #   '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n        #   '%', '@', '`'.\n        #\n        # It may also start with\n        #   '-', '?', ':'\n        # if it is followed by a non-space character.\n        #\n        # Note that we limit the last rule to the block context (except the\n        # '-' character) because we want the flow context to be space\n        # independent.\n        ch = self.peek()\n        return ch not in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029-?:,[]{}#&*!|>\\'\\\"%@`'  \\\n                or (self.peek(1) not in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n                        and (ch == u'-' or (not self.flow_level and ch in u'?:')))\n\n    # Scanners.\n\n    def scan_to_next_token(self):\n        # We ignore spaces, line breaks and comments.\n        # If we find a line break in the block context, we set the flag\n        # `allow_simple_key` on.\n        # The byte order mark is stripped if it's the first character in the\n        # stream. We do not yet support BOM inside the stream as the\n        # specification requires. Any such mark will be considered as a part\n        # of the document.\n        #\n        # TODO: We need to make tab handling rules more sane. A good rule is\n        #   Tabs cannot precede tokens\n        #   BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END,\n        #   KEY(block), VALUE(block), BLOCK-ENTRY\n        # So the checking code is\n        #   if <TAB>:\n        #       self.allow_simple_keys = False\n        # We also need to add the check for `allow_simple_keys == True` to\n        # `unwind_indent` before issuing BLOCK-END.\n        # Scanners for block, flow, and plain scalars need to be modified.\n\n        if self.index == 0 and self.peek() == u'\\uFEFF':\n            self.forward()\n        found = False\n        while not found:\n            while self.peek() == u' ':\n                self.forward()\n            if self.peek() == u'#':\n                while self.peek() not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n                    self.forward()\n            if self.scan_line_break():\n                if not self.flow_level:\n                    self.allow_simple_key = True\n            else:\n                found = True\n\n    def scan_directive(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        self.forward()\n        name = self.scan_directive_name(start_mark)\n        value = None\n        if name == u'YAML':\n            value = self.scan_yaml_directive_value(start_mark)\n            end_mark = self.get_mark()\n        elif name == u'TAG':\n            value = self.scan_tag_directive_value(start_mark)\n            end_mark = self.get_mark()\n        else:\n            end_mark = self.get_mark()\n            while self.peek() not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        self.scan_directive_ignored_line(start_mark)\n        return DirectiveToken(name, value, start_mark, end_mark)\n\n    def scan_directive_name(self, start_mark):\n        # See the specification for details.\n        length = 0\n        ch = self.peek(length)\n        while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'    \\\n                or ch in u'-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch.encode('utf-8'), self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch.encode('utf-8'), self.get_mark())\n        return value\n\n    def scan_yaml_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == u' ':\n            self.forward()\n        major = self.scan_yaml_directive_number(start_mark)\n        if self.peek() != '.':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or '.', but found %r\"\n                    % self.peek().encode('utf-8'),\n                    self.get_mark())\n        self.forward()\n        minor = self.scan_yaml_directive_number(start_mark)\n        if self.peek() not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or ' ', but found %r\"\n                    % self.peek().encode('utf-8'),\n                    self.get_mark())\n        return (major, minor)\n\n    def scan_yaml_directive_number(self, start_mark):\n        # See the specification for details.\n        ch = self.peek()\n        if not (u'0' <= ch <= u'9'):\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit, but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        length = 0\n        while u'0' <= self.peek(length) <= u'9':\n            length += 1\n        value = int(self.prefix(length))\n        self.forward(length)\n        return value\n\n    def scan_tag_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == u' ':\n            self.forward()\n        handle = self.scan_tag_directive_handle(start_mark)\n        while self.peek() == u' ':\n            self.forward()\n        prefix = self.scan_tag_directive_prefix(start_mark)\n        return (handle, prefix)\n\n    def scan_tag_directive_handle(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_handle('directive', start_mark)\n        ch = self.peek()\n        if ch != u' ':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        return value\n\n    def scan_tag_directive_prefix(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_uri('directive', start_mark)\n        ch = self.peek()\n        if ch not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        return value\n\n    def scan_directive_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == u' ':\n            self.forward()\n        if self.peek() == u'#':\n            while self.peek() not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a comment or a line break, but found %r\"\n                        % ch.encode('utf-8'), self.get_mark())\n        self.scan_line_break()\n\n    def scan_anchor(self, TokenClass):\n        # The specification does not restrict characters for anchors and\n        # aliases. This may lead to problems, for instance, the document:\n        #   [ *alias, value ]\n        # can be interpteted in two ways, as\n        #   [ \"value\" ]\n        # and\n        #   [ *alias , \"value\" ]\n        # Therefore we restrict aliases to numbers and ASCII letters.\n        start_mark = self.get_mark()\n        indicator = self.peek()\n        if indicator == u'*':\n            name = 'alias'\n        else:\n            name = 'anchor'\n        self.forward()\n        length = 0\n        ch = self.peek(length)\n        while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'    \\\n                or ch in u'-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch.encode('utf-8'), self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029?:,]}%@`':\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch.encode('utf-8'), self.get_mark())\n        end_mark = self.get_mark()\n        return TokenClass(value, start_mark, end_mark)\n\n    def scan_tag(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        ch = self.peek(1)\n        if ch == u'<':\n            handle = None\n            self.forward(2)\n            suffix = self.scan_tag_uri('tag', start_mark)\n            if self.peek() != u'>':\n                raise ScannerError(\"while parsing a tag\", start_mark,\n                        \"expected '>', but found %r\" % self.peek().encode('utf-8'),\n                        self.get_mark())\n            self.forward()\n        elif ch in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n            handle = None\n            suffix = u'!'\n            self.forward()\n        else:\n            length = 1\n            use_handle = False\n            while ch not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n                if ch == u'!':\n                    use_handle = True\n                    break\n                length += 1\n                ch = self.peek(length)\n            handle = u'!'\n            if use_handle:\n                handle = self.scan_tag_handle('tag', start_mark)\n            else:\n                handle = u'!'\n                self.forward()\n            suffix = self.scan_tag_uri('tag', start_mark)\n        ch = self.peek()\n        if ch not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a tag\", start_mark,\n                    \"expected ' ', but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        value = (handle, suffix)\n        end_mark = self.get_mark()\n        return TagToken(value, start_mark, end_mark)\n\n    def scan_block_scalar(self, style):\n        # See the specification for details.\n\n        if style == '>':\n            folded = True\n        else:\n            folded = False\n\n        chunks = []\n        start_mark = self.get_mark()\n\n        # Scan the header.\n        self.forward()\n        chomping, increment = self.scan_block_scalar_indicators(start_mark)\n        self.scan_block_scalar_ignored_line(start_mark)\n\n        # Determine the indentation level and go to the first non-empty line.\n        min_indent = self.indent+1\n        if min_indent < 1:\n            min_indent = 1\n        if increment is None:\n            breaks, max_indent, end_mark = self.scan_block_scalar_indentation()\n            indent = max(min_indent, max_indent)\n        else:\n            indent = min_indent+increment-1\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n        line_break = u''\n\n        # Scan the inner part of the block scalar.\n        while self.column == indent and self.peek() != u'\\0':\n            chunks.extend(breaks)\n            leading_non_space = self.peek() not in u' \\t'\n            length = 0\n            while self.peek(length) not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            line_break = self.scan_line_break()\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n            if self.column == indent and self.peek() != u'\\0':\n\n                # Unfortunately, folding rules are ambiguous.\n                #\n                # This is the folding according to the specification:\n                \n                if folded and line_break == u'\\n'   \\\n                        and leading_non_space and self.peek() not in u' \\t':\n                    if not breaks:\n                        chunks.append(u' ')\n                else:\n                    chunks.append(line_break)\n                \n                # This is Clark Evans's interpretation (also in the spec\n                # examples):\n                #\n                #if folded and line_break == u'\\n':\n                #    if not breaks:\n                #        if self.peek() not in ' \\t':\n                #            chunks.append(u' ')\n                #        else:\n                #            chunks.append(line_break)\n                #else:\n                #    chunks.append(line_break)\n            else:\n                break\n\n        # Chomp the tail.\n        if chomping is not False:\n            chunks.append(line_break)\n        if chomping is True:\n            chunks.extend(breaks)\n\n        # We are done.\n        return ScalarToken(u''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    def scan_block_scalar_indicators(self, start_mark):\n        # See the specification for details.\n        chomping = None\n        increment = None\n        ch = self.peek()\n        if ch in u'+-':\n            if ch == '+':\n                chomping = True\n            else:\n                chomping = False\n            self.forward()\n            ch = self.peek()\n            if ch in u'0123456789':\n                increment = int(ch)\n                if increment == 0:\n                    raise ScannerError(\"while scanning a block scalar\", start_mark,\n                            \"expected indentation indicator in the range 1-9, but found 0\",\n                            self.get_mark())\n                self.forward()\n        elif ch in u'0123456789':\n            increment = int(ch)\n            if increment == 0:\n                raise ScannerError(\"while scanning a block scalar\", start_mark,\n                        \"expected indentation indicator in the range 1-9, but found 0\",\n                        self.get_mark())\n            self.forward()\n            ch = self.peek()\n            if ch in u'+-':\n                if ch == '+':\n                    chomping = True\n                else:\n                    chomping = False\n                self.forward()\n        ch = self.peek()\n        if ch not in u'\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected chomping or indentation indicators, but found %r\"\n                        % ch.encode('utf-8'), self.get_mark())\n        return chomping, increment\n\n    def scan_block_scalar_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == u' ':\n            self.forward()\n        if self.peek() == u'#':\n            while self.peek() not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in u'\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected a comment or a line break, but found %r\"\n                        % ch.encode('utf-8'), self.get_mark())\n        self.scan_line_break()\n\n    def scan_block_scalar_indentation(self):\n        # See the specification for details.\n        chunks = []\n        max_indent = 0\n        end_mark = self.get_mark()\n        while self.peek() in u' \\r\\n\\x85\\u2028\\u2029':\n            if self.peek() != u' ':\n                chunks.append(self.scan_line_break())\n                end_mark = self.get_mark()\n            else:\n                self.forward()\n                if self.column > max_indent:\n                    max_indent = self.column\n        return chunks, max_indent, end_mark\n\n    def scan_block_scalar_breaks(self, indent):\n        # See the specification for details.\n        chunks = []\n        end_mark = self.get_mark()\n        while self.column < indent and self.peek() == u' ':\n            self.forward()\n        while self.peek() in u'\\r\\n\\x85\\u2028\\u2029':\n            chunks.append(self.scan_line_break())\n            end_mark = self.get_mark()\n            while self.column < indent and self.peek() == u' ':\n                self.forward()\n        return chunks, end_mark\n\n    def scan_flow_scalar(self, style):\n        # See the specification for details.\n        # Note that we loose indentation rules for quoted scalars. Quoted\n        # scalars don't need to adhere indentation because \" and ' clearly\n        # mark the beginning and the end of them. Therefore we are less\n        # restrictive then the specification requires. We only need to check\n        # that document separators are not included in scalars.\n        if style == '\"':\n            double = True\n        else:\n            double = False\n        chunks = []\n        start_mark = self.get_mark()\n        quote = self.peek()\n        self.forward()\n        chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        while self.peek() != quote:\n            chunks.extend(self.scan_flow_scalar_spaces(double, start_mark))\n            chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        self.forward()\n        end_mark = self.get_mark()\n        return ScalarToken(u''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    ESCAPE_REPLACEMENTS = {\n        u'0':   u'\\0',\n        u'a':   u'\\x07',\n        u'b':   u'\\x08',\n        u't':   u'\\x09',\n        u'\\t':  u'\\x09',\n        u'n':   u'\\x0A',\n        u'v':   u'\\x0B',\n        u'f':   u'\\x0C',\n        u'r':   u'\\x0D',\n        u'e':   u'\\x1B',\n        u' ':   u'\\x20',\n        u'\\\"':  u'\\\"',\n        u'\\\\':  u'\\\\',\n        u'N':   u'\\x85',\n        u'_':   u'\\xA0',\n        u'L':   u'\\u2028',\n        u'P':   u'\\u2029',\n    }\n\n    ESCAPE_CODES = {\n        u'x':   2,\n        u'u':   4,\n        u'U':   8,\n    }\n\n    def scan_flow_scalar_non_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            length = 0\n            while self.peek(length) not in u'\\'\\\"\\\\\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            if length:\n                chunks.append(self.prefix(length))\n                self.forward(length)\n            ch = self.peek()\n            if not double and ch == u'\\'' and self.peek(1) == u'\\'':\n                chunks.append(u'\\'')\n                self.forward(2)\n            elif (double and ch == u'\\'') or (not double and ch in u'\\\"\\\\'):\n                chunks.append(ch)\n                self.forward()\n            elif double and ch == u'\\\\':\n                self.forward()\n                ch = self.peek()\n                if ch in self.ESCAPE_REPLACEMENTS:\n                    chunks.append(self.ESCAPE_REPLACEMENTS[ch])\n                    self.forward()\n                elif ch in self.ESCAPE_CODES:\n                    length = self.ESCAPE_CODES[ch]\n                    self.forward()\n                    for k in range(length):\n                        if self.peek(k) not in u'0123456789ABCDEFabcdef':\n                            raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                                    \"expected escape sequence of %d hexdecimal numbers, but found %r\" %\n                                        (length, self.peek(k).encode('utf-8')), self.get_mark())\n                    code = int(self.prefix(length), 16)\n                    chunks.append(unichr(code))\n                    self.forward(length)\n                elif ch in u'\\r\\n\\x85\\u2028\\u2029':\n                    self.scan_line_break()\n                    chunks.extend(self.scan_flow_scalar_breaks(double, start_mark))\n                else:\n                    raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                            \"found unknown escape character %r\" % ch.encode('utf-8'), self.get_mark())\n            else:\n                return chunks\n\n    def scan_flow_scalar_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        length = 0\n        while self.peek(length) in u' \\t':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch == u'\\0':\n            raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                    \"found unexpected end of stream\", self.get_mark())\n        elif ch in u'\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            breaks = self.scan_flow_scalar_breaks(double, start_mark)\n            if line_break != u'\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(u' ')\n            chunks.extend(breaks)\n        else:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_flow_scalar_breaks(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            # Instead of checking indentation, we check for document\n            # separators.\n            prefix = self.prefix(3)\n            if (prefix == u'---' or prefix == u'...')   \\\n                    and self.peek(3) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                        \"found unexpected document separator\", self.get_mark())\n            while self.peek() in u' \\t':\n                self.forward()\n            if self.peek() in u'\\r\\n\\x85\\u2028\\u2029':\n                chunks.append(self.scan_line_break())\n            else:\n                return chunks\n\n    def scan_plain(self):\n        # See the specification for details.\n        # We add an additional restriction for the flow context:\n        #   plain scalars in the flow context cannot contain ',', ':' and '?'.\n        # We also keep track of the `allow_simple_key` flag here.\n        # Indentation rules are loosed for the flow context.\n        chunks = []\n        start_mark = self.get_mark()\n        end_mark = start_mark\n        indent = self.indent+1\n        # We allow zero indentation for scalars, but then we need to check for\n        # document separators at the beginning of the line.\n        #if indent == 0:\n        #    indent = 1\n        spaces = []\n        while True:\n            length = 0\n            if self.peek() == u'#':\n                break\n            while True:\n                ch = self.peek(length)\n                if ch in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029'   \\\n                        or (not self.flow_level and ch == u':' and\n                                self.peek(length+1) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029') \\\n                        or (self.flow_level and ch in u',:?[]{}'):\n                    break\n                length += 1\n            # It's not clear what we should do with ':' in the flow context.\n            if (self.flow_level and ch == u':'\n                    and self.peek(length+1) not in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029,[]{}'):\n                self.forward(length)\n                raise ScannerError(\"while scanning a plain scalar\", start_mark,\n                    \"found unexpected ':'\", self.get_mark(),\n                    \"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.\")\n            if length == 0:\n                break\n            self.allow_simple_key = False\n            chunks.extend(spaces)\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            end_mark = self.get_mark()\n            spaces = self.scan_plain_spaces(indent, start_mark)\n            if not spaces or self.peek() == u'#' \\\n                    or (not self.flow_level and self.column < indent):\n                break\n        return ScalarToken(u''.join(chunks), True, start_mark, end_mark)\n\n    def scan_plain_spaces(self, indent, start_mark):\n        # See the specification for details.\n        # The specification is really confusing about tabs in plain scalars.\n        # We just forbid them completely. Do not use tabs in YAML!\n        chunks = []\n        length = 0\n        while self.peek(length) in u' ':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch in u'\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            self.allow_simple_key = True\n            prefix = self.prefix(3)\n            if (prefix == u'---' or prefix == u'...')   \\\n                    and self.peek(3) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return\n            breaks = []\n            while self.peek() in u' \\r\\n\\x85\\u2028\\u2029':\n                if self.peek() == ' ':\n                    self.forward()\n                else:\n                    breaks.append(self.scan_line_break())\n                    prefix = self.prefix(3)\n                    if (prefix == u'---' or prefix == u'...')   \\\n                            and self.peek(3) in u'\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                        return\n            if line_break != u'\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(u' ')\n            chunks.extend(breaks)\n        elif whitespaces:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_tag_handle(self, name, start_mark):\n        # See the specification for details.\n        # For some strange reasons, the specification does not allow '_' in\n        # tag handles. I have allowed it anyway.\n        ch = self.peek()\n        if ch != u'!':\n            raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                    \"expected '!', but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        length = 1\n        ch = self.peek(length)\n        if ch != u' ':\n            while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'    \\\n                    or ch in u'-_':\n                length += 1\n                ch = self.peek(length)\n            if ch != u'!':\n                self.forward(length)\n                raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                        \"expected '!', but found %r\" % ch.encode('utf-8'),\n                        self.get_mark())\n            length += 1\n        value = self.prefix(length)\n        self.forward(length)\n        return value\n\n    def scan_tag_uri(self, name, start_mark):\n        # See the specification for details.\n        # Note: we do not check if URI is well-formed.\n        chunks = []\n        length = 0\n        ch = self.peek(length)\n        while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'    \\\n                or ch in u'-;/?:@&=+$,_.!~*\\'()[]%':\n            if ch == u'%':\n                chunks.append(self.prefix(length))\n                self.forward(length)\n                length = 0\n                chunks.append(self.scan_uri_escapes(name, start_mark))\n            else:\n                length += 1\n            ch = self.peek(length)\n        if length:\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            length = 0\n        if not chunks:\n            raise ScannerError(\"while parsing a %s\" % name, start_mark,\n                    \"expected URI, but found %r\" % ch.encode('utf-8'),\n                    self.get_mark())\n        return u''.join(chunks)\n\n    def scan_uri_escapes(self, name, start_mark):\n        # See the specification for details.\n        bytes = []\n        mark = self.get_mark()\n        while self.peek() == u'%':\n            self.forward()\n            for k in range(2):\n                if self.peek(k) not in u'0123456789ABCDEFabcdef':\n                    raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                            \"expected URI escape sequence of 2 hexdecimal numbers, but found %r\" %\n                                (self.peek(k).encode('utf-8')), self.get_mark())\n            bytes.append(chr(int(self.prefix(2), 16)))\n            self.forward(2)\n        try:\n            value = unicode(''.join(bytes), 'utf-8')\n        except UnicodeDecodeError, exc:\n            raise ScannerError(\"while scanning a %s\" % name, start_mark, str(exc), mark)\n        return value\n\n    def scan_line_break(self):\n        # Transforms:\n        #   '\\r\\n'      :   '\\n'\n        #   '\\r'        :   '\\n'\n        #   '\\n'        :   '\\n'\n        #   '\\x85'      :   '\\n'\n        #   '\\u2028'    :   '\\u2028'\n        #   '\\u2029     :   '\\u2029'\n        #   default     :   ''\n        ch = self.peek()\n        if ch in u'\\r\\n\\x85':\n            if self.prefix(2) == u'\\r\\n':\n                self.forward(2)\n            else:\n                self.forward()\n            return u'\\n'\n        elif ch in u'\\u2028\\u2029':\n            self.forward()\n            return ch\n        return u''\n\n#try:\n#    import psyco\n#    psyco.bind(Scanner)\n#except ImportError:\n#    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/serializer.py",
    "content": "\n__all__ = ['Serializer', 'SerializerError']\n\nfrom error import YAMLError\nfrom events import *\nfrom nodes import *\n\nclass SerializerError(YAMLError):\n    pass\n\nclass Serializer(object):\n\n    ANCHOR_TEMPLATE = u'id%03d'\n\n    def __init__(self, encoding=None,\n            explicit_start=None, explicit_end=None, version=None, tags=None):\n        self.use_encoding = encoding\n        self.use_explicit_start = explicit_start\n        self.use_explicit_end = explicit_end\n        self.use_version = version\n        self.use_tags = tags\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n        self.closed = None\n\n    def open(self):\n        if self.closed is None:\n            self.emit(StreamStartEvent(encoding=self.use_encoding))\n            self.closed = False\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        else:\n            raise SerializerError(\"serializer is already opened\")\n\n    def close(self):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif not self.closed:\n            self.emit(StreamEndEvent())\n            self.closed = True\n\n    #def __del__(self):\n    #    self.close()\n\n    def serialize(self, node):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        self.emit(DocumentStartEvent(explicit=self.use_explicit_start,\n            version=self.use_version, tags=self.use_tags))\n        self.anchor_node(node)\n        self.serialize_node(node, None, None)\n        self.emit(DocumentEndEvent(explicit=self.use_explicit_end))\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n\n    def anchor_node(self, node):\n        if node in self.anchors:\n            if self.anchors[node] is None:\n                self.anchors[node] = self.generate_anchor(node)\n        else:\n            self.anchors[node] = None\n            if isinstance(node, SequenceNode):\n                for item in node.value:\n                    self.anchor_node(item)\n            elif isinstance(node, MappingNode):\n                for key, value in node.value:\n                    self.anchor_node(key)\n                    self.anchor_node(value)\n\n    def generate_anchor(self, node):\n        self.last_anchor_id += 1\n        return self.ANCHOR_TEMPLATE % self.last_anchor_id\n\n    def serialize_node(self, node, parent, index):\n        alias = self.anchors[node]\n        if node in self.serialized_nodes:\n            self.emit(AliasEvent(alias))\n        else:\n            self.serialized_nodes[node] = True\n            self.descend_resolver(parent, index)\n            if isinstance(node, ScalarNode):\n                detected_tag = self.resolve(ScalarNode, node.value, (True, False))\n                default_tag = self.resolve(ScalarNode, node.value, (False, True))\n                implicit = (node.tag == detected_tag), (node.tag == default_tag)\n                self.emit(ScalarEvent(alias, node.tag, implicit, node.value,\n                    style=node.style))\n            elif isinstance(node, SequenceNode):\n                implicit = (node.tag\n                            == self.resolve(SequenceNode, node.value, True))\n                self.emit(SequenceStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                index = 0\n                for item in node.value:\n                    self.serialize_node(item, node, index)\n                    index += 1\n                self.emit(SequenceEndEvent())\n            elif isinstance(node, MappingNode):\n                implicit = (node.tag\n                            == self.resolve(MappingNode, node.value, True))\n                self.emit(MappingStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                for key, value in node.value:\n                    self.serialize_node(key, node, None)\n                    self.serialize_node(value, node, key)\n                self.emit(MappingEndEvent())\n            self.ascend_resolver()\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_27/yaml/tokens.py",
    "content": "\nclass Token(object):\n    def __init__(self, start_mark, end_mark):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in self.__dict__\n                if not key.endswith('_mark')]\n        attributes.sort()\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\n#class BOMToken(Token):\n#    id = '<byte order mark>'\n\nclass DirectiveToken(Token):\n    id = '<directive>'\n    def __init__(self, name, value, start_mark, end_mark):\n        self.name = name\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass DocumentStartToken(Token):\n    id = '<document start>'\n\nclass DocumentEndToken(Token):\n    id = '<document end>'\n\nclass StreamStartToken(Token):\n    id = '<stream start>'\n    def __init__(self, start_mark=None, end_mark=None,\n            encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndToken(Token):\n    id = '<stream end>'\n\nclass BlockSequenceStartToken(Token):\n    id = '<block sequence start>'\n\nclass BlockMappingStartToken(Token):\n    id = '<block mapping start>'\n\nclass BlockEndToken(Token):\n    id = '<block end>'\n\nclass FlowSequenceStartToken(Token):\n    id = '['\n\nclass FlowMappingStartToken(Token):\n    id = '{'\n\nclass FlowSequenceEndToken(Token):\n    id = ']'\n\nclass FlowMappingEndToken(Token):\n    id = '}'\n\nclass KeyToken(Token):\n    id = '?'\n\nclass ValueToken(Token):\n    id = ':'\n\nclass BlockEntryToken(Token):\n    id = '-'\n\nclass FlowEntryToken(Token):\n    id = ','\n\nclass AliasToken(Token):\n    id = '<alias>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass AnchorToken(Token):\n    id = '<anchor>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass TagToken(Token):\n    id = '<tag>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass ScalarToken(Token):\n    id = '<scalar>'\n    def __init__(self, value, plain, start_mark, end_mark, style=None):\n        self.value = value\n        self.plain = plain\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/LICENSE",
    "content": "Copyright (c) 2017-2018 Ingy döt Net\nCopyright (c) 2006-2016 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/__init__.py",
    "content": "\nfrom .error import *\n\nfrom .tokens import *\nfrom .events import *\nfrom .nodes import *\n\nfrom .loader import *\nfrom .dumper import *\n\n__version__ = '3.13'\ntry:\n    from .cyaml import *\n    __with_libyaml__ = True\nexcept ImportError:\n    __with_libyaml__ = False\n\nimport io\n\ndef scan(stream, Loader=Loader):\n    \"\"\"\n    Scan a YAML stream and produce scanning tokens.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_token():\n            yield loader.get_token()\n    finally:\n        loader.dispose()\n\ndef parse(stream, Loader=Loader):\n    \"\"\"\n    Parse a YAML stream and produce parsing events.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_event():\n            yield loader.get_event()\n    finally:\n        loader.dispose()\n\ndef compose(stream, Loader=Loader):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding representation tree.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        return loader.get_single_node()\n    finally:\n        loader.dispose()\n\ndef compose_all(stream, Loader=Loader):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding representation trees.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_node():\n            yield loader.get_node()\n    finally:\n        loader.dispose()\n\ndef load(stream, Loader=Loader):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        return loader.get_single_data()\n    finally:\n        loader.dispose()\n\ndef load_all(stream, Loader=Loader):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n    \"\"\"\n    loader = Loader(stream)\n    try:\n        while loader.check_data():\n            yield loader.get_data()\n    finally:\n        loader.dispose()\n\ndef safe_load(stream):\n    \"\"\"\n    Parse the first YAML document in a stream\n    and produce the corresponding Python object.\n    Resolve only basic YAML tags.\n    \"\"\"\n    return load(stream, SafeLoader)\n\ndef safe_load_all(stream):\n    \"\"\"\n    Parse all YAML documents in a stream\n    and produce corresponding Python objects.\n    Resolve only basic YAML tags.\n    \"\"\"\n    return load_all(stream, SafeLoader)\n\ndef emit(events, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None):\n    \"\"\"\n    Emit YAML parsing events into a stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        stream = io.StringIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break)\n    try:\n        for event in events:\n            dumper.emit(event)\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize_all(nodes, stream=None, Dumper=Dumper,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding=None, explicit_start=None, explicit_end=None,\n        version=None, tags=None):\n    \"\"\"\n    Serialize a sequence of representation trees into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            stream = io.StringIO()\n        else:\n            stream = io.BytesIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end)\n    try:\n        dumper.open()\n        for node in nodes:\n            dumper.serialize(node)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef serialize(node, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a representation tree into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return serialize_all([node], stream, Dumper=Dumper, **kwds)\n\ndef dump_all(documents, stream=None, Dumper=Dumper,\n        default_style=None, default_flow_style=None,\n        canonical=None, indent=None, width=None,\n        allow_unicode=None, line_break=None,\n        encoding=None, explicit_start=None, explicit_end=None,\n        version=None, tags=None):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    getvalue = None\n    if stream is None:\n        if encoding is None:\n            stream = io.StringIO()\n        else:\n            stream = io.BytesIO()\n        getvalue = stream.getvalue\n    dumper = Dumper(stream, default_style=default_style,\n            default_flow_style=default_flow_style,\n            canonical=canonical, indent=indent, width=width,\n            allow_unicode=allow_unicode, line_break=line_break,\n            encoding=encoding, version=version, tags=tags,\n            explicit_start=explicit_start, explicit_end=explicit_end)\n    try:\n        dumper.open()\n        for data in documents:\n            dumper.represent(data)\n        dumper.close()\n    finally:\n        dumper.dispose()\n    if getvalue:\n        return getvalue()\n\ndef dump(data, stream=None, Dumper=Dumper, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=Dumper, **kwds)\n\ndef safe_dump_all(documents, stream=None, **kwds):\n    \"\"\"\n    Serialize a sequence of Python objects into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all(documents, stream, Dumper=SafeDumper, **kwds)\n\ndef safe_dump(data, stream=None, **kwds):\n    \"\"\"\n    Serialize a Python object into a YAML stream.\n    Produce only basic YAML tags.\n    If stream is None, return the produced string instead.\n    \"\"\"\n    return dump_all([data], stream, Dumper=SafeDumper, **kwds)\n\ndef add_implicit_resolver(tag, regexp, first=None,\n        Loader=Loader, Dumper=Dumper):\n    \"\"\"\n    Add an implicit scalar detector.\n    If an implicit scalar value matches the given regexp,\n    the corresponding tag is assigned to the scalar.\n    first is a sequence of possible initial characters or None.\n    \"\"\"\n    Loader.add_implicit_resolver(tag, regexp, first)\n    Dumper.add_implicit_resolver(tag, regexp, first)\n\ndef add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):\n    \"\"\"\n    Add a path based resolver for the given tag.\n    A path is a list of keys that forms a path\n    to a node in the representation tree.\n    Keys can be string values, integers, or None.\n    \"\"\"\n    Loader.add_path_resolver(tag, path, kind)\n    Dumper.add_path_resolver(tag, path, kind)\n\ndef add_constructor(tag, constructor, Loader=Loader):\n    \"\"\"\n    Add a constructor for the given tag.\n    Constructor is a function that accepts a Loader instance\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    Loader.add_constructor(tag, constructor)\n\ndef add_multi_constructor(tag_prefix, multi_constructor, Loader=Loader):\n    \"\"\"\n    Add a multi-constructor for the given tag prefix.\n    Multi-constructor is called for a node if its tag starts with tag_prefix.\n    Multi-constructor accepts a Loader instance, a tag suffix,\n    and a node object and produces the corresponding Python object.\n    \"\"\"\n    Loader.add_multi_constructor(tag_prefix, multi_constructor)\n\ndef add_representer(data_type, representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Representer is a function accepting a Dumper instance\n    and an instance of the given data type\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_representer(data_type, representer)\n\ndef add_multi_representer(data_type, multi_representer, Dumper=Dumper):\n    \"\"\"\n    Add a representer for the given type.\n    Multi-representer is a function accepting a Dumper instance\n    and an instance of the given data type or subtype\n    and producing the corresponding representation node.\n    \"\"\"\n    Dumper.add_multi_representer(data_type, multi_representer)\n\nclass YAMLObjectMetaclass(type):\n    \"\"\"\n    The metaclass for YAMLObject.\n    \"\"\"\n    def __init__(cls, name, bases, kwds):\n        super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds)\n        if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None:\n            cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml)\n            cls.yaml_dumper.add_representer(cls, cls.to_yaml)\n\nclass YAMLObject(metaclass=YAMLObjectMetaclass):\n    \"\"\"\n    An object that can dump itself to a YAML stream\n    and load itself from a YAML stream.\n    \"\"\"\n\n    __slots__ = ()  # no direct instantiation, so allow immutable subclasses\n\n    yaml_loader = Loader\n    yaml_dumper = Dumper\n\n    yaml_tag = None\n    yaml_flow_style = None\n\n    @classmethod\n    def from_yaml(cls, loader, node):\n        \"\"\"\n        Convert a representation node to a Python object.\n        \"\"\"\n        return loader.construct_yaml_object(node, cls)\n\n    @classmethod\n    def to_yaml(cls, dumper, data):\n        \"\"\"\n        Convert a Python object to a representation node.\n        \"\"\"\n        return dumper.represent_yaml_object(cls.yaml_tag, data, cls,\n                flow_style=cls.yaml_flow_style)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/composer.py",
    "content": "\n__all__ = ['Composer', 'ComposerError']\n\nfrom .error import MarkedYAMLError\nfrom .events import *\nfrom .nodes import *\n\nclass ComposerError(MarkedYAMLError):\n    pass\n\nclass Composer:\n\n    def __init__(self):\n        self.anchors = {}\n\n    def check_node(self):\n        # Drop the STREAM-START event.\n        if self.check_event(StreamStartEvent):\n            self.get_event()\n\n        # If there are more documents available?\n        return not self.check_event(StreamEndEvent)\n\n    def get_node(self):\n        # Get the root node of the next document.\n        if not self.check_event(StreamEndEvent):\n            return self.compose_document()\n\n    def get_single_node(self):\n        # Drop the STREAM-START event.\n        self.get_event()\n\n        # Compose a document if the stream is not empty.\n        document = None\n        if not self.check_event(StreamEndEvent):\n            document = self.compose_document()\n\n        # Ensure that the stream contains no more documents.\n        if not self.check_event(StreamEndEvent):\n            event = self.get_event()\n            raise ComposerError(\"expected a single document in the stream\",\n                    document.start_mark, \"but found another document\",\n                    event.start_mark)\n\n        # Drop the STREAM-END event.\n        self.get_event()\n\n        return document\n\n    def compose_document(self):\n        # Drop the DOCUMENT-START event.\n        self.get_event()\n\n        # Compose the root node.\n        node = self.compose_node(None, None)\n\n        # Drop the DOCUMENT-END event.\n        self.get_event()\n\n        self.anchors = {}\n        return node\n\n    def compose_node(self, parent, index):\n        if self.check_event(AliasEvent):\n            event = self.get_event()\n            anchor = event.anchor\n            if anchor not in self.anchors:\n                raise ComposerError(None, None, \"found undefined alias %r\"\n                        % anchor, event.start_mark)\n            return self.anchors[anchor]\n        event = self.peek_event()\n        anchor = event.anchor\n        if anchor is not None:\n            if anchor in self.anchors:\n                raise ComposerError(\"found duplicate anchor %r; first occurence\"\n                        % anchor, self.anchors[anchor].start_mark,\n                        \"second occurence\", event.start_mark)\n        self.descend_resolver(parent, index)\n        if self.check_event(ScalarEvent):\n            node = self.compose_scalar_node(anchor)\n        elif self.check_event(SequenceStartEvent):\n            node = self.compose_sequence_node(anchor)\n        elif self.check_event(MappingStartEvent):\n            node = self.compose_mapping_node(anchor)\n        self.ascend_resolver()\n        return node\n\n    def compose_scalar_node(self, anchor):\n        event = self.get_event()\n        tag = event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(ScalarNode, event.value, event.implicit)\n        node = ScalarNode(tag, event.value,\n                event.start_mark, event.end_mark, style=event.style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        return node\n\n    def compose_sequence_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(SequenceNode, None, start_event.implicit)\n        node = SequenceNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        index = 0\n        while not self.check_event(SequenceEndEvent):\n            node.value.append(self.compose_node(node, index))\n            index += 1\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n    def compose_mapping_node(self, anchor):\n        start_event = self.get_event()\n        tag = start_event.tag\n        if tag is None or tag == '!':\n            tag = self.resolve(MappingNode, None, start_event.implicit)\n        node = MappingNode(tag, [],\n                start_event.start_mark, None,\n                flow_style=start_event.flow_style)\n        if anchor is not None:\n            self.anchors[anchor] = node\n        while not self.check_event(MappingEndEvent):\n            #key_event = self.peek_event()\n            item_key = self.compose_node(node, None)\n            #if item_key in node.value:\n            #    raise ComposerError(\"while composing a mapping\", start_event.start_mark,\n            #            \"found duplicate key\", key_event.start_mark)\n            item_value = self.compose_node(node, item_key)\n            #node.value[item_key] = item_value\n            node.value.append((item_key, item_value))\n        end_event = self.get_event()\n        node.end_mark = end_event.end_mark\n        return node\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/constructor.py",
    "content": "\n__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',\n    'ConstructorError']\n\nfrom .error import *\nfrom .nodes import *\n\nimport collections, datetime, base64, binascii, re, sys, types\n\nclass ConstructorError(MarkedYAMLError):\n    pass\n\nclass BaseConstructor:\n\n    yaml_constructors = {}\n    yaml_multi_constructors = {}\n\n    def __init__(self):\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.state_generators = []\n        self.deep_construct = False\n\n    def check_data(self):\n        # If there are more documents available?\n        return self.check_node()\n\n    def get_data(self):\n        # Construct and return the next document.\n        if self.check_node():\n            return self.construct_document(self.get_node())\n\n    def get_single_data(self):\n        # Ensure that the stream contains a single document and construct it.\n        node = self.get_single_node()\n        if node is not None:\n            return self.construct_document(node)\n        return None\n\n    def construct_document(self, node):\n        data = self.construct_object(node)\n        while self.state_generators:\n            state_generators = self.state_generators\n            self.state_generators = []\n            for generator in state_generators:\n                for dummy in generator:\n                    pass\n        self.constructed_objects = {}\n        self.recursive_objects = {}\n        self.deep_construct = False\n        return data\n\n    def construct_object(self, node, deep=False):\n        if node in self.constructed_objects:\n            return self.constructed_objects[node]\n        if deep:\n            old_deep = self.deep_construct\n            self.deep_construct = True\n        if node in self.recursive_objects:\n            raise ConstructorError(None, None,\n                    \"found unconstructable recursive node\", node.start_mark)\n        self.recursive_objects[node] = None\n        constructor = None\n        tag_suffix = None\n        if node.tag in self.yaml_constructors:\n            constructor = self.yaml_constructors[node.tag]\n        else:\n            for tag_prefix in self.yaml_multi_constructors:\n                if node.tag.startswith(tag_prefix):\n                    tag_suffix = node.tag[len(tag_prefix):]\n                    constructor = self.yaml_multi_constructors[tag_prefix]\n                    break\n            else:\n                if None in self.yaml_multi_constructors:\n                    tag_suffix = node.tag\n                    constructor = self.yaml_multi_constructors[None]\n                elif None in self.yaml_constructors:\n                    constructor = self.yaml_constructors[None]\n                elif isinstance(node, ScalarNode):\n                    constructor = self.__class__.construct_scalar\n                elif isinstance(node, SequenceNode):\n                    constructor = self.__class__.construct_sequence\n                elif isinstance(node, MappingNode):\n                    constructor = self.__class__.construct_mapping\n        if tag_suffix is None:\n            data = constructor(self, node)\n        else:\n            data = constructor(self, tag_suffix, node)\n        if isinstance(data, types.GeneratorType):\n            generator = data\n            data = next(generator)\n            if self.deep_construct:\n                for dummy in generator:\n                    pass\n            else:\n                self.state_generators.append(generator)\n        self.constructed_objects[node] = data\n        del self.recursive_objects[node]\n        if deep:\n            self.deep_construct = old_deep\n        return data\n\n    def construct_scalar(self, node):\n        if not isinstance(node, ScalarNode):\n            raise ConstructorError(None, None,\n                    \"expected a scalar node, but found %s\" % node.id,\n                    node.start_mark)\n        return node.value\n\n    def construct_sequence(self, node, deep=False):\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(None, None,\n                    \"expected a sequence node, but found %s\" % node.id,\n                    node.start_mark)\n        return [self.construct_object(child, deep=deep)\n                for child in node.value]\n\n    def construct_mapping(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        mapping = {}\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            if not isinstance(key, collections.Hashable):\n                raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                        \"found unhashable key\", key_node.start_mark)\n            value = self.construct_object(value_node, deep=deep)\n            mapping[key] = value\n        return mapping\n\n    def construct_pairs(self, node, deep=False):\n        if not isinstance(node, MappingNode):\n            raise ConstructorError(None, None,\n                    \"expected a mapping node, but found %s\" % node.id,\n                    node.start_mark)\n        pairs = []\n        for key_node, value_node in node.value:\n            key = self.construct_object(key_node, deep=deep)\n            value = self.construct_object(value_node, deep=deep)\n            pairs.append((key, value))\n        return pairs\n\n    @classmethod\n    def add_constructor(cls, tag, constructor):\n        if not 'yaml_constructors' in cls.__dict__:\n            cls.yaml_constructors = cls.yaml_constructors.copy()\n        cls.yaml_constructors[tag] = constructor\n\n    @classmethod\n    def add_multi_constructor(cls, tag_prefix, multi_constructor):\n        if not 'yaml_multi_constructors' in cls.__dict__:\n            cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy()\n        cls.yaml_multi_constructors[tag_prefix] = multi_constructor\n\nclass SafeConstructor(BaseConstructor):\n\n    def construct_scalar(self, node):\n        if isinstance(node, MappingNode):\n            for key_node, value_node in node.value:\n                if key_node.tag == 'tag:yaml.org,2002:value':\n                    return self.construct_scalar(value_node)\n        return super().construct_scalar(node)\n\n    def flatten_mapping(self, node):\n        merge = []\n        index = 0\n        while index < len(node.value):\n            key_node, value_node = node.value[index]\n            if key_node.tag == 'tag:yaml.org,2002:merge':\n                del node.value[index]\n                if isinstance(value_node, MappingNode):\n                    self.flatten_mapping(value_node)\n                    merge.extend(value_node.value)\n                elif isinstance(value_node, SequenceNode):\n                    submerge = []\n                    for subnode in value_node.value:\n                        if not isinstance(subnode, MappingNode):\n                            raise ConstructorError(\"while constructing a mapping\",\n                                    node.start_mark,\n                                    \"expected a mapping for merging, but found %s\"\n                                    % subnode.id, subnode.start_mark)\n                        self.flatten_mapping(subnode)\n                        submerge.append(subnode.value)\n                    submerge.reverse()\n                    for value in submerge:\n                        merge.extend(value)\n                else:\n                    raise ConstructorError(\"while constructing a mapping\", node.start_mark,\n                            \"expected a mapping or list of mappings for merging, but found %s\"\n                            % value_node.id, value_node.start_mark)\n            elif key_node.tag == 'tag:yaml.org,2002:value':\n                key_node.tag = 'tag:yaml.org,2002:str'\n                index += 1\n            else:\n                index += 1\n        if merge:\n            node.value = merge + node.value\n\n    def construct_mapping(self, node, deep=False):\n        if isinstance(node, MappingNode):\n            self.flatten_mapping(node)\n        return super().construct_mapping(node, deep=deep)\n\n    def construct_yaml_null(self, node):\n        self.construct_scalar(node)\n        return None\n\n    bool_values = {\n        'yes':      True,\n        'no':       False,\n        'true':     True,\n        'false':    False,\n        'on':       True,\n        'off':      False,\n    }\n\n    def construct_yaml_bool(self, node):\n        value = self.construct_scalar(node)\n        return self.bool_values[value.lower()]\n\n    def construct_yaml_int(self, node):\n        value = self.construct_scalar(node)\n        value = value.replace('_', '')\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '0':\n            return 0\n        elif value.startswith('0b'):\n            return sign*int(value[2:], 2)\n        elif value.startswith('0x'):\n            return sign*int(value[2:], 16)\n        elif value[0] == '0':\n            return sign*int(value, 8)\n        elif ':' in value:\n            digits = [int(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*int(value)\n\n    inf_value = 1e300\n    while inf_value != inf_value*inf_value:\n        inf_value *= inf_value\n    nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).\n\n    def construct_yaml_float(self, node):\n        value = self.construct_scalar(node)\n        value = value.replace('_', '').lower()\n        sign = +1\n        if value[0] == '-':\n            sign = -1\n        if value[0] in '+-':\n            value = value[1:]\n        if value == '.inf':\n            return sign*self.inf_value\n        elif value == '.nan':\n            return self.nan_value\n        elif ':' in value:\n            digits = [float(part) for part in value.split(':')]\n            digits.reverse()\n            base = 1\n            value = 0.0\n            for digit in digits:\n                value += digit*base\n                base *= 60\n            return sign*value\n        else:\n            return sign*float(value)\n\n    def construct_yaml_binary(self, node):\n        try:\n            value = self.construct_scalar(node).encode('ascii')\n        except UnicodeEncodeError as exc:\n            raise ConstructorError(None, None,\n                    \"failed to convert base64 data into ascii: %s\" % exc,\n                    node.start_mark)\n        try:\n            if hasattr(base64, 'decodebytes'):\n                return base64.decodebytes(value)\n            else:\n                return base64.decodestring(value)\n        except binascii.Error as exc:\n            raise ConstructorError(None, None,\n                    \"failed to decode base64 data: %s\" % exc, node.start_mark)\n\n    timestamp_regexp = re.compile(\n            r'''^(?P<year>[0-9][0-9][0-9][0-9])\n                -(?P<month>[0-9][0-9]?)\n                -(?P<day>[0-9][0-9]?)\n                (?:(?:[Tt]|[ \\t]+)\n                (?P<hour>[0-9][0-9]?)\n                :(?P<minute>[0-9][0-9])\n                :(?P<second>[0-9][0-9])\n                (?:\\.(?P<fraction>[0-9]*))?\n                (?:[ \\t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)\n                (?::(?P<tz_minute>[0-9][0-9]))?))?)?$''', re.X)\n\n    def construct_yaml_timestamp(self, node):\n        value = self.construct_scalar(node)\n        match = self.timestamp_regexp.match(node.value)\n        values = match.groupdict()\n        year = int(values['year'])\n        month = int(values['month'])\n        day = int(values['day'])\n        if not values['hour']:\n            return datetime.date(year, month, day)\n        hour = int(values['hour'])\n        minute = int(values['minute'])\n        second = int(values['second'])\n        fraction = 0\n        if values['fraction']:\n            fraction = values['fraction'][:6]\n            while len(fraction) < 6:\n                fraction += '0'\n            fraction = int(fraction)\n        delta = None\n        if values['tz_sign']:\n            tz_hour = int(values['tz_hour'])\n            tz_minute = int(values['tz_minute'] or 0)\n            delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute)\n            if values['tz_sign'] == '-':\n                delta = -delta\n        data = datetime.datetime(year, month, day, hour, minute, second, fraction)\n        if delta:\n            data -= delta\n        return data\n\n    def construct_yaml_omap(self, node):\n        # Note: we do not check for duplicate keys, because it's too\n        # CPU-expensive.\n        omap = []\n        yield omap\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing an ordered map\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            omap.append((key, value))\n\n    def construct_yaml_pairs(self, node):\n        # Note: the same code as `construct_yaml_omap`.\n        pairs = []\n        yield pairs\n        if not isinstance(node, SequenceNode):\n            raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                    \"expected a sequence, but found %s\" % node.id, node.start_mark)\n        for subnode in node.value:\n            if not isinstance(subnode, MappingNode):\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a mapping of length 1, but found %s\" % subnode.id,\n                        subnode.start_mark)\n            if len(subnode.value) != 1:\n                raise ConstructorError(\"while constructing pairs\", node.start_mark,\n                        \"expected a single mapping item, but found %d items\" % len(subnode.value),\n                        subnode.start_mark)\n            key_node, value_node = subnode.value[0]\n            key = self.construct_object(key_node)\n            value = self.construct_object(value_node)\n            pairs.append((key, value))\n\n    def construct_yaml_set(self, node):\n        data = set()\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_str(self, node):\n        return self.construct_scalar(node)\n\n    def construct_yaml_seq(self, node):\n        data = []\n        yield data\n        data.extend(self.construct_sequence(node))\n\n    def construct_yaml_map(self, node):\n        data = {}\n        yield data\n        value = self.construct_mapping(node)\n        data.update(value)\n\n    def construct_yaml_object(self, node, cls):\n        data = cls.__new__(cls)\n        yield data\n        if hasattr(data, '__setstate__'):\n            state = self.construct_mapping(node, deep=True)\n            data.__setstate__(state)\n        else:\n            state = self.construct_mapping(node)\n            data.__dict__.update(state)\n\n    def construct_undefined(self, node):\n        raise ConstructorError(None, None,\n                \"could not determine a constructor for the tag %r\" % node.tag,\n                node.start_mark)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:null',\n        SafeConstructor.construct_yaml_null)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:bool',\n        SafeConstructor.construct_yaml_bool)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:int',\n        SafeConstructor.construct_yaml_int)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:float',\n        SafeConstructor.construct_yaml_float)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:binary',\n        SafeConstructor.construct_yaml_binary)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:timestamp',\n        SafeConstructor.construct_yaml_timestamp)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:omap',\n        SafeConstructor.construct_yaml_omap)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:pairs',\n        SafeConstructor.construct_yaml_pairs)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:set',\n        SafeConstructor.construct_yaml_set)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:str',\n        SafeConstructor.construct_yaml_str)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:seq',\n        SafeConstructor.construct_yaml_seq)\n\nSafeConstructor.add_constructor(\n        'tag:yaml.org,2002:map',\n        SafeConstructor.construct_yaml_map)\n\nSafeConstructor.add_constructor(None,\n        SafeConstructor.construct_undefined)\n\nclass Constructor(SafeConstructor):\n\n    def construct_python_str(self, node):\n        return self.construct_scalar(node)\n\n    def construct_python_unicode(self, node):\n        return self.construct_scalar(node)\n\n    def construct_python_bytes(self, node):\n        try:\n            value = self.construct_scalar(node).encode('ascii')\n        except UnicodeEncodeError as exc:\n            raise ConstructorError(None, None,\n                    \"failed to convert base64 data into ascii: %s\" % exc,\n                    node.start_mark)\n        try:\n            if hasattr(base64, 'decodebytes'):\n                return base64.decodebytes(value)\n            else:\n                return base64.decodestring(value)\n        except binascii.Error as exc:\n            raise ConstructorError(None, None,\n                    \"failed to decode base64 data: %s\" % exc, node.start_mark)\n\n    def construct_python_long(self, node):\n        return self.construct_yaml_int(node)\n\n    def construct_python_complex(self, node):\n       return complex(self.construct_scalar(node))\n\n    def construct_python_tuple(self, node):\n        return tuple(self.construct_sequence(node))\n\n    def find_python_module(self, name, mark):\n        if not name:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        try:\n            __import__(name)\n        except ImportError as exc:\n            raise ConstructorError(\"while constructing a Python module\", mark,\n                    \"cannot find module %r (%s)\" % (name, exc), mark)\n        return sys.modules[name]\n\n    def find_python_name(self, name, mark):\n        if not name:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"expected non-empty name appended to the tag\", mark)\n        if '.' in name:\n            module_name, object_name = name.rsplit('.', 1)\n        else:\n            module_name = 'builtins'\n            object_name = name\n        try:\n            __import__(module_name)\n        except ImportError as exc:\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"cannot find module %r (%s)\" % (module_name, exc), mark)\n        module = sys.modules[module_name]\n        if not hasattr(module, object_name):\n            raise ConstructorError(\"while constructing a Python object\", mark,\n                    \"cannot find %r in the module %r\"\n                    % (object_name, module.__name__), mark)\n        return getattr(module, object_name)\n\n    def construct_python_name(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python name\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value, node.start_mark)\n        return self.find_python_name(suffix, node.start_mark)\n\n    def construct_python_module(self, suffix, node):\n        value = self.construct_scalar(node)\n        if value:\n            raise ConstructorError(\"while constructing a Python module\", node.start_mark,\n                    \"expected the empty value, but found %r\" % value, node.start_mark)\n        return self.find_python_module(suffix, node.start_mark)\n\n    def make_python_instance(self, suffix, node,\n            args=None, kwds=None, newobj=False):\n        if not args:\n            args = []\n        if not kwds:\n            kwds = {}\n        cls = self.find_python_name(suffix, node.start_mark)\n        if newobj and isinstance(cls, type):\n            return cls.__new__(cls, *args, **kwds)\n        else:\n            return cls(*args, **kwds)\n\n    def set_python_instance_state(self, instance, state):\n        if hasattr(instance, '__setstate__'):\n            instance.__setstate__(state)\n        else:\n            slotstate = {}\n            if isinstance(state, tuple) and len(state) == 2:\n                state, slotstate = state\n            if hasattr(instance, '__dict__'):\n                instance.__dict__.update(state)\n            elif state:\n                slotstate.update(state)\n            for key, value in slotstate.items():\n                setattr(object, key, value)\n\n    def construct_python_object(self, suffix, node):\n        # Format:\n        #   !!python/object:module.name { ... state ... }\n        instance = self.make_python_instance(suffix, node, newobj=True)\n        yield instance\n        deep = hasattr(instance, '__setstate__')\n        state = self.construct_mapping(node, deep=deep)\n        self.set_python_instance_state(instance, state)\n\n    def construct_python_object_apply(self, suffix, node, newobj=False):\n        # Format:\n        #   !!python/object/apply       # (or !!python/object/new)\n        #   args: [ ... arguments ... ]\n        #   kwds: { ... keywords ... }\n        #   state: ... state ...\n        #   listitems: [ ... listitems ... ]\n        #   dictitems: { ... dictitems ... }\n        # or short format:\n        #   !!python/object/apply [ ... arguments ... ]\n        # The difference between !!python/object/apply and !!python/object/new\n        # is how an object is created, check make_python_instance for details.\n        if isinstance(node, SequenceNode):\n            args = self.construct_sequence(node, deep=True)\n            kwds = {}\n            state = {}\n            listitems = []\n            dictitems = {}\n        else:\n            value = self.construct_mapping(node, deep=True)\n            args = value.get('args', [])\n            kwds = value.get('kwds', {})\n            state = value.get('state', {})\n            listitems = value.get('listitems', [])\n            dictitems = value.get('dictitems', {})\n        instance = self.make_python_instance(suffix, node, args, kwds, newobj)\n        if state:\n            self.set_python_instance_state(instance, state)\n        if listitems:\n            instance.extend(listitems)\n        if dictitems:\n            for key in dictitems:\n                instance[key] = dictitems[key]\n        return instance\n\n    def construct_python_object_new(self, suffix, node):\n        return self.construct_python_object_apply(suffix, node, newobj=True)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/none',\n    Constructor.construct_yaml_null)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/bool',\n    Constructor.construct_yaml_bool)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/str',\n    Constructor.construct_python_str)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/unicode',\n    Constructor.construct_python_unicode)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/bytes',\n    Constructor.construct_python_bytes)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/int',\n    Constructor.construct_yaml_int)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/long',\n    Constructor.construct_python_long)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/float',\n    Constructor.construct_yaml_float)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/complex',\n    Constructor.construct_python_complex)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/list',\n    Constructor.construct_yaml_seq)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/tuple',\n    Constructor.construct_python_tuple)\n\nConstructor.add_constructor(\n    'tag:yaml.org,2002:python/dict',\n    Constructor.construct_yaml_map)\n\nConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/name:',\n    Constructor.construct_python_name)\n\nConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/module:',\n    Constructor.construct_python_module)\n\nConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object:',\n    Constructor.construct_python_object)\n\nConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object/apply:',\n    Constructor.construct_python_object_apply)\n\nConstructor.add_multi_constructor(\n    'tag:yaml.org,2002:python/object/new:',\n    Constructor.construct_python_object_new)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/cyaml.py",
    "content": "\n__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',\n        'CBaseDumper', 'CSafeDumper', 'CDumper']\n\nfrom _yaml import CParser, CEmitter\n\nfrom .constructor import *\n\nfrom .serializer import *\nfrom .representer import *\n\nfrom .resolver import *\n\nclass CBaseLoader(CParser, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass CSafeLoader(CParser, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CLoader(CParser, Constructor, Resolver):\n\n    def __init__(self, stream):\n        CParser.__init__(self, stream)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\nclass CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass CSafeDumper(CEmitter, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass CDumper(CEmitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        CEmitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width, encoding=encoding,\n                allow_unicode=allow_unicode, line_break=line_break,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/dumper.py",
    "content": "\n__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']\n\nfrom .emitter import *\nfrom .serializer import *\nfrom .representer import *\nfrom .resolver import *\n\nclass BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        SafeRepresenter.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\nclass Dumper(Emitter, Serializer, Representer, Resolver):\n\n    def __init__(self, stream,\n            default_style=None, default_flow_style=None,\n            canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None,\n            encoding=None, explicit_start=None, explicit_end=None,\n            version=None, tags=None):\n        Emitter.__init__(self, stream, canonical=canonical,\n                indent=indent, width=width,\n                allow_unicode=allow_unicode, line_break=line_break)\n        Serializer.__init__(self, encoding=encoding,\n                explicit_start=explicit_start, explicit_end=explicit_end,\n                version=version, tags=tags)\n        Representer.__init__(self, default_style=default_style,\n                default_flow_style=default_flow_style)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/emitter.py",
    "content": "\n# Emitter expects events obeying the following grammar:\n# stream ::= STREAM-START document* STREAM-END\n# document ::= DOCUMENT-START node DOCUMENT-END\n# node ::= SCALAR | sequence | mapping\n# sequence ::= SEQUENCE-START node* SEQUENCE-END\n# mapping ::= MAPPING-START (node node)* MAPPING-END\n\n__all__ = ['Emitter', 'EmitterError']\n\nfrom .error import YAMLError\nfrom .events import *\n\nclass EmitterError(YAMLError):\n    pass\n\nclass ScalarAnalysis:\n    def __init__(self, scalar, empty, multiline,\n            allow_flow_plain, allow_block_plain,\n            allow_single_quoted, allow_double_quoted,\n            allow_block):\n        self.scalar = scalar\n        self.empty = empty\n        self.multiline = multiline\n        self.allow_flow_plain = allow_flow_plain\n        self.allow_block_plain = allow_block_plain\n        self.allow_single_quoted = allow_single_quoted\n        self.allow_double_quoted = allow_double_quoted\n        self.allow_block = allow_block\n\nclass Emitter:\n\n    DEFAULT_TAG_PREFIXES = {\n        '!' : '!',\n        'tag:yaml.org,2002:' : '!!',\n    }\n\n    def __init__(self, stream, canonical=None, indent=None, width=None,\n            allow_unicode=None, line_break=None):\n\n        # The stream should have the methods `write` and possibly `flush`.\n        self.stream = stream\n\n        # Encoding can be overriden by STREAM-START.\n        self.encoding = None\n\n        # Emitter is a state machine with a stack of states to handle nested\n        # structures.\n        self.states = []\n        self.state = self.expect_stream_start\n\n        # Current event and the event queue.\n        self.events = []\n        self.event = None\n\n        # The current indentation level and the stack of previous indents.\n        self.indents = []\n        self.indent = None\n\n        # Flow level.\n        self.flow_level = 0\n\n        # Contexts.\n        self.root_context = False\n        self.sequence_context = False\n        self.mapping_context = False\n        self.simple_key_context = False\n\n        # Characteristics of the last emitted character:\n        #  - current position.\n        #  - is it a whitespace?\n        #  - is it an indention character\n        #    (indentation space, '-', '?', or ':')?\n        self.line = 0\n        self.column = 0\n        self.whitespace = True\n        self.indention = True\n\n        # Whether the document requires an explicit document indicator\n        self.open_ended = False\n\n        # Formatting details.\n        self.canonical = canonical\n        self.allow_unicode = allow_unicode\n        self.best_indent = 2\n        if indent and 1 < indent < 10:\n            self.best_indent = indent\n        self.best_width = 80\n        if width and width > self.best_indent*2:\n            self.best_width = width\n        self.best_line_break = '\\n'\n        if line_break in ['\\r', '\\n', '\\r\\n']:\n            self.best_line_break = line_break\n\n        # Tag prefixes.\n        self.tag_prefixes = None\n\n        # Prepared anchor and tag.\n        self.prepared_anchor = None\n        self.prepared_tag = None\n\n        # Scalar analysis and style.\n        self.analysis = None\n        self.style = None\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def emit(self, event):\n        self.events.append(event)\n        while not self.need_more_events():\n            self.event = self.events.pop(0)\n            self.state()\n            self.event = None\n\n    # In some cases, we wait for a few next events before emitting.\n\n    def need_more_events(self):\n        if not self.events:\n            return True\n        event = self.events[0]\n        if isinstance(event, DocumentStartEvent):\n            return self.need_events(1)\n        elif isinstance(event, SequenceStartEvent):\n            return self.need_events(2)\n        elif isinstance(event, MappingStartEvent):\n            return self.need_events(3)\n        else:\n            return False\n\n    def need_events(self, count):\n        level = 0\n        for event in self.events[1:]:\n            if isinstance(event, (DocumentStartEvent, CollectionStartEvent)):\n                level += 1\n            elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)):\n                level -= 1\n            elif isinstance(event, StreamEndEvent):\n                level = -1\n            if level < 0:\n                return False\n        return (len(self.events) < count+1)\n\n    def increase_indent(self, flow=False, indentless=False):\n        self.indents.append(self.indent)\n        if self.indent is None:\n            if flow:\n                self.indent = self.best_indent\n            else:\n                self.indent = 0\n        elif not indentless:\n            self.indent += self.best_indent\n\n    # States.\n\n    # Stream handlers.\n\n    def expect_stream_start(self):\n        if isinstance(self.event, StreamStartEvent):\n            if self.event.encoding and not hasattr(self.stream, 'encoding'):\n                self.encoding = self.event.encoding\n            self.write_stream_start()\n            self.state = self.expect_first_document_start\n        else:\n            raise EmitterError(\"expected StreamStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_nothing(self):\n        raise EmitterError(\"expected nothing, but got %s\" % self.event)\n\n    # Document handlers.\n\n    def expect_first_document_start(self):\n        return self.expect_document_start(first=True)\n\n    def expect_document_start(self, first=False):\n        if isinstance(self.event, DocumentStartEvent):\n            if (self.event.version or self.event.tags) and self.open_ended:\n                self.write_indicator('...', True)\n                self.write_indent()\n            if self.event.version:\n                version_text = self.prepare_version(self.event.version)\n                self.write_version_directive(version_text)\n            self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy()\n            if self.event.tags:\n                handles = sorted(self.event.tags.keys())\n                for handle in handles:\n                    prefix = self.event.tags[handle]\n                    self.tag_prefixes[prefix] = handle\n                    handle_text = self.prepare_tag_handle(handle)\n                    prefix_text = self.prepare_tag_prefix(prefix)\n                    self.write_tag_directive(handle_text, prefix_text)\n            implicit = (first and not self.event.explicit and not self.canonical\n                    and not self.event.version and not self.event.tags\n                    and not self.check_empty_document())\n            if not implicit:\n                self.write_indent()\n                self.write_indicator('---', True)\n                if self.canonical:\n                    self.write_indent()\n            self.state = self.expect_document_root\n        elif isinstance(self.event, StreamEndEvent):\n            if self.open_ended:\n                self.write_indicator('...', True)\n                self.write_indent()\n            self.write_stream_end()\n            self.state = self.expect_nothing\n        else:\n            raise EmitterError(\"expected DocumentStartEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_end(self):\n        if isinstance(self.event, DocumentEndEvent):\n            self.write_indent()\n            if self.event.explicit:\n                self.write_indicator('...', True)\n                self.write_indent()\n            self.flush_stream()\n            self.state = self.expect_document_start\n        else:\n            raise EmitterError(\"expected DocumentEndEvent, but got %s\"\n                    % self.event)\n\n    def expect_document_root(self):\n        self.states.append(self.expect_document_end)\n        self.expect_node(root=True)\n\n    # Node handlers.\n\n    def expect_node(self, root=False, sequence=False, mapping=False,\n            simple_key=False):\n        self.root_context = root\n        self.sequence_context = sequence\n        self.mapping_context = mapping\n        self.simple_key_context = simple_key\n        if isinstance(self.event, AliasEvent):\n            self.expect_alias()\n        elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)):\n            self.process_anchor('&')\n            self.process_tag()\n            if isinstance(self.event, ScalarEvent):\n                self.expect_scalar()\n            elif isinstance(self.event, SequenceStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_sequence():\n                    self.expect_flow_sequence()\n                else:\n                    self.expect_block_sequence()\n            elif isinstance(self.event, MappingStartEvent):\n                if self.flow_level or self.canonical or self.event.flow_style   \\\n                        or self.check_empty_mapping():\n                    self.expect_flow_mapping()\n                else:\n                    self.expect_block_mapping()\n        else:\n            raise EmitterError(\"expected NodeEvent, but got %s\" % self.event)\n\n    def expect_alias(self):\n        if self.event.anchor is None:\n            raise EmitterError(\"anchor is not specified for alias\")\n        self.process_anchor('*')\n        self.state = self.states.pop()\n\n    def expect_scalar(self):\n        self.increase_indent(flow=True)\n        self.process_scalar()\n        self.indent = self.indents.pop()\n        self.state = self.states.pop()\n\n    # Flow sequence handlers.\n\n    def expect_flow_sequence(self):\n        self.write_indicator('[', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_sequence_item\n\n    def expect_first_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator(']', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    def expect_flow_sequence_item(self):\n        if isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(',', False)\n                self.write_indent()\n            self.write_indicator(']', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            self.states.append(self.expect_flow_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Flow mapping handlers.\n\n    def expect_flow_mapping(self):\n        self.write_indicator('{', True, whitespace=True)\n        self.flow_level += 1\n        self.increase_indent(flow=True)\n        self.state = self.expect_first_flow_mapping_key\n\n    def expect_first_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            self.write_indicator('}', False)\n            self.state = self.states.pop()\n        else:\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_key(self):\n        if isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.flow_level -= 1\n            if self.canonical:\n                self.write_indicator(',', False)\n                self.write_indent()\n            self.write_indicator('}', False)\n            self.state = self.states.pop()\n        else:\n            self.write_indicator(',', False)\n            if self.canonical or self.column > self.best_width:\n                self.write_indent()\n            if not self.canonical and self.check_simple_key():\n                self.states.append(self.expect_flow_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True)\n                self.states.append(self.expect_flow_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_flow_mapping_simple_value(self):\n        self.write_indicator(':', False)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_flow_mapping_value(self):\n        if self.canonical or self.column > self.best_width:\n            self.write_indent()\n        self.write_indicator(':', True)\n        self.states.append(self.expect_flow_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Block sequence handlers.\n\n    def expect_block_sequence(self):\n        indentless = (self.mapping_context and not self.indention)\n        self.increase_indent(flow=False, indentless=indentless)\n        self.state = self.expect_first_block_sequence_item\n\n    def expect_first_block_sequence_item(self):\n        return self.expect_block_sequence_item(first=True)\n\n    def expect_block_sequence_item(self, first=False):\n        if not first and isinstance(self.event, SequenceEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            self.write_indicator('-', True, indention=True)\n            self.states.append(self.expect_block_sequence_item)\n            self.expect_node(sequence=True)\n\n    # Block mapping handlers.\n\n    def expect_block_mapping(self):\n        self.increase_indent(flow=False)\n        self.state = self.expect_first_block_mapping_key\n\n    def expect_first_block_mapping_key(self):\n        return self.expect_block_mapping_key(first=True)\n\n    def expect_block_mapping_key(self, first=False):\n        if not first and isinstance(self.event, MappingEndEvent):\n            self.indent = self.indents.pop()\n            self.state = self.states.pop()\n        else:\n            self.write_indent()\n            if self.check_simple_key():\n                self.states.append(self.expect_block_mapping_simple_value)\n                self.expect_node(mapping=True, simple_key=True)\n            else:\n                self.write_indicator('?', True, indention=True)\n                self.states.append(self.expect_block_mapping_value)\n                self.expect_node(mapping=True)\n\n    def expect_block_mapping_simple_value(self):\n        self.write_indicator(':', False)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    def expect_block_mapping_value(self):\n        self.write_indent()\n        self.write_indicator(':', True, indention=True)\n        self.states.append(self.expect_block_mapping_key)\n        self.expect_node(mapping=True)\n\n    # Checkers.\n\n    def check_empty_sequence(self):\n        return (isinstance(self.event, SequenceStartEvent) and self.events\n                and isinstance(self.events[0], SequenceEndEvent))\n\n    def check_empty_mapping(self):\n        return (isinstance(self.event, MappingStartEvent) and self.events\n                and isinstance(self.events[0], MappingEndEvent))\n\n    def check_empty_document(self):\n        if not isinstance(self.event, DocumentStartEvent) or not self.events:\n            return False\n        event = self.events[0]\n        return (isinstance(event, ScalarEvent) and event.anchor is None\n                and event.tag is None and event.implicit and event.value == '')\n\n    def check_simple_key(self):\n        length = 0\n        if isinstance(self.event, NodeEvent) and self.event.anchor is not None:\n            if self.prepared_anchor is None:\n                self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n            length += len(self.prepared_anchor)\n        if isinstance(self.event, (ScalarEvent, CollectionStartEvent))  \\\n                and self.event.tag is not None:\n            if self.prepared_tag is None:\n                self.prepared_tag = self.prepare_tag(self.event.tag)\n            length += len(self.prepared_tag)\n        if isinstance(self.event, ScalarEvent):\n            if self.analysis is None:\n                self.analysis = self.analyze_scalar(self.event.value)\n            length += len(self.analysis.scalar)\n        return (length < 128 and (isinstance(self.event, AliasEvent)\n            or (isinstance(self.event, ScalarEvent)\n                    and not self.analysis.empty and not self.analysis.multiline)\n            or self.check_empty_sequence() or self.check_empty_mapping()))\n\n    # Anchor, Tag, and Scalar processors.\n\n    def process_anchor(self, indicator):\n        if self.event.anchor is None:\n            self.prepared_anchor = None\n            return\n        if self.prepared_anchor is None:\n            self.prepared_anchor = self.prepare_anchor(self.event.anchor)\n        if self.prepared_anchor:\n            self.write_indicator(indicator+self.prepared_anchor, True)\n        self.prepared_anchor = None\n\n    def process_tag(self):\n        tag = self.event.tag\n        if isinstance(self.event, ScalarEvent):\n            if self.style is None:\n                self.style = self.choose_scalar_style()\n            if ((not self.canonical or tag is None) and\n                ((self.style == '' and self.event.implicit[0])\n                        or (self.style != '' and self.event.implicit[1]))):\n                self.prepared_tag = None\n                return\n            if self.event.implicit[0] and tag is None:\n                tag = '!'\n                self.prepared_tag = None\n        else:\n            if (not self.canonical or tag is None) and self.event.implicit:\n                self.prepared_tag = None\n                return\n        if tag is None:\n            raise EmitterError(\"tag is not specified\")\n        if self.prepared_tag is None:\n            self.prepared_tag = self.prepare_tag(tag)\n        if self.prepared_tag:\n            self.write_indicator(self.prepared_tag, True)\n        self.prepared_tag = None\n\n    def choose_scalar_style(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.event.style == '\"' or self.canonical:\n            return '\"'\n        if not self.event.style and self.event.implicit[0]:\n            if (not (self.simple_key_context and\n                    (self.analysis.empty or self.analysis.multiline))\n                and (self.flow_level and self.analysis.allow_flow_plain\n                    or (not self.flow_level and self.analysis.allow_block_plain))):\n                return ''\n        if self.event.style and self.event.style in '|>':\n            if (not self.flow_level and not self.simple_key_context\n                    and self.analysis.allow_block):\n                return self.event.style\n        if not self.event.style or self.event.style == '\\'':\n            if (self.analysis.allow_single_quoted and\n                    not (self.simple_key_context and self.analysis.multiline)):\n                return '\\''\n        return '\"'\n\n    def process_scalar(self):\n        if self.analysis is None:\n            self.analysis = self.analyze_scalar(self.event.value)\n        if self.style is None:\n            self.style = self.choose_scalar_style()\n        split = (not self.simple_key_context)\n        #if self.analysis.multiline and split    \\\n        #        and (not self.style or self.style in '\\'\\\"'):\n        #    self.write_indent()\n        if self.style == '\"':\n            self.write_double_quoted(self.analysis.scalar, split)\n        elif self.style == '\\'':\n            self.write_single_quoted(self.analysis.scalar, split)\n        elif self.style == '>':\n            self.write_folded(self.analysis.scalar)\n        elif self.style == '|':\n            self.write_literal(self.analysis.scalar)\n        else:\n            self.write_plain(self.analysis.scalar, split)\n        self.analysis = None\n        self.style = None\n\n    # Analyzers.\n\n    def prepare_version(self, version):\n        major, minor = version\n        if major != 1:\n            raise EmitterError(\"unsupported YAML version: %d.%d\" % (major, minor))\n        return '%d.%d' % (major, minor)\n\n    def prepare_tag_handle(self, handle):\n        if not handle:\n            raise EmitterError(\"tag handle must not be empty\")\n        if handle[0] != '!' or handle[-1] != '!':\n            raise EmitterError(\"tag handle must start and end with '!': %r\" % handle)\n        for ch in handle[1:-1]:\n            if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'    \\\n                    or ch in '-_'):\n                raise EmitterError(\"invalid character %r in the tag handle: %r\"\n                        % (ch, handle))\n        return handle\n\n    def prepare_tag_prefix(self, prefix):\n        if not prefix:\n            raise EmitterError(\"tag prefix must not be empty\")\n        chunks = []\n        start = end = 0\n        if prefix[0] == '!':\n            end = 1\n        while end < len(prefix):\n            ch = prefix[end]\n            if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \\\n                    or ch in '-;/?!:@&=+$,_.~*\\'()[]':\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(prefix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append('%%%02X' % ord(ch))\n        if start < end:\n            chunks.append(prefix[start:end])\n        return ''.join(chunks)\n\n    def prepare_tag(self, tag):\n        if not tag:\n            raise EmitterError(\"tag must not be empty\")\n        if tag == '!':\n            return tag\n        handle = None\n        suffix = tag\n        prefixes = sorted(self.tag_prefixes.keys())\n        for prefix in prefixes:\n            if tag.startswith(prefix)   \\\n                    and (prefix == '!' or len(prefix) < len(tag)):\n                handle = self.tag_prefixes[prefix]\n                suffix = tag[len(prefix):]\n        chunks = []\n        start = end = 0\n        while end < len(suffix):\n            ch = suffix[end]\n            if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \\\n                    or ch in '-;/?:@&=+$,_.~*\\'()[]'   \\\n                    or (ch == '!' and handle != '!'):\n                end += 1\n            else:\n                if start < end:\n                    chunks.append(suffix[start:end])\n                start = end = end+1\n                data = ch.encode('utf-8')\n                for ch in data:\n                    chunks.append('%%%02X' % ord(ch))\n        if start < end:\n            chunks.append(suffix[start:end])\n        suffix_text = ''.join(chunks)\n        if handle:\n            return '%s%s' % (handle, suffix_text)\n        else:\n            return '!<%s>' % suffix_text\n\n    def prepare_anchor(self, anchor):\n        if not anchor:\n            raise EmitterError(\"anchor must not be empty\")\n        for ch in anchor:\n            if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'    \\\n                    or ch in '-_'):\n                raise EmitterError(\"invalid character %r in the anchor: %r\"\n                        % (ch, anchor))\n        return anchor\n\n    def analyze_scalar(self, scalar):\n\n        # Empty scalar is a special case.\n        if not scalar:\n            return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,\n                    allow_flow_plain=False, allow_block_plain=True,\n                    allow_single_quoted=True, allow_double_quoted=True,\n                    allow_block=False)\n\n        # Indicators and special characters.\n        block_indicators = False\n        flow_indicators = False\n        line_breaks = False\n        special_characters = False\n\n        # Important whitespace combinations.\n        leading_space = False\n        leading_break = False\n        trailing_space = False\n        trailing_break = False\n        break_space = False\n        space_break = False\n\n        # Check document indicators.\n        if scalar.startswith('---') or scalar.startswith('...'):\n            block_indicators = True\n            flow_indicators = True\n\n        # First character or preceded by a whitespace.\n        preceeded_by_whitespace = True\n\n        # Last character or followed by a whitespace.\n        followed_by_whitespace = (len(scalar) == 1 or\n                scalar[1] in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # The previous character is a space.\n        previous_space = False\n\n        # The previous character is a break.\n        previous_break = False\n\n        index = 0\n        while index < len(scalar):\n            ch = scalar[index]\n\n            # Check for indicators.\n            if index == 0:\n                # Leading indicators are special characters.\n                if ch in '#,[]{}&*!|>\\'\\\"%@`': \n                    flow_indicators = True\n                    block_indicators = True\n                if ch in '?:':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == '-' and followed_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n            else:\n                # Some indicators cannot appear within a scalar as well.\n                if ch in ',?[]{}':\n                    flow_indicators = True\n                if ch == ':':\n                    flow_indicators = True\n                    if followed_by_whitespace:\n                        block_indicators = True\n                if ch == '#' and preceeded_by_whitespace:\n                    flow_indicators = True\n                    block_indicators = True\n\n            # Check for line breaks, special, and unicode characters.\n            if ch in '\\n\\x85\\u2028\\u2029':\n                line_breaks = True\n            if not (ch == '\\n' or '\\x20' <= ch <= '\\x7E'):\n                if (ch == '\\x85' or '\\xA0' <= ch <= '\\uD7FF'\n                        or '\\uE000' <= ch <= '\\uFFFD') and ch != '\\uFEFF':\n                    unicode_characters = True\n                    if not self.allow_unicode:\n                        special_characters = True\n                else:\n                    special_characters = True\n\n            # Detect important whitespace combinations.\n            if ch == ' ':\n                if index == 0:\n                    leading_space = True\n                if index == len(scalar)-1:\n                    trailing_space = True\n                if previous_break:\n                    break_space = True\n                previous_space = True\n                previous_break = False\n            elif ch in '\\n\\x85\\u2028\\u2029':\n                if index == 0:\n                    leading_break = True\n                if index == len(scalar)-1:\n                    trailing_break = True\n                if previous_space:\n                    space_break = True\n                previous_space = False\n                previous_break = True\n            else:\n                previous_space = False\n                previous_break = False\n\n            # Prepare for the next character.\n            index += 1\n            preceeded_by_whitespace = (ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n            followed_by_whitespace = (index+1 >= len(scalar) or\n                    scalar[index+1] in '\\0 \\t\\r\\n\\x85\\u2028\\u2029')\n\n        # Let's decide what styles are allowed.\n        allow_flow_plain = True\n        allow_block_plain = True\n        allow_single_quoted = True\n        allow_double_quoted = True\n        allow_block = True\n\n        # Leading and trailing whitespaces are bad for plain scalars.\n        if (leading_space or leading_break\n                or trailing_space or trailing_break):\n            allow_flow_plain = allow_block_plain = False\n\n        # We do not permit trailing spaces for block scalars.\n        if trailing_space:\n            allow_block = False\n\n        # Spaces at the beginning of a new line are only acceptable for block\n        # scalars.\n        if break_space:\n            allow_flow_plain = allow_block_plain = allow_single_quoted = False\n\n        # Spaces followed by breaks, as well as special character are only\n        # allowed for double quoted scalars.\n        if space_break or special_characters:\n            allow_flow_plain = allow_block_plain =  \\\n            allow_single_quoted = allow_block = False\n\n        # Although the plain scalar writer supports breaks, we never emit\n        # multiline plain scalars.\n        if line_breaks:\n            allow_flow_plain = allow_block_plain = False\n\n        # Flow indicators are forbidden for flow plain scalars.\n        if flow_indicators:\n            allow_flow_plain = False\n\n        # Block indicators are forbidden for block plain scalars.\n        if block_indicators:\n            allow_block_plain = False\n\n        return ScalarAnalysis(scalar=scalar,\n                empty=False, multiline=line_breaks,\n                allow_flow_plain=allow_flow_plain,\n                allow_block_plain=allow_block_plain,\n                allow_single_quoted=allow_single_quoted,\n                allow_double_quoted=allow_double_quoted,\n                allow_block=allow_block)\n\n    # Writers.\n\n    def flush_stream(self):\n        if hasattr(self.stream, 'flush'):\n            self.stream.flush()\n\n    def write_stream_start(self):\n        # Write BOM if needed.\n        if self.encoding and self.encoding.startswith('utf-16'):\n            self.stream.write('\\uFEFF'.encode(self.encoding))\n\n    def write_stream_end(self):\n        self.flush_stream()\n\n    def write_indicator(self, indicator, need_whitespace,\n            whitespace=False, indention=False):\n        if self.whitespace or not need_whitespace:\n            data = indicator\n        else:\n            data = ' '+indicator\n        self.whitespace = whitespace\n        self.indention = self.indention and indention\n        self.column += len(data)\n        self.open_ended = False\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_indent(self):\n        indent = self.indent or 0\n        if not self.indention or self.column > indent   \\\n                or (self.column == indent and not self.whitespace):\n            self.write_line_break()\n        if self.column < indent:\n            self.whitespace = True\n            data = ' '*(indent-self.column)\n            self.column = indent\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n\n    def write_line_break(self, data=None):\n        if data is None:\n            data = self.best_line_break\n        self.whitespace = True\n        self.indention = True\n        self.line += 1\n        self.column = 0\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n\n    def write_version_directive(self, version_text):\n        data = '%%YAML %s' % version_text\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    def write_tag_directive(self, handle_text, prefix_text):\n        data = '%%TAG %s %s' % (handle_text, prefix_text)\n        if self.encoding:\n            data = data.encode(self.encoding)\n        self.stream.write(data)\n        self.write_line_break()\n\n    # Scalar streams.\n\n    def write_single_quoted(self, text, split=True):\n        self.write_indicator('\\'', True)\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch is None or ch != ' ':\n                    if start+1 == end and self.column > self.best_width and split   \\\n                            and start != 0 and end != len(text):\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    if text[start] == '\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029' or ch == '\\'':\n                    if start < end:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                        start = end\n            if ch == '\\'':\n                data = '\\'\\''\n                self.column += 2\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                start = end + 1\n            if ch is not None:\n                spaces = (ch == ' ')\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n        self.write_indicator('\\'', False)\n\n    ESCAPE_REPLACEMENTS = {\n        '\\0':       '0',\n        '\\x07':     'a',\n        '\\x08':     'b',\n        '\\x09':     't',\n        '\\x0A':     'n',\n        '\\x0B':     'v',\n        '\\x0C':     'f',\n        '\\x0D':     'r',\n        '\\x1B':     'e',\n        '\\\"':       '\\\"',\n        '\\\\':       '\\\\',\n        '\\x85':     'N',\n        '\\xA0':     '_',\n        '\\u2028':   'L',\n        '\\u2029':   'P',\n    }\n\n    def write_double_quoted(self, text, split=True):\n        self.write_indicator('\"', True)\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if ch is None or ch in '\"\\\\\\x85\\u2028\\u2029\\uFEFF' \\\n                    or not ('\\x20' <= ch <= '\\x7E'\n                        or (self.allow_unicode\n                            and ('\\xA0' <= ch <= '\\uD7FF'\n                                or '\\uE000' <= ch <= '\\uFFFD'))):\n                if start < end:\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n                if ch is not None:\n                    if ch in self.ESCAPE_REPLACEMENTS:\n                        data = '\\\\'+self.ESCAPE_REPLACEMENTS[ch]\n                    elif ch <= '\\xFF':\n                        data = '\\\\x%02X' % ord(ch)\n                    elif ch <= '\\uFFFF':\n                        data = '\\\\u%04X' % ord(ch)\n                    else:\n                        data = '\\\\U%08X' % ord(ch)\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end+1\n            if 0 < end < len(text)-1 and (ch == ' ' or start >= end)    \\\n                    and self.column+(end-start) > self.best_width and split:\n                data = text[start:end]+'\\\\'\n                if start < end:\n                    start = end\n                self.column += len(data)\n                if self.encoding:\n                    data = data.encode(self.encoding)\n                self.stream.write(data)\n                self.write_indent()\n                self.whitespace = False\n                self.indention = False\n                if text[start] == ' ':\n                    data = '\\\\'\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n            end += 1\n        self.write_indicator('\"', False)\n\n    def determine_block_hints(self, text):\n        hints = ''\n        if text:\n            if text[0] in ' \\n\\x85\\u2028\\u2029':\n                hints += str(self.best_indent)\n            if text[-1] not in '\\n\\x85\\u2028\\u2029':\n                hints += '-'\n            elif len(text) == 1 or text[-2] in '\\n\\x85\\u2028\\u2029':\n                hints += '+'\n        return hints\n\n    def write_folded(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator('>'+hints, True)\n        if hints[-1:] == '+':\n            self.open_ended = True\n        self.write_line_break()\n        leading_space = True\n        spaces = False\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    if not leading_space and ch is not None and ch != ' '   \\\n                            and text[start] == '\\n':\n                        self.write_line_break()\n                    leading_space = (ch == ' ')\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            elif spaces:\n                if ch != ' ':\n                    if start+1 == end and self.column > self.best_width:\n                        self.write_indent()\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n                spaces = (ch == ' ')\n            end += 1\n\n    def write_literal(self, text):\n        hints = self.determine_block_hints(text)\n        self.write_indicator('|'+hints, True)\n        if hints[-1:] == '+':\n            self.open_ended = True\n        self.write_line_break()\n        breaks = True\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if breaks:\n                if ch is None or ch not in '\\n\\x85\\u2028\\u2029':\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    if ch is not None:\n                        self.write_indent()\n                    start = end\n            else:\n                if ch is None or ch in '\\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    if ch is None:\n                        self.write_line_break()\n                    start = end\n            if ch is not None:\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n\n    def write_plain(self, text, split=True):\n        if self.root_context:\n            self.open_ended = True\n        if not text:\n            return\n        if not self.whitespace:\n            data = ' '\n            self.column += len(data)\n            if self.encoding:\n                data = data.encode(self.encoding)\n            self.stream.write(data)\n        self.whitespace = False\n        self.indention = False\n        spaces = False\n        breaks = False\n        start = end = 0\n        while end <= len(text):\n            ch = None\n            if end < len(text):\n                ch = text[end]\n            if spaces:\n                if ch != ' ':\n                    if start+1 == end and self.column > self.best_width and split:\n                        self.write_indent()\n                        self.whitespace = False\n                        self.indention = False\n                    else:\n                        data = text[start:end]\n                        self.column += len(data)\n                        if self.encoding:\n                            data = data.encode(self.encoding)\n                        self.stream.write(data)\n                    start = end\n            elif breaks:\n                if ch not in '\\n\\x85\\u2028\\u2029':\n                    if text[start] == '\\n':\n                        self.write_line_break()\n                    for br in text[start:end]:\n                        if br == '\\n':\n                            self.write_line_break()\n                        else:\n                            self.write_line_break(br)\n                    self.write_indent()\n                    self.whitespace = False\n                    self.indention = False\n                    start = end\n            else:\n                if ch is None or ch in ' \\n\\x85\\u2028\\u2029':\n                    data = text[start:end]\n                    self.column += len(data)\n                    if self.encoding:\n                        data = data.encode(self.encoding)\n                    self.stream.write(data)\n                    start = end\n            if ch is not None:\n                spaces = (ch == ' ')\n                breaks = (ch in '\\n\\x85\\u2028\\u2029')\n            end += 1\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/error.py",
    "content": "\n__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']\n\nclass Mark:\n\n    def __init__(self, name, index, line, column, buffer, pointer):\n        self.name = name\n        self.index = index\n        self.line = line\n        self.column = column\n        self.buffer = buffer\n        self.pointer = pointer\n\n    def get_snippet(self, indent=4, max_length=75):\n        if self.buffer is None:\n            return None\n        head = ''\n        start = self.pointer\n        while start > 0 and self.buffer[start-1] not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            start -= 1\n            if self.pointer-start > max_length/2-1:\n                head = ' ... '\n                start += 5\n                break\n        tail = ''\n        end = self.pointer\n        while end < len(self.buffer) and self.buffer[end] not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            end += 1\n            if end-self.pointer > max_length/2-1:\n                tail = ' ... '\n                end -= 5\n                break\n        snippet = self.buffer[start:end]\n        return ' '*indent + head + snippet + tail + '\\n'  \\\n                + ' '*(indent+self.pointer-start+len(head)) + '^'\n\n    def __str__(self):\n        snippet = self.get_snippet()\n        where = \"  in \\\"%s\\\", line %d, column %d\"   \\\n                % (self.name, self.line+1, self.column+1)\n        if snippet is not None:\n            where += \":\\n\"+snippet\n        return where\n\nclass YAMLError(Exception):\n    pass\n\nclass MarkedYAMLError(YAMLError):\n\n    def __init__(self, context=None, context_mark=None,\n            problem=None, problem_mark=None, note=None):\n        self.context = context\n        self.context_mark = context_mark\n        self.problem = problem\n        self.problem_mark = problem_mark\n        self.note = note\n\n    def __str__(self):\n        lines = []\n        if self.context is not None:\n            lines.append(self.context)\n        if self.context_mark is not None  \\\n            and (self.problem is None or self.problem_mark is None\n                    or self.context_mark.name != self.problem_mark.name\n                    or self.context_mark.line != self.problem_mark.line\n                    or self.context_mark.column != self.problem_mark.column):\n            lines.append(str(self.context_mark))\n        if self.problem is not None:\n            lines.append(self.problem)\n        if self.problem_mark is not None:\n            lines.append(str(self.problem_mark))\n        if self.note is not None:\n            lines.append(self.note)\n        return '\\n'.join(lines)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/events.py",
    "content": "\n# Abstract classes.\n\nclass Event(object):\n    def __init__(self, start_mark=None, end_mark=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']\n                if hasattr(self, key)]\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\nclass NodeEvent(Event):\n    def __init__(self, anchor, start_mark=None, end_mark=None):\n        self.anchor = anchor\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass CollectionStartEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,\n            flow_style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass CollectionEndEvent(Event):\n    pass\n\n# Implementations.\n\nclass StreamStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None, encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndEvent(Event):\n    pass\n\nclass DocumentStartEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None, version=None, tags=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n        self.version = version\n        self.tags = tags\n\nclass DocumentEndEvent(Event):\n    def __init__(self, start_mark=None, end_mark=None,\n            explicit=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.explicit = explicit\n\nclass AliasEvent(NodeEvent):\n    pass\n\nclass ScalarEvent(NodeEvent):\n    def __init__(self, anchor, tag, implicit, value,\n            start_mark=None, end_mark=None, style=None):\n        self.anchor = anchor\n        self.tag = tag\n        self.implicit = implicit\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass SequenceStartEvent(CollectionStartEvent):\n    pass\n\nclass SequenceEndEvent(CollectionEndEvent):\n    pass\n\nclass MappingStartEvent(CollectionStartEvent):\n    pass\n\nclass MappingEndEvent(CollectionEndEvent):\n    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/loader.py",
    "content": "\n__all__ = ['BaseLoader', 'SafeLoader', 'Loader']\n\nfrom .reader import *\nfrom .scanner import *\nfrom .parser import *\nfrom .composer import *\nfrom .constructor import *\nfrom .resolver import *\n\nclass BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        BaseConstructor.__init__(self)\n        BaseResolver.__init__(self)\n\nclass SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        SafeConstructor.__init__(self)\n        Resolver.__init__(self)\n\nclass Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver):\n\n    def __init__(self, stream):\n        Reader.__init__(self, stream)\n        Scanner.__init__(self)\n        Parser.__init__(self)\n        Composer.__init__(self)\n        Constructor.__init__(self)\n        Resolver.__init__(self)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/nodes.py",
    "content": "\nclass Node(object):\n    def __init__(self, tag, value, start_mark, end_mark):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        value = self.value\n        #if isinstance(value, list):\n        #    if len(value) == 0:\n        #        value = '<empty>'\n        #    elif len(value) == 1:\n        #        value = '<1 item>'\n        #    else:\n        #        value = '<%d items>' % len(value)\n        #else:\n        #    if len(value) > 75:\n        #        value = repr(value[:70]+u' ... ')\n        #    else:\n        #        value = repr(value)\n        value = repr(value)\n        return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)\n\nclass ScalarNode(Node):\n    id = 'scalar'\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\nclass CollectionNode(Node):\n    def __init__(self, tag, value,\n            start_mark=None, end_mark=None, flow_style=None):\n        self.tag = tag\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.flow_style = flow_style\n\nclass SequenceNode(CollectionNode):\n    id = 'sequence'\n\nclass MappingNode(CollectionNode):\n    id = 'mapping'\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/parser.py",
    "content": "\n# The following YAML grammar is LL(1) and is parsed by a recursive descent\n# parser.\n#\n# stream            ::= STREAM-START implicit_document? explicit_document* STREAM-END\n# implicit_document ::= block_node DOCUMENT-END*\n# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n# block_node_or_indentless_sequence ::=\n#                       ALIAS\n#                       | properties (block_content | indentless_block_sequence)?\n#                       | block_content\n#                       | indentless_block_sequence\n# block_node        ::= ALIAS\n#                       | properties block_content?\n#                       | block_content\n# flow_node         ::= ALIAS\n#                       | properties flow_content?\n#                       | flow_content\n# properties        ::= TAG ANCHOR? | ANCHOR TAG?\n# block_content     ::= block_collection | flow_collection | SCALAR\n# flow_content      ::= flow_collection | SCALAR\n# block_collection  ::= block_sequence | block_mapping\n# flow_collection   ::= flow_sequence | flow_mapping\n# block_sequence    ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n# indentless_sequence   ::= (BLOCK-ENTRY block_node?)+\n# block_mapping     ::= BLOCK-MAPPING_START\n#                       ((KEY block_node_or_indentless_sequence?)?\n#                       (VALUE block_node_or_indentless_sequence?)?)*\n#                       BLOCK-END\n# flow_sequence     ::= FLOW-SEQUENCE-START\n#                       (flow_sequence_entry FLOW-ENTRY)*\n#                       flow_sequence_entry?\n#                       FLOW-SEQUENCE-END\n# flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n# flow_mapping      ::= FLOW-MAPPING-START\n#                       (flow_mapping_entry FLOW-ENTRY)*\n#                       flow_mapping_entry?\n#                       FLOW-MAPPING-END\n# flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n#\n# FIRST sets:\n#\n# stream: { STREAM-START }\n# explicit_document: { DIRECTIVE DOCUMENT-START }\n# implicit_document: FIRST(block_node)\n# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR }\n# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# block_sequence: { BLOCK-SEQUENCE-START }\n# block_mapping: { BLOCK-MAPPING-START }\n# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY }\n# indentless_sequence: { ENTRY }\n# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START }\n# flow_sequence: { FLOW-SEQUENCE-START }\n# flow_mapping: { FLOW-MAPPING-START }\n# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY }\n\n__all__ = ['Parser', 'ParserError']\n\nfrom .error import MarkedYAMLError\nfrom .tokens import *\nfrom .events import *\nfrom .scanner import *\n\nclass ParserError(MarkedYAMLError):\n    pass\n\nclass Parser:\n    # Since writing a recursive-descendant parser is a straightforward task, we\n    # do not give many comments here.\n\n    DEFAULT_TAGS = {\n        '!':   '!',\n        '!!':  'tag:yaml.org,2002:',\n    }\n\n    def __init__(self):\n        self.current_event = None\n        self.yaml_version = None\n        self.tag_handles = {}\n        self.states = []\n        self.marks = []\n        self.state = self.parse_stream_start\n\n    def dispose(self):\n        # Reset the state attributes (to clear self-references)\n        self.states = []\n        self.state = None\n\n    def check_event(self, *choices):\n        # Check the type of the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        if self.current_event is not None:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.current_event, choice):\n                    return True\n        return False\n\n    def peek_event(self):\n        # Get the next event.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        return self.current_event\n\n    def get_event(self):\n        # Get the next event and proceed further.\n        if self.current_event is None:\n            if self.state:\n                self.current_event = self.state()\n        value = self.current_event\n        self.current_event = None\n        return value\n\n    # stream    ::= STREAM-START implicit_document? explicit_document* STREAM-END\n    # implicit_document ::= block_node DOCUMENT-END*\n    # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n\n    def parse_stream_start(self):\n\n        # Parse the stream start.\n        token = self.get_token()\n        event = StreamStartEvent(token.start_mark, token.end_mark,\n                encoding=token.encoding)\n\n        # Prepare the next state.\n        self.state = self.parse_implicit_document_start\n\n        return event\n\n    def parse_implicit_document_start(self):\n\n        # Parse an implicit document.\n        if not self.check_token(DirectiveToken, DocumentStartToken,\n                StreamEndToken):\n            self.tag_handles = self.DEFAULT_TAGS\n            token = self.peek_token()\n            start_mark = end_mark = token.start_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=False)\n\n            # Prepare the next state.\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_block_node\n\n            return event\n\n        else:\n            return self.parse_document_start()\n\n    def parse_document_start(self):\n\n        # Parse any extra document end indicators.\n        while self.check_token(DocumentEndToken):\n            self.get_token()\n\n        # Parse an explicit document.\n        if not self.check_token(StreamEndToken):\n            token = self.peek_token()\n            start_mark = token.start_mark\n            version, tags = self.process_directives()\n            if not self.check_token(DocumentStartToken):\n                raise ParserError(None, None,\n                        \"expected '<document start>', but found %r\"\n                        % self.peek_token().id,\n                        self.peek_token().start_mark)\n            token = self.get_token()\n            end_mark = token.end_mark\n            event = DocumentStartEvent(start_mark, end_mark,\n                    explicit=True, version=version, tags=tags)\n            self.states.append(self.parse_document_end)\n            self.state = self.parse_document_content\n        else:\n            # Parse the end of the stream.\n            token = self.get_token()\n            event = StreamEndEvent(token.start_mark, token.end_mark)\n            assert not self.states\n            assert not self.marks\n            self.state = None\n        return event\n\n    def parse_document_end(self):\n\n        # Parse the document end.\n        token = self.peek_token()\n        start_mark = end_mark = token.start_mark\n        explicit = False\n        if self.check_token(DocumentEndToken):\n            token = self.get_token()\n            end_mark = token.end_mark\n            explicit = True\n        event = DocumentEndEvent(start_mark, end_mark,\n                explicit=explicit)\n\n        # Prepare the next state.\n        self.state = self.parse_document_start\n\n        return event\n\n    def parse_document_content(self):\n        if self.check_token(DirectiveToken,\n                DocumentStartToken, DocumentEndToken, StreamEndToken):\n            event = self.process_empty_scalar(self.peek_token().start_mark)\n            self.state = self.states.pop()\n            return event\n        else:\n            return self.parse_block_node()\n\n    def process_directives(self):\n        self.yaml_version = None\n        self.tag_handles = {}\n        while self.check_token(DirectiveToken):\n            token = self.get_token()\n            if token.name == 'YAML':\n                if self.yaml_version is not None:\n                    raise ParserError(None, None,\n                            \"found duplicate YAML directive\", token.start_mark)\n                major, minor = token.value\n                if major != 1:\n                    raise ParserError(None, None,\n                            \"found incompatible YAML document (version 1.* is required)\",\n                            token.start_mark)\n                self.yaml_version = token.value\n            elif token.name == 'TAG':\n                handle, prefix = token.value\n                if handle in self.tag_handles:\n                    raise ParserError(None, None,\n                            \"duplicate tag handle %r\" % handle,\n                            token.start_mark)\n                self.tag_handles[handle] = prefix\n        if self.tag_handles:\n            value = self.yaml_version, self.tag_handles.copy()\n        else:\n            value = self.yaml_version, None\n        for key in self.DEFAULT_TAGS:\n            if key not in self.tag_handles:\n                self.tag_handles[key] = self.DEFAULT_TAGS[key]\n        return value\n\n    # block_node_or_indentless_sequence ::= ALIAS\n    #               | properties (block_content | indentless_block_sequence)?\n    #               | block_content\n    #               | indentless_block_sequence\n    # block_node    ::= ALIAS\n    #                   | properties block_content?\n    #                   | block_content\n    # flow_node     ::= ALIAS\n    #                   | properties flow_content?\n    #                   | flow_content\n    # properties    ::= TAG ANCHOR? | ANCHOR TAG?\n    # block_content     ::= block_collection | flow_collection | SCALAR\n    # flow_content      ::= flow_collection | SCALAR\n    # block_collection  ::= block_sequence | block_mapping\n    # flow_collection   ::= flow_sequence | flow_mapping\n\n    def parse_block_node(self):\n        return self.parse_node(block=True)\n\n    def parse_flow_node(self):\n        return self.parse_node()\n\n    def parse_block_node_or_indentless_sequence(self):\n        return self.parse_node(block=True, indentless_sequence=True)\n\n    def parse_node(self, block=False, indentless_sequence=False):\n        if self.check_token(AliasToken):\n            token = self.get_token()\n            event = AliasEvent(token.value, token.start_mark, token.end_mark)\n            self.state = self.states.pop()\n        else:\n            anchor = None\n            tag = None\n            start_mark = end_mark = tag_mark = None\n            if self.check_token(AnchorToken):\n                token = self.get_token()\n                start_mark = token.start_mark\n                end_mark = token.end_mark\n                anchor = token.value\n                if self.check_token(TagToken):\n                    token = self.get_token()\n                    tag_mark = token.start_mark\n                    end_mark = token.end_mark\n                    tag = token.value\n            elif self.check_token(TagToken):\n                token = self.get_token()\n                start_mark = tag_mark = token.start_mark\n                end_mark = token.end_mark\n                tag = token.value\n                if self.check_token(AnchorToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    anchor = token.value\n            if tag is not None:\n                handle, suffix = tag\n                if handle is not None:\n                    if handle not in self.tag_handles:\n                        raise ParserError(\"while parsing a node\", start_mark,\n                                \"found undefined tag handle %r\" % handle,\n                                tag_mark)\n                    tag = self.tag_handles[handle]+suffix\n                else:\n                    tag = suffix\n            #if tag == '!':\n            #    raise ParserError(\"while parsing a node\", start_mark,\n            #            \"found non-specific tag '!'\", tag_mark,\n            #            \"Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.\")\n            if start_mark is None:\n                start_mark = end_mark = self.peek_token().start_mark\n            event = None\n            implicit = (tag is None or tag == '!')\n            if indentless_sequence and self.check_token(BlockEntryToken):\n                end_mark = self.peek_token().end_mark\n                event = SequenceStartEvent(anchor, tag, implicit,\n                        start_mark, end_mark)\n                self.state = self.parse_indentless_sequence_entry\n            else:\n                if self.check_token(ScalarToken):\n                    token = self.get_token()\n                    end_mark = token.end_mark\n                    if (token.plain and tag is None) or tag == '!':\n                        implicit = (True, False)\n                    elif tag is None:\n                        implicit = (False, True)\n                    else:\n                        implicit = (False, False)\n                    event = ScalarEvent(anchor, tag, implicit, token.value,\n                            start_mark, end_mark, style=token.style)\n                    self.state = self.states.pop()\n                elif self.check_token(FlowSequenceStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_sequence_first_entry\n                elif self.check_token(FlowMappingStartToken):\n                    end_mark = self.peek_token().end_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=True)\n                    self.state = self.parse_flow_mapping_first_key\n                elif block and self.check_token(BlockSequenceStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = SequenceStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_sequence_first_entry\n                elif block and self.check_token(BlockMappingStartToken):\n                    end_mark = self.peek_token().start_mark\n                    event = MappingStartEvent(anchor, tag, implicit,\n                            start_mark, end_mark, flow_style=False)\n                    self.state = self.parse_block_mapping_first_key\n                elif anchor is not None or tag is not None:\n                    # Empty scalars are allowed even if a tag or an anchor is\n                    # specified.\n                    event = ScalarEvent(anchor, tag, (implicit, False), '',\n                            start_mark, end_mark)\n                    self.state = self.states.pop()\n                else:\n                    if block:\n                        node = 'block'\n                    else:\n                        node = 'flow'\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a %s node\" % node, start_mark,\n                            \"expected the node content, but found %r\" % token.id,\n                            token.start_mark)\n        return event\n\n    # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n\n    def parse_block_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_sequence_entry()\n\n    def parse_block_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken, BlockEndToken):\n                self.states.append(self.parse_block_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_block_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block collection\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    # indentless_sequence ::= (BLOCK-ENTRY block_node?)+\n\n    def parse_indentless_sequence_entry(self):\n        if self.check_token(BlockEntryToken):\n            token = self.get_token()\n            if not self.check_token(BlockEntryToken,\n                    KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_indentless_sequence_entry)\n                return self.parse_block_node()\n            else:\n                self.state = self.parse_indentless_sequence_entry\n                return self.process_empty_scalar(token.end_mark)\n        token = self.peek_token()\n        event = SequenceEndEvent(token.start_mark, token.start_mark)\n        self.state = self.states.pop()\n        return event\n\n    # block_mapping     ::= BLOCK-MAPPING_START\n    #                       ((KEY block_node_or_indentless_sequence?)?\n    #                       (VALUE block_node_or_indentless_sequence?)?)*\n    #                       BLOCK-END\n\n    def parse_block_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_block_mapping_key()\n\n    def parse_block_mapping_key(self):\n        if self.check_token(KeyToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_value)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_value\n                return self.process_empty_scalar(token.end_mark)\n        if not self.check_token(BlockEndToken):\n            token = self.peek_token()\n            raise ParserError(\"while parsing a block mapping\", self.marks[-1],\n                    \"expected <block end>, but found %r\" % token.id, token.start_mark)\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_block_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n                self.states.append(self.parse_block_mapping_key)\n                return self.parse_block_node_or_indentless_sequence()\n            else:\n                self.state = self.parse_block_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_block_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    # flow_sequence     ::= FLOW-SEQUENCE-START\n    #                       (flow_sequence_entry FLOW-ENTRY)*\n    #                       flow_sequence_entry?\n    #                       FLOW-SEQUENCE-END\n    # flow_sequence_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n    #\n    # Note that while production rules for both flow_sequence_entry and\n    # flow_mapping_entry are equal, their interpretations are different.\n    # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?`\n    # generate an inline mapping (set syntax).\n\n    def parse_flow_sequence_first_entry(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_sequence_entry(first=True)\n\n    def parse_flow_sequence_entry(self, first=False):\n        if not self.check_token(FlowSequenceEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow sequence\", self.marks[-1],\n                            \"expected ',' or ']', but got %r\" % token.id, token.start_mark)\n            \n            if self.check_token(KeyToken):\n                token = self.peek_token()\n                event = MappingStartEvent(None, None, True,\n                        token.start_mark, token.end_mark,\n                        flow_style=True)\n                self.state = self.parse_flow_sequence_entry_mapping_key\n                return event\n            elif not self.check_token(FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = SequenceEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_sequence_entry_mapping_key(self):\n        token = self.get_token()\n        if not self.check_token(ValueToken,\n                FlowEntryToken, FlowSequenceEndToken):\n            self.states.append(self.parse_flow_sequence_entry_mapping_value)\n            return self.parse_flow_node()\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_value\n            return self.process_empty_scalar(token.end_mark)\n\n    def parse_flow_sequence_entry_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowSequenceEndToken):\n                self.states.append(self.parse_flow_sequence_entry_mapping_end)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_sequence_entry_mapping_end\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_sequence_entry_mapping_end\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_sequence_entry_mapping_end(self):\n        self.state = self.parse_flow_sequence_entry\n        token = self.peek_token()\n        return MappingEndEvent(token.start_mark, token.start_mark)\n\n    # flow_mapping  ::= FLOW-MAPPING-START\n    #                   (flow_mapping_entry FLOW-ENTRY)*\n    #                   flow_mapping_entry?\n    #                   FLOW-MAPPING-END\n    # flow_mapping_entry    ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n\n    def parse_flow_mapping_first_key(self):\n        token = self.get_token()\n        self.marks.append(token.start_mark)\n        return self.parse_flow_mapping_key(first=True)\n\n    def parse_flow_mapping_key(self, first=False):\n        if not self.check_token(FlowMappingEndToken):\n            if not first:\n                if self.check_token(FlowEntryToken):\n                    self.get_token()\n                else:\n                    token = self.peek_token()\n                    raise ParserError(\"while parsing a flow mapping\", self.marks[-1],\n                            \"expected ',' or '}', but got %r\" % token.id, token.start_mark)\n            if self.check_token(KeyToken):\n                token = self.get_token()\n                if not self.check_token(ValueToken,\n                        FlowEntryToken, FlowMappingEndToken):\n                    self.states.append(self.parse_flow_mapping_value)\n                    return self.parse_flow_node()\n                else:\n                    self.state = self.parse_flow_mapping_value\n                    return self.process_empty_scalar(token.end_mark)\n            elif not self.check_token(FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_empty_value)\n                return self.parse_flow_node()\n        token = self.get_token()\n        event = MappingEndEvent(token.start_mark, token.end_mark)\n        self.state = self.states.pop()\n        self.marks.pop()\n        return event\n\n    def parse_flow_mapping_value(self):\n        if self.check_token(ValueToken):\n            token = self.get_token()\n            if not self.check_token(FlowEntryToken, FlowMappingEndToken):\n                self.states.append(self.parse_flow_mapping_key)\n                return self.parse_flow_node()\n            else:\n                self.state = self.parse_flow_mapping_key\n                return self.process_empty_scalar(token.end_mark)\n        else:\n            self.state = self.parse_flow_mapping_key\n            token = self.peek_token()\n            return self.process_empty_scalar(token.start_mark)\n\n    def parse_flow_mapping_empty_value(self):\n        self.state = self.parse_flow_mapping_key\n        return self.process_empty_scalar(self.peek_token().start_mark)\n\n    def process_empty_scalar(self, mark):\n        return ScalarEvent(None, None, (True, False), '', mark, mark)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/reader.py",
    "content": "# This module contains abstractions for the input stream. You don't have to\n# looks further, there are no pretty code.\n#\n# We define two classes here.\n#\n#   Mark(source, line, column)\n# It's just a record and its only use is producing nice error messages.\n# Parser does not use it for any other purposes.\n#\n#   Reader(source, data)\n# Reader determines the encoding of `data` and converts it to unicode.\n# Reader provides the following methods and attributes:\n#   reader.peek(length=1) - return the next `length` characters\n#   reader.forward(length=1) - move the current position to `length` characters.\n#   reader.index - the number of the current character.\n#   reader.line, stream.column - the line and the column of the current character.\n\n__all__ = ['Reader', 'ReaderError']\n\nfrom .error import YAMLError, Mark\n\nimport codecs, re\n\nclass ReaderError(YAMLError):\n\n    def __init__(self, name, position, character, encoding, reason):\n        self.name = name\n        self.character = character\n        self.position = position\n        self.encoding = encoding\n        self.reason = reason\n\n    def __str__(self):\n        if isinstance(self.character, bytes):\n            return \"'%s' codec can't decode byte #x%02x: %s\\n\"  \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.encoding, ord(self.character), self.reason,\n                            self.name, self.position)\n        else:\n            return \"unacceptable character #x%04x: %s\\n\"    \\\n                    \"  in \\\"%s\\\", position %d\"    \\\n                    % (self.character, self.reason,\n                            self.name, self.position)\n\nclass Reader(object):\n    # Reader:\n    # - determines the data encoding and converts it to a unicode string,\n    # - checks if characters are in allowed range,\n    # - adds '\\0' to the end.\n\n    # Reader accepts\n    #  - a `bytes` object,\n    #  - a `str` object,\n    #  - a file-like object with its `read` method returning `str`,\n    #  - a file-like object with its `read` method returning `unicode`.\n\n    # Yeah, it's ugly and slow.\n\n    def __init__(self, stream):\n        self.name = None\n        self.stream = None\n        self.stream_pointer = 0\n        self.eof = True\n        self.buffer = ''\n        self.pointer = 0\n        self.raw_buffer = None\n        self.raw_decode = None\n        self.encoding = None\n        self.index = 0\n        self.line = 0\n        self.column = 0\n        if isinstance(stream, str):\n            self.name = \"<unicode string>\"\n            self.check_printable(stream)\n            self.buffer = stream+'\\0'\n        elif isinstance(stream, bytes):\n            self.name = \"<byte string>\"\n            self.raw_buffer = stream\n            self.determine_encoding()\n        else:\n            self.stream = stream\n            self.name = getattr(stream, 'name', \"<file>\")\n            self.eof = False\n            self.raw_buffer = None\n            self.determine_encoding()\n\n    def peek(self, index=0):\n        try:\n            return self.buffer[self.pointer+index]\n        except IndexError:\n            self.update(index+1)\n            return self.buffer[self.pointer+index]\n\n    def prefix(self, length=1):\n        if self.pointer+length >= len(self.buffer):\n            self.update(length)\n        return self.buffer[self.pointer:self.pointer+length]\n\n    def forward(self, length=1):\n        if self.pointer+length+1 >= len(self.buffer):\n            self.update(length+1)\n        while length:\n            ch = self.buffer[self.pointer]\n            self.pointer += 1\n            self.index += 1\n            if ch in '\\n\\x85\\u2028\\u2029'  \\\n                    or (ch == '\\r' and self.buffer[self.pointer] != '\\n'):\n                self.line += 1\n                self.column = 0\n            elif ch != '\\uFEFF':\n                self.column += 1\n            length -= 1\n\n    def get_mark(self):\n        if self.stream is None:\n            return Mark(self.name, self.index, self.line, self.column,\n                    self.buffer, self.pointer)\n        else:\n            return Mark(self.name, self.index, self.line, self.column,\n                    None, None)\n\n    def determine_encoding(self):\n        while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2):\n            self.update_raw()\n        if isinstance(self.raw_buffer, bytes):\n            if self.raw_buffer.startswith(codecs.BOM_UTF16_LE):\n                self.raw_decode = codecs.utf_16_le_decode\n                self.encoding = 'utf-16-le'\n            elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE):\n                self.raw_decode = codecs.utf_16_be_decode\n                self.encoding = 'utf-16-be'\n            else:\n                self.raw_decode = codecs.utf_8_decode\n                self.encoding = 'utf-8'\n        self.update(1)\n\n    NON_PRINTABLE = re.compile('[^\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD]')\n    def check_printable(self, data):\n        match = self.NON_PRINTABLE.search(data)\n        if match:\n            character = match.group()\n            position = self.index+(len(self.buffer)-self.pointer)+match.start()\n            raise ReaderError(self.name, position, ord(character),\n                    'unicode', \"special characters are not allowed\")\n\n    def update(self, length):\n        if self.raw_buffer is None:\n            return\n        self.buffer = self.buffer[self.pointer:]\n        self.pointer = 0\n        while len(self.buffer) < length:\n            if not self.eof:\n                self.update_raw()\n            if self.raw_decode is not None:\n                try:\n                    data, converted = self.raw_decode(self.raw_buffer,\n                            'strict', self.eof)\n                except UnicodeDecodeError as exc:\n                    character = self.raw_buffer[exc.start]\n                    if self.stream is not None:\n                        position = self.stream_pointer-len(self.raw_buffer)+exc.start\n                    else:\n                        position = exc.start\n                    raise ReaderError(self.name, position, character,\n                            exc.encoding, exc.reason)\n            else:\n                data = self.raw_buffer\n                converted = len(data)\n            self.check_printable(data)\n            self.buffer += data\n            self.raw_buffer = self.raw_buffer[converted:]\n            if self.eof:\n                self.buffer += '\\0'\n                self.raw_buffer = None\n                break\n\n    def update_raw(self, size=4096):\n        data = self.stream.read(size)\n        if self.raw_buffer is None:\n            self.raw_buffer = data\n        else:\n            self.raw_buffer += data\n        self.stream_pointer += len(data)\n        if not data:\n            self.eof = True\n\n#try:\n#    import psyco\n#    psyco.bind(Reader)\n#except ImportError:\n#    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/representer.py",
    "content": "\n__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',\n    'RepresenterError']\n\nfrom .error import *\nfrom .nodes import *\n\nimport datetime, sys, copyreg, types, base64, collections\n\nclass RepresenterError(YAMLError):\n    pass\n\nclass BaseRepresenter:\n\n    yaml_representers = {}\n    yaml_multi_representers = {}\n\n    def __init__(self, default_style=None, default_flow_style=None):\n        self.default_style = default_style\n        self.default_flow_style = default_flow_style\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def represent(self, data):\n        node = self.represent_data(data)\n        self.serialize(node)\n        self.represented_objects = {}\n        self.object_keeper = []\n        self.alias_key = None\n\n    def represent_data(self, data):\n        if self.ignore_aliases(data):\n            self.alias_key = None\n        else:\n            self.alias_key = id(data)\n        if self.alias_key is not None:\n            if self.alias_key in self.represented_objects:\n                node = self.represented_objects[self.alias_key]\n                #if node is None:\n                #    raise RepresenterError(\"recursive objects are not allowed: %r\" % data)\n                return node\n            #self.represented_objects[alias_key] = None\n            self.object_keeper.append(data)\n        data_types = type(data).__mro__\n        if data_types[0] in self.yaml_representers:\n            node = self.yaml_representers[data_types[0]](self, data)\n        else:\n            for data_type in data_types:\n                if data_type in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[data_type](self, data)\n                    break\n            else:\n                if None in self.yaml_multi_representers:\n                    node = self.yaml_multi_representers[None](self, data)\n                elif None in self.yaml_representers:\n                    node = self.yaml_representers[None](self, data)\n                else:\n                    node = ScalarNode(None, str(data))\n        #if alias_key is not None:\n        #    self.represented_objects[alias_key] = node\n        return node\n\n    @classmethod\n    def add_representer(cls, data_type, representer):\n        if not 'yaml_representers' in cls.__dict__:\n            cls.yaml_representers = cls.yaml_representers.copy()\n        cls.yaml_representers[data_type] = representer\n\n    @classmethod\n    def add_multi_representer(cls, data_type, representer):\n        if not 'yaml_multi_representers' in cls.__dict__:\n            cls.yaml_multi_representers = cls.yaml_multi_representers.copy()\n        cls.yaml_multi_representers[data_type] = representer\n\n    def represent_scalar(self, tag, value, style=None):\n        if style is None:\n            style = self.default_style\n        node = ScalarNode(tag, value, style=style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        return node\n\n    def represent_sequence(self, tag, sequence, flow_style=None):\n        value = []\n        node = SequenceNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        for item in sequence:\n            node_item = self.represent_data(item)\n            if not (isinstance(node_item, ScalarNode) and not node_item.style):\n                best_style = False\n            value.append(node_item)\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def represent_mapping(self, tag, mapping, flow_style=None):\n        value = []\n        node = MappingNode(tag, value, flow_style=flow_style)\n        if self.alias_key is not None:\n            self.represented_objects[self.alias_key] = node\n        best_style = True\n        if hasattr(mapping, 'items'):\n            mapping = list(mapping.items())\n            try:\n                mapping = sorted(mapping)\n            except TypeError:\n                pass\n        for item_key, item_value in mapping:\n            node_key = self.represent_data(item_key)\n            node_value = self.represent_data(item_value)\n            if not (isinstance(node_key, ScalarNode) and not node_key.style):\n                best_style = False\n            if not (isinstance(node_value, ScalarNode) and not node_value.style):\n                best_style = False\n            value.append((node_key, node_value))\n        if flow_style is None:\n            if self.default_flow_style is not None:\n                node.flow_style = self.default_flow_style\n            else:\n                node.flow_style = best_style\n        return node\n\n    def ignore_aliases(self, data):\n        return False\n\nclass SafeRepresenter(BaseRepresenter):\n\n    def ignore_aliases(self, data):\n        if data is None:\n            return True\n        if isinstance(data, tuple) and data == ():\n            return True\n        if isinstance(data, (str, bytes, bool, int, float)):\n            return True\n\n    def represent_none(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:null', 'null')\n\n    def represent_str(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:str', data)\n\n    def represent_binary(self, data):\n        if hasattr(base64, 'encodebytes'):\n            data = base64.encodebytes(data).decode('ascii')\n        else:\n            data = base64.encodestring(data).decode('ascii')\n        return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|')\n\n    def represent_bool(self, data):\n        if data:\n            value = 'true'\n        else:\n            value = 'false'\n        return self.represent_scalar('tag:yaml.org,2002:bool', value)\n\n    def represent_int(self, data):\n        return self.represent_scalar('tag:yaml.org,2002:int', str(data))\n\n    inf_value = 1e300\n    while repr(inf_value) != repr(inf_value*inf_value):\n        inf_value *= inf_value\n\n    def represent_float(self, data):\n        if data != data or (data == 0.0 and data == 1.0):\n            value = '.nan'\n        elif data == self.inf_value:\n            value = '.inf'\n        elif data == -self.inf_value:\n            value = '-.inf'\n        else:\n            value = repr(data).lower()\n            # Note that in some cases `repr(data)` represents a float number\n            # without the decimal parts.  For instance:\n            #   >>> repr(1e17)\n            #   '1e17'\n            # Unfortunately, this is not a valid float representation according\n            # to the definition of the `!!float` tag.  We fix this by adding\n            # '.0' before the 'e' symbol.\n            if '.' not in value and 'e' in value:\n                value = value.replace('e', '.0e', 1)\n        return self.represent_scalar('tag:yaml.org,2002:float', value)\n\n    def represent_list(self, data):\n        #pairs = (len(data) > 0 and isinstance(data, list))\n        #if pairs:\n        #    for item in data:\n        #        if not isinstance(item, tuple) or len(item) != 2:\n        #            pairs = False\n        #            break\n        #if not pairs:\n            return self.represent_sequence('tag:yaml.org,2002:seq', data)\n        #value = []\n        #for item_key, item_value in data:\n        #    value.append(self.represent_mapping(u'tag:yaml.org,2002:map',\n        #        [(item_key, item_value)]))\n        #return SequenceNode(u'tag:yaml.org,2002:pairs', value)\n\n    def represent_dict(self, data):\n        return self.represent_mapping('tag:yaml.org,2002:map', data)\n\n    def represent_set(self, data):\n        value = {}\n        for key in data:\n            value[key] = None\n        return self.represent_mapping('tag:yaml.org,2002:set', value)\n\n    def represent_date(self, data):\n        value = data.isoformat()\n        return self.represent_scalar('tag:yaml.org,2002:timestamp', value)\n\n    def represent_datetime(self, data):\n        value = data.isoformat(' ')\n        return self.represent_scalar('tag:yaml.org,2002:timestamp', value)\n\n    def represent_yaml_object(self, tag, data, cls, flow_style=None):\n        if hasattr(data, '__getstate__'):\n            state = data.__getstate__()\n        else:\n            state = data.__dict__.copy()\n        return self.represent_mapping(tag, state, flow_style=flow_style)\n\n    def represent_undefined(self, data):\n        raise RepresenterError(\"cannot represent an object: %s\" % data)\n\nSafeRepresenter.add_representer(type(None),\n        SafeRepresenter.represent_none)\n\nSafeRepresenter.add_representer(str,\n        SafeRepresenter.represent_str)\n\nSafeRepresenter.add_representer(bytes,\n        SafeRepresenter.represent_binary)\n\nSafeRepresenter.add_representer(bool,\n        SafeRepresenter.represent_bool)\n\nSafeRepresenter.add_representer(int,\n        SafeRepresenter.represent_int)\n\nSafeRepresenter.add_representer(float,\n        SafeRepresenter.represent_float)\n\nSafeRepresenter.add_representer(list,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(tuple,\n        SafeRepresenter.represent_list)\n\nSafeRepresenter.add_representer(dict,\n        SafeRepresenter.represent_dict)\n\nSafeRepresenter.add_representer(set,\n        SafeRepresenter.represent_set)\n\nSafeRepresenter.add_representer(datetime.date,\n        SafeRepresenter.represent_date)\n\nSafeRepresenter.add_representer(datetime.datetime,\n        SafeRepresenter.represent_datetime)\n\nSafeRepresenter.add_representer(None,\n        SafeRepresenter.represent_undefined)\n\nclass Representer(SafeRepresenter):\n\n    def represent_complex(self, data):\n        if data.imag == 0.0:\n            data = '%r' % data.real\n        elif data.real == 0.0:\n            data = '%rj' % data.imag\n        elif data.imag > 0:\n            data = '%r+%rj' % (data.real, data.imag)\n        else:\n            data = '%r%rj' % (data.real, data.imag)\n        return self.represent_scalar('tag:yaml.org,2002:python/complex', data)\n\n    def represent_tuple(self, data):\n        return self.represent_sequence('tag:yaml.org,2002:python/tuple', data)\n\n    def represent_name(self, data):\n        name = '%s.%s' % (data.__module__, data.__name__)\n        return self.represent_scalar('tag:yaml.org,2002:python/name:'+name, '')\n\n    def represent_module(self, data):\n        return self.represent_scalar(\n                'tag:yaml.org,2002:python/module:'+data.__name__, '')\n\n    def represent_object(self, data):\n        # We use __reduce__ API to save the data. data.__reduce__ returns\n        # a tuple of length 2-5:\n        #   (function, args, state, listitems, dictitems)\n\n        # For reconstructing, we calls function(*args), then set its state,\n        # listitems, and dictitems if they are not None.\n\n        # A special case is when function.__name__ == '__newobj__'. In this\n        # case we create the object with args[0].__new__(*args).\n\n        # Another special case is when __reduce__ returns a string - we don't\n        # support it.\n\n        # We produce a !!python/object, !!python/object/new or\n        # !!python/object/apply node.\n\n        cls = type(data)\n        if cls in copyreg.dispatch_table:\n            reduce = copyreg.dispatch_table[cls](data)\n        elif hasattr(data, '__reduce_ex__'):\n            reduce = data.__reduce_ex__(2)\n        elif hasattr(data, '__reduce__'):\n            reduce = data.__reduce__()\n        else:\n            raise RepresenterError(\"cannot represent object: %r\" % data)\n        reduce = (list(reduce)+[None]*5)[:5]\n        function, args, state, listitems, dictitems = reduce\n        args = list(args)\n        if state is None:\n            state = {}\n        if listitems is not None:\n            listitems = list(listitems)\n        if dictitems is not None:\n            dictitems = dict(dictitems)\n        if function.__name__ == '__newobj__':\n            function = args[0]\n            args = args[1:]\n            tag = 'tag:yaml.org,2002:python/object/new:'\n            newobj = True\n        else:\n            tag = 'tag:yaml.org,2002:python/object/apply:'\n            newobj = False\n        function_name = '%s.%s' % (function.__module__, function.__name__)\n        if not args and not listitems and not dictitems \\\n                and isinstance(state, dict) and newobj:\n            return self.represent_mapping(\n                    'tag:yaml.org,2002:python/object:'+function_name, state)\n        if not listitems and not dictitems  \\\n                and isinstance(state, dict) and not state:\n            return self.represent_sequence(tag+function_name, args)\n        value = {}\n        if args:\n            value['args'] = args\n        if state or not isinstance(state, dict):\n            value['state'] = state\n        if listitems:\n            value['listitems'] = listitems\n        if dictitems:\n            value['dictitems'] = dictitems\n        return self.represent_mapping(tag+function_name, value)\n\n    def represent_ordered_dict(self, data):\n        # Provide uniform representation across different Python versions.\n        data_type = type(data)\n        tag = 'tag:yaml.org,2002:python/object/apply:%s.%s' \\\n                % (data_type.__module__, data_type.__name__)\n        items = [[key, value] for key, value in data.items()]\n        return self.represent_sequence(tag, [items])\n\nRepresenter.add_representer(complex,\n        Representer.represent_complex)\n\nRepresenter.add_representer(tuple,\n        Representer.represent_tuple)\n\nRepresenter.add_representer(type,\n        Representer.represent_name)\n\nRepresenter.add_representer(collections.OrderedDict,\n        Representer.represent_ordered_dict)\n\nRepresenter.add_representer(types.FunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.BuiltinFunctionType,\n        Representer.represent_name)\n\nRepresenter.add_representer(types.ModuleType,\n        Representer.represent_module)\n\nRepresenter.add_multi_representer(object,\n        Representer.represent_object)\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/resolver.py",
    "content": "\n__all__ = ['BaseResolver', 'Resolver']\n\nfrom .error import *\nfrom .nodes import *\n\nimport re\n\nclass ResolverError(YAMLError):\n    pass\n\nclass BaseResolver:\n\n    DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str'\n    DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq'\n    DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map'\n\n    yaml_implicit_resolvers = {}\n    yaml_path_resolvers = {}\n\n    def __init__(self):\n        self.resolver_exact_paths = []\n        self.resolver_prefix_paths = []\n\n    @classmethod\n    def add_implicit_resolver(cls, tag, regexp, first):\n        if not 'yaml_implicit_resolvers' in cls.__dict__:\n            implicit_resolvers = {}\n            for key in cls.yaml_implicit_resolvers:\n                implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:]\n            cls.yaml_implicit_resolvers = implicit_resolvers\n        if first is None:\n            first = [None]\n        for ch in first:\n            cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp))\n\n    @classmethod\n    def add_path_resolver(cls, tag, path, kind=None):\n        # Note: `add_path_resolver` is experimental.  The API could be changed.\n        # `new_path` is a pattern that is matched against the path from the\n        # root to the node that is being considered.  `node_path` elements are\n        # tuples `(node_check, index_check)`.  `node_check` is a node class:\n        # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`.  `None`\n        # matches any kind of a node.  `index_check` could be `None`, a boolean\n        # value, a string value, or a number.  `None` and `False` match against\n        # any _value_ of sequence and mapping nodes.  `True` matches against\n        # any _key_ of a mapping node.  A string `index_check` matches against\n        # a mapping value that corresponds to a scalar key which content is\n        # equal to the `index_check` value.  An integer `index_check` matches\n        # against a sequence value with the index equal to `index_check`.\n        if not 'yaml_path_resolvers' in cls.__dict__:\n            cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy()\n        new_path = []\n        for element in path:\n            if isinstance(element, (list, tuple)):\n                if len(element) == 2:\n                    node_check, index_check = element\n                elif len(element) == 1:\n                    node_check = element[0]\n                    index_check = True\n                else:\n                    raise ResolverError(\"Invalid path element: %s\" % element)\n            else:\n                node_check = None\n                index_check = element\n            if node_check is str:\n                node_check = ScalarNode\n            elif node_check is list:\n                node_check = SequenceNode\n            elif node_check is dict:\n                node_check = MappingNode\n            elif node_check not in [ScalarNode, SequenceNode, MappingNode]  \\\n                    and not isinstance(node_check, str) \\\n                    and node_check is not None:\n                raise ResolverError(\"Invalid node checker: %s\" % node_check)\n            if not isinstance(index_check, (str, int))  \\\n                    and index_check is not None:\n                raise ResolverError(\"Invalid index checker: %s\" % index_check)\n            new_path.append((node_check, index_check))\n        if kind is str:\n            kind = ScalarNode\n        elif kind is list:\n            kind = SequenceNode\n        elif kind is dict:\n            kind = MappingNode\n        elif kind not in [ScalarNode, SequenceNode, MappingNode]    \\\n                and kind is not None:\n            raise ResolverError(\"Invalid node kind: %s\" % kind)\n        cls.yaml_path_resolvers[tuple(new_path), kind] = tag\n\n    def descend_resolver(self, current_node, current_index):\n        if not self.yaml_path_resolvers:\n            return\n        exact_paths = {}\n        prefix_paths = []\n        if current_node:\n            depth = len(self.resolver_prefix_paths)\n            for path, kind in self.resolver_prefix_paths[-1]:\n                if self.check_resolver_prefix(depth, path, kind,\n                        current_node, current_index):\n                    if len(path) > depth:\n                        prefix_paths.append((path, kind))\n                    else:\n                        exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n        else:\n            for path, kind in self.yaml_path_resolvers:\n                if not path:\n                    exact_paths[kind] = self.yaml_path_resolvers[path, kind]\n                else:\n                    prefix_paths.append((path, kind))\n        self.resolver_exact_paths.append(exact_paths)\n        self.resolver_prefix_paths.append(prefix_paths)\n\n    def ascend_resolver(self):\n        if not self.yaml_path_resolvers:\n            return\n        self.resolver_exact_paths.pop()\n        self.resolver_prefix_paths.pop()\n\n    def check_resolver_prefix(self, depth, path, kind,\n            current_node, current_index):\n        node_check, index_check = path[depth-1]\n        if isinstance(node_check, str):\n            if current_node.tag != node_check:\n                return\n        elif node_check is not None:\n            if not isinstance(current_node, node_check):\n                return\n        if index_check is True and current_index is not None:\n            return\n        if (index_check is False or index_check is None)    \\\n                and current_index is None:\n            return\n        if isinstance(index_check, str):\n            if not (isinstance(current_index, ScalarNode)\n                    and index_check == current_index.value):\n                return\n        elif isinstance(index_check, int) and not isinstance(index_check, bool):\n            if index_check != current_index:\n                return\n        return True\n\n    def resolve(self, kind, value, implicit):\n        if kind is ScalarNode and implicit[0]:\n            if value == '':\n                resolvers = self.yaml_implicit_resolvers.get('', [])\n            else:\n                resolvers = self.yaml_implicit_resolvers.get(value[0], [])\n            resolvers += self.yaml_implicit_resolvers.get(None, [])\n            for tag, regexp in resolvers:\n                if regexp.match(value):\n                    return tag\n            implicit = implicit[1]\n        if self.yaml_path_resolvers:\n            exact_paths = self.resolver_exact_paths[-1]\n            if kind in exact_paths:\n                return exact_paths[kind]\n            if None in exact_paths:\n                return exact_paths[None]\n        if kind is ScalarNode:\n            return self.DEFAULT_SCALAR_TAG\n        elif kind is SequenceNode:\n            return self.DEFAULT_SEQUENCE_TAG\n        elif kind is MappingNode:\n            return self.DEFAULT_MAPPING_TAG\n\nclass Resolver(BaseResolver):\n    pass\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:bool',\n        re.compile(r'''^(?:yes|Yes|YES|no|No|NO\n                    |true|True|TRUE|false|False|FALSE\n                    |on|On|ON|off|Off|OFF)$''', re.X),\n        list('yYnNtTfFoO'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:float',\n        re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?\n                    |\\.[0-9_]+(?:[eE][-+][0-9]+)?\n                    |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*\n                    |[-+]?\\.(?:inf|Inf|INF)\n                    |\\.(?:nan|NaN|NAN))$''', re.X),\n        list('-+0123456789.'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:int',\n        re.compile(r'''^(?:[-+]?0b[0-1_]+\n                    |[-+]?0[0-7_]+\n                    |[-+]?(?:0|[1-9][0-9_]*)\n                    |[-+]?0x[0-9a-fA-F_]+\n                    |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X),\n        list('-+0123456789'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:merge',\n        re.compile(r'^(?:<<)$'),\n        ['<'])\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:null',\n        re.compile(r'''^(?: ~\n                    |null|Null|NULL\n                    | )$''', re.X),\n        ['~', 'n', 'N', ''])\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:timestamp',\n        re.compile(r'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\n                    |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]?\n                     (?:[Tt]|[ \\t]+)[0-9][0-9]?\n                     :[0-9][0-9] :[0-9][0-9] (?:\\.[0-9]*)?\n                     (?:[ \\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X),\n        list('0123456789'))\n\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:value',\n        re.compile(r'^(?:=)$'),\n        ['='])\n\n# The following resolver is only for documentation purposes. It cannot work\n# because plain scalars cannot start with '!', '&', or '*'.\nResolver.add_implicit_resolver(\n        'tag:yaml.org,2002:yaml',\n        re.compile(r'^(?:!|&|\\*)$'),\n        list('!&*'))\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/scanner.py",
    "content": "\n# Scanner produces tokens of the following types:\n# STREAM-START\n# STREAM-END\n# DIRECTIVE(name, value)\n# DOCUMENT-START\n# DOCUMENT-END\n# BLOCK-SEQUENCE-START\n# BLOCK-MAPPING-START\n# BLOCK-END\n# FLOW-SEQUENCE-START\n# FLOW-MAPPING-START\n# FLOW-SEQUENCE-END\n# FLOW-MAPPING-END\n# BLOCK-ENTRY\n# FLOW-ENTRY\n# KEY\n# VALUE\n# ALIAS(value)\n# ANCHOR(value)\n# TAG(value)\n# SCALAR(value, plain, style)\n#\n# Read comments in the Scanner code for more details.\n#\n\n__all__ = ['Scanner', 'ScannerError']\n\nfrom .error import MarkedYAMLError\nfrom .tokens import *\n\nclass ScannerError(MarkedYAMLError):\n    pass\n\nclass SimpleKey:\n    # See below simple keys treatment.\n\n    def __init__(self, token_number, required, index, line, column, mark):\n        self.token_number = token_number\n        self.required = required\n        self.index = index\n        self.line = line\n        self.column = column\n        self.mark = mark\n\nclass Scanner:\n\n    def __init__(self):\n        \"\"\"Initialize the scanner.\"\"\"\n        # It is assumed that Scanner and Reader will have a common descendant.\n        # Reader do the dirty work of checking for BOM and converting the\n        # input data to Unicode. It also adds NUL to the end.\n        #\n        # Reader supports the following methods\n        #   self.peek(i=0)       # peek the next i-th character\n        #   self.prefix(l=1)     # peek the next l characters\n        #   self.forward(l=1)    # read the next l characters and move the pointer.\n\n        # Had we reached the end of the stream?\n        self.done = False\n\n        # The number of unclosed '{' and '['. `flow_level == 0` means block\n        # context.\n        self.flow_level = 0\n\n        # List of processed tokens that are not yet emitted.\n        self.tokens = []\n\n        # Add the STREAM-START token.\n        self.fetch_stream_start()\n\n        # Number of tokens that were emitted through the `get_token` method.\n        self.tokens_taken = 0\n\n        # The current indentation level.\n        self.indent = -1\n\n        # Past indentation levels.\n        self.indents = []\n\n        # Variables related to simple keys treatment.\n\n        # A simple key is a key that is not denoted by the '?' indicator.\n        # Example of simple keys:\n        #   ---\n        #   block simple key: value\n        #   ? not a simple key:\n        #   : { flow simple key: value }\n        # We emit the KEY token before all keys, so when we find a potential\n        # simple key, we try to locate the corresponding ':' indicator.\n        # Simple keys should be limited to a single line and 1024 characters.\n\n        # Can a simple key start at the current position? A simple key may\n        # start:\n        # - at the beginning of the line, not counting indentation spaces\n        #       (in block context),\n        # - after '{', '[', ',' (in the flow context),\n        # - after '?', ':', '-' (in the block context).\n        # In the block context, this flag also signifies if a block collection\n        # may start at the current position.\n        self.allow_simple_key = True\n\n        # Keep track of possible simple keys. This is a dictionary. The key\n        # is `flow_level`; there can be no more that one possible simple key\n        # for each level. The value is a SimpleKey record:\n        #   (token_number, required, index, line, column, mark)\n        # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow),\n        # '[', or '{' tokens.\n        self.possible_simple_keys = {}\n\n    # Public methods.\n\n    def check_token(self, *choices):\n        # Check if the next token is one of the given types.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            if not choices:\n                return True\n            for choice in choices:\n                if isinstance(self.tokens[0], choice):\n                    return True\n        return False\n\n    def peek_token(self):\n        # Return the next token, but do not delete if from the queue.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            return self.tokens[0]\n\n    def get_token(self):\n        # Return the next token.\n        while self.need_more_tokens():\n            self.fetch_more_tokens()\n        if self.tokens:\n            self.tokens_taken += 1\n            return self.tokens.pop(0)\n\n    # Private methods.\n\n    def need_more_tokens(self):\n        if self.done:\n            return False\n        if not self.tokens:\n            return True\n        # The current token may be a potential simple key, so we\n        # need to look further.\n        self.stale_possible_simple_keys()\n        if self.next_possible_simple_key() == self.tokens_taken:\n            return True\n\n    def fetch_more_tokens(self):\n\n        # Eat whitespaces and comments until we reach the next token.\n        self.scan_to_next_token()\n\n        # Remove obsolete possible simple keys.\n        self.stale_possible_simple_keys()\n\n        # Compare the current indentation and column. It may add some tokens\n        # and decrease the current indentation level.\n        self.unwind_indent(self.column)\n\n        # Peek the next character.\n        ch = self.peek()\n\n        # Is it the end of stream?\n        if ch == '\\0':\n            return self.fetch_stream_end()\n\n        # Is it a directive?\n        if ch == '%' and self.check_directive():\n            return self.fetch_directive()\n\n        # Is it the document start?\n        if ch == '-' and self.check_document_start():\n            return self.fetch_document_start()\n\n        # Is it the document end?\n        if ch == '.' and self.check_document_end():\n            return self.fetch_document_end()\n\n        # TODO: support for BOM within a stream.\n        #if ch == '\\uFEFF':\n        #    return self.fetch_bom()    <-- issue BOMToken\n\n        # Note: the order of the following checks is NOT significant.\n\n        # Is it the flow sequence start indicator?\n        if ch == '[':\n            return self.fetch_flow_sequence_start()\n\n        # Is it the flow mapping start indicator?\n        if ch == '{':\n            return self.fetch_flow_mapping_start()\n\n        # Is it the flow sequence end indicator?\n        if ch == ']':\n            return self.fetch_flow_sequence_end()\n\n        # Is it the flow mapping end indicator?\n        if ch == '}':\n            return self.fetch_flow_mapping_end()\n\n        # Is it the flow entry indicator?\n        if ch == ',':\n            return self.fetch_flow_entry()\n\n        # Is it the block entry indicator?\n        if ch == '-' and self.check_block_entry():\n            return self.fetch_block_entry()\n\n        # Is it the key indicator?\n        if ch == '?' and self.check_key():\n            return self.fetch_key()\n\n        # Is it the value indicator?\n        if ch == ':' and self.check_value():\n            return self.fetch_value()\n\n        # Is it an alias?\n        if ch == '*':\n            return self.fetch_alias()\n\n        # Is it an anchor?\n        if ch == '&':\n            return self.fetch_anchor()\n\n        # Is it a tag?\n        if ch == '!':\n            return self.fetch_tag()\n\n        # Is it a literal scalar?\n        if ch == '|' and not self.flow_level:\n            return self.fetch_literal()\n\n        # Is it a folded scalar?\n        if ch == '>' and not self.flow_level:\n            return self.fetch_folded()\n\n        # Is it a single quoted scalar?\n        if ch == '\\'':\n            return self.fetch_single()\n\n        # Is it a double quoted scalar?\n        if ch == '\\\"':\n            return self.fetch_double()\n\n        # It must be a plain scalar then.\n        if self.check_plain():\n            return self.fetch_plain()\n\n        # No? It's an error. Let's produce a nice error message.\n        raise ScannerError(\"while scanning for the next token\", None,\n                \"found character %r that cannot start any token\" % ch,\n                self.get_mark())\n\n    # Simple keys treatment.\n\n    def next_possible_simple_key(self):\n        # Return the number of the nearest possible simple key. Actually we\n        # don't need to loop through the whole dictionary. We may replace it\n        # with the following code:\n        #   if not self.possible_simple_keys:\n        #       return None\n        #   return self.possible_simple_keys[\n        #           min(self.possible_simple_keys.keys())].token_number\n        min_token_number = None\n        for level in self.possible_simple_keys:\n            key = self.possible_simple_keys[level]\n            if min_token_number is None or key.token_number < min_token_number:\n                min_token_number = key.token_number\n        return min_token_number\n\n    def stale_possible_simple_keys(self):\n        # Remove entries that are no longer possible simple keys. According to\n        # the YAML specification, simple keys\n        # - should be limited to a single line,\n        # - should be no longer than 1024 characters.\n        # Disabling this procedure will allow simple keys of any length and\n        # height (may cause problems if indentation is broken though).\n        for level in list(self.possible_simple_keys):\n            key = self.possible_simple_keys[level]\n            if key.line != self.line  \\\n                    or self.index-key.index > 1024:\n                if key.required:\n                    raise ScannerError(\"while scanning a simple key\", key.mark,\n                            \"could not find expected ':'\", self.get_mark())\n                del self.possible_simple_keys[level]\n\n    def save_possible_simple_key(self):\n        # The next token may start a simple key. We check if it's possible\n        # and save its position. This function is called for\n        #   ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'.\n\n        # Check if a simple key is required at the current position.\n        required = not self.flow_level and self.indent == self.column\n\n        # The next token might be a simple key. Let's save it's number and\n        # position.\n        if self.allow_simple_key:\n            self.remove_possible_simple_key()\n            token_number = self.tokens_taken+len(self.tokens)\n            key = SimpleKey(token_number, required,\n                    self.index, self.line, self.column, self.get_mark())\n            self.possible_simple_keys[self.flow_level] = key\n\n    def remove_possible_simple_key(self):\n        # Remove the saved possible key position at the current flow level.\n        if self.flow_level in self.possible_simple_keys:\n            key = self.possible_simple_keys[self.flow_level]\n            \n            if key.required:\n                raise ScannerError(\"while scanning a simple key\", key.mark,\n                        \"could not find expected ':'\", self.get_mark())\n\n            del self.possible_simple_keys[self.flow_level]\n\n    # Indentation functions.\n\n    def unwind_indent(self, column):\n\n        ## In flow context, tokens should respect indentation.\n        ## Actually the condition should be `self.indent >= column` according to\n        ## the spec. But this condition will prohibit intuitively correct\n        ## constructions such as\n        ## key : {\n        ## }\n        #if self.flow_level and self.indent > column:\n        #    raise ScannerError(None, None,\n        #            \"invalid intendation or unclosed '[' or '{'\",\n        #            self.get_mark())\n\n        # In the flow context, indentation is ignored. We make the scanner less\n        # restrictive then specification requires.\n        if self.flow_level:\n            return\n\n        # In block context, we may need to issue the BLOCK-END tokens.\n        while self.indent > column:\n            mark = self.get_mark()\n            self.indent = self.indents.pop()\n            self.tokens.append(BlockEndToken(mark, mark))\n\n    def add_indent(self, column):\n        # Check if we need to increase indentation.\n        if self.indent < column:\n            self.indents.append(self.indent)\n            self.indent = column\n            return True\n        return False\n\n    # Fetchers.\n\n    def fetch_stream_start(self):\n        # We always add STREAM-START as the first token and STREAM-END as the\n        # last token.\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-START.\n        self.tokens.append(StreamStartToken(mark, mark,\n            encoding=self.encoding))\n        \n\n    def fetch_stream_end(self):\n\n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n        self.possible_simple_keys = {}\n\n        # Read the token.\n        mark = self.get_mark()\n        \n        # Add STREAM-END.\n        self.tokens.append(StreamEndToken(mark, mark))\n\n        # The steam is finished.\n        self.done = True\n\n    def fetch_directive(self):\n        \n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Scan and add DIRECTIVE.\n        self.tokens.append(self.scan_directive())\n\n    def fetch_document_start(self):\n        self.fetch_document_indicator(DocumentStartToken)\n\n    def fetch_document_end(self):\n        self.fetch_document_indicator(DocumentEndToken)\n\n    def fetch_document_indicator(self, TokenClass):\n\n        # Set the current intendation to -1.\n        self.unwind_indent(-1)\n\n        # Reset simple keys. Note that there could not be a block collection\n        # after '---'.\n        self.remove_possible_simple_key()\n        self.allow_simple_key = False\n\n        # Add DOCUMENT-START or DOCUMENT-END.\n        start_mark = self.get_mark()\n        self.forward(3)\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_start(self):\n        self.fetch_flow_collection_start(FlowSequenceStartToken)\n\n    def fetch_flow_mapping_start(self):\n        self.fetch_flow_collection_start(FlowMappingStartToken)\n\n    def fetch_flow_collection_start(self, TokenClass):\n\n        # '[' and '{' may start a simple key.\n        self.save_possible_simple_key()\n\n        # Increase the flow level.\n        self.flow_level += 1\n\n        # Simple keys are allowed after '[' and '{'.\n        self.allow_simple_key = True\n\n        # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_sequence_end(self):\n        self.fetch_flow_collection_end(FlowSequenceEndToken)\n\n    def fetch_flow_mapping_end(self):\n        self.fetch_flow_collection_end(FlowMappingEndToken)\n\n    def fetch_flow_collection_end(self, TokenClass):\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Decrease the flow level.\n        self.flow_level -= 1\n\n        # No simple keys after ']' or '}'.\n        self.allow_simple_key = False\n\n        # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(TokenClass(start_mark, end_mark))\n\n    def fetch_flow_entry(self):\n\n        # Simple keys are allowed after ','.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add FLOW-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(FlowEntryToken(start_mark, end_mark))\n\n    def fetch_block_entry(self):\n\n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a new entry?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"sequence entries are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-SEQUENCE-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockSequenceStartToken(mark, mark))\n\n        # It's an error for the block entry to occur in the flow context,\n        # but we let the parser detect this.\n        else:\n            pass\n\n        # Simple keys are allowed after '-'.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add BLOCK-ENTRY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(BlockEntryToken(start_mark, end_mark))\n\n    def fetch_key(self):\n        \n        # Block context needs additional checks.\n        if not self.flow_level:\n\n            # Are we allowed to start a key (not nessesary a simple)?\n            if not self.allow_simple_key:\n                raise ScannerError(None, None,\n                        \"mapping keys are not allowed here\",\n                        self.get_mark())\n\n            # We may need to add BLOCK-MAPPING-START.\n            if self.add_indent(self.column):\n                mark = self.get_mark()\n                self.tokens.append(BlockMappingStartToken(mark, mark))\n\n        # Simple keys are allowed after '?' in the block context.\n        self.allow_simple_key = not self.flow_level\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Add KEY.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(KeyToken(start_mark, end_mark))\n\n    def fetch_value(self):\n\n        # Do we determine a simple key?\n        if self.flow_level in self.possible_simple_keys:\n\n            # Add KEY.\n            key = self.possible_simple_keys[self.flow_level]\n            del self.possible_simple_keys[self.flow_level]\n            self.tokens.insert(key.token_number-self.tokens_taken,\n                    KeyToken(key.mark, key.mark))\n\n            # If this key starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.\n            if not self.flow_level:\n                if self.add_indent(key.column):\n                    self.tokens.insert(key.token_number-self.tokens_taken,\n                            BlockMappingStartToken(key.mark, key.mark))\n\n            # There cannot be two simple keys one after another.\n            self.allow_simple_key = False\n\n        # It must be a part of a complex key.\n        else:\n            \n            # Block context needs additional checks.\n            # (Do we really need them? They will be catched by the parser\n            # anyway.)\n            if not self.flow_level:\n\n                # We are allowed to start a complex value if and only if\n                # we can start a simple key.\n                if not self.allow_simple_key:\n                    raise ScannerError(None, None,\n                            \"mapping values are not allowed here\",\n                            self.get_mark())\n\n            # If this value starts a new block mapping, we need to add\n            # BLOCK-MAPPING-START.  It will be detected as an error later by\n            # the parser.\n            if not self.flow_level:\n                if self.add_indent(self.column):\n                    mark = self.get_mark()\n                    self.tokens.append(BlockMappingStartToken(mark, mark))\n\n            # Simple keys are allowed after ':' in the block context.\n            self.allow_simple_key = not self.flow_level\n\n            # Reset possible simple key on the current level.\n            self.remove_possible_simple_key()\n\n        # Add VALUE.\n        start_mark = self.get_mark()\n        self.forward()\n        end_mark = self.get_mark()\n        self.tokens.append(ValueToken(start_mark, end_mark))\n\n    def fetch_alias(self):\n\n        # ALIAS could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ALIAS.\n        self.allow_simple_key = False\n\n        # Scan and add ALIAS.\n        self.tokens.append(self.scan_anchor(AliasToken))\n\n    def fetch_anchor(self):\n\n        # ANCHOR could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after ANCHOR.\n        self.allow_simple_key = False\n\n        # Scan and add ANCHOR.\n        self.tokens.append(self.scan_anchor(AnchorToken))\n\n    def fetch_tag(self):\n\n        # TAG could start a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after TAG.\n        self.allow_simple_key = False\n\n        # Scan and add TAG.\n        self.tokens.append(self.scan_tag())\n\n    def fetch_literal(self):\n        self.fetch_block_scalar(style='|')\n\n    def fetch_folded(self):\n        self.fetch_block_scalar(style='>')\n\n    def fetch_block_scalar(self, style):\n\n        # A simple key may follow a block scalar.\n        self.allow_simple_key = True\n\n        # Reset possible simple key on the current level.\n        self.remove_possible_simple_key()\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_block_scalar(style))\n\n    def fetch_single(self):\n        self.fetch_flow_scalar(style='\\'')\n\n    def fetch_double(self):\n        self.fetch_flow_scalar(style='\"')\n\n    def fetch_flow_scalar(self, style):\n\n        # A flow scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after flow scalars.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR.\n        self.tokens.append(self.scan_flow_scalar(style))\n\n    def fetch_plain(self):\n\n        # A plain scalar could be a simple key.\n        self.save_possible_simple_key()\n\n        # No simple keys after plain scalars. But note that `scan_plain` will\n        # change this flag if the scan is finished at the beginning of the\n        # line.\n        self.allow_simple_key = False\n\n        # Scan and add SCALAR. May change `allow_simple_key`.\n        self.tokens.append(self.scan_plain())\n\n    # Checkers.\n\n    def check_directive(self):\n\n        # DIRECTIVE:        ^ '%' ...\n        # The '%' indicator is already checked.\n        if self.column == 0:\n            return True\n\n    def check_document_start(self):\n\n        # DOCUMENT-START:   ^ '---' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == '---'  \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_document_end(self):\n\n        # DOCUMENT-END:     ^ '...' (' '|'\\n')\n        if self.column == 0:\n            if self.prefix(3) == '...'  \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return True\n\n    def check_block_entry(self):\n\n        # BLOCK-ENTRY:      '-' (' '|'\\n')\n        return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_key(self):\n\n        # KEY(flow context):    '?'\n        if self.flow_level:\n            return True\n\n        # KEY(block context):   '?' (' '|'\\n')\n        else:\n            return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_value(self):\n\n        # VALUE(flow context):  ':'\n        if self.flow_level:\n            return True\n\n        # VALUE(block context): ':' (' '|'\\n')\n        else:\n            return self.peek(1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n\n    def check_plain(self):\n\n        # A plain scalar may start with any non-space character except:\n        #   '-', '?', ':', ',', '[', ']', '{', '}',\n        #   '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n        #   '%', '@', '`'.\n        #\n        # It may also start with\n        #   '-', '?', ':'\n        # if it is followed by a non-space character.\n        #\n        # Note that we limit the last rule to the block context (except the\n        # '-' character) because we want the flow context to be space\n        # independent.\n        ch = self.peek()\n        return ch not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029-?:,[]{}#&*!|>\\'\\\"%@`'  \\\n                or (self.peek(1) not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'\n                        and (ch == '-' or (not self.flow_level and ch in '?:')))\n\n    # Scanners.\n\n    def scan_to_next_token(self):\n        # We ignore spaces, line breaks and comments.\n        # If we find a line break in the block context, we set the flag\n        # `allow_simple_key` on.\n        # The byte order mark is stripped if it's the first character in the\n        # stream. We do not yet support BOM inside the stream as the\n        # specification requires. Any such mark will be considered as a part\n        # of the document.\n        #\n        # TODO: We need to make tab handling rules more sane. A good rule is\n        #   Tabs cannot precede tokens\n        #   BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END,\n        #   KEY(block), VALUE(block), BLOCK-ENTRY\n        # So the checking code is\n        #   if <TAB>:\n        #       self.allow_simple_keys = False\n        # We also need to add the check for `allow_simple_keys == True` to\n        # `unwind_indent` before issuing BLOCK-END.\n        # Scanners for block, flow, and plain scalars need to be modified.\n\n        if self.index == 0 and self.peek() == '\\uFEFF':\n            self.forward()\n        found = False\n        while not found:\n            while self.peek() == ' ':\n                self.forward()\n            if self.peek() == '#':\n                while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                    self.forward()\n            if self.scan_line_break():\n                if not self.flow_level:\n                    self.allow_simple_key = True\n            else:\n                found = True\n\n    def scan_directive(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        self.forward()\n        name = self.scan_directive_name(start_mark)\n        value = None\n        if name == 'YAML':\n            value = self.scan_yaml_directive_value(start_mark)\n            end_mark = self.get_mark()\n        elif name == 'TAG':\n            value = self.scan_tag_directive_value(start_mark)\n            end_mark = self.get_mark()\n        else:\n            end_mark = self.get_mark()\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        self.scan_directive_ignored_line(start_mark)\n        return DirectiveToken(name, value, start_mark, end_mark)\n\n    def scan_directive_name(self, start_mark):\n        # See the specification for details.\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        return value\n\n    def scan_yaml_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        major = self.scan_yaml_directive_number(start_mark)\n        if self.peek() != '.':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or '.', but found %r\" % self.peek(),\n                    self.get_mark())\n        self.forward()\n        minor = self.scan_yaml_directive_number(start_mark)\n        if self.peek() not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit or ' ', but found %r\" % self.peek(),\n                    self.get_mark())\n        return (major, minor)\n\n    def scan_yaml_directive_number(self, start_mark):\n        # See the specification for details.\n        ch = self.peek()\n        if not ('0' <= ch <= '9'):\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a digit, but found %r\" % ch, self.get_mark())\n        length = 0\n        while '0' <= self.peek(length) <= '9':\n            length += 1\n        value = int(self.prefix(length))\n        self.forward(length)\n        return value\n\n    def scan_tag_directive_value(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        handle = self.scan_tag_directive_handle(start_mark)\n        while self.peek() == ' ':\n            self.forward()\n        prefix = self.scan_tag_directive_prefix(start_mark)\n        return (handle, prefix)\n\n    def scan_tag_directive_handle(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_handle('directive', start_mark)\n        ch = self.peek()\n        if ch != ' ':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        return value\n\n    def scan_tag_directive_prefix(self, start_mark):\n        # See the specification for details.\n        value = self.scan_tag_uri('directive', start_mark)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        return value\n\n    def scan_directive_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        if self.peek() == '#':\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a directive\", start_mark,\n                    \"expected a comment or a line break, but found %r\"\n                        % ch, self.get_mark())\n        self.scan_line_break()\n\n    def scan_anchor(self, TokenClass):\n        # The specification does not restrict characters for anchors and\n        # aliases. This may lead to problems, for instance, the document:\n        #   [ *alias, value ]\n        # can be interpteted in two ways, as\n        #   [ \"value\" ]\n        # and\n        #   [ *alias , \"value\" ]\n        # Therefore we restrict aliases to numbers and ASCII letters.\n        start_mark = self.get_mark()\n        indicator = self.peek()\n        if indicator == '*':\n            name = 'alias'\n        else:\n            name = 'anchor'\n        self.forward()\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-_':\n            length += 1\n            ch = self.peek(length)\n        if not length:\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        value = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029?:,]}%@`':\n            raise ScannerError(\"while scanning an %s\" % name, start_mark,\n                    \"expected alphabetic or numeric character, but found %r\"\n                    % ch, self.get_mark())\n        end_mark = self.get_mark()\n        return TokenClass(value, start_mark, end_mark)\n\n    def scan_tag(self):\n        # See the specification for details.\n        start_mark = self.get_mark()\n        ch = self.peek(1)\n        if ch == '<':\n            handle = None\n            self.forward(2)\n            suffix = self.scan_tag_uri('tag', start_mark)\n            if self.peek() != '>':\n                raise ScannerError(\"while parsing a tag\", start_mark,\n                        \"expected '>', but found %r\" % self.peek(),\n                        self.get_mark())\n            self.forward()\n        elif ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n            handle = None\n            suffix = '!'\n            self.forward()\n        else:\n            length = 1\n            use_handle = False\n            while ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n                if ch == '!':\n                    use_handle = True\n                    break\n                length += 1\n                ch = self.peek(length)\n            handle = '!'\n            if use_handle:\n                handle = self.scan_tag_handle('tag', start_mark)\n            else:\n                handle = '!'\n                self.forward()\n            suffix = self.scan_tag_uri('tag', start_mark)\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a tag\", start_mark,\n                    \"expected ' ', but found %r\" % ch, self.get_mark())\n        value = (handle, suffix)\n        end_mark = self.get_mark()\n        return TagToken(value, start_mark, end_mark)\n\n    def scan_block_scalar(self, style):\n        # See the specification for details.\n\n        if style == '>':\n            folded = True\n        else:\n            folded = False\n\n        chunks = []\n        start_mark = self.get_mark()\n\n        # Scan the header.\n        self.forward()\n        chomping, increment = self.scan_block_scalar_indicators(start_mark)\n        self.scan_block_scalar_ignored_line(start_mark)\n\n        # Determine the indentation level and go to the first non-empty line.\n        min_indent = self.indent+1\n        if min_indent < 1:\n            min_indent = 1\n        if increment is None:\n            breaks, max_indent, end_mark = self.scan_block_scalar_indentation()\n            indent = max(min_indent, max_indent)\n        else:\n            indent = min_indent+increment-1\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n        line_break = ''\n\n        # Scan the inner part of the block scalar.\n        while self.column == indent and self.peek() != '\\0':\n            chunks.extend(breaks)\n            leading_non_space = self.peek() not in ' \\t'\n            length = 0\n            while self.peek(length) not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            line_break = self.scan_line_break()\n            breaks, end_mark = self.scan_block_scalar_breaks(indent)\n            if self.column == indent and self.peek() != '\\0':\n\n                # Unfortunately, folding rules are ambiguous.\n                #\n                # This is the folding according to the specification:\n                \n                if folded and line_break == '\\n'    \\\n                        and leading_non_space and self.peek() not in ' \\t':\n                    if not breaks:\n                        chunks.append(' ')\n                else:\n                    chunks.append(line_break)\n                \n                # This is Clark Evans's interpretation (also in the spec\n                # examples):\n                #\n                #if folded and line_break == '\\n':\n                #    if not breaks:\n                #        if self.peek() not in ' \\t':\n                #            chunks.append(' ')\n                #        else:\n                #            chunks.append(line_break)\n                #else:\n                #    chunks.append(line_break)\n            else:\n                break\n\n        # Chomp the tail.\n        if chomping is not False:\n            chunks.append(line_break)\n        if chomping is True:\n            chunks.extend(breaks)\n\n        # We are done.\n        return ScalarToken(''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    def scan_block_scalar_indicators(self, start_mark):\n        # See the specification for details.\n        chomping = None\n        increment = None\n        ch = self.peek()\n        if ch in '+-':\n            if ch == '+':\n                chomping = True\n            else:\n                chomping = False\n            self.forward()\n            ch = self.peek()\n            if ch in '0123456789':\n                increment = int(ch)\n                if increment == 0:\n                    raise ScannerError(\"while scanning a block scalar\", start_mark,\n                            \"expected indentation indicator in the range 1-9, but found 0\",\n                            self.get_mark())\n                self.forward()\n        elif ch in '0123456789':\n            increment = int(ch)\n            if increment == 0:\n                raise ScannerError(\"while scanning a block scalar\", start_mark,\n                        \"expected indentation indicator in the range 1-9, but found 0\",\n                        self.get_mark())\n            self.forward()\n            ch = self.peek()\n            if ch in '+-':\n                if ch == '+':\n                    chomping = True\n                else:\n                    chomping = False\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0 \\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected chomping or indentation indicators, but found %r\"\n                    % ch, self.get_mark())\n        return chomping, increment\n\n    def scan_block_scalar_ignored_line(self, start_mark):\n        # See the specification for details.\n        while self.peek() == ' ':\n            self.forward()\n        if self.peek() == '#':\n            while self.peek() not in '\\0\\r\\n\\x85\\u2028\\u2029':\n                self.forward()\n        ch = self.peek()\n        if ch not in '\\0\\r\\n\\x85\\u2028\\u2029':\n            raise ScannerError(\"while scanning a block scalar\", start_mark,\n                    \"expected a comment or a line break, but found %r\" % ch,\n                    self.get_mark())\n        self.scan_line_break()\n\n    def scan_block_scalar_indentation(self):\n        # See the specification for details.\n        chunks = []\n        max_indent = 0\n        end_mark = self.get_mark()\n        while self.peek() in ' \\r\\n\\x85\\u2028\\u2029':\n            if self.peek() != ' ':\n                chunks.append(self.scan_line_break())\n                end_mark = self.get_mark()\n            else:\n                self.forward()\n                if self.column > max_indent:\n                    max_indent = self.column\n        return chunks, max_indent, end_mark\n\n    def scan_block_scalar_breaks(self, indent):\n        # See the specification for details.\n        chunks = []\n        end_mark = self.get_mark()\n        while self.column < indent and self.peek() == ' ':\n            self.forward()\n        while self.peek() in '\\r\\n\\x85\\u2028\\u2029':\n            chunks.append(self.scan_line_break())\n            end_mark = self.get_mark()\n            while self.column < indent and self.peek() == ' ':\n                self.forward()\n        return chunks, end_mark\n\n    def scan_flow_scalar(self, style):\n        # See the specification for details.\n        # Note that we loose indentation rules for quoted scalars. Quoted\n        # scalars don't need to adhere indentation because \" and ' clearly\n        # mark the beginning and the end of them. Therefore we are less\n        # restrictive then the specification requires. We only need to check\n        # that document separators are not included in scalars.\n        if style == '\"':\n            double = True\n        else:\n            double = False\n        chunks = []\n        start_mark = self.get_mark()\n        quote = self.peek()\n        self.forward()\n        chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        while self.peek() != quote:\n            chunks.extend(self.scan_flow_scalar_spaces(double, start_mark))\n            chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))\n        self.forward()\n        end_mark = self.get_mark()\n        return ScalarToken(''.join(chunks), False, start_mark, end_mark,\n                style)\n\n    ESCAPE_REPLACEMENTS = {\n        '0':    '\\0',\n        'a':    '\\x07',\n        'b':    '\\x08',\n        't':    '\\x09',\n        '\\t':   '\\x09',\n        'n':    '\\x0A',\n        'v':    '\\x0B',\n        'f':    '\\x0C',\n        'r':    '\\x0D',\n        'e':    '\\x1B',\n        ' ':    '\\x20',\n        '\\\"':   '\\\"',\n        '\\\\':   '\\\\',\n        'N':    '\\x85',\n        '_':    '\\xA0',\n        'L':    '\\u2028',\n        'P':    '\\u2029',\n    }\n\n    ESCAPE_CODES = {\n        'x':    2,\n        'u':    4,\n        'U':    8,\n    }\n\n    def scan_flow_scalar_non_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            length = 0\n            while self.peek(length) not in '\\'\\\"\\\\\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                length += 1\n            if length:\n                chunks.append(self.prefix(length))\n                self.forward(length)\n            ch = self.peek()\n            if not double and ch == '\\'' and self.peek(1) == '\\'':\n                chunks.append('\\'')\n                self.forward(2)\n            elif (double and ch == '\\'') or (not double and ch in '\\\"\\\\'):\n                chunks.append(ch)\n                self.forward()\n            elif double and ch == '\\\\':\n                self.forward()\n                ch = self.peek()\n                if ch in self.ESCAPE_REPLACEMENTS:\n                    chunks.append(self.ESCAPE_REPLACEMENTS[ch])\n                    self.forward()\n                elif ch in self.ESCAPE_CODES:\n                    length = self.ESCAPE_CODES[ch]\n                    self.forward()\n                    for k in range(length):\n                        if self.peek(k) not in '0123456789ABCDEFabcdef':\n                            raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                                    \"expected escape sequence of %d hexdecimal numbers, but found %r\" %\n                                        (length, self.peek(k)), self.get_mark())\n                    code = int(self.prefix(length), 16)\n                    chunks.append(chr(code))\n                    self.forward(length)\n                elif ch in '\\r\\n\\x85\\u2028\\u2029':\n                    self.scan_line_break()\n                    chunks.extend(self.scan_flow_scalar_breaks(double, start_mark))\n                else:\n                    raise ScannerError(\"while scanning a double-quoted scalar\", start_mark,\n                            \"found unknown escape character %r\" % ch, self.get_mark())\n            else:\n                return chunks\n\n    def scan_flow_scalar_spaces(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        length = 0\n        while self.peek(length) in ' \\t':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch == '\\0':\n            raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                    \"found unexpected end of stream\", self.get_mark())\n        elif ch in '\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            breaks = self.scan_flow_scalar_breaks(double, start_mark)\n            if line_break != '\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(' ')\n            chunks.extend(breaks)\n        else:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_flow_scalar_breaks(self, double, start_mark):\n        # See the specification for details.\n        chunks = []\n        while True:\n            # Instead of checking indentation, we check for document\n            # separators.\n            prefix = self.prefix(3)\n            if (prefix == '---' or prefix == '...')   \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                raise ScannerError(\"while scanning a quoted scalar\", start_mark,\n                        \"found unexpected document separator\", self.get_mark())\n            while self.peek() in ' \\t':\n                self.forward()\n            if self.peek() in '\\r\\n\\x85\\u2028\\u2029':\n                chunks.append(self.scan_line_break())\n            else:\n                return chunks\n\n    def scan_plain(self):\n        # See the specification for details.\n        # We add an additional restriction for the flow context:\n        #   plain scalars in the flow context cannot contain ',', ':' and '?'.\n        # We also keep track of the `allow_simple_key` flag here.\n        # Indentation rules are loosed for the flow context.\n        chunks = []\n        start_mark = self.get_mark()\n        end_mark = start_mark\n        indent = self.indent+1\n        # We allow zero indentation for scalars, but then we need to check for\n        # document separators at the beginning of the line.\n        #if indent == 0:\n        #    indent = 1\n        spaces = []\n        while True:\n            length = 0\n            if self.peek() == '#':\n                break\n            while True:\n                ch = self.peek(length)\n                if ch in '\\0 \\t\\r\\n\\x85\\u2028\\u2029'    \\\n                        or (not self.flow_level and ch == ':' and\n                                self.peek(length+1) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029') \\\n                        or (self.flow_level and ch in ',:?[]{}'):\n                    break\n                length += 1\n            # It's not clear what we should do with ':' in the flow context.\n            if (self.flow_level and ch == ':'\n                    and self.peek(length+1) not in '\\0 \\t\\r\\n\\x85\\u2028\\u2029,[]{}'):\n                self.forward(length)\n                raise ScannerError(\"while scanning a plain scalar\", start_mark,\n                    \"found unexpected ':'\", self.get_mark(),\n                    \"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.\")\n            if length == 0:\n                break\n            self.allow_simple_key = False\n            chunks.extend(spaces)\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            end_mark = self.get_mark()\n            spaces = self.scan_plain_spaces(indent, start_mark)\n            if not spaces or self.peek() == '#' \\\n                    or (not self.flow_level and self.column < indent):\n                break\n        return ScalarToken(''.join(chunks), True, start_mark, end_mark)\n\n    def scan_plain_spaces(self, indent, start_mark):\n        # See the specification for details.\n        # The specification is really confusing about tabs in plain scalars.\n        # We just forbid them completely. Do not use tabs in YAML!\n        chunks = []\n        length = 0\n        while self.peek(length) in ' ':\n            length += 1\n        whitespaces = self.prefix(length)\n        self.forward(length)\n        ch = self.peek()\n        if ch in '\\r\\n\\x85\\u2028\\u2029':\n            line_break = self.scan_line_break()\n            self.allow_simple_key = True\n            prefix = self.prefix(3)\n            if (prefix == '---' or prefix == '...')   \\\n                    and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                return\n            breaks = []\n            while self.peek() in ' \\r\\n\\x85\\u2028\\u2029':\n                if self.peek() == ' ':\n                    self.forward()\n                else:\n                    breaks.append(self.scan_line_break())\n                    prefix = self.prefix(3)\n                    if (prefix == '---' or prefix == '...')   \\\n                            and self.peek(3) in '\\0 \\t\\r\\n\\x85\\u2028\\u2029':\n                        return\n            if line_break != '\\n':\n                chunks.append(line_break)\n            elif not breaks:\n                chunks.append(' ')\n            chunks.extend(breaks)\n        elif whitespaces:\n            chunks.append(whitespaces)\n        return chunks\n\n    def scan_tag_handle(self, name, start_mark):\n        # See the specification for details.\n        # For some strange reasons, the specification does not allow '_' in\n        # tag handles. I have allowed it anyway.\n        ch = self.peek()\n        if ch != '!':\n            raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                    \"expected '!', but found %r\" % ch, self.get_mark())\n        length = 1\n        ch = self.peek(length)\n        if ch != ' ':\n            while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                    or ch in '-_':\n                length += 1\n                ch = self.peek(length)\n            if ch != '!':\n                self.forward(length)\n                raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                        \"expected '!', but found %r\" % ch, self.get_mark())\n            length += 1\n        value = self.prefix(length)\n        self.forward(length)\n        return value\n\n    def scan_tag_uri(self, name, start_mark):\n        # See the specification for details.\n        # Note: we do not check if URI is well-formed.\n        chunks = []\n        length = 0\n        ch = self.peek(length)\n        while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z'  \\\n                or ch in '-;/?:@&=+$,_.!~*\\'()[]%':\n            if ch == '%':\n                chunks.append(self.prefix(length))\n                self.forward(length)\n                length = 0\n                chunks.append(self.scan_uri_escapes(name, start_mark))\n            else:\n                length += 1\n            ch = self.peek(length)\n        if length:\n            chunks.append(self.prefix(length))\n            self.forward(length)\n            length = 0\n        if not chunks:\n            raise ScannerError(\"while parsing a %s\" % name, start_mark,\n                    \"expected URI, but found %r\" % ch, self.get_mark())\n        return ''.join(chunks)\n\n    def scan_uri_escapes(self, name, start_mark):\n        # See the specification for details.\n        codes = []\n        mark = self.get_mark()\n        while self.peek() == '%':\n            self.forward()\n            for k in range(2):\n                if self.peek(k) not in '0123456789ABCDEFabcdef':\n                    raise ScannerError(\"while scanning a %s\" % name, start_mark,\n                            \"expected URI escape sequence of 2 hexdecimal numbers, but found %r\"\n                            % self.peek(k), self.get_mark())\n            codes.append(int(self.prefix(2), 16))\n            self.forward(2)\n        try:\n            value = bytes(codes).decode('utf-8')\n        except UnicodeDecodeError as exc:\n            raise ScannerError(\"while scanning a %s\" % name, start_mark, str(exc), mark)\n        return value\n\n    def scan_line_break(self):\n        # Transforms:\n        #   '\\r\\n'      :   '\\n'\n        #   '\\r'        :   '\\n'\n        #   '\\n'        :   '\\n'\n        #   '\\x85'      :   '\\n'\n        #   '\\u2028'    :   '\\u2028'\n        #   '\\u2029     :   '\\u2029'\n        #   default     :   ''\n        ch = self.peek()\n        if ch in '\\r\\n\\x85':\n            if self.prefix(2) == '\\r\\n':\n                self.forward(2)\n            else:\n                self.forward()\n            return '\\n'\n        elif ch in '\\u2028\\u2029':\n            self.forward()\n            return ch\n        return ''\n\n#try:\n#    import psyco\n#    psyco.bind(Scanner)\n#except ImportError:\n#    pass\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/serializer.py",
    "content": "\n__all__ = ['Serializer', 'SerializerError']\n\nfrom .error import YAMLError\nfrom .events import *\nfrom .nodes import *\n\nclass SerializerError(YAMLError):\n    pass\n\nclass Serializer:\n\n    ANCHOR_TEMPLATE = 'id%03d'\n\n    def __init__(self, encoding=None,\n            explicit_start=None, explicit_end=None, version=None, tags=None):\n        self.use_encoding = encoding\n        self.use_explicit_start = explicit_start\n        self.use_explicit_end = explicit_end\n        self.use_version = version\n        self.use_tags = tags\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n        self.closed = None\n\n    def open(self):\n        if self.closed is None:\n            self.emit(StreamStartEvent(encoding=self.use_encoding))\n            self.closed = False\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        else:\n            raise SerializerError(\"serializer is already opened\")\n\n    def close(self):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif not self.closed:\n            self.emit(StreamEndEvent())\n            self.closed = True\n\n    #def __del__(self):\n    #    self.close()\n\n    def serialize(self, node):\n        if self.closed is None:\n            raise SerializerError(\"serializer is not opened\")\n        elif self.closed:\n            raise SerializerError(\"serializer is closed\")\n        self.emit(DocumentStartEvent(explicit=self.use_explicit_start,\n            version=self.use_version, tags=self.use_tags))\n        self.anchor_node(node)\n        self.serialize_node(node, None, None)\n        self.emit(DocumentEndEvent(explicit=self.use_explicit_end))\n        self.serialized_nodes = {}\n        self.anchors = {}\n        self.last_anchor_id = 0\n\n    def anchor_node(self, node):\n        if node in self.anchors:\n            if self.anchors[node] is None:\n                self.anchors[node] = self.generate_anchor(node)\n        else:\n            self.anchors[node] = None\n            if isinstance(node, SequenceNode):\n                for item in node.value:\n                    self.anchor_node(item)\n            elif isinstance(node, MappingNode):\n                for key, value in node.value:\n                    self.anchor_node(key)\n                    self.anchor_node(value)\n\n    def generate_anchor(self, node):\n        self.last_anchor_id += 1\n        return self.ANCHOR_TEMPLATE % self.last_anchor_id\n\n    def serialize_node(self, node, parent, index):\n        alias = self.anchors[node]\n        if node in self.serialized_nodes:\n            self.emit(AliasEvent(alias))\n        else:\n            self.serialized_nodes[node] = True\n            self.descend_resolver(parent, index)\n            if isinstance(node, ScalarNode):\n                detected_tag = self.resolve(ScalarNode, node.value, (True, False))\n                default_tag = self.resolve(ScalarNode, node.value, (False, True))\n                implicit = (node.tag == detected_tag), (node.tag == default_tag)\n                self.emit(ScalarEvent(alias, node.tag, implicit, node.value,\n                    style=node.style))\n            elif isinstance(node, SequenceNode):\n                implicit = (node.tag\n                            == self.resolve(SequenceNode, node.value, True))\n                self.emit(SequenceStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                index = 0\n                for item in node.value:\n                    self.serialize_node(item, node, index)\n                    index += 1\n                self.emit(SequenceEndEvent())\n            elif isinstance(node, MappingNode):\n                implicit = (node.tag\n                            == self.resolve(MappingNode, node.value, True))\n                self.emit(MappingStartEvent(alias, node.tag, implicit,\n                    flow_style=node.flow_style))\n                for key, value in node.value:\n                    self.serialize_node(key, node, None)\n                    self.serialize_node(value, node, key)\n                self.emit(MappingEndEvent())\n            self.ascend_resolver()\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/yaml_35/yaml/tokens.py",
    "content": "\nclass Token(object):\n    def __init__(self, start_mark, end_mark):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n    def __repr__(self):\n        attributes = [key for key in self.__dict__\n                if not key.endswith('_mark')]\n        attributes.sort()\n        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))\n                for key in attributes])\n        return '%s(%s)' % (self.__class__.__name__, arguments)\n\n#class BOMToken(Token):\n#    id = '<byte order mark>'\n\nclass DirectiveToken(Token):\n    id = '<directive>'\n    def __init__(self, name, value, start_mark, end_mark):\n        self.name = name\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass DocumentStartToken(Token):\n    id = '<document start>'\n\nclass DocumentEndToken(Token):\n    id = '<document end>'\n\nclass StreamStartToken(Token):\n    id = '<stream start>'\n    def __init__(self, start_mark=None, end_mark=None,\n            encoding=None):\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.encoding = encoding\n\nclass StreamEndToken(Token):\n    id = '<stream end>'\n\nclass BlockSequenceStartToken(Token):\n    id = '<block sequence start>'\n\nclass BlockMappingStartToken(Token):\n    id = '<block mapping start>'\n\nclass BlockEndToken(Token):\n    id = '<block end>'\n\nclass FlowSequenceStartToken(Token):\n    id = '['\n\nclass FlowMappingStartToken(Token):\n    id = '{'\n\nclass FlowSequenceEndToken(Token):\n    id = ']'\n\nclass FlowMappingEndToken(Token):\n    id = '}'\n\nclass KeyToken(Token):\n    id = '?'\n\nclass ValueToken(Token):\n    id = ':'\n\nclass BlockEntryToken(Token):\n    id = '-'\n\nclass FlowEntryToken(Token):\n    id = ','\n\nclass AliasToken(Token):\n    id = '<alias>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass AnchorToken(Token):\n    id = '<anchor>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass TagToken(Token):\n    id = '<tag>'\n    def __init__(self, value, start_mark, end_mark):\n        self.value = value\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n\nclass ScalarToken(Token):\n    id = '<scalar>'\n    def __init__(self, value, plain, start_mark, end_mark, style=None):\n        self.value = value\n        self.plain = plain\n        self.start_mark = start_mark\n        self.end_mark = end_mark\n        self.style = style\n\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/LICENSE",
    "content": "Copyright notice:\n\n (C) 1995-2022 Jean-loup Gailly and Mark Adler\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Jean-loup Gailly        Mark Adler\n  jloup@gzip.org          madler@alumni.caltech.edu\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/crc32.c",
    "content": "/* crc32.c -- compute the CRC-32 of a data stream\n * Copyright (C) 1995-2022 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n *\n * This interleaved implementation of a CRC makes use of pipelined multiple\n * arithmetic-logic units, commonly found in modern CPU cores. It is due to\n * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.\n */\n\n/* @(#) $Id$ */\n\n/*\n  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore\n  protection on the static variables used to control the first-use generation\n  of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should\n  first call get_crc_table() to initialize the tables before allowing more than\n  one thread to use crc32().\n\n  MAKECRCH can be #defined to write out crc32.h. A main() routine is also\n  produced, so that this one source file can be compiled to an executable.\n */\n\n#ifdef MAKECRCH\n#  include <stdio.h>\n#  ifndef DYNAMIC_CRC_TABLE\n#    define DYNAMIC_CRC_TABLE\n#  endif /* !DYNAMIC_CRC_TABLE */\n#endif /* MAKECRCH */\n\n#include \"zutil.h\"      /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */\n\n /*\n  A CRC of a message is computed on N braids of words in the message, where\n  each word consists of W bytes (4 or 8). If N is 3, for example, then three\n  running sparse CRCs are calculated respectively on each braid, at these\n  indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ...\n  This is done starting at a word boundary, and continues until as many blocks\n  of N * W bytes as are available have been processed. The results are combined\n  into a single CRC at the end. For this code, N must be in the range 1..6 and\n  W must be 4 or 8. The upper limit on N can be increased if desired by adding\n  more #if blocks, extending the patterns apparent in the code. In addition,\n  crc32.h would need to be regenerated, if the maximum N value is increased.\n\n  N and W are chosen empirically by benchmarking the execution time on a given\n  processor. The choices for N and W below were based on testing on Intel Kaby\n  Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64\n  Octeon II processors. The Intel, AMD, and ARM processors were all fastest\n  with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4.\n  They were all tested with either gcc or clang, all using the -O3 optimization\n  level. Your mileage may vary.\n */\n\n/* Define N */\n#ifdef Z_TESTN\n#  define N Z_TESTN\n#else\n#  define N 5\n#endif\n#if N < 1 || N > 6\n#  error N must be in 1..6\n#endif\n\n/*\n  z_crc_t must be at least 32 bits. z_word_t must be at least as long as\n  z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and\n  that bytes are eight bits.\n */\n\n/*\n  Define W and the associated z_word_t type. If W is not defined, then a\n  braided calculation is not used, and the associated tables and code are not\n  compiled.\n */\n#ifdef Z_TESTW\n#  if Z_TESTW-1 != -1\n#    define W Z_TESTW\n#  endif\n#else\n#  ifdef MAKECRCH\n#    define W 8         /* required for MAKECRCH */\n#  else\n#    if defined(__x86_64__) || defined(__aarch64__)\n#      define W 8\n#    else\n#      define W 4\n#    endif\n#  endif\n#endif\n#ifdef W\n#  if W == 8 && defined(Z_U8)\n     typedef Z_U8 z_word_t;\n#  elif defined(Z_U4)\n#    undef W\n#    define W 4\n     typedef Z_U4 z_word_t;\n#  else\n#    undef W\n#  endif\n#endif\n\n/* If available, use the ARM processor CRC32 instruction. */\n#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8\n#  define ARMCRC32\n#endif\n\n#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))\n/*\n  Swap the bytes in a z_word_t to convert between little and big endian. Any\n  self-respecting compiler will optimize this to a single machine byte-swap\n  instruction, if one is available. This assumes that word_t is either 32 bits\n  or 64 bits.\n */\nlocal z_word_t byte_swap(z_word_t word) {\n#  if W == 8\n    return\n        (word & 0xff00000000000000) >> 56 |\n        (word & 0xff000000000000) >> 40 |\n        (word & 0xff0000000000) >> 24 |\n        (word & 0xff00000000) >> 8 |\n        (word & 0xff000000) << 8 |\n        (word & 0xff0000) << 24 |\n        (word & 0xff00) << 40 |\n        (word & 0xff) << 56;\n#  else   /* W == 4 */\n    return\n        (word & 0xff000000) >> 24 |\n        (word & 0xff0000) >> 8 |\n        (word & 0xff00) << 8 |\n        (word & 0xff) << 24;\n#  endif\n}\n#endif\n\n#ifdef DYNAMIC_CRC_TABLE\n/* =========================================================================\n * Table of powers of x for combining CRC-32s, filled in by make_crc_table()\n * below.\n */\n   local z_crc_t FAR x2n_table[32];\n#else\n/* =========================================================================\n * Tables for byte-wise and braided CRC-32 calculations, and a table of powers\n * of x for combining CRC-32s, all made by make_crc_table().\n */\n#  include \"crc32.h\"\n#endif\n\n/* CRC polynomial. */\n#define POLY 0xedb88320         /* p(x) reflected, with x^32 implied */\n\n/*\n  Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,\n  reflected. For speed, this requires that a not be zero.\n */\nlocal z_crc_t multmodp(z_crc_t a, z_crc_t b) {\n    z_crc_t m, p;\n\n    m = (z_crc_t)1 << 31;\n    p = 0;\n    for (;;) {\n        if (a & m) {\n            p ^= b;\n            if ((a & (m - 1)) == 0)\n                break;\n        }\n        m >>= 1;\n        b = b & 1 ? (b >> 1) ^ POLY : b >> 1;\n    }\n    return p;\n}\n\n/*\n  Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been\n  initialized.\n */\nlocal z_crc_t x2nmodp(z_off64_t n, unsigned k) {\n    z_crc_t p;\n\n    p = (z_crc_t)1 << 31;           /* x^0 == 1 */\n    while (n) {\n        if (n & 1)\n            p = multmodp(x2n_table[k & 31], p);\n        n >>= 1;\n        k++;\n    }\n    return p;\n}\n\n#ifdef DYNAMIC_CRC_TABLE\n/* =========================================================================\n * Build the tables for byte-wise and braided CRC-32 calculations, and a table\n * of powers of x for combining CRC-32s.\n */\nlocal z_crc_t FAR crc_table[256];\n#ifdef W\n   local z_word_t FAR crc_big_table[256];\n   local z_crc_t FAR crc_braid_table[W][256];\n   local z_word_t FAR crc_braid_big_table[W][256];\n   local void braid(z_crc_t [][256], z_word_t [][256], int, int);\n#endif\n#ifdef MAKECRCH\n   local void write_table(FILE *, const z_crc_t FAR *, int);\n   local void write_table32hi(FILE *, const z_word_t FAR *, int);\n   local void write_table64(FILE *, const z_word_t FAR *, int);\n#endif /* MAKECRCH */\n\n/*\n  Define a once() function depending on the availability of atomics. If this is\n  compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in\n  multiple threads, and if atomics are not available, then get_crc_table() must\n  be called to initialize the tables and must return before any threads are\n  allowed to compute or combine CRCs.\n */\n\n/* Definition of once functionality. */\ntypedef struct once_s once_t;\n\n/* Check for the availability of atomics. */\n#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \\\n    !defined(__STDC_NO_ATOMICS__)\n\n#include <stdatomic.h>\n\n/* Structure for once(), which must be initialized with ONCE_INIT. */\nstruct once_s {\n    atomic_flag begun;\n    atomic_int done;\n};\n#define ONCE_INIT {ATOMIC_FLAG_INIT, 0}\n\n/*\n  Run the provided init() function exactly once, even if multiple threads\n  invoke once() at the same time. The state must be a once_t initialized with\n  ONCE_INIT.\n */\nlocal void once(once_t *state, void (*init)(void)) {\n    if (!atomic_load(&state->done)) {\n        if (atomic_flag_test_and_set(&state->begun))\n            while (!atomic_load(&state->done))\n                ;\n        else {\n            init();\n            atomic_store(&state->done, 1);\n        }\n    }\n}\n\n#else   /* no atomics */\n\n/* Structure for once(), which must be initialized with ONCE_INIT. */\nstruct once_s {\n    volatile int begun;\n    volatile int done;\n};\n#define ONCE_INIT {0, 0}\n\n/* Test and set. Alas, not atomic, but tries to minimize the period of\n   vulnerability. */\nlocal int test_and_set(int volatile *flag) {\n    int was;\n\n    was = *flag;\n    *flag = 1;\n    return was;\n}\n\n/* Run the provided init() function once. This is not thread-safe. */\nlocal void once(once_t *state, void (*init)(void)) {\n    if (!state->done) {\n        if (test_and_set(&state->begun))\n            while (!state->done)\n                ;\n        else {\n            init();\n            state->done = 1;\n        }\n    }\n}\n\n#endif\n\n/* State for once(). */\nlocal once_t made = ONCE_INIT;\n\n/*\n  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:\n  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.\n\n  Polynomials over GF(2) are represented in binary, one bit per coefficient,\n  with the lowest powers in the most significant bit. Then adding polynomials\n  is just exclusive-or, and multiplying a polynomial by x is a right shift by\n  one. If we call the above polynomial p, and represent a byte as the\n  polynomial q, also with the lowest power in the most significant bit (so the\n  byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p,\n  where a mod b means the remainder after dividing a by b.\n\n  This calculation is done using the shift-register method of multiplying and\n  taking the remainder. The register is initialized to zero, and for each\n  incoming bit, x^32 is added mod p to the register if the bit is a one (where\n  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x\n  (which is shifting right by one and adding x^32 mod p if the bit shifted out\n  is a one). We start with the highest power (least significant bit) of q and\n  repeat for all eight bits of q.\n\n  The table is simply the CRC of all possible eight bit values. This is all the\n  information needed to generate CRCs on data a byte at a time for all\n  combinations of CRC register values and incoming bytes.\n */\n\nlocal void make_crc_table(void) {\n    unsigned i, j, n;\n    z_crc_t p;\n\n    /* initialize the CRC of bytes tables */\n    for (i = 0; i < 256; i++) {\n        p = i;\n        for (j = 0; j < 8; j++)\n            p = p & 1 ? (p >> 1) ^ POLY : p >> 1;\n        crc_table[i] = p;\n#ifdef W\n        crc_big_table[i] = byte_swap(p);\n#endif\n    }\n\n    /* initialize the x^2^n mod p(x) table */\n    p = (z_crc_t)1 << 30;         /* x^1 */\n    x2n_table[0] = p;\n    for (n = 1; n < 32; n++)\n        x2n_table[n] = p = multmodp(p, p);\n\n#ifdef W\n    /* initialize the braiding tables -- needs x2n_table[] */\n    braid(crc_braid_table, crc_braid_big_table, N, W);\n#endif\n\n#ifdef MAKECRCH\n    {\n        /*\n          The crc32.h header file contains tables for both 32-bit and 64-bit\n          z_word_t's, and so requires a 64-bit type be available. In that case,\n          z_word_t must be defined to be 64-bits. This code then also generates\n          and writes out the tables for the case that z_word_t is 32 bits.\n         */\n#if !defined(W) || W != 8\n#  error Need a 64-bit integer type in order to generate crc32.h.\n#endif\n        FILE *out;\n        int k, n;\n        z_crc_t ltl[8][256];\n        z_word_t big[8][256];\n\n        out = fopen(\"crc32.h\", \"w\");\n        if (out == NULL) return;\n\n        /* write out little-endian CRC table to crc32.h */\n        fprintf(out,\n            \"/* crc32.h -- tables for rapid CRC calculation\\n\"\n            \" * Generated automatically by crc32.c\\n */\\n\"\n            \"\\n\"\n            \"local const z_crc_t FAR crc_table[] = {\\n\"\n            \"    \");\n        write_table(out, crc_table, 256);\n        fprintf(out,\n            \"};\\n\");\n\n        /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */\n        fprintf(out,\n            \"\\n\"\n            \"#ifdef W\\n\"\n            \"\\n\"\n            \"#if W == 8\\n\"\n            \"\\n\"\n            \"local const z_word_t FAR crc_big_table[] = {\\n\"\n            \"    \");\n        write_table64(out, crc_big_table, 256);\n        fprintf(out,\n            \"};\\n\");\n\n        /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */\n        fprintf(out,\n            \"\\n\"\n            \"#else /* W == 4 */\\n\"\n            \"\\n\"\n            \"local const z_word_t FAR crc_big_table[] = {\\n\"\n            \"    \");\n        write_table32hi(out, crc_big_table, 256);\n        fprintf(out,\n            \"};\\n\"\n            \"\\n\"\n            \"#endif\\n\");\n\n        /* write out braid tables for each value of N */\n        for (n = 1; n <= 6; n++) {\n            fprintf(out,\n            \"\\n\"\n            \"#if N == %d\\n\", n);\n\n            /* compute braid tables for this N and 64-bit word_t */\n            braid(ltl, big, n, 8);\n\n            /* write out braid tables for 64-bit z_word_t to crc32.h */\n            fprintf(out,\n            \"\\n\"\n            \"#if W == 8\\n\"\n            \"\\n\"\n            \"local const z_crc_t FAR crc_braid_table[][256] = {\\n\");\n            for (k = 0; k < 8; k++) {\n                fprintf(out, \"   {\");\n                write_table(out, ltl[k], 256);\n                fprintf(out, \"}%s\", k < 7 ? \",\\n\" : \"\");\n            }\n            fprintf(out,\n            \"};\\n\"\n            \"\\n\"\n            \"local const z_word_t FAR crc_braid_big_table[][256] = {\\n\");\n            for (k = 0; k < 8; k++) {\n                fprintf(out, \"   {\");\n                write_table64(out, big[k], 256);\n                fprintf(out, \"}%s\", k < 7 ? \",\\n\" : \"\");\n            }\n            fprintf(out,\n            \"};\\n\");\n\n            /* compute braid tables for this N and 32-bit word_t */\n            braid(ltl, big, n, 4);\n\n            /* write out braid tables for 32-bit z_word_t to crc32.h */\n            fprintf(out,\n            \"\\n\"\n            \"#else /* W == 4 */\\n\"\n            \"\\n\"\n            \"local const z_crc_t FAR crc_braid_table[][256] = {\\n\");\n            for (k = 0; k < 4; k++) {\n                fprintf(out, \"   {\");\n                write_table(out, ltl[k], 256);\n                fprintf(out, \"}%s\", k < 3 ? \",\\n\" : \"\");\n            }\n            fprintf(out,\n            \"};\\n\"\n            \"\\n\"\n            \"local const z_word_t FAR crc_braid_big_table[][256] = {\\n\");\n            for (k = 0; k < 4; k++) {\n                fprintf(out, \"   {\");\n                write_table32hi(out, big[k], 256);\n                fprintf(out, \"}%s\", k < 3 ? \",\\n\" : \"\");\n            }\n            fprintf(out,\n            \"};\\n\"\n            \"\\n\"\n            \"#endif\\n\"\n            \"\\n\"\n            \"#endif\\n\");\n        }\n        fprintf(out,\n            \"\\n\"\n            \"#endif\\n\");\n\n        /* write out zeros operator table to crc32.h */\n        fprintf(out,\n            \"\\n\"\n            \"local const z_crc_t FAR x2n_table[] = {\\n\"\n            \"    \");\n        write_table(out, x2n_table, 32);\n        fprintf(out,\n            \"};\\n\");\n        fclose(out);\n    }\n#endif /* MAKECRCH */\n}\n\n#ifdef MAKECRCH\n\n/*\n   Write the 32-bit values in table[0..k-1] to out, five per line in\n   hexadecimal separated by commas.\n */\nlocal void write_table(FILE *out, const z_crc_t FAR *table, int k) {\n    int n;\n\n    for (n = 0; n < k; n++)\n        fprintf(out, \"%s0x%08lx%s\", n == 0 || n % 5 ? \"\" : \"    \",\n                (unsigned long)(table[n]),\n                n == k - 1 ? \"\" : (n % 5 == 4 ? \",\\n\" : \", \"));\n}\n\n/*\n   Write the high 32-bits of each value in table[0..k-1] to out, five per line\n   in hexadecimal separated by commas.\n */\nlocal void write_table32hi(FILE *out, const z_word_t FAR *table, int k) {\n    int n;\n\n    for (n = 0; n < k; n++)\n        fprintf(out, \"%s0x%08lx%s\", n == 0 || n % 5 ? \"\" : \"    \",\n                (unsigned long)(table[n] >> 32),\n                n == k - 1 ? \"\" : (n % 5 == 4 ? \",\\n\" : \", \"));\n}\n\n/*\n  Write the 64-bit values in table[0..k-1] to out, three per line in\n  hexadecimal separated by commas. This assumes that if there is a 64-bit\n  type, then there is also a long long integer type, and it is at least 64\n  bits. If not, then the type cast and format string can be adjusted\n  accordingly.\n */\nlocal void write_table64(FILE *out, const z_word_t FAR *table, int k) {\n    int n;\n\n    for (n = 0; n < k; n++)\n        fprintf(out, \"%s0x%016llx%s\", n == 0 || n % 3 ? \"\" : \"    \",\n                (unsigned long long)(table[n]),\n                n == k - 1 ? \"\" : (n % 3 == 2 ? \",\\n\" : \", \"));\n}\n\n/* Actually do the deed. */\nint main(void) {\n    make_crc_table();\n    return 0;\n}\n\n#endif /* MAKECRCH */\n\n#ifdef W\n/*\n  Generate the little and big-endian braid tables for the given n and z_word_t\n  size w. Each array must have room for w blocks of 256 elements.\n */\nlocal void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) {\n    int k;\n    z_crc_t i, p, q;\n    for (k = 0; k < w; k++) {\n        p = x2nmodp((n * w + 3 - k) << 3, 0);\n        ltl[k][0] = 0;\n        big[w - 1 - k][0] = 0;\n        for (i = 1; i < 256; i++) {\n            ltl[k][i] = q = multmodp(i << 24, p);\n            big[w - 1 - k][i] = byte_swap(q);\n        }\n    }\n}\n#endif\n\n#endif /* DYNAMIC_CRC_TABLE */\n\n/* =========================================================================\n * This function can be used by asm versions of crc32(), and to force the\n * generation of the CRC tables in a threaded application.\n */\nconst z_crc_t FAR * ZEXPORT get_crc_table(void) {\n#ifdef DYNAMIC_CRC_TABLE\n    once(&made, make_crc_table);\n#endif /* DYNAMIC_CRC_TABLE */\n    return (const z_crc_t FAR *)crc_table;\n}\n\n/* =========================================================================\n * Use ARM machine instructions if available. This will compute the CRC about\n * ten times faster than the braided calculation. This code does not check for\n * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will\n * only be defined if the compilation specifies an ARM processor architecture\n * that has the instructions. For example, compiling with -march=armv8.1-a or\n * -march=armv8-a+crc, or -march=native if the compile machine has the crc32\n * instructions.\n */\n#ifdef ARMCRC32\n\n/*\n   Constants empirically determined to maximize speed. These values are from\n   measurements on a Cortex-A57. Your mileage may vary.\n */\n#define Z_BATCH 3990                /* number of words in a batch */\n#define Z_BATCH_ZEROS 0xa10d3d0c    /* computed from Z_BATCH = 3990 */\n#define Z_BATCH_MIN 800             /* fewest words in a final batch */\n\nunsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,\n                              z_size_t len) {\n    z_crc_t val;\n    z_word_t crc1, crc2;\n    const z_word_t *word;\n    z_word_t val0, val1, val2;\n    z_size_t last, last2, i;\n    z_size_t num;\n\n    /* Return initial CRC, if requested. */\n    if (buf == Z_NULL) return 0;\n\n#ifdef DYNAMIC_CRC_TABLE\n    once(&made, make_crc_table);\n#endif /* DYNAMIC_CRC_TABLE */\n\n    /* Pre-condition the CRC */\n    crc = (~crc) & 0xffffffff;\n\n    /* Compute the CRC up to a word boundary. */\n    while (len && ((z_size_t)buf & 7) != 0) {\n        len--;\n        val = *buf++;\n        __asm__ volatile(\"crc32b %w0, %w0, %w1\" : \"+r\"(crc) : \"r\"(val));\n    }\n\n    /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */\n    word = (z_word_t const *)buf;\n    num = len >> 3;\n    len &= 7;\n\n    /* Do three interleaved CRCs to realize the throughput of one crc32x\n       instruction per cycle. Each CRC is calculated on Z_BATCH words. The\n       three CRCs are combined into a single CRC after each set of batches. */\n    while (num >= 3 * Z_BATCH) {\n        crc1 = 0;\n        crc2 = 0;\n        for (i = 0; i < Z_BATCH; i++) {\n            val0 = word[i];\n            val1 = word[i + Z_BATCH];\n            val2 = word[i + 2 * Z_BATCH];\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc) : \"r\"(val0));\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc1) : \"r\"(val1));\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc2) : \"r\"(val2));\n        }\n        word += 3 * Z_BATCH;\n        num -= 3 * Z_BATCH;\n        crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1;\n        crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2;\n    }\n\n    /* Do one last smaller batch with the remaining words, if there are enough\n       to pay for the combination of CRCs. */\n    last = num / 3;\n    if (last >= Z_BATCH_MIN) {\n        last2 = last << 1;\n        crc1 = 0;\n        crc2 = 0;\n        for (i = 0; i < last; i++) {\n            val0 = word[i];\n            val1 = word[i + last];\n            val2 = word[i + last2];\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc) : \"r\"(val0));\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc1) : \"r\"(val1));\n            __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc2) : \"r\"(val2));\n        }\n        word += 3 * last;\n        num -= 3 * last;\n        val = x2nmodp(last, 6);\n        crc = multmodp(val, crc) ^ crc1;\n        crc = multmodp(val, crc) ^ crc2;\n    }\n\n    /* Compute the CRC on any remaining words. */\n    for (i = 0; i < num; i++) {\n        val0 = word[i];\n        __asm__ volatile(\"crc32x %w0, %w0, %x1\" : \"+r\"(crc) : \"r\"(val0));\n    }\n    word += num;\n\n    /* Complete the CRC on any remaining bytes. */\n    buf = (const unsigned char FAR *)word;\n    while (len) {\n        len--;\n        val = *buf++;\n        __asm__ volatile(\"crc32b %w0, %w0, %w1\" : \"+r\"(crc) : \"r\"(val));\n    }\n\n    /* Return the CRC, post-conditioned. */\n    return crc ^ 0xffffffff;\n}\n\n#else\n\n#ifdef W\n\n/*\n  Return the CRC of the W bytes in the word_t data, taking the\n  least-significant byte of the word as the first byte of data, without any pre\n  or post conditioning. This is used to combine the CRCs of each braid.\n */\nlocal z_crc_t crc_word(z_word_t data) {\n    int k;\n    for (k = 0; k < W; k++)\n        data = (data >> 8) ^ crc_table[data & 0xff];\n    return (z_crc_t)data;\n}\n\nlocal z_word_t crc_word_big(z_word_t data) {\n    int k;\n    for (k = 0; k < W; k++)\n        data = (data << 8) ^\n            crc_big_table[(data >> ((W - 1) << 3)) & 0xff];\n    return data;\n}\n\n#endif\n\n/* ========================================================================= */\nunsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,\n                              z_size_t len) {\n    /* Return initial CRC, if requested. */\n    if (buf == Z_NULL) return 0;\n\n#ifdef DYNAMIC_CRC_TABLE\n    once(&made, make_crc_table);\n#endif /* DYNAMIC_CRC_TABLE */\n\n    /* Pre-condition the CRC */\n    crc = (~crc) & 0xffffffff;\n\n#ifdef W\n\n    /* If provided enough bytes, do a braided CRC calculation. */\n    if (len >= N * W + W - 1) {\n        z_size_t blks;\n        z_word_t const *words;\n        unsigned endian;\n        int k;\n\n        /* Compute the CRC up to a z_word_t boundary. */\n        while (len && ((z_size_t)buf & (W - 1)) != 0) {\n            len--;\n            crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        }\n\n        /* Compute the CRC on as many N z_word_t blocks as are available. */\n        blks = len / (N * W);\n        len -= blks * N * W;\n        words = (z_word_t const *)buf;\n\n        /* Do endian check at execution time instead of compile time, since ARM\n           processors can change the endianness at execution time. If the\n           compiler knows what the endianness will be, it can optimize out the\n           check and the unused branch. */\n        endian = 1;\n        if (*(unsigned char *)&endian) {\n            /* Little endian. */\n\n            z_crc_t crc0;\n            z_word_t word0;\n#if N > 1\n            z_crc_t crc1;\n            z_word_t word1;\n#if N > 2\n            z_crc_t crc2;\n            z_word_t word2;\n#if N > 3\n            z_crc_t crc3;\n            z_word_t word3;\n#if N > 4\n            z_crc_t crc4;\n            z_word_t word4;\n#if N > 5\n            z_crc_t crc5;\n            z_word_t word5;\n#endif\n#endif\n#endif\n#endif\n#endif\n\n            /* Initialize the CRC for each braid. */\n            crc0 = crc;\n#if N > 1\n            crc1 = 0;\n#if N > 2\n            crc2 = 0;\n#if N > 3\n            crc3 = 0;\n#if N > 4\n            crc4 = 0;\n#if N > 5\n            crc5 = 0;\n#endif\n#endif\n#endif\n#endif\n#endif\n\n            /*\n              Process the first blks-1 blocks, computing the CRCs on each braid\n              independently.\n             */\n            while (--blks) {\n                /* Load the word for each braid into registers. */\n                word0 = crc0 ^ words[0];\n#if N > 1\n                word1 = crc1 ^ words[1];\n#if N > 2\n                word2 = crc2 ^ words[2];\n#if N > 3\n                word3 = crc3 ^ words[3];\n#if N > 4\n                word4 = crc4 ^ words[4];\n#if N > 5\n                word5 = crc5 ^ words[5];\n#endif\n#endif\n#endif\n#endif\n#endif\n                words += N;\n\n                /* Compute and update the CRC for each word. The loop should\n                   get unrolled. */\n                crc0 = crc_braid_table[0][word0 & 0xff];\n#if N > 1\n                crc1 = crc_braid_table[0][word1 & 0xff];\n#if N > 2\n                crc2 = crc_braid_table[0][word2 & 0xff];\n#if N > 3\n                crc3 = crc_braid_table[0][word3 & 0xff];\n#if N > 4\n                crc4 = crc_braid_table[0][word4 & 0xff];\n#if N > 5\n                crc5 = crc_braid_table[0][word5 & 0xff];\n#endif\n#endif\n#endif\n#endif\n#endif\n                for (k = 1; k < W; k++) {\n                    crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];\n#if N > 1\n                    crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];\n#if N > 2\n                    crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];\n#if N > 3\n                    crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];\n#if N > 4\n                    crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];\n#if N > 5\n                    crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];\n#endif\n#endif\n#endif\n#endif\n#endif\n                }\n            }\n\n            /*\n              Process the last block, combining the CRCs of the N braids at the\n              same time.\n             */\n            crc = crc_word(crc0 ^ words[0]);\n#if N > 1\n            crc = crc_word(crc1 ^ words[1] ^ crc);\n#if N > 2\n            crc = crc_word(crc2 ^ words[2] ^ crc);\n#if N > 3\n            crc = crc_word(crc3 ^ words[3] ^ crc);\n#if N > 4\n            crc = crc_word(crc4 ^ words[4] ^ crc);\n#if N > 5\n            crc = crc_word(crc5 ^ words[5] ^ crc);\n#endif\n#endif\n#endif\n#endif\n#endif\n            words += N;\n        }\n        else {\n            /* Big endian. */\n\n            z_word_t crc0, word0, comb;\n#if N > 1\n            z_word_t crc1, word1;\n#if N > 2\n            z_word_t crc2, word2;\n#if N > 3\n            z_word_t crc3, word3;\n#if N > 4\n            z_word_t crc4, word4;\n#if N > 5\n            z_word_t crc5, word5;\n#endif\n#endif\n#endif\n#endif\n#endif\n\n            /* Initialize the CRC for each braid. */\n            crc0 = byte_swap(crc);\n#if N > 1\n            crc1 = 0;\n#if N > 2\n            crc2 = 0;\n#if N > 3\n            crc3 = 0;\n#if N > 4\n            crc4 = 0;\n#if N > 5\n            crc5 = 0;\n#endif\n#endif\n#endif\n#endif\n#endif\n\n            /*\n              Process the first blks-1 blocks, computing the CRCs on each braid\n              independently.\n             */\n            while (--blks) {\n                /* Load the word for each braid into registers. */\n                word0 = crc0 ^ words[0];\n#if N > 1\n                word1 = crc1 ^ words[1];\n#if N > 2\n                word2 = crc2 ^ words[2];\n#if N > 3\n                word3 = crc3 ^ words[3];\n#if N > 4\n                word4 = crc4 ^ words[4];\n#if N > 5\n                word5 = crc5 ^ words[5];\n#endif\n#endif\n#endif\n#endif\n#endif\n                words += N;\n\n                /* Compute and update the CRC for each word. The loop should\n                   get unrolled. */\n                crc0 = crc_braid_big_table[0][word0 & 0xff];\n#if N > 1\n                crc1 = crc_braid_big_table[0][word1 & 0xff];\n#if N > 2\n                crc2 = crc_braid_big_table[0][word2 & 0xff];\n#if N > 3\n                crc3 = crc_braid_big_table[0][word3 & 0xff];\n#if N > 4\n                crc4 = crc_braid_big_table[0][word4 & 0xff];\n#if N > 5\n                crc5 = crc_braid_big_table[0][word5 & 0xff];\n#endif\n#endif\n#endif\n#endif\n#endif\n                for (k = 1; k < W; k++) {\n                    crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];\n#if N > 1\n                    crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];\n#if N > 2\n                    crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];\n#if N > 3\n                    crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];\n#if N > 4\n                    crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];\n#if N > 5\n                    crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];\n#endif\n#endif\n#endif\n#endif\n#endif\n                }\n            }\n\n            /*\n              Process the last block, combining the CRCs of the N braids at the\n              same time.\n             */\n            comb = crc_word_big(crc0 ^ words[0]);\n#if N > 1\n            comb = crc_word_big(crc1 ^ words[1] ^ comb);\n#if N > 2\n            comb = crc_word_big(crc2 ^ words[2] ^ comb);\n#if N > 3\n            comb = crc_word_big(crc3 ^ words[3] ^ comb);\n#if N > 4\n            comb = crc_word_big(crc4 ^ words[4] ^ comb);\n#if N > 5\n            comb = crc_word_big(crc5 ^ words[5] ^ comb);\n#endif\n#endif\n#endif\n#endif\n#endif\n            words += N;\n            crc = byte_swap(comb);\n        }\n\n        /*\n          Update the pointer to the remaining bytes to process.\n         */\n        buf = (unsigned char const *)words;\n    }\n\n#endif /* W */\n\n    /* Complete the computation of the CRC on any remaining bytes. */\n    while (len >= 8) {\n        len -= 8;\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n    }\n    while (len) {\n        len--;\n        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];\n    }\n\n    /* Return the CRC, post-conditioned. */\n    return crc ^ 0xffffffff;\n}\n\n#endif\n\n/* ========================================================================= */\nunsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf,\n                            uInt len) {\n    return crc32_z(crc, buf, len);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {\n#ifdef DYNAMIC_CRC_TABLE\n    once(&made, make_crc_table);\n#endif /* DYNAMIC_CRC_TABLE */\n    return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) {\n    return crc32_combine64(crc1, crc2, (z_off64_t)len2);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine_gen64(z_off64_t len2) {\n#ifdef DYNAMIC_CRC_TABLE\n    once(&made, make_crc_table);\n#endif /* DYNAMIC_CRC_TABLE */\n    return x2nmodp(len2, 3);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine_gen(z_off_t len2) {\n    return crc32_combine_gen64((z_off64_t)len2);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) {\n    return multmodp(op, crc1) ^ (crc2 & 0xffffffff);\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/crc32.h",
    "content": "/* crc32.h -- tables for rapid CRC calculation\n * Generated automatically by crc32.c\n */\n\nlocal const z_crc_t FAR crc_table[] = {\n    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n    0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n    0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n    0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n    0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n    0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n    0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n    0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n    0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n    0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n    0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n    0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n    0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n    0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n    0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n    0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n    0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n    0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n    0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n    0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n    0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n    0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n    0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n    0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n    0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n    0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n    0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n    0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n    0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n    0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n    0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n    0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n    0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n    0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n    0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n    0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n    0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n    0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n    0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n    0x2d02ef8d};\n\n#ifdef W\n\n#if W == 8\n\nlocal const z_word_t FAR crc_big_table[] = {\n    0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000,\n    0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000,\n    0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000,\n    0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000,\n    0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000,\n    0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000,\n    0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000,\n    0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000,\n    0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000,\n    0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000,\n    0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000,\n    0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000,\n    0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000,\n    0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000,\n    0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000,\n    0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000,\n    0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000,\n    0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000,\n    0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000,\n    0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000,\n    0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000,\n    0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000,\n    0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000,\n    0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000,\n    0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000,\n    0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000,\n    0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000,\n    0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000,\n    0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000,\n    0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000,\n    0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000,\n    0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000,\n    0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000,\n    0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000,\n    0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000,\n    0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000,\n    0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000,\n    0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000,\n    0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000,\n    0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000,\n    0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000,\n    0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000,\n    0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000,\n    0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000,\n    0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000,\n    0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000,\n    0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000,\n    0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000,\n    0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000,\n    0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000,\n    0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000,\n    0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000,\n    0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000,\n    0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000,\n    0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000,\n    0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000,\n    0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000,\n    0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000,\n    0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000,\n    0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000,\n    0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000,\n    0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000,\n    0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000,\n    0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000,\n    0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000,\n    0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000,\n    0x8567077200000000, 0x1357000500000000, 0x824abf9500000000,\n    0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000,\n    0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000,\n    0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000,\n    0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000,\n    0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000,\n    0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000,\n    0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000,\n    0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000,\n    0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000,\n    0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000,\n    0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000,\n    0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000,\n    0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000,\n    0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000,\n    0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000,\n    0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000,\n    0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000,\n    0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000,\n    0x8def022d00000000};\n\n#else /* W == 4 */\n\nlocal const z_word_t FAR crc_big_table[] = {\n    0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07,\n    0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79,\n    0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7,\n    0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84,\n    0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13,\n    0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663,\n    0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5,\n    0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5,\n    0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832,\n    0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51,\n    0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf,\n    0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1,\n    0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76,\n    0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606,\n    0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996,\n    0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6,\n    0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c,\n    0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712,\n    0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c,\n    0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4,\n    0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943,\n    0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333,\n    0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe,\n    0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce,\n    0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359,\n    0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a,\n    0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04,\n    0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a,\n    0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0,\n    0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580,\n    0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10,\n    0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060,\n    0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1,\n    0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf,\n    0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31,\n    0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852,\n    0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5,\n    0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5,\n    0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75,\n    0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005,\n    0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292,\n    0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1,\n    0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f,\n    0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111,\n    0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0,\n    0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0,\n    0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40,\n    0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530,\n    0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba,\n    0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4,\n    0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a,\n    0x8def022d};\n\n#endif\n\n#if N == 1\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa,\n    0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b,\n    0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232,\n    0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8,\n    0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e,\n    0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa,\n    0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b,\n    0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f,\n    0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719,\n    0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3,\n    0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa,\n    0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b,\n    0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed,\n    0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89,\n    0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25,\n    0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041,\n    0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c,\n    0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed,\n    0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4,\n    0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758,\n    0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e,\n    0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a,\n    0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed,\n    0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889,\n    0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df,\n    0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544,\n    0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d,\n    0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c,\n    0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1,\n    0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95,\n    0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839,\n    0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d,\n    0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976,\n    0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7,\n    0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be,\n    0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144,\n    0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12,\n    0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376,\n    0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a,\n    0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e,\n    0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278,\n    0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682,\n    0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b,\n    0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a,\n    0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561,\n    0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05,\n    0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9,\n    0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd,\n    0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0,\n    0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61,\n    0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678,\n    0x264b06e6},\n   {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413,\n    0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3,\n    0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d,\n    0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653,\n    0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9,\n    0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e,\n    0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5,\n    0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712,\n    0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8,\n    0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6,\n    0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068,\n    0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8,\n    0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579,\n    0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade,\n    0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37,\n    0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590,\n    0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4,\n    0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64,\n    0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea,\n    0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678,\n    0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282,\n    0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25,\n    0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102,\n    0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5,\n    0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f,\n    0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146,\n    0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8,\n    0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08,\n    0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c,\n    0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b,\n    0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972,\n    0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5,\n    0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d,\n    0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd,\n    0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833,\n    0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d,\n    0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7,\n    0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60,\n    0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2,\n    0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105,\n    0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff,\n    0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1,\n    0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f,\n    0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf,\n    0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617,\n    0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0,\n    0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959,\n    0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe,\n    0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca,\n    0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a,\n    0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184,\n    0x92364a30},\n   {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216,\n    0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8,\n    0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170,\n    0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035,\n    0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6,\n    0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145,\n    0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d,\n    0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e,\n    0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d,\n    0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408,\n    0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0,\n    0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e,\n    0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c,\n    0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf,\n    0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a,\n    0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9,\n    0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1,\n    0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f,\n    0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987,\n    0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4,\n    0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37,\n    0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84,\n    0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca,\n    0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79,\n    0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba,\n    0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d,\n    0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5,\n    0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b,\n    0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643,\n    0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0,\n    0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525,\n    0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496,\n    0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8,\n    0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026,\n    0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e,\n    0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db,\n    0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118,\n    0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab,\n    0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf,\n    0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c,\n    0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf,\n    0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a,\n    0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32,\n    0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec,\n    0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82,\n    0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31,\n    0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4,\n    0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957,\n    0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f,\n    0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1,\n    0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869,\n    0xe4c4abcc},\n   {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0,\n    0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271,\n    0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61,\n    0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52,\n    0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43,\n    0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333,\n    0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64,\n    0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314,\n    0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205,\n    0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136,\n    0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26,\n    0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997,\n    0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849,\n    0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739,\n    0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8,\n    0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98,\n    0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b,\n    0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba,\n    0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa,\n    0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d,\n    0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c,\n    0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc,\n    0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af,\n    0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf,\n    0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce,\n    0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922,\n    0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532,\n    0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183,\n    0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710,\n    0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860,\n    0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1,\n    0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1,\n    0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956,\n    0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7,\n    0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7,\n    0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4,\n    0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5,\n    0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5,\n    0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb,\n    0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb,\n    0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da,\n    0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9,\n    0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9,\n    0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48,\n    0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df,\n    0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af,\n    0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e,\n    0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e,\n    0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d,\n    0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c,\n    0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c,\n    0xca64c78c},\n   {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757,\n    0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a,\n    0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733,\n    0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871,\n    0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70,\n    0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42,\n    0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5,\n    0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787,\n    0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086,\n    0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4,\n    0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d,\n    0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0,\n    0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d,\n    0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f,\n    0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859,\n    0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b,\n    0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5,\n    0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028,\n    0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891,\n    0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed,\n    0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec,\n    0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde,\n    0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817,\n    0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825,\n    0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24,\n    0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e,\n    0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7,\n    0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a,\n    0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4,\n    0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196,\n    0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0,\n    0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2,\n    0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52,\n    0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f,\n    0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36,\n    0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174,\n    0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675,\n    0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647,\n    0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d,\n    0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf,\n    0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be,\n    0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc,\n    0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645,\n    0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98,\n    0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138,\n    0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a,\n    0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c,\n    0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e,\n    0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0,\n    0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d,\n    0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194,\n    0xde0506f1},\n   {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc,\n    0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f,\n    0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a,\n    0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29,\n    0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8,\n    0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023,\n    0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e,\n    0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065,\n    0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84,\n    0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7,\n    0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922,\n    0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71,\n    0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0,\n    0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b,\n    0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816,\n    0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd,\n    0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c,\n    0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f,\n    0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba,\n    0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579,\n    0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98,\n    0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873,\n    0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e,\n    0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5,\n    0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134,\n    0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7,\n    0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732,\n    0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461,\n    0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0,\n    0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b,\n    0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26,\n    0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd,\n    0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc,\n    0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef,\n    0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a,\n    0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049,\n    0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8,\n    0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43,\n    0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e,\n    0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5,\n    0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24,\n    0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07,\n    0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982,\n    0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1,\n    0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0,\n    0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b,\n    0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576,\n    0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d,\n    0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c,\n    0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f,\n    0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda,\n    0xbe9834ed},\n   {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504,\n    0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49,\n    0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e,\n    0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192,\n    0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859,\n    0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c,\n    0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620,\n    0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265,\n    0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae,\n    0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2,\n    0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175,\n    0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38,\n    0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05,\n    0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40,\n    0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f,\n    0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca,\n    0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850,\n    0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d,\n    0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da,\n    0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864,\n    0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af,\n    0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea,\n    0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74,\n    0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31,\n    0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa,\n    0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a,\n    0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd,\n    0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180,\n    0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a,\n    0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f,\n    0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290,\n    0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5,\n    0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed,\n    0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0,\n    0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167,\n    0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b,\n    0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0,\n    0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5,\n    0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc,\n    0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189,\n    0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842,\n    0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e,\n    0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299,\n    0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4,\n    0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec,\n    0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9,\n    0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66,\n    0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23,\n    0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9,\n    0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4,\n    0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33,\n    0x9324fd72},\n   {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n    0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n    0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n    0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n    0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n    0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n    0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n    0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n    0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n    0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n    0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n    0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n    0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n    0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n    0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n    0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n    0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n    0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n    0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n    0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n    0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n    0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n    0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n    0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n    0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n    0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n    0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n    0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n    0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n    0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n    0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n    0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n    0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n    0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n    0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n    0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n    0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n    0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n    0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n    0x2d02ef8d}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000,\n    0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000,\n    0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000,\n    0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000,\n    0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000,\n    0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000,\n    0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000,\n    0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000,\n    0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000,\n    0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000,\n    0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000,\n    0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000,\n    0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000,\n    0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000,\n    0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000,\n    0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000,\n    0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000,\n    0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000,\n    0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000,\n    0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000,\n    0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000,\n    0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000,\n    0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000,\n    0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000,\n    0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000,\n    0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000,\n    0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000,\n    0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000,\n    0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000,\n    0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000,\n    0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000,\n    0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000,\n    0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000,\n    0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000,\n    0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000,\n    0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000,\n    0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000,\n    0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000,\n    0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000,\n    0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000,\n    0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000,\n    0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000,\n    0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000,\n    0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000,\n    0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000,\n    0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000,\n    0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000,\n    0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000,\n    0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000,\n    0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000,\n    0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000,\n    0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000,\n    0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000,\n    0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000,\n    0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000,\n    0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000,\n    0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000,\n    0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000,\n    0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000,\n    0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000,\n    0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000,\n    0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000,\n    0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000,\n    0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000,\n    0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000,\n    0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000,\n    0x8567077200000000, 0x1357000500000000, 0x824abf9500000000,\n    0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000,\n    0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000,\n    0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000,\n    0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000,\n    0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000,\n    0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000,\n    0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000,\n    0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000,\n    0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000,\n    0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000,\n    0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000,\n    0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000,\n    0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000,\n    0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000,\n    0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000,\n    0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000,\n    0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000,\n    0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000,\n    0x8def022d00000000},\n   {0x0000000000000000, 0x41311b1900000000, 0x8262363200000000,\n    0xc3532d2b00000000, 0x04c56c6400000000, 0x45f4777d00000000,\n    0x86a75a5600000000, 0xc796414f00000000, 0x088ad9c800000000,\n    0x49bbc2d100000000, 0x8ae8effa00000000, 0xcbd9f4e300000000,\n    0x0c4fb5ac00000000, 0x4d7eaeb500000000, 0x8e2d839e00000000,\n    0xcf1c988700000000, 0x5112c24a00000000, 0x1023d95300000000,\n    0xd370f47800000000, 0x9241ef6100000000, 0x55d7ae2e00000000,\n    0x14e6b53700000000, 0xd7b5981c00000000, 0x9684830500000000,\n    0x59981b8200000000, 0x18a9009b00000000, 0xdbfa2db000000000,\n    0x9acb36a900000000, 0x5d5d77e600000000, 0x1c6c6cff00000000,\n    0xdf3f41d400000000, 0x9e0e5acd00000000, 0xa224849500000000,\n    0xe3159f8c00000000, 0x2046b2a700000000, 0x6177a9be00000000,\n    0xa6e1e8f100000000, 0xe7d0f3e800000000, 0x2483dec300000000,\n    0x65b2c5da00000000, 0xaaae5d5d00000000, 0xeb9f464400000000,\n    0x28cc6b6f00000000, 0x69fd707600000000, 0xae6b313900000000,\n    0xef5a2a2000000000, 0x2c09070b00000000, 0x6d381c1200000000,\n    0xf33646df00000000, 0xb2075dc600000000, 0x715470ed00000000,\n    0x30656bf400000000, 0xf7f32abb00000000, 0xb6c231a200000000,\n    0x75911c8900000000, 0x34a0079000000000, 0xfbbc9f1700000000,\n    0xba8d840e00000000, 0x79dea92500000000, 0x38efb23c00000000,\n    0xff79f37300000000, 0xbe48e86a00000000, 0x7d1bc54100000000,\n    0x3c2ade5800000000, 0x054f79f000000000, 0x447e62e900000000,\n    0x872d4fc200000000, 0xc61c54db00000000, 0x018a159400000000,\n    0x40bb0e8d00000000, 0x83e823a600000000, 0xc2d938bf00000000,\n    0x0dc5a03800000000, 0x4cf4bb2100000000, 0x8fa7960a00000000,\n    0xce968d1300000000, 0x0900cc5c00000000, 0x4831d74500000000,\n    0x8b62fa6e00000000, 0xca53e17700000000, 0x545dbbba00000000,\n    0x156ca0a300000000, 0xd63f8d8800000000, 0x970e969100000000,\n    0x5098d7de00000000, 0x11a9ccc700000000, 0xd2fae1ec00000000,\n    0x93cbfaf500000000, 0x5cd7627200000000, 0x1de6796b00000000,\n    0xdeb5544000000000, 0x9f844f5900000000, 0x58120e1600000000,\n    0x1923150f00000000, 0xda70382400000000, 0x9b41233d00000000,\n    0xa76bfd6500000000, 0xe65ae67c00000000, 0x2509cb5700000000,\n    0x6438d04e00000000, 0xa3ae910100000000, 0xe29f8a1800000000,\n    0x21cca73300000000, 0x60fdbc2a00000000, 0xafe124ad00000000,\n    0xeed03fb400000000, 0x2d83129f00000000, 0x6cb2098600000000,\n    0xab2448c900000000, 0xea1553d000000000, 0x29467efb00000000,\n    0x687765e200000000, 0xf6793f2f00000000, 0xb748243600000000,\n    0x741b091d00000000, 0x352a120400000000, 0xf2bc534b00000000,\n    0xb38d485200000000, 0x70de657900000000, 0x31ef7e6000000000,\n    0xfef3e6e700000000, 0xbfc2fdfe00000000, 0x7c91d0d500000000,\n    0x3da0cbcc00000000, 0xfa368a8300000000, 0xbb07919a00000000,\n    0x7854bcb100000000, 0x3965a7a800000000, 0x4b98833b00000000,\n    0x0aa9982200000000, 0xc9fab50900000000, 0x88cbae1000000000,\n    0x4f5def5f00000000, 0x0e6cf44600000000, 0xcd3fd96d00000000,\n    0x8c0ec27400000000, 0x43125af300000000, 0x022341ea00000000,\n    0xc1706cc100000000, 0x804177d800000000, 0x47d7369700000000,\n    0x06e62d8e00000000, 0xc5b500a500000000, 0x84841bbc00000000,\n    0x1a8a417100000000, 0x5bbb5a6800000000, 0x98e8774300000000,\n    0xd9d96c5a00000000, 0x1e4f2d1500000000, 0x5f7e360c00000000,\n    0x9c2d1b2700000000, 0xdd1c003e00000000, 0x120098b900000000,\n    0x533183a000000000, 0x9062ae8b00000000, 0xd153b59200000000,\n    0x16c5f4dd00000000, 0x57f4efc400000000, 0x94a7c2ef00000000,\n    0xd596d9f600000000, 0xe9bc07ae00000000, 0xa88d1cb700000000,\n    0x6bde319c00000000, 0x2aef2a8500000000, 0xed796bca00000000,\n    0xac4870d300000000, 0x6f1b5df800000000, 0x2e2a46e100000000,\n    0xe136de6600000000, 0xa007c57f00000000, 0x6354e85400000000,\n    0x2265f34d00000000, 0xe5f3b20200000000, 0xa4c2a91b00000000,\n    0x6791843000000000, 0x26a09f2900000000, 0xb8aec5e400000000,\n    0xf99fdefd00000000, 0x3accf3d600000000, 0x7bfde8cf00000000,\n    0xbc6ba98000000000, 0xfd5ab29900000000, 0x3e099fb200000000,\n    0x7f3884ab00000000, 0xb0241c2c00000000, 0xf115073500000000,\n    0x32462a1e00000000, 0x7377310700000000, 0xb4e1704800000000,\n    0xf5d06b5100000000, 0x3683467a00000000, 0x77b25d6300000000,\n    0x4ed7facb00000000, 0x0fe6e1d200000000, 0xccb5ccf900000000,\n    0x8d84d7e000000000, 0x4a1296af00000000, 0x0b238db600000000,\n    0xc870a09d00000000, 0x8941bb8400000000, 0x465d230300000000,\n    0x076c381a00000000, 0xc43f153100000000, 0x850e0e2800000000,\n    0x42984f6700000000, 0x03a9547e00000000, 0xc0fa795500000000,\n    0x81cb624c00000000, 0x1fc5388100000000, 0x5ef4239800000000,\n    0x9da70eb300000000, 0xdc9615aa00000000, 0x1b0054e500000000,\n    0x5a314ffc00000000, 0x996262d700000000, 0xd85379ce00000000,\n    0x174fe14900000000, 0x567efa5000000000, 0x952dd77b00000000,\n    0xd41ccc6200000000, 0x138a8d2d00000000, 0x52bb963400000000,\n    0x91e8bb1f00000000, 0xd0d9a00600000000, 0xecf37e5e00000000,\n    0xadc2654700000000, 0x6e91486c00000000, 0x2fa0537500000000,\n    0xe836123a00000000, 0xa907092300000000, 0x6a54240800000000,\n    0x2b653f1100000000, 0xe479a79600000000, 0xa548bc8f00000000,\n    0x661b91a400000000, 0x272a8abd00000000, 0xe0bccbf200000000,\n    0xa18dd0eb00000000, 0x62defdc000000000, 0x23efe6d900000000,\n    0xbde1bc1400000000, 0xfcd0a70d00000000, 0x3f838a2600000000,\n    0x7eb2913f00000000, 0xb924d07000000000, 0xf815cb6900000000,\n    0x3b46e64200000000, 0x7a77fd5b00000000, 0xb56b65dc00000000,\n    0xf45a7ec500000000, 0x370953ee00000000, 0x763848f700000000,\n    0xb1ae09b800000000, 0xf09f12a100000000, 0x33cc3f8a00000000,\n    0x72fd249300000000},\n   {0x0000000000000000, 0x376ac20100000000, 0x6ed4840300000000,\n    0x59be460200000000, 0xdca8090700000000, 0xebc2cb0600000000,\n    0xb27c8d0400000000, 0x85164f0500000000, 0xb851130e00000000,\n    0x8f3bd10f00000000, 0xd685970d00000000, 0xe1ef550c00000000,\n    0x64f91a0900000000, 0x5393d80800000000, 0x0a2d9e0a00000000,\n    0x3d475c0b00000000, 0x70a3261c00000000, 0x47c9e41d00000000,\n    0x1e77a21f00000000, 0x291d601e00000000, 0xac0b2f1b00000000,\n    0x9b61ed1a00000000, 0xc2dfab1800000000, 0xf5b5691900000000,\n    0xc8f2351200000000, 0xff98f71300000000, 0xa626b11100000000,\n    0x914c731000000000, 0x145a3c1500000000, 0x2330fe1400000000,\n    0x7a8eb81600000000, 0x4de47a1700000000, 0xe0464d3800000000,\n    0xd72c8f3900000000, 0x8e92c93b00000000, 0xb9f80b3a00000000,\n    0x3cee443f00000000, 0x0b84863e00000000, 0x523ac03c00000000,\n    0x6550023d00000000, 0x58175e3600000000, 0x6f7d9c3700000000,\n    0x36c3da3500000000, 0x01a9183400000000, 0x84bf573100000000,\n    0xb3d5953000000000, 0xea6bd33200000000, 0xdd01113300000000,\n    0x90e56b2400000000, 0xa78fa92500000000, 0xfe31ef2700000000,\n    0xc95b2d2600000000, 0x4c4d622300000000, 0x7b27a02200000000,\n    0x2299e62000000000, 0x15f3242100000000, 0x28b4782a00000000,\n    0x1fdeba2b00000000, 0x4660fc2900000000, 0x710a3e2800000000,\n    0xf41c712d00000000, 0xc376b32c00000000, 0x9ac8f52e00000000,\n    0xada2372f00000000, 0xc08d9a7000000000, 0xf7e7587100000000,\n    0xae591e7300000000, 0x9933dc7200000000, 0x1c25937700000000,\n    0x2b4f517600000000, 0x72f1177400000000, 0x459bd57500000000,\n    0x78dc897e00000000, 0x4fb64b7f00000000, 0x16080d7d00000000,\n    0x2162cf7c00000000, 0xa474807900000000, 0x931e427800000000,\n    0xcaa0047a00000000, 0xfdcac67b00000000, 0xb02ebc6c00000000,\n    0x87447e6d00000000, 0xdefa386f00000000, 0xe990fa6e00000000,\n    0x6c86b56b00000000, 0x5bec776a00000000, 0x0252316800000000,\n    0x3538f36900000000, 0x087faf6200000000, 0x3f156d6300000000,\n    0x66ab2b6100000000, 0x51c1e96000000000, 0xd4d7a66500000000,\n    0xe3bd646400000000, 0xba03226600000000, 0x8d69e06700000000,\n    0x20cbd74800000000, 0x17a1154900000000, 0x4e1f534b00000000,\n    0x7975914a00000000, 0xfc63de4f00000000, 0xcb091c4e00000000,\n    0x92b75a4c00000000, 0xa5dd984d00000000, 0x989ac44600000000,\n    0xaff0064700000000, 0xf64e404500000000, 0xc124824400000000,\n    0x4432cd4100000000, 0x73580f4000000000, 0x2ae6494200000000,\n    0x1d8c8b4300000000, 0x5068f15400000000, 0x6702335500000000,\n    0x3ebc755700000000, 0x09d6b75600000000, 0x8cc0f85300000000,\n    0xbbaa3a5200000000, 0xe2147c5000000000, 0xd57ebe5100000000,\n    0xe839e25a00000000, 0xdf53205b00000000, 0x86ed665900000000,\n    0xb187a45800000000, 0x3491eb5d00000000, 0x03fb295c00000000,\n    0x5a456f5e00000000, 0x6d2fad5f00000000, 0x801b35e100000000,\n    0xb771f7e000000000, 0xeecfb1e200000000, 0xd9a573e300000000,\n    0x5cb33ce600000000, 0x6bd9fee700000000, 0x3267b8e500000000,\n    0x050d7ae400000000, 0x384a26ef00000000, 0x0f20e4ee00000000,\n    0x569ea2ec00000000, 0x61f460ed00000000, 0xe4e22fe800000000,\n    0xd388ede900000000, 0x8a36abeb00000000, 0xbd5c69ea00000000,\n    0xf0b813fd00000000, 0xc7d2d1fc00000000, 0x9e6c97fe00000000,\n    0xa90655ff00000000, 0x2c101afa00000000, 0x1b7ad8fb00000000,\n    0x42c49ef900000000, 0x75ae5cf800000000, 0x48e900f300000000,\n    0x7f83c2f200000000, 0x263d84f000000000, 0x115746f100000000,\n    0x944109f400000000, 0xa32bcbf500000000, 0xfa958df700000000,\n    0xcdff4ff600000000, 0x605d78d900000000, 0x5737bad800000000,\n    0x0e89fcda00000000, 0x39e33edb00000000, 0xbcf571de00000000,\n    0x8b9fb3df00000000, 0xd221f5dd00000000, 0xe54b37dc00000000,\n    0xd80c6bd700000000, 0xef66a9d600000000, 0xb6d8efd400000000,\n    0x81b22dd500000000, 0x04a462d000000000, 0x33cea0d100000000,\n    0x6a70e6d300000000, 0x5d1a24d200000000, 0x10fe5ec500000000,\n    0x27949cc400000000, 0x7e2adac600000000, 0x494018c700000000,\n    0xcc5657c200000000, 0xfb3c95c300000000, 0xa282d3c100000000,\n    0x95e811c000000000, 0xa8af4dcb00000000, 0x9fc58fca00000000,\n    0xc67bc9c800000000, 0xf1110bc900000000, 0x740744cc00000000,\n    0x436d86cd00000000, 0x1ad3c0cf00000000, 0x2db902ce00000000,\n    0x4096af9100000000, 0x77fc6d9000000000, 0x2e422b9200000000,\n    0x1928e99300000000, 0x9c3ea69600000000, 0xab54649700000000,\n    0xf2ea229500000000, 0xc580e09400000000, 0xf8c7bc9f00000000,\n    0xcfad7e9e00000000, 0x9613389c00000000, 0xa179fa9d00000000,\n    0x246fb59800000000, 0x1305779900000000, 0x4abb319b00000000,\n    0x7dd1f39a00000000, 0x3035898d00000000, 0x075f4b8c00000000,\n    0x5ee10d8e00000000, 0x698bcf8f00000000, 0xec9d808a00000000,\n    0xdbf7428b00000000, 0x8249048900000000, 0xb523c68800000000,\n    0x88649a8300000000, 0xbf0e588200000000, 0xe6b01e8000000000,\n    0xd1dadc8100000000, 0x54cc938400000000, 0x63a6518500000000,\n    0x3a18178700000000, 0x0d72d58600000000, 0xa0d0e2a900000000,\n    0x97ba20a800000000, 0xce0466aa00000000, 0xf96ea4ab00000000,\n    0x7c78ebae00000000, 0x4b1229af00000000, 0x12ac6fad00000000,\n    0x25c6adac00000000, 0x1881f1a700000000, 0x2feb33a600000000,\n    0x765575a400000000, 0x413fb7a500000000, 0xc429f8a000000000,\n    0xf3433aa100000000, 0xaafd7ca300000000, 0x9d97bea200000000,\n    0xd073c4b500000000, 0xe71906b400000000, 0xbea740b600000000,\n    0x89cd82b700000000, 0x0cdbcdb200000000, 0x3bb10fb300000000,\n    0x620f49b100000000, 0x55658bb000000000, 0x6822d7bb00000000,\n    0x5f4815ba00000000, 0x06f653b800000000, 0x319c91b900000000,\n    0xb48adebc00000000, 0x83e01cbd00000000, 0xda5e5abf00000000,\n    0xed3498be00000000},\n   {0x0000000000000000, 0x6567bcb800000000, 0x8bc809aa00000000,\n    0xeeafb51200000000, 0x5797628f00000000, 0x32f0de3700000000,\n    0xdc5f6b2500000000, 0xb938d79d00000000, 0xef28b4c500000000,\n    0x8a4f087d00000000, 0x64e0bd6f00000000, 0x018701d700000000,\n    0xb8bfd64a00000000, 0xddd86af200000000, 0x3377dfe000000000,\n    0x5610635800000000, 0x9f57195000000000, 0xfa30a5e800000000,\n    0x149f10fa00000000, 0x71f8ac4200000000, 0xc8c07bdf00000000,\n    0xada7c76700000000, 0x4308727500000000, 0x266fcecd00000000,\n    0x707fad9500000000, 0x1518112d00000000, 0xfbb7a43f00000000,\n    0x9ed0188700000000, 0x27e8cf1a00000000, 0x428f73a200000000,\n    0xac20c6b000000000, 0xc9477a0800000000, 0x3eaf32a000000000,\n    0x5bc88e1800000000, 0xb5673b0a00000000, 0xd00087b200000000,\n    0x6938502f00000000, 0x0c5fec9700000000, 0xe2f0598500000000,\n    0x8797e53d00000000, 0xd187866500000000, 0xb4e03add00000000,\n    0x5a4f8fcf00000000, 0x3f28337700000000, 0x8610e4ea00000000,\n    0xe377585200000000, 0x0dd8ed4000000000, 0x68bf51f800000000,\n    0xa1f82bf000000000, 0xc49f974800000000, 0x2a30225a00000000,\n    0x4f579ee200000000, 0xf66f497f00000000, 0x9308f5c700000000,\n    0x7da740d500000000, 0x18c0fc6d00000000, 0x4ed09f3500000000,\n    0x2bb7238d00000000, 0xc518969f00000000, 0xa07f2a2700000000,\n    0x1947fdba00000000, 0x7c20410200000000, 0x928ff41000000000,\n    0xf7e848a800000000, 0x3d58149b00000000, 0x583fa82300000000,\n    0xb6901d3100000000, 0xd3f7a18900000000, 0x6acf761400000000,\n    0x0fa8caac00000000, 0xe1077fbe00000000, 0x8460c30600000000,\n    0xd270a05e00000000, 0xb7171ce600000000, 0x59b8a9f400000000,\n    0x3cdf154c00000000, 0x85e7c2d100000000, 0xe0807e6900000000,\n    0x0e2fcb7b00000000, 0x6b4877c300000000, 0xa20f0dcb00000000,\n    0xc768b17300000000, 0x29c7046100000000, 0x4ca0b8d900000000,\n    0xf5986f4400000000, 0x90ffd3fc00000000, 0x7e5066ee00000000,\n    0x1b37da5600000000, 0x4d27b90e00000000, 0x284005b600000000,\n    0xc6efb0a400000000, 0xa3880c1c00000000, 0x1ab0db8100000000,\n    0x7fd7673900000000, 0x9178d22b00000000, 0xf41f6e9300000000,\n    0x03f7263b00000000, 0x66909a8300000000, 0x883f2f9100000000,\n    0xed58932900000000, 0x546044b400000000, 0x3107f80c00000000,\n    0xdfa84d1e00000000, 0xbacff1a600000000, 0xecdf92fe00000000,\n    0x89b82e4600000000, 0x67179b5400000000, 0x027027ec00000000,\n    0xbb48f07100000000, 0xde2f4cc900000000, 0x3080f9db00000000,\n    0x55e7456300000000, 0x9ca03f6b00000000, 0xf9c783d300000000,\n    0x176836c100000000, 0x720f8a7900000000, 0xcb375de400000000,\n    0xae50e15c00000000, 0x40ff544e00000000, 0x2598e8f600000000,\n    0x73888bae00000000, 0x16ef371600000000, 0xf840820400000000,\n    0x9d273ebc00000000, 0x241fe92100000000, 0x4178559900000000,\n    0xafd7e08b00000000, 0xcab05c3300000000, 0x3bb659ed00000000,\n    0x5ed1e55500000000, 0xb07e504700000000, 0xd519ecff00000000,\n    0x6c213b6200000000, 0x094687da00000000, 0xe7e932c800000000,\n    0x828e8e7000000000, 0xd49eed2800000000, 0xb1f9519000000000,\n    0x5f56e48200000000, 0x3a31583a00000000, 0x83098fa700000000,\n    0xe66e331f00000000, 0x08c1860d00000000, 0x6da63ab500000000,\n    0xa4e140bd00000000, 0xc186fc0500000000, 0x2f29491700000000,\n    0x4a4ef5af00000000, 0xf376223200000000, 0x96119e8a00000000,\n    0x78be2b9800000000, 0x1dd9972000000000, 0x4bc9f47800000000,\n    0x2eae48c000000000, 0xc001fdd200000000, 0xa566416a00000000,\n    0x1c5e96f700000000, 0x79392a4f00000000, 0x97969f5d00000000,\n    0xf2f123e500000000, 0x05196b4d00000000, 0x607ed7f500000000,\n    0x8ed162e700000000, 0xebb6de5f00000000, 0x528e09c200000000,\n    0x37e9b57a00000000, 0xd946006800000000, 0xbc21bcd000000000,\n    0xea31df8800000000, 0x8f56633000000000, 0x61f9d62200000000,\n    0x049e6a9a00000000, 0xbda6bd0700000000, 0xd8c101bf00000000,\n    0x366eb4ad00000000, 0x5309081500000000, 0x9a4e721d00000000,\n    0xff29cea500000000, 0x11867bb700000000, 0x74e1c70f00000000,\n    0xcdd9109200000000, 0xa8beac2a00000000, 0x4611193800000000,\n    0x2376a58000000000, 0x7566c6d800000000, 0x10017a6000000000,\n    0xfeaecf7200000000, 0x9bc973ca00000000, 0x22f1a45700000000,\n    0x479618ef00000000, 0xa939adfd00000000, 0xcc5e114500000000,\n    0x06ee4d7600000000, 0x6389f1ce00000000, 0x8d2644dc00000000,\n    0xe841f86400000000, 0x51792ff900000000, 0x341e934100000000,\n    0xdab1265300000000, 0xbfd69aeb00000000, 0xe9c6f9b300000000,\n    0x8ca1450b00000000, 0x620ef01900000000, 0x07694ca100000000,\n    0xbe519b3c00000000, 0xdb36278400000000, 0x3599929600000000,\n    0x50fe2e2e00000000, 0x99b9542600000000, 0xfcdee89e00000000,\n    0x12715d8c00000000, 0x7716e13400000000, 0xce2e36a900000000,\n    0xab498a1100000000, 0x45e63f0300000000, 0x208183bb00000000,\n    0x7691e0e300000000, 0x13f65c5b00000000, 0xfd59e94900000000,\n    0x983e55f100000000, 0x2106826c00000000, 0x44613ed400000000,\n    0xaace8bc600000000, 0xcfa9377e00000000, 0x38417fd600000000,\n    0x5d26c36e00000000, 0xb389767c00000000, 0xd6eecac400000000,\n    0x6fd61d5900000000, 0x0ab1a1e100000000, 0xe41e14f300000000,\n    0x8179a84b00000000, 0xd769cb1300000000, 0xb20e77ab00000000,\n    0x5ca1c2b900000000, 0x39c67e0100000000, 0x80fea99c00000000,\n    0xe599152400000000, 0x0b36a03600000000, 0x6e511c8e00000000,\n    0xa716668600000000, 0xc271da3e00000000, 0x2cde6f2c00000000,\n    0x49b9d39400000000, 0xf081040900000000, 0x95e6b8b100000000,\n    0x7b490da300000000, 0x1e2eb11b00000000, 0x483ed24300000000,\n    0x2d596efb00000000, 0xc3f6dbe900000000, 0xa691675100000000,\n    0x1fa9b0cc00000000, 0x7ace0c7400000000, 0x9461b96600000000,\n    0xf10605de00000000},\n   {0x0000000000000000, 0xb029603d00000000, 0x6053c07a00000000,\n    0xd07aa04700000000, 0xc0a680f500000000, 0x708fe0c800000000,\n    0xa0f5408f00000000, 0x10dc20b200000000, 0xc14b703000000000,\n    0x7162100d00000000, 0xa118b04a00000000, 0x1131d07700000000,\n    0x01edf0c500000000, 0xb1c490f800000000, 0x61be30bf00000000,\n    0xd197508200000000, 0x8297e06000000000, 0x32be805d00000000,\n    0xe2c4201a00000000, 0x52ed402700000000, 0x4231609500000000,\n    0xf21800a800000000, 0x2262a0ef00000000, 0x924bc0d200000000,\n    0x43dc905000000000, 0xf3f5f06d00000000, 0x238f502a00000000,\n    0x93a6301700000000, 0x837a10a500000000, 0x3353709800000000,\n    0xe329d0df00000000, 0x5300b0e200000000, 0x042fc1c100000000,\n    0xb406a1fc00000000, 0x647c01bb00000000, 0xd455618600000000,\n    0xc489413400000000, 0x74a0210900000000, 0xa4da814e00000000,\n    0x14f3e17300000000, 0xc564b1f100000000, 0x754dd1cc00000000,\n    0xa537718b00000000, 0x151e11b600000000, 0x05c2310400000000,\n    0xb5eb513900000000, 0x6591f17e00000000, 0xd5b8914300000000,\n    0x86b821a100000000, 0x3691419c00000000, 0xe6ebe1db00000000,\n    0x56c281e600000000, 0x461ea15400000000, 0xf637c16900000000,\n    0x264d612e00000000, 0x9664011300000000, 0x47f3519100000000,\n    0xf7da31ac00000000, 0x27a091eb00000000, 0x9789f1d600000000,\n    0x8755d16400000000, 0x377cb15900000000, 0xe706111e00000000,\n    0x572f712300000000, 0x4958f35800000000, 0xf971936500000000,\n    0x290b332200000000, 0x9922531f00000000, 0x89fe73ad00000000,\n    0x39d7139000000000, 0xe9adb3d700000000, 0x5984d3ea00000000,\n    0x8813836800000000, 0x383ae35500000000, 0xe840431200000000,\n    0x5869232f00000000, 0x48b5039d00000000, 0xf89c63a000000000,\n    0x28e6c3e700000000, 0x98cfa3da00000000, 0xcbcf133800000000,\n    0x7be6730500000000, 0xab9cd34200000000, 0x1bb5b37f00000000,\n    0x0b6993cd00000000, 0xbb40f3f000000000, 0x6b3a53b700000000,\n    0xdb13338a00000000, 0x0a84630800000000, 0xbaad033500000000,\n    0x6ad7a37200000000, 0xdafec34f00000000, 0xca22e3fd00000000,\n    0x7a0b83c000000000, 0xaa71238700000000, 0x1a5843ba00000000,\n    0x4d77329900000000, 0xfd5e52a400000000, 0x2d24f2e300000000,\n    0x9d0d92de00000000, 0x8dd1b26c00000000, 0x3df8d25100000000,\n    0xed82721600000000, 0x5dab122b00000000, 0x8c3c42a900000000,\n    0x3c15229400000000, 0xec6f82d300000000, 0x5c46e2ee00000000,\n    0x4c9ac25c00000000, 0xfcb3a26100000000, 0x2cc9022600000000,\n    0x9ce0621b00000000, 0xcfe0d2f900000000, 0x7fc9b2c400000000,\n    0xafb3128300000000, 0x1f9a72be00000000, 0x0f46520c00000000,\n    0xbf6f323100000000, 0x6f15927600000000, 0xdf3cf24b00000000,\n    0x0eaba2c900000000, 0xbe82c2f400000000, 0x6ef862b300000000,\n    0xded1028e00000000, 0xce0d223c00000000, 0x7e24420100000000,\n    0xae5ee24600000000, 0x1e77827b00000000, 0x92b0e6b100000000,\n    0x2299868c00000000, 0xf2e326cb00000000, 0x42ca46f600000000,\n    0x5216664400000000, 0xe23f067900000000, 0x3245a63e00000000,\n    0x826cc60300000000, 0x53fb968100000000, 0xe3d2f6bc00000000,\n    0x33a856fb00000000, 0x838136c600000000, 0x935d167400000000,\n    0x2374764900000000, 0xf30ed60e00000000, 0x4327b63300000000,\n    0x102706d100000000, 0xa00e66ec00000000, 0x7074c6ab00000000,\n    0xc05da69600000000, 0xd081862400000000, 0x60a8e61900000000,\n    0xb0d2465e00000000, 0x00fb266300000000, 0xd16c76e100000000,\n    0x614516dc00000000, 0xb13fb69b00000000, 0x0116d6a600000000,\n    0x11caf61400000000, 0xa1e3962900000000, 0x7199366e00000000,\n    0xc1b0565300000000, 0x969f277000000000, 0x26b6474d00000000,\n    0xf6cce70a00000000, 0x46e5873700000000, 0x5639a78500000000,\n    0xe610c7b800000000, 0x366a67ff00000000, 0x864307c200000000,\n    0x57d4574000000000, 0xe7fd377d00000000, 0x3787973a00000000,\n    0x87aef70700000000, 0x9772d7b500000000, 0x275bb78800000000,\n    0xf72117cf00000000, 0x470877f200000000, 0x1408c71000000000,\n    0xa421a72d00000000, 0x745b076a00000000, 0xc472675700000000,\n    0xd4ae47e500000000, 0x648727d800000000, 0xb4fd879f00000000,\n    0x04d4e7a200000000, 0xd543b72000000000, 0x656ad71d00000000,\n    0xb510775a00000000, 0x0539176700000000, 0x15e537d500000000,\n    0xa5cc57e800000000, 0x75b6f7af00000000, 0xc59f979200000000,\n    0xdbe815e900000000, 0x6bc175d400000000, 0xbbbbd59300000000,\n    0x0b92b5ae00000000, 0x1b4e951c00000000, 0xab67f52100000000,\n    0x7b1d556600000000, 0xcb34355b00000000, 0x1aa365d900000000,\n    0xaa8a05e400000000, 0x7af0a5a300000000, 0xcad9c59e00000000,\n    0xda05e52c00000000, 0x6a2c851100000000, 0xba56255600000000,\n    0x0a7f456b00000000, 0x597ff58900000000, 0xe95695b400000000,\n    0x392c35f300000000, 0x890555ce00000000, 0x99d9757c00000000,\n    0x29f0154100000000, 0xf98ab50600000000, 0x49a3d53b00000000,\n    0x983485b900000000, 0x281de58400000000, 0xf86745c300000000,\n    0x484e25fe00000000, 0x5892054c00000000, 0xe8bb657100000000,\n    0x38c1c53600000000, 0x88e8a50b00000000, 0xdfc7d42800000000,\n    0x6feeb41500000000, 0xbf94145200000000, 0x0fbd746f00000000,\n    0x1f6154dd00000000, 0xaf4834e000000000, 0x7f3294a700000000,\n    0xcf1bf49a00000000, 0x1e8ca41800000000, 0xaea5c42500000000,\n    0x7edf646200000000, 0xcef6045f00000000, 0xde2a24ed00000000,\n    0x6e0344d000000000, 0xbe79e49700000000, 0x0e5084aa00000000,\n    0x5d50344800000000, 0xed79547500000000, 0x3d03f43200000000,\n    0x8d2a940f00000000, 0x9df6b4bd00000000, 0x2ddfd48000000000,\n    0xfda574c700000000, 0x4d8c14fa00000000, 0x9c1b447800000000,\n    0x2c32244500000000, 0xfc48840200000000, 0x4c61e43f00000000,\n    0x5cbdc48d00000000, 0xec94a4b000000000, 0x3cee04f700000000,\n    0x8cc764ca00000000},\n   {0x0000000000000000, 0xa5d35ccb00000000, 0x0ba1c84d00000000,\n    0xae72948600000000, 0x1642919b00000000, 0xb391cd5000000000,\n    0x1de359d600000000, 0xb830051d00000000, 0x6d8253ec00000000,\n    0xc8510f2700000000, 0x66239ba100000000, 0xc3f0c76a00000000,\n    0x7bc0c27700000000, 0xde139ebc00000000, 0x70610a3a00000000,\n    0xd5b256f100000000, 0x9b02d60300000000, 0x3ed18ac800000000,\n    0x90a31e4e00000000, 0x3570428500000000, 0x8d40479800000000,\n    0x28931b5300000000, 0x86e18fd500000000, 0x2332d31e00000000,\n    0xf68085ef00000000, 0x5353d92400000000, 0xfd214da200000000,\n    0x58f2116900000000, 0xe0c2147400000000, 0x451148bf00000000,\n    0xeb63dc3900000000, 0x4eb080f200000000, 0x3605ac0700000000,\n    0x93d6f0cc00000000, 0x3da4644a00000000, 0x9877388100000000,\n    0x20473d9c00000000, 0x8594615700000000, 0x2be6f5d100000000,\n    0x8e35a91a00000000, 0x5b87ffeb00000000, 0xfe54a32000000000,\n    0x502637a600000000, 0xf5f56b6d00000000, 0x4dc56e7000000000,\n    0xe81632bb00000000, 0x4664a63d00000000, 0xe3b7faf600000000,\n    0xad077a0400000000, 0x08d426cf00000000, 0xa6a6b24900000000,\n    0x0375ee8200000000, 0xbb45eb9f00000000, 0x1e96b75400000000,\n    0xb0e423d200000000, 0x15377f1900000000, 0xc08529e800000000,\n    0x6556752300000000, 0xcb24e1a500000000, 0x6ef7bd6e00000000,\n    0xd6c7b87300000000, 0x7314e4b800000000, 0xdd66703e00000000,\n    0x78b52cf500000000, 0x6c0a580f00000000, 0xc9d904c400000000,\n    0x67ab904200000000, 0xc278cc8900000000, 0x7a48c99400000000,\n    0xdf9b955f00000000, 0x71e901d900000000, 0xd43a5d1200000000,\n    0x01880be300000000, 0xa45b572800000000, 0x0a29c3ae00000000,\n    0xaffa9f6500000000, 0x17ca9a7800000000, 0xb219c6b300000000,\n    0x1c6b523500000000, 0xb9b80efe00000000, 0xf7088e0c00000000,\n    0x52dbd2c700000000, 0xfca9464100000000, 0x597a1a8a00000000,\n    0xe14a1f9700000000, 0x4499435c00000000, 0xeaebd7da00000000,\n    0x4f388b1100000000, 0x9a8adde000000000, 0x3f59812b00000000,\n    0x912b15ad00000000, 0x34f8496600000000, 0x8cc84c7b00000000,\n    0x291b10b000000000, 0x8769843600000000, 0x22bad8fd00000000,\n    0x5a0ff40800000000, 0xffdca8c300000000, 0x51ae3c4500000000,\n    0xf47d608e00000000, 0x4c4d659300000000, 0xe99e395800000000,\n    0x47ecadde00000000, 0xe23ff11500000000, 0x378da7e400000000,\n    0x925efb2f00000000, 0x3c2c6fa900000000, 0x99ff336200000000,\n    0x21cf367f00000000, 0x841c6ab400000000, 0x2a6efe3200000000,\n    0x8fbda2f900000000, 0xc10d220b00000000, 0x64de7ec000000000,\n    0xcaacea4600000000, 0x6f7fb68d00000000, 0xd74fb39000000000,\n    0x729cef5b00000000, 0xdcee7bdd00000000, 0x793d271600000000,\n    0xac8f71e700000000, 0x095c2d2c00000000, 0xa72eb9aa00000000,\n    0x02fde56100000000, 0xbacde07c00000000, 0x1f1ebcb700000000,\n    0xb16c283100000000, 0x14bf74fa00000000, 0xd814b01e00000000,\n    0x7dc7ecd500000000, 0xd3b5785300000000, 0x7666249800000000,\n    0xce56218500000000, 0x6b857d4e00000000, 0xc5f7e9c800000000,\n    0x6024b50300000000, 0xb596e3f200000000, 0x1045bf3900000000,\n    0xbe372bbf00000000, 0x1be4777400000000, 0xa3d4726900000000,\n    0x06072ea200000000, 0xa875ba2400000000, 0x0da6e6ef00000000,\n    0x4316661d00000000, 0xe6c53ad600000000, 0x48b7ae5000000000,\n    0xed64f29b00000000, 0x5554f78600000000, 0xf087ab4d00000000,\n    0x5ef53fcb00000000, 0xfb26630000000000, 0x2e9435f100000000,\n    0x8b47693a00000000, 0x2535fdbc00000000, 0x80e6a17700000000,\n    0x38d6a46a00000000, 0x9d05f8a100000000, 0x33776c2700000000,\n    0x96a430ec00000000, 0xee111c1900000000, 0x4bc240d200000000,\n    0xe5b0d45400000000, 0x4063889f00000000, 0xf8538d8200000000,\n    0x5d80d14900000000, 0xf3f245cf00000000, 0x5621190400000000,\n    0x83934ff500000000, 0x2640133e00000000, 0x883287b800000000,\n    0x2de1db7300000000, 0x95d1de6e00000000, 0x300282a500000000,\n    0x9e70162300000000, 0x3ba34ae800000000, 0x7513ca1a00000000,\n    0xd0c096d100000000, 0x7eb2025700000000, 0xdb615e9c00000000,\n    0x63515b8100000000, 0xc682074a00000000, 0x68f093cc00000000,\n    0xcd23cf0700000000, 0x189199f600000000, 0xbd42c53d00000000,\n    0x133051bb00000000, 0xb6e30d7000000000, 0x0ed3086d00000000,\n    0xab0054a600000000, 0x0572c02000000000, 0xa0a19ceb00000000,\n    0xb41ee81100000000, 0x11cdb4da00000000, 0xbfbf205c00000000,\n    0x1a6c7c9700000000, 0xa25c798a00000000, 0x078f254100000000,\n    0xa9fdb1c700000000, 0x0c2eed0c00000000, 0xd99cbbfd00000000,\n    0x7c4fe73600000000, 0xd23d73b000000000, 0x77ee2f7b00000000,\n    0xcfde2a6600000000, 0x6a0d76ad00000000, 0xc47fe22b00000000,\n    0x61acbee000000000, 0x2f1c3e1200000000, 0x8acf62d900000000,\n    0x24bdf65f00000000, 0x816eaa9400000000, 0x395eaf8900000000,\n    0x9c8df34200000000, 0x32ff67c400000000, 0x972c3b0f00000000,\n    0x429e6dfe00000000, 0xe74d313500000000, 0x493fa5b300000000,\n    0xececf97800000000, 0x54dcfc6500000000, 0xf10fa0ae00000000,\n    0x5f7d342800000000, 0xfaae68e300000000, 0x821b441600000000,\n    0x27c818dd00000000, 0x89ba8c5b00000000, 0x2c69d09000000000,\n    0x9459d58d00000000, 0x318a894600000000, 0x9ff81dc000000000,\n    0x3a2b410b00000000, 0xef9917fa00000000, 0x4a4a4b3100000000,\n    0xe438dfb700000000, 0x41eb837c00000000, 0xf9db866100000000,\n    0x5c08daaa00000000, 0xf27a4e2c00000000, 0x57a912e700000000,\n    0x1919921500000000, 0xbccacede00000000, 0x12b85a5800000000,\n    0xb76b069300000000, 0x0f5b038e00000000, 0xaa885f4500000000,\n    0x04facbc300000000, 0xa129970800000000, 0x749bc1f900000000,\n    0xd1489d3200000000, 0x7f3a09b400000000, 0xdae9557f00000000,\n    0x62d9506200000000, 0xc70a0ca900000000, 0x6978982f00000000,\n    0xccabc4e400000000},\n   {0x0000000000000000, 0xb40b77a600000000, 0x29119f9700000000,\n    0x9d1ae83100000000, 0x13244ff400000000, 0xa72f385200000000,\n    0x3a35d06300000000, 0x8e3ea7c500000000, 0x674eef3300000000,\n    0xd345989500000000, 0x4e5f70a400000000, 0xfa54070200000000,\n    0x746aa0c700000000, 0xc061d76100000000, 0x5d7b3f5000000000,\n    0xe97048f600000000, 0xce9cde6700000000, 0x7a97a9c100000000,\n    0xe78d41f000000000, 0x5386365600000000, 0xddb8919300000000,\n    0x69b3e63500000000, 0xf4a90e0400000000, 0x40a279a200000000,\n    0xa9d2315400000000, 0x1dd946f200000000, 0x80c3aec300000000,\n    0x34c8d96500000000, 0xbaf67ea000000000, 0x0efd090600000000,\n    0x93e7e13700000000, 0x27ec969100000000, 0x9c39bdcf00000000,\n    0x2832ca6900000000, 0xb528225800000000, 0x012355fe00000000,\n    0x8f1df23b00000000, 0x3b16859d00000000, 0xa60c6dac00000000,\n    0x12071a0a00000000, 0xfb7752fc00000000, 0x4f7c255a00000000,\n    0xd266cd6b00000000, 0x666dbacd00000000, 0xe8531d0800000000,\n    0x5c586aae00000000, 0xc142829f00000000, 0x7549f53900000000,\n    0x52a563a800000000, 0xe6ae140e00000000, 0x7bb4fc3f00000000,\n    0xcfbf8b9900000000, 0x41812c5c00000000, 0xf58a5bfa00000000,\n    0x6890b3cb00000000, 0xdc9bc46d00000000, 0x35eb8c9b00000000,\n    0x81e0fb3d00000000, 0x1cfa130c00000000, 0xa8f164aa00000000,\n    0x26cfc36f00000000, 0x92c4b4c900000000, 0x0fde5cf800000000,\n    0xbbd52b5e00000000, 0x79750b4400000000, 0xcd7e7ce200000000,\n    0x506494d300000000, 0xe46fe37500000000, 0x6a5144b000000000,\n    0xde5a331600000000, 0x4340db2700000000, 0xf74bac8100000000,\n    0x1e3be47700000000, 0xaa3093d100000000, 0x372a7be000000000,\n    0x83210c4600000000, 0x0d1fab8300000000, 0xb914dc2500000000,\n    0x240e341400000000, 0x900543b200000000, 0xb7e9d52300000000,\n    0x03e2a28500000000, 0x9ef84ab400000000, 0x2af33d1200000000,\n    0xa4cd9ad700000000, 0x10c6ed7100000000, 0x8ddc054000000000,\n    0x39d772e600000000, 0xd0a73a1000000000, 0x64ac4db600000000,\n    0xf9b6a58700000000, 0x4dbdd22100000000, 0xc38375e400000000,\n    0x7788024200000000, 0xea92ea7300000000, 0x5e999dd500000000,\n    0xe54cb68b00000000, 0x5147c12d00000000, 0xcc5d291c00000000,\n    0x78565eba00000000, 0xf668f97f00000000, 0x42638ed900000000,\n    0xdf7966e800000000, 0x6b72114e00000000, 0x820259b800000000,\n    0x36092e1e00000000, 0xab13c62f00000000, 0x1f18b18900000000,\n    0x9126164c00000000, 0x252d61ea00000000, 0xb83789db00000000,\n    0x0c3cfe7d00000000, 0x2bd068ec00000000, 0x9fdb1f4a00000000,\n    0x02c1f77b00000000, 0xb6ca80dd00000000, 0x38f4271800000000,\n    0x8cff50be00000000, 0x11e5b88f00000000, 0xa5eecf2900000000,\n    0x4c9e87df00000000, 0xf895f07900000000, 0x658f184800000000,\n    0xd1846fee00000000, 0x5fbac82b00000000, 0xebb1bf8d00000000,\n    0x76ab57bc00000000, 0xc2a0201a00000000, 0xf2ea168800000000,\n    0x46e1612e00000000, 0xdbfb891f00000000, 0x6ff0feb900000000,\n    0xe1ce597c00000000, 0x55c52eda00000000, 0xc8dfc6eb00000000,\n    0x7cd4b14d00000000, 0x95a4f9bb00000000, 0x21af8e1d00000000,\n    0xbcb5662c00000000, 0x08be118a00000000, 0x8680b64f00000000,\n    0x328bc1e900000000, 0xaf9129d800000000, 0x1b9a5e7e00000000,\n    0x3c76c8ef00000000, 0x887dbf4900000000, 0x1567577800000000,\n    0xa16c20de00000000, 0x2f52871b00000000, 0x9b59f0bd00000000,\n    0x0643188c00000000, 0xb2486f2a00000000, 0x5b3827dc00000000,\n    0xef33507a00000000, 0x7229b84b00000000, 0xc622cfed00000000,\n    0x481c682800000000, 0xfc171f8e00000000, 0x610df7bf00000000,\n    0xd506801900000000, 0x6ed3ab4700000000, 0xdad8dce100000000,\n    0x47c234d000000000, 0xf3c9437600000000, 0x7df7e4b300000000,\n    0xc9fc931500000000, 0x54e67b2400000000, 0xe0ed0c8200000000,\n    0x099d447400000000, 0xbd9633d200000000, 0x208cdbe300000000,\n    0x9487ac4500000000, 0x1ab90b8000000000, 0xaeb27c2600000000,\n    0x33a8941700000000, 0x87a3e3b100000000, 0xa04f752000000000,\n    0x1444028600000000, 0x895eeab700000000, 0x3d559d1100000000,\n    0xb36b3ad400000000, 0x07604d7200000000, 0x9a7aa54300000000,\n    0x2e71d2e500000000, 0xc7019a1300000000, 0x730aedb500000000,\n    0xee10058400000000, 0x5a1b722200000000, 0xd425d5e700000000,\n    0x602ea24100000000, 0xfd344a7000000000, 0x493f3dd600000000,\n    0x8b9f1dcc00000000, 0x3f946a6a00000000, 0xa28e825b00000000,\n    0x1685f5fd00000000, 0x98bb523800000000, 0x2cb0259e00000000,\n    0xb1aacdaf00000000, 0x05a1ba0900000000, 0xecd1f2ff00000000,\n    0x58da855900000000, 0xc5c06d6800000000, 0x71cb1ace00000000,\n    0xfff5bd0b00000000, 0x4bfecaad00000000, 0xd6e4229c00000000,\n    0x62ef553a00000000, 0x4503c3ab00000000, 0xf108b40d00000000,\n    0x6c125c3c00000000, 0xd8192b9a00000000, 0x56278c5f00000000,\n    0xe22cfbf900000000, 0x7f3613c800000000, 0xcb3d646e00000000,\n    0x224d2c9800000000, 0x96465b3e00000000, 0x0b5cb30f00000000,\n    0xbf57c4a900000000, 0x3169636c00000000, 0x856214ca00000000,\n    0x1878fcfb00000000, 0xac738b5d00000000, 0x17a6a00300000000,\n    0xa3add7a500000000, 0x3eb73f9400000000, 0x8abc483200000000,\n    0x0482eff700000000, 0xb089985100000000, 0x2d93706000000000,\n    0x999807c600000000, 0x70e84f3000000000, 0xc4e3389600000000,\n    0x59f9d0a700000000, 0xedf2a70100000000, 0x63cc00c400000000,\n    0xd7c7776200000000, 0x4add9f5300000000, 0xfed6e8f500000000,\n    0xd93a7e6400000000, 0x6d3109c200000000, 0xf02be1f300000000,\n    0x4420965500000000, 0xca1e319000000000, 0x7e15463600000000,\n    0xe30fae0700000000, 0x5704d9a100000000, 0xbe74915700000000,\n    0x0a7fe6f100000000, 0x97650ec000000000, 0x236e796600000000,\n    0xad50dea300000000, 0x195ba90500000000, 0x8441413400000000,\n    0x304a369200000000},\n   {0x0000000000000000, 0x9e00aacc00000000, 0x7d07254200000000,\n    0xe3078f8e00000000, 0xfa0e4a8400000000, 0x640ee04800000000,\n    0x87096fc600000000, 0x1909c50a00000000, 0xb51be5d300000000,\n    0x2b1b4f1f00000000, 0xc81cc09100000000, 0x561c6a5d00000000,\n    0x4f15af5700000000, 0xd115059b00000000, 0x32128a1500000000,\n    0xac1220d900000000, 0x2b31bb7c00000000, 0xb53111b000000000,\n    0x56369e3e00000000, 0xc83634f200000000, 0xd13ff1f800000000,\n    0x4f3f5b3400000000, 0xac38d4ba00000000, 0x32387e7600000000,\n    0x9e2a5eaf00000000, 0x002af46300000000, 0xe32d7bed00000000,\n    0x7d2dd12100000000, 0x6424142b00000000, 0xfa24bee700000000,\n    0x1923316900000000, 0x87239ba500000000, 0x566276f900000000,\n    0xc862dc3500000000, 0x2b6553bb00000000, 0xb565f97700000000,\n    0xac6c3c7d00000000, 0x326c96b100000000, 0xd16b193f00000000,\n    0x4f6bb3f300000000, 0xe379932a00000000, 0x7d7939e600000000,\n    0x9e7eb66800000000, 0x007e1ca400000000, 0x1977d9ae00000000,\n    0x8777736200000000, 0x6470fcec00000000, 0xfa70562000000000,\n    0x7d53cd8500000000, 0xe353674900000000, 0x0054e8c700000000,\n    0x9e54420b00000000, 0x875d870100000000, 0x195d2dcd00000000,\n    0xfa5aa24300000000, 0x645a088f00000000, 0xc848285600000000,\n    0x5648829a00000000, 0xb54f0d1400000000, 0x2b4fa7d800000000,\n    0x324662d200000000, 0xac46c81e00000000, 0x4f41479000000000,\n    0xd141ed5c00000000, 0xedc29d2900000000, 0x73c237e500000000,\n    0x90c5b86b00000000, 0x0ec512a700000000, 0x17ccd7ad00000000,\n    0x89cc7d6100000000, 0x6acbf2ef00000000, 0xf4cb582300000000,\n    0x58d978fa00000000, 0xc6d9d23600000000, 0x25de5db800000000,\n    0xbbdef77400000000, 0xa2d7327e00000000, 0x3cd798b200000000,\n    0xdfd0173c00000000, 0x41d0bdf000000000, 0xc6f3265500000000,\n    0x58f38c9900000000, 0xbbf4031700000000, 0x25f4a9db00000000,\n    0x3cfd6cd100000000, 0xa2fdc61d00000000, 0x41fa499300000000,\n    0xdffae35f00000000, 0x73e8c38600000000, 0xede8694a00000000,\n    0x0eefe6c400000000, 0x90ef4c0800000000, 0x89e6890200000000,\n    0x17e623ce00000000, 0xf4e1ac4000000000, 0x6ae1068c00000000,\n    0xbba0ebd000000000, 0x25a0411c00000000, 0xc6a7ce9200000000,\n    0x58a7645e00000000, 0x41aea15400000000, 0xdfae0b9800000000,\n    0x3ca9841600000000, 0xa2a92eda00000000, 0x0ebb0e0300000000,\n    0x90bba4cf00000000, 0x73bc2b4100000000, 0xedbc818d00000000,\n    0xf4b5448700000000, 0x6ab5ee4b00000000, 0x89b261c500000000,\n    0x17b2cb0900000000, 0x909150ac00000000, 0x0e91fa6000000000,\n    0xed9675ee00000000, 0x7396df2200000000, 0x6a9f1a2800000000,\n    0xf49fb0e400000000, 0x17983f6a00000000, 0x899895a600000000,\n    0x258ab57f00000000, 0xbb8a1fb300000000, 0x588d903d00000000,\n    0xc68d3af100000000, 0xdf84fffb00000000, 0x4184553700000000,\n    0xa283dab900000000, 0x3c83707500000000, 0xda853b5300000000,\n    0x4485919f00000000, 0xa7821e1100000000, 0x3982b4dd00000000,\n    0x208b71d700000000, 0xbe8bdb1b00000000, 0x5d8c549500000000,\n    0xc38cfe5900000000, 0x6f9ede8000000000, 0xf19e744c00000000,\n    0x1299fbc200000000, 0x8c99510e00000000, 0x9590940400000000,\n    0x0b903ec800000000, 0xe897b14600000000, 0x76971b8a00000000,\n    0xf1b4802f00000000, 0x6fb42ae300000000, 0x8cb3a56d00000000,\n    0x12b30fa100000000, 0x0bbacaab00000000, 0x95ba606700000000,\n    0x76bdefe900000000, 0xe8bd452500000000, 0x44af65fc00000000,\n    0xdaafcf3000000000, 0x39a840be00000000, 0xa7a8ea7200000000,\n    0xbea12f7800000000, 0x20a185b400000000, 0xc3a60a3a00000000,\n    0x5da6a0f600000000, 0x8ce74daa00000000, 0x12e7e76600000000,\n    0xf1e068e800000000, 0x6fe0c22400000000, 0x76e9072e00000000,\n    0xe8e9ade200000000, 0x0bee226c00000000, 0x95ee88a000000000,\n    0x39fca87900000000, 0xa7fc02b500000000, 0x44fb8d3b00000000,\n    0xdafb27f700000000, 0xc3f2e2fd00000000, 0x5df2483100000000,\n    0xbef5c7bf00000000, 0x20f56d7300000000, 0xa7d6f6d600000000,\n    0x39d65c1a00000000, 0xdad1d39400000000, 0x44d1795800000000,\n    0x5dd8bc5200000000, 0xc3d8169e00000000, 0x20df991000000000,\n    0xbedf33dc00000000, 0x12cd130500000000, 0x8ccdb9c900000000,\n    0x6fca364700000000, 0xf1ca9c8b00000000, 0xe8c3598100000000,\n    0x76c3f34d00000000, 0x95c47cc300000000, 0x0bc4d60f00000000,\n    0x3747a67a00000000, 0xa9470cb600000000, 0x4a40833800000000,\n    0xd44029f400000000, 0xcd49ecfe00000000, 0x5349463200000000,\n    0xb04ec9bc00000000, 0x2e4e637000000000, 0x825c43a900000000,\n    0x1c5ce96500000000, 0xff5b66eb00000000, 0x615bcc2700000000,\n    0x7852092d00000000, 0xe652a3e100000000, 0x05552c6f00000000,\n    0x9b5586a300000000, 0x1c761d0600000000, 0x8276b7ca00000000,\n    0x6171384400000000, 0xff71928800000000, 0xe678578200000000,\n    0x7878fd4e00000000, 0x9b7f72c000000000, 0x057fd80c00000000,\n    0xa96df8d500000000, 0x376d521900000000, 0xd46add9700000000,\n    0x4a6a775b00000000, 0x5363b25100000000, 0xcd63189d00000000,\n    0x2e64971300000000, 0xb0643ddf00000000, 0x6125d08300000000,\n    0xff257a4f00000000, 0x1c22f5c100000000, 0x82225f0d00000000,\n    0x9b2b9a0700000000, 0x052b30cb00000000, 0xe62cbf4500000000,\n    0x782c158900000000, 0xd43e355000000000, 0x4a3e9f9c00000000,\n    0xa939101200000000, 0x3739bade00000000, 0x2e307fd400000000,\n    0xb030d51800000000, 0x53375a9600000000, 0xcd37f05a00000000,\n    0x4a146bff00000000, 0xd414c13300000000, 0x37134ebd00000000,\n    0xa913e47100000000, 0xb01a217b00000000, 0x2e1a8bb700000000,\n    0xcd1d043900000000, 0x531daef500000000, 0xff0f8e2c00000000,\n    0x610f24e000000000, 0x8208ab6e00000000, 0x1c0801a200000000,\n    0x0501c4a800000000, 0x9b016e6400000000, 0x7806e1ea00000000,\n    0xe6064b2600000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757,\n    0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a,\n    0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733,\n    0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871,\n    0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70,\n    0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42,\n    0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5,\n    0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787,\n    0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086,\n    0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4,\n    0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d,\n    0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0,\n    0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d,\n    0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f,\n    0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859,\n    0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b,\n    0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5,\n    0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028,\n    0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891,\n    0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed,\n    0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec,\n    0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde,\n    0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817,\n    0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825,\n    0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24,\n    0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e,\n    0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7,\n    0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a,\n    0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4,\n    0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196,\n    0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0,\n    0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2,\n    0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52,\n    0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f,\n    0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36,\n    0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174,\n    0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675,\n    0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647,\n    0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d,\n    0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf,\n    0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be,\n    0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc,\n    0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645,\n    0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98,\n    0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138,\n    0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a,\n    0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c,\n    0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e,\n    0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0,\n    0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d,\n    0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194,\n    0xde0506f1},\n   {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc,\n    0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f,\n    0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a,\n    0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29,\n    0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8,\n    0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023,\n    0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e,\n    0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065,\n    0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84,\n    0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7,\n    0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922,\n    0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71,\n    0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0,\n    0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b,\n    0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816,\n    0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd,\n    0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c,\n    0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f,\n    0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba,\n    0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579,\n    0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98,\n    0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873,\n    0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e,\n    0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5,\n    0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134,\n    0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7,\n    0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732,\n    0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461,\n    0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0,\n    0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b,\n    0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26,\n    0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd,\n    0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc,\n    0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef,\n    0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a,\n    0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049,\n    0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8,\n    0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43,\n    0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e,\n    0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5,\n    0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24,\n    0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07,\n    0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982,\n    0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1,\n    0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0,\n    0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b,\n    0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576,\n    0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d,\n    0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c,\n    0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f,\n    0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda,\n    0xbe9834ed},\n   {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504,\n    0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49,\n    0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e,\n    0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192,\n    0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859,\n    0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c,\n    0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620,\n    0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265,\n    0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae,\n    0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2,\n    0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175,\n    0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38,\n    0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05,\n    0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40,\n    0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f,\n    0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca,\n    0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850,\n    0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d,\n    0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da,\n    0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864,\n    0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af,\n    0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea,\n    0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74,\n    0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31,\n    0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa,\n    0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a,\n    0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd,\n    0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180,\n    0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a,\n    0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f,\n    0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290,\n    0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5,\n    0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed,\n    0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0,\n    0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167,\n    0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b,\n    0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0,\n    0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5,\n    0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc,\n    0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189,\n    0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842,\n    0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e,\n    0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299,\n    0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4,\n    0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec,\n    0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9,\n    0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66,\n    0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23,\n    0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9,\n    0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4,\n    0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33,\n    0x9324fd72},\n   {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n    0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n    0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n    0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n    0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n    0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n    0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n    0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n    0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n    0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n    0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n    0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n    0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n    0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n    0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n    0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n    0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n    0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n    0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n    0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n    0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n    0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n    0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n    0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n    0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n    0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n    0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n    0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n    0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n    0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n    0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n    0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n    0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n    0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n    0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n    0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n    0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n    0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n    0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n    0x2d02ef8d}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07,\n    0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79,\n    0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7,\n    0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84,\n    0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13,\n    0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663,\n    0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5,\n    0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5,\n    0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832,\n    0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51,\n    0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf,\n    0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1,\n    0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76,\n    0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606,\n    0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996,\n    0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6,\n    0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c,\n    0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712,\n    0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c,\n    0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4,\n    0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943,\n    0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333,\n    0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe,\n    0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce,\n    0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359,\n    0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a,\n    0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04,\n    0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a,\n    0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0,\n    0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580,\n    0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10,\n    0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060,\n    0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1,\n    0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf,\n    0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31,\n    0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852,\n    0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5,\n    0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5,\n    0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75,\n    0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005,\n    0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292,\n    0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1,\n    0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f,\n    0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111,\n    0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0,\n    0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0,\n    0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40,\n    0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530,\n    0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba,\n    0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4,\n    0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a,\n    0x8def022d},\n   {0x00000000, 0x41311b19, 0x82623632, 0xc3532d2b, 0x04c56c64,\n    0x45f4777d, 0x86a75a56, 0xc796414f, 0x088ad9c8, 0x49bbc2d1,\n    0x8ae8effa, 0xcbd9f4e3, 0x0c4fb5ac, 0x4d7eaeb5, 0x8e2d839e,\n    0xcf1c9887, 0x5112c24a, 0x1023d953, 0xd370f478, 0x9241ef61,\n    0x55d7ae2e, 0x14e6b537, 0xd7b5981c, 0x96848305, 0x59981b82,\n    0x18a9009b, 0xdbfa2db0, 0x9acb36a9, 0x5d5d77e6, 0x1c6c6cff,\n    0xdf3f41d4, 0x9e0e5acd, 0xa2248495, 0xe3159f8c, 0x2046b2a7,\n    0x6177a9be, 0xa6e1e8f1, 0xe7d0f3e8, 0x2483dec3, 0x65b2c5da,\n    0xaaae5d5d, 0xeb9f4644, 0x28cc6b6f, 0x69fd7076, 0xae6b3139,\n    0xef5a2a20, 0x2c09070b, 0x6d381c12, 0xf33646df, 0xb2075dc6,\n    0x715470ed, 0x30656bf4, 0xf7f32abb, 0xb6c231a2, 0x75911c89,\n    0x34a00790, 0xfbbc9f17, 0xba8d840e, 0x79dea925, 0x38efb23c,\n    0xff79f373, 0xbe48e86a, 0x7d1bc541, 0x3c2ade58, 0x054f79f0,\n    0x447e62e9, 0x872d4fc2, 0xc61c54db, 0x018a1594, 0x40bb0e8d,\n    0x83e823a6, 0xc2d938bf, 0x0dc5a038, 0x4cf4bb21, 0x8fa7960a,\n    0xce968d13, 0x0900cc5c, 0x4831d745, 0x8b62fa6e, 0xca53e177,\n    0x545dbbba, 0x156ca0a3, 0xd63f8d88, 0x970e9691, 0x5098d7de,\n    0x11a9ccc7, 0xd2fae1ec, 0x93cbfaf5, 0x5cd76272, 0x1de6796b,\n    0xdeb55440, 0x9f844f59, 0x58120e16, 0x1923150f, 0xda703824,\n    0x9b41233d, 0xa76bfd65, 0xe65ae67c, 0x2509cb57, 0x6438d04e,\n    0xa3ae9101, 0xe29f8a18, 0x21cca733, 0x60fdbc2a, 0xafe124ad,\n    0xeed03fb4, 0x2d83129f, 0x6cb20986, 0xab2448c9, 0xea1553d0,\n    0x29467efb, 0x687765e2, 0xf6793f2f, 0xb7482436, 0x741b091d,\n    0x352a1204, 0xf2bc534b, 0xb38d4852, 0x70de6579, 0x31ef7e60,\n    0xfef3e6e7, 0xbfc2fdfe, 0x7c91d0d5, 0x3da0cbcc, 0xfa368a83,\n    0xbb07919a, 0x7854bcb1, 0x3965a7a8, 0x4b98833b, 0x0aa99822,\n    0xc9fab509, 0x88cbae10, 0x4f5def5f, 0x0e6cf446, 0xcd3fd96d,\n    0x8c0ec274, 0x43125af3, 0x022341ea, 0xc1706cc1, 0x804177d8,\n    0x47d73697, 0x06e62d8e, 0xc5b500a5, 0x84841bbc, 0x1a8a4171,\n    0x5bbb5a68, 0x98e87743, 0xd9d96c5a, 0x1e4f2d15, 0x5f7e360c,\n    0x9c2d1b27, 0xdd1c003e, 0x120098b9, 0x533183a0, 0x9062ae8b,\n    0xd153b592, 0x16c5f4dd, 0x57f4efc4, 0x94a7c2ef, 0xd596d9f6,\n    0xe9bc07ae, 0xa88d1cb7, 0x6bde319c, 0x2aef2a85, 0xed796bca,\n    0xac4870d3, 0x6f1b5df8, 0x2e2a46e1, 0xe136de66, 0xa007c57f,\n    0x6354e854, 0x2265f34d, 0xe5f3b202, 0xa4c2a91b, 0x67918430,\n    0x26a09f29, 0xb8aec5e4, 0xf99fdefd, 0x3accf3d6, 0x7bfde8cf,\n    0xbc6ba980, 0xfd5ab299, 0x3e099fb2, 0x7f3884ab, 0xb0241c2c,\n    0xf1150735, 0x32462a1e, 0x73773107, 0xb4e17048, 0xf5d06b51,\n    0x3683467a, 0x77b25d63, 0x4ed7facb, 0x0fe6e1d2, 0xccb5ccf9,\n    0x8d84d7e0, 0x4a1296af, 0x0b238db6, 0xc870a09d, 0x8941bb84,\n    0x465d2303, 0x076c381a, 0xc43f1531, 0x850e0e28, 0x42984f67,\n    0x03a9547e, 0xc0fa7955, 0x81cb624c, 0x1fc53881, 0x5ef42398,\n    0x9da70eb3, 0xdc9615aa, 0x1b0054e5, 0x5a314ffc, 0x996262d7,\n    0xd85379ce, 0x174fe149, 0x567efa50, 0x952dd77b, 0xd41ccc62,\n    0x138a8d2d, 0x52bb9634, 0x91e8bb1f, 0xd0d9a006, 0xecf37e5e,\n    0xadc26547, 0x6e91486c, 0x2fa05375, 0xe836123a, 0xa9070923,\n    0x6a542408, 0x2b653f11, 0xe479a796, 0xa548bc8f, 0x661b91a4,\n    0x272a8abd, 0xe0bccbf2, 0xa18dd0eb, 0x62defdc0, 0x23efe6d9,\n    0xbde1bc14, 0xfcd0a70d, 0x3f838a26, 0x7eb2913f, 0xb924d070,\n    0xf815cb69, 0x3b46e642, 0x7a77fd5b, 0xb56b65dc, 0xf45a7ec5,\n    0x370953ee, 0x763848f7, 0xb1ae09b8, 0xf09f12a1, 0x33cc3f8a,\n    0x72fd2493},\n   {0x00000000, 0x376ac201, 0x6ed48403, 0x59be4602, 0xdca80907,\n    0xebc2cb06, 0xb27c8d04, 0x85164f05, 0xb851130e, 0x8f3bd10f,\n    0xd685970d, 0xe1ef550c, 0x64f91a09, 0x5393d808, 0x0a2d9e0a,\n    0x3d475c0b, 0x70a3261c, 0x47c9e41d, 0x1e77a21f, 0x291d601e,\n    0xac0b2f1b, 0x9b61ed1a, 0xc2dfab18, 0xf5b56919, 0xc8f23512,\n    0xff98f713, 0xa626b111, 0x914c7310, 0x145a3c15, 0x2330fe14,\n    0x7a8eb816, 0x4de47a17, 0xe0464d38, 0xd72c8f39, 0x8e92c93b,\n    0xb9f80b3a, 0x3cee443f, 0x0b84863e, 0x523ac03c, 0x6550023d,\n    0x58175e36, 0x6f7d9c37, 0x36c3da35, 0x01a91834, 0x84bf5731,\n    0xb3d59530, 0xea6bd332, 0xdd011133, 0x90e56b24, 0xa78fa925,\n    0xfe31ef27, 0xc95b2d26, 0x4c4d6223, 0x7b27a022, 0x2299e620,\n    0x15f32421, 0x28b4782a, 0x1fdeba2b, 0x4660fc29, 0x710a3e28,\n    0xf41c712d, 0xc376b32c, 0x9ac8f52e, 0xada2372f, 0xc08d9a70,\n    0xf7e75871, 0xae591e73, 0x9933dc72, 0x1c259377, 0x2b4f5176,\n    0x72f11774, 0x459bd575, 0x78dc897e, 0x4fb64b7f, 0x16080d7d,\n    0x2162cf7c, 0xa4748079, 0x931e4278, 0xcaa0047a, 0xfdcac67b,\n    0xb02ebc6c, 0x87447e6d, 0xdefa386f, 0xe990fa6e, 0x6c86b56b,\n    0x5bec776a, 0x02523168, 0x3538f369, 0x087faf62, 0x3f156d63,\n    0x66ab2b61, 0x51c1e960, 0xd4d7a665, 0xe3bd6464, 0xba032266,\n    0x8d69e067, 0x20cbd748, 0x17a11549, 0x4e1f534b, 0x7975914a,\n    0xfc63de4f, 0xcb091c4e, 0x92b75a4c, 0xa5dd984d, 0x989ac446,\n    0xaff00647, 0xf64e4045, 0xc1248244, 0x4432cd41, 0x73580f40,\n    0x2ae64942, 0x1d8c8b43, 0x5068f154, 0x67023355, 0x3ebc7557,\n    0x09d6b756, 0x8cc0f853, 0xbbaa3a52, 0xe2147c50, 0xd57ebe51,\n    0xe839e25a, 0xdf53205b, 0x86ed6659, 0xb187a458, 0x3491eb5d,\n    0x03fb295c, 0x5a456f5e, 0x6d2fad5f, 0x801b35e1, 0xb771f7e0,\n    0xeecfb1e2, 0xd9a573e3, 0x5cb33ce6, 0x6bd9fee7, 0x3267b8e5,\n    0x050d7ae4, 0x384a26ef, 0x0f20e4ee, 0x569ea2ec, 0x61f460ed,\n    0xe4e22fe8, 0xd388ede9, 0x8a36abeb, 0xbd5c69ea, 0xf0b813fd,\n    0xc7d2d1fc, 0x9e6c97fe, 0xa90655ff, 0x2c101afa, 0x1b7ad8fb,\n    0x42c49ef9, 0x75ae5cf8, 0x48e900f3, 0x7f83c2f2, 0x263d84f0,\n    0x115746f1, 0x944109f4, 0xa32bcbf5, 0xfa958df7, 0xcdff4ff6,\n    0x605d78d9, 0x5737bad8, 0x0e89fcda, 0x39e33edb, 0xbcf571de,\n    0x8b9fb3df, 0xd221f5dd, 0xe54b37dc, 0xd80c6bd7, 0xef66a9d6,\n    0xb6d8efd4, 0x81b22dd5, 0x04a462d0, 0x33cea0d1, 0x6a70e6d3,\n    0x5d1a24d2, 0x10fe5ec5, 0x27949cc4, 0x7e2adac6, 0x494018c7,\n    0xcc5657c2, 0xfb3c95c3, 0xa282d3c1, 0x95e811c0, 0xa8af4dcb,\n    0x9fc58fca, 0xc67bc9c8, 0xf1110bc9, 0x740744cc, 0x436d86cd,\n    0x1ad3c0cf, 0x2db902ce, 0x4096af91, 0x77fc6d90, 0x2e422b92,\n    0x1928e993, 0x9c3ea696, 0xab546497, 0xf2ea2295, 0xc580e094,\n    0xf8c7bc9f, 0xcfad7e9e, 0x9613389c, 0xa179fa9d, 0x246fb598,\n    0x13057799, 0x4abb319b, 0x7dd1f39a, 0x3035898d, 0x075f4b8c,\n    0x5ee10d8e, 0x698bcf8f, 0xec9d808a, 0xdbf7428b, 0x82490489,\n    0xb523c688, 0x88649a83, 0xbf0e5882, 0xe6b01e80, 0xd1dadc81,\n    0x54cc9384, 0x63a65185, 0x3a181787, 0x0d72d586, 0xa0d0e2a9,\n    0x97ba20a8, 0xce0466aa, 0xf96ea4ab, 0x7c78ebae, 0x4b1229af,\n    0x12ac6fad, 0x25c6adac, 0x1881f1a7, 0x2feb33a6, 0x765575a4,\n    0x413fb7a5, 0xc429f8a0, 0xf3433aa1, 0xaafd7ca3, 0x9d97bea2,\n    0xd073c4b5, 0xe71906b4, 0xbea740b6, 0x89cd82b7, 0x0cdbcdb2,\n    0x3bb10fb3, 0x620f49b1, 0x55658bb0, 0x6822d7bb, 0x5f4815ba,\n    0x06f653b8, 0x319c91b9, 0xb48adebc, 0x83e01cbd, 0xda5e5abf,\n    0xed3498be},\n   {0x00000000, 0x6567bcb8, 0x8bc809aa, 0xeeafb512, 0x5797628f,\n    0x32f0de37, 0xdc5f6b25, 0xb938d79d, 0xef28b4c5, 0x8a4f087d,\n    0x64e0bd6f, 0x018701d7, 0xb8bfd64a, 0xddd86af2, 0x3377dfe0,\n    0x56106358, 0x9f571950, 0xfa30a5e8, 0x149f10fa, 0x71f8ac42,\n    0xc8c07bdf, 0xada7c767, 0x43087275, 0x266fcecd, 0x707fad95,\n    0x1518112d, 0xfbb7a43f, 0x9ed01887, 0x27e8cf1a, 0x428f73a2,\n    0xac20c6b0, 0xc9477a08, 0x3eaf32a0, 0x5bc88e18, 0xb5673b0a,\n    0xd00087b2, 0x6938502f, 0x0c5fec97, 0xe2f05985, 0x8797e53d,\n    0xd1878665, 0xb4e03add, 0x5a4f8fcf, 0x3f283377, 0x8610e4ea,\n    0xe3775852, 0x0dd8ed40, 0x68bf51f8, 0xa1f82bf0, 0xc49f9748,\n    0x2a30225a, 0x4f579ee2, 0xf66f497f, 0x9308f5c7, 0x7da740d5,\n    0x18c0fc6d, 0x4ed09f35, 0x2bb7238d, 0xc518969f, 0xa07f2a27,\n    0x1947fdba, 0x7c204102, 0x928ff410, 0xf7e848a8, 0x3d58149b,\n    0x583fa823, 0xb6901d31, 0xd3f7a189, 0x6acf7614, 0x0fa8caac,\n    0xe1077fbe, 0x8460c306, 0xd270a05e, 0xb7171ce6, 0x59b8a9f4,\n    0x3cdf154c, 0x85e7c2d1, 0xe0807e69, 0x0e2fcb7b, 0x6b4877c3,\n    0xa20f0dcb, 0xc768b173, 0x29c70461, 0x4ca0b8d9, 0xf5986f44,\n    0x90ffd3fc, 0x7e5066ee, 0x1b37da56, 0x4d27b90e, 0x284005b6,\n    0xc6efb0a4, 0xa3880c1c, 0x1ab0db81, 0x7fd76739, 0x9178d22b,\n    0xf41f6e93, 0x03f7263b, 0x66909a83, 0x883f2f91, 0xed589329,\n    0x546044b4, 0x3107f80c, 0xdfa84d1e, 0xbacff1a6, 0xecdf92fe,\n    0x89b82e46, 0x67179b54, 0x027027ec, 0xbb48f071, 0xde2f4cc9,\n    0x3080f9db, 0x55e74563, 0x9ca03f6b, 0xf9c783d3, 0x176836c1,\n    0x720f8a79, 0xcb375de4, 0xae50e15c, 0x40ff544e, 0x2598e8f6,\n    0x73888bae, 0x16ef3716, 0xf8408204, 0x9d273ebc, 0x241fe921,\n    0x41785599, 0xafd7e08b, 0xcab05c33, 0x3bb659ed, 0x5ed1e555,\n    0xb07e5047, 0xd519ecff, 0x6c213b62, 0x094687da, 0xe7e932c8,\n    0x828e8e70, 0xd49eed28, 0xb1f95190, 0x5f56e482, 0x3a31583a,\n    0x83098fa7, 0xe66e331f, 0x08c1860d, 0x6da63ab5, 0xa4e140bd,\n    0xc186fc05, 0x2f294917, 0x4a4ef5af, 0xf3762232, 0x96119e8a,\n    0x78be2b98, 0x1dd99720, 0x4bc9f478, 0x2eae48c0, 0xc001fdd2,\n    0xa566416a, 0x1c5e96f7, 0x79392a4f, 0x97969f5d, 0xf2f123e5,\n    0x05196b4d, 0x607ed7f5, 0x8ed162e7, 0xebb6de5f, 0x528e09c2,\n    0x37e9b57a, 0xd9460068, 0xbc21bcd0, 0xea31df88, 0x8f566330,\n    0x61f9d622, 0x049e6a9a, 0xbda6bd07, 0xd8c101bf, 0x366eb4ad,\n    0x53090815, 0x9a4e721d, 0xff29cea5, 0x11867bb7, 0x74e1c70f,\n    0xcdd91092, 0xa8beac2a, 0x46111938, 0x2376a580, 0x7566c6d8,\n    0x10017a60, 0xfeaecf72, 0x9bc973ca, 0x22f1a457, 0x479618ef,\n    0xa939adfd, 0xcc5e1145, 0x06ee4d76, 0x6389f1ce, 0x8d2644dc,\n    0xe841f864, 0x51792ff9, 0x341e9341, 0xdab12653, 0xbfd69aeb,\n    0xe9c6f9b3, 0x8ca1450b, 0x620ef019, 0x07694ca1, 0xbe519b3c,\n    0xdb362784, 0x35999296, 0x50fe2e2e, 0x99b95426, 0xfcdee89e,\n    0x12715d8c, 0x7716e134, 0xce2e36a9, 0xab498a11, 0x45e63f03,\n    0x208183bb, 0x7691e0e3, 0x13f65c5b, 0xfd59e949, 0x983e55f1,\n    0x2106826c, 0x44613ed4, 0xaace8bc6, 0xcfa9377e, 0x38417fd6,\n    0x5d26c36e, 0xb389767c, 0xd6eecac4, 0x6fd61d59, 0x0ab1a1e1,\n    0xe41e14f3, 0x8179a84b, 0xd769cb13, 0xb20e77ab, 0x5ca1c2b9,\n    0x39c67e01, 0x80fea99c, 0xe5991524, 0x0b36a036, 0x6e511c8e,\n    0xa7166686, 0xc271da3e, 0x2cde6f2c, 0x49b9d394, 0xf0810409,\n    0x95e6b8b1, 0x7b490da3, 0x1e2eb11b, 0x483ed243, 0x2d596efb,\n    0xc3f6dbe9, 0xa6916751, 0x1fa9b0cc, 0x7ace0c74, 0x9461b966,\n    0xf10605de}};\n\n#endif\n\n#endif\n\n#if N == 2\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87,\n    0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede,\n    0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab,\n    0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c,\n    0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1,\n    0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7,\n    0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e,\n    0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308,\n    0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5,\n    0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472,\n    0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07,\n    0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e,\n    0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa,\n    0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec,\n    0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6,\n    0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0,\n    0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3,\n    0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba,\n    0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf,\n    0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975,\n    0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8,\n    0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde,\n    0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a,\n    0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c,\n    0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1,\n    0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65,\n    0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410,\n    0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649,\n    0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a,\n    0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c,\n    0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946,\n    0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450,\n    0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e,\n    0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857,\n    0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022,\n    0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5,\n    0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758,\n    0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e,\n    0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d,\n    0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b,\n    0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6,\n    0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401,\n    0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74,\n    0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d,\n    0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073,\n    0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65,\n    0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f,\n    0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749,\n    0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a,\n    0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033,\n    0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846,\n    0x0d7139d7},\n   {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563,\n    0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f,\n    0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875,\n    0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536,\n    0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8,\n    0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43,\n    0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f,\n    0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184,\n    0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a,\n    0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39,\n    0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523,\n    0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f,\n    0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d,\n    0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6,\n    0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b,\n    0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0,\n    0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151,\n    0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d,\n    0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47,\n    0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a,\n    0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964,\n    0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef,\n    0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d,\n    0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6,\n    0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348,\n    0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53,\n    0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449,\n    0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645,\n    0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4,\n    0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f,\n    0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2,\n    0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69,\n    0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46,\n    0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a,\n    0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650,\n    0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13,\n    0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded,\n    0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366,\n    0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57,\n    0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc,\n    0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222,\n    0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61,\n    0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b,\n    0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277,\n    0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558,\n    0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3,\n    0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e,\n    0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5,\n    0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74,\n    0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78,\n    0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262,\n    0x1c53e98a},\n   {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b,\n    0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40,\n    0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580,\n    0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7,\n    0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a,\n    0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37,\n    0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75,\n    0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218,\n    0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5,\n    0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2,\n    0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02,\n    0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59,\n    0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1,\n    0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c,\n    0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a,\n    0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307,\n    0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486,\n    0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd,\n    0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d,\n    0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2,\n    0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f,\n    0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72,\n    0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8,\n    0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985,\n    0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268,\n    0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94,\n    0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454,\n    0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f,\n    0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e,\n    0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3,\n    0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915,\n    0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778,\n    0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821,\n    0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a,\n    0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba,\n    0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d,\n    0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560,\n    0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d,\n    0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe,\n    0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3,\n    0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e,\n    0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509,\n    0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9,\n    0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92,\n    0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb,\n    0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6,\n    0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50,\n    0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d,\n    0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc,\n    0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7,\n    0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927,\n    0x3f88e851},\n   {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96,\n    0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8,\n    0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0,\n    0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14,\n    0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7,\n    0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4,\n    0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe,\n    0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad,\n    0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e,\n    0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa,\n    0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2,\n    0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c,\n    0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab,\n    0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8,\n    0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d,\n    0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e,\n    0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7,\n    0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99,\n    0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1,\n    0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690,\n    0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933,\n    0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20,\n    0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf,\n    0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc,\n    0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f,\n    0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92,\n    0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca,\n    0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4,\n    0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd,\n    0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de,\n    0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb,\n    0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8,\n    0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474,\n    0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a,\n    0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252,\n    0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6,\n    0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55,\n    0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846,\n    0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7,\n    0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4,\n    0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47,\n    0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3,\n    0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb,\n    0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5,\n    0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49,\n    0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a,\n    0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f,\n    0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c,\n    0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305,\n    0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b,\n    0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523,\n    0x3dee8ca6},\n   {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f,\n    0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91,\n    0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e,\n    0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c,\n    0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02,\n    0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12,\n    0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567,\n    0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277,\n    0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679,\n    0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b,\n    0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4,\n    0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a,\n    0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0,\n    0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0,\n    0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91,\n    0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881,\n    0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173,\n    0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d,\n    0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912,\n    0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8,\n    0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6,\n    0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6,\n    0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b,\n    0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b,\n    0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75,\n    0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f,\n    0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00,\n    0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee,\n    0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c,\n    0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c,\n    0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d,\n    0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d,\n    0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67,\n    0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89,\n    0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706,\n    0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14,\n    0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a,\n    0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a,\n    0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f,\n    0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f,\n    0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591,\n    0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983,\n    0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c,\n    0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2,\n    0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8,\n    0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8,\n    0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89,\n    0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99,\n    0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b,\n    0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485,\n    0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a,\n    0x36197165},\n   {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382,\n    0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85,\n    0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06,\n    0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca,\n    0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e,\n    0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc,\n    0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616,\n    0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54,\n    0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10,\n    0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc,\n    0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f,\n    0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58,\n    0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef,\n    0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad,\n    0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b,\n    0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29,\n    0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6,\n    0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1,\n    0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622,\n    0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039,\n    0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d,\n    0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f,\n    0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32,\n    0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770,\n    0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034,\n    0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f,\n    0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc,\n    0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db,\n    0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154,\n    0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16,\n    0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0,\n    0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592,\n    0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca,\n    0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd,\n    0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e,\n    0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882,\n    0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6,\n    0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384,\n    0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1,\n    0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3,\n    0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7,\n    0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b,\n    0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8,\n    0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff,\n    0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7,\n    0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5,\n    0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23,\n    0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761,\n    0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee,\n    0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9,\n    0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a,\n    0x1a3b93aa},\n   {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a,\n    0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca,\n    0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3,\n    0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb,\n    0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c,\n    0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58,\n    0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed,\n    0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9,\n    0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e,\n    0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906,\n    0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f,\n    0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf,\n    0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0,\n    0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4,\n    0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769,\n    0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d,\n    0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632,\n    0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82,\n    0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb,\n    0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73,\n    0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484,\n    0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0,\n    0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5,\n    0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1,\n    0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516,\n    0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f,\n    0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946,\n    0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6,\n    0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9,\n    0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad,\n    0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820,\n    0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364,\n    0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab,\n    0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b,\n    0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62,\n    0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a,\n    0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd,\n    0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089,\n    0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c,\n    0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8,\n    0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f,\n    0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477,\n    0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e,\n    0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be,\n    0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71,\n    0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635,\n    0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8,\n    0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc,\n    0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3,\n    0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753,\n    0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a,\n    0xe147d714},\n   {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c,\n    0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b,\n    0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92,\n    0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4,\n    0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069,\n    0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526,\n    0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25,\n    0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a,\n    0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7,\n    0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491,\n    0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958,\n    0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f,\n    0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307,\n    0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648,\n    0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999,\n    0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6,\n    0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a,\n    0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d,\n    0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4,\n    0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61,\n    0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc,\n    0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3,\n    0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53,\n    0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c,\n    0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1,\n    0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c,\n    0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5,\n    0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92,\n    0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e,\n    0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771,\n    0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0,\n    0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def,\n    0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0,\n    0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7,\n    0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e,\n    0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58,\n    0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285,\n    0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca,\n    0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce,\n    0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81,\n    0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c,\n    0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a,\n    0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3,\n    0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4,\n    0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb,\n    0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4,\n    0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75,\n    0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a,\n    0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296,\n    0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1,\n    0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808,\n    0x494f0c4b}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0x43147b1700000000, 0x8628f62e00000000,\n    0xc53c8d3900000000, 0x0c51ec5d00000000, 0x4f45974a00000000,\n    0x8a791a7300000000, 0xc96d616400000000, 0x18a2d8bb00000000,\n    0x5bb6a3ac00000000, 0x9e8a2e9500000000, 0xdd9e558200000000,\n    0x14f334e600000000, 0x57e74ff100000000, 0x92dbc2c800000000,\n    0xd1cfb9df00000000, 0x7142c0ac00000000, 0x3256bbbb00000000,\n    0xf76a368200000000, 0xb47e4d9500000000, 0x7d132cf100000000,\n    0x3e0757e600000000, 0xfb3bdadf00000000, 0xb82fa1c800000000,\n    0x69e0181700000000, 0x2af4630000000000, 0xefc8ee3900000000,\n    0xacdc952e00000000, 0x65b1f44a00000000, 0x26a58f5d00000000,\n    0xe399026400000000, 0xa08d797300000000, 0xa382f18200000000,\n    0xe0968a9500000000, 0x25aa07ac00000000, 0x66be7cbb00000000,\n    0xafd31ddf00000000, 0xecc766c800000000, 0x29fbebf100000000,\n    0x6aef90e600000000, 0xbb20293900000000, 0xf834522e00000000,\n    0x3d08df1700000000, 0x7e1ca40000000000, 0xb771c56400000000,\n    0xf465be7300000000, 0x3159334a00000000, 0x724d485d00000000,\n    0xd2c0312e00000000, 0x91d44a3900000000, 0x54e8c70000000000,\n    0x17fcbc1700000000, 0xde91dd7300000000, 0x9d85a66400000000,\n    0x58b92b5d00000000, 0x1bad504a00000000, 0xca62e99500000000,\n    0x8976928200000000, 0x4c4a1fbb00000000, 0x0f5e64ac00000000,\n    0xc63305c800000000, 0x85277edf00000000, 0x401bf3e600000000,\n    0x030f88f100000000, 0x070392de00000000, 0x4417e9c900000000,\n    0x812b64f000000000, 0xc23f1fe700000000, 0x0b527e8300000000,\n    0x4846059400000000, 0x8d7a88ad00000000, 0xce6ef3ba00000000,\n    0x1fa14a6500000000, 0x5cb5317200000000, 0x9989bc4b00000000,\n    0xda9dc75c00000000, 0x13f0a63800000000, 0x50e4dd2f00000000,\n    0x95d8501600000000, 0xd6cc2b0100000000, 0x7641527200000000,\n    0x3555296500000000, 0xf069a45c00000000, 0xb37ddf4b00000000,\n    0x7a10be2f00000000, 0x3904c53800000000, 0xfc38480100000000,\n    0xbf2c331600000000, 0x6ee38ac900000000, 0x2df7f1de00000000,\n    0xe8cb7ce700000000, 0xabdf07f000000000, 0x62b2669400000000,\n    0x21a61d8300000000, 0xe49a90ba00000000, 0xa78eebad00000000,\n    0xa481635c00000000, 0xe795184b00000000, 0x22a9957200000000,\n    0x61bdee6500000000, 0xa8d08f0100000000, 0xebc4f41600000000,\n    0x2ef8792f00000000, 0x6dec023800000000, 0xbc23bbe700000000,\n    0xff37c0f000000000, 0x3a0b4dc900000000, 0x791f36de00000000,\n    0xb07257ba00000000, 0xf3662cad00000000, 0x365aa19400000000,\n    0x754eda8300000000, 0xd5c3a3f000000000, 0x96d7d8e700000000,\n    0x53eb55de00000000, 0x10ff2ec900000000, 0xd9924fad00000000,\n    0x9a8634ba00000000, 0x5fbab98300000000, 0x1caec29400000000,\n    0xcd617b4b00000000, 0x8e75005c00000000, 0x4b498d6500000000,\n    0x085df67200000000, 0xc130971600000000, 0x8224ec0100000000,\n    0x4718613800000000, 0x040c1a2f00000000, 0x4f00556600000000,\n    0x0c142e7100000000, 0xc928a34800000000, 0x8a3cd85f00000000,\n    0x4351b93b00000000, 0x0045c22c00000000, 0xc5794f1500000000,\n    0x866d340200000000, 0x57a28ddd00000000, 0x14b6f6ca00000000,\n    0xd18a7bf300000000, 0x929e00e400000000, 0x5bf3618000000000,\n    0x18e71a9700000000, 0xdddb97ae00000000, 0x9ecfecb900000000,\n    0x3e4295ca00000000, 0x7d56eedd00000000, 0xb86a63e400000000,\n    0xfb7e18f300000000, 0x3213799700000000, 0x7107028000000000,\n    0xb43b8fb900000000, 0xf72ff4ae00000000, 0x26e04d7100000000,\n    0x65f4366600000000, 0xa0c8bb5f00000000, 0xe3dcc04800000000,\n    0x2ab1a12c00000000, 0x69a5da3b00000000, 0xac99570200000000,\n    0xef8d2c1500000000, 0xec82a4e400000000, 0xaf96dff300000000,\n    0x6aaa52ca00000000, 0x29be29dd00000000, 0xe0d348b900000000,\n    0xa3c733ae00000000, 0x66fbbe9700000000, 0x25efc58000000000,\n    0xf4207c5f00000000, 0xb734074800000000, 0x72088a7100000000,\n    0x311cf16600000000, 0xf871900200000000, 0xbb65eb1500000000,\n    0x7e59662c00000000, 0x3d4d1d3b00000000, 0x9dc0644800000000,\n    0xded41f5f00000000, 0x1be8926600000000, 0x58fce97100000000,\n    0x9191881500000000, 0xd285f30200000000, 0x17b97e3b00000000,\n    0x54ad052c00000000, 0x8562bcf300000000, 0xc676c7e400000000,\n    0x034a4add00000000, 0x405e31ca00000000, 0x893350ae00000000,\n    0xca272bb900000000, 0x0f1ba68000000000, 0x4c0fdd9700000000,\n    0x4803c7b800000000, 0x0b17bcaf00000000, 0xce2b319600000000,\n    0x8d3f4a8100000000, 0x44522be500000000, 0x074650f200000000,\n    0xc27addcb00000000, 0x816ea6dc00000000, 0x50a11f0300000000,\n    0x13b5641400000000, 0xd689e92d00000000, 0x959d923a00000000,\n    0x5cf0f35e00000000, 0x1fe4884900000000, 0xdad8057000000000,\n    0x99cc7e6700000000, 0x3941071400000000, 0x7a557c0300000000,\n    0xbf69f13a00000000, 0xfc7d8a2d00000000, 0x3510eb4900000000,\n    0x7604905e00000000, 0xb3381d6700000000, 0xf02c667000000000,\n    0x21e3dfaf00000000, 0x62f7a4b800000000, 0xa7cb298100000000,\n    0xe4df529600000000, 0x2db233f200000000, 0x6ea648e500000000,\n    0xab9ac5dc00000000, 0xe88ebecb00000000, 0xeb81363a00000000,\n    0xa8954d2d00000000, 0x6da9c01400000000, 0x2ebdbb0300000000,\n    0xe7d0da6700000000, 0xa4c4a17000000000, 0x61f82c4900000000,\n    0x22ec575e00000000, 0xf323ee8100000000, 0xb037959600000000,\n    0x750b18af00000000, 0x361f63b800000000, 0xff7202dc00000000,\n    0xbc6679cb00000000, 0x795af4f200000000, 0x3a4e8fe500000000,\n    0x9ac3f69600000000, 0xd9d78d8100000000, 0x1ceb00b800000000,\n    0x5fff7baf00000000, 0x96921acb00000000, 0xd58661dc00000000,\n    0x10baece500000000, 0x53ae97f200000000, 0x82612e2d00000000,\n    0xc175553a00000000, 0x0449d80300000000, 0x475da31400000000,\n    0x8e30c27000000000, 0xcd24b96700000000, 0x0818345e00000000,\n    0x4b0c4f4900000000},\n   {0x0000000000000000, 0x3e6bc2ef00000000, 0x3dd0f50400000000,\n    0x03bb37eb00000000, 0x7aa0eb0900000000, 0x44cb29e600000000,\n    0x47701e0d00000000, 0x791bdce200000000, 0xf440d71300000000,\n    0xca2b15fc00000000, 0xc990221700000000, 0xf7fbe0f800000000,\n    0x8ee03c1a00000000, 0xb08bfef500000000, 0xb330c91e00000000,\n    0x8d5b0bf100000000, 0xe881ae2700000000, 0xd6ea6cc800000000,\n    0xd5515b2300000000, 0xeb3a99cc00000000, 0x9221452e00000000,\n    0xac4a87c100000000, 0xaff1b02a00000000, 0x919a72c500000000,\n    0x1cc1793400000000, 0x22aabbdb00000000, 0x21118c3000000000,\n    0x1f7a4edf00000000, 0x6661923d00000000, 0x580a50d200000000,\n    0x5bb1673900000000, 0x65daa5d600000000, 0xd0035d4f00000000,\n    0xee689fa000000000, 0xedd3a84b00000000, 0xd3b86aa400000000,\n    0xaaa3b64600000000, 0x94c874a900000000, 0x9773434200000000,\n    0xa91881ad00000000, 0x24438a5c00000000, 0x1a2848b300000000,\n    0x19937f5800000000, 0x27f8bdb700000000, 0x5ee3615500000000,\n    0x6088a3ba00000000, 0x6333945100000000, 0x5d5856be00000000,\n    0x3882f36800000000, 0x06e9318700000000, 0x0552066c00000000,\n    0x3b39c48300000000, 0x4222186100000000, 0x7c49da8e00000000,\n    0x7ff2ed6500000000, 0x41992f8a00000000, 0xccc2247b00000000,\n    0xf2a9e69400000000, 0xf112d17f00000000, 0xcf79139000000000,\n    0xb662cf7200000000, 0x88090d9d00000000, 0x8bb23a7600000000,\n    0xb5d9f89900000000, 0xa007ba9e00000000, 0x9e6c787100000000,\n    0x9dd74f9a00000000, 0xa3bc8d7500000000, 0xdaa7519700000000,\n    0xe4cc937800000000, 0xe777a49300000000, 0xd91c667c00000000,\n    0x54476d8d00000000, 0x6a2caf6200000000, 0x6997988900000000,\n    0x57fc5a6600000000, 0x2ee7868400000000, 0x108c446b00000000,\n    0x1337738000000000, 0x2d5cb16f00000000, 0x488614b900000000,\n    0x76edd65600000000, 0x7556e1bd00000000, 0x4b3d235200000000,\n    0x3226ffb000000000, 0x0c4d3d5f00000000, 0x0ff60ab400000000,\n    0x319dc85b00000000, 0xbcc6c3aa00000000, 0x82ad014500000000,\n    0x811636ae00000000, 0xbf7df44100000000, 0xc66628a300000000,\n    0xf80dea4c00000000, 0xfbb6dda700000000, 0xc5dd1f4800000000,\n    0x7004e7d100000000, 0x4e6f253e00000000, 0x4dd412d500000000,\n    0x73bfd03a00000000, 0x0aa40cd800000000, 0x34cfce3700000000,\n    0x3774f9dc00000000, 0x091f3b3300000000, 0x844430c200000000,\n    0xba2ff22d00000000, 0xb994c5c600000000, 0x87ff072900000000,\n    0xfee4dbcb00000000, 0xc08f192400000000, 0xc3342ecf00000000,\n    0xfd5fec2000000000, 0x988549f600000000, 0xa6ee8b1900000000,\n    0xa555bcf200000000, 0x9b3e7e1d00000000, 0xe225a2ff00000000,\n    0xdc4e601000000000, 0xdff557fb00000000, 0xe19e951400000000,\n    0x6cc59ee500000000, 0x52ae5c0a00000000, 0x51156be100000000,\n    0x6f7ea90e00000000, 0x166575ec00000000, 0x280eb70300000000,\n    0x2bb580e800000000, 0x15de420700000000, 0x010905e600000000,\n    0x3f62c70900000000, 0x3cd9f0e200000000, 0x02b2320d00000000,\n    0x7ba9eeef00000000, 0x45c22c0000000000, 0x46791beb00000000,\n    0x7812d90400000000, 0xf549d2f500000000, 0xcb22101a00000000,\n    0xc89927f100000000, 0xf6f2e51e00000000, 0x8fe939fc00000000,\n    0xb182fb1300000000, 0xb239ccf800000000, 0x8c520e1700000000,\n    0xe988abc100000000, 0xd7e3692e00000000, 0xd4585ec500000000,\n    0xea339c2a00000000, 0x932840c800000000, 0xad43822700000000,\n    0xaef8b5cc00000000, 0x9093772300000000, 0x1dc87cd200000000,\n    0x23a3be3d00000000, 0x201889d600000000, 0x1e734b3900000000,\n    0x676897db00000000, 0x5903553400000000, 0x5ab862df00000000,\n    0x64d3a03000000000, 0xd10a58a900000000, 0xef619a4600000000,\n    0xecdaadad00000000, 0xd2b16f4200000000, 0xabaab3a000000000,\n    0x95c1714f00000000, 0x967a46a400000000, 0xa811844b00000000,\n    0x254a8fba00000000, 0x1b214d5500000000, 0x189a7abe00000000,\n    0x26f1b85100000000, 0x5fea64b300000000, 0x6181a65c00000000,\n    0x623a91b700000000, 0x5c51535800000000, 0x398bf68e00000000,\n    0x07e0346100000000, 0x045b038a00000000, 0x3a30c16500000000,\n    0x432b1d8700000000, 0x7d40df6800000000, 0x7efbe88300000000,\n    0x40902a6c00000000, 0xcdcb219d00000000, 0xf3a0e37200000000,\n    0xf01bd49900000000, 0xce70167600000000, 0xb76bca9400000000,\n    0x8900087b00000000, 0x8abb3f9000000000, 0xb4d0fd7f00000000,\n    0xa10ebf7800000000, 0x9f657d9700000000, 0x9cde4a7c00000000,\n    0xa2b5889300000000, 0xdbae547100000000, 0xe5c5969e00000000,\n    0xe67ea17500000000, 0xd815639a00000000, 0x554e686b00000000,\n    0x6b25aa8400000000, 0x689e9d6f00000000, 0x56f55f8000000000,\n    0x2fee836200000000, 0x1185418d00000000, 0x123e766600000000,\n    0x2c55b48900000000, 0x498f115f00000000, 0x77e4d3b000000000,\n    0x745fe45b00000000, 0x4a3426b400000000, 0x332ffa5600000000,\n    0x0d4438b900000000, 0x0eff0f5200000000, 0x3094cdbd00000000,\n    0xbdcfc64c00000000, 0x83a404a300000000, 0x801f334800000000,\n    0xbe74f1a700000000, 0xc76f2d4500000000, 0xf904efaa00000000,\n    0xfabfd84100000000, 0xc4d41aae00000000, 0x710de23700000000,\n    0x4f6620d800000000, 0x4cdd173300000000, 0x72b6d5dc00000000,\n    0x0bad093e00000000, 0x35c6cbd100000000, 0x367dfc3a00000000,\n    0x08163ed500000000, 0x854d352400000000, 0xbb26f7cb00000000,\n    0xb89dc02000000000, 0x86f602cf00000000, 0xffedde2d00000000,\n    0xc1861cc200000000, 0xc23d2b2900000000, 0xfc56e9c600000000,\n    0x998c4c1000000000, 0xa7e78eff00000000, 0xa45cb91400000000,\n    0x9a377bfb00000000, 0xe32ca71900000000, 0xdd4765f600000000,\n    0xdefc521d00000000, 0xe09790f200000000, 0x6dcc9b0300000000,\n    0x53a759ec00000000, 0x501c6e0700000000, 0x6e77ace800000000,\n    0x176c700a00000000, 0x2907b2e500000000, 0x2abc850e00000000,\n    0x14d747e100000000},\n   {0x0000000000000000, 0xc0df8ec100000000, 0xc1b96c5800000000,\n    0x0166e29900000000, 0x8273d9b000000000, 0x42ac577100000000,\n    0x43cab5e800000000, 0x83153b2900000000, 0x45e1c3ba00000000,\n    0x853e4d7b00000000, 0x8458afe200000000, 0x4487212300000000,\n    0xc7921a0a00000000, 0x074d94cb00000000, 0x062b765200000000,\n    0xc6f4f89300000000, 0xcbc4f6ae00000000, 0x0b1b786f00000000,\n    0x0a7d9af600000000, 0xcaa2143700000000, 0x49b72f1e00000000,\n    0x8968a1df00000000, 0x880e434600000000, 0x48d1cd8700000000,\n    0x8e25351400000000, 0x4efabbd500000000, 0x4f9c594c00000000,\n    0x8f43d78d00000000, 0x0c56eca400000000, 0xcc89626500000000,\n    0xcdef80fc00000000, 0x0d300e3d00000000, 0xd78f9c8600000000,\n    0x1750124700000000, 0x1636f0de00000000, 0xd6e97e1f00000000,\n    0x55fc453600000000, 0x9523cbf700000000, 0x9445296e00000000,\n    0x549aa7af00000000, 0x926e5f3c00000000, 0x52b1d1fd00000000,\n    0x53d7336400000000, 0x9308bda500000000, 0x101d868c00000000,\n    0xd0c2084d00000000, 0xd1a4ead400000000, 0x117b641500000000,\n    0x1c4b6a2800000000, 0xdc94e4e900000000, 0xddf2067000000000,\n    0x1d2d88b100000000, 0x9e38b39800000000, 0x5ee73d5900000000,\n    0x5f81dfc000000000, 0x9f5e510100000000, 0x59aaa99200000000,\n    0x9975275300000000, 0x9813c5ca00000000, 0x58cc4b0b00000000,\n    0xdbd9702200000000, 0x1b06fee300000000, 0x1a601c7a00000000,\n    0xdabf92bb00000000, 0xef1948d600000000, 0x2fc6c61700000000,\n    0x2ea0248e00000000, 0xee7faa4f00000000, 0x6d6a916600000000,\n    0xadb51fa700000000, 0xacd3fd3e00000000, 0x6c0c73ff00000000,\n    0xaaf88b6c00000000, 0x6a2705ad00000000, 0x6b41e73400000000,\n    0xab9e69f500000000, 0x288b52dc00000000, 0xe854dc1d00000000,\n    0xe9323e8400000000, 0x29edb04500000000, 0x24ddbe7800000000,\n    0xe40230b900000000, 0xe564d22000000000, 0x25bb5ce100000000,\n    0xa6ae67c800000000, 0x6671e90900000000, 0x67170b9000000000,\n    0xa7c8855100000000, 0x613c7dc200000000, 0xa1e3f30300000000,\n    0xa085119a00000000, 0x605a9f5b00000000, 0xe34fa47200000000,\n    0x23902ab300000000, 0x22f6c82a00000000, 0xe22946eb00000000,\n    0x3896d45000000000, 0xf8495a9100000000, 0xf92fb80800000000,\n    0x39f036c900000000, 0xbae50de000000000, 0x7a3a832100000000,\n    0x7b5c61b800000000, 0xbb83ef7900000000, 0x7d7717ea00000000,\n    0xbda8992b00000000, 0xbcce7bb200000000, 0x7c11f57300000000,\n    0xff04ce5a00000000, 0x3fdb409b00000000, 0x3ebda20200000000,\n    0xfe622cc300000000, 0xf35222fe00000000, 0x338dac3f00000000,\n    0x32eb4ea600000000, 0xf234c06700000000, 0x7121fb4e00000000,\n    0xb1fe758f00000000, 0xb098971600000000, 0x704719d700000000,\n    0xb6b3e14400000000, 0x766c6f8500000000, 0x770a8d1c00000000,\n    0xb7d503dd00000000, 0x34c038f400000000, 0xf41fb63500000000,\n    0xf57954ac00000000, 0x35a6da6d00000000, 0x9f35e17700000000,\n    0x5fea6fb600000000, 0x5e8c8d2f00000000, 0x9e5303ee00000000,\n    0x1d4638c700000000, 0xdd99b60600000000, 0xdcff549f00000000,\n    0x1c20da5e00000000, 0xdad422cd00000000, 0x1a0bac0c00000000,\n    0x1b6d4e9500000000, 0xdbb2c05400000000, 0x58a7fb7d00000000,\n    0x987875bc00000000, 0x991e972500000000, 0x59c119e400000000,\n    0x54f117d900000000, 0x942e991800000000, 0x95487b8100000000,\n    0x5597f54000000000, 0xd682ce6900000000, 0x165d40a800000000,\n    0x173ba23100000000, 0xd7e42cf000000000, 0x1110d46300000000,\n    0xd1cf5aa200000000, 0xd0a9b83b00000000, 0x107636fa00000000,\n    0x93630dd300000000, 0x53bc831200000000, 0x52da618b00000000,\n    0x9205ef4a00000000, 0x48ba7df100000000, 0x8865f33000000000,\n    0x890311a900000000, 0x49dc9f6800000000, 0xcac9a44100000000,\n    0x0a162a8000000000, 0x0b70c81900000000, 0xcbaf46d800000000,\n    0x0d5bbe4b00000000, 0xcd84308a00000000, 0xcce2d21300000000,\n    0x0c3d5cd200000000, 0x8f2867fb00000000, 0x4ff7e93a00000000,\n    0x4e910ba300000000, 0x8e4e856200000000, 0x837e8b5f00000000,\n    0x43a1059e00000000, 0x42c7e70700000000, 0x821869c600000000,\n    0x010d52ef00000000, 0xc1d2dc2e00000000, 0xc0b43eb700000000,\n    0x006bb07600000000, 0xc69f48e500000000, 0x0640c62400000000,\n    0x072624bd00000000, 0xc7f9aa7c00000000, 0x44ec915500000000,\n    0x84331f9400000000, 0x8555fd0d00000000, 0x458a73cc00000000,\n    0x702ca9a100000000, 0xb0f3276000000000, 0xb195c5f900000000,\n    0x714a4b3800000000, 0xf25f701100000000, 0x3280fed000000000,\n    0x33e61c4900000000, 0xf339928800000000, 0x35cd6a1b00000000,\n    0xf512e4da00000000, 0xf474064300000000, 0x34ab888200000000,\n    0xb7beb3ab00000000, 0x77613d6a00000000, 0x7607dff300000000,\n    0xb6d8513200000000, 0xbbe85f0f00000000, 0x7b37d1ce00000000,\n    0x7a51335700000000, 0xba8ebd9600000000, 0x399b86bf00000000,\n    0xf944087e00000000, 0xf822eae700000000, 0x38fd642600000000,\n    0xfe099cb500000000, 0x3ed6127400000000, 0x3fb0f0ed00000000,\n    0xff6f7e2c00000000, 0x7c7a450500000000, 0xbca5cbc400000000,\n    0xbdc3295d00000000, 0x7d1ca79c00000000, 0xa7a3352700000000,\n    0x677cbbe600000000, 0x661a597f00000000, 0xa6c5d7be00000000,\n    0x25d0ec9700000000, 0xe50f625600000000, 0xe46980cf00000000,\n    0x24b60e0e00000000, 0xe242f69d00000000, 0x229d785c00000000,\n    0x23fb9ac500000000, 0xe324140400000000, 0x60312f2d00000000,\n    0xa0eea1ec00000000, 0xa188437500000000, 0x6157cdb400000000,\n    0x6c67c38900000000, 0xacb84d4800000000, 0xaddeafd100000000,\n    0x6d01211000000000, 0xee141a3900000000, 0x2ecb94f800000000,\n    0x2fad766100000000, 0xef72f8a000000000, 0x2986003300000000,\n    0xe9598ef200000000, 0xe83f6c6b00000000, 0x28e0e2aa00000000,\n    0xabf5d98300000000, 0x6b2a574200000000, 0x6a4cb5db00000000,\n    0xaa933b1a00000000},\n   {0x0000000000000000, 0x6f4ca59b00000000, 0x9f9e3bec00000000,\n    0xf0d29e7700000000, 0x7f3b060300000000, 0x1077a39800000000,\n    0xe0a53def00000000, 0x8fe9987400000000, 0xfe760c0600000000,\n    0x913aa99d00000000, 0x61e837ea00000000, 0x0ea4927100000000,\n    0x814d0a0500000000, 0xee01af9e00000000, 0x1ed331e900000000,\n    0x719f947200000000, 0xfced180c00000000, 0x93a1bd9700000000,\n    0x637323e000000000, 0x0c3f867b00000000, 0x83d61e0f00000000,\n    0xec9abb9400000000, 0x1c4825e300000000, 0x7304807800000000,\n    0x029b140a00000000, 0x6dd7b19100000000, 0x9d052fe600000000,\n    0xf2498a7d00000000, 0x7da0120900000000, 0x12ecb79200000000,\n    0xe23e29e500000000, 0x8d728c7e00000000, 0xf8db311800000000,\n    0x9797948300000000, 0x67450af400000000, 0x0809af6f00000000,\n    0x87e0371b00000000, 0xe8ac928000000000, 0x187e0cf700000000,\n    0x7732a96c00000000, 0x06ad3d1e00000000, 0x69e1988500000000,\n    0x993306f200000000, 0xf67fa36900000000, 0x79963b1d00000000,\n    0x16da9e8600000000, 0xe60800f100000000, 0x8944a56a00000000,\n    0x0436291400000000, 0x6b7a8c8f00000000, 0x9ba812f800000000,\n    0xf4e4b76300000000, 0x7b0d2f1700000000, 0x14418a8c00000000,\n    0xe49314fb00000000, 0x8bdfb16000000000, 0xfa40251200000000,\n    0x950c808900000000, 0x65de1efe00000000, 0x0a92bb6500000000,\n    0x857b231100000000, 0xea37868a00000000, 0x1ae518fd00000000,\n    0x75a9bd6600000000, 0xf0b7633000000000, 0x9ffbc6ab00000000,\n    0x6f2958dc00000000, 0x0065fd4700000000, 0x8f8c653300000000,\n    0xe0c0c0a800000000, 0x10125edf00000000, 0x7f5efb4400000000,\n    0x0ec16f3600000000, 0x618dcaad00000000, 0x915f54da00000000,\n    0xfe13f14100000000, 0x71fa693500000000, 0x1eb6ccae00000000,\n    0xee6452d900000000, 0x8128f74200000000, 0x0c5a7b3c00000000,\n    0x6316dea700000000, 0x93c440d000000000, 0xfc88e54b00000000,\n    0x73617d3f00000000, 0x1c2dd8a400000000, 0xecff46d300000000,\n    0x83b3e34800000000, 0xf22c773a00000000, 0x9d60d2a100000000,\n    0x6db24cd600000000, 0x02fee94d00000000, 0x8d17713900000000,\n    0xe25bd4a200000000, 0x12894ad500000000, 0x7dc5ef4e00000000,\n    0x086c522800000000, 0x6720f7b300000000, 0x97f269c400000000,\n    0xf8becc5f00000000, 0x7757542b00000000, 0x181bf1b000000000,\n    0xe8c96fc700000000, 0x8785ca5c00000000, 0xf61a5e2e00000000,\n    0x9956fbb500000000, 0x698465c200000000, 0x06c8c05900000000,\n    0x8921582d00000000, 0xe66dfdb600000000, 0x16bf63c100000000,\n    0x79f3c65a00000000, 0xf4814a2400000000, 0x9bcdefbf00000000,\n    0x6b1f71c800000000, 0x0453d45300000000, 0x8bba4c2700000000,\n    0xe4f6e9bc00000000, 0x142477cb00000000, 0x7b68d25000000000,\n    0x0af7462200000000, 0x65bbe3b900000000, 0x95697dce00000000,\n    0xfa25d85500000000, 0x75cc402100000000, 0x1a80e5ba00000000,\n    0xea527bcd00000000, 0x851ede5600000000, 0xe06fc76000000000,\n    0x8f2362fb00000000, 0x7ff1fc8c00000000, 0x10bd591700000000,\n    0x9f54c16300000000, 0xf01864f800000000, 0x00cafa8f00000000,\n    0x6f865f1400000000, 0x1e19cb6600000000, 0x71556efd00000000,\n    0x8187f08a00000000, 0xeecb551100000000, 0x6122cd6500000000,\n    0x0e6e68fe00000000, 0xfebcf68900000000, 0x91f0531200000000,\n    0x1c82df6c00000000, 0x73ce7af700000000, 0x831ce48000000000,\n    0xec50411b00000000, 0x63b9d96f00000000, 0x0cf57cf400000000,\n    0xfc27e28300000000, 0x936b471800000000, 0xe2f4d36a00000000,\n    0x8db876f100000000, 0x7d6ae88600000000, 0x12264d1d00000000,\n    0x9dcfd56900000000, 0xf28370f200000000, 0x0251ee8500000000,\n    0x6d1d4b1e00000000, 0x18b4f67800000000, 0x77f853e300000000,\n    0x872acd9400000000, 0xe866680f00000000, 0x678ff07b00000000,\n    0x08c355e000000000, 0xf811cb9700000000, 0x975d6e0c00000000,\n    0xe6c2fa7e00000000, 0x898e5fe500000000, 0x795cc19200000000,\n    0x1610640900000000, 0x99f9fc7d00000000, 0xf6b559e600000000,\n    0x0667c79100000000, 0x692b620a00000000, 0xe459ee7400000000,\n    0x8b154bef00000000, 0x7bc7d59800000000, 0x148b700300000000,\n    0x9b62e87700000000, 0xf42e4dec00000000, 0x04fcd39b00000000,\n    0x6bb0760000000000, 0x1a2fe27200000000, 0x756347e900000000,\n    0x85b1d99e00000000, 0xeafd7c0500000000, 0x6514e47100000000,\n    0x0a5841ea00000000, 0xfa8adf9d00000000, 0x95c67a0600000000,\n    0x10d8a45000000000, 0x7f9401cb00000000, 0x8f469fbc00000000,\n    0xe00a3a2700000000, 0x6fe3a25300000000, 0x00af07c800000000,\n    0xf07d99bf00000000, 0x9f313c2400000000, 0xeeaea85600000000,\n    0x81e20dcd00000000, 0x713093ba00000000, 0x1e7c362100000000,\n    0x9195ae5500000000, 0xfed90bce00000000, 0x0e0b95b900000000,\n    0x6147302200000000, 0xec35bc5c00000000, 0x837919c700000000,\n    0x73ab87b000000000, 0x1ce7222b00000000, 0x930eba5f00000000,\n    0xfc421fc400000000, 0x0c9081b300000000, 0x63dc242800000000,\n    0x1243b05a00000000, 0x7d0f15c100000000, 0x8ddd8bb600000000,\n    0xe2912e2d00000000, 0x6d78b65900000000, 0x023413c200000000,\n    0xf2e68db500000000, 0x9daa282e00000000, 0xe803954800000000,\n    0x874f30d300000000, 0x779daea400000000, 0x18d10b3f00000000,\n    0x9738934b00000000, 0xf87436d000000000, 0x08a6a8a700000000,\n    0x67ea0d3c00000000, 0x1675994e00000000, 0x79393cd500000000,\n    0x89eba2a200000000, 0xe6a7073900000000, 0x694e9f4d00000000,\n    0x06023ad600000000, 0xf6d0a4a100000000, 0x999c013a00000000,\n    0x14ee8d4400000000, 0x7ba228df00000000, 0x8b70b6a800000000,\n    0xe43c133300000000, 0x6bd58b4700000000, 0x04992edc00000000,\n    0xf44bb0ab00000000, 0x9b07153000000000, 0xea98814200000000,\n    0x85d424d900000000, 0x7506baae00000000, 0x1a4a1f3500000000,\n    0x95a3874100000000, 0xfaef22da00000000, 0x0a3dbcad00000000,\n    0x6571193600000000},\n   {0x0000000000000000, 0x85d996dd00000000, 0x4bb55c6000000000,\n    0xce6ccabd00000000, 0x966ab9c000000000, 0x13b32f1d00000000,\n    0xdddfe5a000000000, 0x5806737d00000000, 0x6dd3035a00000000,\n    0xe80a958700000000, 0x26665f3a00000000, 0xa3bfc9e700000000,\n    0xfbb9ba9a00000000, 0x7e602c4700000000, 0xb00ce6fa00000000,\n    0x35d5702700000000, 0xdaa607b400000000, 0x5f7f916900000000,\n    0x91135bd400000000, 0x14cacd0900000000, 0x4cccbe7400000000,\n    0xc91528a900000000, 0x0779e21400000000, 0x82a074c900000000,\n    0xb77504ee00000000, 0x32ac923300000000, 0xfcc0588e00000000,\n    0x7919ce5300000000, 0x211fbd2e00000000, 0xa4c62bf300000000,\n    0x6aaae14e00000000, 0xef73779300000000, 0xf54b7eb300000000,\n    0x7092e86e00000000, 0xbefe22d300000000, 0x3b27b40e00000000,\n    0x6321c77300000000, 0xe6f851ae00000000, 0x28949b1300000000,\n    0xad4d0dce00000000, 0x98987de900000000, 0x1d41eb3400000000,\n    0xd32d218900000000, 0x56f4b75400000000, 0x0ef2c42900000000,\n    0x8b2b52f400000000, 0x4547984900000000, 0xc09e0e9400000000,\n    0x2fed790700000000, 0xaa34efda00000000, 0x6458256700000000,\n    0xe181b3ba00000000, 0xb987c0c700000000, 0x3c5e561a00000000,\n    0xf2329ca700000000, 0x77eb0a7a00000000, 0x423e7a5d00000000,\n    0xc7e7ec8000000000, 0x098b263d00000000, 0x8c52b0e000000000,\n    0xd454c39d00000000, 0x518d554000000000, 0x9fe19ffd00000000,\n    0x1a38092000000000, 0xab918dbd00000000, 0x2e481b6000000000,\n    0xe024d1dd00000000, 0x65fd470000000000, 0x3dfb347d00000000,\n    0xb822a2a000000000, 0x764e681d00000000, 0xf397fec000000000,\n    0xc6428ee700000000, 0x439b183a00000000, 0x8df7d28700000000,\n    0x082e445a00000000, 0x5028372700000000, 0xd5f1a1fa00000000,\n    0x1b9d6b4700000000, 0x9e44fd9a00000000, 0x71378a0900000000,\n    0xf4ee1cd400000000, 0x3a82d66900000000, 0xbf5b40b400000000,\n    0xe75d33c900000000, 0x6284a51400000000, 0xace86fa900000000,\n    0x2931f97400000000, 0x1ce4895300000000, 0x993d1f8e00000000,\n    0x5751d53300000000, 0xd28843ee00000000, 0x8a8e309300000000,\n    0x0f57a64e00000000, 0xc13b6cf300000000, 0x44e2fa2e00000000,\n    0x5edaf30e00000000, 0xdb0365d300000000, 0x156faf6e00000000,\n    0x90b639b300000000, 0xc8b04ace00000000, 0x4d69dc1300000000,\n    0x830516ae00000000, 0x06dc807300000000, 0x3309f05400000000,\n    0xb6d0668900000000, 0x78bcac3400000000, 0xfd653ae900000000,\n    0xa563499400000000, 0x20badf4900000000, 0xeed615f400000000,\n    0x6b0f832900000000, 0x847cf4ba00000000, 0x01a5626700000000,\n    0xcfc9a8da00000000, 0x4a103e0700000000, 0x12164d7a00000000,\n    0x97cfdba700000000, 0x59a3111a00000000, 0xdc7a87c700000000,\n    0xe9aff7e000000000, 0x6c76613d00000000, 0xa21aab8000000000,\n    0x27c33d5d00000000, 0x7fc54e2000000000, 0xfa1cd8fd00000000,\n    0x3470124000000000, 0xb1a9849d00000000, 0x17256aa000000000,\n    0x92fcfc7d00000000, 0x5c9036c000000000, 0xd949a01d00000000,\n    0x814fd36000000000, 0x049645bd00000000, 0xcafa8f0000000000,\n    0x4f2319dd00000000, 0x7af669fa00000000, 0xff2fff2700000000,\n    0x3143359a00000000, 0xb49aa34700000000, 0xec9cd03a00000000,\n    0x694546e700000000, 0xa7298c5a00000000, 0x22f01a8700000000,\n    0xcd836d1400000000, 0x485afbc900000000, 0x8636317400000000,\n    0x03efa7a900000000, 0x5be9d4d400000000, 0xde30420900000000,\n    0x105c88b400000000, 0x95851e6900000000, 0xa0506e4e00000000,\n    0x2589f89300000000, 0xebe5322e00000000, 0x6e3ca4f300000000,\n    0x363ad78e00000000, 0xb3e3415300000000, 0x7d8f8bee00000000,\n    0xf8561d3300000000, 0xe26e141300000000, 0x67b782ce00000000,\n    0xa9db487300000000, 0x2c02deae00000000, 0x7404add300000000,\n    0xf1dd3b0e00000000, 0x3fb1f1b300000000, 0xba68676e00000000,\n    0x8fbd174900000000, 0x0a64819400000000, 0xc4084b2900000000,\n    0x41d1ddf400000000, 0x19d7ae8900000000, 0x9c0e385400000000,\n    0x5262f2e900000000, 0xd7bb643400000000, 0x38c813a700000000,\n    0xbd11857a00000000, 0x737d4fc700000000, 0xf6a4d91a00000000,\n    0xaea2aa6700000000, 0x2b7b3cba00000000, 0xe517f60700000000,\n    0x60ce60da00000000, 0x551b10fd00000000, 0xd0c2862000000000,\n    0x1eae4c9d00000000, 0x9b77da4000000000, 0xc371a93d00000000,\n    0x46a83fe000000000, 0x88c4f55d00000000, 0x0d1d638000000000,\n    0xbcb4e71d00000000, 0x396d71c000000000, 0xf701bb7d00000000,\n    0x72d82da000000000, 0x2ade5edd00000000, 0xaf07c80000000000,\n    0x616b02bd00000000, 0xe4b2946000000000, 0xd167e44700000000,\n    0x54be729a00000000, 0x9ad2b82700000000, 0x1f0b2efa00000000,\n    0x470d5d8700000000, 0xc2d4cb5a00000000, 0x0cb801e700000000,\n    0x8961973a00000000, 0x6612e0a900000000, 0xe3cb767400000000,\n    0x2da7bcc900000000, 0xa87e2a1400000000, 0xf078596900000000,\n    0x75a1cfb400000000, 0xbbcd050900000000, 0x3e1493d400000000,\n    0x0bc1e3f300000000, 0x8e18752e00000000, 0x4074bf9300000000,\n    0xc5ad294e00000000, 0x9dab5a3300000000, 0x1872ccee00000000,\n    0xd61e065300000000, 0x53c7908e00000000, 0x49ff99ae00000000,\n    0xcc260f7300000000, 0x024ac5ce00000000, 0x8793531300000000,\n    0xdf95206e00000000, 0x5a4cb6b300000000, 0x94207c0e00000000,\n    0x11f9ead300000000, 0x242c9af400000000, 0xa1f50c2900000000,\n    0x6f99c69400000000, 0xea40504900000000, 0xb246233400000000,\n    0x379fb5e900000000, 0xf9f37f5400000000, 0x7c2ae98900000000,\n    0x93599e1a00000000, 0x168008c700000000, 0xd8ecc27a00000000,\n    0x5d3554a700000000, 0x053327da00000000, 0x80eab10700000000,\n    0x4e867bba00000000, 0xcb5fed6700000000, 0xfe8a9d4000000000,\n    0x7b530b9d00000000, 0xb53fc12000000000, 0x30e657fd00000000,\n    0x68e0248000000000, 0xed39b25d00000000, 0x235578e000000000,\n    0xa68cee3d00000000},\n   {0x0000000000000000, 0x76e10f9d00000000, 0xadc46ee100000000,\n    0xdb25617c00000000, 0x1b8fac1900000000, 0x6d6ea38400000000,\n    0xb64bc2f800000000, 0xc0aacd6500000000, 0x361e593300000000,\n    0x40ff56ae00000000, 0x9bda37d200000000, 0xed3b384f00000000,\n    0x2d91f52a00000000, 0x5b70fab700000000, 0x80559bcb00000000,\n    0xf6b4945600000000, 0x6c3cb26600000000, 0x1addbdfb00000000,\n    0xc1f8dc8700000000, 0xb719d31a00000000, 0x77b31e7f00000000,\n    0x015211e200000000, 0xda77709e00000000, 0xac967f0300000000,\n    0x5a22eb5500000000, 0x2cc3e4c800000000, 0xf7e685b400000000,\n    0x81078a2900000000, 0x41ad474c00000000, 0x374c48d100000000,\n    0xec6929ad00000000, 0x9a88263000000000, 0xd87864cd00000000,\n    0xae996b5000000000, 0x75bc0a2c00000000, 0x035d05b100000000,\n    0xc3f7c8d400000000, 0xb516c74900000000, 0x6e33a63500000000,\n    0x18d2a9a800000000, 0xee663dfe00000000, 0x9887326300000000,\n    0x43a2531f00000000, 0x35435c8200000000, 0xf5e991e700000000,\n    0x83089e7a00000000, 0x582dff0600000000, 0x2eccf09b00000000,\n    0xb444d6ab00000000, 0xc2a5d93600000000, 0x1980b84a00000000,\n    0x6f61b7d700000000, 0xafcb7ab200000000, 0xd92a752f00000000,\n    0x020f145300000000, 0x74ee1bce00000000, 0x825a8f9800000000,\n    0xf4bb800500000000, 0x2f9ee17900000000, 0x597feee400000000,\n    0x99d5238100000000, 0xef342c1c00000000, 0x34114d6000000000,\n    0x42f042fd00000000, 0xf1f7b94100000000, 0x8716b6dc00000000,\n    0x5c33d7a000000000, 0x2ad2d83d00000000, 0xea78155800000000,\n    0x9c991ac500000000, 0x47bc7bb900000000, 0x315d742400000000,\n    0xc7e9e07200000000, 0xb108efef00000000, 0x6a2d8e9300000000,\n    0x1ccc810e00000000, 0xdc664c6b00000000, 0xaa8743f600000000,\n    0x71a2228a00000000, 0x07432d1700000000, 0x9dcb0b2700000000,\n    0xeb2a04ba00000000, 0x300f65c600000000, 0x46ee6a5b00000000,\n    0x8644a73e00000000, 0xf0a5a8a300000000, 0x2b80c9df00000000,\n    0x5d61c64200000000, 0xabd5521400000000, 0xdd345d8900000000,\n    0x06113cf500000000, 0x70f0336800000000, 0xb05afe0d00000000,\n    0xc6bbf19000000000, 0x1d9e90ec00000000, 0x6b7f9f7100000000,\n    0x298fdd8c00000000, 0x5f6ed21100000000, 0x844bb36d00000000,\n    0xf2aabcf000000000, 0x3200719500000000, 0x44e17e0800000000,\n    0x9fc41f7400000000, 0xe92510e900000000, 0x1f9184bf00000000,\n    0x69708b2200000000, 0xb255ea5e00000000, 0xc4b4e5c300000000,\n    0x041e28a600000000, 0x72ff273b00000000, 0xa9da464700000000,\n    0xdf3b49da00000000, 0x45b36fea00000000, 0x3352607700000000,\n    0xe877010b00000000, 0x9e960e9600000000, 0x5e3cc3f300000000,\n    0x28ddcc6e00000000, 0xf3f8ad1200000000, 0x8519a28f00000000,\n    0x73ad36d900000000, 0x054c394400000000, 0xde69583800000000,\n    0xa88857a500000000, 0x68229ac000000000, 0x1ec3955d00000000,\n    0xc5e6f42100000000, 0xb307fbbc00000000, 0xe2ef738300000000,\n    0x940e7c1e00000000, 0x4f2b1d6200000000, 0x39ca12ff00000000,\n    0xf960df9a00000000, 0x8f81d00700000000, 0x54a4b17b00000000,\n    0x2245bee600000000, 0xd4f12ab000000000, 0xa210252d00000000,\n    0x7935445100000000, 0x0fd44bcc00000000, 0xcf7e86a900000000,\n    0xb99f893400000000, 0x62bae84800000000, 0x145be7d500000000,\n    0x8ed3c1e500000000, 0xf832ce7800000000, 0x2317af0400000000,\n    0x55f6a09900000000, 0x955c6dfc00000000, 0xe3bd626100000000,\n    0x3898031d00000000, 0x4e790c8000000000, 0xb8cd98d600000000,\n    0xce2c974b00000000, 0x1509f63700000000, 0x63e8f9aa00000000,\n    0xa34234cf00000000, 0xd5a33b5200000000, 0x0e865a2e00000000,\n    0x786755b300000000, 0x3a97174e00000000, 0x4c7618d300000000,\n    0x975379af00000000, 0xe1b2763200000000, 0x2118bb5700000000,\n    0x57f9b4ca00000000, 0x8cdcd5b600000000, 0xfa3dda2b00000000,\n    0x0c894e7d00000000, 0x7a6841e000000000, 0xa14d209c00000000,\n    0xd7ac2f0100000000, 0x1706e26400000000, 0x61e7edf900000000,\n    0xbac28c8500000000, 0xcc23831800000000, 0x56aba52800000000,\n    0x204aaab500000000, 0xfb6fcbc900000000, 0x8d8ec45400000000,\n    0x4d24093100000000, 0x3bc506ac00000000, 0xe0e067d000000000,\n    0x9601684d00000000, 0x60b5fc1b00000000, 0x1654f38600000000,\n    0xcd7192fa00000000, 0xbb909d6700000000, 0x7b3a500200000000,\n    0x0ddb5f9f00000000, 0xd6fe3ee300000000, 0xa01f317e00000000,\n    0x1318cac200000000, 0x65f9c55f00000000, 0xbedca42300000000,\n    0xc83dabbe00000000, 0x089766db00000000, 0x7e76694600000000,\n    0xa553083a00000000, 0xd3b207a700000000, 0x250693f100000000,\n    0x53e79c6c00000000, 0x88c2fd1000000000, 0xfe23f28d00000000,\n    0x3e893fe800000000, 0x4868307500000000, 0x934d510900000000,\n    0xe5ac5e9400000000, 0x7f2478a400000000, 0x09c5773900000000,\n    0xd2e0164500000000, 0xa40119d800000000, 0x64abd4bd00000000,\n    0x124adb2000000000, 0xc96fba5c00000000, 0xbf8eb5c100000000,\n    0x493a219700000000, 0x3fdb2e0a00000000, 0xe4fe4f7600000000,\n    0x921f40eb00000000, 0x52b58d8e00000000, 0x2454821300000000,\n    0xff71e36f00000000, 0x8990ecf200000000, 0xcb60ae0f00000000,\n    0xbd81a19200000000, 0x66a4c0ee00000000, 0x1045cf7300000000,\n    0xd0ef021600000000, 0xa60e0d8b00000000, 0x7d2b6cf700000000,\n    0x0bca636a00000000, 0xfd7ef73c00000000, 0x8b9ff8a100000000,\n    0x50ba99dd00000000, 0x265b964000000000, 0xe6f15b2500000000,\n    0x901054b800000000, 0x4b3535c400000000, 0x3dd43a5900000000,\n    0xa75c1c6900000000, 0xd1bd13f400000000, 0x0a98728800000000,\n    0x7c797d1500000000, 0xbcd3b07000000000, 0xca32bfed00000000,\n    0x1117de9100000000, 0x67f6d10c00000000, 0x9142455a00000000,\n    0xe7a34ac700000000, 0x3c862bbb00000000, 0x4a67242600000000,\n    0x8acde94300000000, 0xfc2ce6de00000000, 0x270987a200000000,\n    0x51e8883f00000000},\n   {0x0000000000000000, 0xe8dbfbb900000000, 0x91b186a800000000,\n    0x796a7d1100000000, 0x63657c8a00000000, 0x8bbe873300000000,\n    0xf2d4fa2200000000, 0x1a0f019b00000000, 0x87cc89cf00000000,\n    0x6f17727600000000, 0x167d0f6700000000, 0xfea6f4de00000000,\n    0xe4a9f54500000000, 0x0c720efc00000000, 0x751873ed00000000,\n    0x9dc3885400000000, 0x4f9f624400000000, 0xa74499fd00000000,\n    0xde2ee4ec00000000, 0x36f51f5500000000, 0x2cfa1ece00000000,\n    0xc421e57700000000, 0xbd4b986600000000, 0x559063df00000000,\n    0xc853eb8b00000000, 0x2088103200000000, 0x59e26d2300000000,\n    0xb139969a00000000, 0xab36970100000000, 0x43ed6cb800000000,\n    0x3a8711a900000000, 0xd25cea1000000000, 0x9e3ec58800000000,\n    0x76e53e3100000000, 0x0f8f432000000000, 0xe754b89900000000,\n    0xfd5bb90200000000, 0x158042bb00000000, 0x6cea3faa00000000,\n    0x8431c41300000000, 0x19f24c4700000000, 0xf129b7fe00000000,\n    0x8843caef00000000, 0x6098315600000000, 0x7a9730cd00000000,\n    0x924ccb7400000000, 0xeb26b66500000000, 0x03fd4ddc00000000,\n    0xd1a1a7cc00000000, 0x397a5c7500000000, 0x4010216400000000,\n    0xa8cbdadd00000000, 0xb2c4db4600000000, 0x5a1f20ff00000000,\n    0x23755dee00000000, 0xcbaea65700000000, 0x566d2e0300000000,\n    0xbeb6d5ba00000000, 0xc7dca8ab00000000, 0x2f07531200000000,\n    0x3508528900000000, 0xddd3a93000000000, 0xa4b9d42100000000,\n    0x4c622f9800000000, 0x7d7bfbca00000000, 0x95a0007300000000,\n    0xecca7d6200000000, 0x041186db00000000, 0x1e1e874000000000,\n    0xf6c57cf900000000, 0x8faf01e800000000, 0x6774fa5100000000,\n    0xfab7720500000000, 0x126c89bc00000000, 0x6b06f4ad00000000,\n    0x83dd0f1400000000, 0x99d20e8f00000000, 0x7109f53600000000,\n    0x0863882700000000, 0xe0b8739e00000000, 0x32e4998e00000000,\n    0xda3f623700000000, 0xa3551f2600000000, 0x4b8ee49f00000000,\n    0x5181e50400000000, 0xb95a1ebd00000000, 0xc03063ac00000000,\n    0x28eb981500000000, 0xb528104100000000, 0x5df3ebf800000000,\n    0x249996e900000000, 0xcc426d5000000000, 0xd64d6ccb00000000,\n    0x3e96977200000000, 0x47fcea6300000000, 0xaf2711da00000000,\n    0xe3453e4200000000, 0x0b9ec5fb00000000, 0x72f4b8ea00000000,\n    0x9a2f435300000000, 0x802042c800000000, 0x68fbb97100000000,\n    0x1191c46000000000, 0xf94a3fd900000000, 0x6489b78d00000000,\n    0x8c524c3400000000, 0xf538312500000000, 0x1de3ca9c00000000,\n    0x07eccb0700000000, 0xef3730be00000000, 0x965d4daf00000000,\n    0x7e86b61600000000, 0xacda5c0600000000, 0x4401a7bf00000000,\n    0x3d6bdaae00000000, 0xd5b0211700000000, 0xcfbf208c00000000,\n    0x2764db3500000000, 0x5e0ea62400000000, 0xb6d55d9d00000000,\n    0x2b16d5c900000000, 0xc3cd2e7000000000, 0xbaa7536100000000,\n    0x527ca8d800000000, 0x4873a94300000000, 0xa0a852fa00000000,\n    0xd9c22feb00000000, 0x3119d45200000000, 0xbbf0874e00000000,\n    0x532b7cf700000000, 0x2a4101e600000000, 0xc29afa5f00000000,\n    0xd895fbc400000000, 0x304e007d00000000, 0x49247d6c00000000,\n    0xa1ff86d500000000, 0x3c3c0e8100000000, 0xd4e7f53800000000,\n    0xad8d882900000000, 0x4556739000000000, 0x5f59720b00000000,\n    0xb78289b200000000, 0xcee8f4a300000000, 0x26330f1a00000000,\n    0xf46fe50a00000000, 0x1cb41eb300000000, 0x65de63a200000000,\n    0x8d05981b00000000, 0x970a998000000000, 0x7fd1623900000000,\n    0x06bb1f2800000000, 0xee60e49100000000, 0x73a36cc500000000,\n    0x9b78977c00000000, 0xe212ea6d00000000, 0x0ac911d400000000,\n    0x10c6104f00000000, 0xf81debf600000000, 0x817796e700000000,\n    0x69ac6d5e00000000, 0x25ce42c600000000, 0xcd15b97f00000000,\n    0xb47fc46e00000000, 0x5ca43fd700000000, 0x46ab3e4c00000000,\n    0xae70c5f500000000, 0xd71ab8e400000000, 0x3fc1435d00000000,\n    0xa202cb0900000000, 0x4ad930b000000000, 0x33b34da100000000,\n    0xdb68b61800000000, 0xc167b78300000000, 0x29bc4c3a00000000,\n    0x50d6312b00000000, 0xb80dca9200000000, 0x6a51208200000000,\n    0x828adb3b00000000, 0xfbe0a62a00000000, 0x133b5d9300000000,\n    0x09345c0800000000, 0xe1efa7b100000000, 0x9885daa000000000,\n    0x705e211900000000, 0xed9da94d00000000, 0x054652f400000000,\n    0x7c2c2fe500000000, 0x94f7d45c00000000, 0x8ef8d5c700000000,\n    0x66232e7e00000000, 0x1f49536f00000000, 0xf792a8d600000000,\n    0xc68b7c8400000000, 0x2e50873d00000000, 0x573afa2c00000000,\n    0xbfe1019500000000, 0xa5ee000e00000000, 0x4d35fbb700000000,\n    0x345f86a600000000, 0xdc847d1f00000000, 0x4147f54b00000000,\n    0xa99c0ef200000000, 0xd0f673e300000000, 0x382d885a00000000,\n    0x222289c100000000, 0xcaf9727800000000, 0xb3930f6900000000,\n    0x5b48f4d000000000, 0x89141ec000000000, 0x61cfe57900000000,\n    0x18a5986800000000, 0xf07e63d100000000, 0xea71624a00000000,\n    0x02aa99f300000000, 0x7bc0e4e200000000, 0x931b1f5b00000000,\n    0x0ed8970f00000000, 0xe6036cb600000000, 0x9f6911a700000000,\n    0x77b2ea1e00000000, 0x6dbdeb8500000000, 0x8566103c00000000,\n    0xfc0c6d2d00000000, 0x14d7969400000000, 0x58b5b90c00000000,\n    0xb06e42b500000000, 0xc9043fa400000000, 0x21dfc41d00000000,\n    0x3bd0c58600000000, 0xd30b3e3f00000000, 0xaa61432e00000000,\n    0x42bab89700000000, 0xdf7930c300000000, 0x37a2cb7a00000000,\n    0x4ec8b66b00000000, 0xa6134dd200000000, 0xbc1c4c4900000000,\n    0x54c7b7f000000000, 0x2dadcae100000000, 0xc576315800000000,\n    0x172adb4800000000, 0xfff120f100000000, 0x869b5de000000000,\n    0x6e40a65900000000, 0x744fa7c200000000, 0x9c945c7b00000000,\n    0xe5fe216a00000000, 0x0d25dad300000000, 0x90e6528700000000,\n    0x783da93e00000000, 0x0157d42f00000000, 0xe98c2f9600000000,\n    0xf3832e0d00000000, 0x1b58d5b400000000, 0x6232a8a500000000,\n    0x8ae9531c00000000},\n   {0x0000000000000000, 0x919168ae00000000, 0x6325a08700000000,\n    0xf2b4c82900000000, 0x874c31d400000000, 0x16dd597a00000000,\n    0xe469915300000000, 0x75f8f9fd00000000, 0x4f9f137300000000,\n    0xde0e7bdd00000000, 0x2cbab3f400000000, 0xbd2bdb5a00000000,\n    0xc8d322a700000000, 0x59424a0900000000, 0xabf6822000000000,\n    0x3a67ea8e00000000, 0x9e3e27e600000000, 0x0faf4f4800000000,\n    0xfd1b876100000000, 0x6c8aefcf00000000, 0x1972163200000000,\n    0x88e37e9c00000000, 0x7a57b6b500000000, 0xebc6de1b00000000,\n    0xd1a1349500000000, 0x40305c3b00000000, 0xb284941200000000,\n    0x2315fcbc00000000, 0x56ed054100000000, 0xc77c6def00000000,\n    0x35c8a5c600000000, 0xa459cd6800000000, 0x7d7b3f1700000000,\n    0xecea57b900000000, 0x1e5e9f9000000000, 0x8fcff73e00000000,\n    0xfa370ec300000000, 0x6ba6666d00000000, 0x9912ae4400000000,\n    0x0883c6ea00000000, 0x32e42c6400000000, 0xa37544ca00000000,\n    0x51c18ce300000000, 0xc050e44d00000000, 0xb5a81db000000000,\n    0x2439751e00000000, 0xd68dbd3700000000, 0x471cd59900000000,\n    0xe34518f100000000, 0x72d4705f00000000, 0x8060b87600000000,\n    0x11f1d0d800000000, 0x6409292500000000, 0xf598418b00000000,\n    0x072c89a200000000, 0x96bde10c00000000, 0xacda0b8200000000,\n    0x3d4b632c00000000, 0xcfffab0500000000, 0x5e6ec3ab00000000,\n    0x2b963a5600000000, 0xba0752f800000000, 0x48b39ad100000000,\n    0xd922f27f00000000, 0xfaf67e2e00000000, 0x6b67168000000000,\n    0x99d3dea900000000, 0x0842b60700000000, 0x7dba4ffa00000000,\n    0xec2b275400000000, 0x1e9fef7d00000000, 0x8f0e87d300000000,\n    0xb5696d5d00000000, 0x24f805f300000000, 0xd64ccdda00000000,\n    0x47dda57400000000, 0x32255c8900000000, 0xa3b4342700000000,\n    0x5100fc0e00000000, 0xc09194a000000000, 0x64c859c800000000,\n    0xf559316600000000, 0x07edf94f00000000, 0x967c91e100000000,\n    0xe384681c00000000, 0x721500b200000000, 0x80a1c89b00000000,\n    0x1130a03500000000, 0x2b574abb00000000, 0xbac6221500000000,\n    0x4872ea3c00000000, 0xd9e3829200000000, 0xac1b7b6f00000000,\n    0x3d8a13c100000000, 0xcf3edbe800000000, 0x5eafb34600000000,\n    0x878d413900000000, 0x161c299700000000, 0xe4a8e1be00000000,\n    0x7539891000000000, 0x00c170ed00000000, 0x9150184300000000,\n    0x63e4d06a00000000, 0xf275b8c400000000, 0xc812524a00000000,\n    0x59833ae400000000, 0xab37f2cd00000000, 0x3aa69a6300000000,\n    0x4f5e639e00000000, 0xdecf0b3000000000, 0x2c7bc31900000000,\n    0xbdeaabb700000000, 0x19b366df00000000, 0x88220e7100000000,\n    0x7a96c65800000000, 0xeb07aef600000000, 0x9eff570b00000000,\n    0x0f6e3fa500000000, 0xfddaf78c00000000, 0x6c4b9f2200000000,\n    0x562c75ac00000000, 0xc7bd1d0200000000, 0x3509d52b00000000,\n    0xa498bd8500000000, 0xd160447800000000, 0x40f12cd600000000,\n    0xb245e4ff00000000, 0x23d48c5100000000, 0xf4edfd5c00000000,\n    0x657c95f200000000, 0x97c85ddb00000000, 0x0659357500000000,\n    0x73a1cc8800000000, 0xe230a42600000000, 0x10846c0f00000000,\n    0x811504a100000000, 0xbb72ee2f00000000, 0x2ae3868100000000,\n    0xd8574ea800000000, 0x49c6260600000000, 0x3c3edffb00000000,\n    0xadafb75500000000, 0x5f1b7f7c00000000, 0xce8a17d200000000,\n    0x6ad3daba00000000, 0xfb42b21400000000, 0x09f67a3d00000000,\n    0x9867129300000000, 0xed9feb6e00000000, 0x7c0e83c000000000,\n    0x8eba4be900000000, 0x1f2b234700000000, 0x254cc9c900000000,\n    0xb4dda16700000000, 0x4669694e00000000, 0xd7f801e000000000,\n    0xa200f81d00000000, 0x339190b300000000, 0xc125589a00000000,\n    0x50b4303400000000, 0x8996c24b00000000, 0x1807aae500000000,\n    0xeab362cc00000000, 0x7b220a6200000000, 0x0edaf39f00000000,\n    0x9f4b9b3100000000, 0x6dff531800000000, 0xfc6e3bb600000000,\n    0xc609d13800000000, 0x5798b99600000000, 0xa52c71bf00000000,\n    0x34bd191100000000, 0x4145e0ec00000000, 0xd0d4884200000000,\n    0x2260406b00000000, 0xb3f128c500000000, 0x17a8e5ad00000000,\n    0x86398d0300000000, 0x748d452a00000000, 0xe51c2d8400000000,\n    0x90e4d47900000000, 0x0175bcd700000000, 0xf3c174fe00000000,\n    0x62501c5000000000, 0x5837f6de00000000, 0xc9a69e7000000000,\n    0x3b12565900000000, 0xaa833ef700000000, 0xdf7bc70a00000000,\n    0x4eeaafa400000000, 0xbc5e678d00000000, 0x2dcf0f2300000000,\n    0x0e1b837200000000, 0x9f8aebdc00000000, 0x6d3e23f500000000,\n    0xfcaf4b5b00000000, 0x8957b2a600000000, 0x18c6da0800000000,\n    0xea72122100000000, 0x7be37a8f00000000, 0x4184900100000000,\n    0xd015f8af00000000, 0x22a1308600000000, 0xb330582800000000,\n    0xc6c8a1d500000000, 0x5759c97b00000000, 0xa5ed015200000000,\n    0x347c69fc00000000, 0x9025a49400000000, 0x01b4cc3a00000000,\n    0xf300041300000000, 0x62916cbd00000000, 0x1769954000000000,\n    0x86f8fdee00000000, 0x744c35c700000000, 0xe5dd5d6900000000,\n    0xdfbab7e700000000, 0x4e2bdf4900000000, 0xbc9f176000000000,\n    0x2d0e7fce00000000, 0x58f6863300000000, 0xc967ee9d00000000,\n    0x3bd326b400000000, 0xaa424e1a00000000, 0x7360bc6500000000,\n    0xe2f1d4cb00000000, 0x10451ce200000000, 0x81d4744c00000000,\n    0xf42c8db100000000, 0x65bde51f00000000, 0x97092d3600000000,\n    0x0698459800000000, 0x3cffaf1600000000, 0xad6ec7b800000000,\n    0x5fda0f9100000000, 0xce4b673f00000000, 0xbbb39ec200000000,\n    0x2a22f66c00000000, 0xd8963e4500000000, 0x490756eb00000000,\n    0xed5e9b8300000000, 0x7ccff32d00000000, 0x8e7b3b0400000000,\n    0x1fea53aa00000000, 0x6a12aa5700000000, 0xfb83c2f900000000,\n    0x09370ad000000000, 0x98a6627e00000000, 0xa2c188f000000000,\n    0x3350e05e00000000, 0xc1e4287700000000, 0x507540d900000000,\n    0x258db92400000000, 0xb41cd18a00000000, 0x46a819a300000000,\n    0xd739710d00000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa,\n    0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b,\n    0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232,\n    0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8,\n    0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e,\n    0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa,\n    0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b,\n    0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f,\n    0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719,\n    0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3,\n    0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa,\n    0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b,\n    0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed,\n    0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89,\n    0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25,\n    0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041,\n    0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c,\n    0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed,\n    0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4,\n    0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758,\n    0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e,\n    0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a,\n    0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed,\n    0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889,\n    0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df,\n    0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544,\n    0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d,\n    0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c,\n    0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1,\n    0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95,\n    0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839,\n    0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d,\n    0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976,\n    0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7,\n    0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be,\n    0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144,\n    0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12,\n    0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376,\n    0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a,\n    0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e,\n    0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278,\n    0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682,\n    0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b,\n    0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a,\n    0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561,\n    0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05,\n    0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9,\n    0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd,\n    0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0,\n    0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61,\n    0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678,\n    0x264b06e6},\n   {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413,\n    0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3,\n    0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d,\n    0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653,\n    0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9,\n    0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e,\n    0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5,\n    0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712,\n    0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8,\n    0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6,\n    0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068,\n    0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8,\n    0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579,\n    0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade,\n    0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37,\n    0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590,\n    0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4,\n    0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64,\n    0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea,\n    0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678,\n    0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282,\n    0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25,\n    0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102,\n    0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5,\n    0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f,\n    0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146,\n    0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8,\n    0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08,\n    0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c,\n    0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b,\n    0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972,\n    0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5,\n    0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d,\n    0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd,\n    0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833,\n    0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d,\n    0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7,\n    0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60,\n    0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2,\n    0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105,\n    0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff,\n    0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1,\n    0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f,\n    0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf,\n    0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617,\n    0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0,\n    0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959,\n    0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe,\n    0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca,\n    0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a,\n    0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184,\n    0x92364a30},\n   {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216,\n    0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8,\n    0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170,\n    0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035,\n    0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6,\n    0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145,\n    0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d,\n    0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e,\n    0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d,\n    0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408,\n    0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0,\n    0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e,\n    0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c,\n    0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf,\n    0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a,\n    0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9,\n    0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1,\n    0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f,\n    0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987,\n    0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4,\n    0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37,\n    0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84,\n    0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca,\n    0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79,\n    0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba,\n    0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d,\n    0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5,\n    0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b,\n    0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643,\n    0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0,\n    0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525,\n    0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496,\n    0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8,\n    0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026,\n    0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e,\n    0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db,\n    0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118,\n    0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab,\n    0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf,\n    0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c,\n    0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf,\n    0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a,\n    0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32,\n    0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec,\n    0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82,\n    0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31,\n    0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4,\n    0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957,\n    0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f,\n    0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1,\n    0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869,\n    0xe4c4abcc},\n   {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0,\n    0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271,\n    0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61,\n    0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52,\n    0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43,\n    0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333,\n    0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64,\n    0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314,\n    0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205,\n    0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136,\n    0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26,\n    0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997,\n    0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849,\n    0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739,\n    0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8,\n    0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98,\n    0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b,\n    0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba,\n    0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa,\n    0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d,\n    0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c,\n    0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc,\n    0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af,\n    0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf,\n    0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce,\n    0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922,\n    0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532,\n    0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183,\n    0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710,\n    0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860,\n    0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1,\n    0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1,\n    0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956,\n    0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7,\n    0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7,\n    0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4,\n    0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5,\n    0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5,\n    0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb,\n    0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb,\n    0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da,\n    0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9,\n    0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9,\n    0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48,\n    0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df,\n    0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af,\n    0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e,\n    0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e,\n    0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d,\n    0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c,\n    0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c,\n    0xca64c78c}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0xb029603d, 0x6053c07a, 0xd07aa047, 0xc0a680f5,\n    0x708fe0c8, 0xa0f5408f, 0x10dc20b2, 0xc14b7030, 0x7162100d,\n    0xa118b04a, 0x1131d077, 0x01edf0c5, 0xb1c490f8, 0x61be30bf,\n    0xd1975082, 0x8297e060, 0x32be805d, 0xe2c4201a, 0x52ed4027,\n    0x42316095, 0xf21800a8, 0x2262a0ef, 0x924bc0d2, 0x43dc9050,\n    0xf3f5f06d, 0x238f502a, 0x93a63017, 0x837a10a5, 0x33537098,\n    0xe329d0df, 0x5300b0e2, 0x042fc1c1, 0xb406a1fc, 0x647c01bb,\n    0xd4556186, 0xc4894134, 0x74a02109, 0xa4da814e, 0x14f3e173,\n    0xc564b1f1, 0x754dd1cc, 0xa537718b, 0x151e11b6, 0x05c23104,\n    0xb5eb5139, 0x6591f17e, 0xd5b89143, 0x86b821a1, 0x3691419c,\n    0xe6ebe1db, 0x56c281e6, 0x461ea154, 0xf637c169, 0x264d612e,\n    0x96640113, 0x47f35191, 0xf7da31ac, 0x27a091eb, 0x9789f1d6,\n    0x8755d164, 0x377cb159, 0xe706111e, 0x572f7123, 0x4958f358,\n    0xf9719365, 0x290b3322, 0x9922531f, 0x89fe73ad, 0x39d71390,\n    0xe9adb3d7, 0x5984d3ea, 0x88138368, 0x383ae355, 0xe8404312,\n    0x5869232f, 0x48b5039d, 0xf89c63a0, 0x28e6c3e7, 0x98cfa3da,\n    0xcbcf1338, 0x7be67305, 0xab9cd342, 0x1bb5b37f, 0x0b6993cd,\n    0xbb40f3f0, 0x6b3a53b7, 0xdb13338a, 0x0a846308, 0xbaad0335,\n    0x6ad7a372, 0xdafec34f, 0xca22e3fd, 0x7a0b83c0, 0xaa712387,\n    0x1a5843ba, 0x4d773299, 0xfd5e52a4, 0x2d24f2e3, 0x9d0d92de,\n    0x8dd1b26c, 0x3df8d251, 0xed827216, 0x5dab122b, 0x8c3c42a9,\n    0x3c152294, 0xec6f82d3, 0x5c46e2ee, 0x4c9ac25c, 0xfcb3a261,\n    0x2cc90226, 0x9ce0621b, 0xcfe0d2f9, 0x7fc9b2c4, 0xafb31283,\n    0x1f9a72be, 0x0f46520c, 0xbf6f3231, 0x6f159276, 0xdf3cf24b,\n    0x0eaba2c9, 0xbe82c2f4, 0x6ef862b3, 0xded1028e, 0xce0d223c,\n    0x7e244201, 0xae5ee246, 0x1e77827b, 0x92b0e6b1, 0x2299868c,\n    0xf2e326cb, 0x42ca46f6, 0x52166644, 0xe23f0679, 0x3245a63e,\n    0x826cc603, 0x53fb9681, 0xe3d2f6bc, 0x33a856fb, 0x838136c6,\n    0x935d1674, 0x23747649, 0xf30ed60e, 0x4327b633, 0x102706d1,\n    0xa00e66ec, 0x7074c6ab, 0xc05da696, 0xd0818624, 0x60a8e619,\n    0xb0d2465e, 0x00fb2663, 0xd16c76e1, 0x614516dc, 0xb13fb69b,\n    0x0116d6a6, 0x11caf614, 0xa1e39629, 0x7199366e, 0xc1b05653,\n    0x969f2770, 0x26b6474d, 0xf6cce70a, 0x46e58737, 0x5639a785,\n    0xe610c7b8, 0x366a67ff, 0x864307c2, 0x57d45740, 0xe7fd377d,\n    0x3787973a, 0x87aef707, 0x9772d7b5, 0x275bb788, 0xf72117cf,\n    0x470877f2, 0x1408c710, 0xa421a72d, 0x745b076a, 0xc4726757,\n    0xd4ae47e5, 0x648727d8, 0xb4fd879f, 0x04d4e7a2, 0xd543b720,\n    0x656ad71d, 0xb510775a, 0x05391767, 0x15e537d5, 0xa5cc57e8,\n    0x75b6f7af, 0xc59f9792, 0xdbe815e9, 0x6bc175d4, 0xbbbbd593,\n    0x0b92b5ae, 0x1b4e951c, 0xab67f521, 0x7b1d5566, 0xcb34355b,\n    0x1aa365d9, 0xaa8a05e4, 0x7af0a5a3, 0xcad9c59e, 0xda05e52c,\n    0x6a2c8511, 0xba562556, 0x0a7f456b, 0x597ff589, 0xe95695b4,\n    0x392c35f3, 0x890555ce, 0x99d9757c, 0x29f01541, 0xf98ab506,\n    0x49a3d53b, 0x983485b9, 0x281de584, 0xf86745c3, 0x484e25fe,\n    0x5892054c, 0xe8bb6571, 0x38c1c536, 0x88e8a50b, 0xdfc7d428,\n    0x6feeb415, 0xbf941452, 0x0fbd746f, 0x1f6154dd, 0xaf4834e0,\n    0x7f3294a7, 0xcf1bf49a, 0x1e8ca418, 0xaea5c425, 0x7edf6462,\n    0xcef6045f, 0xde2a24ed, 0x6e0344d0, 0xbe79e497, 0x0e5084aa,\n    0x5d503448, 0xed795475, 0x3d03f432, 0x8d2a940f, 0x9df6b4bd,\n    0x2ddfd480, 0xfda574c7, 0x4d8c14fa, 0x9c1b4478, 0x2c322445,\n    0xfc488402, 0x4c61e43f, 0x5cbdc48d, 0xec94a4b0, 0x3cee04f7,\n    0x8cc764ca},\n   {0x00000000, 0xa5d35ccb, 0x0ba1c84d, 0xae729486, 0x1642919b,\n    0xb391cd50, 0x1de359d6, 0xb830051d, 0x6d8253ec, 0xc8510f27,\n    0x66239ba1, 0xc3f0c76a, 0x7bc0c277, 0xde139ebc, 0x70610a3a,\n    0xd5b256f1, 0x9b02d603, 0x3ed18ac8, 0x90a31e4e, 0x35704285,\n    0x8d404798, 0x28931b53, 0x86e18fd5, 0x2332d31e, 0xf68085ef,\n    0x5353d924, 0xfd214da2, 0x58f21169, 0xe0c21474, 0x451148bf,\n    0xeb63dc39, 0x4eb080f2, 0x3605ac07, 0x93d6f0cc, 0x3da4644a,\n    0x98773881, 0x20473d9c, 0x85946157, 0x2be6f5d1, 0x8e35a91a,\n    0x5b87ffeb, 0xfe54a320, 0x502637a6, 0xf5f56b6d, 0x4dc56e70,\n    0xe81632bb, 0x4664a63d, 0xe3b7faf6, 0xad077a04, 0x08d426cf,\n    0xa6a6b249, 0x0375ee82, 0xbb45eb9f, 0x1e96b754, 0xb0e423d2,\n    0x15377f19, 0xc08529e8, 0x65567523, 0xcb24e1a5, 0x6ef7bd6e,\n    0xd6c7b873, 0x7314e4b8, 0xdd66703e, 0x78b52cf5, 0x6c0a580f,\n    0xc9d904c4, 0x67ab9042, 0xc278cc89, 0x7a48c994, 0xdf9b955f,\n    0x71e901d9, 0xd43a5d12, 0x01880be3, 0xa45b5728, 0x0a29c3ae,\n    0xaffa9f65, 0x17ca9a78, 0xb219c6b3, 0x1c6b5235, 0xb9b80efe,\n    0xf7088e0c, 0x52dbd2c7, 0xfca94641, 0x597a1a8a, 0xe14a1f97,\n    0x4499435c, 0xeaebd7da, 0x4f388b11, 0x9a8adde0, 0x3f59812b,\n    0x912b15ad, 0x34f84966, 0x8cc84c7b, 0x291b10b0, 0x87698436,\n    0x22bad8fd, 0x5a0ff408, 0xffdca8c3, 0x51ae3c45, 0xf47d608e,\n    0x4c4d6593, 0xe99e3958, 0x47ecadde, 0xe23ff115, 0x378da7e4,\n    0x925efb2f, 0x3c2c6fa9, 0x99ff3362, 0x21cf367f, 0x841c6ab4,\n    0x2a6efe32, 0x8fbda2f9, 0xc10d220b, 0x64de7ec0, 0xcaacea46,\n    0x6f7fb68d, 0xd74fb390, 0x729cef5b, 0xdcee7bdd, 0x793d2716,\n    0xac8f71e7, 0x095c2d2c, 0xa72eb9aa, 0x02fde561, 0xbacde07c,\n    0x1f1ebcb7, 0xb16c2831, 0x14bf74fa, 0xd814b01e, 0x7dc7ecd5,\n    0xd3b57853, 0x76662498, 0xce562185, 0x6b857d4e, 0xc5f7e9c8,\n    0x6024b503, 0xb596e3f2, 0x1045bf39, 0xbe372bbf, 0x1be47774,\n    0xa3d47269, 0x06072ea2, 0xa875ba24, 0x0da6e6ef, 0x4316661d,\n    0xe6c53ad6, 0x48b7ae50, 0xed64f29b, 0x5554f786, 0xf087ab4d,\n    0x5ef53fcb, 0xfb266300, 0x2e9435f1, 0x8b47693a, 0x2535fdbc,\n    0x80e6a177, 0x38d6a46a, 0x9d05f8a1, 0x33776c27, 0x96a430ec,\n    0xee111c19, 0x4bc240d2, 0xe5b0d454, 0x4063889f, 0xf8538d82,\n    0x5d80d149, 0xf3f245cf, 0x56211904, 0x83934ff5, 0x2640133e,\n    0x883287b8, 0x2de1db73, 0x95d1de6e, 0x300282a5, 0x9e701623,\n    0x3ba34ae8, 0x7513ca1a, 0xd0c096d1, 0x7eb20257, 0xdb615e9c,\n    0x63515b81, 0xc682074a, 0x68f093cc, 0xcd23cf07, 0x189199f6,\n    0xbd42c53d, 0x133051bb, 0xb6e30d70, 0x0ed3086d, 0xab0054a6,\n    0x0572c020, 0xa0a19ceb, 0xb41ee811, 0x11cdb4da, 0xbfbf205c,\n    0x1a6c7c97, 0xa25c798a, 0x078f2541, 0xa9fdb1c7, 0x0c2eed0c,\n    0xd99cbbfd, 0x7c4fe736, 0xd23d73b0, 0x77ee2f7b, 0xcfde2a66,\n    0x6a0d76ad, 0xc47fe22b, 0x61acbee0, 0x2f1c3e12, 0x8acf62d9,\n    0x24bdf65f, 0x816eaa94, 0x395eaf89, 0x9c8df342, 0x32ff67c4,\n    0x972c3b0f, 0x429e6dfe, 0xe74d3135, 0x493fa5b3, 0xececf978,\n    0x54dcfc65, 0xf10fa0ae, 0x5f7d3428, 0xfaae68e3, 0x821b4416,\n    0x27c818dd, 0x89ba8c5b, 0x2c69d090, 0x9459d58d, 0x318a8946,\n    0x9ff81dc0, 0x3a2b410b, 0xef9917fa, 0x4a4a4b31, 0xe438dfb7,\n    0x41eb837c, 0xf9db8661, 0x5c08daaa, 0xf27a4e2c, 0x57a912e7,\n    0x19199215, 0xbccacede, 0x12b85a58, 0xb76b0693, 0x0f5b038e,\n    0xaa885f45, 0x04facbc3, 0xa1299708, 0x749bc1f9, 0xd1489d32,\n    0x7f3a09b4, 0xdae9557f, 0x62d95062, 0xc70a0ca9, 0x6978982f,\n    0xccabc4e4},\n   {0x00000000, 0xb40b77a6, 0x29119f97, 0x9d1ae831, 0x13244ff4,\n    0xa72f3852, 0x3a35d063, 0x8e3ea7c5, 0x674eef33, 0xd3459895,\n    0x4e5f70a4, 0xfa540702, 0x746aa0c7, 0xc061d761, 0x5d7b3f50,\n    0xe97048f6, 0xce9cde67, 0x7a97a9c1, 0xe78d41f0, 0x53863656,\n    0xddb89193, 0x69b3e635, 0xf4a90e04, 0x40a279a2, 0xa9d23154,\n    0x1dd946f2, 0x80c3aec3, 0x34c8d965, 0xbaf67ea0, 0x0efd0906,\n    0x93e7e137, 0x27ec9691, 0x9c39bdcf, 0x2832ca69, 0xb5282258,\n    0x012355fe, 0x8f1df23b, 0x3b16859d, 0xa60c6dac, 0x12071a0a,\n    0xfb7752fc, 0x4f7c255a, 0xd266cd6b, 0x666dbacd, 0xe8531d08,\n    0x5c586aae, 0xc142829f, 0x7549f539, 0x52a563a8, 0xe6ae140e,\n    0x7bb4fc3f, 0xcfbf8b99, 0x41812c5c, 0xf58a5bfa, 0x6890b3cb,\n    0xdc9bc46d, 0x35eb8c9b, 0x81e0fb3d, 0x1cfa130c, 0xa8f164aa,\n    0x26cfc36f, 0x92c4b4c9, 0x0fde5cf8, 0xbbd52b5e, 0x79750b44,\n    0xcd7e7ce2, 0x506494d3, 0xe46fe375, 0x6a5144b0, 0xde5a3316,\n    0x4340db27, 0xf74bac81, 0x1e3be477, 0xaa3093d1, 0x372a7be0,\n    0x83210c46, 0x0d1fab83, 0xb914dc25, 0x240e3414, 0x900543b2,\n    0xb7e9d523, 0x03e2a285, 0x9ef84ab4, 0x2af33d12, 0xa4cd9ad7,\n    0x10c6ed71, 0x8ddc0540, 0x39d772e6, 0xd0a73a10, 0x64ac4db6,\n    0xf9b6a587, 0x4dbdd221, 0xc38375e4, 0x77880242, 0xea92ea73,\n    0x5e999dd5, 0xe54cb68b, 0x5147c12d, 0xcc5d291c, 0x78565eba,\n    0xf668f97f, 0x42638ed9, 0xdf7966e8, 0x6b72114e, 0x820259b8,\n    0x36092e1e, 0xab13c62f, 0x1f18b189, 0x9126164c, 0x252d61ea,\n    0xb83789db, 0x0c3cfe7d, 0x2bd068ec, 0x9fdb1f4a, 0x02c1f77b,\n    0xb6ca80dd, 0x38f42718, 0x8cff50be, 0x11e5b88f, 0xa5eecf29,\n    0x4c9e87df, 0xf895f079, 0x658f1848, 0xd1846fee, 0x5fbac82b,\n    0xebb1bf8d, 0x76ab57bc, 0xc2a0201a, 0xf2ea1688, 0x46e1612e,\n    0xdbfb891f, 0x6ff0feb9, 0xe1ce597c, 0x55c52eda, 0xc8dfc6eb,\n    0x7cd4b14d, 0x95a4f9bb, 0x21af8e1d, 0xbcb5662c, 0x08be118a,\n    0x8680b64f, 0x328bc1e9, 0xaf9129d8, 0x1b9a5e7e, 0x3c76c8ef,\n    0x887dbf49, 0x15675778, 0xa16c20de, 0x2f52871b, 0x9b59f0bd,\n    0x0643188c, 0xb2486f2a, 0x5b3827dc, 0xef33507a, 0x7229b84b,\n    0xc622cfed, 0x481c6828, 0xfc171f8e, 0x610df7bf, 0xd5068019,\n    0x6ed3ab47, 0xdad8dce1, 0x47c234d0, 0xf3c94376, 0x7df7e4b3,\n    0xc9fc9315, 0x54e67b24, 0xe0ed0c82, 0x099d4474, 0xbd9633d2,\n    0x208cdbe3, 0x9487ac45, 0x1ab90b80, 0xaeb27c26, 0x33a89417,\n    0x87a3e3b1, 0xa04f7520, 0x14440286, 0x895eeab7, 0x3d559d11,\n    0xb36b3ad4, 0x07604d72, 0x9a7aa543, 0x2e71d2e5, 0xc7019a13,\n    0x730aedb5, 0xee100584, 0x5a1b7222, 0xd425d5e7, 0x602ea241,\n    0xfd344a70, 0x493f3dd6, 0x8b9f1dcc, 0x3f946a6a, 0xa28e825b,\n    0x1685f5fd, 0x98bb5238, 0x2cb0259e, 0xb1aacdaf, 0x05a1ba09,\n    0xecd1f2ff, 0x58da8559, 0xc5c06d68, 0x71cb1ace, 0xfff5bd0b,\n    0x4bfecaad, 0xd6e4229c, 0x62ef553a, 0x4503c3ab, 0xf108b40d,\n    0x6c125c3c, 0xd8192b9a, 0x56278c5f, 0xe22cfbf9, 0x7f3613c8,\n    0xcb3d646e, 0x224d2c98, 0x96465b3e, 0x0b5cb30f, 0xbf57c4a9,\n    0x3169636c, 0x856214ca, 0x1878fcfb, 0xac738b5d, 0x17a6a003,\n    0xa3add7a5, 0x3eb73f94, 0x8abc4832, 0x0482eff7, 0xb0899851,\n    0x2d937060, 0x999807c6, 0x70e84f30, 0xc4e33896, 0x59f9d0a7,\n    0xedf2a701, 0x63cc00c4, 0xd7c77762, 0x4add9f53, 0xfed6e8f5,\n    0xd93a7e64, 0x6d3109c2, 0xf02be1f3, 0x44209655, 0xca1e3190,\n    0x7e154636, 0xe30fae07, 0x5704d9a1, 0xbe749157, 0x0a7fe6f1,\n    0x97650ec0, 0x236e7966, 0xad50dea3, 0x195ba905, 0x84414134,\n    0x304a3692},\n   {0x00000000, 0x9e00aacc, 0x7d072542, 0xe3078f8e, 0xfa0e4a84,\n    0x640ee048, 0x87096fc6, 0x1909c50a, 0xb51be5d3, 0x2b1b4f1f,\n    0xc81cc091, 0x561c6a5d, 0x4f15af57, 0xd115059b, 0x32128a15,\n    0xac1220d9, 0x2b31bb7c, 0xb53111b0, 0x56369e3e, 0xc83634f2,\n    0xd13ff1f8, 0x4f3f5b34, 0xac38d4ba, 0x32387e76, 0x9e2a5eaf,\n    0x002af463, 0xe32d7bed, 0x7d2dd121, 0x6424142b, 0xfa24bee7,\n    0x19233169, 0x87239ba5, 0x566276f9, 0xc862dc35, 0x2b6553bb,\n    0xb565f977, 0xac6c3c7d, 0x326c96b1, 0xd16b193f, 0x4f6bb3f3,\n    0xe379932a, 0x7d7939e6, 0x9e7eb668, 0x007e1ca4, 0x1977d9ae,\n    0x87777362, 0x6470fcec, 0xfa705620, 0x7d53cd85, 0xe3536749,\n    0x0054e8c7, 0x9e54420b, 0x875d8701, 0x195d2dcd, 0xfa5aa243,\n    0x645a088f, 0xc8482856, 0x5648829a, 0xb54f0d14, 0x2b4fa7d8,\n    0x324662d2, 0xac46c81e, 0x4f414790, 0xd141ed5c, 0xedc29d29,\n    0x73c237e5, 0x90c5b86b, 0x0ec512a7, 0x17ccd7ad, 0x89cc7d61,\n    0x6acbf2ef, 0xf4cb5823, 0x58d978fa, 0xc6d9d236, 0x25de5db8,\n    0xbbdef774, 0xa2d7327e, 0x3cd798b2, 0xdfd0173c, 0x41d0bdf0,\n    0xc6f32655, 0x58f38c99, 0xbbf40317, 0x25f4a9db, 0x3cfd6cd1,\n    0xa2fdc61d, 0x41fa4993, 0xdffae35f, 0x73e8c386, 0xede8694a,\n    0x0eefe6c4, 0x90ef4c08, 0x89e68902, 0x17e623ce, 0xf4e1ac40,\n    0x6ae1068c, 0xbba0ebd0, 0x25a0411c, 0xc6a7ce92, 0x58a7645e,\n    0x41aea154, 0xdfae0b98, 0x3ca98416, 0xa2a92eda, 0x0ebb0e03,\n    0x90bba4cf, 0x73bc2b41, 0xedbc818d, 0xf4b54487, 0x6ab5ee4b,\n    0x89b261c5, 0x17b2cb09, 0x909150ac, 0x0e91fa60, 0xed9675ee,\n    0x7396df22, 0x6a9f1a28, 0xf49fb0e4, 0x17983f6a, 0x899895a6,\n    0x258ab57f, 0xbb8a1fb3, 0x588d903d, 0xc68d3af1, 0xdf84fffb,\n    0x41845537, 0xa283dab9, 0x3c837075, 0xda853b53, 0x4485919f,\n    0xa7821e11, 0x3982b4dd, 0x208b71d7, 0xbe8bdb1b, 0x5d8c5495,\n    0xc38cfe59, 0x6f9ede80, 0xf19e744c, 0x1299fbc2, 0x8c99510e,\n    0x95909404, 0x0b903ec8, 0xe897b146, 0x76971b8a, 0xf1b4802f,\n    0x6fb42ae3, 0x8cb3a56d, 0x12b30fa1, 0x0bbacaab, 0x95ba6067,\n    0x76bdefe9, 0xe8bd4525, 0x44af65fc, 0xdaafcf30, 0x39a840be,\n    0xa7a8ea72, 0xbea12f78, 0x20a185b4, 0xc3a60a3a, 0x5da6a0f6,\n    0x8ce74daa, 0x12e7e766, 0xf1e068e8, 0x6fe0c224, 0x76e9072e,\n    0xe8e9ade2, 0x0bee226c, 0x95ee88a0, 0x39fca879, 0xa7fc02b5,\n    0x44fb8d3b, 0xdafb27f7, 0xc3f2e2fd, 0x5df24831, 0xbef5c7bf,\n    0x20f56d73, 0xa7d6f6d6, 0x39d65c1a, 0xdad1d394, 0x44d17958,\n    0x5dd8bc52, 0xc3d8169e, 0x20df9910, 0xbedf33dc, 0x12cd1305,\n    0x8ccdb9c9, 0x6fca3647, 0xf1ca9c8b, 0xe8c35981, 0x76c3f34d,\n    0x95c47cc3, 0x0bc4d60f, 0x3747a67a, 0xa9470cb6, 0x4a408338,\n    0xd44029f4, 0xcd49ecfe, 0x53494632, 0xb04ec9bc, 0x2e4e6370,\n    0x825c43a9, 0x1c5ce965, 0xff5b66eb, 0x615bcc27, 0x7852092d,\n    0xe652a3e1, 0x05552c6f, 0x9b5586a3, 0x1c761d06, 0x8276b7ca,\n    0x61713844, 0xff719288, 0xe6785782, 0x7878fd4e, 0x9b7f72c0,\n    0x057fd80c, 0xa96df8d5, 0x376d5219, 0xd46add97, 0x4a6a775b,\n    0x5363b251, 0xcd63189d, 0x2e649713, 0xb0643ddf, 0x6125d083,\n    0xff257a4f, 0x1c22f5c1, 0x82225f0d, 0x9b2b9a07, 0x052b30cb,\n    0xe62cbf45, 0x782c1589, 0xd43e3550, 0x4a3e9f9c, 0xa9391012,\n    0x3739bade, 0x2e307fd4, 0xb030d518, 0x53375a96, 0xcd37f05a,\n    0x4a146bff, 0xd414c133, 0x37134ebd, 0xa913e471, 0xb01a217b,\n    0x2e1a8bb7, 0xcd1d0439, 0x531daef5, 0xff0f8e2c, 0x610f24e0,\n    0x8208ab6e, 0x1c0801a2, 0x0501c4a8, 0x9b016e64, 0x7806e1ea,\n    0xe6064b26}};\n\n#endif\n\n#endif\n\n#if N == 3\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f,\n    0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999,\n    0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee,\n    0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615,\n    0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383,\n    0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb,\n    0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275,\n    0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d,\n    0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b,\n    0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460,\n    0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317,\n    0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1,\n    0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5,\n    0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd,\n    0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04,\n    0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c,\n    0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7,\n    0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11,\n    0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66,\n    0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7,\n    0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871,\n    0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309,\n    0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd,\n    0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85,\n    0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913,\n    0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d,\n    0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a,\n    0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc,\n    0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57,\n    0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f,\n    0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6,\n    0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e,\n    0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f,\n    0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289,\n    0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe,\n    0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05,\n    0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893,\n    0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb,\n    0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0,\n    0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8,\n    0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e,\n    0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5,\n    0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2,\n    0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574,\n    0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5,\n    0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add,\n    0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114,\n    0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c,\n    0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7,\n    0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701,\n    0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076,\n    0x09cd8551},\n   {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193,\n    0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2,\n    0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c,\n    0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71,\n    0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a,\n    0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d,\n    0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71,\n    0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436,\n    0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d,\n    0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000,\n    0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae,\n    0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf,\n    0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930,\n    0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277,\n    0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff,\n    0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8,\n    0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef,\n    0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e,\n    0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20,\n    0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95,\n    0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e,\n    0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9,\n    0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d,\n    0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a,\n    0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151,\n    0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4,\n    0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a,\n    0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b,\n    0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c,\n    0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b,\n    0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3,\n    0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4,\n    0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b,\n    0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a,\n    0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4,\n    0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189,\n    0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92,\n    0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5,\n    0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9,\n    0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe,\n    0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5,\n    0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8,\n    0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66,\n    0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707,\n    0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8,\n    0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f,\n    0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707,\n    0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40,\n    0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017,\n    0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876,\n    0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8,\n    0x7bc97a0c},\n   {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300,\n    0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0,\n    0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80,\n    0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701,\n    0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41,\n    0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81,\n    0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43,\n    0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83,\n    0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3,\n    0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42,\n    0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202,\n    0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2,\n    0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7,\n    0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407,\n    0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47,\n    0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87,\n    0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86,\n    0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46,\n    0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506,\n    0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44,\n    0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704,\n    0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4,\n    0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5,\n    0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505,\n    0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45,\n    0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f,\n    0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f,\n    0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f,\n    0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e,\n    0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e,\n    0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e,\n    0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce,\n    0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c,\n    0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc,\n    0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c,\n    0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d,\n    0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d,\n    0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d,\n    0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88,\n    0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48,\n    0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708,\n    0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89,\n    0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9,\n    0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309,\n    0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb,\n    0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b,\n    0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b,\n    0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b,\n    0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a,\n    0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a,\n    0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a,\n    0x7851a2ca},\n   {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb,\n    0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8,\n    0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0,\n    0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f,\n    0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a,\n    0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf,\n    0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5,\n    0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380,\n    0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815,\n    0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa,\n    0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2,\n    0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1,\n    0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1,\n    0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4,\n    0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa,\n    0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df,\n    0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6,\n    0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5,\n    0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad,\n    0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca,\n    0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f,\n    0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a,\n    0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8,\n    0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d,\n    0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708,\n    0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d,\n    0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865,\n    0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636,\n    0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f,\n    0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a,\n    0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744,\n    0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061,\n    0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0,\n    0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293,\n    0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb,\n    0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874,\n    0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1,\n    0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4,\n    0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f,\n    0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a,\n    0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f,\n    0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120,\n    0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778,\n    0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b,\n    0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a,\n    0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af,\n    0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81,\n    0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4,\n    0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd,\n    0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e,\n    0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6,\n    0x566b6848},\n   {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59,\n    0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4,\n    0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67,\n    0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef,\n    0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97,\n    0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88,\n    0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687,\n    0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698,\n    0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0,\n    0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068,\n    0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb,\n    0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056,\n    0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016,\n    0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009,\n    0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028,\n    0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037,\n    0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a,\n    0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7,\n    0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054,\n    0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7,\n    0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af,\n    0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0,\n    0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4,\n    0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab,\n    0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3,\n    0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a,\n    0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9,\n    0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54,\n    0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09,\n    0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16,\n    0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37,\n    0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28,\n    0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e,\n    0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3,\n    0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40,\n    0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8,\n    0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0,\n    0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf,\n    0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6,\n    0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9,\n    0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1,\n    0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059,\n    0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca,\n    0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067,\n    0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031,\n    0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e,\n    0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f,\n    0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010,\n    0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d,\n    0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0,\n    0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073,\n    0xd8ac6b35},\n   {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2,\n    0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd,\n    0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696,\n    0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3,\n    0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f,\n    0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35,\n    0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5,\n    0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f,\n    0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673,\n    0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46,\n    0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d,\n    0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632,\n    0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28,\n    0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192,\n    0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c,\n    0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6,\n    0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0,\n    0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff,\n    0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4,\n    0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95,\n    0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9,\n    0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03,\n    0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7,\n    0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d,\n    0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151,\n    0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808,\n    0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343,\n    0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c,\n    0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a,\n    0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0,\n    0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e,\n    0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594,\n    0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6,\n    0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399,\n    0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2,\n    0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7,\n    0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb,\n    0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571,\n    0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289,\n    0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33,\n    0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f,\n    0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a,\n    0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461,\n    0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e,\n    0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c,\n    0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6,\n    0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918,\n    0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2,\n    0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484,\n    0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb,\n    0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0,\n    0xa140efa8},\n   {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706,\n    0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed,\n    0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289,\n    0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a,\n    0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214,\n    0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3,\n    0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3,\n    0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254,\n    0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a,\n    0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9,\n    0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad,\n    0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746,\n    0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060,\n    0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187,\n    0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef,\n    0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408,\n    0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e,\n    0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495,\n    0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1,\n    0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532,\n    0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c,\n    0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb,\n    0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb,\n    0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c,\n    0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42,\n    0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060,\n    0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04,\n    0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef,\n    0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99,\n    0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e,\n    0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16,\n    0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1,\n    0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7,\n    0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c,\n    0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38,\n    0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb,\n    0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5,\n    0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42,\n    0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62,\n    0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85,\n    0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb,\n    0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18,\n    0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c,\n    0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997,\n    0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1,\n    0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36,\n    0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e,\n    0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9,\n    0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf,\n    0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24,\n    0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040,\n    0x917cd6a1},\n   {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf,\n    0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd,\n    0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896,\n    0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9,\n    0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3,\n    0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f,\n    0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d,\n    0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1,\n    0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab,\n    0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4,\n    0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f,\n    0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d,\n    0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4,\n    0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978,\n    0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad,\n    0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621,\n    0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46,\n    0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854,\n    0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f,\n    0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a,\n    0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890,\n    0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c,\n    0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4,\n    0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238,\n    0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622,\n    0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab,\n    0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0,\n    0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2,\n    0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295,\n    0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19,\n    0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc,\n    0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140,\n    0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd,\n    0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf,\n    0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184,\n    0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb,\n    0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1,\n    0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d,\n    0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb,\n    0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257,\n    0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d,\n    0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22,\n    0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069,\n    0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b,\n    0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6,\n    0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a,\n    0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf,\n    0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33,\n    0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254,\n    0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146,\n    0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d,\n    0x18ba364e}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0x43cba68700000000, 0xc7903cd400000000,\n    0x845b9a5300000000, 0xcf27087300000000, 0x8cecaef400000000,\n    0x08b734a700000000, 0x4b7c922000000000, 0x9e4f10e600000000,\n    0xdd84b66100000000, 0x59df2c3200000000, 0x1a148ab500000000,\n    0x5168189500000000, 0x12a3be1200000000, 0x96f8244100000000,\n    0xd53382c600000000, 0x7d99511700000000, 0x3e52f79000000000,\n    0xba096dc300000000, 0xf9c2cb4400000000, 0xb2be596400000000,\n    0xf175ffe300000000, 0x752e65b000000000, 0x36e5c33700000000,\n    0xe3d641f100000000, 0xa01de77600000000, 0x24467d2500000000,\n    0x678ddba200000000, 0x2cf1498200000000, 0x6f3aef0500000000,\n    0xeb61755600000000, 0xa8aad3d100000000, 0xfa32a32e00000000,\n    0xb9f905a900000000, 0x3da29ffa00000000, 0x7e69397d00000000,\n    0x3515ab5d00000000, 0x76de0dda00000000, 0xf285978900000000,\n    0xb14e310e00000000, 0x647db3c800000000, 0x27b6154f00000000,\n    0xa3ed8f1c00000000, 0xe026299b00000000, 0xab5abbbb00000000,\n    0xe8911d3c00000000, 0x6cca876f00000000, 0x2f0121e800000000,\n    0x87abf23900000000, 0xc46054be00000000, 0x403bceed00000000,\n    0x03f0686a00000000, 0x488cfa4a00000000, 0x0b475ccd00000000,\n    0x8f1cc69e00000000, 0xccd7601900000000, 0x19e4e2df00000000,\n    0x5a2f445800000000, 0xde74de0b00000000, 0x9dbf788c00000000,\n    0xd6c3eaac00000000, 0x95084c2b00000000, 0x1153d67800000000,\n    0x529870ff00000000, 0xf465465d00000000, 0xb7aee0da00000000,\n    0x33f57a8900000000, 0x703edc0e00000000, 0x3b424e2e00000000,\n    0x7889e8a900000000, 0xfcd272fa00000000, 0xbf19d47d00000000,\n    0x6a2a56bb00000000, 0x29e1f03c00000000, 0xadba6a6f00000000,\n    0xee71cce800000000, 0xa50d5ec800000000, 0xe6c6f84f00000000,\n    0x629d621c00000000, 0x2156c49b00000000, 0x89fc174a00000000,\n    0xca37b1cd00000000, 0x4e6c2b9e00000000, 0x0da78d1900000000,\n    0x46db1f3900000000, 0x0510b9be00000000, 0x814b23ed00000000,\n    0xc280856a00000000, 0x17b307ac00000000, 0x5478a12b00000000,\n    0xd0233b7800000000, 0x93e89dff00000000, 0xd8940fdf00000000,\n    0x9b5fa95800000000, 0x1f04330b00000000, 0x5ccf958c00000000,\n    0x0e57e57300000000, 0x4d9c43f400000000, 0xc9c7d9a700000000,\n    0x8a0c7f2000000000, 0xc170ed0000000000, 0x82bb4b8700000000,\n    0x06e0d1d400000000, 0x452b775300000000, 0x9018f59500000000,\n    0xd3d3531200000000, 0x5788c94100000000, 0x14436fc600000000,\n    0x5f3ffde600000000, 0x1cf45b6100000000, 0x98afc13200000000,\n    0xdb6467b500000000, 0x73ceb46400000000, 0x300512e300000000,\n    0xb45e88b000000000, 0xf7952e3700000000, 0xbce9bc1700000000,\n    0xff221a9000000000, 0x7b7980c300000000, 0x38b2264400000000,\n    0xed81a48200000000, 0xae4a020500000000, 0x2a11985600000000,\n    0x69da3ed100000000, 0x22a6acf100000000, 0x616d0a7600000000,\n    0xe536902500000000, 0xa6fd36a200000000, 0xe8cb8cba00000000,\n    0xab002a3d00000000, 0x2f5bb06e00000000, 0x6c9016e900000000,\n    0x27ec84c900000000, 0x6427224e00000000, 0xe07cb81d00000000,\n    0xa3b71e9a00000000, 0x76849c5c00000000, 0x354f3adb00000000,\n    0xb114a08800000000, 0xf2df060f00000000, 0xb9a3942f00000000,\n    0xfa6832a800000000, 0x7e33a8fb00000000, 0x3df80e7c00000000,\n    0x9552ddad00000000, 0xd6997b2a00000000, 0x52c2e17900000000,\n    0x110947fe00000000, 0x5a75d5de00000000, 0x19be735900000000,\n    0x9de5e90a00000000, 0xde2e4f8d00000000, 0x0b1dcd4b00000000,\n    0x48d66bcc00000000, 0xcc8df19f00000000, 0x8f46571800000000,\n    0xc43ac53800000000, 0x87f163bf00000000, 0x03aaf9ec00000000,\n    0x40615f6b00000000, 0x12f92f9400000000, 0x5132891300000000,\n    0xd569134000000000, 0x96a2b5c700000000, 0xddde27e700000000,\n    0x9e15816000000000, 0x1a4e1b3300000000, 0x5985bdb400000000,\n    0x8cb63f7200000000, 0xcf7d99f500000000, 0x4b2603a600000000,\n    0x08eda52100000000, 0x4391370100000000, 0x005a918600000000,\n    0x84010bd500000000, 0xc7caad5200000000, 0x6f607e8300000000,\n    0x2cabd80400000000, 0xa8f0425700000000, 0xeb3be4d000000000,\n    0xa04776f000000000, 0xe38cd07700000000, 0x67d74a2400000000,\n    0x241ceca300000000, 0xf12f6e6500000000, 0xb2e4c8e200000000,\n    0x36bf52b100000000, 0x7574f43600000000, 0x3e08661600000000,\n    0x7dc3c09100000000, 0xf9985ac200000000, 0xba53fc4500000000,\n    0x1caecae700000000, 0x5f656c6000000000, 0xdb3ef63300000000,\n    0x98f550b400000000, 0xd389c29400000000, 0x9042641300000000,\n    0x1419fe4000000000, 0x57d258c700000000, 0x82e1da0100000000,\n    0xc12a7c8600000000, 0x4571e6d500000000, 0x06ba405200000000,\n    0x4dc6d27200000000, 0x0e0d74f500000000, 0x8a56eea600000000,\n    0xc99d482100000000, 0x61379bf000000000, 0x22fc3d7700000000,\n    0xa6a7a72400000000, 0xe56c01a300000000, 0xae10938300000000,\n    0xeddb350400000000, 0x6980af5700000000, 0x2a4b09d000000000,\n    0xff788b1600000000, 0xbcb32d9100000000, 0x38e8b7c200000000,\n    0x7b23114500000000, 0x305f836500000000, 0x739425e200000000,\n    0xf7cfbfb100000000, 0xb404193600000000, 0xe69c69c900000000,\n    0xa557cf4e00000000, 0x210c551d00000000, 0x62c7f39a00000000,\n    0x29bb61ba00000000, 0x6a70c73d00000000, 0xee2b5d6e00000000,\n    0xade0fbe900000000, 0x78d3792f00000000, 0x3b18dfa800000000,\n    0xbf4345fb00000000, 0xfc88e37c00000000, 0xb7f4715c00000000,\n    0xf43fd7db00000000, 0x70644d8800000000, 0x33afeb0f00000000,\n    0x9b0538de00000000, 0xd8ce9e5900000000, 0x5c95040a00000000,\n    0x1f5ea28d00000000, 0x542230ad00000000, 0x17e9962a00000000,\n    0x93b20c7900000000, 0xd079aafe00000000, 0x054a283800000000,\n    0x46818ebf00000000, 0xc2da14ec00000000, 0x8111b26b00000000,\n    0xca6d204b00000000, 0x89a686cc00000000, 0x0dfd1c9f00000000,\n    0x4e36ba1800000000},\n   {0x0000000000000000, 0xe1b652ef00000000, 0x836bd40500000000,\n    0x62dd86ea00000000, 0x06d7a80b00000000, 0xe761fae400000000,\n    0x85bc7c0e00000000, 0x640a2ee100000000, 0x0cae511700000000,\n    0xed1803f800000000, 0x8fc5851200000000, 0x6e73d7fd00000000,\n    0x0a79f91c00000000, 0xebcfabf300000000, 0x89122d1900000000,\n    0x68a47ff600000000, 0x185ca32e00000000, 0xf9eaf1c100000000,\n    0x9b37772b00000000, 0x7a8125c400000000, 0x1e8b0b2500000000,\n    0xff3d59ca00000000, 0x9de0df2000000000, 0x7c568dcf00000000,\n    0x14f2f23900000000, 0xf544a0d600000000, 0x9799263c00000000,\n    0x762f74d300000000, 0x12255a3200000000, 0xf39308dd00000000,\n    0x914e8e3700000000, 0x70f8dcd800000000, 0x30b8465d00000000,\n    0xd10e14b200000000, 0xb3d3925800000000, 0x5265c0b700000000,\n    0x366fee5600000000, 0xd7d9bcb900000000, 0xb5043a5300000000,\n    0x54b268bc00000000, 0x3c16174a00000000, 0xdda045a500000000,\n    0xbf7dc34f00000000, 0x5ecb91a000000000, 0x3ac1bf4100000000,\n    0xdb77edae00000000, 0xb9aa6b4400000000, 0x581c39ab00000000,\n    0x28e4e57300000000, 0xc952b79c00000000, 0xab8f317600000000,\n    0x4a39639900000000, 0x2e334d7800000000, 0xcf851f9700000000,\n    0xad58997d00000000, 0x4ceecb9200000000, 0x244ab46400000000,\n    0xc5fce68b00000000, 0xa721606100000000, 0x4697328e00000000,\n    0x229d1c6f00000000, 0xc32b4e8000000000, 0xa1f6c86a00000000,\n    0x40409a8500000000, 0x60708dba00000000, 0x81c6df5500000000,\n    0xe31b59bf00000000, 0x02ad0b5000000000, 0x66a725b100000000,\n    0x8711775e00000000, 0xe5ccf1b400000000, 0x047aa35b00000000,\n    0x6cdedcad00000000, 0x8d688e4200000000, 0xefb508a800000000,\n    0x0e035a4700000000, 0x6a0974a600000000, 0x8bbf264900000000,\n    0xe962a0a300000000, 0x08d4f24c00000000, 0x782c2e9400000000,\n    0x999a7c7b00000000, 0xfb47fa9100000000, 0x1af1a87e00000000,\n    0x7efb869f00000000, 0x9f4dd47000000000, 0xfd90529a00000000,\n    0x1c26007500000000, 0x74827f8300000000, 0x95342d6c00000000,\n    0xf7e9ab8600000000, 0x165ff96900000000, 0x7255d78800000000,\n    0x93e3856700000000, 0xf13e038d00000000, 0x1088516200000000,\n    0x50c8cbe700000000, 0xb17e990800000000, 0xd3a31fe200000000,\n    0x32154d0d00000000, 0x561f63ec00000000, 0xb7a9310300000000,\n    0xd574b7e900000000, 0x34c2e50600000000, 0x5c669af000000000,\n    0xbdd0c81f00000000, 0xdf0d4ef500000000, 0x3ebb1c1a00000000,\n    0x5ab132fb00000000, 0xbb07601400000000, 0xd9dae6fe00000000,\n    0x386cb41100000000, 0x489468c900000000, 0xa9223a2600000000,\n    0xcbffbccc00000000, 0x2a49ee2300000000, 0x4e43c0c200000000,\n    0xaff5922d00000000, 0xcd2814c700000000, 0x2c9e462800000000,\n    0x443a39de00000000, 0xa58c6b3100000000, 0xc751eddb00000000,\n    0x26e7bf3400000000, 0x42ed91d500000000, 0xa35bc33a00000000,\n    0xc18645d000000000, 0x2030173f00000000, 0x81e66bae00000000,\n    0x6050394100000000, 0x028dbfab00000000, 0xe33bed4400000000,\n    0x8731c3a500000000, 0x6687914a00000000, 0x045a17a000000000,\n    0xe5ec454f00000000, 0x8d483ab900000000, 0x6cfe685600000000,\n    0x0e23eebc00000000, 0xef95bc5300000000, 0x8b9f92b200000000,\n    0x6a29c05d00000000, 0x08f446b700000000, 0xe942145800000000,\n    0x99bac88000000000, 0x780c9a6f00000000, 0x1ad11c8500000000,\n    0xfb674e6a00000000, 0x9f6d608b00000000, 0x7edb326400000000,\n    0x1c06b48e00000000, 0xfdb0e66100000000, 0x9514999700000000,\n    0x74a2cb7800000000, 0x167f4d9200000000, 0xf7c91f7d00000000,\n    0x93c3319c00000000, 0x7275637300000000, 0x10a8e59900000000,\n    0xf11eb77600000000, 0xb15e2df300000000, 0x50e87f1c00000000,\n    0x3235f9f600000000, 0xd383ab1900000000, 0xb78985f800000000,\n    0x563fd71700000000, 0x34e251fd00000000, 0xd554031200000000,\n    0xbdf07ce400000000, 0x5c462e0b00000000, 0x3e9ba8e100000000,\n    0xdf2dfa0e00000000, 0xbb27d4ef00000000, 0x5a91860000000000,\n    0x384c00ea00000000, 0xd9fa520500000000, 0xa9028edd00000000,\n    0x48b4dc3200000000, 0x2a695ad800000000, 0xcbdf083700000000,\n    0xafd526d600000000, 0x4e63743900000000, 0x2cbef2d300000000,\n    0xcd08a03c00000000, 0xa5acdfca00000000, 0x441a8d2500000000,\n    0x26c70bcf00000000, 0xc771592000000000, 0xa37b77c100000000,\n    0x42cd252e00000000, 0x2010a3c400000000, 0xc1a6f12b00000000,\n    0xe196e61400000000, 0x0020b4fb00000000, 0x62fd321100000000,\n    0x834b60fe00000000, 0xe7414e1f00000000, 0x06f71cf000000000,\n    0x642a9a1a00000000, 0x859cc8f500000000, 0xed38b70300000000,\n    0x0c8ee5ec00000000, 0x6e53630600000000, 0x8fe531e900000000,\n    0xebef1f0800000000, 0x0a594de700000000, 0x6884cb0d00000000,\n    0x893299e200000000, 0xf9ca453a00000000, 0x187c17d500000000,\n    0x7aa1913f00000000, 0x9b17c3d000000000, 0xff1ded3100000000,\n    0x1eabbfde00000000, 0x7c76393400000000, 0x9dc06bdb00000000,\n    0xf564142d00000000, 0x14d246c200000000, 0x760fc02800000000,\n    0x97b992c700000000, 0xf3b3bc2600000000, 0x1205eec900000000,\n    0x70d8682300000000, 0x916e3acc00000000, 0xd12ea04900000000,\n    0x3098f2a600000000, 0x5245744c00000000, 0xb3f326a300000000,\n    0xd7f9084200000000, 0x364f5aad00000000, 0x5492dc4700000000,\n    0xb5248ea800000000, 0xdd80f15e00000000, 0x3c36a3b100000000,\n    0x5eeb255b00000000, 0xbf5d77b400000000, 0xdb57595500000000,\n    0x3ae10bba00000000, 0x583c8d5000000000, 0xb98adfbf00000000,\n    0xc972036700000000, 0x28c4518800000000, 0x4a19d76200000000,\n    0xabaf858d00000000, 0xcfa5ab6c00000000, 0x2e13f98300000000,\n    0x4cce7f6900000000, 0xad782d8600000000, 0xc5dc527000000000,\n    0x246a009f00000000, 0x46b7867500000000, 0xa701d49a00000000,\n    0xc30bfa7b00000000, 0x22bda89400000000, 0x40602e7e00000000,\n    0xa1d67c9100000000},\n   {0x0000000000000000, 0x5880e2d700000000, 0xf106b47400000000,\n    0xa98656a300000000, 0xe20d68e900000000, 0xba8d8a3e00000000,\n    0x130bdc9d00000000, 0x4b8b3e4a00000000, 0x851da10900000000,\n    0xdd9d43de00000000, 0x741b157d00000000, 0x2c9bf7aa00000000,\n    0x6710c9e000000000, 0x3f902b3700000000, 0x96167d9400000000,\n    0xce969f4300000000, 0x0a3b421300000000, 0x52bba0c400000000,\n    0xfb3df66700000000, 0xa3bd14b000000000, 0xe8362afa00000000,\n    0xb0b6c82d00000000, 0x19309e8e00000000, 0x41b07c5900000000,\n    0x8f26e31a00000000, 0xd7a601cd00000000, 0x7e20576e00000000,\n    0x26a0b5b900000000, 0x6d2b8bf300000000, 0x35ab692400000000,\n    0x9c2d3f8700000000, 0xc4addd5000000000, 0x1476842600000000,\n    0x4cf666f100000000, 0xe570305200000000, 0xbdf0d28500000000,\n    0xf67beccf00000000, 0xaefb0e1800000000, 0x077d58bb00000000,\n    0x5ffdba6c00000000, 0x916b252f00000000, 0xc9ebc7f800000000,\n    0x606d915b00000000, 0x38ed738c00000000, 0x73664dc600000000,\n    0x2be6af1100000000, 0x8260f9b200000000, 0xdae01b6500000000,\n    0x1e4dc63500000000, 0x46cd24e200000000, 0xef4b724100000000,\n    0xb7cb909600000000, 0xfc40aedc00000000, 0xa4c04c0b00000000,\n    0x0d461aa800000000, 0x55c6f87f00000000, 0x9b50673c00000000,\n    0xc3d085eb00000000, 0x6a56d34800000000, 0x32d6319f00000000,\n    0x795d0fd500000000, 0x21dded0200000000, 0x885bbba100000000,\n    0xd0db597600000000, 0x28ec084d00000000, 0x706cea9a00000000,\n    0xd9eabc3900000000, 0x816a5eee00000000, 0xcae160a400000000,\n    0x9261827300000000, 0x3be7d4d000000000, 0x6367360700000000,\n    0xadf1a94400000000, 0xf5714b9300000000, 0x5cf71d3000000000,\n    0x0477ffe700000000, 0x4ffcc1ad00000000, 0x177c237a00000000,\n    0xbefa75d900000000, 0xe67a970e00000000, 0x22d74a5e00000000,\n    0x7a57a88900000000, 0xd3d1fe2a00000000, 0x8b511cfd00000000,\n    0xc0da22b700000000, 0x985ac06000000000, 0x31dc96c300000000,\n    0x695c741400000000, 0xa7caeb5700000000, 0xff4a098000000000,\n    0x56cc5f2300000000, 0x0e4cbdf400000000, 0x45c783be00000000,\n    0x1d47616900000000, 0xb4c137ca00000000, 0xec41d51d00000000,\n    0x3c9a8c6b00000000, 0x641a6ebc00000000, 0xcd9c381f00000000,\n    0x951cdac800000000, 0xde97e48200000000, 0x8617065500000000,\n    0x2f9150f600000000, 0x7711b22100000000, 0xb9872d6200000000,\n    0xe107cfb500000000, 0x4881991600000000, 0x10017bc100000000,\n    0x5b8a458b00000000, 0x030aa75c00000000, 0xaa8cf1ff00000000,\n    0xf20c132800000000, 0x36a1ce7800000000, 0x6e212caf00000000,\n    0xc7a77a0c00000000, 0x9f2798db00000000, 0xd4aca69100000000,\n    0x8c2c444600000000, 0x25aa12e500000000, 0x7d2af03200000000,\n    0xb3bc6f7100000000, 0xeb3c8da600000000, 0x42badb0500000000,\n    0x1a3a39d200000000, 0x51b1079800000000, 0x0931e54f00000000,\n    0xa0b7b3ec00000000, 0xf837513b00000000, 0x50d8119a00000000,\n    0x0858f34d00000000, 0xa1dea5ee00000000, 0xf95e473900000000,\n    0xb2d5797300000000, 0xea559ba400000000, 0x43d3cd0700000000,\n    0x1b532fd000000000, 0xd5c5b09300000000, 0x8d45524400000000,\n    0x24c304e700000000, 0x7c43e63000000000, 0x37c8d87a00000000,\n    0x6f483aad00000000, 0xc6ce6c0e00000000, 0x9e4e8ed900000000,\n    0x5ae3538900000000, 0x0263b15e00000000, 0xabe5e7fd00000000,\n    0xf365052a00000000, 0xb8ee3b6000000000, 0xe06ed9b700000000,\n    0x49e88f1400000000, 0x11686dc300000000, 0xdffef28000000000,\n    0x877e105700000000, 0x2ef846f400000000, 0x7678a42300000000,\n    0x3df39a6900000000, 0x657378be00000000, 0xccf52e1d00000000,\n    0x9475ccca00000000, 0x44ae95bc00000000, 0x1c2e776b00000000,\n    0xb5a821c800000000, 0xed28c31f00000000, 0xa6a3fd5500000000,\n    0xfe231f8200000000, 0x57a5492100000000, 0x0f25abf600000000,\n    0xc1b334b500000000, 0x9933d66200000000, 0x30b580c100000000,\n    0x6835621600000000, 0x23be5c5c00000000, 0x7b3ebe8b00000000,\n    0xd2b8e82800000000, 0x8a380aff00000000, 0x4e95d7af00000000,\n    0x1615357800000000, 0xbf9363db00000000, 0xe713810c00000000,\n    0xac98bf4600000000, 0xf4185d9100000000, 0x5d9e0b3200000000,\n    0x051ee9e500000000, 0xcb8876a600000000, 0x9308947100000000,\n    0x3a8ec2d200000000, 0x620e200500000000, 0x29851e4f00000000,\n    0x7105fc9800000000, 0xd883aa3b00000000, 0x800348ec00000000,\n    0x783419d700000000, 0x20b4fb0000000000, 0x8932ada300000000,\n    0xd1b24f7400000000, 0x9a39713e00000000, 0xc2b993e900000000,\n    0x6b3fc54a00000000, 0x33bf279d00000000, 0xfd29b8de00000000,\n    0xa5a95a0900000000, 0x0c2f0caa00000000, 0x54afee7d00000000,\n    0x1f24d03700000000, 0x47a432e000000000, 0xee22644300000000,\n    0xb6a2869400000000, 0x720f5bc400000000, 0x2a8fb91300000000,\n    0x8309efb000000000, 0xdb890d6700000000, 0x9002332d00000000,\n    0xc882d1fa00000000, 0x6104875900000000, 0x3984658e00000000,\n    0xf712facd00000000, 0xaf92181a00000000, 0x06144eb900000000,\n    0x5e94ac6e00000000, 0x151f922400000000, 0x4d9f70f300000000,\n    0xe419265000000000, 0xbc99c48700000000, 0x6c429df100000000,\n    0x34c27f2600000000, 0x9d44298500000000, 0xc5c4cb5200000000,\n    0x8e4ff51800000000, 0xd6cf17cf00000000, 0x7f49416c00000000,\n    0x27c9a3bb00000000, 0xe95f3cf800000000, 0xb1dfde2f00000000,\n    0x1859888c00000000, 0x40d96a5b00000000, 0x0b52541100000000,\n    0x53d2b6c600000000, 0xfa54e06500000000, 0xa2d402b200000000,\n    0x6679dfe200000000, 0x3ef93d3500000000, 0x977f6b9600000000,\n    0xcfff894100000000, 0x8474b70b00000000, 0xdcf455dc00000000,\n    0x7572037f00000000, 0x2df2e1a800000000, 0xe3647eeb00000000,\n    0xbbe49c3c00000000, 0x1262ca9f00000000, 0x4ae2284800000000,\n    0x0169160200000000, 0x59e9f4d500000000, 0xf06fa27600000000,\n    0xa8ef40a100000000},\n   {0x0000000000000000, 0x463b676500000000, 0x8c76ceca00000000,\n    0xca4da9af00000000, 0x59ebed4e00000000, 0x1fd08a2b00000000,\n    0xd59d238400000000, 0x93a644e100000000, 0xb2d6db9d00000000,\n    0xf4edbcf800000000, 0x3ea0155700000000, 0x789b723200000000,\n    0xeb3d36d300000000, 0xad0651b600000000, 0x674bf81900000000,\n    0x21709f7c00000000, 0x25abc6e000000000, 0x6390a18500000000,\n    0xa9dd082a00000000, 0xefe66f4f00000000, 0x7c402bae00000000,\n    0x3a7b4ccb00000000, 0xf036e56400000000, 0xb60d820100000000,\n    0x977d1d7d00000000, 0xd1467a1800000000, 0x1b0bd3b700000000,\n    0x5d30b4d200000000, 0xce96f03300000000, 0x88ad975600000000,\n    0x42e03ef900000000, 0x04db599c00000000, 0x0b50fc1a00000000,\n    0x4d6b9b7f00000000, 0x872632d000000000, 0xc11d55b500000000,\n    0x52bb115400000000, 0x1480763100000000, 0xdecddf9e00000000,\n    0x98f6b8fb00000000, 0xb986278700000000, 0xffbd40e200000000,\n    0x35f0e94d00000000, 0x73cb8e2800000000, 0xe06dcac900000000,\n    0xa656adac00000000, 0x6c1b040300000000, 0x2a20636600000000,\n    0x2efb3afa00000000, 0x68c05d9f00000000, 0xa28df43000000000,\n    0xe4b6935500000000, 0x7710d7b400000000, 0x312bb0d100000000,\n    0xfb66197e00000000, 0xbd5d7e1b00000000, 0x9c2de16700000000,\n    0xda16860200000000, 0x105b2fad00000000, 0x566048c800000000,\n    0xc5c60c2900000000, 0x83fd6b4c00000000, 0x49b0c2e300000000,\n    0x0f8ba58600000000, 0x16a0f83500000000, 0x509b9f5000000000,\n    0x9ad636ff00000000, 0xdced519a00000000, 0x4f4b157b00000000,\n    0x0970721e00000000, 0xc33ddbb100000000, 0x8506bcd400000000,\n    0xa47623a800000000, 0xe24d44cd00000000, 0x2800ed6200000000,\n    0x6e3b8a0700000000, 0xfd9dcee600000000, 0xbba6a98300000000,\n    0x71eb002c00000000, 0x37d0674900000000, 0x330b3ed500000000,\n    0x753059b000000000, 0xbf7df01f00000000, 0xf946977a00000000,\n    0x6ae0d39b00000000, 0x2cdbb4fe00000000, 0xe6961d5100000000,\n    0xa0ad7a3400000000, 0x81dde54800000000, 0xc7e6822d00000000,\n    0x0dab2b8200000000, 0x4b904ce700000000, 0xd836080600000000,\n    0x9e0d6f6300000000, 0x5440c6cc00000000, 0x127ba1a900000000,\n    0x1df0042f00000000, 0x5bcb634a00000000, 0x9186cae500000000,\n    0xd7bdad8000000000, 0x441be96100000000, 0x02208e0400000000,\n    0xc86d27ab00000000, 0x8e5640ce00000000, 0xaf26dfb200000000,\n    0xe91db8d700000000, 0x2350117800000000, 0x656b761d00000000,\n    0xf6cd32fc00000000, 0xb0f6559900000000, 0x7abbfc3600000000,\n    0x3c809b5300000000, 0x385bc2cf00000000, 0x7e60a5aa00000000,\n    0xb42d0c0500000000, 0xf2166b6000000000, 0x61b02f8100000000,\n    0x278b48e400000000, 0xedc6e14b00000000, 0xabfd862e00000000,\n    0x8a8d195200000000, 0xccb67e3700000000, 0x06fbd79800000000,\n    0x40c0b0fd00000000, 0xd366f41c00000000, 0x955d937900000000,\n    0x5f103ad600000000, 0x192b5db300000000, 0x2c40f16b00000000,\n    0x6a7b960e00000000, 0xa0363fa100000000, 0xe60d58c400000000,\n    0x75ab1c2500000000, 0x33907b4000000000, 0xf9ddd2ef00000000,\n    0xbfe6b58a00000000, 0x9e962af600000000, 0xd8ad4d9300000000,\n    0x12e0e43c00000000, 0x54db835900000000, 0xc77dc7b800000000,\n    0x8146a0dd00000000, 0x4b0b097200000000, 0x0d306e1700000000,\n    0x09eb378b00000000, 0x4fd050ee00000000, 0x859df94100000000,\n    0xc3a69e2400000000, 0x5000dac500000000, 0x163bbda000000000,\n    0xdc76140f00000000, 0x9a4d736a00000000, 0xbb3dec1600000000,\n    0xfd068b7300000000, 0x374b22dc00000000, 0x717045b900000000,\n    0xe2d6015800000000, 0xa4ed663d00000000, 0x6ea0cf9200000000,\n    0x289ba8f700000000, 0x27100d7100000000, 0x612b6a1400000000,\n    0xab66c3bb00000000, 0xed5da4de00000000, 0x7efbe03f00000000,\n    0x38c0875a00000000, 0xf28d2ef500000000, 0xb4b6499000000000,\n    0x95c6d6ec00000000, 0xd3fdb18900000000, 0x19b0182600000000,\n    0x5f8b7f4300000000, 0xcc2d3ba200000000, 0x8a165cc700000000,\n    0x405bf56800000000, 0x0660920d00000000, 0x02bbcb9100000000,\n    0x4480acf400000000, 0x8ecd055b00000000, 0xc8f6623e00000000,\n    0x5b5026df00000000, 0x1d6b41ba00000000, 0xd726e81500000000,\n    0x911d8f7000000000, 0xb06d100c00000000, 0xf656776900000000,\n    0x3c1bdec600000000, 0x7a20b9a300000000, 0xe986fd4200000000,\n    0xafbd9a2700000000, 0x65f0338800000000, 0x23cb54ed00000000,\n    0x3ae0095e00000000, 0x7cdb6e3b00000000, 0xb696c79400000000,\n    0xf0ada0f100000000, 0x630be41000000000, 0x2530837500000000,\n    0xef7d2ada00000000, 0xa9464dbf00000000, 0x8836d2c300000000,\n    0xce0db5a600000000, 0x04401c0900000000, 0x427b7b6c00000000,\n    0xd1dd3f8d00000000, 0x97e658e800000000, 0x5dabf14700000000,\n    0x1b90962200000000, 0x1f4bcfbe00000000, 0x5970a8db00000000,\n    0x933d017400000000, 0xd506661100000000, 0x46a022f000000000,\n    0x009b459500000000, 0xcad6ec3a00000000, 0x8ced8b5f00000000,\n    0xad9d142300000000, 0xeba6734600000000, 0x21ebdae900000000,\n    0x67d0bd8c00000000, 0xf476f96d00000000, 0xb24d9e0800000000,\n    0x780037a700000000, 0x3e3b50c200000000, 0x31b0f54400000000,\n    0x778b922100000000, 0xbdc63b8e00000000, 0xfbfd5ceb00000000,\n    0x685b180a00000000, 0x2e607f6f00000000, 0xe42dd6c000000000,\n    0xa216b1a500000000, 0x83662ed900000000, 0xc55d49bc00000000,\n    0x0f10e01300000000, 0x492b877600000000, 0xda8dc39700000000,\n    0x9cb6a4f200000000, 0x56fb0d5d00000000, 0x10c06a3800000000,\n    0x141b33a400000000, 0x522054c100000000, 0x986dfd6e00000000,\n    0xde569a0b00000000, 0x4df0deea00000000, 0x0bcbb98f00000000,\n    0xc186102000000000, 0x87bd774500000000, 0xa6cde83900000000,\n    0xe0f68f5c00000000, 0x2abb26f300000000, 0x6c80419600000000,\n    0xff26057700000000, 0xb91d621200000000, 0x7350cbbd00000000,\n    0x356bacd800000000},\n   {0x0000000000000000, 0x9e83da9f00000000, 0x7d01c4e400000000,\n    0xe3821e7b00000000, 0xbb04f91200000000, 0x2587238d00000000,\n    0xc6053df600000000, 0x5886e76900000000, 0x7609f22500000000,\n    0xe88a28ba00000000, 0x0b0836c100000000, 0x958bec5e00000000,\n    0xcd0d0b3700000000, 0x538ed1a800000000, 0xb00ccfd300000000,\n    0x2e8f154c00000000, 0xec12e44b00000000, 0x72913ed400000000,\n    0x911320af00000000, 0x0f90fa3000000000, 0x57161d5900000000,\n    0xc995c7c600000000, 0x2a17d9bd00000000, 0xb494032200000000,\n    0x9a1b166e00000000, 0x0498ccf100000000, 0xe71ad28a00000000,\n    0x7999081500000000, 0x211fef7c00000000, 0xbf9c35e300000000,\n    0x5c1e2b9800000000, 0xc29df10700000000, 0xd825c89700000000,\n    0x46a6120800000000, 0xa5240c7300000000, 0x3ba7d6ec00000000,\n    0x6321318500000000, 0xfda2eb1a00000000, 0x1e20f56100000000,\n    0x80a32ffe00000000, 0xae2c3ab200000000, 0x30afe02d00000000,\n    0xd32dfe5600000000, 0x4dae24c900000000, 0x1528c3a000000000,\n    0x8bab193f00000000, 0x6829074400000000, 0xf6aadddb00000000,\n    0x34372cdc00000000, 0xaab4f64300000000, 0x4936e83800000000,\n    0xd7b532a700000000, 0x8f33d5ce00000000, 0x11b00f5100000000,\n    0xf232112a00000000, 0x6cb1cbb500000000, 0x423edef900000000,\n    0xdcbd046600000000, 0x3f3f1a1d00000000, 0xa1bcc08200000000,\n    0xf93a27eb00000000, 0x67b9fd7400000000, 0x843be30f00000000,\n    0x1ab8399000000000, 0xf14de1f400000000, 0x6fce3b6b00000000,\n    0x8c4c251000000000, 0x12cfff8f00000000, 0x4a4918e600000000,\n    0xd4cac27900000000, 0x3748dc0200000000, 0xa9cb069d00000000,\n    0x874413d100000000, 0x19c7c94e00000000, 0xfa45d73500000000,\n    0x64c60daa00000000, 0x3c40eac300000000, 0xa2c3305c00000000,\n    0x41412e2700000000, 0xdfc2f4b800000000, 0x1d5f05bf00000000,\n    0x83dcdf2000000000, 0x605ec15b00000000, 0xfedd1bc400000000,\n    0xa65bfcad00000000, 0x38d8263200000000, 0xdb5a384900000000,\n    0x45d9e2d600000000, 0x6b56f79a00000000, 0xf5d52d0500000000,\n    0x1657337e00000000, 0x88d4e9e100000000, 0xd0520e8800000000,\n    0x4ed1d41700000000, 0xad53ca6c00000000, 0x33d010f300000000,\n    0x2968296300000000, 0xb7ebf3fc00000000, 0x5469ed8700000000,\n    0xcaea371800000000, 0x926cd07100000000, 0x0cef0aee00000000,\n    0xef6d149500000000, 0x71eece0a00000000, 0x5f61db4600000000,\n    0xc1e201d900000000, 0x22601fa200000000, 0xbce3c53d00000000,\n    0xe465225400000000, 0x7ae6f8cb00000000, 0x9964e6b000000000,\n    0x07e73c2f00000000, 0xc57acd2800000000, 0x5bf917b700000000,\n    0xb87b09cc00000000, 0x26f8d35300000000, 0x7e7e343a00000000,\n    0xe0fdeea500000000, 0x037ff0de00000000, 0x9dfc2a4100000000,\n    0xb3733f0d00000000, 0x2df0e59200000000, 0xce72fbe900000000,\n    0x50f1217600000000, 0x0877c61f00000000, 0x96f41c8000000000,\n    0x757602fb00000000, 0xebf5d86400000000, 0xa39db33200000000,\n    0x3d1e69ad00000000, 0xde9c77d600000000, 0x401fad4900000000,\n    0x18994a2000000000, 0x861a90bf00000000, 0x65988ec400000000,\n    0xfb1b545b00000000, 0xd594411700000000, 0x4b179b8800000000,\n    0xa89585f300000000, 0x36165f6c00000000, 0x6e90b80500000000,\n    0xf013629a00000000, 0x13917ce100000000, 0x8d12a67e00000000,\n    0x4f8f577900000000, 0xd10c8de600000000, 0x328e939d00000000,\n    0xac0d490200000000, 0xf48bae6b00000000, 0x6a0874f400000000,\n    0x898a6a8f00000000, 0x1709b01000000000, 0x3986a55c00000000,\n    0xa7057fc300000000, 0x448761b800000000, 0xda04bb2700000000,\n    0x82825c4e00000000, 0x1c0186d100000000, 0xff8398aa00000000,\n    0x6100423500000000, 0x7bb87ba500000000, 0xe53ba13a00000000,\n    0x06b9bf4100000000, 0x983a65de00000000, 0xc0bc82b700000000,\n    0x5e3f582800000000, 0xbdbd465300000000, 0x233e9ccc00000000,\n    0x0db1898000000000, 0x9332531f00000000, 0x70b04d6400000000,\n    0xee3397fb00000000, 0xb6b5709200000000, 0x2836aa0d00000000,\n    0xcbb4b47600000000, 0x55376ee900000000, 0x97aa9fee00000000,\n    0x0929457100000000, 0xeaab5b0a00000000, 0x7428819500000000,\n    0x2cae66fc00000000, 0xb22dbc6300000000, 0x51afa21800000000,\n    0xcf2c788700000000, 0xe1a36dcb00000000, 0x7f20b75400000000,\n    0x9ca2a92f00000000, 0x022173b000000000, 0x5aa794d900000000,\n    0xc4244e4600000000, 0x27a6503d00000000, 0xb9258aa200000000,\n    0x52d052c600000000, 0xcc53885900000000, 0x2fd1962200000000,\n    0xb1524cbd00000000, 0xe9d4abd400000000, 0x7757714b00000000,\n    0x94d56f3000000000, 0x0a56b5af00000000, 0x24d9a0e300000000,\n    0xba5a7a7c00000000, 0x59d8640700000000, 0xc75bbe9800000000,\n    0x9fdd59f100000000, 0x015e836e00000000, 0xe2dc9d1500000000,\n    0x7c5f478a00000000, 0xbec2b68d00000000, 0x20416c1200000000,\n    0xc3c3726900000000, 0x5d40a8f600000000, 0x05c64f9f00000000,\n    0x9b45950000000000, 0x78c78b7b00000000, 0xe64451e400000000,\n    0xc8cb44a800000000, 0x56489e3700000000, 0xb5ca804c00000000,\n    0x2b495ad300000000, 0x73cfbdba00000000, 0xed4c672500000000,\n    0x0ece795e00000000, 0x904da3c100000000, 0x8af59a5100000000,\n    0x147640ce00000000, 0xf7f45eb500000000, 0x6977842a00000000,\n    0x31f1634300000000, 0xaf72b9dc00000000, 0x4cf0a7a700000000,\n    0xd2737d3800000000, 0xfcfc687400000000, 0x627fb2eb00000000,\n    0x81fdac9000000000, 0x1f7e760f00000000, 0x47f8916600000000,\n    0xd97b4bf900000000, 0x3af9558200000000, 0xa47a8f1d00000000,\n    0x66e77e1a00000000, 0xf864a48500000000, 0x1be6bafe00000000,\n    0x8565606100000000, 0xdde3870800000000, 0x43605d9700000000,\n    0xa0e243ec00000000, 0x3e61997300000000, 0x10ee8c3f00000000,\n    0x8e6d56a000000000, 0x6def48db00000000, 0xf36c924400000000,\n    0xabea752d00000000, 0x3569afb200000000, 0xd6ebb1c900000000,\n    0x48686b5600000000},\n   {0x0000000000000000, 0xc064281700000000, 0x80c9502e00000000,\n    0x40ad783900000000, 0x0093a15c00000000, 0xc0f7894b00000000,\n    0x805af17200000000, 0x403ed96500000000, 0x002643b900000000,\n    0xc0426bae00000000, 0x80ef139700000000, 0x408b3b8000000000,\n    0x00b5e2e500000000, 0xc0d1caf200000000, 0x807cb2cb00000000,\n    0x40189adc00000000, 0x414af7a900000000, 0x812edfbe00000000,\n    0xc183a78700000000, 0x01e78f9000000000, 0x41d956f500000000,\n    0x81bd7ee200000000, 0xc11006db00000000, 0x01742ecc00000000,\n    0x416cb41000000000, 0x81089c0700000000, 0xc1a5e43e00000000,\n    0x01c1cc2900000000, 0x41ff154c00000000, 0x819b3d5b00000000,\n    0xc136456200000000, 0x01526d7500000000, 0xc3929f8800000000,\n    0x03f6b79f00000000, 0x435bcfa600000000, 0x833fe7b100000000,\n    0xc3013ed400000000, 0x036516c300000000, 0x43c86efa00000000,\n    0x83ac46ed00000000, 0xc3b4dc3100000000, 0x03d0f42600000000,\n    0x437d8c1f00000000, 0x8319a40800000000, 0xc3277d6d00000000,\n    0x0343557a00000000, 0x43ee2d4300000000, 0x838a055400000000,\n    0x82d8682100000000, 0x42bc403600000000, 0x0211380f00000000,\n    0xc275101800000000, 0x824bc97d00000000, 0x422fe16a00000000,\n    0x0282995300000000, 0xc2e6b14400000000, 0x82fe2b9800000000,\n    0x429a038f00000000, 0x02377bb600000000, 0xc25353a100000000,\n    0x826d8ac400000000, 0x4209a2d300000000, 0x02a4daea00000000,\n    0xc2c0f2fd00000000, 0xc7234eca00000000, 0x074766dd00000000,\n    0x47ea1ee400000000, 0x878e36f300000000, 0xc7b0ef9600000000,\n    0x07d4c78100000000, 0x4779bfb800000000, 0x871d97af00000000,\n    0xc7050d7300000000, 0x0761256400000000, 0x47cc5d5d00000000,\n    0x87a8754a00000000, 0xc796ac2f00000000, 0x07f2843800000000,\n    0x475ffc0100000000, 0x873bd41600000000, 0x8669b96300000000,\n    0x460d917400000000, 0x06a0e94d00000000, 0xc6c4c15a00000000,\n    0x86fa183f00000000, 0x469e302800000000, 0x0633481100000000,\n    0xc657600600000000, 0x864ffada00000000, 0x462bd2cd00000000,\n    0x0686aaf400000000, 0xc6e282e300000000, 0x86dc5b8600000000,\n    0x46b8739100000000, 0x06150ba800000000, 0xc67123bf00000000,\n    0x04b1d14200000000, 0xc4d5f95500000000, 0x8478816c00000000,\n    0x441ca97b00000000, 0x0422701e00000000, 0xc446580900000000,\n    0x84eb203000000000, 0x448f082700000000, 0x049792fb00000000,\n    0xc4f3baec00000000, 0x845ec2d500000000, 0x443aeac200000000,\n    0x040433a700000000, 0xc4601bb000000000, 0x84cd638900000000,\n    0x44a94b9e00000000, 0x45fb26eb00000000, 0x859f0efc00000000,\n    0xc53276c500000000, 0x05565ed200000000, 0x456887b700000000,\n    0x850cafa000000000, 0xc5a1d79900000000, 0x05c5ff8e00000000,\n    0x45dd655200000000, 0x85b94d4500000000, 0xc514357c00000000,\n    0x05701d6b00000000, 0x454ec40e00000000, 0x852aec1900000000,\n    0xc587942000000000, 0x05e3bc3700000000, 0xcf41ed4f00000000,\n    0x0f25c55800000000, 0x4f88bd6100000000, 0x8fec957600000000,\n    0xcfd24c1300000000, 0x0fb6640400000000, 0x4f1b1c3d00000000,\n    0x8f7f342a00000000, 0xcf67aef600000000, 0x0f0386e100000000,\n    0x4faefed800000000, 0x8fcad6cf00000000, 0xcff40faa00000000,\n    0x0f9027bd00000000, 0x4f3d5f8400000000, 0x8f59779300000000,\n    0x8e0b1ae600000000, 0x4e6f32f100000000, 0x0ec24ac800000000,\n    0xcea662df00000000, 0x8e98bbba00000000, 0x4efc93ad00000000,\n    0x0e51eb9400000000, 0xce35c38300000000, 0x8e2d595f00000000,\n    0x4e49714800000000, 0x0ee4097100000000, 0xce80216600000000,\n    0x8ebef80300000000, 0x4edad01400000000, 0x0e77a82d00000000,\n    0xce13803a00000000, 0x0cd372c700000000, 0xccb75ad000000000,\n    0x8c1a22e900000000, 0x4c7e0afe00000000, 0x0c40d39b00000000,\n    0xcc24fb8c00000000, 0x8c8983b500000000, 0x4cedaba200000000,\n    0x0cf5317e00000000, 0xcc91196900000000, 0x8c3c615000000000,\n    0x4c58494700000000, 0x0c66902200000000, 0xcc02b83500000000,\n    0x8cafc00c00000000, 0x4ccbe81b00000000, 0x4d99856e00000000,\n    0x8dfdad7900000000, 0xcd50d54000000000, 0x0d34fd5700000000,\n    0x4d0a243200000000, 0x8d6e0c2500000000, 0xcdc3741c00000000,\n    0x0da75c0b00000000, 0x4dbfc6d700000000, 0x8ddbeec000000000,\n    0xcd7696f900000000, 0x0d12beee00000000, 0x4d2c678b00000000,\n    0x8d484f9c00000000, 0xcde537a500000000, 0x0d811fb200000000,\n    0x0862a38500000000, 0xc8068b9200000000, 0x88abf3ab00000000,\n    0x48cfdbbc00000000, 0x08f102d900000000, 0xc8952ace00000000,\n    0x883852f700000000, 0x485c7ae000000000, 0x0844e03c00000000,\n    0xc820c82b00000000, 0x888db01200000000, 0x48e9980500000000,\n    0x08d7416000000000, 0xc8b3697700000000, 0x881e114e00000000,\n    0x487a395900000000, 0x4928542c00000000, 0x894c7c3b00000000,\n    0xc9e1040200000000, 0x09852c1500000000, 0x49bbf57000000000,\n    0x89dfdd6700000000, 0xc972a55e00000000, 0x09168d4900000000,\n    0x490e179500000000, 0x896a3f8200000000, 0xc9c747bb00000000,\n    0x09a36fac00000000, 0x499db6c900000000, 0x89f99ede00000000,\n    0xc954e6e700000000, 0x0930cef000000000, 0xcbf03c0d00000000,\n    0x0b94141a00000000, 0x4b396c2300000000, 0x8b5d443400000000,\n    0xcb639d5100000000, 0x0b07b54600000000, 0x4baacd7f00000000,\n    0x8bcee56800000000, 0xcbd67fb400000000, 0x0bb257a300000000,\n    0x4b1f2f9a00000000, 0x8b7b078d00000000, 0xcb45dee800000000,\n    0x0b21f6ff00000000, 0x4b8c8ec600000000, 0x8be8a6d100000000,\n    0x8abacba400000000, 0x4adee3b300000000, 0x0a739b8a00000000,\n    0xca17b39d00000000, 0x8a296af800000000, 0x4a4d42ef00000000,\n    0x0ae03ad600000000, 0xca8412c100000000, 0x8a9c881d00000000,\n    0x4af8a00a00000000, 0x0a55d83300000000, 0xca31f02400000000,\n    0x8a0f294100000000, 0x4a6b015600000000, 0x0ac6796f00000000,\n    0xcaa2517800000000},\n   {0x0000000000000000, 0xd4ea739b00000000, 0xe9d396ed00000000,\n    0x3d39e57600000000, 0x93a15c0000000000, 0x474b2f9b00000000,\n    0x7a72caed00000000, 0xae98b97600000000, 0x2643b90000000000,\n    0xf2a9ca9b00000000, 0xcf902fed00000000, 0x1b7a5c7600000000,\n    0xb5e2e50000000000, 0x6108969b00000000, 0x5c3173ed00000000,\n    0x88db007600000000, 0x4c86720100000000, 0x986c019a00000000,\n    0xa555e4ec00000000, 0x71bf977700000000, 0xdf272e0100000000,\n    0x0bcd5d9a00000000, 0x36f4b8ec00000000, 0xe21ecb7700000000,\n    0x6ac5cb0100000000, 0xbe2fb89a00000000, 0x83165dec00000000,\n    0x57fc2e7700000000, 0xf964970100000000, 0x2d8ee49a00000000,\n    0x10b701ec00000000, 0xc45d727700000000, 0x980ce50200000000,\n    0x4ce6969900000000, 0x71df73ef00000000, 0xa535007400000000,\n    0x0badb90200000000, 0xdf47ca9900000000, 0xe27e2fef00000000,\n    0x36945c7400000000, 0xbe4f5c0200000000, 0x6aa52f9900000000,\n    0x579ccaef00000000, 0x8376b97400000000, 0x2dee000200000000,\n    0xf904739900000000, 0xc43d96ef00000000, 0x10d7e57400000000,\n    0xd48a970300000000, 0x0060e49800000000, 0x3d5901ee00000000,\n    0xe9b3727500000000, 0x472bcb0300000000, 0x93c1b89800000000,\n    0xaef85dee00000000, 0x7a122e7500000000, 0xf2c92e0300000000,\n    0x26235d9800000000, 0x1b1ab8ee00000000, 0xcff0cb7500000000,\n    0x6168720300000000, 0xb582019800000000, 0x88bbe4ee00000000,\n    0x5c51977500000000, 0x3019ca0500000000, 0xe4f3b99e00000000,\n    0xd9ca5ce800000000, 0x0d202f7300000000, 0xa3b8960500000000,\n    0x7752e59e00000000, 0x4a6b00e800000000, 0x9e81737300000000,\n    0x165a730500000000, 0xc2b0009e00000000, 0xff89e5e800000000,\n    0x2b63967300000000, 0x85fb2f0500000000, 0x51115c9e00000000,\n    0x6c28b9e800000000, 0xb8c2ca7300000000, 0x7c9fb80400000000,\n    0xa875cb9f00000000, 0x954c2ee900000000, 0x41a65d7200000000,\n    0xef3ee40400000000, 0x3bd4979f00000000, 0x06ed72e900000000,\n    0xd207017200000000, 0x5adc010400000000, 0x8e36729f00000000,\n    0xb30f97e900000000, 0x67e5e47200000000, 0xc97d5d0400000000,\n    0x1d972e9f00000000, 0x20aecbe900000000, 0xf444b87200000000,\n    0xa8152f0700000000, 0x7cff5c9c00000000, 0x41c6b9ea00000000,\n    0x952cca7100000000, 0x3bb4730700000000, 0xef5e009c00000000,\n    0xd267e5ea00000000, 0x068d967100000000, 0x8e56960700000000,\n    0x5abce59c00000000, 0x678500ea00000000, 0xb36f737100000000,\n    0x1df7ca0700000000, 0xc91db99c00000000, 0xf4245cea00000000,\n    0x20ce2f7100000000, 0xe4935d0600000000, 0x30792e9d00000000,\n    0x0d40cbeb00000000, 0xd9aab87000000000, 0x7732010600000000,\n    0xa3d8729d00000000, 0x9ee197eb00000000, 0x4a0be47000000000,\n    0xc2d0e40600000000, 0x163a979d00000000, 0x2b0372eb00000000,\n    0xffe9017000000000, 0x5171b80600000000, 0x859bcb9d00000000,\n    0xb8a22eeb00000000, 0x6c485d7000000000, 0x6032940b00000000,\n    0xb4d8e79000000000, 0x89e102e600000000, 0x5d0b717d00000000,\n    0xf393c80b00000000, 0x2779bb9000000000, 0x1a405ee600000000,\n    0xceaa2d7d00000000, 0x46712d0b00000000, 0x929b5e9000000000,\n    0xafa2bbe600000000, 0x7b48c87d00000000, 0xd5d0710b00000000,\n    0x013a029000000000, 0x3c03e7e600000000, 0xe8e9947d00000000,\n    0x2cb4e60a00000000, 0xf85e959100000000, 0xc56770e700000000,\n    0x118d037c00000000, 0xbf15ba0a00000000, 0x6bffc99100000000,\n    0x56c62ce700000000, 0x822c5f7c00000000, 0x0af75f0a00000000,\n    0xde1d2c9100000000, 0xe324c9e700000000, 0x37ceba7c00000000,\n    0x9956030a00000000, 0x4dbc709100000000, 0x708595e700000000,\n    0xa46fe67c00000000, 0xf83e710900000000, 0x2cd4029200000000,\n    0x11ede7e400000000, 0xc507947f00000000, 0x6b9f2d0900000000,\n    0xbf755e9200000000, 0x824cbbe400000000, 0x56a6c87f00000000,\n    0xde7dc80900000000, 0x0a97bb9200000000, 0x37ae5ee400000000,\n    0xe3442d7f00000000, 0x4ddc940900000000, 0x9936e79200000000,\n    0xa40f02e400000000, 0x70e5717f00000000, 0xb4b8030800000000,\n    0x6052709300000000, 0x5d6b95e500000000, 0x8981e67e00000000,\n    0x27195f0800000000, 0xf3f32c9300000000, 0xcecac9e500000000,\n    0x1a20ba7e00000000, 0x92fbba0800000000, 0x4611c99300000000,\n    0x7b282ce500000000, 0xafc25f7e00000000, 0x015ae60800000000,\n    0xd5b0959300000000, 0xe88970e500000000, 0x3c63037e00000000,\n    0x502b5e0e00000000, 0x84c12d9500000000, 0xb9f8c8e300000000,\n    0x6d12bb7800000000, 0xc38a020e00000000, 0x1760719500000000,\n    0x2a5994e300000000, 0xfeb3e77800000000, 0x7668e70e00000000,\n    0xa282949500000000, 0x9fbb71e300000000, 0x4b51027800000000,\n    0xe5c9bb0e00000000, 0x3123c89500000000, 0x0c1a2de300000000,\n    0xd8f05e7800000000, 0x1cad2c0f00000000, 0xc8475f9400000000,\n    0xf57ebae200000000, 0x2194c97900000000, 0x8f0c700f00000000,\n    0x5be6039400000000, 0x66dfe6e200000000, 0xb235957900000000,\n    0x3aee950f00000000, 0xee04e69400000000, 0xd33d03e200000000,\n    0x07d7707900000000, 0xa94fc90f00000000, 0x7da5ba9400000000,\n    0x409c5fe200000000, 0x94762c7900000000, 0xc827bb0c00000000,\n    0x1ccdc89700000000, 0x21f42de100000000, 0xf51e5e7a00000000,\n    0x5b86e70c00000000, 0x8f6c949700000000, 0xb25571e100000000,\n    0x66bf027a00000000, 0xee64020c00000000, 0x3a8e719700000000,\n    0x07b794e100000000, 0xd35de77a00000000, 0x7dc55e0c00000000,\n    0xa92f2d9700000000, 0x9416c8e100000000, 0x40fcbb7a00000000,\n    0x84a1c90d00000000, 0x504bba9600000000, 0x6d725fe000000000,\n    0xb9982c7b00000000, 0x1700950d00000000, 0xc3eae69600000000,\n    0xfed303e000000000, 0x2a39707b00000000, 0xa2e2700d00000000,\n    0x7608039600000000, 0x4b31e6e000000000, 0x9fdb957b00000000,\n    0x31432c0d00000000, 0xe5a95f9600000000, 0xd890bae000000000,\n    0x0c7ac97b00000000},\n   {0x0000000000000000, 0x2765258100000000, 0x0fcc3bd900000000,\n    0x28a91e5800000000, 0x5f9e066900000000, 0x78fb23e800000000,\n    0x50523db000000000, 0x7737183100000000, 0xbe3c0dd200000000,\n    0x9959285300000000, 0xb1f0360b00000000, 0x9695138a00000000,\n    0xe1a20bbb00000000, 0xc6c72e3a00000000, 0xee6e306200000000,\n    0xc90b15e300000000, 0x3d7f6b7f00000000, 0x1a1a4efe00000000,\n    0x32b350a600000000, 0x15d6752700000000, 0x62e16d1600000000,\n    0x4584489700000000, 0x6d2d56cf00000000, 0x4a48734e00000000,\n    0x834366ad00000000, 0xa426432c00000000, 0x8c8f5d7400000000,\n    0xabea78f500000000, 0xdcdd60c400000000, 0xfbb8454500000000,\n    0xd3115b1d00000000, 0xf4747e9c00000000, 0x7afed6fe00000000,\n    0x5d9bf37f00000000, 0x7532ed2700000000, 0x5257c8a600000000,\n    0x2560d09700000000, 0x0205f51600000000, 0x2aaceb4e00000000,\n    0x0dc9cecf00000000, 0xc4c2db2c00000000, 0xe3a7fead00000000,\n    0xcb0ee0f500000000, 0xec6bc57400000000, 0x9b5cdd4500000000,\n    0xbc39f8c400000000, 0x9490e69c00000000, 0xb3f5c31d00000000,\n    0x4781bd8100000000, 0x60e4980000000000, 0x484d865800000000,\n    0x6f28a3d900000000, 0x181fbbe800000000, 0x3f7a9e6900000000,\n    0x17d3803100000000, 0x30b6a5b000000000, 0xf9bdb05300000000,\n    0xded895d200000000, 0xf6718b8a00000000, 0xd114ae0b00000000,\n    0xa623b63a00000000, 0x814693bb00000000, 0xa9ef8de300000000,\n    0x8e8aa86200000000, 0xb5fadc2600000000, 0x929ff9a700000000,\n    0xba36e7ff00000000, 0x9d53c27e00000000, 0xea64da4f00000000,\n    0xcd01ffce00000000, 0xe5a8e19600000000, 0xc2cdc41700000000,\n    0x0bc6d1f400000000, 0x2ca3f47500000000, 0x040aea2d00000000,\n    0x236fcfac00000000, 0x5458d79d00000000, 0x733df21c00000000,\n    0x5b94ec4400000000, 0x7cf1c9c500000000, 0x8885b75900000000,\n    0xafe092d800000000, 0x87498c8000000000, 0xa02ca90100000000,\n    0xd71bb13000000000, 0xf07e94b100000000, 0xd8d78ae900000000,\n    0xffb2af6800000000, 0x36b9ba8b00000000, 0x11dc9f0a00000000,\n    0x3975815200000000, 0x1e10a4d300000000, 0x6927bce200000000,\n    0x4e42996300000000, 0x66eb873b00000000, 0x418ea2ba00000000,\n    0xcf040ad800000000, 0xe8612f5900000000, 0xc0c8310100000000,\n    0xe7ad148000000000, 0x909a0cb100000000, 0xb7ff293000000000,\n    0x9f56376800000000, 0xb83312e900000000, 0x7138070a00000000,\n    0x565d228b00000000, 0x7ef43cd300000000, 0x5991195200000000,\n    0x2ea6016300000000, 0x09c324e200000000, 0x216a3aba00000000,\n    0x060f1f3b00000000, 0xf27b61a700000000, 0xd51e442600000000,\n    0xfdb75a7e00000000, 0xdad27fff00000000, 0xade567ce00000000,\n    0x8a80424f00000000, 0xa2295c1700000000, 0x854c799600000000,\n    0x4c476c7500000000, 0x6b2249f400000000, 0x438b57ac00000000,\n    0x64ee722d00000000, 0x13d96a1c00000000, 0x34bc4f9d00000000,\n    0x1c1551c500000000, 0x3b70744400000000, 0x6af5b94d00000000,\n    0x4d909ccc00000000, 0x6539829400000000, 0x425ca71500000000,\n    0x356bbf2400000000, 0x120e9aa500000000, 0x3aa784fd00000000,\n    0x1dc2a17c00000000, 0xd4c9b49f00000000, 0xf3ac911e00000000,\n    0xdb058f4600000000, 0xfc60aac700000000, 0x8b57b2f600000000,\n    0xac32977700000000, 0x849b892f00000000, 0xa3feacae00000000,\n    0x578ad23200000000, 0x70eff7b300000000, 0x5846e9eb00000000,\n    0x7f23cc6a00000000, 0x0814d45b00000000, 0x2f71f1da00000000,\n    0x07d8ef8200000000, 0x20bdca0300000000, 0xe9b6dfe000000000,\n    0xced3fa6100000000, 0xe67ae43900000000, 0xc11fc1b800000000,\n    0xb628d98900000000, 0x914dfc0800000000, 0xb9e4e25000000000,\n    0x9e81c7d100000000, 0x100b6fb300000000, 0x376e4a3200000000,\n    0x1fc7546a00000000, 0x38a271eb00000000, 0x4f9569da00000000,\n    0x68f04c5b00000000, 0x4059520300000000, 0x673c778200000000,\n    0xae37626100000000, 0x895247e000000000, 0xa1fb59b800000000,\n    0x869e7c3900000000, 0xf1a9640800000000, 0xd6cc418900000000,\n    0xfe655fd100000000, 0xd9007a5000000000, 0x2d7404cc00000000,\n    0x0a11214d00000000, 0x22b83f1500000000, 0x05dd1a9400000000,\n    0x72ea02a500000000, 0x558f272400000000, 0x7d26397c00000000,\n    0x5a431cfd00000000, 0x9348091e00000000, 0xb42d2c9f00000000,\n    0x9c8432c700000000, 0xbbe1174600000000, 0xccd60f7700000000,\n    0xebb32af600000000, 0xc31a34ae00000000, 0xe47f112f00000000,\n    0xdf0f656b00000000, 0xf86a40ea00000000, 0xd0c35eb200000000,\n    0xf7a67b3300000000, 0x8091630200000000, 0xa7f4468300000000,\n    0x8f5d58db00000000, 0xa8387d5a00000000, 0x613368b900000000,\n    0x46564d3800000000, 0x6eff536000000000, 0x499a76e100000000,\n    0x3ead6ed000000000, 0x19c84b5100000000, 0x3161550900000000,\n    0x1604708800000000, 0xe2700e1400000000, 0xc5152b9500000000,\n    0xedbc35cd00000000, 0xcad9104c00000000, 0xbdee087d00000000,\n    0x9a8b2dfc00000000, 0xb22233a400000000, 0x9547162500000000,\n    0x5c4c03c600000000, 0x7b29264700000000, 0x5380381f00000000,\n    0x74e51d9e00000000, 0x03d205af00000000, 0x24b7202e00000000,\n    0x0c1e3e7600000000, 0x2b7b1bf700000000, 0xa5f1b39500000000,\n    0x8294961400000000, 0xaa3d884c00000000, 0x8d58adcd00000000,\n    0xfa6fb5fc00000000, 0xdd0a907d00000000, 0xf5a38e2500000000,\n    0xd2c6aba400000000, 0x1bcdbe4700000000, 0x3ca89bc600000000,\n    0x1401859e00000000, 0x3364a01f00000000, 0x4453b82e00000000,\n    0x63369daf00000000, 0x4b9f83f700000000, 0x6cfaa67600000000,\n    0x988ed8ea00000000, 0xbfebfd6b00000000, 0x9742e33300000000,\n    0xb027c6b200000000, 0xc710de8300000000, 0xe075fb0200000000,\n    0xc8dce55a00000000, 0xefb9c0db00000000, 0x26b2d53800000000,\n    0x01d7f0b900000000, 0x297eeee100000000, 0x0e1bcb6000000000,\n    0x792cd35100000000, 0x5e49f6d000000000, 0x76e0e88800000000,\n    0x5185cd0900000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f,\n    0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91,\n    0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e,\n    0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c,\n    0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02,\n    0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12,\n    0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567,\n    0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277,\n    0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679,\n    0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b,\n    0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4,\n    0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a,\n    0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0,\n    0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0,\n    0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91,\n    0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881,\n    0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173,\n    0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d,\n    0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912,\n    0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8,\n    0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6,\n    0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6,\n    0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b,\n    0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b,\n    0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75,\n    0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f,\n    0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00,\n    0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee,\n    0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c,\n    0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c,\n    0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d,\n    0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d,\n    0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67,\n    0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89,\n    0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706,\n    0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14,\n    0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a,\n    0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a,\n    0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f,\n    0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f,\n    0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591,\n    0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983,\n    0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c,\n    0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2,\n    0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8,\n    0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8,\n    0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89,\n    0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99,\n    0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b,\n    0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485,\n    0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a,\n    0x36197165},\n   {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382,\n    0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85,\n    0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06,\n    0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca,\n    0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e,\n    0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc,\n    0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616,\n    0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54,\n    0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10,\n    0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc,\n    0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f,\n    0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58,\n    0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef,\n    0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad,\n    0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b,\n    0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29,\n    0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6,\n    0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1,\n    0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622,\n    0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039,\n    0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d,\n    0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f,\n    0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32,\n    0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770,\n    0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034,\n    0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f,\n    0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc,\n    0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db,\n    0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154,\n    0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16,\n    0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0,\n    0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592,\n    0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca,\n    0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd,\n    0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e,\n    0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882,\n    0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6,\n    0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384,\n    0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1,\n    0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3,\n    0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7,\n    0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b,\n    0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8,\n    0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff,\n    0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7,\n    0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5,\n    0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23,\n    0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761,\n    0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee,\n    0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9,\n    0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a,\n    0x1a3b93aa},\n   {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a,\n    0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca,\n    0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3,\n    0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb,\n    0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c,\n    0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58,\n    0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed,\n    0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9,\n    0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e,\n    0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906,\n    0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f,\n    0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf,\n    0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0,\n    0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4,\n    0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769,\n    0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d,\n    0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632,\n    0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82,\n    0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb,\n    0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73,\n    0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484,\n    0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0,\n    0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5,\n    0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1,\n    0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516,\n    0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f,\n    0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946,\n    0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6,\n    0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9,\n    0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad,\n    0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820,\n    0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364,\n    0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab,\n    0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b,\n    0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62,\n    0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a,\n    0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd,\n    0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089,\n    0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c,\n    0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8,\n    0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f,\n    0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477,\n    0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e,\n    0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be,\n    0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71,\n    0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635,\n    0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8,\n    0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc,\n    0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3,\n    0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753,\n    0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a,\n    0xe147d714},\n   {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c,\n    0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b,\n    0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92,\n    0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4,\n    0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069,\n    0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526,\n    0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25,\n    0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a,\n    0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7,\n    0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491,\n    0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958,\n    0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f,\n    0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307,\n    0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648,\n    0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999,\n    0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6,\n    0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a,\n    0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d,\n    0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4,\n    0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61,\n    0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc,\n    0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3,\n    0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53,\n    0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c,\n    0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1,\n    0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c,\n    0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5,\n    0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92,\n    0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e,\n    0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771,\n    0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0,\n    0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def,\n    0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0,\n    0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7,\n    0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e,\n    0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58,\n    0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285,\n    0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca,\n    0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce,\n    0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81,\n    0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c,\n    0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a,\n    0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3,\n    0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4,\n    0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb,\n    0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4,\n    0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75,\n    0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a,\n    0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296,\n    0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1,\n    0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808,\n    0x494f0c4b}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0x43147b17, 0x8628f62e, 0xc53c8d39, 0x0c51ec5d,\n    0x4f45974a, 0x8a791a73, 0xc96d6164, 0x18a2d8bb, 0x5bb6a3ac,\n    0x9e8a2e95, 0xdd9e5582, 0x14f334e6, 0x57e74ff1, 0x92dbc2c8,\n    0xd1cfb9df, 0x7142c0ac, 0x3256bbbb, 0xf76a3682, 0xb47e4d95,\n    0x7d132cf1, 0x3e0757e6, 0xfb3bdadf, 0xb82fa1c8, 0x69e01817,\n    0x2af46300, 0xefc8ee39, 0xacdc952e, 0x65b1f44a, 0x26a58f5d,\n    0xe3990264, 0xa08d7973, 0xa382f182, 0xe0968a95, 0x25aa07ac,\n    0x66be7cbb, 0xafd31ddf, 0xecc766c8, 0x29fbebf1, 0x6aef90e6,\n    0xbb202939, 0xf834522e, 0x3d08df17, 0x7e1ca400, 0xb771c564,\n    0xf465be73, 0x3159334a, 0x724d485d, 0xd2c0312e, 0x91d44a39,\n    0x54e8c700, 0x17fcbc17, 0xde91dd73, 0x9d85a664, 0x58b92b5d,\n    0x1bad504a, 0xca62e995, 0x89769282, 0x4c4a1fbb, 0x0f5e64ac,\n    0xc63305c8, 0x85277edf, 0x401bf3e6, 0x030f88f1, 0x070392de,\n    0x4417e9c9, 0x812b64f0, 0xc23f1fe7, 0x0b527e83, 0x48460594,\n    0x8d7a88ad, 0xce6ef3ba, 0x1fa14a65, 0x5cb53172, 0x9989bc4b,\n    0xda9dc75c, 0x13f0a638, 0x50e4dd2f, 0x95d85016, 0xd6cc2b01,\n    0x76415272, 0x35552965, 0xf069a45c, 0xb37ddf4b, 0x7a10be2f,\n    0x3904c538, 0xfc384801, 0xbf2c3316, 0x6ee38ac9, 0x2df7f1de,\n    0xe8cb7ce7, 0xabdf07f0, 0x62b26694, 0x21a61d83, 0xe49a90ba,\n    0xa78eebad, 0xa481635c, 0xe795184b, 0x22a99572, 0x61bdee65,\n    0xa8d08f01, 0xebc4f416, 0x2ef8792f, 0x6dec0238, 0xbc23bbe7,\n    0xff37c0f0, 0x3a0b4dc9, 0x791f36de, 0xb07257ba, 0xf3662cad,\n    0x365aa194, 0x754eda83, 0xd5c3a3f0, 0x96d7d8e7, 0x53eb55de,\n    0x10ff2ec9, 0xd9924fad, 0x9a8634ba, 0x5fbab983, 0x1caec294,\n    0xcd617b4b, 0x8e75005c, 0x4b498d65, 0x085df672, 0xc1309716,\n    0x8224ec01, 0x47186138, 0x040c1a2f, 0x4f005566, 0x0c142e71,\n    0xc928a348, 0x8a3cd85f, 0x4351b93b, 0x0045c22c, 0xc5794f15,\n    0x866d3402, 0x57a28ddd, 0x14b6f6ca, 0xd18a7bf3, 0x929e00e4,\n    0x5bf36180, 0x18e71a97, 0xdddb97ae, 0x9ecfecb9, 0x3e4295ca,\n    0x7d56eedd, 0xb86a63e4, 0xfb7e18f3, 0x32137997, 0x71070280,\n    0xb43b8fb9, 0xf72ff4ae, 0x26e04d71, 0x65f43666, 0xa0c8bb5f,\n    0xe3dcc048, 0x2ab1a12c, 0x69a5da3b, 0xac995702, 0xef8d2c15,\n    0xec82a4e4, 0xaf96dff3, 0x6aaa52ca, 0x29be29dd, 0xe0d348b9,\n    0xa3c733ae, 0x66fbbe97, 0x25efc580, 0xf4207c5f, 0xb7340748,\n    0x72088a71, 0x311cf166, 0xf8719002, 0xbb65eb15, 0x7e59662c,\n    0x3d4d1d3b, 0x9dc06448, 0xded41f5f, 0x1be89266, 0x58fce971,\n    0x91918815, 0xd285f302, 0x17b97e3b, 0x54ad052c, 0x8562bcf3,\n    0xc676c7e4, 0x034a4add, 0x405e31ca, 0x893350ae, 0xca272bb9,\n    0x0f1ba680, 0x4c0fdd97, 0x4803c7b8, 0x0b17bcaf, 0xce2b3196,\n    0x8d3f4a81, 0x44522be5, 0x074650f2, 0xc27addcb, 0x816ea6dc,\n    0x50a11f03, 0x13b56414, 0xd689e92d, 0x959d923a, 0x5cf0f35e,\n    0x1fe48849, 0xdad80570, 0x99cc7e67, 0x39410714, 0x7a557c03,\n    0xbf69f13a, 0xfc7d8a2d, 0x3510eb49, 0x7604905e, 0xb3381d67,\n    0xf02c6670, 0x21e3dfaf, 0x62f7a4b8, 0xa7cb2981, 0xe4df5296,\n    0x2db233f2, 0x6ea648e5, 0xab9ac5dc, 0xe88ebecb, 0xeb81363a,\n    0xa8954d2d, 0x6da9c014, 0x2ebdbb03, 0xe7d0da67, 0xa4c4a170,\n    0x61f82c49, 0x22ec575e, 0xf323ee81, 0xb0379596, 0x750b18af,\n    0x361f63b8, 0xff7202dc, 0xbc6679cb, 0x795af4f2, 0x3a4e8fe5,\n    0x9ac3f696, 0xd9d78d81, 0x1ceb00b8, 0x5fff7baf, 0x96921acb,\n    0xd58661dc, 0x10baece5, 0x53ae97f2, 0x82612e2d, 0xc175553a,\n    0x0449d803, 0x475da314, 0x8e30c270, 0xcd24b967, 0x0818345e,\n    0x4b0c4f49},\n   {0x00000000, 0x3e6bc2ef, 0x3dd0f504, 0x03bb37eb, 0x7aa0eb09,\n    0x44cb29e6, 0x47701e0d, 0x791bdce2, 0xf440d713, 0xca2b15fc,\n    0xc9902217, 0xf7fbe0f8, 0x8ee03c1a, 0xb08bfef5, 0xb330c91e,\n    0x8d5b0bf1, 0xe881ae27, 0xd6ea6cc8, 0xd5515b23, 0xeb3a99cc,\n    0x9221452e, 0xac4a87c1, 0xaff1b02a, 0x919a72c5, 0x1cc17934,\n    0x22aabbdb, 0x21118c30, 0x1f7a4edf, 0x6661923d, 0x580a50d2,\n    0x5bb16739, 0x65daa5d6, 0xd0035d4f, 0xee689fa0, 0xedd3a84b,\n    0xd3b86aa4, 0xaaa3b646, 0x94c874a9, 0x97734342, 0xa91881ad,\n    0x24438a5c, 0x1a2848b3, 0x19937f58, 0x27f8bdb7, 0x5ee36155,\n    0x6088a3ba, 0x63339451, 0x5d5856be, 0x3882f368, 0x06e93187,\n    0x0552066c, 0x3b39c483, 0x42221861, 0x7c49da8e, 0x7ff2ed65,\n    0x41992f8a, 0xccc2247b, 0xf2a9e694, 0xf112d17f, 0xcf791390,\n    0xb662cf72, 0x88090d9d, 0x8bb23a76, 0xb5d9f899, 0xa007ba9e,\n    0x9e6c7871, 0x9dd74f9a, 0xa3bc8d75, 0xdaa75197, 0xe4cc9378,\n    0xe777a493, 0xd91c667c, 0x54476d8d, 0x6a2caf62, 0x69979889,\n    0x57fc5a66, 0x2ee78684, 0x108c446b, 0x13377380, 0x2d5cb16f,\n    0x488614b9, 0x76edd656, 0x7556e1bd, 0x4b3d2352, 0x3226ffb0,\n    0x0c4d3d5f, 0x0ff60ab4, 0x319dc85b, 0xbcc6c3aa, 0x82ad0145,\n    0x811636ae, 0xbf7df441, 0xc66628a3, 0xf80dea4c, 0xfbb6dda7,\n    0xc5dd1f48, 0x7004e7d1, 0x4e6f253e, 0x4dd412d5, 0x73bfd03a,\n    0x0aa40cd8, 0x34cfce37, 0x3774f9dc, 0x091f3b33, 0x844430c2,\n    0xba2ff22d, 0xb994c5c6, 0x87ff0729, 0xfee4dbcb, 0xc08f1924,\n    0xc3342ecf, 0xfd5fec20, 0x988549f6, 0xa6ee8b19, 0xa555bcf2,\n    0x9b3e7e1d, 0xe225a2ff, 0xdc4e6010, 0xdff557fb, 0xe19e9514,\n    0x6cc59ee5, 0x52ae5c0a, 0x51156be1, 0x6f7ea90e, 0x166575ec,\n    0x280eb703, 0x2bb580e8, 0x15de4207, 0x010905e6, 0x3f62c709,\n    0x3cd9f0e2, 0x02b2320d, 0x7ba9eeef, 0x45c22c00, 0x46791beb,\n    0x7812d904, 0xf549d2f5, 0xcb22101a, 0xc89927f1, 0xf6f2e51e,\n    0x8fe939fc, 0xb182fb13, 0xb239ccf8, 0x8c520e17, 0xe988abc1,\n    0xd7e3692e, 0xd4585ec5, 0xea339c2a, 0x932840c8, 0xad438227,\n    0xaef8b5cc, 0x90937723, 0x1dc87cd2, 0x23a3be3d, 0x201889d6,\n    0x1e734b39, 0x676897db, 0x59035534, 0x5ab862df, 0x64d3a030,\n    0xd10a58a9, 0xef619a46, 0xecdaadad, 0xd2b16f42, 0xabaab3a0,\n    0x95c1714f, 0x967a46a4, 0xa811844b, 0x254a8fba, 0x1b214d55,\n    0x189a7abe, 0x26f1b851, 0x5fea64b3, 0x6181a65c, 0x623a91b7,\n    0x5c515358, 0x398bf68e, 0x07e03461, 0x045b038a, 0x3a30c165,\n    0x432b1d87, 0x7d40df68, 0x7efbe883, 0x40902a6c, 0xcdcb219d,\n    0xf3a0e372, 0xf01bd499, 0xce701676, 0xb76bca94, 0x8900087b,\n    0x8abb3f90, 0xb4d0fd7f, 0xa10ebf78, 0x9f657d97, 0x9cde4a7c,\n    0xa2b58893, 0xdbae5471, 0xe5c5969e, 0xe67ea175, 0xd815639a,\n    0x554e686b, 0x6b25aa84, 0x689e9d6f, 0x56f55f80, 0x2fee8362,\n    0x1185418d, 0x123e7666, 0x2c55b489, 0x498f115f, 0x77e4d3b0,\n    0x745fe45b, 0x4a3426b4, 0x332ffa56, 0x0d4438b9, 0x0eff0f52,\n    0x3094cdbd, 0xbdcfc64c, 0x83a404a3, 0x801f3348, 0xbe74f1a7,\n    0xc76f2d45, 0xf904efaa, 0xfabfd841, 0xc4d41aae, 0x710de237,\n    0x4f6620d8, 0x4cdd1733, 0x72b6d5dc, 0x0bad093e, 0x35c6cbd1,\n    0x367dfc3a, 0x08163ed5, 0x854d3524, 0xbb26f7cb, 0xb89dc020,\n    0x86f602cf, 0xffedde2d, 0xc1861cc2, 0xc23d2b29, 0xfc56e9c6,\n    0x998c4c10, 0xa7e78eff, 0xa45cb914, 0x9a377bfb, 0xe32ca719,\n    0xdd4765f6, 0xdefc521d, 0xe09790f2, 0x6dcc9b03, 0x53a759ec,\n    0x501c6e07, 0x6e77ace8, 0x176c700a, 0x2907b2e5, 0x2abc850e,\n    0x14d747e1},\n   {0x00000000, 0xc0df8ec1, 0xc1b96c58, 0x0166e299, 0x8273d9b0,\n    0x42ac5771, 0x43cab5e8, 0x83153b29, 0x45e1c3ba, 0x853e4d7b,\n    0x8458afe2, 0x44872123, 0xc7921a0a, 0x074d94cb, 0x062b7652,\n    0xc6f4f893, 0xcbc4f6ae, 0x0b1b786f, 0x0a7d9af6, 0xcaa21437,\n    0x49b72f1e, 0x8968a1df, 0x880e4346, 0x48d1cd87, 0x8e253514,\n    0x4efabbd5, 0x4f9c594c, 0x8f43d78d, 0x0c56eca4, 0xcc896265,\n    0xcdef80fc, 0x0d300e3d, 0xd78f9c86, 0x17501247, 0x1636f0de,\n    0xd6e97e1f, 0x55fc4536, 0x9523cbf7, 0x9445296e, 0x549aa7af,\n    0x926e5f3c, 0x52b1d1fd, 0x53d73364, 0x9308bda5, 0x101d868c,\n    0xd0c2084d, 0xd1a4ead4, 0x117b6415, 0x1c4b6a28, 0xdc94e4e9,\n    0xddf20670, 0x1d2d88b1, 0x9e38b398, 0x5ee73d59, 0x5f81dfc0,\n    0x9f5e5101, 0x59aaa992, 0x99752753, 0x9813c5ca, 0x58cc4b0b,\n    0xdbd97022, 0x1b06fee3, 0x1a601c7a, 0xdabf92bb, 0xef1948d6,\n    0x2fc6c617, 0x2ea0248e, 0xee7faa4f, 0x6d6a9166, 0xadb51fa7,\n    0xacd3fd3e, 0x6c0c73ff, 0xaaf88b6c, 0x6a2705ad, 0x6b41e734,\n    0xab9e69f5, 0x288b52dc, 0xe854dc1d, 0xe9323e84, 0x29edb045,\n    0x24ddbe78, 0xe40230b9, 0xe564d220, 0x25bb5ce1, 0xa6ae67c8,\n    0x6671e909, 0x67170b90, 0xa7c88551, 0x613c7dc2, 0xa1e3f303,\n    0xa085119a, 0x605a9f5b, 0xe34fa472, 0x23902ab3, 0x22f6c82a,\n    0xe22946eb, 0x3896d450, 0xf8495a91, 0xf92fb808, 0x39f036c9,\n    0xbae50de0, 0x7a3a8321, 0x7b5c61b8, 0xbb83ef79, 0x7d7717ea,\n    0xbda8992b, 0xbcce7bb2, 0x7c11f573, 0xff04ce5a, 0x3fdb409b,\n    0x3ebda202, 0xfe622cc3, 0xf35222fe, 0x338dac3f, 0x32eb4ea6,\n    0xf234c067, 0x7121fb4e, 0xb1fe758f, 0xb0989716, 0x704719d7,\n    0xb6b3e144, 0x766c6f85, 0x770a8d1c, 0xb7d503dd, 0x34c038f4,\n    0xf41fb635, 0xf57954ac, 0x35a6da6d, 0x9f35e177, 0x5fea6fb6,\n    0x5e8c8d2f, 0x9e5303ee, 0x1d4638c7, 0xdd99b606, 0xdcff549f,\n    0x1c20da5e, 0xdad422cd, 0x1a0bac0c, 0x1b6d4e95, 0xdbb2c054,\n    0x58a7fb7d, 0x987875bc, 0x991e9725, 0x59c119e4, 0x54f117d9,\n    0x942e9918, 0x95487b81, 0x5597f540, 0xd682ce69, 0x165d40a8,\n    0x173ba231, 0xd7e42cf0, 0x1110d463, 0xd1cf5aa2, 0xd0a9b83b,\n    0x107636fa, 0x93630dd3, 0x53bc8312, 0x52da618b, 0x9205ef4a,\n    0x48ba7df1, 0x8865f330, 0x890311a9, 0x49dc9f68, 0xcac9a441,\n    0x0a162a80, 0x0b70c819, 0xcbaf46d8, 0x0d5bbe4b, 0xcd84308a,\n    0xcce2d213, 0x0c3d5cd2, 0x8f2867fb, 0x4ff7e93a, 0x4e910ba3,\n    0x8e4e8562, 0x837e8b5f, 0x43a1059e, 0x42c7e707, 0x821869c6,\n    0x010d52ef, 0xc1d2dc2e, 0xc0b43eb7, 0x006bb076, 0xc69f48e5,\n    0x0640c624, 0x072624bd, 0xc7f9aa7c, 0x44ec9155, 0x84331f94,\n    0x8555fd0d, 0x458a73cc, 0x702ca9a1, 0xb0f32760, 0xb195c5f9,\n    0x714a4b38, 0xf25f7011, 0x3280fed0, 0x33e61c49, 0xf3399288,\n    0x35cd6a1b, 0xf512e4da, 0xf4740643, 0x34ab8882, 0xb7beb3ab,\n    0x77613d6a, 0x7607dff3, 0xb6d85132, 0xbbe85f0f, 0x7b37d1ce,\n    0x7a513357, 0xba8ebd96, 0x399b86bf, 0xf944087e, 0xf822eae7,\n    0x38fd6426, 0xfe099cb5, 0x3ed61274, 0x3fb0f0ed, 0xff6f7e2c,\n    0x7c7a4505, 0xbca5cbc4, 0xbdc3295d, 0x7d1ca79c, 0xa7a33527,\n    0x677cbbe6, 0x661a597f, 0xa6c5d7be, 0x25d0ec97, 0xe50f6256,\n    0xe46980cf, 0x24b60e0e, 0xe242f69d, 0x229d785c, 0x23fb9ac5,\n    0xe3241404, 0x60312f2d, 0xa0eea1ec, 0xa1884375, 0x6157cdb4,\n    0x6c67c389, 0xacb84d48, 0xaddeafd1, 0x6d012110, 0xee141a39,\n    0x2ecb94f8, 0x2fad7661, 0xef72f8a0, 0x29860033, 0xe9598ef2,\n    0xe83f6c6b, 0x28e0e2aa, 0xabf5d983, 0x6b2a5742, 0x6a4cb5db,\n    0xaa933b1a},\n   {0x00000000, 0x6f4ca59b, 0x9f9e3bec, 0xf0d29e77, 0x7f3b0603,\n    0x1077a398, 0xe0a53def, 0x8fe99874, 0xfe760c06, 0x913aa99d,\n    0x61e837ea, 0x0ea49271, 0x814d0a05, 0xee01af9e, 0x1ed331e9,\n    0x719f9472, 0xfced180c, 0x93a1bd97, 0x637323e0, 0x0c3f867b,\n    0x83d61e0f, 0xec9abb94, 0x1c4825e3, 0x73048078, 0x029b140a,\n    0x6dd7b191, 0x9d052fe6, 0xf2498a7d, 0x7da01209, 0x12ecb792,\n    0xe23e29e5, 0x8d728c7e, 0xf8db3118, 0x97979483, 0x67450af4,\n    0x0809af6f, 0x87e0371b, 0xe8ac9280, 0x187e0cf7, 0x7732a96c,\n    0x06ad3d1e, 0x69e19885, 0x993306f2, 0xf67fa369, 0x79963b1d,\n    0x16da9e86, 0xe60800f1, 0x8944a56a, 0x04362914, 0x6b7a8c8f,\n    0x9ba812f8, 0xf4e4b763, 0x7b0d2f17, 0x14418a8c, 0xe49314fb,\n    0x8bdfb160, 0xfa402512, 0x950c8089, 0x65de1efe, 0x0a92bb65,\n    0x857b2311, 0xea37868a, 0x1ae518fd, 0x75a9bd66, 0xf0b76330,\n    0x9ffbc6ab, 0x6f2958dc, 0x0065fd47, 0x8f8c6533, 0xe0c0c0a8,\n    0x10125edf, 0x7f5efb44, 0x0ec16f36, 0x618dcaad, 0x915f54da,\n    0xfe13f141, 0x71fa6935, 0x1eb6ccae, 0xee6452d9, 0x8128f742,\n    0x0c5a7b3c, 0x6316dea7, 0x93c440d0, 0xfc88e54b, 0x73617d3f,\n    0x1c2dd8a4, 0xecff46d3, 0x83b3e348, 0xf22c773a, 0x9d60d2a1,\n    0x6db24cd6, 0x02fee94d, 0x8d177139, 0xe25bd4a2, 0x12894ad5,\n    0x7dc5ef4e, 0x086c5228, 0x6720f7b3, 0x97f269c4, 0xf8becc5f,\n    0x7757542b, 0x181bf1b0, 0xe8c96fc7, 0x8785ca5c, 0xf61a5e2e,\n    0x9956fbb5, 0x698465c2, 0x06c8c059, 0x8921582d, 0xe66dfdb6,\n    0x16bf63c1, 0x79f3c65a, 0xf4814a24, 0x9bcdefbf, 0x6b1f71c8,\n    0x0453d453, 0x8bba4c27, 0xe4f6e9bc, 0x142477cb, 0x7b68d250,\n    0x0af74622, 0x65bbe3b9, 0x95697dce, 0xfa25d855, 0x75cc4021,\n    0x1a80e5ba, 0xea527bcd, 0x851ede56, 0xe06fc760, 0x8f2362fb,\n    0x7ff1fc8c, 0x10bd5917, 0x9f54c163, 0xf01864f8, 0x00cafa8f,\n    0x6f865f14, 0x1e19cb66, 0x71556efd, 0x8187f08a, 0xeecb5511,\n    0x6122cd65, 0x0e6e68fe, 0xfebcf689, 0x91f05312, 0x1c82df6c,\n    0x73ce7af7, 0x831ce480, 0xec50411b, 0x63b9d96f, 0x0cf57cf4,\n    0xfc27e283, 0x936b4718, 0xe2f4d36a, 0x8db876f1, 0x7d6ae886,\n    0x12264d1d, 0x9dcfd569, 0xf28370f2, 0x0251ee85, 0x6d1d4b1e,\n    0x18b4f678, 0x77f853e3, 0x872acd94, 0xe866680f, 0x678ff07b,\n    0x08c355e0, 0xf811cb97, 0x975d6e0c, 0xe6c2fa7e, 0x898e5fe5,\n    0x795cc192, 0x16106409, 0x99f9fc7d, 0xf6b559e6, 0x0667c791,\n    0x692b620a, 0xe459ee74, 0x8b154bef, 0x7bc7d598, 0x148b7003,\n    0x9b62e877, 0xf42e4dec, 0x04fcd39b, 0x6bb07600, 0x1a2fe272,\n    0x756347e9, 0x85b1d99e, 0xeafd7c05, 0x6514e471, 0x0a5841ea,\n    0xfa8adf9d, 0x95c67a06, 0x10d8a450, 0x7f9401cb, 0x8f469fbc,\n    0xe00a3a27, 0x6fe3a253, 0x00af07c8, 0xf07d99bf, 0x9f313c24,\n    0xeeaea856, 0x81e20dcd, 0x713093ba, 0x1e7c3621, 0x9195ae55,\n    0xfed90bce, 0x0e0b95b9, 0x61473022, 0xec35bc5c, 0x837919c7,\n    0x73ab87b0, 0x1ce7222b, 0x930eba5f, 0xfc421fc4, 0x0c9081b3,\n    0x63dc2428, 0x1243b05a, 0x7d0f15c1, 0x8ddd8bb6, 0xe2912e2d,\n    0x6d78b659, 0x023413c2, 0xf2e68db5, 0x9daa282e, 0xe8039548,\n    0x874f30d3, 0x779daea4, 0x18d10b3f, 0x9738934b, 0xf87436d0,\n    0x08a6a8a7, 0x67ea0d3c, 0x1675994e, 0x79393cd5, 0x89eba2a2,\n    0xe6a70739, 0x694e9f4d, 0x06023ad6, 0xf6d0a4a1, 0x999c013a,\n    0x14ee8d44, 0x7ba228df, 0x8b70b6a8, 0xe43c1333, 0x6bd58b47,\n    0x04992edc, 0xf44bb0ab, 0x9b071530, 0xea988142, 0x85d424d9,\n    0x7506baae, 0x1a4a1f35, 0x95a38741, 0xfaef22da, 0x0a3dbcad,\n    0x65711936}};\n\n#endif\n\n#endif\n\n#if N == 4\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xf1da05aa, 0x38c50d15, 0xc91f08bf, 0x718a1a2a,\n    0x80501f80, 0x494f173f, 0xb8951295, 0xe3143454, 0x12ce31fe,\n    0xdbd13941, 0x2a0b3ceb, 0x929e2e7e, 0x63442bd4, 0xaa5b236b,\n    0x5b8126c1, 0x1d596ee9, 0xec836b43, 0x259c63fc, 0xd4466656,\n    0x6cd374c3, 0x9d097169, 0x541679d6, 0xa5cc7c7c, 0xfe4d5abd,\n    0x0f975f17, 0xc68857a8, 0x37525202, 0x8fc74097, 0x7e1d453d,\n    0xb7024d82, 0x46d84828, 0x3ab2ddd2, 0xcb68d878, 0x0277d0c7,\n    0xf3add56d, 0x4b38c7f8, 0xbae2c252, 0x73fdcaed, 0x8227cf47,\n    0xd9a6e986, 0x287cec2c, 0xe163e493, 0x10b9e139, 0xa82cf3ac,\n    0x59f6f606, 0x90e9feb9, 0x6133fb13, 0x27ebb33b, 0xd631b691,\n    0x1f2ebe2e, 0xeef4bb84, 0x5661a911, 0xa7bbacbb, 0x6ea4a404,\n    0x9f7ea1ae, 0xc4ff876f, 0x352582c5, 0xfc3a8a7a, 0x0de08fd0,\n    0xb5759d45, 0x44af98ef, 0x8db09050, 0x7c6a95fa, 0x7565bba4,\n    0x84bfbe0e, 0x4da0b6b1, 0xbc7ab31b, 0x04efa18e, 0xf535a424,\n    0x3c2aac9b, 0xcdf0a931, 0x96718ff0, 0x67ab8a5a, 0xaeb482e5,\n    0x5f6e874f, 0xe7fb95da, 0x16219070, 0xdf3e98cf, 0x2ee49d65,\n    0x683cd54d, 0x99e6d0e7, 0x50f9d858, 0xa123ddf2, 0x19b6cf67,\n    0xe86ccacd, 0x2173c272, 0xd0a9c7d8, 0x8b28e119, 0x7af2e4b3,\n    0xb3edec0c, 0x4237e9a6, 0xfaa2fb33, 0x0b78fe99, 0xc267f626,\n    0x33bdf38c, 0x4fd76676, 0xbe0d63dc, 0x77126b63, 0x86c86ec9,\n    0x3e5d7c5c, 0xcf8779f6, 0x06987149, 0xf74274e3, 0xacc35222,\n    0x5d195788, 0x94065f37, 0x65dc5a9d, 0xdd494808, 0x2c934da2,\n    0xe58c451d, 0x145640b7, 0x528e089f, 0xa3540d35, 0x6a4b058a,\n    0x9b910020, 0x230412b5, 0xd2de171f, 0x1bc11fa0, 0xea1b1a0a,\n    0xb19a3ccb, 0x40403961, 0x895f31de, 0x78853474, 0xc01026e1,\n    0x31ca234b, 0xf8d52bf4, 0x090f2e5e, 0xeacb7748, 0x1b1172e2,\n    0xd20e7a5d, 0x23d47ff7, 0x9b416d62, 0x6a9b68c8, 0xa3846077,\n    0x525e65dd, 0x09df431c, 0xf80546b6, 0x311a4e09, 0xc0c04ba3,\n    0x78555936, 0x898f5c9c, 0x40905423, 0xb14a5189, 0xf79219a1,\n    0x06481c0b, 0xcf5714b4, 0x3e8d111e, 0x8618038b, 0x77c20621,\n    0xbedd0e9e, 0x4f070b34, 0x14862df5, 0xe55c285f, 0x2c4320e0,\n    0xdd99254a, 0x650c37df, 0x94d63275, 0x5dc93aca, 0xac133f60,\n    0xd079aa9a, 0x21a3af30, 0xe8bca78f, 0x1966a225, 0xa1f3b0b0,\n    0x5029b51a, 0x9936bda5, 0x68ecb80f, 0x336d9ece, 0xc2b79b64,\n    0x0ba893db, 0xfa729671, 0x42e784e4, 0xb33d814e, 0x7a2289f1,\n    0x8bf88c5b, 0xcd20c473, 0x3cfac1d9, 0xf5e5c966, 0x043fcccc,\n    0xbcaade59, 0x4d70dbf3, 0x846fd34c, 0x75b5d6e6, 0x2e34f027,\n    0xdfeef58d, 0x16f1fd32, 0xe72bf898, 0x5fbeea0d, 0xae64efa7,\n    0x677be718, 0x96a1e2b2, 0x9faeccec, 0x6e74c946, 0xa76bc1f9,\n    0x56b1c453, 0xee24d6c6, 0x1ffed36c, 0xd6e1dbd3, 0x273bde79,\n    0x7cbaf8b8, 0x8d60fd12, 0x447ff5ad, 0xb5a5f007, 0x0d30e292,\n    0xfceae738, 0x35f5ef87, 0xc42fea2d, 0x82f7a205, 0x732da7af,\n    0xba32af10, 0x4be8aaba, 0xf37db82f, 0x02a7bd85, 0xcbb8b53a,\n    0x3a62b090, 0x61e39651, 0x903993fb, 0x59269b44, 0xa8fc9eee,\n    0x10698c7b, 0xe1b389d1, 0x28ac816e, 0xd97684c4, 0xa51c113e,\n    0x54c61494, 0x9dd91c2b, 0x6c031981, 0xd4960b14, 0x254c0ebe,\n    0xec530601, 0x1d8903ab, 0x4608256a, 0xb7d220c0, 0x7ecd287f,\n    0x8f172dd5, 0x37823f40, 0xc6583aea, 0x0f473255, 0xfe9d37ff,\n    0xb8457fd7, 0x499f7a7d, 0x808072c2, 0x715a7768, 0xc9cf65fd,\n    0x38156057, 0xf10a68e8, 0x00d06d42, 0x5b514b83, 0xaa8b4e29,\n    0x63944696, 0x924e433c, 0x2adb51a9, 0xdb015403, 0x121e5cbc,\n    0xe3c45916},\n   {0x00000000, 0x0ee7e8d1, 0x1dcfd1a2, 0x13283973, 0x3b9fa344,\n    0x35784b95, 0x265072e6, 0x28b79a37, 0x773f4688, 0x79d8ae59,\n    0x6af0972a, 0x64177ffb, 0x4ca0e5cc, 0x42470d1d, 0x516f346e,\n    0x5f88dcbf, 0xee7e8d10, 0xe09965c1, 0xf3b15cb2, 0xfd56b463,\n    0xd5e12e54, 0xdb06c685, 0xc82efff6, 0xc6c91727, 0x9941cb98,\n    0x97a62349, 0x848e1a3a, 0x8a69f2eb, 0xa2de68dc, 0xac39800d,\n    0xbf11b97e, 0xb1f651af, 0x078c1c61, 0x096bf4b0, 0x1a43cdc3,\n    0x14a42512, 0x3c13bf25, 0x32f457f4, 0x21dc6e87, 0x2f3b8656,\n    0x70b35ae9, 0x7e54b238, 0x6d7c8b4b, 0x639b639a, 0x4b2cf9ad,\n    0x45cb117c, 0x56e3280f, 0x5804c0de, 0xe9f29171, 0xe71579a0,\n    0xf43d40d3, 0xfadaa802, 0xd26d3235, 0xdc8adae4, 0xcfa2e397,\n    0xc1450b46, 0x9ecdd7f9, 0x902a3f28, 0x8302065b, 0x8de5ee8a,\n    0xa55274bd, 0xabb59c6c, 0xb89da51f, 0xb67a4dce, 0x0f1838c2,\n    0x01ffd013, 0x12d7e960, 0x1c3001b1, 0x34879b86, 0x3a607357,\n    0x29484a24, 0x27afa2f5, 0x78277e4a, 0x76c0969b, 0x65e8afe8,\n    0x6b0f4739, 0x43b8dd0e, 0x4d5f35df, 0x5e770cac, 0x5090e47d,\n    0xe166b5d2, 0xef815d03, 0xfca96470, 0xf24e8ca1, 0xdaf91696,\n    0xd41efe47, 0xc736c734, 0xc9d12fe5, 0x9659f35a, 0x98be1b8b,\n    0x8b9622f8, 0x8571ca29, 0xadc6501e, 0xa321b8cf, 0xb00981bc,\n    0xbeee696d, 0x089424a3, 0x0673cc72, 0x155bf501, 0x1bbc1dd0,\n    0x330b87e7, 0x3dec6f36, 0x2ec45645, 0x2023be94, 0x7fab622b,\n    0x714c8afa, 0x6264b389, 0x6c835b58, 0x4434c16f, 0x4ad329be,\n    0x59fb10cd, 0x571cf81c, 0xe6eaa9b3, 0xe80d4162, 0xfb257811,\n    0xf5c290c0, 0xdd750af7, 0xd392e226, 0xc0badb55, 0xce5d3384,\n    0x91d5ef3b, 0x9f3207ea, 0x8c1a3e99, 0x82fdd648, 0xaa4a4c7f,\n    0xa4ada4ae, 0xb7859ddd, 0xb962750c, 0x1e307184, 0x10d79955,\n    0x03ffa026, 0x0d1848f7, 0x25afd2c0, 0x2b483a11, 0x38600362,\n    0x3687ebb3, 0x690f370c, 0x67e8dfdd, 0x74c0e6ae, 0x7a270e7f,\n    0x52909448, 0x5c777c99, 0x4f5f45ea, 0x41b8ad3b, 0xf04efc94,\n    0xfea91445, 0xed812d36, 0xe366c5e7, 0xcbd15fd0, 0xc536b701,\n    0xd61e8e72, 0xd8f966a3, 0x8771ba1c, 0x899652cd, 0x9abe6bbe,\n    0x9459836f, 0xbcee1958, 0xb209f189, 0xa121c8fa, 0xafc6202b,\n    0x19bc6de5, 0x175b8534, 0x0473bc47, 0x0a945496, 0x2223cea1,\n    0x2cc42670, 0x3fec1f03, 0x310bf7d2, 0x6e832b6d, 0x6064c3bc,\n    0x734cfacf, 0x7dab121e, 0x551c8829, 0x5bfb60f8, 0x48d3598b,\n    0x4634b15a, 0xf7c2e0f5, 0xf9250824, 0xea0d3157, 0xe4ead986,\n    0xcc5d43b1, 0xc2baab60, 0xd1929213, 0xdf757ac2, 0x80fda67d,\n    0x8e1a4eac, 0x9d3277df, 0x93d59f0e, 0xbb620539, 0xb585ede8,\n    0xa6add49b, 0xa84a3c4a, 0x11284946, 0x1fcfa197, 0x0ce798e4,\n    0x02007035, 0x2ab7ea02, 0x245002d3, 0x37783ba0, 0x399fd371,\n    0x66170fce, 0x68f0e71f, 0x7bd8de6c, 0x753f36bd, 0x5d88ac8a,\n    0x536f445b, 0x40477d28, 0x4ea095f9, 0xff56c456, 0xf1b12c87,\n    0xe29915f4, 0xec7efd25, 0xc4c96712, 0xca2e8fc3, 0xd906b6b0,\n    0xd7e15e61, 0x886982de, 0x868e6a0f, 0x95a6537c, 0x9b41bbad,\n    0xb3f6219a, 0xbd11c94b, 0xae39f038, 0xa0de18e9, 0x16a45527,\n    0x1843bdf6, 0x0b6b8485, 0x058c6c54, 0x2d3bf663, 0x23dc1eb2,\n    0x30f427c1, 0x3e13cf10, 0x619b13af, 0x6f7cfb7e, 0x7c54c20d,\n    0x72b32adc, 0x5a04b0eb, 0x54e3583a, 0x47cb6149, 0x492c8998,\n    0xf8dad837, 0xf63d30e6, 0xe5150995, 0xebf2e144, 0xc3457b73,\n    0xcda293a2, 0xde8aaad1, 0xd06d4200, 0x8fe59ebf, 0x8102766e,\n    0x922a4f1d, 0x9ccda7cc, 0xb47a3dfb, 0xba9dd52a, 0xa9b5ec59,\n    0xa7520488},\n   {0x00000000, 0x3c60e308, 0x78c1c610, 0x44a12518, 0xf1838c20,\n    0xcde36f28, 0x89424a30, 0xb522a938, 0x38761e01, 0x0416fd09,\n    0x40b7d811, 0x7cd73b19, 0xc9f59221, 0xf5957129, 0xb1345431,\n    0x8d54b739, 0x70ec3c02, 0x4c8cdf0a, 0x082dfa12, 0x344d191a,\n    0x816fb022, 0xbd0f532a, 0xf9ae7632, 0xc5ce953a, 0x489a2203,\n    0x74fac10b, 0x305be413, 0x0c3b071b, 0xb919ae23, 0x85794d2b,\n    0xc1d86833, 0xfdb88b3b, 0xe1d87804, 0xddb89b0c, 0x9919be14,\n    0xa5795d1c, 0x105bf424, 0x2c3b172c, 0x689a3234, 0x54fad13c,\n    0xd9ae6605, 0xe5ce850d, 0xa16fa015, 0x9d0f431d, 0x282dea25,\n    0x144d092d, 0x50ec2c35, 0x6c8ccf3d, 0x91344406, 0xad54a70e,\n    0xe9f58216, 0xd595611e, 0x60b7c826, 0x5cd72b2e, 0x18760e36,\n    0x2416ed3e, 0xa9425a07, 0x9522b90f, 0xd1839c17, 0xede37f1f,\n    0x58c1d627, 0x64a1352f, 0x20001037, 0x1c60f33f, 0x18c1f649,\n    0x24a11541, 0x60003059, 0x5c60d351, 0xe9427a69, 0xd5229961,\n    0x9183bc79, 0xade35f71, 0x20b7e848, 0x1cd70b40, 0x58762e58,\n    0x6416cd50, 0xd1346468, 0xed548760, 0xa9f5a278, 0x95954170,\n    0x682dca4b, 0x544d2943, 0x10ec0c5b, 0x2c8cef53, 0x99ae466b,\n    0xa5cea563, 0xe16f807b, 0xdd0f6373, 0x505bd44a, 0x6c3b3742,\n    0x289a125a, 0x14faf152, 0xa1d8586a, 0x9db8bb62, 0xd9199e7a,\n    0xe5797d72, 0xf9198e4d, 0xc5796d45, 0x81d8485d, 0xbdb8ab55,\n    0x089a026d, 0x34fae165, 0x705bc47d, 0x4c3b2775, 0xc16f904c,\n    0xfd0f7344, 0xb9ae565c, 0x85ceb554, 0x30ec1c6c, 0x0c8cff64,\n    0x482dda7c, 0x744d3974, 0x89f5b24f, 0xb5955147, 0xf134745f,\n    0xcd549757, 0x78763e6f, 0x4416dd67, 0x00b7f87f, 0x3cd71b77,\n    0xb183ac4e, 0x8de34f46, 0xc9426a5e, 0xf5228956, 0x4000206e,\n    0x7c60c366, 0x38c1e67e, 0x04a10576, 0x3183ec92, 0x0de30f9a,\n    0x49422a82, 0x7522c98a, 0xc00060b2, 0xfc6083ba, 0xb8c1a6a2,\n    0x84a145aa, 0x09f5f293, 0x3595119b, 0x71343483, 0x4d54d78b,\n    0xf8767eb3, 0xc4169dbb, 0x80b7b8a3, 0xbcd75bab, 0x416fd090,\n    0x7d0f3398, 0x39ae1680, 0x05cef588, 0xb0ec5cb0, 0x8c8cbfb8,\n    0xc82d9aa0, 0xf44d79a8, 0x7919ce91, 0x45792d99, 0x01d80881,\n    0x3db8eb89, 0x889a42b1, 0xb4faa1b9, 0xf05b84a1, 0xcc3b67a9,\n    0xd05b9496, 0xec3b779e, 0xa89a5286, 0x94fab18e, 0x21d818b6,\n    0x1db8fbbe, 0x5919dea6, 0x65793dae, 0xe82d8a97, 0xd44d699f,\n    0x90ec4c87, 0xac8caf8f, 0x19ae06b7, 0x25cee5bf, 0x616fc0a7,\n    0x5d0f23af, 0xa0b7a894, 0x9cd74b9c, 0xd8766e84, 0xe4168d8c,\n    0x513424b4, 0x6d54c7bc, 0x29f5e2a4, 0x159501ac, 0x98c1b695,\n    0xa4a1559d, 0xe0007085, 0xdc60938d, 0x69423ab5, 0x5522d9bd,\n    0x1183fca5, 0x2de31fad, 0x29421adb, 0x1522f9d3, 0x5183dccb,\n    0x6de33fc3, 0xd8c196fb, 0xe4a175f3, 0xa00050eb, 0x9c60b3e3,\n    0x113404da, 0x2d54e7d2, 0x69f5c2ca, 0x559521c2, 0xe0b788fa,\n    0xdcd76bf2, 0x98764eea, 0xa416ade2, 0x59ae26d9, 0x65cec5d1,\n    0x216fe0c9, 0x1d0f03c1, 0xa82daaf9, 0x944d49f1, 0xd0ec6ce9,\n    0xec8c8fe1, 0x61d838d8, 0x5db8dbd0, 0x1919fec8, 0x25791dc0,\n    0x905bb4f8, 0xac3b57f0, 0xe89a72e8, 0xd4fa91e0, 0xc89a62df,\n    0xf4fa81d7, 0xb05ba4cf, 0x8c3b47c7, 0x3919eeff, 0x05790df7,\n    0x41d828ef, 0x7db8cbe7, 0xf0ec7cde, 0xcc8c9fd6, 0x882dbace,\n    0xb44d59c6, 0x016ff0fe, 0x3d0f13f6, 0x79ae36ee, 0x45ced5e6,\n    0xb8765edd, 0x8416bdd5, 0xc0b798cd, 0xfcd77bc5, 0x49f5d2fd,\n    0x759531f5, 0x313414ed, 0x0d54f7e5, 0x800040dc, 0xbc60a3d4,\n    0xf8c186cc, 0xc4a165c4, 0x7183ccfc, 0x4de32ff4, 0x09420aec,\n    0x3522e9e4},\n   {0x00000000, 0x6307d924, 0xc60fb248, 0xa5086b6c, 0x576e62d1,\n    0x3469bbf5, 0x9161d099, 0xf26609bd, 0xaedcc5a2, 0xcddb1c86,\n    0x68d377ea, 0x0bd4aece, 0xf9b2a773, 0x9ab57e57, 0x3fbd153b,\n    0x5cbacc1f, 0x86c88d05, 0xe5cf5421, 0x40c73f4d, 0x23c0e669,\n    0xd1a6efd4, 0xb2a136f0, 0x17a95d9c, 0x74ae84b8, 0x281448a7,\n    0x4b139183, 0xee1bfaef, 0x8d1c23cb, 0x7f7a2a76, 0x1c7df352,\n    0xb975983e, 0xda72411a, 0xd6e01c4b, 0xb5e7c56f, 0x10efae03,\n    0x73e87727, 0x818e7e9a, 0xe289a7be, 0x4781ccd2, 0x248615f6,\n    0x783cd9e9, 0x1b3b00cd, 0xbe336ba1, 0xdd34b285, 0x2f52bb38,\n    0x4c55621c, 0xe95d0970, 0x8a5ad054, 0x5028914e, 0x332f486a,\n    0x96272306, 0xf520fa22, 0x0746f39f, 0x64412abb, 0xc14941d7,\n    0xa24e98f3, 0xfef454ec, 0x9df38dc8, 0x38fbe6a4, 0x5bfc3f80,\n    0xa99a363d, 0xca9def19, 0x6f958475, 0x0c925d51, 0x76b13ed7,\n    0x15b6e7f3, 0xb0be8c9f, 0xd3b955bb, 0x21df5c06, 0x42d88522,\n    0xe7d0ee4e, 0x84d7376a, 0xd86dfb75, 0xbb6a2251, 0x1e62493d,\n    0x7d659019, 0x8f0399a4, 0xec044080, 0x490c2bec, 0x2a0bf2c8,\n    0xf079b3d2, 0x937e6af6, 0x3676019a, 0x5571d8be, 0xa717d103,\n    0xc4100827, 0x6118634b, 0x021fba6f, 0x5ea57670, 0x3da2af54,\n    0x98aac438, 0xfbad1d1c, 0x09cb14a1, 0x6acccd85, 0xcfc4a6e9,\n    0xacc37fcd, 0xa051229c, 0xc356fbb8, 0x665e90d4, 0x055949f0,\n    0xf73f404d, 0x94389969, 0x3130f205, 0x52372b21, 0x0e8de73e,\n    0x6d8a3e1a, 0xc8825576, 0xab858c52, 0x59e385ef, 0x3ae45ccb,\n    0x9fec37a7, 0xfcebee83, 0x2699af99, 0x459e76bd, 0xe0961dd1,\n    0x8391c4f5, 0x71f7cd48, 0x12f0146c, 0xb7f87f00, 0xd4ffa624,\n    0x88456a3b, 0xeb42b31f, 0x4e4ad873, 0x2d4d0157, 0xdf2b08ea,\n    0xbc2cd1ce, 0x1924baa2, 0x7a236386, 0xed627dae, 0x8e65a48a,\n    0x2b6dcfe6, 0x486a16c2, 0xba0c1f7f, 0xd90bc65b, 0x7c03ad37,\n    0x1f047413, 0x43beb80c, 0x20b96128, 0x85b10a44, 0xe6b6d360,\n    0x14d0dadd, 0x77d703f9, 0xd2df6895, 0xb1d8b1b1, 0x6baaf0ab,\n    0x08ad298f, 0xada542e3, 0xcea29bc7, 0x3cc4927a, 0x5fc34b5e,\n    0xfacb2032, 0x99ccf916, 0xc5763509, 0xa671ec2d, 0x03798741,\n    0x607e5e65, 0x921857d8, 0xf11f8efc, 0x5417e590, 0x37103cb4,\n    0x3b8261e5, 0x5885b8c1, 0xfd8dd3ad, 0x9e8a0a89, 0x6cec0334,\n    0x0febda10, 0xaae3b17c, 0xc9e46858, 0x955ea447, 0xf6597d63,\n    0x5351160f, 0x3056cf2b, 0xc230c696, 0xa1371fb2, 0x043f74de,\n    0x6738adfa, 0xbd4aece0, 0xde4d35c4, 0x7b455ea8, 0x1842878c,\n    0xea248e31, 0x89235715, 0x2c2b3c79, 0x4f2ce55d, 0x13962942,\n    0x7091f066, 0xd5999b0a, 0xb69e422e, 0x44f84b93, 0x27ff92b7,\n    0x82f7f9db, 0xe1f020ff, 0x9bd34379, 0xf8d49a5d, 0x5ddcf131,\n    0x3edb2815, 0xccbd21a8, 0xafbaf88c, 0x0ab293e0, 0x69b54ac4,\n    0x350f86db, 0x56085fff, 0xf3003493, 0x9007edb7, 0x6261e40a,\n    0x01663d2e, 0xa46e5642, 0xc7698f66, 0x1d1bce7c, 0x7e1c1758,\n    0xdb147c34, 0xb813a510, 0x4a75acad, 0x29727589, 0x8c7a1ee5,\n    0xef7dc7c1, 0xb3c70bde, 0xd0c0d2fa, 0x75c8b996, 0x16cf60b2,\n    0xe4a9690f, 0x87aeb02b, 0x22a6db47, 0x41a10263, 0x4d335f32,\n    0x2e348616, 0x8b3ced7a, 0xe83b345e, 0x1a5d3de3, 0x795ae4c7,\n    0xdc528fab, 0xbf55568f, 0xe3ef9a90, 0x80e843b4, 0x25e028d8,\n    0x46e7f1fc, 0xb481f841, 0xd7862165, 0x728e4a09, 0x1189932d,\n    0xcbfbd237, 0xa8fc0b13, 0x0df4607f, 0x6ef3b95b, 0x9c95b0e6,\n    0xff9269c2, 0x5a9a02ae, 0x399ddb8a, 0x65271795, 0x0620ceb1,\n    0xa328a5dd, 0xc02f7cf9, 0x32497544, 0x514eac60, 0xf446c70c,\n    0x97411e28},\n   {0x00000000, 0x01b5fd1d, 0x036bfa3a, 0x02de0727, 0x06d7f474,\n    0x07620969, 0x05bc0e4e, 0x0409f353, 0x0dafe8e8, 0x0c1a15f5,\n    0x0ec412d2, 0x0f71efcf, 0x0b781c9c, 0x0acde181, 0x0813e6a6,\n    0x09a61bbb, 0x1b5fd1d0, 0x1aea2ccd, 0x18342bea, 0x1981d6f7,\n    0x1d8825a4, 0x1c3dd8b9, 0x1ee3df9e, 0x1f562283, 0x16f03938,\n    0x1745c425, 0x159bc302, 0x142e3e1f, 0x1027cd4c, 0x11923051,\n    0x134c3776, 0x12f9ca6b, 0x36bfa3a0, 0x370a5ebd, 0x35d4599a,\n    0x3461a487, 0x306857d4, 0x31ddaac9, 0x3303adee, 0x32b650f3,\n    0x3b104b48, 0x3aa5b655, 0x387bb172, 0x39ce4c6f, 0x3dc7bf3c,\n    0x3c724221, 0x3eac4506, 0x3f19b81b, 0x2de07270, 0x2c558f6d,\n    0x2e8b884a, 0x2f3e7557, 0x2b378604, 0x2a827b19, 0x285c7c3e,\n    0x29e98123, 0x204f9a98, 0x21fa6785, 0x232460a2, 0x22919dbf,\n    0x26986eec, 0x272d93f1, 0x25f394d6, 0x244669cb, 0x6d7f4740,\n    0x6ccaba5d, 0x6e14bd7a, 0x6fa14067, 0x6ba8b334, 0x6a1d4e29,\n    0x68c3490e, 0x6976b413, 0x60d0afa8, 0x616552b5, 0x63bb5592,\n    0x620ea88f, 0x66075bdc, 0x67b2a6c1, 0x656ca1e6, 0x64d95cfb,\n    0x76209690, 0x77956b8d, 0x754b6caa, 0x74fe91b7, 0x70f762e4,\n    0x71429ff9, 0x739c98de, 0x722965c3, 0x7b8f7e78, 0x7a3a8365,\n    0x78e48442, 0x7951795f, 0x7d588a0c, 0x7ced7711, 0x7e337036,\n    0x7f868d2b, 0x5bc0e4e0, 0x5a7519fd, 0x58ab1eda, 0x591ee3c7,\n    0x5d171094, 0x5ca2ed89, 0x5e7ceaae, 0x5fc917b3, 0x566f0c08,\n    0x57daf115, 0x5504f632, 0x54b10b2f, 0x50b8f87c, 0x510d0561,\n    0x53d30246, 0x5266ff5b, 0x409f3530, 0x412ac82d, 0x43f4cf0a,\n    0x42413217, 0x4648c144, 0x47fd3c59, 0x45233b7e, 0x4496c663,\n    0x4d30ddd8, 0x4c8520c5, 0x4e5b27e2, 0x4feedaff, 0x4be729ac,\n    0x4a52d4b1, 0x488cd396, 0x49392e8b, 0xdafe8e80, 0xdb4b739d,\n    0xd99574ba, 0xd82089a7, 0xdc297af4, 0xdd9c87e9, 0xdf4280ce,\n    0xdef77dd3, 0xd7516668, 0xd6e49b75, 0xd43a9c52, 0xd58f614f,\n    0xd186921c, 0xd0336f01, 0xd2ed6826, 0xd358953b, 0xc1a15f50,\n    0xc014a24d, 0xc2caa56a, 0xc37f5877, 0xc776ab24, 0xc6c35639,\n    0xc41d511e, 0xc5a8ac03, 0xcc0eb7b8, 0xcdbb4aa5, 0xcf654d82,\n    0xced0b09f, 0xcad943cc, 0xcb6cbed1, 0xc9b2b9f6, 0xc80744eb,\n    0xec412d20, 0xedf4d03d, 0xef2ad71a, 0xee9f2a07, 0xea96d954,\n    0xeb232449, 0xe9fd236e, 0xe848de73, 0xe1eec5c8, 0xe05b38d5,\n    0xe2853ff2, 0xe330c2ef, 0xe73931bc, 0xe68ccca1, 0xe452cb86,\n    0xe5e7369b, 0xf71efcf0, 0xf6ab01ed, 0xf47506ca, 0xf5c0fbd7,\n    0xf1c90884, 0xf07cf599, 0xf2a2f2be, 0xf3170fa3, 0xfab11418,\n    0xfb04e905, 0xf9daee22, 0xf86f133f, 0xfc66e06c, 0xfdd31d71,\n    0xff0d1a56, 0xfeb8e74b, 0xb781c9c0, 0xb63434dd, 0xb4ea33fa,\n    0xb55fcee7, 0xb1563db4, 0xb0e3c0a9, 0xb23dc78e, 0xb3883a93,\n    0xba2e2128, 0xbb9bdc35, 0xb945db12, 0xb8f0260f, 0xbcf9d55c,\n    0xbd4c2841, 0xbf922f66, 0xbe27d27b, 0xacde1810, 0xad6be50d,\n    0xafb5e22a, 0xae001f37, 0xaa09ec64, 0xabbc1179, 0xa962165e,\n    0xa8d7eb43, 0xa171f0f8, 0xa0c40de5, 0xa21a0ac2, 0xa3aff7df,\n    0xa7a6048c, 0xa613f991, 0xa4cdfeb6, 0xa57803ab, 0x813e6a60,\n    0x808b977d, 0x8255905a, 0x83e06d47, 0x87e99e14, 0x865c6309,\n    0x8482642e, 0x85379933, 0x8c918288, 0x8d247f95, 0x8ffa78b2,\n    0x8e4f85af, 0x8a4676fc, 0x8bf38be1, 0x892d8cc6, 0x889871db,\n    0x9a61bbb0, 0x9bd446ad, 0x990a418a, 0x98bfbc97, 0x9cb64fc4,\n    0x9d03b2d9, 0x9fddb5fe, 0x9e6848e3, 0x97ce5358, 0x967bae45,\n    0x94a5a962, 0x9510547f, 0x9119a72c, 0x90ac5a31, 0x92725d16,\n    0x93c7a00b},\n   {0x00000000, 0x6e8c1b41, 0xdd183682, 0xb3942dc3, 0x61416b45,\n    0x0fcd7004, 0xbc595dc7, 0xd2d54686, 0xc282d68a, 0xac0ecdcb,\n    0x1f9ae008, 0x7116fb49, 0xa3c3bdcf, 0xcd4fa68e, 0x7edb8b4d,\n    0x1057900c, 0x5e74ab55, 0x30f8b014, 0x836c9dd7, 0xede08696,\n    0x3f35c010, 0x51b9db51, 0xe22df692, 0x8ca1edd3, 0x9cf67ddf,\n    0xf27a669e, 0x41ee4b5d, 0x2f62501c, 0xfdb7169a, 0x933b0ddb,\n    0x20af2018, 0x4e233b59, 0xbce956aa, 0xd2654deb, 0x61f16028,\n    0x0f7d7b69, 0xdda83def, 0xb32426ae, 0x00b00b6d, 0x6e3c102c,\n    0x7e6b8020, 0x10e79b61, 0xa373b6a2, 0xcdffade3, 0x1f2aeb65,\n    0x71a6f024, 0xc232dde7, 0xacbec6a6, 0xe29dfdff, 0x8c11e6be,\n    0x3f85cb7d, 0x5109d03c, 0x83dc96ba, 0xed508dfb, 0x5ec4a038,\n    0x3048bb79, 0x201f2b75, 0x4e933034, 0xfd071df7, 0x938b06b6,\n    0x415e4030, 0x2fd25b71, 0x9c4676b2, 0xf2ca6df3, 0xa2a3ab15,\n    0xcc2fb054, 0x7fbb9d97, 0x113786d6, 0xc3e2c050, 0xad6edb11,\n    0x1efaf6d2, 0x7076ed93, 0x60217d9f, 0x0ead66de, 0xbd394b1d,\n    0xd3b5505c, 0x016016da, 0x6fec0d9b, 0xdc782058, 0xb2f43b19,\n    0xfcd70040, 0x925b1b01, 0x21cf36c2, 0x4f432d83, 0x9d966b05,\n    0xf31a7044, 0x408e5d87, 0x2e0246c6, 0x3e55d6ca, 0x50d9cd8b,\n    0xe34de048, 0x8dc1fb09, 0x5f14bd8f, 0x3198a6ce, 0x820c8b0d,\n    0xec80904c, 0x1e4afdbf, 0x70c6e6fe, 0xc352cb3d, 0xadded07c,\n    0x7f0b96fa, 0x11878dbb, 0xa213a078, 0xcc9fbb39, 0xdcc82b35,\n    0xb2443074, 0x01d01db7, 0x6f5c06f6, 0xbd894070, 0xd3055b31,\n    0x609176f2, 0x0e1d6db3, 0x403e56ea, 0x2eb24dab, 0x9d266068,\n    0xf3aa7b29, 0x217f3daf, 0x4ff326ee, 0xfc670b2d, 0x92eb106c,\n    0x82bc8060, 0xec309b21, 0x5fa4b6e2, 0x3128ada3, 0xe3fdeb25,\n    0x8d71f064, 0x3ee5dda7, 0x5069c6e6, 0x9e36506b, 0xf0ba4b2a,\n    0x432e66e9, 0x2da27da8, 0xff773b2e, 0x91fb206f, 0x226f0dac,\n    0x4ce316ed, 0x5cb486e1, 0x32389da0, 0x81acb063, 0xef20ab22,\n    0x3df5eda4, 0x5379f6e5, 0xe0eddb26, 0x8e61c067, 0xc042fb3e,\n    0xaecee07f, 0x1d5acdbc, 0x73d6d6fd, 0xa103907b, 0xcf8f8b3a,\n    0x7c1ba6f9, 0x1297bdb8, 0x02c02db4, 0x6c4c36f5, 0xdfd81b36,\n    0xb1540077, 0x638146f1, 0x0d0d5db0, 0xbe997073, 0xd0156b32,\n    0x22df06c1, 0x4c531d80, 0xffc73043, 0x914b2b02, 0x439e6d84,\n    0x2d1276c5, 0x9e865b06, 0xf00a4047, 0xe05dd04b, 0x8ed1cb0a,\n    0x3d45e6c9, 0x53c9fd88, 0x811cbb0e, 0xef90a04f, 0x5c048d8c,\n    0x328896cd, 0x7cabad94, 0x1227b6d5, 0xa1b39b16, 0xcf3f8057,\n    0x1deac6d1, 0x7366dd90, 0xc0f2f053, 0xae7eeb12, 0xbe297b1e,\n    0xd0a5605f, 0x63314d9c, 0x0dbd56dd, 0xdf68105b, 0xb1e40b1a,\n    0x027026d9, 0x6cfc3d98, 0x3c95fb7e, 0x5219e03f, 0xe18dcdfc,\n    0x8f01d6bd, 0x5dd4903b, 0x33588b7a, 0x80cca6b9, 0xee40bdf8,\n    0xfe172df4, 0x909b36b5, 0x230f1b76, 0x4d830037, 0x9f5646b1,\n    0xf1da5df0, 0x424e7033, 0x2cc26b72, 0x62e1502b, 0x0c6d4b6a,\n    0xbff966a9, 0xd1757de8, 0x03a03b6e, 0x6d2c202f, 0xdeb80dec,\n    0xb03416ad, 0xa06386a1, 0xceef9de0, 0x7d7bb023, 0x13f7ab62,\n    0xc122ede4, 0xafaef6a5, 0x1c3adb66, 0x72b6c027, 0x807cadd4,\n    0xeef0b695, 0x5d649b56, 0x33e88017, 0xe13dc691, 0x8fb1ddd0,\n    0x3c25f013, 0x52a9eb52, 0x42fe7b5e, 0x2c72601f, 0x9fe64ddc,\n    0xf16a569d, 0x23bf101b, 0x4d330b5a, 0xfea72699, 0x902b3dd8,\n    0xde080681, 0xb0841dc0, 0x03103003, 0x6d9c2b42, 0xbf496dc4,\n    0xd1c57685, 0x62515b46, 0x0cdd4007, 0x1c8ad00b, 0x7206cb4a,\n    0xc192e689, 0xaf1efdc8, 0x7dcbbb4e, 0x1347a00f, 0xa0d38dcc,\n    0xce5f968d},\n   {0x00000000, 0xe71da697, 0x154a4b6f, 0xf257edf8, 0x2a9496de,\n    0xcd893049, 0x3fdeddb1, 0xd8c37b26, 0x55292dbc, 0xb2348b2b,\n    0x406366d3, 0xa77ec044, 0x7fbdbb62, 0x98a01df5, 0x6af7f00d,\n    0x8dea569a, 0xaa525b78, 0x4d4ffdef, 0xbf181017, 0x5805b680,\n    0x80c6cda6, 0x67db6b31, 0x958c86c9, 0x7291205e, 0xff7b76c4,\n    0x1866d053, 0xea313dab, 0x0d2c9b3c, 0xd5efe01a, 0x32f2468d,\n    0xc0a5ab75, 0x27b80de2, 0x8fd5b0b1, 0x68c81626, 0x9a9ffbde,\n    0x7d825d49, 0xa541266f, 0x425c80f8, 0xb00b6d00, 0x5716cb97,\n    0xdafc9d0d, 0x3de13b9a, 0xcfb6d662, 0x28ab70f5, 0xf0680bd3,\n    0x1775ad44, 0xe52240bc, 0x023fe62b, 0x2587ebc9, 0xc29a4d5e,\n    0x30cda0a6, 0xd7d00631, 0x0f137d17, 0xe80edb80, 0x1a593678,\n    0xfd4490ef, 0x70aec675, 0x97b360e2, 0x65e48d1a, 0x82f92b8d,\n    0x5a3a50ab, 0xbd27f63c, 0x4f701bc4, 0xa86dbd53, 0xc4da6723,\n    0x23c7c1b4, 0xd1902c4c, 0x368d8adb, 0xee4ef1fd, 0x0953576a,\n    0xfb04ba92, 0x1c191c05, 0x91f34a9f, 0x76eeec08, 0x84b901f0,\n    0x63a4a767, 0xbb67dc41, 0x5c7a7ad6, 0xae2d972e, 0x493031b9,\n    0x6e883c5b, 0x89959acc, 0x7bc27734, 0x9cdfd1a3, 0x441caa85,\n    0xa3010c12, 0x5156e1ea, 0xb64b477d, 0x3ba111e7, 0xdcbcb770,\n    0x2eeb5a88, 0xc9f6fc1f, 0x11358739, 0xf62821ae, 0x047fcc56,\n    0xe3626ac1, 0x4b0fd792, 0xac127105, 0x5e459cfd, 0xb9583a6a,\n    0x619b414c, 0x8686e7db, 0x74d10a23, 0x93ccacb4, 0x1e26fa2e,\n    0xf93b5cb9, 0x0b6cb141, 0xec7117d6, 0x34b26cf0, 0xd3afca67,\n    0x21f8279f, 0xc6e58108, 0xe15d8cea, 0x06402a7d, 0xf417c785,\n    0x130a6112, 0xcbc91a34, 0x2cd4bca3, 0xde83515b, 0x399ef7cc,\n    0xb474a156, 0x536907c1, 0xa13eea39, 0x46234cae, 0x9ee03788,\n    0x79fd911f, 0x8baa7ce7, 0x6cb7da70, 0x52c5c807, 0xb5d86e90,\n    0x478f8368, 0xa09225ff, 0x78515ed9, 0x9f4cf84e, 0x6d1b15b6,\n    0x8a06b321, 0x07ece5bb, 0xe0f1432c, 0x12a6aed4, 0xf5bb0843,\n    0x2d787365, 0xca65d5f2, 0x3832380a, 0xdf2f9e9d, 0xf897937f,\n    0x1f8a35e8, 0xedddd810, 0x0ac07e87, 0xd20305a1, 0x351ea336,\n    0xc7494ece, 0x2054e859, 0xadbebec3, 0x4aa31854, 0xb8f4f5ac,\n    0x5fe9533b, 0x872a281d, 0x60378e8a, 0x92606372, 0x757dc5e5,\n    0xdd1078b6, 0x3a0dde21, 0xc85a33d9, 0x2f47954e, 0xf784ee68,\n    0x109948ff, 0xe2cea507, 0x05d30390, 0x8839550a, 0x6f24f39d,\n    0x9d731e65, 0x7a6eb8f2, 0xa2adc3d4, 0x45b06543, 0xb7e788bb,\n    0x50fa2e2c, 0x774223ce, 0x905f8559, 0x620868a1, 0x8515ce36,\n    0x5dd6b510, 0xbacb1387, 0x489cfe7f, 0xaf8158e8, 0x226b0e72,\n    0xc576a8e5, 0x3721451d, 0xd03ce38a, 0x08ff98ac, 0xefe23e3b,\n    0x1db5d3c3, 0xfaa87554, 0x961faf24, 0x710209b3, 0x8355e44b,\n    0x644842dc, 0xbc8b39fa, 0x5b969f6d, 0xa9c17295, 0x4edcd402,\n    0xc3368298, 0x242b240f, 0xd67cc9f7, 0x31616f60, 0xe9a21446,\n    0x0ebfb2d1, 0xfce85f29, 0x1bf5f9be, 0x3c4df45c, 0xdb5052cb,\n    0x2907bf33, 0xce1a19a4, 0x16d96282, 0xf1c4c415, 0x039329ed,\n    0xe48e8f7a, 0x6964d9e0, 0x8e797f77, 0x7c2e928f, 0x9b333418,\n    0x43f04f3e, 0xa4ede9a9, 0x56ba0451, 0xb1a7a2c6, 0x19ca1f95,\n    0xfed7b902, 0x0c8054fa, 0xeb9df26d, 0x335e894b, 0xd4432fdc,\n    0x2614c224, 0xc10964b3, 0x4ce33229, 0xabfe94be, 0x59a97946,\n    0xbeb4dfd1, 0x6677a4f7, 0x816a0260, 0x733def98, 0x9420490f,\n    0xb39844ed, 0x5485e27a, 0xa6d20f82, 0x41cfa915, 0x990cd233,\n    0x7e1174a4, 0x8c46995c, 0x6b5b3fcb, 0xe6b16951, 0x01accfc6,\n    0xf3fb223e, 0x14e684a9, 0xcc25ff8f, 0x2b385918, 0xd96fb4e0,\n    0x3e721277},\n   {0x00000000, 0xa58b900e, 0x9066265d, 0x35edb653, 0xfbbd4afb,\n    0x5e36daf5, 0x6bdb6ca6, 0xce50fca8, 0x2c0b93b7, 0x898003b9,\n    0xbc6db5ea, 0x19e625e4, 0xd7b6d94c, 0x723d4942, 0x47d0ff11,\n    0xe25b6f1f, 0x5817276e, 0xfd9cb760, 0xc8710133, 0x6dfa913d,\n    0xa3aa6d95, 0x0621fd9b, 0x33cc4bc8, 0x9647dbc6, 0x741cb4d9,\n    0xd19724d7, 0xe47a9284, 0x41f1028a, 0x8fa1fe22, 0x2a2a6e2c,\n    0x1fc7d87f, 0xba4c4871, 0xb02e4edc, 0x15a5ded2, 0x20486881,\n    0x85c3f88f, 0x4b930427, 0xee189429, 0xdbf5227a, 0x7e7eb274,\n    0x9c25dd6b, 0x39ae4d65, 0x0c43fb36, 0xa9c86b38, 0x67989790,\n    0xc213079e, 0xf7feb1cd, 0x527521c3, 0xe83969b2, 0x4db2f9bc,\n    0x785f4fef, 0xddd4dfe1, 0x13842349, 0xb60fb347, 0x83e20514,\n    0x2669951a, 0xc432fa05, 0x61b96a0b, 0x5454dc58, 0xf1df4c56,\n    0x3f8fb0fe, 0x9a0420f0, 0xafe996a3, 0x0a6206ad, 0xbb2d9bf9,\n    0x1ea60bf7, 0x2b4bbda4, 0x8ec02daa, 0x4090d102, 0xe51b410c,\n    0xd0f6f75f, 0x757d6751, 0x9726084e, 0x32ad9840, 0x07402e13,\n    0xa2cbbe1d, 0x6c9b42b5, 0xc910d2bb, 0xfcfd64e8, 0x5976f4e6,\n    0xe33abc97, 0x46b12c99, 0x735c9aca, 0xd6d70ac4, 0x1887f66c,\n    0xbd0c6662, 0x88e1d031, 0x2d6a403f, 0xcf312f20, 0x6ababf2e,\n    0x5f57097d, 0xfadc9973, 0x348c65db, 0x9107f5d5, 0xa4ea4386,\n    0x0161d388, 0x0b03d525, 0xae88452b, 0x9b65f378, 0x3eee6376,\n    0xf0be9fde, 0x55350fd0, 0x60d8b983, 0xc553298d, 0x27084692,\n    0x8283d69c, 0xb76e60cf, 0x12e5f0c1, 0xdcb50c69, 0x793e9c67,\n    0x4cd32a34, 0xe958ba3a, 0x5314f24b, 0xf69f6245, 0xc372d416,\n    0x66f94418, 0xa8a9b8b0, 0x0d2228be, 0x38cf9eed, 0x9d440ee3,\n    0x7f1f61fc, 0xda94f1f2, 0xef7947a1, 0x4af2d7af, 0x84a22b07,\n    0x2129bb09, 0x14c40d5a, 0xb14f9d54, 0xad2a31b3, 0x08a1a1bd,\n    0x3d4c17ee, 0x98c787e0, 0x56977b48, 0xf31ceb46, 0xc6f15d15,\n    0x637acd1b, 0x8121a204, 0x24aa320a, 0x11478459, 0xb4cc1457,\n    0x7a9ce8ff, 0xdf1778f1, 0xeafacea2, 0x4f715eac, 0xf53d16dd,\n    0x50b686d3, 0x655b3080, 0xc0d0a08e, 0x0e805c26, 0xab0bcc28,\n    0x9ee67a7b, 0x3b6dea75, 0xd936856a, 0x7cbd1564, 0x4950a337,\n    0xecdb3339, 0x228bcf91, 0x87005f9f, 0xb2ede9cc, 0x176679c2,\n    0x1d047f6f, 0xb88fef61, 0x8d625932, 0x28e9c93c, 0xe6b93594,\n    0x4332a59a, 0x76df13c9, 0xd35483c7, 0x310fecd8, 0x94847cd6,\n    0xa169ca85, 0x04e25a8b, 0xcab2a623, 0x6f39362d, 0x5ad4807e,\n    0xff5f1070, 0x45135801, 0xe098c80f, 0xd5757e5c, 0x70feee52,\n    0xbeae12fa, 0x1b2582f4, 0x2ec834a7, 0x8b43a4a9, 0x6918cbb6,\n    0xcc935bb8, 0xf97eedeb, 0x5cf57de5, 0x92a5814d, 0x372e1143,\n    0x02c3a710, 0xa748371e, 0x1607aa4a, 0xb38c3a44, 0x86618c17,\n    0x23ea1c19, 0xedbae0b1, 0x483170bf, 0x7ddcc6ec, 0xd85756e2,\n    0x3a0c39fd, 0x9f87a9f3, 0xaa6a1fa0, 0x0fe18fae, 0xc1b17306,\n    0x643ae308, 0x51d7555b, 0xf45cc555, 0x4e108d24, 0xeb9b1d2a,\n    0xde76ab79, 0x7bfd3b77, 0xb5adc7df, 0x102657d1, 0x25cbe182,\n    0x8040718c, 0x621b1e93, 0xc7908e9d, 0xf27d38ce, 0x57f6a8c0,\n    0x99a65468, 0x3c2dc466, 0x09c07235, 0xac4be23b, 0xa629e496,\n    0x03a27498, 0x364fc2cb, 0x93c452c5, 0x5d94ae6d, 0xf81f3e63,\n    0xcdf28830, 0x6879183e, 0x8a227721, 0x2fa9e72f, 0x1a44517c,\n    0xbfcfc172, 0x719f3dda, 0xd414add4, 0xe1f91b87, 0x44728b89,\n    0xfe3ec3f8, 0x5bb553f6, 0x6e58e5a5, 0xcbd375ab, 0x05838903,\n    0xa008190d, 0x95e5af5e, 0x306e3f50, 0xd235504f, 0x77bec041,\n    0x42537612, 0xe7d8e61c, 0x29881ab4, 0x8c038aba, 0xb9ee3ce9,\n    0x1c65ace7}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0x0e908ba500000000, 0x5d26669000000000,\n    0x53b6ed3500000000, 0xfb4abdfb00000000, 0xf5da365e00000000,\n    0xa66cdb6b00000000, 0xa8fc50ce00000000, 0xb7930b2c00000000,\n    0xb903808900000000, 0xeab56dbc00000000, 0xe425e61900000000,\n    0x4cd9b6d700000000, 0x42493d7200000000, 0x11ffd04700000000,\n    0x1f6f5be200000000, 0x6e27175800000000, 0x60b79cfd00000000,\n    0x330171c800000000, 0x3d91fa6d00000000, 0x956daaa300000000,\n    0x9bfd210600000000, 0xc84bcc3300000000, 0xc6db479600000000,\n    0xd9b41c7400000000, 0xd72497d100000000, 0x84927ae400000000,\n    0x8a02f14100000000, 0x22fea18f00000000, 0x2c6e2a2a00000000,\n    0x7fd8c71f00000000, 0x71484cba00000000, 0xdc4e2eb000000000,\n    0xd2dea51500000000, 0x8168482000000000, 0x8ff8c38500000000,\n    0x2704934b00000000, 0x299418ee00000000, 0x7a22f5db00000000,\n    0x74b27e7e00000000, 0x6bdd259c00000000, 0x654dae3900000000,\n    0x36fb430c00000000, 0x386bc8a900000000, 0x9097986700000000,\n    0x9e0713c200000000, 0xcdb1fef700000000, 0xc321755200000000,\n    0xb26939e800000000, 0xbcf9b24d00000000, 0xef4f5f7800000000,\n    0xe1dfd4dd00000000, 0x4923841300000000, 0x47b30fb600000000,\n    0x1405e28300000000, 0x1a95692600000000, 0x05fa32c400000000,\n    0x0b6ab96100000000, 0x58dc545400000000, 0x564cdff100000000,\n    0xfeb08f3f00000000, 0xf020049a00000000, 0xa396e9af00000000,\n    0xad06620a00000000, 0xf99b2dbb00000000, 0xf70ba61e00000000,\n    0xa4bd4b2b00000000, 0xaa2dc08e00000000, 0x02d1904000000000,\n    0x0c411be500000000, 0x5ff7f6d000000000, 0x51677d7500000000,\n    0x4e08269700000000, 0x4098ad3200000000, 0x132e400700000000,\n    0x1dbecba200000000, 0xb5429b6c00000000, 0xbbd210c900000000,\n    0xe864fdfc00000000, 0xe6f4765900000000, 0x97bc3ae300000000,\n    0x992cb14600000000, 0xca9a5c7300000000, 0xc40ad7d600000000,\n    0x6cf6871800000000, 0x62660cbd00000000, 0x31d0e18800000000,\n    0x3f406a2d00000000, 0x202f31cf00000000, 0x2ebfba6a00000000,\n    0x7d09575f00000000, 0x7399dcfa00000000, 0xdb658c3400000000,\n    0xd5f5079100000000, 0x8643eaa400000000, 0x88d3610100000000,\n    0x25d5030b00000000, 0x2b4588ae00000000, 0x78f3659b00000000,\n    0x7663ee3e00000000, 0xde9fbef000000000, 0xd00f355500000000,\n    0x83b9d86000000000, 0x8d2953c500000000, 0x9246082700000000,\n    0x9cd6838200000000, 0xcf606eb700000000, 0xc1f0e51200000000,\n    0x690cb5dc00000000, 0x679c3e7900000000, 0x342ad34c00000000,\n    0x3aba58e900000000, 0x4bf2145300000000, 0x45629ff600000000,\n    0x16d472c300000000, 0x1844f96600000000, 0xb0b8a9a800000000,\n    0xbe28220d00000000, 0xed9ecf3800000000, 0xe30e449d00000000,\n    0xfc611f7f00000000, 0xf2f194da00000000, 0xa14779ef00000000,\n    0xafd7f24a00000000, 0x072ba28400000000, 0x09bb292100000000,\n    0x5a0dc41400000000, 0x549d4fb100000000, 0xb3312aad00000000,\n    0xbda1a10800000000, 0xee174c3d00000000, 0xe087c79800000000,\n    0x487b975600000000, 0x46eb1cf300000000, 0x155df1c600000000,\n    0x1bcd7a6300000000, 0x04a2218100000000, 0x0a32aa2400000000,\n    0x5984471100000000, 0x5714ccb400000000, 0xffe89c7a00000000,\n    0xf17817df00000000, 0xa2cefaea00000000, 0xac5e714f00000000,\n    0xdd163df500000000, 0xd386b65000000000, 0x80305b6500000000,\n    0x8ea0d0c000000000, 0x265c800e00000000, 0x28cc0bab00000000,\n    0x7b7ae69e00000000, 0x75ea6d3b00000000, 0x6a8536d900000000,\n    0x6415bd7c00000000, 0x37a3504900000000, 0x3933dbec00000000,\n    0x91cf8b2200000000, 0x9f5f008700000000, 0xcce9edb200000000,\n    0xc279661700000000, 0x6f7f041d00000000, 0x61ef8fb800000000,\n    0x3259628d00000000, 0x3cc9e92800000000, 0x9435b9e600000000,\n    0x9aa5324300000000, 0xc913df7600000000, 0xc78354d300000000,\n    0xd8ec0f3100000000, 0xd67c849400000000, 0x85ca69a100000000,\n    0x8b5ae20400000000, 0x23a6b2ca00000000, 0x2d36396f00000000,\n    0x7e80d45a00000000, 0x70105fff00000000, 0x0158134500000000,\n    0x0fc898e000000000, 0x5c7e75d500000000, 0x52eefe7000000000,\n    0xfa12aebe00000000, 0xf482251b00000000, 0xa734c82e00000000,\n    0xa9a4438b00000000, 0xb6cb186900000000, 0xb85b93cc00000000,\n    0xebed7ef900000000, 0xe57df55c00000000, 0x4d81a59200000000,\n    0x43112e3700000000, 0x10a7c30200000000, 0x1e3748a700000000,\n    0x4aaa071600000000, 0x443a8cb300000000, 0x178c618600000000,\n    0x191cea2300000000, 0xb1e0baed00000000, 0xbf70314800000000,\n    0xecc6dc7d00000000, 0xe25657d800000000, 0xfd390c3a00000000,\n    0xf3a9879f00000000, 0xa01f6aaa00000000, 0xae8fe10f00000000,\n    0x0673b1c100000000, 0x08e33a6400000000, 0x5b55d75100000000,\n    0x55c55cf400000000, 0x248d104e00000000, 0x2a1d9beb00000000,\n    0x79ab76de00000000, 0x773bfd7b00000000, 0xdfc7adb500000000,\n    0xd157261000000000, 0x82e1cb2500000000, 0x8c71408000000000,\n    0x931e1b6200000000, 0x9d8e90c700000000, 0xce387df200000000,\n    0xc0a8f65700000000, 0x6854a69900000000, 0x66c42d3c00000000,\n    0x3572c00900000000, 0x3be24bac00000000, 0x96e429a600000000,\n    0x9874a20300000000, 0xcbc24f3600000000, 0xc552c49300000000,\n    0x6dae945d00000000, 0x633e1ff800000000, 0x3088f2cd00000000,\n    0x3e18796800000000, 0x2177228a00000000, 0x2fe7a92f00000000,\n    0x7c51441a00000000, 0x72c1cfbf00000000, 0xda3d9f7100000000,\n    0xd4ad14d400000000, 0x871bf9e100000000, 0x898b724400000000,\n    0xf8c33efe00000000, 0xf653b55b00000000, 0xa5e5586e00000000,\n    0xab75d3cb00000000, 0x0389830500000000, 0x0d1908a000000000,\n    0x5eafe59500000000, 0x503f6e3000000000, 0x4f5035d200000000,\n    0x41c0be7700000000, 0x1276534200000000, 0x1ce6d8e700000000,\n    0xb41a882900000000, 0xba8a038c00000000, 0xe93ceeb900000000,\n    0xe7ac651c00000000},\n   {0x0000000000000000, 0x97a61de700000000, 0x6f4b4a1500000000,\n    0xf8ed57f200000000, 0xde96942a00000000, 0x493089cd00000000,\n    0xb1ddde3f00000000, 0x267bc3d800000000, 0xbc2d295500000000,\n    0x2b8b34b200000000, 0xd366634000000000, 0x44c07ea700000000,\n    0x62bbbd7f00000000, 0xf51da09800000000, 0x0df0f76a00000000,\n    0x9a56ea8d00000000, 0x785b52aa00000000, 0xeffd4f4d00000000,\n    0x171018bf00000000, 0x80b6055800000000, 0xa6cdc68000000000,\n    0x316bdb6700000000, 0xc9868c9500000000, 0x5e20917200000000,\n    0xc4767bff00000000, 0x53d0661800000000, 0xab3d31ea00000000,\n    0x3c9b2c0d00000000, 0x1ae0efd500000000, 0x8d46f23200000000,\n    0x75aba5c000000000, 0xe20db82700000000, 0xb1b0d58f00000000,\n    0x2616c86800000000, 0xdefb9f9a00000000, 0x495d827d00000000,\n    0x6f2641a500000000, 0xf8805c4200000000, 0x006d0bb000000000,\n    0x97cb165700000000, 0x0d9dfcda00000000, 0x9a3be13d00000000,\n    0x62d6b6cf00000000, 0xf570ab2800000000, 0xd30b68f000000000,\n    0x44ad751700000000, 0xbc4022e500000000, 0x2be63f0200000000,\n    0xc9eb872500000000, 0x5e4d9ac200000000, 0xa6a0cd3000000000,\n    0x3106d0d700000000, 0x177d130f00000000, 0x80db0ee800000000,\n    0x7836591a00000000, 0xef9044fd00000000, 0x75c6ae7000000000,\n    0xe260b39700000000, 0x1a8de46500000000, 0x8d2bf98200000000,\n    0xab503a5a00000000, 0x3cf627bd00000000, 0xc41b704f00000000,\n    0x53bd6da800000000, 0x2367dac400000000, 0xb4c1c72300000000,\n    0x4c2c90d100000000, 0xdb8a8d3600000000, 0xfdf14eee00000000,\n    0x6a57530900000000, 0x92ba04fb00000000, 0x051c191c00000000,\n    0x9f4af39100000000, 0x08ecee7600000000, 0xf001b98400000000,\n    0x67a7a46300000000, 0x41dc67bb00000000, 0xd67a7a5c00000000,\n    0x2e972dae00000000, 0xb931304900000000, 0x5b3c886e00000000,\n    0xcc9a958900000000, 0x3477c27b00000000, 0xa3d1df9c00000000,\n    0x85aa1c4400000000, 0x120c01a300000000, 0xeae1565100000000,\n    0x7d474bb600000000, 0xe711a13b00000000, 0x70b7bcdc00000000,\n    0x885aeb2e00000000, 0x1ffcf6c900000000, 0x3987351100000000,\n    0xae2128f600000000, 0x56cc7f0400000000, 0xc16a62e300000000,\n    0x92d70f4b00000000, 0x057112ac00000000, 0xfd9c455e00000000,\n    0x6a3a58b900000000, 0x4c419b6100000000, 0xdbe7868600000000,\n    0x230ad17400000000, 0xb4accc9300000000, 0x2efa261e00000000,\n    0xb95c3bf900000000, 0x41b16c0b00000000, 0xd61771ec00000000,\n    0xf06cb23400000000, 0x67caafd300000000, 0x9f27f82100000000,\n    0x0881e5c600000000, 0xea8c5de100000000, 0x7d2a400600000000,\n    0x85c717f400000000, 0x12610a1300000000, 0x341ac9cb00000000,\n    0xa3bcd42c00000000, 0x5b5183de00000000, 0xccf79e3900000000,\n    0x56a174b400000000, 0xc107695300000000, 0x39ea3ea100000000,\n    0xae4c234600000000, 0x8837e09e00000000, 0x1f91fd7900000000,\n    0xe77caa8b00000000, 0x70dab76c00000000, 0x07c8c55200000000,\n    0x906ed8b500000000, 0x68838f4700000000, 0xff2592a000000000,\n    0xd95e517800000000, 0x4ef84c9f00000000, 0xb6151b6d00000000,\n    0x21b3068a00000000, 0xbbe5ec0700000000, 0x2c43f1e000000000,\n    0xd4aea61200000000, 0x4308bbf500000000, 0x6573782d00000000,\n    0xf2d565ca00000000, 0x0a38323800000000, 0x9d9e2fdf00000000,\n    0x7f9397f800000000, 0xe8358a1f00000000, 0x10d8dded00000000,\n    0x877ec00a00000000, 0xa10503d200000000, 0x36a31e3500000000,\n    0xce4e49c700000000, 0x59e8542000000000, 0xc3bebead00000000,\n    0x5418a34a00000000, 0xacf5f4b800000000, 0x3b53e95f00000000,\n    0x1d282a8700000000, 0x8a8e376000000000, 0x7263609200000000,\n    0xe5c57d7500000000, 0xb67810dd00000000, 0x21de0d3a00000000,\n    0xd9335ac800000000, 0x4e95472f00000000, 0x68ee84f700000000,\n    0xff48991000000000, 0x07a5cee200000000, 0x9003d30500000000,\n    0x0a55398800000000, 0x9df3246f00000000, 0x651e739d00000000,\n    0xf2b86e7a00000000, 0xd4c3ada200000000, 0x4365b04500000000,\n    0xbb88e7b700000000, 0x2c2efa5000000000, 0xce23427700000000,\n    0x59855f9000000000, 0xa168086200000000, 0x36ce158500000000,\n    0x10b5d65d00000000, 0x8713cbba00000000, 0x7ffe9c4800000000,\n    0xe85881af00000000, 0x720e6b2200000000, 0xe5a876c500000000,\n    0x1d45213700000000, 0x8ae33cd000000000, 0xac98ff0800000000,\n    0x3b3ee2ef00000000, 0xc3d3b51d00000000, 0x5475a8fa00000000,\n    0x24af1f9600000000, 0xb309027100000000, 0x4be4558300000000,\n    0xdc42486400000000, 0xfa398bbc00000000, 0x6d9f965b00000000,\n    0x9572c1a900000000, 0x02d4dc4e00000000, 0x988236c300000000,\n    0x0f242b2400000000, 0xf7c97cd600000000, 0x606f613100000000,\n    0x4614a2e900000000, 0xd1b2bf0e00000000, 0x295fe8fc00000000,\n    0xbef9f51b00000000, 0x5cf44d3c00000000, 0xcb5250db00000000,\n    0x33bf072900000000, 0xa4191ace00000000, 0x8262d91600000000,\n    0x15c4c4f100000000, 0xed29930300000000, 0x7a8f8ee400000000,\n    0xe0d9646900000000, 0x777f798e00000000, 0x8f922e7c00000000,\n    0x1834339b00000000, 0x3e4ff04300000000, 0xa9e9eda400000000,\n    0x5104ba5600000000, 0xc6a2a7b100000000, 0x951fca1900000000,\n    0x02b9d7fe00000000, 0xfa54800c00000000, 0x6df29deb00000000,\n    0x4b895e3300000000, 0xdc2f43d400000000, 0x24c2142600000000,\n    0xb36409c100000000, 0x2932e34c00000000, 0xbe94feab00000000,\n    0x4679a95900000000, 0xd1dfb4be00000000, 0xf7a4776600000000,\n    0x60026a8100000000, 0x98ef3d7300000000, 0x0f49209400000000,\n    0xed4498b300000000, 0x7ae2855400000000, 0x820fd2a600000000,\n    0x15a9cf4100000000, 0x33d20c9900000000, 0xa474117e00000000,\n    0x5c99468c00000000, 0xcb3f5b6b00000000, 0x5169b1e600000000,\n    0xc6cfac0100000000, 0x3e22fbf300000000, 0xa984e61400000000,\n    0x8fff25cc00000000, 0x1859382b00000000, 0xe0b46fd900000000,\n    0x7712723e00000000},\n   {0x0000000000000000, 0x411b8c6e00000000, 0x823618dd00000000,\n    0xc32d94b300000000, 0x456b416100000000, 0x0470cd0f00000000,\n    0xc75d59bc00000000, 0x8646d5d200000000, 0x8ad682c200000000,\n    0xcbcd0eac00000000, 0x08e09a1f00000000, 0x49fb167100000000,\n    0xcfbdc3a300000000, 0x8ea64fcd00000000, 0x4d8bdb7e00000000,\n    0x0c90571000000000, 0x55ab745e00000000, 0x14b0f83000000000,\n    0xd79d6c8300000000, 0x9686e0ed00000000, 0x10c0353f00000000,\n    0x51dbb95100000000, 0x92f62de200000000, 0xd3eda18c00000000,\n    0xdf7df69c00000000, 0x9e667af200000000, 0x5d4bee4100000000,\n    0x1c50622f00000000, 0x9a16b7fd00000000, 0xdb0d3b9300000000,\n    0x1820af2000000000, 0x593b234e00000000, 0xaa56e9bc00000000,\n    0xeb4d65d200000000, 0x2860f16100000000, 0x697b7d0f00000000,\n    0xef3da8dd00000000, 0xae2624b300000000, 0x6d0bb00000000000,\n    0x2c103c6e00000000, 0x20806b7e00000000, 0x619be71000000000,\n    0xa2b673a300000000, 0xe3adffcd00000000, 0x65eb2a1f00000000,\n    0x24f0a67100000000, 0xe7dd32c200000000, 0xa6c6beac00000000,\n    0xfffd9de200000000, 0xbee6118c00000000, 0x7dcb853f00000000,\n    0x3cd0095100000000, 0xba96dc8300000000, 0xfb8d50ed00000000,\n    0x38a0c45e00000000, 0x79bb483000000000, 0x752b1f2000000000,\n    0x3430934e00000000, 0xf71d07fd00000000, 0xb6068b9300000000,\n    0x30405e4100000000, 0x715bd22f00000000, 0xb276469c00000000,\n    0xf36dcaf200000000, 0x15aba3a200000000, 0x54b02fcc00000000,\n    0x979dbb7f00000000, 0xd686371100000000, 0x50c0e2c300000000,\n    0x11db6ead00000000, 0xd2f6fa1e00000000, 0x93ed767000000000,\n    0x9f7d216000000000, 0xde66ad0e00000000, 0x1d4b39bd00000000,\n    0x5c50b5d300000000, 0xda16600100000000, 0x9b0dec6f00000000,\n    0x582078dc00000000, 0x193bf4b200000000, 0x4000d7fc00000000,\n    0x011b5b9200000000, 0xc236cf2100000000, 0x832d434f00000000,\n    0x056b969d00000000, 0x44701af300000000, 0x875d8e4000000000,\n    0xc646022e00000000, 0xcad6553e00000000, 0x8bcdd95000000000,\n    0x48e04de300000000, 0x09fbc18d00000000, 0x8fbd145f00000000,\n    0xcea6983100000000, 0x0d8b0c8200000000, 0x4c9080ec00000000,\n    0xbffd4a1e00000000, 0xfee6c67000000000, 0x3dcb52c300000000,\n    0x7cd0dead00000000, 0xfa960b7f00000000, 0xbb8d871100000000,\n    0x78a013a200000000, 0x39bb9fcc00000000, 0x352bc8dc00000000,\n    0x743044b200000000, 0xb71dd00100000000, 0xf6065c6f00000000,\n    0x704089bd00000000, 0x315b05d300000000, 0xf276916000000000,\n    0xb36d1d0e00000000, 0xea563e4000000000, 0xab4db22e00000000,\n    0x6860269d00000000, 0x297baaf300000000, 0xaf3d7f2100000000,\n    0xee26f34f00000000, 0x2d0b67fc00000000, 0x6c10eb9200000000,\n    0x6080bc8200000000, 0x219b30ec00000000, 0xe2b6a45f00000000,\n    0xa3ad283100000000, 0x25ebfde300000000, 0x64f0718d00000000,\n    0xa7dde53e00000000, 0xe6c6695000000000, 0x6b50369e00000000,\n    0x2a4bbaf000000000, 0xe9662e4300000000, 0xa87da22d00000000,\n    0x2e3b77ff00000000, 0x6f20fb9100000000, 0xac0d6f2200000000,\n    0xed16e34c00000000, 0xe186b45c00000000, 0xa09d383200000000,\n    0x63b0ac8100000000, 0x22ab20ef00000000, 0xa4edf53d00000000,\n    0xe5f6795300000000, 0x26dbede000000000, 0x67c0618e00000000,\n    0x3efb42c000000000, 0x7fe0ceae00000000, 0xbccd5a1d00000000,\n    0xfdd6d67300000000, 0x7b9003a100000000, 0x3a8b8fcf00000000,\n    0xf9a61b7c00000000, 0xb8bd971200000000, 0xb42dc00200000000,\n    0xf5364c6c00000000, 0x361bd8df00000000, 0x770054b100000000,\n    0xf146816300000000, 0xb05d0d0d00000000, 0x737099be00000000,\n    0x326b15d000000000, 0xc106df2200000000, 0x801d534c00000000,\n    0x4330c7ff00000000, 0x022b4b9100000000, 0x846d9e4300000000,\n    0xc576122d00000000, 0x065b869e00000000, 0x47400af000000000,\n    0x4bd05de000000000, 0x0acbd18e00000000, 0xc9e6453d00000000,\n    0x88fdc95300000000, 0x0ebb1c8100000000, 0x4fa090ef00000000,\n    0x8c8d045c00000000, 0xcd96883200000000, 0x94adab7c00000000,\n    0xd5b6271200000000, 0x169bb3a100000000, 0x57803fcf00000000,\n    0xd1c6ea1d00000000, 0x90dd667300000000, 0x53f0f2c000000000,\n    0x12eb7eae00000000, 0x1e7b29be00000000, 0x5f60a5d000000000,\n    0x9c4d316300000000, 0xdd56bd0d00000000, 0x5b1068df00000000,\n    0x1a0be4b100000000, 0xd926700200000000, 0x983dfc6c00000000,\n    0x7efb953c00000000, 0x3fe0195200000000, 0xfccd8de100000000,\n    0xbdd6018f00000000, 0x3b90d45d00000000, 0x7a8b583300000000,\n    0xb9a6cc8000000000, 0xf8bd40ee00000000, 0xf42d17fe00000000,\n    0xb5369b9000000000, 0x761b0f2300000000, 0x3700834d00000000,\n    0xb146569f00000000, 0xf05ddaf100000000, 0x33704e4200000000,\n    0x726bc22c00000000, 0x2b50e16200000000, 0x6a4b6d0c00000000,\n    0xa966f9bf00000000, 0xe87d75d100000000, 0x6e3ba00300000000,\n    0x2f202c6d00000000, 0xec0db8de00000000, 0xad1634b000000000,\n    0xa18663a000000000, 0xe09defce00000000, 0x23b07b7d00000000,\n    0x62abf71300000000, 0xe4ed22c100000000, 0xa5f6aeaf00000000,\n    0x66db3a1c00000000, 0x27c0b67200000000, 0xd4ad7c8000000000,\n    0x95b6f0ee00000000, 0x569b645d00000000, 0x1780e83300000000,\n    0x91c63de100000000, 0xd0ddb18f00000000, 0x13f0253c00000000,\n    0x52eba95200000000, 0x5e7bfe4200000000, 0x1f60722c00000000,\n    0xdc4de69f00000000, 0x9d566af100000000, 0x1b10bf2300000000,\n    0x5a0b334d00000000, 0x9926a7fe00000000, 0xd83d2b9000000000,\n    0x810608de00000000, 0xc01d84b000000000, 0x0330100300000000,\n    0x422b9c6d00000000, 0xc46d49bf00000000, 0x8576c5d100000000,\n    0x465b516200000000, 0x0740dd0c00000000, 0x0bd08a1c00000000,\n    0x4acb067200000000, 0x89e692c100000000, 0xc8fd1eaf00000000,\n    0x4ebbcb7d00000000, 0x0fa0471300000000, 0xcc8dd3a000000000,\n    0x8d965fce00000000},\n   {0x0000000000000000, 0x1dfdb50100000000, 0x3afa6b0300000000,\n    0x2707de0200000000, 0x74f4d70600000000, 0x6909620700000000,\n    0x4e0ebc0500000000, 0x53f3090400000000, 0xe8e8af0d00000000,\n    0xf5151a0c00000000, 0xd212c40e00000000, 0xcfef710f00000000,\n    0x9c1c780b00000000, 0x81e1cd0a00000000, 0xa6e6130800000000,\n    0xbb1ba60900000000, 0xd0d15f1b00000000, 0xcd2cea1a00000000,\n    0xea2b341800000000, 0xf7d6811900000000, 0xa425881d00000000,\n    0xb9d83d1c00000000, 0x9edfe31e00000000, 0x8322561f00000000,\n    0x3839f01600000000, 0x25c4451700000000, 0x02c39b1500000000,\n    0x1f3e2e1400000000, 0x4ccd271000000000, 0x5130921100000000,\n    0x76374c1300000000, 0x6bcaf91200000000, 0xa0a3bf3600000000,\n    0xbd5e0a3700000000, 0x9a59d43500000000, 0x87a4613400000000,\n    0xd457683000000000, 0xc9aadd3100000000, 0xeead033300000000,\n    0xf350b63200000000, 0x484b103b00000000, 0x55b6a53a00000000,\n    0x72b17b3800000000, 0x6f4cce3900000000, 0x3cbfc73d00000000,\n    0x2142723c00000000, 0x0645ac3e00000000, 0x1bb8193f00000000,\n    0x7072e02d00000000, 0x6d8f552c00000000, 0x4a888b2e00000000,\n    0x57753e2f00000000, 0x0486372b00000000, 0x197b822a00000000,\n    0x3e7c5c2800000000, 0x2381e92900000000, 0x989a4f2000000000,\n    0x8567fa2100000000, 0xa260242300000000, 0xbf9d912200000000,\n    0xec6e982600000000, 0xf1932d2700000000, 0xd694f32500000000,\n    0xcb69462400000000, 0x40477f6d00000000, 0x5dbaca6c00000000,\n    0x7abd146e00000000, 0x6740a16f00000000, 0x34b3a86b00000000,\n    0x294e1d6a00000000, 0x0e49c36800000000, 0x13b4766900000000,\n    0xa8afd06000000000, 0xb552656100000000, 0x9255bb6300000000,\n    0x8fa80e6200000000, 0xdc5b076600000000, 0xc1a6b26700000000,\n    0xe6a16c6500000000, 0xfb5cd96400000000, 0x9096207600000000,\n    0x8d6b957700000000, 0xaa6c4b7500000000, 0xb791fe7400000000,\n    0xe462f77000000000, 0xf99f427100000000, 0xde989c7300000000,\n    0xc365297200000000, 0x787e8f7b00000000, 0x65833a7a00000000,\n    0x4284e47800000000, 0x5f79517900000000, 0x0c8a587d00000000,\n    0x1177ed7c00000000, 0x3670337e00000000, 0x2b8d867f00000000,\n    0xe0e4c05b00000000, 0xfd19755a00000000, 0xda1eab5800000000,\n    0xc7e31e5900000000, 0x9410175d00000000, 0x89eda25c00000000,\n    0xaeea7c5e00000000, 0xb317c95f00000000, 0x080c6f5600000000,\n    0x15f1da5700000000, 0x32f6045500000000, 0x2f0bb15400000000,\n    0x7cf8b85000000000, 0x61050d5100000000, 0x4602d35300000000,\n    0x5bff665200000000, 0x30359f4000000000, 0x2dc82a4100000000,\n    0x0acff44300000000, 0x1732414200000000, 0x44c1484600000000,\n    0x593cfd4700000000, 0x7e3b234500000000, 0x63c6964400000000,\n    0xd8dd304d00000000, 0xc520854c00000000, 0xe2275b4e00000000,\n    0xffdaee4f00000000, 0xac29e74b00000000, 0xb1d4524a00000000,\n    0x96d38c4800000000, 0x8b2e394900000000, 0x808efeda00000000,\n    0x9d734bdb00000000, 0xba7495d900000000, 0xa78920d800000000,\n    0xf47a29dc00000000, 0xe9879cdd00000000, 0xce8042df00000000,\n    0xd37df7de00000000, 0x686651d700000000, 0x759be4d600000000,\n    0x529c3ad400000000, 0x4f618fd500000000, 0x1c9286d100000000,\n    0x016f33d000000000, 0x2668edd200000000, 0x3b9558d300000000,\n    0x505fa1c100000000, 0x4da214c000000000, 0x6aa5cac200000000,\n    0x77587fc300000000, 0x24ab76c700000000, 0x3956c3c600000000,\n    0x1e511dc400000000, 0x03aca8c500000000, 0xb8b70ecc00000000,\n    0xa54abbcd00000000, 0x824d65cf00000000, 0x9fb0d0ce00000000,\n    0xcc43d9ca00000000, 0xd1be6ccb00000000, 0xf6b9b2c900000000,\n    0xeb4407c800000000, 0x202d41ec00000000, 0x3dd0f4ed00000000,\n    0x1ad72aef00000000, 0x072a9fee00000000, 0x54d996ea00000000,\n    0x492423eb00000000, 0x6e23fde900000000, 0x73de48e800000000,\n    0xc8c5eee100000000, 0xd5385be000000000, 0xf23f85e200000000,\n    0xefc230e300000000, 0xbc3139e700000000, 0xa1cc8ce600000000,\n    0x86cb52e400000000, 0x9b36e7e500000000, 0xf0fc1ef700000000,\n    0xed01abf600000000, 0xca0675f400000000, 0xd7fbc0f500000000,\n    0x8408c9f100000000, 0x99f57cf000000000, 0xbef2a2f200000000,\n    0xa30f17f300000000, 0x1814b1fa00000000, 0x05e904fb00000000,\n    0x22eedaf900000000, 0x3f136ff800000000, 0x6ce066fc00000000,\n    0x711dd3fd00000000, 0x561a0dff00000000, 0x4be7b8fe00000000,\n    0xc0c981b700000000, 0xdd3434b600000000, 0xfa33eab400000000,\n    0xe7ce5fb500000000, 0xb43d56b100000000, 0xa9c0e3b000000000,\n    0x8ec73db200000000, 0x933a88b300000000, 0x28212eba00000000,\n    0x35dc9bbb00000000, 0x12db45b900000000, 0x0f26f0b800000000,\n    0x5cd5f9bc00000000, 0x41284cbd00000000, 0x662f92bf00000000,\n    0x7bd227be00000000, 0x1018deac00000000, 0x0de56bad00000000,\n    0x2ae2b5af00000000, 0x371f00ae00000000, 0x64ec09aa00000000,\n    0x7911bcab00000000, 0x5e1662a900000000, 0x43ebd7a800000000,\n    0xf8f071a100000000, 0xe50dc4a000000000, 0xc20a1aa200000000,\n    0xdff7afa300000000, 0x8c04a6a700000000, 0x91f913a600000000,\n    0xb6fecda400000000, 0xab0378a500000000, 0x606a3e8100000000,\n    0x7d978b8000000000, 0x5a90558200000000, 0x476de08300000000,\n    0x149ee98700000000, 0x09635c8600000000, 0x2e64828400000000,\n    0x3399378500000000, 0x8882918c00000000, 0x957f248d00000000,\n    0xb278fa8f00000000, 0xaf854f8e00000000, 0xfc76468a00000000,\n    0xe18bf38b00000000, 0xc68c2d8900000000, 0xdb71988800000000,\n    0xb0bb619a00000000, 0xad46d49b00000000, 0x8a410a9900000000,\n    0x97bcbf9800000000, 0xc44fb69c00000000, 0xd9b2039d00000000,\n    0xfeb5dd9f00000000, 0xe348689e00000000, 0x5853ce9700000000,\n    0x45ae7b9600000000, 0x62a9a59400000000, 0x7f54109500000000,\n    0x2ca7199100000000, 0x315aac9000000000, 0x165d729200000000,\n    0x0ba0c79300000000},\n   {0x0000000000000000, 0x24d9076300000000, 0x48b20fc600000000,\n    0x6c6b08a500000000, 0xd1626e5700000000, 0xf5bb693400000000,\n    0x99d0619100000000, 0xbd0966f200000000, 0xa2c5dcae00000000,\n    0x861cdbcd00000000, 0xea77d36800000000, 0xceaed40b00000000,\n    0x73a7b2f900000000, 0x577eb59a00000000, 0x3b15bd3f00000000,\n    0x1fccba5c00000000, 0x058dc88600000000, 0x2154cfe500000000,\n    0x4d3fc74000000000, 0x69e6c02300000000, 0xd4efa6d100000000,\n    0xf036a1b200000000, 0x9c5da91700000000, 0xb884ae7400000000,\n    0xa748142800000000, 0x8391134b00000000, 0xeffa1bee00000000,\n    0xcb231c8d00000000, 0x762a7a7f00000000, 0x52f37d1c00000000,\n    0x3e9875b900000000, 0x1a4172da00000000, 0x4b1ce0d600000000,\n    0x6fc5e7b500000000, 0x03aeef1000000000, 0x2777e87300000000,\n    0x9a7e8e8100000000, 0xbea789e200000000, 0xd2cc814700000000,\n    0xf615862400000000, 0xe9d93c7800000000, 0xcd003b1b00000000,\n    0xa16b33be00000000, 0x85b234dd00000000, 0x38bb522f00000000,\n    0x1c62554c00000000, 0x70095de900000000, 0x54d05a8a00000000,\n    0x4e91285000000000, 0x6a482f3300000000, 0x0623279600000000,\n    0x22fa20f500000000, 0x9ff3460700000000, 0xbb2a416400000000,\n    0xd74149c100000000, 0xf3984ea200000000, 0xec54f4fe00000000,\n    0xc88df39d00000000, 0xa4e6fb3800000000, 0x803ffc5b00000000,\n    0x3d369aa900000000, 0x19ef9dca00000000, 0x7584956f00000000,\n    0x515d920c00000000, 0xd73eb17600000000, 0xf3e7b61500000000,\n    0x9f8cbeb000000000, 0xbb55b9d300000000, 0x065cdf2100000000,\n    0x2285d84200000000, 0x4eeed0e700000000, 0x6a37d78400000000,\n    0x75fb6dd800000000, 0x51226abb00000000, 0x3d49621e00000000,\n    0x1990657d00000000, 0xa499038f00000000, 0x804004ec00000000,\n    0xec2b0c4900000000, 0xc8f20b2a00000000, 0xd2b379f000000000,\n    0xf66a7e9300000000, 0x9a01763600000000, 0xbed8715500000000,\n    0x03d117a700000000, 0x270810c400000000, 0x4b63186100000000,\n    0x6fba1f0200000000, 0x7076a55e00000000, 0x54afa23d00000000,\n    0x38c4aa9800000000, 0x1c1dadfb00000000, 0xa114cb0900000000,\n    0x85cdcc6a00000000, 0xe9a6c4cf00000000, 0xcd7fc3ac00000000,\n    0x9c2251a000000000, 0xb8fb56c300000000, 0xd4905e6600000000,\n    0xf049590500000000, 0x4d403ff700000000, 0x6999389400000000,\n    0x05f2303100000000, 0x212b375200000000, 0x3ee78d0e00000000,\n    0x1a3e8a6d00000000, 0x765582c800000000, 0x528c85ab00000000,\n    0xef85e35900000000, 0xcb5ce43a00000000, 0xa737ec9f00000000,\n    0x83eeebfc00000000, 0x99af992600000000, 0xbd769e4500000000,\n    0xd11d96e000000000, 0xf5c4918300000000, 0x48cdf77100000000,\n    0x6c14f01200000000, 0x007ff8b700000000, 0x24a6ffd400000000,\n    0x3b6a458800000000, 0x1fb342eb00000000, 0x73d84a4e00000000,\n    0x57014d2d00000000, 0xea082bdf00000000, 0xced12cbc00000000,\n    0xa2ba241900000000, 0x8663237a00000000, 0xae7d62ed00000000,\n    0x8aa4658e00000000, 0xe6cf6d2b00000000, 0xc2166a4800000000,\n    0x7f1f0cba00000000, 0x5bc60bd900000000, 0x37ad037c00000000,\n    0x1374041f00000000, 0x0cb8be4300000000, 0x2861b92000000000,\n    0x440ab18500000000, 0x60d3b6e600000000, 0xdddad01400000000,\n    0xf903d77700000000, 0x9568dfd200000000, 0xb1b1d8b100000000,\n    0xabf0aa6b00000000, 0x8f29ad0800000000, 0xe342a5ad00000000,\n    0xc79ba2ce00000000, 0x7a92c43c00000000, 0x5e4bc35f00000000,\n    0x3220cbfa00000000, 0x16f9cc9900000000, 0x093576c500000000,\n    0x2dec71a600000000, 0x4187790300000000, 0x655e7e6000000000,\n    0xd857189200000000, 0xfc8e1ff100000000, 0x90e5175400000000,\n    0xb43c103700000000, 0xe561823b00000000, 0xc1b8855800000000,\n    0xadd38dfd00000000, 0x890a8a9e00000000, 0x3403ec6c00000000,\n    0x10daeb0f00000000, 0x7cb1e3aa00000000, 0x5868e4c900000000,\n    0x47a45e9500000000, 0x637d59f600000000, 0x0f16515300000000,\n    0x2bcf563000000000, 0x96c630c200000000, 0xb21f37a100000000,\n    0xde743f0400000000, 0xfaad386700000000, 0xe0ec4abd00000000,\n    0xc4354dde00000000, 0xa85e457b00000000, 0x8c87421800000000,\n    0x318e24ea00000000, 0x1557238900000000, 0x793c2b2c00000000,\n    0x5de52c4f00000000, 0x4229961300000000, 0x66f0917000000000,\n    0x0a9b99d500000000, 0x2e429eb600000000, 0x934bf84400000000,\n    0xb792ff2700000000, 0xdbf9f78200000000, 0xff20f0e100000000,\n    0x7943d39b00000000, 0x5d9ad4f800000000, 0x31f1dc5d00000000,\n    0x1528db3e00000000, 0xa821bdcc00000000, 0x8cf8baaf00000000,\n    0xe093b20a00000000, 0xc44ab56900000000, 0xdb860f3500000000,\n    0xff5f085600000000, 0x933400f300000000, 0xb7ed079000000000,\n    0x0ae4616200000000, 0x2e3d660100000000, 0x42566ea400000000,\n    0x668f69c700000000, 0x7cce1b1d00000000, 0x58171c7e00000000,\n    0x347c14db00000000, 0x10a513b800000000, 0xadac754a00000000,\n    0x8975722900000000, 0xe51e7a8c00000000, 0xc1c77def00000000,\n    0xde0bc7b300000000, 0xfad2c0d000000000, 0x96b9c87500000000,\n    0xb260cf1600000000, 0x0f69a9e400000000, 0x2bb0ae8700000000,\n    0x47dba62200000000, 0x6302a14100000000, 0x325f334d00000000,\n    0x1686342e00000000, 0x7aed3c8b00000000, 0x5e343be800000000,\n    0xe33d5d1a00000000, 0xc7e45a7900000000, 0xab8f52dc00000000,\n    0x8f5655bf00000000, 0x909aefe300000000, 0xb443e88000000000,\n    0xd828e02500000000, 0xfcf1e74600000000, 0x41f881b400000000,\n    0x652186d700000000, 0x094a8e7200000000, 0x2d93891100000000,\n    0x37d2fbcb00000000, 0x130bfca800000000, 0x7f60f40d00000000,\n    0x5bb9f36e00000000, 0xe6b0959c00000000, 0xc26992ff00000000,\n    0xae029a5a00000000, 0x8adb9d3900000000, 0x9517276500000000,\n    0xb1ce200600000000, 0xdda528a300000000, 0xf97c2fc000000000,\n    0x4475493200000000, 0x60ac4e5100000000, 0x0cc746f400000000,\n    0x281e419700000000},\n   {0x0000000000000000, 0x08e3603c00000000, 0x10c6c17800000000,\n    0x1825a14400000000, 0x208c83f100000000, 0x286fe3cd00000000,\n    0x304a428900000000, 0x38a922b500000000, 0x011e763800000000,\n    0x09fd160400000000, 0x11d8b74000000000, 0x193bd77c00000000,\n    0x2192f5c900000000, 0x297195f500000000, 0x315434b100000000,\n    0x39b7548d00000000, 0x023cec7000000000, 0x0adf8c4c00000000,\n    0x12fa2d0800000000, 0x1a194d3400000000, 0x22b06f8100000000,\n    0x2a530fbd00000000, 0x3276aef900000000, 0x3a95cec500000000,\n    0x03229a4800000000, 0x0bc1fa7400000000, 0x13e45b3000000000,\n    0x1b073b0c00000000, 0x23ae19b900000000, 0x2b4d798500000000,\n    0x3368d8c100000000, 0x3b8bb8fd00000000, 0x0478d8e100000000,\n    0x0c9bb8dd00000000, 0x14be199900000000, 0x1c5d79a500000000,\n    0x24f45b1000000000, 0x2c173b2c00000000, 0x34329a6800000000,\n    0x3cd1fa5400000000, 0x0566aed900000000, 0x0d85cee500000000,\n    0x15a06fa100000000, 0x1d430f9d00000000, 0x25ea2d2800000000,\n    0x2d094d1400000000, 0x352cec5000000000, 0x3dcf8c6c00000000,\n    0x0644349100000000, 0x0ea754ad00000000, 0x1682f5e900000000,\n    0x1e6195d500000000, 0x26c8b76000000000, 0x2e2bd75c00000000,\n    0x360e761800000000, 0x3eed162400000000, 0x075a42a900000000,\n    0x0fb9229500000000, 0x179c83d100000000, 0x1f7fe3ed00000000,\n    0x27d6c15800000000, 0x2f35a16400000000, 0x3710002000000000,\n    0x3ff3601c00000000, 0x49f6c11800000000, 0x4115a12400000000,\n    0x5930006000000000, 0x51d3605c00000000, 0x697a42e900000000,\n    0x619922d500000000, 0x79bc839100000000, 0x715fe3ad00000000,\n    0x48e8b72000000000, 0x400bd71c00000000, 0x582e765800000000,\n    0x50cd166400000000, 0x686434d100000000, 0x608754ed00000000,\n    0x78a2f5a900000000, 0x7041959500000000, 0x4bca2d6800000000,\n    0x43294d5400000000, 0x5b0cec1000000000, 0x53ef8c2c00000000,\n    0x6b46ae9900000000, 0x63a5cea500000000, 0x7b806fe100000000,\n    0x73630fdd00000000, 0x4ad45b5000000000, 0x42373b6c00000000,\n    0x5a129a2800000000, 0x52f1fa1400000000, 0x6a58d8a100000000,\n    0x62bbb89d00000000, 0x7a9e19d900000000, 0x727d79e500000000,\n    0x4d8e19f900000000, 0x456d79c500000000, 0x5d48d88100000000,\n    0x55abb8bd00000000, 0x6d029a0800000000, 0x65e1fa3400000000,\n    0x7dc45b7000000000, 0x75273b4c00000000, 0x4c906fc100000000,\n    0x44730ffd00000000, 0x5c56aeb900000000, 0x54b5ce8500000000,\n    0x6c1cec3000000000, 0x64ff8c0c00000000, 0x7cda2d4800000000,\n    0x74394d7400000000, 0x4fb2f58900000000, 0x475195b500000000,\n    0x5f7434f100000000, 0x579754cd00000000, 0x6f3e767800000000,\n    0x67dd164400000000, 0x7ff8b70000000000, 0x771bd73c00000000,\n    0x4eac83b100000000, 0x464fe38d00000000, 0x5e6a42c900000000,\n    0x568922f500000000, 0x6e20004000000000, 0x66c3607c00000000,\n    0x7ee6c13800000000, 0x7605a10400000000, 0x92ec833100000000,\n    0x9a0fe30d00000000, 0x822a424900000000, 0x8ac9227500000000,\n    0xb26000c000000000, 0xba8360fc00000000, 0xa2a6c1b800000000,\n    0xaa45a18400000000, 0x93f2f50900000000, 0x9b11953500000000,\n    0x8334347100000000, 0x8bd7544d00000000, 0xb37e76f800000000,\n    0xbb9d16c400000000, 0xa3b8b78000000000, 0xab5bd7bc00000000,\n    0x90d06f4100000000, 0x98330f7d00000000, 0x8016ae3900000000,\n    0x88f5ce0500000000, 0xb05cecb000000000, 0xb8bf8c8c00000000,\n    0xa09a2dc800000000, 0xa8794df400000000, 0x91ce197900000000,\n    0x992d794500000000, 0x8108d80100000000, 0x89ebb83d00000000,\n    0xb1429a8800000000, 0xb9a1fab400000000, 0xa1845bf000000000,\n    0xa9673bcc00000000, 0x96945bd000000000, 0x9e773bec00000000,\n    0x86529aa800000000, 0x8eb1fa9400000000, 0xb618d82100000000,\n    0xbefbb81d00000000, 0xa6de195900000000, 0xae3d796500000000,\n    0x978a2de800000000, 0x9f694dd400000000, 0x874cec9000000000,\n    0x8faf8cac00000000, 0xb706ae1900000000, 0xbfe5ce2500000000,\n    0xa7c06f6100000000, 0xaf230f5d00000000, 0x94a8b7a000000000,\n    0x9c4bd79c00000000, 0x846e76d800000000, 0x8c8d16e400000000,\n    0xb424345100000000, 0xbcc7546d00000000, 0xa4e2f52900000000,\n    0xac01951500000000, 0x95b6c19800000000, 0x9d55a1a400000000,\n    0x857000e000000000, 0x8d9360dc00000000, 0xb53a426900000000,\n    0xbdd9225500000000, 0xa5fc831100000000, 0xad1fe32d00000000,\n    0xdb1a422900000000, 0xd3f9221500000000, 0xcbdc835100000000,\n    0xc33fe36d00000000, 0xfb96c1d800000000, 0xf375a1e400000000,\n    0xeb5000a000000000, 0xe3b3609c00000000, 0xda04341100000000,\n    0xd2e7542d00000000, 0xcac2f56900000000, 0xc221955500000000,\n    0xfa88b7e000000000, 0xf26bd7dc00000000, 0xea4e769800000000,\n    0xe2ad16a400000000, 0xd926ae5900000000, 0xd1c5ce6500000000,\n    0xc9e06f2100000000, 0xc1030f1d00000000, 0xf9aa2da800000000,\n    0xf1494d9400000000, 0xe96cecd000000000, 0xe18f8cec00000000,\n    0xd838d86100000000, 0xd0dbb85d00000000, 0xc8fe191900000000,\n    0xc01d792500000000, 0xf8b45b9000000000, 0xf0573bac00000000,\n    0xe8729ae800000000, 0xe091fad400000000, 0xdf629ac800000000,\n    0xd781faf400000000, 0xcfa45bb000000000, 0xc7473b8c00000000,\n    0xffee193900000000, 0xf70d790500000000, 0xef28d84100000000,\n    0xe7cbb87d00000000, 0xde7cecf000000000, 0xd69f8ccc00000000,\n    0xceba2d8800000000, 0xc6594db400000000, 0xfef06f0100000000,\n    0xf6130f3d00000000, 0xee36ae7900000000, 0xe6d5ce4500000000,\n    0xdd5e76b800000000, 0xd5bd168400000000, 0xcd98b7c000000000,\n    0xc57bd7fc00000000, 0xfdd2f54900000000, 0xf531957500000000,\n    0xed14343100000000, 0xe5f7540d00000000, 0xdc40008000000000,\n    0xd4a360bc00000000, 0xcc86c1f800000000, 0xc465a1c400000000,\n    0xfccc837100000000, 0xf42fe34d00000000, 0xec0a420900000000,\n    0xe4e9223500000000},\n   {0x0000000000000000, 0xd1e8e70e00000000, 0xa2d1cf1d00000000,\n    0x7339281300000000, 0x44a39f3b00000000, 0x954b783500000000,\n    0xe672502600000000, 0x379ab72800000000, 0x88463f7700000000,\n    0x59aed87900000000, 0x2a97f06a00000000, 0xfb7f176400000000,\n    0xcce5a04c00000000, 0x1d0d474200000000, 0x6e346f5100000000,\n    0xbfdc885f00000000, 0x108d7eee00000000, 0xc16599e000000000,\n    0xb25cb1f300000000, 0x63b456fd00000000, 0x542ee1d500000000,\n    0x85c606db00000000, 0xf6ff2ec800000000, 0x2717c9c600000000,\n    0x98cb419900000000, 0x4923a69700000000, 0x3a1a8e8400000000,\n    0xebf2698a00000000, 0xdc68dea200000000, 0x0d8039ac00000000,\n    0x7eb911bf00000000, 0xaf51f6b100000000, 0x611c8c0700000000,\n    0xb0f46b0900000000, 0xc3cd431a00000000, 0x1225a41400000000,\n    0x25bf133c00000000, 0xf457f43200000000, 0x876edc2100000000,\n    0x56863b2f00000000, 0xe95ab37000000000, 0x38b2547e00000000,\n    0x4b8b7c6d00000000, 0x9a639b6300000000, 0xadf92c4b00000000,\n    0x7c11cb4500000000, 0x0f28e35600000000, 0xdec0045800000000,\n    0x7191f2e900000000, 0xa07915e700000000, 0xd3403df400000000,\n    0x02a8dafa00000000, 0x35326dd200000000, 0xe4da8adc00000000,\n    0x97e3a2cf00000000, 0x460b45c100000000, 0xf9d7cd9e00000000,\n    0x283f2a9000000000, 0x5b06028300000000, 0x8aeee58d00000000,\n    0xbd7452a500000000, 0x6c9cb5ab00000000, 0x1fa59db800000000,\n    0xce4d7ab600000000, 0xc238180f00000000, 0x13d0ff0100000000,\n    0x60e9d71200000000, 0xb101301c00000000, 0x869b873400000000,\n    0x5773603a00000000, 0x244a482900000000, 0xf5a2af2700000000,\n    0x4a7e277800000000, 0x9b96c07600000000, 0xe8afe86500000000,\n    0x39470f6b00000000, 0x0eddb84300000000, 0xdf355f4d00000000,\n    0xac0c775e00000000, 0x7de4905000000000, 0xd2b566e100000000,\n    0x035d81ef00000000, 0x7064a9fc00000000, 0xa18c4ef200000000,\n    0x9616f9da00000000, 0x47fe1ed400000000, 0x34c736c700000000,\n    0xe52fd1c900000000, 0x5af3599600000000, 0x8b1bbe9800000000,\n    0xf822968b00000000, 0x29ca718500000000, 0x1e50c6ad00000000,\n    0xcfb821a300000000, 0xbc8109b000000000, 0x6d69eebe00000000,\n    0xa324940800000000, 0x72cc730600000000, 0x01f55b1500000000,\n    0xd01dbc1b00000000, 0xe7870b3300000000, 0x366fec3d00000000,\n    0x4556c42e00000000, 0x94be232000000000, 0x2b62ab7f00000000,\n    0xfa8a4c7100000000, 0x89b3646200000000, 0x585b836c00000000,\n    0x6fc1344400000000, 0xbe29d34a00000000, 0xcd10fb5900000000,\n    0x1cf81c5700000000, 0xb3a9eae600000000, 0x62410de800000000,\n    0x117825fb00000000, 0xc090c2f500000000, 0xf70a75dd00000000,\n    0x26e292d300000000, 0x55dbbac000000000, 0x84335dce00000000,\n    0x3befd59100000000, 0xea07329f00000000, 0x993e1a8c00000000,\n    0x48d6fd8200000000, 0x7f4c4aaa00000000, 0xaea4ada400000000,\n    0xdd9d85b700000000, 0x0c7562b900000000, 0x8471301e00000000,\n    0x5599d71000000000, 0x26a0ff0300000000, 0xf748180d00000000,\n    0xc0d2af2500000000, 0x113a482b00000000, 0x6203603800000000,\n    0xb3eb873600000000, 0x0c370f6900000000, 0xdddfe86700000000,\n    0xaee6c07400000000, 0x7f0e277a00000000, 0x4894905200000000,\n    0x997c775c00000000, 0xea455f4f00000000, 0x3badb84100000000,\n    0x94fc4ef000000000, 0x4514a9fe00000000, 0x362d81ed00000000,\n    0xe7c566e300000000, 0xd05fd1cb00000000, 0x01b736c500000000,\n    0x728e1ed600000000, 0xa366f9d800000000, 0x1cba718700000000,\n    0xcd52968900000000, 0xbe6bbe9a00000000, 0x6f83599400000000,\n    0x5819eebc00000000, 0x89f109b200000000, 0xfac821a100000000,\n    0x2b20c6af00000000, 0xe56dbc1900000000, 0x34855b1700000000,\n    0x47bc730400000000, 0x9654940a00000000, 0xa1ce232200000000,\n    0x7026c42c00000000, 0x031fec3f00000000, 0xd2f70b3100000000,\n    0x6d2b836e00000000, 0xbcc3646000000000, 0xcffa4c7300000000,\n    0x1e12ab7d00000000, 0x29881c5500000000, 0xf860fb5b00000000,\n    0x8b59d34800000000, 0x5ab1344600000000, 0xf5e0c2f700000000,\n    0x240825f900000000, 0x57310dea00000000, 0x86d9eae400000000,\n    0xb1435dcc00000000, 0x60abbac200000000, 0x139292d100000000,\n    0xc27a75df00000000, 0x7da6fd8000000000, 0xac4e1a8e00000000,\n    0xdf77329d00000000, 0x0e9fd59300000000, 0x390562bb00000000,\n    0xe8ed85b500000000, 0x9bd4ada600000000, 0x4a3c4aa800000000,\n    0x4649281100000000, 0x97a1cf1f00000000, 0xe498e70c00000000,\n    0x3570000200000000, 0x02eab72a00000000, 0xd302502400000000,\n    0xa03b783700000000, 0x71d39f3900000000, 0xce0f176600000000,\n    0x1fe7f06800000000, 0x6cded87b00000000, 0xbd363f7500000000,\n    0x8aac885d00000000, 0x5b446f5300000000, 0x287d474000000000,\n    0xf995a04e00000000, 0x56c456ff00000000, 0x872cb1f100000000,\n    0xf41599e200000000, 0x25fd7eec00000000, 0x1267c9c400000000,\n    0xc38f2eca00000000, 0xb0b606d900000000, 0x615ee1d700000000,\n    0xde82698800000000, 0x0f6a8e8600000000, 0x7c53a69500000000,\n    0xadbb419b00000000, 0x9a21f6b300000000, 0x4bc911bd00000000,\n    0x38f039ae00000000, 0xe918dea000000000, 0x2755a41600000000,\n    0xf6bd431800000000, 0x85846b0b00000000, 0x546c8c0500000000,\n    0x63f63b2d00000000, 0xb21edc2300000000, 0xc127f43000000000,\n    0x10cf133e00000000, 0xaf139b6100000000, 0x7efb7c6f00000000,\n    0x0dc2547c00000000, 0xdc2ab37200000000, 0xebb0045a00000000,\n    0x3a58e35400000000, 0x4961cb4700000000, 0x98892c4900000000,\n    0x37d8daf800000000, 0xe6303df600000000, 0x950915e500000000,\n    0x44e1f2eb00000000, 0x737b45c300000000, 0xa293a2cd00000000,\n    0xd1aa8ade00000000, 0x00426dd000000000, 0xbf9ee58f00000000,\n    0x6e76028100000000, 0x1d4f2a9200000000, 0xcca7cd9c00000000,\n    0xfb3d7ab400000000, 0x2ad59dba00000000, 0x59ecb5a900000000,\n    0x880452a700000000},\n   {0x0000000000000000, 0xaa05daf100000000, 0x150dc53800000000,\n    0xbf081fc900000000, 0x2a1a8a7100000000, 0x801f508000000000,\n    0x3f174f4900000000, 0x951295b800000000, 0x543414e300000000,\n    0xfe31ce1200000000, 0x4139d1db00000000, 0xeb3c0b2a00000000,\n    0x7e2e9e9200000000, 0xd42b446300000000, 0x6b235baa00000000,\n    0xc126815b00000000, 0xe96e591d00000000, 0x436b83ec00000000,\n    0xfc639c2500000000, 0x566646d400000000, 0xc374d36c00000000,\n    0x6971099d00000000, 0xd679165400000000, 0x7c7ccca500000000,\n    0xbd5a4dfe00000000, 0x175f970f00000000, 0xa85788c600000000,\n    0x0252523700000000, 0x9740c78f00000000, 0x3d451d7e00000000,\n    0x824d02b700000000, 0x2848d84600000000, 0xd2ddb23a00000000,\n    0x78d868cb00000000, 0xc7d0770200000000, 0x6dd5adf300000000,\n    0xf8c7384b00000000, 0x52c2e2ba00000000, 0xedcafd7300000000,\n    0x47cf278200000000, 0x86e9a6d900000000, 0x2cec7c2800000000,\n    0x93e463e100000000, 0x39e1b91000000000, 0xacf32ca800000000,\n    0x06f6f65900000000, 0xb9fee99000000000, 0x13fb336100000000,\n    0x3bb3eb2700000000, 0x91b631d600000000, 0x2ebe2e1f00000000,\n    0x84bbf4ee00000000, 0x11a9615600000000, 0xbbacbba700000000,\n    0x04a4a46e00000000, 0xaea17e9f00000000, 0x6f87ffc400000000,\n    0xc582253500000000, 0x7a8a3afc00000000, 0xd08fe00d00000000,\n    0x459d75b500000000, 0xef98af4400000000, 0x5090b08d00000000,\n    0xfa956a7c00000000, 0xa4bb657500000000, 0x0ebebf8400000000,\n    0xb1b6a04d00000000, 0x1bb37abc00000000, 0x8ea1ef0400000000,\n    0x24a435f500000000, 0x9bac2a3c00000000, 0x31a9f0cd00000000,\n    0xf08f719600000000, 0x5a8aab6700000000, 0xe582b4ae00000000,\n    0x4f876e5f00000000, 0xda95fbe700000000, 0x7090211600000000,\n    0xcf983edf00000000, 0x659de42e00000000, 0x4dd53c6800000000,\n    0xe7d0e69900000000, 0x58d8f95000000000, 0xf2dd23a100000000,\n    0x67cfb61900000000, 0xcdca6ce800000000, 0x72c2732100000000,\n    0xd8c7a9d000000000, 0x19e1288b00000000, 0xb3e4f27a00000000,\n    0x0cecedb300000000, 0xa6e9374200000000, 0x33fba2fa00000000,\n    0x99fe780b00000000, 0x26f667c200000000, 0x8cf3bd3300000000,\n    0x7666d74f00000000, 0xdc630dbe00000000, 0x636b127700000000,\n    0xc96ec88600000000, 0x5c7c5d3e00000000, 0xf67987cf00000000,\n    0x4971980600000000, 0xe37442f700000000, 0x2252c3ac00000000,\n    0x8857195d00000000, 0x375f069400000000, 0x9d5adc6500000000,\n    0x084849dd00000000, 0xa24d932c00000000, 0x1d458ce500000000,\n    0xb740561400000000, 0x9f088e5200000000, 0x350d54a300000000,\n    0x8a054b6a00000000, 0x2000919b00000000, 0xb512042300000000,\n    0x1f17ded200000000, 0xa01fc11b00000000, 0x0a1a1bea00000000,\n    0xcb3c9ab100000000, 0x6139404000000000, 0xde315f8900000000,\n    0x7434857800000000, 0xe12610c000000000, 0x4b23ca3100000000,\n    0xf42bd5f800000000, 0x5e2e0f0900000000, 0x4877cbea00000000,\n    0xe272111b00000000, 0x5d7a0ed200000000, 0xf77fd42300000000,\n    0x626d419b00000000, 0xc8689b6a00000000, 0x776084a300000000,\n    0xdd655e5200000000, 0x1c43df0900000000, 0xb64605f800000000,\n    0x094e1a3100000000, 0xa34bc0c000000000, 0x3659557800000000,\n    0x9c5c8f8900000000, 0x2354904000000000, 0x89514ab100000000,\n    0xa11992f700000000, 0x0b1c480600000000, 0xb41457cf00000000,\n    0x1e118d3e00000000, 0x8b03188600000000, 0x2106c27700000000,\n    0x9e0eddbe00000000, 0x340b074f00000000, 0xf52d861400000000,\n    0x5f285ce500000000, 0xe020432c00000000, 0x4a2599dd00000000,\n    0xdf370c6500000000, 0x7532d69400000000, 0xca3ac95d00000000,\n    0x603f13ac00000000, 0x9aaa79d000000000, 0x30afa32100000000,\n    0x8fa7bce800000000, 0x25a2661900000000, 0xb0b0f3a100000000,\n    0x1ab5295000000000, 0xa5bd369900000000, 0x0fb8ec6800000000,\n    0xce9e6d3300000000, 0x649bb7c200000000, 0xdb93a80b00000000,\n    0x719672fa00000000, 0xe484e74200000000, 0x4e813db300000000,\n    0xf189227a00000000, 0x5b8cf88b00000000, 0x73c420cd00000000,\n    0xd9c1fa3c00000000, 0x66c9e5f500000000, 0xcccc3f0400000000,\n    0x59deaabc00000000, 0xf3db704d00000000, 0x4cd36f8400000000,\n    0xe6d6b57500000000, 0x27f0342e00000000, 0x8df5eedf00000000,\n    0x32fdf11600000000, 0x98f82be700000000, 0x0deabe5f00000000,\n    0xa7ef64ae00000000, 0x18e77b6700000000, 0xb2e2a19600000000,\n    0xecccae9f00000000, 0x46c9746e00000000, 0xf9c16ba700000000,\n    0x53c4b15600000000, 0xc6d624ee00000000, 0x6cd3fe1f00000000,\n    0xd3dbe1d600000000, 0x79de3b2700000000, 0xb8f8ba7c00000000,\n    0x12fd608d00000000, 0xadf57f4400000000, 0x07f0a5b500000000,\n    0x92e2300d00000000, 0x38e7eafc00000000, 0x87eff53500000000,\n    0x2dea2fc400000000, 0x05a2f78200000000, 0xafa72d7300000000,\n    0x10af32ba00000000, 0xbaaae84b00000000, 0x2fb87df300000000,\n    0x85bda70200000000, 0x3ab5b8cb00000000, 0x90b0623a00000000,\n    0x5196e36100000000, 0xfb93399000000000, 0x449b265900000000,\n    0xee9efca800000000, 0x7b8c691000000000, 0xd189b3e100000000,\n    0x6e81ac2800000000, 0xc48476d900000000, 0x3e111ca500000000,\n    0x9414c65400000000, 0x2b1cd99d00000000, 0x8119036c00000000,\n    0x140b96d400000000, 0xbe0e4c2500000000, 0x010653ec00000000,\n    0xab03891d00000000, 0x6a25084600000000, 0xc020d2b700000000,\n    0x7f28cd7e00000000, 0xd52d178f00000000, 0x403f823700000000,\n    0xea3a58c600000000, 0x5532470f00000000, 0xff379dfe00000000,\n    0xd77f45b800000000, 0x7d7a9f4900000000, 0xc272808000000000,\n    0x68775a7100000000, 0xfd65cfc900000000, 0x5760153800000000,\n    0xe8680af100000000, 0x426dd00000000000, 0x834b515b00000000,\n    0x294e8baa00000000, 0x9646946300000000, 0x3c434e9200000000,\n    0xa951db2a00000000, 0x035401db00000000, 0xbc5c1e1200000000,\n    0x1659c4e300000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87,\n    0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede,\n    0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab,\n    0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c,\n    0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1,\n    0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7,\n    0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e,\n    0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308,\n    0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5,\n    0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472,\n    0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07,\n    0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e,\n    0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa,\n    0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec,\n    0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6,\n    0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0,\n    0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3,\n    0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba,\n    0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf,\n    0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975,\n    0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8,\n    0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde,\n    0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a,\n    0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c,\n    0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1,\n    0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65,\n    0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410,\n    0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649,\n    0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a,\n    0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c,\n    0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946,\n    0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450,\n    0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e,\n    0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857,\n    0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022,\n    0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5,\n    0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758,\n    0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e,\n    0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d,\n    0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b,\n    0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6,\n    0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401,\n    0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74,\n    0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d,\n    0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073,\n    0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65,\n    0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f,\n    0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749,\n    0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a,\n    0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033,\n    0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846,\n    0x0d7139d7},\n   {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563,\n    0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f,\n    0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875,\n    0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536,\n    0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8,\n    0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43,\n    0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f,\n    0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184,\n    0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a,\n    0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39,\n    0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523,\n    0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f,\n    0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d,\n    0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6,\n    0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b,\n    0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0,\n    0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151,\n    0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d,\n    0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47,\n    0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a,\n    0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964,\n    0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef,\n    0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d,\n    0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6,\n    0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348,\n    0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53,\n    0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449,\n    0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645,\n    0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4,\n    0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f,\n    0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2,\n    0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69,\n    0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46,\n    0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a,\n    0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650,\n    0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13,\n    0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded,\n    0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366,\n    0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57,\n    0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc,\n    0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222,\n    0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61,\n    0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b,\n    0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277,\n    0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558,\n    0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3,\n    0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e,\n    0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5,\n    0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74,\n    0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78,\n    0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262,\n    0x1c53e98a},\n   {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b,\n    0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40,\n    0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580,\n    0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7,\n    0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a,\n    0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37,\n    0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75,\n    0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218,\n    0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5,\n    0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2,\n    0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02,\n    0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59,\n    0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1,\n    0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c,\n    0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a,\n    0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307,\n    0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486,\n    0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd,\n    0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d,\n    0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2,\n    0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f,\n    0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72,\n    0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8,\n    0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985,\n    0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268,\n    0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94,\n    0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454,\n    0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f,\n    0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e,\n    0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3,\n    0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915,\n    0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778,\n    0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821,\n    0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a,\n    0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba,\n    0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d,\n    0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560,\n    0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d,\n    0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe,\n    0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3,\n    0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e,\n    0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509,\n    0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9,\n    0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92,\n    0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb,\n    0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6,\n    0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50,\n    0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d,\n    0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc,\n    0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7,\n    0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927,\n    0x3f88e851},\n   {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96,\n    0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8,\n    0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0,\n    0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14,\n    0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7,\n    0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4,\n    0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe,\n    0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad,\n    0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e,\n    0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa,\n    0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2,\n    0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c,\n    0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab,\n    0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8,\n    0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d,\n    0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e,\n    0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7,\n    0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99,\n    0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1,\n    0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690,\n    0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933,\n    0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20,\n    0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf,\n    0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc,\n    0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f,\n    0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92,\n    0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca,\n    0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4,\n    0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd,\n    0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de,\n    0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb,\n    0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8,\n    0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474,\n    0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a,\n    0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252,\n    0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6,\n    0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55,\n    0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846,\n    0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7,\n    0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4,\n    0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47,\n    0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3,\n    0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb,\n    0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5,\n    0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49,\n    0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a,\n    0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f,\n    0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c,\n    0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305,\n    0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b,\n    0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523,\n    0x3dee8ca6}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0x85d996dd, 0x4bb55c60, 0xce6ccabd, 0x966ab9c0,\n    0x13b32f1d, 0xdddfe5a0, 0x5806737d, 0x6dd3035a, 0xe80a9587,\n    0x26665f3a, 0xa3bfc9e7, 0xfbb9ba9a, 0x7e602c47, 0xb00ce6fa,\n    0x35d57027, 0xdaa607b4, 0x5f7f9169, 0x91135bd4, 0x14cacd09,\n    0x4cccbe74, 0xc91528a9, 0x0779e214, 0x82a074c9, 0xb77504ee,\n    0x32ac9233, 0xfcc0588e, 0x7919ce53, 0x211fbd2e, 0xa4c62bf3,\n    0x6aaae14e, 0xef737793, 0xf54b7eb3, 0x7092e86e, 0xbefe22d3,\n    0x3b27b40e, 0x6321c773, 0xe6f851ae, 0x28949b13, 0xad4d0dce,\n    0x98987de9, 0x1d41eb34, 0xd32d2189, 0x56f4b754, 0x0ef2c429,\n    0x8b2b52f4, 0x45479849, 0xc09e0e94, 0x2fed7907, 0xaa34efda,\n    0x64582567, 0xe181b3ba, 0xb987c0c7, 0x3c5e561a, 0xf2329ca7,\n    0x77eb0a7a, 0x423e7a5d, 0xc7e7ec80, 0x098b263d, 0x8c52b0e0,\n    0xd454c39d, 0x518d5540, 0x9fe19ffd, 0x1a380920, 0xab918dbd,\n    0x2e481b60, 0xe024d1dd, 0x65fd4700, 0x3dfb347d, 0xb822a2a0,\n    0x764e681d, 0xf397fec0, 0xc6428ee7, 0x439b183a, 0x8df7d287,\n    0x082e445a, 0x50283727, 0xd5f1a1fa, 0x1b9d6b47, 0x9e44fd9a,\n    0x71378a09, 0xf4ee1cd4, 0x3a82d669, 0xbf5b40b4, 0xe75d33c9,\n    0x6284a514, 0xace86fa9, 0x2931f974, 0x1ce48953, 0x993d1f8e,\n    0x5751d533, 0xd28843ee, 0x8a8e3093, 0x0f57a64e, 0xc13b6cf3,\n    0x44e2fa2e, 0x5edaf30e, 0xdb0365d3, 0x156faf6e, 0x90b639b3,\n    0xc8b04ace, 0x4d69dc13, 0x830516ae, 0x06dc8073, 0x3309f054,\n    0xb6d06689, 0x78bcac34, 0xfd653ae9, 0xa5634994, 0x20badf49,\n    0xeed615f4, 0x6b0f8329, 0x847cf4ba, 0x01a56267, 0xcfc9a8da,\n    0x4a103e07, 0x12164d7a, 0x97cfdba7, 0x59a3111a, 0xdc7a87c7,\n    0xe9aff7e0, 0x6c76613d, 0xa21aab80, 0x27c33d5d, 0x7fc54e20,\n    0xfa1cd8fd, 0x34701240, 0xb1a9849d, 0x17256aa0, 0x92fcfc7d,\n    0x5c9036c0, 0xd949a01d, 0x814fd360, 0x049645bd, 0xcafa8f00,\n    0x4f2319dd, 0x7af669fa, 0xff2fff27, 0x3143359a, 0xb49aa347,\n    0xec9cd03a, 0x694546e7, 0xa7298c5a, 0x22f01a87, 0xcd836d14,\n    0x485afbc9, 0x86363174, 0x03efa7a9, 0x5be9d4d4, 0xde304209,\n    0x105c88b4, 0x95851e69, 0xa0506e4e, 0x2589f893, 0xebe5322e,\n    0x6e3ca4f3, 0x363ad78e, 0xb3e34153, 0x7d8f8bee, 0xf8561d33,\n    0xe26e1413, 0x67b782ce, 0xa9db4873, 0x2c02deae, 0x7404add3,\n    0xf1dd3b0e, 0x3fb1f1b3, 0xba68676e, 0x8fbd1749, 0x0a648194,\n    0xc4084b29, 0x41d1ddf4, 0x19d7ae89, 0x9c0e3854, 0x5262f2e9,\n    0xd7bb6434, 0x38c813a7, 0xbd11857a, 0x737d4fc7, 0xf6a4d91a,\n    0xaea2aa67, 0x2b7b3cba, 0xe517f607, 0x60ce60da, 0x551b10fd,\n    0xd0c28620, 0x1eae4c9d, 0x9b77da40, 0xc371a93d, 0x46a83fe0,\n    0x88c4f55d, 0x0d1d6380, 0xbcb4e71d, 0x396d71c0, 0xf701bb7d,\n    0x72d82da0, 0x2ade5edd, 0xaf07c800, 0x616b02bd, 0xe4b29460,\n    0xd167e447, 0x54be729a, 0x9ad2b827, 0x1f0b2efa, 0x470d5d87,\n    0xc2d4cb5a, 0x0cb801e7, 0x8961973a, 0x6612e0a9, 0xe3cb7674,\n    0x2da7bcc9, 0xa87e2a14, 0xf0785969, 0x75a1cfb4, 0xbbcd0509,\n    0x3e1493d4, 0x0bc1e3f3, 0x8e18752e, 0x4074bf93, 0xc5ad294e,\n    0x9dab5a33, 0x1872ccee, 0xd61e0653, 0x53c7908e, 0x49ff99ae,\n    0xcc260f73, 0x024ac5ce, 0x87935313, 0xdf95206e, 0x5a4cb6b3,\n    0x94207c0e, 0x11f9ead3, 0x242c9af4, 0xa1f50c29, 0x6f99c694,\n    0xea405049, 0xb2462334, 0x379fb5e9, 0xf9f37f54, 0x7c2ae989,\n    0x93599e1a, 0x168008c7, 0xd8ecc27a, 0x5d3554a7, 0x053327da,\n    0x80eab107, 0x4e867bba, 0xcb5fed67, 0xfe8a9d40, 0x7b530b9d,\n    0xb53fc120, 0x30e657fd, 0x68e02480, 0xed39b25d, 0x235578e0,\n    0xa68cee3d},\n   {0x00000000, 0x76e10f9d, 0xadc46ee1, 0xdb25617c, 0x1b8fac19,\n    0x6d6ea384, 0xb64bc2f8, 0xc0aacd65, 0x361e5933, 0x40ff56ae,\n    0x9bda37d2, 0xed3b384f, 0x2d91f52a, 0x5b70fab7, 0x80559bcb,\n    0xf6b49456, 0x6c3cb266, 0x1addbdfb, 0xc1f8dc87, 0xb719d31a,\n    0x77b31e7f, 0x015211e2, 0xda77709e, 0xac967f03, 0x5a22eb55,\n    0x2cc3e4c8, 0xf7e685b4, 0x81078a29, 0x41ad474c, 0x374c48d1,\n    0xec6929ad, 0x9a882630, 0xd87864cd, 0xae996b50, 0x75bc0a2c,\n    0x035d05b1, 0xc3f7c8d4, 0xb516c749, 0x6e33a635, 0x18d2a9a8,\n    0xee663dfe, 0x98873263, 0x43a2531f, 0x35435c82, 0xf5e991e7,\n    0x83089e7a, 0x582dff06, 0x2eccf09b, 0xb444d6ab, 0xc2a5d936,\n    0x1980b84a, 0x6f61b7d7, 0xafcb7ab2, 0xd92a752f, 0x020f1453,\n    0x74ee1bce, 0x825a8f98, 0xf4bb8005, 0x2f9ee179, 0x597feee4,\n    0x99d52381, 0xef342c1c, 0x34114d60, 0x42f042fd, 0xf1f7b941,\n    0x8716b6dc, 0x5c33d7a0, 0x2ad2d83d, 0xea781558, 0x9c991ac5,\n    0x47bc7bb9, 0x315d7424, 0xc7e9e072, 0xb108efef, 0x6a2d8e93,\n    0x1ccc810e, 0xdc664c6b, 0xaa8743f6, 0x71a2228a, 0x07432d17,\n    0x9dcb0b27, 0xeb2a04ba, 0x300f65c6, 0x46ee6a5b, 0x8644a73e,\n    0xf0a5a8a3, 0x2b80c9df, 0x5d61c642, 0xabd55214, 0xdd345d89,\n    0x06113cf5, 0x70f03368, 0xb05afe0d, 0xc6bbf190, 0x1d9e90ec,\n    0x6b7f9f71, 0x298fdd8c, 0x5f6ed211, 0x844bb36d, 0xf2aabcf0,\n    0x32007195, 0x44e17e08, 0x9fc41f74, 0xe92510e9, 0x1f9184bf,\n    0x69708b22, 0xb255ea5e, 0xc4b4e5c3, 0x041e28a6, 0x72ff273b,\n    0xa9da4647, 0xdf3b49da, 0x45b36fea, 0x33526077, 0xe877010b,\n    0x9e960e96, 0x5e3cc3f3, 0x28ddcc6e, 0xf3f8ad12, 0x8519a28f,\n    0x73ad36d9, 0x054c3944, 0xde695838, 0xa88857a5, 0x68229ac0,\n    0x1ec3955d, 0xc5e6f421, 0xb307fbbc, 0xe2ef7383, 0x940e7c1e,\n    0x4f2b1d62, 0x39ca12ff, 0xf960df9a, 0x8f81d007, 0x54a4b17b,\n    0x2245bee6, 0xd4f12ab0, 0xa210252d, 0x79354451, 0x0fd44bcc,\n    0xcf7e86a9, 0xb99f8934, 0x62bae848, 0x145be7d5, 0x8ed3c1e5,\n    0xf832ce78, 0x2317af04, 0x55f6a099, 0x955c6dfc, 0xe3bd6261,\n    0x3898031d, 0x4e790c80, 0xb8cd98d6, 0xce2c974b, 0x1509f637,\n    0x63e8f9aa, 0xa34234cf, 0xd5a33b52, 0x0e865a2e, 0x786755b3,\n    0x3a97174e, 0x4c7618d3, 0x975379af, 0xe1b27632, 0x2118bb57,\n    0x57f9b4ca, 0x8cdcd5b6, 0xfa3dda2b, 0x0c894e7d, 0x7a6841e0,\n    0xa14d209c, 0xd7ac2f01, 0x1706e264, 0x61e7edf9, 0xbac28c85,\n    0xcc238318, 0x56aba528, 0x204aaab5, 0xfb6fcbc9, 0x8d8ec454,\n    0x4d240931, 0x3bc506ac, 0xe0e067d0, 0x9601684d, 0x60b5fc1b,\n    0x1654f386, 0xcd7192fa, 0xbb909d67, 0x7b3a5002, 0x0ddb5f9f,\n    0xd6fe3ee3, 0xa01f317e, 0x1318cac2, 0x65f9c55f, 0xbedca423,\n    0xc83dabbe, 0x089766db, 0x7e766946, 0xa553083a, 0xd3b207a7,\n    0x250693f1, 0x53e79c6c, 0x88c2fd10, 0xfe23f28d, 0x3e893fe8,\n    0x48683075, 0x934d5109, 0xe5ac5e94, 0x7f2478a4, 0x09c57739,\n    0xd2e01645, 0xa40119d8, 0x64abd4bd, 0x124adb20, 0xc96fba5c,\n    0xbf8eb5c1, 0x493a2197, 0x3fdb2e0a, 0xe4fe4f76, 0x921f40eb,\n    0x52b58d8e, 0x24548213, 0xff71e36f, 0x8990ecf2, 0xcb60ae0f,\n    0xbd81a192, 0x66a4c0ee, 0x1045cf73, 0xd0ef0216, 0xa60e0d8b,\n    0x7d2b6cf7, 0x0bca636a, 0xfd7ef73c, 0x8b9ff8a1, 0x50ba99dd,\n    0x265b9640, 0xe6f15b25, 0x901054b8, 0x4b3535c4, 0x3dd43a59,\n    0xa75c1c69, 0xd1bd13f4, 0x0a987288, 0x7c797d15, 0xbcd3b070,\n    0xca32bfed, 0x1117de91, 0x67f6d10c, 0x9142455a, 0xe7a34ac7,\n    0x3c862bbb, 0x4a672426, 0x8acde943, 0xfc2ce6de, 0x270987a2,\n    0x51e8883f},\n   {0x00000000, 0xe8dbfbb9, 0x91b186a8, 0x796a7d11, 0x63657c8a,\n    0x8bbe8733, 0xf2d4fa22, 0x1a0f019b, 0x87cc89cf, 0x6f177276,\n    0x167d0f67, 0xfea6f4de, 0xe4a9f545, 0x0c720efc, 0x751873ed,\n    0x9dc38854, 0x4f9f6244, 0xa74499fd, 0xde2ee4ec, 0x36f51f55,\n    0x2cfa1ece, 0xc421e577, 0xbd4b9866, 0x559063df, 0xc853eb8b,\n    0x20881032, 0x59e26d23, 0xb139969a, 0xab369701, 0x43ed6cb8,\n    0x3a8711a9, 0xd25cea10, 0x9e3ec588, 0x76e53e31, 0x0f8f4320,\n    0xe754b899, 0xfd5bb902, 0x158042bb, 0x6cea3faa, 0x8431c413,\n    0x19f24c47, 0xf129b7fe, 0x8843caef, 0x60983156, 0x7a9730cd,\n    0x924ccb74, 0xeb26b665, 0x03fd4ddc, 0xd1a1a7cc, 0x397a5c75,\n    0x40102164, 0xa8cbdadd, 0xb2c4db46, 0x5a1f20ff, 0x23755dee,\n    0xcbaea657, 0x566d2e03, 0xbeb6d5ba, 0xc7dca8ab, 0x2f075312,\n    0x35085289, 0xddd3a930, 0xa4b9d421, 0x4c622f98, 0x7d7bfbca,\n    0x95a00073, 0xecca7d62, 0x041186db, 0x1e1e8740, 0xf6c57cf9,\n    0x8faf01e8, 0x6774fa51, 0xfab77205, 0x126c89bc, 0x6b06f4ad,\n    0x83dd0f14, 0x99d20e8f, 0x7109f536, 0x08638827, 0xe0b8739e,\n    0x32e4998e, 0xda3f6237, 0xa3551f26, 0x4b8ee49f, 0x5181e504,\n    0xb95a1ebd, 0xc03063ac, 0x28eb9815, 0xb5281041, 0x5df3ebf8,\n    0x249996e9, 0xcc426d50, 0xd64d6ccb, 0x3e969772, 0x47fcea63,\n    0xaf2711da, 0xe3453e42, 0x0b9ec5fb, 0x72f4b8ea, 0x9a2f4353,\n    0x802042c8, 0x68fbb971, 0x1191c460, 0xf94a3fd9, 0x6489b78d,\n    0x8c524c34, 0xf5383125, 0x1de3ca9c, 0x07eccb07, 0xef3730be,\n    0x965d4daf, 0x7e86b616, 0xacda5c06, 0x4401a7bf, 0x3d6bdaae,\n    0xd5b02117, 0xcfbf208c, 0x2764db35, 0x5e0ea624, 0xb6d55d9d,\n    0x2b16d5c9, 0xc3cd2e70, 0xbaa75361, 0x527ca8d8, 0x4873a943,\n    0xa0a852fa, 0xd9c22feb, 0x3119d452, 0xbbf0874e, 0x532b7cf7,\n    0x2a4101e6, 0xc29afa5f, 0xd895fbc4, 0x304e007d, 0x49247d6c,\n    0xa1ff86d5, 0x3c3c0e81, 0xd4e7f538, 0xad8d8829, 0x45567390,\n    0x5f59720b, 0xb78289b2, 0xcee8f4a3, 0x26330f1a, 0xf46fe50a,\n    0x1cb41eb3, 0x65de63a2, 0x8d05981b, 0x970a9980, 0x7fd16239,\n    0x06bb1f28, 0xee60e491, 0x73a36cc5, 0x9b78977c, 0xe212ea6d,\n    0x0ac911d4, 0x10c6104f, 0xf81debf6, 0x817796e7, 0x69ac6d5e,\n    0x25ce42c6, 0xcd15b97f, 0xb47fc46e, 0x5ca43fd7, 0x46ab3e4c,\n    0xae70c5f5, 0xd71ab8e4, 0x3fc1435d, 0xa202cb09, 0x4ad930b0,\n    0x33b34da1, 0xdb68b618, 0xc167b783, 0x29bc4c3a, 0x50d6312b,\n    0xb80dca92, 0x6a512082, 0x828adb3b, 0xfbe0a62a, 0x133b5d93,\n    0x09345c08, 0xe1efa7b1, 0x9885daa0, 0x705e2119, 0xed9da94d,\n    0x054652f4, 0x7c2c2fe5, 0x94f7d45c, 0x8ef8d5c7, 0x66232e7e,\n    0x1f49536f, 0xf792a8d6, 0xc68b7c84, 0x2e50873d, 0x573afa2c,\n    0xbfe10195, 0xa5ee000e, 0x4d35fbb7, 0x345f86a6, 0xdc847d1f,\n    0x4147f54b, 0xa99c0ef2, 0xd0f673e3, 0x382d885a, 0x222289c1,\n    0xcaf97278, 0xb3930f69, 0x5b48f4d0, 0x89141ec0, 0x61cfe579,\n    0x18a59868, 0xf07e63d1, 0xea71624a, 0x02aa99f3, 0x7bc0e4e2,\n    0x931b1f5b, 0x0ed8970f, 0xe6036cb6, 0x9f6911a7, 0x77b2ea1e,\n    0x6dbdeb85, 0x8566103c, 0xfc0c6d2d, 0x14d79694, 0x58b5b90c,\n    0xb06e42b5, 0xc9043fa4, 0x21dfc41d, 0x3bd0c586, 0xd30b3e3f,\n    0xaa61432e, 0x42bab897, 0xdf7930c3, 0x37a2cb7a, 0x4ec8b66b,\n    0xa6134dd2, 0xbc1c4c49, 0x54c7b7f0, 0x2dadcae1, 0xc5763158,\n    0x172adb48, 0xfff120f1, 0x869b5de0, 0x6e40a659, 0x744fa7c2,\n    0x9c945c7b, 0xe5fe216a, 0x0d25dad3, 0x90e65287, 0x783da93e,\n    0x0157d42f, 0xe98c2f96, 0xf3832e0d, 0x1b58d5b4, 0x6232a8a5,\n    0x8ae9531c},\n   {0x00000000, 0x919168ae, 0x6325a087, 0xf2b4c829, 0x874c31d4,\n    0x16dd597a, 0xe4699153, 0x75f8f9fd, 0x4f9f1373, 0xde0e7bdd,\n    0x2cbab3f4, 0xbd2bdb5a, 0xc8d322a7, 0x59424a09, 0xabf68220,\n    0x3a67ea8e, 0x9e3e27e6, 0x0faf4f48, 0xfd1b8761, 0x6c8aefcf,\n    0x19721632, 0x88e37e9c, 0x7a57b6b5, 0xebc6de1b, 0xd1a13495,\n    0x40305c3b, 0xb2849412, 0x2315fcbc, 0x56ed0541, 0xc77c6def,\n    0x35c8a5c6, 0xa459cd68, 0x7d7b3f17, 0xecea57b9, 0x1e5e9f90,\n    0x8fcff73e, 0xfa370ec3, 0x6ba6666d, 0x9912ae44, 0x0883c6ea,\n    0x32e42c64, 0xa37544ca, 0x51c18ce3, 0xc050e44d, 0xb5a81db0,\n    0x2439751e, 0xd68dbd37, 0x471cd599, 0xe34518f1, 0x72d4705f,\n    0x8060b876, 0x11f1d0d8, 0x64092925, 0xf598418b, 0x072c89a2,\n    0x96bde10c, 0xacda0b82, 0x3d4b632c, 0xcfffab05, 0x5e6ec3ab,\n    0x2b963a56, 0xba0752f8, 0x48b39ad1, 0xd922f27f, 0xfaf67e2e,\n    0x6b671680, 0x99d3dea9, 0x0842b607, 0x7dba4ffa, 0xec2b2754,\n    0x1e9fef7d, 0x8f0e87d3, 0xb5696d5d, 0x24f805f3, 0xd64ccdda,\n    0x47dda574, 0x32255c89, 0xa3b43427, 0x5100fc0e, 0xc09194a0,\n    0x64c859c8, 0xf5593166, 0x07edf94f, 0x967c91e1, 0xe384681c,\n    0x721500b2, 0x80a1c89b, 0x1130a035, 0x2b574abb, 0xbac62215,\n    0x4872ea3c, 0xd9e38292, 0xac1b7b6f, 0x3d8a13c1, 0xcf3edbe8,\n    0x5eafb346, 0x878d4139, 0x161c2997, 0xe4a8e1be, 0x75398910,\n    0x00c170ed, 0x91501843, 0x63e4d06a, 0xf275b8c4, 0xc812524a,\n    0x59833ae4, 0xab37f2cd, 0x3aa69a63, 0x4f5e639e, 0xdecf0b30,\n    0x2c7bc319, 0xbdeaabb7, 0x19b366df, 0x88220e71, 0x7a96c658,\n    0xeb07aef6, 0x9eff570b, 0x0f6e3fa5, 0xfddaf78c, 0x6c4b9f22,\n    0x562c75ac, 0xc7bd1d02, 0x3509d52b, 0xa498bd85, 0xd1604478,\n    0x40f12cd6, 0xb245e4ff, 0x23d48c51, 0xf4edfd5c, 0x657c95f2,\n    0x97c85ddb, 0x06593575, 0x73a1cc88, 0xe230a426, 0x10846c0f,\n    0x811504a1, 0xbb72ee2f, 0x2ae38681, 0xd8574ea8, 0x49c62606,\n    0x3c3edffb, 0xadafb755, 0x5f1b7f7c, 0xce8a17d2, 0x6ad3daba,\n    0xfb42b214, 0x09f67a3d, 0x98671293, 0xed9feb6e, 0x7c0e83c0,\n    0x8eba4be9, 0x1f2b2347, 0x254cc9c9, 0xb4dda167, 0x4669694e,\n    0xd7f801e0, 0xa200f81d, 0x339190b3, 0xc125589a, 0x50b43034,\n    0x8996c24b, 0x1807aae5, 0xeab362cc, 0x7b220a62, 0x0edaf39f,\n    0x9f4b9b31, 0x6dff5318, 0xfc6e3bb6, 0xc609d138, 0x5798b996,\n    0xa52c71bf, 0x34bd1911, 0x4145e0ec, 0xd0d48842, 0x2260406b,\n    0xb3f128c5, 0x17a8e5ad, 0x86398d03, 0x748d452a, 0xe51c2d84,\n    0x90e4d479, 0x0175bcd7, 0xf3c174fe, 0x62501c50, 0x5837f6de,\n    0xc9a69e70, 0x3b125659, 0xaa833ef7, 0xdf7bc70a, 0x4eeaafa4,\n    0xbc5e678d, 0x2dcf0f23, 0x0e1b8372, 0x9f8aebdc, 0x6d3e23f5,\n    0xfcaf4b5b, 0x8957b2a6, 0x18c6da08, 0xea721221, 0x7be37a8f,\n    0x41849001, 0xd015f8af, 0x22a13086, 0xb3305828, 0xc6c8a1d5,\n    0x5759c97b, 0xa5ed0152, 0x347c69fc, 0x9025a494, 0x01b4cc3a,\n    0xf3000413, 0x62916cbd, 0x17699540, 0x86f8fdee, 0x744c35c7,\n    0xe5dd5d69, 0xdfbab7e7, 0x4e2bdf49, 0xbc9f1760, 0x2d0e7fce,\n    0x58f68633, 0xc967ee9d, 0x3bd326b4, 0xaa424e1a, 0x7360bc65,\n    0xe2f1d4cb, 0x10451ce2, 0x81d4744c, 0xf42c8db1, 0x65bde51f,\n    0x97092d36, 0x06984598, 0x3cffaf16, 0xad6ec7b8, 0x5fda0f91,\n    0xce4b673f, 0xbbb39ec2, 0x2a22f66c, 0xd8963e45, 0x490756eb,\n    0xed5e9b83, 0x7ccff32d, 0x8e7b3b04, 0x1fea53aa, 0x6a12aa57,\n    0xfb83c2f9, 0x09370ad0, 0x98a6627e, 0xa2c188f0, 0x3350e05e,\n    0xc1e42877, 0x507540d9, 0x258db924, 0xb41cd18a, 0x46a819a3,\n    0xd739710d}};\n\n#endif\n\n#endif\n\n#if N == 5\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0xaf449247, 0x85f822cf, 0x2abcb088, 0xd08143df,\n    0x7fc5d198, 0x55796110, 0xfa3df357, 0x7a7381ff, 0xd53713b8,\n    0xff8ba330, 0x50cf3177, 0xaaf2c220, 0x05b65067, 0x2f0ae0ef,\n    0x804e72a8, 0xf4e703fe, 0x5ba391b9, 0x711f2131, 0xde5bb376,\n    0x24664021, 0x8b22d266, 0xa19e62ee, 0x0edaf0a9, 0x8e948201,\n    0x21d01046, 0x0b6ca0ce, 0xa4283289, 0x5e15c1de, 0xf1515399,\n    0xdbede311, 0x74a97156, 0x32bf01bd, 0x9dfb93fa, 0xb7472372,\n    0x1803b135, 0xe23e4262, 0x4d7ad025, 0x67c660ad, 0xc882f2ea,\n    0x48cc8042, 0xe7881205, 0xcd34a28d, 0x627030ca, 0x984dc39d,\n    0x370951da, 0x1db5e152, 0xb2f17315, 0xc6580243, 0x691c9004,\n    0x43a0208c, 0xece4b2cb, 0x16d9419c, 0xb99dd3db, 0x93216353,\n    0x3c65f114, 0xbc2b83bc, 0x136f11fb, 0x39d3a173, 0x96973334,\n    0x6caac063, 0xc3ee5224, 0xe952e2ac, 0x461670eb, 0x657e037a,\n    0xca3a913d, 0xe08621b5, 0x4fc2b3f2, 0xb5ff40a5, 0x1abbd2e2,\n    0x3007626a, 0x9f43f02d, 0x1f0d8285, 0xb04910c2, 0x9af5a04a,\n    0x35b1320d, 0xcf8cc15a, 0x60c8531d, 0x4a74e395, 0xe53071d2,\n    0x91990084, 0x3edd92c3, 0x1461224b, 0xbb25b00c, 0x4118435b,\n    0xee5cd11c, 0xc4e06194, 0x6ba4f3d3, 0xebea817b, 0x44ae133c,\n    0x6e12a3b4, 0xc15631f3, 0x3b6bc2a4, 0x942f50e3, 0xbe93e06b,\n    0x11d7722c, 0x57c102c7, 0xf8859080, 0xd2392008, 0x7d7db24f,\n    0x87404118, 0x2804d35f, 0x02b863d7, 0xadfcf190, 0x2db28338,\n    0x82f6117f, 0xa84aa1f7, 0x070e33b0, 0xfd33c0e7, 0x527752a0,\n    0x78cbe228, 0xd78f706f, 0xa3260139, 0x0c62937e, 0x26de23f6,\n    0x899ab1b1, 0x73a742e6, 0xdce3d0a1, 0xf65f6029, 0x591bf26e,\n    0xd95580c6, 0x76111281, 0x5cada209, 0xf3e9304e, 0x09d4c319,\n    0xa690515e, 0x8c2ce1d6, 0x23687391, 0xcafc06f4, 0x65b894b3,\n    0x4f04243b, 0xe040b67c, 0x1a7d452b, 0xb539d76c, 0x9f8567e4,\n    0x30c1f5a3, 0xb08f870b, 0x1fcb154c, 0x3577a5c4, 0x9a333783,\n    0x600ec4d4, 0xcf4a5693, 0xe5f6e61b, 0x4ab2745c, 0x3e1b050a,\n    0x915f974d, 0xbbe327c5, 0x14a7b582, 0xee9a46d5, 0x41ded492,\n    0x6b62641a, 0xc426f65d, 0x446884f5, 0xeb2c16b2, 0xc190a63a,\n    0x6ed4347d, 0x94e9c72a, 0x3bad556d, 0x1111e5e5, 0xbe5577a2,\n    0xf8430749, 0x5707950e, 0x7dbb2586, 0xd2ffb7c1, 0x28c24496,\n    0x8786d6d1, 0xad3a6659, 0x027ef41e, 0x823086b6, 0x2d7414f1,\n    0x07c8a479, 0xa88c363e, 0x52b1c569, 0xfdf5572e, 0xd749e7a6,\n    0x780d75e1, 0x0ca404b7, 0xa3e096f0, 0x895c2678, 0x2618b43f,\n    0xdc254768, 0x7361d52f, 0x59dd65a7, 0xf699f7e0, 0x76d78548,\n    0xd993170f, 0xf32fa787, 0x5c6b35c0, 0xa656c697, 0x091254d0,\n    0x23aee458, 0x8cea761f, 0xaf82058e, 0x00c697c9, 0x2a7a2741,\n    0x853eb506, 0x7f034651, 0xd047d416, 0xfafb649e, 0x55bff6d9,\n    0xd5f18471, 0x7ab51636, 0x5009a6be, 0xff4d34f9, 0x0570c7ae,\n    0xaa3455e9, 0x8088e561, 0x2fcc7726, 0x5b650670, 0xf4219437,\n    0xde9d24bf, 0x71d9b6f8, 0x8be445af, 0x24a0d7e8, 0x0e1c6760,\n    0xa158f527, 0x2116878f, 0x8e5215c8, 0xa4eea540, 0x0baa3707,\n    0xf197c450, 0x5ed35617, 0x746fe69f, 0xdb2b74d8, 0x9d3d0433,\n    0x32799674, 0x18c526fc, 0xb781b4bb, 0x4dbc47ec, 0xe2f8d5ab,\n    0xc8446523, 0x6700f764, 0xe74e85cc, 0x480a178b, 0x62b6a703,\n    0xcdf23544, 0x37cfc613, 0x988b5454, 0xb237e4dc, 0x1d73769b,\n    0x69da07cd, 0xc69e958a, 0xec222502, 0x4366b745, 0xb95b4412,\n    0x161fd655, 0x3ca366dd, 0x93e7f49a, 0x13a98632, 0xbced1475,\n    0x9651a4fd, 0x391536ba, 0xc328c5ed, 0x6c6c57aa, 0x46d0e722,\n    0xe9947565},\n   {0x00000000, 0x4e890ba9, 0x9d121752, 0xd39b1cfb, 0xe15528e5,\n    0xafdc234c, 0x7c473fb7, 0x32ce341e, 0x19db578b, 0x57525c22,\n    0x84c940d9, 0xca404b70, 0xf88e7f6e, 0xb60774c7, 0x659c683c,\n    0x2b156395, 0x33b6af16, 0x7d3fa4bf, 0xaea4b844, 0xe02db3ed,\n    0xd2e387f3, 0x9c6a8c5a, 0x4ff190a1, 0x01789b08, 0x2a6df89d,\n    0x64e4f334, 0xb77fefcf, 0xf9f6e466, 0xcb38d078, 0x85b1dbd1,\n    0x562ac72a, 0x18a3cc83, 0x676d5e2c, 0x29e45585, 0xfa7f497e,\n    0xb4f642d7, 0x863876c9, 0xc8b17d60, 0x1b2a619b, 0x55a36a32,\n    0x7eb609a7, 0x303f020e, 0xe3a41ef5, 0xad2d155c, 0x9fe32142,\n    0xd16a2aeb, 0x02f13610, 0x4c783db9, 0x54dbf13a, 0x1a52fa93,\n    0xc9c9e668, 0x8740edc1, 0xb58ed9df, 0xfb07d276, 0x289cce8d,\n    0x6615c524, 0x4d00a6b1, 0x0389ad18, 0xd012b1e3, 0x9e9bba4a,\n    0xac558e54, 0xe2dc85fd, 0x31479906, 0x7fce92af, 0xcedabc58,\n    0x8053b7f1, 0x53c8ab0a, 0x1d41a0a3, 0x2f8f94bd, 0x61069f14,\n    0xb29d83ef, 0xfc148846, 0xd701ebd3, 0x9988e07a, 0x4a13fc81,\n    0x049af728, 0x3654c336, 0x78ddc89f, 0xab46d464, 0xe5cfdfcd,\n    0xfd6c134e, 0xb3e518e7, 0x607e041c, 0x2ef70fb5, 0x1c393bab,\n    0x52b03002, 0x812b2cf9, 0xcfa22750, 0xe4b744c5, 0xaa3e4f6c,\n    0x79a55397, 0x372c583e, 0x05e26c20, 0x4b6b6789, 0x98f07b72,\n    0xd67970db, 0xa9b7e274, 0xe73ee9dd, 0x34a5f526, 0x7a2cfe8f,\n    0x48e2ca91, 0x066bc138, 0xd5f0ddc3, 0x9b79d66a, 0xb06cb5ff,\n    0xfee5be56, 0x2d7ea2ad, 0x63f7a904, 0x51399d1a, 0x1fb096b3,\n    0xcc2b8a48, 0x82a281e1, 0x9a014d62, 0xd48846cb, 0x07135a30,\n    0x499a5199, 0x7b546587, 0x35dd6e2e, 0xe64672d5, 0xa8cf797c,\n    0x83da1ae9, 0xcd531140, 0x1ec80dbb, 0x50410612, 0x628f320c,\n    0x2c0639a5, 0xff9d255e, 0xb1142ef7, 0x46c47ef1, 0x084d7558,\n    0xdbd669a3, 0x955f620a, 0xa7915614, 0xe9185dbd, 0x3a834146,\n    0x740a4aef, 0x5f1f297a, 0x119622d3, 0xc20d3e28, 0x8c843581,\n    0xbe4a019f, 0xf0c30a36, 0x235816cd, 0x6dd11d64, 0x7572d1e7,\n    0x3bfbda4e, 0xe860c6b5, 0xa6e9cd1c, 0x9427f902, 0xdaaef2ab,\n    0x0935ee50, 0x47bce5f9, 0x6ca9866c, 0x22208dc5, 0xf1bb913e,\n    0xbf329a97, 0x8dfcae89, 0xc375a520, 0x10eeb9db, 0x5e67b272,\n    0x21a920dd, 0x6f202b74, 0xbcbb378f, 0xf2323c26, 0xc0fc0838,\n    0x8e750391, 0x5dee1f6a, 0x136714c3, 0x38727756, 0x76fb7cff,\n    0xa5606004, 0xebe96bad, 0xd9275fb3, 0x97ae541a, 0x443548e1,\n    0x0abc4348, 0x121f8fcb, 0x5c968462, 0x8f0d9899, 0xc1849330,\n    0xf34aa72e, 0xbdc3ac87, 0x6e58b07c, 0x20d1bbd5, 0x0bc4d840,\n    0x454dd3e9, 0x96d6cf12, 0xd85fc4bb, 0xea91f0a5, 0xa418fb0c,\n    0x7783e7f7, 0x390aec5e, 0x881ec2a9, 0xc697c900, 0x150cd5fb,\n    0x5b85de52, 0x694bea4c, 0x27c2e1e5, 0xf459fd1e, 0xbad0f6b7,\n    0x91c59522, 0xdf4c9e8b, 0x0cd78270, 0x425e89d9, 0x7090bdc7,\n    0x3e19b66e, 0xed82aa95, 0xa30ba13c, 0xbba86dbf, 0xf5216616,\n    0x26ba7aed, 0x68337144, 0x5afd455a, 0x14744ef3, 0xc7ef5208,\n    0x896659a1, 0xa2733a34, 0xecfa319d, 0x3f612d66, 0x71e826cf,\n    0x432612d1, 0x0daf1978, 0xde340583, 0x90bd0e2a, 0xef739c85,\n    0xa1fa972c, 0x72618bd7, 0x3ce8807e, 0x0e26b460, 0x40afbfc9,\n    0x9334a332, 0xddbda89b, 0xf6a8cb0e, 0xb821c0a7, 0x6bbadc5c,\n    0x2533d7f5, 0x17fde3eb, 0x5974e842, 0x8aeff4b9, 0xc466ff10,\n    0xdcc53393, 0x924c383a, 0x41d724c1, 0x0f5e2f68, 0x3d901b76,\n    0x731910df, 0xa0820c24, 0xee0b078d, 0xc51e6418, 0x8b976fb1,\n    0x580c734a, 0x168578e3, 0x244b4cfd, 0x6ac24754, 0xb9595baf,\n    0xf7d05006},\n   {0x00000000, 0x8d88fde2, 0xc060fd85, 0x4de80067, 0x5bb0fd4b,\n    0xd63800a9, 0x9bd000ce, 0x1658fd2c, 0xb761fa96, 0x3ae90774,\n    0x77010713, 0xfa89faf1, 0xecd107dd, 0x6159fa3f, 0x2cb1fa58,\n    0xa13907ba, 0xb5b2f36d, 0x383a0e8f, 0x75d20ee8, 0xf85af30a,\n    0xee020e26, 0x638af3c4, 0x2e62f3a3, 0xa3ea0e41, 0x02d309fb,\n    0x8f5bf419, 0xc2b3f47e, 0x4f3b099c, 0x5963f4b0, 0xd4eb0952,\n    0x99030935, 0x148bf4d7, 0xb014e09b, 0x3d9c1d79, 0x70741d1e,\n    0xfdfce0fc, 0xeba41dd0, 0x662ce032, 0x2bc4e055, 0xa64c1db7,\n    0x07751a0d, 0x8afde7ef, 0xc715e788, 0x4a9d1a6a, 0x5cc5e746,\n    0xd14d1aa4, 0x9ca51ac3, 0x112de721, 0x05a613f6, 0x882eee14,\n    0xc5c6ee73, 0x484e1391, 0x5e16eebd, 0xd39e135f, 0x9e761338,\n    0x13feeeda, 0xb2c7e960, 0x3f4f1482, 0x72a714e5, 0xff2fe907,\n    0xe977142b, 0x64ffe9c9, 0x2917e9ae, 0xa49f144c, 0xbb58c777,\n    0x36d03a95, 0x7b383af2, 0xf6b0c710, 0xe0e83a3c, 0x6d60c7de,\n    0x2088c7b9, 0xad003a5b, 0x0c393de1, 0x81b1c003, 0xcc59c064,\n    0x41d13d86, 0x5789c0aa, 0xda013d48, 0x97e93d2f, 0x1a61c0cd,\n    0x0eea341a, 0x8362c9f8, 0xce8ac99f, 0x4302347d, 0x555ac951,\n    0xd8d234b3, 0x953a34d4, 0x18b2c936, 0xb98bce8c, 0x3403336e,\n    0x79eb3309, 0xf463ceeb, 0xe23b33c7, 0x6fb3ce25, 0x225bce42,\n    0xafd333a0, 0x0b4c27ec, 0x86c4da0e, 0xcb2cda69, 0x46a4278b,\n    0x50fcdaa7, 0xdd742745, 0x909c2722, 0x1d14dac0, 0xbc2ddd7a,\n    0x31a52098, 0x7c4d20ff, 0xf1c5dd1d, 0xe79d2031, 0x6a15ddd3,\n    0x27fdddb4, 0xaa752056, 0xbefed481, 0x33762963, 0x7e9e2904,\n    0xf316d4e6, 0xe54e29ca, 0x68c6d428, 0x252ed44f, 0xa8a629ad,\n    0x099f2e17, 0x8417d3f5, 0xc9ffd392, 0x44772e70, 0x522fd35c,\n    0xdfa72ebe, 0x924f2ed9, 0x1fc7d33b, 0xadc088af, 0x2048754d,\n    0x6da0752a, 0xe02888c8, 0xf67075e4, 0x7bf88806, 0x36108861,\n    0xbb987583, 0x1aa17239, 0x97298fdb, 0xdac18fbc, 0x5749725e,\n    0x41118f72, 0xcc997290, 0x817172f7, 0x0cf98f15, 0x18727bc2,\n    0x95fa8620, 0xd8128647, 0x559a7ba5, 0x43c28689, 0xce4a7b6b,\n    0x83a27b0c, 0x0e2a86ee, 0xaf138154, 0x229b7cb6, 0x6f737cd1,\n    0xe2fb8133, 0xf4a37c1f, 0x792b81fd, 0x34c3819a, 0xb94b7c78,\n    0x1dd46834, 0x905c95d6, 0xddb495b1, 0x503c6853, 0x4664957f,\n    0xcbec689d, 0x860468fa, 0x0b8c9518, 0xaab592a2, 0x273d6f40,\n    0x6ad56f27, 0xe75d92c5, 0xf1056fe9, 0x7c8d920b, 0x3165926c,\n    0xbced6f8e, 0xa8669b59, 0x25ee66bb, 0x680666dc, 0xe58e9b3e,\n    0xf3d66612, 0x7e5e9bf0, 0x33b69b97, 0xbe3e6675, 0x1f0761cf,\n    0x928f9c2d, 0xdf679c4a, 0x52ef61a8, 0x44b79c84, 0xc93f6166,\n    0x84d76101, 0x095f9ce3, 0x16984fd8, 0x9b10b23a, 0xd6f8b25d,\n    0x5b704fbf, 0x4d28b293, 0xc0a04f71, 0x8d484f16, 0x00c0b2f4,\n    0xa1f9b54e, 0x2c7148ac, 0x619948cb, 0xec11b529, 0xfa494805,\n    0x77c1b5e7, 0x3a29b580, 0xb7a14862, 0xa32abcb5, 0x2ea24157,\n    0x634a4130, 0xeec2bcd2, 0xf89a41fe, 0x7512bc1c, 0x38fabc7b,\n    0xb5724199, 0x144b4623, 0x99c3bbc1, 0xd42bbba6, 0x59a34644,\n    0x4ffbbb68, 0xc273468a, 0x8f9b46ed, 0x0213bb0f, 0xa68caf43,\n    0x2b0452a1, 0x66ec52c6, 0xeb64af24, 0xfd3c5208, 0x70b4afea,\n    0x3d5caf8d, 0xb0d4526f, 0x11ed55d5, 0x9c65a837, 0xd18da850,\n    0x5c0555b2, 0x4a5da89e, 0xc7d5557c, 0x8a3d551b, 0x07b5a8f9,\n    0x133e5c2e, 0x9eb6a1cc, 0xd35ea1ab, 0x5ed65c49, 0x488ea165,\n    0xc5065c87, 0x88ee5ce0, 0x0566a102, 0xa45fa6b8, 0x29d75b5a,\n    0x643f5b3d, 0xe9b7a6df, 0xffef5bf3, 0x7267a611, 0x3f8fa676,\n    0xb2075b94},\n   {0x00000000, 0x80f0171f, 0xda91287f, 0x5a613f60, 0x6e5356bf,\n    0xeea341a0, 0xb4c27ec0, 0x343269df, 0xdca6ad7e, 0x5c56ba61,\n    0x06378501, 0x86c7921e, 0xb2f5fbc1, 0x3205ecde, 0x6864d3be,\n    0xe894c4a1, 0x623c5cbd, 0xe2cc4ba2, 0xb8ad74c2, 0x385d63dd,\n    0x0c6f0a02, 0x8c9f1d1d, 0xd6fe227d, 0x560e3562, 0xbe9af1c3,\n    0x3e6ae6dc, 0x640bd9bc, 0xe4fbcea3, 0xd0c9a77c, 0x5039b063,\n    0x0a588f03, 0x8aa8981c, 0xc478b97a, 0x4488ae65, 0x1ee99105,\n    0x9e19861a, 0xaa2befc5, 0x2adbf8da, 0x70bac7ba, 0xf04ad0a5,\n    0x18de1404, 0x982e031b, 0xc24f3c7b, 0x42bf2b64, 0x768d42bb,\n    0xf67d55a4, 0xac1c6ac4, 0x2cec7ddb, 0xa644e5c7, 0x26b4f2d8,\n    0x7cd5cdb8, 0xfc25daa7, 0xc817b378, 0x48e7a467, 0x12869b07,\n    0x92768c18, 0x7ae248b9, 0xfa125fa6, 0xa07360c6, 0x208377d9,\n    0x14b11e06, 0x94410919, 0xce203679, 0x4ed02166, 0x538074b5,\n    0xd37063aa, 0x89115cca, 0x09e14bd5, 0x3dd3220a, 0xbd233515,\n    0xe7420a75, 0x67b21d6a, 0x8f26d9cb, 0x0fd6ced4, 0x55b7f1b4,\n    0xd547e6ab, 0xe1758f74, 0x6185986b, 0x3be4a70b, 0xbb14b014,\n    0x31bc2808, 0xb14c3f17, 0xeb2d0077, 0x6bdd1768, 0x5fef7eb7,\n    0xdf1f69a8, 0x857e56c8, 0x058e41d7, 0xed1a8576, 0x6dea9269,\n    0x378bad09, 0xb77bba16, 0x8349d3c9, 0x03b9c4d6, 0x59d8fbb6,\n    0xd928eca9, 0x97f8cdcf, 0x1708dad0, 0x4d69e5b0, 0xcd99f2af,\n    0xf9ab9b70, 0x795b8c6f, 0x233ab30f, 0xa3caa410, 0x4b5e60b1,\n    0xcbae77ae, 0x91cf48ce, 0x113f5fd1, 0x250d360e, 0xa5fd2111,\n    0xff9c1e71, 0x7f6c096e, 0xf5c49172, 0x7534866d, 0x2f55b90d,\n    0xafa5ae12, 0x9b97c7cd, 0x1b67d0d2, 0x4106efb2, 0xc1f6f8ad,\n    0x29623c0c, 0xa9922b13, 0xf3f31473, 0x7303036c, 0x47316ab3,\n    0xc7c17dac, 0x9da042cc, 0x1d5055d3, 0xa700e96a, 0x27f0fe75,\n    0x7d91c115, 0xfd61d60a, 0xc953bfd5, 0x49a3a8ca, 0x13c297aa,\n    0x933280b5, 0x7ba64414, 0xfb56530b, 0xa1376c6b, 0x21c77b74,\n    0x15f512ab, 0x950505b4, 0xcf643ad4, 0x4f942dcb, 0xc53cb5d7,\n    0x45cca2c8, 0x1fad9da8, 0x9f5d8ab7, 0xab6fe368, 0x2b9ff477,\n    0x71fecb17, 0xf10edc08, 0x199a18a9, 0x996a0fb6, 0xc30b30d6,\n    0x43fb27c9, 0x77c94e16, 0xf7395909, 0xad586669, 0x2da87176,\n    0x63785010, 0xe388470f, 0xb9e9786f, 0x39196f70, 0x0d2b06af,\n    0x8ddb11b0, 0xd7ba2ed0, 0x574a39cf, 0xbfdefd6e, 0x3f2eea71,\n    0x654fd511, 0xe5bfc20e, 0xd18dabd1, 0x517dbcce, 0x0b1c83ae,\n    0x8bec94b1, 0x01440cad, 0x81b41bb2, 0xdbd524d2, 0x5b2533cd,\n    0x6f175a12, 0xefe74d0d, 0xb586726d, 0x35766572, 0xdde2a1d3,\n    0x5d12b6cc, 0x077389ac, 0x87839eb3, 0xb3b1f76c, 0x3341e073,\n    0x6920df13, 0xe9d0c80c, 0xf4809ddf, 0x74708ac0, 0x2e11b5a0,\n    0xaee1a2bf, 0x9ad3cb60, 0x1a23dc7f, 0x4042e31f, 0xc0b2f400,\n    0x282630a1, 0xa8d627be, 0xf2b718de, 0x72470fc1, 0x4675661e,\n    0xc6857101, 0x9ce44e61, 0x1c14597e, 0x96bcc162, 0x164cd67d,\n    0x4c2de91d, 0xccddfe02, 0xf8ef97dd, 0x781f80c2, 0x227ebfa2,\n    0xa28ea8bd, 0x4a1a6c1c, 0xcaea7b03, 0x908b4463, 0x107b537c,\n    0x24493aa3, 0xa4b92dbc, 0xfed812dc, 0x7e2805c3, 0x30f824a5,\n    0xb00833ba, 0xea690cda, 0x6a991bc5, 0x5eab721a, 0xde5b6505,\n    0x843a5a65, 0x04ca4d7a, 0xec5e89db, 0x6cae9ec4, 0x36cfa1a4,\n    0xb63fb6bb, 0x820ddf64, 0x02fdc87b, 0x589cf71b, 0xd86ce004,\n    0x52c47818, 0xd2346f07, 0x88555067, 0x08a54778, 0x3c972ea7,\n    0xbc6739b8, 0xe60606d8, 0x66f611c7, 0x8e62d566, 0x0e92c279,\n    0x54f3fd19, 0xd403ea06, 0xe03183d9, 0x60c194c6, 0x3aa0aba6,\n    0xba50bcb9},\n   {0x00000000, 0x9570d495, 0xf190af6b, 0x64e07bfe, 0x38505897,\n    0xad208c02, 0xc9c0f7fc, 0x5cb02369, 0x70a0b12e, 0xe5d065bb,\n    0x81301e45, 0x1440cad0, 0x48f0e9b9, 0xdd803d2c, 0xb96046d2,\n    0x2c109247, 0xe141625c, 0x7431b6c9, 0x10d1cd37, 0x85a119a2,\n    0xd9113acb, 0x4c61ee5e, 0x288195a0, 0xbdf14135, 0x91e1d372,\n    0x049107e7, 0x60717c19, 0xf501a88c, 0xa9b18be5, 0x3cc15f70,\n    0x5821248e, 0xcd51f01b, 0x19f3c2f9, 0x8c83166c, 0xe8636d92,\n    0x7d13b907, 0x21a39a6e, 0xb4d34efb, 0xd0333505, 0x4543e190,\n    0x695373d7, 0xfc23a742, 0x98c3dcbc, 0x0db30829, 0x51032b40,\n    0xc473ffd5, 0xa093842b, 0x35e350be, 0xf8b2a0a5, 0x6dc27430,\n    0x09220fce, 0x9c52db5b, 0xc0e2f832, 0x55922ca7, 0x31725759,\n    0xa40283cc, 0x8812118b, 0x1d62c51e, 0x7982bee0, 0xecf26a75,\n    0xb042491c, 0x25329d89, 0x41d2e677, 0xd4a232e2, 0x33e785f2,\n    0xa6975167, 0xc2772a99, 0x5707fe0c, 0x0bb7dd65, 0x9ec709f0,\n    0xfa27720e, 0x6f57a69b, 0x434734dc, 0xd637e049, 0xb2d79bb7,\n    0x27a74f22, 0x7b176c4b, 0xee67b8de, 0x8a87c320, 0x1ff717b5,\n    0xd2a6e7ae, 0x47d6333b, 0x233648c5, 0xb6469c50, 0xeaf6bf39,\n    0x7f866bac, 0x1b661052, 0x8e16c4c7, 0xa2065680, 0x37768215,\n    0x5396f9eb, 0xc6e62d7e, 0x9a560e17, 0x0f26da82, 0x6bc6a17c,\n    0xfeb675e9, 0x2a14470b, 0xbf64939e, 0xdb84e860, 0x4ef43cf5,\n    0x12441f9c, 0x8734cb09, 0xe3d4b0f7, 0x76a46462, 0x5ab4f625,\n    0xcfc422b0, 0xab24594e, 0x3e548ddb, 0x62e4aeb2, 0xf7947a27,\n    0x937401d9, 0x0604d54c, 0xcb552557, 0x5e25f1c2, 0x3ac58a3c,\n    0xafb55ea9, 0xf3057dc0, 0x6675a955, 0x0295d2ab, 0x97e5063e,\n    0xbbf59479, 0x2e8540ec, 0x4a653b12, 0xdf15ef87, 0x83a5ccee,\n    0x16d5187b, 0x72356385, 0xe745b710, 0x67cf0be4, 0xf2bfdf71,\n    0x965fa48f, 0x032f701a, 0x5f9f5373, 0xcaef87e6, 0xae0ffc18,\n    0x3b7f288d, 0x176fbaca, 0x821f6e5f, 0xe6ff15a1, 0x738fc134,\n    0x2f3fe25d, 0xba4f36c8, 0xdeaf4d36, 0x4bdf99a3, 0x868e69b8,\n    0x13febd2d, 0x771ec6d3, 0xe26e1246, 0xbede312f, 0x2baee5ba,\n    0x4f4e9e44, 0xda3e4ad1, 0xf62ed896, 0x635e0c03, 0x07be77fd,\n    0x92cea368, 0xce7e8001, 0x5b0e5494, 0x3fee2f6a, 0xaa9efbff,\n    0x7e3cc91d, 0xeb4c1d88, 0x8fac6676, 0x1adcb2e3, 0x466c918a,\n    0xd31c451f, 0xb7fc3ee1, 0x228cea74, 0x0e9c7833, 0x9becaca6,\n    0xff0cd758, 0x6a7c03cd, 0x36cc20a4, 0xa3bcf431, 0xc75c8fcf,\n    0x522c5b5a, 0x9f7dab41, 0x0a0d7fd4, 0x6eed042a, 0xfb9dd0bf,\n    0xa72df3d6, 0x325d2743, 0x56bd5cbd, 0xc3cd8828, 0xefdd1a6f,\n    0x7aadcefa, 0x1e4db504, 0x8b3d6191, 0xd78d42f8, 0x42fd966d,\n    0x261ded93, 0xb36d3906, 0x54288e16, 0xc1585a83, 0xa5b8217d,\n    0x30c8f5e8, 0x6c78d681, 0xf9080214, 0x9de879ea, 0x0898ad7f,\n    0x24883f38, 0xb1f8ebad, 0xd5189053, 0x406844c6, 0x1cd867af,\n    0x89a8b33a, 0xed48c8c4, 0x78381c51, 0xb569ec4a, 0x201938df,\n    0x44f94321, 0xd18997b4, 0x8d39b4dd, 0x18496048, 0x7ca91bb6,\n    0xe9d9cf23, 0xc5c95d64, 0x50b989f1, 0x3459f20f, 0xa129269a,\n    0xfd9905f3, 0x68e9d166, 0x0c09aa98, 0x99797e0d, 0x4ddb4cef,\n    0xd8ab987a, 0xbc4be384, 0x293b3711, 0x758b1478, 0xe0fbc0ed,\n    0x841bbb13, 0x116b6f86, 0x3d7bfdc1, 0xa80b2954, 0xcceb52aa,\n    0x599b863f, 0x052ba556, 0x905b71c3, 0xf4bb0a3d, 0x61cbdea8,\n    0xac9a2eb3, 0x39eafa26, 0x5d0a81d8, 0xc87a554d, 0x94ca7624,\n    0x01baa2b1, 0x655ad94f, 0xf02a0dda, 0xdc3a9f9d, 0x494a4b08,\n    0x2daa30f6, 0xb8dae463, 0xe46ac70a, 0x711a139f, 0x15fa6861,\n    0x808abcf4},\n   {0x00000000, 0xcf9e17c8, 0x444d29d1, 0x8bd33e19, 0x889a53a2,\n    0x4704446a, 0xccd77a73, 0x03496dbb, 0xca45a105, 0x05dbb6cd,\n    0x8e0888d4, 0x41969f1c, 0x42dff2a7, 0x8d41e56f, 0x0692db76,\n    0xc90cccbe, 0x4ffa444b, 0x80645383, 0x0bb76d9a, 0xc4297a52,\n    0xc76017e9, 0x08fe0021, 0x832d3e38, 0x4cb329f0, 0x85bfe54e,\n    0x4a21f286, 0xc1f2cc9f, 0x0e6cdb57, 0x0d25b6ec, 0xc2bba124,\n    0x49689f3d, 0x86f688f5, 0x9ff48896, 0x506a9f5e, 0xdbb9a147,\n    0x1427b68f, 0x176edb34, 0xd8f0ccfc, 0x5323f2e5, 0x9cbde52d,\n    0x55b12993, 0x9a2f3e5b, 0x11fc0042, 0xde62178a, 0xdd2b7a31,\n    0x12b56df9, 0x996653e0, 0x56f84428, 0xd00eccdd, 0x1f90db15,\n    0x9443e50c, 0x5bddf2c4, 0x58949f7f, 0x970a88b7, 0x1cd9b6ae,\n    0xd347a166, 0x1a4b6dd8, 0xd5d57a10, 0x5e064409, 0x919853c1,\n    0x92d13e7a, 0x5d4f29b2, 0xd69c17ab, 0x19020063, 0xe498176d,\n    0x2b0600a5, 0xa0d53ebc, 0x6f4b2974, 0x6c0244cf, 0xa39c5307,\n    0x284f6d1e, 0xe7d17ad6, 0x2eddb668, 0xe143a1a0, 0x6a909fb9,\n    0xa50e8871, 0xa647e5ca, 0x69d9f202, 0xe20acc1b, 0x2d94dbd3,\n    0xab625326, 0x64fc44ee, 0xef2f7af7, 0x20b16d3f, 0x23f80084,\n    0xec66174c, 0x67b52955, 0xa82b3e9d, 0x6127f223, 0xaeb9e5eb,\n    0x256adbf2, 0xeaf4cc3a, 0xe9bda181, 0x2623b649, 0xadf08850,\n    0x626e9f98, 0x7b6c9ffb, 0xb4f28833, 0x3f21b62a, 0xf0bfa1e2,\n    0xf3f6cc59, 0x3c68db91, 0xb7bbe588, 0x7825f240, 0xb1293efe,\n    0x7eb72936, 0xf564172f, 0x3afa00e7, 0x39b36d5c, 0xf62d7a94,\n    0x7dfe448d, 0xb2605345, 0x3496dbb0, 0xfb08cc78, 0x70dbf261,\n    0xbf45e5a9, 0xbc0c8812, 0x73929fda, 0xf841a1c3, 0x37dfb60b,\n    0xfed37ab5, 0x314d6d7d, 0xba9e5364, 0x750044ac, 0x76492917,\n    0xb9d73edf, 0x320400c6, 0xfd9a170e, 0x1241289b, 0xdddf3f53,\n    0x560c014a, 0x99921682, 0x9adb7b39, 0x55456cf1, 0xde9652e8,\n    0x11084520, 0xd804899e, 0x179a9e56, 0x9c49a04f, 0x53d7b787,\n    0x509eda3c, 0x9f00cdf4, 0x14d3f3ed, 0xdb4de425, 0x5dbb6cd0,\n    0x92257b18, 0x19f64501, 0xd66852c9, 0xd5213f72, 0x1abf28ba,\n    0x916c16a3, 0x5ef2016b, 0x97fecdd5, 0x5860da1d, 0xd3b3e404,\n    0x1c2df3cc, 0x1f649e77, 0xd0fa89bf, 0x5b29b7a6, 0x94b7a06e,\n    0x8db5a00d, 0x422bb7c5, 0xc9f889dc, 0x06669e14, 0x052ff3af,\n    0xcab1e467, 0x4162da7e, 0x8efccdb6, 0x47f00108, 0x886e16c0,\n    0x03bd28d9, 0xcc233f11, 0xcf6a52aa, 0x00f44562, 0x8b277b7b,\n    0x44b96cb3, 0xc24fe446, 0x0dd1f38e, 0x8602cd97, 0x499cda5f,\n    0x4ad5b7e4, 0x854ba02c, 0x0e989e35, 0xc10689fd, 0x080a4543,\n    0xc794528b, 0x4c476c92, 0x83d97b5a, 0x809016e1, 0x4f0e0129,\n    0xc4dd3f30, 0x0b4328f8, 0xf6d93ff6, 0x3947283e, 0xb2941627,\n    0x7d0a01ef, 0x7e436c54, 0xb1dd7b9c, 0x3a0e4585, 0xf590524d,\n    0x3c9c9ef3, 0xf302893b, 0x78d1b722, 0xb74fa0ea, 0xb406cd51,\n    0x7b98da99, 0xf04be480, 0x3fd5f348, 0xb9237bbd, 0x76bd6c75,\n    0xfd6e526c, 0x32f045a4, 0x31b9281f, 0xfe273fd7, 0x75f401ce,\n    0xba6a1606, 0x7366dab8, 0xbcf8cd70, 0x372bf369, 0xf8b5e4a1,\n    0xfbfc891a, 0x34629ed2, 0xbfb1a0cb, 0x702fb703, 0x692db760,\n    0xa6b3a0a8, 0x2d609eb1, 0xe2fe8979, 0xe1b7e4c2, 0x2e29f30a,\n    0xa5facd13, 0x6a64dadb, 0xa3681665, 0x6cf601ad, 0xe7253fb4,\n    0x28bb287c, 0x2bf245c7, 0xe46c520f, 0x6fbf6c16, 0xa0217bde,\n    0x26d7f32b, 0xe949e4e3, 0x629adafa, 0xad04cd32, 0xae4da089,\n    0x61d3b741, 0xea008958, 0x259e9e90, 0xec92522e, 0x230c45e6,\n    0xa8df7bff, 0x67416c37, 0x6408018c, 0xab961644, 0x2045285d,\n    0xefdb3f95},\n   {0x00000000, 0x24825136, 0x4904a26c, 0x6d86f35a, 0x920944d8,\n    0xb68b15ee, 0xdb0de6b4, 0xff8fb782, 0xff638ff1, 0xdbe1dec7,\n    0xb6672d9d, 0x92e57cab, 0x6d6acb29, 0x49e89a1f, 0x246e6945,\n    0x00ec3873, 0x25b619a3, 0x01344895, 0x6cb2bbcf, 0x4830eaf9,\n    0xb7bf5d7b, 0x933d0c4d, 0xfebbff17, 0xda39ae21, 0xdad59652,\n    0xfe57c764, 0x93d1343e, 0xb7536508, 0x48dcd28a, 0x6c5e83bc,\n    0x01d870e6, 0x255a21d0, 0x4b6c3346, 0x6fee6270, 0x0268912a,\n    0x26eac01c, 0xd965779e, 0xfde726a8, 0x9061d5f2, 0xb4e384c4,\n    0xb40fbcb7, 0x908ded81, 0xfd0b1edb, 0xd9894fed, 0x2606f86f,\n    0x0284a959, 0x6f025a03, 0x4b800b35, 0x6eda2ae5, 0x4a587bd3,\n    0x27de8889, 0x035cd9bf, 0xfcd36e3d, 0xd8513f0b, 0xb5d7cc51,\n    0x91559d67, 0x91b9a514, 0xb53bf422, 0xd8bd0778, 0xfc3f564e,\n    0x03b0e1cc, 0x2732b0fa, 0x4ab443a0, 0x6e361296, 0x96d8668c,\n    0xb25a37ba, 0xdfdcc4e0, 0xfb5e95d6, 0x04d12254, 0x20537362,\n    0x4dd58038, 0x6957d10e, 0x69bbe97d, 0x4d39b84b, 0x20bf4b11,\n    0x043d1a27, 0xfbb2ada5, 0xdf30fc93, 0xb2b60fc9, 0x96345eff,\n    0xb36e7f2f, 0x97ec2e19, 0xfa6add43, 0xdee88c75, 0x21673bf7,\n    0x05e56ac1, 0x6863999b, 0x4ce1c8ad, 0x4c0df0de, 0x688fa1e8,\n    0x050952b2, 0x218b0384, 0xde04b406, 0xfa86e530, 0x9700166a,\n    0xb382475c, 0xddb455ca, 0xf93604fc, 0x94b0f7a6, 0xb032a690,\n    0x4fbd1112, 0x6b3f4024, 0x06b9b37e, 0x223be248, 0x22d7da3b,\n    0x06558b0d, 0x6bd37857, 0x4f512961, 0xb0de9ee3, 0x945ccfd5,\n    0xf9da3c8f, 0xdd586db9, 0xf8024c69, 0xdc801d5f, 0xb106ee05,\n    0x9584bf33, 0x6a0b08b1, 0x4e895987, 0x230faadd, 0x078dfbeb,\n    0x0761c398, 0x23e392ae, 0x4e6561f4, 0x6ae730c2, 0x95688740,\n    0xb1ead676, 0xdc6c252c, 0xf8ee741a, 0xf6c1cb59, 0xd2439a6f,\n    0xbfc56935, 0x9b473803, 0x64c88f81, 0x404adeb7, 0x2dcc2ded,\n    0x094e7cdb, 0x09a244a8, 0x2d20159e, 0x40a6e6c4, 0x6424b7f2,\n    0x9bab0070, 0xbf295146, 0xd2afa21c, 0xf62df32a, 0xd377d2fa,\n    0xf7f583cc, 0x9a737096, 0xbef121a0, 0x417e9622, 0x65fcc714,\n    0x087a344e, 0x2cf86578, 0x2c145d0b, 0x08960c3d, 0x6510ff67,\n    0x4192ae51, 0xbe1d19d3, 0x9a9f48e5, 0xf719bbbf, 0xd39bea89,\n    0xbdadf81f, 0x992fa929, 0xf4a95a73, 0xd02b0b45, 0x2fa4bcc7,\n    0x0b26edf1, 0x66a01eab, 0x42224f9d, 0x42ce77ee, 0x664c26d8,\n    0x0bcad582, 0x2f4884b4, 0xd0c73336, 0xf4456200, 0x99c3915a,\n    0xbd41c06c, 0x981be1bc, 0xbc99b08a, 0xd11f43d0, 0xf59d12e6,\n    0x0a12a564, 0x2e90f452, 0x43160708, 0x6794563e, 0x67786e4d,\n    0x43fa3f7b, 0x2e7ccc21, 0x0afe9d17, 0xf5712a95, 0xd1f37ba3,\n    0xbc7588f9, 0x98f7d9cf, 0x6019add5, 0x449bfce3, 0x291d0fb9,\n    0x0d9f5e8f, 0xf210e90d, 0xd692b83b, 0xbb144b61, 0x9f961a57,\n    0x9f7a2224, 0xbbf87312, 0xd67e8048, 0xf2fcd17e, 0x0d7366fc,\n    0x29f137ca, 0x4477c490, 0x60f595a6, 0x45afb476, 0x612de540,\n    0x0cab161a, 0x2829472c, 0xd7a6f0ae, 0xf324a198, 0x9ea252c2,\n    0xba2003f4, 0xbacc3b87, 0x9e4e6ab1, 0xf3c899eb, 0xd74ac8dd,\n    0x28c57f5f, 0x0c472e69, 0x61c1dd33, 0x45438c05, 0x2b759e93,\n    0x0ff7cfa5, 0x62713cff, 0x46f36dc9, 0xb97cda4b, 0x9dfe8b7d,\n    0xf0787827, 0xd4fa2911, 0xd4161162, 0xf0944054, 0x9d12b30e,\n    0xb990e238, 0x461f55ba, 0x629d048c, 0x0f1bf7d6, 0x2b99a6e0,\n    0x0ec38730, 0x2a41d606, 0x47c7255c, 0x6345746a, 0x9ccac3e8,\n    0xb84892de, 0xd5ce6184, 0xf14c30b2, 0xf1a008c1, 0xd52259f7,\n    0xb8a4aaad, 0x9c26fb9b, 0x63a94c19, 0x472b1d2f, 0x2aadee75,\n    0x0e2fbf43},\n   {0x00000000, 0x36f290f3, 0x6de521e6, 0x5b17b115, 0xdbca43cc,\n    0xed38d33f, 0xb62f622a, 0x80ddf2d9, 0x6ce581d9, 0x5a17112a,\n    0x0100a03f, 0x37f230cc, 0xb72fc215, 0x81dd52e6, 0xdacae3f3,\n    0xec387300, 0xd9cb03b2, 0xef399341, 0xb42e2254, 0x82dcb2a7,\n    0x0201407e, 0x34f3d08d, 0x6fe46198, 0x5916f16b, 0xb52e826b,\n    0x83dc1298, 0xd8cba38d, 0xee39337e, 0x6ee4c1a7, 0x58165154,\n    0x0301e041, 0x35f370b2, 0x68e70125, 0x5e1591d6, 0x050220c3,\n    0x33f0b030, 0xb32d42e9, 0x85dfd21a, 0xdec8630f, 0xe83af3fc,\n    0x040280fc, 0x32f0100f, 0x69e7a11a, 0x5f1531e9, 0xdfc8c330,\n    0xe93a53c3, 0xb22de2d6, 0x84df7225, 0xb12c0297, 0x87de9264,\n    0xdcc92371, 0xea3bb382, 0x6ae6415b, 0x5c14d1a8, 0x070360bd,\n    0x31f1f04e, 0xddc9834e, 0xeb3b13bd, 0xb02ca2a8, 0x86de325b,\n    0x0603c082, 0x30f15071, 0x6be6e164, 0x5d147197, 0xd1ce024a,\n    0xe73c92b9, 0xbc2b23ac, 0x8ad9b35f, 0x0a044186, 0x3cf6d175,\n    0x67e16060, 0x5113f093, 0xbd2b8393, 0x8bd91360, 0xd0cea275,\n    0xe63c3286, 0x66e1c05f, 0x501350ac, 0x0b04e1b9, 0x3df6714a,\n    0x080501f8, 0x3ef7910b, 0x65e0201e, 0x5312b0ed, 0xd3cf4234,\n    0xe53dd2c7, 0xbe2a63d2, 0x88d8f321, 0x64e08021, 0x521210d2,\n    0x0905a1c7, 0x3ff73134, 0xbf2ac3ed, 0x89d8531e, 0xd2cfe20b,\n    0xe43d72f8, 0xb929036f, 0x8fdb939c, 0xd4cc2289, 0xe23eb27a,\n    0x62e340a3, 0x5411d050, 0x0f066145, 0x39f4f1b6, 0xd5cc82b6,\n    0xe33e1245, 0xb829a350, 0x8edb33a3, 0x0e06c17a, 0x38f45189,\n    0x63e3e09c, 0x5511706f, 0x60e200dd, 0x5610902e, 0x0d07213b,\n    0x3bf5b1c8, 0xbb284311, 0x8ddad3e2, 0xd6cd62f7, 0xe03ff204,\n    0x0c078104, 0x3af511f7, 0x61e2a0e2, 0x57103011, 0xd7cdc2c8,\n    0xe13f523b, 0xba28e32e, 0x8cda73dd, 0x78ed02d5, 0x4e1f9226,\n    0x15082333, 0x23fab3c0, 0xa3274119, 0x95d5d1ea, 0xcec260ff,\n    0xf830f00c, 0x1408830c, 0x22fa13ff, 0x79eda2ea, 0x4f1f3219,\n    0xcfc2c0c0, 0xf9305033, 0xa227e126, 0x94d571d5, 0xa1260167,\n    0x97d49194, 0xccc32081, 0xfa31b072, 0x7aec42ab, 0x4c1ed258,\n    0x1709634d, 0x21fbf3be, 0xcdc380be, 0xfb31104d, 0xa026a158,\n    0x96d431ab, 0x1609c372, 0x20fb5381, 0x7bece294, 0x4d1e7267,\n    0x100a03f0, 0x26f89303, 0x7def2216, 0x4b1db2e5, 0xcbc0403c,\n    0xfd32d0cf, 0xa62561da, 0x90d7f129, 0x7cef8229, 0x4a1d12da,\n    0x110aa3cf, 0x27f8333c, 0xa725c1e5, 0x91d75116, 0xcac0e003,\n    0xfc3270f0, 0xc9c10042, 0xff3390b1, 0xa42421a4, 0x92d6b157,\n    0x120b438e, 0x24f9d37d, 0x7fee6268, 0x491cf29b, 0xa524819b,\n    0x93d61168, 0xc8c1a07d, 0xfe33308e, 0x7eeec257, 0x481c52a4,\n    0x130be3b1, 0x25f97342, 0xa923009f, 0x9fd1906c, 0xc4c62179,\n    0xf234b18a, 0x72e94353, 0x441bd3a0, 0x1f0c62b5, 0x29fef246,\n    0xc5c68146, 0xf33411b5, 0xa823a0a0, 0x9ed13053, 0x1e0cc28a,\n    0x28fe5279, 0x73e9e36c, 0x451b739f, 0x70e8032d, 0x461a93de,\n    0x1d0d22cb, 0x2bffb238, 0xab2240e1, 0x9dd0d012, 0xc6c76107,\n    0xf035f1f4, 0x1c0d82f4, 0x2aff1207, 0x71e8a312, 0x471a33e1,\n    0xc7c7c138, 0xf13551cb, 0xaa22e0de, 0x9cd0702d, 0xc1c401ba,\n    0xf7369149, 0xac21205c, 0x9ad3b0af, 0x1a0e4276, 0x2cfcd285,\n    0x77eb6390, 0x4119f363, 0xad218063, 0x9bd31090, 0xc0c4a185,\n    0xf6363176, 0x76ebc3af, 0x4019535c, 0x1b0ee249, 0x2dfc72ba,\n    0x180f0208, 0x2efd92fb, 0x75ea23ee, 0x4318b31d, 0xc3c541c4,\n    0xf537d137, 0xae206022, 0x98d2f0d1, 0x74ea83d1, 0x42181322,\n    0x190fa237, 0x2ffd32c4, 0xaf20c01d, 0x99d250ee, 0xc2c5e1fb,\n    0xf4377108}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0xf390f23600000000, 0xe621e56d00000000,\n    0x15b1175b00000000, 0xcc43cadb00000000, 0x3fd338ed00000000,\n    0x2a622fb600000000, 0xd9f2dd8000000000, 0xd981e56c00000000,\n    0x2a11175a00000000, 0x3fa0000100000000, 0xcc30f23700000000,\n    0x15c22fb700000000, 0xe652dd8100000000, 0xf3e3cada00000000,\n    0x007338ec00000000, 0xb203cbd900000000, 0x419339ef00000000,\n    0x54222eb400000000, 0xa7b2dc8200000000, 0x7e40010200000000,\n    0x8dd0f33400000000, 0x9861e46f00000000, 0x6bf1165900000000,\n    0x6b822eb500000000, 0x9812dc8300000000, 0x8da3cbd800000000,\n    0x7e3339ee00000000, 0xa7c1e46e00000000, 0x5451165800000000,\n    0x41e0010300000000, 0xb270f33500000000, 0x2501e76800000000,\n    0xd691155e00000000, 0xc320020500000000, 0x30b0f03300000000,\n    0xe9422db300000000, 0x1ad2df8500000000, 0x0f63c8de00000000,\n    0xfcf33ae800000000, 0xfc80020400000000, 0x0f10f03200000000,\n    0x1aa1e76900000000, 0xe931155f00000000, 0x30c3c8df00000000,\n    0xc3533ae900000000, 0xd6e22db200000000, 0x2572df8400000000,\n    0x97022cb100000000, 0x6492de8700000000, 0x7123c9dc00000000,\n    0x82b33bea00000000, 0x5b41e66a00000000, 0xa8d1145c00000000,\n    0xbd60030700000000, 0x4ef0f13100000000, 0x4e83c9dd00000000,\n    0xbd133beb00000000, 0xa8a22cb000000000, 0x5b32de8600000000,\n    0x82c0030600000000, 0x7150f13000000000, 0x64e1e66b00000000,\n    0x9771145d00000000, 0x4a02ced100000000, 0xb9923ce700000000,\n    0xac232bbc00000000, 0x5fb3d98a00000000, 0x8641040a00000000,\n    0x75d1f63c00000000, 0x6060e16700000000, 0x93f0135100000000,\n    0x93832bbd00000000, 0x6013d98b00000000, 0x75a2ced000000000,\n    0x86323ce600000000, 0x5fc0e16600000000, 0xac50135000000000,\n    0xb9e1040b00000000, 0x4a71f63d00000000, 0xf801050800000000,\n    0x0b91f73e00000000, 0x1e20e06500000000, 0xedb0125300000000,\n    0x3442cfd300000000, 0xc7d23de500000000, 0xd2632abe00000000,\n    0x21f3d88800000000, 0x2180e06400000000, 0xd210125200000000,\n    0xc7a1050900000000, 0x3431f73f00000000, 0xedc32abf00000000,\n    0x1e53d88900000000, 0x0be2cfd200000000, 0xf8723de400000000,\n    0x6f0329b900000000, 0x9c93db8f00000000, 0x8922ccd400000000,\n    0x7ab23ee200000000, 0xa340e36200000000, 0x50d0115400000000,\n    0x4561060f00000000, 0xb6f1f43900000000, 0xb682ccd500000000,\n    0x45123ee300000000, 0x50a329b800000000, 0xa333db8e00000000,\n    0x7ac1060e00000000, 0x8951f43800000000, 0x9ce0e36300000000,\n    0x6f70115500000000, 0xdd00e26000000000, 0x2e90105600000000,\n    0x3b21070d00000000, 0xc8b1f53b00000000, 0x114328bb00000000,\n    0xe2d3da8d00000000, 0xf762cdd600000000, 0x04f23fe000000000,\n    0x0481070c00000000, 0xf711f53a00000000, 0xe2a0e26100000000,\n    0x1130105700000000, 0xc8c2cdd700000000, 0x3b523fe100000000,\n    0x2ee328ba00000000, 0xdd73da8c00000000, 0xd502ed7800000000,\n    0x26921f4e00000000, 0x3323081500000000, 0xc0b3fa2300000000,\n    0x194127a300000000, 0xead1d59500000000, 0xff60c2ce00000000,\n    0x0cf030f800000000, 0x0c83081400000000, 0xff13fa2200000000,\n    0xeaa2ed7900000000, 0x19321f4f00000000, 0xc0c0c2cf00000000,\n    0x335030f900000000, 0x26e127a200000000, 0xd571d59400000000,\n    0x670126a100000000, 0x9491d49700000000, 0x8120c3cc00000000,\n    0x72b031fa00000000, 0xab42ec7a00000000, 0x58d21e4c00000000,\n    0x4d63091700000000, 0xbef3fb2100000000, 0xbe80c3cd00000000,\n    0x4d1031fb00000000, 0x58a126a000000000, 0xab31d49600000000,\n    0x72c3091600000000, 0x8153fb2000000000, 0x94e2ec7b00000000,\n    0x67721e4d00000000, 0xf0030a1000000000, 0x0393f82600000000,\n    0x1622ef7d00000000, 0xe5b21d4b00000000, 0x3c40c0cb00000000,\n    0xcfd032fd00000000, 0xda6125a600000000, 0x29f1d79000000000,\n    0x2982ef7c00000000, 0xda121d4a00000000, 0xcfa30a1100000000,\n    0x3c33f82700000000, 0xe5c125a700000000, 0x1651d79100000000,\n    0x03e0c0ca00000000, 0xf07032fc00000000, 0x4200c1c900000000,\n    0xb19033ff00000000, 0xa42124a400000000, 0x57b1d69200000000,\n    0x8e430b1200000000, 0x7dd3f92400000000, 0x6862ee7f00000000,\n    0x9bf21c4900000000, 0x9b8124a500000000, 0x6811d69300000000,\n    0x7da0c1c800000000, 0x8e3033fe00000000, 0x57c2ee7e00000000,\n    0xa4521c4800000000, 0xb1e30b1300000000, 0x4273f92500000000,\n    0x9f0023a900000000, 0x6c90d19f00000000, 0x7921c6c400000000,\n    0x8ab134f200000000, 0x5343e97200000000, 0xa0d31b4400000000,\n    0xb5620c1f00000000, 0x46f2fe2900000000, 0x4681c6c500000000,\n    0xb51134f300000000, 0xa0a023a800000000, 0x5330d19e00000000,\n    0x8ac20c1e00000000, 0x7952fe2800000000, 0x6ce3e97300000000,\n    0x9f731b4500000000, 0x2d03e87000000000, 0xde931a4600000000,\n    0xcb220d1d00000000, 0x38b2ff2b00000000, 0xe14022ab00000000,\n    0x12d0d09d00000000, 0x0761c7c600000000, 0xf4f135f000000000,\n    0xf4820d1c00000000, 0x0712ff2a00000000, 0x12a3e87100000000,\n    0xe1331a4700000000, 0x38c1c7c700000000, 0xcb5135f100000000,\n    0xdee022aa00000000, 0x2d70d09c00000000, 0xba01c4c100000000,\n    0x499136f700000000, 0x5c2021ac00000000, 0xafb0d39a00000000,\n    0x76420e1a00000000, 0x85d2fc2c00000000, 0x9063eb7700000000,\n    0x63f3194100000000, 0x638021ad00000000, 0x9010d39b00000000,\n    0x85a1c4c000000000, 0x763136f600000000, 0xafc3eb7600000000,\n    0x5c53194000000000, 0x49e20e1b00000000, 0xba72fc2d00000000,\n    0x08020f1800000000, 0xfb92fd2e00000000, 0xee23ea7500000000,\n    0x1db3184300000000, 0xc441c5c300000000, 0x37d137f500000000,\n    0x226020ae00000000, 0xd1f0d29800000000, 0xd183ea7400000000,\n    0x2213184200000000, 0x37a20f1900000000, 0xc432fd2f00000000,\n    0x1dc020af00000000, 0xee50d29900000000, 0xfbe1c5c200000000,\n    0x087137f400000000},\n   {0x0000000000000000, 0x3651822400000000, 0x6ca2044900000000,\n    0x5af3866d00000000, 0xd844099200000000, 0xee158bb600000000,\n    0xb4e60ddb00000000, 0x82b78fff00000000, 0xf18f63ff00000000,\n    0xc7dee1db00000000, 0x9d2d67b600000000, 0xab7ce59200000000,\n    0x29cb6a6d00000000, 0x1f9ae84900000000, 0x45696e2400000000,\n    0x7338ec0000000000, 0xa319b62500000000, 0x9548340100000000,\n    0xcfbbb26c00000000, 0xf9ea304800000000, 0x7b5dbfb700000000,\n    0x4d0c3d9300000000, 0x17ffbbfe00000000, 0x21ae39da00000000,\n    0x5296d5da00000000, 0x64c757fe00000000, 0x3e34d19300000000,\n    0x086553b700000000, 0x8ad2dc4800000000, 0xbc835e6c00000000,\n    0xe670d80100000000, 0xd0215a2500000000, 0x46336c4b00000000,\n    0x7062ee6f00000000, 0x2a91680200000000, 0x1cc0ea2600000000,\n    0x9e7765d900000000, 0xa826e7fd00000000, 0xf2d5619000000000,\n    0xc484e3b400000000, 0xb7bc0fb400000000, 0x81ed8d9000000000,\n    0xdb1e0bfd00000000, 0xed4f89d900000000, 0x6ff8062600000000,\n    0x59a9840200000000, 0x035a026f00000000, 0x350b804b00000000,\n    0xe52ada6e00000000, 0xd37b584a00000000, 0x8988de2700000000,\n    0xbfd95c0300000000, 0x3d6ed3fc00000000, 0x0b3f51d800000000,\n    0x51ccd7b500000000, 0x679d559100000000, 0x14a5b99100000000,\n    0x22f43bb500000000, 0x7807bdd800000000, 0x4e563ffc00000000,\n    0xcce1b00300000000, 0xfab0322700000000, 0xa043b44a00000000,\n    0x9612366e00000000, 0x8c66d89600000000, 0xba375ab200000000,\n    0xe0c4dcdf00000000, 0xd6955efb00000000, 0x5422d10400000000,\n    0x6273532000000000, 0x3880d54d00000000, 0x0ed1576900000000,\n    0x7de9bb6900000000, 0x4bb8394d00000000, 0x114bbf2000000000,\n    0x271a3d0400000000, 0xa5adb2fb00000000, 0x93fc30df00000000,\n    0xc90fb6b200000000, 0xff5e349600000000, 0x2f7f6eb300000000,\n    0x192eec9700000000, 0x43dd6afa00000000, 0x758ce8de00000000,\n    0xf73b672100000000, 0xc16ae50500000000, 0x9b99636800000000,\n    0xadc8e14c00000000, 0xdef00d4c00000000, 0xe8a18f6800000000,\n    0xb252090500000000, 0x84038b2100000000, 0x06b404de00000000,\n    0x30e586fa00000000, 0x6a16009700000000, 0x5c4782b300000000,\n    0xca55b4dd00000000, 0xfc0436f900000000, 0xa6f7b09400000000,\n    0x90a632b000000000, 0x1211bd4f00000000, 0x24403f6b00000000,\n    0x7eb3b90600000000, 0x48e23b2200000000, 0x3bdad72200000000,\n    0x0d8b550600000000, 0x5778d36b00000000, 0x6129514f00000000,\n    0xe39edeb000000000, 0xd5cf5c9400000000, 0x8f3cdaf900000000,\n    0xb96d58dd00000000, 0x694c02f800000000, 0x5f1d80dc00000000,\n    0x05ee06b100000000, 0x33bf849500000000, 0xb1080b6a00000000,\n    0x8759894e00000000, 0xddaa0f2300000000, 0xebfb8d0700000000,\n    0x98c3610700000000, 0xae92e32300000000, 0xf461654e00000000,\n    0xc230e76a00000000, 0x4087689500000000, 0x76d6eab100000000,\n    0x2c256cdc00000000, 0x1a74eef800000000, 0x59cbc1f600000000,\n    0x6f9a43d200000000, 0x3569c5bf00000000, 0x0338479b00000000,\n    0x818fc86400000000, 0xb7de4a4000000000, 0xed2dcc2d00000000,\n    0xdb7c4e0900000000, 0xa844a20900000000, 0x9e15202d00000000,\n    0xc4e6a64000000000, 0xf2b7246400000000, 0x7000ab9b00000000,\n    0x465129bf00000000, 0x1ca2afd200000000, 0x2af32df600000000,\n    0xfad277d300000000, 0xcc83f5f700000000, 0x9670739a00000000,\n    0xa021f1be00000000, 0x22967e4100000000, 0x14c7fc6500000000,\n    0x4e347a0800000000, 0x7865f82c00000000, 0x0b5d142c00000000,\n    0x3d0c960800000000, 0x67ff106500000000, 0x51ae924100000000,\n    0xd3191dbe00000000, 0xe5489f9a00000000, 0xbfbb19f700000000,\n    0x89ea9bd300000000, 0x1ff8adbd00000000, 0x29a92f9900000000,\n    0x735aa9f400000000, 0x450b2bd000000000, 0xc7bca42f00000000,\n    0xf1ed260b00000000, 0xab1ea06600000000, 0x9d4f224200000000,\n    0xee77ce4200000000, 0xd8264c6600000000, 0x82d5ca0b00000000,\n    0xb484482f00000000, 0x3633c7d000000000, 0x006245f400000000,\n    0x5a91c39900000000, 0x6cc041bd00000000, 0xbce11b9800000000,\n    0x8ab099bc00000000, 0xd0431fd100000000, 0xe6129df500000000,\n    0x64a5120a00000000, 0x52f4902e00000000, 0x0807164300000000,\n    0x3e56946700000000, 0x4d6e786700000000, 0x7b3ffa4300000000,\n    0x21cc7c2e00000000, 0x179dfe0a00000000, 0x952a71f500000000,\n    0xa37bf3d100000000, 0xf98875bc00000000, 0xcfd9f79800000000,\n    0xd5ad196000000000, 0xe3fc9b4400000000, 0xb90f1d2900000000,\n    0x8f5e9f0d00000000, 0x0de910f200000000, 0x3bb892d600000000,\n    0x614b14bb00000000, 0x571a969f00000000, 0x24227a9f00000000,\n    0x1273f8bb00000000, 0x48807ed600000000, 0x7ed1fcf200000000,\n    0xfc66730d00000000, 0xca37f12900000000, 0x90c4774400000000,\n    0xa695f56000000000, 0x76b4af4500000000, 0x40e52d6100000000,\n    0x1a16ab0c00000000, 0x2c47292800000000, 0xaef0a6d700000000,\n    0x98a124f300000000, 0xc252a29e00000000, 0xf40320ba00000000,\n    0x873bccba00000000, 0xb16a4e9e00000000, 0xeb99c8f300000000,\n    0xddc84ad700000000, 0x5f7fc52800000000, 0x692e470c00000000,\n    0x33ddc16100000000, 0x058c434500000000, 0x939e752b00000000,\n    0xa5cff70f00000000, 0xff3c716200000000, 0xc96df34600000000,\n    0x4bda7cb900000000, 0x7d8bfe9d00000000, 0x277878f000000000,\n    0x1129fad400000000, 0x621116d400000000, 0x544094f000000000,\n    0x0eb3129d00000000, 0x38e290b900000000, 0xba551f4600000000,\n    0x8c049d6200000000, 0xd6f71b0f00000000, 0xe0a6992b00000000,\n    0x3087c30e00000000, 0x06d6412a00000000, 0x5c25c74700000000,\n    0x6a74456300000000, 0xe8c3ca9c00000000, 0xde9248b800000000,\n    0x8461ced500000000, 0xb2304cf100000000, 0xc108a0f100000000,\n    0xf75922d500000000, 0xadaaa4b800000000, 0x9bfb269c00000000,\n    0x194ca96300000000, 0x2f1d2b4700000000, 0x75eead2a00000000,\n    0x43bf2f0e00000000},\n   {0x0000000000000000, 0xc8179ecf00000000, 0xd1294d4400000000,\n    0x193ed38b00000000, 0xa2539a8800000000, 0x6a44044700000000,\n    0x737ad7cc00000000, 0xbb6d490300000000, 0x05a145ca00000000,\n    0xcdb6db0500000000, 0xd488088e00000000, 0x1c9f964100000000,\n    0xa7f2df4200000000, 0x6fe5418d00000000, 0x76db920600000000,\n    0xbecc0cc900000000, 0x4b44fa4f00000000, 0x8353648000000000,\n    0x9a6db70b00000000, 0x527a29c400000000, 0xe91760c700000000,\n    0x2100fe0800000000, 0x383e2d8300000000, 0xf029b34c00000000,\n    0x4ee5bf8500000000, 0x86f2214a00000000, 0x9fccf2c100000000,\n    0x57db6c0e00000000, 0xecb6250d00000000, 0x24a1bbc200000000,\n    0x3d9f684900000000, 0xf588f68600000000, 0x9688f49f00000000,\n    0x5e9f6a5000000000, 0x47a1b9db00000000, 0x8fb6271400000000,\n    0x34db6e1700000000, 0xfcccf0d800000000, 0xe5f2235300000000,\n    0x2de5bd9c00000000, 0x9329b15500000000, 0x5b3e2f9a00000000,\n    0x4200fc1100000000, 0x8a1762de00000000, 0x317a2bdd00000000,\n    0xf96db51200000000, 0xe053669900000000, 0x2844f85600000000,\n    0xddcc0ed000000000, 0x15db901f00000000, 0x0ce5439400000000,\n    0xc4f2dd5b00000000, 0x7f9f945800000000, 0xb7880a9700000000,\n    0xaeb6d91c00000000, 0x66a147d300000000, 0xd86d4b1a00000000,\n    0x107ad5d500000000, 0x0944065e00000000, 0xc153989100000000,\n    0x7a3ed19200000000, 0xb2294f5d00000000, 0xab179cd600000000,\n    0x6300021900000000, 0x6d1798e400000000, 0xa500062b00000000,\n    0xbc3ed5a000000000, 0x74294b6f00000000, 0xcf44026c00000000,\n    0x07539ca300000000, 0x1e6d4f2800000000, 0xd67ad1e700000000,\n    0x68b6dd2e00000000, 0xa0a143e100000000, 0xb99f906a00000000,\n    0x71880ea500000000, 0xcae547a600000000, 0x02f2d96900000000,\n    0x1bcc0ae200000000, 0xd3db942d00000000, 0x265362ab00000000,\n    0xee44fc6400000000, 0xf77a2fef00000000, 0x3f6db12000000000,\n    0x8400f82300000000, 0x4c1766ec00000000, 0x5529b56700000000,\n    0x9d3e2ba800000000, 0x23f2276100000000, 0xebe5b9ae00000000,\n    0xf2db6a2500000000, 0x3accf4ea00000000, 0x81a1bde900000000,\n    0x49b6232600000000, 0x5088f0ad00000000, 0x989f6e6200000000,\n    0xfb9f6c7b00000000, 0x3388f2b400000000, 0x2ab6213f00000000,\n    0xe2a1bff000000000, 0x59ccf6f300000000, 0x91db683c00000000,\n    0x88e5bbb700000000, 0x40f2257800000000, 0xfe3e29b100000000,\n    0x3629b77e00000000, 0x2f1764f500000000, 0xe700fa3a00000000,\n    0x5c6db33900000000, 0x947a2df600000000, 0x8d44fe7d00000000,\n    0x455360b200000000, 0xb0db963400000000, 0x78cc08fb00000000,\n    0x61f2db7000000000, 0xa9e545bf00000000, 0x12880cbc00000000,\n    0xda9f927300000000, 0xc3a141f800000000, 0x0bb6df3700000000,\n    0xb57ad3fe00000000, 0x7d6d4d3100000000, 0x64539eba00000000,\n    0xac44007500000000, 0x1729497600000000, 0xdf3ed7b900000000,\n    0xc600043200000000, 0x0e179afd00000000, 0x9b28411200000000,\n    0x533fdfdd00000000, 0x4a010c5600000000, 0x8216929900000000,\n    0x397bdb9a00000000, 0xf16c455500000000, 0xe85296de00000000,\n    0x2045081100000000, 0x9e8904d800000000, 0x569e9a1700000000,\n    0x4fa0499c00000000, 0x87b7d75300000000, 0x3cda9e5000000000,\n    0xf4cd009f00000000, 0xedf3d31400000000, 0x25e44ddb00000000,\n    0xd06cbb5d00000000, 0x187b259200000000, 0x0145f61900000000,\n    0xc95268d600000000, 0x723f21d500000000, 0xba28bf1a00000000,\n    0xa3166c9100000000, 0x6b01f25e00000000, 0xd5cdfe9700000000,\n    0x1dda605800000000, 0x04e4b3d300000000, 0xccf32d1c00000000,\n    0x779e641f00000000, 0xbf89fad000000000, 0xa6b7295b00000000,\n    0x6ea0b79400000000, 0x0da0b58d00000000, 0xc5b72b4200000000,\n    0xdc89f8c900000000, 0x149e660600000000, 0xaff32f0500000000,\n    0x67e4b1ca00000000, 0x7eda624100000000, 0xb6cdfc8e00000000,\n    0x0801f04700000000, 0xc0166e8800000000, 0xd928bd0300000000,\n    0x113f23cc00000000, 0xaa526acf00000000, 0x6245f40000000000,\n    0x7b7b278b00000000, 0xb36cb94400000000, 0x46e44fc200000000,\n    0x8ef3d10d00000000, 0x97cd028600000000, 0x5fda9c4900000000,\n    0xe4b7d54a00000000, 0x2ca04b8500000000, 0x359e980e00000000,\n    0xfd8906c100000000, 0x43450a0800000000, 0x8b5294c700000000,\n    0x926c474c00000000, 0x5a7bd98300000000, 0xe116908000000000,\n    0x29010e4f00000000, 0x303fddc400000000, 0xf828430b00000000,\n    0xf63fd9f600000000, 0x3e28473900000000, 0x271694b200000000,\n    0xef010a7d00000000, 0x546c437e00000000, 0x9c7bddb100000000,\n    0x85450e3a00000000, 0x4d5290f500000000, 0xf39e9c3c00000000,\n    0x3b8902f300000000, 0x22b7d17800000000, 0xeaa04fb700000000,\n    0x51cd06b400000000, 0x99da987b00000000, 0x80e44bf000000000,\n    0x48f3d53f00000000, 0xbd7b23b900000000, 0x756cbd7600000000,\n    0x6c526efd00000000, 0xa445f03200000000, 0x1f28b93100000000,\n    0xd73f27fe00000000, 0xce01f47500000000, 0x06166aba00000000,\n    0xb8da667300000000, 0x70cdf8bc00000000, 0x69f32b3700000000,\n    0xa1e4b5f800000000, 0x1a89fcfb00000000, 0xd29e623400000000,\n    0xcba0b1bf00000000, 0x03b72f7000000000, 0x60b72d6900000000,\n    0xa8a0b3a600000000, 0xb19e602d00000000, 0x7989fee200000000,\n    0xc2e4b7e100000000, 0x0af3292e00000000, 0x13cdfaa500000000,\n    0xdbda646a00000000, 0x651668a300000000, 0xad01f66c00000000,\n    0xb43f25e700000000, 0x7c28bb2800000000, 0xc745f22b00000000,\n    0x0f526ce400000000, 0x166cbf6f00000000, 0xde7b21a000000000,\n    0x2bf3d72600000000, 0xe3e449e900000000, 0xfada9a6200000000,\n    0x32cd04ad00000000, 0x89a04dae00000000, 0x41b7d36100000000,\n    0x588900ea00000000, 0x909e9e2500000000, 0x2e5292ec00000000,\n    0xe6450c2300000000, 0xff7bdfa800000000, 0x376c416700000000,\n    0x8c01086400000000, 0x441696ab00000000, 0x5d28452000000000,\n    0x953fdbef00000000},\n   {0x0000000000000000, 0x95d4709500000000, 0x6baf90f100000000,\n    0xfe7be06400000000, 0x9758503800000000, 0x028c20ad00000000,\n    0xfcf7c0c900000000, 0x6923b05c00000000, 0x2eb1a07000000000,\n    0xbb65d0e500000000, 0x451e308100000000, 0xd0ca401400000000,\n    0xb9e9f04800000000, 0x2c3d80dd00000000, 0xd24660b900000000,\n    0x4792102c00000000, 0x5c6241e100000000, 0xc9b6317400000000,\n    0x37cdd11000000000, 0xa219a18500000000, 0xcb3a11d900000000,\n    0x5eee614c00000000, 0xa095812800000000, 0x3541f1bd00000000,\n    0x72d3e19100000000, 0xe707910400000000, 0x197c716000000000,\n    0x8ca801f500000000, 0xe58bb1a900000000, 0x705fc13c00000000,\n    0x8e24215800000000, 0x1bf051cd00000000, 0xf9c2f31900000000,\n    0x6c16838c00000000, 0x926d63e800000000, 0x07b9137d00000000,\n    0x6e9aa32100000000, 0xfb4ed3b400000000, 0x053533d000000000,\n    0x90e1434500000000, 0xd773536900000000, 0x42a723fc00000000,\n    0xbcdcc39800000000, 0x2908b30d00000000, 0x402b035100000000,\n    0xd5ff73c400000000, 0x2b8493a000000000, 0xbe50e33500000000,\n    0xa5a0b2f800000000, 0x3074c26d00000000, 0xce0f220900000000,\n    0x5bdb529c00000000, 0x32f8e2c000000000, 0xa72c925500000000,\n    0x5957723100000000, 0xcc8302a400000000, 0x8b11128800000000,\n    0x1ec5621d00000000, 0xe0be827900000000, 0x756af2ec00000000,\n    0x1c4942b000000000, 0x899d322500000000, 0x77e6d24100000000,\n    0xe232a2d400000000, 0xf285e73300000000, 0x675197a600000000,\n    0x992a77c200000000, 0x0cfe075700000000, 0x65ddb70b00000000,\n    0xf009c79e00000000, 0x0e7227fa00000000, 0x9ba6576f00000000,\n    0xdc34474300000000, 0x49e037d600000000, 0xb79bd7b200000000,\n    0x224fa72700000000, 0x4b6c177b00000000, 0xdeb867ee00000000,\n    0x20c3878a00000000, 0xb517f71f00000000, 0xaee7a6d200000000,\n    0x3b33d64700000000, 0xc548362300000000, 0x509c46b600000000,\n    0x39bff6ea00000000, 0xac6b867f00000000, 0x5210661b00000000,\n    0xc7c4168e00000000, 0x805606a200000000, 0x1582763700000000,\n    0xebf9965300000000, 0x7e2de6c600000000, 0x170e569a00000000,\n    0x82da260f00000000, 0x7ca1c66b00000000, 0xe975b6fe00000000,\n    0x0b47142a00000000, 0x9e9364bf00000000, 0x60e884db00000000,\n    0xf53cf44e00000000, 0x9c1f441200000000, 0x09cb348700000000,\n    0xf7b0d4e300000000, 0x6264a47600000000, 0x25f6b45a00000000,\n    0xb022c4cf00000000, 0x4e5924ab00000000, 0xdb8d543e00000000,\n    0xb2aee46200000000, 0x277a94f700000000, 0xd901749300000000,\n    0x4cd5040600000000, 0x572555cb00000000, 0xc2f1255e00000000,\n    0x3c8ac53a00000000, 0xa95eb5af00000000, 0xc07d05f300000000,\n    0x55a9756600000000, 0xabd2950200000000, 0x3e06e59700000000,\n    0x7994f5bb00000000, 0xec40852e00000000, 0x123b654a00000000,\n    0x87ef15df00000000, 0xeecca58300000000, 0x7b18d51600000000,\n    0x8563357200000000, 0x10b745e700000000, 0xe40bcf6700000000,\n    0x71dfbff200000000, 0x8fa45f9600000000, 0x1a702f0300000000,\n    0x73539f5f00000000, 0xe687efca00000000, 0x18fc0fae00000000,\n    0x8d287f3b00000000, 0xcaba6f1700000000, 0x5f6e1f8200000000,\n    0xa115ffe600000000, 0x34c18f7300000000, 0x5de23f2f00000000,\n    0xc8364fba00000000, 0x364dafde00000000, 0xa399df4b00000000,\n    0xb8698e8600000000, 0x2dbdfe1300000000, 0xd3c61e7700000000,\n    0x46126ee200000000, 0x2f31debe00000000, 0xbae5ae2b00000000,\n    0x449e4e4f00000000, 0xd14a3eda00000000, 0x96d82ef600000000,\n    0x030c5e6300000000, 0xfd77be0700000000, 0x68a3ce9200000000,\n    0x01807ece00000000, 0x94540e5b00000000, 0x6a2fee3f00000000,\n    0xfffb9eaa00000000, 0x1dc93c7e00000000, 0x881d4ceb00000000,\n    0x7666ac8f00000000, 0xe3b2dc1a00000000, 0x8a916c4600000000,\n    0x1f451cd300000000, 0xe13efcb700000000, 0x74ea8c2200000000,\n    0x33789c0e00000000, 0xa6acec9b00000000, 0x58d70cff00000000,\n    0xcd037c6a00000000, 0xa420cc3600000000, 0x31f4bca300000000,\n    0xcf8f5cc700000000, 0x5a5b2c5200000000, 0x41ab7d9f00000000,\n    0xd47f0d0a00000000, 0x2a04ed6e00000000, 0xbfd09dfb00000000,\n    0xd6f32da700000000, 0x43275d3200000000, 0xbd5cbd5600000000,\n    0x2888cdc300000000, 0x6f1addef00000000, 0xfacead7a00000000,\n    0x04b54d1e00000000, 0x91613d8b00000000, 0xf8428dd700000000,\n    0x6d96fd4200000000, 0x93ed1d2600000000, 0x06396db300000000,\n    0x168e285400000000, 0x835a58c100000000, 0x7d21b8a500000000,\n    0xe8f5c83000000000, 0x81d6786c00000000, 0x140208f900000000,\n    0xea79e89d00000000, 0x7fad980800000000, 0x383f882400000000,\n    0xadebf8b100000000, 0x539018d500000000, 0xc644684000000000,\n    0xaf67d81c00000000, 0x3ab3a88900000000, 0xc4c848ed00000000,\n    0x511c387800000000, 0x4aec69b500000000, 0xdf38192000000000,\n    0x2143f94400000000, 0xb49789d100000000, 0xddb4398d00000000,\n    0x4860491800000000, 0xb61ba97c00000000, 0x23cfd9e900000000,\n    0x645dc9c500000000, 0xf189b95000000000, 0x0ff2593400000000,\n    0x9a2629a100000000, 0xf30599fd00000000, 0x66d1e96800000000,\n    0x98aa090c00000000, 0x0d7e799900000000, 0xef4cdb4d00000000,\n    0x7a98abd800000000, 0x84e34bbc00000000, 0x11373b2900000000,\n    0x78148b7500000000, 0xedc0fbe000000000, 0x13bb1b8400000000,\n    0x866f6b1100000000, 0xc1fd7b3d00000000, 0x54290ba800000000,\n    0xaa52ebcc00000000, 0x3f869b5900000000, 0x56a52b0500000000,\n    0xc3715b9000000000, 0x3d0abbf400000000, 0xa8decb6100000000,\n    0xb32e9aac00000000, 0x26faea3900000000, 0xd8810a5d00000000,\n    0x4d557ac800000000, 0x2476ca9400000000, 0xb1a2ba0100000000,\n    0x4fd95a6500000000, 0xda0d2af000000000, 0x9d9f3adc00000000,\n    0x084b4a4900000000, 0xf630aa2d00000000, 0x63e4dab800000000,\n    0x0ac76ae400000000, 0x9f131a7100000000, 0x6168fa1500000000,\n    0xf4bc8a8000000000},\n   {0x0000000000000000, 0x1f17f08000000000, 0x7f2891da00000000,\n    0x603f615a00000000, 0xbf56536e00000000, 0xa041a3ee00000000,\n    0xc07ec2b400000000, 0xdf69323400000000, 0x7eada6dc00000000,\n    0x61ba565c00000000, 0x0185370600000000, 0x1e92c78600000000,\n    0xc1fbf5b200000000, 0xdeec053200000000, 0xbed3646800000000,\n    0xa1c494e800000000, 0xbd5c3c6200000000, 0xa24bcce200000000,\n    0xc274adb800000000, 0xdd635d3800000000, 0x020a6f0c00000000,\n    0x1d1d9f8c00000000, 0x7d22fed600000000, 0x62350e5600000000,\n    0xc3f19abe00000000, 0xdce66a3e00000000, 0xbcd90b6400000000,\n    0xa3cefbe400000000, 0x7ca7c9d000000000, 0x63b0395000000000,\n    0x038f580a00000000, 0x1c98a88a00000000, 0x7ab978c400000000,\n    0x65ae884400000000, 0x0591e91e00000000, 0x1a86199e00000000,\n    0xc5ef2baa00000000, 0xdaf8db2a00000000, 0xbac7ba7000000000,\n    0xa5d04af000000000, 0x0414de1800000000, 0x1b032e9800000000,\n    0x7b3c4fc200000000, 0x642bbf4200000000, 0xbb428d7600000000,\n    0xa4557df600000000, 0xc46a1cac00000000, 0xdb7dec2c00000000,\n    0xc7e544a600000000, 0xd8f2b42600000000, 0xb8cdd57c00000000,\n    0xa7da25fc00000000, 0x78b317c800000000, 0x67a4e74800000000,\n    0x079b861200000000, 0x188c769200000000, 0xb948e27a00000000,\n    0xa65f12fa00000000, 0xc66073a000000000, 0xd977832000000000,\n    0x061eb11400000000, 0x1909419400000000, 0x793620ce00000000,\n    0x6621d04e00000000, 0xb574805300000000, 0xaa6370d300000000,\n    0xca5c118900000000, 0xd54be10900000000, 0x0a22d33d00000000,\n    0x153523bd00000000, 0x750a42e700000000, 0x6a1db26700000000,\n    0xcbd9268f00000000, 0xd4ced60f00000000, 0xb4f1b75500000000,\n    0xabe647d500000000, 0x748f75e100000000, 0x6b98856100000000,\n    0x0ba7e43b00000000, 0x14b014bb00000000, 0x0828bc3100000000,\n    0x173f4cb100000000, 0x77002deb00000000, 0x6817dd6b00000000,\n    0xb77eef5f00000000, 0xa8691fdf00000000, 0xc8567e8500000000,\n    0xd7418e0500000000, 0x76851aed00000000, 0x6992ea6d00000000,\n    0x09ad8b3700000000, 0x16ba7bb700000000, 0xc9d3498300000000,\n    0xd6c4b90300000000, 0xb6fbd85900000000, 0xa9ec28d900000000,\n    0xcfcdf89700000000, 0xd0da081700000000, 0xb0e5694d00000000,\n    0xaff299cd00000000, 0x709babf900000000, 0x6f8c5b7900000000,\n    0x0fb33a2300000000, 0x10a4caa300000000, 0xb1605e4b00000000,\n    0xae77aecb00000000, 0xce48cf9100000000, 0xd15f3f1100000000,\n    0x0e360d2500000000, 0x1121fda500000000, 0x711e9cff00000000,\n    0x6e096c7f00000000, 0x7291c4f500000000, 0x6d86347500000000,\n    0x0db9552f00000000, 0x12aea5af00000000, 0xcdc7979b00000000,\n    0xd2d0671b00000000, 0xb2ef064100000000, 0xadf8f6c100000000,\n    0x0c3c622900000000, 0x132b92a900000000, 0x7314f3f300000000,\n    0x6c03037300000000, 0xb36a314700000000, 0xac7dc1c700000000,\n    0xcc42a09d00000000, 0xd355501d00000000, 0x6ae900a700000000,\n    0x75fef02700000000, 0x15c1917d00000000, 0x0ad661fd00000000,\n    0xd5bf53c900000000, 0xcaa8a34900000000, 0xaa97c21300000000,\n    0xb580329300000000, 0x1444a67b00000000, 0x0b5356fb00000000,\n    0x6b6c37a100000000, 0x747bc72100000000, 0xab12f51500000000,\n    0xb405059500000000, 0xd43a64cf00000000, 0xcb2d944f00000000,\n    0xd7b53cc500000000, 0xc8a2cc4500000000, 0xa89dad1f00000000,\n    0xb78a5d9f00000000, 0x68e36fab00000000, 0x77f49f2b00000000,\n    0x17cbfe7100000000, 0x08dc0ef100000000, 0xa9189a1900000000,\n    0xb60f6a9900000000, 0xd6300bc300000000, 0xc927fb4300000000,\n    0x164ec97700000000, 0x095939f700000000, 0x696658ad00000000,\n    0x7671a82d00000000, 0x1050786300000000, 0x0f4788e300000000,\n    0x6f78e9b900000000, 0x706f193900000000, 0xaf062b0d00000000,\n    0xb011db8d00000000, 0xd02ebad700000000, 0xcf394a5700000000,\n    0x6efddebf00000000, 0x71ea2e3f00000000, 0x11d54f6500000000,\n    0x0ec2bfe500000000, 0xd1ab8dd100000000, 0xcebc7d5100000000,\n    0xae831c0b00000000, 0xb194ec8b00000000, 0xad0c440100000000,\n    0xb21bb48100000000, 0xd224d5db00000000, 0xcd33255b00000000,\n    0x125a176f00000000, 0x0d4de7ef00000000, 0x6d7286b500000000,\n    0x7265763500000000, 0xd3a1e2dd00000000, 0xccb6125d00000000,\n    0xac89730700000000, 0xb39e838700000000, 0x6cf7b1b300000000,\n    0x73e0413300000000, 0x13df206900000000, 0x0cc8d0e900000000,\n    0xdf9d80f400000000, 0xc08a707400000000, 0xa0b5112e00000000,\n    0xbfa2e1ae00000000, 0x60cbd39a00000000, 0x7fdc231a00000000,\n    0x1fe3424000000000, 0x00f4b2c000000000, 0xa130262800000000,\n    0xbe27d6a800000000, 0xde18b7f200000000, 0xc10f477200000000,\n    0x1e66754600000000, 0x017185c600000000, 0x614ee49c00000000,\n    0x7e59141c00000000, 0x62c1bc9600000000, 0x7dd64c1600000000,\n    0x1de92d4c00000000, 0x02feddcc00000000, 0xdd97eff800000000,\n    0xc2801f7800000000, 0xa2bf7e2200000000, 0xbda88ea200000000,\n    0x1c6c1a4a00000000, 0x037beaca00000000, 0x63448b9000000000,\n    0x7c537b1000000000, 0xa33a492400000000, 0xbc2db9a400000000,\n    0xdc12d8fe00000000, 0xc305287e00000000, 0xa524f83000000000,\n    0xba3308b000000000, 0xda0c69ea00000000, 0xc51b996a00000000,\n    0x1a72ab5e00000000, 0x05655bde00000000, 0x655a3a8400000000,\n    0x7a4dca0400000000, 0xdb895eec00000000, 0xc49eae6c00000000,\n    0xa4a1cf3600000000, 0xbbb63fb600000000, 0x64df0d8200000000,\n    0x7bc8fd0200000000, 0x1bf79c5800000000, 0x04e06cd800000000,\n    0x1878c45200000000, 0x076f34d200000000, 0x6750558800000000,\n    0x7847a50800000000, 0xa72e973c00000000, 0xb83967bc00000000,\n    0xd80606e600000000, 0xc711f66600000000, 0x66d5628e00000000,\n    0x79c2920e00000000, 0x19fdf35400000000, 0x06ea03d400000000,\n    0xd98331e000000000, 0xc694c16000000000, 0xa6aba03a00000000,\n    0xb9bc50ba00000000},\n   {0x0000000000000000, 0xe2fd888d00000000, 0x85fd60c000000000,\n    0x6700e84d00000000, 0x4bfdb05b00000000, 0xa90038d600000000,\n    0xce00d09b00000000, 0x2cfd581600000000, 0x96fa61b700000000,\n    0x7407e93a00000000, 0x1307017700000000, 0xf1fa89fa00000000,\n    0xdd07d1ec00000000, 0x3ffa596100000000, 0x58fab12c00000000,\n    0xba0739a100000000, 0x6df3b2b500000000, 0x8f0e3a3800000000,\n    0xe80ed27500000000, 0x0af35af800000000, 0x260e02ee00000000,\n    0xc4f38a6300000000, 0xa3f3622e00000000, 0x410eeaa300000000,\n    0xfb09d30200000000, 0x19f45b8f00000000, 0x7ef4b3c200000000,\n    0x9c093b4f00000000, 0xb0f4635900000000, 0x5209ebd400000000,\n    0x3509039900000000, 0xd7f48b1400000000, 0x9be014b000000000,\n    0x791d9c3d00000000, 0x1e1d747000000000, 0xfce0fcfd00000000,\n    0xd01da4eb00000000, 0x32e02c6600000000, 0x55e0c42b00000000,\n    0xb71d4ca600000000, 0x0d1a750700000000, 0xefe7fd8a00000000,\n    0x88e715c700000000, 0x6a1a9d4a00000000, 0x46e7c55c00000000,\n    0xa41a4dd100000000, 0xc31aa59c00000000, 0x21e72d1100000000,\n    0xf613a60500000000, 0x14ee2e8800000000, 0x73eec6c500000000,\n    0x91134e4800000000, 0xbdee165e00000000, 0x5f139ed300000000,\n    0x3813769e00000000, 0xdaeefe1300000000, 0x60e9c7b200000000,\n    0x82144f3f00000000, 0xe514a77200000000, 0x07e92fff00000000,\n    0x2b1477e900000000, 0xc9e9ff6400000000, 0xaee9172900000000,\n    0x4c149fa400000000, 0x77c758bb00000000, 0x953ad03600000000,\n    0xf23a387b00000000, 0x10c7b0f600000000, 0x3c3ae8e000000000,\n    0xdec7606d00000000, 0xb9c7882000000000, 0x5b3a00ad00000000,\n    0xe13d390c00000000, 0x03c0b18100000000, 0x64c059cc00000000,\n    0x863dd14100000000, 0xaac0895700000000, 0x483d01da00000000,\n    0x2f3de99700000000, 0xcdc0611a00000000, 0x1a34ea0e00000000,\n    0xf8c9628300000000, 0x9fc98ace00000000, 0x7d34024300000000,\n    0x51c95a5500000000, 0xb334d2d800000000, 0xd4343a9500000000,\n    0x36c9b21800000000, 0x8cce8bb900000000, 0x6e33033400000000,\n    0x0933eb7900000000, 0xebce63f400000000, 0xc7333be200000000,\n    0x25ceb36f00000000, 0x42ce5b2200000000, 0xa033d3af00000000,\n    0xec274c0b00000000, 0x0edac48600000000, 0x69da2ccb00000000,\n    0x8b27a44600000000, 0xa7dafc5000000000, 0x452774dd00000000,\n    0x22279c9000000000, 0xc0da141d00000000, 0x7add2dbc00000000,\n    0x9820a53100000000, 0xff204d7c00000000, 0x1dddc5f100000000,\n    0x31209de700000000, 0xd3dd156a00000000, 0xb4ddfd2700000000,\n    0x562075aa00000000, 0x81d4febe00000000, 0x6329763300000000,\n    0x04299e7e00000000, 0xe6d416f300000000, 0xca294ee500000000,\n    0x28d4c66800000000, 0x4fd42e2500000000, 0xad29a6a800000000,\n    0x172e9f0900000000, 0xf5d3178400000000, 0x92d3ffc900000000,\n    0x702e774400000000, 0x5cd32f5200000000, 0xbe2ea7df00000000,\n    0xd92e4f9200000000, 0x3bd3c71f00000000, 0xaf88c0ad00000000,\n    0x4d75482000000000, 0x2a75a06d00000000, 0xc88828e000000000,\n    0xe47570f600000000, 0x0688f87b00000000, 0x6188103600000000,\n    0x837598bb00000000, 0x3972a11a00000000, 0xdb8f299700000000,\n    0xbc8fc1da00000000, 0x5e72495700000000, 0x728f114100000000,\n    0x907299cc00000000, 0xf772718100000000, 0x158ff90c00000000,\n    0xc27b721800000000, 0x2086fa9500000000, 0x478612d800000000,\n    0xa57b9a5500000000, 0x8986c24300000000, 0x6b7b4ace00000000,\n    0x0c7ba28300000000, 0xee862a0e00000000, 0x548113af00000000,\n    0xb67c9b2200000000, 0xd17c736f00000000, 0x3381fbe200000000,\n    0x1f7ca3f400000000, 0xfd812b7900000000, 0x9a81c33400000000,\n    0x787c4bb900000000, 0x3468d41d00000000, 0xd6955c9000000000,\n    0xb195b4dd00000000, 0x53683c5000000000, 0x7f95644600000000,\n    0x9d68eccb00000000, 0xfa68048600000000, 0x18958c0b00000000,\n    0xa292b5aa00000000, 0x406f3d2700000000, 0x276fd56a00000000,\n    0xc5925de700000000, 0xe96f05f100000000, 0x0b928d7c00000000,\n    0x6c92653100000000, 0x8e6fedbc00000000, 0x599b66a800000000,\n    0xbb66ee2500000000, 0xdc66066800000000, 0x3e9b8ee500000000,\n    0x1266d6f300000000, 0xf09b5e7e00000000, 0x979bb63300000000,\n    0x75663ebe00000000, 0xcf61071f00000000, 0x2d9c8f9200000000,\n    0x4a9c67df00000000, 0xa861ef5200000000, 0x849cb74400000000,\n    0x66613fc900000000, 0x0161d78400000000, 0xe39c5f0900000000,\n    0xd84f981600000000, 0x3ab2109b00000000, 0x5db2f8d600000000,\n    0xbf4f705b00000000, 0x93b2284d00000000, 0x714fa0c000000000,\n    0x164f488d00000000, 0xf4b2c00000000000, 0x4eb5f9a100000000,\n    0xac48712c00000000, 0xcb48996100000000, 0x29b511ec00000000,\n    0x054849fa00000000, 0xe7b5c17700000000, 0x80b5293a00000000,\n    0x6248a1b700000000, 0xb5bc2aa300000000, 0x5741a22e00000000,\n    0x30414a6300000000, 0xd2bcc2ee00000000, 0xfe419af800000000,\n    0x1cbc127500000000, 0x7bbcfa3800000000, 0x994172b500000000,\n    0x23464b1400000000, 0xc1bbc39900000000, 0xa6bb2bd400000000,\n    0x4446a35900000000, 0x68bbfb4f00000000, 0x8a4673c200000000,\n    0xed469b8f00000000, 0x0fbb130200000000, 0x43af8ca600000000,\n    0xa152042b00000000, 0xc652ec6600000000, 0x24af64eb00000000,\n    0x08523cfd00000000, 0xeaafb47000000000, 0x8daf5c3d00000000,\n    0x6f52d4b000000000, 0xd555ed1100000000, 0x37a8659c00000000,\n    0x50a88dd100000000, 0xb255055c00000000, 0x9ea85d4a00000000,\n    0x7c55d5c700000000, 0x1b553d8a00000000, 0xf9a8b50700000000,\n    0x2e5c3e1300000000, 0xcca1b69e00000000, 0xaba15ed300000000,\n    0x495cd65e00000000, 0x65a18e4800000000, 0x875c06c500000000,\n    0xe05cee8800000000, 0x02a1660500000000, 0xb8a65fa400000000,\n    0x5a5bd72900000000, 0x3d5b3f6400000000, 0xdfa6b7e900000000,\n    0xf35befff00000000, 0x11a6677200000000, 0x76a68f3f00000000,\n    0x945b07b200000000},\n   {0x0000000000000000, 0xa90b894e00000000, 0x5217129d00000000,\n    0xfb1c9bd300000000, 0xe52855e100000000, 0x4c23dcaf00000000,\n    0xb73f477c00000000, 0x1e34ce3200000000, 0x8b57db1900000000,\n    0x225c525700000000, 0xd940c98400000000, 0x704b40ca00000000,\n    0x6e7f8ef800000000, 0xc77407b600000000, 0x3c689c6500000000,\n    0x9563152b00000000, 0x16afb63300000000, 0xbfa43f7d00000000,\n    0x44b8a4ae00000000, 0xedb32de000000000, 0xf387e3d200000000,\n    0x5a8c6a9c00000000, 0xa190f14f00000000, 0x089b780100000000,\n    0x9df86d2a00000000, 0x34f3e46400000000, 0xcfef7fb700000000,\n    0x66e4f6f900000000, 0x78d038cb00000000, 0xd1dbb18500000000,\n    0x2ac72a5600000000, 0x83cca31800000000, 0x2c5e6d6700000000,\n    0x8555e42900000000, 0x7e497ffa00000000, 0xd742f6b400000000,\n    0xc976388600000000, 0x607db1c800000000, 0x9b612a1b00000000,\n    0x326aa35500000000, 0xa709b67e00000000, 0x0e023f3000000000,\n    0xf51ea4e300000000, 0x5c152dad00000000, 0x4221e39f00000000,\n    0xeb2a6ad100000000, 0x1036f10200000000, 0xb93d784c00000000,\n    0x3af1db5400000000, 0x93fa521a00000000, 0x68e6c9c900000000,\n    0xc1ed408700000000, 0xdfd98eb500000000, 0x76d207fb00000000,\n    0x8dce9c2800000000, 0x24c5156600000000, 0xb1a6004d00000000,\n    0x18ad890300000000, 0xe3b112d000000000, 0x4aba9b9e00000000,\n    0x548e55ac00000000, 0xfd85dce200000000, 0x0699473100000000,\n    0xaf92ce7f00000000, 0x58bcdace00000000, 0xf1b7538000000000,\n    0x0aabc85300000000, 0xa3a0411d00000000, 0xbd948f2f00000000,\n    0x149f066100000000, 0xef839db200000000, 0x468814fc00000000,\n    0xd3eb01d700000000, 0x7ae0889900000000, 0x81fc134a00000000,\n    0x28f79a0400000000, 0x36c3543600000000, 0x9fc8dd7800000000,\n    0x64d446ab00000000, 0xcddfcfe500000000, 0x4e136cfd00000000,\n    0xe718e5b300000000, 0x1c047e6000000000, 0xb50ff72e00000000,\n    0xab3b391c00000000, 0x0230b05200000000, 0xf92c2b8100000000,\n    0x5027a2cf00000000, 0xc544b7e400000000, 0x6c4f3eaa00000000,\n    0x9753a57900000000, 0x3e582c3700000000, 0x206ce20500000000,\n    0x89676b4b00000000, 0x727bf09800000000, 0xdb7079d600000000,\n    0x74e2b7a900000000, 0xdde93ee700000000, 0x26f5a53400000000,\n    0x8ffe2c7a00000000, 0x91cae24800000000, 0x38c16b0600000000,\n    0xc3ddf0d500000000, 0x6ad6799b00000000, 0xffb56cb000000000,\n    0x56bee5fe00000000, 0xada27e2d00000000, 0x04a9f76300000000,\n    0x1a9d395100000000, 0xb396b01f00000000, 0x488a2bcc00000000,\n    0xe181a28200000000, 0x624d019a00000000, 0xcb4688d400000000,\n    0x305a130700000000, 0x99519a4900000000, 0x8765547b00000000,\n    0x2e6edd3500000000, 0xd57246e600000000, 0x7c79cfa800000000,\n    0xe91ada8300000000, 0x401153cd00000000, 0xbb0dc81e00000000,\n    0x1206415000000000, 0x0c328f6200000000, 0xa539062c00000000,\n    0x5e259dff00000000, 0xf72e14b100000000, 0xf17ec44600000000,\n    0x58754d0800000000, 0xa369d6db00000000, 0x0a625f9500000000,\n    0x145691a700000000, 0xbd5d18e900000000, 0x4641833a00000000,\n    0xef4a0a7400000000, 0x7a291f5f00000000, 0xd322961100000000,\n    0x283e0dc200000000, 0x8135848c00000000, 0x9f014abe00000000,\n    0x360ac3f000000000, 0xcd16582300000000, 0x641dd16d00000000,\n    0xe7d1727500000000, 0x4edafb3b00000000, 0xb5c660e800000000,\n    0x1ccde9a600000000, 0x02f9279400000000, 0xabf2aeda00000000,\n    0x50ee350900000000, 0xf9e5bc4700000000, 0x6c86a96c00000000,\n    0xc58d202200000000, 0x3e91bbf100000000, 0x979a32bf00000000,\n    0x89aefc8d00000000, 0x20a575c300000000, 0xdbb9ee1000000000,\n    0x72b2675e00000000, 0xdd20a92100000000, 0x742b206f00000000,\n    0x8f37bbbc00000000, 0x263c32f200000000, 0x3808fcc000000000,\n    0x9103758e00000000, 0x6a1fee5d00000000, 0xc314671300000000,\n    0x5677723800000000, 0xff7cfb7600000000, 0x046060a500000000,\n    0xad6be9eb00000000, 0xb35f27d900000000, 0x1a54ae9700000000,\n    0xe148354400000000, 0x4843bc0a00000000, 0xcb8f1f1200000000,\n    0x6284965c00000000, 0x99980d8f00000000, 0x309384c100000000,\n    0x2ea74af300000000, 0x87acc3bd00000000, 0x7cb0586e00000000,\n    0xd5bbd12000000000, 0x40d8c40b00000000, 0xe9d34d4500000000,\n    0x12cfd69600000000, 0xbbc45fd800000000, 0xa5f091ea00000000,\n    0x0cfb18a400000000, 0xf7e7837700000000, 0x5eec0a3900000000,\n    0xa9c21e8800000000, 0x00c997c600000000, 0xfbd50c1500000000,\n    0x52de855b00000000, 0x4cea4b6900000000, 0xe5e1c22700000000,\n    0x1efd59f400000000, 0xb7f6d0ba00000000, 0x2295c59100000000,\n    0x8b9e4cdf00000000, 0x7082d70c00000000, 0xd9895e4200000000,\n    0xc7bd907000000000, 0x6eb6193e00000000, 0x95aa82ed00000000,\n    0x3ca10ba300000000, 0xbf6da8bb00000000, 0x166621f500000000,\n    0xed7aba2600000000, 0x4471336800000000, 0x5a45fd5a00000000,\n    0xf34e741400000000, 0x0852efc700000000, 0xa159668900000000,\n    0x343a73a200000000, 0x9d31faec00000000, 0x662d613f00000000,\n    0xcf26e87100000000, 0xd112264300000000, 0x7819af0d00000000,\n    0x830534de00000000, 0x2a0ebd9000000000, 0x859c73ef00000000,\n    0x2c97faa100000000, 0xd78b617200000000, 0x7e80e83c00000000,\n    0x60b4260e00000000, 0xc9bfaf4000000000, 0x32a3349300000000,\n    0x9ba8bddd00000000, 0x0ecba8f600000000, 0xa7c021b800000000,\n    0x5cdcba6b00000000, 0xf5d7332500000000, 0xebe3fd1700000000,\n    0x42e8745900000000, 0xb9f4ef8a00000000, 0x10ff66c400000000,\n    0x9333c5dc00000000, 0x3a384c9200000000, 0xc124d74100000000,\n    0x682f5e0f00000000, 0x761b903d00000000, 0xdf10197300000000,\n    0x240c82a000000000, 0x8d070bee00000000, 0x18641ec500000000,\n    0xb16f978b00000000, 0x4a730c5800000000, 0xe378851600000000,\n    0xfd4c4b2400000000, 0x5447c26a00000000, 0xaf5b59b900000000,\n    0x0650d0f700000000},\n   {0x0000000000000000, 0x479244af00000000, 0xcf22f88500000000,\n    0x88b0bc2a00000000, 0xdf4381d000000000, 0x98d1c57f00000000,\n    0x1061795500000000, 0x57f33dfa00000000, 0xff81737a00000000,\n    0xb81337d500000000, 0x30a38bff00000000, 0x7731cf5000000000,\n    0x20c2f2aa00000000, 0x6750b60500000000, 0xefe00a2f00000000,\n    0xa8724e8000000000, 0xfe03e7f400000000, 0xb991a35b00000000,\n    0x31211f7100000000, 0x76b35bde00000000, 0x2140662400000000,\n    0x66d2228b00000000, 0xee629ea100000000, 0xa9f0da0e00000000,\n    0x0182948e00000000, 0x4610d02100000000, 0xcea06c0b00000000,\n    0x893228a400000000, 0xdec1155e00000000, 0x995351f100000000,\n    0x11e3eddb00000000, 0x5671a97400000000, 0xbd01bf3200000000,\n    0xfa93fb9d00000000, 0x722347b700000000, 0x35b1031800000000,\n    0x62423ee200000000, 0x25d07a4d00000000, 0xad60c66700000000,\n    0xeaf282c800000000, 0x4280cc4800000000, 0x051288e700000000,\n    0x8da234cd00000000, 0xca30706200000000, 0x9dc34d9800000000,\n    0xda51093700000000, 0x52e1b51d00000000, 0x1573f1b200000000,\n    0x430258c600000000, 0x04901c6900000000, 0x8c20a04300000000,\n    0xcbb2e4ec00000000, 0x9c41d91600000000, 0xdbd39db900000000,\n    0x5363219300000000, 0x14f1653c00000000, 0xbc832bbc00000000,\n    0xfb116f1300000000, 0x73a1d33900000000, 0x3433979600000000,\n    0x63c0aa6c00000000, 0x2452eec300000000, 0xace252e900000000,\n    0xeb70164600000000, 0x7a037e6500000000, 0x3d913aca00000000,\n    0xb52186e000000000, 0xf2b3c24f00000000, 0xa540ffb500000000,\n    0xe2d2bb1a00000000, 0x6a62073000000000, 0x2df0439f00000000,\n    0x85820d1f00000000, 0xc21049b000000000, 0x4aa0f59a00000000,\n    0x0d32b13500000000, 0x5ac18ccf00000000, 0x1d53c86000000000,\n    0x95e3744a00000000, 0xd27130e500000000, 0x8400999100000000,\n    0xc392dd3e00000000, 0x4b22611400000000, 0x0cb025bb00000000,\n    0x5b43184100000000, 0x1cd15cee00000000, 0x9461e0c400000000,\n    0xd3f3a46b00000000, 0x7b81eaeb00000000, 0x3c13ae4400000000,\n    0xb4a3126e00000000, 0xf33156c100000000, 0xa4c26b3b00000000,\n    0xe3502f9400000000, 0x6be093be00000000, 0x2c72d71100000000,\n    0xc702c15700000000, 0x809085f800000000, 0x082039d200000000,\n    0x4fb27d7d00000000, 0x1841408700000000, 0x5fd3042800000000,\n    0xd763b80200000000, 0x90f1fcad00000000, 0x3883b22d00000000,\n    0x7f11f68200000000, 0xf7a14aa800000000, 0xb0330e0700000000,\n    0xe7c033fd00000000, 0xa052775200000000, 0x28e2cb7800000000,\n    0x6f708fd700000000, 0x390126a300000000, 0x7e93620c00000000,\n    0xf623de2600000000, 0xb1b19a8900000000, 0xe642a77300000000,\n    0xa1d0e3dc00000000, 0x29605ff600000000, 0x6ef21b5900000000,\n    0xc68055d900000000, 0x8112117600000000, 0x09a2ad5c00000000,\n    0x4e30e9f300000000, 0x19c3d40900000000, 0x5e5190a600000000,\n    0xd6e12c8c00000000, 0x9173682300000000, 0xf406fcca00000000,\n    0xb394b86500000000, 0x3b24044f00000000, 0x7cb640e000000000,\n    0x2b457d1a00000000, 0x6cd739b500000000, 0xe467859f00000000,\n    0xa3f5c13000000000, 0x0b878fb000000000, 0x4c15cb1f00000000,\n    0xc4a5773500000000, 0x8337339a00000000, 0xd4c40e6000000000,\n    0x93564acf00000000, 0x1be6f6e500000000, 0x5c74b24a00000000,\n    0x0a051b3e00000000, 0x4d975f9100000000, 0xc527e3bb00000000,\n    0x82b5a71400000000, 0xd5469aee00000000, 0x92d4de4100000000,\n    0x1a64626b00000000, 0x5df626c400000000, 0xf584684400000000,\n    0xb2162ceb00000000, 0x3aa690c100000000, 0x7d34d46e00000000,\n    0x2ac7e99400000000, 0x6d55ad3b00000000, 0xe5e5111100000000,\n    0xa27755be00000000, 0x490743f800000000, 0x0e95075700000000,\n    0x8625bb7d00000000, 0xc1b7ffd200000000, 0x9644c22800000000,\n    0xd1d6868700000000, 0x59663aad00000000, 0x1ef47e0200000000,\n    0xb686308200000000, 0xf114742d00000000, 0x79a4c80700000000,\n    0x3e368ca800000000, 0x69c5b15200000000, 0x2e57f5fd00000000,\n    0xa6e749d700000000, 0xe1750d7800000000, 0xb704a40c00000000,\n    0xf096e0a300000000, 0x78265c8900000000, 0x3fb4182600000000,\n    0x684725dc00000000, 0x2fd5617300000000, 0xa765dd5900000000,\n    0xe0f799f600000000, 0x4885d77600000000, 0x0f1793d900000000,\n    0x87a72ff300000000, 0xc0356b5c00000000, 0x97c656a600000000,\n    0xd054120900000000, 0x58e4ae2300000000, 0x1f76ea8c00000000,\n    0x8e0582af00000000, 0xc997c60000000000, 0x41277a2a00000000,\n    0x06b53e8500000000, 0x5146037f00000000, 0x16d447d000000000,\n    0x9e64fbfa00000000, 0xd9f6bf5500000000, 0x7184f1d500000000,\n    0x3616b57a00000000, 0xbea6095000000000, 0xf9344dff00000000,\n    0xaec7700500000000, 0xe95534aa00000000, 0x61e5888000000000,\n    0x2677cc2f00000000, 0x7006655b00000000, 0x379421f400000000,\n    0xbf249dde00000000, 0xf8b6d97100000000, 0xaf45e48b00000000,\n    0xe8d7a02400000000, 0x60671c0e00000000, 0x27f558a100000000,\n    0x8f87162100000000, 0xc815528e00000000, 0x40a5eea400000000,\n    0x0737aa0b00000000, 0x50c497f100000000, 0x1756d35e00000000,\n    0x9fe66f7400000000, 0xd8742bdb00000000, 0x33043d9d00000000,\n    0x7496793200000000, 0xfc26c51800000000, 0xbbb481b700000000,\n    0xec47bc4d00000000, 0xabd5f8e200000000, 0x236544c800000000,\n    0x64f7006700000000, 0xcc854ee700000000, 0x8b170a4800000000,\n    0x03a7b66200000000, 0x4435f2cd00000000, 0x13c6cf3700000000,\n    0x54548b9800000000, 0xdce437b200000000, 0x9b76731d00000000,\n    0xcd07da6900000000, 0x8a959ec600000000, 0x022522ec00000000,\n    0x45b7664300000000, 0x12445bb900000000, 0x55d61f1600000000,\n    0xdd66a33c00000000, 0x9af4e79300000000, 0x3286a91300000000,\n    0x7514edbc00000000, 0xfda4519600000000, 0xba36153900000000,\n    0xedc528c300000000, 0xaa576c6c00000000, 0x22e7d04600000000,\n    0x657594e900000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59,\n    0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4,\n    0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67,\n    0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef,\n    0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97,\n    0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88,\n    0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687,\n    0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698,\n    0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0,\n    0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068,\n    0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb,\n    0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056,\n    0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016,\n    0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009,\n    0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028,\n    0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037,\n    0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a,\n    0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7,\n    0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054,\n    0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7,\n    0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af,\n    0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0,\n    0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4,\n    0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab,\n    0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3,\n    0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a,\n    0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9,\n    0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54,\n    0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09,\n    0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16,\n    0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37,\n    0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28,\n    0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e,\n    0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3,\n    0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40,\n    0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8,\n    0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0,\n    0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf,\n    0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6,\n    0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9,\n    0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1,\n    0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059,\n    0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca,\n    0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067,\n    0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031,\n    0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e,\n    0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f,\n    0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010,\n    0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d,\n    0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0,\n    0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073,\n    0xd8ac6b35},\n   {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2,\n    0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd,\n    0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696,\n    0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3,\n    0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f,\n    0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35,\n    0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5,\n    0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f,\n    0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673,\n    0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46,\n    0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d,\n    0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632,\n    0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28,\n    0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192,\n    0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c,\n    0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6,\n    0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0,\n    0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff,\n    0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4,\n    0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95,\n    0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9,\n    0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03,\n    0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7,\n    0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d,\n    0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151,\n    0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808,\n    0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343,\n    0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c,\n    0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a,\n    0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0,\n    0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e,\n    0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594,\n    0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6,\n    0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399,\n    0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2,\n    0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7,\n    0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb,\n    0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571,\n    0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289,\n    0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33,\n    0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f,\n    0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a,\n    0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461,\n    0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e,\n    0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c,\n    0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6,\n    0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918,\n    0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2,\n    0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484,\n    0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb,\n    0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0,\n    0xa140efa8},\n   {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706,\n    0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed,\n    0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289,\n    0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a,\n    0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214,\n    0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3,\n    0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3,\n    0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254,\n    0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a,\n    0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9,\n    0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad,\n    0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746,\n    0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060,\n    0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187,\n    0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef,\n    0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408,\n    0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e,\n    0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495,\n    0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1,\n    0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532,\n    0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c,\n    0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb,\n    0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb,\n    0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c,\n    0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42,\n    0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060,\n    0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04,\n    0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef,\n    0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99,\n    0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e,\n    0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16,\n    0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1,\n    0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7,\n    0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c,\n    0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38,\n    0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb,\n    0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5,\n    0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42,\n    0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62,\n    0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85,\n    0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb,\n    0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18,\n    0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c,\n    0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997,\n    0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1,\n    0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36,\n    0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e,\n    0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9,\n    0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf,\n    0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24,\n    0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040,\n    0x917cd6a1},\n   {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf,\n    0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd,\n    0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896,\n    0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9,\n    0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3,\n    0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f,\n    0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d,\n    0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1,\n    0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab,\n    0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4,\n    0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f,\n    0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d,\n    0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4,\n    0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978,\n    0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad,\n    0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621,\n    0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46,\n    0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854,\n    0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f,\n    0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a,\n    0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890,\n    0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c,\n    0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4,\n    0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238,\n    0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622,\n    0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab,\n    0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0,\n    0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2,\n    0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295,\n    0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19,\n    0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc,\n    0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140,\n    0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd,\n    0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf,\n    0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184,\n    0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb,\n    0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1,\n    0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d,\n    0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb,\n    0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257,\n    0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d,\n    0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22,\n    0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069,\n    0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b,\n    0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6,\n    0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a,\n    0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf,\n    0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33,\n    0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254,\n    0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146,\n    0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d,\n    0x18ba364e}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0x43cba687, 0xc7903cd4, 0x845b9a53, 0xcf270873,\n    0x8cecaef4, 0x08b734a7, 0x4b7c9220, 0x9e4f10e6, 0xdd84b661,\n    0x59df2c32, 0x1a148ab5, 0x51681895, 0x12a3be12, 0x96f82441,\n    0xd53382c6, 0x7d995117, 0x3e52f790, 0xba096dc3, 0xf9c2cb44,\n    0xb2be5964, 0xf175ffe3, 0x752e65b0, 0x36e5c337, 0xe3d641f1,\n    0xa01de776, 0x24467d25, 0x678ddba2, 0x2cf14982, 0x6f3aef05,\n    0xeb617556, 0xa8aad3d1, 0xfa32a32e, 0xb9f905a9, 0x3da29ffa,\n    0x7e69397d, 0x3515ab5d, 0x76de0dda, 0xf2859789, 0xb14e310e,\n    0x647db3c8, 0x27b6154f, 0xa3ed8f1c, 0xe026299b, 0xab5abbbb,\n    0xe8911d3c, 0x6cca876f, 0x2f0121e8, 0x87abf239, 0xc46054be,\n    0x403bceed, 0x03f0686a, 0x488cfa4a, 0x0b475ccd, 0x8f1cc69e,\n    0xccd76019, 0x19e4e2df, 0x5a2f4458, 0xde74de0b, 0x9dbf788c,\n    0xd6c3eaac, 0x95084c2b, 0x1153d678, 0x529870ff, 0xf465465d,\n    0xb7aee0da, 0x33f57a89, 0x703edc0e, 0x3b424e2e, 0x7889e8a9,\n    0xfcd272fa, 0xbf19d47d, 0x6a2a56bb, 0x29e1f03c, 0xadba6a6f,\n    0xee71cce8, 0xa50d5ec8, 0xe6c6f84f, 0x629d621c, 0x2156c49b,\n    0x89fc174a, 0xca37b1cd, 0x4e6c2b9e, 0x0da78d19, 0x46db1f39,\n    0x0510b9be, 0x814b23ed, 0xc280856a, 0x17b307ac, 0x5478a12b,\n    0xd0233b78, 0x93e89dff, 0xd8940fdf, 0x9b5fa958, 0x1f04330b,\n    0x5ccf958c, 0x0e57e573, 0x4d9c43f4, 0xc9c7d9a7, 0x8a0c7f20,\n    0xc170ed00, 0x82bb4b87, 0x06e0d1d4, 0x452b7753, 0x9018f595,\n    0xd3d35312, 0x5788c941, 0x14436fc6, 0x5f3ffde6, 0x1cf45b61,\n    0x98afc132, 0xdb6467b5, 0x73ceb464, 0x300512e3, 0xb45e88b0,\n    0xf7952e37, 0xbce9bc17, 0xff221a90, 0x7b7980c3, 0x38b22644,\n    0xed81a482, 0xae4a0205, 0x2a119856, 0x69da3ed1, 0x22a6acf1,\n    0x616d0a76, 0xe5369025, 0xa6fd36a2, 0xe8cb8cba, 0xab002a3d,\n    0x2f5bb06e, 0x6c9016e9, 0x27ec84c9, 0x6427224e, 0xe07cb81d,\n    0xa3b71e9a, 0x76849c5c, 0x354f3adb, 0xb114a088, 0xf2df060f,\n    0xb9a3942f, 0xfa6832a8, 0x7e33a8fb, 0x3df80e7c, 0x9552ddad,\n    0xd6997b2a, 0x52c2e179, 0x110947fe, 0x5a75d5de, 0x19be7359,\n    0x9de5e90a, 0xde2e4f8d, 0x0b1dcd4b, 0x48d66bcc, 0xcc8df19f,\n    0x8f465718, 0xc43ac538, 0x87f163bf, 0x03aaf9ec, 0x40615f6b,\n    0x12f92f94, 0x51328913, 0xd5691340, 0x96a2b5c7, 0xddde27e7,\n    0x9e158160, 0x1a4e1b33, 0x5985bdb4, 0x8cb63f72, 0xcf7d99f5,\n    0x4b2603a6, 0x08eda521, 0x43913701, 0x005a9186, 0x84010bd5,\n    0xc7caad52, 0x6f607e83, 0x2cabd804, 0xa8f04257, 0xeb3be4d0,\n    0xa04776f0, 0xe38cd077, 0x67d74a24, 0x241ceca3, 0xf12f6e65,\n    0xb2e4c8e2, 0x36bf52b1, 0x7574f436, 0x3e086616, 0x7dc3c091,\n    0xf9985ac2, 0xba53fc45, 0x1caecae7, 0x5f656c60, 0xdb3ef633,\n    0x98f550b4, 0xd389c294, 0x90426413, 0x1419fe40, 0x57d258c7,\n    0x82e1da01, 0xc12a7c86, 0x4571e6d5, 0x06ba4052, 0x4dc6d272,\n    0x0e0d74f5, 0x8a56eea6, 0xc99d4821, 0x61379bf0, 0x22fc3d77,\n    0xa6a7a724, 0xe56c01a3, 0xae109383, 0xeddb3504, 0x6980af57,\n    0x2a4b09d0, 0xff788b16, 0xbcb32d91, 0x38e8b7c2, 0x7b231145,\n    0x305f8365, 0x739425e2, 0xf7cfbfb1, 0xb4041936, 0xe69c69c9,\n    0xa557cf4e, 0x210c551d, 0x62c7f39a, 0x29bb61ba, 0x6a70c73d,\n    0xee2b5d6e, 0xade0fbe9, 0x78d3792f, 0x3b18dfa8, 0xbf4345fb,\n    0xfc88e37c, 0xb7f4715c, 0xf43fd7db, 0x70644d88, 0x33afeb0f,\n    0x9b0538de, 0xd8ce9e59, 0x5c95040a, 0x1f5ea28d, 0x542230ad,\n    0x17e9962a, 0x93b20c79, 0xd079aafe, 0x054a2838, 0x46818ebf,\n    0xc2da14ec, 0x8111b26b, 0xca6d204b, 0x89a686cc, 0x0dfd1c9f,\n    0x4e36ba18},\n   {0x00000000, 0xe1b652ef, 0x836bd405, 0x62dd86ea, 0x06d7a80b,\n    0xe761fae4, 0x85bc7c0e, 0x640a2ee1, 0x0cae5117, 0xed1803f8,\n    0x8fc58512, 0x6e73d7fd, 0x0a79f91c, 0xebcfabf3, 0x89122d19,\n    0x68a47ff6, 0x185ca32e, 0xf9eaf1c1, 0x9b37772b, 0x7a8125c4,\n    0x1e8b0b25, 0xff3d59ca, 0x9de0df20, 0x7c568dcf, 0x14f2f239,\n    0xf544a0d6, 0x9799263c, 0x762f74d3, 0x12255a32, 0xf39308dd,\n    0x914e8e37, 0x70f8dcd8, 0x30b8465d, 0xd10e14b2, 0xb3d39258,\n    0x5265c0b7, 0x366fee56, 0xd7d9bcb9, 0xb5043a53, 0x54b268bc,\n    0x3c16174a, 0xdda045a5, 0xbf7dc34f, 0x5ecb91a0, 0x3ac1bf41,\n    0xdb77edae, 0xb9aa6b44, 0x581c39ab, 0x28e4e573, 0xc952b79c,\n    0xab8f3176, 0x4a396399, 0x2e334d78, 0xcf851f97, 0xad58997d,\n    0x4ceecb92, 0x244ab464, 0xc5fce68b, 0xa7216061, 0x4697328e,\n    0x229d1c6f, 0xc32b4e80, 0xa1f6c86a, 0x40409a85, 0x60708dba,\n    0x81c6df55, 0xe31b59bf, 0x02ad0b50, 0x66a725b1, 0x8711775e,\n    0xe5ccf1b4, 0x047aa35b, 0x6cdedcad, 0x8d688e42, 0xefb508a8,\n    0x0e035a47, 0x6a0974a6, 0x8bbf2649, 0xe962a0a3, 0x08d4f24c,\n    0x782c2e94, 0x999a7c7b, 0xfb47fa91, 0x1af1a87e, 0x7efb869f,\n    0x9f4dd470, 0xfd90529a, 0x1c260075, 0x74827f83, 0x95342d6c,\n    0xf7e9ab86, 0x165ff969, 0x7255d788, 0x93e38567, 0xf13e038d,\n    0x10885162, 0x50c8cbe7, 0xb17e9908, 0xd3a31fe2, 0x32154d0d,\n    0x561f63ec, 0xb7a93103, 0xd574b7e9, 0x34c2e506, 0x5c669af0,\n    0xbdd0c81f, 0xdf0d4ef5, 0x3ebb1c1a, 0x5ab132fb, 0xbb076014,\n    0xd9dae6fe, 0x386cb411, 0x489468c9, 0xa9223a26, 0xcbffbccc,\n    0x2a49ee23, 0x4e43c0c2, 0xaff5922d, 0xcd2814c7, 0x2c9e4628,\n    0x443a39de, 0xa58c6b31, 0xc751eddb, 0x26e7bf34, 0x42ed91d5,\n    0xa35bc33a, 0xc18645d0, 0x2030173f, 0x81e66bae, 0x60503941,\n    0x028dbfab, 0xe33bed44, 0x8731c3a5, 0x6687914a, 0x045a17a0,\n    0xe5ec454f, 0x8d483ab9, 0x6cfe6856, 0x0e23eebc, 0xef95bc53,\n    0x8b9f92b2, 0x6a29c05d, 0x08f446b7, 0xe9421458, 0x99bac880,\n    0x780c9a6f, 0x1ad11c85, 0xfb674e6a, 0x9f6d608b, 0x7edb3264,\n    0x1c06b48e, 0xfdb0e661, 0x95149997, 0x74a2cb78, 0x167f4d92,\n    0xf7c91f7d, 0x93c3319c, 0x72756373, 0x10a8e599, 0xf11eb776,\n    0xb15e2df3, 0x50e87f1c, 0x3235f9f6, 0xd383ab19, 0xb78985f8,\n    0x563fd717, 0x34e251fd, 0xd5540312, 0xbdf07ce4, 0x5c462e0b,\n    0x3e9ba8e1, 0xdf2dfa0e, 0xbb27d4ef, 0x5a918600, 0x384c00ea,\n    0xd9fa5205, 0xa9028edd, 0x48b4dc32, 0x2a695ad8, 0xcbdf0837,\n    0xafd526d6, 0x4e637439, 0x2cbef2d3, 0xcd08a03c, 0xa5acdfca,\n    0x441a8d25, 0x26c70bcf, 0xc7715920, 0xa37b77c1, 0x42cd252e,\n    0x2010a3c4, 0xc1a6f12b, 0xe196e614, 0x0020b4fb, 0x62fd3211,\n    0x834b60fe, 0xe7414e1f, 0x06f71cf0, 0x642a9a1a, 0x859cc8f5,\n    0xed38b703, 0x0c8ee5ec, 0x6e536306, 0x8fe531e9, 0xebef1f08,\n    0x0a594de7, 0x6884cb0d, 0x893299e2, 0xf9ca453a, 0x187c17d5,\n    0x7aa1913f, 0x9b17c3d0, 0xff1ded31, 0x1eabbfde, 0x7c763934,\n    0x9dc06bdb, 0xf564142d, 0x14d246c2, 0x760fc028, 0x97b992c7,\n    0xf3b3bc26, 0x1205eec9, 0x70d86823, 0x916e3acc, 0xd12ea049,\n    0x3098f2a6, 0x5245744c, 0xb3f326a3, 0xd7f90842, 0x364f5aad,\n    0x5492dc47, 0xb5248ea8, 0xdd80f15e, 0x3c36a3b1, 0x5eeb255b,\n    0xbf5d77b4, 0xdb575955, 0x3ae10bba, 0x583c8d50, 0xb98adfbf,\n    0xc9720367, 0x28c45188, 0x4a19d762, 0xabaf858d, 0xcfa5ab6c,\n    0x2e13f983, 0x4cce7f69, 0xad782d86, 0xc5dc5270, 0x246a009f,\n    0x46b78675, 0xa701d49a, 0xc30bfa7b, 0x22bda894, 0x40602e7e,\n    0xa1d67c91},\n   {0x00000000, 0x5880e2d7, 0xf106b474, 0xa98656a3, 0xe20d68e9,\n    0xba8d8a3e, 0x130bdc9d, 0x4b8b3e4a, 0x851da109, 0xdd9d43de,\n    0x741b157d, 0x2c9bf7aa, 0x6710c9e0, 0x3f902b37, 0x96167d94,\n    0xce969f43, 0x0a3b4213, 0x52bba0c4, 0xfb3df667, 0xa3bd14b0,\n    0xe8362afa, 0xb0b6c82d, 0x19309e8e, 0x41b07c59, 0x8f26e31a,\n    0xd7a601cd, 0x7e20576e, 0x26a0b5b9, 0x6d2b8bf3, 0x35ab6924,\n    0x9c2d3f87, 0xc4addd50, 0x14768426, 0x4cf666f1, 0xe5703052,\n    0xbdf0d285, 0xf67beccf, 0xaefb0e18, 0x077d58bb, 0x5ffdba6c,\n    0x916b252f, 0xc9ebc7f8, 0x606d915b, 0x38ed738c, 0x73664dc6,\n    0x2be6af11, 0x8260f9b2, 0xdae01b65, 0x1e4dc635, 0x46cd24e2,\n    0xef4b7241, 0xb7cb9096, 0xfc40aedc, 0xa4c04c0b, 0x0d461aa8,\n    0x55c6f87f, 0x9b50673c, 0xc3d085eb, 0x6a56d348, 0x32d6319f,\n    0x795d0fd5, 0x21dded02, 0x885bbba1, 0xd0db5976, 0x28ec084d,\n    0x706cea9a, 0xd9eabc39, 0x816a5eee, 0xcae160a4, 0x92618273,\n    0x3be7d4d0, 0x63673607, 0xadf1a944, 0xf5714b93, 0x5cf71d30,\n    0x0477ffe7, 0x4ffcc1ad, 0x177c237a, 0xbefa75d9, 0xe67a970e,\n    0x22d74a5e, 0x7a57a889, 0xd3d1fe2a, 0x8b511cfd, 0xc0da22b7,\n    0x985ac060, 0x31dc96c3, 0x695c7414, 0xa7caeb57, 0xff4a0980,\n    0x56cc5f23, 0x0e4cbdf4, 0x45c783be, 0x1d476169, 0xb4c137ca,\n    0xec41d51d, 0x3c9a8c6b, 0x641a6ebc, 0xcd9c381f, 0x951cdac8,\n    0xde97e482, 0x86170655, 0x2f9150f6, 0x7711b221, 0xb9872d62,\n    0xe107cfb5, 0x48819916, 0x10017bc1, 0x5b8a458b, 0x030aa75c,\n    0xaa8cf1ff, 0xf20c1328, 0x36a1ce78, 0x6e212caf, 0xc7a77a0c,\n    0x9f2798db, 0xd4aca691, 0x8c2c4446, 0x25aa12e5, 0x7d2af032,\n    0xb3bc6f71, 0xeb3c8da6, 0x42badb05, 0x1a3a39d2, 0x51b10798,\n    0x0931e54f, 0xa0b7b3ec, 0xf837513b, 0x50d8119a, 0x0858f34d,\n    0xa1dea5ee, 0xf95e4739, 0xb2d57973, 0xea559ba4, 0x43d3cd07,\n    0x1b532fd0, 0xd5c5b093, 0x8d455244, 0x24c304e7, 0x7c43e630,\n    0x37c8d87a, 0x6f483aad, 0xc6ce6c0e, 0x9e4e8ed9, 0x5ae35389,\n    0x0263b15e, 0xabe5e7fd, 0xf365052a, 0xb8ee3b60, 0xe06ed9b7,\n    0x49e88f14, 0x11686dc3, 0xdffef280, 0x877e1057, 0x2ef846f4,\n    0x7678a423, 0x3df39a69, 0x657378be, 0xccf52e1d, 0x9475ccca,\n    0x44ae95bc, 0x1c2e776b, 0xb5a821c8, 0xed28c31f, 0xa6a3fd55,\n    0xfe231f82, 0x57a54921, 0x0f25abf6, 0xc1b334b5, 0x9933d662,\n    0x30b580c1, 0x68356216, 0x23be5c5c, 0x7b3ebe8b, 0xd2b8e828,\n    0x8a380aff, 0x4e95d7af, 0x16153578, 0xbf9363db, 0xe713810c,\n    0xac98bf46, 0xf4185d91, 0x5d9e0b32, 0x051ee9e5, 0xcb8876a6,\n    0x93089471, 0x3a8ec2d2, 0x620e2005, 0x29851e4f, 0x7105fc98,\n    0xd883aa3b, 0x800348ec, 0x783419d7, 0x20b4fb00, 0x8932ada3,\n    0xd1b24f74, 0x9a39713e, 0xc2b993e9, 0x6b3fc54a, 0x33bf279d,\n    0xfd29b8de, 0xa5a95a09, 0x0c2f0caa, 0x54afee7d, 0x1f24d037,\n    0x47a432e0, 0xee226443, 0xb6a28694, 0x720f5bc4, 0x2a8fb913,\n    0x8309efb0, 0xdb890d67, 0x9002332d, 0xc882d1fa, 0x61048759,\n    0x3984658e, 0xf712facd, 0xaf92181a, 0x06144eb9, 0x5e94ac6e,\n    0x151f9224, 0x4d9f70f3, 0xe4192650, 0xbc99c487, 0x6c429df1,\n    0x34c27f26, 0x9d442985, 0xc5c4cb52, 0x8e4ff518, 0xd6cf17cf,\n    0x7f49416c, 0x27c9a3bb, 0xe95f3cf8, 0xb1dfde2f, 0x1859888c,\n    0x40d96a5b, 0x0b525411, 0x53d2b6c6, 0xfa54e065, 0xa2d402b2,\n    0x6679dfe2, 0x3ef93d35, 0x977f6b96, 0xcfff8941, 0x8474b70b,\n    0xdcf455dc, 0x7572037f, 0x2df2e1a8, 0xe3647eeb, 0xbbe49c3c,\n    0x1262ca9f, 0x4ae22848, 0x01691602, 0x59e9f4d5, 0xf06fa276,\n    0xa8ef40a1},\n   {0x00000000, 0x463b6765, 0x8c76ceca, 0xca4da9af, 0x59ebed4e,\n    0x1fd08a2b, 0xd59d2384, 0x93a644e1, 0xb2d6db9d, 0xf4edbcf8,\n    0x3ea01557, 0x789b7232, 0xeb3d36d3, 0xad0651b6, 0x674bf819,\n    0x21709f7c, 0x25abc6e0, 0x6390a185, 0xa9dd082a, 0xefe66f4f,\n    0x7c402bae, 0x3a7b4ccb, 0xf036e564, 0xb60d8201, 0x977d1d7d,\n    0xd1467a18, 0x1b0bd3b7, 0x5d30b4d2, 0xce96f033, 0x88ad9756,\n    0x42e03ef9, 0x04db599c, 0x0b50fc1a, 0x4d6b9b7f, 0x872632d0,\n    0xc11d55b5, 0x52bb1154, 0x14807631, 0xdecddf9e, 0x98f6b8fb,\n    0xb9862787, 0xffbd40e2, 0x35f0e94d, 0x73cb8e28, 0xe06dcac9,\n    0xa656adac, 0x6c1b0403, 0x2a206366, 0x2efb3afa, 0x68c05d9f,\n    0xa28df430, 0xe4b69355, 0x7710d7b4, 0x312bb0d1, 0xfb66197e,\n    0xbd5d7e1b, 0x9c2de167, 0xda168602, 0x105b2fad, 0x566048c8,\n    0xc5c60c29, 0x83fd6b4c, 0x49b0c2e3, 0x0f8ba586, 0x16a0f835,\n    0x509b9f50, 0x9ad636ff, 0xdced519a, 0x4f4b157b, 0x0970721e,\n    0xc33ddbb1, 0x8506bcd4, 0xa47623a8, 0xe24d44cd, 0x2800ed62,\n    0x6e3b8a07, 0xfd9dcee6, 0xbba6a983, 0x71eb002c, 0x37d06749,\n    0x330b3ed5, 0x753059b0, 0xbf7df01f, 0xf946977a, 0x6ae0d39b,\n    0x2cdbb4fe, 0xe6961d51, 0xa0ad7a34, 0x81dde548, 0xc7e6822d,\n    0x0dab2b82, 0x4b904ce7, 0xd8360806, 0x9e0d6f63, 0x5440c6cc,\n    0x127ba1a9, 0x1df0042f, 0x5bcb634a, 0x9186cae5, 0xd7bdad80,\n    0x441be961, 0x02208e04, 0xc86d27ab, 0x8e5640ce, 0xaf26dfb2,\n    0xe91db8d7, 0x23501178, 0x656b761d, 0xf6cd32fc, 0xb0f65599,\n    0x7abbfc36, 0x3c809b53, 0x385bc2cf, 0x7e60a5aa, 0xb42d0c05,\n    0xf2166b60, 0x61b02f81, 0x278b48e4, 0xedc6e14b, 0xabfd862e,\n    0x8a8d1952, 0xccb67e37, 0x06fbd798, 0x40c0b0fd, 0xd366f41c,\n    0x955d9379, 0x5f103ad6, 0x192b5db3, 0x2c40f16b, 0x6a7b960e,\n    0xa0363fa1, 0xe60d58c4, 0x75ab1c25, 0x33907b40, 0xf9ddd2ef,\n    0xbfe6b58a, 0x9e962af6, 0xd8ad4d93, 0x12e0e43c, 0x54db8359,\n    0xc77dc7b8, 0x8146a0dd, 0x4b0b0972, 0x0d306e17, 0x09eb378b,\n    0x4fd050ee, 0x859df941, 0xc3a69e24, 0x5000dac5, 0x163bbda0,\n    0xdc76140f, 0x9a4d736a, 0xbb3dec16, 0xfd068b73, 0x374b22dc,\n    0x717045b9, 0xe2d60158, 0xa4ed663d, 0x6ea0cf92, 0x289ba8f7,\n    0x27100d71, 0x612b6a14, 0xab66c3bb, 0xed5da4de, 0x7efbe03f,\n    0x38c0875a, 0xf28d2ef5, 0xb4b64990, 0x95c6d6ec, 0xd3fdb189,\n    0x19b01826, 0x5f8b7f43, 0xcc2d3ba2, 0x8a165cc7, 0x405bf568,\n    0x0660920d, 0x02bbcb91, 0x4480acf4, 0x8ecd055b, 0xc8f6623e,\n    0x5b5026df, 0x1d6b41ba, 0xd726e815, 0x911d8f70, 0xb06d100c,\n    0xf6567769, 0x3c1bdec6, 0x7a20b9a3, 0xe986fd42, 0xafbd9a27,\n    0x65f03388, 0x23cb54ed, 0x3ae0095e, 0x7cdb6e3b, 0xb696c794,\n    0xf0ada0f1, 0x630be410, 0x25308375, 0xef7d2ada, 0xa9464dbf,\n    0x8836d2c3, 0xce0db5a6, 0x04401c09, 0x427b7b6c, 0xd1dd3f8d,\n    0x97e658e8, 0x5dabf147, 0x1b909622, 0x1f4bcfbe, 0x5970a8db,\n    0x933d0174, 0xd5066611, 0x46a022f0, 0x009b4595, 0xcad6ec3a,\n    0x8ced8b5f, 0xad9d1423, 0xeba67346, 0x21ebdae9, 0x67d0bd8c,\n    0xf476f96d, 0xb24d9e08, 0x780037a7, 0x3e3b50c2, 0x31b0f544,\n    0x778b9221, 0xbdc63b8e, 0xfbfd5ceb, 0x685b180a, 0x2e607f6f,\n    0xe42dd6c0, 0xa216b1a5, 0x83662ed9, 0xc55d49bc, 0x0f10e013,\n    0x492b8776, 0xda8dc397, 0x9cb6a4f2, 0x56fb0d5d, 0x10c06a38,\n    0x141b33a4, 0x522054c1, 0x986dfd6e, 0xde569a0b, 0x4df0deea,\n    0x0bcbb98f, 0xc1861020, 0x87bd7745, 0xa6cde839, 0xe0f68f5c,\n    0x2abb26f3, 0x6c804196, 0xff260577, 0xb91d6212, 0x7350cbbd,\n    0x356bacd8}};\n\n#endif\n\n#endif\n\n#if N == 6\n\n#if W == 8\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0x3db1ecdc, 0x7b63d9b8, 0x46d23564, 0xf6c7b370,\n    0xcb765fac, 0x8da46ac8, 0xb0158614, 0x36fe60a1, 0x0b4f8c7d,\n    0x4d9db919, 0x702c55c5, 0xc039d3d1, 0xfd883f0d, 0xbb5a0a69,\n    0x86ebe6b5, 0x6dfcc142, 0x504d2d9e, 0x169f18fa, 0x2b2ef426,\n    0x9b3b7232, 0xa68a9eee, 0xe058ab8a, 0xdde94756, 0x5b02a1e3,\n    0x66b34d3f, 0x2061785b, 0x1dd09487, 0xadc51293, 0x9074fe4f,\n    0xd6a6cb2b, 0xeb1727f7, 0xdbf98284, 0xe6486e58, 0xa09a5b3c,\n    0x9d2bb7e0, 0x2d3e31f4, 0x108fdd28, 0x565de84c, 0x6bec0490,\n    0xed07e225, 0xd0b60ef9, 0x96643b9d, 0xabd5d741, 0x1bc05155,\n    0x2671bd89, 0x60a388ed, 0x5d126431, 0xb60543c6, 0x8bb4af1a,\n    0xcd669a7e, 0xf0d776a2, 0x40c2f0b6, 0x7d731c6a, 0x3ba1290e,\n    0x0610c5d2, 0x80fb2367, 0xbd4acfbb, 0xfb98fadf, 0xc6291603,\n    0x763c9017, 0x4b8d7ccb, 0x0d5f49af, 0x30eea573, 0x6c820349,\n    0x5133ef95, 0x17e1daf1, 0x2a50362d, 0x9a45b039, 0xa7f45ce5,\n    0xe1266981, 0xdc97855d, 0x5a7c63e8, 0x67cd8f34, 0x211fba50,\n    0x1cae568c, 0xacbbd098, 0x910a3c44, 0xd7d80920, 0xea69e5fc,\n    0x017ec20b, 0x3ccf2ed7, 0x7a1d1bb3, 0x47acf76f, 0xf7b9717b,\n    0xca089da7, 0x8cdaa8c3, 0xb16b441f, 0x3780a2aa, 0x0a314e76,\n    0x4ce37b12, 0x715297ce, 0xc14711da, 0xfcf6fd06, 0xba24c862,\n    0x879524be, 0xb77b81cd, 0x8aca6d11, 0xcc185875, 0xf1a9b4a9,\n    0x41bc32bd, 0x7c0dde61, 0x3adfeb05, 0x076e07d9, 0x8185e16c,\n    0xbc340db0, 0xfae638d4, 0xc757d408, 0x7742521c, 0x4af3bec0,\n    0x0c218ba4, 0x31906778, 0xda87408f, 0xe736ac53, 0xa1e49937,\n    0x9c5575eb, 0x2c40f3ff, 0x11f11f23, 0x57232a47, 0x6a92c69b,\n    0xec79202e, 0xd1c8ccf2, 0x971af996, 0xaaab154a, 0x1abe935e,\n    0x270f7f82, 0x61dd4ae6, 0x5c6ca63a, 0xd9040692, 0xe4b5ea4e,\n    0xa267df2a, 0x9fd633f6, 0x2fc3b5e2, 0x1272593e, 0x54a06c5a,\n    0x69118086, 0xeffa6633, 0xd24b8aef, 0x9499bf8b, 0xa9285357,\n    0x193dd543, 0x248c399f, 0x625e0cfb, 0x5fefe027, 0xb4f8c7d0,\n    0x89492b0c, 0xcf9b1e68, 0xf22af2b4, 0x423f74a0, 0x7f8e987c,\n    0x395cad18, 0x04ed41c4, 0x8206a771, 0xbfb74bad, 0xf9657ec9,\n    0xc4d49215, 0x74c11401, 0x4970f8dd, 0x0fa2cdb9, 0x32132165,\n    0x02fd8416, 0x3f4c68ca, 0x799e5dae, 0x442fb172, 0xf43a3766,\n    0xc98bdbba, 0x8f59eede, 0xb2e80202, 0x3403e4b7, 0x09b2086b,\n    0x4f603d0f, 0x72d1d1d3, 0xc2c457c7, 0xff75bb1b, 0xb9a78e7f,\n    0x841662a3, 0x6f014554, 0x52b0a988, 0x14629cec, 0x29d37030,\n    0x99c6f624, 0xa4771af8, 0xe2a52f9c, 0xdf14c340, 0x59ff25f5,\n    0x644ec929, 0x229cfc4d, 0x1f2d1091, 0xaf389685, 0x92897a59,\n    0xd45b4f3d, 0xe9eaa3e1, 0xb58605db, 0x8837e907, 0xcee5dc63,\n    0xf35430bf, 0x4341b6ab, 0x7ef05a77, 0x38226f13, 0x059383cf,\n    0x8378657a, 0xbec989a6, 0xf81bbcc2, 0xc5aa501e, 0x75bfd60a,\n    0x480e3ad6, 0x0edc0fb2, 0x336de36e, 0xd87ac499, 0xe5cb2845,\n    0xa3191d21, 0x9ea8f1fd, 0x2ebd77e9, 0x130c9b35, 0x55deae51,\n    0x686f428d, 0xee84a438, 0xd33548e4, 0x95e77d80, 0xa856915c,\n    0x18431748, 0x25f2fb94, 0x6320cef0, 0x5e91222c, 0x6e7f875f,\n    0x53ce6b83, 0x151c5ee7, 0x28adb23b, 0x98b8342f, 0xa509d8f3,\n    0xe3dbed97, 0xde6a014b, 0x5881e7fe, 0x65300b22, 0x23e23e46,\n    0x1e53d29a, 0xae46548e, 0x93f7b852, 0xd5258d36, 0xe89461ea,\n    0x0383461d, 0x3e32aac1, 0x78e09fa5, 0x45517379, 0xf544f56d,\n    0xc8f519b1, 0x8e272cd5, 0xb396c009, 0x357d26bc, 0x08ccca60,\n    0x4e1eff04, 0x73af13d8, 0xc3ba95cc, 0xfe0b7910, 0xb8d94c74,\n    0x8568a0a8},\n   {0x00000000, 0x69790b65, 0xd2f216ca, 0xbb8b1daf, 0x7e952bd5,\n    0x17ec20b0, 0xac673d1f, 0xc51e367a, 0xfd2a57aa, 0x94535ccf,\n    0x2fd84160, 0x46a14a05, 0x83bf7c7f, 0xeac6771a, 0x514d6ab5,\n    0x383461d0, 0x2125a915, 0x485ca270, 0xf3d7bfdf, 0x9aaeb4ba,\n    0x5fb082c0, 0x36c989a5, 0x8d42940a, 0xe43b9f6f, 0xdc0ffebf,\n    0xb576f5da, 0x0efde875, 0x6784e310, 0xa29ad56a, 0xcbe3de0f,\n    0x7068c3a0, 0x1911c8c5, 0x424b522a, 0x2b32594f, 0x90b944e0,\n    0xf9c04f85, 0x3cde79ff, 0x55a7729a, 0xee2c6f35, 0x87556450,\n    0xbf610580, 0xd6180ee5, 0x6d93134a, 0x04ea182f, 0xc1f42e55,\n    0xa88d2530, 0x1306389f, 0x7a7f33fa, 0x636efb3f, 0x0a17f05a,\n    0xb19cedf5, 0xd8e5e690, 0x1dfbd0ea, 0x7482db8f, 0xcf09c620,\n    0xa670cd45, 0x9e44ac95, 0xf73da7f0, 0x4cb6ba5f, 0x25cfb13a,\n    0xe0d18740, 0x89a88c25, 0x3223918a, 0x5b5a9aef, 0x8496a454,\n    0xedefaf31, 0x5664b29e, 0x3f1db9fb, 0xfa038f81, 0x937a84e4,\n    0x28f1994b, 0x4188922e, 0x79bcf3fe, 0x10c5f89b, 0xab4ee534,\n    0xc237ee51, 0x0729d82b, 0x6e50d34e, 0xd5dbcee1, 0xbca2c584,\n    0xa5b30d41, 0xccca0624, 0x77411b8b, 0x1e3810ee, 0xdb262694,\n    0xb25f2df1, 0x09d4305e, 0x60ad3b3b, 0x58995aeb, 0x31e0518e,\n    0x8a6b4c21, 0xe3124744, 0x260c713e, 0x4f757a5b, 0xf4fe67f4,\n    0x9d876c91, 0xc6ddf67e, 0xafa4fd1b, 0x142fe0b4, 0x7d56ebd1,\n    0xb848ddab, 0xd131d6ce, 0x6abacb61, 0x03c3c004, 0x3bf7a1d4,\n    0x528eaab1, 0xe905b71e, 0x807cbc7b, 0x45628a01, 0x2c1b8164,\n    0x97909ccb, 0xfee997ae, 0xe7f85f6b, 0x8e81540e, 0x350a49a1,\n    0x5c7342c4, 0x996d74be, 0xf0147fdb, 0x4b9f6274, 0x22e66911,\n    0x1ad208c1, 0x73ab03a4, 0xc8201e0b, 0xa159156e, 0x64472314,\n    0x0d3e2871, 0xb6b535de, 0xdfcc3ebb, 0xd25c4ee9, 0xbb25458c,\n    0x00ae5823, 0x69d75346, 0xacc9653c, 0xc5b06e59, 0x7e3b73f6,\n    0x17427893, 0x2f761943, 0x460f1226, 0xfd840f89, 0x94fd04ec,\n    0x51e33296, 0x389a39f3, 0x8311245c, 0xea682f39, 0xf379e7fc,\n    0x9a00ec99, 0x218bf136, 0x48f2fa53, 0x8deccc29, 0xe495c74c,\n    0x5f1edae3, 0x3667d186, 0x0e53b056, 0x672abb33, 0xdca1a69c,\n    0xb5d8adf9, 0x70c69b83, 0x19bf90e6, 0xa2348d49, 0xcb4d862c,\n    0x90171cc3, 0xf96e17a6, 0x42e50a09, 0x2b9c016c, 0xee823716,\n    0x87fb3c73, 0x3c7021dc, 0x55092ab9, 0x6d3d4b69, 0x0444400c,\n    0xbfcf5da3, 0xd6b656c6, 0x13a860bc, 0x7ad16bd9, 0xc15a7676,\n    0xa8237d13, 0xb132b5d6, 0xd84bbeb3, 0x63c0a31c, 0x0ab9a879,\n    0xcfa79e03, 0xa6de9566, 0x1d5588c9, 0x742c83ac, 0x4c18e27c,\n    0x2561e919, 0x9eeaf4b6, 0xf793ffd3, 0x328dc9a9, 0x5bf4c2cc,\n    0xe07fdf63, 0x8906d406, 0x56caeabd, 0x3fb3e1d8, 0x8438fc77,\n    0xed41f712, 0x285fc168, 0x4126ca0d, 0xfaadd7a2, 0x93d4dcc7,\n    0xabe0bd17, 0xc299b672, 0x7912abdd, 0x106ba0b8, 0xd57596c2,\n    0xbc0c9da7, 0x07878008, 0x6efe8b6d, 0x77ef43a8, 0x1e9648cd,\n    0xa51d5562, 0xcc645e07, 0x097a687d, 0x60036318, 0xdb887eb7,\n    0xb2f175d2, 0x8ac51402, 0xe3bc1f67, 0x583702c8, 0x314e09ad,\n    0xf4503fd7, 0x9d2934b2, 0x26a2291d, 0x4fdb2278, 0x1481b897,\n    0x7df8b3f2, 0xc673ae5d, 0xaf0aa538, 0x6a149342, 0x036d9827,\n    0xb8e68588, 0xd19f8eed, 0xe9abef3d, 0x80d2e458, 0x3b59f9f7,\n    0x5220f292, 0x973ec4e8, 0xfe47cf8d, 0x45ccd222, 0x2cb5d947,\n    0x35a41182, 0x5cdd1ae7, 0xe7560748, 0x8e2f0c2d, 0x4b313a57,\n    0x22483132, 0x99c32c9d, 0xf0ba27f8, 0xc88e4628, 0xa1f74d4d,\n    0x1a7c50e2, 0x73055b87, 0xb61b6dfd, 0xdf626698, 0x64e97b37,\n    0x0d907052},\n   {0x00000000, 0x7fc99b93, 0xff933726, 0x805aacb5, 0x2457680d,\n    0x5b9ef39e, 0xdbc45f2b, 0xa40dc4b8, 0x48aed01a, 0x37674b89,\n    0xb73de73c, 0xc8f47caf, 0x6cf9b817, 0x13302384, 0x936a8f31,\n    0xeca314a2, 0x915da034, 0xee943ba7, 0x6ece9712, 0x11070c81,\n    0xb50ac839, 0xcac353aa, 0x4a99ff1f, 0x3550648c, 0xd9f3702e,\n    0xa63aebbd, 0x26604708, 0x59a9dc9b, 0xfda41823, 0x826d83b0,\n    0x02372f05, 0x7dfeb496, 0xf9ca4629, 0x8603ddba, 0x0659710f,\n    0x7990ea9c, 0xdd9d2e24, 0xa254b5b7, 0x220e1902, 0x5dc78291,\n    0xb1649633, 0xcead0da0, 0x4ef7a115, 0x313e3a86, 0x9533fe3e,\n    0xeafa65ad, 0x6aa0c918, 0x1569528b, 0x6897e61d, 0x175e7d8e,\n    0x9704d13b, 0xe8cd4aa8, 0x4cc08e10, 0x33091583, 0xb353b936,\n    0xcc9a22a5, 0x20393607, 0x5ff0ad94, 0xdfaa0121, 0xa0639ab2,\n    0x046e5e0a, 0x7ba7c599, 0xfbfd692c, 0x8434f2bf, 0x28e58a13,\n    0x572c1180, 0xd776bd35, 0xa8bf26a6, 0x0cb2e21e, 0x737b798d,\n    0xf321d538, 0x8ce84eab, 0x604b5a09, 0x1f82c19a, 0x9fd86d2f,\n    0xe011f6bc, 0x441c3204, 0x3bd5a997, 0xbb8f0522, 0xc4469eb1,\n    0xb9b82a27, 0xc671b1b4, 0x462b1d01, 0x39e28692, 0x9def422a,\n    0xe226d9b9, 0x627c750c, 0x1db5ee9f, 0xf116fa3d, 0x8edf61ae,\n    0x0e85cd1b, 0x714c5688, 0xd5419230, 0xaa8809a3, 0x2ad2a516,\n    0x551b3e85, 0xd12fcc3a, 0xaee657a9, 0x2ebcfb1c, 0x5175608f,\n    0xf578a437, 0x8ab13fa4, 0x0aeb9311, 0x75220882, 0x99811c20,\n    0xe64887b3, 0x66122b06, 0x19dbb095, 0xbdd6742d, 0xc21fefbe,\n    0x4245430b, 0x3d8cd898, 0x40726c0e, 0x3fbbf79d, 0xbfe15b28,\n    0xc028c0bb, 0x64250403, 0x1bec9f90, 0x9bb63325, 0xe47fa8b6,\n    0x08dcbc14, 0x77152787, 0xf74f8b32, 0x888610a1, 0x2c8bd419,\n    0x53424f8a, 0xd318e33f, 0xacd178ac, 0x51cb1426, 0x2e028fb5,\n    0xae582300, 0xd191b893, 0x759c7c2b, 0x0a55e7b8, 0x8a0f4b0d,\n    0xf5c6d09e, 0x1965c43c, 0x66ac5faf, 0xe6f6f31a, 0x993f6889,\n    0x3d32ac31, 0x42fb37a2, 0xc2a19b17, 0xbd680084, 0xc096b412,\n    0xbf5f2f81, 0x3f058334, 0x40cc18a7, 0xe4c1dc1f, 0x9b08478c,\n    0x1b52eb39, 0x649b70aa, 0x88386408, 0xf7f1ff9b, 0x77ab532e,\n    0x0862c8bd, 0xac6f0c05, 0xd3a69796, 0x53fc3b23, 0x2c35a0b0,\n    0xa801520f, 0xd7c8c99c, 0x57926529, 0x285bfeba, 0x8c563a02,\n    0xf39fa191, 0x73c50d24, 0x0c0c96b7, 0xe0af8215, 0x9f661986,\n    0x1f3cb533, 0x60f52ea0, 0xc4f8ea18, 0xbb31718b, 0x3b6bdd3e,\n    0x44a246ad, 0x395cf23b, 0x469569a8, 0xc6cfc51d, 0xb9065e8e,\n    0x1d0b9a36, 0x62c201a5, 0xe298ad10, 0x9d513683, 0x71f22221,\n    0x0e3bb9b2, 0x8e611507, 0xf1a88e94, 0x55a54a2c, 0x2a6cd1bf,\n    0xaa367d0a, 0xd5ffe699, 0x792e9e35, 0x06e705a6, 0x86bda913,\n    0xf9743280, 0x5d79f638, 0x22b06dab, 0xa2eac11e, 0xdd235a8d,\n    0x31804e2f, 0x4e49d5bc, 0xce137909, 0xb1dae29a, 0x15d72622,\n    0x6a1ebdb1, 0xea441104, 0x958d8a97, 0xe8733e01, 0x97baa592,\n    0x17e00927, 0x682992b4, 0xcc24560c, 0xb3edcd9f, 0x33b7612a,\n    0x4c7efab9, 0xa0ddee1b, 0xdf147588, 0x5f4ed93d, 0x208742ae,\n    0x848a8616, 0xfb431d85, 0x7b19b130, 0x04d02aa3, 0x80e4d81c,\n    0xff2d438f, 0x7f77ef3a, 0x00be74a9, 0xa4b3b011, 0xdb7a2b82,\n    0x5b208737, 0x24e91ca4, 0xc84a0806, 0xb7839395, 0x37d93f20,\n    0x4810a4b3, 0xec1d600b, 0x93d4fb98, 0x138e572d, 0x6c47ccbe,\n    0x11b97828, 0x6e70e3bb, 0xee2a4f0e, 0x91e3d49d, 0x35ee1025,\n    0x4a278bb6, 0xca7d2703, 0xb5b4bc90, 0x5917a832, 0x26de33a1,\n    0xa6849f14, 0xd94d0487, 0x7d40c03f, 0x02895bac, 0x82d3f719,\n    0xfd1a6c8a},\n   {0x00000000, 0xa396284c, 0x9c5d56d9, 0x3fcb7e95, 0xe3cbabf3,\n    0x405d83bf, 0x7f96fd2a, 0xdc00d566, 0x1ce651a7, 0xbf7079eb,\n    0x80bb077e, 0x232d2f32, 0xff2dfa54, 0x5cbbd218, 0x6370ac8d,\n    0xc0e684c1, 0x39cca34e, 0x9a5a8b02, 0xa591f597, 0x0607dddb,\n    0xda0708bd, 0x799120f1, 0x465a5e64, 0xe5cc7628, 0x252af2e9,\n    0x86bcdaa5, 0xb977a430, 0x1ae18c7c, 0xc6e1591a, 0x65777156,\n    0x5abc0fc3, 0xf92a278f, 0x7399469c, 0xd00f6ed0, 0xefc41045,\n    0x4c523809, 0x9052ed6f, 0x33c4c523, 0x0c0fbbb6, 0xaf9993fa,\n    0x6f7f173b, 0xcce93f77, 0xf32241e2, 0x50b469ae, 0x8cb4bcc8,\n    0x2f229484, 0x10e9ea11, 0xb37fc25d, 0x4a55e5d2, 0xe9c3cd9e,\n    0xd608b30b, 0x759e9b47, 0xa99e4e21, 0x0a08666d, 0x35c318f8,\n    0x965530b4, 0x56b3b475, 0xf5259c39, 0xcaeee2ac, 0x6978cae0,\n    0xb5781f86, 0x16ee37ca, 0x2925495f, 0x8ab36113, 0xe7328d38,\n    0x44a4a574, 0x7b6fdbe1, 0xd8f9f3ad, 0x04f926cb, 0xa76f0e87,\n    0x98a47012, 0x3b32585e, 0xfbd4dc9f, 0x5842f4d3, 0x67898a46,\n    0xc41fa20a, 0x181f776c, 0xbb895f20, 0x844221b5, 0x27d409f9,\n    0xdefe2e76, 0x7d68063a, 0x42a378af, 0xe13550e3, 0x3d358585,\n    0x9ea3adc9, 0xa168d35c, 0x02fefb10, 0xc2187fd1, 0x618e579d,\n    0x5e452908, 0xfdd30144, 0x21d3d422, 0x8245fc6e, 0xbd8e82fb,\n    0x1e18aab7, 0x94abcba4, 0x373de3e8, 0x08f69d7d, 0xab60b531,\n    0x77606057, 0xd4f6481b, 0xeb3d368e, 0x48ab1ec2, 0x884d9a03,\n    0x2bdbb24f, 0x1410ccda, 0xb786e496, 0x6b8631f0, 0xc81019bc,\n    0xf7db6729, 0x544d4f65, 0xad6768ea, 0x0ef140a6, 0x313a3e33,\n    0x92ac167f, 0x4eacc319, 0xed3aeb55, 0xd2f195c0, 0x7167bd8c,\n    0xb181394d, 0x12171101, 0x2ddc6f94, 0x8e4a47d8, 0x524a92be,\n    0xf1dcbaf2, 0xce17c467, 0x6d81ec2b, 0x15141c31, 0xb682347d,\n    0x89494ae8, 0x2adf62a4, 0xf6dfb7c2, 0x55499f8e, 0x6a82e11b,\n    0xc914c957, 0x09f24d96, 0xaa6465da, 0x95af1b4f, 0x36393303,\n    0xea39e665, 0x49afce29, 0x7664b0bc, 0xd5f298f0, 0x2cd8bf7f,\n    0x8f4e9733, 0xb085e9a6, 0x1313c1ea, 0xcf13148c, 0x6c853cc0,\n    0x534e4255, 0xf0d86a19, 0x303eeed8, 0x93a8c694, 0xac63b801,\n    0x0ff5904d, 0xd3f5452b, 0x70636d67, 0x4fa813f2, 0xec3e3bbe,\n    0x668d5aad, 0xc51b72e1, 0xfad00c74, 0x59462438, 0x8546f15e,\n    0x26d0d912, 0x191ba787, 0xba8d8fcb, 0x7a6b0b0a, 0xd9fd2346,\n    0xe6365dd3, 0x45a0759f, 0x99a0a0f9, 0x3a3688b5, 0x05fdf620,\n    0xa66bde6c, 0x5f41f9e3, 0xfcd7d1af, 0xc31caf3a, 0x608a8776,\n    0xbc8a5210, 0x1f1c7a5c, 0x20d704c9, 0x83412c85, 0x43a7a844,\n    0xe0318008, 0xdffafe9d, 0x7c6cd6d1, 0xa06c03b7, 0x03fa2bfb,\n    0x3c31556e, 0x9fa77d22, 0xf2269109, 0x51b0b945, 0x6e7bc7d0,\n    0xcdedef9c, 0x11ed3afa, 0xb27b12b6, 0x8db06c23, 0x2e26446f,\n    0xeec0c0ae, 0x4d56e8e2, 0x729d9677, 0xd10bbe3b, 0x0d0b6b5d,\n    0xae9d4311, 0x91563d84, 0x32c015c8, 0xcbea3247, 0x687c1a0b,\n    0x57b7649e, 0xf4214cd2, 0x282199b4, 0x8bb7b1f8, 0xb47ccf6d,\n    0x17eae721, 0xd70c63e0, 0x749a4bac, 0x4b513539, 0xe8c71d75,\n    0x34c7c813, 0x9751e05f, 0xa89a9eca, 0x0b0cb686, 0x81bfd795,\n    0x2229ffd9, 0x1de2814c, 0xbe74a900, 0x62747c66, 0xc1e2542a,\n    0xfe292abf, 0x5dbf02f3, 0x9d598632, 0x3ecfae7e, 0x0104d0eb,\n    0xa292f8a7, 0x7e922dc1, 0xdd04058d, 0xe2cf7b18, 0x41595354,\n    0xb87374db, 0x1be55c97, 0x242e2202, 0x87b80a4e, 0x5bb8df28,\n    0xf82ef764, 0xc7e589f1, 0x6473a1bd, 0xa495257c, 0x07030d30,\n    0x38c873a5, 0x9b5e5be9, 0x475e8e8f, 0xe4c8a6c3, 0xdb03d856,\n    0x7895f01a},\n   {0x00000000, 0x2a283862, 0x545070c4, 0x7e7848a6, 0xa8a0e188,\n    0x8288d9ea, 0xfcf0914c, 0xd6d8a92e, 0x8a30c551, 0xa018fd33,\n    0xde60b595, 0xf4488df7, 0x229024d9, 0x08b81cbb, 0x76c0541d,\n    0x5ce86c7f, 0xcf108ce3, 0xe538b481, 0x9b40fc27, 0xb168c445,\n    0x67b06d6b, 0x4d985509, 0x33e01daf, 0x19c825cd, 0x452049b2,\n    0x6f0871d0, 0x11703976, 0x3b580114, 0xed80a83a, 0xc7a89058,\n    0xb9d0d8fe, 0x93f8e09c, 0x45501f87, 0x6f7827e5, 0x11006f43,\n    0x3b285721, 0xedf0fe0f, 0xc7d8c66d, 0xb9a08ecb, 0x9388b6a9,\n    0xcf60dad6, 0xe548e2b4, 0x9b30aa12, 0xb1189270, 0x67c03b5e,\n    0x4de8033c, 0x33904b9a, 0x19b873f8, 0x8a409364, 0xa068ab06,\n    0xde10e3a0, 0xf438dbc2, 0x22e072ec, 0x08c84a8e, 0x76b00228,\n    0x5c983a4a, 0x00705635, 0x2a586e57, 0x542026f1, 0x7e081e93,\n    0xa8d0b7bd, 0x82f88fdf, 0xfc80c779, 0xd6a8ff1b, 0x8aa03f0e,\n    0xa088076c, 0xdef04fca, 0xf4d877a8, 0x2200de86, 0x0828e6e4,\n    0x7650ae42, 0x5c789620, 0x0090fa5f, 0x2ab8c23d, 0x54c08a9b,\n    0x7ee8b2f9, 0xa8301bd7, 0x821823b5, 0xfc606b13, 0xd6485371,\n    0x45b0b3ed, 0x6f988b8f, 0x11e0c329, 0x3bc8fb4b, 0xed105265,\n    0xc7386a07, 0xb94022a1, 0x93681ac3, 0xcf8076bc, 0xe5a84ede,\n    0x9bd00678, 0xb1f83e1a, 0x67209734, 0x4d08af56, 0x3370e7f0,\n    0x1958df92, 0xcff02089, 0xe5d818eb, 0x9ba0504d, 0xb188682f,\n    0x6750c101, 0x4d78f963, 0x3300b1c5, 0x192889a7, 0x45c0e5d8,\n    0x6fe8ddba, 0x1190951c, 0x3bb8ad7e, 0xed600450, 0xc7483c32,\n    0xb9307494, 0x93184cf6, 0x00e0ac6a, 0x2ac89408, 0x54b0dcae,\n    0x7e98e4cc, 0xa8404de2, 0x82687580, 0xfc103d26, 0xd6380544,\n    0x8ad0693b, 0xa0f85159, 0xde8019ff, 0xf4a8219d, 0x227088b3,\n    0x0858b0d1, 0x7620f877, 0x5c08c015, 0xce31785d, 0xe419403f,\n    0x9a610899, 0xb04930fb, 0x669199d5, 0x4cb9a1b7, 0x32c1e911,\n    0x18e9d173, 0x4401bd0c, 0x6e29856e, 0x1051cdc8, 0x3a79f5aa,\n    0xeca15c84, 0xc68964e6, 0xb8f12c40, 0x92d91422, 0x0121f4be,\n    0x2b09ccdc, 0x5571847a, 0x7f59bc18, 0xa9811536, 0x83a92d54,\n    0xfdd165f2, 0xd7f95d90, 0x8b1131ef, 0xa139098d, 0xdf41412b,\n    0xf5697949, 0x23b1d067, 0x0999e805, 0x77e1a0a3, 0x5dc998c1,\n    0x8b6167da, 0xa1495fb8, 0xdf31171e, 0xf5192f7c, 0x23c18652,\n    0x09e9be30, 0x7791f696, 0x5db9cef4, 0x0151a28b, 0x2b799ae9,\n    0x5501d24f, 0x7f29ea2d, 0xa9f14303, 0x83d97b61, 0xfda133c7,\n    0xd7890ba5, 0x4471eb39, 0x6e59d35b, 0x10219bfd, 0x3a09a39f,\n    0xecd10ab1, 0xc6f932d3, 0xb8817a75, 0x92a94217, 0xce412e68,\n    0xe469160a, 0x9a115eac, 0xb03966ce, 0x66e1cfe0, 0x4cc9f782,\n    0x32b1bf24, 0x18998746, 0x44914753, 0x6eb97f31, 0x10c13797,\n    0x3ae90ff5, 0xec31a6db, 0xc6199eb9, 0xb861d61f, 0x9249ee7d,\n    0xcea18202, 0xe489ba60, 0x9af1f2c6, 0xb0d9caa4, 0x6601638a,\n    0x4c295be8, 0x3251134e, 0x18792b2c, 0x8b81cbb0, 0xa1a9f3d2,\n    0xdfd1bb74, 0xf5f98316, 0x23212a38, 0x0909125a, 0x77715afc,\n    0x5d59629e, 0x01b10ee1, 0x2b993683, 0x55e17e25, 0x7fc94647,\n    0xa911ef69, 0x8339d70b, 0xfd419fad, 0xd769a7cf, 0x01c158d4,\n    0x2be960b6, 0x55912810, 0x7fb91072, 0xa961b95c, 0x8349813e,\n    0xfd31c998, 0xd719f1fa, 0x8bf19d85, 0xa1d9a5e7, 0xdfa1ed41,\n    0xf589d523, 0x23517c0d, 0x0979446f, 0x77010cc9, 0x5d2934ab,\n    0xced1d437, 0xe4f9ec55, 0x9a81a4f3, 0xb0a99c91, 0x667135bf,\n    0x4c590ddd, 0x3221457b, 0x18097d19, 0x44e11166, 0x6ec92904,\n    0x10b161a2, 0x3a9959c0, 0xec41f0ee, 0xc669c88c, 0xb811802a,\n    0x9239b848},\n   {0x00000000, 0x4713f6fb, 0x8e27edf6, 0xc9341b0d, 0xc73eddad,\n    0x802d2b56, 0x4919305b, 0x0e0ac6a0, 0x550cbd1b, 0x121f4be0,\n    0xdb2b50ed, 0x9c38a616, 0x923260b6, 0xd521964d, 0x1c158d40,\n    0x5b067bbb, 0xaa197a36, 0xed0a8ccd, 0x243e97c0, 0x632d613b,\n    0x6d27a79b, 0x2a345160, 0xe3004a6d, 0xa413bc96, 0xff15c72d,\n    0xb80631d6, 0x71322adb, 0x3621dc20, 0x382b1a80, 0x7f38ec7b,\n    0xb60cf776, 0xf11f018d, 0x8f43f22d, 0xc85004d6, 0x01641fdb,\n    0x4677e920, 0x487d2f80, 0x0f6ed97b, 0xc65ac276, 0x8149348d,\n    0xda4f4f36, 0x9d5cb9cd, 0x5468a2c0, 0x137b543b, 0x1d71929b,\n    0x5a626460, 0x93567f6d, 0xd4458996, 0x255a881b, 0x62497ee0,\n    0xab7d65ed, 0xec6e9316, 0xe26455b6, 0xa577a34d, 0x6c43b840,\n    0x2b504ebb, 0x70563500, 0x3745c3fb, 0xfe71d8f6, 0xb9622e0d,\n    0xb768e8ad, 0xf07b1e56, 0x394f055b, 0x7e5cf3a0, 0xc5f6e21b,\n    0x82e514e0, 0x4bd10fed, 0x0cc2f916, 0x02c83fb6, 0x45dbc94d,\n    0x8cefd240, 0xcbfc24bb, 0x90fa5f00, 0xd7e9a9fb, 0x1eddb2f6,\n    0x59ce440d, 0x57c482ad, 0x10d77456, 0xd9e36f5b, 0x9ef099a0,\n    0x6fef982d, 0x28fc6ed6, 0xe1c875db, 0xa6db8320, 0xa8d14580,\n    0xefc2b37b, 0x26f6a876, 0x61e55e8d, 0x3ae32536, 0x7df0d3cd,\n    0xb4c4c8c0, 0xf3d73e3b, 0xfdddf89b, 0xbace0e60, 0x73fa156d,\n    0x34e9e396, 0x4ab51036, 0x0da6e6cd, 0xc492fdc0, 0x83810b3b,\n    0x8d8bcd9b, 0xca983b60, 0x03ac206d, 0x44bfd696, 0x1fb9ad2d,\n    0x58aa5bd6, 0x919e40db, 0xd68db620, 0xd8877080, 0x9f94867b,\n    0x56a09d76, 0x11b36b8d, 0xe0ac6a00, 0xa7bf9cfb, 0x6e8b87f6,\n    0x2998710d, 0x2792b7ad, 0x60814156, 0xa9b55a5b, 0xeea6aca0,\n    0xb5a0d71b, 0xf2b321e0, 0x3b873aed, 0x7c94cc16, 0x729e0ab6,\n    0x358dfc4d, 0xfcb9e740, 0xbbaa11bb, 0x509cc277, 0x178f348c,\n    0xdebb2f81, 0x99a8d97a, 0x97a21fda, 0xd0b1e921, 0x1985f22c,\n    0x5e9604d7, 0x05907f6c, 0x42838997, 0x8bb7929a, 0xcca46461,\n    0xc2aea2c1, 0x85bd543a, 0x4c894f37, 0x0b9ab9cc, 0xfa85b841,\n    0xbd964eba, 0x74a255b7, 0x33b1a34c, 0x3dbb65ec, 0x7aa89317,\n    0xb39c881a, 0xf48f7ee1, 0xaf89055a, 0xe89af3a1, 0x21aee8ac,\n    0x66bd1e57, 0x68b7d8f7, 0x2fa42e0c, 0xe6903501, 0xa183c3fa,\n    0xdfdf305a, 0x98ccc6a1, 0x51f8ddac, 0x16eb2b57, 0x18e1edf7,\n    0x5ff21b0c, 0x96c60001, 0xd1d5f6fa, 0x8ad38d41, 0xcdc07bba,\n    0x04f460b7, 0x43e7964c, 0x4ded50ec, 0x0afea617, 0xc3cabd1a,\n    0x84d94be1, 0x75c64a6c, 0x32d5bc97, 0xfbe1a79a, 0xbcf25161,\n    0xb2f897c1, 0xf5eb613a, 0x3cdf7a37, 0x7bcc8ccc, 0x20caf777,\n    0x67d9018c, 0xaeed1a81, 0xe9feec7a, 0xe7f42ada, 0xa0e7dc21,\n    0x69d3c72c, 0x2ec031d7, 0x956a206c, 0xd279d697, 0x1b4dcd9a,\n    0x5c5e3b61, 0x5254fdc1, 0x15470b3a, 0xdc731037, 0x9b60e6cc,\n    0xc0669d77, 0x87756b8c, 0x4e417081, 0x0952867a, 0x075840da,\n    0x404bb621, 0x897fad2c, 0xce6c5bd7, 0x3f735a5a, 0x7860aca1,\n    0xb154b7ac, 0xf6474157, 0xf84d87f7, 0xbf5e710c, 0x766a6a01,\n    0x31799cfa, 0x6a7fe741, 0x2d6c11ba, 0xe4580ab7, 0xa34bfc4c,\n    0xad413aec, 0xea52cc17, 0x2366d71a, 0x647521e1, 0x1a29d241,\n    0x5d3a24ba, 0x940e3fb7, 0xd31dc94c, 0xdd170fec, 0x9a04f917,\n    0x5330e21a, 0x142314e1, 0x4f256f5a, 0x083699a1, 0xc10282ac,\n    0x86117457, 0x881bb2f7, 0xcf08440c, 0x063c5f01, 0x412fa9fa,\n    0xb030a877, 0xf7235e8c, 0x3e174581, 0x7904b37a, 0x770e75da,\n    0x301d8321, 0xf929982c, 0xbe3a6ed7, 0xe53c156c, 0xa22fe397,\n    0x6b1bf89a, 0x2c080e61, 0x2202c8c1, 0x65113e3a, 0xac252537,\n    0xeb36d3cc},\n   {0x00000000, 0xa13984ee, 0x99020f9d, 0x383b8b73, 0xe975197b,\n    0x484c9d95, 0x707716e6, 0xd14e9208, 0x099b34b7, 0xa8a2b059,\n    0x90993b2a, 0x31a0bfc4, 0xe0ee2dcc, 0x41d7a922, 0x79ec2251,\n    0xd8d5a6bf, 0x1336696e, 0xb20fed80, 0x8a3466f3, 0x2b0de21d,\n    0xfa437015, 0x5b7af4fb, 0x63417f88, 0xc278fb66, 0x1aad5dd9,\n    0xbb94d937, 0x83af5244, 0x2296d6aa, 0xf3d844a2, 0x52e1c04c,\n    0x6ada4b3f, 0xcbe3cfd1, 0x266cd2dc, 0x87555632, 0xbf6edd41,\n    0x1e5759af, 0xcf19cba7, 0x6e204f49, 0x561bc43a, 0xf72240d4,\n    0x2ff7e66b, 0x8ece6285, 0xb6f5e9f6, 0x17cc6d18, 0xc682ff10,\n    0x67bb7bfe, 0x5f80f08d, 0xfeb97463, 0x355abbb2, 0x94633f5c,\n    0xac58b42f, 0x0d6130c1, 0xdc2fa2c9, 0x7d162627, 0x452dad54,\n    0xe41429ba, 0x3cc18f05, 0x9df80beb, 0xa5c38098, 0x04fa0476,\n    0xd5b4967e, 0x748d1290, 0x4cb699e3, 0xed8f1d0d, 0x4cd9a5b8,\n    0xede02156, 0xd5dbaa25, 0x74e22ecb, 0xa5acbcc3, 0x0495382d,\n    0x3caeb35e, 0x9d9737b0, 0x4542910f, 0xe47b15e1, 0xdc409e92,\n    0x7d791a7c, 0xac378874, 0x0d0e0c9a, 0x353587e9, 0x940c0307,\n    0x5fefccd6, 0xfed64838, 0xc6edc34b, 0x67d447a5, 0xb69ad5ad,\n    0x17a35143, 0x2f98da30, 0x8ea15ede, 0x5674f861, 0xf74d7c8f,\n    0xcf76f7fc, 0x6e4f7312, 0xbf01e11a, 0x1e3865f4, 0x2603ee87,\n    0x873a6a69, 0x6ab57764, 0xcb8cf38a, 0xf3b778f9, 0x528efc17,\n    0x83c06e1f, 0x22f9eaf1, 0x1ac26182, 0xbbfbe56c, 0x632e43d3,\n    0xc217c73d, 0xfa2c4c4e, 0x5b15c8a0, 0x8a5b5aa8, 0x2b62de46,\n    0x13595535, 0xb260d1db, 0x79831e0a, 0xd8ba9ae4, 0xe0811197,\n    0x41b89579, 0x90f60771, 0x31cf839f, 0x09f408ec, 0xa8cd8c02,\n    0x70182abd, 0xd121ae53, 0xe91a2520, 0x4823a1ce, 0x996d33c6,\n    0x3854b728, 0x006f3c5b, 0xa156b8b5, 0x99b34b70, 0x388acf9e,\n    0x00b144ed, 0xa188c003, 0x70c6520b, 0xd1ffd6e5, 0xe9c45d96,\n    0x48fdd978, 0x90287fc7, 0x3111fb29, 0x092a705a, 0xa813f4b4,\n    0x795d66bc, 0xd864e252, 0xe05f6921, 0x4166edcf, 0x8a85221e,\n    0x2bbca6f0, 0x13872d83, 0xb2bea96d, 0x63f03b65, 0xc2c9bf8b,\n    0xfaf234f8, 0x5bcbb016, 0x831e16a9, 0x22279247, 0x1a1c1934,\n    0xbb259dda, 0x6a6b0fd2, 0xcb528b3c, 0xf369004f, 0x525084a1,\n    0xbfdf99ac, 0x1ee61d42, 0x26dd9631, 0x87e412df, 0x56aa80d7,\n    0xf7930439, 0xcfa88f4a, 0x6e910ba4, 0xb644ad1b, 0x177d29f5,\n    0x2f46a286, 0x8e7f2668, 0x5f31b460, 0xfe08308e, 0xc633bbfd,\n    0x670a3f13, 0xace9f0c2, 0x0dd0742c, 0x35ebff5f, 0x94d27bb1,\n    0x459ce9b9, 0xe4a56d57, 0xdc9ee624, 0x7da762ca, 0xa572c475,\n    0x044b409b, 0x3c70cbe8, 0x9d494f06, 0x4c07dd0e, 0xed3e59e0,\n    0xd505d293, 0x743c567d, 0xd56aeec8, 0x74536a26, 0x4c68e155,\n    0xed5165bb, 0x3c1ff7b3, 0x9d26735d, 0xa51df82e, 0x04247cc0,\n    0xdcf1da7f, 0x7dc85e91, 0x45f3d5e2, 0xe4ca510c, 0x3584c304,\n    0x94bd47ea, 0xac86cc99, 0x0dbf4877, 0xc65c87a6, 0x67650348,\n    0x5f5e883b, 0xfe670cd5, 0x2f299edd, 0x8e101a33, 0xb62b9140,\n    0x171215ae, 0xcfc7b311, 0x6efe37ff, 0x56c5bc8c, 0xf7fc3862,\n    0x26b2aa6a, 0x878b2e84, 0xbfb0a5f7, 0x1e892119, 0xf3063c14,\n    0x523fb8fa, 0x6a043389, 0xcb3db767, 0x1a73256f, 0xbb4aa181,\n    0x83712af2, 0x2248ae1c, 0xfa9d08a3, 0x5ba48c4d, 0x639f073e,\n    0xc2a683d0, 0x13e811d8, 0xb2d19536, 0x8aea1e45, 0x2bd39aab,\n    0xe030557a, 0x4109d194, 0x79325ae7, 0xd80bde09, 0x09454c01,\n    0xa87cc8ef, 0x9047439c, 0x317ec772, 0xe9ab61cd, 0x4892e523,\n    0x70a96e50, 0xd190eabe, 0x00de78b6, 0xa1e7fc58, 0x99dc772b,\n    0x38e5f3c5},\n   {0x00000000, 0xe81790a1, 0x0b5e2703, 0xe349b7a2, 0x16bc4e06,\n    0xfeabdea7, 0x1de26905, 0xf5f5f9a4, 0x2d789c0c, 0xc56f0cad,\n    0x2626bb0f, 0xce312bae, 0x3bc4d20a, 0xd3d342ab, 0x309af509,\n    0xd88d65a8, 0x5af13818, 0xb2e6a8b9, 0x51af1f1b, 0xb9b88fba,\n    0x4c4d761e, 0xa45ae6bf, 0x4713511d, 0xaf04c1bc, 0x7789a414,\n    0x9f9e34b5, 0x7cd78317, 0x94c013b6, 0x6135ea12, 0x89227ab3,\n    0x6a6bcd11, 0x827c5db0, 0xb5e27030, 0x5df5e091, 0xbebc5733,\n    0x56abc792, 0xa35e3e36, 0x4b49ae97, 0xa8001935, 0x40178994,\n    0x989aec3c, 0x708d7c9d, 0x93c4cb3f, 0x7bd35b9e, 0x8e26a23a,\n    0x6631329b, 0x85788539, 0x6d6f1598, 0xef134828, 0x0704d889,\n    0xe44d6f2b, 0x0c5aff8a, 0xf9af062e, 0x11b8968f, 0xf2f1212d,\n    0x1ae6b18c, 0xc26bd424, 0x2a7c4485, 0xc935f327, 0x21226386,\n    0xd4d79a22, 0x3cc00a83, 0xdf89bd21, 0x379e2d80, 0xb0b5e621,\n    0x58a27680, 0xbbebc122, 0x53fc5183, 0xa609a827, 0x4e1e3886,\n    0xad578f24, 0x45401f85, 0x9dcd7a2d, 0x75daea8c, 0x96935d2e,\n    0x7e84cd8f, 0x8b71342b, 0x6366a48a, 0x802f1328, 0x68388389,\n    0xea44de39, 0x02534e98, 0xe11af93a, 0x090d699b, 0xfcf8903f,\n    0x14ef009e, 0xf7a6b73c, 0x1fb1279d, 0xc73c4235, 0x2f2bd294,\n    0xcc626536, 0x2475f597, 0xd1800c33, 0x39979c92, 0xdade2b30,\n    0x32c9bb91, 0x05579611, 0xed4006b0, 0x0e09b112, 0xe61e21b3,\n    0x13ebd817, 0xfbfc48b6, 0x18b5ff14, 0xf0a26fb5, 0x282f0a1d,\n    0xc0389abc, 0x23712d1e, 0xcb66bdbf, 0x3e93441b, 0xd684d4ba,\n    0x35cd6318, 0xdddaf3b9, 0x5fa6ae09, 0xb7b13ea8, 0x54f8890a,\n    0xbcef19ab, 0x491ae00f, 0xa10d70ae, 0x4244c70c, 0xaa5357ad,\n    0x72de3205, 0x9ac9a2a4, 0x79801506, 0x919785a7, 0x64627c03,\n    0x8c75eca2, 0x6f3c5b00, 0x872bcba1, 0xba1aca03, 0x520d5aa2,\n    0xb144ed00, 0x59537da1, 0xaca68405, 0x44b114a4, 0xa7f8a306,\n    0x4fef33a7, 0x9762560f, 0x7f75c6ae, 0x9c3c710c, 0x742be1ad,\n    0x81de1809, 0x69c988a8, 0x8a803f0a, 0x6297afab, 0xe0ebf21b,\n    0x08fc62ba, 0xebb5d518, 0x03a245b9, 0xf657bc1d, 0x1e402cbc,\n    0xfd099b1e, 0x151e0bbf, 0xcd936e17, 0x2584feb6, 0xc6cd4914,\n    0x2edad9b5, 0xdb2f2011, 0x3338b0b0, 0xd0710712, 0x386697b3,\n    0x0ff8ba33, 0xe7ef2a92, 0x04a69d30, 0xecb10d91, 0x1944f435,\n    0xf1536494, 0x121ad336, 0xfa0d4397, 0x2280263f, 0xca97b69e,\n    0x29de013c, 0xc1c9919d, 0x343c6839, 0xdc2bf898, 0x3f624f3a,\n    0xd775df9b, 0x5509822b, 0xbd1e128a, 0x5e57a528, 0xb6403589,\n    0x43b5cc2d, 0xaba25c8c, 0x48ebeb2e, 0xa0fc7b8f, 0x78711e27,\n    0x90668e86, 0x732f3924, 0x9b38a985, 0x6ecd5021, 0x86dac080,\n    0x65937722, 0x8d84e783, 0x0aaf2c22, 0xe2b8bc83, 0x01f10b21,\n    0xe9e69b80, 0x1c136224, 0xf404f285, 0x174d4527, 0xff5ad586,\n    0x27d7b02e, 0xcfc0208f, 0x2c89972d, 0xc49e078c, 0x316bfe28,\n    0xd97c6e89, 0x3a35d92b, 0xd222498a, 0x505e143a, 0xb849849b,\n    0x5b003339, 0xb317a398, 0x46e25a3c, 0xaef5ca9d, 0x4dbc7d3f,\n    0xa5abed9e, 0x7d268836, 0x95311897, 0x7678af35, 0x9e6f3f94,\n    0x6b9ac630, 0x838d5691, 0x60c4e133, 0x88d37192, 0xbf4d5c12,\n    0x575accb3, 0xb4137b11, 0x5c04ebb0, 0xa9f11214, 0x41e682b5,\n    0xa2af3517, 0x4ab8a5b6, 0x9235c01e, 0x7a2250bf, 0x996be71d,\n    0x717c77bc, 0x84898e18, 0x6c9e1eb9, 0x8fd7a91b, 0x67c039ba,\n    0xe5bc640a, 0x0dabf4ab, 0xeee24309, 0x06f5d3a8, 0xf3002a0c,\n    0x1b17baad, 0xf85e0d0f, 0x10499dae, 0xc8c4f806, 0x20d368a7,\n    0xc39adf05, 0x2b8d4fa4, 0xde78b600, 0x366f26a1, 0xd5269103,\n    0x3d3101a2}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x0000000000000000, 0xa19017e800000000, 0x03275e0b00000000,\n    0xa2b749e300000000, 0x064ebc1600000000, 0xa7deabfe00000000,\n    0x0569e21d00000000, 0xa4f9f5f500000000, 0x0c9c782d00000000,\n    0xad0c6fc500000000, 0x0fbb262600000000, 0xae2b31ce00000000,\n    0x0ad2c43b00000000, 0xab42d3d300000000, 0x09f59a3000000000,\n    0xa8658dd800000000, 0x1838f15a00000000, 0xb9a8e6b200000000,\n    0x1b1faf5100000000, 0xba8fb8b900000000, 0x1e764d4c00000000,\n    0xbfe65aa400000000, 0x1d51134700000000, 0xbcc104af00000000,\n    0x14a4897700000000, 0xb5349e9f00000000, 0x1783d77c00000000,\n    0xb613c09400000000, 0x12ea356100000000, 0xb37a228900000000,\n    0x11cd6b6a00000000, 0xb05d7c8200000000, 0x3070e2b500000000,\n    0x91e0f55d00000000, 0x3357bcbe00000000, 0x92c7ab5600000000,\n    0x363e5ea300000000, 0x97ae494b00000000, 0x351900a800000000,\n    0x9489174000000000, 0x3cec9a9800000000, 0x9d7c8d7000000000,\n    0x3fcbc49300000000, 0x9e5bd37b00000000, 0x3aa2268e00000000,\n    0x9b32316600000000, 0x3985788500000000, 0x98156f6d00000000,\n    0x284813ef00000000, 0x89d8040700000000, 0x2b6f4de400000000,\n    0x8aff5a0c00000000, 0x2e06aff900000000, 0x8f96b81100000000,\n    0x2d21f1f200000000, 0x8cb1e61a00000000, 0x24d46bc200000000,\n    0x85447c2a00000000, 0x27f335c900000000, 0x8663222100000000,\n    0x229ad7d400000000, 0x830ac03c00000000, 0x21bd89df00000000,\n    0x802d9e3700000000, 0x21e6b5b000000000, 0x8076a25800000000,\n    0x22c1ebbb00000000, 0x8351fc5300000000, 0x27a809a600000000,\n    0x86381e4e00000000, 0x248f57ad00000000, 0x851f404500000000,\n    0x2d7acd9d00000000, 0x8ceada7500000000, 0x2e5d939600000000,\n    0x8fcd847e00000000, 0x2b34718b00000000, 0x8aa4666300000000,\n    0x28132f8000000000, 0x8983386800000000, 0x39de44ea00000000,\n    0x984e530200000000, 0x3af91ae100000000, 0x9b690d0900000000,\n    0x3f90f8fc00000000, 0x9e00ef1400000000, 0x3cb7a6f700000000,\n    0x9d27b11f00000000, 0x35423cc700000000, 0x94d22b2f00000000,\n    0x366562cc00000000, 0x97f5752400000000, 0x330c80d100000000,\n    0x929c973900000000, 0x302bdeda00000000, 0x91bbc93200000000,\n    0x1196570500000000, 0xb00640ed00000000, 0x12b1090e00000000,\n    0xb3211ee600000000, 0x17d8eb1300000000, 0xb648fcfb00000000,\n    0x14ffb51800000000, 0xb56fa2f000000000, 0x1d0a2f2800000000,\n    0xbc9a38c000000000, 0x1e2d712300000000, 0xbfbd66cb00000000,\n    0x1b44933e00000000, 0xbad484d600000000, 0x1863cd3500000000,\n    0xb9f3dadd00000000, 0x09aea65f00000000, 0xa83eb1b700000000,\n    0x0a89f85400000000, 0xab19efbc00000000, 0x0fe01a4900000000,\n    0xae700da100000000, 0x0cc7444200000000, 0xad5753aa00000000,\n    0x0532de7200000000, 0xa4a2c99a00000000, 0x0615807900000000,\n    0xa785979100000000, 0x037c626400000000, 0xa2ec758c00000000,\n    0x005b3c6f00000000, 0xa1cb2b8700000000, 0x03ca1aba00000000,\n    0xa25a0d5200000000, 0x00ed44b100000000, 0xa17d535900000000,\n    0x0584a6ac00000000, 0xa414b14400000000, 0x06a3f8a700000000,\n    0xa733ef4f00000000, 0x0f56629700000000, 0xaec6757f00000000,\n    0x0c713c9c00000000, 0xade12b7400000000, 0x0918de8100000000,\n    0xa888c96900000000, 0x0a3f808a00000000, 0xabaf976200000000,\n    0x1bf2ebe000000000, 0xba62fc0800000000, 0x18d5b5eb00000000,\n    0xb945a20300000000, 0x1dbc57f600000000, 0xbc2c401e00000000,\n    0x1e9b09fd00000000, 0xbf0b1e1500000000, 0x176e93cd00000000,\n    0xb6fe842500000000, 0x1449cdc600000000, 0xb5d9da2e00000000,\n    0x11202fdb00000000, 0xb0b0383300000000, 0x120771d000000000,\n    0xb397663800000000, 0x33baf80f00000000, 0x922aefe700000000,\n    0x309da60400000000, 0x910db1ec00000000, 0x35f4441900000000,\n    0x946453f100000000, 0x36d31a1200000000, 0x97430dfa00000000,\n    0x3f26802200000000, 0x9eb697ca00000000, 0x3c01de2900000000,\n    0x9d91c9c100000000, 0x39683c3400000000, 0x98f82bdc00000000,\n    0x3a4f623f00000000, 0x9bdf75d700000000, 0x2b82095500000000,\n    0x8a121ebd00000000, 0x28a5575e00000000, 0x893540b600000000,\n    0x2dccb54300000000, 0x8c5ca2ab00000000, 0x2eebeb4800000000,\n    0x8f7bfca000000000, 0x271e717800000000, 0x868e669000000000,\n    0x24392f7300000000, 0x85a9389b00000000, 0x2150cd6e00000000,\n    0x80c0da8600000000, 0x2277936500000000, 0x83e7848d00000000,\n    0x222caf0a00000000, 0x83bcb8e200000000, 0x210bf10100000000,\n    0x809be6e900000000, 0x2462131c00000000, 0x85f204f400000000,\n    0x27454d1700000000, 0x86d55aff00000000, 0x2eb0d72700000000,\n    0x8f20c0cf00000000, 0x2d97892c00000000, 0x8c079ec400000000,\n    0x28fe6b3100000000, 0x896e7cd900000000, 0x2bd9353a00000000,\n    0x8a4922d200000000, 0x3a145e5000000000, 0x9b8449b800000000,\n    0x3933005b00000000, 0x98a317b300000000, 0x3c5ae24600000000,\n    0x9dcaf5ae00000000, 0x3f7dbc4d00000000, 0x9eedaba500000000,\n    0x3688267d00000000, 0x9718319500000000, 0x35af787600000000,\n    0x943f6f9e00000000, 0x30c69a6b00000000, 0x91568d8300000000,\n    0x33e1c46000000000, 0x9271d38800000000, 0x125c4dbf00000000,\n    0xb3cc5a5700000000, 0x117b13b400000000, 0xb0eb045c00000000,\n    0x1412f1a900000000, 0xb582e64100000000, 0x1735afa200000000,\n    0xb6a5b84a00000000, 0x1ec0359200000000, 0xbf50227a00000000,\n    0x1de76b9900000000, 0xbc777c7100000000, 0x188e898400000000,\n    0xb91e9e6c00000000, 0x1ba9d78f00000000, 0xba39c06700000000,\n    0x0a64bce500000000, 0xabf4ab0d00000000, 0x0943e2ee00000000,\n    0xa8d3f50600000000, 0x0c2a00f300000000, 0xadba171b00000000,\n    0x0f0d5ef800000000, 0xae9d491000000000, 0x06f8c4c800000000,\n    0xa768d32000000000, 0x05df9ac300000000, 0xa44f8d2b00000000,\n    0x00b678de00000000, 0xa1266f3600000000, 0x039126d500000000,\n    0xa201313d00000000},\n   {0x0000000000000000, 0xee8439a100000000, 0x9d0f029900000000,\n    0x738b3b3800000000, 0x7b1975e900000000, 0x959d4c4800000000,\n    0xe616777000000000, 0x08924ed100000000, 0xb7349b0900000000,\n    0x59b0a2a800000000, 0x2a3b999000000000, 0xc4bfa03100000000,\n    0xcc2deee000000000, 0x22a9d74100000000, 0x5122ec7900000000,\n    0xbfa6d5d800000000, 0x6e69361300000000, 0x80ed0fb200000000,\n    0xf366348a00000000, 0x1de20d2b00000000, 0x157043fa00000000,\n    0xfbf47a5b00000000, 0x887f416300000000, 0x66fb78c200000000,\n    0xd95dad1a00000000, 0x37d994bb00000000, 0x4452af8300000000,\n    0xaad6962200000000, 0xa244d8f300000000, 0x4cc0e15200000000,\n    0x3f4bda6a00000000, 0xd1cfe3cb00000000, 0xdcd26c2600000000,\n    0x3256558700000000, 0x41dd6ebf00000000, 0xaf59571e00000000,\n    0xa7cb19cf00000000, 0x494f206e00000000, 0x3ac41b5600000000,\n    0xd44022f700000000, 0x6be6f72f00000000, 0x8562ce8e00000000,\n    0xf6e9f5b600000000, 0x186dcc1700000000, 0x10ff82c600000000,\n    0xfe7bbb6700000000, 0x8df0805f00000000, 0x6374b9fe00000000,\n    0xb2bb5a3500000000, 0x5c3f639400000000, 0x2fb458ac00000000,\n    0xc130610d00000000, 0xc9a22fdc00000000, 0x2726167d00000000,\n    0x54ad2d4500000000, 0xba2914e400000000, 0x058fc13c00000000,\n    0xeb0bf89d00000000, 0x9880c3a500000000, 0x7604fa0400000000,\n    0x7e96b4d500000000, 0x90128d7400000000, 0xe399b64c00000000,\n    0x0d1d8fed00000000, 0xb8a5d94c00000000, 0x5621e0ed00000000,\n    0x25aadbd500000000, 0xcb2ee27400000000, 0xc3bcaca500000000,\n    0x2d38950400000000, 0x5eb3ae3c00000000, 0xb037979d00000000,\n    0x0f91424500000000, 0xe1157be400000000, 0x929e40dc00000000,\n    0x7c1a797d00000000, 0x748837ac00000000, 0x9a0c0e0d00000000,\n    0xe987353500000000, 0x07030c9400000000, 0xd6ccef5f00000000,\n    0x3848d6fe00000000, 0x4bc3edc600000000, 0xa547d46700000000,\n    0xadd59ab600000000, 0x4351a31700000000, 0x30da982f00000000,\n    0xde5ea18e00000000, 0x61f8745600000000, 0x8f7c4df700000000,\n    0xfcf776cf00000000, 0x12734f6e00000000, 0x1ae101bf00000000,\n    0xf465381e00000000, 0x87ee032600000000, 0x696a3a8700000000,\n    0x6477b56a00000000, 0x8af38ccb00000000, 0xf978b7f300000000,\n    0x17fc8e5200000000, 0x1f6ec08300000000, 0xf1eaf92200000000,\n    0x8261c21a00000000, 0x6ce5fbbb00000000, 0xd3432e6300000000,\n    0x3dc717c200000000, 0x4e4c2cfa00000000, 0xa0c8155b00000000,\n    0xa85a5b8a00000000, 0x46de622b00000000, 0x3555591300000000,\n    0xdbd160b200000000, 0x0a1e837900000000, 0xe49abad800000000,\n    0x971181e000000000, 0x7995b84100000000, 0x7107f69000000000,\n    0x9f83cf3100000000, 0xec08f40900000000, 0x028ccda800000000,\n    0xbd2a187000000000, 0x53ae21d100000000, 0x20251ae900000000,\n    0xcea1234800000000, 0xc6336d9900000000, 0x28b7543800000000,\n    0x5b3c6f0000000000, 0xb5b856a100000000, 0x704bb39900000000,\n    0x9ecf8a3800000000, 0xed44b10000000000, 0x03c088a100000000,\n    0x0b52c67000000000, 0xe5d6ffd100000000, 0x965dc4e900000000,\n    0x78d9fd4800000000, 0xc77f289000000000, 0x29fb113100000000,\n    0x5a702a0900000000, 0xb4f413a800000000, 0xbc665d7900000000,\n    0x52e264d800000000, 0x21695fe000000000, 0xcfed664100000000,\n    0x1e22858a00000000, 0xf0a6bc2b00000000, 0x832d871300000000,\n    0x6da9beb200000000, 0x653bf06300000000, 0x8bbfc9c200000000,\n    0xf834f2fa00000000, 0x16b0cb5b00000000, 0xa9161e8300000000,\n    0x4792272200000000, 0x34191c1a00000000, 0xda9d25bb00000000,\n    0xd20f6b6a00000000, 0x3c8b52cb00000000, 0x4f0069f300000000,\n    0xa184505200000000, 0xac99dfbf00000000, 0x421de61e00000000,\n    0x3196dd2600000000, 0xdf12e48700000000, 0xd780aa5600000000,\n    0x390493f700000000, 0x4a8fa8cf00000000, 0xa40b916e00000000,\n    0x1bad44b600000000, 0xf5297d1700000000, 0x86a2462f00000000,\n    0x68267f8e00000000, 0x60b4315f00000000, 0x8e3008fe00000000,\n    0xfdbb33c600000000, 0x133f0a6700000000, 0xc2f0e9ac00000000,\n    0x2c74d00d00000000, 0x5fffeb3500000000, 0xb17bd29400000000,\n    0xb9e99c4500000000, 0x576da5e400000000, 0x24e69edc00000000,\n    0xca62a77d00000000, 0x75c472a500000000, 0x9b404b0400000000,\n    0xe8cb703c00000000, 0x064f499d00000000, 0x0edd074c00000000,\n    0xe0593eed00000000, 0x93d205d500000000, 0x7d563c7400000000,\n    0xc8ee6ad500000000, 0x266a537400000000, 0x55e1684c00000000,\n    0xbb6551ed00000000, 0xb3f71f3c00000000, 0x5d73269d00000000,\n    0x2ef81da500000000, 0xc07c240400000000, 0x7fdaf1dc00000000,\n    0x915ec87d00000000, 0xe2d5f34500000000, 0x0c51cae400000000,\n    0x04c3843500000000, 0xea47bd9400000000, 0x99cc86ac00000000,\n    0x7748bf0d00000000, 0xa6875cc600000000, 0x4803656700000000,\n    0x3b885e5f00000000, 0xd50c67fe00000000, 0xdd9e292f00000000,\n    0x331a108e00000000, 0x40912bb600000000, 0xae15121700000000,\n    0x11b3c7cf00000000, 0xff37fe6e00000000, 0x8cbcc55600000000,\n    0x6238fcf700000000, 0x6aaab22600000000, 0x842e8b8700000000,\n    0xf7a5b0bf00000000, 0x1921891e00000000, 0x143c06f300000000,\n    0xfab83f5200000000, 0x8933046a00000000, 0x67b73dcb00000000,\n    0x6f25731a00000000, 0x81a14abb00000000, 0xf22a718300000000,\n    0x1cae482200000000, 0xa3089dfa00000000, 0x4d8ca45b00000000,\n    0x3e079f6300000000, 0xd083a6c200000000, 0xd811e81300000000,\n    0x3695d1b200000000, 0x451eea8a00000000, 0xab9ad32b00000000,\n    0x7a5530e000000000, 0x94d1094100000000, 0xe75a327900000000,\n    0x09de0bd800000000, 0x014c450900000000, 0xefc87ca800000000,\n    0x9c43479000000000, 0x72c77e3100000000, 0xcd61abe900000000,\n    0x23e5924800000000, 0x506ea97000000000, 0xbeea90d100000000,\n    0xb678de0000000000, 0x58fce7a100000000, 0x2b77dc9900000000,\n    0xc5f3e53800000000},\n   {0x0000000000000000, 0xfbf6134700000000, 0xf6ed278e00000000,\n    0x0d1b34c900000000, 0xaddd3ec700000000, 0x562b2d8000000000,\n    0x5b30194900000000, 0xa0c60a0e00000000, 0x1bbd0c5500000000,\n    0xe04b1f1200000000, 0xed502bdb00000000, 0x16a6389c00000000,\n    0xb660329200000000, 0x4d9621d500000000, 0x408d151c00000000,\n    0xbb7b065b00000000, 0x367a19aa00000000, 0xcd8c0aed00000000,\n    0xc0973e2400000000, 0x3b612d6300000000, 0x9ba7276d00000000,\n    0x6051342a00000000, 0x6d4a00e300000000, 0x96bc13a400000000,\n    0x2dc715ff00000000, 0xd63106b800000000, 0xdb2a327100000000,\n    0x20dc213600000000, 0x801a2b3800000000, 0x7bec387f00000000,\n    0x76f70cb600000000, 0x8d011ff100000000, 0x2df2438f00000000,\n    0xd60450c800000000, 0xdb1f640100000000, 0x20e9774600000000,\n    0x802f7d4800000000, 0x7bd96e0f00000000, 0x76c25ac600000000,\n    0x8d34498100000000, 0x364f4fda00000000, 0xcdb95c9d00000000,\n    0xc0a2685400000000, 0x3b547b1300000000, 0x9b92711d00000000,\n    0x6064625a00000000, 0x6d7f569300000000, 0x968945d400000000,\n    0x1b885a2500000000, 0xe07e496200000000, 0xed657dab00000000,\n    0x16936eec00000000, 0xb65564e200000000, 0x4da377a500000000,\n    0x40b8436c00000000, 0xbb4e502b00000000, 0x0035567000000000,\n    0xfbc3453700000000, 0xf6d871fe00000000, 0x0d2e62b900000000,\n    0xade868b700000000, 0x561e7bf000000000, 0x5b054f3900000000,\n    0xa0f35c7e00000000, 0x1be2f6c500000000, 0xe014e58200000000,\n    0xed0fd14b00000000, 0x16f9c20c00000000, 0xb63fc80200000000,\n    0x4dc9db4500000000, 0x40d2ef8c00000000, 0xbb24fccb00000000,\n    0x005ffa9000000000, 0xfba9e9d700000000, 0xf6b2dd1e00000000,\n    0x0d44ce5900000000, 0xad82c45700000000, 0x5674d71000000000,\n    0x5b6fe3d900000000, 0xa099f09e00000000, 0x2d98ef6f00000000,\n    0xd66efc2800000000, 0xdb75c8e100000000, 0x2083dba600000000,\n    0x8045d1a800000000, 0x7bb3c2ef00000000, 0x76a8f62600000000,\n    0x8d5ee56100000000, 0x3625e33a00000000, 0xcdd3f07d00000000,\n    0xc0c8c4b400000000, 0x3b3ed7f300000000, 0x9bf8ddfd00000000,\n    0x600eceba00000000, 0x6d15fa7300000000, 0x96e3e93400000000,\n    0x3610b54a00000000, 0xcde6a60d00000000, 0xc0fd92c400000000,\n    0x3b0b818300000000, 0x9bcd8b8d00000000, 0x603b98ca00000000,\n    0x6d20ac0300000000, 0x96d6bf4400000000, 0x2dadb91f00000000,\n    0xd65baa5800000000, 0xdb409e9100000000, 0x20b68dd600000000,\n    0x807087d800000000, 0x7b86949f00000000, 0x769da05600000000,\n    0x8d6bb31100000000, 0x006aace000000000, 0xfb9cbfa700000000,\n    0xf6878b6e00000000, 0x0d71982900000000, 0xadb7922700000000,\n    0x5641816000000000, 0x5b5ab5a900000000, 0xa0aca6ee00000000,\n    0x1bd7a0b500000000, 0xe021b3f200000000, 0xed3a873b00000000,\n    0x16cc947c00000000, 0xb60a9e7200000000, 0x4dfc8d3500000000,\n    0x40e7b9fc00000000, 0xbb11aabb00000000, 0x77c29c5000000000,\n    0x8c348f1700000000, 0x812fbbde00000000, 0x7ad9a89900000000,\n    0xda1fa29700000000, 0x21e9b1d000000000, 0x2cf2851900000000,\n    0xd704965e00000000, 0x6c7f900500000000, 0x9789834200000000,\n    0x9a92b78b00000000, 0x6164a4cc00000000, 0xc1a2aec200000000,\n    0x3a54bd8500000000, 0x374f894c00000000, 0xccb99a0b00000000,\n    0x41b885fa00000000, 0xba4e96bd00000000, 0xb755a27400000000,\n    0x4ca3b13300000000, 0xec65bb3d00000000, 0x1793a87a00000000,\n    0x1a889cb300000000, 0xe17e8ff400000000, 0x5a0589af00000000,\n    0xa1f39ae800000000, 0xace8ae2100000000, 0x571ebd6600000000,\n    0xf7d8b76800000000, 0x0c2ea42f00000000, 0x013590e600000000,\n    0xfac383a100000000, 0x5a30dfdf00000000, 0xa1c6cc9800000000,\n    0xacddf85100000000, 0x572beb1600000000, 0xf7ede11800000000,\n    0x0c1bf25f00000000, 0x0100c69600000000, 0xfaf6d5d100000000,\n    0x418dd38a00000000, 0xba7bc0cd00000000, 0xb760f40400000000,\n    0x4c96e74300000000, 0xec50ed4d00000000, 0x17a6fe0a00000000,\n    0x1abdcac300000000, 0xe14bd98400000000, 0x6c4ac67500000000,\n    0x97bcd53200000000, 0x9aa7e1fb00000000, 0x6151f2bc00000000,\n    0xc197f8b200000000, 0x3a61ebf500000000, 0x377adf3c00000000,\n    0xcc8ccc7b00000000, 0x77f7ca2000000000, 0x8c01d96700000000,\n    0x811aedae00000000, 0x7aecfee900000000, 0xda2af4e700000000,\n    0x21dce7a000000000, 0x2cc7d36900000000, 0xd731c02e00000000,\n    0x6c206a9500000000, 0x97d679d200000000, 0x9acd4d1b00000000,\n    0x613b5e5c00000000, 0xc1fd545200000000, 0x3a0b471500000000,\n    0x371073dc00000000, 0xcce6609b00000000, 0x779d66c000000000,\n    0x8c6b758700000000, 0x8170414e00000000, 0x7a86520900000000,\n    0xda40580700000000, 0x21b64b4000000000, 0x2cad7f8900000000,\n    0xd75b6cce00000000, 0x5a5a733f00000000, 0xa1ac607800000000,\n    0xacb754b100000000, 0x574147f600000000, 0xf7874df800000000,\n    0x0c715ebf00000000, 0x016a6a7600000000, 0xfa9c793100000000,\n    0x41e77f6a00000000, 0xba116c2d00000000, 0xb70a58e400000000,\n    0x4cfc4ba300000000, 0xec3a41ad00000000, 0x17cc52ea00000000,\n    0x1ad7662300000000, 0xe121756400000000, 0x41d2291a00000000,\n    0xba243a5d00000000, 0xb73f0e9400000000, 0x4cc91dd300000000,\n    0xec0f17dd00000000, 0x17f9049a00000000, 0x1ae2305300000000,\n    0xe114231400000000, 0x5a6f254f00000000, 0xa199360800000000,\n    0xac8202c100000000, 0x5774118600000000, 0xf7b21b8800000000,\n    0x0c4408cf00000000, 0x015f3c0600000000, 0xfaa92f4100000000,\n    0x77a830b000000000, 0x8c5e23f700000000, 0x8145173e00000000,\n    0x7ab3047900000000, 0xda750e7700000000, 0x21831d3000000000,\n    0x2c9829f900000000, 0xd76e3abe00000000, 0x6c153ce500000000,\n    0x97e32fa200000000, 0x9af81b6b00000000, 0x610e082c00000000,\n    0xc1c8022200000000, 0x3a3e116500000000, 0x372525ac00000000,\n    0xccd336eb00000000},\n   {0x0000000000000000, 0x6238282a00000000, 0xc470505400000000,\n    0xa648787e00000000, 0x88e1a0a800000000, 0xead9888200000000,\n    0x4c91f0fc00000000, 0x2ea9d8d600000000, 0x51c5308a00000000,\n    0x33fd18a000000000, 0x95b560de00000000, 0xf78d48f400000000,\n    0xd924902200000000, 0xbb1cb80800000000, 0x1d54c07600000000,\n    0x7f6ce85c00000000, 0xe38c10cf00000000, 0x81b438e500000000,\n    0x27fc409b00000000, 0x45c468b100000000, 0x6b6db06700000000,\n    0x0955984d00000000, 0xaf1de03300000000, 0xcd25c81900000000,\n    0xb249204500000000, 0xd071086f00000000, 0x7639701100000000,\n    0x1401583b00000000, 0x3aa880ed00000000, 0x5890a8c700000000,\n    0xfed8d0b900000000, 0x9ce0f89300000000, 0x871f504500000000,\n    0xe527786f00000000, 0x436f001100000000, 0x2157283b00000000,\n    0x0ffef0ed00000000, 0x6dc6d8c700000000, 0xcb8ea0b900000000,\n    0xa9b6889300000000, 0xd6da60cf00000000, 0xb4e248e500000000,\n    0x12aa309b00000000, 0x709218b100000000, 0x5e3bc06700000000,\n    0x3c03e84d00000000, 0x9a4b903300000000, 0xf873b81900000000,\n    0x6493408a00000000, 0x06ab68a000000000, 0xa0e310de00000000,\n    0xc2db38f400000000, 0xec72e02200000000, 0x8e4ac80800000000,\n    0x2802b07600000000, 0x4a3a985c00000000, 0x3556700000000000,\n    0x576e582a00000000, 0xf126205400000000, 0x931e087e00000000,\n    0xbdb7d0a800000000, 0xdf8ff88200000000, 0x79c780fc00000000,\n    0x1bffa8d600000000, 0x0e3fa08a00000000, 0x6c0788a000000000,\n    0xca4ff0de00000000, 0xa877d8f400000000, 0x86de002200000000,\n    0xe4e6280800000000, 0x42ae507600000000, 0x2096785c00000000,\n    0x5ffa900000000000, 0x3dc2b82a00000000, 0x9b8ac05400000000,\n    0xf9b2e87e00000000, 0xd71b30a800000000, 0xb523188200000000,\n    0x136b60fc00000000, 0x715348d600000000, 0xedb3b04500000000,\n    0x8f8b986f00000000, 0x29c3e01100000000, 0x4bfbc83b00000000,\n    0x655210ed00000000, 0x076a38c700000000, 0xa12240b900000000,\n    0xc31a689300000000, 0xbc7680cf00000000, 0xde4ea8e500000000,\n    0x7806d09b00000000, 0x1a3ef8b100000000, 0x3497206700000000,\n    0x56af084d00000000, 0xf0e7703300000000, 0x92df581900000000,\n    0x8920f0cf00000000, 0xeb18d8e500000000, 0x4d50a09b00000000,\n    0x2f6888b100000000, 0x01c1506700000000, 0x63f9784d00000000,\n    0xc5b1003300000000, 0xa789281900000000, 0xd8e5c04500000000,\n    0xbadde86f00000000, 0x1c95901100000000, 0x7eadb83b00000000,\n    0x500460ed00000000, 0x323c48c700000000, 0x947430b900000000,\n    0xf64c189300000000, 0x6aace00000000000, 0x0894c82a00000000,\n    0xaedcb05400000000, 0xcce4987e00000000, 0xe24d40a800000000,\n    0x8075688200000000, 0x263d10fc00000000, 0x440538d600000000,\n    0x3b69d08a00000000, 0x5951f8a000000000, 0xff1980de00000000,\n    0x9d21a8f400000000, 0xb388702200000000, 0xd1b0580800000000,\n    0x77f8207600000000, 0x15c0085c00000000, 0x5d7831ce00000000,\n    0x3f4019e400000000, 0x9908619a00000000, 0xfb3049b000000000,\n    0xd599916600000000, 0xb7a1b94c00000000, 0x11e9c13200000000,\n    0x73d1e91800000000, 0x0cbd014400000000, 0x6e85296e00000000,\n    0xc8cd511000000000, 0xaaf5793a00000000, 0x845ca1ec00000000,\n    0xe66489c600000000, 0x402cf1b800000000, 0x2214d99200000000,\n    0xbef4210100000000, 0xdccc092b00000000, 0x7a84715500000000,\n    0x18bc597f00000000, 0x361581a900000000, 0x542da98300000000,\n    0xf265d1fd00000000, 0x905df9d700000000, 0xef31118b00000000,\n    0x8d0939a100000000, 0x2b4141df00000000, 0x497969f500000000,\n    0x67d0b12300000000, 0x05e8990900000000, 0xa3a0e17700000000,\n    0xc198c95d00000000, 0xda67618b00000000, 0xb85f49a100000000,\n    0x1e1731df00000000, 0x7c2f19f500000000, 0x5286c12300000000,\n    0x30bee90900000000, 0x96f6917700000000, 0xf4ceb95d00000000,\n    0x8ba2510100000000, 0xe99a792b00000000, 0x4fd2015500000000,\n    0x2dea297f00000000, 0x0343f1a900000000, 0x617bd98300000000,\n    0xc733a1fd00000000, 0xa50b89d700000000, 0x39eb714400000000,\n    0x5bd3596e00000000, 0xfd9b211000000000, 0x9fa3093a00000000,\n    0xb10ad1ec00000000, 0xd332f9c600000000, 0x757a81b800000000,\n    0x1742a99200000000, 0x682e41ce00000000, 0x0a1669e400000000,\n    0xac5e119a00000000, 0xce6639b000000000, 0xe0cfe16600000000,\n    0x82f7c94c00000000, 0x24bfb13200000000, 0x4687991800000000,\n    0x5347914400000000, 0x317fb96e00000000, 0x9737c11000000000,\n    0xf50fe93a00000000, 0xdba631ec00000000, 0xb99e19c600000000,\n    0x1fd661b800000000, 0x7dee499200000000, 0x0282a1ce00000000,\n    0x60ba89e400000000, 0xc6f2f19a00000000, 0xa4cad9b000000000,\n    0x8a63016600000000, 0xe85b294c00000000, 0x4e13513200000000,\n    0x2c2b791800000000, 0xb0cb818b00000000, 0xd2f3a9a100000000,\n    0x74bbd1df00000000, 0x1683f9f500000000, 0x382a212300000000,\n    0x5a12090900000000, 0xfc5a717700000000, 0x9e62595d00000000,\n    0xe10eb10100000000, 0x8336992b00000000, 0x257ee15500000000,\n    0x4746c97f00000000, 0x69ef11a900000000, 0x0bd7398300000000,\n    0xad9f41fd00000000, 0xcfa769d700000000, 0xd458c10100000000,\n    0xb660e92b00000000, 0x1028915500000000, 0x7210b97f00000000,\n    0x5cb961a900000000, 0x3e81498300000000, 0x98c931fd00000000,\n    0xfaf119d700000000, 0x859df18b00000000, 0xe7a5d9a100000000,\n    0x41eda1df00000000, 0x23d589f500000000, 0x0d7c512300000000,\n    0x6f44790900000000, 0xc90c017700000000, 0xab34295d00000000,\n    0x37d4d1ce00000000, 0x55ecf9e400000000, 0xf3a4819a00000000,\n    0x919ca9b000000000, 0xbf35716600000000, 0xdd0d594c00000000,\n    0x7b45213200000000, 0x197d091800000000, 0x6611e14400000000,\n    0x0429c96e00000000, 0xa261b11000000000, 0xc059993a00000000,\n    0xeef041ec00000000, 0x8cc869c600000000, 0x2a8011b800000000,\n    0x48b8399200000000},\n   {0x0000000000000000, 0x4c2896a300000000, 0xd9565d9c00000000,\n    0x957ecb3f00000000, 0xf3abcbe300000000, 0xbf835d4000000000,\n    0x2afd967f00000000, 0x66d500dc00000000, 0xa751e61c00000000,\n    0xeb7970bf00000000, 0x7e07bb8000000000, 0x322f2d2300000000,\n    0x54fa2dff00000000, 0x18d2bb5c00000000, 0x8dac706300000000,\n    0xc184e6c000000000, 0x4ea3cc3900000000, 0x028b5a9a00000000,\n    0x97f591a500000000, 0xdbdd070600000000, 0xbd0807da00000000,\n    0xf120917900000000, 0x645e5a4600000000, 0x2876cce500000000,\n    0xe9f22a2500000000, 0xa5dabc8600000000, 0x30a477b900000000,\n    0x7c8ce11a00000000, 0x1a59e1c600000000, 0x5671776500000000,\n    0xc30fbc5a00000000, 0x8f272af900000000, 0x9c46997300000000,\n    0xd06e0fd000000000, 0x4510c4ef00000000, 0x0938524c00000000,\n    0x6fed529000000000, 0x23c5c43300000000, 0xb6bb0f0c00000000,\n    0xfa9399af00000000, 0x3b177f6f00000000, 0x773fe9cc00000000,\n    0xe24122f300000000, 0xae69b45000000000, 0xc8bcb48c00000000,\n    0x8494222f00000000, 0x11eae91000000000, 0x5dc27fb300000000,\n    0xd2e5554a00000000, 0x9ecdc3e900000000, 0x0bb308d600000000,\n    0x479b9e7500000000, 0x214e9ea900000000, 0x6d66080a00000000,\n    0xf818c33500000000, 0xb430559600000000, 0x75b4b35600000000,\n    0x399c25f500000000, 0xace2eeca00000000, 0xe0ca786900000000,\n    0x861f78b500000000, 0xca37ee1600000000, 0x5f49252900000000,\n    0x1361b38a00000000, 0x388d32e700000000, 0x74a5a44400000000,\n    0xe1db6f7b00000000, 0xadf3f9d800000000, 0xcb26f90400000000,\n    0x870e6fa700000000, 0x1270a49800000000, 0x5e58323b00000000,\n    0x9fdcd4fb00000000, 0xd3f4425800000000, 0x468a896700000000,\n    0x0aa21fc400000000, 0x6c771f1800000000, 0x205f89bb00000000,\n    0xb521428400000000, 0xf909d42700000000, 0x762efede00000000,\n    0x3a06687d00000000, 0xaf78a34200000000, 0xe35035e100000000,\n    0x8585353d00000000, 0xc9ada39e00000000, 0x5cd368a100000000,\n    0x10fbfe0200000000, 0xd17f18c200000000, 0x9d578e6100000000,\n    0x0829455e00000000, 0x4401d3fd00000000, 0x22d4d32100000000,\n    0x6efc458200000000, 0xfb828ebd00000000, 0xb7aa181e00000000,\n    0xa4cbab9400000000, 0xe8e33d3700000000, 0x7d9df60800000000,\n    0x31b560ab00000000, 0x5760607700000000, 0x1b48f6d400000000,\n    0x8e363deb00000000, 0xc21eab4800000000, 0x039a4d8800000000,\n    0x4fb2db2b00000000, 0xdacc101400000000, 0x96e486b700000000,\n    0xf031866b00000000, 0xbc1910c800000000, 0x2967dbf700000000,\n    0x654f4d5400000000, 0xea6867ad00000000, 0xa640f10e00000000,\n    0x333e3a3100000000, 0x7f16ac9200000000, 0x19c3ac4e00000000,\n    0x55eb3aed00000000, 0xc095f1d200000000, 0x8cbd677100000000,\n    0x4d3981b100000000, 0x0111171200000000, 0x946fdc2d00000000,\n    0xd8474a8e00000000, 0xbe924a5200000000, 0xf2badcf100000000,\n    0x67c417ce00000000, 0x2bec816d00000000, 0x311c141500000000,\n    0x7d3482b600000000, 0xe84a498900000000, 0xa462df2a00000000,\n    0xc2b7dff600000000, 0x8e9f495500000000, 0x1be1826a00000000,\n    0x57c914c900000000, 0x964df20900000000, 0xda6564aa00000000,\n    0x4f1baf9500000000, 0x0333393600000000, 0x65e639ea00000000,\n    0x29ceaf4900000000, 0xbcb0647600000000, 0xf098f2d500000000,\n    0x7fbfd82c00000000, 0x33974e8f00000000, 0xa6e985b000000000,\n    0xeac1131300000000, 0x8c1413cf00000000, 0xc03c856c00000000,\n    0x55424e5300000000, 0x196ad8f000000000, 0xd8ee3e3000000000,\n    0x94c6a89300000000, 0x01b863ac00000000, 0x4d90f50f00000000,\n    0x2b45f5d300000000, 0x676d637000000000, 0xf213a84f00000000,\n    0xbe3b3eec00000000, 0xad5a8d6600000000, 0xe1721bc500000000,\n    0x740cd0fa00000000, 0x3824465900000000, 0x5ef1468500000000,\n    0x12d9d02600000000, 0x87a71b1900000000, 0xcb8f8dba00000000,\n    0x0a0b6b7a00000000, 0x4623fdd900000000, 0xd35d36e600000000,\n    0x9f75a04500000000, 0xf9a0a09900000000, 0xb588363a00000000,\n    0x20f6fd0500000000, 0x6cde6ba600000000, 0xe3f9415f00000000,\n    0xafd1d7fc00000000, 0x3aaf1cc300000000, 0x76878a6000000000,\n    0x10528abc00000000, 0x5c7a1c1f00000000, 0xc904d72000000000,\n    0x852c418300000000, 0x44a8a74300000000, 0x088031e000000000,\n    0x9dfefadf00000000, 0xd1d66c7c00000000, 0xb7036ca000000000,\n    0xfb2bfa0300000000, 0x6e55313c00000000, 0x227da79f00000000,\n    0x099126f200000000, 0x45b9b05100000000, 0xd0c77b6e00000000,\n    0x9cefedcd00000000, 0xfa3aed1100000000, 0xb6127bb200000000,\n    0x236cb08d00000000, 0x6f44262e00000000, 0xaec0c0ee00000000,\n    0xe2e8564d00000000, 0x77969d7200000000, 0x3bbe0bd100000000,\n    0x5d6b0b0d00000000, 0x11439dae00000000, 0x843d569100000000,\n    0xc815c03200000000, 0x4732eacb00000000, 0x0b1a7c6800000000,\n    0x9e64b75700000000, 0xd24c21f400000000, 0xb499212800000000,\n    0xf8b1b78b00000000, 0x6dcf7cb400000000, 0x21e7ea1700000000,\n    0xe0630cd700000000, 0xac4b9a7400000000, 0x3935514b00000000,\n    0x751dc7e800000000, 0x13c8c73400000000, 0x5fe0519700000000,\n    0xca9e9aa800000000, 0x86b60c0b00000000, 0x95d7bf8100000000,\n    0xd9ff292200000000, 0x4c81e21d00000000, 0x00a974be00000000,\n    0x667c746200000000, 0x2a54e2c100000000, 0xbf2a29fe00000000,\n    0xf302bf5d00000000, 0x3286599d00000000, 0x7eaecf3e00000000,\n    0xebd0040100000000, 0xa7f892a200000000, 0xc12d927e00000000,\n    0x8d0504dd00000000, 0x187bcfe200000000, 0x5453594100000000,\n    0xdb7473b800000000, 0x975ce51b00000000, 0x02222e2400000000,\n    0x4e0ab88700000000, 0x28dfb85b00000000, 0x64f72ef800000000,\n    0xf189e5c700000000, 0xbda1736400000000, 0x7c2595a400000000,\n    0x300d030700000000, 0xa573c83800000000, 0xe95b5e9b00000000,\n    0x8f8e5e4700000000, 0xc3a6c8e400000000, 0x56d803db00000000,\n    0x1af0957800000000},\n   {0x0000000000000000, 0x939bc97f00000000, 0x263793ff00000000,\n    0xb5ac5a8000000000, 0x0d68572400000000, 0x9ef39e5b00000000,\n    0x2b5fc4db00000000, 0xb8c40da400000000, 0x1ad0ae4800000000,\n    0x894b673700000000, 0x3ce73db700000000, 0xaf7cf4c800000000,\n    0x17b8f96c00000000, 0x8423301300000000, 0x318f6a9300000000,\n    0xa214a3ec00000000, 0x34a05d9100000000, 0xa73b94ee00000000,\n    0x1297ce6e00000000, 0x810c071100000000, 0x39c80ab500000000,\n    0xaa53c3ca00000000, 0x1fff994a00000000, 0x8c64503500000000,\n    0x2e70f3d900000000, 0xbdeb3aa600000000, 0x0847602600000000,\n    0x9bdca95900000000, 0x2318a4fd00000000, 0xb0836d8200000000,\n    0x052f370200000000, 0x96b4fe7d00000000, 0x2946caf900000000,\n    0xbadd038600000000, 0x0f71590600000000, 0x9cea907900000000,\n    0x242e9ddd00000000, 0xb7b554a200000000, 0x02190e2200000000,\n    0x9182c75d00000000, 0x339664b100000000, 0xa00dadce00000000,\n    0x15a1f74e00000000, 0x863a3e3100000000, 0x3efe339500000000,\n    0xad65faea00000000, 0x18c9a06a00000000, 0x8b52691500000000,\n    0x1de6976800000000, 0x8e7d5e1700000000, 0x3bd1049700000000,\n    0xa84acde800000000, 0x108ec04c00000000, 0x8315093300000000,\n    0x36b953b300000000, 0xa5229acc00000000, 0x0736392000000000,\n    0x94adf05f00000000, 0x2101aadf00000000, 0xb29a63a000000000,\n    0x0a5e6e0400000000, 0x99c5a77b00000000, 0x2c69fdfb00000000,\n    0xbff2348400000000, 0x138ae52800000000, 0x80112c5700000000,\n    0x35bd76d700000000, 0xa626bfa800000000, 0x1ee2b20c00000000,\n    0x8d797b7300000000, 0x38d521f300000000, 0xab4ee88c00000000,\n    0x095a4b6000000000, 0x9ac1821f00000000, 0x2f6dd89f00000000,\n    0xbcf611e000000000, 0x04321c4400000000, 0x97a9d53b00000000,\n    0x22058fbb00000000, 0xb19e46c400000000, 0x272ab8b900000000,\n    0xb4b171c600000000, 0x011d2b4600000000, 0x9286e23900000000,\n    0x2a42ef9d00000000, 0xb9d926e200000000, 0x0c757c6200000000,\n    0x9feeb51d00000000, 0x3dfa16f100000000, 0xae61df8e00000000,\n    0x1bcd850e00000000, 0x88564c7100000000, 0x309241d500000000,\n    0xa30988aa00000000, 0x16a5d22a00000000, 0x853e1b5500000000,\n    0x3acc2fd100000000, 0xa957e6ae00000000, 0x1cfbbc2e00000000,\n    0x8f60755100000000, 0x37a478f500000000, 0xa43fb18a00000000,\n    0x1193eb0a00000000, 0x8208227500000000, 0x201c819900000000,\n    0xb38748e600000000, 0x062b126600000000, 0x95b0db1900000000,\n    0x2d74d6bd00000000, 0xbeef1fc200000000, 0x0b43454200000000,\n    0x98d88c3d00000000, 0x0e6c724000000000, 0x9df7bb3f00000000,\n    0x285be1bf00000000, 0xbbc028c000000000, 0x0304256400000000,\n    0x909fec1b00000000, 0x2533b69b00000000, 0xb6a87fe400000000,\n    0x14bcdc0800000000, 0x8727157700000000, 0x328b4ff700000000,\n    0xa110868800000000, 0x19d48b2c00000000, 0x8a4f425300000000,\n    0x3fe318d300000000, 0xac78d1ac00000000, 0x2614cb5100000000,\n    0xb58f022e00000000, 0x002358ae00000000, 0x93b891d100000000,\n    0x2b7c9c7500000000, 0xb8e7550a00000000, 0x0d4b0f8a00000000,\n    0x9ed0c6f500000000, 0x3cc4651900000000, 0xaf5fac6600000000,\n    0x1af3f6e600000000, 0x89683f9900000000, 0x31ac323d00000000,\n    0xa237fb4200000000, 0x179ba1c200000000, 0x840068bd00000000,\n    0x12b496c000000000, 0x812f5fbf00000000, 0x3483053f00000000,\n    0xa718cc4000000000, 0x1fdcc1e400000000, 0x8c47089b00000000,\n    0x39eb521b00000000, 0xaa709b6400000000, 0x0864388800000000,\n    0x9bfff1f700000000, 0x2e53ab7700000000, 0xbdc8620800000000,\n    0x050c6fac00000000, 0x9697a6d300000000, 0x233bfc5300000000,\n    0xb0a0352c00000000, 0x0f5201a800000000, 0x9cc9c8d700000000,\n    0x2965925700000000, 0xbafe5b2800000000, 0x023a568c00000000,\n    0x91a19ff300000000, 0x240dc57300000000, 0xb7960c0c00000000,\n    0x1582afe000000000, 0x8619669f00000000, 0x33b53c1f00000000,\n    0xa02ef56000000000, 0x18eaf8c400000000, 0x8b7131bb00000000,\n    0x3edd6b3b00000000, 0xad46a24400000000, 0x3bf25c3900000000,\n    0xa869954600000000, 0x1dc5cfc600000000, 0x8e5e06b900000000,\n    0x369a0b1d00000000, 0xa501c26200000000, 0x10ad98e200000000,\n    0x8336519d00000000, 0x2122f27100000000, 0xb2b93b0e00000000,\n    0x0715618e00000000, 0x948ea8f100000000, 0x2c4aa55500000000,\n    0xbfd16c2a00000000, 0x0a7d36aa00000000, 0x99e6ffd500000000,\n    0x359e2e7900000000, 0xa605e70600000000, 0x13a9bd8600000000,\n    0x803274f900000000, 0x38f6795d00000000, 0xab6db02200000000,\n    0x1ec1eaa200000000, 0x8d5a23dd00000000, 0x2f4e803100000000,\n    0xbcd5494e00000000, 0x097913ce00000000, 0x9ae2dab100000000,\n    0x2226d71500000000, 0xb1bd1e6a00000000, 0x041144ea00000000,\n    0x978a8d9500000000, 0x013e73e800000000, 0x92a5ba9700000000,\n    0x2709e01700000000, 0xb492296800000000, 0x0c5624cc00000000,\n    0x9fcdedb300000000, 0x2a61b73300000000, 0xb9fa7e4c00000000,\n    0x1beedda000000000, 0x887514df00000000, 0x3dd94e5f00000000,\n    0xae42872000000000, 0x16868a8400000000, 0x851d43fb00000000,\n    0x30b1197b00000000, 0xa32ad00400000000, 0x1cd8e48000000000,\n    0x8f432dff00000000, 0x3aef777f00000000, 0xa974be0000000000,\n    0x11b0b3a400000000, 0x822b7adb00000000, 0x3787205b00000000,\n    0xa41ce92400000000, 0x06084ac800000000, 0x959383b700000000,\n    0x203fd93700000000, 0xb3a4104800000000, 0x0b601dec00000000,\n    0x98fbd49300000000, 0x2d578e1300000000, 0xbecc476c00000000,\n    0x2878b91100000000, 0xbbe3706e00000000, 0x0e4f2aee00000000,\n    0x9dd4e39100000000, 0x2510ee3500000000, 0xb68b274a00000000,\n    0x03277dca00000000, 0x90bcb4b500000000, 0x32a8175900000000,\n    0xa133de2600000000, 0x149f84a600000000, 0x87044dd900000000,\n    0x3fc0407d00000000, 0xac5b890200000000, 0x19f7d38200000000,\n    0x8a6c1afd00000000},\n   {0x0000000000000000, 0x650b796900000000, 0xca16f2d200000000,\n    0xaf1d8bbb00000000, 0xd52b957e00000000, 0xb020ec1700000000,\n    0x1f3d67ac00000000, 0x7a361ec500000000, 0xaa572afd00000000,\n    0xcf5c539400000000, 0x6041d82f00000000, 0x054aa14600000000,\n    0x7f7cbf8300000000, 0x1a77c6ea00000000, 0xb56a4d5100000000,\n    0xd061343800000000, 0x15a9252100000000, 0x70a25c4800000000,\n    0xdfbfd7f300000000, 0xbab4ae9a00000000, 0xc082b05f00000000,\n    0xa589c93600000000, 0x0a94428d00000000, 0x6f9f3be400000000,\n    0xbffe0fdc00000000, 0xdaf576b500000000, 0x75e8fd0e00000000,\n    0x10e3846700000000, 0x6ad59aa200000000, 0x0fdee3cb00000000,\n    0xa0c3687000000000, 0xc5c8111900000000, 0x2a524b4200000000,\n    0x4f59322b00000000, 0xe044b99000000000, 0x854fc0f900000000,\n    0xff79de3c00000000, 0x9a72a75500000000, 0x356f2cee00000000,\n    0x5064558700000000, 0x800561bf00000000, 0xe50e18d600000000,\n    0x4a13936d00000000, 0x2f18ea0400000000, 0x552ef4c100000000,\n    0x30258da800000000, 0x9f38061300000000, 0xfa337f7a00000000,\n    0x3ffb6e6300000000, 0x5af0170a00000000, 0xf5ed9cb100000000,\n    0x90e6e5d800000000, 0xead0fb1d00000000, 0x8fdb827400000000,\n    0x20c609cf00000000, 0x45cd70a600000000, 0x95ac449e00000000,\n    0xf0a73df700000000, 0x5fbab64c00000000, 0x3ab1cf2500000000,\n    0x4087d1e000000000, 0x258ca88900000000, 0x8a91233200000000,\n    0xef9a5a5b00000000, 0x54a4968400000000, 0x31afefed00000000,\n    0x9eb2645600000000, 0xfbb91d3f00000000, 0x818f03fa00000000,\n    0xe4847a9300000000, 0x4b99f12800000000, 0x2e92884100000000,\n    0xfef3bc7900000000, 0x9bf8c51000000000, 0x34e54eab00000000,\n    0x51ee37c200000000, 0x2bd8290700000000, 0x4ed3506e00000000,\n    0xe1cedbd500000000, 0x84c5a2bc00000000, 0x410db3a500000000,\n    0x2406cacc00000000, 0x8b1b417700000000, 0xee10381e00000000,\n    0x942626db00000000, 0xf12d5fb200000000, 0x5e30d40900000000,\n    0x3b3bad6000000000, 0xeb5a995800000000, 0x8e51e03100000000,\n    0x214c6b8a00000000, 0x444712e300000000, 0x3e710c2600000000,\n    0x5b7a754f00000000, 0xf467fef400000000, 0x916c879d00000000,\n    0x7ef6ddc600000000, 0x1bfda4af00000000, 0xb4e02f1400000000,\n    0xd1eb567d00000000, 0xabdd48b800000000, 0xced631d100000000,\n    0x61cbba6a00000000, 0x04c0c30300000000, 0xd4a1f73b00000000,\n    0xb1aa8e5200000000, 0x1eb705e900000000, 0x7bbc7c8000000000,\n    0x018a624500000000, 0x64811b2c00000000, 0xcb9c909700000000,\n    0xae97e9fe00000000, 0x6b5ff8e700000000, 0x0e54818e00000000,\n    0xa1490a3500000000, 0xc442735c00000000, 0xbe746d9900000000,\n    0xdb7f14f000000000, 0x74629f4b00000000, 0x1169e62200000000,\n    0xc108d21a00000000, 0xa403ab7300000000, 0x0b1e20c800000000,\n    0x6e1559a100000000, 0x1423476400000000, 0x71283e0d00000000,\n    0xde35b5b600000000, 0xbb3eccdf00000000, 0xe94e5cd200000000,\n    0x8c4525bb00000000, 0x2358ae0000000000, 0x4653d76900000000,\n    0x3c65c9ac00000000, 0x596eb0c500000000, 0xf6733b7e00000000,\n    0x9378421700000000, 0x4319762f00000000, 0x26120f4600000000,\n    0x890f84fd00000000, 0xec04fd9400000000, 0x9632e35100000000,\n    0xf3399a3800000000, 0x5c24118300000000, 0x392f68ea00000000,\n    0xfce779f300000000, 0x99ec009a00000000, 0x36f18b2100000000,\n    0x53faf24800000000, 0x29ccec8d00000000, 0x4cc795e400000000,\n    0xe3da1e5f00000000, 0x86d1673600000000, 0x56b0530e00000000,\n    0x33bb2a6700000000, 0x9ca6a1dc00000000, 0xf9add8b500000000,\n    0x839bc67000000000, 0xe690bf1900000000, 0x498d34a200000000,\n    0x2c864dcb00000000, 0xc31c179000000000, 0xa6176ef900000000,\n    0x090ae54200000000, 0x6c019c2b00000000, 0x163782ee00000000,\n    0x733cfb8700000000, 0xdc21703c00000000, 0xb92a095500000000,\n    0x694b3d6d00000000, 0x0c40440400000000, 0xa35dcfbf00000000,\n    0xc656b6d600000000, 0xbc60a81300000000, 0xd96bd17a00000000,\n    0x76765ac100000000, 0x137d23a800000000, 0xd6b532b100000000,\n    0xb3be4bd800000000, 0x1ca3c06300000000, 0x79a8b90a00000000,\n    0x039ea7cf00000000, 0x6695dea600000000, 0xc988551d00000000,\n    0xac832c7400000000, 0x7ce2184c00000000, 0x19e9612500000000,\n    0xb6f4ea9e00000000, 0xd3ff93f700000000, 0xa9c98d3200000000,\n    0xccc2f45b00000000, 0x63df7fe000000000, 0x06d4068900000000,\n    0xbdeaca5600000000, 0xd8e1b33f00000000, 0x77fc388400000000,\n    0x12f741ed00000000, 0x68c15f2800000000, 0x0dca264100000000,\n    0xa2d7adfa00000000, 0xc7dcd49300000000, 0x17bde0ab00000000,\n    0x72b699c200000000, 0xddab127900000000, 0xb8a06b1000000000,\n    0xc29675d500000000, 0xa79d0cbc00000000, 0x0880870700000000,\n    0x6d8bfe6e00000000, 0xa843ef7700000000, 0xcd48961e00000000,\n    0x62551da500000000, 0x075e64cc00000000, 0x7d687a0900000000,\n    0x1863036000000000, 0xb77e88db00000000, 0xd275f1b200000000,\n    0x0214c58a00000000, 0x671fbce300000000, 0xc802375800000000,\n    0xad094e3100000000, 0xd73f50f400000000, 0xb234299d00000000,\n    0x1d29a22600000000, 0x7822db4f00000000, 0x97b8811400000000,\n    0xf2b3f87d00000000, 0x5dae73c600000000, 0x38a50aaf00000000,\n    0x4293146a00000000, 0x27986d0300000000, 0x8885e6b800000000,\n    0xed8e9fd100000000, 0x3defabe900000000, 0x58e4d28000000000,\n    0xf7f9593b00000000, 0x92f2205200000000, 0xe8c43e9700000000,\n    0x8dcf47fe00000000, 0x22d2cc4500000000, 0x47d9b52c00000000,\n    0x8211a43500000000, 0xe71add5c00000000, 0x480756e700000000,\n    0x2d0c2f8e00000000, 0x573a314b00000000, 0x3231482200000000,\n    0x9d2cc39900000000, 0xf827baf000000000, 0x28468ec800000000,\n    0x4d4df7a100000000, 0xe2507c1a00000000, 0x875b057300000000,\n    0xfd6d1bb600000000, 0x986662df00000000, 0x377be96400000000,\n    0x5270900d00000000},\n   {0x0000000000000000, 0xdcecb13d00000000, 0xb8d9637b00000000,\n    0x6435d24600000000, 0x70b3c7f600000000, 0xac5f76cb00000000,\n    0xc86aa48d00000000, 0x148615b000000000, 0xa160fe3600000000,\n    0x7d8c4f0b00000000, 0x19b99d4d00000000, 0xc5552c7000000000,\n    0xd1d339c000000000, 0x0d3f88fd00000000, 0x690a5abb00000000,\n    0xb5e6eb8600000000, 0x42c1fc6d00000000, 0x9e2d4d5000000000,\n    0xfa189f1600000000, 0x26f42e2b00000000, 0x32723b9b00000000,\n    0xee9e8aa600000000, 0x8aab58e000000000, 0x5647e9dd00000000,\n    0xe3a1025b00000000, 0x3f4db36600000000, 0x5b78612000000000,\n    0x8794d01d00000000, 0x9312c5ad00000000, 0x4ffe749000000000,\n    0x2bcba6d600000000, 0xf72717eb00000000, 0x8482f9db00000000,\n    0x586e48e600000000, 0x3c5b9aa000000000, 0xe0b72b9d00000000,\n    0xf4313e2d00000000, 0x28dd8f1000000000, 0x4ce85d5600000000,\n    0x9004ec6b00000000, 0x25e207ed00000000, 0xf90eb6d000000000,\n    0x9d3b649600000000, 0x41d7d5ab00000000, 0x5551c01b00000000,\n    0x89bd712600000000, 0xed88a36000000000, 0x3164125d00000000,\n    0xc64305b600000000, 0x1aafb48b00000000, 0x7e9a66cd00000000,\n    0xa276d7f000000000, 0xb6f0c24000000000, 0x6a1c737d00000000,\n    0x0e29a13b00000000, 0xd2c5100600000000, 0x6723fb8000000000,\n    0xbbcf4abd00000000, 0xdffa98fb00000000, 0x031629c600000000,\n    0x17903c7600000000, 0xcb7c8d4b00000000, 0xaf495f0d00000000,\n    0x73a5ee3000000000, 0x4903826c00000000, 0x95ef335100000000,\n    0xf1dae11700000000, 0x2d36502a00000000, 0x39b0459a00000000,\n    0xe55cf4a700000000, 0x816926e100000000, 0x5d8597dc00000000,\n    0xe8637c5a00000000, 0x348fcd6700000000, 0x50ba1f2100000000,\n    0x8c56ae1c00000000, 0x98d0bbac00000000, 0x443c0a9100000000,\n    0x2009d8d700000000, 0xfce569ea00000000, 0x0bc27e0100000000,\n    0xd72ecf3c00000000, 0xb31b1d7a00000000, 0x6ff7ac4700000000,\n    0x7b71b9f700000000, 0xa79d08ca00000000, 0xc3a8da8c00000000,\n    0x1f446bb100000000, 0xaaa2803700000000, 0x764e310a00000000,\n    0x127be34c00000000, 0xce97527100000000, 0xda1147c100000000,\n    0x06fdf6fc00000000, 0x62c824ba00000000, 0xbe24958700000000,\n    0xcd817bb700000000, 0x116dca8a00000000, 0x755818cc00000000,\n    0xa9b4a9f100000000, 0xbd32bc4100000000, 0x61de0d7c00000000,\n    0x05ebdf3a00000000, 0xd9076e0700000000, 0x6ce1858100000000,\n    0xb00d34bc00000000, 0xd438e6fa00000000, 0x08d457c700000000,\n    0x1c52427700000000, 0xc0bef34a00000000, 0xa48b210c00000000,\n    0x7867903100000000, 0x8f4087da00000000, 0x53ac36e700000000,\n    0x3799e4a100000000, 0xeb75559c00000000, 0xfff3402c00000000,\n    0x231ff11100000000, 0x472a235700000000, 0x9bc6926a00000000,\n    0x2e2079ec00000000, 0xf2ccc8d100000000, 0x96f91a9700000000,\n    0x4a15abaa00000000, 0x5e93be1a00000000, 0x827f0f2700000000,\n    0xe64add6100000000, 0x3aa66c5c00000000, 0x920604d900000000,\n    0x4eeab5e400000000, 0x2adf67a200000000, 0xf633d69f00000000,\n    0xe2b5c32f00000000, 0x3e59721200000000, 0x5a6ca05400000000,\n    0x8680116900000000, 0x3366faef00000000, 0xef8a4bd200000000,\n    0x8bbf999400000000, 0x575328a900000000, 0x43d53d1900000000,\n    0x9f398c2400000000, 0xfb0c5e6200000000, 0x27e0ef5f00000000,\n    0xd0c7f8b400000000, 0x0c2b498900000000, 0x681e9bcf00000000,\n    0xb4f22af200000000, 0xa0743f4200000000, 0x7c988e7f00000000,\n    0x18ad5c3900000000, 0xc441ed0400000000, 0x71a7068200000000,\n    0xad4bb7bf00000000, 0xc97e65f900000000, 0x1592d4c400000000,\n    0x0114c17400000000, 0xddf8704900000000, 0xb9cda20f00000000,\n    0x6521133200000000, 0x1684fd0200000000, 0xca684c3f00000000,\n    0xae5d9e7900000000, 0x72b12f4400000000, 0x66373af400000000,\n    0xbadb8bc900000000, 0xdeee598f00000000, 0x0202e8b200000000,\n    0xb7e4033400000000, 0x6b08b20900000000, 0x0f3d604f00000000,\n    0xd3d1d17200000000, 0xc757c4c200000000, 0x1bbb75ff00000000,\n    0x7f8ea7b900000000, 0xa362168400000000, 0x5445016f00000000,\n    0x88a9b05200000000, 0xec9c621400000000, 0x3070d32900000000,\n    0x24f6c69900000000, 0xf81a77a400000000, 0x9c2fa5e200000000,\n    0x40c314df00000000, 0xf525ff5900000000, 0x29c94e6400000000,\n    0x4dfc9c2200000000, 0x91102d1f00000000, 0x859638af00000000,\n    0x597a899200000000, 0x3d4f5bd400000000, 0xe1a3eae900000000,\n    0xdb0586b500000000, 0x07e9378800000000, 0x63dce5ce00000000,\n    0xbf3054f300000000, 0xabb6414300000000, 0x775af07e00000000,\n    0x136f223800000000, 0xcf83930500000000, 0x7a65788300000000,\n    0xa689c9be00000000, 0xc2bc1bf800000000, 0x1e50aac500000000,\n    0x0ad6bf7500000000, 0xd63a0e4800000000, 0xb20fdc0e00000000,\n    0x6ee36d3300000000, 0x99c47ad800000000, 0x4528cbe500000000,\n    0x211d19a300000000, 0xfdf1a89e00000000, 0xe977bd2e00000000,\n    0x359b0c1300000000, 0x51aede5500000000, 0x8d426f6800000000,\n    0x38a484ee00000000, 0xe44835d300000000, 0x807de79500000000,\n    0x5c9156a800000000, 0x4817431800000000, 0x94fbf22500000000,\n    0xf0ce206300000000, 0x2c22915e00000000, 0x5f877f6e00000000,\n    0x836bce5300000000, 0xe75e1c1500000000, 0x3bb2ad2800000000,\n    0x2f34b89800000000, 0xf3d809a500000000, 0x97eddbe300000000,\n    0x4b016ade00000000, 0xfee7815800000000, 0x220b306500000000,\n    0x463ee22300000000, 0x9ad2531e00000000, 0x8e5446ae00000000,\n    0x52b8f79300000000, 0x368d25d500000000, 0xea6194e800000000,\n    0x1d46830300000000, 0xc1aa323e00000000, 0xa59fe07800000000,\n    0x7973514500000000, 0x6df544f500000000, 0xb119f5c800000000,\n    0xd52c278e00000000, 0x09c096b300000000, 0xbc267d3500000000,\n    0x60cacc0800000000, 0x04ff1e4e00000000, 0xd813af7300000000,\n    0xcc95bac300000000, 0x10790bfe00000000, 0x744cd9b800000000,\n    0xa8a0688500000000}};\n\n#else /* W == 4 */\n\nlocal const z_crc_t FAR crc_braid_table[][256] = {\n   {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f,\n    0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999,\n    0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee,\n    0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615,\n    0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383,\n    0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb,\n    0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275,\n    0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d,\n    0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b,\n    0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460,\n    0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317,\n    0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1,\n    0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5,\n    0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd,\n    0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04,\n    0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c,\n    0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7,\n    0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11,\n    0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66,\n    0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7,\n    0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871,\n    0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309,\n    0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd,\n    0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85,\n    0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913,\n    0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d,\n    0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a,\n    0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc,\n    0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57,\n    0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f,\n    0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6,\n    0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e,\n    0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f,\n    0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289,\n    0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe,\n    0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05,\n    0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893,\n    0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb,\n    0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0,\n    0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8,\n    0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e,\n    0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5,\n    0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2,\n    0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574,\n    0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5,\n    0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add,\n    0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114,\n    0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c,\n    0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7,\n    0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701,\n    0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076,\n    0x09cd8551},\n   {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193,\n    0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2,\n    0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c,\n    0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71,\n    0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a,\n    0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d,\n    0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71,\n    0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436,\n    0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d,\n    0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000,\n    0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae,\n    0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf,\n    0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930,\n    0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277,\n    0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff,\n    0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8,\n    0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef,\n    0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e,\n    0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20,\n    0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95,\n    0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e,\n    0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9,\n    0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d,\n    0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a,\n    0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151,\n    0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4,\n    0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a,\n    0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b,\n    0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c,\n    0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b,\n    0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3,\n    0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4,\n    0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b,\n    0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a,\n    0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4,\n    0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189,\n    0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92,\n    0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5,\n    0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9,\n    0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe,\n    0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5,\n    0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8,\n    0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66,\n    0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707,\n    0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8,\n    0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f,\n    0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707,\n    0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40,\n    0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017,\n    0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876,\n    0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8,\n    0x7bc97a0c},\n   {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300,\n    0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0,\n    0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80,\n    0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701,\n    0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41,\n    0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81,\n    0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43,\n    0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83,\n    0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3,\n    0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42,\n    0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202,\n    0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2,\n    0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7,\n    0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407,\n    0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47,\n    0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87,\n    0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86,\n    0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46,\n    0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506,\n    0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44,\n    0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704,\n    0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4,\n    0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5,\n    0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505,\n    0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45,\n    0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f,\n    0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f,\n    0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f,\n    0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e,\n    0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e,\n    0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e,\n    0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce,\n    0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c,\n    0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc,\n    0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c,\n    0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d,\n    0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d,\n    0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d,\n    0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88,\n    0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48,\n    0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708,\n    0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89,\n    0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9,\n    0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309,\n    0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb,\n    0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b,\n    0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b,\n    0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b,\n    0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a,\n    0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a,\n    0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a,\n    0x7851a2ca},\n   {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb,\n    0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8,\n    0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0,\n    0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f,\n    0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a,\n    0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf,\n    0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5,\n    0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380,\n    0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815,\n    0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa,\n    0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2,\n    0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1,\n    0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1,\n    0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4,\n    0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa,\n    0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df,\n    0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6,\n    0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5,\n    0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad,\n    0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca,\n    0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f,\n    0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a,\n    0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8,\n    0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d,\n    0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708,\n    0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d,\n    0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865,\n    0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636,\n    0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f,\n    0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a,\n    0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744,\n    0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061,\n    0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0,\n    0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293,\n    0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb,\n    0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874,\n    0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1,\n    0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4,\n    0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f,\n    0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a,\n    0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f,\n    0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120,\n    0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778,\n    0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b,\n    0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a,\n    0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af,\n    0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81,\n    0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4,\n    0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd,\n    0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e,\n    0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6,\n    0x566b6848}};\n\nlocal const z_word_t FAR crc_braid_big_table[][256] = {\n   {0x00000000, 0x9e83da9f, 0x7d01c4e4, 0xe3821e7b, 0xbb04f912,\n    0x2587238d, 0xc6053df6, 0x5886e769, 0x7609f225, 0xe88a28ba,\n    0x0b0836c1, 0x958bec5e, 0xcd0d0b37, 0x538ed1a8, 0xb00ccfd3,\n    0x2e8f154c, 0xec12e44b, 0x72913ed4, 0x911320af, 0x0f90fa30,\n    0x57161d59, 0xc995c7c6, 0x2a17d9bd, 0xb4940322, 0x9a1b166e,\n    0x0498ccf1, 0xe71ad28a, 0x79990815, 0x211fef7c, 0xbf9c35e3,\n    0x5c1e2b98, 0xc29df107, 0xd825c897, 0x46a61208, 0xa5240c73,\n    0x3ba7d6ec, 0x63213185, 0xfda2eb1a, 0x1e20f561, 0x80a32ffe,\n    0xae2c3ab2, 0x30afe02d, 0xd32dfe56, 0x4dae24c9, 0x1528c3a0,\n    0x8bab193f, 0x68290744, 0xf6aadddb, 0x34372cdc, 0xaab4f643,\n    0x4936e838, 0xd7b532a7, 0x8f33d5ce, 0x11b00f51, 0xf232112a,\n    0x6cb1cbb5, 0x423edef9, 0xdcbd0466, 0x3f3f1a1d, 0xa1bcc082,\n    0xf93a27eb, 0x67b9fd74, 0x843be30f, 0x1ab83990, 0xf14de1f4,\n    0x6fce3b6b, 0x8c4c2510, 0x12cfff8f, 0x4a4918e6, 0xd4cac279,\n    0x3748dc02, 0xa9cb069d, 0x874413d1, 0x19c7c94e, 0xfa45d735,\n    0x64c60daa, 0x3c40eac3, 0xa2c3305c, 0x41412e27, 0xdfc2f4b8,\n    0x1d5f05bf, 0x83dcdf20, 0x605ec15b, 0xfedd1bc4, 0xa65bfcad,\n    0x38d82632, 0xdb5a3849, 0x45d9e2d6, 0x6b56f79a, 0xf5d52d05,\n    0x1657337e, 0x88d4e9e1, 0xd0520e88, 0x4ed1d417, 0xad53ca6c,\n    0x33d010f3, 0x29682963, 0xb7ebf3fc, 0x5469ed87, 0xcaea3718,\n    0x926cd071, 0x0cef0aee, 0xef6d1495, 0x71eece0a, 0x5f61db46,\n    0xc1e201d9, 0x22601fa2, 0xbce3c53d, 0xe4652254, 0x7ae6f8cb,\n    0x9964e6b0, 0x07e73c2f, 0xc57acd28, 0x5bf917b7, 0xb87b09cc,\n    0x26f8d353, 0x7e7e343a, 0xe0fdeea5, 0x037ff0de, 0x9dfc2a41,\n    0xb3733f0d, 0x2df0e592, 0xce72fbe9, 0x50f12176, 0x0877c61f,\n    0x96f41c80, 0x757602fb, 0xebf5d864, 0xa39db332, 0x3d1e69ad,\n    0xde9c77d6, 0x401fad49, 0x18994a20, 0x861a90bf, 0x65988ec4,\n    0xfb1b545b, 0xd5944117, 0x4b179b88, 0xa89585f3, 0x36165f6c,\n    0x6e90b805, 0xf013629a, 0x13917ce1, 0x8d12a67e, 0x4f8f5779,\n    0xd10c8de6, 0x328e939d, 0xac0d4902, 0xf48bae6b, 0x6a0874f4,\n    0x898a6a8f, 0x1709b010, 0x3986a55c, 0xa7057fc3, 0x448761b8,\n    0xda04bb27, 0x82825c4e, 0x1c0186d1, 0xff8398aa, 0x61004235,\n    0x7bb87ba5, 0xe53ba13a, 0x06b9bf41, 0x983a65de, 0xc0bc82b7,\n    0x5e3f5828, 0xbdbd4653, 0x233e9ccc, 0x0db18980, 0x9332531f,\n    0x70b04d64, 0xee3397fb, 0xb6b57092, 0x2836aa0d, 0xcbb4b476,\n    0x55376ee9, 0x97aa9fee, 0x09294571, 0xeaab5b0a, 0x74288195,\n    0x2cae66fc, 0xb22dbc63, 0x51afa218, 0xcf2c7887, 0xe1a36dcb,\n    0x7f20b754, 0x9ca2a92f, 0x022173b0, 0x5aa794d9, 0xc4244e46,\n    0x27a6503d, 0xb9258aa2, 0x52d052c6, 0xcc538859, 0x2fd19622,\n    0xb1524cbd, 0xe9d4abd4, 0x7757714b, 0x94d56f30, 0x0a56b5af,\n    0x24d9a0e3, 0xba5a7a7c, 0x59d86407, 0xc75bbe98, 0x9fdd59f1,\n    0x015e836e, 0xe2dc9d15, 0x7c5f478a, 0xbec2b68d, 0x20416c12,\n    0xc3c37269, 0x5d40a8f6, 0x05c64f9f, 0x9b459500, 0x78c78b7b,\n    0xe64451e4, 0xc8cb44a8, 0x56489e37, 0xb5ca804c, 0x2b495ad3,\n    0x73cfbdba, 0xed4c6725, 0x0ece795e, 0x904da3c1, 0x8af59a51,\n    0x147640ce, 0xf7f45eb5, 0x6977842a, 0x31f16343, 0xaf72b9dc,\n    0x4cf0a7a7, 0xd2737d38, 0xfcfc6874, 0x627fb2eb, 0x81fdac90,\n    0x1f7e760f, 0x47f89166, 0xd97b4bf9, 0x3af95582, 0xa47a8f1d,\n    0x66e77e1a, 0xf864a485, 0x1be6bafe, 0x85656061, 0xdde38708,\n    0x43605d97, 0xa0e243ec, 0x3e619973, 0x10ee8c3f, 0x8e6d56a0,\n    0x6def48db, 0xf36c9244, 0xabea752d, 0x3569afb2, 0xd6ebb1c9,\n    0x48686b56},\n   {0x00000000, 0xc0642817, 0x80c9502e, 0x40ad7839, 0x0093a15c,\n    0xc0f7894b, 0x805af172, 0x403ed965, 0x002643b9, 0xc0426bae,\n    0x80ef1397, 0x408b3b80, 0x00b5e2e5, 0xc0d1caf2, 0x807cb2cb,\n    0x40189adc, 0x414af7a9, 0x812edfbe, 0xc183a787, 0x01e78f90,\n    0x41d956f5, 0x81bd7ee2, 0xc11006db, 0x01742ecc, 0x416cb410,\n    0x81089c07, 0xc1a5e43e, 0x01c1cc29, 0x41ff154c, 0x819b3d5b,\n    0xc1364562, 0x01526d75, 0xc3929f88, 0x03f6b79f, 0x435bcfa6,\n    0x833fe7b1, 0xc3013ed4, 0x036516c3, 0x43c86efa, 0x83ac46ed,\n    0xc3b4dc31, 0x03d0f426, 0x437d8c1f, 0x8319a408, 0xc3277d6d,\n    0x0343557a, 0x43ee2d43, 0x838a0554, 0x82d86821, 0x42bc4036,\n    0x0211380f, 0xc2751018, 0x824bc97d, 0x422fe16a, 0x02829953,\n    0xc2e6b144, 0x82fe2b98, 0x429a038f, 0x02377bb6, 0xc25353a1,\n    0x826d8ac4, 0x4209a2d3, 0x02a4daea, 0xc2c0f2fd, 0xc7234eca,\n    0x074766dd, 0x47ea1ee4, 0x878e36f3, 0xc7b0ef96, 0x07d4c781,\n    0x4779bfb8, 0x871d97af, 0xc7050d73, 0x07612564, 0x47cc5d5d,\n    0x87a8754a, 0xc796ac2f, 0x07f28438, 0x475ffc01, 0x873bd416,\n    0x8669b963, 0x460d9174, 0x06a0e94d, 0xc6c4c15a, 0x86fa183f,\n    0x469e3028, 0x06334811, 0xc6576006, 0x864ffada, 0x462bd2cd,\n    0x0686aaf4, 0xc6e282e3, 0x86dc5b86, 0x46b87391, 0x06150ba8,\n    0xc67123bf, 0x04b1d142, 0xc4d5f955, 0x8478816c, 0x441ca97b,\n    0x0422701e, 0xc4465809, 0x84eb2030, 0x448f0827, 0x049792fb,\n    0xc4f3baec, 0x845ec2d5, 0x443aeac2, 0x040433a7, 0xc4601bb0,\n    0x84cd6389, 0x44a94b9e, 0x45fb26eb, 0x859f0efc, 0xc53276c5,\n    0x05565ed2, 0x456887b7, 0x850cafa0, 0xc5a1d799, 0x05c5ff8e,\n    0x45dd6552, 0x85b94d45, 0xc514357c, 0x05701d6b, 0x454ec40e,\n    0x852aec19, 0xc5879420, 0x05e3bc37, 0xcf41ed4f, 0x0f25c558,\n    0x4f88bd61, 0x8fec9576, 0xcfd24c13, 0x0fb66404, 0x4f1b1c3d,\n    0x8f7f342a, 0xcf67aef6, 0x0f0386e1, 0x4faefed8, 0x8fcad6cf,\n    0xcff40faa, 0x0f9027bd, 0x4f3d5f84, 0x8f597793, 0x8e0b1ae6,\n    0x4e6f32f1, 0x0ec24ac8, 0xcea662df, 0x8e98bbba, 0x4efc93ad,\n    0x0e51eb94, 0xce35c383, 0x8e2d595f, 0x4e497148, 0x0ee40971,\n    0xce802166, 0x8ebef803, 0x4edad014, 0x0e77a82d, 0xce13803a,\n    0x0cd372c7, 0xccb75ad0, 0x8c1a22e9, 0x4c7e0afe, 0x0c40d39b,\n    0xcc24fb8c, 0x8c8983b5, 0x4cedaba2, 0x0cf5317e, 0xcc911969,\n    0x8c3c6150, 0x4c584947, 0x0c669022, 0xcc02b835, 0x8cafc00c,\n    0x4ccbe81b, 0x4d99856e, 0x8dfdad79, 0xcd50d540, 0x0d34fd57,\n    0x4d0a2432, 0x8d6e0c25, 0xcdc3741c, 0x0da75c0b, 0x4dbfc6d7,\n    0x8ddbeec0, 0xcd7696f9, 0x0d12beee, 0x4d2c678b, 0x8d484f9c,\n    0xcde537a5, 0x0d811fb2, 0x0862a385, 0xc8068b92, 0x88abf3ab,\n    0x48cfdbbc, 0x08f102d9, 0xc8952ace, 0x883852f7, 0x485c7ae0,\n    0x0844e03c, 0xc820c82b, 0x888db012, 0x48e99805, 0x08d74160,\n    0xc8b36977, 0x881e114e, 0x487a3959, 0x4928542c, 0x894c7c3b,\n    0xc9e10402, 0x09852c15, 0x49bbf570, 0x89dfdd67, 0xc972a55e,\n    0x09168d49, 0x490e1795, 0x896a3f82, 0xc9c747bb, 0x09a36fac,\n    0x499db6c9, 0x89f99ede, 0xc954e6e7, 0x0930cef0, 0xcbf03c0d,\n    0x0b94141a, 0x4b396c23, 0x8b5d4434, 0xcb639d51, 0x0b07b546,\n    0x4baacd7f, 0x8bcee568, 0xcbd67fb4, 0x0bb257a3, 0x4b1f2f9a,\n    0x8b7b078d, 0xcb45dee8, 0x0b21f6ff, 0x4b8c8ec6, 0x8be8a6d1,\n    0x8abacba4, 0x4adee3b3, 0x0a739b8a, 0xca17b39d, 0x8a296af8,\n    0x4a4d42ef, 0x0ae03ad6, 0xca8412c1, 0x8a9c881d, 0x4af8a00a,\n    0x0a55d833, 0xca31f024, 0x8a0f2941, 0x4a6b0156, 0x0ac6796f,\n    0xcaa25178},\n   {0x00000000, 0xd4ea739b, 0xe9d396ed, 0x3d39e576, 0x93a15c00,\n    0x474b2f9b, 0x7a72caed, 0xae98b976, 0x2643b900, 0xf2a9ca9b,\n    0xcf902fed, 0x1b7a5c76, 0xb5e2e500, 0x6108969b, 0x5c3173ed,\n    0x88db0076, 0x4c867201, 0x986c019a, 0xa555e4ec, 0x71bf9777,\n    0xdf272e01, 0x0bcd5d9a, 0x36f4b8ec, 0xe21ecb77, 0x6ac5cb01,\n    0xbe2fb89a, 0x83165dec, 0x57fc2e77, 0xf9649701, 0x2d8ee49a,\n    0x10b701ec, 0xc45d7277, 0x980ce502, 0x4ce69699, 0x71df73ef,\n    0xa5350074, 0x0badb902, 0xdf47ca99, 0xe27e2fef, 0x36945c74,\n    0xbe4f5c02, 0x6aa52f99, 0x579ccaef, 0x8376b974, 0x2dee0002,\n    0xf9047399, 0xc43d96ef, 0x10d7e574, 0xd48a9703, 0x0060e498,\n    0x3d5901ee, 0xe9b37275, 0x472bcb03, 0x93c1b898, 0xaef85dee,\n    0x7a122e75, 0xf2c92e03, 0x26235d98, 0x1b1ab8ee, 0xcff0cb75,\n    0x61687203, 0xb5820198, 0x88bbe4ee, 0x5c519775, 0x3019ca05,\n    0xe4f3b99e, 0xd9ca5ce8, 0x0d202f73, 0xa3b89605, 0x7752e59e,\n    0x4a6b00e8, 0x9e817373, 0x165a7305, 0xc2b0009e, 0xff89e5e8,\n    0x2b639673, 0x85fb2f05, 0x51115c9e, 0x6c28b9e8, 0xb8c2ca73,\n    0x7c9fb804, 0xa875cb9f, 0x954c2ee9, 0x41a65d72, 0xef3ee404,\n    0x3bd4979f, 0x06ed72e9, 0xd2070172, 0x5adc0104, 0x8e36729f,\n    0xb30f97e9, 0x67e5e472, 0xc97d5d04, 0x1d972e9f, 0x20aecbe9,\n    0xf444b872, 0xa8152f07, 0x7cff5c9c, 0x41c6b9ea, 0x952cca71,\n    0x3bb47307, 0xef5e009c, 0xd267e5ea, 0x068d9671, 0x8e569607,\n    0x5abce59c, 0x678500ea, 0xb36f7371, 0x1df7ca07, 0xc91db99c,\n    0xf4245cea, 0x20ce2f71, 0xe4935d06, 0x30792e9d, 0x0d40cbeb,\n    0xd9aab870, 0x77320106, 0xa3d8729d, 0x9ee197eb, 0x4a0be470,\n    0xc2d0e406, 0x163a979d, 0x2b0372eb, 0xffe90170, 0x5171b806,\n    0x859bcb9d, 0xb8a22eeb, 0x6c485d70, 0x6032940b, 0xb4d8e790,\n    0x89e102e6, 0x5d0b717d, 0xf393c80b, 0x2779bb90, 0x1a405ee6,\n    0xceaa2d7d, 0x46712d0b, 0x929b5e90, 0xafa2bbe6, 0x7b48c87d,\n    0xd5d0710b, 0x013a0290, 0x3c03e7e6, 0xe8e9947d, 0x2cb4e60a,\n    0xf85e9591, 0xc56770e7, 0x118d037c, 0xbf15ba0a, 0x6bffc991,\n    0x56c62ce7, 0x822c5f7c, 0x0af75f0a, 0xde1d2c91, 0xe324c9e7,\n    0x37ceba7c, 0x9956030a, 0x4dbc7091, 0x708595e7, 0xa46fe67c,\n    0xf83e7109, 0x2cd40292, 0x11ede7e4, 0xc507947f, 0x6b9f2d09,\n    0xbf755e92, 0x824cbbe4, 0x56a6c87f, 0xde7dc809, 0x0a97bb92,\n    0x37ae5ee4, 0xe3442d7f, 0x4ddc9409, 0x9936e792, 0xa40f02e4,\n    0x70e5717f, 0xb4b80308, 0x60527093, 0x5d6b95e5, 0x8981e67e,\n    0x27195f08, 0xf3f32c93, 0xcecac9e5, 0x1a20ba7e, 0x92fbba08,\n    0x4611c993, 0x7b282ce5, 0xafc25f7e, 0x015ae608, 0xd5b09593,\n    0xe88970e5, 0x3c63037e, 0x502b5e0e, 0x84c12d95, 0xb9f8c8e3,\n    0x6d12bb78, 0xc38a020e, 0x17607195, 0x2a5994e3, 0xfeb3e778,\n    0x7668e70e, 0xa2829495, 0x9fbb71e3, 0x4b510278, 0xe5c9bb0e,\n    0x3123c895, 0x0c1a2de3, 0xd8f05e78, 0x1cad2c0f, 0xc8475f94,\n    0xf57ebae2, 0x2194c979, 0x8f0c700f, 0x5be60394, 0x66dfe6e2,\n    0xb2359579, 0x3aee950f, 0xee04e694, 0xd33d03e2, 0x07d77079,\n    0xa94fc90f, 0x7da5ba94, 0x409c5fe2, 0x94762c79, 0xc827bb0c,\n    0x1ccdc897, 0x21f42de1, 0xf51e5e7a, 0x5b86e70c, 0x8f6c9497,\n    0xb25571e1, 0x66bf027a, 0xee64020c, 0x3a8e7197, 0x07b794e1,\n    0xd35de77a, 0x7dc55e0c, 0xa92f2d97, 0x9416c8e1, 0x40fcbb7a,\n    0x84a1c90d, 0x504bba96, 0x6d725fe0, 0xb9982c7b, 0x1700950d,\n    0xc3eae696, 0xfed303e0, 0x2a39707b, 0xa2e2700d, 0x76080396,\n    0x4b31e6e0, 0x9fdb957b, 0x31432c0d, 0xe5a95f96, 0xd890bae0,\n    0x0c7ac97b},\n   {0x00000000, 0x27652581, 0x0fcc3bd9, 0x28a91e58, 0x5f9e0669,\n    0x78fb23e8, 0x50523db0, 0x77371831, 0xbe3c0dd2, 0x99592853,\n    0xb1f0360b, 0x9695138a, 0xe1a20bbb, 0xc6c72e3a, 0xee6e3062,\n    0xc90b15e3, 0x3d7f6b7f, 0x1a1a4efe, 0x32b350a6, 0x15d67527,\n    0x62e16d16, 0x45844897, 0x6d2d56cf, 0x4a48734e, 0x834366ad,\n    0xa426432c, 0x8c8f5d74, 0xabea78f5, 0xdcdd60c4, 0xfbb84545,\n    0xd3115b1d, 0xf4747e9c, 0x7afed6fe, 0x5d9bf37f, 0x7532ed27,\n    0x5257c8a6, 0x2560d097, 0x0205f516, 0x2aaceb4e, 0x0dc9cecf,\n    0xc4c2db2c, 0xe3a7fead, 0xcb0ee0f5, 0xec6bc574, 0x9b5cdd45,\n    0xbc39f8c4, 0x9490e69c, 0xb3f5c31d, 0x4781bd81, 0x60e49800,\n    0x484d8658, 0x6f28a3d9, 0x181fbbe8, 0x3f7a9e69, 0x17d38031,\n    0x30b6a5b0, 0xf9bdb053, 0xded895d2, 0xf6718b8a, 0xd114ae0b,\n    0xa623b63a, 0x814693bb, 0xa9ef8de3, 0x8e8aa862, 0xb5fadc26,\n    0x929ff9a7, 0xba36e7ff, 0x9d53c27e, 0xea64da4f, 0xcd01ffce,\n    0xe5a8e196, 0xc2cdc417, 0x0bc6d1f4, 0x2ca3f475, 0x040aea2d,\n    0x236fcfac, 0x5458d79d, 0x733df21c, 0x5b94ec44, 0x7cf1c9c5,\n    0x8885b759, 0xafe092d8, 0x87498c80, 0xa02ca901, 0xd71bb130,\n    0xf07e94b1, 0xd8d78ae9, 0xffb2af68, 0x36b9ba8b, 0x11dc9f0a,\n    0x39758152, 0x1e10a4d3, 0x6927bce2, 0x4e429963, 0x66eb873b,\n    0x418ea2ba, 0xcf040ad8, 0xe8612f59, 0xc0c83101, 0xe7ad1480,\n    0x909a0cb1, 0xb7ff2930, 0x9f563768, 0xb83312e9, 0x7138070a,\n    0x565d228b, 0x7ef43cd3, 0x59911952, 0x2ea60163, 0x09c324e2,\n    0x216a3aba, 0x060f1f3b, 0xf27b61a7, 0xd51e4426, 0xfdb75a7e,\n    0xdad27fff, 0xade567ce, 0x8a80424f, 0xa2295c17, 0x854c7996,\n    0x4c476c75, 0x6b2249f4, 0x438b57ac, 0x64ee722d, 0x13d96a1c,\n    0x34bc4f9d, 0x1c1551c5, 0x3b707444, 0x6af5b94d, 0x4d909ccc,\n    0x65398294, 0x425ca715, 0x356bbf24, 0x120e9aa5, 0x3aa784fd,\n    0x1dc2a17c, 0xd4c9b49f, 0xf3ac911e, 0xdb058f46, 0xfc60aac7,\n    0x8b57b2f6, 0xac329777, 0x849b892f, 0xa3feacae, 0x578ad232,\n    0x70eff7b3, 0x5846e9eb, 0x7f23cc6a, 0x0814d45b, 0x2f71f1da,\n    0x07d8ef82, 0x20bdca03, 0xe9b6dfe0, 0xced3fa61, 0xe67ae439,\n    0xc11fc1b8, 0xb628d989, 0x914dfc08, 0xb9e4e250, 0x9e81c7d1,\n    0x100b6fb3, 0x376e4a32, 0x1fc7546a, 0x38a271eb, 0x4f9569da,\n    0x68f04c5b, 0x40595203, 0x673c7782, 0xae376261, 0x895247e0,\n    0xa1fb59b8, 0x869e7c39, 0xf1a96408, 0xd6cc4189, 0xfe655fd1,\n    0xd9007a50, 0x2d7404cc, 0x0a11214d, 0x22b83f15, 0x05dd1a94,\n    0x72ea02a5, 0x558f2724, 0x7d26397c, 0x5a431cfd, 0x9348091e,\n    0xb42d2c9f, 0x9c8432c7, 0xbbe11746, 0xccd60f77, 0xebb32af6,\n    0xc31a34ae, 0xe47f112f, 0xdf0f656b, 0xf86a40ea, 0xd0c35eb2,\n    0xf7a67b33, 0x80916302, 0xa7f44683, 0x8f5d58db, 0xa8387d5a,\n    0x613368b9, 0x46564d38, 0x6eff5360, 0x499a76e1, 0x3ead6ed0,\n    0x19c84b51, 0x31615509, 0x16047088, 0xe2700e14, 0xc5152b95,\n    0xedbc35cd, 0xcad9104c, 0xbdee087d, 0x9a8b2dfc, 0xb22233a4,\n    0x95471625, 0x5c4c03c6, 0x7b292647, 0x5380381f, 0x74e51d9e,\n    0x03d205af, 0x24b7202e, 0x0c1e3e76, 0x2b7b1bf7, 0xa5f1b395,\n    0x82949614, 0xaa3d884c, 0x8d58adcd, 0xfa6fb5fc, 0xdd0a907d,\n    0xf5a38e25, 0xd2c6aba4, 0x1bcdbe47, 0x3ca89bc6, 0x1401859e,\n    0x3364a01f, 0x4453b82e, 0x63369daf, 0x4b9f83f7, 0x6cfaa676,\n    0x988ed8ea, 0xbfebfd6b, 0x9742e333, 0xb027c6b2, 0xc710de83,\n    0xe075fb02, 0xc8dce55a, 0xefb9c0db, 0x26b2d538, 0x01d7f0b9,\n    0x297eeee1, 0x0e1bcb60, 0x792cd351, 0x5e49f6d0, 0x76e0e888,\n    0x5185cd09}};\n\n#endif\n\n#endif\n\n#endif\n\nlocal const z_crc_t FAR x2n_table[] = {\n    0x40000000, 0x20000000, 0x08000000, 0x00800000, 0x00008000,\n    0xedb88320, 0xb1e6b092, 0xa06a2517, 0xed627dae, 0x88d14467,\n    0xd7bbfe6a, 0xec447f11, 0x8e7ea170, 0x6427800e, 0x4d47bae0,\n    0x09fe548f, 0x83852d0f, 0x30362f1a, 0x7b5a9cc3, 0x31fec169,\n    0x9fec022a, 0x6c8dedc4, 0x15d6874d, 0x5fde7a4e, 0xbad90e37,\n    0x2e4e5eef, 0x4eaba214, 0xa8a472c0, 0x429a969e, 0x148d302a,\n    0xc40ba6d0, 0xc4e22c3c};\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/zconf.h",
    "content": "/* zconf.h -- configuration of the zlib compression library\n * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#ifndef ZCONF_H\n#define ZCONF_H\n\n/*\n * If you *really* need a unique prefix for all types and library functions,\n * compile with -DZ_PREFIX. The \"standard\" zlib should be compiled without it.\n * Even better than compiling with -DZ_PREFIX would be to use configure to set\n * this permanently in zconf.h using \"./configure --zprefix\".\n */\n#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */\n#  define Z_PREFIX_SET\n\n/* all linked symbols and init macros */\n#  define _dist_code            z__dist_code\n#  define _length_code          z__length_code\n#  define _tr_align             z__tr_align\n#  define _tr_flush_bits        z__tr_flush_bits\n#  define _tr_flush_block       z__tr_flush_block\n#  define _tr_init              z__tr_init\n#  define _tr_stored_block      z__tr_stored_block\n#  define _tr_tally             z__tr_tally\n#  define adler32               z_adler32\n#  define adler32_combine       z_adler32_combine\n#  define adler32_combine64     z_adler32_combine64\n#  define adler32_z             z_adler32_z\n#  ifndef Z_SOLO\n#    define compress              z_compress\n#    define compress2             z_compress2\n#    define compressBound         z_compressBound\n#  endif\n#  define crc32                 z_crc32\n#  define crc32_combine         z_crc32_combine\n#  define crc32_combine64       z_crc32_combine64\n#  define crc32_combine_gen     z_crc32_combine_gen\n#  define crc32_combine_gen64   z_crc32_combine_gen64\n#  define crc32_combine_op      z_crc32_combine_op\n#  define crc32_z               z_crc32_z\n#  define deflate               z_deflate\n#  define deflateBound          z_deflateBound\n#  define deflateCopy           z_deflateCopy\n#  define deflateEnd            z_deflateEnd\n#  define deflateGetDictionary  z_deflateGetDictionary\n#  define deflateInit           z_deflateInit\n#  define deflateInit2          z_deflateInit2\n#  define deflateInit2_         z_deflateInit2_\n#  define deflateInit_          z_deflateInit_\n#  define deflateParams         z_deflateParams\n#  define deflatePending        z_deflatePending\n#  define deflatePrime          z_deflatePrime\n#  define deflateReset          z_deflateReset\n#  define deflateResetKeep      z_deflateResetKeep\n#  define deflateSetDictionary  z_deflateSetDictionary\n#  define deflateSetHeader      z_deflateSetHeader\n#  define deflateTune           z_deflateTune\n#  define deflate_copyright     z_deflate_copyright\n#  define get_crc_table         z_get_crc_table\n#  ifndef Z_SOLO\n#    define gz_error              z_gz_error\n#    define gz_intmax             z_gz_intmax\n#    define gz_strwinerror        z_gz_strwinerror\n#    define gzbuffer              z_gzbuffer\n#    define gzclearerr            z_gzclearerr\n#    define gzclose               z_gzclose\n#    define gzclose_r             z_gzclose_r\n#    define gzclose_w             z_gzclose_w\n#    define gzdirect              z_gzdirect\n#    define gzdopen               z_gzdopen\n#    define gzeof                 z_gzeof\n#    define gzerror               z_gzerror\n#    define gzflush               z_gzflush\n#    define gzfread               z_gzfread\n#    define gzfwrite              z_gzfwrite\n#    define gzgetc                z_gzgetc\n#    define gzgetc_               z_gzgetc_\n#    define gzgets                z_gzgets\n#    define gzoffset              z_gzoffset\n#    define gzoffset64            z_gzoffset64\n#    define gzopen                z_gzopen\n#    define gzopen64              z_gzopen64\n#    ifdef _WIN32\n#      define gzopen_w              z_gzopen_w\n#    endif\n#    define gzprintf              z_gzprintf\n#    define gzputc                z_gzputc\n#    define gzputs                z_gzputs\n#    define gzread                z_gzread\n#    define gzrewind              z_gzrewind\n#    define gzseek                z_gzseek\n#    define gzseek64              z_gzseek64\n#    define gzsetparams           z_gzsetparams\n#    define gztell                z_gztell\n#    define gztell64              z_gztell64\n#    define gzungetc              z_gzungetc\n#    define gzvprintf             z_gzvprintf\n#    define gzwrite               z_gzwrite\n#  endif\n#  define inflate               z_inflate\n#  define inflateBack           z_inflateBack\n#  define inflateBackEnd        z_inflateBackEnd\n#  define inflateBackInit       z_inflateBackInit\n#  define inflateBackInit_      z_inflateBackInit_\n#  define inflateCodesUsed      z_inflateCodesUsed\n#  define inflateCopy           z_inflateCopy\n#  define inflateEnd            z_inflateEnd\n#  define inflateGetDictionary  z_inflateGetDictionary\n#  define inflateGetHeader      z_inflateGetHeader\n#  define inflateInit           z_inflateInit\n#  define inflateInit2          z_inflateInit2\n#  define inflateInit2_         z_inflateInit2_\n#  define inflateInit_          z_inflateInit_\n#  define inflateMark           z_inflateMark\n#  define inflatePrime          z_inflatePrime\n#  define inflateReset          z_inflateReset\n#  define inflateReset2         z_inflateReset2\n#  define inflateResetKeep      z_inflateResetKeep\n#  define inflateSetDictionary  z_inflateSetDictionary\n#  define inflateSync           z_inflateSync\n#  define inflateSyncPoint      z_inflateSyncPoint\n#  define inflateUndermine      z_inflateUndermine\n#  define inflateValidate       z_inflateValidate\n#  define inflate_copyright     z_inflate_copyright\n#  define inflate_fast          z_inflate_fast\n#  define inflate_table         z_inflate_table\n#  ifndef Z_SOLO\n#    define uncompress            z_uncompress\n#    define uncompress2           z_uncompress2\n#  endif\n#  define zError                z_zError\n#  ifndef Z_SOLO\n#    define zcalloc               z_zcalloc\n#    define zcfree                z_zcfree\n#  endif\n#  define zlibCompileFlags      z_zlibCompileFlags\n#  define zlibVersion           z_zlibVersion\n\n/* all zlib typedefs in zlib.h and zconf.h */\n#  define Byte                  z_Byte\n#  define Bytef                 z_Bytef\n#  define alloc_func            z_alloc_func\n#  define charf                 z_charf\n#  define free_func             z_free_func\n#  ifndef Z_SOLO\n#    define gzFile                z_gzFile\n#  endif\n#  define gz_header             z_gz_header\n#  define gz_headerp            z_gz_headerp\n#  define in_func               z_in_func\n#  define intf                  z_intf\n#  define out_func              z_out_func\n#  define uInt                  z_uInt\n#  define uIntf                 z_uIntf\n#  define uLong                 z_uLong\n#  define uLongf                z_uLongf\n#  define voidp                 z_voidp\n#  define voidpc                z_voidpc\n#  define voidpf                z_voidpf\n\n/* all zlib structs in zlib.h and zconf.h */\n#  define gz_header_s           z_gz_header_s\n#  define internal_state        z_internal_state\n\n#endif\n\n#if defined(__MSDOS__) && !defined(MSDOS)\n#  define MSDOS\n#endif\n#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)\n#  define OS2\n#endif\n#if defined(_WINDOWS) && !defined(WINDOWS)\n#  define WINDOWS\n#endif\n#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)\n#  ifndef WIN32\n#    define WIN32\n#  endif\n#endif\n#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)\n#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)\n#    ifndef SYS16BIT\n#      define SYS16BIT\n#    endif\n#  endif\n#endif\n\n/*\n * Compile with -DMAXSEG_64K if the alloc function cannot allocate more\n * than 64k bytes at a time (needed on systems with 16-bit int).\n */\n#ifdef SYS16BIT\n#  define MAXSEG_64K\n#endif\n#ifdef MSDOS\n#  define UNALIGNED_OK\n#endif\n\n#ifdef __STDC_VERSION__\n#  ifndef STDC\n#    define STDC\n#  endif\n#  if __STDC_VERSION__ >= 199901L\n#    ifndef STDC99\n#      define STDC99\n#    endif\n#  endif\n#endif\n#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))\n#  define STDC\n#endif\n\n#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */\n#  define STDC\n#endif\n\n#ifndef STDC\n#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */\n#    define const       /* note: need a more gentle solution here */\n#  endif\n#endif\n\n#if defined(ZLIB_CONST) && !defined(z_const)\n#  define z_const const\n#else\n#  define z_const\n#endif\n\n#ifdef Z_SOLO\n#  ifdef _WIN64\n     typedef unsigned long long z_size_t;\n#  else\n     typedef unsigned long z_size_t;\n#  endif\n#else\n#  define z_longlong long long\n#  if defined(NO_SIZE_T)\n     typedef unsigned NO_SIZE_T z_size_t;\n#  elif defined(STDC)\n#    include <stddef.h>\n     typedef size_t z_size_t;\n#  else\n     typedef unsigned long z_size_t;\n#  endif\n#  undef z_longlong\n#endif\n\n/* Maximum value for memLevel in deflateInit2 */\n#ifndef MAX_MEM_LEVEL\n#  ifdef MAXSEG_64K\n#    define MAX_MEM_LEVEL 8\n#  else\n#    define MAX_MEM_LEVEL 9\n#  endif\n#endif\n\n/* Maximum value for windowBits in deflateInit2 and inflateInit2.\n * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files\n * created by gzip. (Files created by minigzip can still be extracted by\n * gzip.)\n */\n#ifndef MAX_WBITS\n#  define MAX_WBITS   15 /* 32K LZ77 window */\n#endif\n\n/* The memory requirements for deflate are (in bytes):\n            (1 << (windowBits+2)) +  (1 << (memLevel+9))\n that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)\n plus a few kilobytes for small objects. For example, if you want to reduce\n the default memory requirements from 256K to 128K, compile with\n     make CFLAGS=\"-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7\"\n Of course this will generally degrade compression (there's no free lunch).\n\n   The memory requirements for inflate are (in bytes) 1 << windowBits\n that is, 32K for windowBits=15 (default value) plus about 7 kilobytes\n for small objects.\n*/\n\n                        /* Type declarations */\n\n#ifndef OF /* function prototypes */\n#  ifdef STDC\n#    define OF(args)  args\n#  else\n#    define OF(args)  ()\n#  endif\n#endif\n\n#ifndef Z_ARG /* function prototypes for stdarg */\n#  if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#    define Z_ARG(args)  args\n#  else\n#    define Z_ARG(args)  ()\n#  endif\n#endif\n\n/* The following definitions for FAR are needed only for MSDOS mixed\n * model programming (small or medium model with some far allocations).\n * This was tested only with MSC; for other MSDOS compilers you may have\n * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,\n * just define FAR to be empty.\n */\n#ifdef SYS16BIT\n#  if defined(M_I86SM) || defined(M_I86MM)\n     /* MSC small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef _MSC_VER\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#  if (defined(__SMALL__) || defined(__MEDIUM__))\n     /* Turbo C small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef __BORLANDC__\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#endif\n\n#if defined(WINDOWS) || defined(WIN32)\n   /* If building or using zlib as a DLL, define ZLIB_DLL.\n    * This is not mandatory, but it offers a little performance increase.\n    */\n#  ifdef ZLIB_DLL\n#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))\n#      ifdef ZLIB_INTERNAL\n#        define ZEXTERN extern __declspec(dllexport)\n#      else\n#        define ZEXTERN extern __declspec(dllimport)\n#      endif\n#    endif\n#  endif  /* ZLIB_DLL */\n   /* If building or using zlib with the WINAPI/WINAPIV calling convention,\n    * define ZLIB_WINAPI.\n    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.\n    */\n#  ifdef ZLIB_WINAPI\n#    ifdef FAR\n#      undef FAR\n#    endif\n#    ifndef WIN32_LEAN_AND_MEAN\n#      define WIN32_LEAN_AND_MEAN\n#    endif\n#    include <windows.h>\n     /* No need for _export, use ZLIB.DEF instead. */\n     /* For complete Windows compatibility, use WINAPI, not __stdcall. */\n#    define ZEXPORT WINAPI\n#    ifdef WIN32\n#      define ZEXPORTVA WINAPIV\n#    else\n#      define ZEXPORTVA FAR CDECL\n#    endif\n#  endif\n#endif\n\n#if defined (__BEOS__)\n#  ifdef ZLIB_DLL\n#    ifdef ZLIB_INTERNAL\n#      define ZEXPORT   __declspec(dllexport)\n#      define ZEXPORTVA __declspec(dllexport)\n#    else\n#      define ZEXPORT   __declspec(dllimport)\n#      define ZEXPORTVA __declspec(dllimport)\n#    endif\n#  endif\n#endif\n\n#ifndef ZEXTERN\n#  define ZEXTERN extern\n#endif\n#ifndef ZEXPORT\n#  define ZEXPORT\n#endif\n#ifndef ZEXPORTVA\n#  define ZEXPORTVA\n#endif\n\n#ifndef FAR\n#  define FAR\n#endif\n\n#if !defined(__MACTYPES__)\ntypedef unsigned char  Byte;  /* 8 bits */\n#endif\ntypedef unsigned int   uInt;  /* 16 bits or more */\ntypedef unsigned long  uLong; /* 32 bits or more */\n\n#ifdef SMALL_MEDIUM\n   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */\n#  define Bytef Byte FAR\n#else\n   typedef Byte  FAR Bytef;\n#endif\ntypedef char  FAR charf;\ntypedef int   FAR intf;\ntypedef uInt  FAR uIntf;\ntypedef uLong FAR uLongf;\n\n#ifdef STDC\n   typedef void const *voidpc;\n   typedef void FAR   *voidpf;\n   typedef void       *voidp;\n#else\n   typedef Byte const *voidpc;\n   typedef Byte FAR   *voidpf;\n   typedef Byte       *voidp;\n#endif\n\n#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)\n#  include <limits.h>\n#  if (UINT_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned\n#  elif (ULONG_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned long\n#  elif (USHRT_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned short\n#  endif\n#endif\n\n#ifdef Z_U4\n   typedef Z_U4 z_crc_t;\n#else\n   typedef unsigned long z_crc_t;\n#endif\n\n#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */\n#  define Z_HAVE_UNISTD_H\n#endif\n\n#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */\n#  define Z_HAVE_STDARG_H\n#endif\n\n#ifdef STDC\n#  ifndef Z_SOLO\n#    include <sys/types.h>      /* for off_t */\n#  endif\n#endif\n\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#  ifndef Z_SOLO\n#    include <stdarg.h>         /* for va_list */\n#  endif\n#endif\n\n#ifdef _WIN32\n#  ifndef Z_SOLO\n#    include <stddef.h>         /* for wchar_t */\n#  endif\n#endif\n\n/* a little trick to accommodate both \"#define _LARGEFILE64_SOURCE\" and\n * \"#define _LARGEFILE64_SOURCE 1\" as requesting 64-bit operations, (even\n * though the former does not conform to the LFS document), but considering\n * both \"#undef _LARGEFILE64_SOURCE\" and \"#define _LARGEFILE64_SOURCE 0\" as\n * equivalently requesting no 64-bit operations\n */\n#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1\n#  undef _LARGEFILE64_SOURCE\n#endif\n\n#ifndef Z_HAVE_UNISTD_H\n#  ifdef __WATCOMC__\n#    define Z_HAVE_UNISTD_H\n#  endif\n#endif\n#ifndef Z_HAVE_UNISTD_H\n#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)\n#    define Z_HAVE_UNISTD_H\n#  endif\n#endif\n#ifndef Z_SOLO\n#  if defined(Z_HAVE_UNISTD_H)\n#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */\n#    ifdef VMS\n#      include <unixio.h>       /* for off_t */\n#    endif\n#    ifndef z_off_t\n#      define z_off_t off_t\n#    endif\n#  endif\n#endif\n\n#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0\n#  define Z_LFS64\n#endif\n\n#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)\n#  define Z_LARGE64\n#endif\n\n#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)\n#  define Z_WANT64\n#endif\n\n#if !defined(SEEK_SET) && !defined(Z_SOLO)\n#  define SEEK_SET        0       /* Seek from beginning of file.  */\n#  define SEEK_CUR        1       /* Seek from current position.  */\n#  define SEEK_END        2       /* Set file pointer to EOF plus \"offset\" */\n#endif\n\n#ifndef z_off_t\n#  define z_off_t long\n#endif\n\n#if !defined(_WIN32) && defined(Z_LARGE64)\n#  define z_off64_t off64_t\n#else\n#  if defined(_WIN32) && !defined(__GNUC__)\n#    define z_off64_t __int64\n#  else\n#    define z_off64_t z_off_t\n#  endif\n#endif\n\n/* MVS linker does not support external names larger than 8 bytes */\n#if defined(__MVS__)\n  #pragma map(deflateInit_,\"DEIN\")\n  #pragma map(deflateInit2_,\"DEIN2\")\n  #pragma map(deflateEnd,\"DEEND\")\n  #pragma map(deflateBound,\"DEBND\")\n  #pragma map(inflateInit_,\"ININ\")\n  #pragma map(inflateInit2_,\"ININ2\")\n  #pragma map(inflateEnd,\"INEND\")\n  #pragma map(inflateSync,\"INSY\")\n  #pragma map(inflateSetDictionary,\"INSEDI\")\n  #pragma map(compressBound,\"CMBND\")\n  #pragma map(inflate_table,\"INTABL\")\n  #pragma map(inflate_fast,\"INFA\")\n  #pragma map(inflate_copyright,\"INCOPY\")\n#endif\n\n#endif /* ZCONF_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/zlib.h",
    "content": "/* zlib.h -- interface of the 'zlib' general purpose compression library\n  version 1.3, August 18th, 2023\n\n  Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Jean-loup Gailly        Mark Adler\n  jloup@gzip.org          madler@alumni.caltech.edu\n\n\n  The data format used by the zlib library is described by RFCs (Request for\n  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950\n  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).\n*/\n\n#ifndef ZLIB_H\n#define ZLIB_H\n\n#include \"zconf.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define ZLIB_VERSION \"1.3\"\n#define ZLIB_VERNUM 0x1300\n#define ZLIB_VER_MAJOR 1\n#define ZLIB_VER_MINOR 3\n#define ZLIB_VER_REVISION 0\n#define ZLIB_VER_SUBREVISION 0\n\n/*\n    The 'zlib' compression library provides in-memory compression and\n  decompression functions, including integrity checks of the uncompressed data.\n  This version of the library supports only one compression method (deflation)\n  but other algorithms will be added later and will have the same stream\n  interface.\n\n    Compression can be done in a single step if the buffers are large enough,\n  or can be done by repeated calls of the compression function.  In the latter\n  case, the application must provide more input and/or consume the output\n  (providing more output space) before each call.\n\n    The compressed data format used by default by the in-memory functions is\n  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped\n  around a deflate stream, which is itself documented in RFC 1951.\n\n    The library also supports reading and writing files in gzip (.gz) format\n  with an interface similar to that of stdio using the functions that start\n  with \"gz\".  The gzip format is different from the zlib format.  gzip is a\n  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.\n\n    This library can optionally read and write gzip and raw deflate streams in\n  memory as well.\n\n    The zlib format was designed to be compact and fast for use in memory\n  and on communications channels.  The gzip format was designed for single-\n  file compression on file systems, has a larger header than zlib to maintain\n  directory information, and uses a different, slower check method than zlib.\n\n    The library does not install any signal handler.  The decoder checks\n  the consistency of the compressed data, so the library should never crash\n  even in the case of corrupted input.\n*/\n\ntypedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);\ntypedef void   (*free_func)(voidpf opaque, voidpf address);\n\nstruct internal_state;\n\ntypedef struct z_stream_s {\n    z_const Bytef *next_in;     /* next input byte */\n    uInt     avail_in;  /* number of bytes available at next_in */\n    uLong    total_in;  /* total number of input bytes read so far */\n\n    Bytef    *next_out; /* next output byte will go here */\n    uInt     avail_out; /* remaining free space at next_out */\n    uLong    total_out; /* total number of bytes output so far */\n\n    z_const char *msg;  /* last error message, NULL if no error */\n    struct internal_state FAR *state; /* not visible by applications */\n\n    alloc_func zalloc;  /* used to allocate the internal state */\n    free_func  zfree;   /* used to free the internal state */\n    voidpf     opaque;  /* private data object passed to zalloc and zfree */\n\n    int     data_type;  /* best guess about the data type: binary or text\n                           for deflate, or the decoding state for inflate */\n    uLong   adler;      /* Adler-32 or CRC-32 value of the uncompressed data */\n    uLong   reserved;   /* reserved for future use */\n} z_stream;\n\ntypedef z_stream FAR *z_streamp;\n\n/*\n     gzip header information passed to and from zlib routines.  See RFC 1952\n  for more details on the meanings of these fields.\n*/\ntypedef struct gz_header_s {\n    int     text;       /* true if compressed data believed to be text */\n    uLong   time;       /* modification time */\n    int     xflags;     /* extra flags (not used when writing a gzip file) */\n    int     os;         /* operating system */\n    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */\n    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */\n    uInt    extra_max;  /* space at extra (only when reading header) */\n    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */\n    uInt    name_max;   /* space at name (only when reading header) */\n    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */\n    uInt    comm_max;   /* space at comment (only when reading header) */\n    int     hcrc;       /* true if there was or will be a header crc */\n    int     done;       /* true when done reading gzip header (not used\n                           when writing a gzip file) */\n} gz_header;\n\ntypedef gz_header FAR *gz_headerp;\n\n/*\n     The application must update next_in and avail_in when avail_in has dropped\n   to zero.  It must update next_out and avail_out when avail_out has dropped\n   to zero.  The application must initialize zalloc, zfree and opaque before\n   calling the init function.  All other fields are set by the compression\n   library and must not be updated by the application.\n\n     The opaque value provided by the application will be passed as the first\n   parameter for calls of zalloc and zfree.  This can be useful for custom\n   memory management.  The compression library attaches no meaning to the\n   opaque value.\n\n     zalloc must return Z_NULL if there is not enough memory for the object.\n   If zlib is used in a multi-threaded application, zalloc and zfree must be\n   thread safe.  In that case, zlib is thread-safe.  When zalloc and zfree are\n   Z_NULL on entry to the initialization function, they are set to internal\n   routines that use the standard library functions malloc() and free().\n\n     On 16-bit systems, the functions zalloc and zfree must be able to allocate\n   exactly 65536 bytes, but will not be required to allocate more than this if\n   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers\n   returned by zalloc for objects of exactly 65536 bytes *must* have their\n   offset normalized to zero.  The default allocation function provided by this\n   library ensures this (see zutil.c).  To reduce memory requirements and avoid\n   any allocation of 64K objects, at the expense of compression ratio, compile\n   the library with -DMAX_WBITS=14 (see zconf.h).\n\n     The fields total_in and total_out can be used for statistics or progress\n   reports.  After compression, total_in holds the total size of the\n   uncompressed data and may be saved for use by the decompressor (particularly\n   if the decompressor wants to decompress everything in a single step).\n*/\n\n                        /* constants */\n\n#define Z_NO_FLUSH      0\n#define Z_PARTIAL_FLUSH 1\n#define Z_SYNC_FLUSH    2\n#define Z_FULL_FLUSH    3\n#define Z_FINISH        4\n#define Z_BLOCK         5\n#define Z_TREES         6\n/* Allowed flush values; see deflate() and inflate() below for details */\n\n#define Z_OK            0\n#define Z_STREAM_END    1\n#define Z_NEED_DICT     2\n#define Z_ERRNO        (-1)\n#define Z_STREAM_ERROR (-2)\n#define Z_DATA_ERROR   (-3)\n#define Z_MEM_ERROR    (-4)\n#define Z_BUF_ERROR    (-5)\n#define Z_VERSION_ERROR (-6)\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n\n#define Z_NO_COMPRESSION         0\n#define Z_BEST_SPEED             1\n#define Z_BEST_COMPRESSION       9\n#define Z_DEFAULT_COMPRESSION  (-1)\n/* compression levels */\n\n#define Z_FILTERED            1\n#define Z_HUFFMAN_ONLY        2\n#define Z_RLE                 3\n#define Z_FIXED               4\n#define Z_DEFAULT_STRATEGY    0\n/* compression strategy; see deflateInit2() below for details */\n\n#define Z_BINARY   0\n#define Z_TEXT     1\n#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */\n#define Z_UNKNOWN  2\n/* Possible values of the data_type field for deflate() */\n\n#define Z_DEFLATED   8\n/* The deflate compression method (the only one supported in this version) */\n\n#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */\n\n#define zlib_version zlibVersion()\n/* for compatibility with versions < 1.0.2 */\n\n\n                        /* basic functions */\n\nZEXTERN const char * ZEXPORT zlibVersion(void);\n/* The application can compare zlibVersion and ZLIB_VERSION for consistency.\n   If the first character differs, the library code actually used is not\n   compatible with the zlib.h header file used by the application.  This check\n   is automatically made by deflateInit and inflateInit.\n */\n\n/*\nZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level);\n\n     Initializes the internal stream state for compression.  The fields\n   zalloc, zfree and opaque must be initialized before by the caller.  If\n   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default\n   allocation functions.  total_in, total_out, adler, and msg are initialized.\n\n     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:\n   1 gives best speed, 9 gives best compression, 0 gives no compression at all\n   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION\n   requests a default compromise between speed and compression (currently\n   equivalent to level 6).\n\n     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if level is not a valid compression level, or\n   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible\n   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null\n   if there is no error message.  deflateInit does not perform any compression:\n   this will be done by deflate().\n*/\n\n\nZEXTERN int ZEXPORT deflate(z_streamp strm, int flush);\n/*\n    deflate compresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n    The detailed semantics are as follows.  deflate performs one or both of the\n  following actions:\n\n  - Compress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), next_in and avail_in are updated and\n    processing will resume at this point for the next call of deflate().\n\n  - Generate more output starting at next_out and update next_out and avail_out\n    accordingly.  This action is forced if the parameter flush is non zero.\n    Forcing flush frequently degrades the compression ratio, so this parameter\n    should be set only when necessary.  Some output may be provided even if\n    flush is zero.\n\n    Before the call of deflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating avail_in or avail_out accordingly; avail_out should\n  never be zero before the call.  The application can consume the compressed\n  output when it wants, for example when the output buffer is full (avail_out\n  == 0), or after each call of deflate().  If deflate returns Z_OK and with\n  zero avail_out, it must be called again after making room in the output\n  buffer because there might be more output pending. See deflatePending(),\n  which can be used if desired to determine whether or not there is more output\n  in that case.\n\n    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to\n  decide how much data to accumulate before producing output, in order to\n  maximize compression.\n\n    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is\n  flushed to the output buffer and the output is aligned on a byte boundary, so\n  that the decompressor can get all input data available so far.  (In\n  particular avail_in is zero after the call if enough output space has been\n  provided before the call.) Flushing may degrade compression for some\n  compression algorithms and so it should be used only when necessary.  This\n  completes the current deflate block and follows it with an empty stored block\n  that is three bits plus filler bits to the next byte, followed by four bytes\n  (00 00 ff ff).\n\n    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the\n  output buffer, but the output is not aligned to a byte boundary.  All of the\n  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.\n  This completes the current deflate block and follows it with an empty fixed\n  codes block that is 10 bits long.  This assures that enough bytes are output\n  in order for the decompressor to finish the block before the empty fixed\n  codes block.\n\n    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as\n  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to\n  seven bits of the current block are held to be written as the next byte after\n  the next deflate block is completed.  In this case, the decompressor may not\n  be provided enough bits at this point in order to complete decompression of\n  the data provided so far to the compressor.  It may need to wait for the next\n  block to be emitted.  This is for advanced applications that need to control\n  the emission of deflate blocks.\n\n    If flush is set to Z_FULL_FLUSH, all output is flushed as with\n  Z_SYNC_FLUSH, and the compression state is reset so that decompression can\n  restart from this point if previous compressed data has been damaged or if\n  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade\n  compression.\n\n    If deflate returns with avail_out == 0, this function must be called again\n  with the same value of the flush parameter and more output space (updated\n  avail_out), until the flush is complete (deflate returns with non-zero\n  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that\n  avail_out is greater than six when the flush marker begins, in order to avoid\n  repeated flush markers upon calling deflate() again when avail_out == 0.\n\n    If the parameter flush is set to Z_FINISH, pending input is processed,\n  pending output is flushed and deflate returns with Z_STREAM_END if there was\n  enough output space.  If deflate returns with Z_OK or Z_BUF_ERROR, this\n  function must be called again with Z_FINISH and more output space (updated\n  avail_out) but no more input data, until it returns with Z_STREAM_END or an\n  error.  After deflate has returned Z_STREAM_END, the only possible operations\n  on the stream are deflateReset or deflateEnd.\n\n    Z_FINISH can be used in the first deflate call after deflateInit if all the\n  compression is to be done in a single step.  In order to complete in one\n  call, avail_out must be at least the value returned by deflateBound (see\n  below).  Then deflate is guaranteed to return Z_STREAM_END.  If not enough\n  output space is provided, deflate will not return Z_STREAM_END, and it must\n  be called again as described above.\n\n    deflate() sets strm->adler to the Adler-32 checksum of all input read\n  so far (that is, total_in bytes).  If a gzip stream is being generated, then\n  strm->adler will be the CRC-32 checksum of the input read so far.  (See\n  deflateInit2 below.)\n\n    deflate() may update strm->data_type if it can make a good guess about\n  the input data type (Z_BINARY or Z_TEXT).  If in doubt, the data is\n  considered binary.  This field is only for information purposes and does not\n  affect the compression algorithm in any manner.\n\n    deflate() returns Z_OK if some progress has been made (more input\n  processed or more output produced), Z_STREAM_END if all input has been\n  consumed and all output has been produced (only when flush is set to\n  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example\n  if next_in or next_out was Z_NULL or the state was inadvertently written over\n  by the application), or Z_BUF_ERROR if no progress is possible (for example\n  avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not fatal, and\n  deflate() can be called again with more input and more output space to\n  continue compressing.\n*/\n\n\nZEXTERN int ZEXPORT deflateEnd(z_streamp strm);\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the\n   stream state was inconsistent, Z_DATA_ERROR if the stream was freed\n   prematurely (some input or output was discarded).  In the error case, msg\n   may be set but then points to a static string (which must not be\n   deallocated).\n*/\n\n\n/*\nZEXTERN int ZEXPORT inflateInit(z_streamp strm);\n\n     Initializes the internal stream state for decompression.  The fields\n   next_in, avail_in, zalloc, zfree and opaque must be initialized before by\n   the caller.  In the current version of inflate, the provided input is not\n   read or consumed.  The allocation of a sliding window will be deferred to\n   the first call of inflate (if the decompression does not complete on the\n   first call).  If zalloc and zfree are set to Z_NULL, inflateInit updates\n   them to use default allocation functions.  total_in, total_out, adler, and\n   msg are initialized.\n\n     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit does not perform any decompression.\n   Actual decompression will be done by inflate().  So next_in, and avail_in,\n   next_out, and avail_out are unused and unchanged.  The current\n   implementation of inflateInit() does not process any header information --\n   that is deferred until inflate() is called.\n*/\n\n\nZEXTERN int ZEXPORT inflate(z_streamp strm, int flush);\n/*\n    inflate decompresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n  The detailed semantics are as follows.  inflate performs one or both of the\n  following actions:\n\n  - Decompress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), then next_in and avail_in are updated\n    accordingly, and processing will resume at this point for the next call of\n    inflate().\n\n  - Generate more output starting at next_out and update next_out and avail_out\n    accordingly.  inflate() provides as much output as possible, until there is\n    no more input data or no more space in the output buffer (see below about\n    the flush parameter).\n\n    Before the call of inflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating the next_* and avail_* values accordingly.  If the\n  caller of inflate() does not provide both available input and available\n  output space, it is possible that there will be no progress made.  The\n  application can consume the uncompressed output when it wants, for example\n  when the output buffer is full (avail_out == 0), or after each call of\n  inflate().  If inflate returns Z_OK and with zero avail_out, it must be\n  called again after making room in the output buffer because there might be\n  more output pending.\n\n    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,\n  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much\n  output as possible to the output buffer.  Z_BLOCK requests that inflate()\n  stop if and when it gets to the next deflate block boundary.  When decoding\n  the zlib or gzip format, this will cause inflate() to return immediately\n  after the header and before the first block.  When doing a raw inflate,\n  inflate() will go ahead and process the first block, and will return when it\n  gets to the end of that block, or when it runs out of data.\n\n    The Z_BLOCK option assists in appending to or combining deflate streams.\n  To assist in this, on return inflate() always sets strm->data_type to the\n  number of unused bits in the last byte taken from strm->next_in, plus 64 if\n  inflate() is currently decoding the last block in the deflate stream, plus\n  128 if inflate() returned immediately after decoding an end-of-block code or\n  decoding the complete header up to just before the first byte of the deflate\n  stream.  The end-of-block will not be indicated until all of the uncompressed\n  data from that block has been written to strm->next_out.  The number of\n  unused bits may in general be greater than seven, except when bit 7 of\n  data_type is set, in which case the number of unused bits will be less than\n  eight.  data_type is set as noted here every time inflate() returns for all\n  flush options, and so can be used to determine the amount of currently\n  consumed input in bits.\n\n    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the\n  end of each deflate block header is reached, before any actual data in that\n  block is decoded.  This allows the caller to determine the length of the\n  deflate block header for later use in random access within a deflate block.\n  256 is added to the value of strm->data_type when inflate() returns\n  immediately after reaching the end of the deflate block header.\n\n    inflate() should normally be called until it returns Z_STREAM_END or an\n  error.  However if all decompression is to be performed in a single step (a\n  single call of inflate), the parameter flush should be set to Z_FINISH.  In\n  this case all pending input is processed and all pending output is flushed;\n  avail_out must be large enough to hold all of the uncompressed data for the\n  operation to complete.  (The size of the uncompressed data may have been\n  saved by the compressor for this purpose.)  The use of Z_FINISH is not\n  required to perform an inflation in one step.  However it may be used to\n  inform inflate that a faster approach can be used for the single inflate()\n  call.  Z_FINISH also informs inflate to not maintain a sliding window if the\n  stream completes, which reduces inflate's memory footprint.  If the stream\n  does not complete, either because not all of the stream is provided or not\n  enough output space is provided, then a sliding window will be allocated and\n  inflate() can be called again to continue the operation as if Z_NO_FLUSH had\n  been used.\n\n     In this implementation, inflate() always flushes as much output as\n  possible to the output buffer, and always uses the faster approach on the\n  first call.  So the effects of the flush parameter in this implementation are\n  on the return value of inflate() as noted below, when inflate() returns early\n  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of\n  memory for a sliding window when Z_FINISH is used.\n\n     If a preset dictionary is needed after this call (see inflateSetDictionary\n  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary\n  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets\n  strm->adler to the Adler-32 checksum of all output produced so far (that is,\n  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described\n  below.  At the end of the stream, inflate() checks that its computed Adler-32\n  checksum is equal to that saved by the compressor and returns Z_STREAM_END\n  only if the checksum is correct.\n\n    inflate() can decompress and check either zlib-wrapped or gzip-wrapped\n  deflate data.  The header type is detected automatically, if requested when\n  initializing with inflateInit2().  Any information contained in the gzip\n  header is not retained unless inflateGetHeader() is used.  When processing\n  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output\n  produced so far.  The CRC-32 is checked against the gzip trailer, as is the\n  uncompressed length, modulo 2^32.\n\n    inflate() returns Z_OK if some progress has been made (more input processed\n  or more output produced), Z_STREAM_END if the end of the compressed data has\n  been reached and all uncompressed output has been produced, Z_NEED_DICT if a\n  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was\n  corrupted (input stream not conforming to the zlib format or incorrect check\n  value, in which case strm->msg points to a string with a more specific\n  error), Z_STREAM_ERROR if the stream structure was inconsistent (for example\n  next_in or next_out was Z_NULL, or the state was inadvertently written over\n  by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR\n  if no progress was possible or if there was not enough room in the output\n  buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and\n  inflate() can be called again with more input and more output space to\n  continue decompressing.  If Z_DATA_ERROR is returned, the application may\n  then call inflateSync() to look for a good compression block if a partial\n  recovery of the data is to be attempted.\n*/\n\n\nZEXTERN int ZEXPORT inflateEnd(z_streamp strm);\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state\n   was inconsistent.\n*/\n\n\n                        /* Advanced functions */\n\n/*\n    The following functions are needed only in some special applications.\n*/\n\n/*\nZEXTERN int ZEXPORT deflateInit2(z_streamp strm,\n                                 int level,\n                                 int method,\n                                 int windowBits,\n                                 int memLevel,\n                                 int strategy);\n\n     This is another version of deflateInit with more compression options.  The\n   fields zalloc, zfree and opaque must be initialized before by the caller.\n\n     The method parameter is the compression method.  It must be Z_DEFLATED in\n   this version of the library.\n\n     The windowBits parameter is the base two logarithm of the window size\n   (the size of the history buffer).  It should be in the range 8..15 for this\n   version of the library.  Larger values of this parameter result in better\n   compression at the expense of memory usage.  The default value is 15 if\n   deflateInit is used instead.\n\n     For the current implementation of deflate(), a windowBits value of 8 (a\n   window size of 256 bytes) is not supported.  As a result, a request for 8\n   will result in 9 (a 512-byte window).  In that case, providing 8 to\n   inflateInit2() will result in an error when the zlib header with 9 is\n   checked against the initialization of inflate().  The remedy is to not use 8\n   with deflateInit2() with this initialization, or at least in that case use 9\n   with inflateInit2().\n\n     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits\n   determines the window size.  deflate() will then generate raw deflate data\n   with no zlib header or trailer, and will not compute a check value.\n\n     windowBits can also be greater than 15 for optional gzip encoding.  Add\n   16 to windowBits to write a simple gzip header and trailer around the\n   compressed data instead of a zlib wrapper.  The gzip header will have no\n   file name, no extra data, no comment, no modification time (set to zero), no\n   header crc, and the operating system will be set to the appropriate value,\n   if the operating system was determined at compile time.  If a gzip stream is\n   being written, strm->adler is a CRC-32 instead of an Adler-32.\n\n     For raw deflate or gzip encoding, a request for a 256-byte window is\n   rejected as invalid, since only the zlib header provides a means of\n   transmitting the window size to the decompressor.\n\n     The memLevel parameter specifies how much memory should be allocated\n   for the internal compression state.  memLevel=1 uses minimum memory but is\n   slow and reduces compression ratio; memLevel=9 uses maximum memory for\n   optimal speed.  The default value is 8.  See zconf.h for total memory usage\n   as a function of windowBits and memLevel.\n\n     The strategy parameter is used to tune the compression algorithm.  Use the\n   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a\n   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no\n   string match), or Z_RLE to limit match distances to one (run-length\n   encoding).  Filtered data consists mostly of small values with a somewhat\n   random distribution.  In this case, the compression algorithm is tuned to\n   compress them better.  The effect of Z_FILTERED is to force more Huffman\n   coding and less string matching; it is somewhat intermediate between\n   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as\n   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The\n   strategy parameter only affects the compression ratio but not the\n   correctness of the compressed output even if it is not set appropriately.\n   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler\n   decoder for special applications.\n\n     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid\n   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is\n   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is\n   set to null if there is no error message.  deflateInit2 does not perform any\n   compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm,\n                                         const Bytef *dictionary,\n                                         uInt  dictLength);\n/*\n     Initializes the compression dictionary from the given byte sequence\n   without producing any compressed output.  When using the zlib format, this\n   function must be called immediately after deflateInit, deflateInit2 or\n   deflateReset, and before any call of deflate.  When doing raw deflate, this\n   function must be called either before any call of deflate, or immediately\n   after the completion of a deflate block, i.e. after all input has been\n   consumed and all output has been delivered when using any of the flush\n   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The\n   compressor and decompressor must use exactly the same dictionary (see\n   inflateSetDictionary).\n\n     The dictionary should consist of strings (byte sequences) that are likely\n   to be encountered later in the data to be compressed, with the most commonly\n   used strings preferably put towards the end of the dictionary.  Using a\n   dictionary is most useful when the data to be compressed is short and can be\n   predicted with good accuracy; the data can then be compressed better than\n   with the default empty dictionary.\n\n     Depending on the size of the compression data structures selected by\n   deflateInit or deflateInit2, a part of the dictionary may in effect be\n   discarded, for example if the dictionary is larger than the window size\n   provided in deflateInit or deflateInit2.  Thus the strings most likely to be\n   useful should be put at the end of the dictionary, not at the front.  In\n   addition, the current implementation of deflate will use at most the window\n   size minus 262 bytes of the provided dictionary.\n\n     Upon return of this function, strm->adler is set to the Adler-32 value\n   of the dictionary; the decompressor may later use this value to determine\n   which dictionary has been used by the compressor.  (The Adler-32 value\n   applies to the whole dictionary even if only a subset of the dictionary is\n   actually used by the compressor.) If a raw deflate was requested, then the\n   Adler-32 value is not computed and strm->adler is not set.\n\n     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent (for example if deflate has already been called for this stream\n   or if not at a block boundary for raw deflate).  deflateSetDictionary does\n   not perform any compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm,\n                                         Bytef *dictionary,\n                                         uInt  *dictLength);\n/*\n     Returns the sliding dictionary being maintained by deflate.  dictLength is\n   set to the number of bytes in the dictionary, and that many bytes are copied\n   to dictionary.  dictionary must have enough space, where 32768 bytes is\n   always enough.  If deflateGetDictionary() is called with dictionary equal to\n   Z_NULL, then only the dictionary length is returned, and nothing is copied.\n   Similarly, if dictLength is Z_NULL, then it is not set.\n\n     deflateGetDictionary() may return a length less than the window size, even\n   when more than the window size in input has been provided. It may return up\n   to 258 bytes less in that case, due to how zlib's implementation of deflate\n   manages the sliding window and lookahead for matches, where matches can be\n   up to 258 bytes long. If the application needs the last window-size bytes of\n   input, then that would need to be saved by the application outside of zlib.\n\n     deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the\n   stream state is inconsistent.\n*/\n\nZEXTERN int ZEXPORT deflateCopy(z_streamp dest,\n                                z_streamp source);\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when several compression strategies will be\n   tried, for example when there are several ways of pre-processing the input\n   data with a filter.  The streams that will be discarded should then be freed\n   by calling deflateEnd.  Note that deflateCopy duplicates the internal\n   compression state which can be quite large, so this strategy is slow and can\n   consume lots of memory.\n\n     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT deflateReset(z_streamp strm);\n/*\n     This function is equivalent to deflateEnd followed by deflateInit, but\n   does not free and reallocate the internal compression state.  The stream\n   will leave the compression level and any other attributes that may have been\n   set unchanged.  total_in, total_out, adler, and msg are initialized.\n\n     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT deflateParams(z_streamp strm,\n                                  int level,\n                                  int strategy);\n/*\n     Dynamically update the compression level and compression strategy.  The\n   interpretation of level and strategy is as in deflateInit2().  This can be\n   used to switch between compression and straight copy of the input data, or\n   to switch to a different kind of input data requiring a different strategy.\n   If the compression approach (which is a function of the level) or the\n   strategy is changed, and if there have been any deflate() calls since the\n   state was initialized or reset, then the input available so far is\n   compressed with the old level and strategy using deflate(strm, Z_BLOCK).\n   There are three approaches for the compression levels 0, 1..3, and 4..9\n   respectively.  The new level and strategy will take effect at the next call\n   of deflate().\n\n     If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does\n   not have enough output space to complete, then the parameter change will not\n   take effect.  In this case, deflateParams() can be called again with the\n   same parameters and more output space to try again.\n\n     In order to assure a change in the parameters on the first try, the\n   deflate stream should be flushed using deflate() with Z_BLOCK or other flush\n   request until strm.avail_out is not zero, before calling deflateParams().\n   Then no more input data should be provided before the deflateParams() call.\n   If this is done, the old level and strategy will be applied to the data\n   compressed before deflateParams(), and the new level and strategy will be\n   applied to the data compressed after deflateParams().\n\n     deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream\n   state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if\n   there was not enough output space to complete the compression of the\n   available input data before a change in the strategy or approach.  Note that\n   in the case of a Z_BUF_ERROR, the parameters are not changed.  A return\n   value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be\n   retried with more output space.\n*/\n\nZEXTERN int ZEXPORT deflateTune(z_streamp strm,\n                                int good_length,\n                                int max_lazy,\n                                int nice_length,\n                                int max_chain);\n/*\n     Fine tune deflate's internal compression parameters.  This should only be\n   used by someone who understands the algorithm used by zlib's deflate for\n   searching for the best matching string, and even then only by the most\n   fanatic optimizer trying to squeeze out the last compressed bit for their\n   specific input data.  Read the deflate.c source code for the meaning of the\n   max_lazy, good_length, nice_length, and max_chain parameters.\n\n     deflateTune() can be called after deflateInit() or deflateInit2(), and\n   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.\n */\n\nZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,\n                                   uLong sourceLen);\n/*\n     deflateBound() returns an upper bound on the compressed size after\n   deflation of sourceLen bytes.  It must be called after deflateInit() or\n   deflateInit2(), and after deflateSetHeader(), if used.  This would be used\n   to allocate an output buffer for deflation in a single pass, and so would be\n   called before deflate().  If that first deflate() call is provided the\n   sourceLen input bytes, an output buffer allocated to the size returned by\n   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed\n   to return Z_STREAM_END.  Note that it is possible for the compressed size to\n   be larger than the value returned by deflateBound() if flush options other\n   than Z_FINISH or Z_NO_FLUSH are used.\n*/\n\nZEXTERN int ZEXPORT deflatePending(z_streamp strm,\n                                   unsigned *pending,\n                                   int *bits);\n/*\n     deflatePending() returns the number of bytes and bits of output that have\n   been generated, but not yet provided in the available output.  The bytes not\n   provided would be due to the available output space having being consumed.\n   The number of bits of output not provided are between 0 and 7, where they\n   await more bits to join them in order to fill out a full byte.  If pending\n   or bits are Z_NULL, then those values are not set.\n\n     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n */\n\nZEXTERN int ZEXPORT deflatePrime(z_streamp strm,\n                                 int bits,\n                                 int value);\n/*\n     deflatePrime() inserts bits in the deflate output stream.  The intent\n   is that this function is used to start off the deflate output with the bits\n   leftover from a previous deflate stream when appending to it.  As such, this\n   function can only be used for raw deflate, and must be used before the first\n   deflate() call after a deflateInit2() or deflateReset().  bits must be less\n   than or equal to 16, and that many of the least significant bits of value\n   will be inserted in the output.\n\n     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough\n   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the\n   source stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm,\n                                     gz_headerp head);\n/*\n     deflateSetHeader() provides gzip header information for when a gzip\n   stream is requested by deflateInit2().  deflateSetHeader() may be called\n   after deflateInit2() or deflateReset() and before the first call of\n   deflate().  The text, time, os, extra field, name, and comment information\n   in the provided gz_header structure are written to the gzip header (xflag is\n   ignored -- the extra flags are set according to the compression level).  The\n   caller must assure that, if not Z_NULL, name and comment are terminated with\n   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are\n   available there.  If hcrc is true, a gzip header crc is included.  Note that\n   the current versions of the command-line version of gzip (up through version\n   1.3.x) do not support header crc's, and will report that it is a \"multi-part\n   gzip file\" and give up.\n\n     If deflateSetHeader is not used, the default gzip header has text false,\n   the time set to zero, and os set to the current operating system, with no\n   extra, name, or comment fields.  The gzip header is returned to the default\n   state by deflateReset().\n\n     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateInit2(z_streamp strm,\n                                 int windowBits);\n\n     This is another version of inflateInit with an extra parameter.  The\n   fields next_in, avail_in, zalloc, zfree and opaque must be initialized\n   before by the caller.\n\n     The windowBits parameter is the base two logarithm of the maximum window\n   size (the size of the history buffer).  It should be in the range 8..15 for\n   this version of the library.  The default value is 15 if inflateInit is used\n   instead.  windowBits must be greater than or equal to the windowBits value\n   provided to deflateInit2() while compressing, or it must be equal to 15 if\n   deflateInit2() was not used.  If a compressed stream with a larger window\n   size is given as input, inflate() will return with the error code\n   Z_DATA_ERROR instead of trying to allocate a larger window.\n\n     windowBits can also be zero to request that inflate use the window size in\n   the zlib header of the compressed stream.\n\n     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits\n   determines the window size.  inflate() will then process raw deflate data,\n   not looking for a zlib or gzip header, not generating a check value, and not\n   looking for any check values for comparison at the end of the stream.  This\n   is for use with other formats that use the deflate compressed data format\n   such as zip.  Those formats provide their own check values.  If a custom\n   format is developed using the raw deflate format for compressed data, it is\n   recommended that a check value such as an Adler-32 or a CRC-32 be applied to\n   the uncompressed data as is done in the zlib, gzip, and zip formats.  For\n   most applications, the zlib format should be used as is.  Note that comments\n   above on the use in deflateInit2() applies to the magnitude of windowBits.\n\n     windowBits can also be greater than 15 for optional gzip decoding.  Add\n   32 to windowBits to enable zlib and gzip decoding with automatic header\n   detection, or add 16 to decode only the gzip format (the zlib format will\n   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a\n   CRC-32 instead of an Adler-32.  Unlike the gunzip utility and gzread() (see\n   below), inflate() will *not* automatically decode concatenated gzip members.\n   inflate() will return Z_STREAM_END at the end of the gzip member.  The state\n   would need to be reset to continue decoding a subsequent gzip member.  This\n   *must* be done if there is more data after a gzip member, in order for the\n   decompression to be compliant with the gzip standard (RFC 1952).\n\n     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit2 does not perform any decompression\n   apart from possibly reading the zlib header if present: actual decompression\n   will be done by inflate().  (So next_in and avail_in may be modified, but\n   next_out and avail_out are unused and unchanged.) The current implementation\n   of inflateInit2() does not process any header information -- that is\n   deferred until inflate() is called.\n*/\n\nZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm,\n                                         const Bytef *dictionary,\n                                         uInt  dictLength);\n/*\n     Initializes the decompression dictionary from the given uncompressed byte\n   sequence.  This function must be called immediately after a call of inflate,\n   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor\n   can be determined from the Adler-32 value returned by that call of inflate.\n   The compressor and decompressor must use exactly the same dictionary (see\n   deflateSetDictionary).  For raw inflate, this function can be called at any\n   time to set the dictionary.  If the provided dictionary is smaller than the\n   window and there is already data in the window, then the provided dictionary\n   will amend what's there.  The application must insure that the dictionary\n   that was used for compression is provided.\n\n     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the\n   expected one (incorrect Adler-32 value).  inflateSetDictionary does not\n   perform any decompression: this will be done by subsequent calls of\n   inflate().\n*/\n\nZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm,\n                                         Bytef *dictionary,\n                                         uInt  *dictLength);\n/*\n     Returns the sliding dictionary being maintained by inflate.  dictLength is\n   set to the number of bytes in the dictionary, and that many bytes are copied\n   to dictionary.  dictionary must have enough space, where 32768 bytes is\n   always enough.  If inflateGetDictionary() is called with dictionary equal to\n   Z_NULL, then only the dictionary length is returned, and nothing is copied.\n   Similarly, if dictLength is Z_NULL, then it is not set.\n\n     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the\n   stream state is inconsistent.\n*/\n\nZEXTERN int ZEXPORT inflateSync(z_streamp strm);\n/*\n     Skips invalid compressed data until a possible full flush point (see above\n   for the description of deflate with Z_FULL_FLUSH) can be found, or until all\n   available input is skipped.  No output is provided.\n\n     inflateSync searches for a 00 00 FF FF pattern in the compressed data.\n   All full flush points have this pattern, but not all occurrences of this\n   pattern are full flush points.\n\n     inflateSync returns Z_OK if a possible full flush point has been found,\n   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point\n   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.\n   In the success case, the application may save the current current value of\n   total_in which indicates where valid compressed data was found.  In the\n   error case, the application may repeatedly call inflateSync, providing more\n   input each time, until success or end of the input data.\n*/\n\nZEXTERN int ZEXPORT inflateCopy(z_streamp dest,\n                                z_streamp source);\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when randomly accessing a large stream.  The\n   first pass through the stream can periodically record the inflate state,\n   allowing restarting inflate at those points when randomly accessing the\n   stream.\n\n     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT inflateReset(z_streamp strm);\n/*\n     This function is equivalent to inflateEnd followed by inflateInit,\n   but does not free and reallocate the internal decompression state.  The\n   stream will keep attributes that may have been set by inflateInit2.\n   total_in, total_out, adler, and msg are initialized.\n\n     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT inflateReset2(z_streamp strm,\n                                  int windowBits);\n/*\n     This function is the same as inflateReset, but it also permits changing\n   the wrap and window size requests.  The windowBits parameter is interpreted\n   the same as it is for inflateInit2.  If the window size is changed, then the\n   memory allocated for the window is freed, and the window will be reallocated\n   by inflate() if needed.\n\n     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL), or if\n   the windowBits parameter is invalid.\n*/\n\nZEXTERN int ZEXPORT inflatePrime(z_streamp strm,\n                                 int bits,\n                                 int value);\n/*\n     This function inserts bits in the inflate input stream.  The intent is\n   that this function is used to start inflating at a bit position in the\n   middle of a byte.  The provided bits will be used before any bytes are used\n   from next_in.  This function should only be used with raw inflate, and\n   should be used before the first inflate() call after inflateInit2() or\n   inflateReset().  bits must be less than or equal to 16, and that many of the\n   least significant bits of value will be inserted in the input.\n\n     If bits is negative, then the input stream bit buffer is emptied.  Then\n   inflatePrime() can be called again to put bits in the buffer.  This is used\n   to clear out bits leftover after feeding inflate a block description prior\n   to feeding inflate codes.\n\n     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\nZEXTERN long ZEXPORT inflateMark(z_streamp strm);\n/*\n     This function returns two values, one in the lower 16 bits of the return\n   value, and the other in the remaining upper bits, obtained by shifting the\n   return value down 16 bits.  If the upper value is -1 and the lower value is\n   zero, then inflate() is currently decoding information outside of a block.\n   If the upper value is -1 and the lower value is non-zero, then inflate is in\n   the middle of a stored block, with the lower value equaling the number of\n   bytes from the input remaining to copy.  If the upper value is not -1, then\n   it is the number of bits back from the current bit position in the input of\n   the code (literal or length/distance pair) currently being processed.  In\n   that case the lower value is the number of bytes already emitted for that\n   code.\n\n     A code is being processed if inflate is waiting for more input to complete\n   decoding of the code, or if it has completed decoding but is waiting for\n   more output space to write the literal or match data.\n\n     inflateMark() is used to mark locations in the input data for random\n   access, which may be at bit positions, and to note those cases where the\n   output of a code may span boundaries of random access blocks.  The current\n   location in the input stream can be determined from avail_in and data_type\n   as noted in the description for the Z_BLOCK flush parameter for inflate.\n\n     inflateMark returns the value noted above, or -65536 if the provided\n   source stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm,\n                                     gz_headerp head);\n/*\n     inflateGetHeader() requests that gzip header information be stored in the\n   provided gz_header structure.  inflateGetHeader() may be called after\n   inflateInit2() or inflateReset(), and before the first call of inflate().\n   As inflate() processes the gzip stream, head->done is zero until the header\n   is completed, at which time head->done is set to one.  If a zlib stream is\n   being decoded, then head->done is set to -1 to indicate that there will be\n   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be\n   used to force inflate() to return immediately after header processing is\n   complete and before any actual data is decompressed.\n\n     The text, time, xflags, and os fields are filled in with the gzip header\n   contents.  hcrc is set to true if there is a header CRC.  (The header CRC\n   was valid if done is set to one.) If extra is not Z_NULL, then extra_max\n   contains the maximum number of bytes to write to extra.  Once done is true,\n   extra_len contains the actual extra field length, and extra contains the\n   extra field, or that field truncated if extra_max is less than extra_len.\n   If name is not Z_NULL, then up to name_max characters are written there,\n   terminated with a zero unless the length is greater than name_max.  If\n   comment is not Z_NULL, then up to comm_max characters are written there,\n   terminated with a zero unless the length is greater than comm_max.  When any\n   of extra, name, or comment are not Z_NULL and the respective field is not\n   present in the header, then that field is set to Z_NULL to signal its\n   absence.  This allows the use of deflateSetHeader() with the returned\n   structure to duplicate the header.  However if those fields are set to\n   allocated memory, then the application will need to save those pointers\n   elsewhere so that they can be eventually freed.\n\n     If inflateGetHeader is not used, then the header information is simply\n   discarded.  The header is always checked for validity, including the header\n   CRC if present.  inflateReset() will reset the process to discard the header\n   information.  The application would need to call inflateGetHeader() again to\n   retrieve the header from the next gzip stream.\n\n     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits,\n                                    unsigned char FAR *window);\n\n     Initialize the internal stream state for decompression using inflateBack()\n   calls.  The fields zalloc, zfree and opaque in strm must be initialized\n   before the call.  If zalloc and zfree are Z_NULL, then the default library-\n   derived memory allocation routines are used.  windowBits is the base two\n   logarithm of the window size, in the range 8..15.  window is a caller\n   supplied buffer of that size.  Except for special applications where it is\n   assured that deflate was used with small window sizes, windowBits must be 15\n   and a 32K byte window must be supplied to be able to decompress general\n   deflate streams.\n\n     See inflateBack() for the usage of these routines.\n\n     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of\n   the parameters are invalid, Z_MEM_ERROR if the internal state could not be\n   allocated, or Z_VERSION_ERROR if the version of the library does not match\n   the version of the header file.\n*/\n\ntypedef unsigned (*in_func)(void FAR *,\n                            z_const unsigned char FAR * FAR *);\ntypedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned);\n\nZEXTERN int ZEXPORT inflateBack(z_streamp strm,\n                                in_func in, void FAR *in_desc,\n                                out_func out, void FAR *out_desc);\n/*\n     inflateBack() does a raw inflate with a single call using a call-back\n   interface for input and output.  This is potentially more efficient than\n   inflate() for file i/o applications, in that it avoids copying between the\n   output and the sliding window by simply making the window itself the output\n   buffer.  inflate() can be faster on modern CPUs when used with large\n   buffers.  inflateBack() trusts the application to not change the output\n   buffer passed by the output function, at least until inflateBack() returns.\n\n     inflateBackInit() must be called first to allocate the internal state\n   and to initialize the state with the user-provided window buffer.\n   inflateBack() may then be used multiple times to inflate a complete, raw\n   deflate stream with each call.  inflateBackEnd() is then called to free the\n   allocated state.\n\n     A raw deflate stream is one with no zlib or gzip header or trailer.\n   This routine would normally be used in a utility that reads zip or gzip\n   files and writes out uncompressed files.  The utility would decode the\n   header and process the trailer on its own, hence this routine expects only\n   the raw deflate stream to decompress.  This is different from the default\n   behavior of inflate(), which expects a zlib header and trailer around the\n   deflate stream.\n\n     inflateBack() uses two subroutines supplied by the caller that are then\n   called by inflateBack() for input and output.  inflateBack() calls those\n   routines until it reads a complete deflate stream and writes out all of the\n   uncompressed data, or until it encounters an error.  The function's\n   parameters and return types are defined above in the in_func and out_func\n   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the\n   number of bytes of provided input, and a pointer to that input in buf.  If\n   there is no input available, in() must return zero -- buf is ignored in that\n   case -- and inflateBack() will return a buffer error.  inflateBack() will\n   call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].\n   out() should return zero on success, or non-zero on failure.  If out()\n   returns non-zero, inflateBack() will return with an error.  Neither in() nor\n   out() are permitted to change the contents of the window provided to\n   inflateBackInit(), which is also the buffer that out() uses to write from.\n   The length written by out() will be at most the window size.  Any non-zero\n   amount of input may be provided by in().\n\n     For convenience, inflateBack() can be provided input on the first call by\n   setting strm->next_in and strm->avail_in.  If that input is exhausted, then\n   in() will be called.  Therefore strm->next_in must be initialized before\n   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called\n   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in\n   must also be initialized, and then if strm->avail_in is not zero, input will\n   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].\n\n     The in_desc and out_desc parameters of inflateBack() is passed as the\n   first parameter of in() and out() respectively when they are called.  These\n   descriptors can be optionally used to pass any information that the caller-\n   supplied in() and out() functions need to do their job.\n\n     On return, inflateBack() will set strm->next_in and strm->avail_in to\n   pass back any unused input that was provided by the last in() call.  The\n   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR\n   if in() or out() returned an error, Z_DATA_ERROR if there was a format error\n   in the deflate stream (in which case strm->msg is set to indicate the nature\n   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.\n   In the case of Z_BUF_ERROR, an input or output error can be distinguished\n   using strm->next_in which will be Z_NULL only if in() returned an error.  If\n   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning\n   non-zero.  (in() will always be called before out(), so strm->next_in is\n   assured to be defined if out() returns non-zero.)  Note that inflateBack()\n   cannot return Z_OK.\n*/\n\nZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm);\n/*\n     All memory allocated by inflateBackInit() is freed.\n\n     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream\n   state was inconsistent.\n*/\n\nZEXTERN uLong ZEXPORT zlibCompileFlags(void);\n/* Return flags indicating compile-time options.\n\n    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:\n     1.0: size of uInt\n     3.2: size of uLong\n     5.4: size of voidpf (pointer)\n     7.6: size of z_off_t\n\n    Compiler, assembler, and debug options:\n     8: ZLIB_DEBUG\n     9: ASMV or ASMINF -- use ASM code\n     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention\n     11: 0 (reserved)\n\n    One-time table building (smaller code, but not thread-safe if true):\n     12: BUILDFIXED -- build static block decoding tables when needed\n     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed\n     14,15: 0 (reserved)\n\n    Library content (indicates missing functionality):\n     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking\n                          deflate code when not needed)\n     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect\n                    and decode gzip streams (to avoid linking crc code)\n     18-19: 0 (reserved)\n\n    Operation variations (changes in library functionality):\n     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate\n     21: FASTEST -- deflate algorithm with only one, lowest compression level\n     22,23: 0 (reserved)\n\n    The sprintf variant used by gzprintf (zero is best):\n     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format\n     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!\n     26: 0 = returns value, 1 = void -- 1 means inferred string length returned\n\n    Remainder:\n     27-31: 0 (reserved)\n */\n\n#ifndef Z_SOLO\n\n                        /* utility functions */\n\n/*\n     The following utility functions are implemented on top of the basic\n   stream-oriented functions.  To simplify the interface, some default options\n   are assumed (compression level and memory usage, standard memory allocation\n   functions).  The source code of these utility functions can be modified if\n   you need special options.\n*/\n\nZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,\n                             const Bytef *source, uLong sourceLen);\n/*\n     Compresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed data.  compress() is equivalent to compress2() with a level\n   parameter of Z_DEFAULT_COMPRESSION.\n\n     compress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer.\n*/\n\nZEXTERN int ZEXPORT compress2(Bytef *dest,   uLongf *destLen,\n                              const Bytef *source, uLong sourceLen,\n                              int level);\n/*\n     Compresses the source buffer into the destination buffer.  The level\n   parameter has the same meaning as in deflateInit.  sourceLen is the byte\n   length of the source buffer.  Upon entry, destLen is the total size of the\n   destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed data.\n\n     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_BUF_ERROR if there was not enough room in the output buffer,\n   Z_STREAM_ERROR if the level parameter is invalid.\n*/\n\nZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);\n/*\n     compressBound() returns an upper bound on the compressed size after\n   compress() or compress2() on sourceLen bytes.  It would be used before a\n   compress() or compress2() call to allocate the destination buffer.\n*/\n\nZEXTERN int ZEXPORT uncompress(Bytef *dest,   uLongf *destLen,\n                               const Bytef *source, uLong sourceLen);\n/*\n     Decompresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be large enough to hold the entire\n   uncompressed data.  (The size of the uncompressed data must have been saved\n   previously by the compressor and transmitted to the decompressor by some\n   mechanism outside the scope of this compression library.) Upon exit, destLen\n   is the actual size of the uncompressed data.\n\n     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In\n   the case where there is not enough room, uncompress() will fill the output\n   buffer with the uncompressed data up to that point.\n*/\n\nZEXTERN int ZEXPORT uncompress2(Bytef *dest,   uLongf *destLen,\n                                const Bytef *source, uLong *sourceLen);\n/*\n     Same as uncompress, except that sourceLen is a pointer, where the\n   length of the source is *sourceLen.  On return, *sourceLen is the number of\n   source bytes consumed.\n*/\n\n                        /* gzip file access functions */\n\n/*\n     This library supports reading and writing files in gzip (.gz) format with\n   an interface similar to that of stdio, using the functions that start with\n   \"gz\".  The gzip format is different from the zlib format.  gzip is a gzip\n   wrapper, documented in RFC 1952, wrapped around a deflate stream.\n*/\n\ntypedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */\n\n/*\nZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);\n\n     Open the gzip (.gz) file at path for reading and decompressing, or\n   compressing and writing.  The mode parameter is as in fopen (\"rb\" or \"wb\")\n   but can also include a compression level (\"wb9\") or a strategy: 'f' for\n   filtered data as in \"wb6f\", 'h' for Huffman-only compression as in \"wb1h\",\n   'R' for run-length encoding as in \"wb1R\", or 'F' for fixed code compression\n   as in \"wb9F\".  (See the description of deflateInit2 for more information\n   about the strategy parameter.)  'T' will request transparent writing or\n   appending with no compression and not using the gzip format.\n\n     \"a\" can be used instead of \"w\" to request that the gzip stream that will\n   be written be appended to the file.  \"+\" will result in an error, since\n   reading and writing to the same gzip file is not supported.  The addition of\n   \"x\" when writing will create the file exclusively, which fails if the file\n   already exists.  On systems that support it, the addition of \"e\" when\n   reading or writing will set the flag to close the file on an execve() call.\n\n     These functions, as well as gzip, will read and decode a sequence of gzip\n   streams in a file.  The append function of gzopen() can be used to create\n   such a file.  (Also see gzflush() for another way to do this.)  When\n   appending, gzopen does not test whether the file begins with a gzip stream,\n   nor does it look for the end of the gzip streams to begin appending.  gzopen\n   will simply append a gzip stream to the existing file.\n\n     gzopen can be used to read a file which is not in gzip format; in this\n   case gzread will directly read from the file without decompression.  When\n   reading, this will be detected automatically by looking for the magic two-\n   byte gzip header.\n\n     gzopen returns NULL if the file could not be opened, if there was\n   insufficient memory to allocate the gzFile state, or if an invalid mode was\n   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).\n   errno can be checked to determine if the reason gzopen failed was that the\n   file could not be opened.\n*/\n\nZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);\n/*\n     Associate a gzFile with the file descriptor fd.  File descriptors are\n   obtained from calls like open, dup, creat, pipe or fileno (if the file has\n   been previously opened with fopen).  The mode parameter is as in gzopen.\n\n     The next call of gzclose on the returned gzFile will also close the file\n   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor\n   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,\n   mode);.  The duplicated descriptor should be saved to avoid a leak, since\n   gzdopen does not close fd if it fails.  If you are using fileno() to get the\n   file descriptor from a FILE *, then you will have to use dup() to avoid\n   double-close()ing the file descriptor.  Both gzclose() and fclose() will\n   close the associated file descriptor, so they need to have different file\n   descriptors.\n\n     gzdopen returns NULL if there was insufficient memory to allocate the\n   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not\n   provided, or '+' was provided), or if fd is -1.  The file descriptor is not\n   used until the next gz* read, write, seek, or close operation, so gzdopen\n   will not detect if fd is invalid (unless fd is -1).\n*/\n\nZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size);\n/*\n     Set the internal buffer size used by this library's functions for file to\n   size.  The default buffer size is 8192 bytes.  This function must be called\n   after gzopen() or gzdopen(), and before any other calls that read or write\n   the file.  The buffer memory allocation is always deferred to the first read\n   or write.  Three times that size in buffer space is allocated.  A larger\n   buffer size of, for example, 64K or 128K bytes will noticeably increase the\n   speed of decompression (reading).\n\n     The new buffer size also affects the maximum length for gzprintf().\n\n     gzbuffer() returns 0 on success, or -1 on failure, such as being called\n   too late.\n*/\n\nZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy);\n/*\n     Dynamically update the compression level and strategy for file.  See the\n   description of deflateInit2 for the meaning of these parameters. Previously\n   provided data is flushed before applying the parameter changes.\n\n     gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not\n   opened for writing, Z_ERRNO if there is an error writing the flushed data,\n   or Z_MEM_ERROR if there is a memory allocation error.\n*/\n\nZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);\n/*\n     Read and decompress up to len uncompressed bytes from file into buf.  If\n   the input file is not in gzip format, gzread copies the given number of\n   bytes into the buffer directly from the file.\n\n     After reaching the end of a gzip stream in the input, gzread will continue\n   to read, looking for another gzip stream.  Any number of gzip streams may be\n   concatenated in the input file, and will all be decompressed by gzread().\n   If something other than a gzip stream is encountered after a gzip stream,\n   that remaining trailing garbage is ignored (and no error is returned).\n\n     gzread can be used to read a gzip file that is being concurrently written.\n   Upon reaching the end of the input, gzread will return with the available\n   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then\n   gzclearerr can be used to clear the end of file indicator in order to permit\n   gzread to be tried again.  Z_OK indicates that a gzip stream was completed\n   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the\n   middle of a gzip stream.  Note that gzread does not return -1 in the event\n   of an incomplete gzip stream.  This error is deferred until gzclose(), which\n   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip\n   stream.  Alternatively, gzerror can be used before gzclose to detect this\n   case.\n\n     gzread returns the number of uncompressed bytes actually read, less than\n   len for end of file, or -1 for error.  If len is too large to fit in an int,\n   then nothing is read, -1 is returned, and the error state is set to\n   Z_STREAM_ERROR.\n*/\n\nZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,\n                                 gzFile file);\n/*\n     Read and decompress up to nitems items of size size from file into buf,\n   otherwise operating as gzread() does.  This duplicates the interface of\n   stdio's fread(), with size_t request and return types.  If the library\n   defines size_t, then z_size_t is identical to size_t.  If not, then z_size_t\n   is an unsigned integer type that can contain a pointer.\n\n     gzfread() returns the number of full items read of size size, or zero if\n   the end of the file was reached and a full item could not be read, or if\n   there was an error.  gzerror() must be consulted if zero is returned in\n   order to determine if there was an error.  If the multiplication of size and\n   nitems overflows, i.e. the product does not fit in a z_size_t, then nothing\n   is read, zero is returned, and the error state is set to Z_STREAM_ERROR.\n\n     In the event that the end of file is reached and only a partial item is\n   available at the end, i.e. the remaining uncompressed data length is not a\n   multiple of size, then the final partial item is nevertheless read into buf\n   and the end-of-file flag is set.  The length of the partial item read is not\n   provided, but could be inferred from the result of gztell().  This behavior\n   is the same as the behavior of fread() implementations in common libraries,\n   but it prevents the direct use of gzfread() to read a concurrently written\n   file, resetting and retrying on end-of-file, when size is not 1.\n*/\n\nZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);\n/*\n     Compress and write the len uncompressed bytes at buf to file. gzwrite\n   returns the number of uncompressed bytes written or 0 in case of error.\n*/\n\nZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,\n                                  z_size_t nitems, gzFile file);\n/*\n     Compress and write nitems items of size size from buf to file, duplicating\n   the interface of stdio's fwrite(), with size_t request and return types.  If\n   the library defines size_t, then z_size_t is identical to size_t.  If not,\n   then z_size_t is an unsigned integer type that can contain a pointer.\n\n     gzfwrite() returns the number of full items written of size size, or zero\n   if there was an error.  If the multiplication of size and nitems overflows,\n   i.e. the product does not fit in a z_size_t, then nothing is written, zero\n   is returned, and the error state is set to Z_STREAM_ERROR.\n*/\n\nZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);\n/*\n     Convert, format, compress, and write the arguments (...) to file under\n   control of the string format, as in fprintf.  gzprintf returns the number of\n   uncompressed bytes actually written, or a negative zlib error code in case\n   of error.  The number of uncompressed bytes written is limited to 8191, or\n   one less than the buffer size given to gzbuffer().  The caller should assure\n   that this limit is not exceeded.  If it is exceeded, then gzprintf() will\n   return an error (0) with nothing written.  In this case, there may also be a\n   buffer overflow with unpredictable consequences, which is possible only if\n   zlib was compiled with the insecure functions sprintf() or vsprintf(),\n   because the secure snprintf() or vsnprintf() functions were not available.\n   This can be determined using zlibCompileFlags().\n*/\n\nZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);\n/*\n     Compress and write the given null-terminated string s to file, excluding\n   the terminating null character.\n\n     gzputs returns the number of characters written, or -1 in case of error.\n*/\n\nZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);\n/*\n     Read and decompress bytes from file into buf, until len-1 characters are\n   read, or until a newline character is read and transferred to buf, or an\n   end-of-file condition is encountered.  If any characters are read or if len\n   is one, the string is terminated with a null character.  If no characters\n   are read due to an end-of-file or len is less than one, then the buffer is\n   left untouched.\n\n     gzgets returns buf which is a null-terminated string, or it returns NULL\n   for end-of-file or in case of error.  If there was an error, the contents at\n   buf are indeterminate.\n*/\n\nZEXTERN int ZEXPORT gzputc(gzFile file, int c);\n/*\n     Compress and write c, converted to an unsigned char, into file.  gzputc\n   returns the value that was written, or -1 in case of error.\n*/\n\nZEXTERN int ZEXPORT gzgetc(gzFile file);\n/*\n     Read and decompress one byte from file.  gzgetc returns this byte or -1\n   in case of end of file or error.  This is implemented as a macro for speed.\n   As such, it does not do all of the checking the other functions do.  I.e.\n   it does not check to see if file is NULL, nor whether the structure file\n   points to has been clobbered or not.\n*/\n\nZEXTERN int ZEXPORT gzungetc(int c, gzFile file);\n/*\n     Push c back onto the stream for file to be read as the first character on\n   the next read.  At least one character of push-back is always allowed.\n   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will\n   fail if c is -1, and may fail if a character has been pushed but not read\n   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the\n   output buffer size of pushed characters is allowed.  (See gzbuffer above.)\n   The pushed character will be discarded if the stream is repositioned with\n   gzseek() or gzrewind().\n*/\n\nZEXTERN int ZEXPORT gzflush(gzFile file, int flush);\n/*\n     Flush all pending output to file.  The parameter flush is as in the\n   deflate() function.  The return value is the zlib error number (see function\n   gzerror below).  gzflush is only permitted when writing.\n\n     If the flush parameter is Z_FINISH, the remaining data is written and the\n   gzip stream is completed in the output.  If gzwrite() is called again, a new\n   gzip stream will be started in the output.  gzread() is able to read such\n   concatenated gzip streams.\n\n     gzflush should be called only when strictly necessary because it will\n   degrade compression if called too often.\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzseek(gzFile file,\n                               z_off_t offset, int whence);\n\n     Set the starting position to offset relative to whence for the next gzread\n   or gzwrite on file.  The offset represents a number of bytes in the\n   uncompressed data stream.  The whence parameter is defined as in lseek(2);\n   the value SEEK_END is not supported.\n\n     If the file is opened for reading, this function is emulated but can be\n   extremely slow.  If the file is opened for writing, only forward seeks are\n   supported; gzseek then compresses a sequence of zeroes up to the new\n   starting position.\n\n     gzseek returns the resulting offset location as measured in bytes from\n   the beginning of the uncompressed stream, or -1 in case of error, in\n   particular if the file is opened for writing and the new starting position\n   would be before the current position.\n*/\n\nZEXTERN int ZEXPORT    gzrewind(gzFile file);\n/*\n     Rewind file. This function is supported only for reading.\n\n     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT    gztell(gzFile file);\n\n     Return the starting position for the next gzread or gzwrite on file.\n   This position represents a number of bytes in the uncompressed data stream,\n   and is zero when starting, even if appending or reading a gzip stream from\n   the middle of a file using gzdopen().\n\n     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzoffset(gzFile file);\n\n     Return the current compressed (actual) read or write offset of file.  This\n   offset includes the count of bytes that precede the gzip stream, for example\n   when appending or when using gzdopen() for reading.  When reading, the\n   offset does not include as yet unused buffered input.  This information can\n   be used for a progress indicator.  On error, gzoffset() returns -1.\n*/\n\nZEXTERN int ZEXPORT gzeof(gzFile file);\n/*\n     Return true (1) if the end-of-file indicator for file has been set while\n   reading, false (0) otherwise.  Note that the end-of-file indicator is set\n   only if the read tried to go past the end of the input, but came up short.\n   Therefore, just like feof(), gzeof() may return false even if there is no\n   more data to read, in the event that the last read request was for the exact\n   number of bytes remaining in the input file.  This will happen if the input\n   file size is an exact multiple of the buffer size.\n\n     If gzeof() returns true, then the read functions will return no more data,\n   unless the end-of-file indicator is reset by gzclearerr() and the input file\n   has grown since the previous end of file was detected.\n*/\n\nZEXTERN int ZEXPORT gzdirect(gzFile file);\n/*\n     Return true (1) if file is being copied directly while reading, or false\n   (0) if file is a gzip stream being decompressed.\n\n     If the input file is empty, gzdirect() will return true, since the input\n   does not contain a gzip stream.\n\n     If gzdirect() is used immediately after gzopen() or gzdopen() it will\n   cause buffers to be allocated to allow reading the file to determine if it\n   is a gzip file.  Therefore if gzbuffer() is used, it should be called before\n   gzdirect().\n\n     When writing, gzdirect() returns true (1) if transparent writing was\n   requested (\"wT\" for the gzopen() mode), or false (0) otherwise.  (Note:\n   gzdirect() is not needed when writing.  Transparent writing must be\n   explicitly requested, so the application already knows the answer.  When\n   linking statically, using gzdirect() will include all of the zlib code for\n   gzip file reading and decompression, which may not be desired.)\n*/\n\nZEXTERN int ZEXPORT    gzclose(gzFile file);\n/*\n     Flush all pending output for file, if necessary, close file and\n   deallocate the (de)compression state.  Note that once file is closed, you\n   cannot call gzerror with file, since its structures have been deallocated.\n   gzclose must not be called more than once on the same file, just as free\n   must not be called more than once on the same allocation.\n\n     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a\n   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the\n   last read ended in the middle of a gzip stream, or Z_OK on success.\n*/\n\nZEXTERN int ZEXPORT gzclose_r(gzFile file);\nZEXTERN int ZEXPORT gzclose_w(gzFile file);\n/*\n     Same as gzclose(), but gzclose_r() is only for use when reading, and\n   gzclose_w() is only for use when writing or appending.  The advantage to\n   using these instead of gzclose() is that they avoid linking in zlib\n   compression or decompression code that is not used when only reading or only\n   writing respectively.  If gzclose() is used, then both compression and\n   decompression code will be included the application when linking to a static\n   zlib library.\n*/\n\nZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);\n/*\n     Return the error message for the last error which occurred on file.\n   errnum is set to zlib error number.  If an error occurred in the file system\n   and not in the compression library, errnum is set to Z_ERRNO and the\n   application may consult errno to get the exact error code.\n\n     The application must not modify the returned string.  Future calls to\n   this function may invalidate the previously returned string.  If file is\n   closed, then the string previously returned by gzerror will no longer be\n   available.\n\n     gzerror() should be used to distinguish errors from end-of-file for those\n   functions above that do not distinguish those cases in their return values.\n*/\n\nZEXTERN void ZEXPORT gzclearerr(gzFile file);\n/*\n     Clear the error and end-of-file flags for file.  This is analogous to the\n   clearerr() function in stdio.  This is useful for continuing to read a gzip\n   file that is being written concurrently.\n*/\n\n#endif /* !Z_SOLO */\n\n                        /* checksum functions */\n\n/*\n     These functions are not related to compression but are exported\n   anyway because they might be useful in applications using the compression\n   library.\n*/\n\nZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);\n/*\n     Update a running Adler-32 checksum with the bytes buf[0..len-1] and\n   return the updated checksum. An Adler-32 value is in the range of a 32-bit\n   unsigned integer. If buf is Z_NULL, this function returns the required\n   initial value for the checksum.\n\n     An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed\n   much faster.\n\n   Usage example:\n\n     uLong adler = adler32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       adler = adler32(adler, buffer, length);\n     }\n     if (adler != original_adler) error();\n*/\n\nZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,\n                                z_size_t len);\n/*\n     Same as adler32(), but with a size_t length.\n*/\n\n/*\nZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2,\n                                      z_off_t len2);\n\n     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1\n   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for\n   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of\n   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note\n   that the z_off_t type (like off_t) is a signed integer.  If len2 is\n   negative, the result has no meaning or utility.\n*/\n\nZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);\n/*\n     Update a running CRC-32 with the bytes buf[0..len-1] and return the\n   updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.\n   If buf is Z_NULL, this function returns the required initial value for the\n   crc. Pre- and post-conditioning (one's complement) is performed within this\n   function so it shouldn't be done by the application.\n\n   Usage example:\n\n     uLong crc = crc32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       crc = crc32(crc, buffer, length);\n     }\n     if (crc != original_crc) error();\n*/\n\nZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,\n                              z_size_t len);\n/*\n     Same as crc32(), but with a size_t length.\n*/\n\n/*\nZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);\n\n     Combine two CRC-32 check values into one.  For two sequences of bytes,\n   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were\n   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32\n   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and\n   len2.\n*/\n\n/*\nZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);\n\n     Return the operator corresponding to length len2, to be used with\n   crc32_combine_op().\n*/\n\nZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);\n/*\n     Give the same result as crc32_combine(), using op in place of len2. op is\n   is generated from len2 by crc32_combine_gen(). This will be faster than\n   crc32_combine() if the generated op is used more than once.\n*/\n\n\n                        /* various hacks, don't look :) */\n\n/* deflateInit and inflateInit are macros to allow checking the zlib version\n * and the compiler's view of z_stream:\n */\nZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level,\n                                 const char *version, int stream_size);\nZEXTERN int ZEXPORT inflateInit_(z_streamp strm,\n                                 const char *version, int stream_size);\nZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int  level, int  method,\n                                  int windowBits, int memLevel,\n                                  int strategy, const char *version,\n                                  int stream_size);\nZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int  windowBits,\n                                  const char *version, int stream_size);\nZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,\n                                     unsigned char FAR *window,\n                                     const char *version,\n                                     int stream_size);\n#ifdef Z_PREFIX_SET\n#  define z_deflateInit(strm, level) \\\n          deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define z_inflateInit(strm) \\\n          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \\\n          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\\\n                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define z_inflateInit2(strm, windowBits) \\\n          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \\\n                        (int)sizeof(z_stream))\n#  define z_inflateBackInit(strm, windowBits, window) \\\n          inflateBackInit_((strm), (windowBits), (window), \\\n                           ZLIB_VERSION, (int)sizeof(z_stream))\n#else\n#  define deflateInit(strm, level) \\\n          deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define inflateInit(strm) \\\n          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \\\n          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\\\n                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))\n#  define inflateInit2(strm, windowBits) \\\n          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \\\n                        (int)sizeof(z_stream))\n#  define inflateBackInit(strm, windowBits, window) \\\n          inflateBackInit_((strm), (windowBits), (window), \\\n                           ZLIB_VERSION, (int)sizeof(z_stream))\n#endif\n\n#ifndef Z_SOLO\n\n/* gzgetc() macro and its supporting function and exposed data structure.  Note\n * that the real internal state is much larger than the exposed structure.\n * This abbreviated structure exposes just enough for the gzgetc() macro.  The\n * user should not mess with these exposed elements, since their names or\n * behavior could change in the future, perhaps even capriciously.  They can\n * only be used by the gzgetc() macro.  You have been warned.\n */\nstruct gzFile_s {\n    unsigned have;\n    unsigned char *next;\n    z_off64_t pos;\n};\nZEXTERN int ZEXPORT gzgetc_(gzFile file);       /* backward compatibility */\n#ifdef Z_PREFIX_SET\n#  undef z_gzgetc\n#  define z_gzgetc(g) \\\n          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))\n#else\n#  define gzgetc(g) \\\n          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))\n#endif\n\n/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or\n * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if\n * both are true, the application gets the *64 functions, and the regular\n * functions are changed to 64 bits) -- in case these are set on systems\n * without large file support, _LFS64_LARGEFILE must also be true\n */\n#ifdef Z_LARGE64\n   ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);\n   ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);\n   ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);\n   ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);\n   ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);\n   ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);\n   ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);\n#endif\n\n#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)\n#  ifdef Z_PREFIX_SET\n#    define z_gzopen z_gzopen64\n#    define z_gzseek z_gzseek64\n#    define z_gztell z_gztell64\n#    define z_gzoffset z_gzoffset64\n#    define z_adler32_combine z_adler32_combine64\n#    define z_crc32_combine z_crc32_combine64\n#    define z_crc32_combine_gen z_crc32_combine_gen64\n#  else\n#    define gzopen gzopen64\n#    define gzseek gzseek64\n#    define gztell gztell64\n#    define gzoffset gzoffset64\n#    define adler32_combine adler32_combine64\n#    define crc32_combine crc32_combine64\n#    define crc32_combine_gen crc32_combine_gen64\n#  endif\n#  ifndef Z_LARGE64\n     ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);\n     ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int);\n     ZEXTERN z_off_t ZEXPORT gztell64(gzFile);\n     ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile);\n     ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);\n     ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);\n     ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);\n#  endif\n#else\n   ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);\n   ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int);\n   ZEXTERN z_off_t ZEXPORT gztell(gzFile);\n   ZEXTERN z_off_t ZEXPORT gzoffset(gzFile);\n   ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);\n   ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);\n   ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);\n#endif\n\n#else /* Z_SOLO */\n\n   ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);\n   ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);\n   ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);\n\n#endif /* !Z_SOLO */\n\n/* undocumented functions */\nZEXTERN const char   * ZEXPORT zError(int);\nZEXTERN int            ZEXPORT inflateSyncPoint(z_streamp);\nZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);\nZEXTERN int            ZEXPORT inflateUndermine(z_streamp, int);\nZEXTERN int            ZEXPORT inflateValidate(z_streamp, int);\nZEXTERN unsigned long  ZEXPORT inflateCodesUsed(z_streamp);\nZEXTERN int            ZEXPORT inflateResetKeep(z_streamp);\nZEXTERN int            ZEXPORT deflateResetKeep(z_streamp);\n#if defined(_WIN32) && !defined(Z_SOLO)\nZEXTERN gzFile         ZEXPORT gzopen_w(const wchar_t *path,\n                                        const char *mode);\n#endif\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#  ifndef Z_SOLO\nZEXTERN int            ZEXPORTVA gzvprintf(gzFile file,\n                                           const char *format,\n                                           va_list va);\n#  endif\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ZLIB_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zlib/zutil.h",
    "content": "/* zutil.h -- internal interface and configuration of the compression library\n * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* @(#) $Id$ */\n\n#ifndef ZUTIL_H\n#define ZUTIL_H\n\n#ifdef HAVE_HIDDEN\n#  define ZLIB_INTERNAL __attribute__((visibility (\"hidden\")))\n#else\n#  define ZLIB_INTERNAL\n#endif\n\n#include \"zlib.h\"\n\n#if defined(STDC) && !defined(Z_SOLO)\n#  if !(defined(_WIN32_WCE) && defined(_MSC_VER))\n#    include <stddef.h>\n#  endif\n#  include <string.h>\n#  include <stdlib.h>\n#endif\n\n#ifndef local\n#  define local static\n#endif\n/* since \"static\" is used to mean two completely different things in C, we\n   define \"local\" for the non-static meaning of \"static\", for readability\n   (compile with -Dlocal if your debugger can't find static symbols) */\n\ntypedef unsigned char  uch;\ntypedef uch FAR uchf;\ntypedef unsigned short ush;\ntypedef ush FAR ushf;\ntypedef unsigned long  ulg;\n\n#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)\n#  include <limits.h>\n#  if (ULONG_MAX == 0xffffffffffffffff)\n#    define Z_U8 unsigned long\n#  elif (ULLONG_MAX == 0xffffffffffffffff)\n#    define Z_U8 unsigned long long\n#  elif (UINT_MAX == 0xffffffffffffffff)\n#    define Z_U8 unsigned\n#  endif\n#endif\n\nextern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */\n/* (size given to avoid silly warnings with Visual C++) */\n\n#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]\n\n#define ERR_RETURN(strm,err) \\\n  return (strm->msg = ERR_MSG(err), (err))\n/* To be used only when the state is known to be valid */\n\n        /* common constants */\n\n#ifndef DEF_WBITS\n#  define DEF_WBITS MAX_WBITS\n#endif\n/* default windowBits for decompression. MAX_WBITS is for compression only */\n\n#if MAX_MEM_LEVEL >= 8\n#  define DEF_MEM_LEVEL 8\n#else\n#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL\n#endif\n/* default memLevel */\n\n#define STORED_BLOCK 0\n#define STATIC_TREES 1\n#define DYN_TREES    2\n/* The three kinds of block type */\n\n#define MIN_MATCH  3\n#define MAX_MATCH  258\n/* The minimum and maximum match lengths */\n\n#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */\n\n        /* target dependencies */\n\n#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))\n#  define OS_CODE  0x00\n#  ifndef Z_SOLO\n#    if defined(__TURBOC__) || defined(__BORLANDC__)\n#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))\n         /* Allow compilation with ANSI keywords only enabled */\n         void _Cdecl farfree( void *block );\n         void *_Cdecl farmalloc( unsigned long nbytes );\n#      else\n#        include <alloc.h>\n#      endif\n#    else /* MSC or DJGPP */\n#      include <malloc.h>\n#    endif\n#  endif\n#endif\n\n#ifdef AMIGA\n#  define OS_CODE  1\n#endif\n\n#if defined(VAXC) || defined(VMS)\n#  define OS_CODE  2\n#  define F_OPEN(name, mode) \\\n     fopen((name), (mode), \"mbc=60\", \"ctx=stm\", \"rfm=fix\", \"mrs=512\")\n#endif\n\n#ifdef __370__\n#  if __TARGET_LIB__ < 0x20000000\n#    define OS_CODE 4\n#  elif __TARGET_LIB__ < 0x40000000\n#    define OS_CODE 11\n#  else\n#    define OS_CODE 8\n#  endif\n#endif\n\n#if defined(ATARI) || defined(atarist)\n#  define OS_CODE  5\n#endif\n\n#ifdef OS2\n#  define OS_CODE  6\n#  if defined(M_I86) && !defined(Z_SOLO)\n#    include <malloc.h>\n#  endif\n#endif\n\n#if defined(MACOS) || defined(TARGET_OS_MAC)\n#  define OS_CODE  7\n#  ifndef Z_SOLO\n#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os\n#      include <unix.h> /* for fdopen */\n#    else\n#      ifndef fdopen\n#        define fdopen(fd,mode) NULL /* No fdopen() */\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __acorn\n#  define OS_CODE 13\n#endif\n\n#if defined(WIN32) && !defined(__CYGWIN__)\n#  define OS_CODE  10\n#endif\n\n#ifdef _BEOS_\n#  define OS_CODE  16\n#endif\n\n#ifdef __TOS_OS400__\n#  define OS_CODE 18\n#endif\n\n#ifdef __APPLE__\n#  define OS_CODE 19\n#endif\n\n#if defined(_BEOS_) || defined(RISCOS)\n#  define fdopen(fd,mode) NULL /* No fdopen() */\n#endif\n\n#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX\n#  if defined(_WIN32_WCE)\n#    define fdopen(fd,mode) NULL /* No fdopen() */\n#  else\n#    define fdopen(fd,type)  _fdopen(fd,type)\n#  endif\n#endif\n\n#if defined(__BORLANDC__) && !defined(MSDOS)\n  #pragma warn -8004\n  #pragma warn -8008\n  #pragma warn -8066\n#endif\n\n/* provide prototypes for these when building zlib without LFS */\n#if !defined(_WIN32) && \\\n    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)\n    ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);\n    ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);\n    ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);\n#endif\n\n        /* common defaults */\n\n#ifndef OS_CODE\n#  define OS_CODE  3     /* assume Unix */\n#endif\n\n#ifndef F_OPEN\n#  define F_OPEN(name, mode) fopen((name), (mode))\n#endif\n\n         /* functions */\n\n#if defined(pyr) || defined(Z_SOLO)\n#  define NO_MEMCPY\n#endif\n#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)\n /* Use our own functions for small and medium model with MSC <= 5.0.\n  * You may have to use the same strategy for Borland C (untested).\n  * The __SC__ check is for Symantec.\n  */\n#  define NO_MEMCPY\n#endif\n#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)\n#  define HAVE_MEMCPY\n#endif\n#ifdef HAVE_MEMCPY\n#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */\n#    define zmemcpy _fmemcpy\n#    define zmemcmp _fmemcmp\n#    define zmemzero(dest, len) _fmemset(dest, 0, len)\n#  else\n#    define zmemcpy memcpy\n#    define zmemcmp memcmp\n#    define zmemzero(dest, len) memset(dest, 0, len)\n#  endif\n#else\n   void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len);\n   int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len);\n   void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);\n#endif\n\n/* Diagnostic functions */\n#ifdef ZLIB_DEBUG\n#  include <stdio.h>\n   extern int ZLIB_INTERNAL z_verbose;\n   extern void ZLIB_INTERNAL z_error(char *m);\n#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}\n#  define Trace(x) {if (z_verbose>=0) fprintf x ;}\n#  define Tracev(x) {if (z_verbose>0) fprintf x ;}\n#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}\n#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}\n#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}\n#else\n#  define Assert(cond,msg)\n#  define Trace(x)\n#  define Tracev(x)\n#  define Tracevv(x)\n#  define Tracec(c,x)\n#  define Tracecv(c,x)\n#endif\n\n#ifndef Z_SOLO\n   voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items,\n                                unsigned size);\n   void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr);\n#endif\n\n#define ZALLOC(strm, items, size) \\\n           (*((strm)->zalloc))((strm)->opaque, (items), (size))\n#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))\n#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}\n\n/* Reverse the bytes in a 32-bit value */\n#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \\\n                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))\n\n#endif /* ZUTIL_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/LICENSE.txt",
    "content": "BSD License\n\nFor Zstandard software\n\nCopyright (c) 2016-present, Facebook, Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n * Neither the name Facebook nor the names of its contributors may be used to\n   endorse or promote products derived from this software without specific\n   prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/bitstream.h",
    "content": "/* ******************************************************************\n * bitstream\n * Part of FSE library\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n#ifndef BITSTREAM_H_MODULE\n#define BITSTREAM_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n/*\n*  This API consists of small unitary functions, which must be inlined for best performance.\n*  Since link-time-optimization is not available for all compilers,\n*  these functions are defined into a .h to be included.\n*/\n\n/*-****************************************\n*  Dependencies\n******************************************/\n#include \"mem.h\"            /* unaligned access routines */\n#include \"compiler.h\"       /* UNLIKELY() */\n#include \"debug.h\"          /* assert(), DEBUGLOG(), RAWLOG() */\n#include \"error_private.h\"  /* error codes and messages */\n\n\n/*=========================================\n*  Target specific\n=========================================*/\n#ifndef ZSTD_NO_INTRINSICS\n#  if defined(__BMI__) && defined(__GNUC__)\n#    include <immintrin.h>   /* support for bextr (experimental) */\n#  elif defined(__ICCARM__)\n#    include <intrinsics.h>\n#  endif\n#endif\n\n#define STREAM_ACCUMULATOR_MIN_32  25\n#define STREAM_ACCUMULATOR_MIN_64  57\n#define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))\n\n\n/*-******************************************\n*  bitStream encoding API (write forward)\n********************************************/\n/* bitStream can mix input from multiple sources.\n * A critical property of these streams is that they encode and decode in **reverse** direction.\n * So the first bit sequence you add will be the last to be read, like a LIFO stack.\n */\ntypedef struct {\n    size_t bitContainer;\n    unsigned bitPos;\n    char*  startPtr;\n    char*  ptr;\n    char*  endPtr;\n} BIT_CStream_t;\n\nMEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);\nMEM_STATIC void   BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);\nMEM_STATIC void   BIT_flushBits(BIT_CStream_t* bitC);\nMEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC);\n\n/* Start with initCStream, providing the size of buffer to write into.\n*  bitStream will never write outside of this buffer.\n*  `dstCapacity` must be >= sizeof(bitD->bitContainer), otherwise @return will be an error code.\n*\n*  bits are first added to a local register.\n*  Local register is size_t, hence 64-bits on 64-bits systems, or 32-bits on 32-bits systems.\n*  Writing data into memory is an explicit operation, performed by the flushBits function.\n*  Hence keep track how many bits are potentially stored into local register to avoid register overflow.\n*  After a flushBits, a maximum of 7 bits might still be stored into local register.\n*\n*  Avoid storing elements of more than 24 bits if you want compatibility with 32-bits bitstream readers.\n*\n*  Last operation is to close the bitStream.\n*  The function returns the final size of CStream in bytes.\n*  If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable)\n*/\n\n\n/*-********************************************\n*  bitStream decoding API (read backward)\n**********************************************/\ntypedef struct {\n    size_t   bitContainer;\n    unsigned bitsConsumed;\n    const char* ptr;\n    const char* start;\n    const char* limitPtr;\n} BIT_DStream_t;\n\ntypedef enum { BIT_DStream_unfinished = 0,\n               BIT_DStream_endOfBuffer = 1,\n               BIT_DStream_completed = 2,\n               BIT_DStream_overflow = 3 } BIT_DStream_status;  /* result of BIT_reloadDStream() */\n               /* 1,2,4,8 would be better for bitmap combinations, but slows down performance a bit ... :( */\n\nMEM_STATIC size_t   BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);\nMEM_STATIC size_t   BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);\nMEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);\nMEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);\n\n\n/* Start by invoking BIT_initDStream().\n*  A chunk of the bitStream is then stored into a local register.\n*  Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).\n*  You can then retrieve bitFields stored into the local register, **in reverse order**.\n*  Local register is explicitly reloaded from memory by the BIT_reloadDStream() method.\n*  A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished.\n*  Otherwise, it can be less than that, so proceed accordingly.\n*  Checking if DStream has reached its end can be performed with BIT_endOfDStream().\n*/\n\n\n/*-****************************************\n*  unsafe API\n******************************************/\nMEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);\n/* faster, but works only if value is \"clean\", meaning all high bits above nbBits are 0 */\n\nMEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC);\n/* unsafe version; does not check buffer overflow */\n\nMEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);\n/* faster, but works only if nbBits >= 1 */\n\n\n\n/*-**************************************************************\n*  Internal functions\n****************************************************************/\nMEM_STATIC unsigned BIT_highbit32 (U32 val)\n{\n    assert(val != 0);\n    {\n#   if defined(_MSC_VER)   /* Visual */\n#       if STATIC_BMI2 == 1\n\t\treturn _lzcnt_u32(val) ^ 31;\n#       else\n\t\tunsigned long r = 0;\n\t\treturn _BitScanReverse(&r, val) ? (unsigned)r : 0;\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */\n        return __builtin_clz (val) ^ 31;\n#   elif defined(__ICCARM__)    /* IAR Intrinsic */\n        return 31 - __CLZ(val);\n#   else   /* Software version */\n        static const unsigned DeBruijnClz[32] = { 0,  9,  1, 10, 13, 21,  2, 29,\n                                                 11, 14, 16, 18, 22, 25,  3, 30,\n                                                  8, 12, 20, 28, 15, 17, 24,  7,\n                                                 19, 27, 23,  6, 26,  5,  4, 31 };\n        U32 v = val;\n        v |= v >> 1;\n        v |= v >> 2;\n        v |= v >> 4;\n        v |= v >> 8;\n        v |= v >> 16;\n        return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];\n#   endif\n    }\n}\n\n/*=====    Local Constants   =====*/\nstatic const unsigned BIT_mask[] = {\n    0,          1,         3,         7,         0xF,       0x1F,\n    0x3F,       0x7F,      0xFF,      0x1FF,     0x3FF,     0x7FF,\n    0xFFF,      0x1FFF,    0x3FFF,    0x7FFF,    0xFFFF,    0x1FFFF,\n    0x3FFFF,    0x7FFFF,   0xFFFFF,   0x1FFFFF,  0x3FFFFF,  0x7FFFFF,\n    0xFFFFFF,   0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,\n    0x3FFFFFFF, 0x7FFFFFFF}; /* up to 31 bits */\n#define BIT_MASK_SIZE (sizeof(BIT_mask) / sizeof(BIT_mask[0]))\n\n/*-**************************************************************\n*  bitStream encoding\n****************************************************************/\n/*! BIT_initCStream() :\n *  `dstCapacity` must be > sizeof(size_t)\n *  @return : 0 if success,\n *            otherwise an error code (can be tested using ERR_isError()) */\nMEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC,\n                                  void* startPtr, size_t dstCapacity)\n{\n    bitC->bitContainer = 0;\n    bitC->bitPos = 0;\n    bitC->startPtr = (char*)startPtr;\n    bitC->ptr = bitC->startPtr;\n    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);\n    if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall);\n    return 0;\n}\n\n/*! BIT_addBits() :\n *  can add up to 31 bits into `bitC`.\n *  Note : does not check for register overflow ! */\nMEM_STATIC void BIT_addBits(BIT_CStream_t* bitC,\n                            size_t value, unsigned nbBits)\n{\n    DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32);\n    assert(nbBits < BIT_MASK_SIZE);\n    assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;\n    bitC->bitPos += nbBits;\n}\n\n/*! BIT_addBitsFast() :\n *  works only if `value` is _clean_,\n *  meaning all high bits above nbBits are 0 */\nMEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC,\n                                size_t value, unsigned nbBits)\n{\n    assert((value>>nbBits) == 0);\n    assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    bitC->bitContainer |= value << bitC->bitPos;\n    bitC->bitPos += nbBits;\n}\n\n/*! BIT_flushBitsFast() :\n *  assumption : bitContainer has not overflowed\n *  unsafe version; does not check buffer overflow */\nMEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC)\n{\n    size_t const nbBytes = bitC->bitPos >> 3;\n    assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    assert(bitC->ptr <= bitC->endPtr);\n    MEM_writeLEST(bitC->ptr, bitC->bitContainer);\n    bitC->ptr += nbBytes;\n    bitC->bitPos &= 7;\n    bitC->bitContainer >>= nbBytes*8;\n}\n\n/*! BIT_flushBits() :\n *  assumption : bitContainer has not overflowed\n *  safe version; check for buffer overflow, and prevents it.\n *  note : does not signal buffer overflow.\n *  overflow will be revealed later on using BIT_closeCStream() */\nMEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC)\n{\n    size_t const nbBytes = bitC->bitPos >> 3;\n    assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    assert(bitC->ptr <= bitC->endPtr);\n    MEM_writeLEST(bitC->ptr, bitC->bitContainer);\n    bitC->ptr += nbBytes;\n    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;\n    bitC->bitPos &= 7;\n    bitC->bitContainer >>= nbBytes*8;\n}\n\n/*! BIT_closeCStream() :\n *  @return : size of CStream, in bytes,\n *            or 0 if it could not fit into dstBuffer */\nMEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC)\n{\n    BIT_addBitsFast(bitC, 1, 1);   /* endMark */\n    BIT_flushBits(bitC);\n    if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */\n    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);\n}\n\n\n/*-********************************************************\n*  bitStream decoding\n**********************************************************/\n/*! BIT_initDStream() :\n *  Initialize a BIT_DStream_t.\n * `bitD` : a pointer to an already allocated BIT_DStream_t structure.\n * `srcSize` must be the *exact* size of the bitStream, in bytes.\n * @return : size of stream (== srcSize), or an errorCode if a problem is detected\n */\nMEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)\n{\n    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }\n\n    bitD->start = (const char*)srcBuffer;\n    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);\n\n    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */\n        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);\n        bitD->bitContainer = MEM_readLEST(bitD->ptr);\n        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];\n          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */\n          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }\n    } else {\n        bitD->ptr   = bitD->start;\n        bitD->bitContainer = *(const BYTE*)(bitD->start);\n        switch(srcSize)\n        {\n        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);\n                /* fall-through */\n\n        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);\n                /* fall-through */\n\n        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);\n                /* fall-through */\n\n        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;\n                /* fall-through */\n\n        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;\n                /* fall-through */\n\n        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8;\n                /* fall-through */\n\n        default: break;\n        }\n        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];\n            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;\n            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */\n        }\n        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;\n    }\n\n    return srcSize;\n}\n\nMEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits(size_t bitContainer, U32 const start)\n{\n    return bitContainer >> start;\n}\n\nMEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)\n{\n    U32 const regMask = sizeof(bitContainer)*8 - 1;\n    /* if start > regMask, bitstream is corrupted, and result is undefined */\n    assert(nbBits < BIT_MASK_SIZE);\n    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];\n}\n\nMEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)\n{\n#if defined(STATIC_BMI2) && STATIC_BMI2 == 1\n\treturn  _bzhi_u64(bitContainer, nbBits);\n#else\n    assert(nbBits < BIT_MASK_SIZE);\n    return bitContainer & BIT_mask[nbBits];\n#endif\n}\n\n/*! BIT_lookBits() :\n *  Provides next n bits from local register.\n *  local register is not modified.\n *  On 32-bits, maxNbBits==24.\n *  On 64-bits, maxNbBits==56.\n * @return : value extracted */\nMEM_STATIC  FORCE_INLINE_ATTR size_t BIT_lookBits(const BIT_DStream_t*  bitD, U32 nbBits)\n{\n    /* arbitrate between double-shift and shift+mask */\n#if 1\n    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,\n     * bitstream is likely corrupted, and result is undefined */\n    return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);\n#else\n    /* this code path is slower on my os-x laptop */\n    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;\n    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);\n#endif\n}\n\n/*! BIT_lookBitsFast() :\n *  unsafe version; only works if nbBits >= 1 */\nMEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)\n{\n    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;\n    assert(nbBits >= 1);\n    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);\n}\n\nMEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)\n{\n    bitD->bitsConsumed += nbBits;\n}\n\n/*! BIT_readBits() :\n *  Read (consume) next n bits from local register and update.\n *  Pay attention to not read more than nbBits contained into local register.\n * @return : extracted value. */\nMEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits)\n{\n    size_t const value = BIT_lookBits(bitD, nbBits);\n    BIT_skipBits(bitD, nbBits);\n    return value;\n}\n\n/*! BIT_readBitsFast() :\n *  unsafe version; only works only if nbBits >= 1 */\nMEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits)\n{\n    size_t const value = BIT_lookBitsFast(bitD, nbBits);\n    assert(nbBits >= 1);\n    BIT_skipBits(bitD, nbBits);\n    return value;\n}\n\n/*! BIT_reloadDStreamFast() :\n *  Similar to BIT_reloadDStream(), but with two differences:\n *  1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold!\n *  2. Returns BIT_DStream_overflow when bitD->ptr < bitD->limitPtr, at this\n *     point you must use BIT_reloadDStream() to reload.\n */\nMEM_STATIC BIT_DStream_status BIT_reloadDStreamFast(BIT_DStream_t* bitD)\n{\n    if (UNLIKELY(bitD->ptr < bitD->limitPtr))\n        return BIT_DStream_overflow;\n    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);\n    bitD->ptr -= bitD->bitsConsumed >> 3;\n    bitD->bitsConsumed &= 7;\n    bitD->bitContainer = MEM_readLEST(bitD->ptr);\n    return BIT_DStream_unfinished;\n}\n\n/*! BIT_reloadDStream() :\n *  Refill `bitD` from buffer previously set in BIT_initDStream() .\n *  This function is safe, it guarantees it will not read beyond src buffer.\n * @return : status of `BIT_DStream_t` internal register.\n *           when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */\nMEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)\n{\n    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* overflow detected, like end of stream */\n        return BIT_DStream_overflow;\n\n    if (bitD->ptr >= bitD->limitPtr) {\n        return BIT_reloadDStreamFast(bitD);\n    }\n    if (bitD->ptr == bitD->start) {\n        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;\n        return BIT_DStream_completed;\n    }\n    /* start < ptr < limitPtr */\n    {   U32 nbBytes = bitD->bitsConsumed >> 3;\n        BIT_DStream_status result = BIT_DStream_unfinished;\n        if (bitD->ptr - nbBytes < bitD->start) {\n            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */\n            result = BIT_DStream_endOfBuffer;\n        }\n        bitD->ptr -= nbBytes;\n        bitD->bitsConsumed -= nbBytes*8;\n        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */\n        return result;\n    }\n}\n\n/*! BIT_endOfDStream() :\n * @return : 1 if DStream has _exactly_ reached its end (all bits consumed).\n */\nMEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)\n{\n    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));\n}\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* BITSTREAM_H_MODULE */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/compiler.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_COMPILER_H\n#define ZSTD_COMPILER_H\n\n/*-*******************************************************\n*  Compiler specifics\n*********************************************************/\n/* force inlining */\n\n#if !defined(ZSTD_NO_INLINE)\n#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L   /* C99 */\n#  define INLINE_KEYWORD inline\n#else\n#  define INLINE_KEYWORD\n#endif\n\n#if defined(__GNUC__) || defined(__ICCARM__)\n#  define FORCE_INLINE_ATTR __attribute__((always_inline))\n#elif defined(_MSC_VER)\n#  define FORCE_INLINE_ATTR __forceinline\n#else\n#  define FORCE_INLINE_ATTR\n#endif\n\n#else\n\n#define INLINE_KEYWORD\n#define FORCE_INLINE_ATTR\n\n#endif\n\n/**\n  On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC).\n  This explictly marks such functions as __cdecl so that the code will still compile\n  if a CC other than __cdecl has been made the default.\n*/\n#if  defined(_MSC_VER)\n#  define WIN_CDECL __cdecl\n#else\n#  define WIN_CDECL\n#endif\n\n/**\n * FORCE_INLINE_TEMPLATE is used to define C \"templates\", which take constant\n * parameters. They must be inlined for the compiler to eliminate the constant\n * branches.\n */\n#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR\n/**\n * HINT_INLINE is used to help the compiler generate better code. It is *not*\n * used for \"templates\", so it can be tweaked based on the compilers\n * performance.\n *\n * gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the\n * always_inline attribute.\n *\n * clang up to 5.0.0 (trunk) benefit tremendously from the always_inline\n * attribute.\n */\n#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5\n#  define HINT_INLINE static INLINE_KEYWORD\n#else\n#  define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR\n#endif\n\n/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */\n#if defined(__GNUC__)\n#  define UNUSED_ATTR __attribute__((unused))\n#else\n#  define UNUSED_ATTR\n#endif\n\n/* force no inlining */\n#ifdef _MSC_VER\n#  define FORCE_NOINLINE static __declspec(noinline)\n#else\n#  if defined(__GNUC__) || defined(__ICCARM__)\n#    define FORCE_NOINLINE static __attribute__((__noinline__))\n#  else\n#    define FORCE_NOINLINE static\n#  endif\n#endif\n\n/* target attribute */\n#ifndef __has_attribute\n  #define __has_attribute(x) 0  /* Compatibility with non-clang compilers. */\n#endif\n#if defined(__GNUC__) || defined(__ICCARM__)\n#  define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))\n#else\n#  define TARGET_ATTRIBUTE(target)\n#endif\n\n/* Enable runtime BMI2 dispatch based on the CPU.\n * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.\n */\n#ifndef DYNAMIC_BMI2\n  #if ((defined(__clang__) && __has_attribute(__target__)) \\\n      || (defined(__GNUC__) \\\n          && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \\\n      && (defined(__x86_64__) || defined(_M_X86)) \\\n      && !defined(__BMI2__)\n  #  define DYNAMIC_BMI2 1\n  #else\n  #  define DYNAMIC_BMI2 0\n  #endif\n#endif\n\n/* prefetch\n * can be disabled, by declaring NO_PREFETCH build macro */\n#if defined(NO_PREFETCH)\n#  define PREFETCH_L1(ptr)  (void)(ptr)  /* disabled */\n#  define PREFETCH_L2(ptr)  (void)(ptr)  /* disabled */\n#else\n#  if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))  /* _mm_prefetch() is not defined outside of x86/x64 */\n#    include <mmintrin.h>   /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */\n#    define PREFETCH_L1(ptr)  _mm_prefetch((const char*)(ptr), _MM_HINT_T0)\n#    define PREFETCH_L2(ptr)  _mm_prefetch((const char*)(ptr), _MM_HINT_T1)\n#  elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) )\n#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)\n#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)\n#  elif defined(__aarch64__)\n#    define PREFETCH_L1(ptr)  __asm__ __volatile__(\"prfm pldl1keep, %0\" ::\"Q\"(*(ptr)))\n#    define PREFETCH_L2(ptr)  __asm__ __volatile__(\"prfm pldl2keep, %0\" ::\"Q\"(*(ptr)))\n#  else\n#    define PREFETCH_L1(ptr) (void)(ptr)  /* disabled */\n#    define PREFETCH_L2(ptr) (void)(ptr)  /* disabled */\n#  endif\n#endif  /* NO_PREFETCH */\n\n#define CACHELINE_SIZE 64\n\n#define PREFETCH_AREA(p, s)  {            \\\n    const char* const _ptr = (const char*)(p);  \\\n    size_t const _size = (size_t)(s);     \\\n    size_t _pos;                          \\\n    for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) {  \\\n        PREFETCH_L2(_ptr + _pos);         \\\n    }                                     \\\n}\n\n/* vectorization\n * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */\n#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__)\n#  if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)\n#    define DONT_VECTORIZE __attribute__((optimize(\"no-tree-vectorize\")))\n#  else\n#    define DONT_VECTORIZE _Pragma(\"GCC optimize(\\\"no-tree-vectorize\\\")\")\n#  endif\n#else\n#  define DONT_VECTORIZE\n#endif\n\n/* Tell the compiler that a branch is likely or unlikely.\n * Only use these macros if it causes the compiler to generate better code.\n * If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc\n * and clang, please do.\n */\n#if defined(__GNUC__)\n#define LIKELY(x) (__builtin_expect((x), 1))\n#define UNLIKELY(x) (__builtin_expect((x), 0))\n#else\n#define LIKELY(x) (x)\n#define UNLIKELY(x) (x)\n#endif\n\n/* disable warnings */\n#ifdef _MSC_VER    /* Visual Studio */\n#  include <intrin.h>                    /* For Visual 2005 */\n#  pragma warning(disable : 4100)        /* disable: C4100: unreferenced formal parameter */\n#  pragma warning(disable : 4127)        /* disable: C4127: conditional expression is constant */\n#  pragma warning(disable : 4204)        /* disable: C4204: non-constant aggregate initializer */\n#  pragma warning(disable : 4214)        /* disable: C4214: non-int bitfields */\n#  pragma warning(disable : 4324)        /* disable: C4324: padded structure */\n#endif\n\n/*Like DYNAMIC_BMI2 but for compile time determination of BMI2 support*/\n#ifndef STATIC_BMI2\n#  if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))\n#    ifdef __AVX2__  //MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2\n#       define STATIC_BMI2 1\n#    endif\n#  endif\n#endif\n\n#ifndef STATIC_BMI2\n    #define STATIC_BMI2 0\n#endif\n\n/* compat. with non-clang compilers */\n#ifndef __has_builtin\n#  define __has_builtin(x) 0\n#endif\n\n/* compat. with non-clang compilers */\n#ifndef __has_feature\n#  define __has_feature(x) 0\n#endif\n\n/* detects whether we are being compiled under msan */\n#ifndef ZSTD_MEMORY_SANITIZER\n#  if __has_feature(memory_sanitizer)\n#    define ZSTD_MEMORY_SANITIZER 1\n#  else\n#    define ZSTD_MEMORY_SANITIZER 0\n#  endif\n#endif\n\n#if ZSTD_MEMORY_SANITIZER\n/* Not all platforms that support msan provide sanitizers/msan_interface.h.\n * We therefore declare the functions we need ourselves, rather than trying to\n * include the header file... */\n#include <stddef.h>  /* size_t */\n#define ZSTD_DEPS_NEED_STDINT\n#include \"zstd_deps.h\"  /* intptr_t */\n\n/* Make memory region fully initialized (without changing its contents). */\nvoid __msan_unpoison(const volatile void *a, size_t size);\n\n/* Make memory region fully uninitialized (without changing its contents).\n   This is a legacy interface that does not update origin information. Use\n   __msan_allocated_memory() instead. */\nvoid __msan_poison(const volatile void *a, size_t size);\n\n/* Returns the offset of the first (at least partially) poisoned byte in the\n   memory range, or -1 if the whole range is good. */\nintptr_t __msan_test_shadow(const volatile void *x, size_t size);\n#endif\n\n/* detects whether we are being compiled under asan */\n#ifndef ZSTD_ADDRESS_SANITIZER\n#  if __has_feature(address_sanitizer)\n#    define ZSTD_ADDRESS_SANITIZER 1\n#  elif defined(__SANITIZE_ADDRESS__)\n#    define ZSTD_ADDRESS_SANITIZER 1\n#  else\n#    define ZSTD_ADDRESS_SANITIZER 0\n#  endif\n#endif\n\n#if ZSTD_ADDRESS_SANITIZER\n/* Not all platforms that support asan provide sanitizers/asan_interface.h.\n * We therefore declare the functions we need ourselves, rather than trying to\n * include the header file... */\n#include <stddef.h>  /* size_t */\n\n/**\n * Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable.\n *\n * This memory must be previously allocated by your program. Instrumented\n * code is forbidden from accessing addresses in this region until it is\n * unpoisoned. This function is not guaranteed to poison the entire region -\n * it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan\n * alignment restrictions.\n *\n * \\note This function is not thread-safe because no two threads can poison or\n * unpoison memory in the same memory region simultaneously.\n *\n * \\param addr Start of memory region.\n * \\param size Size of memory region. */\nvoid __asan_poison_memory_region(void const volatile *addr, size_t size);\n\n/**\n * Marks a memory region (<c>[addr, addr+size)</c>) as addressable.\n *\n * This memory must be previously allocated by your program. Accessing\n * addresses in this region is allowed until this region is poisoned again.\n * This function could unpoison a super-region of <c>[addr, addr+size)</c> due\n * to ASan alignment restrictions.\n *\n * \\note This function is not thread-safe because no two threads can\n * poison or unpoison memory in the same memory region simultaneously.\n *\n * \\param addr Start of memory region.\n * \\param size Size of memory region. */\nvoid __asan_unpoison_memory_region(void const volatile *addr, size_t size);\n#endif\n\n#endif /* ZSTD_COMPILER_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/cpu.h",
    "content": "/*\n * Copyright (c) 2018-2020, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_COMMON_CPU_H\n#define ZSTD_COMMON_CPU_H\n\n/**\n * Implementation taken from folly/CpuId.h\n * https://github.com/facebook/folly/blob/master/folly/CpuId.h\n */\n\n#include \"mem.h\"\n\n#ifdef _MSC_VER\n#include <intrin.h>\n#endif\n\ntypedef struct {\n    U32 f1c;\n    U32 f1d;\n    U32 f7b;\n    U32 f7c;\n} ZSTD_cpuid_t;\n\nMEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {\n    U32 f1c = 0;\n    U32 f1d = 0;\n    U32 f7b = 0;\n    U32 f7c = 0;\n#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))\n    int reg[4];\n    __cpuid((int*)reg, 0);\n    {\n        int const n = reg[0];\n        if (n >= 1) {\n            __cpuid((int*)reg, 1);\n            f1c = (U32)reg[2];\n            f1d = (U32)reg[3];\n        }\n        if (n >= 7) {\n            __cpuidex((int*)reg, 7, 0);\n            f7b = (U32)reg[1];\n            f7c = (U32)reg[2];\n        }\n    }\n#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__)\n    /* The following block like the normal cpuid branch below, but gcc\n     * reserves ebx for use of its pic register so we must specially\n     * handle the save and restore to avoid clobbering the register\n     */\n    U32 n;\n    __asm__(\n        \"pushl %%ebx\\n\\t\"\n        \"cpuid\\n\\t\"\n        \"popl %%ebx\\n\\t\"\n        : \"=a\"(n)\n        : \"a\"(0)\n        : \"ecx\", \"edx\");\n    if (n >= 1) {\n      U32 f1a;\n      __asm__(\n          \"pushl %%ebx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"popl %%ebx\\n\\t\"\n          : \"=a\"(f1a), \"=c\"(f1c), \"=d\"(f1d)\n          : \"a\"(1));\n    }\n    if (n >= 7) {\n      __asm__(\n          \"pushl %%ebx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"movl %%ebx, %%eax\\n\\t\"\n          \"popl %%ebx\"\n          : \"=a\"(f7b), \"=c\"(f7c)\n          : \"a\"(7), \"c\"(0)\n          : \"edx\");\n    }\n#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__)\n    U32 n;\n    __asm__(\"cpuid\" : \"=a\"(n) : \"a\"(0) : \"ebx\", \"ecx\", \"edx\");\n    if (n >= 1) {\n      U32 f1a;\n      __asm__(\"cpuid\" : \"=a\"(f1a), \"=c\"(f1c), \"=d\"(f1d) : \"a\"(1) : \"ebx\");\n    }\n    if (n >= 7) {\n      U32 f7a;\n      __asm__(\"cpuid\"\n              : \"=a\"(f7a), \"=b\"(f7b), \"=c\"(f7c)\n              : \"a\"(7), \"c\"(0)\n              : \"edx\");\n    }\n#endif\n    {\n        ZSTD_cpuid_t cpuid;\n        cpuid.f1c = f1c;\n        cpuid.f1d = f1d;\n        cpuid.f7b = f7b;\n        cpuid.f7c = f7c;\n        return cpuid;\n    }\n}\n\n#define X(name, r, bit)                                                        \\\n  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \\\n    return ((cpuid.r) & (1U << bit)) != 0;                                     \\\n  }\n\n/* cpuid(1): Processor Info and Feature Bits. */\n#define C(name, bit) X(name, f1c, bit)\n  C(sse3, 0)\n  C(pclmuldq, 1)\n  C(dtes64, 2)\n  C(monitor, 3)\n  C(dscpl, 4)\n  C(vmx, 5)\n  C(smx, 6)\n  C(eist, 7)\n  C(tm2, 8)\n  C(ssse3, 9)\n  C(cnxtid, 10)\n  C(fma, 12)\n  C(cx16, 13)\n  C(xtpr, 14)\n  C(pdcm, 15)\n  C(pcid, 17)\n  C(dca, 18)\n  C(sse41, 19)\n  C(sse42, 20)\n  C(x2apic, 21)\n  C(movbe, 22)\n  C(popcnt, 23)\n  C(tscdeadline, 24)\n  C(aes, 25)\n  C(xsave, 26)\n  C(osxsave, 27)\n  C(avx, 28)\n  C(f16c, 29)\n  C(rdrand, 30)\n#undef C\n#define D(name, bit) X(name, f1d, bit)\n  D(fpu, 0)\n  D(vme, 1)\n  D(de, 2)\n  D(pse, 3)\n  D(tsc, 4)\n  D(msr, 5)\n  D(pae, 6)\n  D(mce, 7)\n  D(cx8, 8)\n  D(apic, 9)\n  D(sep, 11)\n  D(mtrr, 12)\n  D(pge, 13)\n  D(mca, 14)\n  D(cmov, 15)\n  D(pat, 16)\n  D(pse36, 17)\n  D(psn, 18)\n  D(clfsh, 19)\n  D(ds, 21)\n  D(acpi, 22)\n  D(mmx, 23)\n  D(fxsr, 24)\n  D(sse, 25)\n  D(sse2, 26)\n  D(ss, 27)\n  D(htt, 28)\n  D(tm, 29)\n  D(pbe, 31)\n#undef D\n\n/* cpuid(7): Extended Features. */\n#define B(name, bit) X(name, f7b, bit)\n  B(bmi1, 3)\n  B(hle, 4)\n  B(avx2, 5)\n  B(smep, 7)\n  B(bmi2, 8)\n  B(erms, 9)\n  B(invpcid, 10)\n  B(rtm, 11)\n  B(mpx, 14)\n  B(avx512f, 16)\n  B(avx512dq, 17)\n  B(rdseed, 18)\n  B(adx, 19)\n  B(smap, 20)\n  B(avx512ifma, 21)\n  B(pcommit, 22)\n  B(clflushopt, 23)\n  B(clwb, 24)\n  B(avx512pf, 26)\n  B(avx512er, 27)\n  B(avx512cd, 28)\n  B(sha, 29)\n  B(avx512bw, 30)\n  B(avx512vl, 31)\n#undef B\n#define C(name, bit) X(name, f7c, bit)\n  C(prefetchwt1, 0)\n  C(avx512vbmi, 1)\n#undef C\n\n#undef X\n\n#endif /* ZSTD_COMMON_CPU_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/debug.h",
    "content": "/* ******************************************************************\n * debug\n * Part of FSE library\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n\n/*\n * The purpose of this header is to enable debug functions.\n * They regroup assert(), DEBUGLOG() and RAWLOG() for run-time,\n * and DEBUG_STATIC_ASSERT() for compile-time.\n *\n * By default, DEBUGLEVEL==0, which means run-time debug is disabled.\n *\n * Level 1 enables assert() only.\n * Starting level 2, traces can be generated and pushed to stderr.\n * The higher the level, the more verbose the traces.\n *\n * It's possible to dynamically adjust level using variable g_debug_level,\n * which is only declared if DEBUGLEVEL>=2,\n * and is a global variable, not multi-thread protected (use with care)\n */\n\n#ifndef DEBUG_H_12987983217\n#define DEBUG_H_12987983217\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n\n/* static assert is triggered at compile time, leaving no runtime artefact.\n * static assert only works with compile-time constants.\n * Also, this variant can only be used inside a function. */\n#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])\n\n\n/* DEBUGLEVEL is expected to be defined externally,\n * typically through compiler command line.\n * Value must be a number. */\n#ifndef DEBUGLEVEL\n#  define DEBUGLEVEL 0\n#endif\n\n\n/* recommended values for DEBUGLEVEL :\n * 0 : release mode, no debug, all run-time checks disabled\n * 1 : enables assert() only, no display\n * 2 : reserved, for currently active debug path\n * 3 : events once per object lifetime (CCtx, CDict, etc.)\n * 4 : events once per frame\n * 5 : events once per block\n * 6 : events once per sequence (verbose)\n * 7+: events at every position (*very* verbose)\n *\n * It's generally inconvenient to output traces > 5.\n * In which case, it's possible to selectively trigger high verbosity levels\n * by modifying g_debug_level.\n */\n\n#if (DEBUGLEVEL>=1)\n#  define ZSTD_DEPS_NEED_ASSERT\n#  include \"zstd_deps.h\"\n#else\n#  ifndef assert   /* assert may be already defined, due to prior #include <assert.h> */\n#    define assert(condition) ((void)0)   /* disable assert (default) */\n#  endif\n#endif\n\n#if (DEBUGLEVEL>=2)\n#  define ZSTD_DEPS_NEED_IO\n#  include \"zstd_deps.h\"\nextern int g_debuglevel; /* the variable is only declared,\n                            it actually lives in debug.c,\n                            and is shared by the whole process.\n                            It's not thread-safe.\n                            It's useful when enabling very verbose levels\n                            on selective conditions (such as position in src) */\n\n#  define RAWLOG(l, ...) {                                       \\\n                if (l<=g_debuglevel) {                           \\\n                    ZSTD_DEBUG_PRINT(__VA_ARGS__);               \\\n            }   }\n#  define DEBUGLOG(l, ...) {                                     \\\n                if (l<=g_debuglevel) {                           \\\n                    ZSTD_DEBUG_PRINT(__FILE__ \": \" __VA_ARGS__); \\\n                    ZSTD_DEBUG_PRINT(\" \\n\");                     \\\n            }   }\n#else\n#  define RAWLOG(l, ...)      {}    /* disabled */\n#  define DEBUGLOG(l, ...)    {}    /* disabled */\n#endif\n\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* DEBUG_H_12987983217 */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/entropy_common.c",
    "content": "/* ******************************************************************\n * Common functions of New Generation Entropy library\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n *\n *  You can contact the author at :\n *  - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *  - Public forum : https://groups.google.com/forum/#!forum/lz4c\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n/* *************************************\n*  Dependencies\n***************************************/\n#include \"mem.h\"\n#include \"error_private.h\"       /* ERR_*, ERROR */\n#define FSE_STATIC_LINKING_ONLY  /* FSE_MIN_TABLELOG */\n#include \"fse.h\"\n#define HUF_STATIC_LINKING_ONLY  /* HUF_TABLELOG_ABSOLUTEMAX */\n#include \"huf.h\"\n\n\n/*===   Version   ===*/\nunsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; }\n\n\n/*===   Error Management   ===*/\nconst char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\nconst char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\n\n/*-**************************************************************\n*  FSE NCount encoding-decoding\n****************************************************************/\nstatic U32 FSE_ctz(U32 val)\n{\n    assert(val != 0);\n    {\n#   if defined(_MSC_VER)   /* Visual */\n        unsigned long r=0;\n        return _BitScanForward(&r, val) ? (unsigned)r : 0;\n#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* GCC Intrinsic */\n        return __builtin_ctz(val);\n#   elif defined(__ICCARM__)    /* IAR Intrinsic */\n        return __CTZ(val);\n#   else   /* Software version */\n        U32 count = 0;\n        while ((val & 1) == 0) {\n            val >>= 1;\n            ++count;\n        }\n        return count;\n#   endif\n    }\n}\n\nFORCE_INLINE_TEMPLATE\nsize_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n                           const void* headerBuffer, size_t hbSize)\n{\n    const BYTE* const istart = (const BYTE*) headerBuffer;\n    const BYTE* const iend = istart + hbSize;\n    const BYTE* ip = istart;\n    int nbBits;\n    int remaining;\n    int threshold;\n    U32 bitStream;\n    int bitCount;\n    unsigned charnum = 0;\n    unsigned const maxSV1 = *maxSVPtr + 1;\n    int previous0 = 0;\n\n    if (hbSize < 8) {\n        /* This function only works when hbSize >= 8 */\n        char buffer[8] = {0};\n        ZSTD_memcpy(buffer, headerBuffer, hbSize);\n        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,\n                                                    buffer, sizeof(buffer));\n            if (FSE_isError(countSize)) return countSize;\n            if (countSize > hbSize) return ERROR(corruption_detected);\n            return countSize;\n    }   }\n    assert(hbSize >= 8);\n\n    /* init */\n    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */\n    bitStream = MEM_readLE32(ip);\n    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */\n    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);\n    bitStream >>= 4;\n    bitCount = 4;\n    *tableLogPtr = nbBits;\n    remaining = (1<<nbBits)+1;\n    threshold = 1<<nbBits;\n    nbBits++;\n\n    for (;;) {\n        if (previous0) {\n            /* Count the number of repeats. Each time the\n             * 2-bit repeat code is 0b11 there is another\n             * repeat.\n             * Avoid UB by setting the high bit to 1.\n             */\n            int repeats = FSE_ctz(~bitStream | 0x80000000) >> 1;\n            while (repeats >= 12) {\n                charnum += 3 * 12;\n                if (LIKELY(ip <= iend-7)) {\n                    ip += 3;\n                } else {\n                    bitCount -= (int)(8 * (iend - 7 - ip));\n                    bitCount &= 31;\n                    ip = iend - 4;\n                }\n                bitStream = MEM_readLE32(ip) >> bitCount;\n                repeats = FSE_ctz(~bitStream | 0x80000000) >> 1;\n            }\n            charnum += 3 * repeats;\n            bitStream >>= 2 * repeats;\n            bitCount += 2 * repeats;\n\n            /* Add the final repeat which isn't 0b11. */\n            assert((bitStream & 3) < 3);\n            charnum += bitStream & 3;\n            bitCount += 2;\n\n            /* This is an error, but break and return an error\n             * at the end, because returning out of a loop makes\n             * it harder for the compiler to optimize.\n             */\n            if (charnum >= maxSV1) break;\n\n            /* We don't need to set the normalized count to 0\n             * because we already memset the whole buffer to 0.\n             */\n\n            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {\n                assert((bitCount >> 3) <= 3); /* For first condition to work */\n                ip += bitCount>>3;\n                bitCount &= 7;\n            } else {\n                bitCount -= (int)(8 * (iend - 4 - ip));\n                bitCount &= 31;\n                ip = iend - 4;\n            }\n            bitStream = MEM_readLE32(ip) >> bitCount;\n        }\n        {\n            int const max = (2*threshold-1) - remaining;\n            int count;\n\n            if ((bitStream & (threshold-1)) < (U32)max) {\n                count = bitStream & (threshold-1);\n                bitCount += nbBits-1;\n            } else {\n                count = bitStream & (2*threshold-1);\n                if (count >= threshold) count -= max;\n                bitCount += nbBits;\n            }\n\n            count--;   /* extra accuracy */\n            /* When it matters (small blocks), this is a\n             * predictable branch, because we don't use -1.\n             */\n            if (count >= 0) {\n                remaining -= count;\n            } else {\n                assert(count == -1);\n                remaining += count;\n            }\n            normalizedCounter[charnum++] = (short)count;\n            previous0 = !count;\n\n            assert(threshold > 1);\n            if (remaining < threshold) {\n                /* This branch can be folded into the\n                 * threshold update condition because we\n                 * know that threshold > 1.\n                 */\n                if (remaining <= 1) break;\n                nbBits = BIT_highbit32(remaining) + 1;\n                threshold = 1 << (nbBits - 1);\n            }\n            if (charnum >= maxSV1) break;\n\n            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {\n                ip += bitCount>>3;\n                bitCount &= 7;\n            } else {\n                bitCount -= (int)(8 * (iend - 4 - ip));\n                bitCount &= 31;\n                ip = iend - 4;\n            }\n            bitStream = MEM_readLE32(ip) >> bitCount;\n    }   }\n    if (remaining != 1) return ERROR(corruption_detected);\n    /* Only possible when there are too many zeros. */\n    if (charnum > maxSV1) return ERROR(maxSymbolValue_tooSmall);\n    if (bitCount > 32) return ERROR(corruption_detected);\n    *maxSVPtr = charnum-1;\n\n    ip += (bitCount+7)>>3;\n    return ip-istart;\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t FSE_readNCount_body_default(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n\n#if DYNAMIC_BMI2\nTARGET_ATTRIBUTE(\"bmi2\") static size_t FSE_readNCount_body_bmi2(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n#endif\n\nsize_t FSE_readNCount_bmi2(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n    }\n#endif\n    (void)bmi2;\n    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n\nsize_t FSE_readNCount(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);\n}\n\n\n/*! HUF_readStats() :\n    Read compact Huffman tree, saved by HUF_writeCTable().\n    `huffWeight` is destination buffer.\n    `rankStats` is assumed to be a table of at least HUF_TABLELOG_MAX U32.\n    @return : size read from `src` , or an error Code .\n    Note : Needed by HUF_readCTable() and HUF_readDTableX?() .\n*/\nsize_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize)\n{\n    U32 wksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];\n    return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* bmi2 */ 0);\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_readStats_body(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                   U32* nbSymbolsPtr, U32* tableLogPtr,\n                   const void* src, size_t srcSize,\n                   void* workSpace, size_t wkspSize,\n                   int bmi2)\n{\n    U32 weightTotal;\n    const BYTE* ip = (const BYTE*) src;\n    size_t iSize;\n    size_t oSize;\n\n    if (!srcSize) return ERROR(srcSize_wrong);\n    iSize = ip[0];\n    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */\n\n    if (iSize >= 128) {  /* special header */\n        oSize = iSize - 127;\n        iSize = ((oSize+1)/2);\n        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);\n        if (oSize >= hwSize) return ERROR(corruption_detected);\n        ip += 1;\n        {   U32 n;\n            for (n=0; n<oSize; n+=2) {\n                huffWeight[n]   = ip[n/2] >> 4;\n                huffWeight[n+1] = ip[n/2] & 15;\n    }   }   }\n    else  {   /* header compressed with FSE (normal case) */\n        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);\n        /* max (hwSize-1) values decoded, as last one is implied */\n        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);\n        if (FSE_isError(oSize)) return oSize;\n    }\n\n    /* collect weight stats */\n    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));\n    weightTotal = 0;\n    {   U32 n; for (n=0; n<oSize; n++) {\n            if (huffWeight[n] >= HUF_TABLELOG_MAX) return ERROR(corruption_detected);\n            rankStats[huffWeight[n]]++;\n            weightTotal += (1 << huffWeight[n]) >> 1;\n    }   }\n    if (weightTotal == 0) return ERROR(corruption_detected);\n\n    /* get last non-null symbol weight (implied, total must be 2^n) */\n    {   U32 const tableLog = BIT_highbit32(weightTotal) + 1;\n        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);\n        *tableLogPtr = tableLog;\n        /* determine last weight */\n        {   U32 const total = 1 << tableLog;\n            U32 const rest = total - weightTotal;\n            U32 const verif = 1 << BIT_highbit32(rest);\n            U32 const lastWeight = BIT_highbit32(rest) + 1;\n            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */\n            huffWeight[oSize] = (BYTE)lastWeight;\n            rankStats[lastWeight]++;\n    }   }\n\n    /* check tree construction validity */\n    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */\n\n    /* results */\n    *nbSymbolsPtr = (U32)(oSize+1);\n    return iSize+1;\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t HUF_readStats_body_default(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize)\n{\n    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);\n}\n\n#if DYNAMIC_BMI2\nstatic TARGET_ATTRIBUTE(\"bmi2\") size_t HUF_readStats_body_bmi2(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize)\n{\n    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);\n}\n#endif\n\nsize_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize,\n                     int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);\n    }\n#endif\n    (void)bmi2;\n    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/error_private.c",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* The purpose of this file is to have a single list of error strings embedded in binary */\n\n#include \"error_private.h\"\n\nconst char* ERR_getErrorString(ERR_enum code)\n{\n#ifdef ZSTD_STRIP_ERROR_STRINGS\n    (void)code;\n    return \"Error strings stripped\";\n#else\n    static const char* const notErrorCode = \"Unspecified error code\";\n    switch( code )\n    {\n    case PREFIX(no_error): return \"No error detected\";\n    case PREFIX(GENERIC):  return \"Error (generic)\";\n    case PREFIX(prefix_unknown): return \"Unknown frame descriptor\";\n    case PREFIX(version_unsupported): return \"Version not supported\";\n    case PREFIX(frameParameter_unsupported): return \"Unsupported frame parameter\";\n    case PREFIX(frameParameter_windowTooLarge): return \"Frame requires too much memory for decoding\";\n    case PREFIX(corruption_detected): return \"Corrupted block detected\";\n    case PREFIX(checksum_wrong): return \"Restored data doesn't match checksum\";\n    case PREFIX(parameter_unsupported): return \"Unsupported parameter\";\n    case PREFIX(parameter_outOfBound): return \"Parameter is out of bound\";\n    case PREFIX(init_missing): return \"Context should be init first\";\n    case PREFIX(memory_allocation): return \"Allocation error : not enough memory\";\n    case PREFIX(workSpace_tooSmall): return \"workSpace buffer is not large enough\";\n    case PREFIX(stage_wrong): return \"Operation not authorized at current processing stage\";\n    case PREFIX(tableLog_tooLarge): return \"tableLog requires too much memory : unsupported\";\n    case PREFIX(maxSymbolValue_tooLarge): return \"Unsupported max Symbol Value : too large\";\n    case PREFIX(maxSymbolValue_tooSmall): return \"Specified maxSymbolValue is too small\";\n    case PREFIX(dictionary_corrupted): return \"Dictionary is corrupted\";\n    case PREFIX(dictionary_wrong): return \"Dictionary mismatch\";\n    case PREFIX(dictionaryCreation_failed): return \"Cannot create Dictionary from provided samples\";\n    case PREFIX(dstSize_tooSmall): return \"Destination buffer is too small\";\n    case PREFIX(srcSize_wrong): return \"Src size is incorrect\";\n    case PREFIX(dstBuffer_null): return \"Operation on NULL destination buffer\";\n        /* following error codes are not stable and may be removed or changed in a future version */\n    case PREFIX(frameIndex_tooLarge): return \"Frame index is too large\";\n    case PREFIX(seekableIO): return \"An I/O error occurred when reading/seeking\";\n    case PREFIX(dstBuffer_wrong): return \"Destination buffer is wrong\";\n    case PREFIX(srcBuffer_wrong): return \"Source buffer is wrong\";\n    case PREFIX(maxCode):\n    default: return notErrorCode;\n    }\n#endif\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/error_private.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* Note : this module is expected to remain private, do not expose it */\n\n#ifndef ERROR_H_MODULE\n#define ERROR_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n\n/* ****************************************\n*  Dependencies\n******************************************/\n#include \"zstd_deps.h\"    /* size_t */\n#include \"zstd_errors.h\"  /* enum list */\n\n\n/* ****************************************\n*  Compiler-specific\n******************************************/\n#if defined(__GNUC__)\n#  define ERR_STATIC static __attribute__((unused))\n#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#  define ERR_STATIC static inline\n#elif defined(_MSC_VER)\n#  define ERR_STATIC static __inline\n#else\n#  define ERR_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */\n#endif\n\n\n/*-****************************************\n*  Customization (error_public.h)\n******************************************/\ntypedef ZSTD_ErrorCode ERR_enum;\n#define PREFIX(name) ZSTD_error_##name\n\n\n/*-****************************************\n*  Error codes handling\n******************************************/\n#undef ERROR   /* already defined on Visual Studio */\n#define ERROR(name) ZSTD_ERROR(name)\n#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))\n\nERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }\n\nERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }\n\n/* check and forward error code */\n#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return e\n#define CHECK_F(f)   { CHECK_V_F(_var_err__, f); }\n\n\n/*-****************************************\n*  Error Strings\n******************************************/\n\nconst char* ERR_getErrorString(ERR_enum code);   /* error_private.c */\n\nERR_STATIC const char* ERR_getErrorName(size_t code)\n{\n    return ERR_getErrorString(ERR_getErrorCode(code));\n}\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* ERROR_H_MODULE */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/fse.h",
    "content": "/* ******************************************************************\n * FSE : Finite State Entropy codec\n * Public Prototypes declaration\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef FSE_H\n#define FSE_H\n\n\n/*-*****************************************\n*  Dependencies\n******************************************/\n#include \"zstd_deps.h\"    /* size_t, ptrdiff_t */\n\n\n/*-*****************************************\n*  FSE_PUBLIC_API : control library symbols visibility\n******************************************/\n#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)\n#  define FSE_PUBLIC_API __attribute__ ((visibility (\"default\")))\n#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1)   /* Visual expected */\n#  define FSE_PUBLIC_API __declspec(dllexport)\n#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)\n#  define FSE_PUBLIC_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define FSE_PUBLIC_API\n#endif\n\n/*------   Version   ------*/\n#define FSE_VERSION_MAJOR    0\n#define FSE_VERSION_MINOR    9\n#define FSE_VERSION_RELEASE  0\n\n#define FSE_LIB_VERSION FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE\n#define FSE_QUOTE(str) #str\n#define FSE_EXPAND_AND_QUOTE(str) FSE_QUOTE(str)\n#define FSE_VERSION_STRING FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)\n\n#define FSE_VERSION_NUMBER  (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)\nFSE_PUBLIC_API unsigned FSE_versionNumber(void);   /**< library version number; to be used when checking dll version */\n\n\n/*-****************************************\n*  FSE simple functions\n******************************************/\n/*! FSE_compress() :\n    Compress content of buffer 'src', of size 'srcSize', into destination buffer 'dst'.\n    'dst' buffer must be already allocated. Compression runs faster is dstCapacity >= FSE_compressBound(srcSize).\n    @return : size of compressed data (<= dstCapacity).\n    Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!!\n                     if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression instead.\n                     if FSE_isError(return), compression failed (more details using FSE_getErrorName())\n*/\nFSE_PUBLIC_API size_t FSE_compress(void* dst, size_t dstCapacity,\n                             const void* src, size_t srcSize);\n\n/*! FSE_decompress():\n    Decompress FSE data from buffer 'cSrc', of size 'cSrcSize',\n    into already allocated destination buffer 'dst', of size 'dstCapacity'.\n    @return : size of regenerated data (<= maxDstSize),\n              or an error code, which can be tested using FSE_isError() .\n\n    ** Important ** : FSE_decompress() does not decompress non-compressible nor RLE data !!!\n    Why ? : making this distinction requires a header.\n    Header management is intentionally delegated to the user layer, which can better manage special cases.\n*/\nFSE_PUBLIC_API size_t FSE_decompress(void* dst,  size_t dstCapacity,\n                               const void* cSrc, size_t cSrcSize);\n\n\n/*-*****************************************\n*  Tool functions\n******************************************/\nFSE_PUBLIC_API size_t FSE_compressBound(size_t size);       /* maximum compressed size */\n\n/* Error Management */\nFSE_PUBLIC_API unsigned    FSE_isError(size_t code);        /* tells if a return value is an error code */\nFSE_PUBLIC_API const char* FSE_getErrorName(size_t code);   /* provides error code string (useful for debugging) */\n\n\n/*-*****************************************\n*  FSE advanced functions\n******************************************/\n/*! FSE_compress2() :\n    Same as FSE_compress(), but allows the selection of 'maxSymbolValue' and 'tableLog'\n    Both parameters can be defined as '0' to mean : use default value\n    @return : size of compressed data\n    Special values : if return == 0, srcData is not compressible => Nothing is stored within cSrc !!!\n                     if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression.\n                     if FSE_isError(return), it's an error code.\n*/\nFSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);\n\n\n/*-*****************************************\n*  FSE detailed API\n******************************************/\n/*!\nFSE_compress() does the following:\n1. count symbol occurrence from source[] into table count[] (see hist.h)\n2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog)\n3. save normalized counters to memory buffer using writeNCount()\n4. build encoding table 'CTable' from normalized counters\n5. encode the data stream using encoding table 'CTable'\n\nFSE_decompress() does the following:\n1. read normalized counters with readNCount()\n2. build decoding table 'DTable' from normalized counters\n3. decode the data stream using decoding table 'DTable'\n\nThe following API allows targeting specific sub-functions for advanced tasks.\nFor example, it's possible to compress several blocks using the same 'CTable',\nor to save and provide normalized distribution using external method.\n*/\n\n/* *** COMPRESSION *** */\n\n/*! FSE_optimalTableLog():\n    dynamically downsize 'tableLog' when conditions are met.\n    It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.\n    @return : recommended tableLog (necessarily <= 'maxTableLog') */\nFSE_PUBLIC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);\n\n/*! FSE_normalizeCount():\n    normalize counts so that sum(count[]) == Power_of_2 (2^tableLog)\n    'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1).\n    useLowProbCount is a boolean parameter which trades off compressed size for\n    faster header decoding. When it is set to 1, the compressed data will be slightly\n    smaller. And when it is set to 0, FSE_readNCount() and FSE_buildDTable() will be\n    faster. If you are compressing a small amount of data (< 2 KB) then useLowProbCount=0\n    is a good default, since header deserialization makes a big speed difference.\n    Otherwise, useLowProbCount=1 is a good default, since the speed difference is small.\n    @return : tableLog,\n              or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,\n                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue, unsigned useLowProbCount);\n\n/*! FSE_NCountWriteBound():\n    Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'.\n    Typically useful for allocation purpose. */\nFSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);\n\n/*! FSE_writeNCount():\n    Compactly save 'normalizedCounter' into 'buffer'.\n    @return : size of the compressed table,\n              or an errorCode, which can be tested using FSE_isError(). */\nFSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize,\n                                 const short* normalizedCounter,\n                                 unsigned maxSymbolValue, unsigned tableLog);\n\n/*! Constructor and Destructor of FSE_CTable.\n    Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */\ntypedef unsigned FSE_CTable;   /* don't allocate that. It's only meant to be more restrictive than void* */\nFSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);\nFSE_PUBLIC_API void        FSE_freeCTable (FSE_CTable* ct);\n\n/*! FSE_buildCTable():\n    Builds `ct`, which must be already allocated, using FSE_createCTable().\n    @return : 0, or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);\n\n/*! FSE_compress_usingCTable():\n    Compress `src` using `ct` into `dst` which must be already allocated.\n    @return : size of compressed data (<= `dstCapacity`),\n              or 0 if compressed data could not fit into `dst`,\n              or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);\n\n/*!\nTutorial :\n----------\nThe first step is to count all symbols. FSE_count() does this job very fast.\nResult will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells.\n'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0]\nmaxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value)\nFSE_count() will return the number of occurrence of the most frequent symbol.\nThis can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).\n\nThe next step is to normalize the frequencies.\nFSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'.\nIt also guarantees a minimum of 1 to any Symbol with frequency >= 1.\nYou can use 'tableLog'==0 to mean \"use default tableLog value\".\nIf you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(),\nwhich will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means \"default\").\n\nThe result of FSE_normalizeCount() will be saved into a table,\ncalled 'normalizedCounter', which is a table of signed short.\n'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells.\nThe return value is tableLog if everything proceeded as expected.\nIt is 0 if there is a single symbol within distribution.\nIf there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()).\n\n'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount().\n'buffer' must be already allocated.\nFor guaranteed success, buffer size must be at least FSE_headerBound().\nThe result of the function is the number of bytes written into 'buffer'.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small).\n\n'normalizedCounter' can then be used to create the compression table 'CTable'.\nThe space required by 'CTable' must be already allocated, using FSE_createCTable().\nYou can then use FSE_buildCTable() to fill 'CTable'.\nIf there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()).\n\n'CTable' can then be used to compress 'src', with FSE_compress_usingCTable().\nSimilar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize'\nThe function returns the size of compressed data (without header), necessarily <= `dstCapacity`.\nIf it returns '0', compressed data could not fit into 'dst'.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).\n*/\n\n\n/* *** DECOMPRESSION *** */\n\n/*! FSE_readNCount():\n    Read compactly saved 'normalizedCounter' from 'rBuffer'.\n    @return : size read from 'rBuffer',\n              or an errorCode, which can be tested using FSE_isError().\n              maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */\nFSE_PUBLIC_API size_t FSE_readNCount (short* normalizedCounter,\n                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,\n                           const void* rBuffer, size_t rBuffSize);\n\n/*! FSE_readNCount_bmi2():\n * Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise.\n */\nFSE_PUBLIC_API size_t FSE_readNCount_bmi2(short* normalizedCounter,\n                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,\n                           const void* rBuffer, size_t rBuffSize, int bmi2);\n\n/*! Constructor and Destructor of FSE_DTable.\n    Note that its size depends on 'tableLog' */\ntypedef unsigned FSE_DTable;   /* don't allocate that. It's just a way to be more restrictive than void* */\nFSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog);\nFSE_PUBLIC_API void        FSE_freeDTable(FSE_DTable* dt);\n\n/*! FSE_buildDTable():\n    Builds 'dt', which must be already allocated, using FSE_createDTable().\n    return : 0, or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);\n\n/*! FSE_decompress_usingDTable():\n    Decompress compressed source `cSrc` of size `cSrcSize` using `dt`\n    into `dst` which must be already allocated.\n    @return : size of regenerated data (necessarily <= `dstCapacity`),\n              or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);\n\n/*!\nTutorial :\n----------\n(Note : these functions only decompress FSE-compressed blocks.\n If block is uncompressed, use memcpy() instead\n If block is a single repeated byte, use memset() instead )\n\nThe first step is to obtain the normalized frequencies of symbols.\nThis can be performed by FSE_readNCount() if it was saved using FSE_writeNCount().\n'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short.\nIn practice, that means it's necessary to know 'maxSymbolValue' beforehand,\nor size the table to handle worst case situations (typically 256).\nFSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'.\nThe result of FSE_readNCount() is the number of bytes read from 'rBuffer'.\nNote that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that.\nIf there is an error, the function will return an error code, which can be tested using FSE_isError().\n\nThe next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'.\nThis is performed by the function FSE_buildDTable().\nThe space required by 'FSE_DTable' must be already allocated using FSE_createDTable().\nIf there is an error, the function will return an error code, which can be tested using FSE_isError().\n\n`FSE_DTable` can then be used to decompress `cSrc`, with FSE_decompress_usingDTable().\n`cSrcSize` must be strictly correct, otherwise decompression will fail.\nFSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=`dstCapacity`).\nIf there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small)\n*/\n\n#endif  /* FSE_H */\n\n#if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY)\n#define FSE_H_FSE_STATIC_LINKING_ONLY\n\n/* *** Dependency *** */\n#include \"bitstream.h\"\n\n\n/* *****************************************\n*  Static allocation\n*******************************************/\n/* FSE buffer bounds */\n#define FSE_NCOUNTBOUND 512\n#define FSE_BLOCKBOUND(size) ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */)\n#define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size))   /* Macro version, useful for static allocation */\n\n/* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */\n#define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue)   (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2))\n#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))\n\n/* or use the size to malloc() space directly. Pay attention to alignment restrictions though */\n#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue)   (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))\n#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))\n\n\n/* *****************************************\n *  FSE advanced API\n ***************************************** */\n\nunsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);\n/**< same as FSE_optimalTableLog(), which used `minus==2` */\n\n/* FSE_compress_wksp() :\n * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`).\n * FSE_COMPRESS_WKSP_SIZE_U32() provides the minimum size required for `workSpace` as a table of FSE_CTable.\n */\n#define FSE_COMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue)   ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + ((maxTableLog > 12) ? (1 << (maxTableLog - 2)) : 1024) )\nsize_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);\n\nsize_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);\n/**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */\n\nsize_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);\n/**< build a fake FSE_CTable, designed to compress always the same symbolValue */\n\n/* FSE_buildCTable_wksp() :\n * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`).\n * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog)`.\n */\n#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * (maxSymbolValue + 2) + (1ull << tableLog))\nsize_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);\n\n#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)\n#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))\nFSE_PUBLIC_API size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);\n/**< Same as FSE_buildDTable(), using an externally allocated `workspace` produced with `FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)` */\n\nsize_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);\n/**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */\n\nsize_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);\n/**< build a fake FSE_DTable, designed to always generate the same symbolValue */\n\n#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue))\n#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))\nsize_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize);\n/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)` */\n\nsize_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2);\n/**< Same as FSE_decompress_wksp() but with dynamic BMI2 support. Pass 1 if your CPU supports BMI2 or 0 if it doesn't. */\n\ntypedef enum {\n   FSE_repeat_none,  /**< Cannot use the previous table */\n   FSE_repeat_check, /**< Can use the previous table but it must be checked */\n   FSE_repeat_valid  /**< Can use the previous table and it is assumed to be valid */\n } FSE_repeat;\n\n/* *****************************************\n*  FSE symbol compression API\n*******************************************/\n/*!\n   This API consists of small unitary functions, which highly benefit from being inlined.\n   Hence their body are included in next section.\n*/\ntypedef struct {\n    ptrdiff_t   value;\n    const void* stateTable;\n    const void* symbolTT;\n    unsigned    stateLog;\n} FSE_CState_t;\n\nstatic void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);\n\nstatic void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);\n\nstatic void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);\n\n/**<\nThese functions are inner components of FSE_compress_usingCTable().\nThey allow the creation of custom streams, mixing multiple tables and bit sources.\n\nA key property to keep in mind is that encoding and decoding are done **in reverse direction**.\nSo the first symbol you will encode is the last you will decode, like a LIFO stack.\n\nYou will need a few variables to track your CStream. They are :\n\nFSE_CTable    ct;         // Provided by FSE_buildCTable()\nBIT_CStream_t bitStream;  // bitStream tracking structure\nFSE_CState_t  state;      // State tracking structure (can have several)\n\n\nThe first thing to do is to init bitStream and state.\n    size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);\n    FSE_initCState(&state, ct);\n\nNote that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError();\nYou can then encode your input data, byte after byte.\nFSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time.\nRemember decoding will be done in reverse direction.\n    FSE_encodeByte(&bitStream, &state, symbol);\n\nAt any time, you can also add any bit sequence.\nNote : maximum allowed nbBits is 25, for compatibility with 32-bits decoders\n    BIT_addBits(&bitStream, bitField, nbBits);\n\nThe above methods don't commit data to memory, they just store it into local register, for speed.\nLocal register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).\nWriting data to memory is a manual operation, performed by the flushBits function.\n    BIT_flushBits(&bitStream);\n\nYour last FSE encoding operation shall be to flush your last state value(s).\n    FSE_flushState(&bitStream, &state);\n\nFinally, you must close the bitStream.\nThe function returns the size of CStream in bytes.\nIf data couldn't fit into dstBuffer, it will return a 0 ( == not compressible)\nIf there is an error, it returns an errorCode (which can be tested using FSE_isError()).\n    size_t size = BIT_closeCStream(&bitStream);\n*/\n\n\n/* *****************************************\n*  FSE symbol decompression API\n*******************************************/\ntypedef struct {\n    size_t      state;\n    const void* table;   /* precise table may vary, depending on U16 */\n} FSE_DState_t;\n\n\nstatic void     FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);\n\nstatic unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);\n\nstatic unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);\n\n/**<\nLet's now decompose FSE_decompress_usingDTable() into its unitary components.\nYou will decode FSE-encoded symbols from the bitStream,\nand also any other bitFields you put in, **in reverse order**.\n\nYou will need a few variables to track your bitStream. They are :\n\nBIT_DStream_t DStream;    // Stream context\nFSE_DState_t  DState;     // State context. Multiple ones are possible\nFSE_DTable*   DTablePtr;  // Decoding table, provided by FSE_buildDTable()\n\nThe first thing to do is to init the bitStream.\n    errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize);\n\nYou should then retrieve your initial state(s)\n(in reverse flushing order if you have several ones) :\n    errorCode = FSE_initDState(&DState, &DStream, DTablePtr);\n\nYou can then decode your data, symbol after symbol.\nFor information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'.\nKeep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out).\n    unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);\n\nYou can retrieve any bitfield you eventually stored into the bitStream (in reverse order)\nNote : maximum allowed nbBits is 25, for 32-bits compatibility\n    size_t bitField = BIT_readBits(&DStream, nbBits);\n\nAll above operations only read from local register (which size depends on size_t).\nRefueling the register from memory is manually performed by the reload method.\n    endSignal = FSE_reloadDStream(&DStream);\n\nBIT_reloadDStream() result tells if there is still some more data to read from DStream.\nBIT_DStream_unfinished : there is still some data left into the DStream.\nBIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled.\nBIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed.\nBIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted.\n\nWhen reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop,\nto properly detect the exact end of stream.\nAfter each decoded symbol, check if DStream is fully consumed using this simple test :\n    BIT_reloadDStream(&DStream) >= BIT_DStream_completed\n\nWhen it's done, verify decompression is fully completed, by checking both DStream and the relevant states.\nChecking if DStream has reached its end is performed by :\n    BIT_endOfDStream(&DStream);\nCheck also the states. There might be some symbols left there, if some high probability ones (>50%) are possible.\n    FSE_endOfDState(&DState);\n*/\n\n\n/* *****************************************\n*  FSE unsafe API\n*******************************************/\nstatic unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);\n/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */\n\n\n/* *****************************************\n*  Implementation of inlined functions\n*******************************************/\ntypedef struct {\n    int deltaFindState;\n    U32 deltaNbBits;\n} FSE_symbolCompressionTransform; /* total 8 bytes */\n\nMEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)\n{\n    const void* ptr = ct;\n    const U16* u16ptr = (const U16*) ptr;\n    const U32 tableLog = MEM_read16(ptr);\n    statePtr->value = (ptrdiff_t)1<<tableLog;\n    statePtr->stateTable = u16ptr+2;\n    statePtr->symbolTT = ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1);\n    statePtr->stateLog = tableLog;\n}\n\n\n/*! FSE_initCState2() :\n*   Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)\n*   uses the smallest state value possible, saving the cost of this symbol */\nMEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)\n{\n    FSE_initCState(statePtr, ct);\n    {   const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];\n        const U16* stateTable = (const U16*)(statePtr->stateTable);\n        U32 nbBitsOut  = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);\n        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;\n        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];\n    }\n}\n\nMEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol)\n{\n    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];\n    const U16* const stateTable = (const U16*)(statePtr->stateTable);\n    U32 const nbBitsOut  = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);\n    BIT_addBits(bitC, statePtr->value, nbBitsOut);\n    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];\n}\n\nMEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)\n{\n    BIT_addBits(bitC, statePtr->value, statePtr->stateLog);\n    BIT_flushBits(bitC);\n}\n\n\n/* FSE_getMaxNbBits() :\n * Approximate maximum cost of a symbol, in bits.\n * Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)\n * note 1 : assume symbolValue is valid (<= maxSymbolValue)\n * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */\nMEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)\n{\n    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;\n    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;\n}\n\n/* FSE_bitCost() :\n * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits)\n * note 1 : assume symbolValue is valid (<= maxSymbolValue)\n * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */\nMEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)\n{\n    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;\n    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;\n    U32 const threshold = (minNbBits+1) << 16;\n    assert(tableLog < 16);\n    assert(accuracyLog < 31-tableLog);  /* ensure enough room for renormalization double shift */\n    {   U32 const tableSize = 1 << tableLog;\n        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);\n        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;   /* linear interpolation (very approximate) */\n        U32 const bitMultiplier = 1 << accuracyLog;\n        assert(symbolTT[symbolValue].deltaNbBits + tableSize <= threshold);\n        assert(normalizedDeltaFromThreshold <= bitMultiplier);\n        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;\n    }\n}\n\n\n/* ======    Decompression    ====== */\n\ntypedef struct {\n    U16 tableLog;\n    U16 fastMode;\n} FSE_DTableHeader;   /* sizeof U32 */\n\ntypedef struct\n{\n    unsigned short newState;\n    unsigned char  symbol;\n    unsigned char  nbBits;\n} FSE_decode_t;   /* size == U32 */\n\nMEM_STATIC void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)\n{\n    const void* ptr = dt;\n    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;\n    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);\n    BIT_reloadDStream(bitD);\n    DStatePtr->table = dt + 1;\n}\n\nMEM_STATIC BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    return DInfo.symbol;\n}\n\nMEM_STATIC void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n    DStatePtr->state = DInfo.newState + lowBits;\n}\n\nMEM_STATIC BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    BYTE const symbol = DInfo.symbol;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n\n    DStatePtr->state = DInfo.newState + lowBits;\n    return symbol;\n}\n\n/*! FSE_decodeSymbolFast() :\n    unsafe, only works if no symbol has a probability > 50% */\nMEM_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    BYTE const symbol = DInfo.symbol;\n    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);\n\n    DStatePtr->state = DInfo.newState + lowBits;\n    return symbol;\n}\n\nMEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)\n{\n    return DStatePtr->state == 0;\n}\n\n\n\n#ifndef FSE_COMMONDEFS_ONLY\n\n/* **************************************************************\n*  Tuning parameters\n****************************************************************/\n/*!MEMORY_USAGE :\n*  Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)\n*  Increasing memory usage improves compression ratio\n*  Reduced memory usage can improve speed, due to cache effect\n*  Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */\n#ifndef FSE_MAX_MEMORY_USAGE\n#  define FSE_MAX_MEMORY_USAGE 14\n#endif\n#ifndef FSE_DEFAULT_MEMORY_USAGE\n#  define FSE_DEFAULT_MEMORY_USAGE 13\n#endif\n#if (FSE_DEFAULT_MEMORY_USAGE > FSE_MAX_MEMORY_USAGE)\n#  error \"FSE_DEFAULT_MEMORY_USAGE must be <= FSE_MAX_MEMORY_USAGE\"\n#endif\n\n/*!FSE_MAX_SYMBOL_VALUE :\n*  Maximum symbol value authorized.\n*  Required for proper stack allocation */\n#ifndef FSE_MAX_SYMBOL_VALUE\n#  define FSE_MAX_SYMBOL_VALUE 255\n#endif\n\n/* **************************************************************\n*  template functions type & suffix\n****************************************************************/\n#define FSE_FUNCTION_TYPE BYTE\n#define FSE_FUNCTION_EXTENSION\n#define FSE_DECODE_TYPE FSE_decode_t\n\n\n#endif   /* !FSE_COMMONDEFS_ONLY */\n\n\n/* ***************************************************************\n*  Constants\n*****************************************************************/\n#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)\n#define FSE_MAX_TABLESIZE (1U<<FSE_MAX_TABLELOG)\n#define FSE_MAXTABLESIZE_MASK (FSE_MAX_TABLESIZE-1)\n#define FSE_DEFAULT_TABLELOG (FSE_DEFAULT_MEMORY_USAGE-2)\n#define FSE_MIN_TABLELOG 5\n\n#define FSE_TABLELOG_ABSOLUTE_MAX 15\n#if FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX\n#  error \"FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX is not supported\"\n#endif\n\n#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)\n\n\n#endif /* FSE_STATIC_LINKING_ONLY */\n\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/fse_decompress.c",
    "content": "/* ******************************************************************\n * FSE : Finite State Entropy decoder\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n *  You can contact the author at :\n *  - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *  - Public forum : https://groups.google.com/forum/#!forum/lz4c\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n\n/* **************************************************************\n*  Includes\n****************************************************************/\n#include \"debug.h\"      /* assert */\n#include \"bitstream.h\"\n#include \"compiler.h\"\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#include \"error_private.h\"\n#define ZSTD_DEPS_NEED_MALLOC\n#include \"zstd_deps.h\"\n\n\n/* **************************************************************\n*  Error Management\n****************************************************************/\n#define FSE_isError ERR_isError\n#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */\n\n\n/* **************************************************************\n*  Templates\n****************************************************************/\n/*\n  designed to be included\n  for type-specific functions (template emulation in C)\n  Objective is to write these functions only once, for improved maintenance\n*/\n\n/* safety checks */\n#ifndef FSE_FUNCTION_EXTENSION\n#  error \"FSE_FUNCTION_EXTENSION must be defined\"\n#endif\n#ifndef FSE_FUNCTION_TYPE\n#  error \"FSE_FUNCTION_TYPE must be defined\"\n#endif\n\n/* Function names */\n#define FSE_CAT(X,Y) X##Y\n#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y)\n#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y)\n\n\n/* Function templates */\nFSE_DTable* FSE_createDTable (unsigned tableLog)\n{\n    if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX;\n    return (FSE_DTable*)ZSTD_malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) );\n}\n\nvoid FSE_freeDTable (FSE_DTable* dt)\n{\n    ZSTD_free(dt);\n}\n\nstatic size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)\n{\n    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */\n    FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr);\n    U16* symbolNext = (U16*)workSpace;\n    BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1);\n\n    U32 const maxSV1 = maxSymbolValue + 1;\n    U32 const tableSize = 1 << tableLog;\n    U32 highThreshold = tableSize-1;\n\n    /* Sanity Checks */\n    if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge);\n    if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);\n    if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);\n\n    /* Init, lay down lowprob symbols */\n    {   FSE_DTableHeader DTableH;\n        DTableH.tableLog = (U16)tableLog;\n        DTableH.fastMode = 1;\n        {   S16 const largeLimit= (S16)(1 << (tableLog-1));\n            U32 s;\n            for (s=0; s<maxSV1; s++) {\n                if (normalizedCounter[s]==-1) {\n                    tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;\n                    symbolNext[s] = 1;\n                } else {\n                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;\n                    symbolNext[s] = normalizedCounter[s];\n        }   }   }\n        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));\n    }\n\n    /* Spread symbols */\n    if (highThreshold == tableSize - 1) {\n        size_t const tableMask = tableSize-1;\n        size_t const step = FSE_TABLESTEP(tableSize);\n        /* First lay down the symbols in order.\n         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch\n         * misses since small blocks generally have small table logs, so nearly\n         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of\n         * our buffer to handle the over-write.\n         */\n        {\n            U64 const add = 0x0101010101010101ull;\n            size_t pos = 0;\n            U64 sv = 0;\n            U32 s;\n            for (s=0; s<maxSV1; ++s, sv += add) {\n                int i;\n                int const n = normalizedCounter[s];\n                MEM_write64(spread + pos, sv);\n                for (i = 8; i < n; i += 8) {\n                    MEM_write64(spread + pos + i, sv);\n                }\n                pos += n;\n            }\n        }\n        /* Now we spread those positions across the table.\n         * The benefit of doing it in two stages is that we avoid the the\n         * variable size inner loop, which caused lots of branch misses.\n         * Now we can run through all the positions without any branch misses.\n         * We unroll the loop twice, since that is what emperically worked best.\n         */\n        {\n            size_t position = 0;\n            size_t s;\n            size_t const unroll = 2;\n            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */\n            for (s = 0; s < (size_t)tableSize; s += unroll) {\n                size_t u;\n                for (u = 0; u < unroll; ++u) {\n                    size_t const uPosition = (position + (u * step)) & tableMask;\n                    tableDecode[uPosition].symbol = spread[s + u];\n                }\n                position = (position + (unroll * step)) & tableMask;\n            }\n            assert(position == 0);\n        }\n    } else {\n        U32 const tableMask = tableSize-1;\n        U32 const step = FSE_TABLESTEP(tableSize);\n        U32 s, position = 0;\n        for (s=0; s<maxSV1; s++) {\n            int i;\n            for (i=0; i<normalizedCounter[s]; i++) {\n                tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;\n                position = (position + step) & tableMask;\n                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */\n        }   }\n        if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */\n    }\n\n    /* Build Decoding table */\n    {   U32 u;\n        for (u=0; u<tableSize; u++) {\n            FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);\n            U32 const nextState = symbolNext[symbol]++;\n            tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );\n            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);\n    }   }\n\n    return 0;\n}\n\nsize_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_buildDTable_internal(dt, normalizedCounter, maxSymbolValue, tableLog, workSpace, wkspSize);\n}\n\n\n#ifndef FSE_COMMONDEFS_ONLY\n\n/*-*******************************************************\n*  Decompression (Byte symbols)\n*********************************************************/\nsize_t FSE_buildDTable_rle (FSE_DTable* dt, BYTE symbolValue)\n{\n    void* ptr = dt;\n    FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;\n    void* dPtr = dt + 1;\n    FSE_decode_t* const cell = (FSE_decode_t*)dPtr;\n\n    DTableH->tableLog = 0;\n    DTableH->fastMode = 0;\n\n    cell->newState = 0;\n    cell->symbol = symbolValue;\n    cell->nbBits = 0;\n\n    return 0;\n}\n\n\nsize_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits)\n{\n    void* ptr = dt;\n    FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;\n    void* dPtr = dt + 1;\n    FSE_decode_t* const dinfo = (FSE_decode_t*)dPtr;\n    const unsigned tableSize = 1 << nbBits;\n    const unsigned tableMask = tableSize - 1;\n    const unsigned maxSV1 = tableMask+1;\n    unsigned s;\n\n    /* Sanity checks */\n    if (nbBits < 1) return ERROR(GENERIC);         /* min size */\n\n    /* Build Decoding Table */\n    DTableH->tableLog = (U16)nbBits;\n    DTableH->fastMode = 1;\n    for (s=0; s<maxSV1; s++) {\n        dinfo[s].newState = 0;\n        dinfo[s].symbol = (BYTE)s;\n        dinfo[s].nbBits = (BYTE)nbBits;\n    }\n\n    return 0;\n}\n\nFORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic(\n          void* dst, size_t maxDstSize,\n    const void* cSrc, size_t cSrcSize,\n    const FSE_DTable* dt, const unsigned fast)\n{\n    BYTE* const ostart = (BYTE*) dst;\n    BYTE* op = ostart;\n    BYTE* const omax = op + maxDstSize;\n    BYTE* const olimit = omax-3;\n\n    BIT_DStream_t bitD;\n    FSE_DState_t state1;\n    FSE_DState_t state2;\n\n    /* Init */\n    CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize));\n\n    FSE_initDState(&state1, &bitD, dt);\n    FSE_initDState(&state2, &bitD, dt);\n\n#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)\n\n    /* 4 symbols per loop */\n    for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {\n        op[0] = FSE_GETSYMBOL(&state1);\n\n        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            BIT_reloadDStream(&bitD);\n\n        op[1] = FSE_GETSYMBOL(&state2);\n\n        if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }\n\n        op[2] = FSE_GETSYMBOL(&state1);\n\n        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            BIT_reloadDStream(&bitD);\n\n        op[3] = FSE_GETSYMBOL(&state2);\n    }\n\n    /* tail */\n    /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */\n    while (1) {\n        if (op>(omax-2)) return ERROR(dstSize_tooSmall);\n        *op++ = FSE_GETSYMBOL(&state1);\n        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {\n            *op++ = FSE_GETSYMBOL(&state2);\n            break;\n        }\n\n        if (op>(omax-2)) return ERROR(dstSize_tooSmall);\n        *op++ = FSE_GETSYMBOL(&state2);\n        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {\n            *op++ = FSE_GETSYMBOL(&state1);\n            break;\n    }   }\n\n    return op-ostart;\n}\n\n\nsize_t FSE_decompress_usingDTable(void* dst, size_t originalSize,\n                            const void* cSrc, size_t cSrcSize,\n                            const FSE_DTable* dt)\n{\n    const void* ptr = dt;\n    const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;\n    const U32 fastMode = DTableH->fastMode;\n\n    /* select fast mode (static) */\n    if (fastMode) return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);\n    return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);\n}\n\n\nsize_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_decompress_wksp_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, /* bmi2 */ 0);\n}\n\nFORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body(\n        void* dst, size_t dstCapacity,\n        const void* cSrc, size_t cSrcSize,\n        unsigned maxLog, void* workSpace, size_t wkspSize,\n        int bmi2)\n{\n    const BYTE* const istart = (const BYTE*)cSrc;\n    const BYTE* ip = istart;\n    short counting[FSE_MAX_SYMBOL_VALUE+1];\n    unsigned tableLog;\n    unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE;\n    FSE_DTable* const dtable = (FSE_DTable*)workSpace;\n\n    /* normal FSE decoding mode */\n    size_t const NCountLength = FSE_readNCount_bmi2(counting, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2);\n    if (FSE_isError(NCountLength)) return NCountLength;\n    if (tableLog > maxLog) return ERROR(tableLog_tooLarge);\n    assert(NCountLength <= cSrcSize);\n    ip += NCountLength;\n    cSrcSize -= NCountLength;\n\n    if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);\n    workSpace = dtable + FSE_DTABLE_SIZE_U32(tableLog);\n    wkspSize -= FSE_DTABLE_SIZE(tableLog);\n\n    CHECK_F( FSE_buildDTable_internal(dtable, counting, maxSymbolValue, tableLog, workSpace, wkspSize) );\n\n    {\n        const void* ptr = dtable;\n        const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;\n        const U32 fastMode = DTableH->fastMode;\n\n        /* select fast mode (static) */\n        if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 1);\n        return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 0);\n    }\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t FSE_decompress_wksp_body_default(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 0);\n}\n\n#if DYNAMIC_BMI2\nTARGET_ATTRIBUTE(\"bmi2\") static size_t FSE_decompress_wksp_body_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1);\n}\n#endif\n\nsize_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        return FSE_decompress_wksp_body_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);\n    }\n#endif\n    (void)bmi2;\n    return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);\n}\n\n\ntypedef FSE_DTable DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)];\n\n#ifndef ZSTD_NO_UNUSED_FUNCTIONS\nsize_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) {\n    U32 wksp[FSE_BUILD_DTABLE_WKSP_SIZE_U32(FSE_TABLELOG_ABSOLUTE_MAX, FSE_MAX_SYMBOL_VALUE)];\n    return FSE_buildDTable_wksp(dt, normalizedCounter, maxSymbolValue, tableLog, wksp, sizeof(wksp));\n}\n\nsize_t FSE_decompress(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize)\n{\n    /* Static analyzer seems unable to understand this table will be properly initialized later */\n    U32 wksp[FSE_DECOMPRESS_WKSP_SIZE_U32(FSE_MAX_TABLELOG, FSE_MAX_SYMBOL_VALUE)];\n    return FSE_decompress_wksp(dst, dstCapacity, cSrc, cSrcSize, FSE_MAX_TABLELOG, wksp, sizeof(wksp));\n}\n#endif\n\n\n#endif   /* FSE_COMMONDEFS_ONLY */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/huf.h",
    "content": "/* ******************************************************************\n * huff0 huffman codec,\n * part of Finite State Entropy library\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef HUF_H_298734234\n#define HUF_H_298734234\n\n/* *** Dependencies *** */\n#include \"zstd_deps.h\"    /* size_t */\n\n\n/* *** library symbols visibility *** */\n/* Note : when linking with -fvisibility=hidden on gcc, or by default on Visual,\n *        HUF symbols remain \"private\" (internal symbols for library only).\n *        Set macro FSE_DLL_EXPORT to 1 if you want HUF symbols visible on DLL interface */\n#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)\n#  define HUF_PUBLIC_API __attribute__ ((visibility (\"default\")))\n#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1)   /* Visual expected */\n#  define HUF_PUBLIC_API __declspec(dllexport)\n#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)\n#  define HUF_PUBLIC_API __declspec(dllimport)  /* not required, just to generate faster code (saves a function pointer load from IAT and an indirect jump) */\n#else\n#  define HUF_PUBLIC_API\n#endif\n\n\n/* ========================== */\n/* ***  simple functions  *** */\n/* ========================== */\n\n/** HUF_compress() :\n *  Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'.\n * 'dst' buffer must be already allocated.\n *  Compression runs faster if `dstCapacity` >= HUF_compressBound(srcSize).\n * `srcSize` must be <= `HUF_BLOCKSIZE_MAX` == 128 KB.\n * @return : size of compressed data (<= `dstCapacity`).\n *  Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!!\n *                   if HUF_isError(return), compression failed (more details using HUF_getErrorName())\n */\nHUF_PUBLIC_API size_t HUF_compress(void* dst, size_t dstCapacity,\n                             const void* src, size_t srcSize);\n\n/** HUF_decompress() :\n *  Decompress HUF data from buffer 'cSrc', of size 'cSrcSize',\n *  into already allocated buffer 'dst', of minimum size 'dstSize'.\n * `originalSize` : **must** be the ***exact*** size of original (uncompressed) data.\n *  Note : in contrast with FSE, HUF_decompress can regenerate\n *         RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data,\n *         because it knows size to regenerate (originalSize).\n * @return : size of regenerated data (== originalSize),\n *           or an error code, which can be tested using HUF_isError()\n */\nHUF_PUBLIC_API size_t HUF_decompress(void* dst,  size_t originalSize,\n                               const void* cSrc, size_t cSrcSize);\n\n\n/* ***   Tool functions *** */\n#define HUF_BLOCKSIZE_MAX (128 * 1024)                  /**< maximum input size for a single block compressed with HUF_compress */\nHUF_PUBLIC_API size_t HUF_compressBound(size_t size);   /**< maximum compressed size (worst case) */\n\n/* Error Management */\nHUF_PUBLIC_API unsigned    HUF_isError(size_t code);       /**< tells if a return value is an error code */\nHUF_PUBLIC_API const char* HUF_getErrorName(size_t code);  /**< provides error code string (useful for debugging) */\n\n\n/* ***   Advanced function   *** */\n\n/** HUF_compress2() :\n *  Same as HUF_compress(), but offers control over `maxSymbolValue` and `tableLog`.\n * `maxSymbolValue` must be <= HUF_SYMBOLVALUE_MAX .\n * `tableLog` must be `<= HUF_TABLELOG_MAX` . */\nHUF_PUBLIC_API size_t HUF_compress2 (void* dst, size_t dstCapacity,\n                               const void* src, size_t srcSize,\n                               unsigned maxSymbolValue, unsigned tableLog);\n\n/** HUF_compress4X_wksp() :\n *  Same as HUF_compress2(), but uses externally allocated `workSpace`.\n * `workspace` must have minimum alignment of 4, and be at least as large as HUF_WORKSPACE_SIZE */\n#define HUF_WORKSPACE_SIZE ((6 << 10) + 256)\n#define HUF_WORKSPACE_SIZE_U32 (HUF_WORKSPACE_SIZE / sizeof(U32))\nHUF_PUBLIC_API size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity,\n                                     const void* src, size_t srcSize,\n                                     unsigned maxSymbolValue, unsigned tableLog,\n                                     void* workSpace, size_t wkspSize);\n\n#endif   /* HUF_H_298734234 */\n\n/* ******************************************************************\n *  WARNING !!\n *  The following section contains advanced and experimental definitions\n *  which shall never be used in the context of a dynamic library,\n *  because they are not guaranteed to remain stable in the future.\n *  Only consider them in association with static linking.\n * *****************************************************************/\n#if defined(HUF_STATIC_LINKING_ONLY) && !defined(HUF_H_HUF_STATIC_LINKING_ONLY)\n#define HUF_H_HUF_STATIC_LINKING_ONLY\n\n/* *** Dependencies *** */\n#include \"mem.h\"   /* U32 */\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n\n\n/* *** Constants *** */\n#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG */\n#define HUF_TABLELOG_DEFAULT  11      /* default tableLog value when none specified */\n#define HUF_SYMBOLVALUE_MAX  255\n\n#define HUF_TABLELOG_ABSOLUTEMAX  15  /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */\n#if (HUF_TABLELOG_MAX > HUF_TABLELOG_ABSOLUTEMAX)\n#  error \"HUF_TABLELOG_MAX is too large !\"\n#endif\n\n\n/* ****************************************\n*  Static allocation\n******************************************/\n/* HUF buffer bounds */\n#define HUF_CTABLEBOUND 129\n#define HUF_BLOCKBOUND(size) (size + (size>>8) + 8)   /* only true when incompressible is pre-filtered with fast heuristic */\n#define HUF_COMPRESSBOUND(size) (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size))   /* Macro version, useful for static allocation */\n\n/* static allocation of HUF's Compression Table */\n/* this is a private definition, just exposed for allocation and strict aliasing purpose. never EVER access its members directly */\nstruct HUF_CElt_s {\n  U16  val;\n  BYTE nbBits;\n};   /* typedef'd to HUF_CElt */\ntypedef struct HUF_CElt_s HUF_CElt;   /* consider it an incomplete type */\n#define HUF_CTABLE_SIZE_U32(maxSymbolValue)   ((maxSymbolValue)+1)   /* Use tables of U32, for proper alignment */\n#define HUF_CTABLE_SIZE(maxSymbolValue)       (HUF_CTABLE_SIZE_U32(maxSymbolValue) * sizeof(U32))\n#define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \\\n    HUF_CElt name[HUF_CTABLE_SIZE_U32(maxSymbolValue)] /* no final ; */\n\n/* static allocation of HUF's DTable */\ntypedef U32 HUF_DTable;\n#define HUF_DTABLE_SIZE(maxTableLog)   (1 + (1<<(maxTableLog)))\n#define HUF_CREATE_STATIC_DTABLEX1(DTable, maxTableLog) \\\n        HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) }\n#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \\\n        HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }\n\n\n/* ****************************************\n*  Advanced decompression functions\n******************************************/\nsize_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< single-symbol decoder */\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< double-symbols decoder */\n#endif\n\nsize_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< decodes RLE and uncompressed */\nsize_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< considers RLE and uncompressed as errors */\nsize_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< considers RLE and uncompressed as errors */\nsize_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< single-symbol decoder */\nsize_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);   /**< single-symbol decoder */\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< double-symbols decoder */\nsize_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);   /**< double-symbols decoder */\n#endif\n\n\n/* ****************************************\n *  HUF detailed API\n * ****************************************/\n\n/*! HUF_compress() does the following:\n *  1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within \"fse.h\")\n *  2. (optional) refine tableLog using HUF_optimalTableLog()\n *  3. build Huffman table from count using HUF_buildCTable()\n *  4. save Huffman table to memory buffer using HUF_writeCTable()\n *  5. encode the data stream using HUF_compress4X_usingCTable()\n *\n *  The following API allows targeting specific sub-functions for advanced tasks.\n *  For example, it's possible to compress several blocks using the same 'CTable',\n *  or to save and regenerate 'CTable' using external methods.\n */\nunsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);\nsize_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);   /* @return : maxNbBits; CTable and count can overlap. In which case, CTable will overwrite count content */\nsize_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);\nsize_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);\nsize_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);\nint HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);\n\ntypedef enum {\n   HUF_repeat_none,  /**< Cannot use the previous table */\n   HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */\n   HUF_repeat_valid  /**< Can use the previous table and it is assumed to be valid */\n } HUF_repeat;\n/** HUF_compress4X_repeat() :\n *  Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.\n *  If it uses hufTable it does not modify hufTable or repeat.\n *  If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.\n *  If preferRepeat then the old table will always be used if valid. */\nsize_t HUF_compress4X_repeat(void* dst, size_t dstSize,\n                       const void* src, size_t srcSize,\n                       unsigned maxSymbolValue, unsigned tableLog,\n                       void* workSpace, size_t wkspSize,    /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */\n                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);\n\n/** HUF_buildCTable_wksp() :\n *  Same as HUF_buildCTable(), but using externally allocated scratch buffer.\n * `workSpace` must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE.\n */\n#define HUF_CTABLE_WORKSPACE_SIZE_U32 (2*HUF_SYMBOLVALUE_MAX +1 +1)\n#define HUF_CTABLE_WORKSPACE_SIZE (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned))\nsize_t HUF_buildCTable_wksp (HUF_CElt* tree,\n                       const unsigned* count, U32 maxSymbolValue, U32 maxNbBits,\n                             void* workSpace, size_t wkspSize);\n\n/*! HUF_readStats() :\n *  Read compact Huffman tree, saved by HUF_writeCTable().\n * `huffWeight` is destination buffer.\n * @return : size read from `src` , or an error Code .\n *  Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */\nsize_t HUF_readStats(BYTE* huffWeight, size_t hwSize,\n                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize);\n\n/*! HUF_readStats_wksp() :\n * Same as HUF_readStats() but takes an external workspace which must be\n * 4-byte aligned and its size must be >= HUF_READ_STATS_WORKSPACE_SIZE.\n * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0.\n */\n#define HUF_READ_STATS_WORKSPACE_SIZE_U32 FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1)\n#define HUF_READ_STATS_WORKSPACE_SIZE (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned))\nsize_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize,\n                          U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,\n                          const void* src, size_t srcSize,\n                          void* workspace, size_t wkspSize,\n                          int bmi2);\n\n/** HUF_readCTable() :\n *  Loading a CTable saved with HUF_writeCTable() */\nsize_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights);\n\n/** HUF_getNbBits() :\n *  Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX\n *  Note 1 : is not inlined, as HUF_CElt definition is private\n *  Note 2 : const void* used, so that it can provide a statically allocated table as argument (which uses type U32) */\nU32 HUF_getNbBits(const void* symbolTable, U32 symbolValue);\n\n/*\n * HUF_decompress() does the following:\n * 1. select the decompression algorithm (X1, X2) based on pre-computed heuristics\n * 2. build Huffman table from save, using HUF_readDTableX?()\n * 3. decode 1 or 4 segments in parallel using HUF_decompress?X?_usingDTable()\n */\n\n/** HUF_selectDecoder() :\n *  Tells which decoder is likely to decode faster,\n *  based on a set of pre-computed metrics.\n * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 .\n *  Assumption : 0 < dstSize <= 128 KB */\nU32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);\n\n/**\n *  The minimum workspace size for the `workSpace` used in\n *  HUF_readDTableX1_wksp() and HUF_readDTableX2_wksp().\n *\n *  The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when\n *  HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15.\n *  Buffer overflow errors may potentially occur if code modifications result in\n *  a required workspace size greater than that specified in the following\n *  macro.\n */\n#define HUF_DECOMPRESS_WORKSPACE_SIZE (2 << 10)\n#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32))\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize);\nsize_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);\n#endif\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);\nsize_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);\n#endif\n\nsize_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);\n#endif\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);\n#endif\n\n\n/* ====================== */\n/* single stream variants */\n/* ====================== */\n\nsize_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);\nsize_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);  /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U32 unsigned */\nsize_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);\n/** HUF_compress1X_repeat() :\n *  Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.\n *  If it uses hufTable it does not modify hufTable or repeat.\n *  If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.\n *  If preferRepeat then the old table will always be used if valid. */\nsize_t HUF_compress1X_repeat(void* dst, size_t dstSize,\n                       const void* src, size_t srcSize,\n                       unsigned maxSymbolValue, unsigned tableLog,\n                       void* workSpace, size_t wkspSize,   /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */\n                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);\n\nsize_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /* single-symbol decoder */\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /* double-symbol decoder */\n#endif\n\nsize_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);\nsize_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< single-symbol decoder */\nsize_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);   /**< single-symbol decoder */\n#endif\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);   /**< double-symbols decoder */\nsize_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);   /**< double-symbols decoder */\n#endif\n\nsize_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);   /**< automatic selection of sing or double symbol decoder, based on DTable */\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);\n#endif\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);\n#endif\n\n/* BMI2 variants.\n * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0.\n */\nsize_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);\n#endif\nsize_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);\nsize_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2);\n#endif\n\n#endif /* HUF_STATIC_LINKING_ONLY */\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/mem.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef MEM_H_MODULE\n#define MEM_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/*-****************************************\n*  Dependencies\n******************************************/\n#include <stddef.h>  /* size_t, ptrdiff_t */\n#include \"compiler.h\"  /* __has_builtin */\n#include \"debug.h\"  /* DEBUG_STATIC_ASSERT */\n#include \"zstd_deps.h\"  /* ZSTD_memcpy */\n\n\n/*-****************************************\n*  Compiler specifics\n******************************************/\n#if defined(_MSC_VER)   /* Visual Studio */\n#   include <stdlib.h>  /* _byteswap_ulong */\n#   include <intrin.h>  /* _byteswap_* */\n#endif\n#if defined(__GNUC__)\n#  define MEM_STATIC static __inline __attribute__((unused))\n#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#  define MEM_STATIC static inline\n#elif defined(_MSC_VER)\n#  define MEM_STATIC static __inline\n#else\n#  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */\n#endif\n\n/*-**************************************************************\n*  Basic Types\n*****************************************************************/\n#if  !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n#  if defined(_AIX)\n#    include <inttypes.h>\n#  else\n#    include <stdint.h> /* intptr_t */\n#  endif\n  typedef   uint8_t BYTE;\n  typedef  uint16_t U16;\n  typedef   int16_t S16;\n  typedef  uint32_t U32;\n  typedef   int32_t S32;\n  typedef  uint64_t U64;\n  typedef   int64_t S64;\n#else\n# include <limits.h>\n#if CHAR_BIT != 8\n#  error \"this implementation requires char to be exactly 8-bit type\"\n#endif\n  typedef unsigned char      BYTE;\n#if USHRT_MAX != 65535\n#  error \"this implementation requires short to be exactly 16-bit type\"\n#endif\n  typedef unsigned short      U16;\n  typedef   signed short      S16;\n#if UINT_MAX != 4294967295\n#  error \"this implementation requires int to be exactly 32-bit type\"\n#endif\n  typedef unsigned int        U32;\n  typedef   signed int        S32;\n/* note : there are no limits defined for long long type in C90.\n * limits exist in C99, however, in such case, <stdint.h> is preferred */\n  typedef unsigned long long  U64;\n  typedef   signed long long  S64;\n#endif\n\n\n/*-**************************************************************\n*  Memory I/O API\n*****************************************************************/\n/*=== Static platform detection ===*/\nMEM_STATIC unsigned MEM_32bits(void);\nMEM_STATIC unsigned MEM_64bits(void);\nMEM_STATIC unsigned MEM_isLittleEndian(void);\n\n/*=== Native unaligned read/write ===*/\nMEM_STATIC U16 MEM_read16(const void* memPtr);\nMEM_STATIC U32 MEM_read32(const void* memPtr);\nMEM_STATIC U64 MEM_read64(const void* memPtr);\nMEM_STATIC size_t MEM_readST(const void* memPtr);\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value);\nMEM_STATIC void MEM_write32(void* memPtr, U32 value);\nMEM_STATIC void MEM_write64(void* memPtr, U64 value);\n\n/*=== Little endian unaligned read/write ===*/\nMEM_STATIC U16 MEM_readLE16(const void* memPtr);\nMEM_STATIC U32 MEM_readLE24(const void* memPtr);\nMEM_STATIC U32 MEM_readLE32(const void* memPtr);\nMEM_STATIC U64 MEM_readLE64(const void* memPtr);\nMEM_STATIC size_t MEM_readLEST(const void* memPtr);\n\nMEM_STATIC void MEM_writeLE16(void* memPtr, U16 val);\nMEM_STATIC void MEM_writeLE24(void* memPtr, U32 val);\nMEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32);\nMEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64);\nMEM_STATIC void MEM_writeLEST(void* memPtr, size_t val);\n\n/*=== Big endian unaligned read/write ===*/\nMEM_STATIC U32 MEM_readBE32(const void* memPtr);\nMEM_STATIC U64 MEM_readBE64(const void* memPtr);\nMEM_STATIC size_t MEM_readBEST(const void* memPtr);\n\nMEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32);\nMEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64);\nMEM_STATIC void MEM_writeBEST(void* memPtr, size_t val);\n\n/*=== Byteswap ===*/\nMEM_STATIC U32 MEM_swap32(U32 in);\nMEM_STATIC U64 MEM_swap64(U64 in);\nMEM_STATIC size_t MEM_swapST(size_t in);\n\n\n/*-**************************************************************\n*  Memory I/O Implementation\n*****************************************************************/\n/* MEM_FORCE_MEMORY_ACCESS :\n * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.\n * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.\n * The below switch allow to select different access method for improved performance.\n * Method 0 (default) : use `memcpy()`. Safe and portable.\n * Method 1 : `__packed` statement. It depends on compiler extension (i.e., not portable).\n *            This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`.\n * Method 2 : direct access. This method is portable but violate C standard.\n *            It can generate buggy code on targets depending on alignment.\n *            In some circumstances, it's the only known way to get the most performance (i.e. GCC + ARMv6)\n * See http://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details.\n * Prefer these methods in priority order (0 > 1 > 2)\n */\n#ifndef MEM_FORCE_MEMORY_ACCESS   /* can be defined externally, on command line for example */\n#  if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )\n#    define MEM_FORCE_MEMORY_ACCESS 2\n#  elif defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__)\n#    define MEM_FORCE_MEMORY_ACCESS 1\n#  endif\n#endif\n\nMEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }\nMEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }\n\nMEM_STATIC unsigned MEM_isLittleEndian(void)\n{\n    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */\n    return one.c[0];\n}\n\n#if defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==2)\n\n/* violates C standard, by lying on structure alignment.\nOnly use if no other choice to achieve best performance on target platform */\nMEM_STATIC U16 MEM_read16(const void* memPtr) { return *(const U16*) memPtr; }\nMEM_STATIC U32 MEM_read32(const void* memPtr) { return *(const U32*) memPtr; }\nMEM_STATIC U64 MEM_read64(const void* memPtr) { return *(const U64*) memPtr; }\nMEM_STATIC size_t MEM_readST(const void* memPtr) { return *(const size_t*) memPtr; }\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(U16*)memPtr = value; }\nMEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(U32*)memPtr = value; }\nMEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(U64*)memPtr = value; }\n\n#elif defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==1)\n\n/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */\n/* currently only defined for gcc and icc */\n#if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(WIN32))\n    __pragma( pack(push, 1) )\n    typedef struct { U16 v; } unalign16;\n    typedef struct { U32 v; } unalign32;\n    typedef struct { U64 v; } unalign64;\n    typedef struct { size_t v; } unalignArch;\n    __pragma( pack(pop) )\n#else\n    typedef struct { U16 v; } __attribute__((packed)) unalign16;\n    typedef struct { U32 v; } __attribute__((packed)) unalign32;\n    typedef struct { U64 v; } __attribute__((packed)) unalign64;\n    typedef struct { size_t v; } __attribute__((packed)) unalignArch;\n#endif\n\nMEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }\nMEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }\nMEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }\nMEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }\nMEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }\nMEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }\n\n#else\n\n/* default method, safe and standard.\n   can sometimes prove slower */\n\nMEM_STATIC U16 MEM_read16(const void* memPtr)\n{\n    U16 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC U32 MEM_read32(const void* memPtr)\n{\n    U32 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC U64 MEM_read64(const void* memPtr)\n{\n    U64 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC size_t MEM_readST(const void* memPtr)\n{\n    size_t val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\nMEM_STATIC void MEM_write32(void* memPtr, U32 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\nMEM_STATIC void MEM_write64(void* memPtr, U64 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\n#endif /* MEM_FORCE_MEMORY_ACCESS */\n\nMEM_STATIC U32 MEM_swap32(U32 in)\n{\n#if defined(_MSC_VER)     /* Visual Studio */\n    return _byteswap_ulong(in);\n#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \\\n  || (defined(__clang__) && __has_builtin(__builtin_bswap32))\n    return __builtin_bswap32(in);\n#else\n    return  ((in << 24) & 0xff000000 ) |\n            ((in <<  8) & 0x00ff0000 ) |\n            ((in >>  8) & 0x0000ff00 ) |\n            ((in >> 24) & 0x000000ff );\n#endif\n}\n\nMEM_STATIC U64 MEM_swap64(U64 in)\n{\n#if defined(_MSC_VER)     /* Visual Studio */\n    return _byteswap_uint64(in);\n#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \\\n  || (defined(__clang__) && __has_builtin(__builtin_bswap64))\n    return __builtin_bswap64(in);\n#else\n    return  ((in << 56) & 0xff00000000000000ULL) |\n            ((in << 40) & 0x00ff000000000000ULL) |\n            ((in << 24) & 0x0000ff0000000000ULL) |\n            ((in << 8)  & 0x000000ff00000000ULL) |\n            ((in >> 8)  & 0x00000000ff000000ULL) |\n            ((in >> 24) & 0x0000000000ff0000ULL) |\n            ((in >> 40) & 0x000000000000ff00ULL) |\n            ((in >> 56) & 0x00000000000000ffULL);\n#endif\n}\n\nMEM_STATIC size_t MEM_swapST(size_t in)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_swap32((U32)in);\n    else\n        return (size_t)MEM_swap64((U64)in);\n}\n\n/*=== Little endian r/w ===*/\n\nMEM_STATIC U16 MEM_readLE16(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read16(memPtr);\n    else {\n        const BYTE* p = (const BYTE*)memPtr;\n        return (U16)(p[0] + (p[1]<<8));\n    }\n}\n\nMEM_STATIC void MEM_writeLE16(void* memPtr, U16 val)\n{\n    if (MEM_isLittleEndian()) {\n        MEM_write16(memPtr, val);\n    } else {\n        BYTE* p = (BYTE*)memPtr;\n        p[0] = (BYTE)val;\n        p[1] = (BYTE)(val>>8);\n    }\n}\n\nMEM_STATIC U32 MEM_readLE24(const void* memPtr)\n{\n    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);\n}\n\nMEM_STATIC void MEM_writeLE24(void* memPtr, U32 val)\n{\n    MEM_writeLE16(memPtr, (U16)val);\n    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);\n}\n\nMEM_STATIC U32 MEM_readLE32(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read32(memPtr);\n    else\n        return MEM_swap32(MEM_read32(memPtr));\n}\n\nMEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32)\n{\n    if (MEM_isLittleEndian())\n        MEM_write32(memPtr, val32);\n    else\n        MEM_write32(memPtr, MEM_swap32(val32));\n}\n\nMEM_STATIC U64 MEM_readLE64(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read64(memPtr);\n    else\n        return MEM_swap64(MEM_read64(memPtr));\n}\n\nMEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64)\n{\n    if (MEM_isLittleEndian())\n        MEM_write64(memPtr, val64);\n    else\n        MEM_write64(memPtr, MEM_swap64(val64));\n}\n\nMEM_STATIC size_t MEM_readLEST(const void* memPtr)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_readLE32(memPtr);\n    else\n        return (size_t)MEM_readLE64(memPtr);\n}\n\nMEM_STATIC void MEM_writeLEST(void* memPtr, size_t val)\n{\n    if (MEM_32bits())\n        MEM_writeLE32(memPtr, (U32)val);\n    else\n        MEM_writeLE64(memPtr, (U64)val);\n}\n\n/*=== Big endian r/w ===*/\n\nMEM_STATIC U32 MEM_readBE32(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_swap32(MEM_read32(memPtr));\n    else\n        return MEM_read32(memPtr);\n}\n\nMEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32)\n{\n    if (MEM_isLittleEndian())\n        MEM_write32(memPtr, MEM_swap32(val32));\n    else\n        MEM_write32(memPtr, val32);\n}\n\nMEM_STATIC U64 MEM_readBE64(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_swap64(MEM_read64(memPtr));\n    else\n        return MEM_read64(memPtr);\n}\n\nMEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64)\n{\n    if (MEM_isLittleEndian())\n        MEM_write64(memPtr, MEM_swap64(val64));\n    else\n        MEM_write64(memPtr, val64);\n}\n\nMEM_STATIC size_t MEM_readBEST(const void* memPtr)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_readBE32(memPtr);\n    else\n        return (size_t)MEM_readBE64(memPtr);\n}\n\nMEM_STATIC void MEM_writeBEST(void* memPtr, size_t val)\n{\n    if (MEM_32bits())\n        MEM_writeBE32(memPtr, (U32)val);\n    else\n        MEM_writeBE64(memPtr, (U64)val);\n}\n\n/* code only tested on 32 and 64 bits systems */\nMEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }\n\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* MEM_H_MODULE */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/xxhash.c",
    "content": "/*\n *  xxHash - Fast Hash algorithm\n *  Copyright (c) 2012-2020, Yann Collet, Facebook, Inc.\n *\n *  You can contact the author at :\n *  - xxHash homepage: http://www.xxhash.com\n *  - xxHash source repository : https://github.com/Cyan4973/xxHash\n * \n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n*/\n\n\n/* *************************************\n*  Tuning parameters\n***************************************/\n/*!XXH_FORCE_MEMORY_ACCESS :\n * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.\n * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.\n * The below switch allow to select different access method for improved performance.\n * Method 0 (default) : use `memcpy()`. Safe and portable.\n * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable).\n *            This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`.\n * Method 2 : direct access. This method doesn't depend on compiler but violate C standard.\n *            It can generate buggy code on targets which do not support unaligned memory accesses.\n *            But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6)\n * See http://stackoverflow.com/a/32095106/646947 for details.\n * Prefer these methods in priority order (0 > 1 > 2)\n */\n#ifndef XXH_FORCE_MEMORY_ACCESS   /* can be defined externally, on command line for example */\n#  if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )\n#    define XXH_FORCE_MEMORY_ACCESS 2\n#  elif (defined(__INTEL_COMPILER) && !defined(WIN32)) || \\\n  (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \\\n  defined(__ICCARM__)\n#    define XXH_FORCE_MEMORY_ACCESS 1\n#  endif\n#endif\n\n/*!XXH_ACCEPT_NULL_INPUT_POINTER :\n * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer.\n * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input.\n * By default, this option is disabled. To enable it, uncomment below define :\n */\n/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */\n\n/*!XXH_FORCE_NATIVE_FORMAT :\n * By default, xxHash library provides endian-independent Hash values, based on little-endian convention.\n * Results are therefore identical for little-endian and big-endian CPU.\n * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.\n * Should endian-independence be of no importance for your application, you may set the #define below to 1,\n * to improve speed for Big-endian CPU.\n * This option has no impact on Little_Endian CPU.\n */\n#ifndef XXH_FORCE_NATIVE_FORMAT   /* can be defined externally */\n#  define XXH_FORCE_NATIVE_FORMAT 0\n#endif\n\n/*!XXH_FORCE_ALIGN_CHECK :\n * This is a minor performance trick, only useful with lots of very small keys.\n * It means : check for aligned/unaligned input.\n * The check costs one initial branch per hash; set to 0 when the input data\n * is guaranteed to be aligned.\n */\n#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */\n#  if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)\n#    define XXH_FORCE_ALIGN_CHECK 0\n#  else\n#    define XXH_FORCE_ALIGN_CHECK 1\n#  endif\n#endif\n\n\n/* *************************************\n*  Includes & Memory related functions\n***************************************/\n/* Modify the local functions below should you wish to use some other memory routines */\n/* for ZSTD_malloc(), ZSTD_free() */\n#define ZSTD_DEPS_NEED_MALLOC\n#include \"zstd_deps.h\"  /* size_t, ZSTD_malloc, ZSTD_free, ZSTD_memcpy */\nstatic void* XXH_malloc(size_t s) { return ZSTD_malloc(s); }\nstatic void  XXH_free  (void* p)  { ZSTD_free(p); }\nstatic void* XXH_memcpy(void* dest, const void* src, size_t size) { return ZSTD_memcpy(dest,src,size); }\n\n#ifndef XXH_STATIC_LINKING_ONLY\n#  define XXH_STATIC_LINKING_ONLY\n#endif\n#include \"xxhash.h\"\n\n\n/* *************************************\n*  Compiler Specific Options\n***************************************/\n#include \"compiler.h\"\n\n\n/* *************************************\n*  Basic Types\n***************************************/\n#include \"mem.h\"  /* BYTE, U32, U64, size_t */\n\n#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))\n\n/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */\nstatic U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; }\nstatic U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; }\n\n#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))\n\n/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */\n/* currently only defined for gcc and icc */\ntypedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign;\n\nstatic U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; }\nstatic U64 XXH_read64(const void* ptr) { return ((const unalign*)ptr)->u64; }\n\n#else\n\n/* portable and safe solution. Generally efficient.\n * see : http://stackoverflow.com/a/32095106/646947\n */\n\nstatic U32 XXH_read32(const void* memPtr)\n{\n    U32 val;\n    ZSTD_memcpy(&val, memPtr, sizeof(val));\n    return val;\n}\n\nstatic U64 XXH_read64(const void* memPtr)\n{\n    U64 val;\n    ZSTD_memcpy(&val, memPtr, sizeof(val));\n    return val;\n}\n\n#endif   /* XXH_FORCE_DIRECT_MEMORY_ACCESS */\n\n\n/* ****************************************\n*  Compiler-specific Functions and Macros\n******************************************/\n#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)\n\n/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */\n#if defined(_MSC_VER)\n#  define XXH_rotl32(x,r) _rotl(x,r)\n#  define XXH_rotl64(x,r) _rotl64(x,r)\n#else\n#if defined(__ICCARM__)\n#  include <intrinsics.h>\n#  define XXH_rotl32(x,r) __ROR(x,(32 - r))\n#else\n#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))\n#endif\n#  define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r)))\n#endif\n\n#if defined(_MSC_VER)     /* Visual Studio */\n#  define XXH_swap32 _byteswap_ulong\n#  define XXH_swap64 _byteswap_uint64\n#elif GCC_VERSION >= 403\n#  define XXH_swap32 __builtin_bswap32\n#  define XXH_swap64 __builtin_bswap64\n#else\nstatic U32 XXH_swap32 (U32 x)\n{\n    return  ((x << 24) & 0xff000000 ) |\n            ((x <<  8) & 0x00ff0000 ) |\n            ((x >>  8) & 0x0000ff00 ) |\n            ((x >> 24) & 0x000000ff );\n}\nstatic U64 XXH_swap64 (U64 x)\n{\n    return  ((x << 56) & 0xff00000000000000ULL) |\n            ((x << 40) & 0x00ff000000000000ULL) |\n            ((x << 24) & 0x0000ff0000000000ULL) |\n            ((x << 8)  & 0x000000ff00000000ULL) |\n            ((x >> 8)  & 0x00000000ff000000ULL) |\n            ((x >> 24) & 0x0000000000ff0000ULL) |\n            ((x >> 40) & 0x000000000000ff00ULL) |\n            ((x >> 56) & 0x00000000000000ffULL);\n}\n#endif\n\n\n/* *************************************\n*  Architecture Macros\n***************************************/\ntypedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;\n\n/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */\n#ifndef XXH_CPU_LITTLE_ENDIAN\n    static const int g_one = 1;\n#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&g_one))\n#endif\n\n\n/* ***************************\n*  Memory reads\n*****************************/\ntypedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;\n\nFORCE_INLINE_TEMPLATE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align)\n{\n    if (align==XXH_unaligned)\n        return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr));\n    else\n        return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr);\n}\n\nFORCE_INLINE_TEMPLATE U32 XXH_readLE32(const void* ptr, XXH_endianess endian)\n{\n    return XXH_readLE32_align(ptr, endian, XXH_unaligned);\n}\n\nstatic U32 XXH_readBE32(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr);\n}\n\nFORCE_INLINE_TEMPLATE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align)\n{\n    if (align==XXH_unaligned)\n        return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));\n    else\n        return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr);\n}\n\nFORCE_INLINE_TEMPLATE U64 XXH_readLE64(const void* ptr, XXH_endianess endian)\n{\n    return XXH_readLE64_align(ptr, endian, XXH_unaligned);\n}\n\nstatic U64 XXH_readBE64(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr);\n}\n\n\n/* *************************************\n*  Macros\n***************************************/\n#define XXH_STATIC_ASSERT(c)   { enum { XXH_static_assert = 1/(int)(!!(c)) }; }    /* use only *after* variable declarations */\n\n\n/* *************************************\n*  Constants\n***************************************/\nstatic const U32 PRIME32_1 = 2654435761U;\nstatic const U32 PRIME32_2 = 2246822519U;\nstatic const U32 PRIME32_3 = 3266489917U;\nstatic const U32 PRIME32_4 =  668265263U;\nstatic const U32 PRIME32_5 =  374761393U;\n\nstatic const U64 PRIME64_1 = 11400714785074694791ULL;\nstatic const U64 PRIME64_2 = 14029467366897019727ULL;\nstatic const U64 PRIME64_3 =  1609587929392839161ULL;\nstatic const U64 PRIME64_4 =  9650029242287828579ULL;\nstatic const U64 PRIME64_5 =  2870177450012600261ULL;\n\nXXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; }\n\n\n/* **************************\n*  Utils\n****************************/\nXXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dstState, const XXH32_state_t* restrict srcState)\n{\n    ZSTD_memcpy(dstState, srcState, sizeof(*dstState));\n}\n\nXXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dstState, const XXH64_state_t* restrict srcState)\n{\n    ZSTD_memcpy(dstState, srcState, sizeof(*dstState));\n}\n\n\n/* ***************************\n*  Simple Hash Functions\n*****************************/\n\nstatic U32 XXH32_round(U32 seed, U32 input)\n{\n    seed += input * PRIME32_2;\n    seed  = XXH_rotl32(seed, 13);\n    seed *= PRIME32_1;\n    return seed;\n}\n\nFORCE_INLINE_TEMPLATE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)\n{\n    const BYTE* p = (const BYTE*)input;\n    const BYTE* bEnd = p + len;\n    U32 h32;\n#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align)\n\n#ifdef XXH_ACCEPT_NULL_INPUT_POINTER\n    if (p==NULL) {\n        len=0;\n        bEnd=p=(const BYTE*)(size_t)16;\n    }\n#endif\n\n    if (len>=16) {\n        const BYTE* const limit = bEnd - 16;\n        U32 v1 = seed + PRIME32_1 + PRIME32_2;\n        U32 v2 = seed + PRIME32_2;\n        U32 v3 = seed + 0;\n        U32 v4 = seed - PRIME32_1;\n\n        do {\n            v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4;\n            v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4;\n            v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4;\n            v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4;\n        } while (p<=limit);\n\n        h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);\n    } else {\n        h32  = seed + PRIME32_5;\n    }\n\n    h32 += (U32) len;\n\n    while (p+4<=bEnd) {\n        h32 += XXH_get32bits(p) * PRIME32_3;\n        h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;\n        p+=4;\n    }\n\n    while (p<bEnd) {\n        h32 += (*p) * PRIME32_5;\n        h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;\n        p++;\n    }\n\n    h32 ^= h32 >> 15;\n    h32 *= PRIME32_2;\n    h32 ^= h32 >> 13;\n    h32 *= PRIME32_3;\n    h32 ^= h32 >> 16;\n\n    return h32;\n}\n\n\nXXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed)\n{\n#if 0\n    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */\n    XXH32_CREATESTATE_STATIC(state);\n    XXH32_reset(state, seed);\n    XXH32_update(state, input, len);\n    return XXH32_digest(state);\n#else\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if (XXH_FORCE_ALIGN_CHECK) {\n        if ((((size_t)input) & 3) == 0) {   /* Input is 4-bytes aligned, leverage the speed benefit */\n            if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n                return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);\n            else\n                return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);\n    }   }\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);\n    else\n        return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);\n#endif\n}\n\n\nstatic U64 XXH64_round(U64 acc, U64 input)\n{\n    acc += input * PRIME64_2;\n    acc  = XXH_rotl64(acc, 31);\n    acc *= PRIME64_1;\n    return acc;\n}\n\nstatic U64 XXH64_mergeRound(U64 acc, U64 val)\n{\n    val  = XXH64_round(0, val);\n    acc ^= val;\n    acc  = acc * PRIME64_1 + PRIME64_4;\n    return acc;\n}\n\nFORCE_INLINE_TEMPLATE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)\n{\n    const BYTE* p = (const BYTE*)input;\n    const BYTE* const bEnd = p + len;\n    U64 h64;\n#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align)\n\n#ifdef XXH_ACCEPT_NULL_INPUT_POINTER\n    if (p==NULL) {\n        len=0;\n        bEnd=p=(const BYTE*)(size_t)32;\n    }\n#endif\n\n    if (len>=32) {\n        const BYTE* const limit = bEnd - 32;\n        U64 v1 = seed + PRIME64_1 + PRIME64_2;\n        U64 v2 = seed + PRIME64_2;\n        U64 v3 = seed + 0;\n        U64 v4 = seed - PRIME64_1;\n\n        do {\n            v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8;\n            v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8;\n            v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8;\n            v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8;\n        } while (p<=limit);\n\n        h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);\n        h64 = XXH64_mergeRound(h64, v1);\n        h64 = XXH64_mergeRound(h64, v2);\n        h64 = XXH64_mergeRound(h64, v3);\n        h64 = XXH64_mergeRound(h64, v4);\n\n    } else {\n        h64  = seed + PRIME64_5;\n    }\n\n    h64 += (U64) len;\n\n    while (p+8<=bEnd) {\n        U64 const k1 = XXH64_round(0, XXH_get64bits(p));\n        h64 ^= k1;\n        h64  = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4;\n        p+=8;\n    }\n\n    if (p+4<=bEnd) {\n        h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1;\n        h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;\n        p+=4;\n    }\n\n    while (p<bEnd) {\n        h64 ^= (*p) * PRIME64_5;\n        h64 = XXH_rotl64(h64, 11) * PRIME64_1;\n        p++;\n    }\n\n    h64 ^= h64 >> 33;\n    h64 *= PRIME64_2;\n    h64 ^= h64 >> 29;\n    h64 *= PRIME64_3;\n    h64 ^= h64 >> 32;\n\n    return h64;\n}\n\n\nXXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)\n{\n#if 0\n    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */\n    XXH64_CREATESTATE_STATIC(state);\n    XXH64_reset(state, seed);\n    XXH64_update(state, input, len);\n    return XXH64_digest(state);\n#else\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if (XXH_FORCE_ALIGN_CHECK) {\n        if ((((size_t)input) & 7)==0) {  /* Input is aligned, let's leverage the speed advantage */\n            if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n                return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);\n            else\n                return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);\n    }   }\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);\n    else\n        return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);\n#endif\n}\n\n\n/* **************************************************\n*  Advanced Hash Functions\n****************************************************/\n\nXXH_PUBLIC_API XXH32_state_t* XXH32_createState(void)\n{\n    return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));\n}\nXXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)\n{\n    XXH_free(statePtr);\n    return XXH_OK;\n}\n\nXXH_PUBLIC_API XXH64_state_t* XXH64_createState(void)\n{\n    return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t));\n}\nXXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)\n{\n    XXH_free(statePtr);\n    return XXH_OK;\n}\n\n\n/*** Hash feed ***/\n\nXXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed)\n{\n    XXH32_state_t state;   /* using a local state to memcpy() in order to avoid strict-aliasing warnings */\n    ZSTD_memset(&state, 0, sizeof(state)-4);   /* do not write into reserved, for future removal */\n    state.v1 = seed + PRIME32_1 + PRIME32_2;\n    state.v2 = seed + PRIME32_2;\n    state.v3 = seed + 0;\n    state.v4 = seed - PRIME32_1;\n    ZSTD_memcpy(statePtr, &state, sizeof(state));\n    return XXH_OK;\n}\n\n\nXXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed)\n{\n    XXH64_state_t state;   /* using a local state to memcpy() in order to avoid strict-aliasing warnings */\n    ZSTD_memset(&state, 0, sizeof(state)-8);   /* do not write into reserved, for future removal */\n    state.v1 = seed + PRIME64_1 + PRIME64_2;\n    state.v2 = seed + PRIME64_2;\n    state.v3 = seed + 0;\n    state.v4 = seed - PRIME64_1;\n    ZSTD_memcpy(statePtr, &state, sizeof(state));\n    return XXH_OK;\n}\n\n\nFORCE_INLINE_TEMPLATE XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian)\n{\n    const BYTE* p = (const BYTE*)input;\n    const BYTE* const bEnd = p + len;\n\n#ifdef XXH_ACCEPT_NULL_INPUT_POINTER\n    if (input==NULL) return XXH_ERROR;\n#endif\n\n    state->total_len_32 += (unsigned)len;\n    state->large_len |= (len>=16) | (state->total_len_32>=16);\n\n    if (state->memsize + len < 16)  {   /* fill in tmp buffer */\n        XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len);\n        state->memsize += (unsigned)len;\n        return XXH_OK;\n    }\n\n    if (state->memsize) {   /* some data left from previous update */\n        XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize);\n        {   const U32* p32 = state->mem32;\n            state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++;\n            state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++;\n            state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++;\n            state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); p32++;\n        }\n        p += 16-state->memsize;\n        state->memsize = 0;\n    }\n\n    if (p <= bEnd-16) {\n        const BYTE* const limit = bEnd - 16;\n        U32 v1 = state->v1;\n        U32 v2 = state->v2;\n        U32 v3 = state->v3;\n        U32 v4 = state->v4;\n\n        do {\n            v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4;\n            v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4;\n            v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4;\n            v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4;\n        } while (p<=limit);\n\n        state->v1 = v1;\n        state->v2 = v2;\n        state->v3 = v3;\n        state->v4 = v4;\n    }\n\n    if (p < bEnd) {\n        XXH_memcpy(state->mem32, p, (size_t)(bEnd-p));\n        state->memsize = (unsigned)(bEnd-p);\n    }\n\n    return XXH_OK;\n}\n\nXXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len)\n{\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH32_update_endian(state_in, input, len, XXH_littleEndian);\n    else\n        return XXH32_update_endian(state_in, input, len, XXH_bigEndian);\n}\n\n\n\nFORCE_INLINE_TEMPLATE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)\n{\n    const BYTE * p = (const BYTE*)state->mem32;\n    const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize;\n    U32 h32;\n\n    if (state->large_len) {\n        h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);\n    } else {\n        h32 = state->v3 /* == seed */ + PRIME32_5;\n    }\n\n    h32 += state->total_len_32;\n\n    while (p+4<=bEnd) {\n        h32 += XXH_readLE32(p, endian) * PRIME32_3;\n        h32  = XXH_rotl32(h32, 17) * PRIME32_4;\n        p+=4;\n    }\n\n    while (p<bEnd) {\n        h32 += (*p) * PRIME32_5;\n        h32  = XXH_rotl32(h32, 11) * PRIME32_1;\n        p++;\n    }\n\n    h32 ^= h32 >> 15;\n    h32 *= PRIME32_2;\n    h32 ^= h32 >> 13;\n    h32 *= PRIME32_3;\n    h32 ^= h32 >> 16;\n\n    return h32;\n}\n\n\nXXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in)\n{\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH32_digest_endian(state_in, XXH_littleEndian);\n    else\n        return XXH32_digest_endian(state_in, XXH_bigEndian);\n}\n\n\n\n/* **** XXH64 **** */\n\nFORCE_INLINE_TEMPLATE XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian)\n{\n    const BYTE* p = (const BYTE*)input;\n    const BYTE* const bEnd = p + len;\n\n#ifdef XXH_ACCEPT_NULL_INPUT_POINTER\n    if (input==NULL) return XXH_ERROR;\n#endif\n\n    state->total_len += len;\n\n    if (state->memsize + len < 32) {  /* fill in tmp buffer */\n        if (input != NULL) {\n            XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len);\n        }\n        state->memsize += (U32)len;\n        return XXH_OK;\n    }\n\n    if (state->memsize) {   /* tmp buffer is full */\n        XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize);\n        state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian));\n        state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian));\n        state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian));\n        state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian));\n        p += 32-state->memsize;\n        state->memsize = 0;\n    }\n\n    if (p+32 <= bEnd) {\n        const BYTE* const limit = bEnd - 32;\n        U64 v1 = state->v1;\n        U64 v2 = state->v2;\n        U64 v3 = state->v3;\n        U64 v4 = state->v4;\n\n        do {\n            v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8;\n            v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8;\n            v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8;\n            v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8;\n        } while (p<=limit);\n\n        state->v1 = v1;\n        state->v2 = v2;\n        state->v3 = v3;\n        state->v4 = v4;\n    }\n\n    if (p < bEnd) {\n        XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));\n        state->memsize = (unsigned)(bEnd-p);\n    }\n\n    return XXH_OK;\n}\n\nXXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len)\n{\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH64_update_endian(state_in, input, len, XXH_littleEndian);\n    else\n        return XXH64_update_endian(state_in, input, len, XXH_bigEndian);\n}\n\n\n\nFORCE_INLINE_TEMPLATE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian)\n{\n    const BYTE * p = (const BYTE*)state->mem64;\n    const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize;\n    U64 h64;\n\n    if (state->total_len >= 32) {\n        U64 const v1 = state->v1;\n        U64 const v2 = state->v2;\n        U64 const v3 = state->v3;\n        U64 const v4 = state->v4;\n\n        h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);\n        h64 = XXH64_mergeRound(h64, v1);\n        h64 = XXH64_mergeRound(h64, v2);\n        h64 = XXH64_mergeRound(h64, v3);\n        h64 = XXH64_mergeRound(h64, v4);\n    } else {\n        h64  = state->v3 + PRIME64_5;\n    }\n\n    h64 += (U64) state->total_len;\n\n    while (p+8<=bEnd) {\n        U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian));\n        h64 ^= k1;\n        h64  = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4;\n        p+=8;\n    }\n\n    if (p+4<=bEnd) {\n        h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1;\n        h64  = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;\n        p+=4;\n    }\n\n    while (p<bEnd) {\n        h64 ^= (*p) * PRIME64_5;\n        h64  = XXH_rotl64(h64, 11) * PRIME64_1;\n        p++;\n    }\n\n    h64 ^= h64 >> 33;\n    h64 *= PRIME64_2;\n    h64 ^= h64 >> 29;\n    h64 *= PRIME64_3;\n    h64 ^= h64 >> 32;\n\n    return h64;\n}\n\n\nXXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in)\n{\n    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;\n\n    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)\n        return XXH64_digest_endian(state_in, XXH_littleEndian);\n    else\n        return XXH64_digest_endian(state_in, XXH_bigEndian);\n}\n\n\n/* **************************\n*  Canonical representation\n****************************/\n\n/*! Default XXH result types are basic unsigned 32 and 64 bits.\n*   The canonical representation follows human-readable write convention, aka big-endian (large digits first).\n*   These functions allow transformation of hash result into and from its canonical format.\n*   This way, hash values can be written into a file or buffer, and remain comparable across different systems and programs.\n*/\n\nXXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash)\n{\n    XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));\n    if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash);\n    ZSTD_memcpy(dst, &hash, sizeof(*dst));\n}\n\nXXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash)\n{\n    XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));\n    if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash);\n    ZSTD_memcpy(dst, &hash, sizeof(*dst));\n}\n\nXXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)\n{\n    return XXH_readBE32(src);\n}\n\nXXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src)\n{\n    return XXH_readBE64(src);\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/xxhash.h",
    "content": "/*\n * xxHash - Extremely Fast Hash algorithm\n * Header File\n * Copyright (c) 2012-2020, Yann Collet, Facebook, Inc.\n *\n * You can contact the author at :\n * - xxHash source repository : https://github.com/Cyan4973/xxHash\n * \n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n*/\n\n/* Notice extracted from xxHash homepage :\n\nxxHash is an extremely fast Hash algorithm, running at RAM speed limits.\nIt also successfully passes all tests from the SMHasher suite.\n\nComparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz)\n\nName            Speed       Q.Score   Author\nxxHash          5.4 GB/s     10\nCrapWow         3.2 GB/s      2       Andrew\nMumurHash 3a    2.7 GB/s     10       Austin Appleby\nSpookyHash      2.0 GB/s     10       Bob Jenkins\nSBox            1.4 GB/s      9       Bret Mulvey\nLookup3         1.2 GB/s      9       Bob Jenkins\nSuperFastHash   1.2 GB/s      1       Paul Hsieh\nCityHash64      1.05 GB/s    10       Pike & Alakuijala\nFNV             0.55 GB/s     5       Fowler, Noll, Vo\nCRC32           0.43 GB/s     9\nMD5-32          0.33 GB/s    10       Ronald L. Rivest\nSHA1-32         0.28 GB/s    10\n\nQ.Score is a measure of quality of the hash function.\nIt depends on successfully passing SMHasher test set.\n10 is a perfect score.\n\nA 64-bits version, named XXH64, is available since r35.\nIt offers much better speed, but for 64-bits applications only.\nName     Speed on 64 bits    Speed on 32 bits\nXXH64       13.8 GB/s            1.9 GB/s\nXXH32        6.8 GB/s            6.0 GB/s\n*/\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef XXHASH_H_5627135585666179\n#define XXHASH_H_5627135585666179 1\n\n\n/* ****************************\n*  Definitions\n******************************/\n#include \"zstd_deps.h\"\ntypedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;\n\n\n/* ****************************\n*  API modifier\n******************************/\n/** XXH_PRIVATE_API\n*   This is useful if you want to include xxhash functions in `static` mode\n*   in order to inline them, and remove their symbol from the public list.\n*   Methodology :\n*     #define XXH_PRIVATE_API\n*     #include \"xxhash.h\"\n*   `xxhash.c` is automatically included.\n*   It's not useful to compile and link it as a separate module anymore.\n*/\n#ifdef XXH_PRIVATE_API\n#  ifndef XXH_STATIC_LINKING_ONLY\n#    define XXH_STATIC_LINKING_ONLY\n#  endif\n#  if defined(__GNUC__)\n#    define XXH_PUBLIC_API static __inline __attribute__((unused))\n#  elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#    define XXH_PUBLIC_API static inline\n#  elif defined(_MSC_VER)\n#    define XXH_PUBLIC_API static __inline\n#  else\n#    define XXH_PUBLIC_API static   /* this version may generate warnings for unused static functions; disable the relevant warning */\n#  endif\n#else\n#  define XXH_PUBLIC_API   /* do nothing */\n#endif /* XXH_PRIVATE_API */\n\n/*!XXH_NAMESPACE, aka Namespace Emulation :\n\nIf you want to include _and expose_ xxHash functions from within your own library,\nbut also want to avoid symbol collisions with another library which also includes xxHash,\n\nyou can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library\nwith the value of XXH_NAMESPACE (so avoid to keep it NULL and avoid numeric values).\n\nNote that no change is required within the calling program as long as it includes `xxhash.h` :\nregular symbol name will be automatically translated by this header.\n*/\n#ifdef XXH_NAMESPACE\n#  define XXH_CAT(A,B) A##B\n#  define XXH_NAME2(A,B) XXH_CAT(A,B)\n#  define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32)\n#  define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64)\n#  define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber)\n#  define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState)\n#  define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState)\n#  define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)\n#  define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)\n#  define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset)\n#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)\n#  define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update)\n#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)\n#  define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest)\n#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)\n#  define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)\n#  define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)\n#  define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)\n#  define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)\n#  define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)\n#  define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)\n#endif\n\n\n/* *************************************\n*  Version\n***************************************/\n#define XXH_VERSION_MAJOR    0\n#define XXH_VERSION_MINOR    6\n#define XXH_VERSION_RELEASE  2\n#define XXH_VERSION_NUMBER  (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)\nXXH_PUBLIC_API unsigned XXH_versionNumber (void);\n\n\n/* ****************************\n*  Simple Hash Functions\n******************************/\ntypedef unsigned int       XXH32_hash_t;\ntypedef unsigned long long XXH64_hash_t;\n\nXXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);\nXXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);\n\n/*!\nXXH32() :\n    Calculate the 32-bits hash of sequence \"length\" bytes stored at memory address \"input\".\n    The memory between input & input+length must be valid (allocated and read-accessible).\n    \"seed\" can be used to alter the result predictably.\n    Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s\nXXH64() :\n    Calculate the 64-bits hash of sequence of length \"len\" stored at memory address \"input\".\n    \"seed\" can be used to alter the result predictably.\n    This function runs 2x faster on 64-bits systems, but slower on 32-bits systems (see benchmark).\n*/\n\n\n/* ****************************\n*  Streaming Hash Functions\n******************************/\ntypedef struct XXH32_state_s XXH32_state_t;   /* incomplete type */\ntypedef struct XXH64_state_s XXH64_state_t;   /* incomplete type */\n\n/*! State allocation, compatible with dynamic libraries */\n\nXXH_PUBLIC_API XXH32_state_t* XXH32_createState(void);\nXXH_PUBLIC_API XXH_errorcode  XXH32_freeState(XXH32_state_t* statePtr);\n\nXXH_PUBLIC_API XXH64_state_t* XXH64_createState(void);\nXXH_PUBLIC_API XXH_errorcode  XXH64_freeState(XXH64_state_t* statePtr);\n\n\n/* hash streaming */\n\nXXH_PUBLIC_API XXH_errorcode XXH32_reset  (XXH32_state_t* statePtr, unsigned int seed);\nXXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);\nXXH_PUBLIC_API XXH32_hash_t  XXH32_digest (const XXH32_state_t* statePtr);\n\nXXH_PUBLIC_API XXH_errorcode XXH64_reset  (XXH64_state_t* statePtr, unsigned long long seed);\nXXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);\nXXH_PUBLIC_API XXH64_hash_t  XXH64_digest (const XXH64_state_t* statePtr);\n\n/*\nThese functions generate the xxHash of an input provided in multiple segments.\nNote that, for small input, they are slower than single-call functions, due to state management.\nFor small input, prefer `XXH32()` and `XXH64()` .\n\nXXH state must first be allocated, using XXH*_createState() .\n\nStart a new hash by initializing state with a seed, using XXH*_reset().\n\nThen, feed the hash state by calling XXH*_update() as many times as necessary.\nObviously, input must be allocated and read accessible.\nThe function returns an error code, with 0 meaning OK, and any other value meaning there is an error.\n\nFinally, a hash value can be produced anytime, by using XXH*_digest().\nThis function returns the nn-bits hash as an int or long long.\n\nIt's still possible to continue inserting input into the hash state after a digest,\nand generate some new hashes later on, by calling again XXH*_digest().\n\nWhen done, free XXH state space if it was allocated dynamically.\n*/\n\n\n/* **************************\n*  Utils\n****************************/\n#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))   /* ! C99 */\n#  define restrict   /* disable restrict */\n#endif\n\nXXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);\nXXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);\n\n\n/* **************************\n*  Canonical representation\n****************************/\n/* Default result type for XXH functions are primitive unsigned 32 and 64 bits.\n*  The canonical representation uses human-readable write convention, aka big-endian (large digits first).\n*  These functions allow transformation of hash result into and from its canonical format.\n*  This way, hash values can be written into a file / memory, and remain comparable on different systems and programs.\n*/\ntypedef struct { unsigned char digest[4]; } XXH32_canonical_t;\ntypedef struct { unsigned char digest[8]; } XXH64_canonical_t;\n\nXXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);\nXXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);\n\nXXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);\nXXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);\n\n#endif /* XXHASH_H_5627135585666179 */\n\n\n\n/* ================================================================================================\n   This section contains definitions which are not guaranteed to remain stable.\n   They may change in future versions, becoming incompatible with a different version of the library.\n   They shall only be used with static linking.\n   Never use these definitions in association with dynamic linking !\n=================================================================================================== */\n#if defined(XXH_STATIC_LINKING_ONLY) && !defined(XXH_STATIC_H_3543687687345)\n#define XXH_STATIC_H_3543687687345\n\n/* These definitions are only meant to allow allocation of XXH state\n   statically, on stack, or in a struct for example.\n   Do not use members directly. */\n\n   struct XXH32_state_s {\n       unsigned total_len_32;\n       unsigned large_len;\n       unsigned v1;\n       unsigned v2;\n       unsigned v3;\n       unsigned v4;\n       unsigned mem32[4];   /* buffer defined as U32 for alignment */\n       unsigned memsize;\n       unsigned reserved;   /* never read nor write, will be removed in a future version */\n   };   /* typedef'd to XXH32_state_t */\n\n   struct XXH64_state_s {\n       unsigned long long total_len;\n       unsigned long long v1;\n       unsigned long long v2;\n       unsigned long long v3;\n       unsigned long long v4;\n       unsigned long long mem64[4];   /* buffer defined as U64 for alignment */\n       unsigned memsize;\n       unsigned reserved[2];          /* never read nor write, will be removed in a future version */\n   };   /* typedef'd to XXH64_state_t */\n\n\n#  ifdef XXH_PRIVATE_API\n#    include \"xxhash.c\"   /* include xxhash functions as `static`, for inlining */\n#  endif\n\n#endif /* XXH_STATIC_LINKING_ONLY && XXH_STATIC_H_3543687687345 */\n\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/zstd_common.c",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n\n/*-*************************************\n*  Dependencies\n***************************************/\n#define ZSTD_DEPS_NEED_MALLOC\n#include \"zstd_deps.h\"   /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */\n#include \"error_private.h\"\n#include \"zstd_internal.h\"\n\n\n/*-****************************************\n*  Version\n******************************************/\nunsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }\n\nconst char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }\n\n\n/*-****************************************\n*  ZSTD Error Management\n******************************************/\n#undef ZSTD_isError   /* defined within zstd_internal.h */\n/*! ZSTD_isError() :\n *  tells if a return value is an error code\n *  symbol is required for external callers */\nunsigned ZSTD_isError(size_t code) { return ERR_isError(code); }\n\n/*! ZSTD_getErrorName() :\n *  provides error code string from function result (useful for debugging) */\nconst char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\n/*! ZSTD_getError() :\n *  convert a `size_t` function result into a proper ZSTD_errorCode enum */\nZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }\n\n/*! ZSTD_getErrorString() :\n *  provides error code string from enum */\nconst char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }\n\n\n\n/*=**************************************************************\n*  Custom allocator\n****************************************************************/\nvoid* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)\n{\n    if (customMem.customAlloc)\n        return customMem.customAlloc(customMem.opaque, size);\n    return ZSTD_malloc(size);\n}\n\nvoid* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)\n{\n    if (customMem.customAlloc) {\n        /* calloc implemented as malloc+memset;\n         * not as efficient as calloc, but next best guess for custom malloc */\n        void* const ptr = customMem.customAlloc(customMem.opaque, size);\n        ZSTD_memset(ptr, 0, size);\n        return ptr;\n    }\n    return ZSTD_calloc(1, size);\n}\n\nvoid ZSTD_customFree(void* ptr, ZSTD_customMem customMem)\n{\n    if (ptr!=NULL) {\n        if (customMem.customFree)\n            customMem.customFree(customMem.opaque, ptr);\n        else\n            ZSTD_free(ptr);\n    }\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/zstd_deps.h",
    "content": "/*\n * Copyright (c) 2016-2020, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* This file provides common libc dependencies that zstd requires.\n * The purpose is to allow replacing this file with a custom implementation\n * to compile zstd without libc support.\n */\n\n/* Need:\n * NULL\n * INT_MAX\n * UINT_MAX\n * ZSTD_memcpy()\n * ZSTD_memset()\n * ZSTD_memmove()\n */\n#ifndef ZSTD_DEPS_COMMON\n#define ZSTD_DEPS_COMMON\n\n#include <limits.h>\n#include <stddef.h>\n#include <string.h>\n\n#if defined(__GNUC__) && __GNUC__ >= 4\n# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))\n# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))\n# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))\n#else\n# define ZSTD_memcpy(d,s,l) memcpy((d),(s),(l))\n# define ZSTD_memmove(d,s,l) memmove((d),(s),(l))\n# define ZSTD_memset(p,v,l) memset((p),(v),(l))\n#endif\n\n#endif /* ZSTD_DEPS_COMMON */\n\n/* Need:\n * ZSTD_malloc()\n * ZSTD_free()\n * ZSTD_calloc()\n */\n#ifdef ZSTD_DEPS_NEED_MALLOC\n#ifndef ZSTD_DEPS_MALLOC\n#define ZSTD_DEPS_MALLOC\n\n#include <stdlib.h>\n\n#define ZSTD_malloc(s) malloc(s)\n#define ZSTD_calloc(n,s) calloc((n), (s))\n#define ZSTD_free(p) free((p))\n\n#endif /* ZSTD_DEPS_MALLOC */\n#endif /* ZSTD_DEPS_NEED_MALLOC */\n\n/*\n * Provides 64-bit math support.\n * Need:\n * U64 ZSTD_div64(U64 dividend, U32 divisor)\n */\n#ifdef ZSTD_DEPS_NEED_MATH64\n#ifndef ZSTD_DEPS_MATH64\n#define ZSTD_DEPS_MATH64\n\n#define ZSTD_div64(dividend, divisor) ((dividend) / (divisor))\n\n#endif /* ZSTD_DEPS_MATH64 */\n#endif /* ZSTD_DEPS_NEED_MATH64 */\n\n/* Need:\n * assert()\n */\n#ifdef ZSTD_DEPS_NEED_ASSERT\n#ifndef ZSTD_DEPS_ASSERT\n#define ZSTD_DEPS_ASSERT\n\n#include <assert.h>\n\n#endif /* ZSTD_DEPS_ASSERT */\n#endif /* ZSTD_DEPS_NEED_ASSERT */\n\n/* Need:\n * ZSTD_DEBUG_PRINT()\n */\n#ifdef ZSTD_DEPS_NEED_IO\n#ifndef ZSTD_DEPS_IO\n#define ZSTD_DEPS_IO\n\n#include <stdio.h>\n#define ZSTD_DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)\n\n#endif /* ZSTD_DEPS_IO */\n#endif /* ZSTD_DEPS_NEED_IO */\n\n/* Only requested when <stdint.h> is known to be present.\n * Need:\n * intptr_t\n */\n#ifdef ZSTD_DEPS_NEED_STDINT\n#ifndef ZSTD_DEPS_STDINT\n#define ZSTD_DEPS_STDINT\n\n#include <stdint.h>\n\n#endif /* ZSTD_DEPS_STDINT */\n#endif /* ZSTD_DEPS_NEED_STDINT */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/zstd_errors.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_ERRORS_H_398273423\n#define ZSTD_ERRORS_H_398273423\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/*===== dependency =====*/\n#include <stddef.h>   /* size_t */\n\n\n/* =====   ZSTDERRORLIB_API : control library symbols visibility   ===== */\n#ifndef ZSTDERRORLIB_VISIBILITY\n#  if defined(__GNUC__) && (__GNUC__ >= 4)\n#    define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility (\"default\")))\n#  else\n#    define ZSTDERRORLIB_VISIBILITY\n#  endif\n#endif\n#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)\n#  define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY\n#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)\n#  define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY\n#endif\n\n/*-*********************************************\n *  Error codes list\n *-*********************************************\n *  Error codes _values_ are pinned down since v1.3.1 only.\n *  Therefore, don't rely on values if you may link to any version < v1.3.1.\n *\n *  Only values < 100 are considered stable.\n *\n *  note 1 : this API shall be used with static linking only.\n *           dynamic linking is not yet officially supported.\n *  note 2 : Prefer relying on the enum than on its value whenever possible\n *           This is the only supported way to use the error list < v1.3.1\n *  note 3 : ZSTD_isError() is always correct, whatever the library version.\n **********************************************/\ntypedef enum {\n  ZSTD_error_no_error = 0,\n  ZSTD_error_GENERIC  = 1,\n  ZSTD_error_prefix_unknown                = 10,\n  ZSTD_error_version_unsupported           = 12,\n  ZSTD_error_frameParameter_unsupported    = 14,\n  ZSTD_error_frameParameter_windowTooLarge = 16,\n  ZSTD_error_corruption_detected = 20,\n  ZSTD_error_checksum_wrong      = 22,\n  ZSTD_error_dictionary_corrupted      = 30,\n  ZSTD_error_dictionary_wrong          = 32,\n  ZSTD_error_dictionaryCreation_failed = 34,\n  ZSTD_error_parameter_unsupported   = 40,\n  ZSTD_error_parameter_outOfBound    = 42,\n  ZSTD_error_tableLog_tooLarge       = 44,\n  ZSTD_error_maxSymbolValue_tooLarge = 46,\n  ZSTD_error_maxSymbolValue_tooSmall = 48,\n  ZSTD_error_stage_wrong       = 60,\n  ZSTD_error_init_missing      = 62,\n  ZSTD_error_memory_allocation = 64,\n  ZSTD_error_workSpace_tooSmall= 66,\n  ZSTD_error_dstSize_tooSmall = 70,\n  ZSTD_error_srcSize_wrong    = 72,\n  ZSTD_error_dstBuffer_null   = 74,\n  /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */\n  ZSTD_error_frameIndex_tooLarge = 100,\n  ZSTD_error_seekableIO          = 102,\n  ZSTD_error_dstBuffer_wrong     = 104,\n  ZSTD_error_srcBuffer_wrong     = 105,\n  ZSTD_error_maxCode = 120  /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */\n} ZSTD_ErrorCode;\n\n/*! ZSTD_getErrorCode() :\n    convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,\n    which can be used to compare with enum list published above */\nZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);\nZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);   /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */\n\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* ZSTD_ERRORS_H_398273423 */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/common/zstd_internal.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_CCOMMON_H_MODULE\n#define ZSTD_CCOMMON_H_MODULE\n\n/* this module contains definitions which must be identical\n * across compression, decompression and dictBuilder.\n * It also contains a few functions useful to at least 2 of them\n * and which benefit from being inlined */\n\n/*-*************************************\n*  Dependencies\n***************************************/\n#if !defined(ZSTD_NO_INTRINSICS) && defined(__ARM_NEON)\n#include <arm_neon.h>\n#endif\n#include \"compiler.h\"\n#include \"mem.h\"\n#include \"debug.h\"                 /* assert, DEBUGLOG, RAWLOG, g_debuglevel */\n#include \"error_private.h\"\n#define ZSTD_STATIC_LINKING_ONLY\n#include \"../zstd.h\"\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#define HUF_STATIC_LINKING_ONLY\n#include \"huf.h\"\n#ifndef XXH_STATIC_LINKING_ONLY\n#  define XXH_STATIC_LINKING_ONLY  /* XXH64_state_t */\n#endif\n#include \"xxhash.h\"                /* XXH_reset, update, digest */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/* ---- static assert (debug) --- */\n#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)\n#define ZSTD_isError ERR_isError   /* for inlining */\n#define FSE_isError  ERR_isError\n#define HUF_isError  ERR_isError\n\n\n/*-*************************************\n*  shared macros\n***************************************/\n#undef MIN\n#undef MAX\n#define MIN(a,b) ((a)<(b) ? (a) : (b))\n#define MAX(a,b) ((a)>(b) ? (a) : (b))\n\n/**\n * Ignore: this is an internal helper.\n *\n * This is a helper function to help force C99-correctness during compilation.\n * Under strict compilation modes, variadic macro arguments can't be empty.\n * However, variadic function arguments can be. Using a function therefore lets\n * us statically check that at least one (string) argument was passed,\n * independent of the compilation flags.\n */\nstatic INLINE_KEYWORD UNUSED_ATTR\nvoid _force_has_format_string(const char *format, ...) {\n  (void)format;\n}\n\n/**\n * Ignore: this is an internal helper.\n *\n * We want to force this function invocation to be syntactically correct, but\n * we don't want to force runtime evaluation of its arguments.\n */\n#define _FORCE_HAS_FORMAT_STRING(...) \\\n  if (0) { \\\n    _force_has_format_string(__VA_ARGS__); \\\n  }\n\n/**\n * Return the specified error if the condition evaluates to true.\n *\n * In debug modes, prints additional information.\n * In order to do that (particularly, printing the conditional that failed),\n * this can't just wrap RETURN_ERROR().\n */\n#define RETURN_ERROR_IF(cond, err, ...) \\\n  if (cond) { \\\n    RAWLOG(3, \"%s:%d: ERROR!: check %s failed, returning %s\", \\\n           __FILE__, __LINE__, ZSTD_QUOTE(cond), ZSTD_QUOTE(ERROR(err))); \\\n    _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \\\n    RAWLOG(3, \": \" __VA_ARGS__); \\\n    RAWLOG(3, \"\\n\"); \\\n    return ERROR(err); \\\n  }\n\n/**\n * Unconditionally return the specified error.\n *\n * In debug modes, prints additional information.\n */\n#define RETURN_ERROR(err, ...) \\\n  do { \\\n    RAWLOG(3, \"%s:%d: ERROR!: unconditional check failed, returning %s\", \\\n           __FILE__, __LINE__, ZSTD_QUOTE(ERROR(err))); \\\n    _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \\\n    RAWLOG(3, \": \" __VA_ARGS__); \\\n    RAWLOG(3, \"\\n\"); \\\n    return ERROR(err); \\\n  } while(0);\n\n/**\n * If the provided expression evaluates to an error code, returns that error code.\n *\n * In debug modes, prints additional information.\n */\n#define FORWARD_IF_ERROR(err, ...) \\\n  do { \\\n    size_t const err_code = (err); \\\n    if (ERR_isError(err_code)) { \\\n      RAWLOG(3, \"%s:%d: ERROR!: forwarding error in %s: %s\", \\\n             __FILE__, __LINE__, ZSTD_QUOTE(err), ERR_getErrorName(err_code)); \\\n      _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \\\n      RAWLOG(3, \": \" __VA_ARGS__); \\\n      RAWLOG(3, \"\\n\"); \\\n      return err_code; \\\n    } \\\n  } while(0);\n\n\n/*-*************************************\n*  Common constants\n***************************************/\n#define ZSTD_OPT_NUM    (1<<12)\n\n#define ZSTD_REP_NUM      3                 /* number of repcodes */\n#define ZSTD_REP_MOVE     (ZSTD_REP_NUM-1)\nstatic UNUSED_ATTR const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 };\n\n#define KB *(1 <<10)\n#define MB *(1 <<20)\n#define GB *(1U<<30)\n\n#define BIT7 128\n#define BIT6  64\n#define BIT5  32\n#define BIT4  16\n#define BIT1   2\n#define BIT0   1\n\n#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10\nstatic UNUSED_ATTR const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 };\nstatic UNUSED_ATTR const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 };\n\n#define ZSTD_FRAMEIDSIZE 4   /* magic number size */\n\n#define ZSTD_BLOCKHEADERSIZE 3   /* C standard doesn't allow `static const` variable to be init using another `static const` variable */\nstatic UNUSED_ATTR const size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE;\ntypedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;\n\n#define ZSTD_FRAMECHECKSUMSIZE 4\n\n#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */\n#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */\n\n#define HufLog 12\ntypedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e;\n\n#define LONGNBSEQ 0x7F00\n\n#define MINMATCH 3\n\n#define Litbits  8\n#define MaxLit ((1<<Litbits) - 1)\n#define MaxML   52\n#define MaxLL   35\n#define DefaultMaxOff 28\n#define MaxOff  31\n#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */\n#define MLFSELog    9\n#define LLFSELog    9\n#define OffFSELog   8\n#define MaxFSELog  MAX(MAX(MLFSELog, LLFSELog), OffFSELog)\n\n#define ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */\n/* Each table cannot take more than #symbols * FSELog bits */\n#define ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8)\n\nstatic UNUSED_ATTR const U32 LL_bits[MaxLL+1] = {\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     1, 1, 1, 1, 2, 2, 3, 3,\n     4, 6, 7, 8, 9,10,11,12,\n    13,14,15,16\n};\nstatic UNUSED_ATTR const S16 LL_defaultNorm[MaxLL+1] = {\n     4, 3, 2, 2, 2, 2, 2, 2,\n     2, 2, 2, 2, 2, 1, 1, 1,\n     2, 2, 2, 2, 2, 2, 2, 2,\n     2, 3, 2, 1, 1, 1, 1, 1,\n    -1,-1,-1,-1\n};\n#define LL_DEFAULTNORMLOG 6  /* for static allocation */\nstatic UNUSED_ATTR const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG;\n\nstatic UNUSED_ATTR const U32 ML_bits[MaxML+1] = {\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     1, 1, 1, 1, 2, 2, 3, 3,\n     4, 4, 5, 7, 8, 9,10,11,\n    12,13,14,15,16\n};\nstatic UNUSED_ATTR const S16 ML_defaultNorm[MaxML+1] = {\n     1, 4, 3, 2, 2, 2, 2, 2,\n     2, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1,-1,-1,\n    -1,-1,-1,-1,-1\n};\n#define ML_DEFAULTNORMLOG 6  /* for static allocation */\nstatic UNUSED_ATTR const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG;\n\nstatic UNUSED_ATTR const S16 OF_defaultNorm[DefaultMaxOff+1] = {\n     1, 1, 1, 1, 1, 1, 2, 2,\n     2, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n    -1,-1,-1,-1,-1\n};\n#define OF_DEFAULTNORMLOG 5  /* for static allocation */\nstatic UNUSED_ATTR const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG;\n\n\n/*-*******************************************\n*  Shared functions to include for inlining\n*********************************************/\nstatic void ZSTD_copy8(void* dst, const void* src) {\n#if !defined(ZSTD_NO_INTRINSICS) && defined(__ARM_NEON)\n    vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src));\n#else\n    ZSTD_memcpy(dst, src, 8);\n#endif\n}\n\n#define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; }\nstatic void ZSTD_copy16(void* dst, const void* src) {\n#if !defined(ZSTD_NO_INTRINSICS) && defined(__ARM_NEON)\n    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));\n#else\n    ZSTD_memcpy(dst, src, 16);\n#endif\n}\n#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; }\n\n#define WILDCOPY_OVERLENGTH 32\n#define WILDCOPY_VECLEN 16\n\ntypedef enum {\n    ZSTD_no_overlap,\n    ZSTD_overlap_src_before_dst\n    /*  ZSTD_overlap_dst_before_src, */\n} ZSTD_overlap_e;\n\n/*! ZSTD_wildcopy() :\n *  Custom version of ZSTD_memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0)\n *  @param ovtype controls the overlap detection\n *         - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.\n *         - ZSTD_overlap_src_before_dst: The src and dst may overlap, but they MUST be at least 8 bytes apart.\n *           The src buffer must be before the dst buffer.\n */\nMEM_STATIC FORCE_INLINE_ATTR\nvoid ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e const ovtype)\n{\n    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;\n    const BYTE* ip = (const BYTE*)src;\n    BYTE* op = (BYTE*)dst;\n    BYTE* const oend = op + length;\n\n    assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff <= -WILDCOPY_VECLEN));\n\n    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {\n        /* Handle short offset copies. */\n        do {\n            COPY8(op, ip)\n        } while (op < oend);\n    } else {\n        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);\n        /* Separate out the first COPY16() call because the copy length is\n         * almost certain to be short, so the branches have different\n         * probabilities. Since it is almost certain to be short, only do\n         * one COPY16() in the first call. Then, do two calls per loop since\n         * at that point it is more likely to have a high trip count.\n         */\n#ifdef __aarch64__\n        do {\n            COPY16(op, ip);\n        }\n        while (op < oend);\n#else\n        ZSTD_copy16(op, ip);\n        if (16 >= length) return;\n        op += 16;\n        ip += 16;\n        do {\n            COPY16(op, ip);\n            COPY16(op, ip);\n        }\n        while (op < oend);\n#endif\n    }\n}\n\nMEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    size_t const length = MIN(dstCapacity, srcSize);\n    if (length > 0) {\n        ZSTD_memcpy(dst, src, length);\n    }\n    return length;\n}\n\n/* define \"workspace is too large\" as this number of times larger than needed */\n#define ZSTD_WORKSPACETOOLARGE_FACTOR 3\n\n/* when workspace is continuously too large\n * during at least this number of times,\n * context's memory usage is considered wasteful,\n * because it's sized to handle a worst case scenario which rarely happens.\n * In which case, resize it down to free some memory */\n#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128\n\n/* Controls whether the input/output buffer is buffered or stable. */\ntypedef enum {\n    ZSTD_bm_buffered = 0,  /* Buffer the input/output */\n    ZSTD_bm_stable = 1     /* ZSTD_inBuffer/ZSTD_outBuffer is stable */\n} ZSTD_bufferMode_e;\n\n\n/*-*******************************************\n*  Private declarations\n*********************************************/\ntypedef struct seqDef_s {\n    U32 offset;         /* Offset code of the sequence */\n    U16 litLength;\n    U16 matchLength;\n} seqDef;\n\ntypedef struct {\n    seqDef* sequencesStart;\n    seqDef* sequences;      /* ptr to end of sequences */\n    BYTE* litStart;\n    BYTE* lit;              /* ptr to end of literals */\n    BYTE* llCode;\n    BYTE* mlCode;\n    BYTE* ofCode;\n    size_t maxNbSeq;\n    size_t maxNbLit;\n\n    /* longLengthPos and longLengthID to allow us to represent either a single litLength or matchLength\n     * in the seqStore that has a value larger than U16 (if it exists). To do so, we increment\n     * the existing value of the litLength or matchLength by 0x10000. \n     */\n    U32   longLengthID;   /* 0 == no longLength; 1 == Represent the long literal; 2 == Represent the long match; */\n    U32   longLengthPos;  /* Index of the sequence to apply long length modification to */\n} seqStore_t;\n\ntypedef struct {\n    U32 litLength;\n    U32 matchLength;\n} ZSTD_sequenceLength;\n\n/**\n * Returns the ZSTD_sequenceLength for the given sequences. It handles the decoding of long sequences\n * indicated by longLengthPos and longLengthID, and adds MINMATCH back to matchLength.\n */\nMEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength(seqStore_t const* seqStore, seqDef const* seq)\n{\n    ZSTD_sequenceLength seqLen;\n    seqLen.litLength = seq->litLength;\n    seqLen.matchLength = seq->matchLength + MINMATCH;\n    if (seqStore->longLengthPos == (U32)(seq - seqStore->sequencesStart)) {\n        if (seqStore->longLengthID == 1) {\n            seqLen.litLength += 0xFFFF;\n        }\n        if (seqStore->longLengthID == 2) {\n            seqLen.matchLength += 0xFFFF;\n        }\n    }\n    return seqLen;\n}\n\n/**\n * Contains the compressed frame size and an upper-bound for the decompressed frame size.\n * Note: before using `compressedSize`, check for errors using ZSTD_isError().\n *       similarly, before using `decompressedBound`, check for errors using:\n *          `decompressedBound != ZSTD_CONTENTSIZE_ERROR`\n */\ntypedef struct {\n    size_t compressedSize;\n    unsigned long long decompressedBound;\n} ZSTD_frameSizeInfo;   /* decompress & legacy */\n\nconst seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx);   /* compress & dictBuilder */\nvoid ZSTD_seqToCodes(const seqStore_t* seqStorePtr);   /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */\n\n/* custom memory allocation functions */\nvoid* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem);\nvoid* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem);\nvoid ZSTD_customFree(void* ptr, ZSTD_customMem customMem);\n\n\nMEM_STATIC U32 ZSTD_highbit32(U32 val)   /* compress, dictBuilder, decodeCorpus */\n{\n    assert(val != 0);\n    {\n#   if defined(_MSC_VER)   /* Visual */\n#       if STATIC_BMI2 == 1\n            return _lzcnt_u32(val)^31;\n#       else\n            unsigned long r=0;\n            return _BitScanReverse(&r, val) ? (unsigned)r : 0;\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* GCC Intrinsic */\n        return __builtin_clz (val) ^ 31;\n#   elif defined(__ICCARM__)    /* IAR Intrinsic */\n        return 31 - __CLZ(val);\n#   else   /* Software version */\n        static const U32 DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };\n        U32 v = val;\n        v |= v >> 1;\n        v |= v >> 2;\n        v |= v >> 4;\n        v |= v >> 8;\n        v |= v >> 16;\n        return DeBruijnClz[(v * 0x07C4ACDDU) >> 27];\n#   endif\n    }\n}\n\n\n/* ZSTD_invalidateRepCodes() :\n * ensures next compression will not use repcodes from previous block.\n * Note : only works with regular variant;\n *        do not use with extDict variant ! */\nvoid ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx);   /* zstdmt, adaptive_compression (shouldn't get this definition from here) */\n\n\ntypedef struct {\n    blockType_e blockType;\n    U32 lastBlock;\n    U32 origSize;\n} blockProperties_t;   /* declared here for decompress and fullbench */\n\n/*! ZSTD_getcBlockSize() :\n *  Provides the size of compressed block from block header `src` */\n/* Used by: decompress, fullbench (does not get its definition from here) */\nsize_t ZSTD_getcBlockSize(const void* src, size_t srcSize,\n                          blockProperties_t* bpPtr);\n\n/*! ZSTD_decodeSeqHeaders() :\n *  decode sequence header from src */\n/* Used by: decompress, fullbench (does not get its definition from here) */\nsize_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,\n                       const void* src, size_t srcSize);\n\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif   /* ZSTD_CCOMMON_H_MODULE */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/huf_decompress.c",
    "content": "/* ******************************************************************\n * huff0 huffman decoder,\n * part of Finite State Entropy library\n * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.\n *\n *  You can contact the author at :\n *  - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n/* **************************************************************\n*  Dependencies\n****************************************************************/\n#include \"../common/zstd_deps.h\"  /* ZSTD_memcpy, ZSTD_memset */\n#include \"../common/compiler.h\"\n#include \"../common/bitstream.h\"  /* BIT_* */\n#include \"../common/fse.h\"        /* to compress headers */\n#define HUF_STATIC_LINKING_ONLY\n#include \"../common/huf.h\"\n#include \"../common/error_private.h\"\n\n/* **************************************************************\n*  Macros\n****************************************************************/\n\n/* These two optional macros force the use one way or another of the two\n * Huffman decompression implementations. You can't force in both directions\n * at the same time.\n */\n#if defined(HUF_FORCE_DECOMPRESS_X1) && \\\n    defined(HUF_FORCE_DECOMPRESS_X2)\n#error \"Cannot force the use of the X1 and X2 decoders at the same time!\"\n#endif\n\n\n/* **************************************************************\n*  Error Management\n****************************************************************/\n#define HUF_isError ERR_isError\n\n\n/* **************************************************************\n*  Byte alignment for workSpace management\n****************************************************************/\n#define HUF_ALIGN(x, a)         HUF_ALIGN_MASK((x), (a) - 1)\n#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))\n\n\n/* **************************************************************\n*  BMI2 Variant Wrappers\n****************************************************************/\n#if DYNAMIC_BMI2\n\n#define HUF_DGEN(fn)                                                        \\\n                                                                            \\\n    static size_t fn##_default(                                             \\\n                  void* dst,  size_t dstSize,                               \\\n            const void* cSrc, size_t cSrcSize,                              \\\n            const HUF_DTable* DTable)                                       \\\n    {                                                                       \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }                                                                       \\\n                                                                            \\\n    static TARGET_ATTRIBUTE(\"bmi2\") size_t fn##_bmi2(                       \\\n                  void* dst,  size_t dstSize,                               \\\n            const void* cSrc, size_t cSrcSize,                              \\\n            const HUF_DTable* DTable)                                       \\\n    {                                                                       \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }                                                                       \\\n                                                                            \\\n    static size_t fn(void* dst, size_t dstSize, void const* cSrc,           \\\n                     size_t cSrcSize, HUF_DTable const* DTable, int bmi2)   \\\n    {                                                                       \\\n        if (bmi2) {                                                         \\\n            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \\\n        }                                                                   \\\n        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \\\n    }\n\n#else\n\n#define HUF_DGEN(fn)                                                        \\\n    static size_t fn(void* dst, size_t dstSize, void const* cSrc,           \\\n                     size_t cSrcSize, HUF_DTable const* DTable, int bmi2)   \\\n    {                                                                       \\\n        (void)bmi2;                                                         \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }\n\n#endif\n\n\n/*-***************************/\n/*  generic DTableDesc       */\n/*-***************************/\ntypedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc;\n\nstatic DTableDesc HUF_getDTableDesc(const HUF_DTable* table)\n{\n    DTableDesc dtd;\n    ZSTD_memcpy(&dtd, table, sizeof(dtd));\n    return dtd;\n}\n\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\n\n/*-***************************/\n/*  single-symbol decoding   */\n/*-***************************/\ntypedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1;   /* single-symbol decoding */\n\n/**\n * Packs 4 HUF_DEltX1 structs into a U64. This is used to lay down 4 entries at\n * a time.\n */\nstatic U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {\n    U64 D4;\n    if (MEM_isLittleEndian()) {\n        D4 = symbol + (nbBits << 8);\n    } else {\n        D4 = (symbol << 8) + nbBits;\n    }\n    D4 *= 0x0001000100010001ULL;\n    return D4;\n}\n\ntypedef struct {\n        U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1];\n        U32 rankStart[HUF_TABLELOG_ABSOLUTEMAX + 1];\n        U32 statsWksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];\n        BYTE symbols[HUF_SYMBOLVALUE_MAX + 1];\n        BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1];\n} HUF_ReadDTableX1_Workspace;\n\n\nsize_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize)\n{\n    return HUF_readDTableX1_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0);\n}\n\nsize_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2)\n{\n    U32 tableLog = 0;\n    U32 nbSymbols = 0;\n    size_t iSize;\n    void* const dtPtr = DTable + 1;\n    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;\n    HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace;\n\n    DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));\n    if (sizeof(*wksp) > wkspSize) return ERROR(tableLog_tooLarge);\n\n    DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));\n    /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */\n\n    iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), bmi2);\n    if (HUF_isError(iSize)) return iSize;\n\n    /* Table header */\n    {   DTableDesc dtd = HUF_getDTableDesc(DTable);\n        if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge);   /* DTable too small, Huffman tree cannot fit in */\n        dtd.tableType = 0;\n        dtd.tableLog = (BYTE)tableLog;\n        ZSTD_memcpy(DTable, &dtd, sizeof(dtd));\n    }\n\n    /* Compute symbols and rankStart given rankVal:\n     *\n     * rankVal already contains the number of values of each weight.\n     *\n     * symbols contains the symbols ordered by weight. First are the rankVal[0]\n     * weight 0 symbols, followed by the rankVal[1] weight 1 symbols, and so on.\n     * symbols[0] is filled (but unused) to avoid a branch.\n     *\n     * rankStart contains the offset where each rank belongs in the DTable.\n     * rankStart[0] is not filled because there are no entries in the table for\n     * weight 0.\n     */\n    {\n        int n;\n        int nextRankStart = 0;\n        int const unroll = 4;\n        int const nLimit = (int)nbSymbols - unroll + 1;\n        for (n=0; n<(int)tableLog+1; n++) {\n            U32 const curr = nextRankStart;\n            nextRankStart += wksp->rankVal[n];\n            wksp->rankStart[n] = curr;\n        }\n        for (n=0; n < nLimit; n += unroll) {\n            int u;\n            for (u=0; u < unroll; ++u) {\n                size_t const w = wksp->huffWeight[n+u];\n                wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u);\n            }\n        }\n        for (; n < (int)nbSymbols; ++n) {\n            size_t const w = wksp->huffWeight[n];\n            wksp->symbols[wksp->rankStart[w]++] = (BYTE)n;\n        }\n    }\n\n    /* fill DTable\n     * We fill all entries of each weight in order.\n     * That way length is a constant for each iteration of the outter loop.\n     * We can switch based on the length to a different inner loop which is\n     * optimized for that particular case.\n     */\n    {\n        U32 w;\n        int symbol=wksp->rankVal[0];\n        int rankStart=0;\n        for (w=1; w<tableLog+1; ++w) {\n            int const symbolCount = wksp->rankVal[w];\n            int const length = (1 << w) >> 1;\n            int uStart = rankStart;\n            BYTE const nbBits = (BYTE)(tableLog + 1 - w);\n            int s;\n            int u;\n            switch (length) {\n            case 1:\n                for (s=0; s<symbolCount; ++s) {\n                    HUF_DEltX1 D;\n                    D.byte = wksp->symbols[symbol + s];\n                    D.nbBits = nbBits;\n                    dt[uStart] = D;\n                    uStart += 1;\n                }\n                break;\n            case 2:\n                for (s=0; s<symbolCount; ++s) {\n                    HUF_DEltX1 D;\n                    D.byte = wksp->symbols[symbol + s];\n                    D.nbBits = nbBits;\n                    dt[uStart+0] = D;\n                    dt[uStart+1] = D;\n                    uStart += 2;\n                }\n                break;\n            case 4:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    MEM_write64(dt + uStart, D4);\n                    uStart += 4;\n                }\n                break;\n            case 8:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    MEM_write64(dt + uStart, D4);\n                    MEM_write64(dt + uStart + 4, D4);\n                    uStart += 8;\n                }\n                break;\n            default:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    for (u=0; u < length; u += 16) {\n                        MEM_write64(dt + uStart + u + 0, D4);\n                        MEM_write64(dt + uStart + u + 4, D4);\n                        MEM_write64(dt + uStart + u + 8, D4);\n                        MEM_write64(dt + uStart + u + 12, D4);\n                    }\n                    assert(u == length);\n                    uStart += length;\n                }\n                break;\n            }\n            symbol += symbolCount;\n            rankStart += symbolCount * length;\n        }\n    }\n    return iSize;\n}\n\nFORCE_INLINE_TEMPLATE BYTE\nHUF_decodeSymbolX1(BIT_DStream_t* Dstream, const HUF_DEltX1* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */\n    BYTE const c = dt[val].byte;\n    BIT_skipBits(Dstream, dt[val].nbBits);\n    return c;\n}\n\n#define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) \\\n    *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog)\n\n#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr)  \\\n    if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \\\n        HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr)\n\n#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr) \\\n    if (MEM_64bits()) \\\n        HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr)\n\nHINT_INLINE size_t\nHUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX1* const dt, const U32 dtLog)\n{\n    BYTE* const pStart = p;\n\n    /* up to 4 symbols at a time */\n    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {\n        HUF_DECODE_SYMBOLX1_2(p, bitDPtr);\n        HUF_DECODE_SYMBOLX1_1(p, bitDPtr);\n        HUF_DECODE_SYMBOLX1_2(p, bitDPtr);\n        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n    }\n\n    /* [0-3] symbols remaining */\n    if (MEM_32bits())\n        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd))\n            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n\n    /* no more data to retrieve from bitstream, no need to reload */\n    while (p < pEnd)\n        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n\n    return pEnd-pStart;\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress1X1_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    BYTE* op = (BYTE*)dst;\n    BYTE* const oend = op + dstSize;\n    const void* dtPtr = DTable + 1;\n    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;\n    BIT_DStream_t bitD;\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n    U32 const dtLog = dtd.tableLog;\n\n    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );\n\n    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);\n\n    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);\n\n    return dstSize;\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress4X1_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    /* Check */\n    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */\n\n    {   const BYTE* const istart = (const BYTE*) cSrc;\n        BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ostart + dstSize;\n        BYTE* const olimit = oend - 3;\n        const void* const dtPtr = DTable + 1;\n        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;\n\n        /* Init */\n        BIT_DStream_t bitD1;\n        BIT_DStream_t bitD2;\n        BIT_DStream_t bitD3;\n        BIT_DStream_t bitD4;\n        size_t const length1 = MEM_readLE16(istart);\n        size_t const length2 = MEM_readLE16(istart+2);\n        size_t const length3 = MEM_readLE16(istart+4);\n        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);\n        const BYTE* const istart1 = istart + 6;  /* jumpTable */\n        const BYTE* const istart2 = istart1 + length1;\n        const BYTE* const istart3 = istart2 + length2;\n        const BYTE* const istart4 = istart3 + length3;\n        const size_t segmentSize = (dstSize+3) / 4;\n        BYTE* const opStart2 = ostart + segmentSize;\n        BYTE* const opStart3 = opStart2 + segmentSize;\n        BYTE* const opStart4 = opStart3 + segmentSize;\n        BYTE* op1 = ostart;\n        BYTE* op2 = opStart2;\n        BYTE* op3 = opStart3;\n        BYTE* op4 = opStart4;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        U32 const dtLog = dtd.tableLog;\n        U32 endSignal = 1;\n\n        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */\n        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );\n        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );\n        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );\n        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );\n\n        /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */\n        for ( ; (endSignal) & (op4 < olimit) ; ) {\n            HUF_DECODE_SYMBOLX1_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX1_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX1_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX1_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX1_1(op1, &bitD1);\n            HUF_DECODE_SYMBOLX1_1(op2, &bitD2);\n            HUF_DECODE_SYMBOLX1_1(op3, &bitD3);\n            HUF_DECODE_SYMBOLX1_1(op4, &bitD4);\n            HUF_DECODE_SYMBOLX1_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX1_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX1_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX1_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX1_0(op1, &bitD1);\n            HUF_DECODE_SYMBOLX1_0(op2, &bitD2);\n            HUF_DECODE_SYMBOLX1_0(op3, &bitD3);\n            HUF_DECODE_SYMBOLX1_0(op4, &bitD4);\n            endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;\n            endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;\n            endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;\n            endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;\n        }\n\n        /* check corruption */\n        /* note : should not be necessary : op# advance in lock step, and we control op4.\n         *        but curiously, binary generated by gcc 7.2 & 7.3 with -mbmi2 runs faster when >=1 test is present */\n        if (op1 > opStart2) return ERROR(corruption_detected);\n        if (op2 > opStart3) return ERROR(corruption_detected);\n        if (op3 > opStart4) return ERROR(corruption_detected);\n        /* note : op4 supposed already verified within main loop */\n\n        /* finish bitStreams one by one */\n        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);\n        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);\n        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);\n        HUF_decodeStreamX1(op4, &bitD4, oend,     dt, dtLog);\n\n        /* check */\n        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);\n          if (!endCheck) return ERROR(corruption_detected); }\n\n        /* decoded size */\n        return dstSize;\n    }\n}\n\n\ntypedef size_t (*HUF_decompress_usingDTable_t)(void *dst, size_t dstSize,\n                                               const void *cSrc,\n                                               size_t cSrcSize,\n                                               const HUF_DTable *DTable);\n\nHUF_DGEN(HUF_decompress1X1_usingDTable_internal)\nHUF_DGEN(HUF_decompress4X1_usingDTable_internal)\n\n\n\nsize_t HUF_decompress1X1_usingDTable(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    if (dtd.tableType != 0) return ERROR(GENERIC);\n    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n}\n\nsize_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX1_wksp(DCtx, cSrc, cSrcSize, workSpace, wkspSize);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0);\n}\n\n\nsize_t HUF_decompress4X1_usingDTable(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    if (dtd.tableType != 0) return ERROR(GENERIC);\n    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n}\n\nstatic size_t HUF_decompress4X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize, int bmi2)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);\n}\n\nsize_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize)\n{\n    return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0);\n}\n\n\n#endif /* HUF_FORCE_DECOMPRESS_X2 */\n\n\n#ifndef HUF_FORCE_DECOMPRESS_X1\n\n/* *************************/\n/* double-symbols decoding */\n/* *************************/\n\ntypedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2;  /* double-symbols decoding */\ntypedef struct { BYTE symbol; BYTE weight; } sortedSymbol_t;\ntypedef U32 rankValCol_t[HUF_TABLELOG_MAX + 1];\ntypedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX];\n\n\n/* HUF_fillDTableX2Level2() :\n * `rankValOrigin` must be a table of at least (HUF_TABLELOG_MAX + 1) U32 */\nstatic void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 sizeLog, const U32 consumed,\n                           const U32* rankValOrigin, const int minWeight,\n                           const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,\n                           U32 nbBitsBaseline, U16 baseSeq)\n{\n    HUF_DEltX2 DElt;\n    U32 rankVal[HUF_TABLELOG_MAX + 1];\n\n    /* get pre-calculated rankVal */\n    ZSTD_memcpy(rankVal, rankValOrigin, sizeof(rankVal));\n\n    /* fill skipped values */\n    if (minWeight>1) {\n        U32 i, skipSize = rankVal[minWeight];\n        MEM_writeLE16(&(DElt.sequence), baseSeq);\n        DElt.nbBits   = (BYTE)(consumed);\n        DElt.length   = 1;\n        for (i = 0; i < skipSize; i++)\n            DTable[i] = DElt;\n    }\n\n    /* fill DTable */\n    {   U32 s; for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */\n            const U32 symbol = sortedSymbols[s].symbol;\n            const U32 weight = sortedSymbols[s].weight;\n            const U32 nbBits = nbBitsBaseline - weight;\n            const U32 length = 1 << (sizeLog-nbBits);\n            const U32 start = rankVal[weight];\n            U32 i = start;\n            const U32 end = start + length;\n\n            MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));\n            DElt.nbBits = (BYTE)(nbBits + consumed);\n            DElt.length = 2;\n            do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */\n\n            rankVal[weight] += length;\n    }   }\n}\n\n\nstatic void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog,\n                           const sortedSymbol_t* sortedList, const U32 sortedListSize,\n                           const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight,\n                           const U32 nbBitsBaseline)\n{\n    U32 rankVal[HUF_TABLELOG_MAX + 1];\n    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */\n    const U32 minBits  = nbBitsBaseline - maxWeight;\n    U32 s;\n\n    ZSTD_memcpy(rankVal, rankValOrigin, sizeof(rankVal));\n\n    /* fill DTable */\n    for (s=0; s<sortedListSize; s++) {\n        const U16 symbol = sortedList[s].symbol;\n        const U32 weight = sortedList[s].weight;\n        const U32 nbBits = nbBitsBaseline - weight;\n        const U32 start = rankVal[weight];\n        const U32 length = 1 << (targetLog-nbBits);\n\n        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */\n            U32 sortedRank;\n            int minWeight = nbBits + scaleLog;\n            if (minWeight < 1) minWeight = 1;\n            sortedRank = rankStart[minWeight];\n            HUF_fillDTableX2Level2(DTable+start, targetLog-nbBits, nbBits,\n                           rankValOrigin[nbBits], minWeight,\n                           sortedList+sortedRank, sortedListSize-sortedRank,\n                           nbBitsBaseline, symbol);\n        } else {\n            HUF_DEltX2 DElt;\n            MEM_writeLE16(&(DElt.sequence), symbol);\n            DElt.nbBits = (BYTE)(nbBits);\n            DElt.length = 1;\n            {   U32 const end = start + length;\n                U32 u;\n                for (u = start; u < end; u++) DTable[u] = DElt;\n        }   }\n        rankVal[weight] += length;\n    }\n}\n\nsize_t HUF_readDTableX2_wksp(HUF_DTable* DTable,\n                       const void* src, size_t srcSize,\n                             void* workSpace, size_t wkspSize)\n{\n    U32 tableLog, maxW, sizeOfSort, nbSymbols;\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    U32 const maxTableLog = dtd.maxTableLog;\n    size_t iSize;\n    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */\n    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;\n    U32 *rankStart;\n\n    rankValCol_t* rankVal;\n    U32* rankStats;\n    U32* rankStart0;\n    sortedSymbol_t* sortedSymbol;\n    BYTE* weightList;\n    size_t spaceUsed32 = 0;\n\n    rankVal = (rankValCol_t *)((U32 *)workSpace + spaceUsed32);\n    spaceUsed32 += (sizeof(rankValCol_t) * HUF_TABLELOG_MAX) >> 2;\n    rankStats = (U32 *)workSpace + spaceUsed32;\n    spaceUsed32 += HUF_TABLELOG_MAX + 1;\n    rankStart0 = (U32 *)workSpace + spaceUsed32;\n    spaceUsed32 += HUF_TABLELOG_MAX + 2;\n    sortedSymbol = (sortedSymbol_t *)workSpace + (spaceUsed32 * sizeof(U32)) / sizeof(sortedSymbol_t);\n    spaceUsed32 += HUF_ALIGN(sizeof(sortedSymbol_t) * (HUF_SYMBOLVALUE_MAX + 1), sizeof(U32)) >> 2;\n    weightList = (BYTE *)((U32 *)workSpace + spaceUsed32);\n    spaceUsed32 += HUF_ALIGN(HUF_SYMBOLVALUE_MAX + 1, sizeof(U32)) >> 2;\n\n    if ((spaceUsed32 << 2) > wkspSize) return ERROR(tableLog_tooLarge);\n\n    rankStart = rankStart0 + 1;\n    ZSTD_memset(rankStats, 0, sizeof(U32) * (2 * HUF_TABLELOG_MAX + 2 + 1));\n\n    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable));   /* if compiler fails here, assertion is wrong */\n    if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);\n    /* ZSTD_memset(weightList, 0, sizeof(weightList)); */  /* is not necessary, even though some analyzer complain ... */\n\n    iSize = HUF_readStats(weightList, HUF_SYMBOLVALUE_MAX + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);\n    if (HUF_isError(iSize)) return iSize;\n\n    /* check result */\n    if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */\n\n    /* find maxWeight */\n    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */\n\n    /* Get start index of each weight */\n    {   U32 w, nextRankStart = 0;\n        for (w=1; w<maxW+1; w++) {\n            U32 curr = nextRankStart;\n            nextRankStart += rankStats[w];\n            rankStart[w] = curr;\n        }\n        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/\n        sizeOfSort = nextRankStart;\n    }\n\n    /* sort symbols by weight */\n    {   U32 s;\n        for (s=0; s<nbSymbols; s++) {\n            U32 const w = weightList[s];\n            U32 const r = rankStart[w]++;\n            sortedSymbol[r].symbol = (BYTE)s;\n            sortedSymbol[r].weight = (BYTE)w;\n        }\n        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */\n    }\n\n    /* Build rankVal */\n    {   U32* const rankVal0 = rankVal[0];\n        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */\n            U32 nextRankVal = 0;\n            U32 w;\n            for (w=1; w<maxW+1; w++) {\n                U32 curr = nextRankVal;\n                nextRankVal += rankStats[w] << (w+rescale);\n                rankVal0[w] = curr;\n        }   }\n        {   U32 const minBits = tableLog+1 - maxW;\n            U32 consumed;\n            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {\n                U32* const rankValPtr = rankVal[consumed];\n                U32 w;\n                for (w = 1; w < maxW+1; w++) {\n                    rankValPtr[w] = rankVal0[w] >> consumed;\n    }   }   }   }\n\n    HUF_fillDTableX2(dt, maxTableLog,\n                   sortedSymbol, sizeOfSort,\n                   rankStart0, rankVal, maxW,\n                   tableLog+1);\n\n    dtd.tableLog = (BYTE)maxTableLog;\n    dtd.tableType = 1;\n    ZSTD_memcpy(DTable, &dtd, sizeof(dtd));\n    return iSize;\n}\n\n\nFORCE_INLINE_TEMPLATE U32\nHUF_decodeSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */\n    ZSTD_memcpy(op, dt+val, 2);\n    BIT_skipBits(DStream, dt[val].nbBits);\n    return dt[val].length;\n}\n\nFORCE_INLINE_TEMPLATE U32\nHUF_decodeLastSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */\n    ZSTD_memcpy(op, dt+val, 1);\n    if (dt[val].length==1) BIT_skipBits(DStream, dt[val].nbBits);\n    else {\n        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {\n            BIT_skipBits(DStream, dt[val].nbBits);\n            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))\n                /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */\n                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);\n    }   }\n    return 1;\n}\n\n#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \\\n    ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)\n\n#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \\\n    if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \\\n        ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)\n\n#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \\\n    if (MEM_64bits()) \\\n        ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)\n\nHINT_INLINE size_t\nHUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd,\n                const HUF_DEltX2* const dt, const U32 dtLog)\n{\n    BYTE* const pStart = p;\n\n    /* up to 8 symbols at a time */\n    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {\n        HUF_DECODE_SYMBOLX2_2(p, bitDPtr);\n        HUF_DECODE_SYMBOLX2_1(p, bitDPtr);\n        HUF_DECODE_SYMBOLX2_2(p, bitDPtr);\n        HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n    }\n\n    /* closer to end : up to 2 symbols at a time */\n    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))\n        HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n\n    while (p <= pEnd-2)\n        HUF_DECODE_SYMBOLX2_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */\n\n    if (p < pEnd)\n        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);\n\n    return p-pStart;\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress1X2_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    BIT_DStream_t bitD;\n\n    /* Init */\n    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );\n\n    /* decode */\n    {   BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ostart + dstSize;\n        const void* const dtPtr = DTable+1;   /* force compiler to not use strict-aliasing */\n        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);\n    }\n\n    /* check */\n    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);\n\n    /* decoded size */\n    return dstSize;\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress4X2_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */\n\n    {   const BYTE* const istart = (const BYTE*) cSrc;\n        BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ostart + dstSize;\n        BYTE* const olimit = oend - (sizeof(size_t)-1);\n        const void* const dtPtr = DTable+1;\n        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;\n\n        /* Init */\n        BIT_DStream_t bitD1;\n        BIT_DStream_t bitD2;\n        BIT_DStream_t bitD3;\n        BIT_DStream_t bitD4;\n        size_t const length1 = MEM_readLE16(istart);\n        size_t const length2 = MEM_readLE16(istart+2);\n        size_t const length3 = MEM_readLE16(istart+4);\n        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);\n        const BYTE* const istart1 = istart + 6;  /* jumpTable */\n        const BYTE* const istart2 = istart1 + length1;\n        const BYTE* const istart3 = istart2 + length2;\n        const BYTE* const istart4 = istart3 + length3;\n        size_t const segmentSize = (dstSize+3) / 4;\n        BYTE* const opStart2 = ostart + segmentSize;\n        BYTE* const opStart3 = opStart2 + segmentSize;\n        BYTE* const opStart4 = opStart3 + segmentSize;\n        BYTE* op1 = ostart;\n        BYTE* op2 = opStart2;\n        BYTE* op3 = opStart3;\n        BYTE* op4 = opStart4;\n        U32 endSignal = 1;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        U32 const dtLog = dtd.tableLog;\n\n        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */\n        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );\n        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );\n        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );\n        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );\n\n        /* 16-32 symbols per loop (4-8 symbols per stream) */\n        for ( ; (endSignal) & (op4 < olimit); ) {\n#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))\n            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_1(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_0(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_1(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_0(op2, &bitD2);\n            endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;\n            endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;\n            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_1(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_0(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_1(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_0(op4, &bitD4);\n            endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;\n            endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;\n#else\n            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_1(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_1(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_1(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_1(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n            HUF_DECODE_SYMBOLX2_0(op1, &bitD1);\n            HUF_DECODE_SYMBOLX2_0(op2, &bitD2);\n            HUF_DECODE_SYMBOLX2_0(op3, &bitD3);\n            HUF_DECODE_SYMBOLX2_0(op4, &bitD4);\n            endSignal = (U32)LIKELY(\n                        (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)\n                      & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished)\n                      & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)\n                      & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));\n#endif\n        }\n\n        /* check corruption */\n        if (op1 > opStart2) return ERROR(corruption_detected);\n        if (op2 > opStart3) return ERROR(corruption_detected);\n        if (op3 > opStart4) return ERROR(corruption_detected);\n        /* note : op4 already verified within main loop */\n\n        /* finish bitStreams one by one */\n        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);\n        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);\n        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);\n        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);\n\n        /* check */\n        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);\n          if (!endCheck) return ERROR(corruption_detected); }\n\n        /* decoded size */\n        return dstSize;\n    }\n}\n\nHUF_DGEN(HUF_decompress1X2_usingDTable_internal)\nHUF_DGEN(HUF_decompress4X2_usingDTable_internal)\n\nsize_t HUF_decompress1X2_usingDTable(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    if (dtd.tableType != 1) return ERROR(GENERIC);\n    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n}\n\nsize_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize,\n                                               workSpace, wkspSize);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0);\n}\n\n\nsize_t HUF_decompress4X2_usingDTable(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    if (dtd.tableType != 1) return ERROR(GENERIC);\n    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n}\n\nstatic size_t HUF_decompress4X2_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize, int bmi2)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,\n                                         workSpace, wkspSize);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);\n}\n\nsize_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize)\n{\n    return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, /* bmi2 */ 0);\n}\n\n\n#endif /* HUF_FORCE_DECOMPRESS_X1 */\n\n\n/* ***********************************/\n/* Universal decompression selectors */\n/* ***********************************/\n\nsize_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize,\n                                    const void* cSrc, size_t cSrcSize,\n                                    const HUF_DTable* DTable)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#else\n    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) :\n                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#endif\n}\n\nsize_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize,\n                                    const void* cSrc, size_t cSrcSize,\n                                    const HUF_DTable* DTable)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#else\n    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) :\n                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0);\n#endif\n}\n\n\n#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)\ntypedef struct { U32 tableTime; U32 decode256Time; } algo_time_t;\nstatic const algo_time_t algoTime[16 /* Quantization */][3 /* single, double, quad */] =\n{\n    /* single, double, quad */\n    {{0,0}, {1,1}, {2,2}},  /* Q==0 : impossible */\n    {{0,0}, {1,1}, {2,2}},  /* Q==1 : impossible */\n    {{  38,130}, {1313, 74}, {2151, 38}},   /* Q == 2 : 12-18% */\n    {{ 448,128}, {1353, 74}, {2238, 41}},   /* Q == 3 : 18-25% */\n    {{ 556,128}, {1353, 74}, {2238, 47}},   /* Q == 4 : 25-32% */\n    {{ 714,128}, {1418, 74}, {2436, 53}},   /* Q == 5 : 32-38% */\n    {{ 883,128}, {1437, 74}, {2464, 61}},   /* Q == 6 : 38-44% */\n    {{ 897,128}, {1515, 75}, {2622, 68}},   /* Q == 7 : 44-50% */\n    {{ 926,128}, {1613, 75}, {2730, 75}},   /* Q == 8 : 50-56% */\n    {{ 947,128}, {1729, 77}, {3359, 77}},   /* Q == 9 : 56-62% */\n    {{1107,128}, {2083, 81}, {4006, 84}},   /* Q ==10 : 62-69% */\n    {{1177,128}, {2379, 87}, {4785, 88}},   /* Q ==11 : 69-75% */\n    {{1242,128}, {2415, 93}, {5155, 84}},   /* Q ==12 : 75-81% */\n    {{1349,128}, {2644,106}, {5260,106}},   /* Q ==13 : 81-87% */\n    {{1455,128}, {2422,124}, {4174,124}},   /* Q ==14 : 87-93% */\n    {{ 722,128}, {1891,145}, {1936,146}},   /* Q ==15 : 93-99% */\n};\n#endif\n\n/** HUF_selectDecoder() :\n *  Tells which decoder is likely to decode faster,\n *  based on a set of pre-computed metrics.\n * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 .\n *  Assumption : 0 < dstSize <= 128 KB */\nU32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)\n{\n    assert(dstSize > 0);\n    assert(dstSize <= 128*1024);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dstSize;\n    (void)cSrcSize;\n    return 0;\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dstSize;\n    (void)cSrcSize;\n    return 1;\n#else\n    /* decoder timing evaluation */\n    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */\n        U32 const D256 = (U32)(dstSize >> 8);\n        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);\n        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);\n        DTime1 += DTime1 >> 3;  /* advantage to algorithm using less memory, to reduce cache eviction */\n        return DTime1 < DTime0;\n    }\n#endif\n}\n\n\nsize_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst,\n                                     size_t dstSize, const void* cSrc,\n                                     size_t cSrcSize, void* workSpace,\n                                     size_t wkspSize)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize == 0) return ERROR(corruption_detected);\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);\n#else\n        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                            cSrcSize, workSpace, wkspSize):\n                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);\n#endif\n    }\n}\n\nsize_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                  const void* cSrc, size_t cSrcSize,\n                                  void* workSpace, size_t wkspSize)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */\n    if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */\n    if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize);\n#else\n        return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize):\n                        HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize);\n#endif\n    }\n}\n\n\nsize_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#else\n    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) :\n                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#endif\n}\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);\n}\n#endif\n\nsize_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#else\n    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) :\n                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);\n#endif\n}\n\nsize_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize == 0) return ERROR(corruption_detected);\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);\n#else\n        return algoNb ? HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2) :\n                        HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);\n#endif\n    }\n}\n\n#ifndef ZSTD_NO_UNUSED_FUNCTIONS\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_readDTableX1(HUF_DTable* DTable, const void* src, size_t srcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_readDTableX1_wksp(DTable, src, srcSize,\n                                 workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress1X1_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,\n                              const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress1X1_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,\n                                       workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    HUF_CREATE_STATIC_DTABLEX1(DTable, HUF_TABLELOG_MAX);\n    return HUF_decompress1X1_DCtx (DTable, dst, dstSize, cSrc, cSrcSize);\n}\n#endif \n\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_readDTableX2(HUF_DTable* DTable, const void* src, size_t srcSize)\n{\n  U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n  return HUF_readDTableX2_wksp(DTable, src, srcSize,\n                               workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress1X2_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,\n                              const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress1X2_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,\n                                       workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    HUF_CREATE_STATIC_DTABLEX2(DTable, HUF_TABLELOG_MAX);\n    return HUF_decompress1X2_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);\n}\n#endif\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress4X1_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,\n                                       workSpace, sizeof(workSpace));\n}\nsize_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    HUF_CREATE_STATIC_DTABLEX1(DTable, HUF_TABLELOG_MAX);\n    return HUF_decompress4X1_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);\n}\n#endif\n\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,\n                              const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,\n                                       workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    HUF_CREATE_STATIC_DTABLEX2(DTable, HUF_TABLELOG_MAX);\n    return HUF_decompress4X2_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);\n}\n#endif\n\ntypedef size_t (*decompressionAlgo)(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);\n\nsize_t HUF_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)\n    static const decompressionAlgo decompress[2] = { HUF_decompress4X1, HUF_decompress4X2 };\n#endif\n\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */\n    if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */\n    if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress4X1(dst, dstSize, cSrc, cSrcSize);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress4X2(dst, dstSize, cSrc, cSrcSize);\n#else\n        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);\n#endif\n    }\n}\n\nsize_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */\n    if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */\n    if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress4X1_DCtx(dctx, dst, dstSize, cSrc, cSrcSize);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize);\n#else\n        return algoNb ? HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :\n                        HUF_decompress4X1_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;\n#endif\n    }\n}\n\nsize_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress4X_hufOnly_wksp(dctx, dst, dstSize, cSrc, cSrcSize,\n                                         workSpace, sizeof(workSpace));\n}\n\nsize_t HUF_decompress1X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,\n                             const void* cSrc, size_t cSrcSize)\n{\n    U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];\n    return HUF_decompress1X_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,\n                                      workSpace, sizeof(workSpace));\n}\n#endif\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* zstd_ddict.c :\n * concentrates all logic that needs to know the internals of ZSTD_DDict object */\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n#include \"../common/zstd_deps.h\"   /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"../common/cpu.h\"         /* bmi2 */\n#include \"../common/mem.h\"         /* low level memory routines */\n#define FSE_STATIC_LINKING_ONLY\n#include \"../common/fse.h\"\n#define HUF_STATIC_LINKING_ONLY\n#include \"../common/huf.h\"\n#include \"zstd_decompress_internal.h\"\n#include \"zstd_ddict.h\"\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n#  include \"../legacy/zstd_legacy.h\"\n#endif\n\n\n\n/*-*******************************************************\n*  Types\n*********************************************************/\nstruct ZSTD_DDict_s {\n    void* dictBuffer;\n    const void* dictContent;\n    size_t dictSize;\n    ZSTD_entropyDTables_t entropy;\n    U32 dictID;\n    U32 entropyPresent;\n    ZSTD_customMem cMem;\n};  /* typedef'd to ZSTD_DDict within \"zstd.h\" */\n\nconst void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict)\n{\n    assert(ddict != NULL);\n    return ddict->dictContent;\n}\n\nsize_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict)\n{\n    assert(ddict != NULL);\n    return ddict->dictSize;\n}\n\nvoid ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    DEBUGLOG(4, \"ZSTD_copyDDictParameters\");\n    assert(dctx != NULL);\n    assert(ddict != NULL);\n    dctx->dictID = ddict->dictID;\n    dctx->prefixStart = ddict->dictContent;\n    dctx->virtualStart = ddict->dictContent;\n    dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;\n    dctx->previousDstEnd = dctx->dictEnd;\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentBeginForFuzzing = dctx->prefixStart;\n    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;\n#endif\n    if (ddict->entropyPresent) {\n        dctx->litEntropy = 1;\n        dctx->fseEntropy = 1;\n        dctx->LLTptr = ddict->entropy.LLTable;\n        dctx->MLTptr = ddict->entropy.MLTable;\n        dctx->OFTptr = ddict->entropy.OFTable;\n        dctx->HUFptr = ddict->entropy.hufTable;\n        dctx->entropy.rep[0] = ddict->entropy.rep[0];\n        dctx->entropy.rep[1] = ddict->entropy.rep[1];\n        dctx->entropy.rep[2] = ddict->entropy.rep[2];\n    } else {\n        dctx->litEntropy = 0;\n        dctx->fseEntropy = 0;\n    }\n}\n\n\nstatic size_t\nZSTD_loadEntropy_intoDDict(ZSTD_DDict* ddict,\n                           ZSTD_dictContentType_e dictContentType)\n{\n    ddict->dictID = 0;\n    ddict->entropyPresent = 0;\n    if (dictContentType == ZSTD_dct_rawContent) return 0;\n\n    if (ddict->dictSize < 8) {\n        if (dictContentType == ZSTD_dct_fullDict)\n            return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */\n        return 0;   /* pure content mode */\n    }\n    {   U32 const magic = MEM_readLE32(ddict->dictContent);\n        if (magic != ZSTD_MAGIC_DICTIONARY) {\n            if (dictContentType == ZSTD_dct_fullDict)\n                return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */\n            return 0;   /* pure content mode */\n        }\n    }\n    ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_FRAMEIDSIZE);\n\n    /* load entropy tables */\n    RETURN_ERROR_IF(ZSTD_isError(ZSTD_loadDEntropy(\n            &ddict->entropy, ddict->dictContent, ddict->dictSize)),\n        dictionary_corrupted, \"\");\n    ddict->entropyPresent = 1;\n    return 0;\n}\n\n\nstatic size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict,\n                                      const void* dict, size_t dictSize,\n                                      ZSTD_dictLoadMethod_e dictLoadMethod,\n                                      ZSTD_dictContentType_e dictContentType)\n{\n    if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {\n        ddict->dictBuffer = NULL;\n        ddict->dictContent = dict;\n        if (!dict) dictSize = 0;\n    } else {\n        void* const internalBuffer = ZSTD_customMalloc(dictSize, ddict->cMem);\n        ddict->dictBuffer = internalBuffer;\n        ddict->dictContent = internalBuffer;\n        if (!internalBuffer) return ERROR(memory_allocation);\n        ZSTD_memcpy(internalBuffer, dict, dictSize);\n    }\n    ddict->dictSize = dictSize;\n    ddict->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001);  /* cover both little and big endian */\n\n    /* parse dictionary content */\n    FORWARD_IF_ERROR( ZSTD_loadEntropy_intoDDict(ddict, dictContentType) , \"\");\n\n    return 0;\n}\n\nZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,\n                                      ZSTD_dictLoadMethod_e dictLoadMethod,\n                                      ZSTD_dictContentType_e dictContentType,\n                                      ZSTD_customMem customMem)\n{\n    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;\n\n    {   ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_customMalloc(sizeof(ZSTD_DDict), customMem);\n        if (ddict == NULL) return NULL;\n        ddict->cMem = customMem;\n        {   size_t const initResult = ZSTD_initDDict_internal(ddict,\n                                            dict, dictSize,\n                                            dictLoadMethod, dictContentType);\n            if (ZSTD_isError(initResult)) {\n                ZSTD_freeDDict(ddict);\n                return NULL;\n        }   }\n        return ddict;\n    }\n}\n\n/*! ZSTD_createDDict() :\n*   Create a digested dictionary, to start decompression without startup delay.\n*   `dict` content is copied inside DDict.\n*   Consequently, `dict` can be released after `ZSTD_DDict` creation */\nZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize)\n{\n    ZSTD_customMem const allocator = { NULL, NULL, NULL };\n    return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator);\n}\n\n/*! ZSTD_createDDict_byReference() :\n *  Create a digested dictionary, to start decompression without startup delay.\n *  Dictionary content is simply referenced, it will be accessed during decompression.\n *  Warning : dictBuffer must outlive DDict (DDict must be freed before dictBuffer) */\nZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize)\n{\n    ZSTD_customMem const allocator = { NULL, NULL, NULL };\n    return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, allocator);\n}\n\n\nconst ZSTD_DDict* ZSTD_initStaticDDict(\n                                void* sBuffer, size_t sBufferSize,\n                                const void* dict, size_t dictSize,\n                                ZSTD_dictLoadMethod_e dictLoadMethod,\n                                ZSTD_dictContentType_e dictContentType)\n{\n    size_t const neededSpace = sizeof(ZSTD_DDict)\n                             + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);\n    ZSTD_DDict* const ddict = (ZSTD_DDict*)sBuffer;\n    assert(sBuffer != NULL);\n    assert(dict != NULL);\n    if ((size_t)sBuffer & 7) return NULL;   /* 8-aligned */\n    if (sBufferSize < neededSpace) return NULL;\n    if (dictLoadMethod == ZSTD_dlm_byCopy) {\n        ZSTD_memcpy(ddict+1, dict, dictSize);  /* local copy */\n        dict = ddict+1;\n    }\n    if (ZSTD_isError( ZSTD_initDDict_internal(ddict,\n                                              dict, dictSize,\n                                              ZSTD_dlm_byRef, dictContentType) ))\n        return NULL;\n    return ddict;\n}\n\n\nsize_t ZSTD_freeDDict(ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;   /* support free on NULL */\n    {   ZSTD_customMem const cMem = ddict->cMem;\n        ZSTD_customFree(ddict->dictBuffer, cMem);\n        ZSTD_customFree(ddict, cMem);\n        return 0;\n    }\n}\n\n/*! ZSTD_estimateDDictSize() :\n *  Estimate amount of memory that will be needed to create a dictionary for decompression.\n *  Note : dictionary created by reference using ZSTD_dlm_byRef are smaller */\nsize_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod)\n{\n    return sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);\n}\n\nsize_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;   /* support sizeof on NULL */\n    return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ;\n}\n\n/*! ZSTD_getDictID_fromDDict() :\n *  Provides the dictID of the dictionary loaded into `ddict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nunsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;\n    return ZSTD_getDictID_fromDict(ddict->dictContent, ddict->dictSize);\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n#ifndef ZSTD_DDICT_H\n#define ZSTD_DDICT_H\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"../common/zstd_deps.h\"   /* size_t */\n#include \"../zstd.h\"     /* ZSTD_DDict, and several public functions */\n\n\n/*-*******************************************************\n *  Interface\n *********************************************************/\n\n/* note: several prototypes are already published in `zstd.h` :\n * ZSTD_createDDict()\n * ZSTD_createDDict_byReference()\n * ZSTD_createDDict_advanced()\n * ZSTD_freeDDict()\n * ZSTD_initStaticDDict()\n * ZSTD_sizeof_DDict()\n * ZSTD_estimateDDictSize()\n * ZSTD_getDictID_fromDict()\n */\n\nconst void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict);\nsize_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict);\n\nvoid ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\n\n\n#endif /* ZSTD_DDICT_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n/* ***************************************************************\n*  Tuning parameters\n*****************************************************************/\n/*!\n * HEAPMODE :\n * Select how default decompression function ZSTD_decompress() allocates its context,\n * on stack (0), or into heap (1, default; requires malloc()).\n * Note that functions with explicit context such as ZSTD_decompressDCtx() are unaffected.\n */\n#ifndef ZSTD_HEAPMODE\n#  define ZSTD_HEAPMODE 1\n#endif\n\n/*!\n*  LEGACY_SUPPORT :\n*  if set to 1+, ZSTD_decompress() can decode older formats (v0.1+)\n*/\n#ifndef ZSTD_LEGACY_SUPPORT\n#  define ZSTD_LEGACY_SUPPORT 0\n#endif\n\n/*!\n *  MAXWINDOWSIZE_DEFAULT :\n *  maximum window size accepted by DStream __by default__.\n *  Frames requiring more memory will be rejected.\n *  It's possible to set a different limit using ZSTD_DCtx_setMaxWindowSize().\n */\n#ifndef ZSTD_MAXWINDOWSIZE_DEFAULT\n#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)\n#endif\n\n/*!\n *  NO_FORWARD_PROGRESS_MAX :\n *  maximum allowed nb of calls to ZSTD_decompressStream()\n *  without any forward progress\n *  (defined as: no byte read from input, and no byte flushed to output)\n *  before triggering an error.\n */\n#ifndef ZSTD_NO_FORWARD_PROGRESS_MAX\n#  define ZSTD_NO_FORWARD_PROGRESS_MAX 16\n#endif\n\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n#include \"../common/zstd_deps.h\"   /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"../common/cpu.h\"         /* bmi2 */\n#include \"../common/mem.h\"         /* low level memory routines */\n#define FSE_STATIC_LINKING_ONLY\n#include \"../common/fse.h\"\n#define HUF_STATIC_LINKING_ONLY\n#include \"../common/huf.h\"\n#include \"../common/zstd_internal.h\"  /* blockProperties_t */\n#include \"zstd_decompress_internal.h\"   /* ZSTD_DCtx */\n#include \"zstd_ddict.h\"  /* ZSTD_DDictDictContent */\n#include \"zstd_decompress_block.h\"   /* ZSTD_decompressBlock_internal */\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n#  include \"../legacy/zstd_legacy.h\"\n#endif\n\n\n/*-*************************************************************\n*   Context management\n***************************************************************/\nsize_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx)\n{\n    if (dctx==NULL) return 0;   /* support sizeof NULL */\n    return sizeof(*dctx)\n           + ZSTD_sizeof_DDict(dctx->ddictLocal)\n           + dctx->inBuffSize + dctx->outBuffSize;\n}\n\nsize_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }\n\n\nstatic size_t ZSTD_startingInputLength(ZSTD_format_e format)\n{\n    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);\n    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */\n    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );\n    return startingInputLength;\n}\n\nstatic void ZSTD_DCtx_resetParameters(ZSTD_DCtx* dctx)\n{\n    assert(dctx->streamStage == zdss_init);\n    dctx->format = ZSTD_f_zstd1;\n    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;\n    dctx->outBufferMode = ZSTD_bm_buffered;\n    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;\n}\n\nstatic void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)\n{\n    dctx->staticSize  = 0;\n    dctx->ddict       = NULL;\n    dctx->ddictLocal  = NULL;\n    dctx->dictEnd     = NULL;\n    dctx->ddictIsCold = 0;\n    dctx->dictUses = ZSTD_dont_use;\n    dctx->inBuff      = NULL;\n    dctx->inBuffSize  = 0;\n    dctx->outBuffSize = 0;\n    dctx->streamStage = zdss_init;\n    dctx->legacyContext = NULL;\n    dctx->previousLegacyVersion = 0;\n    dctx->noForwardProgress = 0;\n    dctx->oversizedDuration = 0;\n    dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid());\n    ZSTD_DCtx_resetParameters(dctx);\n    dctx->validateChecksum = 1;\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentEndForFuzzing = NULL;\n#endif\n}\n\nZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize)\n{\n    ZSTD_DCtx* const dctx = (ZSTD_DCtx*) workspace;\n\n    if ((size_t)workspace & 7) return NULL;  /* 8-aligned */\n    if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL;  /* minimum size */\n\n    ZSTD_initDCtx_internal(dctx);\n    dctx->staticSize = workspaceSize;\n    dctx->inBuff = (char*)(dctx+1);\n    return dctx;\n}\n\nZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)\n{\n    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;\n\n    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);\n        if (!dctx) return NULL;\n        dctx->customMem = customMem;\n        ZSTD_initDCtx_internal(dctx);\n        return dctx;\n    }\n}\n\nZSTD_DCtx* ZSTD_createDCtx(void)\n{\n    DEBUGLOG(3, \"ZSTD_createDCtx\");\n    return ZSTD_createDCtx_advanced(ZSTD_defaultCMem);\n}\n\nstatic void ZSTD_clearDict(ZSTD_DCtx* dctx)\n{\n    ZSTD_freeDDict(dctx->ddictLocal);\n    dctx->ddictLocal = NULL;\n    dctx->ddict = NULL;\n    dctx->dictUses = ZSTD_dont_use;\n}\n\nsize_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)\n{\n    if (dctx==NULL) return 0;   /* support free on NULL */\n    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, \"not compatible with static DCtx\");\n    {   ZSTD_customMem const cMem = dctx->customMem;\n        ZSTD_clearDict(dctx);\n        ZSTD_customFree(dctx->inBuff, cMem);\n        dctx->inBuff = NULL;\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n        if (dctx->legacyContext)\n            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);\n#endif\n        ZSTD_customFree(dctx, cMem);\n        return 0;\n    }\n}\n\n/* no longer useful */\nvoid ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)\n{\n    size_t const toCopy = (size_t)((char*)(&dstDCtx->inBuff) - (char*)dstDCtx);\n    ZSTD_memcpy(dstDCtx, srcDCtx, toCopy);  /* no need to copy workspace */\n}\n\n\n/*-*************************************************************\n *   Frame header decoding\n ***************************************************************/\n\n/*! ZSTD_isFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier.\n *  Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.\n *  Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.\n *  Note 3 : Skippable Frame Identifiers are considered valid. */\nunsigned ZSTD_isFrame(const void* buffer, size_t size)\n{\n    if (size < ZSTD_FRAMEIDSIZE) return 0;\n    {   U32 const magic = MEM_readLE32(buffer);\n        if (magic == ZSTD_MAGICNUMBER) return 1;\n        if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1;\n    }\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (ZSTD_isLegacy(buffer, size)) return 1;\n#endif\n    return 0;\n}\n\n/** ZSTD_frameHeaderSize_internal() :\n *  srcSize must be large enough to reach header size fields.\n *  note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless.\n * @return : size of the Frame Header\n *           or an error code, which can be tested with ZSTD_isError() */\nstatic size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZSTD_format_e format)\n{\n    size_t const minInputSize = ZSTD_startingInputLength(format);\n    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, \"\");\n\n    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];\n        U32 const dictID= fhd & 3;\n        U32 const singleSegment = (fhd >> 5) & 1;\n        U32 const fcsId = fhd >> 6;\n        return minInputSize + !singleSegment\n             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]\n             + (singleSegment && !fcsId);\n    }\n}\n\n/** ZSTD_frameHeaderSize() :\n *  srcSize must be >= ZSTD_frameHeaderSize_prefix.\n * @return : size of the Frame Header,\n *           or an error code (if srcSize is too small) */\nsize_t ZSTD_frameHeaderSize(const void* src, size_t srcSize)\n{\n    return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1);\n}\n\n\n/** ZSTD_getFrameHeader_advanced() :\n *  decode Frame Header, or require larger `srcSize`.\n *  note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n *           or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format)\n{\n    const BYTE* ip = (const BYTE*)src;\n    size_t const minInputSize = ZSTD_startingInputLength(format);\n\n    ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));   /* not strictly necessary, but static analyzer do not understand that zfhPtr is only going to be read only if return value is zero, since they are 2 different signals */\n    if (srcSize < minInputSize) return minInputSize;\n    RETURN_ERROR_IF(src==NULL, GENERIC, \"invalid parameter\");\n\n    if ( (format != ZSTD_f_zstd1_magicless)\n      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {\n        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n            /* skippable frame */\n            if (srcSize < ZSTD_SKIPPABLEHEADERSIZE)\n                return ZSTD_SKIPPABLEHEADERSIZE; /* magic number + frame length */\n            ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));\n            zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_FRAMEIDSIZE);\n            zfhPtr->frameType = ZSTD_skippableFrame;\n            return 0;\n        }\n        RETURN_ERROR(prefix_unknown, \"\");\n    }\n\n    /* ensure there is enough `srcSize` to fully read/decode frame header */\n    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);\n        if (srcSize < fhsize) return fhsize;\n        zfhPtr->headerSize = (U32)fhsize;\n    }\n\n    {   BYTE const fhdByte = ip[minInputSize-1];\n        size_t pos = minInputSize;\n        U32 const dictIDSizeCode = fhdByte&3;\n        U32 const checksumFlag = (fhdByte>>2)&1;\n        U32 const singleSegment = (fhdByte>>5)&1;\n        U32 const fcsID = fhdByte>>6;\n        U64 windowSize = 0;\n        U32 dictID = 0;\n        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;\n        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,\n                        \"reserved bits, must be zero\");\n\n        if (!singleSegment) {\n            BYTE const wlByte = ip[pos++];\n            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;\n            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, \"\");\n            windowSize = (1ULL << windowLog);\n            windowSize += (windowSize >> 3) * (wlByte&7);\n        }\n        switch(dictIDSizeCode)\n        {\n            default: assert(0);  /* impossible */\n            case 0 : break;\n            case 1 : dictID = ip[pos]; pos++; break;\n            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;\n            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;\n        }\n        switch(fcsID)\n        {\n            default: assert(0);  /* impossible */\n            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;\n            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;\n            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;\n            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;\n        }\n        if (singleSegment) windowSize = frameContentSize;\n\n        zfhPtr->frameType = ZSTD_frame;\n        zfhPtr->frameContentSize = frameContentSize;\n        zfhPtr->windowSize = windowSize;\n        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);\n        zfhPtr->dictID = dictID;\n        zfhPtr->checksumFlag = checksumFlag;\n    }\n    return 0;\n}\n\n/** ZSTD_getFrameHeader() :\n *  decode Frame Header, or require larger `srcSize`.\n *  note : this function does not consume input, it only reads it.\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n *           or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize)\n{\n    return ZSTD_getFrameHeader_advanced(zfhPtr, src, srcSize, ZSTD_f_zstd1);\n}\n\n\n/** ZSTD_getFrameContentSize() :\n *  compatible with legacy mode\n * @return : decompressed size of the single frame pointed to be `src` if known, otherwise\n *         - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined\n *         - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) */\nunsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize)\n{\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (ZSTD_isLegacy(src, srcSize)) {\n        unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize);\n        return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret;\n    }\n#endif\n    {   ZSTD_frameHeader zfh;\n        if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0)\n            return ZSTD_CONTENTSIZE_ERROR;\n        if (zfh.frameType == ZSTD_skippableFrame) {\n            return 0;\n        } else {\n            return zfh.frameContentSize;\n    }   }\n}\n\nstatic size_t readSkippableFrameSize(void const* src, size_t srcSize)\n{\n    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;\n    U32 sizeU32;\n\n    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, \"\");\n\n    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);\n    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,\n                    frameParameter_unsupported, \"\");\n    {\n        size_t const skippableSize = skippableHeaderSize + sizeU32;\n        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, \"\");\n        return skippableSize;\n    }\n}\n\n/** ZSTD_findDecompressedSize() :\n *  compatible with legacy mode\n *  `srcSize` must be the exact length of some number of ZSTD compressed and/or\n *      skippable frames\n *  @return : decompressed size of the frames contained */\nunsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize)\n{\n    unsigned long long totalDstSize = 0;\n\n    while (srcSize >= ZSTD_startingInputLength(ZSTD_f_zstd1)) {\n        U32 const magicNumber = MEM_readLE32(src);\n\n        if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n            size_t const skippableSize = readSkippableFrameSize(src, srcSize);\n            if (ZSTD_isError(skippableSize)) {\n                return ZSTD_CONTENTSIZE_ERROR;\n            }\n            assert(skippableSize <= srcSize);\n\n            src = (const BYTE *)src + skippableSize;\n            srcSize -= skippableSize;\n            continue;\n        }\n\n        {   unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);\n            if (ret >= ZSTD_CONTENTSIZE_ERROR) return ret;\n\n            /* check for overflow */\n            if (totalDstSize + ret < totalDstSize) return ZSTD_CONTENTSIZE_ERROR;\n            totalDstSize += ret;\n        }\n        {   size_t const frameSrcSize = ZSTD_findFrameCompressedSize(src, srcSize);\n            if (ZSTD_isError(frameSrcSize)) {\n                return ZSTD_CONTENTSIZE_ERROR;\n            }\n\n            src = (const BYTE *)src + frameSrcSize;\n            srcSize -= frameSrcSize;\n        }\n    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */\n\n    if (srcSize) return ZSTD_CONTENTSIZE_ERROR;\n\n    return totalDstSize;\n}\n\n/** ZSTD_getDecompressedSize() :\n *  compatible with legacy mode\n * @return : decompressed size if known, 0 otherwise\n             note : 0 can mean any of the following :\n                   - frame content is empty\n                   - decompressed size field is not present in frame header\n                   - frame header unknown / not supported\n                   - frame header not complete (`srcSize` too small) */\nunsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize)\n{\n    unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);\n    ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_ERROR < ZSTD_CONTENTSIZE_UNKNOWN);\n    return (ret >= ZSTD_CONTENTSIZE_ERROR) ? 0 : ret;\n}\n\n\n/** ZSTD_decodeFrameHeader() :\n * `headerSize` must be the size provided by ZSTD_frameHeaderSize().\n * @return : 0 if success, or an error code, which can be tested using ZSTD_isError() */\nstatic size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize)\n{\n    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);\n    if (ZSTD_isError(result)) return result;    /* invalid header */\n    RETURN_ERROR_IF(result>0, srcSize_wrong, \"headerSize too small\");\n#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    /* Skip the dictID check in fuzzing mode, because it makes the search\n     * harder.\n     */\n    RETURN_ERROR_IF(dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID),\n                    dictionary_wrong, \"\");\n#endif\n    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;\n    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);\n    return 0;\n}\n\nstatic ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo(size_t ret)\n{\n    ZSTD_frameSizeInfo frameSizeInfo;\n    frameSizeInfo.compressedSize = ret;\n    frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;\n    return frameSizeInfo;\n}\n\nstatic ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo(const void* src, size_t srcSize)\n{\n    ZSTD_frameSizeInfo frameSizeInfo;\n    ZSTD_memset(&frameSizeInfo, 0, sizeof(ZSTD_frameSizeInfo));\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (ZSTD_isLegacy(src, srcSize))\n        return ZSTD_findFrameSizeInfoLegacy(src, srcSize);\n#endif\n\n    if ((srcSize >= ZSTD_SKIPPABLEHEADERSIZE)\n        && (MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n        frameSizeInfo.compressedSize = readSkippableFrameSize(src, srcSize);\n        assert(ZSTD_isError(frameSizeInfo.compressedSize) ||\n               frameSizeInfo.compressedSize <= srcSize);\n        return frameSizeInfo;\n    } else {\n        const BYTE* ip = (const BYTE*)src;\n        const BYTE* const ipstart = ip;\n        size_t remainingSize = srcSize;\n        size_t nbBlocks = 0;\n        ZSTD_frameHeader zfh;\n\n        /* Extract Frame Header */\n        {   size_t const ret = ZSTD_getFrameHeader(&zfh, src, srcSize);\n            if (ZSTD_isError(ret))\n                return ZSTD_errorFrameSizeInfo(ret);\n            if (ret > 0)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n        }\n\n        ip += zfh.headerSize;\n        remainingSize -= zfh.headerSize;\n\n        /* Iterate over each block */\n        while (1) {\n            blockProperties_t blockProperties;\n            size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);\n            if (ZSTD_isError(cBlockSize))\n                return ZSTD_errorFrameSizeInfo(cBlockSize);\n\n            if (ZSTD_blockHeaderSize + cBlockSize > remainingSize)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n\n            ip += ZSTD_blockHeaderSize + cBlockSize;\n            remainingSize -= ZSTD_blockHeaderSize + cBlockSize;\n            nbBlocks++;\n\n            if (blockProperties.lastBlock) break;\n        }\n\n        /* Final frame content checksum */\n        if (zfh.checksumFlag) {\n            if (remainingSize < 4)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n            ip += 4;\n        }\n\n        frameSizeInfo.compressedSize = (size_t)(ip - ipstart);\n        frameSizeInfo.decompressedBound = (zfh.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN)\n                                        ? zfh.frameContentSize\n                                        : nbBlocks * zfh.blockSizeMax;\n        return frameSizeInfo;\n    }\n}\n\n/** ZSTD_findFrameCompressedSize() :\n *  compatible with legacy mode\n *  `src` must point to the start of a ZSTD frame, ZSTD legacy frame, or skippable frame\n *  `srcSize` must be at least as large as the frame contained\n *  @return : the compressed size of the frame starting at `src` */\nsize_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)\n{\n    ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize);\n    return frameSizeInfo.compressedSize;\n}\n\n/** ZSTD_decompressBound() :\n *  compatible with legacy mode\n *  `src` must point to the start of a ZSTD frame or a skippeable frame\n *  `srcSize` must be at least as large as the frame contained\n *  @return : the maximum decompressed size of the compressed source\n */\nunsigned long long ZSTD_decompressBound(const void* src, size_t srcSize)\n{\n    unsigned long long bound = 0;\n    /* Iterate over each frame */\n    while (srcSize > 0) {\n        ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize);\n        size_t const compressedSize = frameSizeInfo.compressedSize;\n        unsigned long long const decompressedBound = frameSizeInfo.decompressedBound;\n        if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR)\n            return ZSTD_CONTENTSIZE_ERROR;\n        assert(srcSize >= compressedSize);\n        src = (const BYTE*)src + compressedSize;\n        srcSize -= compressedSize;\n        bound += decompressedBound;\n    }\n    return bound;\n}\n\n\n/*-*************************************************************\n *   Frame decoding\n ***************************************************************/\n\n/** ZSTD_insertBlock() :\n *  insert `src` block into `dctx` history. Useful to track uncompressed blocks. */\nsize_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize)\n{\n    DEBUGLOG(5, \"ZSTD_insertBlock: %u bytes\", (unsigned)blockSize);\n    ZSTD_checkContinuity(dctx, blockStart);\n    dctx->previousDstEnd = (const char*)blockStart + blockSize;\n    return blockSize;\n}\n\n\nstatic size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity,\n                          const void* src, size_t srcSize)\n{\n    DEBUGLOG(5, \"ZSTD_copyRawBlock\");\n    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, \"\");\n    if (dst == NULL) {\n        if (srcSize == 0) return 0;\n        RETURN_ERROR(dstBuffer_null, \"\");\n    }\n    ZSTD_memcpy(dst, src, srcSize);\n    return srcSize;\n}\n\nstatic size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity,\n                               BYTE b,\n                               size_t regenSize)\n{\n    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, \"\");\n    if (dst == NULL) {\n        if (regenSize == 0) return 0;\n        RETURN_ERROR(dstBuffer_null, \"\");\n    }\n    ZSTD_memset(dst, b, regenSize);\n    return regenSize;\n}\n\n\n/*! ZSTD_decompressFrame() :\n * @dctx must be properly initialized\n *  will update *srcPtr and *srcSizePtr,\n *  to make *srcPtr progress by one frame. */\nstatic size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx,\n                                   void* dst, size_t dstCapacity,\n                             const void** srcPtr, size_t *srcSizePtr)\n{\n    const BYTE* ip = (const BYTE*)(*srcPtr);\n    BYTE* const ostart = (BYTE* const)dst;\n    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;\n    BYTE* op = ostart;\n    size_t remainingSrcSize = *srcSizePtr;\n\n    DEBUGLOG(4, \"ZSTD_decompressFrame (srcSize:%i)\", (int)*srcSizePtr);\n\n    /* check */\n    RETURN_ERROR_IF(\n        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,\n        srcSize_wrong, \"\");\n\n    /* Frame Header */\n    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(\n                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);\n        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;\n        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,\n                        srcSize_wrong, \"\");\n        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , \"\");\n        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;\n    }\n\n    /* Loop on each block */\n    while (1) {\n        size_t decodedSize;\n        blockProperties_t blockProperties;\n        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);\n        if (ZSTD_isError(cBlockSize)) return cBlockSize;\n\n        ip += ZSTD_blockHeaderSize;\n        remainingSrcSize -= ZSTD_blockHeaderSize;\n        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, \"\");\n\n        switch(blockProperties.blockType)\n        {\n        case bt_compressed:\n            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oend-op), ip, cBlockSize, /* frame */ 1);\n            break;\n        case bt_raw :\n            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);\n            break;\n        case bt_rle :\n            decodedSize = ZSTD_setRleBlock(op, (size_t)(oend-op), *ip, blockProperties.origSize);\n            break;\n        case bt_reserved :\n        default:\n            RETURN_ERROR(corruption_detected, \"invalid block type\");\n        }\n\n        if (ZSTD_isError(decodedSize)) return decodedSize;\n        if (dctx->validateChecksum)\n            XXH64_update(&dctx->xxhState, op, decodedSize);\n        if (decodedSize != 0)\n            op += decodedSize;\n        assert(ip != NULL);\n        ip += cBlockSize;\n        remainingSrcSize -= cBlockSize;\n        if (blockProperties.lastBlock) break;\n    }\n\n    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {\n        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,\n                        corruption_detected, \"\");\n    }\n    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */\n        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, \"\");\n        if (!dctx->forceIgnoreChecksum) {\n            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);\n            U32 checkRead;\n            checkRead = MEM_readLE32(ip);\n            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, \"\");\n        }\n        ip += 4;\n        remainingSrcSize -= 4;\n    }\n\n    /* Allow caller to get size read */\n    *srcPtr = ip;\n    *srcSizePtr = remainingSrcSize;\n    return (size_t)(op-ostart);\n}\n\nstatic size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,\n                                        void* dst, size_t dstCapacity,\n                                  const void* src, size_t srcSize,\n                                  const void* dict, size_t dictSize,\n                                  const ZSTD_DDict* ddict)\n{\n    void* const dststart = dst;\n    int moreThan1Frame = 0;\n\n    DEBUGLOG(5, \"ZSTD_decompressMultiFrame\");\n    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */\n\n    if (ddict) {\n        dict = ZSTD_DDict_dictContent(ddict);\n        dictSize = ZSTD_DDict_dictSize(ddict);\n    }\n\n    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n        if (ZSTD_isLegacy(src, srcSize)) {\n            size_t decodedSize;\n            size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);\n            if (ZSTD_isError(frameSize)) return frameSize;\n            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,\n                \"legacy support is not compatible with static dctx\");\n\n            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);\n            if (ZSTD_isError(decodedSize)) return decodedSize;\n\n            assert(decodedSize <= dstCapacity);\n            dst = (BYTE*)dst + decodedSize;\n            dstCapacity -= decodedSize;\n\n            src = (const BYTE*)src + frameSize;\n            srcSize -= frameSize;\n\n            continue;\n        }\n#endif\n\n        {   U32 const magicNumber = MEM_readLE32(src);\n            DEBUGLOG(4, \"reading magic number %08X (expecting %08X)\",\n                        (unsigned)magicNumber, ZSTD_MAGICNUMBER);\n            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n                size_t const skippableSize = readSkippableFrameSize(src, srcSize);\n                FORWARD_IF_ERROR(skippableSize, \"readSkippableFrameSize failed\");\n                assert(skippableSize <= srcSize);\n\n                src = (const BYTE *)src + skippableSize;\n                srcSize -= skippableSize;\n                continue;\n        }   }\n\n        if (ddict) {\n            /* we were called from ZSTD_decompress_usingDDict */\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), \"\");\n        } else {\n            /* this will initialize correctly with no dict if dict == NULL, so\n             * use this in all cases but ddict */\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), \"\");\n        }\n        ZSTD_checkContinuity(dctx, dst);\n\n        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,\n                                                    &src, &srcSize);\n            RETURN_ERROR_IF(\n                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)\n             && (moreThan1Frame==1),\n                srcSize_wrong,\n                \"At least one frame successfully completed, \"\n                \"but following bytes are garbage: \"\n                \"it's more likely to be a srcSize error, \"\n                \"specifying more input bytes than size of frame(s). \"\n                \"Note: one could be unlucky, it might be a corruption error instead, \"\n                \"happening right at the place where we expect zstd magic bytes. \"\n                \"But this is _much_ less likely than a srcSize field error.\");\n            if (ZSTD_isError(res)) return res;\n            assert(res <= dstCapacity);\n            if (res != 0)\n                dst = (BYTE*)dst + res;\n            dstCapacity -= res;\n        }\n        moreThan1Frame = 1;\n    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */\n\n    RETURN_ERROR_IF(srcSize, srcSize_wrong, \"input not entirely consumed\");\n\n    return (size_t)((BYTE*)dst - (BYTE*)dststart);\n}\n\nsize_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,\n                                 void* dst, size_t dstCapacity,\n                           const void* src, size_t srcSize,\n                           const void* dict, size_t dictSize)\n{\n    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, NULL);\n}\n\n\nstatic ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx)\n{\n    switch (dctx->dictUses) {\n    default:\n        assert(0 /* Impossible */);\n        /* fall-through */\n    case ZSTD_dont_use:\n        ZSTD_clearDict(dctx);\n        return NULL;\n    case ZSTD_use_indefinitely:\n        return dctx->ddict;\n    case ZSTD_use_once:\n        dctx->dictUses = ZSTD_dont_use;\n        return dctx->ddict;\n    }\n}\n\nsize_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));\n}\n\n\nsize_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n#if defined(ZSTD_HEAPMODE) && (ZSTD_HEAPMODE>=1)\n    size_t regenSize;\n    ZSTD_DCtx* const dctx = ZSTD_createDCtx();\n    RETURN_ERROR_IF(dctx==NULL, memory_allocation, \"NULL pointer!\");\n    regenSize = ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize);\n    ZSTD_freeDCtx(dctx);\n    return regenSize;\n#else   /* stack mode */\n    ZSTD_DCtx dctx;\n    ZSTD_initDCtx_internal(&dctx);\n    return ZSTD_decompressDCtx(&dctx, dst, dstCapacity, src, srcSize);\n#endif\n}\n\n\n/*-**************************************\n*   Advanced Streaming Decompression API\n*   Bufferless and synchronous\n****************************************/\nsize_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; }\n\n/**\n * Similar to ZSTD_nextSrcSizeToDecompress(), but when when a block input can be streamed,\n * we allow taking a partial block as the input. Currently only raw uncompressed blocks can\n * be streamed.\n *\n * For blocks that can be streamed, this allows us to reduce the latency until we produce\n * output, and avoid copying the input.\n *\n * @param inputSize - The total amount of input that the caller currently has.\n */\nstatic size_t ZSTD_nextSrcSizeToDecompressWithInputSize(ZSTD_DCtx* dctx, size_t inputSize) {\n    if (!(dctx->stage == ZSTDds_decompressBlock || dctx->stage == ZSTDds_decompressLastBlock))\n        return dctx->expected;\n    if (dctx->bType != bt_raw)\n        return dctx->expected;\n    return MIN(MAX(inputSize, 1), dctx->expected);\n}\n\nZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) {\n    switch(dctx->stage)\n    {\n    default:   /* should not happen */\n        assert(0);\n    case ZSTDds_getFrameHeaderSize:\n    case ZSTDds_decodeFrameHeader:\n        return ZSTDnit_frameHeader;\n    case ZSTDds_decodeBlockHeader:\n        return ZSTDnit_blockHeader;\n    case ZSTDds_decompressBlock:\n        return ZSTDnit_block;\n    case ZSTDds_decompressLastBlock:\n        return ZSTDnit_lastBlock;\n    case ZSTDds_checkChecksum:\n        return ZSTDnit_checksum;\n    case ZSTDds_decodeSkippableHeader:\n    case ZSTDds_skipFrame:\n        return ZSTDnit_skippableFrame;\n    }\n}\n\nstatic int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; }\n\n/** ZSTD_decompressContinue() :\n *  srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress())\n *  @return : nb of bytes generated into `dst` (necessarily <= `dstCapacity)\n *            or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    DEBUGLOG(5, \"ZSTD_decompressContinue (srcSize:%u)\", (unsigned)srcSize);\n    /* Sanity check */\n    RETURN_ERROR_IF(srcSize != ZSTD_nextSrcSizeToDecompressWithInputSize(dctx, srcSize), srcSize_wrong, \"not allowed\");\n    if (dstCapacity) ZSTD_checkContinuity(dctx, dst);\n\n    switch (dctx->stage)\n    {\n    case ZSTDds_getFrameHeaderSize :\n        assert(src != NULL);\n        if (dctx->format == ZSTD_f_zstd1) {  /* allows header */\n            assert(srcSize >= ZSTD_FRAMEIDSIZE);  /* to read skippable magic number */\n            if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {        /* skippable frame */\n                ZSTD_memcpy(dctx->headerBuffer, src, srcSize);\n                dctx->expected = ZSTD_SKIPPABLEHEADERSIZE - srcSize;  /* remaining to load to get full skippable frame header */\n                dctx->stage = ZSTDds_decodeSkippableHeader;\n                return 0;\n        }   }\n        dctx->headerSize = ZSTD_frameHeaderSize_internal(src, srcSize, dctx->format);\n        if (ZSTD_isError(dctx->headerSize)) return dctx->headerSize;\n        ZSTD_memcpy(dctx->headerBuffer, src, srcSize);\n        dctx->expected = dctx->headerSize - srcSize;\n        dctx->stage = ZSTDds_decodeFrameHeader;\n        return 0;\n\n    case ZSTDds_decodeFrameHeader:\n        assert(src != NULL);\n        ZSTD_memcpy(dctx->headerBuffer + (dctx->headerSize - srcSize), src, srcSize);\n        FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize), \"\");\n        dctx->expected = ZSTD_blockHeaderSize;\n        dctx->stage = ZSTDds_decodeBlockHeader;\n        return 0;\n\n    case ZSTDds_decodeBlockHeader:\n        {   blockProperties_t bp;\n            size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp);\n            if (ZSTD_isError(cBlockSize)) return cBlockSize;\n            RETURN_ERROR_IF(cBlockSize > dctx->fParams.blockSizeMax, corruption_detected, \"Block Size Exceeds Maximum\");\n            dctx->expected = cBlockSize;\n            dctx->bType = bp.blockType;\n            dctx->rleSize = bp.origSize;\n            if (cBlockSize) {\n                dctx->stage = bp.lastBlock ? ZSTDds_decompressLastBlock : ZSTDds_decompressBlock;\n                return 0;\n            }\n            /* empty block */\n            if (bp.lastBlock) {\n                if (dctx->fParams.checksumFlag) {\n                    dctx->expected = 4;\n                    dctx->stage = ZSTDds_checkChecksum;\n                } else {\n                    dctx->expected = 0; /* end of frame */\n                    dctx->stage = ZSTDds_getFrameHeaderSize;\n                }\n            } else {\n                dctx->expected = ZSTD_blockHeaderSize;  /* jump to next header */\n                dctx->stage = ZSTDds_decodeBlockHeader;\n            }\n            return 0;\n        }\n\n    case ZSTDds_decompressLastBlock:\n    case ZSTDds_decompressBlock:\n        DEBUGLOG(5, \"ZSTD_decompressContinue: case ZSTDds_decompressBlock\");\n        {   size_t rSize;\n            switch(dctx->bType)\n            {\n            case bt_compressed:\n                DEBUGLOG(5, \"ZSTD_decompressContinue: case bt_compressed\");\n                rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 1);\n                dctx->expected = 0;  /* Streaming not supported */\n                break;\n            case bt_raw :\n                assert(srcSize <= dctx->expected);\n                rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize);\n                FORWARD_IF_ERROR(rSize, \"ZSTD_copyRawBlock failed\");\n                assert(rSize == srcSize);\n                dctx->expected -= rSize;\n                break;\n            case bt_rle :\n                rSize = ZSTD_setRleBlock(dst, dstCapacity, *(const BYTE*)src, dctx->rleSize);\n                dctx->expected = 0;  /* Streaming not supported */\n                break;\n            case bt_reserved :   /* should never happen */\n            default:\n                RETURN_ERROR(corruption_detected, \"invalid block type\");\n            }\n            FORWARD_IF_ERROR(rSize, \"\");\n            RETURN_ERROR_IF(rSize > dctx->fParams.blockSizeMax, corruption_detected, \"Decompressed Block Size Exceeds Maximum\");\n            DEBUGLOG(5, \"ZSTD_decompressContinue: decoded size from block : %u\", (unsigned)rSize);\n            dctx->decodedSize += rSize;\n            if (dctx->validateChecksum) XXH64_update(&dctx->xxhState, dst, rSize);\n            dctx->previousDstEnd = (char*)dst + rSize;\n\n            /* Stay on the same stage until we are finished streaming the block. */\n            if (dctx->expected > 0) {\n                return rSize;\n            }\n\n            if (dctx->stage == ZSTDds_decompressLastBlock) {   /* end of frame */\n                DEBUGLOG(4, \"ZSTD_decompressContinue: decoded size from frame : %u\", (unsigned)dctx->decodedSize);\n                RETURN_ERROR_IF(\n                    dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                 && dctx->decodedSize != dctx->fParams.frameContentSize,\n                    corruption_detected, \"\");\n                if (dctx->fParams.checksumFlag) {  /* another round for frame checksum */\n                    dctx->expected = 4;\n                    dctx->stage = ZSTDds_checkChecksum;\n                } else {\n                    dctx->expected = 0;   /* ends here */\n                    dctx->stage = ZSTDds_getFrameHeaderSize;\n                }\n            } else {\n                dctx->stage = ZSTDds_decodeBlockHeader;\n                dctx->expected = ZSTD_blockHeaderSize;\n            }\n            return rSize;\n        }\n\n    case ZSTDds_checkChecksum:\n        assert(srcSize == 4);  /* guaranteed by dctx->expected */\n        {\n            if (dctx->validateChecksum) {\n                U32 const h32 = (U32)XXH64_digest(&dctx->xxhState);\n                U32 const check32 = MEM_readLE32(src);\n                DEBUGLOG(4, \"ZSTD_decompressContinue: checksum : calculated %08X :: %08X read\", (unsigned)h32, (unsigned)check32);\n                RETURN_ERROR_IF(check32 != h32, checksum_wrong, \"\");\n            }\n            dctx->expected = 0;\n            dctx->stage = ZSTDds_getFrameHeaderSize;\n            return 0;\n        }\n\n    case ZSTDds_decodeSkippableHeader:\n        assert(src != NULL);\n        assert(srcSize <= ZSTD_SKIPPABLEHEADERSIZE);\n        ZSTD_memcpy(dctx->headerBuffer + (ZSTD_SKIPPABLEHEADERSIZE - srcSize), src, srcSize);   /* complete skippable header */\n        dctx->expected = MEM_readLE32(dctx->headerBuffer + ZSTD_FRAMEIDSIZE);   /* note : dctx->expected can grow seriously large, beyond local buffer size */\n        dctx->stage = ZSTDds_skipFrame;\n        return 0;\n\n    case ZSTDds_skipFrame:\n        dctx->expected = 0;\n        dctx->stage = ZSTDds_getFrameHeaderSize;\n        return 0;\n\n    default:\n        assert(0);   /* impossible */\n        RETURN_ERROR(GENERIC, \"impossible to reach\");   /* some compiler require default to do something */\n    }\n}\n\n\nstatic size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    dctx->dictEnd = dctx->previousDstEnd;\n    dctx->virtualStart = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));\n    dctx->prefixStart = dict;\n    dctx->previousDstEnd = (const char*)dict + dictSize;\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentBeginForFuzzing = dctx->prefixStart;\n    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;\n#endif\n    return 0;\n}\n\n/*! ZSTD_loadDEntropy() :\n *  dict : must point at beginning of a valid zstd dictionary.\n * @return : size of entropy tables read */\nsize_t\nZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,\n                  const void* const dict, size_t const dictSize)\n{\n    const BYTE* dictPtr = (const BYTE*)dict;\n    const BYTE* const dictEnd = dictPtr + dictSize;\n\n    RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, \"dict is too small\");\n    assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY);   /* dict must be valid */\n    dictPtr += 8;   /* skip header = magic + dictID */\n\n    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable));\n    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable));\n    ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE);\n    {   void* const workspace = &entropy->LLTable;   /* use fse tables as temporary workspace; implies fse tables are grouped together */\n        size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable);\n#ifdef HUF_FORCE_DECOMPRESS_X1\n        /* in minimal huffman, we always use X1 variants */\n        size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable,\n                                                dictPtr, dictEnd - dictPtr,\n                                                workspace, workspaceSize);\n#else\n        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,\n                                                dictPtr, (size_t)(dictEnd - dictPtr),\n                                                workspace, workspaceSize);\n#endif\n        RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, \"\");\n        dictPtr += hSize;\n    }\n\n    {   short offcodeNCount[MaxOff+1];\n        unsigned offcodeMaxValue = MaxOff, offcodeLog;\n        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->OFTable,\n                            offcodeNCount, offcodeMaxValue,\n                            OF_base, OF_bits,\n                            offcodeLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */0);\n        dictPtr += offcodeHeaderSize;\n    }\n\n    {   short matchlengthNCount[MaxML+1];\n        unsigned matchlengthMaxValue = MaxML, matchlengthLog;\n        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->MLTable,\n                            matchlengthNCount, matchlengthMaxValue,\n                            ML_base, ML_bits,\n                            matchlengthLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */ 0);\n        dictPtr += matchlengthHeaderSize;\n    }\n\n    {   short litlengthNCount[MaxLL+1];\n        unsigned litlengthMaxValue = MaxLL, litlengthLog;\n        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->LLTable,\n                            litlengthNCount, litlengthMaxValue,\n                            LL_base, LL_bits,\n                            litlengthLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */ 0);\n        dictPtr += litlengthHeaderSize;\n    }\n\n    RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, \"\");\n    {   int i;\n        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));\n        for (i=0; i<3; i++) {\n            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;\n            RETURN_ERROR_IF(rep==0 || rep > dictContentSize,\n                            dictionary_corrupted, \"\");\n            entropy->rep[i] = rep;\n    }   }\n\n    return (size_t)(dictPtr - (const BYTE*)dict);\n}\n\nstatic size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    if (dictSize < 8) return ZSTD_refDictContent(dctx, dict, dictSize);\n    {   U32 const magic = MEM_readLE32(dict);\n        if (magic != ZSTD_MAGIC_DICTIONARY) {\n            return ZSTD_refDictContent(dctx, dict, dictSize);   /* pure content mode */\n    }   }\n    dctx->dictID = MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE);\n\n    /* load entropy tables */\n    {   size_t const eSize = ZSTD_loadDEntropy(&dctx->entropy, dict, dictSize);\n        RETURN_ERROR_IF(ZSTD_isError(eSize), dictionary_corrupted, \"\");\n        dict = (const char*)dict + eSize;\n        dictSize -= eSize;\n    }\n    dctx->litEntropy = dctx->fseEntropy = 1;\n\n    /* reference dictionary content */\n    return ZSTD_refDictContent(dctx, dict, dictSize);\n}\n\nsize_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)\n{\n    assert(dctx != NULL);\n    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */\n    dctx->stage = ZSTDds_getFrameHeaderSize;\n    dctx->decodedSize = 0;\n    dctx->previousDstEnd = NULL;\n    dctx->prefixStart = NULL;\n    dctx->virtualStart = NULL;\n    dctx->dictEnd = NULL;\n    dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001);  /* cover both little and big endian */\n    dctx->litEntropy = dctx->fseEntropy = 0;\n    dctx->dictID = 0;\n    dctx->bType = bt_reserved;\n    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));\n    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */\n    dctx->LLTptr = dctx->entropy.LLTable;\n    dctx->MLTptr = dctx->entropy.MLTable;\n    dctx->OFTptr = dctx->entropy.OFTable;\n    dctx->HUFptr = dctx->entropy.hufTable;\n    return 0;\n}\n\nsize_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , \"\");\n    if (dict && dictSize)\n        RETURN_ERROR_IF(\n            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),\n            dictionary_corrupted, \"\");\n    return 0;\n}\n\n\n/* ======   ZSTD_DDict   ====== */\n\nsize_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    DEBUGLOG(4, \"ZSTD_decompressBegin_usingDDict\");\n    assert(dctx != NULL);\n    if (ddict) {\n        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);\n        size_t const dictSize = ZSTD_DDict_dictSize(ddict);\n        const void* const dictEnd = dictStart + dictSize;\n        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);\n        DEBUGLOG(4, \"DDict is %s\",\n                    dctx->ddictIsCold ? \"~cold~\" : \"hot!\");\n    }\n    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , \"\");\n    if (ddict) {   /* NULL ddict is equivalent to no dictionary */\n        ZSTD_copyDDictParameters(dctx, ddict);\n    }\n    return 0;\n}\n\n/*! ZSTD_getDictID_fromDict() :\n *  Provides the dictID stored within dictionary.\n *  if @return == 0, the dictionary is not conformant with Zstandard specification.\n *  It can still be loaded, but as a content-only dictionary. */\nunsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize)\n{\n    if (dictSize < 8) return 0;\n    if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) return 0;\n    return MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE);\n}\n\n/*! ZSTD_getDictID_fromFrame() :\n *  Provides the dictID required to decompress frame stored within `src`.\n *  If @return == 0, the dictID could not be decoded.\n *  This could for one of the following reasons :\n *  - The frame does not require a dictionary (most common case).\n *  - The frame was built with dictID intentionally removed.\n *    Needed dictionary is a hidden information.\n *    Note : this use case also happens when using a non-conformant dictionary.\n *  - `srcSize` is too small, and as a result, frame header could not be decoded.\n *    Note : possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`.\n *  - This is not a Zstandard frame.\n *  When identifying the exact failure cause, it's possible to use\n *  ZSTD_getFrameHeader(), which will provide a more precise error code. */\nunsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize)\n{\n    ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0 };\n    size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize);\n    if (ZSTD_isError(hError)) return 0;\n    return zfp.dictID;\n}\n\n\n/*! ZSTD_decompress_usingDDict() :\n*   Decompression using a pre-digested Dictionary\n*   Use dictionary without significant overhead. */\nsize_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,\n                                  void* dst, size_t dstCapacity,\n                            const void* src, size_t srcSize,\n                            const ZSTD_DDict* ddict)\n{\n    /* pass content and size in case legacy frames are encountered */\n    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,\n                                     NULL, 0,\n                                     ddict);\n}\n\n\n/*=====================================\n*   Streaming decompression\n*====================================*/\n\nZSTD_DStream* ZSTD_createDStream(void)\n{\n    DEBUGLOG(3, \"ZSTD_createDStream\");\n    return ZSTD_createDStream_advanced(ZSTD_defaultCMem);\n}\n\nZSTD_DStream* ZSTD_initStaticDStream(void *workspace, size_t workspaceSize)\n{\n    return ZSTD_initStaticDCtx(workspace, workspaceSize);\n}\n\nZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem)\n{\n    return ZSTD_createDCtx_advanced(customMem);\n}\n\nsize_t ZSTD_freeDStream(ZSTD_DStream* zds)\n{\n    return ZSTD_freeDCtx(zds);\n}\n\n\n/* ***  Initialization  *** */\n\nsize_t ZSTD_DStreamInSize(void)  { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; }\nsize_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_MAX; }\n\nsize_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx,\n                                   const void* dict, size_t dictSize,\n                                         ZSTD_dictLoadMethod_e dictLoadMethod,\n                                         ZSTD_dictContentType_e dictContentType)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    ZSTD_clearDict(dctx);\n    if (dict && dictSize != 0) {\n        dctx->ddictLocal = ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, dctx->customMem);\n        RETURN_ERROR_IF(dctx->ddictLocal == NULL, memory_allocation, \"NULL pointer!\");\n        dctx->ddict = dctx->ddictLocal;\n        dctx->dictUses = ZSTD_use_indefinitely;\n    }\n    return 0;\n}\n\nsize_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto);\n}\n\nsize_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto);\n}\n\nsize_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)\n{\n    FORWARD_IF_ERROR(ZSTD_DCtx_loadDictionary_advanced(dctx, prefix, prefixSize, ZSTD_dlm_byRef, dictContentType), \"\");\n    dctx->dictUses = ZSTD_use_once;\n    return 0;\n}\n\nsize_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize)\n{\n    return ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, ZSTD_dct_rawContent);\n}\n\n\n/* ZSTD_initDStream_usingDict() :\n * return : expected size, aka ZSTD_startingInputLength().\n * this function cannot fail */\nsize_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize)\n{\n    DEBUGLOG(4, \"ZSTD_initDStream_usingDict\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_reset(zds, ZSTD_reset_session_only) , \"\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_loadDictionary(zds, dict, dictSize) , \"\");\n    return ZSTD_startingInputLength(zds->format);\n}\n\n/* note : this variant can't fail */\nsize_t ZSTD_initDStream(ZSTD_DStream* zds)\n{\n    DEBUGLOG(4, \"ZSTD_initDStream\");\n    return ZSTD_initDStream_usingDDict(zds, NULL);\n}\n\n/* ZSTD_initDStream_usingDDict() :\n * ddict will just be referenced, and must outlive decompression session\n * this function cannot fail */\nsize_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict)\n{\n    FORWARD_IF_ERROR( ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only) , \"\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_refDDict(dctx, ddict) , \"\");\n    return ZSTD_startingInputLength(dctx->format);\n}\n\n/* ZSTD_resetDStream() :\n * return : expected size, aka ZSTD_startingInputLength().\n * this function cannot fail */\nsize_t ZSTD_resetDStream(ZSTD_DStream* dctx)\n{\n    FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), \"\");\n    return ZSTD_startingInputLength(dctx->format);\n}\n\n\nsize_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    ZSTD_clearDict(dctx);\n    if (ddict) {\n        dctx->ddict = ddict;\n        dctx->dictUses = ZSTD_use_indefinitely;\n    }\n    return 0;\n}\n\n/* ZSTD_DCtx_setMaxWindowSize() :\n * note : no direct equivalence in ZSTD_DCtx_setParameter,\n * since this version sets windowSize, and the other sets windowLog */\nsize_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize)\n{\n    ZSTD_bounds const bounds = ZSTD_dParam_getBounds(ZSTD_d_windowLogMax);\n    size_t const min = (size_t)1 << bounds.lowerBound;\n    size_t const max = (size_t)1 << bounds.upperBound;\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    RETURN_ERROR_IF(maxWindowSize < min, parameter_outOfBound, \"\");\n    RETURN_ERROR_IF(maxWindowSize > max, parameter_outOfBound, \"\");\n    dctx->maxWindowSize = maxWindowSize;\n    return 0;\n}\n\nsize_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format)\n{\n    return ZSTD_DCtx_setParameter(dctx, ZSTD_d_format, (int)format);\n}\n\nZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam)\n{\n    ZSTD_bounds bounds = { 0, 0, 0 };\n    switch(dParam) {\n        case ZSTD_d_windowLogMax:\n            bounds.lowerBound = ZSTD_WINDOWLOG_ABSOLUTEMIN;\n            bounds.upperBound = ZSTD_WINDOWLOG_MAX;\n            return bounds;\n        case ZSTD_d_format:\n            bounds.lowerBound = (int)ZSTD_f_zstd1;\n            bounds.upperBound = (int)ZSTD_f_zstd1_magicless;\n            ZSTD_STATIC_ASSERT(ZSTD_f_zstd1 < ZSTD_f_zstd1_magicless);\n            return bounds;\n        case ZSTD_d_stableOutBuffer:\n            bounds.lowerBound = (int)ZSTD_bm_buffered;\n            bounds.upperBound = (int)ZSTD_bm_stable;\n            return bounds;\n        case ZSTD_d_forceIgnoreChecksum:\n            bounds.lowerBound = (int)ZSTD_d_validateChecksum;\n            bounds.upperBound = (int)ZSTD_d_ignoreChecksum;\n            return bounds;\n        default:;\n    }\n    bounds.error = ERROR(parameter_unsupported);\n    return bounds;\n}\n\n/* ZSTD_dParam_withinBounds:\n * @return 1 if value is within dParam bounds,\n * 0 otherwise */\nstatic int ZSTD_dParam_withinBounds(ZSTD_dParameter dParam, int value)\n{\n    ZSTD_bounds const bounds = ZSTD_dParam_getBounds(dParam);\n    if (ZSTD_isError(bounds.error)) return 0;\n    if (value < bounds.lowerBound) return 0;\n    if (value > bounds.upperBound) return 0;\n    return 1;\n}\n\n#define CHECK_DBOUNDS(p,v) {                \\\n    RETURN_ERROR_IF(!ZSTD_dParam_withinBounds(p, v), parameter_outOfBound, \"\"); \\\n}\n\nsize_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value)\n{\n    switch (param) {\n        case ZSTD_d_windowLogMax:\n            *value = (int)ZSTD_highbit32((U32)dctx->maxWindowSize);\n            return 0;\n        case ZSTD_d_format:\n            *value = (int)dctx->format;\n            return 0;\n        case ZSTD_d_stableOutBuffer:\n            *value = (int)dctx->outBufferMode;\n            return 0;\n        case ZSTD_d_forceIgnoreChecksum:\n            *value = (int)dctx->forceIgnoreChecksum;\n            return 0;\n        default:;\n    }\n    RETURN_ERROR(parameter_unsupported, \"\");\n}\n\nsize_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter dParam, int value)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    switch(dParam) {\n        case ZSTD_d_windowLogMax:\n            if (value == 0) value = ZSTD_WINDOWLOG_LIMIT_DEFAULT;\n            CHECK_DBOUNDS(ZSTD_d_windowLogMax, value);\n            dctx->maxWindowSize = ((size_t)1) << value;\n            return 0;\n        case ZSTD_d_format:\n            CHECK_DBOUNDS(ZSTD_d_format, value);\n            dctx->format = (ZSTD_format_e)value;\n            return 0;\n        case ZSTD_d_stableOutBuffer:\n            CHECK_DBOUNDS(ZSTD_d_stableOutBuffer, value);\n            dctx->outBufferMode = (ZSTD_bufferMode_e)value;\n            return 0;\n        case ZSTD_d_forceIgnoreChecksum:\n            CHECK_DBOUNDS(ZSTD_d_forceIgnoreChecksum, value);\n            dctx->forceIgnoreChecksum = (ZSTD_forceIgnoreChecksum_e)value;\n            return 0;\n        default:;\n    }\n    RETURN_ERROR(parameter_unsupported, \"\");\n}\n\nsize_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset)\n{\n    if ( (reset == ZSTD_reset_session_only)\n      || (reset == ZSTD_reset_session_and_parameters) ) {\n        dctx->streamStage = zdss_init;\n        dctx->noForwardProgress = 0;\n    }\n    if ( (reset == ZSTD_reset_parameters)\n      || (reset == ZSTD_reset_session_and_parameters) ) {\n        RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n        ZSTD_clearDict(dctx);\n        ZSTD_DCtx_resetParameters(dctx);\n    }\n    return 0;\n}\n\n\nsize_t ZSTD_sizeof_DStream(const ZSTD_DStream* dctx)\n{\n    return ZSTD_sizeof_DCtx(dctx);\n}\n\nsize_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize)\n{\n    size_t const blockSize = (size_t) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);\n    unsigned long long const neededRBSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2);\n    unsigned long long const neededSize = MIN(frameContentSize, neededRBSize);\n    size_t const minRBSize = (size_t) neededSize;\n    RETURN_ERROR_IF((unsigned long long)minRBSize != neededSize,\n                    frameParameter_windowTooLarge, \"\");\n    return minRBSize;\n}\n\nsize_t ZSTD_estimateDStreamSize(size_t windowSize)\n{\n    size_t const blockSize = MIN(windowSize, ZSTD_BLOCKSIZE_MAX);\n    size_t const inBuffSize = blockSize;  /* no block can be larger */\n    size_t const outBuffSize = ZSTD_decodingBufferSize_min(windowSize, ZSTD_CONTENTSIZE_UNKNOWN);\n    return ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize;\n}\n\nsize_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize)\n{\n    U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX;   /* note : should be user-selectable, but requires an additional parameter (or a dctx) */\n    ZSTD_frameHeader zfh;\n    size_t const err = ZSTD_getFrameHeader(&zfh, src, srcSize);\n    if (ZSTD_isError(err)) return err;\n    RETURN_ERROR_IF(err>0, srcSize_wrong, \"\");\n    RETURN_ERROR_IF(zfh.windowSize > windowSizeMax,\n                    frameParameter_windowTooLarge, \"\");\n    return ZSTD_estimateDStreamSize((size_t)zfh.windowSize);\n}\n\n\n/* *****   Decompression   ***** */\n\nstatic int ZSTD_DCtx_isOverflow(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)\n{\n    return (zds->inBuffSize + zds->outBuffSize) >= (neededInBuffSize + neededOutBuffSize) * ZSTD_WORKSPACETOOLARGE_FACTOR;\n}\n\nstatic void ZSTD_DCtx_updateOversizedDuration(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)\n{\n    if (ZSTD_DCtx_isOverflow(zds, neededInBuffSize, neededOutBuffSize))\n        zds->oversizedDuration++;\n    else\n        zds->oversizedDuration = 0;\n}\n\nstatic int ZSTD_DCtx_isOversizedTooLong(ZSTD_DStream* zds)\n{\n    return zds->oversizedDuration >= ZSTD_WORKSPACETOOLARGE_MAXDURATION;\n}\n\n/* Checks that the output buffer hasn't changed if ZSTD_obm_stable is used. */\nstatic size_t ZSTD_checkOutBuffer(ZSTD_DStream const* zds, ZSTD_outBuffer const* output)\n{\n    ZSTD_outBuffer const expect = zds->expectedOutBuffer;\n    /* No requirement when ZSTD_obm_stable is not enabled. */\n    if (zds->outBufferMode != ZSTD_bm_stable)\n        return 0;\n    /* Any buffer is allowed in zdss_init, this must be the same for every other call until\n     * the context is reset.\n     */\n    if (zds->streamStage == zdss_init)\n        return 0;\n    /* The buffer must match our expectation exactly. */\n    if (expect.dst == output->dst && expect.pos == output->pos && expect.size == output->size)\n        return 0;\n    RETURN_ERROR(dstBuffer_wrong, \"ZSTD_d_stableOutBuffer enabled but output differs!\");\n}\n\n/* Calls ZSTD_decompressContinue() with the right parameters for ZSTD_decompressStream()\n * and updates the stage and the output buffer state. This call is extracted so it can be\n * used both when reading directly from the ZSTD_inBuffer, and in buffered input mode.\n * NOTE: You must break after calling this function since the streamStage is modified.\n */\nstatic size_t ZSTD_decompressContinueStream(\n            ZSTD_DStream* zds, char** op, char* oend,\n            void const* src, size_t srcSize) {\n    int const isSkipFrame = ZSTD_isSkipFrame(zds);\n    if (zds->outBufferMode == ZSTD_bm_buffered) {\n        size_t const dstSize = isSkipFrame ? 0 : zds->outBuffSize - zds->outStart;\n        size_t const decodedSize = ZSTD_decompressContinue(zds,\n                zds->outBuff + zds->outStart, dstSize, src, srcSize);\n        FORWARD_IF_ERROR(decodedSize, \"\");\n        if (!decodedSize && !isSkipFrame) {\n            zds->streamStage = zdss_read;\n        } else {\n            zds->outEnd = zds->outStart + decodedSize;\n            zds->streamStage = zdss_flush;\n        }\n    } else {\n        /* Write directly into the output buffer */\n        size_t const dstSize = isSkipFrame ? 0 : (size_t)(oend - *op);\n        size_t const decodedSize = ZSTD_decompressContinue(zds, *op, dstSize, src, srcSize);\n        FORWARD_IF_ERROR(decodedSize, \"\");\n        *op += decodedSize;\n        /* Flushing is not needed. */\n        zds->streamStage = zdss_read;\n        assert(*op <= oend);\n        assert(zds->outBufferMode == ZSTD_bm_stable);\n    }\n    return 0;\n}\n\nsize_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input)\n{\n    const char* const src = (const char*)input->src;\n    const char* const istart = input->pos != 0 ? src + input->pos : src;\n    const char* const iend = input->size != 0 ? src + input->size : src;\n    const char* ip = istart;\n    char* const dst = (char*)output->dst;\n    char* const ostart = output->pos != 0 ? dst + output->pos : dst;\n    char* const oend = output->size != 0 ? dst + output->size : dst;\n    char* op = ostart;\n    U32 someMoreWork = 1;\n\n    DEBUGLOG(5, \"ZSTD_decompressStream\");\n    RETURN_ERROR_IF(\n        input->pos > input->size,\n        srcSize_wrong,\n        \"forbidden. in: pos: %u   vs size: %u\",\n        (U32)input->pos, (U32)input->size);\n    RETURN_ERROR_IF(\n        output->pos > output->size,\n        dstSize_tooSmall,\n        \"forbidden. out: pos: %u   vs size: %u\",\n        (U32)output->pos, (U32)output->size);\n    DEBUGLOG(5, \"input size : %u\", (U32)(input->size - input->pos));\n    FORWARD_IF_ERROR(ZSTD_checkOutBuffer(zds, output), \"\");\n\n    while (someMoreWork) {\n        switch(zds->streamStage)\n        {\n        case zdss_init :\n            DEBUGLOG(5, \"stage zdss_init => transparent reset \");\n            zds->streamStage = zdss_loadHeader;\n            zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;\n            zds->legacyVersion = 0;\n            zds->hostageByte = 0;\n            zds->expectedOutBuffer = *output;\n            /* fall-through */\n\n        case zdss_loadHeader :\n            DEBUGLOG(5, \"stage zdss_loadHeader (srcSize : %u)\", (U32)(iend - ip));\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n            if (zds->legacyVersion) {\n                RETURN_ERROR_IF(zds->staticSize, memory_allocation,\n                    \"legacy support is incompatible with static dctx\");\n                {   size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);\n                    if (hint==0) zds->streamStage = zdss_init;\n                    return hint;\n            }   }\n#endif\n            {   size_t const hSize = ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format);\n                DEBUGLOG(5, \"header size : %u\", (U32)hSize);\n                if (ZSTD_isError(hSize)) {\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n                    U32 const legacyVersion = ZSTD_isLegacy(istart, iend-istart);\n                    if (legacyVersion) {\n                        ZSTD_DDict const* const ddict = ZSTD_getDDict(zds);\n                        const void* const dict = ddict ? ZSTD_DDict_dictContent(ddict) : NULL;\n                        size_t const dictSize = ddict ? ZSTD_DDict_dictSize(ddict) : 0;\n                        DEBUGLOG(5, \"ZSTD_decompressStream: detected legacy version v0.%u\", legacyVersion);\n                        RETURN_ERROR_IF(zds->staticSize, memory_allocation,\n                            \"legacy support is incompatible with static dctx\");\n                        FORWARD_IF_ERROR(ZSTD_initLegacyStream(&zds->legacyContext,\n                                    zds->previousLegacyVersion, legacyVersion,\n                                    dict, dictSize), \"\");\n                        zds->legacyVersion = zds->previousLegacyVersion = legacyVersion;\n                        {   size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, legacyVersion, output, input);\n                            if (hint==0) zds->streamStage = zdss_init;   /* or stay in stage zdss_loadHeader */\n                            return hint;\n                    }   }\n#endif\n                    return hSize;   /* error */\n                }\n                if (hSize != 0) {   /* need more input */\n                    size_t const toLoad = hSize - zds->lhSize;   /* if hSize!=0, hSize > zds->lhSize */\n                    size_t const remainingInput = (size_t)(iend-ip);\n                    assert(iend >= ip);\n                    if (toLoad > remainingInput) {   /* not enough input to load full header */\n                        if (remainingInput > 0) {\n                            ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, remainingInput);\n                            zds->lhSize += remainingInput;\n                        }\n                        input->pos = input->size;\n                        return (MAX((size_t)ZSTD_FRAMEHEADERSIZE_MIN(zds->format), hSize) - zds->lhSize) + ZSTD_blockHeaderSize;   /* remaining header bytes + next block header */\n                    }\n                    assert(ip != NULL);\n                    ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad;\n                    break;\n            }   }\n\n            /* check for single-pass mode opportunity */\n            if (zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                && zds->fParams.frameType != ZSTD_skippableFrame\n                && (U64)(size_t)(oend-op) >= zds->fParams.frameContentSize) {\n                size_t const cSize = ZSTD_findFrameCompressedSize(istart, (size_t)(iend-istart));\n                if (cSize <= (size_t)(iend-istart)) {\n                    /* shortcut : using single-pass mode */\n                    size_t const decompressedSize = ZSTD_decompress_usingDDict(zds, op, (size_t)(oend-op), istart, cSize, ZSTD_getDDict(zds));\n                    if (ZSTD_isError(decompressedSize)) return decompressedSize;\n                    DEBUGLOG(4, \"shortcut to single-pass ZSTD_decompress_usingDDict()\")\n                    ip = istart + cSize;\n                    op += decompressedSize;\n                    zds->expected = 0;\n                    zds->streamStage = zdss_init;\n                    someMoreWork = 0;\n                    break;\n            }   }\n\n            /* Check output buffer is large enough for ZSTD_odm_stable. */\n            if (zds->outBufferMode == ZSTD_bm_stable\n                && zds->fParams.frameType != ZSTD_skippableFrame\n                && zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                && (U64)(size_t)(oend-op) < zds->fParams.frameContentSize) {\n                RETURN_ERROR(dstSize_tooSmall, \"ZSTD_obm_stable passed but ZSTD_outBuffer is too small\");\n            }\n\n            /* Consume header (see ZSTDds_decodeFrameHeader) */\n            DEBUGLOG(4, \"Consume header\");\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(zds, ZSTD_getDDict(zds)), \"\");\n\n            if ((MEM_readLE32(zds->headerBuffer) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {  /* skippable frame */\n                zds->expected = MEM_readLE32(zds->headerBuffer + ZSTD_FRAMEIDSIZE);\n                zds->stage = ZSTDds_skipFrame;\n            } else {\n                FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize), \"\");\n                zds->expected = ZSTD_blockHeaderSize;\n                zds->stage = ZSTDds_decodeBlockHeader;\n            }\n\n            /* control buffer memory usage */\n            DEBUGLOG(4, \"Control max memory usage (%u KB <= max %u KB)\",\n                        (U32)(zds->fParams.windowSize >>10),\n                        (U32)(zds->maxWindowSize >> 10) );\n            zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN);\n            RETURN_ERROR_IF(zds->fParams.windowSize > zds->maxWindowSize,\n                            frameParameter_windowTooLarge, \"\");\n\n            /* Adapt buffer sizes to frame header instructions */\n            {   size_t const neededInBuffSize = MAX(zds->fParams.blockSizeMax, 4 /* frame checksum */);\n                size_t const neededOutBuffSize = zds->outBufferMode == ZSTD_bm_buffered\n                        ? ZSTD_decodingBufferSize_min(zds->fParams.windowSize, zds->fParams.frameContentSize)\n                        : 0;\n\n                ZSTD_DCtx_updateOversizedDuration(zds, neededInBuffSize, neededOutBuffSize);\n\n                {   int const tooSmall = (zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize);\n                    int const tooLarge = ZSTD_DCtx_isOversizedTooLong(zds);\n\n                    if (tooSmall || tooLarge) {\n                        size_t const bufferSize = neededInBuffSize + neededOutBuffSize;\n                        DEBUGLOG(4, \"inBuff  : from %u to %u\",\n                                    (U32)zds->inBuffSize, (U32)neededInBuffSize);\n                        DEBUGLOG(4, \"outBuff : from %u to %u\",\n                                    (U32)zds->outBuffSize, (U32)neededOutBuffSize);\n                        if (zds->staticSize) {  /* static DCtx */\n                            DEBUGLOG(4, \"staticSize : %u\", (U32)zds->staticSize);\n                            assert(zds->staticSize >= sizeof(ZSTD_DCtx));  /* controlled at init */\n                            RETURN_ERROR_IF(\n                                bufferSize > zds->staticSize - sizeof(ZSTD_DCtx),\n                                memory_allocation, \"\");\n                        } else {\n                            ZSTD_customFree(zds->inBuff, zds->customMem);\n                            zds->inBuffSize = 0;\n                            zds->outBuffSize = 0;\n                            zds->inBuff = (char*)ZSTD_customMalloc(bufferSize, zds->customMem);\n                            RETURN_ERROR_IF(zds->inBuff == NULL, memory_allocation, \"\");\n                        }\n                        zds->inBuffSize = neededInBuffSize;\n                        zds->outBuff = zds->inBuff + zds->inBuffSize;\n                        zds->outBuffSize = neededOutBuffSize;\n            }   }   }\n            zds->streamStage = zdss_read;\n            /* fall-through */\n\n        case zdss_read:\n            DEBUGLOG(5, \"stage zdss_read\");\n            {   size_t const neededInSize = ZSTD_nextSrcSizeToDecompressWithInputSize(zds, (size_t)(iend - ip));\n                DEBUGLOG(5, \"neededInSize = %u\", (U32)neededInSize);\n                if (neededInSize==0) {  /* end of frame */\n                    zds->streamStage = zdss_init;\n                    someMoreWork = 0;\n                    break;\n                }\n                if ((size_t)(iend-ip) >= neededInSize) {  /* decode directly from src */\n                    FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, ip, neededInSize), \"\");\n                    ip += neededInSize;\n                    /* Function modifies the stage so we must break */\n                    break;\n            }   }\n            if (ip==iend) { someMoreWork = 0; break; }   /* no more input */\n            zds->streamStage = zdss_load;\n            /* fall-through */\n\n        case zdss_load:\n            {   size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);\n                size_t const toLoad = neededInSize - zds->inPos;\n                int const isSkipFrame = ZSTD_isSkipFrame(zds);\n                size_t loadedSize;\n                /* At this point we shouldn't be decompressing a block that we can stream. */\n                assert(neededInSize == ZSTD_nextSrcSizeToDecompressWithInputSize(zds, iend - ip));\n                if (isSkipFrame) {\n                    loadedSize = MIN(toLoad, (size_t)(iend-ip));\n                } else {\n                    RETURN_ERROR_IF(toLoad > zds->inBuffSize - zds->inPos,\n                                    corruption_detected,\n                                    \"should never happen\");\n                    loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, (size_t)(iend-ip));\n                }\n                ip += loadedSize;\n                zds->inPos += loadedSize;\n                if (loadedSize < toLoad) { someMoreWork = 0; break; }   /* not enough input, wait for more */\n\n                /* decode loaded input */\n                zds->inPos = 0;   /* input is consumed */\n                FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, zds->inBuff, neededInSize), \"\");\n                /* Function modifies the stage so we must break */\n                break;\n            }\n        case zdss_flush:\n            {   size_t const toFlushSize = zds->outEnd - zds->outStart;\n                size_t const flushedSize = ZSTD_limitCopy(op, (size_t)(oend-op), zds->outBuff + zds->outStart, toFlushSize);\n                op += flushedSize;\n                zds->outStart += flushedSize;\n                if (flushedSize == toFlushSize) {  /* flush completed */\n                    zds->streamStage = zdss_read;\n                    if ( (zds->outBuffSize < zds->fParams.frameContentSize)\n                      && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) {\n                        DEBUGLOG(5, \"restart filling outBuff from beginning (left:%i, needed:%u)\",\n                                (int)(zds->outBuffSize - zds->outStart),\n                                (U32)zds->fParams.blockSizeMax);\n                        zds->outStart = zds->outEnd = 0;\n                    }\n                    break;\n            }   }\n            /* cannot complete flush */\n            someMoreWork = 0;\n            break;\n\n        default:\n            assert(0);    /* impossible */\n            RETURN_ERROR(GENERIC, \"impossible to reach\");   /* some compiler require default to do something */\n    }   }\n\n    /* result */\n    input->pos = (size_t)(ip - (const char*)(input->src));\n    output->pos = (size_t)(op - (char*)(output->dst));\n\n    /* Update the expected output buffer for ZSTD_obm_stable. */\n    zds->expectedOutBuffer = *output;\n\n    if ((ip==istart) && (op==ostart)) {  /* no forward progress */\n        zds->noForwardProgress ++;\n        if (zds->noForwardProgress >= ZSTD_NO_FORWARD_PROGRESS_MAX) {\n            RETURN_ERROR_IF(op==oend, dstSize_tooSmall, \"\");\n            RETURN_ERROR_IF(ip==iend, srcSize_wrong, \"\");\n            assert(0);\n        }\n    } else {\n        zds->noForwardProgress = 0;\n    }\n    {   size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zds);\n        if (!nextSrcSizeHint) {   /* frame fully decoded */\n            if (zds->outEnd == zds->outStart) {  /* output fully flushed */\n                if (zds->hostageByte) {\n                    if (input->pos >= input->size) {\n                        /* can't release hostage (not present) */\n                        zds->streamStage = zdss_read;\n                        return 1;\n                    }\n                    input->pos++;  /* release hostage */\n                }   /* zds->hostageByte */\n                return 0;\n            }  /* zds->outEnd == zds->outStart */\n            if (!zds->hostageByte) { /* output not fully flushed; keep last byte as hostage; will be released when all output is flushed */\n                input->pos--;   /* note : pos > 0, otherwise, impossible to finish reading last block */\n                zds->hostageByte=1;\n            }\n            return 1;\n        }  /* nextSrcSizeHint==0 */\n        nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds) == ZSTDnit_block);   /* preload header of next block */\n        assert(zds->inPos <= nextSrcSizeHint);\n        nextSrcSizeHint -= zds->inPos;   /* part already loaded*/\n        return nextSrcSizeHint;\n    }\n}\n\nsize_t ZSTD_decompressStream_simpleArgs (\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos)\n{\n    ZSTD_outBuffer output = { dst, dstCapacity, *dstPos };\n    ZSTD_inBuffer  input  = { src, srcSize, *srcPos };\n    /* ZSTD_compress_generic() will check validity of dstPos and srcPos */\n    size_t const cErr = ZSTD_decompressStream(dctx, &output, &input);\n    *dstPos = output.pos;\n    *srcPos = input.pos;\n    return cErr;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* zstd_decompress_block :\n * this module takes care of decompressing _compressed_ block */\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n#include \"../common/zstd_deps.h\"   /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"../common/compiler.h\"    /* prefetch */\n#include \"../common/cpu.h\"         /* bmi2 */\n#include \"../common/mem.h\"         /* low level memory routines */\n#define FSE_STATIC_LINKING_ONLY\n#include \"../common/fse.h\"\n#define HUF_STATIC_LINKING_ONLY\n#include \"../common/huf.h\"\n#include \"../common/zstd_internal.h\"\n#include \"zstd_decompress_internal.h\"   /* ZSTD_DCtx */\n#include \"zstd_ddict.h\"  /* ZSTD_DDictDictContent */\n#include \"zstd_decompress_block.h\"\n\n/*_*******************************************************\n*  Macros\n**********************************************************/\n\n/* These two optional macros force the use one way or another of the two\n * ZSTD_decompressSequences implementations. You can't force in both directions\n * at the same time.\n */\n#if defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n#error \"Cannot force the use of the short and the long ZSTD_decompressSequences variants!\"\n#endif\n\n\n/*_*******************************************************\n*  Memory operations\n**********************************************************/\nstatic void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }\n\n\n/*-*************************************************************\n *   Block decoding\n ***************************************************************/\n\n/*! ZSTD_getcBlockSize() :\n *  Provides the size of compressed block from block header `src` */\nsize_t ZSTD_getcBlockSize(const void* src, size_t srcSize,\n                          blockProperties_t* bpPtr)\n{\n    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, \"\");\n\n    {   U32 const cBlockHeader = MEM_readLE24(src);\n        U32 const cSize = cBlockHeader >> 3;\n        bpPtr->lastBlock = cBlockHeader & 1;\n        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);\n        bpPtr->origSize = cSize;   /* only useful for RLE */\n        if (bpPtr->blockType == bt_rle) return 1;\n        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, \"\");\n        return cSize;\n    }\n}\n\n\n/* Hidden declaration for fullbench */\nsize_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,\n                          const void* src, size_t srcSize);\n/*! ZSTD_decodeLiteralsBlock() :\n * @return : nb of bytes read from src (< srcSize )\n *  note : symbol not declared but exposed for fullbench */\nsize_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,\n                          const void* src, size_t srcSize)   /* note : srcSize < BLOCKSIZE */\n{\n    DEBUGLOG(5, \"ZSTD_decodeLiteralsBlock\");\n    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, \"\");\n\n    {   const BYTE* const istart = (const BYTE*) src;\n        symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3);\n\n        switch(litEncType)\n        {\n        case set_repeat:\n            DEBUGLOG(5, \"set_repeat flag : re-using stats from previous compressed literals block\");\n            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, \"\");\n            /* fall-through */\n\n        case set_compressed:\n            RETURN_ERROR_IF(srcSize < 5, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3\");\n            {   size_t lhSize, litSize, litCSize;\n                U32 singleStream=0;\n                U32 const lhlCode = (istart[0] >> 2) & 3;\n                U32 const lhc = MEM_readLE32(istart);\n                size_t hufSuccess;\n                switch(lhlCode)\n                {\n                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    /* 2 - 2 - 10 - 10 */\n                    singleStream = !lhlCode;\n                    lhSize = 3;\n                    litSize  = (lhc >> 4) & 0x3FF;\n                    litCSize = (lhc >> 14) & 0x3FF;\n                    break;\n                case 2:\n                    /* 2 - 2 - 14 - 14 */\n                    lhSize = 4;\n                    litSize  = (lhc >> 4) & 0x3FFF;\n                    litCSize = lhc >> 18;\n                    break;\n                case 3:\n                    /* 2 - 2 - 18 - 18 */\n                    lhSize = 5;\n                    litSize  = (lhc >> 4) & 0x3FFFF;\n                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);\n                    break;\n                }\n                RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, \"\");\n                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, \"\");\n\n                /* prefetch huffman table if cold */\n                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {\n                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));\n                }\n\n                if (litEncType==set_repeat) {\n                    if (singleStream) {\n                        hufSuccess = HUF_decompress1X_usingDTable_bmi2(\n                            dctx->litBuffer, litSize, istart+lhSize, litCSize,\n                            dctx->HUFptr, dctx->bmi2);\n                    } else {\n                        hufSuccess = HUF_decompress4X_usingDTable_bmi2(\n                            dctx->litBuffer, litSize, istart+lhSize, litCSize,\n                            dctx->HUFptr, dctx->bmi2);\n                    }\n                } else {\n                    if (singleStream) {\n#if defined(HUF_FORCE_DECOMPRESS_X2)\n                        hufSuccess = HUF_decompress1X_DCtx_wksp(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace));\n#else\n                        hufSuccess = HUF_decompress1X1_DCtx_wksp_bmi2(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace), dctx->bmi2);\n#endif\n                    } else {\n                        hufSuccess = HUF_decompress4X_hufOnly_wksp_bmi2(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace), dctx->bmi2);\n                    }\n                }\n\n                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, \"\");\n\n                dctx->litPtr = dctx->litBuffer;\n                dctx->litSize = litSize;\n                dctx->litEntropy = 1;\n                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;\n                ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);\n                return litCSize + lhSize;\n            }\n\n        case set_basic:\n            {   size_t litSize, lhSize;\n                U32 const lhlCode = ((istart[0]) >> 2) & 3;\n                switch(lhlCode)\n                {\n                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    lhSize = 1;\n                    litSize = istart[0] >> 3;\n                    break;\n                case 1:\n                    lhSize = 2;\n                    litSize = MEM_readLE16(istart) >> 4;\n                    break;\n                case 3:\n                    lhSize = 3;\n                    litSize = MEM_readLE24(istart) >> 4;\n                    break;\n                }\n\n                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */\n                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, \"\");\n                    ZSTD_memcpy(dctx->litBuffer, istart+lhSize, litSize);\n                    dctx->litPtr = dctx->litBuffer;\n                    dctx->litSize = litSize;\n                    ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);\n                    return lhSize+litSize;\n                }\n                /* direct reference into compressed stream */\n                dctx->litPtr = istart+lhSize;\n                dctx->litSize = litSize;\n                return lhSize+litSize;\n            }\n\n        case set_rle:\n            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;\n                size_t litSize, lhSize;\n                switch(lhlCode)\n                {\n                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    lhSize = 1;\n                    litSize = istart[0] >> 3;\n                    break;\n                case 1:\n                    lhSize = 2;\n                    litSize = MEM_readLE16(istart) >> 4;\n                    break;\n                case 3:\n                    lhSize = 3;\n                    litSize = MEM_readLE24(istart) >> 4;\n                    RETURN_ERROR_IF(srcSize<4, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4\");\n                    break;\n                }\n                RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, \"\");\n                ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);\n                dctx->litPtr = dctx->litBuffer;\n                dctx->litSize = litSize;\n                return lhSize+1;\n            }\n        default:\n            RETURN_ERROR(corruption_detected, \"impossible\");\n        }\n    }\n}\n\n/* Default FSE distribution tables.\n * These are pre-calculated FSE decoding tables using default distributions as defined in specification :\n * https://github.com/facebook/zstd/blob/release/doc/zstd_compression_format.md#default-distributions\n * They were generated programmatically with following method :\n * - start from default distributions, present in /lib/common/zstd_internal.h\n * - generate tables normally, using ZSTD_buildFSETable()\n * - printout the content of tables\n * - pretify output, report below, test with fuzzer to ensure it's correct */\n\n/* Default FSE distribution table for Literal Lengths */\nstatic const ZSTD_seqSymbol LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = {\n     {  1,  1,  1, LL_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n     /* nextState, nbAddBits, nbBits, baseVal */\n     {  0,  0,  4,    0},  { 16,  0,  4,    0},\n     { 32,  0,  5,    1},  {  0,  0,  5,    3},\n     {  0,  0,  5,    4},  {  0,  0,  5,    6},\n     {  0,  0,  5,    7},  {  0,  0,  5,    9},\n     {  0,  0,  5,   10},  {  0,  0,  5,   12},\n     {  0,  0,  6,   14},  {  0,  1,  5,   16},\n     {  0,  1,  5,   20},  {  0,  1,  5,   22},\n     {  0,  2,  5,   28},  {  0,  3,  5,   32},\n     {  0,  4,  5,   48},  { 32,  6,  5,   64},\n     {  0,  7,  5,  128},  {  0,  8,  6,  256},\n     {  0, 10,  6, 1024},  {  0, 12,  6, 4096},\n     { 32,  0,  4,    0},  {  0,  0,  4,    1},\n     {  0,  0,  5,    2},  { 32,  0,  5,    4},\n     {  0,  0,  5,    5},  { 32,  0,  5,    7},\n     {  0,  0,  5,    8},  { 32,  0,  5,   10},\n     {  0,  0,  5,   11},  {  0,  0,  6,   13},\n     { 32,  1,  5,   16},  {  0,  1,  5,   18},\n     { 32,  1,  5,   22},  {  0,  2,  5,   24},\n     { 32,  3,  5,   32},  {  0,  3,  5,   40},\n     {  0,  6,  4,   64},  { 16,  6,  4,   64},\n     { 32,  7,  5,  128},  {  0,  9,  6,  512},\n     {  0, 11,  6, 2048},  { 48,  0,  4,    0},\n     { 16,  0,  4,    1},  { 32,  0,  5,    2},\n     { 32,  0,  5,    3},  { 32,  0,  5,    5},\n     { 32,  0,  5,    6},  { 32,  0,  5,    8},\n     { 32,  0,  5,    9},  { 32,  0,  5,   11},\n     { 32,  0,  5,   12},  {  0,  0,  6,   15},\n     { 32,  1,  5,   18},  { 32,  1,  5,   20},\n     { 32,  2,  5,   24},  { 32,  2,  5,   28},\n     { 32,  3,  5,   40},  { 32,  4,  5,   48},\n     {  0, 16,  6,65536},  {  0, 15,  6,32768},\n     {  0, 14,  6,16384},  {  0, 13,  6, 8192},\n};   /* LL_defaultDTable */\n\n/* Default FSE distribution table for Offset Codes */\nstatic const ZSTD_seqSymbol OF_defaultDTable[(1<<OF_DEFAULTNORMLOG)+1] = {\n    {  1,  1,  1, OF_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n    /* nextState, nbAddBits, nbBits, baseVal */\n    {  0,  0,  5,    0},     {  0,  6,  4,   61},\n    {  0,  9,  5,  509},     {  0, 15,  5,32765},\n    {  0, 21,  5,2097149},   {  0,  3,  5,    5},\n    {  0,  7,  4,  125},     {  0, 12,  5, 4093},\n    {  0, 18,  5,262141},    {  0, 23,  5,8388605},\n    {  0,  5,  5,   29},     {  0,  8,  4,  253},\n    {  0, 14,  5,16381},     {  0, 20,  5,1048573},\n    {  0,  2,  5,    1},     { 16,  7,  4,  125},\n    {  0, 11,  5, 2045},     {  0, 17,  5,131069},\n    {  0, 22,  5,4194301},   {  0,  4,  5,   13},\n    { 16,  8,  4,  253},     {  0, 13,  5, 8189},\n    {  0, 19,  5,524285},    {  0,  1,  5,    1},\n    { 16,  6,  4,   61},     {  0, 10,  5, 1021},\n    {  0, 16,  5,65533},     {  0, 28,  5,268435453},\n    {  0, 27,  5,134217725}, {  0, 26,  5,67108861},\n    {  0, 25,  5,33554429},  {  0, 24,  5,16777213},\n};   /* OF_defaultDTable */\n\n\n/* Default FSE distribution table for Match Lengths */\nstatic const ZSTD_seqSymbol ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = {\n    {  1,  1,  1, ML_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n    /* nextState, nbAddBits, nbBits, baseVal */\n    {  0,  0,  6,    3},  {  0,  0,  4,    4},\n    { 32,  0,  5,    5},  {  0,  0,  5,    6},\n    {  0,  0,  5,    8},  {  0,  0,  5,    9},\n    {  0,  0,  5,   11},  {  0,  0,  6,   13},\n    {  0,  0,  6,   16},  {  0,  0,  6,   19},\n    {  0,  0,  6,   22},  {  0,  0,  6,   25},\n    {  0,  0,  6,   28},  {  0,  0,  6,   31},\n    {  0,  0,  6,   34},  {  0,  1,  6,   37},\n    {  0,  1,  6,   41},  {  0,  2,  6,   47},\n    {  0,  3,  6,   59},  {  0,  4,  6,   83},\n    {  0,  7,  6,  131},  {  0,  9,  6,  515},\n    { 16,  0,  4,    4},  {  0,  0,  4,    5},\n    { 32,  0,  5,    6},  {  0,  0,  5,    7},\n    { 32,  0,  5,    9},  {  0,  0,  5,   10},\n    {  0,  0,  6,   12},  {  0,  0,  6,   15},\n    {  0,  0,  6,   18},  {  0,  0,  6,   21},\n    {  0,  0,  6,   24},  {  0,  0,  6,   27},\n    {  0,  0,  6,   30},  {  0,  0,  6,   33},\n    {  0,  1,  6,   35},  {  0,  1,  6,   39},\n    {  0,  2,  6,   43},  {  0,  3,  6,   51},\n    {  0,  4,  6,   67},  {  0,  5,  6,   99},\n    {  0,  8,  6,  259},  { 32,  0,  4,    4},\n    { 48,  0,  4,    4},  { 16,  0,  4,    5},\n    { 32,  0,  5,    7},  { 32,  0,  5,    8},\n    { 32,  0,  5,   10},  { 32,  0,  5,   11},\n    {  0,  0,  6,   14},  {  0,  0,  6,   17},\n    {  0,  0,  6,   20},  {  0,  0,  6,   23},\n    {  0,  0,  6,   26},  {  0,  0,  6,   29},\n    {  0,  0,  6,   32},  {  0, 16,  6,65539},\n    {  0, 15,  6,32771},  {  0, 14,  6,16387},\n    {  0, 13,  6, 8195},  {  0, 12,  6, 4099},\n    {  0, 11,  6, 2051},  {  0, 10,  6, 1027},\n};   /* ML_defaultDTable */\n\n\nstatic void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddBits)\n{\n    void* ptr = dt;\n    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;\n    ZSTD_seqSymbol* const cell = dt + 1;\n\n    DTableH->tableLog = 0;\n    DTableH->fastMode = 0;\n\n    cell->nbBits = 0;\n    cell->nextState = 0;\n    assert(nbAddBits < 255);\n    cell->nbAdditionalBits = (BYTE)nbAddBits;\n    cell->baseValue = baseValue;\n}\n\n\n/* ZSTD_buildFSETable() :\n * generate FSE decoding table for one symbol (ll, ml or off)\n * cannot fail if input is valid =>\n * all inputs are presumed validated at this stage */\nFORCE_INLINE_TEMPLATE\nvoid ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U32* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_seqSymbol* const tableDecode = dt+1;\n    U32 const maxSV1 = maxSymbolValue + 1;\n    U32 const tableSize = 1 << tableLog;\n\n    U16* symbolNext = (U16*)wksp;\n    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);\n    U32 highThreshold = tableSize - 1;\n\n\n    /* Sanity Checks */\n    assert(maxSymbolValue <= MaxSeq);\n    assert(tableLog <= MaxFSELog);\n    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);\n    (void)wkspSize;\n    /* Init, lay down lowprob symbols */\n    {   ZSTD_seqSymbol_header DTableH;\n        DTableH.tableLog = tableLog;\n        DTableH.fastMode = 1;\n        {   S16 const largeLimit= (S16)(1 << (tableLog-1));\n            U32 s;\n            for (s=0; s<maxSV1; s++) {\n                if (normalizedCounter[s]==-1) {\n                    tableDecode[highThreshold--].baseValue = s;\n                    symbolNext[s] = 1;\n                } else {\n                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;\n                    assert(normalizedCounter[s]>=0);\n                    symbolNext[s] = (U16)normalizedCounter[s];\n        }   }   }\n        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));\n    }\n\n    /* Spread symbols */\n    assert(tableSize <= 512);\n    /* Specialized symbol spreading for the case when there are\n     * no low probability (-1 count) symbols. When compressing\n     * small blocks we avoid low probability symbols to hit this\n     * case, since header decoding speed matters more.\n     */\n    if (highThreshold == tableSize - 1) {\n        size_t const tableMask = tableSize-1;\n        size_t const step = FSE_TABLESTEP(tableSize);\n        /* First lay down the symbols in order.\n         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch\n         * misses since small blocks generally have small table logs, so nearly\n         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of\n         * our buffer to handle the over-write.\n         */\n        {\n            U64 const add = 0x0101010101010101ull;\n            size_t pos = 0;\n            U64 sv = 0;\n            U32 s;\n            for (s=0; s<maxSV1; ++s, sv += add) {\n                int i;\n                int const n = normalizedCounter[s];\n                MEM_write64(spread + pos, sv);\n                for (i = 8; i < n; i += 8) {\n                    MEM_write64(spread + pos + i, sv);\n                }\n                pos += n;\n            }\n        }\n        /* Now we spread those positions across the table.\n         * The benefit of doing it in two stages is that we avoid the the\n         * variable size inner loop, which caused lots of branch misses.\n         * Now we can run through all the positions without any branch misses.\n         * We unroll the loop twice, since that is what emperically worked best.\n         */\n        {\n            size_t position = 0;\n            size_t s;\n            size_t const unroll = 2;\n            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */\n            for (s = 0; s < (size_t)tableSize; s += unroll) {\n                size_t u;\n                for (u = 0; u < unroll; ++u) {\n                    size_t const uPosition = (position + (u * step)) & tableMask;\n                    tableDecode[uPosition].baseValue = spread[s + u];\n                }\n                position = (position + (unroll * step)) & tableMask;\n            }\n            assert(position == 0);\n        }\n    } else {\n        U32 const tableMask = tableSize-1;\n        U32 const step = FSE_TABLESTEP(tableSize);\n        U32 s, position = 0;\n        for (s=0; s<maxSV1; s++) {\n            int i;\n            int const n = normalizedCounter[s];\n            for (i=0; i<n; i++) {\n                tableDecode[position].baseValue = s;\n                position = (position + step) & tableMask;\n                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */\n        }   }\n        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */\n    }\n\n    /* Build Decoding table */\n    {\n        U32 u;\n        for (u=0; u<tableSize; u++) {\n            U32 const symbol = tableDecode[u].baseValue;\n            U32 const nextState = symbolNext[symbol]++;\n            tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );\n            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);\n            assert(nbAdditionalBits[symbol] < 255);\n            tableDecode[u].nbAdditionalBits = (BYTE)nbAdditionalBits[symbol];\n            tableDecode[u].baseValue = baseValue[symbol];\n        }\n    }\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U32* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n\n#if DYNAMIC_BMI2\nTARGET_ATTRIBUTE(\"bmi2\") static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U32* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n#endif\n\nvoid ZSTD_buildFSETable(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U32* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,\n                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n        return;\n    }\n#endif\n    (void)bmi2;\n    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n\n\n/*! ZSTD_buildSeqTable() :\n * @return : nb bytes read from src,\n *           or an error code if it fails */\nstatic size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymbol** DTablePtr,\n                                 symbolEncodingType_e type, unsigned max, U32 maxLog,\n                                 const void* src, size_t srcSize,\n                                 const U32* baseValue, const U32* nbAdditionalBits,\n                                 const ZSTD_seqSymbol* defaultTable, U32 flagRepeatTable,\n                                 int ddictIsCold, int nbSeq, U32* wksp, size_t wkspSize,\n                                 int bmi2)\n{\n    switch(type)\n    {\n    case set_rle :\n        RETURN_ERROR_IF(!srcSize, srcSize_wrong, \"\");\n        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, \"\");\n        {   U32 const symbol = *(const BYTE*)src;\n            U32 const baseline = baseValue[symbol];\n            U32 const nbBits = nbAdditionalBits[symbol];\n            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);\n        }\n        *DTablePtr = DTableSpace;\n        return 1;\n    case set_basic :\n        *DTablePtr = defaultTable;\n        return 0;\n    case set_repeat:\n        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, \"\");\n        /* prefetch FSE table if used */\n        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {\n            const void* const pStart = *DTablePtr;\n            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));\n            PREFETCH_AREA(pStart, pSize);\n        }\n        return 0;\n    case set_compressed :\n        {   unsigned tableLog;\n            S16 norm[MaxSeq+1];\n            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);\n            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, \"\");\n            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, \"\");\n            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);\n            *DTablePtr = DTableSpace;\n            return headerSize;\n        }\n    default :\n        assert(0);\n        RETURN_ERROR(GENERIC, \"impossible\");\n    }\n}\n\nsize_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,\n                             const void* src, size_t srcSize)\n{\n    const BYTE* const istart = (const BYTE* const)src;\n    const BYTE* const iend = istart + srcSize;\n    const BYTE* ip = istart;\n    int nbSeq;\n    DEBUGLOG(5, \"ZSTD_decodeSeqHeaders\");\n\n    /* check */\n    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, \"\");\n\n    /* SeqHead */\n    nbSeq = *ip++;\n    if (!nbSeq) {\n        *nbSeqPtr=0;\n        RETURN_ERROR_IF(srcSize != 1, srcSize_wrong, \"\");\n        return 1;\n    }\n    if (nbSeq > 0x7F) {\n        if (nbSeq == 0xFF) {\n            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, \"\");\n            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;\n            ip+=2;\n        } else {\n            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, \"\");\n            nbSeq = ((nbSeq-0x80)<<8) + *ip++;\n        }\n    }\n    *nbSeqPtr = nbSeq;\n\n    /* FSE table descriptors */\n    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, \"\"); /* minimum possible size: 1 byte for symbol encoding types */\n    {   symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6);\n        symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3);\n        symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3);\n        ip++;\n\n        /* Build DTables */\n        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,\n                                                      LLtype, MaxLL, LLFSELog,\n                                                      ip, iend-ip,\n                                                      LL_base, LL_bits,\n                                                      LL_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      dctx->bmi2);\n            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += llhSize;\n        }\n\n        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,\n                                                      OFtype, MaxOff, OffFSELog,\n                                                      ip, iend-ip,\n                                                      OF_base, OF_bits,\n                                                      OF_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      dctx->bmi2);\n            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += ofhSize;\n        }\n\n        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,\n                                                      MLtype, MaxML, MLFSELog,\n                                                      ip, iend-ip,\n                                                      ML_base, ML_bits,\n                                                      ML_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      dctx->bmi2);\n            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += mlhSize;\n        }\n    }\n\n    return ip-istart;\n}\n\n\ntypedef struct {\n    size_t litLength;\n    size_t matchLength;\n    size_t offset;\n    const BYTE* match;\n} seq_t;\n\ntypedef struct {\n    size_t state;\n    const ZSTD_seqSymbol* table;\n} ZSTD_fseState;\n\ntypedef struct {\n    BIT_DStream_t DStream;\n    ZSTD_fseState stateLL;\n    ZSTD_fseState stateOffb;\n    ZSTD_fseState stateML;\n    size_t prevOffset[ZSTD_REP_NUM];\n    const BYTE* prefixStart;\n    const BYTE* dictEnd;\n    size_t pos;\n} seqState_t;\n\n/*! ZSTD_overlapCopy8() :\n *  Copies 8 bytes from ip to op and updates op and ip where ip <= op.\n *  If the offset is < 8 then the offset is spread to at least 8 bytes.\n *\n *  Precondition: *ip <= *op\n *  Postcondition: *op - *op >= 8\n */\nHINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {\n    assert(*ip <= *op);\n    if (offset < 8) {\n        /* close range match, overlap */\n        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */\n        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */\n        int const sub2 = dec64table[offset];\n        (*op)[0] = (*ip)[0];\n        (*op)[1] = (*ip)[1];\n        (*op)[2] = (*ip)[2];\n        (*op)[3] = (*ip)[3];\n        *ip += dec32table[offset];\n        ZSTD_copy4(*op+4, *ip);\n        *ip -= sub2;\n    } else {\n        ZSTD_copy8(*op, *ip);\n    }\n    *ip += 8;\n    *op += 8;\n    assert(*op - *ip >= 8);\n}\n\n/*! ZSTD_safecopy() :\n *  Specialized version of memcpy() that is allowed to READ up to WILDCOPY_OVERLENGTH past the input buffer\n *  and write up to 16 bytes past oend_w (op >= oend_w is allowed).\n *  This function is only called in the uncommon case where the sequence is near the end of the block. It\n *  should be fast for a single long sequence, but can be slow for several short sequences.\n *\n *  @param ovtype controls the overlap detection\n *         - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.\n *         - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart.\n *           The src buffer must be before the dst buffer.\n */\nstatic void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {\n    ptrdiff_t const diff = op - ip;\n    BYTE* const oend = op + length;\n\n    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||\n           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));\n\n    if (length < 8) {\n        /* Handle short lengths. */\n        while (op < oend) *op++ = *ip++;\n        return;\n    }\n    if (ovtype == ZSTD_overlap_src_before_dst) {\n        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */\n        assert(length >= 8);\n        ZSTD_overlapCopy8(&op, &ip, diff);\n        assert(op - ip >= 8);\n        assert(op <= oend);\n    }\n\n    if (oend <= oend_w) {\n        /* No risk of overwrite. */\n        ZSTD_wildcopy(op, ip, length, ovtype);\n        return;\n    }\n    if (op <= oend_w) {\n        /* Wildcopy until we get close to the end. */\n        assert(oend > oend_w);\n        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);\n        ip += oend_w - op;\n        op = oend_w;\n    }\n    /* Handle the leftovers. */\n    while (op < oend) *op++ = *ip++;\n}\n\n/* ZSTD_execSequenceEnd():\n * This version handles cases that are near the end of the output buffer. It requires\n * more careful checks to make sure there is no overflow. By separating out these hard\n * and unlikely cases, we can speed up the common cases.\n *\n * NOTE: This function needs to be fast for a single long sequence, but doesn't need\n * to be optimized for many small sequences, since those fall into ZSTD_execSequence().\n */\nFORCE_NOINLINE\nsize_t ZSTD_execSequenceEnd(BYTE* op,\n                            BYTE* const oend, seq_t sequence,\n                            const BYTE** litPtr, const BYTE* const litLimit,\n                            const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;\n\n    /* bounds checks : careful of address space overflow in 32-bit mode */\n    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, \"last match must fit within dstBuffer\");\n    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, \"try to read beyond literal buffer\");\n    assert(op < op + sequenceLength);\n    assert(oLitEnd < op + sequenceLength);\n\n    /* copy literals */\n    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);\n    op = oLitEnd;\n    *litPtr = iLitEnd;\n\n    /* copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix */\n        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, \"\");\n        match = dictEnd - (prefixStart-match);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n            ZSTD_memmove(oLitEnd, match, length1);\n            op = oLitEnd + length1;\n            sequence.matchLength -= length1;\n            match = prefixStart;\n    }   }\n    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);\n    return sequenceLength;\n}\n\nHINT_INLINE\nsize_t ZSTD_execSequence(BYTE* op,\n                         BYTE* const oend, seq_t sequence,\n                         const BYTE** litPtr, const BYTE* const litLimit,\n                         const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */\n    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n\n    assert(op != NULL /* Precondition */);\n    assert(oend_w < oend /* No underflow */);\n    /* Handle edge cases in a slow path:\n     *   - Read beyond end of literals\n     *   - Match end is within WILDCOPY_OVERLIMIT of oend\n     *   - 32-bit mode and the match length overflows\n     */\n    if (UNLIKELY(\n            iLitEnd > litLimit ||\n            oMatchEnd > oend_w ||\n            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))\n        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);\n\n    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */\n    assert(op <= oLitEnd /* No overflow */);\n    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);\n    assert(oMatchEnd <= oend /* No underflow */);\n    assert(iLitEnd <= litLimit /* Literal length is in bounds */);\n    assert(oLitEnd <= oend_w /* Can wildcopy literals */);\n    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);\n\n    /* Copy Literals:\n     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.\n     * We likely don't need the full 32-byte wildcopy.\n     */\n    assert(WILDCOPY_OVERLENGTH >= 16);\n    ZSTD_copy16(op, (*litPtr));\n    if (UNLIKELY(sequence.litLength > 16)) {\n        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);\n    }\n    op = oLitEnd;\n    *litPtr = iLitEnd;   /* update for next sequence */\n\n    /* Copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix -> go into extDict */\n        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, \"\");\n        match = dictEnd + (match - prefixStart);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n            ZSTD_memmove(oLitEnd, match, length1);\n            op = oLitEnd + length1;\n            sequence.matchLength -= length1;\n            match = prefixStart;\n    }   }\n    /* Match within prefix of 1 or more bytes */\n    assert(op <= oMatchEnd);\n    assert(oMatchEnd <= oend_w);\n    assert(match >= prefixStart);\n    assert(sequence.matchLength >= 1);\n\n    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy\n     * without overlap checking.\n     */\n    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {\n        /* We bet on a full wildcopy for matches, since we expect matches to be\n         * longer than literals (in general). In silesia, ~10% of matches are longer\n         * than 16 bytes.\n         */\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);\n        return sequenceLength;\n    }\n    assert(sequence.offset < WILDCOPY_VECLEN);\n\n    /* Copy 8 bytes and spread the offset to be >= 8. */\n    ZSTD_overlapCopy8(&op, &match, sequence.offset);\n\n    /* If the match length is > 8 bytes, then continue with the wildcopy. */\n    if (sequence.matchLength > 8) {\n        assert(op < oMatchEnd);\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);\n    }\n    return sequenceLength;\n}\n\nstatic void\nZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt)\n{\n    const void* ptr = dt;\n    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;\n    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);\n    DEBUGLOG(6, \"ZSTD_initFseState : val=%u using %u bits\",\n                (U32)DStatePtr->state, DTableH->tableLog);\n    BIT_reloadDStream(bitD);\n    DStatePtr->table = dt + 1;\n}\n\nFORCE_INLINE_TEMPLATE void\nZSTD_updateFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD)\n{\n    ZSTD_seqSymbol const DInfo = DStatePtr->table[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n    DStatePtr->state = DInfo.nextState + lowBits;\n}\n\nFORCE_INLINE_TEMPLATE void\nZSTD_updateFseStateWithDInfo(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, ZSTD_seqSymbol const DInfo)\n{\n    U32 const nbBits = DInfo.nbBits;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n    DStatePtr->state = DInfo.nextState + lowBits;\n}\n\n/* We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum\n * offset bits. But we can only read at most (STREAM_ACCUMULATOR_MIN_32 - 1)\n * bits before reloading. This value is the maximum number of bytes we read\n * after reloading when we are decoding long offsets.\n */\n#define LONG_OFFSETS_MAX_EXTRA_BITS_32                       \\\n    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \\\n        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \\\n        : 0)\n\ntypedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset_e;\ntypedef enum { ZSTD_p_noPrefetch=0, ZSTD_p_prefetch=1 } ZSTD_prefetch_e;\n\nFORCE_INLINE_TEMPLATE seq_t\nZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, const ZSTD_prefetch_e prefetch)\n{\n    seq_t seq;\n    ZSTD_seqSymbol const llDInfo = seqState->stateLL.table[seqState->stateLL.state];\n    ZSTD_seqSymbol const mlDInfo = seqState->stateML.table[seqState->stateML.state];\n    ZSTD_seqSymbol const ofDInfo = seqState->stateOffb.table[seqState->stateOffb.state];\n    U32 const llBase = llDInfo.baseValue;\n    U32 const mlBase = mlDInfo.baseValue;\n    U32 const ofBase = ofDInfo.baseValue;\n    BYTE const llBits = llDInfo.nbAdditionalBits;\n    BYTE const mlBits = mlDInfo.nbAdditionalBits;\n    BYTE const ofBits = ofDInfo.nbAdditionalBits;\n    BYTE const totalBits = llBits+mlBits+ofBits;\n\n    /* sequence */\n    {   size_t offset;\n        if (ofBits > 1) {\n            ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);\n            ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);\n            assert(ofBits <= MaxOff);\n            if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {\n                U32 const extraBits = ofBits - MIN(ofBits, 32 - seqState->DStream.bitsConsumed);\n                offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);\n                BIT_reloadDStream(&seqState->DStream);\n                if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits);\n                assert(extraBits <= LONG_OFFSETS_MAX_EXTRA_BITS_32);   /* to avoid another reload */\n            } else {\n                offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */\n                if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);\n            }\n            seqState->prevOffset[2] = seqState->prevOffset[1];\n            seqState->prevOffset[1] = seqState->prevOffset[0];\n            seqState->prevOffset[0] = offset;\n        } else {\n            U32 const ll0 = (llBase == 0);\n            if (LIKELY((ofBits == 0))) {\n                if (LIKELY(!ll0))\n                    offset = seqState->prevOffset[0];\n                else {\n                    offset = seqState->prevOffset[1];\n                    seqState->prevOffset[1] = seqState->prevOffset[0];\n                    seqState->prevOffset[0] = offset;\n                }\n            } else {\n                offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);\n                {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];\n                    temp += !temp;   /* 0 is not valid; input is corrupted; force offset to 1 */\n                    if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];\n                    seqState->prevOffset[1] = seqState->prevOffset[0];\n                    seqState->prevOffset[0] = offset = temp;\n        }   }   }\n        seq.offset = offset;\n    }\n\n    seq.matchLength = mlBase;\n    if (mlBits > 0)\n        seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);\n\n    if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))\n        BIT_reloadDStream(&seqState->DStream);\n    if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))\n        BIT_reloadDStream(&seqState->DStream);\n    /* Ensure there are enough bits to read the rest of data in 64-bit mode. */\n    ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);\n\n    seq.litLength = llBase;\n    if (llBits > 0)\n        seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);\n\n    if (MEM_32bits())\n        BIT_reloadDStream(&seqState->DStream);\n\n    DEBUGLOG(6, \"seq: litL=%u, matchL=%u, offset=%u\",\n                (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);\n\n    if (prefetch == ZSTD_p_prefetch) {\n        size_t const pos = seqState->pos + seq.litLength;\n        const BYTE* const matchBase = (seq.offset > pos) ? seqState->dictEnd : seqState->prefixStart;\n        seq.match = matchBase + pos - seq.offset;  /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.\n                                                    * No consequence though : no memory access will occur, offset is only used for prefetching */\n        seqState->pos = pos + seq.matchLength;\n    }\n\n    /* ANS state update\n     * gcc-9.0.0 does 2.5% worse with ZSTD_updateFseStateWithDInfo().\n     * clang-9.2.0 does 7% worse with ZSTD_updateFseState().\n     * Naturally it seems like ZSTD_updateFseStateWithDInfo() should be the\n     * better option, so it is the default for other compilers. But, if you\n     * measure that it is worse, please put up a pull request.\n     */\n    {\n#if defined(__GNUC__) && !defined(__clang__)\n        const int kUseUpdateFseState = 1;\n#else\n        const int kUseUpdateFseState = 0;\n#endif\n        if (kUseUpdateFseState) {\n            ZSTD_updateFseState(&seqState->stateLL, &seqState->DStream);    /* <=  9 bits */\n            ZSTD_updateFseState(&seqState->stateML, &seqState->DStream);    /* <=  9 bits */\n            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */\n            ZSTD_updateFseState(&seqState->stateOffb, &seqState->DStream);  /* <=  8 bits */\n        } else {\n            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llDInfo);    /* <=  9 bits */\n            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlDInfo);    /* <=  9 bits */\n            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */\n            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofDInfo);  /* <=  8 bits */\n        }\n    }\n\n    return seq;\n}\n\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\nMEM_STATIC int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)\n{\n    size_t const windowSize = dctx->fParams.windowSize;\n    /* No dictionary used. */\n    if (dctx->dictContentEndForFuzzing == NULL) return 0;\n    /* Dictionary is our prefix. */\n    if (prefixStart == dctx->dictContentBeginForFuzzing) return 1;\n    /* Dictionary is not our ext-dict. */\n    if (dctx->dictEnd != dctx->dictContentEndForFuzzing) return 0;\n    /* Dictionary is not within our window size. */\n    if ((size_t)(oLitEnd - prefixStart) >= windowSize) return 0;\n    /* Dictionary is active. */\n    return 1;\n}\n\nMEM_STATIC void ZSTD_assertValidSequence(\n        ZSTD_DCtx const* dctx,\n        BYTE const* op, BYTE const* oend,\n        seq_t const seq,\n        BYTE const* prefixStart, BYTE const* virtualStart)\n{\n#if DEBUGLEVEL >= 1\n    size_t const windowSize = dctx->fParams.windowSize;\n    size_t const sequenceSize = seq.litLength + seq.matchLength;\n    BYTE const* const oLitEnd = op + seq.litLength;\n    DEBUGLOG(6, \"Checking sequence: litL=%u matchL=%u offset=%u\",\n            (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);\n    assert(op <= oend);\n    assert((size_t)(oend - op) >= sequenceSize);\n    assert(sequenceSize <= ZSTD_BLOCKSIZE_MAX);\n    if (ZSTD_dictionaryIsActive(dctx, prefixStart, oLitEnd)) {\n        size_t const dictSize = (size_t)((char const*)dctx->dictContentEndForFuzzing - (char const*)dctx->dictContentBeginForFuzzing);\n        /* Offset must be within the dictionary. */\n        assert(seq.offset <= (size_t)(oLitEnd - virtualStart));\n        assert(seq.offset <= windowSize + dictSize);\n    } else {\n        /* Offset must be within our window. */\n        assert(seq.offset <= windowSize);\n    }\n#else\n    (void)dctx, (void)op, (void)oend, (void)seq, (void)prefixStart, (void)virtualStart;\n#endif\n}\n#endif\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\nFORCE_INLINE_TEMPLATE size_t\nDONT_VECTORIZE\nZSTD_decompressSequences_body( ZSTD_DCtx* dctx,\n                               void* dst, size_t maxDstSize,\n                         const void* seqStart, size_t seqSize, int nbSeq,\n                         const ZSTD_longOffset_e isLongOffset,\n                         const int frame)\n{\n    const BYTE* ip = (const BYTE*)seqStart;\n    const BYTE* const iend = ip + seqSize;\n    BYTE* const ostart = (BYTE* const)dst;\n    BYTE* const oend = ostart + maxDstSize;\n    BYTE* op = ostart;\n    const BYTE* litPtr = dctx->litPtr;\n    const BYTE* const litEnd = litPtr + dctx->litSize;\n    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);\n    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);\n    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);\n    DEBUGLOG(5, \"ZSTD_decompressSequences_body\");\n    (void)frame;\n\n    /* Regen sequences */\n    if (nbSeq) {\n        seqState_t seqState;\n        size_t error = 0;\n        dctx->fseEntropy = 1;\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }\n        RETURN_ERROR_IF(\n            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),\n            corruption_detected, \"\");\n        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);\n        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);\n        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);\n        assert(dst != NULL);\n\n        ZSTD_STATIC_ASSERT(\n                BIT_DStream_unfinished < BIT_DStream_completed &&\n                BIT_DStream_endOfBuffer < BIT_DStream_completed &&\n                BIT_DStream_completed < BIT_DStream_overflow);\n\n#if defined(__GNUC__) && defined(__x86_64__)\n        /* Align the decompression loop to 32 + 16 bytes.\n         *\n         * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression\n         * speed swings based on the alignment of the decompression loop. This\n         * performance swing is caused by parts of the decompression loop falling\n         * out of the DSB. The entire decompression loop should fit in the DSB,\n         * when it can't we get much worse performance. You can measure if you've\n         * hit the good case or the bad case with this perf command for some\n         * compressed file test.zst:\n         *\n         *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \\\n         *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst\n         *\n         * If you see most cycles served out of the MITE you've hit the bad case.\n         * If you see most cycles served out of the DSB you've hit the good case.\n         * If it is pretty even then you may be in an okay case.\n         *\n         * I've been able to reproduce this issue on the following CPUs:\n         *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9\n         *               Use Instruments->Counters to get DSB/MITE cycles.\n         *               I never got performance swings, but I was able to\n         *               go from the good case of mostly DSB to half of the\n         *               cycles served from MITE.\n         *   - Coffeelake: Intel i9-9900k\n         *\n         * I haven't been able to reproduce the instability or DSB misses on any\n         * of the following CPUS:\n         *   - Haswell\n         *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH\n         *   - Skylake\n         *\n         * If you are seeing performance stability this script can help test.\n         * It tests on 4 commits in zstd where I saw performance change.\n         *\n         *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4\n         */\n        __asm__(\".p2align 5\");\n        __asm__(\"nop\");\n        __asm__(\".p2align 4\");\n#endif\n        for ( ; ; ) {\n            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, ZSTD_p_noPrefetch);\n            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n            assert(!ZSTD_isError(oneSeqSize));\n            if (frame) ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);\n#endif\n            DEBUGLOG(6, \"regenerated sequence size : %u\", (U32)oneSeqSize);\n            BIT_reloadDStream(&(seqState.DStream));\n            op += oneSeqSize;\n            /* gcc and clang both don't like early returns in this loop.\n             * Instead break and check for an error at the end of the loop.\n             */\n            if (UNLIKELY(ZSTD_isError(oneSeqSize))) {\n                error = oneSeqSize;\n                break;\n            }\n            if (UNLIKELY(!--nbSeq)) break;\n        }\n\n        /* check if reached exact end */\n        DEBUGLOG(5, \"ZSTD_decompressSequences_body: after decode loop, remaining nbSeq : %i\", nbSeq);\n        if (ZSTD_isError(error)) return error;\n        RETURN_ERROR_IF(nbSeq, corruption_detected, \"\");\n        RETURN_ERROR_IF(BIT_reloadDStream(&seqState.DStream) < BIT_DStream_completed, corruption_detected, \"\");\n        /* save reps for next block */\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }\n    }\n\n    /* last literal segment */\n    {   size_t const lastLLSize = litEnd - litPtr;\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memcpy(op, litPtr, lastLLSize);\n            op += lastLLSize;\n        }\n    }\n\n    return op-ostart;\n}\n\nstatic size_t\nZSTD_decompressSequences_default(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset,\n                           const int frame)\n{\n    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\nFORCE_INLINE_TEMPLATE size_t\nZSTD_decompressSequencesLong_body(\n                               ZSTD_DCtx* dctx,\n                               void* dst, size_t maxDstSize,\n                         const void* seqStart, size_t seqSize, int nbSeq,\n                         const ZSTD_longOffset_e isLongOffset,\n                         const int frame)\n{\n    const BYTE* ip = (const BYTE*)seqStart;\n    const BYTE* const iend = ip + seqSize;\n    BYTE* const ostart = (BYTE* const)dst;\n    BYTE* const oend = ostart + maxDstSize;\n    BYTE* op = ostart;\n    const BYTE* litPtr = dctx->litPtr;\n    const BYTE* const litEnd = litPtr + dctx->litSize;\n    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);\n    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);\n    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);\n    (void)frame;\n\n    /* Regen sequences */\n    if (nbSeq) {\n#define STORED_SEQS 4\n#define STORED_SEQS_MASK (STORED_SEQS-1)\n#define ADVANCED_SEQS 4\n        seq_t sequences[STORED_SEQS];\n        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);\n        seqState_t seqState;\n        int seqNb;\n        dctx->fseEntropy = 1;\n        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }\n        seqState.prefixStart = prefixStart;\n        seqState.pos = (size_t)(op-prefixStart);\n        seqState.dictEnd = dictEnd;\n        assert(dst != NULL);\n        assert(iend >= ip);\n        RETURN_ERROR_IF(\n            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),\n            corruption_detected, \"\");\n        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);\n        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);\n        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);\n\n        /* prepare in advance */\n        for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && (seqNb<seqAdvance); seqNb++) {\n            sequences[seqNb] = ZSTD_decodeSequence(&seqState, isLongOffset, ZSTD_p_prefetch);\n            PREFETCH_L1(sequences[seqNb].match); PREFETCH_L1(sequences[seqNb].match + sequences[seqNb].matchLength - 1); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */\n        }\n        RETURN_ERROR_IF(seqNb<seqAdvance, corruption_detected, \"\");\n\n        /* decode and decompress */\n        for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && (seqNb<nbSeq) ; seqNb++) {\n            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, ZSTD_p_prefetch);\n            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n            assert(!ZSTD_isError(oneSeqSize));\n            if (frame) ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n            if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n            PREFETCH_L1(sequence.match); PREFETCH_L1(sequence.match + sequence.matchLength - 1); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */\n            sequences[seqNb & STORED_SEQS_MASK] = sequence;\n            op += oneSeqSize;\n        }\n        RETURN_ERROR_IF(seqNb<nbSeq, corruption_detected, \"\");\n\n        /* finish queue */\n        seqNb -= seqAdvance;\n        for ( ; seqNb<nbSeq ; seqNb++) {\n            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[seqNb&STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n            assert(!ZSTD_isError(oneSeqSize));\n            if (frame) ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n            if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n            op += oneSeqSize;\n        }\n\n        /* save reps for next block */\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }\n    }\n\n    /* last literal segment */\n    {   size_t const lastLLSize = litEnd - litPtr;\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memcpy(op, litPtr, lastLLSize);\n            op += lastLLSize;\n        }\n    }\n\n    return op-ostart;\n}\n\nstatic size_t\nZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset,\n                           const int frame)\n{\n    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n\n\n#if DYNAMIC_BMI2\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\nstatic TARGET_ATTRIBUTE(\"bmi2\") size_t\nDONT_VECTORIZE\nZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset,\n                           const int frame)\n{\n    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\nstatic TARGET_ATTRIBUTE(\"bmi2\") size_t\nZSTD_decompressSequencesLong_bmi2(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset,\n                           const int frame)\n{\n    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n#endif /* DYNAMIC_BMI2 */\n\ntypedef size_t (*ZSTD_decompressSequences_t)(\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t maxDstSize,\n                            const void* seqStart, size_t seqSize, int nbSeq,\n                            const ZSTD_longOffset_e isLongOffset,\n                            const int frame);\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\nstatic size_t\nZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize,\n                   const void* seqStart, size_t seqSize, int nbSeq,\n                   const ZSTD_longOffset_e isLongOffset,\n                   const int frame)\n{\n    DEBUGLOG(5, \"ZSTD_decompressSequences\");\n#if DYNAMIC_BMI2\n    if (dctx->bmi2) {\n        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n    }\n#endif\n  return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\n/* ZSTD_decompressSequencesLong() :\n * decompression function triggered when a minimum share of offsets is considered \"long\",\n * aka out of cache.\n * note : \"long\" definition seems overloaded here, sometimes meaning \"wider than bitstream register\", and sometimes meaning \"farther than memory cache distance\".\n * This function will try to mitigate main memory latency through the use of prefetching */\nstatic size_t\nZSTD_decompressSequencesLong(ZSTD_DCtx* dctx,\n                             void* dst, size_t maxDstSize,\n                             const void* seqStart, size_t seqSize, int nbSeq,\n                             const ZSTD_longOffset_e isLongOffset,\n                             const int frame)\n{\n    DEBUGLOG(5, \"ZSTD_decompressSequencesLong\");\n#if DYNAMIC_BMI2\n    if (dctx->bmi2) {\n        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n    }\n#endif\n  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n\n\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n/* ZSTD_getLongOffsetsShare() :\n * condition : offTable must be valid\n * @return : \"share\" of long offsets (arbitrarily defined as > (1<<23))\n *           compared to maximum possible of (1<<OffFSELog) */\nstatic unsigned\nZSTD_getLongOffsetsShare(const ZSTD_seqSymbol* offTable)\n{\n    const void* ptr = offTable;\n    U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog;\n    const ZSTD_seqSymbol* table = offTable + 1;\n    U32 const max = 1 << tableLog;\n    U32 u, total = 0;\n    DEBUGLOG(5, \"ZSTD_getLongOffsetsShare: (tableLog=%u)\", tableLog);\n\n    assert(max <= (1 << OffFSELog));  /* max not too large */\n    for (u=0; u<max; u++) {\n        if (table[u].nbAdditionalBits > 22) total += 1;\n    }\n\n    assert(tableLog <= OffFSELog);\n    total <<= (OffFSELog - tableLog);  /* scale to OffFSELog */\n\n    return total;\n}\n#endif\n\nsize_t\nZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,\n                              void* dst, size_t dstCapacity,\n                        const void* src, size_t srcSize, const int frame)\n{   /* blockType == blockCompressed */\n    const BYTE* ip = (const BYTE*)src;\n    /* isLongOffset must be true if there are long offsets.\n     * Offsets are long if they are larger than 2^STREAM_ACCUMULATOR_MIN.\n     * We don't expect that to be the case in 64-bit mode.\n     * In block mode, window size is not known, so we have to be conservative.\n     * (note: but it could be evaluated from current-lowLimit)\n     */\n    ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || (dctx->fParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN))));\n    DEBUGLOG(5, \"ZSTD_decompressBlock_internal (size : %u)\", (U32)srcSize);\n\n    RETURN_ERROR_IF(srcSize >= ZSTD_BLOCKSIZE_MAX, srcSize_wrong, \"\");\n\n    /* Decode literals section */\n    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize);\n        DEBUGLOG(5, \"ZSTD_decodeLiteralsBlock : %u\", (U32)litCSize);\n        if (ZSTD_isError(litCSize)) return litCSize;\n        ip += litCSize;\n        srcSize -= litCSize;\n    }\n\n    /* Build Decoding Tables */\n    {\n        /* These macros control at build-time which decompressor implementation\n         * we use. If neither is defined, we do some inspection and dispatch at\n         * runtime.\n         */\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n        int usePrefetchDecoder = dctx->ddictIsCold;\n#endif\n        int nbSeq;\n        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);\n        if (ZSTD_isError(seqHSize)) return seqHSize;\n        ip += seqHSize;\n        srcSize -= seqHSize;\n\n        RETURN_ERROR_IF(dst == NULL && nbSeq > 0, dstSize_tooSmall, \"NULL not handled\");\n\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n        if ( !usePrefetchDecoder\n          && (!frame || (dctx->fParams.windowSize > (1<<24)))\n          && (nbSeq>ADVANCED_SEQS) ) {  /* could probably use a larger nbSeq limit */\n            U32 const shareLongOffsets = ZSTD_getLongOffsetsShare(dctx->OFTptr);\n            U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */\n            usePrefetchDecoder = (shareLongOffsets >= minShare);\n        }\n#endif\n\n        dctx->ddictIsCold = 0;\n\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n        if (usePrefetchDecoder)\n#endif\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\n            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame);\n#endif\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\n        /* else */\n        return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame);\n#endif\n    }\n}\n\n\nvoid ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst)\n{\n    if (dst != dctx->previousDstEnd) {   /* not contiguous */\n        dctx->dictEnd = dctx->previousDstEnd;\n        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));\n        dctx->prefixStart = dst;\n        dctx->previousDstEnd = dst;\n    }\n}\n\n\nsize_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity,\n                      const void* src, size_t srcSize)\n{\n    size_t dSize;\n    ZSTD_checkContinuity(dctx, dst);\n    dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 0);\n    dctx->previousDstEnd = (char*)dst + dSize;\n    return dSize;\n}\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n#ifndef ZSTD_DEC_BLOCK_H\n#define ZSTD_DEC_BLOCK_H\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"../common/zstd_deps.h\"   /* size_t */\n#include \"../zstd.h\"    /* DCtx, and some public functions */\n#include \"../common/zstd_internal.h\"  /* blockProperties_t, and some public functions */\n#include \"zstd_decompress_internal.h\"  /* ZSTD_seqSymbol */\n\n\n/* ===   Prototypes   === */\n\n/* note: prototypes already published within `zstd.h` :\n * ZSTD_decompressBlock()\n */\n\n/* note: prototypes already published within `zstd_internal.h` :\n * ZSTD_getcBlockSize()\n * ZSTD_decodeSeqHeaders()\n */\n\n\n/* ZSTD_decompressBlock_internal() :\n * decompress block, starting at `src`,\n * into destination buffer `dst`.\n * @return : decompressed block size,\n *           or an error code (which can be tested using ZSTD_isError())\n */\nsize_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,\n                               void* dst, size_t dstCapacity,\n                         const void* src, size_t srcSize, const int frame);\n\n/* ZSTD_buildFSETable() :\n * generate FSE decoding table for one symbol (ll, ml or off)\n * this function must be called with valid parameters only\n * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.)\n * in which case it cannot fail.\n * The workspace must be 4-byte aligned and at least ZSTD_BUILD_FSE_TABLE_WKSP_SIZE bytes, which is\n * defined in zstd_decompress_internal.h.\n * Internal use only.\n */\nvoid ZSTD_buildFSETable(ZSTD_seqSymbol* dt,\n             const short* normalizedCounter, unsigned maxSymbolValue,\n             const U32* baseValue, const U32* nbAdditionalBits,\n                   unsigned tableLog, void* wksp, size_t wkspSize,\n                   int bmi2);\n\n\n#endif /* ZSTD_DEC_BLOCK_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n/* zstd_decompress_internal:\n * objects and definitions shared within lib/decompress modules */\n\n #ifndef ZSTD_DECOMPRESS_INTERNAL_H\n #define ZSTD_DECOMPRESS_INTERNAL_H\n\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"../common/mem.h\"             /* BYTE, U16, U32 */\n#include \"../common/zstd_internal.h\"   /* ZSTD_seqSymbol */\n\n\n\n/*-*******************************************************\n *  Constants\n *********************************************************/\nstatic UNUSED_ATTR const U32 LL_base[MaxLL+1] = {\n                 0,    1,    2,     3,     4,     5,     6,      7,\n                 8,    9,   10,    11,    12,    13,    14,     15,\n                16,   18,   20,    22,    24,    28,    32,     40,\n                48,   64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,\n                0x2000, 0x4000, 0x8000, 0x10000 };\n\nstatic UNUSED_ATTR const U32 OF_base[MaxOff+1] = {\n                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,\n                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,\n                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,\n                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD };\n\nstatic UNUSED_ATTR const U32 OF_bits[MaxOff+1] = {\n                     0,  1,  2,  3,  4,  5,  6,  7,\n                     8,  9, 10, 11, 12, 13, 14, 15,\n                    16, 17, 18, 19, 20, 21, 22, 23,\n                    24, 25, 26, 27, 28, 29, 30, 31 };\n\nstatic UNUSED_ATTR const U32 ML_base[MaxML+1] = {\n                     3,  4,  5,    6,     7,     8,     9,    10,\n                    11, 12, 13,   14,    15,    16,    17,    18,\n                    19, 20, 21,   22,    23,    24,    25,    26,\n                    27, 28, 29,   30,    31,    32,    33,    34,\n                    35, 37, 39,   41,    43,    47,    51,    59,\n                    67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,\n                    0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };\n\n\n/*-*******************************************************\n *  Decompression types\n *********************************************************/\n typedef struct {\n     U32 fastMode;\n     U32 tableLog;\n } ZSTD_seqSymbol_header;\n\n typedef struct {\n     U16  nextState;\n     BYTE nbAdditionalBits;\n     BYTE nbBits;\n     U32  baseValue;\n } ZSTD_seqSymbol;\n\n #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))\n\n#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64))\n#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32 ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32))\n\ntypedef struct {\n    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];    /* Note : Space reserved for FSE Tables */\n    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];   /* is also used as temporary workspace while building hufTable during DDict creation */\n    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];    /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */\n    HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)];  /* can accommodate HUF_decompress4X */\n    U32 rep[ZSTD_REP_NUM];\n    U32 workspace[ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32];\n} ZSTD_entropyDTables_t;\n\ntypedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader,\n               ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,\n               ZSTDds_decompressLastBlock, ZSTDds_checkChecksum,\n               ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame } ZSTD_dStage;\n\ntypedef enum { zdss_init=0, zdss_loadHeader,\n               zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage;\n\ntypedef enum {\n    ZSTD_use_indefinitely = -1,  /* Use the dictionary indefinitely */\n    ZSTD_dont_use = 0,           /* Do not use the dictionary (if one exists free it) */\n    ZSTD_use_once = 1            /* Use the dictionary once and set to ZSTD_dont_use */\n} ZSTD_dictUses_e;\n\nstruct ZSTD_DCtx_s\n{\n    const ZSTD_seqSymbol* LLTptr;\n    const ZSTD_seqSymbol* MLTptr;\n    const ZSTD_seqSymbol* OFTptr;\n    const HUF_DTable* HUFptr;\n    ZSTD_entropyDTables_t entropy;\n    U32 workspace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];   /* space needed when building huffman tables */\n    const void* previousDstEnd;   /* detect continuity */\n    const void* prefixStart;      /* start of current segment */\n    const void* virtualStart;     /* virtual start of previous segment if it was just before current one */\n    const void* dictEnd;          /* end of previous segment */\n    size_t expected;\n    ZSTD_frameHeader fParams;\n    U64 decodedSize;\n    blockType_e bType;            /* used in ZSTD_decompressContinue(), store blockType between block header decoding and block decompression stages */\n    ZSTD_dStage stage;\n    U32 litEntropy;\n    U32 fseEntropy;\n    XXH64_state_t xxhState;\n    size_t headerSize;\n    ZSTD_format_e format;\n    ZSTD_forceIgnoreChecksum_e forceIgnoreChecksum;   /* User specified: if == 1, will ignore checksums in compressed frame. Default == 0 */\n    U32 validateChecksum;         /* if == 1, will validate checksum. Is == 1 if (fParams.checksumFlag == 1) and (forceIgnoreChecksum == 0). */\n    const BYTE* litPtr;\n    ZSTD_customMem customMem;\n    size_t litSize;\n    size_t rleSize;\n    size_t staticSize;\n    int bmi2;                     /* == 1 if the CPU supports BMI2 and 0 otherwise. CPU support is determined dynamically once per context lifetime. */\n\n    /* dictionary */\n    ZSTD_DDict* ddictLocal;\n    const ZSTD_DDict* ddict;     /* set by ZSTD_initDStream_usingDDict(), or ZSTD_DCtx_refDDict() */\n    U32 dictID;\n    int ddictIsCold;             /* if == 1 : dictionary is \"new\" for working context, and presumed \"cold\" (not in cpu cache) */\n    ZSTD_dictUses_e dictUses;\n\n    /* streaming */\n    ZSTD_dStreamStage streamStage;\n    char*  inBuff;\n    size_t inBuffSize;\n    size_t inPos;\n    size_t maxWindowSize;\n    char*  outBuff;\n    size_t outBuffSize;\n    size_t outStart;\n    size_t outEnd;\n    size_t lhSize;\n    void* legacyContext;\n    U32 previousLegacyVersion;\n    U32 legacyVersion;\n    U32 hostageByte;\n    int noForwardProgress;\n    ZSTD_bufferMode_e outBufferMode;\n    ZSTD_outBuffer expectedOutBuffer;\n\n    /* workspace */\n    BYTE litBuffer[ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH];\n    BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];\n\n    size_t oversizedDuration;\n\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    void const* dictContentBeginForFuzzing;\n    void const* dictContentEndForFuzzing;\n#endif\n};  /* typedef'd to ZSTD_DCtx within \"zstd.h\" */\n\n\n/*-*******************************************************\n *  Shared internal functions\n *********************************************************/\n\n/*! ZSTD_loadDEntropy() :\n *  dict : must point at beginning of a valid zstd dictionary.\n * @return : size of dictionary header (size of magic number + dict ID + entropy tables) */\nsize_t ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,\n                   const void* const dict, size_t const dictSize);\n\n/*! ZSTD_checkContinuity() :\n *  check if next `dst` follows previous position, where decompression ended.\n *  If yes, do nothing (continue on current segment).\n *  If not, classify previous segment as \"external dictionary\", and start a new segment.\n *  This function cannot fail. */\nvoid ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst);\n\n\n#endif /* ZSTD_DECOMPRESS_INTERNAL_H */\n"
  },
  {
    "path": "nuitka/build/inline_copy/zstd/zstd.h",
    "content": "/*\n * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef ZSTD_H_235446\n#define ZSTD_H_235446\n\n/* ======   Dependency   ======*/\n#include <limits.h>   /* INT_MAX */\n#include <stddef.h>   /* size_t */\n\n\n/* =====   ZSTDLIB_API : control library symbols visibility   ===== */\n#ifndef ZSTDLIB_VISIBILITY\n#  if defined(__GNUC__) && (__GNUC__ >= 4)\n#    define ZSTDLIB_VISIBILITY __attribute__ ((visibility (\"default\")))\n#  else\n#    define ZSTDLIB_VISIBILITY\n#  endif\n#endif\n#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)\n#  define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBILITY\n#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)\n#  define ZSTDLIB_API __declspec(dllimport) ZSTDLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define ZSTDLIB_API ZSTDLIB_VISIBILITY\n#endif\n\n\n/*******************************************************************************\n  Introduction\n\n  zstd, short for Zstandard, is a fast lossless compression algorithm, targeting\n  real-time compression scenarios at zlib-level and better compression ratios.\n  The zstd compression library provides in-memory compression and decompression\n  functions.\n\n  The library supports regular compression levels from 1 up to ZSTD_maxCLevel(),\n  which is currently 22. Levels >= 20, labeled `--ultra`, should be used with\n  caution, as they require more memory. The library also offers negative\n  compression levels, which extend the range of speed vs. ratio preferences.\n  The lower the level, the faster the speed (at the cost of compression).\n\n  Compression can be done in:\n    - a single step (described as Simple API)\n    - a single step, reusing a context (described as Explicit context)\n    - unbounded multiple steps (described as Streaming compression)\n\n  The compression ratio achievable on small data can be highly improved using\n  a dictionary. Dictionary compression can be performed in:\n    - a single step (described as Simple dictionary API)\n    - a single step, reusing a dictionary (described as Bulk-processing\n      dictionary API)\n\n  Advanced experimental functions can be accessed using\n  `#define ZSTD_STATIC_LINKING_ONLY` before including zstd.h.\n\n  Advanced experimental APIs should never be used with a dynamically-linked\n  library. They are not \"stable\"; their definitions or signatures may change in\n  the future. Only static linking is allowed.\n*******************************************************************************/\n\n/*------   Version   ------*/\n#define ZSTD_VERSION_MAJOR    1\n#define ZSTD_VERSION_MINOR    4\n#define ZSTD_VERSION_RELEASE  7\n#define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)\n\n/*! ZSTD_versionNumber() :\n *  Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE). */\nZSTDLIB_API unsigned ZSTD_versionNumber(void);\n\n#define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE\n#define ZSTD_QUOTE(str) #str\n#define ZSTD_EXPAND_AND_QUOTE(str) ZSTD_QUOTE(str)\n#define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION)\n\n/*! ZSTD_versionString() :\n *  Return runtime library version, like \"1.4.5\". Requires v1.3.0+. */\nZSTDLIB_API const char* ZSTD_versionString(void);\n\n/* *************************************\n *  Default constant\n ***************************************/\n#ifndef ZSTD_CLEVEL_DEFAULT\n#  define ZSTD_CLEVEL_DEFAULT 3\n#endif\n\n/* *************************************\n *  Constants\n ***************************************/\n\n/* All magic numbers are supposed read/written to/from files/memory using little-endian convention */\n#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */\n#define ZSTD_MAGIC_DICTIONARY       0xEC30A437    /* valid since v0.7.0 */\n#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */\n#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0\n\n#define ZSTD_BLOCKSIZELOG_MAX  17\n#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)\n\n\n\n/***************************************\n*  Simple API\n***************************************/\n/*! ZSTD_compress() :\n *  Compresses `src` content as a single zstd compressed frame into already allocated `dst`.\n *  Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`.\n *  @return : compressed size written into `dst` (<= `dstCapacity),\n *            or an error code if it fails (which can be tested using ZSTD_isError()). */\nZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,\n                            const void* src, size_t srcSize,\n                                  int compressionLevel);\n\n/*! ZSTD_decompress() :\n *  `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames.\n *  `dstCapacity` is an upper bound of originalSize to regenerate.\n *  If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data.\n *  @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),\n *            or an errorCode if it fails (which can be tested using ZSTD_isError()). */\nZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,\n                              const void* src, size_t compressedSize);\n\n/*! ZSTD_getFrameContentSize() : requires v1.3.0+\n *  `src` should point to the start of a ZSTD encoded frame.\n *  `srcSize` must be at least as large as the frame header.\n *            hint : any size >= `ZSTD_frameHeaderSize_max` is large enough.\n *  @return : - decompressed size of `src` frame content, if known\n *            - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined\n *            - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)\n *   note 1 : a 0 return value means the frame is valid but \"empty\".\n *   note 2 : decompressed size is an optional field, it may not be present, typically in streaming mode.\n *            When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *            Optionally, application can rely on some implicit limit,\n *            as ZSTD_decompress() only needs an upper bound of decompressed size.\n *            (For example, data could be necessarily cut into blocks <= 16 KB).\n *   note 3 : decompressed size is always present when compression is completed using single-pass functions,\n *            such as ZSTD_compress(), ZSTD_compressCCtx() ZSTD_compress_usingDict() or ZSTD_compress_usingCDict().\n *   note 4 : decompressed size can be very large (64-bits value),\n *            potentially larger than what local system can handle as a single memory segment.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *   note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified.\n *            Always ensure return value fits within application's authorized limits.\n *            Each application can set its own limits.\n *   note 6 : This function replaces ZSTD_getDecompressedSize() */\n#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)\n#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)\nZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);\n\n/*! ZSTD_getDecompressedSize() :\n *  NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().\n *  Both functions work the same way, but ZSTD_getDecompressedSize() blends\n *  \"empty\", \"unknown\" and \"error\" results to the same return value (0),\n *  while ZSTD_getFrameContentSize() gives them separate return values.\n * @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. */\nZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);\n\n/*! ZSTD_findFrameCompressedSize() :\n * `src` should point to the start of a ZSTD frame or skippable frame.\n * `srcSize` must be >= first frame size\n * @return : the compressed size of the first frame starting at `src`,\n *           suitable to pass as `srcSize` to `ZSTD_decompress` or similar,\n *        or an error code if input is invalid */\nZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);\n\n\n/*======  Helper functions  ======*/\n#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */\nZSTDLIB_API size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case single-pass scenario */\nZSTDLIB_API unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */\nZSTDLIB_API const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */\nZSTDLIB_API int         ZSTD_minCLevel(void);               /*!< minimum negative compression level allowed */\nZSTDLIB_API int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */\n\n\n/***************************************\n*  Explicit context\n***************************************/\n/*= Compression context\n *  When compressing many times,\n *  it is recommended to allocate a context just once,\n *  and re-use it for each successive compression operation.\n *  This will make workload friendlier for system's memory.\n *  Note : re-using context is just a speed / resource optimization.\n *         It doesn't change the compression ratio, which remains identical.\n *  Note 2 : In multi-threaded environments,\n *         use one different context per thread for parallel execution.\n */\ntypedef struct ZSTD_CCtx_s ZSTD_CCtx;\nZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void);\nZSTDLIB_API size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);\n\n/*! ZSTD_compressCCtx() :\n *  Same as ZSTD_compress(), using an explicit ZSTD_CCtx.\n *  Important : in order to behave similarly to `ZSTD_compress()`,\n *  this function compresses at requested compression level,\n *  __ignoring any other parameter__ .\n *  If any advanced parameter was set using the advanced API,\n *  they will all be reset. Only `compressionLevel` remains.\n */\nZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx,\n                                     void* dst, size_t dstCapacity,\n                               const void* src, size_t srcSize,\n                                     int compressionLevel);\n\n/*= Decompression context\n *  When decompressing many times,\n *  it is recommended to allocate a context only once,\n *  and re-use it for each successive compression operation.\n *  This will make workload friendlier for system's memory.\n *  Use one context per thread for parallel execution. */\ntypedef struct ZSTD_DCtx_s ZSTD_DCtx;\nZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);\nZSTDLIB_API size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);\n\n/*! ZSTD_decompressDCtx() :\n *  Same as ZSTD_decompress(),\n *  requires an allocated ZSTD_DCtx.\n *  Compatible with sticky parameters.\n */\nZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx,\n                                       void* dst, size_t dstCapacity,\n                                 const void* src, size_t srcSize);\n\n\n/***************************************\n*  Advanced compression API\n***************************************/\n\n/* API design :\n *   Parameters are pushed one by one into an existing context,\n *   using ZSTD_CCtx_set*() functions.\n *   Pushed parameters are sticky : they are valid for next compressed frame, and any subsequent frame.\n *   \"sticky\" parameters are applicable to `ZSTD_compress2()` and `ZSTD_compressStream*()` !\n *   __They do not apply to \"simple\" one-shot variants such as ZSTD_compressCCtx()__ .\n *\n *   It's possible to reset all parameters to \"default\" using ZSTD_CCtx_reset().\n *\n *   This API supercedes all other \"advanced\" API entry points in the experimental section.\n *   In the future, we expect to remove from experimental API entry points which are redundant with this API.\n */\n\n\n/* Compression strategies, listed from fastest to strongest */\ntypedef enum { ZSTD_fast=1,\n               ZSTD_dfast=2,\n               ZSTD_greedy=3,\n               ZSTD_lazy=4,\n               ZSTD_lazy2=5,\n               ZSTD_btlazy2=6,\n               ZSTD_btopt=7,\n               ZSTD_btultra=8,\n               ZSTD_btultra2=9\n               /* note : new strategies _might_ be added in the future.\n                         Only the order (from fast to strong) is guaranteed */\n} ZSTD_strategy;\n\n\ntypedef enum {\n\n    /* compression parameters\n     * Note: When compressing with a ZSTD_CDict these parameters are superseded\n     * by the parameters used to construct the ZSTD_CDict.\n     * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */\n    ZSTD_c_compressionLevel=100, /* Set compression parameters according to pre-defined cLevel table.\n                              * Note that exact compression parameters are dynamically determined,\n                              * depending on both compression level and srcSize (when known).\n                              * Default level is ZSTD_CLEVEL_DEFAULT==3.\n                              * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT.\n                              * Note 1 : it's possible to pass a negative compression level.\n                              * Note 2 : setting a level does not automatically set all other compression parameters\n                              *   to default. Setting this will however eventually dynamically impact the compression\n                              *   parameters which have not been manually set. The manually set\n                              *   ones will 'stick'. */\n    /* Advanced compression parameters :\n     * It's possible to pin down compression parameters to some specific values.\n     * In which case, these values are no longer dynamically selected by the compressor */\n    ZSTD_c_windowLog=101,    /* Maximum allowed back-reference distance, expressed as power of 2.\n                              * This will set a memory budget for streaming decompression,\n                              * with larger values requiring more memory\n                              * and typically compressing more.\n                              * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.\n                              * Special: value 0 means \"use default windowLog\".\n                              * Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT\n                              *       requires explicitly allowing such size at streaming decompression stage. */\n    ZSTD_c_hashLog=102,      /* Size of the initial probe table, as a power of 2.\n                              * Resulting memory usage is (1 << (hashLog+2)).\n                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.\n                              * Larger tables improve compression ratio of strategies <= dFast,\n                              * and improve speed of strategies > dFast.\n                              * Special: value 0 means \"use default hashLog\". */\n    ZSTD_c_chainLog=103,     /* Size of the multi-probe search table, as a power of 2.\n                              * Resulting memory usage is (1 << (chainLog+2)).\n                              * Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX.\n                              * Larger tables result in better and slower compression.\n                              * This parameter is useless for \"fast\" strategy.\n                              * It's still useful when using \"dfast\" strategy,\n                              * in which case it defines a secondary probe table.\n                              * Special: value 0 means \"use default chainLog\". */\n    ZSTD_c_searchLog=104,    /* Number of search attempts, as a power of 2.\n                              * More attempts result in better and slower compression.\n                              * This parameter is useless for \"fast\" and \"dFast\" strategies.\n                              * Special: value 0 means \"use default searchLog\". */\n    ZSTD_c_minMatch=105,     /* Minimum size of searched matches.\n                              * Note that Zstandard can still find matches of smaller size,\n                              * it just tweaks its search algorithm to look for this size and larger.\n                              * Larger values increase compression and decompression speed, but decrease ratio.\n                              * Must be clamped between ZSTD_MINMATCH_MIN and ZSTD_MINMATCH_MAX.\n                              * Note that currently, for all strategies < btopt, effective minimum is 4.\n                              *                    , for all strategies > fast, effective maximum is 6.\n                              * Special: value 0 means \"use default minMatchLength\". */\n    ZSTD_c_targetLength=106, /* Impact of this field depends on strategy.\n                              * For strategies btopt, btultra & btultra2:\n                              *     Length of Match considered \"good enough\" to stop search.\n                              *     Larger values make compression stronger, and slower.\n                              * For strategy fast:\n                              *     Distance between match sampling.\n                              *     Larger values make compression faster, and weaker.\n                              * Special: value 0 means \"use default targetLength\". */\n    ZSTD_c_strategy=107,     /* See ZSTD_strategy enum definition.\n                              * The higher the value of selected strategy, the more complex it is,\n                              * resulting in stronger and slower compression.\n                              * Special: value 0 means \"use default strategy\". */\n\n    /* LDM mode parameters */\n    ZSTD_c_enableLongDistanceMatching=160, /* Enable long distance matching.\n                                     * This parameter is designed to improve compression ratio\n                                     * for large inputs, by finding large matches at long distance.\n                                     * It increases memory usage and window size.\n                                     * Note: enabling this parameter increases default ZSTD_c_windowLog to 128 MB\n                                     * except when expressly set to a different value.\n                                     * Note: will be enabled by default if ZSTD_c_windowLog >= 128 MB and\n                                     * compression strategy >= ZSTD_btopt (== compression level 16+) */\n    ZSTD_c_ldmHashLog=161,   /* Size of the table for long distance matching, as a power of 2.\n                              * Larger values increase memory usage and compression ratio,\n                              * but decrease compression speed.\n                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX\n                              * default: windowlog - 7.\n                              * Special: value 0 means \"automatically determine hashlog\". */\n    ZSTD_c_ldmMinMatch=162,  /* Minimum match size for long distance matcher.\n                              * Larger/too small values usually decrease compression ratio.\n                              * Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.\n                              * Special: value 0 means \"use default value\" (default: 64). */\n    ZSTD_c_ldmBucketSizeLog=163, /* Log size of each bucket in the LDM hash table for collision resolution.\n                              * Larger values improve collision resolution but decrease compression speed.\n                              * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.\n                              * Special: value 0 means \"use default value\" (default: 3). */\n    ZSTD_c_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table.\n                              * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).\n                              * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.\n                              * Larger values improve compression speed.\n                              * Deviating far from default value will likely result in a compression ratio decrease.\n                              * Special: value 0 means \"automatically determine hashRateLog\". */\n\n    /* frame parameters */\n    ZSTD_c_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)\n                              * Content size must be known at the beginning of compression.\n                              * This is automatically the case when using ZSTD_compress2(),\n                              * For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */\n    ZSTD_c_checksumFlag=201, /* A 32-bits checksum of content is written at end of frame (default:0) */\n    ZSTD_c_dictIDFlag=202,   /* When applicable, dictionary's ID is written into frame header (default:1) */\n\n    /* multi-threading parameters */\n    /* These parameters are only active if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD).\n     * Otherwise, trying to set any other value than default (0) will be a no-op and return an error.\n     * In a situation where it's unknown if the linked library supports multi-threading or not,\n     * setting ZSTD_c_nbWorkers to any value >= 1 and consulting the return value provides a quick way to check this property.\n     */\n    ZSTD_c_nbWorkers=400,    /* Select how many threads will be spawned to compress in parallel.\n                              * When nbWorkers >= 1, triggers asynchronous mode when invoking ZSTD_compressStream*() :\n                              * ZSTD_compressStream*() consumes input and flush output if possible, but immediately gives back control to caller,\n                              * while compression is performed in parallel, within worker thread(s).\n                              * (note : a strong exception to this rule is when first invocation of ZSTD_compressStream2() sets ZSTD_e_end :\n                              *  in which case, ZSTD_compressStream2() delegates to ZSTD_compress2(), which is always a blocking call).\n                              * More workers improve speed, but also increase memory usage.\n                              * Default value is `0`, aka \"single-threaded mode\" : no worker is spawned,\n                              * compression is performed inside Caller's thread, and all invocations are blocking */\n    ZSTD_c_jobSize=401,      /* Size of a compression job. This value is enforced only when nbWorkers >= 1.\n                              * Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.\n                              * 0 means default, which is dynamically determined based on compression parameters.\n                              * Job size must be a minimum of overlap size, or 1 MB, whichever is largest.\n                              * The minimum size is automatically and transparently enforced. */\n    ZSTD_c_overlapLog=402,   /* Control the overlap size, as a fraction of window size.\n                              * The overlap size is an amount of data reloaded from previous job at the beginning of a new job.\n                              * It helps preserve compression ratio, while each job is compressed in parallel.\n                              * This value is enforced only when nbWorkers >= 1.\n                              * Larger values increase compression ratio, but decrease speed.\n                              * Possible values range from 0 to 9 :\n                              * - 0 means \"default\" : value will be determined by the library, depending on strategy\n                              * - 1 means \"no overlap\"\n                              * - 9 means \"full overlap\", using a full window size.\n                              * Each intermediate rank increases/decreases load size by a factor 2 :\n                              * 9: full window;  8: w/2;  7: w/4;  6: w/8;  5:w/16;  4: w/32;  3:w/64;  2:w/128;  1:no overlap;  0:default\n                              * default value varies between 6 and 9, depending on strategy */\n\n    /* note : additional experimental parameters are also available\n     * within the experimental section of the API.\n     * At the time of this writing, they include :\n     * ZSTD_c_rsyncable\n     * ZSTD_c_format\n     * ZSTD_c_forceMaxWindow\n     * ZSTD_c_forceAttachDict\n     * ZSTD_c_literalCompressionMode\n     * ZSTD_c_targetCBlockSize\n     * ZSTD_c_srcSizeHint\n     * ZSTD_c_enableDedicatedDictSearch\n     * ZSTD_c_stableInBuffer\n     * ZSTD_c_stableOutBuffer\n     * ZSTD_c_blockDelimiters\n     * ZSTD_c_validateSequences\n     * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.\n     * note : never ever use experimentalParam? names directly;\n     *        also, the enums values themselves are unstable and can still change.\n     */\n     ZSTD_c_experimentalParam1=500,\n     ZSTD_c_experimentalParam2=10,\n     ZSTD_c_experimentalParam3=1000,\n     ZSTD_c_experimentalParam4=1001,\n     ZSTD_c_experimentalParam5=1002,\n     ZSTD_c_experimentalParam6=1003,\n     ZSTD_c_experimentalParam7=1004,\n     ZSTD_c_experimentalParam8=1005,\n     ZSTD_c_experimentalParam9=1006,\n     ZSTD_c_experimentalParam10=1007,\n     ZSTD_c_experimentalParam11=1008,\n     ZSTD_c_experimentalParam12=1009\n} ZSTD_cParameter;\n\ntypedef struct {\n    size_t error;\n    int lowerBound;\n    int upperBound;\n} ZSTD_bounds;\n\n/*! ZSTD_cParam_getBounds() :\n *  All parameters must belong to an interval with lower and upper bounds,\n *  otherwise they will either trigger an error or be automatically clamped.\n * @return : a structure, ZSTD_bounds, which contains\n *         - an error status field, which must be tested using ZSTD_isError()\n *         - lower and upper bounds, both inclusive\n */\nZSTDLIB_API ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam);\n\n/*! ZSTD_CCtx_setParameter() :\n *  Set one compression parameter, selected by enum ZSTD_cParameter.\n *  All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds().\n *  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n *  Setting a parameter is generally only possible during frame initialization (before starting compression).\n *  Exception : when using multi-threading mode (nbWorkers >= 1),\n *              the following parameters can be updated _during_ compression (within same frame):\n *              => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy.\n *              new parameters will be active for next job only (after a flush()).\n * @return : an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value);\n\n/*! ZSTD_CCtx_setPledgedSrcSize() :\n *  Total input data size to be compressed as a single frame.\n *  Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag.\n *  This value will also be controlled at end of frame, and trigger an error if not respected.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame.\n *           In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN.\n *           ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame.\n *  Note 2 : pledgedSrcSize is only valid once, for the next frame.\n *           It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN.\n *  Note 3 : Whenever all input data is provided and consumed in a single round,\n *           for example with ZSTD_compress2(),\n *           or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),\n *           this value is automatically overridden by srcSize instead.\n */\nZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);\n\ntypedef enum {\n    ZSTD_reset_session_only = 1,\n    ZSTD_reset_parameters = 2,\n    ZSTD_reset_session_and_parameters = 3\n} ZSTD_ResetDirective;\n\n/*! ZSTD_CCtx_reset() :\n *  There are 2 different things that can be reset, independently or jointly :\n *  - The session : will stop compressing current frame, and make CCtx ready to start a new one.\n *                  Useful after an error, or to interrupt any ongoing compression.\n *                  Any internal data not yet flushed is cancelled.\n *                  Compression parameters and dictionary remain unchanged.\n *                  They will be used to compress next frame.\n *                  Resetting session never fails.\n *  - The parameters : changes all parameters back to \"default\".\n *                  This removes any reference to any dictionary too.\n *                  Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)\n *                  otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())\n *  - Both : similar to resetting the session, followed by resetting parameters.\n */\nZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);\n\n/*! ZSTD_compress2() :\n *  Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API.\n *  ZSTD_compress2() always starts a new frame.\n *  Should cctx hold data from a previously unfinished frame, everything about it is forgotten.\n *  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n *  - The function is always blocking, returns when compression is completed.\n *  Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`.\n * @return : compressed size written into `dst` (<= `dstCapacity),\n *           or an error code if it fails (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_compress2( ZSTD_CCtx* cctx,\n                                   void* dst, size_t dstCapacity,\n                             const void* src, size_t srcSize);\n\n\n/***************************************\n*  Advanced decompression API\n***************************************/\n\n/* The advanced API pushes parameters one by one into an existing DCtx context.\n * Parameters are sticky, and remain valid for all following frames\n * using the same DCtx context.\n * It's possible to reset parameters to default values using ZSTD_DCtx_reset().\n * Note : This API is compatible with existing ZSTD_decompressDCtx() and ZSTD_decompressStream().\n *        Therefore, no new decompression function is necessary.\n */\n\ntypedef enum {\n\n    ZSTD_d_windowLogMax=100, /* Select a size limit (in power of 2) beyond which\n                              * the streaming API will refuse to allocate memory buffer\n                              * in order to protect the host from unreasonable memory requirements.\n                              * This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.\n                              * By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).\n                              * Special: value 0 means \"use default maximum windowLog\". */\n\n    /* note : additional experimental parameters are also available\n     * within the experimental section of the API.\n     * At the time of this writing, they include :\n     * ZSTD_d_format\n     * ZSTD_d_stableOutBuffer\n     * ZSTD_d_forceIgnoreChecksum\n     * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.\n     * note : never ever use experimentalParam? names directly\n     */\n     ZSTD_d_experimentalParam1=1000,\n     ZSTD_d_experimentalParam2=1001,\n     ZSTD_d_experimentalParam3=1002\n\n} ZSTD_dParameter;\n\n/*! ZSTD_dParam_getBounds() :\n *  All parameters must belong to an interval with lower and upper bounds,\n *  otherwise they will either trigger an error or be automatically clamped.\n * @return : a structure, ZSTD_bounds, which contains\n *         - an error status field, which must be tested using ZSTD_isError()\n *         - both lower and upper bounds, inclusive\n */\nZSTDLIB_API ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam);\n\n/*! ZSTD_DCtx_setParameter() :\n *  Set one compression parameter, selected by enum ZSTD_dParameter.\n *  All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds().\n *  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n *  Setting a parameter is only possible during frame initialization (before starting decompression).\n * @return : 0, or an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int value);\n\n/*! ZSTD_DCtx_reset() :\n *  Return a DCtx to clean state.\n *  Session and parameters can be reset jointly or separately.\n *  Parameters can only be reset when no active frame is being decompressed.\n * @return : 0, or an error code, which can be tested with ZSTD_isError()\n */\nZSTDLIB_API size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset);\n\n\n/****************************\n*  Streaming\n****************************/\n\ntypedef struct ZSTD_inBuffer_s {\n  const void* src;    /**< start of input buffer */\n  size_t size;        /**< size of input buffer */\n  size_t pos;         /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */\n} ZSTD_inBuffer;\n\ntypedef struct ZSTD_outBuffer_s {\n  void*  dst;         /**< start of output buffer */\n  size_t size;        /**< size of output buffer */\n  size_t pos;         /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */\n} ZSTD_outBuffer;\n\n\n\n/*-***********************************************************************\n*  Streaming compression - HowTo\n*\n*  A ZSTD_CStream object is required to track streaming operation.\n*  Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.\n*  ZSTD_CStream objects can be reused multiple times on consecutive compression operations.\n*  It is recommended to re-use ZSTD_CStream since it will play nicer with system's memory, by re-using already allocated memory.\n*\n*  For parallel execution, use one separate ZSTD_CStream per thread.\n*\n*  note : since v1.3.0, ZSTD_CStream and ZSTD_CCtx are the same thing.\n*\n*  Parameters are sticky : when starting a new compression on the same context,\n*  it will re-use the same sticky parameters as previous compression session.\n*  When in doubt, it's recommended to fully initialize the context before usage.\n*  Use ZSTD_CCtx_reset() to reset the context and ZSTD_CCtx_setParameter(),\n*  ZSTD_CCtx_setPledgedSrcSize(), or ZSTD_CCtx_loadDictionary() and friends to\n*  set more specific parameters, the pledged source size, or load a dictionary.\n*\n*  Use ZSTD_compressStream2() with ZSTD_e_continue as many times as necessary to\n*  consume input stream. The function will automatically update both `pos`\n*  fields within `input` and `output`.\n*  Note that the function may not consume the entire input, for example, because\n*  the output buffer is already full, in which case `input.pos < input.size`.\n*  The caller must check if input has been entirely consumed.\n*  If not, the caller must make some room to receive more compressed data,\n*  and then present again remaining input data.\n*  note: ZSTD_e_continue is guaranteed to make some forward progress when called,\n*        but doesn't guarantee maximal forward progress. This is especially relevant\n*        when compressing with multiple threads. The call won't block if it can\n*        consume some input, but if it can't it will wait for some, but not all,\n*        output to be flushed.\n* @return : provides a minimum amount of data remaining to be flushed from internal buffers\n*           or an error code, which can be tested using ZSTD_isError().\n*\n*  At any moment, it's possible to flush whatever data might remain stuck within internal buffer,\n*  using ZSTD_compressStream2() with ZSTD_e_flush. `output->pos` will be updated.\n*  Note that, if `output->size` is too small, a single invocation with ZSTD_e_flush might not be enough (return code > 0).\n*  In which case, make some room to receive more compressed data, and call again ZSTD_compressStream2() with ZSTD_e_flush.\n*  You must continue calling ZSTD_compressStream2() with ZSTD_e_flush until it returns 0, at which point you can change the\n*  operation.\n*  note: ZSTD_e_flush will flush as much output as possible, meaning when compressing with multiple threads, it will\n*        block until the flush is complete or the output buffer is full.\n*  @return : 0 if internal buffers are entirely flushed,\n*            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),\n*            or an error code, which can be tested using ZSTD_isError().\n*\n*  Calling ZSTD_compressStream2() with ZSTD_e_end instructs to finish a frame.\n*  It will perform a flush and write frame epilogue.\n*  The epilogue is required for decoders to consider a frame completed.\n*  flush operation is the same, and follows same rules as calling ZSTD_compressStream2() with ZSTD_e_flush.\n*  You must continue calling ZSTD_compressStream2() with ZSTD_e_end until it returns 0, at which point you are free to\n*  start a new frame.\n*  note: ZSTD_e_end will flush as much output as possible, meaning when compressing with multiple threads, it will\n*        block until the flush is complete or the output buffer is full.\n*  @return : 0 if frame fully completed and fully flushed,\n*            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),\n*            or an error code, which can be tested using ZSTD_isError().\n*\n* *******************************************************************/\n\ntypedef ZSTD_CCtx ZSTD_CStream;  /**< CCtx and CStream are now effectively same object (>= v1.3.0) */\n                                 /* Continue to distinguish them for compatibility with older versions <= v1.2.0 */\n/*===== ZSTD_CStream management functions =====*/\nZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void);\nZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs);\n\n/*===== Streaming compression functions =====*/\ntypedef enum {\n    ZSTD_e_continue=0, /* collect more data, encoder decides when to output compressed result, for optimal compression ratio */\n    ZSTD_e_flush=1,    /* flush any data provided so far,\n                        * it creates (at least) one new block, that can be decoded immediately on reception;\n                        * frame will continue: any future data can still reference previously compressed data, improving compression.\n                        * note : multithreaded compression will block to flush as much output as possible. */\n    ZSTD_e_end=2       /* flush any remaining data _and_ close current frame.\n                        * note that frame is only closed after compressed data is fully flushed (return value == 0).\n                        * After that point, any additional data starts a new frame.\n                        * note : each frame is independent (does not reference any content from previous frame).\n                        : note : multithreaded compression will block to flush as much output as possible. */\n} ZSTD_EndDirective;\n\n/*! ZSTD_compressStream2() :\n *  Behaves about the same as ZSTD_compressStream, with additional control on end directive.\n *  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n *  - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)\n *  - output->pos must be <= dstCapacity, input->pos must be <= srcSize\n *  - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.\n *  - endOp must be a valid directive\n *  - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.\n *  - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,\n *                                                  and then immediately returns, just indicating that there is some data remaining to be flushed.\n *                                                  The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.\n *  - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.\n *  - @return provides a minimum amount of data remaining to be flushed from internal buffers\n *            or an error code, which can be tested using ZSTD_isError().\n *            if @return != 0, flush is not fully completed, there is still some data left within internal buffers.\n *            This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.\n *            For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.\n *  - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),\n *            only ZSTD_e_end or ZSTD_e_flush operations are allowed.\n *            Before starting a new compression job, or changing compression parameters,\n *            it is required to fully flush internal buffers.\n */\nZSTDLIB_API size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,\n                                         ZSTD_outBuffer* output,\n                                         ZSTD_inBuffer* input,\n                                         ZSTD_EndDirective endOp);\n\n\n/* These buffer sizes are softly recommended.\n * They are not required : ZSTD_compressStream*() happily accepts any buffer size, for both input and output.\n * Respecting the recommended size just makes it a bit easier for ZSTD_compressStream*(),\n * reducing the amount of memory shuffling and buffering, resulting in minor performance savings.\n *\n * However, note that these recommendations are from the perspective of a C caller program.\n * If the streaming interface is invoked from some other language,\n * especially managed ones such as Java or Go, through a foreign function interface such as jni or cgo,\n * a major performance rule is to reduce crossing such interface to an absolute minimum.\n * It's not rare that performance ends being spent more into the interface, rather than compression itself.\n * In which cases, prefer using large buffers, as large as practical,\n * for both input and output, to reduce the nb of roundtrips.\n */\nZSTDLIB_API size_t ZSTD_CStreamInSize(void);    /**< recommended size for input buffer */\nZSTDLIB_API size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */\n\n\n/* *****************************************************************************\n * This following is a legacy streaming API.\n * It can be replaced by ZSTD_CCtx_reset() and ZSTD_compressStream2().\n * It is redundant, but remains fully supported.\n * Advanced parameters and dictionary compression can only be used through the\n * new API.\n ******************************************************************************/\n\n/*!\n * Equivalent to:\n *\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n */\nZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);\n/*!\n * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).\n * NOTE: The return value is different. ZSTD_compressStream() returns a hint for\n * the next read size (if non-zero and not an error). ZSTD_compressStream2()\n * returns the minimum nb of bytes left to flush (if non-zero and not an error).\n */\nZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);\n/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */\nZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);\n/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */\nZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);\n\n\n/*-***************************************************************************\n*  Streaming decompression - HowTo\n*\n*  A ZSTD_DStream object is required to track streaming operations.\n*  Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.\n*  ZSTD_DStream objects can be re-used multiple times.\n*\n*  Use ZSTD_initDStream() to start a new decompression operation.\n* @return : recommended first input size\n*  Alternatively, use advanced API to set specific properties.\n*\n*  Use ZSTD_decompressStream() repetitively to consume your input.\n*  The function will update both `pos` fields.\n*  If `input.pos < input.size`, some input has not been consumed.\n*  It's up to the caller to present again remaining data.\n*  The function tries to flush all data decoded immediately, respecting output buffer size.\n*  If `output.pos < output.size`, decoder has flushed everything it could.\n*  But if `output.pos == output.size`, there might be some data left within internal buffers.,\n*  In which case, call ZSTD_decompressStream() again to flush whatever remains in the buffer.\n*  Note : with no additional input provided, amount of data flushed is necessarily <= ZSTD_BLOCKSIZE_MAX.\n* @return : 0 when a frame is completely decoded and fully flushed,\n*        or an error code, which can be tested using ZSTD_isError(),\n*        or any other value > 0, which means there is still some decoding or flushing to do to complete current frame :\n*                                the return value is a suggested next input size (just a hint for better latency)\n*                                that will never request more than the remaining frame size.\n* *******************************************************************************/\n\ntypedef ZSTD_DCtx ZSTD_DStream;  /**< DCtx and DStream are now effectively same object (>= v1.3.0) */\n                                 /* For compatibility with versions <= v1.2.0, prefer differentiating them. */\n/*===== ZSTD_DStream management functions =====*/\nZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void);\nZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);\n\n/*===== Streaming decompression functions =====*/\n\n/* This function is redundant with the advanced API and equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_refDDict(zds, NULL);\n */\nZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);\n\nZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);\n\nZSTDLIB_API size_t ZSTD_DStreamInSize(void);    /*!< recommended size for input buffer */\nZSTDLIB_API size_t ZSTD_DStreamOutSize(void);   /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */\n\n\n/**************************\n*  Simple dictionary API\n***************************/\n/*! ZSTD_compress_usingDict() :\n *  Compression at an explicit compression level using a Dictionary.\n *  A dictionary can be any arbitrary data segment (also called a prefix),\n *  or a buffer with specified information (see dictBuilder/zdict.h).\n *  Note : This function loads the dictionary, resulting in significant startup delay.\n *         It's intended for a dictionary used only once.\n *  Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used. */\nZSTDLIB_API size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,\n                                           void* dst, size_t dstCapacity,\n                                     const void* src, size_t srcSize,\n                                     const void* dict,size_t dictSize,\n                                           int compressionLevel);\n\n/*! ZSTD_decompress_usingDict() :\n *  Decompression using a known Dictionary.\n *  Dictionary must be identical to the one used during compression.\n *  Note : This function loads the dictionary, resulting in significant startup delay.\n *         It's intended for a dictionary used only once.\n *  Note : When `dict == NULL || dictSize < 8` no dictionary is used. */\nZSTDLIB_API size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,\n                                             void* dst, size_t dstCapacity,\n                                       const void* src, size_t srcSize,\n                                       const void* dict,size_t dictSize);\n\n\n/***********************************\n *  Bulk processing dictionary API\n **********************************/\ntypedef struct ZSTD_CDict_s ZSTD_CDict;\n\n/*! ZSTD_createCDict() :\n *  When compressing multiple messages or blocks using the same dictionary,\n *  it's recommended to digest the dictionary only once, since it's a costly operation.\n *  ZSTD_createCDict() will create a state from digesting a dictionary.\n *  The resulting state can be used for future compression operations with very limited startup cost.\n *  ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.\n * @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict.\n *  Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content.\n *  Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,\n *      in which case the only thing that it transports is the @compressionLevel.\n *      This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,\n *      expecting a ZSTD_CDict parameter with any data, including those without a known dictionary. */\nZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,\n                                         int compressionLevel);\n\n/*! ZSTD_freeCDict() :\n *  Function frees memory allocated by ZSTD_createCDict(). */\nZSTDLIB_API size_t      ZSTD_freeCDict(ZSTD_CDict* CDict);\n\n/*! ZSTD_compress_usingCDict() :\n *  Compression using a digested Dictionary.\n *  Recommended when same dictionary is used multiple times.\n *  Note : compression level is _decided at dictionary creation time_,\n *     and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no) */\nZSTDLIB_API size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,\n                                            void* dst, size_t dstCapacity,\n                                      const void* src, size_t srcSize,\n                                      const ZSTD_CDict* cdict);\n\n\ntypedef struct ZSTD_DDict_s ZSTD_DDict;\n\n/*! ZSTD_createDDict() :\n *  Create a digested dictionary, ready to start decompression operation without startup delay.\n *  dictBuffer can be released after DDict creation, as its content is copied inside DDict. */\nZSTDLIB_API ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);\n\n/*! ZSTD_freeDDict() :\n *  Function frees memory allocated with ZSTD_createDDict() */\nZSTDLIB_API size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);\n\n/*! ZSTD_decompress_usingDDict() :\n *  Decompression using a digested Dictionary.\n *  Recommended when same dictionary is used multiple times. */\nZSTDLIB_API size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,\n                                              void* dst, size_t dstCapacity,\n                                        const void* src, size_t srcSize,\n                                        const ZSTD_DDict* ddict);\n\n\n/********************************\n *  Dictionary helper functions\n *******************************/\n\n/*! ZSTD_getDictID_fromDict() :\n *  Provides the dictID stored within dictionary.\n *  if @return == 0, the dictionary is not conformant with Zstandard specification.\n *  It can still be loaded, but as a content-only dictionary. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);\n\n/*! ZSTD_getDictID_fromDDict() :\n *  Provides the dictID of the dictionary loaded into `ddict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);\n\n/*! ZSTD_getDictID_fromFrame() :\n *  Provides the dictID required to decompressed the frame stored within `src`.\n *  If @return == 0, the dictID could not be decoded.\n *  This could for one of the following reasons :\n *  - The frame does not require a dictionary to be decoded (most common case).\n *  - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information.\n *    Note : this use case also happens when using a non-conformant dictionary.\n *  - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).\n *  - This is not a Zstandard frame.\n *  When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);\n\n\n/*******************************************************************************\n * Advanced dictionary and prefix API\n *\n * This API allows dictionaries to be used with ZSTD_compress2(),\n * ZSTD_compressStream2(), and ZSTD_decompress(). Dictionaries are sticky, and\n * only reset with the context is reset with ZSTD_reset_parameters or\n * ZSTD_reset_session_and_parameters. Prefixes are single-use.\n ******************************************************************************/\n\n\n/*! ZSTD_CCtx_loadDictionary() :\n *  Create an internal CDict from `dict` buffer.\n *  Decompression will have to use same dictionary.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,\n *           meaning \"return to no-dictionary mode\".\n *  Note 1 : Dictionary is sticky, it will be used for all future compressed frames.\n *           To return to \"no-dictionary\" situation, load a NULL dictionary (or reset parameters).\n *  Note 2 : Loading a dictionary involves building tables.\n *           It's also a CPU consuming operation, with non-negligible impact on latency.\n *           Tables are dependent on compression parameters, and for this reason,\n *           compression parameters can no longer be changed after loading a dictionary.\n *  Note 3 :`dict` content will be copied internally.\n *           Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead.\n *           In such a case, dictionary buffer must outlive its users.\n *  Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()\n *           to precisely select how dictionary content must be interpreted. */\nZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_CCtx_refCDict() :\n *  Reference a prepared dictionary, to be used for all next compressed frames.\n *  Note that compression parameters are enforced from within CDict,\n *  and supersede any compression parameter previously set within CCtx.\n *  The parameters ignored are labled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs.\n *  The ignored parameters will be used again if the CCtx is returned to no-dictionary mode.\n *  The dictionary will remain valid for future compressed frames using same CCtx.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special : Referencing a NULL CDict means \"return to no-dictionary mode\".\n *  Note 1 : Currently, only one dictionary can be managed.\n *           Referencing a new dictionary effectively \"discards\" any previous one.\n *  Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx. */\nZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);\n\n/*! ZSTD_CCtx_refPrefix() :\n *  Reference a prefix (single-usage dictionary) for next compressed frame.\n *  A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end).\n *  Decompression will need same prefix to properly regenerate data.\n *  Compressing with a prefix is similar in outcome as performing a diff and compressing it,\n *  but performs much faster, especially during decompression (compression speed is tunable with compression level).\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary\n *  Note 1 : Prefix buffer is referenced. It **must** outlive compression.\n *           Its content must remain unmodified during compression.\n *  Note 2 : If the intention is to diff some large src data blob with some prior version of itself,\n *           ensure that the window size is large enough to contain the entire source.\n *           See ZSTD_c_windowLog.\n *  Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters.\n *           It's a CPU consuming operation, with non-negligible impact on latency.\n *           If there is a need to use the same prefix multiple times, consider loadDictionary instead.\n *  Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent).\n *           Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation. */\nZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,\n                                 const void* prefix, size_t prefixSize);\n\n/*! ZSTD_DCtx_loadDictionary() :\n *  Create an internal DDict from dict buffer,\n *  to be used to decompress next frames.\n *  The dictionary remains valid for all future frames, until explicitly invalidated.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,\n *            meaning \"return to no-dictionary mode\".\n *  Note 1 : Loading a dictionary involves building tables,\n *           which has a non-negligible impact on CPU usage and latency.\n *           It's recommended to \"load once, use many times\", to amortize the cost\n *  Note 2 :`dict` content will be copied internally, so `dict` can be released after loading.\n *           Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead.\n *  Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of\n *           how dictionary content is loaded and interpreted.\n */\nZSTDLIB_API size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_DCtx_refDDict() :\n *  Reference a prepared dictionary, to be used to decompress next frames.\n *  The dictionary remains active for decompression of future frames using same DCtx.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Note 1 : Currently, only one dictionary can be managed.\n *           Referencing a new dictionary effectively \"discards\" any previous one.\n *  Special: referencing a NULL DDict means \"return to no-dictionary mode\".\n *  Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.\n */\nZSTDLIB_API size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\n/*! ZSTD_DCtx_refPrefix() :\n *  Reference a prefix (single-usage dictionary) to decompress next frame.\n *  This is the reverse operation of ZSTD_CCtx_refPrefix(),\n *  and must use the same prefix as the one used during compression.\n *  Prefix is **only used once**. Reference is discarded at end of frame.\n *  End of frame is reached when ZSTD_decompressStream() returns 0.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary\n *  Note 2 : Prefix buffer is referenced. It **must** outlive decompression.\n *           Prefix buffer must remain unmodified up to the end of frame,\n *           reached when ZSTD_decompressStream() returns 0.\n *  Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent).\n *           Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)\n *  Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost.\n *           A full dictionary is more costly, as it requires building tables.\n */\nZSTDLIB_API size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,\n                                 const void* prefix, size_t prefixSize);\n\n/* ===   Memory management   === */\n\n/*! ZSTD_sizeof_*() :\n *  These functions give the _current_ memory usage of selected object.\n *  Note that object memory usage can evolve (increase or decrease) over time. */\nZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);\nZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);\nZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);\nZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);\nZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);\nZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);\n\n#endif  /* ZSTD_H_235446 */\n\n\n/* **************************************************************************************\n *   ADVANCED AND EXPERIMENTAL FUNCTIONS\n ****************************************************************************************\n * The definitions in the following section are considered experimental.\n * They are provided for advanced scenarios.\n * They should never be used with a dynamic library, as prototypes may change in the future.\n * Use them only in association with static linking.\n * ***************************************************************************************/\n\n#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)\n#define ZSTD_H_ZSTD_STATIC_LINKING_ONLY\n\n/****************************************************************************************\n *   experimental API (static linking only)\n ****************************************************************************************\n * The following symbols and constants\n * are not planned to join \"stable API\" status in the near future.\n * They can still change in future versions.\n * Some of them are planned to remain in the static_only section indefinitely.\n * Some of them might be removed in the future (especially when redundant with existing stable functions)\n * ***************************************************************************************/\n\n#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */\n#define ZSTD_FRAMEHEADERSIZE_MIN(format)    ((format) == ZSTD_f_zstd1 ? 6 : 2)\n#define ZSTD_FRAMEHEADERSIZE_MAX   18   /* can be useful for static allocation */\n#define ZSTD_SKIPPABLEHEADERSIZE    8\n\n/* compression parameter bounds */\n#define ZSTD_WINDOWLOG_MAX_32    30\n#define ZSTD_WINDOWLOG_MAX_64    31\n#define ZSTD_WINDOWLOG_MAX     ((int)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64))\n#define ZSTD_WINDOWLOG_MIN       10\n#define ZSTD_HASHLOG_MAX       ((ZSTD_WINDOWLOG_MAX < 30) ? ZSTD_WINDOWLOG_MAX : 30)\n#define ZSTD_HASHLOG_MIN          6\n#define ZSTD_CHAINLOG_MAX_32     29\n#define ZSTD_CHAINLOG_MAX_64     30\n#define ZSTD_CHAINLOG_MAX      ((int)(sizeof(size_t) == 4 ? ZSTD_CHAINLOG_MAX_32 : ZSTD_CHAINLOG_MAX_64))\n#define ZSTD_CHAINLOG_MIN        ZSTD_HASHLOG_MIN\n#define ZSTD_SEARCHLOG_MAX      (ZSTD_WINDOWLOG_MAX-1)\n#define ZSTD_SEARCHLOG_MIN        1\n#define ZSTD_MINMATCH_MAX         7   /* only for ZSTD_fast, other strategies are limited to 6 */\n#define ZSTD_MINMATCH_MIN         3   /* only for ZSTD_btopt+, faster strategies are limited to 4 */\n#define ZSTD_TARGETLENGTH_MAX    ZSTD_BLOCKSIZE_MAX\n#define ZSTD_TARGETLENGTH_MIN     0   /* note : comparing this constant to an unsigned results in a tautological test */\n#define ZSTD_STRATEGY_MIN        ZSTD_fast\n#define ZSTD_STRATEGY_MAX        ZSTD_btultra2\n\n\n#define ZSTD_OVERLAPLOG_MIN       0\n#define ZSTD_OVERLAPLOG_MAX       9\n\n#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame\n                                           * requiring larger than (1<<ZSTD_WINDOWLOG_LIMIT_DEFAULT) window size,\n                                           * to preserve host's memory from unreasonable requirements.\n                                           * This limit can be overridden using ZSTD_DCtx_setParameter(,ZSTD_d_windowLogMax,).\n                                           * The limit does not apply for one-pass decoders (such as ZSTD_decompress()), since no additional memory is allocated */\n\n\n/* LDM parameter bounds */\n#define ZSTD_LDM_HASHLOG_MIN      ZSTD_HASHLOG_MIN\n#define ZSTD_LDM_HASHLOG_MAX      ZSTD_HASHLOG_MAX\n#define ZSTD_LDM_MINMATCH_MIN        4\n#define ZSTD_LDM_MINMATCH_MAX     4096\n#define ZSTD_LDM_BUCKETSIZELOG_MIN   1\n#define ZSTD_LDM_BUCKETSIZELOG_MAX   8\n#define ZSTD_LDM_HASHRATELOG_MIN     0\n#define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)\n\n/* Advanced parameter bounds */\n#define ZSTD_TARGETCBLOCKSIZE_MIN   64\n#define ZSTD_TARGETCBLOCKSIZE_MAX   ZSTD_BLOCKSIZE_MAX\n#define ZSTD_SRCSIZEHINT_MIN        0\n#define ZSTD_SRCSIZEHINT_MAX        INT_MAX\n\n/* internal */\n#define ZSTD_HASHLOG3_MAX           17\n\n\n/* ---  Advanced types  --- */\n\ntypedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params;\n\ntypedef struct {\n    unsigned int offset;      /* The offset of the match. (NOT the same as the offset code)\n                               * If offset == 0 and matchLength == 0, this sequence represents the last\n                               * literals in the block of litLength size.\n                               */\n\n    unsigned int litLength;   /* Literal length of the sequence. */\n    unsigned int matchLength; /* Match length of the sequence. */\n\n                              /* Note: Users of this API may provide a sequence with matchLength == litLength == offset == 0.\n                               * In this case, we will treat the sequence as a marker for a block boundary.\n                               */\n\n    unsigned int rep;         /* Represents which repeat offset is represented by the field 'offset'.\n                               * Ranges from [0, 3].\n                               *\n                               * Repeat offsets are essentially previous offsets from previous sequences sorted in\n                               * recency order. For more detail, see doc/zstd_compression_format.md\n                               *\n                               * If rep == 0, then 'offset' does not contain a repeat offset.\n                               * If rep > 0:\n                               *  If litLength != 0:\n                               *      rep == 1 --> offset == repeat_offset_1\n                               *      rep == 2 --> offset == repeat_offset_2\n                               *      rep == 3 --> offset == repeat_offset_3\n                               *  If litLength == 0:\n                               *      rep == 1 --> offset == repeat_offset_2\n                               *      rep == 2 --> offset == repeat_offset_3\n                               *      rep == 3 --> offset == repeat_offset_1 - 1\n                               *\n                               * Note: This field is optional. ZSTD_generateSequences() will calculate the value of\n                               * 'rep', but repeat offsets do not necessarily need to be calculated from an external\n                               * sequence provider's perspective. For example, ZSTD_compressSequences() does not\n                               * use this 'rep' field at all (as of now).\n                               */\n} ZSTD_Sequence;\n\ntypedef struct {\n    unsigned windowLog;       /**< largest match distance : larger == more compression, more memory needed during decompression */\n    unsigned chainLog;        /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */\n    unsigned hashLog;         /**< dispatch table : larger == faster, more memory */\n    unsigned searchLog;       /**< nb of searches : larger == more compression, slower */\n    unsigned minMatch;        /**< match length searched : larger == faster decompression, sometimes less compression */\n    unsigned targetLength;    /**< acceptable match size for optimal parser (only) : larger == more compression, slower */\n    ZSTD_strategy strategy;   /**< see ZSTD_strategy definition above */\n} ZSTD_compressionParameters;\n\ntypedef struct {\n    int contentSizeFlag; /**< 1: content size will be in frame header (when known) */\n    int checksumFlag;    /**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */\n    int noDictIDFlag;    /**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */\n} ZSTD_frameParameters;\n\ntypedef struct {\n    ZSTD_compressionParameters cParams;\n    ZSTD_frameParameters fParams;\n} ZSTD_parameters;\n\ntypedef enum {\n    ZSTD_dct_auto = 0,       /* dictionary is \"full\" when starting with ZSTD_MAGIC_DICTIONARY, otherwise it is \"rawContent\" */\n    ZSTD_dct_rawContent = 1, /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */\n    ZSTD_dct_fullDict = 2    /* refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY */\n} ZSTD_dictContentType_e;\n\ntypedef enum {\n    ZSTD_dlm_byCopy = 0,  /**< Copy dictionary content internally */\n    ZSTD_dlm_byRef = 1    /**< Reference dictionary content -- the dictionary buffer must outlive its users. */\n} ZSTD_dictLoadMethod_e;\n\ntypedef enum {\n    ZSTD_f_zstd1 = 0,           /* zstd frame format, specified in zstd_compression_format.md (default) */\n    ZSTD_f_zstd1_magicless = 1  /* Variant of zstd frame format, without initial 4-bytes magic number.\n                                 * Useful to save 4 bytes per generated frame.\n                                 * Decoder cannot recognise automatically this format, requiring this instruction. */\n} ZSTD_format_e;\n\ntypedef enum {\n    /* Note: this enum controls ZSTD_d_forceIgnoreChecksum */\n    ZSTD_d_validateChecksum = 0,\n    ZSTD_d_ignoreChecksum = 1\n} ZSTD_forceIgnoreChecksum_e;\n\ntypedef enum {\n    /* Note: this enum and the behavior it controls are effectively internal\n     * implementation details of the compressor. They are expected to continue\n     * to evolve and should be considered only in the context of extremely\n     * advanced performance tuning.\n     *\n     * Zstd currently supports the use of a CDict in three ways:\n     *\n     * - The contents of the CDict can be copied into the working context. This\n     *   means that the compression can search both the dictionary and input\n     *   while operating on a single set of internal tables. This makes\n     *   the compression faster per-byte of input. However, the initial copy of\n     *   the CDict's tables incurs a fixed cost at the beginning of the\n     *   compression. For small compressions (< 8 KB), that copy can dominate\n     *   the cost of the compression.\n     *\n     * - The CDict's tables can be used in-place. In this model, compression is\n     *   slower per input byte, because the compressor has to search two sets of\n     *   tables. However, this model incurs no start-up cost (as long as the\n     *   working context's tables can be reused). For small inputs, this can be\n     *   faster than copying the CDict's tables.\n     *\n     * - The CDict's tables are not used at all, and instead we use the working\n     *   context alone to reload the dictionary and use params based on the source\n     *   size. See ZSTD_compress_insertDictionary() and ZSTD_compress_usingDict().\n     *   This method is effective when the dictionary sizes are very small relative\n     *   to the input size, and the input size is fairly large to begin with.\n     *\n     * Zstd has a simple internal heuristic that selects which strategy to use\n     * at the beginning of a compression. However, if experimentation shows that\n     * Zstd is making poor choices, it is possible to override that choice with\n     * this enum.\n     */\n    ZSTD_dictDefaultAttach = 0, /* Use the default heuristic. */\n    ZSTD_dictForceAttach   = 1, /* Never copy the dictionary. */\n    ZSTD_dictForceCopy     = 2, /* Always copy the dictionary. */\n    ZSTD_dictForceLoad     = 3  /* Always reload the dictionary */\n} ZSTD_dictAttachPref_e;\n\ntypedef enum {\n  ZSTD_lcm_auto = 0,          /**< Automatically determine the compression mode based on the compression level.\n                               *   Negative compression levels will be uncompressed, and positive compression\n                               *   levels will be compressed. */\n  ZSTD_lcm_huffman = 1,       /**< Always attempt Huffman compression. Uncompressed literals will still be\n                               *   emitted if Huffman compression is not profitable. */\n  ZSTD_lcm_uncompressed = 2   /**< Always emit uncompressed literals. */\n} ZSTD_literalCompressionMode_e;\n\n\n/***************************************\n*  Frame size functions\n***************************************/\n\n/*! ZSTD_findDecompressedSize() :\n *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames\n *  `srcSize` must be the _exact_ size of this series\n *       (i.e. there should be a frame boundary at `src + srcSize`)\n *  @return : - decompressed size of all data in all successive frames\n *            - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN\n *            - if an error occurred: ZSTD_CONTENTSIZE_ERROR\n *\n *   note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode.\n *            When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *   note 2 : decompressed size is always present when compression is done with ZSTD_compress()\n *   note 3 : decompressed size can be very large (64-bits value),\n *            potentially larger than what local system can handle as a single memory segment.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *   note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified.\n *            Always ensure result fits within application's authorized limits.\n *            Each application can set its own limits.\n *   note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to\n *            read each contained frame header.  This is fast as most of the data is skipped,\n *            however it does mean that all frame data must be present and valid. */\nZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);\n\n/*! ZSTD_decompressBound() :\n *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames\n *  `srcSize` must be the _exact_ size of this series\n *       (i.e. there should be a frame boundary at `src + srcSize`)\n *  @return : - upper-bound for the decompressed size of all data in all successive frames\n *            - if an error occured: ZSTD_CONTENTSIZE_ERROR\n *\n *  note 1  : an error can occur if `src` contains an invalid or incorrectly formatted frame.\n *  note 2  : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`.\n *            in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value.\n *  note 3  : when the decompressed size field isn't available, the upper-bound for that frame is calculated by:\n *              upper-bound = # blocks * min(128 KB, Window_Size)\n */\nZSTDLIB_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize);\n\n/*! ZSTD_frameHeaderSize() :\n *  srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX.\n * @return : size of the Frame Header,\n *           or an error code (if srcSize is too small) */\nZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);\n\ntypedef enum {\n  ZSTD_sf_noBlockDelimiters = 0,         /* Representation of ZSTD_Sequence has no block delimiters, sequences only */\n  ZSTD_sf_explicitBlockDelimiters = 1    /* Representation of ZSTD_Sequence contains explicit block delimiters */\n} ZSTD_sequenceFormat_e;\n\n/*! ZSTD_generateSequences() :\n * Generate sequences using ZSTD_compress2, given a source buffer.\n *\n * Each block will end with a dummy sequence\n * with offset == 0, matchLength == 0, and litLength == length of last literals.\n * litLength may be == 0, and if so, then the sequence of (of: 0 ml: 0 ll: 0)\n * simply acts as a block delimiter.\n *\n * zc can be used to insert custom compression params.\n * This function invokes ZSTD_compress2\n *\n * The output of this function can be fed into ZSTD_compressSequences() with CCtx\n * setting of ZSTD_c_blockDelimiters as ZSTD_sf_explicitBlockDelimiters\n * @return : number of sequences generated\n */\n\nZSTDLIB_API size_t ZSTD_generateSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs,\n                                          size_t outSeqsSize, const void* src, size_t srcSize);\n\n/*! ZSTD_mergeBlockDelimiters() :\n * Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals\n * by merging them into into the literals of the next sequence.\n *\n * As such, the final generated result has no explicit representation of block boundaries,\n * and the final last literals segment is not represented in the sequences.\n *\n * The output of this function can be fed into ZSTD_compressSequences() with CCtx\n * setting of ZSTD_c_blockDelimiters as ZSTD_sf_noBlockDelimiters\n * @return : number of sequences left after merging\n */\nZSTDLIB_API size_t ZSTD_mergeBlockDelimiters(ZSTD_Sequence* sequences, size_t seqsSize);\n\n/*! ZSTD_compressSequences() :\n * Compress an array of ZSTD_Sequence, generated from the original source buffer, into dst.\n * If a dictionary is included, then the cctx should reference the dict. (see: ZSTD_CCtx_refCDict(), ZSTD_CCtx_loadDictionary(), etc.)\n * The entire source is compressed into a single frame.\n *\n * The compression behavior changes based on cctx params. In particular:\n *    If ZSTD_c_blockDelimiters == ZSTD_sf_noBlockDelimiters, the array of ZSTD_Sequence is expected to contain\n *    no block delimiters (defined in ZSTD_Sequence). Block boundaries are roughly determined based on\n *    the block size derived from the cctx, and sequences may be split. This is the default setting.\n *\n *    If ZSTD_c_blockDelimiters == ZSTD_sf_explicitBlockDelimiters, the array of ZSTD_Sequence is expected to contain\n *    block delimiters (defined in ZSTD_Sequence). Behavior is undefined if no block delimiters are provided.\n *\n *    If ZSTD_c_validateSequences == 0, this function will blindly accept the sequences provided. Invalid sequences cause undefined\n *    behavior. If ZSTD_c_validateSequences == 1, then if sequence is invalid (see doc/zstd_compression_format.md for\n *    specifics regarding offset/matchlength requirements) then the function will bail out and return an error.\n *\n *    In addition to the two adjustable experimental params, there are other important cctx params.\n *    - ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match finder. It has a minimum value of ZSTD_MINMATCH_MIN.\n *    - ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in typical compression.\n *    - ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug levels if a provided offset\n *      is larger than what the spec allows for a given window log and dictionary (if present). See: doc/zstd_compression_format.md\n *\n * Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is unused.\n * Note 2: Once we integrate ability to ingest repcodes, the explicit block delims mode must respect those repcodes exactly,\n *         and cannot emit an RLE block that disagrees with the repcode history\n * @return : final compressed size or a ZSTD error.\n */\nZSTDLIB_API size_t ZSTD_compressSequences(ZSTD_CCtx* const cctx, void* dst, size_t dstSize,\n                                  const ZSTD_Sequence* inSeqs, size_t inSeqsSize,\n                                  const void* src, size_t srcSize);\n\n\n/***************************************\n*  Memory management\n***************************************/\n\n/*! ZSTD_estimate*() :\n *  These functions make it possible to estimate memory usage\n *  of a future {D,C}Ctx, before its creation.\n *\n *  ZSTD_estimateCCtxSize() will provide a memory budget large enough\n *  for any compression level up to selected one.\n *  Note : Unlike ZSTD_estimateCStreamSize*(), this estimate\n *         does not include space for a window buffer.\n *         Therefore, the estimation is only guaranteed for single-shot compressions, not streaming.\n *  The estimate will assume the input may be arbitrarily large,\n *  which is the worst case.\n *\n *  When srcSize can be bound by a known and rather \"small\" value,\n *  this fact can be used to provide a tighter estimation\n *  because the CCtx compression context will need less memory.\n *  This tighter estimation can be provided by more advanced functions\n *  ZSTD_estimateCCtxSize_usingCParams(), which can be used in tandem with ZSTD_getCParams(),\n *  and ZSTD_estimateCCtxSize_usingCCtxParams(), which can be used in tandem with ZSTD_CCtxParams_setParameter().\n *  Both can be used to estimate memory using custom compression parameters and arbitrary srcSize limits.\n *\n *  Note 2 : only single-threaded compression is supported.\n *  ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1.\n */\nZSTDLIB_API size_t ZSTD_estimateCCtxSize(int compressionLevel);\nZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);\nZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);\nZSTDLIB_API size_t ZSTD_estimateDCtxSize(void);\n\n/*! ZSTD_estimateCStreamSize() :\n *  ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one.\n *  It will also consider src size to be arbitrarily \"large\", which is worst case.\n *  If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation.\n *  ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.\n *  ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1.\n *  Note : CStream size estimation is only correct for single-threaded compression.\n *  ZSTD_DStream memory budget depends on window Size.\n *  This information can be passed manually, using ZSTD_estimateDStreamSize,\n *  or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();\n *  Note : if streaming is init with function ZSTD_init?Stream_usingDict(),\n *         an internal ?Dict will be created, which additional size is not estimated here.\n *         In this case, get total size by adding ZSTD_estimate?DictSize */\nZSTDLIB_API size_t ZSTD_estimateCStreamSize(int compressionLevel);\nZSTDLIB_API size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);\nZSTDLIB_API size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);\nZSTDLIB_API size_t ZSTD_estimateDStreamSize(size_t windowSize);\nZSTDLIB_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);\n\n/*! ZSTD_estimate?DictSize() :\n *  ZSTD_estimateCDictSize() will bet that src size is relatively \"small\", and content is copied, like ZSTD_createCDict().\n *  ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced().\n *  Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller.\n */\nZSTDLIB_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);\nZSTDLIB_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);\nZSTDLIB_API size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);\n\n/*! ZSTD_initStatic*() :\n *  Initialize an object using a pre-allocated fixed-size buffer.\n *  workspace: The memory area to emplace the object into.\n *             Provided pointer *must be 8-bytes aligned*.\n *             Buffer must outlive object.\n *  workspaceSize: Use ZSTD_estimate*Size() to determine\n *                 how large workspace must be to support target scenario.\n * @return : pointer to object (same address as workspace, just different type),\n *           or NULL if error (size too small, incorrect alignment, etc.)\n *  Note : zstd will never resize nor malloc() when using a static buffer.\n *         If the object requires more memory than available,\n *         zstd will just error out (typically ZSTD_error_memory_allocation).\n *  Note 2 : there is no corresponding \"free\" function.\n *           Since workspace is allocated externally, it must be freed externally too.\n *  Note 3 : cParams : use ZSTD_getCParams() to convert a compression level\n *           into its associated cParams.\n *  Limitation 1 : currently not compatible with internal dictionary creation, triggered by\n *                 ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict().\n *  Limitation 2 : static cctx currently not compatible with multi-threading.\n *  Limitation 3 : static dctx is incompatible with legacy support.\n */\nZSTDLIB_API ZSTD_CCtx*    ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);\nZSTDLIB_API ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */\n\nZSTDLIB_API ZSTD_DCtx*    ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);\nZSTDLIB_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */\n\nZSTDLIB_API const ZSTD_CDict* ZSTD_initStaticCDict(\n                                        void* workspace, size_t workspaceSize,\n                                        const void* dict, size_t dictSize,\n                                        ZSTD_dictLoadMethod_e dictLoadMethod,\n                                        ZSTD_dictContentType_e dictContentType,\n                                        ZSTD_compressionParameters cParams);\n\nZSTDLIB_API const ZSTD_DDict* ZSTD_initStaticDDict(\n                                        void* workspace, size_t workspaceSize,\n                                        const void* dict, size_t dictSize,\n                                        ZSTD_dictLoadMethod_e dictLoadMethod,\n                                        ZSTD_dictContentType_e dictContentType);\n\n\n/*! Custom memory allocation :\n *  These prototypes make it possible to pass your own allocation/free functions.\n *  ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below.\n *  All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.\n */\ntypedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);\ntypedef void  (*ZSTD_freeFunction) (void* opaque, void* address);\ntypedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;\nstatic\n#ifdef __GNUC__\n__attribute__((__unused__))\n#endif\nZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL };  /**< this constant defers to stdlib's functions */\n\nZSTDLIB_API ZSTD_CCtx*    ZSTD_createCCtx_advanced(ZSTD_customMem customMem);\nZSTDLIB_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);\nZSTDLIB_API ZSTD_DCtx*    ZSTD_createDCtx_advanced(ZSTD_customMem customMem);\nZSTDLIB_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);\n\nZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,\n                                                  ZSTD_dictLoadMethod_e dictLoadMethod,\n                                                  ZSTD_dictContentType_e dictContentType,\n                                                  ZSTD_compressionParameters cParams,\n                                                  ZSTD_customMem customMem);\n\n/* ! Thread pool :\n * These prototypes make it possible to share a thread pool among multiple compression contexts.\n * This can limit resources for applications with multiple threads where each one uses\n * a threaded compression mode (via ZSTD_c_nbWorkers parameter).\n * ZSTD_createThreadPool creates a new thread pool with a given number of threads.\n * Note that the lifetime of such pool must exist while being used.\n * ZSTD_CCtx_refThreadPool assigns a thread pool to a context (use NULL argument value\n * to use an internal thread pool).\n * ZSTD_freeThreadPool frees a thread pool.\n */\ntypedef struct POOL_ctx_s ZSTD_threadPool;\nZSTDLIB_API ZSTD_threadPool* ZSTD_createThreadPool(size_t numThreads);\nZSTDLIB_API void ZSTD_freeThreadPool (ZSTD_threadPool* pool);\nZSTDLIB_API size_t ZSTD_CCtx_refThreadPool(ZSTD_CCtx* cctx, ZSTD_threadPool* pool);\n\n/*\n * This API is temporary and is expected to change or disappear in the future!\n */\nZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced2(\n    const void* dict, size_t dictSize,\n    ZSTD_dictLoadMethod_e dictLoadMethod,\n    ZSTD_dictContentType_e dictContentType,\n    const ZSTD_CCtx_params* cctxParams,\n    ZSTD_customMem customMem);\n\nZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,\n                                                  ZSTD_dictLoadMethod_e dictLoadMethod,\n                                                  ZSTD_dictContentType_e dictContentType,\n                                                  ZSTD_customMem customMem);\n\n/***************************************\n*  Advanced compression functions\n***************************************/\n\n/*! ZSTD_createCDict_byReference() :\n *  Create a digested dictionary for compression\n *  Dictionary content is just referenced, not duplicated.\n *  As a consequence, `dictBuffer` **must** outlive CDict,\n *  and its content must remain unmodified throughout the lifetime of CDict.\n *  note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef */\nZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);\n\n/*! ZSTD_getDictID_fromCDict() :\n *  Provides the dictID of the dictionary loaded into `cdict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromCDict(const ZSTD_CDict* cdict);\n\n/*! ZSTD_getCParams() :\n * @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.\n * `estimatedSrcSize` value is optional, select 0 if not known */\nZSTDLIB_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);\n\n/*! ZSTD_getParams() :\n *  same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`.\n *  All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0 */\nZSTDLIB_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);\n\n/*! ZSTD_checkCParams() :\n *  Ensure param values remain within authorized range.\n * @return 0 on success, or an error code (can be checked with ZSTD_isError()) */\nZSTDLIB_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params);\n\n/*! ZSTD_adjustCParams() :\n *  optimize params for a given `srcSize` and `dictSize`.\n * `srcSize` can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN.\n * `dictSize` must be `0` when there is no dictionary.\n *  cPar can be invalid : all parameters will be clamped within valid range in the @return struct.\n *  This function never fails (wide contract) */\nZSTDLIB_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);\n\n/*! ZSTD_compress_advanced() :\n *  Note : this function is now DEPRECATED.\n *         It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters.\n *  This prototype will be marked as deprecated and generate compilation warning on reaching v1.5.x */\nZSTDLIB_API size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx,\n                                          void* dst, size_t dstCapacity,\n                                    const void* src, size_t srcSize,\n                                    const void* dict,size_t dictSize,\n                                          ZSTD_parameters params);\n\n/*! ZSTD_compress_usingCDict_advanced() :\n *  Note : this function is now REDUNDANT.\n *         It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters.\n *  This prototype will be marked as deprecated and generate compilation warning in some future version */\nZSTDLIB_API size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,\n                                              void* dst, size_t dstCapacity,\n                                        const void* src, size_t srcSize,\n                                        const ZSTD_CDict* cdict,\n                                              ZSTD_frameParameters fParams);\n\n\n/*! ZSTD_CCtx_loadDictionary_byReference() :\n *  Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx.\n *  It saves some memory, but also requires that `dict` outlives its usage within `cctx` */\nZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_CCtx_loadDictionary_advanced() :\n *  Same as ZSTD_CCtx_loadDictionary(), but gives finer control over\n *  how to load the dictionary (by copy ? by reference ?)\n *  and how to interpret it (automatic ? force raw mode ? full mode only ?) */\nZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_CCtx_refPrefix_advanced() :\n *  Same as ZSTD_CCtx_refPrefix(), but gives finer control over\n *  how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */\nZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType);\n\n/* ===   experimental parameters   === */\n/* these parameters can be used with ZSTD_setParameter()\n * they are not guaranteed to remain supported in the future */\n\n /* Enables rsyncable mode,\n  * which makes compressed files more rsync friendly\n  * by adding periodic synchronization points to the compressed data.\n  * The target average block size is ZSTD_c_jobSize / 2.\n  * It's possible to modify the job size to increase or decrease\n  * the granularity of the synchronization point.\n  * Once the jobSize is smaller than the window size,\n  * it will result in compression ratio degradation.\n  * NOTE 1: rsyncable mode only works when multithreading is enabled.\n  * NOTE 2: rsyncable performs poorly in combination with long range mode,\n  * since it will decrease the effectiveness of synchronization points,\n  * though mileage may vary.\n  * NOTE 3: Rsyncable mode limits maximum compression speed to ~400 MB/s.\n  * If the selected compression level is already running significantly slower,\n  * the overall speed won't be significantly impacted.\n  */\n #define ZSTD_c_rsyncable ZSTD_c_experimentalParam1\n\n/* Select a compression format.\n * The value must be of type ZSTD_format_e.\n * See ZSTD_format_e enum definition for details */\n#define ZSTD_c_format ZSTD_c_experimentalParam2\n\n/* Force back-reference distances to remain < windowSize,\n * even when referencing into Dictionary content (default:0) */\n#define ZSTD_c_forceMaxWindow ZSTD_c_experimentalParam3\n\n/* Controls whether the contents of a CDict\n * are used in place, or copied into the working context.\n * Accepts values from the ZSTD_dictAttachPref_e enum.\n * See the comments on that enum for an explanation of the feature. */\n#define ZSTD_c_forceAttachDict ZSTD_c_experimentalParam4\n\n/* Controls how the literals are compressed (default is auto).\n * The value must be of type ZSTD_literalCompressionMode_e.\n * See ZSTD_literalCompressionMode_t enum definition for details.\n */\n#define ZSTD_c_literalCompressionMode ZSTD_c_experimentalParam5\n\n/* Tries to fit compressed block size to be around targetCBlockSize.\n * No target when targetCBlockSize == 0.\n * There is no guarantee on compressed block size (default:0) */\n#define ZSTD_c_targetCBlockSize ZSTD_c_experimentalParam6\n\n/* User's best guess of source size.\n * Hint is not valid when srcSizeHint == 0.\n * There is no guarantee that hint is close to actual source size,\n * but compression ratio may regress significantly if guess considerably underestimates */\n#define ZSTD_c_srcSizeHint ZSTD_c_experimentalParam7\n\n/* Controls whether the new and experimental \"dedicated dictionary search\n * structure\" can be used. This feature is still rough around the edges, be\n * prepared for surprising behavior!\n *\n * How to use it:\n *\n * When using a CDict, whether to use this feature or not is controlled at\n * CDict creation, and it must be set in a CCtxParams set passed into that\n * construction (via ZSTD_createCDict_advanced2()). A compression will then\n * use the feature or not based on how the CDict was constructed; the value of\n * this param, set in the CCtx, will have no effect.\n *\n * However, when a dictionary buffer is passed into a CCtx, such as via\n * ZSTD_CCtx_loadDictionary(), this param can be set on the CCtx to control\n * whether the CDict that is created internally can use the feature or not.\n *\n * What it does:\n *\n * Normally, the internal data structures of the CDict are analogous to what\n * would be stored in a CCtx after compressing the contents of a dictionary.\n * To an approximation, a compression using a dictionary can then use those\n * data structures to simply continue what is effectively a streaming\n * compression where the simulated compression of the dictionary left off.\n * Which is to say, the search structures in the CDict are normally the same\n * format as in the CCtx.\n *\n * It is possible to do better, since the CDict is not like a CCtx: the search\n * structures are written once during CDict creation, and then are only read\n * after that, while the search structures in the CCtx are both read and\n * written as the compression goes along. This means we can choose a search\n * structure for the dictionary that is read-optimized.\n *\n * This feature enables the use of that different structure.\n *\n * Note that some of the members of the ZSTD_compressionParameters struct have\n * different semantics and constraints in the dedicated search structure. It is\n * highly recommended that you simply set a compression level in the CCtxParams\n * you pass into the CDict creation call, and avoid messing with the cParams\n * directly.\n *\n * Effects:\n *\n * This will only have any effect when the selected ZSTD_strategy\n * implementation supports this feature. Currently, that's limited to\n * ZSTD_greedy, ZSTD_lazy, and ZSTD_lazy2.\n *\n * Note that this means that the CDict tables can no longer be copied into the\n * CCtx, so the dict attachment mode ZSTD_dictForceCopy will no longer be\n * useable. The dictionary can only be attached or reloaded.\n *\n * In general, you should expect compression to be faster--sometimes very much\n * so--and CDict creation to be slightly slower. Eventually, we will probably\n * make this mode the default.\n */\n#define ZSTD_c_enableDedicatedDictSearch ZSTD_c_experimentalParam8\n\n/* ZSTD_c_stableInBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells the compressor that the ZSTD_inBuffer will ALWAYS be the same\n * between calls, except for the modifications that zstd makes to pos (the\n * caller must not modify pos). This is checked by the compressor, and\n * compression will fail if it ever changes. This means the only flush\n * mode that makes sense is ZSTD_e_end, so zstd will error if ZSTD_e_end\n * is not used. The data in the ZSTD_inBuffer in the range [src, src + pos)\n * MUST not be modified during compression or you will get data corruption.\n *\n * When this flag is enabled zstd won't allocate an input window buffer,\n * because the user guarantees it can reference the ZSTD_inBuffer until\n * the frame is complete. But, it will still allocate an output buffer\n * large enough to fit a block (see ZSTD_c_stableOutBuffer). This will also\n * avoid the memcpy() from the input buffer to the input window buffer.\n *\n * NOTE: ZSTD_compressStream2() will error if ZSTD_e_end is not used.\n * That means this flag cannot be used with ZSTD_compressStream().\n *\n * NOTE: So long as the ZSTD_inBuffer always points to valid memory, using\n * this flag is ALWAYS memory safe, and will never access out-of-bounds\n * memory. However, compression WILL fail if you violate the preconditions.\n *\n * WARNING: The data in the ZSTD_inBuffer in the range [dst, dst + pos) MUST\n * not be modified during compression or you will get data corruption. This\n * is because zstd needs to reference data in the ZSTD_inBuffer to find\n * matches. Normally zstd maintains its own window buffer for this purpose,\n * but passing this flag tells zstd to use the user provided buffer.\n */\n#define ZSTD_c_stableInBuffer ZSTD_c_experimentalParam9\n\n/* ZSTD_c_stableOutBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells he compressor that the ZSTD_outBuffer will not be resized between\n * calls. Specifically: (out.size - out.pos) will never grow. This gives the\n * compressor the freedom to say: If the compressed data doesn't fit in the\n * output buffer then return ZSTD_error_dstSizeTooSmall. This allows us to\n * always decompress directly into the output buffer, instead of decompressing\n * into an internal buffer and copying to the output buffer.\n *\n * When this flag is enabled zstd won't allocate an output buffer, because\n * it can write directly to the ZSTD_outBuffer. It will still allocate the\n * input window buffer (see ZSTD_c_stableInBuffer).\n *\n * Zstd will check that (out.size - out.pos) never grows and return an error\n * if it does. While not strictly necessary, this should prevent surprises.\n */\n#define ZSTD_c_stableOutBuffer ZSTD_c_experimentalParam10\n\n/* ZSTD_c_blockDelimiters\n * Default is 0 == ZSTD_sf_noBlockDelimiters.\n *\n * For use with sequence compression API: ZSTD_compressSequences().\n *\n * Designates whether or not the given array of ZSTD_Sequence contains block delimiters\n * and last literals, which are defined as sequences with offset == 0 and matchLength == 0.\n * See the definition of ZSTD_Sequence for more specifics.\n */\n#define ZSTD_c_blockDelimiters ZSTD_c_experimentalParam11\n\n/* ZSTD_c_validateSequences\n * Default is 0 == disabled. Set to 1 to enable sequence validation.\n *\n * For use with sequence compression API: ZSTD_compressSequences().\n * Designates whether or not we validate sequences provided to ZSTD_compressSequences()\n * during function execution.\n *\n * Without validation, providing a sequence that does not conform to the zstd spec will cause\n * undefined behavior, and may produce a corrupted block.\n *\n * With validation enabled, a if sequence is invalid (see doc/zstd_compression_format.md for\n * specifics regarding offset/matchlength requirements) then the function will bail out and\n * return an error.\n *\n */\n#define ZSTD_c_validateSequences ZSTD_c_experimentalParam12\n\n/*! ZSTD_CCtx_getParameter() :\n *  Get the requested compression parameter value, selected by enum ZSTD_cParameter,\n *  and store it into int* value.\n * @return : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);\n\n\n/*! ZSTD_CCtx_params :\n *  Quick howto :\n *  - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure\n *  - ZSTD_CCtxParams_setParameter() : Push parameters one by one into\n *                                     an existing ZSTD_CCtx_params structure.\n *                                     This is similar to\n *                                     ZSTD_CCtx_setParameter().\n *  - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to\n *                                    an existing CCtx.\n *                                    These parameters will be applied to\n *                                    all subsequent frames.\n *  - ZSTD_compressStream2() : Do compression using the CCtx.\n *  - ZSTD_freeCCtxParams() : Free the memory.\n *\n *  This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams()\n *  for static allocation of CCtx for single-threaded compression.\n */\nZSTDLIB_API ZSTD_CCtx_params* ZSTD_createCCtxParams(void);\nZSTDLIB_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);\n\n/*! ZSTD_CCtxParams_reset() :\n *  Reset params to default values.\n */\nZSTDLIB_API size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);\n\n/*! ZSTD_CCtxParams_init() :\n *  Initializes the compression parameters of cctxParams according to\n *  compression level. All other parameters are reset to their default values.\n */\nZSTDLIB_API size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel);\n\n/*! ZSTD_CCtxParams_init_advanced() :\n *  Initializes the compression and frame parameters of cctxParams according to\n *  params. All other parameters are reset to their default values.\n */\nZSTDLIB_API size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);\n\n/*! ZSTD_CCtxParams_setParameter() :\n *  Similar to ZSTD_CCtx_setParameter.\n *  Set one compression parameter, selected by enum ZSTD_cParameter.\n *  Parameters must be applied to a ZSTD_CCtx using\n *  ZSTD_CCtx_setParametersUsingCCtxParams().\n * @result : a code representing success or failure (which can be tested with\n *           ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value);\n\n/*! ZSTD_CCtxParams_getParameter() :\n * Similar to ZSTD_CCtx_getParameter.\n * Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_CCtxParams_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);\n\n/*! ZSTD_CCtx_setParametersUsingCCtxParams() :\n *  Apply a set of ZSTD_CCtx_params to the compression context.\n *  This can be done even after compression is started,\n *    if nbWorkers==0, this will have no impact until a new compression is started.\n *    if nbWorkers>=1, new parameters will be picked up at next job,\n *       with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated).\n */\nZSTDLIB_API size_t ZSTD_CCtx_setParametersUsingCCtxParams(\n        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);\n\n/*! ZSTD_compressStream2_simpleArgs() :\n *  Same as ZSTD_compressStream2(),\n *  but using only integral types as arguments.\n *  This variant might be helpful for binders from dynamic languages\n *  which have troubles handling structures containing memory pointers.\n */\nZSTDLIB_API size_t ZSTD_compressStream2_simpleArgs (\n                            ZSTD_CCtx* cctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos,\n                            ZSTD_EndDirective endOp);\n\n\n/***************************************\n*  Advanced decompression functions\n***************************************/\n\n/*! ZSTD_isFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier.\n *  Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.\n *  Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.\n *  Note 3 : Skippable Frame Identifiers are considered valid. */\nZSTDLIB_API unsigned ZSTD_isFrame(const void* buffer, size_t size);\n\n/*! ZSTD_createDDict_byReference() :\n *  Create a digested dictionary, ready to start decompression operation without startup delay.\n *  Dictionary content is referenced, and therefore stays in dictBuffer.\n *  It is important that dictBuffer outlives DDict,\n *  it must remain read accessible throughout the lifetime of DDict */\nZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);\n\n/*! ZSTD_DCtx_loadDictionary_byReference() :\n *  Same as ZSTD_DCtx_loadDictionary(),\n *  but references `dict` content instead of copying it into `dctx`.\n *  This saves memory if `dict` remains around.,\n *  However, it's imperative that `dict` remains accessible (and unmodified) while being used, so it must outlive decompression. */\nZSTDLIB_API size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_DCtx_loadDictionary_advanced() :\n *  Same as ZSTD_DCtx_loadDictionary(),\n *  but gives direct control over\n *  how to load the dictionary (by copy ? by reference ?)\n *  and how to interpret it (automatic ? force raw mode ? full mode only ?). */\nZSTDLIB_API size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_DCtx_refPrefix_advanced() :\n *  Same as ZSTD_DCtx_refPrefix(), but gives finer control over\n *  how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */\nZSTDLIB_API size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_DCtx_setMaxWindowSize() :\n *  Refuses allocating internal buffers for frames requiring a window size larger than provided limit.\n *  This protects a decoder context from reserving too much memory for itself (potential attack scenario).\n *  This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.\n *  By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT)\n * @return : 0, or an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);\n\n/*! ZSTD_DCtx_getParameter() :\n *  Get the requested decompression parameter value, selected by enum ZSTD_dParameter,\n *  and store it into int* value.\n * @return : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value);\n\n/* ZSTD_d_format\n * experimental parameter,\n * allowing selection between ZSTD_format_e input compression formats\n */\n#define ZSTD_d_format ZSTD_d_experimentalParam1\n/* ZSTD_d_stableOutBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells the decompressor that the ZSTD_outBuffer will ALWAYS be the same\n * between calls, except for the modifications that zstd makes to pos (the\n * caller must not modify pos). This is checked by the decompressor, and\n * decompression will fail if it ever changes. Therefore the ZSTD_outBuffer\n * MUST be large enough to fit the entire decompressed frame. This will be\n * checked when the frame content size is known. The data in the ZSTD_outBuffer\n * in the range [dst, dst + pos) MUST not be modified during decompression\n * or you will get data corruption.\n *\n * When this flags is enabled zstd won't allocate an output buffer, because\n * it can write directly to the ZSTD_outBuffer, but it will still allocate\n * an input buffer large enough to fit any compressed block. This will also\n * avoid the memcpy() from the internal output buffer to the ZSTD_outBuffer.\n * If you need to avoid the input buffer allocation use the buffer-less\n * streaming API.\n *\n * NOTE: So long as the ZSTD_outBuffer always points to valid memory, using\n * this flag is ALWAYS memory safe, and will never access out-of-bounds\n * memory. However, decompression WILL fail if you violate the preconditions.\n *\n * WARNING: The data in the ZSTD_outBuffer in the range [dst, dst + pos) MUST\n * not be modified during decompression or you will get data corruption. This\n * is because zstd needs to reference data in the ZSTD_outBuffer to regenerate\n * matches. Normally zstd maintains its own buffer for this purpose, but passing\n * this flag tells zstd to use the user provided buffer.\n */\n#define ZSTD_d_stableOutBuffer ZSTD_d_experimentalParam2\n\n/* ZSTD_d_forceIgnoreChecksum\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable\n *\n * Tells the decompressor to skip checksum validation during decompression, regardless\n * of whether checksumming was specified during compression. This offers some\n * slight performance benefits, and may be useful for debugging.\n * Param has values of type ZSTD_forceIgnoreChecksum_e\n */\n#define ZSTD_d_forceIgnoreChecksum ZSTD_d_experimentalParam3\n\n/*! ZSTD_DCtx_setFormat() :\n *  Instruct the decoder context about what kind of data to decode next.\n *  This instruction is mandatory to decode data without a fully-formed header,\n *  such ZSTD_f_zstd1_magicless for example.\n * @return : 0, or an error code (which can be tested using ZSTD_isError()). */\nZSTDLIB_API size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);\n\n/*! ZSTD_decompressStream_simpleArgs() :\n *  Same as ZSTD_decompressStream(),\n *  but using only integral types as arguments.\n *  This can be helpful for binders from dynamic languages\n *  which have troubles handling structures containing memory pointers.\n */\nZSTDLIB_API size_t ZSTD_decompressStream_simpleArgs (\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos);\n\n\n/********************************************************************\n*  Advanced streaming functions\n*  Warning : most of these functions are now redundant with the Advanced API.\n*  Once Advanced API reaches \"stable\" status,\n*  redundant functions will be deprecated, and then at some point removed.\n********************************************************************/\n\n/*=====   Advanced Streaming compression functions  =====*/\n\n/*! ZSTD_initCStream_srcSize() :\n * This function is deprecated, and equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *\n * pledgedSrcSize must be correct. If it is not known at init time, use\n * ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs,\n * \"0\" also disables frame content size field. It may be enabled in the future.\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t\nZSTD_initCStream_srcSize(ZSTD_CStream* zcs,\n                         int compressionLevel,\n                         unsigned long long pledgedSrcSize);\n\n/*! ZSTD_initCStream_usingDict() :\n * This function is deprecated, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n *     ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);\n *\n * Creates of an internal CDict (incompatible with static CCtx), except if\n * dict == NULL or dictSize < 8, in which case no dict is used.\n * Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if\n * it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t\nZSTD_initCStream_usingDict(ZSTD_CStream* zcs,\n                     const void* dict, size_t dictSize,\n                           int compressionLevel);\n\n/*! ZSTD_initCStream_advanced() :\n * This function is deprecated, and is approximately equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     // Pseudocode: Set each zstd parameter and leave the rest as-is.\n *     for ((param, value) : params) {\n *         ZSTD_CCtx_setParameter(zcs, param, value);\n *     }\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *     ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);\n *\n * dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy.\n * pledgedSrcSize must be correct.\n * If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN.\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t\nZSTD_initCStream_advanced(ZSTD_CStream* zcs,\n                    const void* dict, size_t dictSize,\n                          ZSTD_parameters params,\n                          unsigned long long pledgedSrcSize);\n\n/*! ZSTD_initCStream_usingCDict() :\n * This function is deprecated, and equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, cdict);\n *\n * note : cdict will just be referenced, and must outlive compression session\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);\n\n/*! ZSTD_initCStream_usingCDict_advanced() :\n *   This function is DEPRECATED, and is approximately equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     // Pseudocode: Set each zstd frame parameter and leave the rest as-is.\n *     for ((fParam, value) : fParams) {\n *         ZSTD_CCtx_setParameter(zcs, fParam, value);\n *     }\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *     ZSTD_CCtx_refCDict(zcs, cdict);\n *\n * same as ZSTD_initCStream_usingCDict(), with control over frame parameters.\n * pledgedSrcSize must be correct. If srcSize is not known at init time, use\n * value ZSTD_CONTENTSIZE_UNKNOWN.\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t\nZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs,\n                               const ZSTD_CDict* cdict,\n                                     ZSTD_frameParameters fParams,\n                                     unsigned long long pledgedSrcSize);\n\n/*! ZSTD_resetCStream() :\n * This function is deprecated, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *\n *  start a new frame, using same parameters from previous frame.\n *  This is typically useful to skip dictionary loading stage, since it will re-use it in-place.\n *  Note that zcs must be init at least once before using ZSTD_resetCStream().\n *  If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN.\n *  If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end.\n *  For the time being, pledgedSrcSize==0 is interpreted as \"srcSize unknown\" for compatibility with older programs,\n *  but it will change to mean \"empty\" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead.\n * @return : 0, or an error code (which can be tested using ZSTD_isError())\n *  Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);\n\n\ntypedef struct {\n    unsigned long long ingested;   /* nb input bytes read and buffered */\n    unsigned long long consumed;   /* nb input bytes actually compressed */\n    unsigned long long produced;   /* nb of compressed bytes generated and buffered */\n    unsigned long long flushed;    /* nb of compressed bytes flushed : not provided; can be tracked from caller side */\n    unsigned currentJobID;         /* MT only : latest started job nb */\n    unsigned nbActiveWorkers;      /* MT only : nb of workers actively compressing at probe time */\n} ZSTD_frameProgression;\n\n/* ZSTD_getFrameProgression() :\n * tells how much data has been ingested (read from input)\n * consumed (input actually compressed) and produced (output) for current frame.\n * Note : (ingested - consumed) is amount of input data buffered internally, not yet compressed.\n * Aggregates progression inside active worker threads.\n */\nZSTDLIB_API ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx);\n\n/*! ZSTD_toFlushNow() :\n *  Tell how many bytes are ready to be flushed immediately.\n *  Useful for multithreading scenarios (nbWorkers >= 1).\n *  Probe the oldest active job, defined as oldest job not yet entirely flushed,\n *  and check its output buffer.\n * @return : amount of data stored in oldest job and ready to be flushed immediately.\n *  if @return == 0, it means either :\n *  + there is no active job (could be checked with ZSTD_frameProgression()), or\n *  + oldest job is still actively compressing data,\n *    but everything it has produced has also been flushed so far,\n *    therefore flush speed is limited by production speed of oldest job\n *    irrespective of the speed of concurrent (and newer) jobs.\n */\nZSTDLIB_API size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);\n\n\n/*=====   Advanced Streaming decompression functions  =====*/\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_loadDictionary(zds, dict, dictSize);\n *\n * note: no dictionary will be used if dict == NULL or dictSize < 8\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_refDDict(zds, ddict);\n *\n * note : ddict is referenced, it must outlive decompression session\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *\n * re-use decompression parameters from previous init; saves dictionary loading\n * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x\n */\nZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);\n\n\n/*********************************************************************\n*  Buffer-less and synchronous inner streaming functions\n*\n*  This is an advanced API, giving full control over buffer management, for users which need direct control over memory.\n*  But it's also a complex one, with several restrictions, documented below.\n*  Prefer normal streaming API for an easier experience.\n********************************************************************* */\n\n/**\n  Buffer-less streaming compression (synchronous mode)\n\n  A ZSTD_CCtx object is required to track streaming operations.\n  Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.\n  ZSTD_CCtx object can be re-used multiple times within successive compression operations.\n\n  Start by initializing a context.\n  Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,\n  or ZSTD_compressBegin_advanced(), for finer parameter control.\n  It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()\n\n  Then, consume your input using ZSTD_compressContinue().\n  There are some important considerations to keep in mind when using this advanced function :\n  - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only.\n  - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks.\n  - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario.\n    Worst case evaluation is provided by ZSTD_compressBound().\n    ZSTD_compressContinue() doesn't guarantee recover after a failed compression.\n  - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).\n    It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)\n  - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.\n    In which case, it will \"discard\" the relevant memory section from its history.\n\n  Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum.\n  It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame.\n  Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders.\n\n  `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again.\n*/\n\n/*=====   Buffer-less streaming compression functions  =====*/\nZSTDLIB_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);\nZSTDLIB_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);\nZSTDLIB_API size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */\nZSTDLIB_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */\nZSTDLIB_API size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */\nZSTDLIB_API size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */\n\nZSTDLIB_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTDLIB_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\n\n\n/**\n  Buffer-less streaming decompression (synchronous mode)\n\n  A ZSTD_DCtx object is required to track streaming operations.\n  Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.\n  A ZSTD_DCtx object can be re-used multiple times.\n\n  First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().\n  Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.\n  Data fragment must be large enough to ensure successful decoding.\n `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.\n  @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.\n           >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.\n           errorCode, which can be tested using ZSTD_isError().\n\n  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,\n  such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`).\n  Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information.\n  As a consequence, check that values remain within valid application range.\n  For example, do not allocate memory blindly, check that `windowSize` is within expectation.\n  Each application can set its own limits, depending on local restrictions.\n  For extended interoperability, it is recommended to support `windowSize` of at least 8 MB.\n\n  ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes.\n  ZSTD_decompressContinue() is very sensitive to contiguity,\n  if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,\n  or that previous contiguous segment is large enough to properly handle maximum back-reference distance.\n  There are multiple ways to guarantee this condition.\n\n  The most memory efficient way is to use a round buffer of sufficient size.\n  Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(),\n  which can @return an error code if required value is too large for current system (in 32-bits mode).\n  In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one,\n  up to the moment there is not enough room left in the buffer to guarantee decoding another full block,\n  which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`.\n  At which point, decoding can resume from the beginning of the buffer.\n  Note that already decoded data stored in the buffer should be flushed before being overwritten.\n\n  There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory.\n\n  Finally, if you control the compression process, you can also ignore all buffer size rules,\n  as long as the encoder and decoder progress in \"lock-step\",\n  aka use exactly the same buffer sizes, break contiguity at the same place, etc.\n\n  Once buffers are setup, start decompression, with ZSTD_decompressBegin().\n  If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().\n\n  Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.\n  ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue().\n  ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail.\n\n @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).\n  It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item.\n  It can also be an error code, which can be tested with ZSTD_isError().\n\n  A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero.\n  Context can then be reset to start a new decompression.\n\n  Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType().\n  This information is not required to properly decode a frame.\n\n  == Special case : skippable frames ==\n\n  Skippable frames allow integration of user-defined data into a flow of concatenated frames.\n  Skippable frames will be ignored (skipped) by decompressor.\n  The format of skippable frames is as follows :\n  a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F\n  b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits\n  c) Frame Content - any content (User Data) of length equal to Frame Size\n  For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame.\n  For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content.\n*/\n\n/*=====   Buffer-less streaming decompression functions  =====*/\ntypedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;\ntypedef struct {\n    unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means \"empty\" */\n    unsigned long long windowSize;       /* can be very large, up to <= frameContentSize */\n    unsigned blockSizeMax;\n    ZSTD_frameType_e frameType;          /* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */\n    unsigned headerSize;\n    unsigned dictID;\n    unsigned checksumFlag;\n} ZSTD_frameHeader;\n\n/*! ZSTD_getFrameHeader() :\n *  decode Frame Header, or requires larger `srcSize`.\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n *           or an error code, which can be tested using ZSTD_isError() */\nZSTDLIB_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */\n/*! ZSTD_getFrameHeader_advanced() :\n *  same as ZSTD_getFrameHeader(),\n *  with added capability to select a format (like ZSTD_f_zstd1_magicless) */\nZSTDLIB_API size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);\nZSTDLIB_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */\n\nZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);\nZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\nZSTDLIB_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\nZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);\nZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\n\n/* misc */\nZSTDLIB_API void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);\ntypedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;\nZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);\n\n\n\n\n/* ============================ */\n/**       Block level API       */\n/* ============================ */\n\n/*!\n    Block functions produce and decode raw zstd blocks, without frame metadata.\n    Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes).\n    But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes.\n\n    A few rules to respect :\n    - Compressing and decompressing require a context structure\n      + Use ZSTD_createCCtx() and ZSTD_createDCtx()\n    - It is necessary to init context before starting\n      + compression : any ZSTD_compressBegin*() variant, including with dictionary\n      + decompression : any ZSTD_decompressBegin*() variant, including with dictionary\n      + copyCCtx() and copyDCtx() can be used too\n    - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB\n      + If input is larger than a block size, it's necessary to split input data into multiple blocks\n      + For inputs larger than a single block, consider using regular ZSTD_compress() instead.\n        Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block.\n    - When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) !\n      ===> In which case, nothing is produced into `dst` !\n      + User __must__ test for such outcome and deal directly with uncompressed data\n      + A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0.\n        Doing so would mess up with statistics history, leading to potential data corruption.\n      + ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !!\n      + In case of multiple successive blocks, should some of them be uncompressed,\n        decoder must be informed of their existence in order to follow proper history.\n        Use ZSTD_insertBlock() for such a case.\n*/\n\n/*=====   Raw zstd block functions  =====*/\nZSTDLIB_API size_t ZSTD_getBlockSize   (const ZSTD_CCtx* cctx);\nZSTDLIB_API size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTDLIB_API size_t ZSTD_insertBlock    (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression. */\n\n\n#endif   /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledAsyncgenType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Compiled Asyncgen.\n *\n * Unlike in CPython, we have one type for just asyncgen, this doesn't do\n * generators nor coroutines.\n *\n * It strives to be full replacement for normal asyncgen.\n *\n * spellchecker: ignore Asend,Athrow\n *\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/freelists.h\"\n#include \"nuitka/prelude.h\"\n#include <structmember.h>\n#endif\n\n// For reporting about reference counts per type.\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Asyncgen_Type = 0;\nint count_allocated_Nuitka_Asyncgen_Type = 0;\nint count_released_Nuitka_Asyncgen_Type = 0;\nint count_active_Nuitka_AsyncgenValueWrapper_Type = 0;\nint count_allocated_Nuitka_AsyncgenValueWrapper_Type = 0;\nint count_released_Nuitka_AsyncgenValueWrapper_Type = 0;\nint count_active_Nuitka_AsyncgenAsend_Type = 0;\nint count_allocated_Nuitka_AsyncgenAsend_Type = 0;\nint count_released_Nuitka_AsyncgenAsend_Type = 0;\nint count_active_Nuitka_AsyncgenAthrow_Type = 0;\nint count_allocated_Nuitka_AsyncgenAthrow_Type = 0;\nint count_released_Nuitka_AsyncgenAthrow_Type = 0;\n#endif\n\nstatic void Nuitka_MarkAsyncgenAsFinished(struct Nuitka_AsyncgenObject *asyncgen) {\n    asyncgen->m_status = status_Finished;\n\n#if PYTHON_VERSION >= 0x3b0\n    if (asyncgen->m_frame) {\n        asyncgen->m_frame->m_frame_state = FRAME_COMPLETED;\n    }\n#endif\n}\n\nstatic void Nuitka_MarkAsyncgenAsRunning(struct Nuitka_AsyncgenObject *asyncgen) {\n    asyncgen->m_running = 1;\n\n    if (asyncgen->m_frame) {\n        Nuitka_Frame_MarkAsExecuting(asyncgen->m_frame);\n    }\n}\n\nstatic void Nuitka_MarkAsyncgenAsNotRunning(struct Nuitka_AsyncgenObject *asyncgen) {\n    asyncgen->m_running = 0;\n\n    if (asyncgen->m_frame) {\n        Nuitka_Frame_MarkAsNotExecuting(asyncgen->m_frame);\n    }\n}\n\nstatic long Nuitka_Asyncgen_tp_hash(struct Nuitka_AsyncgenObject *asyncgen) { return asyncgen->m_counter; }\n\nstatic PyObject *Nuitka_Asyncgen_get_name(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    Py_INCREF(asyncgen->m_name);\n    return asyncgen->m_name;\n}\n\nstatic int Nuitka_Asyncgen_set_name(struct Nuitka_AsyncgenObject *asyncgen, PyObject *value) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(value);\n\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = asyncgen->m_name;\n    Py_INCREF(value);\n    asyncgen->m_name = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Asyncgen_get_qualname(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    Py_INCREF(asyncgen->m_qualname);\n    return asyncgen->m_qualname;\n}\n\nstatic int Nuitka_Asyncgen_set_qualname(struct Nuitka_AsyncgenObject *asyncgen, PyObject *value) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(value);\n\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__qualname__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = asyncgen->m_qualname;\n    Py_INCREF(value);\n    asyncgen->m_qualname = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Asyncgen_get_ag_await(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    if (asyncgen->m_yield_from) {\n        Py_INCREF(asyncgen->m_yield_from);\n        return asyncgen->m_yield_from;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\nstatic PyObject *Nuitka_Asyncgen_get_code(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT(asyncgen->m_code_object);\n\n    Py_INCREF(asyncgen->m_code_object);\n    return (PyObject *)asyncgen->m_code_object;\n}\n\nstatic int Nuitka_Asyncgen_set_code(struct Nuitka_AsyncgenObject *asyncgen, PyObject *value) {\n    CHECK_OBJECT(asyncgen);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"ag_code is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Asyncgen_get_frame(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(asyncgen->m_frame);\n\n    if (asyncgen->m_frame) {\n        Py_INCREF(asyncgen->m_frame);\n        return (PyObject *)asyncgen->m_frame;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\nstatic int Nuitka_Asyncgen_set_frame(struct Nuitka_AsyncgenObject *asyncgen, PyObject *value) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(value);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"ag_frame is not writable in Nuitka\");\n    return -1;\n}\n\nstatic void Nuitka_Asyncgen_release_closure(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    for (Py_ssize_t i = 0; i < asyncgen->m_closure_given; i++) {\n        CHECK_OBJECT(asyncgen->m_closure[i]);\n        Py_DECREF(asyncgen->m_closure[i]);\n    }\n\n    asyncgen->m_closure_given = 0;\n}\n\nstatic PyObject *Nuitka_YieldFromAsyncgenCore(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,\n                                              PyObject *send_value, bool mode) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(send_value);\n\n    PyObject *yield_from = asyncgen->m_yield_from;\n    CHECK_OBJECT(yield_from);\n\n    // Need to make it unaccessible while using it.\n    asyncgen->m_yield_from = NULL;\n\n    PyObject *returned_value;\n    PyObject *yielded = _Nuitka_YieldFromCore(tstate, yield_from, send_value, &returned_value, mode);\n\n    if (yielded == NULL) {\n        assert(asyncgen->m_yield_from == NULL);\n        Py_DECREF(yield_from);\n\n        yielded = ((asyncgen_code)asyncgen->m_code)(tstate, asyncgen, returned_value);\n    } else {\n        assert(asyncgen->m_yield_from == NULL);\n        asyncgen->m_yield_from = yield_from;\n    }\n\n    return yielded;\n}\n\n#if _DEBUG_ASYNCGEN\nNUITKA_MAY_BE_UNUSED static void _PRINT_ASYNCGEN_STATUS(char const *descriptor, char const *context,\n                                                        struct Nuitka_AsyncgenObject *asyncgen) {\n    char const *status;\n\n    switch (asyncgen->m_status) {\n    case status_Finished:\n        status = \"(finished)\";\n        break;\n    case status_Running:\n        status = \"(running)\";\n        break;\n    case status_Unused:\n        status = \"(unused)\";\n        break;\n    default:\n        status = \"(ILLEGAL)\";\n        break;\n    }\n\n    PRINT_STRING(descriptor);\n    PRINT_STRING(\" : \");\n    PRINT_STRING(context);\n    PRINT_STRING(\" \");\n    PRINT_ITEM((PyObject *)asyncgen);\n    PRINT_STRING(\" \");\n    PRINT_STRING(status);\n    PRINT_NEW_LINE();\n}\n\n#define PRINT_ASYNCGEN_STATUS(context, asyncgen) _PRINT_ASYNCGEN_STATUS(__FUNCTION__, context, asyncgen)\n\n#endif\n\nstatic PyObject *Nuitka_YieldFromAsyncgenNext(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_NEW_LINE();\n#endif\n    PyObject *result = Nuitka_YieldFromAsyncgenCore(tstate, asyncgen, Py_None, true);\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_YieldFromAsyncgenInitial(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,\n                                                 PyObject *send_value) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(send_value);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_NEW_LINE();\n#endif\n    PyObject *result = Nuitka_YieldFromAsyncgenCore(tstate, asyncgen, send_value, false);\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_AsyncgenValueWrapper_New(PyObject *value);\n\nstatic PySendResult _Nuitka_Asyncgen_sendR(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,\n                                           PyObject *value, bool closing,\n                                           struct Nuitka_ExceptionPreservationItem *exception_state,\n                                           PyObject **result) {\n    CHECK_OBJECT(asyncgen);\n    assert(Nuitka_Asyncgen_Check((PyObject *)asyncgen));\n    CHECK_OBJECT_X(value);\n    CHECK_EXCEPTION_STATE_X(exception_state);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"value\", value);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    if (value != NULL) {\n        ASSERT_EMPTY_EXCEPTION_STATE(exception_state);\n    }\n\n    if (asyncgen->m_status == status_Unused && value != NULL && value != Py_None) {\n        // No exception if value is given.\n        Py_XDECREF(value);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"can't send non-None value to a just-started async generator\");\n        return PYGEN_ERROR;\n    }\n\n    if (asyncgen->m_status != status_Finished) {\n        if (asyncgen->m_running) {\n            Py_XDECREF(value);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"async generator already executing\");\n            return PYGEN_ERROR;\n        }\n        // Put the asyncgen back on the frame stack.\n        Nuitka_ThreadStateFrameType *return_frame = _Nuitka_GetThreadStateFrame(tstate);\n\n        // Consider it as running.\n        if (asyncgen->m_status == status_Unused) {\n            asyncgen->m_status = status_Running;\n            assert(asyncgen->m_resume_frame == NULL);\n\n            // Value will not be used, can only be Py_None or NULL.\n            Py_XDECREF(value);\n            value = NULL;\n        } else {\n            assert(asyncgen->m_resume_frame);\n            pushFrameStackGenerator(tstate, asyncgen->m_resume_frame);\n\n            asyncgen->m_resume_frame = NULL;\n        }\n\n        // Continue the yielder function while preventing recursion.\n        asyncgen->m_running = true;\n\n        // Check for thrown exception, and publish it.\n        if (unlikely(HAS_EXCEPTION_STATE(exception_state))) {\n            assert(value == NULL);\n\n            // Transfer exception ownership to published.\n            RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n        }\n\n        if (asyncgen->m_frame) {\n            Nuitka_Frame_MarkAsExecuting(asyncgen->m_frame);\n        }\n\n#if _DEBUG_ASYNCGEN\n        PRINT_ASYNCGEN_STATUS(\"Switching to asyncgen\", asyncgen);\n        PRINT_COROUTINE_VALUE(\"value\", value);\n        PRINT_CURRENT_EXCEPTION();\n        PRINT_NEW_LINE();\n        // dumpFrameStack();\n#endif\n\n        PyObject *yielded;\n\n        if (asyncgen->m_yield_from == NULL) {\n            yielded = ((asyncgen_code)asyncgen->m_code)(tstate, asyncgen, value);\n        } else {\n            // This does not release the value if any, so we need to do it afterwards.\n            yielded = Nuitka_YieldFromAsyncgenInitial(tstate, asyncgen, value);\n            Py_XDECREF(value);\n        }\n\n        // If the asyncgen returns with m_yield_from set, it wants us to yield\n        // from that value from now on.\n        while (yielded == NULL && asyncgen->m_yield_from != NULL) {\n            yielded = Nuitka_YieldFromAsyncgenNext(tstate, asyncgen);\n        }\n\n        Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n\n        tstate = PyThreadState_GET();\n\n        // Remove the back frame from asyncgen if it's there.\n        if (asyncgen->m_frame) {\n            // assert(tstate->frame == &asyncgen->m_frame->m_frame);\n            assertFrameObject(asyncgen->m_frame);\n\n            Py_CLEAR(asyncgen->m_frame->m_frame.f_back);\n\n            // Remember where to resume from.\n            asyncgen->m_resume_frame = _Nuitka_GetThreadStateFrame(tstate);\n        }\n\n        // Return back to the frame that called us.\n        _Nuitka_GeneratorPopFrame(tstate, return_frame);\n\n#if _DEBUG_ASYNCGEN\n        PRINT_ASYNCGEN_STATUS(\"Returned from coroutine\", asyncgen);\n        // dumpFrameStack();\n#endif\n\n#ifndef __NUITKA_NO_ASSERT__\n        if (return_frame) {\n            assertThreadFrameObject(return_frame);\n        }\n#endif\n\n        if (yielded == NULL) {\n#if _DEBUG_ASYNCGEN\n            PRINT_ASYNCGEN_STATUS(\"finishing from yield\", asyncgen);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_STRING(\"-> finishing asyncgen with exception sets status_Finished\\n\");\n            PRINT_NEW_LINE();\n#endif\n            Nuitka_MarkAsyncgenAsFinished(asyncgen);\n\n            if (asyncgen->m_frame != NULL) {\n                Nuitka_SetFrameGenerator(asyncgen->m_frame, NULL);\n                Py_DECREF(asyncgen->m_frame);\n                asyncgen->m_frame = NULL;\n            }\n\n            Nuitka_Asyncgen_release_closure(asyncgen);\n\n            PyObject *error_occurred = GET_ERROR_OCCURRED(tstate);\n\n            if (error_occurred == PyExc_StopIteration || error_occurred == PyExc_StopAsyncIteration) {\n                char const *message;\n                if (error_occurred == PyExc_StopIteration) {\n                    message = \"async generator raised StopIteration\";\n                } else {\n                    message = \"async generator raised StopAsyncIteration\";\n                }\n\n                RAISE_RUNTIME_ERROR_RAISED_STOP_ITERATION(tstate, message);\n                return PYGEN_ERROR;\n            }\n\n            return PYGEN_ERROR;\n        } else {\n            // For normal yield, wrap the result value before returning.\n            if (asyncgen->m_yield_from == NULL) {\n                // Transferred ownership to constructor of Nuitka_AsyncgenValueWrapper\n                PyObject *wrapped = Nuitka_AsyncgenValueWrapper_New(yielded);\n                yielded = wrapped;\n\n                assert(yielded != NULL);\n            }\n\n            *result = yielded;\n            return PYGEN_NEXT;\n        }\n    } else {\n        Py_XDECREF(value);\n\n        // Release exception if any, we are finished with it and will raise another.\n        RELEASE_ERROR_OCCURRED_STATE_X(exception_state);\n\n        return PYGEN_RETURN;\n    }\n}\n\nstatic PyObject *_Nuitka_Asyncgen_send(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen, PyObject *value,\n                                       bool closing, struct Nuitka_ExceptionPreservationItem *exception_state) {\n\n    PyObject *result;\n    PySendResult res = _Nuitka_Asyncgen_sendR(tstate, asyncgen, value, closing, exception_state, &result);\n\n    switch (res) {\n    case PYGEN_RETURN:\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n        return NULL;\n    case PYGEN_NEXT:\n        return result;\n    case PYGEN_ERROR:\n        return NULL;\n    default:\n        NUITKA_CANNOT_GET_HERE(\"invalid PYGEN_ result\");\n    }\n}\n\n// Note: Used by compiled frames.\nstatic bool _Nuitka_Asyncgen_close(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n#endif\n    CHECK_OBJECT(asyncgen);\n\n    if (asyncgen->m_status == status_Running) {\n        struct Nuitka_ExceptionPreservationItem exception_state;\n        SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, PyExc_GeneratorExit, NULL, NULL);\n\n        PyObject *result = _Nuitka_Asyncgen_send(tstate, asyncgen, NULL, true, &exception_state);\n\n        if (unlikely(result)) {\n            Py_DECREF(result);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"async generator ignored GeneratorExit\");\n            return false;\n        } else {\n            return DROP_ERROR_OCCURRED_GENERATOR_EXIT_OR_STOP_ITERATION(tstate);\n        }\n    }\n\n    return true;\n}\n\nstatic bool _Nuitka_Generator_check_throw2(PyThreadState *tstate,\n                                           struct Nuitka_ExceptionPreservationItem *exception_state);\n\n// This function is called when yielding to a asyncgen through \"_Nuitka_YieldFromPassExceptionTo\"\n// and potentially wrapper objects used by generators, or by the throw method itself.\n// Note:\n//   Exception arguments are passed for ownership and must be released before returning. The\n//   value of exception_type will not be NULL, but the actual exception will not necessarily\n//   be normalized.\nstatic PyObject *_Nuitka_Asyncgen_throw2(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,\n                                         bool close_on_genexit,\n                                         struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT(asyncgen);\n    assert(Nuitka_Asyncgen_Check((PyObject *)asyncgen));\n    CHECK_EXCEPTION_STATE(exception_state);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"yield_from\", asyncgen->m_yield_from);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_NEW_LINE();\n#endif\n\n    if (asyncgen->m_yield_from != NULL) {\n        // TODO: This check is not done for coroutines, correct?\n        if (close_on_genexit) {\n            if (EXCEPTION_STATE_MATCH_BOOL_SINGLE(tstate, exception_state, PyExc_GeneratorExit)) {\n                // Asynchronous generators need to close the yield_from.\n                Nuitka_MarkAsyncgenAsRunning(asyncgen);\n                bool res = Nuitka_gen_close_iter(tstate, asyncgen->m_yield_from);\n                Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n\n                if (res == false) {\n                    // Release exception, we are done with it now and pick up the new one.\n                    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n                    FETCH_ERROR_OCCURRED_STATE(tstate, exception_state);\n                }\n\n                return _Nuitka_Asyncgen_send(tstate, asyncgen, NULL, false, exception_state);\n            }\n        }\n\n        PyObject *ret;\n\n#if _DEBUG_ASYNCGEN\n        PRINT_ASYNCGEN_STATUS(\"Passing to yielded from\", asyncgen);\n        PRINT_COROUTINE_VALUE(\"m_yield_from\", asyncgen->m_yield_from);\n        PRINT_NEW_LINE();\n#endif\n\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n        if (PyGen_CheckExact(asyncgen->m_yield_from) || PyCoro_CheckExact(asyncgen->m_yield_from)) {\n            PyGenObject *gen = (PyGenObject *)asyncgen->m_yield_from;\n\n            // Transferred exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = Nuitka_UncompiledGenerator_throw(tstate, gen, 1, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n        } else\n#endif\n            if (Nuitka_Generator_Check(asyncgen->m_yield_from)) {\n            struct Nuitka_GeneratorObject *gen = ((struct Nuitka_GeneratorObject *)asyncgen->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Generator_throw2\".\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = _Nuitka_Generator_throw2(tstate, gen, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n        } else if (Nuitka_Coroutine_Check(asyncgen->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro = ((struct Nuitka_CoroutineObject *)asyncgen->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n        } else if (Nuitka_CoroutineWrapper_Check(asyncgen->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro =\n                ((struct Nuitka_CoroutineWrapperObject *)asyncgen->m_yield_from)->m_coroutine;\n\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n        } else if (Nuitka_AsyncgenAsend_Check(asyncgen->m_yield_from)) {\n            struct Nuitka_AsyncgenAsendObject *asyncgen_asend =\n                ((struct Nuitka_AsyncgenAsendObject *)asyncgen->m_yield_from);\n\n            // Transferred exception ownership to \"_Nuitka_AsyncgenAsend_throw2\".\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = _Nuitka_AsyncgenAsend_throw2(tstate, asyncgen_asend, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n        } else {\n            PyObject *meth = PyObject_GetAttr(asyncgen->m_yield_from, const_str_plain_throw);\n\n            if (unlikely(meth == NULL)) {\n                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n                    // Release exception, we are done with it now.\n                    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                    return NULL;\n                }\n\n                CLEAR_ERROR_OCCURRED(tstate);\n\n                // Passing exception ownership to that code.\n                goto throw_here;\n            }\n\n            CHECK_EXCEPTION_STATE(exception_state);\n\n#if 0\n            // TODO: Add slow mode traces.\n            PRINT_ITEM(coroutine->m_yield_from);\n            PRINT_NEW_LINE();\n#endif\n\n            Nuitka_MarkAsyncgenAsRunning(asyncgen);\n            ret = Nuitka_CallGeneratorThrowMethod(meth, exception_state);\n            Nuitka_MarkAsyncgenAsNotRunning(asyncgen);\n\n            Py_DECREF(meth);\n\n            // Release exception, we are done with it now.\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n        }\n\n        if (unlikely(ret == NULL)) {\n            PyObject *val;\n\n            if (_PyGen_FetchStopIterationValue(&val) == 0) {\n                CHECK_OBJECT(val);\n\n                asyncgen->m_yield_from = NULL;\n\n                // Return value, not to continue with yielding from.\n                if (asyncgen->m_yield_from != NULL) {\n                    CHECK_OBJECT(asyncgen->m_yield_from);\n#if _DEBUG_ASYNCGEN\n                    PRINT_ASYNCGEN_STATUS(\"Yield from removal:\", asyncgen);\n                    PRINT_COROUTINE_VALUE(\"yield_from\", asyncgen->m_yield_from);\n#endif\n                    Py_DECREF(asyncgen->m_yield_from);\n                    asyncgen->m_yield_from = NULL;\n                }\n\n#if _DEBUG_ASYNCGEN\n                PRINT_ASYNCGEN_STATUS(\"Sending return value into ourselves\", asyncgen);\n                PRINT_COROUTINE_VALUE(\"value\", val);\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                ret = _Nuitka_Asyncgen_send(tstate, asyncgen, val, false, &no_exception_state);\n            } else {\n#if _DEBUG_ASYNCGEN\n                PRINT_ASYNCGEN_STATUS(\"Sending exception value into ourselves\", asyncgen);\n                PRINT_COROUTINE_VALUE(\"yield_from\", asyncgen->m_yield_from);\n                PRINT_CURRENT_EXCEPTION();\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                ret = _Nuitka_Asyncgen_send(tstate, asyncgen, NULL, false, &no_exception_state);\n            }\n\n#if _DEBUG_ASYNCGEN\n            PRINT_ASYNCGEN_STATUS(\"Leave with value/exception from sending into ourselves:\", asyncgen);\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        } else {\n#if _DEBUG_ASYNCGEN\n            PRINT_ASYNCGEN_STATUS(\"Leave with return value:\", asyncgen);\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        }\n\n        return ret;\n    }\n\nthrow_here:\n    // We continue to have exception ownership here.\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Need to throw into itself\", asyncgen);\n#endif\n\n    if (unlikely(_Nuitka_Generator_check_throw2(tstate, exception_state) == false)) {\n        // Exception was released by _Nuitka_Generator_check_throw2 already.\n        return NULL;\n    }\n\n    PyObject *result;\n\n    if (asyncgen->m_status == status_Running) {\n        result = _Nuitka_Asyncgen_send(tstate, asyncgen, NULL, false, exception_state);\n    } else if (asyncgen->m_status == status_Finished) {\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n        result = NULL;\n    } else {\n        PyTracebackObject *exception_tb = GET_EXCEPTION_STATE_TRACEBACK(exception_state);\n\n        if (exception_tb == NULL) {\n            // TODO: Our compiled objects really need a way to store common\n            // stuff in a \"shared\" part across all instances, and outside of\n            // run time, so we could reuse this.\n            struct Nuitka_FrameObject *frame =\n                MAKE_FUNCTION_FRAME(tstate, asyncgen->m_code_object, asyncgen->m_module, 0);\n            SET_EXCEPTION_STATE_TRACEBACK(exception_state,\n                                          MAKE_TRACEBACK(frame, asyncgen->m_code_object->co_firstlineno));\n            Py_DECREF(frame);\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n#if _DEBUG_ASYNCGEN\n        PRINT_ASYNCGEN_STATUS(\"Finishing from exception\", asyncgen);\n        PRINT_NEW_LINE();\n#endif\n\n        Nuitka_MarkAsyncgenAsFinished(asyncgen);\n\n        result = NULL;\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"yield_from\", asyncgen->m_yield_from);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_Asyncgen_throw(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen, PyObject *args) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_DEEP(args);\n\n    PyObject *exception_type;\n    PyObject *exception_value = NULL;\n    PyTracebackObject *exception_tb = NULL;\n\n    // This takes no references, that is for us to do.\n    int res = PyArg_UnpackTuple(args, \"throw\", 1, 3, &exception_type, &exception_value, &exception_tb);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_EXCEPTION(exception_type, exception_value, exception_tb);\n    PRINT_NEW_LINE();\n#endif\n\n    // Handing ownership of exception over, we need not release it ourselves\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, exception_type, exception_value, exception_tb);\n\n    PyObject *result = _Nuitka_Asyncgen_throw2(tstate, asyncgen, false, &exception_state);\n\n    if (result == NULL) {\n        if (HAS_ERROR_OCCURRED(tstate) == false) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n        }\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"return value\", result);\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    CHECK_EXCEPTION_STATE(&exception_state);\n\n    return result;\n}\n\nstatic int _Nuitka_Asyncgen_init_hooks(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen) {\n    /* Just do this once per async generator object. */\n    if (asyncgen->m_hooks_init_done) {\n        return 0;\n    }\n    asyncgen->m_hooks_init_done = 1;\n\n    /* Attach the finalizer if any. */\n    PyObject *finalizer = tstate->async_gen_finalizer;\n    if (finalizer != NULL) {\n        Py_INCREF(finalizer);\n        asyncgen->m_finalizer = finalizer;\n    }\n\n    /* Call the \"firstiter\" hook for async generator. */\n    PyObject *firstiter = tstate->async_gen_firstiter;\n    if (firstiter != NULL) {\n        Py_INCREF(firstiter);\n\n        PyObject *res = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, firstiter, (PyObject *)asyncgen);\n\n        Py_DECREF(firstiter);\n\n        if (unlikely(res == NULL)) {\n            return 1;\n        }\n\n        Py_DECREF(res);\n    }\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_New(struct Nuitka_AsyncgenObject *asyncgen, PyObject *sendval);\nstatic PyObject *Nuitka_AsyncgenAthrow_New(struct Nuitka_AsyncgenObject *asyncgen, PyObject *args);\n\nstatic PyObject *Nuitka_Asyncgen_anext(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n    PRINT_NEW_LINE();\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (_Nuitka_Asyncgen_init_hooks(tstate, asyncgen)) {\n        return NULL;\n    }\n\n    PyObject *result = Nuitka_AsyncgenAsend_New(asyncgen, Py_None);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_Asyncgen_asend(struct Nuitka_AsyncgenObject *asyncgen, PyObject *value) {\n    CHECK_OBJECT(asyncgen);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (_Nuitka_Asyncgen_init_hooks(tstate, asyncgen)) {\n        return NULL;\n    }\n\n    return Nuitka_AsyncgenAsend_New(asyncgen, value);\n}\n\nstatic PyObject *Nuitka_Asyncgen_aclose(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (_Nuitka_Asyncgen_init_hooks(tstate, asyncgen)) {\n        return NULL;\n    }\n\n    return Nuitka_AsyncgenAthrow_New(asyncgen, NULL);\n}\n\nstatic PyObject *Nuitka_Asyncgen_athrow(struct Nuitka_AsyncgenObject *asyncgen, PyObject *args) {\n    CHECK_OBJECT(asyncgen);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (_Nuitka_Asyncgen_init_hooks(tstate, asyncgen)) {\n        return NULL;\n    }\n\n    return Nuitka_AsyncgenAthrow_New(asyncgen, args);\n}\n\n#if PYTHON_VERSION >= 0x3a0\nstatic PySendResult _Nuitka_Asyncgen_am_send(struct Nuitka_AsyncgenObject *asyncgen, PyObject *arg, PyObject **result) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Enter\", asyncgen);\n#endif\n\n    *result = NULL;\n    Py_INCREF(arg);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PySendResult res = _Nuitka_Asyncgen_sendR(tstate, asyncgen, arg, false, &exception_state, result);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGEN_STATUS(\"Leave\", asyncgen);\n    PRINT_COROUTINE_VALUE(\"result\", *result);\n    PRINT_NEW_LINE();\n#endif\n    return res;\n}\n#endif\n\nstatic void Nuitka_Asyncgen_tp_finalize(struct Nuitka_AsyncgenObject *asyncgen) {\n    if (asyncgen->m_status != status_Running) {\n        return;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    bool close_result = _Nuitka_Asyncgen_close(tstate, asyncgen);\n\n    if (unlikely(close_result == false)) {\n        PyErr_WriteUnraisable((PyObject *)asyncgen);\n    }\n\n    /* Restore the saved exception if any. */\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\n#define MAX_ASYNCGEN_FREE_LIST_COUNT 100\nstatic struct Nuitka_AsyncgenObject *free_list_asyncgens = NULL;\nstatic int free_list_asyncgens_count = 0;\n\n// TODO: This might have to be finalize actually.\nstatic void Nuitka_Asyncgen_tp_dealloc(struct Nuitka_AsyncgenObject *asyncgen) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Asyncgen_Type -= 1;\n    count_released_Nuitka_Asyncgen_Type += 1;\n#endif\n\n    // Revive temporarily.\n    assert(Py_REFCNT(asyncgen) == 0);\n    Py_SET_REFCNT(asyncgen, 1);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // Save the current exception, if any, we must preserve it.\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n    PyObject *finalizer = asyncgen->m_finalizer;\n    if (finalizer != NULL && asyncgen->m_closed == false) {\n        // Save the current exception, if any.\n        FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n        PyObject *res = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, finalizer, (PyObject *)asyncgen);\n\n        if (unlikely(res == NULL)) {\n            PyErr_WriteUnraisable((PyObject *)asyncgen);\n        } else {\n            Py_DECREF(res);\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n        return;\n    }\n\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    bool close_result = _Nuitka_Asyncgen_close(tstate, asyncgen);\n\n    if (unlikely(close_result == false)) {\n        PyErr_WriteUnraisable((PyObject *)asyncgen);\n    }\n\n    Nuitka_Asyncgen_release_closure(asyncgen);\n\n    // Allow for above code to resurrect the coroutine, do not release the object\n    // like Py_DECREF would.\n    Py_SET_REFCNT(asyncgen, Py_REFCNT(asyncgen) - 1);\n    if (Py_REFCNT(asyncgen) >= 1) {\n        return;\n    }\n\n    if (asyncgen->m_frame) {\n        Nuitka_SetFrameGenerator(asyncgen->m_frame, NULL);\n        Py_DECREF(asyncgen->m_frame);\n        asyncgen->m_frame = NULL;\n    }\n\n    // Now it is safe to release references and memory for it.\n    Nuitka_GC_UnTrack(asyncgen);\n\n    Py_XDECREF(asyncgen->m_finalizer);\n\n    if (asyncgen->m_weakrefs != NULL) {\n        PyObject_ClearWeakRefs((PyObject *)asyncgen);\n        assert(!HAS_ERROR_OCCURRED(tstate));\n    }\n\n    Py_DECREF(asyncgen->m_name);\n    Py_DECREF(asyncgen->m_qualname);\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_asyncgens, asyncgen, MAX_ASYNCGEN_FREE_LIST_COUNT);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\nstatic PyObject *Nuitka_Asyncgen_tp_repr(struct Nuitka_AsyncgenObject *asyncgen) {\n    CHECK_OBJECT(asyncgen);\n\n    return PyUnicode_FromFormat(\"<compiled_async_generator object %s at %p>\",\n                                Nuitka_String_AsString(asyncgen->m_qualname), asyncgen);\n}\n\nstatic int Nuitka_Asyncgen_tp_traverse(struct Nuitka_AsyncgenObject *asyncgen, visitproc visit, void *arg) {\n    CHECK_OBJECT(asyncgen);\n\n    Py_VISIT(asyncgen->m_yield_from);\n\n    for (Py_ssize_t i = 0; i < asyncgen->m_closure_given; i++) {\n        Py_VISIT(asyncgen->m_closure[i]);\n    }\n\n    Py_VISIT(asyncgen->m_frame);\n\n    Py_VISIT(asyncgen->m_finalizer);\n\n    return 0;\n}\n\n// TODO: Set \"__doc__\" automatically for method clones of compiled types from\n// the documentation of built-in original type.\nstatic PyMethodDef Nuitka_Asyncgen_methods[] = {{\"asend\", (PyCFunction)Nuitka_Asyncgen_asend, METH_O, NULL},\n                                                {\"athrow\", (PyCFunction)Nuitka_Asyncgen_athrow, METH_VARARGS, NULL},\n                                                {\"aclose\", (PyCFunction)Nuitka_Asyncgen_aclose, METH_NOARGS, NULL},\n                                                {NULL}};\n\nstatic PyAsyncMethods Nuitka_Asyncgen_as_async = {\n    0,                               // am_await\n    0,                               // am_aiter (PyObject_SelfIter)\n    (unaryfunc)Nuitka_Asyncgen_anext // am_anext\n#if PYTHON_VERSION >= 0x3a0\n    ,\n    (sendfunc)_Nuitka_Asyncgen_am_send // am_send\n#endif\n};\n\n// TODO: Set \"__doc__\" automatically for method clones of compiled types from\n// the documentation of built-in original type.\nstatic PyGetSetDef Nuitka_Asyncgen_getsetlist[] = {\n    {(char *)\"__name__\", (getter)Nuitka_Asyncgen_get_name, (setter)Nuitka_Asyncgen_set_name, NULL},\n    {(char *)\"__qualname__\", (getter)Nuitka_Asyncgen_get_qualname, (setter)Nuitka_Asyncgen_set_qualname, NULL},\n    {(char *)\"ag_await\", (getter)Nuitka_Asyncgen_get_ag_await, (setter)NULL, NULL},\n    {(char *)\"ag_code\", (getter)Nuitka_Asyncgen_get_code, (setter)Nuitka_Asyncgen_set_code, NULL},\n    {(char *)\"ag_frame\", (getter)Nuitka_Asyncgen_get_frame, (setter)Nuitka_Asyncgen_set_frame, NULL},\n\n    {NULL}};\n\nstatic PyMemberDef Nuitka_Asyncgen_members[] = {\n    {(char *)\"ag_running\", T_BOOL, offsetof(struct Nuitka_AsyncgenObject, m_running), READONLY},\n#if PYTHON_VERSION >= 0x380\n    {(char *)\"ag_running\", T_BOOL, offsetof(struct Nuitka_AsyncgenObject, m_running_async), READONLY},\n#endif\n    {NULL}};\n\nPyTypeObject Nuitka_Asyncgen_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_async_generator\",          // tp_name\n    sizeof(struct Nuitka_AsyncgenObject),                               // tp_basicsize\n    sizeof(struct Nuitka_CellObject *),                                 // tp_itemsize\n    (destructor)Nuitka_Asyncgen_tp_dealloc,                             // tp_dealloc\n    0,                                                                  // tp_print\n    0,                                                                  // tp_getattr\n    0,                                                                  // tp_setattr\n    &Nuitka_Asyncgen_as_async,                                          // tp_as_async\n    (reprfunc)Nuitka_Asyncgen_tp_repr,                                  // tp_repr\n    0,                                                                  // tp_as_number\n    0,                                                                  // tp_as_sequence\n    0,                                                                  // tp_as_mapping\n    (hashfunc)Nuitka_Asyncgen_tp_hash,                                  // tp_hash\n    0,                                                                  // tp_call\n    0,                                                                  // tp_str\n    0,                                                                  // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                                  // tp_setattro\n    0,                                                                  // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, // tp_flags\n    0,                                                                  // tp_doc\n    (traverseproc)Nuitka_Asyncgen_tp_traverse,                          // tp_traverse\n    0,                                                                  // tp_clear\n    0,                                                                  // tp_richcompare\n    offsetof(struct Nuitka_AsyncgenObject, m_weakrefs),                 // tp_weaklistoffset\n    0,                                                                  // tp_iter\n    0,                                                                  // tp_iternext\n    Nuitka_Asyncgen_methods,                                            // tp_methods\n    Nuitka_Asyncgen_members,                                            // tp_members\n    Nuitka_Asyncgen_getsetlist,                                         // tp_getset\n    0,                                                                  // tp_base\n    0,                                                                  // tp_dict\n    0,                                                                  // tp_descr_get\n    0,                                                                  // tp_descr_set\n    0,                                                                  // tp_dictoffset\n    0,                                                                  // tp_init\n    0,                                                                  // tp_alloc\n    0,                                                                  // tp_new\n    0,                                                                  // tp_free\n    0,                                                                  // tp_is_gc\n    0,                                                                  // tp_bases\n    0,                                                                  // tp_mro\n    0,                                                                  // tp_cache\n    0,                                                                  // tp_subclasses\n    0,                                                                  // tp_weaklist\n    0,                                                                  // tp_del\n    0,                                                                  // tp_version_tag\n    (destructor)Nuitka_Asyncgen_tp_finalize,                            // tp_finalize\n\n};\n\nPyObject *Nuitka_Asyncgen_New(asyncgen_code code, PyObject *module, PyObject *name, PyObject *qualname,\n                              PyCodeObject *code_object, struct Nuitka_CellObject **closure, Py_ssize_t closure_given,\n                              Py_ssize_t heap_storage_size) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Asyncgen_Type += 1;\n    count_allocated_Nuitka_Asyncgen_Type += 1;\n#endif\n\n    struct Nuitka_AsyncgenObject *result;\n\n    // TODO: Change the var part of the type to 1 maybe\n    Py_ssize_t full_size = closure_given + (heap_storage_size + sizeof(void *) - 1) / sizeof(void *);\n\n    // Macro to assign result memory from GC or free list.\n    allocateFromFreeList(free_list_asyncgens, struct Nuitka_AsyncgenObject, Nuitka_Asyncgen_Type, full_size);\n\n    // For quicker access of generator heap.\n    result->m_heap_storage = &result->m_closure[closure_given];\n\n    result->m_code = (void *)code;\n\n    CHECK_OBJECT(module);\n    result->m_module = module;\n\n    CHECK_OBJECT(name);\n    result->m_name = name;\n    Py_INCREF(name);\n\n    // The \"qualname\" defaults to NULL for most compact C code.\n    if (qualname == NULL) {\n        qualname = name;\n    }\n    CHECK_OBJECT(qualname);\n\n    result->m_qualname = qualname;\n    Py_INCREF(qualname);\n\n    result->m_yield_from = NULL;\n\n    memcpy(&result->m_closure[0], closure, closure_given * sizeof(struct Nuitka_CellObject *));\n    result->m_closure_given = closure_given;\n\n    result->m_weakrefs = NULL;\n\n    result->m_status = status_Unused;\n    result->m_running = false;\n    result->m_awaiting = false;\n#if PYTHON_VERSION >= 0x380\n    result->m_running_async = false;\n#endif\n\n    result->m_yield_return_index = 0;\n\n    result->m_frame = NULL;\n    result->m_code_object = code_object;\n\n    result->m_resume_frame = NULL;\n\n    result->m_finalizer = NULL;\n    result->m_hooks_init_done = false;\n    result->m_closed = false;\n\n#if PYTHON_VERSION >= 0x370\n    result->m_exc_state = Nuitka_ExceptionStackItem_Empty;\n#endif\n\n    static long Nuitka_Asyncgen_counter = 0;\n    result->m_counter = Nuitka_Asyncgen_counter++;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\nstruct Nuitka_AsyncgenWrappedValueObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *m_value;\n};\n\nstatic struct Nuitka_AsyncgenWrappedValueObject *free_list_asyncgen_value_wrappers = NULL;\nstatic int free_list_asyncgen_value_wrappers_count = 0;\n\nstatic void Nuitka_AsyncgenValueWrapper_tp_dealloc(struct Nuitka_AsyncgenWrappedValueObject *asyncgen_value_wrapper) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenValueWrapper_Type -= 1;\n    count_released_Nuitka_AsyncgenValueWrapper_Type += 1;\n#endif\n\n    Nuitka_GC_UnTrack((PyObject *)asyncgen_value_wrapper);\n\n    CHECK_OBJECT(asyncgen_value_wrapper->m_value);\n    Py_DECREF(asyncgen_value_wrapper->m_value);\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_asyncgen_value_wrappers, asyncgen_value_wrapper, MAX_ASYNCGEN_FREE_LIST_COUNT);\n}\n\nstatic int Nuitka_AsyncgenValueWrapper_tp_traverse(struct Nuitka_AsyncgenWrappedValueObject *asyncgen_value_wrapper,\n                                                   visitproc visit, void *arg) {\n    CHECK_OBJECT(asyncgen_value_wrapper);\n\n    Py_VISIT(asyncgen_value_wrapper->m_value);\n\n    return 0;\n}\n\nstatic PyTypeObject Nuitka_AsyncgenValueWrapper_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_async_generator_wrapped_value\", // tp_name\n    sizeof(struct Nuitka_AsyncgenWrappedValueObject),                        // tp_basicsize\n    0,                                                                       // tp_itemsize\n    (destructor)Nuitka_AsyncgenValueWrapper_tp_dealloc,                      // tp_dealloc\n    0,                                                                       // tp_print\n    0,                                                                       // tp_getattr\n    0,                                                                       // tp_setattr\n    0,                                                                       // tp_as_async\n    0,                                                                       // tp_repr\n    0,                                                                       // tp_as_number\n    0,                                                                       // tp_as_sequence\n    0,                                                                       // tp_as_mapping\n    0,                                                                       // tp_hash\n    0,                                                                       // tp_call\n    0,                                                                       // tp_str\n    0,                                                                       // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                                       // tp_setattro\n    0,                                                                       // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,      // tp_flags\n    0,                                                                       // tp_doc\n    (traverseproc)Nuitka_AsyncgenValueWrapper_tp_traverse,                   // tp_traverse\n    0,                                                                       // tp_clear\n    0,                                                                       // tp_richcompare\n    0,                                                                       // tp_weaklistoffset\n    0,                                                                       // tp_iter\n    0,                                                                       // tp_iternext\n    0,                                                                       // tp_methods\n    0,                                                                       // tp_members\n    0,                                                                       // tp_getset\n    0,                                                                       // tp_base\n    0,                                                                       // tp_dict\n    0,                                                                       // tp_descr_get\n    0,                                                                       // tp_descr_set\n    0,                                                                       // tp_dictoffset\n    0,                                                                       // tp_init\n    0,                                                                       // tp_alloc\n    0,                                                                       // tp_new\n};\n\n// Note: This expects a reference given in value, because that is the\n// only way we use it.\nstatic PyObject *Nuitka_AsyncgenValueWrapper_New(PyObject *value) {\n    CHECK_OBJECT(value);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenValueWrapper_Type += 1;\n#endif\n\n    struct Nuitka_AsyncgenWrappedValueObject *result;\n\n    allocateFromFreeListFixed(free_list_asyncgen_value_wrappers, struct Nuitka_AsyncgenWrappedValueObject,\n                              Nuitka_AsyncgenValueWrapper_Type);\n\n    result->m_value = value;\n\n    Nuitka_GC_Track(result);\n\n    return (PyObject *)result;\n}\n\n#define Nuitka_AsyncgenWrappedValue_CheckExact(o) (Py_TYPE(o) == &Nuitka_AsyncgenValueWrapper_Type)\n\ntypedef enum {\n    AWAITABLE_STATE_INIT = 0,   /* Has not yet been iterated. */\n    AWAITABLE_STATE_ITER = 1,   /* Being iterated currently. */\n    AWAITABLE_STATE_CLOSED = 2, /* Closed, no more. */\n} AwaitableState;\n\nstruct Nuitka_AsyncgenAsendObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        struct Nuitka_AsyncgenObject *m_gen;\n    PyObject *m_sendval;\n\n    AwaitableState m_state;\n};\n\n#if _DEBUG_ASYNCGEN\n\nNUITKA_MAY_BE_UNUSED static void _PRINT_ASYNCGENASEND_STATUS(char const *descriptor, char const *context,\n                                                             struct Nuitka_AsyncgenAsendObject *asyncgen_asend) {\n    char const *status;\n\n    switch (asyncgen_asend->m_state) {\n    case AWAITABLE_STATE_INIT:\n        status = \"(init)\";\n        break;\n    case AWAITABLE_STATE_ITER:\n        status = \"(iter)\";\n        break;\n    case AWAITABLE_STATE_CLOSED:\n        status = \"(closed)\";\n        break;\n    default:\n        status = \"(ILLEGAL)\";\n        break;\n    }\n\n    PRINT_STRING(descriptor);\n    PRINT_STRING(\" : \");\n    PRINT_STRING(context);\n    PRINT_STRING(\" \");\n    PRINT_ITEM((PyObject *)asyncgen_asend);\n    PRINT_STRING(\" \");\n    PRINT_STRING(status);\n    PRINT_NEW_LINE();\n}\n\n#define PRINT_ASYNCGENASEND_STATUS(context, asyncgen_asend)                                                            \\\n    _PRINT_ASYNCGENASEND_STATUS(__FUNCTION__, context, asyncgen_asend)\n\n#endif\n\n/**\n * These can be created by byte code loop, and we don't now its internals,\n * yet we have to unwrap ourselves too. These could break in future updates,\n * and ideally we would have checks to cover those.\n */\n\nstruct _PyAsyncGenWrappedValue {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *agw_val;\n};\n\n#define _PyAsyncGenWrappedValue_CheckExact(o) (Py_TYPE(o) == &_PyAsyncGenWrappedValue_Type)\n\nstatic PyObject *_Nuitka_Asyncgen_unwrap_value(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,\n                                               PyObject *result) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(result);\n\n    if (result == NULL) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n        if (error == NULL) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n            asyncgen->m_closed = true;\n        } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopAsyncIteration) ||\n                   EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_GeneratorExit)) {\n            asyncgen->m_closed = true;\n        }\n\n#if PYTHON_VERSION >= 0x380\n        asyncgen->m_running_async = false;\n#endif\n        return NULL;\n    }\n\n    if (_PyAsyncGenWrappedValue_CheckExact(result)) {\n        /* async yield */\n        _PyGen_SetStopIterationValue(((struct _PyAsyncGenWrappedValue *)result)->agw_val);\n\n        Py_DECREF(result);\n\n#if PYTHON_VERSION >= 0x380\n        asyncgen->m_running_async = false;\n#endif\n        return NULL;\n    } else if (Nuitka_AsyncgenWrappedValue_CheckExact(result)) {\n        /* async yield */\n        _PyGen_SetStopIterationValue(((struct Nuitka_AsyncgenWrappedValueObject *)result)->m_value);\n\n        Py_DECREF(result);\n\n#if PYTHON_VERSION >= 0x380\n        asyncgen->m_running_async = false;\n#endif\n        return NULL;\n    }\n\n    return result;\n}\n\nstatic struct Nuitka_AsyncgenAsendObject *free_list_asyncgen_asends = NULL;\nstatic int free_list_asyncgen_asends_count = 0;\n\nstatic void Nuitka_AsyncgenAsend_tp_dealloc(struct Nuitka_AsyncgenAsendObject *asyncgen_asend) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenAsend_Type -= 1;\n    count_released_Nuitka_AsyncgenAsend_Type += 1;\n#endif\n\n    Nuitka_GC_UnTrack(asyncgen_asend);\n\n    CHECK_OBJECT(asyncgen_asend->m_gen);\n    Py_DECREF(asyncgen_asend->m_gen);\n\n    CHECK_OBJECT(asyncgen_asend->m_sendval);\n    Py_DECREF(asyncgen_asend->m_sendval);\n\n    releaseToFreeList(free_list_asyncgen_asends, asyncgen_asend, MAX_ASYNCGEN_FREE_LIST_COUNT);\n}\n\nstatic int Nuitka_AsyncgenAsend_tp_traverse(struct Nuitka_AsyncgenAsendObject *asyncgen_asend, visitproc visit,\n                                            void *arg) {\n    CHECK_OBJECT(asyncgen_asend);\n\n    CHECK_OBJECT(asyncgen_asend->m_gen);\n    CHECK_OBJECT(asyncgen_asend->m_sendval);\n\n    Py_VISIT(asyncgen_asend->m_gen);\n    Py_VISIT(asyncgen_asend->m_sendval);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_send(struct Nuitka_AsyncgenAsendObject *asyncgen_asend, PyObject *arg) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Enter\", asyncgen_asend);\n    PRINT_COROUTINE_VALUE(\"arg\", arg);\n    PRINT_NEW_LINE();\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (asyncgen_asend->m_state == AWAITABLE_STATE_CLOSED) {\n#if PYTHON_VERSION < 0x390\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n#else\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot reuse already awaited __anext__()/asend()\");\n#endif\n\n#if _DEBUG_ASYNCGEN\n        PRINT_ASYNCGENASEND_STATUS(\"Leave\", asyncgen_asend);\n        PRINT_STRING(\"Closed -> StopIteration\\n\");\n        PRINT_CURRENT_EXCEPTION();\n        PRINT_NEW_LINE();\n#endif\n\n        return NULL;\n    } else if (asyncgen_asend->m_state == AWAITABLE_STATE_INIT) {\n#if PYTHON_VERSION >= 0x380\n        if (asyncgen_asend->m_gen->m_running_async) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                            \"anext(): asynchronous generator is already running\");\n            return NULL;\n        }\n#endif\n        if (arg == NULL || arg == Py_None) {\n            arg = asyncgen_asend->m_sendval;\n        }\n\n        asyncgen_asend->m_state = AWAITABLE_STATE_ITER;\n\n#if _DEBUG_ASYNCGEN\n        PRINT_STRING(\"Init -> begin iteration\\n\");\n        PRINT_COROUTINE_VALUE(\"computed arg from sendval\", arg);\n        PRINT_NEW_LINE();\n#endif\n    }\n\n#if PYTHON_VERSION >= 0x380\n    asyncgen_asend->m_gen->m_running_async = true;\n#endif\n\n#if _DEBUG_ASYNCGEN\n    PRINT_STRING(\"Deferring to _Nuitka_Asyncgen_send\\n\");\n    PRINT_NEW_LINE();\n#endif\n\n    Py_INCREF(arg);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PyObject *result = _Nuitka_Asyncgen_send(tstate, asyncgen_asend->m_gen, arg, false, &exception_state);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_STRING(\"Returned from _Nuitka_Asyncgen_send\\n\");\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    result = _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen_asend->m_gen, result);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    if (result == NULL) {\n        asyncgen_asend->m_state = AWAITABLE_STATE_CLOSED;\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Leave\", asyncgen_asend);\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_tp_iternext(struct Nuitka_AsyncgenAsendObject *asyncgen_asend) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Enter\", asyncgen_asend);\n    PRINT_STRING(\"Deferring to Nuitka_AsyncgenAsend_send(Py_None)\\n\");\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = Nuitka_AsyncgenAsend_send(asyncgen_asend, Py_None);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Leave\", asyncgen_asend);\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_throw(struct Nuitka_AsyncgenAsendObject *asyncgen_asend, PyObject *args) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Enter\", asyncgen_asend);\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: args:\");\n    PRINT_ITEM(args);\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: On entry: \");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (asyncgen_asend->m_state == AWAITABLE_STATE_CLOSED) {\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        return NULL;\n    }\n\n    PyObject *result = Nuitka_Asyncgen_throw(tstate, asyncgen_asend->m_gen, args);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: Async throw result:\");\n    PRINT_ITEM(result);\n    PRINT_STRING(\" exception: \");\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    result = _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen_asend->m_gen, result);\n\n    if (result == NULL) {\n        asyncgen_asend->m_state = AWAITABLE_STATE_CLOSED;\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: Leave with result: \");\n    PRINT_ITEM(result);\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: Leave with exception: \");\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_STRING(\"Nuitka_AsyncgenAsend_throw: Leave with exception: \");\n    PRINT_PUBLISHED_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n    CHECK_OBJECT_DEEP(args);\n\n    return result;\n}\n\nstatic PyObject *_Nuitka_AsyncgenAsend_throw2(PyThreadState *tstate, struct Nuitka_AsyncgenAsendObject *asyncgen_asend,\n                                              struct Nuitka_ExceptionPreservationItem *exception_state) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Enter\", asyncgen_asend);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    if (asyncgen_asend->m_state == AWAITABLE_STATE_CLOSED) {\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        return NULL;\n    }\n\n    PyObject *result = _Nuitka_Asyncgen_throw2(tstate, asyncgen_asend->m_gen, false, exception_state);\n\n    // TODO: This might not be all that necessary as this is not directly outside facing,\n    // but there were tests failing when this was not the specific value.\n    if (result == NULL) {\n        if (GET_ERROR_OCCURRED(tstate) == NULL) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n        }\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Got result\", asyncgen_asend);\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    result = _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen_asend->m_gen, result);\n\n#if _DEBUG_ASYNCGEN\n    PRINT_COROUTINE_VALUE(\"unwrapped\", result);\n    PRINT_NEW_LINE();\n#endif\n\n    if (result == NULL) {\n        asyncgen_asend->m_state = AWAITABLE_STATE_CLOSED;\n    }\n\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENASEND_STATUS(\"Leave\", asyncgen_asend);\n    PRINT_COROUTINE_VALUE(\"result\", result);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n    return result;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_close(struct Nuitka_AsyncgenAsendObject *asyncgen_asend, PyObject *args) {\n    asyncgen_asend->m_state = AWAITABLE_STATE_CLOSED;\n\n    Py_INCREF(Py_None);\n    return Py_None;\n}\n\nstatic PyObject *Nuitka_AsyncgenAsend_tp_repr(struct Nuitka_AsyncgenAsendObject *asyncgen_asend) {\n    return PyUnicode_FromFormat(\"<compiled_async_generator_asend of %s at %p>\",\n                                Nuitka_String_AsString(asyncgen_asend->m_gen->m_qualname), asyncgen_asend);\n}\n\nstatic PyMethodDef Nuitka_AsyncgenAsend_methods[] = {\n    {\"send\", (PyCFunction)Nuitka_AsyncgenAsend_send, METH_O, NULL},\n    {\"throw\", (PyCFunction)Nuitka_AsyncgenAsend_throw, METH_VARARGS, NULL},\n    {\"close\", (PyCFunction)Nuitka_AsyncgenAsend_close, METH_NOARGS, NULL},\n    {NULL}};\n\nstatic PyAsyncMethods Nuitka_AsyncgenAsend_as_async = {\n    0, // am_await (PyObject_SelfIter)\n    0, // am_aiter\n    0  // am_anext\n};\n\nstatic PyTypeObject Nuitka_AsyncgenAsend_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_async_generator_asend\", // tp_name\n    sizeof(struct Nuitka_AsyncgenAsendObject),                       // tp_basicsize\n    0,                                                               // tp_itemsize\n    (destructor)Nuitka_AsyncgenAsend_tp_dealloc,                     // tp_dealloc\n    0,                                                               // tp_print\n    0,                                                               // tp_getattr\n    0,                                                               // tp_setattr\n    &Nuitka_AsyncgenAsend_as_async,                                  // tp_as_async\n    (reprfunc)Nuitka_AsyncgenAsend_tp_repr,                          // tp_repr\n    0,                                                               // tp_as_number\n    0,                                                               // tp_as_sequence\n    0,                                                               // tp_as_mapping\n    0,                                                               // tp_hash\n    0,                                                               // tp_call\n    0,                                                               // tp_str\n    0,                                                               // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                               // tp_setattro\n    0,                                                               // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,                         // tp_flags\n    0,                                                               // tp_doc\n    (traverseproc)Nuitka_AsyncgenAsend_tp_traverse,                  // tp_traverse\n    0,                                                               // tp_clear\n    0,                                                               // tp_richcompare\n    0,                                                               // tp_weaklistoffset\n    0,                                                               // tp_iter (PyObject_SelfIter)\n    (iternextfunc)Nuitka_AsyncgenAsend_tp_iternext,                  // tp_iternext\n    Nuitka_AsyncgenAsend_methods,                                    // tp_methods\n    0,                                                               // tp_members\n    0,                                                               // tp_getset\n    0,                                                               // tp_base\n    0,                                                               // tp_dict\n    0,                                                               // tp_descr_get\n    0,                                                               // tp_descr_set\n    0,                                                               // tp_dictoffset\n    0,                                                               // tp_init\n    0,                                                               // tp_alloc\n    0,                                                               // tp_new\n};\n\nstatic bool Nuitka_AsyncgenAsend_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_AsyncgenAsend_Type; }\n\nstatic PyObject *Nuitka_AsyncgenAsend_New(struct Nuitka_AsyncgenObject *asyncgen, PyObject *send_value) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT(send_value);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenAsend_Type += 1;\n    count_allocated_Nuitka_AsyncgenAsend_Type += 1;\n#endif\n\n    struct Nuitka_AsyncgenAsendObject *result;\n\n    allocateFromFreeListFixed(free_list_asyncgen_asends, struct Nuitka_AsyncgenAsendObject, Nuitka_AsyncgenAsend_Type);\n\n    Py_INCREF(asyncgen);\n    result->m_gen = asyncgen;\n\n    Py_INCREF(send_value);\n    result->m_sendval = send_value;\n\n    result->m_state = AWAITABLE_STATE_INIT;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\nstruct Nuitka_AsyncgenAthrowObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        // The asyncgen we are working for.\n        struct Nuitka_AsyncgenObject *m_gen;\n    // Arguments, NULL in case of close, otherwise throw arguments.\n    PyObject *m_args;\n\n    AwaitableState m_state;\n};\n\n#if _DEBUG_ASYNCGEN\n\nNUITKA_MAY_BE_UNUSED static void _PRINT_ASYNCGENATHROW_STATUS(char const *descriptor, char const *context,\n                                                              struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow) {\n    char const *status;\n\n    switch (asyncgen_athrow->m_state) {\n    case AWAITABLE_STATE_INIT:\n        status = \"(init)\";\n        break;\n    case AWAITABLE_STATE_ITER:\n        status = \"(iter)\";\n        break;\n    case AWAITABLE_STATE_CLOSED:\n        status = \"(closed)\";\n        break;\n    default:\n        status = \"(ILLEGAL)\";\n        break;\n    }\n\n    PRINT_STRING(descriptor);\n    PRINT_STRING(\" : \");\n    PRINT_STRING(context);\n    PRINT_STRING(\" \");\n    PRINT_ITEM((PyObject *)asyncgen_athrow);\n    PRINT_STRING(\" \");\n    PRINT_STRING(status);\n    PRINT_NEW_LINE();\n}\n\n#define PRINT_ASYNCGENATHROW_STATUS(context, coroutine)                                                                \\\n    _PRINT_ASYNCGENATHROW_STATUS(__FUNCTION__, context, asyncgen_athrow)\n\n#endif\n\nstatic struct Nuitka_AsyncgenAthrowObject *free_list_asyncgen_athrows = NULL;\nstatic int free_list_asyncgen_athrows_count = 0;\n\nstatic void Nuitka_AsyncgenAthrow_dealloc(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenAthrow_Type -= 1;\n    count_released_Nuitka_AsyncgenAthrow_Type += 1;\n#endif\n\n    Nuitka_GC_UnTrack(asyncgen_athrow);\n\n    CHECK_OBJECT(asyncgen_athrow->m_gen);\n    Py_DECREF(asyncgen_athrow->m_gen);\n\n    CHECK_OBJECT_X(asyncgen_athrow->m_args);\n    Py_XDECREF(asyncgen_athrow->m_args);\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_asyncgen_athrows, asyncgen_athrow, MAX_ASYNCGEN_FREE_LIST_COUNT);\n}\n\nstatic int Nuitka_AsyncgenAthrow_traverse(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow, visitproc visit,\n                                          void *arg) {\n    Py_VISIT(asyncgen_athrow->m_gen);\n    Py_VISIT(asyncgen_athrow->m_args);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_AsyncgenAthrow_send(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow, PyObject *arg) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENATHROW_STATUS(\"Enter\", asyncgen_athrow);\n    PRINT_COROUTINE_VALUE(\"arg\", arg);\n    PRINT_NEW_LINE();\n#endif\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_AsyncgenObject *asyncgen = asyncgen_athrow->m_gen;\n\n    // Closing twice is not allowed with 3.9 or higher.\n    if (asyncgen_athrow->m_state == AWAITABLE_STATE_CLOSED) {\n#if PYTHON_VERSION < 0x390\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n#else\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot reuse already awaited aclose()/athrow()\");\n#endif\n\n        return NULL;\n    }\n\n    // If finished, just report StopIteration.\n    if (asyncgen->m_status == status_Finished) {\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        return NULL;\n    }\n\n    PyObject *retval;\n\n    if (asyncgen_athrow->m_state == AWAITABLE_STATE_INIT) {\n#if PYTHON_VERSION >= 0x380\n        if (asyncgen_athrow->m_gen->m_running_async) {\n            if (asyncgen_athrow->m_args == NULL) {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                                \"aclose(): asynchronous generator is already running\");\n            } else {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                                \"athrow(): asynchronous generator is already running\");\n            }\n            return NULL;\n        }\n#endif\n\n        // Can also close only once.\n        if (asyncgen->m_closed) {\n#if PYTHON_VERSION >= 0x380\n            asyncgen_athrow->m_state = AWAITABLE_STATE_CLOSED;\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n#else\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n#endif\n            return NULL;\n        }\n\n        // Starting accepts only \"None\" as input value.\n        if (arg != Py_None) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                            \"can't send non-None value to a just-started coroutine\");\n\n            return NULL;\n        }\n\n#if PYTHON_VERSION >= 0x380\n        asyncgen_athrow->m_gen->m_running_async = true;\n#endif\n        asyncgen_athrow->m_state = AWAITABLE_STATE_ITER;\n\n        if (asyncgen_athrow->m_args == NULL) {\n            asyncgen->m_closed = true;\n\n            struct Nuitka_ExceptionPreservationItem exception_state;\n            SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, PyExc_GeneratorExit, NULL, NULL);\n\n            retval = _Nuitka_Asyncgen_throw2(tstate, asyncgen,\n                                             1, /* Do not close generator when PyExc_GeneratorExit is passed */\n                                             &exception_state);\n\n            if (retval) {\n                if (_PyAsyncGenWrappedValue_CheckExact(retval) || Nuitka_AsyncgenWrappedValue_CheckExact(retval)) {\n#if PYTHON_VERSION >= 0x380\n                    asyncgen_athrow->m_gen->m_running_async = false;\n#endif\n\n                    Py_DECREF(retval);\n\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                                    \"async generator ignored GeneratorExit\");\n\n                    return NULL;\n                }\n            }\n        } else {\n            PyObject *exception_type;\n            PyObject *exception_value = NULL;\n            PyTracebackObject *exception_tb = NULL;\n\n            if (unlikely(!PyArg_UnpackTuple(asyncgen_athrow->m_args, \"athrow\", 1, 3, &exception_type, &exception_value,\n                                            &exception_tb))) {\n                return NULL;\n            }\n\n            // Handing ownership of exception over, we need not release it ourselves\n            struct Nuitka_ExceptionPreservationItem exception_state;\n            SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, exception_type, exception_value, exception_tb);\n\n            retval = _Nuitka_Asyncgen_throw2(tstate, asyncgen,\n                                             0, /* Do not close generator when PyExc_GeneratorExit is passed */\n                                             &exception_state);\n\n            retval = _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen, retval);\n        }\n\n        if (retval == NULL) {\n            goto check_error;\n        }\n\n        return retval;\n    }\n\n    assert(asyncgen_athrow->m_state == AWAITABLE_STATE_ITER);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    retval = _Nuitka_Asyncgen_send(tstate, asyncgen, arg, false, &exception_state);\n\n    if (asyncgen_athrow->m_args) {\n        return _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen, retval);\n    } else {\n        /* We are here to close if no args. */\n        if (retval) {\n            if (_PyAsyncGenWrappedValue_CheckExact(retval) || Nuitka_AsyncgenWrappedValue_CheckExact(retval)) {\n#if PYTHON_VERSION >= 0x380\n                asyncgen_athrow->m_gen->m_running_async = false;\n#endif\n                Py_DECREF(retval);\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"async generator ignored GeneratorExit\");\n\n                return NULL;\n            }\n\n            return retval;\n        }\n    }\n\ncheck_error:\n#if PYTHON_VERSION >= 0x380\n    asyncgen_athrow->m_gen->m_running_async = false;\n#endif\n\n    if (PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) {\n        asyncgen_athrow->m_state = AWAITABLE_STATE_CLOSED;\n\n        if (asyncgen_athrow->m_args == NULL) {\n            CLEAR_ERROR_OCCURRED(tstate);\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n    } else if (PyErr_ExceptionMatches(PyExc_GeneratorExit)) {\n        asyncgen_athrow->m_state = AWAITABLE_STATE_CLOSED;\n\n#if PYTHON_VERSION >= 0x380\n        if (asyncgen_athrow->m_args == NULL) {\n#endif\n            CLEAR_ERROR_OCCURRED(tstate);\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n#if PYTHON_VERSION >= 0x380\n        }\n#endif\n    }\n\n    return NULL;\n}\n\nstatic PyObject *Nuitka_AsyncgenAthrow_throw(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow, PyObject *args) {\n#if _DEBUG_ASYNCGEN\n    PRINT_ASYNCGENATHROW_STATUS(\"Enter\", asyncgen_athrow);\n    PRINT_COROUTINE_VALUE(\"args\", args);\n    PRINT_NEW_LINE();\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *retval;\n\n#if PYTHON_VERSION < 0x375\n    if (asyncgen_athrow->m_state == AWAITABLE_STATE_INIT) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                        \"can't send non-None value to a just-started coroutine\");\n\n        return NULL;\n    }\n#endif\n\n    if (asyncgen_athrow->m_state == AWAITABLE_STATE_CLOSED) {\n#if PYTHON_VERSION < 0x390\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n#else\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot reuse already awaited aclose()/athrow()\");\n#endif\n\n        return NULL;\n    }\n\n    retval = Nuitka_Asyncgen_throw(tstate, asyncgen_athrow->m_gen, args);\n\n    if (asyncgen_athrow->m_args) {\n        return _Nuitka_Asyncgen_unwrap_value(tstate, asyncgen_athrow->m_gen, retval);\n    } else {\n        if (retval != NULL) {\n            if (_PyAsyncGenWrappedValue_CheckExact(retval) || Nuitka_AsyncgenWrappedValue_CheckExact(retval)) {\n#if PYTHON_VERSION >= 0x380\n                asyncgen_athrow->m_gen->m_running_async = false;\n#endif\n                Py_DECREF(retval);\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"async generator ignored GeneratorExit\");\n\n                return NULL;\n            }\n        }\n\n#if PYTHON_VERSION >= 0x390\n        if (PyErr_ExceptionMatches(PyExc_StopAsyncIteration) || PyErr_ExceptionMatches(PyExc_GeneratorExit)) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n#endif\n\n        return retval;\n    }\n}\n\nstatic PyObject *Nuitka_AsyncgenAthrow_tp_iternext(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow) {\n    return Nuitka_AsyncgenAthrow_send(asyncgen_athrow, Py_None);\n}\n\nstatic PyObject *Nuitka_AsyncgenAthrow_close(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow) {\n    asyncgen_athrow->m_state = AWAITABLE_STATE_CLOSED;\n\n    Py_INCREF(Py_None);\n    return Py_None;\n}\n\nstatic PyMethodDef Nuitka_AsyncgenAthrow_methods[] = {\n    {\"send\", (PyCFunction)Nuitka_AsyncgenAthrow_send, METH_O, NULL},\n    {\"throw\", (PyCFunction)Nuitka_AsyncgenAthrow_throw, METH_VARARGS, NULL},\n    {\"close\", (PyCFunction)Nuitka_AsyncgenAthrow_close, METH_NOARGS, NULL},\n    {NULL}};\n\nstatic PyAsyncMethods Nuitka_AsyncgenAthrow_as_async = {\n    0, // am_await (PyObject_SelfIter)\n    0, // am_aiter\n    0  // am_anext\n};\n\nstatic PyTypeObject Nuitka_AsyncgenAthrow_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_async_generator_athrow\", // tp_name\n    sizeof(struct Nuitka_AsyncgenAthrowObject),                       // tp_basicsize\n    0,                                                                // tp_itemsize\n    (destructor)Nuitka_AsyncgenAthrow_dealloc,                        // tp_dealloc\n    0,                                                                // tp_print\n    0,                                                                // tp_getattr\n    0,                                                                // tp_setattr\n    &Nuitka_AsyncgenAthrow_as_async,                                  // tp_as_async\n    0,                                                                // tp_repr\n    0,                                                                // tp_as_number\n    0,                                                                // tp_as_sequence\n    0,                                                                // tp_as_mapping\n    0,                                                                // tp_hash\n    0,                                                                // tp_call\n    0,                                                                // tp_str\n    0,                                                                // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                                // tp_setattro\n    0,                                                                // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,                          // tp_flags\n    0,                                                                // tp_doc\n    (traverseproc)Nuitka_AsyncgenAthrow_traverse,                     // tp_traverse\n    0,                                                                // tp_clear\n    0,                                                                // tp_richcompare\n    0,                                                                // tp_weaklistoffset\n    0,                                                                // tp_iter (PyObject_SelfIter)\n    (iternextfunc)Nuitka_AsyncgenAthrow_tp_iternext,                  // tp_iternext\n    Nuitka_AsyncgenAthrow_methods,                                    // tp_methods\n    0,                                                                // tp_members\n    0,                                                                // tp_getset\n    0,                                                                // tp_base\n    0,                                                                // tp_dict\n    0,                                                                // tp_descr_get\n    0,                                                                // tp_descr_set\n    0,                                                                // tp_dictoffset\n    0,                                                                // tp_init\n    0,                                                                // tp_alloc\n    0,                                                                // tp_new\n    0,                                                                // tp_free\n    0,                                                                // tp_is_gc\n    0,                                                                // tp_bases\n    0,                                                                // tp_mro\n    0,                                                                // tp_cache\n    0,                                                                // tp_subclasses\n    0,                                                                // tp_weaklist\n    0,                                                                // tp_del\n    0,                                                                // tp_version_tag\n    0,                                                                // tp_finalize\n};\n\nstatic PyObject *Nuitka_AsyncgenAthrow_New(struct Nuitka_AsyncgenObject *asyncgen, PyObject *args) {\n    CHECK_OBJECT(asyncgen);\n    CHECK_OBJECT_X(args);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AsyncgenAthrow_Type += 1;\n    count_allocated_Nuitka_AsyncgenAthrow_Type += 1;\n#endif\n\n    struct Nuitka_AsyncgenAthrowObject *result;\n\n    allocateFromFreeListFixed(free_list_asyncgen_athrows, struct Nuitka_AsyncgenAthrowObject,\n                              Nuitka_AsyncgenAthrow_Type);\n\n    Py_INCREF(asyncgen);\n    result->m_gen = asyncgen;\n\n    Py_XINCREF(args);\n    result->m_args = args;\n\n    result->m_state = AWAITABLE_STATE_INIT;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\nstatic void _initCompiledAsyncgenTypes(void) {\n\n    Nuitka_PyType_Ready(&Nuitka_Asyncgen_Type, &PyAsyncGen_Type, true, false, false, false, true);\n\n    // Be a paranoid subtype of uncompiled function, we want nothing shared.\n    assert(Nuitka_Asyncgen_Type.tp_doc != PyAsyncGen_Type.tp_doc || PyAsyncGen_Type.tp_doc == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_traverse != PyAsyncGen_Type.tp_traverse);\n    assert(Nuitka_Asyncgen_Type.tp_clear != PyAsyncGen_Type.tp_clear || PyAsyncGen_Type.tp_clear == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_richcompare != PyAsyncGen_Type.tp_richcompare ||\n           PyAsyncGen_Type.tp_richcompare == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_weaklistoffset != PyAsyncGen_Type.tp_weaklistoffset);\n    assert(Nuitka_Asyncgen_Type.tp_iter != PyAsyncGen_Type.tp_iter || PyAsyncGen_Type.tp_iter == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_iternext != PyAsyncGen_Type.tp_iternext || PyAsyncGen_Type.tp_iternext == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_as_async != PyAsyncGen_Type.tp_as_async || PyAsyncGen_Type.tp_as_async == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_methods != PyAsyncGen_Type.tp_methods);\n    assert(Nuitka_Asyncgen_Type.tp_members != PyAsyncGen_Type.tp_members);\n    assert(Nuitka_Asyncgen_Type.tp_getset != PyAsyncGen_Type.tp_getset);\n    assert(Nuitka_Asyncgen_Type.tp_base != PyAsyncGen_Type.tp_base);\n    assert(Nuitka_Asyncgen_Type.tp_dict != PyAsyncGen_Type.tp_dict);\n    assert(Nuitka_Asyncgen_Type.tp_descr_get != PyAsyncGen_Type.tp_descr_get || PyAsyncGen_Type.tp_descr_get == NULL);\n\n    assert(Nuitka_Asyncgen_Type.tp_descr_set != PyAsyncGen_Type.tp_descr_set || PyAsyncGen_Type.tp_descr_set == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_dictoffset != PyAsyncGen_Type.tp_dictoffset || PyAsyncGen_Type.tp_dictoffset == 0);\n    // TODO: These get changed and into the same thing, not sure what to compare against, project something\n    // assert(Nuitka_Asyncgen_Type.tp_init != PyAsyncGen_Type.tp_init || PyAsyncGen_Type.tp_init == NULL);\n    // assert(Nuitka_Asyncgen_Type.tp_alloc != PyAsyncGen_Type.tp_alloc || PyAsyncGen_Type.tp_alloc == NULL);\n    // assert(Nuitka_Asyncgen_Type.tp_new != PyAsyncGen_Type.tp_new || PyAsyncGen_Type.tp_new == NULL);\n    // assert(Nuitka_Asyncgen_Type.tp_free != PyAsyncGen_Type.tp_free || PyAsyncGen_Type.tp_free == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_bases != PyAsyncGen_Type.tp_bases);\n    assert(Nuitka_Asyncgen_Type.tp_mro != PyAsyncGen_Type.tp_mro);\n    assert(Nuitka_Asyncgen_Type.tp_cache != PyAsyncGen_Type.tp_cache || PyAsyncGen_Type.tp_cache == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_subclasses != PyAsyncGen_Type.tp_subclasses || PyAsyncGen_Type.tp_cache == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_weaklist != PyAsyncGen_Type.tp_weaklist);\n    assert(Nuitka_Asyncgen_Type.tp_del != PyAsyncGen_Type.tp_del || PyAsyncGen_Type.tp_del == NULL);\n    assert(Nuitka_Asyncgen_Type.tp_finalize != PyAsyncGen_Type.tp_finalize || PyAsyncGen_Type.tp_finalize == NULL);\n\n    Nuitka_PyType_Ready(&Nuitka_AsyncgenAsend_Type, NULL, true, false, true, true, false);\n    Nuitka_PyType_Ready(&Nuitka_AsyncgenAthrow_Type, NULL, true, false, true, true, false);\n    Nuitka_PyType_Ready(&Nuitka_AsyncgenValueWrapper_Type, NULL, false, false, false, false, false);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledCellType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Compiled cells.\n *\n * We have our own cell type, so we can use a freelist for them, to speed up our\n * interactions with allocating them.\n *\n * It strives to be full replacement for normal cells. It does not yet inherit\n * from the cell type like functions, generators, etc. do but could be made so\n * if that becomes necessary by some C extension code.\n *\n */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Cell_Type;\nint count_allocated_Nuitka_Cell_Type;\nint count_released_Nuitka_Cell_Type;\n#endif\n\n#define MAX_CELL_FREE_LIST_COUNT 1000\nstatic struct Nuitka_CellObject *free_list_cells = NULL;\nstatic int free_list_cells_count = 0;\n\nstatic void Nuitka_Cell_tp_dealloc(struct Nuitka_CellObject *cell) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Cell_Type -= 1;\n    count_released_Nuitka_Cell_Type += 1;\n#endif\n\n    Nuitka_GC_UnTrack(cell);\n    Py_XDECREF(cell->ob_ref);\n\n    releaseToFreeList(free_list_cells, cell, MAX_CELL_FREE_LIST_COUNT);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic int Nuitka_Cell_tp_compare(PyObject *a, PyObject *b) {\n    struct Nuitka_CellObject *cell_a = (struct Nuitka_CellObject *)a;\n    struct Nuitka_CellObject *cell_b = (struct Nuitka_CellObject *)b;\n\n    /* Empty cells compare specifically different. */\n    if (cell_a->ob_ref == NULL) {\n        if (cell_b->ob_ref == NULL) {\n            return 0;\n        }\n\n        return -1;\n    }\n\n    if (cell_b->ob_ref == NULL) {\n        return 1;\n    }\n\n    return PyObject_Compare(cell_a->ob_ref, cell_b->ob_ref);\n}\n#else\n#define Nuitka_Cell_tp_compare (NULL)\n\nstatic PyObject *Nuitka_Cell_tp_richcompare(PyObject *a, PyObject *b, int op) {\n    PyObject *result;\n\n    CHECK_OBJECT(a);\n    CHECK_OBJECT(b);\n\n    if (unlikely(!Nuitka_Cell_Check(a) || !Nuitka_Cell_Check(b))) {\n        result = Py_NotImplemented;\n        Py_INCREF(result);\n\n        return result;\n    }\n\n    // Now just dereference cell value, and compare from there by contents, which can\n    // be NULL however.\n    a = ((struct Nuitka_CellObject *)a)->ob_ref;\n    b = ((struct Nuitka_CellObject *)b)->ob_ref;\n\n    if (a != NULL && b != NULL) {\n        switch (op) {\n        case Py_EQ:\n            return RICH_COMPARE_EQ_OBJECT_OBJECT_OBJECT(a, b);\n        case Py_NE:\n            return RICH_COMPARE_NE_OBJECT_OBJECT_OBJECT(a, b);\n        case Py_LE:\n            return RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(a, b);\n        case Py_GE:\n            return RICH_COMPARE_GE_OBJECT_OBJECT_OBJECT(a, b);\n        case Py_LT:\n            return RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(a, b);\n        case Py_GT:\n            return RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(a, b);\n        default:\n            PyErr_BadArgument();\n            return NULL;\n        }\n    }\n\n    int res = (b == NULL) - (a == NULL);\n    switch (op) {\n    case Py_EQ:\n        result = BOOL_FROM(res == 0);\n        break;\n    case Py_NE:\n        result = BOOL_FROM(res != 0);\n        break;\n    case Py_LE:\n        result = BOOL_FROM(res <= 0);\n        break;\n    case Py_GE:\n        result = BOOL_FROM(res >= 0);\n        break;\n    case Py_LT:\n        result = BOOL_FROM(res < 0);\n        break;\n    case Py_GT:\n        result = BOOL_FROM(res > 0);\n        break;\n    default:\n        PyErr_BadArgument();\n        return NULL;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n#endif\n\nstatic PyObject *Nuitka_Cell_tp_repr(struct Nuitka_CellObject *cell) {\n    if (cell->ob_ref == NULL) {\n        return Nuitka_String_FromFormat(\"<compiled_cell at %p: empty>\", cell);\n    } else {\n        return Nuitka_String_FromFormat(\"<compiled_cell at %p: %s object at %p>\", cell, cell->ob_ref->ob_type->tp_name,\n                                        cell->ob_ref);\n    }\n}\n\nstatic int Nuitka_Cell_tp_traverse(struct Nuitka_CellObject *cell, visitproc visit, void *arg) {\n    Py_VISIT(cell->ob_ref);\n\n    return 0;\n}\n\nstatic int Nuitka_Cell_tp_clear(struct Nuitka_CellObject *cell) {\n    Py_CLEAR(cell->ob_ref);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Cell_get_contents(struct Nuitka_CellObject *cell, void *closure) {\n    if (unlikely(cell->ob_ref == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"Cell is empty\");\n        return NULL;\n    }\n\n    Py_INCREF(cell->ob_ref);\n    return cell->ob_ref;\n}\n\n#if PYTHON_VERSION >= 0x370\nstatic int Nuitka_Cell_set_contents(struct Nuitka_CellObject *cell, PyObject *value) {\n    PyObject *old = cell->ob_ref;\n\n    if (old != NULL && value == NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                        \"cell_contents cannot be used to delete values Nuitka\");\n        return -1;\n    }\n\n    cell->ob_ref = value;\n    Py_XINCREF(value);\n    Py_XDECREF(old);\n\n    return 0;\n}\n#endif\n\nstatic PyGetSetDef Nuitka_Cell_getsetlist[] = {\n#if PYTHON_VERSION < 0x370\n    {(char *)\"cell_contents\", (getter)Nuitka_Cell_get_contents, NULL, NULL},\n#else\n    {(char *)\"cell_contents\", (getter)Nuitka_Cell_get_contents, (setter)Nuitka_Cell_set_contents, NULL},\n#endif\n    {NULL}};\n\nPyTypeObject Nuitka_Cell_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_cell\",\n    sizeof(struct Nuitka_CellObject),        // tp_basicsize\n    0,                                       // tp_itemsize\n    (destructor)Nuitka_Cell_tp_dealloc,      // tp_dealloc\n    0,                                       // tp_print\n    0,                                       // tp_getattr\n    0,                                       // tp_setattr\n    Nuitka_Cell_tp_compare,                  // tp_compare / tp_reserved\n    (reprfunc)Nuitka_Cell_tp_repr,           // tp_repr\n    0,                                       // tp_as_number\n    0,                                       // tp_as_sequence\n    0,                                       // tp_as_mapping\n    0,                                       // tp_hash\n    0,                                       // tp_call\n    0,                                       // tp_str\n    0,                                       // tp_getattro (PyObject_GenericGetAttr)\n    0,                                       // tp_setattro\n    0,                                       // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags\n    0,                                       // tp_doc\n    (traverseproc)Nuitka_Cell_tp_traverse,   // tp_traverse\n    (inquiry)Nuitka_Cell_tp_clear,           // tp_clear\n#if PYTHON_VERSION < 0x300\n    0, // tp_richcompare\n#else\n    Nuitka_Cell_tp_richcompare, // tp_richcompare\n#endif\n    0,                      // tp_weaklistoffset\n    0,                      // tp_iter\n    0,                      // tp_iternext\n    0,                      // tp_methods\n    0,                      // tp_members\n    Nuitka_Cell_getsetlist, // tp_getset\n};\n\nvoid _initCompiledCellType(void) { Nuitka_PyType_Ready(&Nuitka_Cell_Type, NULL, true, false, false, false, false); }\n\nstruct Nuitka_CellObject *Nuitka_Cell_NewEmpty(void) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Cell_Type += 1;\n    count_allocated_Nuitka_Cell_Type += 1;\n#endif\n\n    struct Nuitka_CellObject *result;\n\n    allocateFromFreeListFixed(free_list_cells, struct Nuitka_CellObject, Nuitka_Cell_Type);\n\n    result->ob_ref = NULL;\n\n    Nuitka_GC_Track(result);\n\n    return result;\n}\n\nstruct Nuitka_CellObject *Nuitka_Cell_New0(PyObject *value) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Cell_Type += 1;\n    count_allocated_Nuitka_Cell_Type += 1;\n#endif\n    CHECK_OBJECT(value);\n\n    struct Nuitka_CellObject *result;\n\n    allocateFromFreeListFixed(free_list_cells, struct Nuitka_CellObject, Nuitka_Cell_Type);\n\n    result->ob_ref = value;\n    Py_INCREF(value);\n\n    Nuitka_GC_Track(result);\n\n    return result;\n}\n\nstruct Nuitka_CellObject *Nuitka_Cell_New1(PyObject *value) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Cell_Type += 1;\n    count_allocated_Nuitka_Cell_Type += 1;\n#endif\n    CHECK_OBJECT(value);\n\n    struct Nuitka_CellObject *result;\n\n    allocateFromFreeListFixed(free_list_cells, struct Nuitka_CellObject, Nuitka_Cell_Type);\n\n    result->ob_ref = value;\n\n    Nuitka_GC_Track(result);\n\n    return result;\n}\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledCodeHelpers.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* Implementations of compiled code helpers.\n\n * The definition of a compiled code helper is that it's being used in\n * generated C code and provides part of the operations implementation.\n *\n * Currently we also have standalone mode related code here, patches to CPython\n * runtime that we do, and e.g. the built-in module. TODO: Move these to their\n * own files for clarity.\n */\n\n#include \"nuitka/prelude.h\"\n\n#include \"HelpersBuiltinTypeMethods.c\"\n\nstatic void _initBuiltinTypeMethods(void) {\n#if PYTHON_VERSION < 0x300\n    NUITKA_PRINT_TRACE(\"main(): Calling _initStrBuiltinMethods().\");\n    _initStrBuiltinMethods();\n#else\n    NUITKA_PRINT_TRACE(\"main(): Calling _initBytesBuiltinMethods().\");\n    _initBytesBuiltinMethods();\n#endif\n    NUITKA_PRINT_TRACE(\"main(): Calling _initUnicodeBuiltinMethods().\");\n    _initUnicodeBuiltinMethods();\n    NUITKA_PRINT_TRACE(\"main(): Calling _initDictBuiltinMethods().\");\n    _initDictBuiltinMethods();\n    NUITKA_PRINT_TRACE(\"main(): Calling _initListBuiltinMethods().\");\n    _initListBuiltinMethods();\n}\n\n#if PYTHON_VERSION >= 0x3b0\n#include \"HelpersAllocator.c\"\n#endif\n\n#include \"HelpersBuiltin.c\"\n#include \"HelpersBytes.c\"\n#include \"HelpersClasses.c\"\n#include \"HelpersDictionaries.c\"\n#include \"HelpersExceptions.c\"\n#include \"HelpersFiles.c\"\n#include \"HelpersFloats.c\"\n#include \"HelpersHeapStorage.c\"\n#include \"HelpersImport.c\"\n#include \"HelpersImportHard.c\"\n#include \"HelpersLists.c\"\n#include \"HelpersMappings.c\"\n#include \"HelpersRaising.c\"\n#include \"HelpersSequences.c\"\n#include \"HelpersSlices.c\"\n#include \"HelpersStrings.c\"\n#include \"HelpersTuples.c\"\n\n#include \"HelpersEnvironmentVariables.c\"\n#include \"HelpersFilesystemPaths.c\"\n#include \"HelpersSafeStrings.c\"\n\n#if PYTHON_VERSION >= 0x3a0\n#include \"HelpersMatching.c\"\n#endif\n\n#if PYTHON_VERSION < 0x300\n\nstatic Py_ssize_t ESTIMATE_RANGE(long low, long high, long step) {\n    if (low >= high) {\n        return 0;\n    } else {\n        return (high - low - 1) / step + 1;\n    }\n}\n\nstatic PyObject *_BUILTIN_RANGE_INT3(long low, long high, long step) {\n    assert(step != 0);\n\n    Py_ssize_t size;\n\n    if (step > 0) {\n        size = ESTIMATE_RANGE(low, high, step);\n    } else {\n        size = ESTIMATE_RANGE(high, low, -step);\n    }\n\n    PyObject *result = MAKE_LIST_EMPTY(size);\n\n    long current = low;\n\n    for (int i = 0; i < size; i++) {\n        PyList_SET_ITEM(result, i, PyInt_FromLong(current));\n        current += step;\n    }\n\n    return result;\n}\n\nstatic PyObject *_BUILTIN_RANGE_INT2(long low, long high) { return _BUILTIN_RANGE_INT3(low, high, 1); }\n\nstatic PyObject *_BUILTIN_RANGE_INT(long boundary) {\n    PyObject *result = MAKE_LIST_EMPTY(boundary > 0 ? boundary : 0);\n\n    for (int i = 0; i < boundary; i++) {\n        PyList_SET_ITEM(result, i, PyInt_FromLong(i));\n    }\n\n    return result;\n}\n\nstatic PyObject *TO_RANGE_ARG(PyObject *value, char const *name) {\n    if (likely(PyInt_Check(value) || PyLong_Check(value))) {\n        Py_INCREF(value);\n        return value;\n    }\n\n    PyTypeObject *type = Py_TYPE(value);\n    PyNumberMethods *tp_as_number = type->tp_as_number;\n\n    // Everything that casts to int is allowed.\n    if (\n#if PYTHON_VERSION >= 0x270\n        PyFloat_Check(value) ||\n#endif\n        tp_as_number == NULL || tp_as_number->nb_int == NULL) {\n        PyErr_Format(PyExc_TypeError, \"range() integer %s argument expected, got %s.\", name, type->tp_name);\n        return NULL;\n    }\n\n    PyObject *result = tp_as_number->nb_int(value);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n\nNUITKA_DEFINE_BUILTIN(range);\n\nPyObject *BUILTIN_RANGE(PyThreadState *tstate, PyObject *boundary) {\n    PyObject *boundary_temp = TO_RANGE_ARG(boundary, \"end\");\n\n    if (unlikely(boundary_temp == NULL)) {\n        return NULL;\n    }\n\n    long start = PyInt_AsLong(boundary_temp);\n\n    if (start == -1 && DROP_ERROR_OCCURRED(tstate)) {\n        NUITKA_ASSIGN_BUILTIN(range);\n\n        PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(range), boundary_temp);\n\n        Py_DECREF(boundary_temp);\n\n        return result;\n    }\n    Py_DECREF(boundary_temp);\n\n    return _BUILTIN_RANGE_INT(start);\n}\n\nPyObject *BUILTIN_RANGE2(PyThreadState *tstate, PyObject *low, PyObject *high) {\n    PyObject *low_temp = TO_RANGE_ARG(low, \"start\");\n\n    if (unlikely(low_temp == NULL)) {\n        return NULL;\n    }\n\n    PyObject *high_temp = TO_RANGE_ARG(high, \"end\");\n\n    if (unlikely(high_temp == NULL)) {\n        Py_DECREF(low_temp);\n        return NULL;\n    }\n\n    bool fallback = false;\n\n    long start = PyInt_AsLong(low_temp);\n\n    if (unlikely(start == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        fallback = true;\n    }\n\n    long end = PyInt_AsLong(high_temp);\n\n    if (unlikely(end == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        fallback = true;\n    }\n\n    if (fallback) {\n        // Transfers references to tuple.\n        PyObject *pos_args = MAKE_TUPLE2_0(low_temp, high_temp);\n        NUITKA_ASSIGN_BUILTIN(range);\n\n        PyObject *result = CALL_FUNCTION_WITH_POSARGS2(tstate, NUITKA_ACCESS_BUILTIN(range), pos_args);\n\n        Py_DECREF(pos_args);\n\n        return result;\n    } else {\n        Py_DECREF(low_temp);\n        Py_DECREF(high_temp);\n\n        return _BUILTIN_RANGE_INT2(start, end);\n    }\n}\n\nPyObject *BUILTIN_RANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, PyObject *step) {\n    PyObject *low_temp = TO_RANGE_ARG(low, \"start\");\n\n    if (unlikely(low_temp == NULL)) {\n        return NULL;\n    }\n\n    PyObject *high_temp = TO_RANGE_ARG(high, \"end\");\n\n    if (unlikely(high_temp == NULL)) {\n        Py_DECREF(low_temp);\n        return NULL;\n    }\n\n    PyObject *step_temp = TO_RANGE_ARG(step, \"step\");\n\n    if (unlikely(high_temp == NULL)) {\n        Py_DECREF(low_temp);\n        Py_DECREF(high_temp);\n        return NULL;\n    }\n\n    bool fallback = false;\n\n    long start = PyInt_AsLong(low_temp);\n\n    if (unlikely(start == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        fallback = true;\n    }\n\n    long end = PyInt_AsLong(high_temp);\n\n    if (unlikely(end == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        fallback = true;\n    }\n\n    long step_long = PyInt_AsLong(step_temp);\n\n    if (unlikely(step_long == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        fallback = true;\n    }\n\n    if (fallback) {\n        PyObject *pos_args = MAKE_TUPLE3_0(low_temp, high_temp, step_temp);\n\n        NUITKA_ASSIGN_BUILTIN(range);\n\n        PyObject *result = CALL_FUNCTION_WITH_POSARGS3(tstate, NUITKA_ACCESS_BUILTIN(range), pos_args);\n\n        Py_DECREF(pos_args);\n\n        return result;\n    } else {\n        Py_DECREF(low_temp);\n        Py_DECREF(high_temp);\n        Py_DECREF(step_temp);\n\n        if (unlikely(step_long == 0)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"range() step argument must not be zero\");\n            return NULL;\n        }\n\n        return _BUILTIN_RANGE_INT3(start, end, step_long);\n    }\n}\n\n#endif\n\n#if PYTHON_VERSION < 0x300\n\n/* Same as CPython2: */\nstatic unsigned long getLengthOfRange(PyThreadState *tstate, long lo, long hi, long step) {\n    assert(step != 0);\n\n    if (step > 0 && lo < hi) {\n        return 1UL + (hi - 1UL - lo) / step;\n    } else if (step < 0 && lo > hi) {\n        return 1UL + (lo - 1UL - hi) / (0UL - step);\n    } else {\n        return 0UL;\n    }\n}\n\n/* Create a \"xrange\" object from C long values. Used for constant ranges. */\nPyObject *MAKE_XRANGE(PyThreadState *tstate, long start, long stop, long step) {\n    /* TODO: It would be sweet to calculate that on user side already. */\n    unsigned long n = getLengthOfRange(tstate, start, stop, step);\n\n    if (n > (unsigned long)LONG_MAX || (long)n > PY_SSIZE_T_MAX) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_OverflowError, \"xrange() result has too many items\");\n\n        return NULL;\n    }\n\n    struct _rangeobject2 *result = (struct _rangeobject2 *)PyObject_New(struct _rangeobject2, &PyRange_Type);\n    assert(result != NULL);\n\n    result->start = start;\n    result->len = (long)n;\n    result->step = step;\n\n    return (PyObject *)result;\n}\n\n#else\n\n/* Same as CPython3: */\nstatic PyObject *getLengthOfRange(PyThreadState *tstate, PyObject *start, PyObject *stop, PyObject *step) {\n    nuitka_bool nbool_res = RICH_COMPARE_GT_NBOOL_OBJECT_LONG(step, const_int_0);\n\n    if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n        return NULL;\n    }\n\n    PyObject *lo, *hi;\n\n    // Make sure we use step as a positive number.\n    if (nbool_res == NUITKA_BOOL_TRUE) {\n        lo = start;\n        hi = stop;\n\n        Py_INCREF(step);\n    } else {\n        lo = stop;\n        hi = start;\n\n        step = PyNumber_Negative(step);\n\n        if (unlikely(step == NULL)) {\n            return NULL;\n        }\n\n        nbool_res = RICH_COMPARE_EQ_NBOOL_OBJECT_LONG(step, const_int_0);\n\n        if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n            Py_DECREF(step);\n            return NULL;\n        }\n\n        if (unlikely(nbool_res == NUITKA_BOOL_TRUE)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"range() arg 3 must not be zero\");\n            Py_DECREF(step);\n\n            return NULL;\n        }\n    }\n\n    // Negative difference, we got zero length.\n    nbool_res = RICH_COMPARE_GE_NBOOL_OBJECT_OBJECT(lo, hi);\n\n    // No distance means we do not have any length to go.\n    if (nbool_res != NUITKA_BOOL_FALSE) {\n        Py_DECREF(step);\n\n        if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n            return NULL;\n        }\n\n        Py_INCREF(const_int_0);\n        return const_int_0;\n    }\n\n    // TODO: Use binary operations here, for now we only eliminated rich comparison API\n    PyObject *tmp1 = PyNumber_Subtract(hi, lo);\n\n    if (unlikely(tmp1 == NULL)) {\n        Py_DECREF(step);\n\n        return NULL;\n    }\n\n    PyObject *diff = PyNumber_Subtract(tmp1, const_int_pos_1);\n    Py_DECREF(tmp1);\n\n    if (unlikely(diff == NULL)) {\n        Py_DECREF(step);\n\n        return NULL;\n    }\n\n    tmp1 = PyNumber_FloorDivide(diff, step);\n    Py_DECREF(diff);\n    Py_DECREF(step);\n\n    if (unlikely(tmp1 == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = PyNumber_Add(tmp1, const_int_pos_1);\n    Py_DECREF(tmp1);\n\n    return result;\n}\n\nstatic PyObject *MAKE_XRANGE(PyThreadState *tstate, PyObject *start, PyObject *stop, PyObject *step) {\n    start = Nuitka_Number_IndexAsLong(start);\n    if (unlikely(start == NULL)) {\n        return NULL;\n    }\n    stop = Nuitka_Number_IndexAsLong(stop);\n    if (unlikely(stop == NULL)) {\n        return NULL;\n    }\n    step = Nuitka_Number_IndexAsLong(step);\n    if (unlikely(step == NULL)) {\n        return NULL;\n    }\n\n    PyObject *length = getLengthOfRange(tstate, start, stop, step);\n    if (unlikely(length == NULL)) {\n        return NULL;\n    }\n\n    struct _rangeobject3 *result = (struct _rangeobject3 *)PyObject_New(struct _rangeobject3, &PyRange_Type);\n    assert(result != NULL);\n\n    result->start = start;\n    result->stop = stop;\n    result->step = step;\n    result->length = length;\n\n    return (PyObject *)result;\n}\n#endif\n\n/* Built-in xrange (Python2) or xrange (Python3) with one argument. */\nPyObject *BUILTIN_XRANGE1(PyThreadState *tstate, PyObject *high) {\n#if PYTHON_VERSION < 0x300\n    if (unlikely(PyFloat_Check(high))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_high = PyInt_AsLong(high);\n\n    if (unlikely(int_high == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    return MAKE_XRANGE(tstate, 0, int_high, 1);\n#else\n    PyObject *stop = Nuitka_Number_IndexAsLong(high);\n\n    if (unlikely(stop == NULL)) {\n        return NULL;\n    }\n\n    PyObject *length = getLengthOfRange(tstate, const_int_0, stop, const_int_pos_1);\n    if (unlikely(length == NULL)) {\n        Py_DECREF(stop);\n\n        return NULL;\n    }\n\n    struct _rangeobject3 *result = (struct _rangeobject3 *)PyObject_New(struct _rangeobject3, &PyRange_Type);\n    assert(result != NULL);\n\n    result->start = const_int_0;\n    Py_INCREF(const_int_0);\n    result->stop = stop;\n    result->step = const_int_pos_1;\n    Py_INCREF(const_int_pos_1);\n\n    result->length = length;\n\n    return (PyObject *)result;\n#endif\n}\n\n/* Built-in xrange (Python2) or xrange (Python3) with two arguments. */\nPyObject *BUILTIN_XRANGE2(PyThreadState *tstate, PyObject *low, PyObject *high) {\n#if PYTHON_VERSION < 0x300\n    if (unlikely(PyFloat_Check(low))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_low = PyInt_AsLong(low);\n\n    if (unlikely(int_low == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (unlikely(PyFloat_Check(high))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_high = PyInt_AsLong(high);\n\n    if (unlikely(int_high == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    return MAKE_XRANGE(tstate, int_low, int_high, 1);\n#else\n    return MAKE_XRANGE(tstate, low, high, const_int_pos_1);\n#endif\n}\n\n/* Built-in xrange (Python2) or xrange (Python3) with three arguments. */\nPyObject *BUILTIN_XRANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, PyObject *step) {\n#if PYTHON_VERSION < 0x300\n    if (unlikely(PyFloat_Check(low))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_low = PyInt_AsLong(low);\n\n    if (unlikely(int_low == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (unlikely(PyFloat_Check(high))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_high = PyInt_AsLong(high);\n\n    if (unlikely(int_high == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (unlikely(PyFloat_Check(step))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"integer argument expected, got float\");\n\n        return NULL;\n    }\n\n    long int_step = PyInt_AsLong(step);\n\n    if (unlikely(int_step == -1 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (unlikely(int_step == 0)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"range() arg 3 must not be zero\");\n\n        return NULL;\n    }\n\n    return MAKE_XRANGE(tstate, int_low, int_high, int_step);\n#else\n    return MAKE_XRANGE(tstate, low, high, step);\n#endif\n}\n\nPyObject *BUILTIN_ALL(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n    PyObject *it = PyObject_GetIter(value);\n\n    if (unlikely((it == NULL))) {\n        return NULL;\n    }\n\n    iternextfunc iternext = Py_TYPE(it)->tp_iternext;\n    for (;;) {\n        PyObject *item = iternext(it);\n\n        if (unlikely((item == NULL)))\n            break;\n        int cmp = PyObject_IsTrue(item);\n        Py_DECREF(item);\n        if (unlikely(cmp < 0)) {\n            Py_DECREF(it);\n            return NULL;\n        }\n\n        if (cmp == 0) {\n            Py_DECREF(it);\n            Py_INCREF(Py_False);\n            return Py_False;\n        }\n    }\n\n    Py_DECREF(it);\n\n    if (unlikely(!CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    Py_INCREF(Py_True);\n    return Py_True;\n}\n\nPyObject *BUILTIN_LEN(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n    Py_ssize_t res = Nuitka_PyObject_Size(value);\n\n    if (unlikely(res < 0 && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    return PyInt_FromSsize_t(res);\n}\n\nPyObject *BUILTIN_ANY(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n    PyObject *it = PyObject_GetIter(value);\n\n    if (unlikely((it == NULL))) {\n        return NULL;\n    }\n\n    iternextfunc iternext = Py_TYPE(it)->tp_iternext;\n    for (;;) {\n        PyObject *item = iternext(it);\n\n        if (unlikely((item == NULL)))\n            break;\n        int cmp = PyObject_IsTrue(item);\n        Py_DECREF(item);\n        if (unlikely(cmp < 0)) {\n            Py_DECREF(it);\n            return NULL;\n        }\n        if (cmp > 0) {\n            Py_DECREF(it);\n            Py_INCREF(Py_True);\n            return Py_True;\n        }\n    }\n\n    Py_DECREF(it);\n    if (unlikely(!CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    Py_INCREF(Py_False);\n    return Py_False;\n}\n\nPyObject *BUILTIN_ABS(PyObject *o) {\n    CHECK_OBJECT(o);\n\n    PyNumberMethods *m = o->ob_type->tp_as_number;\n    if (likely(m && m->nb_absolute)) {\n        return m->nb_absolute(o);\n    }\n\n    return PyErr_Format(PyExc_TypeError, \"bad operand type for abs(): '%s'\", Py_TYPE(o)->tp_name);\n}\n\nNUITKA_DEFINE_BUILTIN(format);\n\nPyObject *BUILTIN_FORMAT(PyThreadState *tstate, PyObject *value, PyObject *format_spec) {\n    CHECK_OBJECT(value);\n    CHECK_OBJECT(format_spec);\n\n    NUITKA_ASSIGN_BUILTIN(format);\n\n    PyObject *args[2] = {value, format_spec};\n\n    return CALL_FUNCTION_WITH_ARGS2(tstate, NUITKA_ACCESS_BUILTIN(format), args);\n}\n\n// Helper functions for print. Need to play nice with Python softspace\n// behaviour.\n\n#if PYTHON_VERSION >= 0x300\nNUITKA_DEFINE_BUILTIN(print);\n#endif\n\nbool PRINT_NEW_LINE_TO(PyObject *file) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n#if PYTHON_VERSION < 0x300\n    if (file == NULL || file == Py_None) {\n        file = GET_STDOUT();\n\n        if (unlikely(file == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"lost sys.stdout\");\n            return false;\n        }\n    }\n\n    // need to hold a reference to the file or else __getattr__ may release\n    // \"file\" in the mean time.\n    Py_INCREF(file);\n\n    if (unlikely(PyFile_WriteString(\"\\n\", file) == -1)) {\n        Py_DECREF(file);\n        return false;\n    }\n\n    PyFile_SoftSpace(file, 0);\n    CHECK_OBJECT(file);\n\n    Py_DECREF(file);\n    return true;\n#else\n    NUITKA_ASSIGN_BUILTIN(print);\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n    FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    PyObject *result;\n\n    if (likely(file == NULL)) {\n        result = CALL_FUNCTION_NO_ARGS(tstate, NUITKA_ACCESS_BUILTIN(print));\n    } else {\n        PyObject *kw_pairs[2] = {const_str_plain_file, GET_STDOUT()};\n        PyObject *kw_args = MAKE_DICT(kw_pairs, 1);\n\n        // TODO: This should use something that does not build a dictionary at all, and not\n        // uses a tuple.\n        result = CALL_FUNCTION_WITH_KEYARGS(tstate, NUITKA_ACCESS_BUILTIN(print), kw_args);\n\n        Py_DECREF(kw_args);\n    }\n\n    Py_XDECREF(result);\n\n    RESTORE_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    return result != NULL;\n#endif\n}\n\nbool PRINT_ITEM_TO(PyObject *file, PyObject *object) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n// The print built-in function cannot replace \"softspace\" behavior of CPython\n// print statement, so this code is really necessary.\n#if PYTHON_VERSION < 0x300\n    if (file == NULL || file == Py_None) {\n        file = GET_STDOUT();\n\n        if (unlikely(file == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"lost sys.stdout\");\n            return false;\n        }\n    }\n\n    CHECK_OBJECT(file);\n    CHECK_OBJECT(object);\n\n    // need to hold a reference to the file or else \"__getattr__\" code may\n    // release \"file\" in the mean time.\n    Py_INCREF(file);\n\n    // Check for soft space indicator\n    if (PyFile_SoftSpace(file, 0)) {\n        if (unlikely(PyFile_WriteString(\" \", file) == -1)) {\n            Py_DECREF(file);\n            return false;\n        }\n    }\n\n    if (unlikely(PyFile_WriteObject(object, file, Py_PRINT_RAW) == -1)) {\n        Py_DECREF(file);\n        return false;\n    }\n\n    if (PyString_Check(object)) {\n        char *buffer;\n        Py_ssize_t length;\n\n#ifndef __NUITKA_NO_ASSERT__\n        int status =\n#endif\n            PyString_AsStringAndSize(object, &buffer, &length);\n        assert(status != -1);\n\n        if (length == 0 || !isspace(Py_CHARMASK(buffer[length - 1])) || buffer[length - 1] == ' ') {\n            PyFile_SoftSpace(file, 1);\n        }\n    } else if (PyUnicode_Check(object)) {\n        Py_UNICODE *buffer = PyUnicode_AS_UNICODE(object);\n        Py_ssize_t length = PyUnicode_GET_SIZE(object);\n\n        if (length == 0 || !Py_UNICODE_ISSPACE(buffer[length - 1]) || buffer[length - 1] == ' ') {\n            PyFile_SoftSpace(file, 1);\n        }\n    } else {\n        PyFile_SoftSpace(file, 1);\n    }\n\n    CHECK_OBJECT(file);\n    Py_DECREF(file);\n\n    return true;\n#else\n    NUITKA_ASSIGN_BUILTIN(print);\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n    FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    // TODO: Have a helper that creates a dictionary for PyObject **\n    PyObject *print_kw = MAKE_DICT_EMPTY();\n    DICT_SET_ITEM(print_kw, const_str_plain_end, const_str_empty);\n\n    if (file == NULL) {\n        DICT_SET_ITEM(print_kw, const_str_plain_file, GET_STDOUT());\n    } else {\n        DICT_SET_ITEM(print_kw, const_str_plain_file, file);\n    }\n\n    PyObject *print_args = MAKE_TUPLE1(object);\n\n    PyObject *result = CALL_FUNCTION(tstate, NUITKA_ACCESS_BUILTIN(print), print_args, print_kw);\n\n    Py_DECREF(print_args);\n    Py_DECREF(print_kw);\n\n    Py_XDECREF(result);\n\n    RESTORE_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    return result != NULL;\n#endif\n}\n\nvoid PRINT_REFCOUNT(PyObject *object) {\n    if (object) {\n        char buffer[1024];\n        snprintf(buffer, sizeof(buffer) - 1, \" refcnt %\" PY_FORMAT_SIZE_T \"d \", Py_REFCNT(object));\n\n        PRINT_STRING(buffer);\n    } else {\n        PRINT_STRING(\"<null>\");\n    }\n}\n\nbool PRINT_STRING(char const *str) {\n    if (str) {\n        PyObject *tmp = PyUnicode_FromString(str);\n        bool res = PRINT_ITEM(tmp);\n        Py_DECREF(tmp);\n        return res;\n    } else {\n        return PRINT_STRING(\"<nullstr>\");\n    }\n}\n\nbool PRINT_FORMAT(char const *fmt, ...) {\n    va_list args;\n    va_start(args, fmt);\n\n    // Only used for debug purposes, lets be unsafe here.\n    char buffer[4096];\n\n    vsprintf(buffer, fmt, args);\n    return PRINT_STRING(buffer);\n}\n\nbool PRINT_REPR(PyObject *object) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n    FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    bool res;\n\n    if (object != NULL) {\n        CHECK_OBJECT(object);\n\n        // Cannot have error set for this function, it asserts against that\n        // in debug builds.\n        PyObject *repr = PyObject_Repr(object);\n\n        res = PRINT_ITEM(repr);\n        Py_DECREF(repr);\n    } else {\n        res = PRINT_NULL();\n    }\n\n    RESTORE_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n    return res;\n}\n\nbool PRINT_NULL(void) { return PRINT_STRING(\"<NULL>\"); }\n\nbool PRINT_TYPE(PyObject *object) { return PRINT_ITEM((PyObject *)Py_TYPE(object)); }\n\n#if PYTHON_VERSION < 0x3b0\nvoid _PRINT_EXCEPTION(PyObject *exception_type, PyObject *exception_value, PyTracebackObject *exception_tb) {\n#else\nvoid _PRINT_EXCEPTION(PyObject *exception_value) {\n    PyObject *exception_type = exception_value ? PyExceptionInstance_Class(exception_value) : NULL;\n    PyTracebackObject *exception_tb = (exception_value && PyExceptionInstance_Check(exception_value))\n                                          ? GET_EXCEPTION_TRACEBACK(exception_value)\n                                          : NULL;\n#endif\n    PRINT_REPR(exception_type);\n    if (exception_type) {\n        PRINT_REFCOUNT(exception_type);\n    }\n    PRINT_STRING(\"|\");\n    PRINT_REPR(exception_value);\n    if (exception_value) {\n        PRINT_REFCOUNT(exception_value);\n    }\n#if PYTHON_VERSION >= 0x300\n    if (exception_value != NULL && PyExceptionInstance_Check(exception_value)) {\n        PRINT_STRING(\" <- context \");\n        PyObject *context = PyException_GetContext(exception_value);\n        PRINT_REPR(context);\n        Py_XDECREF(context);\n    }\n#endif\n    PRINT_STRING(\"|\");\n    PRINT_REPR((PyObject *)exception_tb);\n\n    PRINT_NEW_LINE();\n}\n\nvoid PRINT_CURRENT_EXCEPTION(void) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PRINT_STRING(\"current_exc=\");\n#if PYTHON_VERSION < 0x3c0\n    PRINT_EXCEPTION(tstate->curexc_type, tstate->curexc_value, (PyTracebackObject *)tstate->curexc_traceback);\n#else\n    _PRINT_EXCEPTION(tstate->exc_info->exc_value);\n#endif\n}\n\nvoid PRINT_PUBLISHED_EXCEPTION(void) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PRINT_STRING(\"thread_exc=\");\n    PRINT_EXCEPTION(EXC_TYPE(tstate), EXC_VALUE(tstate), EXC_TRACEBACK(tstate));\n}\n\n// TODO: Could be ported, the \"printf\" stuff would need to be split. On Python3\n// the normal C print output gets lost.\n#if PYTHON_VERSION < 0x300\nvoid PRINT_TRACEBACK(PyTracebackObject *traceback) {\n    PRINT_STRING(\"Dumping traceback:\\n\");\n\n    if (traceback == NULL)\n        PRINT_STRING(\"<NULL traceback?!>\\n\");\n\n    while (traceback != NULL) {\n        printf(\" line %d (frame object chain):\\n\", traceback->tb_lineno);\n\n        PyFrameObject *frame = traceback->tb_frame;\n\n        while (frame != NULL) {\n            printf(\"  Frame at %s\\n\", PyString_AsString(PyObject_Str((PyObject *)frame->f_code)));\n\n            frame = frame->f_back;\n        }\n\n        assert(traceback->tb_next != traceback);\n        traceback = traceback->tb_next;\n    }\n\n    PRINT_STRING(\"End of Dump.\\n\");\n}\n#endif\n\nPyObject *GET_STDOUT(void) {\n    PyObject *result = Nuitka_SysGetObject(\"stdout\");\n\n    if (unlikely(result == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"lost sys.stdout\");\n        return NULL;\n    }\n\n    return result;\n}\n\nPyObject *GET_STDERR(void) {\n    PyObject *result = Nuitka_SysGetObject(\"stderr\");\n\n    if (unlikely(result == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"lost sys.stderr\");\n        return NULL;\n    }\n\n    return result;\n}\n\nbool PRINT_NEW_LINE(void) { return PRINT_NEW_LINE_TO(NULL); }\n\nbool PRINT_ITEM(PyObject *object) {\n    if (object == NULL) {\n        return PRINT_NULL();\n    } else {\n        return PRINT_ITEM_TO(NULL, object);\n    }\n}\n\n#if PYTHON_VERSION < 0x300\n\nstatic void set_slot(PyObject **slot, PyObject *value) {\n    PyObject *temp = *slot;\n    Py_XINCREF(value);\n    *slot = value;\n    Py_XDECREF(temp);\n}\n\nstatic void set_attr_slots(PyClassObject *klass) {\n    set_slot(&klass->cl_getattr, FIND_ATTRIBUTE_IN_CLASS(klass, const_str_plain___getattr__));\n    set_slot(&klass->cl_setattr, FIND_ATTRIBUTE_IN_CLASS(klass, const_str_plain___setattr__));\n    set_slot(&klass->cl_delattr, FIND_ATTRIBUTE_IN_CLASS(klass, const_str_plain___delattr__));\n}\n\nstatic bool set_dict(PyClassObject *klass, PyObject *value) {\n    if (value == NULL || !PyDict_Check(value)) {\n        PyThreadState *tstate = PyThreadState_GET();\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__dict__ must be a dictionary object\");\n        return false;\n    } else {\n        set_slot(&klass->cl_dict, value);\n        set_attr_slots(klass);\n\n        return true;\n    }\n}\n\nstatic bool set_bases(PyClassObject *klass, PyObject *value) {\n    if (value == NULL || !PyTuple_Check(value)) {\n\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__bases__ must be a tuple object\");\n        return false;\n    } else {\n        Py_ssize_t n = PyTuple_GET_SIZE(value);\n\n        for (Py_ssize_t i = 0; i < n; i++) {\n            PyObject *base = PyTuple_GET_ITEM(value, i);\n\n            if (unlikely(!PyClass_Check(base))) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__bases__ items must be classes\");\n                return false;\n            }\n\n            if (unlikely(PyClass_IsSubclass(base, (PyObject *)klass))) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                                \"a __bases__ item causes an inheritance cycle\");\n                return false;\n            }\n        }\n\n        set_slot(&klass->cl_bases, value);\n        set_attr_slots(klass);\n\n        return true;\n    }\n}\n\nstatic bool set_name(PyClassObject *klass, PyObject *value) {\n    if (value == NULL || !PyDict_Check(value)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be a string object\");\n        return false;\n    }\n\n    if (strlen(PyString_AS_STRING(value)) != (size_t)PyString_GET_SIZE(value)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must not contain null bytes\");\n        return false;\n    }\n\n    set_slot(&klass->cl_name, value);\n    return true;\n}\n\nstatic int nuitka_class_setattr(PyClassObject *klass, PyObject *attr_name, PyObject *value) {\n    char const *sattr_name = PyString_AsString(attr_name);\n\n    if (sattr_name[0] == '_' && sattr_name[1] == '_') {\n        Py_ssize_t n = PyString_Size(attr_name);\n\n        if (sattr_name[n - 2] == '_' && sattr_name[n - 1] == '_') {\n            if (strcmp(sattr_name, \"__dict__\") == 0) {\n                if (set_dict(klass, value) == false) {\n                    return -1;\n                } else {\n                    return 0;\n                }\n            } else if (strcmp(sattr_name, \"__bases__\") == 0) {\n                if (set_bases(klass, value) == false) {\n                    return -1;\n                } else {\n                    return 0;\n                }\n            } else if (strcmp(sattr_name, \"__name__\") == 0) {\n                if (set_name(klass, value) == false) {\n                    return -1;\n                } else {\n                    return 0;\n                }\n            } else if (strcmp(sattr_name, \"__getattr__\") == 0) {\n                set_slot(&klass->cl_getattr, value);\n            } else if (strcmp(sattr_name, \"__setattr__\") == 0) {\n                set_slot(&klass->cl_setattr, value);\n            } else if (strcmp(sattr_name, \"__delattr__\") == 0) {\n                set_slot(&klass->cl_delattr, value);\n            }\n        }\n    }\n\n    if (value == NULL) {\n        int status = DICT_REMOVE_ITEM(klass->cl_dict, attr_name);\n\n        if (status < 0) {\n            PyErr_Format(PyExc_AttributeError, \"class %s has no attribute '%s'\", PyString_AS_STRING(klass->cl_name),\n                         sattr_name);\n        }\n\n        return status;\n    } else {\n        return DICT_SET_ITEM(klass->cl_dict, attr_name, value) ? 0 : -1;\n    }\n}\n\nstatic PyObject *nuitka_class_getattr(PyClassObject *klass, PyObject *attr_name) {\n    char const *sattr_name = PyString_AsString(attr_name);\n\n    if (sattr_name[0] == '_' && sattr_name[1] == '_') {\n        if (strcmp(sattr_name, \"__dict__\") == 0) {\n            Py_INCREF(klass->cl_dict);\n            return klass->cl_dict;\n        } else if (strcmp(sattr_name, \"__bases__\") == 0) {\n            Py_INCREF(klass->cl_bases);\n            return klass->cl_bases;\n        } else if (strcmp(sattr_name, \"__name__\") == 0) {\n            if (klass->cl_name == NULL) {\n                Py_INCREF(Py_None);\n                return Py_None;\n            } else {\n                Py_INCREF(klass->cl_name);\n                return klass->cl_name;\n            }\n        }\n    }\n\n    PyObject *value = FIND_ATTRIBUTE_IN_CLASS(klass, attr_name);\n\n    if (unlikely(value == NULL)) {\n        PyErr_Format(PyExc_AttributeError, \"class %s has no attribute '%s'\", PyString_AS_STRING(klass->cl_name),\n                     sattr_name);\n        return NULL;\n    }\n\n    PyTypeObject *type = Py_TYPE(value);\n\n    descrgetfunc tp_descr_get = NuitkaType_HasFeatureClass(type) ? type->tp_descr_get : NULL;\n\n    if (tp_descr_get == NULL) {\n        Py_INCREF(value);\n        return value;\n    } else {\n        return tp_descr_get(value, (PyObject *)NULL, (PyObject *)klass);\n    }\n}\n\n#endif\n\nvoid enhancePythonTypes(void) {\n#if PYTHON_VERSION < 0x300\n    // Our own variant won't call PyEval_GetRestricted, saving quite some cycles\n    // not doing that.\n    PyClass_Type.tp_setattro = (setattrofunc)nuitka_class_setattr;\n    PyClass_Type.tp_getattro = (getattrofunc)nuitka_class_getattr;\n#endif\n}\n\n#ifdef __FreeBSD__\n#include <floatingpoint.h>\n#endif\n\n#define ITERATOR_GENERIC 0\n#define ITERATOR_COMPILED_GENERATOR 1\n#define ITERATOR_TUPLE 2\n#define ITERATOR_LIST 3\n\nstruct Nuitka_QuickIterator {\n    int iterator_mode;\n\n    union {\n        // ITERATOR_GENERIC\n        PyObject *iter;\n\n        // ITERATOR_COMPILED_GENERATOR\n        struct Nuitka_GeneratorObject *generator;\n\n        // ITERATOR_TUPLE\n        struct {\n            PyTupleObject *tuple;\n            Py_ssize_t tuple_index;\n        } tuple_data;\n\n        // ITERATOR_LIST\n        struct {\n            PyListObject *list;\n            Py_ssize_t list_index;\n        } list_data;\n    } iterator_data;\n};\n\nstatic bool MAKE_QUICK_ITERATOR(PyThreadState *tstate, PyObject *sequence, struct Nuitka_QuickIterator *qiter) {\n    if (Nuitka_Generator_Check(sequence)) {\n        qiter->iterator_mode = ITERATOR_COMPILED_GENERATOR;\n        qiter->iterator_data.generator = (struct Nuitka_GeneratorObject *)sequence;\n    } else if (PyTuple_CheckExact(sequence)) {\n        qiter->iterator_mode = ITERATOR_TUPLE;\n        qiter->iterator_data.tuple_data.tuple = (PyTupleObject *)sequence;\n        qiter->iterator_data.tuple_data.tuple_index = 0;\n    } else if (PyList_CheckExact(sequence)) {\n        qiter->iterator_mode = ITERATOR_LIST;\n        qiter->iterator_data.list_data.list = (PyListObject *)sequence;\n        qiter->iterator_data.list_data.list_index = 0;\n    } else {\n        qiter->iterator_mode = ITERATOR_GENERIC;\n\n        qiter->iterator_data.iter = MAKE_ITERATOR(tstate, sequence);\n        if (unlikely(qiter->iterator_data.iter == NULL)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nstatic PyObject *QUICK_ITERATOR_NEXT(PyThreadState *tstate, struct Nuitka_QuickIterator *qiter, bool *finished) {\n    PyObject *result;\n\n    switch (qiter->iterator_mode) {\n    case ITERATOR_GENERIC:\n        result = ITERATOR_NEXT(qiter->iterator_data.iter);\n\n        if (result == NULL) {\n            Py_DECREF(qiter->iterator_data.iter);\n\n            if (unlikely(!CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate))) {\n                *finished = false;\n                return NULL;\n            }\n\n            *finished = true;\n            return NULL;\n        }\n\n        *finished = false;\n        return result;\n    case ITERATOR_COMPILED_GENERATOR:\n        result = Nuitka_Generator_qiter(tstate, qiter->iterator_data.generator, finished);\n\n        return result;\n    case ITERATOR_TUPLE:\n        if (qiter->iterator_data.tuple_data.tuple_index < PyTuple_GET_SIZE(qiter->iterator_data.tuple_data.tuple)) {\n            result =\n                PyTuple_GET_ITEM(qiter->iterator_data.tuple_data.tuple, qiter->iterator_data.tuple_data.tuple_index);\n            qiter->iterator_data.tuple_data.tuple_index += 1;\n\n            *finished = false;\n\n            Py_INCREF(result);\n            return result;\n        } else {\n            *finished = true;\n            return NULL;\n        }\n    case ITERATOR_LIST:\n        if (qiter->iterator_data.list_data.list_index < PyList_GET_SIZE(qiter->iterator_data.list_data.list)) {\n            result = PyList_GET_ITEM(qiter->iterator_data.list_data.list, qiter->iterator_data.list_data.list_index);\n            qiter->iterator_data.list_data.list_index += 1;\n\n            *finished = false;\n\n            Py_INCREF(result);\n            return result;\n        } else {\n            *finished = true;\n            return NULL;\n        }\n    }\n\n    assert(false);\n    return NULL;\n}\n\nPyObject *BUILTIN_SUM1(PyThreadState *tstate, PyObject *sequence) {\n    struct Nuitka_QuickIterator qiter;\n\n    if (unlikely(MAKE_QUICK_ITERATOR(tstate, sequence, &qiter) == false)) {\n        return NULL;\n    }\n\n    PyObject *result;\n\n    long int_result = 0;\n\n    PyObject *item;\n\n    for (;;) {\n        bool finished;\n\n        item = QUICK_ITERATOR_NEXT(tstate, &qiter, &finished);\n\n        if (finished) {\n#if PYTHON_VERSION < 0x300\n            return PyInt_FromLong(int_result);\n#else\n            return PyLong_FromLong(int_result);\n#endif\n        } else if (item == NULL) {\n            return NULL;\n        }\n\n        CHECK_OBJECT(item);\n\n// For Python2 int objects:\n#if PYTHON_VERSION < 0x300\n        if (PyInt_CheckExact(item)) {\n            long b = PyInt_AS_LONG(item);\n            long x = int_result + b;\n\n            if ((x ^ int_result) >= 0 || (x ^ b) >= 0) {\n                int_result = x;\n                Py_DECREF(item);\n\n                continue;\n            }\n        }\n#endif\n\n// For Python2 long, Python3 int objects\n#if PYTHON_VERSION >= 0x270\n        if (PyLong_CheckExact(item)) {\n            int overflow;\n            long b = PyLong_AsLongAndOverflow(item, &overflow);\n\n            if (overflow) {\n                break;\n            }\n\n            long x = int_result + b;\n\n            if ((x ^ int_result) >= 0 || (x ^ b) >= 0) {\n                int_result = x;\n                Py_DECREF(item);\n\n                continue;\n            }\n        }\n#endif\n\n        if (item == Py_False) {\n            Py_DECREF(item);\n            continue;\n        }\n\n        if (item == Py_True) {\n            long b = 1;\n            long x = int_result + b;\n\n            if ((x ^ int_result) >= 0 || (x ^ b) >= 0) {\n                int_result = x;\n                Py_DECREF(item);\n\n                continue;\n            }\n        }\n\n        /* Either overflowed or not one of the supported int alike types. */\n        break;\n    }\n\n/* Switch over to objects, and redo last step. */\n#if PYTHON_VERSION < 0x300\n    result = PyInt_FromLong(int_result);\n#else\n    result = PyLong_FromLong(int_result);\n#endif\n    CHECK_OBJECT(result);\n\n    PyObject *temp = PyNumber_Add(result, item);\n    Py_DECREF(result);\n    Py_DECREF(item);\n    result = temp;\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    for (;;) {\n        CHECK_OBJECT(result);\n\n        bool finished;\n        item = QUICK_ITERATOR_NEXT(tstate, &qiter, &finished);\n\n        if (finished) {\n            break;\n        } else if (item == NULL) {\n            Py_DECREF(result);\n            return NULL;\n        }\n\n        CHECK_OBJECT(item);\n\n        PyObject *temp2 = PyNumber_Add(result, item);\n\n        Py_DECREF(item);\n        Py_DECREF(result);\n\n        if (unlikely(temp2 == NULL)) {\n            return NULL;\n        }\n\n        result = temp2;\n    }\n\n    CHECK_OBJECT(result);\n\n    return result;\n}\n\nNUITKA_DEFINE_BUILTIN(sum);\n\nPyObject *BUILTIN_SUM2(PyThreadState *tstate, PyObject *sequence, PyObject *start) {\n    NUITKA_ASSIGN_BUILTIN(sum);\n\n    CHECK_OBJECT(sequence);\n    CHECK_OBJECT(start);\n\n    PyObject *pos_args = MAKE_TUPLE2(sequence, start);\n\n    PyObject *result = CALL_FUNCTION_WITH_POSARGS2(tstate, NUITKA_ACCESS_BUILTIN(sum), pos_args);\n\n    Py_DECREF(pos_args);\n\n    return result;\n}\n\nPyDictObject *dict_builtin = NULL;\nPyModuleObject *builtin_module = NULL;\n\nstatic PyTypeObject Nuitka_BuiltinModule_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_module\", // tp_name\n    sizeof(PyModuleObject),                           // tp_size\n};\n\nint Nuitka_BuiltinModule_SetAttr(PyModuleObject *module, PyObject *name, PyObject *value) {\n    CHECK_OBJECT(module);\n    CHECK_OBJECT(name);\n\n    // This is used for \"del\" as well.\n    assert(value == NULL || Py_REFCNT(value) > 0);\n\n    // only checks the builtins that we can refresh at this time, if we have\n    // many value to check maybe need create a dict first.\n    bool found = false;\n\n    int res = PyObject_RichCompareBool(name, const_str_plain_open, Py_EQ);\n\n    if (unlikely(res == -1)) {\n        return -1;\n    }\n    if (res == 1) {\n        NUITKA_UPDATE_BUILTIN(open, value);\n        found = true;\n    }\n\n    if (found == false) {\n        res = PyObject_RichCompareBool(name, const_str_plain___import__, Py_EQ);\n\n        if (unlikely(res == -1)) {\n            return -1;\n        }\n\n        if (res == 1) {\n            NUITKA_UPDATE_BUILTIN(__import__, value);\n            found = true;\n        }\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (found == false) {\n        res = PyObject_RichCompareBool(name, const_str_plain_print, Py_EQ);\n\n        if (unlikely(res == -1)) {\n            return -1;\n        }\n\n        if (res == 1) {\n            NUITKA_UPDATE_BUILTIN(print, value);\n            found = true;\n        }\n    }\n#endif\n\n    if (found == false) {\n        res = PyObject_RichCompareBool(name, const_str_plain_super, Py_EQ);\n\n        if (unlikely(res == -1)) {\n            return -1;\n        }\n\n        if (res == 1) {\n            NUITKA_UPDATE_BUILTIN(super, value);\n            found = true;\n        }\n    }\n\n    return PyObject_GenericSetAttr((PyObject *)module, name, value);\n}\n\n#if defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <sys/sysctl.h>\n#endif\n\nstatic PyObject *getPathSeparatorStringObject(void) {\n    static char const sep[2] = {SEP, 0};\n\n    static PyObject *sep_str = NULL;\n\n    if (sep_str == NULL) {\n        sep_str = Nuitka_String_FromString(sep);\n    }\n\n    CHECK_OBJECT(sep_str);\n\n    return sep_str;\n}\n\nPyObject *JOIN_PATH2(PyObject *dirname, PyObject *filename) {\n    CHECK_OBJECT(dirname);\n    CHECK_OBJECT(filename);\n\n    // Avoid string APIs, so str, unicode doesn't matter for input.\n    PyObject *result = dirname;\n\n    if (dirname != const_str_empty) {\n        result = PyNumber_InPlaceAdd(result, getPathSeparatorStringObject());\n        CHECK_OBJECT(result);\n    }\n\n    result = PyNumber_InPlaceAdd(result, filename);\n    CHECK_OBJECT(result);\n\n    return result;\n}\n\n#if defined(_WIN32)\n// Replacement for RemoveFileSpecW, slightly smaller, avoids a link library.\nNUITKA_MAY_BE_UNUSED static void stripFilenameW(wchar_t *path) {\n    wchar_t *last_slash = NULL;\n\n    while (*path != 0) {\n        if (*path == L'\\\\') {\n            last_slash = path;\n        }\n\n        path++;\n    }\n\n    if (last_slash != NULL) {\n        *last_slash = 0;\n    }\n}\n#endif\n\n#if defined(_NUITKA_EXE)\n\nwchar_t const *getBinaryDirectoryWideChars(bool resolve_symlinks) {\n    static wchar_t binary_directory[MAXPATHLEN + 1];\n    static bool init_done = false;\n\n    if (init_done == false) {\n        binary_directory[0] = 0;\n\n#if defined(_WIN32)\n        copyStringSafeW(binary_directory, getBinaryFilenameWideChars(resolve_symlinks),\n                        sizeof(binary_directory) / sizeof(wchar_t));\n\n        stripFilenameW(binary_directory);\n\n        // Query length of result first.\n        DWORD length = GetShortPathNameW(binary_directory, NULL, 0);\n        assert(length != 0);\n\n        wchar_t *short_binary_directory = (wchar_t *)malloc((length + 1) * sizeof(wchar_t));\n        DWORD res = GetShortPathNameW(binary_directory, short_binary_directory, length);\n        assert(res != 0);\n\n        if (unlikely(res > length)) {\n            abort();\n        }\n\n        binary_directory[0] = 0;\n        appendWStringSafeW(binary_directory, short_binary_directory, sizeof(binary_directory) / sizeof(wchar_t));\n\n        free(short_binary_directory);\n#else\n        appendStringSafeW(binary_directory, getBinaryDirectoryHostEncoded(true),\n                          sizeof(binary_directory) / sizeof(wchar_t));\n#endif\n\n        init_done = true;\n    }\n    return (wchar_t const *)binary_directory;\n}\n\n#if defined(_WIN32)\nchar const *getBinaryDirectoryHostEncoded(bool resolve_symlinks) {\n    static char *binary_directory = NULL;\n    static char *binary_directory_resolved = NULL;\n\n    char *binary_directory_target;\n\n    if (resolve_symlinks) {\n        binary_directory_target = binary_directory_resolved;\n    } else {\n        binary_directory_target = binary_directory;\n    }\n\n    if (binary_directory_target != NULL) {\n        return binary_directory_target;\n    }\n    wchar_t const *w = getBinaryDirectoryWideChars(resolve_symlinks);\n\n    DWORD bufsize = WideCharToMultiByte(CP_ACP, 0, w, -1, NULL, 0, NULL, NULL);\n    assert(bufsize != 0);\n\n    binary_directory_target = (char *)malloc(bufsize + 1);\n    assert(binary_directory_target);\n\n    DWORD res2 = WideCharToMultiByte(CP_ACP, 0, w, -1, binary_directory_target, bufsize, NULL, NULL);\n    assert(res2 != 0);\n\n    if (unlikely(res2 > bufsize)) {\n        abort();\n    }\n\n    return (char const *)binary_directory_target;\n}\n\n#else\n\nchar const *getBinaryDirectoryHostEncoded(bool resolve_symlinks) {\n    const int buffer_size = MAXPATHLEN + 1;\n\n    static char binary_directory[MAXPATHLEN + 1] = {0};\n    static char binary_directory_resolved[MAXPATHLEN + 1] = {0};\n\n    char *binary_directory_target;\n\n    if (resolve_symlinks) {\n        binary_directory_target = binary_directory_resolved;\n    } else {\n        binary_directory_target = binary_directory;\n    }\n\n    if (*binary_directory_target != 0) {\n        return binary_directory_target;\n    }\n\n    // Get the filename first.\n    copyStringSafe(binary_directory_target, getBinaryFilenameHostEncoded(resolve_symlinks), buffer_size);\n\n    // We want the directory name, the above gives the full executable name.\n    copyStringSafe(binary_directory_target, dirname(binary_directory_target), buffer_size);\n\n    return binary_directory_target;\n}\n\n#endif\n\n#ifdef _NUITKA_STANDALONE\nstatic PyObject *getBinaryFilenameObject(bool resolve_symlinks) {\n    static PyObject *binary_filename = NULL;\n    static PyObject *binary_filename_resolved = NULL;\n\n    PyObject **binary_object_target;\n\n    if (resolve_symlinks) {\n        binary_object_target = &binary_filename_resolved;\n    } else {\n        binary_object_target = &binary_filename;\n    }\n\n    if (*binary_object_target != NULL) {\n        CHECK_OBJECT(*binary_object_target);\n\n        return *binary_object_target;\n    }\n\n// On Python3, this must be a unicode object, it cannot be on Python2,\n// there e.g. code objects expect Python2 strings.\n#if PYTHON_VERSION >= 0x300\n#ifdef _WIN32\n    wchar_t const *exe_filename = getBinaryFilenameWideChars(resolve_symlinks);\n    *binary_object_target = NuitkaUnicode_FromWideChar(exe_filename, -1);\n#else\n    *binary_object_target = PyUnicode_DecodeFSDefault(getBinaryFilenameHostEncoded(resolve_symlinks));\n#endif\n#else\n    *binary_object_target = PyString_FromString(getBinaryFilenameHostEncoded(resolve_symlinks));\n#endif\n\n    if (unlikely(*binary_object_target == NULL)) {\n        PyErr_Print();\n        abort();\n    }\n\n    // Make sure it's usable for caching.\n    Py_INCREF(*binary_object_target);\n\n    return *binary_object_target;\n}\n#endif\n\nPyObject *getBinaryDirectoryObject(bool resolve_symlinks) {\n    static PyObject *binary_directory = NULL;\n    static PyObject *binary_directory_resolved = NULL;\n\n    PyObject **binary_object_target;\n\n    if (resolve_symlinks) {\n        binary_object_target = &binary_directory_resolved;\n    } else {\n        binary_object_target = &binary_directory;\n    }\n\n    if (*binary_object_target != NULL) {\n        CHECK_OBJECT(*binary_object_target);\n\n        return *binary_object_target;\n    }\n\n// On Python3, this must be a unicode object, it cannot be on Python2,\n// there e.g. code objects expect Python2 strings.\n#if PYTHON_VERSION >= 0x300\n#ifdef _WIN32\n    wchar_t const *bin_directory = getBinaryDirectoryWideChars(resolve_symlinks);\n    *binary_object_target = NuitkaUnicode_FromWideChar(bin_directory, -1);\n#else\n    *binary_object_target = PyUnicode_DecodeFSDefault(getBinaryDirectoryHostEncoded(resolve_symlinks));\n#endif\n#else\n    *binary_object_target = PyString_FromString(getBinaryDirectoryHostEncoded(resolve_symlinks));\n#endif\n\n    if (unlikely(*binary_object_target == NULL)) {\n        PyErr_Print();\n        abort();\n    }\n\n    // Make sure it's usable for caching.\n    Py_INCREF(*binary_object_target);\n\n    return *binary_object_target;\n}\n\n#ifdef _NUITKA_STANDALONE\n// Helper function to create path.\nPyObject *getStandaloneSysExecutablePath(PyObject *basename) {\n    PyObject *dir_name = getBinaryDirectoryObject(false);\n    PyObject *sys_executable = JOIN_PATH2(dir_name, basename);\n\n    return sys_executable;\n}\n#endif\n\n#else\n\n#if defined(_WIN32)\n/* Small helper function to get current DLL handle. */\nstatic HMODULE getDllModuleHandle(void) {\n    static HMODULE hm = NULL;\n\n    if (hm == NULL) {\n        int res =\n            GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,\n                               (LPCSTR)&getDllModuleHandle, &hm);\n        assert(res != 0);\n    }\n\n    assert(hm != NULL);\n    return hm;\n}\n#endif\n\nstatic filename_char_t const *getDllDirectory(void) {\n#if defined(_WIN32)\n    static WCHAR path[MAXPATHLEN + 1];\n    path[0] = 0;\n\n    int res = GetModuleFileNameW(getDllModuleHandle(), path, MAXPATHLEN);\n    assert(res != 0);\n\n    stripFilenameW(path);\n\n    return path;\n#else\n    Dl_info where;\n\n    {\n        NUITKA_MAY_BE_UNUSED int res = dladdr((void *)getDllDirectory, &where);\n        assert(res != 0);\n    }\n\n    return dirname((char *)where.dli_fname);\n#endif\n}\nstatic PyObject *getDllDirectoryObject(void) {\n    static PyObject *dll_directory = NULL;\n\n    if (dll_directory == NULL) {\n        filename_char_t const *dll_directory_filename = getDllDirectory();\n\n        dll_directory = Nuitka_String_FromFilename(dll_directory_filename);\n\n#if PYTHON_VERSION < 0x300\n        // Avoid unnecessary unicode values.\n        PyObject *decoded_dll_directory = PyObject_Str(dll_directory);\n\n        if (decoded_dll_directory == NULL) {\n            PyThreadState *tstate = PyThreadState_GET();\n            DROP_ERROR_OCCURRED(tstate);\n        } else {\n            Py_DECREF(dll_directory);\n            dll_directory = decoded_dll_directory;\n        }\n#endif\n    }\n\n    CHECK_OBJECT(dll_directory);\n\n    return dll_directory;\n}\n#endif\n\nPyObject *getContainingDirectoryObject(bool resolve_symlinks) {\n#if defined(_NUITKA_EXE)\n#if defined(_NUITKA_ONEFILE_MODE)\n    environment_char_t const *onefile_binary = getEnvironmentVariable(\"NUITKA_ONEFILE_BINARY\");\n    if (onefile_binary != NULL) {\n        PyObject *result = Nuitka_String_FromFilename(onefile_binary);\n        unsetEnvironmentVariable(\"NUITKA_ONEFILE_BINARY\");\n\n        PyThreadState *tstate = PyThreadState_GET();\n        return OS_PATH_DIRNAME(tstate, result);\n    }\n\n    return getBinaryDirectoryObject(resolve_symlinks);\n#else\n    return getBinaryDirectoryObject(resolve_symlinks);\n#endif\n#else\n    return getDllDirectoryObject();\n#endif\n}\n\nstatic void _initDeepCopy(void);\n\nvoid _initBuiltinModule(void) {\n    NUITKA_PRINT_TRACE(\"main(): Calling _initBuiltinTypeMethods().\");\n    _initBuiltinTypeMethods();\n    NUITKA_PRINT_TRACE(\"main(): Calling _initDeepCopy().\");\n    _initDeepCopy();\n\n#if _NUITKA_MODULE\n    if (builtin_module != NULL) {\n        return;\n    }\n#else\n    assert(builtin_module == NULL);\n#endif\n\n#if PYTHON_VERSION < 0x300\n    builtin_module = (PyModuleObject *)PyImport_ImportModule(\"__builtin__\");\n#else\n    builtin_module = (PyModuleObject *)PyImport_ImportModule(\"builtins\");\n#endif\n    assert(builtin_module);\n    dict_builtin = (PyDictObject *)builtin_module->md_dict;\n    assert(PyDict_Check(dict_builtin));\n\n#ifdef _NUITKA_STANDALONE\n    {\n        NUITKA_MAY_BE_UNUSED int res =\n            PyDict_SetItemString((PyObject *)dict_builtin, \"__nuitka_binary_dir\", getBinaryDirectoryObject(true));\n        assert(res == 0);\n        PyDict_SetItemString((PyObject *)dict_builtin, \"__nuitka_binary_exe\", getBinaryFilenameObject(true));\n        assert(res == 0);\n    }\n#endif\n\n    // init Nuitka_BuiltinModule_Type, PyType_Ready won't copy all member from\n    // base type, so we need copy all members from PyModule_Type manual for\n    // safety.  PyType_Ready will change tp_flags, we need define it again. Set\n    // tp_setattro to Nuitka_BuiltinModule_SetAttr and we can detect value\n    // change. Set tp_base to PyModule_Type and PyModule_Check will pass.\n    Nuitka_BuiltinModule_Type.tp_dealloc = PyModule_Type.tp_dealloc;\n    Nuitka_BuiltinModule_Type.tp_repr = PyModule_Type.tp_repr;\n    Nuitka_BuiltinModule_Type.tp_setattro = (setattrofunc)Nuitka_BuiltinModule_SetAttr;\n    Nuitka_BuiltinModule_Type.tp_getattro = PyModule_Type.tp_getattro;\n    Nuitka_BuiltinModule_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE;\n    Nuitka_BuiltinModule_Type.tp_doc = PyModule_Type.tp_doc;\n    Nuitka_BuiltinModule_Type.tp_traverse = PyModule_Type.tp_traverse;\n    Nuitka_BuiltinModule_Type.tp_members = PyModule_Type.tp_members;\n    Nuitka_BuiltinModule_Type.tp_base = &PyModule_Type;\n    Nuitka_BuiltinModule_Type.tp_dictoffset = PyModule_Type.tp_dictoffset;\n    Nuitka_BuiltinModule_Type.tp_init = PyModule_Type.tp_init;\n    Nuitka_BuiltinModule_Type.tp_alloc = PyModule_Type.tp_alloc;\n    Nuitka_BuiltinModule_Type.tp_new = PyModule_Type.tp_new;\n    Nuitka_BuiltinModule_Type.tp_free = PyModule_Type.tp_free;\n    NUITKA_MAY_BE_UNUSED int res2 = PyType_Ready(&Nuitka_BuiltinModule_Type);\n    assert(res2 >= 0);\n\n    // Replace type of builtin module to take over.\n    ((PyObject *)builtin_module)->ob_type = &Nuitka_BuiltinModule_Type;\n    assert(PyModule_Check(builtin_module) == 1);\n}\n\n#include \"HelpersCalling.c\"\n\nPyObject *MAKE_RELATIVE_PATH(PyObject *relative) {\n    CHECK_OBJECT(relative);\n\n    static PyObject *our_path_object = NULL;\n\n    if (our_path_object == NULL) {\n        our_path_object = getContainingDirectoryObject(true);\n    }\n\n    return JOIN_PATH2(our_path_object, relative);\n}\n\n#ifdef _NUITKA_EXE\n\nNUITKA_DEFINE_BUILTIN(type)\nNUITKA_DEFINE_BUILTIN(len)\nNUITKA_DEFINE_BUILTIN(repr)\nNUITKA_DEFINE_BUILTIN(int)\nNUITKA_DEFINE_BUILTIN(iter)\n#if PYTHON_VERSION < 0x300\nNUITKA_DEFINE_BUILTIN(long)\n#else\nNUITKA_DEFINE_BUILTIN(range);\n#endif\n\nvoid _initBuiltinOriginalValues(void) {\n    NUITKA_ASSIGN_BUILTIN(type);\n    NUITKA_ASSIGN_BUILTIN(len);\n    NUITKA_ASSIGN_BUILTIN(range);\n    NUITKA_ASSIGN_BUILTIN(repr);\n    NUITKA_ASSIGN_BUILTIN(int);\n    NUITKA_ASSIGN_BUILTIN(iter);\n#if PYTHON_VERSION < 0x300\n    NUITKA_ASSIGN_BUILTIN(long);\n#endif\n\n    CHECK_OBJECT(_python_original_builtin_value_range);\n}\n\n#endif\n\n// Used for threading.\n#if PYTHON_VERSION >= 0x300 && !defined(NUITKA_USE_PYCORE_THREAD_STATE)\nvolatile int _Py_Ticker = _Py_CheckInterval;\n#endif\n\n#if PYTHON_VERSION >= 0x270\niternextfunc default_iternext;\n\nvoid _initSlotIterNext(void) {\n    PyObject *pos_args = MAKE_TUPLE1((PyObject *)&PyBaseObject_Type);\n\n    // Note: Not using MAKE_DICT_EMPTY on purpose, this is called early on.\n    PyObject *kw_args = PyDict_New();\n    PyDict_SetItem(kw_args, const_str_plain___iter__, Py_True);\n\n    PyObject *c =\n        PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, const_str_plain___iter__, pos_args, kw_args, NULL);\n    Py_DECREF(pos_args);\n    Py_DECREF(kw_args);\n\n    PyObject *r = PyObject_CallFunctionObjArgs(c, NULL);\n    Py_DECREF(c);\n\n    CHECK_OBJECT(r);\n    assert(Py_TYPE(r)->tp_iternext);\n\n    default_iternext = Py_TYPE(r)->tp_iternext;\n\n    Py_DECREF(r);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\nPyObject *MAKE_UNION_TYPE(PyObject *args) {\n    assert(PyTuple_CheckExact(args));\n    assert(PyTuple_GET_SIZE(args) > 1);\n\n    CHECK_OBJECT_DEEP(args);\n\n    PyObject *result = NULL;\n\n    for (Py_ssize_t i = 0; i < PyTuple_GET_SIZE(args); i++) {\n        PyObject *value = PyTuple_GET_ITEM(args, i);\n\n        if (result == NULL) {\n            assert(i == 0);\n            result = value;\n        } else {\n            result = PyNumber_InPlaceBitor(result, value);\n        }\n    }\n\n    return result;\n}\n#endif\n\n#include \"HelpersAttributes.c\"\n#include \"HelpersDeepcopy.c\"\n#include \"HelpersOperationBinaryAdd.c\"\n#include \"HelpersOperationBinaryBitand.c\"\n#include \"HelpersOperationBinaryBitor.c\"\n#include \"HelpersOperationBinaryBitxor.c\"\n#include \"HelpersOperationBinaryDivmod.c\"\n#include \"HelpersOperationBinaryFloordiv.c\"\n#include \"HelpersOperationBinaryLshift.c\"\n#include \"HelpersOperationBinaryMod.c\"\n#include \"HelpersOperationBinaryMult.c\"\n#include \"HelpersOperationBinaryPow.c\"\n#include \"HelpersOperationBinaryRshift.c\"\n#include \"HelpersOperationBinarySub.c\"\n#include \"HelpersOperationBinaryTruediv.c\"\n#include \"HelpersTypes.c\"\n#if PYTHON_VERSION < 0x300\n#include \"HelpersOperationBinaryOlddiv.c\"\n#endif\n#if PYTHON_VERSION >= 0x350\n#include \"HelpersOperationBinaryMatmult.c\"\n#endif\n\n#include \"HelpersOperationInplaceAdd.c\"\n#include \"HelpersOperationInplaceBitand.c\"\n#include \"HelpersOperationInplaceBitor.c\"\n#include \"HelpersOperationInplaceBitxor.c\"\n#include \"HelpersOperationInplaceFloordiv.c\"\n#include \"HelpersOperationInplaceLshift.c\"\n#include \"HelpersOperationInplaceMod.c\"\n#include \"HelpersOperationInplaceMult.c\"\n#include \"HelpersOperationInplacePow.c\"\n#include \"HelpersOperationInplaceRshift.c\"\n#include \"HelpersOperationInplaceSub.c\"\n#include \"HelpersOperationInplaceTruediv.c\"\n#if PYTHON_VERSION < 0x300\n#include \"HelpersOperationInplaceOlddiv.c\"\n#endif\n#if PYTHON_VERSION >= 0x350\n#include \"HelpersOperationInplaceMatmult.c\"\n#endif\n\n#include \"HelpersComparisonEq.c\"\n#include \"HelpersComparisonGe.c\"\n#include \"HelpersComparisonGt.c\"\n#include \"HelpersComparisonLe.c\"\n#include \"HelpersComparisonLt.c\"\n#include \"HelpersComparisonNe.c\"\n\n#include \"HelpersChecksumTools.c\"\n#include \"HelpersConstantsBlob.c\"\n\n#if _NUITKA_PROFILE\n#include \"HelpersProfiling.c\"\n#endif\n\n#if _NUITKA_PGO_PYTHON\n#include \"HelpersPythonPgo.c\"\n#endif\n\n#include \"MetaPathBasedLoader.c\"\n\n#ifdef _NUITKA_EXPERIMENTAL_DUMP_C_TRACEBACKS\n#include \"HelpersDumpBacktraces.c\"\n#endif\n\n#include \"HelpersJitSources.c\"\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledCoroutineType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Compiled Coroutines.\n *\n * Unlike in CPython, we have one type for just coroutines, this doesn't do generators\n * nor asyncgen.\n *\n * It strives to be full replacement for normal coroutines.\n *\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/freelists.h\"\n#include \"nuitka/prelude.h\"\n#include <structmember.h>\n#endif\n\n// For reporting about reference counts per type.\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Coroutine_Type = 0;\nint count_allocated_Nuitka_Coroutine_Type = 0;\nint count_released_Nuitka_Coroutine_Type = 0;\nint count_active_Nuitka_CoroutineWrapper_Type = 0;\nint count_allocated_Nuitka_CoroutineWrapper_Type = 0;\nint count_released_Nuitka_CoroutineWrapper_Type = 0;\nint count_active_Nuitka_AIterWrapper_Type = 0;\nint count_allocated_Nuitka_AIterWrapper_Type = 0;\nint count_released_Nuitka_AIterWrapper_Type = 0;\n#endif\n\nstatic void Nuitka_MarkCoroutineAsFinished(struct Nuitka_CoroutineObject *coroutine) {\n    coroutine->m_status = status_Finished;\n\n#if PYTHON_VERSION >= 0x3b0\n    if (coroutine->m_frame) {\n        coroutine->m_frame->m_frame_state = FRAME_COMPLETED;\n    }\n#endif\n}\n\nstatic void Nuitka_MarkCoroutineAsRunning(struct Nuitka_CoroutineObject *coroutine) {\n    coroutine->m_running = 1;\n\n    if (coroutine->m_frame) {\n        Nuitka_Frame_MarkAsExecuting(coroutine->m_frame);\n    }\n}\n\nstatic void Nuitka_MarkCoroutineAsNotRunning(struct Nuitka_CoroutineObject *coroutine) {\n    coroutine->m_running = 0;\n\n    if (coroutine->m_frame) {\n        Nuitka_Frame_MarkAsNotExecuting(coroutine->m_frame);\n    }\n}\n\nstatic PyObject *_Nuitka_Coroutine_send(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine,\n                                        PyObject *value, bool closing,\n                                        struct Nuitka_ExceptionPreservationItem *exception_state);\n\nstatic long Nuitka_Coroutine_tp_hash(struct Nuitka_CoroutineObject *coroutine) { return coroutine->m_counter; }\n\nstatic PyObject *Nuitka_Coroutine_get_name(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n\n    Py_INCREF(coroutine->m_name);\n    return coroutine->m_name;\n}\n\nstatic int Nuitka_Coroutine_set_name(struct Nuitka_CoroutineObject *coroutine, PyObject *value) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(value);\n\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = coroutine->m_name;\n    Py_INCREF(value);\n    coroutine->m_name = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Coroutine_get_qualname(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n\n    Py_INCREF(coroutine->m_qualname);\n    return coroutine->m_qualname;\n}\n\nstatic int Nuitka_Coroutine_set_qualname(struct Nuitka_CoroutineObject *coroutine, PyObject *value) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(value);\n\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__qualname__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = coroutine->m_qualname;\n    Py_INCREF(value);\n    coroutine->m_qualname = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Coroutine_get_cr_await(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(coroutine->m_yield_from);\n\n    if (coroutine->m_yield_from) {\n        Py_INCREF(coroutine->m_yield_from);\n        return coroutine->m_yield_from;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\nstatic PyObject *Nuitka_Coroutine_get_code(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT(coroutine->m_code_object);\n\n    Py_INCREF(coroutine->m_code_object);\n    return (PyObject *)coroutine->m_code_object;\n}\n\nstatic int Nuitka_Coroutine_set_code(struct Nuitka_CoroutineObject *coroutine, PyObject *value) {\n    CHECK_OBJECT(coroutine);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cr_code is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Coroutine_get_frame(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(coroutine->m_frame);\n\n    if (coroutine->m_frame) {\n        Py_INCREF(coroutine->m_frame);\n        return (PyObject *)coroutine->m_frame;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\nstatic int Nuitka_Coroutine_set_frame(struct Nuitka_CoroutineObject *coroutine, PyObject *value) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(value);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"gi_frame is not writable in Nuitka\");\n    return -1;\n}\n\nstatic void Nuitka_Coroutine_release_closure(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n\n    for (Py_ssize_t i = 0; i < coroutine->m_closure_given; i++) {\n        CHECK_OBJECT(coroutine->m_closure[i]);\n        Py_DECREF(coroutine->m_closure[i]);\n    }\n\n    coroutine->m_closure_given = 0;\n}\n\n// Note: Shared with asyncgen.\nstatic PyObject *_Nuitka_YieldFromCore(PyThreadState *tstate, PyObject *yield_from, PyObject *send_value,\n                                       PyObject **returned_value, bool mode) {\n    // Send iteration value to the sub-generator, which may be a CPython\n    // generator object, something with an iterator next, or a send method,\n    // where the later is only required if values other than \"None\" need to\n    // be passed in.\n    CHECK_OBJECT(yield_from);\n    CHECK_OBJECT_X(send_value);\n\n    assert(send_value != NULL || HAS_ERROR_OCCURRED(tstate));\n\n    PyObject *retval;\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n\n    FETCH_ERROR_OCCURRED_STATE(tstate, &exception_state);\n\n    if (HAS_EXCEPTION_STATE(&exception_state)) {\n        // Exception, was thrown into us, need to send that to sub-generator.\n        // We acquired ownership of the published exception and need to release it potentially.\n\n        // Transfer exception owner this.\n        retval = _Nuitka_YieldFromPassExceptionTo(tstate, yield_from, &exception_state);\n\n        // TODO: This wants to look at retval most definitely, send_value is going to be NULL.\n        if (unlikely(send_value == NULL)) {\n            PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n            if (error != NULL && EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration)) {\n                *returned_value = ERROR_GET_STOP_ITERATION_VALUE(tstate);\n                assert(!HAS_ERROR_OCCURRED(tstate));\n\n                return NULL;\n            }\n        }\n    } else if (PyGen_CheckExact(yield_from) || PyCoro_CheckExact(yield_from)) {\n        retval = Nuitka_PyGen_Send(tstate, (PyGenObject *)yield_from, Py_None);\n    } else if (send_value == Py_None && Nuitka_CoroutineWrapper_Check(yield_from)) {\n        struct Nuitka_CoroutineObject *yieldfrom_coroutine =\n            ((struct Nuitka_CoroutineWrapperObject *)yield_from)->m_coroutine;\n\n        Py_INCREF(Py_None);\n\n        struct Nuitka_ExceptionPreservationItem no_exception_state;\n        INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n        retval = _Nuitka_Coroutine_send(tstate, yieldfrom_coroutine, Py_None, mode ? false : true, &no_exception_state);\n    } else if (send_value == Py_None && Py_TYPE(yield_from)->tp_iternext != NULL) {\n        retval = Py_TYPE(yield_from)->tp_iternext(yield_from);\n    } else {\n#if 0\n        // TODO: Add slow mode traces.\n        PRINT_ITEM(yield_from);\n        PRINT_NEW_LINE();\n#endif\n\n        retval = PyObject_CallMethodObjArgs(yield_from, const_str_plain_send, send_value, NULL);\n    }\n\n    // Check the sub-generator result\n    if (retval == NULL) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n        if (error == NULL) {\n            Py_INCREF(Py_None);\n            *returned_value = Py_None;\n        } else if (likely(EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration))) {\n            // The sub-generator has given an exception. In case of\n            // StopIteration, we need to check the value, as it is going to be\n            // the expression value of this \"yield from\", and we are done. All\n            // other errors, we need to raise.\n            *returned_value = ERROR_GET_STOP_ITERATION_VALUE(tstate);\n            assert(!HAS_ERROR_OCCURRED(tstate));\n\n            assert(*returned_value != NULL);\n        } else {\n            *returned_value = NULL;\n        }\n\n        return NULL;\n    } else {\n        assert(!HAS_ERROR_OCCURRED(tstate));\n        return retval;\n    }\n}\n\nstatic PyObject *_Nuitka_YieldFromCoroutineCore(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine,\n                                                PyObject *send_value, bool mode) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(send_value);\n\n    PyObject *yield_from = coroutine->m_yield_from;\n    CHECK_OBJECT(yield_from);\n\n    // Need to make it unaccessible while using it.\n    coroutine->m_yield_from = NULL;\n\n    PyObject *returned_value;\n    PyObject *yielded = _Nuitka_YieldFromCore(tstate, yield_from, send_value, &returned_value, mode);\n\n    if (yielded == NULL) {\n        assert(coroutine->m_yield_from == NULL);\n        Py_DECREF(yield_from);\n\n        yielded = ((coroutine_code)coroutine->m_code)(tstate, coroutine, returned_value);\n    } else {\n        assert(coroutine->m_yield_from == NULL);\n        coroutine->m_yield_from = yield_from;\n    }\n\n    return yielded;\n}\n\n#if _DEBUG_COROUTINE\nNUITKA_MAY_BE_UNUSED static void _PRINT_COROUTINE_STATUS(char const *descriptor, char const *context,\n                                                         struct Nuitka_CoroutineObject *coroutine) {\n    char const *status;\n\n    switch (coroutine->m_status) {\n    case status_Finished:\n        status = \"(finished)\";\n        break;\n    case status_Running:\n        status = \"(running)\";\n        break;\n    case status_Unused:\n        status = \"(unused)\";\n        break;\n    default:\n        status = \"(ILLEGAL)\";\n        break;\n    }\n\n    PRINT_STRING(descriptor);\n    PRINT_STRING(\" : \");\n    PRINT_STRING(context);\n    PRINT_STRING(\" \");\n    PRINT_ITEM((PyObject *)coroutine);\n    PRINT_STRING(\" \");\n    PRINT_REFCOUNT((PyObject *)coroutine);\n    PRINT_STRING(status);\n    PRINT_NEW_LINE();\n}\n\n#define PRINT_COROUTINE_STATUS(context, coroutine) _PRINT_COROUTINE_STATUS(__FUNCTION__, context, coroutine)\n\n#endif\n\nstatic PyObject *Nuitka_YieldFromCoroutineNext(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_NEW_LINE();\n#endif\n    PyObject *result = _Nuitka_YieldFromCoroutineCore(tstate, coroutine, Py_None, true);\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Leave\", coroutine);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n    return result;\n}\n\nstatic PyObject *Nuitka_YieldFromCoroutineInitial(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine,\n                                                  PyObject *send_value) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_X(send_value);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_NEW_LINE();\n#endif\n    PyObject *result = _Nuitka_YieldFromCoroutineCore(tstate, coroutine, send_value, false);\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Leave\", coroutine);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n    return result;\n}\n\nstatic void Nuitka_SetStopIterationValue(PyThreadState *tstate, PyObject *value);\n\n// This function is called when sending a value or exception to be handled in the coroutine\n// Note:\n//   Exception arguments are passed for ownership and must be released before returning. The\n//   value of exception_type may be NULL, and the actual exception will not necessarily\n//   be normalized.\n\nstatic PySendResult _Nuitka_Coroutine_sendR(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine,\n                                            PyObject *value, bool closing,\n                                            struct Nuitka_ExceptionPreservationItem *exception_state,\n                                            PyObject **result) {\n    CHECK_OBJECT(coroutine);\n    assert(Nuitka_Coroutine_Check((PyObject *)coroutine));\n    CHECK_EXCEPTION_STATE_X(exception_state);\n    CHECK_OBJECT_X(value);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_COROUTINE_STRING(\"closing\", closing ? \"(closing) \" : \"(not closing) \");\n    PRINT_COROUTINE_VALUE(\"value\", value);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    // Not both a value and an exception please.\n    if (value != NULL) {\n        ASSERT_EMPTY_EXCEPTION_STATE(exception_state);\n    }\n\n    if (coroutine->m_status == status_Unused && value != NULL && value != Py_None) {\n        // No exception if value is given.\n        Py_XDECREF(value);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"can't send non-None value to a just-started coroutine\");\n        return PYGEN_ERROR;\n    }\n\n    if (coroutine->m_status != status_Finished) {\n        if (coroutine->m_running) {\n            Py_XDECREF(value);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"coroutine already executing\");\n            return PYGEN_ERROR;\n        }\n\n        // Put the coroutine back on the frame stack.\n        Nuitka_ThreadStateFrameType *return_frame = _Nuitka_GetThreadStateFrame(tstate);\n\n        // Consider it as running.\n        if (coroutine->m_status == status_Unused) {\n            coroutine->m_status = status_Running;\n            assert(coroutine->m_resume_frame == NULL);\n\n            // Value will not be used, can only be Py_None or NULL.\n            Py_XDECREF(value);\n            value = NULL;\n        } else {\n            assert(coroutine->m_resume_frame);\n            pushFrameStackGenerator(tstate, coroutine->m_resume_frame);\n\n            coroutine->m_resume_frame = NULL;\n        }\n\n        // Continue the yielder function while preventing recursion.\n        Nuitka_MarkCoroutineAsRunning(coroutine);\n\n        // Check for thrown exception, publish it to the coroutine code.\n        if (unlikely(HAS_EXCEPTION_STATE(exception_state))) {\n            assert(value == NULL);\n\n            // Transfer exception ownership to published.\n            RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n        }\n\n#if _DEBUG_COROUTINE\n        PRINT_COROUTINE_STATUS(\"Switching to coroutine\", coroutine);\n        PRINT_COROUTINE_VALUE(\"value\", value);\n        PRINT_CURRENT_EXCEPTION();\n        PRINT_NEW_LINE();\n        // dumpFrameStack();\n#endif\n\n        PyObject *yielded;\n\n        if (coroutine->m_yield_from == NULL) {\n            yielded = ((coroutine_code)coroutine->m_code)(tstate, coroutine, value);\n        } else {\n            // This does not release the value if any, so we need to do it afterwards.\n            yielded = Nuitka_YieldFromCoroutineInitial(tstate, coroutine, value);\n            Py_XDECREF(value);\n        }\n\n        // If the coroutine returns with m_yield_from set, it wants us to yield\n        // from that value from now on.\n        while (yielded == NULL && coroutine->m_yield_from != NULL) {\n            yielded = Nuitka_YieldFromCoroutineNext(tstate, coroutine);\n        }\n\n        Nuitka_MarkCoroutineAsNotRunning(coroutine);\n\n        tstate = PyThreadState_GET();\n\n        // Remove the back frame from coroutine if it's there.\n        if (coroutine->m_frame) {\n            // assert(tstate->frame == &coroutine->m_frame->m_frame);\n            assertFrameObject(coroutine->m_frame);\n\n            Py_CLEAR(coroutine->m_frame->m_frame.f_back);\n\n            // Remember where to resume from.\n            coroutine->m_resume_frame = _Nuitka_GetThreadStateFrame(tstate);\n        }\n\n        // Return back to the frame that called us.\n        _Nuitka_GeneratorPopFrame(tstate, return_frame);\n\n#if _DEBUG_COROUTINE\n        PRINT_COROUTINE_STATUS(\"Returned from coroutine\", coroutine);\n        // dumpFrameStack();\n#endif\n\n#ifndef __NUITKA_NO_ASSERT__\n        if (return_frame) {\n            assertThreadFrameObject(return_frame);\n        }\n#endif\n\n        if (yielded == NULL) {\n#if _DEBUG_COROUTINE\n            PRINT_COROUTINE_STATUS(\"finishing from yield\", coroutine);\n            PRINT_COROUTINE_STRING(\"closing\", closing ? \"(closing) \" : \"(not closing) \");\n            PRINT_STRING(\"-> finishing coroutine sets status_Finished\\n\");\n            PRINT_COROUTINE_VALUE(\"return_value\", coroutine->m_returned);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n            Nuitka_MarkCoroutineAsFinished(coroutine);\n\n            if (coroutine->m_frame != NULL) {\n                Nuitka_SetFrameGenerator(coroutine->m_frame, NULL);\n                Py_DECREF(coroutine->m_frame);\n                coroutine->m_frame = NULL;\n            }\n\n            Nuitka_Coroutine_release_closure(coroutine);\n\n            // Create StopIteration if necessary, i.e. return value that is not \"None\" was\n            // given. TODO: Push this further down the user line, we might be able to avoid\n            // it for some uses, e.g. quick iteration entirely.\n            if (coroutine->m_returned) {\n                *result = coroutine->m_returned;\n\n                coroutine->m_returned = NULL;\n\n#if _DEBUG_COROUTINE\n                PRINT_COROUTINE_STATUS(\"Return value to exception set\", coroutine);\n                PRINT_CURRENT_EXCEPTION();\n                PRINT_NEW_LINE();\n#endif\n                return PYGEN_RETURN;\n            } else {\n                PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n                if (error == NULL) {\n                    *result = NULL;\n\n                    return PYGEN_RETURN;\n                } else if (error == PyExc_StopIteration) {\n                    RAISE_RUNTIME_ERROR_RAISED_STOP_ITERATION(tstate, \"coroutine raised StopIteration\");\n\n#if _DEBUG_COROUTINE\n                    PRINT_COROUTINE_STATUS(\"Leave with exception set\", coroutine);\n                    PRINT_CURRENT_EXCEPTION();\n                    PRINT_NEW_LINE();\n#endif\n                }\n\n                return PYGEN_ERROR;\n            }\n        } else {\n            *result = yielded;\n            return PYGEN_NEXT;\n        }\n    } else {\n        Py_XDECREF(value);\n\n        // Release exception if any, we are finished with it and will raise another.\n        RELEASE_ERROR_OCCURRED_STATE_X(exception_state);\n\n        /* This is for status_Finished */\n        assert(coroutine->m_status == status_Finished);\n        /* This check got added in Python 3.5.2 only. It's good to do it, but\n         * not fully compatible, therefore guard it.\n         */\n#if PYTHON_VERSION >= 0x352 || !defined(_NUITKA_FULL_COMPAT)\n        if (closing == false) {\n#if _DEBUG_COROUTINE\n            PRINT_COROUTINE_STATUS(\"Finished coroutine sent into -> RuntimeError\", coroutine);\n            PRINT_NEW_LINE();\n#endif\n            PyErr_Format(PyExc_RuntimeError,\n#if !defined(_NUITKA_FULL_COMPAT)\n                         \"cannot reuse already awaited compiled_coroutine %S\", coroutine->m_qualname\n#else\n                         \"cannot reuse already awaited coroutine\"\n#endif\n            );\n\n            return PYGEN_ERROR;\n        } else\n#endif\n        {\n            *result = NULL;\n            return PYGEN_RETURN;\n        }\n    }\n}\n\nstatic PyObject *_Nuitka_Coroutine_send(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine,\n                                        PyObject *value, bool closing,\n                                        struct Nuitka_ExceptionPreservationItem *exception_state) {\n\n    PyObject *result;\n    PySendResult res = _Nuitka_Coroutine_sendR(tstate, coroutine, value, closing, exception_state, &result);\n\n    switch (res) {\n    case PYGEN_RETURN:\n        if (result == NULL) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        } else {\n            if (result != Py_None) {\n                Nuitka_SetStopIterationValue(tstate, result);\n            }\n\n            Py_DECREF(result);\n        }\n\n        return NULL;\n    case PYGEN_NEXT:\n        return result;\n    case PYGEN_ERROR:\n        return NULL;\n    default:\n        NUITKA_CANNOT_GET_HERE(\"invalid PYGEN_ result\");\n    }\n}\n\nstatic PyObject *Nuitka_Coroutine_send(struct Nuitka_CoroutineObject *coroutine, PyObject *value) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT(value);\n\n    // We need to transfer ownership of the sent value.\n    Py_INCREF(value);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PyObject *result = _Nuitka_Coroutine_send(tstate, coroutine, value, false, &exception_state);\n\n    if (result == NULL) {\n        if (HAS_ERROR_OCCURRED(tstate) == false) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n    }\n\n    return result;\n}\n\n// Note: Used by compiled frames.\nstatic bool _Nuitka_Coroutine_close(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine) {\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n#endif\n    CHECK_OBJECT(coroutine);\n\n    if (coroutine->m_status == status_Running) {\n        struct Nuitka_ExceptionPreservationItem exception_state;\n        SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, PyExc_GeneratorExit, NULL, NULL);\n\n        PyObject *result = _Nuitka_Coroutine_send(tstate, coroutine, NULL, true, &exception_state);\n\n        if (unlikely(result)) {\n            Py_DECREF(result);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"coroutine ignored GeneratorExit\");\n            return false;\n        } else {\n            return DROP_ERROR_OCCURRED_GENERATOR_EXIT_OR_STOP_ITERATION(tstate);\n        }\n    }\n\n    return true;\n}\n\nstatic PyObject *Nuitka_Coroutine_close(struct Nuitka_CoroutineObject *coroutine) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    bool r = _Nuitka_Coroutine_close(tstate, coroutine);\n\n    if (unlikely(r == false)) {\n        return NULL;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\n#if PYTHON_VERSION >= 0x360\nstatic bool Nuitka_AsyncgenAsend_Check(PyObject *object);\nstruct Nuitka_AsyncgenAsendObject;\nstatic PyObject *_Nuitka_AsyncgenAsend_throw2(PyThreadState *tstate, struct Nuitka_AsyncgenAsendObject *asyncgen_asend,\n                                              struct Nuitka_ExceptionPreservationItem *exception_state);\n#endif\n\nstatic bool _Nuitka_Generator_check_throw2(PyThreadState *tstate,\n                                           struct Nuitka_ExceptionPreservationItem *exception_state);\n\n// This function is called when yielding to a coroutine through \"_Nuitka_YieldFromPassExceptionTo\"\n// and potentially wrapper objects used by generators, or by the throw method itself.\n// Note:\n//   Exception arguments are passed for ownership and must be released before returning. The\n//   value of exception_type will not be NULL, but the actual exception will not necessarily\n//   be normalized.\nstatic PyObject *_Nuitka_Coroutine_throw2(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine, bool closing,\n                                          struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT(coroutine);\n    assert(Nuitka_Coroutine_Check((PyObject *)coroutine));\n    CHECK_EXCEPTION_STATE(exception_state);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_COROUTINE_STRING(\"closing\", closing ? \"(closing) \" : \"(not closing) \");\n    PRINT_COROUTINE_VALUE(\"yield_from\", coroutine->m_yield_from);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_NEW_LINE();\n#endif\n\n    if (coroutine->m_yield_from != NULL) {\n        if (EXCEPTION_STATE_MATCH_BOOL_SINGLE(tstate, exception_state, PyExc_GeneratorExit)) {\n            // Coroutines need to close the yield_from.\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            bool res = Nuitka_gen_close_iter(tstate, coroutine->m_yield_from);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n\n            if (res == false) {\n                // Release exception, we are done with it now and pick up the new one.\n                RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                FETCH_ERROR_OCCURRED_STATE(tstate, exception_state);\n            }\n\n            // Transferred exception ownership to \"_Nuitka_Coroutine_send\".\n            return _Nuitka_Coroutine_send(tstate, coroutine, NULL, false, exception_state);\n        }\n\n        PyObject *ret;\n\n#if _DEBUG_COROUTINE\n        PRINT_COROUTINE_STATUS(\"Passing to yielded from\", coroutine);\n        PRINT_COROUTINE_VALUE(\"m_yield_from\", coroutine->m_yield_from);\n        PRINT_NEW_LINE();\n#endif\n\n        if (Nuitka_Generator_Check(coroutine->m_yield_from)) {\n            struct Nuitka_GeneratorObject *gen = ((struct Nuitka_GeneratorObject *)coroutine->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Generator_throw2\".\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = _Nuitka_Generator_throw2(tstate, gen, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n        } else if (Nuitka_Coroutine_Check(coroutine->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro = ((struct Nuitka_CoroutineObject *)coroutine->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n        } else if (PyGen_CheckExact(coroutine->m_yield_from) || PyCoro_CheckExact(coroutine->m_yield_from)) {\n            PyGenObject *gen = (PyGenObject *)coroutine->m_yield_from;\n\n            // Transferred exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = Nuitka_UncompiledGenerator_throw(tstate, gen, 1, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n#endif\n        } else if (Nuitka_CoroutineWrapper_Check(coroutine->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro =\n                ((struct Nuitka_CoroutineWrapperObject *)coroutine->m_yield_from)->m_coroutine;\n\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n#if PYTHON_VERSION >= 0x360\n        } else if (Nuitka_AsyncgenAsend_Check(coroutine->m_yield_from)) {\n            struct Nuitka_AsyncgenAsendObject *asyncgen_asend =\n                ((struct Nuitka_AsyncgenAsendObject *)coroutine->m_yield_from);\n\n            // Transferred exception ownership to \"_Nuitka_AsyncgenAsend_throw2\".\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = _Nuitka_AsyncgenAsend_throw2(tstate, asyncgen_asend, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n#endif\n        } else {\n            PyObject *meth = PyObject_GetAttr(coroutine->m_yield_from, const_str_plain_throw);\n            if (unlikely(meth == NULL)) {\n                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n                    // Release exception, we are done with it now.\n                    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                    return NULL;\n                }\n\n                CLEAR_ERROR_OCCURRED(tstate);\n\n                // Passing exception ownership to that code.\n                goto throw_here;\n            }\n\n            CHECK_EXCEPTION_STATE(exception_state);\n\n#if 0\n            // TODO: Add slow mode traces.\n            PRINT_ITEM(coroutine->m_yield_from);\n            PRINT_NEW_LINE();\n#endif\n            Nuitka_MarkCoroutineAsRunning(coroutine);\n            ret = Nuitka_CallGeneratorThrowMethod(meth, exception_state);\n            Nuitka_MarkCoroutineAsNotRunning(coroutine);\n\n            Py_DECREF(meth);\n\n            // Release exception, we are done with it now.\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n        }\n\n        if (unlikely(ret == NULL)) {\n            // Return value or exception, not to continue with yielding from.\n            if (coroutine->m_yield_from != NULL) {\n                CHECK_OBJECT(coroutine->m_yield_from);\n#if _DEBUG_COROUTINE\n                PRINT_COROUTINE_STATUS(\"Null return, yield from removal:\", coroutine);\n                PRINT_COROUTINE_VALUE(\"yield_from\", coroutine->m_yield_from);\n#endif\n                Py_DECREF(coroutine->m_yield_from);\n                coroutine->m_yield_from = NULL;\n            }\n\n            PyObject *val;\n            if (_PyGen_FetchStopIterationValue(&val) == 0) {\n                CHECK_OBJECT(val);\n\n#if _DEBUG_COROUTINE\n                PRINT_COROUTINE_STATUS(\"Sending return value into ourselves\", coroutine);\n                PRINT_COROUTINE_VALUE(\"value\", val);\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                // The ownership of val is transferred.\n                ret = _Nuitka_Coroutine_send(tstate, coroutine, val, false, &no_exception_state);\n            } else {\n#if _DEBUG_COROUTINE\n                PRINT_COROUTINE_STATUS(\"Sending exception value into ourselves\", coroutine);\n                PRINT_CURRENT_EXCEPTION();\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                ret = _Nuitka_Coroutine_send(tstate, coroutine, NULL, false, &no_exception_state);\n            }\n\n#if _DEBUG_COROUTINE\n            PRINT_COROUTINE_STATUS(\"Leave with value/exception from sending into ourselves:\", coroutine);\n            PRINT_COROUTINE_STRING(\"closing\", closing ? \"(closing) \" : \"(not closing) \");\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        } else {\n#if _DEBUG_COROUTINE\n            PRINT_COROUTINE_STATUS(\"Leave with return value:\", coroutine);\n            PRINT_COROUTINE_STRING(\"closing\", closing ? \"(closing) \" : \"(not closing) \");\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        }\n\n        return ret;\n    }\n\nthrow_here:\n    // We continue to have exception ownership here.\n\n    if (unlikely(_Nuitka_Generator_check_throw2(tstate, exception_state) == false)) {\n        // Exception was released by _Nuitka_Generator_check_throw2 already.\n        return NULL;\n    }\n\n    if (coroutine->m_status == status_Running) {\n        // Transferred exception ownership to \"_Nuitka_Coroutine_send\".\n        PyObject *result = _Nuitka_Coroutine_send(tstate, coroutine, NULL, false, exception_state);\n        return result;\n    } else if (coroutine->m_status == status_Finished) {\n\n        /* This check got added in Python 3.5.2 only. It's good to do it, but\n         * not fully compatible, therefore guard it.\n         */\n#if PYTHON_VERSION >= 0x352 || !defined(_NUITKA_FULL_COMPAT)\n        if (closing == false) {\n#if _DEBUG_COROUTINE\n            PRINT_STRING(\"Finished coroutine thrown into -> RuntimeError\\n\");\n            PRINT_ITEM(coroutine->m_qualname);\n            PRINT_NEW_LINE();\n#endif\n            PyErr_Format(PyExc_RuntimeError,\n#if !defined(_NUITKA_FULL_COMPAT)\n                         \"cannot reuse already awaited compiled_coroutine %S\", coroutine->m_qualname\n#else\n                         \"cannot reuse already awaited coroutine\"\n#endif\n            );\n\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n            return NULL;\n        }\n#endif\n        // Passing exception to publication.\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n        return NULL;\n    } else {\n        PyTracebackObject *exception_tb = GET_EXCEPTION_STATE_TRACEBACK(exception_state);\n\n        if (exception_tb == NULL) {\n            // TODO: Our compiled objects really need a way to store common\n            // stuff in a \"shared\" part across all instances, and outside of\n            // run time, so we could reuse this.\n            struct Nuitka_FrameObject *frame =\n                MAKE_FUNCTION_FRAME(tstate, coroutine->m_code_object, coroutine->m_module, 0);\n            SET_EXCEPTION_STATE_TRACEBACK(exception_state,\n                                          MAKE_TRACEBACK(frame, coroutine->m_code_object->co_firstlineno));\n            Py_DECREF(frame);\n        }\n\n        // Passing exception to publication.\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n#if _DEBUG_COROUTINE\n        PRINT_COROUTINE_STATUS(\"Finishing from exception\", coroutine);\n        PRINT_NEW_LINE();\n#endif\n\n        Nuitka_MarkCoroutineAsFinished(coroutine);\n\n        return NULL;\n    }\n}\n\nstatic PyObject *Nuitka_Coroutine_throw(struct Nuitka_CoroutineObject *coroutine, PyObject *args) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT_DEEP(args);\n\n    PyObject *exception_type;\n    PyObject *exception_value = NULL;\n    PyTracebackObject *exception_tb = NULL;\n\n    // This takes no references, that is for us to do.\n    int res = PyArg_UnpackTuple(args, \"throw\", 1, 3, &exception_type, &exception_value, &exception_tb);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_EXCEPTION(exception_type, exception_value, exception_tb);\n    PRINT_NEW_LINE();\n#endif\n\n    // Handing ownership of exception over, we need not release it ourselves\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, exception_type, exception_value, exception_tb);\n\n    PyThreadState *tstate = PyThreadState_GET();\n    PyObject *result = _Nuitka_Coroutine_throw2(tstate, coroutine, false, &exception_state);\n\n    if (result == NULL) {\n        if (HAS_ERROR_OCCURRED(tstate) == false) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n    }\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Leave\", coroutine);\n    PRINT_EXCEPTION(exception_type, exception_value, exception_tb);\n    PRINT_COROUTINE_VALUE(\"return value\", result);\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    return result;\n}\n\nstatic PyObject *Nuitka_Coroutine_tp_repr(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n    CHECK_OBJECT(coroutine->m_qualname);\n\n    return PyUnicode_FromFormat(\"<compiled_coroutine object %s at %p>\", Nuitka_String_AsString(coroutine->m_qualname),\n                                coroutine);\n}\n\nstatic long Nuitka_Coroutine_tp_traverse(struct Nuitka_CoroutineObject *coroutine, visitproc visit, void *arg) {\n    CHECK_OBJECT(coroutine);\n\n    // TODO: Identify the impact of not visiting owned objects like module\n    Py_VISIT(coroutine->m_yield_from);\n\n    for (Py_ssize_t i = 0; i < coroutine->m_closure_given; i++) {\n        Py_VISIT(coroutine->m_closure[i]);\n    }\n\n    Py_VISIT(coroutine->m_frame);\n\n    return 0;\n}\n\nstatic struct Nuitka_CoroutineWrapperObject *free_list_coro_wrappers = NULL;\nstatic int free_list_coro_wrappers_count = 0;\n\nstatic PyObject *Nuitka_Coroutine_await(struct Nuitka_CoroutineObject *coroutine) {\n    CHECK_OBJECT(coroutine);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_NEW_LINE();\n#endif\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_CoroutineWrapper_Type += 1;\n    count_allocated_Nuitka_CoroutineWrapper_Type += 1;\n#endif\n\n    struct Nuitka_CoroutineWrapperObject *result;\n\n    allocateFromFreeListFixed(free_list_coro_wrappers, struct Nuitka_CoroutineWrapperObject,\n                              Nuitka_CoroutineWrapper_Type);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    result->m_coroutine = coroutine;\n    Py_INCREF(result->m_coroutine);\n\n    Nuitka_GC_Track(result);\n\n    return (PyObject *)result;\n}\n\n#if PYTHON_VERSION >= 0x3a0\nstatic PySendResult _Nuitka_Coroutine_am_send(struct Nuitka_CoroutineObject *coroutine, PyObject *arg,\n                                              PyObject **result) {\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n#endif\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // We need to transfer ownership of the sent value.\n    Py_INCREF(arg);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PySendResult res = _Nuitka_Coroutine_sendR(tstate, coroutine, arg, false, &exception_state, result);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Leave\", coroutine);\n    PRINT_COROUTINE_VALUE(\"result\", *result);\n    PRINT_NEW_LINE();\n#endif\n    return res;\n}\n#endif\n\nstatic void Nuitka_Coroutine_tp_finalize(struct Nuitka_CoroutineObject *coroutine) {\n    if (coroutine->m_status != status_Running) {\n        return;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    bool close_result = _Nuitka_Coroutine_close(tstate, coroutine);\n\n    if (unlikely(close_result == false)) {\n        PyErr_WriteUnraisable((PyObject *)coroutine);\n    }\n\n    /* Restore the saved exception if any. */\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\n#define MAX_COROUTINE_FREE_LIST_COUNT 100\nstatic struct Nuitka_CoroutineObject *free_list_coros = NULL;\nstatic int free_list_coros_count = 0;\n\nstatic void Nuitka_Coroutine_tp_dealloc(struct Nuitka_CoroutineObject *coroutine) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Coroutine_Type -= 1;\n    count_released_Nuitka_Coroutine_Type += 1;\n#endif\n\n    // Revive temporarily.\n    assert(Py_REFCNT(coroutine) == 0);\n    Py_SET_REFCNT(coroutine, 1);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // Save the current exception, if any, we must preserve it.\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n#if _DEBUG_COROUTINE\n    PRINT_COROUTINE_STATUS(\"Enter\", coroutine);\n    PRINT_NEW_LINE();\n#endif\n\n    bool close_result = _Nuitka_Coroutine_close(tstate, coroutine);\n\n    if (unlikely(close_result == false)) {\n        PyErr_WriteUnraisable((PyObject *)coroutine);\n    }\n\n    Nuitka_Coroutine_release_closure(coroutine);\n\n    // Allow for above code to resurrect the coroutine.\n    Py_SET_REFCNT(coroutine, Py_REFCNT(coroutine) - 1);\n    if (Py_REFCNT(coroutine) >= 1) {\n        RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n        return;\n    }\n\n    if (coroutine->m_frame) {\n        Nuitka_SetFrameGenerator(coroutine->m_frame, NULL);\n        Py_DECREF(coroutine->m_frame);\n        coroutine->m_frame = NULL;\n    }\n\n    // Now it is safe to release references and memory for it.\n    Nuitka_GC_UnTrack(coroutine);\n\n    if (coroutine->m_weakrefs != NULL) {\n        PyObject_ClearWeakRefs((PyObject *)coroutine);\n        assert(!HAS_ERROR_OCCURRED(tstate));\n    }\n\n    Py_DECREF(coroutine->m_name);\n    Py_DECREF(coroutine->m_qualname);\n\n#if PYTHON_VERSION >= 0x370\n    Py_XDECREF(coroutine->m_origin);\n#endif\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_coros, coroutine, MAX_COROUTINE_FREE_LIST_COUNT);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\n// TODO: Set \"__doc__\" automatically for method clones of compiled types from\n// the documentation of built-in original type.\nstatic PyMethodDef Nuitka_Coroutine_methods[] = {{\"send\", (PyCFunction)Nuitka_Coroutine_send, METH_O, NULL},\n                                                 {\"throw\", (PyCFunction)Nuitka_Coroutine_throw, METH_VARARGS, NULL},\n                                                 {\"close\", (PyCFunction)Nuitka_Coroutine_close, METH_NOARGS, NULL},\n                                                 {NULL}};\n\n// TODO: Set \"__doc__\" automatically for method clones of compiled types from\n// the documentation of built-in original type.\nstatic PyGetSetDef Nuitka_Coroutine_getsetlist[] = {\n    {(char *)\"__name__\", (getter)Nuitka_Coroutine_get_name, (setter)Nuitka_Coroutine_set_name, NULL},\n    {(char *)\"__qualname__\", (getter)Nuitka_Coroutine_get_qualname, (setter)Nuitka_Coroutine_set_qualname, NULL},\n    {(char *)\"cr_await\", (getter)Nuitka_Coroutine_get_cr_await, (setter)NULL, NULL},\n    {(char *)\"cr_code\", (getter)Nuitka_Coroutine_get_code, (setter)Nuitka_Coroutine_set_code, NULL},\n    {(char *)\"cr_frame\", (getter)Nuitka_Coroutine_get_frame, (setter)Nuitka_Coroutine_set_frame, NULL},\n\n    {NULL}};\n\nstatic PyMemberDef Nuitka_Coroutine_members[] = {\n    {(char *)\"cr_running\", T_BOOL, offsetof(struct Nuitka_CoroutineObject, m_running), READONLY},\n#if PYTHON_VERSION >= 0x370\n    {(char *)\"cr_origin\", T_OBJECT, offsetof(struct Nuitka_CoroutineObject, m_origin), READONLY},\n\n#endif\n    {NULL}};\n\nstatic PyAsyncMethods Nuitka_Coroutine_as_async = {\n    (unaryfunc)Nuitka_Coroutine_await, // am_await\n    0,                                 // am_aiter\n    0                                  // am_anext\n#if PYTHON_VERSION >= 0x3a0\n    ,\n    (sendfunc)_Nuitka_Coroutine_am_send // am_send\n#endif\n\n};\n\nPyTypeObject Nuitka_Coroutine_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_coroutine\",                // tp_name\n    sizeof(struct Nuitka_CoroutineObject),                              // tp_basicsize\n    sizeof(struct Nuitka_CellObject *),                                 // tp_itemsize\n    (destructor)Nuitka_Coroutine_tp_dealloc,                            // tp_dealloc\n    0,                                                                  // tp_print\n    0,                                                                  // tp_getattr\n    0,                                                                  // tp_setattr\n    &Nuitka_Coroutine_as_async,                                         // tp_as_async\n    (reprfunc)Nuitka_Coroutine_tp_repr,                                 // tp_repr\n    0,                                                                  // tp_as_number\n    0,                                                                  // tp_as_sequence\n    0,                                                                  // tp_as_mapping\n    (hashfunc)Nuitka_Coroutine_tp_hash,                                 // tp_hash\n    0,                                                                  // tp_call\n    0,                                                                  // tp_str\n    0,                                                                  // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                                  // tp_setattro\n    0,                                                                  // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, // tp_flags\n    0,                                                                  // tp_doc\n    (traverseproc)Nuitka_Coroutine_tp_traverse,                         // tp_traverse\n    0,                                                                  // tp_clear\n    0,                                                                  // tp_richcompare\n    offsetof(struct Nuitka_CoroutineObject, m_weakrefs),                // tp_weaklistoffset\n    0,                                                                  // tp_iter\n    0,                                                                  // tp_iternext\n    Nuitka_Coroutine_methods,                                           // tp_methods\n    Nuitka_Coroutine_members,                                           // tp_members\n    Nuitka_Coroutine_getsetlist,                                        // tp_getset\n    0,                                                                  // tp_base\n    0,                                                                  // tp_dict\n    0,                                                                  // tp_descr_get\n    0,                                                                  // tp_descr_set\n    0,                                                                  // tp_dictoffset\n    0,                                                                  // tp_init\n    0,                                                                  // tp_alloc\n    0,                                                                  // tp_new\n    0,                                                                  // tp_free\n    0,                                                                  // tp_is_gc\n    0,                                                                  // tp_bases\n    0,                                                                  // tp_mro\n    0,                                                                  // tp_cache\n    0,                                                                  // tp_subclasses\n    0,                                                                  // tp_weaklist\n    0,                                                                  // tp_del\n    0,                                                                  // tp_version_tag\n    (destructor)Nuitka_Coroutine_tp_finalize,                           // tp_finalize\n};\n\nstatic void Nuitka_CoroutineWrapper_tp_dealloc(struct Nuitka_CoroutineWrapperObject *cw) {\n    Nuitka_GC_UnTrack((PyObject *)cw);\n\n    assert(Py_REFCNT(cw) == 0);\n    Py_SET_REFCNT(cw, 1);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_CoroutineWrapper_Type -= 1;\n    count_released_Nuitka_CoroutineWrapper_Type += 1;\n#endif\n    CHECK_OBJECT(cw->m_coroutine);\n\n    Py_DECREF(cw->m_coroutine);\n    cw->m_coroutine = NULL;\n\n    assert(Py_REFCNT(cw) == 1);\n    Py_SET_REFCNT(cw, 0);\n\n    releaseToFreeList(free_list_coro_wrappers, cw, MAX_COROUTINE_FREE_LIST_COUNT);\n}\n\nstatic PyObject *Nuitka_CoroutineWrapper_tp_iternext(struct Nuitka_CoroutineWrapperObject *cw) {\n    CHECK_OBJECT(cw);\n\n    return Nuitka_Coroutine_send(cw->m_coroutine, Py_None);\n}\n\nstatic int Nuitka_CoroutineWrapper_tp_traverse(struct Nuitka_CoroutineWrapperObject *cw, visitproc visit, void *arg) {\n    CHECK_OBJECT(cw);\n\n    Py_VISIT((PyObject *)cw->m_coroutine);\n    return 0;\n}\n\nstatic PyObject *Nuitka_CoroutineWrapper_send(struct Nuitka_CoroutineWrapperObject *cw, PyObject *arg) {\n    CHECK_OBJECT(cw);\n    CHECK_OBJECT(arg);\n\n    return Nuitka_Coroutine_send(cw->m_coroutine, arg);\n}\n\nstatic PyObject *Nuitka_CoroutineWrapper_throw(struct Nuitka_CoroutineWrapperObject *cw, PyObject *args) {\n    CHECK_OBJECT(cw);\n    CHECK_OBJECT_DEEP(args);\n\n    return Nuitka_Coroutine_throw(cw->m_coroutine, args);\n}\n\nstatic PyObject *Nuitka_CoroutineWrapper_close(struct Nuitka_CoroutineWrapperObject *cw) {\n    CHECK_OBJECT(cw);\n\n    return Nuitka_Coroutine_close(cw->m_coroutine);\n}\n\nstatic PyObject *Nuitka_CoroutineWrapper_tp_repr(struct Nuitka_CoroutineWrapperObject *cw) {\n    CHECK_OBJECT(cw);\n    CHECK_OBJECT(cw->m_coroutine);\n    CHECK_OBJECT(cw->m_coroutine->m_qualname);\n\n    return PyUnicode_FromFormat(\"<compiled_coroutine_wrapper object %s at %p>\",\n                                Nuitka_String_AsString(cw->m_coroutine->m_qualname), cw);\n}\n\nstatic PyMethodDef Nuitka_CoroutineWrapper_methods[] = {\n    {\"send\", (PyCFunction)Nuitka_CoroutineWrapper_send, METH_O, NULL},\n    {\"throw\", (PyCFunction)Nuitka_CoroutineWrapper_throw, METH_VARARGS, NULL},\n    {\"close\", (PyCFunction)Nuitka_CoroutineWrapper_close, METH_NOARGS, NULL},\n    {NULL}};\n\nPyTypeObject Nuitka_CoroutineWrapper_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_coroutine_wrapper\",\n    sizeof(struct Nuitka_CoroutineWrapperObject),      // tp_basicsize\n    0,                                                 // tp_itemsize\n    (destructor)Nuitka_CoroutineWrapper_tp_dealloc,    // tp_dealloc\n    0,                                                 // tp_print\n    0,                                                 // tp_getattr\n    0,                                                 // tp_setattr\n    0,                                                 // tp_as_async\n    (reprfunc)Nuitka_CoroutineWrapper_tp_repr,         // tp_repr\n    0,                                                 // tp_as_number\n    0,                                                 // tp_as_sequence\n    0,                                                 // tp_as_mapping\n    0,                                                 // tp_hash\n    0,                                                 // tp_call\n    0,                                                 // tp_str\n    0,                                                 // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                 // tp_setattro\n    0,                                                 // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,           // tp_flags\n    0,                                                 // tp_doc\n    (traverseproc)Nuitka_CoroutineWrapper_tp_traverse, // tp_traverse\n    0,                                                 // tp_clear\n    0,                                                 // tp_richcompare\n    0,                                                 // tp_weaklistoffset\n    0,                                                 // tp_iter (PyObject_SelfIter)\n    (iternextfunc)Nuitka_CoroutineWrapper_tp_iternext, // tp_iternext\n    Nuitka_CoroutineWrapper_methods,                   // tp_methods\n    0,                                                 // tp_members\n    0,                                                 // tp_getset\n    0,                                                 // tp_base\n    0,                                                 // tp_dict\n    0,                                                 // tp_descr_get\n    0,                                                 // tp_descr_set\n    0,                                                 // tp_dictoffset\n    0,                                                 // tp_init\n    0,                                                 // tp_alloc\n    0,                                                 // tp_new\n    0,                                                 // tp_free\n};\n\n#if PYTHON_VERSION >= 0x3b0\n\n// Not exported by the core library.\nstatic int Nuitka_PyInterpreterFrame_GetLine(_PyInterpreterFrame *frame) {\n    // TODO: For Nuitka frames there is a better way actually, since\n    // we have the line number stored.\n\n    int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT);\n    return PyCode_Addr2Line(frame->f_code, addr);\n}\n\nstatic PyObject *computeCoroutineOrigin(int origin_depth) {\n    PyThreadState *tstate = _PyThreadState_GET();\n    _PyInterpreterFrame *current_frame = tstate->cframe->current_frame;\n\n    // Create result tuple with correct size.\n    int frame_count = 0;\n    _PyInterpreterFrame *frame = current_frame;\n    while (frame != NULL && frame_count < origin_depth) {\n        frame = frame->previous;\n        frame_count += 1;\n    }\n    PyObject *cr_origin = MAKE_TUPLE_EMPTY_VAR(frame_count);\n\n    frame = current_frame;\n    for (int i = 0; i < frame_count; i++) {\n        PyCodeObject *code = frame->f_code;\n\n        int line = Nuitka_PyInterpreterFrame_GetLine(frame);\n\n        PyObject *frame_info = Py_BuildValue(\"OiO\", code->co_filename, line, code->co_name);\n        assert(frame_info);\n\n        PyTuple_SET_ITEM(cr_origin, i, frame_info);\n        frame = frame->previous;\n    }\n\n    return cr_origin;\n}\n\n#elif PYTHON_VERSION >= 0x370\nstatic PyObject *computeCoroutineOrigin(int origin_depth) {\n    PyFrameObject *frame = PyEval_GetFrame();\n\n    int frame_count = 0;\n\n    while (frame != NULL && frame_count < origin_depth) {\n        frame = frame->f_back;\n        frame_count += 1;\n    }\n\n    PyObject *cr_origin = MAKE_TUPLE_EMPTY(frame_count);\n\n    frame = PyEval_GetFrame();\n\n    for (int i = 0; i < frame_count; i++) {\n        PyObject *frame_info =\n            Py_BuildValue(\"OiO\", frame->f_code->co_filename, PyFrame_GetLineNumber(frame), frame->f_code->co_name);\n\n        assert(frame_info);\n\n        PyTuple_SET_ITEM(cr_origin, i, frame_info);\n\n        frame = frame->f_back;\n    }\n\n    return cr_origin;\n}\n#endif\n\nPyObject *Nuitka_Coroutine_New(PyThreadState *tstate, coroutine_code code, PyObject *module, PyObject *name,\n                               PyObject *qualname, PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                               Py_ssize_t closure_given, Py_ssize_t heap_storage_size) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Coroutine_Type += 1;\n    count_allocated_Nuitka_Coroutine_Type += 1;\n#endif\n\n    struct Nuitka_CoroutineObject *result;\n\n    // TODO: Change the var part of the type to 1 maybe\n    Py_ssize_t full_size = closure_given + (heap_storage_size + sizeof(void *) - 1) / sizeof(void *);\n\n    // Macro to assign result memory from GC or free list.\n    allocateFromFreeList(free_list_coros, struct Nuitka_CoroutineObject, Nuitka_Coroutine_Type, full_size);\n\n    // For quicker access of generator heap.\n    result->m_heap_storage = &result->m_closure[closure_given];\n\n    result->m_code = (void *)code;\n\n    CHECK_OBJECT(module);\n    result->m_module = module;\n\n    CHECK_OBJECT(name);\n    result->m_name = name;\n    Py_INCREF(name);\n\n    // The \"qualname\" defaults to NULL for most compact C code.\n    if (qualname == NULL) {\n        qualname = name;\n    }\n    CHECK_OBJECT(qualname);\n\n    result->m_qualname = qualname;\n    Py_INCREF(qualname);\n\n    result->m_yield_from = NULL;\n\n    memcpy(&result->m_closure[0], closure, closure_given * sizeof(struct Nuitka_CellObject *));\n    result->m_closure_given = closure_given;\n\n    result->m_weakrefs = NULL;\n\n    result->m_status = status_Unused;\n    result->m_running = 0;\n    result->m_awaiting = false;\n\n    result->m_yield_return_index = 0;\n\n    result->m_returned = NULL;\n\n    result->m_frame = NULL;\n    result->m_code_object = code_object;\n\n    result->m_resume_frame = NULL;\n\n#if PYTHON_VERSION >= 0x370\n    int origin_depth = tstate->coroutine_origin_tracking_depth;\n\n    if (origin_depth == 0) {\n        result->m_origin = NULL;\n    } else {\n        result->m_origin = computeCoroutineOrigin(origin_depth);\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x370\n    result->m_exc_state = Nuitka_ExceptionStackItem_Empty;\n#endif\n\n    static long Nuitka_Coroutine_counter = 0;\n    result->m_counter = Nuitka_Coroutine_counter++;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\nstatic inline PyCodeObject *_Nuitka_PyGen_GetCode(PyGenObject *gen) {\n#if PYTHON_VERSION < 0x3c0\n    return (PyCodeObject *)gen->gi_code;\n#else\n    _PyInterpreterFrame *frame = (_PyInterpreterFrame *)(gen->gi_iframe);\n    return frame->f_code;\n#endif\n}\n\nstatic int gen_is_coroutine(PyObject *object) {\n    if (PyGen_CheckExact(object)) {\n        PyCodeObject *code = _Nuitka_PyGen_GetCode((PyGenObject *)object);\n\n        if (code->co_flags & CO_ITERABLE_COROUTINE) {\n            return 1;\n        }\n    }\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_GetAwaitableIter(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n#if _DEBUG_COROUTINE\n    PRINT_STRING(\"Nuitka_GetAwaitableIter: Enter \");\n    PRINT_ITEM(value);\n    PRINT_NEW_LINE();\n#endif\n\n    unaryfunc getter = NULL;\n\n    if (PyCoro_CheckExact(value) || gen_is_coroutine(value)) {\n        Py_INCREF(value);\n        return value;\n    }\n\n    if (Py_TYPE(value)->tp_as_async != NULL) {\n        getter = Py_TYPE(value)->tp_as_async->am_await;\n    }\n\n    if (getter != NULL) {\n        PyObject *result = (*getter)(value);\n\n        if (result != NULL) {\n            if (unlikely(PyCoro_CheckExact(result) || gen_is_coroutine(result) || Nuitka_Coroutine_Check(result))) {\n                Py_DECREF(result);\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__await__() returned a coroutine\");\n\n                return NULL;\n            }\n\n            if (unlikely(!HAS_ITERNEXT(result))) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__await__() returned non-iterator of type '%s'\", result);\n\n                Py_DECREF(result);\n\n                return NULL;\n            }\n        }\n\n        return result;\n    }\n\n    SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"object %s can't be used in 'await' expression\", value);\n\n    return NULL;\n}\n\n#if PYTHON_VERSION >= 0x366\nstatic void FORMAT_AWAIT_ERROR(PyThreadState *tstate, PyObject *value, int await_kind) {\n    CHECK_OBJECT(value);\n\n    if (await_kind == await_enter) {\n        PyErr_Format(PyExc_TypeError,\n                     \"'async with' received an object from __aenter__ that does not implement __await__: %s\",\n                     Py_TYPE(value)->tp_name);\n    } else if (await_kind == await_exit) {\n        PyErr_Format(PyExc_TypeError,\n                     \"'async with' received an object from __aexit__ that does not implement __await__: %s\",\n                     Py_TYPE(value)->tp_name);\n    }\n\n    assert(HAS_ERROR_OCCURRED(tstate));\n}\n#endif\n\nPyObject *ASYNC_AWAIT(PyThreadState *tstate, PyObject *awaitable, int await_kind) {\n    CHECK_OBJECT(awaitable);\n\n#if _DEBUG_COROUTINE\n    PRINT_STRING(\"ASYNC_AWAIT: Enter for awaitable \");\n    PRINT_STRING(await_kind == await_enter ? \"enter\" : \"exit\");\n    PRINT_STRING(\" \");\n    PRINT_ITEM(awaitable);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *awaitable_iter = Nuitka_GetAwaitableIter(tstate, awaitable);\n\n    if (unlikely(awaitable_iter == NULL)) {\n#if PYTHON_VERSION >= 0x366\n        FORMAT_AWAIT_ERROR(tstate, awaitable, await_kind);\n#endif\n        return NULL;\n    }\n\n#if PYTHON_VERSION >= 0x352 || !defined(_NUITKA_FULL_COMPAT)\n    /* This check got added in Python 3.5.2 only. It's good to do it, but\n     * not fully compatible, therefore guard it.\n     */\n\n    if (Nuitka_Coroutine_Check(awaitable)) {\n        struct Nuitka_CoroutineObject *awaited_coroutine = (struct Nuitka_CoroutineObject *)awaitable;\n\n        if (awaited_coroutine->m_awaiting) {\n            Py_DECREF(awaitable_iter);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"coroutine is being awaited already\");\n\n            return NULL;\n        }\n    }\n#endif\n\n#if _DEBUG_COROUTINE\n    PRINT_STRING(\"ASYNC_AWAIT: Result \");\n    PRINT_ITEM(awaitable);\n    PRINT_NEW_LINE();\n#endif\n\n    return awaitable_iter;\n}\n\n#if PYTHON_VERSION >= 0x352\n\n/* Our \"aiter\" wrapper clone */\nstruct Nuitka_AIterWrapper {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *aw_aiter;\n};\n\nstatic PyObject *Nuitka_AIterWrapper_tp_repr(struct Nuitka_AIterWrapper *aw) {\n    return PyUnicode_FromFormat(\"<compiled_aiter_wrapper object of %R at %p>\", aw->aw_aiter, aw);\n}\n\nstatic PyObject *Nuitka_AIterWrapper_iternext(struct Nuitka_AIterWrapper *aw) {\n    CHECK_OBJECT(aw);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#if PYTHON_VERSION < 0x360\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_StopIteration, aw->aw_aiter);\n#else\n    if (!PyTuple_Check(aw->aw_aiter) && !PyExceptionInstance_Check(aw->aw_aiter)) {\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_StopIteration, aw->aw_aiter);\n    } else {\n        PyObject *result = PyObject_CallFunctionObjArgs(PyExc_StopIteration, aw->aw_aiter, NULL);\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_StopIteration, result);\n    }\n#endif\n\n    return NULL;\n}\n\nstatic int Nuitka_AIterWrapper_traverse(struct Nuitka_AIterWrapper *aw, visitproc visit, void *arg) {\n    CHECK_OBJECT(aw);\n\n    Py_VISIT((PyObject *)aw->aw_aiter);\n    return 0;\n}\n\nstatic struct Nuitka_AIterWrapper *free_list_coroutine_aiter_wrappers = NULL;\nstatic int free_list_coroutine_aiter_wrappers_count = 0;\n\nstatic void Nuitka_AIterWrapper_dealloc(struct Nuitka_AIterWrapper *aw) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AIterWrapper_Type -= 1;\n    count_released_Nuitka_AIterWrapper_Type += 1;\n#endif\n\n    Nuitka_GC_UnTrack((PyObject *)aw);\n\n    CHECK_OBJECT(aw->aw_aiter);\n    Py_DECREF(aw->aw_aiter);\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_coroutine_aiter_wrappers, aw, MAX_COROUTINE_FREE_LIST_COUNT);\n}\n\nstatic PyAsyncMethods Nuitka_AIterWrapper_as_async = {\n    0, // am_await (PyObject_SelfIter)\n    0, // am_aiter\n    0  // am_anext\n};\n\nPyTypeObject Nuitka_AIterWrapper_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_aiter_wrapper\",\n    sizeof(struct Nuitka_AIterWrapper),                          // tp_basicsize\n    0,                                                           // tp_itemsize\n    (destructor)Nuitka_AIterWrapper_dealloc,                     // tp_dealloc\n    0,                                                           // tp_print\n    0,                                                           // tp_getattr\n    0,                                                           // tp_setattr\n    &Nuitka_AIterWrapper_as_async,                               // tp_as_async\n    (reprfunc)Nuitka_AIterWrapper_tp_repr,                       // tp_repr\n    0,                                                           // tp_as_number\n    0,                                                           // tp_as_sequence\n    0,                                                           // tp_as_mapping\n    0,                                                           // tp_hash\n    0,                                                           // tp_call\n    0,                                                           // tp_str\n    0,                                                           // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                           // tp_setattro\n    0,                                                           // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,                     // tp_flags\n    \"A wrapper object for '__aiter__' backwards compatibility.\", // tp_doc\n    (traverseproc)Nuitka_AIterWrapper_traverse,                  // tp_traverse\n    0,                                                           // tp_clear\n    0,                                                           // tp_richcompare\n    0,                                                           // tp_weaklistoffset\n    0,                                                           // tp_iter (PyObject_SelfIter)\n    (iternextfunc)Nuitka_AIterWrapper_iternext,                  // tp_iternext\n    0,                                                           // tp_methods\n    0,                                                           // tp_members\n    0,                                                           // tp_getset\n    0,                                                           // tp_base\n    0,                                                           // tp_dict\n    0,                                                           // tp_descr_get\n    0,                                                           // tp_descr_set\n    0,                                                           // tp_dictoffset\n    0,                                                           // tp_init\n    0,                                                           // tp_alloc\n    0,                                                           // tp_new\n    0,                                                           // tp_free\n};\n\nstatic PyObject *Nuitka_AIterWrapper_New(PyObject *aiter) {\n    CHECK_OBJECT(aiter);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_AIterWrapper_Type += 1;\n    count_allocated_Nuitka_AIterWrapper_Type += 1;\n#endif\n    struct Nuitka_AIterWrapper *result;\n\n    allocateFromFreeListFixed(free_list_coroutine_aiter_wrappers, struct Nuitka_AIterWrapper, Nuitka_AIterWrapper_Type);\n\n    CHECK_OBJECT(aiter);\n\n    Py_INCREF(aiter);\n    result->aw_aiter = aiter;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\n#endif\n\nPyObject *ASYNC_MAKE_ITERATOR(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n#if _DEBUG_COROUTINE\n    PRINT_STRING(\"AITER entry:\");\n    PRINT_ITEM(value);\n\n    PRINT_NEW_LINE();\n#endif\n\n    unaryfunc getter = NULL;\n\n    if (Py_TYPE(value)->tp_as_async) {\n        getter = Py_TYPE(value)->tp_as_async->am_aiter;\n    }\n\n    if (unlikely(getter == NULL)) {\n        PyErr_Format(PyExc_TypeError, \"'async for' requires an object with __aiter__ method, got %s\",\n                     Py_TYPE(value)->tp_name);\n\n        return NULL;\n    }\n\n    PyObject *iter = (*getter)(value);\n\n    if (unlikely(iter == NULL)) {\n        return NULL;\n    }\n\n#if PYTHON_VERSION >= 0x370\n    if (unlikely(Py_TYPE(iter)->tp_as_async == NULL || Py_TYPE(iter)->tp_as_async->am_anext == NULL)) {\n        PyErr_Format(PyExc_TypeError,\n                     \"'async for' received an object from __aiter__ that does not implement __anext__: %s\",\n                     Py_TYPE(iter)->tp_name);\n\n        Py_DECREF(iter);\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x352\n    /* Starting with Python 3.5.2 it is acceptable to return an async iterator\n     * directly, instead of an awaitable.\n     */\n    if (Py_TYPE(iter)->tp_as_async != NULL && Py_TYPE(iter)->tp_as_async->am_anext != NULL) {\n        PyObject *wrapper = Nuitka_AIterWrapper_New(iter);\n        Py_DECREF(iter);\n\n        iter = wrapper;\n    }\n#endif\n\n    PyObject *awaitable_iter = Nuitka_GetAwaitableIter(tstate, iter);\n\n    if (unlikely(awaitable_iter == NULL)) {\n#if PYTHON_VERSION >= 0x360\n        _PyErr_FormatFromCause(\n#else\n        PyErr_Format(\n#endif\n            PyExc_TypeError, \"'async for' received an invalid object from __aiter__: %s\", Py_TYPE(iter)->tp_name);\n\n        Py_DECREF(iter);\n\n        return NULL;\n    }\n\n    Py_DECREF(iter);\n\n    return awaitable_iter;\n}\n\nPyObject *ASYNC_ITERATOR_NEXT(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n#if _DEBUG_COROUTINE\n    PRINT_STRING(\"ANEXT entry:\");\n    PRINT_ITEM(value);\n\n    PRINT_NEW_LINE();\n#endif\n\n    unaryfunc getter = NULL;\n\n    if (Py_TYPE(value)->tp_as_async) {\n        getter = Py_TYPE(value)->tp_as_async->am_anext;\n    }\n\n    if (unlikely(getter == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'async for' requires an iterator with __anext__ method, got %s\", value);\n\n        return NULL;\n    }\n\n    PyObject *next_value = (*getter)(value);\n\n    if (unlikely(next_value == NULL)) {\n        return NULL;\n    }\n\n    PyObject *awaitable_iter = Nuitka_GetAwaitableIter(tstate, next_value);\n\n    if (unlikely(awaitable_iter == NULL)) {\n#if PYTHON_VERSION >= 0x360\n        _PyErr_FormatFromCause(\n#else\n        PyErr_Format(\n#endif\n            PyExc_TypeError, \"'async for' received an invalid object from __anext__: %s\", Py_TYPE(next_value)->tp_name);\n\n        Py_DECREF(next_value);\n\n        return NULL;\n    }\n\n    Py_DECREF(next_value);\n\n    return awaitable_iter;\n}\n\nstatic void _initCompiledCoroutineTypes(void) {\n    Nuitka_PyType_Ready(&Nuitka_Coroutine_Type, &PyCoro_Type, true, false, false, false, false);\n\n    // Be a paranoid subtype of uncompiled function, we want nothing shared.\n    assert(Nuitka_Coroutine_Type.tp_doc != PyCoro_Type.tp_doc || PyCoro_Type.tp_doc == NULL);\n    assert(Nuitka_Coroutine_Type.tp_traverse != PyCoro_Type.tp_traverse);\n    assert(Nuitka_Coroutine_Type.tp_clear != PyCoro_Type.tp_clear || PyCoro_Type.tp_clear == NULL);\n    assert(Nuitka_Coroutine_Type.tp_richcompare != PyCoro_Type.tp_richcompare || PyCoro_Type.tp_richcompare == NULL);\n    assert(Nuitka_Coroutine_Type.tp_weaklistoffset != PyCoro_Type.tp_weaklistoffset);\n    assert(Nuitka_Coroutine_Type.tp_iter != PyCoro_Type.tp_iter || PyCoro_Type.tp_iter == NULL);\n    assert(Nuitka_Coroutine_Type.tp_iternext != PyCoro_Type.tp_iternext || PyCoro_Type.tp_iternext == NULL);\n    assert(Nuitka_Coroutine_Type.tp_as_async != PyCoro_Type.tp_as_async || PyCoro_Type.tp_as_async == NULL);\n    assert(Nuitka_Coroutine_Type.tp_methods != PyCoro_Type.tp_methods);\n    assert(Nuitka_Coroutine_Type.tp_members != PyCoro_Type.tp_members);\n    assert(Nuitka_Coroutine_Type.tp_getset != PyCoro_Type.tp_getset);\n    assert(Nuitka_Coroutine_Type.tp_dict != PyCoro_Type.tp_dict);\n    assert(Nuitka_Coroutine_Type.tp_descr_get != PyCoro_Type.tp_descr_get || PyCoro_Type.tp_descr_get == NULL);\n\n    assert(Nuitka_Coroutine_Type.tp_descr_set != PyCoro_Type.tp_descr_set || PyCoro_Type.tp_descr_set == NULL);\n    assert(Nuitka_Coroutine_Type.tp_dictoffset != PyCoro_Type.tp_dictoffset || PyCoro_Type.tp_dictoffset == 0);\n    // TODO: These get changed and into the same thing, not sure what to compare against, project something\n    // assert(Nuitka_Coroutine_Type.tp_init != PyCoro_Type.tp_init || PyCoro_Type.tp_init == NULL);\n    // assert(Nuitka_Coroutine_Type.tp_alloc != PyCoro_Type.tp_alloc || PyCoro_Type.tp_alloc == NULL);\n    // assert(Nuitka_Coroutine_Type.tp_new != PyCoro_Type.tp_new || PyCoro_Type.tp_new == NULL);\n    // assert(Nuitka_Coroutine_Type.tp_free != PyCoro_Type.tp_free || PyCoro_Type.tp_free == NULL);\n    assert(Nuitka_Coroutine_Type.tp_bases != PyCoro_Type.tp_bases);\n    assert(Nuitka_Coroutine_Type.tp_mro != PyCoro_Type.tp_mro);\n    assert(Nuitka_Coroutine_Type.tp_cache != PyCoro_Type.tp_cache || PyCoro_Type.tp_cache == NULL);\n    assert(Nuitka_Coroutine_Type.tp_subclasses != PyCoro_Type.tp_subclasses || PyCoro_Type.tp_cache == NULL);\n    assert(Nuitka_Coroutine_Type.tp_weaklist != PyCoro_Type.tp_weaklist);\n    assert(Nuitka_Coroutine_Type.tp_del != PyCoro_Type.tp_del || PyCoro_Type.tp_del == NULL);\n    assert(Nuitka_Coroutine_Type.tp_finalize != PyCoro_Type.tp_finalize || PyCoro_Type.tp_finalize == NULL);\n\n    Nuitka_PyType_Ready(&Nuitka_CoroutineWrapper_Type, NULL, true, false, true, false, false);\n\n#if PYTHON_VERSION >= 0x352\n    Nuitka_PyType_Ready(&Nuitka_AIterWrapper_Type, NULL, true, false, true, true, false);\n#endif\n}\n\n// Chain asyncgen code to coroutine and generator code, as it uses same functions,\n// and then we can have some things static if both are in the same compilation unit.\n\n#if PYTHON_VERSION >= 0x360\n#include \"CompiledAsyncgenType.c\"\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledFrameType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n#ifdef __IDE_ONLY__\n#include \"nuitka/freelists.h\"\n#include \"nuitka/prelude.h\"\n#include <structmember.h>\n#endif\n\n// For reporting about reference counts per type.\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Frame_Type = 0;\nint count_allocated_Nuitka_Frame_Type = 0;\nint count_released_Nuitka_Frame_Type = 0;\n#endif\n\n// For reporting about frame cache usage\n#if _DEBUG_REFCOUNTS\nint count_active_frame_cache_instances = 0;\nint count_allocated_frame_cache_instances = 0;\nint count_released_frame_cache_instances = 0;\nint count_hit_frame_cache_instances = 0;\n#endif\n\n#if PYTHON_VERSION < 0x3b0\nstatic PyMemberDef Nuitka_Frame_memberlist[] = {\n    {(char *)\"f_back\", T_OBJECT, offsetof(PyFrameObject, f_back), READONLY | RESTRICTED},\n    {(char *)\"f_code\", T_OBJECT, offsetof(PyFrameObject, f_code), READONLY | RESTRICTED},\n    {(char *)\"f_builtins\", T_OBJECT, offsetof(PyFrameObject, f_builtins), READONLY | RESTRICTED},\n    {(char *)\"f_globals\", T_OBJECT, offsetof(PyFrameObject, f_globals), READONLY | RESTRICTED},\n    {(char *)\"f_lasti\", T_INT, offsetof(PyFrameObject, f_lasti), READONLY | RESTRICTED},\n    {NULL}};\n\n#else\n#define Nuitka_Frame_memberlist 0\n#endif\n\n#if PYTHON_VERSION < 0x300\n\nstatic PyObject *Nuitka_Frame_get_exc_traceback(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result = frame->m_frame.f_exc_traceback;\n\n    if (result == NULL) {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_set_exc_traceback(struct Nuitka_FrameObject *frame, PyObject *traceback) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    Py_XDECREF(frame->m_frame.f_exc_traceback);\n\n    if (traceback == Py_None) {\n        traceback = NULL;\n    }\n\n    frame->m_frame.f_exc_traceback = traceback;\n    Py_XINCREF(traceback);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Frame_get_exc_type(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result;\n\n    if (frame->m_frame.f_exc_type != NULL) {\n        result = frame->m_frame.f_exc_type;\n    } else {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_set_exc_type(struct Nuitka_FrameObject *frame, PyObject *exception_type) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *old = frame->m_frame.f_exc_type;\n\n    if (exception_type == Py_None) {\n        exception_type = NULL;\n    }\n\n    frame->m_frame.f_exc_type = exception_type;\n    Py_XINCREF(frame->m_frame.f_exc_type);\n\n    Py_XDECREF(old);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Frame_get_exc_value(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result;\n\n    if (frame->m_frame.f_exc_value != NULL) {\n        result = frame->m_frame.f_exc_value;\n    } else {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_set_exc_value(struct Nuitka_FrameObject *frame, PyObject *exception_value) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *old = frame->m_frame.f_exc_value;\n\n    if (exception_value == Py_None) {\n        exception_value = NULL;\n    }\n\n    frame->m_frame.f_exc_value = exception_value;\n    Py_XINCREF(exception_value);\n    Py_XDECREF(old);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Frame_get_restricted(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    Py_INCREF(Py_False);\n    return Py_False;\n}\n\n#endif\n\nstatic PyObject *Nuitka_Frame_getlocals(struct Nuitka_FrameObject *nuitka_frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)nuitka_frame));\n    CHECK_OBJECT((PyObject *)nuitka_frame);\n    assert(_PyObject_GC_IS_TRACKED(nuitka_frame));\n\n    if (nuitka_frame->m_type_description == NULL) {\n#if PYTHON_VERSION < 0x3b0\n        PyFrameObject *locals_owner = &nuitka_frame->m_frame;\n#else\n        _PyInterpreterFrame *locals_owner = &nuitka_frame->m_interpreter_frame;\n#endif\n\n        if (locals_owner->f_locals == NULL) {\n            locals_owner->f_locals = MAKE_DICT_EMPTY();\n        }\n\n        Py_INCREF(locals_owner->f_locals);\n        return locals_owner->f_locals;\n    } else {\n        PyObject *result = MAKE_DICT_EMPTY();\n        PyObject **var_names = Nuitka_GetCodeVarNames(Nuitka_GetFrameCodeObject(nuitka_frame));\n\n        char const *w = nuitka_frame->m_type_description;\n        char const *t = nuitka_frame->m_locals_storage;\n\n        while (*w != 0) {\n            switch (*w) {\n            case NUITKA_TYPE_DESCRIPTION_OBJECT:\n            case NUITKA_TYPE_DESCRIPTION_OBJECT_PTR: {\n                PyObject *value = *(PyObject **)t;\n                CHECK_OBJECT_X(value);\n\n                if (value != NULL) {\n                    DICT_SET_ITEM(result, *var_names, value);\n                }\n\n                t += sizeof(PyObject *);\n\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_CELL: {\n                struct Nuitka_CellObject *value = *(struct Nuitka_CellObject **)t;\n                assert(Nuitka_Cell_Check((PyObject *)value));\n                CHECK_OBJECT(value);\n\n                if (value->ob_ref != NULL) {\n                    DICT_SET_ITEM(result, *var_names, value->ob_ref);\n                }\n\n                t += sizeof(struct Nuitka_CellObject *);\n\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_NULL: {\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_BOOL: {\n                int value = *(int *)t;\n                t += sizeof(int);\n                switch ((nuitka_bool)value) {\n                case NUITKA_BOOL_TRUE: {\n                    DICT_SET_ITEM(result, *var_names, Py_True);\n                    break;\n                }\n                case NUITKA_BOOL_FALSE: {\n                    DICT_SET_ITEM(result, *var_names, Py_False);\n                    break;\n                }\n                default:\n                    break;\n                }\n                break;\n            }\n            default:\n                assert(false);\n            }\n\n            w += 1;\n            var_names += 1;\n        }\n\n        return result;\n    }\n}\n\nstatic PyObject *Nuitka_Frame_getlineno(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    return PyInt_FromLong(frame->m_frame.f_lineno);\n}\n\nstatic PyObject *Nuitka_Frame_gettrace(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result = frame->m_frame.f_trace;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_settrace(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"f_trace is not writable in Nuitka\");\n    return -1;\n}\n\n#if PYTHON_VERSION >= 0x370\nstatic PyObject *Nuitka_Frame_gettracelines(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result = Py_False;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_settracelines(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"f_trace_lines is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Frame_gettraceopcodes(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyObject *result = Py_False;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Frame_settraceopcodes(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"f_trace_opcodes is not writable in Nuitka\");\n    return -1;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\nstatic PyObject *Nuitka_Frame_getback(struct Nuitka_FrameObject *frame, void *closure) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    return (PyObject *)PyFrame_GetBack(&frame->m_frame);\n}\n#endif\n\nstatic PyGetSetDef Nuitka_Frame_getsetlist[] = {\n    {(char *)\"f_locals\", (getter)Nuitka_Frame_getlocals, NULL, NULL},\n    {(char *)\"f_lineno\", (getter)Nuitka_Frame_getlineno, NULL, NULL},\n    {(char *)\"f_trace\", (getter)Nuitka_Frame_gettrace, (setter)Nuitka_Frame_settrace, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"f_restricted\", (getter)Nuitka_Frame_get_restricted, NULL, NULL},\n    {(char *)\"f_exc_traceback\", (getter)Nuitka_Frame_get_exc_traceback, (setter)Nuitka_Frame_set_exc_traceback, NULL},\n    {(char *)\"f_exc_type\", (getter)Nuitka_Frame_get_exc_type, (setter)Nuitka_Frame_set_exc_type, NULL},\n    {(char *)\"f_exc_value\", (getter)Nuitka_Frame_get_exc_value, (setter)Nuitka_Frame_set_exc_value, NULL},\n#endif\n#if PYTHON_VERSION >= 0x370\n    {(char *)\"f_trace_lines\", (getter)Nuitka_Frame_gettracelines, (setter)Nuitka_Frame_settracelines, NULL},\n    {(char *)\"f_trace_opcodes\", (getter)Nuitka_Frame_gettraceopcodes, (setter)Nuitka_Frame_settraceopcodes, NULL},\n#endif\n#if PYTHON_VERSION >= 0x3b0\n    {(char *)\"f_trace_lines\", (getter)Nuitka_Frame_getback, NULL, NULL},\n#endif\n    {NULL}};\n\n// tp_repr slot, decide how a function shall be output\nstatic PyObject *Nuitka_Frame_tp_repr(struct Nuitka_FrameObject *nuitka_frame) {\n    assert(Nuitka_Frame_Check((PyObject *)nuitka_frame));\n    CHECK_OBJECT((PyObject *)nuitka_frame);\n    assert(_PyObject_GC_IS_TRACKED(nuitka_frame));\n\n#if PYTHON_VERSION >= 0x370\n    PyCodeObject *code_object = Nuitka_GetFrameCodeObject(nuitka_frame);\n    return Nuitka_String_FromFormat(\"<compiled_frame at %p, file %R, line %d, code %S>\", nuitka_frame,\n                                    code_object->co_filename, Nuitka_GetFrameLineNumber(nuitka_frame),\n                                    code_object->co_name);\n#elif _DEBUG_FRAME || _DEBUG_REFRAME || _DEBUG_EXCEPTIONS\n    PyCodeObject *code_object = Nuitka_GetFrameCodeObject(nuitka_frame);\n    return Nuitka_String_FromFormat(\"<compiled_frame object for %s at %p>\",\n                                    Nuitka_String_AsString(code_object->co_name), nuitka_frame);\n#else\n    return Nuitka_String_FromFormat(\"<compiled_frame object at %p>\", nuitka_frame);\n#endif\n}\n\nstatic void Nuitka_Frame_tp_clear(struct Nuitka_FrameObject *frame) {\n    if (frame->m_type_description) {\n        char const *w = frame->m_type_description;\n        char const *t = frame->m_locals_storage;\n\n        while (*w != 0) {\n            switch (*w) {\n            case NUITKA_TYPE_DESCRIPTION_OBJECT:\n            case NUITKA_TYPE_DESCRIPTION_OBJECT_PTR: {\n                PyObject *value = *(PyObject **)t;\n                CHECK_OBJECT_X(value);\n\n                Py_XDECREF(value);\n\n                t += sizeof(PyObject *);\n\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_CELL: {\n                struct Nuitka_CellObject *value = *(struct Nuitka_CellObject **)t;\n                assert(Nuitka_Cell_Check((PyObject *)value));\n                CHECK_OBJECT(value);\n\n                Py_DECREF(value);\n\n                t += sizeof(struct Nuitka_CellObject *);\n\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_NULL: {\n                break;\n            }\n            case NUITKA_TYPE_DESCRIPTION_BOOL: {\n                t += sizeof(int);\n\n                break;\n            }\n            default:\n                assert(false);\n            }\n\n            w += 1;\n        }\n\n        frame->m_type_description = NULL;\n    }\n}\n\n#define MAX_FRAME_FREE_LIST_COUNT 100\nstatic struct Nuitka_FrameObject *free_list_frames = NULL;\nstatic int free_list_frames_count = 0;\n\nstatic void Nuitka_Frame_tp_dealloc(struct Nuitka_FrameObject *nuitka_frame) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Frame_Type -= 1;\n    count_released_Nuitka_Frame_Type += 1;\n#endif\n\n#ifndef __NUITKA_NO_ASSERT__\n    // Save the current exception, if any, we must to not corrupt it.\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state1;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n#endif\n\n    Nuitka_GC_UnTrack(nuitka_frame);\n\n    PyFrameObject *frame = &nuitka_frame->m_frame;\n#if PYTHON_VERSION < 0x3b0\n    PyFrameObject *locals_owner = frame;\n#else\n    _PyInterpreterFrame *locals_owner = &nuitka_frame->m_interpreter_frame;\n#endif\n\n    Py_XDECREF(frame->f_back);\n    Py_DECREF(locals_owner->f_builtins);\n    Py_DECREF(locals_owner->f_globals);\n    Py_XDECREF(locals_owner->f_locals);\n\n#if PYTHON_VERSION < 0x370\n    Py_XDECREF(frame->f_exc_type);\n    Py_XDECREF(frame->f_exc_value);\n    Py_XDECREF(frame->f_exc_traceback);\n#endif\n\n    Nuitka_Frame_tp_clear(nuitka_frame);\n\n    Py_SET_REFCNT(nuitka_frame, Py_REFCNT(nuitka_frame) - 1);\n    if (Py_REFCNT(nuitka_frame) >= 1) {\n        // TODO: Allow this in debug mode, for now we would like to reproduce it.\n        assert(false);\n        return;\n    }\n\n#if PYTHON_VERSION >= 0x3b0\n    // Restore from backup, see header comment for the field \"m_ob_size\" to get\n    // it.\n    Py_SET_SIZE(nuitka_frame, nuitka_frame->m_ob_size);\n#endif\n\n    releaseToFreeList(free_list_frames, nuitka_frame, MAX_FRAME_FREE_LIST_COUNT);\n\n#ifndef __NUITKA_NO_ASSERT__\n    struct Nuitka_ExceptionPreservationItem saved_exception_state2;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n\n    ASSERT_SAME_EXCEPTION_STATE(&saved_exception_state1, &saved_exception_state2);\n#endif\n}\n\nstatic int Nuitka_Frame_tp_traverse(struct Nuitka_FrameObject *frame, visitproc visit, void *arg) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    Py_VISIT(frame->m_frame.f_back);\n\n#if PYTHON_VERSION < 0x3b0\n    PyFrameObject *locals_owner = &frame->m_frame;\n#else\n    _PyInterpreterFrame *locals_owner = &frame->m_interpreter_frame;\n#endif\n\n    Py_VISIT(locals_owner->f_builtins);\n    Py_VISIT(locals_owner->f_globals);\n    // Py_VISIT(locals_owner->f_locals);\n\n#if PYTHON_VERSION < 0x370\n    Py_VISIT(frame->m_frame.f_exc_type);\n    Py_VISIT(frame->m_frame.f_exc_value);\n    Py_VISIT(frame->m_frame.f_exc_traceback);\n#endif\n\n    // Traverse attached locals too.\n    char const *w = frame->m_type_description;\n    char const *t = frame->m_locals_storage;\n\n    while (w != NULL && *w != 0) {\n        switch (*w) {\n        case NUITKA_TYPE_DESCRIPTION_OBJECT:\n        case NUITKA_TYPE_DESCRIPTION_OBJECT_PTR: {\n            PyObject *value = *(PyObject **)t;\n            CHECK_OBJECT_X(value);\n\n            Py_VISIT(value);\n            t += sizeof(PyObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_CELL: {\n            struct Nuitka_CellObject *value = *(struct Nuitka_CellObject **)t;\n            assert(Nuitka_Cell_Check((PyObject *)value));\n            CHECK_OBJECT(value);\n\n            Py_VISIT(value);\n\n            t += sizeof(struct Nuitka_CellObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_NULL: {\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_BOOL: {\n            t += sizeof(int);\n\n            break;\n        }\n        default:\n            assert(false);\n        }\n\n        w += 1;\n    }\n\n    return 0;\n}\n\n#if PYTHON_VERSION >= 0x340\n\nstatic PyObject *Nuitka_Frame_clear(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (Nuitka_Frame_IsExecuting(frame)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot clear an executing frame\");\n\n        return NULL;\n    }\n\n#if PYTHON_VERSION >= 0x3b0\n    if (frame->m_frame_state == FRAME_COMPLETED) {\n        Nuitka_Frame_tp_clear(frame);\n\n        Py_RETURN_NONE;\n    }\n\n    if (frame->m_frame_state == FRAME_EXECUTING) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot clear an executing frame\");\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x340\n    // For frames that are closed, we also need to close the generator.\n    PyObject *f_gen = Nuitka_GetFrameGenerator(frame);\n    if (f_gen != NULL) {\n        CHECK_OBJECT(f_gen);\n\n        Py_INCREF(frame);\n\n        bool close_exception;\n\n        if (Nuitka_Generator_Check(f_gen)) {\n            struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)f_gen;\n            Nuitka_SetFrameGenerator(frame, NULL);\n\n            close_exception = !_Nuitka_Generator_close(tstate, generator);\n        }\n#if PYTHON_VERSION >= 0x350\n        else if (Nuitka_Coroutine_Check(f_gen)) {\n            struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)f_gen;\n            Nuitka_SetFrameGenerator(frame, NULL);\n\n            close_exception = !_Nuitka_Coroutine_close(tstate, coroutine);\n        }\n#endif\n#if PYTHON_VERSION >= 0x360\n        else if (Nuitka_Asyncgen_Check(f_gen)) {\n            struct Nuitka_AsyncgenObject *asyncgen = (struct Nuitka_AsyncgenObject *)f_gen;\n            Nuitka_SetFrameGenerator(frame, NULL);\n\n            close_exception = !_Nuitka_Asyncgen_close(tstate, asyncgen);\n        }\n#endif\n        else {\n            // Compiled frames should only have our types, so this ought to not happen.\n            assert(false);\n\n            Nuitka_SetFrameGenerator(frame, NULL);\n\n            close_exception = false;\n        }\n\n        if (unlikely(close_exception)) {\n            PyErr_WriteUnraisable(f_gen);\n        }\n\n        Py_DECREF(frame);\n    }\n#endif\n\n    Nuitka_Frame_tp_clear(frame);\n\n    Py_RETURN_NONE;\n}\n\n#endif\n\nstatic inline Py_ssize_t Nuitka_Frame_GetSize(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n#if PYTHON_VERSION < 0x3b0\n    return Py_SIZE(frame);\n#else\n    return frame->m_ob_size;\n#endif\n}\n\nstatic PyObject *Nuitka_Frame_sizeof(struct Nuitka_FrameObject *frame) {\n    assert(Nuitka_Frame_Check((PyObject *)frame));\n    CHECK_OBJECT((PyObject *)frame);\n    assert(_PyObject_GC_IS_TRACKED(frame));\n\n    return PyInt_FromSsize_t(sizeof(struct Nuitka_FrameObject) + Py_SIZE(frame));\n}\n\nstatic PyMethodDef Nuitka_Frame_methods[] = {\n#if PYTHON_VERSION >= 0x340\n    {\"clear\", (PyCFunction)Nuitka_Frame_clear, METH_NOARGS, \"F.clear(): clear most references held by the frame\"},\n#endif\n    {\"__sizeof__\", (PyCFunction)Nuitka_Frame_sizeof, METH_NOARGS, \"F.__sizeof__() -> size of F in memory, in bytes\"},\n    {NULL, NULL}};\n\nPyTypeObject Nuitka_Frame_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_frame\",\n    sizeof(struct Nuitka_FrameObject),\n    1,\n    (destructor)Nuitka_Frame_tp_dealloc,     // tp_dealloc\n    0,                                       // tp_print\n    0,                                       // tp_getattr\n    0,                                       // tp_setattr\n    0,                                       // tp_compare\n    (reprfunc)Nuitka_Frame_tp_repr,          // tp_repr\n    0,                                       // tp_as_number\n    0,                                       // tp_as_sequence\n    0,                                       // tp_as_mapping\n    0,                                       // tp_hash\n    0,                                       // tp_call\n    0,                                       // tp_str\n    0,                                       // tp_getattro (PyObject_GenericGetAttr)\n    0,                                       // tp_setattro (PyObject_GenericSetAttr)\n    0,                                       // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags\n    0,                                       // tp_doc\n    (traverseproc)Nuitka_Frame_tp_traverse,  // tp_traverse\n    (inquiry)Nuitka_Frame_tp_clear,          // tp_clear\n    0,                                       // tp_richcompare\n    0,                                       // tp_weaklistoffset\n    0,                                       // tp_iter\n    0,                                       // tp_iternext\n    Nuitka_Frame_methods,                    // tp_methods\n    Nuitka_Frame_memberlist,                 // tp_members\n    Nuitka_Frame_getsetlist,                 // tp_getset\n    0,                                       // tp_base\n    0,                                       // tp_dict\n};\n\nvoid _initCompiledFrameType(void) {\n    assert(Nuitka_Frame_Type.tp_doc != PyFrame_Type.tp_doc || PyFrame_Type.tp_doc == NULL);\n    assert(Nuitka_Frame_Type.tp_traverse != PyFrame_Type.tp_traverse);\n    assert(Nuitka_Frame_Type.tp_clear != PyFrame_Type.tp_clear || PyFrame_Type.tp_clear == NULL);\n    assert(Nuitka_Frame_Type.tp_richcompare != PyFrame_Type.tp_richcompare || PyFrame_Type.tp_richcompare == NULL);\n    assert(Nuitka_Frame_Type.tp_weaklistoffset != PyFrame_Type.tp_weaklistoffset ||\n           PyFrame_Type.tp_weaklistoffset == 0);\n    assert(Nuitka_Frame_Type.tp_iter != PyFrame_Type.tp_iter || PyFrame_Type.tp_iter == NULL);\n    assert(Nuitka_Frame_Type.tp_iternext != PyFrame_Type.tp_iternext || PyFrame_Type.tp_iternext == NULL);\n    assert(Nuitka_Frame_Type.tp_methods != PyFrame_Type.tp_methods);\n    assert(Nuitka_Frame_Type.tp_members != PyFrame_Type.tp_members);\n    assert(Nuitka_Frame_Type.tp_getset != PyFrame_Type.tp_getset);\n    assert(Nuitka_Frame_Type.tp_dict != PyFrame_Type.tp_dict);\n    assert(Nuitka_Frame_Type.tp_descr_get != PyFrame_Type.tp_descr_get || PyFrame_Type.tp_descr_get == NULL);\n\n    assert(Nuitka_Frame_Type.tp_descr_set != PyFrame_Type.tp_descr_set || PyFrame_Type.tp_descr_set == NULL);\n    assert(Nuitka_Frame_Type.tp_dictoffset != PyFrame_Type.tp_dictoffset || PyFrame_Type.tp_dictoffset == 0);\n    // TODO: These get changed and into the same thing, not sure what to compare against, project something\n    // assert(Nuitka_Frame_Type.tp_init != PyFrame_Type.tp_init || PyFrame_Type.tp_init == NULL);\n    // assert(Nuitka_Frame_Type.tp_alloc != PyFrame_Type.tp_alloc || PyFrame_Type.tp_alloc == NULL);\n    // assert(Nuitka_Frame_Type.tp_new != PyFrame_Type.tp_new || PyFrame_Type.tp_new == NULL);\n    // assert(Nuitka_Frame_Type.tp_free != PyFrame_Type.tp_free || PyFrame_Type.tp_free == NULL);\n    assert(Nuitka_Frame_Type.tp_bases != PyFrame_Type.tp_bases);\n    assert(Nuitka_Frame_Type.tp_mro != PyFrame_Type.tp_mro);\n    assert(Nuitka_Frame_Type.tp_cache != PyFrame_Type.tp_cache || PyFrame_Type.tp_cache == NULL);\n    assert(Nuitka_Frame_Type.tp_subclasses != PyFrame_Type.tp_subclasses || PyFrame_Type.tp_cache == NULL);\n    assert(Nuitka_Frame_Type.tp_weaklist != PyFrame_Type.tp_weaklist);\n    assert(Nuitka_Frame_Type.tp_del != PyFrame_Type.tp_del || PyFrame_Type.tp_del == NULL);\n#if PYTHON_VERSION >= 0x340\n    assert(Nuitka_Frame_Type.tp_finalize != PyFrame_Type.tp_finalize || PyFrame_Type.tp_finalize == NULL);\n#endif\n    Nuitka_PyType_Ready(&Nuitka_Frame_Type, &PyFrame_Type, true, true, false, false, false);\n\n    // These are to be used interchangeably. Make sure that's true.\n    assert(offsetof(struct Nuitka_FrameObject, m_frame) == 0);\n}\n\nstatic struct Nuitka_FrameObject *_MAKE_COMPILED_FRAME(PyCodeObject *code, PyObject *module, PyObject *f_locals,\n                                                       Py_ssize_t locals_size) {\n    CHECK_CODE_OBJECT(code);\n    CHECK_OBJECT(module);\n\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Frame_Type += 1;\n    count_allocated_Nuitka_Frame_Type += 1;\n#endif\n\n    PyObject *globals = ((PyModuleObject *)module)->md_dict;\n    CHECK_OBJECT(globals);\n\n    assert(PyDict_Check(globals));\n\n    struct Nuitka_FrameObject *result;\n\n    // Macro to assign result memory from GC or free list.\n    allocateFromFreeList(free_list_frames, struct Nuitka_FrameObject, Nuitka_Frame_Type, locals_size);\n\n    result->m_type_description = NULL;\n\n    PyFrameObject *frame = &result->m_frame;\n    // Globals and locals are stored differently before Python 3.11\n#if PYTHON_VERSION < 0x3b0\n    PyFrameObject *locals_owner = frame;\n#else\n    _PyInterpreterFrame *locals_owner = &result->m_interpreter_frame;\n#endif\n\n    locals_owner->f_code = code;\n\n    frame->f_trace = Py_None;\n\n#if PYTHON_VERSION < 0x370\n    frame->f_exc_type = NULL;\n    frame->f_exc_value = NULL;\n    frame->f_exc_traceback = NULL;\n#else\n    frame->f_trace_lines = 0;\n    frame->f_trace_opcodes = 0;\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\n    result->m_ob_size = Py_SIZE(result);\n#endif\n    frame->f_back = NULL;\n\n    Py_INCREF(dict_builtin);\n    locals_owner->f_builtins = (PyObject *)dict_builtin;\n\n    Py_INCREF(globals);\n    locals_owner->f_globals = globals;\n\n    // Note: Reference taking happens in calling function.\n    CHECK_OBJECT_X(f_locals);\n    locals_owner->f_locals = f_locals;\n\n#if PYTHON_VERSION < 0x340\n    frame->f_tstate = PyThreadState_GET();\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    frame->f_lasti = -1;\n    frame->f_iblock = 0;\n#endif\n\n    frame->f_lineno = code->co_firstlineno;\n\n#if PYTHON_VERSION >= 0x340\n    Nuitka_SetFrameGenerator(result, NULL);\n\n    Nuitka_Frame_MarkAsNotExecuting(result);\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\n    result->m_interpreter_frame.frame_obj = &result->m_frame;\n    result->m_interpreter_frame.owner = 0;\n    result->m_interpreter_frame.prev_instr = _PyCode_CODE(code);\n    result->m_frame.f_frame = &result->m_interpreter_frame;\n#endif\n\n    Nuitka_GC_Track(result);\n    return result;\n}\n\nstruct Nuitka_FrameObject *MAKE_MODULE_FRAME(PyCodeObject *code, PyObject *module) {\n    PyObject *f_locals = ((PyModuleObject *)module)->md_dict;\n    Py_INCREF(f_locals);\n\n    return _MAKE_COMPILED_FRAME(code, module, f_locals, 0);\n}\n\nstruct Nuitka_FrameObject *MAKE_FUNCTION_FRAME(PyThreadState *tstate, PyCodeObject *code, PyObject *module,\n                                               Py_ssize_t locals_size) {\n    PyObject *f_locals;\n\n    if (likely((code->co_flags & CO_OPTIMIZED) == CO_OPTIMIZED)) {\n        f_locals = NULL;\n    } else {\n        PyObject *kw_pairs[2] = {const_str_plain___module__, MODULE_NAME0(tstate, module)};\n        f_locals = MAKE_DICT(kw_pairs, 1);\n    }\n\n    return _MAKE_COMPILED_FRAME(code, module, f_locals, locals_size);\n}\n\nstruct Nuitka_FrameObject *MAKE_CLASS_FRAME(PyThreadState *tstate, PyCodeObject *code, PyObject *module,\n                                            PyObject *f_locals, Py_ssize_t locals_size) {\n    // The frame template sets f_locals on usage itself, need not create it that way.\n    if (f_locals == NULL) {\n        PyObject *kw_pairs[2] = {const_str_plain___module__, MODULE_NAME0(tstate, module)};\n        f_locals = MAKE_DICT(kw_pairs, 1);\n    } else {\n        Py_INCREF(f_locals);\n    }\n\n    return _MAKE_COMPILED_FRAME(code, module, f_locals, locals_size);\n}\n\n// This is the backend of MAKE_CODE_OBJECT macro.\nPyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,\n#if PYTHON_VERSION >= 0x3b0\n                             PyObject *function_qualname,\n#endif\n                             PyObject *argnames, PyObject *freevars, int arg_count\n#if PYTHON_VERSION >= 0x300\n                             ,\n                             int kw_only_count\n#endif\n#if PYTHON_VERSION >= 0x380\n                             ,\n                             int pos_only_count\n#endif\n) {\n    CHECK_OBJECT(filename);\n    assert(Nuitka_StringOrUnicode_CheckExact(filename));\n    CHECK_OBJECT(function_name);\n    assert(Nuitka_String_CheckExact(function_name));\n\n#if PYTHON_VERSION < 0x300\n    PyObject *filename_str = NULL;\n\n    // TODO: Memory leak of filename, it might be intended transferred to the\n    // code object by using code.\n    if (PyUnicode_CheckExact(filename)) {\n        filename_str = PyUnicode_AsUTF8String(filename);\n        filename = filename_str;\n    } else {\n        filename_str = filename;\n        Py_INCREF(filename);\n    }\n#endif\n\n    if (argnames == NULL) {\n        argnames = const_tuple_empty;\n    }\n    CHECK_OBJECT(argnames);\n    assert(PyTuple_Check(argnames));\n\n    if (freevars == NULL) {\n        freevars = const_tuple_empty;\n    }\n    CHECK_OBJECT(freevars);\n    assert(PyTuple_Check(freevars));\n\n    // The PyCode_New has funny code that interns, mutating the tuple that owns\n    // it. Really serious non-immutable shit. We have triggered that changes\n    // behind our back in the past.\n#ifndef __NUITKA_NO_ASSERT__\n    // TODO: Reactivate once code object creation becomes un-streaming driven\n    // and we can pass the extra args with no worries.\n\n    // Py_hash_t hash = DEEP_HASH(argnames);\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyObject *code = const_str_empty;\n    PyObject *lnotab = const_str_empty;\n#else\n#if PYTHON_VERSION < 0x3b0\n    PyObject *code = const_bytes_empty;\n    PyObject *lnotab = const_bytes_empty;\n#else\n    // Our code object needs to be recognizable, and Python doesn't store the\n    // length anymore, so we need a non-empty one.\n    static PyObject *empty_code = NULL;\n    if (empty_code == NULL) {\n        empty_code = PyBytes_FromString(\"\\0\\0\");\n    }\n    PyObject *code = empty_code;\n    static PyObject *lnotab = NULL;\n    if (lnotab == NULL) {\n        lnotab = PyBytes_FromStringAndSize(\"\\x80\\x00\\xd8\\x04\\x08\\x80\"\n                                           \"D\",\n                                           7);\n    }\n#endif\n#endif\n\n    // For Python 3.11 this value is checked, even if not used.\n#if PYTHON_VERSION >= 0x3b0\n    int nlocals = (int)PyTuple_GET_SIZE(argnames);\n#else\n    int nlocals = 0;\n#endif\n\n    // Not using PyCode_NewEmpty, it doesn't given us much beyond this\n    // and is not available for Python2.\n\n#if PYTHON_VERSION >= 0x380\n    PyCodeObject *result = PyCode_NewWithPosOnlyArgs(arg_count, // argcount\n#else\n    PyCodeObject *result = PyCode_New(arg_count, // argcount\n#endif\n\n#if PYTHON_VERSION >= 0x300\n#if PYTHON_VERSION >= 0x380\n                                                     pos_only_count, // kw-only count\n#endif\n                                                     kw_only_count, // kw-only count\n#endif\n                                                     nlocals,           // nlocals\n                                                     0,                 // stacksize\n                                                     flags,             // flags\n                                                     code,              // code (bytecode)\n                                                     const_tuple_empty, // consts (we are not going to be compatible)\n                                                     const_tuple_empty, // names (we are not going to be compatible)\n                                                     argnames,          // varnames (we are not going to be compatible)\n                                                     freevars,          // freevars\n                                                     const_tuple_empty, // cellvars (we are not going to be compatible)\n                                                     filename,          // filename\n                                                     function_name,     // name\n#if PYTHON_VERSION >= 0x3b0\n                                                     function_qualname, // qualname\n#endif\n                                                     line,  // firstlineno (offset of the code object)\n                                                     lnotab // lnotab (table to translate code object)\n#if PYTHON_VERSION >= 0x3b0\n                                                     ,\n                                                     const_bytes_empty // exceptiontable\n#endif\n    );\n\n    // assert(DEEP_HASH(tstate, argnames) == hash);\n\n#if PYTHON_VERSION < 0x300\n    Py_DECREF(filename_str);\n#endif\n\n    if (result == NULL) {\n        PyErr_PrintEx(0);\n    }\n\n    CHECK_OBJECT(result);\n    return result;\n}\n\nvoid Nuitka_Frame_AttachLocals(struct Nuitka_FrameObject *frame_object, char const *type_description, ...) {\n    assert(Nuitka_Frame_Check((PyObject *)frame_object));\n    CHECK_OBJECT((PyObject *)frame_object);\n    assert(_PyObject_GC_IS_TRACKED(frame_object));\n    assertFrameObject(frame_object);\n\n#if _DEBUG_FRAME\n    PRINT_FORMAT(\"Attaching to frame 0x%lx %s\\n\", frame_object,\n                 Nuitka_String_AsString(PyObject_Repr((PyObject *)Nuitka_Frame_GetCodeObject(&frame_object->m_frame))));\n#endif\n\n    assert(frame_object->m_type_description == NULL);\n\n    // TODO: Do not call this if there is nothing to do. Instead make all the\n    // places handle NULL pointer and recognize that there is nothing to do.\n    // assert(type_description != NULL && assert(strlen(type_description)>0));\n    if (type_description == NULL) {\n        type_description = \"\";\n    }\n\n    frame_object->m_type_description = type_description;\n\n    char const *w = type_description;\n    char *t = frame_object->m_locals_storage;\n\n    va_list(ap);\n    va_start(ap, type_description);\n\n    while (*w != 0) {\n        switch (*w) {\n        case NUITKA_TYPE_DESCRIPTION_OBJECT: {\n            PyObject *value = va_arg(ap, PyObject *);\n            memcpy(t, &value, sizeof(PyObject *));\n            Py_XINCREF(value);\n            t += sizeof(PyObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_OBJECT_PTR: {\n            /* Note: We store the pointed object only, so this is only\n               a shortcut for the calling side. */\n            PyObject **value = va_arg(ap, PyObject **);\n            CHECK_OBJECT_X(*value);\n\n            memcpy(t, value, sizeof(PyObject *));\n\n            Py_XINCREF(*value);\n            t += sizeof(PyObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_CELL: {\n            struct Nuitka_CellObject *value = va_arg(ap, struct Nuitka_CellObject *);\n            assert(Nuitka_Cell_Check((PyObject *)value));\n            CHECK_OBJECT(value);\n            CHECK_OBJECT_X(value->ob_ref);\n\n            memcpy(t, &value, sizeof(struct Nuitka_CellObject *));\n            // TODO: Reference count must become wrong here, should\n            // be forced to one probably, or we should simply not\n            // store cells, but their values. Take a ref off \"value\"\n            // is probably not needed.\n            // Py_SET_REFCNT((struct Nuitka_CellObject *)t, 1);\n            Py_INCREF(value);\n\n            t += sizeof(struct Nuitka_CellObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_NULL: {\n            NUITKA_MAY_BE_UNUSED void *value = va_arg(ap, struct Nuitka_CellObject *);\n\n            break;\n        }\n        case NUITKA_TYPE_DESCRIPTION_BOOL: {\n            int value = va_arg(ap, int);\n            memcpy(t, &value, sizeof(int));\n\n            t += sizeof(value);\n\n            break;\n        }\n        default:\n            assert(false);\n        }\n\n        w += 1;\n    }\n\n    va_end(ap);\n\n    assert(t - frame_object->m_locals_storage <= Nuitka_Frame_GetSize(frame_object));\n}\n\n// Make a dump of the active frame stack. For debugging purposes only.\n#if _DEBUG_FRAME\nvoid dumpFrameStack(void) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *saved_exception_type, *saved_exception_value;\n    PyTracebackObject *saved_exception_tb;\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    int total = 0;\n\n#if PYTHON_VERSION < 0x3b0\n    PyFrameObject *current = PyThreadState_GET()->frame;\n    while (current != NULL) {\n        total++;\n        current = current->f_back;\n    }\n\n    current = tstate->frame;\n#else\n    _PyCFrame *current = tstate->cframe;\n    while (current != NULL) {\n        total++;\n        current = current->previous;\n    }\n\n    current = tstate->cframe;\n#endif\n\n    PRINT_STRING(\">--------->\\n\");\n\n    while (current) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *current_repr = PyObject_Str((PyObject *)current);\n        PyObject *code_repr = PyObject_Str((PyObject *)current->f_code);\n#else\n        PyObject *current_repr = NULL;\n        if (current->current_frame->frame_obj != NULL) {\n            current_repr = PyObject_Str((PyObject *)current->current_frame->frame_obj);\n        } else {\n            current_repr = const_str_empty;\n            Py_INCREF(const_str_empty);\n        }\n        PyObject *code_repr = PyObject_Str((PyObject *)current->current_frame->f_code);\n#endif\n\n        PRINT_FORMAT(\"Frame stack %d: %s %d %s\\n\", total--, Nuitka_String_AsString(current_repr), Py_REFCNT(current),\n                     Nuitka_String_AsString(code_repr));\n\n        Py_DECREF(current_repr);\n        Py_DECREF(code_repr);\n\n#if PYTHON_VERSION < 0x3b0\n        current = current->f_back;\n#else\n        current = current->previous;\n#endif\n    }\n\n    PRINT_STRING(\">---------<\\n\");\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\nstatic void PRINT_UNCOMPILED_FRAME(char const *prefix, PyFrameObject *frame) {\n    PRINT_STRING(prefix);\n    PRINT_STRING(\" \");\n\n    if (frame) {\n        PyObject *frame_str = PyObject_Str((PyObject *)frame);\n        PRINT_ITEM(frame_str);\n        Py_DECREF(frame_str);\n\n        PyObject *code_object_str = PyObject_Repr((PyObject *)Nuitka_Frame_GetCodeObject(frame));\n        PRINT_ITEM(code_object_str);\n        Py_DECREF(code_object_str);\n\n        PRINT_REFCOUNT((PyObject *)frame);\n    } else {\n        PRINT_STRING(\"<NULL> no frame\");\n    }\n\n    PRINT_NEW_LINE();\n}\n\nvoid PRINT_COMPILED_FRAME(char const *prefix, struct Nuitka_FrameObject *frame) {\n    return PRINT_UNCOMPILED_FRAME(prefix, &frame->m_frame);\n}\n\nvoid PRINT_INTERPRETER_FRAME(char const *prefix, Nuitka_ThreadStateFrameType *frame) {\n#if PYTHON_VERSION < 0x3b0\n    PRINT_UNCOMPILED_FRAME(prefix, frame);\n#else\n    PRINT_STRING(prefix);\n    PRINT_STRING(\" \");\n\n    if (frame) {\n        PRINT_FORMAT(\"0x%lx \", frame);\n\n        PyObject *code_object_str = PyObject_Repr((PyObject *)frame->f_code);\n        PRINT_ITEM(code_object_str);\n        Py_DECREF(code_object_str);\n    } else {\n        PRINT_STRING(\"<NULL> no frame\");\n    }\n\n    PRINT_NEW_LINE();\n#endif\n}\n\nvoid PRINT_TOP_FRAME(char const *prefix) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n#if PYTHON_VERSION < 0x3b0\n    PRINT_UNCOMPILED_FRAME(prefix, tstate->frame);\n#else\n    PRINT_INTERPRETER_FRAME(prefix, tstate->cframe->current_frame);\n#endif\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledFunctionType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// Compiled function type.\n\n// The backbone of the integration into CPython. Try to behave as well as normal\n// functions and built-in functions, or even better.\n\n#include \"nuitka/prelude.h\"\n\n#include \"nuitka/compiled_method.h\"\n\n#include \"nuitka/freelists.h\"\n\n// Needed for offsetof\n#include <stddef.h>\n#include <structmember.h>\n\n// spell-checker: ignore qualname,klass,kwdefaults,getset,weakrefs,vectorcall,nargsf,m_varnames\n\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Function_Type;\nint count_allocated_Nuitka_Function_Type;\nint count_released_Nuitka_Function_Type;\n#endif\n\n// tp_descr_get slot, bind a function to an object.\nstatic PyObject *Nuitka_Function_descr_get(PyObject *function, PyObject *object, PyObject *klass) {\n    assert(Nuitka_Function_Check(function));\n    CHECK_OBJECT((PyObject *)function);\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n#if PYTHON_VERSION >= 0x300\n    if (object == NULL || object == Py_None) {\n        Py_INCREF(function);\n        return function;\n    }\n#endif\n\n    return Nuitka_Method_New((struct Nuitka_FunctionObject *)function, object == Py_None ? NULL : object, klass);\n}\n\n// tp_repr slot, decide how compiled function shall be output to \"repr\" built-in\nstatic PyObject *Nuitka_Function_tp_repr(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    return Nuitka_String_FromFormat(\"<compiled_function %s at %p>\",\n#if PYTHON_VERSION < 0x300\n                                    Nuitka_String_AsString(function->m_name),\n#else\n                                    Nuitka_String_AsString(function->m_qualname),\n#endif\n                                    function);\n}\n\nstatic long Nuitka_Function_tp_traverse(struct Nuitka_FunctionObject *function, visitproc visit, void *arg) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    // TODO: Identify the impact of not visiting other owned objects. It appears\n    // to be mostly harmless, as these are strings.\n    Py_VISIT(function->m_dict);\n\n    for (Py_ssize_t i = 0; i < function->m_closure_given; i++) {\n        Py_VISIT(function->m_closure[i]);\n    }\n\n    return 0;\n}\n\nstatic long Nuitka_Function_tp_hash(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    return function->m_counter;\n}\n\nstatic PyObject *Nuitka_Function_get_name(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = function->m_name;\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_name(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(value == NULL || PyString_Check(value) == 0))\n#else\n    if (unlikely(value == NULL || PyUnicode_Check(value) == 0))\n#endif\n    {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *old = function->m_name;\n    CHECK_OBJECT(old);\n\n    Py_INCREF(value);\n    function->m_name = value;\n    Py_DECREF(old);\n\n    return 0;\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *Nuitka_Function_get_qualname(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = function->m_qualname;\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_qualname(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    if (unlikely(value == NULL || PyUnicode_Check(value) == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__qualname__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *old = function->m_qualname;\n    Py_INCREF(value);\n    function->m_qualname = value;\n    Py_DECREF(old);\n\n    return 0;\n}\n#endif\n\nstatic PyObject *Nuitka_Function_get_doc(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = function->m_doc;\n\n    if (result == NULL) {\n        result = Py_None;\n    }\n\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_doc(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    PyObject *old = function->m_doc;\n\n    function->m_doc = value;\n    Py_XINCREF(value);\n\n    Py_XDECREF(old);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Function_get_dict(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    if (function->m_dict == NULL) {\n        function->m_dict = MAKE_DICT_EMPTY();\n    }\n\n    CHECK_OBJECT(function->m_dict);\n\n    Py_INCREF(function->m_dict);\n    return function->m_dict;\n}\n\nstatic int Nuitka_Function_set_dict(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    if (unlikely(value == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"function's dictionary may not be deleted\");\n        return -1;\n    }\n\n    if (likely(PyDict_Check(value))) {\n        PyObject *old = function->m_dict;\n        CHECK_OBJECT_X(old);\n\n        Py_INCREF(value);\n        function->m_dict = value;\n        Py_XDECREF(old);\n\n        return 0;\n    } else {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"setting function's dictionary to a non-dict\");\n        return -1;\n    }\n}\n\nstatic PyObject *Nuitka_Function_get_code(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = (PyObject *)function->m_code_object;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_code(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"__code__ is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_compiled(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = Nuitka_dunder_compiled_value;\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_compiled(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"__compiled__ is not writable\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_compiled_constant(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = function->m_constant_return_value;\n\n    if (result == NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_AttributeError, \"non-constant return value\");\n\n        return NULL;\n    }\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_compiled_constant(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"__compiled_constant__ is not writable\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_closure(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    if (function->m_closure_given > 0) {\n        return MAKE_TUPLE((PyObject *const *)function->m_closure, function->m_closure_given);\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\nstatic int Nuitka_Function_set_closure(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate,\n#if PYTHON_VERSION < 0x300\n                                    PyExc_TypeError,\n#else\n                                    PyExc_AttributeError,\n#endif\n                                    \"readonly attribute\");\n\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_defaults(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = (PyObject *)function->m_defaults;\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic void _onUpdatedCompiledFunctionDefaultsValue(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n\n    if (function->m_defaults == Py_None) {\n        function->m_defaults_given = 0;\n    } else {\n        function->m_defaults_given = PyTuple_GET_SIZE(function->m_defaults);\n    }\n}\n\nstatic int Nuitka_Function_set_defaults(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    if (value == NULL) {\n        value = Py_None;\n    }\n\n    if (unlikely(value != Py_None && PyTuple_Check(value) == false)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__defaults__ must be set to a tuple object\");\n        return -1;\n    }\n\n    PyObject *old = function->m_defaults;\n    CHECK_OBJECT(old);\n\n    Py_INCREF(value);\n    function->m_defaults = value;\n    Py_DECREF(old);\n\n    _onUpdatedCompiledFunctionDefaultsValue(function);\n\n    return 0;\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *Nuitka_Function_get_kwdefaults(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = function->m_kwdefaults;\n    CHECK_OBJECT_X(result);\n\n    if (result == NULL) {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Function_set_kwdefaults(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    if (value == NULL) {\n        value = Py_None;\n    }\n\n    if (unlikely(value != Py_None && PyDict_Check(value) == false)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__kwdefaults__ must be set to a dict object\");\n        return -1;\n    }\n\n    if (value == Py_None) {\n        value = NULL;\n    }\n\n    PyObject *old = function->m_kwdefaults;\n    CHECK_OBJECT_X(old);\n\n    Py_XINCREF(value);\n    function->m_kwdefaults = value;\n    Py_XDECREF(old);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Function_get_annotations(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    if (function->m_annotations == NULL) {\n        function->m_annotations = MAKE_DICT_EMPTY();\n    }\n    CHECK_OBJECT(function->m_annotations);\n\n    Py_INCREF(function->m_annotations);\n    return function->m_annotations;\n}\n\nstatic int Nuitka_Function_set_annotations(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    if (unlikely(value != NULL && PyDict_Check(value) == false)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__annotations__ must be set to a dict object\");\n        return -1;\n    }\n\n    PyObject *old = function->m_annotations;\n    CHECK_OBJECT_X(old);\n\n    Py_XINCREF(value);\n    function->m_annotations = value;\n    Py_XDECREF(old);\n\n    return 0;\n}\n\n#endif\n\nstatic int Nuitka_Function_set_globals(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"readonly attribute\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_globals(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result = PyModule_GetDict(function->m_module);\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x3a0\nstatic int Nuitka_Function_set_builtins(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"readonly attribute\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Function_get_builtins(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyThreadState *tstate = PyThreadState_GET();\n    return LOOKUP_SUBSCRIPT(tstate, PyModule_GetDict(function->m_module), const_str_plain___builtins__);\n}\n#endif\n\nstatic int Nuitka_Function_set_module(struct Nuitka_FunctionObject *function, PyObject *value) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n    CHECK_OBJECT_X(value);\n\n    if (function->m_dict == NULL) {\n        function->m_dict = MAKE_DICT_EMPTY();\n    }\n\n    if (value == NULL) {\n        value = Py_None;\n    }\n\n    return DICT_SET_ITEM(function->m_dict, const_str_plain___module__, value) ? 0 : -1;\n}\n\nstatic PyObject *Nuitka_Function_get_module(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result;\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // The __dict__ might overrule this.\n    if (function->m_dict) {\n        result = DICT_GET_ITEM1(tstate, function->m_dict, const_str_plain___module__);\n\n        if (result != NULL) {\n            return result;\n        }\n    }\n\n    result = MODULE_NAME1(tstate, function->m_module);\n    return result;\n}\n\nstatic PyGetSetDef Nuitka_Function_getset[] = {\n#if PYTHON_VERSION >= 0x300\n    {(char *)\"__qualname__\", (getter)Nuitka_Function_get_qualname, (setter)Nuitka_Function_set_qualname, NULL},\n#endif\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_name\", (getter)Nuitka_Function_get_name, (setter)Nuitka_Function_set_name, NULL},\n#endif\n    {(char *)\"__name__\", (getter)Nuitka_Function_get_name, (setter)Nuitka_Function_set_name, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_doc\", (getter)Nuitka_Function_get_doc, (setter)Nuitka_Function_set_doc, NULL},\n#endif\n    {(char *)\"__doc__\", (getter)Nuitka_Function_get_doc, (setter)Nuitka_Function_set_doc, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_dict\", (getter)Nuitka_Function_get_dict, (setter)Nuitka_Function_set_dict, NULL},\n#endif\n    {(char *)\"__dict__\", (getter)Nuitka_Function_get_dict, (setter)Nuitka_Function_set_dict, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_code\", (getter)Nuitka_Function_get_code, (setter)Nuitka_Function_set_code, NULL},\n#endif\n    {(char *)\"__code__\", (getter)Nuitka_Function_get_code, (setter)Nuitka_Function_set_code, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_defaults\", (getter)Nuitka_Function_get_defaults, (setter)Nuitka_Function_set_defaults, NULL},\n#endif\n    {(char *)\"__defaults__\", (getter)Nuitka_Function_get_defaults, (setter)Nuitka_Function_set_defaults, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_globals\", (getter)Nuitka_Function_get_globals, (setter)Nuitka_Function_set_globals, NULL},\n#endif\n    {(char *)\"__closure__\", (getter)Nuitka_Function_get_closure, (setter)Nuitka_Function_set_closure, NULL},\n#if PYTHON_VERSION < 0x300\n    {(char *)\"func_closure\", (getter)Nuitka_Function_get_closure, (setter)Nuitka_Function_set_closure, NULL},\n#endif\n    {(char *)\"__globals__\", (getter)Nuitka_Function_get_globals, (setter)Nuitka_Function_set_globals, NULL},\n    {(char *)\"__module__\", (getter)Nuitka_Function_get_module, (setter)Nuitka_Function_set_module, NULL},\n#if PYTHON_VERSION >= 0x300\n    {(char *)\"__kwdefaults__\", (getter)Nuitka_Function_get_kwdefaults, (setter)Nuitka_Function_set_kwdefaults, NULL},\n    {(char *)\"__annotations__\", (getter)Nuitka_Function_get_annotations, (setter)Nuitka_Function_set_annotations, NULL},\n#endif\n#if PYTHON_VERSION >= 0x3a0\n    {(char *)\"__builtins__\", (getter)Nuitka_Function_get_builtins, (setter)Nuitka_Function_set_builtins, NULL},\n#endif\n    {(char *)\"__compiled__\", (getter)Nuitka_Function_get_compiled, (setter)Nuitka_Function_set_compiled, NULL},\n    {(char *)\"__compiled_constant__\", (getter)Nuitka_Function_get_compiled_constant,\n     (setter)Nuitka_Function_set_compiled_constant, NULL},\n    {NULL}};\n\nstatic PyObject *Nuitka_Function_reduce(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    PyObject *result;\n\n#if PYTHON_VERSION < 0x300\n    result = function->m_name;\n#else\n    result = function->m_qualname;\n#endif\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyObject *Nuitka_Function_clone(struct Nuitka_FunctionObject *function) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    for (Py_ssize_t i = 0; i < function->m_closure_given; i++) {\n        assert(function->m_closure[i]);\n        Py_INCREF(function->m_closure[i]);\n    }\n\n    Py_INCREF(function->m_defaults);\n\n#if PYTHON_VERSION >= 0x300\n#if 0\n    PRINT_STRING(\"Nuitka_Function_clone:\");\n    PRINT_ITEM((PyObject *)function);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *annotations = function->m_annotations;\n    if (annotations != NULL) {\n        if (DICT_SIZE(annotations) != 0) {\n            annotations = DICT_COPY(annotations);\n        } else {\n            annotations = NULL;\n        }\n    }\n\n    PyObject *kwdefaults = function->m_kwdefaults;\n    if (kwdefaults != NULL) {\n        if (DICT_SIZE(kwdefaults) != 0) {\n            kwdefaults = DICT_COPY(kwdefaults);\n        } else {\n            kwdefaults = NULL;\n        }\n    }\n#endif\n\n    struct Nuitka_FunctionObject *result =\n        Nuitka_Function_New(function->m_c_code, function->m_name,\n#if PYTHON_VERSION >= 0x300\n                            function->m_qualname,\n#endif\n                            function->m_code_object, function->m_defaults,\n#if PYTHON_VERSION >= 0x300\n                            kwdefaults, annotations,\n#endif\n                            function->m_module, function->m_doc, function->m_closure, function->m_closure_given);\n\n    return (PyObject *)result;\n}\n\n#define MAX_FUNCTION_FREE_LIST_COUNT 100\nstatic struct Nuitka_FunctionObject *free_list_functions = NULL;\nstatic int free_list_functions_count = 0;\n\nstatic void Nuitka_Function_tp_dealloc(struct Nuitka_FunctionObject *function) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Function_Type -= 1;\n    count_released_Nuitka_Function_Type += 1;\n#endif\n\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n#ifndef __NUITKA_NO_ASSERT__\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // Save the current exception, if any, we must to not corrupt it.\n    struct Nuitka_ExceptionPreservationItem saved_exception_state1;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n#endif\n    assert(_PyObject_GC_IS_TRACKED(function));\n    Nuitka_GC_UnTrack(function);\n\n    if (function->m_weakrefs != NULL) {\n        PyObject_ClearWeakRefs((PyObject *)function);\n    }\n\n    Py_DECREF(function->m_name);\n#if PYTHON_VERSION >= 0x300\n    Py_DECREF(function->m_qualname);\n#endif\n\n    // These may actually resurrect the object, not?\n    Py_XDECREF(function->m_dict);\n    Py_DECREF(function->m_defaults);\n\n    Py_XDECREF(function->m_doc);\n\n#if PYTHON_VERSION >= 0x300\n    Py_XDECREF(function->m_kwdefaults);\n    Py_XDECREF(function->m_annotations);\n#endif\n\n    for (Py_ssize_t i = 0; i < function->m_closure_given; i++) {\n        assert(function->m_closure[i]);\n        Py_DECREF(function->m_closure[i]);\n\n        // Note: No need to set to NULL, each function creation makes\n        // a full copy, doing the init.\n    }\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_functions, function, MAX_FUNCTION_FREE_LIST_COUNT);\n\n#ifndef __NUITKA_NO_ASSERT__\n    struct Nuitka_ExceptionPreservationItem saved_exception_state2;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n\n    ASSERT_SAME_EXCEPTION_STATE(&saved_exception_state1, &saved_exception_state2);\n#endif\n}\n\nstatic PyMethodDef Nuitka_Function_methods[] = {{\"__reduce__\", (PyCFunction)Nuitka_Function_reduce, METH_NOARGS, NULL},\n                                                {\"clone\", (PyCFunction)Nuitka_Function_clone, METH_NOARGS, NULL},\n                                                {NULL}};\n\nstatic PyObject *Nuitka_Function_tp_call(struct Nuitka_FunctionObject *function, PyObject *tuple_args, PyObject *kw);\n\nPyTypeObject Nuitka_Function_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_function\", // tp_name\n    sizeof(struct Nuitka_FunctionObject),               // tp_basicsize\n    sizeof(struct Nuitka_CellObject *),                 // tp_itemsize\n    (destructor)Nuitka_Function_tp_dealloc,             // tp_dealloc\n#if PYTHON_VERSION < 0x380 || defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\n    0, // tp_print\n#else\n    offsetof(struct Nuitka_FunctionObject, m_vectorcall), // tp_vectorcall_offset\n#endif\n    0,                                    // tp_getattr\n    0,                                    // tp_setattr\n    0,                                    // tp_compare\n    (reprfunc)Nuitka_Function_tp_repr,    // tp_repr\n    0,                                    // tp_as_number\n    0,                                    // tp_as_sequence\n    0,                                    // tp_as_mapping\n    (hashfunc)Nuitka_Function_tp_hash,    // tp_hash\n    (ternaryfunc)Nuitka_Function_tp_call, // tp_call\n    0,                                    // tp_str\n    0,                                    // tp_getattro (PyObject_GenericGetAttr)\n    0,                                    // tp_setattro\n    0,                                    // tp_as_buffer\n    Py_TPFLAGS_DEFAULT |\n#if PYTHON_VERSION < 0x300\n        Py_TPFLAGS_HAVE_WEAKREFS |\n#endif\n#if PYTHON_VERSION >= 0x380\n        _Py_TPFLAGS_HAVE_VECTORCALL | Py_TPFLAGS_METHOD_DESCRIPTOR |\n#endif\n        Py_TPFLAGS_HAVE_GC,                             // tp_flags\n    0,                                                  // tp_doc\n    (traverseproc)Nuitka_Function_tp_traverse,          // tp_traverse\n    0,                                                  // tp_clear\n    0,                                                  // tp_richcompare\n    offsetof(struct Nuitka_FunctionObject, m_weakrefs), // tp_weaklistoffset\n    0,                                                  // tp_iter\n    0,                                                  // tp_iternext\n    Nuitka_Function_methods,                            // tp_methods\n    0,                                                  // tp_members\n    Nuitka_Function_getset,                             // tp_getset\n    0,                                                  // tp_base\n    0,                                                  // tp_dict\n    Nuitka_Function_descr_get,                          // tp_descr_get\n    0,                                                  // tp_descr_set\n    offsetof(struct Nuitka_FunctionObject, m_dict),     // tp_dictoffset\n    0,                                                  // tp_init\n    0,                                                  // tp_alloc\n    0,                                                  // tp_new\n    0,                                                  // tp_free\n    0,                                                  // tp_is_gc\n    0,                                                  // tp_bases\n    0,                                                  // tp_mro\n    0,                                                  // tp_cache\n    0,                                                  // tp_subclasses\n    0,                                                  // tp_weaklist\n    0,                                                  // tp_del\n    0                                                   // tp_version_tag\n#if PYTHON_VERSION >= 0x340\n    ,\n    0 // tp_finalizer\n#endif\n};\n\nvoid _initCompiledFunctionType(void) {\n    Nuitka_PyType_Ready(&Nuitka_Function_Type, &PyFunction_Type, true, false, false, false, false);\n\n    // Be a paranoid subtype of uncompiled function, we want nothing shared.\n    assert(Nuitka_Function_Type.tp_doc != PyFunction_Type.tp_doc);\n    assert(Nuitka_Function_Type.tp_traverse != PyFunction_Type.tp_traverse);\n    assert(Nuitka_Function_Type.tp_clear != PyFunction_Type.tp_clear || PyFunction_Type.tp_clear == NULL);\n    assert(Nuitka_Function_Type.tp_richcompare != PyFunction_Type.tp_richcompare ||\n           PyFunction_Type.tp_richcompare == NULL);\n    assert(Nuitka_Function_Type.tp_weaklistoffset != PyFunction_Type.tp_weaklistoffset);\n    assert(Nuitka_Function_Type.tp_iter != PyFunction_Type.tp_iter || PyFunction_Type.tp_iter == NULL);\n    assert(Nuitka_Function_Type.tp_iternext != PyFunction_Type.tp_iternext || PyFunction_Type.tp_iternext == NULL);\n    assert(Nuitka_Function_Type.tp_methods != PyFunction_Type.tp_methods);\n    assert(Nuitka_Function_Type.tp_members != PyFunction_Type.tp_members);\n    assert(Nuitka_Function_Type.tp_getset != PyFunction_Type.tp_getset);\n    assert(Nuitka_Function_Type.tp_dict != PyFunction_Type.tp_dict);\n    assert(Nuitka_Function_Type.tp_descr_get != PyFunction_Type.tp_descr_get);\n\n    assert(Nuitka_Function_Type.tp_descr_set != PyFunction_Type.tp_descr_set || PyFunction_Type.tp_descr_set == NULL);\n    assert(Nuitka_Function_Type.tp_dictoffset != PyFunction_Type.tp_dictoffset);\n    // TODO: These get changed and into the same thing, not sure what to compare against, project something\n    // assert(Nuitka_Function_Type.tp_init != PyFunction_Type.tp_init || PyFunction_Type.tp_init == NULL);\n    // assert(Nuitka_Function_Type.tp_alloc != PyFunction_Type.tp_alloc || PyFunction_Type.tp_alloc == NULL);\n    // assert(Nuitka_Function_Type.tp_new != PyFunction_Type.tp_new || PyFunction_Type.tp_new == NULL);\n    // assert(Nuitka_Function_Type.tp_free != PyFunction_Type.tp_free || PyFunction_Type.tp_free == NULL);\n    assert(Nuitka_Function_Type.tp_bases != PyFunction_Type.tp_bases);\n    assert(Nuitka_Function_Type.tp_mro != PyFunction_Type.tp_mro);\n    assert(Nuitka_Function_Type.tp_cache != PyFunction_Type.tp_cache || PyFunction_Type.tp_cache == NULL);\n    assert(Nuitka_Function_Type.tp_subclasses != PyFunction_Type.tp_subclasses || PyFunction_Type.tp_cache == NULL);\n    assert(Nuitka_Function_Type.tp_weaklist != PyFunction_Type.tp_weaklist);\n    assert(Nuitka_Function_Type.tp_del != PyFunction_Type.tp_del || PyFunction_Type.tp_del == NULL);\n#if PYTHON_VERSION >= 0x340\n    assert(Nuitka_Function_Type.tp_finalize != PyFunction_Type.tp_finalize || PyFunction_Type.tp_finalize == NULL);\n#endif\n\n    // Make sure we don't miss out on attributes we are not having or should not have.\n#ifndef __NUITKA_NO_ASSERT__\n    for (struct PyGetSetDef *own = &Nuitka_Function_getset[0]; own->name != NULL; own++) {\n        bool found = false;\n\n        for (struct PyGetSetDef *related = PyFunction_Type.tp_getset; related->name != NULL; related++) {\n            if (strcmp(related->name, own->name) == 0) {\n                found = true;\n            }\n        }\n\n        if (found == false) {\n            if (strcmp(own->name, \"__doc__\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n#if PYTHON_VERSION < 0x300\n            if (strcmp(own->name, \"func_doc\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n#endif\n\n            if (strcmp(own->name, \"__globals__\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n\n#if PYTHON_VERSION < 0x300\n            if (strcmp(own->name, \"func_globals\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\n            if (strcmp(own->name, \"__builtins__\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n#endif\n\n            if (strcmp(own->name, \"__module__\") == 0) {\n                // We do that one differently right now.\n                continue;\n            }\n\n            if (strcmp(own->name, \"__closure__\") == 0) {\n                // We have to do that differently, because we do not keep this around until\n                // needed, and we make it read-only\n                continue;\n            }\n\n#if PYTHON_VERSION < 0x300\n            if (strcmp(own->name, \"func_closure\") == 0) {\n                // We have to do that differently, because we do not keep this around until\n                // needed, and we make it read-only\n                continue;\n            }\n#endif\n\n            if (strcmp(own->name, \"__compiled__\") == 0 || strcmp(own->name, \"__compiled_constant__\") == 0) {\n                // We have to do that differently, because we do not keep this around until\n                // needed, and we make it read-only\n                continue;\n            }\n\n            PRINT_FORMAT(\"Not found in uncompiled type: %s\\n\", own->name);\n            NUITKA_CANNOT_GET_HERE(\"Type problem\");\n        }\n    }\n\n    for (struct PyGetSetDef *related = PyFunction_Type.tp_getset; related->name != NULL; related++) {\n        bool found = false;\n\n        for (struct PyGetSetDef *own = &Nuitka_Function_getset[0]; own->name != NULL; own++) {\n            if (strcmp(related->name, own->name) == 0) {\n                found = true;\n            }\n        }\n\n        if (found == false) {\n            PRINT_FORMAT(\"Not found in compiled type: %s\\n\", related->name);\n            NUITKA_CANNOT_GET_HERE(\"Type problem\");\n        }\n    }\n\n    for (struct PyMemberDef *related = PyFunction_Type.tp_members; related->name != NULL; related++) {\n        bool found = false;\n\n        for (struct PyGetSetDef *own = &Nuitka_Function_getset[0]; own->name != NULL; own++) {\n            if (strcmp(related->name, own->name) == 0) {\n                found = true;\n            }\n        }\n\n        if (found == false) {\n            PRINT_FORMAT(\"Not found in compiled type: %s\\n\", related->name);\n            NUITKA_CANNOT_GET_HERE(\"Type problem\");\n        }\n    }\n#endif\n}\n\n// Shared implementations for empty functions. When a function body is empty, but\n// still needs to exist, e.g. overloaded functions, this is saving the effort to\n// produce one.\nstatic PyObject *_Nuitka_FunctionEmptyCodeNoneImpl(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                   PyObject **python_pars) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    Py_ssize_t arg_count = function->m_args_overall_count;\n\n    for (Py_ssize_t i = 0; i < arg_count; i++) {\n        Py_DECREF(python_pars[i]);\n    }\n\n    PyObject *result = Py_None;\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyObject *_Nuitka_FunctionEmptyCodeTrueImpl(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                   PyObject **python_pars) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    Py_ssize_t arg_count = function->m_args_overall_count;\n\n    for (Py_ssize_t i = 0; i < arg_count; i++) {\n        Py_DECREF(python_pars[i]);\n    }\n\n    PyObject *result = Py_True;\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyObject *_Nuitka_FunctionEmptyCodeFalseImpl(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                    PyObject **python_pars) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    Py_ssize_t arg_count = function->m_args_overall_count;\n\n    for (Py_ssize_t i = 0; i < arg_count; i++) {\n        Py_DECREF(python_pars[i]);\n    }\n\n    PyObject *result = Py_False;\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyObject *_Nuitka_FunctionEmptyCodeGenericImpl(PyThreadState *tstate,\n                                                      struct Nuitka_FunctionObject const *function,\n                                                      PyObject **python_pars) {\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    Py_ssize_t arg_count = function->m_args_overall_count;\n\n    for (Py_ssize_t i = 0; i < arg_count; i++) {\n        Py_DECREF(python_pars[i]);\n    }\n\n    PyObject *result = function->m_constant_return_value;\n\n    Py_INCREF(result);\n    return result;\n}\n\nvoid Nuitka_Function_EnableConstReturnTrue(struct Nuitka_FunctionObject *function) {\n    function->m_constant_return_value = Py_True;\n    function->m_c_code = _Nuitka_FunctionEmptyCodeTrueImpl;\n}\n\nvoid Nuitka_Function_EnableConstReturnFalse(struct Nuitka_FunctionObject *function) {\n    function->m_constant_return_value = Py_False;\n    function->m_c_code = _Nuitka_FunctionEmptyCodeFalseImpl;\n}\n\nvoid Nuitka_Function_EnableConstReturnGeneric(struct Nuitka_FunctionObject *function, PyObject *value) {\n    function->m_constant_return_value = value;\n    function->m_c_code = _Nuitka_FunctionEmptyCodeGenericImpl;\n}\n\n#ifdef _NUITKA_PLUGIN_DILL_ENABLED\nint Nuitka_Function_GetFunctionCodeIndex(struct Nuitka_FunctionObject *function,\n                                         function_impl_code const *function_table) {\n\n    if (function->m_c_code == _Nuitka_FunctionEmptyCodeTrueImpl) {\n        return -2;\n    }\n\n    if (function->m_c_code == _Nuitka_FunctionEmptyCodeFalseImpl) {\n        return -3;\n    }\n\n    if (function->m_c_code == _Nuitka_FunctionEmptyCodeNoneImpl) {\n        return -4;\n    }\n\n    if (function->m_c_code == _Nuitka_FunctionEmptyCodeGenericImpl) {\n        return -5;\n    }\n\n    function_impl_code const *current = function_table;\n    int offset = 0;\n\n    while (*current != NULL) {\n        if (*current == function->m_c_code) {\n            break;\n        }\n\n        current += 1;\n        offset += 1;\n    }\n\n    if (*current == NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n#if 0\n        PRINT_STRING(\"Looking for:\");\n        PRINT_ITEM((PyObject *)function);\n        PRINT_NEW_LINE();\n#endif\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"Cannot find compiled function in module.\");\n        return -1;\n    }\n\n    return offset;\n}\n\nstruct Nuitka_FunctionObject *\nNuitka_Function_CreateFunctionViaCodeIndex(PyObject *module, PyObject *function_qualname, PyObject *function_index,\n                                           PyObject *code_object_desc, PyObject *constant_return_value,\n                                           PyObject *defaults, PyObject *kw_defaults, PyObject *doc, PyObject *closure,\n                                           function_impl_code const *function_table, int function_table_size) {\n    int offset = PyLong_AsLong(function_index);\n\n    if (offset > function_table_size || offset < -5 || offset == -1) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"Wrong offset for compiled function.\");\n        return NULL;\n    }\n\n    PyObject *filename = PyTuple_GET_ITEM(code_object_desc, 0);\n    PyObject *function_name = PyTuple_GET_ITEM(code_object_desc, 1);\n    PyObject *line = PyTuple_GET_ITEM(code_object_desc, 2);\n    int line_int = PyLong_AsLong(line);\n    assert(line_int != -1);\n\n    PyObject *arg_names = PyTuple_GET_ITEM(code_object_desc, 3);\n    PyObject *arg_count = PyTuple_GET_ITEM(code_object_desc, 4);\n    int arg_count_int = PyLong_AsLong(arg_count);\n    assert(arg_count_int != -1);\n\n    PyObject *flags = PyTuple_GET_ITEM(code_object_desc, 5);\n    int flags_int = PyLong_AsLong(flags);\n    assert(flags_int != -1);\n\n    PyCodeObject *code_object =\n        MAKE_CODE_OBJECT(filename, line_int, flags_int, function_name, function_qualname, arg_names,\n                         NULL, // freevars\n                         arg_count_int,\n                         0, // TODO: Missing kw_only_count\n                         0  // TODO: Missing pos_only_count\n        );\n\n    Py_ssize_t closure_size;\n\n    if (closure != Py_None) {\n        closure_size = PyTuple_GET_SIZE(closure);\n    } else {\n        closure_size = 0;\n    }\n\n    NUITKA_DYNAMIC_ARRAY_DECL(closure_cells, struct Nuitka_CellObject *, closure_size);\n\n    for (Py_ssize_t i = 0; i < closure_size; i++) {\n        closure_cells[i] = Nuitka_Cell_New0(PyTuple_GET_ITEM(closure, i));\n    }\n\n    struct Nuitka_FunctionObject *result =\n        Nuitka_Function_New(offset >= 0 ? function_table[offset] : NULL, code_object->co_name,\n#if PYTHON_VERSION >= 0x300\n                            NULL, // TODO: Not transferring qualname yet\n#endif\n                            code_object, defaults,\n#if PYTHON_VERSION >= 0x300\n                            kw_defaults,\n                            NULL, // TODO: Not transferring annotations\n#endif\n                            module, doc, closure_cells, closure_size);\n\n    CHECK_OBJECT(result);\n\n    if (offset == -2) {\n        Nuitka_Function_EnableConstReturnTrue(result);\n    }\n    if (offset == -3) {\n        Nuitka_Function_EnableConstReturnFalse(result);\n    }\n    if (offset == -4) {\n        result->m_c_code = _Nuitka_FunctionEmptyCodeNoneImpl;\n    }\n    if (offset == -5) {\n        CHECK_OBJECT(constant_return_value);\n\n        Nuitka_Function_EnableConstReturnGeneric(result, constant_return_value);\n\n        Py_INCREF(constant_return_value);\n    }\n\n    assert(result->m_c_code != NULL);\n\n    return result;\n}\n\n#endif\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\nstatic PyObject *Nuitka_Function_tp_vectorcall(struct Nuitka_FunctionObject *function, PyObject *const *stack,\n                                               size_t nargsf, PyObject *kw_names);\n#endif\n\n// Make a function with closure.\n#if PYTHON_VERSION < 0x300\nstruct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyCodeObject *code_object,\n                                                  PyObject *defaults, PyObject *module, PyObject *doc,\n                                                  struct Nuitka_CellObject **closure, Py_ssize_t closure_given)\n#else\nstruct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyObject *qualname,\n                                                  PyCodeObject *code_object, PyObject *defaults, PyObject *kw_defaults,\n                                                  PyObject *annotations, PyObject *module, PyObject *doc,\n                                                  struct Nuitka_CellObject **closure, Py_ssize_t closure_given)\n#endif\n{\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Function_Type += 1;\n    count_allocated_Nuitka_Function_Type += 1;\n#endif\n\n    struct Nuitka_FunctionObject *result;\n\n    // Macro to assign result memory from GC or free list.\n    allocateFromFreeList(free_list_functions, struct Nuitka_FunctionObject, Nuitka_Function_Type, closure_given);\n\n    memcpy(&result->m_closure[0], closure, closure_given * sizeof(struct Nuitka_CellObject *));\n    result->m_closure_given = closure_given;\n\n    if (c_code != NULL) {\n        result->m_c_code = c_code;\n        result->m_constant_return_value = NULL;\n    } else {\n        result->m_c_code = _Nuitka_FunctionEmptyCodeNoneImpl;\n        result->m_constant_return_value = Py_None;\n    }\n\n    Py_INCREF(name);\n    result->m_name = name;\n\n#if PYTHON_VERSION >= 0x300\n    // The \"qualname\" defaults to NULL for most compact C code.\n    if (qualname == NULL) {\n        qualname = name;\n    }\n    CHECK_OBJECT(qualname);\n\n    Py_INCREF(qualname);\n    result->m_qualname = qualname;\n#endif\n\n    if (defaults == NULL) {\n        Py_INCREF(Py_None);\n        defaults = Py_None;\n    }\n    CHECK_OBJECT(defaults);\n    assert(defaults == Py_None || (PyTuple_Check(defaults) && PyTuple_GET_SIZE(defaults) > 0));\n    result->m_defaults = defaults;\n\n    _onUpdatedCompiledFunctionDefaultsValue(result);\n\n#if PYTHON_VERSION >= 0x300\n    assert(kw_defaults == NULL || (PyDict_Check(kw_defaults) && DICT_SIZE(kw_defaults) > 0));\n    result->m_kwdefaults = kw_defaults;\n\n    assert(annotations == NULL || (PyDict_Check(annotations) && DICT_SIZE(annotations) > 0));\n    result->m_annotations = annotations;\n#endif\n\n    result->m_code_object = code_object;\n    result->m_args_positional_count = code_object->co_argcount;\n    result->m_args_keywords_count = result->m_args_positional_count;\n#if PYTHON_VERSION >= 0x300\n    result->m_args_keywords_count += code_object->co_kwonlyargcount;\n#endif\n#if PYTHON_VERSION >= 0x380\n    result->m_args_pos_only_count = code_object->co_posonlyargcount;\n#endif\n\n    result->m_args_overall_count = result->m_args_keywords_count + ((code_object->co_flags & CO_VARARGS) ? 1 : 0) +\n                                   ((code_object->co_flags & CO_VARKEYWORDS) ? 1 : 0);\n\n    result->m_args_simple = (code_object->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) == 0;\n#if PYTHON_VERSION >= 0x300\n    if (code_object->co_kwonlyargcount > 0) {\n        result->m_args_simple = false;\n    }\n#endif\n\n    if ((code_object->co_flags & CO_VARARGS) != 0) {\n        result->m_args_star_list_index = result->m_args_keywords_count;\n    } else {\n        result->m_args_star_list_index = -1;\n    }\n\n    if ((code_object->co_flags & CO_VARKEYWORDS) != 0) {\n        result->m_args_star_dict_index = result->m_args_keywords_count;\n\n        if (code_object->co_flags & CO_VARARGS) {\n            result->m_args_star_dict_index += 1;\n        }\n    } else {\n        result->m_args_star_dict_index = -1;\n    }\n\n    result->m_varnames = Nuitka_GetCodeVarNames(code_object);\n\n    result->m_module = module;\n\n    Py_XINCREF(doc);\n    result->m_doc = doc;\n\n    result->m_dict = NULL;\n    result->m_weakrefs = NULL;\n\n    static long Nuitka_Function_counter = 0;\n    result->m_counter = Nuitka_Function_counter++;\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\n    result->m_vectorcall = (vectorcallfunc)Nuitka_Function_tp_vectorcall;\n#endif\n\n    Nuitka_GC_Track(result);\n\n    assert(Py_REFCNT(result) == 1);\n\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic void formatErrorNoArgumentAllowedKwSplit(struct Nuitka_FunctionObject const *function, PyObject *kw_name,\n                                                Py_ssize_t given) {\n#if PYTHON_VERSION < 0x3a0\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                 Nuitka_String_AsString(kw_name));\n}\n#endif\n\nstatic void formatErrorNoArgumentAllowed(struct Nuitka_FunctionObject const *function,\n#if PYTHON_VERSION >= 0x300\n                                         PyObject *kw,\n#endif\n                                         Py_ssize_t given) {\n#if PYTHON_VERSION < 0x3a0\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"%s() takes no arguments (%zd given)\", function_name, given);\n#else\n    if (kw == NULL) {\n        PyErr_Format(PyExc_TypeError, \"%s() takes 0 positional arguments but %zd was given\", function_name, given);\n    } else {\n        PyObject *tmp_iter = PyObject_GetIter(kw);\n        PyObject *tmp_arg_name = PyIter_Next(tmp_iter);\n        Py_DECREF(tmp_iter);\n\n        PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                     Nuitka_String_AsString(tmp_arg_name));\n\n        Py_DECREF(tmp_arg_name);\n    }\n#endif\n}\n\nstatic void formatErrorMultipleValuesGiven(struct Nuitka_FunctionObject const *function, Py_ssize_t index) {\n#if PYTHON_VERSION < 0x390\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n    PyErr_Format(PyExc_TypeError,\n#if PYTHON_VERSION < 0x300\n                 \"%s() got multiple values for keyword argument '%s'\",\n#else\n                 \"%s() got multiple values for argument '%s'\",\n#endif\n                 function_name, Nuitka_String_AsString(function->m_varnames[index]));\n}\n\n#if PYTHON_VERSION < 0x300\nstatic void formatErrorTooFewArguments(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n#if PYTHON_VERSION < 0x270\n                                       Py_ssize_t kw_size,\n#endif\n                                       Py_ssize_t given) {\n    Py_ssize_t required_parameter_count = function->m_args_positional_count - function->m_defaults_given;\n\n#if PYTHON_VERSION < 0x390\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n    char const *violation =\n        (function->m_defaults != Py_None || function->m_args_star_list_index != -1) ? \"at least\" : \"exactly\";\n    char const *plural = required_parameter_count == 1 ? \"\" : \"s\";\n\n#if PYTHON_VERSION < 0x270\n    if (kw_size > 0) {\n        PyErr_Format(PyExc_TypeError, \"%s() takes %s %zd non-keyword argument%s (%zd given)\", function_name, violation,\n                     required_parameter_count, plural, given - function->m_defaults_given);\n    } else {\n        PyErr_Format(PyExc_TypeError, \"%s() takes %s %zd argument%s (%zd given)\", function_name, violation,\n                     required_parameter_count, plural, given);\n    }\n#else\n    PyErr_Format(PyExc_TypeError, \"%s() takes %s %zd argument%s (%zd given)\", function_name, violation,\n                 required_parameter_count, plural, given);\n#endif\n}\n#else\nstatic void formatErrorTooFewArguments(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                       PyObject **values) {\n#if PYTHON_VERSION < 0x3a0\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n    Py_ssize_t max_missing = 0;\n\n    for (Py_ssize_t i = function->m_args_positional_count - 1 - function->m_defaults_given; i >= 0; --i) {\n        if (values[i] == NULL) {\n            max_missing += 1;\n        }\n    }\n\n    PyObject *list_str = PyUnicode_FromString(\"\");\n\n    PyObject *comma_str = PyUnicode_FromString(\", \");\n    PyObject *and_str = PyUnicode_FromString(max_missing == 2 ? \" and \" : \", and \");\n\n    Py_ssize_t missing = 0;\n    for (Py_ssize_t i = function->m_args_positional_count - 1 - function->m_defaults_given; i >= 0; --i) {\n        if (values[i] == NULL) {\n            PyObject *current_str = function->m_varnames[i];\n\n            PyObject *current = PyObject_Repr(current_str);\n\n            if (missing == 0) {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, list_str, current);\n\n                Py_DECREF(old);\n            } else if (missing == 1) {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, and_str, list_str);\n\n                Py_DECREF(old);\n                old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, current, list_str);\n\n                Py_DECREF(old);\n            } else {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, comma_str, list_str);\n\n                Py_DECREF(old);\n                old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, current, list_str);\n\n                Py_DECREF(old);\n            }\n\n            Py_DECREF(current);\n\n            missing += 1;\n        }\n    }\n\n    Py_DECREF(comma_str);\n    Py_DECREF(and_str);\n\n    PyErr_Format(PyExc_TypeError, \"%s() missing %zd required positional argument%s: %s\", function_name, max_missing,\n                 max_missing > 1 ? \"s\" : \"\", Nuitka_String_AsString(list_str));\n\n    Py_DECREF(list_str);\n}\n#endif\n\nstatic void formatErrorTooManyArguments(struct Nuitka_FunctionObject const *function, Py_ssize_t given\n#if PYTHON_VERSION < 0x270\n                                        ,\n                                        Py_ssize_t kw_size\n\n#endif\n#if PYTHON_VERSION >= 0x300\n                                        ,\n                                        Py_ssize_t kw_only\n#endif\n) {\n    Py_ssize_t top_level_parameter_count = function->m_args_positional_count;\n\n#if PYTHON_VERSION < 0x3a0\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n#if PYTHON_VERSION < 0x300\n    char const *violation = function->m_defaults != Py_None ? \"at most\" : \"exactly\";\n#endif\n    char const *plural = top_level_parameter_count == 1 ? \"\" : \"s\";\n\n#if PYTHON_VERSION < 0x270\n    PyErr_Format(PyExc_TypeError, \"%s() takes %s %zd%s argument%s (%zd given)\", function_name, violation,\n                 top_level_parameter_count, kw_size > 0 ? \" non-keyword\" : \"\", plural, given);\n#elif PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"%s() takes %s %zd argument%s (%zd given)\", function_name, violation,\n                 top_level_parameter_count, plural, given);\n#else\n    char keyword_only_part[100];\n\n    if (kw_only > 0) {\n        snprintf(keyword_only_part, sizeof(keyword_only_part) - 1,\n                 \" positional argument%s (and %\" PY_FORMAT_SIZE_T \"d keyword-only argument%s)\", given != 1 ? \"s\" : \"\",\n                 kw_only, kw_only != 1 ? \"s\" : \"\");\n    } else {\n        keyword_only_part[0] = 0;\n    }\n\n    if (function->m_defaults_given == 0) {\n        PyErr_Format(PyExc_TypeError, \"%s() takes %zd positional argument%s but %zd%s were given\", function_name,\n                     top_level_parameter_count, plural, given, keyword_only_part);\n    } else {\n        PyErr_Format(PyExc_TypeError, \"%s() takes from %zd to %zd positional argument%s but %zd%s were given\",\n                     function_name, top_level_parameter_count - function->m_defaults_given, top_level_parameter_count,\n                     plural, given, keyword_only_part);\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic void formatErrorTooFewKwOnlyArguments(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                             PyObject **kw_vars) {\n#if PYTHON_VERSION < 0x3a0\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n    char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n    Py_ssize_t co_kwonlyargcount = function->m_code_object->co_kwonlyargcount;\n\n    Py_ssize_t max_missing = 0;\n\n    for (Py_ssize_t i = co_kwonlyargcount - 1; i >= 0; --i) {\n        if (kw_vars[i] == NULL) {\n            max_missing += 1;\n        }\n    }\n\n    PyObject *list_str = PyUnicode_FromString(\"\");\n\n    PyObject *comma_str = PyUnicode_FromString(\", \");\n    PyObject *and_str = PyUnicode_FromString(max_missing == 2 ? \" and \" : \", and \");\n\n    Py_ssize_t missing = 0;\n    for (Py_ssize_t i = co_kwonlyargcount - 1; i >= 0; --i) {\n        if (kw_vars[i] == NULL) {\n            PyObject *current_str = function->m_varnames[function->m_args_positional_count + i];\n\n            PyObject *current = PyObject_Repr(current_str);\n\n            if (missing == 0) {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, list_str, current);\n\n                Py_DECREF(old);\n            } else if (missing == 1) {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, and_str, list_str);\n\n                Py_DECREF(old);\n                old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, current, list_str);\n\n                Py_DECREF(old);\n            } else {\n                PyObject *old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, comma_str, list_str);\n\n                Py_DECREF(old);\n                old = list_str;\n\n                list_str = UNICODE_CONCAT(tstate, current, list_str);\n\n                Py_DECREF(old);\n            }\n\n            Py_DECREF(current);\n\n            missing += 1;\n        }\n    }\n\n    Py_DECREF(comma_str);\n    Py_DECREF(and_str);\n\n    PyErr_Format(PyExc_TypeError, \"%s() missing %zd required keyword-only argument%s: %s\", function_name, max_missing,\n                 max_missing > 1 ? \"s\" : \"\", Nuitka_String_AsString(list_str));\n\n    Py_DECREF(list_str);\n}\n#endif\n\nstatic void formatErrorKeywordsMustBeString(PyThreadState *tstate, struct Nuitka_FunctionObject const *function) {\n#if PYTHON_VERSION < 0x390\n    char const *function_name = Nuitka_String_AsString(function->m_name);\n    SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() keywords must be strings\", function_name);\n#else\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"keywords must be strings\");\n#endif\n}\n\nstatic inline bool checkKeywordType(PyObject *arg_name) {\n#if PYTHON_VERSION < 0x300\n    return (PyString_Check(arg_name) || PyUnicode_Check(arg_name));\n#else\n    return PyUnicode_Check(arg_name) != 0;\n#endif\n}\n\nstatic inline bool RICH_COMPARE_EQ_CBOOL_ARG_NAMES(PyObject *operand1, PyObject *operand2) {\n    // Compare with argument name. We know our type, but from the outside, it\n    // can be a derived type, or in case of Python2, a unicode value to compare\n    // with a string. These half sided comparisons will make the switch to the\n    // special one immediately if possible though.\n\n#if PYTHON_VERSION < 0x300\n    nuitka_bool result = RICH_COMPARE_EQ_NBOOL_STR_OBJECT(operand1, operand2);\n#else\n    nuitka_bool result = RICH_COMPARE_EQ_NBOOL_UNICODE_OBJECT(operand1, operand2);\n#endif\n\n    // Should be close to impossible, we will have to ignore it though.\n    if (unlikely(result == NUITKA_BOOL_EXCEPTION)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        CLEAR_ERROR_OCCURRED(tstate);\n        return false;\n    }\n\n    return result == NUITKA_BOOL_TRUE;\n}\n\n#if PYTHON_VERSION < 0x300\nstatic Py_ssize_t handleKeywordArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                    PyObject **python_pars, PyObject *kw)\n#else\nstatic Py_ssize_t handleKeywordArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                    PyObject **python_pars, Py_ssize_t *kw_only_found, PyObject *kw)\n#endif\n{\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n#endif\n\n    assert(function->m_args_star_dict_index == -1);\n\n    Py_ssize_t kw_found = 0;\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(kw, &pos, &key, &value)) {\n        if (unlikely(!checkKeywordType(key))) {\n            formatErrorKeywordsMustBeString(tstate, function);\n            return -1;\n        }\n\n        NUITKA_MAY_BE_UNUSED bool found = false;\n\n        Py_INCREF(key);\n        Py_INCREF(value);\n\n#if PYTHON_VERSION < 0x380\n        Py_ssize_t kw_arg_start = 0;\n#else\n        Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n        for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n            if (function->m_varnames[i] == key) {\n                assert(python_pars[i] == NULL);\n                python_pars[i] = value;\n\n#if PYTHON_VERSION >= 0x300\n                if (i >= keyword_after_index) {\n                    *kw_only_found += 1;\n                }\n#endif\n\n                found = true;\n                break;\n            }\n        }\n\n        if (found == false) {\n            PyObject **var_names = function->m_varnames;\n\n            for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    assert(python_pars[i] == NULL);\n                    python_pars[i] = value;\n\n#if PYTHON_VERSION >= 0x300\n                    if (i >= keyword_after_index) {\n                        *kw_only_found += 1;\n                    }\n#endif\n\n                    found = true;\n                    break;\n                }\n            }\n        }\n\n        if (unlikely(found == false)) {\n            bool pos_only_error = false;\n\n            for (Py_ssize_t i = 0; i < kw_arg_start; i++) {\n                PyObject **var_names = function->m_varnames;\n\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    pos_only_error = true;\n                    break;\n                }\n            }\n\n#if PYTHON_VERSION < 0x3a0\n            char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n            char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n            if (pos_only_error == true) {\n                PyErr_Format(PyExc_TypeError,\n                             \"%s() got some positional-only arguments passed as keyword arguments: '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n\n            } else {\n                PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n            }\n\n            Py_DECREF(key);\n            Py_DECREF(value);\n\n            return -1;\n        }\n\n        Py_DECREF(key);\n\n        kw_found += 1;\n    }\n\n    return kw_found;\n}\n\n#if PYTHON_VERSION < 0x300\nstatic Py_ssize_t handleKeywordArgsSplit(struct Nuitka_FunctionObject const *function, PyObject **python_pars,\n                                         PyObject *const *kw_values, PyObject *kw_names)\n#else\nstatic Py_ssize_t handleKeywordArgsSplit(struct Nuitka_FunctionObject const *function, PyObject **python_pars,\n                                         Py_ssize_t *kw_only_found, PyObject *const *kw_values, PyObject *kw_names)\n#endif\n{\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n#endif\n\n    assert(function->m_args_star_dict_index == -1);\n\n    Py_ssize_t kw_found = 0;\n\n    Py_ssize_t kw_names_size = PyTuple_GET_SIZE(kw_names);\n\n    for (Py_ssize_t kw_index = 0; kw_index < kw_names_size; kw_index++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, kw_index);\n        PyObject *value = kw_values[kw_index];\n\n        assert(checkKeywordType(key));\n\n        NUITKA_MAY_BE_UNUSED bool found = false;\n\n#if PYTHON_VERSION < 0x380\n        Py_ssize_t kw_arg_start = 0;\n#else\n        Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n        Py_INCREF(value);\n\n        for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n            if (function->m_varnames[i] == key) {\n                assert(python_pars[i] == NULL);\n                python_pars[i] = value;\n\n#if PYTHON_VERSION >= 0x300\n                if (i >= keyword_after_index) {\n                    *kw_only_found += 1;\n                }\n#endif\n\n                found = true;\n                break;\n            }\n        }\n\n        if (found == false) {\n            PyObject **var_names = function->m_varnames;\n\n            for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n                // TODO: Could do better here, STR/UNICODE key knowledge being there.\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    assert(python_pars[i] == NULL);\n                    python_pars[i] = value;\n\n#if PYTHON_VERSION >= 0x300\n                    if (i >= keyword_after_index) {\n                        *kw_only_found += 1;\n                    }\n#endif\n\n                    found = true;\n                    break;\n                }\n            }\n        }\n\n        if (unlikely(found == false)) {\n            bool pos_only_error = false;\n\n            for (Py_ssize_t i = 0; i < kw_arg_start; i++) {\n                PyObject **var_names = function->m_varnames;\n\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    pos_only_error = true;\n                    break;\n                }\n            }\n\n#if PYTHON_VERSION < 0x3a0\n            char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n            char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n            if (pos_only_error == true) {\n                PyErr_Format(PyExc_TypeError,\n                             \"%s() got some positional-only arguments passed as keyword arguments: '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n\n            } else {\n                PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n            }\n\n            Py_DECREF(value);\n\n            return -1;\n        }\n\n        kw_found += 1;\n    }\n\n    return kw_found;\n}\n\nstatic PyObject *COPY_DICT_KW(PyObject *dict_value);\n\nstatic bool MAKE_STAR_DICT_DICTIONARY_COPY(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject **python_pars, PyObject *kw) {\n    Py_ssize_t star_dict_index = function->m_args_star_dict_index;\n    assert(star_dict_index != -1);\n\n    if (kw == NULL || ((PyDictObject *)kw)->ma_used == 0) {\n        python_pars[star_dict_index] = MAKE_DICT_EMPTY();\n    } else {\n        python_pars[star_dict_index] = COPY_DICT_KW(kw);\n\n        if (unlikely(python_pars[star_dict_index] == NULL)) {\n            formatErrorKeywordsMustBeString(tstate, function);\n            return false;\n        }\n    }\n\n    return true;\n}\n\n#if PYTHON_VERSION < 0x300\nstatic Py_ssize_t handleKeywordArgsWithStarDict(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                PyObject **python_pars, PyObject *kw)\n#else\nstatic Py_ssize_t handleKeywordArgsWithStarDict(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                PyObject **python_pars, Py_ssize_t *kw_only_found, PyObject *kw)\n#endif\n{\n    assert(function->m_args_star_dict_index != -1);\n\n    if (unlikely(MAKE_STAR_DICT_DICTIONARY_COPY(tstate, function, python_pars, kw) == false)) {\n        return -1;\n    }\n\n    Py_ssize_t kw_found = 0;\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n#endif\n\n    Py_ssize_t star_dict_index = function->m_args_star_dict_index;\n\n    PyObject **var_names = function->m_varnames;\n\n#if PYTHON_VERSION < 0x380\n    Py_ssize_t kw_arg_start = 0;\n#else\n    Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n    for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n        PyObject *arg_name = var_names[i];\n\n        PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);\n\n        if (kw_arg_value != NULL) {\n            assert(python_pars[i] == NULL);\n\n            python_pars[i] = kw_arg_value;\n\n            DICT_REMOVE_ITEM(python_pars[star_dict_index], arg_name);\n\n            kw_found += 1;\n\n#if PYTHON_VERSION >= 0x300\n            if (i >= keyword_after_index) {\n                *kw_only_found += 1;\n            }\n#endif\n        }\n    }\n\n    return kw_found;\n}\n\n#if PYTHON_VERSION < 0x300\nstatic Py_ssize_t\nhandleKeywordArgsSplitWithStarDict(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                   PyObject **python_pars, PyObject *const *kw_values, PyObject *kw_names)\n#else\nstatic Py_ssize_t handleKeywordArgsSplitWithStarDict(PyThreadState *tstate,\n                                                     struct Nuitka_FunctionObject const *function,\n                                                     PyObject **python_pars, Py_ssize_t *kw_only_found,\n                                                     PyObject *const *kw_values, PyObject *kw_names)\n#endif\n{\n\n    Py_ssize_t star_dict_index = function->m_args_star_dict_index;\n    assert(star_dict_index != -1);\n\n    Py_ssize_t kw_names_size = PyTuple_GET_SIZE(kw_names);\n\n    python_pars[star_dict_index] = _PyDict_NewPresized(kw_names_size);\n\n    for (Py_ssize_t i = 0; i < kw_names_size; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n        PyObject *value = kw_values[i];\n\n        DICT_SET_ITEM(python_pars[star_dict_index], key, value);\n    }\n\n    Py_ssize_t kw_found = 0;\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n#endif\n\n    PyObject **var_names = function->m_varnames;\n\n#if PYTHON_VERSION < 0x380\n    Py_ssize_t kw_arg_start = 0;\n#else\n    Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n    for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n        PyObject *arg_name = var_names[i];\n\n        PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);\n\n        if (kw_arg_value != NULL) {\n            assert(python_pars[i] == NULL);\n\n            python_pars[i] = kw_arg_value;\n\n            DICT_REMOVE_ITEM(python_pars[star_dict_index], arg_name);\n\n            kw_found += 1;\n\n#if PYTHON_VERSION >= 0x300\n            if (i >= keyword_after_index) {\n                *kw_only_found += 1;\n            }\n#endif\n        }\n    }\n\n    return kw_found;\n}\n\nstatic void makeStarListTupleCopy(struct Nuitka_FunctionObject const *function, PyObject **python_pars,\n                                  PyObject *const *args, Py_ssize_t args_size) {\n    assert(function->m_args_star_list_index != -1);\n    Py_ssize_t list_star_index = function->m_args_star_list_index;\n\n    // Copy left-over argument values to the star list parameter given.\n    if (args_size > function->m_args_positional_count) {\n        python_pars[list_star_index] =\n            MAKE_TUPLE(&args[function->m_args_positional_count], args_size - function->m_args_positional_count);\n    } else {\n        python_pars[list_star_index] = const_tuple_empty;\n        Py_INCREF(const_tuple_empty);\n    }\n}\n\nstatic void makeStarListTupleCopyMethod(struct Nuitka_FunctionObject const *function, PyObject **python_pars,\n                                        PyObject *const *args, Py_ssize_t args_size) {\n    assert(function->m_args_star_list_index != -1);\n    Py_ssize_t list_star_index = function->m_args_star_list_index;\n\n    // Copy left-over argument values to the star list parameter given.\n    if (args_size + 1 > function->m_args_positional_count) {\n        python_pars[list_star_index] =\n            MAKE_TUPLE(&args[function->m_args_positional_count - 1], args_size + 1 - function->m_args_positional_count);\n    } else {\n        python_pars[list_star_index] = const_tuple_empty;\n        Py_INCREF(const_tuple_empty);\n    }\n}\n\nstatic bool _handleArgumentsPlainOnly(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                      PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size) {\n    Py_ssize_t arg_count = function->m_args_positional_count;\n\n    // Check if too many arguments were given in case of non list star arg.\n    // For Python3.3 it's done only later, when more knowledge has\n    // been gained. TODO: Could be done this way for improved mode\n    // on all versions.\n#if PYTHON_VERSION < 0x300\n    if (function->m_args_star_list_index == -1) {\n        if (unlikely(args_size > arg_count)) {\n#if PYTHON_VERSION < 0x270\n            formatErrorTooManyArguments(function, args_size, 0);\n#else\n            formatErrorTooManyArguments(function, args_size);\n#endif\n            return false;\n        }\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    bool parameter_error = false;\n#endif\n\n    Py_ssize_t defaults_given = function->m_defaults_given;\n\n    if (args_size + defaults_given < arg_count) {\n#if PYTHON_VERSION < 0x270\n        formatErrorTooFewArguments(tstate, function, 0, args_size);\n        return false;\n#elif PYTHON_VERSION < 0x300\n        formatErrorTooFewArguments(tstate, function, args_size);\n        return false;\n#else\n        parameter_error = true;\n#endif\n    }\n\n    for (Py_ssize_t i = 0; i < args_size; i++) {\n        if (i >= arg_count)\n            break;\n\n        assert(python_pars[i] == NULL);\n\n        python_pars[i] = args[i];\n        Py_INCREF(python_pars[i]);\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (parameter_error == false) {\n#endif\n        PyObject *source = function->m_defaults;\n\n        for (Py_ssize_t i = args_size; i < arg_count; i++) {\n            assert(python_pars[i] == NULL);\n            assert(i + defaults_given >= arg_count);\n\n            python_pars[i] = PyTuple_GET_ITEM(source, defaults_given + i - arg_count);\n            Py_INCREF(python_pars[i]);\n        }\n#if PYTHON_VERSION >= 0x300\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    if (unlikely(parameter_error)) {\n        formatErrorTooFewArguments(tstate, function, python_pars);\n        return false;\n    }\n\n    if (function->m_args_star_list_index == -1) {\n        // Check if too many arguments were given in case of non list star arg\n        if (unlikely(args_size > arg_count)) {\n            formatErrorTooManyArguments(function, args_size, 0);\n            return false;\n        }\n    }\n#endif\n\n    if (function->m_args_star_list_index != -1) {\n        makeStarListTupleCopy(function, python_pars, args, args_size);\n    }\n\n    return true;\n}\n\nstatic bool handleMethodArgumentsPlainOnly(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject **python_pars, PyObject *object, PyObject *const *args,\n                                           Py_ssize_t args_size) {\n    Py_ssize_t arg_count = function->m_args_positional_count;\n\n    // There may be no self, otherwise we can directly assign it.\n    if (arg_count >= 1) {\n        python_pars[0] = object;\n        Py_INCREF(object);\n    } else {\n        // Without self, there can only be star list to get the object as its\n        // first element. Or we complain about illegal arguments.\n        if (function->m_args_star_list_index == 0) {\n            python_pars[0] = MAKE_TUPLE_EMPTY(args_size + 1);\n            PyTuple_SET_ITEM0(python_pars[0], 0, object);\n\n            for (Py_ssize_t i = 0; i < args_size; i++) {\n                PyTuple_SET_ITEM0(python_pars[0], i + 1, args[i]);\n            }\n\n            return true;\n        }\n    }\n\n    // Check if too many arguments were given in case of non list star arg.\n    // For Python3.3 it's done only later, when more knowledge has\n    // been gained. TODO: Could be done this way for improved mode\n    // on all versions.\n#if PYTHON_VERSION < 0x300\n    if (function->m_args_star_list_index == -1) {\n        if (unlikely(args_size + 1 > arg_count)) {\n#if PYTHON_VERSION < 0x270\n            formatErrorTooManyArguments(function, args_size + 1, 0);\n#else\n            formatErrorTooManyArguments(function, args_size + 1);\n#endif\n            return false;\n        }\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    bool parameter_error = false;\n#endif\n    Py_ssize_t defaults_given = function->m_defaults_given;\n\n    if (args_size + 1 + defaults_given < arg_count) {\n#if PYTHON_VERSION < 0x270\n        formatErrorTooFewArguments(tstate, function, 0, args_size + 1);\n        return false;\n#elif PYTHON_VERSION < 0x300\n        formatErrorTooFewArguments(tstate, function, args_size + 1);\n        return false;\n#else\n        parameter_error = true;\n#endif\n    }\n\n    for (Py_ssize_t i = 0; i < args_size; i++) {\n        if (i + 1 >= arg_count)\n            break;\n\n        assert(python_pars[i + 1] == NULL);\n\n        python_pars[i + 1] = args[i];\n        Py_INCREF(python_pars[i + 1]);\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (parameter_error == false) {\n#endif\n        for (Py_ssize_t i = args_size + 1; i < arg_count; i++) {\n            assert(python_pars[i] == NULL);\n            assert(i + defaults_given >= arg_count);\n\n            python_pars[i] = PyTuple_GET_ITEM(function->m_defaults, defaults_given + i - arg_count);\n            Py_INCREF(python_pars[i]);\n        }\n#if PYTHON_VERSION >= 0x300\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    if (unlikely(parameter_error)) {\n        formatErrorTooFewArguments(tstate, function, python_pars);\n        return false;\n    }\n\n    if (function->m_args_star_list_index == -1) {\n        // Check if too many arguments were given in case of non list star arg\n        if (unlikely(args_size + 1 > arg_count)) {\n            formatErrorTooManyArguments(function, args_size + 1, 0);\n            return false;\n        }\n    }\n#endif\n\n    if (function->m_args_star_list_index != -1) {\n        makeStarListTupleCopyMethod(function, python_pars, args, args_size);\n    }\n\n    return true;\n}\n\n#if PYTHON_VERSION < 0x270\nstatic bool _handleArgumentsPlain(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                  PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size,\n                                  Py_ssize_t kw_found, Py_ssize_t kw_size)\n#elif PYTHON_VERSION < 0x300\nstatic bool _handleArgumentsPlain(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                  PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size,\n                                  Py_ssize_t kw_found)\n#else\nstatic bool _handleArgumentsPlain(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                  PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size,\n                                  Py_ssize_t kw_found, Py_ssize_t kw_only_found)\n#endif\n{\n    Py_ssize_t arg_count = function->m_args_positional_count;\n\n    // Check if too many arguments were given in case of non list star arg.\n    // For Python3.3 it's done only later, when more knowledge has\n    // been gained. TODO: Could be done this way for improved mode\n    // on all versions.\n#if PYTHON_VERSION < 0x300\n    if (function->m_args_star_list_index == -1) {\n        if (unlikely(args_size > arg_count)) {\n#if PYTHON_VERSION < 0x270\n            formatErrorTooManyArguments(function, args_size, kw_size);\n#else\n            formatErrorTooManyArguments(function, args_size + kw_found);\n#endif\n            return false;\n        }\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    bool parameter_error = false;\n#endif\n\n    if (kw_found > 0) {\n        Py_ssize_t i;\n        for (i = 0; i < (args_size < arg_count ? args_size : arg_count); i++) {\n            if (unlikely(python_pars[i] != NULL)) {\n                formatErrorMultipleValuesGiven(function, i);\n                return false;\n            }\n\n            python_pars[i] = args[i];\n            Py_INCREF(python_pars[i]);\n        }\n\n        Py_ssize_t defaults_given = function->m_defaults_given;\n\n        for (; i < arg_count; i++) {\n            if (python_pars[i] == NULL) {\n\n                if (i + defaults_given >= arg_count) {\n                    python_pars[i] = PyTuple_GET_ITEM(function->m_defaults, defaults_given + i - arg_count);\n                    Py_INCREF(python_pars[i]);\n                } else {\n#if PYTHON_VERSION < 0x270\n                    formatErrorTooFewArguments(tstate, function, kw_size, args_size + kw_found);\n                    return false;\n#elif PYTHON_VERSION < 0x300\n                    formatErrorTooFewArguments(tstate, function, args_size + kw_found);\n                    return false;\n#else\n                    parameter_error = true;\n#endif\n                }\n            }\n        }\n    } else {\n        Py_ssize_t usable = (args_size < arg_count ? args_size : arg_count);\n        Py_ssize_t defaults_given = function->m_defaults_given;\n\n        if (defaults_given < arg_count - usable) {\n#if PYTHON_VERSION < 0x270\n            formatErrorTooFewArguments(tstate, function, kw_size, args_size + kw_found);\n            return false;\n#elif PYTHON_VERSION < 0x300\n            formatErrorTooFewArguments(tstate, function, args_size + kw_found);\n            return false;\n#else\n            parameter_error = true;\n#endif\n        }\n\n        for (Py_ssize_t i = 0; i < usable; i++) {\n            assert(python_pars[i] == NULL);\n\n            python_pars[i] = args[i];\n            Py_INCREF(python_pars[i]);\n        }\n\n#if PYTHON_VERSION >= 0x300\n        if (parameter_error == false) {\n#endif\n            for (Py_ssize_t i = usable; i < arg_count; i++) {\n                assert(python_pars[i] == NULL);\n                assert(i + defaults_given >= arg_count);\n\n                python_pars[i] = PyTuple_GET_ITEM(function->m_defaults, defaults_given + i - arg_count);\n                Py_INCREF(python_pars[i]);\n            }\n#if PYTHON_VERSION >= 0x300\n        }\n#endif\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (unlikely(parameter_error)) {\n        formatErrorTooFewArguments(tstate, function, python_pars);\n        return false;\n    }\n\n    if (function->m_args_star_list_index == -1) {\n        // Check if too many arguments were given in case of non list star arg\n        if (unlikely(args_size > arg_count)) {\n            formatErrorTooManyArguments(function, args_size, kw_only_found);\n            return false;\n        }\n    }\n#endif\n\n    if (function->m_args_star_list_index != -1) {\n        makeStarListTupleCopy(function, python_pars, args, args_size);\n    }\n\n    return true;\n}\n\n// Release them all in case of an error.\nstatic void releaseParameters(struct Nuitka_FunctionObject const *function, PyObject *const *python_pars) {\n    Py_ssize_t arg_count = function->m_args_overall_count;\n\n    for (Py_ssize_t i = 0; i < arg_count; i++) {\n        Py_XDECREF(python_pars[i]);\n    }\n}\n\nstatic bool parseArgumentsPos(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                              PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size) {\n    bool result;\n\n    Py_ssize_t arg_count = function->m_args_positional_count;\n\n    if (unlikely(arg_count == 0 && function->m_args_simple && args_size != 0)) {\n#if PYTHON_VERSION < 0x300\n        formatErrorNoArgumentAllowed(function, args_size);\n#else\n        formatErrorNoArgumentAllowed(function, NULL, args_size);\n#endif\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n    result = _handleArgumentsPlainOnly(tstate, function, python_pars, args, args_size);\n\n    if (result == false) {\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    // For Python3.3 the keyword only errors are all reported at once.\n    bool kw_only_error = false;\n\n    for (Py_ssize_t i = function->m_args_positional_count; i < function->m_args_keywords_count; i++) {\n        if (python_pars[i] == NULL) {\n            PyObject *arg_name = function->m_varnames[i];\n\n            if (function->m_kwdefaults != NULL) {\n                python_pars[i] = DICT_GET_ITEM1(tstate, function->m_kwdefaults, arg_name);\n            }\n\n            if (unlikely(python_pars[i] == NULL)) {\n                kw_only_error = true;\n            }\n        }\n    }\n\n    if (unlikely(kw_only_error)) {\n        formatErrorTooFewKwOnlyArguments(tstate, function, &python_pars[function->m_args_positional_count]);\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#endif\n\n    if (function->m_args_star_dict_index != -1) {\n        python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY();\n    }\n\n    return true;\n}\n\n// We leave it to partial inlining to specialize this.\nstatic bool parseArgumentsEmpty(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                PyObject **python_pars) {\n    return parseArgumentsPos(tstate, function, python_pars, NULL, 0);\n}\n\nstatic bool parseArgumentsMethodPos(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                    PyObject **python_pars, PyObject *object, PyObject *const *args,\n                                    Py_ssize_t args_size) {\n    bool result;\n\n    result = handleMethodArgumentsPlainOnly(tstate, function, python_pars, object, args, args_size);\n\n    if (result == false) {\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    // For Python3 the keyword only errors are all reported at once.\n    bool kw_only_error = false;\n\n    for (Py_ssize_t i = function->m_args_positional_count; i < function->m_args_keywords_count; i++) {\n        if (python_pars[i] == NULL) {\n            PyObject *arg_name = function->m_varnames[i];\n\n            if (function->m_kwdefaults != NULL) {\n                python_pars[i] = DICT_GET_ITEM1(tstate, function->m_kwdefaults, arg_name);\n            }\n\n            if (unlikely(python_pars[i] == NULL)) {\n                kw_only_error = true;\n            }\n        }\n    }\n\n    if (unlikely(kw_only_error)) {\n        formatErrorTooFewKwOnlyArguments(tstate, function, &python_pars[function->m_args_positional_count]);\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#endif\n\n    if (function->m_args_star_dict_index != -1) {\n        python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY();\n    }\n\n    return true;\n}\n\nstatic bool parseArgumentsFullKwSplit(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                      PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size,\n                                      PyObject *const *kw_values, PyObject *kw_names) {\n    Py_ssize_t kw_size = PyTuple_GET_SIZE(kw_names);\n    Py_ssize_t kw_found;\n    bool result;\n\n    Py_ssize_t arg_count = function->m_args_keywords_count;\n\n    if (unlikely(arg_count == 0 && function->m_args_simple && args_size + kw_size > 0)) {\n#if PYTHON_VERSION < 0x300\n        formatErrorNoArgumentAllowed(function, args_size + kw_size);\n#else\n        formatErrorNoArgumentAllowedKwSplit(function, PyTuple_GET_ITEM(kw_names, 0), args_size);\n#endif\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t kw_only_found = 0;\n#endif\n    if (function->m_args_star_dict_index != -1) {\n#if PYTHON_VERSION < 0x300\n        kw_found = handleKeywordArgsSplitWithStarDict(tstate, function, python_pars, kw_values, kw_names);\n#else\n        kw_found =\n            handleKeywordArgsSplitWithStarDict(tstate, function, python_pars, &kw_only_found, kw_values, kw_names);\n#endif\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    } else {\n#if PYTHON_VERSION < 0x300\n        kw_found = handleKeywordArgsSplit(function, python_pars, kw_values, kw_names);\n#else\n        kw_found = handleKeywordArgsSplit(function, python_pars, &kw_only_found, kw_values, kw_names);\n#endif\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    }\n\n#if PYTHON_VERSION < 0x270\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_size);\n#elif PYTHON_VERSION < 0x300\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found);\n#else\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_only_found);\n#endif\n\n    if (result == false) {\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    // For Python3.3 the keyword only errors are all reported at once.\n    bool kw_only_error = false;\n\n    for (Py_ssize_t i = function->m_args_positional_count; i < function->m_args_keywords_count; i++) {\n        if (python_pars[i] == NULL) {\n            PyObject *arg_name = function->m_varnames[i];\n\n            if (function->m_kwdefaults != NULL) {\n                python_pars[i] = DICT_GET_ITEM1(tstate, function->m_kwdefaults, arg_name);\n            }\n\n            if (unlikely(python_pars[i] == NULL)) {\n                kw_only_error = true;\n            }\n        }\n    }\n\n    if (unlikely(kw_only_error)) {\n        formatErrorTooFewKwOnlyArguments(tstate, function, &python_pars[function->m_args_positional_count]);\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#endif\n\n    return true;\n}\n\nstatic bool parseArgumentsFull(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                               PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size, PyObject *kw) {\n    Py_ssize_t kw_size = kw ? DICT_SIZE(kw) : 0;\n    Py_ssize_t kw_found;\n    bool result;\n\n    Py_ssize_t arg_count = function->m_args_keywords_count;\n\n    assert(kw == NULL || PyDict_CheckExact(kw));\n\n    if (unlikely(arg_count == 0 && function->m_args_simple && args_size + kw_size > 0)) {\n#if PYTHON_VERSION < 0x300\n        formatErrorNoArgumentAllowed(function, args_size + kw_size);\n#else\n        formatErrorNoArgumentAllowed(function, kw_size > 0 ? kw : NULL, args_size);\n#endif\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    Py_ssize_t kw_only_found = 0;\n#endif\n    if (function->m_args_star_dict_index != -1) {\n#if PYTHON_VERSION < 0x300\n        kw_found = handleKeywordArgsWithStarDict(tstate, function, python_pars, kw);\n#else\n        kw_found = handleKeywordArgsWithStarDict(tstate, function, python_pars, &kw_only_found, kw);\n#endif\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    } else if (kw == NULL || DICT_SIZE(kw) == 0) {\n        kw_found = 0;\n    } else {\n#if PYTHON_VERSION < 0x300\n        kw_found = handleKeywordArgs(tstate, function, python_pars, kw);\n#else\n        kw_found = handleKeywordArgs(tstate, function, python_pars, &kw_only_found, kw);\n#endif\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    }\n\n#if PYTHON_VERSION < 0x270\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_size);\n#elif PYTHON_VERSION < 0x300\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found);\n#else\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_only_found);\n#endif\n\n    if (result == false) {\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    // For Python3.3 the keyword only errors are all reported at once.\n    bool kw_only_error = false;\n\n    for (Py_ssize_t i = function->m_args_positional_count; i < function->m_args_keywords_count; i++) {\n        if (python_pars[i] == NULL) {\n            PyObject *arg_name = function->m_varnames[i];\n\n            if (function->m_kwdefaults != NULL) {\n                python_pars[i] = DICT_GET_ITEM1(tstate, function->m_kwdefaults, arg_name);\n            }\n\n            if (unlikely(python_pars[i] == NULL)) {\n                kw_only_error = true;\n            }\n        }\n    }\n\n    if (unlikely(kw_only_error)) {\n        formatErrorTooFewKwOnlyArguments(tstate, function, &python_pars[function->m_args_positional_count]);\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#endif\n\n    return true;\n}\n\nPyObject *Nuitka_CallFunctionNoArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsEmpty(tstate, function, python_pars))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallFunctionPosArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                     PyObject *const *args, Py_ssize_t args_size) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsPos(tstate, function, python_pars, args, args_size))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallFunctionPosArgsKwArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject *const *args, Py_ssize_t args_size, PyObject *kw) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsFull(tstate, function, python_pars, args, args_size, kw))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallFunctionPosArgsKwSplit(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                            PyObject *const *args, Py_ssize_t args_size, PyObject *const *kw_values,\n                                            PyObject *kw_names) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsFullKwSplit(tstate, function, python_pars, args, args_size, kw_values, kw_names))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallMethodFunctionNoArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                          PyObject *object) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsMethodPos(tstate, function, python_pars, object, NULL, 0))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallMethodFunctionPosArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                           PyObject *object, PyObject *const *args, Py_ssize_t args_size) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsMethodPos(tstate, function, python_pars, object, args, args_size))) {\n        return NULL;\n    }\n\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nPyObject *Nuitka_CallMethodFunctionPosArgsKwArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                                 PyObject *object, PyObject *const *args, Py_ssize_t args_size,\n                                                 PyObject *kw) {\n    NUITKA_DYNAMIC_ARRAY_DECL(new_args, PyObject *, args_size + 1);\n\n    new_args[0] = object;\n    memcpy(new_args + 1, args, args_size * sizeof(PyObject *));\n\n    // TODO: Specialize implementation for massive gains.\n    return Nuitka_CallFunctionPosArgsKwArgs(tstate, function, new_args, args_size + 1, kw);\n}\n\nstatic Py_ssize_t _handleVectorcallKeywordArgs(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                               PyObject **python_pars, Py_ssize_t *kw_only_found,\n                                               PyObject *const *kw_names, PyObject *const *kw_values,\n                                               Py_ssize_t kw_size) {\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n\n    assert(function->m_args_star_dict_index == -1);\n\n    Py_ssize_t kw_found = 0;\n\n    for (Py_ssize_t pos = 0; pos < kw_size; pos++) {\n        PyObject *key = kw_names[pos];\n\n        if (unlikely(!checkKeywordType(key))) {\n            formatErrorKeywordsMustBeString(tstate, function);\n            return -1;\n        }\n\n        NUITKA_MAY_BE_UNUSED bool found = false;\n\n#if PYTHON_VERSION < 0x380\n        Py_ssize_t kw_arg_start = 0;\n#else\n        Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n        for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n            if (function->m_varnames[i] == key) {\n                assert(python_pars[i] == NULL);\n                python_pars[i] = kw_values[pos];\n                Py_INCREF(python_pars[i]);\n\n                if (i >= keyword_after_index) {\n                    *kw_only_found += 1;\n                }\n\n                found = true;\n                break;\n            }\n        }\n\n        if (found == false) {\n            PyObject **var_names = function->m_varnames;\n\n            for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    assert(python_pars[i] == NULL);\n                    python_pars[i] = kw_values[pos];\n                    Py_INCREF(python_pars[i]);\n\n                    if (i >= keyword_after_index) {\n                        *kw_only_found += 1;\n                    }\n\n                    found = true;\n                    break;\n                }\n            }\n        }\n\n        if (unlikely(found == false)) {\n            bool pos_only_error = false;\n\n            for (Py_ssize_t i = 0; i < kw_arg_start; i++) {\n                PyObject **var_names = function->m_varnames;\n\n                if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {\n                    pos_only_error = true;\n                    break;\n                }\n            }\n\n#if PYTHON_VERSION < 0x3a0\n            char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n            char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n            if (pos_only_error == true) {\n                PyErr_Format(PyExc_TypeError,\n                             \"%s() got some positional-only arguments passed as keyword arguments: '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n\n            } else {\n                PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                             Nuitka_String_Check(key) ? Nuitka_String_AsString(key) : \"<non-string>\");\n            }\n\n            return -1;\n        }\n\n        kw_found += 1;\n    }\n\n    return kw_found;\n}\n\nstatic bool MAKE_STAR_DICT_DICTIONARY_COPY38(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                             PyObject **python_pars, PyObject *const *kw_names,\n                                             PyObject *const *kw_values, Py_ssize_t kw_size) {\n    Py_ssize_t star_dict_index = function->m_args_star_dict_index;\n    assert(star_dict_index != -1);\n\n    python_pars[star_dict_index] = _PyDict_NewPresized(kw_size);\n\n    for (int i = 0; i < kw_size; i++) {\n        PyObject *key = kw_names[i];\n\n        if (unlikely(!checkKeywordType(key))) {\n            formatErrorKeywordsMustBeString(tstate, function);\n            return false;\n        }\n\n        bool result = DICT_SET_ITEM(python_pars[star_dict_index], key, kw_values[i]);\n\n        if (unlikely(result == false)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nstatic Py_ssize_t handleVectorcallKeywordArgsWithStarDict(PyThreadState *tstate,\n                                                          struct Nuitka_FunctionObject const *function,\n                                                          PyObject **python_pars, Py_ssize_t *kw_only_found,\n                                                          PyObject *const *kw_names, PyObject *const *kw_values,\n                                                          Py_ssize_t kw_size) {\n    assert(function->m_args_star_dict_index != -1);\n\n    if (unlikely(MAKE_STAR_DICT_DICTIONARY_COPY38(tstate, function, python_pars, kw_names, kw_values, kw_size) ==\n                 false)) {\n        return -1;\n    }\n\n    Py_ssize_t kw_found = 0;\n    Py_ssize_t keywords_count = function->m_args_keywords_count;\n    Py_ssize_t keyword_after_index = function->m_args_positional_count;\n\n    Py_ssize_t star_dict_index = function->m_args_star_dict_index;\n\n    PyObject **var_names = function->m_varnames;\n\n#if PYTHON_VERSION < 0x380\n    Py_ssize_t kw_arg_start = 0;\n#else\n    Py_ssize_t kw_arg_start = function->m_args_pos_only_count;\n#endif\n\n    for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {\n        PyObject *arg_name = var_names[i];\n\n        PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);\n\n        if (kw_arg_value != NULL) {\n            assert(python_pars[i] == NULL);\n\n            python_pars[i] = kw_arg_value;\n\n            DICT_REMOVE_ITEM(python_pars[star_dict_index], arg_name);\n\n            kw_found += 1;\n\n            if (i >= keyword_after_index) {\n                *kw_only_found += 1;\n            }\n        }\n    }\n\n    return kw_found;\n}\n\nstatic bool parseArgumentsVectorcall(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                     PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size,\n                                     PyObject *const *kw_names, Py_ssize_t kw_size) {\n    Py_ssize_t kw_found;\n    bool result;\n    Py_ssize_t kw_only_found;\n\n    Py_ssize_t arg_count = function->m_args_keywords_count;\n\n    // TODO: Create different the vector call slot entries for different function types for extra\n    // performance.\n\n    if (unlikely(arg_count == 0 && function->m_args_simple && args_size + kw_size > 0)) {\n#if PYTHON_VERSION < 0x3a0\n        char const *function_name = Nuitka_String_AsString(function->m_name);\n#else\n        char const *function_name = Nuitka_String_AsString(function->m_qualname);\n#endif\n\n        if (kw_size == 0) {\n            PyErr_Format(PyExc_TypeError, \"%s() takes 0 positional arguments but %zd was given\", function_name,\n                         args_size);\n        } else {\n            PyErr_Format(PyExc_TypeError, \"%s() got an unexpected keyword argument '%s'\", function_name,\n                         Nuitka_String_AsString(kw_names[0]));\n        }\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n    kw_only_found = 0;\n    if (function->m_args_star_dict_index != -1) {\n        kw_found = handleVectorcallKeywordArgsWithStarDict(tstate, function, python_pars, &kw_only_found, kw_names,\n                                                           &args[args_size], kw_size);\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    } else if (kw_size == 0) {\n        kw_found = 0;\n    } else {\n        kw_found = _handleVectorcallKeywordArgs(tstate, function, python_pars, &kw_only_found, kw_names,\n                                                &args[args_size], kw_size);\n\n        if (unlikely(kw_found == -1)) {\n            releaseParameters(function, python_pars);\n            return false;\n        }\n    }\n\n#if PYTHON_VERSION < 0x270\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_size);\n#elif PYTHON_VERSION < 0x300\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found);\n#else\n    result = _handleArgumentsPlain(tstate, function, python_pars, args, args_size, kw_found, kw_only_found);\n#endif\n\n    if (result == false) {\n        releaseParameters(function, python_pars);\n        return false;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    // For Python3 the keyword only errors are all reported at once.\n    bool kw_only_error = false;\n\n    for (Py_ssize_t i = function->m_args_positional_count; i < function->m_args_keywords_count; i++) {\n        if (python_pars[i] == NULL) {\n            PyObject *arg_name = function->m_varnames[i];\n\n            if (function->m_kwdefaults != NULL) {\n                python_pars[i] = DICT_GET_ITEM1(tstate, function->m_kwdefaults, arg_name);\n            }\n\n            if (unlikely(python_pars[i] == NULL)) {\n                kw_only_error = true;\n            }\n        }\n    }\n\n    if (unlikely(kw_only_error)) {\n        formatErrorTooFewKwOnlyArguments(tstate, function, &python_pars[function->m_args_positional_count]);\n\n        releaseParameters(function, python_pars);\n        return false;\n    }\n#endif\n\n    return true;\n}\n\nPyObject *Nuitka_CallFunctionVectorcall(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,\n                                        PyObject *const *args, Py_ssize_t args_size, PyObject *const *kw_names,\n                                        Py_ssize_t kw_size) {\n    NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n    memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n    if (unlikely(!parseArgumentsVectorcall(tstate, function, python_pars, args, args_size, kw_names, kw_size))) {\n        return NULL;\n    }\n    return function->m_c_code(tstate, function, python_pars);\n}\n\nstatic PyObject *Nuitka_Function_tp_call(struct Nuitka_FunctionObject *function, PyObject *tuple_args, PyObject *kw) {\n    CHECK_OBJECT(tuple_args);\n    assert(PyTuple_CheckExact(tuple_args));\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (kw == NULL) {\n        PyObject **args = &PyTuple_GET_ITEM(tuple_args, 0);\n        Py_ssize_t args_size = PyTuple_GET_SIZE(tuple_args);\n\n        if (function->m_args_simple && args_size == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < args_size; i++) {\n                Py_INCREF(args[i]);\n            }\n\n            return function->m_c_code(tstate, function, args);\n        } else if (function->m_args_simple &&\n                   args_size + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n            memcpy(python_pars, args, args_size * sizeof(PyObject *));\n            memcpy(python_pars + args_size, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_overall_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            return function->m_c_code(tstate, function, python_pars);\n        } else {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_overall_count);\n            memset(python_pars, 0, function->m_args_overall_count * sizeof(PyObject *));\n\n            if (parseArgumentsPos(tstate, function, python_pars, args, args_size)) {\n                return function->m_c_code(tstate, function, python_pars);\n            } else {\n                return NULL;\n            }\n        }\n    } else {\n        return Nuitka_CallFunctionPosArgsKwArgs(tstate, function, &PyTuple_GET_ITEM(tuple_args, 0),\n                                                PyTuple_GET_SIZE(tuple_args), kw);\n    }\n}\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\nstatic PyObject *Nuitka_Function_tp_vectorcall(struct Nuitka_FunctionObject *function, PyObject *const *stack,\n                                               size_t nargsf, PyObject *kw_names) {\n    assert(kw_names == NULL || PyTuple_CheckExact(kw_names));\n    Py_ssize_t kwargs_count = (kw_names == NULL) ? 0 : PyTuple_GET_SIZE(kw_names);\n\n    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);\n    assert(nargs >= 0);\n    assert((nargs == 0 && kwargs_count == 0) || stack != NULL);\n\n    PyThreadState *tstate = PyThreadState_GET();\n    return Nuitka_CallFunctionVectorcall(tstate, function, stack, nargs,\n                                         kw_names ? &PyTuple_GET_ITEM(kw_names, 0) : NULL, kwargs_count);\n}\n#endif\n\n#include \"CompiledMethodType.c\"\n\n#include \"CompiledGeneratorType.c\"\n\n#include \"CompiledCellType.c\"\n\n#include \"CompiledCodeHelpers.c\"\n\n#include \"InspectPatcher.c\"\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledGeneratorType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Compiled Generators.\n *\n * Unlike in CPython, we have one type for just generators, this doesn't do coroutines\n * nor asyncgen.\n *\n * It strives to be full replacement for normal generators, while providing also an\n * interface for quick iteration from compiled code.\n *\n */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#include <structmember.h>\n#endif\n\n#if _DEBUG_REFCOUNTS\nint count_active_Nuitka_Generator_Type;\nint count_allocated_Nuitka_Generator_Type;\nint count_released_Nuitka_Generator_Type;\n#endif\n\n// In a separate file, code to interact with uncompiled generators, that does\n// all the quirks necessary to get those working.\n#include \"CompiledGeneratorTypeUncompiledIntegration.c\"\n\n// Debugging output tools\n#if _DEBUG_GENERATOR\nNUITKA_MAY_BE_UNUSED static void _PRINT_GENERATOR_STATUS(char const *descriptor, char const *context,\n                                                         struct Nuitka_GeneratorObject *generator) {\n    char const *status;\n\n    switch (generator->m_status) {\n    case status_Finished:\n        status = \"(finished)\";\n        break;\n    case status_Running:\n        status = \"(running)\";\n        break;\n    case status_Unused:\n        status = \"(unused)\";\n        break;\n    default:\n        status = \"(ILLEGAL)\";\n        break;\n    }\n\n    PRINT_STRING(descriptor);\n    PRINT_STRING(\" : \");\n    PRINT_STRING(context);\n    PRINT_STRING(\" \");\n    PRINT_ITEM((PyObject *)generator);\n    PRINT_STRING(\" \");\n    PRINT_STRING(status);\n    PRINT_STRING(\" \");\n    PRINT_REFCOUNT((PyObject *)generator);\n    PRINT_NEW_LINE();\n}\n\n#define PRINT_GENERATOR_STATUS(context, generator) _PRINT_GENERATOR_STATUS(__FUNCTION__, context, generator)\n\n#endif\n\n#if _DEBUG_GENERATOR || _DEBUG_COROUTINE || _DEBUG_ASYNCGEN\n\nNUITKA_MAY_BE_UNUSED static void PRINT_COROUTINE_VALUE(char const *name, PyObject *value) {\n    PRINT_STRING(name);\n    PRINT_STRING(\"=\");\n    PRINT_ITEM(value);\n    if (value) {\n        PRINT_REFCOUNT(value);\n    }\n    PRINT_NEW_LINE();\n}\n\nNUITKA_MAY_BE_UNUSED static void PRINT_COROUTINE_STRING(char const *name, char const *value) {\n    PRINT_STRING(name);\n    PRINT_STRING(\"=\");\n    PRINT_STRING(value);\n    PRINT_NEW_LINE();\n}\n#endif\n\nstatic void Nuitka_MarkGeneratorAsFinished(struct Nuitka_GeneratorObject *generator) {\n    generator->m_status = status_Finished;\n\n#if PYTHON_VERSION >= 0x3b0\n    if (generator->m_frame) {\n        generator->m_frame->m_frame_state = FRAME_COMPLETED;\n    }\n#endif\n}\n\nstatic void Nuitka_MarkGeneratorAsRunning(struct Nuitka_GeneratorObject *generator) {\n    generator->m_running = 1;\n\n    if (generator->m_frame) {\n        Nuitka_Frame_MarkAsExecuting(generator->m_frame);\n    }\n}\n\nstatic void Nuitka_MarkGeneratorAsNotRunning(struct Nuitka_GeneratorObject *generator) {\n    generator->m_running = 0;\n\n    if (generator->m_frame) {\n        Nuitka_Frame_MarkAsNotExecuting(generator->m_frame);\n    }\n}\n\nstatic PyObject *Nuitka_Generator_tp_repr(struct Nuitka_GeneratorObject *generator) {\n    return Nuitka_String_FromFormat(\"<compiled_generator object %s at %p>\",\n#if PYTHON_VERSION < 0x350\n                                    Nuitka_String_AsString(generator->m_name),\n#else\n                                    Nuitka_String_AsString(generator->m_qualname),\n#endif\n                                    generator);\n}\n\nstatic long Nuitka_Generator_tp_traverse(struct Nuitka_GeneratorObject *generator, visitproc visit, void *arg) {\n    CHECK_OBJECT(generator);\n\n    // TODO: Identify the impact of not visiting owned objects like module.\n#if PYTHON_VERSION >= 0x300\n    Py_VISIT(generator->m_yield_from);\n#endif\n\n    for (Py_ssize_t i = 0; i < generator->m_closure_given; i++) {\n        Py_VISIT(generator->m_closure[i]);\n    }\n\n    Py_VISIT(generator->m_frame);\n\n    return 0;\n}\n\nstatic void Nuitka_Generator_release_closure(struct Nuitka_GeneratorObject *generator) {\n    for (Py_ssize_t i = 0; i < generator->m_closure_given; i++) {\n        CHECK_OBJECT(generator->m_closure[i]);\n        Py_DECREF(generator->m_closure[i]);\n    }\n\n    generator->m_closure_given = 0;\n}\n\n#if PYTHON_VERSION >= 0x300\n\n// Note: Shared with coroutines and asyncgen code.\nstatic PyObject *ERROR_GET_STOP_ITERATION_VALUE(PyThreadState *tstate) {\n    assert(PyErr_ExceptionMatches(PyExc_StopIteration));\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n#if PYTHON_VERSION < 0x3c0\n    Py_DECREF(saved_exception_state.exception_type);\n    Py_XDECREF(saved_exception_state.exception_tb);\n#endif\n    PyObject *exception_value = saved_exception_state.exception_value;\n\n    PyObject *value = NULL;\n\n    if (exception_value) {\n        if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_value, PyExc_StopIteration)) {\n            value = ((PyStopIterationObject *)exception_value)->value;\n            Py_XINCREF(value);\n            Py_DECREF(exception_value);\n        } else {\n            value = exception_value;\n        }\n    }\n\n    if (value == NULL) {\n        Py_INCREF(Py_None);\n        value = Py_None;\n    }\n\n    return value;\n}\n\nstatic PyObject *Nuitka_CallGeneratorThrowMethod(PyObject *throw_method,\n                                                 struct Nuitka_ExceptionPreservationItem *exception_state) {\n\n    // TODO: Faster call code should be used.\n\n#if PYTHON_VERSION < 0x3c0\n    PyObject *result =\n        PyObject_CallFunctionObjArgs(throw_method, exception_state->exception_type, exception_state->exception_value,\n                                     exception_state->exception_tb, NULL);\n\n    return result;\n#else\n    // TODO: For 3.12, we may or may not have to create the type and tb args\n    assert(false);\n    PyObject *result = PyObject_CallFunctionObjArgs(throw_method, exception_state->exception_value, NULL);\n\n    return result;\n#endif\n}\n\nstatic PyObject *_Nuitka_Generator_throw2(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                          struct Nuitka_ExceptionPreservationItem *exception_state);\n#if PYTHON_VERSION >= 0x350\nstatic PyObject *_Nuitka_Coroutine_throw2(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine, bool closing,\n                                          struct Nuitka_ExceptionPreservationItem *exception_state);\n#endif\n\nstatic PyObject *_Nuitka_YieldFromPassExceptionTo(PyThreadState *tstate, PyObject *value,\n                                                  struct Nuitka_ExceptionPreservationItem *exception_state) {\n    // The yielding generator is being closed, but we also are tasked to\n    // immediately close the currently running sub-generator.\n    if (EXCEPTION_STATE_MATCH_BOOL_SINGLE(tstate, exception_state, PyExc_GeneratorExit)) {\n        PyObject *close_method = PyObject_GetAttr(value, const_str_plain_close);\n\n        if (close_method) {\n            PyObject *close_value = PyObject_Call(close_method, const_tuple_empty, NULL);\n            Py_DECREF(close_method);\n\n            if (unlikely(close_value == NULL)) {\n                // Release exception, we are done with it, raising the one from close instead.\n                RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                return NULL;\n            }\n\n            Py_DECREF(close_value);\n        } else {\n            PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n            if (error != NULL && !EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_AttributeError)) {\n                PyErr_WriteUnraisable((PyObject *)value);\n            }\n        }\n\n        // Transfer exception ownership to published.\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n        return NULL;\n    }\n\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n    if (PyGen_CheckExact(value)\n#if PYTHON_VERSION >= 0x350\n        || PyCoro_CheckExact(value)\n#endif\n    ) {\n        PyGenObject *gen = (PyGenObject *)value;\n\n        // Handing exception ownership over.\n        PyObject *result = Nuitka_UncompiledGenerator_throw(tstate, gen, 1, exception_state);\n\n        return result;\n    }\n#endif\n\n    if (Nuitka_Generator_Check(value)) {\n        struct Nuitka_GeneratorObject *gen = ((struct Nuitka_GeneratorObject *)value);\n\n        return _Nuitka_Generator_throw2(tstate, gen, exception_state);\n    }\n\n#if PYTHON_VERSION >= 0x350\n    if (Nuitka_Coroutine_Check(value)) {\n        struct Nuitka_CoroutineObject *coro = ((struct Nuitka_CoroutineObject *)value);\n        // Handing exception ownership over.\n        return _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n    }\n\n    if (Nuitka_CoroutineWrapper_Check(value)) {\n        struct Nuitka_CoroutineObject *coro = ((struct Nuitka_CoroutineWrapperObject *)value)->m_coroutine;\n        // Handing exception ownership over.\n        return _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n    }\n#endif\n\n    PyObject *throw_method = PyObject_GetAttr(value, const_str_plain_throw);\n\n    if (throw_method) {\n        PyObject *result = Nuitka_CallGeneratorThrowMethod(throw_method, exception_state);\n        Py_DECREF(throw_method);\n\n        // Releasing exception we own.\n        RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n        return result;\n    } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {\n        // Restoring the exception we own, to be released when handling it.\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n        return NULL;\n    } else {\n        assert(HAS_ERROR_OCCURRED(tstate));\n\n        // Releasing exception we own.\n        RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n        return NULL;\n    }\n}\n\nstatic PyObject *_Nuitka_YieldFromGeneratorCore(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                                PyObject *yield_from, PyObject *send_value) {\n    // Send iteration value to the sub-generator, which may be a CPython\n    // generator object, something with an iterator next, or a send method,\n    // where the later is only required if values other than \"None\" need to\n    // be passed in.\n    CHECK_OBJECT(yield_from);\n    assert(send_value != NULL || HAS_ERROR_OCCURRED(tstate));\n\n    PyObject *retval;\n\n#if 0\n    PRINT_STRING(\"YIELD CORE:\");\n    PRINT_ITEM( value );\n    PRINT_ITEM( send_value );\n\n    PRINT_NEW_LINE();\n#endif\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &exception_state);\n\n    // Exception, was thrown into us, need to send that to sub-generator.\n    if (HAS_EXCEPTION_STATE(&exception_state)) {\n        // Passing ownership of exception fetch to it.\n        retval = _Nuitka_YieldFromPassExceptionTo(tstate, yield_from, &exception_state);\n\n        // TODO: This wants to look at retval most definitely, send_value is going to be NULL.\n        if (unlikely(send_value == NULL)) {\n            PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n            if (error != NULL && EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration)) {\n                generator->m_returned = ERROR_GET_STOP_ITERATION_VALUE(tstate);\n                assert(!HAS_ERROR_OCCURRED(tstate));\n\n                return NULL;\n            }\n        }\n    } else if (PyGen_CheckExact(yield_from)) {\n        retval = Nuitka_PyGen_Send(tstate, (PyGenObject *)yield_from, Py_None);\n    }\n#if PYTHON_VERSION >= 0x350\n    else if (PyCoro_CheckExact(yield_from)) {\n        retval = Nuitka_PyGen_Send(tstate, (PyGenObject *)yield_from, Py_None);\n    }\n#endif\n    else if (send_value == Py_None && Py_TYPE(yield_from)->tp_iternext != NULL) {\n        retval = Py_TYPE(yield_from)->tp_iternext(yield_from);\n    } else {\n        // Bug compatibility here, before 3.3 tuples were unrolled in calls, which is what\n        // PyObject_CallMethod does.\n#if PYTHON_VERSION >= 0x340\n        retval = PyObject_CallMethodObjArgs(yield_from, const_str_plain_send, send_value, NULL);\n#else\n        retval = PyObject_CallMethod(yield_from, (char *)\"send\", (char *)\"O\", send_value);\n#endif\n    }\n\n    // Check the sub-generator result\n    if (retval == NULL) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n        if (error == NULL) {\n            Py_INCREF(Py_None);\n            generator->m_returned = Py_None;\n        } else if (likely(EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration))) {\n            // The sub-generator has given an exception. In case of\n            // StopIteration, we need to check the value, as it is going to be\n            // the expression value of this \"yield from\", and we are done. All\n            // other errors, we need to raise.\n            generator->m_returned = ERROR_GET_STOP_ITERATION_VALUE(tstate);\n            assert(!HAS_ERROR_OCCURRED(tstate));\n        }\n\n        return NULL;\n    } else {\n        return retval;\n    }\n}\n\nstatic PyObject *Nuitka_YieldFromGeneratorCore(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                               PyObject *send_value) {\n    CHECK_OBJECT(generator);\n    CHECK_OBJECT_X(send_value);\n\n    PyObject *yield_from = generator->m_yield_from;\n    CHECK_OBJECT(yield_from);\n\n    // Need to make it unaccessible while using it.\n    generator->m_yield_from = NULL;\n    PyObject *yielded = _Nuitka_YieldFromGeneratorCore(tstate, generator, yield_from, send_value);\n\n    if (yielded == NULL) {\n        Py_DECREF(yield_from);\n\n        if (generator->m_returned != NULL) {\n            PyObject *yield_from_result = generator->m_returned;\n            generator->m_returned = NULL;\n\n            yielded = ((generator_code)generator->m_code)(tstate, generator, yield_from_result);\n        } else {\n            assert(HAS_ERROR_OCCURRED(tstate));\n            yielded = ((generator_code)generator->m_code)(tstate, generator, NULL);\n        }\n\n    } else {\n        generator->m_yield_from = yield_from;\n    }\n\n    return yielded;\n}\n\nstatic PyObject *Nuitka_YieldFromGeneratorNext(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator) {\n    CHECK_OBJECT(generator);\n\n    // Coroutines are already perfect for yielding from.\n#if PYTHON_VERSION >= 0x350\n    if (PyCoro_CheckExact(generator->m_yield_from) || Nuitka_Coroutine_Check(generator->m_yield_from)) {\n        if (unlikely((generator->m_code_object->co_flags & CO_ITERABLE_COROUTINE) == 0)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                            \"cannot 'yield from' a coroutine object in a non-coroutine generator\");\n        }\n    } else\n#endif\n    {\n        PyObject *new_iterator = MAKE_ITERATOR(tstate, generator->m_yield_from);\n        if (new_iterator != NULL) {\n            Py_DECREF(generator->m_yield_from);\n            generator->m_yield_from = new_iterator;\n        }\n    }\n\n    return Nuitka_YieldFromGeneratorCore(tstate, generator, Py_None);\n}\n\nstatic PyObject *Nuitka_YieldFromGeneratorInitial(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                                  PyObject *send_value) {\n    PyObject *result = Nuitka_YieldFromGeneratorCore(tstate, generator, send_value);\n\n#if 0\n    PRINT_STRING(\"RES:\");\n    PRINT_ITEM( result );\n    PRINT_NEW_LINE();\n#endif\n\n    return result;\n}\n\n#endif\n\nstatic void _Nuitka_GeneratorPopFrame(PyThreadState *tstate, Nuitka_ThreadStateFrameType *return_frame) {\n#if PYTHON_VERSION < 0x3b0\n    tstate->frame = return_frame;\n#else\n    tstate->cframe->current_frame = return_frame;\n#endif\n\n    PRINT_TOP_FRAME(\"Generator pop exit gives top frame:\");\n}\n\n#if PYTHON_VERSION >= 0x350\nstatic void RAISE_RUNTIME_ERROR_RAISED_STOP_ITERATION(PyThreadState *tstate, char const *message) {\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n#if PYTHON_VERSION < 0x3c0\n    NORMALIZE_EXCEPTION(tstate, &saved_exception_state.exception_type, &saved_exception_state.exception_value,\n                        &saved_exception_state.exception_tb);\n#endif\n\n    struct Nuitka_ExceptionPreservationItem new_exception_state;\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_TYPE0_STR(&new_exception_state, PyExc_RuntimeError, message);\n\n#if PYTHON_VERSION < 0x3c0\n    NORMALIZE_EXCEPTION(tstate, &new_exception_state.exception_type, &new_exception_state.exception_value,\n                        &new_exception_state.exception_tb);\n#endif\n    RAISE_EXCEPTION_WITH_CAUSE_STATE(tstate, &new_exception_state, saved_exception_state.exception_value);\n\n    Py_INCREF(saved_exception_state.exception_value);\n    PyException_SetContext(new_exception_state.exception_value, saved_exception_state.exception_value);\n\n    Py_INCREF(saved_exception_state.exception_value);\n    RELEASE_ERROR_OCCURRED_STATE(&saved_exception_state);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &new_exception_state);\n}\n#endif\n\nstatic PyObject *_Nuitka_Generator_send(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                        PyObject *value, struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_OBJECT(generator);\n    assert(Nuitka_Generator_Check((PyObject *)generator));\n    CHECK_EXCEPTION_STATE_X(exception_state);\n    CHECK_OBJECT_X(value);\n    assert(PyThreadState_GET() == tstate);\n\n#if _DEBUG_GENERATOR\n    PRINT_GENERATOR_STATUS(\"Enter\", generator);\n    PRINT_COROUTINE_VALUE(\"value\", value);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_CURRENT_EXCEPTION();\n    PRINT_NEW_LINE();\n#endif\n\n    if (value != NULL) {\n        ASSERT_EMPTY_EXCEPTION_STATE(exception_state);\n    }\n\n    if (generator->m_status != status_Finished) {\n        if (generator->m_running) {\n            Py_XDECREF(value);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"generator already executing\");\n            return NULL;\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyObject *saved_exception_type = tstate->exc_type;\n        PyObject *saved_exception_value = NULL;\n        PyTracebackObject *saved_exception_traceback = NULL;\n\n        if (saved_exception_type != Py_None && saved_exception_type != NULL) {\n            saved_exception_value = tstate->exc_value;\n            Py_INCREF(saved_exception_type);\n            Py_XINCREF(saved_exception_value);\n            saved_exception_traceback = (PyTracebackObject *)tstate->exc_traceback;\n            Py_XINCREF(saved_exception_traceback);\n        }\n#endif\n\n        // Put the asyncgen back on the frame stack.\n        Nuitka_ThreadStateFrameType *return_frame = _Nuitka_GetThreadStateFrame(tstate);\n\n        if (generator->m_status == status_Unused) {\n            generator->m_status = status_Running;\n\n            Py_XDECREF(value);\n            value = NULL;\n        } else {\n            // Put the generator back on the frame stack.\n            pushFrameStackGeneratorCompiledFrame(tstate, generator->m_frame);\n        }\n\n        // Continue the yielder function while preventing recursion.\n        Nuitka_MarkGeneratorAsRunning(generator);\n\n        // Check for thrown exception, publish it to the generator code.\n        if (unlikely(HAS_EXCEPTION_STATE(exception_state))) {\n            assert(value == NULL);\n\n            // Transfer exception ownership to published.\n            RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n        }\n\n#if _DEBUG_GENERATOR\n        PRINT_GENERATOR_STATUS(\"Switching to coroutine\", generator);\n        PRINT_COROUTINE_VALUE(\"value\", value);\n        PRINT_CURRENT_EXCEPTION();\n        PRINT_NEW_LINE();\n        // dumpFrameStack();\n#endif\n\n        PyObject *yielded;\n\n#if PYTHON_VERSION >= 0x300\n        if (generator->m_yield_from == NULL) {\n            yielded = ((generator_code)generator->m_code)(tstate, generator, value);\n        } else {\n            // This does not release the value if any, so we need to do it afterwards.\n            yielded = Nuitka_YieldFromGeneratorInitial(tstate, generator, value);\n            Py_XDECREF(value);\n        }\n#else\n        yielded = ((generator_code)generator->m_code)(tstate, generator, value);\n#endif\n        assert(PyThreadState_GET() == tstate);\n\n#if PYTHON_VERSION >= 0x300\n        // If the generator returns with m_yield_from set, it wants us to yield\n        // from that value from now on.\n        while (yielded == NULL && generator->m_yield_from != NULL) {\n            yielded = Nuitka_YieldFromGeneratorNext(tstate, generator);\n        }\n#endif\n        assert(PyThreadState_GET() == tstate);\n\n        Nuitka_MarkGeneratorAsNotRunning(generator);\n\n        // Remove the generator from the frame stack.\n        if (generator->m_frame) {\n            // assert(tstate->frame == &generator->m_frame->m_frame);\n            assertFrameObject(generator->m_frame);\n\n            Py_CLEAR(generator->m_frame->m_frame.f_back);\n        }\n\n        // Return back to the frame that called us.\n        _Nuitka_GeneratorPopFrame(tstate, return_frame);\n\n#if _DEBUG_GENERATOR\n        PRINT_GENERATOR_STATUS(\"Returned from generator\", generator);\n        // dumpFrameStack();\n#endif\n\n        if (yielded == NULL) {\n#if _DEBUG_GENERATOR\n            PRINT_GENERATOR_STATUS(\"finishing from yield\", generator);\n            PRINT_STRING(\"-> finishing generator sets status_Finished\\n\");\n            PRINT_COROUTINE_VALUE(\"return_value\", generator->m_returned);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n            Nuitka_MarkGeneratorAsFinished(generator);\n\n            if (generator->m_frame != NULL) {\n#if PYTHON_VERSION >= 0x340\n                Nuitka_SetFrameGenerator(generator->m_frame, NULL);\n#endif\n                Py_DECREF(generator->m_frame);\n                generator->m_frame = NULL;\n            }\n\n            Nuitka_Generator_release_closure(generator);\n\n#if PYTHON_VERSION < 0x300\n            if (saved_exception_type != NULL && saved_exception_type != Py_None) {\n                Py_DECREF(saved_exception_type);\n                Py_XDECREF(saved_exception_value);\n                Py_XDECREF(saved_exception_traceback);\n            }\n#endif\n\n#if PYTHON_VERSION >= 0x350\n            if (\n#if PYTHON_VERSION < 0x370\n                generator->m_code_object->co_flags & CO_FUTURE_GENERATOR_STOP &&\n#endif\n                GET_ERROR_OCCURRED(tstate) == PyExc_StopIteration) {\n                RAISE_RUNTIME_ERROR_RAISED_STOP_ITERATION(tstate, \"generator raised StopIteration\");\n\n                return NULL;\n            }\n#endif\n\n            // Create StopIteration if necessary, i.e. return value that is not \"None\" was\n            // given. TODO: Push this further down the user line, we might be able to avoid\n            // it for some uses, e.g. quick iteration entirely.\n#if PYTHON_VERSION >= 0x300\n            if (generator->m_returned) {\n                if (generator->m_returned != Py_None) {\n                    Nuitka_SetStopIterationValue(tstate, generator->m_returned);\n                }\n\n                Py_DECREF(generator->m_returned);\n                generator->m_returned = NULL;\n\n#if _DEBUG_GENERATOR\n                PRINT_GENERATOR_STATUS(\"Return value to exception set\", generator);\n                PRINT_CURRENT_EXCEPTION();\n                PRINT_NEW_LINE();\n#endif\n            }\n#endif\n\n            return NULL;\n        } else {\n#if _NUITKA_MAINTAIN_SYS_EXC_VARS\n            PyObject *old_type = tstate->exc_type;\n            PyObject *old_value = tstate->exc_value;\n            PyTracebackObject *old_tb = (PyTracebackObject *)tstate->exc_traceback;\n\n            // Set sys attributes in the fastest possible way.\n            PyObject *sys_dict = tstate->interp->sysdict;\n            CHECK_OBJECT(sys_dict);\n\n            if (saved_exception_type != NULL && saved_exception_type != Py_None) {\n                tstate->exc_type = saved_exception_type;\n                tstate->exc_value = saved_exception_value;\n                tstate->exc_traceback = (PyObject *)saved_exception_traceback;\n\n                Py_XDECREF(old_type);\n                Py_XDECREF(old_value);\n                Py_XDECREF(old_tb);\n\n                if (old_type != saved_exception_type) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_type, saved_exception_type);\n                }\n                if (saved_exception_value != old_value) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_value,\n                                  saved_exception_value ? saved_exception_value : Py_None);\n                }\n                if (saved_exception_traceback != old_tb) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_traceback,\n                                  saved_exception_traceback ? (PyObject *)saved_exception_traceback : Py_None);\n                }\n            } else {\n                tstate->exc_type = Py_None;\n                tstate->exc_value = Py_None;\n                tstate->exc_traceback = (PyObject *)Py_None;\n\n                Py_INCREF(Py_None);\n                Py_INCREF(Py_None);\n                Py_INCREF(Py_None);\n\n                Py_XDECREF(old_type);\n                Py_XDECREF(old_value);\n                Py_XDECREF(old_tb);\n\n                if (old_type != Py_None) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_type, Py_None);\n                }\n                if (old_value != Py_None) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_value, Py_None);\n                }\n                if (old_tb != (PyTracebackObject *)Py_None) {\n                    DICT_SET_ITEM(sys_dict, const_str_plain_exc_traceback, Py_None);\n                }\n            }\n#endif\n\n            return yielded;\n        }\n    } else {\n        return NULL;\n    }\n}\n\nstatic PyObject *Nuitka_Generator_send(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (generator->m_status == status_Unused && value != NULL && value != Py_None) {\n        // Buggy CPython 3.10 refuses to allow later usage.\n#if PYTHON_VERSION >= 0x3a0 && PYTHON_VERSION < 0x3a2\n        Nuitka_MarkGeneratorAsFinished(generator);\n#endif\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"can't send non-None value to a just-started generator\");\n        return NULL;\n    }\n\n    // We need to transfer ownership of the sent value.\n    Py_INCREF(value);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PyObject *result = _Nuitka_Generator_send(tstate, generator, value, &exception_state);\n\n    if (result == NULL) {\n        if (HAS_ERROR_OCCURRED(tstate) == false) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n    }\n\n    return result;\n}\n\nstatic PyObject *Nuitka_Generator_tp_iternext(struct Nuitka_GeneratorObject *generator) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    Py_INCREF(Py_None);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    return _Nuitka_Generator_send(tstate, generator, Py_None, &exception_state);\n}\n\n/* Our own qiter interface, which is for quicker simple loop style iteration,\n   that does not send anything in. */\nPyObject *Nuitka_Generator_qiter(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator, bool *finished) {\n    Py_INCREF(Py_None);\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    INIT_ERROR_OCCURRED_STATE(&exception_state);\n\n    PyObject *result = _Nuitka_Generator_send(tstate, generator, Py_None, &exception_state);\n\n    if (result == NULL) {\n        if (unlikely(!CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate))) {\n            *finished = false;\n            return NULL;\n        }\n\n        *finished = true;\n        return NULL;\n    }\n\n    *finished = false;\n    return result;\n}\n\nstatic bool DROP_ERROR_OCCURRED_GENERATOR_EXIT_OR_STOP_ITERATION(PyThreadState *tstate) {\n    PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n    if (EXCEPTION_MATCH_GENERATOR(tstate, error)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        return true;\n    }\n\n    return false;\n}\n\n// Note: Used by compiled frames.\nstatic bool _Nuitka_Generator_close(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator) {\n#if _DEBUG_GENERATOR\n    PRINT_GENERATOR_STATUS(\"Enter\", generator);\n#endif\n    CHECK_OBJECT(generator);\n\n    if (generator->m_status == status_Running) {\n        struct Nuitka_ExceptionPreservationItem exception_state;\n        SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, PyExc_GeneratorExit, NULL, NULL);\n\n        PyObject *result = _Nuitka_Generator_send(tstate, generator, NULL, &exception_state);\n\n        if (unlikely(result)) {\n            Py_DECREF(result);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"generator ignored GeneratorExit\");\n            return false;\n        } else {\n            PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n            // StopIteration as exception.\n            if (error == NULL) {\n                return true;\n            }\n\n            // Maybe another acceptable exception for generator exit.\n            return DROP_ERROR_OCCURRED_GENERATOR_EXIT_OR_STOP_ITERATION(tstate);\n        }\n    }\n\n    return true;\n}\n\nstatic PyObject *Nuitka_Generator_close(struct Nuitka_GeneratorObject *generator) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    bool r = _Nuitka_Generator_close(tstate, generator);\n\n    if (unlikely(r == false)) {\n        return NULL;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\n// Shared code for checking a thrown exception, coroutines, asyncgen, uncompiled ones do this too.\nstatic bool _Nuitka_Generator_check_throw2(PyThreadState *tstate,\n                                           struct Nuitka_ExceptionPreservationItem *exception_state) {\n    CHECK_EXCEPTION_STATE(exception_state);\n\n#if PYTHON_VERSION < 0x3c0\n    if (exception_state->exception_tb == (PyTracebackObject *)Py_None) {\n        Py_DECREF(exception_state->exception_tb);\n        exception_state->exception_tb = NULL;\n    } else if (exception_state->exception_tb != NULL && !PyTraceBack_Check(exception_state->exception_tb)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"throw() third argument must be a traceback object\");\n        goto failed_throw;\n    }\n\n    if (PyExceptionClass_Check(exception_state->exception_type)) {\n        // TODO: Must not / need not normalize here?\n        NORMALIZE_EXCEPTION(tstate, &exception_state->exception_type, &exception_state->exception_value,\n                            &exception_state->exception_tb);\n    } else if (PyExceptionInstance_Check(exception_state->exception_type)) {\n        if (exception_state->exception_value != NULL && exception_state->exception_value != Py_None) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                            \"instance exception may not have a separate value\");\n            goto failed_throw;\n        }\n\n        // Release old None value and replace it with the object, then set the exception type\n        // from the class.\n        Py_XDECREF(exception_state->exception_value);\n        exception_state->exception_value = exception_state->exception_type;\n\n        exception_state->exception_type = PyExceptionInstance_Class(exception_state->exception_type);\n        Py_INCREF(exception_state->exception_type);\n    } else {\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"exceptions must be classes, or instances, not %s\",\n                     Py_TYPE(exception_state->exception_type)->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"exceptions must be classes or instances deriving from BaseException, not %s\",\n                     Py_TYPE(exception_state->exception_type)->tp_name);\n#endif\n\n        goto failed_throw;\n    }\n\n#endif\n    return true;\n\n#if PYTHON_VERSION < 0x3c0\nfailed_throw:\n#endif\n    // Release exception, we are done with it now.\n    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n    return false;\n}\n\n#if PYTHON_VERSION >= 0x300\n\nstatic bool _Nuitka_Generator_close(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator);\n#if PYTHON_VERSION >= 0x350\nstatic bool _Nuitka_Coroutine_close(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine);\n#if PYTHON_VERSION >= 0x360\nstatic bool _Nuitka_Asyncgen_close(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen);\n#endif\n#endif\n\n// Note: This is also used for coroutines and asyncgen\nstatic bool Nuitka_gen_close_iter(PyThreadState *tstate, PyObject *yield_from) {\n#if _DEBUG_GENERATOR\n    PRINT_STRING(\"Nuitka_gen_close_iter: Enter\\n\");\n#endif\n\n    CHECK_OBJECT(yield_from);\n\n    // TODO: Could specialize depending in yield_from type for performance. Many\n    // times these will be our own ones, or known ones like uncompiled\n    // generators.\n    if (Nuitka_Generator_Check(yield_from)) {\n#if _DEBUG_GENERATOR\n        PRINT_STRING(\"Nuitka_gen_close_iter: Defer to _Nuitka_Generator_close\\n\");\n#endif\n        return _Nuitka_Generator_close(tstate, (struct Nuitka_GeneratorObject *)yield_from);\n    }\n\n#if PYTHON_VERSION >= 0x350\n    if (Nuitka_Coroutine_Check(yield_from)) {\n#if _DEBUG_GENERATOR\n        PRINT_STRING(\"Nuitka_gen_close_iter: Defer to _Nuitka_Coroutine_close\\n\");\n#endif\n        return _Nuitka_Coroutine_close(tstate, (struct Nuitka_CoroutineObject *)yield_from);\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x360\n    if (Nuitka_Asyncgen_Check(yield_from)) {\n#if _DEBUG_GENERATOR\n        PRINT_STRING(\"Nuitka_gen_close_iter: Defer to _Nuitka_Asyncgen_close\\n\");\n#endif\n        return _Nuitka_Asyncgen_close(tstate, (struct Nuitka_AsyncgenObject *)yield_from);\n    }\n#endif\n\n    PyObject *meth = PyObject_GetAttr(yield_from, const_str_plain_close);\n\n    if (unlikely(meth == NULL)) {\n        if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) {\n#if _DEBUG_GENERATOR\n            PRINT_STRING(\"Nuitka_gen_close_iter: Strange error while looking up close method.\\n\");\n#endif\n            PyErr_WriteUnraisable(yield_from);\n        }\n\n        CLEAR_ERROR_OCCURRED(tstate);\n\n#if _DEBUG_GENERATOR\n        PRINT_STRING(\"Nuitka_gen_close_iter: Leave, has no close method.\\n\");\n#endif\n        return true;\n    }\n\n    PyObject *retval = CALL_FUNCTION_NO_ARGS(tstate, meth);\n    Py_DECREF(meth);\n\n    if (unlikely(retval == NULL)) {\n#if _DEBUG_GENERATOR\n        PRINT_STRING(\"Nuitka_gen_close_iter: Leave, exception from close.\\n\");\n#endif\n        return false;\n    }\n\n    CHECK_OBJECT(retval);\n    Py_DECREF(retval);\n\n#if _DEBUG_GENERATOR\n    PRINT_STRING(\"Nuitka_gen_close_iter: Leave, closed.\\n\");\n#endif\n\n    return true;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x360\nstatic bool Nuitka_AsyncgenAsend_Check(PyObject *object);\nstruct Nuitka_AsyncgenAsendObject;\nstatic PyObject *_Nuitka_AsyncgenAsend_throw2(PyThreadState *tstate, struct Nuitka_AsyncgenAsendObject *asyncgen_asend,\n                                              struct Nuitka_ExceptionPreservationItem *exception_state);\n#endif\n\nstatic PyObject *_Nuitka_Generator_throw2(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                          struct Nuitka_ExceptionPreservationItem *exception_state) {\n#if _DEBUG_GENERATOR\n    PRINT_GENERATOR_STATUS(\"Enter\", generator);\n    PRINT_COROUTINE_VALUE(\"yield_from\", generator->m_yield_from);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_NEW_LINE();\n#endif\n\n    CHECK_OBJECT(generator);\n    assert(Nuitka_Generator_Check((PyObject *)generator));\n    CHECK_EXCEPTION_STATE(exception_state);\n\n#if PYTHON_VERSION >= 0x300\n    if (generator->m_yield_from != NULL) {\n        if (EXCEPTION_STATE_MATCH_BOOL_SINGLE(tstate, exception_state, PyExc_GeneratorExit)) {\n            // Generators need to close the yield_from.\n            Nuitka_MarkGeneratorAsRunning(generator);\n            bool res = Nuitka_gen_close_iter(tstate, generator->m_yield_from);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n\n            if (res == false) {\n                // Release exception, we are done with it now and pick up the new one.\n                RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                FETCH_ERROR_OCCURRED_STATE(tstate, exception_state);\n            }\n\n            // Transferred exception ownership to \"_Nuitka_Generator_send\".\n            return _Nuitka_Generator_send(tstate, generator, NULL, exception_state);\n        }\n\n        PyObject *ret;\n\n#if _DEBUG_GENERATOR\n        PRINT_GENERATOR_STATUS(\"Passing to yielded from\", generator);\n        PRINT_COROUTINE_VALUE(\"m_yield_from\", generator->m_yield_from);\n        PRINT_NEW_LINE();\n#endif\n\n        if (Nuitka_Generator_Check(generator->m_yield_from)) {\n            struct Nuitka_GeneratorObject *gen = ((struct Nuitka_GeneratorObject *)generator->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Generator_throw2\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = _Nuitka_Generator_throw2(tstate, gen, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n        } else if (PyGen_CheckExact(generator->m_yield_from)) {\n            PyGenObject *gen = (PyGenObject *)generator->m_yield_from;\n\n            // Transferred exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = Nuitka_UncompiledGenerator_throw(tstate, gen, 1, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n#endif\n#if PYTHON_VERSION >= 0x350\n        } else if (Nuitka_Coroutine_Check(generator->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro = ((struct Nuitka_CoroutineObject *)generator->m_yield_from);\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n        } else if (Nuitka_CoroutineWrapper_Check(generator->m_yield_from)) {\n            struct Nuitka_CoroutineObject *coro =\n                ((struct Nuitka_CoroutineWrapperObject *)generator->m_yield_from)->m_coroutine;\n\n            // Transferred exception ownership to \"_Nuitka_Coroutine_throw2\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = _Nuitka_Coroutine_throw2(tstate, coro, true, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n        } else if (PyCoro_CheckExact(generator->m_yield_from)) {\n            PyGenObject *gen = (PyGenObject *)generator->m_yield_from;\n\n            // Transferred exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = Nuitka_UncompiledGenerator_throw(tstate, gen, 1, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n#endif\n#if PYTHON_VERSION >= 0x360\n        } else if (Nuitka_AsyncgenAsend_Check(generator->m_yield_from)) {\n            struct Nuitka_AsyncgenAsendObject *asyncgen_asend =\n                ((struct Nuitka_AsyncgenAsendObject *)generator->m_yield_from);\n\n            // Transferred exception ownership to \"_Nuitka_AsyncgenAsend_throw2\".\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = _Nuitka_AsyncgenAsend_throw2(tstate, asyncgen_asend, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n#endif\n#endif\n        } else {\n            PyObject *meth = PyObject_GetAttr(generator->m_yield_from, const_str_plain_throw);\n            if (unlikely(meth == NULL)) {\n                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n                    // Release exception, we are done with it now.\n                    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                    return NULL;\n                }\n\n                CLEAR_ERROR_OCCURRED(tstate);\n\n                // Passing exception ownership to that code.\n                goto throw_here;\n            }\n\n            CHECK_EXCEPTION_STATE(exception_state);\n\n#if 0\n            // TODO: Add slow mode traces.\n            PRINT_ITEM(coroutine->m_yield_from);\n            PRINT_NEW_LINE();\n#endif\n            Nuitka_MarkGeneratorAsRunning(generator);\n            ret = Nuitka_CallGeneratorThrowMethod(meth, exception_state);\n            Nuitka_MarkGeneratorAsNotRunning(generator);\n\n            Py_DECREF(meth);\n\n            // Release exception, we are done with it now.\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n        }\n\n        if (unlikely(ret == NULL)) {\n            // Return value or exception, not to continue with yielding from.\n            if (generator->m_yield_from != NULL) {\n                CHECK_OBJECT(generator->m_yield_from);\n#if _DEBUG_GENERATOR\n                PRINT_GENERATOR_STATUS(\"Null return, yield from removal:\", generator);\n                PRINT_COROUTINE_VALUE(\"yield_from\", generator->m_yield_from);\n#endif\n                Py_DECREF(generator->m_yield_from);\n                generator->m_yield_from = NULL;\n            }\n\n            PyObject *val;\n            if (_PyGen_FetchStopIterationValue(&val) == 0) {\n                CHECK_OBJECT(val);\n\n#if _DEBUG_GENERATOR\n                PRINT_GENERATOR_STATUS(\"Sending return value into ourselves\", generator);\n                PRINT_COROUTINE_VALUE(\"value\", val);\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                ret = _Nuitka_Generator_send(tstate, generator, val, &no_exception_state);\n            } else {\n#if _DEBUG_GENERATOR\n                PRINT_GENERATOR_STATUS(\"Sending exception value into ourselves\", generator);\n                PRINT_CURRENT_EXCEPTION();\n                PRINT_NEW_LINE();\n#endif\n\n                struct Nuitka_ExceptionPreservationItem no_exception_state;\n                INIT_ERROR_OCCURRED_STATE(&no_exception_state);\n\n                ret = _Nuitka_Generator_send(tstate, generator, NULL, &no_exception_state);\n            }\n\n#if _DEBUG_GENERATOR\n            PRINT_GENERATOR_STATUS(\"Leave with value/exception from sending into ourselves:\", generator);\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        } else {\n#if _DEBUG_GENERATOR\n            PRINT_GENERATOR_STATUS(\"Leave with return value:\", generator);\n            PRINT_COROUTINE_VALUE(\"return_value\", ret);\n            PRINT_CURRENT_EXCEPTION();\n            PRINT_NEW_LINE();\n#endif\n        }\n\n        return ret;\n    }\n\nthrow_here:\n#endif\n\n    // We continue to have exception ownership here.\n\n    if (unlikely(_Nuitka_Generator_check_throw2(tstate, exception_state) == false)) {\n        // Exception was released by _Nuitka_Generator_check_throw2 already.\n        return NULL;\n    }\n\n    if (generator->m_status == status_Running) {\n        // Passing exception ownership to _Nuitka_Generator_send\n        PyObject *result = _Nuitka_Generator_send(tstate, generator, NULL, exception_state);\n\n        if (result == NULL) {\n            if (GET_ERROR_OCCURRED(tstate) == NULL) {\n                SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n            }\n        }\n\n        return result;\n    } else if (generator->m_status == status_Finished) {\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n        return NULL;\n    } else {\n        PyTracebackObject *exception_tb = GET_EXCEPTION_STATE_TRACEBACK(exception_state);\n\n        if (exception_tb == NULL) {\n            // TODO: Our compiled objects really need a way to store common\n            // stuff in a \"shared\" part across all instances, and outside of\n            // run time, so we could reuse this.\n            struct Nuitka_FrameObject *frame =\n                MAKE_FUNCTION_FRAME(tstate, generator->m_code_object, generator->m_module, 0);\n            SET_EXCEPTION_STATE_TRACEBACK(exception_state,\n                                          MAKE_TRACEBACK(frame, generator->m_code_object->co_firstlineno));\n            Py_DECREF(frame);\n        }\n\n        RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n        Nuitka_MarkGeneratorAsFinished(generator);\n\n        return NULL;\n    }\n}\n\nstatic PyObject *Nuitka_Generator_throw(struct Nuitka_GeneratorObject *generator, PyObject *args) {\n    PyObject *exception_type;\n    PyObject *exception_value = NULL;\n    PyTracebackObject *exception_tb = NULL;\n\n    // This takes no references, that is for us to do.\n    int res = PyArg_UnpackTuple(args, \"throw\", 1, 3, &exception_type, &exception_value, &exception_tb);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    // Handing ownership of exception over, we need not release it ourselves\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    SET_EXCEPTION_PRESERVATION_STATE_FROM_ARGS(&exception_state, exception_type, exception_value, exception_tb);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *result = _Nuitka_Generator_throw2(tstate, generator, &exception_state);\n\n    if (result == NULL) {\n        if (HAS_ERROR_OCCURRED(tstate) == false) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n    }\n\n#if _DEBUG_GENERATOR\n    PRINT_GENERATOR_STATUS(\"Leave\", generator);\n    PRINT_EXCEPTION(exception_type, exception_value, exception_tb);\n    PRINT_COROUTINE_VALUE(\"return value\", result);\n    PRINT_CURRENT_EXCEPTION();\n#endif\n\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x340\nstatic void Nuitka_Generator_tp_finalizer(struct Nuitka_GeneratorObject *generator) {\n    if (generator->m_status != status_Running) {\n        return;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    bool close_result = _Nuitka_Generator_close(tstate, generator);\n\n    if (unlikely(close_result == false)) {\n        PyErr_WriteUnraisable((PyObject *)generator);\n    }\n\n    // Restore the saved exception if any.\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n#endif\n\n#define MAX_GENERATOR_FREE_LIST_COUNT 100\nstatic struct Nuitka_GeneratorObject *free_list_generators = NULL;\nstatic int free_list_generators_count = 0;\n\nstatic void Nuitka_Generator_tp_dealloc(struct Nuitka_GeneratorObject *generator) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Generator_Type -= 1;\n    count_released_Nuitka_Generator_Type += 1;\n#endif\n\n    // Revive temporarily.\n    assert(Py_REFCNT(generator) == 0);\n    Py_SET_REFCNT(generator, 1);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // Save the current exception, if any, we must preserve it.\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    if (generator->m_status == status_Running) {\n        bool close_result = _Nuitka_Generator_close(tstate, generator);\n        CHECK_OBJECT(generator);\n\n        if (unlikely(close_result == false)) {\n            PyErr_WriteUnraisable((PyObject *)generator);\n        }\n    }\n\n    Nuitka_Generator_release_closure(generator);\n\n    // Allow for above code to resurrect the generator.\n    Py_SET_REFCNT(generator, Py_REFCNT(generator) - 1);\n    if (Py_REFCNT(generator) >= 1) {\n        return;\n    }\n\n    if (generator->m_frame != NULL) {\n#if PYTHON_VERSION >= 0x340\n        Nuitka_SetFrameGenerator(generator->m_frame, NULL);\n#endif\n        Py_DECREF(generator->m_frame);\n        generator->m_frame = NULL;\n    }\n\n    // Now it is safe to release references and memory for it.\n    Nuitka_GC_UnTrack(generator);\n\n    if (generator->m_weakrefs != NULL) {\n        PyObject_ClearWeakRefs((PyObject *)generator);\n        assert(!HAS_ERROR_OCCURRED(tstate));\n    }\n\n    Py_DECREF(generator->m_name);\n\n#if PYTHON_VERSION >= 0x350\n    Py_DECREF(generator->m_qualname);\n#endif\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_generators, generator, MAX_GENERATOR_FREE_LIST_COUNT);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\nstatic long Nuitka_Generator_tp_hash(struct Nuitka_GeneratorObject *generator) { return generator->m_counter; }\n\nstatic PyObject *Nuitka_Generator_get_name(struct Nuitka_GeneratorObject *generator) {\n    PyObject *result = generator->m_name;\n    Py_INCREF(result);\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x350\nstatic int Nuitka_Generator_set_name(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = generator->m_name;\n    Py_INCREF(value);\n    generator->m_name = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Generator_get_qualname(struct Nuitka_GeneratorObject *generator) {\n    PyObject *result = generator->m_qualname;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Generator_set_qualname(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n    // Cannot be deleted, not be non-unicode value.\n    if (unlikely((value == NULL) || !PyUnicode_Check(value))) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__qualname__ must be set to a string object\");\n        return -1;\n    }\n\n    PyObject *tmp = generator->m_qualname;\n    Py_INCREF(value);\n    generator->m_qualname = value;\n    Py_DECREF(tmp);\n\n    return 0;\n}\n\nstatic PyObject *Nuitka_Generator_get_yieldfrom(struct Nuitka_GeneratorObject *generator) {\n    if (generator->m_yield_from) {\n        Py_INCREF(generator->m_yield_from);\n        return generator->m_yield_from;\n    } else {\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n}\n\n#endif\n\nstatic PyObject *Nuitka_Generator_get_code(struct Nuitka_GeneratorObject *generator) {\n    PyObject *result = (PyObject *)generator->m_code_object;\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Generator_set_code(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"gi_code is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Generator_get_frame(struct Nuitka_GeneratorObject *generator) {\n    PyObject *result;\n\n    if (generator->m_frame) {\n        result = (PyObject *)generator->m_frame;\n    } else {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic int Nuitka_Generator_set_frame(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"gi_frame is not writable in Nuitka\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_Generator_get_running(struct Nuitka_GeneratorObject *generator) {\n    PyObject *result;\n\n/* The type of \"gi_running\" changed in Python3. */\n#if PYTHON_VERSION < 0x300\n    result = PyInt_FromLong(generator->m_running);\n#else\n    result = BOOL_FROM(generator->m_running != 0);\n    Py_INCREF(result);\n#endif\n    return result;\n}\n\nstatic int Nuitka_Generator_set_running(struct Nuitka_GeneratorObject *generator, PyObject *value) {\n#if PYTHON_VERSION < 0x300\n    PyObject *exception_type = PyExc_TypeError;\n#else\n    PyObject *exception_type = PyExc_AttributeError;\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#if !defined(_NUITKA_FULL_COMPAT) || PYTHON_VERSION >= 0x3a0\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, exception_type,\n                                    \"attribute 'gi_running' of 'generator' objects is not writable\");\n#else\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, exception_type, \"readonly attribute\");\n#endif\n    return -1;\n}\n\nstatic PyGetSetDef Nuitka_Generator_getsetlist[] = {\n#if PYTHON_VERSION < 0x350\n    {(char *)\"__name__\", (getter)Nuitka_Generator_get_name, NULL, NULL},\n#else\n    {(char *)\"__name__\", (getter)Nuitka_Generator_get_name, (setter)Nuitka_Generator_set_name, NULL},\n    {(char *)\"__qualname__\", (getter)Nuitka_Generator_get_qualname, (setter)Nuitka_Generator_set_qualname, NULL},\n    {(char *)\"gi_yieldfrom\", (getter)Nuitka_Generator_get_yieldfrom, NULL, NULL},\n#endif\n    {(char *)\"gi_code\", (getter)Nuitka_Generator_get_code, (setter)Nuitka_Generator_set_code, NULL},\n    {(char *)\"gi_frame\", (getter)Nuitka_Generator_get_frame, (setter)Nuitka_Generator_set_frame, NULL},\n    {(char *)\"gi_running\", (getter)Nuitka_Generator_get_running, (setter)Nuitka_Generator_set_running, NULL},\n\n    {NULL}};\n\nstatic PyMethodDef Nuitka_Generator_methods[] = {{\"send\", (PyCFunction)Nuitka_Generator_send, METH_O, NULL},\n                                                 {\"throw\", (PyCFunction)Nuitka_Generator_throw, METH_VARARGS, NULL},\n                                                 {\"close\", (PyCFunction)Nuitka_Generator_close, METH_NOARGS, NULL},\n                                                 {NULL}};\n\n// This is only used.\n#if PYTHON_VERSION >= 0x3a0\nstatic PyAsyncMethods Nuitka_Generator_as_async = {\n    NULL, /* am_await */\n    NULL, /* am_aiter */\n    NULL, /* am_anext */\n    // TODO: have this too, (sendfunc)_Nuitka_Generator_am_send\n    NULL /* am_send */\n};\n#endif\n\nPyTypeObject Nuitka_Generator_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_generator\", // tp_name\n    sizeof(struct Nuitka_GeneratorObject),               // tp_basicsize\n    sizeof(struct Nuitka_CellObject *),                  // tp_itemsize\n    (destructor)Nuitka_Generator_tp_dealloc,             // tp_dealloc\n    0,                                                   // tp_print\n    0,                                                   // tp_getattr\n    0,                                                   // tp_setattr\n#if PYTHON_VERSION < 0x3a0\n    0, // tp_as_async\n#else\n    &Nuitka_Generator_as_async, // tp_as_async\n#endif\n    (reprfunc)Nuitka_Generator_tp_repr, // tp_repr\n    0,                                  // tp_as_number\n    0,                                  // tp_as_sequence\n    0,                                  // tp_as_mapping\n    (hashfunc)Nuitka_Generator_tp_hash, // tp_hash\n    0,                                  // tp_call\n    0,                                  // tp_str\n    0,                                  // tp_getattro (PyObject_GenericGetAttr)\n    0,                                  // tp_setattro\n    0,                                  // tp_as_buffer\n#if PYTHON_VERSION < 0x340\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,\n#else\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,\n#endif\n    // tp_flags\n    0,                                                   // tp_doc\n    (traverseproc)Nuitka_Generator_tp_traverse,          // tp_traverse\n    0,                                                   // tp_clear\n    0,                                                   // tp_richcompare\n    offsetof(struct Nuitka_GeneratorObject, m_weakrefs), // tp_weaklistoffset\n    0,                                                   // tp_iter (PyObject_SelfIter)\n    (iternextfunc)Nuitka_Generator_tp_iternext,          // tp_iternext\n    Nuitka_Generator_methods,                            // tp_methods\n    NULL,                                                // tp_members\n    Nuitka_Generator_getsetlist,                         // tp_getset\n    0,                                                   // tp_base\n    0,                                                   // tp_dict\n    0,                                                   // tp_descr_get\n    0,                                                   // tp_descr_set\n    0,                                                   // tp_dictoffset\n    0,                                                   // tp_init\n    0,                                                   // tp_alloc\n    0,                                                   // tp_new\n    0,                                                   // tp_free\n    0,                                                   // tp_is_gc\n    0,                                                   // tp_bases\n    0,                                                   // tp_mro\n    0,                                                   // tp_cache\n    0,                                                   // tp_subclasses\n    0,                                                   // tp_weaklist\n    0,                                                   // tp_del\n    0                                                    // tp_version_tag\n#if PYTHON_VERSION >= 0x340\n    ,\n    (destructor)Nuitka_Generator_tp_finalizer // tp_finalize\n#endif\n};\n\n#if PYTHON_VERSION >= 0x350\nstatic void _initCompiledCoroutineTypes();\n#endif\n#if PYTHON_VERSION >= 0x360\nstatic void _initCompiledAsyncgenTypes();\n#endif\n\nvoid _initCompiledGeneratorType(void) {\n    Nuitka_PyType_Ready(&Nuitka_Generator_Type, &PyGen_Type, true, false, true, false, false);\n\n    // Be a paranoid subtype of uncompiled function, we want nothing shared.\n    assert(Nuitka_Generator_Type.tp_doc != PyGen_Type.tp_doc || PyGen_Type.tp_doc == NULL);\n    assert(Nuitka_Generator_Type.tp_traverse != PyGen_Type.tp_traverse);\n    assert(Nuitka_Generator_Type.tp_clear != PyGen_Type.tp_clear || PyGen_Type.tp_clear == NULL);\n    assert(Nuitka_Generator_Type.tp_richcompare != PyGen_Type.tp_richcompare || PyGen_Type.tp_richcompare == NULL);\n    assert(Nuitka_Generator_Type.tp_iter != PyGen_Type.tp_iter || PyGen_Type.tp_iter == PyObject_SelfIter);\n    assert(Nuitka_Generator_Type.tp_iternext != PyGen_Type.tp_iternext || PyGen_Type.tp_iternext == NULL);\n#if PYTHON_VERSION >= 0x350\n    assert(Nuitka_Generator_Type.tp_as_async != PyGen_Type.tp_as_async || PyGen_Type.tp_as_async == NULL);\n#endif\n    assert(Nuitka_Generator_Type.tp_methods != PyGen_Type.tp_methods);\n    assert(Nuitka_Generator_Type.tp_members != PyGen_Type.tp_members);\n    assert(Nuitka_Generator_Type.tp_getset != PyGen_Type.tp_getset);\n    assert(Nuitka_Generator_Type.tp_base != PyGen_Type.tp_base);\n    assert(Nuitka_Generator_Type.tp_dict != PyGen_Type.tp_dict);\n    assert(Nuitka_Generator_Type.tp_descr_get != PyGen_Type.tp_descr_get || PyGen_Type.tp_descr_get == NULL);\n\n    assert(Nuitka_Generator_Type.tp_descr_set != PyGen_Type.tp_descr_set || PyGen_Type.tp_descr_set == NULL);\n    assert(Nuitka_Generator_Type.tp_dictoffset != PyGen_Type.tp_dictoffset || PyGen_Type.tp_dictoffset == 0);\n    // TODO: These get changed and into the same thing, not sure what to compare against, project something\n    // assert(Nuitka_Generator_Type.tp_init != PyGen_Type.tp_init || PyGen_Type.tp_init == NULL);\n    // assert(Nuitka_Generator_Type.tp_alloc != PyGen_Type.tp_alloc || PyGen_Type.tp_alloc == NULL);\n    // assert(Nuitka_Generator_Type.tp_new != PyGen_Type.tp_new || PyGen_Type.tp_new == NULL);\n    // assert(Nuitka_Generator_Type.tp_free != PyGen_Type.tp_free || PyGen_Type.tp_free == NULL);\n    assert(Nuitka_Generator_Type.tp_bases != PyGen_Type.tp_bases);\n    assert(Nuitka_Generator_Type.tp_mro != PyGen_Type.tp_mro);\n    assert(Nuitka_Generator_Type.tp_cache != PyGen_Type.tp_cache || PyGen_Type.tp_cache == NULL);\n    assert(Nuitka_Generator_Type.tp_subclasses != PyGen_Type.tp_subclasses || PyGen_Type.tp_cache == NULL);\n    assert(Nuitka_Generator_Type.tp_weaklist != PyGen_Type.tp_weaklist);\n    assert(Nuitka_Generator_Type.tp_del != PyGen_Type.tp_del || PyGen_Type.tp_del == NULL);\n#if PYTHON_VERSION >= 0x340\n    assert(Nuitka_Generator_Type.tp_finalize != PyGen_Type.tp_finalize || PyGen_Type.tp_finalize == NULL);\n#endif\n\n#if PYTHON_VERSION >= 0x350\n    // Also initialize coroutines if necessary\n    _initCompiledCoroutineTypes();\n#endif\n\n#if PYTHON_VERSION >= 0x360\n    // Also initialize asyncgen if necessary\n    _initCompiledAsyncgenTypes();\n#endif\n}\n\nPyObject *Nuitka_Generator_New(generator_code code, PyObject *module, PyObject *name,\n#if PYTHON_VERSION >= 0x350\n                               PyObject *qualname,\n#endif\n                               PyCodeObject *code_object, struct Nuitka_CellObject **closure, Py_ssize_t closure_given,\n                               Py_ssize_t heap_storage_size) {\n#if _DEBUG_REFCOUNTS\n    count_active_Nuitka_Generator_Type += 1;\n    count_allocated_Nuitka_Generator_Type += 1;\n#endif\n\n    struct Nuitka_GeneratorObject *result;\n\n    // TODO: Change the var part of the type to 1 maybe\n    Py_ssize_t full_size = closure_given + (heap_storage_size + sizeof(void *) - 1) / sizeof(void *);\n\n    // Macro to assign result memory from GC or free list.\n    allocateFromFreeList(free_list_generators, struct Nuitka_GeneratorObject, Nuitka_Generator_Type, full_size);\n\n    // For quicker access of generator heap.\n    result->m_heap_storage = &result->m_closure[closure_given];\n\n    assert(result != NULL);\n    CHECK_OBJECT(result);\n\n    assert(Py_SIZE(result) >= closure_given);\n\n    result->m_code = (void *)code;\n\n    CHECK_OBJECT(module);\n    result->m_module = module;\n\n    CHECK_OBJECT(name);\n    result->m_name = name;\n    Py_INCREF(name);\n\n#if PYTHON_VERSION >= 0x350\n    // The \"qualname\" defaults to NULL for most compact C code.\n    if (qualname == NULL) {\n        qualname = name;\n    }\n    CHECK_OBJECT(qualname);\n\n    result->m_qualname = qualname;\n    Py_INCREF(qualname);\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    result->m_yield_from = NULL;\n#endif\n\n    memcpy(&result->m_closure[0], closure, closure_given * sizeof(struct Nuitka_CellObject *));\n    result->m_closure_given = closure_given;\n\n    result->m_weakrefs = NULL;\n\n    result->m_status = status_Unused;\n    result->m_running = 0;\n\n    result->m_yield_return_index = 0;\n\n#if PYTHON_VERSION >= 0x300\n    result->m_returned = NULL;\n#endif\n\n    result->m_frame = NULL;\n    result->m_code_object = code_object;\n\n#if PYTHON_VERSION >= 0x370\n    result->m_exc_state = Nuitka_ExceptionStackItem_Empty;\n#endif\n\n    static long Nuitka_Generator_counter = 0;\n    result->m_counter = Nuitka_Generator_counter++;\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\nstatic PyObject *_EMPTY_GENERATOR_CONTEXT(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator,\n                                          PyObject *yield_return_value) {\n    return NULL;\n}\n\nPyObject *Nuitka_Generator_NewEmpty(PyObject *module, PyObject *name,\n#if PYTHON_VERSION >= 0x350\n                                    PyObject *qualname,\n#endif\n                                    PyCodeObject *code_object, struct Nuitka_CellObject **closure,\n                                    Py_ssize_t closure_given) {\n    return Nuitka_Generator_New(_EMPTY_GENERATOR_CONTEXT, module, name,\n#if PYTHON_VERSION >= 0x350\n                                qualname,\n#endif\n                                code_object, closure, closure_given, 0);\n}\n\n// Chain coroutine code to generator code, as it uses same functions, and then we can\n// have some things static if both are in the same compilation unit. This also loads\n// the asyncgen for 3.6 and higher.\n#if PYTHON_VERSION >= 0x350\n#include \"CompiledCoroutineType.c\"\n#endif\n\n// Chain frames to generator and asyncgen code, as they need to close them with access\n// to best functions.\n#include \"CompiledFrameType.c\"\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Uncompiled generator integration\n *\n * This is for use in compiled generator, coroutine, async types. The file in\n * included for compiled generator, and in part exports functions as necessary.\n *\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#ifdef PY_NOGIL\n#define Py_BUILD_CORE\n#include \"internal/pycore_generator.h\"\n#undef Py_BUILD_CORE\n#endif\n\nstatic PyObject *Nuitka_CallGeneratorThrowMethod(PyObject *throw_method,\n                                                 struct Nuitka_ExceptionPreservationItem *exception_state);\n// This function takes no reference to value, and publishes a StopIteration\n// exception with it.\n#if PYTHON_VERSION >= 0x300\nstatic void Nuitka_SetStopIterationValue(PyThreadState *tstate, PyObject *value) {\n    CHECK_OBJECT(value);\n\n#if PYTHON_VERSION <= 0x352\n    PyObject *stop_value = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, PyExc_StopIteration, value);\n\n    if (unlikely(stop_value == NULL)) {\n        return;\n    }\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_StopIteration, stop_value);\n#else\n    if (likely(!PyTuple_Check(value) && !PyExceptionInstance_Check(value))) {\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_StopIteration, value);\n    } else {\n        PyObject *stop_value = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, PyExc_StopIteration, value);\n\n        if (unlikely(stop_value == NULL)) {\n            return;\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_StopIteration, stop_value);\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x370\nstatic inline void Nuitka_PyGen_exc_state_clear(_PyErr_StackItem *exc_state) {\n#if PYTHON_VERSION < 0x3b0\n    PyObject *t = exc_state->exc_type;\n#endif\n    PyObject *v = exc_state->exc_value;\n#if PYTHON_VERSION < 0x3b0\n    PyObject *tb = exc_state->exc_traceback;\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    exc_state->exc_type = NULL;\n#endif\n    exc_state->exc_value = NULL;\n#if PYTHON_VERSION < 0x3b0\n    exc_state->exc_traceback = NULL;\n#endif\n\n#if PYTHON_VERSION < 0x3b0\n    Py_XDECREF(t);\n#endif\n    Py_XDECREF(v);\n#if PYTHON_VERSION < 0x3b0\n    Py_XDECREF(tb);\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n\n#if PYTHON_VERSION < 0x3b0\nstatic inline bool Nuitka_PyFrameHasCompleted(PyFrameObject *const frame) {\n#if PYTHON_VERSION < 0x3a0\n    return frame->f_stacktop == NULL;\n#else\n    return frame->f_state > FRAME_EXECUTING;\n#endif\n}\n#endif\n\n// This is for CPython iterator objects, the respective code is not exported as\n// API, so we need to redo it. This is an re-implementation that closely follows\n// what it does. It's unrelated to compiled generators, and used from coroutines\n// and asyncgen to interact with them.\nstatic PyObject *Nuitka_PyGen_Send(PyThreadState *tstate, PyGenObject *gen, PyObject *arg) {\n#if defined(PY_NOGIL)\n    PyObject *res;\n\n    if (gen->status == GEN_CREATED) {\n        if (unlikely(arg != Py_None)) {\n            char const *msg = \"generator raised StopIteration\";\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"coroutine raised StopIteration\";\n            } else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"async generator raised StopIteration\";\n            }\n\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n            return NULL;\n        }\n        arg = NULL;\n    }\n\n    res = PyEval2_EvalGen(gen, arg);\n\n    if (likely(res != NULL)) {\n        assert(gen->status == GEN_SUSPENDED);\n        return res;\n    }\n\n    if (likely(gen->return_value == Py_None)) {\n        gen->return_value = NULL;\n        SET_CURRENT_EXCEPTION_TYPE0(tstate,\n                                    PyAsyncGen_CheckExact(gen) ? PyExc_StopAsyncIteration : PyExc_StopIteration);\n        return NULL;\n    } else if (gen->return_value != NULL) {\n        Nuitka_SetStopIterationValue(tstate, gen->return_value);\n        return NULL;\n    } else {\n        return gen_wrap_exception(gen);\n    }\n#elif PYTHON_VERSION >= 0x3a0\n    PyObject *result;\n\n    PySendResult res = PyIter_Send((PyObject *)gen, arg, &result);\n\n    switch (res) {\n    case PYGEN_RETURN:\n        if (result == NULL) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        } else {\n            if (result != Py_None) {\n                Nuitka_SetStopIterationValue(tstate, result);\n            }\n\n            Py_DECREF(result);\n        }\n\n        return NULL;\n    case PYGEN_NEXT:\n        return result;\n    case PYGEN_ERROR:\n        return NULL;\n    default:\n        NUITKA_CANNOT_GET_HERE(\"invalid PYGEN_ result\");\n    }\n#else\n\n    PyFrameObject *f = gen->gi_frame;\n\n#if PYTHON_VERSION >= 0x3b0\n    if (gen->gi_frame_state == FRAME_EXECUTING) {\n#elif PYTHON_VERSION >= 0x3a0\n    if (f != NULL && _PyFrame_IsExecuting(f)) {\n#else\n    if (unlikely(gen->gi_running)) {\n#endif\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"generator already executing\");\n        return NULL;\n    }\n\n#if PYTHON_VERSION < 0x3b0\n    if (f == NULL || Nuitka_PyFrameHasCompleted(f)) {\n#else\n    if (gen->gi_frame_state >= FRAME_COMPLETED) {\n#endif\n        // Set exception if called from send()\n        if (arg != NULL) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        }\n\n        return NULL;\n    }\n\n#if PYTHON_VERSION < 0x3a0\n    if (f->f_lasti == -1) {\n        if (unlikely(arg && arg != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                            \"can't send non-None value to a just-started generator\");\n\n            return NULL;\n        }\n    } else {\n        // Put arg on top of the value stack\n        PyObject *tmp = arg ? arg : Py_None;\n\n        Py_INCREF(tmp);\n        *(f->f_stacktop++) = tmp;\n    }\n#else\n    // CPython assertions, check them\n    assert(_PyFrame_IsRunnable(f));\n    assert(f->f_lasti >= 0 || ((unsigned char *)PyBytes_AS_STRING(f->f_code->co_code))[0] == 129);\n\n    PyObject *gen_result = arg ? arg : Py_None;\n    Py_INCREF(gen_result);\n    gen->gi_frame->f_valuestack[gen->gi_frame->f_stackdepth] = gen_result;\n    gen->gi_frame->f_stackdepth++;\n#endif\n\n    // Generators always return to their most recent caller, not necessarily\n    // their creator.\n    tstate = PyThreadState_GET();\n    Py_XINCREF(tstate->frame);\n\n    f->f_back = tstate->frame;\n\n#if PYTHON_VERSION < 0x3a0\n    gen->gi_running = 1;\n#endif\n#if PYTHON_VERSION >= 0x370\n    gen->gi_exc_state.previous_item = tstate->exc_info;\n    tstate->exc_info = &gen->gi_exc_state;\n#endif\n\n#if PYTHON_VERSION < 0x390\n    PyObject *result = PyEval_EvalFrameEx(f, 0);\n#else\n    PyObject *result = _PyEval_EvalFrame(tstate, f, 0);\n#endif\n\n#if PYTHON_VERSION >= 0x370\n    tstate->exc_info = gen->gi_exc_state.previous_item;\n    gen->gi_exc_state.previous_item = NULL;\n#endif\n#if PYTHON_VERSION < 0x3a0\n    gen->gi_running = 0;\n#endif\n\n    // Don't keep the reference to f_back any longer than necessary.  It\n    // may keep a chain of frames alive or it could create a reference\n    // cycle.\n    Py_CLEAR(f->f_back);\n\n    // If the generator just returned (as opposed to yielding), signal that the\n    // generator is exhausted.\n#if PYTHON_VERSION < 0x3a0\n    if (result && f->f_stacktop == NULL) {\n        if (result == Py_None) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        } else {\n            PyObject *e = PyObject_CallFunctionObjArgs(PyExc_StopIteration, result, NULL);\n\n            if (e != NULL) {\n                SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_StopIteration, e);\n            }\n        }\n\n        Py_CLEAR(result);\n    }\n\n    if (result == NULL || f->f_stacktop == NULL) {\n#if PYTHON_VERSION < 0x370\n        // Generator is finished, remove exception from frame before releasing\n        // it.\n        PyObject *type = f->f_exc_type;\n        PyObject *value = f->f_exc_value;\n        PyObject *traceback = f->f_exc_traceback;\n        f->f_exc_type = NULL;\n        f->f_exc_value = NULL;\n        f->f_exc_traceback = NULL;\n        Py_XDECREF(type);\n        Py_XDECREF(value);\n        Py_XDECREF(traceback);\n#else\n        Nuitka_PyGen_exc_state_clear(&gen->gi_exc_state);\n#endif\n\n        // Now release frame.\n#if PYTHON_VERSION >= 0x340\n        gen->gi_frame->f_gen = NULL;\n#endif\n        gen->gi_frame = NULL;\n        Py_DECREF(f);\n    }\n#else\n    if (result) {\n        if (!_PyFrameHasCompleted(f)) {\n            return result;\n        }\n        assert(result == Py_None || !PyAsyncGen_CheckExact(gen));\n\n        if (result == Py_None && !PyAsyncGen_CheckExact(gen)) {\n            Py_DECREF(result);\n            result = NULL;\n        }\n    } else {\n        if (PyErr_ExceptionMatches(PyExc_StopIteration)) {\n            const char *msg = \"generator raised StopIteration\";\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"coroutine raised StopIteration\";\n            } else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"async generator raised StopIteration\";\n            }\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        } else if (PyAsyncGen_CheckExact(gen) && PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) {\n            const char *msg = \"async generator raised StopAsyncIteration\";\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        }\n\n        result = NULL;\n    }\n\n    Nuitka_PyGen_exc_state_clear(&gen->gi_exc_state);\n\n    gen->gi_frame->f_gen = NULL;\n    gen->gi_frame = NULL;\n\n    Py_DECREF(f);\n\n#endif\n\n    return result;\n#endif\n}\n\n#endif\n\n// TODO: Disabled for NOGIL until it becomes more ready.\n// Not done for earlier versions yet, indicate usability for compiled\n// generators, but it seems that mostly coroutines need it anyway, so the\n// benefit would be only for performance and not by a lot.\n#if PYTHON_VERSION >= 0x340 && !defined(PY_NOGIL)\n#define NUITKA_UNCOMPILED_THROW_INTEGRATION 1\n#endif\n\n// TODO: Disabled for Python3.12 until release of it\n#if PYTHON_VERSION >= 0x3c0\n#undef NUITKA_UNCOMPILED_THROW_INTEGRATION\n#define NUITKA_UNCOMPILED_THROW_INTEGRATION 0\n#endif\n\n#if NUITKA_UNCOMPILED_THROW_INTEGRATION\n\nstatic bool _Nuitka_Generator_check_throw2(PyThreadState *tstate,\n                                           struct Nuitka_ExceptionPreservationItem *exception_state);\n\n#if PYTHON_VERSION < 0x3b0\n#include <opcode.h>\n// Clashes with our helper names.\n#undef CALL_FUNCTION\n#endif\n\nstatic PyObject *Nuitka_PyGen_gen_close(PyThreadState *tstate, PyGenObject *gen, PyObject *args);\nstatic int Nuitka_PyGen_gen_close_iter(PyThreadState *tstate, PyObject *yf);\n\n// Restarting with 3.11, because the structures and internal API have\n// changed so much, makes no sense to keep it in one code. For older\n// versions, the else branch is there.\n#if PYTHON_VERSION >= 0x3b0\n\n// Private opcode mapping, that we need too\n// spell-checker: ignore deopt,subscr,isinstance,getitem,noargs,aiter,anext\n// spell-checker: ignore classderef,getattribute,precall\nconst uint8_t Nuitka_PyOpcode_Deopt[256] = {\n#if PYTHON_VERSION >= 0x3c0\n    [ASYNC_GEN_WRAP] = ASYNC_GEN_WRAP,\n    [BEFORE_ASYNC_WITH] = BEFORE_ASYNC_WITH,\n    [BEFORE_WITH] = BEFORE_WITH,\n    [BINARY_OP] = BINARY_OP,\n    [BINARY_OP_ADAPTIVE] = BINARY_OP,\n    [BINARY_OP_ADD_FLOAT] = BINARY_OP,\n    [BINARY_OP_ADD_INT] = BINARY_OP,\n    [BINARY_OP_ADD_UNICODE] = BINARY_OP,\n    [BINARY_OP_INPLACE_ADD_UNICODE] = BINARY_OP,\n    [BINARY_OP_MULTIPLY_FLOAT] = BINARY_OP,\n    [BINARY_OP_MULTIPLY_INT] = BINARY_OP,\n    [BINARY_OP_SUBTRACT_FLOAT] = BINARY_OP,\n    [BINARY_OP_SUBTRACT_INT] = BINARY_OP,\n    [BINARY_SLICE] = BINARY_SLICE,\n    [BINARY_SUBSCR] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_ADAPTIVE] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_DICT] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_GETITEM] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_LIST_INT] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_TUPLE_INT] = BINARY_SUBSCR,\n    [BUILD_CONST_KEY_MAP] = BUILD_CONST_KEY_MAP,\n    [BUILD_LIST] = BUILD_LIST,\n    [BUILD_MAP] = BUILD_MAP,\n    [BUILD_SET] = BUILD_SET,\n    [BUILD_SLICE] = BUILD_SLICE,\n    [BUILD_STRING] = BUILD_STRING,\n    [BUILD_TUPLE] = BUILD_TUPLE,\n    [CACHE] = CACHE,\n    [CALL] = CALL,\n    [CALL_ADAPTIVE] = CALL,\n    [CALL_BOUND_METHOD_EXACT_ARGS] = CALL,\n    [CALL_BUILTIN_CLASS] = CALL,\n    [CALL_BUILTIN_FAST_WITH_KEYWORDS] = CALL,\n    [CALL_FUNCTION_EX] = CALL_FUNCTION_EX,\n    [CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = CALL,\n    [CALL_NO_KW_BUILTIN_FAST] = CALL,\n    [CALL_NO_KW_BUILTIN_O] = CALL,\n    [CALL_NO_KW_ISINSTANCE] = CALL,\n    [CALL_NO_KW_LEN] = CALL,\n    [CALL_NO_KW_LIST_APPEND] = CALL,\n    [CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = CALL,\n    [CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = CALL,\n    [CALL_NO_KW_METHOD_DESCRIPTOR_O] = CALL,\n    [CALL_NO_KW_STR_1] = CALL,\n    [CALL_NO_KW_TUPLE_1] = CALL,\n    [CALL_NO_KW_TYPE_1] = CALL,\n    [CALL_PY_EXACT_ARGS] = CALL,\n    [CALL_PY_WITH_DEFAULTS] = CALL,\n    [CHECK_EG_MATCH] = CHECK_EG_MATCH,\n    [CHECK_EXC_MATCH] = CHECK_EXC_MATCH,\n    [CLEANUP_THROW] = CLEANUP_THROW,\n    [COMPARE_OP] = COMPARE_OP,\n    [COMPARE_OP_ADAPTIVE] = COMPARE_OP,\n    [COMPARE_OP_FLOAT_JUMP] = COMPARE_OP,\n    [COMPARE_OP_INT_JUMP] = COMPARE_OP,\n    [COMPARE_OP_STR_JUMP] = COMPARE_OP,\n    [CONTAINS_OP] = CONTAINS_OP,\n    [COPY] = COPY,\n    [COPY_FREE_VARS] = COPY_FREE_VARS,\n    [DELETE_ATTR] = DELETE_ATTR,\n    [DELETE_DEREF] = DELETE_DEREF,\n    [DELETE_FAST] = DELETE_FAST,\n    [DELETE_GLOBAL] = DELETE_GLOBAL,\n    [DELETE_NAME] = DELETE_NAME,\n    [DELETE_SUBSCR] = DELETE_SUBSCR,\n    [DICT_MERGE] = DICT_MERGE,\n    [DICT_UPDATE] = DICT_UPDATE,\n    [END_ASYNC_FOR] = END_ASYNC_FOR,\n    [EXTENDED_ARG] = EXTENDED_ARG,\n    [EXTENDED_ARG_QUICK] = EXTENDED_ARG,\n    [FORMAT_VALUE] = FORMAT_VALUE,\n    [FOR_ITER] = FOR_ITER,\n    [FOR_ITER_ADAPTIVE] = FOR_ITER,\n    [FOR_ITER_LIST] = FOR_ITER,\n    [FOR_ITER_RANGE] = FOR_ITER,\n    [GET_AITER] = GET_AITER,\n    [GET_ANEXT] = GET_ANEXT,\n    [GET_AWAITABLE] = GET_AWAITABLE,\n    [GET_ITER] = GET_ITER,\n    [GET_LEN] = GET_LEN,\n    [GET_YIELD_FROM_ITER] = GET_YIELD_FROM_ITER,\n    [IMPORT_FROM] = IMPORT_FROM,\n    [IMPORT_NAME] = IMPORT_NAME,\n    [IMPORT_STAR] = IMPORT_STAR,\n    [IS_OP] = IS_OP,\n    [JUMP_BACKWARD] = JUMP_BACKWARD,\n    [JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT,\n    [JUMP_BACKWARD_QUICK] = JUMP_BACKWARD,\n    [JUMP_FORWARD] = JUMP_FORWARD,\n    [JUMP_IF_FALSE_OR_POP] = JUMP_IF_FALSE_OR_POP,\n    [JUMP_IF_TRUE_OR_POP] = JUMP_IF_TRUE_OR_POP,\n    [KW_NAMES] = KW_NAMES,\n    [LIST_APPEND] = LIST_APPEND,\n    [LIST_EXTEND] = LIST_EXTEND,\n    [LIST_TO_TUPLE] = LIST_TO_TUPLE,\n    [LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR,\n    [LOAD_ATTR] = LOAD_ATTR,\n    [LOAD_ATTR_ADAPTIVE] = LOAD_ATTR,\n    [LOAD_ATTR_CLASS] = LOAD_ATTR,\n    [LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = LOAD_ATTR,\n    [LOAD_ATTR_INSTANCE_VALUE] = LOAD_ATTR,\n    [LOAD_ATTR_METHOD_LAZY_DICT] = LOAD_ATTR,\n    [LOAD_ATTR_METHOD_NO_DICT] = LOAD_ATTR,\n    [LOAD_ATTR_METHOD_WITH_DICT] = LOAD_ATTR,\n    [LOAD_ATTR_METHOD_WITH_VALUES] = LOAD_ATTR,\n    [LOAD_ATTR_MODULE] = LOAD_ATTR,\n    [LOAD_ATTR_PROPERTY] = LOAD_ATTR,\n    [LOAD_ATTR_SLOT] = LOAD_ATTR,\n    [LOAD_ATTR_WITH_HINT] = LOAD_ATTR,\n    [LOAD_BUILD_CLASS] = LOAD_BUILD_CLASS,\n    [LOAD_CLASSDEREF] = LOAD_CLASSDEREF,\n    [LOAD_CLOSURE] = LOAD_CLOSURE,\n    [LOAD_CONST] = LOAD_CONST,\n    [LOAD_CONST__LOAD_FAST] = LOAD_CONST,\n    [LOAD_DEREF] = LOAD_DEREF,\n    [LOAD_FAST] = LOAD_FAST,\n    [LOAD_FAST_CHECK] = LOAD_FAST_CHECK,\n    [LOAD_FAST__LOAD_CONST] = LOAD_FAST,\n    [LOAD_FAST__LOAD_FAST] = LOAD_FAST,\n    [LOAD_GLOBAL] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_ADAPTIVE] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_BUILTIN] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_MODULE] = LOAD_GLOBAL,\n    [LOAD_NAME] = LOAD_NAME,\n    [MAKE_CELL] = MAKE_CELL,\n    [MAKE_FUNCTION] = MAKE_FUNCTION,\n    [MAP_ADD] = MAP_ADD,\n    [MATCH_CLASS] = MATCH_CLASS,\n    [MATCH_KEYS] = MATCH_KEYS,\n    [MATCH_MAPPING] = MATCH_MAPPING,\n    [MATCH_SEQUENCE] = MATCH_SEQUENCE,\n    [NOP] = NOP,\n    [POP_EXCEPT] = POP_EXCEPT,\n    [POP_JUMP_IF_FALSE] = POP_JUMP_IF_FALSE,\n    [POP_JUMP_IF_NONE] = POP_JUMP_IF_NONE,\n    [POP_JUMP_IF_NOT_NONE] = POP_JUMP_IF_NOT_NONE,\n    [POP_JUMP_IF_TRUE] = POP_JUMP_IF_TRUE,\n    [POP_TOP] = POP_TOP,\n    [PREP_RERAISE_STAR] = PREP_RERAISE_STAR,\n    [PRINT_EXPR] = PRINT_EXPR,\n    [PUSH_EXC_INFO] = PUSH_EXC_INFO,\n    [PUSH_NULL] = PUSH_NULL,\n    [RAISE_VARARGS] = RAISE_VARARGS,\n    [RERAISE] = RERAISE,\n    [RESUME] = RESUME,\n    [RESUME_QUICK] = RESUME,\n    [RETURN_GENERATOR] = RETURN_GENERATOR,\n    [RETURN_VALUE] = RETURN_VALUE,\n    [SEND] = SEND,\n    [SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS,\n    [SET_ADD] = SET_ADD,\n    [SET_UPDATE] = SET_UPDATE,\n    [STORE_ATTR] = STORE_ATTR,\n    [STORE_ATTR_ADAPTIVE] = STORE_ATTR,\n    [STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR,\n    [STORE_ATTR_SLOT] = STORE_ATTR,\n    [STORE_ATTR_WITH_HINT] = STORE_ATTR,\n    [STORE_DEREF] = STORE_DEREF,\n    [STORE_FAST] = STORE_FAST,\n    [STORE_FAST__LOAD_FAST] = STORE_FAST,\n    [STORE_FAST__STORE_FAST] = STORE_FAST,\n    [STORE_GLOBAL] = STORE_GLOBAL,\n    [STORE_NAME] = STORE_NAME,\n    [STORE_SLICE] = STORE_SLICE,\n    [STORE_SUBSCR] = STORE_SUBSCR,\n    [STORE_SUBSCR_ADAPTIVE] = STORE_SUBSCR,\n    [STORE_SUBSCR_DICT] = STORE_SUBSCR,\n    [STORE_SUBSCR_LIST_INT] = STORE_SUBSCR,\n    [SWAP] = SWAP,\n    [UNARY_INVERT] = UNARY_INVERT,\n    [UNARY_NEGATIVE] = UNARY_NEGATIVE,\n    [UNARY_NOT] = UNARY_NOT,\n    [UNARY_POSITIVE] = UNARY_POSITIVE,\n    [UNPACK_EX] = UNPACK_EX,\n    [UNPACK_SEQUENCE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_ADAPTIVE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_LIST] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_TUPLE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_TWO_TUPLE] = UNPACK_SEQUENCE,\n    [WITH_EXCEPT_START] = WITH_EXCEPT_START,\n    [YIELD_VALUE] = YIELD_VALUE,\n#else\n    [ASYNC_GEN_WRAP] = ASYNC_GEN_WRAP,\n    [BEFORE_ASYNC_WITH] = BEFORE_ASYNC_WITH,\n    [BEFORE_WITH] = BEFORE_WITH,\n    [BINARY_OP] = BINARY_OP,\n    [BINARY_OP_ADAPTIVE] = BINARY_OP,\n    [BINARY_OP_ADD_FLOAT] = BINARY_OP,\n    [BINARY_OP_ADD_INT] = BINARY_OP,\n    [BINARY_OP_ADD_UNICODE] = BINARY_OP,\n    [BINARY_OP_INPLACE_ADD_UNICODE] = BINARY_OP,\n    [BINARY_OP_MULTIPLY_FLOAT] = BINARY_OP,\n    [BINARY_OP_MULTIPLY_INT] = BINARY_OP,\n    [BINARY_OP_SUBTRACT_FLOAT] = BINARY_OP,\n    [BINARY_OP_SUBTRACT_INT] = BINARY_OP,\n    [BINARY_SUBSCR] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_ADAPTIVE] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_DICT] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_GETITEM] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_LIST_INT] = BINARY_SUBSCR,\n    [BINARY_SUBSCR_TUPLE_INT] = BINARY_SUBSCR,\n    [BUILD_CONST_KEY_MAP] = BUILD_CONST_KEY_MAP,\n    [BUILD_LIST] = BUILD_LIST,\n    [BUILD_MAP] = BUILD_MAP,\n    [BUILD_SET] = BUILD_SET,\n    [BUILD_SLICE] = BUILD_SLICE,\n    [BUILD_STRING] = BUILD_STRING,\n    [BUILD_TUPLE] = BUILD_TUPLE,\n    [CACHE] = CACHE,\n    [CALL] = CALL,\n    [CALL_ADAPTIVE] = CALL,\n    [CALL_FUNCTION_EX] = CALL_FUNCTION_EX,\n    [CALL_PY_EXACT_ARGS] = CALL,\n    [CALL_PY_WITH_DEFAULTS] = CALL,\n    [CHECK_EG_MATCH] = CHECK_EG_MATCH,\n    [CHECK_EXC_MATCH] = CHECK_EXC_MATCH,\n    [COMPARE_OP] = COMPARE_OP,\n    [COMPARE_OP_ADAPTIVE] = COMPARE_OP,\n    [COMPARE_OP_FLOAT_JUMP] = COMPARE_OP,\n    [COMPARE_OP_INT_JUMP] = COMPARE_OP,\n    [COMPARE_OP_STR_JUMP] = COMPARE_OP,\n    [CONTAINS_OP] = CONTAINS_OP,\n    [COPY] = COPY,\n    [COPY_FREE_VARS] = COPY_FREE_VARS,\n    [DELETE_ATTR] = DELETE_ATTR,\n    [DELETE_DEREF] = DELETE_DEREF,\n    [DELETE_FAST] = DELETE_FAST,\n    [DELETE_GLOBAL] = DELETE_GLOBAL,\n    [DELETE_NAME] = DELETE_NAME,\n    [DELETE_SUBSCR] = DELETE_SUBSCR,\n    [DICT_MERGE] = DICT_MERGE,\n    [DICT_UPDATE] = DICT_UPDATE,\n    [END_ASYNC_FOR] = END_ASYNC_FOR,\n    [EXTENDED_ARG] = EXTENDED_ARG,\n    [EXTENDED_ARG_QUICK] = EXTENDED_ARG,\n    [FORMAT_VALUE] = FORMAT_VALUE,\n    [FOR_ITER] = FOR_ITER,\n    [GET_AITER] = GET_AITER,\n    [GET_ANEXT] = GET_ANEXT,\n    [GET_AWAITABLE] = GET_AWAITABLE,\n    [GET_ITER] = GET_ITER,\n    [GET_LEN] = GET_LEN,\n    [GET_YIELD_FROM_ITER] = GET_YIELD_FROM_ITER,\n    [IMPORT_FROM] = IMPORT_FROM,\n    [IMPORT_NAME] = IMPORT_NAME,\n    [IMPORT_STAR] = IMPORT_STAR,\n    [IS_OP] = IS_OP,\n    [JUMP_BACKWARD] = JUMP_BACKWARD,\n    [JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT,\n    [JUMP_BACKWARD_QUICK] = JUMP_BACKWARD,\n    [JUMP_FORWARD] = JUMP_FORWARD,\n    [JUMP_IF_FALSE_OR_POP] = JUMP_IF_FALSE_OR_POP,\n    [JUMP_IF_TRUE_OR_POP] = JUMP_IF_TRUE_OR_POP,\n    [KW_NAMES] = KW_NAMES,\n    [LIST_APPEND] = LIST_APPEND,\n    [LIST_EXTEND] = LIST_EXTEND,\n    [LIST_TO_TUPLE] = LIST_TO_TUPLE,\n    [LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR,\n    [LOAD_ATTR] = LOAD_ATTR,\n    [LOAD_ATTR_ADAPTIVE] = LOAD_ATTR,\n    [LOAD_ATTR_INSTANCE_VALUE] = LOAD_ATTR,\n    [LOAD_ATTR_MODULE] = LOAD_ATTR,\n    [LOAD_ATTR_SLOT] = LOAD_ATTR,\n    [LOAD_ATTR_WITH_HINT] = LOAD_ATTR,\n    [LOAD_BUILD_CLASS] = LOAD_BUILD_CLASS,\n    [LOAD_CLASSDEREF] = LOAD_CLASSDEREF,\n    [LOAD_CLOSURE] = LOAD_CLOSURE,\n    [LOAD_CONST] = LOAD_CONST,\n    [LOAD_CONST__LOAD_FAST] = LOAD_CONST,\n    [LOAD_DEREF] = LOAD_DEREF,\n    [LOAD_FAST] = LOAD_FAST,\n    [LOAD_FAST__LOAD_CONST] = LOAD_FAST,\n    [LOAD_FAST__LOAD_FAST] = LOAD_FAST,\n    [LOAD_GLOBAL] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_ADAPTIVE] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_BUILTIN] = LOAD_GLOBAL,\n    [LOAD_GLOBAL_MODULE] = LOAD_GLOBAL,\n    [LOAD_METHOD] = LOAD_METHOD,\n    [LOAD_METHOD_ADAPTIVE] = LOAD_METHOD,\n    [LOAD_METHOD_CLASS] = LOAD_METHOD,\n    [LOAD_METHOD_MODULE] = LOAD_METHOD,\n    [LOAD_METHOD_NO_DICT] = LOAD_METHOD,\n    [LOAD_METHOD_WITH_DICT] = LOAD_METHOD,\n    [LOAD_METHOD_WITH_VALUES] = LOAD_METHOD,\n    [LOAD_NAME] = LOAD_NAME,\n    [MAKE_CELL] = MAKE_CELL,\n    [MAKE_FUNCTION] = MAKE_FUNCTION,\n    [MAP_ADD] = MAP_ADD,\n    [MATCH_CLASS] = MATCH_CLASS,\n    [MATCH_KEYS] = MATCH_KEYS,\n    [MATCH_MAPPING] = MATCH_MAPPING,\n    [MATCH_SEQUENCE] = MATCH_SEQUENCE,\n    [NOP] = NOP,\n    [POP_EXCEPT] = POP_EXCEPT,\n    [POP_JUMP_BACKWARD_IF_FALSE] = POP_JUMP_BACKWARD_IF_FALSE,\n    [POP_JUMP_BACKWARD_IF_NONE] = POP_JUMP_BACKWARD_IF_NONE,\n    [POP_JUMP_BACKWARD_IF_NOT_NONE] = POP_JUMP_BACKWARD_IF_NOT_NONE,\n    [POP_JUMP_BACKWARD_IF_TRUE] = POP_JUMP_BACKWARD_IF_TRUE,\n    [POP_JUMP_FORWARD_IF_FALSE] = POP_JUMP_FORWARD_IF_FALSE,\n    [POP_JUMP_FORWARD_IF_NONE] = POP_JUMP_FORWARD_IF_NONE,\n    [POP_JUMP_FORWARD_IF_NOT_NONE] = POP_JUMP_FORWARD_IF_NOT_NONE,\n    [POP_JUMP_FORWARD_IF_TRUE] = POP_JUMP_FORWARD_IF_TRUE,\n    [POP_TOP] = POP_TOP,\n    [PRECALL] = PRECALL,\n    [PRECALL_ADAPTIVE] = PRECALL,\n    [PRECALL_BOUND_METHOD] = PRECALL,\n    [PRECALL_BUILTIN_CLASS] = PRECALL,\n    [PRECALL_BUILTIN_FAST_WITH_KEYWORDS] = PRECALL,\n    [PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = PRECALL,\n    [PRECALL_NO_KW_BUILTIN_FAST] = PRECALL,\n    [PRECALL_NO_KW_BUILTIN_O] = PRECALL,\n    [PRECALL_NO_KW_ISINSTANCE] = PRECALL,\n    [PRECALL_NO_KW_LEN] = PRECALL,\n    [PRECALL_NO_KW_LIST_APPEND] = PRECALL,\n    [PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST] = PRECALL,\n    [PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = PRECALL,\n    [PRECALL_NO_KW_METHOD_DESCRIPTOR_O] = PRECALL,\n    [PRECALL_NO_KW_STR_1] = PRECALL,\n    [PRECALL_NO_KW_TUPLE_1] = PRECALL,\n    [PRECALL_NO_KW_TYPE_1] = PRECALL,\n    [PRECALL_PYFUNC] = PRECALL,\n    [PREP_RERAISE_STAR] = PREP_RERAISE_STAR,\n    [PRINT_EXPR] = PRINT_EXPR,\n    [PUSH_EXC_INFO] = PUSH_EXC_INFO,\n    [PUSH_NULL] = PUSH_NULL,\n    [RAISE_VARARGS] = RAISE_VARARGS,\n    [RERAISE] = RERAISE,\n    [RESUME] = RESUME,\n    [RESUME_QUICK] = RESUME,\n    [RETURN_GENERATOR] = RETURN_GENERATOR,\n    [RETURN_VALUE] = RETURN_VALUE,\n    [SEND] = SEND,\n    [SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS,\n    [SET_ADD] = SET_ADD,\n    [SET_UPDATE] = SET_UPDATE,\n    [STORE_ATTR] = STORE_ATTR,\n    [STORE_ATTR_ADAPTIVE] = STORE_ATTR,\n    [STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR,\n    [STORE_ATTR_SLOT] = STORE_ATTR,\n    [STORE_ATTR_WITH_HINT] = STORE_ATTR,\n    [STORE_DEREF] = STORE_DEREF,\n    [STORE_FAST] = STORE_FAST,\n    [STORE_FAST__LOAD_FAST] = STORE_FAST,\n    [STORE_FAST__STORE_FAST] = STORE_FAST,\n    [STORE_GLOBAL] = STORE_GLOBAL,\n    [STORE_NAME] = STORE_NAME,\n    [STORE_SUBSCR] = STORE_SUBSCR,\n    [STORE_SUBSCR_ADAPTIVE] = STORE_SUBSCR,\n    [STORE_SUBSCR_DICT] = STORE_SUBSCR,\n    [STORE_SUBSCR_LIST_INT] = STORE_SUBSCR,\n    [SWAP] = SWAP,\n    [UNARY_INVERT] = UNARY_INVERT,\n    [UNARY_NEGATIVE] = UNARY_NEGATIVE,\n    [UNARY_NOT] = UNARY_NOT,\n    [UNARY_POSITIVE] = UNARY_POSITIVE,\n    [UNPACK_EX] = UNPACK_EX,\n    [UNPACK_SEQUENCE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_ADAPTIVE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_LIST] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_TUPLE] = UNPACK_SEQUENCE,\n    [UNPACK_SEQUENCE_TWO_TUPLE] = UNPACK_SEQUENCE,\n    [WITH_EXCEPT_START] = WITH_EXCEPT_START,\n    [YIELD_VALUE] = YIELD_VALUE,\n#endif\n};\n\nPyObject *Nuitka_PyGen_yf(PyGenObject *gen) {\n    PyObject *yf = NULL;\n\n    if (gen->gi_frame_state < FRAME_CLEARED) {\n        _PyInterpreterFrame *frame = (_PyInterpreterFrame *)gen->gi_iframe;\n\n        if (gen->gi_frame_state == FRAME_CREATED) {\n            return NULL;\n        }\n\n        _Py_CODEUNIT next = frame->prev_instr[1];\n\n        if (Nuitka_PyOpcode_Deopt[_Py_OPCODE(next)] != RESUME || _Py_OPARG(next) < 2) {\n            return NULL;\n        }\n\n        yf = _PyFrame_StackPeek(frame);\n\n        Py_INCREF(yf);\n    }\n\n    return yf;\n}\n\n// Because it is not exported, we need to duplicate this.\nstatic PyFrameObject *_Nuitka_PyFrame_New_NoTrack(PyCodeObject *code) {\n    int slots = code->co_nlocalsplus + code->co_stacksize;\n\n    PyFrameObject *f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, slots);\n\n    if (f == NULL) {\n        return NULL;\n    }\n\n    f->f_back = NULL;\n    f->f_trace = NULL;\n    f->f_trace_lines = 1;\n    f->f_trace_opcodes = 0;\n    f->f_fast_as_locals = 0;\n    f->f_lineno = 0;\n\n    return f;\n}\n\n// Also not exported.\nstatic PyFrameObject *_Nuitka_PyFrame_MakeAndSetFrameObject(PyThreadState *tstate, _PyInterpreterFrame *frame) {\n    assert(frame->frame_obj == NULL);\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    PyFrameObject *f = _Nuitka_PyFrame_New_NoTrack(frame->f_code);\n\n    // Out of memory should be rare.\n    assert(f != NULL);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    // Apparently there are situations where there is a race with what code creates the\n    // frame, and this time it's not us.\n    if (frame->frame_obj) {\n        f->f_frame = (_PyInterpreterFrame *)f->_f_frame_data;\n        f->f_frame->owner = FRAME_CLEARED;\n        f->f_frame->frame_obj = f;\n        Py_DECREF(f);\n\n        return frame->frame_obj;\n    }\n\n    assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT);\n    assert(frame->owner != FRAME_CLEARED);\n\n    f->f_frame = frame;\n    frame->frame_obj = f;\n\n    return f;\n}\n\n// The header variant uses un-exported code, replicate it with using our own variation.\nstatic inline PyFrameObject *_Nuitka_PyFrame_GetFrameObject(PyThreadState *tstate, _PyInterpreterFrame *frame) {\n    assert(!_PyFrame_IsIncomplete(frame));\n\n    PyFrameObject *res = frame->frame_obj;\n\n    if (res != NULL) {\n        return res;\n    }\n\n    return _Nuitka_PyFrame_MakeAndSetFrameObject(tstate, frame);\n}\n\n// Also not exported, taking over a frame object.\n\nstatic void _Nuitka_take_ownership(PyThreadState *tstate, PyFrameObject *f, _PyInterpreterFrame *frame) {\n    assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT);\n    assert(frame->owner != FRAME_CLEARED);\n\n    Py_ssize_t size = ((char *)&frame->localsplus[frame->stacktop]) - (char *)frame;\n    memcpy((_PyInterpreterFrame *)f->_f_frame_data, frame, size);\n\n    frame = (_PyInterpreterFrame *)f->_f_frame_data;\n    f->f_frame = frame;\n    frame->owner = FRAME_OWNED_BY_FRAME_OBJECT;\n\n    assert(f->f_back == NULL);\n\n    _PyInterpreterFrame *prev = frame->previous;\n    while (prev && _PyFrame_IsIncomplete(prev)) {\n        prev = prev->previous;\n    }\n\n    // Link the back frame, which may have to be created.\n    if (prev) {\n        // Link PyFrameObject \"f_back\" and remove link through \"_PyInterpreterFrame\".previous\n        // TODO: Nuitka doesn't do that for compiled frames ever, is that really needed?\n        PyFrameObject *back = _Nuitka_PyFrame_GetFrameObject(tstate, prev);\n\n        if (unlikely(back == NULL)) {\n            DROP_ERROR_OCCURRED(tstate);\n        } else {\n            f->f_back = (PyFrameObject *)Py_NewRef(back);\n        }\n\n        frame->previous = NULL;\n    }\n\n    if (!_PyObject_GC_IS_TRACKED((PyObject *)f)) {\n        Nuitka_GC_Track((PyObject *)f);\n    }\n}\n\n// Cleanup up the frame is also not exported.\nstatic void _Nuitka_PyFrame_Clear(PyThreadState *tstate, _PyInterpreterFrame *frame) {\n    assert(frame->owner != FRAME_OWNED_BY_GENERATOR || _PyFrame_GetGenerator(frame)->gi_frame_state == FRAME_CLEARED);\n\n    if (frame->frame_obj) {\n        PyFrameObject *f = frame->frame_obj;\n        frame->frame_obj = NULL;\n\n        if (Py_REFCNT(f) > 1) {\n            _Nuitka_take_ownership(tstate, f, frame);\n            Py_DECREF(f);\n\n            return;\n        }\n\n        Py_DECREF(f);\n    }\n\n    assert(frame->stacktop >= 0);\n    for (int i = 0; i < frame->stacktop; i++) {\n        Py_XDECREF(frame->localsplus[i]);\n    }\n\n    Py_XDECREF(frame->frame_obj);\n    Py_XDECREF(frame->f_locals);\n#if PYTHON_VERSION < 0x3c0\n    Py_DECREF(frame->f_func);\n#else\n    Py_DECREF(frame->f_funcobj);\n#endif\n    Py_DECREF(frame->f_code);\n}\n\nstatic PySendResult Nuitka_PyGen_gen_send_ex2(PyThreadState *tstate, PyGenObject *gen, PyObject *arg,\n                                              PyObject **presult, int exc, int closing) {\n    _PyInterpreterFrame *frame = (_PyInterpreterFrame *)gen->gi_iframe;\n    PyObject *result;\n\n    *presult = NULL;\n\n    if (gen->gi_frame_state == FRAME_CREATED && arg != NULL && arg != Py_None) {\n        const char *msg = \"can't send non-None value to a just-started generator\";\n        if (PyCoro_CheckExact(gen)) {\n            msg = \"can't send non-None value to a just-started coroutine\";\n        } else if (PyAsyncGen_CheckExact(gen)) {\n            msg = \"can't send non-None value to a just-started async generator\";\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, msg);\n        return PYGEN_ERROR;\n    }\n\n    if (gen->gi_frame_state == FRAME_EXECUTING) {\n        const char *msg = \"generator already executing\";\n\n        if (PyCoro_CheckExact(gen)) {\n            msg = \"coroutine already executing\";\n        } else if (PyAsyncGen_CheckExact(gen)) {\n            msg = \"async generator already executing\";\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, msg);\n        return PYGEN_ERROR;\n    }\n\n    if (gen->gi_frame_state >= FRAME_COMPLETED) {\n        if (PyCoro_CheckExact(gen) && !closing) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot reuse already awaited coroutine\");\n        } else if (arg && !exc) {\n            *presult = Py_None;\n            Py_INCREF(*presult);\n            return PYGEN_RETURN;\n        }\n        return PYGEN_ERROR;\n    }\n\n    assert(gen->gi_frame_state < FRAME_EXECUTING);\n\n    // Put arg on the frame's stack\n    result = arg ? arg : Py_None;\n    Py_INCREF(result);\n    _PyFrame_StackPush(frame, result);\n\n    frame->previous = tstate->cframe->current_frame;\n\n    gen->gi_exc_state.previous_item = tstate->exc_info;\n    tstate->exc_info = &gen->gi_exc_state;\n\n    if (exc) {\n        assert(_PyErr_Occurred(tstate));\n        _PyErr_ChainStackItem(NULL);\n    }\n\n    gen->gi_frame_state = FRAME_EXECUTING;\n    result = _PyEval_EvalFrame(tstate, frame, exc);\n    if (gen->gi_frame_state == FRAME_EXECUTING) {\n        gen->gi_frame_state = FRAME_COMPLETED;\n    }\n    tstate->exc_info = gen->gi_exc_state.previous_item;\n    gen->gi_exc_state.previous_item = NULL;\n\n    assert(tstate->cframe->current_frame == frame->previous);\n    frame->previous = NULL;\n\n    if (result != NULL) {\n        if (gen->gi_frame_state == FRAME_SUSPENDED) {\n            *presult = result;\n            return PYGEN_NEXT;\n        }\n\n        assert(result == Py_None || !PyAsyncGen_CheckExact(gen));\n\n        if (result == Py_None && !PyAsyncGen_CheckExact(gen) && !arg) {\n            Py_CLEAR(result);\n        }\n    } else {\n        if (PyErr_ExceptionMatches(PyExc_StopIteration)) {\n            const char *msg = \"generator raised StopIteration\";\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"coroutine raised StopIteration\";\n            } else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"async generator raised StopIteration\";\n            }\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        } else if (PyAsyncGen_CheckExact(gen) && PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) {\n            const char *msg = \"async generator raised StopAsyncIteration\";\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        }\n    }\n\n    _PyErr_ClearExcState(&gen->gi_exc_state);\n\n    gen->gi_frame_state = FRAME_CLEARED;\n    _Nuitka_PyFrame_Clear(tstate, frame);\n\n    *presult = result;\n    return result ? PYGEN_RETURN : PYGEN_ERROR;\n}\n\nstatic PyObject *Nuitka_PyGen_gen_send_ex(PyThreadState *tstate, PyGenObject *gen, PyObject *arg, int exc,\n                                          int closing) {\n    PyObject *result;\n\n    if (Nuitka_PyGen_gen_send_ex2(tstate, gen, arg, &result, exc, closing) == PYGEN_RETURN) {\n        if (PyAsyncGen_CheckExact(gen)) {\n            assert(result == Py_None);\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n        } else if (result == Py_None) {\n            SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n        } else {\n            _PyGen_SetStopIterationValue(result);\n        }\n\n        Py_DECREF(result);\n        return NULL;\n    }\n\n    return result;\n}\n\n// This function is called when throwing to an uncompiled generator. Coroutines and generators\n// do this in their yielding from.\n// Note:\n//   Exception arguments are passed for ownership and must be released before returning. The\n//   value of exception_type will not be NULL, but the actual exception will not necessarily\n//   be normalized.\nstatic PyObject *Nuitka_UncompiledGenerator_throw(PyThreadState *tstate, PyGenObject *gen, int close_on_genexit,\n                                                  struct Nuitka_ExceptionPreservationItem *exception_state) {\n#if _DEBUG_GENERATOR\n    PRINT_STRING(\"Nuitka_UncompiledGenerator_throw: Enter \");\n    PRINT_ITEM((PyObject *)gen);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *yf = Nuitka_PyGen_yf(gen);\n\n    if (yf != NULL) {\n        _PyInterpreterFrame *frame = (_PyInterpreterFrame *)gen->gi_iframe;\n\n        if (close_on_genexit &&\n            EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_state->exception_type, PyExc_GeneratorExit)) {\n            PyFrameState state = (PyFrameState)gen->gi_frame_state;\n            gen->gi_frame_state = FRAME_EXECUTING;\n\n            int err = Nuitka_PyGen_gen_close_iter(tstate, yf);\n\n            gen->gi_frame_state = state;\n\n            Py_DECREF(yf);\n\n            if (err < 0) {\n                // Releasing exception, we are done with it, raising instead the error just\n                // occurred.\n                RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                return Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 0);\n            }\n\n            // Handing exception ownership to this code.\n            goto throw_here;\n        }\n\n        PyObject *ret;\n\n        if (PyGen_CheckExact(yf) || PyCoro_CheckExact(yf)) {\n            _PyInterpreterFrame *prev = tstate->cframe->current_frame;\n            frame->previous = prev;\n            tstate->cframe->current_frame = frame;\n            PyFrameState state = (PyFrameState)gen->gi_frame_state;\n            gen->gi_frame_state = FRAME_EXECUTING;\n\n            // Handing exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            ret = Nuitka_UncompiledGenerator_throw(tstate, (PyGenObject *)yf, close_on_genexit, exception_state);\n            gen->gi_frame_state = state;\n            tstate->cframe->current_frame = prev;\n            frame->previous = NULL;\n        } else {\n#if 0\n            // TODO: Add slow mode traces.\n            PRINT_ITEM(yf);\n            PRINT_NEW_LINE();\n#endif\n\n            PyObject *meth;\n\n            // TODO: Use our faster (?) code here too.\n            if (_PyObject_LookupAttr(yf, &_Py_ID(throw), &meth) < 0) {\n                Py_DECREF(yf);\n\n                goto failed_throw;\n            }\n\n            if (meth == NULL) {\n                Py_DECREF(yf);\n                goto throw_here;\n            }\n\n            PyFrameState state = (PyFrameState)gen->gi_frame_state;\n            gen->gi_frame_state = FRAME_EXECUTING;\n\n            ret = Nuitka_CallGeneratorThrowMethod(meth, exception_state);\n\n            gen->gi_frame_state = state;\n\n            // Releasing exception, we are done with it.\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n            Py_DECREF(meth);\n        }\n        Py_DECREF(yf);\n\n        if (ret == NULL) {\n            PyObject *val;\n            assert(gen->gi_frame_state < FRAME_CLEARED);\n            ret = _PyFrame_StackPop((_PyInterpreterFrame *)gen->gi_iframe);\n            assert(ret == yf);\n            Py_DECREF(ret);\n            assert(_PyInterpreterFrame_LASTI(frame) >= 0);\n            assert(_Py_OPCODE(frame->prev_instr[-1]) == SEND);\n            int jump = _Py_OPARG(frame->prev_instr[-1]);\n            frame->prev_instr += jump - 1;\n            if (_PyGen_FetchStopIterationValue(&val) == 0) {\n                ret = Nuitka_PyGen_gen_send_ex(tstate, gen, val, 0, 0);\n                Py_DECREF(val);\n            } else {\n                ret = Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 0);\n            }\n        }\n\n        return ret;\n    }\n\nthrow_here:\n    if (exception_state->exception_tb == (PyTracebackObject *)Py_None) {\n        exception_state->exception_tb = NULL;\n        Py_DECREF(exception_state->exception_tb);\n    } else if (exception_state->exception_tb != NULL && !PyTraceBack_Check(exception_state->exception_tb)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"throw() third argument must be a traceback object\");\n        goto failed_throw;\n    }\n\n    tstate = _PyThreadState_GET();\n\n    if (PyExceptionClass_Check(exception_state->exception_type)) {\n        Nuitka_Err_NormalizeException(tstate, &exception_state->exception_type, &exception_state->exception_value,\n                                      &exception_state->exception_tb);\n    } else if (PyExceptionInstance_Check(exception_state->exception_type)) {\n        if (exception_state->exception_value && exception_state->exception_value != Py_None) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                            \"instance exception may not have a separate value\");\n            goto failed_throw;\n        } else {\n            // Normalize manually here via APIs\n            Py_XDECREF(exception_state->exception_value);\n            exception_state->exception_value = exception_state->exception_type;\n            exception_state->exception_type = PyExceptionInstance_Class(exception_state->exception_type);\n            Py_INCREF(exception_state->exception_type);\n\n            if (exception_state->exception_tb == NULL) {\n                // Can remain NULL if no traceback is available.\n                exception_state->exception_tb = GET_EXCEPTION_TRACEBACK(exception_state->exception_value);\n                Py_XINCREF(exception_state->exception_tb);\n            }\n        }\n    } else {\n        // Raisable\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\n            \"exceptions must be classes or instances deriving from BaseException, not %s\",\n            exception_state->exception_type);\n        goto failed_throw;\n    }\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n    return Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 1);\n\nfailed_throw:\n    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n    return NULL;\n}\n\n#else\n\n// For Python3.10 or earlier:\n\nstatic PyObject *Nuitka_PyGen_yf(PyGenObject *gen) {\n    PyFrameObject *f = gen->gi_frame;\n\n#if PYTHON_VERSION < 0x3a0\n    if (f && f->f_stacktop) {\n#else\n    if (f) {\n#endif\n        PyObject *bytecode = f->f_code->co_code;\n        unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);\n\n        if (f->f_lasti < 0) {\n            return NULL;\n        }\n\n#if PYTHON_VERSION < 0x360\n        if (code[f->f_lasti + 1] != YIELD_FROM)\n#elif PYTHON_VERSION < 0x3a0\n        if (code[f->f_lasti + sizeof(_Py_CODEUNIT)] != YIELD_FROM)\n#else\n    if (code[(f->f_lasti + 1) * sizeof(_Py_CODEUNIT)] != YIELD_FROM)\n#endif\n        {\n            return NULL;\n        }\n\n#if PYTHON_VERSION < 0x3a0\n        PyObject *yf = f->f_stacktop[-1];\n#else\n        assert(f->f_stackdepth > 0);\n        PyObject *yf = f->f_valuestack[f->f_stackdepth - 1];\n#endif\n        Py_INCREF(yf);\n        return yf;\n    } else {\n        return NULL;\n    }\n}\n\nstatic PyObject *Nuitka_PyGen_gen_send_ex(PyThreadState *tstate, PyGenObject *gen, PyObject *arg, int exc,\n                                          int closing) {\n    PyFrameObject *f = gen->gi_frame;\n    PyObject *result;\n\n#if PYTHON_VERSION >= 0x3a0\n    if (f != NULL && unlikely(_PyFrame_IsExecuting(f))) {\n#else\n    if (unlikely(gen->gi_running)) {\n#endif\n        char const *msg = \"generator already executing\";\n\n#if PYTHON_VERSION >= 0x350\n        if (PyCoro_CheckExact(gen)) {\n            msg = \"coroutine already executing\";\n        }\n#if PYTHON_VERSION >= 0x360\n        else if (PyAsyncGen_CheckExact(gen)) {\n            msg = \"async generator already executing\";\n        }\n#endif\n#endif\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, msg);\n\n        return NULL;\n    }\n\n    if (f == NULL || Nuitka_PyFrameHasCompleted(f)) {\n#if PYTHON_VERSION >= 0x350\n        if (PyCoro_CheckExact(gen) && !closing) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, \"cannot reuse already awaited coroutine\");\n        } else\n#endif\n            if (arg && !exc) {\n#if PYTHON_VERSION >= 0x360\n            if (PyAsyncGen_CheckExact(gen)) {\n                SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n            } else\n#endif\n            {\n                SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n            }\n        }\n        return NULL;\n    }\n\n#if PYTHON_VERSION < 0x3a0\n    if (f->f_lasti == -1) {\n        if (unlikely(arg != NULL && arg != Py_None)) {\n            char const *msg = \"can't send non-None value to a just-started generator\";\n\n#if PYTHON_VERSION >= 0x350\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"can't send non-None value to a just-started coroutine\";\n            }\n#if PYTHON_VERSION >= 0x360\n            else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"can't send non-None value to a just-started async generator\";\n            }\n#endif\n#endif\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, msg);\n            return NULL;\n        }\n    } else {\n        // Put arg on the frame's stack\n        result = arg ? arg : Py_None;\n        Py_INCREF(result);\n        *(f->f_stacktop++) = result;\n    }\n#else\n    // CPython assertions, check them\n    assert(_PyFrame_IsRunnable(f));\n    assert(f->f_lasti >= 0 || ((unsigned char *)PyBytes_AS_STRING(f->f_code->co_code))[0] == GEN_START);\n\n    result = arg ? arg : Py_None;\n    Py_INCREF(result);\n    gen->gi_frame->f_valuestack[gen->gi_frame->f_stackdepth] = result;\n    gen->gi_frame->f_stackdepth++;\n#endif\n\n    Py_XINCREF(tstate->frame);\n    f->f_back = tstate->frame;\n\n#if PYTHON_VERSION < 0x3a0\n    gen->gi_running = 1;\n#endif\n#if PYTHON_VERSION >= 0x370\n    gen->gi_exc_state.previous_item = tstate->exc_info;\n    tstate->exc_info = &gen->gi_exc_state;\n#endif\n#if PYTHON_VERSION < 0x390\n    result = PyEval_EvalFrameEx(f, exc);\n#else\n    result = _PyEval_EvalFrame(tstate, f, exc);\n#endif\n#if PYTHON_VERSION >= 0x370\n    tstate->exc_info = gen->gi_exc_state.previous_item;\n    gen->gi_exc_state.previous_item = NULL;\n#endif\n#if PYTHON_VERSION < 0x3a0\n    gen->gi_running = 0;\n#endif\n\n    Py_CLEAR(f->f_back);\n\n#if PYTHON_VERSION < 0x3a0\n    if (result && f->f_stacktop == NULL) {\n        if (result == Py_None) {\n#if PYTHON_VERSION >= 0x360\n            if (PyAsyncGen_CheckExact(gen)) {\n                SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopAsyncIteration);\n            } else\n#endif\n            {\n                SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);\n            }\n        } else {\n            Nuitka_SetStopIterationValue(tstate, result);\n        }\n\n        Py_CLEAR(result);\n    }\n#if PYTHON_VERSION >= 0x350\n    else if (result == NULL && PyErr_ExceptionMatches(PyExc_StopIteration)) {\n#if PYTHON_VERSION < 0x370\n        const int check_stop_iter_error_flags = CO_FUTURE_GENERATOR_STOP | CO_COROUTINE |\n#if PYTHON_VERSION >= 0x360\n                                                CO_ASYNC_GENERATOR |\n#endif\n                                                CO_ITERABLE_COROUTINE;\n\n        if (unlikely(gen->gi_code != NULL && ((PyCodeObject *)gen->gi_code)->co_flags & check_stop_iter_error_flags))\n#endif\n        {\n            char const *msg = \"generator raised StopIteration\";\n\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"coroutine raised StopIteration\";\n            }\n#if PYTHON_VERSION >= 0x360\n            else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"async generator raised StopIteration\";\n            }\n#endif\n\n#if PYTHON_VERSION >= 0x360\n            _PyErr_FormatFromCause(\n#else\n            PyErr_Format(\n#endif\n                PyExc_RuntimeError, \"%s\", msg);\n        }\n    }\n#endif\n#if PYTHON_VERSION >= 0x360\n    else if (result == NULL && PyAsyncGen_CheckExact(gen) && PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) {\n        char const *msg = \"async generator raised StopAsyncIteration\";\n        _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n    }\n#endif\n\n    if (!result || f->f_stacktop == NULL) {\n#if PYTHON_VERSION < 0x370\n        PyObject *t, *v, *tb;\n        t = f->f_exc_type;\n        v = f->f_exc_value;\n        tb = f->f_exc_traceback;\n        f->f_exc_type = NULL;\n        f->f_exc_value = NULL;\n        f->f_exc_traceback = NULL;\n        Py_XDECREF(t);\n        Py_XDECREF(v);\n        Py_XDECREF(tb);\n#else\n        Nuitka_PyGen_exc_state_clear(&gen->gi_exc_state);\n#endif\n        gen->gi_frame->f_gen = NULL;\n        gen->gi_frame = NULL;\n        Py_DECREF(f);\n    }\n#else\n    if (result) {\n        if (!_PyFrameHasCompleted(f)) {\n            return result;\n        }\n        assert(result == Py_None || !PyAsyncGen_CheckExact(gen));\n        if (result == Py_None && !PyAsyncGen_CheckExact(gen) && !arg) {\n            Py_CLEAR(result);\n        }\n    } else {\n        if (PyErr_ExceptionMatches(PyExc_StopIteration)) {\n            const char *msg = \"generator raised StopIteration\";\n            if (PyCoro_CheckExact(gen)) {\n                msg = \"coroutine raised StopIteration\";\n            } else if (PyAsyncGen_CheckExact(gen)) {\n                msg = \"async generator raised StopIteration\";\n            }\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        } else if (PyAsyncGen_CheckExact(gen) && PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) {\n            const char *msg = \"async generator raised StopAsyncIteration\";\n\n            // TODO: Have our own variant of this.\n            _PyErr_FormatFromCause(PyExc_RuntimeError, \"%s\", msg);\n        }\n    }\n\n    Nuitka_PyGen_exc_state_clear(&gen->gi_exc_state);\n\n    gen->gi_frame->f_gen = NULL;\n    gen->gi_frame = NULL;\n\n    Py_DECREF(f);\n#endif\n    return result;\n}\n\n// This function is called when throwing to an uncompiled generator. Coroutines and generators\n// do this in their yielding from.\n// Note:\n//   Exception arguments are passed for ownership and must be released before returning. The\n//   value of exception_type will not be NULL, but the actual exception will not necessarily\n//   be normalized.\nstatic PyObject *Nuitka_UncompiledGenerator_throw(PyThreadState *tstate, PyGenObject *gen, int close_on_genexit,\n                                                  struct Nuitka_ExceptionPreservationItem *exception_state) {\n#if _DEBUG_GENERATOR\n    PRINT_STRING(\"Nuitka_UncompiledGenerator_throw: Enter \");\n    PRINT_ITEM((PyObject *)gen);\n    PRINT_EXCEPTION_STATE(exception_state);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *yf = Nuitka_PyGen_yf(gen);\n\n    if (yf != NULL) {\n        if (close_on_genexit &&\n            EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_state->exception_type, PyExc_GeneratorExit)) {\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 1;\n#else\n            PyFrameState state = gen->gi_frame->f_state;\n            gen->gi_frame->f_state = FRAME_EXECUTING;\n#endif\n\n            int err = Nuitka_PyGen_gen_close_iter(tstate, yf);\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 0;\n#else\n            gen->gi_frame->f_state = state;\n#endif\n            Py_DECREF(yf);\n\n            if (err < 0) {\n                // Releasing exception, we are done with it, raising instead the error just\n                // occurred.\n                RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                return Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 0);\n            }\n\n            // Handing exception ownership to this code.\n            goto throw_here;\n        }\n\n        PyObject *ret;\n\n        if (PyGen_CheckExact(yf)\n#if PYTHON_VERSION >= 0x350\n            || PyCoro_CheckExact(yf)\n#endif\n        ) {\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 1;\n#else\n            PyFrameState state = gen->gi_frame->f_state;\n            gen->gi_frame->f_state = FRAME_EXECUTING;\n#endif\n\n            // Handing exception ownership to \"Nuitka_UncompiledGenerator_throw\".\n            ret = Nuitka_UncompiledGenerator_throw(tstate, (PyGenObject *)yf, close_on_genexit, exception_state);\n\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 0;\n#else\n            gen->gi_frame->f_state = state;\n#endif\n        } else {\n#if 0\n            // TODO: Add slow mode traces.\n            PRINT_ITEM(yf);\n            PRINT_NEW_LINE();\n#endif\n\n            // TODO: Use faster code here too.\n            PyObject *meth = PyObject_GetAttr(yf, const_str_plain_throw);\n\n            if (meth == NULL) {\n                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n                    Py_DECREF(yf);\n\n                    // Releasing exception, we are done with it.\n                    RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n                    return NULL;\n                }\n\n                CLEAR_ERROR_OCCURRED(tstate);\n                Py_DECREF(yf);\n\n                // Handing exception ownership to this code.\n                goto throw_here;\n            }\n\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 1;\n#else\n            PyFrameState state = gen->gi_frame->f_state;\n            gen->gi_frame->f_state = FRAME_EXECUTING;\n#endif\n            // TODO: Faster call code should be used.\n            ret = Nuitka_CallGeneratorThrowMethod(meth, exception_state);\n\n#if PYTHON_VERSION < 0x3a0\n            gen->gi_running = 0;\n#else\n            gen->gi_frame->f_state = state;\n#endif\n\n            // Releasing exception, we are done with it.\n            RELEASE_ERROR_OCCURRED_STATE(exception_state);\n\n            Py_DECREF(meth);\n        }\n\n        Py_DECREF(yf);\n\n        if (ret == NULL) {\n#if PYTHON_VERSION < 0x3a0\n            ret = *(--gen->gi_frame->f_stacktop);\n#else\n            assert(gen->gi_frame->f_stackdepth > 0);\n            gen->gi_frame->f_stackdepth--;\n            ret = gen->gi_frame->f_valuestack[gen->gi_frame->f_stackdepth];\n#endif\n            Py_DECREF(ret);\n\n#if PYTHON_VERSION >= 0x360\n            gen->gi_frame->f_lasti += sizeof(_Py_CODEUNIT);\n#else\n            gen->gi_frame->f_lasti += 1;\n#endif\n\n            if (_PyGen_FetchStopIterationValue(&exception_state->exception_value) == 0) {\n                ret = Nuitka_PyGen_gen_send_ex(tstate, gen, exception_state->exception_value, 0, 0);\n\n                Py_DECREF(exception_state->exception_value);\n            } else {\n                ret = Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 0);\n            }\n        }\n        return ret;\n    }\n\nthrow_here:\n    // We continue to have exception ownership here.\n    if (unlikely(_Nuitka_Generator_check_throw2(tstate, exception_state) == false)) {\n        // Exception was released by _Nuitka_Generator_check_throw2 already.\n        return NULL;\n    }\n\n    // Transfer exception ownership to published exception.\n    RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);\n\n    return Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 1);\n}\n\n#endif\n\nstatic int Nuitka_PyGen_gen_close_iter(PyThreadState *tstate, PyObject *yf) {\n    PyObject *retval = NULL;\n\n    if (PyGen_CheckExact(yf)\n#if PYTHON_VERSION >= 0x350\n        || PyCoro_CheckExact(yf)\n#endif\n    ) {\n        assert(false);\n        retval = Nuitka_PyGen_gen_close(tstate, (PyGenObject *)yf, NULL);\n\n        if (retval == NULL) {\n            return -1;\n        }\n    } else {\n        PyObject *meth = PyObject_GetAttr(yf, const_str_plain_close);\n\n        if (meth == NULL) {\n            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n                PyErr_WriteUnraisable(yf);\n            }\n\n            CLEAR_ERROR_OCCURRED(tstate);\n        } else {\n            retval = CALL_FUNCTION_NO_ARGS(tstate, meth);\n\n            Py_DECREF(meth);\n\n            if (retval == NULL) {\n                return -1;\n            }\n        }\n    }\n\n    Py_XDECREF(retval);\n    return 0;\n}\n\nstatic PyObject *Nuitka_PyGen_gen_close(PyThreadState *tstate, PyGenObject *gen, PyObject *args) {\n    PyObject *yf = Nuitka_PyGen_yf(gen);\n    int err = 0;\n\n    if (yf != NULL) {\n#if PYTHON_VERSION >= 0x3b0\n        PyFrameState state = (PyFrameState)gen->gi_frame_state;\n        gen->gi_frame_state = FRAME_EXECUTING;\n#elif PYTHON_VERSION >= 0x3a0\n        PyFrameState state = gen->gi_frame->f_state;\n        gen->gi_frame->f_state = FRAME_EXECUTING;\n#else\n        gen->gi_running = 1;\n#endif\n        err = Nuitka_PyGen_gen_close_iter(tstate, yf);\n\n#if PYTHON_VERSION >= 0x3b0\n        gen->gi_frame_state = state;\n#elif PYTHON_VERSION >= 0x3a0\n        gen->gi_frame->f_state = state;\n#else\n        gen->gi_running = 0;\n#endif\n        Py_DECREF(yf);\n    }\n\n    if (err == 0) {\n        SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_GeneratorExit);\n    }\n\n    PyObject *retval = Nuitka_PyGen_gen_send_ex(tstate, gen, Py_None, 1, 1);\n\n    if (retval != NULL) {\n        char const *msg = \"generator ignored GeneratorExit\";\n\n#if PYTHON_VERSION >= 0x350\n        if (PyCoro_CheckExact(gen)) {\n            msg = \"coroutine ignored GeneratorExit\";\n        }\n#if PYTHON_VERSION >= 0x360\n        else if (PyAsyncGen_CheckExact(gen)) {\n            msg = \"async generator ignored GeneratorExit\";\n        }\n#endif\n#endif\n        Py_DECREF(retval);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, msg);\n        return NULL;\n    }\n\n    if (PyErr_ExceptionMatches(PyExc_StopIteration) || PyErr_ExceptionMatches(PyExc_GeneratorExit)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n    return NULL;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/CompiledMethodType.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Compiled methods.\n *\n * It strives to be full replacement for normal method objects, but\n * normally should be avoided to exist in Nuitka calls.\n *\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/freelists.h\"\n#include \"nuitka/prelude.h\"\n#include <structmember.h>\n#endif\n\nstatic PyObject *Nuitka_Method_get__doc__(struct Nuitka_MethodObject *method, void *closure) {\n    PyObject *result = method->m_function->m_doc;\n\n    if (result == NULL) {\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyGetSetDef Nuitka_Method_tp_getset[] = {{(char *)\"__doc__\", (getter)Nuitka_Method_get__doc__, NULL, NULL},\n                                                {NULL}};\n\n#define OFF(x) offsetof(struct Nuitka_MethodObject, x)\n\nstatic PyMemberDef Nuitka_Method_members[] = {\n    {(char *)\"im_class\", T_OBJECT, OFF(m_class), READONLY | RESTRICTED, (char *)\"the class associated with a method\"},\n    {(char *)\"im_func\", T_OBJECT, OFF(m_function), READONLY | RESTRICTED,\n     (char *)\"the function (or other callable) implementing a method\"},\n    {(char *)\"__func__\", T_OBJECT, OFF(m_function), READONLY | RESTRICTED,\n     (char *)\"the function (or other callable) implementing a method\"},\n    {(char *)\"im_self\", T_OBJECT, OFF(m_object), READONLY | RESTRICTED,\n     (char *)\"the instance to which a method is bound; None for unbound method\"},\n    {(char *)\"__self__\", T_OBJECT, OFF(m_object), READONLY | RESTRICTED,\n     (char *)\"the instance to which a method is bound; None for unbound method\"},\n    {NULL}};\n\nstatic PyObject *Nuitka_Method_reduce(struct Nuitka_MethodObject *method) {\n#if PYTHON_VERSION < 0x300\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // spell-checker: ignore instancemethod\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"can't pickle instancemethod objects\");\n    return NULL;\n#elif PYTHON_VERSION < 0x340\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"can't pickle method objects\");\n    return NULL;\n#else\n    PyObject *result = MAKE_TUPLE_EMPTY(2);\n    PyTuple_SET_ITEM0(result, 0, LOOKUP_BUILTIN(const_str_plain_getattr));\n    PyObject *arg_tuple = MAKE_TUPLE2(method->m_object, method->m_function->m_name);\n    PyTuple_SET_ITEM(result, 1, arg_tuple);\n\n    CHECK_OBJECT_DEEP(result);\n\n    return result;\n#endif\n}\n\nstatic PyObject *Nuitka_Method_reduce_ex(struct Nuitka_MethodObject *method, PyObject *args) {\n    int proto;\n\n    if (!PyArg_ParseTuple(args, \"|i:__reduce_ex__\", &proto)) {\n        return NULL;\n    }\n\n    // Python API, spell-checker: ignore copyreg,newobj\n\n#if PYTHON_VERSION < 0x340\n#if PYTHON_VERSION < 0x300\n    PyObject *copy_reg = PyImport_ImportModule(\"copy_reg\");\n#else\n    PyObject *copy_reg = PyImport_ImportModule(\"copyreg\");\n#endif\n    CHECK_OBJECT(copy_reg);\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *newobj_func = LOOKUP_ATTRIBUTE(tstate, copy_reg, const_str_plain___newobj__);\n    Py_DECREF(copy_reg);\n    if (unlikely(newobj_func == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = MAKE_TUPLE_EMPTY(5);\n    PyTuple_SET_ITEM(result, 0, newobj_func);\n    PyObject *type_tuple = MAKE_TUPLE1((PyObject *)&Nuitka_Method_Type);\n    PyTuple_SET_ITEM(result, 1, type_tuple);\n    PyTuple_SET_ITEM0(result, 2, Py_None);\n    PyTuple_SET_ITEM0(result, 3, Py_None);\n    PyTuple_SET_ITEM0(result, 4, Py_None);\n\n    CHECK_OBJECT_DEEP(result);\n\n    return result;\n#else\n    return Nuitka_Method_reduce(method);\n#endif\n}\n\nstatic PyObject *Nuitka_Method_deepcopy(struct Nuitka_MethodObject *method, PyObject *memo) {\n    assert(Nuitka_Method_Check((PyObject *)method));\n\n    static PyObject *module_copy = NULL;\n    static PyObject *deepcopy_function = NULL;\n\n    if (module_copy == NULL) {\n        module_copy = PyImport_ImportModule(\"copy\");\n        CHECK_OBJECT(module_copy);\n\n        deepcopy_function = PyObject_GetAttrString(module_copy, \"deepcopy\");\n        CHECK_OBJECT(deepcopy_function);\n    }\n\n    PyObject *object = PyObject_CallFunctionObjArgs(deepcopy_function, method->m_object, memo, NULL);\n\n    if (unlikely(object == NULL)) {\n        return NULL;\n    }\n\n    return Nuitka_Method_New(method->m_function, object, method->m_class);\n}\n\nstatic PyMethodDef Nuitka_Method_methods[] = {\n    {\"__reduce__\", (PyCFunction)Nuitka_Method_reduce, METH_NOARGS, NULL},\n    {\"__reduce_ex__\", (PyCFunction)Nuitka_Method_reduce_ex, METH_VARARGS, NULL},\n    {\"__deepcopy__\", (PyCFunction)Nuitka_Method_deepcopy, METH_O, NULL},\n    {NULL}};\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\nstatic PyObject *Nuitka_Method_tp_vectorcall(struct Nuitka_MethodObject *method, PyObject *const *stack, size_t nargsf,\n                                             PyObject *kwnames) {\n    assert(Nuitka_Method_Check((PyObject *)method));\n    assert(kwnames == NULL || PyTuple_CheckExact(kwnames));\n    Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);\n    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);\n\n    assert(nargs >= 0);\n    assert((nargs == 0 && nkwargs == 0) || stack != NULL);\n\n    Py_ssize_t totalargs = nargs + nkwargs;\n\n    // Shortcut possible, no args.\n    if (totalargs == 0) {\n        return Nuitka_CallMethodFunctionNoArgs(PyThreadState_GET(), method->m_function, method->m_object);\n    }\n\n    PyObject *result;\n\n    if (nargsf & PY_VECTORCALL_ARGUMENTS_OFFSET) {\n        /* We are allowed to mutate the stack. TODO: Is this the normal case, so\n           we can consider the else branch irrelevant? Also does it not make sense\n           to check pos arg and kw counts and shortcut somewhat. */\n\n        PyObject **new_args = (PyObject **)stack - 1;\n\n        PyObject *tmp = new_args[0];\n        new_args[0] = method->m_object;\n\n        CHECK_OBJECTS(new_args, totalargs + 1);\n\n        result = Nuitka_CallFunctionVectorcall(PyThreadState_GET(), method->m_function, new_args, nargs + 1,\n                                               kwnames ? &PyTuple_GET_ITEM(kwnames, 0) : NULL, nkwargs);\n\n        CHECK_OBJECTS(new_args, totalargs + 1);\n\n        new_args[0] = tmp;\n    } else {\n        /* Definitely having args at this point. */\n        assert(stack != NULL);\n\n        NUITKA_DYNAMIC_ARRAY_DECL(new_args, PyObject *, totalargs + 1);\n        new_args[0] = method->m_object;\n        memcpy(&new_args[1], stack, totalargs * sizeof(PyObject *));\n\n        CHECK_OBJECTS(new_args, totalargs + 1);\n\n        result = Nuitka_CallFunctionVectorcall(PyThreadState_GET(), method->m_function, new_args, nargs + 1,\n                                               kwnames ? &PyTuple_GET_ITEM(kwnames, 0) : NULL, nkwargs);\n\n        CHECK_OBJECTS(new_args, totalargs + 1);\n    }\n\n    return result;\n}\n#endif\n\nstatic PyObject *Nuitka_Method_tp_call(struct Nuitka_MethodObject *method, PyObject *args, PyObject *kw) {\n    Py_ssize_t arg_count = PyTuple_GET_SIZE(args);\n\n    if (method->m_object == NULL) {\n        if (unlikely(arg_count < 1)) {\n            PyErr_Format(\n                PyExc_TypeError,\n                \"unbound compiled_method %s%s must be called with %s instance as first argument (got nothing instead)\",\n                GET_CALLABLE_NAME((PyObject *)method->m_function), GET_CALLABLE_DESC((PyObject *)method->m_function),\n                GET_CLASS_NAME(method->m_class));\n            return NULL;\n        } else {\n            PyObject *self = PyTuple_GET_ITEM(args, 0);\n            CHECK_OBJECT(self);\n\n            int result = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(result < 0)) {\n                return NULL;\n            } else if (unlikely(result == 0)) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n        }\n\n        return Py_TYPE(method->m_function)->tp_call((PyObject *)method->m_function, args, kw);\n    } else {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        if (kw == NULL) {\n            if (arg_count == 0) {\n                return Nuitka_CallMethodFunctionNoArgs(tstate, method->m_function, method->m_object);\n            } else {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, method->m_function, method->m_object,\n                                                        &PyTuple_GET_ITEM(args, 0), arg_count);\n            }\n        } else {\n            return Nuitka_CallMethodFunctionPosArgsKwArgs(tstate, method->m_function, method->m_object,\n                                                          &PyTuple_GET_ITEM(args, 0), arg_count, kw);\n        }\n    }\n}\n\nstatic PyObject *Nuitka_Method_tp_descr_get(struct Nuitka_MethodObject *method, PyObject *object, PyObject *klass) {\n    // Don't rebind already bound methods.\n    if (method->m_object != NULL) {\n        Py_INCREF(method);\n        return (PyObject *)method;\n    }\n\n    if (method->m_class != NULL && klass != NULL) {\n        // Quick subclass test, bound methods remain the same if the class is a sub class\n        int result = PyObject_IsSubclass(klass, method->m_class);\n\n        if (unlikely(result < 0)) {\n            return NULL;\n        } else if (result == 0) {\n            Py_INCREF(method);\n            return (PyObject *)method;\n        }\n    }\n\n    return Nuitka_Method_New(method->m_function, object, klass);\n}\n\nstatic PyObject *Nuitka_Method_tp_getattro(struct Nuitka_MethodObject *method, PyObject *name) {\n    PyObject *descr = Nuitka_TypeLookup(&Nuitka_Method_Type, name);\n\n    if (descr != NULL) {\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr)) && (Py_TYPE(descr)->tp_descr_get != NULL)) {\n            return Py_TYPE(descr)->tp_descr_get(descr, (PyObject *)method, (PyObject *)Py_TYPE(method));\n        } else {\n            Py_INCREF(descr);\n            return descr;\n        }\n    }\n\n    // Delegate all other attributes to the underlying function.\n    // TODO: Could be a bit more direct here, and know this is generic lookup.\n    return PyObject_GetAttr((PyObject *)method->m_function, name);\n}\n\nstatic long Nuitka_Method_tp_traverse(struct Nuitka_MethodObject *method, visitproc visit, void *arg) {\n    Py_VISIT(method->m_function);\n    Py_VISIT(method->m_object);\n    Py_VISIT(method->m_class);\n\n    return 0;\n}\n\n// tp_repr slot, decide how a function shall be output\nstatic PyObject *Nuitka_Method_tp_repr(struct Nuitka_MethodObject *method) {\n    if (method->m_object == NULL) {\n#if PYTHON_VERSION < 0x300\n        return PyString_FromFormat(\"<unbound compiled_method %s.%s>\", GET_CLASS_NAME(method->m_class),\n                                   Nuitka_String_AsString(method->m_function->m_name));\n#else\n        return PyUnicode_FromFormat(\"<compiled_function %s at %p>\", Nuitka_String_AsString(method->m_function->m_name),\n                                    method->m_function);\n#endif\n    } else {\n        // Note: CPython uses repr of the object, although a comment despises\n        // it, we do it for compatibility.\n        PyObject *object_repr = PyObject_Repr(method->m_object);\n\n        if (object_repr == NULL) {\n            return NULL;\n        }\n#if PYTHON_VERSION < 0x300\n        else if (!PyString_Check(object_repr)) {\n            Py_DECREF(object_repr);\n            return NULL;\n        }\n#else\n        else if (!PyUnicode_Check(object_repr)) {\n            Py_DECREF(object_repr);\n            return NULL;\n        }\n#endif\n\n#if PYTHON_VERSION < 0x350\n        PyObject *result = Nuitka_String_FromFormat(\n            \"<bound compiled_method %s.%s of %s>\", GET_CLASS_NAME(method->m_class),\n            Nuitka_String_AsString(method->m_function->m_name), Nuitka_String_AsString_Unchecked(object_repr));\n#else\n        PyObject *result = PyUnicode_FromFormat(\"<bound compiled_method %s of %s>\",\n                                                Nuitka_String_AsString(method->m_function->m_qualname),\n                                                Nuitka_String_AsString_Unchecked(object_repr));\n#endif\n\n        Py_DECREF(object_repr);\n\n        return result;\n    }\n}\n\n#if PYTHON_VERSION < 0x300\nstatic int Nuitka_Method_tp_compare(struct Nuitka_MethodObject *a, struct Nuitka_MethodObject *b) {\n    if (a->m_function->m_counter < b->m_function->m_counter) {\n        return -1;\n    } else if (a->m_function->m_counter > b->m_function->m_counter) {\n        return 1;\n    } else if (a->m_object == b->m_object) {\n        return 0;\n    } else if (a->m_object == NULL) {\n        return -1;\n    } else if (b->m_object == NULL) {\n        return 1;\n    } else {\n        return PyObject_Compare(a->m_object, b->m_object);\n    }\n}\n#endif\n\nstatic PyObject *Nuitka_Method_tp_richcompare(struct Nuitka_MethodObject *a, struct Nuitka_MethodObject *b, int op) {\n    if (op != Py_EQ && op != Py_NE) {\n        Py_INCREF(Py_NotImplemented);\n        return Py_NotImplemented;\n    }\n\n    if (Nuitka_Method_Check((PyObject *)a) == false || Nuitka_Method_Check((PyObject *)b) == false) {\n        Py_INCREF(Py_NotImplemented);\n        return Py_NotImplemented;\n    }\n\n    bool b_res = a->m_function->m_counter == b->m_function->m_counter;\n\n    // If the underlying function objects are the same, check the objects, which\n    // may be NULL in case of unbound methods, which would be the same again.\n    if (b_res) {\n#if PYTHON_VERSION < 0x380\n        if (a->m_object == NULL) {\n            b_res = b->m_object == NULL;\n        } else if (b->m_object == NULL) {\n            b_res = false;\n        } else {\n            nuitka_bool nbool_res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(a->m_object, b->m_object);\n\n            if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n                return NULL;\n            }\n\n            b_res = nbool_res == NUITKA_BOOL_TRUE;\n        }\n#else\n        b_res = a->m_object == b->m_object;\n#endif\n    }\n\n    PyObject *result;\n\n    if (op == Py_EQ) {\n        result = BOOL_FROM(b_res);\n    } else {\n        result = BOOL_FROM(!b_res);\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic long Nuitka_Method_tp_hash(struct Nuitka_MethodObject *method) {\n    // Just give the hash of the method function, that ought to be good enough.\n    return method->m_function->m_counter;\n}\n\n#define MAX_METHOD_FREE_LIST_COUNT 100\nstatic struct Nuitka_MethodObject *free_list_methods = NULL;\nstatic int free_list_methods_count = 0;\n\nstatic void Nuitka_Method_tp_dealloc(struct Nuitka_MethodObject *method) {\n#ifndef __NUITKA_NO_ASSERT__\n    // Save the current exception, if any, we must to not corrupt it.\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state1;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state1);\n#endif\n\n    Nuitka_GC_UnTrack(method);\n\n    if (method->m_weakrefs != NULL) {\n        PyObject_ClearWeakRefs((PyObject *)method);\n    }\n\n    Py_XDECREF(method->m_object);\n    Py_XDECREF(method->m_class);\n\n    Py_DECREF((PyObject *)method->m_function);\n\n    /* Put the object into free list or release to GC */\n    releaseToFreeList(free_list_methods, method, MAX_METHOD_FREE_LIST_COUNT);\n\n#ifndef __NUITKA_NO_ASSERT__\n    struct Nuitka_ExceptionPreservationItem saved_exception_state2;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state2);\n\n    ASSERT_SAME_EXCEPTION_STATE(&saved_exception_state1, &saved_exception_state2);\n#endif\n}\n\nstatic PyObject *Nuitka_Method_tp_new(PyTypeObject *type, PyObject *args, PyObject *kw) {\n    PyObject *func;\n    PyObject *self;\n    PyObject *klass = NULL;\n\n    if (!_PyArg_NoKeywords(\"compiled_method\", kw)) {\n        return NULL;\n    }\n\n    if (!PyArg_UnpackTuple(args, \"compiled_method\", 2, 3, &func, &self, &klass)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(func);\n\n    if (!PyCallable_Check(func)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"first argument must be callable\");\n        return NULL;\n    }\n\n    if (self == Py_None) {\n        self = NULL;\n    }\n\n    if (self == NULL && klass == NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"unbound methods must have non-NULL im_class\");\n        return NULL;\n    }\n\n    if (Nuitka_Method_Check(func)) {\n        return Nuitka_Method_New(((struct Nuitka_MethodObject *)func)->m_function, self, klass);\n    }\n\n    if (Nuitka_Function_Check(func) == false) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT_NICE(\"Cannot create compiled_ method from type '%s'\", func);\n        return NULL;\n    }\n\n    return Nuitka_Method_New((struct Nuitka_FunctionObject *)func, self, klass);\n}\n\nPyTypeObject Nuitka_Method_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"compiled_method\",\n    sizeof(struct Nuitka_MethodObject),\n    0,\n    (destructor)Nuitka_Method_tp_dealloc, // tp_dealloc\n#if PYTHON_VERSION < 0x380 || defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\n    0, // tp_print\n#else\n    offsetof(struct Nuitka_MethodObject, m_vectorcall), // tp_vectorcall_offset\n#endif\n    0, // tp_getattr\n    0, // tp_setattr\n#if PYTHON_VERSION < 0x300\n    (cmpfunc)Nuitka_Method_tp_compare, // tp_compare\n#else\n    0,\n#endif\n    (reprfunc)Nuitka_Method_tp_repr,         // tp_repr\n    0,                                       // tp_as_number\n    0,                                       // tp_as_sequence\n    0,                                       // tp_as_mapping\n    (hashfunc)Nuitka_Method_tp_hash,         // tp_hash\n    (ternaryfunc)Nuitka_Method_tp_call,      // tp_call\n    0,                                       // tp_str\n    (getattrofunc)Nuitka_Method_tp_getattro, // tp_getattro\n    0,                                       // tp_setattro (PyObject_GenericSetAttr)\n    0,                                       // tp_as_buffer\n    Py_TPFLAGS_DEFAULT |                     // tp_flags\n#if PYTHON_VERSION < 0x300\n        Py_TPFLAGS_HAVE_WEAKREFS |\n#endif\n#if PYTHON_VERSION >= 0x380\n        _Py_TPFLAGS_HAVE_VECTORCALL |\n#endif\n        Py_TPFLAGS_HAVE_GC,\n    0,                                                // tp_doc\n    (traverseproc)Nuitka_Method_tp_traverse,          // tp_traverse\n    0,                                                // tp_clear\n    (richcmpfunc)Nuitka_Method_tp_richcompare,        // tp_richcompare\n    offsetof(struct Nuitka_MethodObject, m_weakrefs), // tp_weaklistoffset\n    0,                                                // tp_iter\n    0,                                                // tp_iternext\n    Nuitka_Method_methods,                            // tp_methods\n    Nuitka_Method_members,                            // tp_members\n    Nuitka_Method_tp_getset,                          // tp_getset\n    0,                                                // tp_base\n    0,                                                // tp_dict\n    (descrgetfunc)Nuitka_Method_tp_descr_get,         // tp_descr_get\n    0,                                                // tp_descr_set\n    0,                                                // tp_dictoffset\n    0,                                                // tp_init\n    0,                                                // tp_alloc\n    Nuitka_Method_tp_new,                             // tp_new\n    0,                                                // tp_free\n    0,                                                // tp_is_gc\n    0,                                                // tp_bases\n    0,                                                // tp_mro\n    0,                                                // tp_cache\n    0,                                                // tp_subclasses\n    0,                                                // tp_weaklist\n    0,                                                // tp_del\n    0                                                 // tp_version_tag\n#if PYTHON_VERSION >= 0x340\n    ,\n    0 /* tp_finalizer */\n#endif\n};\n\nvoid _initCompiledMethodType(void) {\n    Nuitka_PyType_Ready(&Nuitka_Method_Type, &PyMethod_Type, false, true, false, false, false);\n}\n\nPyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *klass) {\n    struct Nuitka_MethodObject *result;\n\n    CHECK_OBJECT((PyObject *)function);\n    assert(Nuitka_Function_Check((PyObject *)function));\n    assert(_PyObject_GC_IS_TRACKED(function));\n\n    allocateFromFreeListFixed(free_list_methods, struct Nuitka_MethodObject, Nuitka_Method_Type);\n\n    if (unlikely(result == NULL)) {\n        PyErr_Format(PyExc_RuntimeError, \"cannot create method %s\", Nuitka_String_AsString(function->m_name));\n\n        return NULL;\n    }\n\n    Py_INCREF(function);\n    result->m_function = function;\n\n    result->m_object = object;\n    Py_XINCREF(object);\n    result->m_class = klass;\n    Py_XINCREF(klass);\n\n    result->m_weakrefs = NULL;\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)\n    result->m_vectorcall = (vectorcallfunc)Nuitka_Method_tp_vectorcall;\n#endif\n\n    Nuitka_GC_Track(result);\n    return (PyObject *)result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersAllocator.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// For interacting with the Python GC unexposed details\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\ntypedef struct _gc_runtime_state GCState;\n\n#define AS_GC(o) ((PyGC_Head *)(((char *)(o)) - sizeof(PyGC_Head)))\n#define FROM_GC(g) ((PyObject *)(((char *)(g)) + sizeof(PyGC_Head)))\n\nstatic inline bool Nuitka_gc_is_collecting(PyGC_Head *g) { return (g->_gc_prev & _PyGC_PREV_MASK_COLLECTING) != 0; }\n\nstatic inline void Nuitka_gc_clear_collecting(PyGC_Head *g) { g->_gc_prev &= ~_PyGC_PREV_MASK_COLLECTING; }\n\nstatic inline Py_ssize_t Nuitka_gc_get_refs(PyGC_Head *g) { return (Py_ssize_t)(g->_gc_prev >> _PyGC_PREV_SHIFT); }\n\nstatic inline void Nuitka_gc_set_refs(PyGC_Head *g, Py_ssize_t refs) {\n    g->_gc_prev = (g->_gc_prev & ~_PyGC_PREV_MASK) | ((uintptr_t)(refs) << _PyGC_PREV_SHIFT);\n}\n\nstatic inline void Nuitka_gc_reset_refs(PyGC_Head *g, Py_ssize_t refs) {\n    g->_gc_prev = (g->_gc_prev & _PyGC_PREV_MASK_FINALIZED) | _PyGC_PREV_MASK_COLLECTING |\n                  ((uintptr_t)(refs) << _PyGC_PREV_SHIFT);\n}\n\nstatic inline void Nuitka_gc_decref(PyGC_Head *g) { g->_gc_prev -= 1 << _PyGC_PREV_SHIFT; }\n\n#define GEN_HEAD(gcstate, n) (&(gcstate)->generations[n].head)\n#define GC_NEXT _PyGCHead_NEXT\n#define GC_PREV _PyGCHead_PREV\n\nstatic void Nuitka_invoke_gc_callback(PyThreadState *tstate, const char *phase, int generation, Py_ssize_t collected,\n                                      Py_ssize_t uncollectable) {\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    GCState *gcstate = &tstate->interp->gc;\n    if (gcstate->callbacks == NULL) {\n        return;\n    }\n\n    PyObject *info = NULL;\n\n    if (PyList_GET_SIZE(gcstate->callbacks) != 0) {\n        assert(false);\n\n        info =\n            Py_BuildValue(\"{sisnsn}\", \"generation\", generation, \"collected\", collected, \"uncollectable\", uncollectable);\n\n        if (info == NULL) {\n            PyErr_WriteUnraisable(NULL);\n            return;\n        }\n    }\n\n    for (Py_ssize_t i = 0; i < PyList_GET_SIZE(gcstate->callbacks); i++) {\n        PyObject *r, *cb = PyList_GET_ITEM(gcstate->callbacks, i);\n        Py_INCREF(cb);\n\n        r = PyObject_CallFunction(cb, \"sO\", phase, info);\n\n        if (r == NULL) {\n            PyErr_WriteUnraisable(cb);\n        } else {\n            Py_DECREF(r);\n        }\n\n        Py_DECREF(cb);\n    }\n\n    Py_XDECREF(info);\n\n    assert(!HAS_ERROR_OCCURRED(tstate));\n}\n\nstatic inline bool Nuitka_gc_list_is_empty(PyGC_Head *list) { return (list->_gc_next == (uintptr_t)list); }\n\nstatic inline void Nuitka_gc_list_init(PyGC_Head *list) {\n    list->_gc_prev = (uintptr_t)list;\n    list->_gc_next = (uintptr_t)list;\n}\n\nstatic void Nuitka_gc_list_merge(PyGC_Head *from, PyGC_Head *to) {\n    if (Nuitka_gc_list_is_empty(from) == false) {\n        PyGC_Head *to_tail = GC_PREV(to);\n        PyGC_Head *from_head = GC_NEXT(from);\n        PyGC_Head *from_tail = GC_PREV(from);\n\n        assert(from_head != from);\n        assert(from_tail != from);\n\n        _PyGCHead_SET_NEXT(to_tail, from_head);\n        _PyGCHead_SET_PREV(from_head, to_tail);\n\n        _PyGCHead_SET_NEXT(from_tail, to);\n        _PyGCHead_SET_PREV(to, from_tail);\n    }\n\n    Nuitka_gc_list_init(from);\n}\n\nstatic void Nuitka_update_refs(PyGC_Head *containers) {\n    for (PyGC_Head *gc = GC_NEXT(containers); gc != containers; gc = GC_NEXT(gc)) {\n        Nuitka_gc_reset_refs(gc, Py_REFCNT(FROM_GC(gc)));\n    }\n}\n\nstatic int Nuitka_visit_decref(PyObject *op, void *parent) {\n    if (_PyObject_IS_GC(op)) {\n        PyGC_Head *gc = AS_GC(op);\n\n        if (Nuitka_gc_is_collecting(gc)) {\n            Nuitka_gc_decref(gc);\n        }\n    }\n\n    return 0;\n}\n\nstatic void Nuitka_subtract_refs(PyGC_Head *containers) {\n    for (PyGC_Head *gc = GC_NEXT(containers); gc != containers; gc = GC_NEXT(gc)) {\n        PyObject *op = FROM_GC(gc);\n        traverseproc traverse = Py_TYPE(op)->tp_traverse;\n        (void)traverse(op, (visitproc)Nuitka_visit_decref, op);\n    }\n}\n\n#define NEXT_MASK_UNREACHABLE 1\n\nstatic inline void Nuitka_gc_list_append(PyGC_Head *node, PyGC_Head *list) {\n    PyGC_Head *last = (PyGC_Head *)list->_gc_prev;\n\n    _PyGCHead_SET_PREV(node, last);\n    _PyGCHead_SET_NEXT(last, node);\n\n    _PyGCHead_SET_NEXT(node, list);\n    list->_gc_prev = (uintptr_t)node;\n}\n\nstatic inline void Nuitka_gc_list_remove(PyGC_Head *node) {\n    PyGC_Head *prev = GC_PREV(node);\n    PyGC_Head *next = GC_NEXT(node);\n\n    _PyGCHead_SET_NEXT(prev, next);\n    _PyGCHead_SET_PREV(next, prev);\n\n    node->_gc_next = 0;\n}\n\nstatic int Nuitka_visit_reachable(PyObject *op, PyGC_Head *reachable) {\n    if (!_PyObject_IS_GC(op)) {\n        return 0;\n    }\n\n    PyGC_Head *gc = AS_GC(op);\n    const Py_ssize_t gc_refs = Nuitka_gc_get_refs(gc);\n\n    if (Nuitka_gc_is_collecting(gc) == false) {\n        return 0;\n    }\n\n    assert(gc->_gc_next != 0);\n\n    if (gc->_gc_next & NEXT_MASK_UNREACHABLE) {\n        PyGC_Head *prev = GC_PREV(gc);\n        PyGC_Head *next = (PyGC_Head *)(gc->_gc_next & ~NEXT_MASK_UNREACHABLE);\n        prev->_gc_next = gc->_gc_next;\n        _PyGCHead_SET_PREV(next, prev);\n\n        Nuitka_gc_list_append(gc, reachable);\n        Nuitka_gc_set_refs(gc, 1);\n    } else if (gc_refs == 0) {\n        Nuitka_gc_set_refs(gc, 1);\n    }\n\n    return 0;\n}\n\nstatic void Nuitka_move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) {\n    PyGC_Head *prev = young;\n    PyGC_Head *gc = GC_NEXT(young);\n\n    while (gc != young) {\n        if (Nuitka_gc_get_refs(gc)) {\n            PyObject *op = FROM_GC(gc);\n            traverseproc traverse = Py_TYPE(op)->tp_traverse;\n\n            (void)traverse(op, (visitproc)Nuitka_visit_reachable, (void *)young);\n            _PyGCHead_SET_PREV(gc, prev);\n\n            Nuitka_gc_clear_collecting(gc);\n            prev = gc;\n        } else {\n            prev->_gc_next = gc->_gc_next;\n\n            PyGC_Head *last = GC_PREV(unreachable);\n            last->_gc_next = (NEXT_MASK_UNREACHABLE | (uintptr_t)gc);\n            _PyGCHead_SET_PREV(gc, last);\n            gc->_gc_next = (NEXT_MASK_UNREACHABLE | (uintptr_t)unreachable);\n            unreachable->_gc_prev = (uintptr_t)gc;\n        }\n        gc = (PyGC_Head *)prev->_gc_next;\n    }\n\n    young->_gc_prev = (uintptr_t)prev;\n    unreachable->_gc_next &= ~NEXT_MASK_UNREACHABLE;\n}\n\nstatic inline void Nuitka_deduce_unreachable(PyGC_Head *base, PyGC_Head *unreachable) {\n    Nuitka_update_refs(base);\n    Nuitka_subtract_refs(base);\n\n    Nuitka_gc_list_init(unreachable);\n    Nuitka_move_unreachable(base, unreachable);\n}\n\nstatic void Nuitka_untrack_tuples(PyGC_Head *head) {\n    PyGC_Head *gc = GC_NEXT(head);\n\n    while (gc != head) {\n        PyObject *op = FROM_GC(gc);\n        PyGC_Head *next = GC_NEXT(gc);\n\n        if (PyTuple_CheckExact(op)) {\n            // TODO: API function\n            _PyTuple_MaybeUntrack(op);\n        }\n\n        gc = next;\n    }\n}\n\nstatic Py_ssize_t Nuitka_gc_list_size(PyGC_Head *list) {\n    Py_ssize_t n = 0;\n\n    for (PyGC_Head *gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {\n        n += 1;\n    }\n\n    return n;\n}\n\nstatic void Nuitka_untrack_dicts(PyGC_Head *head) {\n    PyGC_Head *next, *gc = GC_NEXT(head);\n    while (gc != head) {\n        PyObject *op = FROM_GC(gc);\n        next = GC_NEXT(gc);\n        if (PyDict_CheckExact(op)) {\n            // TODO: API function\n            _PyDict_MaybeUntrack(op);\n        }\n        gc = next;\n    }\n}\n\nstatic bool Nuitka_has_legacy_finalizer(PyObject *op) { return Py_TYPE(op)->tp_del != NULL; }\n\nstatic void Nuitka_gc_list_move(PyGC_Head *node, PyGC_Head *list) {\n    PyGC_Head *from_prev = GC_PREV(node);\n    PyGC_Head *from_next = GC_NEXT(node);\n    _PyGCHead_SET_NEXT(from_prev, from_next);\n    _PyGCHead_SET_PREV(from_next, from_prev);\n\n    PyGC_Head *to_prev = (PyGC_Head *)list->_gc_prev;\n    _PyGCHead_SET_PREV(node, to_prev);\n    _PyGCHead_SET_NEXT(to_prev, node);\n    list->_gc_prev = (uintptr_t)node;\n    _PyGCHead_SET_NEXT(node, list);\n}\n\nstatic void Nuitka_move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) {\n    PyGC_Head *next;\n    for (PyGC_Head *gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {\n        PyObject *op = FROM_GC(gc);\n\n        _PyObject_ASSERT(op, gc->_gc_next & NEXT_MASK_UNREACHABLE);\n        gc->_gc_next &= ~NEXT_MASK_UNREACHABLE;\n        next = (PyGC_Head *)gc->_gc_next;\n\n        if (Nuitka_has_legacy_finalizer(op)) {\n            Nuitka_gc_clear_collecting(gc);\n            Nuitka_gc_list_move(gc, finalizers);\n        }\n    }\n}\n\nstatic int Nuitka_visit_move(PyObject *op, PyGC_Head *tolist) {\n    if (_PyObject_IS_GC(op)) {\n        PyGC_Head *gc = AS_GC(op);\n        if (Nuitka_gc_is_collecting(gc)) {\n            Nuitka_gc_list_move(gc, tolist);\n            Nuitka_gc_clear_collecting(gc);\n        }\n    }\n\n    // Required for traverseproc\n    return 0;\n}\n\nstatic void Nuitka_move_legacy_finalizer_reachable(PyGC_Head *finalizers) {\n    for (PyGC_Head *gc = GC_NEXT(finalizers); gc != finalizers; gc = GC_NEXT(gc)) {\n        traverseproc traverse = Py_TYPE(FROM_GC(gc))->tp_traverse;\n        (void)traverse(FROM_GC(gc), (visitproc)Nuitka_visit_move, (void *)finalizers);\n    }\n}\n\nstatic void Nuitka_finalize_garbage(PyThreadState *tstate, PyGC_Head *collectable) {\n    destructor finalize;\n    PyGC_Head seen;\n\n    Nuitka_gc_list_init(&seen);\n\n    while (Nuitka_gc_list_is_empty(collectable) == false) {\n        PyGC_Head *gc = GC_NEXT(collectable);\n        PyObject *op = FROM_GC(gc);\n        Nuitka_gc_list_move(gc, &seen);\n\n        if (!_PyGCHead_FINALIZED(gc) && (finalize = Py_TYPE(op)->tp_finalize) != NULL) {\n            _PyGCHead_SET_FINALIZED(gc);\n            Py_INCREF(op);\n            finalize(op);\n            assert(!HAS_ERROR_OCCURRED(tstate));\n            Py_DECREF(op);\n        }\n    }\n    Nuitka_gc_list_merge(&seen, collectable);\n}\n\nstatic int Nuitka_handle_weakrefs(PyThreadState *tstate, PyGC_Head *unreachable, PyGC_Head *old) {\n    PyGC_Head *gc;\n    PyObject *op;\n    PyWeakReference *wr;\n    PyGC_Head wrcb_to_call;\n    PyGC_Head *next;\n    int num_freed = 0;\n\n    Nuitka_gc_list_init(&wrcb_to_call);\n\n    for (gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {\n        PyWeakReference **wrlist;\n\n        op = FROM_GC(gc);\n        next = GC_NEXT(gc);\n\n        if (PyWeakref_Check(op)) {\n            _PyWeakref_ClearRef((PyWeakReference *)op);\n        }\n\n        if (!_PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))\n            continue;\n\n        wrlist = (PyWeakReference **)_PyObject_GET_WEAKREFS_LISTPTR(op);\n\n        for (wr = *wrlist; wr != NULL; wr = *wrlist) {\n            PyGC_Head *wrasgc;\n\n            _PyWeakref_ClearRef(wr);\n\n            if (wr->wr_callback == NULL) {\n                continue;\n            }\n\n            if (Nuitka_gc_is_collecting(AS_GC(wr))) {\n                continue;\n            }\n\n            Py_INCREF(wr);\n\n            wrasgc = AS_GC(wr);\n            Nuitka_gc_list_move(wrasgc, &wrcb_to_call);\n        }\n    }\n\n    while (Nuitka_gc_list_is_empty(&wrcb_to_call) == false) {\n        PyObject *temp;\n        PyObject *callback;\n\n        gc = (PyGC_Head *)wrcb_to_call._gc_next;\n        op = FROM_GC(gc);\n        wr = (PyWeakReference *)op;\n        callback = wr->wr_callback;\n\n        temp = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, callback, (PyObject *)wr);\n        if (temp == NULL)\n            PyErr_WriteUnraisable(callback);\n        else\n            Py_DECREF(temp);\n\n        Py_DECREF(op);\n        if (wrcb_to_call._gc_next == (uintptr_t)gc) {\n            Nuitka_gc_list_move(gc, old);\n        } else {\n            ++num_freed;\n        }\n    }\n\n    return num_freed;\n}\n\nstatic inline void Nuitka_gc_list_clear_collecting(PyGC_Head *collectable) {\n    for (PyGC_Head *gc = GC_NEXT(collectable); gc != collectable; gc = GC_NEXT(gc)) {\n        Nuitka_gc_clear_collecting(gc);\n    }\n}\n\nstatic inline void Nuitka_clear_unreachable_mask(PyGC_Head *unreachable) {\n    PyGC_Head *next;\n\n    for (PyGC_Head *gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {\n        gc->_gc_next &= ~NEXT_MASK_UNREACHABLE;\n        next = (PyGC_Head *)gc->_gc_next;\n    }\n}\n\nstatic inline void handle_resurrected_objects(PyGC_Head *unreachable, PyGC_Head *still_unreachable,\n                                              PyGC_Head *old_generation) {\n    Nuitka_gc_list_clear_collecting(unreachable);\n\n    PyGC_Head *resurrected = unreachable;\n    Nuitka_deduce_unreachable(resurrected, still_unreachable);\n    Nuitka_clear_unreachable_mask(still_unreachable);\n\n    Nuitka_gc_list_merge(resurrected, old_generation);\n}\n\nstatic void Nuitka_delete_garbage(PyThreadState *tstate, GCState *gcstate, PyGC_Head *collectable, PyGC_Head *old) {\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    while (Nuitka_gc_list_is_empty(collectable) == false) {\n        PyGC_Head *gc = GC_NEXT(collectable);\n        PyObject *op = FROM_GC(gc);\n\n        _PyObject_ASSERT_WITH_MSG(op, Py_REFCNT(op) > 0, \"refcount is too small\");\n\n        {\n            inquiry clear;\n            if ((clear = Py_TYPE(op)->tp_clear) != NULL) {\n                Py_INCREF(op);\n                (void)clear(op);\n                if (HAS_ERROR_OCCURRED(tstate)) {\n                    _PyErr_WriteUnraisableMsg(\"in tp_clear of\", (PyObject *)Py_TYPE(op));\n                }\n                Py_DECREF(op);\n            }\n        }\n        if (GC_NEXT(collectable) == gc) {\n            Nuitka_gc_clear_collecting(gc);\n            Nuitka_gc_list_move(gc, old);\n        }\n    }\n}\n\nstatic void Nuitka_handle_legacy_finalizers(PyThreadState *tstate, GCState *gcstate, PyGC_Head *finalizers,\n                                            PyGC_Head *old) {\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    for (PyGC_Head *gc = GC_NEXT(finalizers); gc != finalizers; gc = GC_NEXT(gc)) {\n        PyObject *op = FROM_GC(gc);\n\n        if (Nuitka_has_legacy_finalizer(op)) {\n            if (PyList_Append(gcstate->garbage, op) < 0) {\n                CLEAR_ERROR_OCCURRED(tstate);\n                break;\n            }\n        }\n    }\n\n    Nuitka_gc_list_merge(finalizers, old);\n}\n\nstatic Py_ssize_t Nuitka_gc_collect_main(PyThreadState *tstate, int generation, Py_ssize_t *n_collected,\n                                         Py_ssize_t *n_uncollectable) {\n    int i;\n    Py_ssize_t m = 0;\n    Py_ssize_t n = 0;\n    PyGC_Head *young;\n    PyGC_Head *old;\n    PyGC_Head unreachable;\n    PyGC_Head finalizers;\n    PyGC_Head *gc;\n\n    GCState *gcstate = &tstate->interp->gc;\n\n    assert(gcstate->garbage != NULL);\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    if (generation + 1 < NUM_GENERATIONS) {\n        gcstate->generations[generation + 1].count += 1;\n    }\n\n    for (i = 0; i <= generation; i++) {\n        gcstate->generations[i].count = 0;\n    }\n\n    for (i = 0; i < generation; i++) {\n        Nuitka_gc_list_merge(GEN_HEAD(gcstate, i), GEN_HEAD(gcstate, generation));\n    }\n\n    young = GEN_HEAD(gcstate, generation);\n    if (generation < NUM_GENERATIONS - 1) {\n        old = GEN_HEAD(gcstate, generation + 1);\n    } else {\n        old = young;\n    }\n\n    Nuitka_deduce_unreachable(young, &unreachable);\n\n    Nuitka_untrack_tuples(young);\n\n    if (young != old) {\n        if (generation == NUM_GENERATIONS - 2) {\n            gcstate->long_lived_pending += Nuitka_gc_list_size(young);\n        }\n\n        Nuitka_gc_list_merge(young, old);\n    } else {\n        Nuitka_untrack_dicts(young);\n\n        gcstate->long_lived_pending = 0;\n        gcstate->long_lived_total = Nuitka_gc_list_size(young);\n    }\n\n    Nuitka_gc_list_init(&finalizers);\n\n    Nuitka_move_legacy_finalizers(&unreachable, &finalizers);\n\n    Nuitka_move_legacy_finalizer_reachable(&finalizers);\n\n    m += Nuitka_handle_weakrefs(tstate, &unreachable, old);\n\n    Nuitka_finalize_garbage(tstate, &unreachable);\n\n    PyGC_Head final_unreachable;\n    handle_resurrected_objects(&unreachable, &final_unreachable, old);\n\n    m += Nuitka_gc_list_size(&final_unreachable);\n    Nuitka_delete_garbage(tstate, gcstate, &final_unreachable, old);\n\n    for (gc = GC_NEXT(&finalizers); gc != &finalizers; gc = GC_NEXT(gc)) {\n        n++;\n    }\n\n    Nuitka_handle_legacy_finalizers(tstate, gcstate, &finalizers, old);\n\n    if (HAS_ERROR_OCCURRED(tstate)) {\n        _PyErr_WriteUnraisableMsg(\"in garbage collection\", NULL);\n    }\n\n    if (n_collected) {\n        *n_collected = m;\n    }\n    if (n_uncollectable) {\n        *n_uncollectable = n;\n    }\n\n    struct gc_generation_stats *stats = &gcstate->generation_stats[generation];\n    stats->collections++;\n    stats->collected += m;\n    stats->uncollectable += n;\n\n    assert(!HAS_ERROR_OCCURRED(tstate));\n    return n + m;\n}\n\nstatic Py_ssize_t Nuitka_gc_collect_with_callback(PyThreadState *tstate, int generation) {\n    assert(!HAS_ERROR_OCCURRED(tstate));\n\n    Nuitka_invoke_gc_callback(tstate, \"start\", generation, 0, 0);\n    Py_ssize_t collected, uncollectable;\n    Py_ssize_t result = Nuitka_gc_collect_main(tstate, generation, &collected, &uncollectable);\n    Nuitka_invoke_gc_callback(tstate, \"stop\", generation, collected, uncollectable);\n\n    assert(!HAS_ERROR_OCCURRED(tstate));\n    return result;\n}\n\nstatic Py_ssize_t Nuitka_gc_collect_generations(PyThreadState *tstate) {\n    GCState *gcstate = &tstate->interp->gc;\n\n    Py_ssize_t n = 0;\n\n    for (int i = NUM_GENERATIONS - 1; i >= 0; i--) {\n        if (gcstate->generations[i].count > gcstate->generations[i].threshold) {\n            if (i == NUM_GENERATIONS - 1 && gcstate->long_lived_pending < gcstate->long_lived_total / 4)\n                continue;\n\n            n = Nuitka_gc_collect_with_callback(tstate, i);\n            break;\n        }\n    }\n\n    return n;\n}\n\n// This is called during object creation and might trigger garbage collection\nvoid Nuitka_PyObject_GC_Link(PyObject *op) {\n    PyGC_Head *g = AS_GC(op);\n\n    PyThreadState *tstate = _PyThreadState_GET();\n    GCState *gcstate = &tstate->interp->gc;\n\n    g->_gc_next = 0;\n    g->_gc_prev = 0;\n    gcstate->generations[0].count++;\n\n    if (gcstate->generations[0].count > gcstate->generations[0].threshold && gcstate->enabled &&\n        gcstate->generations[0].threshold && !gcstate->collecting && !HAS_ERROR_OCCURRED(tstate)) {\n\n        gcstate->collecting = 1;\n        Nuitka_gc_collect_generations(tstate);\n        gcstate->collecting = 0;\n    }\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersAttributes.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// spell-checker: ignore klass\n\n#if PYTHON_VERSION < 0x300\nPyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *klass, PyObject *attr_name) {\n    CHECK_OBJECT(klass);\n    CHECK_OBJECT(attr_name);\n\n    assert(PyClass_Check(klass));\n    assert(PyString_CheckExact(attr_name));\n\n    PyObject *result = GET_STRING_DICT_VALUE((PyDictObject *)klass->cl_dict, (PyStringObject *)attr_name);\n\n    if (result == NULL) {\n        assert(PyTuple_Check(klass->cl_bases));\n\n        Py_ssize_t base_count = PyTuple_GET_SIZE(klass->cl_bases);\n\n        for (Py_ssize_t i = 0; i < base_count; i++) {\n            result = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)PyTuple_GET_ITEM(klass->cl_bases, i), attr_name);\n\n            if (result != NULL) {\n                break;\n            }\n        }\n    }\n\n    return result;\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *LOOKUP_INSTANCE(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    assert(PyInstance_Check(source));\n    assert(PyString_CheckExact(attr_name));\n\n    PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n    // The special cases have their own variant on the code generation level\n    // as we are called with constants only.\n    assert(attr_name != const_str_plain___dict__);\n    assert(attr_name != const_str_plain___class__);\n\n    // Try the instance dict first.\n    PyObject *result = GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n    if (result) {\n        Py_INCREF(result);\n        return result;\n    }\n\n    // Next see if a class has it\n    result = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n    if (result != NULL) {\n        descrgetfunc func = Py_TYPE(result)->tp_descr_get;\n\n        if (func) {\n            result = func(result, source, (PyObject *)source_instance->in_class);\n\n            if (unlikely(result == NULL)) {\n                return NULL;\n            }\n\n            CHECK_OBJECT(result);\n\n            return result;\n        } else {\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Finally allow a __getattr__ to handle it or else it's an error.\n    if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n        PyErr_Format(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                     PyString_AS_STRING(source_instance->in_class->cl_name), PyString_AS_STRING(attr_name));\n\n        return NULL;\n    } else {\n        PyObject *args[] = {source, attr_name};\n        return CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args);\n    }\n}\n#endif\n\nPyObject *LOOKUP_ATTRIBUTE(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    /* Note: There are 2 specializations of this function, that need to be\n     * updated in line with this: LOOKUP_ATTRIBUTE_[DICT|CLASS]_SLOT\n     */\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    return PyObject_GetAttr(source, attr_name);\n#else\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *result = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    return result;\n                }\n            }\n        }\n\n        PyObject *dict = NULL;\n\n// TODO: This is what Python 3.11 requires us to add.\n#if PYTHON_VERSION >= 0x3b0 && 0\n        if ((type->tp_flags & Py_TPFLAGS_MANAGED_DICT) && *_PyObject_ValuesPointer(source)) {\n            PyObject **dict_pointer;\n\n            PyDictValues **values_ptr = _PyObject_ValuesPointer(source);\n\n            // TODO: Seems we would benefit by knowing this on the outside.\n            if (PyUnicode_CheckExact(attr_name)) {\n                assert(*_PyObject_DictPointer(source) == NULL);\n                PyObject *result = _PyObject_GetInstanceAttribute(source, *values_ptr, attr_name);\n                if (result != NULL) {\n                    return result;\n                }\n            } else {\n                dict_pointer = _PyObject_DictPointer(source);\n                assert(dict_pointer != NULL && *dict_pointer == NULL);\n\n                *dict_pointer = dict = _PyObject_MakeDictFromInstanceAttributes(source, *values_ptr);\n                if (unlikely(dict == NULL)) {\n                    return NULL;\n                }\n                *values_ptr = NULL;\n            }\n        }\n#endif\n\n        if (dict == NULL) {\n            Py_ssize_t dict_offset = type->tp_dictoffset;\n\n            if (dict_offset != 0) {\n\n                // Negative dictionary offsets have special meaning.\n                if (dict_offset < 0) {\n                    Py_ssize_t tsize;\n                    size_t size;\n\n                    tsize = ((PyVarObject *)source)->ob_size;\n                    if (tsize < 0) {\n                        tsize = -tsize;\n                    }\n                    size = _PyObject_VAR_SIZE(type, tsize);\n\n                    dict_offset += (long)size;\n                }\n\n                PyObject **dict_pointer = (PyObject **)((char *)source + dict_offset);\n                dict = *dict_pointer;\n            }\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            // TODO: If this is an exact dict, we don't have to hold a reference, is it?\n            Py_INCREF(dict);\n\n            PyObject *result = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            Py_DECREF(dict);\n\n            if (result != NULL) {\n                Py_XDECREF(descr);\n\n                CHECK_OBJECT(result);\n                return result;\n            }\n        }\n\n        if (func != NULL) {\n            PyObject *result = func(descr, source, (PyObject *)type);\n            Py_DECREF(descr);\n\n            CHECK_OBJECT_X(result);\n            return result;\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n            return descr;\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                     PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type->tp_getattro == PyInstance_Type.tp_getattro && Nuitka_String_CheckExact(attr_name)) {\n        PyObject *result = LOOKUP_INSTANCE(tstate, source, attr_name);\n        return result;\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *result = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        CHECK_OBJECT(result);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *result = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n        return result;\n    } else {\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                     Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n#endif\n}\n\nPyObject *LOOKUP_ATTRIBUTE_DICT_SLOT(PyThreadState *tstate, PyObject *source) {\n    CHECK_OBJECT(source);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    return PyObject_GetAttr(source, const_str_plain___dict__);\n#else\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, const_str_plain___dict__);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *result = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dict_offset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dict_offset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dict_offset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0)\n                    tsize = -tsize;\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dict_offset += (long)size;\n            }\n\n            PyObject **dict_pointer = (PyObject **)((char *)source + dict_offset);\n            dict = *dict_pointer;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *result = DICT_GET_ITEM1(tstate, dict, const_str_plain___dict__);\n\n            if (result != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                CHECK_OBJECT(result);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            PyObject *result = func(descr, source, (PyObject *)type);\n            Py_DECREF(descr);\n\n            CHECK_OBJECT_X(result);\n            return result;\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n            return descr;\n        }\n\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '__dict__'\", type->tp_name);\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type->tp_getattro == PyInstance_Type.tp_getattro) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n        PyObject *result = source_instance->in_dict;\n\n        Py_INCREF(result);\n        return result;\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *result = (*type->tp_getattro)(source, const_str_plain___dict__);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        CHECK_OBJECT(result);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *result = (*type->tp_getattr)(source, (char *)\"__dict__\");\n        return result;\n    } else {\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '__dict__'\", type->tp_name);\n\n        return NULL;\n    }\n#endif\n}\n\nPyObject *LOOKUP_ATTRIBUTE_CLASS_SLOT(PyThreadState *tstate, PyObject *source) {\n    CHECK_OBJECT(source);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    return PyObject_GetAttr(source, const_str_plain___class__);\n#else\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, const_str_plain___class__);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *result = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dict_offset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dict_offset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dict_offset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dict_offset += (long)size;\n            }\n\n            PyObject **dict_pointer = (PyObject **)((char *)source + dict_offset);\n            dict = *dict_pointer;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *result = DICT_GET_ITEM1(tstate, dict, const_str_plain___class__);\n\n            if (result != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                CHECK_OBJECT(result);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            PyObject *result = func(descr, source, (PyObject *)type);\n            Py_DECREF(descr);\n\n            CHECK_OBJECT_X(result);\n            return result;\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n            return descr;\n        }\n\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '__class__'\", type->tp_name);\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type->tp_getattro == PyInstance_Type.tp_getattro) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n        PyObject *result = (PyObject *)source_instance->in_class;\n\n        Py_INCREF(result);\n        return result;\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *result = (*type->tp_getattro)(source, const_str_plain___class__);\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        CHECK_OBJECT(result);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *result = (*type->tp_getattr)(source, (char *)\"__class__\");\n        return result;\n    } else {\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '__class__'\", type->tp_name);\n\n        return NULL;\n    }\n#endif\n}\n\nint BUILTIN_HASATTR_BOOL(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n#if PYTHON_VERSION < 0x300\n    if (PyUnicode_Check(attr_name)) {\n        attr_name = _PyUnicode_AsDefaultEncodedString(attr_name, NULL);\n\n        if (unlikely(attr_name == NULL)) {\n            return -1;\n        }\n    }\n\n    if (unlikely(!PyString_Check(attr_name))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"hasattr(): attribute name must be string\");\n\n        return -1;\n    }\n#else\n    if (unlikely(!PyUnicode_Check(attr_name))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"hasattr(): attribute name must be string\");\n\n        return -1;\n    }\n#endif\n\n    // TODO: This should use what LOOKUP_ATTRIBUTE does and know that the result value is going to\n    // be unused, having an easier time generally, e.g. not having to create the error in the first\n    // place.\n    PyObject *value = PyObject_GetAttr(source, attr_name);\n\n    if (value == NULL) {\n        if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n            return -1;\n        }\n        return 0;\n    }\n\n    Py_DECREF(value);\n\n    return 1;\n}\n\nbool HAS_ATTR_BOOL(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    return PyObject_HasAttr(source, attr_name);\n#else\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                CLEAR_ERROR_OCCURRED(tstate);\n\n                return false;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *result = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    if (result) {\n                        CHECK_OBJECT(result);\n\n                        Py_DECREF(result);\n                        return true;\n                    }\n\n                    DROP_ERROR_OCCURRED(tstate);\n                    return false;\n                }\n            }\n        }\n\n        Py_ssize_t dict_offset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dict_offset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dict_offset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dict_offset += (long)size;\n            }\n\n            PyObject **dict_pointer = (PyObject **)((char *)source + dict_offset);\n            dict = *dict_pointer;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            // TODO: If this is an exact dict, we don't have to hold a reference, is it?\n            Py_INCREF(dict);\n\n            PyObject *result = DICT_GET_ITEM1(tstate, dict, attr_name);\n            DROP_ERROR_OCCURRED(tstate);\n\n            Py_DECREF(dict);\n\n            if (result != NULL) {\n                Py_XDECREF(descr);\n\n                CHECK_OBJECT(result);\n\n                Py_DECREF(result);\n                return true;\n            }\n        }\n\n        if (func != NULL) {\n            PyObject *result = func(descr, source, (PyObject *)type);\n            Py_DECREF(descr);\n\n            if (result != NULL) {\n                CHECK_OBJECT(result);\n\n                Py_DECREF(result);\n                return true;\n            }\n\n            if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n                return false;\n            }\n            return true;\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            Py_DECREF(descr);\n            return true;\n        }\n\n        return false;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type->tp_getattro == PyInstance_Type.tp_getattro && Nuitka_String_CheckExact(attr_name)) {\n        PyObject *result = LOOKUP_INSTANCE(tstate, source, attr_name);\n\n        if (result == NULL) {\n            CLEAR_ERROR_OCCURRED(tstate);\n\n            return false;\n        }\n\n        CHECK_OBJECT(result);\n\n        Py_DECREF(result);\n        return true;\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *result = (*type->tp_getattro)(source, attr_name);\n\n        if (result == NULL) {\n            DROP_ERROR_OCCURRED(tstate);\n\n            return false;\n        }\n\n        CHECK_OBJECT(result);\n        Py_DECREF(result);\n        return true;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *result = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (result == NULL) {\n            CLEAR_ERROR_OCCURRED(tstate);\n\n            return false;\n        }\n\n        CHECK_OBJECT(result);\n        Py_DECREF(result);\n        return true;\n    } else {\n        return false;\n    }\n#endif\n}\n\nint HAS_ATTR_BOOL2(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    PyObject *result = PyObject_GetAttr(source, attr_name);\n\n    if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n        return -1;\n    }\n\n    if (result == NULL) {\n        return 0;\n    }\n\n    return CHECK_IF_TRUE(result) ? 1 : 0;\n#else\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return -1;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            // Hold a refcount, Nuitka_TypeLookup does not give any.\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *result = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    if (result) {\n                        CHECK_OBJECT(result);\n\n                        Py_DECREF(result);\n                        return 1;\n                    }\n\n                    DROP_ERROR_OCCURRED(tstate);\n                    return 0;\n                }\n            }\n        }\n\n        Py_ssize_t dict_offset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dict_offset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dict_offset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dict_offset += (long)size;\n            }\n\n            PyObject **dict_pointer = (PyObject **)((char *)source + dict_offset);\n            dict = *dict_pointer;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            // TODO: If this is an exact dict, we don't have to hold a reference, is it?\n            Py_INCREF(dict);\n\n            PyObject *result = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n                return -1;\n            }\n\n            Py_DECREF(dict);\n\n            if (result != NULL) {\n                Py_XDECREF(descr);\n\n                CHECK_OBJECT(result);\n\n                Py_DECREF(result);\n                return 1;\n            }\n        }\n\n        if (func != NULL) {\n            PyObject *result = func(descr, source, (PyObject *)type);\n            Py_DECREF(descr);\n\n            if (result != NULL) {\n                CHECK_OBJECT(result);\n\n                Py_DECREF(result);\n                return 1;\n            }\n\n            if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n                return -1;\n            }\n            return 0;\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            Py_DECREF(descr);\n            return 1;\n        }\n\n        return 0;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type->tp_getattro == PyInstance_Type.tp_getattro && Nuitka_String_CheckExact(attr_name)) {\n        PyObject *result = LOOKUP_INSTANCE(tstate, source, attr_name);\n\n        if (result == NULL) {\n            return -1;\n        }\n\n        CHECK_OBJECT(result);\n\n        Py_DECREF(result);\n        return true;\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *result = (*type->tp_getattro)(source, attr_name);\n\n        if (result == NULL) {\n            if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n                return -1;\n            }\n\n            return 0;\n        }\n\n        CHECK_OBJECT(result);\n        Py_DECREF(result);\n        return true;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *result = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (result == NULL) {\n            if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate) == false) {\n                return -1;\n            }\n\n            return 0;\n        }\n\n        CHECK_OBJECT(result);\n        Py_DECREF(result);\n\n        return 1;\n    } else {\n        return 0;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nextern PyObject *CALL_FUNCTION_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args);\n\nstatic bool SET_INSTANCE(PyThreadState *tstate, PyObject *target, PyObject *attr_name, PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(attr_name);\n    CHECK_OBJECT(value);\n\n    assert(PyInstance_Check(target));\n    assert(PyString_Check(attr_name));\n\n    PyInstanceObject *target_instance = (PyInstanceObject *)target;\n\n    // The special cases should get their own SET_ATTRIBUTE_xxxx_SLOT variants\n    // on the code generation level as SET_ATTRIBUTE is called with constants\n    // only.\n    assert(attr_name != const_str_plain___dict__);\n    assert(attr_name != const_str_plain___class__);\n\n    if (target_instance->in_class->cl_setattr != NULL) {\n        PyObject *args[] = {target, attr_name, value};\n        PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, target_instance->in_class->cl_setattr, args);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(result);\n\n        return true;\n    } else {\n        int status = PyDict_SetItem(target_instance->in_dict, attr_name, value);\n\n        if (unlikely(status != 0)) {\n            return false;\n        }\n\n        return true;\n    }\n}\n#endif\n\n#if (PYTHON_VERSION < 0x300 || defined(_NUITKA_USE_UNEXPOSED_API)) && !defined(_NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT)\n\n// Classes in Python3 might share keys.\n#define CACHED_KEYS(type) (((PyHeapTypeObject *)type)->ht_cached_keys)\n\nstatic bool SET_ATTRIBUTE_GENERIC(PyThreadState *tstate, PyTypeObject *type, PyObject *target, PyObject *attr_name,\n                                  PyObject *value) {\n    // Unfortunately this is required, although of cause rarely necessary.\n    if (unlikely(type->tp_dict == NULL)) {\n        if (unlikely(PyType_Ready(type) < 0)) {\n            return false;\n        }\n    }\n\n    PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n\n    if (descr != NULL) {\n        Py_INCREF(descr);\n\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            descrsetfunc func = Py_TYPE(descr)->tp_descr_set;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                int res = func(descr, target, value);\n                Py_DECREF(descr);\n\n                return res == 0;\n            }\n        }\n    }\n\n    Py_ssize_t dict_offset = type->tp_dictoffset;\n    PyObject *dict = NULL;\n\n    if (dict_offset != 0) {\n        // Negative dictionary offsets have special meaning.\n        if (dict_offset < 0) {\n            Py_ssize_t tsize;\n            size_t size;\n\n            tsize = ((PyVarObject *)target)->ob_size;\n            if (tsize < 0) {\n                tsize = -tsize;\n            }\n            size = _PyObject_VAR_SIZE(type, tsize);\n\n            dict_offset += (long)size;\n        }\n\n        PyObject **dict_pointer = (PyObject **)((char *)target + dict_offset);\n\n#if PYTHON_VERSION >= 0x300\n        if ((type->tp_flags & Py_TPFLAGS_HEAPTYPE) && (CACHED_KEYS(type) != NULL)) {\n            int res = _PyObjectDict_SetItem(type, dict_pointer, attr_name, value);\n\n            // TODO: Not possible for set, is it?\n            if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError)) {\n                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError, attr_name);\n                return false;\n            }\n\n            return res >= 0;\n        } else\n#endif\n        {\n            dict = *dict_pointer;\n\n            if (dict == NULL) {\n                dict = MAKE_DICT_EMPTY();\n                *dict_pointer = dict;\n            }\n        }\n    }\n\n    if (dict != NULL) {\n        CHECK_OBJECT(dict);\n\n        // TODO: If this is an exact dict, we don't have to hold a reference, is it?\n        Py_INCREF(dict);\n\n        int res = PyDict_SetItem(dict, attr_name, value);\n\n        Py_DECREF(dict);\n        Py_XDECREF(descr);\n\n        return res == 0;\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                 PyString_AS_STRING(attr_name));\n#else\n    PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n    return false;\n}\n\n#endif\n\nbool SET_ATTRIBUTE(PyThreadState *tstate, PyObject *target, PyObject *attr_name, PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(attr_name);\n    CHECK_OBJECT(value);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_ATTR_OPT\n    int res = PyObject_SetAttr(target, attr_name, value);\n    return res == 0;\n#else\n    PyTypeObject *type = Py_TYPE(target);\n\n#if PYTHON_VERSION < 0x300 || defined(_NUITKA_USE_UNEXPOSED_API)\n    if (hasTypeGenericSetAttr(type)) {\n        return SET_ATTRIBUTE_GENERIC(tstate, type, target, attr_name, value);\n    }\n#endif\n#if PYTHON_VERSION < 0x300\n    if (type->tp_setattro == PyInstance_Type.tp_setattro) {\n        return SET_INSTANCE(tstate, target, attr_name, value);\n    }\n#endif\n    if (type->tp_setattro != NULL) {\n        int status = (*type->tp_setattro)(target, attr_name, value);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    if (type->tp_setattr != NULL) {\n        int status = (*type->tp_setattr)(target, (char *)Nuitka_String_AsString_Unchecked(attr_name), value);\n\n        if (unlikely(status == -1)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    if (type->tp_getattr == NULL && type->tp_getattro == NULL) {\n        PyErr_Format(PyExc_TypeError, \"'%s' object has no attributes (assign to %s)\", type->tp_name,\n                     Nuitka_String_AsString_Unchecked(attr_name));\n\n        return false;\n    } else {\n        PyErr_Format(PyExc_TypeError, \"'%s' object has only read-only attributes (assign to %s)\", type->tp_name,\n                     Nuitka_String_AsString_Unchecked(attr_name));\n\n        return false;\n    }\n#endif\n}\n\nbool SET_ATTRIBUTE_DICT_SLOT(PyThreadState *tstate, PyObject *target, PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(value);\n\n#if PYTHON_VERSION < 0x300\n    if (likely(PyInstance_Check(target))) {\n        PyInstanceObject *target_instance = (PyInstanceObject *)target;\n\n        /* Note seems this doesn't have to be an exact dictionary. */\n        if (unlikely(!PyDict_Check(value))) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__dict__ must be set to a dictionary\");\n            return false;\n        }\n\n        PyObject *old = target_instance->in_dict;\n\n        Py_INCREF(value);\n        target_instance->in_dict = value;\n\n        Py_DECREF(old);\n    } else\n#endif\n    {\n        PyTypeObject *type = Py_TYPE(target);\n\n        if (type->tp_setattro != NULL) {\n            int status = (*type->tp_setattro)(target, const_str_plain___dict__, value);\n\n            if (unlikely(status == -1)) {\n                return false;\n            }\n        } else if (type->tp_setattr != NULL) {\n            int status = (*type->tp_setattr)(target, (char *)\"__dict__\", value);\n\n            if (unlikely(status == -1)) {\n                return false;\n            }\n        } else if (type->tp_getattr == NULL && type->tp_getattro == NULL) {\n            PyErr_Format(PyExc_TypeError, \"'%s' object has no attributes (assign to __dict__)\", type->tp_name);\n\n            return false;\n        } else {\n            PyErr_Format(PyExc_TypeError, \"'%s' object has only read-only attributes (assign to __dict__)\",\n                         type->tp_name);\n\n            return false;\n        }\n    }\n\n    return true;\n}\n\nbool SET_ATTRIBUTE_CLASS_SLOT(PyThreadState *tstate, PyObject *target, PyObject *value) {\n    CHECK_OBJECT(target);\n    CHECK_OBJECT(value);\n\n#if PYTHON_VERSION < 0x300\n    if (likely(PyInstance_Check(target))) {\n        PyInstanceObject *target_instance = (PyInstanceObject *)target;\n\n        if (unlikely(!PyClass_Check(value))) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__class__ must be set to a class\");\n            return false;\n        }\n\n        PyObject *old = (PyObject *)(target_instance->in_class);\n        Py_INCREF(value);\n        target_instance->in_class = (PyClassObject *)value;\n        Py_DECREF(old);\n    } else\n#endif\n    {\n        PyTypeObject *type = Py_TYPE(target);\n\n        if (type->tp_setattro != NULL) {\n            int status = (*type->tp_setattro)(target, const_str_plain___class__, value);\n\n            if (unlikely(status == -1)) {\n                return false;\n            }\n        } else if (type->tp_setattr != NULL) {\n            int status = (*type->tp_setattr)(target, (char *)\"__class__\", value);\n\n            if (unlikely(status == -1)) {\n                return false;\n            }\n        } else if (type->tp_getattr == NULL && type->tp_getattro == NULL) {\n            PyErr_Format(PyExc_TypeError, \"'%s' object has no attributes (assign to __class__)\", type->tp_name);\n\n            return false;\n        } else {\n            PyErr_Format(PyExc_TypeError, \"'%s' object has only read-only attributes (assign to __class__)\",\n                         type->tp_name);\n\n            return false;\n        }\n    }\n\n    return true;\n}\n\nPyObject *LOOKUP_SPECIAL(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n#if PYTHON_VERSION < 0x300\n    if (PyInstance_Check(source)) {\n        return LOOKUP_INSTANCE(tstate, source, attr_name);\n    }\n#endif\n\n    // TODO: There is heavy optimization in CPython to avoid it. Potentially\n    // that's worth it to imitate that.\n\n    PyObject *result = Nuitka_TypeLookup(Py_TYPE(source), attr_name);\n\n    if (likely(result)) {\n        descrgetfunc func = Py_TYPE(result)->tp_descr_get;\n\n        if (func == NULL) {\n            Py_INCREF(result);\n            return result;\n        } else {\n            PyObject *func_result = func(result, source, (PyObject *)(Py_TYPE(source)));\n\n            if (unlikely(func_result == NULL)) {\n                return NULL;\n            }\n\n            CHECK_OBJECT(func_result);\n            return func_result;\n        }\n    }\n\n#if PYTHON_VERSION < 0x3b0\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError, attr_name);\n#else\n    // TODO: Maybe we should have dedicated variations with the 4 hard coded\n    // attribute names, might save a bit of complexity to large programs not\n    // having to pass constant values in what is a frequent construct.\n    if (attr_name == const_str_plain___exit__) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\n            \"'%s' object does not support the context manager protocol (missed __exit__ method)\", source);\n    } else if (attr_name == const_str_plain___aexit__) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\n            \"'%s' object does not support the asynchronous context manager protocol (missed __aexit__ method)\", source);\n    } else if (attr_name == const_str_plain___aenter__) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object does not support the asynchronous context manager protocol\",\n                                             source);\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object does not support the context manager protocol\", source);\n    }\n#endif\n    return NULL;\n}\n\nPyObject *LOOKUP_MODULE_VALUE(PyDictObject *module_dict, PyObject *var_name) {\n    PyObject *result = GET_STRING_DICT_VALUE(module_dict, (Nuitka_StringObject *)var_name);\n\n    if (unlikely(result == NULL)) {\n        result = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)var_name);\n    }\n\n    return result;\n}\n\nPyObject *GET_MODULE_VARIABLE_VALUE_FALLBACK(PyThreadState *tstate, PyObject *variable_name) {\n    PyObject *result = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)variable_name);\n\n    if (unlikely(result == NULL)) {\n        SET_CURRENT_EXCEPTION_NAME_ERROR(tstate, variable_name);\n    }\n\n    return result;\n}\n\n#if PYTHON_VERSION < 0x340\nPyObject *GET_MODULE_VARIABLE_VALUE_FALLBACK_IN_FUNCTION(PyThreadState *tstate, PyObject *variable_name) {\n    PyObject *result = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)variable_name);\n\n    if (unlikely(result == NULL)) {\n        SET_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(tstate, variable_name);\n    }\n\n    return result;\n}\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersBuiltin.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For calling built-ins, calls it and uses keyword dictionary if necessary.\n *\n * This helper simplifies calling built-ins with optional arguments that can\n * be given as keyword arguments. We basically re-construct the minimal call\n * using keywords here. This obviously is for inefficient calls to the original\n * built-in and should be avoided.\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPyObject *CALL_BUILTIN_KW_ARGS(PyThreadState *tstate, PyObject *callable, PyObject **args, char const **arg_names,\n                               int max_args) {\n    int i = 0;\n\n    while (i < max_args) {\n        if (args[i] == NULL)\n            break;\n\n        CHECK_OBJECT(args[i]);\n\n        i++;\n    }\n\n    int usable_args = i;\n\n    PyObject *kw_dict = NULL;\n\n    while (i < max_args) {\n        if (args[i] != NULL) {\n            CHECK_OBJECT(args[i]);\n\n            if (kw_dict == NULL) {\n                kw_dict = MAKE_DICT_EMPTY();\n            }\n\n            NUITKA_MAY_BE_UNUSED int res = PyDict_SetItemString(kw_dict, arg_names[i], args[i]);\n            assert(res == 0);\n        }\n\n        i++;\n    }\n\n    PyObject *args_tuple = MAKE_TUPLE(args, usable_args);\n\n    PyObject *result = CALL_FUNCTION(tstate, callable, args_tuple, kw_dict);\n    Py_XDECREF(kw_dict);\n    Py_DECREF(args_tuple);\n\n    return result;\n}\n\n/** The \"compile\" built-in.\n *\n */\n\nNUITKA_DEFINE_BUILTIN(compile)\n\n#if PYTHON_VERSION < 0x300\nPyObject *COMPILE_CODE(PyThreadState *tstate, PyObject *source_code, PyObject *file_name, PyObject *mode,\n                       PyObject *flags, PyObject *dont_inherit)\n#else\nPyObject *COMPILE_CODE(PyThreadState *tstate, PyObject *source_code, PyObject *file_name, PyObject *mode,\n                       PyObject *flags, PyObject *dont_inherit, PyObject *optimize)\n#endif\n{\n    // May be a source, but also could already be a compiled object, in which\n    // case this should just return it.\n    if (PyCode_Check(source_code)) {\n        Py_INCREF(source_code);\n        return source_code;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE3(source_code, file_name, mode);\n\n    PyObject *kw_values[] = {\n        flags,\n        dont_inherit,\n#if PYTHON_VERSION >= 0x300\n        optimize,\n#endif\n    };\n\n    char const *kw_keys[] = {\n        \"flags\",\n        \"dont_inherit\",\n#if PYTHON_VERSION >= 0x300\n        \"optimize\",\n#endif\n    };\n\n    PyObject *kw_args = MAKE_DICT_X_CSTR(kw_keys, kw_values, sizeof(kw_values) / sizeof(PyObject *));\n\n    NUITKA_ASSIGN_BUILTIN(compile);\n\n    PyObject *result = CALL_FUNCTION(tstate, NUITKA_ACCESS_BUILTIN(compile), pos_args, kw_args);\n\n    Py_DECREF(pos_args);\n    Py_XDECREF(kw_args);\n\n    return result;\n}\n\n/**\n * Helper used to deal with exec statement\n */\n\n#if PYTHON_VERSION < 0x300\n\nbool EXEC_FILE_ARG_HANDLING(PyThreadState *tstate, PyObject **prog, PyObject **name) {\n    CHECK_OBJECT(*prog);\n    CHECK_OBJECT(*name);\n\n    if (PyFile_Check(*prog)) {\n        PyObject *old = *name;\n        *name = PyFile_Name(*prog);\n        Py_INCREF(*name);\n        Py_DECREF(old);\n\n        if (unlikely(*name == NULL)) {\n            return false;\n        }\n\n        old = *prog;\n        *prog = CALL_METHOD_NO_ARGS(tstate, *prog, const_str_plain_read);\n        Py_DECREF(old);\n\n        if (unlikely(*prog == NULL)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n#endif\n\n/**\n *  The \"eval\" implementation, used for \"exec\" too.\n */\n\nPyObject *EVAL_CODE(PyThreadState *tstate, PyObject *code, PyObject *globals, PyObject *locals, PyObject *closure) {\n    CHECK_OBJECT(code);\n    CHECK_OBJECT(globals);\n    CHECK_OBJECT(locals);\n\n    if (PyDict_Check(globals) == 0) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"exec: arg 2 must be a dictionary or None\");\n        return NULL;\n    }\n\n    // TODO: Our re-formulation prevents this externally, doesn't it.\n    if (locals == Py_None) {\n        locals = globals;\n    }\n\n    if (PyMapping_Check(locals) == 0) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"exec: arg 3 must be a mapping or None\");\n        return NULL;\n    }\n\n    // Set the __builtins__ in globals, it is expected to be present.\n    if (PyDict_Check(globals) && DICT_HAS_ITEM(tstate, globals, const_str_plain___builtins__) == 0) {\n        if (PyDict_SetItem(globals, const_str_plain___builtins__, (PyObject *)builtin_module) != 0) {\n            return NULL;\n        }\n    }\n\n    if (isFakeCodeObject((PyCodeObject *)code)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError,\n                                        \"compiled function code objects do not work with exec/eval\");\n        return NULL;\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyObject *result = PyEval_EvalCode((PyCodeObject *)code, globals, locals);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result = PyEval_EvalCode(code, globals, locals);\n#else\n    PyObject *result = PyEval_EvalCodeEx(code, globals, locals, NULL, 0, NULL, 0, NULL, 0, NULL, closure);\n#endif\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\n/** The \"open\" built-in.\n *\n * Different for Python2 and Python3, the later has more arguments and\n * both accept keyword arguments.\n *\n **/\n\nNUITKA_DEFINE_BUILTIN(open);\n\n#if PYTHON_VERSION < 0x300\nPyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObject *mode, PyObject *buffering) {\n    NUITKA_ASSIGN_BUILTIN(open);\n\n    PyObject *result;\n\n    if (TRACE_FILE_OPEN(tstate, file_name, mode, buffering, &result)) {\n        return result;\n    }\n\n    PyObject *args[] = {file_name, mode, buffering};\n\n    char const *arg_names[] = {\"name\", \"mode\", \"buffering\"};\n\n    return CALL_BUILTIN_KW_ARGS(tstate, NUITKA_ACCESS_BUILTIN(open), args, arg_names, 3);\n}\n#else\nPyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObject *mode, PyObject *buffering,\n                       PyObject *encoding, PyObject *errors, PyObject *newline, PyObject *closefd, PyObject *opener) {\n    NUITKA_ASSIGN_BUILTIN(open);\n\n    PyObject *result;\n\n    if (TRACE_FILE_OPEN(tstate, file_name, mode, buffering, encoding, errors, newline, closefd, opener, &result)) {\n        return result;\n    }\n\n    PyObject *args[] = {file_name, mode, buffering, encoding, errors, newline, closefd, opener};\n\n    char const *arg_names[] = {\"file\", \"mode\", \"buffering\", \"encoding\", \"errors\", \"newline\", \"closefd\", \"opener\"};\n\n    return CALL_BUILTIN_KW_ARGS(tstate, NUITKA_ACCESS_BUILTIN(open), args, arg_names, 8);\n}\n\n#endif\n\nNUITKA_DEFINE_BUILTIN(input);\n\nPyObject *BUILTIN_INPUT(PyThreadState *tstate, PyObject *prompt) {\n    NUITKA_ASSIGN_BUILTIN(input);\n\n#if NUITKA_STDERR_NOT_VISIBLE && (PYTHON_VERSION >= 0x300 || !defined(_WIN32))\n    if (prompt != NULL) {\n        PRINT_ITEM(prompt);\n        prompt = NULL;\n    }\n#endif\n\n    if (prompt == NULL) {\n        return CALL_FUNCTION_NO_ARGS(tstate, NUITKA_ACCESS_BUILTIN(input));\n    } else {\n        return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(input), prompt);\n    }\n}\n\n/** The \"staticmethod\" built-in.\n *\n **/\n\nNUITKA_DEFINE_BUILTIN(staticmethod)\n\nPyObject *BUILTIN_STATICMETHOD(PyThreadState *tstate, PyObject *value) {\n    NUITKA_ASSIGN_BUILTIN(staticmethod);\n\n    return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(staticmethod), value);\n}\n\n/** The \"classmethod\" built-in.\n *\n **/\n\nNUITKA_DEFINE_BUILTIN(classmethod)\n\nPyObject *BUILTIN_CLASSMETHOD(PyThreadState *tstate, PyObject *value) {\n    NUITKA_ASSIGN_BUILTIN(classmethod);\n\n    return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(classmethod), value);\n}\n\n#if PYTHON_VERSION >= 0x300\n\n/** The \"bytes\" built-in.\n *\n * Only for Python3. There is not BYTES_BUILTIN1 yet, this only delegates to\n * the actual built-in which is wasteful. TODO: Have dedicated implementation\n * for this.\n *\n **/\n\nNUITKA_DEFINE_BUILTIN(bytes);\n\nPyObject *BUILTIN_BYTES1(PyThreadState *tstate, PyObject *value) {\n    NUITKA_ASSIGN_BUILTIN(bytes);\n\n    return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(bytes), value);\n}\n\nPyObject *BUILTIN_BYTES3(PyThreadState *tstate, PyObject *value, PyObject *encoding, PyObject *errors) {\n    NUITKA_ASSIGN_BUILTIN(bytes);\n\n    PyObject *args[] = {value, encoding, errors};\n\n    char const *arg_names[] = {\"value\", \"encoding\", \"errors\"};\n\n    return CALL_BUILTIN_KW_ARGS(tstate, NUITKA_ACCESS_BUILTIN(bytes), args, arg_names, 3);\n}\n#endif\n\n/** The \"bin\" built-in.\n *\n **/\n\nPyObject *BUILTIN_BIN(PyObject *value) {\n    // Note: I don't really know why \"oct\" and \"hex\" don't use this as well.\n    PyObject *result = PyNumber_ToBase(value, 2);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\n/** The \"oct\" built-in.\n *\n **/\n\nPyObject *BUILTIN_OCT(PyThreadState *tstate, PyObject *value) {\n#if PYTHON_VERSION >= 0x300\n    PyObject *result = PyNumber_ToBase(value, 8);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n#else\n    if (unlikely(value == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"oct() argument can't be converted to oct\");\n        return NULL;\n    }\n\n    PyNumberMethods *nb = Py_TYPE(value)->tp_as_number;\n\n    if (unlikely(nb == NULL || nb->nb_oct == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"oct() argument can't be converted to oct\");\n        return NULL;\n    }\n\n    PyObject *result = (*nb->nb_oct)(value);\n\n    if (result) {\n        if (unlikely(!PyString_Check(result))) {\n            PyErr_Format(PyExc_TypeError, \"__oct__ returned non-string (type %s)\", Py_TYPE(result)->tp_name);\n\n            Py_DECREF(result);\n            return NULL;\n        }\n    }\n\n    return result;\n#endif\n}\n\n/** The \"hex\" built-in.\n *\n **/\n\nPyObject *BUILTIN_HEX(PyThreadState *tstate, PyObject *value) {\n#if PYTHON_VERSION >= 0x300\n    PyObject *result = PyNumber_ToBase(value, 16);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n#else\n    if (unlikely(value == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"hex() argument can't be converted to hex\");\n        return NULL;\n    }\n\n    PyNumberMethods *nb = Py_TYPE(value)->tp_as_number;\n\n    if (unlikely(nb == NULL || nb->nb_hex == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"hex() argument can't be converted to hex\");\n        return NULL;\n    }\n\n    PyObject *result = (*nb->nb_hex)(value);\n\n    if (likely(result)) {\n        if (unlikely(!PyString_Check(result))) {\n            PyErr_Format(PyExc_TypeError, \"__hex__ returned non-string (type %s)\", Py_TYPE(result)->tp_name);\n\n            Py_DECREF(result);\n            return NULL;\n        }\n    }\n\n    return result;\n#endif\n}\n\n/** The \"hash\" built-in.\n *\n **/\n\nstatic void SET_HASH_NOT_IMPLEMENTED_ERROR(PyThreadState *tstate, PyObject *value) {\n    // TODO: Use our own formatting code.\n\n    PyErr_Format(PyExc_TypeError, \"unhashable type: '%s'\", Py_TYPE(value)->tp_name);\n}\n\n#if PYTHON_VERSION < 0x300\n// Helper to make hash from pointer value, compatible with CPython.\nstatic long Nuitka_HashFromPointer(void *p) {\n    size_t y = (size_t)p;\n    y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4));\n    long x = (long)y;\n    if (unlikely(x == -1)) {\n        x = -2;\n    }\n    return x;\n}\n#endif\n\nPyObject *BUILTIN_HASH(PyThreadState *tstate, PyObject *value) {\n    PyTypeObject *type = Py_TYPE(value);\n\n    if (likely(type->tp_hash != NULL)) {\n        Py_hash_t hash = (*type->tp_hash)(value);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n\n#if PYTHON_VERSION < 0x300\n        return PyInt_FromLong(hash);\n#else\n        return PyLong_FromSsize_t(hash);\n#endif\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {\n        Py_hash_t hash = Nuitka_HashFromPointer(value);\n        return PyInt_FromLong(hash);\n    }\n#endif\n\n    SET_HASH_NOT_IMPLEMENTED_ERROR(tstate, value);\n    return NULL;\n}\n\nPy_hash_t HASH_VALUE_WITH_ERROR(PyThreadState *tstate, PyObject *value) {\n    PyTypeObject *type = Py_TYPE(value);\n\n    if (likely(type->tp_hash != NULL)) {\n        Py_hash_t hash = (*type->tp_hash)(value);\n        return hash;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {\n        return Nuitka_HashFromPointer(value);\n    }\n#endif\n\n    SET_HASH_NOT_IMPLEMENTED_ERROR(tstate, value);\n    return -1;\n}\n\nPy_hash_t HASH_VALUE_WITHOUT_ERROR(PyThreadState *tstate, PyObject *value) {\n    PyTypeObject *type = Py_TYPE(value);\n\n    if (likely(type->tp_hash != NULL)) {\n        Py_hash_t hash = (*type->tp_hash)(value);\n\n        if (unlikely(hash == -1)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n\n        return hash;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {\n        return Nuitka_HashFromPointer(value);\n    }\n#endif\n\n    return -1;\n}\n\n/** The \"bytearray\" built-in.\n *\n * These should be more in-lined maybe, as a lot of checks are not necessary\n * and the error checking for the 3 arguments variant may even not be enough,\n * as it could be keyword arguments.\n *\n **/\n\nPyObject *BUILTIN_BYTEARRAY1(PyObject *value) {\n    PyObject *result = PyByteArray_FromObject(value);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\nNUITKA_DEFINE_BUILTIN(bytearray)\n\nPyObject *BUILTIN_BYTEARRAY3(PyThreadState *tstate, PyObject *string, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(string);\n    CHECK_OBJECT(encoding);\n\n    NUITKA_ASSIGN_BUILTIN(bytearray);\n\n    if (errors == NULL) {\n        PyObject *args[] = {string, encoding};\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, NUITKA_ACCESS_BUILTIN(bytearray), args);\n\n        return result;\n    } else {\n        PyObject *args[] = {string, encoding, errors};\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, NUITKA_ACCESS_BUILTIN(bytearray), args);\n\n        return result;\n    }\n}\n\n/** The \"iter\" built-in.\n *\n * This comes in two flavors, with one or two arguments. The second one\n * creates a \"calliterobject\" that is private to CPython. We define it here\n * for ourselves. The one argument version is in headers for in-lining of\n * the code.\n *\n **/\n\n// From CPython:\ntypedef struct {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        PyObject *it_callable;\n    PyObject *it_sentinel;\n} calliterobject;\n\nPyObject *BUILTIN_ITER2(PyObject *callable, PyObject *sentinel) {\n    calliterobject *result = (calliterobject *)Nuitka_GC_New(&PyCallIter_Type);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    // Note: References were taken at call site already.\n    result->it_callable = callable;\n    Py_INCREF(callable);\n    result->it_sentinel = sentinel;\n    Py_INCREF(sentinel);\n\n    Nuitka_GC_Track(result);\n\n    return (PyObject *)result;\n}\n\n/** The \"type\" built-in.\n *\n * This comes in two flavors, one being the detection of a values type,\n * and 3 argument variant creates a new type.\n *\n **/\n\nPyObject *BUILTIN_TYPE1(PyObject *arg) {\n    CHECK_OBJECT(arg);\n\n    PyObject *result = (PyObject *)Py_TYPE(arg);\n    CHECK_OBJECT(result);\n\n    Py_INCREF(result);\n    return result;\n}\n\nPyObject *BUILTIN_TYPE3(PyThreadState *tstate, PyObject *module_name, PyObject *name, PyObject *bases, PyObject *dict) {\n    PyObject *pos_args = MAKE_TUPLE3(name, bases, dict);\n\n    PyObject *result = PyType_Type.tp_new(&PyType_Type, pos_args, NULL);\n\n    if (unlikely(result == NULL)) {\n        Py_DECREF(pos_args);\n        return NULL;\n    }\n\n    PyTypeObject *type = Py_TYPE(result);\n\n    if (likely(Nuitka_Type_IsSubtype(type, &PyType_Type))) {\n        if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n            int res = type->tp_init(result, pos_args, NULL);\n\n            if (unlikely(res < 0)) {\n                Py_DECREF(pos_args);\n                Py_DECREF(result);\n                return NULL;\n            }\n        }\n    }\n\n    Py_DECREF(pos_args);\n\n    if (HAS_ATTR_BOOL(tstate, result, const_str_plain___module__) == false) {\n        int res = SET_ATTRIBUTE(tstate, result, const_str_plain___module__, module_name);\n\n        if (res < 0) {\n            Py_DECREF(result);\n            return NULL;\n        }\n    }\n\n    return result;\n}\n\n/** The \"super\" built-in.\n *\n *\n **/\n\nNUITKA_DEFINE_BUILTIN(super);\n\nPyObject *BUILTIN_SUPER2(PyThreadState *tstate, PyDictObject *module_dict, PyObject *type, PyObject *object) {\n    CHECK_OBJECT(type);\n    CHECK_OBJECT_X(object);\n\n    PyObject *super_value = GET_STRING_DICT_VALUE(module_dict, (Nuitka_StringObject *)const_str_plain_super);\n\n    if (super_value == NULL) {\n        NUITKA_ASSIGN_BUILTIN(super);\n\n        super_value = NUITKA_ACCESS_BUILTIN(super);\n    }\n\n    if (object != NULL) {\n        PyObject *args[] = {type, object};\n\n        return CALL_FUNCTION_WITH_ARGS2(tstate, super_value, args);\n    } else {\n        return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, super_value, type);\n    }\n}\n\nPyObject *BUILTIN_SUPER0(PyThreadState *tstate, PyDictObject *module_dict, PyObject *type, PyObject *object) {\n    if (object == Py_None) {\n        object = NULL;\n    }\n\n    return BUILTIN_SUPER2(tstate, module_dict, type, object);\n}\n\n/** The \"callable\" built-in.\n *\n **/\n\nPyObject *BUILTIN_CALLABLE(PyObject *value) {\n    int res = PyCallable_Check(value);\n    PyObject *result = BOOL_FROM(res != 0);\n    Py_INCREF(result);\n    return result;\n}\n\n/* The \"getattr\" built-in with default value.\n *\n * We might want to split it off for a variant without default value.\n *\n **/\n\nPyObject *BUILTIN_GETATTR(PyThreadState *tstate, PyObject *object, PyObject *attribute, PyObject *default_value) {\n    CHECK_OBJECT(object);\n    CHECK_OBJECT(attribute);\n    CHECK_OBJECT_X(default_value);\n\n#if PYTHON_VERSION < 0x300\n    if (PyUnicode_Check(attribute)) {\n        attribute = _PyUnicode_AsDefaultEncodedString(attribute, NULL);\n\n        if (unlikely(attribute == NULL)) {\n            return NULL;\n        }\n    }\n\n    if (unlikely(!PyString_Check(attribute))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"getattr(): attribute name must be string\");\n        return NULL;\n    }\n#else\n    if (!PyUnicode_Check(attribute)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"getattr(): attribute name must be string\");\n        return NULL;\n    }\n#endif\n\n    PyObject *result = PyObject_GetAttr(object, attribute);\n\n    if (result == NULL) {\n        if (default_value != NULL &&\n            EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n\n            Py_INCREF(default_value);\n            return default_value;\n        } else {\n            return NULL;\n        }\n    } else {\n        return result;\n    }\n}\n\n/** The \"setattr\" built-in.\n *\n **/\n\nPyObject *BUILTIN_SETATTR(PyObject *object, PyObject *attribute, PyObject *value) {\n    int res = PyObject_SetAttr(object, attribute, value);\n\n    if (unlikely(res < 0)) {\n        return NULL;\n    }\n\n    // No reference returned.\n    return Py_None;\n}\n\nPyObject *BUILTIN_INT2(PyThreadState *tstate, PyObject *value, PyObject *base) {\n#if PYTHON_VERSION < 0x340\n    long base_int = PyInt_AsLong(base);\n#else\n    Py_ssize_t base_int = PyNumber_AsSsize_t(base, NULL);\n#endif\n\n    if (unlikely(base_int == -1)) {\n        PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n        if (likely(error)) {\n#if PYTHON_VERSION >= 0x300\n            if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_OverflowError)) {\n                PyErr_Format(PyExc_ValueError,\n#if PYTHON_VERSION < 0x324\n                             \"int() arg 2 must be >= 2 and <= 36\"\n#elif PYTHON_VERSION < 0x364\n                             \"int() base must be >= 2 and <= 36\"\n#else\n                             \"int() base must be >= 2 and <= 36, or 0\"\n#endif\n                );\n            }\n#endif\n            return NULL;\n        }\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (unlikely((base_int != 0 && base_int < 2) || base_int > 36)) {\n        PyErr_Format(PyExc_ValueError,\n#if PYTHON_VERSION < 0x324\n                     \"int() arg 2 must be >= 2 and <= 36\"\n#elif PYTHON_VERSION < 0x364\n                     \"int() base must be >= 2 and <= 36\"\n#else\n                     \"int() base must be >= 2 and <= 36, or 0\"\n#endif\n        );\n\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(!Nuitka_String_Check(value) && !PyUnicode_Check(value))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"int() can't convert non-string with explicit base\");\n        return NULL;\n    }\n\n    char *value_str = Nuitka_String_AsString(value);\n    if (unlikely(value_str == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = PyInt_FromString(value_str, NULL, base_int);\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n#else\n    if (PyUnicode_Check(value)) {\n        return PyLong_FromUnicodeObject(value, (int)base_int);\n    } else if (PyBytes_Check(value) || PyByteArray_Check(value)) {\n        // Check for \"NUL\" as PyLong_FromString has no length parameter,\n        Py_ssize_t size = Py_SIZE(value);\n        char const *value_str;\n\n        if (PyByteArray_Check(value)) {\n            value_str = PyByteArray_AS_STRING(value);\n        } else {\n            value_str = PyBytes_AS_STRING(value);\n        }\n\n        PyObject *result = NULL;\n\n        if (size != 0 && strlen(value_str) == (size_t)size) {\n            result = PyLong_FromString((char *)value_str, NULL, (int)base_int);\n        }\n\n        if (unlikely(result == NULL)) {\n            PyErr_Format(PyExc_ValueError, \"invalid literal for int() with base %d: %R\", base_int, value);\n\n            return NULL;\n        }\n\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"int() can't convert non-string with explicit base\");\n        return NULL;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\n// Note: Python3 uses TO_INT2 function.\nPyObject *BUILTIN_LONG2(PyThreadState *tstate, PyObject *value, PyObject *base) {\n    long base_int = PyInt_AsLong(base);\n\n    if (unlikely(base_int == -1)) {\n        if (likely(HAS_ERROR_OCCURRED(tstate))) {\n            return NULL;\n        }\n    }\n\n    if (unlikely(!Nuitka_String_Check(value) && !PyUnicode_Check(value))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"long() can't convert non-string with explicit base\");\n        return NULL;\n    }\n\n    char *value_str = Nuitka_String_AsString(value);\n    if (unlikely(value_str == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = PyLong_FromString(value_str, NULL, base_int);\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersBuiltinTypeMethods.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperBuiltinMethodOperation.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_capitalize = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_center = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_count = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_decode = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_encode = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_endswith = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_expandtabs = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_find = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nPyObject *str_builtin_format = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_index = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_isalnum = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_isalpha = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_isdigit = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_islower = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_isspace = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_istitle = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_isupper = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_join = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_ljust = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_lower = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_lstrip = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_partition = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_replace = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rfind = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rindex = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rjust = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rpartition = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rsplit = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_rstrip = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_split = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_splitlines = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_startswith = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_strip = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_swapcase = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_title = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_translate = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_upper = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *str_builtin_zfill = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic void _initStrBuiltinMethods(void) {\n    str_builtin_capitalize = PyObject_GetAttrString((PyObject *)&PyString_Type, \"capitalize\");\n    str_builtin_center = PyObject_GetAttrString((PyObject *)&PyString_Type, \"center\");\n    str_builtin_count = PyObject_GetAttrString((PyObject *)&PyString_Type, \"count\");\n    str_builtin_decode = PyObject_GetAttrString((PyObject *)&PyString_Type, \"decode\");\n    str_builtin_encode = PyObject_GetAttrString((PyObject *)&PyString_Type, \"encode\");\n    str_builtin_endswith = PyObject_GetAttrString((PyObject *)&PyString_Type, \"endswith\");\n    str_builtin_expandtabs = PyObject_GetAttrString((PyObject *)&PyString_Type, \"expandtabs\");\n    str_builtin_find = PyObject_GetAttrString((PyObject *)&PyString_Type, \"find\");\n    str_builtin_format = PyObject_GetAttrString((PyObject *)&PyString_Type, \"format\");\n    str_builtin_index = PyObject_GetAttrString((PyObject *)&PyString_Type, \"index\");\n    str_builtin_isalnum = PyObject_GetAttrString((PyObject *)&PyString_Type, \"isalnum\");\n    str_builtin_isalpha = PyObject_GetAttrString((PyObject *)&PyString_Type, \"isalpha\");\n    str_builtin_isdigit = PyObject_GetAttrString((PyObject *)&PyString_Type, \"isdigit\");\n    str_builtin_islower = PyObject_GetAttrString((PyObject *)&PyString_Type, \"islower\");\n    str_builtin_isspace = PyObject_GetAttrString((PyObject *)&PyString_Type, \"isspace\");\n    str_builtin_istitle = PyObject_GetAttrString((PyObject *)&PyString_Type, \"istitle\");\n    str_builtin_isupper = PyObject_GetAttrString((PyObject *)&PyString_Type, \"isupper\");\n    str_builtin_join = PyObject_GetAttrString((PyObject *)&PyString_Type, \"join\");\n    str_builtin_ljust = PyObject_GetAttrString((PyObject *)&PyString_Type, \"ljust\");\n    str_builtin_lower = PyObject_GetAttrString((PyObject *)&PyString_Type, \"lower\");\n    str_builtin_lstrip = PyObject_GetAttrString((PyObject *)&PyString_Type, \"lstrip\");\n    str_builtin_partition = PyObject_GetAttrString((PyObject *)&PyString_Type, \"partition\");\n    str_builtin_replace = PyObject_GetAttrString((PyObject *)&PyString_Type, \"replace\");\n    str_builtin_rfind = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rfind\");\n    str_builtin_rindex = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rindex\");\n    str_builtin_rjust = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rjust\");\n    str_builtin_rpartition = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rpartition\");\n    str_builtin_rsplit = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rsplit\");\n    str_builtin_rstrip = PyObject_GetAttrString((PyObject *)&PyString_Type, \"rstrip\");\n    str_builtin_split = PyObject_GetAttrString((PyObject *)&PyString_Type, \"split\");\n    str_builtin_splitlines = PyObject_GetAttrString((PyObject *)&PyString_Type, \"splitlines\");\n    str_builtin_startswith = PyObject_GetAttrString((PyObject *)&PyString_Type, \"startswith\");\n    str_builtin_strip = PyObject_GetAttrString((PyObject *)&PyString_Type, \"strip\");\n    str_builtin_swapcase = PyObject_GetAttrString((PyObject *)&PyString_Type, \"swapcase\");\n    str_builtin_title = PyObject_GetAttrString((PyObject *)&PyString_Type, \"title\");\n    str_builtin_translate = PyObject_GetAttrString((PyObject *)&PyString_Type, \"translate\");\n    str_builtin_upper = PyObject_GetAttrString((PyObject *)&PyString_Type, \"upper\");\n    str_builtin_zfill = PyObject_GetAttrString((PyObject *)&PyString_Type, \"zfill\");\n}\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_capitalize = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_center = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_count = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_decode = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_endswith = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_expandtabs = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_find = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_index = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_isalnum = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_isalpha = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_isdigit = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_islower = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_isspace = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_istitle = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_isupper = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_join = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_ljust = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_lower = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_lstrip = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_partition = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_replace = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rfind = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rindex = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rjust = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rpartition = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rsplit = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_rstrip = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_split = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_splitlines = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_startswith = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_strip = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_swapcase = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_title = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_translate = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_upper = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_builtin_zfill = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic void _initBytesBuiltinMethods(void) {\n    bytes_builtin_capitalize = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"capitalize\");\n    bytes_builtin_center = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"center\");\n    bytes_builtin_count = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"count\");\n    bytes_builtin_decode = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"decode\");\n    bytes_builtin_endswith = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"endswith\");\n    bytes_builtin_expandtabs = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"expandtabs\");\n    bytes_builtin_find = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"find\");\n    bytes_builtin_index = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"index\");\n    bytes_builtin_isalnum = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"isalnum\");\n    bytes_builtin_isalpha = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"isalpha\");\n    bytes_builtin_isdigit = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"isdigit\");\n    bytes_builtin_islower = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"islower\");\n    bytes_builtin_isspace = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"isspace\");\n    bytes_builtin_istitle = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"istitle\");\n    bytes_builtin_isupper = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"isupper\");\n    bytes_builtin_join = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"join\");\n    bytes_builtin_ljust = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"ljust\");\n    bytes_builtin_lower = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"lower\");\n    bytes_builtin_lstrip = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"lstrip\");\n    bytes_builtin_partition = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"partition\");\n    bytes_builtin_replace = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"replace\");\n    bytes_builtin_rfind = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rfind\");\n    bytes_builtin_rindex = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rindex\");\n    bytes_builtin_rjust = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rjust\");\n    bytes_builtin_rpartition = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rpartition\");\n    bytes_builtin_rsplit = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rsplit\");\n    bytes_builtin_rstrip = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"rstrip\");\n    bytes_builtin_split = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"split\");\n    bytes_builtin_splitlines = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"splitlines\");\n    bytes_builtin_startswith = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"startswith\");\n    bytes_builtin_strip = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"strip\");\n    bytes_builtin_swapcase = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"swapcase\");\n    bytes_builtin_title = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"title\");\n    bytes_builtin_translate = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"translate\");\n    bytes_builtin_upper = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"upper\");\n    bytes_builtin_zfill = PyObject_GetAttrString((PyObject *)&PyBytes_Type, \"zfill\");\n}\n#endif\nstatic PyObject *unicode_builtin_capitalize = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_casefold = NULL;\n#endif\nstatic PyObject *unicode_builtin_center = NULL;\nstatic PyObject *unicode_builtin_count = NULL;\n#if PYTHON_VERSION < 0x300\nstatic PyObject *unicode_builtin_decode = NULL;\n#endif\nstatic PyObject *unicode_builtin_encode = NULL;\nstatic PyObject *unicode_builtin_endswith = NULL;\nstatic PyObject *unicode_builtin_expandtabs = NULL;\nstatic PyObject *unicode_builtin_find = NULL;\nPyObject *unicode_builtin_format = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_format_map = NULL;\n#endif\nstatic PyObject *unicode_builtin_index = NULL;\nstatic PyObject *unicode_builtin_isalnum = NULL;\nstatic PyObject *unicode_builtin_isalpha = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_isascii = NULL;\n#endif\nstatic PyObject *unicode_builtin_isdecimal = NULL;\nstatic PyObject *unicode_builtin_isdigit = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_isidentifier = NULL;\n#endif\nstatic PyObject *unicode_builtin_islower = NULL;\nstatic PyObject *unicode_builtin_isnumeric = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_isprintable = NULL;\n#endif\nstatic PyObject *unicode_builtin_isspace = NULL;\nstatic PyObject *unicode_builtin_istitle = NULL;\nstatic PyObject *unicode_builtin_isupper = NULL;\nstatic PyObject *unicode_builtin_join = NULL;\nstatic PyObject *unicode_builtin_ljust = NULL;\nstatic PyObject *unicode_builtin_lower = NULL;\nstatic PyObject *unicode_builtin_lstrip = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *unicode_builtin_maketrans = NULL;\n#endif\nstatic PyObject *unicode_builtin_partition = NULL;\nstatic PyObject *unicode_builtin_replace = NULL;\nstatic PyObject *unicode_builtin_rfind = NULL;\nstatic PyObject *unicode_builtin_rindex = NULL;\nstatic PyObject *unicode_builtin_rjust = NULL;\nstatic PyObject *unicode_builtin_rpartition = NULL;\nstatic PyObject *unicode_builtin_rsplit = NULL;\nstatic PyObject *unicode_builtin_rstrip = NULL;\nstatic PyObject *unicode_builtin_split = NULL;\nstatic PyObject *unicode_builtin_splitlines = NULL;\nstatic PyObject *unicode_builtin_startswith = NULL;\nstatic PyObject *unicode_builtin_strip = NULL;\nstatic PyObject *unicode_builtin_swapcase = NULL;\nstatic PyObject *unicode_builtin_title = NULL;\nstatic PyObject *unicode_builtin_translate = NULL;\nstatic PyObject *unicode_builtin_upper = NULL;\nstatic PyObject *unicode_builtin_zfill = NULL;\nstatic void _initUnicodeBuiltinMethods(void) {\n    unicode_builtin_capitalize = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"capitalize\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_casefold = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"casefold\");\n#endif\n    unicode_builtin_center = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"center\");\n    unicode_builtin_count = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"count\");\n#if PYTHON_VERSION < 0x300\n    unicode_builtin_decode = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"decode\");\n#endif\n    unicode_builtin_encode = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"encode\");\n    unicode_builtin_endswith = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"endswith\");\n    unicode_builtin_expandtabs = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"expandtabs\");\n    unicode_builtin_find = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"find\");\n    unicode_builtin_format = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"format\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_format_map = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"format_map\");\n#endif\n    unicode_builtin_index = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"index\");\n    unicode_builtin_isalnum = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isalnum\");\n    unicode_builtin_isalpha = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isalpha\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_isascii = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isascii\");\n#endif\n    unicode_builtin_isdecimal = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isdecimal\");\n    unicode_builtin_isdigit = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isdigit\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_isidentifier = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isidentifier\");\n#endif\n    unicode_builtin_islower = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"islower\");\n    unicode_builtin_isnumeric = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isnumeric\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_isprintable = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isprintable\");\n#endif\n    unicode_builtin_isspace = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isspace\");\n    unicode_builtin_istitle = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"istitle\");\n    unicode_builtin_isupper = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"isupper\");\n    unicode_builtin_join = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"join\");\n    unicode_builtin_ljust = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"ljust\");\n    unicode_builtin_lower = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"lower\");\n    unicode_builtin_lstrip = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"lstrip\");\n#if PYTHON_VERSION >= 0x300\n    unicode_builtin_maketrans = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"maketrans\");\n#endif\n    unicode_builtin_partition = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"partition\");\n    unicode_builtin_replace = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"replace\");\n    unicode_builtin_rfind = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rfind\");\n    unicode_builtin_rindex = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rindex\");\n    unicode_builtin_rjust = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rjust\");\n    unicode_builtin_rpartition = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rpartition\");\n    unicode_builtin_rsplit = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rsplit\");\n    unicode_builtin_rstrip = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"rstrip\");\n    unicode_builtin_split = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"split\");\n    unicode_builtin_splitlines = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"splitlines\");\n    unicode_builtin_startswith = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"startswith\");\n    unicode_builtin_strip = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"strip\");\n    unicode_builtin_swapcase = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"swapcase\");\n    unicode_builtin_title = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"title\");\n    unicode_builtin_translate = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"translate\");\n    unicode_builtin_upper = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"upper\");\n    unicode_builtin_zfill = PyObject_GetAttrString((PyObject *)&PyUnicode_Type, \"zfill\");\n}\nstatic PyObject *dict_builtin_clear = NULL;\nstatic PyObject *dict_builtin_copy = NULL;\nPyObject *dict_builtin_fromkeys = NULL;\nstatic PyObject *dict_builtin_get = NULL;\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_has_key = NULL;\n#endif\nstatic PyObject *dict_builtin_items = NULL;\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_iteritems = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_iterkeys = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_itervalues = NULL;\n#endif\nstatic PyObject *dict_builtin_keys = NULL;\nstatic PyObject *dict_builtin_pop = NULL;\nstatic PyObject *dict_builtin_popitem = NULL;\nstatic PyObject *dict_builtin_setdefault = NULL;\nstatic PyObject *dict_builtin_update = NULL;\nstatic PyObject *dict_builtin_values = NULL;\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_viewitems = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_viewkeys = NULL;\n#endif\n#if PYTHON_VERSION < 0x300\nstatic PyObject *dict_builtin_viewvalues = NULL;\n#endif\nstatic void _initDictBuiltinMethods(void) {\n    dict_builtin_clear = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"clear\");\n    dict_builtin_copy = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"copy\");\n    dict_builtin_fromkeys = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"fromkeys\");\n    dict_builtin_get = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"get\");\n#if PYTHON_VERSION < 0x300\n    dict_builtin_has_key = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"has_key\");\n#endif\n    dict_builtin_items = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"items\");\n#if PYTHON_VERSION < 0x300\n    dict_builtin_iteritems = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"iteritems\");\n#endif\n#if PYTHON_VERSION < 0x300\n    dict_builtin_iterkeys = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"iterkeys\");\n#endif\n#if PYTHON_VERSION < 0x300\n    dict_builtin_itervalues = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"itervalues\");\n#endif\n    dict_builtin_keys = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"keys\");\n    dict_builtin_pop = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"pop\");\n    dict_builtin_popitem = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"popitem\");\n    dict_builtin_setdefault = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"setdefault\");\n    dict_builtin_update = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"update\");\n    dict_builtin_values = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"values\");\n#if PYTHON_VERSION < 0x300\n    dict_builtin_viewitems = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"viewitems\");\n#endif\n#if PYTHON_VERSION < 0x300\n    dict_builtin_viewkeys = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"viewkeys\");\n#endif\n#if PYTHON_VERSION < 0x300\n    dict_builtin_viewvalues = PyObject_GetAttrString((PyObject *)&PyDict_Type, \"viewvalues\");\n#endif\n}\nstatic PyObject *list_builtin_append = NULL;\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *list_builtin_clear = NULL;\n#endif\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *list_builtin_copy = NULL;\n#endif\nstatic PyObject *list_builtin_count = NULL;\nstatic PyObject *list_builtin_extend = NULL;\nstatic PyObject *list_builtin_index = NULL;\nstatic PyObject *list_builtin_insert = NULL;\nstatic PyObject *list_builtin_pop = NULL;\nstatic PyObject *list_builtin_remove = NULL;\nstatic PyObject *list_builtin_reverse = NULL;\nstatic PyObject *list_builtin_sort = NULL;\nstatic void _initListBuiltinMethods(void) {\n    list_builtin_append = PyObject_GetAttrString((PyObject *)&PyList_Type, \"append\");\n#if PYTHON_VERSION >= 0x300\n    list_builtin_clear = PyObject_GetAttrString((PyObject *)&PyList_Type, \"clear\");\n#endif\n#if PYTHON_VERSION >= 0x300\n    list_builtin_copy = PyObject_GetAttrString((PyObject *)&PyList_Type, \"copy\");\n#endif\n    list_builtin_count = PyObject_GetAttrString((PyObject *)&PyList_Type, \"count\");\n    list_builtin_extend = PyObject_GetAttrString((PyObject *)&PyList_Type, \"extend\");\n    list_builtin_index = PyObject_GetAttrString((PyObject *)&PyList_Type, \"index\");\n    list_builtin_insert = PyObject_GetAttrString((PyObject *)&PyList_Type, \"insert\");\n    list_builtin_pop = PyObject_GetAttrString((PyObject *)&PyList_Type, \"pop\");\n    list_builtin_remove = PyObject_GetAttrString((PyObject *)&PyList_Type, \"remove\");\n    list_builtin_reverse = PyObject_GetAttrString((PyObject *)&PyList_Type, \"reverse\");\n    list_builtin_sort = PyObject_GetAttrString((PyObject *)&PyList_Type, \"sort\");\n}\nPyObject *DICT_POP2(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n\n    PyObject *called = dict_builtin_pop;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {dict, key};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *DICT_POP3(PyThreadState *tstate, PyObject *dict, PyObject *key, PyObject *default_value) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n    CHECK_OBJECT(default_value);\n\n    PyObject *called = dict_builtin_pop;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {dict, key, default_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *DICT_POPITEM(PyThreadState *tstate, PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    PyObject *called = dict_builtin_popitem;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, dict);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyTuple_CheckExact(result));\n    return result;\n}\nPyObject *DICT_SETDEFAULT2(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n\n    PyObject *called = dict_builtin_setdefault;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {dict, key};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *DICT_SETDEFAULT3(PyThreadState *tstate, PyObject *dict, PyObject *key, PyObject *default_value) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n    CHECK_OBJECT(default_value);\n\n    PyObject *called = dict_builtin_setdefault;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {dict, key, default_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *LIST_POP1(PyThreadState *tstate, PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    PyObject *called = list_builtin_pop;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, list);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *LIST_POP2(PyThreadState *tstate, PyObject *list, PyObject *index) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    CHECK_OBJECT(index);\n\n    PyObject *called = list_builtin_pop;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {list, index};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\n#if PYTHON_VERSION < 0x300\nPyObject *STR_CAPITALIZE(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_capitalize;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_CENTER2(PyThreadState *tstate, PyObject *str, PyObject *width) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = str_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_CENTER3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = str_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_COUNT2(PyThreadState *tstate, PyObject *str, PyObject *sub) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = str_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_COUNT3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_COUNT4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_DECODE1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_DECODE2(PyThreadState *tstate, PyObject *str, PyObject *encoding) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(encoding);\n\n    PyObject *called = str_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, encoding};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_DECODE3(PyThreadState *tstate, PyObject *str, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    if (encoding == NULL) {\n        encoding = PyString_FromString(PyUnicode_GetDefaultEncoding());\n    } else {\n        Py_INCREF(encoding);\n    }\n    CHECK_OBJECT(errors);\n\n    PyObject *called = str_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, encoding, errors};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    Py_DECREF(encoding);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_ENCODE1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_ENCODE2(PyThreadState *tstate, PyObject *str, PyObject *encoding) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(encoding);\n\n    PyObject *called = str_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, encoding};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_ENCODE3(PyThreadState *tstate, PyObject *str, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(encoding);\n    CHECK_OBJECT(errors);\n\n    PyObject *called = str_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, encoding, errors};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_ENDSWITH2(PyThreadState *tstate, PyObject *str, PyObject *suffix) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(suffix);\n\n    PyObject *called = str_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, suffix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ENDSWITH3(PyThreadState *tstate, PyObject *str, PyObject *suffix, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, suffix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ENDSWITH4(PyThreadState *tstate, PyObject *str, PyObject *suffix, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, suffix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_EXPANDTABS1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_EXPANDTABS2(PyThreadState *tstate, PyObject *str, PyObject *tabsize) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(tabsize);\n\n    PyObject *called = str_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, tabsize};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_FIND2(PyThreadState *tstate, PyObject *str, PyObject *sub) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = str_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_FIND3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_FIND4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_INDEX2(PyThreadState *tstate, PyObject *str, PyObject *sub) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = str_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_INDEX3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_INDEX4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_ISALNUM(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_isalnum;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISALPHA(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_isalpha;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISDIGIT(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_isdigit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISLOWER(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_islower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISSPACE(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_isspace;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISTITLE(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_istitle;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_ISUPPER(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_isupper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_LJUST2(PyThreadState *tstate, PyObject *str, PyObject *width) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = str_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_LJUST3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = str_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_LOWER(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_lower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_LSTRIP1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_LSTRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = str_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_PARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = str_builtin_partition;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyTuple_CheckExact(result));\n    return result;\n}\nPyObject *STR_REPLACE3(PyThreadState *tstate, PyObject *str, PyObject *old, PyObject *new_value) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n\n    PyObject *called = str_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, old, new_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_REPLACE4(PyThreadState *tstate, PyObject *str, PyObject *old, PyObject *new_value, PyObject *count) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n    CHECK_OBJECT(count);\n\n    PyObject *called = str_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, old, new_value, count};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_RFIND2(PyThreadState *tstate, PyObject *str, PyObject *sub) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = str_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RFIND3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RFIND4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RINDEX2(PyThreadState *tstate, PyObject *str, PyObject *sub) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = str_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RINDEX3(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RINDEX4(PyThreadState *tstate, PyObject *str, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *STR_RJUST2(PyThreadState *tstate, PyObject *str, PyObject *width) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = str_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_RJUST3(PyThreadState *tstate, PyObject *str, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = str_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_RPARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = str_builtin_rpartition;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyTuple_CheckExact(result));\n    return result;\n}\nPyObject *STR_RSPLIT1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_RSPLIT2(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = str_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_RSPLIT3(PyThreadState *tstate, PyObject *str, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = str_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_RSTRIP1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_RSTRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = str_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_SPLIT1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_SPLIT2(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = str_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_SPLIT3(PyThreadState *tstate, PyObject *str, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = str_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_SPLITLINES1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_SPLITLINES2(PyThreadState *tstate, PyObject *str, PyObject *keepends) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(keepends);\n\n    PyObject *called = str_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, keepends};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *STR_STARTSWITH2(PyThreadState *tstate, PyObject *str, PyObject *prefix) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(prefix);\n\n    PyObject *called = str_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, prefix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_STARTSWITH3(PyThreadState *tstate, PyObject *str, PyObject *prefix, PyObject *start) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = str_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {str, prefix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_STARTSWITH4(PyThreadState *tstate, PyObject *str, PyObject *prefix, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = str_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {str, prefix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *STR_STRIP1(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_STRIP2(PyThreadState *tstate, PyObject *str, PyObject *chars) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = str_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_SWAPCASE(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_swapcase;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_TITLE(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_title;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_TRANSLATE(PyThreadState *tstate, PyObject *str, PyObject *table) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(table);\n\n    PyObject *called = str_builtin_translate;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, table};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_UPPER(PyThreadState *tstate, PyObject *str) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    PyObject *called = str_builtin_upper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, str);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *STR_ZFILL(PyThreadState *tstate, PyObject *str, PyObject *width) {\n    CHECK_OBJECT(str);\n    assert(PyString_CheckExact(str));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = str_builtin_zfill;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {str, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\n#endif\nPyObject *UNICODE_CAPITALIZE(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_capitalize;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_CENTER2(PyThreadState *tstate, PyObject *unicode, PyObject *width) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = unicode_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_CENTER3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = unicode_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_COUNT2(PyThreadState *tstate, PyObject *unicode, PyObject *sub) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = unicode_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_COUNT3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_COUNT4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENCODE1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENCODE2(PyThreadState *tstate, PyObject *unicode, PyObject *encoding) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(encoding);\n\n    PyObject *called = unicode_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, encoding};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENCODE3(PyThreadState *tstate, PyObject *unicode, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(encoding);\n    CHECK_OBJECT(errors);\n\n    PyObject *called = unicode_builtin_encode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, encoding, errors};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENDSWITH2(PyThreadState *tstate, PyObject *unicode, PyObject *suffix) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(suffix);\n\n    PyObject *called = unicode_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, suffix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENDSWITH3(PyThreadState *tstate, PyObject *unicode, PyObject *suffix, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, suffix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ENDSWITH4(PyThreadState *tstate, PyObject *unicode, PyObject *suffix, PyObject *start,\n                            PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, suffix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_EXPANDTABS1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_EXPANDTABS2(PyThreadState *tstate, PyObject *unicode, PyObject *tabsize) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(tabsize);\n\n    PyObject *called = unicode_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, tabsize};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_FIND2(PyThreadState *tstate, PyObject *unicode, PyObject *sub) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = unicode_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_FIND3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_FIND4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_INDEX2(PyThreadState *tstate, PyObject *unicode, PyObject *sub) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = unicode_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_INDEX3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_INDEX4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISALNUM(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_isalnum;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISALPHA(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_isalpha;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISDIGIT(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_isdigit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISLOWER(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_islower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISSPACE(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_isspace;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISTITLE(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_istitle;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ISUPPER(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_isupper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_LJUST2(PyThreadState *tstate, PyObject *unicode, PyObject *width) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = unicode_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_LJUST3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = unicode_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_LOWER(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_lower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_LSTRIP1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_LSTRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = unicode_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_REPLACE3(PyThreadState *tstate, PyObject *unicode, PyObject *old, PyObject *new_value) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n\n    PyObject *called = unicode_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, old, new_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_REPLACE4(PyThreadState *tstate, PyObject *unicode, PyObject *old, PyObject *new_value,\n                           PyObject *count) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n    CHECK_OBJECT(count);\n\n    PyObject *called = unicode_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, old, new_value, count};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RFIND2(PyThreadState *tstate, PyObject *unicode, PyObject *sub) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = unicode_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RFIND3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RFIND4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RINDEX2(PyThreadState *tstate, PyObject *unicode, PyObject *sub) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = unicode_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RINDEX3(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RINDEX4(PyThreadState *tstate, PyObject *unicode, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RJUST2(PyThreadState *tstate, PyObject *unicode, PyObject *width) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = unicode_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RJUST3(PyThreadState *tstate, PyObject *unicode, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = unicode_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RSPLIT1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RSPLIT2(PyThreadState *tstate, PyObject *unicode, PyObject *sep) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = unicode_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RSPLIT3(PyThreadState *tstate, PyObject *unicode, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = unicode_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RSTRIP1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_RSTRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = unicode_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SPLIT1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SPLIT2(PyThreadState *tstate, PyObject *unicode, PyObject *sep) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = unicode_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SPLIT3(PyThreadState *tstate, PyObject *unicode, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = unicode_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SPLITLINES1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SPLITLINES2(PyThreadState *tstate, PyObject *unicode, PyObject *keepends) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(keepends);\n\n    PyObject *called = unicode_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, keepends};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_STARTSWITH2(PyThreadState *tstate, PyObject *unicode, PyObject *prefix) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(prefix);\n\n    PyObject *called = unicode_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, prefix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_STARTSWITH3(PyThreadState *tstate, PyObject *unicode, PyObject *prefix, PyObject *start) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = unicode_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {unicode, prefix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_STARTSWITH4(PyThreadState *tstate, PyObject *unicode, PyObject *prefix, PyObject *start,\n                              PyObject *end) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = unicode_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {unicode, prefix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_STRIP1(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_STRIP2(PyThreadState *tstate, PyObject *unicode, PyObject *chars) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = unicode_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_SWAPCASE(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_swapcase;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_TITLE(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_title;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_TRANSLATE(PyThreadState *tstate, PyObject *unicode, PyObject *table) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(table);\n\n    PyObject *called = unicode_builtin_translate;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, table};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_UPPER(PyThreadState *tstate, PyObject *unicode) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    PyObject *called = unicode_builtin_upper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, unicode);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *UNICODE_ZFILL(PyThreadState *tstate, PyObject *unicode, PyObject *width) {\n    CHECK_OBJECT(unicode);\n    assert(PyUnicode_CheckExact(unicode));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = unicode_builtin_zfill;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {unicode, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\n#if PYTHON_VERSION >= 0x300\nPyObject *BYTES_CAPITALIZE(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_capitalize;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_CENTER2(PyThreadState *tstate, PyObject *bytes, PyObject *width) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = bytes_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_CENTER3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = bytes_builtin_center;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_COUNT2(PyThreadState *tstate, PyObject *bytes, PyObject *sub) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = bytes_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_COUNT3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_COUNT4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_count;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_DECODE1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_DECODE2(PyThreadState *tstate, PyObject *bytes, PyObject *encoding) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(encoding);\n\n    PyObject *called = bytes_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, encoding};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_DECODE3(PyThreadState *tstate, PyObject *bytes, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(encoding);\n    CHECK_OBJECT(errors);\n\n    PyObject *called = bytes_builtin_decode;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, encoding, errors};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || Nuitka_String_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_ENDSWITH2(PyThreadState *tstate, PyObject *bytes, PyObject *suffix) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(suffix);\n\n    PyObject *called = bytes_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, suffix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ENDSWITH3(PyThreadState *tstate, PyObject *bytes, PyObject *suffix, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, suffix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ENDSWITH4(PyThreadState *tstate, PyObject *bytes, PyObject *suffix, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(suffix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_endswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, suffix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_EXPANDTABS1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_EXPANDTABS2(PyThreadState *tstate, PyObject *bytes, PyObject *tabsize) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(tabsize);\n\n    PyObject *called = bytes_builtin_expandtabs;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, tabsize};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_FIND2(PyThreadState *tstate, PyObject *bytes, PyObject *sub) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = bytes_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_FIND3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_FIND4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_find;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_INDEX2(PyThreadState *tstate, PyObject *bytes, PyObject *sub) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = bytes_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_INDEX3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_INDEX4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_index;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_ISALNUM(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_isalnum;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISALPHA(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_isalpha;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISDIGIT(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_isdigit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISLOWER(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_islower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISSPACE(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_isspace;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISTITLE(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_istitle;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_ISUPPER(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_isupper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_JOIN(PyThreadState *tstate, PyObject *bytes, PyObject *iterable) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(iterable);\n\n    PyObject *called = bytes_builtin_join;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, iterable};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_LJUST2(PyThreadState *tstate, PyObject *bytes, PyObject *width) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = bytes_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_LJUST3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = bytes_builtin_ljust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_LOWER(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_lower;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_LSTRIP1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_LSTRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = bytes_builtin_lstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_PARTITION(PyThreadState *tstate, PyObject *bytes, PyObject *sep) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = bytes_builtin_partition;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyTuple_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_REPLACE3(PyThreadState *tstate, PyObject *bytes, PyObject *old, PyObject *new_value) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n\n    PyObject *called = bytes_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, old, new_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_REPLACE4(PyThreadState *tstate, PyObject *bytes, PyObject *old, PyObject *new_value, PyObject *count) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(old);\n    CHECK_OBJECT(new_value);\n    CHECK_OBJECT(count);\n\n    PyObject *called = bytes_builtin_replace;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, old, new_value, count};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RFIND2(PyThreadState *tstate, PyObject *bytes, PyObject *sub) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = bytes_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RFIND3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RFIND4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_rfind;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RINDEX2(PyThreadState *tstate, PyObject *bytes, PyObject *sub) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n\n    PyObject *called = bytes_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sub};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RINDEX3(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sub, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RINDEX4(PyThreadState *tstate, PyObject *bytes, PyObject *sub, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sub);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_rindex;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, sub, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    return result;\n}\nPyObject *BYTES_RJUST2(PyThreadState *tstate, PyObject *bytes, PyObject *width) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = bytes_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RJUST3(PyThreadState *tstate, PyObject *bytes, PyObject *width, PyObject *fillchar) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n    CHECK_OBJECT(fillchar);\n\n    PyObject *called = bytes_builtin_rjust;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, width, fillchar};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RPARTITION(PyThreadState *tstate, PyObject *bytes, PyObject *sep) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = bytes_builtin_rpartition;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyTuple_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RSPLIT1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RSPLIT2(PyThreadState *tstate, PyObject *bytes, PyObject *sep) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = bytes_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RSPLIT3(PyThreadState *tstate, PyObject *bytes, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = bytes_builtin_rsplit;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RSTRIP1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_RSTRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = bytes_builtin_rstrip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SPLIT1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SPLIT2(PyThreadState *tstate, PyObject *bytes, PyObject *sep) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n\n    PyObject *called = bytes_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, sep};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SPLIT3(PyThreadState *tstate, PyObject *bytes, PyObject *sep, PyObject *maxsplit) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(sep);\n    CHECK_OBJECT(maxsplit);\n\n    PyObject *called = bytes_builtin_split;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, sep, maxsplit};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SPLITLINES1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SPLITLINES2(PyThreadState *tstate, PyObject *bytes, PyObject *keepends) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(keepends);\n\n    PyObject *called = bytes_builtin_splitlines;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, keepends};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyList_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_STARTSWITH2(PyThreadState *tstate, PyObject *bytes, PyObject *prefix) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(prefix);\n\n    PyObject *called = bytes_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, prefix};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_STARTSWITH3(PyThreadState *tstate, PyObject *bytes, PyObject *prefix, PyObject *start) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n\n    PyObject *called = bytes_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, prefix, start};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_STARTSWITH4(PyThreadState *tstate, PyObject *bytes, PyObject *prefix, PyObject *start, PyObject *end) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(prefix);\n    CHECK_OBJECT(start);\n    CHECK_OBJECT(end);\n\n    PyObject *called = bytes_builtin_startswith;\n    CHECK_OBJECT(called);\n\n    PyObject *args[4] = {bytes, prefix, start, end};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS4(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBool_Check(result));\n    return result;\n}\nPyObject *BYTES_STRIP1(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_STRIP2(PyThreadState *tstate, PyObject *bytes, PyObject *chars) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(chars);\n\n    PyObject *called = bytes_builtin_strip;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, chars};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_SWAPCASE(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_swapcase;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_TITLE(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_title;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_TRANSLATE2(PyThreadState *tstate, PyObject *bytes, PyObject *table) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(table);\n\n    PyObject *called = bytes_builtin_translate;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, table};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_TRANSLATE3(PyThreadState *tstate, PyObject *bytes, PyObject *table, PyObject *delete_value) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(table);\n    CHECK_OBJECT(delete_value);\n\n    PyObject *called = bytes_builtin_translate;\n    CHECK_OBJECT(called);\n\n    PyObject *args[3] = {bytes, table, delete_value};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS3(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_UPPER(PyThreadState *tstate, PyObject *bytes) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    PyObject *called = bytes_builtin_upper;\n    CHECK_OBJECT(called);\n\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, bytes);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\nPyObject *BYTES_ZFILL(PyThreadState *tstate, PyObject *bytes, PyObject *width) {\n    CHECK_OBJECT(bytes);\n    assert(PyBytes_CheckExact(bytes));\n\n    CHECK_OBJECT(width);\n\n    PyObject *called = bytes_builtin_zfill;\n    CHECK_OBJECT(called);\n\n    PyObject *args[2] = {bytes, width};\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS2(tstate, called, args);\n\n    CHECK_OBJECT_X(result);\n    assert(result == NULL || PyBytes_CheckExact(result));\n    return result;\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersBytes.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to quickly create a bytes objects.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x300\n\n// Custom allocation to save bytes at the end.\n#define PyBytesObject_SIZE (offsetof(PyBytesObject, ob_sval) + 1)\n\n#if NUITKA_BYTES_HAS_FREELIST\n\n#if PYTHON_VERSION < 0x3b0\nstatic struct _Py_bytes_state *Nuitka_Py_get_bytes_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->bytes;\n}\n#else\n#define BYTES_CHARACTERS _Py_SINGLETON(bytes_characters)\n#define BYTES_CHARACTER(ch) ((PyBytesObject *)&(BYTES_CHARACTERS[ch]));\n#define BYTES_EMPTY (&_Py_SINGLETON(bytes_empty))\n#endif\n\nPyObject *Nuitka_Bytes_FromStringAndSize(const char *data, Py_ssize_t size) {\n    assert(size >= 0);\n    PyBytesObject *op;\n\n    if (size == 1) {\n        // For Python3.10 we can use the internal cache.\n#if PYTHON_VERSION < 0x3b0\n        struct _Py_bytes_state *state = Nuitka_Py_get_bytes_state();\n\n        op = state->characters[*data & UCHAR_MAX];\n\n        if (op != NULL) {\n            Py_INCREF(op);\n            return (PyObject *)op;\n        }\n#else\n        op = BYTES_CHARACTER(*data & 255);\n        Py_INCREF(op);\n        return (PyObject *)op;\n#endif\n    }\n\n    if (size == 0) {\n#if PYTHON_VERSION < 0x3b0\n        struct _Py_bytes_state *state = Nuitka_Py_get_bytes_state();\n\n        assert(state->empty_string != NULL);\n        Py_INCREF(state->empty_string);\n\n        return state->empty_string;\n#else\n        Py_INCREF(BYTES_EMPTY);\n        return (PyObject *)BYTES_EMPTY;\n\n#endif\n    }\n\n    op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + size);\n\n    Py_SET_SIZE(op, size);\n    Py_SET_TYPE(op, &PyBytes_Type);\n\n    Nuitka_Py_NewReference((PyObject *)op);\n\n    op->ob_shash = -1;\n    memcpy(op->ob_sval, data, size);\n    op->ob_sval[size] = '\\0';\n\n#if PYTHON_VERSION < 0x3b0\n    // For Python3.10 we might have to populate the cache.\n    if (size == 1) {\n        struct _Py_bytes_state *state = Nuitka_Py_get_bytes_state();\n        Py_INCREF(op);\n        state->characters[*data & UCHAR_MAX] = op;\n    }\n#endif\n\n    return (PyObject *)op;\n}\n\n#endif\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersCalling.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION < 0x3b0\nPyObject *callPythonFunction(PyObject *func, PyObject *const *args, int count) {\n    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);\n    PyObject *globals = PyFunction_GET_GLOBALS(func);\n    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);\n\n#if PYTHON_VERSION >= 0x300\n    PyObject *kwdefs = PyFunction_GET_KW_DEFAULTS(func);\n\n    // TODO: Verify this actually matches current Python versions.\n    if (kwdefs == NULL && argdefs == NULL && co->co_argcount == count &&\n        co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))\n#else\n    if (argdefs == NULL && co->co_argcount == count && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))\n#endif\n    {\n        PyThreadState *tstate = PyThreadState_GET();\n        CHECK_OBJECT(globals);\n\n        PyFrameObject *frame = PyFrame_New(tstate, co, globals, NULL);\n\n        if (unlikely(frame == NULL)) {\n            return NULL;\n        };\n\n        for (int i = 0; i < count; i++) {\n            frame->f_localsplus[i] = args[i];\n            Py_INCREF(frame->f_localsplus[i]);\n        }\n\n#if PYTHON_VERSION < 0x390\n        PyObject *result = PyEval_EvalFrameEx(frame, 0);\n#else\n        PyObject *result = _PyEval_EvalFrame(tstate, frame, 0);\n#endif\n        // Frame release protects against recursion as it may lead to variable\n        // destruction.\n        tstate->recursion_depth++;\n        Py_DECREF(frame);\n        tstate->recursion_depth--;\n\n        return result;\n    }\n\n    PyObject **defaults = NULL;\n    int num_defaults = 0;\n\n    if (argdefs != NULL) {\n        defaults = &PyTuple_GET_ITEM(argdefs, 0);\n        num_defaults = (int)(Py_SIZE(argdefs));\n    }\n\n    PyObject *result = PyEval_EvalCodeEx(\n#if PYTHON_VERSION >= 0x300\n        (PyObject *)co,\n#else\n        co, // code object\n#endif\n        globals,           // globals\n        NULL,              // no locals\n        (PyObject **)args, // args\n        count,             // argcount\n        NULL,              // kwds\n        0,                 // kwcount\n        defaults,          // defaults\n        num_defaults,      // defcount\n#if PYTHON_VERSION >= 0x300\n        kwdefs,\n#endif\n        PyFunction_GET_CLOSURE(func));\n\n    return result;\n}\n\nstatic PyObject *callPythonFunctionNoArgs(PyObject *func) {\n    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);\n    PyObject *globals = PyFunction_GET_GLOBALS(func);\n    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);\n\n#if PYTHON_VERSION >= 0x300\n    PyObject *kwdefs = PyFunction_GET_KW_DEFAULTS(func);\n\n    if (kwdefs == NULL && argdefs == NULL && co->co_argcount == 0 &&\n        co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))\n#else\n    if (argdefs == NULL && co->co_argcount == 0 && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))\n#endif\n    {\n        PyThreadState *tstate = PyThreadState_GET();\n        CHECK_OBJECT(globals);\n\n        PyFrameObject *frame = PyFrame_New(tstate, co, globals, NULL);\n\n        if (unlikely(frame == NULL)) {\n            return NULL;\n        };\n\n        PyObject *result = PyEval_EvalFrameEx(frame, 0);\n\n        // Frame release protects against recursion as it may lead to variable\n        // destruction.\n        tstate->recursion_depth++;\n        Py_DECREF(frame);\n        tstate->recursion_depth--;\n\n        return result;\n    }\n\n    PyObject **defaults = NULL;\n    int num_defaults = 0;\n\n    if (argdefs != NULL) {\n        defaults = &PyTuple_GET_ITEM(argdefs, 0);\n        num_defaults = (int)(Py_SIZE(argdefs));\n    }\n\n    PyObject *result = PyEval_EvalCodeEx(\n#if PYTHON_VERSION >= 0x300\n        (PyObject *)co,\n#else\n        co, // code object\n#endif\n        globals,      // globals\n        NULL,         // no locals\n        NULL,         // args\n        0,            // argcount\n        NULL,         // kwds\n        0,            // kwcount\n        defaults,     // defaults\n        num_defaults, // defcount\n#if PYTHON_VERSION >= 0x300\n        kwdefs,\n#endif\n        PyFunction_GET_CLOSURE(func));\n\n    return result;\n}\n#endif\n\nPyObject *CALL_METHOD_WITH_POSARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name,\n                                   PyObject *positional_args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n    CHECK_OBJECT(positional_args);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInstance_Check(source)) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_POSARGS(tstate, called_object, positional_args);\n        }\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, &PyTuple_GET_ITEM(positional_args, 0),\n                                                        PyTuple_GET_SIZE(positional_args));\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_POSARGS(tstate, method, positional_args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_POSARGS(tstate, called_object, positional_args);\n            }\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            PyErr_Format(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                         PyString_AS_STRING(source_instance->in_class->cl_name), PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_POSARGS(tstate, called_object, positional_args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    } else\n#endif\n    {\n        PyObject *called_object;\n\n        PyTypeObject *type = Py_TYPE(source);\n\n        if (type->tp_getattro != NULL) {\n            called_object = (*type->tp_getattro)(source, attr_name);\n        } else if (type->tp_getattr != NULL) {\n            called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n        } else {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\",\n                                                type->tp_name, Nuitka_String_AsString_Unchecked(attr_name));\n\n            return NULL;\n        }\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_POSARGS(tstate, called_object, positional_args);\n        Py_DECREF(called_object);\n        return result;\n    }\n}\n\nchar const *GET_CALLABLE_NAME(PyObject *object) {\n    if (Nuitka_Function_Check(object)) {\n        return Nuitka_String_AsString(Nuitka_Function_GetName(object));\n    } else if (Nuitka_Generator_Check(object)) {\n        return Nuitka_String_AsString(Nuitka_Generator_GetName(object));\n    } else if (PyMethod_Check(object)) {\n        return PyEval_GetFuncName(PyMethod_GET_FUNCTION(object));\n    } else if (PyFunction_Check(object)) {\n        return Nuitka_String_AsString(((PyFunctionObject *)object)->func_name);\n    }\n#if PYTHON_VERSION < 0x300\n    else if (PyInstance_Check(object)) {\n        return Nuitka_String_AsString(((PyInstanceObject *)object)->in_class->cl_name);\n    } else if (PyClass_Check(object)) {\n        return Nuitka_String_AsString(((PyClassObject *)object)->cl_name);\n    }\n#endif\n    else if (PyCFunction_Check(object)) {\n        return ((PyCFunctionObject *)object)->m_ml->ml_name;\n    } else {\n        return Py_TYPE(object)->tp_name;\n    }\n}\n\nchar const *GET_CALLABLE_DESC(PyObject *object) {\n    if (Nuitka_Function_Check(object) || Nuitka_Generator_Check(object) || PyMethod_Check(object) ||\n        PyFunction_Check(object) || PyCFunction_Check(object)) {\n        return \"()\";\n    }\n#if PYTHON_VERSION < 0x300\n    else if (PyClass_Check(object)) {\n        return \" constructor\";\n    } else if (PyInstance_Check(object)) {\n        return \" instance\";\n    }\n#endif\n    else {\n        return \" object\";\n    }\n}\n\nchar const *GET_CLASS_NAME(PyObject *klass) {\n    if (klass == NULL) {\n        return \"?\";\n    } else {\n#if PYTHON_VERSION < 0x300\n        if (PyClass_Check(klass)) {\n            return Nuitka_String_AsString(((PyClassObject *)klass)->cl_name);\n        }\n#endif\n\n        if (!PyType_Check(klass)) {\n            klass = (PyObject *)Py_TYPE(klass);\n        }\n\n        return ((PyTypeObject *)klass)->tp_name;\n    }\n}\n\nchar const *GET_INSTANCE_CLASS_NAME(PyThreadState *tstate, PyObject *instance) {\n    // TODO: Why not use our own attribute lookup here.\n    PyObject *klass = PyObject_GetAttr(instance, const_str_plain___class__);\n\n    // Fallback to type as this cannot fail.\n    if (klass == NULL) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        klass = (PyObject *)Py_TYPE(instance);\n        Py_INCREF(klass);\n    }\n\n    char const *result = GET_CLASS_NAME(klass);\n\n    Py_DECREF(klass);\n\n    return result;\n}\n\nstatic PyObject *_getTypeAbstractMethods(PyThreadState *tstate, PyTypeObject *type, void *context) {\n    PyObject *result = DICT_GET_ITEM_WITH_ERROR(tstate, type->tp_dict, const_str_plain___abstractmethods__);\n\n    if (unlikely(result == NULL)) {\n        if (!HAS_ERROR_OCCURRED(tstate)) {\n            SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError, const_str_plain___abstractmethods__);\n        }\n        return NULL;\n    }\n\n    return result;\n}\n\nvoid formatCannotInstantiateAbstractClass(PyThreadState *tstate, PyTypeObject *type) {\n    PyObject *abstract_methods = _getTypeAbstractMethods(tstate, type, NULL);\n    if (unlikely(abstract_methods == NULL)) {\n        return;\n    }\n\n    PyObject *sorted_methods = PySequence_List(abstract_methods);\n    Py_DECREF(abstract_methods);\n    if (unlikely(sorted_methods == NULL)) {\n        return;\n    }\n    if (unlikely(PyList_Sort(sorted_methods))) {\n        Py_DECREF(sorted_methods);\n        return;\n    }\n    PyObject *comma = Nuitka_String_FromString(\", \");\n    CHECK_OBJECT(comma);\n#if PYTHON_VERSION < 0x300\n    PyObject *joined = CALL_METHOD_WITH_SINGLE_ARG(tstate, comma, const_str_plain_join, sorted_methods);\n\n    char const *joined_str = Nuitka_String_AsString(joined);\n    if (unlikely(joined_str == NULL)) {\n        Py_DECREF(joined);\n        return;\n    }\n#else\n    PyObject *joined = PyUnicode_Join(comma, sorted_methods);\n#endif\n    Py_DECREF(sorted_methods);\n    if (unlikely(joined == NULL)) {\n        return;\n    }\n\n    Py_ssize_t method_count = PyList_GET_SIZE(sorted_methods);\n\n    SET_CURRENT_EXCEPTION_TYPE0_FORMAT3(PyExc_TypeError,\n                                        \"Can't instantiate abstract class %s with abstract method%s %s\", type->tp_name,\n                                        method_count > 1 ? \"s\" : \"\", Nuitka_String_AsString(joined));\n\n    Py_DECREF(joined);\n}\n\n#include \"HelpersCallingGenerated.c\"\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersCallingGenerated.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template CodeTemplateCallsPositional.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPyObject *CALL_FUNCTION_NO_ARGS(PyThreadState *tstate, PyObject *called) {\n    CHECK_OBJECT(called);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 0 == function->m_args_positional_count) {\n            result = function->m_c_code(tstate, function, NULL);\n        } else if (function->m_args_simple && 0 + function->m_defaults_given == function->m_args_positional_count) {\n            PyObject **python_pars = &PyTuple_GET_ITEM(function->m_defaults, 0);\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionNoArgs(tstate, function);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyErr_Format(\n                PyExc_TypeError,\n                \"unbound compiled_method %s%s must be called with %s instance as first argument (got nothing instead)\",\n                GET_CALLABLE_NAME((PyObject *)method->m_function), GET_CALLABLE_DESC((PyObject *)method->m_function),\n                GET_CLASS_NAME(method->m_class));\n            return NULL;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 0 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[0 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       0 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1 + 0, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionNoArgs(tstate, function, method->m_object);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (likely(flags & METH_NOARGS)) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result = (*method)(self, NULL);\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (0 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = const_tuple_empty;\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = const_tuple_empty;\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, NULL, 0, NULL);\n#else\n                PyObject *pos_args = const_tuple_empty;\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 0);\n#endif\n            } else {\n                PyObject *pos_args = const_tuple_empty;\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunctionNoArgs(called);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, NULL, 0, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = const_tuple_empty;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionNoArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj);\n                        } else {\n                            result = CALL_FUNCTION_NO_ARGS(tstate, init_method);\n\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if ((init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            return obj;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionNoArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj);\n        } else {\n            result = CALL_FUNCTION_NO_ARGS(tstate, init_method);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, NULL, 0, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, const_tuple_empty, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 1);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 1 == function->m_args_positional_count) {\n            Py_INCREF(args[0]);\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 1 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 1 * sizeof(PyObject *));\n            memcpy(python_pars + 1, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 1);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 1);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 1 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[1 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                python_pars[1] = args[0];\n                Py_INCREF(args[0]);\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       1 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 1 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 1, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 1);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (1 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if ((flags & METH_O)) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result = (*method)(self, args[0]);\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 1);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 1);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 1, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 1);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 1);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 1);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 1);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 1, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called == (PyObject *)&PyType_Type)) {\n                PyObject *result = (PyObject *)Py_TYPE(args[0]);\n                Py_INCREF(result);\n                return result;\n            }\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 1);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 1);\n                        } else {\n                            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 1);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 1);\n        } else {\n            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 1, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 1);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS1(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 1);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 1);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 1 == function->m_args_positional_count) {\n            Py_INCREF(args[0]);\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 1 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 1 * sizeof(PyObject *));\n            memcpy(python_pars + 1, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 1);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 1);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 1 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[1 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                python_pars[1] = args[0];\n                Py_INCREF(args[0]);\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       1 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 1 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 1, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 1);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (1 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if ((flags & METH_O)) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result = (*method)(self, args[0]);\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 1, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 1);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 1);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 1, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called == (PyObject *)&PyType_Type)) {\n                PyObject *result = (PyObject *)Py_TYPE(args[0]);\n                Py_INCREF(result);\n                return result;\n            }\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 1);\n                        } else {\n                            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 1);\n        } else {\n            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 1, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS2(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 2);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 2 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 2; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 2 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 2 * sizeof(PyObject *));\n            memcpy(python_pars + 2, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 2);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 2);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 2 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[2 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 2; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       2 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 2 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 2, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 2);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (2 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (2 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 2);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 2);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 2, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 2);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 2);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 2);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 2);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 2, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 2);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 2);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS2(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 2);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 2);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS2(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 2, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 2);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS2(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 2);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 2);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 2 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 2; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 2 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 2 * sizeof(PyObject *));\n            memcpy(python_pars + 2, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 2);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 2);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 2 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[2 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 2; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       2 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 2 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 2, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 2);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (2 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (2 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 2, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 2);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 2);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 2, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 2);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS2(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 2);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS2(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 2, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 3);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 3 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 3; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 3 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 3 * sizeof(PyObject *));\n            memcpy(python_pars + 3, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 3);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 3);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 3 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[3 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 3; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       3 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 3 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 3, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 3);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (3 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (3 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 3);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 3);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 3, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 3);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 3);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 3);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 3);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 3, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 3);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 3);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS3(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 3);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 3);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS3(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 3, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 3);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS3(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 3);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 3);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 3 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 3; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 3 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 3 * sizeof(PyObject *));\n            memcpy(python_pars + 3, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 3);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 3);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 3 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[3 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 3; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       3 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 3 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 3, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 3);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (3 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (3 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 3, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 3);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 3);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 3, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 3);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS3(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 3);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS3(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 3, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS4(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 4);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 4 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 4; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 4 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 4 * sizeof(PyObject *));\n            memcpy(python_pars + 4, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 4);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 4);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 4 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[4 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 4; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       4 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 4 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 4, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 4);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (4 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (4 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 4);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 4);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 4, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 4);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 4);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 4);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 4);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 4, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 4);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 4);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS4(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 4);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 4);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS4(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 4, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 4);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS4(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 4);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 4);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 4 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 4; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 4 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 4 * sizeof(PyObject *));\n            memcpy(python_pars + 4, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 4);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 4);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 4 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[4 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 4; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       4 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 4 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 4, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 4);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (4 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (4 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 4, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 4);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 4);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 4, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 4);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS4(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 4);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS4(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 4, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS5(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 5);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 5 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 5; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 5 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 5 * sizeof(PyObject *));\n            memcpy(python_pars + 5, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 5);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 5);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 5 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[5 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 5; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       5 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 5 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 5, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 5);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (5 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (5 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 5);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 5);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 5, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 5);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 5);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 5);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 5);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 5, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 5);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 5);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS5(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 5);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 5);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS5(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 5, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 5);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS5(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 5);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 5);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 5 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 5; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 5 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 5 * sizeof(PyObject *));\n            memcpy(python_pars + 5, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 5);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 5);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 5 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[5 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 5; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       5 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 5 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 5, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 5);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (5 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (5 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 5, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 5);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 5);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 5, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 5);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS5(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 5);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS5(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 5, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS6(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 6);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 6 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 6; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 6 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 6 * sizeof(PyObject *));\n            memcpy(python_pars + 6, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 6);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 6);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 6 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[6 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 6; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       6 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 6 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 6, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 6);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (6 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (6 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 6);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 6);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 6, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 6);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 6);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 6);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 6);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 6, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 6);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 6);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS6(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 6);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 6);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS6(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 6, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 6);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS6(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 6);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 6);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 6 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 6; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 6 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 6 * sizeof(PyObject *));\n            memcpy(python_pars + 6, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 6);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 6);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 6 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[6 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 6; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       6 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 6 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 6, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 6);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (6 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (6 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 6, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 6);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 6);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 6, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 6);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS6(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 6);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS6(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 6, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS7(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 7);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 7 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 7; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 7 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 7 * sizeof(PyObject *));\n            memcpy(python_pars + 7, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 7);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 7);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 7 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[7 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 7; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       7 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 7 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 7, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 7);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (7 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (7 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 7);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 7);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 7, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 7);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 7);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 7);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 7);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 7, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 7);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 7);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS7(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 7);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 7);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS7(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 7, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 7);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS7(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 7);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 7);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 7 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 7; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 7 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 7 * sizeof(PyObject *));\n            memcpy(python_pars + 7, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 7);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 7);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 7 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[7 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 7; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       7 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 7 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 7, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 7);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (7 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (7 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 7, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 7);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 7);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 7, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 7);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS7(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 7);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS7(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 7, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS8(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 8);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 8 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 8; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 8 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 8 * sizeof(PyObject *));\n            memcpy(python_pars + 8, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 8);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 8);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 8 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[8 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 8; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       8 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 8 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 8, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 8);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (8 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (8 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 8);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 8);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 8, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 8);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 8);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 8);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 8);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 8, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 8);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 8);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS8(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 8);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 8);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS8(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 8, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 8);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS8(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 8);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 8);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 8 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 8; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 8 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 8 * sizeof(PyObject *));\n            memcpy(python_pars + 8, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 8);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 8);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 8 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[8 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 8; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       8 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 8 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 8, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 8);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (8 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (8 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 8, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 8);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 8);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 8, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 8);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS8(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 8);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS8(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 8, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS9(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 9);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 9 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 9; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 9 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 9 * sizeof(PyObject *));\n            memcpy(python_pars + 9, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 9);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 9);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 9 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[9 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 9; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       9 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 9 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 9, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 9);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (9 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (9 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 9);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 9);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 9, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 9);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 9);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 9);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 9);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 9, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 9);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 9);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS9(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 9);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 9);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS9(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 9, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 9);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS9(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 9);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 9);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 9 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 9; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 9 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 9 * sizeof(PyObject *));\n            memcpy(python_pars + 9, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 9);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 9);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 9 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[9 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 9; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       9 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 9 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 9, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 9);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (9 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (9 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 9, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 9);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 9);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 9, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 9);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS9(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 9);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS9(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 9, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_ARGS10(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 10);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 10 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 10; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 10 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 10 * sizeof(PyObject *));\n            memcpy(python_pars + 10, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 10);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 10);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 10 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[10 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 10; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       10 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 10 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 10, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 10);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (10 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (10 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            PyObject *pos_args = MAKE_TUPLE(args, 10);\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n            Py_DECREF(pos_args);\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                PyObject *pos_args = MAKE_TUPLE(args, 10);\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n                Py_DECREF(pos_args);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 10, NULL);\n#else\n                PyObject *pos_args = MAKE_TUPLE(args, 10);\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 10);\n                Py_DECREF(pos_args);\n#endif\n            } else {\n                PyObject *pos_args = MAKE_TUPLE(args, 10);\n                result = (*method)(self, pos_args);\n                Py_DECREF(pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 10);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 10, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *pos_args = NULL;\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                pos_args = MAKE_TUPLE(args, 10);\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    Py_DECREF(pos_args);\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 10);\n                        } else {\n                            result = CALL_FUNCTION_WITH_ARGS10(tstate, init_method, args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, 10);\n                        }\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            Py_XDECREF(pos_args);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            Py_XDECREF(pos_args);\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 10);\n        } else {\n            result = CALL_FUNCTION_WITH_ARGS10(tstate, init_method, args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 10, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 10);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS10(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == 10);\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 10);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && 10 == function->m_args_positional_count) {\n            for (Py_ssize_t i = 0; i < 10; i++) {\n                Py_INCREF(args[i]);\n            }\n            result = function->m_c_code(tstate, function, (PyObject **)args);\n        } else if (function->m_args_simple && 10 + function->m_defaults_given == function->m_args_positional_count) {\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, 10 * sizeof(PyObject *));\n            memcpy(python_pars + 10, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                   function->m_defaults_given * sizeof(PyObject *));\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, 10);\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, 10);\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && 10 + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[10 + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                for (Py_ssize_t i = 0; i < 10; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple &&\n                       10 + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n                memcpy(python_pars + 1, args, 10 * sizeof(PyObject *));\n                memcpy(python_pars + 1 + 10, &PyTuple_GET_ITEM(function->m_defaults, 0),\n                       function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, 10);\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if (unlikely(flags & METH_NOARGS)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes no arguments (10 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (unlikely(flags & METH_O)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (10 given)\",\n                                                ((PyCFunctionObject *)called)->m_ml->ml_name);\n            return NULL;\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n#else\n            if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, 10, NULL);\n#else\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, 10);\n#endif\n            } else {\n                result = (*method)(self, pos_args);\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n        PyObject *result = callPythonFunction(called, args, 10);\n#else\n        PyObject *result = _PyFunction_Vectorcall(called, args, 10, NULL);\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError,\n                                                                   const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(\n                                tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 10);\n                        } else {\n                            result = CALL_FUNCTION_WITH_POSARGS10(tstate, init_method, pos_args);\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if (unlikely(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj,\n                                                      args, 10);\n        } else {\n            result = CALL_FUNCTION_WITH_POSARGS10(tstate, init_method, pos_args);\n            Py_DECREF(init_method);\n        }\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 10, NULL);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\nPyObject *CALL_FUNCTION_WITH_NO_ARGS_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *kw_values,\n                                             PyObject *kw_names) {\n\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, NULL, 0, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, kw_values, 0, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = const_tuple_empty;\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS1_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 1);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[1], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 1, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 1, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 1);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[1 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS1_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 1);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 1, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 1 + nkwargs);\n\n            memcpy(vectorcall_args, args, 1 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[1], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 1, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 1);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS1_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 1);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 1, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 1 + nkwargs);\n\n            memcpy(vectorcall_args, args, 1 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[1], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 1, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS2_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 2);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[2], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 2, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 2, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 2);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[2 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS2_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 2);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 2, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 2 + nkwargs);\n\n            memcpy(vectorcall_args, args, 2 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[2], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 2, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 2);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS2_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 2);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 2, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 2 + nkwargs);\n\n            memcpy(vectorcall_args, args, 2 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[2], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 2, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS3_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 3);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[3], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 3, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 3, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 3);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[3 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS3_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 3);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 3, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 3 + nkwargs);\n\n            memcpy(vectorcall_args, args, 3 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[3], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 3, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 3);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS3_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 3);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 3, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 3 + nkwargs);\n\n            memcpy(vectorcall_args, args, 3 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[3], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 3, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS4_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 4);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[4], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 4, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 4, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 4);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[4 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS4_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 4);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 4, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 4 + nkwargs);\n\n            memcpy(vectorcall_args, args, 4 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[4], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 4, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 4);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS4_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 4);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 4, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 4 + nkwargs);\n\n            memcpy(vectorcall_args, args, 4 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[4], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 4, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS5_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 5);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[5], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 5, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 5, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 5);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[5 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS5_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 5);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 5, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 5 + nkwargs);\n\n            memcpy(vectorcall_args, args, 5 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[5], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 5, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 5);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS5_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 5);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 5, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 5 + nkwargs);\n\n            memcpy(vectorcall_args, args, 5 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[5], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 5, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS6_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 6);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[6], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 6, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 6, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 6);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[6 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS6_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 6);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 6, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 6 + nkwargs);\n\n            memcpy(vectorcall_args, args, 6 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[6], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 6, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 6);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS6_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 6);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 6, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 6 + nkwargs);\n\n            memcpy(vectorcall_args, args, 6 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[6], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 6, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS7_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 7);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[7], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 7, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 7, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 7);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[7 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS7_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 7);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 7, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 7 + nkwargs);\n\n            memcpy(vectorcall_args, args, 7 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[7], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 7, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 7);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS7_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 7);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 7, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 7 + nkwargs);\n\n            memcpy(vectorcall_args, args, 7 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[7], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 7, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS8_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 8);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[8], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 8, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 8, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 8);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[8 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS8_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 8);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 8, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 8 + nkwargs);\n\n            memcpy(vectorcall_args, args, 8 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[8], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 8, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 8);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS8_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 8);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 8, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 8 + nkwargs);\n\n            memcpy(vectorcall_args, args, 8 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[8], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 8, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS9_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                              PyObject *kw_names) {\n    CHECK_OBJECTS(args, 9);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[9], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 9, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 9, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 9);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[9 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS9_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                           PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 9);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 9, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 9 + nkwargs);\n\n            memcpy(vectorcall_args, args, 9 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[9], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 9, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 9);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS9_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                              PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 9);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 9, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 9 + nkwargs);\n\n            memcpy(vectorcall_args, args, 9 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[9], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 9, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS10_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                               PyObject *kw_names) {\n    CHECK_OBJECTS(args, 10);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(&args[10], nkwargs);\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result =\n            Nuitka_CallFunctionVectorcall(tstate, function, args, 10, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            PyObject *result = func(called, args, 10, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 10);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = args[10 + i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_ARGS10_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args,\n                                            PyObject *const *kw_values, PyObject *kw_names) {\n    CHECK_OBJECTS(args, 10);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 10, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 10 + nkwargs);\n\n            memcpy(vectorcall_args, args, 10 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[10], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 10, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *pos_args = MAKE_TUPLE(args, 10);\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(pos_args);\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_FUNCTION_WITH_POSARGS10_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args,\n                                               PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n    CHECK_OBJECTS(args, 10);\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, 10, kw_values, kw_names);\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, 10 + nkwargs);\n\n            memcpy(vectorcall_args, args, 10 * sizeof(PyObject *));\n            memcpy(&vectorcall_args[10], kw_values, nkwargs * sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, 10, kw_names);\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n        PyObject *value = kw_values[i];\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\nPyObject *CALL_METHODDESCR_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 1);\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    assert(PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL));\n    vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n    assert(func != NULL);\n    PyObject *result = func(called, args, 1, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n    return result;\n#endif\n#else\n    PyMethodDescrObject *called_descr = (PyMethodDescrObject *)called;\n    PyMethodDef *method_def = called_descr->d_method;\n\n    // Try to be fast about wrapping the arguments.\n    int flags = method_def->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n    if (likely(flags & METH_NOARGS)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if ((flags & METH_O)) {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (1 given)\",\n                                            method_def->ml_name);\n        return NULL;\n    } else if (flags & METH_VARARGS) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n        PyObject *pos_args = MAKE_TUPLE(args + 1, 0);\n\n        if (flags & METH_KEYWORDS) {\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n        } else {\n            result = (*method)(self, pos_args);\n        }\n\n        Py_DECREF(pos_args);\n#else\n        if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 0);\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            Py_DECREF(pos_args);\n        } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n            result = (*(_PyCFunctionFast)method)(self, (PyObject **)args + 1, 0, NULL);\n#else\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 0);\n            result = (*(_PyCFunctionFast)method)(self, &pos_args, 1);\n            Py_DECREF(pos_args);\n#endif\n        } else {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 0);\n            result = (*method)(self, pos_args);\n            Py_DECREF(pos_args);\n        }\n#endif\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 1);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    return result;\n#endif\n}\nPyObject *CALL_METHODDESCR_WITH_ARGS2(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 2);\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    assert(PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL));\n    vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n    assert(func != NULL);\n    PyObject *result = func(called, args, 2, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n    return result;\n#endif\n#else\n    PyMethodDescrObject *called_descr = (PyMethodDescrObject *)called;\n    PyMethodDef *method_def = called_descr->d_method;\n\n    // Try to be fast about wrapping the arguments.\n    int flags = method_def->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n    if (unlikely(flags & METH_NOARGS)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if (unlikely(flags & METH_O)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, args[1]);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if (flags & METH_VARARGS) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n        PyObject *pos_args = MAKE_TUPLE(args + 1, 1);\n\n        if (flags & METH_KEYWORDS) {\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n        } else {\n            result = (*method)(self, pos_args);\n        }\n\n        Py_DECREF(pos_args);\n#else\n        if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 1);\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            Py_DECREF(pos_args);\n        } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n            result = (*(_PyCFunctionFast)method)(self, (PyObject **)args + 1, 1, NULL);\n#else\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 1);\n            result = (*(_PyCFunctionFast)method)(self, &pos_args, 2);\n            Py_DECREF(pos_args);\n#endif\n        } else {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 1);\n            result = (*method)(self, pos_args);\n            Py_DECREF(pos_args);\n        }\n#endif\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 2);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    return result;\n#endif\n}\nPyObject *CALL_METHODDESCR_WITH_ARGS3(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 3);\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    assert(PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL));\n    vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n    assert(func != NULL);\n    PyObject *result = func(called, args, 3, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n    return result;\n#endif\n#else\n    PyMethodDescrObject *called_descr = (PyMethodDescrObject *)called;\n    PyMethodDef *method_def = called_descr->d_method;\n\n    // Try to be fast about wrapping the arguments.\n    int flags = method_def->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n    if (unlikely(flags & METH_NOARGS)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if (unlikely(flags & METH_O)) {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (3 given)\",\n                                            method_def->ml_name);\n        return NULL;\n    } else if (flags & METH_VARARGS) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n        PyObject *pos_args = MAKE_TUPLE(args + 1, 2);\n\n        if (flags & METH_KEYWORDS) {\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n        } else {\n            result = (*method)(self, pos_args);\n        }\n\n        Py_DECREF(pos_args);\n#else\n        if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 2);\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            Py_DECREF(pos_args);\n        } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n            result = (*(_PyCFunctionFast)method)(self, (PyObject **)args + 1, 2, NULL);\n#else\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 2);\n            result = (*(_PyCFunctionFast)method)(self, &pos_args, 3);\n            Py_DECREF(pos_args);\n#endif\n        } else {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 2);\n            result = (*method)(self, pos_args);\n            Py_DECREF(pos_args);\n        }\n#endif\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 3);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    return result;\n#endif\n}\nPyObject *CALL_METHODDESCR_WITH_ARGS4(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n    CHECK_OBJECT(called);\n    CHECK_OBJECTS(args, 4);\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    assert(PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL));\n    vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n    assert(func != NULL);\n    PyObject *result = func(called, args, 4, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n    return result;\n#endif\n#else\n    PyMethodDescrObject *called_descr = (PyMethodDescrObject *)called;\n    PyMethodDef *method_def = called_descr->d_method;\n\n    // Try to be fast about wrapping the arguments.\n    int flags = method_def->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n    if (unlikely(flags & METH_NOARGS)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if (unlikely(flags & METH_O)) {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, \"%s() takes exactly one argument (4 given)\",\n                                            method_def->ml_name);\n        return NULL;\n    } else if (flags & METH_VARARGS) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n        PyObject *pos_args = MAKE_TUPLE(args + 1, 3);\n\n        if (flags & METH_KEYWORDS) {\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n        } else {\n            result = (*method)(self, pos_args);\n        }\n\n        Py_DECREF(pos_args);\n#else\n        if (flags == (METH_VARARGS | METH_KEYWORDS)) {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 3);\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            Py_DECREF(pos_args);\n        } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n            result = (*(_PyCFunctionFast)method)(self, (PyObject **)args + 1, 3, NULL);\n#else\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 3);\n            result = (*(_PyCFunctionFast)method)(self, &pos_args, 4);\n            Py_DECREF(pos_args);\n#endif\n        } else {\n            PyObject *pos_args = MAKE_TUPLE(args + 1, 3);\n            result = (*method)(self, pos_args);\n            Py_DECREF(pos_args);\n        }\n#endif\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    PyObject *pos_args = MAKE_TUPLE(args, 4);\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n\n    return result;\n#endif\n}\nPyObject *CALL_METHOD_NO_ARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result =\n                    Nuitka_CallMethodFunctionNoArgs(tstate, (struct Nuitka_FunctionObject const *)descr, source);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, descr);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_NO_ARGS(tstate, called_object);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionNoArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                       source);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, method);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_NO_ARGS(tstate, called_object);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, descr);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, called_object);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 1);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 1);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, descr, args[0]);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 1);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, method, args[0]);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, descr, args[0]);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, called_object, args[0]);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS2(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 2);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 2);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 2);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS2(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS3(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 3);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 3);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 3);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS4(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 4);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 4);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 4);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS4(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS5(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 5);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 5);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 5);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS5(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS6(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 6);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 6);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 6);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS6(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS7(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 7);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 7);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 7);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS7(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS8(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 8);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 8);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 8);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS8(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS9(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 9);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 9);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 9);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS9(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\nPyObject *CALL_METHOD_WITH_ARGS10(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    CHECK_OBJECTS(args, 10);\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **)((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)descr,\n                                                                    source, args, 10);\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, descr, args);\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            PyString_AS_STRING(attr_name));\n#else\n        PyErr_Format(PyExc_AttributeError, \"'%s' object has no attribute '%U'\", type->tp_name, attr_name);\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object =\n            GET_STRING_DICT_VALUE((PyDictObject *)source_instance->in_dict, (PyStringObject *)attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(source_instance->in_class, attr_name);\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n                return Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)called_object,\n                                                        source, args, 10);\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(called_object, source, (PyObject *)source_instance->in_class);\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, method, args);\n                Py_DECREF(method);\n                return result;\n            } else {\n                return CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"%s instance has no attribute '%s'\",\n                                                PyString_AS_STRING(source_instance->in_class->cl_name),\n                                                PyString_AS_STRING(attr_name));\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {source, attr_name};\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(tstate, source_instance->in_class->cl_getattr, args2);\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, descr, args);\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(source, (char *)Nuitka_String_AsString_Unchecked(attr_name));\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = CALL_FUNCTION_WITH_ARGS10(tstate, called_object, args);\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyExc_AttributeError, \"'%s' object has no attribute '%s'\", type->tp_name,\n                                            Nuitka_String_AsString_Unchecked(attr_name));\n\n        return NULL;\n    }\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersChecksumTools.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Comment in to disable outside zlib usage for code size, very slow though,\n// since it doesn't use assembly to use CPU crc32 instructions.\n// #define _NUITKA_USE_OWN_CRC32\n\n#ifdef _NUITKA_USE_OWN_CRC32\nuint32_t _initCRC32(void) { return 0xFFFFFFFF; }\n\nuint32_t _updateCRC32(uint32_t crc, unsigned char const *message, uint32_t size) {\n    for (uint32_t i = 0; i < size; i++) {\n        unsigned int c = message[i];\n        crc = crc ^ c;\n\n        for (int j = 7; j >= 0; j--) {\n            uint32_t mask = ((crc & 1) != 0) ? 0xFFFFFFFF : 0;\n            crc = (crc >> 1) ^ (0xEDB88320 & mask);\n        }\n    }\n\n    return crc;\n}\n\nuint32_t _finalizeCRC32(uint32_t crc) { return ~crc; }\n\n// No Python runtime is available yet, need to do this in C.\nuint32_t calcCRC32(unsigned char const *message, uint32_t size) {\n    return _finalizeCRC32(_updateCRC32(_initCRC32(), message, size));\n}\n#else\n\n#ifdef _NUITKA_USE_SYSTEM_CRC32\n#include \"zlib.h\"\n#else\n#include \"crc32.c\"\n#endif\n\nuint32_t calcCRC32(unsigned char const *message, uint32_t size) { return crc32(0, message, size) & 0xFFFFFFFF; }\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersClasses.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For creating classes.\n *\n * Currently only the Python3 meta class selection is here, but more will be\n * added later, should be choose to have our own \"__slots__\" special metaclass.\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x300\nPyObject *SELECT_METACLASS(PyThreadState *tstate, PyObject *metaclass, PyObject *bases) {\n    CHECK_OBJECT(metaclass);\n    CHECK_OBJECT(bases);\n\n    if (likely(PyType_Check(metaclass))) {\n        // Determine the proper metaclass type\n        Py_ssize_t nbases = PyTuple_GET_SIZE(bases);\n        PyTypeObject *winner = (PyTypeObject *)metaclass;\n\n#if _DEBUG_CLASSES\n        PRINT_STRING(\"Bases:\");\n        PRINT_ITEM((PyObject *)bases);\n        PRINT_NEW_LINE();\n#endif\n\n        for (int i = 0; i < nbases; i++) {\n            PyObject *base = PyTuple_GET_ITEM(bases, i);\n\n            PyTypeObject *base_type = Py_TYPE(base);\n\n            if (Nuitka_Type_IsSubtype(winner, base_type)) {\n                // Ignore if current winner is already a subtype.\n                continue;\n            } else if (Nuitka_Type_IsSubtype(base_type, winner)) {\n                // Use if, if it's a subtype of the current winner.\n                winner = base_type;\n                continue;\n            } else {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                                \"metaclass conflict: the metaclass of a derived class must be a \"\n                                                \"(non-strict) subclass of the metaclasses of all its bases\");\n\n                return NULL;\n            }\n        }\n\n        if (unlikely(winner == NULL)) {\n            return NULL;\n        }\n\n#if _DEBUG_CLASSES\n        PRINT_STRING(\"Metaclass winner:\");\n        PRINT_ITEM((PyObject *)winner);\n        PRINT_NEW_LINE();\n#endif\n\n        Py_INCREF(winner);\n        return (PyObject *)winner;\n    } else {\n#if _DEBUG_CLASSES\n        PRINT_STRING(\"Metaclass not a type is used:\");\n        PRINT_ITEM((PyObject *)metaclass);\n        PRINT_NEW_LINE();\n#endif\n\n        Py_INCREF(metaclass);\n        return metaclass;\n    }\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonEq.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersComparisonEqUtils.c\"\n/* C helpers for type specialized \"==\" (EQ) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_EQ_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a == b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_EQ_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a == b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_EQ_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_EQ_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_EQ_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = true;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        } else {\n            bool r = false;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_EQ_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_EQ_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = true;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        } else {\n            bool r = false;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        }\n    }\n}\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nbool RICH_COMPARE_EQ_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_EQ_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_EQ_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        int kind1 = PyUnicode_KIND(a);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind1 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)a);\n            assert(res != -1);\n            kind1 = PyUnicode_KIND(a);\n            assert(kind1 != 0);\n        }\n#endif\n\n        int kind2 = PyUnicode_KIND(b);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind2 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)b);\n            assert(res != -1);\n            kind2 = PyUnicode_KIND(b);\n            assert(kind2 != 0);\n        }\n#endif\n\n        if (kind1 != kind2) {\n            r = false;\n        } else {\n            const void *data1 = PyUnicode_DATA(a);\n            const void *data2 = PyUnicode_DATA(b);\n\n            int cmp = memcmp(data1, data2, len * kind1);\n            r = (cmp == 0);\n        }\n    }\n\n    PyObject *result = BOOL_FROM(r == true);\n    Py_INCREF(result);\n    return result;\n#else\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        const Py_UNICODE *data1 = a->str;\n        const Py_UNICODE *data2 = b->str;\n\n        int cmp = memcmp(data1, data2, len * sizeof(Py_UNICODE));\n        r = (cmp == 0);\n    }\n\n    PyObject *result = BOOL_FROM(r == true);\n    Py_INCREF(result);\n    return result;\n#endif\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_EQ_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() == %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_UNICODE_UNICODE(operand1, operand2);\n}\n\nstatic bool COMPARE_EQ_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        int kind1 = PyUnicode_KIND(a);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind1 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)a);\n            assert(res != -1);\n            kind1 = PyUnicode_KIND(a);\n            assert(kind1 != 0);\n        }\n#endif\n\n        int kind2 = PyUnicode_KIND(b);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind2 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)b);\n            assert(res != -1);\n            kind2 = PyUnicode_KIND(b);\n            assert(kind2 != 0);\n        }\n#endif\n\n        if (kind1 != kind2) {\n            r = false;\n        } else {\n            const void *data1 = PyUnicode_DATA(a);\n            const void *data2 = PyUnicode_DATA(b);\n\n            int cmp = memcmp(data1, data2, len * kind1);\n            r = (cmp == 0);\n        }\n    }\n\n    bool result = r == true;\n\n    return result;\n#else\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        const Py_UNICODE *data1 = a->str;\n        const Py_UNICODE *data2 = b->str;\n\n        int cmp = memcmp(data1, data2, len * sizeof(Py_UNICODE));\n        r = (cmp == 0);\n    }\n\n    bool result = r == true;\n\n    return result;\n#endif\n}\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nbool RICH_COMPARE_EQ_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_EQ_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() == %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_EQ_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = true;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        } else {\n            bool r = false;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_EQ_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_EQ_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = true;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        } else {\n            bool r = false;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        }\n    }\n}\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nbool RICH_COMPARE_EQ_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_EQ_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_EQ_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_EQ_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_EQ_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_EQ_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_EQ_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() == %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_LONG_LONG(operand1, operand2);\n}\n\nstatic bool COMPARE_EQ_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nbool RICH_COMPARE_EQ_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_EQ_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() == %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_EQ_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a == b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_EQ_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_EQ_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a == b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nbool RICH_COMPARE_EQ_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_EQ_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_EQ_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r = res == NUITKA_BOOL_TRUE;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_EQ_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_EQ_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    if (len_a != len_b) {\n        bool r = false;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r = res == NUITKA_BOOL_TRUE;\n\n    // Convert to target type.\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_EQ_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_EQ_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r;\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) == Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_TRUE;\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_EQ_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_EQ_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n        bool r = false;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r;\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) == Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_TRUE;\n    }\n\n    // Convert to target type.\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_EQ_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() == list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_EQ_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_EQ) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_EQ) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_EQ);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_EQ);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_EQ) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() == %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'==' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_EQ_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_EQ_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_EQ_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_EQ_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_EQ_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_EQ_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a == b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_EQ_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_EQ_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_EQ_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a == b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_EQ_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_EQ_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_EQ_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_EQ_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_EQ_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_EQ_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = false;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = false;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_EQ_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_EQ_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_EQ_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a == b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_EQ_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_EQ_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_EQ_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a == b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_EQ_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_EQ_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonEqUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For making rich comparisons work.\n *\n * Helpers that implement the details of comparisons for both Python2 and\n * Python3 individually, mostly because of the many changes.\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\npython_initproc default_tp_init_wrapper;\n\n#if PYTHON_VERSION < 0x300\nstatic cmpfunc default_tp_compare;\n#endif\n\nvoid _initSlotCompare(void) {\n    // Create a class with \"__cmp__\" attribute, to get a hand at the default\n    // implementation of tp_compare. It's not part of the API and with shared\n    // libraries it's not accessible. The name does not matter, nor does the\n    // actual value used for \"__cmp__\".\n\n    // Use \"int\" as the base class.\n    PyObject *pos_args = MAKE_TUPLE1((PyObject *)&PyLong_Type);\n\n    // Use \"__cmp__\" with true value, won't matter.\n    // Note: Not using MAKE_DICT_EMPTY on purpose, this is called early on.\n    PyObject *kw_args = PyDict_New();\n#if PYTHON_VERSION < 0x0300\n    PyDict_SetItem(kw_args, const_str_plain___cmp__, Py_True);\n#endif\n    PyDict_SetItem(kw_args, const_str_plain___init__, (PyObject *)Py_TYPE(Py_None));\n\n    // Create the type.\n    PyTypeObject *c = (PyTypeObject *)PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, const_str_plain___cmp__,\n                                                                   pos_args, kw_args, NULL);\n    Py_DECREF(pos_args);\n    Py_DECREF(kw_args);\n\n    CHECK_OBJECT(c);\n\n#if PYTHON_VERSION < 0x0300\n    assert(c->tp_compare);\n    default_tp_compare = c->tp_compare;\n#endif\n\n    assert(c->tp_init);\n    default_tp_init_wrapper = c->tp_init;\n\n    Py_DECREF(c);\n}\n\n#if PYTHON_VERSION < 0x300\n\nstatic inline int adjust_tp_compare(int c) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    if (HAS_ERROR_OCCURRED(tstate)) {\n        return -2;\n    } else if (c < -1 || c > 1) {\n        return c < -1 ? -1 : 1;\n    } else {\n        return c;\n    }\n}\n\nstatic inline int coerce_objects(PyObject **pa, PyObject **pb) {\n    PyObject *a = *pa;\n    PyObject *b = *pb;\n\n    // Shortcut only for old-style types\n    if (a->ob_type == b->ob_type && !PyType_HasFeature(a->ob_type, Py_TPFLAGS_CHECKTYPES)) {\n        Py_INCREF(a);\n        Py_INCREF(b);\n\n        return 0;\n    }\n    if (a->ob_type->tp_as_number && a->ob_type->tp_as_number->nb_coerce) {\n        int res = (*a->ob_type->tp_as_number->nb_coerce)(pa, pb);\n\n        if (res <= 0) {\n            return res;\n        }\n    }\n    if (b->ob_type->tp_as_number && b->ob_type->tp_as_number->nb_coerce) {\n        int res = (*b->ob_type->tp_as_number->nb_coerce)(pb, pa);\n\n        if (res <= 0) {\n            return res;\n        }\n    }\n\n    return 1;\n}\n\nstatic int try_3way_compare(PyObject *a, PyObject *b) {\n    cmpfunc f1 = a->ob_type->tp_compare;\n    cmpfunc f2 = b->ob_type->tp_compare;\n    int c;\n\n    // Same compares, just use it.\n    if (f1 != NULL && f1 == f2) {\n        c = (*f1)(a, b);\n        return adjust_tp_compare(c);\n    }\n\n    // If one slot is _PyObject_SlotCompare (which we got our hands on under a\n    // different name in case it's a shared library), prefer it.\n    if (f1 == default_tp_compare || f2 == default_tp_compare) {\n        return default_tp_compare(a, b);\n    }\n\n    // Try coercion.\n    c = coerce_objects(&a, &b);\n\n    if (c < 0) {\n        return -2;\n    }\n    if (c > 0) {\n        return 2;\n    }\n\n    f1 = a->ob_type->tp_compare;\n    if (f1 != NULL && f1 == b->ob_type->tp_compare) {\n        c = (*f1)(a, b);\n        Py_DECREF(a);\n        Py_DECREF(b);\n\n        return adjust_tp_compare(c);\n    }\n\n    // No comparison defined.\n    Py_DECREF(a);\n    Py_DECREF(b);\n    return 2;\n}\n\n#endif\n\nstatic inline bool IS_SANE_TYPE(PyTypeObject *type) {\n    return\n#if PYTHON_VERSION < 0x300\n        type == &PyString_Type || type == &PyInt_Type ||\n#endif\n        type == &PyLong_Type || type == &PyList_Type || type == &PyTuple_Type;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonGe.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">=\" (GE) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GE_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_GE_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_GE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c >= 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_GE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c >= 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_GE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_GE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_GE);\n    CHECK_OBJECT(r);\n\n    return r;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_GE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() >= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_GE);\n    CHECK_OBJECT(r);\n\n    // Convert to target type if necessary\n    bool result = r == Py_True;\n    Py_DECREF(r);\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_GE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() >= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_GE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c >= 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_GE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_GE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c >= 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_GE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_GE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_GE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_GE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_GE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() >= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_GE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() >= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_GE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_GE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GE_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_GE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_GE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a >= len_b;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_GE_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_GE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_GE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_GE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a >= len_b;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_GE_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_GE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) >= Py_SIZE(b);\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_GE_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_GE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) >= Py_SIZE(b);\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_GE_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_GE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() >= list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_GE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() >= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_GE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_GE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GE_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_GE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_GE_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_GE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_GE_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_GE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_GE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_GE_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_GE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_GE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_GE_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_GE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_GE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_GE_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_GE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a >= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_GE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_GE_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonGt.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">\" (GT) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a > b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GT_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a > b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_GT_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_GT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c > 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_GT_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c > 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_GT_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_GT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_GT);\n    CHECK_OBJECT(r);\n\n    return r;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_GT_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() > %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_GT);\n    CHECK_OBJECT(r);\n\n    // Convert to target type if necessary\n    bool result = r == Py_True;\n    Py_DECREF(r);\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_GT_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() > %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_GT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c > 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_GT_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_GT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c > 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_GT_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_GT_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_GT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_GT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_GT_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() > %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_GT_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() > %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_GT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a > b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_GT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_GT_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a > b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_GT_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_GT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a > len_b;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_GT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_GT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_GT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a > len_b;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_GT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) > Py_SIZE(b);\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_GT_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) > Py_SIZE(b);\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_GT_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() > list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_GT_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_GT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_GT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_GT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() > %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'>' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_GT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_GT_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_GT_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_GT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a > b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_GT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_GT_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_GT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a > b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_GT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_GT_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_GT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_GT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_GT_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_GT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_GT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_GT_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_GT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a > b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_GT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_GT_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_GT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a > b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_GT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_GT_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonLe.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<=\" (LE) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LE_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_LE_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_LE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = true;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c <= 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_LE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c <= 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nbool RICH_COMPARE_LE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_LE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_LE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_LE);\n    CHECK_OBJECT(r);\n\n    return r;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_LE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() <= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nPyObject *RICH_COMPARE_LE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n}\n\nstatic bool COMPARE_LE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_LE);\n    CHECK_OBJECT(r);\n\n    // Convert to target type if necessary\n    bool result = r == Py_True;\n    Py_DECREF(r);\n\n    return result;\n}\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nbool RICH_COMPARE_LE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_LE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() <= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c <= 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_LE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_LE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c <= 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nbool RICH_COMPARE_LE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_LE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_LE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_LE_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_LE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_LE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() <= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_LONG_LONG(operand1, operand2);\n}\n\nstatic bool COMPARE_LE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nbool RICH_COMPARE_LE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_LE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() <= %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_LE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_LE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_LE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_LE_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nbool RICH_COMPARE_LE_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_LE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_LE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a <= len_b;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_LE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_LE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_LE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a <= len_b;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_LE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) <= Py_SIZE(b);\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_LE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) <= Py_SIZE(b);\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_LE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() <= list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_LE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() <= %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_LE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LE_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_LE_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_LE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_LE_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_LE_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_LE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = true;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_LE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_LE_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_LE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_LE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_LE_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_LE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a <= b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_LE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_LE_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonLt.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<\" (LT) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a < b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LT_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a < b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_LT_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_LT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c < 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_LT_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c < 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nbool RICH_COMPARE_LT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_LT_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_LT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_LT);\n    CHECK_OBJECT(r);\n\n    return r;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_LT_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() < %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nPyObject *RICH_COMPARE_LT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_UNICODE_UNICODE(operand1, operand2);\n}\n\nstatic bool COMPARE_LT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_LT);\n    CHECK_OBJECT(r);\n\n    // Convert to target type if necessary\n    bool result = r == Py_True;\n    Py_DECREF(r);\n\n    return result;\n}\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nbool RICH_COMPARE_LT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_LT_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() < %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c < 0;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(c != 0);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_LT_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_LT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c == 0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n    c = c < 0;\n\n    // Convert to target type.\n    bool result = c != 0;\n\n    return result;\n}\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nbool RICH_COMPARE_LT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_LT_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_LT_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_LT_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_LT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_LT_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() < %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_LONG_LONG(operand1, operand2);\n}\n\nstatic bool COMPARE_LT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <\n                    Nuitka_LongGetDigitPointer(operand2_long_object)[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nbool RICH_COMPARE_LT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_LT_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() < %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_LT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a < b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_LT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_LT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_LT_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a < b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nbool RICH_COMPARE_LT_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_LT_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_LT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a < len_b;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_LT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_LT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_LT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = len_a < len_b;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_LT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) < Py_SIZE(b);\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    return RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_LT_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    bool found = false;\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            found = true;\n            break;\n        }\n    }\n\n    if (found == false) {\n        bool r = Py_SIZE(a) < Py_SIZE(b);\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    return RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_LT_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() < list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_LT_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_LT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_LT) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_LT) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_LT);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_GT);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_LT) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() < %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'<' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_LT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = Py_SIZE(operand1_long_object) - operand2_size < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_LT_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_LT_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a < b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_LT_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_LT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a < b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_LT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_LT_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_LT_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_LT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);\n                if (Py_SIZE(operand1_long_object) < 0) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_LT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_LT_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_LT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a < b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_LT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_LT_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_LT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a < b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_LT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_LT_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersComparisonNe.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"!=\" (NE) comparisons */\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_NE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a != b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n#endif\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_NE_CBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    bool r = a != b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n#endif\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_NE_OBJECT_INT_INT(operand1, operand2);\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = false;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        return COMPARE_NE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n#endif\n\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {\n        bool r = false;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == type2 && !PyInstance_Check(operand1)) {\n\n        richcmpfunc frich = RICHCOMPARE(type1);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = type1->tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != %s()\", type1->tp_name, type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_NE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = false;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        } else {\n            bool r = true;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_NE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_STR_STR(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_NE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = false;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        } else {\n            bool r = true;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyString_Type) {\n        return COMPARE_NE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyString_Type && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && 0) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyString_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"str\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyString_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyString_Type && Nuitka_Type_IsSubtype(&PyString_Type, type1)) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyString_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyString_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_STR_STR(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyString_Type == type2 && !0) {\n\n        richcmpfunc frich = PyString_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyString_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"str\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyString_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyString_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_NE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        int kind1 = PyUnicode_KIND(a);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind1 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)a);\n            assert(res != -1);\n            kind1 = PyUnicode_KIND(a);\n            assert(kind1 != 0);\n        }\n#endif\n\n        int kind2 = PyUnicode_KIND(b);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind2 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)b);\n            assert(res != -1);\n            kind2 = PyUnicode_KIND(b);\n            assert(kind2 != 0);\n        }\n#endif\n\n        if (kind1 != kind2) {\n            r = false;\n        } else {\n            const void *data1 = PyUnicode_DATA(a);\n            const void *data2 = PyUnicode_DATA(b);\n\n            int cmp = memcmp(data1, data2, len * kind1);\n            r = (cmp == 0);\n        }\n    }\n\n    PyObject *result = BOOL_FROM(r == false);\n    Py_INCREF(result);\n    return result;\n#else\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        const Py_UNICODE *data1 = a->str;\n        const Py_UNICODE *data2 = b->str;\n\n        int cmp = memcmp(data1, data2, len * sizeof(Py_UNICODE));\n        r = (cmp == 0);\n    }\n\n    PyObject *result = BOOL_FROM(r == false);\n    Py_INCREF(result);\n    return result;\n#endif\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_NE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_UNICODE_UNICODE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() != %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_NE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        int kind1 = PyUnicode_KIND(a);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind1 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)a);\n            assert(res != -1);\n            kind1 = PyUnicode_KIND(a);\n            assert(kind1 != 0);\n        }\n#endif\n\n        int kind2 = PyUnicode_KIND(b);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind2 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)b);\n            assert(res != -1);\n            kind2 = PyUnicode_KIND(b);\n            assert(kind2 != 0);\n        }\n#endif\n\n        if (kind1 != kind2) {\n            r = false;\n        } else {\n            const void *data1 = PyUnicode_DATA(a);\n            const void *data2 = PyUnicode_DATA(b);\n\n            int cmp = memcmp(data1, data2, len * kind1);\n            r = (cmp == 0);\n        }\n    }\n\n    bool result = r == false;\n\n    return result;\n#else\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        const Py_UNICODE *data1 = a->str;\n        const Py_UNICODE *data2 = b->str;\n\n        int cmp = memcmp(data1, data2, len * sizeof(Py_UNICODE));\n        r = (cmp == 0);\n    }\n\n    bool result = r == false;\n\n    return result;\n#endif\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyUnicode_Type) {\n        return COMPARE_NE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyUnicode_Type && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && 0) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyUnicode_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyUnicode_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyUnicode_Type && Nuitka_Type_IsSubtype(&PyUnicode_Type, type1)) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyUnicode_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != unicode()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != str()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'str'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyUnicode_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_UNICODE_UNICODE(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyUnicode_Type == type2 && !0) {\n\n        richcmpfunc frich = PyUnicode_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyUnicode_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyUnicode_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"unicode\" : \"str\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyUnicode_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyUnicode_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: unicode() != %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: str() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'str' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *COMPARE_NE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = false;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        } else {\n            bool r = true;\n\n            // Convert to target type.\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_NE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_BYTES_BYTES(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic bool COMPARE_NE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n        bool r = false;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        bool result = r;\n\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n            bool r = false;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        } else {\n            bool r = true;\n\n            // Convert to target type.\n            bool result = r;\n\n            return result;\n        }\n    }\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyBytes_Type) {\n        return COMPARE_NE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyBytes_Type && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && 0) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyBytes_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"bytes\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyBytes_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyBytes_Type && Nuitka_Type_IsSubtype(&PyBytes_Type, type1)) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyBytes_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != bytes()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'bytes'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyBytes_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_BYTES_BYTES(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyBytes_Type == type2 && !0) {\n\n        richcmpfunc frich = PyBytes_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyBytes_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"bytes\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyBytes_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyBytes_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: bytes() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'bytes' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_NE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_INT_INT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyInt_Type) {\n        return COMPARE_NE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyInt_Type && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && 0) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyInt_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"int\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyInt_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyInt_Type && Nuitka_Type_IsSubtype(&PyInt_Type, type1)) {\n        f = NULL;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = NULL;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyInt_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_INT_INT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyInt_Type == type2 && !0) {\n\n        richcmpfunc frich = NULL;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyInt_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyInt_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"int\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyInt_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = NULL;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n#endif\n\nstatic PyObject *COMPARE_NE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_NE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_LONG_LONG(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() != %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_NE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    bool r;\n\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=\n                Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyLong_Type) {\n        return COMPARE_NE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyLong_Type && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && 0) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyLong_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, (PYTHON_VERSION < 0x300 ? \"long\" : \"int\"));\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyLong_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyLong_Type && Nuitka_Type_IsSubtype(&PyLong_Type, type1)) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != long()\", type1->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != int()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'int'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyLong_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_LONG_LONG(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyLong_Type == type2 && !0) {\n\n        richcmpfunc frich = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = PyLong_Type.tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyLong_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp((PYTHON_VERSION < 0x300 ? \"long\" : \"int\"), type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyLong_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unorderable types: long() != %s()\", type2->tp_name);\n#elif PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: int() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'int' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_NE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a != b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_NE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_FLOAT_FLOAT(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\nstatic bool COMPARE_NE_CBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    bool r = a != b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyFloat_Type) {\n        return COMPARE_NE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyFloat_Type && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && 0) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyFloat_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"float\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyFloat_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyFloat_Type && Nuitka_Type_IsSubtype(&PyFloat_Type, type1)) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyFloat_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != float()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'float'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyFloat_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_CBOOL_FLOAT_FLOAT(operand1, operand2) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyFloat_Type == type2 && !0) {\n\n        richcmpfunc frich = PyFloat_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyFloat_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"float\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyFloat_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyFloat_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: float() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'float' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\nstatic PyObject *COMPARE_NE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r = res == NUITKA_BOOL_FALSE;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_NE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nPyObject *RICH_COMPARE_NE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_NE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n    if (len_a != len_b) {\n        bool r = true;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r = res == NUITKA_BOOL_FALSE;\n\n    // Convert to target type.\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyTuple_Type) {\n        return COMPARE_NE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyTuple_Type && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && 0) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyTuple_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"tuple\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyTuple_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyTuple_Type && Nuitka_Type_IsSubtype(&PyTuple_Type, type1)) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyTuple_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != tuple()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'tuple'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyTuple_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyTuple_Type == type2 && !0) {\n\n        richcmpfunc frich = PyTuple_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyTuple_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"tuple\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyTuple_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyTuple_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: tuple() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'tuple' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_NBOOL_TUPLE_TUPLE(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_NE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n        bool r = true;\n\n        // Convert to target type.\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NULL;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r;\n\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) != Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_FALSE;\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_NE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_NE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nPyObject *RICH_COMPARE_NE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_OBJECT_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NULL;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NULL;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            PyObject *result = BOOL_FROM(r);\n            Py_INCREF(result);\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NULL;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            return result;\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                return result;\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        PyObject *result = BOOL_FROM(r);\n        Py_INCREF(result);\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NULL;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nPyObject *RICH_COMPARE_NE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_OBJECT_LIST_LIST(operand1, operand2);\n}\n\nstatic nuitka_bool COMPARE_NE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n        bool r = true;\n\n        // Convert to target type.\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return NUITKA_BOOL_EXCEPTION;\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n            break;\n        }\n    }\n\n    bool r;\n\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) != Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_FALSE;\n    }\n\n    // Convert to target type.\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n}\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n\n    if (Py_TYPE(operand1) == &PyList_Type) {\n        return COMPARE_NE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (type1 == &PyList_Type && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && 0) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (PyInstance_Check(operand1)) {\n        cmpfunc fcmp = type1->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (type1 == &PyList_Type) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(type1->tp_name, \"list\");\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)type1;\n                Py_uintptr_t bb = (Py_uintptr_t)&PyList_Type;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (type1 != &PyList_Type && Nuitka_Type_IsSubtype(&PyList_Type, type1)) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = RICHCOMPARE(type1);\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = PyList_Type.tp_richcompare;\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: %s() != list()\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of '%s' and 'list'\", type1->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n\n    if (&PyList_Type == Py_TYPE(operand2)) {\n        return COMPARE_NE_NBOOL_LIST_LIST(operand1, operand2);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if (&PyList_Type == type2 && !0) {\n\n        richcmpfunc frich = PyList_Type.tp_richcompare;\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n        cmpfunc fcmp = NULL;\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            switch (Py_NE) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = RICHCOMPARE(type2);\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if (0) {\n        cmpfunc fcmp = NULL;\n        c = (*fcmp)(operand1, operand2);\n    } else if (PyInstance_Check(operand2)) {\n        cmpfunc fcmp = type2->tp_compare;\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if (&PyList_Type == type2) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp(\"list\", type2->tp_name);\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t)&PyList_Type;\n                Py_uintptr_t bb = (Py_uintptr_t)type2;\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    switch (Py_NE) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = PyList_Type.tp_richcompare;\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_NE);\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            if (unlikely(result == NULL)) {\n                return NUITKA_BOOL_EXCEPTION;\n            }\n\n            {\n                nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                Py_DECREF(result);\n                return r;\n            }\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = RICHCOMPARE(type2);\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_NE);\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                if (unlikely(result == NULL)) {\n                    return NUITKA_BOOL_EXCEPTION;\n                }\n\n                {\n                    nuitka_bool r = CHECK_IF_TRUE(result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n                    Py_DECREF(result);\n                    return r;\n                }\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch (Py_NE) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n\n        return result;\n    }\n    default:\n#if PYTHON_VERSION < 0x360\n        PyErr_Format(PyExc_TypeError, \"unorderable types: list() != %s()\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"'!=' not supported between instances of 'list' and '%s'\", type2->tp_name);\n#endif\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nnuitka_bool RICH_COMPARE_NE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_NE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nPyObject *RICH_COMPARE_NE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_OBJECT_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_NE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool operand2_is_negative;\n    unsigned long operand2_abs_ival;\n\n    if (operand2 < 0) {\n        operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;\n        operand2_is_negative = true;\n    } else {\n        operand2_abs_ival = (unsigned long)operand2;\n        operand2_is_negative = false;\n    }\n\n    Py_ssize_t operand2_digit_count = 0;\n    digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = operand2_abs_ival;\n\n        while (t != 0) {\n            operand2_digit_count += 1;\n            assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));\n\n            operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != operand2_size) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nbool RICH_COMPARE_NE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n\n    return COMPARE_NE_CBOOL_LONG_CLONG(operand1, PyInt_AS_LONG(operand1));\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *COMPARE_NE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a != b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nPyObject *RICH_COMPARE_NE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_NE_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic bool COMPARE_NE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    bool r = a != b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nbool RICH_COMPARE_NE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n\n    return COMPARE_NE_CBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\nstatic PyObject *COMPARE_NE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nPyObject *RICH_COMPARE_NE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_NE_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\nstatic bool COMPARE_NE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    bool r;\n\n    if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {\n        r = true;\n    } else {\n        Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));\n        r = false;\n        while (--i >= 0) {\n            if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {\n                r = true;\n                break;\n            }\n        }\n    }\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nbool RICH_COMPARE_NE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n\n    return COMPARE_NE_CBOOL_LONG_DIGIT(operand1, operand2);\n}\n\nstatic PyObject *COMPARE_NE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a != b;\n\n    // Convert to target type.\n    PyObject *result = BOOL_FROM(r);\n    Py_INCREF(result);\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nPyObject *RICH_COMPARE_NE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_NE_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\nstatic bool COMPARE_NE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    bool r = a != b;\n\n    // Convert to target type.\n    bool result = r;\n\n    return result;\n}\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nbool RICH_COMPARE_NE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n\n    return COMPARE_NE_CBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersConstantsBlob.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Providing access to the constants binary blob.\n *\n * There are multiple ways, the constants binary is accessed, and its\n * definition depends on how that is done.\n *\n * This deals with loading the resource from a DLL under Windows.\n *\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if _NUITKA_EXPERIMENTAL_WRITEABLE_CONSTANTS\n#define CONST_CONSTANT\n#else\n#define CONST_CONSTANT const\n#endif\n\n#if defined(_NUITKA_CONSTANTS_FROM_LINKER)\n// Symbol as provided by the linker, different for C++ and C11 mode.\n#ifdef __cplusplus\nextern \"C\" CONST_CONSTANT unsigned char constant_bin_data[];\n#else\nextern CONST_CONSTANT unsigned char constant_bin_data[0];\n#endif\n\nunsigned char const *constant_bin = &constant_bin_data[0];\n\n#elif defined(_NUITKA_CONSTANTS_FROM_CODE)\nextern CONST_CONSTANT unsigned char constant_bin_data[];\n\nunsigned char const *constant_bin = &constant_bin_data[0];\n#else\n// Symbol to be assigned locally.\nunsigned char const *constant_bin = NULL;\n#endif\n\n#if defined(_NUITKA_CONSTANTS_FROM_INCBIN)\nextern unsigned const char *getConstantsBlobData(void);\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *int_cache = NULL;\n#endif\n\nstatic PyObject *long_cache = NULL;\n\nstatic PyObject *float_cache = NULL;\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *bytes_cache = NULL;\n#endif\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *unicode_cache = NULL;\n#endif\n\nstatic PyObject *tuple_cache = NULL;\n\nstatic PyObject *list_cache = NULL;\n\nstatic PyObject *dict_cache = NULL;\n\nstatic PyObject *set_cache = NULL;\n\nstatic PyObject *frozenset_cache = NULL;\n\n// Use our own non-random hash for some of the things to be fast. This is inspired\n// from the original Python2 hash func, but we are mostly using it on pointer values\nstatic Py_hash_t Nuitka_FastHashBytes(const void *value, Py_ssize_t size) {\n    if (unlikely(size == 0)) {\n        return 0;\n    }\n\n    unsigned char *w = (unsigned char *)value;\n    long x = *w << 7;\n\n    while (--size >= 0) {\n        x = (1000003 * x) ^ *w++;\n    }\n\n    x ^= size;\n\n    // The value -1 is reserved for errors.\n    if (x == -1) {\n        x = -2;\n    }\n\n    return x;\n}\n\nstatic Py_hash_t our_list_hash(PyListObject *list) {\n    return Nuitka_FastHashBytes(&list->ob_item[0], Py_SIZE(list) * sizeof(PyObject *));\n}\n\nstatic PyObject *our_list_richcompare(PyListObject *list1, PyListObject *list2, int op) {\n    assert(op == Py_EQ);\n\n    PyObject *result;\n\n    if (list1 == list2) {\n        result = Py_True;\n    } else if (Py_SIZE(list1) != Py_SIZE(list2)) {\n        result = Py_False;\n    } else if (memcmp(&list1->ob_item[0], &list2->ob_item[0], Py_SIZE(list1) * sizeof(PyObject *)) == 0) {\n        result = Py_True;\n    } else {\n        result = Py_False;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic Py_hash_t our_tuple_hash(PyTupleObject *tuple) {\n    return Nuitka_FastHashBytes(&tuple->ob_item[0], Py_SIZE(tuple) * sizeof(PyObject *));\n}\n\nstatic PyObject *our_tuple_richcompare(PyTupleObject *tuple1, PyTupleObject *tuple2, int op) {\n    assert(op == Py_EQ);\n\n    PyObject *result;\n\n    if (tuple1 == tuple2) {\n        result = Py_True;\n    } else if (Py_SIZE(tuple1) != Py_SIZE(tuple2)) {\n        result = Py_False;\n    } else if (memcmp(&tuple1->ob_item[0], &tuple2->ob_item[0], Py_SIZE(tuple1) * sizeof(PyObject *)) == 0) {\n        result = Py_True;\n    } else {\n        result = Py_False;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic Py_hash_t our_set_hash(PyObject *set) {\n    Py_hash_t result = 0;\n    PyObject *key;\n    Py_ssize_t pos = 0;\n\n#if PYTHON_VERSION < 0x300\n    // Same sized set, simply check if values are identical. Other reductions should\n    // make it identical, or else this won't have the effect intended.\n    while (_PySet_Next(set, &pos, &key)) {\n        result *= 1000003;\n        result ^= Nuitka_FastHashBytes(&key, sizeof(PyObject *));\n    }\n#else\n    Py_hash_t unused;\n\n    while (_PySet_NextEntry(set, &pos, &key, &unused)) {\n        result *= 1000003;\n        result ^= Nuitka_FastHashBytes(&key, sizeof(PyObject *));\n    }\n#endif\n\n    return result;\n}\n\nstatic PyObject *our_set_richcompare(PyObject *set1, PyObject *set2, int op) {\n    assert(op == Py_EQ);\n\n    PyObject *result;\n\n    Py_ssize_t pos1 = 0, pos2 = 0;\n    PyObject *key1, *key2;\n\n    if (Py_SIZE(set1) != Py_SIZE(set2)) {\n        result = Py_False;\n    } else {\n        result = Py_True;\n\n#if PYTHON_VERSION < 0x300\n        // Same sized set, simply check if values are identical. Other reductions should\n        // make it identical, or else this won't have the effect intended.\n        while (_PySet_Next(set1, &pos1, &key1)) {\n            {\n                NUITKA_MAY_BE_UNUSED int res = _PySet_Next(set2, &pos2, &key2);\n                assert(res != 0);\n            }\n\n            if (key1 != key2) {\n                result = Py_False;\n                break;\n            }\n        }\n#else\n        Py_hash_t unused1, unused2;\n\n        // Same sized dictionary, simply check if values are identical. Other reductions should\n        // make it identical, or else this won't have the effect intended.\n        while (_PySet_NextEntry(set1, &pos1, &key1, &unused1)) {\n            {\n                NUITKA_MAY_BE_UNUSED int res = _PySet_NextEntry(set2, &pos2, &key2, &unused2);\n                assert(res != 0);\n            }\n\n            if (key1 != key2) {\n                result = Py_False;\n                break;\n            }\n        }\n#endif\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyObject *our_float_richcompare(PyFloatObject *a, PyFloatObject *b, int op) {\n    assert(op == Py_EQ);\n\n    PyObject *result;\n\n    // Avoid the C math when comparing, for it makes too many values equal or unequal.\n    if (memcmp(&a->ob_fval, &b->ob_fval, sizeof(b->ob_fval)) == 0) {\n        result = Py_True;\n    } else {\n        result = Py_False;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic Py_hash_t our_dict_hash(PyObject *dict) {\n    Py_hash_t result = 0;\n\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(dict, &pos, &key, &value)) {\n        result *= 1000003;\n        result ^= Nuitka_FastHashBytes(&key, sizeof(PyObject *));\n        result *= 1000003;\n        result ^= Nuitka_FastHashBytes(&value, sizeof(PyObject *));\n    }\n\n    return result;\n}\n\nstatic PyObject *our_dict_richcompare(PyObject *a, PyObject *b, int op) {\n    PyObject *result;\n\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n        result = Py_False;\n    } else {\n        result = Py_True;\n\n        Py_ssize_t pos1 = 0, pos2 = 0;\n        PyObject *key1, *value1;\n        PyObject *key2, *value2;\n\n        // Same sized dictionary, simply check if key and values are identical.\n        // Other reductions should make it identical, or else this won't have the\n        // effect intended.\n        while (Nuitka_DictNext(a, &pos1, &key1, &value1)) {\n            {\n                NUITKA_MAY_BE_UNUSED int res = Nuitka_DictNext(b, &pos2, &key2, &value2);\n                assert(res != 0);\n            }\n\n            if (key1 != key2 || value1 != value2) {\n                result = Py_False;\n                break;\n            }\n        }\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\n// For creation of small long singleton long values as required by Python3.\n#if PYTHON_VERSION < 0x3b0\n#if PYTHON_VERSION >= 0x390\nPyObject **Nuitka_Long_SmallValues;\n#elif PYTHON_VERSION >= 0x300\nPyObject *Nuitka_Long_SmallValues[NUITKA_STATIC_SMALLINT_VALUE_MAX - NUITKA_STATIC_SMALLINT_VALUE_MIN + 1];\n#endif\n#endif\n\nstatic void initCaches(void) {\n    static bool init_done = false;\n    if (init_done == true) {\n        return;\n    }\n\n#if PYTHON_VERSION < 0x300\n    int_cache = PyDict_New();\n#endif\n\n    long_cache = PyDict_New();\n\n    float_cache = PyDict_New();\n\n#if PYTHON_VERSION >= 0x300\n    bytes_cache = PyDict_New();\n#endif\n\n#if PYTHON_VERSION < 0x300\n    unicode_cache = PyDict_New();\n#endif\n\n    tuple_cache = PyDict_New();\n\n    list_cache = PyDict_New();\n\n    dict_cache = PyDict_New();\n\n    set_cache = PyDict_New();\n\n    frozenset_cache = PyDict_New();\n\n#if PYTHON_VERSION < 0x3b0\n#if PYTHON_VERSION >= 0x390\n    // On Python3.9+ these are exposed in the interpreter.\n    Nuitka_Long_SmallValues = (PyObject **)_PyInterpreterState_GET()->small_ints;\n#elif PYTHON_VERSION >= 0x300\n    for (long i = NUITKA_STATIC_SMALLINT_VALUE_MIN; i < NUITKA_STATIC_SMALLINT_VALUE_MAX; i++) {\n        PyObject *value = PyLong_FromLong(i);\n        Nuitka_Long_SmallValues[NUITKA_TO_SMALL_VALUE_OFFSET(i)] = value;\n    }\n#endif\n#endif\n\n    init_done = true;\n}\n\nstatic void insertToDictCache(PyObject *dict, PyObject **value) {\n    PyObject *item = PyDict_GetItem(dict, *value);\n\n    if (item != NULL) {\n        *value = item;\n    } else {\n        PyDict_SetItem(dict, *value, *value);\n    }\n}\n\nstatic void insertToDictCacheForcedHash(PyObject *dict, PyObject **value, hashfunc tp_hash,\n                                        richcmpfunc tp_richcompare) {\n    hashfunc old_hash = Py_TYPE(*value)->tp_hash;\n    richcmpfunc old_richcmp = Py_TYPE(*value)->tp_richcompare;\n\n    // Hash is optional, e.g. for floats we can spare us doing our own hash,\n    // but we do equality\n    if (tp_hash != NULL) {\n        Py_TYPE(*value)->tp_hash = tp_hash;\n    }\n    Py_TYPE(*value)->tp_richcompare = tp_richcompare;\n\n    insertToDictCache(dict, value);\n\n    Py_TYPE(*value)->tp_hash = old_hash;\n    Py_TYPE(*value)->tp_richcompare = old_richcmp;\n}\n\nstatic uint16_t unpackValueUint16(unsigned char const **data) {\n    uint16_t value;\n\n    memcpy(&value, *data, sizeof(value));\n\n    assert(sizeof(value) == 2);\n\n    *data += sizeof(value);\n\n    return value;\n}\n\nstatic uint32_t unpackValueUint32(unsigned char const **data) {\n    uint32_t value;\n\n    memcpy(&value, *data, sizeof(value));\n\n    assert(sizeof(value) == 4);\n\n    *data += sizeof(value);\n\n    return value;\n}\n\nstatic int unpackValueInt(unsigned char const **data) {\n    int size;\n\n    memcpy(&size, *data, sizeof(size));\n    *data += sizeof(size);\n\n    return size;\n}\n\nstatic long unpackValueLong(unsigned char const **data) {\n    long size;\n\n    memcpy(&size, *data, sizeof(size));\n    *data += sizeof(size);\n\n    return size;\n}\n\nstatic long long unpackValueLongLong(unsigned char const **data) {\n    long long size;\n\n    memcpy(&size, *data, sizeof(size));\n    *data += sizeof(size);\n\n    return size;\n}\n\nstatic unsigned long long unpackValueUnsignedLongLong(unsigned char const **data) {\n    unsigned long long size;\n\n    memcpy(&size, *data, sizeof(size));\n    *data += sizeof(size);\n\n    return size;\n}\n\nstatic double unpackValueFloat(unsigned char const **data) {\n    double size;\n\n    memcpy(&size, *data, sizeof(size));\n    *data += sizeof(size);\n\n    return size;\n}\n\nstatic unsigned char const *_unpackValueCString(unsigned char const *data) {\n    while (*(data++) != 0) {\n    }\n\n    return data;\n}\n\n// Decoding Variable-length quantity values\nstatic uint64_t _unpackVariableLength(unsigned char const **data) {\n    uint64_t result = 0;\n    uint64_t factor = 1;\n\n    while (1) {\n        unsigned char value = **data;\n        *data += 1;\n\n        result += (value & 127) * factor;\n\n        if (value < 128) {\n            break;\n        }\n\n        factor <<= 7;\n    }\n\n    return result;\n}\n\nstatic PyObject *_unpackAnonValue(unsigned char anon_index) {\n    switch (anon_index) {\n    case 0:\n        return (PyObject *)Py_TYPE(Py_None);\n    case 1:\n        return (PyObject *)&PyEllipsis_Type;\n    case 2:\n        return (PyObject *)Py_TYPE(Py_NotImplemented);\n    case 3:\n        return (PyObject *)&PyFunction_Type;\n    case 4:\n        return (PyObject *)&PyGen_Type;\n    case 5:\n        return (PyObject *)&PyCFunction_Type;\n    case 6:\n        return (PyObject *)&PyCode_Type;\n    case 7:\n        return (PyObject *)&PyModule_Type;\n\n#if PYTHON_VERSION < 0x300\n    case 8:\n        return (PyObject *)&PyFile_Type;\n    case 9:\n        return (PyObject *)&PyClass_Type;\n    case 10:\n        return (PyObject *)&PyInstance_Type;\n    case 11:\n        return (PyObject *)&PyMethod_Type;\n#endif\n\n    default:\n        PRINT_FORMAT(\"Missing anon value for %d\\n\", (int)anon_index);\n        NUITKA_CANNOT_GET_HERE(\"Corrupt constants blob\");\n    }\n}\n\nPyObject *_unpackSpecialValue(unsigned char special_index) {\n    switch (special_index) {\n    case 0:\n        return PyObject_GetAttrString((PyObject *)builtin_module, \"Ellipsis\");\n    case 1:\n        return PyObject_GetAttrString((PyObject *)builtin_module, \"NotImplemented\");\n    case 2:\n        return Py_SysVersionInfo;\n    default:\n        PRINT_FORMAT(\"Missing special value for %d\\n\", (int)special_index);\n        NUITKA_CANNOT_GET_HERE(\"Corrupt constants blob\");\n    }\n}\n\nstatic unsigned char const *_unpackBlobConstants(PyThreadState *tstate, PyObject **output, unsigned char const *data,\n                                                 int count) {\n\n    for (int _i = 0; _i < count; _i++) {\n        // Make sure we discover failures to assign.\n        *output = NULL;\n        bool is_object;\n\n        char c = *((char const *)data++);\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        unsigned char const *data_old = data;\n        printf(\"Type %c for %d of %d:\\n\", c, _i, count);\n#endif\n        switch (c) {\n\n        case 'p': {\n            assert(_i > 0);\n\n            *output = *(output - 1);\n            is_object = true;\n\n            break;\n        }\n        case 'T': {\n            int size = (int)_unpackVariableLength(&data);\n\n            PyObject *t = PyTuple_New(size);\n\n            if (size > 0) {\n                data = _unpackBlobConstants(tstate, &PyTuple_GET_ITEM(t, 0), data, size);\n            }\n\n            insertToDictCacheForcedHash(tuple_cache, &t, (hashfunc)our_tuple_hash, (richcmpfunc)our_tuple_richcompare);\n\n            *output = t;\n            is_object = true;\n\n            break;\n        }\n        case 'L': {\n            int size = (int)_unpackVariableLength(&data);\n\n            PyObject *l = PyList_New(size);\n\n            if (size > 0) {\n                data = _unpackBlobConstants(tstate, &PyList_GET_ITEM(l, 0), data, size);\n            }\n\n            insertToDictCacheForcedHash(list_cache, &l, (hashfunc)our_list_hash, (richcmpfunc)our_list_richcompare);\n\n            *output = l;\n            is_object = true;\n\n            break;\n        }\n        case 'D': {\n            int size = (int)_unpackVariableLength(&data);\n\n            PyObject *d = _PyDict_NewPresized(size);\n\n            if (size > 0) {\n                NUITKA_DYNAMIC_ARRAY_DECL(keys, PyObject *, size);\n                NUITKA_DYNAMIC_ARRAY_DECL(values, PyObject *, size);\n\n                data = _unpackBlobConstants(tstate, &keys[0], data, size);\n                data = _unpackBlobConstants(tstate, &values[0], data, size);\n\n                for (int i = 0; i < size; i++) {\n                    PyDict_SetItem(d, keys[i], values[i]);\n                }\n            }\n\n            insertToDictCacheForcedHash(dict_cache, &d, (hashfunc)our_dict_hash, (richcmpfunc)our_dict_richcompare);\n\n            *output = d;\n            is_object = true;\n\n            break;\n        }\n        case 'P':\n        case 'S': {\n            int size = (int)_unpackVariableLength(&data);\n\n            PyObject *s;\n\n            if (c == 'S') {\n                s = PySet_New(NULL);\n            } else {\n                if (size == 0) {\n                    // Get at the frozenset singleton of CPython and use it too. Some things\n                    // rely on it being a singleton across the board.\n                    static PyObject *empty_frozenset = NULL;\n\n                    if (empty_frozenset == NULL) {\n                        empty_frozenset = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, (PyObject *)&PyFrozenSet_Type,\n                                                                        Nuitka_Bytes_FromStringAndSize(\"\", 0));\n                    }\n\n                    s = empty_frozenset;\n                } else {\n                    s = PyFrozenSet_New(NULL);\n                }\n            }\n\n            if (size > 0) {\n                NUITKA_DYNAMIC_ARRAY_DECL(values, PyObject *, size);\n\n                data = _unpackBlobConstants(tstate, &values[0], data, size);\n\n                for (int i = 0; i < size; i++) {\n                    PySet_Add(s, values[i]);\n                }\n            }\n\n            // sets are cached globally too.\n            if (c == 'S') {\n                insertToDictCacheForcedHash(set_cache, &s, (hashfunc)our_set_hash, (richcmpfunc)our_set_richcompare);\n            } else {\n                insertToDictCacheForcedHash(frozenset_cache, &s, (hashfunc)our_set_hash,\n                                            (richcmpfunc)our_set_richcompare);\n            }\n\n            *output = s;\n            is_object = true;\n\n            break;\n        }\n#if PYTHON_VERSION < 0x300\n        case 'i': {\n            // TODO: Use fixed sizes for small values, e.g. byte sized.\n            long value = unpackValueLong(&data);\n\n            PyObject *i = PyInt_FromLong(value);\n\n            insertToDictCache(int_cache, &i);\n\n            *output = i;\n            is_object = true;\n\n            break;\n        }\n#endif\n        case 'l': {\n            // TODO: Use fixed sizes for small values, e.g. byte, word sized.\n            long value = unpackValueLong(&data);\n\n            PyObject *l = Nuitka_LongFromCLong(value);\n\n            // Avoid the long cache, won't do anything useful for small ints\n#if PYTHON_VERSION >= 0x300\n            if (value < NUITKA_STATIC_SMALLINT_VALUE_MIN || value >= NUITKA_STATIC_SMALLINT_VALUE_MAX)\n#endif\n            {\n                insertToDictCache(long_cache, &l);\n            }\n\n            *output = l;\n            is_object = true;\n\n            break;\n        }\n        case 'q': {\n            long long value = unpackValueLongLong(&data);\n\n            PyObject *l = PyLong_FromLongLong(value);\n\n            insertToDictCache(long_cache, &l);\n\n            *output = l;\n            is_object = true;\n\n            break;\n        }\n        case 'g': {\n            PyObject *result = PyLong_FromLong(0);\n\n            unsigned char sign = *data++;\n            int size = unpackValueInt(&data);\n\n            PyObject *shift = PyLong_FromLong(8 * sizeof(unsigned long long));\n\n            for (int i = 0; i < size; i++) {\n                result = PyNumber_InPlaceLshift(result, shift);\n\n                unsigned long long value = unpackValueUnsignedLongLong(&data);\n                PyObject *part = PyLong_FromUnsignedLongLong(value);\n                result = PyNumber_InPlaceAdd(result, part);\n                Py_DECREF(part);\n            }\n\n            Py_DECREF(shift);\n\n            if (sign == '-') {\n                // TODO: There is a negate function\n                PyObject *neg = PyLong_FromLong(-1);\n                result = PyNumber_InPlaceMultiply(result, neg);\n                Py_DECREF(neg);\n            }\n\n            insertToDictCache(long_cache, &result);\n\n            *output = result;\n            is_object = true;\n\n            break;\n        }\n        case 'f': {\n            double value = unpackValueFloat(&data);\n\n            PyObject *f = PyFloat_FromDouble(value);\n\n            // Floats are cached globally too.\n            insertToDictCacheForcedHash(float_cache, &f, NULL, (richcmpfunc)our_float_richcompare);\n\n            *output = f;\n            is_object = true;\n\n            break;\n        }\n        case 'j': {\n            double real = unpackValueFloat(&data);\n            double imag = unpackValueFloat(&data);\n\n            *output = PyComplex_FromDoubles(real, imag);\n            is_object = true;\n\n            break;\n        }\n        case 'J': {\n            PyObject *parts[2];\n\n            // Complex via float is done for ones that are 0, nan, float.\n            data = _unpackBlobConstants(tstate, &parts[0], data, 2);\n\n            *output = BUILTIN_COMPLEX2(tstate, parts[0], parts[1]);\n            is_object = true;\n\n            break;\n        }\n#if PYTHON_VERSION < 0x300\n        case 'a':\n        case 'c': {\n            // Python2 str, potentially attribute, zero terminated.\n            size_t size = strlen((const char *)data);\n\n            PyObject *s = PyString_FromStringAndSize((const char *)data, size);\n            CHECK_OBJECT(s);\n\n            data += size + 1;\n\n            if (c == 'a') {\n                PyString_InternInPlace(&s);\n            }\n\n            *output = s;\n            is_object = true;\n\n            break;\n        }\n#else\n        case 'c': {\n            // Python3 bytes, zero terminated.\n            size_t size = strlen((const char *)data);\n\n            PyObject *b = Nuitka_Bytes_FromStringAndSize((const char *)data, size);\n            CHECK_OBJECT(b);\n\n            data += size + 1;\n\n            // Empty bytes value is here as well.\n            if (size > 1) {\n                insertToDictCache(bytes_cache, &b);\n            }\n\n            *output = b;\n            is_object = true;\n\n            break;\n        }\n#endif\n        case 'd': {\n            // Python2 str length 1 str, potentially attribute, or Python3 single byte\n\n#if PYTHON_VERSION < 0x300\n            PyObject *s = PyString_FromStringAndSize((const char *)data, 1);\n            data += 1;\n            *output = s;\n#else\n            PyObject *b = Nuitka_Bytes_FromStringAndSize((const char *)data, 1);\n            data += 1;\n            *output = b;\n#endif\n\n            is_object = true;\n\n            break;\n        }\n        case 'w': {\n            // Python2 unicode, Python3 str length 1, potentially attribute in Python3\n\n            PyObject *u = PyUnicode_FromStringAndSize((const char *)data, 1);\n            data += 1;\n\n#if PYTHON_VERSION >= 0x300\n            PyUnicode_InternInPlace(&u);\n#else\n            insertToDictCache(unicode_cache, &u);\n#endif\n\n            *output = u;\n            is_object = true;\n\n            break;\n        }\n        case 'b': {\n            // Python2 str or Python3 bytes, length indicated.\n            int size = (int)_unpackVariableLength(&data);\n            assert(size > 1);\n\n            PyObject *b = Nuitka_Bytes_FromStringAndSize((const char *)data, size);\n            CHECK_OBJECT(b);\n\n            data += size;\n\n#if PYTHON_VERSION >= 0x300\n            insertToDictCache(bytes_cache, &b);\n#endif\n\n            *output = b;\n            is_object = true;\n\n            break;\n        }\n\n        case 'B': {\n            int size = (int)_unpackVariableLength(&data);\n\n            PyObject *b = PyByteArray_FromStringAndSize((const char *)data, size);\n            data += size;\n\n            *output = b;\n            is_object = true;\n\n            break;\n        }\n#if PYTHON_VERSION >= 0x300\n        case 'a': // Python3 attributes\n#endif\n        case 'u': { // Python2 unicode, Python3 str, zero terminated.\n            size_t size = strlen((const char *)data);\n#if PYTHON_VERSION < 0x300\n            PyObject *u = PyUnicode_FromStringAndSize((const char *)data, size);\n#else\n            PyObject *u = PyUnicode_DecodeUTF8((const char *)data, size, \"surrogatepass\");\n#endif\n            data += size + 1;\n\n#if PYTHON_VERSION >= 0x300\n            if (c == 'a') {\n                PyUnicode_InternInPlace(&u);\n            }\n#else\n            insertToDictCache(unicode_cache, &u);\n#endif\n\n            *output = u;\n            is_object = true;\n\n            break;\n        }\n        case 'v': {\n            int size = (int)_unpackVariableLength(&data);\n\n#if PYTHON_VERSION < 0x300\n            PyObject *u = PyUnicode_FromStringAndSize((const char *)data, size);\n#else\n            PyObject *u = PyUnicode_DecodeUTF8((const char *)data, size, \"surrogatepass\");\n#endif\n            data += size;\n\n#if PYTHON_VERSION < 0x300\n            insertToDictCache(unicode_cache, &u);\n#endif\n\n            *output = u;\n            is_object = true;\n\n            break;\n        }\n        case 'n': {\n            *output = Py_None;\n            is_object = true;\n\n            break;\n        }\n        case 't': {\n            *output = Py_True;\n            is_object = true;\n\n            break;\n        }\n        case 'F': {\n            *output = Py_False;\n            is_object = true;\n\n            break;\n        }\n        case ':': {\n            // Slice object\n            PyObject *items[3];\n            data = _unpackBlobConstants(tstate, &items[0], data, 3);\n\n            PyObject *s = MAKE_SLICE_OBJECT3(items[0], items[1], items[2]);\n\n            *output = s;\n            is_object = true;\n\n            break;\n        }\n        case ';': {\n            // (x)range objects\n#if PYTHON_VERSION < 0x300\n            long start = unpackValueLong(&data);\n            long stop = unpackValueLong(&data);\n            long step = unpackValueLong(&data);\n\n            PyObject *s = MAKE_XRANGE(tstate, start, stop, step);\n#else\n            PyObject *items[3];\n            data = _unpackBlobConstants(tstate, &items[0], data, 3);\n\n            PyObject *s = BUILTIN_XRANGE3(tstate, items[0], items[1], items[2]);\n#endif\n            *output = s;\n            is_object = true;\n\n            break;\n        }\n        case 'M': {\n            // Anonymous builtin by table index value.\n            unsigned char anon_index = *data++;\n\n            *output = _unpackAnonValue(anon_index);\n            is_object = true;\n\n            break;\n        }\n        case 'Q': {\n            // Anonymous builtin by table index value.\n            unsigned char special_index = *data++;\n\n            *output = _unpackSpecialValue(special_index);\n            is_object = true;\n\n            break;\n        }\n        case 'O': {\n            // Builtin by name. TODO: Define number table shared by C and Python\n            // serialization to avoid using strings here.\n            char const *builtin_name = (char const *)data;\n            data = _unpackValueCString(data);\n\n            *output = PyObject_GetAttrString((PyObject *)builtin_module, builtin_name);\n            is_object = true;\n\n            break;\n        }\n        case 'E': {\n            // Builtin exception by name. TODO: Define number table shared by C and Python\n            // serialization to avoid using strings here.\n            char const *builtin_exception_name = (char const *)data;\n            data = _unpackValueCString(data);\n\n            *output = PyObject_GetAttrString((PyObject *)builtin_module, builtin_exception_name);\n            is_object = true;\n\n            break;\n        }\n        case 'Z': {\n            unsigned char v = *data++;\n\n            PyObject *z = NULL;\n\n            switch (v) {\n            case 0: {\n                static PyObject *_const_float_0_0 = NULL;\n\n                if (_const_float_0_0 == NULL) {\n                    _const_float_0_0 = PyFloat_FromDouble(0.0);\n                }\n                z = _const_float_0_0;\n\n                break;\n            }\n            case 1: {\n                static PyObject *_const_float_minus_0_0 = NULL;\n\n                if (_const_float_minus_0_0 == NULL) {\n                    _const_float_minus_0_0 = PyFloat_FromDouble(0.0);\n\n                    // Older Python3 has variable signs from C, so be explicit about it.\n                    PyFloat_SET_DOUBLE(_const_float_minus_0_0,\n                                       copysign(PyFloat_AS_DOUBLE(_const_float_minus_0_0), -1.0));\n                }\n                z = _const_float_minus_0_0;\n\n                break;\n            }\n\n            case 2: {\n                static PyObject *_const_float_plus_nan = NULL;\n\n                if (_const_float_plus_nan == NULL) {\n                    _const_float_plus_nan = PyFloat_FromDouble(Py_NAN);\n\n                    // Older Python3 has variable signs for NaN from C, so be explicit about it.\n                    PyFloat_SET_DOUBLE(_const_float_plus_nan, copysign(PyFloat_AS_DOUBLE(_const_float_plus_nan), 1.0));\n                }\n                z = _const_float_plus_nan;\n\n                break;\n            }\n            case 3: {\n                static PyObject *_const_float_minus_nan = NULL;\n\n                if (_const_float_minus_nan == NULL) {\n                    _const_float_minus_nan = PyFloat_FromDouble(Py_NAN);\n\n                    // Older Python3 has variable signs for NaN from C, so be explicit about it.\n                    PyFloat_SET_DOUBLE(_const_float_minus_nan,\n                                       copysign(PyFloat_AS_DOUBLE(_const_float_minus_nan), -1.0));\n                }\n                z = _const_float_minus_nan;\n\n                break;\n            }\n            case 4: {\n                static PyObject *_const_float_plus_inf = NULL;\n\n                if (_const_float_plus_inf == NULL) {\n                    _const_float_plus_inf = PyFloat_FromDouble(Py_HUGE_VAL);\n\n                    // Older Python3 has variable signs from C, so be explicit about it.\n                    PyFloat_SET_DOUBLE(_const_float_plus_inf, copysign(PyFloat_AS_DOUBLE(_const_float_plus_inf), 1.0));\n                }\n                z = _const_float_plus_inf;\n\n                break;\n            }\n            case 5: {\n                static PyObject *_const_float_minus_inf = NULL;\n\n                if (_const_float_minus_inf == NULL) {\n                    _const_float_minus_inf = PyFloat_FromDouble(Py_HUGE_VAL);\n\n                    // Older Python3 has variable signs from C, so be explicit about it.\n                    PyFloat_SET_DOUBLE(_const_float_minus_inf,\n                                       copysign(PyFloat_AS_DOUBLE(_const_float_minus_inf), -1.0));\n                }\n                z = _const_float_minus_inf;\n\n                break;\n            }\n            default: {\n                PRINT_FORMAT(\"Missing decoding for %d\\n\", (int)c);\n                NUITKA_CANNOT_GET_HERE(\"Corrupt constants blob\");\n            }\n            }\n\n            // Floats are cached globally too.\n            insertToDictCacheForcedHash(float_cache, &z, NULL, (richcmpfunc)our_float_richcompare);\n\n            *output = z;\n            is_object = true;\n\n            break;\n        }\n        case 'X': {\n            // Blob data pointer, user knowns size.\n            int size = unpackValueInt(&data);\n\n            *output = (PyObject *)data;\n            is_object = false;\n\n            data += size;\n\n            break;\n        }\n#if PYTHON_VERSION >= 0x390\n        case 'G': {\n            // GenericAlias object\n            PyObject *items[2];\n            data = _unpackBlobConstants(tstate, &items[0], data, 2);\n\n            PyObject *g = Py_GenericAlias(items[0], items[1]);\n\n            // TODO: Maybe deduplicate.\n            *output = g;\n\n            is_object = true;\n            break;\n        }\n#endif\n#if PYTHON_VERSION >= 0x3a0\n        case 'H': {\n            // UnionType object\n            PyObject *args;\n            data = _unpackBlobConstants(tstate, &args, data, 1);\n\n            PyObject *union_type = MAKE_UNION_TYPE(args);\n\n            // TODO: Maybe deduplicate.\n            *output = union_type;\n\n            is_object = true;\n            break;\n        }\n#endif\n        case '.': {\n            PRINT_FORMAT(\"Missing values %d\\n\", count - _i);\n            NUITKA_CANNOT_GET_HERE(\"Corrupt constants blob\");\n        }\n        default:\n            PRINT_FORMAT(\"Missing decoding for %d\\n\", (int)c);\n            NUITKA_CANNOT_GET_HERE(\"Corrupt constants blob\");\n        }\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        printf(\"Size for %c was %d\\n\", c, data - data_old);\n#endif\n\n        // Discourage in-place operations from modifying these. These\n        // might be put into containers, therefore take 2 refs to be\n        // accounting for the container too.\n        if (is_object == true) {\n            CHECK_OBJECT(*output);\n\n            Py_INCREF(*output);\n            Py_INCREF(*output);\n        }\n\n        // PRINT_ITEM(*output);\n        // PRINT_NEW_LINE();\n\n        output += 1;\n    }\n\n    return data;\n}\n\nstatic void unpackBlobConstants(PyThreadState *tstate, PyObject **output, unsigned char const *data) {\n    int count = (int)unpackValueUint16(&data);\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n    printf(\"unpackBlobConstants count %d\\n\", count);\n#endif\n    _unpackBlobConstants(tstate, output, data, count);\n}\n\n#if _NUITKA_CONSTANTS_FROM_MACOS_SECTION\n\n#include <mach-o/getsect.h>\n#include <mach-o/ldsyms.h>\n\n#ifndef _NUITKA_EXE\nstatic int findMacOSDllImageId(void) {\n    Dl_info where;\n    int res = dladdr((void *)findMacOSDllImageId, &where);\n    assert(res != 0);\n\n    char const *dll_filename = where.dli_fname;\n\n    unsigned long image_count = _dyld_image_count();\n\n    for (int i = 0; i < image_count; i++) {\n        // Ignore entries without a header.\n        struct mach_header const *header = _dyld_get_image_header(i);\n        if (header == NULL) {\n            continue;\n        }\n\n        if (strcmp(dll_filename, _dyld_get_image_name(i)) == 0) {\n            return i;\n        }\n    }\n\n    return -1;\n}\n#endif\n\nunsigned char *findMacOSBinarySection(void) {\n#ifdef _NUITKA_EXE\n    const struct mach_header *header = &_mh_execute_header;\n#else\n    int image_id = findMacOSDllImageId();\n    assert(image_id != -1);\n\n    const struct mach_header *header = _dyld_get_image_header(image_id);\n#endif\n\n    unsigned long *size;\n    return getsectiondata(header, \"constants\", \"constants\", &size);\n}\n\n#endif\n\nvoid loadConstantsBlob(PyThreadState *tstate, PyObject **output, char const *name) {\n    static bool init_done = false;\n\n    if (init_done == false) {\n        NUITKA_PRINT_TIMING(\"loadConstantsBlob(): One time init.\");\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        printf(\"loadConstantsBlob '%s' one time init\\n\", name);\n#endif\n\n#if defined(_NUITKA_CONSTANTS_FROM_INCBIN)\n        constant_bin = getConstantsBlobData();\n#elif defined(_NUITKA_CONSTANTS_FROM_RESOURCE)\n#ifdef _NUITKA_EXE\n        // Using NULL as this indicates running program.\n        HMODULE handle = NULL;\n#else\n        HMODULE handle = getDllModuleHandle();\n#endif\n\n        constant_bin = (const unsigned char *)LockResource(\n            LoadResource(handle, FindResource(handle, MAKEINTRESOURCE(3), RT_RCDATA)));\n\n        assert(constant_bin);\n#elif _NUITKA_CONSTANTS_FROM_MACOS_SECTION\n        constant_bin = findMacOSBinarySection();\n\n        assert(constant_bin);\n#endif\n        NUITKA_PRINT_TIMING(\"loadConstantsBlob(): Found blob, decoding now.\");\n        DECODE(constant_bin);\n\n        NUITKA_PRINT_TIMING(\"loadConstantsBlob(): CRC32 that blob for correctness.\");\n        uint32_t hash = unpackValueUint32(&constant_bin);\n        uint32_t size = unpackValueUint32(&constant_bin);\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        printf(\"loadConstantsBlob '%u' hash value\\n\", hash);\n        printf(\"loadConstantsBlob '%u' size value\\n\", size);\n#endif\n        if (calcCRC32(constant_bin, size) != hash) {\n            puts(\"Error, corrupted constants object\");\n            abort();\n        }\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        printf(\"Checked CRC32 to match hash %u size %u\\n\", hash, size);\n#endif\n\n        NUITKA_PRINT_TIMING(\"loadConstantsBlob(): One time init complete.\");\n\n        init_done = true;\n    }\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n    printf(\"Loading blob named '%s'\\n\", name);\n#endif\n    // Python 3.9 or higher cannot create dictionary before calling init so avoid it.\n    if (strcmp(name, \".bytecode\") != 0) {\n        initCaches();\n    }\n\n    unsigned char const *w = constant_bin;\n\n    for (;;) {\n        int match = strcmp(name, (char const *)w);\n        w += strlen((char const *)w) + 1;\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n        printf(\"offset of blob size %d\\n\", w - constant_bin);\n#endif\n\n        uint32_t size = unpackValueUint32(&w);\n\n        if (match == 0) {\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CONSTANTS\n            printf(\"Loading blob named '%s' with size %d\\n\", name, size);\n#endif\n            break;\n        }\n\n        // Skip other module data.\n        w += size;\n    }\n\n    unpackBlobConstants(tstate, output, w);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersDeepcopy.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/**\n * This is responsible for deep copy and hashing of constants.\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x390\ntypedef struct {\n    PyObject_HEAD PyObject *origin;\n    PyObject *args;\n    PyObject *parameters;\n} GenericAliasObject;\n#endif\n\ntypedef PyObject *(*copy_func)(PyThreadState *tstate, PyObject *);\n\nstatic PyObject *DEEP_COPY_ITEM(PyThreadState *tstate, PyObject *value, PyTypeObject **type, copy_func *copy_function);\n\nPyObject *DEEP_COPY_LIST(PyThreadState *tstate, PyObject *value) {\n    assert(PyList_CheckExact(value));\n\n    Py_ssize_t n = PyList_GET_SIZE(value);\n    PyObject *result = MAKE_LIST_EMPTY(n);\n\n    PyTypeObject *type = NULL;\n    copy_func copy_function = NULL;\n\n    for (Py_ssize_t i = 0; i < n; i++) {\n        PyObject *item = PyList_GET_ITEM(value, i);\n        if (i == 0) {\n            PyList_SET_ITEM(result, i, DEEP_COPY_ITEM(tstate, item, &type, &copy_function));\n        } else {\n            PyObject *new_item;\n\n            if (likely(type == Py_TYPE(item))) {\n                if (copy_function) {\n                    new_item = copy_function(tstate, item);\n                } else {\n                    new_item = item;\n                    Py_INCREF(item);\n                }\n            } else {\n                new_item = DEEP_COPY_ITEM(tstate, item, &type, &copy_function);\n            }\n\n            PyList_SET_ITEM(result, i, new_item);\n        }\n    }\n\n    return result;\n}\n\nPyObject *DEEP_COPY_TUPLE(PyThreadState *tstate, PyObject *value) {\n    assert(PyTuple_CheckExact(value));\n\n    Py_ssize_t n = PyTuple_GET_SIZE(value);\n\n    PyObject *result = MAKE_TUPLE_EMPTY_VAR(n);\n\n    for (Py_ssize_t i = 0; i < n; i++) {\n        PyTuple_SET_ITEM(result, i, DEEP_COPY(tstate, PyTuple_GET_ITEM(value, i)));\n    }\n\n    return result;\n}\n\nstatic PyObject *_DEEP_COPY_SET(PyObject *value) {\n    // Sets cannot contain non-hashable types, so these all must be immutable,\n    // but the set itself might be changed, so we need to copy it.\n    return PySet_New(value);\n}\n\nPyObject *DEEP_COPY_SET(PyThreadState *tstate, PyObject *value) { return _DEEP_COPY_SET(value); }\n\n#if PYTHON_VERSION >= 0x390\nPyObject *DEEP_COPY_GENERICALIAS(PyThreadState *tstate, PyObject *value) {\n    assert(Py_TYPE(value) == &Py_GenericAliasType);\n\n    GenericAliasObject *generic_alias = (GenericAliasObject *)value;\n\n    PyObject *args = DEEP_COPY(tstate, generic_alias->args);\n    PyObject *origin = DEEP_COPY(tstate, generic_alias->origin);\n\n    if (generic_alias->args == args && generic_alias->origin == origin) {\n        Py_INCREF(value);\n        return value;\n    } else {\n        return Py_GenericAlias(origin, args);\n    }\n}\n#endif\n\nstatic PyObject *_deep_copy_dispatch = NULL;\nstatic PyObject *_deep_noop = NULL;\n\nstatic PyObject *Nuitka_CapsuleNew(void *pointer) {\n#if PYTHON_VERSION < 0x300\n    return PyCObject_FromVoidPtr(pointer, NULL);\n#else\n    return PyCapsule_New(pointer, \"\", NULL);\n#endif\n}\n\n#if PYTHON_VERSION >= 0x300\ntypedef struct {\n    PyObject_HEAD void *pointer;\n    const char *name;\n    void *context;\n    PyCapsule_Destructor destructor;\n} Nuitka_PyCapsule;\n\n#define Nuitka_CapsuleGetPointer(capsule) (((Nuitka_PyCapsule *)(capsule))->pointer)\n\n#else\n#define Nuitka_CapsuleGetPointer(capsule) (PyCObject_AsVoidPtr(capsule))\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\nPyTypeObject *Nuitka_PyUnion_Type;\n#endif\n\nstatic PyObject *_makeDeepCopyFunctionCapsule(copy_func func) { return Nuitka_CapsuleNew((void *)func); }\n\nstatic void _initDeepCopy(void) {\n    _deep_copy_dispatch = PyDict_New();\n    _deep_noop = Py_None;\n\n    CHECK_OBJECT(_deep_noop);\n\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyDict_Type, _makeDeepCopyFunctionCapsule(DEEP_COPY_DICT));\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyList_Type, _makeDeepCopyFunctionCapsule(DEEP_COPY_LIST));\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyTuple_Type, _makeDeepCopyFunctionCapsule(DEEP_COPY_TUPLE));\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PySet_Type, _makeDeepCopyFunctionCapsule(DEEP_COPY_SET));\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyByteArray_Type, _makeDeepCopyFunctionCapsule(BYTEARRAY_COPY));\n\n#if PYTHON_VERSION >= 0x390\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&Py_GenericAliasType,\n                   _makeDeepCopyFunctionCapsule(DEEP_COPY_GENERICALIAS));\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\n    {\n        PyObject *args[2] = {(PyObject *)&PyFloat_Type, (PyObject *)&PyTuple_Type};\n        PyObject *args_tuple = MAKE_TUPLE(args, 2);\n        PyObject *union_value = MAKE_UNION_TYPE(args_tuple);\n\n        Nuitka_PyUnion_Type = Py_TYPE(union_value);\n\n        PyDict_SetItem(_deep_copy_dispatch, (PyObject *)Nuitka_PyUnion_Type, _deep_noop);\n\n        Py_DECREF(union_value);\n        Py_DECREF(args_tuple);\n    }\n\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyString_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyInt_Type, _deep_noop);\n#else\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyBytes_Type, _deep_noop);\n#endif\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyUnicode_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyLong_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)Py_TYPE(Py_None), _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyBool_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyFloat_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyRange_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyType_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PySlice_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyComplex_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyCFunction_Type, _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)Py_TYPE(Py_Ellipsis), _deep_noop);\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)Py_TYPE(Py_NotImplemented), _deep_noop);\n\n    // Sets can be changed, but not a frozenset.\n    PyDict_SetItem(_deep_copy_dispatch, (PyObject *)&PyFrozenSet_Type, _deep_noop);\n}\n\nstatic PyObject *DEEP_COPY_ITEM(PyThreadState *tstate, PyObject *value, PyTypeObject **type, copy_func *copy_function) {\n    *type = Py_TYPE(value);\n\n    PyObject *dispatcher = DICT_GET_ITEM0(tstate, _deep_copy_dispatch, (PyObject *)*type);\n\n    if (unlikely(dispatcher == NULL)) {\n        NUITKA_CANNOT_GET_HERE(\"DEEP_COPY encountered unknown type\");\n    }\n\n    if (dispatcher == Py_None) {\n        *copy_function = NULL;\n\n        Py_INCREF(value);\n        return value;\n    } else {\n        *copy_function = (copy_func)(Nuitka_CapsuleGetPointer(dispatcher));\n        return (*copy_function)(tstate, value);\n    }\n}\n\nPyObject *DEEP_COPY(PyThreadState *tstate, PyObject *value) {\n#if 1\n    PyObject *dispatcher = DICT_GET_ITEM0(tstate, _deep_copy_dispatch, (PyObject *)Py_TYPE(value));\n\n    if (unlikely(dispatcher == NULL)) {\n        NUITKA_CANNOT_GET_HERE(\"DEEP_COPY encountered unknown type\");\n    }\n\n    if (dispatcher == Py_None) {\n        Py_INCREF(value);\n        return value;\n    } else {\n        copy_func copy_function = (copy_func)(Nuitka_CapsuleGetPointer(dispatcher));\n        return copy_function(tstate, value);\n    }\n\n#else\n\n    if (PyDict_CheckExact(value)) {\n        return DEEP_COPY_DICT(value);\n    } else if (PyList_CheckExact(value)) {\n        return DEEP_COPY_LIST(value);\n    } else if (PyTuple_CheckExact(value)) {\n        return DEEP_COPY_TUPLE(value);\n    } else if (PySet_CheckExact(value)) {\n        return DEEP_COPY_SET(value);\n    } else if (PyFrozenSet_CheckExact(value)) {\n        // Sets cannot contain non-hashable types, so they must be immutable and\n        // the frozenset itself is immutable.\n        return value;\n    } else if (\n#if PYTHON_VERSION < 0x300\n        PyString_Check(value) ||\n#endif\n        PyUnicode_Check(value) ||\n#if PYTHON_VERSION < 0x300\n        PyInt_CheckExact(value) ||\n#endif\n        PyLong_CheckExact(value) || value == Py_None || PyBool_Check(value) || PyFloat_CheckExact(value) ||\n        PyBytes_CheckExact(value) || PyRange_Check(value) || PyType_Check(value) || PySlice_Check(value) ||\n        PyComplex_CheckExact(value) || PyCFunction_Check(value) || value == Py_Ellipsis || value == Py_NotImplemented) {\n        Py_INCREF(value);\n        return value;\n    } else if (PyByteArray_CheckExact(value)) {\n        // TODO: Could make an exception for zero size.\n        return PyByteArray_FromObject(value);\n#if PYTHON_VERSION >= 0x390\n    } else if (Py_TYPE(value) == &Py_GenericAliasType) {\n        GenericAliasObject *generic_alias = (GenericAliasObject *)value;\n\n        PyObject *args = DEEP_COPY(generic_alias->args);\n        PyObject *origin = DEEP_COPY(generic_alias->origin);\n\n        if (generic_alias->args == args && generic_alias->origin == origin) {\n            Py_INCREF(value);\n            return value;\n        } else {\n            return Py_GenericAlias(origin, args);\n        }\n#endif\n    } else {\n        NUITKA_CANNOT_GET_HERE(\"DEEP_COPY encountered unknown type\");\n    }\n#endif\n}\n\n#ifndef __NUITKA_NO_ASSERT__\n\nstatic Py_hash_t DEEP_HASH_INIT(PyThreadState *tstate, PyObject *value) {\n    // To avoid warnings about reduced sizes, we put an intermediate value\n    // that is size_t.\n    size_t value2 = (size_t)value;\n    Py_hash_t result = (Py_hash_t)(value2);\n\n    if (Py_TYPE(value) != &PyType_Type) {\n        result ^= DEEP_HASH(tstate, (PyObject *)Py_TYPE(value));\n    }\n\n    return result;\n}\n\nstatic void DEEP_HASH_BLOB(Py_hash_t *hash, char const *s, Py_ssize_t size) {\n    while (size > 0) {\n        *hash = (1000003 * (*hash)) ^ (Py_hash_t)(*s++);\n        size--;\n    }\n}\n\nstatic void DEEP_HASH_CSTR(Py_hash_t *hash, char const *s) { DEEP_HASH_BLOB(hash, s, strlen(s)); }\n\n// Hash function that actually verifies things done to the bit level. Can be\n// used to detect corruption.\nPy_hash_t DEEP_HASH(PyThreadState *tstate, PyObject *value) {\n    assert(value != NULL);\n\n    if (PyType_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        DEEP_HASH_CSTR(&result, ((PyTypeObject *)value)->tp_name);\n        return result;\n    } else if (PyDict_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t pos = 0;\n        PyObject *key, *dict_value;\n\n        while (Nuitka_DictNext(value, &pos, &key, &dict_value)) {\n            if (key != NULL && value != NULL) {\n                result ^= DEEP_HASH(tstate, key);\n                result ^= DEEP_HASH(tstate, dict_value);\n            }\n        }\n\n        return result;\n    } else if (PyTuple_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t n = PyTuple_GET_SIZE(value);\n\n        for (Py_ssize_t i = 0; i < n; i++) {\n            result ^= DEEP_HASH(tstate, PyTuple_GET_ITEM(value, i));\n        }\n\n        return result;\n    } else if (PyList_CheckExact(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t n = PyList_GET_SIZE(value);\n\n        for (Py_ssize_t i = 0; i < n; i++) {\n            result ^= DEEP_HASH(tstate, PyList_GET_ITEM(value, i));\n        }\n\n        return result;\n    } else if (PySet_Check(value) || PyFrozenSet_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        PyObject *iterator = PyObject_GetIter(value);\n        CHECK_OBJECT(iterator);\n\n        while (true) {\n            PyObject *item = PyIter_Next(iterator);\n            if (!item)\n                break;\n\n            CHECK_OBJECT(item);\n\n            result ^= DEEP_HASH(tstate, item);\n\n            Py_DECREF(item);\n        }\n\n        Py_DECREF(iterator);\n\n        return result;\n    } else if (PyLong_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n        FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n        // Use string to hash the long value, which relies on that to not\n        // use the object address.\n        PyObject *str = PyObject_Str(value);\n        result ^= DEEP_HASH(tstate, str);\n        Py_DECREF(str);\n\n        RESTORE_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n        return result;\n    } else if (PyUnicode_Check(value)) {\n        Py_hash_t result = DEEP_HASH(tstate, (PyObject *)Py_TYPE(value));\n\n        struct Nuitka_ExceptionPreservationItem saved_exception_state;\n\n        FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n#if PYTHON_VERSION >= 0x300\n        char const *s = (char const *)PyUnicode_DATA(value);\n        Py_ssize_t size = PyUnicode_GET_LENGTH(value) * PyUnicode_KIND(value);\n\n        DEEP_HASH_BLOB(&result, s, size);\n#else\n        PyObject *str = PyUnicode_AsUTF8String(value);\n\n        if (str) {\n            result ^= DEEP_HASH(tstate, str);\n        }\n\n        Py_DECREF(str);\n#endif\n        RESTORE_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);\n\n        return result;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (PyString_Check(value)) {\n        Py_hash_t result = DEEP_HASH(tstate, (PyObject *)Py_TYPE(value));\n\n        Py_ssize_t size;\n        char *s;\n\n        int res = PyString_AsStringAndSize(value, &s, &size);\n        assert(res != -1);\n\n        DEEP_HASH_BLOB(&result, s, size);\n\n        return result;\n    }\n#else\n    else if (PyBytes_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t size;\n        char *s;\n\n        int res = PyBytes_AsStringAndSize(value, &s, &size);\n        assert(res != -1);\n\n        DEEP_HASH_BLOB(&result, s, size);\n\n        return result;\n    }\n#endif\n    else if (PyByteArray_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t size = PyByteArray_Size(value);\n        assert(size >= 0);\n\n        char *s = PyByteArray_AsString(value);\n\n        DEEP_HASH_BLOB(&result, s, size);\n\n        return result;\n    } else if (value == Py_None || value == Py_Ellipsis || value == Py_NotImplemented) {\n        return DEEP_HASH_INIT(tstate, value);\n    } else if (PyComplex_Check(value)) {\n        Py_complex c = PyComplex_AsCComplex(value);\n\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t size = sizeof(c);\n        char *s = (char *)&c;\n\n        DEEP_HASH_BLOB(&result, s, size);\n\n        return result;\n    } else if (PyFloat_Check(value)) {\n        double f = PyFloat_AsDouble(value);\n\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        Py_ssize_t size = sizeof(f);\n        char *s = (char *)&f;\n\n        DEEP_HASH_BLOB(&result, s, size);\n\n        return result;\n    } else if (\n#if PYTHON_VERSION < 0x300\n        PyInt_Check(value) ||\n#endif\n        PyBool_Check(value) || PyRange_Check(value) || PySlice_Check(value) || PyCFunction_Check(value)) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n#if 0\n        printf(\"Too simple deep hash: %s\\n\", Py_TYPE(value)->tp_name);\n#endif\n\n        return result;\n#if PYTHON_VERSION >= 0x390\n    } else if (Py_TYPE(value) == &Py_GenericAliasType) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        GenericAliasObject *generic_alias = (GenericAliasObject *)value;\n\n        result ^= DEEP_HASH(tstate, generic_alias->args);\n        result ^= DEEP_HASH(tstate, generic_alias->origin);\n\n        return result;\n#endif\n#if PYTHON_VERSION >= 0x3a0\n    } else if (Py_TYPE(value) == Nuitka_PyUnion_Type) {\n        Py_hash_t result = DEEP_HASH_INIT(tstate, value);\n\n        result ^= DEEP_HASH(tstate, LOOKUP_ATTRIBUTE(tstate, value, const_str_plain___args__));\n\n        return result;\n#endif\n    } else {\n        NUITKA_CANNOT_GET_HERE(\"Unknown type hashed\");\n\n        return -1;\n    }\n}\n#endif\n\n// Note: Not recursion safe, cannot do this everywhere.\nvoid CHECK_OBJECT_DEEP(PyObject *value) {\n    CHECK_OBJECT(value);\n\n    if (PyTuple_Check(value)) {\n        for (Py_ssize_t i = 0, size = PyTuple_GET_SIZE(value); i < size; i++) {\n            PyObject *element = PyTuple_GET_ITEM(value, i);\n\n            CHECK_OBJECT_DEEP(element);\n        }\n    } else if (PyList_CheckExact(value)) {\n        for (Py_ssize_t i = 0, size = PyList_GET_SIZE(value); i < size; i++) {\n            PyObject *element = PyList_GET_ITEM(value, i);\n\n            CHECK_OBJECT_DEEP(element);\n        }\n    } else if (PyDict_Check(value)) {\n        Py_ssize_t pos = 0;\n        PyObject *dict_key, *dict_value;\n\n        while (Nuitka_DictNext(value, &pos, &dict_key, &dict_value)) {\n            CHECK_OBJECT_DEEP(dict_key);\n            CHECK_OBJECT_DEEP(dict_value);\n        }\n    }\n}\n\nvoid CHECK_OBJECTS_DEEP(PyObject *const *values, Py_ssize_t size) {\n    for (Py_ssize_t i = 0; i < size; i++) {\n        CHECK_OBJECT_DEEP(values[i]);\n    }\n}\n\nstatic PyObject *_DEEP_COPY_LIST_GUIDED(PyThreadState *tstate, PyObject *value, char const **guide);\nstatic PyObject *_DEEP_COPY_TUPLE_GUIDED(PyThreadState *tstate, PyObject *value, char const **guide);\n\nstatic PyObject *_DEEP_COPY_ELEMENT_GUIDED(PyThreadState *tstate, PyObject *value, char const **guide) {\n    char code = **guide;\n    *guide += 1;\n\n    switch (code) {\n    case 'i':\n        Py_INCREF(value);\n        return value;\n    case 'L':\n        return _DEEP_COPY_LIST_GUIDED(tstate, value, guide);\n    case 'l':\n        return LIST_COPY(value);\n    case 'T':\n        return _DEEP_COPY_TUPLE_GUIDED(tstate, value, guide);\n    case 't':\n        return TUPLE_COPY(value);\n    case 'D':\n        return DEEP_COPY_DICT(tstate, value);\n    case 'd':\n        return DICT_COPY(value);\n    case 'S':\n        return DEEP_COPY_SET(tstate, value);\n    case 'B':\n        return BYTEARRAY_COPY(tstate, value);\n    case '?':\n        return DEEP_COPY(tstate, value);\n    default:\n        NUITKA_CANNOT_GET_HERE(\"Illegal type guide\");\n        abort();\n    }\n}\n\nstatic PyObject *_DEEP_COPY_LIST_GUIDED(PyThreadState *tstate, PyObject *value, char const **guide) {\n    assert(PyList_CheckExact(value));\n\n    Py_ssize_t size = PyList_GET_SIZE(value);\n\n    PyObject *result = MAKE_LIST_EMPTY(size);\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *item = _DEEP_COPY_ELEMENT_GUIDED(tstate, PyList_GET_ITEM(value, i), guide);\n\n        PyList_SET_ITEM(result, i, item);\n    }\n\n    return result;\n}\n\nstatic PyObject *_DEEP_COPY_TUPLE_GUIDED(PyThreadState *tstate, PyObject *value, char const **guide) {\n    assert(PyTuple_CheckExact(value));\n\n    Py_ssize_t size = PyTuple_GET_SIZE(value);\n\n    // We cannot have size 0, so this is safe.\n    PyObject *result = MAKE_TUPLE_EMPTY(size);\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *item = _DEEP_COPY_ELEMENT_GUIDED(tstate, PyTuple_GET_ITEM(value, i), guide);\n\n        PyTuple_SET_ITEM(result, i, item);\n    }\n\n    return result;\n}\n\nPyObject *DEEP_COPY_LIST_GUIDED(PyThreadState *tstate, PyObject *value, char const *guide) {\n    PyObject *result = _DEEP_COPY_LIST_GUIDED(tstate, value, &guide);\n    assert(*guide == 0);\n    return result;\n}\n\nPyObject *DEEP_COPY_TUPLE_GUIDED(PyThreadState *tstate, PyObject *value, char const *guide) {\n    PyObject *result = _DEEP_COPY_TUPLE_GUIDED(tstate, value, &guide);\n    assert(*guide == 0);\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersDictionaries.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These helpers are used to work with dictionaries.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// spell-checker: ignore ob_shash dictiterobject dictiteritems_type dictiterkeys_type\n// spell-checker: ignore dictitervalues_type dictviewobject dictvaluesview_type dictkeysview_type\n\nPyObject *DICT_GET_ITEM0(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    } else {\n        hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(entry->me_value);\n    return entry->me_value;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        return NULL;\n    }\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0\n    assert(value_addr != NULL);\n    PyObject *result = *value_addr;\n#endif\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n    return result;\n#endif\n}\n\nPyObject *DICT_GET_ITEM1(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    } else {\n        hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(entry->me_value);\n    Py_INCREF(entry->me_value);\n    return entry->me_value;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        return NULL;\n    }\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0\n    assert(value_addr != NULL);\n    PyObject *result = *value_addr;\n#endif\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n    Py_INCREF(result);\n    return result;\n#endif\n}\n\nstatic void SET_CURRENT_EXCEPTION_KEY_ERROR(PyThreadState *tstate, PyObject *key) {\n#if PYTHON_VERSION < 0x3c0\n    /* Wrap all kinds of tuples, because normalization will later unwrap\n     * it, but then that changes the key for the KeyError, which is not\n     * welcome. The check is inexact, as the unwrapping one is too.\n     */\n    if (PyTuple_Check(key) || key == Py_None) {\n        PyObject *tuple = PyTuple_Pack(1, key);\n\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_KeyError, tuple);\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_KeyError, key);\n    }\n#else\n    PyObject *exception_value = MAKE_EXCEPTION_FROM_TYPE_ARG0(tstate, PyExc_KeyError, key);\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_KeyError, exception_value);\n#endif\n}\n\n// TODO: This gives a reference, where would often be one time immediate users\n// of the value, forcing temporary variable releases on the outside. We need\n// to add indication of how long a value is going to be used, so in case where\n// we have the knowledge, we can provide the reference or not. Maybe we can\n// also include temporary nature of the key and/or dict releases to be done\n// inside of such helper code, possibly in template generation, where also\n// the hashing check wouldn't be needed anymore.\nPyObject *DICT_GET_ITEM_WITH_ERROR(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    } else {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        SET_CURRENT_EXCEPTION_KEY_ERROR(tstate, key);\n\n        return NULL;\n    }\n\n    CHECK_OBJECT(entry->me_value);\n    Py_INCREF(entry->me_value);\n    return entry->me_value;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n            return NULL;\n        }\n\n        SET_CURRENT_EXCEPTION_KEY_ERROR(tstate, key);\n\n        return NULL;\n    }\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n            return NULL;\n        }\n\n        SET_CURRENT_EXCEPTION_KEY_ERROR(tstate, key);\n\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0\n    assert(value_addr != NULL);\n    PyObject *result = *value_addr;\n#endif\n\n    if (unlikely(result == NULL)) {\n        if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n            return NULL;\n        }\n\n        SET_CURRENT_EXCEPTION_KEY_ERROR(tstate, key);\n\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n    Py_INCREF(result);\n    return result;\n#endif\n}\n\nPyObject *DICT_GET_ITEM_WITH_HASH_ERROR0(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    } else {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(entry->me_value);\n    return entry->me_value;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        return NULL;\n    }\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0\n    assert(value_addr != NULL);\n    PyObject *result = *value_addr;\n#endif\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n    return result;\n#endif\n}\n\n// TODO: Exact copy of DICT_GET_ITEM_WITH_HASH_ERROR0 with just a Py_INCREF added, we should\n// generate these and all other variants rather than manually maintaining them, so we can\n// also specialize by type and not just result needs.\nPyObject *DICT_GET_ITEM_WITH_HASH_ERROR1(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    } else {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(entry->me_value);\n    Py_INCREF(entry->me_value);\n    return entry->me_value;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n        if (unlikely(hash == -1)) {\n            return NULL;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        return NULL;\n    }\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        return NULL;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0\n    assert(value_addr != NULL);\n    PyObject *result = *value_addr;\n#endif\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(result);\n    Py_INCREF(result);\n    return result;\n#endif\n}\n\nint DICT_HAS_ITEM(PyThreadState *tstate, PyObject *dict, PyObject *key) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    CHECK_OBJECT(key);\n\n    Py_hash_t hash;\n\n// This variant is uncertain about the hashing.\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(key)) {\n        hash = ((PyStringObject *)key)->ob_shash;\n\n        if (unlikely(hash == -1)) {\n            hash = HASH_VALUE_WITHOUT_ERROR(tstate, key);\n        }\n\n        if (unlikely(hash == -1)) {\n            return -1;\n        }\n    } else {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n\n        if (unlikely(hash == -1)) {\n            return -1;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n    PyDictEntry *entry = (dict_object->ma_lookup)(dict_object, key, hash);\n\n    if (unlikely(entry == NULL || entry->me_value == NULL)) {\n        return 0;\n    }\n\n    return 1;\n#else\n    if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *)key)->hash) == -1) {\n        hash = HASH_VALUE_WITH_ERROR(tstate, key);\n        if (unlikely(hash == -1)) {\n            return -1;\n        }\n    }\n\n    PyDictObject *dict_object = (PyDictObject *)dict;\n\n#if PYTHON_VERSION < 0x360\n    PyObject **value_addr;\n    PyDictKeyEntry *entry = dict_object->ma_keys->dk_lookup(dict_object, key, hash, &value_addr);\n\n    if (unlikely(entry == NULL || *value_addr == NULL)) {\n        return 0;\n    }\n\n    return 1;\n#else\n#if PYTHON_VERSION < 0x370\n    PyObject **value_addr;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &value_addr, NULL);\n#elif PYTHON_VERSION < 0x3b0\n    PyObject *result;\n    Py_ssize_t ix = (dict_object->ma_keys->dk_lookup)(dict_object, key, hash, &result);\n#else\n    PyObject **value_addr;\n    Py_ssize_t ix = Nuitka_PyDictLookup(dict_object, key, hash, &value_addr);\n#endif\n\n    if (unlikely(ix < 0)) {\n        if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n            return -1;\n        }\n\n        return 0;\n    }\n#endif\n    return 1;\n#endif\n}\n\n#if PYTHON_VERSION < 0x300\nPyObject *DICT_ITEMS(PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    PyDictObject *mp = (PyDictObject *)dict;\n\n    PyObject *result;\n    Py_ssize_t size;\n\n    /* Preallocate the list of tuples, to avoid allocations during\n     * the loop over the items, which could trigger GC, which\n     * could resize the dict. :-(\n     */\nretry:\n    size = mp->ma_used;\n    result = MAKE_LIST_EMPTY(size);\n    CHECK_OBJECT(result);\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        // Later populated.\n        PyObject *item = MAKE_TUPLE_EMPTY(2);\n        CHECK_OBJECT(item);\n\n        PyList_SET_ITEM(result, i, item);\n    }\n\n    if (unlikely(size != mp->ma_used)) {\n        // Garbage collection can compactify dictionaries.\n        Py_DECREF(result);\n        goto retry;\n    }\n\n    // Nothing must cause any functions to be called\n    PyDictEntry *ep = mp->ma_table;\n    Py_ssize_t mask = mp->ma_mask;\n\n    for (Py_ssize_t i = 0, j = 0; i <= mask; i++) {\n        PyObject *value = ep[i].me_value;\n        if (value != NULL) {\n            PyObject *key = ep[i].me_key;\n            PyObject *item = PyList_GET_ITEM(result, j);\n            PyTuple_SET_ITEM0(item, 0, key);\n            PyTuple_SET_ITEM0(item, 1, value);\n\n            j++;\n        }\n    }\n\n    assert(PyList_GET_SIZE(result) == size);\n\n    return result;\n}\n\n#if PYTHON_VERSION < 0x300\nPyObject *DICT_KEYS(PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    PyDictObject *mp = (PyDictObject *)dict;\n\n    PyObject *result;\n    Py_ssize_t size;\n\n    /* Preallocate the list of tuples, to avoid allocations during\n     * the loop over the items, which could trigger GC, which\n     * could resize the dict. :-(\n     */\nretry:\n    size = mp->ma_used;\n    result = MAKE_LIST_EMPTY(size);\n    CHECK_OBJECT(result);\n\n    if (unlikely(size != mp->ma_used)) {\n        // Garbage collection can compactify dictionaries.\n        Py_DECREF(result);\n        goto retry;\n    }\n\n    // Nothing must cause any functions to be called\n    PyDictEntry *ep = mp->ma_table;\n    Py_ssize_t mask = mp->ma_mask;\n\n    for (Py_ssize_t i = 0, j = 0; i <= mask; i++) {\n        PyObject *value = ep[i].me_value;\n        if (value != NULL) {\n            PyObject *key = ep[i].me_key;\n            PyList_SET_ITEM0(result, j, key);\n\n            j++;\n        }\n    }\n\n    assert(PyList_GET_SIZE(result) == size);\n\n    return result;\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\nPyObject *DICT_VALUES(PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_Check(dict));\n\n    PyDictObject *mp = (PyDictObject *)dict;\n\n    PyObject *result;\n    Py_ssize_t size;\n\n    /* Preallocate the list of tuples, to avoid allocations during\n     * the loop over the items, which could trigger GC, which\n     * could resize the dict. :-(\n     */\nretry:\n    size = mp->ma_used;\n    result = MAKE_LIST_EMPTY(size);\n    CHECK_OBJECT(result);\n\n    if (unlikely(size != mp->ma_used)) {\n        // Garbage collection can compactify dictionaries.\n        Py_DECREF(result);\n        goto retry;\n    }\n\n    // Nothing must cause any functions to be called\n    PyDictEntry *ep = mp->ma_table;\n    Py_ssize_t mask = mp->ma_mask;\n\n    for (Py_ssize_t i = 0, j = 0; i <= mask; i++) {\n        PyObject *value = ep[i].me_value;\n        if (value != NULL) {\n            PyList_SET_ITEM0(result, j, value);\n\n            j++;\n        }\n    }\n\n    assert(PyList_GET_SIZE(result) == size);\n\n    return result;\n}\n#endif\n\n#endif\n\n#if PYTHON_VERSION < 0x300\ntypedef struct {\n    PyObject_HEAD PyDictObject *di_dict;\n    Py_ssize_t di_used;\n    Py_ssize_t di_pos;\n    PyObject *di_result;\n    Py_ssize_t len;\n} dictiterobject;\n#endif\n\n#if PYTHON_VERSION >= 0x300 && PYTHON_VERSION < 0x350\ntypedef struct {\n    PyObject_HEAD PyDictObject *dv_dict;\n} _PyDictViewObject;\n\n#endif\n\n// Generic helper for various dictionary iterations, to be inlined.\nstatic inline PyObject *_MAKE_DICT_ITERATOR(PyDictObject *dict, PyTypeObject *type, bool is_iteritems) {\n    CHECK_OBJECT((PyObject *)dict);\n    assert(PyDict_CheckExact((PyObject *)dict));\n\n#if PYTHON_VERSION < 0x300\n    dictiterobject *di = (dictiterobject *)Nuitka_GC_New(type);\n    CHECK_OBJECT(di);\n    Py_INCREF(dict);\n    di->di_dict = dict;\n    di->di_used = dict->ma_used;\n    di->di_pos = 0;\n    di->len = dict->ma_used;\n    if (is_iteritems) {\n        // TODO: Have this as faster variants, we do these sometimes.\n        di->di_result = PyTuple_Pack(2, Py_None, Py_None);\n        CHECK_OBJECT(di->di_result);\n    } else {\n        di->di_result = NULL;\n    }\n\n    Nuitka_GC_Track(di);\n    return (PyObject *)di;\n#else\n    _PyDictViewObject *dv = (_PyDictViewObject *)Nuitka_GC_New(type);\n    CHECK_OBJECT(dv);\n\n    Py_INCREF(dict);\n    dv->dv_dict = dict;\n\n    Nuitka_GC_Track(dv);\n    return (PyObject *)dv;\n#endif\n}\n\nPyObject *DICT_ITERITEMS(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictiteritems_type = NULL;\n\n    if (unlikely(dictiteritems_type == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n        dictiteritems_type =\n            Py_TYPE(CALL_FUNCTION_NO_ARGS(tstate, PyObject_GetAttrString(const_dict_empty, \"iteritems\")));\n    }\n\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, dictiteritems_type, true);\n#elif PYTHON_VERSION < 0x300\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictIterItem_Type, true);\n#else\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictItems_Type, true);\n#endif\n}\n\nPyObject *DICT_ITERKEYS(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictiterkeys_type = NULL;\n\n    if (unlikely(dictiterkeys_type == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n        dictiterkeys_type =\n            Py_TYPE(CALL_FUNCTION_NO_ARGS(tstate, PyObject_GetAttrString(const_dict_empty, \"iterkeys\")));\n    }\n\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, dictiterkeys_type, false);\n#elif PYTHON_VERSION < 0x300\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictIterKey_Type, false);\n#else\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictKeys_Type, false);\n#endif\n}\n\nPyObject *DICT_ITERVALUES(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictitervalues_type = NULL;\n\n    if (unlikely(dictitervalues_type == NULL)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        dictitervalues_type =\n            Py_TYPE(CALL_FUNCTION_NO_ARGS(tstate, PyObject_GetAttrString(const_dict_empty, \"itervalues\")));\n    }\n\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, dictitervalues_type, false);\n#elif PYTHON_VERSION < 0x300\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictIterValue_Type, false);\n#else\n    return _MAKE_DICT_ITERATOR((PyDictObject *)dict, &PyDictValues_Type, false);\n#endif\n}\n\ntypedef struct {\n    PyObject_HEAD PyDictObject *dv_dict;\n} dictviewobject;\n\nstatic PyObject *_MAKE_DICT_VIEW(PyDictObject *dict, PyTypeObject *type) {\n    CHECK_OBJECT((PyObject *)dict);\n    assert(PyDict_CheckExact((PyObject *)dict));\n\n    dictviewobject *dv = (dictviewobject *)Nuitka_GC_New(type);\n\n    CHECK_OBJECT(dv);\n    Py_INCREF(dict);\n    dv->dv_dict = (PyDictObject *)dict;\n    Nuitka_GC_Track(dv);\n    return (PyObject *)dv;\n}\n\nPyObject *DICT_VIEWKEYS(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictkeysview_type = NULL;\n\n    if (unlikely(dictkeysview_type)) {\n        dictkeysview_type = Py_TYPE(PyObject_GetIter(PyObject_GetAttrString(const_dict_empty, \"viewkeys\")));\n    }\n\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, dictkeysview_type);\n#else\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, &PyDictKeys_Type);\n#endif\n}\n\nPyObject *DICT_VIEWVALUES(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictvaluesview_type = NULL;\n\n    if (unlikely(dictvaluesview_type)) {\n        dictvaluesview_type = Py_TYPE(PyObject_GetIter(PyObject_GetAttrString(const_dict_empty, \"viewvalues\")));\n    }\n\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, dictvaluesview_type);\n#else\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, &PyDictValues_Type);\n#endif\n}\n\nPyObject *DICT_VIEWITEMS(PyObject *dict) {\n#if PYTHON_VERSION < 0x270\n    static PyTypeObject *dictvaluesview_type = NULL;\n\n    if (unlikely(dictvaluesview_type)) {\n        dictvaluesview_type = Py_TYPE(PyObject_GetIter(PyObject_GetAttrString(const_dict_empty, \"viewitems\")));\n    }\n\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, dictvaluesview_type);\n#else\n    return _MAKE_DICT_VIEW((PyDictObject *)dict, &PyDictItems_Type);\n#endif\n}\n\n#include \"HelpersDictionariesGenerated.c\"\n\nvoid DICT_CLEAR(PyObject *dict) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n\n    // TODO: Could inline this for enhanced optimization, but it does\n    // some pretty sophisticated memory handling.\n    PyDict_Clear(dict);\n}\n\n#if PYTHON_VERSION >= 0x3b0\nstatic inline int Nuitka_py_get_index_from_order(PyDictObject *mp, Py_ssize_t i) {\n    assert(mp->ma_used <= SHARED_KEYS_MAX_SIZE);\n    assert(i < (((char *)mp->ma_values)[-2]));\n\n    return ((char *)mp->ma_values)[-3 - i];\n}\n#endif\n\n#if PYTHON_VERSION >= 0x3b0\n\nstatic inline Py_ssize_t Nuitka_Py_dictkeys_get_index(const PyDictKeysObject *keys, Py_ssize_t i) {\n    int log2size = DK_LOG_SIZE(keys);\n    Py_ssize_t ix;\n\n    if (log2size < 8) {\n        const int8_t *indices = (const int8_t *)(keys->dk_indices);\n        ix = indices[i];\n    } else if (log2size < 16) {\n        const int16_t *indices = (const int16_t *)(keys->dk_indices);\n        ix = indices[i];\n    }\n#if SIZEOF_VOID_P > 4\n    else if (log2size >= 32) {\n        const int64_t *indices = (const int64_t *)(keys->dk_indices);\n        ix = indices[i];\n    }\n#endif\n    else {\n        const int32_t *indices = (const int32_t *)(keys->dk_indices);\n        ix = indices[i];\n    }\n\n    assert(ix >= DKIX_DUMMY);\n    return ix;\n}\n\nstatic inline Py_hash_t Nuitka_Py_unicode_get_hash(PyObject *o) { return _PyASCIIObject_CAST(o)->hash; }\n\n// From CPython\n#define PERTURB_SHIFT 5\n\nstatic Py_ssize_t Nuitka_Py_unicodekeys_lookup_generic(PyDictObject *mp, PyDictKeysObject *dk, PyObject *key,\n                                                       Py_hash_t hash) {\n    PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(dk);\n\n    size_t mask = DK_MASK(dk);\n    size_t perturb = hash;\n    size_t i = (size_t)hash & mask;\n\n    while (1) {\n        Py_ssize_t ix = Nuitka_Py_dictkeys_get_index(dk, i);\n\n        if (ix >= 0) {\n            PyDictUnicodeEntry *ep = &ep0[ix];\n\n            assert(ep->me_key != NULL);\n            assert(PyUnicode_CheckExact(ep->me_key));\n\n            if (ep->me_key == key) {\n                return ix;\n            }\n\n            if (Nuitka_Py_unicode_get_hash(ep->me_key) == hash) {\n                PyObject *startkey = ep->me_key;\n                Py_INCREF(startkey);\n                nuitka_bool cmp = RICH_COMPARE_EQ_NBOOL_UNICODE_OBJECT(startkey, key);\n                Py_DECREF(startkey);\n\n                if (unlikely(cmp == NUITKA_BOOL_EXCEPTION)) {\n                    return DKIX_ERROR;\n                }\n\n                if (dk == mp->ma_keys && ep->me_key == startkey) {\n                    if (cmp == NUITKA_BOOL_TRUE) {\n                        return ix;\n                    }\n                } else {\n                    // In case of changed dictionary, trigger restart in caller.\n                    return DKIX_KEY_CHANGED;\n                }\n            }\n        } else if (ix == DKIX_EMPTY) {\n            return DKIX_EMPTY;\n        }\n        perturb >>= PERTURB_SHIFT;\n        i = mask & (i * 5 + perturb + 1);\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"Nuitka_Py_unicodekeys_lookup_generic failed\");\n}\n\n// TODO: Make use of this one in Nuitka_PyDictLookupStr\nstatic Py_ssize_t Nuitka_Py_unicodekeys_lookup_unicode(PyDictKeysObject *dk, PyObject *key, Py_hash_t hash) {\n    assert(PyUnicode_CheckExact(key));\n\n    PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(dk);\n\n    size_t mask = DK_MASK(dk);\n    size_t perturb = hash;\n    size_t i = (size_t)hash & mask;\n\n    while (true) {\n        Py_ssize_t ix = Nuitka_Py_dictkeys_get_index(dk, i);\n\n        // Found it.\n        if (ix >= 0) {\n            PyDictUnicodeEntry *ep = &ep0[ix];\n            assert(ep->me_key != NULL);\n            assert(PyUnicode_CheckExact(ep->me_key));\n\n            if (ep->me_key == key || (Nuitka_Py_unicode_get_hash(ep->me_key) == hash &&\n                                      RICH_COMPARE_EQ_CBOOL_UNICODE_UNICODE(ep->me_key, key))) {\n                return ix;\n            }\n        } else if (ix == DKIX_EMPTY) {\n            return DKIX_EMPTY;\n        }\n        perturb >>= PERTURB_SHIFT;\n\n        i = mask & (i * 5 + perturb + 1);\n        ix = Nuitka_Py_dictkeys_get_index(dk, i);\n\n        if (ix >= 0) {\n            PyDictUnicodeEntry *ep = &ep0[ix];\n\n            assert(ep->me_key != NULL);\n            assert(PyUnicode_CheckExact(ep->me_key));\n\n            if (ep->me_key == key || (Nuitka_Py_unicode_get_hash(ep->me_key) == hash &&\n                                      RICH_COMPARE_EQ_CBOOL_UNICODE_UNICODE(ep->me_key, key))) {\n                return ix;\n            }\n        } else if (ix == DKIX_EMPTY) {\n            return DKIX_EMPTY;\n        }\n\n        perturb >>= PERTURB_SHIFT;\n        i = mask & (i * 5 + perturb + 1);\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"Nuitka_Py_unicodekeys_lookup_unicode failed\");\n}\n\n// Search key from Generic table.\nstatic Py_ssize_t Nuitka_Py_dictkeys_generic_lookup(PyDictObject *mp, PyDictKeysObject *dk, PyObject *key,\n                                                    Py_hash_t hash) {\n    PyDictKeyEntry *ep0 = DK_ENTRIES(dk);\n\n    size_t mask = DK_MASK(dk);\n    size_t perturb = hash;\n    size_t i = (size_t)hash & mask;\n\n    while (1) {\n        Py_ssize_t ix = Nuitka_Py_dictkeys_get_index(dk, i);\n\n        if (ix >= 0) {\n            PyDictKeyEntry *ep = &ep0[ix];\n            assert(ep->me_key != NULL);\n            if (ep->me_key == key) {\n                return ix;\n            }\n            if (ep->me_hash == hash) {\n                PyObject *startkey = ep->me_key;\n                Py_INCREF(startkey);\n                nuitka_bool cmp = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(startkey, key);\n                Py_DECREF(startkey);\n                if (cmp == NUITKA_BOOL_EXCEPTION) {\n                    return DKIX_ERROR;\n                }\n                if (dk == mp->ma_keys && ep->me_key == startkey) {\n                    if (cmp == NUITKA_BOOL_TRUE) {\n                        return ix;\n                    }\n                } else {\n                    // In case of changed dictionary, trigger restart in caller.\n                    return DKIX_KEY_CHANGED;\n                }\n            }\n        } else if (ix == DKIX_EMPTY) {\n            return DKIX_EMPTY;\n        }\n        perturb >>= PERTURB_SHIFT;\n        i = mask & (i * 5 + perturb + 1);\n    }\n    Py_UNREACHABLE();\n}\n\nPy_ssize_t Nuitka_PyDictLookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) {\n    PyDictKeysObject *dk;\n    DictKeysKind kind;\n    Py_ssize_t ix;\n\nrestart:\n    dk = mp->ma_keys;\n    kind = (DictKeysKind)dk->dk_kind;\n\n    if (kind != DICT_KEYS_GENERAL) {\n        if (PyUnicode_CheckExact(key)) {\n            ix = Nuitka_Py_unicodekeys_lookup_unicode(dk, key, hash);\n        } else {\n            ix = Nuitka_Py_unicodekeys_lookup_generic(mp, dk, key, hash);\n\n            // Dictionary lookup changed the dictionary, retry.\n            if (ix == DKIX_KEY_CHANGED) {\n                goto restart;\n            }\n        }\n\n        if (ix >= 0) {\n            if (kind == DICT_KEYS_SPLIT) {\n                *value_addr = &mp->ma_values->values[ix];\n            } else {\n                *value_addr = &DK_UNICODE_ENTRIES(dk)[ix].me_value;\n            }\n        } else {\n            *value_addr = NULL;\n        }\n    } else {\n        ix = Nuitka_Py_dictkeys_generic_lookup(mp, dk, key, hash);\n\n        // Dictionary lookup changed the dictionary, retry.\n        if (ix == DKIX_KEY_CHANGED) {\n            goto restart;\n        }\n\n        if (ix >= 0) {\n            *value_addr = &DK_ENTRIES(dk)[ix].me_value;\n        } else {\n            *value_addr = NULL;\n        }\n    }\n\n    return ix;\n}\n\n// TODO: Take advantage of string key knowledge directly.\nPy_ssize_t Nuitka_PyDictLookupStr(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) {\n    assert(PyUnicode_CheckExact(key));\n\n    return Nuitka_PyDictLookup(mp, key, hash, value_addr);\n}\n\n#endif\n\nbool Nuitka_DictNext(PyObject *dict, Py_ssize_t *pos, PyObject **key_ptr, PyObject **value_ptr) {\n    CHECK_OBJECT(dict);\n    assert(PyDict_CheckExact(dict));\n    assert(key_ptr);\n    assert(value_ptr);\n\n#if PYTHON_VERSION < 0x300\n    Py_ssize_t i = *pos;\n\n    PyDictEntry *ep = ((PyDictObject *)dict)->ma_table;\n    Py_ssize_t mask = ((PyDictObject *)dict)->ma_mask;\n\n    while (i <= mask && ep[i].me_value == NULL) {\n        i++;\n    }\n\n    *pos = i + 1;\n\n    if (i > mask) {\n        return false;\n    }\n\n    *key_ptr = ep[i].me_key;\n    *value_ptr = ep[i].me_value;\n\n    return true;\n\n#elif PYTHON_VERSION < 0x3b0\n    PyDictObject *mp = (PyDictObject *)dict;\n    PyDictKeyEntry *entry;\n    PyObject *value;\n\n    Py_ssize_t i = *pos;\n    assert(i >= 0);\n\n#ifndef PY_NOGIL\n    if (mp->ma_values) {\n        if (i >= mp->ma_used) {\n            return false;\n        }\n\n        entry = &DK_ENTRIES(mp->ma_keys)[i];\n        value = DK_VALUE(mp, i);\n\n        assert(value != NULL);\n#else\n    if (false) {\n#endif\n    } else {\n#if PYTHON_VERSION < 0x360\n        Py_ssize_t n = mp->ma_keys->dk_size;\n#else\n        Py_ssize_t n = mp->ma_keys->dk_nentries;\n#endif\n        if (i >= n) {\n            return false;\n        }\n\n        entry = &DK_ENTRIES(mp->ma_keys)[i];\n\n        while (i < n && entry->me_value == NULL) {\n            entry += 1;\n            i += 1;\n        }\n\n        if (i >= n) {\n            return false;\n        }\n\n        value = entry->me_value;\n    }\n\n    *pos = i + 1;\n\n    *key_ptr = entry->me_key;\n    *value_ptr = value;\n\n    return true;\n#else\n    PyDictObject *mp = (PyDictObject *)dict;\n    Py_ssize_t i = *pos;\n    PyObject *key, *value;\n\n    if (mp->ma_values) {\n        // Shared keys dictionary.\n        assert(mp->ma_used <= SHARED_KEYS_MAX_SIZE);\n\n        if (i >= mp->ma_used) {\n            return false;\n        }\n\n        int index = Nuitka_py_get_index_from_order(mp, i);\n        value = mp->ma_values->values[index];\n\n        key = DK_UNICODE_ENTRIES(mp->ma_keys)[index].me_key;\n\n        assert(value != NULL);\n    } else {\n        Py_ssize_t n = mp->ma_keys->dk_nentries;\n\n        if (i >= n) {\n            return false;\n        }\n\n        // Unicode keys or general keys have different sizes, make sure to index\n        // the right type, the algorithm is the same however.\n        if (DK_IS_UNICODE(mp->ma_keys)) {\n            PyDictUnicodeEntry *entry_ptr = &DK_UNICODE_ENTRIES(mp->ma_keys)[i];\n\n            while (i < n && entry_ptr->me_value == NULL) {\n                entry_ptr++;\n                i++;\n            }\n\n            if (i >= n) {\n                return false;\n            }\n\n            key = entry_ptr->me_key;\n            value = entry_ptr->me_value;\n        } else {\n            PyDictKeyEntry *entry_ptr = &DK_ENTRIES(mp->ma_keys)[i];\n\n            while (i < n && entry_ptr->me_value == NULL) {\n                entry_ptr++;\n                i++;\n            }\n\n            if (i >= n) {\n                return false;\n            }\n\n            key = entry_ptr->me_key;\n            value = entry_ptr->me_value;\n        }\n    }\n\n    *pos = i + 1;\n\n    *key_ptr = key;\n    *value_ptr = value;\n\n    return true;\n#endif\n}\n\nPyObject *TO_DICT(PyThreadState *tstate, PyObject *seq_obj, PyObject *dict_obj) {\n    PyObject *result;\n\n    if (seq_obj != NULL) {\n        CHECK_OBJECT(seq_obj);\n\n        // Fast path for dictionaries.\n        if (PyDict_CheckExact(seq_obj)) {\n            result = DICT_COPY(seq_obj);\n        } else {\n            result = MAKE_DICT_EMPTY();\n\n            Py_INCREF(seq_obj);\n\n#if PYTHON_VERSION >= 0x300\n            int res = HAS_ATTR_BOOL2(tstate, seq_obj, const_str_plain_keys);\n\n            if (unlikely(res == -1)) {\n                Py_DECREF(seq_obj);\n                return NULL;\n            }\n#else\n            int res = HAS_ATTR_BOOL(tstate, seq_obj, const_str_plain_keys) ? 1 : 0;\n#endif\n\n            if (res) {\n                res = PyDict_Merge(result, seq_obj, 1);\n            } else {\n                res = PyDict_MergeFromSeq2(result, seq_obj, 1);\n            }\n\n            Py_DECREF(seq_obj);\n\n            if (unlikely(res == -1)) {\n                return NULL;\n            }\n        }\n    } else {\n        result = MAKE_DICT_EMPTY();\n    }\n\n    // TODO: Should specialize for dict_obj/seq_obj presence to save a bit of time\n    // and complexity.\n    if (dict_obj != NULL) {\n        CHECK_OBJECT(dict_obj);\n\n        int res = PyDict_Merge(result, dict_obj, 1);\n\n        if (unlikely(res == -1)) {\n            return NULL;\n        }\n    }\n\n    return result;\n}\n\n#if NUITKA_DICT_HAS_FREELIST\nPyObject *MAKE_DICT_EMPTY(void) {\n    PyDictObject *empty_dict_mp = (PyDictObject *)const_dict_empty;\n\n    empty_dict_mp->ma_keys->dk_refcnt++;\n\n    PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n\n    result_mp->ma_keys = empty_dict_mp->ma_keys;\n    result_mp->ma_values = empty_dict_mp->ma_values;\n    result_mp->ma_used = 0;\n\n    // Key reference needs to be counted.\n#ifdef Py_REF_DEBUG\n    _Py_RefTotal++;\n#endif\n\n    // No Nuitka_GC_Track for the empty dictionary.\n    return (PyObject *)result_mp;\n}\n#endif\n\nPyObject *MAKE_DICT(PyObject **pairs, Py_ssize_t size) {\n    PyObject *result = _PyDict_NewPresized(size);\n\n    // Reject usage like this.\n    assert(size > 0);\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *key = pairs[i * 2];\n        PyObject *value = pairs[i * 2 + 1];\n\n        int res = PyDict_SetItem(result, key, value);\n\n        if (unlikely(res != 0)) {\n            Py_DECREF(result);\n            return NULL;\n        }\n    }\n\n    return result;\n}\n\nPyObject *MAKE_DICT_X(PyObject **pairs, Py_ssize_t size) {\n    PyObject *result = _PyDict_NewPresized(size);\n\n    // Reject usage like this.\n    assert(size > 0);\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *value = pairs[i * 2 + 1];\n\n        if (value != NULL) {\n            PyObject *key = pairs[i * 2];\n            CHECK_OBJECT(key);\n            CHECK_OBJECT(value);\n\n            int res = PyDict_SetItem(result, key, value);\n\n            if (unlikely(res != 0)) {\n                Py_DECREF(result);\n                return NULL;\n            }\n        }\n    }\n\n    return result;\n}\n\nPyObject *MAKE_DICT_X_CSTR(char const **keys, PyObject **values, Py_ssize_t size) {\n    PyObject *result = _PyDict_NewPresized(size);\n\n    // Reject usage like this.\n    assert(size > 0);\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *value = values[i];\n\n        if (value != NULL) {\n            CHECK_OBJECT(value);\n\n            int res = PyDict_SetItemString(result, keys[i], value);\n\n            if (unlikely(res != 0)) {\n                Py_DECREF(result);\n                return NULL;\n            }\n        }\n    }\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersDictionariesGenerated.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* WARNING, this code is GENERATED. Modify the template HelperDictionaryCopy.c.j2 instead! */\n\n// Usable fraction of keys.\n#define DK_USABLE_FRACTION(n) (((n) << 1) / 3)\n\n#if PYTHON_VERSION < 0x3b0\ntypedef PyObject *PyDictValues;\n#endif\n\n#if PYTHON_VERSION < 0x360\n#define DK_ENTRIES_SIZE(keys) (keys->dk_size)\n#elif PYTHON_VERSION < 0x3b0\n#define DK_ENTRIES_SIZE(keys) DK_USABLE_FRACTION(DK_SIZE(keys))\n#else\n#define DK_ENTRIES_SIZE(keys) (keys->dk_nentries)\n#endif\n\n// More than 2/3 of the keys are used, i.e. no space is wasted.\n#if PYTHON_VERSION < 0x360\n#define IS_COMPACT(dict_mp) (dict_mp->ma_used >= (dict_mp->ma_keys->dk_size * 2) / 3)\n#else\n#define IS_COMPACT(dict_mp) (dict_mp->ma_used >= (dict_mp->ma_keys->dk_nentries * 2) / 3)\n#endif\n\nstatic inline PyDictValues *_Nuitka_PyDict_new_values(Py_ssize_t size) {\n    Py_ssize_t values_size = sizeof(PyObject *) * size;\n\n#if PYTHON_VERSION < 0x3b0\n    return (PyDictValues *)PyMem_MALLOC(values_size);\n#else\n    // With Python3.11 or higher a prefix is allocated too.\n    size_t prefix_size = _Py_SIZE_ROUND_UP(size + 2, sizeof(PyObject *));\n    size_t n = prefix_size + values_size;\n    uint8_t *mem = (uint8_t *)PyMem_MALLOC(n);\n\n    assert(mem != NULL);\n\n    assert(prefix_size % sizeof(PyObject *) == 0);\n    mem[prefix_size - 1] = (uint8_t)prefix_size;\n\n    return (PyDictValues *)(mem + prefix_size);\n#endif\n}\n\n#if NUITKA_DICT_HAS_FREELIST\nstatic struct _Py_dict_state *_Nuitka_Py_get_dict_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->dict_state;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic PyDictObject *_Nuitka_AllocatePyDictObject(void) {\n    PyDictObject *result_mp;\n\n#if NUITKA_DICT_HAS_FREELIST\n    struct _Py_dict_state *state = _Nuitka_Py_get_dict_state();\n\n    if (state->numfree) {\n        result_mp = state->free_list[--state->numfree];\n\n        Nuitka_Py_NewReference((PyObject *)result_mp);\n\n        assert(PyDict_CheckExact((PyObject *)result_mp));\n        assert(result_mp != NULL);\n    } else\n#endif\n    {\n        result_mp = (PyDictObject *)Nuitka_GC_New(&PyDict_Type);\n    }\n\n    return result_mp;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x360 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT)\nstatic Py_ssize_t _Nuitka_Py_PyDict_KeysSize(PyDictKeysObject *keys) {\n#if PYTHON_VERSION < 0x360\n    return sizeof(PyDictKeysObject) + (DK_SIZE(keys) - 1) * sizeof(PyDictKeyEntry);\n#elif PYTHON_VERSION < 0x370\n    return (sizeof(PyDictKeysObject) - Py_MEMBER_SIZE(PyDictKeysObject, dk_indices) + DK_IXSIZE(keys) * DK_SIZE(keys) +\n            DK_USABLE_FRACTION(DK_SIZE(keys)) * sizeof(PyDictKeyEntry));\n#elif PYTHON_VERSION < 0x3b0\n    return (sizeof(PyDictKeysObject) + DK_IXSIZE(keys) * DK_SIZE(keys) +\n            DK_USABLE_FRACTION(DK_SIZE(keys)) * sizeof(PyDictKeyEntry));\n#else\n    size_t entry_size = keys->dk_kind == DICT_KEYS_GENERAL ? sizeof(PyDictKeyEntry) : sizeof(PyDictUnicodeEntry);\n    return (sizeof(PyDictKeysObject) + ((size_t)1 << keys->dk_log2_index_bytes) +\n            DK_USABLE_FRACTION(DK_SIZE(keys)) * entry_size);\n#endif\n}\n#endif\n\nPyObject *DICT_COPY(PyObject *dict_value) {\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    return PyDict_Copy(dict_value);\n#else\n    PyObject *result;\n\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    if (((PyDictObject *)dict_value)->ma_used == 0) {\n        result = MAKE_DICT_EMPTY();\n    } else {\n        PyDictObject *dict_mp = (PyDictObject *)dict_value;\n\n#if PYTHON_VERSION < 0x300\n        // For Python3, this can be done much faster in the same way as it is\n        // done in parameter parsing.\n        result = _PyDict_NewPresized(dict_mp->ma_used);\n\n        for (Py_ssize_t i = 0; i <= dict_mp->ma_mask; i++) {\n            PyDictEntry *entry = &dict_mp->ma_table[i];\n\n            if (entry->me_value != NULL) {\n                PyObject *key = entry->me_key;\n\n                PyObject *value = entry->me_value;\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n            }\n        }\n#else\n        /* Python 3 */\n#ifndef PY_NOGIL\n        if (_PyDict_HasSplitTable(dict_mp)) {\n            PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n            assert(result_mp != NULL);\n            result = (PyObject *)result_mp;\n\n            Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n            PyDictValues *new_values = _Nuitka_PyDict_new_values(size);\n            assert(new_values != NULL);\n\n#if PYTHON_VERSION >= 0x3b0\n            // Need to preserve values prefix.\n            size_t prefix_size = ((uint8_t *)new_values)[-1];\n            memcpy(((char *)new_values) - prefix_size, ((char *)dict_mp->ma_values) - prefix_size, prefix_size - 1);\n#endif\n\n            result_mp->ma_values = new_values;\n            result_mp->ma_keys = dict_mp->ma_keys;\n            result_mp->ma_used = dict_mp->ma_used;\n\n            // This is a manual reference count for the keys.\n#ifdef Py_REF_DEBUG\n            _Py_RefTotal++;\n#endif\n            dict_mp->ma_keys->dk_refcnt += 1;\n\n            for (Py_ssize_t i = 0; i < size; i++) {\n                if (DK_VALUE(dict_mp, i)) {\n                    PyObject *value = DK_VALUE(dict_mp, i);\n\n                    DK_VALUE(result_mp, i) = value;\n                    Py_INCREF(value);\n\n                } else {\n                    DK_VALUE(result_mp, i) = NULL;\n                }\n            }\n\n            Nuitka_GC_Track(result_mp);\n        } else\n#endif\n#if PYTHON_VERSION >= 0x360\n            // Fast dictionary copy if it has at least 2/3 space usage. This is most relevant\n            // for the DICT_COPY, where it might even be the intention to trigger a shrink with\n            // a fresh copy.\n            if (dict_mp->ma_values == NULL && IS_COMPACT(dict_mp)) {\n                assert(dict_mp->ma_values == NULL);\n                assert(dict_mp->ma_keys->dk_refcnt == 1);\n\n                PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n                result = (PyObject *)result_mp;\n\n                result_mp->ma_values = NULL;\n                result_mp->ma_used = dict_mp->ma_used;\n\n                Py_ssize_t keys_size = _Nuitka_Py_PyDict_KeysSize(dict_mp->ma_keys);\n                result_mp->ma_keys = (PyDictKeysObject *)PyObject_MALLOC(keys_size);\n                assert(result_mp->ma_keys);\n\n                memcpy(result_mp->ma_keys, dict_mp->ma_keys, keys_size);\n\n                // Take reference of all keys and values.\n#if PYTHON_VERSION < 0x3b0\n                PyDictKeyEntry *entries = DK_ENTRIES(result_mp->ma_keys);\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &entries[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n\n                        Py_INCREF(key);\n\n                        Py_INCREF(value);\n                    }\n                }\n#else\n                PyObject **key_ptr, **value_ptr;\n                size_t entry_size;\n\n                bool is_unicode = DK_IS_UNICODE(result_mp->ma_keys);\n\n                if (is_unicode) {\n                    PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictUnicodeEntry) / sizeof(PyObject *);\n                } else {\n                    PyDictKeyEntry *ep0 = DK_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictKeyEntry) / sizeof(PyObject *);\n                }\n\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyObject *value = *value_ptr;\n\n                    if (value != NULL) {\n\n                        Py_INCREF(value);\n                        PyObject *key = *key_ptr;\n                        Py_INCREF(key);\n                    }\n\n                    value_ptr += entry_size;\n                    key_ptr += entry_size;\n                }\n#endif\n\n                // The new keys are an object counted.\n#ifdef Py_REF_DEBUG\n                _Py_RefTotal++;\n#endif\n\n                Nuitka_GC_Track(result_mp);\n            } else\n#endif\n            {\n                result = _PyDict_NewPresized(dict_mp->ma_used);\n\n#if PYTHON_VERSION < 0x3b0\n                Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n                        CHECK_OBJECT(key);\n\n                        CHECK_OBJECT(value);\n\n                        NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                        assert(res == 0);\n                    }\n                }\n#else\n            Py_ssize_t pos = 0;\n            PyObject *key, *value;\n\n            while (Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &value)) {\n                CHECK_OBJECT(key);\n                CHECK_OBJECT(value);\n\n                CHECK_OBJECT(value);\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n            }\n#endif\n            }\n#endif\n    }\n\n    return result;\n#endif\n}\n\nPyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value) {\n    PyObject *result;\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    result = DICT_COPY(dict_value);\n\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(dict_value, &pos, &key, &value)) {\n        PyObject *dict_value_copy = DEEP_COPY(tstate, value);\n\n        if (dict_value_copy != value) {\n            DICT_SET_ITEM(result, key, value);\n        }\n    }\n#else\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    if (((PyDictObject *)dict_value)->ma_used == 0) {\n        result = MAKE_DICT_EMPTY();\n    } else {\n        PyDictObject *dict_mp = (PyDictObject *)dict_value;\n\n#if PYTHON_VERSION < 0x300\n        // For Python3, this can be done much faster in the same way as it is\n        // done in parameter parsing.\n        result = _PyDict_NewPresized(dict_mp->ma_used);\n\n        for (Py_ssize_t i = 0; i <= dict_mp->ma_mask; i++) {\n            PyDictEntry *entry = &dict_mp->ma_table[i];\n\n            if (entry->me_value != NULL) {\n                PyObject *key = entry->me_key;\n\n                PyObject *value = entry->me_value;\n                value = DEEP_COPY(tstate, value);\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n\n                Py_DECREF(value);\n            }\n        }\n#else\n        /* Python 3 */\n#ifndef PY_NOGIL\n        if (_PyDict_HasSplitTable(dict_mp)) {\n            PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n            assert(result_mp != NULL);\n            result = (PyObject *)result_mp;\n\n            Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n            PyDictValues *new_values = _Nuitka_PyDict_new_values(size);\n            assert(new_values != NULL);\n\n#if PYTHON_VERSION >= 0x3b0\n            // Need to preserve values prefix.\n            size_t prefix_size = ((uint8_t *)new_values)[-1];\n            memcpy(((char *)new_values) - prefix_size, ((char *)dict_mp->ma_values) - prefix_size, prefix_size - 1);\n#endif\n\n            result_mp->ma_values = new_values;\n            result_mp->ma_keys = dict_mp->ma_keys;\n            result_mp->ma_used = dict_mp->ma_used;\n\n            // This is a manual reference count for the keys.\n#ifdef Py_REF_DEBUG\n            _Py_RefTotal++;\n#endif\n            dict_mp->ma_keys->dk_refcnt += 1;\n\n            for (Py_ssize_t i = 0; i < size; i++) {\n                if (DK_VALUE(dict_mp, i)) {\n                    PyObject *value = DK_VALUE(dict_mp, i);\n                    value = DEEP_COPY(tstate, value);\n\n                    DK_VALUE(result_mp, i) = value;\n\n                } else {\n                    DK_VALUE(result_mp, i) = NULL;\n                }\n            }\n\n            Nuitka_GC_Track(result_mp);\n        } else\n#endif\n#if PYTHON_VERSION >= 0x360\n            // Fast dictionary copy if it has at least 2/3 space usage. This is most relevant\n            // for the DICT_COPY, where it might even be the intention to trigger a shrink with\n            // a fresh copy.\n            if (dict_mp->ma_values == NULL && IS_COMPACT(dict_mp)) {\n                assert(dict_mp->ma_values == NULL);\n                assert(dict_mp->ma_keys->dk_refcnt == 1);\n\n                PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n                result = (PyObject *)result_mp;\n\n                result_mp->ma_values = NULL;\n                result_mp->ma_used = dict_mp->ma_used;\n\n                Py_ssize_t keys_size = _Nuitka_Py_PyDict_KeysSize(dict_mp->ma_keys);\n                result_mp->ma_keys = (PyDictKeysObject *)PyObject_MALLOC(keys_size);\n                assert(result_mp->ma_keys);\n\n                memcpy(result_mp->ma_keys, dict_mp->ma_keys, keys_size);\n\n                // Take reference of all keys and values.\n#if PYTHON_VERSION < 0x3b0\n                PyDictKeyEntry *entries = DK_ENTRIES(result_mp->ma_keys);\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &entries[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n\n                        Py_INCREF(key);\n\n                        value = DEEP_COPY(tstate, value);\n\n                        entry->me_value = value;\n                    }\n                }\n#else\n                PyObject **key_ptr, **value_ptr;\n                size_t entry_size;\n\n                bool is_unicode = DK_IS_UNICODE(result_mp->ma_keys);\n\n                if (is_unicode) {\n                    PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictUnicodeEntry) / sizeof(PyObject *);\n                } else {\n                    PyDictKeyEntry *ep0 = DK_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictKeyEntry) / sizeof(PyObject *);\n                }\n\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyObject *value = *value_ptr;\n\n                    if (value != NULL) {\n                        value = DEEP_COPY(tstate, value);\n                        *value_ptr = value;\n                        PyObject *key = *key_ptr;\n                        Py_INCREF(key);\n                    }\n\n                    value_ptr += entry_size;\n                    key_ptr += entry_size;\n                }\n#endif\n\n                // The new keys are an object counted.\n#ifdef Py_REF_DEBUG\n                _Py_RefTotal++;\n#endif\n\n                Nuitka_GC_Track(result_mp);\n            } else\n#endif\n            {\n                result = _PyDict_NewPresized(dict_mp->ma_used);\n\n#if PYTHON_VERSION < 0x3b0\n                Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n                        CHECK_OBJECT(key);\n\n                        CHECK_OBJECT(value);\n\n                        value = DEEP_COPY(tstate, value);\n\n                        NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                        assert(res == 0);\n\n                        Py_DECREF(value);\n                    }\n                }\n#else\n            Py_ssize_t pos = 0;\n            PyObject *key, *value;\n\n            while (Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &value)) {\n                CHECK_OBJECT(key);\n                CHECK_OBJECT(value);\n\n                CHECK_OBJECT(value);\n\n                value = DEEP_COPY(tstate, value);\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n\n                Py_DECREF(value);\n            }\n#endif\n            }\n#endif\n    }\n\n#endif\n\n    return result;\n}\n\n// Helper for function calls with star dict arguments. */\nstatic PyObject *COPY_DICT_KW(PyObject *dict_value) {\n    PyObject *result;\n    bool had_kw_error = false;\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    result = DICT_COPY(dict_value);\n\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(dict_value, &pos, &key, &value)) {\n        if (unlikely(!checkKeywordType(key))) {\n            had_kw_error = true;\n        }\n    }\n#else\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    if (((PyDictObject *)dict_value)->ma_used == 0) {\n        result = MAKE_DICT_EMPTY();\n    } else {\n        PyDictObject *dict_mp = (PyDictObject *)dict_value;\n\n#if PYTHON_VERSION < 0x300\n        // For Python3, this can be done much faster in the same way as it is\n        // done in parameter parsing.\n        result = _PyDict_NewPresized(dict_mp->ma_used);\n\n        for (Py_ssize_t i = 0; i <= dict_mp->ma_mask; i++) {\n            PyDictEntry *entry = &dict_mp->ma_table[i];\n\n            if (entry->me_value != NULL) {\n                PyObject *key = entry->me_key;\n                if (unlikely(!checkKeywordType(key))) {\n                    had_kw_error = true;\n                }\n\n                PyObject *value = entry->me_value;\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n            }\n        }\n#else\n        /* Python 3 */\n#ifndef PY_NOGIL\n        if (_PyDict_HasSplitTable(dict_mp)) {\n            PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n            assert(result_mp != NULL);\n            result = (PyObject *)result_mp;\n\n            Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n#if PYTHON_VERSION < 0x3b0\n            for (Py_ssize_t i = 0; i < size; i++) {\n                PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n\n                if (entry->me_value != NULL) {\n                    PyObject *key = entry->me_key;\n                    if (unlikely(!checkKeywordType(key))) {\n                        had_kw_error = true;\n                    }\n                }\n#else\n            Py_ssize_t pos = 0;\n            PyObject *key, *_value;\n\n            while (Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &_value)) {\n                CHECK_OBJECT(key);\n                CHECK_OBJECT(_value);\n\n                if (unlikely(!checkKeywordType(key))) {\n                    had_kw_error = true;\n                }\n#endif\n            }\n\n            PyDictValues *new_values = _Nuitka_PyDict_new_values(size);\n            assert(new_values != NULL);\n\n#if PYTHON_VERSION >= 0x3b0\n            // Need to preserve values prefix.\n            size_t prefix_size = ((uint8_t *)new_values)[-1];\n            memcpy(((char *)new_values) - prefix_size, ((char *)dict_mp->ma_values) - prefix_size, prefix_size - 1);\n#endif\n\n            result_mp->ma_values = new_values;\n            result_mp->ma_keys = dict_mp->ma_keys;\n            result_mp->ma_used = dict_mp->ma_used;\n\n            // This is a manual reference count for the keys.\n#ifdef Py_REF_DEBUG\n            _Py_RefTotal++;\n#endif\n            dict_mp->ma_keys->dk_refcnt += 1;\n\n            for (Py_ssize_t i = 0; i < size; i++) {\n                if (DK_VALUE(dict_mp, i)) {\n                    PyObject *value = DK_VALUE(dict_mp, i);\n\n                    DK_VALUE(result_mp, i) = value;\n                    Py_INCREF(value);\n\n                } else {\n                    DK_VALUE(result_mp, i) = NULL;\n                }\n            }\n\n            Nuitka_GC_Track(result_mp);\n        } else\n#endif\n#if PYTHON_VERSION >= 0x360\n            // Fast dictionary copy if it has at least 2/3 space usage. This is most relevant\n            // for the DICT_COPY, where it might even be the intention to trigger a shrink with\n            // a fresh copy.\n            if (dict_mp->ma_values == NULL && IS_COMPACT(dict_mp)) {\n                assert(dict_mp->ma_values == NULL);\n                assert(dict_mp->ma_keys->dk_refcnt == 1);\n\n                PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n                result = (PyObject *)result_mp;\n\n                result_mp->ma_values = NULL;\n                result_mp->ma_used = dict_mp->ma_used;\n\n                Py_ssize_t keys_size = _Nuitka_Py_PyDict_KeysSize(dict_mp->ma_keys);\n                result_mp->ma_keys = (PyDictKeysObject *)PyObject_MALLOC(keys_size);\n                assert(result_mp->ma_keys);\n\n                memcpy(result_mp->ma_keys, dict_mp->ma_keys, keys_size);\n\n                // Take reference of all keys and values.\n#if PYTHON_VERSION < 0x3b0\n                PyDictKeyEntry *entries = DK_ENTRIES(result_mp->ma_keys);\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &entries[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n                        if (unlikely(!checkKeywordType(key))) {\n                            had_kw_error = true;\n                        }\n                        Py_INCREF(key);\n\n                        Py_INCREF(value);\n                    }\n                }\n#else\n                PyObject **key_ptr, **value_ptr;\n                size_t entry_size;\n\n                bool is_unicode = DK_IS_UNICODE(result_mp->ma_keys);\n\n                if (is_unicode) {\n                    PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictUnicodeEntry) / sizeof(PyObject *);\n                } else {\n                    PyDictKeyEntry *ep0 = DK_ENTRIES(result_mp->ma_keys);\n\n                    key_ptr = &ep0->me_key;\n                    value_ptr = &ep0->me_value;\n                    entry_size = sizeof(PyDictKeyEntry) / sizeof(PyObject *);\n                }\n\n                Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyObject *value = *value_ptr;\n\n                    if (value != NULL) {\n\n                        Py_INCREF(value);\n                        PyObject *key = *key_ptr;\n                        if (is_unicode == false) {\n                            if (unlikely(!checkKeywordType(key))) {\n                                had_kw_error = true;\n                            }\n                        }\n                        Py_INCREF(key);\n                    }\n\n                    value_ptr += entry_size;\n                    key_ptr += entry_size;\n                }\n#endif\n\n                // The new keys are an object counted.\n#ifdef Py_REF_DEBUG\n                _Py_RefTotal++;\n#endif\n\n                Nuitka_GC_Track(result_mp);\n            } else\n#endif\n            {\n                result = _PyDict_NewPresized(dict_mp->ma_used);\n\n#if PYTHON_VERSION < 0x3b0\n                Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n                for (Py_ssize_t i = 0; i < size; i++) {\n                    PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n                    PyObject *value = entry->me_value;\n\n                    if (value != NULL) {\n                        PyObject *key = entry->me_key;\n                        CHECK_OBJECT(key);\n\n                        if (unlikely(!checkKeywordType(key))) {\n                            had_kw_error = true;\n                        }\n\n                        CHECK_OBJECT(value);\n\n                        NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                        assert(res == 0);\n                    }\n                }\n#else\n            Py_ssize_t pos = 0;\n            PyObject *key, *value;\n\n            while (Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &value)) {\n                CHECK_OBJECT(key);\n                CHECK_OBJECT(value);\n\n                if (unlikely(!checkKeywordType(key))) {\n                    had_kw_error = true;\n                }\n\n                CHECK_OBJECT(value);\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem(result, key, value);\n                assert(res == 0);\n            }\n#endif\n            }\n#endif\n    }\n\n#endif\n\n    if (unlikely(had_kw_error)) {\n        Py_DECREF(result);\n        return NULL;\n    }\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersDumpBacktraces.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These helpers are used to report C backtraces */\n\n#include \"backtrace/backtrace.h\"\n\nstatic struct backtrace_state *our_backtrace_state = NULL;\n\nvoid INIT_C_BACKTRACES(void) {\n    our_backtrace_state = backtrace_create_state(NULL, 1, NULL, NULL);\n    assert(our_backtrace_state != NULL);\n}\n\nstatic int bt_frame_count = 0;\n\nstatic int ourBacktraceFullCallback(void *data, uintptr_t pc, const char *filename, int lineno, const char *function) {\n    if (strcmp(function, \"DUMP_C_BACKTRACE\") != 0) {\n        fprintf(stderr, \"#%d %s:%d %s\\n\", bt_frame_count, filename, lineno, function);\n        bt_frame_count += 1;\n    }\n\n    if (strcmp(function, \"main\") == 0) {\n        return 1;\n    }\n\n    return 0;\n}\n\nvoid DUMP_C_BACKTRACE(void) {\n    assert(our_backtrace_state != NULL);\n\n    bt_frame_count = 0;\n    backtrace_full(our_backtrace_state, 0, ourBacktraceFullCallback, NULL, NULL);\n}\n\n#include \"backtrace/backtrace.c\"\n#include \"backtrace/dwarf.c\"\n#if !defined(_WIN32)\n#include \"backtrace/elf.c\"\n#include \"backtrace/mmap.c\"\n#else\n#include \"backtrace/alloc.c\"\n#include \"backtrace/pecoff.c\"\n#endif\n#include \"backtrace/fileline.c\"\n#include \"backtrace/posix.c\"\n#include \"backtrace/read.c\"\n#include \"backtrace/sort.c\"\n#include \"backtrace/state.c\"\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersEnvironmentVariables.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// Helpers for working with environment variables from Python binary in a\n// portable way.\n\n#include \"nuitka/environment_variables.h\"\n\n#include \"HelpersEnvironmentVariablesSystem.c\"\n\nvoid undoEnvironmentVariable(PyThreadState *tstate, char const *variable_name, environment_char_t const *old_value) {\n    PyObject *os_module = IMPORT_HARD_OS();\n    CHECK_OBJECT(os_module);\n\n    PyObject *os_environ = PyObject_GetAttrString(os_module, \"environ\");\n    CHECK_OBJECT(os_environ);\n\n    PyObject *variable_name_str = Nuitka_String_FromString(variable_name);\n    CHECK_OBJECT(variable_name_str);\n\n    if (old_value) {\n        setEnvironmentVariable(variable_name, old_value);\n\n#ifdef _WIN32\n        PyObject *env_value = NuitkaUnicode_FromWideChar(old_value, -1);\n#else\n        PyObject *env_value = Nuitka_String_FromString(old_value);\n#endif\n        CHECK_OBJECT(env_value);\n\n        int res = PyObject_SetItem(os_environ, variable_name_str, env_value);\n\n        if (unlikely(res != 0)) {\n            PyErr_PrintEx(1);\n            Py_Exit(1);\n        }\n\n        Py_DECREF(env_value);\n    } else {\n        unsetEnvironmentVariable(variable_name);\n\n        int res = PyObject_DelItem(os_environ, variable_name_str);\n\n        if (unlikely(res != 0)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n    }\n\n    Py_DECREF(variable_name_str);\n    Py_DECREF(os_environ);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// Helpers for working with environment variables in a portable way. This mainly\n// abstracts the string type differences between Win32 and non-Win32 environment\n// variables.\n\n#include \"nuitka/environment_variables_system.h\"\n#include \"nuitka/safe_string_ops.h\"\n\n#if defined(_WIN32)\n\nenvironment_char_t const *getEnvironmentVariable(char const *name) {\n    // Max size for environment variables according to docs.\n    wchar_t buffer[32768];\n    buffer[0] = 0;\n\n    wchar_t name_wide[40];\n    name_wide[0] = 0;\n    appendStringSafeW(name_wide, name, sizeof(name_wide) / sizeof(wchar_t));\n\n    // Size must be in bytes apparently, not in characters. Cannot be larger anyway.\n    DWORD res = GetEnvironmentVariableW(name_wide, buffer, 65536);\n\n    if (res == 0 || res > sizeof(buffer)) {\n        return NULL;\n    }\n\n    return wcsdup(buffer);\n}\n\nvoid setEnvironmentVariable(char const *name, environment_char_t const *value) {\n    assert(name != NULL);\n    assert(value != NULL);\n\n    wchar_t name_wide[40];\n    name_wide[0] = 0;\n    appendStringSafeW(name_wide, name, sizeof(name_wide) / sizeof(wchar_t));\n\n    DWORD res = SetEnvironmentVariableW(name_wide, value);\n    assert(wcscmp(getEnvironmentVariable(name), value) == 0);\n\n    assert(res != 0);\n}\n\nvoid unsetEnvironmentVariable(char const *name) {\n    wchar_t name_wide[40];\n    name_wide[0] = 0;\n    appendStringSafeW(name_wide, name, sizeof(name_wide) / sizeof(wchar_t));\n\n    DWORD res = SetEnvironmentVariableW(name_wide, NULL);\n\n    assert(res != 0);\n}\n\n#else\n\nenvironment_char_t const *getEnvironmentVariable(char const *name) { return getenv(name); }\n\nvoid setEnvironmentVariable(char const *name, environment_char_t const *value) { setenv(name, value, 1); }\n\nvoid unsetEnvironmentVariable(char const *name) { unsetenv(name); }\n\n#endif\n\nvoid setEnvironmentVariableFromLong(char const *name, long value) {\n    char buffer[128];\n    snprintf(buffer, sizeof(buffer), \"%ld\", value);\n\n#if defined(_WIN32)\n    wchar_t buffer2[128];\n    buffer2[0] = 0;\n    appendStringSafeW(buffer2, buffer, 128);\n\n    setEnvironmentVariable(name, buffer2);\n#else\n    setEnvironmentVariable(name, buffer);\n#endif\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersExceptions.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For setting exceptions.\n *\n * These are non-inline variants for exception raises, done so to avoid the code bloat.\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nvoid SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyObject *exception_type, char const *format, char const *value) {\n    PyErr_Format(exception_type, format, value);\n}\n\nvoid SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(PyObject *exception_type, char const *format, char const *value1,\n                                         char const *value2) {\n    PyErr_Format(exception_type, format, value1, value2);\n}\n\nvoid SET_CURRENT_EXCEPTION_TYPE0_FORMAT3(PyObject *exception_type, char const *format, char const *value1,\n                                         char const *value2, char const *value3) {\n    PyErr_Format(exception_type, format, value1, value2, value3);\n}\n\nvoid SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(char const *format, PyObject *mistyped) {\n    SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, format, Py_TYPE(mistyped)->tp_name);\n}\n\nstatic char const *TYPE_NAME_DESC(PyObject *type) {\n    if (type == Py_None) {\n        return \"None\";\n    } else {\n        return Py_TYPE(type)->tp_name;\n    }\n}\n\nvoid SET_CURRENT_EXCEPTION_TYPE_COMPLAINT_NICE(char const *format, PyObject *mistyped) {\n    SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError, format, TYPE_NAME_DESC(mistyped));\n}\n\nvoid FORMAT_UNBOUND_LOCAL_ERROR(PyObject **exception_type, PyObject **exception_value, PyObject *variable_name) {\n    *exception_type = PyExc_UnboundLocalError;\n    Py_INCREF(*exception_type);\n\n#if PYTHON_VERSION < 0x3b0\n    char const *message = \"local variable '%s' referenced before assignment\";\n#else\n    char const *message = \"cannot access local variable '%s' where it is not associated with a value\";\n#endif\n\n    *exception_value = Nuitka_String_FromFormat(message, Nuitka_String_AsString_Unchecked(variable_name));\n    CHECK_OBJECT(*exception_value);\n}\n\nvoid FORMAT_UNBOUND_CLOSURE_ERROR(PyObject **exception_type, PyObject **exception_value, PyObject *variable_name) {\n    *exception_type = PyExc_NameError;\n    Py_INCREF(*exception_type);\n\n#if PYTHON_VERSION < 0x3b0\n    char const *message = \"free variable '%s' referenced before assignment in enclosing scope\";\n#else\n    char const *message = \"cannot access free variable '%s' where it is not associated with a value in enclosing scope\";\n#endif\n\n    *exception_value = Nuitka_String_FromFormat(message, Nuitka_String_AsString_Unchecked(variable_name));\n    CHECK_OBJECT(*exception_value);\n}\n\nstatic PyObject *_Nuitka_Err_CreateException(PyThreadState *tstate, PyObject *exception_type, PyObject *value) {\n    PyObject *exc;\n\n    if (value == NULL || value == Py_None) {\n        exc = CALL_FUNCTION_NO_ARGS(tstate, exception_type);\n    } else if (PyTuple_Check(value)) {\n        exc = CALL_FUNCTION_WITH_POSARGS(tstate, exception_type, value);\n    } else {\n        exc = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, exception_type, value);\n    }\n\n    if (exc != NULL && !PyExceptionInstance_Check(exc)) {\n        PyErr_Format(PyExc_TypeError,\n                     \"calling %s should have returned an instance of \"\n                     \"BaseException, not %s\",\n                     GET_CALLABLE_NAME(exception_type), Py_TYPE(exc)->tp_name);\n        Py_DECREF(exc);\n\n        return NULL;\n    }\n\n    return exc;\n}\n\n// Our replacement for PyErr_NormalizeException, that however does not attempt\n// to deal with recursion, i.e. exception during normalization, we just avoid\n// the API call overhead in the normal case.\nvoid Nuitka_Err_NormalizeException(PyThreadState *tstate, PyObject **exc, PyObject **val, PyTracebackObject **tb) {\n    PyObject *type = *exc;\n\n    // Dealt with in NORMALIZE_EXCEPTION\n    assert(type != NULL && type != Py_None);\n\n    PyObject *value = *val;\n\n    // Allow setting the value to NULL for time savings with quick type only errors\n    if (value == NULL) {\n        value = Py_None;\n        Py_INCREF(value);\n    }\n\n    // Normalize the exception from class to instance\n    if (PyExceptionClass_Check(type)) {\n        PyObject *inclass = NULL;\n\n        int is_subclass = 0;\n\n        if (PyExceptionInstance_Check(value)) {\n            inclass = PyExceptionInstance_Class(value);\n\n            is_subclass = PyObject_IsSubclass(inclass, type);\n\n            if (is_subclass < 0) {\n                goto error;\n            }\n        }\n\n        // If the value was not an instance, or is not an instance of derived\n        // type, then call it\n        if (!is_subclass) {\n            PyObject *fixed_value = _Nuitka_Err_CreateException(tstate, type, value);\n\n            if (unlikely(fixed_value == NULL)) {\n                goto error;\n            }\n\n            Py_DECREF(value);\n            value = fixed_value;\n        } else if (inclass != type) {\n            // Switch to given type then\n            Py_INCREF(inclass);\n            Py_DECREF(type);\n\n            type = inclass;\n        }\n    }\n\n    *exc = type;\n    *val = value;\n\n    return;\n\nerror:\n\n    Py_DECREF(type);\n    Py_DECREF(value);\n    PyTracebackObject *initial_tb = *tb;\n\n    struct Nuitka_ExceptionPreservationItem exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &exception_state);\n\n    ASSIGN_ARGS_FROM_EXCEPTION_PRESERVATION_STATE(&exception_state, exc, val, tb);\n    RELEASE_ERROR_OCCURRED_STATE(&exception_state);\n\n    if (initial_tb != NULL) {\n        if (*tb == NULL) {\n            *tb = initial_tb;\n        } else {\n            Py_DECREF(initial_tb);\n        }\n    }\n\n#if PYTHON_VERSION >= 0x380\n    _PyErr_NormalizeException(tstate, exc, val, (PyObject **)tb);\n#else\n    PyErr_NormalizeException(exc, val, (PyObject **)tb);\n#endif\n}\n\n// Raise NameError for a given variable name.\nvoid SET_CURRENT_EXCEPTION_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name) {\n    PyObject *exception_value_str =\n        Nuitka_String_FromFormat(\"name '%s' is not defined\", Nuitka_String_AsString_Unchecked(variable_name));\n\n    PyObject *exception_value = MAKE_EXCEPTION_FROM_TYPE_ARG0(tstate, PyExc_NameError, exception_value_str);\n    Py_DECREF(exception_value_str);\n\n#if PYTHON_VERSION >= 0x300\n    CHAIN_EXCEPTION(tstate, exception_value);\n#endif\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_NameError, exception_value);\n}\n\n// Raise NameError with \"global\" for a given variable name.\n#if PYTHON_VERSION < 0x340\nvoid SET_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name) {\n    PyObject *exception_value_str =\n        Nuitka_String_FromFormat(\"global name '%s' is not defined\", Nuitka_String_AsString_Unchecked(variable_name));\n\n    PyObject *exception_value = MAKE_EXCEPTION_FROM_TYPE_ARG0(tstate, PyExc_NameError, exception_value_str);\n    Py_DECREF(exception_value_str);\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_NameError, exception_value);\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersFiles.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* Small helpers to access files and their contents */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Small helper to open files with few arguments.\nPyObject *BUILTIN_OPEN_SIMPLE(PyThreadState *tstate, PyObject *filename, char const *mode, bool buffering,\n                              PyObject *encoding) {\n    PyObject *mode_obj = Nuitka_String_FromString(mode);\n    PyObject *buffering_obj = buffering ? const_int_pos_1 : const_int_0;\n\n    PyObject *result;\n\n#if PYTHON_VERSION < 0x300\n    // On Windows, it seems that line buffering is actually the default.\n#ifdef _WIN32\n    if ((strcmp(mode, \"w\") == 0) && buffering == true) {\n        buffering_obj = const_int_0;\n    }\n#endif\n\n    result = BUILTIN_OPEN(tstate, filename, mode_obj, buffering_obj);\n\n#else\n    if ((strcmp(mode, \"w\") == 0) && buffering == false) {\n        // TODO: Hard import code could be used for this.\n        static PyObject *_io_module_text_io_wrapper = NULL;\n        if (_io_module_text_io_wrapper == NULL) {\n            _io_module_text_io_wrapper = PyObject_GetAttrString(IMPORT_HARD__IO(), \"TextIOWrapper\");\n            CHECK_OBJECT(_io_module_text_io_wrapper);\n        }\n\n        PyObject *mode_obj2 = PyUnicode_FromString(\"wb\");\n\n        PyObject *binary_stream =\n            BUILTIN_OPEN(tstate, filename, mode_obj2, buffering_obj, NULL, NULL, NULL, NULL, NULL);\n\n        Py_DECREF(mode_obj2);\n\n        if (binary_stream == NULL) {\n            return NULL;\n        }\n\n        PyObject *encoding_default = NULL;\n\n        if (encoding == NULL) {\n            if (encoding_default == NULL) {\n                encoding_default = Nuitka_String_FromString(\"utf-8\");\n            }\n\n            encoding = encoding_default;\n        }\n\n        PyObject *args[] = {binary_stream, encoding, Py_None, Py_None, Py_False, Py_True};\n\n        result = CALL_FUNCTION_WITH_ARGS6(tstate, _io_module_text_io_wrapper, args);\n    } else {\n        result = BUILTIN_OPEN(tstate, filename, mode_obj, buffering_obj, encoding, NULL, NULL, NULL, NULL);\n    }\n\n#endif\n    Py_DECREF(mode_obj);\n\n    return result;\n}\n\nPyObject *BUILTIN_OPEN_BINARY_READ_SIMPLE(PyThreadState *tstate, PyObject *filename) {\n    PyObject *result;\n\n#if PYTHON_VERSION < 0x300\n    // On Windows, it seems that line buffering is actually the default.\n    result = BUILTIN_OPEN(tstate, filename, const_str_plain_rb, const_int_0);\n#else\n    result = BUILTIN_OPEN(tstate, filename, const_str_plain_rb, const_int_0, NULL, NULL, NULL, NULL, NULL);\n#endif\n\n    return result;\n}\n\nPyObject *GET_FILE_BYTES(PyThreadState *tstate, PyObject *filename) {\n    PyObject *result;\n\n    if (TRACE_FILE_READ(tstate, filename, &result)) {\n        return result;\n    }\n\n    PyObject *data_file = BUILTIN_OPEN_BINARY_READ_SIMPLE(tstate, filename);\n\n    if (unlikely(data_file == NULL)) {\n        // TODO: Issue a runtime warning maybe.\n        return NULL;\n    }\n\n    PyObject *read_method = LOOKUP_ATTRIBUTE(tstate, data_file, const_str_plain_read);\n    Py_DECREF(data_file);\n\n    if (unlikely(read_method == NULL)) {\n        return NULL;\n    }\n\n    result = CALL_FUNCTION_NO_ARGS(tstate, read_method);\n    Py_DECREF(read_method);\n    return result;\n}\n\n// TODO: Don't we have this generated.\nstatic PyObject *IMPORT_HARD_OS_PATH(PyThreadState *tstate) {\n    static PyObject *os_path = NULL;\n\n    if (os_path == NULL) {\n        os_path = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS(), const_str_plain_path);\n\n        CHECK_OBJECT(os_path);\n    }\n\n    return os_path;\n}\n\nPyObject *OS_PATH_FILE_EXISTS(PyThreadState *tstate, PyObject *filename) {\n    PyObject *result;\n\n    if (TRACE_FILE_EXISTS(tstate, filename, &result)) {\n        return result;\n    }\n\n    PyObject *exists_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_exists);\n\n    result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, exists_func, filename);\n\n    Py_DECREF(exists_func);\n    return result;\n}\n\nPyObject *OS_PATH_FILE_ISFILE(PyThreadState *tstate, PyObject *filename) {\n    PyObject *result;\n\n    if (TRACE_FILE_ISFILE(tstate, filename, &result)) {\n        return result;\n    }\n\n    PyObject *isfile_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_isfile);\n\n    result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, isfile_func, filename);\n\n    Py_DECREF(isfile_func);\n    return result;\n}\n\nPyObject *OS_PATH_FILE_ISDIR(PyThreadState *tstate, PyObject *filename) {\n    PyObject *result;\n\n    if (TRACE_FILE_ISDIR(tstate, filename, &result)) {\n        return result;\n    }\n\n    PyObject *isdir_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_isdir);\n\n    result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, isdir_func, filename);\n\n    Py_DECREF(isdir_func);\n    return result;\n}\n\nPyObject *OS_LISTDIR(PyThreadState *tstate, PyObject *path) {\n    PyObject *result;\n\n    if (TRACE_FILE_LISTDIR(tstate, path, &result)) {\n        return result;\n    }\n\n    PyObject *listdir_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS(), const_str_plain_listdir);\n\n    if (path != NULL) {\n        result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, listdir_func, path);\n    } else {\n        result = CALL_FUNCTION_NO_ARGS(tstate, listdir_func);\n    }\n\n    Py_DECREF(listdir_func);\n    return result;\n}\n\nPyObject *OS_PATH_BASENAME(PyThreadState *tstate, PyObject *filename) {\n    CHECK_OBJECT(filename);\n\n    PyObject *basename_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_basename);\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, basename_func, filename);\n\n    Py_DECREF(basename_func);\n    return result;\n}\n\nPyObject *OS_PATH_DIRNAME(PyThreadState *tstate, PyObject *filename) {\n    CHECK_OBJECT(filename);\n\n    PyObject *dirname_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_dirname);\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, dirname_func, filename);\n\n    Py_DECREF(dirname_func);\n    return result;\n}\n\nPyObject *OS_PATH_ABSPATH(PyThreadState *tstate, PyObject *filename) {\n    CHECK_OBJECT(filename);\n\n    PyObject *abspath_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_abspath);\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, abspath_func, filename);\n\n    Py_DECREF(abspath_func);\n    return result;\n}\n\nPyObject *OS_PATH_ISABS(PyThreadState *tstate, PyObject *filename) {\n    CHECK_OBJECT(filename);\n\n    PyObject *isabs_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS_PATH(tstate), const_str_plain_isabs);\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, isabs_func, filename);\n\n    Py_DECREF(isabs_func);\n    return result;\n}\n\nnuitka_bool compareFilePaths(PyThreadState *tstate, PyObject *filename_a, PyObject *filename_b) {\n    filename_a = OS_PATH_ABSPATH(tstate, filename_a);\n\n    if (unlikely(filename_a == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    filename_b = OS_PATH_ABSPATH(tstate, filename_b);\n\n    if (unlikely(filename_b == NULL)) {\n        Py_DECREF(filename_a);\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(filename_a, filename_b);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersFilesystemPaths.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// Tools for working with file, and paths cross platform\n// for use in both onefile bootstrap and python compiled\n// program.\n\n#if defined(__APPLE__)\n#include <dlfcn.h>\n#include <libgen.h>\n#include <mach-o/dyld.h>\n#endif\n\n#if defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <sys/sysctl.h>\n#endif\n\n#if !defined(_WIN32)\n#include <dlfcn.h>\n#include <fcntl.h>\n#include <libgen.h>\n#include <pwd.h>\n#include <stdlib.h>\n#include <strings.h>\n#include <sys/mman.h>\n#include <sys/time.h>\n#include <unistd.h>\n#endif\n\n// We are using in onefile bootstrap as well, so copy it.\n#ifndef Py_MIN\n#define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))\n#endif\n\n#include \"nuitka/filesystem_paths.h\"\n#include \"nuitka/safe_string_ops.h\"\n\nfilename_char_t *getBinaryPath(void) {\n    static filename_char_t binary_filename[MAXPATHLEN];\n\n#if defined(_WIN32)\n    DWORD res = GetModuleFileNameW(NULL, binary_filename, sizeof(binary_filename) / sizeof(wchar_t));\n    if (res == 0) {\n        abort();\n    }\n#elif defined(__APPLE__)\n    uint32_t bufsize = sizeof(binary_filename);\n    int res = _NSGetExecutablePath(binary_filename, &bufsize);\n\n    if (res != 0) {\n        abort();\n    }\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n    /* Not all of FreeBSD has /proc file system, so use the appropriate\n     * \"sysctl\" instead.\n     */\n    int mib[4];\n    mib[0] = CTL_KERN;\n    mib[1] = KERN_PROC;\n    mib[2] = KERN_PROC_PATHNAME;\n    mib[3] = -1;\n    size_t cb = sizeof(binary_filename);\n    int res = sysctl(mib, 4, binary_filename, &cb, NULL, 0);\n\n    if (res != 0) {\n        abort();\n    }\n#else\n    /* The remaining platforms, mostly Linux or compatible. */\n\n    /* The \"readlink\" call does not terminate result, so fill zeros there, then\n     * it is a proper C string right away. */\n    memset(binary_filename, 0, sizeof(binary_filename));\n    ssize_t res = readlink(\"/proc/self/exe\", binary_filename, sizeof(binary_filename) - 1);\n\n    if (res == -1) {\n        abort();\n    }\n#endif\n\n    return binary_filename;\n}\n\nbool readFileChunk(FILE_HANDLE file_handle, void *buffer, size_t size) {\n    // printf(\"Reading %d\\n\", size);\n\n#if defined(_WIN32)\n    DWORD read_size;\n    BOOL bool_res = ReadFile(file_handle, buffer, (DWORD)size, &read_size, NULL);\n\n    return bool_res && (read_size == size);\n#else\n    size_t read_size = fread(buffer, 1, size, file_handle);\n\n    return read_size == size;\n#endif\n}\n\nbool writeFileChunk(FILE_HANDLE target_file, void const *chunk, size_t chunk_size) {\n#if defined(_WIN32)\n    DWORD write_size = 0;\n    return WriteFile(target_file, chunk, (DWORD)chunk_size, &write_size, NULL);\n#else\n    size_t written = fwrite(chunk, 1, chunk_size, target_file);\n    return written == chunk_size;\n#endif\n}\n\nFILE_HANDLE createFileForWriting(filename_char_t const *filename) {\n#if defined(_WIN32)\n    FILE_HANDLE result = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL);\n#else\n    FILE *result = fopen(filename, \"wb\");\n#endif\n\n    return result;\n}\n\nFILE_HANDLE openFileForReading(filename_char_t const *filename) {\n#if defined(_WIN32)\n    FILE_HANDLE result = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n#else\n    FILE *result = fopen(filename, \"rb\");\n#endif\n\n    return result;\n}\n\nbool closeFile(FILE_HANDLE target_file) {\n#if defined(_WIN32)\n    CloseHandle(target_file);\n    return true;\n#else\n    int r = fclose(target_file);\n\n    return r == 0;\n#endif\n}\n\nint64_t getFileSize(FILE_HANDLE file_handle) {\n#if defined(_WIN32)\n    // TODO: File size is truncated here, but maybe an OK thing.\n    DWORD file_size = GetFileSize(file_handle, NULL);\n\n    if (file_size == INVALID_FILE_SIZE) {\n        return -1;\n    }\n#else\n    int res = fseek(file_handle, 0, SEEK_END);\n\n    if (res != 0) {\n        return -1;\n    }\n\n    long file_size = ftell(file_handle);\n\n    res = fseek(file_handle, 0, SEEK_SET);\n\n    if (res != 0) {\n        return -1;\n    }\n#endif\n\n    return (int64_t)file_size;\n}\n\n#if !defined(_WIN32)\n#if defined(__APPLE__)\n#include <copyfile.h>\n#else\n#if defined(__MSYS__) || defined(__HAIKU__)\nstatic bool sendfile(int output_file, int input_file, off_t *bytesCopied, size_t count) {\n    char buffer[32768];\n\n    *bytesCopied = 0;\n\n    while (count > 0) {\n        ssize_t read_bytes = read(input_file, buffer, Py_MIN(sizeof(buffer), count));\n\n        if (unlikely(read <= 0)) {\n            return false;\n        }\n\n        count -= read_bytes;\n\n        ssize_t written_bytes = write(output_file, buffer, read_bytes);\n\n        if (unlikely(written_bytes != read_bytes)) {\n            return false;\n        }\n\n        *bytesCopied += written_bytes;\n    }\n\n    return true;\n}\n#elif !defined(__FreeBSD__)\n#include <sys/sendfile.h>\n#endif\n#endif\n#endif\n\nint getFileMode(filename_char_t const *filename) {\n#if !defined(_WIN32)\n    struct stat fileinfo = {0};\n    if (stat(filename, &fileinfo) == -1) {\n        return -1;\n    }\n\n    return fileinfo.st_mode;\n#else\n    // There is no mode on Windows, but copyFile calls should get it.\n    return 0;\n#endif\n}\n\nbool copyFile(filename_char_t const *source, filename_char_t const *dest, int mode) {\n#if !defined(_WIN32)\n    int input_file = open(source, O_RDONLY);\n\n    if (input_file == -1) {\n        return false;\n    }\n\n    int output_file = creat(dest, mode);\n\n    if (output_file == -1) {\n        close(input_file);\n        return false;\n    }\n\n#if defined(__APPLE__)\n    // Use fcopyfile works on FreeBSD and macOS\n    bool result = fcopyfile(input_file, output_file, 0, COPYFILE_ALL) == 0;\n#elif defined(__FreeBSD__)\n    struct stat input_fileinfo = {0};\n    fstat(input_file, &input_fileinfo);\n    off_t bytesCopied = 0;\n\n    bool result = sendfile(output_file, input_file, 0, input_fileinfo.st_size, 0, &bytesCopied, 0);\n#else\n    // sendfile will work with on Linux 2.6.33+\n    struct stat fileinfo = {0};\n    fstat(input_file, &fileinfo);\n\n    off_t bytesCopied = 0;\n    bool result = sendfile(output_file, input_file, &bytesCopied, fileinfo.st_size) != -1;\n#endif\n\n    close(input_file);\n    close(output_file);\n\n    return result;\n#else\n    return CopyFileW(source, dest, 0) != 0;\n#endif\n}\n\nbool deleteFile(filename_char_t const *filename) {\n#if defined(_WIN32)\n    return DeleteFileW(filename) != 0;\n#else\n    return unlink(filename) == 0;\n#endif\n}\n\nbool renameFile(filename_char_t const *source, filename_char_t const *dest) {\n// spell-checker: ignore _wrename\n#if defined(_WIN32)\n    return _wrename(source, dest) == 0;\n#else\n    return rename(source, dest) == 0;\n#endif\n}\n\n#include \"nuitka/checksum_tools.h\"\n\nextern error_code_t getLastErrorCode(void) {\n#if defined(_WIN32)\n    return GetLastError();\n#else\n    return errno;\n#endif\n}\n\n#if defined(_WIN32)\nstruct MapFileToMemoryInfo {\n    bool error;\n    DWORD error_code;\n    char const *erroring_function;\n    unsigned char const *data;\n    HANDLE file_handle;\n    int64_t file_size;\n    HANDLE handle_mapping;\n};\n\nstatic struct MapFileToMemoryInfo mapFileToMemory(filename_char_t const *filename) {\n    struct MapFileToMemoryInfo result;\n\n    result.file_handle = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,\n                                     NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\n    if (result.file_handle == INVALID_HANDLE_VALUE) {\n        result.error = true;\n        result.error_code = GetLastError();\n        result.erroring_function = \"CreateFileW\";\n\n        return result;\n    }\n\n    result.file_size = getFileSize(result.file_handle);\n\n    if (result.file_size == -1) {\n        result.error = true;\n        result.error_code = GetLastError();\n        result.erroring_function = \"GetFileSize\";\n\n        CloseHandle(result.file_handle);\n\n        return result;\n    }\n\n    result.handle_mapping = CreateFileMappingW(result.file_handle, NULL, PAGE_READONLY, 0, 0, NULL);\n\n    if (result.handle_mapping == NULL) {\n        result.error = true;\n        result.error_code = GetLastError();\n        result.erroring_function = \"CreateFileMappingW\";\n\n        CloseHandle(result.file_handle);\n\n        return result;\n    }\n\n    result.data = (unsigned char const *)MapViewOfFile(result.handle_mapping, FILE_MAP_READ, 0, 0, 0);\n\n    if (unlikely(result.data == NULL)) {\n        result.error = true;\n        result.error_code = GetLastError();\n        result.erroring_function = \"MapViewOfFile\";\n\n        CloseHandle(result.handle_mapping);\n        CloseHandle(result.file_handle);\n\n        return result;\n    }\n\n    result.error = false;\n    result.error_code = 0;\n\n    return result;\n}\n\nstatic void unmapFileFromMemory(struct MapFileToMemoryInfo *mapped_file) {\n    assert(!mapped_file->error);\n\n    UnmapViewOfFile(mapped_file->data);\n    CloseHandle(mapped_file->handle_mapping);\n    CloseHandle(mapped_file->file_handle);\n}\n#else\n\nstruct MapFileToMemoryInfo {\n    bool error;\n    int error_code;\n    char const *erroring_function;\n    unsigned char const *data;\n    int file_handle;\n    int64_t file_size;\n};\n\nstatic struct MapFileToMemoryInfo mapFileToMemory(filename_char_t const *filename) {\n    struct MapFileToMemoryInfo result;\n\n    result.file_handle = open(filename, O_RDONLY);\n\n    if (unlikely(result.file_handle == -1)) {\n        result.error = true;\n        result.error_code = errno;\n        result.erroring_function = \"open\";\n        return result;\n    }\n\n    result.file_size = lseek(result.file_handle, 0, SEEK_END);\n    if (unlikely(result.file_size == -1)) {\n        result.error = true;\n        result.error_code = errno;\n        result.erroring_function = \"lseek\";\n\n        close(result.file_handle);\n\n        return result;\n    }\n    off_t res = lseek(result.file_handle, 0, SEEK_SET);\n\n    if (unlikely(res == -1)) {\n        result.error = true;\n        result.error_code = errno;\n        result.erroring_function = \"lseek\";\n\n        close(result.file_handle);\n\n        return result;\n    }\n\n    result.data = (unsigned char const *)mmap(NULL, result.file_size, PROT_READ, MAP_PRIVATE, result.file_handle, 0);\n\n    if (unlikely(result.data == MAP_FAILED)) {\n        result.error = true;\n        result.error_code = errno;\n        result.erroring_function = \"mmap\";\n\n        close(result.file_handle);\n\n        return result;\n    }\n\n    result.error = false;\n    return result;\n}\n\nstatic void unmapFileFromMemory(struct MapFileToMemoryInfo *mapped_file) {\n    assert(!mapped_file->error);\n\n    munmap((void *)mapped_file->data, mapped_file->file_size);\n    close(mapped_file->file_handle);\n}\n#endif\n\nuint32_t getFileCRC32(filename_char_t const *filename) {\n    struct MapFileToMemoryInfo mapped_file = mapFileToMemory(filename);\n\n    if (mapped_file.error) {\n        return 0;\n    }\n    uint32_t result = calcCRC32(mapped_file.data, (long)mapped_file.file_size);\n\n    // Lets reserve \"0\" value for error indication.\n    if (result == 0) {\n        result = 1;\n    }\n\n    unmapFileFromMemory(&mapped_file);\n\n    return result;\n}\n\n#ifdef _WIN32\n\nstatic DWORD Nuitka_GetFinalPathNameByHandleW(HANDLE hFile, LPWSTR FilePath, DWORD cchFilePath, DWORD dwFlags) {\n    typedef DWORD(WINAPI * pfnGetFinalPathNameByHandleW)(HANDLE hFile, LPWSTR FilePath, DWORD cchFilePath,\n                                                         DWORD dwFlags);\n\n    pfnGetFinalPathNameByHandleW fnGetFinalPathNameByHandleW =\n        (pfnGetFinalPathNameByHandleW)GetProcAddress(GetModuleHandleA(\"Kernel32.dll\"), \"GetFinalPathNameByHandleW\");\n\n    if (fnGetFinalPathNameByHandleW != NULL) {\n        return fnGetFinalPathNameByHandleW(hFile, FilePath, cchFilePath, dwFlags);\n    } else {\n        // There are no symlinks before Windows Vista.\n        return 0;\n    }\n}\n\nstatic void resolveFileSymbolicLink(wchar_t *resolved_filename, wchar_t const *filename, DWORD resolved_filename_size,\n                                    bool resolve_symlinks) {\n    // Resolve any symbolic links in the filename.\n    // Copies the resolved path over the top of the parameter.\n\n    if (resolve_symlinks) {\n        // Open the file in the most non-exclusive way possible\n        HANDLE file_handle = CreateFileW(filename, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,\n                                         OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\n        if (unlikely(file_handle == INVALID_HANDLE_VALUE)) {\n            abort();\n        }\n\n        // In case, the Windows API for symlinks does not yet exist, just used\n        // the unresolved one.\n        copyStringSafeW(resolved_filename, filename, resolved_filename_size);\n\n        // Resolve the path, get the result with a drive letter\n        DWORD len = Nuitka_GetFinalPathNameByHandleW(file_handle, resolved_filename, resolved_filename_size,\n                                                     FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);\n\n        CloseHandle(file_handle);\n\n        if (unlikely(len >= resolved_filename_size)) {\n            abort();\n        }\n\n        // Avoid network filenames added by just the resolution, revert it if\n        // they are pointing to local drive.\n        if (wcsncmp(resolved_filename, L\"\\\\\\\\?\\\\\", 4) == 0) {\n            if (wcscmp(resolved_filename + 4, filename) == 0) {\n                copyStringSafeW(resolved_filename, filename, resolved_filename_size);\n            } else if (resolved_filename[5] == L':') {\n                copyStringSafeW(resolved_filename, resolved_filename + 4, resolved_filename_size);\n            }\n        }\n\n        // Avoid network filenames with UNC prefix, they won't work for loading\n        // extension modules and other things, Python avoids them too.\n        if (wcsncmp(resolved_filename, L\"\\\\\\\\?\\\\UNC\\\\\", 8) == 0) {\n            copyStringSafeW(resolved_filename, resolved_filename + 6, resolved_filename_size);\n            resolved_filename[0] = L'\\\\';\n        }\n\n    } else {\n        copyStringSafeW(resolved_filename, filename, resolved_filename_size);\n    }\n}\n\n#else\n\nstatic void resolveFileSymbolicLink(char *resolved_filename, char const *filename, size_t resolved_filename_size,\n                                    bool resolve_symlinks) {\n    if (resolve_symlinks) {\n        // At least on macOS, realpath cannot allocate a buffer, itself, so lets\n        // use a local one, only on Linux we could use NULL argument and have a\n        // malloc of the resulting value.\n        char buffer[MAXPATHLEN];\n\n        char *result = realpath(filename, buffer);\n\n        if (unlikely(result == NULL)) {\n            abort();\n        }\n\n        copyStringSafe(resolved_filename, buffer, resolved_filename_size);\n    } else {\n        copyStringSafe(resolved_filename, filename, resolved_filename_size);\n    }\n}\n#endif\n\n#ifdef _WIN32\nwchar_t const *getBinaryFilenameWideChars(bool resolve_symlinks) {\n    static wchar_t binary_filename[MAXPATHLEN + 1];\n    static bool init_done = false;\n\n    if (init_done == false) {\n        DWORD res = GetModuleFileNameW(NULL, binary_filename, sizeof(binary_filename) / sizeof(wchar_t));\n        assert(res != 0);\n\n        // Resolve any symlinks we were invoked via\n        resolveFileSymbolicLink(binary_filename, binary_filename, sizeof(binary_filename) / sizeof(wchar_t),\n                                resolve_symlinks);\n    }\n\n    return binary_filename;\n}\n#endif\n\n#ifdef _WIN32\nextern wchar_t const *getBinaryFilenameWideChars(bool resolve_symlinks);\n\nchar const *getBinaryFilenameHostEncoded(bool resolve_symlinks) {\n    static char *binary_filename = NULL;\n    static char *binary_filename_resolved = NULL;\n\n    char *binary_filename_target;\n\n    if (resolve_symlinks) {\n        binary_filename_target = binary_filename_resolved;\n    } else {\n        binary_filename_target = binary_filename;\n    }\n\n    if (binary_filename_target != NULL) {\n        return binary_filename_target;\n    }\n    wchar_t const *w = getBinaryFilenameWideChars(resolve_symlinks);\n\n    DWORD bufsize = WideCharToMultiByte(CP_ACP, 0, w, -1, NULL, 0, NULL, NULL);\n    assert(bufsize != 0);\n\n    binary_filename_target = (char *)malloc(bufsize + 1);\n    assert(binary_filename_target);\n\n    DWORD res2 = WideCharToMultiByte(CP_ACP, 0, w, -1, binary_filename_target, bufsize, NULL, NULL);\n    assert(res2 != 0);\n\n    if (unlikely(res2 > bufsize)) {\n        abort();\n    }\n\n    return (char const *)binary_filename_target;\n}\n\n#else\nchar const *getBinaryFilenameHostEncoded(bool resolve_symlinks) {\n    const int buffer_size = MAXPATHLEN + 1;\n\n    static char binary_filename[MAXPATHLEN + 1] = {0};\n    static char binary_filename_resolved[MAXPATHLEN + 1] = {0};\n\n    char *binary_filename_target;\n\n    if (resolve_symlinks) {\n        binary_filename_target = binary_filename_resolved;\n    } else {\n        binary_filename_target = binary_filename;\n    }\n\n    if (*binary_filename_target != 0) {\n        return binary_filename_target;\n    }\n\n#if defined(__APPLE__)\n    uint32_t bufsize = buffer_size;\n    int res = _NSGetExecutablePath(binary_filename_target, &bufsize);\n\n    if (unlikely(res != 0)) {\n        abort();\n    }\n\n    // Resolve any symlinks we were invoked via\n    resolveFileSymbolicLink(binary_filename_target, binary_filename_target, buffer_size, resolve_symlinks);\n\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n    /* Not all of FreeBSD has /proc file system, so use the appropriate\n     * \"sysctl\" instead.\n     */\n    int mib[4];\n    mib[0] = CTL_KERN;\n    mib[1] = KERN_PROC;\n    mib[2] = KERN_PROC_PATHNAME;\n    mib[3] = -1;\n    size_t cb = buffer_size;\n    int res = sysctl(mib, 4, binary_filename_target, &cb, NULL, 0);\n\n    if (unlikely(res != 0)) {\n        abort();\n    }\n\n    // Resolve any symlinks we were invoked via\n    resolveFileSymbolicLink(binary_filename_target, binary_filename_target, buffer_size, resolve_symlinks);\n#else\n    /* The remaining platforms, mostly Linux or compatible. */\n\n    /* The \"readlink\" call does not terminate result, so fill zeros there, then\n     * it is a proper C string right away. */\n    memset(binary_filename_target, 0, buffer_size);\n    ssize_t res = readlink(\"/proc/self/exe\", binary_filename_target, buffer_size - 1);\n\n    if (unlikely(res == -1)) {\n        abort();\n    }\n\n    // Resolve any symlinks we were invoked via\n    resolveFileSymbolicLink(binary_filename_target, binary_filename_target, buffer_size, resolve_symlinks);\n#endif\n\n    return binary_filename_target;\n}\n#endif\n\n#if defined(_WIN32)\n\n// Note: Keep this separate line, must be included before other Windows headers.\n#include <windows.h>\n\n#include <shlobj.h>\n#include <shlwapi.h>\n\n// For less complete C compilers.\n#ifndef CSIDL_LOCAL_APPDATA\n#define CSIDL_LOCAL_APPDATA 28\n#endif\n#ifndef CSIDL_PROFILE\n#define CSIDL_PROFILE 40\n#endif\n\n// spell-checker: ignore csidl\n\nstatic bool appendStringCSIDLPathW(wchar_t *target, int csidl_id, size_t buffer_size) {\n    wchar_t path_buffer[MAX_PATH];\n#if !defined(_M_ARM64)\n    int res = SHGetFolderPathW(NULL, csidl_id, NULL, 0, path_buffer);\n\n    if (res != S_OK) {\n        return false;\n    }\n#else\n    // spell-checker: ignore USERPROFILE,LOCALAPPDATA\n\n    DWORD res = 0;\n    if (csidl_id == CSIDL_PROFILE) {\n        res = GetEnvironmentVariableW(L\"USERPROFILE\", path_buffer, sizeof(path_buffer));\n    } else if (csidl_id == CSIDL_LOCAL_APPDATA) {\n        res = GetEnvironmentVariableW(L\"LOCALAPPDATA\", path_buffer, sizeof(path_buffer));\n    }\n\n    if (res == 0 || res > sizeof(path_buffer)) {\n        return false;\n    }\n#endif\n    appendWStringSafeW(target, path_buffer, buffer_size);\n\n    return true;\n}\n\nbool expandTemplatePathW(wchar_t *target, wchar_t const *source, size_t buffer_size) {\n    target[0] = 0;\n\n    wchar_t var_name[1024];\n    wchar_t *w = NULL;\n\n    bool var_started = false;\n\n    while (*source != 0) {\n        if (*source == L'{') {\n            assert(var_started == false);\n            var_started = true;\n\n            w = var_name;\n            *w = 0;\n\n            source++;\n\n            continue;\n        } else if (*source == L'}') {\n            assert(var_started == true);\n            var_started = false;\n\n            *w = 0;\n\n            bool is_path = false;\n\n            if (wcsicmp(var_name, L\"TEMP\") == 0) {\n                GetTempPathW((DWORD)buffer_size, target);\n                is_path = true;\n            } else if (wcsicmp(var_name, L\"PROGRAM\") == 0) {\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1\n                appendWStringSafeW(target, __wargv[0], buffer_size);\n#else\n                if (!GetModuleFileNameW(NULL, target, (DWORD)buffer_size)) {\n                    return false;\n                }\n#endif\n            } else if (wcsicmp(var_name, L\"PROGRAM_BASE\") == 0) {\n                if (expandTemplatePathW(target, L\"{PROGRAM}\", buffer_size - wcslen(target)) == false) {\n                    return false;\n                }\n\n                size_t length = wcslen(target);\n\n                if ((length >= 4) && (wcsicmp(target + length - 4, L\".exe\") == 0)) {\n                    target[length - 4] = 0;\n                }\n            } else if (wcsicmp(var_name, L\"PID\") == 0) {\n                char pid_buffer[128];\n                snprintf(pid_buffer, sizeof(pid_buffer), \"%ld\", GetCurrentProcessId());\n\n                appendStringSafeW(target, pid_buffer, buffer_size);\n            } else if (wcsicmp(var_name, L\"HOME\") == 0) {\n                if (appendStringCSIDLPathW(target, CSIDL_PROFILE, buffer_size) == false) {\n                    return false;\n                }\n                is_path = true;\n            } else if (wcsicmp(var_name, L\"CACHE_DIR\") == 0) {\n                if (appendStringCSIDLPathW(target, CSIDL_LOCAL_APPDATA, buffer_size) == false) {\n                    return false;\n                }\n                is_path = true;\n#ifdef NUITKA_COMPANY_NAME\n            } else if (wcsicmp(var_name, L\"COMPANY\") == 0) {\n                appendWStringSafeW(target, L\"\" NUITKA_COMPANY_NAME, buffer_size);\n#endif\n#ifdef NUITKA_PRODUCT_NAME\n            } else if (wcsicmp(var_name, L\"PRODUCT\") == 0) {\n                appendWStringSafeW(target, L\"\" NUITKA_PRODUCT_NAME, buffer_size);\n#endif\n#ifdef NUITKA_VERSION_COMBINED\n            } else if (wcsicmp(var_name, L\"VERSION\") == 0) {\n                appendWStringSafeW(target, L\"\" NUITKA_VERSION_COMBINED, buffer_size);\n#endif\n            } else if (wcsicmp(var_name, L\"TIME\") == 0) {\n                char time_buffer[1024];\n\n                // spell-checker: ignore LPFILETIME\n                __int64 time = 0;\n                assert(sizeof(time) == sizeof(FILETIME));\n                GetSystemTimeAsFileTime((LPFILETIME)&time);\n\n                snprintf(time_buffer, sizeof(time_buffer), \"%lld\", time);\n\n                appendStringSafeW(target, time_buffer, buffer_size);\n            } else {\n                return false;\n            }\n\n            // Skip over appended stuff.\n            while (*target) {\n                target++;\n                buffer_size -= 1;\n            }\n\n            if (is_path) {\n                while (*(target - 1) == FILENAME_SEP_CHAR) {\n                    target--;\n                    *target = 0;\n                    buffer_size += 1;\n                }\n            }\n\n            w = NULL;\n            source++;\n\n            continue;\n        }\n\n        if (w != NULL) {\n            *w++ = *source++;\n            continue;\n        }\n\n        if (buffer_size < 1) {\n            return false;\n        }\n\n        *target++ = *source++;\n        *target = 0;\n        buffer_size -= 1;\n    }\n\n    *target = 0;\n\n    assert(var_started == false);\n    return true;\n}\n\n#else\n\nbool expandTemplatePath(char *target, char const *source, size_t buffer_size) {\n    target[0] = 0;\n\n    char var_name[1024];\n    char *w = NULL;\n\n    NUITKA_MAY_BE_UNUSED bool var_started = false;\n\n    while (*source != 0) {\n        if (*source == '{') {\n            assert(var_started == false);\n            var_started = true;\n\n            w = var_name;\n            *w = 0;\n\n            source++;\n\n            continue;\n        } else if (*source == '}') {\n            assert(var_started == true);\n            var_started = false;\n            *w = 0;\n\n            bool is_path = false;\n\n            if (strcasecmp(var_name, \"TEMP\") == 0) {\n                char const *tmp_dir = getenv(\"TMPDIR\");\n                if (tmp_dir == NULL) {\n                    tmp_dir = \"/tmp\";\n                }\n\n                appendStringSafe(target, tmp_dir, buffer_size);\n                is_path = true;\n            } else if (strcasecmp(var_name, \"PROGRAM\") == 0) {\n                char const *exe_name = getBinaryFilenameHostEncoded(false);\n\n                appendStringSafe(target, exe_name, buffer_size);\n            } else if (strcasecmp(var_name, \"PROGRAM_BASE\") == 0) {\n                if (expandTemplatePath(target, \"{PROGRAM}\", buffer_size - strlen(target)) == false) {\n                    return false;\n                }\n\n                size_t length = strlen(target);\n\n                if ((length >= 4) && (strcasecmp(target + length - 4, \".bin\") == 0)) {\n                    target[length - 4] = 0;\n                }\n            } else if (strcasecmp(var_name, \"PID\") == 0) {\n                char pid_buffer[128];\n\n                snprintf(pid_buffer, sizeof(pid_buffer), \"%d\", getpid());\n\n                appendStringSafe(target, pid_buffer, buffer_size);\n            } else if (strcasecmp(var_name, \"HOME\") == 0) {\n                char const *home_path = getenv(\"HOME\");\n\n                if (home_path == NULL) {\n                    struct passwd *pw_data = getpwuid(getuid());\n\n                    if (unlikely(pw_data == NULL)) {\n                        return false;\n                    }\n\n                    home_path = pw_data->pw_dir;\n                }\n\n                appendStringSafe(target, home_path, buffer_size);\n                is_path = true;\n            } else if (strcasecmp(var_name, \"CACHE_DIR\") == 0) {\n                char const *xdg_cache_home = getenv(\"XDG_CACHE_HOME\");\n\n                if (xdg_cache_home != NULL && xdg_cache_home[0] == '/') {\n                    appendStringSafe(target, xdg_cache_home, buffer_size);\n                } else {\n                    if (expandTemplatePath(target, \"{HOME}/.cache\", buffer_size - strlen(target)) == false) {\n                        return false;\n                    }\n                }\n                is_path = true;\n#ifdef NUITKA_COMPANY_NAME\n            } else if (strcasecmp(var_name, \"COMPANY\") == 0) {\n                appendStringSafe(target, NUITKA_COMPANY_NAME, buffer_size);\n#endif\n#ifdef NUITKA_PRODUCT_NAME\n            } else if (strcasecmp(var_name, \"PRODUCT\") == 0) {\n                appendStringSafe(target, NUITKA_PRODUCT_NAME, buffer_size);\n#endif\n#ifdef NUITKA_VERSION_COMBINED\n            } else if (strcasecmp(var_name, \"VERSION\") == 0) {\n                appendStringSafe(target, NUITKA_VERSION_COMBINED, buffer_size);\n#endif\n            } else if (strcasecmp(var_name, \"TIME\") == 0) {\n                char time_buffer[1024];\n\n                struct timeval current_time;\n                gettimeofday(&current_time, NULL);\n                snprintf(time_buffer, sizeof(time_buffer), \"%ld_%ld\", current_time.tv_sec, (long)current_time.tv_usec);\n\n                appendStringSafe(target, time_buffer, buffer_size);\n            } else {\n                return false;\n            }\n            // Skip over appended stuff.\n            while (*target) {\n                target++;\n                buffer_size -= 1;\n            }\n\n            if (is_path) {\n                while (*(target - 1) == FILENAME_SEP_CHAR) {\n                    target--;\n                    *target = 0;\n                    buffer_size += 1;\n                }\n            }\n\n            w = NULL;\n            source++;\n\n            continue;\n        }\n\n        if (w != NULL) {\n            *w++ = *source++;\n            continue;\n        }\n\n        if (buffer_size < 1) {\n            return false;\n        }\n\n        *target++ = *source++;\n        *target = 0;\n        buffer_size -= 1;\n    }\n\n    *target = 0;\n\n    assert(var_started == false);\n    return true;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersFloats.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These helpers are used to work with float values.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPyObject *TO_FLOAT(PyObject *value) {\n    PyObject *result;\n\n#if PYTHON_VERSION < 0x300\n    if (PyString_CheckExact(value)) {\n        result = PyFloat_FromString(value, NULL);\n    }\n#else\n    if (PyUnicode_CheckExact(value)) {\n        result = PyFloat_FromString(value);\n    }\n#endif\n    else {\n        result = PyNumber_Float(value);\n    }\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\n#if NUITKA_FLOAT_HAS_FREELIST\n\nstatic struct _Py_float_state *_Nuitka_Py_get_float_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->float_state;\n}\n\nstatic PyFloatObject *_Nuitka_AllocatePyFloatObject(void) {\n    struct _Py_float_state *state = _Nuitka_Py_get_float_state();\n\n    PyFloatObject *result_float = state->free_list;\n\n    if (result_float) {\n        state->free_list = (PyFloatObject *)Py_TYPE(result_float);\n        state->numfree -= 1;\n\n        Py_SET_TYPE(result_float, &PyFloat_Type);\n    } else {\n        result_float = (PyFloatObject *)PyObject_Malloc(sizeof(PyFloatObject));\n    }\n\n    Py_SET_TYPE(result_float, &PyFloat_Type);\n    Nuitka_Py_NewReference((PyObject *)result_float);\n    assert(result_float != NULL);\n\n    return result_float;\n}\n\nPyObject *MAKE_FLOAT_FROM_DOUBLE(double value) {\n    PyFloatObject *result = _Nuitka_AllocatePyFloatObject();\n\n    PyFloat_SET_DOUBLE(result, value);\n    return (PyObject *)result;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersHeapStorage.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For making \"yield\" and \"yield from\" capable of persisting current C stack.\n *\n * These copy objects pointed to into an array foreseen for this task.\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nvoid Nuitka_PreserveHeap(void *dest, ...) {\n    va_list(ap);\n    va_start(ap, dest);\n\n    char *w = (char *)dest;\n\n    for (;;) {\n        void *source = va_arg(ap, void *);\n        if (source == NULL) {\n            break;\n        }\n\n        size_t size = va_arg(ap, size_t);\n        memcpy(w, source, size);\n        w += size;\n    }\n}\n\nvoid Nuitka_RestoreHeap(void *source, ...) {\n    va_list(ap);\n    va_start(ap, source);\n\n    char *w = (char *)source;\n\n    for (;;) {\n        void *dest = va_arg(ap, void *);\n        if (dest == NULL) {\n            break;\n        }\n\n        size_t size = va_arg(ap, size_t);\n        memcpy(dest, w, size);\n        w += size;\n    }\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersImport.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** For making imports work.\n *\n * These make the actual built-in importing mechanic work with Nuitka. We\n * provide code to import modules and names from modules, also the mechanic\n * for star imports to look at \"__all__\".\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nNUITKA_DEFINE_BUILTIN(__import__);\n\nPyObject *IMPORT_MODULE_KW(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                           PyObject *import_items, PyObject *level) {\n    CHECK_OBJECT_X(module_name);\n    CHECK_OBJECT_X(globals);\n    CHECK_OBJECT_X(locals);\n    CHECK_OBJECT_X(import_items);\n    CHECK_OBJECT_X(level);\n\n    PyObject *kw_pairs[5 * 2] = {const_str_plain_name,   module_name, const_str_plain_globals,  globals,\n                                 const_str_plain_locals, locals,      const_str_plain_fromlist, import_items,\n                                 const_str_plain_level,  level};\n    PyObject *kw_args = MAKE_DICT_X(kw_pairs, 5);\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n\n    PyObject *import_result = CALL_FUNCTION_WITH_KEYARGS(tstate, NUITKA_ACCESS_BUILTIN(__import__), kw_args);\n\n    Py_DECREF(kw_args);\n\n    return import_result;\n}\n\nPyObject *IMPORT_MODULE1(PyThreadState *tstate, PyObject *module_name) {\n    CHECK_OBJECT(module_name);\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n\n    PyObject *import_result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, NUITKA_ACCESS_BUILTIN(__import__), module_name);\n\n    return import_result;\n}\n\nPyObject *IMPORT_MODULE2(PyThreadState *tstate, PyObject *module_name, PyObject *globals) {\n    CHECK_OBJECT(module_name);\n    CHECK_OBJECT(globals);\n\n    PyObject *pos_args[] = {module_name, globals};\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n\n    PyObject *import_result = CALL_FUNCTION_WITH_ARGS2(tstate, NUITKA_ACCESS_BUILTIN(__import__), pos_args);\n\n    return import_result;\n}\n\nPyObject *IMPORT_MODULE3(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals) {\n    CHECK_OBJECT(module_name);\n    CHECK_OBJECT(globals);\n    CHECK_OBJECT(locals);\n\n    PyObject *pos_args[] = {module_name, globals, locals};\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n\n    PyObject *import_result = CALL_FUNCTION_WITH_ARGS3(tstate, NUITKA_ACCESS_BUILTIN(__import__), pos_args);\n\n    return import_result;\n}\n\nPyObject *IMPORT_MODULE4(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                         PyObject *import_items) {\n    CHECK_OBJECT(module_name);\n    CHECK_OBJECT(globals);\n    CHECK_OBJECT(locals);\n    CHECK_OBJECT(import_items);\n\n    PyObject *pos_args[] = {module_name, globals, locals, import_items};\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n\n    PyObject *import_result = CALL_FUNCTION_WITH_ARGS4(tstate, NUITKA_ACCESS_BUILTIN(__import__), pos_args);\n\n    return import_result;\n}\n\nPyObject *IMPORT_MODULE5(PyThreadState *tstate, PyObject *module_name, PyObject *globals, PyObject *locals,\n                         PyObject *import_items, PyObject *level) {\n    CHECK_OBJECT(module_name);\n    CHECK_OBJECT(globals);\n    CHECK_OBJECT(locals);\n    CHECK_OBJECT(import_items);\n    CHECK_OBJECT(level);\n\n    PyObject *pos_args[] = {module_name, globals, locals, import_items, level};\n\n    NUITKA_ASSIGN_BUILTIN(__import__);\n    PyObject *import_function = NUITKA_ACCESS_BUILTIN(__import__);\n\n// TODO: This should be reserved for the import statements, but not for\n// the import built-in, we have to make a difference there with 3.10 to\n// be compatible.\n#if PYTHON_VERSION >= 0x3a0 && 0\n    // Fast path for default \"__import__\" avoids function call.\n    if (import_function == tstate->interp->import_func) {\n        int level_int = _PyLong_AsInt(level);\n\n        if (level_int == -1 && HAS_ERROR_OCCURRED(tstate)) {\n            return NULL;\n        }\n\n        return PyImport_ImportModuleLevelObject(module_name, globals, locals, import_items, level_int);\n    }\n#endif\n\n    PyObject *import_result = CALL_FUNCTION_WITH_ARGS5(tstate, import_function, pos_args);\n\n    return import_result;\n}\n\nbool IMPORT_MODULE_STAR(PyThreadState *tstate, PyObject *target, bool is_module, PyObject *module) {\n    // Check parameters.\n    CHECK_OBJECT(module);\n    CHECK_OBJECT(target);\n\n    PyObject *iter;\n    bool all_case;\n\n    PyObject *all = PyObject_GetAttr(module, const_str_plain___all__);\n    if (all != NULL) {\n        iter = MAKE_ITERATOR(tstate, all);\n        Py_DECREF(all);\n\n        if (unlikely(iter == NULL)) {\n            return false;\n        }\n\n        all_case = true;\n    } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        iter = MAKE_ITERATOR(tstate, PyModule_GetDict(module));\n        CHECK_OBJECT(iter);\n\n        all_case = false;\n    } else {\n        return false;\n    }\n\n    for (;;) {\n        PyObject *item = ITERATOR_NEXT(iter);\n        if (item == NULL) {\n            break;\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (unlikely(PyString_Check(item) == false && PyUnicode_Check(item) == false))\n#else\n        if (unlikely(PyUnicode_Check(item) == false))\n#endif\n        {\n            PyErr_Format(PyExc_TypeError, \"attribute name must be string, not '%s'\", Py_TYPE(item)->tp_name);\n            break;\n        }\n\n        // When we are not using the \"__all__\", we should skip private variables.\n        if (all_case == false) {\n            PyObject *startswith_value;\n#if PYTHON_VERSION < 0x300\n            if (PyString_Check(item)) {\n                startswith_value = STR_STARTSWITH2(tstate, item, const_str_underscore);\n            } else {\n                startswith_value = UNICODE_STARTSWITH2(tstate, item, const_str_underscore);\n            }\n#else\n            startswith_value = UNICODE_STARTSWITH2(tstate, item, const_str_underscore);\n#endif\n\n            CHECK_OBJECT(startswith_value);\n            Py_DECREF(startswith_value);\n\n            if (startswith_value == Py_True) {\n                continue;\n            }\n        }\n\n        PyObject *value = LOOKUP_ATTRIBUTE(tstate, module, item);\n\n        // Might not exist, because of e.g. wrong \"__all__\" value.\n        if (unlikely(value == NULL)) {\n            Py_DECREF(item);\n            break;\n        }\n\n        // TODO: Check if the reference is handled correctly\n        if (is_module) {\n            SET_ATTRIBUTE(tstate, target, item, value);\n        } else {\n            SET_SUBSCRIPT(tstate, target, item, value);\n        }\n\n        Py_DECREF(value);\n        Py_DECREF(item);\n    }\n\n    Py_DECREF(iter);\n\n    return !HAS_ERROR_OCCURRED(tstate);\n}\n\nPyObject *IMPORT_NAME_FROM_MODULE(PyThreadState *tstate, PyObject *module, PyObject *import_name) {\n    CHECK_OBJECT(module);\n    CHECK_OBJECT(import_name);\n\n    PyObject *result = PyObject_GetAttr(module, import_name);\n\n    if (unlikely(result == NULL)) {\n        if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate)) {\n#if PYTHON_VERSION >= 0x370\n            PyObject *filename = Nuitka_GetFilenameObject(tstate, module);\n\n            PyObject *name = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___name__);\n            if (name == NULL) {\n                name = PyUnicode_FromString(\"<unknown module name>\");\n            }\n\n            PyErr_Format(PyExc_ImportError, \"cannot import name %R from %R (%S)\", import_name, name, filename);\n\n            Py_DECREF(filename);\n            Py_DECREF(name);\n\n#elif PYTHON_VERSION >= 0x340 || !defined(_NUITKA_FULL_COMPAT)\n            PyErr_Format(PyExc_ImportError, \"cannot import name '%s'\", Nuitka_String_AsString(import_name));\n#else\n            PyErr_Format(PyExc_ImportError, \"cannot import name %s\", Nuitka_String_AsString(import_name));\n#endif\n        }\n\n        return NULL;\n    }\n\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x350\n\nstatic PyObject *resolveParentModuleName(PyThreadState *tstate, PyObject *module, PyObject *name, int level) {\n    PyObject *globals = PyModule_GetDict(module);\n\n    CHECK_OBJECT(globals);\n\n    if (unlikely(!PyDict_Check(globals))) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"globals must be a dict\");\n        return NULL;\n    }\n\n    PyObject *package = DICT_GET_ITEM0(tstate, globals, const_str_plain___package__);\n\n    if (unlikely(package == NULL && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (package == Py_None) {\n        package = NULL;\n    }\n\n    PyObject *spec = DICT_GET_ITEM0(tstate, globals, const_str_plain___spec__);\n\n    if (unlikely(spec == NULL && HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (package != NULL) {\n        if (!PyUnicode_Check(package)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"package must be a string\");\n            return NULL;\n        }\n\n        // Compare with spec.\n        if (spec != NULL && spec != Py_None) {\n            PyObject *parent = PyObject_GetAttr(spec, const_str_plain_parent);\n\n            if (unlikely(parent == NULL)) {\n                return NULL;\n            }\n\n            nuitka_bool nbool_equal = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(package, parent);\n\n            Py_DECREF(parent);\n\n            if (unlikely(nbool_equal == NUITKA_BOOL_EXCEPTION)) {\n                return NULL;\n            }\n\n            if (unlikely(nbool_equal == NUITKA_BOOL_FALSE)) {\n                if (PyErr_WarnEx(PyExc_ImportWarning, \"__package__ != __spec__.parent\", 1) < 0) {\n                    return NULL;\n                }\n            }\n        }\n\n        Py_INCREF(package);\n    } else if (spec != NULL && spec != Py_None) {\n        package = PyObject_GetAttr(spec, const_str_plain_parent);\n\n        if (unlikely(package == NULL)) {\n            return NULL;\n        }\n\n        if (unlikely(!PyUnicode_Check(package))) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__spec__.parent must be a string\");\n            return NULL;\n        }\n    } else {\n        if (PyErr_WarnEx(PyExc_ImportWarning,\n                         \"can't resolve package from __spec__ or __package__, \"\n                         \"falling back on __name__ and __path__\",\n                         1) < 0) {\n            return NULL;\n        }\n\n        package = DICT_GET_ITEM0(tstate, globals, const_str_plain___name__);\n\n        if (unlikely(package == NULL && !HAS_ERROR_OCCURRED(tstate))) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_KeyError, \"'__name__' not in globals\");\n            return NULL;\n        }\n\n        if (!PyUnicode_Check(package)) {\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"__name__ must be a string\");\n            return NULL;\n        }\n\n        // Detect package from __path__ presence.\n        if (DICT_HAS_ITEM(tstate, globals, const_str_plain___path__) == 1) {\n            Py_ssize_t dot = PyUnicode_FindChar(package, '.', 0, PyUnicode_GET_LENGTH(package), -1);\n\n            if (unlikely(dot == -2)) {\n                return NULL;\n            }\n\n            if (unlikely(dot == -1)) {\n                // NULL without error means it just didn't work.\n                return NULL;\n            }\n\n            PyObject *substr = PyUnicode_Substring(package, 0, dot);\n            if (unlikely(substr == NULL)) {\n                return NULL;\n            }\n\n            package = substr;\n        } else {\n            Py_INCREF(package);\n        }\n    }\n\n    Py_ssize_t last_dot = PyUnicode_GET_LENGTH(package);\n\n    if (unlikely(last_dot == 0)) {\n        Py_DECREF(package);\n\n        // NULL without error means it just didn't work.\n        return NULL;\n    }\n\n    for (int level_up = 1; level_up < level; level_up += 1) {\n        last_dot = PyUnicode_FindChar(package, '.', 0, last_dot, -1);\n        if (last_dot == -2) {\n            Py_DECREF(package);\n            return NULL;\n        } else if (last_dot == -1) {\n            Py_DECREF(package);\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                            \"attempted relative import beyond top-level package\");\n            return NULL;\n        }\n    }\n\n    PyObject *base = PyUnicode_Substring(package, 0, last_dot);\n\n    Py_DECREF(package);\n\n    if (unlikely(base == NULL || PyUnicode_GET_LENGTH(name) == 0)) {\n        return base;\n    }\n\n    PyObject *abs_name = PyUnicode_FromFormat(\"%U.%U\", base, name);\n    Py_DECREF(base);\n\n    return abs_name;\n}\n\nPyObject *IMPORT_NAME_OR_MODULE(PyThreadState *tstate, PyObject *module, PyObject *globals, PyObject *import_name,\n                                PyObject *level) {\n    CHECK_OBJECT(module);\n    CHECK_OBJECT(import_name);\n\n    PyObject *result = PyObject_GetAttr(module, import_name);\n\n    if (unlikely(result == NULL)) {\n        if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n\n            long level_int = PyLong_AsLong(level);\n\n            if (unlikely(level_int == -1 && HAS_ERROR_OCCURRED(tstate))) {\n                return NULL;\n            }\n\n            if (unlikely(level_int < 0)) {\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"level must be >= 0\");\n                return NULL;\n            }\n\n            if (level_int > 0) {\n                PyObject *fromlist = MAKE_TUPLE1(import_name);\n\n                result = IMPORT_MODULE5(tstate, const_str_empty, globals, globals, fromlist, level);\n\n                Py_DECREF(fromlist);\n\n                // Look up in \"sys.modules\", because we will have returned the\n                // package of it from IMPORT_MODULE5.\n                PyObject *name = PyUnicode_FromFormat(\"%s.%S\", PyModule_GetName(result), import_name);\n\n                if (result != NULL) {\n                    Py_DECREF(result);\n\n                    result = Nuitka_GetModule(tstate, name);\n                }\n\n                Py_DECREF(name);\n            } else {\n                PyObject *name = resolveParentModuleName(tstate, module, import_name, level_int);\n\n                if (name == NULL) {\n                    if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                        return NULL;\n                    }\n                } else {\n                    result = IMPORT_MODULE5(tstate, name, globals, globals, const_tuple_empty, level);\n\n                    if (result != NULL) {\n                        Py_DECREF(result);\n\n                        // Look up in \"sys.modules\", because we will have returned the\n                        result = Nuitka_GetModule(tstate, name);\n                        Py_DECREF(name);\n                    }\n                }\n            }\n\n            if (result == NULL) {\n                CLEAR_ERROR_OCCURRED(tstate);\n\n                result = IMPORT_NAME_FROM_MODULE(tstate, module, import_name);\n            }\n        }\n    }\n\n    CHECK_OBJECT(import_name);\n\n    return result;\n}\n#endif\n\nPyObject *IMPORT_MODULE_FIXED(PyThreadState *tstate, PyObject *module_name, PyObject *value_name) {\n    PyObject *import_result = IMPORT_MODULE1(tstate, module_name);\n\n    if (unlikely(import_result == NULL)) {\n        return import_result;\n    }\n\n    PyObject *result = Nuitka_GetModule(tstate, value_name);\n\n    Py_DECREF(import_result);\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersImportHard.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperImportHard.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helper for hard import of module \"__future__\" import. */\nPyObject *IMPORT_HARD___FUTURE__(void) {\n    static PyObject *module_import_hard___future__ = NULL;\n\n    if (module_import_hard___future__ == NULL) {\n        module_import_hard___future__ = PyImport_ImportModule(\"__future__\");\n\n        if (unlikely(module_import_hard___future__ == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of '__future__'\");\n            abort();\n        }\n    }\n\n    return module_import_hard___future__;\n}\n\n/* C helper for hard import of module \"_frozen_importlib\" import. */\n#if PYTHON_VERSION >= 0x300\nPyObject *IMPORT_HARD__FROZEN_IMPORTLIB(void) {\n    static PyObject *module_import_hard__frozen_importlib = NULL;\n\n    if (module_import_hard__frozen_importlib == NULL) {\n        module_import_hard__frozen_importlib = PyImport_ImportModule(\"_frozen_importlib\");\n\n        if (unlikely(module_import_hard__frozen_importlib == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of '_frozen_importlib'\");\n            abort();\n        }\n    }\n\n    return module_import_hard__frozen_importlib;\n}\n#endif\n\n/* C helper for hard import of module \"_frozen_importlib_external\" import. */\n#if PYTHON_VERSION >= 0x350\nPyObject *IMPORT_HARD__FROZEN_IMPORTLIB_EXTERNAL(void) {\n    static PyObject *module_import_hard__frozen_importlib_external = NULL;\n\n    if (module_import_hard__frozen_importlib_external == NULL) {\n        module_import_hard__frozen_importlib_external = PyImport_ImportModule(\"_frozen_importlib_external\");\n\n        if (unlikely(module_import_hard__frozen_importlib_external == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of '_frozen_importlib_external'\");\n            abort();\n        }\n    }\n\n    return module_import_hard__frozen_importlib_external;\n}\n#endif\n\n/* C helper for hard import of module \"_io\" import. */\nPyObject *IMPORT_HARD__IO(void) {\n    static PyObject *module_import_hard__io = NULL;\n\n    if (module_import_hard__io == NULL) {\n        module_import_hard__io = PyImport_ImportModule(\"_io\");\n\n        if (unlikely(module_import_hard__io == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of '_io'\");\n            abort();\n        }\n    }\n\n    return module_import_hard__io;\n}\n\n/* C helper for hard import of module \"builtins\" import. */\nPyObject *IMPORT_HARD_BUILTINS(void) {\n    static PyObject *module_import_hard_builtins = NULL;\n\n    if (module_import_hard_builtins == NULL) {\n        module_import_hard_builtins = PyImport_ImportModule(\"builtins\");\n\n        if (unlikely(module_import_hard_builtins == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'builtins'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_builtins;\n}\n\n/* C helper for hard import of module \"ctypes\" import. */\nPyObject *IMPORT_HARD_CTYPES(void) {\n    static PyObject *module_import_hard_ctypes = NULL;\n\n    if (module_import_hard_ctypes == NULL) {\n        module_import_hard_ctypes = PyImport_ImportModule(\"ctypes\");\n\n        if (unlikely(module_import_hard_ctypes == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'ctypes'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_ctypes;\n}\n\n/* C helper for hard import of module \"ctypes.macholib\" import. */\nPyObject *IMPORT_HARD_CTYPES__MACHOLIB(void) {\n    static PyObject *module_import_hard_ctypes__macholib = NULL;\n\n    if (module_import_hard_ctypes__macholib == NULL) {\n        module_import_hard_ctypes__macholib = PyImport_ImportModule(\"ctypes.macholib\");\n\n        if (unlikely(module_import_hard_ctypes__macholib == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'ctypes.macholib'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_ctypes__macholib;\n}\n\n/* C helper for hard import of module \"ctypes.wintypes\" import. */\n#if defined(_WIN32)\nPyObject *IMPORT_HARD_CTYPES__WINTYPES(void) {\n    static PyObject *module_import_hard_ctypes__wintypes = NULL;\n\n    if (module_import_hard_ctypes__wintypes == NULL) {\n        module_import_hard_ctypes__wintypes = PyImport_ImportModule(\"ctypes.wintypes\");\n\n        if (unlikely(module_import_hard_ctypes__wintypes == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'ctypes.wintypes'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_ctypes__wintypes;\n}\n#endif\n\n/* C helper for hard import of module \"functools\" import. */\nPyObject *IMPORT_HARD_FUNCTOOLS(void) {\n    static PyObject *module_import_hard_functools = NULL;\n\n    if (module_import_hard_functools == NULL) {\n        module_import_hard_functools = PyImport_ImportModule(\"functools\");\n\n        if (unlikely(module_import_hard_functools == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'functools'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_functools;\n}\n\n/* C helper for hard import of module \"importlib\" import. */\nPyObject *IMPORT_HARD_IMPORTLIB(void) {\n    static PyObject *module_import_hard_importlib = NULL;\n\n    if (module_import_hard_importlib == NULL) {\n        module_import_hard_importlib = PyImport_ImportModule(\"importlib\");\n\n        if (unlikely(module_import_hard_importlib == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'importlib'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_importlib;\n}\n\n/* C helper for hard import of module \"importlib.metadata\" import. */\n#if PYTHON_VERSION >= 0x380\nPyObject *IMPORT_HARD_IMPORTLIB__METADATA(void) {\n    static PyObject *module_import_hard_importlib__metadata = NULL;\n\n    if (module_import_hard_importlib__metadata == NULL) {\n        module_import_hard_importlib__metadata = PyImport_ImportModule(\"importlib.metadata\");\n\n        if (unlikely(module_import_hard_importlib__metadata == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'importlib.metadata'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_importlib__metadata;\n}\n#endif\n\n/* C helper for hard import of module \"importlib.resources\" import. */\n#if PYTHON_VERSION >= 0x370\nPyObject *IMPORT_HARD_IMPORTLIB__RESOURCES(void) {\n    static PyObject *module_import_hard_importlib__resources = NULL;\n\n    if (module_import_hard_importlib__resources == NULL) {\n        module_import_hard_importlib__resources = PyImport_ImportModule(\"importlib.resources\");\n\n        if (unlikely(module_import_hard_importlib__resources == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'importlib.resources'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_importlib__resources;\n}\n#endif\n\n/* C helper for hard import of module \"importlib_metadata\" import. */\nPyObject *IMPORT_HARD_IMPORTLIB_METADATA(void) {\n    static PyObject *module_import_hard_importlib_metadata = NULL;\n\n    if (module_import_hard_importlib_metadata == NULL) {\n        module_import_hard_importlib_metadata = PyImport_ImportModule(\"importlib_metadata\");\n\n        if (unlikely(module_import_hard_importlib_metadata == NULL)) {\n            return NULL;\n        }\n    }\n\n    return module_import_hard_importlib_metadata;\n}\n\n/* C helper for hard import of module \"importlib_resources\" import. */\nPyObject *IMPORT_HARD_IMPORTLIB_RESOURCES(void) {\n    static PyObject *module_import_hard_importlib_resources = NULL;\n\n    if (module_import_hard_importlib_resources == NULL) {\n        module_import_hard_importlib_resources = PyImport_ImportModule(\"importlib_resources\");\n\n        if (unlikely(module_import_hard_importlib_resources == NULL)) {\n            return NULL;\n        }\n    }\n\n    return module_import_hard_importlib_resources;\n}\n\n/* C helper for hard import of module \"io\" import. */\nPyObject *IMPORT_HARD_IO(void) {\n    static PyObject *module_import_hard_io = NULL;\n\n    if (module_import_hard_io == NULL) {\n        module_import_hard_io = PyImport_ImportModule(\"io\");\n\n        if (unlikely(module_import_hard_io == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'io'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_io;\n}\n\n/* C helper for hard import of module \"ntpath\" import. */\nPyObject *IMPORT_HARD_NTPATH(void) {\n    static PyObject *module_import_hard_ntpath = NULL;\n\n    if (module_import_hard_ntpath == NULL) {\n        module_import_hard_ntpath = PyImport_ImportModule(\"ntpath\");\n\n        if (unlikely(module_import_hard_ntpath == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'ntpath'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_ntpath;\n}\n\n/* C helper for hard import of module \"os\" import. */\nPyObject *IMPORT_HARD_OS(void) {\n    static PyObject *module_import_hard_os = NULL;\n\n    if (module_import_hard_os == NULL) {\n        module_import_hard_os = PyImport_ImportModule(\"os\");\n\n        if (unlikely(module_import_hard_os == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'os'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_os;\n}\n\n/* C helper for hard import of module \"pkg_resources\" import. */\nPyObject *IMPORT_HARD_PKG_RESOURCES(void) {\n    static PyObject *module_import_hard_pkg_resources = NULL;\n\n    if (module_import_hard_pkg_resources == NULL) {\n        module_import_hard_pkg_resources = PyImport_ImportModule(\"pkg_resources\");\n\n        if (unlikely(module_import_hard_pkg_resources == NULL)) {\n            return NULL;\n        }\n    }\n\n    return module_import_hard_pkg_resources;\n}\n\n/* C helper for hard import of module \"pkgutil\" import. */\nPyObject *IMPORT_HARD_PKGUTIL(void) {\n    static PyObject *module_import_hard_pkgutil = NULL;\n\n    if (module_import_hard_pkgutil == NULL) {\n        module_import_hard_pkgutil = PyImport_ImportModule(\"pkgutil\");\n\n        if (unlikely(module_import_hard_pkgutil == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'pkgutil'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_pkgutil;\n}\n\n/* C helper for hard import of module \"posixpath\" import. */\nPyObject *IMPORT_HARD_POSIXPATH(void) {\n    static PyObject *module_import_hard_posixpath = NULL;\n\n    if (module_import_hard_posixpath == NULL) {\n        module_import_hard_posixpath = PyImport_ImportModule(\"posixpath\");\n\n        if (unlikely(module_import_hard_posixpath == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'posixpath'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_posixpath;\n}\n\n/* C helper for hard import of module \"site\" import. */\nPyObject *IMPORT_HARD_SITE(void) {\n    static PyObject *module_import_hard_site = NULL;\n\n    if (module_import_hard_site == NULL) {\n        module_import_hard_site = PyImport_ImportModule(\"site\");\n\n        if (unlikely(module_import_hard_site == NULL)) {\n            return NULL;\n        }\n    }\n\n    return module_import_hard_site;\n}\n\n/* C helper for hard import of module \"sys\" import. */\nPyObject *IMPORT_HARD_SYS(void) {\n    static PyObject *module_import_hard_sys = NULL;\n\n    if (module_import_hard_sys == NULL) {\n        module_import_hard_sys = PyImport_ImportModule(\"sys\");\n\n        if (unlikely(module_import_hard_sys == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'sys'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_sys;\n}\n\n/* C helper for hard import of module \"sysconfig\" import. */\nPyObject *IMPORT_HARD_SYSCONFIG(void) {\n    static PyObject *module_import_hard_sysconfig = NULL;\n\n    if (module_import_hard_sysconfig == NULL) {\n        module_import_hard_sysconfig = PyImport_ImportModule(\"sysconfig\");\n\n        if (unlikely(module_import_hard_sysconfig == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'sysconfig'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_sysconfig;\n}\n\n/* C helper for hard import of module \"tensorflow\" import. */\nPyObject *IMPORT_HARD_TENSORFLOW(void) {\n    static PyObject *module_import_hard_tensorflow = NULL;\n\n    if (module_import_hard_tensorflow == NULL) {\n        module_import_hard_tensorflow = PyImport_ImportModule(\"tensorflow\");\n\n        if (unlikely(module_import_hard_tensorflow == NULL)) {\n            return NULL;\n        }\n    }\n\n    return module_import_hard_tensorflow;\n}\n\n/* C helper for hard import of module \"types\" import. */\nPyObject *IMPORT_HARD_TYPES(void) {\n    static PyObject *module_import_hard_types = NULL;\n\n    if (module_import_hard_types == NULL) {\n        module_import_hard_types = PyImport_ImportModule(\"types\");\n\n        if (unlikely(module_import_hard_types == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'types'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_types;\n}\n\n/* C helper for hard import of module \"typing\" import. */\n#if PYTHON_VERSION >= 0x350\nPyObject *IMPORT_HARD_TYPING(void) {\n    static PyObject *module_import_hard_typing = NULL;\n\n    if (module_import_hard_typing == NULL) {\n        module_import_hard_typing = PyImport_ImportModule(\"typing\");\n\n        if (unlikely(module_import_hard_typing == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'typing'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_typing;\n}\n#endif\n\n/* C helper for hard import of module \"unittest\" import. */\nPyObject *IMPORT_HARD_UNITTEST(void) {\n    static PyObject *module_import_hard_unittest = NULL;\n\n    if (module_import_hard_unittest == NULL) {\n        module_import_hard_unittest = PyImport_ImportModule(\"unittest\");\n\n        if (unlikely(module_import_hard_unittest == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'unittest'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_unittest;\n}\n\n/* C helper for hard import of module \"unittest.mock\" import. */\n#if PYTHON_VERSION >= 0x300\nPyObject *IMPORT_HARD_UNITTEST__MOCK(void) {\n    static PyObject *module_import_hard_unittest__mock = NULL;\n\n    if (module_import_hard_unittest__mock == NULL) {\n        module_import_hard_unittest__mock = PyImport_ImportModule(\"unittest.mock\");\n\n        if (unlikely(module_import_hard_unittest__mock == NULL)) {\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of 'unittest.mock'\");\n            abort();\n        }\n    }\n\n    return module_import_hard_unittest__mock;\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersJitSources.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#ifdef _NUITKA_STANDALONE\n\nstatic char const *uncompiled_sources_dict_attribute_name = \"_uncompiled_function_sources_dict\";\n\nvoid SET_UNCOMPILED_FUNCTION_SOURCE_DICT(PyObject *name, PyObject *source) {\n    PyObject *uncompiled_function_sources_dict =\n        PyObject_GetAttrString((PyObject *)builtin_module, uncompiled_sources_dict_attribute_name);\n\n    if (uncompiled_function_sources_dict == NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        DROP_ERROR_OCCURRED(tstate);\n\n        uncompiled_function_sources_dict = MAKE_DICT_EMPTY();\n\n        PyObject_SetAttrString((PyObject *)builtin_module, uncompiled_sources_dict_attribute_name,\n                               uncompiled_function_sources_dict);\n    }\n\n    bool res = DICT_SET_ITEM(uncompiled_function_sources_dict, name, source);\n    assert(res == false);\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersLists.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to work with lists.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// #include \"richcomparisons.h\"\n\nstatic PyObject *Nuitka_LongFromCLong(long ival);\n\n#if NUITKA_LIST_HAS_FREELIST\nstatic struct _Py_list_state *_Nuitka_Py_get_list_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->list;\n}\n\nPyObject *MAKE_LIST_EMPTY(Py_ssize_t size) {\n    assert(size >= 0);\n\n    struct _Py_list_state *state = _Nuitka_Py_get_list_state();\n    PyListObject *result_list;\n\n    assert(state->numfree >= 0);\n\n    if (state->numfree) {\n        state->numfree -= 1;\n        result_list = state->free_list[state->numfree];\n\n        Nuitka_Py_NewReference((PyObject *)result_list);\n    } else {\n        result_list = (PyListObject *)Nuitka_GC_New(&PyList_Type);\n    }\n\n    // Elements are allocated separately.\n    if (size > 0) {\n        result_list->ob_item = (PyObject **)PyMem_Calloc(size, sizeof(PyObject *));\n\n        if (unlikely(result_list->ob_item == NULL)) {\n            Py_DECREF(result_list);\n            return PyErr_NoMemory();\n        }\n    } else {\n        result_list->ob_item = NULL;\n    }\n\n    Py_SET_SIZE(result_list, size);\n    result_list->allocated = size;\n\n    Nuitka_GC_Track(result_list);\n\n    return (PyObject *)result_list;\n}\n#endif\n\nPyObject *LIST_COPY(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    Py_ssize_t size = PyList_GET_SIZE(list);\n    PyObject *result = MAKE_LIST_EMPTY(size);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *item = PyList_GET_ITEM(list, i);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, i, item);\n    }\n\n    return result;\n}\n\nstatic bool LIST_RESIZE(PyListObject *list, Py_ssize_t newsize) {\n    Py_ssize_t allocated = list->allocated;\n\n    if (allocated >= newsize && newsize >= (allocated >> 1)) {\n        Py_SET_SIZE(list, newsize);\n\n        return true;\n    }\n\n    size_t new_allocated;\n\n    if (newsize == 0) {\n        new_allocated = 0;\n    } else {\n        new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3;\n    }\n\n    size_t num_allocated_bytes = new_allocated * sizeof(PyObject *);\n\n    PyObject **items = (PyObject **)PyMem_Realloc(list->ob_item, num_allocated_bytes);\n    if (unlikely(items == NULL)) {\n        PyErr_NoMemory();\n        return false;\n    }\n\n    list->ob_item = items;\n    Py_SET_SIZE(list, newsize);\n    list->allocated = new_allocated;\n\n    return true;\n}\n\nbool LIST_EXTEND_FROM_LIST(PyObject *list, PyObject *other) {\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    PyObject *result = _PyList_Extend((PyListObject *)list, other);\n    if (result != NULL) {\n        Py_DECREF(result);\n        return true;\n    } else {\n        return false;\n    }\n#else\n    assert(PyList_CheckExact(list));\n    assert(PyList_CheckExact(other));\n\n    size_t n = PyList_GET_SIZE(other);\n\n    if (n == 0) {\n        return true;\n    }\n\n    size_t m = Py_SIZE(list);\n\n    if (LIST_RESIZE((PyListObject *)list, m + n) == false) {\n        return false;\n    }\n\n    PyObject **src = &PyList_GET_ITEM(other, 0);\n    PyObject **dest = &PyList_GET_ITEM(list, m);\n\n    for (size_t i = 0; i < n; i++) {\n        PyObject *o = src[i];\n        Py_INCREF(o);\n\n        dest[i] = o;\n    }\n\n    return true;\n#endif\n}\n\nbool LIST_EXTEND_FROM_ITERABLE(PyThreadState *tstate, PyObject *target, PyObject *other) {\n    CHECK_OBJECT(target);\n    assert(PyList_CheckExact(target));\n\n    CHECK_OBJECT(other);\n\n    PyListObject *list = (PyListObject *)target;\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    PyObject *result = _PyList_Extend(list, other);\n    if (result != NULL) {\n        Py_DECREF(result);\n        return true;\n    } else {\n        return false;\n    }\n#else\n    // First attempt those things that occur most often. Keep in mind that\n    // other might be the same object as list.\n    PyObject **src;\n    Py_ssize_t src_size;\n\n    if (PyList_CheckExact(other)) { // this covers list == other too.\n        src = _PyList_ITEMS(other);\n        src_size = PyList_GET_SIZE(other);\n    } else if (PyTuple_CheckExact(other)) {\n        src = _PyTuple_ITEMS(other);\n        src_size = PyTuple_GET_SIZE(other);\n    } else {\n        src = NULL;\n#ifndef __NUITKA_NO_ASSERT__\n        src_size = 0;\n#endif\n    }\n\n    if (src != NULL) {\n        if (src_size == 0) {\n            return true;\n        }\n\n        Py_ssize_t list_size = PyList_GET_SIZE(list);\n\n        // Overflow is not really realistic, so we only assert against it.\n        assert(list_size <= PY_SSIZE_T_MAX - src_size);\n        if (LIST_RESIZE(list, list_size + src_size) == false) {\n            return false;\n        }\n\n        PyObject **target_items = _PyList_ITEMS(list) + list_size;\n\n        for (Py_ssize_t i = 0; i < src_size; i++) {\n            PyObject *value = src[i];\n            Py_INCREF(value);\n            *target_items++ = value;\n        }\n\n        return true;\n    }\n\n    // Slow path needs to use iterator. TODO:\n    PyObject *iter = MAKE_ITERATOR(tstate, other);\n\n    if (iter == NULL) {\n        return false;\n    }\n    PyObject *(*iternext)(PyObject *) = *Py_TYPE(iter)->tp_iternext;\n\n    Py_ssize_t cur_size = PyList_GET_SIZE(list);\n\n#if PYTHON_VERSION >= 0x340\n    // Guess a iterator size if possible\n    src_size = PyObject_LengthHint(other, 8);\n\n    if (src_size < 0) {\n        Py_DECREF(iter);\n        return false;\n    }\n\n    Py_ssize_t list_size = PyList_GET_SIZE(list);\n\n    if (list_size > PY_SSIZE_T_MAX - src_size) {\n        // Overflow is not really realistic, hope is, it will not come true.\n    } else {\n        // Allocate the space in one go.\n        if (LIST_RESIZE(list, list_size + src_size) == false) {\n            Py_DECREF(iter);\n            return false;\n        }\n\n        // Restore validity of the object for the time being.\n        Py_SET_SIZE(list, list_size);\n    }\n#endif\n\n    for (;;) {\n        PyObject *item = iternext(iter);\n\n        if (item == NULL) {\n            bool stop_iteration_error = CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate);\n\n            Py_DECREF(iter);\n\n            if (unlikely(stop_iteration_error == false)) {\n                if (cur_size < list->allocated) {\n                    if (LIST_RESIZE(list, cur_size) == false) {\n                        return false;\n                    }\n                }\n\n                return false;\n            }\n\n            break;\n        }\n\n        CHECK_OBJECT(item);\n\n        if (cur_size < list->allocated) {\n            // Already allocated, so we can just set it.\n            PyList_SET_ITEM(list, cur_size, item);\n            Py_SET_SIZE(list, cur_size + 1);\n        } else {\n            assert(cur_size != PY_SSIZE_T_MAX);\n\n            if (LIST_RESIZE(list, cur_size + 1) == false) {\n                return false;\n            }\n\n            PyList_SET_ITEM(list, cur_size, item);\n        }\n        cur_size += 1;\n    }\n\n    /* Cut back result list if initial guess was too large. */\n    assert(cur_size == PyList_GET_SIZE(list));\n\n    if (cur_size < list->allocated) {\n        if (LIST_RESIZE(list, cur_size) == false) {\n            return false;\n        }\n    }\n\n    return true;\n#endif\n}\n\n#if PYTHON_VERSION >= 0x390\nbool LIST_EXTEND_FOR_UNPACK(PyThreadState *tstate, PyObject *list, PyObject *other) {\n    // TODO: For improved performance, inline this, but we probably wait\n    // until code generation for this kind of helpers is there.\n    bool result = LIST_EXTEND_FROM_ITERABLE(tstate, list, other);\n\n    if (likely(result)) {\n        return true;\n    }\n\n    PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n    if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_TypeError) &&\n        (Py_TYPE(other)->tp_iter == NULL && !PySequence_Check(other))) {\n        CLEAR_ERROR_OCCURRED(tstate);\n        PyErr_Format(PyExc_TypeError, \"Value after * must be an iterable, not %s\", Py_TYPE(other)->tp_name);\n    }\n\n    return false;\n}\n#endif\n\nbool LIST_APPEND1(PyObject *target, PyObject *item) {\n    CHECK_OBJECT(target);\n    assert(PyList_CheckExact(target));\n\n    CHECK_OBJECT(item);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    int res = PyList_Append(target, item);\n    Py_DECREF(item);\n    return res == 0;\n#else\n    PyListObject *list = (PyListObject *)target;\n\n    Py_ssize_t cur_size = PyList_GET_SIZE(list);\n\n    // Overflow is not really realistic, so we only assert against it.\n    assert(cur_size <= PY_SSIZE_T_MAX);\n\n    if (LIST_RESIZE(list, cur_size + 1) == false) {\n        return false;\n    }\n\n    PyList_SET_ITEM(list, cur_size, item);\n\n    return true;\n#endif\n}\n\nbool LIST_APPEND0(PyObject *target, PyObject *item) {\n    CHECK_OBJECT(target);\n    assert(PyList_CheckExact(target));\n\n    CHECK_OBJECT(item);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    int res = PyList_Append(target, item);\n    return res == 0;\n#else\n    PyListObject *list = (PyListObject *)target;\n\n    Py_ssize_t cur_size = PyList_GET_SIZE(list);\n\n    // Overflow is not really realistic, so we only assert against it.\n    assert(cur_size <= PY_SSIZE_T_MAX);\n\n    if (LIST_RESIZE(list, cur_size + 1) == false) {\n        return false;\n    }\n\n    PyList_SET_ITEM0(list, cur_size, item);\n\n    return true;\n#endif\n}\n\nbool LIST_REMOVE(PyObject *target, PyObject *item) {\n    CHECK_OBJECT(target);\n    assert(PyList_CheckExact(target));\n\n    CHECK_OBJECT(item);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    int res = PyList_Remove(target, item);\n    return res == 0;\n#else\n    PyListObject *list = (PyListObject *)target;\n\n    Py_ssize_t cur_size = PyList_GET_SIZE(list);\n\n    for (Py_ssize_t i = 0; i < cur_size; i++) {\n        PyObject *element = list->ob_item[i];\n\n        Py_INCREF(element);\n        nuitka_bool cmp = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(element, item);\n        Py_DECREF(element);\n\n        if (cmp == NUITKA_BOOL_TRUE) {\n            Py_DECREF(element);\n            Py_SET_SIZE(list, cur_size - 1);\n\n            memmove(list->ob_item + i, list->ob_item + i + 1, sizeof(PyObject *) * (cur_size - i - 1));\n\n            return true;\n        } else if (unlikely(cmp == NUITKA_BOOL_EXCEPTION)) {\n            return false;\n        }\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"list.remove(x): x not in list\");\n    return false;\n#endif\n}\n\nvoid LIST_CLEAR(PyObject *target) {\n    CHECK_OBJECT(target);\n    assert(PyList_CheckExact(target));\n\n    PyListObject *list = (PyListObject *)target;\n\n    PyObject **items = list->ob_item;\n\n    if (items != NULL) {\n        // Make the list empty first, so the data we release is not accessible.\n        Py_ssize_t i = Py_SIZE(list);\n        Py_SET_SIZE(list, 0);\n        list->ob_item = NULL;\n        list->allocated = 0;\n\n        while (--i >= 0) {\n            Py_XDECREF(items[i]);\n        }\n\n        PyMem_Free(items);\n    }\n}\n\nPyObject *getListIndexObject(Py_ssize_t value) {\n#if PYTHON_VERSION < 0x300\n    return PyInt_FromSsize_t(value);\n#else\n    // TODO: Actually to be fully correct, we will need a \"Nuitka_LongFromCSsize_t\" which\n    // we do not have yet.\n    return Nuitka_LongFromCLong((long)value);\n#endif\n}\n\nPyObject *LIST_COUNT(PyObject *list, PyObject *item) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    Py_ssize_t count = 0;\n\n    for (Py_ssize_t i = 0; i < Py_SIZE(list); i++) {\n        PyObject *element = PyList_GET_ITEM(list, i);\n\n        // Fast path, is identical\n        if (element == item) {\n            count++;\n            continue;\n        }\n\n        // Rich compare element while holding a reference. TODO: If we knew the type\n        // of \"item\" we could be faster by picking variants that know stuff, but\n        // maybe it is not as important.\n        Py_INCREF(element);\n        nuitka_bool nbool_res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(element, item);\n        Py_DECREF(element);\n\n        if (nbool_res == NUITKA_BOOL_TRUE) {\n            count++;\n            continue;\n        }\n\n        // Pass on exceptions from comparisons.\n        if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n            return NULL;\n        }\n    }\n\n    return getListIndexObject(count);\n}\n\nstatic PyObject *_LIST_INDEX_COMMON(PyThreadState *tstate, PyListObject *list, PyObject *item, Py_ssize_t start,\n                                    Py_ssize_t stop) {\n    // Negative values for start/stop are handled here.\n    if (start < 0) {\n        start += Py_SIZE(list);\n\n        if (start < 0) {\n            start = 0;\n        }\n    }\n\n    if (stop < 0) {\n        stop += Py_SIZE(list);\n\n        if (stop < 0) {\n            stop = 0;\n        }\n    }\n\n    for (Py_ssize_t i = start; i < stop && i < Py_SIZE(list); i++) {\n        PyObject *element = list->ob_item[i];\n\n        Py_INCREF(element);\n        nuitka_bool nbool_res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(element, item);\n        Py_DECREF(element);\n\n        if (nbool_res == NUITKA_BOOL_TRUE) {\n            return getListIndexObject(i);\n        }\n\n        // Pass on exceptions from comparisons.\n        if (unlikely(nbool_res == NUITKA_BOOL_EXCEPTION)) {\n            return NULL;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyObject *err_format = PyString_FromString(\"%r is not in list\");\n    PyObject *format_tuple = MAKE_TUPLE1_0(item);\n    PyObject *err_string = PyString_Format(err_format, format_tuple);\n    Py_DECREF(format_tuple);\n\n    if (err_string == NULL) {\n        return NULL;\n    }\n\n    SET_CURRENT_EXCEPTION_TYPE0_VALUE1(tstate, PyExc_ValueError, err_string);\n    return NULL;\n#else\n    PyErr_Format(PyExc_ValueError, \"%R is not in list\", item);\n    return NULL;\n#endif\n}\n\nPyObject *LIST_INDEX2(PyThreadState *tstate, PyObject *list, PyObject *item) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    return _LIST_INDEX_COMMON(tstate, (PyListObject *)list, item, 0, Py_SIZE(list));\n}\n\nPyObject *LIST_INDEX3(PyThreadState *tstate, PyObject *list, PyObject *item, PyObject *start) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    PyObject *start_index = Nuitka_Number_IndexAsLong(start);\n\n    if (unlikely(start_index == NULL)) {\n        // TODO: Clearing should be useless here.\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"slice indices must be integers or have an __index__ method\");\n        return NULL;\n    }\n\n    Py_ssize_t start_ssize;\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(start_index)) {\n        start_ssize = PyInt_AS_LONG(start_index);\n    } else {\n        start_ssize = PyLong_AsSsize_t(start_index);\n    }\n#else\n    start_ssize = PyLong_AsSsize_t(start_index);\n#endif\n\n    return _LIST_INDEX_COMMON(tstate, (PyListObject *)list, item, start_ssize, Py_SIZE(list));\n}\n\nPyObject *LIST_INDEX4(PyThreadState *tstate, PyObject *list, PyObject *item, PyObject *start, PyObject *stop) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    PyObject *start_index = Nuitka_Number_IndexAsLong(start);\n\n    if (unlikely(start_index == NULL)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"slice indices must be integers or have an __index__ method\");\n        return NULL;\n    }\n\n    Py_ssize_t start_ssize;\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(start_index)) {\n        start_ssize = PyInt_AS_LONG(start_index);\n    } else {\n        start_ssize = PyLong_AsSsize_t(start_index);\n    }\n#else\n    start_ssize = PyLong_AsSsize_t(start_index);\n#endif\n\n    PyObject *stop_index = Nuitka_Number_IndexAsLong(stop);\n\n    if (unlikely(stop_index == NULL)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,\n                                        \"slice indices must be integers or have an __index__ method\");\n        return NULL;\n    }\n\n    Py_ssize_t stop_ssize;\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(stop_index)) {\n        stop_ssize = PyInt_AS_LONG(stop_index);\n    } else {\n        stop_ssize = PyLong_AsSsize_t(stop_index);\n    }\n#else\n    stop_ssize = PyLong_AsSsize_t(stop_index);\n#endif\n\n    return _LIST_INDEX_COMMON(tstate, (PyListObject *)list, item, start_ssize, stop_ssize);\n}\n\nbool LIST_INSERT(PyThreadState *tstate, PyObject *list, PyObject *index, PyObject *item) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    CHECK_OBJECT(index);\n    CHECK_OBJECT(item);\n\n    // TODO: Avoid the clear, by having this as a variant that doesn't set the\n    // exception to begin with\n    PyObject *index_long = Nuitka_Number_IndexAsLong(index);\n\n    if (unlikely(index_long == NULL)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' cannot be interpreted as an integer\", index);\n        return false;\n    }\n\n    Py_ssize_t index_ssize;\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(index_long)) {\n        index_ssize = PyInt_AS_LONG(index_long);\n    } else {\n        index_ssize = PyLong_AsSsize_t(index_long);\n    }\n#else\n    index_ssize = PyLong_AsSsize_t(index_long);\n#endif\n\n    LIST_INSERT_CONST(list, index_ssize, item);\n    return true;\n}\n\nvoid LIST_INSERT_CONST(PyObject *list, Py_ssize_t index, PyObject *item) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    CHECK_OBJECT(item);\n\n    PyListObject *list_object = (PyListObject *)list;\n\n    Py_ssize_t n = Py_SIZE(list_object);\n\n    // Expand the list by needed space.\n    if (LIST_RESIZE(list_object, n + 1) == false) {\n        abort();\n    }\n\n    // Negative values and overflow for for index are handled here.\n    if (index < 0) {\n        index += n;\n        if (index < 0) {\n            index = 0;\n        }\n    }\n    if (index > n) {\n        index = n;\n    }\n\n    // Shift the items behind the insert index.\n    PyObject **items = list_object->ob_item;\n\n    for (Py_ssize_t i = n; --i >= index;) {\n        items[i + 1] = items[i];\n    }\n\n    Py_INCREF(item);\n    items[index] = item;\n}\n\nstatic void _Nuitka_ReverseObjectsSlice(PyObject **lo, PyObject **hi) {\n    assert(lo != NULL && hi != NULL);\n\n    hi -= 1;\n\n    while (lo < hi) {\n        {\n            PyObject *t = *lo;\n            *lo = *hi;\n            *hi = t;\n        }\n\n        lo += 1;\n        hi -= 1;\n    }\n}\n\nvoid LIST_REVERSE(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n\n    PyListObject *list_object = (PyListObject *)list;\n\n    if (Py_SIZE(list_object) > 1) {\n        _Nuitka_ReverseObjectsSlice(list_object->ob_item, list_object->ob_item + Py_SIZE(list_object));\n    }\n}\n\n#if PYTHON_VERSION >= 0x340\nstatic bool allocateListItems(PyListObject *list, Py_ssize_t size) {\n    PyObject **items = PyMem_New(PyObject *, size);\n\n    if (unlikely(items == NULL)) {\n        PyErr_NoMemory();\n        return false;\n    }\n\n    list->ob_item = items;\n    list->allocated = size;\n\n    return true;\n}\n#endif\n\nPyObject *MAKE_LIST(PyThreadState *tstate, PyObject *iterable) {\n    // Can leave the size hinting to later functions, because the list is allocated empty without\n    // items, and when then extending, etc. length hints can be used.\n    PyObject *list = MAKE_LIST_EMPTY(0);\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_LIST_OPT\n    PyObject *result = _PyList_Extend((PyListObject *)list, iterable);\n    if (result == NULL) {\n        Py_DECREF(list);\n        return NULL;\n    } else {\n        Py_DECREF(result);\n        return list;\n    }\n#else\n#if PYTHON_VERSION >= 0x340\n    if (_PyObject_HasLen(iterable)) {\n        Py_ssize_t iter_len = Nuitka_PyObject_Size(iterable);\n\n        if (unlikely(iter_len == -1)) {\n            if (!PyErr_ExceptionMatches(PyExc_TypeError)) {\n                return NULL;\n            }\n\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n\n        if (iter_len > 0) {\n            if (allocateListItems((PyListObject *)list, iter_len) == false) {\n                return NULL;\n            }\n        }\n    }\n#endif\n\n    bool res = LIST_EXTEND_FROM_ITERABLE(tstate, list, iterable);\n\n    if (unlikely(res == false)) {\n        Py_DECREF(list);\n        return NULL;\n    }\n\n    return list;\n#endif\n}\n\n#include \"HelpersListsGenerated.c\"\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersListsGenerated.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template CodeTemplateMakeListSmall.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPyObject *MAKE_LIST1(PyObject *arg0) {\n\n    PyObject *result = MAKE_LIST_EMPTY(1);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(arg0);\n    Py_INCREF(arg0);\n    PyList_SET_ITEM(result, 0, arg0);\n\n    return result;\n}\nPyObject *MAKE_LIST2(PyObject *arg0, PyObject *arg1) {\n\n    PyObject *result = MAKE_LIST_EMPTY(2);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(arg0);\n    Py_INCREF(arg0);\n    PyList_SET_ITEM(result, 0, arg0);\n\n    CHECK_OBJECT(arg1);\n    Py_INCREF(arg1);\n    PyList_SET_ITEM(result, 1, arg1);\n\n    return result;\n}\nPyObject *MAKE_LIST3(PyObject *arg0, PyObject *arg1, PyObject *arg2) {\n\n    PyObject *result = MAKE_LIST_EMPTY(3);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    CHECK_OBJECT(arg0);\n    Py_INCREF(arg0);\n    PyList_SET_ITEM(result, 0, arg0);\n\n    CHECK_OBJECT(arg1);\n    Py_INCREF(arg1);\n    PyList_SET_ITEM(result, 1, arg1);\n\n    CHECK_OBJECT(arg2);\n    Py_INCREF(arg2);\n    PyList_SET_ITEM(result, 2, arg2);\n\n    return result;\n}\nPyObject *MAKE_LIST4(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 4);\n\n    PyObject *result = MAKE_LIST_EMPTY(4);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST5(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 5);\n\n    PyObject *result = MAKE_LIST_EMPTY(5);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST6(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 6);\n\n    PyObject *result = MAKE_LIST_EMPTY(6);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST7(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 7);\n\n    PyObject *result = MAKE_LIST_EMPTY(7);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST8(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 8);\n\n    PyObject *result = MAKE_LIST_EMPTY(8);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 7);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 7, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST9(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 9);\n\n    PyObject *result = MAKE_LIST_EMPTY(9);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 7);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 7, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 8);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 8, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST10(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 10);\n\n    PyObject *result = MAKE_LIST_EMPTY(10);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 7);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 7, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 8);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 8, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 9);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 9, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST11(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 11);\n\n    PyObject *result = MAKE_LIST_EMPTY(11);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 7);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 7, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 8);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 8, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 9);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 9, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 10);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 10, item);\n    }\n\n    return result;\n}\nPyObject *MAKE_LIST12(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == 12);\n\n    PyObject *result = MAKE_LIST_EMPTY(12);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    {\n        PyObject *item = PyList_GET_ITEM(list, 0);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 0, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 1);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 1, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 2);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 2, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 3);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 3, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 4);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 4, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 5);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 5, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 6);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 6, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 7);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 7, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 8);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 8, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 9);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 9, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 10);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 10, item);\n    }\n    {\n        PyObject *item = PyList_GET_ITEM(list, 11);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, 11, item);\n    }\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersMappings.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to work with mapping interfaces.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPy_ssize_t Nuitka_PyMapping_Size(PyObject *mapping) {\n    CHECK_OBJECT(mapping);\n\n    PyMappingMethods *tp_as_mapping = Py_TYPE(mapping)->tp_as_mapping;\n\n    if (tp_as_mapping != NULL && tp_as_mapping->mp_length) {\n        Py_ssize_t result = tp_as_mapping->mp_length(mapping);\n        assert(result >= 0);\n        return result;\n    }\n\n    if (Py_TYPE(mapping)->tp_as_sequence && Py_TYPE(mapping)->tp_as_sequence->sq_length) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"%s is not a mapping\", mapping);\n        return -1;\n    }\n\n    SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"object of type '%s' has no len()\", mapping);\n    return -1;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersMatching.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/** Helpers for matching values with 3.10 or higher\n *\n *\n **/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nstatic void FORMAT_MATCH_MISMATCH_ERROR(PyTypeObject *type, Py_ssize_t max_allowed, Py_ssize_t actual) {\n    const char *plural_form = (max_allowed == 1) ? \"\" : \"s\";\n\n    PyErr_Format(PyExc_TypeError, \"%s() accepts %d positional sub-pattern%s (%d given)\",\n                 ((PyTypeObject *)type)->tp_name, max_allowed, plural_form, actual);\n}\n\nPyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, Py_ssize_t max_allowed) {\n    PyObject *match_args = NULL;\n    PyTypeObject *type = Py_TYPE(matched);\n\n    // First, the positional sub-patterns:\n    match_args = LOOKUP_ATTRIBUTE(tstate, (PyObject *)type, const_str_plain___match_args__);\n    Py_ssize_t actual;\n\n    if (match_args) {\n        if (unlikely(!PyTuple_CheckExact(match_args))) {\n            PyErr_Format(PyExc_TypeError, \"%s.__match_args__ must be a tuple (got %s)\", type->tp_name,\n                         Py_TYPE(match_args)->tp_name);\n            Py_DECREF(match_args);\n            return NULL;\n        }\n\n        actual = PyTuple_GET_SIZE(match_args);\n    } else if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate)) {\n        if (PyType_HasFeature(type, _Py_TPFLAGS_MATCH_SELF)) {\n            if (max_allowed > 1) {\n                FORMAT_MATCH_MISMATCH_ERROR(type, max_allowed, 1);\n                return NULL;\n            }\n\n            // TODO: Specialize for single element maybe, but LTO solves\n            // this just fine.\n            PyObject *elements[1] = {matched};\n            return MAKE_TUPLE(elements, 1);\n        }\n\n        actual = 0;\n    } else {\n        return NULL;\n    }\n\n    if (max_allowed > actual) {\n        FORMAT_MATCH_MISMATCH_ERROR(type, max_allowed, actual);\n        return NULL;\n    }\n\n    PyObject *result = MAKE_TUPLE_EMPTY_VAR(actual);\n\n    for (Py_ssize_t i = 0; i < max_allowed; i++) {\n        PyObject *arg_name = PyTuple_GET_ITEM(match_args, i);\n\n        if (unlikely(!PyUnicode_CheckExact(arg_name))) {\n            PyErr_Format(PyExc_TypeError,\n                         \"__match_args__ elements must be strings \"\n                         \"(got %s)\",\n                         Py_TYPE(arg_name)->tp_name);\n\n            Py_DECREF(match_args);\n            Py_DECREF(result);\n\n            return NULL;\n        }\n\n        PyObject *arg_value = LOOKUP_ATTRIBUTE(tstate, matched, arg_name);\n        if (unlikely(arg_value == NULL)) {\n            Py_DECREF(match_args);\n            Py_DECREF(result);\n\n            return NULL;\n        }\n\n        PyTuple_SET_ITEM(result, i, arg_value);\n    }\n\n    Py_DECREF(match_args);\n    return result;\n}\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryAdd.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersOperationBinaryAddUtils.c\"\n/* C helpers for type specialized \"+\" (ADD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    bool t = !no_overflow || x != 0;\n\n    cbool_result = t;\n    goto exit_result_ok_cbool;\n\nexit_result_ok_cbool:\n    result = cbool_result ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        bool t = !no_overflow || x != 0;\n\n        cbool_result = t;\n        goto exit_result_ok_cbool;\n\n    exit_result_ok_cbool:\n        result = cbool_result ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        bool t = !no_overflow || x != 0;\n\n        cbool_result = t;\n        goto exit_result_ok_cbool;\n\n    exit_result_ok_cbool:\n        result = cbool_result ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = Nuitka_LongFromCLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = Nuitka_LongFromCLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = Nuitka_LongFromCLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_add;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_FLOAT_LONG(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_concat available for this type.\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    bool t = !no_overflow || x != 0;\n\n    cbool_result = t;\n    goto exit_result_ok_cbool;\n\nexit_result_ok_cbool:\n    result = cbool_result ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + (sdigit)operand2;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = Nuitka_LongFromCLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + (sdigit)operand2;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LONG_DIGIT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyString_Type.tp_as_sequence->sq_concat(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'str'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyString_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_STR_STR(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyString_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyString_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NULL;\n#endif\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyString_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_STR_STR(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    // TODO: Have this more globally passed in\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *x = UNICODE_CONCAT(tstate, operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'unicode'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'str'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyUnicode_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *x = UNICODE_CONCAT(tstate, operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyUnicode_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NULL;\n#endif\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyUnicode_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *x = UNICODE_CONCAT(tstate, operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'bytes'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyBytes_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyBytes_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyBytes_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NULL;\n#endif\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyBytes_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = TUPLE_CONCAT(operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'tuple'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyTuple_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = TUPLE_CONCAT(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyTuple_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyTuple_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NULL;\n#endif\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyTuple_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = TUPLE_CONCAT(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = LIST_CONCAT(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LIST_LIST(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'list'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyList_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_LIST_LIST(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyList_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyList_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NULL;\n#endif\n}\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyList_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_ADD_OBJECT_LIST_LIST(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = LIST_CONCAT(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LIST_LIST(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'list'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyList_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_LIST_LIST(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyList_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        PyObject *o = PyList_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\n#if PYTHON_VERSION < 0x300\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n#endif\n}\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyList_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_ADD_NBOOL_LIST_LIST(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_UNICODE_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_STR_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_UNICODE_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(operand1, operand2);\n        obj_result = o;\n        goto exit_binary_result_object;\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_STR_UNICODE(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_ADD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        bool t = !no_overflow || x != 0;\n\n        cbool_result = t;\n        goto exit_result_ok_cbool;\n\n    exit_result_ok_cbool:\n        result = cbool_result ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_add;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = sq_slot(operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_ADD_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryAddUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These slots are still manually coded and are used by the generated code.\n *\n * The plan should be to generate these as well, so e.g. we can have a slot\n * SLOT_nb_add_LONG_INT that is optimal too.\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nstatic PyObject *LIST_CONCAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    Py_ssize_t size = Py_SIZE(operand1) + Py_SIZE(operand2);\n\n    PyListObject *result = (PyListObject *)MAKE_LIST_EMPTY(size);\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    PyObject **src = ((PyListObject *)operand1)->ob_item;\n    PyObject **dest = result->ob_item;\n\n    for (Py_ssize_t i = 0; i < Py_SIZE(operand1); i++) {\n        PyObject *v = src[i];\n        Py_INCREF(v);\n        dest[i] = v;\n    }\n    src = ((PyListObject *)operand2)->ob_item;\n    dest = result->ob_item + Py_SIZE(operand1);\n    for (Py_ssize_t i = 0; i < Py_SIZE(operand2); i++) {\n        PyObject *v = src[i];\n        Py_INCREF(v);\n        dest[i] = v;\n    }\n    return (PyObject *)result;\n}\n\n#if PYTHON_VERSION < 0x3c0\n// Convert single digit to sdigit (int32_t)\n#define MEDIUM_VALUE(x)                                                                                                \\\n    (Py_SIZE(x) < 0 ? -(sdigit)((PyLongObject *)(x))->ob_digit[0]                                                      \\\n                    : (Py_SIZE(x) == 0 ? (sdigit)0 : (sdigit)((PyLongObject *)(x))->ob_digit[0]))\n\n#else\n#define MEDIUM_VALUE(x) ((stwodigits)_PyLong_CompactValue((PyLongObject *)x))\n\n#endif\n\n// Needed for offsetof\n#include <stddef.h>\n\n#if PYTHON_VERSION < 0x3c0\n#define MAX_LONG_DIGITS ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit)) / sizeof(digit))\n#define Nuitka_LongGetDigitPointer(value) (&(((PyLongObject *)value)->ob_digit[0]))\n#define Nuitka_LongGetDigitSize(value) (Py_ABS(Py_SIZE(value)))\n#define Nuitka_LongIsNegative(value) (Py_SIZE(value) < 0)\n#define Nuitka_LongSetSignNegative(value) Py_SET_SIZE(value, -Py_ABS(Py_SIZE(value)))\n#define Nuitka_LongSetSign(value, positive) Py_SET_SIZE(value, (((positive) ? 1 : -1) * Py_ABS(Py_SIZE(value))))\n#define Nuitka_LongFlipSign(value) Py_SET_SIZE(value, -Py_SIZE(value))\n#else\n#define MAX_LONG_DIGITS ((PY_SSIZE_T_MAX - offsetof(PyLongObject, long_value.ob_digit)) / sizeof(digit))\n\n#define Nuitka_LongGetDigitPointer(value) (&(((PyLongObject *)value)->long_value.ob_digit[0]))\n#define Nuitka_LongGetDigitSize(value) (((PyLongObject *)value)->long_value.lv_tag >> NON_SIZE_BITS)\n#define Nuitka_LongIsNegative(value) (((PyLongObject *)value)->long_value.lv_tag & SIGN_NEGATIVE)\n#define Nuitka_LongSetSignNegative(value)                                                                              \\\n    ((PyLongObject *)value)->long_value.lv_tag = ((PyLongObject *)value)->long_value.lv_tag | SIGN_NEGATIVE;\n#define Nuitka_LongSetSignPositive(value)                                                                              \\\n    ((PyLongObject *)value)->long_value.lv_tag = ((PyLongObject *)value)->long_value.lv_tag & ~(SIGN_NEGATIVE);\n#define Nuitka_LongSetSign(value, positive)                                                                            \\\n    if (positive) {                                                                                                    \\\n        Nuitka_LongSetSignPositive(value);                                                                             \\\n    } else {                                                                                                           \\\n        Nuitka_LongSetSignNegative(value);                                                                             \\\n    }\n#define Nuitka_LongFlipSign(value) _PyLong_FlipSign(value)\n#endif\n\n// Our version of _PyLong_New(size);\nstatic PyLongObject *Nuitka_LongNew(Py_ssize_t size) {\n    // TODO: The assertion may be a bit to strong, could be <= for at least < 3.12\n    assert(size < (Py_ssize_t)MAX_LONG_DIGITS);\n    assert(size >= 0);\n\n#if PYTHON_VERSION >= 0x3c0\n    // The zero now is a single digit number.\n    Py_ssize_t ndigits = size ? size : 1;\n\n    PyLongObject *result =\n        (PyLongObject *)PyObject_MALLOC(offsetof(PyLongObject, long_value.ob_digit) + ndigits * sizeof(digit));\n    _PyLong_SetSignAndDigitCount(result, size != 0, size);\n    PyObject_INIT(result, &PyLong_Type);\n    result->long_value.ob_digit[0] = 0;\n    return result;\n#elif PYTHON_VERSION >= 0x300\n    PyLongObject *result = (PyLongObject *)PyObject_MALLOC(offsetof(PyLongObject, ob_digit) + size * sizeof(digit));\n    return (PyLongObject *)PyObject_INIT_VAR(result, &PyLong_Type, size);\n#else\n    return (PyLongObject *)PyObject_NEW_VAR(PyLongObject, &PyLong_Type, size);\n#endif\n}\n\nstatic PyObject *Nuitka_LongRealloc(PyObject *value, Py_ssize_t size) {\n    PyLongObject *result = Nuitka_LongNew(size);\n    Py_SET_SIZE(result, size);\n    Py_DECREF(value);\n\n    return (PyObject *)result;\n}\n\nstatic PyObject *Nuitka_LongFromCLong(long ival) {\n#if PYTHON_VERSION < 0x300\n    if (ival == 0) {\n        PyLongObject *result = Nuitka_LongNew(0);\n\n        return (PyObject *)result;\n    }\n#else\n    if (ival >= NUITKA_STATIC_SMALLINT_VALUE_MIN && ival < NUITKA_STATIC_SMALLINT_VALUE_MAX) {\n        PyObject *result = Nuitka_Long_GetSmallValue(ival);\n        Py_INCREF(result);\n\n        return result;\n    }\n#endif\n\n    // We go via unsigned long to avoid overflows when shifting and we need\n    // the sign separate in the end anyway.\n    unsigned long abs_ival;\n    bool negative;\n\n    if (ival < 0) {\n        abs_ival = 0U - (unsigned long)ival;\n        negative = true;\n    } else {\n        abs_ival = (unsigned long)ival;\n        negative = false;\n    }\n\n    // Fast path for single digit values\n    if (!(abs_ival >> PyLong_SHIFT)) {\n        PyLongObject *result = Nuitka_LongNew(1);\n        assert(result != NULL);\n        if (negative) {\n            Nuitka_LongSetSignNegative(result);\n        }\n\n        digit *digits = Nuitka_LongGetDigitPointer(result);\n        digits[0] = (digit)abs_ival;\n\n        return (PyObject *)result;\n    }\n\n    // Fast path for two digit values on suitable platforms.\n#if PyLong_SHIFT == 15\n    if (!(abs_ival >> 2 * PyLong_SHIFT)) {\n        PyLongObject *result = Nuitka_LongNew(2);\n        assert(result != NULL);\n        if (negative) {\n            Nuitka_LongSetSignNegative(result);\n        }\n\n        digit *digits = Nuitka_LongGetDigitPointer(result);\n\n        digits[0] = (digit)(abs_ival & PyLong_MASK);\n        digits[1] = (digit)(abs_ival >> PyLong_SHIFT);\n\n        return (PyObject *)result;\n    }\n#endif\n\n    // Slow path for the rest.\n    unsigned long t = abs_ival;\n    Py_ssize_t ndigits = 0;\n\n    // First determine the number of digits needed.\n    while (t != 0) {\n        ++ndigits;\n        t >>= PyLong_SHIFT;\n    }\n\n    PyLongObject *result = _PyLong_New(ndigits);\n    assert(result != NULL);\n\n    Py_SET_SIZE(result, negative ? -ndigits : ndigits);\n\n    digit *d = Nuitka_LongGetDigitPointer(result);\n\n    // Now copy the digits\n    t = abs_ival;\n    while (t != 0) {\n        *d++ = (digit)(t & PyLong_MASK);\n        t >>= PyLong_SHIFT;\n    }\n\n    return (PyObject *)result;\n}\n\nstatic void Nuitka_LongUpdateFromCLong(PyObject **value, long ival) {\n    assert(Py_REFCNT(*value) == 1);\n\n#if PYTHON_VERSION < 0x300\n    if (ival == 0) {\n        if (Py_SIZE(*value) == 0) {\n            return;\n        }\n\n        Py_DECREF(*value);\n        *value = (PyObject *)Nuitka_LongNew(0);\n\n        return;\n    }\n#else\n    if (ival >= NUITKA_STATIC_SMALLINT_VALUE_MIN && ival < NUITKA_STATIC_SMALLINT_VALUE_MAX) {\n        Py_DECREF(*value);\n\n        *value = Nuitka_Long_GetSmallValue(ival);\n        Py_INCREF(*value);\n\n        return;\n    }\n#endif\n\n    // We go via unsigned long to avoid overflows when shifting and we need\n    // the sign separate in the end anyway.\n    unsigned long abs_ival;\n    bool negative;\n\n    if (ival < 0) {\n        abs_ival = 0U - (unsigned long)ival;\n        negative = true;\n    } else {\n        abs_ival = (unsigned long)ival;\n        negative = false;\n    }\n\n    // Fast path for single digit values\n    if (!(abs_ival >> PyLong_SHIFT)) {\n        PyLongObject *result;\n\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(Py_SIZE(*value) == 0)) {\n            *value = Nuitka_LongRealloc(*value, 1);\n            CHECK_OBJECT(*value);\n\n            result = (PyLongObject *)*value;\n        } else\n#endif\n        {\n            result = (PyLongObject *)(*value);\n        }\n\n        Nuitka_LongSetSign(result, !negative);\n\n        digit *digits = Nuitka_LongGetDigitPointer(result);\n        digits[0] = (digit)abs_ival;\n\n        return;\n    }\n\n    // Fast path for two digit values on suitable platforms, e.g. armv7l\n#if PyLong_SHIFT == 15\n    if (!(abs_ival >> 2 * PyLong_SHIFT)) {\n        PyLongObject *result;\n        if (unlikely(Py_ABS(Py_SIZE(*value)) < 2)) {\n            *value = Nuitka_LongRealloc(*value, 2);\n            CHECK_OBJECT(*value);\n\n            result = (PyLongObject *)*value;\n        } else {\n            result = (PyLongObject *)(*value);\n        }\n\n        if (negative) {\n            Nuitka_LongSetSignNegative(result);\n        }\n\n        digit *digits = Nuitka_LongGetDigitPointer(result);\n\n        digits[0] = (digit)(abs_ival & PyLong_MASK);\n        digits[1] = (digit)(abs_ival >> PyLong_SHIFT);\n\n        return;\n    }\n#endif\n\n    // Slow path for the rest.\n    unsigned long t = abs_ival;\n    Py_ssize_t ndigits = 0;\n\n    // First determine the number of digits needed.\n    while (t != 0) {\n        ndigits++;\n        t >>= PyLong_SHIFT;\n    }\n\n    if (unlikely(Py_ABS(Py_SIZE(*value)) < ndigits)) {\n        *value = Nuitka_LongRealloc(*value, ndigits);\n    }\n\n    CHECK_OBJECT(*value);\n\n    Py_SET_SIZE(*value, negative ? -ndigits : ndigits);\n\n    digit *d = Nuitka_LongGetDigitPointer(*value);\n\n    // Now copy the digits\n    t = abs_ival;\n    while (t) {\n        *d++ = (digit)(t & PyLong_MASK);\n        t >>= PyLong_SHIFT;\n    }\n\n    return;\n}\n\n#if 0\n// Note: We are manually inlining this so far.\nstatic PyLongObject *Nuitka_LongStripZeros(PyLongObject *v) {\n    Py_ssize_t j = Py_ABS(Py_SIZE(v));\n\n    Py_ssize_t i = j;\n    while (i > 0 && v->ob_digit[i - 1] == 0) {\n        i -= 1;\n    }\n\n    if (i != j) {\n        Py_SIZE(v) = (Py_SIZE(v) < 0) ? -i : i;\n    }\n\n    return v;\n}\n#endif\n\nstatic PyLongObject *_Nuitka_LongAddDigits(digit const *a, Py_ssize_t size_a, digit const *b, Py_ssize_t size_b) {\n    // Make sure we know a is the longest value.\n    if (size_a < size_b) {\n        {\n            digit const *temp = a;\n            a = b;\n            b = temp;\n        }\n\n        {\n            Py_ssize_t temp = size_a;\n            size_a = size_b;\n            size_b = temp;\n        }\n    }\n\n    // We do not know ahead of time, if we need a new digit, lets just allocate it.\n    PyLongObject *result = Nuitka_LongNew(size_a + 1);\n    CHECK_OBJECT(result);\n\n    digit *r = Nuitka_LongGetDigitPointer(result);\n\n    digit carry = 0;\n\n    // First common digits.\n    Py_ssize_t i;\n    for (i = 0; i < size_b; i++) {\n        carry += a[i] + b[i];\n        r[i] = carry & PyLong_MASK;\n        carry >>= PyLong_SHIFT;\n    }\n    // Digits from longest one only.\n    for (; i < size_a; i++) {\n        carry += a[i];\n        r[i] = carry & PyLong_MASK;\n        carry >>= PyLong_SHIFT;\n    }\n\n    // Only the top digit can be zero, so we can strip this faster.\n    if (carry) {\n        r[i] = carry;\n    } else {\n\n        Py_SET_SIZE(result, Py_SIZE(result) - 1);\n    }\n\n    return result;\n}\n\nstatic PyObject *_Nuitka_LongAddInplaceDigits(PyObject *left, digit const *b, Py_ssize_t size_b) {\n    digit const *a = Nuitka_LongGetDigitPointer(left);\n    Py_ssize_t size_a = Nuitka_LongGetDigitSize(left);\n\n    digit const *aa = a;\n    digit const *bb = b;\n\n    // Make sure we know aa is the longest value by swapping a/b attributes.\n    if (size_a < size_b) {\n        {\n            aa = b;\n            bb = a;\n        }\n\n        {\n            Py_ssize_t temp = size_a;\n            size_a = size_b;\n            size_b = temp;\n        }\n    }\n\n    digit carry = 0;\n\n    // First common digits.\n    Py_ssize_t i;\n    for (i = 0; i < size_b; i++) {\n        carry += aa[i] + bb[i];\n        carry >>= PyLong_SHIFT;\n    }\n\n    // Digits from longest one only might cause a new digit through carry.\n    Py_ssize_t needed = size_a;\n\n    for (; i < size_a; i++) {\n        carry += aa[i];\n        carry >>= PyLong_SHIFT;\n\n        // No more carry, that means size cannot increase.\n        if (carry == 0) {\n            break;\n        }\n    }\n\n    // Final digit needs to be added.\n    if (carry) {\n        needed = i + 1;\n    }\n\n    // Need to keep the old value around, or else we commit use after free potentially.\n    PyObject *old = left;\n\n    if (needed > Nuitka_LongGetDigitSize(left)) {\n        left = (PyObject *)Nuitka_LongNew(needed);\n    } else {\n        Py_INCREF(old);\n    }\n\n    digit *r = Nuitka_LongGetDigitPointer(left);\n\n    // Now do the real thing, with actual storage to left digits.\n    carry = 0;\n\n    // First common digits.\n    for (i = 0; i < size_b; i++) {\n        carry += aa[i] + bb[i];\n        r[i] = carry & PyLong_MASK;\n        carry >>= PyLong_SHIFT;\n    }\n    // Digits from longest one only.\n    for (; i < size_a; i++) {\n        carry += aa[i];\n        r[i] = carry & PyLong_MASK;\n        carry >>= PyLong_SHIFT;\n    }\n\n    // Final digit from the carry.\n    if (carry != 0) {\n        r[i] = carry;\n\n        Py_SET_SIZE(left, i + 1);\n    } else {\n        Py_SET_SIZE(left, i);\n    }\n\n    // Release reference to old value\n    Py_DECREF(old);\n\n    return left;\n}\n\nstatic PyLongObject *_Nuitka_LongSubDigits(digit const *a, Py_ssize_t size_a, digit const *b, Py_ssize_t size_b) {\n    // Sign of the result.\n    int sign = 1;\n\n    // Make sure we know a is the largest value.\n    if (size_a < size_b) {\n        sign = -1;\n\n        {\n            digit const *temp = a;\n            a = b;\n            b = temp;\n        }\n\n        {\n            Py_ssize_t temp = size_a;\n            size_a = size_b;\n            size_b = temp;\n        }\n    } else if (size_a == size_b) {\n        // Find highest digit where a and b differ:\n        Py_ssize_t i = size_a;\n        while (--i >= 0 && a[i] == b[i]) {\n        }\n\n        if (i < 0) {\n#if PYTHON_VERSION < 0x300\n            return (PyLongObject *)Nuitka_LongFromCLong(0);\n#else\n            // For Python3, we have this prepared.\n            PyObject *result = Nuitka_Long_GetSmallValue(0);\n            Py_INCREF(result);\n            return (PyLongObject *)result;\n#endif\n        }\n\n        if (a[i] < b[i]) {\n            sign = -1;\n\n            {\n                digit const *temp = a;\n                a = b;\n                b = temp;\n            }\n        }\n\n        size_a = size_b = i + 1;\n    }\n\n    PyLongObject *result = Nuitka_LongNew(size_a);\n    CHECK_OBJECT(result);\n\n    digit *r = Nuitka_LongGetDigitPointer(result);\n\n    digit borrow = 0;\n\n    Py_ssize_t i;\n    // First common digits.\n    for (i = 0; i < size_b; i++) {\n        borrow = a[i] - b[i] - borrow;\n        r[i] = borrow & PyLong_MASK;\n        borrow >>= PyLong_SHIFT;\n        borrow &= 1;\n    }\n    // Digits from largest one only.\n    for (; i < size_a; i++) {\n        borrow = a[i] - borrow;\n        r[i] = borrow & PyLong_MASK;\n        borrow >>= PyLong_SHIFT;\n        borrow &= 1;\n    }\n    assert(borrow == 0);\n\n    // Strip leading zeros.\n    while (i > 0 && r[i - 1] == 0) {\n        i -= 1;\n    }\n\n    Py_SET_SIZE(result, (sign < 0) ? -i : i);\n\n#if PYTHON_VERSION >= 0x300\n    // Normalize small integers.\n    if (i <= 1) {\n        long ival = MEDIUM_VALUE(result);\n\n        if (ival >= NUITKA_STATIC_SMALLINT_VALUE_MIN && ival < NUITKA_STATIC_SMALLINT_VALUE_MAX) {\n            Py_DECREF(result);\n\n            result = (PyLongObject *)Nuitka_Long_GetSmallValue(ival);\n            Py_INCREF(result);\n        }\n    }\n#endif\n\n    return result;\n}\n\nstatic PyObject *_Nuitka_LongSubInplaceDigits(PyObject *left, digit const *b, Py_ssize_t size_b, int sign) {\n    digit const *a = Nuitka_LongGetDigitPointer(left);\n    Py_ssize_t size_a = Nuitka_LongGetDigitSize(left);\n\n    digit const *aa = a;\n    digit const *bb = b;\n\n    // Make sure we know a is the largest value.\n    if (size_a < size_b) {\n        // Invert the sign of the result by swapping the order.\n        sign *= -1;\n\n        {\n            aa = b;\n            bb = a;\n        }\n\n        {\n            Py_ssize_t temp = size_a;\n            size_a = size_b;\n            size_b = temp;\n        }\n    } else if (size_a == size_b) {\n        // Find highest digit where a and b differ:\n        Py_ssize_t i = size_a;\n        while (--i >= 0 && a[i] == b[i]) {\n        }\n\n        // TODO: This will benefit a lot by being in a template.\n        if (i < 0) {\n#if PYTHON_VERSION < 0x300\n            PyObject *r = const_long_0;\n#else\n            PyObject *r = Nuitka_Long_GetSmallValue(0);\n#endif\n            Py_INCREF(r);\n            Py_DECREF(left);\n\n            return r;\n        }\n\n        if (aa[i] < bb[i]) {\n            sign *= -1;\n\n            {\n                aa = b;\n                bb = a;\n            }\n        }\n\n        size_a = size_b = i + 1;\n    }\n\n    Py_ssize_t needed = size_a;\n\n    // Need to keep the old value around, or else we commit use after free potentially.\n    PyObject *old = left;\n\n    if (needed > Nuitka_LongGetDigitSize(left)) {\n        left = (PyObject *)Nuitka_LongNew(needed);\n    } else {\n        Py_INCREF(old);\n    }\n\n    digit *r = Nuitka_LongGetDigitPointer(left);\n\n    digit borrow = 0;\n\n    Py_ssize_t i;\n    // First common digits.\n    for (i = 0; i < size_b; i++) {\n        borrow = aa[i] - bb[i] - borrow;\n        r[i] = borrow & PyLong_MASK;\n        borrow >>= PyLong_SHIFT;\n        borrow &= 1;\n    }\n    // Digits from largest one only.\n    for (; i < size_a; i++) {\n        borrow = aa[i] - borrow;\n        r[i] = borrow & PyLong_MASK;\n        borrow >>= PyLong_SHIFT;\n        borrow &= 1;\n    }\n    assert(borrow == 0);\n\n    // Strip leading zeros.\n    while (i > 0 && r[i - 1] == 0) {\n        i -= 1;\n    }\n\n    Py_SET_SIZE(left, (sign < 0) ? -i : i);\n\n    // Release reference to old value\n    Py_DECREF(old);\n\n#if PYTHON_VERSION >= 0x300\n    // Normalize small integers.\n    if (i <= 1) {\n        long ival = MEDIUM_VALUE(left);\n\n        if (ival >= NUITKA_STATIC_SMALLINT_VALUE_MIN && ival < NUITKA_STATIC_SMALLINT_VALUE_MAX) {\n            Py_DECREF(left);\n\n            left = Nuitka_Long_GetSmallValue(ival);\n            Py_INCREF(left);\n        }\n    }\n#endif\n\n    return left;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryBitand.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"&\" (BITAND) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_and;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_and;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_and;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_and;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITAND_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITAND_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PySet_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PySet_Type.tp_as_number->nb_and;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'set'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PySet_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PySet_Type.tp_as_number->nb_and;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PySet_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'set' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITAND_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_and;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryBitor.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"|\" (BITOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_or;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_or;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITOR_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_or;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_or;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_or;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_or;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITOR_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PySet_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PySet_Type.tp_as_number->nb_or;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'set'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PySet_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PySet_Type.tp_as_number->nb_or;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PySet_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'set' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITOR_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_or(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_or;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITOR_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryBitxor.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"^\" (BITXOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_xor;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_xor;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITXOR_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_xor;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_xor;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_xor;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITXOR_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_xor;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_BITXOR_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_xor(operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PySet_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PySet_Type.tp_as_number->nb_xor;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'set'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PySet_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_xor(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PySet_Type.tp_as_number->nb_xor;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PySet_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'set' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PySet_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_BITXOR_OBJECT_SET_SET(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_xor(operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_BITXOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_BITXOR_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_xor;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_BITXOR_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_BITXOR_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryDivmod.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersOperationBinaryDivmodUtils.c\"\n/* C helpers for type specialized \"divmod\" (DIVMOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n        obj_result = r;\n        goto exit_result_object;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divmod : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_divmod;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n            obj_result = r;\n            goto exit_result_object;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_divmod;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divmod : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n            obj_result = r;\n            goto exit_result_object;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_divmod(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divmod : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_divmod;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divmod(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divmod;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divmod : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divmod(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n                div -= 1.0;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divmod : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divmod;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                    div -= 1.0;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divmod;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divmod : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                    div -= 1.0;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divmod;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divmod;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divmod;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divmod;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divmod;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_divmod;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n        obj_result = r;\n        goto exit_result_object;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n        obj_result = r;\n        goto exit_result_object;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n                div -= 1.0;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n                div -= 1.0;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n            obj_result = r;\n            goto exit_result_object;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divmod(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divmod : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divmod : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divmod;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for divmod(): '%s' and '%s'\", type1->tp_name,\n                 type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_DIVMOD_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These are defines used in floordiv code.\n\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include <float.h>\n\n/* Check if unary negation would not fit into long */\n#define UNARY_NEG_WOULD_OVERFLOW(x) ((x) < 0 && (unsigned long)(x) == 0 - (unsigned long)(x))\n/* This is from pyport.h */\n#define WIDTH_OF_ULONG (CHAR_BIT * SIZEOF_LONG)\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryFloordiv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"//\" (FLOORDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_floor_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_floor_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                    PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_floor_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                    PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_floor_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        cfloat_result = floordiv;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                     PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((a < 0) != (mod < 0)) {\n                    div -= 1.0;\n                }\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            cfloat_result = floordiv;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                     PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((a < 0) != (mod < 0)) {\n                    div -= 1.0;\n                }\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            cfloat_result = floordiv;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_floor_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_floor_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        cfloat_result = floordiv;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        cfloat_result = floordiv;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_floor_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_FLOORDIV_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* C helpers for type specialized \"+=\" (IAdd) operations */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nbool BINARY_OPERATION_ADD_OBJECT_UNICODE_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    if (likely(PyUnicode_CheckExact(*operand1))) {\n#if PYTHON_VERSION >= 0x300\n        if (Py_REFCNT(*operand1) == 1 && !PyUnicode_CHECK_INTERNED(*operand1)) {\n            // We more or less own the operand, so we might reuse its storage and\n            // execute stuff in-place.\n            return UNICODE_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n\n        PyObject *result = UNICODE_CONCAT(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    PyObject *result = PyNumber_InPlaceAdd(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = result;\n\n    return true;\n}\n\nbool BINARY_OPERATION_ADD_UNICODE_OBJECT_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(*operand1));\n\n    if (likely(PyUnicode_CheckExact(operand2))) {\n#if PYTHON_VERSION >= 0x300\n        if (Py_REFCNT(*operand1) == 1 && !PyUnicode_CHECK_INTERNED(*operand1)) {\n            // We more or less own the operand, so we might reuse its storage and\n            // execute stuff in-place.\n            return UNICODE_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n\n        PyObject *result = UNICODE_CONCAT(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    PyObject *result = PyNumber_InPlaceAdd(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = result;\n\n    return true;\n}\n\nbool BINARY_OPERATION_ADD_UNICODE_UNICODE_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(*operand1));\n    assert(PyUnicode_CheckExact(operand2));\n\n#if PYTHON_VERSION >= 0x300\n    if (Py_REFCNT(*operand1) == 1 && !PyUnicode_CHECK_INTERNED(*operand1)) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n        return UNICODE_ADD_INCREMENTAL(operand1, operand2);\n    }\n#endif\n\n    PyObject *result = UNICODE_CONCAT(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    Py_DECREF(*operand1);\n    *operand1 = result;\n\n    return true;\n}\n\n#if PYTHON_VERSION >= 0x300\nbool BINARY_OPERATION_ADD_OBJECT_BYTES_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1 && PyBytes_CheckExact(*operand1)) {\n        return BYTES_ADD_INCREMENTAL(operand1, operand2);\n    }\n\n    PyObject *result = PyNumber_InPlaceAdd(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = result;\n\n    return true;\n}\n\nbool BINARY_OPERATION_ADD_BYTES_OBJECT_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(*operand1));\n\n    if (Py_REFCNT(*operand1) == 1 && PyBytes_CheckExact(operand2)) {\n        return BYTES_ADD_INCREMENTAL(operand1, operand2);\n    }\n\n    PyObject *result = PyNumber_InPlaceAdd(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = result;\n\n    return true;\n}\n\nbool BINARY_OPERATION_ADD_BYTES_BYTES_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1);\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(*operand1));\n    assert(PyBytes_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        return BYTES_ADD_INCREMENTAL(operand1, operand2);\n    }\n\n    // Could concat bytes here more directly.\n\n    PyObject *result = PyNumber_InPlaceAdd(*operand1, operand2);\n\n    if (unlikely(result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = result;\n\n    return true;\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryLshift.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"<<\" (LSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_lshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_lshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_LSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        PyObject *operand1_long = PyLong_FromLong(a);\n        PyObject *operand2_long = PyLong_FromLong(b);\n\n        // TODO: Change this to using CLONG once we specialize that too.\n        PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n        Py_DECREF(operand1_long);\n        Py_DECREF(operand2_long);\n\n        obj_result = r;\n        goto exit_result_object;\n    } else {\n        long c = a << b;\n\n        if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            clong_result = c;\n            goto exit_result_ok_clong;\n        }\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    result = operand1;\n    Py_INCREF(result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_lshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_lshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_LSHIFT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        PyObject *operand1_long = PyLong_FromLong(a);\n        PyObject *operand2_long = PyLong_FromLong(b);\n\n        // TODO: Change this to using CLONG once we specialize that too.\n        PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n        Py_DECREF(operand1_long);\n        Py_DECREF(operand2_long);\n\n        obj_result = r;\n        goto exit_result_object;\n    } else {\n        long c = a << b;\n\n        if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            clong_result = c;\n            goto exit_result_ok_clong;\n        }\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_lshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_lshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_LSHIFT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_lshift;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_lshift;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_lshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_LSHIFT_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryMatmult.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"@\" (MATMULT) operations */\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'long' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'int' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_LONG_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_matrix_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_matrix_multiply\n                                                                              : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'float' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_matrix_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_matrix_multiply\n                                                                              : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MATMULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n#error Operator @ not implemented\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_matrix_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_matrix_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_matrix_multiply\n                                                                              : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MATMULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MATMULT_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryMod.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"%\" (MOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_CLONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyString_Format(operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyUnicode_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'unicode'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'tuple'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'list'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_LIST(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"DICT\" to Python 'dict'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'dict'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_DICT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyString_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyString_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_STR_STR(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Format(operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyString_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'str'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"BYTES\" to Python3 'bytes'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyBytes_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'bytes'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyUnicode_Format(operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'tuple'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'tuple'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'list'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'list'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"DICT\" to Python 'dict'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'dict'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'dict'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyUnicode_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyUnicode_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyUnicode_Format(operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyUnicode_Type.tp_as_number->nb_remainder;\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'str'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'tuple'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'list'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"DICT\" to Python 'dict'. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'dict'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyBytes_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyBytes_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_remainder;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryMult.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersOperationBinaryMultUtils.c\"\n/* C helpers for type specialized \"*\" (MULT) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_multiply;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    } // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    // No sequence repeat slot sq_repeat available for this type.\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    nuitka_bool result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_STR_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LIST_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LIST_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_INT_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_INT_LIST(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"UNICODE\" to Python2 'unicode', Python3\n * 'str'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"BYTES\" to Python3 'bytes'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand2;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LIST_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LIST_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n\n    // Statically recognized that coercion is not possible with these types\n\n    {\n        // No sequence repeat slot sq_repeat available for this type.\n    }\n    if (unlikely(!1)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = operand1;\n\n        {\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LONG_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    if (unlikely(!Nuitka_Index_Check(operand1))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand1);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type1->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyString_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyString_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    if (unlikely(!Nuitka_Index_Check(operand2))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand2);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    if (unlikely(!Nuitka_Index_Check(operand1))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand1);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type1->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyUnicode_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyUnicode_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    if (unlikely(!Nuitka_Index_Check(operand2))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand2);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    if (unlikely(!Nuitka_Index_Check(operand1))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand1);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type1->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyBytes_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyBytes_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    if (unlikely(!Nuitka_Index_Check(operand2))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand2);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    if (unlikely(!Nuitka_Index_Check(operand1))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand1);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type1->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyTuple_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyTuple_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    if (unlikely(!Nuitka_Index_Check(operand2))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand2);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    if (unlikely(!Nuitka_Index_Check(operand1))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand1);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand1);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type1->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand2, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyList_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyList_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    if (unlikely(!Nuitka_Index_Check(operand2))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n        goto exit_binary_exception;\n    }\n\n    {\n        PyObject *index_value = Nuitka_Number_Index(operand2);\n\n        if (unlikely(index_value == NULL)) {\n            goto exit_binary_exception;\n        }\n\n        {\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n            Py_DECREF(index_value);\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                goto exit_binary_exception;\n            }\n            {\n                ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                PyObject *r = (*repeatfunc)(operand1, count);\n\n                obj_result = r;\n                goto exit_binary_result_object;\n            }\n        }\n    }\n\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_multiply;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    {\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n    // Special case for \"*\", also work with sequence repeat from right argument.\n    {\n        ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);\n\n            obj_result = result;\n            goto exit_binary_result_object;\n        }\n    }\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryMultUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These slots are still manually coded and are used by the generated code.\n *\n * The plan should be to generate these as well, so e.g. we can have a slot\n * SLOT_nb_multiply_LONG_INT that is optimal too.\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nstatic Py_ssize_t CONVERT_LONG_TO_REPEAT_FACTOR(PyObject *value) {\n    /* Inline PyLong_AsSsize_t here for our special purpose. */\n    assert(PyLong_Check(value));\n\n    Py_ssize_t digits_count = Nuitka_LongGetDigitSize(value);\n\n    if (digits_count == 0) {\n        return 0;\n    }\n\n    bool is_negative = Nuitka_LongIsNegative(value);\n\n    PyLongObject *long_value = (PyLongObject *)value;\n\n    digit *digits = Nuitka_LongGetDigitPointer(long_value);\n\n    if ((digits_count == 1) && (is_negative == false)) {\n        return digits[0];\n    }\n\n    Py_ssize_t result = 0;\n\n    while (--digits_count >= 0) {\n        Py_ssize_t prev = result;\n        result = (result << PyLong_SHIFT) | digits[digits_count];\n\n        // Overflow detection.\n        if ((result >> PyLong_SHIFT) != prev) {\n            return (Py_ssize_t)-1;\n        }\n    }\n\n    if (is_negative) {\n        return 0;\n    }\n\n    return result;\n}\n\nstatic Py_ssize_t CONVERT_TO_REPEAT_FACTOR(PyObject *value) {\n#if PYTHON_VERSION < 0x300\n    assert(PyInt_Check(value) || PyLong_Check(value));\n\n    if (PyInt_Check(value)) {\n        Py_ssize_t result = PyInt_AS_LONG(value);\n\n        /* A -1 value could indicate error, so we avoid it. */\n        if (result < 0) {\n            return 0;\n        } else {\n            return result;\n        }\n    } else {\n        return CONVERT_LONG_TO_REPEAT_FACTOR(value);\n    }\n#else\n    /* For Python3 we know for a fact that it's a long, or else it's an\n     * exception.\n     */\n    assert(PyLong_Check(value));\n\n    return CONVERT_LONG_TO_REPEAT_FACTOR(value);\n#endif\n}\n\nstatic PyObject *SEQUENCE_REPEAT(ssizeargfunc repeatfunc, PyObject *seq, PyObject *n) {\n    if (unlikely(!Nuitka_Index_Check(n))) {\n        PyErr_Format(PyExc_TypeError, \"can't multiply sequence by non-int of type '%s'\", Py_TYPE(n)->tp_name);\n\n        return NULL;\n    }\n\n    PyObject *index_value = Nuitka_Number_Index(n);\n\n    if (unlikely(index_value == NULL)) {\n        return NULL;\n    }\n\n    Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n    Py_DECREF(index_value);\n\n    /* Above conversion indicates an error as -1 */\n    if (unlikely(count == -1)) {\n        PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", Py_TYPE(n)->tp_name);\n        return NULL;\n    }\n\n    PyObject *result = (*repeatfunc)(seq, count);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryOlddiv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"/\" (OLDDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_divide(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_OLDDIV_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryPow.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersOperationBinaryPowUtils.c\"\n/* C helpers for type specialized \"**\" (POW) operations */\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (b == 0) {\n        goto exit_result_ok_const_float_1_0;\n    }\n\n    if (Py_IS_NAN(a)) {\n        goto exit_result_ok_left;\n    }\n\n    if (Py_IS_NAN(b)) {\n        if (a == 1.0) {\n            goto exit_result_ok_const_float_1_0;\n        } else {\n            goto exit_result_ok_right;\n        }\n    }\n\n    if (Py_IS_INFINITY(b)) {\n        a = fabs(a);\n        if (a == 1.0) {\n            goto exit_result_ok_const_float_1_0;\n        } else if ((b > 0.0) == (a > 1.0)) {\n            long r = (long)fabs(b);\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n    if (Py_IS_INFINITY(a)) {\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r;\n\n        if (b > 0.0) {\n            r = b_is_odd ? a : fabs(a);\n        } else {\n            r = b_is_odd ? copysign(0.0, a) : 0.0;\n        }\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\n    if (a == 0.0) {\n        if (unlikely(b < 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                            \"0.0 cannot be raised to a negative power\");\n            goto exit_result_exception;\n        }\n\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r = b_is_odd ? a : 0.0;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\n    {\n        bool negate_result = false;\n\n        if (a < 0.0) {\n            if (unlikely(b != floor(b))) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                \"negative number cannot be raised to a fractional power\");\n                goto exit_result_exception;\n            }\n\n            a = -a;\n            negate_result = DOUBLE_IS_ODD_INTEGER(b);\n        }\n\n        if (a == 1.0) {\n            if (negate_result) {\n                goto exit_result_ok_const_float_minus_1_0;\n            } else {\n                goto exit_result_ok_const_float_1_0;\n            }\n        } else {\n            errno = 0;\n            double r = pow(a, b);\n\n            if (unlikely(errno != 0)) {\n                PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                goto exit_result_exception;\n            }\n\n            r = negate_result ? -r : r;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    result = operand1;\n    Py_INCREF(result);\n    goto exit_result_ok;\n\nexit_result_ok_right:\n    result = operand2;\n    Py_INCREF(result);\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    Py_INCREF(const_float_0_0);\n    result = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_1_0:\n    Py_INCREF(const_float_1_0);\n    result = const_float_1_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_1_0:\n    Py_INCREF(const_float_minus_1_0);\n    result = const_float_minus_1_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n    ternaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_power;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (b == 0) {\n            goto exit_result_ok_const_float_1_0;\n        }\n\n        if (Py_IS_NAN(a)) {\n            goto exit_result_ok_left;\n        }\n\n        if (Py_IS_NAN(b)) {\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else {\n                goto exit_result_ok_right;\n            }\n        }\n\n        if (Py_IS_INFINITY(b)) {\n            a = fabs(a);\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else if ((b > 0.0) == (a > 1.0)) {\n                long r = (long)fabs(b);\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n        if (Py_IS_INFINITY(a)) {\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r;\n\n            if (b > 0.0) {\n                r = b_is_odd ? a : fabs(a);\n            } else {\n                r = b_is_odd ? copysign(0.0, a) : 0.0;\n            }\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        if (a == 0.0) {\n            if (unlikely(b < 0.0)) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                                \"0.0 cannot be raised to a negative power\");\n                goto exit_result_exception;\n            }\n\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r = b_is_odd ? a : 0.0;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        {\n            bool negate_result = false;\n\n            if (a < 0.0) {\n                if (unlikely(b != floor(b))) {\n                    PyThreadState *tstate = PyThreadState_GET();\n\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                    \"negative number cannot be raised to a fractional power\");\n                    goto exit_result_exception;\n                }\n\n                a = -a;\n                negate_result = DOUBLE_IS_ODD_INTEGER(b);\n            }\n\n            if (a == 1.0) {\n                if (negate_result) {\n                    goto exit_result_ok_const_float_minus_1_0;\n                } else {\n                    goto exit_result_ok_const_float_1_0;\n                }\n            } else {\n                errno = 0;\n                double r = pow(a, b);\n\n                if (unlikely(errno != 0)) {\n                    PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                    goto exit_result_exception;\n                }\n\n                r = negate_result ? -r : r;\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            }\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_right:\n        result = operand2;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        Py_INCREF(const_float_0_0);\n        result = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_1_0:\n        Py_INCREF(const_float_1_0);\n        result = const_float_1_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_1_0:\n        Py_INCREF(const_float_minus_1_0);\n        result = const_float_minus_1_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n    ternaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2, Py_None);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (b == 0) {\n            goto exit_result_ok_const_float_1_0;\n        }\n\n        if (Py_IS_NAN(a)) {\n            goto exit_result_ok_left;\n        }\n\n        if (Py_IS_NAN(b)) {\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else {\n                goto exit_result_ok_right;\n            }\n        }\n\n        if (Py_IS_INFINITY(b)) {\n            a = fabs(a);\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else if ((b > 0.0) == (a > 1.0)) {\n                long r = (long)fabs(b);\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n        if (Py_IS_INFINITY(a)) {\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r;\n\n            if (b > 0.0) {\n                r = b_is_odd ? a : fabs(a);\n            } else {\n                r = b_is_odd ? copysign(0.0, a) : 0.0;\n            }\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        if (a == 0.0) {\n            if (unlikely(b < 0.0)) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                                \"0.0 cannot be raised to a negative power\");\n                goto exit_result_exception;\n            }\n\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r = b_is_odd ? a : 0.0;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        {\n            bool negate_result = false;\n\n            if (a < 0.0) {\n                if (unlikely(b != floor(b))) {\n                    PyThreadState *tstate = PyThreadState_GET();\n\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                    \"negative number cannot be raised to a fractional power\");\n                    goto exit_result_exception;\n                }\n\n                a = -a;\n                negate_result = DOUBLE_IS_ODD_INTEGER(b);\n            }\n\n            if (a == 1.0) {\n                if (negate_result) {\n                    goto exit_result_ok_const_float_minus_1_0;\n                } else {\n                    goto exit_result_ok_const_float_1_0;\n                }\n            } else {\n                errno = 0;\n                double r = pow(a, b);\n\n                if (unlikely(errno != 0)) {\n                    PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                    goto exit_result_exception;\n                }\n\n                r = negate_result ? -r : r;\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            }\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_right:\n        result = operand2;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        Py_INCREF(const_float_0_0);\n        result = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_1_0:\n        Py_INCREF(const_float_1_0);\n        result = const_float_1_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_1_0:\n        Py_INCREF(const_float_minus_1_0);\n        result = const_float_minus_1_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_power(operand1, operand2, Py_None);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n    ternaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_power;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_power(operand1, operand2, Py_None);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyLong_Type.tp_as_number->nb_power;\n    ternaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2, Py_None);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_power(operand1, operand2, Py_None);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (b < 0) {\n        // TODO: Use CFLOAT once available.\n        PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n        PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n        PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n        Py_DECREF(operand1_float);\n        Py_DECREF(operand2_float);\n\n        obj_result = r;\n        goto exit_result_object;\n    } else {\n        long temp = a;\n        long ix = 1;\n        long bb = b;\n\n        while (bb > 0) {\n            long prev = ix;\n            if (bb & 1) {\n                ix = (unsigned long)ix * temp;\n                if (temp == 0) {\n                    break;\n                }\n                if (ix / temp != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n            bb >>= 1;\n            if (bb == 0) {\n                break;\n            }\n            prev = temp;\n            temp = (unsigned long)temp * temp;\n\n            if (prev != 0 && temp / prev != prev) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            }\n        }\n\n        clong_result = ix;\n        goto exit_result_ok_clong;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n    ternaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_power;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_POW_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyInt_Type.tp_as_number->nb_power;\n    ternaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2, Py_None);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_POW_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_POW_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    ternaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_power;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    ternaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_power;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 = PyLong_Type.tp_as_number->nb_power;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    ternaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_power;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_POW_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n    ternaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2, Py_None);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and '%s'\", type1->tp_name,\n                 type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_POW_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_POW_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n    ternaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2, Py_None);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    ternaryfunc slot = mv->nb_power;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and '%s'\", type1->tp_name,\n                 type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_POW_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_POW_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryPowUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include <float.h>\n\n#define DOUBLE_IS_ODD_INTEGER(x) (fmod(fabs(x), 2.0) == 1.0)\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryRshift.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \">>\" (RSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_rshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_RSHIFT_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    Py_DECREF(obj_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_rshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_RSHIFT_NBOOL_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        if (a < 0) {\n            goto exit_result_ok_const_int_neg_1;\n        } else {\n            goto exit_result_ok_const_int_0;\n        }\n    } else {\n        long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    result = operand1;\n    Py_INCREF(result);\n    goto exit_result_ok;\n\nexit_result_ok_const_int_0:\n    Py_INCREF(const_int_0);\n    result = const_int_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_int_neg_1:\n    Py_INCREF(const_int_neg_1);\n    result = const_int_neg_1;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_rshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        Py_INCREF(const_int_0);\n        result = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        Py_INCREF(const_int_neg_1);\n        result = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                 PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_rshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_RSHIFT_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        Py_INCREF(const_int_0);\n        result = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        Py_INCREF(const_int_neg_1);\n        result = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    nuitka_bool result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        if (a < 0) {\n            goto exit_result_ok_const_int_neg_1;\n        } else {\n            goto exit_result_ok_const_int_0;\n        }\n    } else {\n        long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\nexit_result_ok_clong:\n    result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok_const_int_0:\n    result = 0 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok_const_int_neg_1:\n    result = -1 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_rshift;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        result = 0 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        result = -1 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_rshift;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        nuitka_bool result;\n\n        // return _BINARY_OPERATION_RSHIFT_NBOOL_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        result = 0 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        result = -1 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    return __BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_rshift;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_rshift;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = operand1;\n        Py_INCREF(result);\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        Py_INCREF(const_int_0);\n        result = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        Py_INCREF(const_int_neg_1);\n        result = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic nuitka_bool _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        nuitka_bool result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n        result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        result = PyInt_AS_LONG(operand1) != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        result = 0 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        result = -1 != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NUITKA_BOOL_EXCEPTION;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_rshift;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return NUITKA_BOOL_EXCEPTION;\n    }\n\n    {\n        nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\n        Py_DECREF(obj_result);\n        return r;\n    }\n\nexit_binary_exception:\n    return NUITKA_BOOL_EXCEPTION;\n}\n\nnuitka_bool BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_RSHIFT_NBOOL_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinarySub.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"-\" (SUB) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a - b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_subtract;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_subtract;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = Nuitka_LongFromCLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_subtract;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n\n                Nuitka_LongFlipSign(z);\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = Nuitka_LongFromCLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n\n                Nuitka_LongFlipSign(z);\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n        result = Nuitka_LongFromCLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a - b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a - b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_SUB_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a - b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n    }\n\n    return __BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_subtract;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    const long x = (long)((unsigned long)a - b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a - b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n    result = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)operand1;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) - (sdigit)operand2;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = Nuitka_LongFromCLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_LONG_DIGIT(operand1, operand2);\n}\n\n/* Code referring to \"DIGIT\" corresponds to C platform digit value for long Python objects and \"LONG\" to Python2 'long',\n * Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(long operand1, PyObject *operand2) {\n    assert(Py_ABS(operand1) < (1 << PyLong_SHIFT));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if ((operand1 == 0 ? 0 : 1) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = (sdigit)operand1 - MEDIUM_VALUE(operand2_long_object);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = (digit *)&operand1;\n        Py_ssize_t a_digit_count = (operand1 == 0 ? 0 : 1);\n        bool a_negative = operand1 < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n    result = Nuitka_LongFromCLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    double r = a - b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a - b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n        result = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_subtract;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationBinaryTruediv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type specialized \"/\" (TRUEDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        goto exit_result_exception;\n    }\n\n    if (a == 0) {\n        if (b < 0) {\n            goto exit_result_ok_const_float_minus_0_0;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    Py_INCREF(const_float_0_0);\n    result = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_0_0:\n    Py_INCREF(const_float_minus_0_0);\n    result = const_float_minus_0_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyInt_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyInt_Type.tp_as_number->nb_true_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyInt_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        Py_INCREF(const_float_0_0);\n        result = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        Py_INCREF(const_float_minus_0_0);\n        result = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1,\n                                                                                  PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyInt_Type.tp_as_number->nb_true_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyInt_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        Py_INCREF(const_float_0_0);\n        result = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        Py_INCREF(const_float_minus_0_0);\n        result = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyLong_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_true_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'long'\", type1->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyLong_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1,\n                                                                                   PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyLong_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and '%s'\", type2->tp_name);\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1,\n                                                                                    PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == &PyFloat_Type)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'float'\", type1->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n\n    if (type1 == &PyFloat_Type) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1,\n                                                                                    PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n    binaryfunc slot2 = NULL;\n\n    if (!(&PyFloat_Type == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and '%s'\", type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        PyObject *result;\n\n        // return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyFloat_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n\n    return __BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'long'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'float'\");\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n#endif\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyLong_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;\n    // Slot2 ignored on purpose, type1 takes precedence.\n\n    if (slot1 != NULL) {\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'int'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // Slot1 ignored on purpose, type2 takes precedence.\n    binaryfunc slot2 = NULL;\n\n    if (!(0)) {\n        // Different types, need to consider second value slot.\n\n        slot2 = PyLong_Type.tp_as_number->nb_true_divide;\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    // Statically recognized that coercion is not possible with these types\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'long'\");\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyInt_CheckExact(operand1));\n\n    const long a = PyInt_AS_LONG(operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        goto exit_result_exception;\n    }\n\n    if (a == 0) {\n        if (b < 0) {\n            goto exit_result_ok_const_float_minus_0_0;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n    {\n        PyObject *operand1_object = operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    Py_INCREF(const_float_0_0);\n    result = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_0_0:\n    Py_INCREF(const_float_minus_0_0);\n    result = const_float_minus_0_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"CLONG\" corresponds to C platform long value and \"INT\" to Python2 'int'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyObject *result;\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = operand1;\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        goto exit_result_exception;\n    }\n\n    if (a == 0) {\n        if (b < 0) {\n            goto exit_result_ok_const_float_minus_0_0;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n    {\n        PyObject *operand1_object = PyLong_FromLong(operand1);\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand1_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    result = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    Py_INCREF(const_float_0_0);\n    result = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_0_0:\n    Py_INCREF(const_float_minus_0_0);\n    result = const_float_minus_0_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand1);\n    assert(PyFloat_CheckExact(operand1));\n\n    const double a = PyFloat_AS_DOUBLE(operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"CFLOAT\" corresponds to C platform float value and \"FLOAT\" to Python 'float'. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyObject *result;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = operand1;\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return result;\n\nexit_result_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    CHECK_OBJECT(operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {\n        PyObject *result;\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(operand1);\n        assert(PyInt_CheckExact(operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n        result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        result = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        Py_INCREF(const_float_0_0);\n        result = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        Py_INCREF(const_float_minus_0_0);\n        result = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return result;\n\n    exit_result_exception:\n        return NULL;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc slot1 =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n    binaryfunc slot2 = NULL;\n\n    if (!(type1 == type2)) {\n        // Different types, need to consider second value slot.\n\n        slot2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;\n\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n    }\n\n    if (slot1 != NULL) {\n        if (slot2 != NULL) {\n            if (Nuitka_Type_IsSubtype(type2, type1)) {\n                PyObject *x = slot2(operand1, operand2);\n\n                if (x != Py_NotImplemented) {\n                    obj_result = x;\n                    goto exit_binary_result_object;\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n        PyObject *x = slot1(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    if (slot2 != NULL) {\n        PyObject *x = slot2(operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_binary_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n        coercion c1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n        coercion c2 =\n            (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = operand1;\n            PyObject *coerced2 = operand2;\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                goto exit_binary_exception;\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    binaryfunc slot = mv->nb_true_divide;\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = slot(coerced1, coerced2);\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        obj_result = x;\n                        goto exit_binary_result_object;\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n    }\n#endif\n\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and '%s'\", type1->tp_name, type2->tp_name);\n    goto exit_binary_exception;\n\nexit_binary_result_object:\n    return obj_result;\n\nexit_binary_exception:\n    return NULL;\n}\n\nPyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {\n    return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceAdd.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"HelpersOperationInplaceAddUtils.c\"\n/* C helpers for type in-place \"+\" (ADD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_add;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_ADD_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_add;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_ADD_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n        if (Py_REFCNT(*operand1) == 1) {\n            Nuitka_LongUpdateFromCLong(&*operand1, r);\n            goto exit_result_ok;\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            obj_result = obj;\n            goto exit_result_object;\n        }\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    if (Py_REFCNT(*operand1) == 1) {\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative(*operand1);\n            } else {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n            }\n        } else {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n            } else {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n            }\n        }\n\n        goto exit_result_ok;\n    }\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyLong_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_add;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_ADD_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            if (Py_REFCNT(*operand1) == 1) {\n                Nuitka_LongUpdateFromCLong(&*operand1, r);\n                goto exit_result_ok;\n            } else {\n                PyObject *obj = Nuitka_LongFromCLong(r);\n\n                obj_result = obj;\n                goto exit_result_object;\n            }\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        if (Py_REFCNT(*operand1) == 1) {\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                    Nuitka_LongSetSignNegative(*operand1);\n                } else {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n                }\n            } else {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n                } else {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                }\n            }\n\n            goto exit_result_ok;\n        }\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyLong_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_ADD_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) + MEDIUM_VALUE(operand2_long_object);\n\n            if (Py_REFCNT(*operand1) == 1) {\n                Nuitka_LongUpdateFromCLong(&*operand1, r);\n                goto exit_result_ok;\n            } else {\n                PyObject *obj = Nuitka_LongFromCLong(r);\n\n                obj_result = obj;\n                goto exit_result_object;\n            }\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        if (Py_REFCNT(*operand1) == 1) {\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                    Nuitka_LongSetSignNegative(*operand1);\n                } else {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n                }\n            } else {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n                } else {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                }\n            }\n\n            goto exit_result_ok;\n        }\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                    Nuitka_LongFlipSign(z);\n                } else {\n                    z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n                }\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyLong_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_ADD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_ADD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_add;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_ADD_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_ADD_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a + b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_ADD_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_ADD_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_add;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_add;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_ADD_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_add;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_add;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_ADD_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_add;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_concat available for this type.\n            // No inplace sequence repeat slot sq_inplace_concat available for this type.\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_ADD_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long x = (long)((unsigned long)a + b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_ADD_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nstatic inline bool _INPLACE_OPERATION_ADD_LONG_DIGIT(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) + (sdigit)operand2;\n\n        if (Py_REFCNT(*operand1) == 1) {\n            Nuitka_LongUpdateFromCLong(&*operand1, r);\n            goto exit_result_ok;\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            obj_result = obj;\n            goto exit_result_object;\n        }\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    if (Py_REFCNT(*operand1) == 1) {\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative(*operand1);\n            } else {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n            }\n        } else {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n            } else {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n            }\n        }\n\n        goto exit_result_ok;\n    }\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyLong_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_LONG_DIGIT(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_ADD_LONG_DIGIT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_ADD_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    double r = a + b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_ADD_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_ADD_FLOAT_CFLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nstatic inline bool _INPLACE_OPERATION_ADD_STR_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n#if PYTHON_VERSION < 0x300\n        if (1 && !PyString_CHECK_INTERNED(*operand1) && 1) {\n            return STRING_ADD_INPLACE(operand1, operand2);\n        }\n#endif\n    }\n\n#if PYTHON_VERSION < 0x300\n    // Python2 strings are to be treated differently, fall back to Python API here.\n    if (1 && 1) {\n        PyString_Concat(operand1, operand2);\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        return !HAS_ERROR_OCCURRED(tstate);\n    }\n#endif\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyString_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_STR_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"STR\" to Python2 'str'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_STR(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'str'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n#if PYTHON_VERSION < 0x300\n        if (PyString_CheckExact(*operand1) && !PyString_CHECK_INTERNED(*operand1) && 1) {\n            return STRING_ADD_INPLACE(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyString_Type) {\n        // return _BINARY_OPERATION_ADD_STR_STR_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_STR(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyString_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            PyObject *o = PyString_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\n#if PYTHON_VERSION < 0x300\nexit_inplace_exception:\n    return false;\n#endif\n}\nstatic inline bool _INPLACE_OPERATION_ADD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n#if PYTHON_VERSION < 0x300\n        if (1 && !PyString_CHECK_INTERNED(*operand1) && PyString_CheckExact(operand2)) {\n            return STRING_ADD_INPLACE(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyString_Type == type2) {\n        // return _BINARY_OPERATION_ADD_STR_STR_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_STR_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_ADD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (1 && !PyUnicode_CHECK_INTERNED(*operand1) && 1) {\n            // TODO: Push outward.\n            PyThreadState *tstate = PyThreadState_GET();\n\n            return UNICODE_ADD_INCREMENTAL(tstate, operand1, operand2);\n        }\n#endif\n    }\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    // TODO: Have this more globally passed in\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *x = UNICODE_CONCAT(tstate, *operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_UNICODE(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'unicode'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'str'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (PyUnicode_CheckExact(*operand1) && !PyUnicode_CHECK_INTERNED(*operand1) && 1) {\n            // TODO: Push outward.\n            PyThreadState *tstate = PyThreadState_GET();\n\n            return UNICODE_ADD_INCREMENTAL(tstate, operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyUnicode_Type) {\n        // return _BINARY_OPERATION_ADD_UNICODE_UNICODE_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *x = UNICODE_CONCAT(tstate, *operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_UNICODE(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyUnicode_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\n#if PYTHON_VERSION < 0x300\nexit_inplace_exception:\n    return false;\n#endif\n}\nstatic inline bool _INPLACE_OPERATION_ADD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (1 && !PyUnicode_CHECK_INTERNED(*operand1) && PyUnicode_CheckExact(operand2)) {\n            // TODO: Push outward.\n            PyThreadState *tstate = PyThreadState_GET();\n\n            return UNICODE_ADD_INCREMENTAL(tstate, operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyUnicode_Type == type2) {\n        // return _BINARY_OPERATION_ADD_UNICODE_UNICODE_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *x = UNICODE_CONCAT(tstate, *operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_UNICODE_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nstatic inline bool _INPLACE_OPERATION_ADD_BYTES_BYTES(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (1 && 1) {\n            return BYTES_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n    }\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_BYTES_BYTES(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"BYTES\" to Python3 'bytes'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_BYTES(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'bytes'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_BYTES(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (PyBytes_CheckExact(*operand1) && 1) {\n            return BYTES_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyBytes_Type) {\n        // return _BINARY_OPERATION_ADD_BYTES_BYTES_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_BYTES(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_BYTES(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyBytes_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            PyObject *o = PyBytes_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\n#if PYTHON_VERSION < 0x300\nexit_inplace_exception:\n    return false;\n#endif\n}\nstatic inline bool _INPLACE_OPERATION_ADD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n\n#if PYTHON_VERSION >= 0x300\n        if (1 && PyBytes_CheckExact(operand2)) {\n            return BYTES_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyBytes_Type == type2) {\n        // return _BINARY_OPERATION_ADD_BYTES_BYTES_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_BYTES_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_ADD_TUPLE_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyTuple_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    if (1 && 1) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = TUPLE_CONCAT(*operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_TUPLE_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_TUPLE_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"TUPLE\" to Python 'tuple'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_TUPLE(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'tuple'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyTuple_Type) {\n        // return _BINARY_OPERATION_ADD_TUPLE_TUPLE_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = TUPLE_CONCAT(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_TUPLE(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyTuple_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            PyObject *o = PyTuple_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\n#if PYTHON_VERSION < 0x300\nexit_inplace_exception:\n    return false;\n#endif\n}\nstatic inline bool _INPLACE_OPERATION_ADD_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyTuple_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    if (1 && (PyTuple_CheckExact(operand2) || PySequence_Check(operand2))) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyTuple_Type == type2) {\n        // return _BINARY_OPERATION_ADD_TUPLE_TUPLE_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = TUPLE_CONCAT(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_TUPLE_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_TUPLE_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_ADD_LIST_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    if (1 && 1) {\n        return LIST_EXTEND_FROM_LIST(*operand1, operand2);\n    }\n\n    if (1 && 1) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = LIST_CONCAT(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_LIST_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LIST_LIST(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LIST\" to Python 'list'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_LIST(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and 'list'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n    if (PyList_CheckExact(*operand1) && 1) {\n        return LIST_EXTEND_FROM_LIST(*operand1, operand2);\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyList_Type) {\n        // return _BINARY_OPERATION_ADD_LIST_LIST_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_OBJECT_LIST(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_LIST(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_LIST_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyList_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            PyObject *o = PyList_Type.tp_as_sequence->sq_inplace_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n        {\n            PyObject *o = PyList_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\n#if PYTHON_VERSION < 0x300\nexit_inplace_exception:\n    return false;\n#endif\n}\nstatic inline bool _INPLACE_OPERATION_ADD_LIST_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    if (1 && PyList_CheckExact(operand2)) {\n        return LIST_EXTEND_FROM_LIST(*operand1, operand2);\n    }\n\n    if (1 && PySequence_Check(operand2)) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyList_Type == type2) {\n        // return _BINARY_OPERATION_ADD_LIST_LIST_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = LIST_CONCAT(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_ADD_LIST_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_ADD_LIST_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LIST_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nstatic inline bool _INPLACE_OPERATION_ADD_UNICODE_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n}\n\nbool INPLACE_OPERATION_ADD_UNICODE_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_UNICODE_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_ADD_STR_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            PyObject *o = PyUnicode_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n}\n\nbool INPLACE_OPERATION_ADD_STR_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_STR_UNICODE(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a + b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n#if PYTHON_VERSION < 0x300\n        if (PyString_CheckExact(*operand1) && !PyString_CHECK_INTERNED(*operand1) && PyString_CheckExact(operand2)) {\n            return STRING_ADD_INPLACE(operand1, operand2);\n        }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n        if (PyUnicode_CheckExact(*operand1) && !PyUnicode_CHECK_INTERNED(*operand1) && PyUnicode_CheckExact(operand2)) {\n            // TODO: Push outward.\n            PyThreadState *tstate = PyThreadState_GET();\n\n            return UNICODE_ADD_INCREMENTAL(tstate, operand1, operand2);\n        }\n#endif\n    }\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_ADD_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_ADD_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n#if PYTHON_VERSION < 0x300\n    // Python2 strings are to be treated differently, fall back to Python API here.\n    if (PyString_CheckExact(*operand1) && PyString_CheckExact(operand2)) {\n        PyString_Concat(operand1, operand2);\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        return !HAS_ERROR_OCCURRED(tstate);\n    }\n#endif\n#if PYTHON_VERSION >= 0x300\n    // Python3 Strings are to be treated differently.\n    if (PyUnicode_CheckExact(*operand1) && PyUnicode_CheckExact(operand2)) {\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *result = UNICODE_CONCAT(tstate, *operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n#endif\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_add : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_add : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_add : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_add;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            binaryfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_concat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_concat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = sq_slot(*operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for +: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_OBJECT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_ADD_LIST_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n    if (1 && 1) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_add available for this type.\n\n    {\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            PyObject *o = PyList_Type.tp_as_sequence->sq_inplace_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n        {\n            PyObject *o = PyList_Type.tp_as_sequence->sq_concat(*operand1, operand2);\n            obj_result = o;\n            goto exit_inplace_result_object;\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n}\n\nbool INPLACE_OPERATION_ADD_LIST_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_ADD_LIST_TUPLE(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceAddUtils.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These slots are still manually coded and are used by the generated code.\n *\n * The plan should be to generate these as well. Currently also naming is\n * very inconsistent.\n */\n\n#if PYTHON_VERSION < 0x300\n#include <stddef.h>\n\n#define PyStringObject_SIZE (offsetof(PyStringObject, ob_sval) + 1)\n\nNUITKA_MAY_BE_UNUSED static bool STRING_RESIZE(PyObject **value, Py_ssize_t newsize) {\n    PyStringObject *sv;\n\n    _Py_DEC_REFTOTAL;\n    _Py_ForgetReference(*value);\n\n    *value = (PyObject *)PyObject_REALLOC((char *)*value, PyStringObject_SIZE + newsize);\n\n    if (unlikely(*value == NULL)) {\n        PyErr_NoMemory();\n\n        return false;\n    }\n    Nuitka_Py_NewReference(*value);\n\n    sv = (PyStringObject *)*value;\n    Py_SIZE(sv) = newsize;\n\n    sv->ob_sval[newsize] = '\\0';\n    sv->ob_shash = -1;\n\n    return true;\n}\n\nNUITKA_MAY_BE_UNUSED static bool STRING_ADD_INPLACE(PyObject **operand1, PyObject *operand2) {\n    assert(PyString_CheckExact(*operand1));\n    assert(!PyString_CHECK_INTERNED(*operand1));\n    assert(PyString_CheckExact(operand2));\n\n    Py_ssize_t operand1_size = PyString_GET_SIZE(*operand1);\n    Py_ssize_t operand2_size = PyString_GET_SIZE(operand2);\n\n    Py_ssize_t new_size = operand1_size + operand2_size;\n\n    if (unlikely(new_size < 0)) {\n        PyErr_Format(PyExc_OverflowError, \"strings are too large to concat\");\n\n        return false;\n    }\n\n    if (unlikely(STRING_RESIZE(operand1, new_size) == false)) {\n        return false;\n    }\n\n    memcpy(PyString_AS_STRING(*operand1) + operand1_size, PyString_AS_STRING(operand2), operand2_size);\n\n    return true;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nNUITKA_MAY_BE_UNUSED static bool BYTES_ADD_INCREMENTAL(PyObject **operand1, PyObject *operand2) {\n    assert(PyBytes_CheckExact(*operand1));\n    assert(PyBytes_CheckExact(operand2));\n\n    // Buffer of operand2\n    Py_buffer wb;\n    wb.len = -1;\n\n    {\n        NUITKA_MAY_BE_UNUSED int res = PyObject_GetBuffer(operand2, &wb, PyBUF_SIMPLE);\n        // Has to work.\n        assert(res == 0);\n    }\n\n    Py_ssize_t oldsize = PyBytes_GET_SIZE(*operand1);\n\n    if (oldsize > PY_SSIZE_T_MAX - wb.len) {\n        PyErr_NoMemory();\n        PyBuffer_Release(&wb);\n        return false;\n    }\n    if (_PyBytes_Resize(operand1, oldsize + wb.len) < 0) {\n        PyBuffer_Release(&wb);\n        return false;\n    }\n\n    memcpy(PyBytes_AS_STRING(*operand1) + oldsize, wb.buf, wb.len);\n    PyBuffer_Release(&wb);\n    return true;\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static bool UNICODE_ADD_INCREMENTAL(PyThreadState *tstate, PyObject **operand1,\n                                                         PyObject *operand2) {\n    Py_ssize_t operand2_size = PyUnicode_GET_LENGTH(operand2);\n    if (operand2_size == 0) {\n        return true;\n    }\n\n#if PYTHON_VERSION < 0x300\n    Py_ssize_t operand1_size = PyUnicode_GET_SIZE(*operand1);\n\n    Py_ssize_t new_size = operand1_size + operand2_size;\n\n    if (unlikely(new_size < 0)) {\n        PyErr_Format(PyExc_OverflowError, \"strings are too large to concat\");\n\n        return false;\n    }\n\n    if (unlikely(PyUnicode_Resize(operand1, new_size) != 0)) {\n        return false;\n    }\n\n    memcpy(PyUnicode_AS_UNICODE(*operand1) + operand1_size, PyUnicode_AS_UNICODE(operand2),\n           operand2_size * sizeof(Py_UNICODE));\n\n    return true;\n#else\n    assert(!PyUnicode_CHECK_INTERNED(*operand1));\n\n    return UNICODE_APPEND(tstate, operand1, operand2);\n#endif\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceBitand.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"&\" (BITAND) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITAND_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITAND_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_and;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_BITAND_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITAND_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_and available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_BITAND_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITAND_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITAND_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITAND_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_and;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_BITAND_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITAND_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_and available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_BITAND_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITAND_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_BITAND_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long r = a & b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITAND_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_BITAND_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_and available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_and available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_and;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic inline bool _INPLACE_OPERATION_BITAND_SET_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITAND_SET_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PySet_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PySet_Type.tp_as_number->nb_and;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and 'set'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PySet_Type) {\n        // return _BINARY_OPERATION_BITAND_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITAND_OBJECT_SET(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = PySet_Type.tp_as_number->nb_inplace_and;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = PySet_Type.tp_as_number->nb_and;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PySet_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: 'set' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        // return _BINARY_OPERATION_BITAND_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITAND_SET_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a & b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_BITAND_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_and;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for &: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceBitor.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"|\" (BITOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITOR_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_or(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITOR_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_or : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_or;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_BITOR_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITOR_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_or available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_BITOR_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_or(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITOR_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITOR_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITOR_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_or : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_or;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_BITOR_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITOR_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_or available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_or;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_BITOR_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITOR_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_BITOR_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long r = a | b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITOR_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_BITOR_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITOR_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_or available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_or;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITOR_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITOR_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_or available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_or;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITOR_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic inline bool _INPLACE_OPERATION_BITOR_SET_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_inplace_or(*operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITOR_SET_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_or : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PySet_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PySet_Type.tp_as_number->nb_or;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and 'set'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PySet_Type) {\n        // return _BINARY_OPERATION_BITOR_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_or(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITOR_OBJECT_SET(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = PySet_Type.tp_as_number->nb_inplace_or;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = PySet_Type.tp_as_number->nb_or;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PySet_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: 'set' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        // return _BINARY_OPERATION_BITOR_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_or(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITOR_SET_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_BITOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a | b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_BITOR_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_or : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_or : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_or : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_or;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for |: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITOR_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceBitxor.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"^\" (BITXOR) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_xor(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITXOR_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_xor : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_xor;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_BITXOR_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_xor available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_BITXOR_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_xor(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITXOR_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_xor : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_xor;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_BITXOR_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_xor available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_xor;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_BITXOR_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long r = a ^ b;\n\n    clong_result = r;\n    goto exit_result_ok_clong;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_BITXOR_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_BITXOR_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_xor available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_xor;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITXOR_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_xor available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_xor;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITXOR_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"SET\" to Python 'set'. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_SET_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PySet_Type.tp_as_number->nb_inplace_xor(*operand1, operand2);\n\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITXOR_SET_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_SET_SET(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"SET\" to Python 'set'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_xor : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PySet_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PySet_Type.tp_as_number->nb_xor;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and 'set'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PySet_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PySet_Type) {\n        // return _BINARY_OPERATION_BITXOR_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_xor(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_OBJECT_SET(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_OBJECT_SET(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_OBJECT_SET(operand1, operand2);\n}\n\n/* Code referring to \"SET\" corresponds to Python 'set' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITXOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = PySet_Type.tp_as_number->nb_inplace_xor;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = PySet_Type.tp_as_number->nb_xor;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PySet_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: 'set' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_BITXOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PySet_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PySet_Type == type2) {\n        // return _BINARY_OPERATION_BITXOR_SET_SET_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PySet_Type.tp_as_number->nb_inplace_xor(*operand1, operand2);\n\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_BITXOR_SET_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_BITXOR_SET_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_SET_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_BITXOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long r = a ^ b;\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_BITXOR_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_xor : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_xor : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_xor : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_xor;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ^: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_BITXOR_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_BITXOR_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceFloordiv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"//\" (FLOORDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_floor_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_floor_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_FLOORDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_floor_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_FLOORDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_floor_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_floor_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_FLOORDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_floor_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_FLOORDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_floor_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        cfloat_result = floordiv;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_floor_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_FLOORDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((a < 0) != (mod < 0)) {\n                    div -= 1.0;\n                }\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            cfloat_result = floordiv;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_FLOORDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            double div = (a - mod) / b;\n\n            if (mod) {\n                if ((a < 0) != (mod < 0)) {\n                    div -= 1.0;\n                }\n            }\n\n            double floordiv;\n            if (div) {\n                floordiv = floor(div);\n                if (div - floordiv > 0.5) {\n                    floordiv += 1.0;\n                }\n            } else {\n                floordiv = copysign(0.0, a / b);\n            }\n\n            cfloat_result = floordiv;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_floor_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_floor_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_floor_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_floor_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_floor_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a / b);\n        }\n\n        cfloat_result = floordiv;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_FLOORDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_floor_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_FLOORDIV_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_FLOORDIV_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_floor_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_floor_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_floor_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_floor_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for //: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_FLOORDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_FLOORDIV_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceLshift.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"<<\" (LSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_LSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_lshift(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_LSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_LSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_lshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_lshift;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_LSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_LSHIFT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_LSHIFT_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_LSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_LSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_lshift available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_LSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_LSHIFT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_lshift(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_LSHIFT_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_LSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_LSHIFT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        PyObject *operand1_long = PyLong_FromLong(a);\n        PyObject *operand2_long = PyLong_FromLong(b);\n\n        // TODO: Change this to using CLONG once we specialize that too.\n        PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n        Py_DECREF(operand1_long);\n        Py_DECREF(operand2_long);\n\n        obj_result = r;\n        goto exit_result_object;\n    } else {\n        long c = a << b;\n\n        if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            clong_result = c;\n            goto exit_result_ok_clong;\n        }\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_LSHIFT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_LSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_lshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_lshift;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_LSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_LSHIFT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_LSHIFT_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_LSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_LSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_lshift available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_lshift;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_LSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_LSHIFT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_LSHIFT_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_LSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_LSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_lshift available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_lshift;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_LSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_LSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_lshift available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_lshift;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_LSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_LSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long c = a << b;\n\n            if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                // TODO: Change this to using CLONG once we specialize that too.\n                PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            } else {\n                clong_result = c;\n                goto exit_result_ok_clong;\n            }\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_LSHIFT_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_lshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_lshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_lshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_lshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for <<: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_LSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_LSHIFT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceMatmult.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"@\" (MATMULT) operations */\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_matrix_multiply available for this type.\n\n    {\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'long' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'int' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_LONG_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_matrix_multiply\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                               ? type1->tp_as_number->nb_matrix_multiply\n                               : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_OBJECT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_matrix_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2))\n                        ? type2->tp_as_number->nb_matrix_multiply\n                        : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_LONG_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_matrix_multiply available for this type.\n\n    {\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'float' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_FLOAT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_matrix_multiply\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                               ? type1->tp_as_number->nb_matrix_multiply\n                               : NULL;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_OBJECT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_matrix_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2))\n                        ? type2->tp_as_number->nb_matrix_multiply\n                        : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_FLOAT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x350\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MATMULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n#error Operator @ not implemented\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_matrix_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_matrix_multiply\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                               ? type1->tp_as_number->nb_matrix_multiply\n                               : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2))\n                        ? type2->tp_as_number->nb_matrix_multiply\n                        : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with Python3 only operator '@'\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for @: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MATMULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MATMULT_OBJECT_OBJECT(operand1, operand2);\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceMod.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"%\" (MOD) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_remainder\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_remainder;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_MOD_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_MOD_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_remainder(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_remainder\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_remainder;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_MOD_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_MOD_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_remainder(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_remainder\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_MOD_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_MOD_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n            goto exit_result_exception;\n        }\n\n        {\n            double mod = fmod(a, b);\n            if (mod) {\n                if ((b < 0) != (mod < 0)) {\n                    mod += b;\n                }\n            } else {\n                mod = copysign(0.0, b);\n            }\n\n            cfloat_result = mod;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_MOD_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0)) {\n            r += b;\n        }\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_MOD_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_MOD_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        goto exit_result_exception;\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        cfloat_result = mod;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_MOD_FLOAT_CFLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"STR\" to Python2 'str'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyString_Format(*operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyUnicode_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'unicode'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'tuple'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'list'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_LIST(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"DICT\" to Python 'dict'. */\nstatic inline bool _INPLACE_OPERATION_MOD_STR_DICT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'dict'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_STR_DICT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_DICT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyString_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyString_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyString_Type == type2) {\n        // return _BINARY_OPERATION_MOD_STR_STR_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyString_Format(*operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_STR_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_INT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"STR\" to Python2 'str'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyString_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'str'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"BYTES\" to Python3 'bytes'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_BYTES(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyBytes_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'bytes'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_BYTES(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_BYTES(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"UNICODE\" to Python2 'unicode',\n * Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyUnicode_Format(*operand1, operand2);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_UNICODE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'tuple'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'tuple'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'list'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'list'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_LIST(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"DICT\" to Python 'dict'. */\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_DICT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and 'dict'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and 'dict'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_DICT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_DICT(operand1, operand2);\n}\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyUnicode_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'unicode' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'str' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyUnicode_Type == type2) {\n        // return _BINARY_OPERATION_MOD_UNICODE_UNICODE_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyUnicode_Format(*operand1, operand2);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_UNICODE_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"BYTES\" to Python3 'bytes'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_BYTES(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_BYTES(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_BYTES(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyUnicode_Type.tp_as_number->nb_remainder;\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'str'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'tuple'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'list'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_LIST(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"DICT\" to Python 'dict'. */\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_DICT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyDict_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and 'dict'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_DICT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_DICT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MOD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_remainder available for this type.\n\n    {\n        binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyBytes_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: 'bytes' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MOD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyBytes_Type == type2) {\n        // return _BINARY_OPERATION_MOD_BYTES_BYTES_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n        PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MOD_BYTES_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MOD_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MOD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long r = a % b;\n\n            // Sign handling.\n            if (r != 0 && ((b ^ r) < 0)) {\n                r += b;\n            }\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_MOD_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_MOD_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_remainder\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_remainder;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for %%: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MOD_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MOD_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceMult.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"*\" (MULT) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_multiply : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_multiply;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_repeat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, *operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_MULT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MULT_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_multiply;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // Special case for \"*\", also work with sequence repeat from right argument.\n        if (true) {\n            ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, *operand1);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_MULT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MULT_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_multiply(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_multiply : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_multiply;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_repeat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, *operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_MULT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MULT_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // Special case for \"*\", also work with sequence repeat from right argument.\n        if (true) {\n            ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, *operand1);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_MULT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_multiply(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_MULT_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_MULT_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_multiply : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_multiply;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_repeat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, *operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_MULT_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_MULT_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_MULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // Special case for \"*\", also work with sequence repeat from right argument.\n        if (true) {\n            ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, *operand1);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_MULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_MULT_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a * b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_MULT_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_MULT_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_multiply;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_multiply;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_multiply;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        // No sequence repeat slot sq_repeat available for this type.\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        clong_result = longprod;\n        goto exit_result_ok_clong;\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        }\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_MULT_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_MULT_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    double r = a * b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_MULT_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_MULT_FLOAT_CFLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_STR_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = PyInt_AS_LONG(index_value);\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_STR_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_STR_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"STR\" to Python2 'str'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_STR(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyString_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = PyInt_AS_LONG(index_value);\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'str'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_STR(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_STR(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_UNICODE_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = PyInt_AS_LONG(index_value);\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_UNICODE_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_UNICODE_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"UNICODE\" to Python2 'unicode', Python3 'str'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = PyInt_AS_LONG(index_value);\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'unicode'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_UNICODE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_TUPLE_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyTuple_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = PyInt_AS_LONG(index_value);\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_TUPLE_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_TUPLE_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = PyInt_AS_LONG(index_value);\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'tuple'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_TUPLE(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LIST_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = PyInt_AS_LONG(index_value);\n                {\n                    ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_inplace_repeat;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LIST_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LIST_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_MULT_INT_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = PyInt_AS_LONG(index_value);\n                    {\n                        ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_inplace_repeat;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'list'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_INT_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_INT_LIST(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"LONG\" to Python2 'long', Python3\n * 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_UNICODE_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_UNICODE_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_UNICODE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"UNICODE\" to Python2 'unicode', Python3\n * 'str'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_UNICODE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyUnicode_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                    /* Above conversion indicates an error as -1 */\n                    if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                        goto exit_inplace_exception;\n                    }\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'unicode'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'str'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_UNICODE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_UNICODE(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_BYTES_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_BYTES_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_BYTES_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"BYTES\" to Python3 'bytes'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_BYTES(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyBytes_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                    /* Above conversion indicates an error as -1 */\n                    if (unlikely(count == -1)) {\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n                        goto exit_inplace_exception;\n                    }\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'bytes'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_BYTES(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_BYTES(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_TUPLE_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyTuple_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_TUPLE_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_TUPLE_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"TUPLE\" to Python 'tuple'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_TUPLE(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyTuple_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                    /* Above conversion indicates an error as -1 */\n                    if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                        goto exit_inplace_exception;\n                    }\n                    {\n                        ssizeargfunc repeatfunc = NULL;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'tuple'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'tuple'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_TUPLE(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_TUPLE(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LIST_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        if (unlikely(!1)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = operand2;\n\n            {\n                Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_inplace_repeat;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LIST_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LIST_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LIST\" to Python 'list'. */\nstatic inline bool _INPLACE_OPERATION_MULT_LONG_LIST(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyList_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n\n        // Statically recognized that coercion is not possible with these types\n\n        {\n            // No sequence repeat slot sq_repeat available for this type.\n            // No inplace sequence repeat slot sq_inplace_repeat available for this type.\n        }\n        if (true) {\n            if (unlikely(!1)) {\n                SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", *operand1);\n\n                goto exit_inplace_exception;\n            }\n\n            {\n                PyObject *index_value = *operand1;\n\n                {\n                    Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n\n                    /* Above conversion indicates an error as -1 */\n                    if (unlikely(count == -1)) {\n#if PYTHON_VERSION < 0x300\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'long' into an index-sized integer\");\n#else\n                        PyErr_Format(PyExc_OverflowError, \"cannot fit 'int' into an index-sized integer\");\n#endif\n                        goto exit_inplace_exception;\n                    }\n                    {\n                        ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_inplace_repeat;\n                        if (repeatfunc == NULL) {\n                            repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                        }\n                        PyObject *r = (*repeatfunc)(operand2, count);\n\n                        obj_result = r;\n                        goto exit_inplace_result_object;\n                    }\n                }\n            }\n        }\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'long' and 'list'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: 'int' and 'list'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LONG_LIST(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LONG_LIST(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"STR\" corresponds to Python2 'str' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyString_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyString_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        if (unlikely(!Nuitka_Index_Check(operand2))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = Nuitka_Number_Index(operand2);\n\n            if (unlikely(index_value == NULL)) {\n                goto exit_inplace_exception;\n            }\n\n            {\n                Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n                Py_DECREF(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_STR_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_STR_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"UNICODE\" corresponds to Python2 'unicode', Python3 'str' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyUnicode_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyUnicode_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        if (unlikely(!Nuitka_Index_Check(operand2))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = Nuitka_Number_Index(operand2);\n\n            if (unlikely(index_value == NULL)) {\n                goto exit_inplace_exception;\n            }\n\n            {\n                Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n                Py_DECREF(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_UNICODE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_UNICODE_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION >= 0x300\n/* Code referring to \"BYTES\" corresponds to Python3 'bytes' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyBytes_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyBytes_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        if (unlikely(!Nuitka_Index_Check(operand2))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = Nuitka_Number_Index(operand2);\n\n            if (unlikely(index_value == NULL)) {\n                goto exit_inplace_exception;\n            }\n\n            {\n                Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n                Py_DECREF(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_BYTES_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_BYTES_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"TUPLE\" corresponds to Python 'tuple' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyTuple_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyTuple_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        if (unlikely(!Nuitka_Index_Check(operand2))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = Nuitka_Number_Index(operand2);\n\n            if (unlikely(index_value == NULL)) {\n                goto exit_inplace_exception;\n            }\n\n            {\n                Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n                Py_DECREF(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = NULL;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_TUPLE_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_TUPLE_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LIST\" corresponds to Python 'list' and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_LIST_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyList_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_multiply available for this type.\n\n    {\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyList_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        if (unlikely(!Nuitka_Index_Check(operand2))) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", operand2);\n\n            goto exit_inplace_exception;\n        }\n\n        {\n            PyObject *index_value = Nuitka_Number_Index(operand2);\n\n            if (unlikely(index_value == NULL)) {\n                goto exit_inplace_exception;\n            }\n\n            {\n                Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n\n                Py_DECREF(index_value);\n\n                /* Above conversion indicates an error as -1 */\n                if (unlikely(count == -1)) {\n                    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", type2->tp_name);\n                    goto exit_inplace_exception;\n                }\n                {\n                    ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_inplace_repeat;\n                    if (repeatfunc == NULL) {\n                        repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;\n                    }\n                    PyObject *r = (*repeatfunc)(*operand1, count);\n\n                    obj_result = r;\n                    goto exit_inplace_result_object;\n                }\n            }\n        }\n\n        NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_LIST_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_LIST_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_MULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long longprod = (long)((unsigned long)a * b);\n        const double doubleprod = (double)a * (double)b;\n        const double doubled_longprod = (double)longprod;\n\n        if (likely(doubled_longprod == doubleprod)) {\n            clong_result = longprod;\n            goto exit_result_ok_clong;\n        } else {\n            const double diff = doubled_longprod - doubleprod;\n            const double absdiff = diff >= 0.0 ? diff : -diff;\n            const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n            if (likely(32.0 * absdiff <= absprod)) {\n                clong_result = longprod;\n                goto exit_result_ok_clong;\n            }\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_MULT_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_MULT_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_multiply : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_multiply;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        {\n            // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n            ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_inplace_repeat : NULL;\n            if (sq_slot == NULL) {\n                sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;\n            }\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, *operand1, operand2);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n        // Special case for \"*\", also work with sequence repeat from right argument.\n        if (type1->tp_as_sequence == NULL) {\n            ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;\n\n            if (sq_slot != NULL) {\n                PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, *operand1);\n\n                obj_result = result;\n                goto exit_inplace_result_object;\n            }\n        }\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for *: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_MULT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_MULT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceOlddiv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"/\" (OLDDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_divide : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_OLDDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_OLDDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_divide(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_LONG_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_divide : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_OLDDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_OBJECT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_OLDDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_LONG_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_FLOAT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_divide : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_OLDDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_OBJECT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_OLDDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_FLOAT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_FLOAT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_LONG_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        goto exit_result_exception;\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        clong_result = a_div_b;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_OLDDIV_INT_CLONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_OLDDIV_FLOAT_CFLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_OLDDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n            goto exit_result_exception;\n        }\n\n        /* TODO: Isn't this a very specific value only, of which we could\n         * hardcode the constant result. Not sure how well the C compiler\n         * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n         * -1 has to be rare anyway.\n         */\n\n        if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n            long a_div_b = a / b;\n            long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n            if (a_mod_b && (b ^ a_mod_b) < 0) {\n                a_mod_b += b;\n                a_div_b -= 1;\n            }\n\n            clong_result = a_div_b;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_OLDDIV_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_OLDDIV_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_divide : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_divide : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_OLDDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_OLDDIV_OBJECT_OBJECT(operand1, operand2);\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplacePow.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"**\" (POW) operations */\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_POW_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (b == 0) {\n        goto exit_result_ok_const_float_1_0;\n    }\n\n    if (Py_IS_NAN(a)) {\n        goto exit_result_ok_left;\n    }\n\n    if (Py_IS_NAN(b)) {\n        if (a == 1.0) {\n            goto exit_result_ok_const_float_1_0;\n        } else {\n            goto exit_result_ok_right;\n        }\n    }\n\n    if (Py_IS_INFINITY(b)) {\n        a = fabs(a);\n        if (a == 1.0) {\n            goto exit_result_ok_const_float_1_0;\n        } else if ((b > 0.0) == (a > 1.0)) {\n            long r = (long)fabs(b);\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n    if (Py_IS_INFINITY(a)) {\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r;\n\n        if (b > 0.0) {\n            r = b_is_odd ? a : fabs(a);\n        } else {\n            r = b_is_odd ? copysign(0.0, a) : 0.0;\n        }\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\n    if (a == 0.0) {\n        if (unlikely(b < 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                            \"0.0 cannot be raised to a negative power\");\n            goto exit_result_exception;\n        }\n\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r = b_is_odd ? a : 0.0;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\n    {\n        bool negate_result = false;\n\n        if (a < 0.0) {\n            if (unlikely(b != floor(b))) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                \"negative number cannot be raised to a fractional power\");\n                goto exit_result_exception;\n            }\n\n            a = -a;\n            negate_result = DOUBLE_IS_ODD_INTEGER(b);\n        }\n\n        if (a == 1.0) {\n            if (negate_result) {\n                goto exit_result_ok_const_float_minus_1_0;\n            } else {\n                goto exit_result_ok_const_float_1_0;\n            }\n        } else {\n            errno = 0;\n            double r = pow(a, b);\n\n            if (unlikely(errno != 0)) {\n                PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                goto exit_result_exception;\n            }\n\n            r = negate_result ? -r : r;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    goto exit_result_ok;\n\nexit_result_ok_right:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = operand2;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = MAKE_FLOAT_FROM_DOUBLE(0.0);\n    goto exit_result_ok;\n\nexit_result_ok_const_float_1_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = MAKE_FLOAT_FROM_DOUBLE(1.0);\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_1_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = MAKE_FLOAT_FROM_DOUBLE(-1.0);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_power : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        ternaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n        ternaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_power;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_POW_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (b == 0) {\n            goto exit_result_ok_const_float_1_0;\n        }\n\n        if (Py_IS_NAN(a)) {\n            goto exit_result_ok_left;\n        }\n\n        if (Py_IS_NAN(b)) {\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else {\n                goto exit_result_ok_right;\n            }\n        }\n\n        if (Py_IS_INFINITY(b)) {\n            a = fabs(a);\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else if ((b > 0.0) == (a > 1.0)) {\n                long r = (long)fabs(b);\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n        if (Py_IS_INFINITY(a)) {\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r;\n\n            if (b > 0.0) {\n                r = b_is_odd ? a : fabs(a);\n            } else {\n                r = b_is_odd ? copysign(0.0, a) : 0.0;\n            }\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        if (a == 0.0) {\n            if (unlikely(b < 0.0)) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                                \"0.0 cannot be raised to a negative power\");\n                goto exit_result_exception;\n            }\n\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r = b_is_odd ? a : 0.0;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        {\n            bool negate_result = false;\n\n            if (a < 0.0) {\n                if (unlikely(b != floor(b))) {\n                    PyThreadState *tstate = PyThreadState_GET();\n\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                    \"negative number cannot be raised to a fractional power\");\n                    goto exit_result_exception;\n                }\n\n                a = -a;\n                negate_result = DOUBLE_IS_ODD_INTEGER(b);\n            }\n\n            if (a == 1.0) {\n                if (negate_result) {\n                    goto exit_result_ok_const_float_minus_1_0;\n                } else {\n                    goto exit_result_ok_const_float_1_0;\n                }\n            } else {\n                errno = 0;\n                double r = pow(a, b);\n\n                if (unlikely(errno != 0)) {\n                    PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                    goto exit_result_exception;\n                }\n\n                r = negate_result ? -r : r;\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            }\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_ok_right:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = operand2;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(0.0);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_1_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(1.0);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_1_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(-1.0);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n        ternaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2, Py_None);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_POW_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (b == 0) {\n            goto exit_result_ok_const_float_1_0;\n        }\n\n        if (Py_IS_NAN(a)) {\n            goto exit_result_ok_left;\n        }\n\n        if (Py_IS_NAN(b)) {\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else {\n                goto exit_result_ok_right;\n            }\n        }\n\n        if (Py_IS_INFINITY(b)) {\n            a = fabs(a);\n            if (a == 1.0) {\n                goto exit_result_ok_const_float_1_0;\n            } else if ((b > 0.0) == (a > 1.0)) {\n                long r = (long)fabs(b);\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n        if (Py_IS_INFINITY(a)) {\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r;\n\n            if (b > 0.0) {\n                r = b_is_odd ? a : fabs(a);\n            } else {\n                r = b_is_odd ? copysign(0.0, a) : 0.0;\n            }\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        if (a == 0.0) {\n            if (unlikely(b < 0.0)) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,\n                                                \"0.0 cannot be raised to a negative power\");\n                goto exit_result_exception;\n            }\n\n            bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n            double r = b_is_odd ? a : 0.0;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n        {\n            bool negate_result = false;\n\n            if (a < 0.0) {\n                if (unlikely(b != floor(b))) {\n                    PyThreadState *tstate = PyThreadState_GET();\n\n                    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError,\n                                                    \"negative number cannot be raised to a fractional power\");\n                    goto exit_result_exception;\n                }\n\n                a = -a;\n                negate_result = DOUBLE_IS_ODD_INTEGER(b);\n            }\n\n            if (a == 1.0) {\n                if (negate_result) {\n                    goto exit_result_ok_const_float_minus_1_0;\n                } else {\n                    goto exit_result_ok_const_float_1_0;\n                }\n            } else {\n                errno = 0;\n                double r = pow(a, b);\n\n                if (unlikely(errno != 0)) {\n                    PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                    goto exit_result_exception;\n                }\n\n                r = negate_result ? -r : r;\n\n                cfloat_result = r;\n                goto exit_result_ok_cfloat;\n            }\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_ok_right:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = operand2;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(0.0);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_1_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(1.0);\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_1_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(-1.0);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_power(*operand1, operand2, Py_None);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_power : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        ternaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n        ternaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_power;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_POW_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_power(*operand1, operand2, Py_None);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyLong_Type.tp_as_number->nb_power;\n        ternaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2, Py_None);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_POW_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_power(*operand1, operand2, Py_None);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (b < 0) {\n        // TODO: Use CFLOAT once available.\n        PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n        PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n        PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n        Py_DECREF(operand1_float);\n        Py_DECREF(operand2_float);\n\n        obj_result = r;\n        goto exit_result_object;\n    } else {\n        long temp = a;\n        long ix = 1;\n        long bb = b;\n\n        while (bb > 0) {\n            long prev = ix;\n            if (bb & 1) {\n                ix = (unsigned long)ix * temp;\n                if (temp == 0) {\n                    break;\n                }\n                if (ix / temp != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n            bb >>= 1;\n            if (bb == 0) {\n                break;\n            }\n            prev = temp;\n            temp = (unsigned long)temp * temp;\n\n            if (prev != 0 && temp / prev != prev) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                obj_result = r;\n                goto exit_result_object;\n            }\n        }\n\n        clong_result = ix;\n        goto exit_result_ok_clong;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_power : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        ternaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n        ternaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_power;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_POW_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_POW_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyInt_Type.tp_as_number->nb_power;\n        ternaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2, Py_None);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_POW_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_POW_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_POW_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_POW_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_POW_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        ternaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_power;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyFloat_Type.tp_as_number->nb_power;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_POW_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        ternaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_power;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        ternaryfunc slot1 = PyLong_Type.tp_as_number->nb_power;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_POW_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_power available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        ternaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_power;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_POW_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (b < 0) {\n            // TODO: Use CFLOAT once available.\n            PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n            PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n            PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n            Py_DECREF(operand1_float);\n            Py_DECREF(operand2_float);\n\n            obj_result = r;\n            goto exit_result_object;\n        } else {\n            long temp = a;\n            long ix = 1;\n            long bb = b;\n\n            while (bb > 0) {\n                long prev = ix;\n                if (bb & 1) {\n                    ix = (unsigned long)ix * temp;\n                    if (temp == 0) {\n                        break;\n                    }\n                    if (ix / temp != prev) {\n                        PyObject *operand1_long = PyLong_FromLong(a);\n                        PyObject *operand2_long = PyLong_FromLong(b);\n\n                        PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                        Py_DECREF(operand1_long);\n                        Py_DECREF(operand2_long);\n\n                        obj_result = r;\n                        goto exit_result_object;\n                    }\n                }\n                bb >>= 1;\n                if (bb == 0) {\n                    break;\n                }\n                prev = temp;\n                temp = (unsigned long)temp * temp;\n\n                if (prev != 0 && temp / prev != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    obj_result = r;\n                    goto exit_result_object;\n                }\n            }\n\n            clong_result = ix;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_POW_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_POW_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    ternaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_power : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2, Py_None);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        ternaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_power : NULL;\n        ternaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_power : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2, Py_None);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2, Py_None);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        ternaryfunc slot = mv->nb_power;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2, Py_None);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for ** or pow(): '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_POW_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_POW_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceRshift.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \">>\" (RSHIFT) operations */\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_RSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_rshift(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_RSHIFT_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_RSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_rshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_rshift;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_RSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_RSHIFT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_RSHIFT_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_RSHIFT_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_RSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_rshift available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_RSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_RSHIFT_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_rshift(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_RSHIFT_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_RSHIFT_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_LONG_OBJECT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_RSHIFT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        goto exit_result_exception;\n    }\n\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        goto exit_result_ok_left;\n    } else if (b >= LONG_BIT) {\n        if (a < 0) {\n            goto exit_result_ok_const_int_neg_1;\n        } else {\n            goto exit_result_ok_const_int_0;\n        }\n    } else {\n        long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok_left:\n    goto exit_result_ok;\n\nexit_result_ok_const_int_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_int_0);\n    *operand1 = const_int_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_int_neg_1:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_int_neg_1);\n    *operand1 = const_int_neg_1;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_RSHIFT_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_RSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_rshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_rshift;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_RSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_RSHIFT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_0);\n        *operand1 = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_neg_1);\n        *operand1 = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_RSHIFT_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_RSHIFT_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_RSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_rshift available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_rshift;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_RSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_RSHIFT_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_0);\n        *operand1 = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_neg_1);\n        *operand1 = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_RSHIFT_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_RSHIFT_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_RSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_rshift available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_rshift;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_RSHIFT_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_RSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_rshift available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_rshift;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_RSHIFT_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_INT_LONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_RSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b < 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n            goto exit_result_exception;\n        }\n\n        /* Short cut for zero shift or shifting zero. */\n        if (a == 0 || b == 0) {\n            goto exit_result_ok_left;\n        } else if (b >= LONG_BIT) {\n            if (a < 0) {\n                goto exit_result_ok_const_int_neg_1;\n            } else {\n                goto exit_result_ok_const_int_0;\n            }\n        } else {\n            long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok_left:\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_0);\n        *operand1 = const_int_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_int_neg_1:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_int_neg_1);\n        *operand1 = const_int_neg_1;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_RSHIFT_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_rshift : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_rshift : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_rshift : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_rshift;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for >>: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_RSHIFT_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_RSHIFT_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceSub.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"-\" (SUB) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    const long x = (long)((unsigned long)a - b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_subtract;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_SUB_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_SUB_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_subtract;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_SUB_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_SUB_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n    PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n        if (Py_REFCNT(*operand1) == 1) {\n            Nuitka_LongUpdateFromCLong(&*operand1, r);\n            goto exit_result_ok;\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            obj_result = obj;\n            goto exit_result_object;\n        }\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    if (Py_REFCNT(*operand1) == 1) {\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n            } else {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative(*operand1);\n            }\n        } else {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n            } else {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n            }\n        }\n\n        goto exit_result_ok;\n    }\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n        Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n        bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyLong_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_subtract;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_SUB_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n            if (Py_REFCNT(*operand1) == 1) {\n                Nuitka_LongUpdateFromCLong(&*operand1, r);\n                goto exit_result_ok;\n            } else {\n                PyObject *obj = Nuitka_LongFromCLong(r);\n\n                obj_result = obj;\n                goto exit_result_object;\n            }\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        if (Py_REFCNT(*operand1) == 1) {\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n                } else {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                    Nuitka_LongSetSignNegative(*operand1);\n                }\n            } else {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                } else {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n                }\n            }\n\n            goto exit_result_ok;\n        }\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n\n                Nuitka_LongFlipSign(z);\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyLong_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_SUB_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_SUB_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n        PyLongObject *operand2_long_object = (PyLongObject *)operand2;\n\n        if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && Py_ABS(Py_SIZE(operand2_long_object)) <= 1) {\n            long r = MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object);\n\n            if (Py_REFCNT(*operand1) == 1) {\n                Nuitka_LongUpdateFromCLong(&*operand1, r);\n                goto exit_result_ok;\n            } else {\n                PyObject *obj = Nuitka_LongFromCLong(r);\n\n                obj_result = obj;\n                goto exit_result_object;\n            }\n            clong_result = r;\n            goto exit_result_ok_clong;\n        }\n\n        if (Py_REFCNT(*operand1) == 1) {\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n                } else {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                    Nuitka_LongSetSignNegative(*operand1);\n                }\n            } else {\n                if (b_negative) {\n                    *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                } else {\n                    *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n                }\n            }\n\n            goto exit_result_ok;\n        }\n        {\n            PyLongObject *z;\n\n            digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n            Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n            bool a_negative = Py_SIZE(operand1_long_object) < 0;\n            digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);\n            Py_ssize_t b_digit_count = Py_ABS(Py_SIZE(operand2_long_object));\n            bool b_negative = Py_SIZE(operand2_long_object) < 0;\n\n            if (a_negative) {\n                if (b_negative) {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n\n                Nuitka_LongFlipSign(z);\n            } else {\n                if (b_negative) {\n                    z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                } else {\n                    z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                }\n            }\n\n            obj_result = (PyObject *)z;\n            goto exit_result_object;\n        }\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyLong_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_SUB_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_SUB_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    double r = a - b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_SUB_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_SUB_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a - b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_SUB_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_SUB_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        double r = a - b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n    }\n\n    return __INPLACE_OPERATION_SUB_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_SUB_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_SUB_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_subtract;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_SUB_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_subtract available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_subtract;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_SUB_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    const long x = (long)((unsigned long)a - b);\n    bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n    if (likely(no_overflow)) {\n        clong_result = x;\n        goto exit_result_ok_clong;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyInt_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_SUB_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"DIGIT\" to C platform digit value for long\n * Python objects. */\nstatic inline bool _INPLACE_OPERATION_SUB_LONG_DIGIT(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyLongObject *operand1_long_object = (PyLongObject *)*operand1;\n\n    if (Py_ABS(Py_SIZE(operand1_long_object)) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {\n        long r = MEDIUM_VALUE(operand1_long_object) - (sdigit)operand2;\n\n        if (Py_REFCNT(*operand1) == 1) {\n            Nuitka_LongUpdateFromCLong(&*operand1, r);\n            goto exit_result_ok;\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            obj_result = obj;\n            goto exit_result_object;\n        }\n        clong_result = r;\n        goto exit_result_ok_clong;\n    }\n\n    if (Py_REFCNT(*operand1) == 1) {\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);\n            } else {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative(*operand1);\n            }\n        } else {\n            if (b_negative) {\n                *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);\n            } else {\n                *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);\n            }\n        }\n\n        goto exit_result_ok;\n    }\n    {\n        PyLongObject *z;\n\n        digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);\n        Py_ssize_t a_digit_count = Py_ABS(Py_SIZE(operand1_long_object));\n        bool a_negative = Py_SIZE(operand1_long_object) < 0;\n        digit const *b_digits = (digit *)&operand2;\n        Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);\n        bool b_negative = operand2 < 0;\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        obj_result = (PyObject *)z;\n        goto exit_result_object;\n    }\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_clong:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = PyLong_FromLong(clong_result);\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_LONG_DIGIT(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_SUB_LONG_DIGIT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_SUB_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    double r = a - b;\n\n    cfloat_result = r;\n    goto exit_result_ok_cfloat;\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n}\n\nbool INPLACE_OPERATION_SUB_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_SUB_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_SUB_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        const long x = (long)((unsigned long)a - b);\n        bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);\n        if (likely(no_overflow)) {\n            clong_result = x;\n            goto exit_result_ok_clong;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_clong:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        // That's our return value then. As we use a dedicated variable, it's\n        // OK that way.\n        *operand1 = PyInt_FromLong(clong_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_SUB_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_SUB_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot =\n        (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_subtract;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for -: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_SUB_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_SUB_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersOperationInplaceTruediv.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n/* C helpers for type in-place \"/\" (TRUEDIV) operations */\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = PyInt_AS_LONG(operand2);\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        goto exit_result_exception;\n    }\n\n    if (a == 0) {\n        if (b < 0) {\n            goto exit_result_ok_const_float_minus_0_0;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = operand2;\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_cfloat:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_float_0_0);\n    *operand1 = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_0_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_float_minus_0_0);\n    *operand1 = const_float_minus_0_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_INT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_INT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"INT\" to Python2 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_true_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyInt_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyInt_Type.tp_as_number->nb_true_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyInt_Type) {\n        // return _BINARY_OPERATION_TRUEDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_0_0);\n        *operand1 = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_minus_0_0);\n        *operand1 = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_OBJECT_INT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_OBJECT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_OBJECT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyInt_Type.tp_as_number->nb_true_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyInt_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyInt_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyInt_Type == type2) {\n        // return _BINARY_OPERATION_TRUEDIV_INT_INT_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_0_0);\n        *operand1 = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_minus_0_0);\n        *operand1 = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_INT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_INT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_INT_OBJECT(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(*operand1, operand2);\n    assert(x != Py_NotImplemented);\n\n    obj_result = x;\n    goto exit_result_object;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_LONG_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_LONG_LONG(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_true_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyLong_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_true_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'long'\", type1->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'int'\", type1->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyLong_Type) {\n        // return _BINARY_OPERATION_TRUEDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_OBJECT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyLong_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyLong_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and '%s'\", type2->tp_name);\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and '%s'\", type2->tp_name);\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyLong_Type == type2) {\n        // return _BINARY_OPERATION_TRUEDIV_LONG_LONG_INPLACE(operand1, operand2);\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(*operand1, operand2);\n        assert(x != Py_NotImplemented);\n\n        obj_result = x;\n        goto exit_result_object;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_LONG_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = PyFloat_AS_DOUBLE(operand2);\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_FLOAT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"FLOAT\" to Python 'float'. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_true_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == &PyFloat_Type)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and 'float'\", type1->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n\n    if (type1 == &PyFloat_Type) {\n        // return _BINARY_OPERATION_TRUEDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_OBJECT_FLOAT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"OBJECT\" to any Python object. */\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n        binaryfunc slot2 = NULL;\n\n        if (!(&PyFloat_Type == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and '%s'\", type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n    if (&PyFloat_Type == type2) {\n        // return _BINARY_OPERATION_TRUEDIV_FLOAT_FLOAT_INPLACE(operand1, operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        // Not every code path will make use of all possible results.\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyFloat_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyFloat_CheckExact(operand2));\n\n        const double a = PyFloat_AS_DOUBLE(*operand1);\n        const double b = PyFloat_AS_DOUBLE(operand2);\n\n        if (unlikely(b == 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n            goto exit_result_exception;\n        }\n\n        {\n            double r = a / b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n\n    exit_result_ok_cfloat:\n        if (Py_REFCNT(*operand1) == 1) {\n            PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n        } else {\n            // We got an object handed, that we have to release.\n            Py_DECREF(*operand1);\n\n            *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        }\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n\n    return __INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(operand1, operand2);\n}\n\nbool INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_FLOAT_OBJECT(operand1, operand2);\n}\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'long'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_FLOAT_LONG(operand1, operand2);\n}\n\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n#if PYTHON_VERSION < 0x300\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'float'\");\n#else\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n#endif\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_LONG_FLOAT(operand1, operand2);\n}\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'float' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_FLOAT_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_FLOAT_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"FLOAT\" to Python 'float'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyFloat_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyFloat_Type.tp_as_number->nb_true_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'float'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_INT_FLOAT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_INT_FLOAT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"LONG\" corresponds to Python2 'long', Python3 'int' and \"INT\" to Python2 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyLong_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyInt_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;\n        // Slot2 ignored on purpose, type1 takes precedence.\n\n        if (slot1 != NULL) {\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'long' and 'int'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_LONG_INT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_LONG_INT(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"LONG\" to Python2 'long', Python3 'int'. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n    CHECK_OBJECT(operand2);\n    assert(PyLong_CheckExact(operand2));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    // No inplace number slot nb_inplace_true_divide available for this type.\n\n    {\n        // Slot1 ignored on purpose, type2 takes precedence.\n        binaryfunc slot2 = NULL;\n\n        if (!(0)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = PyLong_Type.tp_as_number->nb_true_divide;\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        // Statically recognized that coercion is not possible with these types\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: 'int' and 'long'\");\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_INT_LONG(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_INT_LONG(operand1, operand2);\n}\n#endif\n\n#if PYTHON_VERSION < 0x300\n/* Code referring to \"INT\" corresponds to Python2 'int' and \"CLONG\" to C platform long value. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyInt_CheckExact(*operand1));\n\n    const long a = PyInt_AS_LONG(*operand1);\n    const long b = operand2;\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        goto exit_result_exception;\n    }\n\n    if (a == 0) {\n        if (b < 0) {\n            goto exit_result_ok_const_float_minus_0_0;\n        } else {\n            goto exit_result_ok_const_float_0_0;\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n    {\n        PyObject *operand1_object = *operand1;\n        PyObject *operand2_object = PyLong_FromLong(operand2);\n\n        PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n        assert(r != Py_NotImplemented);\n\n        Py_DECREF(operand2_object);\n\n        obj_result = r;\n        goto exit_result_object;\n    }\n\nexit_result_ok_cfloat:\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    goto exit_result_ok;\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        goto exit_result_exception;\n    }\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    *operand1 = obj_result;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_0_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_float_0_0);\n    *operand1 = const_float_0_0;\n    goto exit_result_ok;\n\nexit_result_ok_const_float_minus_0_0:\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n    Py_INCREF(const_float_minus_0_0);\n    *operand1 = const_float_minus_0_0;\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_INT_CLONG(PyObject **operand1, long operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_INT_CLONG(operand1, operand2);\n}\n#endif\n\n/* Code referring to \"FLOAT\" corresponds to Python 'float' and \"CFLOAT\" to C platform float value. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    CHECK_OBJECT(*operand1);\n    assert(PyFloat_CheckExact(*operand1));\n\n    const double a = PyFloat_AS_DOUBLE(*operand1);\n    const double b = operand2;\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        goto exit_result_exception;\n    }\n\n    {\n        double r = a / b;\n\n        cfloat_result = r;\n        goto exit_result_ok_cfloat;\n    }\n\nexit_result_ok_cfloat:\n    if (Py_REFCNT(*operand1) == 1) {\n        PyFloat_SET_DOUBLE(*operand1, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n    }\n    goto exit_result_ok;\n\nexit_result_ok:\n    return true;\n\nexit_result_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_FLOAT_CFLOAT(PyObject **operand1, double operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_FLOAT_CFLOAT(operand1, operand2);\n}\n\n/* Code referring to \"OBJECT\" corresponds to any Python object and \"OBJECT\" to any Python object. */\nstatic inline bool _INPLACE_OPERATION_TRUEDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    assert(operand1); // Pointer must be non-null.\n\n    CHECK_OBJECT(*operand1);\n    CHECK_OBJECT(operand2);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {\n\n        // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n        NUITKA_MAY_BE_UNUSED bool cbool_result;\n        NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n        NUITKA_MAY_BE_UNUSED long clong_result;\n        NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n        CHECK_OBJECT(*operand1);\n        assert(PyInt_CheckExact(*operand1));\n        CHECK_OBJECT(operand2);\n        assert(PyInt_CheckExact(operand2));\n\n        const long a = PyInt_AS_LONG(*operand1);\n        const long b = PyInt_AS_LONG(operand2);\n\n        if (unlikely(b == 0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n            goto exit_result_exception;\n        }\n\n        if (a == 0) {\n            if (b < 0) {\n                goto exit_result_ok_const_float_minus_0_0;\n            } else {\n                goto exit_result_ok_const_float_0_0;\n            }\n        }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n        if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n        } else\n#endif\n        {\n            double r = (double)a / (double)b;\n\n            cfloat_result = r;\n            goto exit_result_ok_cfloat;\n        }\n        {\n            PyObject *operand1_object = *operand1;\n            PyObject *operand2_object = operand2;\n\n            PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);\n            assert(r != Py_NotImplemented);\n\n            obj_result = r;\n            goto exit_result_object;\n        }\n\n    exit_result_ok_cfloat:\n\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);\n        goto exit_result_ok;\n\n    exit_result_object:\n        if (unlikely(obj_result == NULL)) {\n            goto exit_result_exception;\n        }\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n\n        *operand1 = obj_result;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_0_0);\n        *operand1 = const_float_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok_const_float_minus_0_0:\n        // We got an object handed, that we have to release.\n        Py_DECREF(*operand1);\n        Py_INCREF(const_float_minus_0_0);\n        *operand1 = const_float_minus_0_0;\n        goto exit_result_ok;\n\n    exit_result_ok:\n        return true;\n\n    exit_result_exception:\n        return false;\n    }\n#endif\n\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n        if (PyFloat_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_TRUEDIV_FLOAT_FLOAT(operand1, operand2);\n        }\n#if PYTHON_VERSION >= 0x300\n        if (PyLong_CheckExact(operand2)) {\n            return _INPLACE_OPERATION_TRUEDIV_LONG_LONG(operand1, operand2);\n        }\n#endif\n    }\n\n    PyTypeObject *type1 = Py_TYPE(*operand1);\n    PyTypeObject *type2 = Py_TYPE(operand2);\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    binaryfunc islot = (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1))\n                           ? type1->tp_as_number->nb_inplace_true_divide\n                           : NULL;\n\n    if (islot != NULL) {\n        PyObject *x = islot(*operand1, operand2);\n\n        if (x != Py_NotImplemented) {\n            obj_result = x;\n            goto exit_inplace_result_object;\n        }\n\n        Py_DECREF(x);\n    }\n\n    {\n        binaryfunc slot1 =\n            (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;\n        binaryfunc slot2 = NULL;\n\n        if (!(type1 == type2)) {\n            // Different types, need to consider second value slot.\n\n            slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide\n                                                                                  : NULL;\n\n            if (slot1 == slot2) {\n                slot2 = NULL;\n            }\n        }\n\n        if (slot1 != NULL) {\n            if (slot2 != NULL) {\n                if (Nuitka_Type_IsSubtype(type2, type1)) {\n                    PyObject *x = slot2(*operand1, operand2);\n\n                    if (x != Py_NotImplemented) {\n                        obj_result = x;\n                        goto exit_inplace_result_object;\n                    }\n\n                    Py_DECREF(x);\n                    slot2 = NULL;\n                }\n            }\n\n            PyObject *x = slot1(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n        if (slot2 != NULL) {\n            PyObject *x = slot2(*operand1, operand2);\n\n            if (x != Py_NotImplemented) {\n                obj_result = x;\n                goto exit_inplace_result_object;\n            }\n\n            Py_DECREF(x);\n        }\n\n#if PYTHON_VERSION < 0x300\n        if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {\n            coercion c1 =\n                (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;\n\n            if (c1 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c1(&coerced1, &coerced2);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n            coercion c2 =\n                (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;\n\n            if (c2 != NULL) {\n                PyObject *coerced1 = *operand1;\n                PyObject *coerced2 = operand2;\n\n                int err = c2(&coerced2, &coerced1);\n\n                if (unlikely(err < 0)) {\n                    goto exit_inplace_exception;\n                }\n\n                if (err == 0) {\n                    PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                    if (likely(mv == NULL)) {\n                        binaryfunc slot = mv->nb_true_divide;\n\n                        if (likely(slot != NULL)) {\n                            PyObject *x = slot(coerced1, coerced2);\n\n                            Py_DECREF(coerced1);\n                            Py_DECREF(coerced2);\n\n                            obj_result = x;\n                            goto exit_inplace_result_object;\n                        }\n                    }\n\n                    // nb_coerce took a reference.\n                    Py_DECREF(coerced1);\n                    Py_DECREF(coerced2);\n                }\n            }\n        }\n#endif\n\n        PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for /: '%s' and '%s'\", type1->tp_name,\n                     type2->tp_name);\n        goto exit_inplace_exception;\n    }\n\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n\nexit_inplace_exception:\n    return false;\n}\n\nbool INPLACE_OPERATION_TRUEDIV_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {\n    return _INPLACE_OPERATION_TRUEDIV_OBJECT_OBJECT(operand1, operand2);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersProfiling.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/**\n * This is responsible for profiling Nuitka using \"vmprof\".\n */\n\n#if _NUITKA_PROFILE\n\n#include <time.h>\n\nstruct timespec diff(struct timespec start, struct timespec end);\n\nstatic struct timespec getTimespecDiff(struct timespec start, struct timespec end) {\n    struct timespec temp;\n\n    if ((end.tv_nsec - start.tv_nsec) < 0) {\n        temp.tv_sec = end.tv_sec - start.tv_sec - 1;\n        temp.tv_nsec = 1000000000 + end.tv_nsec - start.tv_nsec;\n    } else {\n        temp.tv_sec = end.tv_sec - start.tv_sec;\n        temp.tv_nsec = end.tv_nsec - start.tv_nsec;\n    }\n\n    return temp;\n}\n\nstatic FILE *tempfile_profile;\nstatic PyObject *vmprof_module;\n\nstatic struct timespec time1, time2;\n\nvoid startProfiling(void) {\n    tempfile_profile = fopen(\"nuitka-performance.dat\", \"w+b\");\n\n    // Might be necessary to import \"site\" module to find \"vmprof\", lets just\n    // hope we don't suffer too much from that. If we do, what might be done\n    // is to try and just have the \"PYTHONPATH\" from it from out user.\n    PyImport_ImportModule(\"site\");\n    vmprof_module = PyImport_ImportModule(\"vmprof\");\n\n    // Abort if it's not there.\n    if (vmprof_module == NULL) {\n        PyErr_Print();\n        abort();\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, PyObject_GetAttrString(vmprof_module, \"enable\"),\n                                                     PyInt_FromLong(fileno(tempfile_profile)));\n\n    if (result == NULL) {\n        PyErr_Print();\n        abort();\n    }\n\n    clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);\n}\n\nvoid stopProfiling(void) {\n    clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);\n\n    // Save the current exception, if any, we must preserve it.\n    PyThreadState *tstate = PyThreadState_GET();\n\n    struct Nuitka_ExceptionPreservationItem saved_exception_state;\n    FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n\n    PyObject *result = CALL_FUNCTION_NO_ARGS(tstate, PyObject_GetAttrString(vmprof_module, \"disable\"));\n\n    if (result == NULL) {\n        CLEAR_ERROR_OCCURRED(tstate);\n    }\n\n    fclose(tempfile_profile);\n\n    FILE *tempfile_times = fopen(\"nuitka-times.dat\", \"wb\");\n\n    struct timespec diff = getTimespecDiff(time1, time2);\n\n    long delta_ns = diff.tv_sec * 1000000000 + diff.tv_nsec;\n    fprintf(tempfile_times, \"%ld\\n\", delta_ns);\n\n    fclose(tempfile_times);\n\n    RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersPythonPgo.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/**\n * This is responsible for collection of Nuitka Python PGO information. It writes\n * traces to files, for reuse in a future Python compilation of the same program.\n */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nstatic FILE *pgo_output;\n\n// Saving space by not repeating strings.\n\n// Allocated strings\nstatic char const **PGO_ProbeNameMappings = NULL;\nuint32_t PGO_ProbeNameMappings_size = 0;\nuint32_t PGO_ProbeNameMappings_used = 0;\n\nuint32_t PGO_getStringID(char const *str) {\n    for (uint32_t i = 0; i < PGO_ProbeNameMappings_used; i++) {\n        if (str == PGO_ProbeNameMappings[i]) {\n            return i;\n        }\n    }\n\n    if (PGO_ProbeNameMappings_used == PGO_ProbeNameMappings_size) {\n        PGO_ProbeNameMappings_size += 10000;\n        PGO_ProbeNameMappings = realloc(PGO_ProbeNameMappings, PGO_ProbeNameMappings_size);\n    }\n\n    PGO_ProbeNameMappings[PGO_ProbeNameMappings_used] = str;\n    PGO_ProbeNameMappings_used += 1;\n\n    return PGO_ProbeNameMappings_used - 1;\n}\n\nstatic void PGO_writeString(char const *value) {\n    uint32_t id = PGO_getStringID(value);\n    fwrite(&id, sizeof(id), 1, pgo_output);\n}\n\nvoid PGO_Initialize(void) {\n    // We expect an environment variable to guide us to where the PGO information\n    // shall be written to.\n    char const *output_filename = getenv(\"NUITKA_PGO_OUTPUT\");\n\n    if (unlikely(output_filename == NULL)) {\n        NUITKA_CANNOT_GET_HERE(\"NUITKA_PGO_OUTPUT needs to be set\");\n    }\n\n    pgo_output = fopen(output_filename, \"wb\");\n\n    if (unlikely(output_filename == NULL)) {\n        fprintf(stderr, \"Error, failed to open '%s' for writing.\", output_filename);\n        exit(27);\n    }\n\n    fputs(\"KAY.PGO\", pgo_output);\n    fflush(pgo_output);\n\n    PGO_ProbeNameMappings_size = 10000;\n    PGO_ProbeNameMappings = malloc(PGO_ProbeNameMappings_size * sizeof(char const *));\n}\n\nvoid PGO_Finalize(void) {\n    PGO_writeString(\"END\");\n\n    uint32_t offset = (uint32_t)ftell(pgo_output);\n\n    for (uint32_t i = 0; i < PGO_ProbeNameMappings_used; i++) {\n        fputs(PGO_ProbeNameMappings[i], pgo_output);\n        fputc(0, pgo_output);\n    }\n\n    fwrite(&PGO_ProbeNameMappings_used, sizeof(PGO_ProbeNameMappings_used), 1, pgo_output);\n    fwrite(&offset, sizeof(offset), 1, pgo_output);\n\n    fputs(\"YAK.PGO\", pgo_output);\n    fclose(pgo_output);\n}\n\nvoid PGO_onProbePassed(char const *probe_str, char const *module_name, uint32_t probe_arg) {\n    PGO_writeString(probe_str);\n    PGO_writeString(module_name);\n    // TODO: Variable args depending on probe type?\n    fwrite(&probe_arg, sizeof(probe_arg), 1, pgo_output);\n}\n\nvoid PGO_onModuleEntered(char const *module_name) { PGO_onProbePassed(\"ModuleEnter\", module_name, 0); }\nvoid PGO_onModuleExit(char const *module_name, bool error) { PGO_onProbePassed(\"ModuleExit\", module_name, error); }\nvoid PGO_onTechnicalModule(char const *module_name) { PGO_onProbePassed(\"ModuleTechnical\", module_name, 0); }\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersRaising.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to work with lists.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nstatic void FORMAT_TYPE_ERROR1(PyObject **exception_type, PyObject **exception_value, char const *format,\n                               char const *arg) {\n    *exception_type = PyExc_TypeError;\n    Py_INCREF(*exception_type);\n\n    *exception_value = Nuitka_String_FromFormat(format, arg);\n    CHECK_OBJECT(*exception_value);\n}\n\n#if PYTHON_VERSION >= 0x270\nstatic void FORMAT_TYPE_ERROR2(PyObject **exception_type, PyObject **exception_value, char const *format,\n                               char const *arg1, char const *arg2) {\n    *exception_type = PyExc_TypeError;\n    Py_INCREF(*exception_type);\n\n    *exception_value = Nuitka_String_FromFormat(format, arg1, arg2);\n    CHECK_OBJECT(*exception_value);\n}\n#endif\n\n#if PYTHON_VERSION < 0x266\n#define WRONG_EXCEPTION_TYPE_ERROR_MESSAGE \"exceptions must be classes or instances, not %s\"\n#elif PYTHON_VERSION < 0x300\n#define WRONG_EXCEPTION_TYPE_ERROR_MESSAGE \"exceptions must be old-style classes or derived from BaseException, not %s\"\n#else\n#define WRONG_EXCEPTION_TYPE_ERROR_MESSAGE \"exceptions must derive from BaseException\"\n#endif\n\nvoid RAISE_EXCEPTION_WITH_TYPE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                               PyTracebackObject **exception_tb) {\n    *exception_value = NULL;\n    *exception_tb = NULL;\n\n#if PYTHON_VERSION < 0x300\n    // Next, repeatedly, replace a tuple exception with its first item\n    while (PyTuple_Check(*exception_type) && PyTuple_GET_SIZE(*exception_type) > 0) {\n        PyObject *tmp = *exception_type;\n        *exception_type = PyTuple_GET_ITEM(*exception_type, 0);\n        Py_INCREF(*exception_type);\n        Py_DECREF(tmp);\n    }\n#endif\n\n    if (PyExceptionClass_Check(*exception_type)) {\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n#if PYTHON_VERSION >= 0x270\n        if (unlikely(!PyExceptionInstance_Check(*exception_value))) {\n            PyObject *old_exception_type = *exception_type;\n            PyObject *old_exception_value = *exception_value;\n\n            FORMAT_TYPE_ERROR2(exception_type, exception_value,\n                               \"calling %s() should have returned an instance of BaseException, not '%s'\",\n                               Py_TYPE(*exception_type)->tp_name, Py_TYPE(*exception_value)->tp_name);\n\n            Py_DECREF(old_exception_type);\n            Py_DECREF(old_exception_value);\n\n            return;\n        }\n#endif\n\n#if PYTHON_VERSION >= 0x300\n        CHAIN_EXCEPTION(tstate, *exception_value);\n#endif\n        return;\n    } else if (PyExceptionInstance_Check(*exception_type)) {\n        *exception_value = *exception_type;\n        *exception_type = PyExceptionInstance_Class(*exception_type);\n        Py_INCREF(*exception_type);\n\n#if PYTHON_VERSION >= 0x300\n        CHAIN_EXCEPTION(tstate, *exception_value);\n\n        // Note: Cannot be assigned here.\n        assert(*exception_tb == NULL);\n        *exception_tb = GET_EXCEPTION_TRACEBACK(*exception_value);\n        Py_XINCREF(*exception_tb);\n#endif\n\n        return;\n    } else {\n        PyObject *old_exception_type = *exception_type;\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n\n        return;\n    }\n}\n\n#if PYTHON_VERSION >= 0x300\nvoid RAISE_EXCEPTION_WITH_CAUSE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                PyTracebackObject **exception_tb, PyObject *exception_cause) {\n    CHECK_OBJECT(*exception_type);\n    CHECK_OBJECT(exception_cause);\n    *exception_tb = NULL;\n\n    // None is not a cause.\n    if (exception_cause == Py_None) {\n        Py_DECREF(exception_cause);\n        exception_cause = NULL;\n    } else if (PyExceptionClass_Check(exception_cause)) {\n        PyObject *old_exception_cause = exception_cause;\n        exception_cause = PyObject_CallObject(exception_cause, NULL);\n        Py_DECREF(old_exception_cause);\n\n        if (unlikely(exception_cause == NULL)) {\n            Py_DECREF(*exception_type);\n            Py_XDECREF(*exception_tb);\n\n            struct Nuitka_ExceptionPreservationItem exception_state;\n            FETCH_ERROR_OCCURRED_STATE(tstate, &exception_state);\n\n            ASSIGN_ARGS_FROM_EXCEPTION_PRESERVATION_STATE(&exception_state, exception_type, exception_value,\n                                                          exception_tb);\n            RELEASE_ERROR_OCCURRED_STATE(&exception_state);\n\n            return;\n        }\n    }\n\n    if (unlikely(exception_cause != NULL && !PyExceptionInstance_Check(exception_cause))) {\n        Py_DECREF(*exception_type);\n        Py_XDECREF(*exception_tb);\n\n        PyObject *old_exception_cause = exception_cause;\n\n#ifdef _NUITKA_FULL_COMPAT\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"exception causes must derive from BaseException\");\n        FETCH_ERROR_OCCURRED(tstate, exception_type, exception_value, exception_tb);\n#else\n        FORMAT_TYPE_ERROR1(exception_type, exception_value,\n                           \"exception causes must derive from BaseException (%s does not)\",\n                           Py_TYPE(exception_cause)->tp_name);\n#endif\n\n        Py_XDECREF(old_exception_cause);\n        return;\n    }\n\n    if (PyExceptionClass_Check(*exception_type)) {\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n\n        if (unlikely(!PyExceptionInstance_Check(*exception_value))) {\n            Py_DECREF(*exception_tb);\n            Py_XDECREF(exception_cause);\n\n            PyObject *old_exception_type = *exception_type;\n            PyObject *old_exception_value = *exception_value;\n\n            FORMAT_TYPE_ERROR2(exception_type, exception_value,\n                               \"calling %s() should have returned an instance of BaseException, not '%s'\",\n                               Py_TYPE(*exception_type)->tp_name, Py_TYPE(*exception_value)->tp_name);\n\n            Py_DECREF(old_exception_type);\n            Py_XDECREF(old_exception_value);\n\n            return;\n        }\n\n        PyException_SetCause(*exception_value, exception_cause);\n\n        CHAIN_EXCEPTION(tstate, *exception_value);\n        return;\n    } else if (PyExceptionInstance_Check(*exception_type)) {\n        *exception_value = *exception_type;\n        *exception_type = PyExceptionInstance_Class(*exception_type);\n        Py_INCREF(*exception_type);\n\n        PyException_SetCause(*exception_value, exception_cause);\n\n        CHAIN_EXCEPTION(tstate, *exception_value);\n        return;\n    } else {\n        Py_XDECREF(exception_cause);\n\n        PyObject *old_exception_type = *exception_type;\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n\n        return;\n    }\n}\n#endif\n\nvoid RAISE_EXCEPTION_WITH_VALUE(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                PyTracebackObject **exception_tb) {\n    CHECK_OBJECT(*exception_type);\n    CHECK_OBJECT(*exception_value);\n    *exception_tb = NULL;\n\n    // Non-empty tuple exceptions are the first element.\n    while (unlikely(PyTuple_Check(*exception_type) && PyTuple_GET_SIZE(*exception_type) > 0)) {\n        *exception_type = PyTuple_GET_ITEM(*exception_type, 0);\n    }\n\n    if (PyExceptionClass_Check(*exception_type)) {\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n#if PYTHON_VERSION >= 0x270\n        if (unlikely(!PyExceptionInstance_Check(*exception_value))) {\n            PyObject *old_exception_type = *exception_type;\n            PyObject *old_exception_value = *exception_type;\n\n            FORMAT_TYPE_ERROR2(exception_type, exception_value,\n                               \"calling %s() should have returned an instance of BaseException, not '%s'\",\n                               Py_TYPE(*exception_type)->tp_name, Py_TYPE(*exception_value)->tp_name);\n\n            Py_DECREF(old_exception_type);\n            Py_DECREF(old_exception_value);\n        }\n#endif\n\n        return;\n    } else if (PyExceptionInstance_Check(*exception_type)) {\n        if (unlikely(*exception_value != NULL && *exception_value != Py_None)) {\n            Py_DECREF(*exception_type);\n            Py_DECREF(*exception_value);\n\n            *exception_type = PyExc_TypeError;\n            Py_INCREF(PyExc_TypeError);\n            *exception_value = Nuitka_String_FromString(\"instance exception may not have a separate value\");\n\n            return;\n        }\n\n        // The type is rather a value, so we are overriding it here.\n        *exception_value = *exception_type;\n        *exception_type = PyExceptionInstance_Class(*exception_type);\n        Py_INCREF(*exception_type);\n\n        return;\n    } else {\n        PyObject *old_exception_type = *exception_type;\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n\n        return;\n    }\n}\n\nvoid RAISE_EXCEPTION_IMPLICIT(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                              PyTracebackObject **exception_tb) {\n    CHECK_OBJECT(*exception_type);\n    CHECK_OBJECT(*exception_value);\n    *exception_tb = NULL;\n\n    // Non-empty tuple exceptions are the first element.\n    while (unlikely(PyTuple_Check(*exception_type) && PyTuple_GET_SIZE(*exception_type) > 0)) {\n        *exception_type = PyTuple_GET_ITEM(*exception_type, 0);\n    }\n\n    if (PyExceptionClass_Check(*exception_type)) {\n#if PYTHON_VERSION >= 0x340\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n        CHAIN_EXCEPTION(tstate, *exception_value);\n#endif\n\n        return;\n    } else if (PyExceptionInstance_Check(*exception_type)) {\n#if PYTHON_VERSION >= 0x340\n        CHAIN_EXCEPTION(tstate, *exception_value);\n#endif\n\n        // The type is rather a value, so we are overriding it here.\n        *exception_value = *exception_type;\n        *exception_type = PyExceptionInstance_Class(*exception_type);\n        Py_INCREF(*exception_type);\n\n        return;\n    } else {\n        PyObject *old_exception_type = *exception_type;\n        Py_DECREF(*exception_value);\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n\n#if PYTHON_VERSION >= 0x340\n        CHAIN_EXCEPTION(tstate, *exception_value);\n#endif\n\n        return;\n    }\n}\n\nvoid RAISE_EXCEPTION_WITH_TRACEBACK(PyThreadState *tstate, PyObject **exception_type, PyObject **exception_value,\n                                    PyTracebackObject **exception_tb) {\n    CHECK_OBJECT(*exception_type);\n    CHECK_OBJECT(*exception_value);\n\n    if (*exception_tb == (PyTracebackObject *)Py_None) {\n        Py_DECREF(*exception_tb);\n        *exception_tb = NULL;\n    }\n\n    // Non-empty tuple exceptions are the first element.\n    while (unlikely(PyTuple_Check(*exception_type) && PyTuple_GET_SIZE(*exception_type) > 0)) {\n        *exception_type = PyTuple_GET_ITEM(*exception_type, 0);\n    }\n\n    if (PyExceptionClass_Check(*exception_type)) {\n        NORMALIZE_EXCEPTION(tstate, exception_type, exception_value, exception_tb);\n#if PYTHON_VERSION >= 0x270\n        if (unlikely(!PyExceptionInstance_Check(*exception_value))) {\n            PyObject *old_exception_type = *exception_type;\n            PyObject *old_exception_value = *exception_value;\n\n            FORMAT_TYPE_ERROR2(exception_type, exception_value,\n                               \"calling %s() should have returned an instance of BaseException, not '%s'\",\n                               Py_TYPE(*exception_type)->tp_name, Py_TYPE(*exception_value)->tp_name);\n\n            Py_DECREF(old_exception_type);\n            Py_DECREF(old_exception_value);\n        }\n#endif\n\n        return;\n    } else if (PyExceptionInstance_Check(*exception_type)) {\n        if (unlikely(*exception_value != NULL && *exception_value != Py_None)) {\n            Py_DECREF(*exception_type);\n            Py_XDECREF(*exception_value);\n            Py_XDECREF(*exception_tb);\n\n            *exception_type = PyExc_TypeError;\n            Py_INCREF(PyExc_TypeError);\n            *exception_value = Nuitka_String_FromString(\"instance exception may not have a separate value\");\n\n            return;\n        }\n\n        // The type is rather a value, so we are overriding it here.\n        *exception_value = *exception_type;\n        *exception_type = PyExceptionInstance_Class(*exception_type);\n        Py_INCREF(*exception_type);\n\n        return;\n    } else {\n        PyObject *old_exception_type = *exception_type;\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n\n        return;\n    }\n}\n\nbool RERAISE_EXCEPTION(PyObject **exception_type, PyObject **exception_value, PyTracebackObject **exception_tb) {\n    PyThreadState *tstate = PyThreadState_GET();\n    assert(tstate);\n\n#if PYTHON_VERSION < 0x3b0\n    *exception_type = EXC_TYPE(tstate) != NULL ? EXC_TYPE(tstate) : Py_None;\n    Py_INCREF(*exception_type);\n    *exception_value = EXC_VALUE(tstate);\n    Py_XINCREF(*exception_value);\n    *exception_tb = (PyTracebackObject *)EXC_TRACEBACK(tstate);\n    Py_XINCREF(*exception_tb);\n\n    if (unlikely(*exception_type == Py_None)) {\n#if PYTHON_VERSION >= 0x300\n        Py_DECREF(*exception_type);\n\n        Py_INCREF(PyExc_RuntimeError);\n        *exception_type = PyExc_RuntimeError;\n        *exception_value = PyUnicode_FromString(\"No active exception to reraise\");\n        *exception_tb = NULL;\n#else\n        PyObject *old_exception_type = *exception_type;\n\n        FORMAT_TYPE_ERROR1(exception_type, exception_value, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE,\n                           Py_TYPE(*exception_type)->tp_name);\n\n        Py_DECREF(old_exception_type);\n#endif\n\n        return false;\n    }\n#else\n    *exception_value = EXC_VALUE(tstate);\n\n    if (*exception_value == Py_None || *exception_value == NULL) {\n        Py_INCREF(PyExc_RuntimeError);\n        *exception_type = PyExc_RuntimeError;\n        *exception_value = PyUnicode_FromString(\"No active exception to reraise\");\n        *exception_tb = NULL;\n\n        return false;\n    } else {\n        Py_INCREF(*exception_value);\n\n        *exception_type = PyExceptionInstance_Class(*exception_value);\n        Py_INCREF(*exception_type);\n        *exception_tb = GET_EXCEPTION_TRACEBACK(*exception_value);\n        Py_XINCREF(*exception_tb);\n    }\n#endif\n\n    CHECK_OBJECT(*exception_type);\n    CHECK_OBJECT(*exception_value);\n    CHECK_OBJECT_X(*exception_tb);\n\n    return true;\n}\n\n// Raise NameError for a given variable name.\nvoid RAISE_CURRENT_EXCEPTION_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name, PyObject **exception_type,\n                                        PyObject **exception_value) {\n    PyObject *exception_value_str =\n        Nuitka_String_FromFormat(\"name '%s' is not defined\", Nuitka_String_AsString_Unchecked(variable_name));\n\n    *exception_value = MAKE_EXCEPTION_FROM_TYPE_ARG0(tstate, PyExc_NameError, exception_value_str);\n    Py_DECREF(exception_value_str);\n\n    *exception_type = PyExc_NameError;\n    Py_INCREF(PyExc_NameError);\n\n#if PYTHON_VERSION >= 0x300\n    CHAIN_EXCEPTION(tstate, *exception_value);\n#endif\n}\n\n#if PYTHON_VERSION < 0x340\nvoid RAISE_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name,\n                                               PyObject **exception_type, PyObject **exception_value) {\n    PyObject *exception_value_str =\n        Nuitka_String_FromFormat(\"global name '%s' is not defined\", Nuitka_String_AsString_Unchecked(variable_name));\n\n    *exception_value = MAKE_EXCEPTION_FROM_TYPE_ARG0(tstate, PyExc_NameError, exception_value_str);\n    Py_DECREF(exception_value_str);\n\n    *exception_type = PyExc_NameError;\n    Py_INCREF(PyExc_NameError);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\n\nvoid RAISE_EXCEPTION_WITH_CAUSE_STATE(PyThreadState *tstate, struct Nuitka_ExceptionPreservationItem *exception_state,\n                                      PyObject *exception_cause) {\n#if PYTHON_VERSION < 0x3c0\n    RAISE_EXCEPTION_WITH_CAUSE(tstate, &exception_state->exception_type, &exception_state->exception_value,\n                               &exception_state->exception_tb, exception_cause);\n#else\n    PyObject *exception_type = (PyObject *)Py_TYPE(exception_state->exception_value);\n    Py_INCREF(exception_type);\n    PyTracebackObject *exception_tb = NULL;\n\n    // Python3.12: We are being a bit lazy there, by preparing the 3 things when\n    // we shouldn't really need them.\n    RAISE_EXCEPTION_WITH_CAUSE(tstate, &exception_type, &exception_state->exception_value, &exception_tb,\n                               exception_cause);\n\n    Py_DECREF(exception_type);\n#endif\n}\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersSafeStrings.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers are used to interact safely with buffers to not overflow.\n\n   Currently this is used for char and wchar_t string buffers and shared\n   between onefile bootstrap for Windows, plugins and Nuitka core, but\n   should not use any Python level functionality.\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#if defined(_WIN32)\n#include <windows.h>\n#endif\n#include <stdbool.h>\n#include <stdio.h>\n#endif\n\n#include \"nuitka/safe_string_ops.h\"\n\nvoid copyStringSafe(char *buffer, char const *source, size_t buffer_size) {\n    if (strlen(source) >= buffer_size) {\n        abort();\n    }\n\n    if (buffer != source) {\n        strcpy(buffer, source);\n    }\n}\n\nvoid copyStringSafeN(char *buffer, char const *source, size_t n, size_t buffer_size) {\n    if (n >= buffer_size - 1) {\n        abort();\n    }\n    strncpy(buffer, source, n);\n    buffer[n] = 0;\n}\n\nvoid copyStringSafeW(wchar_t *buffer, wchar_t const *source, size_t buffer_size) {\n    while (*source != 0) {\n        if (buffer_size < 1) {\n            abort();\n        }\n\n        *buffer++ = *source++;\n        buffer_size -= 1;\n    }\n\n    *buffer = 0;\n}\n\nvoid appendStringSafe(char *target, char const *source, size_t buffer_size) {\n    if (strlen(source) + strlen(target) >= buffer_size) {\n        abort();\n    }\n    strcat(target, source);\n}\n\nvoid appendCharSafe(char *target, char c, size_t buffer_size) {\n    char source[2] = {c, 0};\n\n    appendStringSafe(target, source, buffer_size);\n}\n\nvoid appendWStringSafeW(wchar_t *target, wchar_t const *source, size_t buffer_size) {\n    while (*target != 0) {\n        target++;\n        buffer_size -= 1;\n    }\n\n    while (*source != 0) {\n        if (buffer_size < 1) {\n            abort();\n        }\n\n        *target++ = *source++;\n        buffer_size -= 1;\n    }\n\n    *target = 0;\n}\n\nvoid appendCharSafeW(wchar_t *target, char c, size_t buffer_size) {\n    while (*target != 0) {\n        target++;\n        buffer_size -= 1;\n    }\n\n    if (buffer_size < 1) {\n        abort();\n    }\n\n    target += wcslen(target);\n    char buffer_c[2] = {c, 0};\n    NUITKA_MAY_BE_UNUSED size_t res = mbstowcs(target, buffer_c, 2);\n    assert(res == 1);\n}\n\nvoid appendStringSafeW(wchar_t *target, char const *source, size_t buffer_size) {\n    while (*target != 0) {\n        target++;\n        buffer_size -= 1;\n    }\n\n    while (*source != 0) {\n        appendCharSafeW(target, *source, buffer_size);\n        target++;\n        source++;\n        buffer_size -= 1;\n    }\n}\n\nvoid printOSErrorMessage(char const *message, error_code_t error_code) {\n#if defined(_WIN32)\n    LPCTSTR err_buffer;\n\n    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,\n                  error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPTSTR)&err_buffer, 0, NULL);\n\n    fprintf(stderr, \"%s ([Error \" ERROR_CODE_FORMAT_STR \"] %s)\\n\", message, error_code, err_buffer);\n#else\n    fprintf(stderr, \"%s: %s\\n\", message, strerror(error_code));\n#endif\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersSequences.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to work with sequence interfaces.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nbool SEQUENCE_SET_ITEM(PyObject *sequence, Py_ssize_t index, PyObject *value) {\n    CHECK_OBJECT(sequence);\n    CHECK_OBJECT(value);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(sequence)->tp_as_sequence;\n\n    if (tp_as_sequence != NULL && tp_as_sequence->sq_ass_item) {\n        if (index < 0) {\n            if (tp_as_sequence->sq_length) {\n                Py_ssize_t length = (*tp_as_sequence->sq_length)(sequence);\n\n                if (length < 0) {\n                    return false;\n                }\n\n                index += length;\n            }\n        }\n\n        int res = tp_as_sequence->sq_ass_item(sequence, index, value);\n\n        if (unlikely(res == -1)) {\n            return false;\n        }\n\n        return true;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object does not support item assignment\", sequence);\n        return false;\n    }\n}\n\nPy_ssize_t Nuitka_PyObject_Size(PyObject *sequence) {\n    CHECK_OBJECT(sequence);\n\n    PySequenceMethods *tp_as_sequence = Py_TYPE(sequence)->tp_as_sequence;\n\n    if (tp_as_sequence && tp_as_sequence->sq_length) {\n        return tp_as_sequence->sq_length(sequence);\n    }\n\n    return PyMapping_Size(sequence);\n}\n\nPyObject *Nuitka_Number_Index(PyObject *item) {\n    CHECK_OBJECT(item);\n\n#if PYTHON_VERSION < 0x300\n    if (PyInt_Check(item) || PyLong_Check(item))\n#else\n    if (PyLong_Check(item))\n#endif\n    {\n        Py_INCREF(item);\n        return item;\n    }\n\n    if (unlikely(!Nuitka_Index_Check(item))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object cannot be interpreted as an integer\", item);\n        return NULL;\n    }\n\n    PyObject *result = Py_TYPE(item)->tp_as_number->nb_index(item);\n\n#if PYTHON_VERSION < 0x300\n    if (result == NULL || PyInt_CheckExact(result) || PyLong_CheckExact(result)) {\n        return result;\n    }\n#else\n    if (result == NULL || PyLong_CheckExact(result)) {\n        return result;\n    }\n#endif\n\n#if PYTHON_VERSION < 0x300\n    if (!PyInt_Check(result) && !PyLong_Check(result))\n#else\n    if (!PyLong_Check(result))\n#endif\n    {\n#if PYTHON_VERSION < 0x300\n        char const *message = \"__index__ returned non-(int,long) (type %s)\";\n#else\n        char const *message = \"__index__ returned non-int (type %s)\";\n#endif\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(message, result);\n\n        Py_DECREF(result);\n        return NULL;\n    }\n\n    return result;\n}\n\n#if PYTHON_VERSION >= 0x3a0\nPyObject *Nuitka_Number_IndexAsLong(PyObject *item) {\n    PyObject *result = Nuitka_Number_Index(item);\n\n    if (result != NULL) {\n        PyObject *converted_long = _PyLong_Copy((PyLongObject *)result);\n        Py_DECREF(result);\n\n        return converted_long;\n    } else {\n        return NULL;\n    }\n}\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersSlices.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* Small helpers to work with slices their contents */\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x3a0\nPyObject *Nuitka_Slice_New(PyObject *start, PyObject *stop, PyObject *step) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n\n    PySliceObject *result_slice;\n\n    if (interp->slice_cache != NULL) {\n        result_slice = interp->slice_cache;\n        interp->slice_cache = NULL;\n\n        Nuitka_Py_NewReference((PyObject *)result_slice);\n    } else {\n        result_slice = (PySliceObject *)Nuitka_GC_New(&PySlice_Type);\n\n        if (result_slice == NULL) {\n            return NULL;\n        }\n    }\n\n    if (step == NULL) {\n        step = Py_None;\n    }\n    if (start == NULL) {\n        start = Py_None;\n    }\n    if (stop == NULL) {\n        stop = Py_None;\n    }\n\n    Py_INCREF(step);\n    result_slice->step = step;\n    Py_INCREF(start);\n    result_slice->start = start;\n    Py_INCREF(stop);\n    result_slice->stop = stop;\n\n    Nuitka_GC_Track(result_slice);\n\n    return (PyObject *)result_slice;\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersStrings.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* This helpers is used to quickly create a string object from C char.\n\n   Currently this is used for string subscript code, but may also be used\n   for the \"char\" C type in the future.\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\nPyObject *STRING_FROM_CHAR(unsigned char c) {\n    // TODO: A switch statement might be faster, because no object needs to be\n    // created at all, this here is how CPython does it.\n    char s[1];\n    s[0] = (char)c;\n\n    return Nuitka_String_FromStringAndSize(s, 1);\n}\n\n/* The \"chr\" built-in.\n\n   This could also use a table for the interned single char strings, to be\n   faster on Python2. For Python3 no such table is reasonable.\n*/\n\nPyObject *BUILTIN_CHR(PyThreadState *tstate, PyObject *value) {\n    long x = PyInt_AsLong(value);\n\n    if (unlikely(x == -1 && HAS_ERROR_OCCURRED(tstate))) {\n#if PYTHON_VERSION < 0x300 && defined(_NUITKA_FULL_COMPAT)\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"an integer is required\");\n#else\n        PyErr_Format(PyExc_TypeError, \"an integer is required (got type %s)\", Py_TYPE(value)->tp_name);\n#endif\n        return NULL;\n    }\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(x < 0 || x >= 256)) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"chr() arg not in range(256)\");\n        return NULL;\n    }\n\n    // TODO: A switch statement might be faster, because no object needs to be\n    // created at all, this is how CPython does it.\n    char s[1];\n    s[0] = (char)x;\n\n    return PyString_FromStringAndSize(s, 1);\n#else\n    PyObject *result = PyUnicode_FromOrdinal(x);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    assert(PyUnicode_Check(result));\n\n    return result;\n#endif\n}\n\n/* The \"ord\" built-in.\n\n*/\n\nPyObject *BUILTIN_ORD(PyObject *value) {\n    long result;\n\n    if (likely(PyBytes_Check(value))) {\n        Py_ssize_t size = PyBytes_GET_SIZE(value);\n\n        if (likely(size == 1)) {\n            result = (long)(((unsigned char *)PyBytes_AS_STRING(value))[0]);\n        } else {\n            PyErr_Format(PyExc_TypeError, \"ord() expected a character, but string of length %zd found\", size);\n            return NULL;\n        }\n    } else if (PyByteArray_Check(value)) {\n        Py_ssize_t size = PyByteArray_GET_SIZE(value);\n\n        if (likely(size == 1)) {\n            result = (long)(((unsigned char *)PyByteArray_AS_STRING(value))[0]);\n        } else {\n            PyErr_Format(PyExc_TypeError,\n                         \"ord() expected a character, but byte array of length \"\n                         \"%zd found\",\n                         size);\n            return NULL;\n        }\n    } else if (PyUnicode_Check(value)) {\n#if PYTHON_VERSION >= 0x300\n        if (unlikely(PyUnicode_READY(value) == -1)) {\n            return NULL;\n        }\n\n        Py_ssize_t size = PyUnicode_GET_LENGTH(value);\n#else\n        Py_ssize_t size = PyUnicode_GET_SIZE(value);\n#endif\n\n        if (likely(size == 1)) {\n#if PYTHON_VERSION >= 0x300\n            result = (long)(PyUnicode_READ_CHAR(value, 0));\n#else\n            result = (long)(*PyUnicode_AS_UNICODE(value));\n#endif\n        } else {\n            PyErr_Format(PyExc_TypeError,\n                         \"ord() expected a character, but unicode string of \"\n                         \"length %zd found\",\n                         size);\n            return NULL;\n        }\n    } else {\n        PyErr_Format(PyExc_TypeError, \"ord() expected string of length 1, but %s found\", Py_TYPE(value)->tp_name);\n        return NULL;\n    }\n\n    return PyInt_FromLong(result);\n}\n\n#if PYTHON_VERSION >= 0x300\n\n#define _PyUnicode_UTF8_LENGTH(op) (((PyCompactUnicodeObject *)(op))->utf8_length)\n#define PyUnicode_UTF8_LENGTH(op)                                                                                      \\\n    (assert(_PyUnicode_CHECK(op)), assert(PyUnicode_IS_READY(op)),                                                     \\\n     PyUnicode_IS_COMPACT_ASCII(op) ? ((PyASCIIObject *)(op))->length : _PyUnicode_UTF8_LENGTH(op))\n#define _PyUnicode_WSTR(op) (((PyASCIIObject *)(op))->wstr)\n#if PYTHON_VERSION < 0x3c0\n#define _PyUnicode_WSTR_LENGTH(op) (((PyCompactUnicodeObject *)(op))->wstr_length)\n#endif\n#define _PyUnicode_LENGTH(op) (((PyASCIIObject *)(op))->length)\n#define _PyUnicode_STATE(op) (((PyASCIIObject *)(op))->state)\n#define _PyUnicode_HASH(op) (((PyASCIIObject *)(op))->hash)\n#define _PyUnicode_KIND(op) (((PyASCIIObject *)(op))->state.kind)\n#define _PyUnicode_DATA_ANY(op) (((PyUnicodeObject *)(op))->data.any)\n\n#if PYTHON_VERSION < 0x3c0\n#undef PyUnicode_READY\n#define PyUnicode_READY(op) ((PyUnicode_IS_READY(op) ? 0 : _PyUnicode_Ready(op)))\n#endif\n\n#define _PyUnicode_SHARE_UTF8(op) (assert(!PyUnicode_IS_COMPACT_ASCII(op)), (_PyUnicode_UTF8(op) == PyUnicode_DATA(op)))\n#define _PyUnicode_SHARE_WSTR(op) ((_PyUnicode_WSTR(unicode) == PyUnicode_DATA(op)))\n\n#define _PyUnicode_HAS_UTF8_MEMORY(op)                                                                                 \\\n    ((!PyUnicode_IS_COMPACT_ASCII(op) && _PyUnicode_UTF8(op) && _PyUnicode_UTF8(op) != PyUnicode_DATA(op)))\n\n#define _PyUnicode_HAS_WSTR_MEMORY(op)                                                                                 \\\n    ((_PyUnicode_WSTR(op) && (!PyUnicode_IS_READY(op) || _PyUnicode_WSTR(op) != PyUnicode_DATA(op))))\n\n#define _PyUnicode_CONVERT_BYTES(from_type, to_type, begin, end, to)                                                   \\\n    do {                                                                                                               \\\n        to_type *_to = (to_type *)(to);                                                                                \\\n        const from_type *_iter = (from_type *)(begin);                                                                 \\\n        const from_type *_end = (from_type *)(end);                                                                    \\\n        Py_ssize_t n = (_end) - (_iter);                                                                               \\\n        const from_type *_unrolled_end = _iter + _Py_SIZE_ROUND_DOWN(n, 4);                                            \\\n        while (_iter < (_unrolled_end)) {                                                                              \\\n            _to[0] = (to_type)_iter[0];                                                                                \\\n            _to[1] = (to_type)_iter[1];                                                                                \\\n            _to[2] = (to_type)_iter[2];                                                                                \\\n            _to[3] = (to_type)_iter[3];                                                                                \\\n            _iter += 4;                                                                                                \\\n            _to += 4;                                                                                                  \\\n        }                                                                                                              \\\n        while (_iter < (_end))                                                                                         \\\n            *_to++ = (to_type)(*_iter++);                                                                              \\\n    } while (0)\n\nextern int ucs1lib_find_max_char(const Py_UCS1 *begin, const Py_UCS1 *end);\n\nstatic void _NuitkaUnicode_FastCopyCharacters(PyObject *to, Py_ssize_t to_start, PyObject *from, Py_ssize_t from_start,\n                                              Py_ssize_t how_many) {\n    assert(from_start + how_many <= PyUnicode_GET_LENGTH(from));\n    assert(to_start + how_many <= PyUnicode_GET_LENGTH(to));\n\n    assert(how_many > 0);\n\n    unsigned int from_kind = PyUnicode_KIND(from);\n    void *from_data = PyUnicode_DATA(from);\n\n    unsigned int to_kind = PyUnicode_KIND(to);\n    void *to_data = PyUnicode_DATA(to);\n\n    if (from_kind == to_kind) {\n        memcpy((char *)to_data + to_kind * to_start, (char *)from_data + from_kind * from_start, to_kind * how_many);\n    } else if (from_kind == PyUnicode_1BYTE_KIND && to_kind == PyUnicode_2BYTE_KIND) {\n        _PyUnicode_CONVERT_BYTES(Py_UCS1, Py_UCS2, PyUnicode_1BYTE_DATA(from) + from_start,\n                                 PyUnicode_1BYTE_DATA(from) + from_start + how_many,\n                                 PyUnicode_2BYTE_DATA(to) + to_start);\n    } else if (from_kind == PyUnicode_1BYTE_KIND && to_kind == PyUnicode_4BYTE_KIND) {\n        _PyUnicode_CONVERT_BYTES(Py_UCS1, Py_UCS4, PyUnicode_1BYTE_DATA(from) + from_start,\n                                 PyUnicode_1BYTE_DATA(from) + from_start + how_many,\n                                 PyUnicode_4BYTE_DATA(to) + to_start);\n    } else if (from_kind == PyUnicode_2BYTE_KIND && to_kind == PyUnicode_4BYTE_KIND) {\n        _PyUnicode_CONVERT_BYTES(Py_UCS2, Py_UCS4, PyUnicode_2BYTE_DATA(from) + from_start,\n                                 PyUnicode_2BYTE_DATA(from) + from_start + how_many,\n                                 PyUnicode_4BYTE_DATA(to) + to_start);\n    } else {\n        assert(PyUnicode_MAX_CHAR_VALUE(from) > PyUnicode_MAX_CHAR_VALUE(to));\n\n        if (from_kind == PyUnicode_2BYTE_KIND && to_kind == PyUnicode_1BYTE_KIND) {\n            _PyUnicode_CONVERT_BYTES(Py_UCS2, Py_UCS1, PyUnicode_2BYTE_DATA(from) + from_start,\n                                     PyUnicode_2BYTE_DATA(from) + from_start + how_many,\n                                     PyUnicode_1BYTE_DATA(to) + to_start);\n        } else if (from_kind == PyUnicode_4BYTE_KIND && to_kind == PyUnicode_1BYTE_KIND) {\n            _PyUnicode_CONVERT_BYTES(Py_UCS4, Py_UCS1, PyUnicode_4BYTE_DATA(from) + from_start,\n                                     PyUnicode_4BYTE_DATA(from) + from_start + how_many,\n                                     PyUnicode_1BYTE_DATA(to) + to_start);\n        } else if (from_kind == PyUnicode_4BYTE_KIND && to_kind == PyUnicode_2BYTE_KIND) {\n            _PyUnicode_CONVERT_BYTES(Py_UCS4, Py_UCS2, PyUnicode_4BYTE_DATA(from) + from_start,\n                                     PyUnicode_4BYTE_DATA(from) + from_start + how_many,\n                                     PyUnicode_2BYTE_DATA(to) + to_start);\n        } else {\n            assert(false);\n        }\n    }\n}\n\nstatic int _NuitkaUnicode_modifiable(PyObject *unicode) {\n    if (Py_REFCNT(unicode) != 1)\n        return 0;\n    if (_PyUnicode_HASH(unicode) != -1)\n        return 0;\n    // TODO: That ought to be impossible with refcnt 1.\n    if (PyUnicode_CHECK_INTERNED(unicode))\n        return 0;\n    return 1;\n}\n\n#if PYTHON_VERSION < 0x3c0\nstatic PyObject *_NuitkaUnicode_New(Py_ssize_t length) {\n    assert(length != 0);\n\n    if (length > ((PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(Py_UNICODE)) - 1)) {\n        return PyErr_NoMemory();\n    }\n\n    PyUnicodeObject *unicode = PyObject_New(PyUnicodeObject, &PyUnicode_Type);\n\n    if (unlikely(unicode == NULL)) {\n        return NULL;\n    }\n    Py_ssize_t new_size = sizeof(Py_UNICODE) * ((size_t)length + 1);\n\n    _PyUnicode_WSTR_LENGTH(unicode) = length;\n    _PyUnicode_HASH(unicode) = -1;\n    _PyUnicode_STATE(unicode).interned = 0;\n    _PyUnicode_STATE(unicode).kind = 0;\n    _PyUnicode_STATE(unicode).compact = 0;\n    _PyUnicode_STATE(unicode).ready = 0;\n    _PyUnicode_STATE(unicode).ascii = 0;\n    _PyUnicode_DATA_ANY(unicode) = NULL;\n    _PyUnicode_LENGTH(unicode) = 0;\n    _PyUnicode_UTF8(unicode) = NULL;\n    _PyUnicode_UTF8_LENGTH(unicode) = 0;\n\n    _PyUnicode_WSTR(unicode) = (Py_UNICODE *)PyObject_MALLOC(new_size);\n    if (!_PyUnicode_WSTR(unicode)) {\n        Py_DECREF(unicode);\n        PyErr_NoMemory();\n        return NULL;\n    }\n\n    _PyUnicode_WSTR(unicode)[0] = 0;\n    _PyUnicode_WSTR(unicode)[length] = 0;\n\n    return (PyObject *)unicode;\n}\n\nstatic PyObject *_NuitkaUnicode_resize_copy(PyObject *unicode, Py_ssize_t length) {\n    if (_PyUnicode_KIND(unicode) != PyUnicode_WCHAR_KIND) {\n        PyObject *copy = PyUnicode_New(length, PyUnicode_MAX_CHAR_VALUE(unicode));\n        if (unlikely(copy == NULL)) {\n            return NULL;\n        }\n\n        Py_ssize_t copy_length = Py_MIN(length, PyUnicode_GET_LENGTH(unicode));\n        _NuitkaUnicode_FastCopyCharacters(copy, 0, unicode, 0, copy_length);\n\n        return copy;\n    } else {\n        PyObject *w = _NuitkaUnicode_New(length);\n        if (unlikely(w == NULL)) {\n            return NULL;\n        }\n        Py_ssize_t copy_length = _PyUnicode_WSTR_LENGTH(unicode);\n        copy_length = Py_MIN(copy_length, length);\n        memcpy(_PyUnicode_WSTR(w), _PyUnicode_WSTR(unicode), copy_length * sizeof(wchar_t));\n        return w;\n    }\n}\n\n#endif\n\n// We use older form code, make some backward compatible defines available.\n#if PYTHON_VERSION >= 0x390\n\n#ifdef Py_REF_DEBUG\n#define _Py_DEC_REFTOTAL _Py_RefTotal--;\n#else\n#define _Py_DEC_REFTOTAL\n#endif\n\n#ifdef Py_TRACE_REFS\n#define _Py_ForgetReference(unicode) _Py_ForgetReference(unicode)\n#else\n#define _Py_ForgetReference(unicode)\n#endif\n\n#endif\n\n#if PYTHON_VERSION < 0x3c0\nstatic PyObject *_NuitkaUnicode_resize_compact(PyObject *unicode, Py_ssize_t length) {\n    assert(PyUnicode_IS_COMPACT(unicode));\n\n    Py_ssize_t char_size = PyUnicode_KIND(unicode);\n    Py_ssize_t struct_size;\n\n    if (PyUnicode_IS_ASCII(unicode)) {\n        struct_size = sizeof(PyASCIIObject);\n    } else {\n        struct_size = sizeof(PyCompactUnicodeObject);\n    }\n\n    int share_wstr = _PyUnicode_SHARE_WSTR(unicode);\n\n    if (length > ((PY_SSIZE_T_MAX - struct_size) / char_size - 1)) {\n        PyErr_NoMemory();\n        return NULL;\n    }\n    Py_ssize_t new_size = (struct_size + (length + 1) * char_size);\n\n    if (_PyUnicode_HAS_UTF8_MEMORY(unicode)) {\n        PyObject_DEL(_PyUnicode_UTF8(unicode));\n        _PyUnicode_UTF8(unicode) = NULL;\n        _PyUnicode_UTF8_LENGTH(unicode) = 0;\n    }\n    _Py_DEC_REFTOTAL;\n    _Py_ForgetReference(unicode);\n\n    PyObject *new_unicode = (PyObject *)PyObject_REALLOC(unicode, new_size);\n    if (unlikely(new_unicode == NULL)) {\n        Nuitka_Py_NewReference(unicode);\n\n        PyErr_NoMemory();\n        return NULL;\n    }\n    unicode = new_unicode;\n    Nuitka_Py_NewReference(unicode);\n\n    _PyUnicode_LENGTH(unicode) = length;\n    if (share_wstr) {\n        _PyUnicode_WSTR(unicode) = (wchar_t *)PyUnicode_DATA(unicode);\n        if (!PyUnicode_IS_ASCII(unicode)) {\n            _PyUnicode_WSTR_LENGTH(unicode) = length;\n        }\n    } else if (_PyUnicode_HAS_WSTR_MEMORY(unicode)) {\n        PyObject_DEL(_PyUnicode_WSTR(unicode));\n        _PyUnicode_WSTR(unicode) = NULL;\n        if (!PyUnicode_IS_ASCII(unicode)) {\n            _PyUnicode_WSTR_LENGTH(unicode) = 0;\n        }\n    }\n\n    PyUnicode_WRITE(PyUnicode_KIND(unicode), PyUnicode_DATA(unicode), length, 0);\n\n    return unicode;\n}\n\nstatic int _NuitkaUnicode_resize_inplace(PyObject *unicode, Py_ssize_t length) {\n    assert(!PyUnicode_IS_COMPACT(unicode));\n    assert(Py_REFCNT(unicode) == 1);\n\n    if (PyUnicode_IS_READY(unicode)) {\n        void *data = _PyUnicode_DATA_ANY(unicode);\n        Py_ssize_t char_size = PyUnicode_KIND(unicode);\n        int share_wstr = _PyUnicode_SHARE_WSTR(unicode);\n        int share_utf8 = _PyUnicode_SHARE_UTF8(unicode);\n\n        if (length > (PY_SSIZE_T_MAX / char_size - 1)) {\n            PyErr_NoMemory();\n            return -1;\n        }\n        Py_ssize_t new_size = (length + 1) * char_size;\n\n        if (!share_utf8 && _PyUnicode_HAS_UTF8_MEMORY(unicode)) {\n            PyObject_DEL(_PyUnicode_UTF8(unicode));\n            _PyUnicode_UTF8(unicode) = NULL;\n            _PyUnicode_UTF8_LENGTH(unicode) = 0;\n        }\n\n        data = (PyObject *)PyObject_REALLOC(data, new_size);\n        if (data == NULL) {\n            PyErr_NoMemory();\n            return -1;\n        }\n        _PyUnicode_DATA_ANY(unicode) = data;\n        if (share_wstr) {\n            _PyUnicode_WSTR(unicode) = (wchar_t *)data;\n            _PyUnicode_WSTR_LENGTH(unicode) = length;\n        }\n        if (share_utf8) {\n            _PyUnicode_UTF8(unicode) = (char *)data;\n            _PyUnicode_UTF8_LENGTH(unicode) = length;\n        }\n        _PyUnicode_LENGTH(unicode) = length;\n        PyUnicode_WRITE(PyUnicode_KIND(unicode), data, length, 0);\n\n        if (share_wstr || _PyUnicode_WSTR(unicode) == NULL) {\n            return 0;\n        }\n    }\n    assert(_PyUnicode_WSTR(unicode) != NULL);\n\n    if (length > PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t) - 1) {\n        PyErr_NoMemory();\n        return -1;\n    }\n    Py_ssize_t new_size = sizeof(wchar_t) * (length + 1);\n    wchar_t *wstr = _PyUnicode_WSTR(unicode);\n    wstr = (wchar_t *)PyObject_REALLOC(wstr, new_size);\n\n    if (!wstr) {\n        PyErr_NoMemory();\n        return -1;\n    }\n    _PyUnicode_WSTR(unicode) = wstr;\n    _PyUnicode_WSTR(unicode)[length] = 0;\n    _PyUnicode_WSTR_LENGTH(unicode) = length;\n\n    return 0;\n}\n\nstatic int _NuitkaUnicode_resize(PyObject **p_unicode, Py_ssize_t length) {\n    PyObject *unicode = *p_unicode;\n    Py_ssize_t old_length;\n\n#if PYTHON_VERSION < 0x3c0\n    if (_PyUnicode_KIND(unicode) == PyUnicode_WCHAR_KIND) {\n        old_length = PyUnicode_WSTR_LENGTH(unicode);\n    } else\n#endif\n    {\n        old_length = PyUnicode_GET_LENGTH(unicode);\n    }\n\n    if (old_length == length) {\n        return 0;\n    }\n\n    if (length == 0) {\n        Py_DECREF(*p_unicode);\n        *p_unicode = const_str_empty;\n        return 0;\n    }\n\n    if (!_NuitkaUnicode_modifiable(unicode)) {\n        PyObject *copy = _NuitkaUnicode_resize_copy(unicode, length);\n        if (copy == NULL)\n            return -1;\n        Py_DECREF(*p_unicode);\n        *p_unicode = copy;\n        return 0;\n    }\n\n    if (PyUnicode_IS_COMPACT(unicode)) {\n        PyObject *new_unicode = _NuitkaUnicode_resize_compact(unicode, length);\n        if (new_unicode == NULL)\n            return -1;\n        *p_unicode = new_unicode;\n        return 0;\n    }\n\n    return _NuitkaUnicode_resize_inplace(unicode, length);\n}\n#endif\n\nPyObject *UNICODE_CONCAT(PyThreadState *tstate, PyObject *left, PyObject *right) {\n    if (left == const_str_empty) {\n        Py_INCREF(right);\n        return right;\n    }\n    if (right == const_str_empty) {\n        Py_INCREF(left);\n        return left;\n    }\n\n    if (PyUnicode_READY(left) == -1 || PyUnicode_READY(right) == -1) {\n        return NULL;\n    }\n\n    Py_ssize_t left_len = PyUnicode_GET_LENGTH(left);\n    Py_ssize_t right_len = PyUnicode_GET_LENGTH(right);\n    if (left_len > PY_SSIZE_T_MAX - right_len) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_OverflowError, \"strings are too large to concat\");\n        return NULL;\n    }\n    Py_ssize_t new_len = left_len + right_len;\n\n    Py_UCS4 max_char = PyUnicode_MAX_CHAR_VALUE(left);\n    Py_UCS4 max_char2 = PyUnicode_MAX_CHAR_VALUE(right);\n    max_char = Py_MAX(max_char, max_char2);\n\n    PyObject *result = PyUnicode_New(new_len, max_char);\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    _NuitkaUnicode_FastCopyCharacters(result, 0, left, 0, left_len);\n    _NuitkaUnicode_FastCopyCharacters(result, left_len, right, 0, right_len);\n\n    return result;\n}\n\nbool UNICODE_APPEND(PyThreadState *tstate, PyObject **p_left, PyObject *right) {\n    assert(p_left);\n\n    PyObject *left = *p_left;\n\n    if (left == const_str_empty) {\n        Py_DECREF(left);\n        Py_INCREF(right);\n        *p_left = right;\n        return true;\n    }\n\n    if (right == const_str_empty)\n        return true;\n\n    if (PyUnicode_READY(left) == -1 || PyUnicode_READY(right) == -1) {\n        return false;\n    }\n\n    Py_ssize_t left_len = PyUnicode_GET_LENGTH(left);\n    Py_ssize_t right_len = PyUnicode_GET_LENGTH(right);\n\n    if (left_len > PY_SSIZE_T_MAX - right_len) {\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_OverflowError, \"strings are too large to concat\");\n        return false;\n    }\n    Py_ssize_t new_len = left_len + right_len;\n\n    if (_NuitkaUnicode_modifiable(left) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) &&\n        !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {\n        if (unlikely(_NuitkaUnicode_resize(p_left, new_len) != 0)) {\n            return false;\n        }\n\n        _NuitkaUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);\n    } else {\n        Py_UCS4 max_char = PyUnicode_MAX_CHAR_VALUE(left);\n        Py_UCS4 max_char2 = PyUnicode_MAX_CHAR_VALUE(right);\n\n        max_char = Py_MAX(max_char, max_char2);\n\n        PyObject *res = PyUnicode_New(new_len, max_char);\n        if (unlikely(res == NULL)) {\n            return false;\n        }\n\n        _NuitkaUnicode_FastCopyCharacters(res, 0, left, 0, left_len);\n        _NuitkaUnicode_FastCopyCharacters(res, left_len, right, 0, right_len);\n\n        Py_DECREF(left);\n        *p_left = res;\n    }\n\n    return true;\n}\n#endif\n\nPyObject *UNICODE_JOIN(PyThreadState *tstate, PyObject *str, PyObject *iterable) {\n    CHECK_OBJECT(str);\n    CHECK_OBJECT(iterable);\n    assert(PyUnicode_CheckExact(str));\n\n    return PyUnicode_Join(str, iterable);\n}\n\nPyObject *UNICODE_PARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    CHECK_OBJECT(sep);\n    assert(PyUnicode_CheckExact(str));\n\n    return PyUnicode_Partition(str, sep);\n}\n\nPyObject *UNICODE_RPARTITION(PyThreadState *tstate, PyObject *str, PyObject *sep) {\n    CHECK_OBJECT(str);\n    CHECK_OBJECT(sep);\n    assert(PyUnicode_CheckExact(str));\n\n    return PyUnicode_RPartition(str, sep);\n}\n#if PYTHON_VERSION < 0x300\n\nPyObject *STR_JOIN(PyThreadState *tstate, PyObject *str, PyObject *iterable) {\n    CHECK_OBJECT(str);\n    CHECK_OBJECT(iterable);\n    assert(PyString_CheckExact(str));\n\n    return _PyString_Join(str, iterable);\n}\n\n#endif\n\nPyObject *NuitkaUnicode_FromWideChar(wchar_t const *str, Py_ssize_t size) {\n#if PYTHON_VERSION < 0x300\n    if (size == -1) {\n        size = wcslen(str);\n    }\n#endif\n\n    return PyUnicode_FromWideChar(str, size);\n}\n\nPyObject *BUILTIN_UNICODE1(PyObject *value) {\n#if PYTHON_VERSION >= 0x300\n    if (PyUnicode_CheckExact(value)) {\n#if !defined(Py_DEBUG) && PYTHON_VERSION >= 0x300\n        if (PyUnicode_READY(value) < 0) {\n            return NULL;\n        }\n#endif\n\n        Py_INCREF(value);\n        return value;\n    }\n\n    if (Py_TYPE(value)->tp_str == NULL) {\n        return PyObject_Repr(value);\n    }\n\n    /* It is possible for a type to have a tp_str representation that loops\n       infinitely. */\n    if (Py_EnterRecursiveCall((char *)\" while getting the str of an object\")) {\n        return NULL;\n    }\n\n    PyObject *result = (*Py_TYPE(value)->tp_str)(value);\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    if (unlikely(!PyUnicode_Check(result))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__str__ returned non-string (type %s)\", result);\n\n        Py_DECREF(result);\n        return NULL;\n    }\n\n#if !defined(Py_DEBUG) && PYTHON_VERSION >= 0x300\n    if (PyUnicode_READY(result) < 0) {\n        return NULL;\n    }\n#endif\n\n    return result;\n#else\n    // TODO: Inline this occasionally, however this is not too performance\n    // relevant in most cases.\n    return PyObject_Unicode(value);\n#endif\n}\n\nPyObject *BUILTIN_UNICODE3(PyObject *value, PyObject *encoding, PyObject *errors) {\n    CHECK_OBJECT(value);\n    CHECK_OBJECT_X(encoding);\n    CHECK_OBJECT_X(errors);\n\n    char const *encoding_str;\n\n    if (encoding == NULL) {\n        encoding_str = NULL;\n    } else if (Nuitka_String_Check(encoding)) {\n        encoding_str = Nuitka_String_AsString_Unchecked(encoding);\n    }\n#if PYTHON_VERSION < 0x300\n    else if (PyUnicode_Check(encoding)) {\n        PyObject *uarg2 = _PyUnicode_AsDefaultEncodedString(encoding, NULL);\n        CHECK_OBJECT(uarg2);\n\n        encoding_str = Nuitka_String_AsString_Unchecked(uarg2);\n    }\n#endif\n    else {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"unicode() argument 2 must be string, not %s\", encoding);\n        return NULL;\n    }\n\n    char const *errors_str;\n\n    if (errors == NULL) {\n        errors_str = NULL;\n    } else if (Nuitka_String_Check(errors)) {\n        errors_str = Nuitka_String_AsString_Unchecked(errors);\n    }\n#if PYTHON_VERSION < 0x300\n    else if (PyUnicode_Check(errors)) {\n        PyObject *uarg3 = _PyUnicode_AsDefaultEncodedString(errors, NULL);\n        CHECK_OBJECT(uarg3);\n\n        errors_str = Nuitka_String_AsString_Unchecked(uarg3);\n    }\n#endif\n    else {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"unicode() argument 3 must be string, not %s\", errors);\n        return NULL;\n    }\n\n    PyObject *result = PyUnicode_FromEncodedObject(value, encoding_str, errors_str);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    assert(PyUnicode_Check(result));\n\n    return result;\n}\n\n#if PYTHON_VERSION < 0x300\nPyObject *_BUILTIN_STR(PyObject *value) {\n    CHECK_OBJECT(value);\n\n    if (PyString_CheckExact(value) || PyUnicode_CheckExact(value)) {\n        Py_INCREF(value);\n        return value;\n    }\n\n    /* It is possible for a type to have a tp_str representation that loops\n       infinitely. */\n    if (Py_EnterRecursiveCall((char *)\" while getting the str of an object\")) {\n        return NULL;\n    }\n\n    PyObject *result;\n\n    if (Py_TYPE(value)->tp_str == NULL) {\n        result = PyObject_Repr(value);\n    } else {\n        result = (*Py_TYPE(value)->tp_str)(value);\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    if (unlikely(!PyString_Check(result) && !PyUnicode_Check(result))) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__str__ returned non-string (type %s)\", result);\n        Py_DECREF(result);\n        return NULL;\n    }\n\n    if (PyUnicode_Check(result)) {\n        PyObject *str = PyUnicode_AsEncodedString(result, NULL, NULL);\n        Py_DECREF(result);\n\n        if (likely(str != NULL)) {\n            result = str;\n        } else {\n            return NULL;\n        }\n    }\n\n    assert(PyString_Check(result));\n    return result;\n}\n\nPyObject *BUILTIN_STR(PyObject *value) {\n    PyObject *result = _BUILTIN_STR(value);\n\n    if (result != NULL && PyUnicode_CheckExact(result)) {\n        PyObject *converted = PyUnicode_AsEncodedString(value, NULL, NULL);\n\n        Py_DECREF(result);\n        result = converted;\n    }\n\n    return result;\n}\n\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersTuples.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* These helpers are used to work with tuples.\n\n*/\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if NUITKA_TUPLE_HAS_FREELIST\nstatic struct _Py_tuple_state *_Nuitka_Py_get_tuple_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->tuple;\n}\n\nPyObject *MAKE_TUPLE_EMPTY(Py_ssize_t size) {\n    PyTupleObject *result_tuple;\n\n    // Lets not get called other than this\n    assert(size > 0);\n\n    struct _Py_tuple_state *state = _Nuitka_Py_get_tuple_state();\n\n#if PYTHON_VERSION < 0x3b0\n    Py_ssize_t index = size;\n#else\n    Py_ssize_t index = size - 1;\n#endif\n\n    if ((size < PyTuple_MAXSAVESIZE) && (result_tuple = state->free_list[index]) != NULL) {\n        state->free_list[index] = (PyTupleObject *)result_tuple->ob_item[0];\n        state->numfree[index] -= 1;\n\n        assert(Py_SIZE(result_tuple) == size);\n        assert(Py_TYPE(result_tuple) == &PyTuple_Type);\n\n        Nuitka_Py_NewReference((PyObject *)result_tuple);\n    } else {\n        // Check for overflow\n        if ((size_t)size >\n            ((size_t)PY_SSIZE_T_MAX - (sizeof(PyTupleObject) - sizeof(PyObject *))) / sizeof(PyObject *)) {\n            return PyErr_NoMemory();\n        }\n\n        result_tuple = (PyTupleObject *)Nuitka_GC_NewVar(&PyTuple_Type, size);\n    }\n\n    // TODO: Why not use memset here, and can we rely on memory being cleared\n    // by allocator?\n\n    // TODO: When first initializing the tuple, we might skip this and use\n    // assignments that ignore this.\n    for (Py_ssize_t i = 0; i < size; i++) {\n        result_tuple->ob_item[i] = NULL;\n    }\n\n    Nuitka_GC_Track(result_tuple);\n\n    assert(PyTuple_CheckExact(result_tuple));\n    assert(PyTuple_GET_SIZE(result_tuple) == size);\n\n    return (PyObject *)result_tuple;\n}\n\nPyObject *MAKE_TUPLE_EMPTY_VAR(Py_ssize_t size) {\n    if (size == 0) {\n        PyObject *result = const_tuple_empty;\n        Py_INCREF(result);\n        return result;\n    } else {\n        return MAKE_TUPLE_EMPTY(size);\n    }\n}\n\n#endif\n\nPyObject *TUPLE_CONCAT(PyObject *tuple1, PyObject *tuple2) {\n    Py_ssize_t size = Py_SIZE(tuple1) + Py_SIZE(tuple2);\n\n    // Do not ignore MemoryError, may actually happen.\n    PyTupleObject *result = (PyTupleObject *)MAKE_TUPLE_EMPTY_VAR(size);\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    PyObject **src = ((PyTupleObject *)tuple1)->ob_item;\n    PyObject **dest = result->ob_item;\n\n    for (Py_ssize_t i = 0; i < Py_SIZE(tuple1); i++) {\n        PyObject *v = src[i];\n        Py_INCREF(v);\n        dest[i] = v;\n    }\n\n    src = ((PyTupleObject *)tuple2)->ob_item;\n    dest = result->ob_item + Py_SIZE(tuple1);\n\n    for (Py_ssize_t i = 0; i < Py_SIZE(tuple2); i++) {\n        PyObject *v = src[i];\n        Py_INCREF(v);\n        dest[i] = v;\n    }\n\n    return (PyObject *)result;\n}\n\nPyObject *TUPLE_COPY(PyObject *tuple) {\n    CHECK_OBJECT(tuple);\n    assert(PyTuple_CheckExact(tuple));\n\n    Py_ssize_t size = PyTuple_GET_SIZE(tuple);\n    PyObject *result = MAKE_TUPLE_EMPTY(size);\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n    for (Py_ssize_t i = 0; i < size; i++) {\n        PyObject *item = PyTuple_GET_ITEM(tuple, i);\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, i, item);\n    }\n\n    return result;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/HelpersTypes.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n// Our replacement for \"PyType_IsSubtype\"\nbool Nuitka_Type_IsSubtype(PyTypeObject *a, PyTypeObject *b) {\n    CHECK_OBJECT(a);\n    CHECK_OBJECT(b);\n\n#if PYTHON_VERSION < 0x300\n    if (!(a->tp_flags & Py_TPFLAGS_HAVE_CLASS)) {\n        return b == a || b == &PyBaseObject_Type;\n    }\n#endif\n\n    PyObject *mro = a->tp_mro;\n    CHECK_OBJECT_X(mro);\n\n    if (likely(mro != NULL)) {\n        assert(PyTuple_Check(mro));\n\n        Py_ssize_t n = PyTuple_GET_SIZE(mro);\n\n        for (Py_ssize_t i = 0; i < n; i++) {\n            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) {\n                return true;\n            }\n        }\n\n        return false;\n    } else {\n        // Fallback for uninitialized classes to API usage\n        return PyType_IsSubtype(a, b) != 0;\n    }\n}\n\n// TODO: We cannot really do this, until Nuitka_TypeLookup (_PyType_Lookup) is\n// not also a call to an API, we just become wasteful here. What will make sense\n// is to make specialized variants for not sub class checks, like\n// PyExc_GeneratorExit and PyExc_StopIteration by caching the descriptor\n// \"checker\" for them and then calling the \"func\" behind them more or less\n// directly. These could be created during startup and be very fast to use.\n\n#if 0\nint Nuitka_Object_IsSubclass(PyThreadState *tstate, PyObject *derived, PyObject *cls)\n{\n    // TODO: Checking for a type is nothing the core does, could have a second variant\n    if (PyType_CheckExact(cls)) {\n        // Only a quick test for an exact match, but then give up.\n        if (derived == cls) {\n            return 1;\n        }\n\n        // Too hard for us.\n        return PyObject_IsSubclass(derived, cls);\n    }\n\n    // TODO: Checking for a tuple is nothing the core does, could have a second variant\n    if (PyTuple_Check(cls)) {\n        if (Py_EnterRecursiveCall(\" in __subclasscheck__\")) {\n            return -1;\n        }\n\n        Py_ssize_t n = PyTuple_GET_SIZE(cls);\n        int r = 0;\n\n        for (Py_ssize_t i = 0; i < n; ++i) {\n            PyObject *item = PyTuple_GET_ITEM(cls, i);\n\n            r = Nuitka_Object_IsSubclass(tstate, derived, item);\n\n            if (r != 0) {\n                break;\n            }\n        }\n\n        Py_LeaveRecursiveCall();\n\n        return r;\n    }\n\n    // TODO: For many of our uses, we know it.\n    PyObject *checker = Nuitka_TypeLookup((PyTypeObject *)cls, const_str_plain___subclasscheck__);\n\n    if (checker != NULL) {\n        descrgetfunc f = Py_TYPE(checker)->tp_descr_get;\n\n        if (f == NULL) {\n            Py_INCREF(checker);\n        } else {\n            checker = f(checker, cls, (PyObject *)(Py_TYPE(cls)));\n        }\n    }\n\n    if (checker != NULL) {\n        int ok = -1;\n\n        if (Py_EnterRecursiveCall(\" in __subclasscheck__\")) {\n            Py_DECREF(checker);\n            return ok;\n        }\n\n        PyObject *res = CALL_FUNCTION_WITH_SINGLE_ARG(checker, derived);\n\n        Py_LeaveRecursiveCall();\n\n        Py_DECREF(checker);\n\n        if (res != NULL) {\n            ok = CHECK_IF_TRUE(res);\n            Py_DECREF(res);\n        }\n        return ok;\n    } else if (HAS_ERROR_OCCURRED(tstate)) {\n        return -1;\n    }\n\n    // Too hard for us.\n    return PyObject_IsSubclass(derived, cls);\n}\n#endif\n\ngetattrofunc PyObject_GenericGetAttr_resolved;\nsetattrofunc PyObject_GenericSetAttr_resolved;\n\n// Our wrapper for \"PyType_Ready\" that takes care of trying to avoid DLL entry\n// points for generic attributes.\nvoid Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool generic_get_attr, bool generic_set_attr,\n                         bool self_iter, bool await_self_iter, bool self_aiter) {\n    assert(type->tp_base == NULL);\n\n    PyObject_GenericGetAttr_resolved = PyBaseObject_Type.tp_getattro;\n    PyObject_GenericSetAttr_resolved = PyBaseObject_Type.tp_setattro;\n\n    type->tp_base = base;\n\n    if (generic_get_attr) {\n        assert(type->tp_getattro == NULL);\n        type->tp_getattro = PyObject_GenericGetAttr_resolved;\n    }\n\n    if (generic_set_attr) {\n        assert(type->tp_setattro == NULL);\n        type->tp_setattro = PyObject_GenericSetAttr_resolved;\n    }\n\n    if (self_iter) {\n        assert(type->tp_iter == NULL);\n        type->tp_iter = PyObject_SelfIter;\n    }\n\n#if PYTHON_VERSION >= 0x350\n    if (await_self_iter) {\n        assert(type->tp_as_async->am_await == NULL);\n        type->tp_as_async->am_await = PyObject_SelfIter;\n    }\n\n    if (self_aiter) {\n        assert(type->tp_as_async->am_aiter == NULL);\n        type->tp_as_async->am_aiter = PyObject_SelfIter;\n    }\n#else\n    assert(!await_self_iter);\n    assert(!self_aiter);\n#endif\n\n    NUITKA_MAY_BE_UNUSED int res = PyType_Ready(type);\n    assert(res >= 0);\n}\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/InspectPatcher.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/**\n * This is responsible for updating parts of CPython to better work with Nuitka\n * by replacing CPython implementations with enhanced versions.\n */\n\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic PyObject *module_inspect;\n#if PYTHON_VERSION >= 0x350\nstatic PyObject *module_types;\n#endif\n\nstatic char *kw_list_object[] = {(char *)\"object\", NULL};\n\n// spell-checker: ignore getgeneratorstate, getcoroutinestate\n\nstatic PyObject *old_getgeneratorstate = NULL;\n\nstatic PyObject *_inspect_getgeneratorstate_replacement(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *object;\n\n    if (!PyArg_ParseTupleAndKeywords(args, kwds, \"O:getgeneratorstate\", kw_list_object, &object, NULL)) {\n        return NULL;\n    }\n\n    if (Nuitka_Generator_Check(object)) {\n        struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)object;\n\n        if (generator->m_running) {\n            return PyObject_GetAttrString(module_inspect, \"GEN_RUNNING\");\n        } else if (generator->m_status == status_Finished) {\n            return PyObject_GetAttrString(module_inspect, \"GEN_CLOSED\");\n        } else if (generator->m_status == status_Unused) {\n            return PyObject_GetAttrString(module_inspect, \"GEN_CREATED\");\n        } else {\n            return PyObject_GetAttrString(module_inspect, \"GEN_SUSPENDED\");\n        }\n    } else {\n        return old_getgeneratorstate->ob_type->tp_call(old_getgeneratorstate, args, kwds);\n    }\n}\n\n#if PYTHON_VERSION >= 0x350\nstatic PyObject *old_getcoroutinestate = NULL;\n\nstatic PyObject *_inspect_getcoroutinestate_replacement(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *object;\n\n    if (!PyArg_ParseTupleAndKeywords(args, kwds, \"O:getcoroutinestate\", kw_list_object, &object, NULL)) {\n        return NULL;\n    }\n\n    if (Nuitka_Coroutine_Check(object)) {\n        struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)object;\n\n        if (coroutine->m_running) {\n            return PyObject_GetAttrString(module_inspect, \"CORO_RUNNING\");\n        } else if (coroutine->m_status == status_Finished) {\n            return PyObject_GetAttrString(module_inspect, \"CORO_CLOSED\");\n        } else if (coroutine->m_status == status_Unused) {\n            return PyObject_GetAttrString(module_inspect, \"CORO_CREATED\");\n        } else {\n            return PyObject_GetAttrString(module_inspect, \"CORO_SUSPENDED\");\n        }\n    } else {\n        return old_getcoroutinestate->ob_type->tp_call(old_getcoroutinestate, args, kwds);\n    }\n}\n\nstatic PyObject *old_types_coroutine = NULL;\n\nstatic char *kw_list_coroutine[] = {(char *)\"func\", NULL};\n\nstatic PyObject *_types_coroutine_replacement(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *func;\n\n    if (!PyArg_ParseTupleAndKeywords(args, kwds, \"O:coroutine\", kw_list_coroutine, &func, NULL)) {\n        return NULL;\n    }\n\n    if (Nuitka_Function_Check(func)) {\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)func;\n\n        if (function->m_code_object->co_flags & CO_GENERATOR) {\n            function->m_code_object->co_flags |= 0x100;\n        }\n    }\n\n    return old_types_coroutine->ob_type->tp_call(old_types_coroutine, args, kwds);\n}\n\n#endif\n\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic PyMethodDef _method_def_inspect_getgeneratorstate_replacement = {\n    \"getgeneratorstate\", (PyCFunction)_inspect_getgeneratorstate_replacement, METH_VARARGS | METH_KEYWORDS, NULL};\n\n#if PYTHON_VERSION >= 0x350\nstatic PyMethodDef _method_def_inspect_getcoroutinestate_replacement = {\n    \"getcoroutinestate\", (PyCFunction)_inspect_getcoroutinestate_replacement, METH_VARARGS | METH_KEYWORDS, NULL};\n\nstatic PyMethodDef _method_def_types_coroutine_replacement = {\"coroutine\", (PyCFunction)_types_coroutine_replacement,\n                                                              METH_VARARGS | METH_KEYWORDS, NULL};\n\n#endif\n\n/* Replace inspect functions with ones that handle compiles types too. */\nvoid patchInspectModule(PyThreadState *tstate) {\n    static bool is_done = false;\n    if (is_done) {\n        return;\n    }\n\n    CHECK_OBJECT(dict_builtin);\n\n#if PYTHON_VERSION >= 0x300\n#if defined(_NUITKA_EXE) && !defined(_NUITKA_STANDALONE)\n    // May need to import the \"site\" module, because otherwise the patching can\n    // fail with it being unable to load it (yet)\n    if (Py_NoSiteFlag == 0) {\n        PyObject *site_module =\n            IMPORT_MODULE5(tstate, const_str_plain_site, Py_None, Py_None, const_tuple_empty, const_int_0);\n\n        if (site_module == NULL) {\n            // Ignore \"ImportError\", having a \"site\" module is not a must.\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n    }\n#endif\n\n    // TODO: Change this into an import hook that is executed after it is imported.\n    module_inspect = IMPORT_MODULE5(tstate, const_str_plain_inspect, Py_None, Py_None, const_tuple_empty, const_int_0);\n\n    if (module_inspect == NULL) {\n        PyErr_PrintEx(0);\n        Py_Exit(1);\n    }\n    CHECK_OBJECT(module_inspect);\n\n    // Patch \"inspect.getgeneratorstate\" unless it is already patched.\n    old_getgeneratorstate = PyObject_GetAttrString(module_inspect, \"getgeneratorstate\");\n    CHECK_OBJECT(old_getgeneratorstate);\n\n    if (PyFunction_Check(old_getgeneratorstate)) {\n        PyObject *inspect_getgeneratorstate_replacement =\n            PyCFunction_New(&_method_def_inspect_getgeneratorstate_replacement, NULL);\n        CHECK_OBJECT(inspect_getgeneratorstate_replacement);\n\n        PyObject_SetAttrString(module_inspect, \"getgeneratorstate\", inspect_getgeneratorstate_replacement);\n    }\n\n#if PYTHON_VERSION >= 0x350\n    // Patch \"inspect.getcoroutinestate\" unless it is already patched.\n    old_getcoroutinestate = PyObject_GetAttrString(module_inspect, \"getcoroutinestate\");\n    CHECK_OBJECT(old_getcoroutinestate);\n\n    if (PyFunction_Check(old_getcoroutinestate)) {\n        PyObject *inspect_getcoroutinestate_replacement =\n            PyCFunction_New(&_method_def_inspect_getcoroutinestate_replacement, NULL);\n        CHECK_OBJECT(inspect_getcoroutinestate_replacement);\n\n        PyObject_SetAttrString(module_inspect, \"getcoroutinestate\", inspect_getcoroutinestate_replacement);\n    }\n\n    module_types = IMPORT_MODULE5(tstate, const_str_plain_types, Py_None, Py_None, const_tuple_empty, const_int_0);\n\n    if (module_types == NULL) {\n        PyErr_PrintEx(0);\n        Py_Exit(1);\n    }\n    CHECK_OBJECT(module_types);\n\n    // Patch \"types.coroutine\" unless it is already patched.\n    old_types_coroutine = PyObject_GetAttrString(module_types, \"coroutine\");\n    CHECK_OBJECT(old_types_coroutine);\n\n    if (PyFunction_Check(old_types_coroutine)) {\n        PyObject *types_coroutine_replacement = PyCFunction_New(&_method_def_types_coroutine_replacement, NULL);\n        CHECK_OBJECT(types_coroutine_replacement);\n\n        PyObject_SetAttrString(module_types, \"coroutine\", types_coroutine_replacement);\n    }\n\n    static char const *wrapper_enhancement_code = \"\\n\\\nimport types\\n\\\n_old_GeneratorWrapper = types._GeneratorWrapper\\n\\\nclass GeneratorWrapperEnhanced(_old_GeneratorWrapper):\\n\\\n    def __init__(self, gen):\\n\\\n        _old_GeneratorWrapper.__init__(self, gen)\\n\\\n\\n\\\n        if hasattr(gen, 'gi_code'):\\n\\\n            if gen.gi_code.co_flags & 0x0020:\\n\\\n                self._GeneratorWrapper__isgen = True\\n\\\n\\n\\\ntypes._GeneratorWrapper = GeneratorWrapperEnhanced\\\n\";\n\n    PyObject *wrapper_enhancement_code_object = Py_CompileString(wrapper_enhancement_code, \"<exec>\", Py_file_input);\n    CHECK_OBJECT(wrapper_enhancement_code_object);\n\n    {\n        NUITKA_MAY_BE_UNUSED PyObject *module =\n            PyImport_ExecCodeModule(\"nuitka_types_patch\", wrapper_enhancement_code_object);\n        CHECK_OBJECT(module);\n\n        NUITKA_MAY_BE_UNUSED bool bool_res = Nuitka_DelModuleString(tstate, \"nuitka_types_patch\");\n        assert(bool_res != false);\n    }\n\n#endif\n\n#endif\n\n    is_done = true;\n}\n#endif\n\nstatic richcmpfunc original_PyType_tp_richcompare = NULL;\n\nstatic PyObject *Nuitka_type_tp_richcompare(PyObject *a, PyObject *b, int op) {\n    if (likely(op == Py_EQ || op == Py_NE)) {\n        if (a == (PyObject *)&Nuitka_Function_Type) {\n            a = (PyObject *)&PyFunction_Type;\n        } else if (a == (PyObject *)&Nuitka_Method_Type) {\n            a = (PyObject *)&PyMethod_Type;\n        } else if (a == (PyObject *)&Nuitka_Generator_Type) {\n            a = (PyObject *)&PyGen_Type;\n#if PYTHON_VERSION >= 0x350\n        } else if (a == (PyObject *)&Nuitka_Coroutine_Type) {\n            a = (PyObject *)&PyCoro_Type;\n#endif\n#if PYTHON_VERSION >= 0x360\n        } else if (a == (PyObject *)&Nuitka_Asyncgen_Type) {\n            a = (PyObject *)&PyAsyncGen_Type;\n#endif\n        }\n\n        if (b == (PyObject *)&Nuitka_Function_Type) {\n            b = (PyObject *)&PyFunction_Type;\n        } else if (b == (PyObject *)&Nuitka_Method_Type) {\n            b = (PyObject *)&PyMethod_Type;\n        } else if (b == (PyObject *)&Nuitka_Generator_Type) {\n            b = (PyObject *)&PyGen_Type;\n#if PYTHON_VERSION >= 0x350\n        } else if (b == (PyObject *)&Nuitka_Coroutine_Type) {\n            b = (PyObject *)&PyCoro_Type;\n#endif\n#if PYTHON_VERSION >= 0x360\n        } else if (b == (PyObject *)&Nuitka_Asyncgen_Type) {\n            b = (PyObject *)&PyAsyncGen_Type;\n#endif\n        }\n    }\n\n    CHECK_OBJECT(a);\n    CHECK_OBJECT(b);\n\n    assert(original_PyType_tp_richcompare);\n\n    return original_PyType_tp_richcompare(a, b, op);\n}\n\nvoid patchTypeComparison(void) {\n    if (original_PyType_tp_richcompare == NULL) {\n        original_PyType_tp_richcompare = PyType_Type.tp_richcompare;\n        PyType_Type.tp_richcompare = Nuitka_type_tp_richcompare;\n    }\n}\n\n#include \"nuitka/freelists.h\"\n\n#define MAX_TRACEBACK_FREE_LIST_COUNT 1000\nstatic PyTracebackObject *free_list_tracebacks = NULL;\nstatic int free_list_tracebacks_count = 0;\n\n// Create a traceback for a given frame, using a free list hacked into the\n// existing type.\nPyTracebackObject *MAKE_TRACEBACK(struct Nuitka_FrameObject *frame, int lineno) {\n#if 0\n    PRINT_STRING(\"MAKE_TRACEBACK: Enter\");\n    PRINT_ITEM((PyObject *)frame);\n    PRINT_NEW_LINE();\n\n    dumpFrameStack();\n#endif\n\n    CHECK_OBJECT(frame);\n    assert(lineno != 0);\n\n    PyTracebackObject *result;\n\n    allocateFromFreeListFixed(free_list_tracebacks, PyTracebackObject, PyTraceBack_Type);\n\n    result->tb_next = NULL;\n    result->tb_frame = (PyFrameObject *)frame;\n    Py_INCREF(frame);\n\n    result->tb_lasti = -1;\n    result->tb_lineno = lineno;\n\n    Nuitka_GC_Track(result);\n\n    return result;\n}\n\nstatic void Nuitka_tb_dealloc(PyTracebackObject *tb) {\n    // Need to use official method as it checks for recursion.\n    Nuitka_GC_UnTrack(tb);\n\n#if 0\n#if PYTHON_VERSION >= 0x380\n    Py_TRASHCAN_BEGIN(tb, Nuitka_tb_dealloc);\n#else\n    Py_TRASHCAN_SAFE_BEGIN(tb);\n#endif\n#endif\n\n    Py_XDECREF(tb->tb_next);\n    Py_XDECREF(tb->tb_frame);\n\n    releaseToFreeList(free_list_tracebacks, tb, MAX_TRACEBACK_FREE_LIST_COUNT);\n\n#if 0\n#if PYTHON_VERSION >= 0x380\n    Py_TRASHCAN_END;\n#else\n    Py_TRASHCAN_SAFE_END(tb);\n#endif\n#endif\n}\n\nvoid patchTracebackDealloc(void) { PyTraceBack_Type.tp_dealloc = (destructor)Nuitka_tb_dealloc; }\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/MainProgram.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* The main program for a compiled program.\n *\n * It needs to prepare the interpreter and then loads and executes\n * the \"__main__\" module.\n *\n * For multiprocessing, joblib, loky there is things here that will\n * allow them to fork properly with their intended entry points.\n *\n * spell-checker: ignore joblib loky\n *\n */\n\n#if defined(_WIN32)\n#include <windows.h>\n#endif\n\n#include \"nuitka/prelude.h\"\n\n#ifndef __IDE_ONLY__\n// Generated during build with optional defines.\n#include \"build_definitions.h\"\n#else\n// For the IDE to know these exist.\n#define SYSFLAG_PY3K_WARNING 0\n#define SYSFLAG_DIVISION_WARNING 0\n#define SYSFLAG_UNICODE 0\n#define SYSFLAG_OPTIMIZE 0\n#define SYSFLAG_NO_SITE 0\n#define SYSFLAG_VERBOSE 0\n#define SYSFLAG_BYTES_WARNING 0\n#define SYSFLAG_UTF8 0\n#define SYSFLAG_UNBUFFERED 0\n#define NUITKA_MAIN_MODULE_NAME \"__main__\"\n#define NUITKA_MAIN_IS_PACKAGE_BOOL false\n#endif\n\n// It doesn't work for MinGW64 to update the standard output handles early on,\n// so make a difference here.\n#if defined(NUITKA_FORCED_STDOUT_PATH) || defined(NUITKA_FORCED_STDERR_PATH)\n#if defined(__MINGW64__) || defined(__MINGW32__)\n#define NUITKA_STANDARD_HANDLES_EARLY 0\n#else\n#define NUITKA_STANDARD_HANDLES_EARLY 1\n#endif\n#else\n#define NUITKA_STANDARD_HANDLES_EARLY 0\n#endif\n\nextern PyCodeObject *codeobj_main;\n\n/* For later use in \"Py_GetArgcArgv\" we expose the needed value  */\n#if PYTHON_VERSION >= 0x300\nstatic wchar_t **orig_argv;\n#else\nstatic char **orig_argv;\n#endif\nstatic int orig_argc;\n\n#if _NUITKA_FROZEN > 0\nextern void copyFrozenModulesTo(struct _frozen *destination);\n\n// The original frozen modules list.\n#if PYTHON_VERSION < 0x340\nstatic struct _frozen *old_frozen = NULL;\n#else\nstatic struct _frozen const *old_frozen = NULL;\n#endif\n\nstatic void prepareFrozenModules(void) {\n    // Tell the CPython library to use our pre-compiled modules as frozen\n    // modules. This for those modules/packages like \"encoding\" that will be\n    // loaded during \"Py_Initialize\" already, for the others they may be\n    // compiled.\n\n    // The CPython library before 3.11 has some pre-existing frozen modules, we\n    // only append to those to keep compatible.\n    struct _frozen const *search = PyImport_FrozenModules;\n    int pre_existing_count;\n\n    if (search) {\n        while (search->name) {\n            search++;\n        }\n        pre_existing_count = (int)(search - PyImport_FrozenModules);\n    } else {\n        pre_existing_count = 0;\n    }\n\n    // Allocate new memory and merge the tables. Keeping the old ones has the\n    // advantage that e.g. \"import this\" is going to be compatible, and there\n    // might be Python flavors that add more.\n    struct _frozen *merged =\n        (struct _frozen *)malloc(sizeof(struct _frozen) * (_NUITKA_FROZEN + pre_existing_count + 1));\n\n    memcpy(merged, PyImport_FrozenModules, pre_existing_count * sizeof(struct _frozen));\n    copyFrozenModulesTo(merged + pre_existing_count);\n    old_frozen = PyImport_FrozenModules;\n    PyImport_FrozenModules = merged;\n}\n#endif\n\n#include \"nuitka/environment_variables.h\"\n\n#ifdef _NUITKA_STANDALONE\n\n#include \"pythonrun.h\"\n\nstatic environment_char_t const *old_env_path;\nstatic environment_char_t const *old_env_pythonhome;\n\nstatic void prepareStandaloneEnvironment(void) {\n    /* Setup environment variables to tell CPython that we would like it to use\n     * the provided binary directory as the place to look for DLLs and for\n     * extension modules.\n     */\n    old_env_path = getEnvironmentVariable(\"PATH\");\n    // Remove the PATH during Python init, so it won't pick up stuff from there.\n    setEnvironmentVariable(\"PATH\", makeEnvironmentLiteral(\"/\"));\n\n    old_env_pythonhome = getEnvironmentVariable(\"PYTHONHOME\");\n#if defined(_WIN32)\n    setEnvironmentVariable(\"PYTHONHOME\", getBinaryDirectoryWideChars(true));\n#else\n    setEnvironmentVariable(\"PYTHONHOME\", getBinaryDirectoryHostEncoded(true));\n#endif\n\n#if defined(_WIN32)\n    SetDllDirectoryW(getBinaryDirectoryWideChars(true));\n#endif\n\n#if PYTHON_VERSION < 0x300\n    char *binary_directory = (char *)getBinaryDirectoryHostEncoded(true);\n    NUITKA_PRINTF_TRACE(\"main(): Binary dir is %s\\n\", binary_directory);\n\n    Py_SetPythonHome(binary_directory);\n#elif PYTHON_VERSION < 0x370\n    wchar_t *binary_directory = (wchar_t *)getBinaryDirectoryWideChars(true);\n    NUITKA_PRINTF_TRACE(\"main(): Binary dir is %S\\n\", binary_directory);\n\n    Py_SetPythonHome(binary_directory);\n    Py_SetPath(binary_directory);\n\n#endif\n\n#if PYTHON_VERSION >= 0x380 && PYTHON_VERSION < 0x3b0 && defined(_WIN32)\n    _Py_path_config.isolated = 1;\n#endif\n}\n\nstatic void restoreStandaloneEnvironment(void) {\n    /* Make sure to use the optimal value for standalone mode only. */\n#if PYTHON_VERSION < 0x300\n    PySys_SetPath((char *)getBinaryDirectoryHostEncoded(true));\n    // NUITKA_PRINTF_TRACE(\"Final PySys_GetPath is 's'.\\n\", PySys_GetPath());\n#elif PYTHON_VERSION < 0x370\n    PySys_SetPath(getBinaryDirectoryWideChars(true));\n    Py_SetPath(getBinaryDirectoryWideChars(true));\n    // NUITKA_PRINTF_TRACE(\"Final Py_GetPath is '%ls'.\\n\", Py_GetPath());\n#endif\n\n#ifdef _NUITKA_EXPERIMENTAL_DUMP_PY_PATH_CONFIG\n    wprintf(L\"_Py_path_config.program_full_path='%lS'\\n\", _Py_path_config.program_full_path);\n    wprintf(L\"_Py_path_config.program_name='%lS'\\n\", _Py_path_config.program_name);\n    wprintf(L\"_Py_path_config.prefix='%lS'\\n\", _Py_path_config.prefix);\n    wprintf(L\"_Py_path_config.exec_prefix='%lS'\\n\", _Py_path_config.exec_prefix);\n    wprintf(L\"_Py_path_config.module_search_path='%lS'\\n\", _Py_path_config.module_search_path);\n    wprintf(L\"_Py_path_config.home='%lS'\\n\", _Py_path_config.home);\n#endif\n}\n\n#endif\n\nextern void _initCompiledCellType();\nextern void _initCompiledGeneratorType();\nextern void _initCompiledFunctionType();\nextern void _initCompiledMethodType();\nextern void _initCompiledFrameType();\n\n#include <locale.h>\n\n#ifdef _WIN32\n#define _NUITKA_NATIVE_WCHAR_ARGV 1\n#else\n#define _NUITKA_NATIVE_WCHAR_ARGV 0\n#endif\n\n// Types of command line arguments are different between Python2/3.\n#if PYTHON_VERSION >= 0x300 && _NUITKA_NATIVE_WCHAR_ARGV == 0\nstatic wchar_t **convertCommandLineParameters(int argc, char **argv) {\n    // Originally taken from CPython3: There seems to be no sane way to use\n    static wchar_t **argv_copy;\n    argv_copy = (wchar_t **)PyMem_MALLOC(sizeof(wchar_t *) * argc);\n\n    // Temporarily disable locale for conversions to not use it.\n    char *old_locale = strdup(setlocale(LC_ALL, NULL));\n    setlocale(LC_ALL, \"\");\n\n    for (int i = 0; i < argc; i++) {\n#if PYTHON_VERSION >= 0x350\n        argv_copy[i] = Py_DecodeLocale(argv[i], NULL);\n#elif defined(__APPLE__) && PYTHON_VERSION >= 0x300\n        argv_copy[i] = _Py_DecodeUTF8_surrogateescape(argv[i], strlen(argv[i]));\n#else\n        argv_copy[i] = _Py_char2wchar(argv[i], NULL);\n#endif\n\n        assert(argv_copy[i]);\n    }\n\n    setlocale(LC_ALL, old_locale);\n    free(old_locale);\n\n    return argv_copy;\n}\n#endif\n\n#if _DEBUG_REFCOUNTS\nstatic void PRINT_REFCOUNTS(void) {\n    // spell-checker: ignore Asend, Athrow\n\n    PRINT_STRING(\"REFERENCE counts at program end:\\n\");\n    PRINT_STRING(\"active | allocated | released\\n\");\n    PRINT_FORMAT(\"Compiled Functions: %d | %d | %d (module/class ownership may occur)\\n\",\n                 count_active_Nuitka_Function_Type, count_allocated_Nuitka_Function_Type,\n                 count_released_Nuitka_Function_Type);\n    PRINT_FORMAT(\"Compiled Generators: %d | %d | %d\\n\", count_active_Nuitka_Generator_Type,\n                 count_allocated_Nuitka_Generator_Type, count_released_Nuitka_Generator_Type);\n#if PYTHON_VERSION >= 0x350\n    PRINT_FORMAT(\"Compiled Coroutines: %d | %d | %d\\n\", count_active_Nuitka_Coroutine_Type,\n                 count_allocated_Nuitka_Coroutine_Type, count_released_Nuitka_Coroutine_Type);\n    PRINT_FORMAT(\"Compiled Coroutines Wrappers: %d | %d | %d\\n\", count_active_Nuitka_CoroutineWrapper_Type,\n                 count_allocated_Nuitka_CoroutineWrapper_Type, count_released_Nuitka_CoroutineWrapper_Type);\n\n    PRINT_FORMAT(\"Compiled Coroutines AIter Wrappers: %d | %d | %d\\n\", count_active_Nuitka_AIterWrapper_Type,\n                 count_allocated_Nuitka_AIterWrapper_Type, count_released_Nuitka_AIterWrapper_Type);\n#endif\n#if PYTHON_VERSION >= 0x360\n    PRINT_FORMAT(\"Compiled Asyncgen: %d | %d | %d\\n\", count_active_Nuitka_Asyncgen_Type,\n                 count_allocated_Nuitka_Asyncgen_Type, count_released_Nuitka_Asyncgen_Type);\n    PRINT_FORMAT(\"Compiled Asyncgen Wrappers: %d | %d | %d\\n\", count_active_Nuitka_AsyncgenValueWrapper_Type,\n                 count_allocated_Nuitka_AsyncgenValueWrapper_Type, count_released_Nuitka_AsyncgenValueWrapper_Type);\n    PRINT_FORMAT(\"Compiled Asyncgen Asend: %d | %d | %d\\n\", count_active_Nuitka_AsyncgenAsend_Type,\n                 count_allocated_Nuitka_AsyncgenAsend_Type, count_released_Nuitka_AsyncgenAsend_Type);\n    PRINT_FORMAT(\"Compiled Asyncgen Athrow: %d | %d | %d\\n\", count_active_Nuitka_AsyncgenAthrow_Type,\n                 count_allocated_Nuitka_AsyncgenAthrow_Type, count_released_Nuitka_AsyncgenAthrow_Type);\n#endif\n\n    PRINT_FORMAT(\"Compiled Frames: %d | %d | %d (cache usage may occur)\\n\", count_active_Nuitka_Frame_Type,\n                 count_allocated_Nuitka_Frame_Type, count_released_Nuitka_Frame_Type);\n    PRINT_FORMAT(\"Compiled Cells: %d | %d | %d (function ownership may occur)\\n\", count_active_Nuitka_Cell_Type,\n                 count_allocated_Nuitka_Cell_Type, count_released_Nuitka_Cell_Type);\n    PRINT_STRING(\"CACHED counts at program end:\\n\");\n    PRINT_STRING(\"active | allocated | released | hits\\n\");\n    PRINT_FORMAT(\"Cached Frames: %d | %d | %d | %d\\n\", count_active_frame_cache_instances,\n                 count_allocated_frame_cache_instances, count_released_frame_cache_instances,\n                 count_hit_frame_cache_instances);\n}\n#endif\n\nstatic int HANDLE_PROGRAM_EXIT(PyThreadState *tstate) {\n#if _DEBUG_REFCOUNTS\n    PRINT_REFCOUNTS();\n#endif\n\n    int exit_code;\n\n    if (HAS_ERROR_OCCURRED(tstate)) {\n        // TODO: Clarify which versions this applies to still\n#if PYTHON_VERSION >= 0x300 && PYTHON_VERSION < 0x3c0\n        /* Remove the frozen importlib traceback part, which would not be compatible. */\n\n        while (tstate->curexc_traceback) {\n            PyTracebackObject *tb = (PyTracebackObject *)tstate->curexc_traceback;\n            PyFrameObject *frame = tb->tb_frame;\n\n            if (0 == strcmp(PyUnicode_AsUTF8(Nuitka_Frame_GetCodeObject(frame)->co_filename),\n                            \"<frozen importlib._bootstrap>\")) {\n                tstate->curexc_traceback = (PyObject *)tb->tb_next;\n                Py_INCREF(tb->tb_next);\n\n                continue;\n            }\n\n            break;\n        }\n#endif\n        NUITKA_FINALIZE_PROGRAM(tstate);\n\n        PyErr_PrintEx(0);\n\n        exit_code = 1;\n    } else {\n        exit_code = 0;\n    }\n\n    return exit_code;\n}\n\nstatic PyObject *EXECUTE_MAIN_MODULE(PyThreadState *tstate, char const *module_name, bool is_package) {\n    NUITKA_INIT_PROGRAM_LATE(module_name);\n\n    if (is_package) {\n        char const *w = module_name;\n\n        for (;;) {\n            char const *s = strchr(w, '.');\n\n            if (s == NULL) {\n                break;\n            }\n\n            w = s + 1;\n\n            char buffer[1024];\n            memset(buffer, 0, sizeof(buffer));\n            memcpy(buffer, module_name, s - module_name);\n\n            PyObject *result = IMPORT_EMBEDDED_MODULE(tstate, buffer);\n\n            if (HAS_ERROR_OCCURRED(tstate)) {\n                return result;\n            }\n        }\n    }\n\n    return IMPORT_EMBEDDED_MODULE(tstate, module_name);\n}\n\n#ifdef _NUITKA_PLUGIN_WINDOWS_SERVICE_ENABLED\n#include \"nuitka_windows_service.h\"\n\n// Callback from Windows Service logic.\nbool SvcStartPython(void) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    EXECUTE_MAIN_MODULE(tstate, NUITKA_MAIN_MODULE_NAME, NUITKA_MAIN_IS_PACKAGE_BOOL);\n\n    if (HAS_ERROR_OCCURRED(tstate)) {\n        return true;\n    } else {\n        return false;\n    }\n}\n\nvoid SvcStopPython(void) { PyErr_SetInterrupt(); }\n\n#endif\n\n// This is a multiprocessing fork\nstatic bool is_multiprocessing_fork = false;\n// This is a multiprocessing resource tracker if not -1\nstatic int multiprocessing_resource_tracker_arg = -1;\n\n// This is a joblib loky fork\n#ifdef _WIN32\nstatic bool is_joblib_popen_loky_win32 = false;\nstatic int loky_joblib_pipe_handle_arg = 0;\nstatic int loky_joblib_parent_pid_arg = 0;\n#else\nstatic bool is_joblib_popen_loky_posix = false;\n#endif\n// This is a joblib resource tracker if not -1\nstatic int loky_resource_tracker_arg = -1;\n\n// Parse the command line parameters to decide if it's a multiprocessing usage\n// or something else special.\n#if _NUITKA_NATIVE_WCHAR_ARGV == 0\nstatic void setCommandLineParameters(int argc, char **argv) {\n#else\nstatic void setCommandLineParameters(int argc, wchar_t **argv) {\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_SELF_FORKING\n#if _NUITKA_NATIVE_WCHAR_ARGV == 0\n    printf(\"Commandline: \");\n    for (int i = 0; i < argc; i++) {\n        if (i != 0) {\n            printf(\" \");\n        }\n        printf(\"'%s'\", argv[i]);\n    }\n    printf(\"\\n\");\n#else\n    wprintf(L\"Commandline: '%lS' %d\\n\", GetCommandLineW(), argc);\n#endif\n#endif\n\n    // We might need to handle special parameters from plugins that are\n    // very deeply woven into command line handling. These are right now\n    // multiprocessing, which indicates that it's forking via extra\n\n    // command line argument. And Windows Service indicates need to\n    //   install and exit here too.\n\n    for (int i = 1; i < argc; i++) {\n        if ((i + 1 < argc) && (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"--multiprocessing-fork\")) == 0) {\n            is_multiprocessing_fork = true;\n            break;\n        }\n\n        if ((i + 1 < argc) && (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"--multiprocessing-resource-tracker\")) == 0) {\n#if _NUITKA_NATIVE_WCHAR_ARGV == 0\n            multiprocessing_resource_tracker_arg = atoi(argv[i + 1]);\n#else\n            multiprocessing_resource_tracker_arg = _wtoi(argv[i + 1]);\n#endif\n            break;\n        }\n\n        if (i == 1) {\n#ifdef _NUITKA_PLUGIN_WINDOWS_SERVICE_ENABLED\n            if (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"install\") == 0) {\n                NUITKA_PRINT_TRACE(\"main(): Calling plugin SvcInstall().\");\n\n                SvcInstall();\n                NUITKA_CANNOT_GET_HERE(\"SvcInstall must not return\");\n            }\n#endif\n        }\n\n        if ((i + 1 < argc) && (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"-c\") == 0)) {\n            // The joblib loky resource tracker is launched like this.\n            if (scanFilename(argv[i + 1],\n                             FILENAME_EMPTY_STR\n                             \"from joblib.externals.loky.backend.resource_tracker import main; main(%i, False)\",\n                             &loky_resource_tracker_arg)) {\n                break;\n            }\n\n#if defined(_WIN32)\n            if (strcmpFilename(argv[i + 1], FILENAME_EMPTY_STR\n                               \"from joblib.externals.loky.backend.popen_loky_win32 import main; main()\") == 0) {\n                is_joblib_popen_loky_win32 = true;\n                break;\n            }\n\n            if (scanFilename(argv[i + 1],\n                             FILENAME_EMPTY_STR \"from joblib.externals.loky.backend.popen_loky_win32 import main; \"\n                                                \"main(pipe_handle=%i, parent_pid=%i)\",\n                             &loky_joblib_pipe_handle_arg, &loky_joblib_parent_pid_arg)) {\n                is_joblib_popen_loky_win32 = true;\n                break;\n            }\n\n#endif\n        }\n\n#if !defined(_WIN32)\n        if ((i + 1 < argc) && (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"-m\") == 0)) {\n            // The joblib loky posix popen is launching like this.\n            if (strcmpFilename(argv[i + 1], FILENAME_EMPTY_STR \"joblib.externals.loky.backend.popen_loky_posix\") == 0) {\n                is_joblib_popen_loky_posix = true;\n                break;\n            }\n        }\n#endif\n\n#if !defined(_NUITKA_DEPLOYMENT_MODE) && !defined(_NUITKA_NO_DEPLOYMENT_SELF_EXECUTION)\n        if ((strcmpFilename(argv[i], FILENAME_EMPTY_STR \"-c\") == 0) ||\n            (strcmpFilename(argv[i], FILENAME_EMPTY_STR \"-m\") == 0)) {\n            fprintf(stderr,\n                    \"Error, the program tried to call itself with '\" FILENAME_FORMAT_STR \"' argument. Disable with \"\n                    \"'--no-deployment-flag=self-execution'.\\n\",\n                    argv[i]);\n            exit(2);\n        }\n#endif\n    }\n}\n\n#if defined(_NUITKA_ONEFILE_MODE) && defined(_WIN32)\n\nstatic long onefile_ppid;\n\nDWORD WINAPI doOnefileParentMonitoring(LPVOID lpParam) {\n    NUITKA_PRINT_TRACE(\"Onefile parent monitoring starts.\");\n\n    for (;;) {\n        Sleep(1000);\n\n        HANDLE handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, onefile_ppid);\n\n        if (handle == NULL) {\n            if (GetLastError() == ERROR_INVALID_PARAMETER) {\n                break;\n            } else {\n                continue;\n            }\n        } else {\n            DWORD ret = WaitForSingleObject(handle, 0);\n\n            CloseHandle(handle);\n\n            if (ret == WAIT_OBJECT_0) {\n                break;\n            }\n        }\n    }\n\n    NUITKA_PRINT_TRACE(\"Onefile parent monitoring causes KeyboardInterrupt.\");\n    PyErr_SetInterrupt();\n\n    Sleep(_NUITKA_ONEFILE_CHILD_GRACE_TIME_INT);\n\n    NUITKA_PRINT_TRACE(\"Onefile parent monitoring hard kills after ignored KeyboardInterrupt.\");\n    ExitProcess(1);\n\n    return 0;\n}\n#endif\n\n#if defined(_WIN32) && PYTHON_VERSION < 0x300\nstatic char **getCommandLineToArgvA(char *lpCmdline) {\n    char *s = lpCmdline;\n\n    int argc = 1;\n\n    if (*s == '\"') {\n        s++;\n\n        while (*s != 0) {\n            if (*s++ == '\"') {\n                break;\n            }\n        }\n    } else {\n        while (*s != 0 && *s != ' ' && *s != '\\t') {\n            s++;\n        }\n    }\n\n    while (*s == ' ' || *s == '\\t') {\n        s++;\n    }\n\n    if (*s != 0) {\n        argc++;\n    }\n\n    int quote_count = 0;\n    int slash_count = 0;\n\n    while (*s != 0) {\n        if ((*s == ' ' || *s == '\\t') && quote_count == 0) {\n            while (*s == ' ' || *s == '\\t') {\n                s++;\n            }\n\n            if (*s != 0) {\n                argc++;\n            }\n            slash_count = 0;\n        } else if (*s == '\\\\') {\n            slash_count++;\n            s++;\n        } else if (*s == '\"') {\n            if ((slash_count & 1) == 0) {\n                quote_count++;\n            }\n\n            slash_count = 0;\n            s++;\n\n            while (*s == '\"') {\n                quote_count++;\n                s++;\n            }\n\n            quote_count = quote_count % 3;\n\n            if (quote_count == 2) {\n                quote_count = 0;\n            }\n        } else {\n            slash_count = 0;\n            s++;\n        }\n    }\n\n    char **argv = (char **)malloc((argc + 1) * sizeof(char *) + (strlen(lpCmdline) + 1));\n    assert(argv);\n\n    char *cmdline = (char *)(argv + argc + 1);\n    strcpy(cmdline, lpCmdline);\n\n    argv[0] = cmdline;\n    argc = 1;\n\n    char *d = cmdline;\n\n    if (*d == '\"') {\n        s = d + 1;\n\n        while (*s != 0) {\n            if (*s == '\"') {\n                s++;\n                break;\n            }\n\n            *d++ = *s++;\n        }\n    } else {\n        while (*d && *d != ' ' && *d != '\\t') {\n            d++;\n        }\n\n        s = d;\n\n        if (*s) {\n            s++;\n        }\n    }\n\n    *d++ = 0;\n\n    while (*s == ' ' || *s == '\\t') {\n        s++;\n    }\n\n    if (*s == 0) {\n        argv[argc] = NULL;\n        return argv;\n    }\n\n    argv[argc++] = d;\n    quote_count = 0;\n    slash_count = 0;\n\n    while (*s != 0) {\n        if ((*s == ' ' || *s == '\\t') && quote_count == 0) {\n            *d++ = 0;\n            slash_count = 0;\n\n            do {\n                s++;\n            } while (*s == ' ' || *s == '\\t');\n\n            if (*s) {\n                argv[argc++] = d;\n            }\n\n        } else if (*s == '\\\\') {\n            *d++ = *s++;\n            slash_count++;\n        } else if (*s == '\"') {\n            if ((slash_count & 1) == 0) {\n                d -= slash_count / 2;\n                quote_count++;\n            } else {\n                d = d - slash_count / 2 - 1;\n                *d++ = '\"';\n            }\n            s++;\n            slash_count = 0;\n\n            while (*s == '\"') {\n                if (++quote_count == 3) {\n                    *d++ = '\"';\n                    quote_count = 0;\n                }\n                s++;\n            }\n            if (quote_count == 2)\n                quote_count = 0;\n        } else {\n            *d++ = *s++;\n            slash_count = 0;\n        }\n    }\n\n    *d = '\\0';\n    argv[argc] = NULL;\n\n    return argv;\n}\n#endif\n\n// Disable wild card expansion for MinGW64, spell-checker: ignore _dowildcard\n#if defined(__MINGW64__) || defined(__MINGW32__)\nint _dowildcard = 0;\n#endif\n\n#ifdef _WIN32\nstatic void setStdFileHandleNumber(PyThreadState *tstate, DWORD std_handle_id, PyObject *file_handle) {\n    PyObject *file_no_value = CALL_METHOD_NO_ARGS(tstate, file_handle, const_str_plain_fileno);\n\n    if (unlikely(file_no_value == NULL)) {\n        CLEAR_ERROR_OCCURRED(tstate);\n        return;\n    }\n\n    long file_number = PyLong_AsLong(file_no_value);\n\n    Py_DECREF(file_no_value);\n\n    if (unlikely(file_number == -1 && DROP_ERROR_OCCURRED(tstate))) {\n        return;\n    }\n\n    // Casting from long to handle gives warnings if not using a suitable\n    // sized integer type in between.\n    if (std_handle_id != STD_INPUT_HANDLE) {\n        SetStdHandle(std_handle_id, (HANDLE)(intptr_t)file_number);\n    }\n}\n#endif\n\nstatic bool shallSetOutputHandleToNull(char const *name) {\n#if NUITKA_FORCED_STDOUT_NULL_BOOL\n    if (strcmp(name, \"stdout\") == 0) {\n        return true;\n    }\n#endif\n\n#if NUITKA_FORCED_STDERR_NULL_BOOL\n    if (strcmp(name, \"stderr\") == 0) {\n        return true;\n    }\n#endif\n\n    PyObject *sys_std_handle = Nuitka_SysGetObject(name);\n    if (sys_std_handle == NULL || sys_std_handle == Py_None) {\n        return true;\n    }\n\n    return false;\n}\n\nstatic void setStdinHandle(PyThreadState *tstate, PyObject *stdin_file) {\n\n    CHECK_OBJECT(stdin_file);\n    Nuitka_SysSetObject(\"stdin\", stdin_file);\n\n#ifdef _WIN32\n    setStdFileHandleNumber(tstate, STD_INPUT_HANDLE, stdin_file);\n#endif\n}\n\nstatic void setStdoutHandle(PyThreadState *tstate, PyObject *stdout_file) {\n    CHECK_OBJECT(stdout_file);\n    Nuitka_SysSetObject(\"stdout\", stdout_file);\n\n#ifdef _WIN32\n    setStdFileHandleNumber(tstate, STD_OUTPUT_HANDLE, stdout_file);\n#endif\n}\n\nstatic void setStderrHandle(PyThreadState *tstate, PyObject *stderr_file) {\n    CHECK_OBJECT(stderr_file);\n\n    Nuitka_SysSetObject(\"stderr\", stderr_file);\n\n#ifdef _WIN32\n    setStdFileHandleNumber(tstate, STD_ERROR_HANDLE, stderr_file);\n#endif\n}\n\n#if NUITKA_STANDARD_HANDLES_EARLY == 0\n#if defined(NUITKA_FORCED_STDOUT_PATH) || defined(NUITKA_FORCED_STDERR_PATH)\n#ifdef _WIN32\nstatic PyObject *getExpandedTemplatePath(wchar_t const *template_path) {\n    wchar_t filename_buffer[1024];\n    bool res = expandTemplatePathW(filename_buffer, template_path, sizeof(filename_buffer) / sizeof(wchar_t));\n\n    if (res == false) {\n        puts(\"Error, couldn't expand pattern:\");\n        abort();\n    }\n\n    return NuitkaUnicode_FromWideChar(filename_buffer, -1);\n}\n#else\nstatic PyObject *getExpandedTemplatePath(char const *template_path) {\n    char filename_buffer[1024];\n    bool res = expandTemplatePath(filename_buffer, template_path, sizeof(filename_buffer));\n\n    if (res == false) {\n        printf(\"Error, couldn't expand pattern: %s\\n\", template_path);\n        abort();\n    }\n\n    return Nuitka_String_FromString(filename_buffer);\n}\n#endif\n#endif\n#endif\n\nstatic void setInputOutputHandles(PyThreadState *tstate) {\n    // We support disabling the stdout/stderr through options as well as\n    // building for GUI on Windows, which has inputs disabled by default, this\n    // code repairs that by setting or forcing them to \"os.devnull\"\n    // input/outputs\n\n    // This defaults to \"utf-8\" internally. We may add an argument of use\n    // platform ones in the future.\n    PyObject *encoding = NULL;\n\n// Reconfigure stdout for line buffering, for mixing traces and Python IO\n// better, and force it to utf-8, it often becomes platform IO for no good\n// reason.\n#if NUITKA_STANDARD_HANDLES_EARLY == 1 && PYTHON_VERSION >= 0x370\n#if defined(NUITKA_FORCED_STDOUT_PATH) || defined(NUITKA_FORCED_STDERR_PATH)\n    PyObject *args = MAKE_DICT_EMPTY();\n\n    DICT_SET_ITEM(args, const_str_plain_encoding, Nuitka_String_FromString(\"utf-8\"));\n    DICT_SET_ITEM(args, const_str_plain_line_buffering, Py_True);\n\n#if defined(NUITKA_FORCED_STDOUT_PATH)\n    {\n        PyObject *sys_stdout = Nuitka_SysGetObject(\"stdout\");\n\n        PyObject *method = LOOKUP_ATTRIBUTE(tstate, sys_stdout, const_str_plain_reconfigure);\n        CHECK_OBJECT(method);\n\n        PyObject *result = CALL_FUNCTION_WITH_KEYARGS(tstate, method, args);\n        CHECK_OBJECT(result);\n    }\n#endif\n\n#if defined(NUITKA_FORCED_STDERR_PATH)\n    {\n        PyObject *sys_stderr = Nuitka_SysGetObject(\"stderr\");\n\n        PyObject *method = LOOKUP_ATTRIBUTE(tstate, sys_stderr, const_str_plain_reconfigure);\n        CHECK_OBJECT(method);\n\n        PyObject *result = CALL_FUNCTION_WITH_KEYARGS(tstate, method, args);\n        CHECK_OBJECT(result);\n    }\n#endif\n\n    Py_DECREF(args);\n#endif\n#endif\n\n#if NUITKA_STANDARD_HANDLES_EARLY == 0\n#if defined(NUITKA_FORCED_STDOUT_PATH)\n    {\n#ifdef _WIN32\n        PyObject *filename = getExpandedTemplatePath(L\"\" NUITKA_FORCED_STDOUT_PATH);\n#else\n        PyObject *filename = getExpandedTemplatePath(NUITKA_FORCED_STDOUT_PATH);\n#endif\n        PyObject *stdout_file = BUILTIN_OPEN_SIMPLE(tstate, filename, \"w\", SYSFLAG_UNBUFFERED != 1, encoding);\n        if (unlikely(stdout_file == NULL)) {\n            PyErr_PrintEx(1);\n            Py_Exit(1);\n        }\n\n        setStdoutHandle(tstate, stdout_file);\n    }\n#endif\n\n#if defined(NUITKA_FORCED_STDERR_PATH)\n    {\n#ifdef _WIN32\n        PyObject *filename = getExpandedTemplatePath(L\"\" NUITKA_FORCED_STDERR_PATH);\n#else\n        PyObject *filename = getExpandedTemplatePath(NUITKA_FORCED_STDERR_PATH);\n#endif\n        PyObject *stderr_file = BUILTIN_OPEN_SIMPLE(tstate, filename, \"w\", false, encoding);\n        if (unlikely(stderr_file == NULL)) {\n            PyErr_PrintEx(1);\n            Py_Exit(1);\n        }\n\n        setStderrHandle(tstate, stderr_file);\n    }\n#endif\n#endif\n\n    {\n#if defined(_WIN32)\n        PyObject *devnull_filename = Nuitka_String_FromString(\"NUL:\");\n#else\n        PyObject *devnull_filename = Nuitka_String_FromString(\"/dev/null\");\n#endif\n\n        if (shallSetOutputHandleToNull(\"stdin\")) {\n            // CPython core requires stdin to be buffered due to methods usage, and it won't matter\n            // here much.\n            PyObject *stdin_file = BUILTIN_OPEN_SIMPLE(tstate, devnull_filename, \"r\", true, encoding);\n\n            setStdinHandle(tstate, stdin_file);\n        }\n\n        if (shallSetOutputHandleToNull(\"stdout\")) {\n            PyObject *stdout_file = BUILTIN_OPEN_SIMPLE(tstate, devnull_filename, \"w\", false, encoding);\n\n            setStdoutHandle(tstate, stdout_file);\n        }\n\n        if (shallSetOutputHandleToNull(\"stderr\")) {\n            PyObject *stderr_file = BUILTIN_OPEN_SIMPLE(tstate, devnull_filename, \"w\", false, encoding);\n\n            setStderrHandle(tstate, stderr_file);\n        }\n\n        Py_DECREF(devnull_filename);\n    }\n\n#if NUITKA_FORCED_STDOUT_NONE_BOOL\n    setStdoutHandle(tstate, Py_None);\n#endif\n\n#if NUITKA_FORCED_STDERR_NONE_BOOL\n    setStderrHandle(tstate, Py_None);\n#endif\n\n    Py_XDECREF(encoding);\n}\n\nstatic void Nuitka_Py_Initialize(void) {\n#if PYTHON_VERSION < 0x380 || defined(_NUITKA_EXPERIMENTAL_OLD_PY_INITIALIZE)\n    Py_Initialize();\n#else\n    PyStatus status = _PyRuntime_Initialize();\n    if (unlikely(status._type != 0)) {\n        Py_ExitStatusException(status);\n    }\n    NUITKA_MAY_BE_UNUSED _PyRuntimeState *runtime = &_PyRuntime;\n    assert(!runtime->initialized);\n\n    PyConfig config;\n    _PyConfig_InitCompatConfig(&config);\n\n    assert(orig_argv[0]);\n    status = PyConfig_SetArgv(&config, orig_argc, orig_argv);\n\n    if (PyStatus_Exception(status)) {\n        Py_ExitStatusException(status);\n    }\n\n#ifdef _NUITKA_STANDALONE\n    wchar_t *binary_directory = (wchar_t *)getBinaryDirectoryWideChars(true);\n\n    PyConfig_SetString(&config, &config.executable, orig_argv[0]);\n    PyConfig_SetString(&config, &config.prefix, binary_directory);\n    PyConfig_SetString(&config, &config.exec_prefix, binary_directory);\n    PyConfig_SetString(&config, &config.base_prefix, binary_directory);\n    PyConfig_SetString(&config, &config.base_exec_prefix, binary_directory);\n    PyConfig_SetString(&config, &config.home, binary_directory);\n#if PYTHON_VERSION >= 0x390\n    PyConfig_SetString(&config, &config.platlibdir, binary_directory);\n#endif\n\n    PyWideStringList_Append(&config.module_search_paths, binary_directory);\n    config.module_search_paths_set = 1;\n#endif\n\n    // Need to disable frozen modules, Nuitka can handle them better itself.\n#if PYTHON_VERSION >= 0x3b0\n#ifdef _NUITKA_STANDALONE\n    config.use_frozen_modules = 0;\n#else\n// Emulate PYTHON_FROZEN_MODULES for accelerated mode, it is only added in 3.13,\n// but we need to control it for controlling things for accelerated binaries\n// too.\n#if PYTHON_VERSION >= 0x3b0 && PYTHON_VERSION <= 0x3d0\n    environment_char_t const *frozen_modules_env = getEnvironmentVariable(\"PYTHON_FROZEN_MODULES\");\n\n    if (frozen_modules_env == NULL ||\n        (compareEnvironmentString(frozen_modules_env, makeEnvironmentLiteral(\"off\")) == 0)) {\n        config.use_frozen_modules = 0;\n    }\n#endif\n#endif\n#endif\n\n    config.install_signal_handlers = 1;\n\n    NUITKA_PRINT_TIMING(\"Nuitka_Py_Initialize(): Calling Py_InitializeFromConfig.\");\n\n    status = Py_InitializeFromConfig(&config);\n    if (unlikely(status._type != 0)) {\n        Py_ExitStatusException(status);\n    }\n\n#ifdef _NUITKA_STANDALONE\n    assert(wcscmp(config.exec_prefix, binary_directory) == 0);\n\n// Empty \"sys.path\" first time, will be revived, but keep it\n// short lived.\n#if SYSFLAG_ISOLATED\n    Nuitka_SysSetObject(\"path\", PyList_New(0));\n#endif\n#endif\n\n#endif\n}\n\n#include <fcntl.h>\n\n#if NUITKA_STANDARD_HANDLES_EARLY == 1\n#if defined(_WIN32)\n\nstatic void changeStandardHandleTarget(int std_handle_id, FILE *std_handle, filename_char_t const *template_path) {\n    filename_char_t filename_buffer[1024];\n\n    // TODO: We should only have one that works with filename_char_t rather than having\n    // to make a difference here.\n#ifdef _WIN32\n    bool res = expandTemplatePathW(filename_buffer, template_path, sizeof(filename_buffer) / sizeof(filename_char_t));\n\n    if (res == false) {\n        wprintf(L\"Error, couldn't expand pattern '%lS'\\n\", template_path);\n        abort();\n    }\n#else\n    bool res = expandTemplatePath(filename_buffer, template_path, sizeof(filename_buffer) / sizeof(filename_char_t));\n\n    if (res == false) {\n        printf(\"Error, couldn't expand pattern: '%s'\\n\", template_path);\n        abort();\n    }\n#endif\n\n    if (GetStdHandle(std_handle_id) == 0) {\n        FILE *file_handle;\n\n        if (std_handle_id == STD_INPUT_HANDLE) {\n            file_handle = _wfreopen(filename_buffer, L\"rb\", std_handle);\n        } else {\n            file_handle = _wfreopen(filename_buffer, L\"wb\", std_handle);\n        }\n\n        if (file_handle == NULL) {\n            perror(\"_wfreopen\");\n            abort();\n        }\n\n        BOOL r = SetStdHandle(std_handle_id, (HANDLE)_get_osfhandle(fileno(file_handle)));\n        assert(r);\n\n        *std_handle = *file_handle;\n\n        assert(fileno(file_handle) == fileno(std_handle));\n\n        int stdout_dup = dup(fileno(std_handle));\n        if (stdout_dup >= 0) {\n            close(stdout_dup);\n        }\n\n        DWORD mode = 0;\n        if (GetConsoleMode((HANDLE)_get_osfhandle(fileno(std_handle)), &mode)) {\n            exit(66);\n        }\n    } else {\n        HANDLE w = CreateFileW(filename_buffer, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,\n                               CREATE_ALWAYS, 0, NULL);\n\n        if (w == INVALID_HANDLE_VALUE) {\n            printOSErrorMessage(\"standard handle failed to create\", GetLastError());\n            abort();\n        }\n        BOOL r = SetStdHandle(std_handle_id, w);\n        assert(r);\n\n        int os_handle = _open_osfhandle((intptr_t)GetStdHandle(std_handle_id), O_WRONLY | O_TEXT);\n        if (os_handle == -1) {\n            perror(\"_open_osfhandle\");\n            abort();\n        }\n\n        int int_res = dup2(os_handle, fileno(std_handle));\n\n        // Without a console, this is normal.\n        if (int_res == -1) {\n            perror(\"_open_osfhandle\");\n            abort();\n        }\n\n        close(os_handle);\n    }\n\n    setvbuf(std_handle, NULL, _IOLBF, 4096);\n}\n#else\nstatic void changeStandardHandleTarget(FILE *std_handle, filename_char_t const *template_path) {\n    filename_char_t filename_buffer[1024];\n\n    bool res = expandTemplatePath(filename_buffer, template_path, sizeof(filename_buffer) / sizeof(filename_char_t));\n\n    if (res == false) {\n        printf(\"Error, couldn't expand pattern: '%s'\\n\", template_path);\n        abort();\n    }\n\n    int os_handle = open(filename_buffer, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);\n    if (os_handle == -1) {\n        perror(\"open\");\n        abort();\n    }\n\n    int int_res = dup2(os_handle, fileno(std_handle));\n    if (int_res == -1) {\n        perror(\"dup2\");\n        abort();\n    }\n\n    close(os_handle);\n}\n#endif\n#endif\n\n#if defined(_NUITKA_EXPERIMENTAL_SHOW_STARTUP_TIME)\nstatic void Nuitka_at_exit(void) { NUITKA_PRINT_TIMING(\"Nuitka_at_exit(): Called by C exit()\"); }\n#endif\n\n#ifdef _NUITKA_WINMAIN_ENTRY_POINT\nint __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpCmdLine, int nCmdShow) {\n    /* MSVC, MINGW64 */\n    int argc = __argc;\n    wchar_t **argv = __wargv;\n#else\n#if defined(_WIN32)\nint wmain(int argc, wchar_t **argv) {\n#else\nint main(int argc, char **argv) {\n#endif\n#endif\n#ifdef _NUITKA_EXPERIMENTAL_DUMP_C_TRACEBACKS\n    INIT_C_BACKTRACES();\n    DUMP_C_BACKTRACE();\n#endif\n    // Trace when the process exits.\n#if defined(_NUITKA_EXPERIMENTAL_SHOW_STARTUP_TIME)\n    atexit(Nuitka_at_exit);\n#endif\n\n    // First things, set up stdout/stderr according to user specification.\n#if NUITKA_STANDARD_HANDLES_EARLY == 1\n#if defined(NUITKA_FORCED_STDOUT_PATH)\n#ifdef _WIN32\n    changeStandardHandleTarget(STD_OUTPUT_HANDLE, stdout, L\"\" NUITKA_FORCED_STDOUT_PATH);\n#else\n    changeStandardHandleTarget(stdout, NUITKA_FORCED_STDOUT_PATH);\n#endif\n#endif\n#if defined(NUITKA_FORCED_STDERR_PATH)\n#ifdef _WIN32\n    changeStandardHandleTarget(STD_ERROR_HANDLE, stderr, L\"\" NUITKA_FORCED_STDERR_PATH);\n#else\n    changeStandardHandleTarget(stderr, NUITKA_FORCED_STDERR_PATH);\n#endif\n#endif\n#if defined(NUITKA_FORCED_STDIN_PATH)\n#ifdef _WIN32\n    changeStandardHandleTarget(STD_INPUT_HANDLE, stdin, L\"\" NUITKA_FORCED_STDIN_PATH);\n#else\n    changeStandardHandleTarget(stdin, NUITKA_FORCED_STDIN_PATH);\n#endif\n#endif\n#endif\n\n#if SYSFLAG_UNBUFFERED == 1\n    setbuf(stdin, (char *)NULL);\n    setbuf(stdout, (char *)NULL);\n    setbuf(stderr, (char *)NULL);\n\n#if PYTHON_VERSION >= 0x300\n    // spell-checker: ignore PYTHONUNBUFFERED\n\n    environment_char_t const *old_env_unbuffered = getEnvironmentVariable(\"PYTHONUNBUFFERED\");\n    setEnvironmentVariable(\"PYTHONUNBUFFERED\", makeEnvironmentLiteral(\"1\"));\n#endif\n#endif\n\n    NUITKA_PRINT_TIMING(\"main(): Entered.\");\n    NUITKA_INIT_PROGRAM_EARLY(argc, argv);\n\n#ifdef __FreeBSD__\n    // FP exceptions run in \"no stop\" mode by default\n    // spell-checker: ignore fpgetmask,fpsetmask\n\n    fp_except_t m;\n\n    m = fpgetmask();\n    fpsetmask(m & ~FP_X_OFL);\n#endif\n\n#ifdef _NUITKA_STANDALONE\n    NUITKA_PRINT_TIMING(\"main(): Prepare standalone environment.\");\n    prepareStandaloneEnvironment();\n#endif\n\n#if _NUITKA_FROZEN > 0\n    NUITKA_PRINT_TIMING(\"main(): Preparing frozen modules.\");\n    prepareFrozenModules();\n#endif\n\n    /* Initialize CPython library environment. */\n    Py_DebugFlag = 0;\n#if PYTHON_VERSION < 0x300\n    Py_Py3kWarningFlag = SYSFLAG_PY3K_WARNING;\n    Py_DivisionWarningFlag = SYSFLAG_DIVISION_WARNING;\n    Py_UnicodeFlag = SYSFLAG_UNICODE;\n    Py_TabcheckFlag = 0;\n#endif\n    Py_InspectFlag = 0;\n    Py_InteractiveFlag = 0;\n    Py_OptimizeFlag = SYSFLAG_OPTIMIZE;\n    Py_DontWriteBytecodeFlag = 0;\n    Py_NoUserSiteDirectory = SYSFLAG_NO_SITE;\n    Py_IgnoreEnvironmentFlag = 0;\n    Py_VerboseFlag = SYSFLAG_VERBOSE;\n    Py_BytesWarningFlag = SYSFLAG_BYTES_WARNING;\n#if PYTHON_VERSION >= 0x300 && SYSFLAG_UNBUFFERED == 1\n    Py_UnbufferedStdioFlag = SYSFLAG_UNBUFFERED;\n#endif\n#if SYSFLAG_NO_RANDOMIZATION == 1\n    Py_HashRandomizationFlag = 0;\n#if PYTHON_VERSION < 0x300\n    // For Python2 this is all it takes to have static hashes.\n    _PyRandom_Init();\n#endif\n#endif\n#if PYTHON_VERSION >= 0x370\n    Py_UTF8Mode = SYSFLAG_UTF8;\n\n    if (Py_UTF8Mode) {\n        if (Py_FileSystemDefaultEncoding == NULL) {\n            Py_FileSystemDefaultEncoding = \"utf-8\";\n            Py_HasFileSystemDefaultEncoding = 1;\n        }\n    }\n#endif\n\n#ifdef NUITKA_PYTHON_STATIC\n    NUITKA_PRINT_TIMING(\"main(): Preparing static modules.\");\n    Py_InitStaticModules();\n#endif\n\n    /* This suppresses warnings from getpath.c */\n    Py_FrozenFlag = 1;\n\n    /* We want to import the site module, but only after we finished our own\n     * setup. The site module import will be the first thing, the main module\n     * does.\n     */\n    Py_NoSiteFlag = 1;\n\n    /* Initial command line handling only. */\n\n#if PYTHON_VERSION >= 0x300 && _NUITKA_NATIVE_WCHAR_ARGV == 0\n    NUITKA_PRINT_TRACE(\"main(): Calling convertCommandLineParameters.\");\n    orig_argv = convertCommandLineParameters(argc, argv);\n#elif PYTHON_VERSION < 0x300 && _NUITKA_NATIVE_WCHAR_ARGV == 1\n    orig_argv = getCommandLineToArgvA(GetCommandLineA());\n#else\norig_argv = argv;\n#endif\n\n    // Make sure the compiled path of Python is replaced.\n    Py_SetProgramName(orig_argv[0]);\n\n    orig_argc = argc;\n\n    // Early command line parsing.\n    NUITKA_PRINT_TRACE(\"main(): Calling setCommandLineParameters.\");\n    setCommandLineParameters(argc, argv);\n\n    /* For Python installations that need the home set, we inject it back here. */\n#if defined(PYTHON_HOME_PATH)\n#if PYTHON_VERSION < 0x300\n    NUITKA_PRINT_TRACE(\"main(): Prepare run environment '\" PYTHON_HOME_PATH \"'.\");\n    Py_SetPythonHome(PYTHON_HOME_PATH);\n#else\n    NUITKA_PRINTF_TRACE(\"main(): Prepare run environment '%S'.\\n\", L\"\" PYTHON_HOME_PATH);\n    Py_SetPythonHome(L\"\" PYTHON_HOME_PATH);\n    // Make sure the above Py_SetPythonHome call has effect already.\n    Py_GetPath();\n#endif\n#endif\n\n#if PYTHON_VERSION >= 0x300 && SYSFLAG_NO_RANDOMIZATION == 1\n    environment_char_t const *old_env_hash_seed = getEnvironmentVariable(\"PYTHONHASHSEED\");\n    setEnvironmentVariable(\"PYTHONHASHSEED\", makeEnvironmentLiteral(\"0\"));\n#endif\n\n    /* Disable CPython warnings if requested to. */\n#if NO_PYTHON_WARNINGS\n    NUITKA_PRINT_TRACE(\"main(): Disabling Python warnings.\");\n    {\n#if PYTHON_VERSION >= 0x300\n        wchar_t ignore[] = L\"ignore\";\n#else\n        char ignore[] = \"ignore\";\n#endif\n\n        PySys_ResetWarnOptions();\n        PySys_AddWarnOption(ignore);\n    }\n#endif\n\n// Workaround older Python not handling stream setup on redirected files properly.\n#if PYTHON_VERSION >= 0x340 && PYTHON_VERSION < 0x380\n    {\n        char const *encoding = NULL;\n\n        if (SYSFLAG_UTF8) {\n            encoding = \"utf-8\";\n        } else {\n            encoding = getenv(\"PYTHONIOENCODING\");\n            if (encoding == NULL) {\n                encoding = \"utf-8\";\n            }\n        }\n\n        Py_SetStandardStreamEncoding(encoding, NULL);\n    }\n#endif\n\n    /* Initialize the embedded CPython interpreter. */\n    NUITKA_PRINT_TIMING(\"main(): Calling Nuitka_Py_Initialize to initialize interpreter.\");\n    Nuitka_Py_Initialize();\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#ifdef _NUITKA_STANDALONE\n    NUITKA_PRINT_TRACE(\"main(): Restore standalone environment.\");\n    restoreStandaloneEnvironment();\n#else\n    {\n        environment_char_t const *python_path_cstr = getEnvironmentVariable(\"NUITKA_PYTHONPATH\");\n\n        if (python_path_cstr != NULL) {\n            PyObject *python_path_str = Nuitka_String_FromFilename(python_path_cstr);\n#ifdef _WIN32\n            PyObject *python_path_list = PyObject_CallMethod(python_path_str, (char *)\"split\", (char *)\"s\", \";\");\n#else\n            PyObject *python_path_list = PyObject_CallMethod(python_path_str, (char *)\"split\", (char *)\"s\", \":\");\n#endif\n            Py_DECREF(python_path_str);\n\n            PySys_SetObject(\"path\", python_path_list);\n\n            unsetEnvironmentVariable(\"NUITKA_PYTHONPATH\");\n        }\n    }\n#endif\n\n    /* Lie about it, believe it or not, there are \"site\" files, that check\n     * against later imports, see below.\n     */\n    Py_NoSiteFlag = SYSFLAG_NO_SITE;\n\n    /* Set the command line parameters for run time usage. */\n    PySys_SetArgv(argc, orig_argv);\n// Empty \"sys.path\" again, the above adds program directory to it.\n#if SYSFLAG_ISOLATED\n    Nuitka_SysSetObject(\"path\", PyList_New(0));\n#endif\n\n    /* Initialize the built-in module tricks used and builtin-type methods */\n    NUITKA_PRINT_TRACE(\"main(): Calling _initBuiltinModule().\");\n    _initBuiltinModule();\n\n    /* Initialize the Python constant values used. This also sets\n     * \"sys.executable\" while at it.\n     */\n    NUITKA_PRINT_TIMING(\"main(): Calling createGlobalConstants().\");\n    createGlobalConstants(tstate);\n    NUITKA_PRINT_TIMING(\"main(): Returned createGlobalConstants().\");\n\n    /* Complex call helpers need \"__main__\" constants, even if we only\n     * go into \"__parents__main__\" module as a start point.\n     */\n    NUITKA_PRINT_TIMING(\"main(): Calling createMainModuleConstants().\");\n    createMainModuleConstants(tstate);\n    NUITKA_PRINT_TIMING(\"main(): Returned createMainModuleConstants().\");\n\n    NUITKA_PRINT_TRACE(\"main(): Calling _initBuiltinOriginalValues().\");\n    _initBuiltinOriginalValues();\n\n    /* Revert the wrong \"sys.flags\" value, it's used by \"site\" on at least\n     * Debian for Python 3.3, more uses may exist.\n     */\n#if SYSFLAG_NO_SITE == 0\n#if PYTHON_VERSION < 0x300\n    PyStructSequence_SET_ITEM(Nuitka_SysGetObject(\"flags\"), 9, const_int_0);\n#else\n    PyStructSequence_SetItem(Nuitka_SysGetObject(\"flags\"), 6, const_int_0);\n#endif\n#endif\n\n    /* Initialize the compiled types of Nuitka. */\n    _initCompiledCellType();\n    _initCompiledGeneratorType();\n    _initCompiledFunctionType();\n    _initCompiledMethodType();\n    _initCompiledFrameType();\n\n    _initSlotCompare();\n#if PYTHON_VERSION >= 0x270\n    _initSlotIterNext();\n#endif\n\n    NUITKA_PRINT_TRACE(\"main(): Calling enhancePythonTypes().\");\n    enhancePythonTypes();\n\n    NUITKA_PRINT_TRACE(\"main(): Calling patchTypeComparison().\");\n    patchTypeComparison();\n\n    NUITKA_PRINT_TRACE(\"main(): Calling patchTracebackDealloc().\");\n    patchTracebackDealloc();\n\n#ifndef NUITKA_USE_PYCORE_THREAD_STATE\n    /* Allow to override the ticker value, to remove checks for threads in\n     * CPython core from impact on benchmarks. */\n    char const *ticker_value = getenv(\"NUITKA_TICKER\");\n    if (ticker_value != NULL) {\n        _Py_Ticker = atoi(ticker_value);\n        assert(_Py_Ticker >= 20);\n    }\n#endif\n\n    NUITKA_PRINT_TRACE(\"main(): Setting Python input/output handles.\");\n    setInputOutputHandles(tstate);\n\n#ifdef _NUITKA_STANDALONE\n\n#if PYTHON_VERSION >= 0x300\n    // Make sure the importlib fully bootstraps as we couldn't load it with the\n    // standard loader.\n    {\n        NUITKA_MAY_BE_UNUSED PyObject *importlib_module = getImportLibBootstrapModule();\n        CHECK_OBJECT(importlib_module);\n    }\n#endif\n\n    NUITKA_PRINT_TRACE(\"main(): Calling setEarlyFrozenModulesFileAttribute().\");\n\n    setEarlyFrozenModulesFileAttribute(tstate);\n#endif\n\n#if _NUITKA_FROZEN > 0\n    NUITKA_PRINT_TRACE(\"main(): Removing early frozen module table again.\");\n    PyImport_FrozenModules = old_frozen;\n#endif\n\n    NUITKA_PRINT_TRACE(\"main(): Calling setupMetaPathBasedLoader().\");\n    /* Enable meta path based loader. */\n    setupMetaPathBasedLoader(tstate);\n\n    /* Initialize warnings module. */\n    _PyWarnings_Init();\n\n#if NO_PYTHON_WARNINGS && PYTHON_VERSION >= 0x342 && PYTHON_VERSION < 0x3a0 && defined(_NUITKA_FULL_COMPAT)\n    // For full compatibility bump the warnings registry version,\n    // otherwise modules \"__warningregistry__\" will mismatch.\n    PyObject *warnings_module = PyImport_ImportModule(\"warnings\");\n    PyObject *meth = PyObject_GetAttrString(warnings_module, \"_filters_mutated\");\n\n    CALL_FUNCTION_NO_ARGS(tstate, meth);\n#if PYTHON_VERSION < 0x380\n    // Two times, so \"__warningregistry__\" version matches.\n    CALL_FUNCTION_NO_ARGS(tstate, meth);\n#endif\n#endif\n\n#if PYTHON_VERSION >= 0x300\n    NUITKA_PRINT_TRACE(\"main(): Calling patchInspectModule().\");\n    patchInspectModule(tstate);\n#endif\n\n#if PYTHON_VERSION >= 0x300 && SYSFLAG_NO_RANDOMIZATION == 1\n    NUITKA_PRINT_TRACE(\"main(): Reverting to initial 'PYTHONHASHSEED' value.\");\n    undoEnvironmentVariable(tstate, \"PYTHONHASHSEED\", old_env_hash_seed);\n#endif\n\n#if PYTHON_VERSION >= 0x300 && SYSFLAG_UNBUFFERED == 1\n    NUITKA_PRINT_TRACE(\"main(): Reverting to initial 'PYTHONUNBUFFERED' value.\");\n    undoEnvironmentVariable(tstate, \"PYTHONUNBUFFERED\", old_env_unbuffered);\n#endif\n\n#ifdef _NUITKA_STANDALONE\n    // Restore the PATH, so the program can use it.\n    NUITKA_PRINT_TRACE(\"main(): Reverting to initial 'PATH' value.\");\n    undoEnvironmentVariable(tstate, \"PATH\", old_env_path);\n    undoEnvironmentVariable(tstate, \"PYTHONHOME\", old_env_pythonhome);\n#endif\n\n#if _NUITKA_PROFILE\n    // Profiling with \"vmprof\" if enabled.\n    startProfiling();\n#endif\n\n#if _NUITKA_PGO_PYTHON\n    // Profiling with our own Python PGO if enabled.\n    PGO_Initialize();\n#endif\n\n    // Execute the main module unless plugins want to do something else. In case\n    // of multiprocessing making a fork on Windows, we should execute\n    // \"__parents_main__\" instead. And for Windows Service we call the plugin C\n    // code to call us back to launch main code in a callback.\n#ifdef _NUITKA_PLUGIN_MULTIPROCESSING_ENABLED\n    if (unlikely(is_multiprocessing_fork)) {\n        NUITKA_PRINT_TRACE(\"main(): Calling __parents_main__.\");\n        EXECUTE_MAIN_MODULE(tstate, \"__parents_main__\", false);\n\n        int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n        NUITKA_PRINT_TRACE(\"main(): Calling __parents_main__ Py_Exit.\");\n        Py_Exit(exit_code);\n#if defined(_WIN32)\n    } else if (unlikely(is_joblib_popen_loky_win32)) {\n        NUITKA_PRINT_TRACE(\"main(): Calling joblib.externals.loky.backend.popen_loky_win32.\");\n        PyObject *joblib_popen_loky_win32_module =\n            EXECUTE_MAIN_MODULE(tstate, \"joblib.externals.loky.backend.popen_loky_win32\", true);\n\n        // Remove the \"-c\" and options part like CPython would do as well.\n        PyObject *argv_list = Nuitka_SysGetObject(\"argv\");\n        Py_ssize_t size = PyList_Size(argv_list);\n\n        // Negative indexes are not supported by this function.\n        int res = PyList_SetSlice(argv_list, 1, size - 2, const_tuple_empty);\n        assert(res == 0);\n\n        PyObject *main_function = PyObject_GetAttrString(joblib_popen_loky_win32_module, \"main\");\n        CHECK_OBJECT(main_function);\n\n        if (loky_joblib_pipe_handle_arg == 0) {\n            CALL_FUNCTION_NO_ARGS(tstate, main_function);\n        } else {\n            char const *kw_keys[] = {\"pipe_handle\", \"parent_pid\"};\n            PyObject *kw_values[] = {\n                PyLong_FromLong(loky_joblib_pipe_handle_arg),\n                PyLong_FromLong(loky_joblib_parent_pid_arg),\n            };\n\n            PyObject *kw_args = MAKE_DICT_X_CSTR(kw_keys, kw_values, sizeof(kw_values) / sizeof(PyObject *));\n\n            CALL_FUNCTION_WITH_KEYARGS(tstate, main_function, kw_args);\n        }\n\n        int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n        NUITKA_PRINT_TRACE(\"main(): Calling 'joblib.externals.loky.backend.popen_loky_posix' Py_Exit.\");\n        Py_Exit(exit_code);\n#else\n    } else if (unlikely(is_joblib_popen_loky_posix)) {\n        NUITKA_PRINT_TRACE(\"main(): Calling joblib.externals.loky.backend.popen_loky_posix.\");\n        PyObject *joblib_popen_loky_posix_module =\n            EXECUTE_MAIN_MODULE(tstate, \"joblib.externals.loky.backend.popen_loky_posix\", true);\n\n        // Remove the \"-m\" like CPython would do as well.\n        int res = PyList_SetSlice(Nuitka_SysGetObject(\"argv\"), 0, 2, const_tuple_empty);\n        assert(res == 0);\n\n        PyObject *main_function = PyObject_GetAttrString(joblib_popen_loky_posix_module, \"main\");\n        CHECK_OBJECT(main_function);\n\n        CALL_FUNCTION_NO_ARGS(tstate, main_function);\n\n        int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n        NUITKA_PRINT_TRACE(\"main(): Calling 'joblib.externals.loky.backend.popen_loky_posix' Py_Exit.\");\n        Py_Exit(exit_code);\n#endif\n    } else if (unlikely(multiprocessing_resource_tracker_arg != -1)) {\n        NUITKA_PRINT_TRACE(\"main(): Launching as 'multiprocessing.resource_tracker'.\");\n        PyObject *resource_tracker_module = EXECUTE_MAIN_MODULE(tstate, \"multiprocessing.resource_tracker\", true);\n\n        PyObject *main_function = PyObject_GetAttrString(resource_tracker_module, \"main\");\n        CHECK_OBJECT(main_function);\n\n        CALL_FUNCTION_WITH_SINGLE_ARG(tstate, main_function, PyInt_FromLong(multiprocessing_resource_tracker_arg));\n\n        int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n        NUITKA_PRINT_TRACE(\"main(): Calling 'multiprocessing.resource_tracker' Py_Exit.\");\n        Py_Exit(exit_code);\n    } else if (unlikely(loky_resource_tracker_arg != -1)) {\n        NUITKA_PRINT_TRACE(\"main(): Launching as 'joblib.externals.loky.backend.resource_tracker'.\");\n        PyObject *resource_tracker_module =\n            EXECUTE_MAIN_MODULE(tstate, \"joblib.externals.loky.backend.resource_tracker\", true);\n        CHECK_OBJECT(resource_tracker_module);\n\n        PyObject *main_function = PyObject_GetAttrString(resource_tracker_module, \"main\");\n        CHECK_OBJECT(main_function);\n\n        CALL_FUNCTION_WITH_SINGLE_ARG(tstate, main_function, PyInt_FromLong(loky_resource_tracker_arg));\n\n        int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n        NUITKA_PRINT_TRACE(\"main(): Calling 'joblib.externals.loky.backend.resource_tracker' Py_Exit.\");\n        Py_Exit(exit_code);\n    } else {\n#endif\n#if defined(_NUITKA_ONEFILE_MODE) && defined(_WIN32)\n        {\n            char buffer[128] = {0};\n            DWORD size = GetEnvironmentVariableA(\"NUITKA_ONEFILE_PARENT\", buffer, sizeof(buffer));\n\n            if (size > 0 && size < 127) {\n                onefile_ppid = atol(buffer);\n\n                CreateThread(NULL, 0, doOnefileParentMonitoring, NULL, 0, NULL);\n            }\n        }\n#endif\n        PyDict_DelItemString(Nuitka_GetSysModules(), NUITKA_MAIN_MODULE_NAME);\n\n#if _NUITKA_PLUGIN_WINDOWS_SERVICE_ENABLED\n        NUITKA_PRINT_TRACE(\"main(): Calling plugin SvcLaunchService() entry point.\");\n        SvcLaunchService();\n#else\n    /* Execute the \"__main__\" module. */\n    NUITKA_PRINT_TIMING(\"main(): Calling \" NUITKA_MAIN_MODULE_NAME \".\");\n    EXECUTE_MAIN_MODULE(tstate, NUITKA_MAIN_MODULE_NAME, NUITKA_MAIN_IS_PACKAGE_BOOL);\n    NUITKA_PRINT_TIMING(\"main(): Exited from \" NUITKA_MAIN_MODULE_NAME \".\");\n\n#endif\n#ifdef _NUITKA_PLUGIN_MULTIPROCESSING_ENABLED\n    }\n#endif\n\n#if _NUITKA_PROFILE\n    stopProfiling();\n#endif\n\n#if _NUITKA_PGO_PYTHON\n    // Write out profiling with our own Python PGO if enabled.\n    PGO_Finalize();\n#endif\n\n#ifndef __NUITKA_NO_ASSERT__\n    checkGlobalConstants();\n\n    /* TODO: Walk over all loaded compiled modules, and make this kind of checks. */\n#if !NUITKA_MAIN_IS_PACKAGE_BOOL\n    checkModuleConstants___main__(tstate);\n#endif\n\n#endif\n\n    int exit_code = HANDLE_PROGRAM_EXIT(tstate);\n\n    NUITKA_PRINT_TIMING(\"main(): Calling Py_Exit.\");\n    Py_Exit(exit_code);\n\n    // The \"Py_Exit()\" calls is not supposed to return.\n    NUITKA_CANNOT_GET_HERE(\"Py_Exit does not return\");\n}\n\n/* This is an unofficial API, not available on Windows, but on Linux and others\n * it is exported, and has been used by some code.\n */\n#if !defined(_WIN32) && !defined(__MSYS__)\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#if PYTHON_VERSION >= 0x300\n#if defined(__GNUC__)\n__attribute__((weak))\n__attribute__((visibility(\"default\")))\n#endif\nvoid Py_GetArgcArgv(int *argc, wchar_t ***argv) {\n    *argc = orig_argc;\n\n    *argv = orig_argv;\n}\n#else\n#if defined(__GNUC__)\n__attribute__((weak))\n__attribute__((visibility(\"default\")))\n#endif\nvoid Py_GetArgcArgv(int *argc, char ***argv) {\n    *argc = orig_argc;\n    *argv = orig_argv;\n}\n#endif\n\n#if defined(__linux__)\n__attribute__((weak))\n__attribute__((visibility(\"default\")))\n#endif\n#if PYTHON_VERSION >= 0x300\nint Py_Main(int argc, wchar_t **argv) {\n    return 0;\n}\n#else\nint Py_Main(int argc, char **argv) { return 0; }\n#endif\n#ifdef __cplusplus\n}\n#endif\n#endif\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/MetaPathBasedLoader.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This implements the loading of C compiled modules and shared library\n// extension modules bundled for standalone mode.\n\n// This is achieved mainly by registered a \"sys.meta_path\" loader, that then\n// gets asked for module names, and responds if knows about one. It's fed by\n// a table created at compile time.\n\n// The nature and use of these 2 loaded module kinds is very different, but\n// having them as distinct loaders would only require to duplicate the search\n// and registering of stuff.\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\n#include \"nuitka/unfreezing.h\"\n\n#ifdef _WIN32\n#undef SEP\n#define SEP '\\\\'\n#endif\n\n#ifdef _WIN32\n#include <windows.h>\n#endif\n\nextern PyTypeObject Nuitka_Loader_Type;\n\nstruct Nuitka_LoaderObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        /* The loader entry, to know what was loaded exactly. */\n        struct Nuitka_MetaPathBasedLoaderEntry const *m_loader_entry;\n};\n\n#ifdef _NUITKA_EXE\nstatic inline bool isVerbose(void) { return Py_VerboseFlag != 0; }\n#elif _NUITKA_SYSFLAG_VERBOSE\nstatic inline bool isVerbose(void) { return true; }\n#else\nstatic inline bool isVerbose(void) { return false; }\n#endif\n\nstatic struct Nuitka_MetaPathBasedLoaderEntry *loader_entries = NULL;\n\nstatic bool hasFrozenModule(char const *name) {\n    for (struct _frozen const *p = PyImport_FrozenModules; p != NULL; p++) {\n        if (p->name == NULL) {\n            return false;\n        }\n\n        if (strcmp(p->name, name) == 0) {\n            break;\n        }\n    }\n\n    return true;\n}\n\nstatic char *appendModuleNameAsPath(char *buffer, char const *module_name, size_t buffer_size) {\n    // Skip to the end\n    while (*buffer != 0) {\n        buffer++;\n    }\n\n    while (*module_name) {\n        if (buffer_size < 1) {\n            abort();\n        }\n\n        if (*module_name == '.') {\n            *buffer++ = SEP;\n            module_name++;\n        } else {\n            *buffer++ = *module_name++;\n        }\n\n        buffer_size -= 1;\n    }\n\n    *buffer = 0;\n\n    return buffer;\n}\n\n#if defined(_WIN32) && defined(_NUITKA_STANDALONE)\n\nstatic void appendModuleNameAsPathW(wchar_t *buffer, char const *module_name, size_t buffer_size) {\n    // Skip to the end\n    while (*buffer != 0) {\n        buffer++;\n    }\n\n    while (*module_name) {\n        char c = *module_name++;\n\n        if (c == '.') {\n            c = SEP;\n        }\n\n        appendCharSafeW(buffer, c, buffer_size);\n    }\n}\n#endif\n\n// TODO: This updates the wrong absolute path. We ought to change it to\n// the \"module_path_name\" at the time of writing it, then we save a few\n// bytes in the blob, and don't have to create that string here.\n#ifdef _NUITKA_STANDALONE\nstatic void patchCodeObjectPaths(PyCodeObject *code_object, PyObject *module_path) {\n    code_object->co_filename = module_path;\n    Py_INCREF(module_path);\n\n#ifndef PY_NOGIL\n    Py_ssize_t consts_count = PyTuple_GET_SIZE(code_object->co_consts);\n\n    for (Py_ssize_t i = 0; i < consts_count; i++) {\n        PyObject *constant = PyTuple_GET_ITEM(code_object->co_consts, i);\n#else\n    for (Py_ssize_t i = 0; i < code_object->co_nconsts; i++) {\n        PyObject *constant = code_object->co_constants[i];\n#endif\n        if (PyCode_Check(constant)) {\n            patchCodeObjectPaths((PyCodeObject *)constant, module_path);\n        }\n    }\n}\n#endif\n\nNUITKA_MAY_BE_UNUSED static PyObject *MAKE_RELATIVE_PATH_FROM_NAME(char const *name, bool is_package, bool dir_only) {\n    char buffer[MAXPATHLEN + 1] = {0};\n\n    appendModuleNameAsPath(buffer, name, sizeof(buffer));\n\n    if (dir_only == false) {\n        if (is_package) {\n            appendCharSafe(buffer, SEP, sizeof(buffer));\n            appendStringSafe(buffer, \"__init__.py\", sizeof(buffer));\n        } else {\n            appendStringSafe(buffer, \".py\", sizeof(buffer));\n        }\n    } else {\n        if (is_package == false) {\n            char *sep = strrchr(buffer, SEP);\n            if (sep) {\n                *sep = 0;\n            } else {\n                buffer[0] = '.';\n                buffer[1] = 0;\n            }\n        }\n    }\n\n    PyObject *module_path_entry_base = Nuitka_String_FromString(buffer);\n\n    PyObject *result = MAKE_RELATIVE_PATH(module_path_entry_base);\n\n    Py_DECREF(module_path_entry_base);\n\n    return result;\n}\n\nstatic PyObject *loadModuleFromCodeObject(PyObject *module, PyCodeObject *code_object, char const *name,\n                                          bool is_package) {\n    assert(code_object != NULL);\n\n    {\n        NUITKA_MAY_BE_UNUSED bool b_res = Nuitka_SetModuleString(name, module);\n        assert(b_res != false);\n    }\n\n    char buffer[MAXPATHLEN + 1] = {0};\n\n    PyObject *module_path_entry = NULL;\n\n    if (is_package) {\n        appendModuleNameAsPath(buffer, name, sizeof(buffer));\n        PyObject *module_path_entry_base = Nuitka_String_FromString(buffer);\n\n        module_path_entry = MAKE_RELATIVE_PATH(module_path_entry_base);\n        Py_DECREF(module_path_entry_base);\n\n        appendCharSafe(buffer, SEP, sizeof(buffer));\n        appendStringSafe(buffer, \"__init__.py\", sizeof(buffer));\n    } else {\n        appendModuleNameAsPath(buffer, name, sizeof(buffer));\n        appendStringSafe(buffer, \".py\", sizeof(buffer));\n    }\n\n    PyObject *module_path_name = Nuitka_String_FromString(buffer);\n\n    PyObject *module_path = MAKE_RELATIVE_PATH(module_path_name);\n    Py_DECREF(module_path_name);\n\n    if (is_package) {\n        /* Set __path__ properly, unlike frozen module importer does. */\n        PyObject *path_list = MAKE_LIST_EMPTY(1);\n        if (unlikely(path_list == NULL))\n            return NULL;\n\n        int res = PyList_SetItem(path_list, 0, module_path_entry);\n        if (unlikely(res != 0)) {\n            return NULL;\n        }\n        Py_INCREF(module_path_entry);\n\n        res = PyObject_SetAttr(module, const_str_plain___path__, path_list);\n        if (unlikely(res != 0)) {\n            return NULL;\n        }\n\n        Py_DECREF(path_list);\n\n        PyObject *module_name = PyObject_GetAttr(module, const_str_plain___name__);\n        CHECK_OBJECT(module_name);\n\n        res = PyObject_SetAttr(module, const_str_plain___package__, module_name);\n\n        if (unlikely(res != 0)) {\n            return NULL;\n        }\n    }\n\n#ifdef _NUITKA_STANDALONE\n    patchCodeObjectPaths(code_object, module_path);\n#endif\n\n    PGO_onModuleEntered(name);\n    module = PyImport_ExecCodeModuleEx((char *)name, (PyObject *)code_object, Nuitka_String_AsString(module_path));\n    PGO_onModuleExit(name, module == NULL);\n\n    Py_DECREF(module_path);\n\n    return module;\n}\n\nstatic struct Nuitka_MetaPathBasedLoaderEntry *findEntry(char const *name) {\n    struct Nuitka_MetaPathBasedLoaderEntry *current = loader_entries;\n    assert(current);\n\n    while (current->name != NULL) {\n        if ((current->flags & NUITKA_TRANSLATED_FLAG) != 0) {\n            current->name = UNTRANSLATE(current->name);\n            current->flags -= NUITKA_TRANSLATED_FLAG;\n        }\n\n        if (strcmp(name, current->name) == 0) {\n            return current;\n        }\n\n        current++;\n    }\n\n    return NULL;\n}\n\n#ifndef _NUITKA_STANDALONE\nstatic struct Nuitka_MetaPathBasedLoaderEntry *findContainingPackageEntry(char const *name) {\n    struct Nuitka_MetaPathBasedLoaderEntry *current = loader_entries;\n\n    // Consider the package name of the searched entry.\n    char const *package_name_end = strrchr(name, '.');\n    if (package_name_end == NULL) {\n        return NULL;\n    }\n\n    size_t length = package_name_end - name;\n\n    while (current->name != NULL) {\n        if ((current->flags & NUITKA_TRANSLATED_FLAG) != 0) {\n            current->name = UNTRANSLATE(current->name);\n            current->flags -= NUITKA_TRANSLATED_FLAG;\n        }\n\n        if ((current->flags & NUITKA_PACKAGE_FLAG) != 0) {\n            if (strlen(current->name) == length && strncmp(name, current->name, length) == 0) {\n                return current;\n            }\n        }\n\n        current++;\n    }\n\n    return NULL;\n}\n\nstatic PyObject *_getFileList(PyThreadState *tstate, PyObject *dirname) {\n    static PyObject *listdir_func = NULL;\n\n    // TODO: Use OS_LISTDIR instead.\n\n    if (listdir_func == NULL) {\n        listdir_func = PyObject_GetAttrString(IMPORT_HARD_OS(), \"listdir\");\n    }\n\n    if (unlikely(listdir_func == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, listdir_func, dirname);\n\n    return result;\n}\n\n#if PYTHON_VERSION < 0x300\nstatic PyObject *_getImportingSuffixesByPriority(PyThreadState *tstate, int kind) {\n    static PyObject *result = NULL;\n\n    if (result == NULL) {\n        result = MAKE_LIST_EMPTY(0);\n\n        PyObject *imp_module = PyImport_ImportModule(\"imp\");\n        PyObject *get_suffixes_func = PyObject_GetAttrString(imp_module, \"get_suffixes\");\n\n        PyObject *suffix_list = CALL_FUNCTION_NO_ARGS(tstate, get_suffixes_func);\n\n        for (int i = 0; i < PyList_GET_SIZE(suffix_list); i++) {\n            PyObject *module_kind = PyTuple_GET_ITEM(PyList_GET_ITEM(suffix_list, i), 2);\n\n            if (PyInt_AsLong(module_kind) == kind) {\n                LIST_APPEND0(result, PyTuple_GET_ITEM(PyList_GET_ITEM(suffix_list, i), 0));\n            }\n        }\n\n        Py_DECREF(suffix_list);\n    }\n\n    return result;\n}\n#endif\n\nstatic PyObject *getExtensionModuleSuffixesByPriority(PyThreadState *tstate) {\n    static PyObject *result = NULL;\n\n    if (result == NULL) {\n#if PYTHON_VERSION < 0x300\n        result = _getImportingSuffixesByPriority(tstate, 3);\n#else\n        static PyObject *machinery_module = NULL;\n\n        if (machinery_module == NULL) {\n            machinery_module = PyImport_ImportModule(\"importlib.machinery\");\n        }\n\n        result = PyObject_GetAttrString(machinery_module, \"EXTENSION_SUFFIXES\");\n#endif\n    }\n\n    CHECK_OBJECT(result);\n    return result;\n}\n\nstatic PyObject *installed_extension_modules = NULL;\n\nstatic bool scanModuleInPackagePath(PyThreadState *tstate, PyObject *module_name, char const *parent_module_name) {\n    PyObject *sys_modules = Nuitka_GetSysModules();\n\n    PyObject *parent_module = PyDict_GetItemString(sys_modules, parent_module_name);\n    CHECK_OBJECT(parent_module);\n\n    PyObject *parent_path = PyObject_GetAttr(parent_module, const_str_plain___path__);\n\n    // Accept that it might be deleted.\n    if (parent_path == NULL || !PyList_Check(parent_path)) {\n        return false;\n    }\n\n    PyObject *candidates = MAKE_LIST_EMPTY(0);\n\n    // Search only relative to the parent name of course.\n    char const *module_relative_name_str = Nuitka_String_AsString(module_name) + strlen(parent_module_name) + 1;\n\n    Py_ssize_t parent_path_size = PyList_GET_SIZE(parent_path);\n\n    for (Py_ssize_t i = 0; i < parent_path_size; i += 1) {\n        PyObject *path_element = PyList_GET_ITEM(parent_path, i);\n\n        PyObject *filenames_list = _getFileList(tstate, path_element);\n\n        if (filenames_list == NULL) {\n            CLEAR_ERROR_OCCURRED(tstate);\n            continue;\n        }\n\n        Py_ssize_t filenames_list_size = PyList_GET_SIZE(filenames_list);\n\n        for (Py_ssize_t j = 0; j < filenames_list_size; j += 1) {\n            PyObject *filename = PyList_GET_ITEM(filenames_list, j);\n\n            if (Nuitka_String_CheckExact(filename)) {\n                char const *filename_str = Nuitka_String_AsString(filename);\n\n                if (strncmp(filename_str, module_relative_name_str, strlen(module_relative_name_str)) == 0 &&\n                    filename_str[strlen(module_relative_name_str)] == '.') {\n                    LIST_APPEND1(candidates, PyTuple_Pack(2, path_element, filename));\n                }\n            }\n        }\n    }\n\n#if 0\n    PRINT_STRING(\"CANDIDATES:\");\n    PRINT_STRING(Nuitka_String_AsString(module_name));\n    PRINT_STRING(module_relative_name_str);\n    PRINT_ITEM(candidates);\n    PRINT_NEW_LINE();\n#endif\n\n    // Look up C-extension suffixes, these are used with highest priority.\n    PyObject *suffix_list = getExtensionModuleSuffixesByPriority(tstate);\n\n    bool result = false;\n\n    for (Py_ssize_t i = 0; i < PyList_GET_SIZE(suffix_list); i += 1) {\n        PyObject *suffix = PyList_GET_ITEM(suffix_list, i);\n\n        char const *suffix_str = Nuitka_String_AsString(suffix);\n\n        for (Py_ssize_t j = 0; j < PyList_GET_SIZE(candidates); j += 1) {\n            PyObject *entry = PyList_GET_ITEM(candidates, j);\n\n            PyObject *directory = PyTuple_GET_ITEM(entry, 0);\n            PyObject *candidate = PyTuple_GET_ITEM(entry, 1);\n\n            char const *candidate_str = Nuitka_String_AsString(candidate);\n\n            if (strcmp(suffix_str, candidate_str + strlen(module_relative_name_str)) == 0) {\n                PyObject *fullpath = JOIN_PATH2(directory, candidate);\n\n                if (installed_extension_modules == NULL) {\n                    installed_extension_modules = MAKE_DICT_EMPTY();\n                }\n\n// Force path to unicode, to have easier consumption, as we need a wchar_t or char *\n// from it later, and we don't want to test there.\n#if PYTHON_VERSION < 0x300 && defined(_WIN32)\n                PyObject *tmp = PyUnicode_FromObject(fullpath);\n                Py_DECREF(fullpath);\n                fullpath = tmp;\n#endif\n\n                DICT_SET_ITEM(installed_extension_modules, module_name, fullpath);\n\n                result = true;\n                break;\n            }\n        }\n    }\n\n    Py_DECREF(candidates);\n\n    return result;\n}\n\n#ifdef _WIN32\nstatic PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const wchar_t *filename);\n#else\nstatic PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const char *filename);\n#endif\n\nstatic PyObject *callIntoInstalledExtensionModule(PyThreadState *tstate, PyObject *module_name,\n                                                  PyObject *extension_module_filename) {\n#if _WIN32\n    // We can rely on unicode object to be there in case of Windows, to have an easier time to\n    // create the string needed.\n    assert(PyUnicode_CheckExact(extension_module_filename));\n\n#if PYTHON_VERSION < 0x300\n    wchar_t const *extension_module_filename_str = PyUnicode_AS_UNICODE(extension_module_filename);\n#else\n    wchar_t const *extension_module_filename_str = PyUnicode_AsWideCharString(extension_module_filename, NULL);\n#endif\n#else\n    char const *extension_module_filename_str = Nuitka_String_AsString(extension_module_filename);\n#endif\n\n    return callIntoExtensionModule(tstate, Nuitka_String_AsString(module_name), extension_module_filename_str);\n}\n\n#endif\n\nstatic char const *getEntryModeString(struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n    char const *mode = \"compiled\";\n\n    if ((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) != 0) {\n        mode = \"extension\";\n    } else if ((entry->flags & NUITKA_BYTECODE_FLAG) != 0) {\n        mode = \"bytecode\";\n    }\n\n    return mode;\n}\n\nstatic char *_kw_list_find_module[] = {(char *)\"fullname\", (char *)\"unused\", NULL};\n\nstatic PyObject *_nuitka_loader_find_module(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module_name;\n    PyObject *unused;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O|O:find_module\", (char **)_kw_list_find_module, &module_name,\n                                          &unused);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    char const *name = Nuitka_String_AsString(module_name);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # considering responsibility (find_module)\\n\", name);\n    }\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(name);\n\n    if (entry) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # claimed responsibility (%s)\\n\", name, getEntryModeString(entry));\n        }\n\n        PyObject *metapath_based_loader = (PyObject *)&Nuitka_Loader_Type;\n\n        Py_INCREF(metapath_based_loader);\n        return metapath_based_loader;\n    }\n\n    if (hasFrozenModule(name)) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # claimed responsibility (frozen)\\n\", name);\n        }\n\n        PyObject *metapath_based_loader = (PyObject *)&Nuitka_Loader_Type;\n\n        Py_INCREF(metapath_based_loader);\n        return metapath_based_loader;\n    }\n\n#ifndef _NUITKA_STANDALONE\n    entry = findContainingPackageEntry(name);\n\n    if (entry != NULL) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        bool result = scanModuleInPackagePath(tstate, module_name, entry->name);\n\n        if (result) {\n            PyObject *metapath_based_loader = (PyObject *)&Nuitka_Loader_Type;\n\n            Py_INCREF(metapath_based_loader);\n            return metapath_based_loader;\n        }\n    }\n#endif\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # denied responsibility\\n\", name);\n    }\n\n    Py_INCREF(Py_None);\n    return Py_None;\n}\n\nstatic char const *_kw_list_get_data[] = {\"filename\", NULL};\n\nstatic PyObject *_nuitka_loader_get_data(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *filename;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:get_data\", (char **)_kw_list_get_data, &filename);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    return GET_FILE_BYTES(tstate, filename);\n}\n\n#ifdef _WIN32\nstatic void setModuleFileValue(PyThreadState *tstate, PyObject *module, wchar_t const *filename) {\n#else\nstatic void setModuleFileValue(PyThreadState *tstate, PyObject *module, char const *filename) {\n#endif\n    bool needs_update = false;\n\n    PyObject *existing_file_value = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__);\n\n#if PYTHON_VERSION < 0x300\n    if (existing_file_value != NULL) {\n        if (PyCObject_Check(existing_file_value)) {\n            PyObject_DelAttr(module, const_str_plain___file__);\n            existing_file_value = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__);\n        }\n    }\n#endif\n\n    if (existing_file_value == NULL) {\n        CLEAR_ERROR_OCCURRED(tstate);\n        needs_update = true;\n    } else {\n        if (existing_file_value == Py_None) {\n            needs_update = true;\n        }\n\n        Py_DECREF(existing_file_value);\n    }\n\n    if (needs_update) {\n#ifdef _WIN32\n        int res = SET_ATTRIBUTE(tstate, module, const_str_plain___file__, NuitkaUnicode_FromWideChar(filename, -1));\n#else\n        int res = SET_ATTRIBUTE(tstate, module, const_str_plain___file__, PyUnicode_FromString(filename));\n#endif\n        if (unlikely(res < 0)) {\n            // Might be refuted, which wouldn't be harmful.\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n    }\n}\n\n#if PYTHON_VERSION < 0x300\ntypedef void (*entrypoint_t)(void);\n#else\ntypedef PyObject *(*entrypoint_t)(void);\n#endif\n\n#ifndef _WIN32\n// Shared libraries loading.\n#include <dlfcn.h>\n#endif\n\n#if PYTHON_VERSION >= 0x350\nstatic PyObject *createModuleSpec(PyThreadState *tstate, PyObject *module_name, PyObject *origin, bool is_package);\n#endif\n\n#ifdef _WIN32\nstatic PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const wchar_t *filename) {\n#else\nstatic PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const char *filename) {\n#endif\n    // Determine the package name and basename of the module to load.\n    char const *dot = strrchr(full_name, '.');\n    char const *name;\n    char const *package;\n\n    if (dot == NULL) {\n        package = NULL;\n        name = full_name;\n    } else {\n        // The extension modules do expect it to be full name in context.\n        package = (char *)full_name;\n        name = dot + 1;\n    }\n\n    char entry_function_name[1024];\n    snprintf(entry_function_name, sizeof(entry_function_name),\n#if PYTHON_VERSION < 0x300\n             \"init%s\",\n#else\n             \"PyInit_%s\",\n#endif\n             name);\n\n#ifdef _WIN32\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # LoadLibraryExW(\\\"%S\\\");\\n\", full_name, filename);\n    }\n\n#ifndef _NUITKA_EXPERIMENTAL_DEBUG_STANDALONE\n    unsigned int old_mode = SetErrorMode(SEM_FAILCRITICALERRORS);\n#endif\n\n    HINSTANCE hDLL;\n#if PYTHON_VERSION >= 0x380\n    Py_BEGIN_ALLOW_THREADS;\n    hDLL = LoadLibraryExW(filename, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);\n    Py_END_ALLOW_THREADS;\n#else\n    hDLL = LoadLibraryExW(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);\n#endif\n\n#ifndef _NUITKA_EXPERIMENTAL_DEBUG_STANDALONE\n    SetErrorMode(old_mode);\n#endif\n\n    if (unlikely(hDLL == NULL)) {\n        char buffer[1024];\n\n        char error_message[1024];\n        int size;\n\n        unsigned int error_code = GetLastError();\n\n        size = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error_code, 0,\n                             (LPTSTR)error_message, sizeof(error_message), NULL);\n\n        // Report either way even if failed to get error message.\n        if (size == 0) {\n            PyOS_snprintf(buffer, sizeof(buffer), \"LoadLibraryExW '%S' failed with error code %d\", filename,\n                          error_code);\n        } else {\n            // Strip trailing newline.\n            if (size >= 2 && error_message[size - 2] == '\\r' && error_message[size - 1] == '\\n') {\n                size -= 2;\n                error_message[size] = '\\0';\n            }\n            PyOS_snprintf(buffer, sizeof(buffer), \"LoadLibraryExW '%S' failed: %s\", filename, error_message);\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ImportError, buffer);\n        return NULL;\n    }\n\n    entrypoint_t entrypoint = (entrypoint_t)GetProcAddress(hDLL, entry_function_name);\n#else\n    // This code would work for all versions, we are avoiding access to interpreter\n    // structure internals of 3.8 or higher.\n    // spell-checker: ignore getdlopenflags,dlopenflags\n\n    static PyObject *dlopenflags_object = NULL;\n    if (dlopenflags_object == NULL) {\n        dlopenflags_object = CALL_FUNCTION_NO_ARGS(tstate, Nuitka_SysGetObject(\"getdlopenflags\"));\n    }\n    int dlopenflags = PyInt_AsLong(dlopenflags_object);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # dlopen(\\\"%s\\\", %x);\\n\", full_name, filename, dlopenflags);\n    }\n\n    void *handle = dlopen(filename, dlopenflags);\n\n    if (unlikely(handle == NULL)) {\n        const char *error = dlerror();\n\n        if (unlikely(error == NULL)) {\n            error = \"unknown dlopen() error\";\n        }\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ImportError, error);\n        return NULL;\n    }\n\n    entrypoint_t entrypoint = (entrypoint_t)dlsym(handle, entry_function_name);\n#endif\n    assert(entrypoint);\n\n#if PYTHON_VERSION < 0x370\n    char *old_context = _Py_PackageContext;\n#else\n    char const *old_context = _Py_PackageContext;\n#endif\n\n    _Py_PackageContext = (char *)package;\n\n    // Finally call into the DLL.\n    PGO_onModuleEntered(full_name);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # calling entrypoint\\n\", full_name);\n    }\n\n    Nuitka_DelModuleString(tstate, full_name);\n\n#if PYTHON_VERSION < 0x300\n    (*entrypoint)();\n#else\n    PyObject *module = (*entrypoint)();\n#endif\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # return from entrypoint\\n\", full_name);\n    }\n\n    _Py_PackageContext = old_context;\n\n#if PYTHON_VERSION < 0x300\n    PyObject *module = Nuitka_GetModuleString(tstate, full_name);\n#endif\n\n    PGO_onModuleExit(name, module == NULL);\n\n    if (unlikely(module == NULL)) {\n        if (unlikely(!HAS_ERROR_OCCURRED(tstate))) {\n            PyErr_Format(PyExc_SystemError, \"dynamic module '%s' not initialized properly\", full_name);\n        }\n\n        return NULL;\n    }\n\n#if PYTHON_VERSION >= 0x300\n#if PYTHON_VERSION >= 0x350\n    PyModuleDef *def;\n\n    if (Py_TYPE(module) == &PyModuleDef_Type) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # entrypoint returned module def\\n\", full_name);\n        }\n\n        def = (PyModuleDef *)module;\n\n        PyObject *full_name_obj = Nuitka_String_FromString(full_name);\n\n        PyObject *spec_value = createModuleSpec(tstate, full_name_obj, NULL, false);\n\n        module = PyModule_FromDefAndSpec(def, spec_value);\n\n        if (unlikely(module == NULL)) {\n            Py_DECREF(spec_value);\n\n            PyErr_Format(PyExc_SystemError, \"dynamic module '%s' not initialized properly from def\", full_name);\n\n            return NULL;\n        }\n\n        setModuleFileValue(tstate, module, filename);\n        PyObject_SetAttrString((PyObject *)spec_value, \"origin\",\n                               LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__));\n        SET_ATTRIBUTE(tstate, module, const_str_plain___spec__, spec_value);\n\n        Nuitka_SetModule(full_name_obj, module);\n        Py_DECREF(full_name_obj);\n\n        SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_True);\n        int res = PyModule_ExecDef(module, def);\n        SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_False);\n\n        Py_DECREF(spec_value);\n        CHECK_OBJECT(spec_value);\n\n        if (unlikely(res == -1)) {\n            return NULL;\n        }\n\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # executed module def\\n\", full_name);\n        }\n\n        CHECK_OBJECT(module);\n\n        return module;\n    } else {\n        def = PyModule_GetDef(module);\n\n        // Set \"__spec__\" and \"__file__\" after load.\n        setModuleFileValue(tstate, module, filename);\n        PyObject *full_name_obj = Nuitka_String_FromString(full_name);\n        PyObject *spec_value =\n            createModuleSpec(tstate, full_name_obj, LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__), false);\n\n        SET_ATTRIBUTE(tstate, module, const_str_plain___spec__, spec_value);\n\n        // Fixup __package__ after load. It seems some modules ignore _Py_PackageContext value.\n        // so we patch it up here if it's None, but a package was specified.\n        if (package != NULL) {\n            PyObject *package_name = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___package__);\n\n            if (package_name == Py_None) {\n                char package2[1024];\n                copyStringSafeN(package2, full_name, dot - full_name, sizeof(package2));\n\n                PyObject *package_name_obj = Nuitka_String_FromString(package2);\n                SET_ATTRIBUTE(tstate, module, const_str_plain___package__, package_name_obj);\n                Py_DECREF(package_name_obj);\n            }\n\n            Py_DECREF(package_name);\n        }\n    }\n\n    if (likely(def != NULL)) {\n        def->m_base.m_init = entrypoint;\n    }\n#else\n    PyModuleDef *def = PyModule_GetDef(module);\n\n    if (unlikely(def == NULL)) {\n        PyErr_Format(PyExc_SystemError, \"initialization of %s did not return an extension module\", filename);\n\n        return NULL;\n    }\n\n    def->m_base.m_init = entrypoint;\n#endif\n\n#endif\n\n    // Set filename attribute if not already set, in some branches we don't\n    // do it, esp. not for older Python.\n    setModuleFileValue(tstate, module, filename);\n\n    // Call the standard import fix-ups for extension modules. Their interface\n    // changed over releases.\n#if PYTHON_VERSION < 0x300\n    PyObject *res2 = _PyImport_FixupExtension((char *)full_name, (char *)filename);\n\n    if (unlikely(res2 == NULL)) {\n        return NULL;\n    }\n#else\n    PyObject *full_name_obj = PyUnicode_FromString(full_name);\n    CHECK_OBJECT(full_name_obj);\n#ifdef _WIN32\n    PyObject *filename_obj = NuitkaUnicode_FromWideChar(filename, -1);\n#else\n    PyObject *filename_obj = PyUnicode_FromString(filename);\n#endif\n    CHECK_OBJECT(filename_obj);\n\n    int res = _PyImport_FixupExtensionObject(module, full_name_obj, filename_obj\n#if PYTHON_VERSION >= 0x370\n                                             ,\n                                             Nuitka_GetSysModules()\n#endif\n\n    );\n\n    Py_DECREF(full_name_obj);\n    Py_DECREF(filename_obj);\n\n    if (unlikely(res == -1)) {\n        return NULL;\n    }\n#endif\n\n    return module;\n}\n\nstatic void loadTriggeredModule(PyThreadState *tstate, char const *name, char const *trigger_name) {\n    char trigger_module_name[2048];\n\n    copyStringSafe(trigger_module_name, name, sizeof(trigger_module_name));\n    appendStringSafe(trigger_module_name, trigger_name, sizeof(trigger_module_name));\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(trigger_module_name);\n\n    if (entry != NULL) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"Loading %s\\n\", trigger_module_name);\n        }\n\n        IMPORT_EMBEDDED_MODULE(tstate, trigger_module_name);\n\n        if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n            if ((entry->flags & NUITKA_ABORT_MODULE_FLAG) != 0) {\n                printf(\"Critical error loading %s.\\n\", trigger_module_name);\n                abort();\n            } else {\n                PyObject *trigger_module_name_str = Nuitka_String_FromString(trigger_module_name);\n                PyErr_WriteUnraisable(trigger_module_name_str);\n                Py_DECREF(trigger_module_name_str);\n            }\n        }\n    }\n}\n\n#if PYTHON_VERSION >= 0x340\nstatic void _fixupSpecAttribute(PyThreadState *tstate, PyObject *module) {\n    PyObject *spec_value = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___spec__);\n\n    if (spec_value && spec_value != Py_None) {\n        if (HAS_ATTR_BOOL(tstate, spec_value, const_str_plain__initializing)) {\n            SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_False);\n        }\n    }\n}\n#endif\n\n// Pointers to bytecode data.\nstatic char **_bytecode_data = NULL;\n\nstatic PyObject *loadModule(PyThreadState *tstate, PyObject *module, PyObject *module_name,\n                            struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n#ifdef _NUITKA_STANDALONE\n    if ((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) != 0) {\n        // Append the the entry name from full path module name with dots,\n        // and translate these into directory separators.\n#ifdef _WIN32\n        wchar_t filename[MAXPATHLEN + 1] = {0};\n\n        appendWStringSafeW(filename, getBinaryDirectoryWideChars(true), sizeof(filename) / sizeof(wchar_t));\n        appendCharSafeW(filename, SEP, sizeof(filename) / sizeof(wchar_t));\n        appendModuleNameAsPathW(filename, entry->name, sizeof(filename) / sizeof(wchar_t));\n        appendStringSafeW(filename, \".pyd\", sizeof(filename) / sizeof(wchar_t));\n#else\n        char filename[MAXPATHLEN + 1] = {0};\n\n        appendStringSafe(filename, getBinaryDirectoryHostEncoded(true), sizeof(filename));\n        appendCharSafe(filename, SEP, sizeof(filename));\n        appendModuleNameAsPath(filename, entry->name, sizeof(filename));\n        appendStringSafe(filename, \".so\", sizeof(filename));\n\n#endif\n\n        // Set \"__spec__\" and \"__file__\", some modules expect it early.\n        setModuleFileValue(tstate, module, filename);\n#if PYTHON_VERSION >= 0x350\n        PyObject *spec_value =\n            createModuleSpec(tstate, module_name, LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__), false);\n\n        SET_ATTRIBUTE(tstate, module, const_str_plain___spec__, spec_value);\n#endif\n\n        callIntoExtensionModule(tstate, entry->name, filename);\n    } else\n#endif\n        if ((entry->flags & NUITKA_BYTECODE_FLAG) != 0) {\n        // TODO: Do node use marshal, but our own stuff, once we\n        // can do code objects too.\n\n        PyCodeObject *code_object =\n            (PyCodeObject *)PyMarshal_ReadObjectFromString(_bytecode_data[entry->bytecode_index], entry->bytecode_size);\n\n        // TODO: Probably a bit harsh reaction.\n        if (unlikely(code_object == NULL)) {\n            PyErr_Print();\n            abort();\n        }\n\n        return loadModuleFromCodeObject(module, code_object, entry->name, (entry->flags & NUITKA_PACKAGE_FLAG) != 0);\n    } else {\n        assert((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) == 0);\n        assert(entry->python_initfunc);\n\n        {\n            NUITKA_MAY_BE_UNUSED bool res = Nuitka_SetModule(module_name, module);\n            assert(res != false);\n        }\n\n        // Run the compiled module code, we get the module returned.\n#if PYTHON_VERSION < 0x300\n        NUITKA_MAY_BE_UNUSED\n#endif\n        PyObject *result = entry->python_initfunc(tstate, module, entry);\n        CHECK_OBJECT_X(result);\n\n#if PYTHON_VERSION >= 0x300\n        if (likely(result != NULL)) {\n            _fixupSpecAttribute(tstate, result);\n        }\n#endif\n    }\n\n    if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n        return NULL;\n    }\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"Loaded %s\\n\", entry->name);\n    }\n\n    return Nuitka_GetModule(tstate, module_name);\n}\n\nstatic PyObject *_EXECUTE_EMBEDDED_MODULE(PyThreadState *tstate, PyObject *module, PyObject *module_name,\n                                          char const *name) {\n    CHECK_OBJECT(module);\n    CHECK_OBJECT(module_name);\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(name);\n    bool frozen_import = entry == NULL && hasFrozenModule(name);\n\n    if (entry != NULL || frozen_import) {\n        // Execute the \"preLoad\" code produced for the module potentially. This\n        // is from plugins typically, that want to modify things for the the\n        // module before loading, to e.g. set a plug-in path, or do some monkey\n        // patching in order to make things compatible.\n        loadTriggeredModule(tstate, name, \"-preLoad\");\n    }\n\n    PyObject *result = NULL;\n\n    if (entry != NULL) {\n#ifdef _NUITKA_EXPERIMENTAL_FORCE_GC_COLLECT_ON_IMPORT\n        PyGC_Collect();\n#endif\n\n        result = loadModule(tstate, module, module_name, entry);\n\n#ifdef _NUITKA_EXPERIMENTAL_FORCE_GC_COLLECT_ON_IMPORT\n        PyGC_Collect();\n#endif\n\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n    }\n\n    if (frozen_import) {\n        PGO_onModuleEntered(name);\n        int res = PyImport_ImportFrozenModule((char *)name);\n        PGO_onModuleExit(name, res == -1);\n\n        if (unlikely(res == -1)) {\n            return NULL;\n        }\n\n        if (res == 1) {\n            result = Nuitka_GetModule(tstate, module_name);\n        }\n    }\n\n    if (result != NULL) {\n        // Execute the \"postLoad\" code produced for the module potentially. This\n        // is from plugins typically, that want to modify the module immediately\n        // after loading, to e.g. set a plug-in path, or do some monkey patching\n        // in order to make things compatible.\n        loadTriggeredModule(tstate, name, \"-postLoad\");\n\n        return result;\n    }\n\n    Py_INCREF(Py_None);\n    return Py_None;\n}\n\n// Note: This may become an entry point for hard coded imports of compiled\n// stuff.\nPyObject *IMPORT_EMBEDDED_MODULE(PyThreadState *tstate, char const *name) {\n    PyObject *module_name = Nuitka_String_FromString(name);\n\n    // Check if it's already loaded, and don't do it again otherwise.\n    PyObject *module = Nuitka_GetModule(tstate, module_name);\n\n    if (module != NULL) {\n        Py_DECREF(module_name);\n        return module;\n    }\n\n#if PYTHON_VERSION < 0x300\n    module = PyModule_New(name);\n#else\n    module = PyModule_NewObject(module_name);\n#endif\n\n    PyObject *result = _EXECUTE_EMBEDDED_MODULE(tstate, module, module_name, name);\n\n#if PYTHON_VERSION < 0x350\n    if (unlikely(result == NULL)) {\n        Nuitka_DelModule(tstate, module_name);\n    }\n#endif\n\n    Py_DECREF(module_name);\n\n    return result;\n}\n\nPyObject *EXECUTE_EMBEDDED_MODULE(PyThreadState *tstate, PyObject *module) {\n    PyObject *module_name = LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___name__);\n    assert(module_name);\n\n    char const *name = Nuitka_String_AsString(module_name);\n\n    return _EXECUTE_EMBEDDED_MODULE(tstate, module, module_name, name);\n}\n\nstatic PyObject *_nuitka_loader_load_module(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module_name;\n    PyObject *unused;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O|O:load_module\", (char **)_kw_list_find_module, &module_name,\n                                          &unused);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    assert(module_name);\n    assert(Nuitka_String_Check(module_name));\n\n    char const *name = Nuitka_String_AsString(module_name);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"Loading %s\\n\", name);\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#ifndef _NUITKA_STANDALONE\n    if (installed_extension_modules != NULL) {\n        PyObject *extension_module_filename = DICT_GET_ITEM0(tstate, installed_extension_modules, module_name);\n\n        if (extension_module_filename != NULL) {\n            // TODO: Should we not set __file__ for the module here, but there is no object.\n            return callIntoInstalledExtensionModule(tstate, module_name, extension_module_filename);\n        }\n    }\n#endif\n\n    return IMPORT_EMBEDDED_MODULE(tstate, name);\n}\n\nstatic char const *_kw_list_is_package[] = {\"fullname\", NULL};\n\nstatic PyObject *_nuitka_loader_is_package(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module_name;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:is_package\", (char **)_kw_list_is_package, &module_name);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    assert(module_name);\n    assert(Nuitka_String_Check(module_name));\n\n    char const *name = Nuitka_String_AsString(module_name);\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(name);\n\n    PyObject *result;\n\n    if (entry) {\n        result = BOOL_FROM((entry->flags & NUITKA_PACKAGE_FLAG) != 0);\n    } else {\n        // TODO: Maybe needs to be an exception.\n        result = Py_None;\n    }\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic char const *_kw_list_iter_modules[] = {\"package\", NULL};\n\nstatic PyObject *_nuitka_loader_iter_modules(struct Nuitka_LoaderObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *prefix;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:iter_modules\", (char **)_kw_list_iter_modules, &prefix);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyObject *result = MAKE_LIST_EMPTY(0);\n\n    struct Nuitka_MetaPathBasedLoaderEntry *current = loader_entries;\n    assert(current);\n\n    char const *s;\n\n    if (self->m_loader_entry) {\n        s = self->m_loader_entry->name;\n    } else {\n        s = \"\";\n    }\n\n    while (current->name != NULL) {\n        if ((current->flags & NUITKA_TRANSLATED_FLAG) != 0) {\n            current->name = UNTRANSLATE(current->name);\n            current->flags -= NUITKA_TRANSLATED_FLAG;\n        }\n\n        int c = strncmp(s, current->name, strlen(s));\n\n        if (c != 0) {\n            current++;\n            continue;\n        }\n\n        if (strcmp(current->name, \"__main__\") == 0) {\n            current++;\n            continue;\n        }\n\n        if (current->name[strlen(s)] == 0) {\n            current++;\n            continue;\n        }\n\n        char const *sub = strchr(current->name + strlen(s) + 1, '.');\n\n        if (sub != NULL) {\n            current++;\n            continue;\n        }\n\n        PyObject *name;\n        if (self->m_loader_entry) {\n            name = Nuitka_String_FromString(current->name + strlen(s) + 1);\n        } else {\n            name = Nuitka_String_FromString(current->name);\n        }\n\n        if (CHECK_IF_TRUE(prefix)) {\n            PyObject *old = name;\n            name = PyUnicode_Concat(prefix, name);\n            Py_DECREF(old);\n        }\n\n        PyObject *r = MAKE_TUPLE_EMPTY(2);\n        PyTuple_SET_ITEM(r, 0, name);\n        PyTuple_SET_ITEM0(r, 1, BOOL_FROM((current->flags & NUITKA_PACKAGE_FLAG) != 0));\n\n        LIST_APPEND1(result, r);\n\n        current++;\n    }\n\n    return result;\n}\n\nstatic PyObject *getModuleDirectory(PyThreadState *tstate, struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n#if defined(_NUITKA_FREEZER_HAS_FILE_PATH)\n#if defined(_WIN32)\n    wchar_t buffer[1024];\n    buffer[0] = 0;\n\n    appendWStringSafeW(buffer, entry->file_path, sizeof(buffer));\n    stripFilenameW(buffer);\n    PyObject *dir_name = NuitkaUnicode_FromWideChar(buffer, -1);\n#else\n    char buffer[1024];\n    copyStringSafe(buffer, entry->file_path, sizeof(buffer));\n\n    PyObject *dir_name = Nuitka_String_FromString(dirname(buffer));\n#endif\n#else\n    PyObject *module_name;\n    if ((entry->flags & NUITKA_PACKAGE_FLAG) != 0) {\n        module_name = Nuitka_String_FromString(entry->name);\n    } else {\n        char buffer[1024];\n        copyStringSafe(buffer, entry->name, sizeof(buffer));\n\n        char *dot = strrchr(buffer, '.');\n        if (dot != NULL) {\n            *dot = 0;\n        }\n\n        module_name = Nuitka_String_FromString(buffer);\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyObject *module_path = STR_REPLACE3(tstate, module_name, const_str_dot, getPathSeparatorStringObject());\n#else\n    PyObject *module_path = UNICODE_REPLACE3(tstate, module_name, const_str_dot, getPathSeparatorStringObject());\n#endif\n    Py_DECREF(module_name);\n\n    if (unlikely(module_path == NULL)) {\n        return NULL;\n    }\n\n    PyObject *dir_name = MAKE_RELATIVE_PATH(module_path);\n    Py_DECREF(module_path);\n#endif\n\n    return dir_name;\n}\n\n#if PYTHON_VERSION >= 0x300\n// Used in module template too, therefore exported.\nPyObject *getImportLibBootstrapModule(void) {\n    static PyObject *importlib = NULL;\n    if (importlib == NULL) {\n        importlib = PyImport_ImportModule(\"importlib._bootstrap\");\n    }\n\n    return importlib;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x340\n\nstatic PyObject *_nuitka_loader_repr_module(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module;\n    PyObject *unused;\n\n    int res =\n        PyArg_ParseTupleAndKeywords(args, kwds, \"O|O:module_repr\", (char **)_kw_list_find_module, &module, &unused);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    return PyUnicode_FromFormat(\"<module '%s' from %R>\", PyModule_GetName(module),\n                                Nuitka_GetFilenameObject(tstate, module));\n}\n\nstatic PyObject *getModuleSpecClass(PyObject *importlib_module) {\n    static PyObject *module_spec_class = NULL;\n\n    if (module_spec_class == NULL) {\n        module_spec_class = PyObject_GetAttrString(importlib_module, \"ModuleSpec\");\n    }\n\n    return module_spec_class;\n}\n\nstatic PyObject *getModuleFileValue(PyThreadState *tstate, struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n    PyObject *dir_name = getModuleDirectory(tstate, entry);\n\n    char filename_buffer[1024];\n\n    char const *basename = strrchr(entry->name, '.');\n    if (basename == NULL) {\n        basename = entry->name;\n    } else {\n        basename += 1;\n    }\n\n    copyStringSafe(filename_buffer, basename, sizeof(filename_buffer));\n\n    if ((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) != 0) {\n#if defined(_WIN32)\n        appendStringSafe(filename_buffer, \".pyd\", sizeof(filename_buffer));\n#else\n        appendStringSafe(filename_buffer, \".so\", sizeof(filename_buffer));\n#endif\n    } else if ((entry->flags & NUITKA_PACKAGE_FLAG) != 0) {\n        appendCharSafe(filename_buffer, SEP, sizeof(filename_buffer));\n        appendStringSafe(filename_buffer, \"__init__.py\", sizeof(filename_buffer));\n    } else {\n        appendStringSafe(filename_buffer, \".py\", sizeof(filename_buffer));\n    }\n\n    PyObject *module_filename = Nuitka_String_FromString(filename_buffer);\n\n    PyObject *result = JOIN_PATH2(dir_name, module_filename);\n\n    Py_DECREF(module_filename);\n\n    return result;\n}\n\nstatic PyObject *createModuleSpec(PyThreadState *tstate, PyObject *module_name, PyObject *origin, bool is_package) {\n    CHECK_OBJECT(module_name);\n    assert(Nuitka_String_Check(module_name));\n    CHECK_OBJECT_X(origin);\n\n    PyObject *importlib_module = getImportLibBootstrapModule();\n\n    if (unlikely(importlib_module == NULL)) {\n        return NULL;\n    }\n\n    PyObject *module_spec_class = getModuleSpecClass(importlib_module);\n\n    if (unlikely(module_spec_class == NULL)) {\n        return NULL;\n    }\n\n    PyObject *args = MAKE_TUPLE2(module_name, (PyObject *)&Nuitka_Loader_Type);\n\n    PyObject *kw_values[] = {is_package ? Py_True : Py_False, origin};\n\n    char const *kw_keys[] = {\"is_package\", \"origin\"};\n\n    PyObject *kw_args = MAKE_DICT_X_CSTR(kw_keys, kw_values, sizeof(kw_values) / sizeof(PyObject *));\n\n    PyObject *result = CALL_FUNCTION(tstate, module_spec_class, args, kw_args);\n\n    Py_DECREF(args);\n    Py_DECREF(kw_args);\n\n    return result;\n}\n\n#ifndef _NUITKA_STANDALONE\n// We might have to load stuff from installed modules in our package namespaces.\nstatic PyObject *createModuleSpecViaPathFinder(PyThreadState *tstate, PyObject *module_name,\n                                               char const *parent_module_name) {\n    if (scanModuleInPackagePath(tstate, module_name, parent_module_name)) {\n        return createModuleSpec(tstate, module_name, NULL, false);\n    } else {\n        // Without error this means we didn't make it.\n        return NULL;\n    }\n}\n#endif\n\nstatic char const *_kw_list_find_spec[] = {\"fullname\", \"is_package\", \"path\", NULL};\n\nstatic PyObject *_nuitka_loader_find_spec(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module_name;\n    PyObject *unused1; // We ignore \"is_package\"\n    PyObject *unused2; // We ignore \"path\"\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O|OO:find_spec\", (char **)_kw_list_find_spec, &module_name,\n                                          &unused1, &unused2);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    char const *full_name = Nuitka_String_AsString(module_name);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # considering responsibility (find_spec)\\n\", full_name);\n    }\n\n    struct Nuitka_MetaPathBasedLoaderEntry const *entry = findEntry(full_name);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#ifndef _NUITKA_STANDALONE\n    // We need to deal with things located in compiled packages, that were not included,\n    // e.g. extension modules, but also other files, that were asked to not be included\n    // or added later.\n    if (entry == NULL) {\n        entry = findContainingPackageEntry(full_name);\n\n        if (entry != NULL) {\n            PyObject *result = createModuleSpecViaPathFinder(tstate, module_name, entry->name);\n\n            if (result != NULL) {\n                if (isVerbose()) {\n                    PySys_WriteStderr(\"import %s # claimed responsibility (%s, contained in compiled package %s)\\n\",\n                                      full_name, getEntryModeString(entry), entry->name);\n                }\n\n                return result;\n            }\n\n            if (HAS_ERROR_OCCURRED(tstate)) {\n                return NULL;\n            }\n\n            entry = NULL;\n        }\n    }\n#endif\n\n    if (entry == NULL) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # denied responsibility\\n\", full_name);\n        }\n\n        Py_INCREF(Py_None);\n        return Py_None;\n    }\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # claimed responsibility (%s)\\n\", Nuitka_String_AsString(module_name),\n                          getEntryModeString(entry));\n    }\n\n    return createModuleSpec(tstate, module_name, getModuleFileValue(tstate, entry),\n                            (entry->flags & NUITKA_PACKAGE_FLAG) != 0);\n}\n\n#if PYTHON_VERSION >= 0x350\nstatic char const *_kw_list_create_module[] = {\"spec\", NULL};\n\nstatic PyObject *_nuitka_loader_create_module(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *spec;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:create_module\", (char **)_kw_list_create_module, &spec);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyObject *module_name = PyObject_GetAttr(spec, const_str_plain_name);\n\n    if (unlikely(module_name == NULL)) {\n        return NULL;\n    }\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # created module\\n\", Nuitka_String_AsString(module_name));\n    }\n\n    PyObject *result = PyModule_NewObject(module_name);\n\n    Py_DECREF(module_name);\n\n    return result;\n}\n\nstatic char const *_kw_list_exec_module[] = {\"module\", NULL};\n\nstatic PyObject *_nuitka_loader_exec_module(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:exec_module\", (char **)_kw_list_exec_module, &module);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyObject *module_name = PyObject_GetAttr(module, const_str_plain___name__);\n    CHECK_OBJECT(module_name);\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"import %s # execute module\\n\", Nuitka_String_AsString(module_name));\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    // During spec creation, we have populated the dictionary with a filename to load from\n    // for extension modules that were found installed in the system and below our package.\n#ifndef _NUITKA_STANDALONE\n    if (installed_extension_modules != NULL) {\n        PyObject *extension_module_filename = DICT_GET_ITEM0(tstate, installed_extension_modules, module_name);\n\n        if (extension_module_filename != NULL) {\n            // Set filename attribute\n            res = SET_ATTRIBUTE(tstate, module, const_str_plain___file__, extension_module_filename);\n\n            if (unlikely(res < 0)) {\n                // Might be refuted, which wouldn't be harmful.\n                CLEAR_ERROR_OCCURRED(tstate);\n            }\n\n            return callIntoInstalledExtensionModule(tstate, module_name, extension_module_filename);\n        }\n    }\n#endif\n\n    return EXECUTE_EMBEDDED_MODULE(tstate, module);\n}\n\n#if PYTHON_VERSION >= 0x370\n\n// The resource reader class is implemented in a separate file.\n#include \"MetaPathBasedLoaderResourceReader.c\"\n\nstatic PyObject *_nuitka_loader_get_resource_reader(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *module_name;\n\n    int res =\n        PyArg_ParseTupleAndKeywords(args, kwds, \"O:get_resource_reader\", (char **)_kw_list_exec_module, &module_name);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    char const *name = Nuitka_String_AsString(module_name);\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(name);\n\n    if (entry) {\n        if (isVerbose()) {\n            PySys_WriteStderr(\"import %s # get_resource_reader (%s)\\n\", name, getEntryModeString(entry));\n        }\n\n        return Nuitka_ResourceReader_New(entry);\n    }\n\n    PyErr_Format(PyExc_RuntimeError, \"Requested resource reader for unhandled module %s\", module_name);\n    return NULL;\n}\n\n#endif\n\n#endif\n\n#endif\n\nstatic char const *_kw_list_find_distributions[] = {\"context\", NULL};\n\nstatic PyObject *_nuitka_loader_find_distributions(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *context;\n\n    int res =\n        PyArg_ParseTupleAndKeywords(args, kwds, \"O:find_distributions\", (char **)_kw_list_find_distributions, &context);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyObject *name = PyObject_GetAttr(context, const_str_plain_name);\n\n    if (unlikely(name == NULL)) {\n        return NULL;\n    }\n\n    PyObject *temp = MAKE_LIST_EMPTY(0);\n\n    Py_ssize_t pos = 0;\n    PyObject *distribution_name;\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    while (Nuitka_DistributionNext(&pos, &distribution_name)) {\n        bool include = false;\n        if (name == Py_None) {\n            include = true;\n        } else {\n            nuitka_bool cmp_res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(name, distribution_name);\n\n            if (unlikely(cmp_res == NUITKA_BOOL_EXCEPTION)) {\n                Py_DECREF(name);\n                return NULL;\n            }\n\n            include = cmp_res == NUITKA_BOOL_TRUE;\n        }\n\n        if (include) {\n            // Create a distribution object from our data.\n            PyObject *distribution = Nuitka_Distribution_New(tstate, distribution_name);\n\n            if (distribution == NULL) {\n                Py_DECREF(temp);\n                return NULL;\n            }\n\n            LIST_APPEND1(temp, distribution);\n        }\n    }\n\n    // We are expected to return an iterator.\n    PyObject *result = MAKE_ITERATOR_INFALLIBLE(temp);\n\n    Py_DECREF(temp);\n    return result;\n}\n\nstatic char const *_kw_list_sys_path_hook[] = {\"path\", NULL};\n\nstatic PyObject *_nuitka_loader_sys_path_hook(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *path;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:sys_path_hook\", (char **)_kw_list_sys_path_hook, &path);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n#if 0\n    PRINT_STRING(\"CONSIDER PATH:\");\n    PRINT_ITEM(path);\n    PRINT_NEW_LINE();\n#endif\n\n    struct Nuitka_MetaPathBasedLoaderEntry *entry = loader_entries;\n    assert(entry);\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    while (entry->name != NULL) {\n        if ((entry->flags & NUITKA_TRANSLATED_FLAG) != 0) {\n            entry->name = UNTRANSLATE(entry->name);\n            entry->flags -= NUITKA_TRANSLATED_FLAG;\n        }\n\n        if ((entry->flags & NUITKA_PACKAGE_FLAG) != 0) {\n            PyObject *module_directory = getModuleDirectory(tstate, entry);\n\n#if 0\n            PRINT_STRING(entry->name);\n            PRINT_STRING(\" \");\n            PRINT_ITEM(module_directory);\n            PRINT_NEW_LINE();\n#endif\n\n            nuitka_bool cmp_res = compareFilePaths(tstate, module_directory, path);\n\n            if (unlikely(cmp_res == NUITKA_BOOL_EXCEPTION)) {\n                return NULL;\n            }\n\n            // Create the loader for the module.\n            if (cmp_res == NUITKA_BOOL_TRUE) {\n                return Nuitka_Loader_New(entry);\n            }\n        }\n\n        entry++;\n    }\n\n    SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_ImportError);\n    return NULL;\n}\n\nstatic PyMethodDef Nuitka_Loader_methods[] = {\n    {\"iter_modules\", (PyCFunction)_nuitka_loader_iter_modules, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"get_data\", (PyCFunction)_nuitka_loader_get_data, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"find_module\", (PyCFunction)_nuitka_loader_find_module, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"load_module\", (PyCFunction)_nuitka_loader_load_module, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"is_package\", (PyCFunction)_nuitka_loader_is_package, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n#if PYTHON_VERSION >= 0x340\n    {\"module_repr\", (PyCFunction)_nuitka_loader_repr_module, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"find_spec\", (PyCFunction)_nuitka_loader_find_spec, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n#endif\n#if PYTHON_VERSION >= 0x350\n    {\"create_module\", (PyCFunction)_nuitka_loader_create_module, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"exec_module\", (PyCFunction)_nuitka_loader_exec_module, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n#endif\n#if PYTHON_VERSION >= 0x370\n    {\"get_resource_reader\", (PyCFunction)_nuitka_loader_get_resource_reader, METH_STATIC | METH_VARARGS | METH_KEYWORDS,\n     NULL},\n#endif\n\n    {\"find_distributions\", (PyCFunction)_nuitka_loader_find_distributions, METH_STATIC | METH_VARARGS | METH_KEYWORDS,\n     NULL},\n\n    {\"sys_path_hook\", (PyCFunction)_nuitka_loader_sys_path_hook, METH_STATIC | METH_VARARGS | METH_KEYWORDS, NULL},\n\n    {NULL, NULL} // terminator\n};\n\nstatic PyObject *Nuitka_Loader_tp_repr(struct Nuitka_LoaderObject *loader) {\n    if (loader->m_loader_entry == NULL) {\n        // TODO: Indicate in module mode, which one it is for.\n        return Nuitka_String_FromString(\"<nuitka_module_loader>\");\n    } else {\n        return Nuitka_String_FromFormat(\"<nuitka_module_loader for '%s'>\", loader->m_loader_entry->name);\n    }\n}\n\n#include \"nuitka/freelists.h\"\n\n// TODO: A free list is not the right thing for those, they are probably living forever, but it's\n// no big harm too, but make it small, maybe be allowing a toggle that makes a specific macro not\n// use the free list mechanism at all.\n\n#define MAX_LOADER_FREE_LIST_COUNT 10\nstatic struct Nuitka_LoaderObject *free_list_loaders = NULL;\nstatic int free_list_loaders_count = 0;\n\nstatic void Nuitka_Loader_tp_dealloc(struct Nuitka_LoaderObject *loader) {\n    Nuitka_GC_UnTrack(loader);\n\n    releaseToFreeList(free_list_loaders, loader, MAX_LOADER_FREE_LIST_COUNT);\n}\n\nstatic int Nuitka_Loader_tp_traverse(struct Nuitka_LoaderObject *loader, visitproc visit, void *arg) { return 0; }\n\nstatic PyObject *Nuitka_Loader_get__module__(struct Nuitka_LoaderObject *loader, void *closure) {\n    PyObject *result = const_str_plain___nuitka__;\n\n    Py_INCREF(result);\n    return result;\n}\n\nstatic PyGetSetDef Nuitka_Loader_tp_getset[] = {{(char *)\"__module__\", (getter)Nuitka_Loader_get__module__, NULL, NULL},\n                                                {NULL}};\n\nPyTypeObject Nuitka_Loader_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"nuitka_module_loader\",\n    sizeof(struct Nuitka_LoaderObject),      // tp_basicsize\n    0,                                       // tp_itemsize\n    (destructor)Nuitka_Loader_tp_dealloc,    // tp_dealloc\n    0,                                       // tp_print\n    0,                                       // tp_getattr\n    0,                                       // tp_setattr\n    0,                                       // tp_reserved\n    (reprfunc)Nuitka_Loader_tp_repr,         // tp_repr\n    0,                                       // tp_as_number\n    0,                                       // tp_as_sequence\n    0,                                       // tp_as_mapping\n    0,                                       // tp_hash\n    0,                                       // tp_call\n    0,                                       // tp_str\n    0,                                       // tp_getattro (PyObject_GenericGetAttr)\n    0,                                       // tp_setattro\n    0,                                       // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags\n    0,                                       // tp_doc\n    (traverseproc)Nuitka_Loader_tp_traverse, // tp_traverse\n    0,                                       // tp_clear\n    0,                                       // tp_richcompare\n    0,                                       // tp_weaklistoffset\n    0,                                       // tp_iter\n    0,                                       // tp_iternext\n    Nuitka_Loader_methods,                   // tp_methods\n    0,                                       // tp_members\n    Nuitka_Loader_tp_getset,                 // tp_getset\n};\n\n/* Used by modules to register child loaders for packages. */\nPyObject *Nuitka_Loader_New(struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n    struct Nuitka_LoaderObject *result;\n\n    allocateFromFreeListFixed(free_list_loaders, struct Nuitka_LoaderObject, Nuitka_Loader_Type);\n    Nuitka_GC_Track(result);\n\n    result->m_loader_entry = entry;\n\n    return (PyObject *)result;\n}\n\nvoid registerMetaPathBasedUnfreezer(struct Nuitka_MetaPathBasedLoaderEntry *_loader_entries,\n                                    unsigned char **bytecode_data) {\n    // Do it only once.\n    if (loader_entries) {\n        assert(_loader_entries == loader_entries);\n\n        return;\n    }\n\n    _bytecode_data = (char **)bytecode_data;\n\n    if (isVerbose()) {\n        PySys_WriteStderr(\"Setup nuitka compiled module/bytecode/extension importer.\\n\");\n    }\n\n#ifdef _NUITKA_MODULE\n    if (_Py_PackageContext != NULL) {\n        char const *last_dot = strrchr(_Py_PackageContext, '.');\n\n        if (last_dot != NULL) {\n            struct Nuitka_MetaPathBasedLoaderEntry *current = _loader_entries;\n            assert(current);\n\n            while (current->name != NULL) {\n                if ((current->flags & NUITKA_TRANSLATED_FLAG) != 0) {\n                    current->name = UNTRANSLATE(current->name);\n                    current->flags -= NUITKA_TRANSLATED_FLAG;\n                }\n\n                char name[2048];\n\n                if (strcmp(last_dot + 1, current->name) == 0) {\n                    copyStringSafeN(name, _Py_PackageContext, last_dot - _Py_PackageContext + 1, sizeof(name));\n                    appendStringSafe(name, current->name, sizeof(name));\n\n                    current->name = strdup(name);\n                } else if (strncmp(last_dot + 1, current->name, strlen(last_dot + 1)) == 0 &&\n                           current->name[strlen(last_dot + 1)] == '.') {\n                    copyStringSafeN(name, _Py_PackageContext, last_dot - _Py_PackageContext + 1, sizeof(name));\n                    appendStringSafe(name, current->name, sizeof(name));\n\n                    current->name = strdup(name);\n                }\n\n                current++;\n            }\n        }\n    }\n#endif\n\n    loader_entries = _loader_entries;\n\n    Nuitka_PyType_Ready(&Nuitka_Loader_Type, NULL, true, false, false, false, false);\n\n#ifdef _NUITKA_EXE\n    {\n        NUITKA_MAY_BE_UNUSED int res =\n            PyDict_SetItemString((PyObject *)dict_builtin, \"__nuitka_loader_type\", (PyObject *)&Nuitka_Loader_Type);\n        assert(res == 0);\n    }\n#endif\n\n#if PYTHON_VERSION >= 0x370\n    Nuitka_PyType_Ready(&Nuitka_ResourceReader_Type, NULL, true, false, false, false, false);\n#endif\n\n    // Register it as a meta path loader.\n    PyObject *global_loader = Nuitka_Loader_New(NULL);\n\n    LIST_INSERT_CONST(Nuitka_SysGetObject(\"meta_path\"),\n#if PYTHON_VERSION < 0x300\n                      0,\n#else\n                      2,\n#endif\n\n                      global_loader);\n\n    // Register it as a sys.path_hook\n    LIST_APPEND1(Nuitka_SysGetObject(\"path_hooks\"), PyObject_GetAttrString(global_loader, \"sys_path_hook\"));\n}\n\n#if defined(_NUITKA_STANDALONE)\n// This is called for the technical module imported early on during interpreter\n// into, to still get compatible \"__file__\" attributes.\nvoid setEarlyFrozenModulesFileAttribute(PyThreadState *tstate) {\n    PyObject *sys_modules = Nuitka_GetSysModules();\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    PyObject *builtin_module_names = Nuitka_SysGetObject(\"builtin_module_names\");\n\n    while (Nuitka_DictNext(sys_modules, &pos, &key, &value)) {\n        if (key != NULL && value != NULL && PyModule_Check(value)) {\n            bool is_package = HAS_ATTR_BOOL(tstate, value, const_str_plain___path__);\n\n            if (is_package || HAS_ATTR_BOOL(tstate, value, const_str_plain___file__) ||\n                PySequence_Contains(builtin_module_names, key) == 0) {\n                PyObject *file_value = MAKE_RELATIVE_PATH_FROM_NAME(Nuitka_String_AsString(key), is_package, false);\n                PyObject_SetAttr(value, const_str_plain___file__, file_value);\n                Py_DECREF(file_value);\n                CHECK_OBJECT(file_value);\n            }\n        }\n    }\n\n    assert(!HAS_ERROR_OCCURRED(tstate));\n}\n\n#endif\n\n// The importlib distribution class is implemented in a separate file.\n#include \"MetaPathBasedLoaderImportlibMetadataDistribution.c\"\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This implements the \"importlib.metadata.distribution\" values, also for\n// the backport \"importlib_metadata.distribution\"\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#include \"nuitka/unfreezing.h\"\n#endif\n\nstatic PyObject *metadata_values_dict = NULL;\n\n// For initialization of the metadata dictionary during startup.\nvoid setDistributionsMetadata(PyObject *metadata_values) { metadata_values_dict = metadata_values; }\n\nbool Nuitka_DistributionNext(Py_ssize_t *pos, PyObject **distribution_name_ptr) {\n    PyObject *value;\n    return Nuitka_DictNext(metadata_values_dict, pos, distribution_name_ptr, &value);\n}\n\nPyObject *Nuitka_Distribution_New(PyThreadState *tstate, PyObject *name) {\n    // TODO: Have our own Python code to be included in compiled form,\n    // this duplicates with inspec patcher code.\n    static PyObject *nuitka_distribution_type = NULL;\n    static PyObject *importlib_metadata_distribution = NULL;\n    // TODO: Use pathlib.Path for \"locate_file\" result should be more compatible.\n\n    if (nuitka_distribution_type == NULL) {\n        static char const *nuitka_distribution_code = \"\\n\\\nimport os,sys\\n\\\nif sys.version_info >= (3, 8):\\n\\\n    from importlib.metadata import Distribution,distribution\\n\\\nelse:\\n\\\n    from importlib_metadata import Distribution,distribution\\n\\\nclass nuitka_distribution(Distribution):\\n\\\n    def __init__(self, base_path, metadata, entry_points):\\n\\\n        self.base_path = base_path; self.metadata_data = metadata\\n\\\n        self.entry_points_data = entry_points\\n\\\n    def read_text(self, filename):\\n\\\n        if filename == 'METADATA':\\n\\\n            return self.metadata_data\\n\\\n        elif filename == 'entry_points.txt':\\n\\\n            return self.entry_points_data\\n\\\n    def locate_file(self, path):\\n\\\n        return os.path.join(self.base_path, path)\\n\\\n\";\n\n        PyObject *nuitka_distribution_code_object = Py_CompileString(nuitka_distribution_code, \"<exec>\", Py_file_input);\n        CHECK_OBJECT(nuitka_distribution_code_object);\n\n        {\n            PyObject *module =\n                PyImport_ExecCodeModule((char *)\"nuitka_distribution_patch\", nuitka_distribution_code_object);\n            CHECK_OBJECT(module);\n\n            nuitka_distribution_type = PyObject_GetAttrString(module, \"nuitka_distribution\");\n            CHECK_OBJECT(nuitka_distribution_type);\n\n            importlib_metadata_distribution = PyObject_GetAttrString(module, \"distribution\");\n            CHECK_OBJECT(importlib_metadata_distribution);\n\n            {\n                NUITKA_MAY_BE_UNUSED bool bool_res = Nuitka_DelModuleString(tstate, \"nuitka_distribution_patch\");\n                assert(bool_res != false);\n            }\n\n            Py_DECREF(module);\n        }\n    }\n\n    PyObject *metadata_value_item = DICT_GET_ITEM0(tstate, metadata_values_dict, name);\n    if (metadata_value_item == NULL) {\n        PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, importlib_metadata_distribution, name);\n\n        return result;\n    } else {\n        PyObject *package_name = PyTuple_GET_ITEM(metadata_value_item, 0);\n        PyObject *metadata = PyTuple_GET_ITEM(metadata_value_item, 1);\n        PyObject *entry_points = PyTuple_GET_ITEM(metadata_value_item, 2);\n\n        struct Nuitka_MetaPathBasedLoaderEntry *entry = findEntry(Nuitka_String_AsString_Unchecked(package_name));\n\n        if (unlikely(entry == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_RuntimeError,\n                                                \"cannot locate package '%s' associated with metadata\",\n                                                Nuitka_String_AsString(package_name));\n\n            return NULL;\n        }\n\n        PyObject *args[3] = {getModuleDirectory(tstate, entry), metadata, entry_points};\n        PyObject *result = CALL_FUNCTION_WITH_ARGS3(tstate, nuitka_distribution_type, args);\n        CHECK_OBJECT(result);\n        return result;\n    }\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This implements the resource reader for of C compiled modules and\n// shared library extension modules bundled for standalone mode with\n// newer Python.\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#include \"nuitka/unfreezing.h\"\n#endif\n\n// Just for the IDE to know, this file is not included otherwise.\n#if PYTHON_VERSION >= 0x370\n\nstruct Nuitka_ResourceReaderObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        /* The loader entry, to know this is about exactly. */\n        struct Nuitka_MetaPathBasedLoaderEntry const *m_loader_entry;\n};\n\nstatic void Nuitka_ResourceReader_tp_dealloc(struct Nuitka_ResourceReaderObject *reader) {\n    Nuitka_GC_UnTrack(reader);\n\n    PyObject_GC_Del(reader);\n}\n\nstatic PyObject *Nuitka_ResourceReader_tp_repr(struct Nuitka_ResourceReaderObject *reader) {\n    return PyUnicode_FromFormat(\"<nuitka_resource_reader for '%s'>\", reader->m_loader_entry->name);\n}\n\n// Obligatory, even if we have nothing to own\nstatic int Nuitka_ResourceReader_tp_traverse(struct Nuitka_ResourceReaderObject *reader, visitproc visit, void *arg) {\n    return 0;\n}\n\nstatic PyObject *_Nuitka_ResourceReader_resource_path(PyThreadState *tstate, struct Nuitka_ResourceReaderObject *reader,\n                                                      PyObject *resource) {\n    PyObject *dir_name = getModuleDirectory(tstate, reader->m_loader_entry);\n\n    if (unlikely(dir_name == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = JOIN_PATH2(dir_name, resource);\n    Py_DECREF(dir_name);\n\n    return result;\n}\n\nstatic PyObject *Nuitka_ResourceReader_resource_path(struct Nuitka_ResourceReaderObject *reader, PyObject *args,\n                                                     PyObject *kwds) {\n    PyObject *resource;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:resource_path\", (char **)_kw_list_get_data, &resource);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    return _Nuitka_ResourceReader_resource_path(tstate, reader, resource);\n}\n\nstatic PyObject *Nuitka_ResourceReader_open_resource(struct Nuitka_ResourceReaderObject *reader, PyObject *args,\n                                                     PyObject *kwds) {\n    PyObject *resource;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:open_resource\", (char **)_kw_list_get_data, &resource);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *filename = _Nuitka_ResourceReader_resource_path(tstate, reader, resource);\n\n    return BUILTIN_OPEN_BINARY_READ_SIMPLE(tstate, filename);\n}\n\n#include \"MetaPathBasedLoaderResourceReaderFiles.c\"\n\nstatic PyObject *Nuitka_ResourceReader_files(struct Nuitka_ResourceReaderObject *reader, PyObject *args,\n                                             PyObject *kwds) {\n\n    PyThreadState *tstate = PyThreadState_GET();\n    return Nuitka_ResourceReaderFiles_New(tstate, reader->m_loader_entry, const_str_empty);\n}\n\nstatic PyMethodDef Nuitka_ResourceReader_methods[] = {\n    {\"resource_path\", (PyCFunction)Nuitka_ResourceReader_resource_path, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"open_resource\", (PyCFunction)Nuitka_ResourceReader_open_resource, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"files\", (PyCFunction)Nuitka_ResourceReader_files, METH_NOARGS, NULL},\n    {NULL}};\n\nstatic PyTypeObject Nuitka_ResourceReader_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"nuitka_resource_reader\",\n    sizeof(struct Nuitka_ResourceReaderObject),      // tp_basicsize\n    0,                                               // tp_itemsize\n    (destructor)Nuitka_ResourceReader_tp_dealloc,    // tp_dealloc\n    0,                                               // tp_print\n    0,                                               // tp_getattr\n    0,                                               // tp_setattr\n    0,                                               // tp_reserved\n    (reprfunc)Nuitka_ResourceReader_tp_repr,         // tp_repr\n    0,                                               // tp_as_number\n    0,                                               // tp_as_sequence\n    0,                                               // tp_as_mapping\n    0,                                               // tp_hash\n    0,                                               // tp_call\n    0,                                               // tp_str\n    0,                                               // tp_getattro (PyObject_GenericGetAttr)\n    0,                                               // tp_setattro\n    0,                                               // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,         // tp_flags\n    0,                                               // tp_doc\n    (traverseproc)Nuitka_ResourceReader_tp_traverse, // tp_traverse\n    0,                                               // tp_clear\n    0,                                               // tp_richcompare\n    0,                                               // tp_weaklistoffset\n    0,                                               // tp_iter\n    0,                                               // tp_iternext\n    Nuitka_ResourceReader_methods,                   // tp_methods\n    0,                                               // tp_members\n    0,                                               // tp_getset\n};\n\nstatic PyObject *Nuitka_ResourceReader_New(struct Nuitka_MetaPathBasedLoaderEntry const *entry) {\n    struct Nuitka_ResourceReaderObject *result;\n\n    result = (struct Nuitka_ResourceReaderObject *)Nuitka_GC_New(&Nuitka_ResourceReader_Type);\n    Nuitka_GC_Track(result);\n\n    result->m_loader_entry = entry;\n\n    return (PyObject *)result;\n}\n\n#endif\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// This implements the resource reader for of C compiled modules and\n// shared library extension modules bundled for standalone mode with\n// newer Python.\n\n// This file is included from another C file, help IDEs to still parse it on\n// its own.\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#include \"nuitka/unfreezing.h\"\n#endif\n\nstruct Nuitka_ResourceReaderFilesObject {\n    /* Python object folklore: */\n    PyObject_HEAD\n\n        // The loader entry, to know this is for one package exactly.\n        struct Nuitka_MetaPathBasedLoaderEntry const *m_loader_entry;\n\n    // The path relative to the entry, if e.g. joinpath is used\n    PyObject *m_path;\n};\n\nstatic PyObject *Nuitka_ResourceReaderFiles_New(PyThreadState *tstate,\n                                                struct Nuitka_MetaPathBasedLoaderEntry const *entry, PyObject *path);\n\nstatic PyObject *_Nuitka_ResourceReaderFiles_GetPath(PyThreadState *tstate,\n                                                     struct Nuitka_ResourceReaderFilesObject const *files) {\n    // Allow for absolute paths, TODO: Too lazy to have OS_PATH_JOIN at this\n    // time also not clearly how early JOIN2 is used, i.e. do we have importing\n    // available for it.\n\n    PyObject *is_abs = OS_PATH_ISABS(tstate, files->m_path);\n    PyObject *result;\n    if (is_abs == Py_True) {\n#if 0\n        PRINT_STRING(\"Getting path from absolute: \");\n        PRINT_ITEM(files->m_path);\n        PRINT_NEW_LINE();\n#endif\n\n        result = files->m_path;\n        Py_INCREF(result);\n    } else {\n        result = getModuleDirectory(tstate, files->m_loader_entry);\n\n#if 0\n        PRINT_STRING(\"Getting path from relative: \");\n        PRINT_ITEM(result);\n        PRINT_STRING(\" \");\n        PRINT_ITEM(files->m_path);\n        PRINT_NEW_LINE();\n#endif\n\n        if (files->m_path != const_str_empty) {\n            PyObject *old = result;\n            result = JOIN_PATH2(result, files->m_path);\n            Py_DECREF(old);\n        }\n    }\n\n    Py_DECREF(is_abs);\n\n    return result;\n}\n\nstatic void Nuitka_ResourceReaderFiles_tp_dealloc(struct Nuitka_ResourceReaderFilesObject *files) {\n    Nuitka_GC_UnTrack(files);\n\n    Py_DECREF(files->m_path);\n\n    PyObject_GC_Del(files);\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_tp_repr(struct Nuitka_ResourceReaderFilesObject *files) {\n    return PyUnicode_FromFormat(\"<nuitka_resource_reader_files for package '%s' file %R>\", files->m_loader_entry->name,\n                                files->m_path);\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_tp_str(struct Nuitka_ResourceReaderFilesObject *files) {\n    PyThreadState *tstate = PyThreadState_GET();\n    return _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n}\n\n// Obligatory, even if we have nothing to own\nstatic int Nuitka_ResourceReaderFiles_tp_traverse(struct Nuitka_ResourceReaderFilesObject *files, visitproc visit,\n                                                  void *arg) {\n    return 0;\n}\n\n// Methods that need to be implemented.\n//\n//\n//    def iterdir(self):\n//        \"\"\"\n//        Yield Traversable objects from self\n//        \"\"\"\n//\nstatic PyObject *Nuitka_ResourceReaderFiles_iterdir(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                    PyObject *kwds) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_path = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n    PyObject *file_names = OS_LISTDIR(tstate, file_path);\n    Py_DECREF(file_path);\n\n    // TODO: Actually we ought to behave like a generator and delay this error,\n    // but we currently spare us the effort and raise this immediately.\n    if (unlikely(file_names == NULL)) {\n        return NULL;\n    }\n\n    PyObject *files_objects = MAKE_LIST_EMPTY(0);\n\n    Py_ssize_t n = PyList_GET_SIZE(file_names);\n    for (Py_ssize_t i = 0; i < n; i++) {\n        PyObject *file_name = PyList_GET_ITEM(file_names, i);\n        CHECK_OBJECT(file_name);\n\n        PyObject *joined = JOIN_PATH2(files->m_path, file_name);\n        CHECK_OBJECT(joined);\n\n        PyObject *files_object = Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, joined);\n        {\n            NUITKA_MAY_BE_UNUSED bool res = LIST_APPEND1(files_objects, files_object);\n            assert(res);\n        }\n\n        CHECK_OBJECT(files_object);\n        Py_DECREF(joined);\n    }\n\n    PyObject *result = MAKE_ITERATOR_INFALLIBLE(files_objects);\n    Py_DECREF(files_objects);\n\n    return result;\n}\n\n//    def read_bytes(self):\n//        \"\"\"\n//        Read contents of self as bytes\n//        \"\"\"\n//        with self.open('rb') as strm:\n//            return strm.read()\n//\n\nstatic PyObject *Nuitka_ResourceReaderFiles_read_bytes(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                       PyObject *kwds) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n\n    if (unlikely(file_name == NULL)) {\n        return NULL;\n    }\n\n    return GET_FILE_BYTES(tstate, file_name);\n}\n\n//    def read_text(self, encoding=None):\n//        \"\"\"\n//        Read contents of self as text\n//        \"\"\"\n//        with self.open(encoding=encoding) as strm:\n//            return strm.read()\n\nstatic char const *_kw_list_encoding[] = {\"encoding\", NULL};\n\nstatic PyObject *Nuitka_ResourceReaderFiles_read_text(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                      PyObject *kwds) {\n\n    PyObject *encoding = NULL;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"|O:read_text\", (char **)_kw_list_encoding, &encoding);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n\n    if (unlikely(file_name == NULL)) {\n        return NULL;\n    }\n\n    PyObject *file_object = BUILTIN_OPEN_SIMPLE(tstate, file_name, \"r\", true, encoding);\n\n    Py_DECREF(file_name);\n\n    if (unlikely(file_object == NULL)) {\n        return NULL;\n    }\n\n    PyObject *read_method = LOOKUP_ATTRIBUTE(tstate, file_object, const_str_plain_read);\n    Py_DECREF(file_object);\n\n    if (unlikely(read_method == NULL)) {\n        return NULL;\n    }\n\n    PyObject *result = CALL_FUNCTION_NO_ARGS(PyThreadState_GET(), read_method);\n    Py_DECREF(read_method);\n    return result;\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_exists(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                   PyObject *kwds) {\n\n    PyThreadState *tstate = PyThreadState_GET();\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n    PyObject *result = OS_PATH_FILE_EXISTS(tstate, file_name);\n    Py_DECREF(file_name);\n    return result;\n}\n\n//    @abc.abstractmethod\n//    def is_dir(self) -> bool:\n//        \"\"\"\n//        Return True if self is a dir\n//        \"\"\"\n//\n\nstatic PyObject *Nuitka_ResourceReaderFiles_is_dir(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                   PyObject *kwds) {\n\n    PyThreadState *tstate = PyThreadState_GET();\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n    PyObject *result = OS_PATH_FILE_ISDIR(tstate, file_name);\n    Py_DECREF(file_name);\n    return result;\n}\n\n//    @abc.abstractmethod\n//    def is_file(self) -> bool:\n//        \"\"\"\n//        Return True if self is a file\n//        \"\"\"\nstatic PyObject *Nuitka_ResourceReaderFiles_is_file(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                    PyObject *kwds) {\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n    PyObject *result = OS_PATH_FILE_ISFILE(tstate, file_name);\n    Py_DECREF(file_name);\n    return result;\n}\n\nstatic char const *_kw_list_joinpath[] = {\"child\", NULL};\n\n//    @abc.abstractmethod\n//    def joinpath(self, child):\n//        \"\"\"\n//        Return Traversable child in self\n//        \"\"\"\n//\n\n// Functions out there, some accept \"child\", and accept varargs, lets be compatible with both.\n\nstatic PyObject *Nuitka_ResourceReaderFiles_joinpath(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                     PyObject *kwds) {\n\n    PyObject *joined = files->m_path;\n\n    if (kwds != NULL) {\n        PyObject *child;\n\n        int res = PyArg_ParseTupleAndKeywords(args, kwds, \"O:joinpath\", (char **)_kw_list_joinpath, &child);\n\n        if (unlikely(res == 0)) {\n            return NULL;\n        }\n\n        joined = JOIN_PATH2(joined, child);\n\n        if (unlikely(joined == NULL)) {\n            return NULL;\n        }\n    } else {\n        Py_INCREF(joined);\n\n        Py_ssize_t n = PyTuple_GET_SIZE(args);\n        for (Py_ssize_t i = 0; i < n; ++i) {\n            PyObject *child = PyTuple_GET_ITEM(args, i);\n\n            PyObject *old = joined;\n            if (old == const_str_empty) {\n                joined = child;\n                Py_INCREF(child);\n            } else {\n                joined = JOIN_PATH2(joined, child);\n            }\n\n            Py_DECREF(old);\n\n            if (unlikely(joined == NULL)) {\n                return NULL;\n            }\n        }\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *result = Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, joined);\n\n    Py_DECREF(joined);\n\n    return result;\n}\n\n//    def def as_posix(self):\n//        \"\"\"\n//        Return Traversable child in self\n//        \"\"\"\n//\n\nstatic PyObject *Nuitka_ResourceReaderFiles_as_posix(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                     PyObject *kwds) {\n    PyThreadState *tstate = PyThreadState_GET();\n    PyObject *path = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n\n#ifdef _WIN32\n\n#if PYTHON_VERSION < 0x300\n    PyObject *result;\n\n    if (PyString_Check(path)) {\n        result = STR_REPLACE3(tstate, path, const_str_backslash, const_str_slash);\n    } else {\n        result = UNICODE_REPLACE3(tstate, path, const_str_backslash, const_str_slash);\n    }\n#else\n    PyObject *result = UNICODE_REPLACE3(tstate, path, const_str_backslash, const_str_slash);\n#endif\n\n    Py_DECREF(path);\n\n    return result;\n#else\n    return path;\n#endif\n}\n\nPyObject *Nuitka_ResourceReaderFiles_nb_truediv(struct Nuitka_ResourceReaderFilesObject *files, PyObject *arg) {\n    PyObject *joined;\n\n    if (files->m_path == const_str_empty) {\n        joined = arg;\n        Py_INCREF(arg);\n    } else {\n        joined = JOIN_PATH2(files->m_path, arg);\n    }\n\n    if (unlikely(joined == NULL)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *result = Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, joined);\n\n    return result;\n}\n\n//    @abc.abstractmethod\n//    def open(self, mode='r', *args, **kwargs):\n//        \"\"\"\n//        mode may be 'r' or 'rb' to open as text or binary. Return a handle\n//        suitable for reading (same as pathlib.Path.open).\n//\n//        When opening as text, accepts encoding parameters such as those\n//        accepted by io.TextIOWrapper.\n//        \"\"\"\n//\n\nstatic char const *_kw_list_open[] = {\"mode\", \"buffering\", \"encoding\", \"errors\", \"newline\", NULL};\n\nstatic PyObject *Nuitka_ResourceReaderFiles_open(struct Nuitka_ResourceReaderFilesObject *files, PyObject *args,\n                                                 PyObject *kwds) {\n\n    PyObject *mode = NULL;\n    PyObject *buffering = NULL;\n    PyObject *encoding = NULL;\n    PyObject *errors = NULL;\n    PyObject *newline = NULL;\n\n    int res = PyArg_ParseTupleAndKeywords(args, kwds, \"|OOOOO:open\", (char **)_kw_list_open, &mode, &buffering,\n                                          &encoding, &errors, &newline);\n\n    if (unlikely(res == 0)) {\n        return NULL;\n    }\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n\n    return BUILTIN_OPEN(tstate, file_name, mode, buffering, encoding, errors, newline, NULL, NULL);\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_as_file(struct Nuitka_ResourceReaderFilesObject *files) {\n    CHECK_OBJECT(files);\n\n    Py_INCREF(files);\n    return (PyObject *)files;\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_enter(struct Nuitka_ResourceReaderFilesObject *files) {\n    CHECK_OBJECT(files);\n\n    Py_INCREF(files);\n    return (PyObject *)files;\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_exit(struct Nuitka_ResourceReaderFilesObject *files) {\n    CHECK_OBJECT(files);\n\n    Py_INCREF(Py_None);\n    return Py_None;\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_fspath(struct Nuitka_ResourceReaderFilesObject *files) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    return _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_absolute(struct Nuitka_ResourceReaderFilesObject *files) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *path = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n\n    PyObject *abspath = OS_PATH_ABSPATH(tstate, path);\n\n    if (unlikely(abspath == NULL)) {\n        return NULL;\n    }\n\n    return Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, abspath);\n}\n\nstatic PyMethodDef Nuitka_ResourceReaderFiles_methods[] = {\n    {\"iterdir\", (PyCFunction)Nuitka_ResourceReaderFiles_iterdir, METH_NOARGS, NULL},\n    {\"read_bytes\", (PyCFunction)Nuitka_ResourceReaderFiles_read_bytes, METH_NOARGS, NULL},\n    {\"read_text\", (PyCFunction)Nuitka_ResourceReaderFiles_read_text, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"exists\", (PyCFunction)Nuitka_ResourceReaderFiles_exists, METH_NOARGS, NULL},\n    {\"is_dir\", (PyCFunction)Nuitka_ResourceReaderFiles_is_dir, METH_NOARGS, NULL},\n    {\"is_file\", (PyCFunction)Nuitka_ResourceReaderFiles_is_file, METH_NOARGS, NULL},\n    {\"joinpath\", (PyCFunction)Nuitka_ResourceReaderFiles_joinpath, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"open\", (PyCFunction)Nuitka_ResourceReaderFiles_open, METH_VARARGS | METH_KEYWORDS, NULL},\n    {\"__enter__\", (PyCFunction)Nuitka_ResourceReaderFiles_enter, METH_NOARGS, NULL},\n    {\"__exit__\", (PyCFunction)Nuitka_ResourceReaderFiles_exit, METH_VARARGS, NULL},\n    {\"__fspath__\", (PyCFunction)Nuitka_ResourceReaderFiles_fspath, METH_NOARGS, NULL},\n    {\"absolute\", (PyCFunction)Nuitka_ResourceReaderFiles_absolute, METH_NOARGS, NULL},\n    {\"as_posix\", (PyCFunction)Nuitka_ResourceReaderFiles_as_posix, METH_NOARGS, NULL},\n\n    // Nuitka specific, for \"importlib.resource.as_file\" overload.\n    {\"as_file\", (PyCFunction)Nuitka_ResourceReaderFiles_as_file, METH_NOARGS, NULL},\n\n    {NULL}};\n\n//    @abc.abstractproperty\n//    def name(self) -> str:\n//        \"\"\"\n//        The base name of this object without any parent references.\n//        \"\"\"\n\nstatic PyObject *Nuitka_ResourceReaderFiles_get_name(struct Nuitka_ResourceReaderFilesObject *files) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *file_name = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);\n    PyObject *result = OS_PATH_BASENAME(tstate, file_name);\n    Py_DECREF(file_name);\n\n    return result;\n}\n\nstatic int Nuitka_ResourceReaderFiles_set_name(struct Nuitka_ResourceReaderFilesObject *files, PyObject *value) {\n    PyThreadState *tstate = PyThreadState_GET();\n\n    SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_AttributeError, \"readonly attribute\");\n    return -1;\n}\n\nstatic PyObject *Nuitka_ResourceReaderFiles_tp_richcompare(struct Nuitka_ResourceReaderFilesObject *files_a,\n                                                           PyObject *other, int op) {\n    PyObject *a = PyObject_Str((PyObject *)files_a);\n    CHECK_OBJECT(a);\n\n    PyObject *b = PyObject_Str(other);\n    if (unlikely(b == NULL)) {\n        Py_DECREF(a);\n        return NULL;\n    }\n\n    PyObject *result = PyObject_RichCompare(a, b, op);\n\n    Py_DECREF(b);\n\n    return result;\n}\n\nstatic PyGetSetDef Nuitka_ResourceReaderFiles_getset[] = {\n    {(char *)\"name\", (getter)Nuitka_ResourceReaderFiles_get_name, (setter)Nuitka_ResourceReaderFiles_set_name, NULL},\n    {NULL}};\n\n// Initialized during readying the type for nb_truediv\nstatic PyNumberMethods Nuitka_resource_reader_as_number = {0};\n\nstatic PyTypeObject Nuitka_ResourceReaderFiles_Type = {\n    PyVarObject_HEAD_INIT(NULL, 0) \"nuitka_resource_reader_files\",\n    sizeof(struct Nuitka_ResourceReaderFilesObject),        // tp_basicsize\n    0,                                                      // tp_itemsize\n    (destructor)Nuitka_ResourceReaderFiles_tp_dealloc,      // tp_dealloc\n    0,                                                      // tp_print\n    0,                                                      // tp_getattr\n    0,                                                      // tp_setattr\n    0,                                                      // tp_reserved\n    (reprfunc)Nuitka_ResourceReaderFiles_tp_repr,           // tp_repr\n    &Nuitka_resource_reader_as_number,                      // tp_as_number\n    0,                                                      // tp_as_sequence\n    0,                                                      // tp_as_mapping\n    0,                                                      // tp_hash\n    0,                                                      // tp_call\n    (reprfunc)Nuitka_ResourceReaderFiles_tp_str,            // tp_str\n    0,                                                      // tp_getattro (PyObject_GenericGetAttr)\n    0,                                                      // tp_setattro\n    0,                                                      // tp_as_buffer\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,                // tp_flags\n    0,                                                      // tp_doc\n    (traverseproc)Nuitka_ResourceReaderFiles_tp_traverse,   // tp_traverse\n    0,                                                      // tp_clear\n    (richcmpfunc)Nuitka_ResourceReaderFiles_tp_richcompare, // tp_richcompare\n    0,                                                      // tp_weaklistoffset\n    0,                                                      // tp_iter (PyObject_SelfIter)\n    0,                                                      // tp_iternext\n    Nuitka_ResourceReaderFiles_methods,                     // tp_methods\n    0,                                                      // tp_members\n    Nuitka_ResourceReaderFiles_getset,                      // tp_getset\n};\n\n#if PYTHON_VERSION >= 0x390\nstatic void registerResourceReaderFiles(PyThreadState *tstate, PyObject *resources_module) {\n    PyObject *as_file = LOOKUP_ATTRIBUTE(tstate, resources_module, const_str_plain_as_file);\n    if (likely(as_file != NULL)) {\n        PyObject *our_as_file =\n            LOOKUP_ATTRIBUTE(tstate, (PyObject *)&Nuitka_ResourceReaderFiles_Type, const_str_plain_as_file);\n        CHECK_OBJECT(our_as_file);\n\n        PyObject *args[2] = {(PyObject *)&Nuitka_ResourceReaderFiles_Type, our_as_file};\n\n        PyObject *register_result = CALL_METHOD_WITH_ARGS2(tstate, as_file, const_str_plain_register, args);\n        if (unlikely(register_result == NULL)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n        }\n\n        Py_DECREF(as_file);\n        Py_DECREF(our_as_file);\n    } else {\n        CLEAR_ERROR_OCCURRED(tstate);\n    }\n}\n#endif\n\nstatic PyObject *Nuitka_ResourceReaderFiles_New(PyThreadState *tstate,\n                                                struct Nuitka_MetaPathBasedLoaderEntry const *entry, PyObject *path) {\n    struct Nuitka_ResourceReaderFilesObject *result;\n\n    static bool init_done = false;\n    if (init_done == false) {\n        // We do not really want to write a lot of NULLs just to do this, and\n        // for as long as we do not have C11 everywhere, that is how we have\n        // to do it.\n        Nuitka_ResourceReaderFiles_Type.tp_as_number->nb_true_divide =\n            (binaryfunc)Nuitka_ResourceReaderFiles_nb_truediv;\n\n        Nuitka_PyType_Ready(&Nuitka_ResourceReaderFiles_Type, NULL, true, false, true, false, false);\n\n#if PYTHON_VERSION >= 0x390\n        // Also register our open, which can avoid a temporary file being created.\n        PyObject *importlib_resources_module = IMPORT_HARD_IMPORTLIB__RESOURCES();\n        registerResourceReaderFiles(tstate, importlib_resources_module);\n\n        PyObject *importlib_resources_backport_module = IMPORT_HARD_IMPORTLIB_RESOURCES();\n        if (importlib_resources_backport_module != NULL) {\n            registerResourceReaderFiles(tstate, importlib_resources_backport_module);\n        } else {\n            DROP_ERROR_OCCURRED(tstate);\n        }\n#endif\n\n        init_done = true;\n    }\n\n    result = (struct Nuitka_ResourceReaderFilesObject *)Nuitka_GC_New(&Nuitka_ResourceReaderFiles_Type);\n    Nuitka_GC_Track(result);\n\n    result->m_loader_entry = entry;\n    result->m_path = path;\n    Py_INCREF(path);\n\n    return (PyObject *)result;\n}\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/OnefileBootstrap.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n/* The main program for onefile bootstrap.\n *\n * It needs to unpack the attached files and and then loads and executes\n * the compiled program as a separate process.\n *\n * spell-checker: ignore _wrename,SHFILEOPSTRUCTW,FOF_NOCONFIRMATION,FOF_NOERRORUI\n * spell-checker: ignore HRESULT,HINSTANCE,lpUnkcaller,MAKELANGID,SUBLANG\n *\n */\n\n#define _CRT_SECURE_NO_WARNINGS\n\n#if !defined(_WIN32)\n#define _POSIX_C_SOURCE 200809L\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n#endif\n\n#ifdef __NUITKA_NO_ASSERT__\n#undef NDEBUG\n#define NDEBUG\n#endif\n\n#if defined(_WIN32)\n// Note: Keep this separate line, must be included before other Windows headers.\n#include <windows.h>\n#endif\n\n#include <assert.h>\n#include <errno.h>\n#include <signal.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#include <wchar.h>\n\n/* Type bool */\n#ifndef __cplusplus\n#include \"stdbool.h\"\n#endif\n\n#if defined(_WIN32)\n#include <imagehlp.h>\n#else\n#include <dirent.h>\n#include <signal.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/wait.h>\n#include <unistd.h>\n#endif\n\n#ifndef __IDE_ONLY__\n// Generated during build with optional defines.\n#include \"onefile_definitions.h\"\n#else\n#define _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_CACHING\n#define _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n#define _NUITKA_ONEFILE_TEMP_BOOL 0\n#define _NUITKA_ONEFILE_CHILD_GRACE_TIME_INT 5000\n#define _NUITKA_ONEFILE_TEMP_SPEC \"{TEMP}/onefile_{PID}_{TIME}\"\n\n#define _NUITKA_AUTO_UPDATE_BOOL 1\n#define _NUITKA_AUTO_UPDATE_DEBUG_BOOL 1\n#define _NUITKA_AUTO_UPDATE_URL_SPEC \"https://...\"\n\n#endif\n\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\n// Header of zstd goes first\n#define ZSTDERRORLIB_VISIBILITY\n#define ZSTDLIB_VISIBILITY\n#include \"zstd.h\"\n\n// Should be in our inline copy, we include all C files into this one.\n#include \"common/error_private.c\"\n#include \"common/fse_decompress.c\"\n#include \"common/xxhash.c\"\n#include \"common/zstd_common.c\"\n// Need to make sure this is last in common as it depends on the others.\n#include \"common/entropy_common.c\"\n\n// Decompression stuff.\n#include \"decompress/huf_decompress.c\"\n#include \"decompress/zstd_ddict.c\"\n#include \"decompress/zstd_decompress.c\"\n#include \"decompress/zstd_decompress_block.c\"\n#endif\n\n// Some handy macro definitions, e.g. unlikely and NUITKA_MAY_BE_UNUSED\n#include \"nuitka/hedley.h\"\n#define likely(x) HEDLEY_LIKELY(x)\n#define unlikely(x) HEDLEY_UNLIKELY(x)\n#ifdef __GNUC__\n#define NUITKA_MAY_BE_UNUSED __attribute__((__unused__))\n#else\n#define NUITKA_MAY_BE_UNUSED\n#endif\n\n#include \"HelpersChecksumTools.c\"\n#include \"HelpersEnvironmentVariablesSystem.c\"\n#include \"HelpersFilesystemPaths.c\"\n#include \"HelpersSafeStrings.c\"\n\n// For tracing outputs if enabled at compile time.\n#include \"nuitka/tracing.h\"\n\nstatic void fatalError(char const *message) {\n    puts(message);\n    exit(2);\n}\n\nstatic void fatalIOError(char const *message, error_code_t error_code) {\n    printOSErrorMessage(message, error_code);\n    exit(2);\n}\n\n// Failure to expand the template for where to extract to.\nstatic void fatalErrorTempFiles(void) {\n    fatalIOError(\"Error, couldn't unpack file to target path.\", getLastErrorCode());\n}\n\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\nstatic void fatalErrorAttachedData(void) { fatalError(\"Error, couldn't decode attached data.\"); }\n#endif\n\nstatic void fatalErrorHeaderAttachedData(void) { fatalError(\"Error, couldn't find attached data header.\"); }\n\n// Out of memory error.\n#if !defined(_WIN32) || _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\nstatic void fatalErrorMemory(void) { fatalError(\"Error, couldn't allocate memory.\"); }\n#endif\n\n// Could not launch child process.\nstatic void fatalErrorChild(char const *message, error_code_t error_code) { fatalIOError(message, error_code); }\n\n#if defined(_WIN32)\nstatic void appendWCharSafeW(wchar_t *target, wchar_t c, size_t buffer_size) {\n    while (*target != 0) {\n        target++;\n        buffer_size -= 1;\n    }\n\n    if (buffer_size < 1) {\n        abort();\n    }\n\n    *target++ = c;\n    *target = 0;\n}\n#endif\n\nstatic void fatalErrorTempFileCreate(filename_char_t const *filename) {\n    fprintf(stderr, \"Error, failed to open '\" FILENAME_FORMAT_STR \"' for writing.\\n\", filename);\n    exit(2);\n}\n\nstatic void fatalErrorSpec(filename_char_t const *spec) {\n    fprintf(stderr, \"Error, couldn't runtime expand spec '\" FILENAME_FORMAT_STR \"'.\\n\", spec);\n    abort();\n}\n\nstatic FILE_HANDLE createFileForWritingChecked(filename_char_t const *filename) {\n    FILE_HANDLE result = createFileForWriting(filename);\n\n    if (result == FILE_HANDLE_NULL) {\n        fatalErrorTempFileCreate(filename);\n    }\n\n    return result;\n}\n\nstatic unsigned char const *payload_data = NULL;\nstatic unsigned char const *payload_current = NULL;\nstatic unsigned long long payload_size = 0;\n\n#ifdef __APPLE__\n\n#include <mach-o/getsect.h>\n#include <mach-o/ldsyms.h>\n\nstatic void initPayloadData(void) {\n    const struct mach_header *header = &_mh_execute_header;\n\n    unsigned long section_size;\n\n    payload_data = getsectiondata(header, \"payload\", \"payload\", &section_size);\n    payload_current = payload_data;\n    payload_size = section_size;\n}\n\nstatic void closePayloadData(void) {}\n\n#elif defined(_WIN32)\n\nstatic void initPayloadData(void) {\n    HRSRC windows_resource = FindResource(NULL, MAKEINTRESOURCE(27), RT_RCDATA);\n\n    payload_data = (const unsigned char *)LockResource(LoadResource(NULL, windows_resource));\n    payload_current = payload_data;\n\n    payload_size = SizeofResource(NULL, windows_resource);\n}\n\n// Note: it appears unlocking the resource is not actually foreseen.\nstatic void closePayloadData(void) {}\n\n#else\n\nstatic void fatalErrorFindAttachedData(char const *erroring_function, error_code_t error_code) {\n    char buffer[1024] = \"Error, couldn't find attached data:\";\n    appendStringSafe(buffer, erroring_function, sizeof(buffer));\n\n    fatalIOError(buffer, error_code);\n}\n\nstatic struct MapFileToMemoryInfo exe_file_mapped;\n\nstatic void initPayloadData(void) {\n    exe_file_mapped = mapFileToMemory(getBinaryPath());\n\n    if (exe_file_mapped.error) {\n        fatalErrorFindAttachedData(exe_file_mapped.erroring_function, exe_file_mapped.error_code);\n    }\n\n    payload_data = exe_file_mapped.data;\n    payload_current = payload_data;\n}\n\nstatic void closePayloadData(void) { unmapFileFromMemory(&exe_file_mapped); }\n\n#endif\n\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\n\nstatic ZSTD_DCtx *dest_ctx = NULL;\nstatic ZSTD_inBuffer input = {NULL, 0, 0};\nstatic ZSTD_outBuffer output = {NULL, 0, 0};\n\nstatic void initZSTD(void) {\n    input.src = NULL;\n\n    size_t const output_buffer_size = ZSTD_DStreamOutSize();\n    output.dst = malloc(output_buffer_size);\n    if (output.dst == NULL) {\n        fatalErrorMemory();\n    }\n\n    dest_ctx = ZSTD_createDCtx();\n    if (dest_ctx == NULL) {\n        fatalErrorMemory();\n    }\n}\n\nstatic void releaseZSTD(void) {\n    ZSTD_freeDCtx(dest_ctx);\n\n    free(output.dst);\n}\n\n#endif\n\nstatic void readChunk(void *buffer, size_t size) {\n    // printf(\"Reading %d\\n\", size);\n\n    memcpy(buffer, payload_current, size);\n    payload_current += size;\n}\n\nstatic void readPayloadChunk(void *buffer, size_t size) {\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1 && _NUITKA_ONEFILE_ARCHIVE_BOOL == 0\n    bool end_of_buffer = false;\n\n    // Loop until finished with asked chunk.\n    while (size > 0) {\n        size_t available = output.size - output.pos;\n\n        // printf(\"already available %d asking for %d\\n\", available, size);\n\n        // Consider available data.\n        if (available != 0) {\n            size_t use = available;\n            if (size < use) {\n                use = size;\n            }\n\n            memcpy(buffer, ((char *)output.dst) + output.pos, use);\n            buffer = (void *)(((char *)buffer) + use);\n            size -= use;\n\n            output.pos += use;\n\n            // Loop end check may exist when \"size\" is \"use\".\n            continue;\n        }\n\n        // Nothing available, make sure to make it available from existing input.\n        if (input.pos < input.size || end_of_buffer) {\n            output.pos = 0;\n            output.size = ZSTD_DStreamOutSize();\n\n            size_t const ret = ZSTD_decompressStream(dest_ctx, &output, &input);\n            // printf(\"return output %d %d\\n\", output.pos, output.size);\n            end_of_buffer = (output.pos == output.size);\n\n            if (ZSTD_isError(ret)) {\n                fatalErrorAttachedData();\n            }\n\n            output.size = output.pos;\n            output.pos = 0;\n\n            // printf(\"made output %d %d\\n\", output.pos, output.size);\n\n            // Above code gets a turn.\n            continue;\n        }\n\n        if (input.size != input.pos) {\n            fatalErrorAttachedData();\n        }\n    }\n#else\n    readChunk(buffer, size);\n#endif\n}\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 0\nstatic uint32_t readPayloadChecksumValue(void) {\n    unsigned int result;\n    readPayloadChunk(&result, sizeof(unsigned int));\n\n    return (uint32_t)result;\n}\n#endif\n\n#if !defined(_WIN32) && !defined(__MSYS__)\nstatic unsigned char readPayloadFileFlagsValue(void) {\n    unsigned char result;\n    readPayloadChunk(&result, 1);\n\n    return result;\n}\n#endif\n\nstatic unsigned long long readPayloadSizeValue(void) {\n    unsigned long long result;\n    readPayloadChunk(&result, sizeof(unsigned long long));\n\n    return result;\n}\n\n#if _NUITKA_ONEFILE_ARCHIVE_BOOL == 1 && _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\nstatic unsigned long long readArchiveFileSizeValue(void) {\n    unsigned long long result;\n    readPayloadChunk(&result, sizeof(unsigned int));\n\n    return result;\n}\n#endif\n\nstatic filename_char_t readPayloadFilenameCharacter(void) {\n    filename_char_t result;\n\n    readPayloadChunk(&result, sizeof(filename_char_t));\n\n    return result;\n}\n\nstatic filename_char_t *readPayloadFilename(void) {\n    static filename_char_t buffer[1024];\n\n    filename_char_t *w = buffer;\n\n    for (;;) {\n        *w = readPayloadFilenameCharacter();\n\n        if (*w == 0) {\n            break;\n        }\n\n        w += 1;\n    }\n\n    return buffer;\n}\n\nstatic void writeContainedFile(FILE_HANDLE target_file, unsigned long long file_size) {\n#if _NUITKA_ONEFILE_ARCHIVE_BOOL == 1\n\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 0\n    if (target_file != FILE_HANDLE_NULL) {\n        if (writeFileChunk(target_file, payload_current, file_size) == false) {\n            fatalErrorTempFiles();\n        }\n    }\n\n    payload_current += file_size;\n#else\n    if (target_file != FILE_HANDLE_NULL) {\n\n        // Nothing available, make sure to make it available from existing input.\n        while (input.pos < input.size) {\n            // printf(\"available input %ld %ld\\n\", input.pos, input.size);\n\n            output.pos = 0;\n            output.size = ZSTD_DStreamOutSize();\n\n            size_t const ret = ZSTD_decompressStream(dest_ctx, &output, &input);\n            if (ZSTD_isError(ret)) {\n                fatalErrorAttachedData();\n            }\n\n            // printf(\"available output %ld %ld\\n\", output.pos, output.size);\n\n            if (writeFileChunk(target_file, (char const *)output.dst, output.pos) == false) {\n                fatalErrorTempFiles();\n            }\n\n            // printf(\"made output %ld %lld\\n\", output.pos, file_size);\n            file_size -= output.pos;\n            assert(file_size >= 0);\n        }\n\n        assert(file_size == 0);\n    }\n#endif\n#else\n    while (file_size > 0) {\n        static char chunk[32768];\n\n        long chunk_size;\n\n        // Doing min manually, as otherwise the compiler is confused from types.\n        if (file_size <= sizeof(chunk)) {\n            chunk_size = (long)file_size;\n        } else {\n            chunk_size = sizeof(chunk);\n        }\n\n        readPayloadChunk(chunk, chunk_size);\n\n        if (target_file != FILE_HANDLE_NULL) {\n            if (writeFileChunk(target_file, chunk, chunk_size) == false) {\n                fatalErrorTempFiles();\n            }\n        }\n\n        file_size -= chunk_size;\n    }\n\n    assert(file_size == 0);\n#endif\n}\n\n// Zero means, not yet created, created unsuccessfully, terminated already.\n#if defined(_WIN32)\nHANDLE handle_process = 0;\n#else\npid_t handle_process = 0;\n#endif\n\nstatic filename_char_t payload_path[4096] = {0};\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1\nstatic bool payload_created = false;\n#endif\n\n#define MAX_CREATED_DIRS 1024\nstatic filename_char_t *created_dir_paths[MAX_CREATED_DIRS];\nint created_dir_count = 0;\n\nstatic bool createDirectory(filename_char_t const *path) {\n    bool bool_res;\n\n#if defined(_WIN32)\n    if (created_dir_count == 0) {\n        filename_char_t home_path[4096];\n        wchar_t *pattern = L\"{HOME}\";\n\n        bool_res = expandTemplatePathFilename(home_path, pattern, sizeof(payload_path) / sizeof(filename_char_t));\n\n        if (unlikely(bool_res == false)) {\n            fatalErrorSpec(pattern);\n        }\n\n        created_dir_paths[created_dir_count] = wcsdup(home_path);\n        created_dir_count += 1;\n    }\n#endif\n\n    for (int i = 0; i < created_dir_count; i++) {\n        if (strcmpFilename(path, created_dir_paths[i]) == 0) {\n            return true;\n        }\n    }\n\n#if defined(_WIN32)\n    // On Windows, lets ignore drive letters.\n    if (strlenFilename(path) == 2 && path[1] == L':') {\n        return true;\n    }\n#endif\n\n#if defined(_WIN32)\n    bool_res = CreateDirectoryW(path, NULL);\n\n    if (bool_res == false && GetLastError() == 183) {\n        bool_res = true;\n    }\n#else\n    if (access(path, F_OK) != -1) {\n        bool_res = true;\n    } else {\n        bool_res = mkdir(path, 0700) == 0;\n    }\n#endif\n\n    if (bool_res != false && created_dir_count < MAX_CREATED_DIRS) {\n        created_dir_paths[created_dir_count] = strdupFilename(path);\n        created_dir_count += 1;\n    }\n\n    return bool_res;\n}\n\nstatic bool createContainingDirectory(filename_char_t const *path) {\n    filename_char_t dir_path[4096] = {0};\n    dir_path[0] = 0;\n\n    appendStringSafeFilename(dir_path, path, sizeof(dir_path) / sizeof(filename_char_t));\n\n    filename_char_t *w = dir_path + strlenFilename(dir_path);\n\n    while (w > dir_path) {\n        if (*w == FILENAME_SEP_CHAR) {\n            *w = 0;\n\n            bool res = createDirectory(dir_path);\n            if (res != false) {\n                return true;\n            }\n\n            createContainingDirectory(dir_path);\n            return createDirectory(dir_path);\n        }\n\n        w--;\n    }\n\n    return true;\n}\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1\n#if defined(_WIN32)\n\nstatic bool isDirectory(wchar_t const *path) {\n    DWORD dwAttrib = GetFileAttributesW(path);\n\n    return (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0);\n}\n\nstatic void _removeDirectory(wchar_t const *path) {\n    SHFILEOPSTRUCTW file_op_struct = {\n        NULL, FO_DELETE, payload_path, L\"\", FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT, false, 0, L\"\"};\n    SHFileOperationW(&file_op_struct);\n}\n\nstatic void removeDirectory(wchar_t const *path) {\n    _removeDirectory(path);\n\n    for (int i = 0; i < 20; i++) {\n        if (!isDirectory(path)) {\n            break;\n        }\n\n        // Delay 0.1s before trying again.\n        Sleep(100);\n\n        _removeDirectory(path);\n    }\n}\n\n#else\nstatic int removeDirectory(char const *path) {\n    DIR *d = opendir(path);\n    size_t path_len = strlen(path);\n\n    int r = -1;\n\n    if (d != NULL) {\n        struct dirent *p;\n\n        r = 0;\n        while (!r && (p = readdir(d))) {\n            int r2 = -1;\n\n            size_t len;\n\n            // Ignore special names\n            if (!strcmp(p->d_name, \".\") || !strcmp(p->d_name, \"..\")) {\n                continue;\n            }\n\n            len = path_len + strlen(p->d_name) + 2;\n            char *buf = (char *)malloc(len);\n\n            if (buf == NULL) {\n                fatalErrorMemory();\n            }\n\n            struct stat statbuf;\n\n            snprintf(buf, len, \"%s/%s\", path, p->d_name);\n\n            if (!stat(buf, &statbuf)) {\n                if (S_ISDIR(statbuf.st_mode))\n                    r2 = removeDirectory(buf);\n                else\n                    r2 = unlink(buf);\n            }\n            free(buf);\n            r = r2;\n        }\n        closedir(d);\n    }\n\n    if (!r) {\n        rmdir(path);\n    }\n\n    return r;\n}\n#endif\n#endif\n\n#if !defined(_WIN32)\nstatic int waitpid_retried(pid_t pid, int *status, bool async) {\n    int res;\n\n    for (;;) {\n        if (status != NULL) {\n            *status = 0;\n        }\n\n        res = waitpid(pid, status, async ? WNOHANG : 0);\n\n        if ((res == -1) && (errno == EINTR)) {\n            continue;\n        }\n\n        break;\n    }\n\n    return res;\n}\n\nstatic int waitpid_timeout(pid_t pid) {\n    // Check if already exited.\n    if (waitpid(pid, NULL, WNOHANG) == -1) {\n        return 0;\n    }\n\n    // Checking 5 times per second should be good enough.\n    long ns = 200000000L; // 0.2s\n\n    // Seconds, nanoseconds from our milliseconds value.\n    struct timespec timeout = {\n        _NUITKA_ONEFILE_CHILD_GRACE_TIME_INT / 1000,\n        (_NUITKA_ONEFILE_CHILD_GRACE_TIME_INT % 1000) * 1000,\n    };\n    struct timespec delay = {0, ns};\n    struct timespec elapsed = {0, 0};\n    struct timespec rem;\n\n    do {\n        // Only want to care about SIGCHLD here.\n        int res = waitpid_retried(pid, NULL, true);\n\n        if (unlikely(res < 0)) {\n            perror(\"waitpid\");\n\n            return -1;\n        }\n\n        if (res != 0) {\n            break;\n        }\n\n        nanosleep(&delay, &rem);\n\n        elapsed.tv_sec += (elapsed.tv_nsec + ns) / 1000000000L;\n        elapsed.tv_nsec = (elapsed.tv_nsec + ns) % 1000000000L;\n    } while (elapsed.tv_sec < timeout.tv_sec ||\n             (elapsed.tv_sec == timeout.tv_sec && elapsed.tv_nsec < timeout.tv_nsec));\n\n    return 0;\n}\n#endif\n\nstatic void cleanupChildProcess(bool send_sigint) {\n\n    // Cause KeyboardInterrupt in the child process.\n    if (handle_process != 0) {\n\n        if (send_sigint) {\n#if defined(_NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING)\n            puts(\"Sending CTRL-C to child\\n\");\n#endif\n\n#if defined(_WIN32)\n            BOOL res = GenerateConsoleCtrlEvent(CTRL_C_EVENT, GetProcessId(handle_process));\n\n            if (res == false) {\n                printOSErrorMessage(\"Failed to send CTRL-C to child process.\", GetLastError());\n                // No error exit is done, we still want to cleanup when it does exit\n            }\n#else\n            kill(handle_process, SIGINT);\n#endif\n        }\n\n        // TODO: We ought to only need to wait if there is a need to cleanup\n        // files when we are on Windows, on Linux maybe exec can be used so\n        // this process to exist anymore if there is nothing to do.\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1 || 1\n        NUITKA_PRINT_TRACE(\"Waiting for child to exit.\\n\");\n#if defined(_WIN32)\n        if (WaitForSingleObject(handle_process, _NUITKA_ONEFILE_CHILD_GRACE_TIME_INT) != 0) {\n            TerminateProcess(handle_process, 0);\n        }\n\n        CloseHandle(handle_process);\n#else\n        waitpid_timeout(handle_process);\n        kill(handle_process, SIGKILL);\n#endif\n        NUITKA_PRINT_TRACE(\"Child is exited.\\n\");\n#endif\n    }\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1\n    if (payload_created) {\n#if _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        wprintf(L\"Removing payload path '%lS'\\n\", payload_path);\n#endif\n        removeDirectory(payload_path);\n    }\n#endif\n}\n\n#if defined(_WIN32)\nBOOL WINAPI ourConsoleCtrlHandler(DWORD fdwCtrlType) {\n    switch (fdwCtrlType) {\n        // Handle the CTRL-C signal.\n    case CTRL_C_EVENT:\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        puts(\"Ctrl-C event\");\n#endif\n        cleanupChildProcess(false);\n        return FALSE;\n\n        // CTRL-CLOSE: confirm that the user wants to exit.\n    case CTRL_CLOSE_EVENT:\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        puts(\"Ctrl-Close event\");\n#endif\n        cleanupChildProcess(false);\n        return FALSE;\n\n        // Pass other signals to the next handler.\n    case CTRL_BREAK_EVENT:\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        puts(\"Ctrl-Break event\");\n#endif\n        cleanupChildProcess(false);\n        return FALSE;\n\n    case CTRL_LOGOFF_EVENT:\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        puts(\"Ctrl-Logoff event\");\n#endif\n        cleanupChildProcess(false);\n        return FALSE;\n\n    case CTRL_SHUTDOWN_EVENT:\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING\n        puts(\"Ctrl-Shutdown event\");\n#endif\n        cleanupChildProcess(false);\n        return FALSE;\n\n    default:\n        return FALSE;\n    }\n}\n\n#else\nvoid ourConsoleCtrlHandler(int sig) { cleanupChildProcess(false); }\n#endif\n\n#if _NUITKA_AUTO_UPDATE_BOOL && !defined(__IDE_ONLY__)\n#include \"nuitka_onefile_auto_updater.h\"\n#endif\n\n#if _NUITKA_AUTO_UPDATE_BOOL\nextern bool exe_file_updatable;\n#endif\n\n#ifdef _NUITKA_ONEFILE_SPLASH_SCREEN\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nextern void initSplashScreen(void);\nextern bool checkSplashScreen(void);\n#ifdef __cplusplus\n}\n#endif\n#endif\n\n#ifdef _NUITKA_WINMAIN_ENTRY_POINT\nint __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpCmdLine, int nCmdShow) {\n    int argc = __argc;\n    wchar_t **argv = __wargv;\n#else\n#if defined(_WIN32)\nint wmain(int argc, wchar_t **argv) {\n#else\nint main(int argc, char **argv) {\n#endif\n#endif\n    NUITKA_PRINT_TIMING(\"ONEFILE: Entered main().\");\n\n    filename_char_t const *pattern = FILENAME_EMPTY_STR _NUITKA_ONEFILE_TEMP_SPEC;\n    bool bool_res = expandTemplatePathFilename(payload_path, pattern, sizeof(payload_path) / sizeof(filename_char_t));\n\n    if (unlikely(bool_res == false)) {\n        fatalErrorSpec(pattern);\n    }\n\n#if defined(_NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_HANDLING)\n    wprintf(L\"payload path: '%lS'\\n\", payload_path);\n#endif\n\n#if defined(_WIN32)\n    bool_res = SetConsoleCtrlHandler(ourConsoleCtrlHandler, true);\n    if (bool_res == false) {\n        fatalError(\"Error, failed to register signal handler.\");\n    }\n#else\n    signal(SIGINT, ourConsoleCtrlHandler);\n    signal(SIGQUIT, ourConsoleCtrlHandler);\n    signal(SIGTERM, ourConsoleCtrlHandler);\n#endif\n\n#if _NUITKA_AUTO_UPDATE_BOOL\n    checkAutoUpdates();\n#endif\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Unpacking payload.\");\n\n    initPayloadData();\n\n#if !defined(__APPLE__) && !defined(_WIN32)\n    const off_t size_end_offset = exe_file_mapped.file_size;\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Determining payload start position.\");\n\n    assert(sizeof(payload_size) == sizeof(unsigned long long));\n    memcpy(&payload_size, payload_data + size_end_offset - sizeof(payload_size), sizeof(payload_size));\n\n    unsigned long long start_pos = size_end_offset - sizeof(payload_size) - payload_size;\n\n    payload_current += start_pos;\n    payload_data += start_pos;\n#endif\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Checking header for compression.\");\n\n    char header[3];\n    readChunk(&header, sizeof(header));\n\n    if (header[0] != 'K' || header[1] != 'A') {\n        fatalErrorHeaderAttachedData();\n    }\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Header is OK.\");\n\n// The 'X' stands for no compression, 'Y' is compressed, handle that.\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\n    if (header[2] != 'Y') {\n        fatalErrorHeaderAttachedData();\n    }\n    initZSTD();\n\n    input.src = payload_current;\n    input.pos = 0;\n    input.size = payload_size;\n\n    assert(payload_size > 0);\n#else\n    if (header[2] != 'X') {\n        fatalErrorHeaderAttachedData();\n    }\n#endif\n\n    static filename_char_t first_filename[1024] = {0};\n\n#if _NUITKA_ONEFILE_SPLASH_SCREEN\n    NUITKA_PRINT_TIMING(\"ONEFILE: Splash screen.\");\n\n    initSplashScreen();\n#endif\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Entering decompression.\");\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 1\n    payload_created = true;\n#endif\n\n    for (;;) {\n        filename_char_t *filename = readPayloadFilename();\n\n        // printf(\"Filename: \" FILENAME_FORMAT_STR \"\\n\", filename);\n\n        // Detect EOF from empty filename.\n        if (filename[0] == 0) {\n            break;\n        }\n\n        static filename_char_t target_path[4096] = {0};\n        target_path[0] = 0;\n\n        appendStringSafeFilename(target_path, payload_path, sizeof(target_path) / sizeof(filename_char_t));\n        appendCharSafeFilename(target_path, FILENAME_SEP_CHAR, sizeof(target_path) / sizeof(filename_char_t));\n        appendStringSafeFilename(target_path, filename, sizeof(target_path) / sizeof(filename_char_t));\n\n        if (first_filename[0] == 0) {\n            appendStringSafeFilename(first_filename, target_path, sizeof(target_path) / sizeof(filename_char_t));\n        }\n\n#if !defined(_WIN32) && !defined(__MSYS__)\n        unsigned char file_flags = readPayloadFileFlagsValue();\n#endif\n\n#if !defined(_WIN32) && !defined(__MSYS__)\n        if (file_flags & 2) {\n            filename_char_t *link_target_path = readPayloadFilename();\n\n            // printf(\"Filename: \" FILENAME_FORMAT_STR \" symlink to \" FILENAME_FORMAT_STR \"\\n\", target_path,\n            // link_target_path);\n\n            createContainingDirectory(target_path);\n\n            unlink(target_path);\n            if (symlink(link_target_path, target_path) != 0) {\n                fatalErrorTempFileCreate(target_path);\n            }\n\n            continue;\n        }\n#endif\n        // _putws(target_path);\n        unsigned long long file_size = readPayloadSizeValue();\n\n        bool needs_write = true;\n\n#if _NUITKA_ONEFILE_TEMP_BOOL == 0\n        uint32_t contained_file_checksum = readPayloadChecksumValue();\n        uint32_t existing_file_checksum = getFileCRC32(target_path);\n\n        if (contained_file_checksum == existing_file_checksum) {\n            needs_write = false;\n\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_CACHING\n            fprintf(stderr, \"CACHE HIT for '\" FILENAME_FORMAT_STR \"'.\\n\", target_path);\n#endif\n        } else {\n#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ONEFILE_CACHING\n            fprintf(stderr, \"CACHE MISS for '\" FILENAME_FORMAT_STR \"'.\\n\", target_path);\n#endif\n        }\n#endif\n\n#if _NUITKA_ONEFILE_ARCHIVE_BOOL == 1\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\n        uint32_t contained_archive_file_size = readArchiveFileSizeValue();\n\n        input.src = payload_current;\n        input.pos = 0;\n        input.size = contained_archive_file_size;\n\n        output.pos = 0;\n        output.size = 0;\n\n        payload_current += contained_archive_file_size;\n#endif\n#endif\n        FILE_HANDLE target_file = FILE_HANDLE_NULL;\n\n        if (needs_write) {\n            createContainingDirectory(target_path);\n            target_file = createFileForWritingChecked(target_path);\n        }\n\n        writeContainedFile(target_file, file_size);\n\n#if !defined(_WIN32) && !defined(__MSYS__)\n        if ((file_flags & 1) && (target_file != FILE_HANDLE_NULL)) {\n            int fd = fileno(target_file);\n\n            struct stat stat_buffer;\n            int res = fstat(fd, &stat_buffer);\n\n            if (res == -1) {\n                printOSErrorMessage(\"fstat\", errno);\n            }\n\n            // User shall be able to execute if at least.\n            stat_buffer.st_mode |= S_IXUSR;\n\n            // Follow read flags for group, others according to umask.\n            if ((stat_buffer.st_mode & S_IRGRP) != 0) {\n                stat_buffer.st_mode |= S_IXOTH;\n            }\n\n            if ((stat_buffer.st_mode & S_IRGRP) != 0) {\n                stat_buffer.st_mode |= S_IXOTH;\n            }\n\n            res = fchmod(fd, stat_buffer.st_mode);\n\n            if (res == -1) {\n                printOSErrorMessage(\"fchmod\", errno);\n            }\n        }\n#endif\n\n        if (target_file != FILE_HANDLE_NULL) {\n            if (closeFile(target_file) == false) {\n                fatalErrorTempFiles();\n            }\n        }\n    }\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Finishing decompression, cleanup payload.\");\n\n    closePayloadData();\n\n#if _NUITKA_AUTO_UPDATE_BOOL\n    exe_file_updatable = true;\n#endif\n\n#if _NUITKA_ONEFILE_COMPRESSION_BOOL == 1\n    releaseZSTD();\n#endif\n\n    // Pass our pid by value to the child. If we exit for some reason, re-parenting\n    // might change it by the time the child looks at its parent.\n#if defined(_WIN32)\n    setEnvironmentVariableFromLong(\"NUITKA_ONEFILE_PARENT\", GetCurrentProcessId());\n#else\n    setEnvironmentVariableFromLong(\"NUITKA_ONEFILE_PARENT\", (long)getpid());\n#endif\n\n#if defined(_WIN32)\n    filename_char_t const *binary_filename = getBinaryFilenameWideChars(false);\n#else\n    filename_char_t const *binary_filename = getBinaryFilenameHostEncoded(false);\n#endif\n    setEnvironmentVariable(\"NUITKA_ONEFILE_BINARY\", binary_filename);\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Preparing forking of slave process.\");\n\n#if defined(_WIN32)\n\n    STARTUPINFOW si;\n    memset(&si, 0, sizeof(si));\n    si.cb = sizeof(si);\n\n    PROCESS_INFORMATION pi;\n\n    bool_res = CreateProcessW(first_filename,        // application name\n                              GetCommandLineW(),     // command line\n                              NULL,                  // process attributes\n                              NULL,                  // thread attributes\n                              FALSE,                 // inherit handles\n                              NORMAL_PRIORITY_CLASS, // creation flags\n                              NULL, NULL, &si, &pi);\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Started slave process.\");\n\n    if (bool_res == false) {\n        fatalErrorChild(\"Error, couldn't launch child\", GetLastError());\n    }\n\n    CloseHandle(pi.hThread);\n    handle_process = pi.hProcess;\n\n    DWORD exit_code = 0;\n\n#if _NUITKA_ONEFILE_SPLASH_SCREEN\n    DWORD wait_time = 50;\n#else\n    DWORD wait_time = INFINITE;\n#endif\n\n    // Loop with splash screen, otherwise this will be only once.\n    while (handle_process != 0) {\n        WaitForSingleObject(handle_process, wait_time);\n\n        if (!GetExitCodeProcess(handle_process, &exit_code)) {\n            exit_code = 1;\n        }\n\n#if _NUITKA_ONEFILE_SPLASH_SCREEN\n        if (exit_code == STILL_ACTIVE) {\n            bool done = checkSplashScreen();\n\n            // Stop checking splash screen, can increase timeout.\n            if (done) {\n                wait_time = INFINITE;\n            }\n\n            continue;\n        }\n#endif\n        CloseHandle(handle_process);\n\n        handle_process = 0;\n    }\n\n    cleanupChildProcess(false);\n#else\n    pid_t pid = fork();\n    int exit_code;\n\n    if (pid < 0) {\n        int error_code = errno;\n\n        cleanupChildProcess(false);\n\n        fatalErrorChild(\"Error, couldn't launch child (fork)\", error_code);\n        exit_code = 2;\n    } else if (pid == 0) {\n        // Child process\n        execv(first_filename, argv);\n\n        fatalErrorChild(\"Error, couldn't launch child (exec)\", errno);\n        exit_code = 2;\n    } else {\n        // Onefile bootstrap process\n        handle_process = pid;\n\n        int status;\n        int res = waitpid_retried(handle_process, &status, false);\n\n        if (res == -1 && errno != ECHILD) {\n            exit_code = 2;\n        } else {\n            exit_code = WEXITSTATUS(status);\n        }\n\n        cleanupChildProcess(false);\n    }\n\n#endif\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Exiting.\");\n\n    return exit_code;\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/build/static_src/OnefileSplashScreen.cpp",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// Creates a stream object initialized with the data from an executable resource.\n\n#ifdef __MINGW32__\n#error \"No support for splash screens with MinGW64 yet, only works with MSVC. Somebody please make it portable.\"\n#endif\n\n#include <shlwapi.h>\n#include <wincodec.h>\n#include <windows.h>\n\n#include <assert.h>\n\n#ifndef _NUITKA_NON_C11_MODE\nextern \"C\" {\n#endif\n#include \"nuitka/filesystem_paths.h\"\n#include \"nuitka/safe_string_ops.h\"\n#include \"nuitka/tracing.h\"\n#ifndef _NUITKA_NON_C11_MODE\n};\n#endif\nIStream *createImageStream(void) {\n\n    // Load the resource with image data\n    HRSRC res_handle = FindResource(NULL, MAKEINTRESOURCE(28), RT_RCDATA);\n    if (res_handle == NULL) {\n        return NULL;\n    }\n    DWORD resource_size = SizeofResource(NULL, res_handle);\n    HGLOBAL image_handle = LoadResource(NULL, res_handle);\n    if (image_handle == NULL) {\n        return NULL;\n    }\n    LPVOID resource_data = LockResource(image_handle);\n    if (resource_data == NULL) {\n        return NULL;\n    }\n\n    HGLOBAL temp_data_handle = GlobalAlloc(GMEM_MOVEABLE, resource_size);\n    if (temp_data_handle == NULL) {\n        return NULL;\n    }\n\n    LPVOID temp_data = GlobalLock(temp_data_handle);\n    if (temp_data == NULL) {\n        return NULL;\n    }\n\n    // Copy the data from the resource to the new memory block\n    CopyMemory(temp_data, resource_data, resource_size);\n    GlobalUnlock(temp_data_handle);\n\n    // Create stream on the HGLOBAL containing the data\n    IStream *result = NULL;\n    if (SUCCEEDED(CreateStreamOnHGlobal(temp_data_handle, TRUE, &result))) {\n        return result;\n    }\n\n    GlobalFree(temp_data_handle);\n\n    return NULL;\n}\n\nIWICBitmapSource *getBitmapFromImageStream(IStream *image_stream) {\n    // Load the PNG\n    IWICBitmapDecoder *ipDecoder = NULL;\n    if (FAILED(CoCreateInstance(CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, __uuidof(ipDecoder),\n                                (void **)(&ipDecoder)))) {\n        return NULL;\n    }\n    if (FAILED(ipDecoder->Initialize(image_stream, WICDecodeMetadataCacheOnLoad))) {\n        return NULL;\n    }\n    UINT frame_count = 0;\n    if (FAILED(ipDecoder->GetFrameCount(&frame_count)) || frame_count != 1) {\n        return NULL;\n    }\n    IWICBitmapFrameDecode *ipFrame = NULL;\n    if (FAILED(ipDecoder->GetFrame(0, &ipFrame))) {\n        return NULL;\n    }\n\n    // Convert the image to 32bpp BGRA with alpha channel\n    IWICBitmapSource *ipBitmap = NULL;\n\n    WICConvertBitmapSource(GUID_WICPixelFormat32bppPBGRA, ipFrame, &ipBitmap);\n\n    ipFrame->Release();\n    ipDecoder->Release();\n\n    return ipBitmap;\n}\n\nHBITMAP CreateHBITMAP(IWICBitmapSource *ipBitmap) {\n    // Get image dimensions.\n    UINT width = 0;\n    UINT height = 0;\n    if (FAILED(ipBitmap->GetSize(&width, &height)) || width == 0 || height == 0) {\n        return NULL;\n    }\n\n    // Prepare structure for bitmap information\n    BITMAPINFO bitmap_info;\n    memset(&bitmap_info, 0, sizeof(bitmap_info));\n    bitmap_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n    bitmap_info.bmiHeader.biWidth = width;\n    bitmap_info.bmiHeader.biHeight = -((LONG)height); // top-down DIB mode\n    bitmap_info.bmiHeader.biPlanes = 1;\n    bitmap_info.bmiHeader.biBitCount = 32;\n    bitmap_info.bmiHeader.biCompression = BI_RGB;\n\n    // Create the DIB section for the image\n    HDC handle_screen = GetDC(NULL);\n    void *image_data = NULL;\n    HBITMAP handle_bmp = CreateDIBSection(handle_screen, &bitmap_info, DIB_RGB_COLORS, &image_data, NULL, 0);\n    ReleaseDC(NULL, handle_screen);\n    if (handle_bmp == NULL) {\n        return NULL;\n    }\n    // Copy the image into the HBITMAP\n    const UINT stride = width * 4;\n    const UINT size = stride * height;\n    if (FAILED(ipBitmap->CopyPixels(NULL, stride, size, (BYTE *)(image_data)))) {\n        return NULL;\n    }\n\n    return handle_bmp;\n}\n\nHWND createSplashWindow(HBITMAP splash_bitmap) {\n    WNDCLASSA wc = {0};\n    wc.lpfnWndProc = DefWindowProc;\n    wc.hCursor = LoadCursor(NULL, IDC_ARROW);\n    wc.lpszClassName = \"Splash\";\n    RegisterClassA(&wc);\n\n    HWND splash_window = CreateWindowExA(WS_EX_LAYERED, wc.lpszClassName, NULL,\n                                         WS_POPUP | WS_VISIBLE | WS_EX_TOOLWINDOW, 0, 0, 0, 0, 0, NULL, 0, NULL);\n\n    // get the size of the bitmap\n\n    BITMAP bitmap;\n    GetObject(splash_bitmap, sizeof(bitmap), &bitmap);\n    SIZE sizeSplash = {bitmap.bmWidth, bitmap.bmHeight};\n\n    POINT zero = {0};\n    HMONITOR handle_monitor = MonitorFromPoint(zero, MONITOR_DEFAULTTOPRIMARY);\n    MONITORINFO monitorinfo = {0};\n    monitorinfo.cbSize = sizeof(monitorinfo);\n    GetMonitorInfo(handle_monitor, &monitorinfo);\n\n    // Centered splash screen in the middle of main monitor.\n    POINT ptOrigin;\n    ptOrigin.x = monitorinfo.rcWork.left + (monitorinfo.rcWork.right - monitorinfo.rcWork.left - sizeSplash.cx) / 2;\n    ptOrigin.y = monitorinfo.rcWork.top + (monitorinfo.rcWork.bottom - monitorinfo.rcWork.top - sizeSplash.cy) / 2;\n\n    // Create a DC with splash bitmap\n    HDC handle_screen = GetDC(NULL);\n    HDC handle_memory = CreateCompatibleDC(handle_screen);\n    HBITMAP handle_old_bitmap = (HBITMAP)SelectObject(handle_memory, splash_bitmap);\n\n    // Set image alpha channel for blending.\n    BLENDFUNCTION blend = {0};\n    blend.BlendOp = AC_SRC_OVER;\n    blend.SourceConstantAlpha = 255;\n    blend.AlphaFormat = AC_SRC_ALPHA;\n\n    // Set window for display.\n    UpdateLayeredWindow(splash_window, handle_screen, &ptOrigin, &sizeSplash, handle_memory, &zero, RGB(0, 0, 0),\n                        &blend, ULW_ALPHA);\n\n    SelectObject(handle_memory, handle_old_bitmap);\n    DeleteDC(handle_memory);\n    ReleaseDC(NULL, handle_screen);\n\n    return splash_window;\n}\n\nHWND splash_window = 0;\nstatic wchar_t splash_indicator_path[4096] = {0};\nbool splash_active = false;\n\nextern \"C\" void initSplashScreen(void) {\n    CoInitialize(NULL);\n    IStream *image_stream = createImageStream();\n    if (image_stream == NULL) {\n        return;\n    }\n    IWICBitmapSource *image_source = getBitmapFromImageStream(image_stream);\n    image_stream->Release();\n    if (image_source == NULL) {\n        return;\n    }\n    HBITMAP splash_bitmap = CreateHBITMAP(image_source);\n    image_source->Release();\n    if (splash_bitmap == NULL) {\n        return;\n    }\n\n    splash_window = createSplashWindow(splash_bitmap);\n\n    wchar_t const *pattern = L\"{TEMP}\\\\onefile_{PID}_splash_feedback.tmp\";\n    BOOL bool_res =\n        expandTemplatePathW(splash_indicator_path, pattern, sizeof(splash_indicator_path) / sizeof(wchar_t));\n    if (bool_res == false) {\n        return;\n    }\n\n    HANDLE handle_splash_file =\n        CreateFileW(splash_indicator_path, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL);\n    CloseHandle(handle_splash_file);\n\n    splash_active = true;\n\n    NUITKA_PRINT_TIMING(\"ONEFILE: Done with splash screen.\");\n}\n\nstatic void closeSplashScreen(void) {\n    if (splash_window) {\n        DestroyWindow(splash_window);\n        splash_window = 0;\n    }\n}\n\nextern \"C\" bool checkSplashScreen(void) {\n    if (splash_active) {\n        if (!PathFileExistsW(splash_indicator_path)) {\n            closeSplashScreen();\n            splash_active = false;\n        }\n    }\n\n    return splash_active == false;\n}\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/AsyncgenCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with compiled asyncgen objects.\n\n\"\"\"\n\nfrom .CodeHelpers import generateStatementSequenceCode\nfrom .Emission import SourceCodeCollector\nfrom .FunctionCodes import (\n    finalizeFunctionLocalVariables,\n    getClosureCopyCode,\n    getFunctionCreationArgs,\n    getFunctionQualnameObj,\n    setupFunctionLocalVariables,\n)\nfrom .Indentation import indented\nfrom .ModuleCodes import getModuleAccessCode\nfrom .templates.CodeTemplatesAsyncgens import (\n    template_asyncgen_exception_exit,\n    template_asyncgen_noexception_exit,\n    template_asyncgen_object_body,\n    template_asyncgen_object_maker_template,\n    template_asyncgen_return_exit,\n    template_make_asyncgen,\n)\nfrom .YieldCodes import getYieldReturnDispatchCode\n\n\ndef _getAsyncgenMakerIdentifier(function_identifier):\n    return \"MAKE_ASYNCGEN_\" + function_identifier\n\n\ndef getAsyncgenObjectDeclCode(function_identifier, closure_variables):\n    asyncgen_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    return template_asyncgen_object_maker_template % {\n        \"asyncgen_maker_identifier\": _getAsyncgenMakerIdentifier(function_identifier),\n        \"asyncgen_creation_args\": \", \".join(asyncgen_creation_args),\n    }\n\n\ndef getAsyncgenObjectCode(\n    context,\n    function_identifier,\n    closure_variables,\n    user_variables,\n    outline_variables,\n    temp_variables,\n    needs_exception_exit,\n    needs_generator_return,\n):\n    # A bit of details going on here, pylint: disable=too-many-locals\n\n    setupFunctionLocalVariables(\n        context=context,\n        parameters=None,\n        closure_variables=closure_variables,\n        user_variables=user_variables + outline_variables,\n        temp_variables=temp_variables,\n    )\n\n    function_codes = SourceCodeCollector()\n\n    asyncgen_object_body = context.getOwner()\n\n    generateStatementSequenceCode(\n        statement_sequence=asyncgen_object_body.subnode_body,\n        allow_none=True,\n        emit=function_codes,\n        context=context,\n    )\n\n    function_cleanup = finalizeFunctionLocalVariables(context)\n\n    if needs_exception_exit:\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            _exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        generator_exit = template_asyncgen_exception_exit % {\n            \"function_cleanup\": indented(function_cleanup),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n    else:\n        generator_exit = template_asyncgen_noexception_exit % {\n            \"function_cleanup\": indented(function_cleanup)\n        }\n\n    if needs_generator_return:\n        generator_exit += template_asyncgen_return_exit % {}\n\n    function_locals = context.variable_storage.makeCFunctionLevelDeclarations()\n\n    local_type_decl = context.variable_storage.makeCStructLevelDeclarations()\n    function_locals += context.variable_storage.makeCStructInits()\n\n    if local_type_decl:\n        heap_declaration = \"\"\"\\\nstruct %(function_identifier)s_locals *asyncgen_heap = \\\n(struct %(function_identifier)s_locals *)asyncgen->m_heap_storage;\"\"\" % {\n            \"function_identifier\": function_identifier\n        }\n    else:\n        heap_declaration = \"\"\n\n    asyncgen_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    return template_asyncgen_object_body % {\n        \"function_identifier\": function_identifier,\n        \"function_body\": indented(function_codes.codes),\n        \"heap_declaration\": indented(heap_declaration),\n        \"has_heap_declaration\": 1 if heap_declaration != \"\" else 0,\n        \"function_local_types\": indented(local_type_decl),\n        \"function_var_inits\": indented(function_locals),\n        \"function_dispatch\": indented(getYieldReturnDispatchCode(context)),\n        \"asyncgen_maker_identifier\": _getAsyncgenMakerIdentifier(function_identifier),\n        \"asyncgen_creation_args\": \", \".join(asyncgen_creation_args),\n        \"asyncgen_exit\": generator_exit,\n        \"asyncgen_module\": getModuleAccessCode(context),\n        \"asyncgen_name_obj\": context.getConstantCode(\n            constant=asyncgen_object_body.getFunctionName()\n        ),\n        \"asyncgen_qualname_obj\": getFunctionQualnameObj(asyncgen_object_body, context),\n        \"code_identifier\": context.getCodeObjectHandle(\n            code_object=asyncgen_object_body.getCodeObject()\n        ),\n        \"closure_name\": \"closure\" if closure_variables else \"NULL\",\n        \"closure_count\": len(closure_variables),\n    }\n\n\ndef generateMakeAsyncgenObjectCode(to_name, expression, emit, context):\n    asyncgen_object_body = expression.subnode_asyncgen_ref.getFunctionBody()\n\n    closure_variables = expression.getClosureVariableVersions()\n\n    closure_name, closure_copy = getClosureCopyCode(\n        closure_variables=closure_variables, context=context\n    )\n\n    args = []\n    if closure_name:\n        args.append(closure_name)\n\n    emit(\n        template_make_asyncgen\n        % {\n            \"to_name\": to_name,\n            \"asyncgen_maker_identifier\": _getAsyncgenMakerIdentifier(\n                asyncgen_object_body.getCodeName()\n            ),\n            \"args\": \", \".join(str(arg) for arg in args),\n            \"closure_copy\": indented(closure_copy, 0, True),\n        }\n    )\n\n    context.addCleanupTempName(to_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/AttributeCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Attribute related codes.\n\nAttribute lookup, setting.\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode, getReleaseCode\nfrom .PythonAPICodes import (\n    generateCAPIObjectCode,\n    generateCAPIObjectCode0,\n    makeArgDescFromExpression,\n)\n\n\ndef generateAssignmentAttributeCode(statement, emit, context):\n    lookup_source = statement.subnode_expression\n    attribute_name = statement.getAttributeName()\n    value = statement.subnode_source\n\n    value_name = context.allocateTempName(\"assattr_value\")\n    generateExpressionCode(\n        to_name=value_name, expression=value, emit=emit, context=context\n    )\n\n    target_name = context.allocateTempName(\"assattr_target\")\n    generateExpressionCode(\n        to_name=target_name, expression=lookup_source, emit=emit, context=context\n    )\n\n    with context.withCurrentSourceCodeReference(\n        value.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        if attribute_name == \"__dict__\":\n            getAttributeAssignmentDictSlotCode(\n                target_name=target_name,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n        elif attribute_name == \"__class__\":\n            getAttributeAssignmentClassSlotCode(\n                target_name=target_name,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n        else:\n            getAttributeAssignmentCode(\n                target_name=target_name,\n                value_name=value_name,\n                attribute_name=context.getConstantCode(constant=attribute_name),\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateDelAttributeCode(statement, emit, context):\n    target_name = context.allocateTempName(\"attrdel_target\")\n\n    generateExpressionCode(\n        to_name=target_name,\n        expression=statement.subnode_expression,\n        emit=emit,\n        context=context,\n    )\n\n    with context.withCurrentSourceCodeReference(\n        statement.subnode_expression.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        getAttributeDelCode(\n            target_name=target_name,\n            attribute_name=context.getConstantCode(\n                constant=statement.getAttributeName()\n            ),\n            emit=emit,\n            context=context,\n        )\n\n\ndef getAttributeLookupCode(\n    to_name, source_name, attribute_name, needs_check, emit, context\n):\n    if attribute_name == \"__dict__\":\n        emit(\"%s = LOOKUP_ATTRIBUTE_DICT_SLOT(tstate, %s);\" % (to_name, source_name))\n    elif attribute_name == \"__class__\":\n        emit(\"%s = LOOKUP_ATTRIBUTE_CLASS_SLOT(tstate, %s);\" % (to_name, source_name))\n    else:\n        emit(\n            \"%s = LOOKUP_ATTRIBUTE(tstate, %s, %s);\"\n            % (to_name, source_name, context.getConstantCode(attribute_name))\n        )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_name=source_name,\n        needs_check=needs_check,\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateAttributeLookupCode(to_name, expression, emit, context):\n    (source_name,) = generateChildExpressionsCode(\n        expression=expression,\n        emit=emit,\n        context=context,\n    )\n\n    attribute_name = expression.getAttributeName()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"attribute_value\", expression, emit, context\n    ) as value_name:\n        getAttributeLookupCode(\n            to_name=value_name,\n            source_name=source_name,\n            attribute_name=attribute_name,\n            needs_check=expression.subnode_expression.mayRaiseExceptionAttributeLookup(\n                exception_type=BaseException, attribute_name=attribute_name\n            ),\n            emit=emit,\n            context=context,\n        )\n\n\ndef getAttributeAssignmentCode(target_name, attribute_name, value_name, emit, context):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_ATTRIBUTE(tstate, %s, %s, %s);\"\n        % (res_name, target_name, attribute_name, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(value_name, target_name, attribute_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef getAttributeAssignmentDictSlotCode(target_name, value_name, emit, context):\n    \"\"\"Code for special case target.__dict__ = value\"\"\"\n\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_ATTRIBUTE_DICT_SLOT(tstate, %s, %s);\"\n        % (res_name, target_name, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(value_name, target_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef getAttributeAssignmentClassSlotCode(target_name, value_name, emit, context):\n    \"\"\"Get code for special case target.__class__ = value\"\"\"\n\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_ATTRIBUTE_CLASS_SLOT(tstate, %s, %s);\"\n        % (res_name, target_name, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(value_name, target_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef getAttributeDelCode(target_name, attribute_name, emit, context):\n    res_name = context.getIntResName()\n\n    emit(\"%s = PyObject_DelAttr(%s, %s);\" % (res_name, target_name, attribute_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(target_name, attribute_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateAttributeLookupSpecialCode(to_name, expression, emit, context):\n    (source_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    attribute_name = expression.getAttributeName()\n\n    getAttributeLookupSpecialCode(\n        to_name=to_name,\n        source_name=source_name,\n        attr_name=context.getConstantCode(constant=attribute_name),\n        needs_check=expression.subnode_expression.mayRaiseExceptionAttributeLookupSpecial(\n            exception_type=BaseException, attribute_name=attribute_name\n        ),\n        emit=emit,\n        context=context,\n    )\n\n\ndef getAttributeLookupSpecialCode(\n    to_name, source_name, attr_name, needs_check, emit, context\n):\n    emit(\"%s = LOOKUP_SPECIAL(tstate, %s, %s);\" % (to_name, source_name, attr_name))\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(source_name, attr_name),\n        emit=emit,\n        needs_check=needs_check,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateBuiltinHasattrCode(to_name, expression, emit, context):\n    source_name, attr_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    res_name = context.getIntResName()\n\n    emit(\n        \"%s = BUILTIN_HASATTR_BOOL(tstate, %s, %s);\"\n        % (res_name, source_name, attr_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(source_name, attr_name),\n        needs_check=expression.mayRaiseException(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n    )\n\n\ndef generateAttributeCheckCode(to_name, expression, emit, context):\n    (source_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    if expression.mayRaiseExceptionOperation():\n        res_name = context.getIntResName()\n\n        emit(\n            \"%s = HAS_ATTR_BOOL2(tstate, %s, %s);\"\n            % (\n                res_name,\n                source_name,\n                context.getConstantCode(constant=expression.getAttributeName()),\n            )\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % res_name,\n            release_name=source_name,\n            emit=emit,\n            context=context,\n        )\n\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n        )\n    else:\n        res_name = context.getBoolResName()\n\n        emit(\n            \"%s = HAS_ATTR_BOOL(tstate, %s, %s);\"\n            % (\n                res_name,\n                source_name,\n                context.getConstantCode(constant=expression.getAttributeName()),\n            )\n        )\n\n        getReleaseCode(release_name=source_name, emit=emit, context=context)\n\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=res_name, emit=emit\n        )\n\n\ndef generateBuiltinGetattrCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_GETATTR\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinSetattrCode(to_name, expression, emit, context):\n    generateCAPIObjectCode0(\n        to_name=to_name,\n        capi=\"BUILTIN_SETATTR\",\n        tstate=False,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/BinaryOperationHelperDefinitions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Shared definitions of what binary operation helpers are available.\n\nThese are functions to work with helper names, as well as sets of functions to\ngenerate specialized code variants for.\n\nNote: These are ordered, so we can define the order they are created in the\ncode generation of specialized helpers, as this set is used for input there\ntoo.\n\n\"\"\"\n\nfrom nuitka.containers.OrderedSets import OrderedSet, buildOrderedSet\n\n# spell-checker: ignore clong\n\n\ndef parseTypesFromHelper(helper_name):\n    \"\"\"Function to parse helper names.\"\"\"\n\n    if helper_name.startswith(\"INPLACE_\"):\n        target_code = None\n        left_code = helper_name.split(\"_\")[3]\n        right_code = helper_name.split(\"_\")[4]\n    else:\n        target_code = helper_name.split(\"_\")[3]\n        left_code = helper_name.split(\"_\")[4]\n        right_code = helper_name.split(\"_\")[5]\n\n    return target_code, left_code, right_code\n\n\ndef deriveInplaceFromBinaryOperations(operations_set):\n    \"\"\"Derive the in-place operations from the binary ones.\n\n    These can largely be the same, or should be, and keeping them inline is easier when\n    generating them. Obviously the templates might both need changes to optimize equally\n    well for all variants.\n    \"\"\"\n\n    if not operations_set:\n        return None\n\n    operation = next(iter(operations_set)).split(\"_\")[2]\n\n    return OrderedSet(\n        helper_name.replace(operation + \"_OBJECT\", operation).replace(\n            \"BINARY_\", \"INPLACE_\"\n        )\n        for helper_name in operations_set\n        if parseTypesFromHelper(helper_name)[0] == \"OBJECT\"\n    )\n\n\ndef _makeTypeSemiOps(op_code, type_name, in_place=False):\n    if in_place:\n        yield \"INPLACE_OPERATION_%s_%s_OBJECT\" % (op_code, type_name)\n    else:\n        yield \"BINARY_OPERATION_%s_OBJECT_OBJECT_%s\" % (op_code, type_name)\n        yield \"BINARY_OPERATION_%s_OBJECT_%s_OBJECT\" % (op_code, type_name)\n\n\ndef _makeTypeOps(op_code, type_name, include_nbool, in_place=False):\n    if in_place:\n        yield \"INPLACE_OPERATION_%s_%s_%s\" % (op_code, type_name, type_name)\n        yield \"INPLACE_OPERATION_%s_OBJECT_%s\" % (op_code, type_name)\n        yield \"INPLACE_OPERATION_%s_%s_OBJECT\" % (op_code, type_name)\n    else:\n        yield \"BINARY_OPERATION_%s_OBJECT_%s_%s\" % (op_code, type_name, type_name)\n        yield \"BINARY_OPERATION_%s_OBJECT_OBJECT_%s\" % (op_code, type_name)\n        yield \"BINARY_OPERATION_%s_OBJECT_%s_OBJECT\" % (op_code, type_name)\n\n    if include_nbool and not in_place:\n        for helper in _makeTypeOpsNbool(op_code, type_name):\n            yield helper\n\n\ndef _makeTypeOpsNbool(op_code, type_name):\n    yield \"BINARY_OPERATION_%s_NBOOL_%s_%s\" % (op_code, type_name, type_name)\n    yield \"BINARY_OPERATION_%s_NBOOL_OBJECT_%s\" % (op_code, type_name)\n    yield \"BINARY_OPERATION_%s_NBOOL_%s_OBJECT\" % (op_code, type_name)\n\n\ndef _isCommutativeOperation(op_code):\n    return op_code in (\"ADD\", \"MULT\", \"BITOR\", \"BITAND\", \"BITXOR\")\n\n\ndef _isCommutativeType(type_name):\n    return type_name in (\"INT\", \"LONG\", \"FLOAT\", \"CLONG\", \"DIGIT\", \"CFLOAT\")\n\n\n_type_order = (\n    \"CLONG\",\n    \"INT\",\n    \"DIGIT\",\n    \"CFLOAT\",\n    \"LONG\",\n    \"FLOAT\",\n    \"STR\",\n    \"UNICODE\",\n    \"BYTES\",\n    \"TUPLE\",\n    \"LIST\",\n)\n\n_no_inplace_target_types = (\"CLONG\", \"DIGIT\", \"CFLOAT\")\n\n\ndef _makeFriendOps(op_code, include_nbool, in_place, *type_names):\n    assert len(type_names) == len(set(type_names)), type_names\n\n    type_names = tuple(\n        sorted(type_names, key=lambda type_name: -_type_order.index(type_name))\n    )\n\n    for type_name1 in type_names:\n        for type_name2 in type_names[type_names.index(type_name1) + 1 :]:\n            # These should be used with reversed arguments, and only have the\n            # dominant type as the first argument.\n            arg_swap = (\n                _isCommutativeOperation(op_code)\n                and not in_place\n                and _isCommutativeType(type_name1)\n                and _isCommutativeType(type_name2)\n            )\n\n            if in_place:\n                if type_name1 not in _no_inplace_target_types:\n                    yield \"INPLACE_OPERATION_%s_%s_%s\" % (\n                        op_code,\n                        type_name1,\n                        type_name2,\n                    )\n            else:\n                yield \"BINARY_OPERATION_%s_OBJECT_%s_%s\" % (\n                    op_code,\n                    type_name1,\n                    type_name2,\n                )\n\n            if not arg_swap:\n                if in_place:\n                    if type_name2 not in _no_inplace_target_types:\n                        yield \"INPLACE_OPERATION_%s_%s_%s\" % (\n                            op_code,\n                            type_name2,\n                            type_name1,\n                        )\n                else:\n                    yield \"BINARY_OPERATION_%s_OBJECT_%s_%s\" % (\n                        op_code,\n                        type_name2,\n                        type_name1,\n                    )\n\n            if include_nbool and not in_place:\n                yield \"BINARY_OPERATION_%s_NBOOL_%s_%s\" % (\n                    op_code,\n                    type_name1,\n                    type_name2,\n                )\n\n                if not arg_swap:\n                    yield \"BINARY_OPERATION_%s_NBOOL_%s_%s\" % (\n                        op_code,\n                        type_name2,\n                        type_name1,\n                    )\n\n\ndef _makeDefaultOps(op_code, include_nbool, in_place=False):\n    if in_place:\n        yield \"INPLACE_OPERATION_%s_OBJECT_OBJECT\" % op_code\n    else:\n        yield \"BINARY_OPERATION_%s_OBJECT_OBJECT_OBJECT\" % op_code\n\n    if include_nbool and not in_place:\n        yield \"BINARY_OPERATION_%s_NBOOL_OBJECT_OBJECT\" % op_code\n\n\ndef _makeNonContainerMathOps(op_code):\n    for type_name in \"TUPLE\", \"LIST\", \"DICT\", \"SET\", \"FROZENSET\":\n        if \"BIT\" in op_code and type_name == \"SET\":\n            continue\n        if \"SUB\" in op_code and type_name == \"SET\":\n            continue\n\n        for value in _makeTypeOps(op_code, type_name, include_nbool=True):\n            yield value\n\n\ndef _makeNumberOps(op_code, include_nbool, in_place):\n    return buildOrderedSet(\n        _makeTypeOps(op_code, \"INT\", include_nbool=include_nbool, in_place=in_place),\n        _makeTypeOps(op_code, \"LONG\", include_nbool=include_nbool, in_place=in_place),\n        _makeTypeOps(op_code, \"FLOAT\", include_nbool=include_nbool, in_place=in_place),\n        # These are friends naturally, they all add with another.\n        _makeFriendOps(op_code, include_nbool, in_place, \"INT\", \"LONG\", \"FLOAT\"),\n        # Special operations, currently used with constant values mostly.\n        _makeFriendOps(op_code, include_nbool, in_place, \"INT\", \"CLONG\"),\n        (\n            _makeFriendOps(op_code, include_nbool, in_place, \"LONG\", \"DIGIT\")\n            if op_code in (\"ADD\", \"SUB\")  # TODO: Add more\n            else ()\n        ),\n        _makeFriendOps(op_code, include_nbool, in_place, \"FLOAT\", \"CFLOAT\"),\n    )\n\n\ndef _makeAddOps(in_place):\n    return buildOrderedSet(\n        _makeNumberOps(\"ADD\", include_nbool=True, in_place=in_place),\n        _makeTypeOps(\"ADD\", \"STR\", include_nbool=False, in_place=in_place),\n        _makeTypeOps(\"ADD\", \"UNICODE\", include_nbool=False, in_place=in_place),\n        _makeTypeOps(\"ADD\", \"BYTES\", include_nbool=False, in_place=in_place),\n        _makeTypeOps(\"ADD\", \"TUPLE\", include_nbool=False, in_place=in_place),\n        _makeTypeOps(\"ADD\", \"LIST\", include_nbool=True, in_place=in_place),\n        # These are friends too.\n        _makeFriendOps(\"ADD\", True, in_place, \"STR\", \"UNICODE\"),\n        # Default implementation.\n        _makeDefaultOps(\"ADD\", include_nbool=True, in_place=in_place),\n    )\n\n\nspecialized_add_helpers_set = _makeAddOps(in_place=False)\n\nnonspecialized_add_helpers_set = buildOrderedSet(\n    _makeTypeOpsNbool(\"ADD\", \"STR\"),  # Not really likely to be used.\n    _makeTypeOpsNbool(\"ADD\", \"UNICODE\"),  # Not really likely to be used.\n    _makeTypeOpsNbool(\"ADD\", \"BYTES\"),  # Not really likely to be used.\n    _makeTypeOpsNbool(\"ADD\", \"TUPLE\"),  # Not really likely to be used.\n)\n\n\ndef makeSubOps(in_place):\n    return buildOrderedSet(\n        _makeNumberOps(\"SUB\", include_nbool=False, in_place=in_place),\n        _makeDefaultOps(\"SUB\", include_nbool=False, in_place=in_place),\n    )\n\n\nspecialized_sub_helpers_set = makeSubOps(in_place=False)\n\n# These made no sense to specialize for, nothing to gain.\nnonspecialized_sub_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"SUB\", \"STR\", include_nbool=True),\n    _makeTypeOps(\"SUB\", \"UNICODE\", include_nbool=True),\n    _makeTypeOps(\"SUB\", \"BYTES\", include_nbool=True),\n    _makeNonContainerMathOps(\"SUB\"),\n)\n\n\ndef _makeMultOps(in_place):\n    return buildOrderedSet(\n        _makeNumberOps(\"MULT\", include_nbool=True, in_place=in_place),\n        _makeFriendOps(\"MULT\", False, in_place, \"INT\", \"STR\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"INT\", \"UNICODE\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"INT\", \"TUPLE\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"INT\", \"LIST\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"LONG\", \"UNICODE\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"LONG\", \"BYTES\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"LONG\", \"TUPLE\"),\n        _makeFriendOps(\"MULT\", False, in_place, \"LONG\", \"LIST\"),\n        _makeTypeSemiOps(\"MULT\", \"STR\", in_place=in_place),\n        _makeTypeSemiOps(\"MULT\", \"UNICODE\", in_place=in_place),\n        _makeTypeSemiOps(\"MULT\", \"BYTES\", in_place=in_place),\n        _makeTypeSemiOps(\"MULT\", \"TUPLE\", in_place=in_place),\n        _makeTypeSemiOps(\"MULT\", \"LIST\", in_place=in_place),\n        # These are friends naturally, they all mul with another\n        _makeDefaultOps(\"MULT\", include_nbool=True, in_place=in_place),\n    )\n\n\nspecialized_mult_helpers_set = _makeMultOps(in_place=False)\n# Using booleans, because multiplication might be used to test for zero result.\n\nnonspecialized_mult_helpers_set = None\n\n\ndef _makeDivOps(op_code, in_place):\n    return buildOrderedSet(\n        _makeNumberOps(op_code, include_nbool=False, in_place=in_place),\n        _makeDefaultOps(op_code, include_nbool=False, in_place=in_place),\n    )\n\n\nspecialized_truediv_helpers_set = _makeDivOps(\"TRUEDIV\", in_place=False)\n\nnonspecialized_truediv_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"TRUEDIV\", \"UNICODE\", include_nbool=True),\n    _makeTypeOps(\"TRUEDIV\", \"STR\", include_nbool=True),\n    _makeTypeOps(\"TRUEDIV\", \"BYTES\", include_nbool=True),\n    _makeNonContainerMathOps(\"TRUEDIV\"),\n)\n\nspecialized_olddiv_helpers_set = _makeDivOps(\"OLDDIV\", in_place=False)\n\nnonspecialized_olddiv_helpers_set = OrderedSet(\n    helper.replace(\"TRUEDIV\", \"OLDDIV\") for helper in nonspecialized_truediv_helpers_set\n)\n\nspecialized_floordiv_helpers_set = _makeDivOps(\"FLOORDIV\", in_place=False)\n\nnonspecialized_floordiv_helpers_set = OrderedSet(\n    helper.replace(\"TRUEDIV\", \"FLOORDIV\")\n    for helper in nonspecialized_truediv_helpers_set\n)\n\n\ndef _makeModOps(in_place):\n    def _makeFormatOps(str_type_name):\n        for formatted_type_name in (\n            \"INT\",\n            \"LONG\",\n            \"FLOAT\",\n            \"STR\",\n            \"BYTES\",\n            \"UNICODE\",\n            \"TUPLE\",\n            \"LIST\",\n            \"DICT\",\n            \"OBJECT\",\n        ):\n            if str_type_name == \"STR\" and formatted_type_name == \"BYTES\":\n                continue\n            if str_type_name == \"BYTES\" and formatted_type_name in (\"STR\", \"INT\"):\n                continue\n\n            if in_place:\n                yield \"INPLACE_OPERATION_MOD_%s_%s\" % (\n                    str_type_name,\n                    formatted_type_name,\n                )\n            else:\n                yield \"BINARY_OPERATION_MOD_OBJECT_%s_%s\" % (\n                    str_type_name,\n                    formatted_type_name,\n                )\n\n    return buildOrderedSet(\n        _makeNumberOps(\"MOD\", include_nbool=True, in_place=in_place),\n        # These are friends naturally, they mod with another\n        _makeFriendOps(\"MOD\", True, in_place, \"INT\", \"LONG\", \"FLOAT\"),\n        # String interpolation:\n        _makeFormatOps(str_type_name=\"STR\"),\n        _makeFormatOps(str_type_name=\"UNICODE\"),\n        _makeFormatOps(str_type_name=\"BYTES\"),\n        _makeDefaultOps(\"MOD\", include_nbool=True, in_place=in_place),\n    )\n\n\nspecialized_mod_helpers_set = _makeModOps(in_place=False)\n\nnonspecialized_mod_helpers_set = buildOrderedSet(\n    (\n        \"BINARY_OPERATION_MOD_OBJECT_TUPLE_OBJECT\",\n        \"BINARY_OPERATION_MOD_OBJECT_LIST_OBJECT\",\n        # String formatting with STR:\n        \"BINARY_OPERATION_MOD_NBOOL_STR_INT\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_LONG\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_FLOAT\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_STR\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_UNICODE\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_TUPLE\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_LIST\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_DICT\",\n        \"BINARY_OPERATION_MOD_NBOOL_STR_OBJECT\",\n        # String formatting with UNICODE:\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_INT\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_LONG\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_FLOAT\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_STR\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_BYTES\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_UNICODE\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_TUPLE\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_LIST\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_DICT\",\n        \"BINARY_OPERATION_MOD_NBOOL_UNICODE_OBJECT\",\n    )\n)\n\nspecialized_imod_helpers_set = _makeModOps(in_place=True)\n\nnonspecialized_imod_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_mod_helpers_set\n)\n\n\ndef _makeBitOps(op_name, in_place):\n    return buildOrderedSet(\n        _makeTypeOps(op_name, \"LONG\", include_nbool=True, in_place=in_place),\n        _makeTypeOps(op_name, \"INT\", include_nbool=True, in_place=in_place),\n        _makeFriendOps(op_name, True, in_place, \"INT\", \"CLONG\"),\n        _makeFriendOps(op_name, True, in_place, \"INT\", \"LONG\"),\n        _makeTypeOps(op_name, \"SET\", include_nbool=False, in_place=in_place),\n        _makeDefaultOps(op_name, include_nbool=True, in_place=in_place),\n    )\n\n\nspecialized_bitor_helpers_set = _makeBitOps(\"BITOR\", in_place=False)\n\nnonspecialized_bitor_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"BITOR\", \"FLOAT\", include_nbool=True),\n    _makeNonContainerMathOps(\"BITOR\"),\n    _makeTypeOps(\"BITOR\", \"UNICODE\", include_nbool=True),\n    _makeTypeOps(\"BITOR\", \"STR\", include_nbool=True),\n    _makeTypeOps(\"BITOR\", \"BYTES\", include_nbool=True),\n)\n\nspecialized_bitand_helpers_set = _makeBitOps(\"BITAND\", in_place=False)\nnonspecialized_bitand_helpers_set = OrderedSet(\n    helper.replace(\"_BITOR_\", \"_BITAND_\") for helper in nonspecialized_bitor_helpers_set\n)\nspecialized_bitxor_helpers_set = _makeBitOps(\"BITXOR\", in_place=False)\n\nnonspecialized_bitxor_helpers_set = OrderedSet(\n    helper.replace(\"_BITOR_\", \"_BITXOR_\") for helper in nonspecialized_bitor_helpers_set\n)\n\n\ndef _makeShiftOps(op_name, in_place):\n    return buildOrderedSet(\n        _makeTypeOps(op_name, \"LONG\", include_nbool=True, in_place=in_place),\n        _makeTypeOps(op_name, \"INT\", include_nbool=True, in_place=in_place),\n        _makeFriendOps(op_name, True, in_place, \"INT\", \"LONG\"),\n        _makeDefaultOps(op_name, include_nbool=True, in_place=in_place),\n    )\n\n\nspecialized_lshift_helpers_set = _makeShiftOps(\"LSHIFT\", in_place=False)\n\nnonspecialized_lshift_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"LSHIFT\", \"FLOAT\", include_nbool=True),\n    _makeNonContainerMathOps(\"LSHIFT\"),\n)\nspecialized_rshift_helpers_set = _makeShiftOps(\"RSHIFT\", in_place=False)\n\nnonspecialized_rshift_helpers_set = OrderedSet(\n    helper.replace(\"_LSHIFT_\", \"_RSHIFT_\")\n    for helper in nonspecialized_lshift_helpers_set\n)\n\n\nspecialized_pow_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"POW\", \"FLOAT\", include_nbool=False),\n    _makeTypeOps(\"POW\", \"LONG\", include_nbool=False),\n    _makeTypeOps(\"POW\", \"INT\", include_nbool=False),\n    _makeFriendOps(\"POW\", False, False, \"INT\", \"LONG\", \"FLOAT\"),\n    _makeDefaultOps(\"POW\", include_nbool=True),\n    (\n        # Float is used by other types for ** operations.\n        # TODO: Enable these later.\n        #        \"BINARY_OPERATION_POW_OBJECT_LONG_FLOAT\",\n        #        \"BINARY_OPERATION_POW_NBOOL_LONG_FLOAT\",\n    ),\n)\nnonspecialized_pow_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"POW\", \"STR\", include_nbool=True),\n    _makeTypeOps(\"POW\", \"UNICODE\", include_nbool=True),\n    _makeTypeOps(\"POW\", \"BYTES\", include_nbool=True),\n    _makeNonContainerMathOps(\"POW\"),\n)\n\n\nspecialized_divmod_helpers_set = _makeDivOps(\"DIVMOD\", in_place=False)\n\nnonspecialized_divmod_helpers_set = buildOrderedSet(\n    _makeTypeOpsNbool(\"DIVMOD\", \"INT\"),\n    _makeTypeOpsNbool(\"DIVMOD\", \"LONG\"),\n    _makeTypeOpsNbool(\"DIVMOD\", \"FLOAT\"),\n    _makeTypeOps(\"DIVMOD\", \"UNICODE\", include_nbool=True),\n    _makeTypeOps(\"DIVMOD\", \"STR\", include_nbool=True),\n    _makeTypeOps(\"DIVMOD\", \"BYTES\", include_nbool=True),\n    _makeNonContainerMathOps(\"DIVMOD\"),\n)\n\nspecialized_matmult_helpers_set = buildOrderedSet(\n    _makeTypeOps(\"MATMULT\", \"LONG\", include_nbool=False),\n    _makeTypeOps(\"MATMULT\", \"FLOAT\", include_nbool=False),\n    _makeDefaultOps(\"MATMULT\", include_nbool=False),\n)\n\nnonspecialized_matmult_helpers_set = buildOrderedSet(\n    _makeTypeOpsNbool(\"MATMULT\", \"LONG\"),\n    _makeTypeOpsNbool(\"MATMULT\", \"FLOAT\"),\n    _makeTypeOps(\"MATMULT\", \"TUPLE\", include_nbool=True),\n    _makeTypeOps(\"MATMULT\", \"LIST\", include_nbool=True),\n    _makeTypeOps(\"MATMULT\", \"DICT\", include_nbool=True),\n    _makeTypeOps(\"MATMULT\", \"BYTES\", include_nbool=True),\n    _makeTypeOps(\"MATMULT\", \"UNICODE\", include_nbool=True),\n)\n\nspecialized_iadd_helpers_set = buildOrderedSet(\n    _makeAddOps(in_place=True),\n    (\"INPLACE_OPERATION_ADD_LIST_TUPLE\",),\n)\nnonspecialized_iadd_helpers_set = buildOrderedSet(\n    deriveInplaceFromBinaryOperations(nonspecialized_add_helpers_set),\n    (\n        \"INPLACE_OPERATION_ADD_LIST_STR\",\n        \"INPLACE_OPERATION_ADD_LIST_BYTES\",\n        \"INPLACE_OPERATION_ADD_LIST_BYTEARRAY\",\n        \"INPLACE_OPERATION_ADD_LIST_UNICODE\",\n        \"INPLACE_OPERATION_ADD_LIST_SET\",  # semi useful only\n        \"INPLACE_OPERATION_ADD_LIST_FROZENSET\",\n        \"INPLACE_OPERATION_ADD_LIST_DICT\",\n    ),\n)\n\nspecialized_isub_helpers_set = makeSubOps(in_place=True)\n\nnonspecialized_isub_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_sub_helpers_set\n)\n\nspecialized_imult_helpers_set = _makeMultOps(in_place=True)\n\nnonspecialized_imult_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_mult_helpers_set\n)\n\nspecialized_ibitor_helpers_set = _makeBitOps(\"BITOR\", in_place=True)\n\nnonspecialized_ibitor_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_bitor_helpers_set\n)\n\nspecialized_ibitand_helpers_set = _makeBitOps(\"BITAND\", in_place=True)\n\nnonspecialized_ibitand_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_bitand_helpers_set\n)\n\nspecialized_ibitxor_helpers_set = _makeBitOps(\"BITXOR\", in_place=True)\n\nnonspecialized_ibitxor_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_bitxor_helpers_set\n)\n\nspecialized_ilshift_helpers_set = deriveInplaceFromBinaryOperations(\n    specialized_lshift_helpers_set\n)\n\nnonspecialized_ilshift_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_lshift_helpers_set\n)\n\nspecialized_irshift_helpers_set = deriveInplaceFromBinaryOperations(\n    specialized_rshift_helpers_set\n)\n\nnonspecialized_irshift_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_rshift_helpers_set\n)\n\nspecialized_ifloordiv_helpers_set = _makeDivOps(\"FLOORDIV\", in_place=True)\n\nnonspecialized_ifloordiv_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_floordiv_helpers_set\n)\n\nspecialized_itruediv_helpers_set = _makeDivOps(\"TRUEDIV\", in_place=True)\n\nnonspecialized_itruediv_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_truediv_helpers_set\n)\n\nspecialized_iolddiv_helpers_set = _makeDivOps(\"OLDDIV\", in_place=True)\n\nnonspecialized_iolddiv_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_olddiv_helpers_set\n)\n\nspecialized_ipow_helpers_set = deriveInplaceFromBinaryOperations(\n    specialized_pow_helpers_set\n)\n\nnonspecialized_ipow_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_pow_helpers_set\n)\n\nspecialized_imatmult_helpers_set = deriveInplaceFromBinaryOperations(\n    specialized_matmult_helpers_set\n)\n\nnonspecialized_imatmult_helpers_set = deriveInplaceFromBinaryOperations(\n    nonspecialized_matmult_helpers_set\n)\n\n\ndef getSpecializedBinaryOperations(operator):\n    return globals()[\"specialized_%s_helpers_set\" % operator.lower()]\n\n\ndef getNonSpecializedBinaryOperations(operator):\n    return globals()[\"nonspecialized_%s_helpers_set\" % operator.lower()]\n\n\ndef getCodeNameForBinaryOperation(operator):\n    return operator[1:].upper() if operator[0] == \"I\" else operator.upper()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/BranchCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Branch related codes.\n\n\"\"\"\n\nfrom .CodeHelpers import generateStatementSequenceCode\nfrom .ConditionalCodes import generateConditionCode\nfrom .Emission import withSubCollector\nfrom .LabelCodes import getGotoCode, getLabelCode\n\n\ndef generateBranchCode(statement, emit, context):\n    true_target = context.allocateLabel(\"branch_yes\")\n    false_target = context.allocateLabel(\"branch_no\")\n    end_target = context.allocateLabel(\"branch_end\")\n\n    old_true_target = context.getTrueBranchTarget()\n    old_false_target = context.getFalseBranchTarget()\n\n    context.setTrueBranchTarget(true_target)\n    context.setFalseBranchTarget(false_target)\n\n    # Have own declaration scope for condition, to limit visibility from branches\n    # which can be huge.\n    with withSubCollector(emit, context) as condition_emit:\n        generateConditionCode(\n            condition=statement.subnode_condition, emit=condition_emit, context=context\n        )\n\n    context.setTrueBranchTarget(old_true_target)\n    context.setFalseBranchTarget(old_false_target)\n\n    getLabelCode(true_target, emit)\n\n    generateStatementSequenceCode(\n        statement_sequence=statement.subnode_yes_branch, emit=emit, context=context\n    )\n\n    if statement.subnode_no_branch is not None:\n        getGotoCode(end_target, emit)\n        getLabelCode(false_target, emit)\n\n        generateStatementSequenceCode(\n            statement_sequence=statement.subnode_no_branch, emit=emit, context=context\n        )\n\n        getLabelCode(end_target, emit)\n    else:\n        getLabelCode(false_target, emit)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/BuiltinCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in codes\n\nThis is code generation for built-in references, and some built-ins like range,\nbin, etc.\n\"\"\"\n\nfrom nuitka import Builtins\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import (\n    getAssertionCode,\n    getErrorExitBoolCode,\n    getErrorExitCode,\n)\nfrom .PythonAPICodes import generateCAPIObjectCode\n\n\ndef generateBuiltinAbsCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_ABS\",\n        tstate=False,\n        arg_desc=((\"abs_arg\", expression.subnode_operand),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinRefCode(to_name, expression, emit, context):\n    builtin_name = expression.getBuiltinName()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"builtin_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = LOOKUP_BUILTIN(%s);\"\n            % (value_name, context.getConstantCode(constant=builtin_name))\n        )\n\n        getAssertionCode(check=\"%s != NULL\" % value_name, emit=emit)\n\n        # Gives no reference\n\n\ndef generateBuiltinAnonymousRefCode(to_name, expression, emit, context):\n    builtin_name = expression.getBuiltinName()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"builtin_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = (PyObject *)%s;\"\n            % (value_name, Builtins.builtin_anon_codes[builtin_name])\n        )\n\n\ndef generateBuiltinType1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_TYPE1\",\n        tstate=False,\n        arg_desc=((\"type_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinType3Code(to_name, expression, emit, context):\n    type_name, bases_name, dict_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"type3_result\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = BUILTIN_TYPE3(tstate, %s, %s, %s, %s);\"\n            % (\n                value_name,\n                context.getConstantCode(constant=context.getModuleName().asString()),\n                type_name,\n                bases_name,\n                dict_name,\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(type_name, bases_name, dict_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateBuiltinInputCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_INPUT\",\n        tstate=True,\n        arg_desc=((\"input_arg\", expression.subnode_prompt),),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        none_null=True,\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinOpenCode(to_name, expression, emit, context):\n    arg_desc = (\n        (\"open_filename\", expression.subnode_filename),\n        (\"open_mode\", expression.subnode_mode),\n        (\"open_buffering\", expression.subnode_buffering),\n    )\n\n    if python_version >= 0x300:\n        arg_desc += (\n            (\"open_encoding\", expression.subnode_encoding),\n            (\"open_errors\", expression.subnode_errors),\n            (\"open_newline\", expression.subnode_newline),\n            (\"open_closefd\", expression.subnode_closefd),\n            (\"open_opener\", expression.subnode_opener),\n        )\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_OPEN\",\n        tstate=True,\n        arg_desc=arg_desc,\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        none_null=True,\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinSum1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_SUM1\",\n        tstate=True,\n        arg_desc=((\"sum_sequence\", expression.subnode_sequence),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinSum2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_SUM2\",\n        tstate=True,\n        arg_desc=(\n            (\"sum_sequence\", expression.subnode_sequence),\n            (\"sum_start\", expression.subnode_start),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinRange1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_RANGE\",\n        tstate=True,\n        arg_desc=((\"range_arg\", expression.subnode_low),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinRange2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_RANGE2\",\n        tstate=True,\n        arg_desc=(\n            (\"range2_low\", expression.subnode_low),\n            (\"range2_high\", expression.subnode_high),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinRange3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_RANGE3\",\n        tstate=True,\n        arg_desc=(\n            (\"range3_low\", expression.subnode_low),\n            (\"range3_high\", expression.subnode_high),\n            (\"range3_step\", expression.subnode_step),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinXrange1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_XRANGE1\",\n        tstate=True,\n        arg_desc=((\"xrange_low\", expression.subnode_low),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n        none_null=True,\n    )\n\n\ndef generateBuiltinXrange2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_XRANGE2\",\n        tstate=True,\n        arg_desc=(\n            (\"xrange_low\", expression.subnode_low),\n            (\"xrange_high\", expression.subnode_high),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n        none_null=True,\n    )\n\n\ndef generateBuiltinXrange3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_XRANGE3\",\n        tstate=True,\n        arg_desc=(\n            (\"xrange_low\", expression.subnode_low),\n            (\"xrange_high\", expression.subnode_high),\n            (\"xrange_step\", expression.subnode_step),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n        none_null=True,\n    )\n\n\ndef generateBuiltinFloatCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"TO_FLOAT\",\n        tstate=False,\n        arg_desc=((\"float_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinComplex1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_COMPLEX1\",\n        tstate=True,\n        arg_desc=((\"real_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinComplex2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_COMPLEX2\",\n        tstate=True,\n        arg_desc=(\n            (\"real_arg\", expression.subnode_real),\n            (\"imag_arg\", expression.subnode_imag),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinBoolCode(to_name, expression, emit, context):\n    (arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = CHECK_IF_TRUE(%s);\" % (res_name, arg_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_name=arg_name,\n        needs_check=expression.subnode_value.mayRaiseExceptionBool(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n    )\n\n\ndef generateBuiltinBinCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_BIN\",\n        tstate=False,\n        arg_desc=((\"bin_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinOctCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_OCT\",\n        tstate=True,\n        arg_desc=((\"oct_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinHexCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_HEX\",\n        tstate=True,\n        arg_desc=((\"hex_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinBytearray1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_BYTEARRAY1\",\n        tstate=False,\n        arg_desc=((\"bytearray_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinBytearray3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_BYTEARRAY3\",\n        tstate=True,\n        arg_desc=(\n            (\"bytearray_string\", expression.subnode_string),\n            (\"bytearray_encoding\", expression.subnode_encoding),\n            (\"bytearray_errors\", expression.subnode_errors),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinStaticmethodCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_STATICMETHOD\",\n        tstate=True,\n        arg_desc=((\"staticmethod_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinClassmethodCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_CLASSMETHOD\",\n        tstate=True,\n        arg_desc=((\"classmethod_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef getBuiltinCallViaSpecCode(spec, to_name, called_name, expression, emit, context):\n    arg_value_names = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"%s_result\" % spec.name.replace(\".\", \"_\"), expression, emit, context\n    ) as value_name:\n        emit(\n            \"\"\"\\\n{\n    PyObject *args[] = {%(arg_value_names)s};\n    char const *arg_names[] = {%(arg_names)s};\n\n    %(to_name)s = CALL_BUILTIN_KW_ARGS(tstate, %(called_name)s, args, arg_names, sizeof(args) / sizeof(PyObject *));\n}\n\"\"\"\n            % {\n                \"to_name\": value_name,\n                \"called_name\": called_name,\n                \"arg_names\": \",\".join(\n                    '\"%s\"' % arg_name for arg_name in spec.getArgumentNames()\n                ),\n                \"arg_value_names\": \",\".join(\n                    (str(arg_value_name) if arg_value_name else \"NULL\")\n                    for arg_value_name in arg_value_names\n                ),\n            }\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=[called_name] + list(arg_value_names),\n            emit=emit,\n            context=context,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CallCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for calls.\n\nThe different kinds of calls get dedicated code. Most notable, calls with\nonly positional arguments, are attempted through helpers that might be\nable to execute them without creating the argument dictionary at all.\n\n\"\"\"\n\nfrom nuitka.Constants import isMutable\nfrom nuitka.utils.Jinja2 import getTemplateC\n\nfrom .CodeHelpers import (\n    generateChildExpressionCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode\nfrom .LineNumberCodes import emitLineNumberUpdateCode\nfrom .templates.CodeTemplatesModules import (\n    template_header_guard,\n    template_helper_impl_decl,\n)\n\n\ndef _generateCallCodePosOnly(\n    to_name, expression, called_name, called_attribute_name, emit, context\n):\n    # We have many variants for this to deal with, pylint: disable=too-many-branches\n\n    assert called_name is not None\n    # TODO: Not yet specialized for method calls.\n    # assert called_attribute_name is None\n\n    call_args = expression.subnode_args\n\n    if call_args is None or call_args.isExpressionConstantRef():\n        context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n        if call_args is not None:\n            call_args_value = call_args.getCompileTimeConstant()\n        else:\n            call_args_value = ()\n\n        assert type(call_args_value) is tuple\n\n        if call_args is not None and call_args.isMutable():\n            call_arg_names = []\n\n            for call_arg_element in call_args_value:\n                call_arg_name = context.allocateTempName(\"call_arg_element\")\n\n                call_arg_name.getCType().emitAssignmentCodeFromConstant(\n                    to_name=call_arg_name,\n                    constant=call_arg_element,\n                    may_escape=True,\n                    emit=emit,\n                    context=context,\n                )\n\n                call_arg_names.append(call_arg_name)\n\n            if called_attribute_name is None:\n                getCallCodePosArgsQuick(\n                    to_name=to_name,\n                    called_name=called_name,\n                    arg_names=call_arg_names,\n                    expression=expression,\n                    emit=emit,\n                    context=context,\n                )\n            else:\n                _getInstanceCallCodePosArgsQuick(\n                    to_name=to_name,\n                    called_name=called_name,\n                    called_attribute_name=called_attribute_name,\n                    expression=expression,\n                    arg_names=call_arg_names,\n                    emit=emit,\n                    context=context,\n                )\n        elif call_args_value:\n            if called_attribute_name is None:\n                _getCallCodeFromTuple(\n                    to_name=to_name,\n                    called_name=called_name,\n                    expression=expression,\n                    args_value=call_args_value,\n                    emit=emit,\n                    context=context,\n                )\n            else:\n                _getInstanceCallCodeFromTuple(\n                    to_name=to_name,\n                    called_name=called_name,\n                    called_attribute_name=called_attribute_name,\n                    expression=expression,\n                    arg_tuple=context.getConstantCode(constant=call_args_value),\n                    arg_size=len(call_args_value),\n                    emit=emit,\n                    context=context,\n                )\n        else:\n            if called_attribute_name is None:\n                getCallCodeNoArgs(\n                    to_name=to_name,\n                    called_name=called_name,\n                    expression=expression,\n                    emit=emit,\n                    context=context,\n                )\n            else:\n                _getInstanceCallCodeNoArgs(\n                    to_name=to_name,\n                    called_name=called_name,\n                    called_attribute_name=called_attribute_name,\n                    expression=expression,\n                    emit=emit,\n                    context=context,\n                )\n    elif call_args.isExpressionMakeTuple():\n        call_arg_names = []\n\n        for call_arg_element in call_args.subnode_elements:\n            call_arg_name = generateChildExpressionCode(\n                child_name=call_args.getChildName() + \"_element\",\n                expression=call_arg_element,\n                emit=emit,\n                context=context,\n            )\n\n            call_arg_names.append(call_arg_name)\n\n        if called_attribute_name is None:\n            getCallCodePosArgsQuick(\n                to_name=to_name,\n                called_name=called_name,\n                expression=expression,\n                arg_names=call_arg_names,\n                emit=emit,\n                context=context,\n            )\n        else:\n            _getInstanceCallCodePosArgsQuick(\n                to_name=to_name,\n                called_name=called_name,\n                called_attribute_name=called_attribute_name,\n                expression=expression,\n                arg_names=call_arg_names,\n                emit=emit,\n                context=context,\n            )\n    else:\n        args_name = generateChildExpressionCode(\n            expression=call_args, emit=emit, context=context\n        )\n\n        context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n        if called_attribute_name is None:\n            _getCallCodePosArgs(\n                to_name=to_name,\n                called_name=called_name,\n                expression=expression,\n                args_name=args_name,\n                emit=emit,\n                context=context,\n            )\n        else:\n            _getInstanceCallCodePosArgs(\n                to_name=to_name,\n                called_name=called_name,\n                called_attribute_name=called_attribute_name,\n                expression=expression,\n                args_name=args_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef _getCallCodeKwSplitFromConstant(\n    to_name, expression, call_kw, called_name, called_attribute_name, emit, context\n):\n    assert called_name is not None\n    # TODO: Not yet specialized for method calls.\n    assert called_attribute_name is None\n\n    kw_items = tuple(call_kw.getCompileTimeConstant().items())\n\n    values = tuple(item[1] for item in kw_items)\n    kw_names = tuple(item[0] for item in kw_items)\n\n    if isMutable(values):\n        args_kwsplit_name = context.allocateTempName(\"call_args_kwsplit\")\n\n        args_kwsplit_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=args_kwsplit_name,\n            constant=values,\n            may_escape=True,\n            emit=emit,\n            context=context,\n        )\n        split_name = args_kwsplit_name\n    else:\n        args_kwsplit_name = context.getConstantCode(values)\n        split_name = None\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"\"\"%s = CALL_FUNCTION_WITH_NO_ARGS_KWSPLIT(tstate, %s, &PyTuple_GET_ITEM(%s, 0), %s);\"\"\"\n        % (\n            to_name,\n            called_name,\n            args_kwsplit_name,\n            context.getConstantCode(kw_names),\n        )\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, split_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getCallCodeKwSplit(\n    to_name, called_name, kw_names, dict_value_names, needs_check, emit, context\n):\n    emit(\n        \"\"\"\\\n{\n    PyObject *kw_values[%(kw_size)d] = {%(kw_value_names)s};\n\n    %(to_name)s = CALL_FUNCTION_WITH_NO_ARGS_KWSPLIT(tstate, %(called_name)s, kw_values, %(kw_names)s);\n}\n\"\"\"\n        % {\n            \"to_name\": to_name,\n            \"kw_value_names\": \", \".join(\n                str(dict_value_name) for dict_value_name in dict_value_names\n            ),\n            \"kw_size\": len(kw_names),\n            \"called_name\": called_name,\n            \"kw_names\": context.getConstantCode(tuple(kw_names)),\n        }\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name,) + tuple(dict_value_names),\n        needs_check=needs_check,\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getCallCodeKwPairs(\n    to_name,\n    expression,\n    pairs,\n    called_name,\n    called_attribute_name,\n    emit,\n    context,\n):\n    assert called_name is not None\n    # TODO: Not yet specialized for method calls.\n    assert called_attribute_name is None\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    kw_names = []\n\n    dict_value_names = []\n\n    for count, pair in enumerate(pairs):\n        kw_names.append(pair.getKeyCompileTimeConstant())\n\n        dict_value_name = context.allocateTempName(\"kw_call_value_%d\" % count)\n\n        # TODO: Need to make it easier to generator constant values here without\n        # going through nodes.\n        generateExpressionCode(\n            to_name=dict_value_name,\n            expression=pair.getValueNode(),\n            emit=emit,\n            context=context,\n            allow_none=False,\n        )\n\n        dict_value_names.append(dict_value_name)\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    assert len(kw_names) == len(pairs)\n\n    if kw_names:\n        getCallCodeKwSplit(\n            to_name=to_name,\n            called_name=called_name,\n            kw_names=kw_names,\n            dict_value_names=dict_value_names,\n            needs_check=expression.mayRaiseExceptionOperation(),\n            emit=emit,\n            context=context,\n        )\n    else:\n        # This is called on generic pairs in some cases. TODO: Make passing expression and needs_check propagate more up.\n        getCallCodeNoArgs(\n            to_name=to_name,\n            called_name=called_name,\n            expression=expression,\n            emit=emit,\n            context=context,\n        )\n\n\ndef _generateCallCodeKwDict(\n    to_name, expression, call_kw, called_name, called_attribute_name, emit, context\n):\n    assert called_name is not None\n    # TODO: Not yet specialized for method calls.\n    assert called_attribute_name is None\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    kw_dict_name = context.allocateTempName(\"kw_dict\")\n\n    generateExpressionCode(\n        to_name=kw_dict_name,\n        expression=call_kw,\n        emit=emit,\n        context=context,\n        allow_none=False,\n    )\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"\"\"\\\n%(to_name)s = CALL_FUNCTION_WITH_KEYARGS(tstate, %(called_name)s, %(kw_dict_name)s);\n\"\"\"\n        % {\n            \"to_name\": to_name,\n            \"kw_dict_name\": kw_dict_name,\n            \"called_name\": called_name,\n        }\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, kw_dict_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateCallCode(to_name, expression, emit, context):\n    # There is a whole lot of different cases, for each of which, we create\n    # optimized code, constant, with and without positional or keyword arguments\n    # each, so there is lots of branches involved.\n\n    called = expression.subnode_called\n    call_kw = expression.subnode_kwargs\n    call_args = expression.subnode_args\n\n    # TODO: Make this work for all cases. Currently, the method calls that do\n    # a combined lookup and call, do a re-ordering of things, and therefore it\n    # must be disabled until this is solved.\n    if (\n        called.isExpressionAttributeLookup()\n        and not called.isExpressionAttributeLookupSpecial()\n        and called.getAttributeName() not in (\"__class__\", \"__dict__\")\n        and (\n            call_args is None\n            or not call_args.mayHaveSideEffects()\n            or not called.mayHaveSideEffects()\n        )\n        and call_kw is None\n    ):\n        called_name = context.allocateTempName(\"called_instance\")\n        generateExpressionCode(\n            to_name=called_name,\n            expression=called.subnode_expression,\n            emit=emit,\n            context=context,\n        )\n\n        called_attribute_name = context.getConstantCode(\n            constant=called.getAttributeName()\n        )\n    else:\n        called_attribute_name = None\n\n        called_name = generateChildExpressionCode(\n            expression=called, emit=emit, context=context\n        )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"call_result\", expression, emit, context\n    ) as result_name:\n        if call_kw is None or call_kw.isExpressionConstantDictEmptyRef():\n            _generateCallCodePosOnly(\n                to_name=result_name,\n                called_name=called_name,\n                called_attribute_name=called_attribute_name,\n                expression=expression,\n                emit=emit,\n                context=context,\n            )\n        else:\n            call_args = expression.subnode_args\n\n            if call_args is None or call_args.isExpressionConstantTupleEmptyRef():\n                if call_kw.isExpressionConstantDictRef():\n                    # Optimization should have turned that into a raise exception.\n                    assert call_kw.isMappingWithConstantStringKeys()\n\n                    _getCallCodeKwSplitFromConstant(\n                        to_name=result_name,\n                        called_name=called_name,\n                        called_attribute_name=called_attribute_name,\n                        expression=expression,\n                        call_kw=call_kw,\n                        emit=emit,\n                        context=context,\n                    )\n                elif (\n                    call_kw.isExpressionMakeDict()\n                    and call_kw.isMappingWithConstantStringKeys()\n                ):\n                    getCallCodeKwPairs(\n                        to_name=result_name,\n                        called_name=called_name,\n                        called_attribute_name=called_attribute_name,\n                        expression=expression,\n                        pairs=call_kw.subnode_pairs,\n                        emit=emit,\n                        context=context,\n                    )\n                else:\n                    # TODO: Still a very slow path.\n                    _generateCallCodeKwDict(\n                        to_name=result_name,\n                        called_name=called_name,\n                        called_attribute_name=called_attribute_name,\n                        expression=expression,\n                        call_kw=call_kw,\n                        emit=emit,\n                        context=context,\n                    )\n            else:\n                if (\n                    call_kw.isExpressionConstantDictRef()\n                    and call_args.isExpressionConstantTupleRef()\n                ):\n                    # Both are constant, merge values into one tuple and pass it on.\n                    _getCallCodePosConstantKeywordConstArgs(\n                        to_name=result_name,\n                        called_name=called_name,\n                        expression=expression,\n                        call_args=call_args,\n                        call_kw=call_kw,\n                        emit=emit,\n                        context=context,\n                    )\n                elif (\n                    call_kw.isExpressionMakeDict()\n                    and call_args.isExpressionConstantTupleRef()\n                ):\n                    # Only positional args are constant, create tuple and split keyword values.\n                    _getCallCodePosConstKeywordVariableArgs(\n                        to_name=result_name,\n                        called_name=called_name,\n                        expression=expression,\n                        call_args=call_args,\n                        call_kw=call_kw,\n                        emit=emit,\n                        context=context,\n                    )\n                elif (\n                    call_kw.isExpressionMakeDict() and call_args.isExpressionMakeTuple()\n                ):\n                    # None are constant, pass as args array split keyword values.\n                    getCallCodePosVariableKeywordVariableArgs(\n                        to_name=result_name,\n                        expression=expression,\n                        called_name=called_name,\n                        call_args=call_args.subnode_elements,\n                        pairs=call_kw.subnode_pairs,\n                        emit=emit,\n                        context=context,\n                    )\n                else:\n                    # Otherwise, pass as tuple and dict\n\n                    call_args_name = generateChildExpressionCode(\n                        expression=call_args, emit=emit, context=context\n                    )\n\n                    call_kw_name = generateChildExpressionCode(\n                        expression=call_kw, emit=emit, context=context\n                    )\n\n                    context.setCurrentSourceCodeReference(\n                        expression.getCompatibleSourceReference()\n                    )\n\n                    _getCallCodePosKeywordArgs(\n                        to_name=result_name,\n                        called_name=called_name,\n                        expression=expression,\n                        call_args_name=call_args_name,\n                        call_kw_name=call_kw_name,\n                        emit=emit,\n                        context=context,\n                    )\n\n\ndef getCallCodeNoArgs(to_name, called_name, expression, emit, context):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\"%s = CALL_FUNCTION_NO_ARGS(tstate, %s);\" % (to_name, called_name))\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_name=called_name,\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getInstanceCallCodeNoArgs(\n    to_name, called_name, called_attribute_name, expression, emit, context\n):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"%s = CALL_METHOD_NO_ARGS(tstate, %s, %s);\"\n        % (to_name, called_name, called_attribute_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, called_attribute_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\nquick_calls_used = set()\nquick_tuple_calls_used = set()\nquick_instance_calls_used = set()\nquick_mixed_calls_used = set()\n\n\ndef _getInstanceCallCodePosArgsQuick(\n    to_name,\n    called_name,\n    called_attribute_name,\n    expression,\n    arg_names,\n    emit,\n    context,\n):\n    arg_size = len(arg_names)\n\n    # For 0 arguments, NOARGS is supposed to be used.\n    assert arg_size > 0\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    # For one argument, we have a dedicated helper function that might\n    # be more efficient.\n    if arg_size == 1:\n        emit(\n            \"\"\"%s = CALL_METHOD_WITH_SINGLE_ARG(tstate, %s, %s, %s);\"\"\"\n            % (to_name, called_name, called_attribute_name, arg_names[0])\n        )\n    else:\n        quick_instance_calls_used.add(arg_size)\n\n        emit(\n            \"\"\"\\\n{\n    PyObject *call_args[] = {%(call_args)s};\n    %(to_name)s = CALL_METHOD_WITH_ARGS%(arg_size)d(\n        tstate,\n        %(called_name)s,\n        %(called_attribute_name)s,\n        call_args\n    );\n}\n\"\"\"\n            % {\n                \"call_args\": \", \".join(str(arg_name) for arg_name in arg_names),\n                \"to_name\": to_name,\n                \"arg_size\": arg_size,\n                \"called_name\": called_name,\n                \"called_attribute_name\": called_attribute_name,\n            }\n        )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=[called_name] + arg_names,\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getCallCodePosArgsQuick(to_name, called_name, arg_names, expression, emit, context):\n    arg_size = len(arg_names)\n\n    # For 0 arguments, NOARGS is supposed to be used.\n    assert arg_size > 0\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    # For one argument, we have a dedicated helper function that might\n    # be more efficient.\n    if arg_size == 1:\n        emit(\n            \"\"\"%s = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, %s, %s);\"\"\"\n            % (to_name, called_name, arg_names[0])\n        )\n    else:\n        quick_calls_used.add(arg_size)\n\n        emit(\n            \"\"\"\\\n{\n    PyObject *call_args[] = {%s};\n    %s = CALL_FUNCTION_WITH_ARGS%d(tstate, %s, call_args);\n}\n\"\"\"\n            % (\n                \", \".join(str(arg_name) for arg_name in arg_names),\n                to_name,\n                arg_size,\n                called_name,\n            )\n        )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=[called_name] + list(arg_names),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getInstanceCallCodeFromTuple(\n    to_name,\n    called_name,\n    called_attribute_name,\n    expression,\n    arg_tuple,\n    arg_size,\n    emit,\n    context,\n):\n    quick_instance_calls_used.add(arg_size)\n\n    # For 0 arguments, NOARGS is supposed to be used.\n    assert arg_size > 0\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    if arg_size == 1:\n        template = \"\"\"\\\n%(to_name)s = CALL_METHOD_WITH_SINGLE_ARG(\n    tstate,\n    %(called_name)s,\n    %(called_attribute_name)s,\n    PyTuple_GET_ITEM(%(arg_tuple)s, 0)\n);\n\"\"\"\n    else:\n        template = \"\"\"\\\n%(to_name)s = CALL_METHOD_WITH_ARGS%(arg_size)d(\n    tstate,\n    %(called_name)s,\n    %(called_attribute_name)s,\n    &PyTuple_GET_ITEM(%(arg_tuple)s, 0)\n);\n\"\"\"\n\n    emit(\n        template\n        % {\n            \"to_name\": to_name,\n            \"arg_size\": arg_size,\n            \"called_name\": called_name,\n            \"called_attribute_name\": called_attribute_name,\n            \"arg_tuple\": arg_tuple,\n        }\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, called_attribute_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getCallCodeFromTuple(to_name, called_name, expression, args_value, emit, context):\n    arg_size = len(args_value)\n\n    # For 0 arguments, NOARGS is supposed to be used.\n    assert arg_size > 0\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    # We create a tuple for the call, as this can be prepared and might have to be\n    # recreated for cases, e.g. when calling C functions, so this is a good way of\n    # having them.\n    if isMutable(args_value):\n        arg_tuple_name = context.allocateTempName(\"call_args_kwsplit\")\n\n        arg_tuple_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=arg_tuple_name,\n            constant=args_value,\n            may_escape=True,\n            emit=emit,\n            context=context,\n        )\n        args_name = arg_tuple_name\n    else:\n        arg_tuple_name = context.getConstantCode(constant=args_value)\n        args_name = None\n\n    quick_tuple_calls_used.add(arg_size)\n\n    emit(\n        \"\"\"\\\n%s = CALL_FUNCTION_WITH_POSARGS%d(tstate, %s, %s);\n\"\"\"\n        % (to_name, arg_size, called_name, arg_tuple_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, args_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getInstanceCallCodePosArgs(\n    to_name,\n    called_name,\n    called_attribute_name,\n    expression,\n    args_name,\n    emit,\n    context,\n):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"%s = CALL_METHOD_WITH_POSARGS(%s, %s, %s);\"\n        % (to_name, called_name, called_attribute_name, args_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, args_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getCallCodePosArgs(to_name, called_name, expression, args_name, emit, context):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"%s = CALL_FUNCTION_WITH_POSARGS(tstate, %s, %s);\"\n        % (to_name, called_name, args_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, args_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getCallCodePosConstKeywordVariableArgs(\n    to_name, called_name, expression, call_args, call_kw, emit, context\n):\n    # More details, pylint: disable=too-many-locals\n\n    args = call_args.getCompileTimeConstant()\n\n    kw_names = []\n\n    dict_value_names = []\n\n    for count, pair in enumerate(call_kw.subnode_pairs):\n        kw_names.append(pair.getKeyCompileTimeConstant())\n\n        dict_value_name = context.allocateTempName(\"kw_call_value_%d\" % count)\n\n        generateExpressionCode(\n            to_name=dict_value_name,\n            expression=pair.getValueNode(),\n            emit=emit,\n            context=context,\n            allow_none=False,\n        )\n\n        dict_value_names.append(dict_value_name)\n\n    args_count = len(args)\n\n    quick_mixed_calls_used.add((args_count, True, True))\n\n    if isMutable(args):\n        args_value_name = context.allocateTempName(\"call_posargs_values\")\n\n        args_value_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=args_value_name,\n            constant=args,\n            may_escape=True,\n            emit=emit,\n            context=context,\n        )\n        args_name = args_value_name\n    else:\n        args_value_name = context.getConstantCode(args)\n        args_name = None\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"\"\"\\\n{\n    PyObject *kw_values[%(kw_size)d] = {%(kw_values)s};\n    %(to_name)s = CALL_FUNCTION_WITH_POSARGS%(args_count)d_KWSPLIT(\\\ntstate, %(called_name)s, %(pos_args)s, kw_values, %(kw_names)s);\n}\n\"\"\"\n        % {\n            \"to_name\": to_name,\n            \"kw_values\": \", \".join(\n                str(dict_value_name) for dict_value_name in dict_value_names\n            ),\n            \"kw_size\": len(call_kw.subnode_pairs),\n            \"pos_args\": args_value_name,\n            \"args_count\": args_count,\n            \"called_name\": called_name,\n            \"kw_names\": context.getConstantCode(tuple(kw_names)),\n        }\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, args_name) + tuple(dict_value_names),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getCallCodePosVariableKeywordVariableArgs(\n    to_name, expression, called_name, call_args, pairs, emit, context\n):\n    # Many details for this call variant, pylint: disable=too-many-locals\n\n    kw_names = []\n\n    call_arg_names = []\n\n    for count, call_arg_element in enumerate(call_args):\n        call_arg_name = context.allocateTempName(\"kw_call_arg_value_%d\" % count)\n\n        generateExpressionCode(\n            to_name=call_arg_name,\n            expression=call_arg_element,\n            emit=emit,\n            context=context,\n        )\n\n        call_arg_names.append(call_arg_name)\n\n    if not pairs:\n        return getCallCodePosArgsQuick(\n            to_name=to_name,\n            expression=expression,\n            called_name=called_name,\n            arg_names=call_arg_names,\n            emit=emit,\n            context=context,\n        )\n\n    dict_value_names = []\n\n    for count, pair in enumerate(pairs):\n        kw_names.append(pair.getKeyCompileTimeConstant())\n\n        dict_value_name = context.allocateTempName(\"kw_call_dict_value_%d\" % count)\n\n        generateExpressionCode(\n            to_name=dict_value_name,\n            expression=pair.getValueNode(),\n            emit=emit,\n            context=context,\n            allow_none=False,\n        )\n\n        dict_value_names.append(dict_value_name)\n\n    args_count = len(call_args)\n\n    quick_mixed_calls_used.add((args_count, False, True))\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"\"\"\\\n{\n    PyObject *args[] = {%(call_arg_names)s};\n    PyObject *kw_values[%(kw_size)d] = {%(kw_value_names)s};\n    %(to_name)s = CALL_FUNCTION_WITH_ARGS%(args_count)d_KWSPLIT(tstate, %(called_name)s, args, kw_values, %(kw_names)s);\n}\n\"\"\"\n        % {\n            \"to_name\": to_name,\n            \"called_name\": called_name,\n            \"call_arg_names\": \", \".join(\n                str(call_arg_name) for call_arg_name in call_arg_names\n            ),\n            \"kw_value_names\": \", \".join(\n                str(dict_value_name) for dict_value_name in dict_value_names\n            ),\n            \"kw_size\": len(pairs),\n            \"args_count\": args_count,\n            \"kw_names\": context.getConstantCode(tuple(kw_names)),\n        }\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name,) + tuple(call_arg_names) + tuple(dict_value_names),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getCallCodePosConstantKeywordConstArgs(\n    to_name, called_name, expression, call_args, call_kw, emit, context\n):\n    kw_items = tuple(call_kw.getCompileTimeConstant().items())\n\n    args = call_args.getCompileTimeConstant()\n\n    values = args + tuple(item[1] for item in kw_items)\n    kw_names = tuple(item[0] for item in kw_items)\n\n    arg_size = len(args)\n    quick_mixed_calls_used.add((arg_size, False, False))\n\n    if isMutable(values):\n        args_values_name = context.allocateTempName(\"call_args_values\")\n\n        args_values_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=args_values_name,\n            constant=values,\n            may_escape=True,\n            emit=emit,\n            context=context,\n        )\n        vector_name = args_values_name\n    else:\n        args_values_name = context.getConstantCode(values)\n        vector_name = None\n\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"\"\"%s = CALL_FUNCTION_WITH_ARGS%d_VECTORCALL(tstate, %s, &PyTuple_GET_ITEM(%s, 0), %s);\"\"\"\n        % (\n            to_name,\n            arg_size,\n            called_name,\n            args_values_name,\n            context.getConstantCode(kw_names),\n        )\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, vector_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getCallCodePosKeywordArgs(\n    to_name, called_name, expression, call_args_name, call_kw_name, emit, context\n):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    emit(\n        \"%s = CALL_FUNCTION(tstate, %s, %s, %s);\"\n        % (to_name, called_name, call_args_name, call_kw_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(called_name, call_args_name, call_kw_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\nmax_quick_call = 10\n\n\ndef getQuickCallCode(args_count, has_tuple_arg):\n    template = getTemplateC(\n        \"nuitka.code_generation\", \"CodeTemplateCallsPositional.c.j2\"\n    )\n    return template.render(args_count=args_count, has_tuple_arg=has_tuple_arg)\n\n\ndef getQuickMethodCallCode(args_count):\n    template = getTemplateC(\n        \"nuitka.code_generation\", \"CodeTemplateCallsMethodPositional.c.j2\"\n    )\n    return template.render(args_count=args_count)\n\n\ndef getQuickMixedCallCode(args_count, has_tuple_arg, has_dict_values):\n    template = getTemplateC(\"nuitka.code_generation\", \"CodeTemplateCallsMixed.c.j2\")\n\n    return template.render(\n        args_count=args_count,\n        has_tuple_arg=has_tuple_arg,\n        has_dict_values=has_dict_values,\n    )\n\n\ndef getQuickMethodDescriptorCallCode(args_count):\n    template = getTemplateC(\n        \"nuitka.code_generation\", \"CodeTemplateCallsPositionalMethodDescr.c.j2\"\n    )\n\n    return template.render(\n        args_count=args_count,\n    )\n\n\ndef getTemplateCodeDeclaredFunction(code):\n    code = code.strip().split(\"{\", 1)[0] + \";\"\n\n    return \"extern \" + code.replace(\" {\", \";\").replace(\"static \", \"\").replace(\n        \"inline \", \"\"\n    ).replace(\"HEDLEY_NEVER_INLINE \", \"\").replace(\"__BINARY\", \"BINARY\").replace(\n        \"_BINARY\", \"BINARY\"\n    ).replace(\n        \"__INPLACE\", \"INPLACE\"\n    ).replace(\n        \"_INPLACE\", \"INPLACE\"\n    )\n\n\ndef getCallsCode():\n    header_codes = []\n    body_codes = []\n\n    body_codes.append(template_helper_impl_decl % {})\n\n    for quick_call_used in sorted(quick_calls_used.union(quick_instance_calls_used)):\n        if quick_call_used <= max_quick_call:\n            continue\n\n        code = getQuickCallCode(args_count=quick_call_used, has_tuple_arg=False)\n        body_codes.append(code)\n        header_codes.append(getTemplateCodeDeclaredFunction(code))\n\n    for quick_tuple_call_used in sorted(quick_tuple_calls_used):\n        if quick_tuple_call_used <= max_quick_call:\n            continue\n\n        code = getQuickCallCode(args_count=quick_tuple_call_used, has_tuple_arg=True)\n        body_codes.append(code)\n        header_codes.append(getTemplateCodeDeclaredFunction(code))\n\n    for quick_mixed_call_used, has_tuple_arg, has_dict_values in sorted(\n        quick_mixed_calls_used\n    ):\n        if quick_mixed_call_used <= max_quick_call:\n            continue\n\n        code = getQuickMixedCallCode(\n            args_count=quick_mixed_call_used,\n            has_tuple_arg=has_tuple_arg,\n            has_dict_values=has_dict_values,\n        )\n        body_codes.append(code)\n        header_codes.append(getTemplateCodeDeclaredFunction(code))\n\n    for quick_instance_call_used in sorted(quick_instance_calls_used):\n        if quick_instance_call_used <= max_quick_call:\n            continue\n\n        code = getQuickMethodCallCode(args_count=quick_instance_call_used)\n\n        body_codes.append(code)\n        header_codes.append(getTemplateCodeDeclaredFunction(code))\n\n    return (\n        template_header_guard\n        % {\n            \"header_guard_name\": \"__NUITKA_CALLS_H__\",\n            \"header_body\": \"\\n\".join(header_codes),\n        },\n        \"\\n\".join(body_codes),\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ClassCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Codes for classes.\n\nMost the class specific stuff is solved in re-formulation. Only the selection\nof the metaclass remains as specific.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .AttributeCodes import getAttributeLookupCode\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode, getReleaseCode\n\n\ndef generateSelectMetaclassCode(to_name, expression, emit, context):\n    metaclass_name, bases_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # This is used for Python3 only.\n    assert python_version >= 0x300\n\n    arg_names = [metaclass_name, bases_name]\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"metaclass_result\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = SELECT_METACLASS(tstate, %s);\"\n            % (value_name, \", \".join(str(arg_name) for arg_name in arg_names))\n        )\n\n        getErrorExitCode(\n            check_name=value_name, release_names=arg_names, emit=emit, context=context\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateBuiltinSuper1Code(to_name, expression, emit, context):\n    (type_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"super_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = BUILTIN_SUPER2(tstate, moduledict_%s, %s, NULL);\"\n            % (\n                value_name,\n                context.getModuleCodeName(),\n                type_name if type_name is not None else \"NULL\",\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_name=type_name,\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateBuiltinSuperCode(to_name, expression, emit, context):\n    type_name, object_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"super_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = BUILTIN_SUPER%d(tstate, moduledict_%s, %s, %s);\"\n            % (\n                value_name,\n                2 if expression.isExpressionBuiltinSuper2() else 0,\n                context.getModuleCodeName(),\n                type_name if type_name is not None else \"NULL\",\n                object_name if object_name is not None else \"NULL\",\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(type_name, object_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateTypeOperationPrepareCode(to_name, expression, emit, context):\n    type_name, args_name, kwargs_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    prepare_func_name = context.allocateTempName(\"prepare_func\")\n\n    getAttributeLookupCode(\n        to_name=prepare_func_name,\n        source_name=type_name,\n        attribute_name=\"__prepare__\",\n        # Types have it.\n        needs_check=False,\n        emit=emit,\n        context=context,\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"prepare_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = CALL_FUNCTION(tstate, %s, %s, %s);\"\n            % (\n                value_name,\n                prepare_func_name,\n                \"const_tuple_empty\" if args_name is None else args_name,\n                \"NULL\" if kwargs_name is None else kwargs_name,\n            )\n        )\n\n        getReleaseCode(release_name=prepare_func_name, emit=emit, context=context)\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(type_name, args_name, kwargs_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CodeGeneration.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" The code generation.\n\nNo language specifics at all are supposed to be present here. Instead it is\nusing primitives from the given generator to build code sequences (list of\nstrings).\n\nAs such this is the place that knows how to take a condition and two code\nbranches and make a code block out of it. But it doesn't contain any target\nlanguage syntax.\n\"\"\"\n\nfrom nuitka.nodes.AttributeNodesGenerated import (\n    attribute_classes,\n    attribute_typed_classes,\n)\nfrom nuitka.nodes.BytesNodes import getBytesOperationClasses\nfrom nuitka.nodes.StrNodes import getStrOperationClasses\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.utils.CStrings import encodePythonStringToC\n\nfrom . import Contexts\nfrom .AsyncgenCodes import (\n    generateMakeAsyncgenObjectCode,\n    getAsyncgenObjectCode,\n    getAsyncgenObjectDeclCode,\n)\nfrom .AttributeCodes import (\n    generateAssignmentAttributeCode,\n    generateAttributeCheckCode,\n    generateAttributeLookupCode,\n    generateAttributeLookupSpecialCode,\n    generateBuiltinGetattrCode,\n    generateBuiltinHasattrCode,\n    generateBuiltinSetattrCode,\n    generateDelAttributeCode,\n)\nfrom .BranchCodes import generateBranchCode\nfrom .BuiltinCodes import (\n    generateBuiltinAbsCode,\n    generateBuiltinAnonymousRefCode,\n    generateBuiltinBinCode,\n    generateBuiltinBoolCode,\n    generateBuiltinBytearray1Code,\n    generateBuiltinBytearray3Code,\n    generateBuiltinClassmethodCode,\n    generateBuiltinComplex1Code,\n    generateBuiltinComplex2Code,\n    generateBuiltinFloatCode,\n    generateBuiltinHexCode,\n    generateBuiltinInputCode,\n    generateBuiltinOctCode,\n    generateBuiltinOpenCode,\n    generateBuiltinRange1Code,\n    generateBuiltinRange2Code,\n    generateBuiltinRange3Code,\n    generateBuiltinRefCode,\n    generateBuiltinStaticmethodCode,\n    generateBuiltinSum1Code,\n    generateBuiltinSum2Code,\n    generateBuiltinType1Code,\n    generateBuiltinType3Code,\n    generateBuiltinXrange1Code,\n    generateBuiltinXrange2Code,\n    generateBuiltinXrange3Code,\n)\nfrom .CallCodes import generateCallCode, getCallsCode\nfrom .ClassCodes import (\n    generateBuiltinSuper1Code,\n    generateBuiltinSuperCode,\n    generateSelectMetaclassCode,\n    generateTypeOperationPrepareCode,\n)\nfrom .CodeHelpers import addExpressionDispatchDict, setStatementDispatchDict\nfrom .ComparisonCodes import (\n    generateBuiltinIsinstanceCode,\n    generateBuiltinIssubclassCode,\n    generateComparisonExpressionCode,\n    generateMatchTypeCheckMappingCode,\n    generateMatchTypeCheckSequenceCode,\n    generateRichComparisonExpressionCode,\n    generateSubtypeCheckCode,\n    generateTypeCheckCode,\n)\nfrom .ConditionalCodes import (\n    generateConditionalAndOrCode,\n    generateConditionalCode,\n)\nfrom .ConstantCodes import (\n    generateConstantGenericAliasCode,\n    generateConstantReferenceCode,\n    getConstantsDefinitionCode,\n)\nfrom .CoroutineCodes import (\n    generateAsyncIterCode,\n    generateAsyncNextCode,\n    generateAsyncWaitCode,\n    generateMakeCoroutineObjectCode,\n    getCoroutineObjectCode,\n    getCoroutineObjectDeclCode,\n)\nfrom .CtypesCodes import generateCtypesCdllCallCode\nfrom .DictCodes import (\n    generateBuiltinDictCode,\n    generateDictionaryCreationCode,\n    generateDictOperationClearCode,\n    generateDictOperationCopyCode,\n    generateDictOperationFromkeys2Code,\n    generateDictOperationFromkeys3Code,\n    generateDictOperationFromkeysRefCode,\n    generateDictOperationGet2Code,\n    generateDictOperationGet3Code,\n    generateDictOperationInCode,\n    generateDictOperationItemCode,\n    generateDictOperationItemsCode,\n    generateDictOperationIteritemsCode,\n    generateDictOperationIterkeysCode,\n    generateDictOperationItervaluesCode,\n    generateDictOperationKeysCode,\n    generateDictOperationPop2Code,\n    generateDictOperationPop3Code,\n    generateDictOperationPopitemCode,\n    generateDictOperationRemoveCode,\n    generateDictOperationSetCode,\n    generateDictOperationSetCodeKeyValue,\n    generateDictOperationSetdefault2Code,\n    generateDictOperationSetdefault3Code,\n    generateDictOperationUpdate2Code,\n    generateDictOperationUpdate3Code,\n    generateDictOperationUpdateCode,\n    generateDictOperationValuesCode,\n    generateDictOperationViewitemsCode,\n    generateDictOperationViewkeysCode,\n    generateDictOperationViewvaluesCode,\n)\nfrom .EvalCodes import (\n    generateBuiltinCompileCode,\n    generateEvalCode,\n    generateExecCode,\n    generateExecfileCode,\n    generateLocalsDictSyncCode,\n)\nfrom .ExceptionCodes import (\n    generateBuiltinMakeExceptionCode,\n    generateExceptionCaughtTracebackCode,\n    generateExceptionCaughtTypeCode,\n    generateExceptionCaughtValueCode,\n    generateExceptionPublishCode,\n    generateExceptionRefCode,\n)\nfrom .ExpressionCodes import (\n    generateExpressionOnlyCode,\n    generateSideEffectsCode,\n)\nfrom .FrameCodes import (\n    generateFramePreserveExceptionCode,\n    generateFrameRestoreExceptionCode,\n)\nfrom .FunctionCodes import (\n    generateFunctionCallCode,\n    generateFunctionCreationCode,\n    generateFunctionErrorStrCode,\n    generateFunctionOutlineCode,\n    getExportScopeCode,\n    getFunctionCode,\n    getFunctionDirectDecl,\n)\nfrom .GeneratorCodes import (\n    generateMakeGeneratorObjectCode,\n    getGeneratorObjectCode,\n    getGeneratorObjectDeclCode,\n)\nfrom .GlobalsLocalsCodes import (\n    generateBuiltinDir1Code,\n    generateBuiltinGlobalsCode,\n    generateBuiltinLocalsCode,\n    generateBuiltinLocalsRefCode,\n    generateBuiltinVarsCode,\n)\nfrom .IdCodes import generateBuiltinHashCode, generateBuiltinIdCode\nfrom .ImportCodes import (\n    generateBuiltinImportCode,\n    generateConstantSysVersionInfoCode,\n    generateImportlibImportCallCode,\n    generateImportModuleFixedCode,\n    generateImportModuleHardCode,\n    generateImportModuleNameHardCode,\n    generateImportNameCode,\n    generateImportStarCode,\n)\nfrom .InjectCCodes import generateInjectCCode\nfrom .IntegerCodes import (\n    generateBuiltinInt1Code,\n    generateBuiltinInt2Code,\n    generateBuiltinLong1Code,\n    generateBuiltinLong2Code,\n)\nfrom .IteratorCodes import (\n    generateBuiltinAllCode,\n    generateBuiltinAnyCode,\n    generateBuiltinIter1Code,\n    generateBuiltinIter2Code,\n    generateBuiltinIterForUnpackCode,\n    generateBuiltinLenCode,\n    generateBuiltinNext1Code,\n    generateBuiltinNext2Code,\n    generateSpecialUnpackCode,\n    generateUnpackCheckCode,\n    generateUnpackCheckFromIteratedCode,\n)\nfrom .ListCodes import (\n    generateBuiltinListCode,\n    generateListCreationCode,\n    generateListOperationAppendCode,\n    generateListOperationAppendCode2,\n    generateListOperationClearCode,\n    generateListOperationCopyCode,\n    generateListOperationCountCode,\n    generateListOperationExtendCode,\n    generateListOperationIndex2Code,\n    generateListOperationIndex3Code,\n    generateListOperationIndex4Code,\n    generateListOperationInsertCode,\n    generateListOperationPop1Code,\n    generateListOperationPop2Code,\n    generateListOperationRemoveCode,\n    generateListOperationReverseCode,\n    generateListOperationSort1Code,\n    generateListOperationSort2Code,\n    generateListOperationSort3Code,\n)\nfrom .LocalsDictCodes import (\n    generateLocalsDictDelCode,\n    generateLocalsDictSetCode,\n    generateLocalsDictVariableCheckCode,\n    generateLocalsDictVariableRefCode,\n    generateLocalsDictVariableRefOrFallbackCode,\n    generateReleaseLocalsDictCode,\n    generateSetLocalsDictCode,\n    generateSetLocalsMappingCode,\n)\nfrom .LoopCodes import (\n    generateLoopBreakCode,\n    generateLoopCode,\n    generateLoopContinueCode,\n)\nfrom .MatchCodes import generateMatchArgsCode\nfrom .ModuleCodes import (\n    generateModuleAttributeCode,\n    generateModuleAttributeFileCode,\n    generateNuitkaLoaderCreationCode,\n    getModuleCode,\n)\nfrom .OperationCodes import (\n    generateOperationBinaryCode,\n    generateOperationNotCode,\n    generateOperationUnaryCode,\n)\nfrom .PackageResourceCodes import (\n    generateImportlibMetadataBackportEntryPointsCallCode,\n    generateImportlibMetadataBackportEntryPointsValueCode,\n    generateImportlibMetadataBackportEntryPointValueCode,\n    generateImportlibMetadataBackportSelectableGroupsValueCode,\n    generateImportlibMetadataBackportVersionCallCode,\n    generateImportlibMetadataDistributionCallCode,\n    generateImportlibMetadataDistributionValueCode,\n    generateImportlibMetadataEntryPointsSince310CallCode,\n    generateImportlibMetadataEntryPointsValueCode,\n    generateImportlibMetadataEntryPointValueCode,\n    generateImportlibMetadataSelectableGroupsValueCode,\n    generateImportlibMetadataVersionCallCode,\n    generateImportlibResourcesFilesCallCode,\n    generateImportlibResourcesReadBinaryCallCode,\n    generateImportlibResourcesReadTextCallCode,\n    generateOsListdirCallCode,\n    generateOsPathAbspathCallCode,\n    generateOsPathBasenameCallCode,\n    generateOsPathDirnameCallCode,\n    generateOsPathExistsCallCode,\n    generateOsPathIsabsCallCode,\n    generateOsPathIsdirCallCode,\n    generateOsPathIsfileCallCode,\n    generateOsUnameCallCode,\n    generatePkglibGetDataCallCode,\n    generatePkgResourcesDistributionValueCode,\n    generatePkgResourcesEntryPointValueCode,\n    generatePkgResourcesGetDistributionCallCode,\n    generatePkgResourcesIterEntryPointsCallCode,\n    generatePkgResourcesRequireCallCode,\n    generatePkgResourcesResourceStreamCallCode,\n    generatePkgResourcesResourceStringCallCode,\n)\nfrom .PrintCodes import generatePrintNewlineCode, generatePrintValueCode\nfrom .RaisingCodes import (\n    generateRaiseCode,\n    generateRaiseExpressionCode,\n    generateReraiseCode,\n)\nfrom .ReturnCodes import (\n    generateGeneratorReturnNoneCode,\n    generateGeneratorReturnValueCode,\n    generateReturnCode,\n    generateReturnConstantCode,\n    generateReturnedValueCode,\n)\nfrom .SetCodes import (\n    generateBuiltinFrozensetCode,\n    generateBuiltinSetCode,\n    generateSetCreationCode,\n    generateSetLiteralCreationCode,\n    generateSetOperationAddCode,\n    generateSetOperationUpdateCode,\n)\nfrom .SliceCodes import (\n    generateAssignmentSliceCode,\n    generateBuiltinSlice1Code,\n    generateBuiltinSlice2Code,\n    generateBuiltinSlice3Code,\n    generateDelSliceCode,\n    generateSliceLookupCode,\n)\nfrom .StringCodes import (\n    generateBuiltinAsciiCode,\n    generateBuiltinBytes1Code,\n    generateBuiltinBytes3Code,\n    generateBuiltinChrCode,\n    generateBuiltinFormatCode,\n    generateBuiltinOrdCode,\n    generateBuiltinStrCode,\n    generateBuiltinUnicodeCode,\n    generateBytesOperationCode,\n    generateStrFormatMethodCode,\n    generateStringConcatenationCode,\n    generateStrOperationCode,\n)\nfrom .SubscriptCodes import (\n    generateAssignmentSubscriptCode,\n    generateDelSubscriptCode,\n    generateSubscriptCheckCode,\n    generateSubscriptLookupCode,\n)\nfrom .TensorflowCodes import generateTensorflowFunctionCallCode\nfrom .TryCodes import generateTryCode\nfrom .TupleCodes import generateBuiltinTupleCode, generateTupleCreationCode\nfrom .VariableCodes import (\n    generateAssignmentVariableCode,\n    generateDelVariableCode,\n    generateVariableReferenceCode,\n    generateVariableReleaseCode,\n)\nfrom .YieldCodes import (\n    generateYieldCode,\n    generateYieldFromAwaitableCode,\n    generateYieldFromCode,\n)\n\n_generated_functions = {}\n\n\ndef generateFunctionBodyCode(function_body, context):\n    # TODO: Generate both codes, and base direct/etc. decisions on context.\n    # pylint: disable=too-many-branches\n\n    function_identifier = function_body.getCodeName()\n\n    if function_identifier in _generated_functions:\n        return _generated_functions[function_identifier]\n\n    if function_body.isExpressionGeneratorObjectBody():\n        function_context = Contexts.PythonGeneratorObjectContext(\n            parent=context, function=function_body\n        )\n    elif function_body.isExpressionClassBodyBase():\n        function_context = Contexts.PythonFunctionDirectContext(\n            parent=context, function=function_body\n        )\n    elif function_body.isExpressionCoroutineObjectBody():\n        function_context = Contexts.PythonCoroutineObjectContext(\n            parent=context, function=function_body\n        )\n    elif function_body.isExpressionAsyncgenObjectBody():\n        function_context = Contexts.PythonAsyncgenObjectContext(\n            parent=context, function=function_body\n        )\n    elif function_body.needsCreation():\n        function_context = Contexts.PythonFunctionCreatedContext(\n            parent=context, function=function_body\n        )\n    else:\n        function_context = Contexts.PythonFunctionDirectContext(\n            parent=context, function=function_body\n        )\n\n    needs_exception_exit = function_body.mayRaiseException(BaseException)\n\n    if function_body.isExpressionGeneratorObjectBody():\n        function_code = getGeneratorObjectCode(\n            context=function_context,\n            function_identifier=function_identifier,\n            closure_variables=function_body.getClosureVariables(),\n            user_variables=function_body.getUserLocalVariables(),\n            outline_variables=function_body.getOutlineLocalVariables(),\n            temp_variables=function_body.getTempVariables(),\n            needs_exception_exit=needs_exception_exit,\n            needs_generator_return=function_body.needsGeneratorReturnExit(),\n        )\n\n        function_decl = getGeneratorObjectDeclCode(\n            function_identifier=function_identifier,\n            closure_variables=function_body.getClosureVariables(),\n        )\n    elif function_body.isExpressionCoroutineObjectBody():\n        function_code = getCoroutineObjectCode(\n            context=function_context,\n            function_identifier=function_identifier,\n            closure_variables=function_body.getClosureVariables(),\n            user_variables=function_body.getUserLocalVariables(),\n            outline_variables=function_body.getOutlineLocalVariables(),\n            temp_variables=function_body.getTempVariables(),\n            needs_exception_exit=needs_exception_exit,\n            needs_generator_return=function_body.needsGeneratorReturnExit(),\n        )\n\n        function_decl = getCoroutineObjectDeclCode(\n            function_identifier=function_body.getCodeName(),\n            closure_variables=function_body.getClosureVariables(),\n        )\n\n    elif function_body.isExpressionAsyncgenObjectBody():\n        function_code = getAsyncgenObjectCode(\n            context=function_context,\n            function_identifier=function_identifier,\n            closure_variables=function_body.getClosureVariables(),\n            user_variables=function_body.getUserLocalVariables(),\n            outline_variables=function_body.getOutlineLocalVariables(),\n            temp_variables=function_body.getTempVariables(),\n            needs_exception_exit=needs_exception_exit,\n            needs_generator_return=function_body.needsGeneratorReturnExit(),\n        )\n\n        function_decl = getAsyncgenObjectDeclCode(\n            function_identifier=function_body.getCodeName(),\n            closure_variables=function_body.getClosureVariables(),\n        )\n\n    elif function_body.isExpressionClassBodyBase():\n        function_code = getFunctionCode(\n            context=function_context,\n            function_identifier=function_identifier,\n            parameters=None,\n            closure_variables=function_body.getClosureVariables(),\n            user_variables=function_body.getUserLocalVariables()\n            + function_body.getOutlineLocalVariables(),\n            temp_variables=function_body.getTempVariables(),\n            function_doc=function_body.getDoc(),\n            needs_exception_exit=needs_exception_exit,\n            file_scope=getExportScopeCode(cross_module=False),\n        )\n\n        function_decl = getFunctionDirectDecl(\n            function_identifier=function_identifier,\n            closure_variables=function_body.getClosureVariables(),\n            file_scope=getExportScopeCode(cross_module=False),\n            context=function_context,\n        )\n\n    else:\n        function_code = getFunctionCode(\n            context=function_context,\n            function_identifier=function_identifier,\n            parameters=function_body.getParameters(),\n            closure_variables=function_body.getClosureVariables(),\n            user_variables=function_body.getUserLocalVariables()\n            + function_body.getOutlineLocalVariables(),\n            temp_variables=function_body.getTempVariables(),\n            function_doc=function_body.getDoc(),\n            needs_exception_exit=needs_exception_exit,\n            file_scope=getExportScopeCode(\n                cross_module=function_body.isCrossModuleUsed()\n            ),\n        )\n\n        if function_body.needsDirectCall():\n            function_decl = getFunctionDirectDecl(\n                function_identifier=function_identifier,\n                closure_variables=function_body.getClosureVariables(),\n                file_scope=getExportScopeCode(\n                    cross_module=function_body.isCrossModuleUsed()\n                ),\n                context=function_context,\n            )\n        else:\n            function_decl = None\n\n    return function_code, function_decl\n\n\ndef _generateModuleCode(module, data_filename):\n    # As this not only creates all modules, but also functions, it deals\n    # also with its functions.\n\n    assert module.isCompiledPythonModule(), module\n\n    context = Contexts.PythonModuleContext(\n        module=module,\n        data_filename=data_filename,\n    )\n\n    context.setExceptionEscape(\"module_exception_exit\")\n\n    function_decl_codes = []\n    function_body_codes = []\n\n    for function_body in module.getUsedFunctions():\n        if function_body.needsCreation():\n            # Constant function returners get no code.\n            (\n                is_constant_returning,\n                _constant_return_value,\n            ) = function_body.getConstantReturnValue()\n            if is_constant_returning:\n                continue\n\n        function_code, function_decl = generateFunctionBodyCode(\n            function_body=function_body, context=context\n        )\n\n        function_body_codes.append(function_code)\n\n        if function_decl is not None:\n            function_decl_codes.append(function_decl)\n\n    # These are for functions used from other modules. Due to cyclic\n    # dependencies, we cannot rely on those to be already created.\n    for function_body in module.getCrossUsedFunctions():\n        assert function_body.isCrossModuleUsed()\n\n        function_decl = getFunctionDirectDecl(\n            function_identifier=function_body.getCodeName(),\n            closure_variables=function_body.getClosureVariables(),\n            file_scope=getExportScopeCode(\n                cross_module=function_body.isCrossModuleUsed()\n            ),\n            context=Contexts.PythonFunctionDirectContext(\n                parent=context, function=function_body\n            ),\n        )\n\n        function_decl_codes.append(function_decl)\n\n    return getModuleCode(\n        module=module,\n        function_decl_codes=function_decl_codes,\n        function_body_codes=function_body_codes,\n        module_const_blob_name=encodePythonStringToC(\n            Plugins.deriveModuleConstantsBlobName(data_filename)\n        ),\n        context=context,\n    )\n\n\ndef generateModuleCode(module, data_filename):\n    try:\n        return _generateModuleCode(module=module, data_filename=data_filename)\n    except KeyboardInterrupt:\n        raise KeyboardInterrupt(\"Interrupted while working on\", module)\n\n\ndef generateHelpersCode():\n    calls_decl_code, calls_body_code = getCallsCode()\n\n    constants_header_code, constants_body_code = getConstantsDefinitionCode()\n\n    return (\n        calls_decl_code,\n        calls_body_code,\n        constants_header_code,\n        constants_body_code,\n    )\n\n\n# TODO: Some of these have names that are way too long, and this should be more automatic in\n# standard cases, e.g. through generation.\n# pylint: disable=line-too-long\naddExpressionDispatchDict(\n    {\n        \"EXPRESSION_ATTRIBUTE_CHECK\": generateAttributeCheckCode,\n        \"EXPRESSION_ATTRIBUTE_LOOKUP\": generateAttributeLookupCode,\n        \"EXPRESSION_ATTRIBUTE_LOOKUP_SPECIAL\": generateAttributeLookupSpecialCode,\n        \"EXPRESSION_BUILTIN_SLICE3\": generateBuiltinSlice3Code,\n        \"EXPRESSION_BUILTIN_SLICE2\": generateBuiltinSlice2Code,\n        \"EXPRESSION_BUILTIN_SLICE1\": generateBuiltinSlice1Code,\n        \"EXPRESSION_BUILTIN_HASH\": generateBuiltinHashCode,\n        \"EXPRESSION_BUILTIN_ID\": generateBuiltinIdCode,\n        \"EXPRESSION_BUILTIN_COMPILE\": generateBuiltinCompileCode,\n        \"EXPRESSION_BUILTIN_EXECFILE\": generateExecfileCode,\n        \"EXPRESSION_BUILTIN_EVAL\": generateEvalCode,\n        \"EXPRESSION_BUILTIN_EXEC\": generateEvalCode,\n        \"EXPRESSION_BUILTIN_ITER_FOR_UNPACK\": generateBuiltinIterForUnpackCode,\n        \"EXPRESSION_BUILTIN_ITER1\": generateBuiltinIter1Code,\n        \"EXPRESSION_BUILTIN_ITER2\": generateBuiltinIter2Code,\n        \"EXPRESSION_BUILTIN_NEXT1\": generateBuiltinNext1Code,\n        \"EXPRESSION_BUILTIN_NEXT2\": generateBuiltinNext2Code,\n        \"EXPRESSION_BUILTIN_SUM1\": generateBuiltinSum1Code,\n        \"EXPRESSION_BUILTIN_SUM2\": generateBuiltinSum2Code,\n        \"EXPRESSION_BUILTIN_TYPE1\": generateBuiltinType1Code,\n        \"EXPRESSION_BUILTIN_TYPE3\": generateBuiltinType3Code,\n        \"EXPRESSION_BUILTIN_IMPORT\": generateBuiltinImportCode,\n        \"EXPRESSION_BUILTIN_BOOL\": generateBuiltinBoolCode,\n        \"EXPRESSION_BUILTIN_BYTEARRAY1\": generateBuiltinBytearray1Code,\n        \"EXPRESSION_BUILTIN_BYTEARRAY3\": generateBuiltinBytearray3Code,\n        \"EXPRESSION_BUILTIN_INT1\": generateBuiltinInt1Code,\n        \"EXPRESSION_BUILTIN_INT2\": generateBuiltinInt2Code,\n        \"EXPRESSION_BUILTIN_LONG1\": generateBuiltinLong1Code,\n        \"EXPRESSION_BUILTIN_LONG2\": generateBuiltinLong2Code,\n        \"EXPRESSION_BUILTIN_FLOAT\": generateBuiltinFloatCode,\n        \"EXPRESSION_BUILTIN_COMPLEX1\": generateBuiltinComplex1Code,\n        \"EXPRESSION_BUILTIN_COMPLEX2\": generateBuiltinComplex2Code,\n        \"EXPRESSION_BUILTIN_LEN\": generateBuiltinLenCode,\n        \"EXPRESSION_BUILTIN_STR_P2\": generateBuiltinStrCode,\n        \"EXPRESSION_BUILTIN_STR_P3\": generateBuiltinStrCode,\n        \"EXPRESSION_BUILTIN_BYTES1\": generateBuiltinBytes1Code,\n        \"EXPRESSION_BUILTIN_BYTES3\": generateBuiltinBytes3Code,\n        \"EXPRESSION_BUILTIN_UNICODE_P2\": generateBuiltinUnicodeCode,\n        \"EXPRESSION_BUILTIN_CHR\": generateBuiltinChrCode,\n        \"EXPRESSION_BUILTIN_ORD\": generateBuiltinOrdCode,\n        \"EXPRESSION_BUILTIN_BIN\": generateBuiltinBinCode,\n        \"EXPRESSION_BUILTIN_OCT\": generateBuiltinOctCode,\n        \"EXPRESSION_BUILTIN_HEX\": generateBuiltinHexCode,\n        \"EXPRESSION_BUILTIN_TUPLE\": generateBuiltinTupleCode,\n        \"EXPRESSION_BUILTIN_LIST\": generateBuiltinListCode,\n        \"EXPRESSION_BUILTIN_SET\": generateBuiltinSetCode,\n        \"EXPRESSION_BUILTIN_ANY\": generateBuiltinAnyCode,\n        \"EXPRESSION_BUILTIN_FROZENSET\": generateBuiltinFrozensetCode,\n        \"EXPRESSION_BUILTIN_ALL\": generateBuiltinAllCode,\n        \"EXPRESSION_BUILTIN_DICT\": generateBuiltinDictCode,\n        \"EXPRESSION_BUILTIN_LOCALS_COPY\": generateBuiltinLocalsCode,\n        \"EXPRESSION_BUILTIN_LOCALS_UPDATED\": generateBuiltinLocalsCode,\n        \"EXPRESSION_BUILTIN_LOCALS_REF\": generateBuiltinLocalsRefCode,\n        \"EXPRESSION_LOCALS_DICT_REF\": generateBuiltinLocalsRefCode,\n        \"EXPRESSION_BUILTIN_GLOBALS\": generateBuiltinGlobalsCode,\n        \"EXPRESSION_BUILTIN_SUPER0\": generateBuiltinSuperCode,\n        \"EXPRESSION_BUILTIN_SUPER2\": generateBuiltinSuperCode,\n        \"EXPRESSION_BUILTIN_SUPER1\": generateBuiltinSuper1Code,\n        \"EXPRESSION_BUILTIN_ISINSTANCE\": generateBuiltinIsinstanceCode,\n        \"EXPRESSION_BUILTIN_ISSUBCLASS\": generateBuiltinIssubclassCode,\n        \"EXPRESSION_TYPE_CHECK\": generateTypeCheckCode,\n        \"EXPRESSION_SUBTYPE_CHECK\": generateSubtypeCheckCode,\n        \"EXPRESSION_MATCH_TYPE_CHECK_SEQUENCE\": generateMatchTypeCheckSequenceCode,\n        \"EXPRESSION_MATCH_TYPE_CHECK_MAPPING\": generateMatchTypeCheckMappingCode,\n        \"EXPRESSION_BUILTIN_DIR1\": generateBuiltinDir1Code,\n        \"EXPRESSION_BUILTIN_VARS\": generateBuiltinVarsCode,\n        \"EXPRESSION_BUILTIN_HASATTR\": generateBuiltinHasattrCode,\n        \"EXPRESSION_BUILTIN_GETATTR\": generateBuiltinGetattrCode,\n        \"EXPRESSION_BUILTIN_SETATTR\": generateBuiltinSetattrCode,\n        \"EXPRESSION_BUILTIN_INPUT\": generateBuiltinInputCode,\n        \"EXPRESSION_BUILTIN_OPEN_P2\": generateBuiltinOpenCode,\n        \"EXPRESSION_BUILTIN_OPEN_P3\": generateBuiltinOpenCode,\n        \"EXPRESSION_BUILTIN_STATICMETHOD\": generateBuiltinStaticmethodCode,\n        \"EXPRESSION_BUILTIN_CLASSMETHOD\": generateBuiltinClassmethodCode,\n        \"EXPRESSION_BUILTIN_RANGE1\": generateBuiltinRange1Code,\n        \"EXPRESSION_BUILTIN_RANGE2\": generateBuiltinRange2Code,\n        \"EXPRESSION_BUILTIN_RANGE3\": generateBuiltinRange3Code,\n        \"EXPRESSION_BUILTIN_XRANGE1\": generateBuiltinXrange1Code,\n        \"EXPRESSION_BUILTIN_XRANGE2\": generateBuiltinXrange2Code,\n        \"EXPRESSION_BUILTIN_XRANGE3\": generateBuiltinXrange3Code,\n        \"EXPRESSION_BUILTIN_MAKE_EXCEPTION\": generateBuiltinMakeExceptionCode,\n        \"EXPRESSION_BUILTIN_MAKE_EXCEPTION_IMPORT_ERROR\": generateBuiltinMakeExceptionCode,\n        \"EXPRESSION_BUILTIN_REF\": generateBuiltinRefCode,\n        \"EXPRESSION_BUILTIN_WITH_CONTEXT_REF\": generateBuiltinRefCode,\n        \"EXPRESSION_BUILTIN_EXCEPTION_REF\": generateExceptionRefCode,\n        \"EXPRESSION_BUILTIN_ANONYMOUS_REF\": generateBuiltinAnonymousRefCode,\n        \"EXPRESSION_CAUGHT_EXCEPTION_TYPE_REF\": generateExceptionCaughtTypeCode,\n        \"EXPRESSION_CAUGHT_EXCEPTION_VALUE_REF\": generateExceptionCaughtValueCode,\n        \"EXPRESSION_CAUGHT_EXCEPTION_TRACEBACK_REF\": generateExceptionCaughtTracebackCode,\n        \"EXPRESSION_CALL_EMPTY\": generateCallCode,\n        \"EXPRESSION_CALL_KEYWORDS_ONLY\": generateCallCode,\n        \"EXPRESSION_CALL_NO_KEYWORDS\": generateCallCode,\n        \"EXPRESSION_CALL\": generateCallCode,\n        \"EXPRESSION_CONSTANT_NONE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TRUE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_FALSE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_STR_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_STR_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_UNICODE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_UNICODE_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_BYTES_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_BYTES_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_INT_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_LONG_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_FLOAT_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_COMPLEX_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_ELLIPSIS_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_DICT_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_DICT_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TUPLE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TUPLE_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TUPLE_MUTABLE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_LIST_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_LIST_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_SET_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_SET_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_FROZENSET_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_FROZENSET_EMPTY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_SLICE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_XRANGE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_DICT_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_SET_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_FROZENSET_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_LIST_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_TUPLE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_TYPE_TYPE_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_BYTEARRAY_REF\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_GENERIC_ALIAS\": generateConstantGenericAliasCode,\n        \"EXPRESSION_CONSTANT_UNION_TYPE\": generateConstantReferenceCode,\n        \"EXPRESSION_CONSTANT_SYS_VERSION_INFO_REF\": generateConstantSysVersionInfoCode,\n        \"EXPRESSION_CONDITIONAL\": generateConditionalCode,\n        \"EXPRESSION_CONDITIONAL_OR\": generateConditionalAndOrCode,\n        \"EXPRESSION_CONDITIONAL_AND\": generateConditionalAndOrCode,\n        \"EXPRESSION_COMPARISON\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_IS\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_IS_NOT\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_IN\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_NOT_IN\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_EXCEPTION_MATCH\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_EXCEPTION_MISMATCH\": generateComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_LT\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_LTE\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_GT\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_GTE\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_EQ\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_COMPARISON_NEQ\": generateRichComparisonExpressionCode,\n        \"EXPRESSION_DICT_OPERATION_ITEM\": generateDictOperationItemCode,\n        \"EXPRESSION_DICT_OPERATION_GET2\": generateDictOperationGet2Code,\n        \"EXPRESSION_DICT_OPERATION_GET3\": generateDictOperationGet3Code,\n        \"EXPRESSION_DICT_OPERATION_HASKEY\": generateDictOperationInCode,\n        \"EXPRESSION_DICT_OPERATION_IN\": generateDictOperationInCode,\n        \"EXPRESSION_DICT_OPERATION_NOT_IN\": generateDictOperationInCode,\n        \"EXPRESSION_DICT_OPERATION_COPY\": generateDictOperationCopyCode,\n        \"EXPRESSION_DICT_OPERATION_CLEAR\": generateDictOperationClearCode,\n        \"EXPRESSION_DICT_OPERATION_ITEMS\": generateDictOperationItemsCode,\n        \"EXPRESSION_DICT_OPERATION_ITERITEMS\": generateDictOperationIteritemsCode,\n        \"EXPRESSION_DICT_OPERATION_VIEWITEMS\": generateDictOperationViewitemsCode,\n        \"EXPRESSION_DICT_OPERATION_KEYS\": generateDictOperationKeysCode,\n        \"EXPRESSION_DICT_OPERATION_ITERKEYS\": generateDictOperationIterkeysCode,\n        \"EXPRESSION_DICT_OPERATION_VIEWKEYS\": generateDictOperationViewkeysCode,\n        \"EXPRESSION_DICT_OPERATION_VALUES\": generateDictOperationValuesCode,\n        \"EXPRESSION_DICT_OPERATION_ITERVALUES\": generateDictOperationItervaluesCode,\n        \"EXPRESSION_DICT_OPERATION_VIEWVALUES\": generateDictOperationViewvaluesCode,\n        \"EXPRESSION_DICT_OPERATION_SETDEFAULT2\": generateDictOperationSetdefault2Code,\n        \"EXPRESSION_DICT_OPERATION_SETDEFAULT3\": generateDictOperationSetdefault3Code,\n        \"EXPRESSION_DICT_OPERATION_POP2\": generateDictOperationPop2Code,\n        \"EXPRESSION_DICT_OPERATION_POP3\": generateDictOperationPop3Code,\n        \"EXPRESSION_DICT_OPERATION_POPITEM\": generateDictOperationPopitemCode,\n        \"EXPRESSION_DICT_OPERATION_UPDATE2\": generateDictOperationUpdate2Code,\n        \"EXPRESSION_DICT_OPERATION_UPDATE3\": generateDictOperationUpdate3Code,\n        \"EXPRESSION_DICT_OPERATION_UPDATE_PAIRS\": generateDictOperationUpdate3Code,\n        \"EXPRESSION_DICT_OPERATION_FROMKEYS2\": generateDictOperationFromkeys2Code,\n        \"EXPRESSION_DICT_OPERATION_FROMKEYS3\": generateDictOperationFromkeys3Code,\n        \"EXPRESSION_FUNCTION_CREATION\": generateFunctionCreationCode,\n        \"EXPRESSION_FUNCTION_CREATION_OLD\": generateFunctionCreationCode,\n        \"EXPRESSION_FUNCTION_CALL\": generateFunctionCallCode,\n        \"EXPRESSION_FUNCTION_ERROR_STR\": generateFunctionErrorStrCode,\n        \"EXPRESSION_IMPORT_MODULE_BUILTIN\": generateImportModuleFixedCode,\n        \"EXPRESSION_IMPORT_MODULE_FIXED\": generateImportModuleFixedCode,\n        \"EXPRESSION_IMPORT_MODULE_HARD\": generateImportModuleHardCode,\n        \"EXPRESSION_IMPORT_MODULE_NAME_HARD_MAYBE_EXISTS\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORT_MODULE_NAME_HARD_EXISTS\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_IMPORT_MODULE_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_IMPORT_MODULE_CALL\": generateImportlibImportCallCode,\n        \"EXPRESSION_IMPORT_NAME\": generateImportNameCode,\n        \"EXPRESSION_LIST_OPERATION_APPEND\": generateListOperationAppendCode2,\n        \"EXPRESSION_LIST_OPERATION_EXTEND\": generateListOperationExtendCode,\n        \"EXPRESSION_LIST_OPERATION_EXTEND_FOR_UNPACK\": generateListOperationExtendCode,\n        \"EXPRESSION_LIST_OPERATION_CLEAR\": generateListOperationClearCode,\n        \"EXPRESSION_LIST_OPERATION_COPY\": generateListOperationCopyCode,\n        \"EXPRESSION_LIST_OPERATION_COUNT\": generateListOperationCountCode,\n        \"EXPRESSION_LIST_OPERATION_INSERT\": generateListOperationInsertCode,\n        \"EXPRESSION_LIST_OPERATION_INDEX2\": generateListOperationIndex2Code,\n        \"EXPRESSION_LIST_OPERATION_INDEX3\": generateListOperationIndex3Code,\n        \"EXPRESSION_LIST_OPERATION_INDEX4\": generateListOperationIndex4Code,\n        \"EXPRESSION_LIST_OPERATION_POP1\": generateListOperationPop1Code,\n        \"EXPRESSION_LIST_OPERATION_POP2\": generateListOperationPop2Code,\n        \"EXPRESSION_LIST_OPERATION_REMOVE\": generateListOperationRemoveCode,\n        \"EXPRESSION_LIST_OPERATION_REVERSE\": generateListOperationReverseCode,\n        \"EXPRESSION_LIST_OPERATION_SORT1\": generateListOperationSort1Code,\n        \"EXPRESSION_LIST_OPERATION_SORT2\": generateListOperationSort2Code,\n        \"EXPRESSION_LIST_OPERATION_SORT3\": generateListOperationSort3Code,\n        \"EXPRESSION_MODULE_ATTRIBUTE_FILE_REF\": generateModuleAttributeFileCode,\n        \"EXPRESSION_MODULE_ATTRIBUTE_NAME_REF\": generateModuleAttributeCode,\n        \"EXPRESSION_MODULE_ATTRIBUTE_PACKAGE_REF\": generateModuleAttributeCode,\n        \"EXPRESSION_MODULE_ATTRIBUTE_LOADER_REF\": generateModuleAttributeCode,\n        \"EXPRESSION_MODULE_ATTRIBUTE_SPEC_REF\": generateModuleAttributeCode,\n        \"EXPRESSION_MAKE_GENERATOR_OBJECT\": generateMakeGeneratorObjectCode,\n        \"EXPRESSION_MAKE_COROUTINE_OBJECT\": generateMakeCoroutineObjectCode,\n        \"EXPRESSION_MAKE_ASYNCGEN_OBJECT\": generateMakeAsyncgenObjectCode,\n        \"EXPRESSION_MAKE_SET\": generateSetCreationCode,\n        \"EXPRESSION_MAKE_SET_LITERAL\": generateSetLiteralCreationCode,\n        \"EXPRESSION_MAKE_TUPLE\": generateTupleCreationCode,\n        \"EXPRESSION_MAKE_LIST\": generateListCreationCode,\n        \"EXPRESSION_MAKE_DICT\": generateDictionaryCreationCode,\n        \"EXPRESSION_OPERATION_BINARY_ADD\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_SUB\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_MULT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_FLOOR_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_OLD_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_TRUE_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_DIVMOD\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_MOD\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_POW\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_LSHIFT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_RSHIFT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_BIT_OR\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_BIT_AND\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_BIT_XOR\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_BINARY_MAT_MULT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_ADD\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_SUB\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_MULT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_FLOOR_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_OLD_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_TRUE_DIV\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_MOD\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_POW\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_LSHIFT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_RSHIFT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_BIT_OR\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_BIT_AND\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_BIT_XOR\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_INPLACE_MAT_MULT\": generateOperationBinaryCode,\n        \"EXPRESSION_OPERATION_UNARY_REPR\": generateOperationUnaryCode,\n        \"EXPRESSION_OPERATION_UNARY_SUB\": generateOperationUnaryCode,\n        \"EXPRESSION_OPERATION_UNARY_ADD\": generateOperationUnaryCode,\n        \"EXPRESSION_OPERATION_UNARY_INVERT\": generateOperationUnaryCode,\n        \"EXPRESSION_OPERATION_UNARY_ABS\": generateBuiltinAbsCode,\n        \"EXPRESSION_OPERATION_NOT\": generateOperationNotCode,\n        \"EXPRESSION_OUTLINE_BODY\": generateFunctionOutlineCode,\n        \"EXPRESSION_OUTLINE_FUNCTION\": generateFunctionOutlineCode,\n        # TODO: Rename to make more clear it is an outline\n        \"EXPRESSION_CLASS_BODY_P2\": generateFunctionOutlineCode,\n        \"EXPRESSION_CLASS_BODY_P3\": generateFunctionOutlineCode,\n        \"EXPRESSION_SUBSCRIPT_LOOKUP\": generateSubscriptLookupCode,\n        \"EXPRESSION_SUBSCRIPT_LOOKUP_FOR_UNPACK\": generateSubscriptLookupCode,\n        \"EXPRESSION_SUBSCRIPT_CHECK\": generateSubscriptCheckCode,\n        \"EXPRESSION_SLICE_LOOKUP\": generateSliceLookupCode,\n        \"EXPRESSION_SET_OPERATION_UPDATE\": generateSetOperationUpdateCode,\n        \"EXPRESSION_SIDE_EFFECTS\": generateSideEffectsCode,\n        \"EXPRESSION_SPECIAL_UNPACK\": generateSpecialUnpackCode,\n        \"EXPRESSION_TEMP_VARIABLE_REF\": generateVariableReferenceCode,\n        \"EXPRESSION_VARIABLE_REF\": generateVariableReferenceCode,\n        \"EXPRESSION_VARIABLE_OR_BUILTIN_REF\": generateVariableReferenceCode,\n        \"EXPRESSION_YIELD\": generateYieldCode,\n        \"EXPRESSION_YIELD_FROM\": generateYieldFromCode,\n        \"EXPRESSION_YIELD_FROM_AWAITABLE\": generateYieldFromAwaitableCode,\n        \"EXPRESSION_ASYNC_WAIT\": generateAsyncWaitCode,\n        \"EXPRESSION_ASYNC_WAIT_ENTER\": generateAsyncWaitCode,\n        \"EXPRESSION_ASYNC_WAIT_EXIT\": generateAsyncWaitCode,\n        \"EXPRESSION_ASYNC_ITER\": generateAsyncIterCode,\n        \"EXPRESSION_ASYNC_NEXT\": generateAsyncNextCode,\n        \"EXPRESSION_SELECT_METACLASS\": generateSelectMetaclassCode,\n        \"EXPRESSION_STRING_CONCATENATION\": generateStringConcatenationCode,\n        \"EXPRESSION_BUILTIN_FORMAT\": generateBuiltinFormatCode,\n        \"EXPRESSION_BUILTIN_ASCII\": generateBuiltinAsciiCode,\n        \"EXPRESSION_LOCALS_VARIABLE_CHECK\": generateLocalsDictVariableCheckCode,\n        \"EXPRESSION_LOCALS_VARIABLE_REF_OR_FALLBACK\": generateLocalsDictVariableRefOrFallbackCode,\n        \"EXPRESSION_LOCALS_VARIABLE_REF\": generateLocalsDictVariableRefCode,\n        \"EXPRESSION_RAISE_EXCEPTION\": generateRaiseExpressionCode,\n        \"EXPRESSION_NUITKA_LOADER_CREATION\": generateNuitkaLoaderCreationCode,\n        \"EXPRESSION_PKGUTIL_GET_DATA_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_REQUIRE_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_GET_DISTRIBUTION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_ITER_ENTRY_POINTS_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_RESOURCE_STRING_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_RESOURCE_STREAM_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_PKG_RESOURCES_DISTRIBUTION_VALUE_REF\": generatePkgResourcesDistributionValueCode,\n        \"EXPRESSION_PKG_RESOURCES_ENTRY_POINT_VALUE_REF\": generatePkgResourcesEntryPointValueCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_READ_BINARY_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_READ_TEXT_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_VERSION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_VERSION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_METADATA_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_METADATA_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_VALUE_REF\": generateImportlibMetadataDistributionValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINT_VALUE_REF\": generateImportlibMetadataEntryPointValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINT_VALUE_REF\": generateImportlibMetadataBackportEntryPointValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_SELECTABLE_GROUPS_VALUE_REF\": generateImportlibMetadataSelectableGroupsValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_SELECTABLE_GROUPS_VALUE_REF\": generateImportlibMetadataBackportSelectableGroupsValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_VALUE_REF\": generateImportlibMetadataEntryPointsValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_VALUE_REF\": generateImportlibMetadataBackportEntryPointsValueCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_BEFORE310_CALL\": generateImportlibMetadataEntryPointsSince310CallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_SINCE310_CALL\": generateImportlibMetadataEntryPointsSince310CallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_CALL\": generateImportlibMetadataBackportEntryPointsCallCode,\n        \"EXPRESSION_SYS_EXIT_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_UNAME_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_LISTDIR_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_EXISTS_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_ISFILE_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_ISDIR_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_DIRNAME_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_BASENAME_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_OS_PATH_ABSPATH_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_BUILTINS_OPEN_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_CTYPES_CDLL_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_CTYPES_CDLL_SINCE38_CALL\": generateCtypesCdllCallCode,\n        \"EXPRESSION_CTYPES_CDLL_BEFORE38_CALL\": generateCtypesCdllCallCode,\n        \"EXPRESSION_PKGUTIL_GET_DATA_CALL\": generatePkglibGetDataCallCode,\n        \"EXPRESSION_PKG_RESOURCES_REQUIRE_CALL\": generatePkgResourcesRequireCallCode,\n        \"EXPRESSION_PKG_RESOURCES_GET_DISTRIBUTION_CALL\": generatePkgResourcesGetDistributionCallCode,\n        \"EXPRESSION_PKG_RESOURCES_ITER_ENTRY_POINTS_CALL\": generatePkgResourcesIterEntryPointsCallCode,\n        \"EXPRESSION_PKG_RESOURCES_RESOURCE_STRING_CALL\": generatePkgResourcesResourceStringCallCode,\n        \"EXPRESSION_PKG_RESOURCES_RESOURCE_STREAM_CALL\": generatePkgResourcesResourceStreamCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_READ_BINARY_CALL\": generateImportlibResourcesReadBinaryCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_READ_TEXT_CALL\": generateImportlibResourcesReadTextCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_CALL\": generateImportlibResourcesFilesCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_CALL\": generateImportlibResourcesFilesCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_CALL_FIXED\": generateImportlibResourcesFilesCallCode,\n        \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_CALL_FIXED\": generateImportlibResourcesFilesCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_VERSION_CALL\": generateImportlibMetadataVersionCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_VERSION_CALL\": generateImportlibMetadataBackportVersionCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_CALL\": generateImportlibMetadataDistributionCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_CALL\": generateImportlibMetadataDistributionCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_FAILED_CALL\": generateImportlibMetadataDistributionCallCode,\n        \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_FAILED_CALL\": generateImportlibMetadataDistributionCallCode,\n        \"EXPRESSION_OS_UNAME_CALL\": generateOsUnameCallCode,\n        \"EXPRESSION_OS_PATH_EXISTS_CALL\": generateOsPathExistsCallCode,\n        \"EXPRESSION_OS_PATH_ISFILE_CALL\": generateOsPathIsfileCallCode,\n        \"EXPRESSION_OS_PATH_ISDIR_CALL\": generateOsPathIsdirCallCode,\n        \"EXPRESSION_OS_PATH_BASENAME_CALL\": generateOsPathBasenameCallCode,\n        \"EXPRESSION_OS_PATH_DIRNAME_CALL\": generateOsPathDirnameCallCode,\n        \"EXPRESSION_OS_PATH_ABSPATH_CALL\": generateOsPathAbspathCallCode,\n        \"EXPRESSION_OS_PATH_ISABS_CALL\": generateOsPathIsabsCallCode,\n        \"EXPRESSION_OS_LISTDIR_CALL\": generateOsListdirCallCode,\n        \"EXPRESSION_MATCH_ARGS\": generateMatchArgsCode,\n        \"EXPRESSION_STR_OPERATION_FORMAT\": generateStrFormatMethodCode,\n        # TODO: Should have all of these generically or not. This one is required for now.\n        \"EXPRESSION_DICT_OPERATION_FROMKEYS_REF\": generateDictOperationFromkeysRefCode,\n        \"EXPRESSION_TYPE_OPERATION_PREPARE\": generateTypeOperationPrepareCode,\n        # PyPI module \"tensorflow\" specific stuff\n        \"EXPRESSION_TENSORFLOW_FUNCTION_REF\": generateImportModuleNameHardCode,\n        \"EXPRESSION_TENSORFLOW_FUNCTION_CALL\": generateTensorflowFunctionCallCode,\n    }\n)\n\n# Add code generation for the EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_* variety\naddExpressionDispatchDict(\n    dict((cls.kind, generateAttributeLookupCode) for cls in attribute_classes.values())\n)\n\n# Add code generation for the EXPRESSION_ATTRIBUTE_LOOKUP_DICT|LIST|STR_* variety\naddExpressionDispatchDict(\n    dict((cls.kind, generateAttributeLookupCode) for cls in attribute_typed_classes)\n)\n\n# Add code generation for the EXPRESSION_STR_OPERATION_* nodes.\naddExpressionDispatchDict(\n    dict((cls.kind, generateStrOperationCode) for cls in getStrOperationClasses())\n)\n\n# Add code generation for the EXPRESSION_BYTES_OPERATION_* nodes.\naddExpressionDispatchDict(\n    dict((cls.kind, generateBytesOperationCode) for cls in getBytesOperationClasses())\n)\n\n\nsetStatementDispatchDict(\n    {\n        \"STATEMENT_ASSIGNMENT_VARIABLE_GENERIC\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_MUTABLE\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_MUTABLE_TRUSTED\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_IMMUTABLE\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_IMMUTABLE_TRUSTED\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_ITERATOR\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_FROM_VARIABLE\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_FROM_TEMP_VARIABLE\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_VARIABLE_HARD_VALUE\": generateAssignmentVariableCode,\n        \"STATEMENT_ASSIGNMENT_ATTRIBUTE\": generateAssignmentAttributeCode,\n        \"STATEMENT_ASSIGNMENT_SUBSCRIPT\": generateAssignmentSubscriptCode,\n        \"STATEMENT_ASSIGNMENT_SLICE\": generateAssignmentSliceCode,\n        \"STATEMENT_DEL_VARIABLE_TOLERANT\": generateDelVariableCode,\n        \"STATEMENT_DEL_VARIABLE_INTOLERANT\": generateDelVariableCode,\n        \"STATEMENT_DEL_ATTRIBUTE\": generateDelAttributeCode,\n        \"STATEMENT_DEL_SUBSCRIPT\": generateDelSubscriptCode,\n        \"STATEMENT_DEL_SLICE\": generateDelSliceCode,\n        \"STATEMENT_DICT_OPERATION_REMOVE\": generateDictOperationRemoveCode,\n        \"STATEMENT_DICT_OPERATION_UPDATE\": generateDictOperationUpdateCode,\n        \"STATEMENT_RELEASE_VARIABLE_TEMP\": generateVariableReleaseCode,\n        \"STATEMENT_RELEASE_VARIABLE_LOCAL\": generateVariableReleaseCode,\n        \"STATEMENT_RELEASE_VARIABLE_PARAMETER\": generateVariableReleaseCode,\n        \"STATEMENT_EXPRESSION_ONLY\": generateExpressionOnlyCode,\n        \"STATEMENT_RETURN\": generateReturnCode,\n        \"STATEMENT_RETURN_TRUE\": generateReturnConstantCode,\n        \"STATEMENT_RETURN_FALSE\": generateReturnConstantCode,\n        \"STATEMENT_RETURN_NONE\": generateReturnConstantCode,\n        \"STATEMENT_RETURN_CONSTANT\": generateReturnConstantCode,\n        \"STATEMENT_RETURN_RETURNED_VALUE\": generateReturnedValueCode,\n        \"STATEMENT_GENERATOR_RETURN\": generateGeneratorReturnValueCode,\n        \"STATEMENT_GENERATOR_RETURN_NONE\": generateGeneratorReturnNoneCode,\n        \"STATEMENT_CONDITIONAL\": generateBranchCode,\n        \"STATEMENT_TRY\": generateTryCode,\n        \"STATEMENT_PRINT_VALUE\": generatePrintValueCode,\n        \"STATEMENT_PRINT_NEWLINE\": generatePrintNewlineCode,\n        \"STATEMENT_IMPORT_STAR\": generateImportStarCode,\n        \"STATEMENT_LIST_OPERATION_APPEND\": generateListOperationAppendCode,\n        \"STATEMENT_SET_OPERATION_ADD\": generateSetOperationAddCode,\n        \"STATEMENT_DICT_OPERATION_SET\": generateDictOperationSetCode,\n        \"STATEMENT_DICT_OPERATION_SET_KEY_VALUE\": generateDictOperationSetCodeKeyValue,\n        \"STATEMENT_LOCALS_DICT_OPERATION_SET\": generateLocalsDictSetCode,\n        \"STATEMENT_LOCALS_DICT_OPERATION_DEL\": generateLocalsDictDelCode,\n        \"STATEMENT_LOOP\": generateLoopCode,\n        \"STATEMENT_LOOP_BREAK\": generateLoopBreakCode,\n        \"STATEMENT_LOOP_CONTINUE\": generateLoopContinueCode,\n        \"STATEMENT_RAISE_EXCEPTION\": generateRaiseCode,\n        \"STATEMENT_RAISE_EXCEPTION_IMPLICIT\": generateRaiseCode,\n        \"STATEMENT_RERAISE_EXCEPTION\": generateReraiseCode,\n        \"STATEMENT_SPECIAL_UNPACK_CHECK\": generateUnpackCheckCode,\n        \"STATEMENT_SPECIAL_UNPACK_CHECK_FROM_ITERATED\": generateUnpackCheckFromIteratedCode,\n        \"STATEMENT_EXEC\": generateExecCode,\n        \"STATEMENT_LOCALS_DICT_SYNC\": generateLocalsDictSyncCode,\n        \"STATEMENT_SET_LOCALS\": generateSetLocalsMappingCode,\n        \"STATEMENT_SET_LOCALS_DICTIONARY\": generateSetLocalsDictCode,\n        \"STATEMENT_RELEASE_LOCALS\": generateReleaseLocalsDictCode,\n        \"STATEMENT_PRESERVE_FRAME_EXCEPTION\": generateFramePreserveExceptionCode,\n        \"STATEMENT_RESTORE_FRAME_EXCEPTION\": generateFrameRestoreExceptionCode,\n        \"STATEMENT_PUBLISH_EXCEPTION\": generateExceptionPublishCode,\n        \"STATEMENT_INJECT_C_CODE\": generateInjectCCode,\n    }\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CodeHelperSelection.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Select from code helpers.\n\nThis aims at being general, but right now is only used for comparison code helpers.\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .c_types.CTypePyObjectPointers import CTypePyObjectPtr\nfrom .Reports import onMissingHelper\n\n\ndef selectCodeHelper(\n    prefix,\n    specialized_helpers_set,\n    non_specialized_helpers_set,\n    result_type,\n    left_shape,\n    right_shape,\n    left_c_type,\n    right_c_type,\n    argument_swap,\n    report_missing,\n    source_ref,\n):\n    if argument_swap:\n        left_shape, right_shape = right_shape, left_shape\n        left_c_type, right_c_type = right_c_type, left_c_type\n\n    left_helper = (\n        left_shape.helper_code\n        if left_c_type is CTypePyObjectPtr\n        else left_c_type.helper_code\n    )\n    right_helper = (\n        right_shape.helper_code\n        if right_c_type is CTypePyObjectPtr\n        else right_c_type.helper_code\n    )\n\n    helper_function = \"%s_%s%s_%s\" % (\n        prefix,\n        (\"%s_\" % result_type.helper_code) if result_type is not None else \"\",\n        left_helper,\n        right_helper,\n    )\n\n    if helper_function not in specialized_helpers_set:\n        if (\n            report_missing\n            and Options.is_report_missing\n            and (\n                not non_specialized_helpers_set\n                or helper_function not in non_specialized_helpers_set\n            )\n        ):\n            onMissingHelper(helper_function, source_ref)\n\n        # print(helper_function, source_ref, len(specialized_helpers_set))\n\n        helper_function = None\n\n    return result_type, helper_function\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CodeHelpers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Helpers for code generation.\n\nThis dispatch building of expressions and statements, as well as providing\ntypical support functions to building parts.\n\n\"\"\"\n\nfrom contextlib import contextmanager\n\nfrom nuitka.nodes.NodeMetaClasses import NuitkaNodeDesignError\nfrom nuitka.Options import shallTraceExecution\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import printError\n\nfrom .Emission import withSubCollector\nfrom .LabelCodes import getGotoCode, getLabelCode, getStatementTrace\n\nexpression_dispatch_dict = {}\n\n_ignore_list_overrides = set((\"EXPRESSION_STR_OPERATION_FORMAT\",))\n\n\ndef addExpressionDispatchDict(dispatch_dict):\n    for key, value in dispatch_dict.items():\n        if key in expression_dispatch_dict:\n            if key not in _ignore_list_overrides:\n                assert False, key\n\n            continue\n\n        expression_dispatch_dict[key] = value\n\n\ndef generateExpressionCode(to_name, expression, emit, context, allow_none=False):\n    try:\n        _generateExpressionCode(\n            to_name=to_name,\n            expression=expression,\n            emit=emit,\n            context=context,\n            allow_none=allow_none,\n        )\n    except Exception:\n        printError(\n            \"Problem with %r at %s\"\n            % (\n                expression,\n                (\n                    \"\"\n                    if expression is None\n                    else expression.getSourceReference().getAsString()\n                ),\n            )\n        )\n        raise\n\n\ndef _generateExpressionCode(to_name, expression, emit, context, allow_none=False):\n    # This is a dispatching function for every expression.\n\n    if expression is None and allow_none:\n        return None\n\n    # Make sure we don't generate code twice for any node, this uncovers bugs\n    # where nodes are shared in the tree, which is not allowed.\n    assert not hasattr(expression, \"code_generated\"), expression\n    expression.code_generated = True\n\n    try:\n        code_generator = expression_dispatch_dict[expression.kind]\n    except KeyError:\n        raise NuitkaNodeDesignError(\n            expression.__class__.__name__,\n            \"Need to provide code generation as well\",\n            expression.kind,\n        )\n\n    with context.withCurrentSourceCodeReference(expression.getSourceReference()):\n        code_generator(\n            to_name=to_name, expression=expression, emit=emit, context=context\n        )\n\n\ndef generateExpressionsCode(names, expressions, emit, context):\n    assert len(names) == len(expressions)\n\n    result = []\n    for name, expression in zip(names, expressions):\n        if expression is not None:\n            to_name = context.allocateTempName(name)\n\n            generateExpressionCode(\n                to_name=to_name, expression=expression, emit=emit, context=context\n            )\n        else:\n            to_name = None\n\n        result.append(to_name)\n\n    return result\n\n\ndef generateChildExpressionsCode(expression, emit, context):\n    value_names = []\n\n    for child_name, child_value in expression.getVisitableNodesNamed():\n        if type(child_value) is tuple:\n            child_names = []\n\n            for child_val in child_value:\n                value_name = context.allocateTempName(child_name + \"_value\")\n\n                generateExpressionCode(\n                    to_name=value_name,\n                    expression=child_val,\n                    emit=emit,\n                    context=context,\n                )\n\n                child_names.append(value_name)\n\n            value_names.append(tuple(child_names))\n        elif child_value is not None:\n            # Allocate anyway, so names are aligned.\n            value_name = context.allocateTempName(child_name + \"_value\")\n\n            generateExpressionCode(\n                to_name=value_name, expression=child_value, emit=emit, context=context\n            )\n\n            value_names.append(value_name)\n        else:\n            # Allocate anyway, so names are aligned.\n            context.skipTempName(child_name + \"_value\")\n\n            value_names.append(None)\n\n    return value_names\n\n\ndef generateChildExpressionCode(expression, emit, context, child_name=None):\n    assert expression is not None\n\n    if child_name is None:\n        child_name = expression.getChildName()\n\n    # Allocate anyway, so names are aligned.\n    value_name = context.allocateTempName(\n        child_name + \"_value\",\n    )\n\n    generateExpressionCode(\n        to_name=value_name, expression=expression, emit=emit, context=context\n    )\n\n    return value_name\n\n\nstatement_dispatch_dict = {}\n\n\ndef setStatementDispatchDict(dispatch_dict):\n    # Using global here, as this is really a singleton, in the form of a module,\n    # and this is to break the cyclic dependency it has, pylint: disable=global-statement\n\n    # Please call us only once.\n    global statement_dispatch_dict\n\n    assert not statement_dispatch_dict\n    statement_dispatch_dict = dispatch_dict\n\n\ndef generateStatementCode(statement, emit, context):\n    try:\n        statement_dispatch_dict[statement.kind](\n            statement=statement, emit=emit, context=context\n        )\n\n        # Complain if any temporary was not dealt with yet.\n        assert not context.getCleanupTempNames(), context.getCleanupTempNames()\n    except Exception:\n        printError(\n            \"Problem with %r at %s\"\n            % (statement, statement.getSourceReference().getAsString())\n        )\n        raise\n\n\ndef _generateStatementSequenceCode(statement_sequence, emit, context):\n    if statement_sequence is None:\n        return\n\n    for statement in statement_sequence.subnode_statements:\n        if shallTraceExecution():\n            source_ref = statement.getSourceReference()\n\n            statement_repr = repr(statement)\n            source_repr = source_ref.getAsString()\n\n            if python_version >= 0x300:\n                statement_repr = statement_repr.encode(\"utf8\")\n                source_repr = source_repr.encode(\"utf8\")\n\n            emit(getStatementTrace(source_repr, statement_repr))\n\n        # Might contain frame statement sequences as children.\n        if statement.isStatementsFrame():\n            from .FrameCodes import generateStatementsFrameCode\n\n            generateStatementsFrameCode(\n                statement_sequence=statement, emit=emit, context=context\n            )\n        else:\n            with withSubCollector(emit, context) as statement_emit:\n                generateStatementCode(\n                    statement=statement, emit=statement_emit, context=context\n                )\n\n\ndef generateStatementSequenceCode(statement_sequence, emit, context, allow_none=False):\n    if allow_none and statement_sequence is None:\n        return None\n\n    assert statement_sequence.kind == \"STATEMENTS_SEQUENCE\", statement_sequence\n\n    _generateStatementSequenceCode(\n        statement_sequence=statement_sequence, emit=emit, context=context\n    )\n\n\ndef decideConversionCheckNeeded(to_name, expression):\n    if to_name.c_type == \"nuitka_bool\":\n        conversion_check = expression.mayRaiseExceptionBool(BaseException)\n    else:\n        conversion_check = False\n\n    return conversion_check\n\n\n# TODO: Get rid of the duplication of code with\n# \"withObjectCodeTemporaryAssignment\" by setting on one of them.\n\n\n@contextmanager\ndef withObjectCodeTemporaryAssignment2(\n    to_name, value_name, needs_conversion_check, emit, context\n):\n    \"\"\"Converting to the target type, provide temporary object value name only if necessary.\"\"\"\n\n    if to_name.c_type == \"PyObject *\":\n        value_name = to_name\n    else:\n        value_name = context.allocateTempName(value_name)\n\n    yield value_name\n\n    if to_name is not value_name:\n        # This is also tasked to release value_name.\n        to_name.getCType().emitAssignConversionCode(\n            to_name=to_name,\n            value_name=value_name,\n            needs_check=needs_conversion_check,\n            emit=emit,\n            context=context,\n        )\n\n\n@contextmanager\ndef withObjectCodeTemporaryAssignment(to_name, value_name, expression, emit, context):\n    \"\"\"Converting to the target type, provide temporary object value name only if necessary.\"\"\"\n\n    if to_name.c_type == \"PyObject *\":\n        value_name = to_name\n    else:\n        value_name = context.allocateTempName(value_name)\n\n    yield value_name\n\n    if to_name is not value_name:\n        to_name.getCType().emitAssignConversionCode(\n            to_name=to_name,\n            value_name=value_name,\n            needs_check=decideConversionCheckNeeded(to_name, expression),\n            emit=emit,\n            context=context,\n        )\n\n        from .ErrorCodes import getReleaseCode\n\n        getReleaseCode(value_name, emit, context)\n\n\ndef assignConstantNoneResult(to_name, emit, context):\n    # TODO: This is also in SetCode, and should be common for statement only\n    # operations that return None in Python, but only in case of non-error\n    to_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=to_name, constant=None, may_escape=False, emit=emit, context=context\n    )\n\n    # This assignment will not necessarily use it, and since it is borrowed,\n    # debug mode would otherwise complain.\n    if to_name.c_type == \"nuitka_void\":\n        to_name.maybe_unused = True\n\n\nclass HelperCallHandle(object):\n    def __init__(\n        self,\n        helper_name,\n        target_type,\n        helper_target,\n        left_shape,\n        helper_left,\n        right_shape,\n        helper_right,\n    ):\n        self.helper_name = helper_name\n        self.target_type = target_type\n        self.helper_target = helper_target\n        self.left_shape = left_shape\n        self.helper_left = helper_left\n        self.right_shape = right_shape\n        self.helper_right = helper_right\n\n    def __str__(self):\n        return self.helper_name\n\n    def emitHelperCall(self, to_name, arg_names, ref_count, needs_check, emit, context):\n        if (\n            self.target_type is not None\n            and self.target_type.helper_code != self.helper_target.helper_code\n        ):\n            value_name = context.allocateTempName(\n                to_name.code_name + \"_\" + self.helper_target.helper_code.lower(),\n                type_name=self.helper_target.c_type,\n                unique=to_name.code_name == \"tmp_unused\",\n            )\n        else:\n            value_name = to_name\n\n        emit(\n            \"%s = %s(%s);\"\n            % (\n                value_name,\n                self.helper_name,\n                \", \".join(\n                    \"%s%s\"\n                    % (\n                        \"&\" if count == 0 and \"INPLACE\" in self.helper_name else \"\",\n                        arg_name,\n                    )\n                    for count, arg_name in enumerate(arg_names)\n                ),\n            )\n        )\n\n        # TODO: Move helper calling to something separate.\n        from .ErrorCodes import (\n            getErrorExitCode,\n            getReleaseCode,\n            getReleaseCodes,\n        )\n\n        # TODO: Have a method to indicate these.\n        if value_name.getCType().c_type != \"bool\":\n            getErrorExitCode(\n                check_name=value_name,\n                release_names=arg_names,\n                needs_check=needs_check,\n                emit=emit,\n                context=context,\n            )\n        else:\n            getReleaseCodes(arg_names, emit, context)\n\n        if ref_count:\n            context.addCleanupTempName(value_name)\n\n        if (\n            self.target_type is not None\n            and self.target_type.helper_code != self.helper_target.helper_code\n        ):\n            if self.target_type.helper_code in (\"NBOOL\", \"NVOID\", \"CBOOL\"):\n                self.target_type.emitAssignConversionCode(\n                    to_name=to_name,\n                    value_name=value_name,\n                    needs_check=needs_check,\n                    emit=emit,\n                    context=context,\n                )\n\n                # TODO: Push that release into the emitAssignConversionCode for higher efficiency\n                # in code generation, or else error releases are done as well as later release.\n                if ref_count:\n                    getReleaseCode(value_name, emit, context)\n            else:\n                assert False, (\n                    self.target_type.helper_code,\n                    self.helper_target.helper_code,\n                )\n\n\n@contextmanager\ndef withCleanupFinally(name, release_name, needs_exception, emit, context):\n    assert not context.needsCleanup(release_name)\n\n    if needs_exception:\n        exception_target = context.allocateLabel(\"%s_exception\" % name)\n        old_exception_target = context.setExceptionEscape(exception_target)\n\n    with withSubCollector(emit, context) as guarded_emit:\n        yield guarded_emit\n\n    assert not context.needsCleanup(release_name)\n    context.addCleanupTempName(release_name)\n\n    if needs_exception:\n        noexception_exit = context.allocateLabel(\"%s_noexception\" % name)\n        getGotoCode(noexception_exit, emit)\n\n        context.setExceptionEscape(old_exception_target)\n\n        emit(\"// Exception handling pass through code for %s:\" % name)\n        getLabelCode(exception_target, emit)\n\n        from .ErrorCodes import getErrorExitReleaseCode\n\n        emit(getErrorExitReleaseCode(context))\n\n        getGotoCode(old_exception_target, emit)\n\n        emit(\"// Finished with no exception for %s:\" % name)\n        getLabelCode(noexception_exit, emit)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CodeObjectCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for code objects.\n\nRight now only the creation is done here. But more should be added later on.\n\"\"\"\n\nimport os\n\nfrom nuitka.__past__ import unicode\nfrom nuitka.Options import getFileReferenceMode\nfrom nuitka.PythonVersions import python_version\n\n\ndef getCodeObjectsDeclCode(context):\n    statements = []\n\n    for _code_object_key, code_identifier in context.getCodeObjects():\n        declaration = \"static PyCodeObject *%s;\" % code_identifier\n\n        statements.append(declaration)\n\n    if context.getOwner().getFullName() == \"__main__\":\n        statements.append('/* For use in \"MainProgram.c\". */')\n        statements.append(\"PyCodeObject *codeobj_main = NULL;\")\n\n    return statements\n\n\ndef _getMakeCodeObjectArgs(code_object_handle, context):\n    \"\"\"Code objects have many flags for creation.\n\n    This is also version dependent, but we hide this behind macros\n    that ignore some arguments.\n    \"\"\"\n\n    co_flags = []\n\n    if code_object_handle.co_kind in (\"Module\", \"Class\", \"Function\"):\n        pass\n    elif code_object_handle.co_kind == \"Generator\":\n        co_flags.append(\"CO_GENERATOR\")\n    elif code_object_handle.co_kind == \"Coroutine\":\n        co_flags.append(\"CO_COROUTINE\")\n    elif code_object_handle.co_kind == \"Asyncgen\":\n        co_flags.append(\"CO_ASYNC_GENERATOR\")\n    else:\n        assert False, code_object_handle.co_kind\n\n    if code_object_handle.is_optimized:\n        co_flags.append(\"CO_OPTIMIZED\")\n\n    if code_object_handle.co_new_locals:\n        co_flags.append(\"CO_NEWLOCALS\")\n\n    if code_object_handle.co_has_starlist:\n        co_flags.append(\"CO_VARARGS\")\n\n    if code_object_handle.co_has_stardict:\n        co_flags.append(\"CO_VARKEYWORDS\")\n\n    if not code_object_handle.co_freevars and python_version < 0x3B0:\n        co_flags.append(\"CO_NOFREE\")\n\n    co_flags.extend(code_object_handle.future_flags)\n\n    return (\n        code_object_handle.line_number,\n        \" | \".join(co_flags) or \"0\",\n        context.getConstantCode(constant=code_object_handle.co_name),\n        context.getConstantCode(constant=code_object_handle.co_qualname),\n        (\n            context.getConstantCode(constant=code_object_handle.co_varnames)\n            if code_object_handle.co_varnames\n            else \"NULL\"\n        ),\n        (\n            context.getConstantCode(constant=code_object_handle.co_freevars)\n            if code_object_handle.co_freevars\n            else \"NULL\"\n        ),\n        code_object_handle.co_argcount,\n        code_object_handle.co_kwonlyargcount,\n        code_object_handle.co_posonlyargcount,\n    )\n\n\ndef getCodeObjectsInitCode(context):\n    # There is a bit of details to this, and we are making some optimizations as\n    # well as customization to what path should be put there.\n\n    statements = []\n\n    code_objects = context.getCodeObjects()\n\n    # Create the always identical, but dynamic filename first thing.\n    module_filename = context.getOwner().getRunTimeFilename()\n\n    # We do not care about release of this object, as code object live\n    # forever anyway.\n    if getFileReferenceMode() == \"frozen\" or os.path.isabs(module_filename):\n        template = \"module_filename_obj = %s; CHECK_OBJECT(module_filename_obj);\"\n    else:\n        template = \"module_filename_obj = MAKE_RELATIVE_PATH(%s); CHECK_OBJECT(module_filename_obj);\"\n\n    if str is bytes and type(module_filename) is unicode:\n        module_filename = module_filename.encode(\"utf8\")\n\n    # The code object will not work from any other type, cannot be e.g. unicode.\n    assert type(module_filename) is str, (type(module_filename), module_filename)\n\n    statements.append(template % (context.getConstantCode(constant=module_filename)))\n\n    for code_object_key, code_identifier in code_objects:\n        # Make sure the filename is always identical.\n        assert code_object_key.co_filename == module_filename, code_object_key\n\n        args = (\n            code_identifier,\n            \", \".join(str(s) for s in _getMakeCodeObjectArgs(code_object_key, context)),\n        )\n\n        code = \"%s = MAKE_CODE_OBJECT(module_filename_obj, %s);\" % args\n\n        statements.append(code)\n\n        if context.getOwner().getFullName() == \"__main__\":\n            if code_object_key[1] == \"<module>\":\n                statements.append(\"codeobj_main = %s;\" % code_identifier)\n\n    return statements\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ComparisonCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Comparison related codes.\n\nRich comparisons, \"in\", and \"not in\", also \"is\", and \"is not\", and the\n\"isinstance\" check as used in conditions, as well as exception matching.\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_frozenset,\n    tshape_set,\n)\nfrom nuitka.nodes.shapes.StandardShapes import tshape_unknown\nfrom nuitka.PythonOperators import (\n    comparison_inversions,\n    rich_comparison_arg_swaps,\n)\n\nfrom .c_types.CTypeBooleans import CTypeBool\nfrom .c_types.CTypeNuitkaBooleans import CTypeNuitkaBoolEnum\nfrom .c_types.CTypeNuitkaVoids import CTypeNuitkaVoidEnum\nfrom .c_types.CTypePyObjectPointers import CTypePyObjectPtr\nfrom .CodeHelpers import generateChildExpressionsCode, generateExpressionCode\nfrom .CodeHelperSelection import selectCodeHelper\nfrom .ComparisonHelperDefinitions import (\n    getNonSpecializedComparisonOperations,\n    getSpecializedComparisonOperations,\n    rich_comparison_codes,\n    rich_comparison_subset_codes,\n)\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getReleaseCode,\n    getReleaseCodes,\n)\nfrom .ExpressionCTypeSelectionHelpers import decideExpressionCTypes\n\n\ndef _handleArgumentSwapAndInversion(\n    comparator, needs_argument_swap, left_c_type, right_c_type\n):\n    needs_result_inversion = False\n    if needs_argument_swap:\n        comparator = rich_comparison_arg_swaps[comparator]\n    else:\n        # Same types, we can swap too, but this time to avoid the comparator variety.\n        if (\n            left_c_type is right_c_type\n            and comparator not in rich_comparison_subset_codes\n        ):\n            needs_result_inversion = True\n            comparator = comparison_inversions[comparator]\n\n    return comparator, needs_result_inversion\n\n\ndef getRichComparisonCode(\n    to_name, comparator, left, right, needs_check, source_ref, emit, context\n):\n    # This is detail rich stuff, encoding the complexity of what helpers are\n    # available, and can be used as a fallback.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    # TODO: Move the value_name to a context generator, then this will be\n    # a bit less complex.\n    (\n        unknown_types,\n        needs_argument_swap,\n        left_shape,\n        right_shape,\n        left_c_type,\n        right_c_type,\n    ) = decideExpressionCTypes(left=left, right=right, may_swap_arguments=\"always\")\n\n    if unknown_types:\n        assert not needs_argument_swap\n        needs_result_inversion = False\n    else:\n        # Same types, we can swap too, but this time to avoid the comparator variety.\n        comparator, needs_result_inversion = _handleArgumentSwapAndInversion(\n            comparator, needs_argument_swap, left_c_type, right_c_type\n        )\n\n    # If a more specific C type was picked that \"PyObject *\" then we can use that to have the helper.\n    helper_type = target_type = to_name.getCType()\n\n    if needs_check:\n        # If an exception may occur, we do not have the \"NVOID\" helpers though, we\n        # instead can use the CTypeNuitkaBoolEnum that will easily convert to\n        # it.\n        if helper_type is CTypeNuitkaVoidEnum:\n            helper_type = CTypeNuitkaBoolEnum\n\n        # Need to represent the intermediate exception, so we cannot have that.\n        if helper_type is CTypeBool:\n            helper_type = CTypeNuitkaBoolEnum\n\n        report_missing = True\n    else:\n        # If no exception can occur, do not require a helper that can indicate\n        # it, but use the one that produces simpler code, this means we can\n        # avoid the CTypeNuitkaBoolEnum (NBOOL) helpers except for things that\n        # can really raise. Once we have expression for types depending on the\n        # value to raise or not, this will get us into trouble, due to using a\n        # fallback\n        helper_type = CTypeBool\n        report_missing = False\n\n    specialized_helpers_set = getSpecializedComparisonOperations()\n    non_specialized_helpers_set = getNonSpecializedComparisonOperations()\n\n    prefix = \"RICH_COMPARE_\" + rich_comparison_codes[comparator]\n\n    helper_type, helper_function = selectCodeHelper(\n        prefix=prefix,\n        specialized_helpers_set=specialized_helpers_set,\n        non_specialized_helpers_set=non_specialized_helpers_set,\n        result_type=helper_type,\n        left_shape=left_shape,\n        right_shape=right_shape,\n        left_c_type=left_c_type,\n        right_c_type=right_c_type,\n        argument_swap=needs_argument_swap,\n        report_missing=report_missing,\n        source_ref=source_ref,\n    )\n\n    # If we failed to find CTypeBool, that should be OK.\n    if helper_function is None and not report_missing:\n        helper_type, helper_function = selectCodeHelper(\n            prefix=prefix,\n            specialized_helpers_set=specialized_helpers_set,\n            non_specialized_helpers_set=non_specialized_helpers_set,\n            result_type=CTypeNuitkaBoolEnum,\n            left_shape=left_shape,\n            right_shape=right_shape,\n            left_c_type=left_c_type,\n            right_c_type=right_c_type,\n            argument_swap=needs_argument_swap,\n            report_missing=True,\n            source_ref=source_ref,\n        )\n\n    # print(\"PICKED\", left, right, left_c_type, right_c_type, helper_function)\n\n    if helper_function is None:\n        # Give up and warn about it.\n        left_c_type = CTypePyObjectPtr\n        right_c_type = CTypePyObjectPtr\n\n        helper_type, helper_function = selectCodeHelper(\n            prefix=prefix,\n            specialized_helpers_set=specialized_helpers_set,\n            non_specialized_helpers_set=non_specialized_helpers_set,\n            result_type=helper_type,\n            left_shape=tshape_unknown,\n            right_shape=tshape_unknown,\n            left_c_type=left_c_type,\n            right_c_type=right_c_type,\n            argument_swap=needs_argument_swap,\n            report_missing=True,\n            source_ref=source_ref,\n        )\n\n        assert helper_function is not None, (to_name, left_shape, right_shape)\n\n    left_name = context.allocateTempName(\"cmp_expr_left\", type_name=left_c_type.c_type)\n    right_name = context.allocateTempName(\n        \"cmp_expr_right\", type_name=right_c_type.c_type\n    )\n\n    generateExpressionCode(\n        to_name=left_name, expression=left, emit=emit, context=context\n    )\n    generateExpressionCode(\n        to_name=right_name, expression=right, emit=emit, context=context\n    )\n\n    if needs_argument_swap:\n        arg1_name = right_name\n        arg2_name = left_name\n    else:\n        arg1_name = left_name\n        arg2_name = right_name\n\n    # May need to convert return value.\n    if helper_type is not target_type:\n        value_name = context.allocateTempName(\n            to_name.code_name + \"_\" + helper_type.helper_code.lower(),\n            type_name=helper_type.c_type,\n            unique=to_name.code_name == \"tmp_unused\",\n        )\n    else:\n        value_name = to_name\n\n    emit(\n        \"%s = %s(%s, %s);\"\n        % (\n            value_name,\n            helper_function,\n            arg1_name,\n            arg2_name,\n        )\n    )\n\n    if value_name.getCType().hasErrorIndicator():\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(left_name, right_name),\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n    else:\n        # Otherwise we picked the wrong kind of helper.\n        assert not needs_check, (\n            to_name,\n            left_shape,\n            right_shape,\n            helper_function,\n            value_name.getCType(),\n        )\n\n        getReleaseCodes(\n            release_names=(left_name, right_name), emit=emit, context=context\n        )\n\n    # TODO: Depending on operation, we could not produce a reference, if result *must*\n    # be boolean, but then we would have some helpers that do it, and some that do not\n    # do it.\n    if helper_type is CTypePyObjectPtr:\n        context.addCleanupTempName(value_name)\n\n    if value_name is not to_name:\n        target_type.emitAssignConversionCode(\n            to_name=to_name,\n            value_name=value_name,\n            # TODO: Right now we don't do conversions here that could fail.\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n    # When this is done on freshly assigned \"Py_True\" and \"Py_False\", the C\n    # compiler should be able to optimize it away by inlining \"CHECK_IF_TRUE\"\n    # branches on these two values.\n    if needs_result_inversion:\n        target_type.emitAssignInplaceNegatedValueCode(\n            to_name=to_name,\n            # We only do get here, target_type doesn't cause issues.\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateComparisonExpressionCode(to_name, expression, emit, context):\n    left = expression.subnode_left\n    right = expression.subnode_right\n\n    comparator = expression.getComparator()\n\n    type_name = \"PyObject *\"\n    if comparator in (\"Is\", \"IsNot\"):\n        if left.getTypeShape() is tshape_bool and right.getTypeShape() is tshape_bool:\n            type_name = \"nuitka_bool\"\n\n    left_name = context.allocateTempName(\"cmp_expr_left\", type_name=type_name)\n    right_name = context.allocateTempName(\"cmp_expr_right\", type_name=type_name)\n\n    generateExpressionCode(\n        to_name=left_name, expression=left, emit=emit, context=context\n    )\n    generateExpressionCode(\n        to_name=right_name, expression=right, emit=emit, context=context\n    )\n\n    if comparator in (\"In\", \"NotIn\"):\n        needs_check = right.mayRaiseExceptionIn(BaseException, expression.subnode_left)\n\n        res_name = context.getIntResName()\n\n        right_shape = right.getTypeShape()\n\n        if right_shape in (tshape_set, tshape_frozenset):\n            c_api = \"PySet_Contains\"\n        else:\n            c_api = \"PySequence_Contains\"\n\n        emit(\n            \"%s = %s(%s, %s);\"\n            % (\n                res_name,\n                c_api,\n                right_name,\n                left_name,\n            )  # sequence goes first in the API.\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % res_name,\n            release_names=(left_name, right_name),\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name,\n            condition=\"%s == %d\" % (res_name, 1 if comparator == \"In\" else 0),\n            emit=emit,\n        )\n    elif comparator == \"Is\":\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=\"%s == %s\" % (left_name, right_name), emit=emit\n        )\n\n        getReleaseCodes(\n            release_names=(left_name, right_name), emit=emit, context=context\n        )\n    elif comparator == \"IsNot\":\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=\"%s != %s\" % (left_name, right_name), emit=emit\n        )\n\n        getReleaseCodes(\n            release_names=(left_name, right_name), emit=emit, context=context\n        )\n    elif comparator in (\"exception_match\", \"exception_mismatch\"):\n        needs_check = expression.mayRaiseExceptionComparison()\n\n        res_name = context.getIntResName()\n\n        emit(\n            \"%s = EXCEPTION_MATCH_BOOL(tstate, %s, %s);\"\n            % (res_name, left_name, right_name)\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % res_name,\n            release_names=(left_name, right_name),\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name,\n            condition=\"%s %s 0\"\n            % (res_name, \"!=\" if comparator == \"exception_match\" else \"==\"),\n            emit=emit,\n        )\n    else:\n        assert False, comparator\n\n\ndef generateRichComparisonExpressionCode(to_name, expression, emit, context):\n    return getRichComparisonCode(\n        to_name=to_name,\n        comparator=expression.getComparator(),\n        left=expression.subnode_left,\n        right=expression.subnode_right,\n        needs_check=expression.mayRaiseExceptionComparison(),\n        source_ref=expression.source_ref,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinIsinstanceCode(to_name, expression, emit, context):\n    inst_name = context.allocateTempName(\"isinstance_inst\")\n    cls_name = context.allocateTempName(\"isinstance_cls\")\n\n    generateExpressionCode(\n        to_name=inst_name,\n        expression=expression.subnode_instance,\n        emit=emit,\n        context=context,\n    )\n    generateExpressionCode(\n        to_name=cls_name,\n        expression=expression.subnode_classes,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = PyObject_IsInstance(%s, %s);\" % (res_name, inst_name, cls_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(inst_name, cls_name),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n    )\n\n\ndef generateBuiltinIssubclassCode(to_name, expression, emit, context):\n    cls_name = context.allocateTempName(\"issubclass_cls\")\n    classes_name = context.allocateTempName(\"issubclass_classes\")\n\n    generateExpressionCode(\n        to_name=cls_name,\n        expression=expression.subnode_cls,\n        emit=emit,\n        context=context,\n    )\n    generateExpressionCode(\n        to_name=classes_name,\n        expression=expression.subnode_classes,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = PyObject_IsSubclass(%s, %s);\" % (res_name, cls_name, classes_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(cls_name, classes_name),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n    )\n\n\ndef generateTypeCheckCode(to_name, expression, emit, context):\n    cls_name = context.allocateTempName(\"type_check_cls\")\n\n    generateExpressionCode(\n        to_name=cls_name,\n        expression=expression.subnode_cls,\n        emit=emit,\n        context=context,\n    )\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = PyType_Check(%s);\" % (res_name, cls_name))\n\n    getReleaseCode(\n        release_name=cls_name,\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s != 0\" % res_name, emit=emit\n    )\n\n\ndef generateSubtypeCheckCode(to_name, expression, emit, context):\n    left_name, right_name = generateChildExpressionsCode(\n        expression=expression,\n        emit=emit,\n        context=context,\n    )\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = Nuitka_Type_IsSubtype((PyTypeObject *)%s, (PyTypeObject *)%s);\"\n        % (res_name, left_name, right_name)\n    )\n\n    getReleaseCodes(\n        release_names=(left_name, right_name),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=res_name, emit=emit\n    )\n\n\ndef generateMatchTypeCheckMappingCode(to_name, expression, emit, context):\n    cls_name = context.allocateTempName(\"mapping_check_cls\")\n\n    generateExpressionCode(\n        to_name=cls_name,\n        expression=expression.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = Py_TYPE(%s)->tp_flags & Py_TPFLAGS_MAPPING;\" % (res_name, cls_name))\n\n    getReleaseCode(\n        release_name=cls_name,\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s\" % res_name, emit=emit\n    )\n\n\ndef generateMatchTypeCheckSequenceCode(to_name, expression, emit, context):\n    cls_name = context.allocateTempName(\"sequence_check_cls\")\n\n    generateExpressionCode(\n        to_name=cls_name,\n        expression=expression.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = Py_TYPE(%s)->tp_flags & Py_TPFLAGS_SEQUENCE;\" % (res_name, cls_name))\n\n    getReleaseCode(\n        release_name=cls_name,\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s\" % res_name, emit=emit\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ComparisonHelperDefinitions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Shared definitions of what comparison operation helpers are available.\n\nThese are functions to work with helper names, as well as sets of functions to\ngenerate specialized code variants for.\n\nNote: These are ordered, so we can define the order they are created in the\ncode generation of specialized helpers, as this set is used for input there\ntoo.\n\n\"\"\"\n\nfrom nuitka.containers.OrderedSets import buildOrderedSet\n\n# Mapping of rich comparison Python level name, to C level name of helpers.\nrich_comparison_codes = {\n    \"Lt\": \"LT\",\n    \"LtE\": \"LE\",\n    \"Eq\": \"EQ\",\n    \"NotEq\": \"NE\",\n    \"Gt\": \"GT\",\n    \"GtE\": \"GE\",\n}\n\n# Subset of comparisons which will be used for identical types.\nrich_comparison_subset_codes = {\n    \"Lt\": \"LT\",\n    \"LtE\": \"LE\",\n    \"Eq\": \"EQ\",\n}\n\n\ndef _makeDefaultOps():\n    for comparator in rich_comparison_codes.values():\n        yield \"RICH_COMPARE_%s_OBJECT_OBJECT_OBJECT\" % comparator\n        yield \"RICH_COMPARE_%s_NBOOL_OBJECT_OBJECT\" % comparator\n\n\ndef _makeTypeOps(type_name, may_raise_same_type, shortcut=False):\n    for result_part in \"OBJECT\", \"CBOOL\", \"NBOOL\":\n        for comparator in rich_comparison_codes.values():\n            if result_part == \"CBOOL\":\n                continue\n\n            yield \"RICH_COMPARE_%s_%s_OBJECT_%s\" % (comparator, result_part, type_name)\n            yield \"RICH_COMPARE_%s_%s_%s_OBJECT\" % (comparator, result_part, type_name)\n\n        if may_raise_same_type and result_part == \"CBOOL\":\n            continue\n        if not may_raise_same_type and result_part == \"NBOOL\":\n            continue\n\n        for comparator in (\n            rich_comparison_codes.values()\n            if not shortcut\n            else rich_comparison_subset_codes.values()\n        ):\n            yield \"RICH_COMPARE_%s_%s_%s_%s\" % (\n                comparator,\n                result_part,\n                type_name,\n                type_name,\n            )\n\n\ndef _makeFriendOps(type_name1, type_name2, may_raise):\n    assert type_name1 != type_name2\n\n    for result_part in \"OBJECT\", \"CBOOL\", \"NBOOL\":\n        if not may_raise:\n            if result_part == \"NBOOL\":\n                continue\n\n        for comparator in rich_comparison_codes.values():\n            yield \"RICH_COMPARE_%s_%s_%s_%s\" % (\n                comparator,\n                result_part,\n                type_name1,\n                type_name2,\n            )\n\n\nspecialized_cmp_helpers_set = buildOrderedSet(\n    # Default implementation.\n    _makeDefaultOps(),\n    # Pure types:\n    _makeTypeOps(\"STR\", may_raise_same_type=False, shortcut=True),\n    _makeTypeOps(\"UNICODE\", may_raise_same_type=False, shortcut=True),\n    _makeTypeOps(\"BYTES\", may_raise_same_type=False, shortcut=True),\n    _makeTypeOps(\"INT\", may_raise_same_type=False, shortcut=True),\n    _makeTypeOps(\"LONG\", may_raise_same_type=False, shortcut=True),\n    _makeTypeOps(\"FLOAT\", may_raise_same_type=False, shortcut=True),\n    # TODO: What would shortcut mean, how do tuples compare their elements then?\n    _makeTypeOps(\"TUPLE\", may_raise_same_type=True),\n    _makeTypeOps(\"LIST\", may_raise_same_type=True),\n    # Mixed Python types:\n    _makeFriendOps(\"LONG\", \"INT\", may_raise=False),\n    # Partial Python with C types\n    _makeFriendOps(\"INT\", \"CLONG\", may_raise=False),\n    _makeFriendOps(\"LONG\", \"DIGIT\", may_raise=False),\n    _makeFriendOps(\"FLOAT\", \"CFLOAT\", may_raise=False),\n    # TODO: Add \"CLONG_CLONG\" type ops once we use that for local variables too.\n)\n\n_non_specialized_cmp_helpers_set = set()\n\n\ndef getSpecializedComparisonOperations():\n    return specialized_cmp_helpers_set\n\n\ndef getNonSpecializedComparisonOperations():\n    return _non_specialized_cmp_helpers_set\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ConditionalCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Conditional statements related codes.\n\nBranches, conditions, truth checks.\n\"\"\"\n\nfrom .CodeHelpers import decideConversionCheckNeeded, generateExpressionCode\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getReleaseCode,\n    getTakeReferenceCode,\n)\nfrom .LabelCodes import getBranchingCode, getGotoCode, getLabelCode\n\n\ndef generateConditionCode(condition, emit, context):\n    if condition.mayRaiseExceptionBool(BaseException):\n        compare_name = context.allocateTempName(\"condition_result\", \"nuitka_bool\")\n    else:\n        compare_name = context.allocateTempName(\"condition_result\", \"bool\")\n\n    generateExpressionCode(\n        to_name=compare_name, expression=condition, emit=emit, context=context\n    )\n\n    getBranchingCode(\n        condition=compare_name.getCType().getTruthCheckCode(compare_name),\n        emit=emit,\n        context=context,\n    )\n\n    getReleaseCode(compare_name, emit, context)\n\n\ndef generateConditionalAndOrCode(to_name, expression, emit, context):\n    # This is a complex beast, handling both \"or\" and \"and\" expressions,\n    # and it needs to micro manage details.\n    # pylint: disable=too-many-locals\n    if expression.isExpressionConditionalOr():\n        prefix = \"or_\"\n    else:\n        prefix = \"and_\"\n\n    true_target = context.allocateLabel(prefix + \"left\")\n    false_target = context.allocateLabel(prefix + \"right\")\n    end_target = context.allocateLabel(prefix + \"end\")\n\n    old_true_target = context.getTrueBranchTarget()\n    old_false_target = context.getFalseBranchTarget()\n\n    truth_name = context.allocateTempName(prefix + \"left_truth\", \"int\")\n\n    left_name = context.allocateTempName(prefix + \"left_value\", to_name.c_type)\n    right_name = context.allocateTempName(prefix + \"right_value\", to_name.c_type)\n\n    left_value = expression.subnode_left\n\n    generateExpressionCode(\n        to_name=left_name, expression=left_value, emit=emit, context=context\n    )\n\n    # We need to treat this mostly manually here. We remember to release\n    # this, and we better do this manually later.\n    needs_ref1 = context.needsCleanup(left_name)\n\n    if expression.isExpressionConditionalOr():\n        context.setTrueBranchTarget(true_target)\n        context.setFalseBranchTarget(false_target)\n    else:\n        context.setTrueBranchTarget(false_target)\n        context.setFalseBranchTarget(true_target)\n\n    left_name.getCType().emitTruthCheckCode(\n        to_name=truth_name,\n        value_name=left_name,\n        emit=emit,\n    )\n\n    needs_check = left_value.mayRaiseExceptionBool(BaseException)\n\n    if needs_check:\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % truth_name,\n            needs_check=True,\n            emit=emit,\n            context=context,\n        )\n\n    getBranchingCode(condition=\"%s == 1\" % truth_name, emit=emit, context=context)\n\n    getLabelCode(false_target, emit)\n\n    # So it's not the left value, then lets release that one right away, it\n    # is not needed, but we remember if it should be added above.\n    getReleaseCode(release_name=left_name, emit=emit, context=context)\n\n    right_value = expression.subnode_right\n\n    # Evaluate the \"right\" value then.\n    generateExpressionCode(\n        to_name=right_name, expression=right_value, emit=emit, context=context\n    )\n\n    # Again, remember the reference count to manage it manually.\n    needs_ref2 = context.needsCleanup(right_name)\n\n    if needs_ref2:\n        context.removeCleanupTempName(right_name)\n\n    if not needs_ref2 and needs_ref1:\n        getTakeReferenceCode(right_name, emit)\n\n    to_name.getCType().emitAssignConversionCode(\n        to_name=to_name,\n        value_name=right_name,\n        needs_check=decideConversionCheckNeeded(to_name, right_value),\n        emit=emit,\n        context=context,\n    )\n\n    getGotoCode(end_target, emit)\n\n    getLabelCode(true_target, emit)\n\n    if not needs_ref1 and needs_ref2:\n        getTakeReferenceCode(left_name, emit)\n\n    to_name.getCType().emitAssignConversionCode(\n        to_name=to_name,\n        value_name=left_name,\n        needs_check=decideConversionCheckNeeded(to_name, left_value),\n        emit=emit,\n        context=context,\n    )\n\n    getLabelCode(end_target, emit)\n\n    if needs_ref1 or needs_ref2:\n        context.addCleanupTempName(to_name)\n\n    context.setTrueBranchTarget(old_true_target)\n    context.setFalseBranchTarget(old_false_target)\n\n\ndef generateConditionalCode(to_name, expression, emit, context):\n    true_target = context.allocateLabel(\"condexpr_true\")\n    false_target = context.allocateLabel(\"condexpr_false\")\n    end_target = context.allocateLabel(\"condexpr_end\")\n\n    old_true_target = context.getTrueBranchTarget()\n    old_false_target = context.getFalseBranchTarget()\n\n    context.setTrueBranchTarget(true_target)\n    context.setFalseBranchTarget(false_target)\n\n    generateConditionCode(\n        condition=expression.subnode_condition, emit=emit, context=context\n    )\n\n    getLabelCode(true_target, emit)\n    generateExpressionCode(\n        to_name=to_name,\n        expression=expression.subnode_expression_yes,\n        emit=emit,\n        context=context,\n    )\n    needs_ref1 = context.needsCleanup(to_name)\n\n    # Must not clean this up in other expression.\n    if needs_ref1:\n        context.removeCleanupTempName(to_name)\n\n    real_emit = emit\n    emit = SourceCodeCollector()\n\n    generateExpressionCode(\n        to_name=to_name,\n        expression=expression.subnode_expression_no,\n        emit=emit,\n        context=context,\n    )\n\n    needs_ref2 = context.needsCleanup(to_name)\n\n    # TODO: Need to buffer generated code, so we can emit extra reference if\n    # not same.\n    if needs_ref1 and not needs_ref2:\n        getGotoCode(end_target, real_emit)\n        getLabelCode(false_target, real_emit)\n\n        for line in emit.codes:\n            real_emit(line)\n        emit = real_emit\n\n        getTakeReferenceCode(to_name, emit)\n        context.addCleanupTempName(to_name)\n    elif not needs_ref1 and needs_ref2:\n        getTakeReferenceCode(to_name, real_emit)\n\n        getGotoCode(end_target, real_emit)\n        getLabelCode(false_target, real_emit)\n\n        for line in emit.codes:\n            real_emit(line)\n        emit = real_emit\n    else:\n        getGotoCode(end_target, real_emit)\n        getLabelCode(false_target, real_emit)\n\n        for line in emit.codes:\n            real_emit(line)\n        emit = real_emit\n\n    getLabelCode(end_target, emit)\n\n    context.setTrueBranchTarget(old_true_target)\n    context.setFalseBranchTarget(old_false_target)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ConstantCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Low level constant code generation.\n\nThis deals with constants, there creation, there access, and some checks about\nthem. Even mutable constants should not change during the course of the\nprogram.\n\nThere are shared constants, which are created for multiple modules to use, you\ncan think of them as globals. And there are module local constants, which are\nfor a single module only.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka import Options\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Serialization import ConstantAccessor\nfrom nuitka.utils.Distributions import getDistributionTopLevelPackageNames\nfrom nuitka.Version import getNuitkaVersionTuple\n\nfrom .CodeHelpers import withObjectCodeTemporaryAssignment\nfrom .ErrorCodes import getAssertionCode\nfrom .GlobalConstants import getConstantDefaultPopulation\nfrom .Namify import namifyConstant\nfrom .templates.CodeTemplatesConstants import template_constants_reading\nfrom .templates.CodeTemplatesModules import template_header_guard\n\n\ndef generateConstantReferenceCode(to_name, expression, emit, context):\n    \"\"\"Assign the constant behind the expression to to_name.\"\"\"\n\n    to_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=to_name,\n        constant=expression.getCompileTimeConstant(),\n        # Derive this from context.\n        may_escape=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateConstantGenericAliasCode(to_name, expression, emit, context):\n    # TODO: Have these as prepared constants as well, if args are not mutable.\n\n    origin_name = context.allocateTempName(\"generic_alias_origin\")\n    args_name = context.allocateTempName(\"generic_alias_args\")\n\n    origin_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=origin_name,\n        constant=expression.getCompileTimeConstant().__origin__,\n        may_escape=True,\n        emit=emit,\n        context=context,\n    )\n\n    args_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=args_name,\n        constant=expression.getCompileTimeConstant().__args__,\n        may_escape=True,\n        emit=emit,\n        context=context,\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"builtin_value\", expression, emit, context\n    ) as value_name:\n        emit(\"%s = Py_GenericAlias(%s, %s);\" % (value_name, origin_name, args_name))\n\n        getAssertionCode(check=\"%s != NULL\" % value_name, emit=emit)\n\n        context.addCleanupTempName(value_name)\n\n\ndef getConstantsDefinitionCode():\n    \"\"\"Create the code code \"__constants.c\" and \"__constants.h\" files.\n\n    This needs to create code to make all global constants (used in more\n    than one module) and create them.\n\n    \"\"\"\n    # Somewhat detail rich, pylint: disable=too-many-locals\n\n    constant_accessor = ConstantAccessor(\n        data_filename=\"__constants.const\", top_level_name=\"global_constants\"\n    )\n\n    lines = []\n\n    for constant_value in getConstantDefaultPopulation():\n        identifier = constant_accessor.getConstantCode(constant_value)\n\n        assert \"[\" in identifier, (identifier, constant_value)\n\n        lines.append(\"// %s\" % repr(constant_value))\n        lines.append(\n            \"#define const_%s %s\" % (namifyConstant(constant_value), identifier)\n        )\n\n    sys_executable = None\n\n    if not Options.shallMakeModule():\n        if Options.isStandaloneMode():\n            # The directory is added back at run time.\n            sys_executable = constant_accessor.getConstantCode(\n                os.path.basename(sys.executable)\n            )\n        else:\n            sys_executable = constant_accessor.getConstantCode(sys.executable)\n\n    sys_prefix = None\n    sys_base_prefix = None\n    sys_exec_prefix = None\n    sys_base_exec_prefix = None\n\n    # TODO: This part is needed for main program only, so do it there?\n    if not Options.shallMakeModule() and not Options.isStandaloneMode():\n        sys_prefix = constant_accessor.getConstantCode(sys.prefix)\n        sys_exec_prefix = constant_accessor.getConstantCode(sys.exec_prefix)\n\n        if python_version >= 0x300:\n            sys_base_prefix = constant_accessor.getConstantCode(sys.base_prefix)\n            sys_base_exec_prefix = constant_accessor.getConstantCode(\n                sys.base_exec_prefix\n            )\n\n    metadata_values_code = constant_accessor.getConstantCode(metadata_values)\n\n    lines.insert(\n        0,\n        \"extern PyObject *global_constants[%d];\"\n        % constant_accessor.getConstantsCount(),\n    )\n\n    header = template_header_guard % {\n        \"header_guard_name\": \"__NUITKA_GLOBAL_CONSTANTS_H__\",\n        \"header_body\": \"\\n\".join(lines),\n    }\n\n    major, minor, micro, is_final, _rc_number = getNuitkaVersionTuple()\n\n    body = template_constants_reading % {\n        \"global_constants_count\": constant_accessor.getConstantsCount(),\n        \"sys_executable\": sys_executable,\n        \"sys_prefix\": sys_prefix,\n        \"sys_base_prefix\": sys_base_prefix,\n        \"sys_exec_prefix\": sys_exec_prefix,\n        \"sys_base_exec_prefix\": sys_base_exec_prefix,\n        \"nuitka_version_major\": major,\n        \"nuitka_version_minor\": minor,\n        \"nuitka_version_micro\": micro,\n        \"nuitka_version_level\": \"release\" if is_final else \"candidate\",\n        \"metadata_values\": metadata_values_code,\n    }\n\n    return header, body\n\n\nmetadata_values = {}\n\n\ndef addDistributionMetadataValue(name, distribution):\n    # Extract what we need to from the distribution object.\n    metadata = str(\n        distribution.read_text(\"METADATA\") or distribution.read_text(\"PKG-INFO\") or \"\"\n    )\n\n    entry_points = str(distribution.read_text(\"entry_points.txt\") or \"\")\n\n    package_name = getDistributionTopLevelPackageNames(distribution)[0]\n\n    metadata_values[name] = (package_name, metadata, entry_points)\n\n\ndef getDistributionMetadataValues():\n    return sorted(tuple(metadata_values.items()))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/Contexts.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation contexts.\n\n\"\"\"\n\nimport collections\nfrom abc import abstractmethod\nfrom contextlib import contextmanager\n\nfrom nuitka import Options\nfrom nuitka.__past__ import iterItems\nfrom nuitka.Constants import isMutable\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Serialization import ConstantAccessor\nfrom nuitka.utils.Hashing import getStringHash\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\n\nfrom .VariableDeclarations import VariableDeclaration, VariableStorage\n\n# Many methods won't use self, but it's the interface. pylint: disable=no-self-use\n\n\nclass TempMixin(object):\n    # Lots of details, everything gets to store bits here, to indicate\n    # code generation states, and there are many, pylint: disable=too-many-instance-attributes\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        self.tmp_names = {}\n\n        self.labels = {}\n\n        # For exception and loop handling\n        self.exception_escape = None\n        self.loop_continue = None\n        self.loop_break = None\n\n        # For branches\n        self.true_target = None\n        self.false_target = None\n\n        self.keeper_variable_count = 0\n        self.exception_keepers = (None, None, None, None)\n\n        self.preserver_variable_declaration = {}\n\n        self.cleanup_names = []\n\n    def _formatTempName(self, base_name, number):\n        if number is None:\n            return \"tmp_{name}\".format(name=base_name)\n        else:\n            return \"tmp_{name}_{number:d}\".format(name=base_name, number=number)\n\n    def allocateTempName(self, base_name, type_name=\"PyObject *\", unique=False):\n        # We might be hard coding too many details for special temps\n        # here, pylint: disable=too-many-branches\n\n        if unique:\n            number = None\n        else:\n            number = self.tmp_names.get(base_name, 0)\n            number += 1\n\n        self.tmp_names[base_name] = number\n\n        formatted_name = self._formatTempName(base_name=base_name, number=number)\n\n        if unique:\n            result = self.variable_storage.getVariableDeclarationTop(formatted_name)\n\n            if result is None:\n                if base_name == \"outline_return_value\":\n                    init_value = \"NULL\"\n                elif base_name == \"return_value\":\n                    init_value = \"NULL\"\n                elif base_name == \"generator_return\":\n                    init_value = \"false\"\n                else:\n                    init_value = None\n\n                if base_name == \"unused\":\n                    result = self.variable_storage.addVariableDeclarationFunction(\n                        c_type=type_name,\n                        code_name=formatted_name,\n                        init_value=init_value,\n                    )\n                else:\n                    result = self.variable_storage.addVariableDeclarationTop(\n                        c_type=type_name,\n                        code_name=formatted_name,\n                        init_value=init_value,\n                    )\n            else:\n                if type_name.startswith(\"NUITKA_MAY_BE_UNUSED\"):\n                    type_name = type_name[21:]\n\n                assert result.c_type == type_name\n\n        else:\n            result = self.variable_storage.addVariableDeclarationLocal(\n                c_type=type_name, code_name=formatted_name\n            )\n\n        return result\n\n    def skipTempName(self, base_name):\n        number = self.tmp_names.get(base_name, 0)\n        number += 1\n        self.tmp_names[base_name] = number\n\n    def getIntResName(self):\n        return self.allocateTempName(\"res\", \"int\", unique=True)\n\n    def getBoolResName(self):\n        return self.allocateTempName(\"result\", \"bool\", unique=True)\n\n    def hasTempName(self, base_name):\n        return base_name in self.tmp_names\n\n    def getExceptionEscape(self):\n        return self.exception_escape\n\n    def setExceptionEscape(self, label):\n        result = self.exception_escape\n        self.exception_escape = label\n        return result\n\n    def getLoopBreakTarget(self):\n        return self.loop_break\n\n    def setLoopBreakTarget(self, label):\n        result = self.loop_break\n        self.loop_break = label\n        return result\n\n    def getLoopContinueTarget(self):\n        return self.loop_continue\n\n    def setLoopContinueTarget(self, label):\n        result = self.loop_continue\n        self.loop_continue = label\n        return result\n\n    def allocateLabel(self, label):\n        result = self.labels.get(label, 0)\n        result += 1\n        self.labels[label] = result\n\n        return \"{name}_{number:d}\".format(name=label, number=result)\n\n    def getLabelCount(self, label):\n        return self.labels.get(label, 0)\n\n    def allocateExceptionKeeperVariables(self):\n        self.keeper_variable_count += 1\n\n        # For finally handlers of Python3, which have conditions on assign and\n        # use, the NULL init is needed.\n        debug = Options.is_debug and python_version >= 0x300\n\n        if debug:\n            keeper_obj_init = \"NULL\"\n        else:\n            keeper_obj_init = None\n\n        return (\n            self.variable_storage.addVariableDeclarationTop(\n                \"PyObject *\",\n                \"exception_keeper_type_%d\" % self.keeper_variable_count,\n                keeper_obj_init,\n            ),\n            self.variable_storage.addVariableDeclarationTop(\n                \"PyObject *\",\n                \"exception_keeper_value_%d\" % self.keeper_variable_count,\n                keeper_obj_init,\n            ),\n            self.variable_storage.addVariableDeclarationTop(\n                \"PyTracebackObject *\",\n                \"exception_keeper_tb_%d\" % self.keeper_variable_count,\n                keeper_obj_init,\n            ),\n            self.variable_storage.addVariableDeclarationTop(\n                \"NUITKA_MAY_BE_UNUSED int\",\n                \"exception_keeper_lineno_%d\" % self.keeper_variable_count,\n                \"0\" if debug else None,\n            ),\n        )\n\n    def getExceptionKeeperVariables(self):\n        return self.exception_keepers\n\n    def setExceptionKeeperVariables(self, keeper_vars):\n        result = self.exception_keepers\n        self.exception_keepers = tuple(keeper_vars)\n        return result\n\n    def addExceptionPreserverVariables(self, preserver_id):\n        # For finally handlers of Python3, which have conditions on assign and\n        # use.\n        if preserver_id not in self.preserver_variable_declaration:\n            needs_init = Options.is_debug and python_version >= 0x300\n\n            if needs_init:\n                preserver_obj_init = \"Nuitka_ExceptionStackItem_Empty\"\n            else:\n                preserver_obj_init = None\n\n            self.preserver_variable_declaration[preserver_id] = (\n                self.variable_storage.addVariableDeclarationTop(\n                    \"struct Nuitka_ExceptionStackItem\",\n                    \"exception_preserved_%d\" % preserver_id,\n                    preserver_obj_init,\n                )\n            )\n\n        return self.preserver_variable_declaration[preserver_id]\n\n    def getTrueBranchTarget(self):\n        return self.true_target\n\n    def getFalseBranchTarget(self):\n        return self.false_target\n\n    def setTrueBranchTarget(self, label):\n        self.true_target = label\n\n    def setFalseBranchTarget(self, label):\n        self.false_target = label\n\n    def getCleanupTempNames(self):\n        return self.cleanup_names[-1]\n\n    def addCleanupTempName(self, tmp_name):\n        assert tmp_name not in self.cleanup_names[-1], tmp_name\n        assert (\n            tmp_name.c_type != \"nuitka_void\" or tmp_name.code_name == \"tmp_unused\"\n        ), tmp_name\n\n        self.cleanup_names[-1].append(tmp_name)\n\n    def removeCleanupTempName(self, tmp_name):\n        assert tmp_name in self.cleanup_names[-1], tmp_name\n        self.cleanup_names[-1].remove(tmp_name)\n\n    def transferCleanupTempName(self, tmp_source, tmp_dest):\n        if self.needsCleanup(tmp_source):\n            self.addCleanupTempName(tmp_dest)\n            self.removeCleanupTempName(tmp_source)\n\n    def needsCleanup(self, tmp_name):\n        return tmp_name in self.cleanup_names[-1]\n\n    def pushCleanupScope(self):\n        self.cleanup_names.append([])\n\n    def popCleanupScope(self):\n        assert not self.cleanup_names[-1]\n        del self.cleanup_names[-1]\n\n\nCodeObjectHandle = collections.namedtuple(\n    \"CodeObjectHandle\",\n    (\n        \"co_name\",\n        \"co_qualname\",\n        \"co_kind\",\n        \"co_varnames\",\n        \"co_argcount\",\n        \"co_posonlyargcount\",\n        \"co_kwonlyargcount\",\n        \"co_has_starlist\",\n        \"co_has_stardict\",\n        \"co_filename\",\n        \"line_number\",\n        \"future_flags\",\n        \"co_new_locals\",\n        \"co_freevars\",\n        \"is_optimized\",\n    ),\n)\n\n\nclass CodeObjectsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        # Code objects needed made unique by a key.\n        self.code_objects = {}\n\n    def getCodeObjects(self):\n        return sorted(iterItems(self.code_objects))\n\n    def getCodeObjectHandle(self, code_object):\n        key = CodeObjectHandle(\n            co_filename=code_object.getFilename(),\n            co_name=code_object.getCodeObjectName(),\n            co_qualname=code_object.getCodeObjectQualname(),\n            line_number=code_object.getLineNumber(),\n            co_varnames=code_object.getVarNames(),\n            co_argcount=code_object.getArgumentCount(),\n            co_freevars=code_object.getFreeVarNames(),\n            co_posonlyargcount=code_object.getPosOnlyParameterCount(),\n            co_kwonlyargcount=code_object.getKwOnlyParameterCount(),\n            co_kind=code_object.getCodeObjectKind(),\n            is_optimized=code_object.getFlagIsOptimizedValue(),\n            co_new_locals=code_object.getFlagNewLocalsValue(),\n            co_has_starlist=code_object.hasStarListArg(),\n            co_has_stardict=code_object.hasStarDictArg(),\n            future_flags=code_object.getFutureSpec().asFlags(),\n        )\n\n        if key not in self.code_objects:\n            self.code_objects[key] = \"codeobj_%s\" % self._calcHash(key)\n\n        return self.code_objects[key]\n\n    def _calcHash(self, key):\n        return getStringHash(\"-\".join(str(s) for s in key))\n\n\nclass PythonContextBase(getMetaClassBase(\"Context\", require_slots=True)):\n    __slots__ = (\"source_ref\", \"current_source_ref\")\n\n    @counted_init\n    def __init__(self):\n        self.source_ref = None\n\n        self.current_source_ref = None\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def getCurrentSourceCodeReference(self):\n        return self.current_source_ref\n\n    def setCurrentSourceCodeReference(self, value):\n        result = self.current_source_ref\n        self.current_source_ref = value\n\n        return result\n\n    @contextmanager\n    def withCurrentSourceCodeReference(self, value):\n        old_source_ref = self.setCurrentSourceCodeReference(value)\n\n        yield old_source_ref\n\n        self.setCurrentSourceCodeReference(value)\n\n    def getInplaceLeftName(self):\n        return self.allocateTempName(\"inplace_orig\", \"PyObject *\", True)\n\n    @abstractmethod\n    def getConstantCode(self, constant, deep_check=False):\n        pass\n\n    @abstractmethod\n    def addModuleInitCode(self, code):\n        pass\n\n    @abstractmethod\n    def getModuleCodeName(self):\n        pass\n\n    @abstractmethod\n    def getModuleName(self):\n        pass\n\n    @abstractmethod\n    def addHelperCode(self, key, code):\n        pass\n\n    @abstractmethod\n    def hasHelperCode(self, key):\n        pass\n\n    @abstractmethod\n    def addDeclaration(self, key, code):\n        pass\n\n    @abstractmethod\n    def pushFrameVariables(self, frame_variables):\n        pass\n\n    @abstractmethod\n    def popFrameVariables(self):\n        pass\n\n    @abstractmethod\n    def getFrameVariableTypeDescriptions(self):\n        pass\n\n    @abstractmethod\n    def getFrameVariableTypeDescription(self):\n        pass\n\n    @abstractmethod\n    def getFrameTypeDescriptionDeclaration(self):\n        pass\n\n    @abstractmethod\n    def getFrameVariableCodeNames(self):\n        pass\n\n    @abstractmethod\n    def allocateTempName(self, base_name, type_name=\"PyObject *\", unique=False):\n        pass\n\n    @abstractmethod\n    def skipTempName(self, base_name):\n        pass\n\n    @abstractmethod\n    def getIntResName(self):\n        pass\n\n    @abstractmethod\n    def getBoolResName(self):\n        pass\n\n    @abstractmethod\n    def hasTempName(self, base_name):\n        pass\n\n    @abstractmethod\n    def getExceptionEscape(self):\n        pass\n\n    @abstractmethod\n    def setExceptionEscape(self, label):\n        pass\n\n    @abstractmethod\n    def getLoopBreakTarget(self):\n        pass\n\n    @abstractmethod\n    def setLoopBreakTarget(self, label):\n        pass\n\n    @abstractmethod\n    def getLoopContinueTarget(self):\n        pass\n\n    @abstractmethod\n    def setLoopContinueTarget(self, label):\n        pass\n\n    @abstractmethod\n    def allocateLabel(self, label):\n        pass\n\n    @abstractmethod\n    def allocateExceptionKeeperVariables(self):\n        pass\n\n    @abstractmethod\n    def getExceptionKeeperVariables(self):\n        pass\n\n    @abstractmethod\n    def setExceptionKeeperVariables(self, keeper_vars):\n        pass\n\n    @abstractmethod\n    def addExceptionPreserverVariables(self, count):\n        pass\n\n    @abstractmethod\n    def getTrueBranchTarget(self):\n        pass\n\n    @abstractmethod\n    def getFalseBranchTarget(self):\n        pass\n\n    @abstractmethod\n    def setTrueBranchTarget(self, label):\n        pass\n\n    @abstractmethod\n    def setFalseBranchTarget(self, label):\n        pass\n\n    @abstractmethod\n    def getCleanupTempNames(self):\n        pass\n\n    @abstractmethod\n    def addCleanupTempName(self, tmp_name):\n        pass\n\n    @abstractmethod\n    def removeCleanupTempName(self, tmp_name):\n        pass\n\n    @abstractmethod\n    def needsCleanup(self, tmp_name):\n        pass\n\n    @abstractmethod\n    def pushCleanupScope(self):\n        pass\n\n    @abstractmethod\n    def popCleanupScope(self):\n        pass\n\n\nclass PythonChildContextBase(PythonContextBase):\n    # Base classes can be abstract, pylint: disable=I0021,abstract-method\n\n    __slots__ = (\"parent\",)\n\n    def __init__(self, parent):\n        PythonContextBase.__init__(self)\n\n        self.parent = parent\n\n    def getConstantCode(self, constant, deep_check=False):\n        return self.parent.getConstantCode(constant, deep_check=deep_check)\n\n    def addModuleInitCode(self, code):\n        self.parent.addModuleInitCode(code)\n\n    def getModuleCodeName(self):\n        return self.parent.getModuleCodeName()\n\n    def getModuleName(self):\n        return self.parent.getModuleName()\n\n    def addHelperCode(self, key, code):\n        return self.parent.addHelperCode(key, code)\n\n    def hasHelperCode(self, key):\n        return self.parent.hasHelperCode(key)\n\n    def addDeclaration(self, key, code):\n        self.parent.addDeclaration(key, code)\n\n    def pushFrameVariables(self, frame_variables):\n        return self.parent.pushFrameVariables(frame_variables)\n\n    def popFrameVariables(self):\n        return self.parent.popFrameVariables()\n\n    def getFrameVariableTypeDescriptions(self):\n        return self.parent.getFrameVariableTypeDescriptions()\n\n    def getFrameVariableTypeDescription(self):\n        return self.parent.getFrameVariableTypeDescription()\n\n    def getFrameTypeDescriptionDeclaration(self):\n        return self.parent.getFrameTypeDescriptionDeclaration()\n\n    def getFrameVariableCodeNames(self):\n        return self.parent.getFrameVariableCodeNames()\n\n    def addFunctionCreationInfo(self, creation_info):\n        return self.parent.addFunctionCreationInfo(creation_info)\n\n\nclass FrameDeclarationsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        # Frame is active or not, default not.\n        self.frame_variables_stack = [\"\"]\n        # Type descriptions of the current frame.\n        self.frame_type_descriptions = [()]\n\n        # Types of variables for current frame.\n        self.frame_variable_types = {}\n\n        self.frames_used = 0\n\n        # Currently active frame stack inside the context.\n        self.frame_stack = [None]\n\n        self.locals_dict_names = None\n\n    def getFrameHandle(self):\n        return self.frame_stack[-1]\n\n    def pushFrameHandle(self, code_identifier, is_light):\n        self.frames_used += 1\n\n        if is_light:\n            frame_identifier = VariableDeclaration(\n                \"struct Nuitka_FrameObject *\",\n                \"m_frame\",\n                None,\n                self.getContextObjectName(),\n            )\n\n        else:\n            frame_handle = code_identifier.replace(\"codeobj_\", \"frame_\")\n\n            if self.frames_used > 1:\n                frame_handle += \"_%d\" % self.frames_used\n\n            frame_identifier = self.variable_storage.addVariableDeclarationTop(\n                \"struct Nuitka_FrameObject *\", frame_handle, None\n            )\n\n        self.variable_storage.addVariableDeclarationTop(\n            \"NUITKA_MAY_BE_UNUSED char const *\",\n            \"type_description_%d\" % self.frames_used,\n            \"NULL\",\n        )\n\n        self.frame_stack.append(frame_identifier)\n        return frame_identifier\n\n    def popFrameHandle(self):\n        result = self.frame_stack[-1]\n        del self.frame_stack[-1]\n\n        return result\n\n    def getFramesCount(self):\n        return self.frames_used\n\n    def pushFrameVariables(self, frame_variables):\n        \"\"\"Set current the frame variables.\"\"\"\n        self.frame_variables_stack.append(frame_variables)\n        self.frame_type_descriptions.append(set())\n\n    def popFrameVariables(self):\n        \"\"\"End of frame, restore previous ones.\"\"\"\n        del self.frame_variables_stack[-1]\n        del self.frame_type_descriptions[-1]\n\n    def setVariableType(self, variable, variable_declaration):\n        assert variable.isLocalVariable(), variable\n\n        # TODO: Change value of that dict to take advantage of declaration.\n        self.frame_variable_types[variable] = (\n            str(variable_declaration),\n            variable_declaration.getCType().getTypeIndicator(),\n        )\n\n    def getFrameVariableTypeDescriptions(self):\n        return self.frame_type_descriptions[-1]\n\n    def getFrameTypeDescriptionDeclaration(self):\n        return self.variable_storage.getVariableDeclarationTop(\n            \"type_description_%d\" % (len(self.frame_stack) - 1)\n        )\n\n    def getFrameVariableTypeDescription(self):\n        result = \"\".join(\n            self.frame_variable_types.get(variable, (\"NULL\", \"N\"))[1]\n            for variable in self.frame_variables_stack[-1]\n        )\n\n        if result:\n            self.frame_type_descriptions[-1].add(result)\n\n        return result\n\n    def getFrameVariableCodeNames(self):\n        result = []\n\n        for variable in self.frame_variables_stack[-1]:\n            variable_code_name, variable_code_type = self.frame_variable_types.get(\n                variable, (\"NULL\", \"N\")\n            )\n\n            if variable_code_type in (\"b\",):\n                result.append(\"(int)\" + variable_code_name)\n            else:\n                result.append(variable_code_name)\n\n        return result\n\n    def getLocalsDictNames(self):\n        return self.locals_dict_names or ()\n\n    def addLocalsDictName(self, locals_dict_name):\n        result = self.variable_storage.getVariableDeclarationTop(locals_dict_name)\n\n        if result is None:\n            result = self.variable_storage.addVariableDeclarationTop(\n                \"PyObject *\", locals_dict_name, \"NULL\"\n            )\n\n        if self.locals_dict_names is None:\n            self.locals_dict_names = set()\n\n        self.locals_dict_names.add(result)\n\n        return result\n\n\nclass ReturnReleaseModeMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        self.return_release_mode = False\n\n        self.return_exit = None\n\n    def setReturnReleaseMode(self, value):\n        result = self.return_release_mode\n        self.return_release_mode = value\n        return result\n\n    def getReturnReleaseMode(self):\n        return self.return_release_mode\n\n    def setReturnTarget(self, label):\n        result = self.return_exit\n        self.return_exit = label\n        return result\n\n    def getReturnTarget(self):\n        return self.return_exit\n\n\nclass ReturnValueNameMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        self.return_name = None\n\n    def getReturnValueName(self):\n        if self.return_name is None:\n            self.return_name = self.allocateTempName(\"return_value\", unique=True)\n\n        return self.return_name\n\n    def setReturnValueName(self, value):\n        result = self.return_name\n        self.return_name = value\n        return result\n\n\nclass PythonModuleContext(\n    FrameDeclarationsMixin,\n    TempMixin,\n    CodeObjectsMixin,\n    ReturnReleaseModeMixin,\n    ReturnValueNameMixin,\n    PythonContextBase,\n):\n    # Plenty of attributes, because it's storing so many different things.\n    # pylint: disable=too-many-instance-attributes\n\n    __slots__ = (\n        \"module\",\n        \"name\",\n        \"code_name\",\n        \"declaration_codes\",\n        \"helper_codes\",\n        \"frame_handle\",\n        \"variable_storage\",\n        \"function_table_entries\",\n        \"constant_accessor\",\n        \"module_init_codes\",\n        # FrameDeclarationsMixin\n        \"frame_variables_stack\",\n        \"frame_type_descriptions\",\n        \"frame_variable_types\",\n        \"frames_used\",\n        \"frame_stack\",\n        \"locals_dict_names\",\n        # TempMixin:\n        \"tmp_names\",\n        \"labels\",\n        \"exception_escape\",\n        \"loop_continue\",\n        \"loop_break\",\n        \"true_target\",\n        \"false_target\",\n        \"keeper_variable_count\",\n        \"exception_keepers\",\n        \"preserver_variable_declaration\",\n        \"cleanup_names\",\n        # CodeObjectsMixin\n        \"code_objects\",\n        # ReturnReleaseModeMixin\n        \"return_release_mode\",\n        \"return_exit\",\n        # ReturnValueNameMixin\n        \"return_name\",\n    )\n\n    def __init__(self, module, data_filename):\n        PythonContextBase.__init__(self)\n\n        TempMixin.__init__(self)\n        CodeObjectsMixin.__init__(self)\n        FrameDeclarationsMixin.__init__(self)\n        ReturnReleaseModeMixin.__init__(self)\n\n        # TODO: For outlines bodies.\n        ReturnValueNameMixin.__init__(self)\n\n        self.module = module\n        self.name = module.getFullName()\n        self.code_name = module.getCodeName()\n\n        self.declaration_codes = {}\n        self.helper_codes = {}\n\n        self.frame_handle = None\n\n        self.variable_storage = VariableStorage(heap_name=None)\n\n        self.function_table_entries = []\n\n        self.constant_accessor = ConstantAccessor(\n            top_level_name=\"mod_consts\", data_filename=data_filename\n        )\n\n        self.module_init_codes = []\n\n    def __repr__(self):\n        return \"<PythonModuleContext instance for module %s>\" % self.name\n\n    def getOwner(self):\n        return self.module\n\n    def getEntryPoint(self):\n        return self.module\n\n    def isCompiledPythonModule(self):\n        return True\n\n    def getName(self):\n        return self.name\n\n    def mayRaiseException(self):\n        body = self.module.subnode_body\n\n        return body is not None and body.mayRaiseException(BaseException)\n\n    getModuleName = getName\n\n    def getModuleCodeName(self):\n        return self.code_name\n\n    def setFrameGuardMode(self, guard_mode):\n        assert guard_mode == \"once\"\n\n    def addHelperCode(self, key, code):\n        assert key not in self.helper_codes, key\n\n        self.helper_codes[key] = code\n\n    def hasHelperCode(self, key):\n        return key in self.helper_codes\n\n    def getHelperCodes(self):\n        return self.helper_codes\n\n    def addDeclaration(self, key, code):\n        assert key not in self.declaration_codes\n\n        self.declaration_codes[key] = code\n\n    def getDeclarations(self):\n        return self.declaration_codes\n\n    def mayRecurse(self):\n        return False\n\n    def getConstantCode(self, constant, deep_check=False):\n        if deep_check and Options.is_debug:\n            assert not isMutable(constant)\n\n        return self.constant_accessor.getConstantCode(constant)\n\n    def getConstantsCount(self):\n        return self.constant_accessor.getConstantsCount()\n\n    def getModuleInitCodes(self):\n        return self.module_init_codes\n\n    def addModuleInitCode(self, code):\n        self.module_init_codes.append(code)\n\n    def addFunctionCreationInfo(self, creation_info):\n        self.function_table_entries.append(creation_info)\n\n    def getFunctionCreationInfos(self):\n        result = self.function_table_entries\n\n        # Release the memory once possible.\n        del self.function_table_entries\n        return result\n\n    @staticmethod\n    def getContextObjectName():\n        return None\n\n\nclass PythonFunctionContext(\n    FrameDeclarationsMixin,\n    TempMixin,\n    ReturnReleaseModeMixin,\n    ReturnValueNameMixin,\n    PythonChildContextBase,\n):\n    __slots__ = (\n        \"function\",\n        \"frame_handle\",\n        \"variable_storage\",\n        # FrameDeclarationsMixin\n        \"frame_variables_stack\",\n        \"frame_type_descriptions\",\n        \"frame_variable_types\",\n        \"frames_used\",\n        \"frame_stack\",\n        \"locals_dict_names\",\n        # TempMixin:\n        \"tmp_names\",\n        \"labels\",\n        \"exception_escape\",\n        \"loop_continue\",\n        \"loop_break\",\n        \"true_target\",\n        \"false_target\",\n        \"keeper_variable_count\",\n        \"exception_keepers\",\n        \"preserver_variable_declaration\",\n        \"cleanup_names\",\n        # ReturnReleaseModeMixin\n        \"return_release_mode\",\n        \"return_exit\",\n        # ReturnValueNameMixin\n        \"return_name\",\n    )\n\n    def __init__(self, parent, function):\n        PythonChildContextBase.__init__(self, parent=parent)\n\n        TempMixin.__init__(self)\n        FrameDeclarationsMixin.__init__(self)\n        ReturnReleaseModeMixin.__init__(self)\n        ReturnValueNameMixin.__init__(self)\n\n        self.function = function\n\n        self.setExceptionEscape(\"function_exception_exit\")\n        self.setReturnTarget(\"function_return_exit\")\n\n        self.frame_handle = None\n\n        self.variable_storage = self._makeVariableStorage()\n\n    def _makeVariableStorage(self):\n        return VariableStorage(heap_name=None)\n\n    def __repr__(self):\n        return \"<%s for %s '%s'>\" % (\n            self.__class__.__name__,\n            \"function\" if not self.function.isExpressionClassBodyBase() else \"class\",\n            self.function.getName(),\n        )\n\n    def getFunction(self):\n        return self.function\n\n    def getOwner(self):\n        return self.function\n\n    def getEntryPoint(self):\n        return self.function\n\n    def mayRecurse(self):\n        # TODO: Determine this at compile time for enhanced optimizations.\n        return True\n\n    def getCodeObjectHandle(self, code_object):\n        return self.parent.getCodeObjectHandle(code_object)\n\n\nclass PythonFunctionDirectContext(PythonFunctionContext):\n    __slots__ = ()\n\n    @staticmethod\n    def getContextObjectName():\n        return None\n\n    @staticmethod\n    def isForDirectCall():\n        return True\n\n    @staticmethod\n    def isForCreatedFunction():\n        return False\n\n\nclass PythonGeneratorObjectContext(PythonFunctionContext):\n    __slots__ = ()\n\n    def _makeVariableStorage(self):\n        return VariableStorage(heap_name=\"%s_heap\" % self.getContextObjectName())\n\n    @staticmethod\n    def isForDirectCall():\n        return False\n\n    @staticmethod\n    def isForCreatedFunction():\n        return False\n\n    @staticmethod\n    def getContextObjectName():\n        return \"generator\"\n\n    def getGeneratorReturnValueName(self):\n        if python_version >= 0x300:\n            return self.allocateTempName(\"return_value\", \"PyObject *\", unique=True)\n        else:\n            return self.allocateTempName(\"generator_return\", \"bool\", unique=True)\n\n\nclass PythonCoroutineObjectContext(PythonGeneratorObjectContext):\n    __slots__ = ()\n\n    @staticmethod\n    def getContextObjectName():\n        return \"coroutine\"\n\n\nclass PythonAsyncgenObjectContext(PythonGeneratorObjectContext):\n    __slots__ = ()\n\n    @staticmethod\n    def getContextObjectName():\n        return \"asyncgen\"\n\n\nclass PythonFunctionCreatedContext(PythonFunctionContext):\n    __slots__ = ()\n\n    @staticmethod\n    def getContextObjectName():\n        return None\n\n    @staticmethod\n    def isForDirectCall():\n        return False\n\n    @staticmethod\n    def isForCreatedFunction():\n        return True\n\n\nclass PythonFunctionOutlineContext(\n    ReturnReleaseModeMixin, ReturnValueNameMixin, PythonChildContextBase\n):\n    __slots__ = (\n        \"outline\",\n        \"variable_storage\",\n        # ReturnReleaseModeMixin\n        \"return_release_mode\",\n        \"return_exit\",\n        # ReturnValueNameMixin\n        \"return_name\",\n    )\n\n    def __init__(self, parent, outline):\n        PythonChildContextBase.__init__(self, parent=parent)\n\n        ReturnReleaseModeMixin.__init__(self)\n        ReturnValueNameMixin.__init__(self)\n\n        self.outline = outline\n\n        self.variable_storage = parent.variable_storage\n\n    def getOwner(self):\n        return self.outline\n\n    def getEntryPoint(self):\n        return self.outline.getEntryPoint()\n\n    def allocateLabel(self, label):\n        return self.parent.allocateLabel(label)\n\n    def allocateTempName(self, base_name, type_name=\"PyObject *\", unique=False):\n        return self.parent.allocateTempName(base_name, type_name, unique)\n\n    def skipTempName(self, base_name):\n        return self.parent.skipTempName(base_name)\n\n    def hasTempName(self, base_name):\n        return self.parent.hasTempName(base_name)\n\n    def getCleanupTempNames(self):\n        return self.parent.getCleanupTempNames()\n\n    # TODO: Make this work on shared data instead.\n    def addCleanupTempName(self, tmp_name):\n        self.parent.addCleanupTempName(tmp_name)\n\n    def transferCleanupTempName(self, tmp_source, tmp_dest):\n        self.parent.transferCleanupTempName(tmp_source, tmp_dest)\n\n    def removeCleanupTempName(self, tmp_name):\n        self.parent.removeCleanupTempName(tmp_name)\n\n    def needsCleanup(self, tmp_name):\n        return self.parent.needsCleanup(tmp_name)\n\n    def pushCleanupScope(self):\n        return self.parent.pushCleanupScope()\n\n    def popCleanupScope(self):\n        self.parent.popCleanupScope()\n\n    def getCodeObjectHandle(self, code_object):\n        return self.parent.getCodeObjectHandle(code_object)\n\n    def getExceptionEscape(self):\n        return self.parent.getExceptionEscape()\n\n    def setExceptionEscape(self, label):\n        return self.parent.setExceptionEscape(label)\n\n    def getLoopBreakTarget(self):\n        return self.parent.getLoopBreakTarget()\n\n    def setLoopBreakTarget(self, label):\n        return self.parent.setLoopBreakTarget(label)\n\n    def getLoopContinueTarget(self):\n        return self.parent.getLoopContinueTarget()\n\n    def setLoopContinueTarget(self, label):\n        return self.parent.setLoopContinueTarget(label)\n\n    def getTrueBranchTarget(self):\n        return self.parent.getTrueBranchTarget()\n\n    def getFalseBranchTarget(self):\n        return self.parent.getFalseBranchTarget()\n\n    def setTrueBranchTarget(self, label):\n        self.parent.setTrueBranchTarget(label)\n\n    def setFalseBranchTarget(self, label):\n        self.parent.setFalseBranchTarget(label)\n\n    def getFrameHandle(self):\n        return self.parent.getFrameHandle()\n\n    def pushFrameHandle(self, code_identifier, is_light):\n        return self.parent.pushFrameHandle(code_identifier, is_light)\n\n    def popFrameHandle(self):\n        return self.parent.popFrameHandle()\n\n    def getExceptionKeeperVariables(self):\n        return self.parent.getExceptionKeeperVariables()\n\n    def setExceptionKeeperVariables(self, keeper_vars):\n        return self.parent.setExceptionKeeperVariables(keeper_vars)\n\n    def setVariableType(self, variable, variable_declaration):\n        self.parent.setVariableType(variable, variable_declaration)\n\n    def getIntResName(self):\n        return self.parent.getIntResName()\n\n    def getBoolResName(self):\n        return self.parent.getBoolResName()\n\n    def allocateExceptionKeeperVariables(self):\n        return self.parent.allocateExceptionKeeperVariables()\n\n    def isForDirectCall(self):\n        return self.parent.isForDirectCall()\n\n    def mayRecurse(self):\n        # The outline is only accessible via its parent.\n        return self.parent.mayRecurse()\n\n    def getLocalsDictNames(self):\n        return self.parent.getLocalsDictNames()\n\n    def addLocalsDictName(self, locals_dict_name):\n        return self.parent.addLocalsDictName(locals_dict_name)\n\n    def addExceptionPreserverVariables(self, count):\n        return self.parent.addExceptionPreserverVariables(count)\n\n    def getContextObjectName(self):\n        return self.parent.getContextObjectName()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CoroutineCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with compiled coroutine objects.\n\n\"\"\"\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    generateStatementSequenceCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import getErrorExitCode\nfrom .FunctionCodes import (\n    finalizeFunctionLocalVariables,\n    getClosureCopyCode,\n    getFunctionCreationArgs,\n    getFunctionQualnameObj,\n    setupFunctionLocalVariables,\n)\nfrom .Indentation import indented\nfrom .LineNumberCodes import emitLineNumberUpdateCode\nfrom .ModuleCodes import getModuleAccessCode\nfrom .templates.CodeTemplatesCoroutines import (\n    template_coroutine_exception_exit,\n    template_coroutine_noexception_exit,\n    template_coroutine_object_body,\n    template_coroutine_object_maker,\n    template_coroutine_return_exit,\n    template_make_coroutine,\n)\nfrom .YieldCodes import getYieldReturnDispatchCode\n\n\ndef _getCoroutineMakerIdentifier(function_identifier):\n    return \"MAKE_COROUTINE_\" + function_identifier\n\n\ndef getCoroutineObjectDeclCode(function_identifier, closure_variables):\n    coroutine_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=True,\n    )\n\n    return template_coroutine_object_maker % {\n        \"coroutine_maker_identifier\": _getCoroutineMakerIdentifier(function_identifier),\n        \"coroutine_creation_args\": \", \".join(coroutine_creation_args),\n    }\n\n\ndef getCoroutineObjectCode(\n    context,\n    function_identifier,\n    closure_variables,\n    user_variables,\n    outline_variables,\n    temp_variables,\n    needs_exception_exit,\n    needs_generator_return,\n):\n    # A bit of details going on here, pylint: disable=too-many-locals\n\n    setupFunctionLocalVariables(\n        context=context,\n        parameters=None,\n        closure_variables=closure_variables,\n        user_variables=user_variables + outline_variables,\n        temp_variables=temp_variables,\n    )\n\n    function_codes = SourceCodeCollector()\n\n    coroutine_object_body = context.getOwner()\n\n    generateStatementSequenceCode(\n        statement_sequence=coroutine_object_body.subnode_body,\n        allow_none=True,\n        emit=function_codes,\n        context=context,\n    )\n\n    function_cleanup = finalizeFunctionLocalVariables(context)\n\n    if needs_exception_exit:\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            _exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        generator_exit = template_coroutine_exception_exit % {\n            \"function_cleanup\": indented(function_cleanup),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n    else:\n        generator_exit = template_coroutine_noexception_exit % {\n            \"function_cleanup\": indented(function_cleanup)\n        }\n\n    if needs_generator_return:\n        generator_exit += template_coroutine_return_exit % {\n            \"return_value\": context.getReturnValueName()\n        }\n\n    function_locals = context.variable_storage.makeCFunctionLevelDeclarations()\n\n    local_type_decl = context.variable_storage.makeCStructLevelDeclarations()\n    function_locals += context.variable_storage.makeCStructInits()\n\n    if local_type_decl:\n        heap_declaration = \"\"\"\\\nstruct %(function_identifier)s_locals *coroutine_heap = \\\n(struct %(function_identifier)s_locals *)coroutine->m_heap_storage;\"\"\" % {\n            \"function_identifier\": function_identifier\n        }\n    else:\n        heap_declaration = \"\"\n\n    coroutine_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=True,\n    )\n\n    return template_coroutine_object_body % {\n        \"function_identifier\": function_identifier,\n        \"function_body\": indented(function_codes.codes),\n        \"heap_declaration\": indented(heap_declaration),\n        \"has_heap_declaration\": 1 if heap_declaration != \"\" else 0,\n        \"function_local_types\": indented(local_type_decl),\n        \"function_var_inits\": indented(function_locals),\n        \"function_dispatch\": indented(getYieldReturnDispatchCode(context)),\n        \"coroutine_maker_identifier\": _getCoroutineMakerIdentifier(function_identifier),\n        \"coroutine_creation_args\": \", \".join(coroutine_creation_args),\n        \"coroutine_exit\": generator_exit,\n        \"coroutine_module\": getModuleAccessCode(context),\n        \"coroutine_name_obj\": context.getConstantCode(\n            constant=coroutine_object_body.getFunctionName()\n        ),\n        \"coroutine_qualname_obj\": getFunctionQualnameObj(\n            coroutine_object_body, context\n        ),\n        \"code_identifier\": context.getCodeObjectHandle(\n            code_object=coroutine_object_body.getCodeObject()\n        ),\n        \"closure_name\": \"closure\" if closure_variables else \"NULL\",\n        \"closure_count\": len(closure_variables),\n    }\n\n\ndef generateMakeCoroutineObjectCode(to_name, expression, emit, context):\n    coroutine_object_body = expression.subnode_coroutine_ref.getFunctionBody()\n\n    closure_variables = expression.getClosureVariableVersions()\n\n    closure_name, closure_copy = getClosureCopyCode(\n        closure_variables=closure_variables, context=context\n    )\n\n    args = [\"tstate\"]\n    if closure_name:\n        args.append(closure_name)\n\n    emit(\n        template_make_coroutine\n        % {\n            \"to_name\": to_name,\n            \"coroutine_maker_identifier\": _getCoroutineMakerIdentifier(\n                coroutine_object_body.getCodeName()\n            ),\n            \"args\": \", \".join(str(arg) for arg in args),\n            \"closure_copy\": indented(closure_copy, 0, True),\n        }\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateAsyncWaitCode(to_name, expression, emit, context):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    if expression.isExpressionAsyncWaitEnter():\n        wait_kind = \"await_enter\"\n    elif expression.isExpressionAsyncWaitExit():\n        wait_kind = \"await_exit\"\n    else:\n        wait_kind = \"await_normal\"\n\n    emit(\"%s = ASYNC_AWAIT(tstate, %s, %s);\" % (to_name, value_name, wait_kind))\n\n    getErrorExitCode(\n        check_name=to_name, release_name=value_name, emit=emit, context=context\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateAsyncIterCode(to_name, expression, emit, context):\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"aiter_result\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = ASYNC_MAKE_ITERATOR(tstate, %s);\" % (result_name, value_name))\n\n        getErrorExitCode(\n            check_name=result_name, release_name=value_name, emit=emit, context=context\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateAsyncNextCode(to_name, expression, emit, context):\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"anext_result\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = ASYNC_ITERATOR_NEXT(tstate, %s);\" % (result_name, value_name))\n\n        getErrorExitCode(\n            check_name=result_name, release_name=value_name, emit=emit, context=context\n        )\n\n        context.addCleanupTempName(result_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/CtypesCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for ctypes module stuff. \"\"\"\n\nfrom .BuiltinCodes import getBuiltinCallViaSpecCode\nfrom .ImportCodes import getImportModuleNameHardCode\n\n\ndef generateCtypesCdllCallCode(to_name, expression, emit, context):\n    # TODO: Have global cached forms of hard attribute lookup results too.\n    ctypes_cdll_class = context.allocateTempName(\"ctypes_cdll_class\", unique=True)\n\n    getImportModuleNameHardCode(\n        to_name=ctypes_cdll_class,\n        module_name=\"ctypes\",\n        import_name=\"CDLL\",\n        needs_check=False,\n        emit=emit,\n        context=context,\n    )\n\n    getBuiltinCallViaSpecCode(\n        spec=expression.spec,\n        called_name=ctypes_cdll_class,\n        to_name=to_name,\n        expression=expression,\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/DictCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for dictionaries.\n\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Jinja2 import renderTemplateFromString\n\nfrom .CallCodes import getCallCodePosArgsQuick\nfrom .CodeHelpers import (\n    assignConstantNoneResult,\n    decideConversionCheckNeeded,\n    generateChildExpressionCode,\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withCleanupFinally,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode, getReleaseCode\nfrom .PythonAPICodes import (\n    generateCAPIObjectCode,\n    generateCAPIObjectCode0,\n    makeArgDescFromExpression,\n)\n\n\ndef generateBuiltinDictCode(to_name, expression, emit, context):\n    if expression.subnode_pos_arg:\n        seq_name = context.allocateTempName(\"dict_seq\")\n\n        generateExpressionCode(\n            to_name=seq_name,\n            expression=expression.subnode_pos_arg,\n            emit=emit,\n            context=context,\n            allow_none=True,\n        )\n    else:\n        seq_name = None\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_value\", expression, emit, context\n    ) as value_name:\n        if expression.subnode_pairs:\n            # If there is no sequence to mix in, then directly generate\n            # into to_name.\n\n            if seq_name is None:\n                getDictionaryCreationCode(\n                    to_name=value_name,\n                    pairs=expression.subnode_pairs,\n                    emit=emit,\n                    context=context,\n                )\n\n                dict_name = None\n            else:\n                dict_name = context.allocateTempName(\"dict_arg\")\n\n                getDictionaryCreationCode(\n                    to_name=dict_name,\n                    pairs=expression.subnode_pairs,\n                    emit=emit,\n                    context=context,\n                )\n        else:\n            dict_name = None\n\n        if seq_name is not None:\n            emit(\n                \"%s = TO_DICT(tstate, %s, %s);\"\n                % (value_name, seq_name, \"NULL\" if dict_name is None else dict_name)\n            )\n\n            getErrorExitCode(\n                check_name=value_name,\n                release_names=(seq_name, dict_name),\n                emit=emit,\n                context=context,\n            )\n\n            context.addCleanupTempName(value_name)\n\n\ndef generateDictionaryCreationCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_result\", expression, emit, context\n    ) as value_name:\n        getDictionaryCreationCode(\n            to_name=value_name,\n            pairs=expression.subnode_pairs,\n            emit=emit,\n            context=context,\n        )\n\n\ndef getDictionaryCreationCode(to_name, pairs, emit, context):\n    # Detailed, and verbose code, pylint: disable=too-many-locals\n\n    pairs_count = len(pairs)\n\n    # Empty dictionaries should not get to this function, but be constant value instead.\n    assert pairs_count > 0\n\n    # Unique per dictionary, they might be nested, but used for all of them.\n    dict_key_name = context.allocateTempName(\"dict_key\")\n    dict_value_name = context.allocateTempName(\"dict_value\")\n\n    is_hashable_key = [pair.isKeyKnownToBeHashable() for pair in pairs]\n\n    # Does this dictionary build need an exception handling at all.\n    if all(is_hashable_key):\n        for pair in pairs[1:]:\n            if pair.mayRaiseException(BaseException):\n                needs_exception_exit = True\n                break\n        else:\n            needs_exception_exit = False\n    else:\n        needs_exception_exit = True\n\n    def generateValueCode(dict_value_name, pair):\n        generateExpressionCode(\n            to_name=dict_value_name,\n            expression=pair.getValueNode(),\n            emit=emit,\n            context=context,\n        )\n\n    # TODO: There must be a way to avoid using a node like getKeyNode does, to\n    # create the pair creation code, maybe this kind of virtual constants can\n    # be asked, but then this code should be shared.\n    def generateKeyCode(dict_key_name, pair):\n        generateExpressionCode(\n            to_name=dict_key_name,\n            expression=pair.getKeyNode(),\n            emit=emit,\n            context=context,\n        )\n\n    def generatePairCode(pair):\n        # Strange as it is, CPython 3.5 and before evaluated the key/value pairs\n        # strictly in order, but for each pair, the value first.\n        if python_version < 0x350:\n            generateValueCode(dict_value_name, pair)\n            generateKeyCode(dict_key_name, pair)\n        else:\n            generateKeyCode(dict_key_name, pair)\n            generateValueCode(dict_value_name, pair)\n\n        key_needs_release = context.needsCleanup(dict_key_name)\n        if key_needs_release:\n            context.removeCleanupTempName(dict_key_name)\n\n        value_needs_release = context.needsCleanup(dict_value_name)\n        if value_needs_release:\n            context.removeCleanupTempName(dict_value_name)\n\n        return key_needs_release, value_needs_release\n\n    key_needs_release, value_needs_release = generatePairCode(pairs[0])\n\n    # Create dictionary pre-sized.\n    emit(\"%s = _PyDict_NewPresized( %d );\" % (to_name, pairs_count))\n\n    with withCleanupFinally(\n        \"dict_build\", to_name, needs_exception_exit, emit, context\n    ) as guarded_emit:\n        emit = guarded_emit.emit\n\n        for count, pair in enumerate(pairs):\n            if count > 0:\n                key_needs_release, value_needs_release = generatePairCode(pair)\n\n            needs_check = not is_hashable_key[count]\n            res_name = context.getIntResName()\n\n            emit(\n                \"%s = PyDict_SetItem(%s, %s, %s);\"\n                % (res_name, to_name, dict_key_name, dict_value_name)\n            )\n\n            if value_needs_release:\n                emit(\"Py_DECREF(%s);\" % dict_value_name)\n\n            if key_needs_release:\n                emit(\"Py_DECREF(%s);\" % dict_key_name)\n\n            getErrorExitBoolCode(\n                condition=\"%s != 0\" % res_name,\n                needs_check=needs_check,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateDictOperationUpdateCode(statement, emit, context):\n    value_arg_name = context.allocateTempName(\"dictupdate_value\", unique=True)\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    dict_arg_name = context.allocateTempName(\"dictupdate_dict\", unique=True)\n    generateExpressionCode(\n        to_name=dict_arg_name,\n        expression=statement.subnode_dict_arg,\n        emit=emit,\n        context=context,\n    )\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        res_name = context.getIntResName()\n\n        emit(\"assert(PyDict_Check(%s));\" % dict_arg_name)\n        emit(\"%s = PyDict_Update(%s, %s);\" % (res_name, dict_arg_name, value_arg_name))\n\n        getErrorExitBoolCode(\n            condition=\"%s != 0\" % res_name,\n            release_names=(dict_arg_name, value_arg_name),\n            needs_check=statement.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateDictOperationItemCode(to_name, expression, emit, context):\n    dict_name, key_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = DICT_GET_ITEM_WITH_ERROR(tstate, %s, %s);\"\n            % (value_name, dict_name, key_name)\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(dict_name, key_name),\n            needs_check=expression.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateDictOperationGet2Code(to_name, expression, emit, context):\n    dict_name, key_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            renderTemplateFromString(\n                r\"\"\"\n{% if expression.known_hashable_key %}\n%(value_name)s = DICT_GET_ITEM1(tstate, %(dict_name)s, %(key_name)s);\nif (%(value_name)s == NULL) {\n{% else %}\n%(value_name)s = DICT_GET_ITEM_WITH_HASH_ERROR1(tstate, %(dict_name)s, %(key_name)s);\nif (%(value_name)s == NULL && !HAS_ERROR_OCCURRED(tstate)) {\n{% endif %}\n    %(value_name)s = Py_None;\n    Py_INCREF(%(value_name)s);\n}\n\"\"\",\n                expression=expression,\n            )\n            % {\n                \"value_name\": value_name,\n                \"dict_name\": dict_name,\n                \"key_name\": key_name,\n            }\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(dict_name, key_name),\n            needs_check=not expression.known_hashable_key,\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateDictOperationGet3Code(to_name, expression, emit, context):\n    dict_name, key_name, default_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            renderTemplateFromString(\n                r\"\"\"\n{% if expression.known_hashable_key %}\n%(value_name)s = DICT_GET_ITEM1(tstate, %(dict_name)s, %(key_name)s);\nif (%(value_name)s == NULL) {\n{% else %}\n%(value_name)s = DICT_GET_ITEM_WITH_HASH_ERROR1(tstate, %(dict_name)s, %(key_name)s);\nif (%(value_name)s == NULL && !HAS_ERROR_OCCURRED(tstate)) {\n{% endif %}\n    %(value_name)s = %(default_name)s;\n    Py_INCREF(%(value_name)s);\n}\n\n\"\"\",\n                expression=expression,\n            )\n            % {\n                \"value_name\": value_name,\n                \"dict_name\": dict_name,\n                \"key_name\": key_name,\n                \"default_name\": default_name,\n            }\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(dict_name, key_name, default_name),\n            needs_check=not expression.known_hashable_key,\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateDictOperationSetdefault2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_SETDEFAULT2\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=not expression.known_hashable_key,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationSetdefault3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_SETDEFAULT3\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=not expression.known_hashable_key,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationPop2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_POP2\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationPop3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_POP3\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=not expression.known_hashable_key,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationPopitemCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_POPITEM\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _generateDictOperationUpdateCommonCode(\n    dict_name, iterable_name, release_dict, expression, emit, context\n):\n    res_name = context.getIntResName()\n\n    emit(\"assert(PyDict_Check(%s));\" % dict_name)\n\n    emit(\n        renderTemplateFromString(\n            r\"\"\"\n{% if has_keys_attribute == None %}\nif (HAS_ATTR_BOOL(tstate, %(iterable_name)s, const_str_plain_keys)){\n    %(res_name)s = PyDict_Merge(%(dict_name)s, %(iterable_name)s, 1);\n} else {\n    %(res_name)s = PyDict_MergeFromSeq2(%(dict_name)s, %(iterable_name)s, 1);\n}\n{% elif has_keys_attribute == True %}\n    %(res_name)s = PyDict_Merge(%(dict_name)s, %(iterable_name)s, 1);\n{% else %}\n    %(res_name)s = PyDict_MergeFromSeq2(%(dict_name)s, %(iterable_name)s, 1);\n{% endif %}\n\"\"\",\n            has_keys_attribute=expression.subnode_iterable.isKnownToHaveAttribute(\n                \"keys\"\n            ),\n        )\n        % {\n            \"res_name\": res_name,\n            \"dict_name\": dict_name,\n            \"iterable_name\": iterable_name,\n        }\n    )\n\n    if release_dict:\n        release_names = (dict_name, iterable_name)\n    else:\n        release_names = (iterable_name,)\n\n    getErrorExitBoolCode(\n        condition=\"%s != 0\" % res_name,\n        release_names=release_names,\n        needs_check=expression.mayRaiseException(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationUpdate2Code(to_name, expression, emit, context):\n    dict_name, iterable_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    _generateDictOperationUpdateCommonCode(\n        dict_name=dict_name,\n        iterable_name=iterable_name,\n        release_dict=True,\n        expression=expression,\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateDictOperationUpdate3Code(to_name, expression, emit, context):\n    dict_name = generateChildExpressionCode(\n        expression=expression.subnode_dict_arg, emit=emit, context=context\n    )\n\n    emit(\"assert(PyDict_Check(%s));\" % dict_name)\n\n    if expression.isExpressionDictOperationUpdate3():\n        iterable_name = generateChildExpressionCode(\n            expression=expression.subnode_iterable, emit=emit, context=context\n        )\n\n        _generateDictOperationUpdateCommonCode(\n            dict_name=dict_name,\n            iterable_name=iterable_name,\n            release_dict=False,\n            expression=expression,\n            emit=emit,\n            context=context,\n        )\n\n    # Unique values per build here, but nested.\n    dict_key_name = context.allocateTempName(\"dictupdate_key\")\n    dict_value_name = context.allocateTempName(\"dictupdate_value\")\n\n    res_name = context.getIntResName()\n\n    for count, pair in enumerate(expression.subnode_pairs):\n        generateExpressionCode(\n            to_name=dict_key_name,\n            expression=pair.getKeyNode(),\n            emit=emit,\n            context=context,\n        )\n\n        generateExpressionCode(\n            to_name=dict_value_name,\n            expression=pair.getValueNode(),\n            emit=emit,\n            context=context,\n        )\n\n        emit(\n            \"%s = PyDict_SetItem(%s, %s, %s);\"\n            % (res_name, dict_name, dict_key_name, dict_value_name)\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s != 0\" % res_name,\n            needs_check=not expression.subnode_pairs[count].isKnownToBeHashable(),\n            release_names=(dict_key_name, dict_value_name),\n            emit=emit,\n            context=context,\n        )\n\n    getReleaseCode(\n        release_name=dict_name,\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateDictOperationCopyCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_COPY\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationClearCode(to_name, expression, emit, context):\n    generateCAPIObjectCode0(\n        to_name=None,\n        capi=\"DICT_CLEAR\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n    # None result if wanted.\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateDictOperationItemsCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_ITEMS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationIteritemsCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_ITERITEMS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationViewitemsCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_VIEWITEMS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationKeysCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_KEYS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationIterkeysCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_ITERKEYS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationViewkeysCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_VIEWKEYS\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationValuesCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_VALUES\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationFromkeysRefCode(to_name, expression, emit, context):\n    # TODO: Could also be done with generic code derived from a method object.\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_fromkeys_function_ref\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = dict_builtin_fromkeys;\" % result_name)\n\n\ndef generateDictOperationFromkeys2Code(to_name, expression, emit, context):\n    (iterable_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_fromkeys_value\", expression, emit, context\n    ) as result_name:\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=\"dict_builtin_fromkeys\",\n            expression=expression,\n            arg_names=(iterable_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateDictOperationFromkeys3Code(to_name, expression, emit, context):\n    (iterable_name, value_name) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"dict_fromkeys_value\", expression, emit, context\n    ) as result_name:\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=\"dict_builtin_fromkeys\",\n            expression=expression,\n            arg_names=(iterable_name, value_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateDictOperationItervaluesCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_ITERVALUES\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationViewvaluesCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"DICT_VIEWVALUES\",\n        tstate=False,\n        arg_desc=((\"dict_arg\", expression.subnode_dict_arg),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateDictOperationInCode(to_name, expression, emit, context):\n    inverted = expression.isExpressionDictOperationNotIn()\n\n    dict_name, key_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # Reverse child order.\n    if expression.isExpressionDictOperationHaskey():\n        dict_name, key_name = key_name, dict_name\n\n    res_name = context.getIntResName()\n\n    emit(\n        \"%s = DICT_HAS_ITEM(tstate, %s, %s);\"\n        % (\n            res_name,\n            key_name,\n            dict_name,\n        )\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(dict_name, key_name),\n        needs_check=expression.known_hashable_key is not True,\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name,\n        condition=\"%s %s 0\" % (res_name, \"==\" if inverted else \"!=\"),\n        emit=emit,\n    )\n\n\ndef generateDictOperationSetCode(statement, emit, context):\n    value_arg_name = context.allocateTempName(\"dictset_value\", unique=True)\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    dict_arg_name = context.allocateTempName(\"dictset_dict\", unique=True)\n    generateExpressionCode(\n        to_name=dict_arg_name,\n        expression=statement.subnode_dict_arg,\n        emit=emit,\n        context=context,\n    )\n\n    key_arg_name = context.allocateTempName(\"dictset_key\", unique=True)\n    generateExpressionCode(\n        to_name=key_arg_name,\n        expression=statement.subnode_key,\n        emit=emit,\n        context=context,\n    )\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\n        \"\"\"\\\nassert(PyDict_CheckExact(%s));\n%s = PyDict_SetItem(%s, %s, %s);\n\"\"\"\n        % (dict_arg_name, res_name, dict_arg_name, key_arg_name, value_arg_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s != 0\" % res_name,\n        release_names=(value_arg_name, dict_arg_name, key_arg_name),\n        emit=emit,\n        needs_check=not statement.subnode_key.isKnownToBeHashable(),\n        context=context,\n    )\n\n\ndef generateDictOperationSetCodeKeyValue(statement, emit, context):\n    key_arg_name = context.allocateTempName(\"dictset38_key\")\n    generateExpressionCode(\n        to_name=key_arg_name,\n        expression=statement.subnode_key,\n        emit=emit,\n        context=context,\n    )\n\n    value_arg_name = context.allocateTempName(\"dictset38_value\")\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    dict_arg_name = context.allocateTempName(\"dictset38_dict\")\n    generateExpressionCode(\n        to_name=dict_arg_name,\n        expression=statement.subnode_dict_arg,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\n        \"\"\"\\\nassert(PyDict_CheckExact(%s));\n%s = PyDict_SetItem(%s, %s, %s);\n\"\"\"\n        % (dict_arg_name, res_name, dict_arg_name, key_arg_name, value_arg_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s != 0\" % res_name,\n        release_names=(value_arg_name, dict_arg_name, key_arg_name),\n        emit=emit,\n        needs_check=not statement.subnode_key.isKnownToBeHashable(),\n        context=context,\n    )\n\n\ndef generateDictOperationRemoveCode(statement, emit, context):\n    dict_arg_name = context.allocateTempName(\"dictdel_dict\", unique=True)\n    generateExpressionCode(\n        to_name=dict_arg_name,\n        expression=statement.subnode_dict_arg,\n        emit=emit,\n        context=context,\n    )\n\n    key_arg_name = context.allocateTempName(\"dictdel_key\", unique=True)\n    generateExpressionCode(\n        to_name=key_arg_name,\n        expression=statement.subnode_key,\n        emit=emit,\n        context=context,\n    )\n\n    with context.withCurrentSourceCodeReference(\n        statement.subnode_key.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        res_name = context.getBoolResName()\n\n        emit(\"%s = DICT_REMOVE_ITEM(%s, %s);\" % (res_name, dict_arg_name, key_arg_name))\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            release_names=(dict_arg_name, key_arg_name),\n            needs_check=statement.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/Emission.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Emission of source code.\n\nCode generation is driven via \"emit\", which is to receive lines of code and\nthis is to collect them, providing the emit implementation. Sometimes nested\nuse of these will occur.\n\n\"\"\"\n\nimport contextlib\n\nfrom .Indentation import indented\n\n\nclass SourceCodeCollector(object):\n    def __init__(self):\n        self.codes = []\n\n    def __call__(self, code):\n        self.emit(code)\n\n    def emit(self, code):\n        for line in code.split(\"\\n\"):\n            self.codes.append(line)\n\n    def emitTo(self, emit, level):\n        for code in self.codes:\n            emit(indented(code, level))\n\n        self.codes = None\n\n\n@contextlib.contextmanager\ndef withSubCollector(emit, context):\n    context.pushCleanupScope()\n\n    with context.variable_storage.withLocalStorage():\n        sub_emit = SourceCodeCollector()\n\n        # To use the collector and put code in it and C declarations on the context.\n        yield sub_emit\n\n        local_declarations = context.variable_storage.makeCLocalDeclarations()\n\n        if local_declarations:\n            emit(\"{\")\n\n            for local_declaration in local_declarations:\n                emit(indented(local_declaration))\n\n            sub_emit.emitTo(emit, level=1)\n\n            emit(\"}\")\n        else:\n            sub_emit.emitTo(emit, level=0)\n\n        context.popCleanupScope()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ErrorCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Error codes\n\nThese are the helper functions that will emit the error exit codes. They\ncan abstractly check conditions or values directly. The release of statement\ntemporaries from context is automatic.\n\nAlso formatting errors is done here, avoiding PyErr_Format as much as\npossible.\n\nAnd releasing of values, as this is what the error case commonly does.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .ExceptionCodes import getExceptionIdentifier\nfrom .Indentation import indented\nfrom .LineNumberCodes import getErrorLineNumberUpdateCode\nfrom .templates.CodeTemplatesExceptions import (\n    template_error_catch_exception,\n    template_error_catch_quick_exception,\n    template_error_format_name_error_exception,\n    template_error_format_string_exception,\n)\n\n\ndef getErrorExitReleaseCode(context):\n    temp_release = \"\\n\".join(\n        \"Py_DECREF(%s);\" % tmp_name for tmp_name in context.getCleanupTempNames()\n    )\n\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    if keeper_variables[0] is not None:\n        temp_release += \"\\nPy_DECREF(%s);\" % keeper_variables[0]\n        temp_release += \"\\nPy_XDECREF(%s);\" % keeper_variables[1]\n        temp_release += \"\\nPy_XDECREF(%s);\" % keeper_variables[2]\n\n    return temp_release\n\n\ndef getFrameVariableTypeDescriptionCode(context):\n    type_description = context.getFrameVariableTypeDescription()\n\n    if type_description:\n        return '%s = \"%s\";' % (\n            context.getFrameTypeDescriptionDeclaration(),\n            type_description,\n        )\n    else:\n        return \"\"\n\n\ndef getErrorExitBoolCode(\n    condition,\n    emit,\n    context,\n    release_names=(),\n    release_name=None,\n    needs_check=True,\n    quick_exception=None,\n):\n    assert not condition.endswith(\";\")\n\n    if release_names:\n        getReleaseCodes(release_names, emit, context)\n        assert not release_name\n\n    if release_name is not None:\n        assert type(release_name) is not tuple\n        getReleaseCode(release_name, emit, context)\n        assert not release_names\n\n    if not needs_check:\n        getAssertionCode(\"!(%s)\" % condition, emit)\n        return\n\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    if quick_exception:\n        emit(\n            indented(\n                template_error_catch_quick_exception\n                % {\n                    \"condition\": condition,\n                    \"exception_type\": exception_type,\n                    \"exception_value\": exception_value,\n                    \"exception_tb\": exception_tb,\n                    \"exception_exit\": context.getExceptionEscape(),\n                    \"quick_exception\": getExceptionIdentifier(quick_exception),\n                    \"release_temps\": indented(getErrorExitReleaseCode(context)),\n                    \"var_description_code\": indented(\n                        getFrameVariableTypeDescriptionCode(context)\n                    ),\n                    \"line_number_code\": indented(getErrorLineNumberUpdateCode(context)),\n                },\n                0,\n            )\n        )\n    else:\n        emit(\n            indented(\n                template_error_catch_exception\n                % {\n                    \"condition\": condition,\n                    \"exception_type\": exception_type,\n                    \"exception_value\": exception_value,\n                    \"exception_tb\": exception_tb,\n                    \"exception_exit\": context.getExceptionEscape(),\n                    \"release_temps\": indented(getErrorExitReleaseCode(context)),\n                    \"var_description_code\": indented(\n                        getFrameVariableTypeDescriptionCode(context)\n                    ),\n                    \"line_number_code\": indented(getErrorLineNumberUpdateCode(context)),\n                },\n                0,\n            )\n        )\n\n\ndef getErrorExitCode(\n    check_name,\n    emit,\n    context,\n    release_names=(),\n    release_name=None,\n    quick_exception=None,\n    needs_check=True,\n):\n    getErrorExitBoolCode(\n        condition=check_name.getCType().getExceptionCheckCondition(check_name),\n        release_names=release_names,\n        release_name=release_name,\n        needs_check=needs_check,\n        quick_exception=quick_exception,\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getExceptionChainingCode(context):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    keeper_vars = context.getExceptionKeeperVariables()\n\n    if keeper_vars[0] is not None:\n        return (\n            \"ADD_EXCEPTION_CONTEXT(tstate, &%s, &%s);\"\n            % (keeper_vars[0], keeper_vars[1]),\n        )\n    else:\n        return (\n            \"NORMALIZE_EXCEPTION(tstate, &%s, &%s, &%s);\"\n            % (exception_type, exception_value, exception_tb),\n            \"CHAIN_EXCEPTION(tstate, %s);\" % exception_value,\n        )\n\n\ndef getTakeReferenceCode(value_name, emit):\n    value_name.getCType().getTakeReferenceCode(value_name=value_name, emit=emit)\n\n\ndef getReleaseCode(release_name, emit, context):\n    if context.needsCleanup(release_name):\n        release_name.getCType().getReleaseCode(\n            value_name=release_name, needs_check=False, emit=emit\n        )\n\n        context.removeCleanupTempName(release_name)\n\n\ndef getReleaseCodes(release_names, emit, context):\n    for release_name in release_names:\n        getReleaseCode(release_name=release_name, emit=emit, context=context)\n\n\ndef getMustNotGetHereCode(reason, emit):\n    emit(\n        \"\"\"\\\nNUITKA_CANNOT_GET_HERE(\"%s\");\nreturn NULL;\"\"\"\n        % reason\n    )\n\n\ndef getAssertionCode(check, emit):\n    emit(\"assert(%s);\" % check)\n\n\ndef getLocalVariableReferenceErrorCode(variable, condition, emit, context):\n    variable_name = variable.getName()\n\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    if variable.getOwner() is not context.getOwner():\n        helper_code = \"FORMAT_UNBOUND_CLOSURE_ERROR\"\n    else:\n        helper_code = \"FORMAT_UNBOUND_LOCAL_ERROR\"\n\n    set_exception = [\n        \"%s(&%s, &%s, %s);\"\n        % (\n            helper_code,\n            exception_type,\n            exception_value,\n            context.getConstantCode(variable_name),\n        ),\n        \"%s = NULL;\" % exception_tb,\n    ]\n\n    # TODO: Move this into the helper code.\n    if python_version >= 0x300:\n        set_exception.extend(_getExceptionChainingCode(context))\n\n    emit(\n        template_error_format_string_exception\n        % {\n            \"condition\": condition,\n            \"exception_exit\": context.getExceptionEscape(),\n            \"set_exception\": indented(set_exception),\n            \"release_temps\": indented(getErrorExitReleaseCode(context)),\n            \"var_description_code\": indented(\n                getFrameVariableTypeDescriptionCode(context)\n            ),\n            \"line_number_code\": indented(getErrorLineNumberUpdateCode(context)),\n        }\n    )\n\n\n# TODO: Get rid of this function entirely.\ndef getNameReferenceErrorCode(variable_name, condition, emit, context):\n    helper_code = \"RAISE_CURRENT_EXCEPTION_NAME_ERROR\"\n\n    if python_version < 0x340:\n        owner = context.getOwner()\n\n        if not owner.isCompiledPythonModule() and not owner.isExpressionClassBodyBase():\n            helper_code = \"RAISE_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR\"\n\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\n        template_error_format_name_error_exception\n        % {\n            \"condition\": condition,\n            \"exception_exit\": context.getExceptionEscape(),\n            \"raise_name_error_helper\": helper_code,\n            \"variable_name\": context.getConstantCode(variable_name),\n            \"release_temps\": indented(getErrorExitReleaseCode(context)),\n            \"var_description_code\": indented(\n                getFrameVariableTypeDescriptionCode(context)\n            ),\n            \"line_number_code\": indented(getErrorLineNumberUpdateCode(context)),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/EvalCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Eval/exec/execfile/compile built-in related codes. \"\"\"\n\nfrom nuitka import Options\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode, getReleaseCode\nfrom .PythonAPICodes import getReferenceExportCode\nfrom .VariableCodes import getVariableAssignmentCode\n\n\ndef _getStoreLocalsCode(locals_name, variable_traces, is_dict, emit, context):\n    for variable, variable_trace in sorted(\n        variable_traces, key=lambda x: x[0].getName()\n    ):\n        if not variable.isModuleVariable():\n            key_name = context.getConstantCode(constant=variable.getName())\n\n            value_name = context.allocateTempName(\"locals_value\", unique=True)\n\n            if is_dict:\n                emit(\n                    \"%s = DICT_GET_ITEM0(tstate, %s, %s);\"\n                    % (value_name, locals_name, key_name)\n                )\n            else:\n                emit(\n                    \"%s = PyObject_GetItem(%s, %s);\"\n                    % (value_name, locals_name, key_name)\n                )\n\n                getErrorExitBoolCode(\n                    condition=\"\"\"\\\n%s == NULL && !EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_KeyError)\"\"\"\n                    % value_name,\n                    emit=emit,\n                    context=context,\n                )\n\n                emit(\"CLEAR_ERROR_OCCURRED(tstate);\")\n\n                context.addCleanupTempName(value_name)\n\n            emit(\"if (%s != NULL)\" % value_name)\n            emit(\"{\")\n\n            getVariableAssignmentCode(\n                variable=variable,\n                variable_trace=variable_trace,\n                tmp_name=value_name,\n                needs_release=None,  # TODO: Could be known maybe.\n                inplace=False,\n                emit=emit,\n                context=context,\n            )\n\n            emit(\"}\")\n\n\ndef generateBuiltinCompileCode(to_name, expression, emit, context):\n    source_name = context.allocateTempName(\"compile_source\")\n    filename_name = context.allocateTempName(\"compile_filename\")\n    mode_name = context.allocateTempName(\"compile_mode\")\n\n    generateExpressionCode(\n        to_name=source_name,\n        expression=expression.subnode_source,\n        emit=emit,\n        context=context,\n    )\n    generateExpressionCode(\n        to_name=filename_name,\n        expression=expression.subnode_filename,\n        emit=emit,\n        context=context,\n    )\n    generateExpressionCode(\n        to_name=mode_name,\n        expression=expression.subnode_mode,\n        emit=emit,\n        context=context,\n    )\n\n    if expression.subnode_flags is not None:\n        flags_name = context.allocateTempName(\"compile_flags\")\n\n        generateExpressionCode(\n            to_name=flags_name,\n            expression=expression.subnode_flags,\n            emit=emit,\n            context=context,\n        )\n    else:\n        flags_name = \"NULL\"\n\n    if expression.subnode_dont_inherit is not None:\n        dont_inherit_name = context.allocateTempName(\"compile_dont_inherit\")\n\n        generateExpressionCode(\n            to_name=dont_inherit_name,\n            expression=expression.subnode_dont_inherit,\n            emit=emit,\n            context=context,\n        )\n    else:\n        dont_inherit_name = \"NULL\"\n\n    if expression.subnode_optimize is not None:\n        optimize_name = context.allocateTempName(\"compile_optimize\")\n\n        generateExpressionCode(\n            to_name=optimize_name,\n            expression=expression.subnode_optimize,\n            emit=emit,\n            context=context,\n        )\n    else:\n        optimize_name = \"NULL\"\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"compile_result\", expression, emit, context\n    ) as value_name:\n        _getBuiltinCompileCode(\n            to_name=value_name,\n            source_name=source_name,\n            filename_name=filename_name,\n            mode_name=mode_name,\n            flags_name=flags_name,\n            dont_inherit_name=dont_inherit_name,\n            optimize_name=optimize_name,\n            emit=emit,\n            context=context,\n        )\n\n\ndef _getBuiltinCompileCode(\n    to_name,\n    source_name,\n    filename_name,\n    mode_name,\n    flags_name,\n    dont_inherit_name,\n    optimize_name,\n    emit,\n    context,\n):\n    if python_version < 0x300:\n        args = (source_name, filename_name, mode_name, flags_name, dont_inherit_name)\n    else:\n        args = (\n            source_name,\n            filename_name,\n            mode_name,\n            flags_name,\n            dont_inherit_name,\n            optimize_name,\n        )\n\n    emit(\n        \"%s = COMPILE_CODE(tstate, %s);\"\n        % (to_name, \", \".join(str(arg) for arg in args))\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(\n            source_name,\n            filename_name,\n            mode_name,\n            flags_name,\n            dont_inherit_name,\n            optimize_name,\n        ),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getBuiltinEvalCode(\n    to_name,\n    source_name,\n    filename_name,\n    globals_name,\n    locals_name,\n    mode_name,\n    closure_name,\n    emit,\n    context,\n):\n    compiled_name = context.allocateTempName(\"eval_compiled\")\n\n    _getBuiltinCompileCode(\n        to_name=compiled_name,\n        source_name=source_name,\n        filename_name=filename_name,\n        mode_name=mode_name,\n        flags_name=\"NULL\",\n        dont_inherit_name=\"NULL\",\n        optimize_name=\"NULL\",\n        emit=emit,\n        context=context,\n    )\n\n    emit(\n        \"%s = EVAL_CODE(tstate, %s, %s, %s, %s);\"\n        % (to_name, compiled_name, globals_name, locals_name, closure_name or \"NULL\")\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(compiled_name, globals_name, locals_name, closure_name),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateExecCode(statement, emit, context):\n    source_arg = statement.subnode_source_code\n    globals_arg = statement.subnode_globals_arg\n    locals_arg = statement.subnode_locals_arg\n\n    source_name = context.allocateTempName(\"exec_source\")\n    globals_name = context.allocateTempName(\"exec_globals\")\n    locals_name = context.allocateTempName(\"exec_locals\")\n\n    generateExpressionCode(\n        to_name=source_name, expression=source_arg, emit=emit, context=context\n    )\n\n    generateExpressionCode(\n        to_name=globals_name, expression=globals_arg, emit=emit, context=context\n    )\n\n    generateExpressionCode(\n        to_name=locals_name, expression=locals_arg, emit=emit, context=context\n    )\n\n    source_ref = statement.getSourceReference()\n\n    filename_name = context.allocateTempName(\"exec_filename\")\n\n    # Default filename with origin in improved mode.\n    filename_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=filename_name,\n        constant=(\n            \"<string>\"\n            if Options.is_full_compat\n            else \"<string at %s>\" % source_ref.getAsString()\n        ),\n        may_escape=False,\n        emit=emit,\n        context=context,\n    )\n\n    getReferenceExportCode(filename_name, emit, context)\n    context.addCleanupTempName(filename_name)\n\n    getReferenceExportCode(source_name, emit, context)\n    context.addCleanupTempName(source_name)\n\n    with context.withCurrentSourceCodeReference(\n        locals_arg.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        res_name = context.getBoolResName()\n\n        emit(\n            \"%s = EXEC_FILE_ARG_HANDLING(tstate, &%s, &%s);\"\n            % (res_name, source_name, filename_name)\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name, emit=emit, context=context\n        )\n\n        compiled_name = context.allocateTempName(\"exec_compiled\")\n\n        _getBuiltinCompileCode(\n            to_name=compiled_name,\n            source_name=source_name,\n            filename_name=filename_name,\n            mode_name=context.getConstantCode(constant=\"exec\"),\n            flags_name=\"NULL\",\n            dont_inherit_name=\"NULL\",\n            optimize_name=\"NULL\",\n            emit=emit,\n            context=context,\n        )\n\n        to_name = context.allocateTempName(\"exec_result\")\n\n        emit(\n            \"%s = EVAL_CODE(tstate, %s, %s, %s, NULL);\"\n            % (to_name, compiled_name, globals_name, locals_name)\n        )\n\n        getErrorExitCode(\n            check_name=to_name,\n            release_names=(\n                compiled_name,\n                globals_name,\n                locals_name,\n                source_name,\n                filename_name,\n            ),\n            emit=emit,\n            context=context,\n        )\n\n        # Immediately release the exec result, no point in keeping it, it's a\n        # statement.\n        context.addCleanupTempName(to_name)\n        getReleaseCode(release_name=to_name, emit=emit, context=context)\n\n\ndef _generateEvalCode(to_name, node, emit, context):\n    source_name = context.allocateTempName(\"eval_source\")\n    globals_name = context.allocateTempName(\"eval_globals\")\n    locals_name = context.allocateTempName(\"eval_locals\")\n\n    generateExpressionCode(\n        to_name=source_name,\n        expression=node.subnode_source_code,\n        emit=emit,\n        context=context,\n    )\n\n    generateExpressionCode(\n        to_name=globals_name,\n        expression=node.subnode_globals_arg,\n        emit=emit,\n        context=context,\n    )\n\n    generateExpressionCode(\n        to_name=locals_name,\n        expression=node.subnode_locals_arg,\n        emit=emit,\n        context=context,\n    )\n\n    if node.isExpressionBuiltinEval() or (\n        python_version >= 0x300 and node.isExpressionBuiltinExec()\n    ):\n        filename = \"<string>\"\n    else:\n        filename = \"<execfile>\"\n\n    if (\n        python_version >= 0x31B\n        and node.isExpressionBuiltinExec()\n        and node.subnode_closure is not None\n    ):\n        closure_name = context.allocateTempName(\"eval_closure\")\n\n        generateExpressionCode(\n            to_name=closure_name,\n            expression=node.subnode_closure,\n            emit=emit,\n            context=context,\n        )\n    else:\n        closure_name = None\n\n    getBuiltinEvalCode(\n        to_name=to_name,\n        source_name=source_name,\n        globals_name=globals_name,\n        locals_name=locals_name,\n        filename_name=context.getConstantCode(constant=filename),\n        mode_name=context.getConstantCode(\n            constant=\"eval\" if node.isExpressionBuiltinEval() else \"exec\"\n        ),\n        closure_name=closure_name,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateEvalCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"eval_result\", expression, emit, context\n    ) as value_name:\n        _generateEvalCode(\n            to_name=value_name, node=expression, emit=emit, context=context\n        )\n\n\ndef generateExecfileCode(to_name, expression, emit, context):\n    assert python_version < 0x300\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"execfile_result\", expression, emit, context\n    ) as value_name:\n        _generateEvalCode(\n            to_name=value_name, node=expression, emit=emit, context=context\n        )\n\n\ndef generateLocalsDictSyncCode(statement, emit, context):\n    locals_arg = statement.subnode_locals_arg\n    locals_name = context.allocateTempName(\"sync_locals\")\n\n    generateExpressionCode(\n        to_name=locals_name, expression=locals_arg, emit=emit, context=context\n    )\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        _getStoreLocalsCode(\n            locals_name=locals_name,\n            variable_traces=statement.getPreviousVariablesTraces(),\n            is_dict=locals_arg.hasShapeDictionaryExact(),\n            emit=emit,\n            context=context,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ExceptionCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Exception handling.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .templates.CodeTemplatesExceptions import (\n    template_publish_exception_to_handler,\n)\n\n\ndef getExceptionIdentifier(exception_type):\n    assert \"PyExc\" not in exception_type, exception_type\n\n    if exception_type == \"NotImplemented\":\n        return \"Py_NotImplemented\"\n\n    return \"PyExc_%s\" % exception_type\n\n\ndef generateExceptionRefCode(to_name, expression, emit, context):\n    exception_type = expression.getExceptionName()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"exception_name\", expression, emit, context\n    ) as value_name:\n        emit(\"%s = %s;\" % (value_name, getExceptionIdentifier(exception_type)))\n\n\ndef getTracebackMakingIdentifier(context, lineno_name):\n    frame_handle = context.getFrameHandle()\n    assert frame_handle is not None\n\n    return \"MAKE_TRACEBACK(%s, %s)\" % (frame_handle, lineno_name)\n\n\ndef generateExceptionCaughtTypeCode(to_name, expression, emit, context):\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"exception_caught_type\", expression, emit, context\n    ) as value_name:\n        if keeper_variables[0] is None:\n            emit(\"%s = EXC_TYPE(PyThreadState_GET());\" % (value_name,))\n        else:\n            emit(\"%s = %s;\" % (value_name, keeper_variables[0]))\n\n\ndef generateExceptionCaughtValueCode(to_name, expression, emit, context):\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"exception_caught_value\", expression, emit, context\n    ) as value_name:\n        if keeper_variables[1] is None:\n            emit(\"%s = EXC_VALUE(PyThreadState_GET());\" % (value_name,))\n        else:\n            if python_version >= 0x270:\n                emit(\"%s = %s;\" % (value_name, keeper_variables[1]))\n            else:\n                emit(\n                    \"%s = %s ? %s : Py_None;\"\n                    % (value_name, keeper_variables[1], keeper_variables[1])\n                )\n\n\ndef generateExceptionCaughtTracebackCode(to_name, expression, emit, context):\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"exception_caught_tb\", expression, emit, context\n    ) as value_name:\n        if keeper_variables[2] is None:\n            if python_version < 0x3B0:\n                emit(\n                    \"%s = (PyObject *)EXC_TRACEBACK(PyThreadState_GET());\"\n                    % (value_name,)\n                )\n            else:\n                emit(\n                    \"%s = (PyObject *)GET_EXCEPTION_TRACEBACK(EXC_VALUE(PyThreadState_GET()));\"\n                    % (value_name,)\n                )\n        else:\n            emit(\n                \"\"\"\\\nif (%(keeper_tb)s != NULL) {\n    %(to_name)s = (PyObject *)%(keeper_tb)s;\n    Py_INCREF(%(to_name)s);\n} else {\n    %(to_name)s = (PyObject *)%(tb_making)s;\n}\n\"\"\"\n                % {\n                    \"to_name\": value_name,\n                    \"keeper_tb\": keeper_variables[2],\n                    \"tb_making\": getTracebackMakingIdentifier(\n                        context=context, lineno_name=keeper_variables[3]\n                    ),\n                }\n            )\n\n            context.addCleanupTempName(value_name)\n\n\ndef getExceptionUnpublishedReleaseCode(emit, context):\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    if keeper_variables[0] is not None:\n        emit(\"Py_DECREF(%s);\" % keeper_variables[0])\n        emit(\"Py_XDECREF(%s);\" % keeper_variables[1])\n        emit(\"Py_XDECREF(%s);\" % keeper_variables[2])\n\n\ndef generateExceptionPublishCode(statement, emit, context):\n    # This statement has no attributes really, pylint: disable=unused-argument\n\n    # Current variables cannot be used anymore now.\n    (\n        keeper_type,\n        keeper_value,\n        keeper_tb,\n        keeper_lineno,\n    ) = context.setExceptionKeeperVariables((None, None, None, None))\n\n    emit(\n        template_publish_exception_to_handler\n        % {\n            \"tb_making\": getTracebackMakingIdentifier(\n                context=context, lineno_name=keeper_lineno\n            ),\n            \"keeper_tb\": keeper_tb,\n            \"keeper_lineno\": keeper_lineno,\n            \"frame_identifier\": context.getFrameHandle(),\n        }\n    )\n\n    # TODO: Make this one thing for performance with thread state shared, also for less code,\n    # then we should not make it in header anymore. Might be more scalable too.\n    emit(\n        \"PUBLISH_CURRENT_EXCEPTION(tstate, &%s, &%s, &%s);\"\n        % (keeper_type, keeper_value, keeper_tb)\n    )\n\n\ndef generateBuiltinMakeExceptionCode(to_name, expression, emit, context):\n    # We try to make optimal code for various cases, pylint: disable=too-many-locals\n\n    from .CallCodes import getCallCodeNoArgs, getCallCodePosArgsQuick\n\n    exception_arg_names = []\n\n    for exception_arg in expression.subnode_args:\n        exception_arg_name = context.allocateTempName(\"make_exception_arg\")\n\n        generateExpressionCode(\n            to_name=exception_arg_name,\n            expression=exception_arg,\n            emit=emit,\n            context=context,\n        )\n\n        exception_arg_names.append(exception_arg_name)\n\n    exception_type = expression.getExceptionName()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"exception_made\", expression, emit, context\n    ) as value_name:\n        if exception_arg_names:\n            getCallCodePosArgsQuick(\n                to_name=value_name,\n                called_name=getExceptionIdentifier(exception_type),\n                expression=expression,\n                arg_names=exception_arg_names,\n                emit=emit,\n                context=context,\n            )\n\n        else:\n            getCallCodeNoArgs(\n                to_name=value_name,\n                called_name=getExceptionIdentifier(exception_type),\n                expression=expression,\n                emit=emit,\n                context=context,\n            )\n\n        if expression.getExceptionName() == \"ImportError\" and python_version >= 0x300:\n            from .PythonAPICodes import getReferenceExportCode\n\n            import_error_name_expression = expression.subnode_name\n\n            if import_error_name_expression is not None:\n                exception_importerror_name = context.allocateTempName(\n                    \"make_exception_importerror_name\"\n                )\n\n                generateExpressionCode(\n                    to_name=exception_importerror_name,\n                    expression=import_error_name_expression,\n                    emit=emit,\n                    context=context,\n                    allow_none=True,\n                )\n\n                getReferenceExportCode(exception_importerror_name, emit, context)\n                if context.needsCleanup(exception_importerror_name):\n                    context.removeCleanupTempName(exception_importerror_name)\n\n                emit(\n                    \"((PyImportErrorObject *)%s)->name = %s;\"\n                    % (to_name, exception_importerror_name)\n                )\n\n            import_error_path_expression = expression.subnode_path\n\n            if import_error_path_expression is not None:\n                exception_importerror_path = context.allocateTempName(\n                    \"make_exception_importerror_path\"\n                )\n\n                generateExpressionCode(\n                    to_name=exception_importerror_path,\n                    expression=import_error_path_expression,\n                    emit=emit,\n                    context=context,\n                    allow_none=True,\n                )\n\n                getReferenceExportCode(exception_importerror_path, emit, context)\n                if context.needsCleanup(exception_importerror_path):\n                    context.removeCleanupTempName(exception_importerror_path)\n\n                emit(\n                    \"((PyImportErrorObject *)%s)->path = %s;\"\n                    % (to_name, exception_importerror_path)\n                )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ExpressionCTypeSelectionHelpers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module for helpers to select types for operation arguments.\n\nThis is first used for comparisons and binary operations, but should see\ngeneral use too and expand beyond constant values, e.g. covering constant\nvalues that are of behind conditions or variables.\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bytearray,\n    tshape_bytes,\n    tshape_float,\n    tshape_int,\n    tshape_long,\n    tshape_str,\n    tshape_unicode,\n)\nfrom nuitka.PythonVersions import (\n    isPythonValidCLongValue,\n    isPythonValidDigitValue,\n    python_version,\n)\n\nfrom .c_types.CTypeCFloats import CTypeCFloat\nfrom .c_types.CTypeCLongs import CTypeCLong, CTypeCLongDigit\nfrom .c_types.CTypePyObjectPointers import CTypePyObjectPtr\n\n\ndef _pickIntFamilyType(expression):\n    if expression.isCompileTimeConstant():\n        # On Python2, \"INT_CLONG\" is very fast as \"CLONG\" is the internal representation\n        # of it, for Python3, it should be avoided, it usually is around 2**30.\n        if python_version < 0x300:\n            c_type = CTypeCLong\n        elif isPythonValidDigitValue(expression.getCompileTimeConstant()):\n            c_type = CTypeCLongDigit\n        elif isPythonValidCLongValue(expression.getCompileTimeConstant()):\n            c_type = CTypeCLong\n        else:\n            c_type = CTypePyObjectPtr\n    else:\n        c_type = CTypePyObjectPtr\n\n    return c_type\n\n\ndef _pickFloatFamilyType(expression):\n    if expression.isCompileTimeConstant():\n        c_type = CTypeCFloat\n    else:\n        c_type = CTypePyObjectPtr\n\n    return c_type\n\n\ndef _pickStrFamilyType(expression):\n    # TODO: No C types yet for these, pylint: disable=unused-argument\n    return CTypePyObjectPtr\n\n\ndef _pickBytesFamilyType(expression):\n    # TODO: No C types yet for these, pylint: disable=unused-argument\n    return CTypePyObjectPtr\n\n\n_int_types_family = (tshape_int, tshape_long)\n_float_types_family = (tshape_int, tshape_long, tshape_float)\n_str_types_family = (tshape_str, tshape_unicode)\n\n# TODO: Bytearray should be there too.\n_bytes_types_family = (tshape_bytes,)\n\n_float_argument_normalization = {\n    # The C float argument should be last.\n    (CTypePyObjectPtr, CTypeCFloat): False,\n    (CTypeCFloat, CTypePyObjectPtr): True,\n}\n\n_long_argument_normalization = {\n    # The C long/digit arguments should be last.\n    (CTypePyObjectPtr, CTypeCLong): False,\n    (CTypeCLong, CTypePyObjectPtr): True,\n    (CTypePyObjectPtr, CTypeCLongDigit): False,\n    (CTypeCLongDigit, CTypePyObjectPtr): True,\n}\n\n_str_argument_normalization = {\n    # The C str/unicode argument should be last, but does not exist yet.\n}\n\n_bytes_argument_normalization = {\n    # The C str/unicode argument should be last, but does not exist yet.\n}\n\n\ndef decideExpressionCTypes(left, right, may_swap_arguments):\n    # Complex stuff with many cases, pylint: disable=too-many-branches\n\n    left_shape = left.getTypeShape()\n    right_shape = right.getTypeShape()\n\n    if left_shape in _int_types_family and right_shape in _int_types_family:\n        may_swap_arguments = may_swap_arguments in (\"number\", \"always\")\n\n        left_c_type = _pickIntFamilyType(left)\n        right_c_type = _pickIntFamilyType(right)\n\n        needs_argument_swap = (\n            may_swap_arguments\n            and left_c_type is not right_c_type\n            and _long_argument_normalization[(left_c_type, right_c_type)]\n        )\n\n        # TODO: The INT and LONG types, do not have distinct C types yet, and maybe\n        # won't have it, so these are manual:\n        if may_swap_arguments and not needs_argument_swap:\n            if right_shape is tshape_long and left_shape is tshape_int:\n                needs_argument_swap = True\n\n        unknown_types = False\n    elif left_shape in _float_types_family and right_shape in _float_types_family:\n        may_swap_arguments = may_swap_arguments in (\"number\", \"always\")\n\n        left_c_type = _pickFloatFamilyType(left)\n        right_c_type = _pickFloatFamilyType(right)\n\n        # Arguments might be swapped because of normalization.\n        needs_argument_swap = (\n            may_swap_arguments\n            and left_c_type is not right_c_type\n            and _float_argument_normalization[(left_c_type, right_c_type)]\n        )\n\n        # TODO: The INT and LONG types, do not have distinct C types yet, and maybe\n        # won't have it, so these are manual:\n        if may_swap_arguments and not needs_argument_swap:\n            if right_shape is tshape_float and left_shape in (tshape_int, tshape_long):\n                needs_argument_swap = True\n\n        unknown_types = False\n    elif left_shape in _str_types_family and right_shape in _str_types_family:\n        may_swap_arguments = may_swap_arguments == \"always\"\n\n        left_c_type = _pickStrFamilyType(left)\n        right_c_type = _pickStrFamilyType(right)\n\n        # Arguments might be swapped because of normalization.\n        needs_argument_swap = (\n            may_swap_arguments\n            and left_c_type is not right_c_type\n            and _str_argument_normalization[(left_c_type, right_c_type)]\n        )\n\n        # TODO: The STR and UNICODE types, do not have distinct C types yet, and maybe\n        # won't have it, so these are manual:\n        if may_swap_arguments and not needs_argument_swap and str is bytes:\n            if right_shape is tshape_unicode and left_shape is tshape_str:\n                needs_argument_swap = True\n\n        unknown_types = False\n    elif left_shape in _bytes_types_family and right_shape in _bytes_types_family:\n        may_swap_arguments = may_swap_arguments == \"always\"\n\n        left_c_type = _pickBytesFamilyType(left)\n        right_c_type = _pickBytesFamilyType(right)\n\n        # Arguments might be swapped because of normalization.\n        needs_argument_swap = (\n            may_swap_arguments\n            and left_c_type is not right_c_type\n            and _bytes_argument_normalization[(left_c_type, right_c_type)]\n        )\n\n        # TODO: The BYTES and BYTEARRAY types, do not have distinct C types yet, and maybe\n        # won't have it, so these are manual:\n        if may_swap_arguments and not needs_argument_swap:\n            if right_shape is tshape_bytearray and left_shape is tshape_bytes:\n                needs_argument_swap = True\n\n        unknown_types = False\n    else:\n        left_c_type = right_c_type = CTypePyObjectPtr\n\n        needs_argument_swap = False\n        unknown_types = True\n\n    return (\n        unknown_types,\n        needs_argument_swap,\n        left_shape,\n        right_shape,\n        left_c_type,\n        right_c_type,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ExpressionCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Expression codes, side effects, or statements that are an unused expression.\n\nWhen you write \"f()\", i.e. you don't use the return value, that is an expression\nonly statement.\n\n\"\"\"\n\nfrom .CodeHelpers import generateExpressionCode\nfrom .ErrorCodes import getReleaseCode\n\n\ndef generateExpressionOnlyCode(statement, emit, context):\n    return getStatementOnlyCode(\n        value=statement.subnode_expression, emit=emit, context=context\n    )\n\n\ndef getStatementOnlyCode(value, emit, context):\n    tmp_name = context.allocateTempName(\n        base_name=\"unused\", type_name=\"nuitka_void\", unique=True\n    )\n    tmp_name.maybe_unused = True\n\n    generateExpressionCode(\n        expression=value, to_name=tmp_name, emit=emit, context=context\n    )\n\n    # An error of the expression is dealt inside of this, not necessary here,\n    # but we have to release non-error value if it has a reference.\n    getReleaseCode(release_name=tmp_name, emit=emit, context=context)\n\n\ndef generateSideEffectsCode(to_name, expression, emit, context):\n    for side_effect in expression.subnode_side_effects:\n        getStatementOnlyCode(value=side_effect, emit=emit, context=context)\n\n    generateExpressionCode(\n        to_name=to_name,\n        expression=expression.subnode_expression,\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/FrameCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Frame codes\n\nThis is about frame stacks and their management. There are different kinds\nof frames for different uses.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Jinja2 import renderTemplateFromString\n\nfrom .CodeHelpers import _generateStatementSequenceCode\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import getFrameVariableTypeDescriptionCode\nfrom .ExceptionCodes import getTracebackMakingIdentifier\nfrom .Indentation import indented\nfrom .LabelCodes import getGotoCode, getLabelCode\nfrom .ModuleCodes import getModuleAccessCode\nfrom .templates.CodeTemplatesFrames import (\n    template_frame_attach_locals,\n    template_frame_guard_generator_exception_handler,\n    template_frame_guard_generator_return_handler,\n    template_frame_guard_normal_exception_handler,\n    template_frame_guard_normal_main_block,\n    template_frame_guard_normal_return_handler,\n)\n\n\ndef getFrameLocalsStorageSize(type_descriptions):\n    candidates = set()\n\n    for type_description in type_descriptions:\n        candidate = \"+\".join(\n            getTypeSizeOf(type_indicator) for type_indicator in sorted(type_description)\n        )\n\n        candidates.add(candidate)\n\n    if not candidates:\n        return \"0\"\n\n    candidates = list(sorted(candidates))\n    result = candidates.pop()\n\n    while candidates:\n        # assert False, (type_descriptions, context.frame_variables_stack[-1])\n\n        result = \"MAX(%s, %s)\" % (result, candidates.pop())\n\n    return result\n\n\ndef _searchLocalVariableByName(local_variables, variable_name):\n    for local_variable in local_variables:\n        if local_variable.getName() == variable_name:\n            return local_variable\n\n    return None\n\n\ndef generateStatementsFrameCode(statement_sequence, emit, context):\n    # This is a wrapper that provides also handling of frames. The standard\n    # and generator frame variety ought to be merged once generators are\n    # possible to inline.\n    # TODO: This will get simpler, pylint: disable=too-many-locals\n    context.pushCleanupScope()\n\n    guard_mode = statement_sequence.getGuardMode()\n\n    code_object = statement_sequence.getCodeObject()\n    code_identifier = context.getCodeObjectHandle(code_object=code_object)\n\n    parent_exception_exit = context.getExceptionEscape()\n\n    # For nested frames, make sure to restore set the type description.\n    if context.getFrameHandle() is not None:\n        real_parent_exception_exit = parent_exception_exit\n        parent_exception_exit = context.allocateLabel(\"nested_frame_exit\")\n\n    # Allow stacking of frame handles.\n    context.pushFrameHandle(code_identifier, statement_sequence.hasStructureMember())\n\n    context.setExceptionEscape(context.allocateLabel(\"frame_exception_exit\"))\n\n    needs_preserve = statement_sequence.needsFrameExceptionPreserving()\n\n    if statement_sequence.mayReturn():\n        parent_return_exit = context.getReturnTarget()\n\n        context.setReturnTarget(context.allocateLabel(\"frame_return_exit\"))\n    else:\n        parent_return_exit = None\n\n    # We need to define that all the variables needs to be pushed. We do not\n    # have a flag that says \"always NULL\" for variables. With efficient NULL\n    # passing however (not at all, TODO), that doesn't matter much.\n    provider = statement_sequence.getParentVariableProvider()\n    local_variables = provider.getLocalVariables()\n\n    context.pushFrameVariables(\n        tuple(\n            _searchLocalVariableByName(local_variables, variable_name)\n            for variable_name in code_object.getVarNames()\n        )\n    )\n\n    # Now generate the statements code into a local buffer, to we can wrap\n    # the frame stuff around it.\n    local_emit = SourceCodeCollector()\n\n    _generateStatementSequenceCode(\n        statement_sequence=statement_sequence, emit=local_emit, context=context\n    )\n\n    if statement_sequence.mayRaiseException(BaseException):\n        frame_exception_exit = context.getExceptionEscape()\n    else:\n        frame_exception_exit = None\n\n    if parent_return_exit is not None:\n        frame_return_exit = context.getReturnTarget()\n    else:\n        frame_return_exit = None\n\n    if guard_mode == \"generator\":\n        # TODO: This case should also care about \"needs_preserve\", as for\n        # Python3 it is actually not a stub of empty code.\n\n        getFrameGuardGeneratorCode(\n            frame_node=statement_sequence,\n            code_identifier=code_identifier,\n            codes=local_emit.codes,\n            parent_exception_exit=parent_exception_exit,\n            frame_exception_exit=frame_exception_exit,\n            parent_return_exit=parent_return_exit,\n            frame_return_exit=frame_return_exit,\n            emit=emit,\n            context=context,\n        )\n    elif guard_mode in (\"full\", \"once\"):\n        getFrameGuardHeavyCode(\n            frame_node=statement_sequence,\n            code_identifier=code_identifier,\n            parent_exception_exit=parent_exception_exit,\n            parent_return_exit=parent_return_exit,\n            frame_exception_exit=frame_exception_exit,\n            frame_return_exit=frame_return_exit,\n            codes=local_emit.codes,\n            needs_preserve=needs_preserve,\n            emit=emit,\n            context=context,\n        )\n    else:\n        assert False, guard_mode\n\n    context.popFrameVariables()\n    context.popFrameHandle()\n\n    # For nested frames, make sure to restore set the type description.\n    if context.getFrameHandle() is not None:\n        label = context.allocateLabel(\"skip_nested_handling\")\n        getGotoCode(label, emit)\n        getLabelCode(parent_exception_exit, emit)\n        emit(getFrameVariableTypeDescriptionCode(context))\n        getGotoCode(real_parent_exception_exit, emit)\n        getLabelCode(label, emit)\n\n        parent_exception_exit = real_parent_exception_exit\n\n    context.popCleanupScope()\n\n    context.setExceptionEscape(parent_exception_exit)\n\n    if frame_return_exit is not None:\n        context.setReturnTarget(parent_return_exit)\n\n\ndef getTypeSizeOf(type_indicator):\n    if type_indicator in (\"O\", \"o\", \"N\", \"c\"):\n        return \"sizeof(void *)\"\n    elif type_indicator == \"b\":\n        return \"sizeof(nuitka_bool)\"\n    elif type_indicator == \"L\":\n        return \"sizeof(nuitka_ilong)\"\n    else:\n        assert False, type_indicator\n\n\ndef getFrameAttachLocalsCode(context, frame_identifier):\n    frame_variable_codes = context.getFrameVariableCodeNames()\n    frame_variable_codes = \",\\n    \".join(frame_variable_codes)\n    if frame_variable_codes:\n        frame_variable_codes = \",\\n    \" + frame_variable_codes\n\n    return template_frame_attach_locals % {\n        \"frame_identifier\": frame_identifier,\n        \"type_description\": context.getFrameTypeDescriptionDeclaration(),\n        \"frame_variable_refs\": frame_variable_codes,\n    }\n\n\ndef getFrameGuardHeavyCode(\n    frame_node,\n    code_identifier,\n    codes,\n    parent_exception_exit,\n    parent_return_exit,\n    frame_exception_exit,\n    frame_return_exit,\n    needs_preserve,\n    emit,\n    context,\n):\n    # We really need this many parameters here and it gets very\n    # detail rich, pylint: disable=too-many-locals\n\n    no_exception_exit = context.allocateLabel(\"frame_no_exception\")\n\n    frame_identifier = context.getFrameHandle()\n    if frame_node.getGuardMode() == \"full\":\n        frame_cache_identifier = context.variable_storage.addFrameCacheDeclaration(\n            frame_identifier.code_name\n        )\n    else:\n        frame_cache_identifier = None\n\n    frame_init_code = \"\"\n    frame_exit_code = \"\"\n\n    # Expose the locals dictionary with the frame locals if it exists.\n    if frame_node.isStatementsFrameClass():\n        attach_locals_code = getFrameAttachLocalsCode(context, frame_identifier)\n\n        use_locals_dict = (\n            frame_node.getLocalsScope().getCodeName() in context.getLocalsDictNames()\n        )\n\n        make_frame_code = (\n            \"\"\"MAKE_CLASS_FRAME(tstate, %(code_identifier)s, %(module_identifier)s, %(locals_dict_name)s, %(locals_size)s)\"\"\"\n            % {\n                \"code_identifier\": code_identifier,\n                \"module_identifier\": getModuleAccessCode(context),\n                \"locals_size\": getFrameLocalsStorageSize(\n                    context.getFrameVariableTypeDescriptions()\n                ),\n                \"locals_dict_name\": (\n                    frame_node.getLocalsScope().getCodeName()\n                    if use_locals_dict\n                    else \"NULL\"\n                ),\n            }\n        )\n\n        if use_locals_dict:\n            # TODO: Have a function that clears an optional existing reference and assigns a new\n            # value taking a reference.\n            frame_init_code = \"\"\"\\\nassert(%(frame_identifier)s->m_frame.f_locals == NULL);\n%(frame_identifier)s->m_frame.f_locals = %(locals_dict)s;\nPy_INCREF(%(frame_identifier)s->m_frame.f_locals);\n\"\"\" % {\n                \"frame_identifier\": frame_identifier,\n                \"locals_dict\": frame_node.getLocalsScope().getCodeName(),\n            }\n            frame_exit_code = \"\"\"\nPy_CLEAR(%(frame_identifier)s->m_frame.f_locals);\n\"\"\" % {\n                \"frame_identifier\": frame_identifier,\n            }\n    elif frame_node.isStatementsFrameFunction():\n        attach_locals_code = getFrameAttachLocalsCode(context, frame_identifier)\n\n        make_frame_code = (\n            \"\"\"MAKE_FUNCTION_FRAME(tstate, %(code_identifier)s, %(module_identifier)s, %(locals_size)s)\"\"\"\n            % {\n                \"code_identifier\": code_identifier,\n                \"module_identifier\": getModuleAccessCode(context),\n                \"locals_size\": getFrameLocalsStorageSize(\n                    context.getFrameVariableTypeDescriptions()\n                ),\n            }\n        )\n    elif frame_node.isStatementsFrameModule():\n        attach_locals_code = \"\"\n        make_frame_code = (\n            \"\"\"MAKE_MODULE_FRAME(%(code_identifier)s, %(module_identifier)s)\"\"\"\n            % {\n                \"code_identifier\": code_identifier,\n                \"module_identifier\": getModuleAccessCode(context),\n            }\n        )\n    else:\n        assert False, frame_node\n\n    context_identifier = frame_node.getStructureMember()\n\n    emit(\n        renderTemplateFromString(\n            template_frame_guard_normal_main_block,\n            frame_identifier=frame_identifier,\n            frame_cache_identifier=frame_cache_identifier,\n            codes=indented(codes, 0),\n            no_exception_exit=no_exception_exit,\n            needs_preserve=needs_preserve,\n            make_frame_code=make_frame_code,\n            frame_init_code=frame_init_code,\n            frame_exit_code=frame_exit_code,\n            context_identifier=context_identifier,\n            is_python34_or_later=python_version >= 0x340,\n            is_python3=python_version >= 0x300,\n        )\n    )\n\n    if frame_return_exit is not None:\n        emit(\n            renderTemplateFromString(\n                template_frame_guard_normal_return_handler,\n                frame_identifier=frame_identifier,\n                return_exit=parent_return_exit,\n                frame_return_exit=frame_return_exit,\n                needs_preserve=needs_preserve,\n                frame_exit_code=frame_exit_code,\n            )\n        )\n\n    if frame_exception_exit is not None:\n        (\n            _exception_type,\n            _exception_value,\n            exception_tb,\n            exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        emit(\n            renderTemplateFromString(\n                template_frame_guard_normal_exception_handler,\n                frame_identifier=context.getFrameHandle(),\n                frame_cache_identifier=frame_cache_identifier,\n                tb_making_code=getTracebackMakingIdentifier(\n                    context=context, lineno_name=exception_lineno\n                ),\n                attach_locals_code=attach_locals_code,\n                parent_exception_exit=parent_exception_exit,\n                frame_exception_exit=frame_exception_exit,\n                frame_exit_code=frame_exit_code,\n                needs_preserve=needs_preserve,\n                exception_tb=exception_tb,\n                exception_lineno=exception_lineno,\n            )\n        )\n\n    getLabelCode(no_exception_exit, emit)\n\n\ndef getFrameGuardGeneratorCode(\n    frame_node,\n    code_identifier,\n    codes,\n    parent_exception_exit,\n    parent_return_exit,\n    frame_exception_exit,\n    frame_return_exit,\n    emit,\n    context,\n):\n    # We really need this many parameters here and it gets very\n    # detail rich, pylint: disable=too-many-locals\n    (\n        exception_type,\n        _exception_value,\n        exception_tb,\n        exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    context_identifier = frame_node.getStructureMember()\n\n    no_exception_exit = context.allocateLabel(\"frame_no_exception\")\n\n    frame_identifier = context.getFrameHandle()\n    frame_cache_identifier = context.variable_storage.addFrameCacheDeclaration(\n        frame_identifier.code_name\n    )\n\n    make_frame_code = (\n        \"\"\"MAKE_FUNCTION_FRAME(tstate, %(code_identifier)s, %(module_identifier)s, %(locals_size)s)\"\"\"\n        % {\n            \"code_identifier\": code_identifier,\n            \"module_identifier\": getModuleAccessCode(context),\n            \"locals_size\": getFrameLocalsStorageSize(\n                context.getFrameVariableTypeDescriptions()\n            ),\n        }\n    )\n    is_generator = True\n\n    frame_init_code = \"\"\n    frame_exit_code = \"\"\n\n    emit(\n        renderTemplateFromString(\n            template_frame_guard_normal_main_block,\n            frame_identifier=frame_identifier,\n            frame_cache_identifier=frame_cache_identifier,\n            context_identifier=context_identifier,\n            codes=indented(codes, 0),\n            no_exception_exit=no_exception_exit,\n            needs_preserve=False,  # TODO: Clears stuff\n            make_frame_code=make_frame_code,\n            frame_init_code=frame_init_code,\n            frame_exit_code=frame_exit_code,\n            is_generator=is_generator,\n            is_python34_or_later=python_version >= 0x340,\n            is_python3=python_version >= 0x300,\n        )\n    )\n\n    if frame_return_exit is not None:\n        emit(\n            template_frame_guard_generator_return_handler\n            % {\n                \"context_identifier\": context_identifier,\n                \"return_exit\": parent_return_exit,\n                \"frame_return_exit\": frame_return_exit,\n            }\n        )\n\n    if frame_exception_exit is not None:\n        emit(\n            template_frame_guard_generator_exception_handler\n            % {\n                \"context_identifier\": context_identifier,\n                \"frame_identifier\": frame_identifier,\n                \"frame_cache_identifier\": frame_cache_identifier,\n                \"exception_type\": exception_type,\n                \"exception_tb\": exception_tb,\n                \"exception_lineno\": exception_lineno,\n                \"tb_making\": getTracebackMakingIdentifier(\n                    context=context, lineno_name=exception_lineno\n                ),\n                \"attach_locals\": indented(\n                    getFrameAttachLocalsCode(context, frame_identifier)\n                ),\n                \"frame_exception_exit\": frame_exception_exit,\n                \"parent_exception_exit\": parent_exception_exit,\n            }\n        )\n\n    getLabelCode(no_exception_exit, emit)\n\n\ndef generateFramePreserveExceptionCode(statement, emit, context):\n    if python_version < 0x300:\n        emit(\"// Preserve existing published exception.\")\n\n        emit(\n            \"PRESERVE_FRAME_EXCEPTION(tstate, %(frame_identifier)s);\"\n            % {\"frame_identifier\": context.getFrameHandle()}\n        )\n    else:\n        preserver_id = statement.getPreserverId()\n\n        assert preserver_id != 0, statement\n        exception_preserved = context.addExceptionPreserverVariables(preserver_id)\n\n        emit(\n            \"\"\"\\\n// Preserve existing published exception id %(preserver_id)d.\n%(exception_preserved)s = GET_CURRENT_EXCEPTION(tstate);\n\"\"\"\n            % {\n                \"exception_preserved\": exception_preserved,\n                \"preserver_id\": preserver_id,\n            }\n        )\n\n\ndef generateFrameRestoreExceptionCode(statement, emit, context):\n    if python_version < 0x300:\n        emit(\n            \"\"\"\\\n// Restore previous exception.\nRESTORE_FRAME_EXCEPTION(%(frame_identifier)s);\"\"\"\n            % {\"frame_identifier\": context.getFrameHandle()}\n        )\n    else:\n        preserver_id = statement.getPreserverId()\n\n        exception_preserved = context.addExceptionPreserverVariables(preserver_id)\n\n        emit(\n            \"\"\"\\\n// Restore previous exception id %(preserver_id)d.\nSET_CURRENT_EXCEPTION(tstate, &%(exception_preserved)s);\n\"\"\"\n            % {\n                \"exception_preserved\": exception_preserved,\n                \"preserver_id\": preserver_id,\n            }\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/FunctionCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with compiled function objects.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import general\n\nfrom .c_types.CTypePyObjectPointers import CTypeCellObject, CTypePyObjectPtrPtr\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateExpressionCode,\n    generateStatementSequenceCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .Contexts import PythonFunctionOutlineContext\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import getErrorExitCode, getMustNotGetHereCode, getReleaseCode\nfrom .Indentation import indented\nfrom .LabelCodes import getGotoCode, getLabelCode\nfrom .LineNumberCodes import emitErrorLineNumberUpdateCode\nfrom .ModuleCodes import getModuleAccessCode\nfrom .PythonAPICodes import generateCAPIObjectCode, getReferenceExportCode\nfrom .templates.CodeTemplatesFunction import (\n    function_direct_body_template,\n    template_function_body,\n    template_function_direct_declaration,\n    template_function_exception_exit,\n    template_function_make_declaration,\n    template_function_return_exit,\n    template_make_function,\n    template_maker_function_body,\n)\nfrom .TupleCodes import getTupleCreationCode\nfrom .VariableCodes import (\n    decideLocalVariableCodeType,\n    getLocalVariableDeclaration,\n)\n\n\ndef getFunctionCreationArgs(\n    defaults_name, kw_defaults_name, annotations_name, closure_variables, tstate\n):\n    result = []\n\n    if tstate:\n        result.append(\"PyThreadState *tstate\")\n\n    if defaults_name is not None:\n        result.append(\"PyObject *defaults\")\n\n    if kw_defaults_name is not None:\n        result.append(\"PyObject *kw_defaults\")\n\n    if annotations_name is not None:\n        result.append(\"PyObject *annotations\")\n\n    if closure_variables:\n        result.append(\"struct Nuitka_CellObject **closure\")\n\n    return result\n\n\ndef getFunctionMakerDecl(\n    function_identifier,\n    closure_variables,\n    defaults_name,\n    kw_defaults_name,\n    annotations_name,\n):\n    function_creation_args = getFunctionCreationArgs(\n        defaults_name=defaults_name,\n        kw_defaults_name=kw_defaults_name,\n        annotations_name=annotations_name,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    return template_function_make_declaration % {\n        \"function_identifier\": function_identifier,\n        \"function_creation_args\": \", \".join(function_creation_args),\n    }\n\n\ndef _getFunctionEntryPointIdentifier(function_identifier):\n    return \"impl_\" + function_identifier\n\n\ndef _getFunctionMakerIdentifier(function_identifier):\n    return \"MAKE_FUNCTION_\" + function_identifier\n\n\ndef getFunctionQualnameObj(owner, context):\n    \"\"\"Get code to pass to function alike object creation for qualname.\n\n    Qualname for functions existed for Python3, generators only after\n    3.5 and coroutines and asyncgen for as long as they existed.\n\n    If identical to the name, we do not pass it as a value, but\n    NULL instead.\n    \"\"\"\n\n    if owner.isExpressionFunctionBody():\n        min_version = 0x300\n    else:\n        min_version = 0x350\n\n    if python_version < min_version:\n        return \"NULL\"\n\n    function_qualname = owner.getFunctionQualname()\n\n    if function_qualname == owner.getFunctionName():\n        return \"NULL\"\n    else:\n        return context.getConstantCode(constant=function_qualname)\n\n\ndef getFunctionMakerCode(\n    function_body,\n    function_identifier,\n    closure_variables,\n    defaults_name,\n    kw_defaults_name,\n    annotations_name,\n    function_doc,\n    context,\n):\n    # We really need this many parameters here and functions have many details,\n    # that we express as variables, pylint: disable=too-many-locals\n    function_creation_args = getFunctionCreationArgs(\n        defaults_name=defaults_name,\n        kw_defaults_name=kw_defaults_name,\n        annotations_name=annotations_name,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    if function_doc is None:\n        function_doc = \"NULL\"\n    else:\n        function_doc = context.getConstantCode(constant=function_doc)\n\n    (\n        is_constant_returning,\n        constant_return_value,\n    ) = function_body.getConstantReturnValue()\n\n    if is_constant_returning:\n        function_impl_identifier = \"NULL\"\n\n        if constant_return_value is None:\n            # Default value, spare the code for common case.\n            constant_return_code = \"\"\n        elif constant_return_value is True:\n            constant_return_code = \"Nuitka_Function_EnableConstReturnTrue(result);\"\n        elif constant_return_value is False:\n            constant_return_code = \"Nuitka_Function_EnableConstReturnFalse(result);\"\n        else:\n            constant_return_code = (\n                \"Nuitka_Function_EnableConstReturnGeneric(result, %s);\"\n                % context.getConstantCode(constant_return_value)\n            )\n    else:\n        function_impl_identifier = _getFunctionEntryPointIdentifier(\n            function_identifier=function_identifier\n        )\n        constant_return_code = \"\"\n\n    function_maker_identifier = _getFunctionMakerIdentifier(\n        function_identifier=function_identifier\n    )\n\n    code_identifier = context.getCodeObjectHandle(\n        code_object=function_body.getCodeObject()\n    )\n\n    module_identifier = getModuleAccessCode(context=context)\n\n    result = template_maker_function_body % {\n        \"function_name_obj\": context.getConstantCode(\n            constant=function_body.getFunctionName()\n        ),\n        \"function_qualname_obj\": getFunctionQualnameObj(function_body, context),\n        \"function_maker_identifier\": function_maker_identifier,\n        \"function_impl_identifier\": function_impl_identifier,\n        \"function_creation_args\": \", \".join(function_creation_args),\n        \"code_identifier\": code_identifier,\n        \"function_doc\": function_doc,\n        \"defaults\": \"defaults\" if defaults_name else \"NULL\",\n        \"kw_defaults\": \"kw_defaults\" if kw_defaults_name else \"NULL\",\n        \"annotations\": \"annotations\" if annotations_name else \"NULL\",\n        \"closure_count\": len(closure_variables),\n        \"closure_name\": \"closure\" if closure_variables else \"NULL\",\n        \"module_identifier\": module_identifier,\n        \"constant_return_code\": indented(constant_return_code),\n    }\n\n    # TODO: Make it optional, only dill plugin really uses that table to\n    # transport the C code implementation pointers.\n    if function_impl_identifier != \"NULL\":\n        context.addFunctionCreationInfo(function_impl_identifier)\n\n    return result\n\n\ndef generateFunctionCreationCode(to_name, expression, emit, context):\n    # This is about creating functions, which is detail ridden stuff,\n    # pylint: disable=too-many-locals\n\n    function_body = expression.subnode_function_ref.getFunctionBody()\n    defaults = expression.subnode_defaults\n    kw_defaults = expression.subnode_kw_defaults\n    annotations = expression.subnode_annotations\n    defaults_first = not expression.kw_defaults_before_defaults\n\n    assert function_body.needsCreation(), function_body\n\n    def handleKwDefaults():\n        if kw_defaults:\n            kw_defaults_name = context.allocateTempName(\"kw_defaults\")\n\n            assert not kw_defaults.isExpressionConstantDictEmptyRef(), kw_defaults\n\n            generateExpressionCode(\n                to_name=kw_defaults_name,\n                expression=kw_defaults,\n                emit=emit,\n                context=context,\n            )\n        else:\n            kw_defaults_name = None\n\n        return kw_defaults_name\n\n    def handleDefaults():\n        if defaults:\n            defaults_name = context.allocateTempName(\"defaults\")\n\n            getTupleCreationCode(\n                to_name=defaults_name, elements=defaults, emit=emit, context=context\n            )\n        else:\n            defaults_name = None\n\n        return defaults_name\n\n    if defaults_first:\n        defaults_name = handleDefaults()\n        kw_defaults_name = handleKwDefaults()\n    else:\n        kw_defaults_name = handleKwDefaults()\n        defaults_name = handleDefaults()\n\n    if annotations:\n        annotations_name = context.allocateTempName(\"annotations\")\n\n        generateExpressionCode(\n            to_name=annotations_name, expression=annotations, emit=emit, context=context\n        )\n    else:\n        annotations_name = None\n\n    function_identifier = function_body.getCodeName()\n\n    # Creation code needs to be done only once.\n    if not context.hasHelperCode(function_identifier):\n        closure_variables = function_body.getClosureVariables()\n\n        maker_code = getFunctionMakerCode(\n            function_body=function_body,\n            function_identifier=function_identifier,\n            closure_variables=closure_variables,\n            defaults_name=defaults_name,\n            kw_defaults_name=kw_defaults_name,\n            annotations_name=annotations_name,\n            function_doc=function_body.getDoc(),\n            context=context,\n        )\n\n        context.addHelperCode(function_identifier, maker_code)\n\n        function_decl = getFunctionMakerDecl(\n            function_identifier=function_body.getCodeName(),\n            closure_variables=closure_variables,\n            defaults_name=defaults_name,\n            kw_defaults_name=kw_defaults_name,\n            annotations_name=annotations_name,\n        )\n\n        context.addDeclaration(function_identifier, function_decl)\n\n    getFunctionCreationCode(\n        to_name=to_name,\n        function_identifier=function_body.getCodeName(),\n        defaults_name=defaults_name,\n        kw_defaults_name=kw_defaults_name,\n        annotations_name=annotations_name,\n        closure_variables=expression.getClosureVariableVersions(),\n        emit=emit,\n        context=context,\n    )\n\n    getReleaseCode(release_name=annotations_name, emit=emit, context=context)\n\n\ndef getClosureCopyCode(closure_variables, context):\n    \"\"\"Get code to copy closure variables storage.\n\n    This gets used by generator/coroutine/asyncgen with varying \"closure_type\".\n    \"\"\"\n    if closure_variables:\n        closure_name = context.allocateTempName(\n            \"closure\", \"struct Nuitka_CellObject *[%d]\" % len(closure_variables)\n        )\n    else:\n        closure_name = None\n\n    closure_copy = []\n\n    for count, (variable, variable_trace) in enumerate(closure_variables):\n        variable_declaration = getLocalVariableDeclaration(\n            context, variable, variable_trace\n        )\n\n        target_cell_code = \"%s[%d]\" % (closure_name, count)\n\n        variable_c_type = variable_declaration.getCType()\n\n        variable_c_type.getCellObjectAssignmentCode(\n            target_cell_code=target_cell_code,\n            variable_code_name=variable_declaration,\n            emit=closure_copy.append,\n        )\n\n    return closure_name, closure_copy\n\n\ndef getFunctionCreationCode(\n    to_name,\n    function_identifier,\n    defaults_name,\n    kw_defaults_name,\n    annotations_name,\n    closure_variables,\n    emit,\n    context,\n):\n    args = []\n\n    if defaults_name is not None:\n        getReferenceExportCode(defaults_name, emit, context)\n        args.append(defaults_name)\n\n    if kw_defaults_name is not None:\n        args.append(kw_defaults_name)\n\n    if annotations_name is not None:\n        args.append(annotations_name)\n\n    closure_name, closure_copy = getClosureCopyCode(\n        closure_variables=closure_variables, context=context\n    )\n\n    if closure_name:\n        args.append(closure_name)\n\n    function_maker_identifier = _getFunctionMakerIdentifier(\n        function_identifier=function_identifier\n    )\n\n    emit(\n        template_make_function\n        % {\n            \"to_name\": to_name,\n            \"function_maker_identifier\": function_maker_identifier,\n            \"args\": \", \".join(str(arg) for arg in args),\n            \"closure_copy\": indented(closure_copy, 0, True),\n        }\n    )\n\n    if context.needsCleanup(defaults_name):\n        context.removeCleanupTempName(defaults_name)\n    if context.needsCleanup(kw_defaults_name):\n        context.removeCleanupTempName(kw_defaults_name)\n    if context.needsCleanup(annotations_name):\n        context.removeCleanupTempName(annotations_name)\n\n    # No error checks, this supposedly, cannot fail.\n    context.addCleanupTempName(to_name)\n\n\ndef getDirectFunctionCallCode(\n    to_name,\n    function_identifier,\n    arg_names,\n    closure_variables,\n    needs_check,\n    emit,\n    context,\n):\n    function_identifier = _getFunctionEntryPointIdentifier(\n        function_identifier=function_identifier\n    )\n\n    suffix_args = []\n\n    # TODO: Does this still have to be a triple, we are stopping to use\n    # versions later in the game.\n    for closure_variable, variable_trace in closure_variables:\n        variable_declaration = getLocalVariableDeclaration(\n            context=context, variable=closure_variable, variable_trace=variable_trace\n        )\n\n        variable_c_type = variable_declaration.getCType()\n\n        suffix_args.append(\n            variable_c_type.getVariableArgReferencePassingCode(variable_declaration)\n        )\n\n    # TODO: We ought to not assume references for direct calls, or make a\n    # profile if an argument needs a reference at all. Most functions don't\n    # bother to release a called argument by \"del\" or assignment to it. We\n    # could well know that ahead of time.\n    for arg_name in arg_names:\n        if context.needsCleanup(arg_name):\n            context.removeCleanupTempName(arg_name)\n        else:\n            emit(\"Py_INCREF(%s);\" % arg_name)\n\n    if arg_names:\n        emit(\n            \"\"\"\n{\n    PyObject *dir_call_args[] = {%s};\n    %s = %s(tstate, dir_call_args%s%s);\n}\"\"\"\n            % (\n                \", \".join(str(arg_name) for arg_name in arg_names),\n                to_name,\n                function_identifier,\n                \", \" if suffix_args else \"\",\n                \", \".join(str(arg) for arg in suffix_args),\n            )\n        )\n    else:\n        emit(\n            \"%s = %s(tstate, NULL%s%s);\"\n            % (\n                to_name,\n                function_identifier,\n                \", \" if suffix_args else \"\",\n                \", \".join(str(arg) for arg in suffix_args),\n            )\n        )\n\n    # Arguments are owned to the called in direct function call.\n    for arg_name in arg_names:\n        if context.needsCleanup(arg_name):\n            context.removeCleanupTempName(arg_name)\n\n    getErrorExitCode(\n        check_name=to_name, emit=emit, needs_check=needs_check, context=context\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef getFunctionDirectDecl(function_identifier, closure_variables, file_scope, context):\n    parameter_objects_decl = [\"PyObject **python_pars\"]\n\n    for closure_variable in closure_variables:\n        variable_declaration = getLocalVariableDeclaration(\n            context=context,\n            variable=closure_variable,\n            variable_trace=None,  # TODO: See other uses of None\n        )\n\n        variable_c_type = variable_declaration.getCType()\n\n        parameter_objects_decl.append(\n            variable_c_type.getVariableArgDeclarationCode(variable_declaration)\n        )\n\n    result = template_function_direct_declaration % {\n        \"file_scope\": file_scope,\n        \"function_identifier\": function_identifier,\n        \"direct_call_arg_spec\": \", \".join(parameter_objects_decl),\n    }\n\n    return result\n\n\ndef setupFunctionLocalVariables(\n    context, parameters, closure_variables, user_variables, temp_variables\n):\n    # Parameter variable initializations\n    if parameters is not None:\n        for count, variable in enumerate(parameters.getAllVariables()):\n            variable_code_name, variable_c_type = decideLocalVariableCodeType(\n                context=context, variable=variable\n            )\n\n            variable_declaration = context.variable_storage.addVariableDeclarationTop(\n                variable_c_type.c_type,\n                variable_code_name,\n                variable_c_type.getInitValue(\"python_pars[%d]\" % count),\n            )\n\n            context.setVariableType(variable, variable_declaration)\n\n    # User local variable initializations\n    for variable in user_variables:\n        variable_code_name, variable_c_type = decideLocalVariableCodeType(\n            context=context, variable=variable\n        )\n\n        # Delay cell variable initialization for outlines to their own code.\n        if (\n            variable_c_type is CTypeCellObject\n            and variable.owner.isExpressionOutlineFunctionBase()\n        ):\n            init_value = \"NULL\"\n        else:\n            init_value = variable_c_type.getInitValue(None)\n\n        variable_declaration = context.variable_storage.addVariableDeclarationTop(\n            variable_c_type.c_type, variable_code_name, init_value\n        )\n\n        context.setVariableType(variable, variable_declaration)\n\n    for variable in sorted(temp_variables, key=lambda variable: variable.getName()):\n        variable_code_name, variable_c_type = decideLocalVariableCodeType(\n            context=context, variable=variable\n        )\n\n        context.variable_storage.addVariableDeclarationTop(\n            variable_c_type.c_type,\n            variable_code_name,\n            variable_c_type.getInitValue(None),\n        )\n\n    for closure_variable in closure_variables:\n        variable_code_name, variable_c_type = decideLocalVariableCodeType(\n            context=context, variable=closure_variable\n        )\n\n        variable_declaration = context.variable_storage.addVariableDeclarationClosure(\n            variable_c_type.c_type, variable_code_name\n        )\n\n        assert variable_c_type in (\n            CTypeCellObject,\n            CTypePyObjectPtrPtr,\n        ), variable_c_type\n\n        if not closure_variable.isTempVariable():\n            context.setVariableType(closure_variable, variable_declaration)\n\n\ndef finalizeFunctionLocalVariables(context):\n    function_cleanup = []\n\n    # TODO: Many times it will not be necessary to release locals dict, because\n    # they already were, but our tracing doesn't yet allow us to know.\n    for locals_declaration in sorted(context.getLocalsDictNames(), key=str):\n        function_cleanup.append(\n            \"Py_XDECREF(%(locals_dict)s);\\n\" % {\"locals_dict\": locals_declaration}\n        )\n\n    # Automatic variable releases if any.\n    for variable in context.getOwner().getFunctionVariablesWithAutoReleases():\n        variable_declaration = getLocalVariableDeclaration(\n            context=context,\n            variable=variable,\n            variable_trace=None,  # TODO: See other uses of None.\n        )\n        function_cleanup.append(\"CHECK_OBJECT(%s);\" % variable_declaration)\n        function_cleanup.append(\"Py_DECREF(%s);\" % variable_declaration)\n\n    return function_cleanup\n\n\ndef getFunctionCode(\n    context,\n    function_identifier,\n    parameters,\n    closure_variables,\n    user_variables,\n    temp_variables,\n    function_doc,\n    file_scope,\n    needs_exception_exit,\n):\n    try:\n        return _getFunctionCode(\n            context=context,\n            function_identifier=function_identifier,\n            parameters=parameters,\n            closure_variables=closure_variables,\n            user_variables=user_variables,\n            temp_variables=temp_variables,\n            function_doc=function_doc,\n            file_scope=file_scope,\n            needs_exception_exit=needs_exception_exit,\n        )\n    except Exception:\n        general.warning(\"Problem creating function code %r.\" % function_identifier)\n        raise\n\n\ndef _getFunctionCode(\n    context,\n    function_identifier,\n    parameters,\n    closure_variables,\n    user_variables,\n    temp_variables,\n    function_doc,\n    file_scope,\n    needs_exception_exit,\n):\n    # Functions have many details, that we express as variables, with many\n    # branches to decide, pylint: disable=too-many-locals\n\n    setupFunctionLocalVariables(\n        context=context,\n        parameters=parameters,\n        closure_variables=closure_variables,\n        user_variables=user_variables,\n        temp_variables=temp_variables,\n    )\n\n    function_codes = SourceCodeCollector()\n\n    generateStatementSequenceCode(\n        statement_sequence=context.getOwner().subnode_body,\n        allow_none=True,\n        emit=function_codes,\n        context=context,\n    )\n\n    function_cleanup = finalizeFunctionLocalVariables(context=context)\n\n    function_locals = context.variable_storage.makeCFunctionLevelDeclarations()\n\n    function_doc = context.getConstantCode(constant=function_doc)\n\n    result = \"\"\n\n    emit = SourceCodeCollector()\n\n    getMustNotGetHereCode(\n        reason=\"Return statement must have exited already.\", emit=emit\n    )\n\n    function_exit = indented(emit.codes) + \"\\n\\n\"\n    del emit\n\n    if needs_exception_exit:\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            _exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        function_exit += template_function_exception_exit % {\n            \"function_cleanup\": indented(function_cleanup),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n\n    if context.hasTempName(\"return_value\"):\n        function_exit += template_function_return_exit % {\n            \"function_cleanup\": indented(function_cleanup)\n        }\n\n    if context.isForCreatedFunction():\n        parameter_objects_decl = [\"struct Nuitka_FunctionObject const *self\"]\n    else:\n        parameter_objects_decl = []\n\n    parameter_objects_decl.append(\"PyObject **python_pars\")\n\n    if context.isForDirectCall():\n        for closure_variable in closure_variables:\n            variable_declaration = getLocalVariableDeclaration(\n                context=context,\n                variable=closure_variable,\n                variable_trace=None,  # TODO: See other uses of None.\n            )\n\n            variable_c_type = variable_declaration.getCType()\n\n            parameter_objects_decl.append(\n                variable_c_type.getVariableArgDeclarationCode(variable_declaration)\n            )\n\n        result += function_direct_body_template % {\n            \"file_scope\": file_scope,\n            \"function_identifier\": function_identifier,\n            \"direct_call_arg_spec\": \", \".join(parameter_objects_decl),\n            \"function_locals\": indented(function_locals),\n            \"function_body\": indented(function_codes.codes),\n            \"function_exit\": function_exit,\n        }\n    else:\n        result += template_function_body % {\n            \"function_identifier\": function_identifier,\n            \"parameter_objects_decl\": \", \".join(parameter_objects_decl),\n            \"function_locals\": indented(function_locals),\n            \"function_body\": indented(function_codes.codes),\n            \"function_exit\": function_exit,\n        }\n\n    return result\n\n\ndef getExportScopeCode(cross_module):\n    if cross_module:\n        return \"NUITKA_CROSS_MODULE\"\n    else:\n        return \"NUITKA_LOCAL_MODULE\"\n\n\ndef generateFunctionCallCode(to_name, expression, emit, context):\n    assert expression.subnode_function.isExpressionFunctionCreation()\n\n    function_body = expression.subnode_function.subnode_function_ref.getFunctionBody()\n    function_identifier = function_body.getCodeName()\n\n    argument_values = expression.subnode_values\n\n    arg_names = []\n    for count, arg_value in enumerate(argument_values, 1):\n        arg_name = context.allocateTempName(\"dircall_arg%d\" % count)\n\n        generateExpressionCode(\n            to_name=arg_name, expression=arg_value, emit=emit, context=context\n        )\n\n        arg_names.append(arg_name)\n\n    context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"call_result\", expression, emit, context\n    ) as value_name:\n        getDirectFunctionCallCode(\n            to_name=value_name,\n            function_identifier=function_identifier,\n            arg_names=arg_names,\n            closure_variables=expression.getClosureVariableVersions(),\n            needs_check=expression.subnode_function.subnode_function_ref.getFunctionBody().mayRaiseException(\n                BaseException\n            ),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateFunctionOutlineCode(to_name, expression, emit, context):\n    assert (\n        expression.isExpressionOutlineBody()\n        or expression.isExpressionOutlineFunctionBase()\n    )\n\n    if expression.isExpressionOutlineFunctionBase():\n        context = PythonFunctionOutlineContext(parent=context, outline=expression)\n\n        for variable in expression.getUserLocalVariables():\n            variable_declaration = getLocalVariableDeclaration(\n                context=context, variable=variable, variable_trace=None\n            )\n\n            if variable_declaration.getCType() is CTypeCellObject:\n                emit(\"%s = Nuitka_Cell_NewEmpty();\" % variable_declaration)\n\n    # Need to set return target, to assign to_name from.\n\n    return_target = context.allocateLabel(\"outline_result\")\n    old_return_target = context.setReturnTarget(return_target)\n    old_return_release_mode = context.setReturnReleaseMode(False)\n\n    # TODO: Put the return value name as that to_name.c_type too.\n\n    if (\n        expression.isExpressionOutlineFunctionBase()\n        and expression.subnode_body.mayRaiseException(BaseException)\n    ):\n        exception_target = context.allocateLabel(\"outline_exception\")\n        old_exception_target = context.setExceptionEscape(exception_target)\n    else:\n        exception_target = None\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"outline_return_value\", expression, emit, context\n    ) as return_value_name:\n        old_return_value_name = context.setReturnValueName(return_value_name)\n\n        generateStatementSequenceCode(\n            statement_sequence=expression.subnode_body,\n            emit=emit,\n            context=context,\n            allow_none=False,\n        )\n\n        context.addCleanupTempName(return_value_name)\n\n        getMustNotGetHereCode(\n            reason=\"Return statement must have exited already.\", emit=emit\n        )\n\n        if exception_target is not None:\n            getLabelCode(exception_target, emit)\n\n            context.setCurrentSourceCodeReference(expression.getSourceReference())\n\n            emitErrorLineNumberUpdateCode(emit, context)\n            getGotoCode(old_exception_target, emit)\n\n            context.setExceptionEscape(old_exception_target)\n\n        # TODO: An outline that cannot return, could be converted probably into\n        # something else, maybe mere side effects.\n        if expression.subnode_body.mayReturn():\n            getLabelCode(return_target, emit)\n\n    # Restore previous \"return\" handling.\n    context.setReturnTarget(old_return_target)\n    context.setReturnReleaseMode(old_return_release_mode)\n    context.setReturnValueName(old_return_value_name)\n\n\ndef generateFunctionErrorStrCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        # TODO: Should be inline this for\n        capi=\"_PyObject_FunctionStr\",\n        tstate=False,\n        arg_desc=((\"func_arg\", expression.subnode_value),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/GeneratorCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with compiled function objects.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import generateStatementSequenceCode\nfrom .Emission import SourceCodeCollector\nfrom .FunctionCodes import (\n    finalizeFunctionLocalVariables,\n    getClosureCopyCode,\n    getFunctionCreationArgs,\n    getFunctionQualnameObj,\n    setupFunctionLocalVariables,\n)\nfrom .Indentation import indented\nfrom .ModuleCodes import getModuleAccessCode\nfrom .templates.CodeTemplatesGeneratorFunction import (\n    template_generator_exception_exit,\n    template_generator_noexception_exit,\n    template_generator_return_exit,\n    template_genfunc_yielder_body_template,\n    template_genfunc_yielder_maker_decl,\n    template_make_empty_generator,\n    template_make_generator,\n)\nfrom .YieldCodes import getYieldReturnDispatchCode\n\n\ndef _getGeneratorMakerIdentifier(function_identifier):\n    return \"MAKE_GENERATOR_\" + function_identifier\n\n\ndef getGeneratorObjectDeclCode(function_identifier, closure_variables):\n    generator_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    return template_genfunc_yielder_maker_decl % {\n        \"generator_maker_identifier\": _getGeneratorMakerIdentifier(function_identifier),\n        \"generator_creation_args\": \", \".join(generator_creation_args),\n    }\n\n\ndef getGeneratorObjectCode(\n    context,\n    function_identifier,\n    closure_variables,\n    user_variables,\n    outline_variables,\n    temp_variables,\n    needs_exception_exit,\n    needs_generator_return,\n):\n    # A bit of details going on here, pylint: disable=too-many-locals\n\n    setupFunctionLocalVariables(\n        context=context,\n        parameters=None,\n        closure_variables=closure_variables,\n        user_variables=user_variables + outline_variables,\n        temp_variables=temp_variables,\n    )\n\n    function_codes = SourceCodeCollector()\n\n    generateStatementSequenceCode(\n        statement_sequence=context.getOwner().subnode_body,\n        allow_none=True,\n        emit=function_codes,\n        context=context,\n    )\n\n    function_cleanup = finalizeFunctionLocalVariables(context)\n\n    if needs_exception_exit:\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            _exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        generator_exit = template_generator_exception_exit % {\n            \"function_cleanup\": indented(function_cleanup),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n    else:\n        generator_exit = template_generator_noexception_exit % {\n            \"function_cleanup\": indented(function_cleanup)\n        }\n\n    if needs_generator_return:\n        generator_exit += template_generator_return_exit % {\n            \"return_value\": (\n                context.getReturnValueName() if python_version >= 0x300 else None\n            ),\n            \"function_cleanup\": indented(function_cleanup),\n        }\n\n    function_locals = context.variable_storage.makeCFunctionLevelDeclarations()\n\n    local_type_decl = context.variable_storage.makeCStructLevelDeclarations()\n    function_locals += context.variable_storage.makeCStructInits()\n\n    generator_object_body = context.getOwner()\n\n    if local_type_decl:\n        heap_declaration = \"\"\"\\\nstruct %(function_identifier)s_locals *generator_heap = \\\n(struct %(function_identifier)s_locals *)generator->m_heap_storage;\"\"\" % {\n            \"function_identifier\": function_identifier\n        }\n    else:\n        heap_declaration = \"\"\n\n    generator_creation_args = getFunctionCreationArgs(\n        defaults_name=None,\n        kw_defaults_name=None,\n        annotations_name=None,\n        closure_variables=closure_variables,\n        tstate=False,\n    )\n\n    return template_genfunc_yielder_body_template % {\n        \"function_identifier\": function_identifier,\n        \"function_body\": indented(function_codes.codes),\n        \"heap_declaration\": indented(heap_declaration),\n        \"has_heap_declaration\": 1 if heap_declaration != \"\" else 0,\n        \"function_local_types\": indented(local_type_decl),\n        \"function_var_inits\": indented(function_locals),\n        \"function_dispatch\": indented(getYieldReturnDispatchCode(context)),\n        \"generator_maker_identifier\": _getGeneratorMakerIdentifier(function_identifier),\n        \"generator_creation_args\": \", \".join(generator_creation_args),\n        \"generator_exit\": generator_exit,\n        \"generator_module\": getModuleAccessCode(context),\n        \"generator_name_obj\": context.getConstantCode(\n            constant=generator_object_body.getFunctionName()\n        ),\n        \"generator_qualname_obj\": getFunctionQualnameObj(\n            generator_object_body, context\n        ),\n        \"code_identifier\": context.getCodeObjectHandle(\n            code_object=generator_object_body.getCodeObject()\n        ),\n        \"closure_name\": \"closure\" if closure_variables else \"NULL\",\n        \"closure_count\": len(closure_variables),\n    }\n\n\ndef generateMakeGeneratorObjectCode(to_name, expression, emit, context):\n    generator_object_body = expression.subnode_generator_ref.getFunctionBody()\n\n    closure_variables = expression.getClosureVariableVersions()\n\n    closure_name, closure_copy = getClosureCopyCode(\n        closure_variables=closure_variables, context=context\n    )\n\n    args = []\n    if closure_name:\n        args.append(closure_name)\n\n    # Special case empty generators.\n    if generator_object_body.subnode_body is None:\n        emit(\n            template_make_empty_generator\n            % {\n                \"closure_copy\": indented(closure_copy, 0, True),\n                \"to_name\": to_name,\n                \"generator_module\": getModuleAccessCode(context),\n                \"generator_name_obj\": context.getConstantCode(\n                    constant=generator_object_body.getFunctionName()\n                ),\n                \"generator_qualname_obj\": getFunctionQualnameObj(\n                    generator_object_body, context\n                ),\n                \"code_identifier\": context.getCodeObjectHandle(\n                    code_object=generator_object_body.getCodeObject()\n                ),\n                \"closure_name\": closure_name if closure_name is not None else \"NULL\",\n                \"closure_count\": len(closure_variables),\n            }\n        )\n    else:\n        emit(\n            template_make_generator\n            % {\n                \"generator_maker_identifier\": _getGeneratorMakerIdentifier(\n                    generator_object_body.getCodeName()\n                ),\n                \"to_name\": to_name,\n                \"args\": \", \".join(str(arg) for arg in args),\n                \"closure_copy\": indented(closure_copy, 0, True),\n            }\n        )\n\n    context.addCleanupTempName(to_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/GlobalConstants.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Global constant values.\n\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.__past__ import long\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Utils import isWin32Windows\n\n# spell-checker: ignore fromlist\n\n\ndef getConstantDefaultPopulation():\n    \"\"\"These are values for non-trivial constants.\n\n    Constants that have a direct name, e.g. Py_True are trivial, these are for things that must\n    be constructed through code.\n    \"\"\"\n\n    # Lots of cases, pylint: disable=too-many-branches,too-many-statements\n\n    # Note: Can't work with set here, because we need to put in some values that\n    # cannot be hashed.\n\n    result = [\n        # Basic values that the helper code uses all the times.\n        (),\n        {},\n        0,\n        1,\n        -1,\n        # Some math operations shortcut to these\n        0.0,\n        -0.0,\n        1.0,\n        -1.0,\n        long(0),\n        \"\",\n        # For Python3 empty bytes, no effect for Python2, same as \"\", used for\n        # code objects.\n        b\"\",\n        # Python mechanics, used in various helpers.\n        \"__module__\",\n        \"__class__\",\n        \"__name__\",\n        \"__package__\",\n        \"__metaclass__\",\n        \"__abstractmethods__\",\n        \"__closure__\",\n        # TODO: For PyObject_IsSubClass one day\n        # \"__subclasscheck__\",\n        \"__dict__\",\n        \"__doc__\",\n        \"__file__\",\n        \"__path__\",\n        \"__enter__\",\n        \"__exit__\",\n        \"__builtins__\",\n        \"__all__\",\n        \"__init__\",\n        \"__cmp__\",\n        \"__iter__\",\n        \"__loader__\",\n        # Nuitka specific\n        \"__compiled__\",\n        \"__nuitka__\",\n        # Patched module name.\n        \"inspect\",\n        # Names of built-ins used in helper code.\n        \"compile\",\n        \"range\",\n        \"open\",\n        \"super\",\n        \"sum\",\n        \"format\",\n        \"__import__\",\n        \"bytearray\",\n        \"staticmethod\",\n        \"classmethod\",\n        \"keys\",\n        # Arguments of __import__ built-in used in helper code.\n        \"name\",\n        \"globals\",\n        \"locals\",\n        \"fromlist\",\n        \"level\",\n        # Meta path based loader.\n        \"read\",\n        \"rb\",\n        # File handling\n        \"/\",\n        \"\\\\\",\n        \"path\",\n        \"basename\",\n        \"dirname\",\n        \"abspath\",\n        \"isabs\",\n        \"exists\",\n        \"isdir\",\n        \"isfile\",\n        \"listdir\",\n    ]\n\n    # Pickling of instance methods.\n    if python_version < 0x340:\n        result += (\"__newobj__\",)\n    else:\n        result += (\"getattr\",)\n\n    if python_version >= 0x300:\n        # For Python3 modules\n        result += (\"__cached__\",)\n\n        # For Python3 print\n        result += (\"print\", \"end\", \"file\")\n\n        # For Python3 \"bytes\" built-in.\n        result.append(\"bytes\")\n\n    # For meta path based loader, iter_modules and Python3 \"__name__\" to\n    # \"__package__\" parsing\n    result.append(\".\")\n\n    # For star imports checking private symbols\n    result.append(\"_\")\n    if python_version < 0x300:\n        result.append(\"_\")\n\n    if python_version >= 0x300:\n        # Modules have that attribute starting with Python3\n        result.append(\"__loader__\")\n\n    if python_version >= 0x340:\n        result.append(\n            # YIELD_FROM uses this starting 3.4, with 3.3 other code is used.\n            \"send\"\n        )\n\n    if python_version >= 0x300:\n        result += (\n            # YIELD_FROM uses this\n            \"throw\",\n            \"close\",\n        )\n\n    if python_version < 0x300:\n        # For patching Python2 internal class type\n        result += (\"__getattr__\", \"__setattr__\", \"__delattr__\")\n\n        # For setting Python2 \"sys\" attributes for current exception\n        result += (\"exc_type\", \"exc_value\", \"exc_traceback\")\n\n        # Abstract base classes need to call the method\n        result.append(\"join\")\n\n    # The xrange built-in is Python2 only.\n    if python_version < 0x300:\n        result.append(\"xrange\")\n\n    # Executables only\n    if not Options.shallMakeModule():\n        # The \"site\" module is referenced in inspect patching.\n        result.append(\"site\")\n\n    # Built-in original values\n    if not Options.shallMakeModule():\n        result += (\"type\", \"len\", \"range\", \"repr\", \"int\", \"iter\")\n\n        if python_version < 0x300:\n            result.append(\"long\")\n\n    if python_version >= 0x340:\n        # Work with the __spec__ module attribute.\n        result += (\"__spec__\", \"_initializing\", \"parent\")\n\n    if python_version >= 0x350:\n        # Patching the types module.\n        result.append(\"types\")\n\n    if not Options.shallMakeModule():\n        result.append(\"__main__\")\n\n    # Resource reader files interface, including for backport\n    if python_version >= 0x390:\n        result.append(\"as_file\")\n        result.append(\"register\")\n\n    if python_version >= 0x370:\n        # New class method\n        result.append(\"__class_getitem__\")\n\n    if python_version >= 0x370:\n        # Reconfiguring stdout\n        result.append(\"reconfigure\")\n        result.append(\"encoding\")\n        result.append(\"line_buffering\")\n\n    if python_version >= 0x3A0:\n        result.append(\"__match_args__\")\n\n        if Options.is_debug:\n            result.append(\"__args__\")\n\n    if python_version >= 0x3B0:\n        result.append(\"__aenter__\")\n        result.append(\"__aexit__\")\n\n    if isWin32Windows():\n        result.append(\"fileno\")\n\n    for value in Plugins.getExtraConstantDefaultPopulation():\n        if value not in result:\n            result.append(value)\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/GlobalsLocalsCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for locals and globals handling.\n\nThis also includes writing back to locals for exec statements.\n\"\"\"\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import getErrorExitBoolCode\nfrom .Indentation import indented\nfrom .PythonAPICodes import generateCAPIObjectCode\nfrom .templates.CodeTemplatesVariables import (\n    template_set_locals_dict_value,\n    template_set_locals_mapping_value,\n    template_update_locals_dict_value,\n    template_update_locals_mapping_value,\n)\nfrom .VariableCodes import (\n    getLocalVariableDeclaration,\n    getVariableReferenceCode,\n)\nfrom .VariableDeclarations import VariableDeclaration\n\n\ndef generateBuiltinLocalsRefCode(to_name, expression, emit, context):\n    locals_scope = expression.getLocalsScope()\n\n    locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"locals_ref_value\", expression, emit, context\n    ) as value_name:\n        emit(\"%s = %s;\" % (value_name, locals_declaration))\n\n\ndef generateBuiltinLocalsCode(to_name, expression, emit, context):\n    variable_traces = expression.getVariableTraces()\n    updated = expression.isExpressionBuiltinLocalsUpdated()\n    locals_scope = expression.getLocalsScope()\n\n    # Locals is sorted of course.\n    def _sorted(variables):\n        variable_order = tuple(locals_scope.getProvidedVariables())\n\n        return sorted(\n            variables, key=lambda variable_desc: variable_order.index(variable_desc[0])\n        )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"locals_ref_value\", expression, emit, context\n    ) as value_name:\n        if updated:\n            locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n            is_dict = locals_scope.hasShapeDictionaryExact()\n            # For Python3 it may really not be a dictionary.\n\n            # TODO: Creation is not needed for classes.\n            emit(\n                \"\"\"\\\nif (%(locals_dict)s == NULL) %(locals_dict)s = MAKE_DICT_EMPTY();\n%(to_name)s = %(locals_dict)s;\nPy_INCREF(%(to_name)s);\"\"\"\n                % {\"to_name\": value_name, \"locals_dict\": locals_declaration}\n            )\n            context.addCleanupTempName(value_name)\n\n            initial = False\n        else:\n            emit(\"%s = MAKE_DICT_EMPTY();\" % (to_name,))\n\n            context.addCleanupTempName(value_name)\n\n            initial = True\n            is_dict = True\n\n        for local_var, variable_trace in _sorted(variable_traces):\n            _getVariableDictUpdateCode(\n                target_name=value_name,\n                variable=local_var,\n                variable_trace=variable_trace,\n                is_dict=is_dict,\n                initial=initial,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateBuiltinGlobalsCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"globals_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%(to_name)s = (PyObject *)moduledict_%(module_identifier)s;\"\n            % {\"to_name\": value_name, \"module_identifier\": context.getModuleCodeName()}\n        )\n\n\ndef _getVariableDictUpdateCode(\n    target_name, variable, variable_trace, initial, is_dict, emit, context\n):\n    # TODO: Variable could known to be set here, get a hand at that\n    # information.\n\n    variable_declaration = getLocalVariableDeclaration(\n        context, variable, variable_trace\n    )\n\n    variable_c_type = variable_declaration.getCType()\n\n    test_code = variable_c_type.getInitTestConditionCode(\n        value_name=variable_declaration, inverted=False\n    )\n\n    access_code = SourceCodeCollector()\n\n    getVariableReferenceCode(\n        to_name=VariableDeclaration(\"PyObject *\", \"value\", None, None),\n        variable=variable,\n        variable_trace=variable_trace,\n        needs_check=False,\n        conversion_check=True,\n        emit=access_code,\n        context=context,\n    )\n\n    if is_dict:\n        if initial:\n            template = template_set_locals_dict_value\n        else:\n            template = template_update_locals_dict_value\n\n        emit(\n            template\n            % {\n                \"dict_name\": target_name,\n                \"var_name\": context.getConstantCode(constant=variable.getName()),\n                \"test_code\": test_code,\n                \"access_code\": indented(access_code.codes),\n            }\n        )\n    else:\n        if initial:\n            template = template_set_locals_mapping_value\n        else:\n            template = template_update_locals_mapping_value\n\n        res_name = context.getBoolResName()\n\n        emit(\n            template\n            % {\n                \"mapping_name\": target_name,\n                \"var_name\": context.getConstantCode(constant=variable.getName()),\n                \"test_code\": test_code,\n                \"access_code\": access_code,\n                \"tmp_name\": res_name,\n            }\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name, emit=emit, context=context\n        )\n\n\ndef generateBuiltinDir1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyObject_Dir\",\n        tstate=False,\n        arg_desc=((\"dir_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinVarsCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"LOOKUP_VARS\",\n        tstate=True,\n        arg_desc=((\"vars_arg\", expression.subnode_source),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/IdCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Codes for id and hash\n\n\"\"\"\n\nfrom .CodeHelpers import decideConversionCheckNeeded\nfrom .PythonAPICodes import generateCAPIObjectCode\n\n\ndef generateBuiltinIdCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyLong_FromVoidPtr\",\n        tstate=False,\n        arg_desc=((\"id_arg\", expression.subnode_value),),\n        may_raise=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinHashCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_HASH\",\n        tstate=True,\n        arg_desc=((\"hash_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ImportCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Import related codes.\n\nThat is import as expression, and star import.\n\"\"\"\n\nimport os\n\nfrom nuitka.HardImportRegistry import isHardModule, isHardModuleDynamic\nfrom nuitka.nodes.LocalsScopes import GlobalsDictHandle\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Jinja2 import renderTemplateFromString\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode\nfrom .LineNumberCodes import emitLineNumberUpdateCode\nfrom .ModuleCodes import getModuleAccessCode\n\n\ndef generateBuiltinImportCode(to_name, expression, emit, context):\n    # We know that 5 expressions are created, pylint: disable=W0632\n    (\n        module_name,\n        globals_name,\n        locals_name,\n        import_list_name,\n        level_name,\n    ) = generateChildExpressionsCode(expression=expression, emit=emit, context=context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        _getBuiltinImportCode(\n            expression=expression,\n            to_name=value_name,\n            module_name=module_name,\n            globals_name=globals_name,\n            locals_name=locals_name,\n            import_list_name=import_list_name,\n            level_name=level_name,\n            needs_check=expression.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\n# TODO: Maybe use this for other cases too, not just import.\ndef _getCountedArgumentsHelperCallCode(\n    helper_prefix, to_name, args, min_args, needs_check, emit, context\n):\n    orig_args = args\n    args = list(args)\n    while args[-1] is None:\n        del args[-1]\n\n    if None in args:\n        emit(\n            \"%s = %s_KW(tstate, %s);\"\n            % (\n                to_name,\n                helper_prefix,\n                \", \".join(\"NULL\" if arg is None else str(arg) for arg in orig_args),\n            )\n        )\n    else:\n        # Check that no following arguments are not None.\n        assert len(args) >= min_args\n\n        emit(\n            \"%s = %s%d(tstate, %s);\"\n            % (to_name, helper_prefix, len(args), \", \".join(str(arg) for arg in args))\n        )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=args,\n        needs_check=needs_check,\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getBuiltinImportCode(\n    expression,\n    to_name,\n    module_name,\n    globals_name,\n    locals_name,\n    import_list_name,\n    level_name,\n    needs_check,\n    emit,\n    context,\n):\n    emitLineNumberUpdateCode(expression, emit, context)\n\n    # Spell the resulting helper names out, so this can be found,\n    # IMPORT_MODULE_KW, IMPORT_MODULE1, IMPORT_MODULE2, IMPORT_MODULE3, IMPORT_MODULE5\n    _getCountedArgumentsHelperCallCode(\n        helper_prefix=\"IMPORT_MODULE\",\n        to_name=to_name,\n        args=(module_name, globals_name, locals_name, import_list_name, level_name),\n        min_args=1,\n        needs_check=needs_check,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateImportModuleFixedCode(to_name, expression, emit, context):\n    needs_check = expression.mayRaiseException(BaseException)\n\n    if needs_check:\n        emitLineNumberUpdateCode(expression, emit, context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"\"\"%s = IMPORT_MODULE_FIXED(tstate, %s, %s);\"\"\"\n            % (\n                value_name,\n                context.getConstantCode(expression.getModuleName().asString()),\n                context.getConstantCode(expression.getValueName().asString()),\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name, needs_check=needs_check, emit=emit, context=context\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef getImportModuleHardCodeName(module_name):\n    \"\"\"Encoding hard module name for code name.\"\"\"\n\n    module_name = ModuleName(module_name)\n\n    return \"IMPORT_HARD_%s\" % module_name.asPath().replace(os.path.sep, \"__\").upper()\n\n\ndef generateImportModuleHardCode(to_name, expression, emit, context):\n    imported_module_name = expression.getModuleName()\n    module_value_name = expression.getValueName()\n\n    needs_check = expression.mayRaiseException(BaseException)\n\n    if needs_check:\n        emitLineNumberUpdateCode(expression, emit, context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        import_gives_ref, module_getter_code = getImportHardModuleGetterCode(\n            module_name=imported_module_name, context=context\n        )\n\n        if imported_module_name == module_value_name:\n            emit(\"\"\"%s = %s;\"\"\" % (value_name, module_getter_code))\n        else:\n            import_gives_ref, module_getter_code2 = getImportHardModuleGetterCode(\n                module_name=module_value_name, context=context\n            )\n\n            emit(\n                renderTemplateFromString(\n                    r\"\"\"\n{% if import_gives_ref %}\n{\n    PyObject *hard_module = {{module_getter_code1}};\n    Py_DECREF(hard_module);\n}\n{% else %}\n{{module_getter_code1}};\n{% endif %}\n{{value_name}} = {{module_getter_code2}};\n\"\"\",\n                    value_name=value_name,\n                    module_getter_code1=module_getter_code,\n                    module_getter_code2=module_getter_code2,\n                    import_gives_ref=import_gives_ref,\n                )\n            )\n\n        getErrorExitCode(\n            check_name=value_name, needs_check=needs_check, emit=emit, context=context\n        )\n\n        if import_gives_ref:\n            context.addCleanupTempName(value_name)\n\n\ndef generateConstantSysVersionInfoCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        emit(\"\"\"%s = Nuitka_SysGetObject(\"%s\");\"\"\" % (value_name, \"version_info\"))\n\n    getErrorExitCode(\n        check_name=value_name, needs_check=False, emit=emit, context=context\n    )\n\n\ndef getImportHardModuleGetterCode(module_name, context):\n    if isHardModuleDynamic(module_name):\n        module_name_code = context.getConstantCode(module_name.asString())\n\n        module_getter_code = \"IMPORT_MODULE_FIXED(tstate, %s, %s)\" % (\n            module_name_code,\n            module_name_code,\n        )\n        gives_ref = True\n    else:\n        module_getter_code = \"%s()\" % getImportModuleHardCodeName(module_name)\n        gives_ref = False\n\n    return gives_ref, module_getter_code\n\n\ndef getImportModuleNameHardCode(\n    to_name, module_name, import_name, needs_check, emit, context\n):\n    module_name = ModuleName(module_name)\n\n    if module_name == \"sys\":\n        emit(\"\"\"%s = Nuitka_SysGetObject(\"%s\");\"\"\" % (to_name, import_name))\n        needs_release = False\n    elif isHardModule(module_name):\n        if needs_check:\n            emitLineNumberUpdateCode(expression=None, emit=emit, context=context)\n\n        import_gives_ref, module_getter_code = getImportHardModuleGetterCode(\n            module_name=module_name, context=context\n        )\n\n        emit(\n            renderTemplateFromString(\n                r\"\"\"\n{\n    PyObject *hard_module = {{module_getter_code}};\n{% if needs_check %}\n    if (likely(hard_module != NULL)) {\n        {{to_name}} = LOOKUP_ATTRIBUTE(tstate, hard_module, {{import_name}});\n\n{% if import_gives_ref %}\n        Py_DECREF(hard_module);\n{% endif %}\n\n    } else {\n        {{to_name}} = NULL;\n    }\n{% else %}\n    {{to_name}} = LOOKUP_ATTRIBUTE(tstate, hard_module, {{import_name}});\n{% if import_gives_ref %}\n    Py_DECREF(hard_module);\n{% endif %}\n{% endif %}\n}\n\"\"\",\n                to_name=to_name,\n                module_name=str(module_name),\n                module_getter_code=module_getter_code,\n                import_name=context.getConstantCode(import_name),\n                needs_check=needs_check,\n                import_gives_ref=import_gives_ref,\n            )\n        )\n\n        needs_release = True\n    else:\n        assert False, module_name\n\n    getErrorExitCode(\n        check_name=to_name, needs_check=needs_check, emit=emit, context=context\n    )\n\n    if needs_release:\n        context.addCleanupTempName(to_name)\n\n\ndef generateImportModuleNameHardCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n        getImportModuleNameHardCode(\n            to_name=value_name,\n            module_name=expression.getModuleName(),\n            import_name=expression.getImportName(),\n            needs_check=expression.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibImportCallCode(to_name, expression, emit, context):\n    needs_check = expression.mayRaiseException(BaseException)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_module\", expression, emit, context\n    ) as value_name:\n        import_name, package_name = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        emitLineNumberUpdateCode(expression, emit, context)\n\n        # TODO: The import name wouldn't have to be an object really, could do with a\n        # C string only.\n\n        emit(\n            renderTemplateFromString(\n                r\"\"\"\n{\n    PyObject *hard_module = {{import_hard_importlib}}();\n    PyObject *import_module_func = LOOKUP_ATTRIBUTE(tstate, hard_module, {{context.getConstantCode(\"import_module\")}});\n{% if package_name == None %}\n    {{to_name}} = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, import_module_func, {{import_name}});\n{% else %}\n    PyObject *args[2] = { {{import_name}}, {{package_name}} };\n    {{to_name}} = CALL_FUNCTION_WITH_ARGS2(tstate, import_module_func, args);\n{% endif %}\n    Py_DECREF(import_module_func);\n}\n\"\"\",\n                context=context,\n                to_name=value_name,\n                import_name=import_name,\n                package_name=package_name,\n                import_hard_importlib=getImportModuleHardCodeName(\"importlib\"),\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=(import_name, package_name),\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportStarCode(statement, emit, context):\n    module_name = context.allocateTempName(\"star_imported\")\n\n    generateExpressionCode(\n        to_name=module_name,\n        expression=statement.subnode_module,\n        emit=emit,\n        context=context,\n    )\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        res_name = context.getBoolResName()\n\n        target_scope = statement.getTargetDictScope()\n\n        if type(target_scope) is GlobalsDictHandle:\n            emit(\n                \"%s = IMPORT_MODULE_STAR(tstate, %s, true, %s);\"\n                % (res_name, getModuleAccessCode(context=context), module_name)\n            )\n        else:\n            locals_declaration = context.addLocalsDictName(target_scope.getCodeName())\n\n            emit(\n                \"%(res_name)s = IMPORT_MODULE_STAR(tstate, %(locals_dict)s, false, %(module_name)s);\"\n                % {\n                    \"res_name\": res_name,\n                    \"locals_dict\": locals_declaration,\n                    \"module_name\": module_name,\n                }\n            )\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            release_name=module_name,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportNameCode(to_name, expression, emit, context):\n    from_arg_name = context.allocateTempName(\"import_name_from\")\n\n    generateExpressionCode(\n        to_name=from_arg_name,\n        expression=expression.subnode_module,\n        emit=emit,\n        context=context,\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"imported_value\", expression, emit, context\n    ) as value_name:\n        if python_version >= 0x350:\n            emit(\n                \"\"\"\\\nif (PyModule_Check(%(from_arg_name)s)) {\n    %(to_name)s = IMPORT_NAME_OR_MODULE(\n        tstate,\n        %(from_arg_name)s,\n        (PyObject *)moduledict_%(module_identifier)s,\n        %(import_name)s,\n        %(import_level)s\n    );\n} else {\n    %(to_name)s = IMPORT_NAME_FROM_MODULE(tstate, %(from_arg_name)s, %(import_name)s);\n}\n\"\"\"\n                % {\n                    \"to_name\": value_name,\n                    \"from_arg_name\": from_arg_name,\n                    \"import_name\": context.getConstantCode(\n                        constant=expression.getImportName()\n                    ),\n                    \"import_level\": context.getConstantCode(\n                        constant=expression.getImportLevel()\n                    ),\n                    \"module_identifier\": context.getModuleCodeName(),\n                }\n            )\n        else:\n            emit(\n                \"%s = IMPORT_NAME_FROM_MODULE(tstate, %s, %s);\"\n                % (\n                    value_name,\n                    from_arg_name,\n                    context.getConstantCode(constant=expression.getImportName()),\n                )\n            )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_name=from_arg_name,\n            needs_check=expression.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/Indentation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Indentation of code.\n\nLanguage independent, the amount of the spaces is not configurable, as it needs\nto be the same as in templates.\n\"\"\"\n\n\ndef _indentedCode(codes, count):\n    return \"\\n\".join(\n        \" \" * count + line if (line and not line.startswith(\"#\")) else line\n        for line in codes\n    )\n\n\ndef indented(codes, level=1, vert_block=False):\n    if type(codes) is str:\n        codes = codes.split(\"\\n\")\n\n    if vert_block and codes != [\"\"]:\n        codes.insert(0, \"\")\n        codes.append(\"\")\n\n    return _indentedCode(codes, level * 4)\n\n\ndef getCommentCode(comment, emit):\n    emit(\"// \" + comment)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/IndexCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for index values.\n\nThis is not for actual subscripts (see SubscriptCodes), but to convert\ngeneric values to indexes. Also the maximum and minimum index values\nare abstracted here.\n\n\"\"\"\n\nfrom .ErrorCodes import getErrorExitBoolCode\n\n\ndef getMaxIndexCode(to_name, emit):\n    emit(\"%s = PY_SSIZE_T_MAX;\" % to_name)\n\n\ndef getMinIndexCode(to_name, emit):\n    emit(\"%s = 0;\" % to_name)\n\n\ndef getIndexCode(to_name, value_name, emit, context):\n    emit(\"%s = CONVERT_TO_INDEX(tstate, %s);\" % (to_name, value_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1 && HAS_ERROR_OCCURRED(tstate)\" % to_name,\n        emit=emit,\n        context=context,\n    )\n\n\ndef getIndexValueCode(to_name, value, emit):\n    emit(\"%s = %d;\" % (to_name, value))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/InjectCCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" C code inject related nodes.\n\nThese are only coming from special purpose plugins.\n\"\"\"\n\n\ndef generateInjectCCode(statement, emit, context):\n    # No intelligence here, just dumping the code, pylint: disable=unused-argument\n    emit(statement.c_code)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/IntegerCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Integer related codes, long and int.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode\nfrom .PythonAPICodes import generateCAPIObjectCode\n\n\ndef generateBuiltinLong1Code(to_name, expression, emit, context):\n    assert python_version < 0x300\n\n    # TODO: Have dedicated helper that inlines.\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyNumber_Long\",\n        tstate=False,\n        arg_desc=((\"long_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinLong2Code(to_name, expression, emit, context):\n    assert python_version < 0x300\n\n    value_name, base_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"long_value\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = BUILTIN_LONG2(tstate, %s, %s);\" % (result_name, value_name, base_name)\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(value_name, base_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateBuiltinInt1Code(to_name, expression, emit, context):\n    # TODO: Have dedicated helper that inlines.\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyNumber_Int\",\n        tstate=False,\n        arg_desc=((\"int_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinInt2Code(to_name, expression, emit, context):\n    value_name, base_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"int_value\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = BUILTIN_INT2(tstate, %s, %s);\" % (result_name, value_name, base_name)\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(value_name, base_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/IteratorCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Iteration related codes.\n\nNext variants and unpacking with related checks.\n\"\"\"\n\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ComparisonCodes import getRichComparisonCode\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getErrorExitReleaseCode,\n    getFrameVariableTypeDescriptionCode,\n    getReleaseCode,\n)\nfrom .Indentation import indented\nfrom .LineNumberCodes import getErrorLineNumberUpdateCode\nfrom .PythonAPICodes import generateCAPIObjectCode\nfrom .templates.CodeTemplatesIterators import (\n    template_iterator_check,\n    template_loop_break_next,\n)\n\n\ndef generateBuiltinNext1Code(to_name, expression, emit, context):\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"next_value\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = %s;\" % (result_name, \"ITERATOR_NEXT(%s)\" % value_name))\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_name=value_name,\n            quick_exception=\"StopIteration\",\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef getBuiltinLoopBreakNextCode(to_name, value, emit, context):\n    emit(\"%s = %s;\" % (to_name, \"ITERATOR_NEXT(%s)\" % value))\n\n    getReleaseCode(release_name=value, emit=emit, context=context)\n\n    break_target = context.getLoopBreakTarget()\n    if type(break_target) is tuple:\n        break_indicator_code = \"%s = true;\" % break_target[1]\n        break_target = break_target[0]\n    else:\n        break_indicator_code = \"\"\n\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\n        template_loop_break_next\n        % {\n            \"to_name\": to_name,\n            \"break_indicator_code\": break_indicator_code,\n            \"break_target\": break_target,\n            \"release_temps\": indented(getErrorExitReleaseCode(context), 2),\n            \"var_description_code\": indented(\n                getFrameVariableTypeDescriptionCode(context), 2\n            ),\n            \"line_number_code\": indented(getErrorLineNumberUpdateCode(context), 2),\n            \"exception_target\": context.getExceptionEscape(),\n            \"exception_type\": exception_type,\n            \"exception_value\": exception_value,\n            \"exception_tb\": exception_tb,\n        }\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateSpecialUnpackCode(to_name, expression, emit, context):\n    value_name = context.allocateTempName(\"unpack\")\n\n    generateExpressionCode(\n        to_name=value_name,\n        expression=expression.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"unpack_value\", expression, emit, context\n    ) as result_name:\n        needs_check = expression.mayRaiseExceptionOperation()\n\n        if not needs_check:\n            emit(\"%s = UNPACK_NEXT_INFALLIBLE(%s);\" % (result_name, value_name))\n        elif python_version < 0x350:\n            emit(\n                \"%s = UNPACK_NEXT(tstate, %s, %s);\"\n                % (result_name, value_name, expression.getCount() - 1)\n            )\n        else:\n            starred = expression.getStarred()\n            expected = expression.getExpected()\n\n            emit(\n                \"%s = UNPACK_NEXT%s(tstate, %s, %s, %s);\"\n                % (\n                    result_name,\n                    \"_STARRED\" if starred else \"\",\n                    value_name,\n                    expression.getCount() - 1,\n                    expected,\n                )\n            )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_name=value_name,\n            quick_exception=\"StopIteration\",\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n    context.addCleanupTempName(to_name)\n\n\ndef generateUnpackCheckCode(statement, emit, context):\n    iterator_name = context.allocateTempName(\"iterator_name\")\n\n    generateExpressionCode(\n        to_name=iterator_name,\n        expression=statement.subnode_iterator,\n        emit=emit,\n        context=context,\n    )\n\n    # These variable cannot collide, as it's used very locally.\n    attempt_name = context.allocateTempName(\"iterator_attempt\", unique=True)\n\n    release_code = getErrorExitReleaseCode(context)\n    var_description_code = getFrameVariableTypeDescriptionCode(context)\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            _exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        emit(\n            template_iterator_check\n            % {\n                \"iterator_name\": iterator_name,\n                \"attempt_name\": attempt_name,\n                \"exception_exit\": context.getExceptionEscape(),\n                \"release_temps_1\": indented(release_code, 3),\n                \"line_number_code_1\": indented(\n                    getErrorLineNumberUpdateCode(context), 3\n                ),\n                \"var_description_code_1\": indented(var_description_code, 3),\n                \"release_temps_2\": indented(release_code),\n                \"var_description_code_2\": indented(var_description_code),\n                \"line_number_code_2\": indented(getErrorLineNumberUpdateCode(context)),\n                \"exception_type\": exception_type,\n                \"exception_value\": exception_value,\n                \"exception_tb\": exception_tb,\n                \"too_many_values_error\": context.getConstantCode(\n                    \"too many values to unpack\"\n                    if python_version < 0x300\n                    else \"too many values to unpack (expected %d)\"\n                    % statement.getCount()\n                ),\n            }\n        )\n\n        getReleaseCode(release_name=iterator_name, emit=emit, context=context)\n\n\ndef generateUnpackCheckFromIteratedCode(statement, emit, context):\n    iteration_length_name = context.allocateTempName(\"iteration_length\", unique=True)\n\n    generateExpressionCode(\n        to_name=iteration_length_name,\n        expression=statement.subnode_iterated_length,\n        emit=emit,\n        context=context,\n    )\n\n    to_name = context.getBoolResName()\n\n    getRichComparisonCode(\n        to_name=to_name,\n        comparator=\"Gt\",\n        left=statement.subnode_iterated_length,\n        # Creating a temporary node on the fly, knowing it's not used for many\n        # things. TODO: Once we have value shapes, we ought to use those.\n        right=makeConstantRefNode(\n            constant=statement.count,\n            source_ref=statement.source_ref,\n            user_provided=True,\n        ),\n        # We know that cannot fail.\n        needs_check=False,\n        source_ref=statement.source_ref,\n        emit=emit,\n        context=context,\n    )\n\n    # TODO: Why is this necessary, to_name doesn't allow storage.\n    context.removeCleanupTempName(to_name)\n\n    # TODO: This exception ought to have a creator function.\n    emit(\n        \"\"\"\nif (%(to_name)s) {\n    PyErr_Format(PyExc_ValueError, \"too many values to unpack\");\n}\n\"\"\"\n        % {\"to_name\": to_name}\n    )\n\n    getErrorExitBoolCode(condition=str(to_name), emit=emit, context=context)\n\n\ndef generateBuiltinNext2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_NEXT2\",\n        tstate=True,\n        arg_desc=(\n            (\"next_arg\", expression.subnode_iterator),\n            (\"next_default\", expression.subnode_default),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinIter1Code(to_name, expression, emit, context):\n    may_raise = expression.mayRaiseExceptionOperation()\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"MAKE_ITERATOR\" if may_raise else \"MAKE_ITERATOR_INFALLIBLE\",\n        tstate=may_raise,\n        arg_desc=((\"iter_arg\", expression.subnode_value),),\n        may_raise=may_raise,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinIterForUnpackCode(to_name, expression, emit, context):\n    may_raise = expression.mayRaiseExceptionOperation()\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"MAKE_UNPACK_ITERATOR\" if may_raise else \"MAKE_ITERATOR_INFALLIBLE\",\n        tstate=False,\n        arg_desc=((\"iter_arg\", expression.subnode_value),),\n        may_raise=may_raise,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinIter2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_ITER2\",\n        tstate=False,\n        arg_desc=(\n            (\"iter_callable\", expression.subnode_callable_arg),\n            (\"iter_sentinel\", expression.subnode_sentinel),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinLenCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_LEN\",\n        tstate=True,\n        arg_desc=((\"len_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinAnyCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_ANY\",\n        tstate=True,\n        arg_desc=((\"any_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinAllCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_ALL\",\n        tstate=True,\n        arg_desc=((\"all_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/LabelCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" C labels, small helpers.\n\nMuch things are handled with \"goto\" statements in the generated code, error\nexits, finally blocks, etc. this provides just the means to emit a label or\nthe goto statement itself.\n\"\"\"\n\nfrom nuitka.utils.CStrings import encodePythonStringToC\n\n\ndef getGotoCode(label, emit):\n    assert label is not None\n\n    emit(\"goto %s;\" % label)\n\n\ndef getLabelCode(label, emit):\n    assert label is not None\n\n    emit(\"%s:;\" % label)\n\n\ndef getBranchingCode(condition, emit, context):\n    true_target = context.getTrueBranchTarget()\n    false_target = context.getFalseBranchTarget()\n\n    if true_target is not None and false_target is None:\n        emit(\"if (%s) goto %s;\" % (condition, true_target))\n    elif true_target is None and false_target is not None:\n        emit(\"if (!(%s)) goto %s;\" % (condition, false_target))\n    else:\n        assert true_target is not None and false_target is not None\n\n        emit(\n            \"\"\"\\\nif (%s) {\n    goto %s;\n} else {\n    goto %s;\n}\"\"\"\n            % (condition, true_target, false_target)\n        )\n\n\ndef getStatementTrace(source_desc, statement_repr):\n    return 'NUITKA_PRINT_TRACE(\"Execute: \" %s);' % (\n        encodePythonStringToC(source_desc + b\" \" + statement_repr),\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/LineNumberCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Generate code that updates the source code line.\n\n\"\"\"\n\n\ndef getCurrentLineNumberCode(context):\n    frame_handle = context.getFrameHandle()\n\n    if frame_handle is None:\n        return \"\"\n    else:\n        source_ref = context.getCurrentSourceCodeReference()\n\n        if source_ref.isInternal():\n            return \"\"\n        else:\n            return str(source_ref.getLineNumber())\n\n\ndef getLineNumberUpdateCode(context):\n    lineno_value = getCurrentLineNumberCode(context)\n\n    if lineno_value:\n        frame_handle = context.getFrameHandle()\n\n        return \"%s->m_frame.f_lineno = %s;\" % (frame_handle, lineno_value)\n    else:\n        return \"\"\n\n\ndef getErrorLineNumberUpdateCode(context):\n    (\n        _exception_type,\n        _exception_value,\n        _exception_tb,\n        exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    lineno_value = getCurrentLineNumberCode(context)\n\n    if lineno_value:\n        return \"%s = %s;\" % (exception_lineno, lineno_value)\n    else:\n        return \"\"\n\n\ndef emitErrorLineNumberUpdateCode(emit, context):\n    update_code = getErrorLineNumberUpdateCode(context)\n\n    if update_code:\n        emit(update_code)\n\n\ndef emitLineNumberUpdateCode(expression, emit, context):\n    # Optional expression.\n    if expression is not None:\n        context.setCurrentSourceCodeReference(expression.getCompatibleSourceReference())\n\n    code = getLineNumberUpdateCode(context)\n\n    if code:\n        emit(code)\n\n\ndef getSetLineNumberCodeRaw(to_name, emit, context):\n    assert context.getFrameHandle() is not None\n\n    emit(\"%s->m_frame.f_lineno = %s;\" % (context.getFrameHandle(), to_name))\n\n\ndef getLineNumberCode(to_name, emit, context):\n    assert context.getFrameHandle() is not None\n\n    emit(\"%s = %s->m_frame.f_lineno;\" % (to_name, context.getFrameHandle()))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ListCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for lists.\n\nRight now only the creation is done here. But more should be added later on.\n\"\"\"\n\nfrom .CodeHelpers import (\n    assignConstantNoneResult,\n    decideConversionCheckNeeded,\n    generateChildExpressionCode,\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withCleanupFinally,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getReleaseCode,\n    getReleaseCodes,\n)\nfrom .PythonAPICodes import (\n    generateCAPIObjectCode,\n    generateCAPIObjectCode0,\n    makeArgDescFromExpression,\n)\nfrom .SubscriptCodes import decideIntegerSubscript\n\n\ndef generateListCreationCode(to_name, expression, emit, context):\n    elements = expression.subnode_elements\n    assert elements\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_result\", expression, emit, context\n    ) as result_name:\n        element_name = context.allocateTempName(\"list_element\")\n\n        def generateElementCode(element):\n            generateExpressionCode(\n                to_name=element_name, expression=element, emit=emit, context=context\n            )\n\n            # Use helper that makes sure we provide a reference.\n            if context.needsCleanup(element_name):\n                context.removeCleanupTempName(element_name)\n                helper_code = \"PyList_SET_ITEM\"\n            else:\n                helper_code = \"PyList_SET_ITEM0\"\n\n            return helper_code\n\n        helper_code = generateElementCode(elements[0])\n\n        emit(\"%s = MAKE_LIST_EMPTY(%d);\" % (result_name, len(elements)))\n\n        needs_exception_exit = any(\n            element.mayRaiseException(BaseException) for element in elements[1:]\n        )\n\n        with withCleanupFinally(\n            \"list_build\", result_name, needs_exception_exit, emit, context\n        ) as guarded_emit:\n            emit = guarded_emit.emit\n\n            for count, element in enumerate(elements):\n                if count > 0:\n                    helper_code = generateElementCode(element)\n\n                emit(\n                    \"%s(%s, %d, %s);\" % (helper_code, result_name, count, element_name)\n                )\n\n\ndef generateListOperationAppendCode(statement, emit, context):\n    list_arg_name = context.allocateTempName(\"append_list\")\n    generateExpressionCode(\n        to_name=list_arg_name,\n        expression=statement.subnode_list_arg,\n        emit=emit,\n        context=context,\n    )\n\n    value_arg_name = context.allocateTempName(\"append_value\")\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    res_name = context.getBoolResName()\n\n    if context.needsCleanup(value_arg_name):\n        emit(\"%s = LIST_APPEND1(%s, %s);\" % (res_name, list_arg_name, value_arg_name))\n        context.removeCleanupTempName(value_arg_name)\n    else:\n        emit(\"%s = LIST_APPEND0(%s, %s);\" % (res_name, list_arg_name, value_arg_name))\n\n    # TODO: Only really MemoryError, which we often ignore.\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(list_arg_name, value_arg_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateListOperationAppendCode2(to_name, expression, emit, context):\n    list_arg_name, value_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    context.setCurrentSourceCodeReference(expression.getSourceReference())\n\n    res_name = context.getBoolResName()\n\n    if context.needsCleanup(value_arg_name):\n        emit(\"%s = LIST_APPEND1(%s, %s);\" % (res_name, list_arg_name, value_arg_name))\n        context.removeCleanupTempName(value_arg_name)\n    else:\n        emit(\"%s = LIST_APPEND0(%s, %s);\" % (res_name, list_arg_name, value_arg_name))\n\n    # TODO: Only really MemoryError, which we often ignore.\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(list_arg_name, value_arg_name),\n        needs_check=False,\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationExtendCode(to_name, expression, emit, context):\n    list_arg_name, value_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # These give different error messages.\n    is_unpack = expression.isExpressionListOperationExtendForUnpack()\n\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = %s(tstate, %s, %s);\"\n        % (\n            res_name,\n            \"LIST_EXTEND_FOR_UNPACK\" if is_unpack else \"LIST_EXTEND_FROM_ITERABLE\",\n            list_arg_name,\n            value_arg_name,\n        )\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(list_arg_name, value_arg_name),\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationClearCode(to_name, expression, emit, context):\n    (list_arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    emit(\"LIST_CLEAR(%s);\" % list_arg_name)\n\n    getReleaseCode(release_name=list_arg_name, emit=emit, context=context)\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationCopyCode(to_name, expression, emit, context):\n    (list_arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_copy_result\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = LIST_COPY(%s);\" % (result_name, list_arg_name))\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_name=list_arg_name,\n            emit=emit,\n            needs_check=False,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateListOperationReverseCode(to_name, expression, emit, context):\n    (list_arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    emit(\"LIST_REVERSE(%s);\" % list_arg_name)\n\n    getReleaseCode(release_name=list_arg_name, emit=emit, context=context)\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationIndex2Code(to_name, expression, emit, context):\n    list_arg_name, value_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_index_result\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = LIST_INDEX2(tstate, %s, %s);\"\n            % (result_name, list_arg_name, value_arg_name)\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(list_arg_name, value_arg_name),\n            needs_check=expression.mayRaiseExceptionOperation(),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateListOperationIndex3Code(to_name, expression, emit, context):\n    list_arg_name, value_arg_name, start_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_index_result\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = LIST_INDEX3(tstate, %s, %s, %s);\"\n            % (result_name, list_arg_name, value_arg_name, start_arg_name)\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(list_arg_name, value_arg_name, start_arg_name),\n            needs_check=expression.mayRaiseExceptionOperation(),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateListOperationIndex4Code(to_name, expression, emit, context):\n    (\n        list_arg_name,\n        value_arg_name,\n        start_arg_name,\n        stop_arg_name,\n    ) = generateChildExpressionsCode(expression=expression, emit=emit, context=context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_index_result\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = LIST_INDEX4(tstate, %s, %s, %s, %s);\"\n            % (\n                result_name,\n                list_arg_name,\n                value_arg_name,\n                start_arg_name,\n                stop_arg_name,\n            )\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(\n                list_arg_name,\n                value_arg_name,\n                start_arg_name,\n                stop_arg_name,\n            ),\n            needs_check=expression.mayRaiseExceptionOperation(),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateListOperationInsertCode(to_name, expression, emit, context):\n    index_constant, is_integer_index = decideIntegerSubscript(expression.subnode_index)\n\n    if is_integer_index:\n        list_arg_name = generateChildExpressionCode(\n            expression=expression.subnode_list_arg, emit=emit, context=context\n        )\n\n        item_arg_name = generateChildExpressionCode(\n            expression=expression.subnode_item, emit=emit, context=context\n        )\n    else:\n        list_arg_name, index_arg_name, item_arg_name = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n    if is_integer_index:\n        emit(\n            \"LIST_INSERT_CONST(%s, %s, %s);\"\n            % (\n                list_arg_name,\n                index_constant,\n                item_arg_name,\n            )\n        )\n\n        getReleaseCodes(\n            release_names=(\n                list_arg_name,\n                item_arg_name,\n            ),\n            emit=emit,\n            context=context,\n        )\n    else:\n        res_name = context.getBoolResName()\n\n        emit(\n            \"%s = LIST_INSERT(tstate, %s, %s, %s);\"\n            % (\n                res_name,\n                list_arg_name,\n                index_arg_name,\n                item_arg_name,\n            )\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            release_names=(\n                list_arg_name,\n                index_arg_name,\n                item_arg_name,\n            ),\n            needs_check=expression.mayRaiseExceptionOperation(),\n            emit=emit,\n            context=context,\n        )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationCountCode(to_name, expression, emit, context):\n    list_arg_name, value_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"list_count_result\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = LIST_COUNT(%s, %s);\" % (result_name, list_arg_name, value_arg_name))\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(list_arg_name, value_arg_name),\n            emit=emit,\n            needs_check=expression.mayRaiseExceptionOperation(),\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateListOperationPop1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"LIST_POP1\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateListOperationPop2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"LIST_POP2\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateListOperationRemoveCode(to_name, expression, emit, context):\n    (list_arg_name, value_arg_name) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    res_name = context.getBoolResName()\n\n    emit(\"%s = LIST_REMOVE(%s, %s);\" % (res_name, list_arg_name, value_arg_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(list_arg_name, value_arg_name),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateListOperationSort1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"LIST_SORT1\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateListOperationSort2Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"LIST_SORT2\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateListOperationSort3Code(to_name, expression, emit, context):\n    generateCAPIObjectCode0(\n        to_name=to_name,\n        capi=\"LIST_SORT3\",\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseExceptionOperation(),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinListCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"MAKE_LIST\",\n        tstate=True,\n        arg_desc=((\"list_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/LoaderCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with module loaders.\n\nThis is for generating the look-up table for the modules included in a binary\nor distribution folder.\n\nAlso this prepares tables for the freezer for bytecode compiled modules. Not\nreal C compiled modules.\n\nThis is including modules as bytecode and mostly intended for modules, where\nwe know compiling it useless or does not make much sense, or for standalone\nmode to access modules during CPython library init that cannot be avoided.\n\nThe level of compatibility for C compiled stuff is so high that this is not\nneeded except for technical reasons.\n\"\"\"\n\nimport sys\n\nfrom nuitka import Options\nfrom nuitka.ModuleRegistry import (\n    getDoneModules,\n    getUncompiledModules,\n    getUncompiledTechnicalModules,\n)\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.CStrings import encodePythonStringToC, encodePythonUnicodeToC\n\nfrom .Indentation import indented\nfrom .templates.CodeTemplatesLoader import (\n    template_metapath_loader_body,\n    template_metapath_loader_bytecode_module_entry,\n    template_metapath_loader_compiled_module_entry,\n    template_metapath_loader_extension_module_entry,\n)\n\n\ndef getModuleMetaPathLoaderEntryCode(module, bytecode_accessor):\n    module_c_name = encodePythonStringToC(\n        Plugins.encodeDataComposerName(module.getFullName().asString())\n    )\n\n    flags = [\"NUITKA_TRANSLATED_FLAG\"]\n\n    if (\n        not Options.isStandaloneMode()\n        and not Options.shallMakeModule()\n        and Options.getFileReferenceMode() == \"original\"\n        and python_version >= 0x370\n    ):\n        # File system paths that will hopefully work, spell-checker: ignore getfilesystemencoding\n        if Options.isWin32Windows():\n            file_path = encodePythonUnicodeToC(module.getCompileTimeFilename())\n        else:\n            file_path = encodePythonStringToC(\n                module.getCompileTimeFilename().encode(sys.getfilesystemencoding())\n            )\n    else:\n        file_path = \"NULL\"\n\n    if module.isUncompiledPythonModule():\n        code_data = module.getByteCode()\n        is_package = module.isUncompiledPythonPackage()\n\n        flags.append(\"NUITKA_BYTECODE_FLAG\")\n        if is_package:\n            flags.append(\"NUITKA_PACKAGE_FLAG\")\n\n        accessor_code = bytecode_accessor.getBlobDataCode(\n            data=code_data,\n            name=\"bytecode of module '%s'\" % module.getFullName(),\n        )\n\n        return template_metapath_loader_bytecode_module_entry % {\n            \"module_name\": module_c_name,\n            \"bytecode\": accessor_code[accessor_code.find(\"[\") + 1 : -1],\n            \"size\": len(code_data),\n            \"flags\": \" | \".join(flags),\n            \"file_path\": file_path,\n        }\n    elif module.isPythonExtensionModule():\n        flags.append(\"NUITKA_EXTENSION_MODULE_FLAG\")\n\n        return template_metapath_loader_extension_module_entry % {\n            \"module_name\": module_c_name,\n            \"flags\": \" | \".join(flags),\n            \"file_path\": file_path,\n        }\n    else:\n        if module.isCompiledPythonPackage():\n            flags.append(\"NUITKA_PACKAGE_FLAG\")\n\n        return template_metapath_loader_compiled_module_entry % {\n            \"module_name\": module_c_name,\n            \"module_identifier\": module.getCodeName(),\n            \"flags\": \" | \".join(flags),\n            \"file_path\": file_path,\n        }\n\n\ndef getMetaPathLoaderBodyCode(bytecode_accessor):\n    metapath_loader_inittab = []\n    metapath_module_decls = []\n\n    uncompiled_modules = getUncompiledModules()\n\n    for other_module in getDoneModules():\n        # Put those at the end.\n        if other_module in uncompiled_modules:\n            continue\n\n        metapath_loader_inittab.append(\n            getModuleMetaPathLoaderEntryCode(\n                module=other_module, bytecode_accessor=bytecode_accessor\n            )\n        )\n\n        if other_module.isCompiledPythonModule():\n            metapath_module_decls.append(\n                \"\"\"\\\nextern PyObject *modulecode_%(module_identifier)s(\\\nPyThreadState *tstate, PyObject *, struct Nuitka_MetaPathBasedLoaderEntry const *);\"\"\"\n                % {\"module_identifier\": other_module.getCodeName()}\n            )\n\n    # Do them now\n    for uncompiled_module in uncompiled_modules:\n        metapath_loader_inittab.append(\n            getModuleMetaPathLoaderEntryCode(\n                module=uncompiled_module, bytecode_accessor=bytecode_accessor\n            )\n        )\n\n    frozen_defs = []\n\n    # Only the non-technical ones need to be there.\n    for uncompiled_module in getUncompiledTechnicalModules():\n        module_name = uncompiled_module.getFullName()\n        code_data = uncompiled_module.getByteCode()\n        is_package = uncompiled_module.isUncompiledPythonPackage()\n\n        size = len(code_data)\n\n        # Packages are indicated with negative size.\n        if is_package:\n            size = -size\n\n        accessor_code = bytecode_accessor.getBlobDataCode(\n            data=code_data,\n            name=\"bytecode of module '%s'\" % uncompiled_module.getFullName(),\n        )\n\n        frozen_defs.append(\n            \"\"\"\\\n{{\"{module_name}\", {start}, {size}}},\"\"\".format(\n                module_name=module_name,\n                start=accessor_code[accessor_code.find(\"[\") + 1 : -1],\n                size=size,\n            )\n        )\n\n        if Options.isShowInclusion():\n            inclusion_logger.info(\"Embedded as frozen module '%s'.\" % module_name)\n\n    return template_metapath_loader_body % {\n        \"metapath_module_decls\": indented(metapath_module_decls, 0),\n        \"metapath_loader_inittab\": indented(metapath_loader_inittab),\n        \"bytecode_count\": bytecode_accessor.getConstantsCount(),\n        \"frozen_modules\": indented(frozen_defs),\n    }\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/LocalsDictCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for locals dict handling.\n\nThese are variable handling for classes and partially also Python2 exec\nstatements.\n\"\"\"\n\nfrom .CodeHelpers import (\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .Emission import SourceCodeCollector\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getNameReferenceErrorCode,\n)\nfrom .Indentation import indented\nfrom .PythonAPICodes import getReferenceExportCode\nfrom .templates.CodeTemplatesVariables import (\n    template_read_locals_dict_with_fallback,\n    template_read_locals_dict_without_fallback,\n    template_read_locals_mapping_with_fallback,\n    template_read_locals_mapping_without_fallback,\n)\n\n\ndef generateSetLocalsDictCode(statement, emit, context):\n    locals_declaration = context.addLocalsDictName(\n        statement.getLocalsScope().getCodeName()\n    )\n\n    emit(\n        \"\"\"\\\n%(locals_dict)s = MAKE_DICT_EMPTY();\"\"\"\n        % {\"locals_dict\": locals_declaration}\n    )\n\n\ndef generateSetLocalsMappingCode(statement, emit, context):\n    new_locals_name = context.allocateTempName(\"set_locals\")\n\n    generateExpressionCode(\n        to_name=new_locals_name,\n        expression=statement.subnode_new_locals,\n        emit=emit,\n        context=context,\n    )\n\n    locals_declaration = context.addLocalsDictName(\n        statement.getLocalsScope().getCodeName()\n    )\n\n    emit(\n        \"\"\"\\\n%(locals_dict)s = %(locals_value)s;\"\"\"\n        % {\"locals_dict\": locals_declaration, \"locals_value\": new_locals_name}\n    )\n\n    getReferenceExportCode(new_locals_name, emit, context)\n\n    if context.needsCleanup(new_locals_name):\n        context.removeCleanupTempName(new_locals_name)\n\n\ndef generateReleaseLocalsDictCode(statement, emit, context):\n    locals_declaration = context.addLocalsDictName(\n        statement.getLocalsScope().getCodeName()\n    )\n\n    emit(\n        \"\"\"\\\nPy_DECREF(%(locals_dict)s);\n%(locals_dict)s = NULL;\"\"\"\n        % {\"locals_dict\": locals_declaration}\n    )\n\n\ndef generateLocalsDictSetCode(statement, emit, context):\n    value_arg_name = context.allocateTempName(\"dictset_value\", unique=True)\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_source,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    locals_scope = statement.getLocalsDictScope()\n\n    locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n\n    is_dict = locals_scope.hasShapeDictionaryExact()\n\n    res_name = context.getIntResName()\n\n    if is_dict:\n        emit(\n            \"%s = PyDict_SetItem(%s, %s, %s);\"\n            % (\n                res_name,\n                locals_declaration,\n                context.getConstantCode(statement.getVariableName()),\n                value_arg_name,\n            )\n        )\n    else:\n        emit(\n            \"%s = PyObject_SetItem(%s, %s, %s);\"\n            % (\n                res_name,\n                locals_declaration,\n                context.getConstantCode(statement.getVariableName()),\n                value_arg_name,\n            )\n        )\n\n    getErrorExitBoolCode(\n        condition=\"%s != 0\" % res_name,\n        release_name=value_arg_name,\n        needs_check=statement.mayRaiseException(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateLocalsDictDelCode(statement, emit, context):\n    locals_scope = statement.getLocalsDictScope()\n\n    dict_arg_name = locals_scope.getCodeName()\n\n    is_dict = locals_scope.hasShapeDictionaryExact()\n\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    if is_dict:\n        res_name = context.getBoolResName()\n\n        emit(\n            \"%s = DICT_REMOVE_ITEM(%s, %s);\"\n            % (\n                res_name,\n                dict_arg_name,\n                context.getConstantCode(statement.getVariableName()),\n            )\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            needs_check=statement.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n    else:\n        res_name = context.getIntResName()\n\n        emit(\n            \"%s = PyObject_DelItem(%s, %s);\"\n            % (\n                res_name,\n                dict_arg_name,\n                context.getConstantCode(statement.getVariableName()),\n            )\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % res_name,\n            needs_check=statement.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateLocalsDictVariableRefOrFallbackCode(to_name, expression, emit, context):\n    variable_name = expression.getVariableName()\n\n    fallback_emit = SourceCodeCollector()\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"locals_lookup_value\", expression, emit, context\n    ) as value_name:\n        generateExpressionCode(\n            to_name=value_name,\n            expression=expression.subnode_fallback,\n            emit=fallback_emit,\n            context=context,\n        )\n\n        locals_scope = expression.getLocalsDictScope()\n        locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n\n        is_dict = locals_scope.hasShapeDictionaryExact()\n\n        assert not context.needsCleanup(value_name)\n\n        if is_dict:\n            template = template_read_locals_dict_with_fallback\n            fallback_codes = indented(fallback_emit.codes)\n\n            emit(\n                template\n                % {\n                    \"to_name\": value_name,\n                    \"locals_dict\": locals_declaration,\n                    \"fallback\": fallback_codes,\n                    \"var_name\": context.getConstantCode(constant=variable_name),\n                }\n            )\n        else:\n            template = template_read_locals_mapping_with_fallback\n            fallback_codes = indented(fallback_emit.codes, 2)\n\n            emit(\n                template\n                % {\n                    \"to_name\": value_name,\n                    \"locals_dict\": locals_declaration,\n                    \"fallback\": fallback_codes,\n                    \"var_name\": context.getConstantCode(constant=variable_name),\n                    \"exception_exit\": context.getExceptionEscape(),\n                }\n            )\n\n            # If the fallback took no reference, then make it do it\n            # anyway.\n            context.addCleanupTempName(value_name)\n\n\ndef generateLocalsDictVariableRefCode(to_name, expression, emit, context):\n    variable_name = expression.getVariableName()\n    locals_scope = expression.getLocalsDictScope()\n\n    locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n\n    is_dict = locals_scope.hasShapeDictionaryExact()\n\n    if is_dict:\n        template = template_read_locals_dict_without_fallback\n    else:\n        template = template_read_locals_mapping_without_fallback\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"locals_lookup_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            template\n            % {\n                \"to_name\": value_name,\n                \"locals_dict\": locals_declaration,\n                \"var_name\": context.getConstantCode(constant=variable_name),\n            }\n        )\n\n        getNameReferenceErrorCode(\n            variable_name=variable_name,\n            condition=\"%s == NULL && CHECK_AND_CLEAR_KEY_ERROR_OCCURRED(tstate)\"\n            % value_name,\n            emit=emit,\n            context=context,\n        )\n\n        getErrorExitCode(check_name=value_name, emit=emit, context=context)\n\n        if not is_dict:\n            context.addCleanupTempName(value_name)\n\n\ndef generateLocalsDictVariableCheckCode(to_name, expression, emit, context):\n    variable_name = expression.getVariableName()\n\n    locals_scope = expression.getLocalsDictScope()\n\n    locals_declaration = context.addLocalsDictName(locals_scope.getCodeName())\n\n    is_dict = locals_scope.hasShapeDictionaryExact()\n\n    if is_dict:\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name,\n            condition=\"DICT_HAS_ITEM(tstate, %(locals_dict)s, %(var_name)s) == 1\"\n            % {\n                \"locals_dict\": locals_declaration,\n                \"var_name\": context.getConstantCode(constant=variable_name),\n            },\n            emit=emit,\n        )\n    else:\n        tmp_name = context.getIntResName()\n\n        template = \"\"\"\\\n%(tmp_name)s = MAPPING_HAS_ITEM(tstate, %(locals_dict)s, %(var_name)s);\n\"\"\"\n\n        emit(\n            template\n            % {\n                \"locals_dict\": locals_declaration,\n                \"var_name\": context.getConstantCode(constant=variable_name),\n                \"tmp_name\": tmp_name,\n            }\n        )\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % tmp_name,\n            needs_check=expression.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n        to_name.getCType().emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=\"%s == 1\" % tmp_name, emit=emit\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/LoopCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Loop codes.\n\nCode generation for loops, breaking them, or continuing them. In Nuitka, there\nare no for-loops or while-loops at this point. They have been re-formulated in\na simpler loop without a condition, and statements there-in that break under\ncertain conditions.\n\nSee Developer Manual for how the CPython loops are mapped to these nodes.\n\"\"\"\n\nfrom .CodeHelpers import generateStatementSequenceCode\nfrom .ErrorCodes import getErrorExitBoolCode\nfrom .ExceptionCodes import getExceptionUnpublishedReleaseCode\nfrom .LabelCodes import getGotoCode, getLabelCode\n\n\ndef generateLoopBreakCode(statement, emit, context):\n    # Functions used for generation all accept statement, but this one does\n    # not use it. pylint: disable=unused-argument\n\n    getExceptionUnpublishedReleaseCode(emit, context)\n\n    break_target = context.getLoopBreakTarget()\n    getGotoCode(break_target, emit)\n\n\ndef generateLoopContinueCode(statement, emit, context):\n    # Functions used for generation all accept statement, but this one does\n    # not use it. pylint: disable=unused-argument\n\n    getExceptionUnpublishedReleaseCode(emit, context)\n\n    continue_target = context.getLoopContinueTarget()\n    getGotoCode(continue_target, emit)\n\n\ndef generateLoopCode(statement, emit, context):\n    loop_start_label = context.allocateLabel(\"loop_start\")\n\n    if not statement.isStatementAborting():\n        loop_end_label = context.allocateLabel(\"loop_end\")\n    else:\n        loop_end_label = None\n\n    getLabelCode(loop_start_label, emit)\n\n    old_loop_break = context.setLoopBreakTarget(loop_end_label)\n    old_loop_continue = context.setLoopContinueTarget(loop_start_label)\n\n    generateStatementSequenceCode(\n        statement_sequence=statement.subnode_loop_body,\n        allow_none=True,\n        emit=emit,\n        context=context,\n    )\n\n    context.setLoopBreakTarget(old_loop_break)\n    context.setLoopContinueTarget(old_loop_continue)\n\n    # Note: We are using the wrong line here, but it's an exception, it's unclear what line it would be anyway.\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        getErrorExitBoolCode(\n            condition=\"CONSIDER_THREADING(tstate) == false\", emit=emit, context=context\n        )\n\n    getGotoCode(loop_start_label, emit)\n\n    if loop_end_label is not None:\n        getLabelCode(loop_end_label, emit)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/MatchCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for match statement helpers.\n\n\"\"\"\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode\n\n\ndef generateMatchArgsCode(to_name, expression, emit, context):\n    (matched_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"match_args_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = MATCH_CLASS_ARGS(tstate, %s, %d);\"\n            % (value_name, matched_name, expression.max_allowed)\n        )\n\n        getErrorExitCode(\n            check_name=value_name, release_name=matched_name, emit=emit, context=context\n        )\n\n        context.addCleanupTempName(value_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ModuleCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code to generate and interact with compiled module objects.\n\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.__past__ import iterItems\nfrom nuitka.code_generation import Emission\nfrom nuitka.utils.CStrings import encodePythonStringToC\nfrom nuitka.Version import getNuitkaVersion, getNuitkaVersionYear\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateStatementSequenceCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .CodeObjectCodes import getCodeObjectsDeclCode, getCodeObjectsInitCode\nfrom .Indentation import indented\nfrom .templates.CodeTemplatesModules import (\n    template_global_copyright,\n    template_module_body_template,\n    template_module_exception_exit,\n    template_module_external_entry_point,\n    template_module_no_exception_exit,\n)\nfrom .VariableCodes import getVariableReferenceCode\n\n\ndef getModuleAccessCode(context):\n    return \"module_%s\" % context.getModuleCodeName()\n\n\ndef getModuleCode(\n    module, function_decl_codes, function_body_codes, module_const_blob_name, context\n):\n    # For the module code, lots of arguments and attributes come together.\n    # pylint: disable=too-many-locals\n\n    # Temporary variable initializations\n    # TODO: Move that to a place outside of functions.\n    from .FunctionCodes import (\n        finalizeFunctionLocalVariables,\n        setupFunctionLocalVariables,\n    )\n\n    setupFunctionLocalVariables(\n        context=context,\n        parameters=None,\n        closure_variables=(),\n        user_variables=module.getOutlineLocalVariables(),\n        temp_variables=module.getTempVariables(),\n    )\n\n    module_codes = Emission.SourceCodeCollector()\n\n    module = context.getOwner()\n    module_body = module.subnode_body\n\n    generateStatementSequenceCode(\n        statement_sequence=module_body,\n        emit=module_codes,\n        allow_none=True,\n        context=context,\n    )\n\n    for _identifier, code in sorted(iterItems(context.getHelperCodes())):\n        function_body_codes.append(code)\n\n    for _identifier, code in sorted(iterItems(context.getDeclarations())):\n        function_decl_codes.append(code)\n\n    function_body_codes = \"\\n\\n\".join(function_body_codes)\n    function_decl_codes = \"\\n\\n\".join(function_decl_codes)\n\n    _cleanup = finalizeFunctionLocalVariables(context)\n\n    # TODO: Seems like a bug, classes could produce those.\n    # assert not _cleanup, _cleanup\n\n    module_identifier = module.getCodeName()\n\n    if module_body is not None and module_body.mayRaiseException(BaseException):\n        module_exit = template_module_exception_exit % {\n            \"module_identifier\": module_identifier,\n            \"is_top\": 1 if module.isTopModule() else 0,\n        }\n    else:\n        module_exit = template_module_no_exception_exit\n\n    local_var_inits = context.variable_storage.makeCFunctionLevelDeclarations()\n\n    function_table_entries_decl = []\n    for func_impl_identifier in context.getFunctionCreationInfos():\n        function_table_entries_decl.append(\"%s,\" % func_impl_identifier)\n\n    module_name = module.getFullName()\n\n    is_package = module.isCompiledPythonPackage()\n    is_top = module.isTopModule()\n\n    module_identifier = module.getCodeName()\n\n    template = template_global_copyright + template_module_body_template\n\n    if is_top == 1 and Options.shallMakeModule():\n        template += template_module_external_entry_point\n\n    module_code_objects_decl = getCodeObjectsDeclCode(context)\n    module_code_objects_init = getCodeObjectsInitCode(context)\n\n    is_dunder_main = module.isMainModule()\n\n    dunder_main_package = context.getConstantCode(\n        module.getRuntimePackageValue() if is_dunder_main else \"\"\n    )\n\n    return template % {\n        \"module_name_cstr\": encodePythonStringToC(\n            module_name.asString().encode(\"utf8\")\n        ),\n        \"version\": getNuitkaVersion(),\n        \"year\": getNuitkaVersionYear(),\n        \"is_top\": 1 if module.isTopModule() else 0,\n        \"is_dunder_main\": 1 if is_dunder_main else 0,\n        \"dunder_main_package\": dunder_main_package,\n        \"is_package\": 1 if is_package else 0,\n        \"module_identifier\": module_identifier,\n        \"module_functions_decl\": function_decl_codes,\n        \"module_functions_code\": function_body_codes,\n        \"module_function_table_entries\": indented(function_table_entries_decl),\n        \"temps_decl\": indented(local_var_inits),\n        \"module_init_codes\": indented(context.getModuleInitCodes()),\n        \"module_codes\": indented(module_codes.codes),\n        \"module_exit\": module_exit,\n        \"module_code_objects_decl\": indented(module_code_objects_decl, 0),\n        \"module_code_objects_init\": indented(module_code_objects_init, 1),\n        \"constants_count\": context.getConstantsCount(),\n        \"module_const_blob_name\": module_const_blob_name,\n    }\n\n\ndef generateModuleAttributeFileCode(to_name, expression, emit, context):\n    # TODO: Special treatment justified?\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"module_fileattr_value\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = module_filename_obj;\" % result_name)\n\n\ndef generateModuleAttributeCode(to_name, expression, emit, context):\n    getVariableReferenceCode(\n        to_name=to_name,\n        variable=expression.getVariable(),\n        variable_trace=None,\n        needs_check=False,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateNuitkaLoaderCreationCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"nuitka_loader_value\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = Nuitka_Loader_New(loader_entry);\" % result_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/Namify.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Namify constants.\n\nThis determines the identifier names of constants in the generated code. We\ntry to have readable names where possible, and resort to hash codes only when\nit is really necessary.\n\n\"\"\"\n\nimport math\nimport re\nimport sys\nfrom types import BuiltinFunctionType\n\nfrom nuitka.__past__ import GenericAlias, UnionType, long, md5, unicode, xrange\nfrom nuitka.Builtins import builtin_anon_values, builtin_named_values_list\nfrom nuitka.Tracing import general\n\n\nclass ExceptionCannotNamify(Exception):\n    pass\n\n\ndef namifyConstant(constant):\n    # Many branches, statements and every case has a return, this is a huge case\n    # statement, that encodes the naming policy of constants, with often complex\n    # conditions, pylint: disable=too-many-branches,too-many-return-statements,too-many-statements\n\n    constant_type = type(constant)\n\n    if constant_type is int:\n        if constant == 0:\n            result = \"int_0\"\n        elif constant > 0:\n            result = \"int_pos_%d\" % constant\n        else:\n            result = \"int_neg_%d\" % abs(constant)\n\n        if len(result) > 32:\n            result = _digest(result)\n\n        return result\n    elif constant_type is long:\n        if constant == 0:\n            result = \"long_0\"\n        elif constant > 0:\n            result = \"long_pos_%d\" % constant\n        else:\n            result = \"long_neg_%d\" % abs(constant)\n\n        if len(result) > 32:\n            result = _digest(result)\n\n        return result\n    elif constant is None:\n        return \"none\"\n    elif constant is True:\n        return \"true\"\n    elif constant is False:\n        return \"false\"\n    elif constant is Ellipsis:\n        return \"ellipsis\"\n    elif constant_type is str:\n        return \"str_\" + _namifyString(constant)\n    elif constant_type is bytes:\n        return \"bytes_\" + _namifyString(constant)\n    elif constant_type is unicode:\n        if _isAscii(constant):\n            return \"unicode_\" + _namifyString(str(constant))\n        else:\n            # Others are better digested to not cause compiler trouble\n            return \"unicode_digest_\" + _digest(repr(constant))\n    elif constant_type is float:\n        if math.isnan(constant):\n            return \"float_%s_nan\" % (\n                \"minus\" if math.copysign(1, constant) < 0 else \"plus\"\n            )\n\n        return \"float_%s\" % repr(constant).replace(\".\", \"_\").replace(\n            \"-\", \"minus_\"\n        ).replace(\"+\", \"\")\n    elif constant_type is complex:\n        value = \"%s__%s\" % (constant.real, constant.imag)\n\n        value = value.replace(\"+\", \"p\").replace(\"-\", \"m\").replace(\".\", \"_\")\n\n        if value.startswith(\"(\") and value.endswith(\")\"):\n            value = value[1:-1]\n\n        return \"complex_%s\" % value\n    elif constant_type is dict:\n        if constant == {}:\n            return \"dict_empty\"\n        else:\n            return \"dict_\" + _digest(repr(constant))\n    elif constant_type is set:\n        if constant == set():\n            return \"set_empty\"\n        else:\n            return \"set_\" + _digest(repr(constant))\n    elif constant_type is frozenset:\n        if constant == frozenset():\n            return \"frozenset_empty\"\n        else:\n            return \"frozenset_\" + _digest(repr(constant))\n    elif constant_type is tuple:\n        if constant == ():\n            return \"tuple_empty\"\n        else:\n            try:\n                result = \"_\".join(namifyConstant(value) for value in constant)\n\n                if len(result) > 60:\n                    result = _digest(repr(constant))\n\n                return \"tuple_\" + result + \"_tuple\"\n            except ExceptionCannotNamify:\n                general.warning(\"Couldn't namify '%r'\" % (constant,))\n\n                return \"tuple_\" + _digest(repr(constant))\n    elif constant_type is list:\n        if constant == []:\n            return \"list_empty\"\n        else:\n            try:\n                result = \"_\".join(namifyConstant(value) for value in constant)\n\n                if len(result) > 60:\n                    result = _digest(repr(constant))\n\n                return \"list_\" + result + \"_list\"\n            except ExceptionCannotNamify:\n                general.warning(\"Couldn't namify '%r'\" % constant)\n\n                return \"list_\" + _digest(repr(constant))\n    elif constant_type is bytearray:\n        return \"bytearray_\" + _digest(repr(constant))\n    elif constant_type is xrange:\n        return \"xrange_%s\" % (\n            str(constant)[7 if str is bytes else 6 : -1]\n            .replace(\" \", \"\")\n            .replace(\",\", \"_\")\n            .replace(\"-\", \"neg\")\n        )\n    elif constant_type is slice:\n        return \"slice_%s_%s_%s\" % (\n            namifyConstant(constant.start),\n            namifyConstant(constant.stop),\n            namifyConstant(constant.step),\n        )\n    elif constant in builtin_anon_values:\n        return \"anon_%s\" % builtin_anon_values[constant]\n    elif constant_type is type:\n        return \"type_%s\" % constant.__name__\n    elif constant_type is BuiltinFunctionType:\n        assert constant in builtin_named_values_list\n\n        return \"builtin_%s\" % constant.__name__\n    elif constant is NotImplemented:\n        return \"type_notimplemented\"\n    elif constant_type is GenericAlias:\n        return \"genalias_%s_%s\" % (\n            namifyConstant(constant.__origin__),\n            namifyConstant(constant.__args__),\n        )\n    elif constant_type is UnionType:\n        return \"uniontype_%s\" % namifyConstant(constant.__args__)\n    elif constant is sys.version_info:\n        return \"sys_version_info\"\n    else:\n        raise ExceptionCannotNamify(\"%r\" % (constant,), constant_type)\n\n\n_re_str_needs_no_digest = re.compile(r\"^([a-z]|[A-Z]|[0-9]|_){1,40}$\", re.S)\n\n\ndef _namifyString(string):\n    # Many branches case has a return, encodes the naming policy of strings\n    # constants, with often complex decisions to make, pylint: disable=too-many-return-statements\n\n    if string in (\"\", b\"\"):\n        return \"empty\"\n    elif string in (\"\\0\", b\"\\0\"):\n        return \"null\"\n    elif string == \" \":\n        return \"space\"\n    elif string == \".\":\n        return \"dot\"\n    elif string == \"\\n\":\n        return \"newline\"\n    elif string == \"/\":\n        return \"slash\"\n    elif string == \"\\\\\":\n        return \"backslash\"\n    elif string == \"_\":\n        return \"underscore\"\n    elif (\n        type(string) is str\n        and _re_str_needs_no_digest.match(string)\n        and \"\\n\" not in string\n    ):\n        # Some strings can be left intact for source code readability.\n        return \"plain_\" + string\n    elif len(string) == 1:\n        return \"chr_%d\" % ord(string)\n    elif (\n        len(string) > 2\n        and string[0] == \"<\"\n        and string[-1] == \">\"\n        and _re_str_needs_no_digest.match(string[1:-1])\n        and \"\\n\" not in string\n    ):\n        return \"angle_\" + string[1:-1]\n    else:\n        # Others are better digested to not cause compiler trouble\n        return \"digest_\" + _digest(repr(string))\n\n\ndef _isAscii(string):\n    try:\n        _unused = str(string)\n\n        return True\n    except UnicodeEncodeError:\n        return False\n\n\ndef _digest(value):\n    if str is bytes:\n        # Python2 is simple\n        return md5(value).hexdigest()\n    else:\n        # Python3 needs to encode the string if it is one.\n        if type(value) is bytes:\n            return md5(value).hexdigest()\n        else:\n            return md5(value.encode(\"utf8\")).hexdigest()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/OperationCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Codes for operations.\n\nThere are unary and binary operations. Many of them have specializations and\nof course types could play into it. Then there is also the added difficulty of\nin-place assignments, which have other operation variants.\n\"\"\"\n\nfrom nuitka.nodes.shapes.StandardShapes import tshape_unknown\n\nfrom .BinaryOperationHelperDefinitions import (\n    getCodeNameForBinaryOperation,\n    getNonSpecializedBinaryOperations,\n    getSpecializedBinaryOperations,\n)\nfrom .c_types.CTypeBooleans import CTypeBool\nfrom .c_types.CTypeNuitkaBooleans import CTypeNuitkaBoolEnum\nfrom .c_types.CTypeNuitkaVoids import CTypeNuitkaVoidEnum\nfrom .c_types.CTypePyObjectPointers import CTypePyObjectPtr\nfrom .c_types.CTypeVoids import CTypeVoid\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .CodeHelperSelection import selectCodeHelper\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getReleaseCodes,\n    getTakeReferenceCode,\n)\nfrom .ExpressionCTypeSelectionHelpers import decideExpressionCTypes\n\n\ndef generateOperationBinaryCode(to_name, expression, emit, context):\n    _getBinaryOperationCode(\n        to_name=to_name,\n        operator=expression.getOperator(),\n        inplace=expression.isInplaceSuspect(),\n        needs_check=expression.mayRaiseExceptionOperation(),\n        left=expression.subnode_left,\n        right=expression.subnode_right,\n        source_ref=expression.source_ref,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOperationNotCode(to_name, expression, emit, context):\n    # TODO: We badly need to support target boolean C type here, or else an object is created from the argument.\n    (arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    res_name = context.getIntResName()\n\n    emit(\"%s = CHECK_IF_TRUE(%s);\" % (res_name, arg_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_name=arg_name,\n        needs_check=expression.subnode_operand.mayRaiseExceptionBool(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name, condition=\"%s == 0\" % res_name, emit=emit\n    )\n\n\ndef generateOperationUnaryCode(to_name, expression, emit, context):\n    (arg_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    _getUnaryOperationCode(\n        to_name=to_name,\n        expression=expression,\n        operator=expression.getOperator(),\n        arg_name=arg_name,\n        needs_check=expression.mayRaiseException(BaseException),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getBinaryOperationCode(\n    to_name, operator, inplace, left, right, needs_check, source_ref, emit, context\n):\n    # This is detail rich stuff, encoding the complexity of what helpers are\n    # available, and can be used as a fallback.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n    (\n        _unknown_types,\n        needs_argument_swap,\n        left_shape,\n        right_shape,\n        left_c_type,\n        right_c_type,\n    ) = decideExpressionCTypes(\n        left=left,\n        right=right,\n        may_swap_arguments=(\n            \"never\"\n            if inplace\n            else (\n                \"number\"\n                if operator in (\"Add\", \"Mult\", \"BitOr\", \"BitAnd\", \"BitXor\")\n                else \"never\"\n            )\n        ),\n    )\n\n    prefix = \"%s_OPERATION_%s\" % (\n        \"INPLACE\" if operator[0] == \"I\" else \"BINARY\",\n        getCodeNameForBinaryOperation(operator),\n    )\n\n    specialized_helpers_set = getSpecializedBinaryOperations(operator)\n    non_specialized_helpers_set = getNonSpecializedBinaryOperations(operator)\n\n    report_missing = True\n\n    helper_type = target_type = None if operator[0] == \"I\" else to_name.getCType()\n\n    if helper_type is not None:\n        if needs_check and helper_type is not None:\n            # If an exception may occur, we do not have the \"NVOID\" helpers though, we\n            # instead can use the CTypeNuitkaBoolEnum that will easily convert to\n            # it.\n\n            if helper_type is CTypeNuitkaVoidEnum:\n                helper_type = CTypeNuitkaBoolEnum\n                report_missing = False\n        else:\n            # If no exception may occur, we do not have the \"VOID\" helpers though, we\n            # instead can use the CTypeBool that will easily convert to it.\n\n            # If no exception can occur, do not require a helper that can indicate\n            # it, but use the one that produces simpler code, this means we can\n            # avoid the CTypeNuitkaBoolEnum (NBOOL) helpers except for things that\n            # can really raise. Once we have expression for types depending on the\n            # value to raise or not, this will get us into trouble, due to using a\n            # fallback\n\n            # TODO: For now to achieve old behavior, we are going to change to\n            # CBOOL for those that cannot raise later.\n            if helper_type is CTypeVoid:\n                helper_type = CTypeNuitkaBoolEnum\n            # helper_type = CTypeBool\n            report_missing = False\n\n    # If a more specific C type was picked that \"PyObject *\" then we can use that to have the helper.\n    helper_type, helper_function = selectCodeHelper(\n        prefix=prefix,\n        specialized_helpers_set=specialized_helpers_set,\n        non_specialized_helpers_set=non_specialized_helpers_set,\n        result_type=helper_type,\n        left_shape=left_shape,\n        right_shape=right_shape,\n        left_c_type=left_c_type,\n        right_c_type=right_c_type,\n        argument_swap=needs_argument_swap,\n        report_missing=report_missing,\n        source_ref=source_ref,\n    )\n\n    # If we failed to find CTypeBool, that should be OK.\n    if helper_function is None and target_type is CTypeBool:\n        helper_type, helper_function = selectCodeHelper(\n            prefix=prefix,\n            specialized_helpers_set=specialized_helpers_set,\n            non_specialized_helpers_set=non_specialized_helpers_set,\n            result_type=CTypeNuitkaBoolEnum,\n            left_shape=left_shape,\n            right_shape=right_shape,\n            left_c_type=left_c_type,\n            right_c_type=right_c_type,\n            argument_swap=needs_argument_swap,\n            report_missing=True,\n            source_ref=source_ref,\n        )\n\n    if helper_function is None:\n        # Give up and warn about it.\n        left_c_type = CTypePyObjectPtr\n        right_c_type = CTypePyObjectPtr\n\n        helper_type, helper_function = selectCodeHelper(\n            prefix=prefix,\n            specialized_helpers_set=specialized_helpers_set,\n            non_specialized_helpers_set=non_specialized_helpers_set,\n            result_type=CTypePyObjectPtr if helper_type is not None else None,\n            left_shape=tshape_unknown,\n            right_shape=tshape_unknown,\n            left_c_type=left_c_type,\n            right_c_type=right_c_type,\n            argument_swap=False,\n            report_missing=True,\n            source_ref=source_ref,\n        )\n\n        assert helper_function is not None, (left, right)\n\n    left_name = context.allocateTempName(\n        \"%s_expr_left\" % operator.lower(), type_name=left_c_type.c_type\n    )\n    right_name = context.allocateTempName(\n        \"%s_expr_right\" % operator.lower(), type_name=right_c_type.c_type\n    )\n\n    generateExpressionCode(\n        to_name=left_name, expression=left, emit=emit, context=context\n    )\n    generateExpressionCode(\n        to_name=right_name, expression=right, emit=emit, context=context\n    )\n\n    # We must assume to write to a variable if \"inplace\" is active, not e.g.\n    # a constant reference. That was asserted before calling us.\n    if inplace or \"INPLACE\" in helper_function:\n        assert not needs_argument_swap\n\n        res_name = context.getBoolResName()\n\n        # For module variable C type to reference later.\n        if left.isExpressionVariableRef() and left.getVariable().isModuleVariable():\n            emit(\"%s = %s;\" % (context.getInplaceLeftName(), left_name))\n\n        if not left.isExpressionVariableRefOrTempVariableRef():\n            if not context.needsCleanup(left_name):\n                getTakeReferenceCode(left_name, emit)\n\n        emit(\"%s = %s(&%s, %s);\" % (res_name, helper_function, left_name, right_name))\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            release_names=(left_name, right_name),\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n        emit(\"%s = %s;\" % (to_name, left_name))\n\n        if not left.isExpressionVariableRefOrTempVariableRef():\n            context.addCleanupTempName(to_name)\n    else:\n        if needs_argument_swap:\n            arg1_name = right_name\n            arg2_name = left_name\n        else:\n            arg1_name = left_name\n            arg2_name = right_name\n\n        # May need to convert return value.\n        if helper_type is not target_type:\n            value_name = context.allocateTempName(\n                to_name.code_name + \"_\" + helper_type.helper_code.lower(),\n                type_name=helper_type.c_type,\n                unique=to_name.code_name == \"tmp_unused\",\n            )\n        else:\n            value_name = to_name\n\n        emit(\n            \"%s = %s(%s, %s);\"\n            % (\n                value_name,\n                helper_function,\n                arg1_name,\n                arg2_name,\n            )\n        )\n\n        if value_name.getCType().hasErrorIndicator():\n            getErrorExitCode(\n                check_name=value_name,\n                release_names=(left_name, right_name),\n                needs_check=needs_check,\n                emit=emit,\n                context=context,\n            )\n        else:\n            # Otherwise we picked the wrong kind of helper.\n            assert not needs_check, value_name.getCType()\n\n            getReleaseCodes(\n                release_names=(left_name, right_name), emit=emit, context=context\n            )\n\n        # TODO: Depending on operation, we could not produce a reference, if result *must*\n        # be boolean, but then we would have some helpers that do it, and some that do not\n        # do it.\n        if helper_type is CTypePyObjectPtr:\n            context.addCleanupTempName(value_name)\n\n        if value_name is not to_name:\n            target_type.emitAssignConversionCode(\n                to_name=to_name,\n                value_name=value_name,\n                # TODO: Right now we don't do conversions here that could fail.\n                needs_check=False,\n                emit=emit,\n                context=context,\n            )\n\n\nunary_operator_codes = {\n    \"UAdd\": (\"PyNumber_Positive\", 1),\n    \"USub\": (\"PyNumber_Negative\", 1),\n    \"Invert\": (\"PyNumber_Invert\", 1),\n    \"Repr\": (\"PyObject_Repr\", 1),\n    \"Not\": (\"UNARY_NOT\", 0),\n}\n\n\ndef _getUnaryOperationCode(\n    to_name, expression, operator, arg_name, needs_check, emit, context\n):\n    impl_helper, ref_count = unary_operator_codes[operator]\n\n    helper = \"UNARY_OPERATION\"\n    prefix_args = (impl_helper,)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"op_%s_res\" % operator.lower(), expression, emit, context\n    ) as value_name:\n        emit(\n            \"%s = %s(%s);\"\n            % (\n                value_name,\n                helper,\n                \", \".join(str(arg_name) for arg_name in prefix_args + (arg_name,)),\n            )\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_name=arg_name,\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n        if ref_count:\n            context.addCleanupTempName(value_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/PackageResourceCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Code generation for package resources access.\"\"\"\n\nfrom nuitka.Options import shallMakeModule\n\nfrom .CallCodes import (\n    getCallCodeKwPairs,\n    getCallCodeKwSplit,\n    getCallCodeNoArgs,\n    getCallCodePosArgsQuick,\n)\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateChildExpressionCode,\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ConstantCodes import addDistributionMetadataValue\nfrom .DictCodes import getDictionaryCreationCode\nfrom .ErrorCodes import getErrorExitCode\nfrom .ImportCodes import getImportModuleNameHardCode\nfrom .PythonAPICodes import generateCAPIObjectCode\nfrom .TupleCodes import getTupleCreationCode\n\n\ndef generatePkglibGetDataCallCode(to_name, expression, emit, context):\n    package_name, resource_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"get_data_value\", expression, emit, context\n    ) as result_name:\n        # TODO: Have global cached forms of hard attribute lookup results too.\n        get_data_function = context.allocateTempName(\"get_data_function\", unique=True)\n\n        getImportModuleNameHardCode(\n            to_name=get_data_function,\n            module_name=\"pkgutil\",\n            import_name=\"get_data\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=get_data_function,\n            expression=expression,\n            arg_names=(package_name, resource_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesDistributionValueCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"distribution_value\", expression, emit, context\n    ) as result_name:\n        distribution_class_name = context.allocateTempName(\n            \"distribution_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=distribution_class_name,\n            module_name=\"pkg_resources\",\n            import_name=\"Distribution\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        kw_names = expression.__class__.preserved_attributes\n        dict_value_names = [\n            context.getConstantCode(getattr(expression.distribution, kw_name))\n            for kw_name in kw_names\n        ]\n\n        # Standalone mode, has a different location.\n        if \"location\" not in kw_names:\n            kw_names += (\"location\",)\n        dict_value_names.append(\n            'LOOKUP_BUILTIN_STR(\"__nuitka_binary_dir\")',\n        )\n\n        getCallCodeKwSplit(\n            to_name=result_name,\n            called_name=distribution_class_name,\n            kw_names=kw_names,\n            dict_value_names=dict_value_names,\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataEntryPointsSince310CallCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entrypoints_value\", expression, emit, context\n    ) as result_name:\n        entry_points_function_name = context.allocateTempName(\n            \"importlib_metadata_entry_points_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_points_function_name,\n            module_name=\"importlib.metadata\",\n            import_name=\"entry_points\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodeKwPairs(\n            to_name=result_name,\n            expression=expression,\n            pairs=expression.subnode_params,\n            called_name=entry_points_function_name,\n            called_attribute_name=None,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataBackportEntryPointsCallCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entrypoints_value\", expression, emit, context\n    ) as result_name:\n        entry_points_function_name = context.allocateTempName(\n            \"importlib_metadata_backport_entry_points_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_points_function_name,\n            module_name=\"importlib_metadata\",\n            import_name=\"entry_points\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodeKwPairs(\n            to_name=result_name,\n            expression=expression,\n            pairs=expression.subnode_params,\n            called_name=entry_points_function_name,\n            called_attribute_name=None,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataDistributionValueCode(to_name, expression, emit, context):\n    distribution = expression.distribution\n    original_name = expression.original_name\n\n    addDistributionMetadataValue(name=original_name, distribution=distribution)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"distribution_value\", expression, emit, context\n    ) as value_name:\n        emit(\n            \"\"\"%(to_name)s = Nuitka_Distribution_New(tstate, %(name)s);\"\"\"\n            % {\n                \"to_name\": value_name,\n                \"name\": context.getConstantCode(original_name),\n            }\n        )\n\n        getErrorExitCode(check_name=value_name, emit=emit, context=context)\n\n        context.addCleanupTempName(value_name)\n\n\ndef generatePkgResourcesEntryPointValueCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entry_point_value\", expression, emit, context\n    ) as result_name:\n        entry_point_class_name = context.allocateTempName(\n            \"entry_point_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_point_class_name,\n            module_name=\"pkg_resources\",\n            import_name=\"EntryPoint\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        kw_names = expression.__class__.preserved_attributes\n        dict_value_names = [\n            context.getConstantCode(getattr(expression.entry_point, kw_name))\n            for kw_name in kw_names\n        ]\n\n        getCallCodeKwSplit(\n            to_name=result_name,\n            called_name=entry_point_class_name,\n            kw_names=kw_names,\n            dict_value_names=dict_value_names,\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataEntryPointValueCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entry_point_value\", expression, emit, context\n    ) as result_name:\n        entry_point_class_name = context.allocateTempName(\n            \"entry_point_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_point_class_name,\n            module_name=\"importlib.metadata\",\n            import_name=\"EntryPoint\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        kw_names = expression.__class__.preserved_attributes\n        dict_value_names = [\n            context.getConstantCode(getattr(expression.entry_point, kw_name))\n            for kw_name in kw_names\n        ]\n\n        getCallCodeKwSplit(\n            to_name=result_name,\n            called_name=entry_point_class_name,\n            kw_names=kw_names,\n            dict_value_names=dict_value_names,\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataBackportEntryPointValueCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entry_point_value\", expression, emit, context\n    ) as result_name:\n        entry_point_class_name = context.allocateTempName(\n            \"backport_entry_point_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_point_class_name,\n            module_name=\"importlib_metadata\",\n            import_name=\"EntryPoint\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        kw_names = expression.__class__.preserved_attributes\n        dict_value_names = [\n            context.getConstantCode(getattr(expression.entry_point, kw_name))\n            for kw_name in kw_names\n        ]\n\n        getCallCodeKwSplit(\n            to_name=result_name,\n            called_name=entry_point_class_name,\n            kw_names=kw_names,\n            dict_value_names=dict_value_names,\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataSelectableGroupsValueCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"selectable_groups_value\", expression, emit, context\n    ) as result_name:\n        selectable_group_class_name = context.allocateTempName(\n            \"selectable_groups_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=selectable_group_class_name,\n            module_name=\"importlib.metadata\",\n            import_name=\"SelectableGroups\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        selectable_group_dict = context.allocateTempName(\"selectable_group_dict\")\n\n        getDictionaryCreationCode(\n            to_name=selectable_group_dict,\n            pairs=expression.subnode_pairs,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=selectable_group_class_name,\n            expression=expression,\n            arg_names=(selectable_group_dict,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataBackportSelectableGroupsValueCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"selectable_groups_value\", expression, emit, context\n    ) as result_name:\n        selectable_group_class_name = context.allocateTempName(\n            \"backport_selectable_groups_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=selectable_group_class_name,\n            module_name=\"importlib_metadata\",\n            import_name=\"SelectableGroups\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        selectable_group_dict = context.allocateTempName(\"selectable_group_dict\")\n\n        getDictionaryCreationCode(\n            to_name=selectable_group_dict,\n            pairs=expression.subnode_pairs,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=selectable_group_class_name,\n            expression=expression,\n            arg_names=(selectable_group_dict,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataEntryPointsValueCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entry_points_class_value\", expression, emit, context\n    ) as result_name:\n        entry_points_class_name = context.allocateTempName(\n            \"entry_points_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_points_class_name,\n            module_name=\"importlib.metadata\",\n            import_name=\"EntryPoints\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        selectable_group_tuple = context.allocateTempName(\"selectable_group_dict\")\n\n        getTupleCreationCode(\n            to_name=selectable_group_tuple,\n            elements=expression.subnode_elements,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=entry_points_class_name,\n            expression=expression,\n            arg_names=(selectable_group_tuple,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataBackportEntryPointsValueCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"entry_points_class_value\", expression, emit, context\n    ) as result_name:\n        entry_points_class_name = context.allocateTempName(\n            \"backport_entry_points_class\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=entry_points_class_name,\n            module_name=\"importlib_metadata\",\n            import_name=\"EntryPoints\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        selectable_group_tuple = context.allocateTempName(\"selectable_group_dict\")\n\n        getTupleCreationCode(\n            to_name=selectable_group_tuple,\n            elements=expression.subnode_elements,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=entry_points_class_name,\n            expression=expression,\n            arg_names=(selectable_group_tuple,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesRequireCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"require_value\", expression, emit, context\n    ) as result_name:\n        (requirement_arg_names,) = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        require_function_name = context.allocateTempName(\n            \"require_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=require_function_name,\n            module_name=\"pkg_resources\",\n            import_name=\"require\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=require_function_name,\n            expression=expression,\n            arg_names=requirement_arg_names,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesGetDistributionCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"get_distribution_value\", expression, emit, context\n    ) as result_name:\n        (dist_arg_name,) = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        get_distribution_function_name = context.allocateTempName(\n            \"get_distribution_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=get_distribution_function_name,\n            module_name=\"pkg_resources\",\n            import_name=\"get_distribution\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=get_distribution_function_name,\n            expression=expression,\n            arg_names=(dist_arg_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesIterEntryPointsCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"iter_entry_points_value\", expression, emit, context\n    ) as result_name:\n        group_arg_name, name_arg_name = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        iter_entry_points_function_name = context.allocateTempName(\n            \"iter_entry_points_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=iter_entry_points_function_name,\n            module_name=\"pkg_resources\",\n            import_name=\"iter_entry_points\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=iter_entry_points_function_name,\n            expression=expression,\n            arg_names=(\n                (\n                    group_arg_name,\n                    name_arg_name,\n                )\n                if name_arg_name is not None\n                else (group_arg_name,)\n            ),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataVersionCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"version_value\", expression, emit, context\n    ) as result_name:\n        (dist_arg_name,) = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        version_function_name = context.allocateTempName(\n            \"importlib_metadata_version_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=version_function_name,\n            module_name=\"importlib.metadata\",\n            import_name=\"version\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=version_function_name,\n            expression=expression,\n            arg_names=(dist_arg_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataBackportVersionCallCode(\n    to_name, expression, emit, context\n):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"version_value\", expression, emit, context\n    ) as result_name:\n        (dist_arg_name,) = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        version_function_name = context.allocateTempName(\n            \"importlib_metadata_backport_version_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=version_function_name,\n            module_name=\"importlib_metadata\",\n            import_name=\"version\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=version_function_name,\n            expression=expression,\n            arg_names=(dist_arg_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibMetadataDistributionCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"distribution_value\", expression, emit, context\n    ) as result_name:\n        (dist_arg_name,) = generateChildExpressionsCode(\n            expression=expression, emit=emit, context=context\n        )\n\n        get_distribution_function_name = context.allocateTempName(\n            \"distribution_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=get_distribution_function_name,\n            module_name=expression.importlib_metadata_name,\n            import_name=\"distribution\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=get_distribution_function_name,\n            expression=expression,\n            arg_names=(dist_arg_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesResourceStringCallCode(to_name, expression, emit, context):\n    package_name, resource_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"resource_string_value\", expression, emit, context\n    ) as result_name:\n        resource_string_function = context.allocateTempName(\n            \"resource_string_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=resource_string_function,\n            module_name=\"pkg_resources\",\n            import_name=\"resource_string\",\n            needs_check=not shallMakeModule(),\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=resource_string_function,\n            expression=expression,\n            arg_names=(package_name, resource_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibResourcesReadBinaryCallCode(to_name, expression, emit, context):\n    package_name, resource_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"read_binary_value\", expression, emit, context\n    ) as result_name:\n        read_binary_function = context.allocateTempName(\n            \"read_binary_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=read_binary_function,\n            module_name=\"importlib.resources\",\n            import_name=\"read_binary\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=read_binary_function,\n            expression=expression,\n            arg_names=(package_name, resource_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibResourcesReadTextCallCode(to_name, expression, emit, context):\n    (\n        package_name,\n        resource_name,\n        encoding_name,\n        errors_name,\n    ) = generateChildExpressionsCode(expression=expression, emit=emit, context=context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"read_text_value\", expression, emit, context\n    ) as result_name:\n        read_text_function = context.allocateTempName(\"read_text_function\", unique=True)\n\n        getImportModuleNameHardCode(\n            to_name=read_text_function,\n            module_name=\"importlib.resources\",\n            import_name=\"read_text\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=read_text_function,\n            expression=expression,\n            arg_names=(package_name, resource_name, encoding_name, errors_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateImportlibResourcesFilesCallCode(to_name, expression, emit, context):\n    package_name = generateChildExpressionCode(\n        expression=expression.getPackageNameUsed(),\n        child_name=\"package_name\",\n        emit=emit,\n        context=context,\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"files_value\", expression, emit, context\n    ) as result_name:\n        files_function = context.allocateTempName(\"files_function\", unique=True)\n\n        getImportModuleNameHardCode(\n            to_name=files_function,\n            module_name=expression.importlib_resources_name,\n            import_name=\"files\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=files_function,\n            expression=expression,\n            arg_names=(package_name,),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePkgResourcesResourceStreamCallCode(to_name, expression, emit, context):\n    package_name, resource_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"resource_stream_value\", expression, emit, context\n    ) as result_name:\n        resource_stream_function = context.allocateTempName(\n            \"resource_stream_function\", unique=True\n        )\n\n        getImportModuleNameHardCode(\n            to_name=resource_stream_function,\n            module_name=\"pkg_resources\",\n            import_name=\"resource_stream\",\n            needs_check=not shallMakeModule(),\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodePosArgsQuick(\n            to_name=result_name,\n            called_name=resource_stream_function,\n            expression=expression,\n            arg_names=(package_name, resource_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateOsUnameCallCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"os_uname_value\", expression, emit, context\n    ) as result_name:\n        os_uname_function = context.allocateTempName(\"os_uname_function\", unique=True)\n\n        getImportModuleNameHardCode(\n            to_name=os_uname_function,\n            module_name=\"os\",\n            import_name=\"uname\",\n            needs_check=False,\n            emit=emit,\n            context=context,\n        )\n\n        getCallCodeNoArgs(\n            to_name=result_name,\n            called_name=os_uname_function,\n            expression=expression,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateOsPathExistsCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_FILE_EXISTS\",\n        tstate=True,\n        arg_desc=((\"exists_arg\", expression.subnode_path),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathIsfileCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_FILE_ISFILE\",\n        tstate=True,\n        arg_desc=((\"isfile_arg\", expression.subnode_path),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathIsdirCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_FILE_ISDIR\",\n        tstate=True,\n        arg_desc=((\"isdir_arg\", expression.subnode_path),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathBasenameCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_BASENAME\",\n        tstate=True,\n        arg_desc=((\"path_arg\", expression.subnode_p),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathDirnameCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_DIRNAME\",\n        tstate=True,\n        arg_desc=((\"path_arg\", expression.subnode_p),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathAbspathCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_ABSPATH\",\n        tstate=True,\n        arg_desc=((\"path_arg\", expression.subnode_path),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsPathIsabsCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_PATH_ISABS\",\n        tstate=True,\n        arg_desc=((\"path_arg\", expression.subnode_s),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateOsListdirCallCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"OS_LISTDIR\",\n        tstate=True,\n        arg_desc=((\"path_arg\", expression.subnode_path),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/PrintCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Print related codes.\n\nThis is broken down to to level on printing one individual item, and\na new line potentially. The heavy lifting for 'softspace', etc. is\nhappening in the C helper functions.\n\n\"\"\"\n\nfrom .CodeHelpers import generateExpressionCode\nfrom .ErrorCodes import getErrorExitBoolCode\n\n\ndef generatePrintValueCode(statement, emit, context):\n    destination = statement.subnode_dest\n    value = statement.subnode_value\n\n    if destination is not None:\n        dest_name = context.allocateTempName(\"print_dest\", unique=True)\n\n        generateExpressionCode(\n            expression=destination, to_name=dest_name, emit=emit, context=context\n        )\n    else:\n        dest_name = None\n\n    value_name = context.allocateTempName(\"print_value\", unique=True)\n\n    generateExpressionCode(\n        expression=value, to_name=value_name, emit=emit, context=context\n    )\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        res_name = context.getBoolResName()\n\n        if dest_name is not None:\n            print_code = \"%s = PRINT_ITEM_TO(%s, %s);\" % (\n                res_name,\n                dest_name,\n                value_name,\n            )\n        else:\n            print_code = \"%s = PRINT_ITEM(%s);\" % (res_name, value_name)\n\n        emit(print_code)\n\n        getErrorExitBoolCode(\n            condition=\"%s == false\" % res_name,\n            release_names=(dest_name, value_name),\n            emit=emit,\n            context=context,\n        )\n\n\ndef generatePrintNewlineCode(statement, emit, context):\n    destination = statement.subnode_dest\n\n    if destination is not None:\n        dest_name = context.allocateTempName(\"print_dest\", unique=True)\n\n        generateExpressionCode(\n            expression=destination, to_name=dest_name, emit=emit, context=context\n        )\n    else:\n        dest_name = None\n\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        if dest_name is not None:\n            print_code = \"PRINT_NEW_LINE_TO(%s) == false\" % (dest_name,)\n        else:\n            print_code = \"PRINT_NEW_LINE() == false\"\n\n        getErrorExitBoolCode(\n            condition=print_code, release_name=dest_name, emit=emit, context=context\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/PythonAPICodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for standard CPython/API calls.\n\nThis is generic stuff, geared at calling functions that accept Python objects\nand return Python objects. As these all work in a similar way, it makes sense\nto concentrate the best way to do to make those calls here.\n\nAlso, many Nuitka helper codes turn out to be very similar to Python C/API\nand then can use the same code.\n\"\"\"\n\nfrom .CodeHelpers import generateExpressionCode\nfrom .ErrorCodes import (\n    getErrorExitBoolCode,\n    getErrorExitCode,\n    getReleaseCode,\n    getReleaseCodes,\n)\n\n\ndef makeArgDescFromExpression(expression):\n    \"\"\"Helper for providing arg_desc consistently for generateCAPIObject methods.\"\"\"\n\n    return tuple(\n        (child_name + \"_value\", child_value)\n        for child_name, child_value in expression.getVisitableNodesNamed()\n    )\n\n\ndef generateCAPIObjectCodeCommon(\n    to_name,\n    capi,\n    tstate,\n    arg_desc,\n    may_raise,\n    conversion_check,\n    ref_count,\n    source_ref,\n    emit,\n    context,\n    none_null=False,\n):\n    arg_names = []\n\n    if tstate:\n        arg_names.append(\"tstate\")\n\n    for arg_name, arg_expression in arg_desc:\n        if arg_expression is None and none_null:\n            arg_names.append(\"NULL\")\n        else:\n            arg_name = context.allocateTempName(arg_name)\n\n            generateExpressionCode(\n                to_name=arg_name,\n                expression=arg_expression,\n                emit=emit,\n                context=context,\n            )\n\n            arg_names.append(arg_name)\n\n    context.setCurrentSourceCodeReference(source_ref)\n\n    getCAPIObjectCode(\n        to_name=to_name,\n        capi=capi,\n        arg_names=arg_names,\n        may_raise=may_raise,\n        conversion_check=conversion_check,\n        ref_count=ref_count,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateCAPIObjectCode(\n    to_name,\n    capi,\n    tstate,\n    arg_desc,\n    may_raise,\n    conversion_check,\n    source_ref,\n    emit,\n    context,\n    none_null=False,\n):\n    generateCAPIObjectCodeCommon(\n        to_name=to_name,\n        capi=capi,\n        tstate=tstate,\n        arg_desc=arg_desc,\n        may_raise=may_raise,\n        conversion_check=conversion_check,\n        ref_count=1,\n        source_ref=source_ref,\n        emit=emit,\n        context=context,\n        none_null=none_null,\n    )\n\n\ndef generateCAPIObjectCode0(\n    to_name,\n    capi,\n    tstate,\n    arg_desc,\n    may_raise,\n    conversion_check,\n    source_ref,\n    emit,\n    context,\n    none_null=False,\n):\n    generateCAPIObjectCodeCommon(\n        to_name=to_name,\n        capi=capi,\n        tstate=tstate,\n        arg_desc=arg_desc,\n        may_raise=may_raise,\n        conversion_check=conversion_check,\n        ref_count=0,\n        source_ref=source_ref,\n        emit=emit,\n        context=context,\n        none_null=none_null,\n    )\n\n\ndef getCAPIObjectCode(\n    to_name, capi, arg_names, may_raise, conversion_check, ref_count, emit, context\n):\n    release_names = tuple(\n        arg_name for arg_name in arg_names if arg_name not in (\"NULL\", \"tstate\")\n    )\n\n    if to_name is not None:\n        # TODO: Use context manager here too.\n        if to_name.c_type == \"PyObject *\":\n            value_name = to_name\n        else:\n            value_name = context.allocateTempName(\"capi_result\")\n\n        emit(\n            \"%s = %s(%s);\"\n            % (value_name, capi, \", \".join(str(arg_name) for arg_name in arg_names))\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_names=release_names,\n            needs_check=may_raise,\n            emit=emit,\n            context=context,\n        )\n\n        if ref_count:\n            context.addCleanupTempName(value_name)\n\n        if to_name is not value_name:\n            to_name.getCType().emitAssignConversionCode(\n                to_name=to_name,\n                value_name=value_name,\n                needs_check=conversion_check,\n                emit=emit,\n                context=context,\n            )\n\n            if ref_count:\n                getReleaseCode(value_name, emit, context)\n    else:\n        if may_raise:\n            res_name = context.getIntResName()\n\n            emit(\n                \"%s = %s(%s);\"\n                % (res_name, capi, \", \".join(str(arg_name) for arg_name in arg_names))\n            )\n\n            getErrorExitBoolCode(\n                condition=\"%s == -1\" % res_name,\n                release_names=release_names,\n                emit=emit,\n                context=context,\n            )\n        else:\n            emit(\"%s(%s);\" % (capi, \", \".join(str(arg_name) for arg_name in arg_names)))\n\n            getReleaseCodes(release_names, emit, context)\n\n        assert not ref_count\n\n\ndef getReferenceExportCode(base_name, emit, context):\n    if not context.needsCleanup(base_name):\n        emit(\"Py_INCREF(%s);\" % base_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/RaisingCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for implicit and explicit exception raises.\n\nExceptions from other operations are consider ErrorCodes domain.\n\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getFrameVariableTypeDescriptionCode\nfrom .LabelCodes import getGotoCode\nfrom .LineNumberCodes import (\n    emitErrorLineNumberUpdateCode,\n    getErrorLineNumberUpdateCode,\n)\nfrom .PythonAPICodes import getReferenceExportCode\n\n\ndef generateReraiseCode(statement, emit, context):\n    with context.withCurrentSourceCodeReference(\n        value=statement.getCompatibleSourceReference()\n    ):\n        getReRaiseExceptionCode(emit=emit, context=context)\n\n\ndef generateRaiseCode(statement, emit, context):\n    exception_type = statement.subnode_exception_type\n    exception_value = statement.subnode_exception_value\n    exception_tb = statement.subnode_exception_trace\n    exception_cause = statement.subnode_exception_cause\n\n    # Exception cause is only possible with simple raise form.\n    if exception_cause is not None:\n        assert exception_type is not None\n        assert exception_value is None\n        assert exception_tb is None\n\n        raise_type_name = context.allocateTempName(\"raise_type\")\n\n        generateExpressionCode(\n            to_name=raise_type_name,\n            expression=exception_type,\n            emit=emit,\n            context=context,\n        )\n\n        raise_cause_name = context.allocateTempName(\"raise_cause\")\n\n        generateExpressionCode(\n            to_name=raise_cause_name,\n            expression=exception_cause,\n            emit=emit,\n            context=context,\n        )\n\n        with context.withCurrentSourceCodeReference(\n            exception_cause.getSourceReference()\n        ):\n            _getRaiseExceptionWithCauseCode(\n                raise_type_name=raise_type_name,\n                raise_cause_name=raise_cause_name,\n                emit=emit,\n                context=context,\n            )\n    elif exception_type is None:\n        assert False, statement\n    elif exception_value is None and exception_tb is None:\n        raise_type_name = context.allocateTempName(\"raise_type\")\n\n        generateExpressionCode(\n            to_name=raise_type_name,\n            expression=exception_type,\n            emit=emit,\n            context=context,\n        )\n\n        with context.withCurrentSourceCodeReference(\n            value=exception_type.getCompatibleSourceReference()\n        ):\n            _getRaiseExceptionWithTypeCode(\n                raise_type_name=raise_type_name, emit=emit, context=context\n            )\n\n    elif exception_tb is None:\n        raise_type_name = context.allocateTempName(\"raise_type\")\n\n        generateExpressionCode(\n            to_name=raise_type_name,\n            expression=exception_type,\n            emit=emit,\n            context=context,\n        )\n\n        raise_value_name = context.allocateTempName(\"raise_value\")\n\n        generateExpressionCode(\n            to_name=raise_value_name,\n            expression=exception_value,\n            emit=emit,\n            context=context,\n        )\n\n        with context.withCurrentSourceCodeReference(\n            exception_value.getCompatibleSourceReference()\n        ):\n            _getRaiseExceptionWithValueCode(\n                raise_type_name=raise_type_name,\n                raise_value_name=raise_value_name,\n                implicit=statement.isStatementRaiseExceptionImplicit(),\n                emit=emit,\n                context=context,\n            )\n    else:\n        raise_type_name = context.allocateTempName(\"raise_type\")\n\n        generateExpressionCode(\n            to_name=raise_type_name,\n            expression=exception_type,\n            emit=emit,\n            context=context,\n        )\n\n        raise_value_name = context.allocateTempName(\"raise_value\")\n\n        generateExpressionCode(\n            to_name=raise_value_name,\n            expression=exception_value,\n            emit=emit,\n            context=context,\n        )\n\n        raise_tb_name = context.allocateTempName(\"raise_tb\")\n\n        generateExpressionCode(\n            to_name=raise_tb_name, expression=exception_tb, emit=emit, context=context\n        )\n\n        with context.withCurrentSourceCodeReference(exception_tb.getSourceReference()):\n            _getRaiseExceptionWithTracebackCode(\n                raise_type_name=raise_type_name,\n                raise_value_name=raise_value_name,\n                raise_tb_name=raise_tb_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateRaiseExpressionCode(to_name, expression, emit, context):\n    arg_names = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # Missed optimization opportunity, please report it, this should not\n    # normally happen. We are supposed to propagate this upwards.\n    if Options.is_debug:\n        # TODO: Need to optimize ExpressionLocalsVariableRefOrFallback once we know\n        # it handles cases where the value is not in locals dict properly.\n\n        parent = expression.parent\n        assert (\n            parent.isExpressionSideEffects()\n            or parent.isExpressionConditional()\n            or parent.isExpressionConditionalOr()\n            or parent.isExpressionConditionalAnd()\n            or parent.isExpressionLocalsVariableRefOrFallback()\n        ), (expression, expression.parent, expression.asXmlText())\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"raise_exception_result\", expression, emit, context\n    ) as value_name:\n        # That's how we indicate exception to the surrounding world.\n        emit(\"%s = NULL;\" % value_name)\n\n        _getRaiseExceptionWithValueCode(\n            raise_type_name=arg_names[0],\n            raise_value_name=arg_names[1],\n            implicit=True,\n            emit=emit,\n            context=context,\n        )\n\n\ndef getReRaiseExceptionCode(emit, context):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    keeper_variables = context.getExceptionKeeperVariables()\n\n    if keeper_variables[0] is None:\n        emit(\n            \"\"\"\\\n%(bool_res_name)s = RERAISE_EXCEPTION(&%(exception_type)s, &%(exception_value)s, &%(exception_tb)s);\nif (unlikely(%(bool_res_name)s == false)) {\n    %(update_code)s\n}\n\"\"\"\n            % {\n                \"exception_type\": exception_type,\n                \"exception_value\": exception_value,\n                \"exception_tb\": exception_tb,\n                \"bool_res_name\": context.getBoolResName(),\n                \"update_code\": getErrorLineNumberUpdateCode(context),\n            }\n        )\n\n        frame_handle = context.getFrameHandle()\n\n        if frame_handle:\n            emit(\n                \"\"\"\\\nif (%(exception_tb)s && %(exception_tb)s->tb_frame == &%(frame_identifier)s->m_frame) \\\n%(frame_identifier)s->m_frame.f_lineno = %(exception_tb)s->tb_lineno;\"\"\"\n                % {\n                    \"exception_tb\": exception_tb,\n                    \"frame_identifier\": context.getFrameHandle(),\n                }\n            )\n\n            emit(getFrameVariableTypeDescriptionCode(context))\n    else:\n        (\n            keeper_type,\n            keeper_value,\n            keeper_tb,\n            keeper_lineno,\n        ) = context.getExceptionKeeperVariables()\n\n        emit(\n            \"\"\"\\\n// Re-raise.\n%(exception_type)s = %(keeper_type)s;\n%(exception_value)s = %(keeper_value)s;\n%(exception_tb)s = %(keeper_tb)s;\n%(exception_lineno)s = %(keeper_lineno)s;\n\"\"\"\n            % {\n                \"exception_type\": exception_type,\n                \"exception_value\": exception_value,\n                \"exception_tb\": exception_tb,\n                \"exception_lineno\": exception_lineno,\n                \"keeper_type\": keeper_type,\n                \"keeper_value\": keeper_value,\n                \"keeper_tb\": keeper_tb,\n                \"keeper_lineno\": keeper_lineno,\n            }\n        )\n\n    getGotoCode(context.getExceptionEscape(), emit)\n\n\ndef _getRaiseExceptionWithCauseCode(raise_type_name, raise_cause_name, emit, context):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\"%s = %s;\" % (exception_type, raise_type_name))\n    getReferenceExportCode(raise_type_name, emit, context)\n\n    emit(\"%s = NULL;\" % exception_value)\n\n    getReferenceExportCode(raise_cause_name, emit, context)\n\n    emitErrorLineNumberUpdateCode(emit, context)\n    emit(\n        \"RAISE_EXCEPTION_WITH_CAUSE(tstate, &%s, &%s, &%s, %s);\"\n        % (exception_type, exception_value, exception_tb, raise_cause_name)\n    )\n\n    emit(getFrameVariableTypeDescriptionCode(context))\n\n    getGotoCode(context.getExceptionEscape(), emit)\n\n    if context.needsCleanup(raise_type_name):\n        context.removeCleanupTempName(raise_type_name)\n    if context.needsCleanup(raise_cause_name):\n        context.removeCleanupTempName(raise_cause_name)\n\n\ndef _getRaiseExceptionWithTypeCode(raise_type_name, emit, context):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\"%s = %s;\" % (exception_type, raise_type_name))\n    getReferenceExportCode(raise_type_name, emit, context)\n\n    emitErrorLineNumberUpdateCode(emit, context)\n    emit(\n        \"RAISE_EXCEPTION_WITH_TYPE(tstate, &%s, &%s, &%s);\"\n        % (exception_type, exception_value, exception_tb)\n    )\n\n    emit(getFrameVariableTypeDescriptionCode(context))\n\n    getGotoCode(context.getExceptionEscape(), emit)\n\n    if context.needsCleanup(raise_type_name):\n        context.removeCleanupTempName(raise_type_name)\n\n\ndef _getRaiseExceptionWithValueCode(\n    raise_type_name, raise_value_name, implicit, emit, context\n):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\"%s = %s;\" % (exception_type, raise_type_name))\n    getReferenceExportCode(raise_type_name, emit, context)\n    emit(\"%s = %s;\" % (exception_value, raise_value_name))\n    getReferenceExportCode(raise_value_name, emit, context)\n\n    emitErrorLineNumberUpdateCode(emit, context)\n\n    # Using RAISE_EXCEPTION_WITH_VALUE (user driven) or RAISE_EXCEPTION_IMPLICIT as needed.\n    emit(\n        \"RAISE_EXCEPTION_%s(tstate, &%s, &%s, &%s);\"\n        % (\n            (\"IMPLICIT\" if implicit else \"WITH_VALUE\"),\n            exception_type,\n            exception_value,\n            exception_tb,\n        )\n    )\n\n    emit(getFrameVariableTypeDescriptionCode(context))\n\n    getGotoCode(context.getExceptionEscape(), emit)\n\n    if context.needsCleanup(raise_type_name):\n        context.removeCleanupTempName(raise_type_name)\n    if context.needsCleanup(raise_value_name):\n        context.removeCleanupTempName(raise_value_name)\n\n\ndef _getRaiseExceptionWithTracebackCode(\n    raise_type_name, raise_value_name, raise_tb_name, emit, context\n):\n    (\n        exception_type,\n        exception_value,\n        exception_tb,\n        _exception_lineno,\n    ) = context.variable_storage.getExceptionVariableDescriptions()\n\n    emit(\"%s = %s;\" % (exception_type, raise_type_name))\n    getReferenceExportCode(raise_type_name, emit, context)\n    emit(\"%s = %s;\" % (exception_value, raise_value_name))\n    getReferenceExportCode(raise_value_name, emit, context)\n\n    emit(\"%s = (PyTracebackObject *)%s;\" % (exception_tb, raise_tb_name))\n    getReferenceExportCode(raise_tb_name, emit, context)\n\n    emit(\n        \"RAISE_EXCEPTION_WITH_TRACEBACK(tstate, &%s, &%s, &%s);\"\n        % (exception_type, exception_value, exception_tb)\n    )\n\n    # If anything is wrong, that will be used.\n    emitErrorLineNumberUpdateCode(emit, context)\n\n    emit(getFrameVariableTypeDescriptionCode(context))\n\n    getGotoCode(context.getExceptionEscape(), emit)\n\n    if context.needsCleanup(raise_type_name):\n        context.removeCleanupTempName(raise_type_name)\n    if context.needsCleanup(raise_value_name):\n        context.removeCleanupTempName(raise_value_name)\n    if context.needsCleanup(raise_tb_name):\n        context.removeCleanupTempName(raise_tb_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/Reports.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reports about code generation.\n\nInitially this is about missing optimization only, but it should expand into\nreal stuff.\n\"\"\"\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Tracing import code_generation_logger, optimization_logger\n\n_missing_helpers = OrderedDict()\n\n_missing_operations = OrderedSet()\n\n_missing_trust = OrderedDict()\n\n_missing_overloads = OrderedDict()\n\n_error_for_missing = False\n# _error_for_missing = True\n\n\ndef doMissingOptimizationReport():\n    for helper, source_refs in _missing_helpers.items():\n        message = \"Missing C helper code variant, used fallback: %s at %s\" % (\n            \",\".join(source_ref.getAsString() for source_ref in source_refs),\n            helper,\n        )\n\n        if _error_for_missing:\n            code_generation_logger.warning(message)\n        else:\n            code_generation_logger.info(message)\n\n    for desc in _missing_operations:\n        message = \"Missing optimization, used fallback: %s\" % (desc,)\n        if _error_for_missing:\n            optimization_logger.warning(message)\n        else:\n            optimization_logger.info(message)\n\n    for desc, source_refs in _missing_trust.items():\n        message = desc[0] % desc[1:]\n        message += \" at %s\" % \",\".join(\n            source_ref.getAsString() for source_ref in source_refs\n        )\n\n        if _error_for_missing:\n            optimization_logger.warning(message)\n        else:\n            optimization_logger.info(message)\n\n    for method_name, node in _missing_overloads.items():\n        message = \"Missing %s overload for %s\" % (method_name, node)\n        if _error_for_missing:\n            optimization_logger.warning(message)\n        else:\n            optimization_logger.info(message)\n\n\ndef onMissingHelper(helper_name, source_ref):\n    if source_ref:\n        if helper_name not in _missing_helpers:\n            _missing_helpers[helper_name] = []\n\n        _missing_helpers[helper_name].append(source_ref)\n\n\ndef onMissingOperation(operation, left, right):\n    # Avoid the circular dependency on tshape_uninitialized from StandardShapes.\n    if right.__class__.__name__ != \"ShapeTypeUninitialized\":\n        _missing_operations.add((operation, left, right))\n\n\ndef onMissingTrust(operation, source_ref, *args):\n    key = (operation,) + args\n\n    if key not in _missing_trust:\n        _missing_trust[key] = OrderedSet()\n\n    _missing_trust[key].add(source_ref)\n\n\ndef onMissingOverload(method_name, node):\n    if method_name not in _missing_overloads:\n        _missing_overloads[method_name] = OrderedSet()\n\n    _missing_overloads[method_name].add(node.kind)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/ReturnCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Return codes\n\nThis handles code generation for return statements of normal functions and of\ngenerator functions. Also the value currently being returned, and intercepted\nby a try statement is accessible this way.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import generateExpressionCode\nfrom .ExceptionCodes import getExceptionUnpublishedReleaseCode\nfrom .LabelCodes import getGotoCode\n\n\ndef generateReturnCode(statement, emit, context):\n    getExceptionUnpublishedReleaseCode(emit, context)\n\n    return_value = statement.subnode_expression\n\n    return_value_name = context.getReturnValueName()\n\n    if context.getReturnReleaseMode():\n        emit(\"CHECK_OBJECT(%s);\" % return_value_name)\n        emit(\"Py_DECREF(%s);\" % return_value_name)\n\n    generateExpressionCode(\n        to_name=return_value_name,\n        expression=return_value,\n        emit=emit,\n        context=context,\n    )\n\n    if context.needsCleanup(return_value_name):\n        context.removeCleanupTempName(return_value_name)\n    else:\n        emit(\"Py_INCREF(%s);\" % return_value_name)\n\n    getGotoCode(label=context.getReturnTarget(), emit=emit)\n\n\ndef generateReturnedValueCode(statement, emit, context):\n    # We don't need the statement, pylint: disable=unused-argument\n\n    getExceptionUnpublishedReleaseCode(emit, context)\n\n    getGotoCode(label=context.getReturnTarget(), emit=emit)\n\n\ndef generateReturnConstantCode(statement, emit, context):\n    getExceptionUnpublishedReleaseCode(emit, context)\n\n    return_value_name = context.getReturnValueName()\n\n    if context.getReturnReleaseMode():\n        emit(\"CHECK_OBJECT(%s);\" % return_value_name)\n        emit(\"Py_DECREF(%s);\" % return_value_name)\n\n    return_value_name.getCType().emitAssignmentCodeFromConstant(\n        to_name=return_value_name,\n        constant=statement.getConstant(),\n        may_escape=True,\n        emit=emit,\n        context=context,\n    )\n\n    if context.needsCleanup(return_value_name):\n        context.removeCleanupTempName(return_value_name)\n    else:\n        emit(\"Py_INCREF(%s);\" % return_value_name)\n\n    getGotoCode(label=context.getReturnTarget(), emit=emit)\n\n\ndef generateGeneratorReturnValueCode(statement, emit, context):\n    if context.getOwner().isExpressionAsyncgenObjectBody():\n        pass\n    elif python_version >= 0x300:\n        return_value_name = context.getGeneratorReturnValueName()\n\n        expression = statement.subnode_expression\n\n        if context.getReturnReleaseMode():\n            emit(\"CHECK_OBJECT(%s);\" % return_value_name)\n            emit(\"Py_DECREF(%s);\" % return_value_name)\n\n        generateExpressionCode(\n            to_name=return_value_name, expression=expression, emit=emit, context=context\n        )\n\n        if context.needsCleanup(return_value_name):\n            context.removeCleanupTempName(return_value_name)\n        else:\n            emit(\"Py_INCREF(%s);\" % return_value_name)\n    elif statement.getParentVariableProvider().needsGeneratorReturnHandling():\n        return_value_name = context.getGeneratorReturnValueName()\n\n        generator_return_name = context.allocateTempName(\n            \"generator_return\", \"bool\", unique=True\n        )\n\n        emit(\"%s = true;\" % generator_return_name)\n\n    getGotoCode(context.getReturnTarget(), emit)\n\n\ndef generateGeneratorReturnNoneCode(statement, emit, context):\n    if context.getOwner().isExpressionAsyncgenObjectBody():\n        pass\n    elif python_version >= 0x300:\n        return_value_name = context.getGeneratorReturnValueName()\n\n        if context.getReturnReleaseMode():\n            emit(\"CHECK_OBJECT(%s);\" % return_value_name)\n            emit(\"Py_DECREF(%s);\" % return_value_name)\n\n        return_value_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=return_value_name,\n            constant=None,\n            may_escape=False,\n            emit=emit,\n            context=context,\n        )\n\n        if context.needsCleanup(return_value_name):\n            context.removeCleanupTempName(return_value_name)\n        else:\n            emit(\"Py_INCREF(%s);\" % return_value_name)\n    elif statement.getParentVariableProvider().needsGeneratorReturnHandling():\n        return_value_name = context.getGeneratorReturnValueName()\n\n        generator_return_name = context.allocateTempName(\n            \"generator_return\", \"bool\", unique=True\n        )\n\n        emit(\"%s = true;\" % generator_return_name)\n\n    getGotoCode(context.getReturnTarget(), emit)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/SetCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for sets.\n\nRight now only the creation, and set add code is done here. But more should be\nadded later on.\n\"\"\"\n\nfrom nuitka.PythonVersions import needsSetLiteralReverseInsertion\n\nfrom .CodeHelpers import (\n    assignConstantNoneResult,\n    decideConversionCheckNeeded,\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getAssertionCode, getErrorExitBoolCode\nfrom .PythonAPICodes import generateCAPIObjectCode\n\n\ndef generateSetCreationCode(to_name, expression, emit, context):\n    element_name = context.allocateTempName(\"set_element\")\n\n    elements = expression.subnode_elements\n\n    # Supposed to optimize empty set to constant value.\n    assert elements, expression\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"set_result\", expression, emit, context\n    ) as result_name:\n        for count, element in enumerate(elements):\n            generateExpressionCode(\n                to_name=element_name, expression=element, emit=emit, context=context\n            )\n\n            if count == 0:\n                emit(\"%s = PySet_New(NULL);\" % (result_name,))\n                getAssertionCode(result_name, emit)\n\n                context.addCleanupTempName(to_name)\n\n            res_name = context.getIntResName()\n\n            emit(\"%s = PySet_Add(%s, %s);\" % (res_name, to_name, element_name))\n\n            getErrorExitBoolCode(\n                condition=\"%s != 0\" % res_name,\n                needs_check=not element.isKnownToBeHashable(),\n                emit=emit,\n                context=context,\n            )\n\n            if context.needsCleanup(element_name):\n                emit(\"Py_DECREF(%s);\" % element_name)\n                context.removeCleanupTempName(element_name)\n\n\ndef generateSetLiteralCreationCode(to_name, expression, emit, context):\n    if not needsSetLiteralReverseInsertion():\n        return generateSetCreationCode(to_name, expression, emit, context)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"set_result\", expression, emit, context\n    ) as result_name:\n        emit(\"%s = PySet_New(NULL);\" % (result_name,))\n\n        context.addCleanupTempName(result_name)\n\n        elements = expression.subnode_elements\n\n        element_names = []\n\n        for count, element in enumerate(elements, 1):\n            element_name = context.allocateTempName(\"set_element_%d\" % count)\n            element_names.append(element_name)\n\n            generateExpressionCode(\n                to_name=element_name, expression=element, emit=emit, context=context\n            )\n\n        for count, element in enumerate(elements):\n            element_name = element_names[len(elements) - count - 1]\n\n            if element.isKnownToBeHashable():\n                emit(\"PySet_Add(%s, %s);\" % (result_name, element_name))\n            else:\n                res_name = context.getIntResName()\n\n                emit(\"%s = PySet_Add(%s, %s);\" % (res_name, result_name, element_name))\n\n                getErrorExitBoolCode(\n                    condition=\"%s != 0\" % res_name, emit=emit, context=context\n                )\n\n            if context.needsCleanup(element_name):\n                emit(\"Py_DECREF(%s);\" % element_name)\n                context.removeCleanupTempName(element_name)\n\n\ndef generateSetOperationAddCode(statement, emit, context):\n    set_arg_name = context.allocateTempName(\"add_set\")\n    generateExpressionCode(\n        to_name=set_arg_name,\n        expression=statement.subnode_set_arg,\n        emit=emit,\n        context=context,\n    )\n\n    value_arg_name = context.allocateTempName(\"add_value\")\n    generateExpressionCode(\n        to_name=value_arg_name,\n        expression=statement.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    context.setCurrentSourceCodeReference(statement.getSourceReference())\n\n    res_name = context.getIntResName()\n\n    emit(\"assert(PySet_Check(%s));\" % set_arg_name)\n    emit(\"%s = PySet_Add(%s, %s);\" % (res_name, set_arg_name, value_arg_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(set_arg_name, value_arg_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateSetOperationUpdateCode(to_name, expression, emit, context):\n    res_name = context.getIntResName()\n\n    set_arg_name, value_arg_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    emit(\"assert(PySet_Check(%s));\" % set_arg_name)\n    emit(\"%s = _PySet_Update(%s, %s);\" % (res_name, set_arg_name, value_arg_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == -1\" % res_name,\n        release_names=(set_arg_name, value_arg_name),\n        emit=emit,\n        context=context,\n    )\n\n    assignConstantNoneResult(to_name, emit, context)\n\n\ndef generateBuiltinSetCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PySet_New\",\n        tstate=False,\n        arg_desc=((\"set_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinFrozensetCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyFrozenSet_New\",\n        tstate=False,\n        arg_desc=((\"frozenset_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/SliceCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for slicing.\n\nThis is about slice lookups, assignments, and deletions. There is also a\nspecial case, for using index values instead of objects. The slice objects\nare also created here, and can be used for indexing.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    generateExpressionCode,\n    generateExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode\nfrom .IndexCodes import (\n    getIndexCode,\n    getIndexValueCode,\n    getMaxIndexCode,\n    getMinIndexCode,\n)\n\n\ndef _isSmallNumberConstant(node):\n    if node.isNumberConstant():\n        value = node.getCompileTimeConstant()\n        return abs(int(value)) < 2**63 - 1\n    else:\n        return False\n\n\ndef _generateSliceRangeIdentifier(lower, upper, scope, emit, context):\n    lower_name = context.allocateTempName(scope + \"slicedel_index_lower\", \"Py_ssize_t\")\n    upper_name = context.allocateTempName(scope + \"_index_upper\", \"Py_ssize_t\")\n\n    if lower is None:\n        getMinIndexCode(to_name=lower_name, emit=emit)\n    elif lower.isExpressionConstantRef() and _isSmallNumberConstant(lower):\n        getIndexValueCode(\n            to_name=lower_name, value=int(lower.getCompileTimeConstant()), emit=emit\n        )\n    else:\n        value_name = context.allocateTempName(scope + \"_lower_index_value\")\n\n        generateExpressionCode(\n            to_name=value_name, expression=lower, emit=emit, context=context\n        )\n\n        getIndexCode(\n            to_name=lower_name, value_name=value_name, emit=emit, context=context\n        )\n\n    if upper is None:\n        getMaxIndexCode(to_name=upper_name, emit=emit)\n    elif upper.isExpressionConstantRef() and _isSmallNumberConstant(upper):\n        getIndexValueCode(\n            to_name=upper_name, value=int(upper.getCompileTimeConstant()), emit=emit\n        )\n    else:\n        value_name = context.allocateTempName(scope + \"_upper_index_value\")\n\n        generateExpressionCode(\n            to_name=value_name, expression=upper, emit=emit, context=context\n        )\n\n        getIndexCode(\n            to_name=upper_name, value_name=value_name, emit=emit, context=context\n        )\n\n    return lower_name, upper_name\n\n\ndef _decideSlicing(lower, upper):\n    return (lower is None or lower.isIndexable()) and (\n        upper is None or upper.isIndexable()\n    )\n\n\ndef generateSliceLookupCode(to_name, expression, emit, context):\n    assert python_version < 0x300\n\n    lower = expression.subnode_lower\n    upper = expression.subnode_upper\n\n    if _decideSlicing(lower, upper):\n        lower_name, upper_name = _generateSliceRangeIdentifier(\n            lower=lower, upper=upper, scope=\"slice\", emit=emit, context=context\n        )\n\n        source_name = context.allocateTempName(\"slice_source\")\n\n        generateExpressionCode(\n            to_name=source_name,\n            expression=expression.subnode_expression,\n            emit=emit,\n            context=context,\n        )\n\n        with withObjectCodeTemporaryAssignment(\n            to_name, \"slice_result\", expression, emit, context\n        ) as result_name:\n            _getSliceLookupIndexesCode(\n                to_name=result_name,\n                source_name=source_name,\n                lower_name=lower_name,\n                upper_name=upper_name,\n                emit=emit,\n                context=context,\n            )\n    else:\n        source_name, lower_name, upper_name = generateExpressionsCode(\n            names=(\"slice_source\", \"slice_lower\", \"slice_upper\"),\n            expressions=(\n                expression.subnode_expression,\n                expression.subnode_lower,\n                expression.subnode_upper,\n            ),\n            emit=emit,\n            context=context,\n        )\n\n        with withObjectCodeTemporaryAssignment(\n            to_name, \"slice_result\", expression, emit, context\n        ) as result_name:\n            _getSliceLookupCode(\n                to_name=result_name,\n                source_name=source_name,\n                lower_name=lower_name,\n                upper_name=upper_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateAssignmentSliceCode(statement, emit, context):\n    assert python_version < 0x300\n\n    lookup_source = statement.subnode_expression\n    lower = statement.subnode_lower\n    upper = statement.subnode_upper\n    value = statement.subnode_source\n\n    value_name = context.allocateTempName(\"sliceass_value\")\n\n    generateExpressionCode(\n        to_name=value_name, expression=value, emit=emit, context=context\n    )\n\n    target_name = context.allocateTempName(\"sliceass_target\")\n\n    generateExpressionCode(\n        to_name=target_name, expression=lookup_source, emit=emit, context=context\n    )\n\n    if _decideSlicing(lower, upper):\n        lower_name, upper_name = _generateSliceRangeIdentifier(\n            lower=lower, upper=upper, scope=\"sliceass\", emit=emit, context=context\n        )\n\n        with context.withCurrentSourceCodeReference(\n            value.getSourceReference()\n            if Options.is_full_compat\n            else statement.getSourceReference()\n        ):\n            _getSliceAssignmentIndexesCode(\n                target_name=target_name,\n                lower_name=lower_name,\n                upper_name=upper_name,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n    else:\n        lower_name, upper_name = generateExpressionsCode(\n            names=(\"sliceass_lower\", \"sliceass_upper\"),\n            expressions=(lower, upper),\n            emit=emit,\n            context=context,\n        )\n\n        with context.withCurrentSourceCodeReference(\n            value.getSourceReference()\n            if Options.is_full_compat\n            else statement.getSourceReference()\n        ):\n            _getSliceAssignmentCode(\n                target_name=target_name,\n                upper_name=upper_name,\n                lower_name=lower_name,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateDelSliceCode(statement, emit, context):\n    assert python_version < 0x300\n\n    target = statement.subnode_expression\n    lower = statement.subnode_lower\n    upper = statement.subnode_upper\n\n    target_name = context.allocateTempName(\"slicedel_target\")\n\n    generateExpressionCode(\n        to_name=target_name, expression=target, emit=emit, context=context\n    )\n\n    if _decideSlicing(lower, upper):\n        lower_name, upper_name = _generateSliceRangeIdentifier(\n            lower=lower, upper=upper, scope=\"slicedel\", emit=emit, context=context\n        )\n\n        with context.withCurrentSourceCodeReference(\n            (upper or lower or statement).getSourceReference()\n            if Options.is_full_compat\n            else statement.getSourceReference()\n        ):\n            _getSliceDelIndexesCode(\n                target_name=target_name,\n                lower_name=lower_name,\n                upper_name=upper_name,\n                emit=emit,\n                context=context,\n            )\n    else:\n        lower_name, upper_name = generateExpressionsCode(\n            names=(\"slicedel_lower\", \"slicedel_upper\"),\n            expressions=(lower, upper),\n            emit=emit,\n            context=context,\n        )\n\n        with context.withCurrentSourceCodeReference(\n            (upper or lower or target).getSourceReference()\n            if Options.is_full_compat\n            else statement.getSourceReference()\n        ):\n            _getSliceDelCode(\n                target_name=target_name,\n                lower_name=lower_name,\n                upper_name=upper_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateBuiltinSlice3Code(to_name, expression, emit, context):\n    lower_name, upper_name, step_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"slice_obj_value\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = MAKE_SLICE_OBJECT3(%s, %s, %s);\"\n            % (\n                result_name,\n                lower_name,\n                upper_name,\n                step_name,\n            )\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(lower_name, upper_name, step_name),\n            needs_check=False,  # Note: Cannot fail\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateBuiltinSlice2Code(to_name, expression, emit, context):\n    lower_name, upper_name = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"slice_obj_value\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = MAKE_SLICE_OBJECT2(%s, %s);\"\n            % (\n                result_name,\n                lower_name,\n                upper_name,\n            )\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(lower_name, upper_name),\n            needs_check=False,  # Note: Cannot fail\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateBuiltinSlice1Code(to_name, expression, emit, context):\n    (upper_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"slice_obj_value\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = MAKE_SLICE_OBJECT1(%s);\"\n            % (\n                result_name,\n                upper_name,\n            )\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_name=upper_name,\n            needs_check=False,  # Note: Cannot fail\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef _getSliceLookupCode(to_name, source_name, lower_name, upper_name, emit, context):\n    emit(\n        \"%s = LOOKUP_SLICE(tstate, %s, %s, %s);\"\n        % (\n            to_name,\n            source_name,\n            lower_name if lower_name is not None else \"Py_None\",\n            upper_name if upper_name is not None else \"Py_None\",\n        )\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(source_name, lower_name, upper_name),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getSliceLookupIndexesCode(\n    to_name, lower_name, upper_name, source_name, emit, context\n):\n    emit(\n        \"%s = LOOKUP_INDEX_SLICE(%s, %s, %s);\"\n        % (to_name, source_name, lower_name, upper_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name, release_name=source_name, emit=emit, context=context\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getSliceAssignmentIndexesCode(\n    target_name, lower_name, upper_name, value_name, emit, context\n):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_INDEX_SLICE(%s, %s, %s, %s);\"\n        % (res_name, target_name, lower_name, upper_name, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(value_name, target_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getSliceAssignmentCode(\n    target_name, lower_name, upper_name, value_name, emit, context\n):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_SLICE(tstate, %s, %s, %s, %s);\"\n        % (\n            res_name,\n            target_name,\n            lower_name if lower_name is not None else \"Py_None\",\n            upper_name if upper_name is not None else \"Py_None\",\n            value_name,\n        )\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(target_name, lower_name, upper_name, value_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getSliceDelIndexesCode(target_name, lower_name, upper_name, emit, context):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = DEL_INDEX_SLICE(%s, %s, %s);\"\n        % (res_name, target_name, lower_name, upper_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_name=target_name,\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getSliceDelCode(target_name, lower_name, upper_name, emit, context):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = DEL_SLICE(tstate, %s, %s, %s);\"\n        % (\n            res_name,\n            target_name,\n            lower_name if lower_name is not None else \"Py_None\",\n            upper_name if upper_name is not None else \"Py_None\",\n        )\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(target_name, lower_name, upper_name),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/StringCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" String related codes, str and unicode.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CallCodes import getCallCodePosVariableKeywordVariableArgs\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode\nfrom .PythonAPICodes import generateCAPIObjectCode, makeArgDescFromExpression\nfrom .TupleCodes import getTupleCreationCode\n\n\ndef generateBuiltinBytes1Code(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_BYTES1\",\n        tstate=True,\n        arg_desc=((\"bytes_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinBytes3Code(to_name, expression, emit, context):\n    encoding = expression.subnode_encoding\n    errors = expression.subnode_errors\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_BYTES3\",\n        tstate=True,\n        arg_desc=(\n            (\"bytes_arg\", expression.subnode_value),\n            (\"bytes_encoding\", encoding),\n            (\"bytes_errors\", errors),\n        ),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        none_null=True,\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinUnicodeCode(to_name, expression, emit, context):\n    encoding = expression.subnode_encoding\n    errors = expression.subnode_errors\n\n    if encoding is None and errors is None:\n        generateCAPIObjectCode(\n            to_name=to_name,\n            capi=\"BUILTIN_UNICODE1\",\n            tstate=False,\n            arg_desc=(\n                (\n                    \"str_arg\" if python_version < 0x300 else \"unicode_arg\",\n                    expression.subnode_value,\n                ),\n            ),\n            may_raise=expression.mayRaiseException(BaseException),\n            conversion_check=decideConversionCheckNeeded(to_name, expression),\n            source_ref=expression.getCompatibleSourceReference(),\n            emit=emit,\n            context=context,\n        )\n    else:\n        generateCAPIObjectCode(\n            to_name=to_name,\n            capi=\"BUILTIN_UNICODE3\",\n            tstate=False,\n            arg_desc=(\n                (\"unicode_arg\", expression.subnode_value),\n                (\"unicode_encoding\", encoding),\n                (\"unicode_errors\", errors),\n            ),\n            may_raise=expression.mayRaiseException(BaseException),\n            conversion_check=decideConversionCheckNeeded(to_name, expression),\n            source_ref=expression.getCompatibleSourceReference(),\n            none_null=True,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateBuiltinStrCode(to_name, expression, emit, context):\n    if python_version < 0x300:\n        generateCAPIObjectCode(\n            to_name=to_name,\n            capi=\"BUILTIN_STR\",\n            tstate=False,\n            arg_desc=((\"str_arg\", expression.subnode_value),),\n            may_raise=expression.mayRaiseException(BaseException),\n            conversion_check=decideConversionCheckNeeded(to_name, expression),\n            source_ref=expression.getCompatibleSourceReference(),\n            emit=emit,\n            context=context,\n        )\n    else:\n        return generateBuiltinUnicodeCode(\n            to_name=to_name, expression=expression, emit=emit, context=context\n        )\n\n\ndef generateBuiltinChrCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_CHR\",\n        tstate=True,\n        arg_desc=((\"chr_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateBuiltinOrdCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"BUILTIN_ORD\",\n        tstate=False,\n        arg_desc=((\"ord_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateStringConcatenationCode(to_name, expression, emit, context):\n    values = expression.subnode_values\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"string_concat_result\", expression, emit, context\n    ) as value_name:\n        tuple_temp_name = context.allocateTempName(\"string_concat_values\")\n\n        # TODO: Consider using _PyUnicode_JoinArray which avoids the tuple,\n        # but got all to be able to release arrays.\n        getTupleCreationCode(\n            to_name=tuple_temp_name, elements=values, emit=emit, context=context\n        )\n\n        emit(\n            \"%s = PyUnicode_Join(%s, %s);\"\n            % (value_name, context.getConstantCode(\"\"), tuple_temp_name)\n        )\n\n        getErrorExitCode(\n            check_name=value_name,\n            release_name=tuple_temp_name,\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(value_name)\n\n\ndef generateBuiltinFormatCode(to_name, expression, emit, context):\n    value_name = context.allocateTempName(\"format_value\")\n\n    generateExpressionCode(\n        to_name=value_name,\n        expression=expression.subnode_value,\n        emit=emit,\n        context=context,\n    )\n\n    format_spec_name = context.allocateTempName(\"format_spec\")\n\n    format_spec = expression.subnode_format_spec\n\n    if format_spec is None:\n        emit(\"%s = %s;\" % (format_spec_name, context.getConstantCode(\"\")))\n    else:\n        generateExpressionCode(\n            to_name=format_spec_name, expression=format_spec, emit=emit, context=context\n        )\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"format_result\", expression, emit, context\n    ) as result_name:\n        emit(\n            \"%s = BUILTIN_FORMAT(tstate, %s, %s);\"\n            % (result_name, value_name, format_spec_name)\n        )\n\n        getErrorExitCode(\n            check_name=result_name,\n            release_names=(value_name, format_spec_name),\n            emit=emit,\n            context=context,\n        )\n\n        context.addCleanupTempName(result_name)\n\n\ndef generateBuiltinAsciiCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PyObject_ASCII\",\n        tstate=False,\n        arg_desc=((\"ascii_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateStrOperationCode(to_name, expression, emit, context):\n    api_name = expression.kind.rsplit(\"_\")[-1]\n\n    if str is bytes:\n        api_name = \"STR_\" + api_name\n    else:\n        api_name = \"UNICODE_\" + api_name\n\n    # This operation has no default available for compile time.\n    none_null = expression.isExpressionStrOperationDecode3()\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=api_name,\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n        none_null=none_null,\n    )\n\n\ndef generateBytesOperationCode(to_name, expression, emit, context):\n    assert str is not bytes\n\n    api_name = \"BYTES_\" + expression.kind.rsplit(\"_\")[-1]\n\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=api_name,\n        tstate=True,\n        arg_desc=makeArgDescFromExpression(expression),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\ndef generateStrFormatMethodCode(to_name, expression, emit, context):\n    if str is bytes:\n        called_name = \"str_builtin_format\"\n    else:\n        called_name = \"unicode_builtin_format\"\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"format_result\", expression, emit, context\n    ) as result_name:\n        getCallCodePosVariableKeywordVariableArgs(\n            to_name=result_name,\n            expression=expression,\n            called_name=called_name,\n            call_args=(expression.subnode_str_arg,) + expression.subnode_args,\n            pairs=expression.subnode_pairs,\n            emit=emit,\n            context=context,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/SubscriptCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Subscript related code generation.\n\nThere is special handling for integer indexes, which can be dealt with\nmuch faster than general subscript lookups.\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .CodeHelpers import (\n    generateChildExpressionCode,\n    generateExpressionCode,\n    generateExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitBoolCode, getErrorExitCode, getReleaseCodes\n\n\ndef decideIntegerSubscript(subscript):\n    if subscript.isExpressionConstantRef():\n        if subscript.isIndexConstant():\n            constant_value = subscript.getIndexValue()\n\n            if abs(constant_value) < 2**31:\n                return constant_value, True\n\n    return None, False\n\n\ndef generateAssignmentSubscriptCode(statement, emit, context):\n    subscribed = statement.subnode_subscribed\n    subscript = statement.subnode_subscript\n    value = statement.subnode_source\n\n    subscript_constant, integer_subscript = decideIntegerSubscript(subscript)\n\n    value_name = context.allocateTempName(\"ass_subvalue\")\n\n    generateExpressionCode(\n        to_name=value_name, expression=value, emit=emit, context=context\n    )\n\n    subscribed_name = context.allocateTempName(\"ass_subscribed\")\n    generateExpressionCode(\n        to_name=subscribed_name, expression=subscribed, emit=emit, context=context\n    )\n\n    subscript_name = context.allocateTempName(\"ass_subscript\")\n    generateExpressionCode(\n        to_name=subscript_name, expression=subscript, emit=emit, context=context\n    )\n\n    with context.withCurrentSourceCodeReference(\n        value.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        if integer_subscript:\n            _getIntegerSubscriptAssignmentCode(\n                subscribed_name=subscribed_name,\n                subscript_name=subscript_name,\n                subscript_value=subscript_constant,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n        else:\n            _getSubscriptAssignmentCode(\n                target_name=subscribed_name,\n                subscript_name=subscript_name,\n                value_name=value_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateDelSubscriptCode(statement, emit, context):\n    subscribed = statement.subnode_subscribed\n    subscript = statement.subnode_subscript\n\n    target_name, subscript_name = generateExpressionsCode(\n        expressions=(subscribed, subscript),\n        names=(\"delsubscr_target\", \"delsubscr_subscript\"),\n        emit=emit,\n        context=context,\n    )\n\n    with context.withCurrentSourceCodeReference(\n        subscript.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        _getSubscriptDelCode(\n            target_name=target_name,\n            subscript_name=subscript_name,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateSubscriptLookupCode(to_name, expression, emit, context):\n    subscribed = expression.subnode_expression\n    subscript = expression.subnode_subscript\n\n    subscribed_name = generateChildExpressionCode(\n        expression=subscribed, emit=emit, context=context\n    )\n\n    subscript_name = generateChildExpressionCode(\n        expression=subscript, emit=emit, context=context\n    )\n\n    subscript_constant, integer_subscript = decideIntegerSubscript(subscript)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"subscript_result\", expression, emit, context\n    ) as value_name:\n        if integer_subscript:\n            _getIntegerSubscriptLookupCode(\n                to_name=value_name,\n                subscribed_name=subscribed_name,\n                subscript_name=subscript_name,\n                subscript_value=subscript_constant,\n                emit=emit,\n                context=context,\n            )\n        else:\n            _getSubscriptLookupCode(\n                to_name=value_name,\n                subscribed_name=subscribed_name,\n                subscript_name=subscript_name,\n                emit=emit,\n                context=context,\n            )\n\n\ndef generateSubscriptCheckCode(to_name, expression, emit, context):\n    subscribed = expression.subnode_expression\n    subscript = expression.subnode_subscript\n\n    subscribed_name = generateChildExpressionCode(\n        expression=subscribed, emit=emit, context=context\n    )\n\n    subscript_name = generateChildExpressionCode(\n        expression=subscript, emit=emit, context=context\n    )\n\n    subscript_constant, integer_subscript = decideIntegerSubscript(subscript)\n\n    res_name = context.getBoolResName()\n\n    if integer_subscript:\n        emit(\n            \"%s = HAS_SUBSCRIPT_CONST(tstate, %s, %s, %s);\"\n            % (res_name, subscribed_name, subscript_name, subscript_constant)\n        )\n    else:\n        emit(\n            \"%s = HAS_SUBSCRIPT(tstate, %s, %s);\"\n            % (res_name, subscribed_name, subscript_name)\n        )\n\n    getReleaseCodes((subscript_name, subscribed_name), emit, context)\n\n    to_name.getCType().emitAssignmentCodeFromBoolCondition(\n        to_name=to_name,\n        condition=res_name,\n        emit=emit,\n    )\n\n\ndef _getIntegerSubscriptLookupCode(\n    to_name, subscribed_name, subscript_name, subscript_value, emit, context\n):\n    emit(\n        \"%s = LOOKUP_SUBSCRIPT_CONST(tstate, %s, %s, %s);\"\n        % (to_name, subscribed_name, subscript_name, subscript_value)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(subscribed_name, subscript_name),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getSubscriptLookupCode(to_name, subscript_name, subscribed_name, emit, context):\n    emit(\n        \"%s = LOOKUP_SUBSCRIPT(tstate, %s, %s);\"\n        % (to_name, subscribed_name, subscript_name)\n    )\n\n    getErrorExitCode(\n        check_name=to_name,\n        release_names=(subscribed_name, subscript_name),\n        emit=emit,\n        context=context,\n    )\n\n    context.addCleanupTempName(to_name)\n\n\ndef _getIntegerSubscriptAssignmentCode(\n    subscribed_name, subscript_name, subscript_value, value_name, emit, context\n):\n    assert abs(subscript_value) < 2**31\n\n    res_name = context.allocateTempName(\"ass_subscript_res\", \"int\")\n\n    emit(\n        \"%s = SET_SUBSCRIPT_CONST(tstate, %s, %s, %s, %s);\"\n        % (res_name, subscribed_name, subscript_name, subscript_value, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(subscribed_name, value_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getSubscriptAssignmentCode(target_name, subscript_name, value_name, emit, context):\n    res_name = context.getBoolResName()\n\n    emit(\n        \"%s = SET_SUBSCRIPT(tstate, %s, %s, %s);\"\n        % (res_name, target_name, subscript_name, value_name)\n    )\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(target_name, subscript_name, value_name),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getSubscriptDelCode(target_name, subscript_name, emit, context):\n    res_name = context.getBoolResName()\n\n    emit(\"%s = DEL_SUBSCRIPT(%s, %s);\" % (res_name, target_name, subscript_name))\n\n    getErrorExitBoolCode(\n        condition=\"%s == false\" % res_name,\n        release_names=(target_name, subscript_name),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/TensorflowCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code generation for tensorflow module specific stuff. \"\"\"\n\nfrom nuitka.Options import isStandaloneMode\n\nfrom .BuiltinCodes import getBuiltinCallViaSpecCode\nfrom .ImportCodes import getImportModuleNameHardCode\n\n\ndef generateTensorflowFunctionCallCode(to_name, expression, emit, context):\n    \"\"\"This is for tensorflow.function calls.\"\"\"\n\n    # TODO: Have global cached forms of hard attribute lookup results too.\n    tensorflow_function_name = context.allocateTempName(\n        \"tensorflow_function\", unique=True\n    )\n\n    getImportModuleNameHardCode(\n        to_name=tensorflow_function_name,\n        module_name=\"tensorflow\",\n        import_name=\"function\",\n        needs_check=False,\n        emit=emit,\n        context=context,\n    )\n\n    # Include source code of \"tensorflow.function\" decorated functions.\n    if expression.subnode_func is not None and isStandaloneMode():\n        func_value = expression.subnode_func\n\n        if func_value.isExpressionFunctionCreation():\n            function_ref = func_value.subnode_function_ref\n\n            function_super_qualified_name = function_ref.getFunctionSuperQualifiedName()\n            function_source_code = function_ref.getFunctionSourceCode()\n\n            context.addModuleInitCode(\n                \"\"\"\\\nSET_UNCOMPILED_FUNCTION_SOURCE_DICT(%s, %s);\n\"\"\"\n                % (\n                    context.getConstantCode(function_super_qualified_name),\n                    context.getConstantCode(function_source_code),\n                )\n            )\n\n    getBuiltinCallViaSpecCode(\n        spec=expression.spec,\n        called_name=tensorflow_function_name,\n        to_name=to_name,\n        expression=expression,\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/TryCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Try statement and related code generation.\n\nFor Nuitka, all try/except and try/finally are dealt with this, where the\nfinally block gets duplicated into handlers. So this is a common low level\nstructure used, where exception handling and everything is made explicit.\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .CodeHelpers import generateExpressionCode, generateStatementSequenceCode\nfrom .ErrorCodes import getMustNotGetHereCode\nfrom .ExceptionCodes import getExceptionUnpublishedReleaseCode\nfrom .IteratorCodes import getBuiltinLoopBreakNextCode\nfrom .LabelCodes import getGotoCode, getLabelCode\nfrom .VariableCodes import getVariableAssignmentCode\n\n\ndef generateTryCode(statement, emit, context):\n    # The try construct is the most complex for code generation. We may need to\n    # react on break, continue, return, raise in the handlers. For exception\n    # and return handlers, we need to be able to re-raise or re-return.\n    # So this is full of detail stuff, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    if generateTryNextExceptStopIterationCode(statement, emit, context):\n        return\n\n    # Get the statement sequences involved. All except the tried block can be\n    # None. For the tried block it would be a missed optimization. Also not all\n    # the handlers must be None, then it's also a missed optimization.\n    tried_block = statement.subnode_tried\n\n    except_handler = statement.subnode_except_handler\n    continue_handler = statement.subnode_continue_handler\n    break_handler = statement.subnode_break_handler\n    return_handler = statement.subnode_return_handler\n\n    tried_block_may_raise = tried_block.mayRaiseException(BaseException)\n\n    assert (\n        tried_block_may_raise\n        or continue_handler is not None\n        or break_handler is not None\n        or return_handler is not None\n    ), statement.asXmlText()\n\n    # The tried statements might raise, for which we define an escape.\n    tried_handler_escape = context.allocateLabel(\"try_except_handler\")\n    if tried_block_may_raise:\n        old_exception_escape = context.setExceptionEscape(tried_handler_escape)\n\n    # The tried statements might continue, for which we define an escape.\n    continue_handler_escape = context.allocateLabel(\"try_continue_handler\")\n    if continue_handler is not None:\n        old_continue_target = context.setLoopContinueTarget(continue_handler_escape)\n\n    # The tried statements might break, for which we define an escape.\n    break_handler_escape = context.allocateLabel(\"try_break_handler\")\n    if break_handler is not None:\n        old_break_target = context.setLoopBreakTarget(break_handler_escape)\n\n    # The tried statements might return, for which we define an escape.\n    return_handler_escape = context.allocateLabel(\"try_return_handler\")\n    if return_handler is not None:\n        old_return_target = context.setReturnTarget(return_handler_escape)\n\n    # Now the tried block can be generated, cannot be \"None\" or else the\n    # optimization failed.\n    emit(\"// Tried code:\")\n    generateStatementSequenceCode(\n        statement_sequence=tried_block, emit=emit, allow_none=False, context=context\n    )\n\n    # Restore the old escape targets as preserved above, during the handlers,\n    # the parent handlers should be back in effect.\n    if tried_block_may_raise:\n        context.setExceptionEscape(old_exception_escape)\n\n    if continue_handler:\n        context.setLoopContinueTarget(old_continue_target)\n\n    if break_handler:\n        context.setLoopBreakTarget(old_break_target)\n\n    if return_handler:\n        context.setReturnTarget(old_return_target)\n\n    post_label = None\n\n    if not tried_block.isStatementAborting():\n        if post_label is None:\n            post_label = context.allocateLabel(\"try_end\")\n\n        getGotoCode(post_label, emit)\n    else:\n        getMustNotGetHereCode(reason=\"tried codes exits in all cases\", emit=emit)\n\n    if return_handler is not None:\n        assert tried_block.mayReturn()\n\n        emit(\"// Return handler code:\")\n        getLabelCode(return_handler_escape, emit)\n\n        # During the return value, the value being returned is in a variable,\n        # and therefore needs to be released before being updated with a new\n        # return value.\n        old_return_value_release = context.setReturnReleaseMode(True)\n\n        generateStatementSequenceCode(\n            statement_sequence=return_handler,\n            emit=emit,\n            allow_none=False,\n            context=context,\n        )\n\n        context.setReturnReleaseMode(old_return_value_release)\n\n        assert return_handler.isStatementAborting()\n\n    if tried_block_may_raise:\n        emit(\"// Exception handler code:\")\n        getLabelCode(tried_handler_escape, emit)\n\n        # Need to preserve exception state.\n        (\n            keeper_type,\n            keeper_value,\n            keeper_tb,\n            keeper_lineno,\n        ) = context.allocateExceptionKeeperVariables()\n\n        old_keepers = context.setExceptionKeeperVariables(\n            (keeper_type, keeper_value, keeper_tb, keeper_lineno)\n        )\n\n        assert keeper_type is not None\n\n        (\n            exception_type,\n            exception_value,\n            exception_tb,\n            exception_lineno,\n        ) = context.variable_storage.getExceptionVariableDescriptions()\n\n        # TODO: That normalization and chaining is only necessary if the\n        # exception is published.\n        emit(\n            \"\"\"\\\n%(keeper_type)s = %(exception_type)s;\n%(keeper_value)s = %(exception_value)s;\n%(keeper_tb)s = %(exception_tb)s;\n%(keeper_lineno)s = %(exception_lineno)s;\n%(exception_type)s = NULL;\n%(exception_value)s = NULL;\n%(exception_tb)s = NULL;\n%(exception_lineno)s = 0;\n\"\"\"\n            % {\n                \"keeper_type\": keeper_type,\n                \"keeper_value\": keeper_value,\n                \"keeper_tb\": keeper_tb,\n                \"keeper_lineno\": keeper_lineno,\n                \"exception_type\": exception_type,\n                \"exception_value\": exception_value,\n                \"exception_tb\": exception_tb,\n                \"exception_lineno\": exception_lineno,\n            }\n        )\n\n        generateStatementSequenceCode(\n            statement_sequence=except_handler,\n            emit=emit,\n            allow_none=True,\n            context=context,\n        )\n\n        if except_handler is None or not except_handler.isStatementAborting():\n            getExceptionUnpublishedReleaseCode(emit, context)\n\n            if post_label is None:\n                post_label = context.allocateLabel(\"try_end\")\n\n            getGotoCode(post_label, emit)\n\n            getMustNotGetHereCode(\n                reason=\"exception handler codes exits in all cases\", emit=emit\n            )\n\n        context.setExceptionKeeperVariables(old_keepers)\n    else:\n        assert except_handler is None, tried_block.asXmlText()\n\n    if break_handler is not None:\n        assert tried_block.mayBreak()\n\n        emit(\"// try break handler code:\")\n        getLabelCode(break_handler_escape, emit)\n\n        generateStatementSequenceCode(\n            statement_sequence=break_handler,\n            emit=emit,\n            allow_none=False,\n            context=context,\n        )\n\n        assert break_handler.isStatementAborting()\n\n    if continue_handler is not None:\n        assert tried_block.mayContinue()\n\n        emit(\"// try continue handler code:\")\n        getLabelCode(continue_handler_escape, emit)\n\n        generateStatementSequenceCode(\n            statement_sequence=continue_handler,\n            emit=emit,\n            allow_none=False,\n            context=context,\n        )\n\n        assert continue_handler.isStatementAborting()\n\n    emit(\"// End of try:\")\n\n    if post_label is not None:\n        getLabelCode(post_label, emit)\n\n\ndef generateTryNextExceptStopIterationCode(statement, emit, context):\n    # This has many branches which mean this optimized code generation is not\n    # applicable, we return each time. pylint: disable=too-many-branches,too-many-return-statements\n\n    except_handler = statement.subnode_except_handler\n\n    if except_handler is None:\n        return False\n\n    if statement.subnode_break_handler is not None:\n        return False\n\n    if statement.subnode_continue_handler is not None:\n        return False\n\n    if statement.subnode_return_handler is not None:\n        return False\n\n    tried_statements = statement.subnode_tried.subnode_statements\n\n    if len(tried_statements) != 1:\n        return False\n\n    handling_statements = except_handler.subnode_statements\n\n    if len(handling_statements) != 1:\n        return False\n\n    tried_statement = tried_statements[0]\n\n    if not tried_statement.isStatementAssignmentVariable():\n        return False\n\n    assign_source = tried_statement.subnode_source\n\n    if not assign_source.isExpressionBuiltinNext1():\n        return False\n\n    handling_statement = handling_statements[0]\n\n    if not handling_statement.isStatementConditional():\n        return False\n\n    yes_statements = handling_statement.subnode_yes_branch.subnode_statements\n    no_statements = handling_statement.subnode_no_branch.subnode_statements\n\n    if len(yes_statements) != 1:\n        return False\n\n    if not yes_statements[0].isStatementLoopBreak():\n        return False\n\n    if len(no_statements) != 1:\n        return False\n\n    if not no_statements[0].isStatementReraiseException():\n        return False\n\n    tmp_name = context.allocateTempName(\"next_source\")\n\n    generateExpressionCode(\n        expression=assign_source.subnode_value,\n        to_name=tmp_name,\n        emit=emit,\n        context=context,\n    )\n\n    tmp_name2 = context.allocateTempName(\"assign_source\")\n\n    with context.withCurrentSourceCodeReference(\n        assign_source.getSourceReference()\n        if Options.is_full_compat\n        else statement.getSourceReference()\n    ):\n        getBuiltinLoopBreakNextCode(\n            to_name=tmp_name2, value=tmp_name, emit=emit, context=context\n        )\n\n        getVariableAssignmentCode(\n            tmp_name=tmp_name2,\n            variable=tried_statement.getVariable(),\n            variable_trace=tried_statement.getVariableTrace(),\n            needs_release=None,\n            inplace=False,\n            emit=emit,\n            context=context,\n        )\n\n        if context.needsCleanup(tmp_name2):\n            context.removeCleanupTempName(tmp_name2)\n\n    return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/TupleCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tuple codes\n\n\"\"\"\n\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateExpressionCode,\n    withCleanupFinally,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .PythonAPICodes import generateCAPIObjectCode\n\n\ndef _areConstants(expressions):\n    for expression in expressions:\n        if not expression.isExpressionConstantRef():\n            return False\n\n        if expression.isMutable():\n            return False\n\n    return True\n\n\ndef generateTupleCreationCode(to_name, expression, emit, context):\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"tuple_value\", expression, emit, context\n    ) as value_name:\n        getTupleCreationCode(\n            to_name=value_name,\n            elements=expression.subnode_elements,\n            emit=emit,\n            context=context,\n        )\n\n\ndef getTupleCreationCode(to_name, elements, emit, context):\n    if _areConstants(elements):\n        to_name.getCType().emitAssignmentCodeFromConstant(\n            to_name=to_name,\n            constant=tuple(element.getCompileTimeConstant() for element in elements),\n            # TODO: Would depend on our target being escaping.\n            may_escape=True,\n            emit=emit,\n            context=context,\n        )\n    else:\n        element_name = context.allocateTempName(\"tuple_element\")\n\n        def generateElementCode(element):\n            generateExpressionCode(\n                to_name=element_name, expression=element, emit=emit, context=context\n            )\n\n            # Use helper that makes sure we provide a reference.\n            if context.needsCleanup(element_name):\n                context.removeCleanupTempName(element_name)\n                helper_code = \"PyTuple_SET_ITEM\"\n            else:\n                helper_code = \"PyTuple_SET_ITEM0\"\n\n            return helper_code\n\n        helper_code = generateElementCode(elements[0])\n\n        # TODO: Consider more compact tuple creation helpers\n        emit(\"%s = MAKE_TUPLE_EMPTY(%d);\" % (to_name, len(elements)))\n\n        needs_exception_exit = any(\n            element.mayRaiseException(BaseException) for element in elements[1:]\n        )\n\n        with withCleanupFinally(\n            \"tuple_build\", to_name, needs_exception_exit, emit, context\n        ) as guarded_emit:\n            emit = guarded_emit.emit\n\n            for count, element in enumerate(elements):\n                if count > 0:\n                    helper_code = generateElementCode(element)\n\n                emit(\"%s(%s, %d, %s);\" % (helper_code, to_name, count, element_name))\n\n\ndef generateBuiltinTupleCode(to_name, expression, emit, context):\n    generateCAPIObjectCode(\n        to_name=to_name,\n        capi=\"PySequence_Tuple\",\n        tstate=False,\n        arg_desc=((\"tuple_arg\", expression.subnode_value),),\n        may_raise=expression.mayRaiseException(BaseException),\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        source_ref=expression.getCompatibleSourceReference(),\n        emit=emit,\n        context=context,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/VariableCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Low level variable code generation.\n\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_int_or_long,\n)\nfrom nuitka.PythonVersions import python_version\n\nfrom .c_types.CTypeNuitkaBooleans import CTypeNuitkaBoolEnum\nfrom .c_types.CTypePyObjectPointers import (\n    CTypeCellObject,\n    CTypePyObjectPtr,\n    CTypePyObjectPtrPtr,\n)\nfrom .CodeHelpers import (\n    decideConversionCheckNeeded,\n    generateExpressionCode,\n    withObjectCodeTemporaryAssignment2,\n)\nfrom .ErrorCodes import (\n    getAssertionCode,\n    getErrorExitCode,\n    getLocalVariableReferenceErrorCode,\n    getNameReferenceErrorCode,\n)\nfrom .VariableDeclarations import VariableDeclaration\n\n\ndef generateAssignmentVariableCode(statement, emit, context):\n    assign_source = statement.subnode_source\n\n    variable = statement.getVariable()\n    variable_trace = statement.getVariableTrace()\n\n    if variable.isModuleVariable():\n        # Use \"object\" for module variables.\n        tmp_name = context.allocateTempName(\"assign_source\")\n    else:\n        source_shape = assign_source.getTypeShape()\n\n        variable_declaration = getLocalVariableDeclaration(\n            context, variable, variable_trace\n        )\n\n        if source_shape is tshape_bool and variable_declaration.c_type == \"nuitka_bool\":\n            tmp_name = context.allocateTempName(\"assign_source\", \"nuitka_bool\")\n        elif (\n            source_shape is tshape_int_or_long\n            and variable_declaration.c_type == \"nuitka_ilong\"\n        ):\n            tmp_name = context.allocateTempName(\"assign_source\", \"nuitka_ilong\")\n        else:\n            tmp_name = context.allocateTempName(\"assign_source\")\n\n    generateExpressionCode(\n        expression=assign_source, to_name=tmp_name, emit=emit, context=context\n    )\n\n    getVariableAssignmentCode(\n        tmp_name=tmp_name,\n        variable=variable,\n        variable_trace=variable_trace,\n        needs_release=statement.needsReleasePreviousValue(),\n        inplace=statement.isInplaceSuspect(),\n        emit=emit,\n        context=context,\n    )\n\n    # Ownership of that reference must have been transferred.\n    assert not context.needsCleanup(tmp_name)\n\n\ndef generateDelVariableCode(statement, emit, context):\n    with context.withCurrentSourceCodeReference(statement.getSourceReference()):\n        _getVariableDelCode(\n            variable=statement.getVariable(),\n            variable_trace=statement.variable_trace,\n            previous_trace=statement.previous_trace,\n            tolerant=statement.is_tolerant,\n            needs_check=statement.is_tolerant\n            or statement.mayRaiseException(BaseException),\n            emit=emit,\n            context=context,\n        )\n\n\ndef getVariableReferenceCode(\n    to_name, variable, variable_trace, needs_check, conversion_check, emit, context\n):\n    if variable.isModuleVariable():\n        owner = context.getOwner()\n\n        with withObjectCodeTemporaryAssignment2(\n            to_name, \"mvar_value\", conversion_check, emit, context\n        ) as value_name:\n            # TODO: Rather have this passed from a distinct node type, so inlining\n            # doesn't change things.\n\n            emit(\n                \"\"\"\\\n%(value_name)s = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)%(var_name)s);\n\nif (unlikely(%(value_name)s == NULL)) {\n    %(value_name)s = %(helper_code)s(tstate, %(var_name)s);\n}\n\"\"\"\n                % {\n                    \"helper_code\": (\n                        \"GET_MODULE_VARIABLE_VALUE_FALLBACK_IN_FUNCTION\"\n                        if python_version < 0x340\n                        and not owner.isCompiledPythonModule()\n                        and not owner.isExpressionClassBodyBase()\n                        else \"GET_MODULE_VARIABLE_VALUE_FALLBACK\"\n                    ),\n                    \"module_identifier\": context.getModuleCodeName(),\n                    \"value_name\": value_name,\n                    \"var_name\": context.getConstantCode(constant=variable.getName()),\n                }\n            )\n\n            getErrorExitCode(\n                check_name=value_name,\n                emit=emit,\n                context=context,\n                needs_check=needs_check,\n            )\n    else:\n        variable_declaration = getLocalVariableDeclaration(\n            context, variable, variable_trace\n        )\n\n        value_name = variable_declaration.getCType().emitValueAccessCode(\n            value_name=variable_declaration, emit=emit, context=context\n        )\n\n        if needs_check:\n            condition = value_name.getCType().getInitTestConditionCode(\n                value_name, inverted=True\n            )\n\n            getLocalVariableReferenceErrorCode(\n                variable=variable, condition=condition, emit=emit, context=context\n            )\n        else:\n            value_name.getCType().emitValueAssertionCode(\n                value_name=value_name, emit=emit\n            )\n\n        to_name.getCType().emitAssignConversionCode(\n            to_name=to_name,\n            value_name=value_name,\n            needs_check=conversion_check,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateVariableReferenceCode(to_name, expression, emit, context):\n    variable = expression.getVariable()\n    variable_trace = expression.getVariableTrace()\n\n    needs_check = expression.mayRaiseException(BaseException)\n\n    getVariableReferenceCode(\n        to_name=to_name,\n        variable=variable,\n        variable_trace=variable_trace,\n        needs_check=needs_check,\n        conversion_check=decideConversionCheckNeeded(to_name, expression),\n        emit=emit,\n        context=context,\n    )\n\n\ndef _getVariableCodeName(in_context, variable):\n    if in_context:\n        # Closure case:\n        return \"closure_\" + variable.getCodeName()\n    elif variable.isParameterVariable():\n        return \"par_\" + variable.getCodeName()\n    elif variable.isTempVariable():\n        return \"tmp_\" + variable.getCodeName()\n    else:\n        return \"var_\" + variable.getCodeName()\n\n\ndef getPickedCType(variable, context):\n    \"\"\"Return type to use for specific context.\"\"\"\n\n    user = context.getEntryPoint()\n    owner = variable.getEntryPoint()\n\n    if owner is user:\n        if variable.isSharedTechnically():\n            # TODO: That need not really be an impedient, we could share pointers to\n            # everything.\n\n            result = CTypeCellObject\n        else:\n            shapes = variable.getTypeShapes()\n\n            if len(shapes) != 1:\n                # Avoiding this for now, but we will have to use our enum\n                # based code variants, either generated or hard coded in\n                # the future.\n                result = CTypePyObjectPtr\n            else:\n                result = shapes.pop().getCType()\n\n    elif context.isForDirectCall():\n        if variable.isSharedTechnically():\n            result = CTypeCellObject\n        else:\n            result = CTypePyObjectPtrPtr\n    else:\n        result = CTypeCellObject\n\n    return result\n\n\ndef decideLocalVariableCodeType(context, variable):\n    # Now must be local or temporary variable.\n\n    # Complexity should be moved out of here, pylint: disable=too-many-branches\n\n    user = context.getOwner()\n    owner = variable.getOwner()\n\n    user = user.getEntryPoint()\n\n    prefix = \"\"\n\n    if owner.isExpressionOutlineFunctionBase():\n        entry_point = owner.getEntryPoint()\n\n        prefix = (\n            \"outline_%d_\"\n            % entry_point.getTraceCollection().getOutlineFunctions().index(owner)\n        )\n        owner = entry_point\n\n    if variable.isTempVariableBool():\n        c_type = CTypeNuitkaBoolEnum\n    else:\n        c_type = getPickedCType(variable, context)\n\n    if owner is user:\n        result = _getVariableCodeName(in_context=False, variable=variable)\n\n        result = prefix + result\n    elif context.isForDirectCall():\n        if user.isExpressionGeneratorObjectBody():\n            closure_index = user.getClosureVariableIndex(variable)\n\n            result = \"generator->m_closure[%d]\" % closure_index\n        elif user.isExpressionCoroutineObjectBody():\n            closure_index = user.getClosureVariableIndex(variable)\n\n            result = \"coroutine->m_closure[%d]\" % closure_index\n        elif user.isExpressionAsyncgenObjectBody():\n            closure_index = user.getClosureVariableIndex(variable)\n\n            result = \"asyncgen->m_closure[%d]\" % closure_index\n        else:\n            result = _getVariableCodeName(in_context=True, variable=variable)\n\n            result = prefix + result\n    else:\n        closure_index = user.getClosureVariableIndex(variable)\n\n        if user.isExpressionGeneratorObjectBody():\n            result = \"generator->m_closure[%d]\" % closure_index\n        elif user.isExpressionCoroutineObjectBody():\n            result = \"coroutine->m_closure[%d]\" % closure_index\n        elif user.isExpressionAsyncgenObjectBody():\n            result = \"asyncgen->m_closure[%d]\" % closure_index\n        else:\n            # TODO: If this were context.getContextObjectName() this would be\n            # a one liner.\n\n            result = \"self->m_closure[%d]\" % closure_index\n\n    return result, c_type\n\n\ndef getLocalVariableDeclaration(context, variable, variable_trace):\n    # TODO: Decide if we will use variable trace, pylint: disable=unused-argument\n\n    # Now must be local or temporary variable.\n\n    user = context.getOwner()\n    owner = variable.getOwner()\n\n    user = user.getEntryPoint()\n\n    prefix = \"\"\n\n    if owner.isExpressionOutlineFunctionBase():\n        entry_point = owner.getEntryPoint()\n\n        prefix = (\n            \"outline_%d_\"\n            % entry_point.getTraceCollection().getOutlineFunctions().index(owner)\n        )\n        owner = entry_point\n\n    if owner is user:\n        result = _getVariableCodeName(in_context=False, variable=variable)\n\n        result = prefix + result\n\n        result = context.variable_storage.getVariableDeclarationTop(result)\n\n        assert result is not None, variable\n\n        return result\n    else:\n        closure_index = user.getClosureVariableIndex(variable)\n\n        return context.variable_storage.getVariableDeclarationClosure(closure_index)\n\n\ndef getVariableAssignmentCode(\n    context, emit, variable, variable_trace, tmp_name, needs_release, inplace\n):\n    # For transfer of ownership.\n    if context.needsCleanup(tmp_name):\n        ref_count = 1\n    else:\n        ref_count = 0\n\n    if variable.isModuleVariable():\n        variable_declaration = VariableDeclaration(\n            \"module_var\", variable.getName(), None, None\n        )\n    else:\n        variable_declaration = getLocalVariableDeclaration(\n            context, variable, variable_trace\n        )\n\n        assert variable_declaration, (variable, context)\n\n        if variable.isLocalVariable():\n            context.setVariableType(variable, variable_declaration)\n\n    variable_declaration.getCType().emitVariableAssignCode(\n        value_name=variable_declaration,\n        needs_release=needs_release,\n        tmp_name=tmp_name,\n        ref_count=ref_count,\n        inplace=inplace,\n        emit=emit,\n        context=context,\n    )\n\n    if ref_count:\n        context.removeCleanupTempName(tmp_name)\n\n\ndef _getVariableDelCode(\n    variable, variable_trace, previous_trace, tolerant, needs_check, emit, context\n):\n    if variable.isModuleVariable():\n        variable_declaration_old = VariableDeclaration(\n            \"module_var\", variable.getName(), None, None\n        )\n        variable_declaration_new = variable_declaration_old\n    else:\n        variable_declaration_old = getLocalVariableDeclaration(\n            context, variable, previous_trace\n        )\n        variable_declaration_new = getLocalVariableDeclaration(\n            context, variable, variable_trace\n        )\n\n        # TODO: We need to split this operation in two parts. Release and init\n        # are not one thing, until then require this.\n        assert variable_declaration_old == variable_declaration_new\n\n        if variable.isLocalVariable():\n            context.setVariableType(variable, variable_declaration_new)\n\n    if needs_check and not tolerant:\n        to_name = context.getBoolResName()\n    else:\n        to_name = None\n\n    variable_declaration_old.getCType().getDeleteObjectCode(\n        to_name=to_name,\n        value_name=variable_declaration_old,\n        tolerant=tolerant,\n        needs_check=needs_check,\n        emit=emit,\n        context=context,\n    )\n\n    if to_name is not None:\n        if variable.isModuleVariable():\n            getNameReferenceErrorCode(\n                variable_name=variable.getName(),\n                condition=\"%s == false\" % to_name,\n                emit=emit,\n                context=context,\n            )\n        elif variable.isLocalVariable():\n            getLocalVariableReferenceErrorCode(\n                variable=variable,\n                condition=\"%s == false\" % to_name,\n                emit=emit,\n                context=context,\n            )\n        else:\n            getAssertionCode(check=\"%s != false\" % to_name, emit=emit)\n\n\ndef generateVariableReleaseCode(statement, emit, context):\n    variable = statement.getVariable()\n\n    # Only for normal variables we do this.\n    assert not variable.isModuleVariable()\n\n    variable_trace = statement.getVariableTrace()\n\n    if variable.isSharedTechnically():\n        # TODO: We might start to not allocate the cell object, then a check\n        # would be due. But currently we always allocate it.\n        needs_check = False\n    else:\n        needs_check = not variable_trace.mustHaveValue()\n\n    value_name = getLocalVariableDeclaration(context, variable, variable_trace)\n\n    c_type = value_name.getCType()\n\n    if not needs_check:\n        c_type.emitReleaseAssertionCode(value_name=value_name, emit=emit)\n\n    c_type.getReleaseCode(value_name=value_name, needs_check=needs_check, emit=emit)\n\n    c_type.emitReinitCode(value_name=value_name, emit=emit)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/VariableDeclarations.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Variable declarations\nHolds the information necessary to make C code declarations related to a variable.\n\n\"\"\"\n\nfrom contextlib import contextmanager\n\nfrom .c_types.CTypeBooleans import CTypeBool\nfrom .c_types.CTypeCFloats import CTypeCFloat\nfrom .c_types.CTypeCLongs import CTypeCLong, CTypeCLongDigit\nfrom .c_types.CTypeModuleDictVariables import CTypeModuleDictVariable\nfrom .c_types.CTypeNuitkaBooleans import CTypeNuitkaBoolEnum\nfrom .c_types.CTypeNuitkaInts import CTypeNuitkaIntOrLongStruct\nfrom .c_types.CTypeNuitkaVoids import CTypeNuitkaVoidEnum\nfrom .c_types.CTypePyObjectPointers import (\n    CTypeCellObject,\n    CTypePyObjectPtr,\n    CTypePyObjectPtrPtr,\n)\n\n\nclass VariableDeclaration(object):\n    __slots__ = (\"c_type\", \"code_name\", \"init_value\", \"heap_name\", \"maybe_unused\")\n\n    def __init__(self, c_type, code_name, init_value, heap_name):\n        if c_type.startswith(\"NUITKA_MAY_BE_UNUSED\"):\n            self.c_type = c_type[21:]\n            self.maybe_unused = True\n        else:\n            self.c_type = c_type\n            self.maybe_unused = False\n\n        self.code_name = code_name\n        self.init_value = init_value\n        self.heap_name = heap_name\n\n    def makeCFunctionLevelDeclaration(self):\n        pos = self.c_type.find(\"[\")\n        if pos != -1:\n            lead_c_type = self.c_type[:pos]\n            suffix_c_type = self.c_type[pos:]\n        else:\n            lead_c_type = self.c_type\n            suffix_c_type = \"\"\n\n        return \"%s%s%s%s%s%s;\" % (\n            \"NUITKA_MAY_BE_UNUSED \" if self.maybe_unused else \"\",\n            lead_c_type,\n            \" \" if lead_c_type[-1] != \"*\" else \"\",\n            self.code_name,\n            \"\" if self.init_value is None else \" = %s\" % self.init_value,\n            suffix_c_type,\n        )\n\n    def makeCStructDeclaration(self):\n        c_type = self.c_type\n\n        if \"[\" in c_type:\n            array_decl = c_type[c_type.find(\"[\") :]\n            c_type = c_type[: c_type.find(\"[\")]\n        else:\n            array_decl = \"\"\n\n        return \"%s%s%s%s;\" % (\n            c_type,\n            \" \" if self.c_type[-1] != \"*\" else \"\",\n            self.code_name,\n            array_decl,\n        )\n\n    def makeCStructInit(self):\n        if self.init_value is None:\n            return None\n\n        assert self.heap_name, repr(self)\n\n        return \"%s%s = %s;\" % (\n            ((self.heap_name + \"->\") if self.heap_name is not None else \"\"),\n            self.code_name,\n            self.init_value,\n        )\n\n    def getCType(self):\n        # TODO: This ought to become unnecessary function\n        # In the mean time, many cases: pylint: disable=too-many-return-statements\n\n        c_type = self.c_type\n\n        if c_type == \"PyObject *\":\n            return CTypePyObjectPtr\n        elif c_type == \"struct Nuitka_CellObject *\":\n            return CTypeCellObject\n        elif c_type == \"PyObject **\":\n            return CTypePyObjectPtrPtr\n        elif c_type == \"nuitka_bool\":\n            return CTypeNuitkaBoolEnum\n        elif c_type == \"bool\":\n            return CTypeBool\n        elif c_type == \"nuitka_ilong\":\n            return CTypeNuitkaIntOrLongStruct\n        elif c_type == \"module_var\":\n            return CTypeModuleDictVariable\n        elif c_type == \"nuitka_void\":\n            return CTypeNuitkaVoidEnum\n        elif c_type == \"long\":\n            return CTypeCLong\n        elif c_type == \"nuitka_digit\":\n            return CTypeCLongDigit\n        elif c_type == \"double\":\n            return CTypeCFloat\n\n        assert False, c_type\n\n    def __str__(self):\n        if self.heap_name:\n            return \"%s->%s\" % (self.heap_name, self.code_name)\n        else:\n            return self.code_name\n\n    def __repr__(self):\n        return \"<VariableDeclaration %s %s = %r>\" % (\n            self.c_type,\n            self.code_name,\n            self.init_value,\n        )\n\n\nclass VariableStorage(object):\n    __slots__ = (\n        \"heap_name\",\n        \"variable_declarations_heap\",\n        \"variable_declarations_main\",\n        \"variable_declarations_closure\",\n        \"variable_declarations_locals\",\n        \"exception_variable_declarations\",\n    )\n\n    def __init__(self, heap_name):\n        self.heap_name = heap_name\n\n        self.variable_declarations_heap = []\n        self.variable_declarations_main = []\n        self.variable_declarations_closure = []\n\n        self.variable_declarations_locals = []\n\n        self.exception_variable_declarations = None\n\n    @contextmanager\n    def withLocalStorage(self):\n        \"\"\"Local storage for only just during context usage.\n\n        This is for automatic removal of that scope. These are supposed\n        to be nestable eventually.\n\n        \"\"\"\n\n        self.variable_declarations_locals.append([])\n\n        yield\n\n        self.variable_declarations_locals.pop()\n\n    def getVariableDeclarationTop(self, code_name):\n        for variable_declaration in self.variable_declarations_main:\n            if variable_declaration.code_name == code_name:\n                return variable_declaration\n\n        for variable_declaration in self.variable_declarations_heap:\n            if variable_declaration.code_name == code_name:\n                return variable_declaration\n\n        return None\n\n    def getVariableDeclarationClosure(self, closure_index):\n        return self.variable_declarations_closure[closure_index]\n\n    def addFrameCacheDeclaration(self, frame_identifier):\n        return self.addVariableDeclarationFunction(\n            \"static struct Nuitka_FrameObject *\", \"cache_%s\" % frame_identifier, \"NULL\"\n        )\n\n    def makeCStructLevelDeclarations(self):\n        return [\n            variable_declaration.makeCStructDeclaration()\n            for variable_declaration in self.variable_declarations_heap\n        ]\n\n    def makeCStructInits(self):\n        return [\n            variable_declaration.makeCStructInit()\n            for variable_declaration in self.variable_declarations_heap\n            if variable_declaration.init_value is not None\n        ]\n\n    def getExceptionVariableDescriptions(self):\n        if self.exception_variable_declarations is None:\n            self.exception_variable_declarations = (\n                self.addVariableDeclarationTop(\"PyObject *\", \"exception_type\", \"NULL\"),\n                self.addVariableDeclarationTop(\"PyObject *\", \"exception_value\", \"NULL\"),\n                self.addVariableDeclarationTop(\n                    \"PyTracebackObject *\", \"exception_tb\", \"NULL\"\n                ),\n                self.addVariableDeclarationTop(\n                    \"NUITKA_MAY_BE_UNUSED int\", \"exception_lineno\", \"0\"\n                ),\n            )\n\n        return self.exception_variable_declarations\n\n    def addVariableDeclarationLocal(self, c_type, code_name):\n        result = VariableDeclaration(c_type, code_name, None, None)\n\n        self.variable_declarations_locals[-1].append(result)\n\n        return result\n\n    def addVariableDeclarationClosure(self, c_type, code_name):\n        result = VariableDeclaration(c_type, code_name, None, None)\n\n        self.variable_declarations_closure.append(result)\n\n        return result\n\n    def addVariableDeclarationFunction(self, c_type, code_name, init_value):\n        result = VariableDeclaration(c_type, code_name, init_value, None)\n\n        self.variable_declarations_main.append(result)\n\n        return result\n\n    def addVariableDeclarationTop(self, c_type, code_name, init_value):\n        result = VariableDeclaration(c_type, code_name, init_value, self.heap_name)\n\n        if self.heap_name is not None:\n            self.variable_declarations_heap.append(result)\n        else:\n            self.variable_declarations_main.append(result)\n\n        return result\n\n    def makeCLocalDeclarations(self):\n        return [\n            variable_declaration.makeCFunctionLevelDeclaration()\n            for variable_declaration in self.variable_declarations_locals[-1]\n        ]\n\n    def makeCFunctionLevelDeclarations(self):\n        return [\n            variable_declaration.makeCFunctionLevelDeclaration()\n            for variable_declaration in self.variable_declarations_main\n        ]\n\n    def getLocalPreservationDeclarations(self):\n        result = []\n\n        for variable_declarations_local in self.variable_declarations_locals:\n            result.extend(variable_declarations_local)\n\n        return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/YieldCodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Yield related codes.\n\nThe normal \"yield\", and the Python 3.3 or higher \"yield from\" variant.\n\"\"\"\n\nfrom .CodeHelpers import (\n    generateChildExpressionsCode,\n    withObjectCodeTemporaryAssignment,\n)\nfrom .ErrorCodes import getErrorExitCode\nfrom .PythonAPICodes import getReferenceExportCode\nfrom .VariableDeclarations import VariableDeclaration\n\n\ndef _getYieldPreserveCode(\n    to_name, value_name, preserve_exception, yield_code, resume_code, emit, context\n):\n    yield_return_label = context.allocateLabel(\"yield_return\")\n    yield_return_index = yield_return_label.split(\"_\")[-1]\n\n    locals_preserved = context.variable_storage.getLocalPreservationDeclarations()\n\n    # Need not preserve it, if we are not going to use it for the purpose\n    # of releasing it.\n    if type(value_name) is tuple:\n        value_names = value_name\n    else:\n        value_names = (value_name,)\n\n    for name in value_names:\n        if not context.needsCleanup(name):\n            locals_preserved.remove(name)\n\n    # Target name is not assigned, no need to preserve it.\n    if to_name in locals_preserved:\n        locals_preserved.remove(to_name)\n\n    if locals_preserved:\n        yield_tmp_storage = context.variable_storage.getVariableDeclarationTop(\n            \"yield_tmps\"\n        )\n\n        if yield_tmp_storage is None:\n            yield_tmp_storage = context.variable_storage.addVariableDeclarationTop(\n                \"char[1024]\", \"yield_tmps\", None\n            )\n\n        emit(\n            \"Nuitka_PreserveHeap(%s, %s, NULL);\"\n            % (\n                yield_tmp_storage,\n                \", \".join(\n                    \"&%s, sizeof(%s)\" % (local_preserved, local_preserved.c_type)\n                    for local_preserved in locals_preserved\n                ),\n            )\n        )\n\n    if preserve_exception:\n        # Expands to SAVE_GENERATOR_EXCEPTION,SAVE_COROUTINE_EXCEPTION,SAVE_ASYNCGEN_EXCEPTION\n        emit(\n            \"SAVE_%s_EXCEPTION(tstate, %s);\"\n            % (context.getContextObjectName().upper(), context.getContextObjectName())\n        )\n\n    emit(\n        \"\"\"\\\n%(context_object_name)s->m_yield_return_index = %(yield_return_index)s;\"\"\"\n        % {\n            \"context_object_name\": context.getContextObjectName(),\n            \"yield_return_index\": yield_return_index,\n        }\n    )\n\n    emit(yield_code)\n\n    emit(\"%(yield_return_label)s:\" % {\"yield_return_label\": yield_return_label})\n\n    if preserve_exception:\n        # Expands to RESTORE_GENERATOR_EXCEPTION,RESTORE_COROUTINE_EXCEPTION,RESTORE_ASYNCGEN_EXCEPTION\n        emit(\n            \"RESTORE_%s_EXCEPTION(tstate, %s);\"\n            % (context.getContextObjectName().upper(), context.getContextObjectName())\n        )\n\n    if locals_preserved:\n        emit(\n            \"Nuitka_RestoreHeap(%s, %s, NULL);\"\n            % (\n                yield_tmp_storage,\n                \", \".join(\n                    \"&%s, sizeof(%s)\" % (local_preserved, local_preserved.c_type)\n                    for local_preserved in locals_preserved\n                ),\n            )\n        )\n\n    if resume_code:\n        emit(resume_code)\n\n    yield_return_name = VariableDeclaration(\n        \"PyObject *\", \"yield_return_value\", None, None\n    )\n\n    getErrorExitCode(check_name=yield_return_name, emit=emit, context=context)\n\n    # Called with object, so we can simply do this.\n    emit(\"%s = %s;\" % (to_name, yield_return_name))\n    context.addCleanupTempName(to_name)\n\n\ndef generateYieldCode(to_name, expression, emit, context):\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # In handlers, we must preserve/restore the exception.\n    preserve_exception = expression.isExceptionPreserving()\n\n    getReferenceExportCode(value_name, emit, context)\n    if context.needsCleanup(value_name):\n        context.removeCleanupTempName(value_name)\n\n    yield_code = \"return %(yielded_value)s;\" % {\"yielded_value\": value_name}\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"yield_result\", expression, emit, context\n    ) as result_name:\n        _getYieldPreserveCode(\n            to_name=result_name,\n            value_name=value_name,\n            yield_code=yield_code,\n            resume_code=None,\n            preserve_exception=preserve_exception,\n            emit=emit,\n            context=context,\n        )\n\n        # This conversion will not use it, and since it is borrowed, debug mode\n        # would otherwise complain.\n        if to_name.c_type == \"nuitka_void\":\n            result_name.maybe_unused = True\n\n        # Comes as only borrowed.\n        # context.addCleanupTempName(result_name)\n\n\ndef generateYieldFromCode(to_name, expression, emit, context):\n    (value_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    # In handlers, we must preserve/restore the exception.\n    preserve_exception = expression.isExceptionPreserving()\n\n    getReferenceExportCode(value_name, emit, context)\n    if context.needsCleanup(value_name):\n        context.removeCleanupTempName(value_name)\n\n    yield_code = \"\"\"\\\ngenerator->m_yield_from = %(yield_from)s;\nreturn NULL;\n\"\"\" % {\n        \"yield_from\": value_name\n    }\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"yieldfrom_result\", expression, emit, context\n    ) as result_name:\n        _getYieldPreserveCode(\n            to_name=result_name,\n            value_name=value_name,\n            yield_code=yield_code,\n            resume_code=None,\n            preserve_exception=preserve_exception,\n            emit=emit,\n            context=context,\n        )\n\n\ndef generateYieldFromAwaitableCode(to_name, expression, emit, context):\n    # In handlers, we must preserve/restore the exception.\n    preserve_exception = expression.isExceptionPreserving()\n\n    (awaited_name,) = generateChildExpressionsCode(\n        expression=expression, emit=emit, context=context\n    )\n\n    yield_code = \"\"\"\\\n%(object_name)s->m_yield_from = %(yield_from)s;\n%(object_name)s->m_awaiting = true;\nreturn NULL;\n\"\"\" % {\n        \"object_name\": context.getContextObjectName(),\n        \"yield_from\": awaited_name,\n    }\n\n    resume_code = \"\"\"\\\n%(object_name)s->m_awaiting = false;\n\"\"\" % {\n        \"object_name\": context.getContextObjectName()\n    }\n\n    getReferenceExportCode(awaited_name, emit, context)\n    if context.needsCleanup(awaited_name):\n        context.removeCleanupTempName(awaited_name)\n\n    with withObjectCodeTemporaryAssignment(\n        to_name, \"await_result\", expression, emit, context\n    ) as result_name:\n        _getYieldPreserveCode(\n            to_name=result_name,\n            value_name=awaited_name,\n            yield_code=yield_code,\n            resume_code=resume_code,\n            preserve_exception=preserve_exception,\n            emit=emit,\n            context=context,\n        )\n\n\ndef getYieldReturnDispatchCode(context):\n    function_dispatch = [\n        \"case %(index)d: goto yield_return_%(index)d;\" % {\"index\": yield_index}\n        for yield_index in range(context.getLabelCount(\"yield_return\"), 0, -1)\n    ]\n\n    if function_dispatch:\n        function_dispatch.insert(\n            0, \"switch(%s->m_yield_return_index) {\" % context.getContextObjectName()\n        )\n        function_dispatch.append(\"}\")\n\n    return function_dispatch\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeBases.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Base class for all C types.\n\nDefines the interface to use by code generation on C types. Different\ntypes then have to overload the class methods.\n\"\"\"\n\ntype_indicators = {\n    \"PyObject *\": \"o\",\n    \"PyObject **\": \"O\",\n    \"struct Nuitka_CellObject *\": \"c\",\n    \"nuitka_bool\": \"b\",\n    \"nuitka_ilong\": \"L\",\n}\n\n\nclass CTypeBase(object):\n    # For overload.\n    c_type = None\n\n    @classmethod\n    def getTypeIndicator(cls):\n        return type_indicators[cls.c_type]\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        \"\"\"Convert to init value for the type.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        \"\"\"Get code to test for uninitialized.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        \"\"\"Get code to assign local variable.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        \"\"\"Get code to delete (del) local variable.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getVariableArgReferencePassingCode(cls, variable_code_name):\n        \"\"\"Get code to pass variable as reference argument.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getVariableArgDeclarationCode(cls, variable_code_name):\n        \"\"\"Get variable declaration code with given name.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getCellObjectAssignmentCode(cls, target_cell_code, variable_code_name, emit):\n        \"\"\"Get assignment code to given cell object from object.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        \"\"\"Get the assignment code from C boolean condition.\"\"\"\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitAssignmentCodeToNuitkaIntOrLong(\n        cls, to_name, value_name, needs_check, emit, context\n    ):\n        \"\"\"Get the assignment code to int or long type.\"\"\"\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, to_name\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        \"\"\"Get release code for given object.\"\"\"\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitReinitCode(cls, value_name, emit):\n        \"\"\"Get release code for given object.\"\"\"\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def getTakeReferenceCode(cls, value_name, emit):\n        \"\"\"Take reference code for given object.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitTruthCheckCode(cls, to_name, value_name, emit):\n        \"\"\"Check the truth of a value and indicate exception to an int.\"\"\"\n        assert to_name.c_type == \"int\", to_name\n\n        emit(\"%s = %s ? 1 : 0;\" % (to_name, cls.getTruthCheckCode(value_name)))\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        \"\"\"Assert that the value is not unassigned.\"\"\"\n\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n    @classmethod\n    def emitReleaseAssertionCode(cls, value_name, emit):\n        \"\"\"Assert that the container of the value is not released already of unassigned.\"\"\"\n        cls.emitValueAssertionCode(value_name, emit)\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        # Need to overload this for each type it is used for, pylint: disable=unused-argument\n        assert False, cls.c_type\n\n\nclass CTypeNotReferenceCountedMixin(object):\n    \"\"\"Mixin for C types, that have no reference counting mechanism.\"\"\"\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        # If no check is needed, assert it for debug mode.\n        if not needs_check:\n            cls.emitValueAssertionCode(value_name, emit=emit)\n\n    @classmethod\n    def getTakeReferenceCode(cls, value_name, emit):\n        pass\n\n    @classmethod\n    def emitReleaseAssertionCode(cls, value_name, emit):\n        pass\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeBooleans.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for C bool, this cannot represent unassigned, nor indicate exception.\n\n\"\"\"\n\nfrom .CTypeBases import CTypeBase, CTypeNotReferenceCountedMixin\n\n\nclass CTypeBool(CTypeNotReferenceCountedMixin, CTypeBase):\n    c_type = \"bool\"\n\n    # Return value only obviously.\n    helper_code = \"CBOOL\"\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing to do for this type, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        pass\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        # Conversion cannot fail really.\n        if value_name.c_type == cls.c_type:\n            emit(\"%s = %s;\" % (to_name, value_name))\n        else:\n            emit(\n                \"%s = %s;\"\n                % (\n                    to_name,\n                    value_name.getCType().getTruthCheckCode(value_name=value_name),\n                )\n            )\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # No context needed, pylint: disable=unused-argument\n        emit(\"%s = %s;\" % (to_name, \"true\" if constant else \"false\"))\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        return \"<not_possible>\"\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"<not_possible>\"\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        assert False\n\n    @classmethod\n    def emitAssignmentCodeToNuitkaBool(\n        cls, to_name, value_name, needs_check, emit, context\n    ):\n        # Half way, virtual method: pylint: disable=unused-argument\n        emit(\"%s = %s ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\" % (to_name, value_name))\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        emit(\"%s = (%s) ? true : false;\" % (to_name, condition))\n\n    @classmethod\n    def emitAssignInplaceNegatedValueCode(cls, to_name, needs_check, emit, context):\n        # Half way, virtual method: pylint: disable=unused-argument\n        emit(\"%s = !%s;\" % (to_name, to_name))\n\n    @classmethod\n    def getExceptionCheckCondition(cls, value_name):\n        # Expected to not be used, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def hasErrorIndicator(cls):\n        return False\n\n    @classmethod\n    def getTruthCheckCode(cls, value_name):\n        return \"%s != false\" % value_name\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeCFloats.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for C \"float\" (double), (used in conjunction with PyFloatObject *)\n\n\"\"\"\n\nfrom math import copysign, isinf, isnan\n\nfrom .CTypeBases import CTypeBase\n\n\nclass CTypeCFloat(CTypeBase):\n    c_type = \"double\"\n\n    helper_code = \"CFLOAT\"\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # No context needed, pylint: disable=unused-argument\n        if constant == 0.0:\n            if copysign(1, constant) == 1:\n                c_constant = \"0.0\"\n            else:\n                c_constant = \"-0.0\"\n        elif isnan(constant):\n            if copysign(1, constant) == 1:\n                c_constant = \"NAN\"\n            else:\n                c_constant = \"-NAN\"\n        elif isinf(constant):\n            if copysign(1, constant) == 1:\n                c_constant = \"HUGE_VAL\"\n            else:\n                c_constant = \"-HUGE_VAL\"\n        else:\n            c_constant = constant\n\n        emit(\"%s = %s;\" % (to_name, c_constant))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeCLongs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for C \"long\", and C \"digit\" (used in conjunction with PyLongObject *)\n\n\"\"\"\n\nfrom .CTypeBases import CTypeBase\n\n\nclass CTypeCLongMixin(CTypeBase):\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # No context needed, pylint: disable=unused-argument\n        emit(\"%s = %s;\" % (to_name, constant))\n\n\nclass CTypeCLong(CTypeCLongMixin, CTypeBase):\n    c_type = \"long\"\n\n    helper_code = \"CLONG\"\n\n\nclass CTypeCLongDigit(CTypeCLongMixin, CTypeBase):\n    c_type = \"nuitka_digit\"\n\n    helper_code = \"DIGIT\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeModuleDictVariables.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Pseudo CType for module variables, object values contained in a dictionary.\n\n    These are to integrate module variables with what is normally local\n    stuff. Going from an to \"PyObject *\" is mostly its trick, then put\n    into the dict.\n\n\"\"\"\n\nfrom nuitka.code_generation.templates.CodeTemplatesVariables import (\n    template_del_global_known,\n    template_del_global_unclear,\n    template_read_mvar_unclear,\n)\n\nfrom .CTypeBases import CTypeBase\n\n\nclass CTypeModuleDictVariable(CTypeBase):\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        if inplace:\n            orig_name = context.getInplaceLeftName()\n\n            emit(\n                \"\"\"\\\nif (%(orig_name)s != %(tmp_name)s) {\n    UPDATE_STRING_DICT_INPLACE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)%(variable_name_str)s, %(tmp_name)s);\n}\"\"\"\n                % {\n                    \"orig_name\": orig_name,\n                    \"tmp_name\": tmp_name,\n                    \"module_identifier\": context.getModuleCodeName(),\n                    \"variable_name_str\": context.getConstantCode(\n                        constant=value_name.code_name\n                    ),\n                }\n            )\n\n        else:\n            emit(\n                \"UPDATE_STRING_DICT%s(moduledict_%s, (Nuitka_StringObject *)%s, %s);\"\n                % (\n                    ref_count,\n                    context.getModuleCodeName(),\n                    context.getConstantCode(constant=value_name.code_name),\n                    tmp_name,\n                )\n            )\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        tmp_name = context.allocateTempName(\"mvar_value\")\n\n        emit(\n            template_read_mvar_unclear\n            % {\n                \"module_identifier\": context.getModuleCodeName(),\n                \"tmp_name\": tmp_name,\n                \"var_name\": context.getConstantCode(constant=value_name.code_name),\n            }\n        )\n\n        return tmp_name\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        if not needs_check or tolerant:\n            emit(\n                template_del_global_known\n                % {\n                    \"module_identifier\": context.getModuleCodeName(),\n                    \"var_name\": context.getConstantCode(constant=value_name.code_name),\n                }\n            )\n        else:\n            emit(\n                template_del_global_unclear\n                % {\n                    \"module_identifier\": context.getModuleCodeName(),\n                    \"result\": to_name,\n                    \"var_name\": context.getConstantCode(constant=value_name.code_name),\n                }\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeNuitkaBooleans.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for nuitka_bool, an enum to represent True, False, unassigned.\n\n\"\"\"\n\nfrom nuitka.code_generation.ErrorCodes import getReleaseCode\n\nfrom .CTypeBases import CTypeBase, CTypeNotReferenceCountedMixin\n\n\nclass CTypeNuitkaBoolEnum(CTypeNotReferenceCountedMixin, CTypeBase):\n    c_type = \"nuitka_bool\"\n\n    helper_code = \"NBOOL\"\n\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        assert not inplace\n\n        if tmp_name.c_type == \"nuitka_bool\":\n            emit(\"%s = %s;\" % (value_name, tmp_name))\n        else:\n            if tmp_name.c_type == \"PyObject *\":\n                test_code = \"%s == Py_True\" % tmp_name\n            else:\n                assert False, tmp_name\n\n            cls.emitAssignmentCodeFromBoolCondition(\n                to_name=value_name, condition=test_code, emit=emit\n            )\n\n            # TODO: Refcount and context needs release are redundant.\n            if ref_count:\n                getReleaseCode(tmp_name, emit, context)\n\n    @classmethod\n    def emitAssignmentCodeToNuitkaIntOrLong(\n        cls, to_name, value_name, needs_check, emit, context\n    ):\n        assert False, to_name\n\n    @classmethod\n    def getTruthCheckCode(cls, value_name):\n        return \"%s == NUITKA_BOOL_TRUE\" % value_name\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing to do for this type, pylint: disable=unused-argument\n        return value_name\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        emit(\"assert(%s != NUITKA_BOOL_UNASSIGNED);\" % value_name)\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        if value_name.c_type == cls.c_type:\n            emit(\"%s = %s;\" % (to_name, value_name))\n        else:\n            value_name.getCType().emitAssignmentCodeToNuitkaBool(\n                to_name=to_name,\n                value_name=value_name,\n                needs_check=needs_check,\n                emit=emit,\n                context=context,\n            )\n\n            getReleaseCode(value_name, emit, context)\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # No context needed, pylint: disable=unused-argument\n        emit(\n            \"%s = %s;\"\n            % (to_name, \"NUITKA_BOOL_TRUE\" if constant else \"NUITKA_BOOL_FALSE\")\n        )\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        if init_from is None:\n            return \"NUITKA_BOOL_UNASSIGNED\"\n        else:\n            assert False, init_from\n            return init_from\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"%s %s NUITKA_BOOL_UNASSIGNED\" % (value_name, \"==\" if inverted else \"!=\")\n\n    @classmethod\n    def emitReinitCode(cls, value_name, emit):\n        emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        if not needs_check:\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n        elif tolerant:\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n        else:\n            emit(\"%s = %s != NUITKA_BOOL_UNASSIGNED;\" % (to_name, value_name))\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        emit(\n            \"%(to_name)s = (%(condition)s) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\"\n            % {\"to_name\": to_name, \"condition\": condition}\n        )\n\n    @classmethod\n    def emitAssignInplaceNegatedValueCode(cls, to_name, needs_check, emit, context):\n        # Half way, virtual method: pylint: disable=unused-argument\n        cls.emitValueAssertionCode(to_name, emit=emit)\n        emit(\"assert(%s != NUITKA_BOOL_EXCEPTION);\" % to_name)\n\n        cls.emitAssignmentCodeFromBoolCondition(\n            to_name=to_name, condition=\"%s == NUITKA_BOOL_FALSE\" % to_name, emit=emit\n        )\n\n    @classmethod\n    def getExceptionCheckCondition(cls, value_name):\n        return \"%s == NUITKA_BOOL_EXCEPTION\" % value_name\n\n    @classmethod\n    def hasErrorIndicator(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeNuitkaInts.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for nuitka_ilong, a struct to represent long values.\n\n\"\"\"\n\nfrom nuitka.code_generation.templates.CodeTemplatesVariables import (\n    template_release_object_clear,\n    template_release_object_unclear,\n)\n\nfrom .CTypeBases import CTypeBase\n\n\nclass CTypeNuitkaIntOrLongStruct(CTypeBase):\n    c_type = \"nuitka_ilong\"\n\n    helper_code = \"NILONG\"\n\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        assert not inplace\n\n        if tmp_name.c_type == \"nuitka_ilong\":\n            emit(\"%s = %s;\" % (value_name, tmp_name))\n\n            if ref_count:\n                emit(\"/* REFCOUNT ? */\")\n\n        else:\n            if tmp_name.c_type == \"PyObject *\":\n                emit(\"%s.validity = NUITKA_ILONG_OBJECT_VALID;\" % value_name)\n                emit(\"%s.ilong_object = %s;\" % (value_name, tmp_name))\n\n                if ref_count:\n                    emit(\"/* REFCOUNT ? */\")\n            else:\n                assert False, repr(tmp_name)\n\n    @classmethod\n    def emitVariantAssignmentCode(cls, int_name, value_name, int_value, emit, context):\n        # needs no context, pylint: disable=unused-argument\n        if value_name is None:\n            assert int_value is not None\n            assert False  # TODO\n        else:\n            if int_value is None:\n                emit(\"%s.validity = NUITKA_ILONG_OBJECT_VALID;\" % int_name)\n                emit(\"%s.ilong_object = %s;\" % (int_name, value_name))\n            else:\n                emit(\"%s.validity = NUITKA_ILONG_BOTH_VALID;\" % int_name)\n                emit(\"%s.ilong_object = %s;\" % (int_name, value_name))\n                emit(\"%s.ilong_value = %s;\" % (int_name, int_value))\n\n    @classmethod\n    def getTruthCheckCode(cls, value_name):\n        return \"%s != 0\" % value_name\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing to do for this type, pylint: disable=unused-argument\n        return value_name\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        emit(\"assert(%s.validity != NUITKA_ILONG_UNASSIGNED);\" % value_name)\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        if value_name.c_type == cls.c_type:\n            emit(\"%s = %s;\" % (to_name, value_name))\n        else:\n            value_name.getCType().emitAssignmentCodeToNuitkaIntOrLong(\n                to_name=to_name,\n                value_name=value_name,\n                needs_check=needs_check,\n                emit=emit,\n                context=context,\n            )\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        if init_from is None:\n            # TODO: In debug mode, use more crash prone maybe.\n            return \"{NUITKA_ILONG_UNASSIGNED, NULL, 0}\"\n        else:\n            assert False, init_from\n            return init_from\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"%s.validity %s NUITKA_ILONG_UNASSIGNED\" % (\n            value_name,\n            \"==\" if inverted else \"!=\",\n        )\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        emit(\n            \"if ((%s.validity & NUITKA_ILONG_OBJECT_VALID) == NUITKA_ILONG_OBJECT_VALID) {\"\n            % value_name\n        )\n\n        # TODO: Have a derived C type that does it.\n\n        if needs_check:\n            template = template_release_object_unclear\n        else:\n            template = template_release_object_clear\n\n        emit(template % {\"identifier\": \"%s.ilong_object\" % value_name})\n\n        emit(\"}\")\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        assert False, \"TODO\"\n\n        if not needs_check:\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n        elif tolerant:\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n        else:\n            emit(\"%s = %s == NUITKA_BOOL_UNASSIGNED;\" % (to_name, value_name))\n            emit(\"%s = NUITKA_BOOL_UNASSIGNED;\" % value_name)\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        assert False, \"TODO\"\n\n        emit(\n            \"%(to_name)s = (%(condition)s) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\"\n            % {\"to_name\": to_name, \"condition\": condition}\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeNuitkaVoids.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType enum class for void, a special value to represent discarding stuff.\n\nCannot be read from obviously. Also drops references immediately when trying\nto assign to it, but allows to check for exception.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.code_generation.ErrorCodes import getReleaseCode\n\nfrom .CTypeBases import CTypeBase, CTypeNotReferenceCountedMixin\n\n# This is going to not use arguments very commonly. For now disable\n# the warning all around, specialize one done, pylint: disable=unused-argument\n\n\nclass CTypeNuitkaVoidEnum(CTypeNotReferenceCountedMixin, CTypeBase):\n    c_type = \"nuitka_void\"\n\n    # Return value only obviously.\n    helper_code = \"NVOID\"\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing to do for this type, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        emit(\"assert(%s == NUITKA_VOID_OK);\" % value_name)\n\n    @classmethod\n    def emitReinitCode(cls, value_name, emit):\n        emit(\"%s = NUITKA_VOID_OK;\" % value_name)\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        # We have no storage, the original user will cleanup after itself. This\n        # is the main point of the whole type.\n        getReleaseCode(value_name, emit, context)\n\n        # The only possible value, and in this case never read, but the compiler hates\n        # it being defined which is hard for us to know ahead of time.\n        if Options.is_debug:\n            emit(\"%s = NUITKA_VOID_OK;\" % to_name)\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # Everything else expresses missed compiled time optimization.\n        assert constant is None\n\n        # The only possible value, and in this case never read, but the compiler hates\n        # it being defined which is hard for us to know ahead of time.\n        if Options.is_debug:\n            emit(\"%s = NUITKA_VOID_OK;\" % to_name)\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        assert False\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        assert False\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        # The only possible value, and in this case never read, but the compiler hates\n        # it being defined which is hard for us to know ahead of time.\n        if Options.is_debug:\n            emit(\"%s = NUITKA_VOID_OK;\" % to_name)\n\n    @classmethod\n    def emitAssignInplaceNegatedValueCode(cls, to_name, needs_check, emit, context):\n        # The only possible value, and in this case never read, but the compiler hates\n        # it being defined which is hard for us to know ahead of time.\n        if Options.is_debug:\n            emit(\"%s = NUITKA_VOID_OK;\" % to_name)\n\n    @classmethod\n    def getExceptionCheckCondition(cls, value_name):\n        return \"%s == NUITKA_VOID_EXCEPTION\" % value_name\n\n    @classmethod\n    def hasErrorIndicator(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypePyObjectPointers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for PyObject *, PyObject **, and struct Nuitka_CellObject *\n\n\"\"\"\n\nfrom nuitka.__past__ import iterItems, xrange\nfrom nuitka.code_generation.ErrorCodes import (\n    getErrorExitBoolCode,\n    getReleaseCode,\n)\nfrom nuitka.code_generation.templates.CodeTemplatesVariables import (\n    template_del_local_intolerant,\n    template_del_local_known,\n    template_del_local_tolerant,\n    template_del_shared_intolerant,\n    template_del_shared_known,\n    template_del_shared_tolerant,\n    template_release_object_clear,\n    template_release_object_unclear,\n    template_write_local_clear_ref0,\n    template_write_local_clear_ref1,\n    template_write_local_empty_ref0,\n    template_write_local_empty_ref1,\n    template_write_local_inplace,\n    template_write_local_unclear_ref0,\n    template_write_local_unclear_ref1,\n    template_write_shared_clear_ref0,\n    template_write_shared_clear_ref1,\n    template_write_shared_inplace,\n    template_write_shared_unclear_ref0,\n    template_write_shared_unclear_ref1,\n)\nfrom nuitka.Constants import getConstantValueGuide, isMutable\n\nfrom .CTypeBases import CTypeBase\n\n# Need to run \"bin/generate-specialized-c-code\" when changing these values.\nmake_list_constant_direct_threshold = 4\nmake_list_constant_hinted_threshold = 13\n\n\nclass CPythonPyObjectPtrBase(CTypeBase):\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        if inplace:\n            # Releasing is not an issue here, local variable reference never\n            # gave a reference, and the in-place code deals with possible\n            # replacement/release.\n            template = template_write_local_inplace\n        else:\n            if ref_count:\n                if needs_release is False:\n                    template = template_write_local_empty_ref0\n                elif needs_release is True:\n                    template = template_write_local_clear_ref0\n                else:\n                    template = template_write_local_unclear_ref0\n            else:\n                if needs_release is False:\n                    template = template_write_local_empty_ref1\n                elif needs_release is True:\n                    template = template_write_local_clear_ref1\n                else:\n                    template = template_write_local_unclear_ref1\n\n        emit(template % {\"identifier\": value_name, \"tmp_name\": tmp_name})\n\n    @classmethod\n    def emitAssignmentCodeToNuitkaIntOrLong(\n        cls, to_name, value_name, needs_check, emit, context\n    ):\n        to_type = to_name.getCType()\n\n        to_type.emitVariantAssignmentCode(\n            int_name=to_name,\n            value_name=value_name,\n            int_value=None,\n            emit=emit,\n            context=context,\n        )\n\n    @classmethod\n    def getTruthCheckCode(cls, value_name):\n        return \"CHECK_IF_TRUE(%s) == 1\" % value_name\n\n    @classmethod\n    def emitTruthCheckCode(cls, to_name, value_name, emit):\n        assert to_name.c_type == \"int\", to_name\n\n        emit(\"%s = CHECK_IF_TRUE(%s);\" % (to_name, value_name))\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        if needs_check:\n            template = template_release_object_unclear\n        else:\n            template = template_release_object_clear\n\n        emit(template % {\"identifier\": value_name})\n\n    @classmethod\n    def emitAssignInplaceNegatedValueCode(cls, to_name, needs_check, emit, context):\n        # Half way, virtual method: pylint: disable=unused-argument\n\n        update_code = \"%(to_name)s = (%(truth_check)s) ? Py_False : Py_True\" % {\n            \"truth_check\": cls.getTruthCheckCode(to_name),\n            \"to_name\": to_name,\n        }\n\n        if context.needsCleanup(to_name):\n            # The release here can only work for this class, needs more work to be able\n            # to deal with CTypePyObjectPtrPtr and CTypeCellObject.\n\n            assert cls is CTypePyObjectPtr\n\n            emit(\n                \"\"\"\\\n{\n    %(tmp_decl)s = %(to_name)s;\n    %(update_code)s;\n    Py_INCREF(%(to_name)s);\n    Py_DECREF(old);\n}\n\"\"\"\n                % {\n                    \"tmp_decl\": cls.getVariableArgDeclarationCode(\"old\"),\n                    \"update_code\": update_code,\n                    \"to_name\": to_name,\n                }\n            )\n        else:\n            emit(\"%s;\" % update_code)\n\n    @classmethod\n    def emitAssignmentCodeToNuitkaBool(\n        cls, to_name, value_name, needs_check, emit, context\n    ):\n        truth_name = context.allocateTempName(\"truth_name\", \"int\")\n\n        emit(\"%s = CHECK_IF_TRUE(%s);\" % (truth_name, value_name))\n\n        getErrorExitBoolCode(\n            condition=\"%s == -1\" % truth_name,\n            needs_check=needs_check,\n            emit=emit,\n            context=context,\n        )\n\n        emit(\n            \"%s = %s == 0 ? NUITKA_BOOL_FALSE : NUITKA_BOOL_TRUE;\"\n            % (to_name, truth_name)\n        )\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # Many cases to deal with, pylint: disable=too-many-branches,too-many-statements\n\n        if type(constant) is dict:\n            if not may_escape:\n                code = context.getConstantCode(constant)\n                ref_count = 0\n            elif constant:\n                for key, value in iterItems(constant):\n                    # key cannot be mutable.\n                    assert not isMutable(key)\n                    if isMutable(value):\n                        needs_deep = True\n                        break\n                else:\n                    needs_deep = False\n\n                if needs_deep:\n                    code = \"DEEP_COPY_DICT(tstate, %s)\" % context.getConstantCode(\n                        constant, deep_check=False\n                    )\n                    ref_count = 1\n                else:\n                    code = \"DICT_COPY(%s)\" % context.getConstantCode(\n                        constant, deep_check=False\n                    )\n                    ref_count = 1\n            else:\n                code = \"MAKE_DICT_EMPTY()\"\n                ref_count = 1\n        elif type(constant) is set:\n            if not may_escape:\n                code = context.getConstantCode(constant)\n                ref_count = 0\n            elif constant:\n                code = \"PySet_New(%s)\" % context.getConstantCode(constant)\n                ref_count = 1\n            else:\n                code = \"PySet_New(NULL)\"\n                ref_count = 1\n        elif type(constant) is list:\n            if not may_escape:\n                code = context.getConstantCode(constant)\n                ref_count = 0\n            elif constant:\n                for value in constant:\n                    if isMutable(value):\n                        needs_deep = True\n                        break\n                else:\n                    needs_deep = False\n\n                if needs_deep:\n                    code = 'DEEP_COPY_LIST_GUIDED(tstate, %s, \"%s\")' % (\n                        context.getConstantCode(constant, deep_check=False),\n                        getConstantValueGuide(constant, elements_only=True),\n                    )\n                    ref_count = 1\n                else:\n                    constant_size = len(constant)\n\n                    if constant_size > 1 and all(\n                        constant[i] is constant[0] for i in xrange(1, len(constant))\n                    ):\n                        code = \"MAKE_LIST_REPEATED(%s, %s)\" % (\n                            constant_size,\n                            context.getConstantCode(constant[0], deep_check=False),\n                        )\n                    elif constant_size < make_list_constant_direct_threshold:\n                        code = \"MAKE_LIST%d(%s)\" % (\n                            constant_size,\n                            \",\".join(\n                                context.getConstantCode(constant[i], deep_check=False)\n                                for i in xrange(constant_size)\n                            ),\n                        )\n                    elif constant_size < make_list_constant_hinted_threshold:\n                        code = \"MAKE_LIST%d(%s)\" % (\n                            constant_size,\n                            context.getConstantCode(constant, deep_check=False),\n                        )\n                    else:\n                        code = \"LIST_COPY(%s)\" % context.getConstantCode(\n                            constant, deep_check=False\n                        )\n                    ref_count = 1\n            else:\n                # TODO: For the zero elements list, maybe have a dedicated function, which\n                # avoids a bit of tests, not sure we want LTO do this.\n                code = \"MAKE_LIST_EMPTY(0)\"\n                ref_count = 1\n        elif type(constant) is tuple:\n            needs_deep = False\n\n            if may_escape:\n                for value in constant:\n                    if isMutable(value):\n                        needs_deep = True\n                        break\n            if needs_deep:\n                code = 'DEEP_COPY_TUPLE_GUIDED(tstate, %s, \"%s\")' % (\n                    context.getConstantCode(constant, deep_check=False),\n                    getConstantValueGuide(constant, elements_only=True),\n                )\n                ref_count = 1\n            else:\n                code = context.getConstantCode(constant)\n                ref_count = 0\n        elif type(constant) is bytearray:\n            if may_escape:\n                code = \"BYTEARRAY_COPY(tstate, %s)\" % context.getConstantCode(constant)\n                ref_count = 1\n            else:\n                code = context.getConstantCode(constant)\n                ref_count = 0\n        else:\n            code = context.getConstantCode(constant=constant)\n            ref_count = 0\n\n        if to_name.c_type == \"PyObject *\":\n            value_name = to_name\n        else:\n            value_name = context.allocateTempName(\"constant_value\")\n\n        emit(\"%s = %s;\" % (value_name, code))\n\n        if to_name is not value_name:\n            cls.emitAssignConversionCode(\n                to_name=to_name,\n                value_name=value_name,\n                needs_check=False,\n                emit=emit,\n                context=context,\n            )\n\n            # Above is supposed to transfer ownership.\n            if ref_count:\n                getReleaseCode(value_name, emit, context)\n        else:\n            if ref_count:\n                context.addCleanupTempName(value_name)\n\n\nclass CTypePyObjectPtr(CPythonPyObjectPtrBase):\n    c_type = \"PyObject *\"\n\n    helper_code = \"OBJECT\"\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        if init_from is None:\n            return \"NULL\"\n        else:\n            return init_from\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"%s %s NULL\" % (value_name, \"==\" if inverted else \"!=\")\n\n    @classmethod\n    def emitReinitCode(cls, value_name, emit):\n        emit(\"%s = NULL;\" % value_name)\n\n    @classmethod\n    def getVariableArgDeclarationCode(cls, variable_code_name):\n        return \"PyObject *%s\" % variable_code_name\n\n    @classmethod\n    def getVariableArgReferencePassingCode(cls, variable_code_name):\n        return \"&%s\" % variable_code_name\n\n    @classmethod\n    def getCellObjectAssignmentCode(cls, target_cell_code, variable_code_name, emit):\n        emit(\"%s = Nuitka_Cell_New0(%s);\" % (target_cell_code, variable_code_name))\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        if not needs_check:\n            emit(template_del_local_known % {\"identifier\": value_name})\n        elif tolerant:\n            emit(template_del_local_tolerant % {\"identifier\": value_name})\n        else:\n            emit(\n                template_del_local_intolerant\n                % {\"identifier\": value_name, \"result\": to_name}\n            )\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        emit(\n            \"%(to_name)s = (%(condition)s) ? Py_True : Py_False;\"\n            % {\"to_name\": to_name, \"condition\": condition}\n        )\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing to do for this type, pylint: disable=unused-argument\n        return value_name\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        emit(\"CHECK_OBJECT(%s);\" % value_name)\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        if value_name.c_type == cls.c_type:\n            emit(\"%s = %s;\" % (to_name, value_name))\n\n            context.transferCleanupTempName(value_name, to_name)\n        elif value_name.c_type in (\"nuitka_bool\", \"bool\"):\n            cls.emitAssignmentCodeFromBoolCondition(\n                condition=value_name.getCType().getTruthCheckCode(value_name),\n                to_name=to_name,\n                emit=emit,\n            )\n        elif value_name.c_type == \"nuitka_ilong\":\n            emit(\"ENFORCE_ILONG_OBJECT_VALUE(&%s);\" % value_name)\n\n            emit(\"%s = %s.ilong_object;\" % (to_name, value_name))\n\n            context.transferCleanupTempName(value_name, to_name)\n        else:\n            assert False, to_name.c_type\n\n    @classmethod\n    def getExceptionCheckCondition(cls, value_name):\n        return \"%s == NULL\" % value_name\n\n    @classmethod\n    def hasErrorIndicator(cls):\n        return True\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        if needs_check:\n            template = template_release_object_unclear\n        else:\n            template = template_release_object_clear\n\n        emit(template % {\"identifier\": value_name})\n\n    @classmethod\n    def getTakeReferenceCode(cls, value_name, emit):\n        \"\"\"Take reference code for given object.\"\"\"\n\n        emit(\"Py_INCREF(%s);\" % value_name)\n\n\nclass CTypePyObjectPtrPtr(CPythonPyObjectPtrBase):\n    c_type = \"PyObject **\"\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"*%s %s NULL\" % (value_name, \"==\" if inverted else \"!=\")\n\n    @classmethod\n    def getVariableArgDeclarationCode(cls, variable_code_name):\n        return \"PyObject **%s\" % variable_code_name\n\n    @classmethod\n    def getVariableArgReferencePassingCode(cls, variable_code_name):\n        return variable_code_name\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # No code needed for this type, pylint: disable=unused-argument\n        from ..VariableDeclarations import VariableDeclaration\n\n        # Use the object pointed to.\n        return VariableDeclaration(\"PyObject *\", \"*%s\" % value_name, None, None)\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        emit(\n            \"*%(to_name)s = (%(condition)s) ? Py_True : Py_False;\"\n            % {\"to_name\": to_name, \"condition\": condition}\n        )\n\n\nclass CTypeCellObject(CTypeBase):\n    c_type = \"struct Nuitka_CellObject *\"\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        # TODO: Single out \"init_from\" only user, so it becomes sure that we\n        # get a reference transferred here in these cases.\n        if init_from is not None:\n            return \"Nuitka_Cell_New1(%s)\" % init_from\n        else:\n            return \"Nuitka_Cell_NewEmpty()\"\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"%s->ob_ref %s NULL\" % (value_name, \"==\" if inverted else \"!=\")\n\n    @classmethod\n    def getCellObjectAssignmentCode(cls, target_cell_code, variable_code_name, emit):\n        emit(\"%s = %s;\" % (target_cell_code, variable_code_name))\n\n        emit(\"Py_INCREF(%s);\" % (target_cell_code))\n\n    @classmethod\n    def emitVariableAssignCode(\n        cls, value_name, needs_release, tmp_name, ref_count, inplace, emit, context\n    ):\n        if inplace:\n            # Releasing is not an issue here, local variable reference never\n            # gave a reference, and the in-place code deals with possible\n            # replacement/release.\n            template = template_write_shared_inplace\n\n        else:\n            if ref_count:\n                if needs_release is False:\n                    template = template_write_shared_clear_ref0\n                else:\n                    template = template_write_shared_unclear_ref0\n            else:\n                if needs_release is False:\n                    template = template_write_shared_clear_ref1\n                else:\n                    template = template_write_shared_unclear_ref1\n\n        emit(template % {\"identifier\": value_name, \"tmp_name\": tmp_name})\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # No code needed for this type, pylint: disable=unused-argument\n        from ..VariableDeclarations import VariableDeclaration\n\n        # Use the object pointed to.\n        return VariableDeclaration(\n            \"PyObject *\", \"Nuitka_Cell_GET(%s)\" % value_name, None, None\n        )\n\n    @classmethod\n    def getVariableArgDeclarationCode(cls, variable_code_name):\n        return \"struct Nuitka_CellObject *%s\" % variable_code_name\n\n    @classmethod\n    def getVariableArgReferencePassingCode(cls, variable_code_name):\n        return variable_code_name\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        emit(\n            \"%(to_name)s->ob_ref = (%(condition)s) ? Py_True : Py_False;\"\n            % {\"to_name\": to_name, \"condition\": condition}\n        )\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        if not needs_check:\n            emit(template_del_shared_known % {\"identifier\": value_name})\n        elif tolerant:\n            emit(template_del_shared_tolerant % {\"identifier\": value_name})\n        else:\n            emit(\n                template_del_shared_intolerant\n                % {\"identifier\": value_name, \"result\": to_name}\n            )\n\n    @classmethod\n    def getReleaseCode(cls, value_name, needs_check, emit):\n        if needs_check:\n            template = template_release_object_unclear\n        else:\n            template = template_release_object_clear\n\n        emit(template % {\"identifier\": value_name})\n\n    @classmethod\n    def emitReinitCode(cls, value_name, emit):\n        emit(\"%s = NULL;\" % value_name)\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        emit(\"CHECK_OBJECT(%s->ob_ref);\" % value_name)\n\n    @classmethod\n    def emitReleaseAssertionCode(cls, value_name, emit):\n        emit(\"CHECK_OBJECT(%s);\" % value_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/CTypeVoids.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CType classes for C void, this cannot represent unassigned, nor indicate exception.\n\n\"\"\"\n\nfrom nuitka.code_generation.ErrorCodes import getReleaseCode\n\nfrom .CTypeBases import CTypeBase, CTypeNotReferenceCountedMixin\n\n\nclass CTypeVoid(CTypeNotReferenceCountedMixin, CTypeBase):\n    c_type = \"bool\"\n\n    # Return value only obviously, normally not used in helpers\n    helper_code = \"CVOID\"\n\n    @classmethod\n    def emitValueAccessCode(cls, value_name, emit, context):\n        # Nothing possible for this type, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def emitValueAssertionCode(cls, value_name, emit):\n        # Always valid\n        pass\n\n    @classmethod\n    def emitAssignConversionCode(cls, to_name, value_name, needs_check, emit, context):\n        # Very easy, just release it.\n        getReleaseCode(value_name, emit, context)\n\n    @classmethod\n    def emitAssignInplaceNegatedValueCode(cls, to_name, needs_check, emit, context):\n        # Very easy\n        pass\n\n    @classmethod\n    def emitAssignmentCodeFromConstant(\n        cls, to_name, constant, may_escape, emit, context\n    ):\n        # That would be rather surprising, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def getInitValue(cls, init_from):\n        return \"<not_possible>\"\n\n    @classmethod\n    def getInitTestConditionCode(cls, value_name, inverted):\n        return \"<not_possible>\"\n\n    @classmethod\n    def getDeleteObjectCode(\n        cls, to_name, value_name, needs_check, tolerant, emit, context\n    ):\n        assert False\n\n    @classmethod\n    def emitAssignmentCodeFromBoolCondition(cls, to_name, condition, emit):\n        assert False\n\n    @classmethod\n    def getExceptionCheckCondition(cls, value_name):\n        # Expected to not be used, pylint: disable=unused-argument\n        assert False\n\n    @classmethod\n    def hasErrorIndicator(cls):\n        return False\n\n    @classmethod\n    def getTruthCheckCode(cls, value_name):\n        # That would be rather surprising, pylint: disable=unused-argument\n        assert False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/c_types/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesAsyncgens.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Async generator (await/async + yield) related templates.\n\n\"\"\"\n\ntemplate_asyncgen_object_maker_template = \"\"\"\\\nstatic PyObject *%(asyncgen_maker_identifier)s(%(asyncgen_creation_args)s);\n\"\"\"\n\ntemplate_asyncgen_object_body = \"\"\"\n#if %(has_heap_declaration)s\nstruct %(function_identifier)s_locals {\n%(function_local_types)s\n};\n#endif\n\nstatic PyObject *%(function_identifier)s_context(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen, PyObject *yield_return_value) {\n    CHECK_OBJECT(asyncgen);\n    assert(Nuitka_Asyncgen_Check((PyObject *)asyncgen));\n    CHECK_OBJECT_X(yield_return_value);\n\n#if %(has_heap_declaration)s\n    // Heap access.\n%(heap_declaration)s\n#endif\n\n    // Dispatch to yield based on return label index:\n%(function_dispatch)s\n\n    // Local variable initialization\n%(function_var_inits)s\n\n    // Actual asyncgen body.\n%(function_body)s\n\n%(asyncgen_exit)s\n}\n\nstatic PyObject *%(asyncgen_maker_identifier)s(%(asyncgen_creation_args)s) {\n    return Nuitka_Asyncgen_New(\n        %(function_identifier)s_context,\n        %(asyncgen_module)s,\n        %(asyncgen_name_obj)s,\n        %(asyncgen_qualname_obj)s,\n        %(code_identifier)s,\n        %(closure_name)s,\n        %(closure_count)d,\n#if %(has_heap_declaration)s\n        sizeof(struct %(function_identifier)s_locals)\n#else\n        0\n#endif\n    );\n}\n\"\"\"\n\ntemplate_make_asyncgen = \"\"\"\\\n%(closure_copy)s\n%(to_name)s = %(asyncgen_maker_identifier)s(%(args)s);\n\"\"\"\n\n# TODO: For functions NUITKA_CANNOT_GET_HERE is injected by composing code.\ntemplate_asyncgen_exception_exit = \"\"\"\\\n    NUITKA_CANNOT_GET_HERE(\"return must be present\");\n\n    function_exception_exit:\n%(function_cleanup)s\n    assert(%(exception_type)s);\n    RESTORE_ERROR_OCCURRED(tstate, %(exception_type)s, %(exception_value)s, %(exception_tb)s);\n    return NULL;\n\"\"\"\n\ntemplate_asyncgen_noexception_exit = \"\"\"\\\n    NUITKA_CANNOT_GET_HERE(\"return must be present\");\n\n%(function_cleanup)s\n    return NULL;\n\"\"\"\n\ntemplate_asyncgen_return_exit = \"\"\"\\\n    function_return_exit:;\n\n    return NULL;\n\"\"\"\n\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesConstants.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Templates for the constants handling.\n\n\"\"\"\n\ntemplate_constants_reading = r\"\"\"\n#include \"nuitka/prelude.h\"\n#include \"structseq.h\"\n\n#include \"build_definitions.h\"\n\n// Global constants storage\nPyObject *global_constants[%(global_constants_count)d];\n\n// Sentinel PyObject to be used for all our call iterator endings. It will\n// become a PyCObject pointing to NULL. It's address is unique, and that's\n// enough for us to use it as sentinel value.\nPyObject *_sentinel_value = NULL;\n\nPyObject *Nuitka_dunder_compiled_value = NULL;\n\n\n#ifdef _NUITKA_STANDALONE\nextern PyObject *getStandaloneSysExecutablePath(PyObject *basename);\n\nNUITKA_MAY_BE_UNUSED static PyObject *STRIP_DIRNAME(PyObject *path) {\n#if PYTHON_VERSION < 0x300\n    char const *path_cstr = PyString_AS_STRING(path);\n\n#ifdef _WIN32\n    char const *last_sep = strrchr(path_cstr, '\\\\');\n#else\n    char const *last_sep = strrchr(path_cstr, '/');\n#endif\n    if (unlikely(last_sep == NULL)) {\n        Py_INCREF(path);\n        return path;\n    }\n\n    return PyString_FromStringAndSize(path_cstr, last_sep - path_cstr);\n#else\n#ifdef _WIN32\n    Py_ssize_t dot_index = PyUnicode_Find(path, const_str_backslash, 0, PyUnicode_GetLength(path), -1);\n#else\n    Py_ssize_t dot_index = PyUnicode_Find(path, const_str_slash, 0, PyUnicode_GetLength(path), -1);\n#endif\n    if (likely(dot_index != -1)) {\n        return PyUnicode_Substring(path, 0, dot_index);\n    } else {\n        Py_INCREF(path);\n        return path;\n    }\n#endif\n}\n#endif\n\nextern void setDistributionsMetadata(PyObject *metadata_values);\n\n// We provide the sys.version info shortcut as a global value here for ease of use.\nPyObject *Py_SysVersionInfo = NULL;\n\nstatic void _createGlobalConstants(PyThreadState *tstate) {\n    // We provide the sys.version info shortcut as a global value here for ease of use.\n    Py_SysVersionInfo = Nuitka_SysGetObject(\"version_info\");\n\n    // The empty name means global.\n    loadConstantsBlob(tstate, &global_constants[0], \"\");\n\n#if _NUITKA_EXE\n    /* Set the \"sys.executable\" path to the original CPython executable or point to inside the\n       distribution for standalone. */\n    Nuitka_SysSetObject(\n        \"executable\",\n#ifndef _NUITKA_STANDALONE\n        %(sys_executable)s\n#else\n        getStandaloneSysExecutablePath(%(sys_executable)s)\n#endif\n    );\n\n#ifndef _NUITKA_STANDALONE\n    /* Set the \"sys.prefix\" path to the original one. */\n    Nuitka_SysSetObject(\n        \"prefix\",\n        %(sys_prefix)s\n    );\n\n    /* Set the \"sys.prefix\" path to the original one. */\n    Nuitka_SysSetObject(\n        \"exec_prefix\",\n        %(sys_exec_prefix)s\n    );\n\n\n#if PYTHON_VERSION >= 0x300\n    /* Set the \"sys.base_prefix\" path to the original one. */\n    Nuitka_SysSetObject(\n        \"base_prefix\",\n        %(sys_base_prefix)s\n    );\n\n    /* Set the \"sys.exec_base_prefix\" path to the original one. */\n    Nuitka_SysSetObject(\n        \"base_exec_prefix\",\n        %(sys_base_exec_prefix)s\n    );\n\n#endif\n#endif\n#endif\n\n    static PyTypeObject Nuitka_VersionInfoType;\n\n    // Same fields as \"sys.version_info\" except no serial number.\n    static PyStructSequence_Field Nuitka_VersionInfoFields[] = {\n        {(char *)\"major\", (char *)\"Major release number\"},\n        {(char *)\"minor\", (char *)\"Minor release number\"},\n        {(char *)\"micro\", (char *)\"Micro release number\"},\n        {(char *)\"releaselevel\", (char *)\"'alpha', 'beta', 'candidate', or 'release'\"},\n        {(char *)\"containing_dir\", (char *)\"directory of the containing binary\"},\n        {(char *)\"standalone\", (char *)\"boolean indicating standalone mode usage\"},\n        {(char *)\"onefile\", (char *)\"boolean indicating onefile mode usage\"},\n        {(char *)\"macos_bundle_mode\", (char *)\"boolean indicating macOS app bundle mode usage\"},\n        {(char *)\"no_asserts\", (char *)\"boolean indicating --python-flag=no_asserts usage\"},\n        {(char *)\"no_docstrings\", (char *)\"boolean indicating --python-flag=no_docstrings usage\"},\n        {(char *)\"no_annotations\", (char *)\"boolean indicating --python-flag=no_annotations usage\"},\n        {(char *)\"module\", (char *)\"boolean indicating --module usage\"},\n        {0}\n    };\n\n    static PyStructSequence_Desc Nuitka_VersionInfoDesc = {\n        (char *)\"__nuitka_version__\",                                       /* name */\n        (char *)\"__compiled__\\\\n\\\\nVersion information as a named tuple.\",  /* doc */\n        Nuitka_VersionInfoFields,                                           /* fields */\n        sizeof(Nuitka_VersionInfoFields) / sizeof(PyStructSequence_Field)-1 /* count */\n    };\n\n    PyStructSequence_InitType(&Nuitka_VersionInfoType, &Nuitka_VersionInfoDesc);\n\n    Nuitka_dunder_compiled_value = PyStructSequence_New(&Nuitka_VersionInfoType);\n    assert(Nuitka_dunder_compiled_value != NULL);\n\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 0, PyInt_FromLong(%(nuitka_version_major)s));\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 1, PyInt_FromLong(%(nuitka_version_minor)s));\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 2, PyInt_FromLong(%(nuitka_version_micro)s));\n\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 3, Nuitka_String_FromString(\"%(nuitka_version_level)s\"));\n\n    PyObject *binary_directory = getContainingDirectoryObject(false);\n#ifdef _NUITKA_STANDALONE\n#ifndef _NUITKA_ONEFILE_MODE\n    binary_directory = STRIP_DIRNAME(binary_directory);\n#endif\n\n#ifdef _NUITKA_MACOS_BUNDLE\n    binary_directory = STRIP_DIRNAME(binary_directory);\n    binary_directory = STRIP_DIRNAME(binary_directory);\n#endif\n#endif\n\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 4, binary_directory);\n\n#ifdef _NUITKA_STANDALONE\n    PyObject *is_standalone_mode = Py_True;\n#else\n    PyObject *is_standalone_mode = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 5, is_standalone_mode);\n#ifdef _NUITKA_ONEFILE_MODE\n    PyObject *is_onefile_mode = Py_True;\n#else\n    PyObject *is_onefile_mode = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 6, is_onefile_mode);\n\n#ifdef _NUITKA_MACOS_BUNDLE\n    PyObject *is_macos_bundle_mode = Py_True;\n#else\n    PyObject *is_macos_bundle_mode = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 7, is_macos_bundle_mode);\n\n#if _NUITKA_NO_ASSERTS == 1\n    PyObject *is_no_asserts = Py_True;\n#else\n    PyObject *is_no_asserts = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 8, is_no_asserts);\n\n#if _NUITKA_NO_DOCSTRINGS == 1\n    PyObject *is_no_docstrings = Py_True;\n#else\n    PyObject *is_no_docstrings = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 9, is_no_docstrings);\n\n#if _NUITKA_NO_ANNOTATIONS == 1\n    PyObject *is_no_annotations = Py_True;\n#else\n    PyObject *is_no_annotations = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 10, is_no_annotations);\n\n#ifdef _NUITKA_MODULE\n    PyObject *is_module_mode = Py_True;\n#else\n    PyObject *is_module_mode = Py_False;\n#endif\n    PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 11, is_module_mode);\n\n    // Prevent users from creating the Nuitka version type object.\n    Nuitka_VersionInfoType.tp_init = NULL;\n    Nuitka_VersionInfoType.tp_new = NULL;\n\n    setDistributionsMetadata(%(metadata_values)s);\n}\n\n// In debug mode we can check that the constants were not tampered with in any\n// given moment. We typically do it at program exit, but we can add extra calls\n// for sanity.\n#ifndef __NUITKA_NO_ASSERT__\nvoid checkGlobalConstants(void) {\n// TODO: Ask constant code to check values.\n\n}\n#endif\n\nvoid createGlobalConstants(PyThreadState *tstate) {\n    if (_sentinel_value == NULL) {\n#if PYTHON_VERSION < 0x300\n        _sentinel_value = PyCObject_FromVoidPtr(NULL, NULL);\n#else\n        // The NULL value is not allowed for a capsule, so use something else.\n        _sentinel_value = PyCapsule_New((void *)27, \"sentinel\", NULL);\n#endif\n        assert(_sentinel_value);\n\n        _createGlobalConstants(tstate);\n    }\n}\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesCoroutines.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Coroutines function (await/async) related templates.\n\n\"\"\"\n\ntemplate_coroutine_object_maker = \"\"\"\\\nstatic PyObject *%(coroutine_maker_identifier)s(%(coroutine_creation_args)s);\n\"\"\"\n\ntemplate_coroutine_object_body = \"\"\"\n#if %(has_heap_declaration)s\nstruct %(function_identifier)s_locals {\n%(function_local_types)s\n};\n#endif\n\nstatic PyObject *%(function_identifier)s_context(PyThreadState *tstate, struct Nuitka_CoroutineObject *coroutine, PyObject *yield_return_value) {\n    CHECK_OBJECT(coroutine);\n    assert(Nuitka_Coroutine_Check((PyObject *)coroutine));\n    CHECK_OBJECT_X(yield_return_value);\n\n#if %(has_heap_declaration)s\n    // Heap access.\n%(heap_declaration)s\n#endif\n\n    // Dispatch to yield based on return label index:\n%(function_dispatch)s\n\n    // Local variable initialization\n%(function_var_inits)s\n\n    // Actual coroutine body.\n%(function_body)s\n\n%(coroutine_exit)s\n}\n\nstatic PyObject *%(coroutine_maker_identifier)s(%(coroutine_creation_args)s) {\n    return Nuitka_Coroutine_New(\n        tstate,\n        %(function_identifier)s_context,\n        %(coroutine_module)s,\n        %(coroutine_name_obj)s,\n        %(coroutine_qualname_obj)s,\n        %(code_identifier)s,\n        %(closure_name)s,\n        %(closure_count)d,\n#if %(has_heap_declaration)s\n        sizeof(struct %(function_identifier)s_locals)\n#else\n        0\n#endif\n    );\n}\n\"\"\"\n\ntemplate_make_coroutine = \"\"\"\\\n%(closure_copy)s\n%(to_name)s = %(coroutine_maker_identifier)s(%(args)s);\n\"\"\"\n\n# TODO: For functions NUITKA_CANNOT_GET_HERE is injected by composing code.\ntemplate_coroutine_exception_exit = \"\"\"\\\n    NUITKA_CANNOT_GET_HERE(\"Return statement must be present\");\n\n    function_exception_exit:\n%(function_cleanup)s\n    assert(%(exception_type)s);\n    RESTORE_ERROR_OCCURRED(tstate, %(exception_type)s, %(exception_value)s, %(exception_tb)s);\n    return NULL;\n\"\"\"\n\ntemplate_coroutine_noexception_exit = \"\"\"\\\n    NUITKA_CANNOT_GET_HERE(\"Return statement must be present\");\n\n%(function_cleanup)s\n    return NULL;\n\"\"\"\n\ntemplate_coroutine_return_exit = \"\"\"\\\n    function_return_exit:;\n\n    coroutine->m_returned = %(return_value)s;\n\n    return NULL;\n\"\"\"\n\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesExceptions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Templates for handling exceptions.\n\n\"\"\"\n\ntemplate_publish_exception_to_handler = \"\"\"\\\nif (%(keeper_tb)s == NULL) {\n    %(keeper_tb)s = %(tb_making)s;\n} else if (%(keeper_lineno)s != 0) {\n    %(keeper_tb)s = ADD_TRACEBACK(%(keeper_tb)s, %(frame_identifier)s, %(keeper_lineno)s);\n}\n\"\"\"\n\ntemplate_error_catch_quick_exception = \"\"\"\\\nif (%(condition)s) {\n    if (!HAS_ERROR_OCCURRED(tstate)) {\n        %(exception_type)s = %(quick_exception)s;\n        Py_INCREF(%(exception_type)s);\n        %(exception_value)s = NULL;\n        %(exception_tb)s = NULL;\n    } else {\n        FETCH_ERROR_OCCURRED(tstate, &%(exception_type)s, &%(exception_value)s, &%(exception_tb)s);\n    }\n%(release_temps)s\n\n%(var_description_code)s\n%(line_number_code)s\n    goto %(exception_exit)s;\n}\"\"\"\n\ntemplate_error_catch_exception = \"\"\"\\\nif (%(condition)s) {\n    assert(HAS_ERROR_OCCURRED(tstate));\n\n    FETCH_ERROR_OCCURRED(tstate, &%(exception_type)s, &%(exception_value)s, &%(exception_tb)s);\n%(release_temps)s\n\n%(line_number_code)s\n%(var_description_code)s\n    goto %(exception_exit)s;\n}\"\"\"\n\ntemplate_error_format_string_exception = \"\"\"\\\nif (%(condition)s) {\n%(release_temps)s\n%(set_exception)s\n\n%(line_number_code)s\n%(var_description_code)s\n    goto %(exception_exit)s;\n}\n\"\"\"\n\ntemplate_error_format_name_error_exception = \"\"\"\\\nif (unlikely(%(condition)s)) {\n%(release_temps)s\n%(raise_name_error_helper)s(tstate, %(variable_name)s, &%(exception_type)s, &%(exception_value)s);\n\n%(line_number_code)s\n%(var_description_code)s\n    goto %(exception_exit)s;\n}\n\"\"\"\n\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesFrames.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code templates for frames of all kinds.\n\n\"\"\"\n\n# This uses STORE_ASYNCGEN_EXCEPTION\n\ntemplate_frame_guard_normal_main_block = \"\"\"\\\n{% if frame_cache_identifier %}\nif (isFrameUnusable({{frame_cache_identifier}})) {\n    Py_XDECREF({{frame_cache_identifier}});\n\n#if _DEBUG_REFCOUNTS\n    if ({{frame_cache_identifier}} == NULL) {\n        count_active_frame_cache_instances += 1;\n    } else {\n        count_released_frame_cache_instances += 1;\n    }\n    count_allocated_frame_cache_instances += 1;\n#endif\n    {{frame_cache_identifier}} = {{make_frame_code}};\n#if _DEBUG_REFCOUNTS\n} else {\n    count_hit_frame_cache_instances += 1;\n#endif\n}\n\nassert({{frame_cache_identifier}}->m_type_description == NULL);\n{{frame_identifier}} = {{frame_cache_identifier}};\n{% else %}\n{{frame_identifier}} = {{make_frame_code}};\n{% endif %}\n{% if frame_init_code %}\n{{frame_init_code}}\n{% endif %}\n{% if context_identifier %}\n{% if frame_cache_identifier %}\n// Mark the frame object as in use, ref count 1 will be up for reuse.\nPy_INCREF({{context_identifier}}->m_frame);\nassert(Py_REFCNT({{context_identifier}}->m_frame) == 2); // Frame stack\n{% endif %}\n\n{% if is_python34_or_later %}\nNuitka_SetFrameGenerator({{context_identifier}}->m_frame, (PyObject *){{context_identifier}});\n{% endif %}\n\nassert({{context_identifier}}->m_frame->m_frame.f_back == NULL);\n{% endif %}\n\n// Push the new frame as the currently active one, and we should be exclusively\n// owning it.\n{% if context_identifier %}\npushFrameStackGeneratorCompiledFrame(tstate, {{frame_identifier}});\n{% else %}\npushFrameStackCompiledFrame(tstate, {{frame_identifier}});\n{% endif %}\nassert(Py_REFCNT({{frame_identifier}}) == 2);\n\n{% if context_identifier and is_python3 %}\n// Store currently existing exception as the one to publish again when we\n// yield or yield from.\nSTORE_{{context_identifier.upper()}}_EXCEPTION(tstate, {{context_identifier}});\n\n{% endif %}\n// Framed code:\n{{codes}}\n\n{% if context_identifier and is_python3 %}\n// Release exception attached to the frame\nDROP_{{context_identifier.upper()}}_EXCEPTION({{context_identifier}});\n\n{% endif %}\n{% if needs_preserve %}\n// Restore frame exception if necessary.\nRESTORE_FRAME_EXCEPTION(tstate, {{frame_identifier}});\n{% endif %}\n\n{% if not context_identifier %}\n// Put the previous frame back on top.\npopFrameStack(tstate);\n{% endif %}\n{% if frame_exit_code %}\n{{frame_exit_code}}\n{% endif %}\n\ngoto {{no_exception_exit}};\n\"\"\"\n\ntemplate_frame_guard_normal_return_handler = \"\"\"\\\n{{frame_return_exit}}:\n{% if needs_preserve %}\nRESTORE_FRAME_EXCEPTION(tstate, {{frame_identifier}});\n{% endif %}\n\n// Put the previous frame back on top.\npopFrameStack(tstate);\n{% if frame_exit_code %}\n{{frame_exit_code}}s\n{% endif %}\n\ngoto {{return_exit}};\n\"\"\"\n\ntemplate_frame_attach_locals = \"\"\"\\\nNuitka_Frame_AttachLocals(\n    %(frame_identifier)s,\n    %(type_description)s%(frame_variable_refs)s\n);\n\"\"\"\n\ntemplate_frame_guard_normal_exception_handler = \"\"\"\\\n{{frame_exception_exit}}:\n\n{% if needs_preserve %}\nRESTORE_FRAME_EXCEPTION(tstate, {{frame_identifier}});\n{% endif %}\n\nif ({{exception_tb}} == NULL) {\n    {{exception_tb}} = {{tb_making_code}};\n} else if ({{exception_tb}}->tb_frame != &{{frame_identifier}}->m_frame) {\n    {{exception_tb}} = ADD_TRACEBACK({{exception_tb}}, {{frame_identifier}}, {{exception_lineno}});\n}\n\n{% if attach_locals_code %}\n// Attaches locals to frame if any.\n{{attach_locals_code}}\n{% endif %}\n\n{% if frame_cache_identifier %}\n// Release cached frame if used for exception.\nif ({{frame_identifier}} == {{frame_cache_identifier}}) {\n#if _DEBUG_REFCOUNTS\n    count_active_frame_cache_instances -= 1;\n    count_released_frame_cache_instances += 1;\n#endif\n    Py_DECREF({{frame_cache_identifier}});\n    {{frame_cache_identifier}} = NULL;\n}\n{% endif %}\n\nassertFrameObject({{frame_identifier}});\n\n// Put the previous frame back on top.\npopFrameStack(tstate);\n{% if frame_exit_code %}\n{{frame_exit_code}}\n{% endif %}\n\n// Return the error.\ngoto {{parent_exception_exit}};\n\"\"\"\n\n# Coroutines and asyncgen do this\ntemplate_frame_guard_generator_return_handler = \"\"\"\\\n%(frame_return_exit)s:;\n\n#if PYTHON_VERSION >= 0x300\n#if PYTHON_VERSION < 0x3b0\nPy_CLEAR(EXC_TYPE_F(%(context_identifier)s));\n#endif\nPy_CLEAR(EXC_VALUE_F(%(context_identifier)s));\n#if PYTHON_VERSION < 0x3b0\nPy_CLEAR(EXC_TRACEBACK_F(%(context_identifier)s));\n#endif\n#endif\n\ngoto %(return_exit)s;\n\"\"\"\n\n\ntemplate_frame_guard_generator_exception_handler = \"\"\"\\\n%(frame_exception_exit)s:;\n\n// If it's not an exit exception, consider and create a traceback for it.\nif (!EXCEPTION_MATCH_GENERATOR(tstate, %(exception_type)s)) {\n    if (%(exception_tb)s == NULL) {\n        %(exception_tb)s = %(tb_making)s;\n    } else if (%(exception_tb)s->tb_frame != &%(frame_identifier)s->m_frame) {\n        %(exception_tb)s = ADD_TRACEBACK(%(exception_tb)s, %(frame_identifier)s, %(exception_lineno)s);\n    }\n\n%(attach_locals)s\n\n    // Release cached frame if used for exception.\n    if (%(frame_identifier)s == %(frame_cache_identifier)s) {\n#if _DEBUG_REFCOUNTS\n        count_active_frame_cache_instances -= 1;\n        count_released_frame_cache_instances += 1;\n#endif\n\n        Py_DECREF(%(frame_cache_identifier)s);\n        %(frame_cache_identifier)s = NULL;\n    }\n\n    assertFrameObject(%(frame_identifier)s);\n}\n\n#if PYTHON_VERSION >= 0x300\n#if PYTHON_VERSION < 0x3b0\nPy_CLEAR(EXC_TYPE_F(%(context_identifier)s));\n#endif\nPy_CLEAR(EXC_VALUE_F(%(context_identifier)s));\n#if PYTHON_VERSION < 0x3b0\nPy_CLEAR(EXC_TRACEBACK_F(%(context_identifier)s));\n#endif\n#endif\n\n// Return the error.\ngoto %(parent_exception_exit)s;\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesFunction.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Normal function (no generator, not yielding) related templates.\n\n\"\"\"\n\ntemplate_function_make_declaration = \"\"\"\\\nstatic PyObject *MAKE_FUNCTION_%(function_identifier)s(%(function_creation_args)s);\n\"\"\"\n\ntemplate_function_direct_declaration = \"\"\"\\\n%(file_scope)s PyObject *impl_%(function_identifier)s(PyThreadState *tstate, %(direct_call_arg_spec)s);\n\"\"\"\n\ntemplate_maker_function_body = \"\"\"\nstatic PyObject *%(function_maker_identifier)s(%(function_creation_args)s) {\n    struct Nuitka_FunctionObject *result = Nuitka_Function_New(\n        %(function_impl_identifier)s,\n        %(function_name_obj)s,\n#if PYTHON_VERSION >= 0x300\n        %(function_qualname_obj)s,\n#endif\n        %(code_identifier)s,\n        %(defaults)s,\n#if PYTHON_VERSION >= 0x300\n        %(kw_defaults)s,\n        %(annotations)s,\n#endif\n        %(module_identifier)s,\n        %(function_doc)s,\n        %(closure_name)s,\n        %(closure_count)d\n    );\n%(constant_return_code)s\n\n    return (PyObject *)result;\n}\n\"\"\"\n\ntemplate_make_function = \"\"\"\\\n%(closure_copy)s\n%(to_name)s = %(function_maker_identifier)s(%(args)s);\n\"\"\"\n\ntemplate_function_body = \"\"\"\\\nstatic PyObject *impl_%(function_identifier)s(PyThreadState *tstate, %(parameter_objects_decl)s) {\n    // Preserve error status for checks\n#ifndef __NUITKA_NO_ASSERT__\n    NUITKA_MAY_BE_UNUSED bool had_error = HAS_ERROR_OCCURRED(tstate);\n#endif\n\n    // Local variable declarations.\n%(function_locals)s\n\n    // Actual function body.\n%(function_body)s\n\n%(function_exit)s\n}\n\"\"\"\n\ntemplate_function_exception_exit = \"\"\"\\\nfunction_exception_exit:\n%(function_cleanup)s\n    assert(%(exception_type)s);\n    RESTORE_ERROR_OCCURRED(tstate, %(exception_type)s, %(exception_value)s, %(exception_tb)s);\n\n    return NULL;\n\"\"\"\n\ntemplate_function_return_exit = \"\"\"\nfunction_return_exit:\n   // Function cleanup code if any.\n%(function_cleanup)s\n\n   // Actual function exit with return value, making sure we did not make\n   // the error status worse despite non-NULL return.\n   CHECK_OBJECT(tmp_return_value);\n   assert(had_error || !HAS_ERROR_OCCURRED(tstate));\n   return tmp_return_value;\"\"\"\n\nfunction_direct_body_template = \"\"\"\\\n%(file_scope)s PyObject *impl_%(function_identifier)s(PyThreadState *tstate, %(direct_call_arg_spec)s) {\n#ifndef __NUITKA_NO_ASSERT__\n    NUITKA_MAY_BE_UNUSED bool had_error = HAS_ERROR_OCCURRED(tstate);\n    assert(!had_error); // Do not enter inlined functions with error set.\n#endif\n\n    // Local variable declarations.\n%(function_locals)s\n\n    // Actual function body.\n%(function_body)s\n\n%(function_exit)s\n}\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Generator function (with yield) related templates.\n\n\"\"\"\n\ntemplate_genfunc_yielder_maker_decl = \"\"\"\\\nstatic PyObject *%(generator_maker_identifier)s(%(generator_creation_args)s);\n\"\"\"\n\ntemplate_genfunc_yielder_body_template = \"\"\"\n#if %(has_heap_declaration)s\nstruct %(function_identifier)s_locals {\n%(function_local_types)s\n};\n#endif\n\nstatic PyObject *%(function_identifier)s_context(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value) {\n    CHECK_OBJECT(generator);\n    assert(Nuitka_Generator_Check((PyObject *)generator));\n    CHECK_OBJECT_X(yield_return_value);\n\n#if %(has_heap_declaration)s\n    // Heap access.\n%(heap_declaration)s\n#endif\n\n    // Dispatch to yield based on return label index:\n%(function_dispatch)s\n\n    // Local variable initialization\n%(function_var_inits)s\n\n    // Actual generator function body.\n%(function_body)s\n\n%(generator_exit)s\n}\n\nstatic PyObject *%(generator_maker_identifier)s(%(generator_creation_args)s) {\n    return Nuitka_Generator_New(\n        %(function_identifier)s_context,\n        %(generator_module)s,\n        %(generator_name_obj)s,\n#if PYTHON_VERSION >= 0x350\n        %(generator_qualname_obj)s,\n#endif\n        %(code_identifier)s,\n        %(closure_name)s,\n        %(closure_count)d,\n#if %(has_heap_declaration)s\n        sizeof(struct %(function_identifier)s_locals)\n#else\n        0\n#endif\n    );\n}\n\"\"\"\n\ntemplate_make_generator = \"\"\"\\\n%(closure_copy)s\n%(to_name)s = %(generator_maker_identifier)s(%(args)s);\n\"\"\"\n\ntemplate_make_empty_generator = \"\"\"\\\n%(closure_copy)s\n%(to_name)s = Nuitka_Generator_NewEmpty(\n    %(generator_module)s,\n    %(generator_name_obj)s,\n#if PYTHON_VERSION >= 0x350\n    %(generator_qualname_obj)s,\n#endif\n    %(code_identifier)s,\n    %(closure_name)s,\n    %(closure_count)d\n);\n\"\"\"\n\n\ntemplate_generator_exception_exit = \"\"\"\\\n%(function_cleanup)s\n    return NULL;\n\n    function_exception_exit:\n%(function_cleanup)s\n    assert(%(exception_type)s);\n    RESTORE_ERROR_OCCURRED(tstate, %(exception_type)s, %(exception_value)s, %(exception_tb)s);\n\n    return NULL;\n\"\"\"\n\ntemplate_generator_noexception_exit = \"\"\"\\\n    // Return statement need not be present.\n%(function_cleanup)s\n    return NULL;\n\"\"\"\n\ntemplate_generator_return_exit = \"\"\"\\\n    NUITKA_CANNOT_GET_HERE(\"Generator must have exited already.\");\n    return NULL;\n\n    function_return_exit:\n#if PYTHON_VERSION >= 0x300\n    generator->m_returned = %(return_value)s;\n#endif\n\n%(function_cleanup)s\n    return NULL;\n\"\"\"\n\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesIterators.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Templates for the iterator handling.\n\n\"\"\"\n\ntemplate_iterator_check = \"\"\"\\\n// Check if iterator has left-over elements.\nCHECK_OBJECT(%(iterator_name)s); assert(HAS_ITERNEXT(%(iterator_name)s));\n\n%(attempt_name)s = (*Py_TYPE(%(iterator_name)s)->tp_iternext)(%(iterator_name)s);\n\nif (likely(%(attempt_name)s == NULL)) {\n    PyObject *error = GET_ERROR_OCCURRED(tstate);\n\n    if (error != NULL) {\n        if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration)) {\n            CLEAR_ERROR_OCCURRED(tstate);\n        } else {\n            FETCH_ERROR_OCCURRED(tstate, &%(exception_type)s, &%(exception_value)s, &%(exception_tb)s);\n%(release_temps_1)s\n%(var_description_code_1)s\n%(line_number_code_1)s\n            goto %(exception_exit)s;\n        }\n    }\n} else {\n    Py_DECREF(%(attempt_name)s);\n\n    %(exception_type)s = PyExc_ValueError;\n    Py_INCREF(PyExc_ValueError);\n    %(exception_value)s = %(too_many_values_error)s;\n    Py_INCREF(%(exception_value)s);\n    %(exception_tb)s = NULL;\n%(release_temps_2)s\n%(var_description_code_2)s\n%(line_number_code_2)s\n    goto %(exception_exit)s;\n}\"\"\"\n\ntemplate_loop_break_next = \"\"\"\\\nif (%(to_name)s == NULL) {\n    if (CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate)) {\n%(break_indicator_code)s\n        goto %(break_target)s;\n    } else {\n%(release_temps)s\n        FETCH_ERROR_OCCURRED(tstate, &%(exception_type)s, &%(exception_value)s, &%(exception_tb)s);\n%(var_description_code)s\n%(line_number_code)s\n        goto %(exception_target)s;\n    }\n}\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesLoader.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Templates for the loading of embedded modules.\n\n\"\"\"\n\ntemplate_metapath_loader_compiled_module_entry = \"\"\"\\\n{%(module_name)s, modulecode_%(module_identifier)s, 0, 0, %(flags)s\n#if defined(_NUITKA_FREEZER_HAS_FILE_PATH)\n, %(file_path)s\n#endif\n},\"\"\"\n\ntemplate_metapath_loader_extension_module_entry = \"\"\"\\\n{%(module_name)s, NULL, 0, 0, %(flags)s\n#if defined(_NUITKA_FREEZER_HAS_FILE_PATH)\n, %(file_path)s\n#endif\n},\"\"\"\n\ntemplate_metapath_loader_bytecode_module_entry = \"\"\"\\\n{%(module_name)s, NULL, %(bytecode)s, %(size)d, %(flags)s\n#if defined(_NUITKA_FREEZER_HAS_FILE_PATH)\n, %(file_path)s\n#endif\n},\"\"\"\n\n\ntemplate_metapath_loader_body = r\"\"\"\n/* Code to register embedded modules for meta path based loading if any. */\n\n#include <Python.h>\n\n/* Use a hex version of our own to compare for versions. We do not care about pre-releases */\n#if PY_MICRO_VERSION < 16\n#define PYTHON_VERSION (PY_MAJOR_VERSION * 256 + PY_MINOR_VERSION * 16 + PY_MICRO_VERSION)\n#else\n#define PYTHON_VERSION (PY_MAJOR_VERSION * 256 + PY_MINOR_VERSION * 16 + 15)\n#endif\n\n#include \"nuitka/constants_blob.h\"\n\n#include \"nuitka/tracing.h\"\n#include \"nuitka/unfreezing.h\"\n\n/* Type bool */\n#ifndef __cplusplus\n#include \"stdbool.h\"\n#endif\n\n#if %(bytecode_count)d > 0\nstatic unsigned char *bytecode_data[%(bytecode_count)d];\n#else\nstatic unsigned char **bytecode_data = NULL;\n#endif\n\n/* Table for lookup to find compiled or bytecode modules included in this\n * binary or module, or put along this binary as extension modules. We do\n * our own loading for each of these.\n */\n%(metapath_module_decls)s\n\nstatic struct Nuitka_MetaPathBasedLoaderEntry meta_path_loader_entries[] = {\n%(metapath_loader_inittab)s\n    {NULL, NULL, 0, 0, 0}\n};\n\nstatic void _loadBytesCodesBlob(PyThreadState *tstate) {\n    static bool init_done = false;\n\n    if (init_done == false) {\n        // Note needed for mere data.\n        loadConstantsBlob(tstate, (PyObject **)bytecode_data, \".bytecode\");\n\n        init_done = true;\n    }\n}\n\n\nvoid setupMetaPathBasedLoader(PyThreadState *tstate) {\n    static bool init_done = false;\n    if (init_done == false) {\n        _loadBytesCodesBlob(tstate);\n        registerMetaPathBasedUnfreezer(meta_path_loader_entries, bytecode_data);\n\n        init_done = true;\n    }\n}\n\n// This provides the frozen (compiled bytecode) files that are included if\n// any.\n\n// These modules should be loaded as bytecode. They may e.g. have to be loadable\n// during \"Py_Initialize\" already, or for irrelevance, they are only included\n// in this un-optimized form. These are not compiled by Nuitka, and therefore\n// are not accelerated at all, merely bundled with the binary or module, so\n// that CPython library can start out finding them.\n\nstruct frozen_desc {\n    char const *name;\n    int index;\n    int size;\n};\n\nstatic struct frozen_desc _frozen_modules[] = {\n%(frozen_modules)s\n    {NULL, 0, 0}\n};\n\n\nvoid copyFrozenModulesTo(struct _frozen *destination) {\n    NUITKA_PRINT_TIMING(\"copyFrozenModulesTo(): Calling _loadBytesCodesBlob.\");\n    _loadBytesCodesBlob(NULL);\n\n    NUITKA_PRINT_TIMING(\"copyFrozenModulesTo(): Updating frozen module table sizes.\");\n\n    struct frozen_desc *current = _frozen_modules;\n\n    for (;;) {\n        destination->name = (char *)current->name;\n        destination->code = bytecode_data[current->index];\n        destination->size = current->size;\n#if PYTHON_VERSION >= 0x3b0\n        destination->is_package = current->size < 0;\n        destination->size = Py_ABS(destination->size);\n        destination->get_code = NULL;\n#endif\n        if (destination->name == NULL) break;\n\n        current += 1;\n        destination += 1;\n    };\n}\n\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesModules.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main module code templates\n\nThis for the main program in case of executables, the module templates and\nstuff related to importing, and of course the generated code license.\n\n\"\"\"\n\ntemplate_global_copyright = \"\"\"\\\n/* Generated code for Python module '%(module_identifier)s'\n * created by Nuitka version %(version)s\n *\n * This code is in part copyright %(year)s Kay Hayen.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\"\"\"\n\ntemplate_module_body_template = r\"\"\"\n#include \"nuitka/prelude.h\"\n\n#include \"nuitka/unfreezing.h\"\n\n#include \"__helpers.h\"\n\n/* The \"module_%(module_identifier)s\" is a Python object pointer of module type.\n *\n * Note: For full compatibility with CPython, every module variable access\n * needs to go through it except for cases where the module cannot possibly\n * have changed in the mean time.\n */\n\nPyObject *module_%(module_identifier)s;\nPyDictObject *moduledict_%(module_identifier)s;\n\n/* The declarations of module constants used, if any. */\nstatic PyObject *mod_consts[%(constants_count)d];\n#ifndef __NUITKA_NO_ASSERT__\nstatic Py_hash_t mod_consts_hash[%(constants_count)d];\n#endif\n\nstatic PyObject *module_filename_obj = NULL;\n\n/* Indicator if this modules private constants were created yet. */\nstatic bool constants_created = false;\n\n/* Function to create module private constants. */\nstatic void createModuleConstants(PyThreadState *tstate) {\n    if (constants_created == false) {\n        loadConstantsBlob(tstate, &mod_consts[0], UNTRANSLATE(%(module_const_blob_name)s));\n        constants_created = true;\n\n#ifndef __NUITKA_NO_ASSERT__\n        for (int i = 0; i < %(constants_count)d; i++) {\n            mod_consts_hash[i] = DEEP_HASH(tstate, mod_consts[i]);\n        }\n#endif\n    }\n}\n\n// We want to be able to initialize the \"__main__\" constants in any case.\n#if %(is_dunder_main)s\nvoid createMainModuleConstants(PyThreadState *tstate) {\n    createModuleConstants(tstate);\n}\n#endif\n\n/* Function to verify module private constants for non-corruption. */\n#ifndef __NUITKA_NO_ASSERT__\nvoid checkModuleConstants_%(module_identifier)s(PyThreadState *tstate) {\n    // The module may not have been used at all, then ignore this.\n    if (constants_created == false) return;\n\n    for (int i = 0; i < %(constants_count)d; i++) {\n        assert(mod_consts_hash[i] == DEEP_HASH(tstate, mod_consts[i]));\n        CHECK_OBJECT_DEEP(mod_consts[i]);\n    }\n}\n#endif\n\n// The module code objects.\n%(module_code_objects_decl)s\n\nstatic void createModuleCodeObjects(void) {\n%(module_code_objects_init)s\n}\n\n// The module function declarations.\n%(module_functions_decl)s\n\n// The module function definitions.\n%(module_functions_code)s\n\nextern void _initCompiledCellType();\nextern void _initCompiledGeneratorType();\nextern void _initCompiledFunctionType();\nextern void _initCompiledMethodType();\nextern void _initCompiledFrameType();\n\nextern PyTypeObject Nuitka_Loader_Type;\n\n#ifdef _NUITKA_PLUGIN_DILL_ENABLED\n// Provide a way to create find a function via its C code and create it back\n// in another process, useful for multiprocessing extensions like dill\nextern void registerDillPluginTables(PyThreadState *tstate, char const *module_name, PyMethodDef *reduce_compiled_function, PyMethodDef *create_compiled_function);\n\nstatic function_impl_code const function_table_%(module_identifier)s[] = {\n%(module_function_table_entries)s\n    NULL\n};\n\nstatic PyObject *_reduce_compiled_function(PyObject *self, PyObject *args, PyObject *kwds) {\n    PyObject *func;\n\n    if (!PyArg_ParseTuple(args, \"O:reduce_compiled_function\", &func, NULL)) {\n        return NULL;\n    }\n\n    if (Nuitka_Function_Check(func) == false) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"not a compiled function\");\n        return NULL;\n    }\n\n    struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)func;\n\n    int offset = Nuitka_Function_GetFunctionCodeIndex(function, function_table_%(module_identifier)s);\n\n    if (unlikely(offset == -1)) {\n        PyThreadState *tstate = PyThreadState_GET();\n#if 0\n        PRINT_STRING(\"Looking for:\");\n        PRINT_ITEM(func);\n        PRINT_NEW_LINE();\n#endif\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"Cannot find compiled function in module.\");\n        return NULL;\n    }\n\n    PyObject *code_object_desc = MAKE_TUPLE_EMPTY(6);\n    PyTuple_SET_ITEM0(code_object_desc, 0, function->m_code_object->co_filename);\n    PyTuple_SET_ITEM0(code_object_desc, 1, function->m_code_object->co_name);\n    PyTuple_SET_ITEM(code_object_desc, 2, PyLong_FromLong(function->m_code_object->co_firstlineno));\n    PyTuple_SET_ITEM0(code_object_desc, 3, function->m_code_object->co_varnames);\n    PyTuple_SET_ITEM(code_object_desc, 4, PyLong_FromLong(function->m_code_object->co_argcount));\n    PyTuple_SET_ITEM(code_object_desc, 5, PyLong_FromLong(function->m_code_object->co_flags));\n\n    CHECK_OBJECT_DEEP(code_object_desc);\n\n\n    PyObject *result = MAKE_TUPLE_EMPTY(8);\n    PyTuple_SET_ITEM(result, 0, PyLong_FromLong(offset));\n    PyTuple_SET_ITEM(result, 1, code_object_desc);\n    PyTuple_SET_ITEM0(result, 2, function->m_defaults);\n#if PYTHON_VERSION >= 0x300\n    PyTuple_SET_ITEM0(result, 3, function->m_kwdefaults ? function->m_kwdefaults : Py_None);\n#else\n    PyTuple_SET_ITEM0(result, 3, Py_None);\n#endif\n    PyTuple_SET_ITEM0(result, 4, function->m_doc != NULL ? function->m_doc : Py_None);\n\n    if (offset == -5) {\n        CHECK_OBJECT(function->m_constant_return_value);\n        PyTuple_SET_ITEM0(result, 5, function->m_constant_return_value);\n    } else {\n        PyTuple_SET_ITEM0(result, 5, Py_None);\n    }\n\n#if PYTHON_VERSION >= 0x300\n    PyTuple_SET_ITEM0(result, 6, function->m_qualname);\n#else\n    PyTuple_SET_ITEM0(result, 6, Py_None);\n#endif\n\n    PyObject *closure = PyObject_GetAttr(\n        (PyObject *)function,\n        const_str_plain___closure__\n    );\n\n    if (closure != Py_None) {\n        for (Py_ssize_t i=0; i < PyTuple_GET_SIZE(closure); i++) {\n            struct Nuitka_CellObject *cell = (struct Nuitka_CellObject *)PyTuple_GET_ITEM(closure, i);\n\n            assert(Nuitka_Cell_Check((PyObject *)cell));\n\n            PyTuple_SET_ITEM0(\n                closure,\n                i,\n                cell->ob_ref\n            );\n        }\n    }\n\n    PyTuple_SET_ITEM(result, 7, closure);\n\n    CHECK_OBJECT_DEEP(result);\n\n    return result;\n}\n\nstatic PyMethodDef _method_def_reduce_compiled_function = {\"reduce_compiled_function\", (PyCFunction)_reduce_compiled_function,\n                                                           METH_VARARGS, NULL};\n\n\nstatic PyObject *_create_compiled_function(PyObject *self, PyObject *args, PyObject *kwds) {\n    CHECK_OBJECT_DEEP(args);\n\n    PyObject *function_index;\n    PyObject *code_object_desc;\n    PyObject *defaults;\n    PyObject *kw_defaults;\n    PyObject *doc;\n    PyObject *constant_return_value;\n    PyObject *function_qualname;\n    PyObject *closure;\n\n    if (!PyArg_ParseTuple(args, \"OOOOOOOO:create_compiled_function\", &function_index, &code_object_desc, &defaults, &kw_defaults, &doc, &constant_return_value, &function_qualname, &closure, NULL)) {\n        return NULL;\n    }\n\n#if PYTHON_VERSION >= 0x300\n    if (kw_defaults == Py_None) {\n        kw_defaults = NULL;\n    }\n#endif\n\n    return (PyObject *)Nuitka_Function_CreateFunctionViaCodeIndex(\n        module_%(module_identifier)s,\n        function_qualname,\n        function_index,\n        code_object_desc,\n        constant_return_value,\n        defaults,\n        kw_defaults,\n        doc,\n        closure,\n        function_table_%(module_identifier)s,\n        sizeof(function_table_%(module_identifier)s) / sizeof(function_impl_code)\n    );\n}\n\nstatic PyMethodDef _method_def_create_compiled_function = {\n    \"create_compiled_function\",\n    (PyCFunction)_create_compiled_function,\n    METH_VARARGS, NULL\n};\n\n\n#endif\n\n// Internal entry point for module code.\nPyObject *modulecode_%(module_identifier)s(PyThreadState *tstate, PyObject *module, struct Nuitka_MetaPathBasedLoaderEntry const *loader_entry) {\n    // Report entry to PGO.\n    PGO_onModuleEntered(\"%(module_identifier)s\");\n\n    // Store the module for future use.\n    module_%(module_identifier)s = module;\n\n    // Modules can be loaded again in case of errors, avoid the init being done again.\n    static bool init_done = false;\n\n    if (init_done == false) {\n#if defined(_NUITKA_MODULE) && %(is_top)d\n        // In case of an extension module loaded into a process, we need to call\n        // initialization here because that's the first and potentially only time\n        // we are going called.\n\n        // Initialize the constant values used.\n        _initBuiltinModule();\n        createGlobalConstants(tstate);\n\n        /* Initialize the compiled types of Nuitka. */\n        _initCompiledCellType();\n        _initCompiledGeneratorType();\n        _initCompiledFunctionType();\n        _initCompiledMethodType();\n        _initCompiledFrameType();\n\n        _initSlotCompare();\n#if PYTHON_VERSION >= 0x270\n        _initSlotIterNext();\n#endif\n\n        patchTypeComparison();\n\n        // Enable meta path based loader if not already done.\n#ifdef _NUITKA_TRACE\n        PRINT_STRING(\"%(module_identifier)s: Calling setupMetaPathBasedLoader().\\n\");\n#endif\n        setupMetaPathBasedLoader(tstate);\n\n#if PYTHON_VERSION >= 0x300\n        patchInspectModule(tstate);\n#endif\n\n#endif\n\n        /* The constants only used by this module are created now. */\n        NUITKA_PRINT_TRACE(\"%(module_identifier)s: Calling createModuleConstants().\\n\");\n        createModuleConstants(tstate);\n\n        createModuleCodeObjects();\n\n        init_done = true;\n    }\n\n#if defined(_NUITKA_MODULE) && %(is_top)d\n    PyObject *pre_load = IMPORT_EMBEDDED_MODULE(tstate, %(module_name_cstr)s \"-preLoad\");\n    if (pre_load == NULL) {\n        return NULL;\n    }\n#endif\n\n    // PRINT_STRING(\"in init%(module_identifier)s\\n\");\n\n    moduledict_%(module_identifier)s = MODULE_DICT(module_%(module_identifier)s);\n\n#ifdef _NUITKA_PLUGIN_DILL_ENABLED\n    {\n        char const *module_name_c;\n        if (loader_entry != NULL) {\n            module_name_c = loader_entry->name;\n        } else {\n            PyObject *module_name = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___name__);\n            module_name_c = Nuitka_String_AsString(module_name);\n        }\n\n        registerDillPluginTables(tstate, module_name_c, &_method_def_reduce_compiled_function, &_method_def_create_compiled_function);\n    }\n#endif\n\n    // Set \"__compiled__\" to what version information we have.\n    UPDATE_STRING_DICT0(\n        moduledict_%(module_identifier)s,\n        (Nuitka_StringObject *)const_str_plain___compiled__,\n        Nuitka_dunder_compiled_value\n    );\n\n    // Update \"__package__\" value to what it ought to be.\n    {\n#if %(is_dunder_main)s\n        UPDATE_STRING_DICT0(\n            moduledict_%(module_identifier)s,\n            (Nuitka_StringObject *)const_str_plain___package__,\n            %(dunder_main_package)s\n        );\n#elif %(is_package)s\n        PyObject *module_name = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___name__);\n\n        UPDATE_STRING_DICT0(\n            moduledict_%(module_identifier)s,\n            (Nuitka_StringObject *)const_str_plain___package__,\n            module_name\n        );\n#else\n\n#if PYTHON_VERSION < 0x300\n        PyObject *module_name = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___name__);\n        char const *module_name_cstr = PyString_AS_STRING(module_name);\n\n        char const *last_dot = strrchr(module_name_cstr, '.');\n\n        if (last_dot != NULL) {\n            UPDATE_STRING_DICT1(\n                moduledict_%(module_identifier)s,\n                (Nuitka_StringObject *)const_str_plain___package__,\n                PyString_FromStringAndSize(module_name_cstr, last_dot - module_name_cstr)\n            );\n        }\n#else\n        PyObject *module_name = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___name__);\n        Py_ssize_t dot_index = PyUnicode_Find(module_name, const_str_dot, 0, PyUnicode_GetLength(module_name), -1);\n\n        if (dot_index != -1) {\n            UPDATE_STRING_DICT1(\n                moduledict_%(module_identifier)s,\n                (Nuitka_StringObject *)const_str_plain___package__,\n                PyUnicode_Substring(module_name, 0, dot_index)\n            );\n        }\n#endif\n#endif\n    }\n\n    CHECK_OBJECT(module_%(module_identifier)s);\n\n    // For deep importing of a module we need to have \"__builtins__\", so we set\n    // it ourselves in the same way than CPython does. Note: This must be done\n    // before the frame object is allocated, or else it may fail.\n\n    if (GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___builtins__) == NULL) {\n        PyObject *value = (PyObject *)builtin_module;\n\n        // Check if main module, not a dict then but the module itself.\n#if defined(_NUITKA_MODULE) || !%(is_dunder_main)s\n        value = PyModule_GetDict(value);\n#endif\n\n        UPDATE_STRING_DICT0(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___builtins__, value);\n    }\n\n    UPDATE_STRING_DICT0(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___loader__, (PyObject *)&Nuitka_Loader_Type);\n\n#if PYTHON_VERSION >= 0x340\n// Set the \"__spec__\" value\n\n#if %(is_dunder_main)s\n    // Main modules just get \"None\" as spec.\n    UPDATE_STRING_DICT0(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___spec__, Py_None);\n#else\n    // Other modules get a \"ModuleSpec\" from the standard mechanism.\n    {\n        PyObject *bootstrap_module = getImportLibBootstrapModule();\n        CHECK_OBJECT(bootstrap_module);\n\n        PyObject *_spec_from_module = PyObject_GetAttrString(bootstrap_module, \"_spec_from_module\");\n        CHECK_OBJECT(_spec_from_module);\n\n        PyObject *spec_value = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, _spec_from_module, module_%(module_identifier)s);\n        Py_DECREF(_spec_from_module);\n\n        // We can assume this to never fail, or else we are in trouble anyway.\n        // CHECK_OBJECT(spec_value);\n\n        if (spec_value == NULL) {\n            PyErr_PrintEx(0);\n            abort();\n        }\n\n// Mark the execution in the \"__spec__\" value.\n        SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_True);\n\n        UPDATE_STRING_DICT1(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___spec__, spec_value);\n    }\n#endif\n#endif\n\n    // Temp variables if any\n%(temps_decl)s\n\n    // Module init code if any\n%(module_init_codes)s\n\n    // Module code.\n%(module_codes)s\n\n    // Report to PGO about leaving the module without error.\n    PGO_onModuleExit(\"%(module_identifier)s\", false);\n\n#if defined(_NUITKA_MODULE) && %(is_top)d\n    PyObject *post_load = IMPORT_EMBEDDED_MODULE(tstate, %(module_name_cstr)s \"-postLoad\");\n    if (post_load == NULL) {\n        return NULL;\n    }\n#endif\n\n    Py_INCREF(module_%(module_identifier)s);\n    return module_%(module_identifier)s;\n%(module_exit)s\n\"\"\"\n\ntemplate_module_external_entry_point = r\"\"\"\n\n/* Visibility definitions to make the DLL entry point exported */\n#if defined(__GNUC__)\n\n#if PYTHON_VERSION < 0x300\n\n#if defined(_WIN32)\n#define NUITKA_MODULE_INIT_FUNCTION __declspec(dllexport) PyMODINIT_FUNC\n#else\n#define NUITKA_MODULE_INIT_FUNCTION PyMODINIT_FUNC __attribute__((visibility(\"default\")))\n#endif\n\n#else\n\n#if defined(_WIN32)\n#define NUITKA_MODULE_INIT_FUNCTION __declspec(dllexport) PyObject *\n#else\n\n#ifdef __cplusplus\n#define NUITKA_MODULE_INIT_FUNCTION extern \"C\" __attribute__((visibility(\"default\"))) PyObject *\n#else\n#define NUITKA_MODULE_INIT_FUNCTION __attribute__((visibility(\"default\"))) PyObject *\n#endif\n\n#endif\n#endif\n\n#else\n#define NUITKA_MODULE_INIT_FUNCTION PyMODINIT_FUNC\n#endif\n\n/* The name of the entry point for DLLs changed between CPython versions, and\n * this is here to hide that.\n */\n#if PYTHON_VERSION < 0x300\n#define MOD_INIT_DECL(name) NUITKA_MODULE_INIT_FUNCTION init##name(void)\n#else\n#define MOD_INIT_DECL(name) NUITKA_MODULE_INIT_FUNCTION PyInit_##name(void)\n#endif\n\nstatic PyObject *orig_dunder_file_value;\n\n#if PYTHON_VERSION >= 0x300\nstatic setattrofunc orig_PyModule_Type_tp_setattro;\n\n/* This is used one time only. */\nstatic int Nuitka_TopLevelModule_tp_setattro(PyObject *module, PyObject *name, PyObject *value) {\n    PyModule_Type.tp_setattro = orig_PyModule_Type_tp_setattro;\n\n    if (orig_dunder_file_value != NULL) {\n        UPDATE_STRING_DICT0(\n            moduledict_%(module_identifier)s,\n            (Nuitka_StringObject *)const_str_plain___file__,\n            orig_dunder_file_value\n        );\n    }\n\n    // Prevent \"__spec__\" update as well.\n#if PYTHON_VERSION >= 0x340\n    if (PyUnicode_Check(name) && PyUnicode_Compare(name, const_str_plain___spec__) == 0) {\n        return 0;\n    }\n#endif\n\n    return orig_PyModule_Type_tp_setattro(module, name, value);\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic struct PyModuleDef mdef_%(module_identifier)s = {\n    PyModuleDef_HEAD_INIT,\n    NULL,                /* m_name, filled later */\n    NULL,                /* m_doc */\n    -1,                  /* m_size */\n    NULL,                /* m_methods */\n    NULL,                /* m_reload */\n    NULL,                /* m_traverse */\n    NULL,                /* m_clear */\n    NULL,                /* m_free */\n};\n#endif\n\n/* The exported interface to CPython. On import of the module, this function\n * gets called. It has to have an exact function name, in cases it's a shared\n * library export. This is hidden behind the MOD_INIT_DECL macro.\n */\n\n// Actual name might be different when loaded as a package.\nstatic char const *module_full_name = %(module_name_cstr)s;\n\n#if PYTHON_VERSION < 0x300\nstatic void onModuleFileValueRelease(void *v) {\n    if (orig_dunder_file_value != NULL) {\n        UPDATE_STRING_DICT0(\n            moduledict_%(module_identifier)s,\n            (Nuitka_StringObject *)const_str_plain___file__,\n            orig_dunder_file_value\n        );\n    }\n}\n#endif\n\nMOD_INIT_DECL(%(module_identifier)s) {\n    if (_Py_PackageContext != NULL) {\n        module_full_name = _Py_PackageContext;\n    }\n\n#if PYTHON_VERSION < 0x300\n    PyObject *module = Py_InitModule4(\n        module_full_name,        // Module Name\n        NULL,                    // No methods initially, all are added\n                                 // dynamically in actual module code only.\n        NULL,                    // No \"__doc__\" is initially set, as it could\n                                 // not contain NUL this way, added early in\n                                 // actual code.\n        NULL,                    // No self for modules, we don't use it.\n        PYTHON_API_VERSION\n    );\n#else\n    mdef_%(module_identifier)s.m_name = module_full_name;\n    PyObject *module = PyModule_Create(&mdef_%(module_identifier)s);\n    CHECK_OBJECT(module);\n\n    {\n        NUITKA_MAY_BE_UNUSED bool res = Nuitka_SetModuleString(module_full_name, module);\n        assert(res != false);\n    }\n#endif\n\n    PyThreadState *tstate = PyThreadState_GET();\n\n#if PYTHON_VERSION < 0x300\n    modulecode_%(module_identifier)s(tstate, module, NULL);\n\n    // Our \"__file__\" value will not be respected by CPython and one\n    // way we can avoid it, is by having a capsule type, that when\n    // it gets released, we are called and repair the value.\n\n    if (HAS_ERROR_OCCURRED(tstate) == false) {\n        orig_dunder_file_value = DICT_GET_ITEM_WITH_HASH_ERROR1(tstate, (PyObject *)moduledict_%(module_identifier)s, const_str_plain___file__);\n\n        PyObject *fake_file_value = PyCObject_FromVoidPtr(NULL, onModuleFileValueRelease);\n\n        UPDATE_STRING_DICT1(\n            moduledict_%(module_identifier)s,\n            (Nuitka_StringObject *)const_str_plain___file__,\n            fake_file_value\n        );\n    }\n#else\n    PyObject *result = modulecode_%(module_identifier)s(tstate, module, NULL);\n\n    if (result != NULL) {\n        // Make sure we undo the change of the \"__file__\" attribute during importing. We do not\n        // know how to achieve it for Python2 though. TODO: Find something for Python2 too.\n        orig_PyModule_Type_tp_setattro = PyModule_Type.tp_setattro;\n        PyModule_Type.tp_setattro = Nuitka_TopLevelModule_tp_setattro;\n\n        orig_dunder_file_value = DICT_GET_ITEM_WITH_HASH_ERROR1(tstate, (PyObject *)moduledict_%(module_identifier)s, const_str_plain___file__);\n    }\n\n    return result;\n#endif\n}\n\"\"\"\n\ntemplate_module_exception_exit = \"\"\"\\\n    module_exception_exit:\n\n#if defined(_NUITKA_MODULE) && %(is_top)d\n    {\n        PyObject *module_name = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)const_str_plain___name__);\n\n        if (module_name != NULL) {\n            Nuitka_DelModule(tstate, module_name);\n        }\n    }\n#endif\n    PGO_onModuleExit(\"%(module_identifier)s\", false);\n\n    RESTORE_ERROR_OCCURRED(tstate, exception_type, exception_value, exception_tb);\n    return NULL;\n}\"\"\"\n\ntemplate_module_no_exception_exit = \"\"\"\\\n}\"\"\"\n\ntemplate_helper_impl_decl = \"\"\"\\\n// This file contains helper functions that are automatically created from\n// templates.\n\n#include \"nuitka/prelude.h\"\n\nextern PyObject *callPythonFunction(PyObject *func, PyObject *const *args, int count);\n\n\"\"\"\n\ntemplate_header_guard = \"\"\"\\\n#ifndef %(header_guard_name)s\n#define %(header_guard_name)s\n\n%(header_body)s\n#endif\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/CodeTemplatesVariables.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Templates for the variable handling.\n\n\"\"\"\n\ntemplate_write_local_unclear_ref0 = \"\"\"\\\n{\n    PyObject *old = %(identifier)s;\n    %(identifier)s = %(tmp_name)s;\n    Py_XDECREF(old);\n}\n\"\"\"\n\ntemplate_write_local_unclear_ref1 = \"\"\"\\\n{\n    PyObject *old = %(identifier)s;\n    %(identifier)s = %(tmp_name)s;\n    Py_INCREF(%(identifier)s);\n    Py_XDECREF(old);\n}\n\"\"\"\n\ntemplate_write_local_empty_ref0 = \"\"\"\\\nassert(%(identifier)s == NULL);\n%(identifier)s = %(tmp_name)s;\"\"\"\n\ntemplate_write_local_empty_ref1 = \"\"\"\\\nassert(%(identifier)s == NULL);\nPy_INCREF(%(tmp_name)s);\n%(identifier)s = %(tmp_name)s;\"\"\"\n\ntemplate_write_local_clear_ref0 = \"\"\"\\\n{\n    PyObject *old = %(identifier)s;\n    assert(old != NULL);\n    %(identifier)s = %(tmp_name)s;\n    Py_DECREF(old);\n}\n\"\"\"\n\ntemplate_write_local_inplace = \"\"\"\\\n%(identifier)s = %(tmp_name)s;\n\"\"\"\n\ntemplate_write_shared_inplace = \"\"\"\\\nPyCell_SET(%(identifier)s, %(tmp_name)s);\n\"\"\"\n\n\ntemplate_write_local_clear_ref1 = \"\"\"\\\n{\n    PyObject *old = %(identifier)s;\n    assert(old != NULL);\n    %(identifier)s = %(tmp_name)s;\n    Py_INCREF(%(identifier)s);\n    Py_DECREF(old);\n}\n\"\"\"\n\ntemplate_write_shared_unclear_ref0 = \"\"\"\\\n{\n    PyObject *old = Nuitka_Cell_GET(%(identifier)s);\n    PyCell_SET(%(identifier)s, %(tmp_name)s);\n    Py_XDECREF(old);\n}\n\"\"\"\n\ntemplate_write_shared_unclear_ref1 = \"\"\"\\\n{\n    PyObject *old = Nuitka_Cell_GET(%(identifier)s);\n    PyCell_SET(%(identifier)s, %(tmp_name)s);\n    Py_INCREF(%(tmp_name)s);\n    Py_XDECREF(old);\n}\n\"\"\"\n\ntemplate_write_shared_clear_ref0 = \"\"\"\\\nassert(Nuitka_Cell_GET(%(identifier)s) == NULL);\nPyCell_SET(%(identifier)s, %(tmp_name)s);\n\"\"\"\n\ntemplate_write_shared_clear_ref1 = \"\"\"\\\nassert(Nuitka_Cell_GET(%(identifier)s) == NULL);\nPy_INCREF(%(tmp_name)s);\nPyCell_SET(%(identifier)s, %(tmp_name)s);\n\"\"\"\n\n\ntemplate_del_local_tolerant = \"\"\"\\\nPy_XDECREF(%(identifier)s);\n%(identifier)s = NULL;\n\"\"\"\n\ntemplate_del_shared_tolerant = \"\"\"\\\n{\n    PyObject *old = Nuitka_Cell_GET(%(identifier)s);\n    PyCell_SET(%(identifier)s, NULL);\n    Py_XDECREF(old);\n}\n\"\"\"\n\ntemplate_del_local_intolerant = \"\"\"\\\n%(result)s = %(identifier)s != NULL;\nif (likely(%(result)s)) {\n    Py_DECREF(%(identifier)s);\n    %(identifier)s = NULL;\n}\n\"\"\"\n\ntemplate_del_shared_intolerant = \"\"\"\\\n{\n    PyObject *old = Nuitka_Cell_GET(%(identifier)s);\n    PyCell_SET(%(identifier)s, NULL);\n    Py_XDECREF(old);\n\n    %(result)s = old != NULL;\n}\n\"\"\"\n\ntemplate_del_local_known = \"\"\"\\\nCHECK_OBJECT(%(identifier)s);\nPy_DECREF(%(identifier)s);\n%(identifier)s = NULL;\n\"\"\"\n\ntemplate_del_shared_known = \"\"\"\\\n{\n    PyObject *old = Nuitka_Cell_GET(%(identifier)s);\n    PyCell_SET(%(identifier)s, NULL);\n\n    CHECK_OBJECT(old);\n    Py_DECREF(old);\n}\n\"\"\"\n\n\ntemplate_release_object_unclear = \"\"\"\\\nPy_XDECREF(%(identifier)s);\"\"\"\n\ntemplate_release_object_clear = \"\"\"\\\nPy_DECREF(%(identifier)s);\"\"\"\n\ntemplate_read_shared_known = \"\"\"\\\n%(tmp_name)s = Nuitka_Cell_GET(%(identifier)s);\n\"\"\"\n\n# For module variable values, need to lookup in module dictionary or in\n# built-in dictionary.\n\n# TODO: Only provide fallback for known actually possible values. Do this\n# by keeping track of things that were added by \"site.py\" mechanisms. Then\n# we can avoid the second call entirely for most cases.\ntemplate_read_mvar_unclear = \"\"\"\\\n%(tmp_name)s = LOOKUP_MODULE_VALUE(moduledict_%(module_identifier)s, %(var_name)s);\n\"\"\"\n\ntemplate_read_locals_dict_with_fallback = \"\"\"\\\n%(to_name)s = DICT_GET_ITEM0(tstate, %(locals_dict)s, %(var_name)s);\n\nif (%(to_name)s == NULL) {\n%(fallback)s\n}\n\"\"\"\n\ntemplate_read_locals_dict_without_fallback = \"\"\"\\\n%(to_name)s = DICT_GET_ITEM0(tstate, %(locals_dict)s, %(var_name)s);\n\"\"\"\n\n\ntemplate_read_locals_mapping_with_fallback = \"\"\"\\\n%(to_name)s = PyObject_GetItem(%(locals_dict)s, %(var_name)s);\n\nif (%(to_name)s == NULL) {\n    if (CHECK_AND_CLEAR_KEY_ERROR_OCCURRED(tstate)) {\n%(fallback)s\n        Py_INCREF(%(to_name)s);\n    } else {\n        goto %(exception_exit)s;\n    }\n}\n\"\"\"\n\ntemplate_read_locals_mapping_without_fallback = \"\"\"\\\n%(to_name)s = PyObject_GetItem(%(locals_dict)s, %(var_name)s);\n\"\"\"\n\n# TODO: Have DICT_REMOVE_ITEM_WITHOUT_ERROR and use that instead.\ntemplate_del_global_unclear = \"\"\"\\\n%(result)s = DICT_REMOVE_ITEM((PyObject *)moduledict_%(module_identifier)s, %(var_name)s);\nif (%(result)s == false) CLEAR_ERROR_OCCURRED(tstate);\n\"\"\"\n\ntemplate_del_global_known = \"\"\"\\\nif (DICT_REMOVE_ITEM((PyObject *)moduledict_%(module_identifier)s, %(var_name)s) == false) {\n    CLEAR_ERROR_OCCURRED(tstate);\n}\n\"\"\"\n\ntemplate_update_locals_dict_value = \"\"\"\\\nif (%(test_code)s) {\n    PyObject *value;\n%(access_code)s\n\n    UPDATE_STRING_DICT0((PyDictObject *)%(dict_name)s, (Nuitka_StringObject *)%(var_name)s, value);\n} else {\n    if (DICT_REMOVE_ITEM(%(dict_name)s, %(var_name)s) == false) {\n        CLEAR_ERROR_OCCURRED(tstate);\n    }\n}\n\"\"\"\n\ntemplate_set_locals_dict_value = \"\"\"\\\nif (%(test_code)s) {\n    PyObject *value;\n%(access_code)s\n\n    int res = PyDict_SetItem(\n        %(dict_name)s,\n        %(var_name)s,\n        value\n    );\n\n    assert(res == 0);\n}\n\"\"\"\n\ntemplate_update_locals_mapping_value = \"\"\"\\\nif (%(test_code)s) {\n    PyObject *value;\n%(access_code)s\n\n    int res = PyObject_SetItem(\n        %(mapping_name)s,\n        %(var_name)s,\n        value\n    );\n\n    %(tmp_name)s = res == 0;\n} else {\n    PyObject *test_value = PyObject_GetItem(\n        %(mapping_name)s,\n        %(var_name)s\n    );\n\n    if (test_value) {\n        Py_DECREF(test_value);\n\n        int res = PyObject_DelItem(\n            %(mapping_name)s,\n            %(var_name)s\n        );\n\n        %(tmp_name)s = res == 0;\n    } else {\n        CLEAR_ERROR_OCCURRED(tstate);\n        %(tmp_name)s = true;\n    }\n}\n\"\"\"\n\ntemplate_set_locals_mapping_value = \"\"\"\\\nif (%(test_code)s) {\n    PyObject *value;\n%(access_code)s\n\n    %(tmp_name)s = SET_SUBSCRIPT(\n        tstate,\n        %(mapping_name)s,\n        %(var_name)s,\n        value\n    );\n} else {\n    %(tmp_name)s = true;\n}\n\"\"\"\n\nfrom . import TemplateDebugWrapper  # isort:skip\n\nTemplateDebugWrapper.checkDebug(globals())\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/TemplateDebugWrapper.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nuitka templates can have more checks that the normal '%' operation.\n\nThis wraps strings with a class derived from \"str\" that does more checks.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.__past__ import iterItems\nfrom nuitka.Tracing import optimization_logger\n\n\nclass TemplateWrapper(object):\n    \"\"\"Wrapper around templates.\n\n    To better trace and control template usage.\n\n    \"\"\"\n\n    def __init__(self, name, value):\n        self.name = name\n        self.value = value\n\n    def __str__(self):\n        return self.value\n\n    def __add__(self, other):\n        return self.__class__(self.name + \"+\" + other.name, self.value + other.value)\n\n    def __mod__(self, other):\n        assert type(other) is dict, self.name\n\n        for key in other.keys():\n            if \"%%(%s)\" % key not in self.value:\n                optimization_logger.warning(\n                    \"Extra value %r provided to template %r.\" % (key, self.name)\n                )\n\n        try:\n            return self.value % other\n        except KeyError as e:\n            raise KeyError(self.name, *e.args)\n\n    def split(self, sep):\n        return self.value.split(sep)\n\n\ndef enableDebug(globals_dict):\n    templates = dict(globals_dict)\n\n    for template_name, template_value in iterItems(templates):\n        # Ignore internal attribute like \"__name__\" that the module will also\n        # have of course.\n        if template_name.startswith(\"_\"):\n            continue\n\n        if type(template_value) is str and \"{%\" not in template_value:\n            globals_dict[template_name] = TemplateWrapper(template_name, template_value)\n\n\ndef checkDebug(globals_dict):\n    if Options.is_debug:\n        enableDebug(globals_dict)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperObjectTools.c.j2' import CHECK_OBJECTS %}\n{% macro call_function_with_args(called, args, args_count) %}\n{% if args_count == 0 %}\nCALL_FUNCTION_NO_ARGS(tstate, {{ called }})\n{% elif args_count == 1 %}\nCALL_FUNCTION_WITH_SINGLE_ARG(tstate, {{ called }}, {{ args }}[0])\n{% else %}\nCALL_FUNCTION_WITH_ARGS{{args_count}}(tstate, {{ called }}, {{args}})\n{% endif %}\n{% endmacro %}\n{% if args_count == 0 %}\nPyObject *CALL_METHOD_NO_ARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name) {\n{% elif args_count == 1 %}\nPyObject *CALL_METHOD_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n{% else %}\nPyObject *CALL_METHOD_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObject *source, PyObject *attr_name, PyObject *const *args) {\n{% endif %}\n    CHECK_OBJECT(source);\n    CHECK_OBJECT(attr_name);\n\n    {{ CHECK_OBJECTS(args, args_count) }}\n\n    PyTypeObject *type = Py_TYPE(source);\n\n    if (hasTypeGenericGetAttr(type)) {\n        // Unfortunately this is required, although of cause rarely necessary.\n        if (unlikely(type->tp_dict == NULL)) {\n            if (unlikely(PyType_Ready(type) < 0)) {\n                return NULL;\n            }\n        }\n\n        PyObject *descr = Nuitka_TypeLookup(type, attr_name);\n        descrgetfunc func = NULL;\n\n        if (descr != NULL) {\n            Py_INCREF(descr);\n\n            if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n                func = Py_TYPE(descr)->tp_descr_get;\n\n                if (func != NULL && PyDescr_IsData(descr)) {\n                    PyObject *called_object = func(descr, source, (PyObject *)type);\n                    Py_DECREF(descr);\n\n                    PyObject *result = {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n                    Py_DECREF(called_object);\n                    return result;\n                }\n            }\n        }\n\n        Py_ssize_t dictoffset = type->tp_dictoffset;\n        PyObject *dict = NULL;\n\n        if (dictoffset != 0) {\n            // Negative dictionary offsets have special meaning.\n            if (dictoffset < 0) {\n                Py_ssize_t tsize;\n                size_t size;\n\n                tsize = ((PyVarObject *)source)->ob_size;\n                if (tsize < 0) {\n                    tsize = -tsize;\n                }\n                size = _PyObject_VAR_SIZE(type, tsize);\n\n                dictoffset += (long)size;\n            }\n\n            PyObject **dictptr = (PyObject **) ((char *)source + dictoffset);\n            dict = *dictptr;\n        }\n\n        if (dict != NULL) {\n            CHECK_OBJECT(dict);\n\n            Py_INCREF(dict);\n\n            PyObject *called_object = DICT_GET_ITEM1(tstate, dict, attr_name);\n\n            if (called_object != NULL) {\n                Py_XDECREF(descr);\n                Py_DECREF(dict);\n\n                PyObject *result = {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n                Py_DECREF(called_object);\n                return result;\n            }\n\n            Py_DECREF(dict);\n        }\n\n        if (func != NULL) {\n            if (func == Nuitka_Function_Type.tp_descr_get) {\n{% if args_count != 0 %}\n                PyObject *result = Nuitka_CallMethodFunctionPosArgs(\n                    tstate,\n                    (struct Nuitka_FunctionObject const *)descr,\n                    source,\n                    args,\n                    {{ args_count }}\n                );\n{% else %}\n                PyObject *result = Nuitka_CallMethodFunctionNoArgs(\n                    tstate,\n                    (struct Nuitka_FunctionObject const *)descr,\n                    source\n                );\n{% endif %}\n                Py_DECREF(descr);\n\n                return result;\n            } else {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                CHECK_OBJECT(called_object);\n\n                Py_DECREF(descr);\n\n                PyObject *result = {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        if (descr != NULL) {\n            CHECK_OBJECT(descr);\n\n            PyObject *result = {{ call_function_with_args( \"descr\", \"args\", args_count) }};\n            Py_DECREF(descr);\n            return result;\n        }\n\n#if PYTHON_VERSION < 0x300\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(\n            PyExc_AttributeError,\n            \"'%s' object has no attribute '%s'\",\n            type->tp_name,\n            PyString_AS_STRING(attr_name)\n        );\n#else\n        PyErr_Format(\n            PyExc_AttributeError,\n            \"'%s' object has no attribute '%U'\",\n            type->tp_name,\n            attr_name\n        );\n#endif\n        return NULL;\n    }\n#if PYTHON_VERSION < 0x300\n    else if (type == &PyInstance_Type) {\n        PyInstanceObject *source_instance = (PyInstanceObject *)source;\n\n        // The special cases have their own variant on the code generation level\n        // as we are called with constants only.\n        assert(attr_name != const_str_plain___dict__);\n        assert(attr_name != const_str_plain___class__);\n\n        // Try the instance dict first.\n        PyObject *called_object = GET_STRING_DICT_VALUE(\n            (PyDictObject *)source_instance->in_dict,\n            (PyStringObject *)attr_name\n        );\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            return {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n        }\n\n        // Then check the class dictionaries.\n        called_object = FIND_ATTRIBUTE_IN_CLASS(\n            source_instance->in_class,\n            attr_name\n        );\n\n        // Note: The \"called_object\" was found without taking a reference,\n        // so we need not release it in this branch.\n        if (called_object != NULL) {\n            descrgetfunc descr_get = Py_TYPE(called_object)->tp_descr_get;\n\n            if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n{% if args_count != 0 %}\n                return Nuitka_CallMethodFunctionPosArgs(\n                    tstate,\n                    (struct Nuitka_FunctionObject const *)called_object,\n                    source,\n                    args,\n                    {{ args_count }}\n                );\n{% else %}\n                return Nuitka_CallMethodFunctionNoArgs(\n                    tstate,\n                    (struct Nuitka_FunctionObject const *)called_object,\n                    source\n                );\n{% endif %}\n            } else if (descr_get != NULL) {\n                PyObject *method = descr_get(\n                    called_object,\n                    source,\n                    (PyObject *)source_instance->in_class\n                );\n\n                if (unlikely(method == NULL)) {\n                    return NULL;\n                }\n\n                PyObject *result = {{ call_function_with_args( \"method\", \"args\", args_count) }};\n                Py_DECREF(method);\n                return result;\n            } else {\n                return {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n            }\n\n        } else if (unlikely(source_instance->in_class->cl_getattr == NULL)) {\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(\n                PyExc_AttributeError,\n                \"%s instance has no attribute '%s'\",\n                PyString_AS_STRING(source_instance->in_class->cl_name),\n                PyString_AS_STRING(attr_name)\n            );\n\n            return NULL;\n        } else {\n            // Finally allow the \"__getattr__\" override to provide it or else\n            // it's an error.\n\n            PyObject *args2[] = {\n                source,\n                attr_name\n            };\n\n            called_object = CALL_FUNCTION_WITH_ARGS2(\n                tstate,\n                source_instance->in_class->cl_getattr,\n                args2\n            );\n\n            if (unlikely(called_object == NULL)) {\n                return NULL;\n            }\n\n            PyObject *result = {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n            Py_DECREF(called_object);\n            return result;\n        }\n    }\n#endif\n    else if (type->tp_getattro != NULL) {\n        PyObject *descr = (*type->tp_getattro)(source, attr_name);\n\n        if (unlikely(descr == NULL)) {\n            return NULL;\n        }\n\n        descrgetfunc func = NULL;\n        if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {\n            func = Py_TYPE(descr)->tp_descr_get;\n\n            if (func != NULL && PyDescr_IsData(descr)) {\n                PyObject *called_object = func(descr, source, (PyObject *)type);\n                Py_DECREF(descr);\n\n                if (unlikely(called_object == NULL))\n                {\n                    return NULL;\n                }\n\n                PyObject *result = {{ call_function_with_args(\"called_object\", \"args\", args_count) }};\n                Py_DECREF(called_object);\n                return result;\n            }\n        }\n\n        PyObject *result = {{ call_function_with_args(\"descr\", \"args\", args_count) }};\n        Py_DECREF(descr);\n        return result;\n    } else if (type->tp_getattr != NULL) {\n        PyObject *called_object = (*type->tp_getattr)(\n            source,\n            (char *)Nuitka_String_AsString_Unchecked(attr_name)\n        );\n\n        if (unlikely(called_object == NULL)) {\n            return NULL;\n        }\n\n        PyObject *result = {{ call_function_with_args( \"called_object\", \"args\", args_count) }};\n        Py_DECREF(called_object);\n        return result;\n    } else {\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT2(\n            PyExc_AttributeError,\n            \"'%s' object has no attribute '%s'\",\n            type->tp_name,\n            Nuitka_String_AsString_Unchecked(attr_name)\n        );\n\n        return NULL;\n    }\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperObjectTools.c.j2' import CHECK_OBJECTS %}\n{% if not has_dict_values %}\nPyObject *CALL_FUNCTION_WITH_ARGS{{args_count}}_VECTORCALL(PyThreadState *tstate, PyObject *called, PyObject *const *args, PyObject *kw_names) {\n{% elif args_count == 0 and has_dict_values %}\nPyObject *CALL_FUNCTION_WITH_NO_ARGS_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *kw_values, PyObject *kw_names) {\n{% elif not has_tuple_arg %}\nPyObject *CALL_FUNCTION_WITH_ARGS{{args_count}}_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *const *args, PyObject *const *kw_values, PyObject *kw_names) {\n{% else %}\nPyObject *CALL_FUNCTION_WITH_POSARGS{{args_count}}_KWSPLIT(PyThreadState *tstate, PyObject *called, PyObject *pos_args, PyObject *const *kw_values, PyObject *kw_names) {\n    assert(PyTuple_CheckExact(pos_args));\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n{% endif %}\n    {{ CHECK_OBJECTS(args, args_count) }}\n    CHECK_OBJECT(kw_names);\n    assert(PyTuple_CheckExact(kw_names));\n    CHECK_OBJECT(called);\n\n    Py_ssize_t nkwargs = PyTuple_GET_SIZE(kw_names);\n\n    {# The dict values might be joined and separately, check them too. #}\n{% if has_dict_values %}\n    CHECK_OBJECTS(kw_values, PyTuple_GET_SIZE(kw_names));\n{% else %}\n    CHECK_OBJECTS(&args[{{args_count}}], nkwargs);\n{% endif %}\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n\n{% if args_count == 0 %}\n        {# TODO: Add more specialized entry point for KwSplit only. #}\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, NULL, {{args_count}}, kw_values, kw_names);\n{% elif not has_dict_values %}\n        PyObject *result = Nuitka_CallFunctionVectorcall(tstate, function, args, {{args_count}}, &PyTuple_GET_ITEM(kw_names, 0), nkwargs);\n{% else %}\n        PyObject *result = Nuitka_CallFunctionPosArgsKwSplit(tstate, function, args, {{args_count}}, kw_values, kw_names);\n{% endif %}\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n{% if args_count == 0 %}\n            PyObject *result = func(called, kw_values, 0, kw_names);\n{% elif not has_dict_values %}\n            PyObject *result = func(called, args, {{args_count}}, kw_names);\n{% else %}\n            NUITKA_DYNAMIC_ARRAY_DECL(vectorcall_args, PyObject *, {{args_count}} + nkwargs);\n\n            memcpy(vectorcall_args, args, {{args_count}}*sizeof(PyObject *));\n            memcpy(&vectorcall_args[{{args_count}}], kw_values, nkwargs*sizeof(PyObject *));\n\n            PyObject *result = func(called, vectorcall_args, {{args_count}}, kw_names);\n{% endif %}\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n    ternaryfunc call_slot = Py_TYPE(called)->tp_call;\n\n    if (unlikely(call_slot == NULL)) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"'%s' object is not callable\", called);\n\n        return NULL;\n    }\n\n    if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n        return NULL;\n    }\n\n{% if args_count == 0 %}\n    PyObject *pos_args = const_tuple_empty;\n{% elif not has_tuple_arg or not has_dict_values %}\n    PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% endif %}\n\n    PyObject *named_args = _PyDict_NewPresized(nkwargs);\n\n    for (Py_ssize_t i = 0; i < nkwargs; i++) {\n        PyObject *key = PyTuple_GET_ITEM(kw_names, i);\n\n{% if not has_dict_values %}\n        PyObject *value = args[{{args_count}}+i];\n{% else %}\n        PyObject *value = kw_values[i];\n{% endif %}\n\n        CHECK_OBJECT(key);\n        CHECK_OBJECT(value);\n\n        DICT_SET_ITEM(named_args, key, value);\n    }\n\n    PyObject *result = (*call_slot)(called, pos_args, named_args);\n\n{% if args_count != 0 and not has_tuple_arg %}\n    Py_DECREF(pos_args);\n{% endif %}\n    Py_DECREF(named_args);\n\n    Py_LeaveRecursiveCall();\n\n    CHECK_OBJECT_X(result);\n\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperObjectTools.c.j2' import CHECK_OBJECTS %}\n{% if args_count == 0 %}\nPyObject *CALL_FUNCTION_NO_ARGS(PyThreadState *tstate, PyObject *called) {\n{% elif args_count == 1 and not has_tuple_arg %}\nPyObject *CALL_FUNCTION_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n{% else %}\n{% if has_tuple_arg %}\nPyObject *CALL_FUNCTION_WITH_POSARGS{{args_count}}(PyThreadState *tstate, PyObject *called, PyObject *pos_args) {\n    assert(PyTuple_CheckExact(pos_args));\n    assert(PyTuple_GET_SIZE(pos_args) == {{args_count}});\n    PyObject *const *args = &PyTuple_GET_ITEM(pos_args, 0);\n{% else %}\nPyObject *CALL_FUNCTION_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n{% endif %}\n{% endif %}\n    CHECK_OBJECT(called);\n    {{ CHECK_OBJECTS(args, args_count) }}\n\n    if (Nuitka_Function_Check(called)) {\n        if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n            return NULL;\n        }\n\n        struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)called;\n        PyObject *result;\n\n        if (function->m_args_simple && {{args_count}} == function->m_args_positional_count){\n{% if args_count == 1 %}\n            Py_INCREF(args[0]);\n{% elif args_count > 1 %}\n            for (Py_ssize_t i = 0; i < {{args_count}}; i++) {\n                Py_INCREF(args[i]);\n            }\n{% endif %}\n            result = function->m_c_code(tstate, function, {% if args_count != 0 %} (PyObject **)args {% else %} NULL {% endif %});\n        } else if (function->m_args_simple && {{args_count}} + function->m_defaults_given == function->m_args_positional_count) {\n{% if args_count != 0 %}\n            NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n            memcpy(python_pars, args, {{args_count}} * sizeof(PyObject *));\n            memcpy(python_pars + {{args_count}}, &PyTuple_GET_ITEM(function->m_defaults, 0), function->m_defaults_given * sizeof(PyObject *));\n{% else %}\n            PyObject **python_pars = &PyTuple_GET_ITEM(function->m_defaults, 0);\n{% endif %}\n\n            for (Py_ssize_t i = 0; i < function->m_args_positional_count; i++) {\n                Py_INCREF(python_pars[i]);\n            }\n\n            result = function->m_c_code(tstate, function, python_pars);\n        } else {\n{% if args_count == 0 %}\n            result = Nuitka_CallFunctionNoArgs(tstate, function);\n{% else %}\n            result = Nuitka_CallFunctionPosArgs(tstate, function, args, {{args_count}});\n{% endif %}\n        }\n\n        Py_LeaveRecursiveCall();\n\n        CHECK_OBJECT_X(result);\n\n        return result;\n    } else if (Nuitka_Method_Check(called)) {\n        struct Nuitka_MethodObject *method = (struct Nuitka_MethodObject *)called;\n\n        if (method->m_object == NULL) {\n{% if args_count < 1 %}\n            PyErr_Format(\n                PyExc_TypeError,\n                \"unbound compiled_method %s%s must be called with %s instance as first argument (got nothing instead)\",\n                GET_CALLABLE_NAME((PyObject *)method->m_function), GET_CALLABLE_DESC((PyObject *)method->m_function),\n                GET_CLASS_NAME(method->m_class));\n            return NULL;\n{% else %}\n            PyObject *self = args[0];\n\n            int res = PyObject_IsInstance(self, method->m_class);\n\n            if (unlikely(res < 0)) {\n                return NULL;\n            } else if (unlikely(res == 0)) {\n                PyErr_Format(PyExc_TypeError,\n                             \"unbound compiled_method %s%s must be called with %s instance as first argument (got %s \"\n                             \"instance instead)\",\n                             GET_CALLABLE_NAME((PyObject *)method->m_function),\n                             GET_CALLABLE_DESC((PyObject *)method->m_function), GET_CLASS_NAME(method->m_class),\n                             GET_INSTANCE_CLASS_NAME(tstate, (PyObject *)self));\n\n                return NULL;\n            }\n\n            PyObject *result = Nuitka_CallFunctionPosArgs(tstate, method->m_function, args, {{args_count}});\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n{% endif %}\n        } else {\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n\n            struct Nuitka_FunctionObject *function = method->m_function;\n\n            PyObject *result;\n\n            if (function->m_args_simple && {{args_count}} + 1 == function->m_args_positional_count) {\n                PyObject *python_pars[{{args_count}} + 1];\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n{% if args_count == 1 %}\n                python_pars[1] = args[0];\n                Py_INCREF(args[0]);\n{% elif args_count > 1 %}\n                for (Py_ssize_t i = 0; i < {{args_count}}; i++) {\n                    python_pars[i + 1] = args[i];\n                    Py_INCREF(args[i]);\n                }\n{% endif %}\n                result = function->m_c_code(tstate, function, python_pars);\n            } else if (function->m_args_simple && {{args_count}} + 1 + function->m_defaults_given == function->m_args_positional_count) {\n                NUITKA_DYNAMIC_ARRAY_DECL(python_pars, PyObject *, function->m_args_positional_count);\n\n                python_pars[0] = method->m_object;\n                Py_INCREF(method->m_object);\n\n{% if args_count != 0 %}\n                memcpy(python_pars+1, args, {{args_count}} * sizeof(PyObject *));\n{% endif %}\n                memcpy(python_pars+1 + {{args_count}}, &PyTuple_GET_ITEM(function->m_defaults, 0), function->m_defaults_given * sizeof(PyObject *));\n\n                for (Py_ssize_t i = 1; i < function->m_args_overall_count; i++) {\n                    Py_INCREF(python_pars[i]);\n                }\n\n                result = function->m_c_code(tstate, function, python_pars);\n            } else {\n{% if args_count != 0 %}\n                result = Nuitka_CallMethodFunctionPosArgs(tstate, function, method->m_object, args, {{args_count}});\n{% else %}\n                result = Nuitka_CallMethodFunctionNoArgs(tstate, function, method->m_object);\n{% endif %}\n            }\n\n            Py_LeaveRecursiveCall();\n\n            CHECK_OBJECT_X(result);\n\n            return result;\n        }\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)\n    } else if (PyCFunction_CheckExact(called)) {\n        // Try to be fast about wrapping the arguments.\n        int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n        if ({{ unlikely_or_likely_from(args_count != 0) }}(flags & METH_NOARGS)) {\n{% if args_count == 0 %}\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result = (*method)(self, NULL);\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n{% else %}\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(\n                PyExc_TypeError,\n                \"%s() takes no arguments ({{args_count}} given)\",\n                ((PyCFunctionObject *)called)->m_ml->ml_name\n            );\n            return NULL;\n{% endif %}\n        } else if ({{ unlikely_if(args_count != 1) }}(flags & METH_O)) {\n{% if args_count == 1 %}\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result = (*method)(self, args[0]);\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n{% else %}\n            SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError,\n                \"%s() takes exactly one argument ({{args_count}} given)\",\n                 ((PyCFunctionObject *)called)->m_ml->ml_name\n            );\n            return NULL;\n{% endif %}\n        } else if (flags & METH_VARARGS) {\n            // Recursion guard is not strictly necessary, as we already have\n            // one on our way to here.\n#ifdef _NUITKA_FULL_COMPAT\n            if (unlikely(Py_EnterRecursiveCall((char *)\" while calling a Python object\"))) {\n                return NULL;\n            }\n#endif\n            PyCFunction method = PyCFunction_GET_FUNCTION(called);\n            PyObject *self = PyCFunction_GET_SELF(called);\n\n            PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n{% if not has_tuple_arg and args_count != 0 %}\n            PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% elif not has_tuple_arg %}\n            PyObject *pos_args = const_tuple_empty;\n{% endif %}\n            if (flags & METH_KEYWORDS) {\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            } else {\n                result = (*method)(self, pos_args);\n            }\n\n{% if not has_tuple_arg and args_count != 0 %}\n            Py_DECREF(pos_args);\n{% endif %}\n#else\n            if (flags == (METH_VARARGS|METH_KEYWORDS)) {\n{% if not has_tuple_arg and args_count != 0 %}\n            PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% elif not has_tuple_arg %}\n            PyObject *pos_args = const_tuple_empty;\n{% endif %}\n                result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n{% if not has_tuple_arg and args_count != 0 %}\n            Py_DECREF(pos_args);\n{% endif %}\n            } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n{% if args_count != 0 %}\n                result = (*(_PyCFunctionFast)method)(self, (PyObject **)args, {{args_count}}, NULL);\n{% else %}\n                result = (*(_PyCFunctionFast)method)(self, NULL, 0, NULL);\n{% endif %}\n#else\n{% if not has_tuple_arg and args_count != 0 %}\n            PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% elif not has_tuple_arg %}\n            PyObject *pos_args = const_tuple_empty;\n{% endif %}\n                result = (*(_PyCFunctionFast)method)(self, &pos_args, {{args_count}});\n{% if not has_tuple_arg and args_count != 0 %}\n            Py_DECREF(pos_args);\n{% endif %}\n#endif\n            } else {\n{% if not has_tuple_arg and args_count != 0 %}\n            PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% elif not has_tuple_arg %}\n            PyObject *pos_args = const_tuple_empty;\n{% endif %}\n                result = (*method)(self, pos_args);\n{% if not has_tuple_arg and args_count != 0 %}\n            Py_DECREF(pos_args);\n{% endif %}\n            }\n#endif\n\n#ifdef _NUITKA_FULL_COMPAT\n            Py_LeaveRecursiveCall();\n#endif\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)\n    } else if (PyFunction_Check(called)) {\n#if PYTHON_VERSION < 0x3b0\n{% if args_count == 0 %}\n        PyObject *result = callPythonFunctionNoArgs(called);\n{% else %}\n        PyObject *result = callPythonFunction(\n            called,\n            args,\n            {{args_count}}\n        );\n{% endif %}\n#else\n{% if args_count == 0 %}\n        PyObject *result = _PyFunction_Vectorcall(called, NULL, 0, NULL);\n{% else %}\n        PyObject *result = _PyFunction_Vectorcall(called, args, {{args_count}}, NULL);\n{% endif %}\n#endif\n        CHECK_OBJECT_X(result);\n\n        return result;\n#endif\n#if !defined(_NUITKA_EXPERIMENTAL_DISABLE_TYPE_CREATION_OPT)\n    } else if (PyType_Check(called)) {\n        PyTypeObject *type = Py_TYPE(called);\n\n        if (type->tp_call == PyType_Type.tp_call) {\n            PyTypeObject *called_type = (PyTypeObject *)(called);\n\n{% if args_count == 1 %}\n            {# For single argument, special case \"type\" itself, this is however unlikely,\n               as this ought to be optimized in normal compilation to built-in call. #}\n            if (unlikely(called == (PyObject *)&PyType_Type)) {\n                PyObject *result = (PyObject *)Py_TYPE(args[0]);\n                Py_INCREF(result);\n                return result;\n            }\n{% endif %}\n\n            if (unlikely(called_type->tp_new == NULL)) {\n                PyErr_Format(PyExc_TypeError, \"cannot create '%s' instances\", called_type->tp_name);\n                return NULL;\n            }\n\n{% if not has_tuple_arg and args_count != 0 %}\n            PyObject *pos_args = NULL;\n{% elif not has_tuple_arg %}\n            PyObject *pos_args = const_tuple_empty;\n{% endif %}\n            PyObject *obj;\n\n            if (called_type->tp_new == PyBaseObject_Type.tp_new) {\n                if (unlikely(called_type->tp_flags & Py_TPFLAGS_IS_ABSTRACT)) {\n                    formatCannotInstantiateAbstractClass(tstate, called_type);\n                    return NULL;\n                }\n\n                obj = called_type->tp_alloc(called_type, 0);\n                CHECK_OBJECT(obj);\n            } else {\n{% if not has_tuple_arg and args_count != 0 %}\n                pos_args = MAKE_TUPLE(args, {{args_count}});\n{% endif %}\n                obj = called_type->tp_new(called_type, pos_args, NULL);\n                {# TODO: obj = _Py_CheckFunctionResult(obj) for Python3 in debug mode #}\n            }\n\n            if (likely(obj != NULL)) {\n                if (!Nuitka_Type_IsSubtype(obj->ob_type, called_type)) {\n{% if not has_tuple_arg and args_count != 0 %}\n                    Py_DECREF(pos_args);\n{% endif %}\n                    return obj;\n                }\n\n                // Work on produced type.\n                type = Py_TYPE(obj);\n\n                if (NuitkaType_HasFeatureClass(type) && type->tp_init != NULL) {\n                    if (type->tp_init == default_tp_init_wrapper) {\n{% if not has_tuple_arg and args_count != 0 %}\n                        Py_XDECREF(pos_args);\n                        pos_args = NULL;\n{% endif %}\n\n                        PyObject *init_method = Nuitka_TypeLookup(type, const_str_plain___init__);\n\n                        // Not really allowed, since we wouldn't have the default wrapper set.\n                        assert(init_method != NULL);\n\n                        bool is_compiled_function = false;\n                        bool init_method_needs_release = false;\n\n                        if (likely(init_method != NULL)) {\n                            descrgetfunc func = Py_TYPE(init_method)->tp_descr_get;\n\n                            if (func == Nuitka_Function_Type.tp_descr_get) {\n                                is_compiled_function = true;\n                            } else if (func != NULL) {\n                                init_method = func(init_method, obj, (PyObject *)(type));\n                                init_method_needs_release = true;\n                            }\n                        }\n\n                        if (unlikely(init_method == NULL)) {\n                            if (!HAS_ERROR_OCCURRED(tstate)) {\n                                SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_AttributeError, const_str_plain___init__);\n                            }\n\n                            return NULL;\n                        }\n\n                        PyObject *result;\n{% if args_count == 0 %}\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionNoArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj);\n                        } else {\n                            result = CALL_FUNCTION_NO_ARGS(tstate, init_method);\n\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n{% elif args_count == 1 %}\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 1);\n                        } else {\n                            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n{% else %}\n                        if (is_compiled_function) {\n                            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, {{args_count}});\n                        } else {\n{% if has_tuple_arg %}\n                            result = CALL_FUNCTION_WITH_POSARGS{{args_count}}(tstate, init_method, pos_args);\n{% else %}\n                            result = CALL_FUNCTION_WITH_ARGS{{args_count}}(tstate, init_method, args);\n{% endif %}\n                            if (init_method_needs_release) {\n                                Py_DECREF(init_method);\n                            }\n                        }\n{% endif %}\n\n\n                        if (unlikely(result == NULL)) {\n                            Py_DECREF(obj);\n                            return NULL;\n                        }\n\n                        Py_DECREF(result);\n\n                        if (unlikely(result != Py_None)) {\n                            Py_DECREF(obj);\n\n                            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n                            return NULL;\n                        }\n                    } else {\n{% if not has_tuple_arg and args_count != 0 %}\n                        if (pos_args == NULL) {\n                            pos_args = MAKE_TUPLE(args, {{args_count}});\n                        }\n{% endif %}\n\n                        if (unlikely(type->tp_init(obj, pos_args, NULL) < 0)) {\n                            Py_DECREF(obj);\n{% if not has_tuple_arg and args_count != 0 %}\n                            Py_XDECREF(pos_args);\n{% endif %}\n                            return NULL;\n                        }\n                    }\n                }\n            }\n\n{% if not has_tuple_arg and args_count != 0 %}\n            Py_XDECREF(pos_args);\n{% endif %}\n\n            CHECK_OBJECT_X(obj);\n\n            return obj;\n        }\n#endif\n#if PYTHON_VERSION < 0x300\n    } else if (PyClass_Check(called)) {\n        PyObject *obj = PyInstance_NewRaw(called, NULL);\n\n        PyObject *init_method = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)called, const_str_plain___init__);\n\n        if ({{ unlikely_if(args_count != 0)}}(init_method == NULL)) {\n            if (unlikely(HAS_ERROR_OCCURRED(tstate))) {\n                Py_DECREF(obj);\n                return NULL;\n            }\n\n{% if args_count == 0 %}\n            return obj;\n{% else %}\n            Py_DECREF(obj);\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, \"this constructor takes no arguments\");\n            return NULL;\n{% endif %}\n        }\n\n        bool is_compiled_function = false;\n\n        descrgetfunc descr_get = Py_TYPE(init_method)->tp_descr_get;\n\n        if (descr_get == NULL) {\n            Py_INCREF(init_method);\n        } else if (descr_get == Nuitka_Function_Type.tp_descr_get) {\n            is_compiled_function = true;\n        } else if (descr_get != NULL) {\n            PyObject *descr_method = descr_get(init_method, obj, called);\n\n            if (unlikely(descr_method == NULL)) {\n                return NULL;\n            }\n\n            init_method = descr_method;\n        }\n\n        PyObject *result;\n{% if args_count == 0 %}\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionNoArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj);\n        } else {\n            result = CALL_FUNCTION_NO_ARGS(tstate, init_method);\n            Py_DECREF(init_method);\n        }\n{% elif args_count == 1 %}\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, 1);\n        } else {\n            result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, init_method, args[0]);\n            Py_DECREF(init_method);\n        }\n{% else %}\n        if (is_compiled_function) {\n            result = Nuitka_CallMethodFunctionPosArgs(tstate, (struct Nuitka_FunctionObject const *)init_method, obj, args, {{args_count}});\n        } else {\n{% if has_tuple_arg %}\n            result = CALL_FUNCTION_WITH_POSARGS{{args_count}}(tstate, init_method, pos_args);\n{% else %}\n            result = CALL_FUNCTION_WITH_ARGS{{args_count}}(tstate, init_method, args);\n{% endif %}\n            Py_DECREF(init_method);\n        }\n{% endif %}\n        if (unlikely(result == NULL)) {\n            return NULL;\n        }\n\n        Py_DECREF(result);\n\n        if (unlikely(result != Py_None)) {\n            SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"__init__() should return None, not '%s'\", result);\n            return NULL;\n        }\n\n        CHECK_OBJECT_X(obj);\n\n        return obj;\n#endif\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    } else if (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL)) {\n        vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n\n        if (likely(func != NULL)) {\n{% if args_count == 0 %}\n            PyObject *result = func(called, NULL, 0, NULL);\n{% else %}\n            PyObject *result = func(called, args, {{args_count}}, NULL);\n{% endif %}\n\n            CHECK_OBJECT_X(result);\n\n            return Nuitka_CheckFunctionResult(tstate, called, result);\n        }\n#endif\n    }\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n{% if args_count == 0 %}\n    PyObject *result = CALL_FUNCTION(tstate, called, const_tuple_empty, NULL);\n{% else %}\n{% if not has_tuple_arg %}\n    PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n{% endif %}\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n{% if not has_tuple_arg %}\n    Py_DECREF(pos_args);\n{% endif %}\n{% endif %}\n\n    CHECK_OBJECT_X(result);\n\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperObjectTools.c.j2' import CHECK_OBJECTS %}\n{% if args_count == 1 %}\nPyObject *CALL_METHODDESCR_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *called, PyObject *arg) {\n    PyObject *const *args = &arg; // For easier code compatibility.\n{% else %}\nPyObject *CALL_METHODDESCR_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObject *called, PyObject *const *args) {\n{% endif %}\n    CHECK_OBJECT(called);\n    {{ CHECK_OBJECTS(args, args_count) }}\n\n#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_USAGE)\n    assert (PyType_HasFeature(Py_TYPE(called), _Py_TPFLAGS_HAVE_VECTORCALL));\n    vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));\n    assert(func != NULL);\n{% if args_count == 0 %}\n    PyObject *result = func(called, NULL, 0, NULL);\n{% else %}\n    PyObject *result = func(called, args, {{args_count}}, NULL);\n{% endif %}\n\n#ifndef __NUITKA_NO_ASSERT__\n    return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n    return result;\n#endif\n#else\n    PyMethodDescrObject *called_descr = (PyMethodDescrObject *)called;\n    PyMethodDef *method_def = called_descr->d_method;\n\n    // Try to be fast about wrapping the arguments.\n    int flags = method_def->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);\n\n    if ({{ unlikely_or_likely_from(args_count != 1) }}(flags & METH_NOARGS)) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, NULL);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    } else if ({{ unlikely_if(args_count != 1) }}(flags & METH_O)) {\n{% if args_count == 2 %}\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result = (*method)(self, args[1]);\n\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n{% else %}\n        SET_CURRENT_EXCEPTION_TYPE0_FORMAT1(PyExc_TypeError,\n            \"%s() takes exactly one argument ({{args_count}} given)\",\n                method_def->ml_name\n        );\n        return NULL;\n{% endif %}\n    } else if (flags & METH_VARARGS) {\n        PyCFunction method = method_def->ml_meth;\n        PyObject *self = args[0];\n\n        PyObject *result;\n\n#if PYTHON_VERSION < 0x360\n        PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});\n\n        if (flags & METH_KEYWORDS) {\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n        } else {\n            result = (*method)(self, pos_args);\n        }\n\n        Py_DECREF(pos_args);\n#else\n        if (flags == (METH_VARARGS|METH_KEYWORDS)) {\n            PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});\n            result = (*(PyCFunctionWithKeywords)method)(self, pos_args, NULL);\n            Py_DECREF(pos_args);\n        } else if (flags == METH_FASTCALL) {\n#if PYTHON_VERSION < 0x370\n            result = (*(_PyCFunctionFast)method)(self, (PyObject **)args+1, {{args_count-1}}, NULL);\n#else\n            PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});\n            result = (*(_PyCFunctionFast)method)(self, &pos_args, {{args_count}});\n            Py_DECREF(pos_args);\n#endif\n        } else {\n            PyObject *pos_args = MAKE_TUPLE(args+1, {{args_count-1}});\n            result = (*method)(self, pos_args);\n            Py_DECREF(pos_args);\n        }\n#endif\n#ifndef __NUITKA_NO_ASSERT__\n        return Nuitka_CheckFunctionResult(tstate, called, result);\n#else\n        return result;\n#endif\n    }\n\n\n#if 0\n    PRINT_NEW_LINE();\n    PRINT_STRING(\"FALLBACK\");\n    PRINT_ITEM(called);\n    PRINT_NEW_LINE();\n#endif\n\n{# TODO: How come the PyCFunction call does not cover all cases, that should\n   be doable. #}\n\n{% if args_count == 0 %}\n    PyObject *result = CALL_FUNCTION(tstate, called, const_tuple_empty, NULL);\n{% else %}\n    PyObject *pos_args = MAKE_TUPLE(args, {{args_count}});\n\n    PyObject *result = CALL_FUNCTION(tstate, called, pos_args, NULL);\n\n    Py_DECREF(pos_args);\n{% endif %}\n\n    return result;\n#endif\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nPyObject *MAKE_LIST{{args_count}}(PyObject *list) {\n    CHECK_OBJECT(list);\n    assert(PyList_CheckExact(list));\n    assert(PyList_GET_SIZE(list) == {{args_count}});\n\n    PyObject *result = MAKE_LIST_EMPTY({{args_count}});\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n{% for i in range(args_count) %}\n    {\n        PyObject *item = PyList_GET_ITEM(list, {{i}});\n        Py_INCREF(item);\n        PyList_SET_ITEM(result, {{i}}, item);\n    }\n{% endfor %}\n\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nPyObject *MAKE_LIST{{args_count}}(\n{% for i in range(args_count) %}\n{% if i != 0 %}\n    ,\n{% endif %}\n    PyObject *arg{{i}}\n{% endfor %}\n) {\n\n    PyObject *result = MAKE_LIST_EMPTY({{args_count}});\n\n    if (unlikely(result == NULL)) {\n        return NULL;\n    }\n\n{% for i in range(args_count) %}\n    CHECK_OBJECT(arg{{i}});\n    Py_INCREF(arg{{i}});\n    PyList_SET_ITEM(result, {{i}}, arg{{i}});\n\n{% endfor %}\n\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nPyObject *{{builtin_type.type_name.upper()}}_{{method_name.upper()}}{{api_suffix}}(PyThreadState *tstate, {{builtin_type.getVariableDecl(builtin_arg_name)}} {{formatArgumentDeclaration(arg_types, arg_names, starting=False)}}) {\n    {{builtin_type.getCheckValueCode(builtin_arg_name)}}\n\n{% for arg_type, arg_name in zip(arg_types, arg_names) %}\n{# Specific hack for hard to default value. #}\n{% if method_name == \"decode\" and builtin_type.type_name == \"str\" and arg_name == \"encoding\" and len(arg_names) == 2 %}\n    if (encoding == NULL) {\n        encoding = PyString_FromString(PyUnicode_GetDefaultEncoding());\n    } else {\n        Py_INCREF(encoding);\n    }\n{% else %}\n    {{arg_type.getCheckValueCode(arg_name)}}\n{% endif %}\n{% endfor %}\n\n    PyObject *called = {{builtin_type.type_name}}_builtin_{{method_name}};\n    CHECK_OBJECT(called);\n\n{% if len(arg_names) > 0 %}\n    PyObject *args[{{len(arg_names)+1}}] = { {{builtin_arg_name}}, {{\",\".join(arg_names)}} };\n    PyObject *result = CALL_METHODDESCR_WITH_ARGS{{len(arg_names)+1}}(tstate, called, args);\n{% else %}\n    PyObject *result = CALL_METHODDESCR_WITH_SINGLE_ARG(tstate, called, {{builtin_arg_name}});\n{% endif %}\n\n{% if method_name == \"decode\" and builtin_type.type_name == \"str\" and len(arg_names) == 2 %}\n    Py_DECREF(encoding);\n{% endif %}\n\n    CHECK_OBJECT_X(result);\n{% if extra_check %}\n    assert(result == NULL || {{extra_check}}(result));\n{% endif %}\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro dict_copy_iteration(result, dict_value, per_key_code, per_value_code, value_ref) %}\nCHECK_OBJECT({{dict_value}});\nassert(PyDict_CheckExact({{dict_value}}));\n\nif (((PyDictObject *){{dict_value}})->ma_used == 0) {\n    {{ result }} = MAKE_DICT_EMPTY();\n}\nelse\n{\n    PyDictObject *dict_mp = (PyDictObject *){{dict_value}};\n\n#if PYTHON_VERSION < 0x300\n    // For Python3, this can be done much faster in the same way as it is\n    // done in parameter parsing.\n    {{ result }} = _PyDict_NewPresized(dict_mp->ma_used);\n\n    for (Py_ssize_t i = 0; i <= dict_mp->ma_mask; i++) {\n        PyDictEntry *entry = &dict_mp->ma_table[i];\n\n        if (entry->me_value != NULL) {\n            PyObject *key = entry->me_key;\n            {{ per_key_code }}\n\n            PyObject *value = entry->me_value;\n            {{ per_value_code }}\n\n            NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem({{ result }}, key, value);\n            assert(res == 0);\n\n{% if value_ref == 1 %}\n            Py_DECREF(value);\n{% endif %}\n        }\n    }\n#else\n    /* Python 3 */\n#ifndef PY_NOGIL\n    if (_PyDict_HasSplitTable(dict_mp)) {\n        PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n        assert(result_mp != NULL);\n        {{ result }} = (PyObject *)result_mp;\n\n        Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n{% if per_key_code %}\n#if PYTHON_VERSION < 0x3b0\n        for (Py_ssize_t i = 0; i < size; i++) {\n            PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n\n            if (entry->me_value != NULL) {\n                PyObject *key = entry->me_key;\n                {{ per_key_code }}\n            }\n#else\n        Py_ssize_t pos = 0;\n        PyObject *key, *_value;\n\n        while(Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &_value)) {\n            CHECK_OBJECT(key);\n            CHECK_OBJECT(_value);\n\n            {{ per_key_code }}\n#endif\n        }\n{% endif %}\n\n        PyDictValues *new_values = _Nuitka_PyDict_new_values(size);\n        assert(new_values != NULL);\n\n#if PYTHON_VERSION >= 0x3b0\n        // Need to preserve values prefix.\n        size_t prefix_size = ((uint8_t *)new_values)[-1];\n        memcpy(((char *)new_values)-prefix_size, ((char *)dict_mp->ma_values)-prefix_size, prefix_size-1);\n#endif\n\n        result_mp->ma_values = new_values;\n        result_mp->ma_keys = dict_mp->ma_keys;\n        result_mp->ma_used = dict_mp->ma_used;\n\n        // This is a manual reference count for the keys.\n#ifdef Py_REF_DEBUG\n        _Py_RefTotal++;\n#endif\n        dict_mp->ma_keys->dk_refcnt += 1;\n\n        for (Py_ssize_t i = 0; i < size; i++) {\n            if (DK_VALUE(dict_mp, i)) {\n                PyObject *value = DK_VALUE(dict_mp, i);\n{{per_value_code}}\n\n                DK_VALUE(result_mp, i) = value;\n{% if value_ref == 0 %}\n                Py_INCREF(value);\n{% endif %}\n\n            } else {\n                DK_VALUE(result_mp, i) = NULL;\n            }\n        }\n\n        Nuitka_GC_Track(result_mp);\n    } else\n#endif\n    {# TODO: This should be working for before 3.6 as well, but posed riddles with\n      crashes at release time. Need to check if the keys allocator is different\n      in some API somehow, or non-split dictionaries which didn't exist then are\n      to be handled differently. #}\n#if PYTHON_VERSION >= 0x360\n    // Fast dictionary copy if it has at least 2/3 space usage. This is most relevant\n    // for the DICT_COPY, where it might even be the intention to trigger a shrink with\n    // a fresh copy.\n    if (dict_mp->ma_values == NULL && IS_COMPACT(dict_mp)) {\n        assert(dict_mp->ma_values == NULL);\n        assert(dict_mp->ma_keys->dk_refcnt == 1);\n\n        PyDictObject *result_mp = _Nuitka_AllocatePyDictObject();\n        {{ result }} = (PyObject *)result_mp;\n\n        result_mp->ma_values = NULL;\n        result_mp->ma_used = dict_mp->ma_used;\n\n        Py_ssize_t keys_size = _Nuitka_Py_PyDict_KeysSize(dict_mp->ma_keys);\n        result_mp->ma_keys = (PyDictKeysObject *)PyObject_MALLOC(keys_size);\n        assert(result_mp->ma_keys);\n\n        memcpy(result_mp->ma_keys, dict_mp->ma_keys, keys_size);\n\n        // Take reference of all keys and values.\n#if PYTHON_VERSION < 0x3b0\n        PyDictKeyEntry *entries = DK_ENTRIES(result_mp->ma_keys);\n        Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n        for (Py_ssize_t i = 0; i < size; i++) {\n            PyDictKeyEntry *entry = &entries[i];\n            PyObject *value = entry->me_value;\n\n            if (value != NULL) {\n                PyObject *key = entry->me_key;\n                {{ per_key_code }}\n                Py_INCREF(key);\n\n                {{ per_value_code }}\n\n{% if value_ref == 0 %}\n                Py_INCREF(value);\n{% endif %}\n{% if per_value_code %}\n                entry->me_value = value;\n{% endif %}\n            }\n        }\n#else\n        PyObject **key_ptr, **value_ptr;\n        size_t entry_size;\n\n        {# Different for unicode or not. #}\n        bool is_unicode = DK_IS_UNICODE(result_mp->ma_keys);\n\n        if (is_unicode) {\n            PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(result_mp->ma_keys);\n\n            key_ptr = &ep0->me_key;\n            value_ptr = &ep0->me_value;\n            entry_size = sizeof(PyDictUnicodeEntry) / sizeof(PyObject*);\n        } else {\n            PyDictKeyEntry *ep0 = DK_ENTRIES(result_mp->ma_keys);\n\n            key_ptr = &ep0->me_key;\n            value_ptr = &ep0->me_value;\n            entry_size = sizeof(PyDictKeyEntry) / sizeof(PyObject*);\n        }\n\n        Py_ssize_t size = DK_ENTRIES_SIZE(result_mp->ma_keys);\n\n        for (Py_ssize_t i = 0; i < size; i++) {\n            PyObject *value = *value_ptr;\n\n            if (value != NULL) {\n                {{ per_value_code }}\n{% if value_ref == 0 %}\n                Py_INCREF(value);\n{% else %}\n                *value_ptr = value;\n{% endif %}\n                PyObject *key = *key_ptr;\n{% if per_key_code %}\n                if (is_unicode == false) {\n                    {{ per_key_code }}\n                }\n{% endif %}\n                Py_INCREF(key);\n            }\n\n            value_ptr += entry_size;\n            key_ptr += entry_size;\n        }\n#endif\n\n    // The new keys are an object counted.\n#ifdef Py_REF_DEBUG\n        _Py_RefTotal++;\n#endif\n\n        Nuitka_GC_Track(result_mp);\n    } else\n#endif\n    {\n        {{ result }} = _PyDict_NewPresized(dict_mp->ma_used);\n\n#if PYTHON_VERSION < 0x3b0\n        Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);\n\n        for (Py_ssize_t i = 0; i < size; i++) {\n            PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];\n            PyObject *value = entry->me_value;\n\n            if (value != NULL) {\n                PyObject *key = entry->me_key;\n                CHECK_OBJECT(key);\n\n                {{ per_key_code }}\n\n                CHECK_OBJECT(value);\n\n                {{ per_value_code }}\n\n                NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem({{ result }}, key, value);\n                assert(res == 0);\n\n{% if value_ref == 1 %}\n                Py_DECREF(value);\n{% endif %}\n            }\n        }\n#else\n        Py_ssize_t pos = 0;\n        PyObject *key, *value;\n\n        while(Nuitka_DictNext((PyObject *)dict_mp, &pos, &key, &value)) {\n            CHECK_OBJECT(key);\n            CHECK_OBJECT(value);\n\n            {{ per_key_code }}\n\n            CHECK_OBJECT(value);\n\n            {{ per_value_code }}\n\n            NUITKA_MAY_BE_UNUSED int res = PyDict_SetItem({{ result }}, key, value);\n            assert(res == 0);\n\n{% if value_ref == 1 %}\n            Py_DECREF(value);\n{% endif %}\n        }\n#endif\n    }\n#endif\n}\n{% endmacro %}\n\n// Usable fraction of keys.\n#define DK_USABLE_FRACTION(n) (((n) << 1) / 3)\n\n#if PYTHON_VERSION < 0x3b0\ntypedef PyObject * PyDictValues;\n#endif\n\n#if PYTHON_VERSION < 0x360\n#define DK_ENTRIES_SIZE(keys) (keys->dk_size)\n#elif PYTHON_VERSION < 0x3b0\n#define DK_ENTRIES_SIZE(keys) DK_USABLE_FRACTION(DK_SIZE(keys))\n#else\n#define DK_ENTRIES_SIZE(keys) (keys->dk_nentries)\n#endif\n\n// More than 2/3 of the keys are used, i.e. no space is wasted.\n#if PYTHON_VERSION < 0x360\n#define IS_COMPACT(dict_mp) (dict_mp->ma_used >= (dict_mp->ma_keys->dk_size * 2) / 3)\n#else\n#define IS_COMPACT(dict_mp) (dict_mp->ma_used >= (dict_mp->ma_keys->dk_nentries * 2) / 3)\n#endif\n\n\nstatic inline PyDictValues *_Nuitka_PyDict_new_values(Py_ssize_t size) {\n    Py_ssize_t values_size = sizeof(PyObject *) * size;\n\n#if PYTHON_VERSION < 0x3b0\n    return (PyDictValues *)PyMem_MALLOC(values_size);\n#else\n    // With Python3.11 or higher a prefix is allocated too.\n    size_t prefix_size = _Py_SIZE_ROUND_UP(size + 2, sizeof(PyObject *));\n    size_t n = prefix_size + values_size;\n    uint8_t *mem = (uint8_t *)PyMem_MALLOC(n);\n\n    assert(mem != NULL);\n\n    assert(prefix_size % sizeof(PyObject *) == 0);\n    mem[prefix_size - 1] = (uint8_t)prefix_size;\n\n    return (PyDictValues *)(mem + prefix_size);\n#endif\n}\n\n#if NUITKA_DICT_HAS_FREELIST\nstatic struct _Py_dict_state *_Nuitka_Py_get_dict_state(void) {\n    PyInterpreterState *interp = _PyInterpreterState_GET();\n    return &interp->dict_state;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x300\nstatic PyDictObject *_Nuitka_AllocatePyDictObject(void) {\n    PyDictObject *result_mp;\n\n#if NUITKA_DICT_HAS_FREELIST\n    struct _Py_dict_state *state = _Nuitka_Py_get_dict_state();\n\n    if (state->numfree) {\n        result_mp = state->free_list[--state->numfree];\n\n        Nuitka_Py_NewReference((PyObject *)result_mp);\n\n        assert(PyDict_CheckExact((PyObject *)result_mp));\n        assert(result_mp != NULL);\n    } else\n#endif\n    {\n        result_mp = (PyDictObject *)Nuitka_GC_New(&PyDict_Type);\n    }\n\n    return result_mp;\n}\n#endif\n\n#if PYTHON_VERSION >= 0x360 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT)\nstatic Py_ssize_t _Nuitka_Py_PyDict_KeysSize(PyDictKeysObject *keys) {\n#if PYTHON_VERSION < 0x360\n    return sizeof(PyDictKeysObject) + (DK_SIZE(keys)-1) * sizeof(PyDictKeyEntry);\n#elif PYTHON_VERSION < 0x370\n    return (sizeof(PyDictKeysObject) -\n            Py_MEMBER_SIZE(PyDictKeysObject, dk_indices) +\n            DK_IXSIZE(keys) * DK_SIZE(keys) +\n            DK_USABLE_FRACTION(DK_SIZE(keys)) * sizeof(PyDictKeyEntry));\n#elif PYTHON_VERSION < 0x3b0\n    return (sizeof(PyDictKeysObject) + DK_IXSIZE(keys) * DK_SIZE(keys) +\n            DK_USABLE_FRACTION(DK_SIZE(keys)) * sizeof(PyDictKeyEntry));\n#else\n    size_t entry_size = keys->dk_kind == DICT_KEYS_GENERAL\n        ?  sizeof(PyDictKeyEntry) : sizeof(PyDictUnicodeEntry);\n    return (sizeof(PyDictKeysObject)\n            + ((size_t)1 << keys->dk_log2_index_bytes)\n            + DK_USABLE_FRACTION(DK_SIZE(keys)) * entry_size);\n#endif\n}\n#endif\n\nPyObject *DICT_COPY(PyObject *dict_value) {\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    return PyDict_Copy(dict_value);\n#else\n    PyObject *result;\n\n    {{ dict_copy_iteration(\"result\", \"dict_value\", \"\", \"\", 0) }}\n\n    return result;\n#endif\n}\n\nPyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value) {\n    PyObject *result;\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    result = DICT_COPY(dict_value);\n\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(dict_value, &pos, &key, &value)) {\n        PyObject *dict_value_copy = DEEP_COPY(tstate, value);\n\n        if (dict_value_copy != value) {\n            DICT_SET_ITEM(result, key, value);\n        }\n    }\n#else\n    {{ dict_copy_iteration(\"result\", \"dict_value\", \"\", \"value = DEEP_COPY(tstate, value);\", 1) }}\n#endif\n\n    return result;\n}\n\n// Helper for function calls with star dict arguments. */\nstatic PyObject *COPY_DICT_KW(PyObject *dict_value) {\n    PyObject *result;\n    bool had_kw_error = false;\n\n#if _NUITKA_EXPERIMENTAL_DISABLE_DICT_OPT\n    CHECK_OBJECT(dict_value);\n    assert(PyDict_CheckExact(dict_value));\n\n    result = DICT_COPY(dict_value);\n\n    Py_ssize_t pos = 0;\n    PyObject *key, *value;\n\n    while (Nuitka_DictNext(dict_value, &pos, &key, &value)) {\n        if (unlikely(!checkKeywordType(key))) {\n            had_kw_error = true;\n        }\n    }\n#else\n    {{ dict_copy_iteration(\"result\", \"dict_value\", \"if (unlikely(!checkKeywordType(key))) { had_kw_error = true; }\", \"\", 0) }}\n#endif\n\n    if (unlikely(had_kw_error)) {\n        Py_DECREF(result);\n        return NULL;\n    }\n\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperImportHard.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{{target.getTypeDecl()}} {{module_code_name}}(void) {\n    static PyObject *module_{{module_code_name.lower()}} = NULL;\n\n    if (module_{{module_code_name.lower()}} == NULL) {\n        module_{{module_code_name.lower()}} = PyImport_ImportModule(\"{{module_name}}\");\n\n        if (unlikely(module_{{module_code_name.lower()}} == NULL)) {\n{% if is_stdlib %}\n#ifndef __NUITKA_NO_ASSERT__\n            PyErr_PrintEx(0);\n#endif\n            NUITKA_CANNOT_GET_HERE(\"failed hard import of '{{module_name}}'\");\n            abort();\n{% else %}\n            return NULL;\n{% endif %}\n        }\n    }\n\n    return module_{{module_code_name.lower()}};\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperLongTools.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro declare_long_access(type_desc, operand) %}\n{% if type_desc == long_desc %}\n    PyLongObject *{{operand.lstrip(\"*\")}}_long_object = (PyLongObject *){{operand}};\n{% elif type_desc == c_long_desc %}\n    bool {{operand}}_is_negative;\n    unsigned long {{operand}}_abs_ival;\n\n    if ({{operand}} < 0) {\n        {{operand}}_abs_ival = (unsigned long)(-1-{{operand}}) + 1;\n        {{operand}}_is_negative = true;\n    } else {\n        {{operand}}_abs_ival = (unsigned long){{operand}};\n        {{operand}}_is_negative = false;\n    }\n\n    Py_ssize_t {{operand}}_digit_count = 0;\n    digit {{operand}}_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)\n    {\n        unsigned long t = {{operand}}_abs_ival;\n\n        while (t != 0) {\n            {{operand}}_digit_count += 1;\n            assert({{operand}}_digit_count <= (Py_ssize_t)(sizeof({{operand}}_digit_count) / sizeof(digit)));\n\n            {{operand}}_digits[{{operand}}_digit_count] = (digit)(t & PyLong_MASK);\n            t >>= PyLong_SHIFT;\n        }\n    }\n\n    Py_ssize_t {{operand}}_size = {{operand}}_is_negative == false ? {{operand}}_digit_count : -{{operand}}_digit_count;\n{% elif type_desc == c_digit_desc %}\n{# Nothing to do really, banking on C compiler to optimize repeated operations. #}\n{% else %}\n# error \"Not done for {{type_desc}} yet\"\n{% endif %}\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperObjectTools.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro CHECK_OBJECTS(args, args_count) %}\n{% if args_count != 0 %} CHECK_OBJECTS(args, {{args_count}}); {% endif %}\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationBinary.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n{% from 'HelperSlotsInt.c.j2' import int_slot with context %}\n{% from 'HelperSlotsBinary.c.j2' import binary_operation, call_binary_slot with context %}\n{% macro binary_fallback_operation(props, target, left, right, type1, type2) %}\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    {% set props = {\"exits\": {}} %}\n    {{ binary_operation(props, operator, nb_slot, left, right, \"type1\", \"type2\", \"operand1\", \"operand2\", \"exit_binary_result_object\", \"exit_binary_result_cbool_ok\", \"exit_binary_result_nbool\", \"exit_binary_exception\") }}\n\n{% if \"exit_binary_result_object\" in props[\"exits\"] %}\nexit_binary_result_object:\n    {{ target.getReturnFromObjectExpressionCode(\"obj_result\") }}\n{% endif %}\n\n{% if \"exit_binary_result_cbool_ok\" in props[\"exits\"] %}\nexit_binary_result_cbool_ok:\n    return cbool_result;\n{% endif %}\n\n{% if \"exit_binary_exception\" in props[\"exits\"] %}\n{% if \"all\" not in props[\"exits\"][\"exit_binary_exception\"] %}\n#if PYTHON_VERSION < 0x300\n{% endif %}\nexit_binary_exception:\n    return {{target.getExceptionResultIndicatorValue()}};\n{% if \"all\" not in props[\"exits\"][\"exit_binary_exception\"] %}\n#endif\n{% endif %}\n{% endif %}\n{% endmacro %}\n{% if not left.hasTypeSpecializationCode(right, nb_slot, sq_slot) and left.getSameTypeType(right).hasSameTypeOperationSpecializationCode(right.getSameTypeType(left), nb_slot, sq_slot) %}\nstatic HEDLEY_NEVER_INLINE {{target.getTypeDecl()}} __BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n{% set props = {\"exits\": {}} %}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    {{ binary_fallback_operation(props, target, left, right, \"type1\", \"type2\") }}\n}\n{% endif %}\nstatic {{target.getTypeDecl()}} _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{ left.getCheckValueCode(\"operand1\") }}\n    {{ right.getCheckValueCode(\"operand2\") }}\n\n{% if left.type_name == \"object\" and right.type_name == \"object\" %}\n    {# CPython2 treats integer values with fast path. #}\n#if PYTHON_VERSION < 0x300\n    if ({{ left.getIntCheckExpression(\"operand1\") }} && {{ right.getIntCheckExpression(\"operand2\") }}) {\n        {{target.getTypeDecl()}} result;\n\n        {% set props = {\"exits\": {}} %}\n        {{ int_slot(props, operator, nb_slot, target, int_desc, int_desc, \"result\", \"operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n        exit_result_ok:\n        return result;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n        exit_result_exception:\n        return {{target.getExceptionResultIndicatorValue()}};\n{% endif %}\n    }\n#endif\n{% endif %}\n\n{% if left.hasTypeSpecializationCode(right, nb_slot, sq_slot) %}\n    {% set props = {\"exits\": {}} %}\n    {{ target.getTypeDecl() }} result;\n\n    {{ call_binary_slot(props, operator, nb_slot, None, left, right, \"result\", \"operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n    exit_result_ok:\n    return result;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n    exit_result_exception:\n    return {{target.getExceptionResultIndicatorValue()}};\n{% endif %}\n{% elif left.getSameTypeType(right).hasSameTypeOperationSpecializationCode(right.getSameTypeType(left), nb_slot, sq_slot) %}\n{% set props = {\"exits\": {}} %}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    if ({{ left.getTypeIdenticalCheckExpression(right, \"type1\", \"type2\") }}) {\n        {{target.getTypeDecl()}} result;\n\n        {# There is special code for same types. #}\n        // return _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getSameTypeType(right).getHelperCodeName()}}_{{right.getSameTypeType(left).getHelperCodeName()}}(operand1, operand2);\n\n        {{ call_binary_slot(props, operator, nb_slot, nb_slot, left.getSameTypeType(right), right.getSameTypeType(left), \"result\", \"operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n        exit_result_ok:\n        return result;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n        exit_result_exception:\n        return {{target.getExceptionResultIndicatorValue()}};\n{% endif %}\n    }\n\n    return __BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}(operand1, operand2);\n{% else %}\n{% set props = {\"exits\": {}} %}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    {{ binary_fallback_operation(props, target, left, right, \"type1\", \"type2\") }}\n{% endif %}\n}\n\n{{target.getTypeDecl()}} BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    return _BINARY_OPERATION_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}(operand1, operand2);\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparison.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro comparison_fallback(op_code, target, left, right, type1, type2, operand1, operand2) %}\n{# For non-identical types, or for \"OBJECT_OBJECT\", do the full work. #}\n{% if left != right or left.type_name == \"object\" %}\n{# CPython2 treats integer values with fast path. #}\n{% if left.type_name == \"object\" == right.type_name %}\n#if PYTHON_VERSION < 0x300\n    if ({{left.getIntCheckExpression(\"operand1\")}} && {{right.getIntCheckExpression(\"operand2\")}}) {\n        {{int_desc.getTypeComparisonSpecializationCode(int_desc, op_code, target, \"operand1\", \"operand2\")}}\n    }\n#endif\n{% endif %}\n\n{% if op_code in (\"EQ\", \"GE\", \"LE\", \"NE\") and left.type_name == \"object\" and right.type_name == \"object\" %}\n    // Quick path for avoidable checks, compatible with CPython.\n    if (operand1 == operand2 && {{left.getMostSpecificType(right).getSaneTypeCheckCode(\"operand1\")}}) {\n        bool r = {% if op_code == \"NE\" %} false {% else %} true {%endif %};\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n{% endif %}\n\n#if PYTHON_VERSION < 0x300\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in cmp\"))) {\n        return {{target.getExceptionResultIndicatorValue()}};\n    }\n#else\n    if (unlikely(Py_EnterRecursiveCall((char *)\" in comparison\"))) {\n        return {{target.getExceptionResultIndicatorValue()}};\n    }\n#endif\n\n{# TODO: Make these optional too #}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n#if PYTHON_VERSION < 0x300\n    // If the types are equal, we may get away immediately except for instances.\n    if ({{left.getTypeIdenticalCheckExpression(right, \"type1\", \"type2\")}}\n          && !{{left.getMostSpecificType(right).getInstanceCheckCode(\"operand1\")}}\n          ) {\n\n{% if left.getMostSpecificType(right) == left %}\n        richcmpfunc frich = {{left.getSlotValueExpression(\"type1\", \"tp_richcompare\")}};\n{% else %}\n        richcmpfunc frich = {{right.getSlotValueExpression(\"type2\", \"tp_richcompare\")}};\n{% endif %}\n\n        if (frich != NULL) {\n            PyObject *result = (*frich)(operand1, operand2, Py_{{op_code}});\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n            }\n\n            Py_DECREF(result);\n        }\n\n        // No rich comparison worked, but maybe compare works.\n{% if left.getMostSpecificType(right) == left %}\n        cmpfunc fcmp = {{left.getSlotValueExpression(\"type1\", \"tp_compare\")}};\n{% else %}\n        cmpfunc fcmp = {{right.getSlotValueExpression(\"type2\", \"tp_compare\")}};\n{% endif %}\n\n        if (fcmp != NULL) {\n            int c = (*fcmp)(operand1, operand2);\n            c = adjust_tp_compare(c);\n\n            Py_LeaveRecursiveCall();\n\n            if (c == -2) {\n                return {{target.getExceptionResultIndicatorValue()}};\n            }\n\n            switch(Py_{{op_code}}) {\n            case Py_LT:\n                c = c < 0;\n                break;\n            case Py_LE:\n                c = c <= 0;\n                break;\n            case Py_EQ:\n                c = c == 0;\n                break;\n            case Py_NE:\n                c = c != 0;\n                break;\n            case Py_GT:\n                c = c > 0;\n                break;\n            case Py_GE:\n                c = c >= 0;\n                break;\n            default:\n                NUITKA_CANNOT_GET_HERE(\"wrong op_code\");\n            }\n\n            bool r = c != 0;\n            {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n            {{target.getTakeReferenceStatement(\"result\")}}\n            return result;\n        }\n    }\n\n    // Fast path was not successful or not taken\n    richcmpfunc f;\n\n    if ({{left.getTypeNonIdenticalCheckExpression(right, \"type1\", \"type2\")}} && {{left.getRealSubTypeCheckCode(right, \"type2\", \"type1\")}}) {\n        f = {{right.getSlotValueExpression(\"type2\", \"tp_richcompare\")}};\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_{{reversed_args_op_code}});\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = {{left.getSlotValueExpression(\"type1\", \"tp_richcompare\")}};\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_{{op_code}});\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n        }\n\n        Py_DECREF(result);\n    }\n\n    f = {{right.getSlotValueExpression(\"type2\", \"tp_richcompare\")}};\n    if (f != NULL) {\n        PyObject *result = (*f)(operand2, operand1, Py_{{reversed_args_op_code}});\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n        }\n\n        Py_DECREF(result);\n    }\n\n    int c;\n\n    if ({{left.getInstanceCheckCode(\"operand1\")}}) {\n        cmpfunc fcmp = {{left.getSlotValueExpression(\"type1\", \"tp_compare\")}};\n        c = (*fcmp)(operand1, operand2);\n    } else if ({{right.getInstanceCheckCode(\"operand2\")}}) {\n        cmpfunc fcmp = {{right.getSlotValueExpression(\"type2\", \"tp_compare\")}};\n        c = (*fcmp)(operand1, operand2);\n    } else {\n        c = try_3way_compare(operand1, operand2);\n    }\n\n    if (c >= 2) {\n        if ({{left.getTypeIdenticalCheckExpression(right, \"type1\", \"type2\")}}) {\n            Py_uintptr_t aa = (Py_uintptr_t)operand1;\n            Py_uintptr_t bb = (Py_uintptr_t)operand2;\n\n            c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n        } else if (operand1 == Py_None) {\n            // None is smaller than everything else\n            c = -1;\n        } else if (operand2 == Py_None) {\n            // None is smaller than everything else\n            c = 1;\n        } else if (PyNumber_Check(operand1)) {\n            // different type: compare type names but numbers are smaller than\n            // others.\n            if (PyNumber_Check(operand2)) {\n                // Both numbers, need to make a decision based on types.\n                Py_uintptr_t aa = (Py_uintptr_t){{ left.getTypeValueVariableExpression(\"type1\") }};\n                Py_uintptr_t bb = (Py_uintptr_t){{ right.getTypeValueVariableExpression(\"type2\") }};\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            } else {\n                c = -1;\n            }\n        } else if (PyNumber_Check(operand2)) {\n            c = 1;\n        } else {\n            // Banking on C compile to optimize \"strcmp\".\n            int s = strcmp({{ left.getTypeNameExpression(\"type1\") }}, {{ right.getTypeNameExpression(\"type2\") }});\n\n            if (s < 0) {\n                c = -1;\n            } else if (s > 0) {\n                c = 1;\n            } else {\n                // Same type name need to make a decision based on type address.\n                Py_uintptr_t aa = (Py_uintptr_t){{ left.getTypeValueVariableExpression(\"type1\") }};\n                Py_uintptr_t bb = (Py_uintptr_t){{ right.getTypeValueVariableExpression(\"type2\") }};\n\n                c = (aa < bb) ? -1 : (aa > bb) ? 1 : 0;\n            }\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    if (unlikely(c <= -2)) {\n        return {{target.getExceptionResultIndicatorValue()}};\n    }\n\n    switch(Py_{{op_code}}) {\n    case Py_LT:\n        c = c < 0;\n        break;\n    case Py_LE:\n        c = c <= 0;\n        break;\n    case Py_EQ:\n        c = c == 0;\n        break;\n    case Py_NE:\n        c = c != 0;\n        break;\n    case Py_GT:\n        c = c > 0;\n        break;\n    case Py_GE:\n        c = c >= 0;\n        break;\n    }\n\n    bool r = c != 0;\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n#else\n    bool checked_reverse_op = false;\n    richcmpfunc f;\n\n    if ({{left.getTypeNonIdenticalCheckExpression(right, \"type1\", \"type2\")}} && {{ left.getTypeSubTypeCheckExpression(right, \"type2\", \"type1\") }}) {\n        f = {{right.getSlotValueExpression(\"type2\", \"tp_richcompare\")}};\n\n        if (f != NULL) {\n            checked_reverse_op = true;\n\n            PyObject *result = (*f)(operand2, operand1, Py_{{reversed_args_op_code}});\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    f = {{left.getSlotValueExpression(\"type1\", \"tp_richcompare\")}};\n\n    if (f != NULL) {\n        PyObject *result = (*f)(operand1, operand2, Py_{{op_code}});\n\n        if (result != Py_NotImplemented) {\n            Py_LeaveRecursiveCall();\n\n            {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n        }\n\n        Py_DECREF(result);\n    }\n\n    if (checked_reverse_op == false) {\n        f = {{right.getSlotValueExpression(\"type2\", \"tp_richcompare\")}};\n\n        if (f != NULL) {\n            PyObject *result = (*f)(operand2, operand1, Py_{{reversed_args_op_code}});\n\n            if (result != Py_NotImplemented) {\n                Py_LeaveRecursiveCall();\n\n                {{ target.getReturnFromObjectExpressionCode(\"result\") }}\n            }\n\n            Py_DECREF(result);\n        }\n    }\n\n    Py_LeaveRecursiveCall();\n\n    // If it is not implemented, do pointer identity checks as \"==\" and \"!=\" and\n    // otherwise give an error\n    switch(Py_{{op_code}}) {\n    case Py_EQ: {\n        bool r = operand1 == operand2;\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n    case Py_NE: {\n        bool r = operand1 != operand2;\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n    default:\n        {{target.getReturnUnorderableTypeErrorCode(operator, left, right, \"type1\", \"type2\")}}\n    }\n#endif\n{% endif %}\n{% endmacro %}\n{{target.getTypeDecl()}} RICH_COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n\n{# Divert to more special implementation immediately if possible. #}\n{% if left.getTypeComparisonSpecializationCode(right, op_code, target, \"operand1\", \"operand2\") %}\n{% if left != right and object_desc in (left, right) %}\n    if ({{left.getTypeIdenticalCheckExpression(right, left.getTypeValueExpression(\"operand1\"), right.getTypeValueExpression(\"operand2\"))}}) {\n        {{left.getTypeComparisonSpecializationCode(right, op_code, target, \"operand1\", \"operand2\")}}\n    }\n\n    {{ comparison_fallback(op_code, target, left, right, type1, type2, operand1, operand2) }}\n{% else %}\n    {{left.getTypeComparisonSpecializationCode(right, op_code, target, \"operand1\", \"operand2\")}}\n{% endif %}\n{% else %}\n{{ comparison_fallback(op_code, target, left, right, type1, type2, operand1, operand2) }}\n{% endif %}\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    PyBytesObject *a = (PyBytesObject *)operand1;\n    PyBytesObject *b = (PyBytesObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n{% if operand in (\"==\", \">=\", \"<=\") %}\n        bool r = true;\n{% else %}\n        bool r = false;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n{% if operand in (\"==\", \"!=\") %}\n    if (len_a != len_b) {\n        {# Shortcut for equality/inequality, driven by length divergence. #}\n{% if operand == \"==\" %}\n        bool r = false;\n{% else %}\n        bool r = true;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n{% if operand == \"==\" %}\n            bool r = true;\n{% else %}\n            bool r = false;\n{% endif %}\n\n            // Convert to target type.\n            {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n            {{target.getTakeReferenceStatement(\"result\")}}\n            return result;\n        } else {\n{% if operand == \"==\" %}\n            bool r = false;\n{% else %}\n            bool r = true;\n{% endif %}\n\n            // Convert to target type.\n            {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n            {{target.getTakeReferenceStatement(\"result\")}}\n            return result;\n        }\n    }\n{% else %}\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c==0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n{% if operand == \"<\" %}\n    c = c < 0;\n{% elif operand == \"<=\" %}\n    c = c <= 0;\n{% elif operand == \">\" %}\n    c = c > 0;\n{% elif operand == \">=\" %}\n    c = c >= 0;\n{% endif %}\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"c != 0\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n\n{% endif %}\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{ left.getCheckValueCode(\"operand1\") }}\n    {{ right.getCheckValueCode(\"operand2\") }}\n\n    const double a = {{ left.getAsDoubleValueExpression(\"operand1\") }};\n    const double b = {{ right.getAsDoubleValueExpression(\"operand2\") }};\n\n    bool r = a {{operand}} b;\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    {# This is supposed to be Python2 code #}\n    const long a = {{left.getAsLongValueExpression(\"operand1\")}};\n    const long b = {{right.getAsLongValueExpression(\"operand2\")}};\n\n    bool r = a {{operand}} b;\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    {# TODO: Unify with tuple, seems the iteration part is only difference #}\n    PyListObject *a = (PyListObject *)operand1;\n    PyListObject *b = (PyListObject *)operand2;\n\n{# Shortcut for equality, driven by length check. #}\n{% if operand in (\"==\", \"!=\") %}\n    if (Py_SIZE(a) != Py_SIZE(b)) {\n{% if operand == \"==\" %}\n        bool r = false;\n{% else %}\n        bool r = true;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n{% endif %}\n\n{# Find the first non-identical object. #}\n{% if operand not in (\"==\", \"!=\") %}\n    bool found = false;\n{% endif %}\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        Py_INCREF(aa);\n        Py_INCREF(bb);\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n        Py_DECREF(aa);\n        Py_DECREF(bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return {{target.getExceptionResultIndicatorValue()}};\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n{% if operand not in (\"==\", \"!=\") %}\n            found = true;\n{% endif %}\n            break;\n        }\n    }\n\n{# If size mismatches, but all is equal at the start, compare sizes to order lists. #}\n{% if operand not in (\"==\", \"!=\") %}\n    if (found == false) {\n        bool r = Py_SIZE(a) {{operand}} Py_SIZE(b);\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n\n    return RICH_COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n{% else %}\n{% if operand == \"==\" %}\n    bool r;\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) {{operand}} Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_TRUE;\n    }\n{% else %}\n    bool r;\n\n    if (i >= Py_SIZE(a) || i >= Py_SIZE(b)) {\n        r = Py_SIZE(a) {{operand}} Py_SIZE(b);\n    } else {\n        r = res == NUITKA_BOOL_FALSE;\n    }\n{% endif %}\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n\n{% endif %}\n\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperLongTools.c.j2' import declare_long_access with context %}\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{ left.getCheckValueCode(\"operand1\") }}\n    {{ right.getCheckValueCode(\"operand2\") }}\n\n    {{ declare_long_access(left, \"operand1\") }}\n    {{ declare_long_access(right, \"operand2\") }}\n\n    bool r;\n\n{% if operand == \"==\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = false;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = true;\n\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = false;\n                break;\n            }\n        }\n    }\n{% elif operand == \"!=\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = true;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = false;\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = true;\n                break;\n            }\n        }\n    }\n{% elif operand == \"<=\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = {{ left.getLongValueSizeExpression(\"operand1\") }} - {{ right.getLongValueSizeExpression(\"operand2\") }} < 0;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = true;\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = {{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} < {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }};\n                if ({{ left.getLongValueIsNegativeTestExpression(\"operand1\") }}) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n{% elif operand == \">=\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = true;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = {{ left.getLongValueSizeExpression(\"operand1\") }} - {{ right.getLongValueSizeExpression(\"operand2\") }} > 0;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = true;\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = {{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} > {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }};\n                if ({{ left.getLongValueIsNegativeTestExpression(\"operand1\") }}) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n{% elif operand == \"<\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = {{ left.getLongValueSizeExpression(\"operand1\") }} - {{ right.getLongValueSizeExpression(\"operand2\") }} < 0;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = false;\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = {{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} < {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }};\n                if ({{ left.getLongValueIsNegativeTestExpression(\"operand1\") }}) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n{% elif operand == \">\" %}\n{% if left == right == long_desc %}\n    if (operand1_long_object == operand2_long_object) {\n        r = false;\n    } else\n{% endif %}\n    if ( {{ left.getLongValueSizeExpression(\"operand1\") }} != {{ right.getLongValueSizeExpression(\"operand2\") }} ) {\n        r = {{ left.getLongValueSizeExpression(\"operand1\") }} - {{ right.getLongValueSizeExpression(\"operand2\") }} > 0;\n    } else {\n        Py_ssize_t i = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        r = false;\n        while (--i >= 0) {\n            if ({{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} != {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }}) {\n                r = {{ left.getLongValueDigitExpression(\"operand1\", \"i\") }} > {{ right.getLongValueDigitExpression(\"operand2\", \"i\") }};\n                if ({{ left.getLongValueIsNegativeTestExpression(\"operand1\") }}) {\n                    r = !r;\n                }\n                break;\n            }\n        }\n    }\n{% else %}\n# error unknown operand {{operand}}\n{% endif %}\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    PyStringObject *a = (PyStringObject *)operand1;\n    PyStringObject *b = (PyStringObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n{% if operand in (\"==\", \">=\", \"<=\") %}\n        bool r = true;\n{% else %}\n        bool r = false;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n\n    Py_ssize_t len_a = Py_SIZE(operand1);\n    Py_ssize_t len_b = Py_SIZE(operand2);\n\n{% if operand in (\"==\", \"!=\") %}\n    if (len_a != len_b) {\n        {# Shortcut for equality/inequality, driven by length divergence. #}\n{% if operand == \"==\" %}\n        bool r = false;\n{% else %}\n        bool r = true;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    } else {\n        if ((a->ob_sval[0] == b->ob_sval[0]) && (memcmp(a->ob_sval, b->ob_sval, len_a) == 0)) {\n{% if operand == \"==\" %}\n            bool r = true;\n{% else %}\n            bool r = false;\n{% endif %}\n\n            // Convert to target type.\n            {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n            {{target.getTakeReferenceStatement(\"result\")}}\n            return result;\n        } else {\n{% if operand == \"==\" %}\n            bool r = false;\n{% else %}\n            bool r = true;\n{% endif %}\n\n            // Convert to target type.\n            {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n            {{target.getTakeReferenceStatement(\"result\")}}\n            return result;\n        }\n    }\n{% else %}\n\n    Py_ssize_t min_len = (len_a < len_b) ? len_a : len_b;\n    int c;\n\n    if (min_len > 0) {\n        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);\n\n        if (c==0) {\n            c = memcmp(a->ob_sval, b->ob_sval, min_len);\n        }\n    } else {\n        c = 0;\n    }\n\n    if (c == 0) {\n        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;\n    }\n\n{% if operand == \"<\" %}\n    c = c < 0;\n{% elif operand == \"<=\" %}\n    c = c <= 0;\n{% elif operand == \">\" %}\n    c = c > 0;\n{% elif operand == \">=\" %}\n    c = c >= 0;\n{% endif %}\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"c != 0\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n\n{% endif %}\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    PyTupleObject *a = (PyTupleObject *)operand1;\n    PyTupleObject *b = (PyTupleObject *)operand2;\n\n    Py_ssize_t len_a = Py_SIZE(a);\n    Py_ssize_t len_b = Py_SIZE(b);\n\n{# Shortcut for equality, driven by length check. #}\n{% if operand in (\"==\", \"!=\") %}\n    if (len_a != len_b) {\n{% if operand == \"==\" %}\n        bool r = false;\n{% else %}\n        bool r = true;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n{% endif %}\n\n{# Find the first non-identical object. #}\n{% if operand not in (\"==\", \"!=\") %}\n    bool found = false;\n{% endif %}\n    nuitka_bool res = NUITKA_BOOL_TRUE;\n\n    Py_ssize_t i;\n    for (i = 0; i < len_a && i < len_b; i++) {\n        PyObject *aa = a->ob_item[i];\n        PyObject *bb = b->ob_item[i];\n\n        if (aa == bb) {\n            continue;\n        }\n\n        res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);\n\n        if (res == NUITKA_BOOL_EXCEPTION) {\n            return {{target.getExceptionResultIndicatorValue()}};\n        }\n\n        if (res == NUITKA_BOOL_FALSE) {\n{% if operand not in (\"==\", \"!=\") %}\n            found = true;\n{% endif %}\n            break;\n        }\n    }\n\n{# If size mismatches, but all is equal at the start, compare sizes to order tuples. #}\n{% if operand not in (\"==\", \"!=\") %}\n    if (found == false) {\n        bool r = len_a {{operand}} len_b;\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n\n    return RICH_COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_OBJECT_OBJECT(a->ob_item[i], b->ob_item[i]);\n{% else %}\n{% if operand == \"==\" %}\n    bool r = res == NUITKA_BOOL_TRUE;\n{% else %}\n    bool r = res == NUITKA_BOOL_FALSE;\n{% endif %}\n\n    // Convert to target type.\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n\n{% endif %}\n\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nstatic {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    {{left.getCheckValueCode(\"operand1\")}}\n    {{right.getCheckValueCode(\"operand2\")}}\n\n    PyUnicodeObject *a = (PyUnicodeObject *)operand1;\n    PyUnicodeObject *b = (PyUnicodeObject *)operand2;\n\n    // Same object has fast path for all operations.\n    if (operand1 == operand2) {\n{% if operand in (\"==\", \">=\", \"<=\") %}\n        bool r = true;\n{% else %}\n        bool r = false;\n{% endif %}\n\n        // Convert to target type.\n        {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r\")}};\n        {{target.getTakeReferenceStatement(\"result\")}}\n        return result;\n    }\n\n{% if operand in (\"==\", \"!=\") %}\n#if PYTHON_VERSION >= 0x300\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        int kind1 = PyUnicode_KIND(a);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind1 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)a);\n            assert(res != -1);\n            kind1 = PyUnicode_KIND(a);\n            assert(kind1 != 0);\n        }\n#endif\n\n        int kind2 = PyUnicode_KIND(b);\n#if PYTHON_VERSION < 0x3c0\n        if (unlikely(kind2 == 0)) {\n            NUITKA_MAY_BE_UNUSED int res = _PyUnicode_Ready((PyObject *)b);\n            assert(res != -1);\n            kind2 = PyUnicode_KIND(b);\n            assert(kind2 != 0);\n        }\n#endif\n\n        if (kind1 != kind2) {\n            r = false;\n        } else {\n            const void *data1 = PyUnicode_DATA(a);\n            const void *data2 = PyUnicode_DATA(b);\n\n            int cmp = memcmp(data1, data2, len * kind1);\n            r = (cmp == 0);\n        }\n    }\n\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r == \" + (\"true\" if operand == \"==\" else \"false\"))}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n#else\n    bool r;\n\n    Py_ssize_t len = PyUnicode_GET_LENGTH(a);\n    if (PyUnicode_GET_LENGTH(b) != len) {\n        r = false;\n    } else {\n        const Py_UNICODE *data1 = a->str;\n        const Py_UNICODE *data2 = b->str;\n\n        int cmp = memcmp(data1, data2, len * sizeof(Py_UNICODE));\n        r = (cmp == 0);\n    }\n\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r == \" + (\"true\" if operand == \"==\" else \"false\"))}};\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n#endif\n{% else %}\n    {# TODO: Make these specialized for Python versions, if only because we have no\n       way of going to C bool quickly otherwise #}\n    PyObject *r = PyUnicode_RichCompare((PyObject *)a, (PyObject *)b, Py_{{op_code}});\n    CHECK_OBJECT(r);\n\n{% if target.type_name == \"object\" %}\n    return r;\n{% else %}\n    // Convert to target type if necessary\n    {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression(\"r == Py_True\")}};\n    Py_DECREF(r);\n    {{target.getTakeReferenceStatement(\"result\")}}\n    return result;\n{% endif %}\n{% endif %}\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperOperationInplace.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n{% from 'HelperSlotsBinary.c.j2' import binary_operation, call_binary_slot with context %}\n{% macro inplace_fallback_operation(props, left, right, type1, type2) %}\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n{% if left == object_desc or left.hasSlot(nb_inplace_slot) %}\n    {{ left.getSlotType(nb_inplace_slot)}} islot = {{left.getSlotValueExpression(\"type1\", nb_inplace_slot) }};\n\n    if (islot != NULL) {\n        PyObject *x = {{ left.getSlotCallExpression(nb_inplace_slot, \"islot\", \"*operand1\", \"operand2\") }};\n\n        if (x != Py_NotImplemented) {\n            {{ goto_exit(props, \"exit_inplace_result_object\", \"x\") }}\n        }\n\n        Py_DECREF(x);\n    }\n{% else %}\n    // No inplace number slot {{ nb_inplace_slot }} available for this type.\n{% endif %}\n\n    {\n        {{ binary_operation(props, operator, nb_slot, left, right, \"type1\", \"type2\", \"*operand1\", \"operand2\", \"exit_inplace_result_object\", \"exit_inplace_result_cbool_ok\", \"exit_inplace_result_nbool\", \"exit_inplace_exception\") }}\n    }\n\n{% if \"exit_inplace_result_object\" in props[\"exits\"] %}\nexit_inplace_result_object:\n    if (unlikely(obj_result == NULL)) {\n        return false;\n    }\n\n    // We got an object handed, that we have to release.\n    Py_DECREF(*operand1);\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    *operand1 = obj_result;\n\n    return true;\n{% endif %}\n\n{% if \"exit_inplace_exception\" in props[\"exits\"] %}\n{% if \"all\" not in props[\"exits\"][\"exit_inplace_exception\"] %}\n#if PYTHON_VERSION < 0x300\n{% endif %}\nexit_inplace_exception:\n    return false;\n{% if \"all\" not in props[\"exits\"][\"exit_inplace_exception\"] %}\n#endif\n{% endif %}\n{% endif %}\n{% endmacro %}\n{% if not left.hasTypeSpecializationCode(right, nb_slot, sq_slot) and left.getSameTypeType(right).hasSameTypeOperationSpecializationCode(right.getSameTypeType(left), nb_slot, sq_slot) %}\nstatic HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_{{op_code}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"*operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n{% set props = {\"exits\": {}} %}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"*operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    {{ inplace_fallback_operation(props, left, right, \"type1\", \"type2\") }}\n}\n{% endif %}\nstatic inline bool _INPLACE_OPERATION_{{op_code}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"*operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    assert(operand1); // Pointer must be non-null.\n\n    {{ left.getCheckValueCode(\"*operand1\") }}\n    {{ right.getCheckValueCode(\"operand2\") }}\n\n{% if left.type_name == \"object\" and right.type_name == \"object\" %}\n    {# CPython2 treats integer values with fast path. #}\n#if PYTHON_VERSION < 0x300\n    if ({{ left.getIntCheckExpression(\"*operand1\") }} && {{ right.getIntCheckExpression(\"operand2\") }}) {\n        {% from 'HelperSlotsInt.c.j2' import int_slot with context %}\n\n        {% set props = {\"exits\": {}} %}\n        {{ int_slot(props, operator, nb_slot, None, int_desc, int_desc, \"result\", \"*operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n        exit_result_ok:\n        return true;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n        exit_result_exception:\n        return false;\n{% endif %}\n    }\n#endif\n{% endif %}\n\n{% if operator == \"+\" and (left.mayBothHaveType(right, \"str\") or left.mayBothHaveType(right, \"unicode\") or left.hasOneOrBothType(right, \"bytes\")) %}\n    if (Py_REFCNT(*operand1) == 1) {\n        // We more or less own the operand, so we might reuse its storage and\n        // execute stuff in-place.\n{% if operator == \"+\" and left.mayBothHaveType(right, \"str\") %}\n#if PYTHON_VERSION < 0x300\n        if ({{left.getStringCheckExpression(\"*operand1\")}} && !PyString_CHECK_INTERNED(*operand1) && {{right.getStringCheckExpression(\"operand2\")}}) {\n            return STRING_ADD_INPLACE(operand1, operand2);\n        }\n#endif\n{% endif %}\n\n{% if operator == \"+\" and left.mayBothHaveType(right, \"unicode\") %}\n#if PYTHON_VERSION >= 0x300\n        if ({{ left.getUnicodeCheckExpression(\"*operand1\")}} && !PyUnicode_CHECK_INTERNED(*operand1) && {{right.getUnicodeCheckExpression(\"operand2\") }}) {\n            // TODO: Push outward.\n            PyThreadState *tstate = PyThreadState_GET();\n\n            return UNICODE_ADD_INCREMENTAL(tstate, operand1, operand2);\n        }\n#endif\n{% endif %}\n\n{% if operator == \"+\" and left.hasOneOrBothType(right, \"bytes\") %}\n#if PYTHON_VERSION >= 0x300\n        if ({{ left.getBytesCheckExpression(\"*operand1\")}} && {{right.getBytesCheckExpression(\"operand2\") }}) {\n            return BYTES_ADD_INCREMENTAL(operand1, operand2);\n        }\n#endif\n{% endif %}\n    }\n{% endif %}\n\n{% if left == object_desc and right == object_desc %}\n{# Floats are very good for in-place operations. #}\n    if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {\n{% if float_desc.hasTypeSpecializationCode(float_desc, nb_slot, sq_slot) %}\n        if ({{left.getFloatCheckExpression(\"operand2\")}}) {\n            return _INPLACE_OPERATION_{{op_code}}_{{float_desc.getHelperCodeName()}}_{{float_desc.getHelperCodeName()}}(operand1, operand2);\n        }\n{% endif %}\n{% if long_desc.hasTypeSpecializationCode(long_desc, nb_slot, sq_slot) %}\n#if PYTHON_VERSION >= 0x300\n        if ({{left.getLongCheckExpression(\"operand2\")}}) {\n            return _INPLACE_OPERATION_{{op_code}}_{{long_desc.getHelperCodeName()}}_{{long_desc.getHelperCodeName()}}(operand1, operand2);\n        }\n#endif\n{% endif %}\n    }\n{% endif %}\n\n{% if operator == \"+\" and left == right and left in (object_desc, str_desc) %}\n{# Fast path for Python2 str values, very important for performance. #}\n#if PYTHON_VERSION < 0x300\n    // Python2 strings are to be treated differently, fall back to Python API here.\n    if ({{ left.getStringCheckExpression(\"*operand1\")}} && {{right.getStringCheckExpression(\"operand2\") }}) {\n        {# This could be inlined too, but it has some detail behind it. #}\n        PyString_Concat(operand1, operand2);\n\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        return !HAS_ERROR_OCCURRED(tstate);\n    }\n#endif\n{% endif %}\n{% if operator == \"+\" and left == right and right == object_desc %}\n{# Fast path for Python3 str values, very important for performance. #}\n#if PYTHON_VERSION >= 0x300\n    // Python3 Strings are to be treated differently.\n    if ({{ left.getUnicodeCheckExpression(\"*operand1\")}} && {{right.getUnicodeCheckExpression(\"operand2\") }}) {\n        // TODO: Have this more globally passed in\n        PyThreadState *tstate = PyThreadState_GET();\n\n        PyObject *result = UNICODE_CONCAT(tstate, *operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n#endif\n{% endif %}\n\n{# Fast path for list in-place add with at least one known list. #}\n{% if operator == \"+\" and left.hasOneOrBothType(right, \"list\") %}\n    if ({{ left.getListCheckExpression(\"*operand1\")}} && {{ right.getListCheckExpression(\"operand2\") }}) {\n        return LIST_EXTEND_FROM_LIST(*operand1, operand2);\n    }\n{% endif %}\n\n{# TODO: No special function for tuple += tuple yet. #}\n{# Fast path for sequences in-place add with at least one known sequence type. #}\n{% if operator == \"+\" and left.type_name in (\"list\", \"tuple\") and right.type_name in (\"list\", \"tuple\", \"object\") %}\n    if ({{ left.getSequenceCheckExpression(\"*operand1\", right)}} && {{ right.getSequenceCheckExpression(\"operand2\", left) }}) {\n        PyObject *result = PySequence_InPlaceConcat(*operand1, operand2);\n\n        if (unlikely(result == NULL)) {\n            return false;\n        }\n\n        Py_DECREF(*operand1);\n        *operand1 = result;\n\n        return true;\n    }\n{% endif %}\n\n{% if left.hasTypeSpecializationCode(right, nb_slot, sq_slot) %}\n{% set props = {\"exits\": {}} %}\n    {{ call_binary_slot(props, operator, nb_slot, nb_inplace_slot, left, right, \"result\", \"*operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n    exit_result_ok:\n    return true;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n    exit_result_exception:\n    return false;\n{% endif %}\n{% elif left.getSameTypeType(right).hasSameTypeOperationSpecializationCode(right.getSameTypeType(left), nb_slot, sq_slot) %}\n{% set props = {\"exits\": {}} %}\n\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"*operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    if ({{ left.getTypeIdenticalCheckExpression(right, \"type1\", \"type2\") }}) {\n        {# There is special code for same types. #}\n        // return _BINARY_OPERATION_{{op_code}}_{{left.getSameTypeType(right).getHelperCodeName()}}_{{right.getSameTypeType(left).getHelperCodeName()}}_INPLACE(operand1, operand2);\n\n        {{ call_binary_slot(props, operator, nb_slot, nb_inplace_slot, left.getSameTypeType(right), right.getSameTypeType(left), \"result\", \"*operand1\", \"operand2\", \"exit_result_ok\", \"exit_result_exception\") }}\n\n        exit_result_ok:\n        return true;\n\n{% if \"exit_result_exception\" in props[\"exits\"] %}\n        exit_result_exception:\n        return false;\n{% endif %}\n    }\n\n    return __INPLACE_OPERATION_{{op_code}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}(operand1, operand2);\n{% else %}\n{% set props = {\"exits\": {}} %}\n{% if left == object_desc %}\n    PyTypeObject *type1 = {{ left.getTypeValueExpression(\"*operand1\") }};\n{% endif %}\n{% if right == object_desc %}\n    PyTypeObject *type2 = {{ right.getTypeValueExpression(\"operand2\") }};\n{% endif %}\n\n    {{ inplace_fallback_operation(props, left, right, \"type1\", \"type2\") }}\n{% endif %}\n}\n\nbool INPLACE_OPERATION_{{op_code}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl(\"*operand1\")}}, {{right.getVariableDecl(\"operand2\")}}) {\n    return _INPLACE_OPERATION_{{op_code}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}(operand1, operand2);\n}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n{% from 'HelperSlotsInt.c.j2' import int_slot with context %}\n{% from 'HelperSlotsLong.c.j2' import long_slot with context %}\n{% from 'HelperSlotsFloat.c.j2' import float_slot %}\n{% from 'HelperSlotsStr.c.j2' import str_slot %}\n{% from 'HelperSlotsUnicode.c.j2' import unicode_slot %}\n{% from 'HelperSlotsBytes.c.j2' import bytes_slot %}\n{% from 'HelperSlotsTuple.c.j2' import tuple_slot %}\n{% from 'HelperSlotsList.c.j2' import list_slot %}\n{% from 'HelperSlotsSet.c.j2' import set_slot %}\n{% macro operation_unsupported_error_exit(props, operator, left, right, type1, type2, exit_result_exception) %}\n{% set args = [] %}\n{% if left == object_desc %}\n{% do args.append(\"%s->tp_name\" % type1) %}\n{% endif %}\n{% if right == object_desc %}\n{% do args.append(\"%s->tp_name\" % type2) %}\n{% endif %}\n{% set left_name_2 = \"'%s'\" % (\"%s\" if left == object_desc else left.getTypeName2()) %}\n{% set left_name_3 = \"'%s'\" % (\"%s\" if left == object_desc else left.getTypeName3()) %}\n{% set right_name_2 = \"'%s'\" % (\"%s\" if right == object_desc else right.getTypeName2()) %}\n{% set right_name_3 = \"'%s'\" % (\"%s\" if right == object_desc else right.getTypeName3()) %}\n{% if (left_name_2 == left_name_3 and right_name_2 == right_name_3) or left.python_requirement or right.python_requirement %}\n{% if left.python_requirement == \"PYTHON_VERSION < 0x300\" or right.python_requirement == \"PYTHON_VERSION < 0x300\" %}\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for {{ left.getOperationErrorMessageName(operator) }}: {{ left_name_2 }} and {{ right_name_2 }}\"{{ \",\" + \",\".join(args) if args else \"\" }});\n{% else %}\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for {{ left.getOperationErrorMessageName(operator) }}: {{ left_name_3 }} and {{ right_name_3 }}\"{{ \",\" + \",\".join(args) if args else \"\" }});\n{% endif %}\n{% else %}\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for {{ left.getOperationErrorMessageName(operator) }}: {{ left_name_2 }} and {{ right_name_2 }}\"{{ \",\" + \",\".join(args) if args else \"\" }});\n#else\n    PyErr_Format(PyExc_TypeError, \"unsupported operand type(s) for {{ left.getOperationErrorMessageName(operator) }}: {{ left_name_3 }} and {{ right_name_3 }}\"{{ \",\" + \",\".join(args) if args else \"\" }});\n#endif\n{% endif %}\n    {{ goto_exit(props, exit_result_exception) }}\n{% endmacro %}\n{% macro cannot_fit_to_index_size_error_exit(props, left, right, type2, exit_result_exception) %}\n{% if right == object_desc %}\n    PyErr_Format(PyExc_OverflowError, \"cannot fit '%s' into an index-sized integer\", {{ type2 }}->tp_name);\n{% else %}\n{% set right_name_2 = right.getTypeName2() %}\n{% set right_name_3 = right.getTypeName3() %}\n{% if right_name_2 == right_name_3 or left.python_requirement or right.python_requirement %}\n{% if left.python_requirement == \"PYTHON_VERSION < 0x300\" or right.python_requirement == \"PYTHON_VERSION < 0x300\" %}\n    PyErr_Format(PyExc_OverflowError, \"cannot fit '{{ right_name_2 }}' into an index-sized integer\");\n{% else %}\n    PyErr_Format(PyExc_OverflowError, \"cannot fit '{{ right_name_3 }}' into an index-sized integer\");\n{% endif %}\n{% else %}\n#if PYTHON_VERSION < 0x300\n    PyErr_Format(PyExc_OverflowError, \"cannot fit '{{ right_name_2 }}' into an index-sized integer\");\n#else\n    PyErr_Format(PyExc_OverflowError, \"cannot fit '{{ right_name_3 }}' into an index-sized integer\");\n#endif\n{% endif %}\n{% endif %}\n    {{ goto_exit(props, exit_result_exception) }}\n{% endmacro %}\n{% macro concat_operation(props, left, right, type1, type2, operand1, operand2, exit_result_object, exit_result_exception) %}\n{% if sq_inplace_slot and left.hasSlot(sq_inplace_slot) %}\n    {\n        PyObject *o = {{ left.getSlotValueExpression(type1, \"sq_inplace_concat\") }}({{ operand1 }}, {{ operand2 }});\n        {{ goto_exit(props, exit_result_object, \"o\") }}\n    }\n{% endif %}\n    {\n{% if left != object_desc and right != object_desc and right.hasSlot(sq_slot) and right.hasPreferredSlot(left, sq_slot) %}\n        PyObject *o = {{ right.getSlotValueExpression(type1, \"sq_concat\") }}({{ operand1 }}, {{ operand2 }});\n{% else %}\n        PyObject *o = {{ left.getSlotValueExpression(type1, \"sq_concat\") }}({{ operand1 }}, {{ operand2 }});\n{% endif %}\n        {{ goto_exit(props, exit_result_object, \"o\") }}\n    }\n{% endmacro %}\n{% macro repeat_operation(props, left, right, type1, type2, operand1, operand2, exit_result_object, exit_result_exception) %}\n    {# This is the SEQUENCE_REPEAT() helper specialized #}\n    if (unlikely(!{{ right.getIndexCheckExpression(operand2) }})) {\n        SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(\"can't multiply sequence by non-int of type '%s'\", {{operand2}});\n\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    {\n{% if right.needsIndexConversion() %}\n        PyObject *index_value = Nuitka_Number_Index({{ operand2 }});\n\n        if (unlikely(index_value == NULL)) {\n            {{ goto_exit(props, exit_result_exception) }}\n        }\n{% else %}\n        PyObject *index_value = {{ operand2 }};\n{% endif %}\n\n        {\n{% if right.type_name == \"int\" %}\n            Py_ssize_t count = PyInt_AS_LONG(index_value);\n{% else %}\n{% if right.type_name == \"long\" %}\n            Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);\n{% else %}\n            Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);\n{% endif %}\n\n{% if right.needsIndexConversion() %}\n            Py_DECREF(index_value);\n{% endif %}\n\n            /* Above conversion indicates an error as -1 */\n            if (unlikely(count == -1)) {\n                {{ cannot_fit_to_index_size_error_exit(props, left, right, type2, exit_result_exception) }}\n            }\n{% endif %}\n            {\n{% if sq_inplace_slot %}\n                {{ left.getSlotType(sq_slot) }} repeatfunc = {{ left.getSlotValueExpression(type1, sq_inplace_slot) }};\n                if (repeatfunc == NULL) {\n                    repeatfunc = {{ left.getSlotValueExpression(type1, sq_slot) }};\n                }\n{% else %}\n                {{ left.getSlotType(sq_slot) }} repeatfunc = {{ left.getSlotValueExpression(type1, sq_slot) }};\n{% endif %}\n                PyObject *r = (*repeatfunc)({{ operand1 }}, count);\n\n                {{ goto_exit(props, exit_result_object, \"r\") }}\n            }\n        }\n    }\n{% endmacro %}\n{% macro binary_operation(props, operator, nb_slot, left, right, type1, type2, operand1, operand2, exit_result_object, exit_result_cbool_ok, exit_result_nbool, exit_result_exception) %}\n{% set slot1_relevant = left == object_desc or left.hasSlot(nb_slot) %}\n{% set slot2_relevant = right == object_desc or (left != right and right.hasSlot(nb_slot)) %}\n{% set error_needed = 1 %}\n{% set slot1_ignored = slot1_relevant and left != object_desc and right != object_desc and right.hasPreferredSlot(left, nb_slot) %}\n{% set slot1_relevant = slot1_relevant and not slot1_ignored %}\n{% set slot2_ignored = slot2_relevant and left != object_desc and right != object_desc and left.hasPreferredSlot(right, nb_slot) %}\n{% set slot2_relevant = slot2_relevant and not slot2_ignored %}\n{% if slot1_relevant %}\n    {{ left.getSlotType(nb_slot) }} slot1 = {{ left.getSlotValueExpression(type1, nb_slot) }};\n{% elif slot1_ignored %}\n    // Slot1 ignored on purpose, type2 takes precedence.\n{% endif %}\n{% if slot2_relevant %}\n    {{ left.getSlotType(nb_slot) }} slot2 = NULL;\n\n    if (!({{ left.getTypeIdenticalCheckExpression(right, type1, type2) }})) {\n        // Different types, need to consider second value slot.\n\n        slot2 = {{ right.getSlotValueExpression(type2, nb_slot) }};\n\n{% if slot1_relevant and (left == object_desc or right == object_desc)  %}\n        if (slot1 == slot2) {\n            slot2 = NULL;\n        }\n{% endif %}\n    }\n{% elif slot2_ignored %}\n    // Slot2 ignored on purpose, type1 takes precedence.\n{% endif %}\n\n{% if slot1_relevant %}\n    if (slot1 != NULL) {\n{% if slot2_relevant and right == object_desc %}\n        if (slot2 != NULL) {\n            if ({{ left.getTypeSubTypeCheckExpression(right, type2, type1) }}) {\n                PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"slot2\", operand1, operand2) }};\n\n                if (x != Py_NotImplemented) {\n                    {{ goto_exit(props, exit_result_object, \"x\") }}\n                }\n\n                Py_DECREF(x);\n                slot2 = NULL;\n            }\n        }\n\n{% endif %}\n        PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"slot1\", operand1, operand2) }};\n\n        if (x != Py_NotImplemented) {\n            {{ goto_exit(props, exit_result_object, \"x\") }}\n        }\n\n        Py_DECREF(x);\n    }\n{% endif %}\n\n{% if slot2_relevant %}\n    if (slot2 != NULL) {\n        PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"slot2\", operand1, operand2) }};\n\n        if (x != Py_NotImplemented) {\n            {{ goto_exit(props, exit_result_object, \"x\") }}\n        }\n\n        Py_DECREF(x);\n    }\n{% endif %}\n\n{% if operator != \"@\" %}\n{% if not left.isKnownToNotCoerce(right) or not right.isKnownToNotCoerce(left) %}\n#if PYTHON_VERSION < 0x300\n    if (!{{ left.getNewStyleNumberTypeCheckExpression(type1) }} || !{{ right.getNewStyleNumberTypeCheckExpression(type2)}} ) {\n{% if not left.isKnownToNotCoerce(right) %}\n        coercion c1 = {{ left.getSlotValueExpression(type1, \"nb_coerce\") }};\n\n        if (c1 != NULL) {\n            PyObject *coerced1 = {{ operand1 }};\n            PyObject *coerced2 = {{ operand2 }};\n\n            int err = c1(&coerced1, &coerced2);\n\n            if (unlikely(err < 0)) {\n                {{ goto_exit(props, exit_result_exception, None, \"py2\") }}\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    {{ left.getSlotType(nb_slot) }} slot = mv->{{ nb_slot }};\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"slot\", \"coerced1\", \"coerced2\") }};\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        {{ goto_exit(props, exit_result_object, \"x\") }}\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n{% endif %}\n{% if not right.isKnownToNotCoerce(left) %}\n        coercion c2 = {{ right.getSlotValueExpression(type2, \"nb_coerce\") }};\n\n        if (c2 != NULL) {\n            PyObject *coerced1 = {{ operand1 }};\n            PyObject *coerced2 = {{ operand2 }};\n\n            int err = c2(&coerced2, &coerced1);\n\n            if (unlikely(err < 0)) {\n                {{ goto_exit(props, exit_result_exception, None, \"py2\") }}\n            }\n\n            if (err == 0) {\n                PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;\n\n                if (likely(mv == NULL)) {\n                    {{ left.getSlotType(nb_slot)}} slot = mv->{{ nb_slot }};\n\n                    if (likely(slot != NULL)) {\n                        PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"slot\", \"coerced1\", \"coerced2\") }};\n\n                        Py_DECREF(coerced1);\n                        Py_DECREF(coerced2);\n\n                        {{ goto_exit(props, exit_result_object, \"x\") }}\n                    }\n                }\n\n                // nb_coerce took a reference.\n                Py_DECREF(coerced1);\n                Py_DECREF(coerced2);\n            }\n        }\n{% endif %}\n    }\n#endif\n{% else %}\n// Statically recognized that coercion is not possible with these types\n{% endif %}\n{% else %}\n// Statically recognized that coercion is not possible with Python3 only operator '@'\n{% endif %}\n\n{# There might be a sq_slot specialization that saves the day. #}\n{% if operator in \"+*\" %}\n{% if left.type_name != \"object\" and left.hasSlot(sq_slot)  %}\n{% if operator == \"*\" %}\n    {{ repeat_operation(props, left, right, type1, type2, operand1, operand2, exit_result_object, exit_result_exception) }}\n{% else %}\n    {{ concat_operation(props, left, right, type1, type2, operand1, operand2, exit_result_object, exit_result_exception) }}\n{% endif %}\n    {% set error_needed = 0 %}\n{% else %}\n    {\n{% if sq_inplace_slot and (left == object_desc or left.hasSlot(sq_inplace_slot)) %}\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        {{ left.getSlotType(sq_slot) }} sq_slot = {{ left.getSlotValueExpression(type1, sq_inplace_slot) }};\n        if (sq_slot == NULL) {\n            sq_slot = {{ left.getSlotValueExpression(type1, sq_slot) }};\n        }\n        {% set lslot_needed = 1 %}\n{% elif left == object_desc or left.hasSlot(sq_slot) %}\n        // Special case for \"+\" and \"*\", also works as sequence concat/repeat.\n        {{ left.getSlotType(sq_slot) }} sq_slot = {{ left.getSlotValueExpression(type1, sq_slot) }};\n        {% set lslot_needed = 1 %}\n{% else %}\n        // No sequence repeat slot {{ sq_slot }} available for this type.\n{% if sq_inplace_slot %}\n        // No inplace sequence repeat slot {{ sq_inplace_slot }} available for this type.\n{% endif %}\n        {% set lslot_needed = 0 %}\n{% endif %}\n{% if lslot_needed == 1 %}\n\n        if (sq_slot != NULL) {\n{% if operator == \"+\" %}\n            PyObject *result = sq_slot({{ operand1 }}, {{ operand2 }});\n{% else %}\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, {{ operand1 }}, {{ operand2 }});\n{% endif %}\n\n            {{ goto_exit(props, exit_result_object, \"result\") }}\n        }\n{% endif %}\n    }\n{% if operator == \"*\" %}\n{% if right.type_name != \"object\" and right.hasSlot(\"sq_repeat\")  %}\n{% if operator == \"*\" %}\n{% if sq_inplace_slot %}\n    if ({{ left.getNoSequenceSlotAccessTestCode(\"type1\") }}) {\n{% endif %}\n        {{ repeat_operation(props, right, left, type2, type1, operand2, operand1, exit_result_object, exit_result_exception) }}\n{% if sq_inplace_slot %}\n    }\n{% endif %}\n{% else %}\n    {{ target.getTypeDecl() }} x = SLOT_sq_repeat_{{target.getHelperCodeName()}}_{{right.getHelperCodeName()}}_{{left.getHelperCodeName()}}(operand2, operand1);\n{% if target and target.type_name == \"cbool\" %}\n    {{ goto_exit(props, exit_result_ok_cbool, \"x\") }}\n{% elif target and target.type_name == \"nbool\" %}\n    {{ goto_exit(props, exit_result_nbool, \"x\") }}\n{% else %}\n    {{ goto_exit(props, exit_result_object, \"x\") }}\n{% endif %}\n{% endif %}\n{% if not sq_inplace_slot %}\n{% set error_needed = 0 %}\n{% endif %}\n{% else %}\n{% if right == object_desc or right.hasSlot(sq_slot) %}\n    // Special case for \"*\", also work with sequence repeat from right argument.\n{% if sq_inplace_slot %}\n    if ({{ left.getNoSequenceSlotAccessTestCode(\"type1\") }})\n{% endif %}\n    {\n        {{ right.getSlotType(sq_slot) }} sq_slot = {{ right.getSlotValueExpression(type2, sq_slot) }};\n        {% set rslot_needed = 1 %}\n{% else %}\n        // No sequence repeat slot {{ sq_slot }} available for this type.\n        {% set rslot_needed = 0 %}\n{% endif %}\n{% if rslot_needed == 1 %}\n\n        if (sq_slot != NULL) {\n            PyObject *result = SEQUENCE_REPEAT(sq_slot, {{ operand2 }}, {{ operand1 }});\n\n            {{ goto_exit(props, exit_result_object, \"result\") }}\n        }\n    }\n{% endif %}\n{% endif %}\n{% endif %}\n{% endif %}\n{% endif %}\n\n{% if error_needed == 1 %}\n    {{ operation_unsupported_error_exit(props, operator, left, right, type1, type2, exit_result_exception) }}\n{% else %}\n    NUITKA_CANNOT_GET_HERE(\"missing error exit annotation\");\n{% endif %}\n{% endmacro %}\n{% macro call_binary_slot(props, operator, nb_slot, nb_inplace_slot, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n{% if left.isSimilarOrSameTypesAsOneOf(int_desc) or right.isSimilarOrSameTypesAsOneOf(int_desc) %}\n    {{ int_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(long_desc) or right.isSimilarOrSameTypesAsOneOf(long_desc) %}\n    {{ long_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(float_desc) or right.isSimilarOrSameTypesAsOneOf(float_desc) %}\n    {{ float_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(str_desc) or right.isSimilarOrSameTypesAsOneOf(str_desc) %}\n    {{ str_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(unicode_desc) or right.isSimilarOrSameTypesAsOneOf(unicode_desc) %}\n    {{ unicode_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(bytes_desc) or right.isSimilarOrSameTypesAsOneOf(bytes_desc) %}\n    {{ bytes_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(tuple_desc) or right.isSimilarOrSameTypesAsOneOf(tuple_desc) %}\n    {{ tuple_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(list_desc) or right.isSimilarOrSameTypesAsOneOf(list_desc) %}\n    {{ list_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% elif left.isSimilarOrSameTypesAsOneOf(set_desc) or right.isSimilarOrSameTypesAsOneOf(set_desc) %}\n    {{ set_slot(props, operator, nb_slot, nb_inplace_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) }}\n{% else %}\n    {{ 0/0 }}\n{% endif %}\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro bytes_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n{% if nb_slot == \"nb_add\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_concat\", \"PyBytes_Type.tp_as_sequence->sq_concat\", operand1, operand2) }};\n{% elif nb_slot == \"nb_multiply\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_repeat\", \"PyBytes_Type.tp_as_sequence->sq_repeat\", operand1, operand2) }};\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyBytes_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n{% endif %}\n    assert(x != Py_NotImplemented);\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{# This contains macros that are used for all slot helper macros #}\n{% macro goto_exit(props, target, result, qual=\"all\") %}\n{% if target.endswith((\"_exception\", \"_left\", \"_right\")) or \"_const_\" in target or target == \"exit_result_ok\" %}\n{% elif target.endswith(\"_cbool\") %}\n    cbool_result = {{ result }};\n{% elif target.endswith(\"_nbool\") %}\n    nbool_result = {{ result }};\n{% elif target.endswith(\"_clong\") %}\n    clong_result = {{ result }};\n{% elif target.endswith(\"_cfloat\") %}\n    cfloat_result = {{ result }};\n{% elif target.endswith(\"_object\") %}\n    obj_result = {{ result }};\n{% else %}\n#error Cannot derive result variable from {{target}}\n{% endif %}\n    goto {{ target }}; {% if target not in props.get(\"exits\") %} {% do props.get(\"exits\").update({target: []}) %} {% endif %} {% do props.get(\"exits\").get(target).append(qual) %}\n{% endmacro %}\n\n{% macro constant_float_exit_target(props, target, result, left, operand1, label, constant_value, exit_result_ok) %}\n{{label}}:\n{% if target %}\n    {{ target.getAssignFromFloatConstantCode(result, constant_value) }}\n{% else %}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n    {{ left.getAssignFromFloatConstantCode(operand1, constant_value) }}\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endmacro %}\n\n{% macro constant_int_exit_target(props, target, result, left, operand1, label, constant_value, exit_result_ok) %}\n{{label}}:\n{% if target %}\n    {{ target.getAssignFromIntConstantCode(result, constant_value) }}\n{% else %}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n    {{ left.getAssignFromIntConstantCode(operand1, constant_value) }}\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endmacro %}\n\n{% macro constant_long_exit_target(props, target, result, left, operand1, label, constant_value, exit_result_ok) %}\n{{label}}:\n{% if target %}\n    {{ target.getAssignFromLongConstantCode(result, constant_value) }}\n{% else %}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n    {{ left.getAssignFromLongConstantCode(operand1, constant_value) }}\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit, constant_int_exit_target, constant_float_exit_target %}\n\n{% macro float_core(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_object, exit_result_exception, exit_result_ok_cfloat, exit_result_ok_left, exit_result_ok_right, exit_result_ok_const_float_1_0, exit_result_ok_const_float_0_0, exit_result_ok_const_float_minus_1_0) %}\n    {{ left.getCheckValueCode(operand1) }}\n    {{ right.getCheckValueCode(operand2) }}\n\n\n{% if operator in \"+-*\" %}\n    const double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    double r = a {{operator}} b;\n\n    {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n{% elif operator == \"//\" %}\n    const double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((a < 0) != (mod < 0)) {\n                div -= 1.0;\n            }\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a/b);\n        }\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"floordiv\") }}\n    }\n{% elif operator == \"/\" %}\n    const double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float division by zero\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    {\n        double r = a {{operator}} b;\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n    }\n{% elif operator == \"%\" %}\n    const double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    {\n        double mod = fmod(a, b);\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"mod\") }}\n    }\n{% elif operator == \"divmod\" %}\n    const double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    if (unlikely(b == 0.0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"float modulo\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    {\n        double mod = fmod(a, b);\n        double div = (a - mod) / b;\n\n        if (mod) {\n            if ((b < 0) != (mod < 0)) {\n                mod += b;\n                div -= 1.0;\n            }\n        } else {\n            mod = copysign(0.0, b);\n        }\n\n        double floordiv;\n        if (div) {\n            floordiv = floor(div);\n            if (div - floordiv > 0.5) {\n                floordiv += 1.0;\n            }\n        } else {\n            floordiv = copysign(0.0, a/b);\n        }\n\n        PyObject *r = Py_BuildValue(\"(dd)\", floordiv, mod);\n\n        {{ goto_exit(props, exit_result_object, \"r\") }}\n    }\n{% elif operator == \"**\" %}\n    double a = {{ left.getAsDoubleValueExpression(operand1) }};\n    const double b = {{ right.getAsDoubleValueExpression(operand2) }};\n\n    if (b == 0) {\n        {{ goto_exit(props, exit_result_ok_const_float_1_0) }}\n    }\n\n    if (Py_IS_NAN(a)) {\n        {{ goto_exit(props, exit_result_ok_left) }}\n    }\n\n    if (Py_IS_NAN(b)) {\n        if (a == 1.0) {\n            {{ goto_exit(props, exit_result_ok_const_float_1_0) }}\n        } else {\n            {{ goto_exit(props, exit_result_ok_right) }}\n        }\n    }\n\n    if (Py_IS_INFINITY(b)) {\n        a = fabs(a);\n        if (a == 1.0) {\n            {{ goto_exit(props, exit_result_ok_const_float_1_0) }}\n        } else if ((b > 0.0) == (a > 1.0)) {\n            long r = (long)fabs(b);\n\n            {# TODO: Should this be ok_clong then? #}\n            {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n        } else {\n            {{ goto_exit(props, exit_result_ok_const_float_0_0) }}\n        }\n    }\n\n    if (Py_IS_INFINITY(a)) {\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r;\n\n        if (b > 0.0) {\n            r = b_is_odd ? a : fabs(a);\n        } else {\n            r = b_is_odd ? copysign(0.0, a) : 0.0;\n        }\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n    }\n\n    if (a == 0.0) {\n        if (unlikely(b < 0.0)) {\n            PyThreadState *tstate = PyThreadState_GET();\n\n            SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"0.0 cannot be raised to a negative power\");\n            {{ goto_exit(props, exit_result_exception) }}\n        }\n\n        bool b_is_odd = DOUBLE_IS_ODD_INTEGER(b);\n        double r = b_is_odd ? a : 0.0;\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n    }\n\n    {\n        bool negate_result = false;\n\n        if (a < 0.0) {\n            if (unlikely(b != floor(b))) {\n                PyThreadState *tstate = PyThreadState_GET();\n\n                SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative number cannot be raised to a fractional power\");\n                {{ goto_exit(props, exit_result_exception) }}\n            }\n\n            a = -a;\n            negate_result = DOUBLE_IS_ODD_INTEGER(b);\n        }\n\n        if (a == 1.0) {\n            if (negate_result) {\n                {{ goto_exit(props, exit_result_ok_const_float_minus_1_0) }}\n            } else {\n                {{ goto_exit(props, exit_result_ok_const_float_1_0) }}\n            }\n        } else {\n            errno = 0;\n            double r = pow(a, b);\n\n            if (unlikely(errno != 0)) {\n                PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError);\n                {{ goto_exit(props, exit_result_exception) }}\n            }\n\n            r = negate_result ? -r : r;\n\n            {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n        }\n    }\n{% else %}\n#error Operator {{operator}} not implemented in {{name}}\n{% endif %}\n\n{% endmacro %}\n\n{% macro float_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    {{ float_core(props, operator, nb_slot, target, left, right, result, operand1, operand2, \"exit_result_object\", exit_result_exception, \"exit_result_ok_cfloat\", \"exit_result_ok_left\", \"exit_result_ok_right\", \"exit_result_ok_const_float_1_0\", \"exit_result_ok_const_float_0_0\", \"exit_result_ok_const_float_minus_1_0\") }}\n\n{% if \"exit_result_ok_cfloat\" in props[\"exits\"] %}\nexit_result_ok_cfloat:\n{% if target %}\n    {{ target.getAssignFromFloatExpressionCode(result, \"cfloat_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down. #}\n    if (Py_REFCNT({{ operand1 }}) == 1) {\n        PyFloat_SET_DOUBLE({{ operand1 }}, cfloat_result);\n    } else {\n        // We got an object handed, that we have to release.\n        Py_DECREF({{ operand1 }});\n\n        {{ left.getAssignFromFloatExpressionCode(operand1, \"cfloat_result\") }}\n    }\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_object\" in props[\"exits\"] %}\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_left\" in props[\"exits\"] %}\nexit_result_ok_left:\n{% if target %}\n    {{ target.getAssignConversionCode(result, left, operand1) }}\n{% endif %}\n    {# Nothing to do in case of in-place. #}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_right\" in props[\"exits\"] %}\nexit_result_ok_right:\n{% if target %}\n    {{ target.getAssignConversionCode(result, right, operand2) }}\n{% else %}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n    {{ left.getAssignConversionCode(operand1, right, operand2) }}\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_float_0_0\" in props[\"exits\"] %}\n{{ constant_float_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_float_0_0\", 0.0, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_float_1_0\" in props[\"exits\"] %}\n{{ constant_float_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_float_1_0\", 1.0, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_float_minus_1_0\" in props[\"exits\"] %}\n{{ constant_float_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_float_minus_1_0\", -1.0, exit_result_ok) }}\n{% endif %}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsInt.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit, constant_int_exit_target, constant_float_exit_target %}\n\n{% macro int_core(props, operator, nb_slot, bool_mode, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception, exit_result_ok_cbool, exit_result_ok_clong, exit_result_ok_cfloat, exit_result_object, exit_result_ok_left, exit_result_ok_const_int_0, exit_result_ok_const_int_neg_1, exit_result_ok_const_float_0_0, exit_result_ok_const_float_minus_0_0) %}\n    {% set fall_through_needed = 1 %}\n\n    {{ left.getCheckValueCode(operand1) }}\n    {{ right.getCheckValueCode(operand2) }}\n\n    {# This is supposed to be Python2 only code with types no bigger than int, therefore this works always #}\n    const long a = {{ left.getAsLongValueExpression(operand1) }};\n    const long b = {{ right.getAsLongValueExpression(operand2) }};\n\n{% if operator in \"+-\" %}\n    const long x = (long)((unsigned long)a {{operator}} b);\n    bool no_overflow = ((x^a) >= 0 || (x^{{\"~\" if operator == \"-\" else \"\"}}b) >= 0);\n{% if bool_mode %}\n    bool t = !no_overflow || x != 0;\n\n    {{ goto_exit(props, exit_result_ok_cbool, \"t\") }}\n    {% set fall_through_needed = 0 %}\n{% else %}\n    if (likely(no_overflow)) {\n        {{ goto_exit(props, exit_result_ok_clong, \"x\") }}\n    }\n{% endif %}\n{% elif operator == \"*\" %}\n    const long longprod = (long)((unsigned long)a * b);\n    const double doubleprod = (double)a * (double)b;\n    const double doubled_longprod = (double)longprod;\n\n    if (likely(doubled_longprod == doubleprod)) {\n        {{ goto_exit(props, exit_result_ok_clong, \"longprod\") }}\n    } else {\n        const double diff = doubled_longprod - doubleprod;\n        const double absdiff = diff >= 0.0 ? diff : -diff;\n        const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;\n\n        if (likely(32.0 * absdiff <= absprod)) {\n            {{ goto_exit(props, exit_result_ok_clong, \"longprod\") }}\n        }\n    }\n{% elif operator == \"//\" or nb_slot == \"nb_divide\" %}\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        {{ goto_exit(props, exit_result_ok_clong, \"a_div_b\") }}\n    }\n{% elif operator==\"/\" and \"true_div\" in nb_slot %}\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"division by zero\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n{% if bool_mode %}\n    {{ goto_exit(props, exit_result_ok_cbool, \"a == 0\") }}\n    {% set fall_through_needed = 0 %}\n{% else %}\n    if (a == 0) {\n        if (b < 0) {\n            {{ goto_exit(props, exit_result_ok_const_float_minus_0_0) }}\n        } else {\n            {{ goto_exit(props, exit_result_ok_const_float_0_0) }}\n        }\n    }\n\n/* May need to resort to LONG code, which we currently do not\n * specialize yet. TODO: Once we do that, call it here instead.\n */\n#if DBL_MANT_DIG < WIDTH_OF_ULONG\n    if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {\n    } else\n#endif\n    {\n        double r = (double)a / (double)b;\n\n        {{ goto_exit(props, exit_result_ok_cfloat, \"r\") }}\n    }\n{% endif %}\n{% elif operator==\"%\" %}\n    /* TODO: Isn't this a very specific value only, of which we could\n     * hardcode the constant result. Not sure how well the C compiler\n     * optimizes UNARY_NEG_WOULD_OVERFLOW to this, but dividing by\n     * -1 has to be rare anyway.\n     */\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long r = a % b;\n\n        // Sign handling.\n        if (r != 0 && ((b ^ r) < 0) ) {\n            r += b;\n        }\n\n        {{ goto_exit(props, exit_result_ok_clong, \"r\") }}\n    }\n{% elif operator in \"|^&\" %}\n    const long r = a {{operator}} b;\n\n    {{ goto_exit(props, exit_result_ok_clong, \"r\") }}\n    {% set fall_through_needed = 0 %}\n{% elif operator == \"<<\" %}\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        {{ goto_exit(props, exit_result_ok_left) }}\n    } else if (b >= LONG_BIT) {\n        PyObject *operand1_long = PyLong_FromLong(a);\n        PyObject *operand2_long = PyLong_FromLong(b);\n\n        // TODO: Change this to using CLONG once we specialize that too.\n        PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n        Py_DECREF(operand1_long);\n        Py_DECREF(operand2_long);\n\n        {{ goto_exit(props, exit_result_object, \"r\") }}\n    } else {\n        long c = a << b;\n\n        if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {\n            PyObject *operand1_long = PyLong_FromLong(a);\n            PyObject *operand2_long = PyLong_FromLong(b);\n\n            // TODO: Change this to using CLONG once we specialize that too.\n            PyObject *r = _BINARY_OPERATION_LSHIFT_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n            Py_DECREF(operand1_long);\n            Py_DECREF(operand2_long);\n\n            {{ goto_exit(props, exit_result_object, \"r\") }}\n        } else {\n            {{ goto_exit(props, exit_result_ok_clong, \"c\") }}\n        }\n    }\n    {% set fall_through_needed = 0 %}\n{% elif operator == \">>\" %}\n    if (unlikely(b < 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ValueError, \"negative shift count\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    /* Short cut for zero shift or shifting zero. */\n    if (a == 0 || b == 0) {\n        {{ goto_exit(props, exit_result_ok_left) }}\n    } else if (b >= LONG_BIT) {\n        if (a < 0) {\n            {{ goto_exit(props, exit_result_ok_const_int_neg_1) }}\n        } else {\n            {{ goto_exit(props, exit_result_ok_const_int_0) }}\n        }\n    } else {\n        long r = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);\n\n        {{ goto_exit(props, exit_result_ok_clong, \"r\") }}\n    }\n    {% set fall_through_needed = 0 %}\n{% elif operator == \"**\" %}\n    if (b < 0) {\n        // TODO: Use CFLOAT once available.\n        PyObject *operand1_float = MAKE_FLOAT_FROM_DOUBLE(a);\n        PyObject *operand2_float = MAKE_FLOAT_FROM_DOUBLE(b);\n\n        PyObject *r = _BINARY_OPERATION_POW_OBJECT_FLOAT_FLOAT(operand1_float, operand2_float);\n\n        Py_DECREF(operand1_float);\n        Py_DECREF(operand2_float);\n\n        {{ goto_exit(props, exit_result_object, \"r\") }}\n    } else {\n        long temp = a;\n        long ix = 1;\n        long bb = b;\n\n        while (bb > 0) {\n            long prev = ix;\n            if (bb & 1) {\n                ix = (unsigned long)ix * temp;\n                if (temp == 0) {\n                    break;\n                }\n                if (ix / temp != prev) {\n                    PyObject *operand1_long = PyLong_FromLong(a);\n                    PyObject *operand2_long = PyLong_FromLong(b);\n\n                    PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                    Py_DECREF(operand1_long);\n                    Py_DECREF(operand2_long);\n\n                    {{ goto_exit(props, exit_result_object, \"r\") }}\n                }\n            }\n            bb >>= 1;\n            if (bb==0) {\n                break;\n            }\n            prev = temp;\n            temp = (unsigned long)temp * temp;\n\n            if (prev != 0 && temp / prev != prev) {\n                PyObject *operand1_long = PyLong_FromLong(a);\n                PyObject *operand2_long = PyLong_FromLong(b);\n\n                PyObject *r = _BINARY_OPERATION_POW_OBJECT_LONG_LONG(operand1_long, operand2_long);\n\n                Py_DECREF(operand1_long);\n                Py_DECREF(operand2_long);\n\n                {{ goto_exit(props, exit_result_object, \"r\") }}\n            }\n        }\n\n        {{ goto_exit(props, exit_result_ok_clong, \"ix\") }}\n    }\n    {% set fall_through_needed = 0 %}\n{% elif operator == \"divmod\" %}\n    if (unlikely(b == 0)) {\n        PyThreadState *tstate = PyThreadState_GET();\n\n        SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError, \"integer division or modulo by zero\");\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n\n    if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {\n        long a_div_b = a / b;\n        long a_mod_b = (long)(a - (unsigned long)a_div_b * b);\n\n        if (a_mod_b && (b ^ a_mod_b) < 0) {\n            a_mod_b += b;\n            a_div_b -= 1;\n        }\n\n        PyObject *r = Py_BuildValue(\"(ll)\", a_div_b, a_mod_b);\n        {{ goto_exit(props, exit_result_object, \"r\") }}\n    }\n{% else %}\n#error Operator {{operator}} not implemented\n{% endif %}\n{% if fall_through_needed %}\n    {\n        PyObject *operand1_object = {{ left.getAsObjectValueExpression(operand1) }};\n        PyObject *operand2_object = {{ right.getAsObjectValueExpression(operand2) }};\n\n        PyObject *r = {{ left.getSlotCallExpression(nb_slot, \"PyLong_Type.tp_as_number->\"+nb_slot, \"operand1_object\", \"operand2_object\") }};\n        assert(r != Py_NotImplemented);\n\n        {{ left.releaseAsObjectValueStatement(\"operand1_object\") }}\n        {{ right.releaseAsObjectValueStatement(\"operand2_object\") }}\n\n        {{ goto_exit(props, exit_result_object, \"r\") }}\n    }\n{% endif %}\n{% endmacro %}\n\n{% macro int_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    {% set bool_mode = target and target.type_name in (\"nuitka_bool\", \"nbool\") %}\n\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED bool cbool_result;\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n    NUITKA_MAY_BE_UNUSED double cfloat_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n    {{ int_core(props, operator, nb_slot, bool_mode, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception, \"exit_result_ok_cbool\", \"exit_result_ok_clong\", \"exit_result_ok_cfloat\", \"exit_result_object\", \"exit_result_ok_left\", \"exit_result_ok_const_int_0\", \"exit_result_ok_const_int_neg_1\", \"exit_result_ok_const_float_0_0\", \"exit_result_ok_const_float_minus_0_0\") }}\n\n{# // {{ props }} #}\n\n{% if \"exit_result_ok_cbool\" in props[\"exits\"] %}\nexit_result_ok_cbool:\n{% if target %}\n    {{ target.getAssignFromBoolExpressionCode(result, \"cbool_result\", give_ref=1) }}\n{% else %}\n    {# TODO: Check the reference we were handed down. #}\n\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    {{ operand1 }} = PyInt_FromLong(cbool_result);\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_clong\" in props[\"exits\"] %}\nexit_result_ok_clong:\n{% if target %}\n    {{ (target if target != object_desc else int_desc).getAssignFromLongExpressionCode(result, \"clong_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down. #}\n\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    {{ operand1 }} = PyInt_FromLong(clong_result);\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_cfloat\" in props[\"exits\"] %}\nexit_result_ok_cfloat:\n{% if target %}\n    {{ target.getAssignFromFloatExpressionCode(result, \"cfloat_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down. #}\n\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ left.getAssignFromFloatExpressionCode(operand1, \"cfloat_result\") }}\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_left\" in props[\"exits\"] %}\nexit_result_ok_left:\n{% if target %}\n    {{ target.getAssignConversionCode(result, left, operand1) }}\n{% endif %}\n    {# Nothing to do in case of in-place. #}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_object\" in props[\"exits\"] %}\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_int_0\" in props[\"exits\"] %}\n{{ constant_int_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_int_0\", 0, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_int_neg_1\" in props[\"exits\"] %}\n{{ constant_int_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_int_neg_1\", -1, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_float_0_0\" in props[\"exits\"] %}\n{{ constant_float_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_float_0_0\", 0.0, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_float_minus_0_0\" in props[\"exits\"] %}\n{{ constant_float_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_float_minus_0_0\", -0.0, exit_result_ok) }}\n{% endif %}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsList.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro list_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n{% if nb_slot == \"nb_add\" %}\n{% if left.type_name == \"list\" == right.type_name %}\n    PyObject *x = LIST_CONCAT({{ operand1 }}, {{ operand2 }});\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_concat\", \"PyList_Type.tp_as_sequence->sq_concat\", operand1, operand2) }};\n{% endif %}\n{% elif nb_slot == \"nb_multiply\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_repeat\", \"PyList_Type.tp_as_sequence->sq_repeat\", operand1, operand2) }};\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyList_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n{% endif %}\n    assert(x != Py_NotImplemented);\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsLong.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit, constant_long_exit_target, constant_int_exit_target %}\n{% from 'HelperLongTools.c.j2' import declare_long_access with context %}\n{% macro long_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#endif\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n    NUITKA_MAY_BE_UNUSED long clong_result;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n{% if operator == \"+\" %}\n    {{ declare_long_access(left, operand1) }}\n    {{ declare_long_access(right, operand2) }}\n\n    if ({{ left.getLongValueDigitCountExpression(\"operand1\")}} <= 1 && {{ right.getLongValueDigitCountExpression(\"operand2\")}} <= 1) {\n        long r = {{ left.getLongValueMediumValueExpression(\"operand1\") }} + {{ right.getLongValueMediumValueExpression(\"operand2\") }};\n\n{% if target == None and left.hasReferenceCounting() %}\n        if (Py_REFCNT({{operand1}}) == 1) {\n            Nuitka_LongUpdateFromCLong(&{{operand1}}, r);\n            {{ goto_exit(props, \"exit_result_ok\") }}\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            {{ goto_exit(props, \"exit_result_object\", \"obj\") }}\n        }\n{% endif %}\n        {{ goto_exit(props, \"exit_result_ok_clong\", \"r\") }}\n    }\n\n{% if target == None and left.hasReferenceCounting() %}\n    if (Py_REFCNT({{operand1}}) == 1) {\n        digit const *b_digits = {{ right.getLongValueDigitsPointerExpression(\"operand2\") }};\n        Py_ssize_t b_digit_count = {{ right.getLongValueDigitCountExpression(\"operand2\") }};\n\n        bool a_negative = {{ left.getLongValueIsNegativeTestExpression(\"operand1\") }};\n        bool b_negative = {{ right.getLongValueIsNegativeTestExpression(\"operand2\") }};\n\n        if (a_negative) {\n            if (b_negative) {\n                {{ operand1 }} = _Nuitka_LongAddInplaceDigits({{ operand1 }}, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative({{ operand1 }});\n            } else {\n                {# Reversed operands order means sign inversion. #}\n                {{ operand1 }} = _Nuitka_LongSubInplaceDigits({{ operand1 }}, b_digits, b_digit_count, -1);\n            }\n        } else {\n            if (b_negative) {\n                {{ operand1 }} = _Nuitka_LongSubInplaceDigits({{ operand1 }}, b_digits, b_digit_count, 1);\n            } else {\n                {{ operand1 }} = _Nuitka_LongAddInplaceDigits({{ operand1 }}, b_digits, b_digit_count);\n            }\n        }\n\n        {{ goto_exit(props, \"exit_result_ok\") }}\n    }\n{% endif %}\n    {\n        {# TODO: Only LONG result is done here #}\n        PyLongObject *z;\n\n        digit const *a_digits = {{ left.getLongValueDigitsPointerExpression(\"operand1\") }};\n        Py_ssize_t a_digit_count = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        bool a_negative = {{ left.getLongValueIsNegativeTestExpression(\"operand1\") }};\n        digit const *b_digits = {{ right.getLongValueDigitsPointerExpression(\"operand2\") }};\n        Py_ssize_t b_digit_count = {{ right.getLongValueDigitCountExpression(\"operand2\") }};\n        bool b_negative = {{ right.getLongValueIsNegativeTestExpression(\"operand2\") }};\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n                Nuitka_LongFlipSign(z);\n            } else {\n                {# Reversed operands order. #}\n                z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);\n            }\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        {{ goto_exit(props, \"exit_result_object\", \"(PyObject *)z\") }}\n    }\n{% elif operator == \"-\" %}\n    {{ declare_long_access(left, operand1) }}\n    {{ declare_long_access(right, operand2) }}\n\n    if ({{ left.getLongValueDigitCountExpression(\"operand1\")}} <= 1 && {{ right.getLongValueDigitCountExpression(\"operand2\")}} <= 1) {\n        long r = {{ left.getLongValueMediumValueExpression(\"operand1\") }} - {{ right.getLongValueMediumValueExpression(\"operand2\") }};\n\n{% if target == None and left.hasReferenceCounting() %}\n        if (Py_REFCNT({{operand1}}) == 1) {\n            Nuitka_LongUpdateFromCLong(&{{operand1}}, r);\n            {{ goto_exit(props, \"exit_result_ok\") }}\n        } else {\n            PyObject *obj = Nuitka_LongFromCLong(r);\n\n            {{ goto_exit(props, \"exit_result_object\", \"obj\") }}\n        }\n{% endif %}\n        {{ goto_exit(props, \"exit_result_ok_clong\", \"r\") }}\n    }\n\n{% if target == None %}\n    if (Py_REFCNT({{operand1}}) == 1) {\n        digit const *b_digits = {{ right.getLongValueDigitsPointerExpression(\"operand2\") }};\n        Py_ssize_t b_digit_count = {{ right.getLongValueDigitCountExpression(\"operand2\") }};\n\n        bool a_negative = {{ left.getLongValueIsNegativeTestExpression(\"operand1\") }};\n        bool b_negative = {{ right.getLongValueIsNegativeTestExpression(\"operand2\") }};\n\n        if (a_negative) {\n            if (b_negative) {\n                {# Reversed operands order means sign inversion. #}\n                {{ operand1 }} = _Nuitka_LongSubInplaceDigits({{ operand1 }}, b_digits, b_digit_count, -1);\n            } else {\n                {{ operand1 }} = _Nuitka_LongAddInplaceDigits({{ operand1 }}, b_digits, b_digit_count);\n                Nuitka_LongSetSignNegative({{ operand1 }});\n            }\n        } else {\n            if (b_negative) {\n                {{ operand1 }} = _Nuitka_LongAddInplaceDigits({{ operand1 }}, b_digits, b_digit_count);\n            } else {\n                {{ operand1 }} = _Nuitka_LongSubInplaceDigits({{ operand1 }}, b_digits, b_digit_count, 1);\n            }\n        }\n\n        {{ goto_exit(props, \"exit_result_ok\") }}\n    }\n{% endif %}\n    {\n        {# TODO: Only LONG result is done here #}\n        PyLongObject *z;\n\n        digit const *a_digits = {{ left.getLongValueDigitsPointerExpression(\"operand1\") }};\n        Py_ssize_t a_digit_count = {{ left.getLongValueDigitCountExpression(\"operand1\") }};\n        bool a_negative = {{ left.getLongValueIsNegativeTestExpression(\"operand1\") }};\n        digit const *b_digits = {{ right.getLongValueDigitsPointerExpression(\"operand2\") }};\n        Py_ssize_t b_digit_count = {{ right.getLongValueDigitCountExpression(\"operand2\") }};\n        bool b_negative = {{ right.getLongValueIsNegativeTestExpression(\"operand2\") }};\n\n        if (a_negative) {\n            if (b_negative) {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n\n            Nuitka_LongFlipSign(z);\n        } else {\n            if (b_negative) {\n                z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            } else {\n                z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);\n            }\n        }\n\n        {{ goto_exit(props, \"exit_result_object\", \"(PyObject *)z\") }}\n    }\n{% else %}\n    {# TODO: Could and should in-line and specialize this for more operators #}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyLong_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n{% endif %}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% if \"exit_result_ok_clong\" in props[\"exits\"] %}\nexit_result_ok_clong:\n{% if target %}\n    {{ (target if target != object_desc else long_desc).getAssignFromLongExpressionCode(result, \"clong_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down. #}\n\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    // That's our return value then. As we use a dedicated variable, it's\n    // OK that way.\n    {{ operand1 }} = PyLong_FromLong(clong_result);\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n{% endif %}\n\n{% if \"exit_result_ok_const_long_0\" in props[\"exits\"] %}\n{{ constant_long_exit_target(props, target, result, left, operand1, \"exit_result_ok_const_long_0\", 0, exit_result_ok) }}\n{% endif %}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsSet.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro set_slot(props, operator, nb_slot, nb_inplace_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n    {% set slot = nb_inplace_slot or nb_slot %}\n    PyObject *x = {{ left.getSlotCallExpression(slot, \"PySet_Type.tp_as_number->\" + slot, operand1, operand2) }};\n\n    assert(x != Py_NotImplemented);\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsStr.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro str_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n{% if nb_slot == \"nb_add\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_concat\", \"PyString_Type.tp_as_sequence->sq_concat\", operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% elif nb_slot == \"nb_multiply\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_repeat\", \"PyString_Type.tp_as_sequence->sq_repeat\", operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% elif nb_slot == \"nb_remainder\" %}\n    PyObject *x = PyString_Format({{ operand1 }}, {{ operand2 }});\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyString_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% endif %}\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro tuple_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n{% if nb_slot == \"nb_add\" %}\n{% if left.type_name == \"tuple\" == right.type_name %}\n    PyObject *x = TUPLE_CONCAT({{ operand1 }}, {{ operand2 }});\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_concat\", \"PyTuple_Type.tp_as_sequence->sq_concat\", operand1, operand2) }};\n{% endif %}\n{% elif nb_slot == \"nb_multiply\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_repeat\", \"PyTuple_Type.tp_as_sequence->sq_repeat\", operand1, operand2) }};\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyTuple_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n{% endif %}\n\n    assert(x != Py_NotImplemented);\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% from 'HelperSlotsCommon.c.j2' import goto_exit %}\n\n{% macro unicode_slot(props, operator, nb_slot, target, left, right, result, operand1, operand2, exit_result_ok, exit_result_exception) %}\n    // Not every code path will make use of all possible results.\n    NUITKA_MAY_BE_UNUSED PyObject *obj_result;\n\n    {# TODO: Could and should in-line and specialize this per slot too. #}\n{% if nb_slot == \"nb_add\" %}\n{% if left.type_name == \"unicode\" == right.type_name %}\n    // TODO: Have this more globally passed in\n    PyThreadState *tstate = PyThreadState_GET();\n\n    PyObject *x = UNICODE_CONCAT(tstate, {{ operand1 }}, {{ operand2 }});\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_concat\", \"PyUnicode_Type.tp_as_sequence->sq_concat\", operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% endif %}\n{% elif nb_slot == \"nb_multiply\" %}\n    PyObject *x = {{ left.getSlotCallExpression(\"sq_repeat\", \"PyUnicode_Type.tp_as_sequence->sq_repeat\", operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% elif nb_slot == \"nb_remainder\" %}\n    PyObject *x = PyUnicode_Format({{ operand1 }}, {{ operand2 }});\n{% else %}\n    PyObject *x = {{ left.getSlotCallExpression(nb_slot, \"PyUnicode_Type.tp_as_number->\" + nb_slot, operand1, operand2) }};\n    assert(x != Py_NotImplemented);\n{% endif %}\n\n    {{ goto_exit(props, \"exit_result_object\", \"x\") }}\n\nexit_result_object:\n    if (unlikely(obj_result == NULL)) {\n        {{ goto_exit(props, exit_result_exception) }}\n    }\n{% if target %}\n    {{ target.getAssignFromObjectExpressionCode(result, \"obj_result\") }}\n{% else %}\n    {# TODO: Check the reference we were handed down and do it in-place really. #}\n    // We got an object handed, that we have to release.\n    Py_DECREF({{ operand1 }});\n\n    {{ operand1 }} = obj_result;\n{% endif %}\n    {{ goto_exit(props, exit_result_ok) }}\n\n{% endmacro %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/containers/Namedtuples.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module is only an abstraction of namedtuple.\n\nIt works around bugs present in some version of Python, and provides extra\nmethods like \"asDict\".\n\"\"\"\n\nfrom collections import namedtuple\n\n\ndef makeNamedtupleClass(name, element_names):\n    # TODO: Have a namedtuple factory that does these things.\n\n    namedtuple_class = namedtuple(name, element_names)\n\n    class DynamicNamedtuple(namedtuple_class):\n        __qualname__ = name\n\n        # Avoids bugs on early Python3.4 and Python3.5 versions.\n        __slots__ = ()\n\n        def asDict(self):\n            return self._asdict()\n\n    DynamicNamedtuple.__name__ = name\n\n    return DynamicNamedtuple\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/containers/OrderedDicts.py",
    "content": "\"\"\" This module is only an abstraction of OrderedDict as present in 2.7 and 3.x.\n\nIt is not in 2.6, for this version we are using the odict.py as mentioned in the\nPEP-0372.\n\nThis can be removed safely after Python2.6 support is dropped (if ever), note\nthat the documentation was removed, as it's not interesting really, being\nredundant to the Python 2.7 documentation.\n\nStarting with Python 3.6, we can safely use the built-in dictionary.\n\"\"\"\n\n#    :copyright: (c) 2008 by Armin Ronacher and PEP 273 authors.\n#    :license: modified BSD license.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#     * Redistributions of source code must retain the above copyright\n#       notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above copyright\n#       notice, this list of conditions and the following disclaimer in the\n#       documentation and/or other materials provided with the distribution.\n#     * Neither the name of the <organization> nor the\n#       names of its contributors may be used to endorse or promote products\n#       derived from this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n# Kay Hayen did some changes for Nuitka, and put everything he added under the same\n# modified BSD license.\n\nfrom nuitka.PythonVersions import python_version\n\ntry:\n    if python_version >= 0x360:\n        OrderedDict = dict\n    else:\n        from collections import OrderedDict\n\nexcept ImportError:\n    # This is for Python 2.6 only.\n    # pylint: disable=I0021,protected-access,undefined-variable\n\n    assert python_version < 0x270\n\n    from copy import deepcopy\n    from itertools import imap, izip\n\n    missing = object()\n\n    class OrderedDict(dict):\n        def __init__(self, *args, **kwargs):\n            dict.__init__(self)\n            self._keys = []\n            self.update(*args, **kwargs)\n\n        def __delitem__(self, key):\n            dict.__delitem__(self, key)\n            self._keys.remove(key)\n\n        def __setitem__(self, key, item):\n            if key not in self:\n                self._keys.append(key)\n            dict.__setitem__(self, key, item)\n\n        def __deepcopy__(self, memo=None):\n            if memo is None:\n                memo = {}\n            d = memo.get(id(self), missing)\n            if d is not missing:\n                return d\n            memo[id(self)] = d = self.__class__()\n            dict.__init__(d, deepcopy(self.items(), memo))\n            d._keys = self._keys[:]\n            return d\n\n        def __getstate__(self):\n            return {\"items\": dict(self), \"keys\": self._keys}\n\n        def __setstate__(self, d):\n            self._keys = d[\"keys\"]\n            dict.update(d[\"items\"])\n\n        def __reversed__(self):\n            return reversed(self._keys)\n\n        def __eq__(self, other):\n            if isinstance(other, OrderedDict):\n                if not dict.__eq__(self, other):\n                    return False\n                return self.items() == other.items()\n            return dict.__eq__(self, other)\n\n        def __ne__(self, other):\n            return not self.__eq__(other)\n\n        def __cmp__(self, other):\n            if isinstance(other, OrderedDict):\n                return cmp(self.items(), other.items())\n            elif isinstance(other, dict):\n                return dict.__cmp__(self, other)\n            return NotImplemented\n\n        @classmethod\n        def fromkeys(cls, iterable, default=None):\n            return cls((key, default) for key in iterable)\n\n        def clear(self):\n            del self._keys[:]\n            dict.clear(self)\n\n        def copy(self):\n            return self.__class__(self)\n\n        def items(self):\n            return zip(self._keys, self.values())\n\n        def iteritems(self):\n            return izip(self._keys, self.itervalues())\n\n        def keys(self):\n            return self._keys[:]\n\n        def iterkeys(self):\n            return iter(self._keys)\n\n        def pop(self, key, default=missing):\n            if default is missing:\n                return dict.pop(self, key)\n            elif key not in self:\n                return default\n            self._keys.remove(key)\n            return dict.pop(self, key, default)\n\n        def popitem(self, key):\n            self._keys.remove(key)\n            return dict.popitem(key)\n\n        def setdefault(self, key, default=None):\n            if key not in self:\n                self._keys.append(key)\n            dict.setdefault(self, key, default)\n\n        def update(self, *args, **kwargs):\n            sources = []\n            if len(args) == 1:\n                if hasattr(args[0], \"iteritems\"):\n                    sources.append(args[0].iteritems())\n                else:\n                    sources.append(iter(args[0]))\n            elif args:\n                raise TypeError(\"expected at most one positional argument\")\n            if kwargs:\n                sources.append(kwargs.iteritems())\n            for iterable in sources:\n                for key, val in iterable:\n                    self[key] = val\n\n        def values(self):\n            return map(self.get, self._keys)\n\n        def itervalues(self):\n            return imap(self.get, self._keys)\n\n        def index(self, item):\n            return self._keys.index(item)\n\n        def byindex(self, item):\n            key = self._keys[item]\n            return (key, dict.__getitem__(self, key))\n\n        def reverse(self):\n            self._keys.reverse()\n\n        def sort(self, *args, **kwargs):\n            self._keys.sort(*args, **kwargs)\n\n        def __repr__(self):\n            return \"OrderedDict(%r)\" % self.items()\n\n        __copy__ = copy\n        __iter__ = iterkeys\n"
  },
  {
    "path": "nuitka/containers/OrderedSets.py",
    "content": "\"\"\" This module is only an abstraction of OrderedSet which is not present in\nPython at all.\n\n\"\"\"\n\ntry:\n    # spell-checker: ignore orderedset\n    from orderedset import OrderedSet\nexcept ImportError:\n    try:\n        from ordered_set import OrderedSet\n    except ImportError:\n        from .OrderedSetsFallback import OrderedSet\n\n\ndef buildOrderedSet(*producers):\n    \"\"\"Helper function to merge multiple producers into one OrderedSet value\"\"\"\n    values = []\n\n    for producer in producers:\n        values.extend(producer)\n\n    return OrderedSet(values)\n"
  },
  {
    "path": "nuitka/containers/OrderedSetsFallback.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module is only an abstraction of OrderedSet which is not present in\nPython at all.\n\nIt was originally downloaded from http://code.activestate.com/recipes/576694/\n\"\"\"\n\n# Copyright 2009 Raymond Hettinger\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n#\n# Note: Kay Hayen did some changes for Nuitka keeping this license. These\n# changes are not improvements, use the original source instead, not this\n# file.\n\n# pylint: disable=redefined-builtin\n\nfrom nuitka.__past__ import MutableSet\n\n\nclass OrderedSet(MutableSet):\n    is_fallback = True\n\n    def __init__(self, iterable=()):\n        self.end = end = []\n        end += (None, end, end)  # sentinel node for doubly linked list\n        self.map = {}  # key --> [key, prev, next]\n        if iterable:\n            self |= iterable\n\n    def __len__(self):\n        return len(self.map)\n\n    def __contains__(self, key):\n        return key in self.map\n\n    def add(self, key):\n        if key not in self.map:\n            end = self.end\n            curr = end[1]\n            curr[2] = end[1] = self.map[key] = [key, curr, end]\n\n    def update(self, keys):\n        for key in keys:\n            self.add(key)\n\n    def discard(self, key):\n        if key in self.map:\n            key, prev, next = self.map.pop(key)\n            prev[2] = next\n            next[1] = prev\n\n    def __iter__(self):\n        end = self.end\n        curr = end[2]\n        while curr is not end:\n            yield curr[0]\n            curr = curr[2]\n\n    def __reversed__(self):\n        end = self.end\n        curr = end[1]\n        while curr is not end:\n            yield curr[0]\n            curr = curr[1]\n\n    def pop(self, last=True):\n        if not self:\n            raise KeyError(\"set is empty\")\n        key = self.end[1][0] if last else self.end[2][0]\n        self.discard(key)\n        return key\n\n    def __repr__(self):\n        if not self:\n            return \"%s()\" % (self.__class__.__name__,)\n        return \"%s(%r)\" % (self.__class__.__name__, list(self))\n\n    def __eq__(self, other):\n        if isinstance(other, OrderedSet):\n            return len(self) == len(other) and list(self) == list(other)\n        return set(self) == set(other)\n\n    def union(self, iterable):\n        result = OrderedSet(self)\n\n        for key in iterable:\n            result.add(key)\n\n        return result\n\n    def index(self, key):\n        if key in self.map:\n            end = self.end\n            curr = self.map[key]\n\n            count = 0\n            while curr is not end:\n                curr = curr[1]\n                count += 1\n\n            return count - 1\n\n        return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/containers/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/distutils/Build.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nuitka python -m build integration \"\"\"\n\nimport contextlib\nimport os\n\nimport setuptools.build_meta\n\nif not hasattr(setuptools.build_meta, \"suppress_known_deprecation\"):\n\n    @contextlib.contextmanager\n    def suppress_known_deprecation():\n        yield\n\nelse:\n    suppress_known_deprecation = setuptools.build_meta.suppress_known_deprecation\n\n\n# reusing private \"build\" package code, pylint: disable=protected-access\nclass NuitkaBuildMetaBackend(setuptools.build_meta._BuildMetaBackend):\n    def build_wheel(\n        self, wheel_directory, config_settings=None, metadata_directory=None\n    ):\n        os.environ[\"NUITKA_TOML_FILE\"] = os.path.join(os.getcwd(), \"pyproject.toml\")\n\n        with suppress_known_deprecation():\n            return self._build_with_temp_dir(\n                [\"bdist_nuitka\"], \".whl\", wheel_directory, config_settings\n            )\n\n\n_BACKEND = NuitkaBuildMetaBackend()\n\nget_requires_for_build_wheel = _BACKEND.get_requires_for_build_wheel\nget_requires_for_build_sdist = _BACKEND.get_requires_for_build_sdist\nprepare_metadata_for_build_wheel = _BACKEND.prepare_metadata_for_build_wheel\nbuild_wheel = _BACKEND.build_wheel\nbuild_sdist = _BACKEND.build_sdist\n\nLEGACY_EDITABLE = getattr(setuptools.build_meta, \"LEGACY_EDITABLE\", False)\n\nif not LEGACY_EDITABLE:\n    get_requires_for_build_editable = _BACKEND.get_requires_for_build_editable\n    prepare_metadata_for_build_editable = _BACKEND.prepare_metadata_for_build_editable\n    build_editable = _BACKEND.build_editable\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/distutils/DistutilCommands.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nuitka distutils integration.\n\n\"\"\"\n\nimport distutils.command.build  # pylint: disable=I0021,import-error,no-name-in-module\nimport distutils.command.install  # pylint: disable=I0021,import-error,no-name-in-module\nimport os\nimport sys\n\nimport wheel.bdist_wheel  # pylint: disable=I0021,import-error,no-name-in-module\n\nfrom nuitka.__past__ import Iterable, unicode\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.Importing import (\n    addMainScriptDirectory,\n    decideModuleSourceRef,\n    flushImportCache,\n    locateModule,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import wheel_logger\nfrom nuitka.utils.Execution import check_call\nfrom nuitka.utils.FileOperations import deleteFile, getFileList, renameFile\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef setupNuitkaDistutilsCommands(dist, keyword, value):\n    # If the user project setup.py includes the key \"build_with_nuitka=True\" all\n    # build operations (build, bdist_wheel, install etc) will run via Nuitka.\n    # pylint: disable=unused-argument\n\n    if not value:\n        return\n\n    dist.cmdclass = dist.cmdclass or {}  # Ensure is a dict\n    dist.cmdclass[\"build\"] = build\n    dist.cmdclass[\"install\"] = install\n    dist.cmdclass[\"bdist_wheel\"] = bdist_nuitka\n\n\n# TODO: Duplicated from test code, should be in utils probably.\ndef addToPythonPath(python_path, in_front=False):\n    if type(python_path) in (tuple, list):\n        python_path = os.pathsep.join(python_path)\n\n    if python_path:\n        if \"PYTHONPATH\" in os.environ:\n            if in_front:\n                os.environ[\"PYTHONPATH\"] = (\n                    python_path + os.pathsep + os.environ[\"PYTHONPATH\"]\n                )\n            else:\n                os.environ[\"PYTHONPATH\"] += os.pathsep + python_path\n        else:\n            os.environ[\"PYTHONPATH\"] = python_path\n\n\n# Class name enforced by distutils, must match the command name.\n# Required by distutils, used as command name, pylint: disable=invalid-name\nclass build(distutils.command.build.build):\n    # pylint: disable=attribute-defined-outside-init\n    def run(self):\n        wheel_logger.info(\"Specified packages: %s.\" % self.distribution.packages)\n        wheel_logger.info(\"Specified modules: %s.\" % self.distribution.py_modules)\n\n        self.compile_packages = self.distribution.packages or []\n        self.py_modules = self.distribution.py_modules or []\n\n        # Determine impact from entry points, might have to add modules from\n        # there.\n        self.script_module_names = OrderedSet()\n        if self.distribution.entry_points is not None:\n            for group, script_specs in self.distribution.entry_points.items():\n                for script_spec in script_specs:\n                    try:\n                        script_module_name = (\n                            script_spec.split(\"=\", 1)[1].strip().split(\":\")[0]\n                        )\n                        # Catch all the things, pylint: disable=broad-except\n                    except Exception as e:\n                        wheel_logger.warning(\n                            \"Problem parsing '%s' script specification in '%s' due to %s\"\n                            % (script_spec, group, e)\n                        )\n\n                    self.script_module_names.add(ModuleName(script_module_name))\n\n        if not self.compile_packages and not self.py_modules:\n            wheel_logger.sysexit(\n                \"No modules or packages specified, aborting. Did you provide packages in 'setup.cfg' or 'setup.py'?\"\n            )\n\n        # Python2 does not allow super on this old style class.\n        distutils.command.build.build.run(self)\n\n        self._build(os.path.abspath(self.build_lib))\n\n    def _findBuildTasks2(self):\n        \"\"\"\n        Helper for _build\n        Returns list containing bool (is_package) and module_names\n\n        Algorithm for finding distinct packages:\n        1) Take minimum package\n        2) Find related packages that start with this name\n        3) Add this to the list to return, then repeat steps 1 & 2\n           until no more packages exist\n\n        \"\"\"\n\n        builds = []\n\n        # Namespace packages can use / rather than dots.\n        py_packages = [\n            ModuleName(m.replace(\"/\", \".\")) for m in sorted(set(self.compile_packages))\n        ]\n        py_modules = [ModuleName(m) for m in sorted(set(self.py_modules))]\n\n        for script_module_name in self.script_module_names:\n            script_module_filename = locateModule(\n                module_name=script_module_name, parent_package=None, level=0\n            )[1]\n\n            if script_module_filename is None:\n                wheel_logger.sysexit(\n                    \"Error, failed to locate script containing module '%s'\"\n                    % script_module_name\n                )\n\n            # Decide package or module.\n            (\n                _main_added,\n                is_package,\n                _is_namespace,\n                _source_ref,\n                _source_filename,\n            ) = decideModuleSourceRef(\n                filename=script_module_filename,\n                module_name=script_module_name,\n                is_main=False,\n                is_fake=False,\n                logger=wheel_logger,\n            )\n\n            if is_package:\n                py_packages.append(script_module_name)\n            else:\n                py_modules.append(script_module_name)\n\n        # Plain modules if they are not in packages to build.\n        builds.extend(\n            (False, current_module)\n            for current_module in py_modules\n            if not current_module.hasOneOfNamespaces(py_packages)\n        )\n\n        while py_packages:\n            current_package = min(py_packages)\n\n            py_packages = [\n                p for p in py_packages if not p.hasNamespace(current_package)\n            ]\n            builds.append((True, current_package))\n\n        return builds\n\n    def _findBuildTasks(self):\n        builds = self._findBuildTasks2()\n        result = []\n\n        for _is_package, module_name_orig in builds:\n            _module_name, main_filename, module_kind, finding = locateModule(\n                module_name=module_name_orig,\n                parent_package=None,\n                level=0,\n            )\n\n            if os.path.isdir(main_filename):\n                if not getFileList(main_filename, only_suffixes=(\".py\",)):\n                    wheel_logger.info(\n                        \"Skipping '%s' from Nuitka compilation due to containing no Python code.\"\n                        % module_name_orig\n                    )\n                    continue\n\n            # Handle extension modules already compiled. They are either to be replaced, or\n            # they are included as they are, because there is no source, then the task can\n            # be skipped.\n            if module_kind == \"extension\":\n                main_filename_away = main_filename + \".away\"\n                renameFile(main_filename, main_filename_away)\n\n                flushImportCache()\n\n                _module_name, main_filename, module_kind, finding = locateModule(\n                    module_name=module_name_orig,\n                    parent_package=None,\n                    level=0,\n                )\n\n                if finding != \"not-found\":\n                    deleteFile(main_filename_away, must_exist=True)\n                else:\n                    renameFile(main_filename_away, main_filename)\n                    continue\n\n            result.append((_is_package, module_name_orig))\n\n        return result\n\n    @staticmethod\n    def _parseOptionsEntry(option, value):\n        option = \"--\" + option.lstrip(\"-\")\n\n        if type(value) is tuple and len(value) == 2 and value[0] == \"setup.py\":\n            value = value[1]\n\n        if value is None or value == \"\":\n            yield option\n        elif isinstance(value, bool):\n            yield \"--\" + (\"no\" if not value else \"\") + option.lstrip(\"-\")\n        elif isinstance(value, Iterable) and not isinstance(\n            value, (unicode, bytes, str)\n        ):\n            for val in value:\n                yield \"%s=%s\" % (option, val)\n        else:\n            yield \"%s=%s\" % (option, value)\n\n    def _build(self, build_lib):\n        # High complexity, pylint: disable=too-many-branches,too-many-locals\n\n        old_dir = os.getcwd()\n\n        # Let's use the python source files in the build_lib since these should\n        # get copied over.\n        os.chdir(build_lib)\n\n        if self.distribution.package_dir and \"\" in self.distribution.package_dir:\n            main_package_dir = os.path.join(\n                build_lib, self.distribution.package_dir.get(\"\")\n            )\n        else:\n            main_package_dir = os.path.abspath(build_lib)\n\n        # Search in the build directory preferably.\n        addMainScriptDirectory(main_package_dir)\n\n        for is_package, module_name in self._findBuildTasks():\n            # Nuitka wants the main package by filename, probably we should stop\n            # needing that.\n            module_name, main_filename, _module_kind, finding = locateModule(\n                module_name=module_name,\n                parent_package=None,\n                level=0,\n            )\n\n            package_name = module_name.getPackageName()\n\n            # Check expectations, e.g. do not compile built-in modules.\n            assert finding == \"absolute\", finding\n\n            if package_name is not None:\n                output_dir = os.path.join(build_lib, package_name.asPath())\n            else:\n                output_dir = build_lib\n\n            command = [\n                sys.executable,\n                \"-m\",\n                \"nuitka\",\n                \"--module\",\n                \"--enable-plugin=pylint-warnings\",\n                \"--output-dir=%s\" % output_dir,\n                \"--nofollow-import-to=*.tests\",\n                \"--remove-output\",\n            ]\n\n            if package_name is not None:\n                package_part, include_package_name = module_name.splitModuleBasename()\n\n                addToPythonPath(\n                    os.path.join(main_package_dir, package_part.asPath()), in_front=True\n                )\n            else:\n                include_package_name = module_name\n\n            if is_package:\n                command.append(\"--include-package=%s\" % include_package_name)\n            else:\n                command.append(\"--include-module=%s\" % include_package_name)\n\n            toml_filename = os.getenv(\"NUITKA_TOML_FILE\")\n            if toml_filename:\n                # Import toml parser like \"build\" module does.\n                if python_version >= 0x3B0:\n                    # stdlib only for 3.11, pylint: disable=I0021,import-error\n                    from tomllib import loads as toml_loads\n                else:\n                    try:\n                        from tomli import loads as toml_loads\n                    except ImportError:\n                        from toml import loads as toml_loads\n\n                # Cannot use FileOperations.getFileContents() here, because of non-Nuitka process\n                # pylint: disable=unspecified-encoding\n\n                with open(toml_filename) as toml_file:\n                    toml_options = toml_loads(toml_file.read())\n\n                for option, value in toml_options.get(\"nuitka\", {}).items():\n                    command.extend(self._parseOptionsEntry(option, value))\n\n                for option, value in (\n                    toml_options.get(\"tool\", {}).get(\"nuitka\", {}).items()\n                ):\n                    command.extend(self._parseOptionsEntry(option, value))\n\n            # Process any extra options from setuptools\n            if \"nuitka\" in self.distribution.command_options:\n                for option, value in self.distribution.command_options[\n                    \"nuitka\"\n                ].items():\n                    command.extend(self._parseOptionsEntry(option, value))\n\n            command.append(main_filename)\n\n            # Adding traces for clarity\n            wheel_logger.info(\n                \"Building: '%s' with command '%s'\" % (module_name.asString(), command)\n            )\n            check_call(command, cwd=build_lib)\n            wheel_logger.info(\n                \"Finished compilation of '%s'.\" % module_name.asString(), style=\"green\"\n            )\n\n        self.build_lib = build_lib\n\n        os.chdir(old_dir)\n\n        # Remove Python code from build folder, that's our job now.\n        for root, _, filenames in os.walk(build_lib):\n            for filename in filenames:\n                fullpath = os.path.join(root, filename)\n\n                if fullpath.lower().endswith((\".py\", \".pyw\", \".pyc\", \".pyo\")):\n                    os.unlink(fullpath)\n\n\n# Required by distutils, used as command name, pylint: disable=invalid-name\nclass install(distutils.command.install.install):\n    # pylint: disable=attribute-defined-outside-init\n    def finalize_options(self):\n        distutils.command.install.install.finalize_options(self)\n        # Ensure the purelib folder is not used\n        self.install_lib = self.install_platlib\n\n\n# Required by distutils, used as command name, pylint: disable=invalid-name\nclass bdist_nuitka(wheel.bdist_wheel.bdist_wheel):\n    def initialize_options(self):\n        # Register the command class overrides above\n        dist = self.distribution\n        dist.cmdclass = dist.cmdclass or {}  # Ensure is a dict\n        dist.cmdclass[\"build\"] = build\n        dist.cmdclass[\"install\"] = install\n\n        wheel.bdist_wheel.bdist_wheel.initialize_options(self)\n\n    # pylint: disable=attribute-defined-outside-init\n    def finalize_options(self):\n        wheel.bdist_wheel.bdist_wheel.finalize_options(self)\n        # Force module to use correct platform in name\n        self.root_is_pure = False\n\n    def write_wheelfile(self, wheelfile_base, generator=None):\n        if generator is None:\n            from nuitka.Version import getNuitkaVersion\n\n            generator = \"Nuitka (%s)\" % getNuitkaVersion()\n\n        wheel.bdist_wheel.bdist_wheel.write_wheelfile(\n            self, wheelfile_base=wheelfile_base, generator=generator\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/distutils/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/finalizations/Finalization.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Finalizations. Last steps directly before code creation is called.\n\nHere the final tasks are executed. Things normally volatile during optimization\ncan be computed here, so the code generation can be quick and doesn't have to\ncheck it many times.\n\n\"\"\"\n\nfrom nuitka.tree import Operations\n\nfrom .FinalizeMarkups import FinalizeMarkups\n\n\ndef prepareCodeGeneration(tree):\n    visitor = FinalizeMarkups()\n    Operations.visitTree(tree, visitor)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/finalizations/FinalizeMarkups.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Finalize the markups\n\nSet flags on functions and classes to indicate if a locals dict is really\nneeded.\n\nSet a flag on loops if they really need to catch Continue and Break exceptions\nor if it can be more simple code.\n\nSet a flag on return statements and functions that require the use of\n\"ReturnValue\" exceptions, or if it can be more simple code.\n\nSet a flag on re-raises of exceptions if they can be simple throws or if they\nare in another context.\n\n\"\"\"\n\nfrom nuitka import Tracing\nfrom nuitka.__past__ import unicode\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.tree.Operations import VisitorNoopMixin\n\nimported_names = OrderedSet()\n\n\ndef getImportedNames():\n    return imported_names\n\n\nclass FinalizeMarkups(VisitorNoopMixin):\n    def onEnterNode(self, node):\n        try:\n            self._onEnterNode(node)\n        except Exception:\n            Tracing.printError(\n                \"Problem with %r at %s\"\n                % (node, node.getSourceReference().getAsString())\n            )\n            raise\n\n    def _onEnterNode(self, node):\n        # This has many different things it deals with, so there need to be a\n        # lot of branches and statements, pylint: disable=too-many-branches\n\n        # Also all self specific things have been done on the outside,\n        # pylint: disable=no-self-use\n        if node.isStatementReturn() or node.isStatementGeneratorReturn():\n            search = node\n\n            in_tried_block = False\n\n            # Search up to the containing function, and check for a try/finally\n            # containing the \"return\" statement.\n            search = search.getParentReturnConsumer()\n\n            if (\n                search.isExpressionGeneratorObjectBody()\n                or search.isExpressionCoroutineObjectBody()\n                or search.isExpressionAsyncgenObjectBody()\n            ):\n                if in_tried_block:\n                    search.markAsNeedsGeneratorReturnHandling(2)\n                else:\n                    search.markAsNeedsGeneratorReturnHandling(1)\n\n        if node.isExpressionBuiltinImport() and node.follow_attempted:\n            module_name = node.subnode_name\n\n            if module_name.isCompileTimeConstant():\n                imported_module_name = module_name.getCompileTimeConstant()\n\n                if type(imported_module_name) in (str, unicode):\n                    if imported_module_name:\n                        imported_names.add(imported_module_name)\n\n        if node.isExpressionFunctionCreation():\n            if (\n                not node.getParent().isExpressionFunctionCall()\n                or node.getParent().subnode_function is not node\n            ):\n                node.subnode_function_ref.getFunctionBody().markAsNeedsCreation()\n\n        if node.isExpressionFunctionCall():\n            node.subnode_function.subnode_function_ref.getFunctionBody().markAsDirectlyCalled()\n\n        if node.isExpressionFunctionRef():\n            function_body = node.getFunctionBody()\n            parent_module = function_body.getParentModule()\n\n            node_module = node.getParentModule()\n            if node_module is not parent_module:\n                function_body.markAsCrossModuleUsed()\n\n                node_module.addCrossUsedFunction(function_body)\n\n        if node.isStatementAssignmentVariable():\n            target_var = node.getVariable()\n            assign_source = node.subnode_source\n\n            if assign_source.isExpressionOperationBinary():\n                left_arg = assign_source.subnode_left\n\n                if left_arg.isExpressionVariableRefOrTempVariableRef():\n                    if assign_source.subnode_left.getVariable() is target_var:\n                        if assign_source.isInplaceSuspect():\n                            node.markAsInplaceSuspect()\n                elif left_arg.isExpressionLocalsVariableRefOrFallback():\n                    # TODO: This might be bad.\n                    assign_source.removeMarkAsInplaceSuspect()\n\n        if python_version < 0x300 and node.isStatementPublishException():\n            node.getParentStatementsFrame().markAsFrameExceptionPreserving()\n\n        if python_version >= 0x300:\n            if (\n                node.isExpressionYield()\n                or node.isExpressionYieldFrom()\n                or node.isExpressionYieldFromAwaitable()\n            ):\n                search = node.getParent()\n\n                # TODO: This is best achieved by having different yield nodes\n                # depending on containing function kind to begin with and should\n                # be discovered during the build.\n\n                while (\n                    not search.isExpressionGeneratorObjectBody()\n                    and not search.isExpressionCoroutineObjectBody()\n                    and not search.isExpressionAsyncgenObjectBody()\n                ):\n                    last_search = search\n                    search = search.getParent()\n\n                    if (\n                        search.isStatementTry()\n                        and last_search == search.subnode_except_handler\n                    ):\n                        node.markAsExceptionPreserving()\n                        break\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/finalizations/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/DependsExe.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Interface to depends.exe on Windows.\n\nWe use depends.exe to investigate needed DLLs of Python DLLs.\n\n\"\"\"\n\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import assumeYesForDownloads\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.Download import getCachedDownload\nfrom nuitka.utils.Execution import executeProcess, withEnvironmentVarOverridden\nfrom nuitka.utils.FileOperations import (\n    deleteFile,\n    getExternalUsePath,\n    getFileContentByLine,\n    getWindowsLongPathName,\n    isFilenameBelowPath,\n    putTextFileContents,\n    withFileLock,\n)\nfrom nuitka.utils.SharedLibraries import getWindowsRunningProcessDLLPaths\nfrom nuitka.utils.Utils import getArchitecture\n\n\ndef getDependsExePath():\n    \"\"\"Return the path of depends.exe (for Windows).\n\n    Will prompt the user to download if not already cached in AppData\n    directory for Nuitka.\n    \"\"\"\n    if getArchitecture() == \"x86\":\n        depends_url = \"https://dependencywalker.com/depends22_x86.zip\"\n    else:\n        depends_url = \"https://dependencywalker.com/depends22_x64.zip\"\n\n    return getCachedDownload(\n        name=\"dependency walker\",\n        url=depends_url,\n        is_arch_specific=getArchitecture(),\n        binary=\"depends.exe\",\n        flatten=True,\n        specificity=\"\",  # Note: If there ever was an update, put version here.\n        message=\"\"\"\\\nNuitka will make use of Dependency Walker (https://dependencywalker.com) tool\nto analyze the dependencies of Python extension modules.\"\"\",\n        reject=\"Nuitka does not work in --standalone or --onefile on Windows without.\",\n        assume_yes_for_downloads=assumeYesForDownloads(),\n    )\n\n\ndef _attemptToFindNotFoundDLL(dll_filename):\n    \"\"\"Some heuristics and tricks to find DLLs that dependency walker did not find.\"\"\"\n\n    # Lets attempt to find it on currently loaded DLLs, this typically should\n    # find the Python DLL.\n    currently_loaded_dlls = getWindowsRunningProcessDLLPaths()\n\n    if dll_filename in currently_loaded_dlls:\n        return currently_loaded_dlls[dll_filename]\n\n    dll_filename = os.path.join(\n        os.environ[\"SYSTEMROOT\"],\n        \"SysWOW64\" if getArchitecture() == \"x86_64\" else \"System32\",\n        dll_filename,\n    )\n    dll_filename = os.path.normcase(dll_filename)\n\n    if os.path.exists(dll_filename):\n        return dll_filename\n\n    return None\n\n\ndef _parseDependsExeOutput2(lines):\n    # Many cases to deal with, pylint: disable=too-many-branches\n\n    result = OrderedSet()\n\n    inside = False\n    first = False\n\n    for line in lines:\n        if \"| Module Dependency Tree |\" in line:\n            inside = True\n            first = True\n            continue\n\n        if not inside:\n            continue\n\n        if \"| Module List |\" in line:\n            break\n\n        if \"]\" not in line:\n            continue\n\n        dll_filename = line[line.find(\"]\") + 2 :].rstrip()\n        dll_filename = os.path.normcase(dll_filename)\n\n        if isFilenameBelowPath(\n            path=os.path.join(os.environ[\"SYSTEMROOT\"], \"WinSxS\"), filename=dll_filename\n        ):\n            continue\n\n        # Skip DLLs that failed to load, apparently not needed anyway.\n        if \"E\" in line[: line.find(\"]\")]:\n            continue\n\n        # Skip missing DLLs, apparently not needed anyway, but we can still\n        # try a few tricks\n        if \"?\" in line[: line.find(\"]\")]:\n            # One exception are \"PythonXY.DLL\", we try to find them from Windows folder.\n            if dll_filename.startswith(\"python\") and dll_filename.endswith(\".dll\"):\n                dll_filename = _attemptToFindNotFoundDLL(dll_filename)\n\n                if dll_filename is None:\n                    continue\n            else:\n                continue\n\n        # The executable itself is of course exempted. We cannot check its path\n        # because depends.exe mistreats unicode paths.\n        if first:\n            first = False\n            continue\n\n        dll_filename = os.path.abspath(dll_filename)\n        dll_filename = getWindowsLongPathName(dll_filename)\n\n        dll_name = os.path.basename(dll_filename)\n\n        # Ignore this runtime DLL of Python2, will be coming via manifest.\n        # spell-checker: ignore msvcr90\n        if dll_name in (\"msvcr90.dll\",):\n            continue\n\n        # Ignore API DLLs, they can come in from PATH, but we do not want to\n        # include them.\n        if dll_name.startswith(\"api-ms-win-\"):\n            continue\n\n        # Ignore UCRT runtime, this must come from OS, spell-checker: ignore ucrtbase\n        if dll_name == \"ucrtbase.dll\":\n            continue\n\n        assert os.path.isfile(dll_filename), (dll_filename, line)\n\n        result.add(os.path.normcase(os.path.abspath(dll_filename)))\n\n    return result\n\n\ndef parseDependsExeOutput(filename):\n    return _parseDependsExeOutput2(getFileContentByLine(filename, encoding=\"latin1\"))\n\n\ndef detectDLLsWithDependencyWalker(binary_filename, source_dir, scan_dirs):\n    dwp_filename = os.path.join(source_dir, os.path.basename(binary_filename) + \".dwp\")\n    output_filename = os.path.join(\n        source_dir, os.path.basename(binary_filename) + \".depends\"\n    )\n\n    # User query should only happen once if at all.\n    with withFileLock(\n        \"Finding out dependency walker path and creating DWP file for %s\"\n        % binary_filename\n    ):\n        depends_exe = getDependsExePath()\n\n        # Note: Do this under lock to avoid forked processes to hold\n        # a copy of the file handle on Windows.\n        putTextFileContents(\n            dwp_filename,\n            contents=\"\"\"\\\nSxS\n%(scan_dirs)s\n\"\"\"\n            % {\n                \"scan_dirs\": \"\\n\".join(\n                    \"UserDir %s\" % getExternalUsePath(dirname) for dirname in scan_dirs\n                )\n            },\n        )\n\n    # Starting the process while locked, so file handles are not duplicated.\n    # TODO: At least exit code should be checked, output goes to a filename,\n    # but errors might be interesting potentially.\n\n    with withEnvironmentVarOverridden(\"PATH\", \"\"):\n        _stdout, _stderr, _exit_code = executeProcess(\n            command=(\n                depends_exe,\n                \"-c\",\n                \"-ot%s\" % output_filename,\n                \"-d:%s\" % dwp_filename,\n                \"-f1\",\n                \"-pa1\",\n                \"-ps1\",\n                getExternalUsePath(binary_filename),\n            ),\n            external_cwd=True,\n        )\n\n    if not os.path.exists(output_filename):\n        inclusion_logger.sysexit(\n            \"Error, 'depends.exe' failed to produce expected output.\"\n        )\n\n    # Opening the result under lock, so it is not getting locked by new processes.\n\n    # Note: Do this under lock to avoid forked processes to hold\n    # a copy of the file handle on Windows.\n    result = parseDependsExeOutput(output_filename)\n\n    deleteFile(output_filename, must_exist=True)\n    deleteFile(dwp_filename, must_exist=True)\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/DllDependenciesCommon.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"DLL dependency scan methods that are shared. \"\"\"\n\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.Importing import locateModule\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.utils.FileOperations import getSubDirectoriesWithDlls\nfrom nuitka.utils.ModuleNames import ModuleName\n\n_ld_library_cache = {}\n\n\ndef getLdLibraryPath(package_name, python_rpaths, original_dir):\n    key = package_name, tuple(python_rpaths), original_dir\n\n    if key not in _ld_library_cache:\n        ld_library_path = OrderedSet()\n        if python_rpaths:\n            ld_library_path.update(python_rpaths)\n\n        ld_library_path.update(getPackageSpecificDLLDirectories(package_name))\n        if original_dir is not None:\n            ld_library_path.add(original_dir)\n\n        _ld_library_cache[key] = ld_library_path\n\n    return _ld_library_cache[key]\n\n\ndef getPackageSpecificDLLDirectories(package_name, consider_plugins=True):\n    scan_dirs = OrderedSet()\n\n    if package_name is not None:\n        package_dir = locateModule(\n            module_name=package_name, parent_package=None, level=0\n        )[1]\n\n        if os.path.isdir(package_dir):\n            scan_dirs.add(package_dir)\n            scan_dirs.update(getSubDirectoriesWithDlls(package_dir))\n\n        if consider_plugins:\n            for plugin_provided_dir in Plugins.getModuleSpecificDllPaths(package_name):\n                if os.path.isdir(plugin_provided_dir):\n                    scan_dirs.add(plugin_provided_dir)\n                    scan_dirs.update(getSubDirectoriesWithDlls(plugin_provided_dir))\n\n    # TODO: Move this to plugins DLLs section.\n    if package_name == \"torchvision\" and consider_plugins:\n        scan_dirs.update(getPackageSpecificDLLDirectories(ModuleName(\"torch\")))\n\n    return scan_dirs\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/DllDependenciesMacOS.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"DLL dependency scan methods for macOS. \"\"\"\n\nimport os\nimport re\nimport sys\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Errors import NuitkaForbiddenDLLEncounter\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonFlavors import isAnacondaPython, isNuitkaPython\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getReportPath,\n    isFilenameBelowPath,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffixes\nfrom nuitka.utils.Json import loadJsonFromFilename\nfrom nuitka.utils.SharedLibraries import (\n    callInstallNameTool,\n    getOtoolDependencyOutput,\n    getOtoolListing,\n)\n\nfrom .DllDependenciesCommon import getLdLibraryPath\n\n# Detected Python rpath is cached.\n_detected_python_rpaths = None\n\n\ndef _detectPythonRpaths():\n    result = []\n\n    if isAnacondaPython() and \"CONDA_PREFIX\" in os.environ:\n        candidate = os.path.normpath(os.path.join(os.environ[\"CONDA_PREFIX\"], \"lib\"))\n\n        if os.path.isdir(candidate):\n            result.append(candidate)\n\n    if isAnacondaPython() and \"CONDA_PYTHON_EXE\" in os.environ:\n        candidate = os.path.normpath(\n            os.path.join(os.path.dirname(os.environ[\"CONDA_PYTHON_EXE\"]), \"..\", \"lib\")\n        )\n\n        if os.path.isdir(candidate):\n            result.append(candidate)\n\n    return tuple(result)\n\n\ndef detectBinaryPathDLLsMacOS(\n    original_dir, binary_filename, package_name, keep_unresolved, recursive\n):\n    assert os.path.exists(binary_filename), binary_filename\n\n    # This is for Anaconda, which puts required libraries of packages in this folder.\n    # do it only once, pylint: disable=global-statement\n    global _detected_python_rpaths\n    if _detected_python_rpaths is None:\n        _detected_python_rpaths = _detectPythonRpaths()\n\n    package_specific_dirs = getLdLibraryPath(\n        package_name=package_name,\n        python_rpaths=_detected_python_rpaths,\n        original_dir=original_dir,\n    )\n\n    # This is recursive potentially and might add more and more.\n    stdout = getOtoolDependencyOutput(\n        filename=binary_filename,\n        package_specific_dirs=package_specific_dirs,\n    )\n    paths = _parseOtoolListingOutput(stdout)\n\n    had_self, resolved_result = _resolveBinaryPathDLLsMacOS(\n        original_dir=original_dir,\n        binary_filename=binary_filename,\n        paths=paths,\n        package_specific_dirs=package_specific_dirs,\n        package_name=package_name,\n    )\n\n    if recursive:\n        merged_result = OrderedDict(resolved_result)\n\n        for sub_dll_filename in resolved_result:\n            _, sub_result = detectBinaryPathDLLsMacOS(\n                original_dir=os.path.dirname(sub_dll_filename),\n                binary_filename=sub_dll_filename,\n                package_name=package_name,\n                recursive=True,\n                keep_unresolved=True,\n            )\n\n            merged_result.update(sub_result)\n\n        resolved_result = merged_result\n\n    if keep_unresolved:\n        return had_self, resolved_result\n    else:\n        return OrderedSet(resolved_result)\n\n\ndef _parseOtoolListingOutput(output):\n    paths = OrderedSet()\n\n    for line in output.split(b\"\\n\")[1:]:\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        if not line:\n            continue\n\n        filename = line.split(\" (\", 1)[0].strip()\n\n        # Ignore dependency from system paths.\n        if not isFilenameBelowPath(\n            path=(\n                \"/usr/lib/\",\n                \"/System/Library/Frameworks/\",\n                \"/System/Library/PrivateFrameworks/\",\n            ),\n            filename=filename,\n        ):\n            paths.add(filename)\n\n    return paths\n\n\ndef _resolveBinaryPathDLLsMacOS(\n    original_dir, binary_filename, paths, package_specific_dirs, package_name\n):\n    # Quite a few variations to consider\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    had_self = False\n\n    result = OrderedDict()\n\n    rpaths = _detectBinaryRPathsMacOS(original_dir, binary_filename)\n    rpaths.update(package_specific_dirs)\n\n    for path in paths:\n        if path.startswith(\"@rpath/\"):\n            # Resolve rpath to just the ones given, first match.\n            for rpath in rpaths:\n                if os.path.exists(os.path.join(rpath, path[7:])):\n                    resolved_path = os.path.normpath(os.path.join(rpath, path[7:]))\n                    break\n            else:\n                # This is only a guess, might be missing package specific directories.\n                resolved_path = os.path.normpath(os.path.join(original_dir, path[7:]))\n        elif path.startswith(\"@loader_path/\"):\n            resolved_path = os.path.normpath(os.path.join(original_dir, path[13:]))\n        elif os.path.basename(path) == os.path.basename(binary_filename):\n            # We ignore the references to itself coming from the library id.\n            continue\n        elif isNuitkaPython() and not os.path.isabs(path) and not os.path.exists(path):\n            # Although Nuitka Python statically links all packages, some of them\n            # have proprietary dependencies that cannot be statically built and\n            # must instead be linked to the python executable. Due to how the\n            # python executable is linked, we end up with relative paths to\n            # dependencies, so we need to scan the Nuitka Python library\n            # directories for a matching dll.\n            link_data = loadJsonFromFilename(os.path.join(sys.prefix, \"link.json\"))\n            for library_dir in link_data[\"library_dirs\"]:\n                candidate = os.path.join(library_dir, path)\n                if os.path.exists(candidate):\n                    resolved_path = os.path.normpath(candidate)\n                    break\n        else:\n            resolved_path = path\n\n        # Some extension modules seem to reference themselves a wrong name,\n        # duplicating their module name into the filename, but that does\n        # not exist.\n        if not os.path.exists(resolved_path) and package_name is not None:\n            parts = os.path.basename(resolved_path).split(\".\")\n\n            if parts[0] == package_name.asString():\n                resolved_path = os.path.join(\n                    os.path.dirname(resolved_path), \".\".join(parts[1:])\n                )\n\n        # Some extension modules seem to reference themselves by a different\n        # extension module name, so use that if it exists.\n        if not os.path.exists(resolved_path) and python_version >= 0x300:\n            so_suffixes = getSharedLibrarySuffixes()[:-1]\n\n            specific_suffix = so_suffixes[0]\n            abi_suffix = so_suffixes[1]\n\n            if resolved_path.endswith(specific_suffix):\n                candidate = resolved_path[: -len(specific_suffix)] + abi_suffix\n            elif resolved_path.endswith(abi_suffix):\n                candidate = resolved_path[: -len(specific_suffix)] + abi_suffix\n            else:\n                candidate = None\n\n            if candidate is not None and os.path.exists(candidate):\n                resolved_path = candidate\n\n        # Sometimes self-dependencies are on a numbered version, but deployed is\n        # one version without it. The macOS just ignores that, and so we do.\n        if not os.path.exists(resolved_path):\n            if os.path.basename(resolved_path) == os.path.basename(binary_filename):\n                resolved_path = binary_filename\n            else:\n                match = re.match(r\"^(.*?)(\\.\\d+)+\\.dylib$\", resolved_path)\n\n                if match:\n                    candidate = match.group(1) + \".dylib\"\n\n                    if os.path.exists(candidate):\n                        resolved_path = candidate\n                    else:\n                        candidate = os.path.join(\n                            original_dir, os.path.basename(candidate)\n                        )\n\n                        if os.path.exists(candidate):\n                            resolved_path = candidate\n                        elif os.path.basename(candidate) == os.path.basename(\n                            binary_filename\n                        ):\n                            # Versioned dependency on itself in non-existent path.\n                            resolved_path = binary_filename\n\n        if not os.path.exists(resolved_path):\n            acceptable, plugin_name = Plugins.isAcceptableMissingDLL(\n                package_name=package_name,\n                filename=binary_filename,\n            )\n\n            # TODO: Missing DLLs that are accepted, are not really forbidden, we\n            # should instead acknowledge them as missing, and treat that properly\n            # in using code.\n            if acceptable is True:\n                raise NuitkaForbiddenDLLEncounter(binary_filename, plugin_name)\n\n            if not path.startswith((\"@\", \"/\")):\n                continue\n\n            inclusion_logger.sysexit(\n                \"Error, failed to find path %s (resolved DLL to %s) for %s from '%s', please report the bug.\"\n                % (path, resolved_path, binary_filename, package_name)\n            )\n\n        # Some libraries depend on themselves.\n        if areSamePaths(binary_filename, resolved_path):\n            had_self = True\n            continue\n\n        result[resolved_path] = path\n\n    return had_self, result\n\n\ndef _detectBinaryRPathsMacOS(original_dir, binary_filename):\n    stdout = getOtoolListing(binary_filename)\n\n    lines = stdout.split(b\"\\n\")\n\n    result = OrderedSet()\n    result.add(original_dir)\n\n    for i, line in enumerate(lines):\n        if line.endswith(b\"cmd LC_RPATH\"):\n            line = lines[i + 2]\n            if str is not bytes:\n                line = line.decode(\"utf8\")\n\n            line = line.split(\"path \", 1)[1]\n            line = line.split(\" (offset\", 1)[0]\n\n            if line.startswith(\"@loader_path\"):\n                line = os.path.join(original_dir, line[13:])\n            elif line.startswith(\"@executable_path\"):\n                continue\n\n            result.add(line)\n\n    return result\n\n\ndef fixupBinaryDLLPathsMacOS(\n    binary_filename, package_name, original_location, standalone_entry_points\n):\n    \"\"\"For macOS, the binary needs to be told to use relative DLL paths\"\"\"\n    try:\n        had_self, rpath_map = detectBinaryPathDLLsMacOS(\n            original_dir=os.path.dirname(original_location),\n            binary_filename=original_location,\n            package_name=package_name,\n            keep_unresolved=True,\n            recursive=False,\n        )\n    except NuitkaForbiddenDLLEncounter:\n        inclusion_logger.info(\"Not copying forbidden DLL '%s'.\" % binary_filename)\n    else:\n        mapping = []\n\n        for resolved_filename, rpath_filename in rpath_map.items():\n            for standalone_entry_point in standalone_entry_points:\n                if resolved_filename == standalone_entry_point.source_path:\n                    dist_path = standalone_entry_point.dest_path\n                    break\n            else:\n                dist_path = None\n\n            if dist_path is None:\n                inclusion_logger.sysexit(\n                    \"\"\"\\\n    Error, problem with dependency scan of '%s' with '%s' please report the bug.\"\"\"\n                    % (getReportPath(original_location), rpath_filename)\n                )\n\n            mapping.append((rpath_filename, \"@executable_path/\" + dist_path))\n\n        if mapping or had_self:\n            callInstallNameTool(\n                filename=binary_filename,\n                mapping=mapping,\n                id_path=os.path.basename(binary_filename) if had_self else None,\n                rpath=None,\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/DllDependenciesPosix.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"DLL dependency scan methods for POSIX (Linux, *BSD, MSYS2).\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonFlavors import isAnacondaPython\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.Execution import executeProcess, withEnvironmentPathAdded\nfrom nuitka.utils.SharedLibraries import getSharedLibraryRPATH\nfrom nuitka.utils.Utils import (\n    isAlpineLinux,\n    isAndroidBasedLinux,\n    isPosixWindows,\n)\n\nfrom .DllDependenciesCommon import getLdLibraryPath\n\n# Detected Python rpath is cached.\n_detected_python_rpath = None\n\n# Cached ldd results.\nldd_result_cache = {}\n\n\ndef detectBinaryPathDLLsPosix(dll_filename, package_name, original_dir):\n    # This is complex, as it also includes the caching mechanism\n    # pylint: disable=too-many-branches\n\n    if ldd_result_cache.get(dll_filename):\n        return ldd_result_cache[dll_filename]\n\n    # Ask \"ldd\" about the libraries being used by the created binary, these\n    # are the ones that interest us.\n\n    # This is the rpath of the Python binary, which will be effective when\n    # loading the other DLLs too. This happens at least for Python installs\n    # on Travis. pylint: disable=global-statement\n    global _detected_python_rpath\n    if _detected_python_rpath is None and not isPosixWindows():\n        _detected_python_rpath = getSharedLibraryRPATH(sys.executable) or False\n\n        if _detected_python_rpath:\n            _detected_python_rpath = _detected_python_rpath.replace(\n                \"$ORIGIN\", os.path.dirname(sys.executable)\n            )\n\n    # Single one, might be wrong for Anaconda, which uses multiple ones on at least\n    # macOS.\n    python_rpaths = (_detected_python_rpath,) if _detected_python_rpath else ()\n\n    # TODO: Actually would be better to pass it as env to the created process instead.\n    with withEnvironmentPathAdded(\n        \"LD_LIBRARY_PATH\",\n        *getLdLibraryPath(\n            package_name=package_name,\n            python_rpaths=python_rpaths,\n            original_dir=original_dir,\n        )\n    ):\n        # TODO: Check exit code, should never fail.\n        stdout, stderr, _exit_code = executeProcess(command=(\"ldd\", dll_filename))\n\n    stderr = b\"\\n\".join(\n        line\n        for line in stderr.splitlines()\n        if not line.startswith(\n            b\"ldd: warning: you do not have execution permission for\"\n        )\n    )\n\n    inclusion_logger.debug(\"ldd output for %s is:\\n%s\" % (dll_filename, stdout))\n\n    if stderr:\n        inclusion_logger.debug(\"ldd error for %s is:\\n%s\" % (dll_filename, stderr))\n\n    result = OrderedSet()\n\n    for line in stdout.split(b\"\\n\"):\n        if not line:\n            continue\n\n        if b\"=>\" not in line:\n            continue\n\n        part = line.split(b\" => \", 2)[1]\n\n        if b\"(\" in part:\n            filename = part[: part.rfind(b\"(\") - 1]\n        else:\n            filename = part\n\n        if not filename:\n            continue\n\n        if str is not bytes:\n            filename = filename.decode(\"utf8\")\n\n        # Sometimes might use stuff not found or supplied by ldd itself.\n        if filename in (\"not found\", \"ldd\"):\n            continue\n\n        # Normalize, sometimes the DLLs produce \"something/../\", this has\n        # been seen with Qt at least.\n        filename = os.path.normpath(filename)\n\n        # Do not include kernel DLLs on the ignore list.\n        filename_base = os.path.basename(filename)\n        if any(\n            filename_base == entry or filename_base.startswith(entry + \".\")\n            for entry in _linux_dll_ignore_list\n        ):\n            continue\n\n        # Do not allow relative paths for shared libraries\n        if not os.path.isabs(filename):\n            inclusion_logger.sysexit(\n                \"Error: Found a dependency with a relative path. Was a dependency copied to dist early? \"\n                + filename\n            )\n\n        result.add(filename)\n\n    ldd_result_cache[dll_filename] = result\n\n    sub_result = OrderedSet(result)\n\n    for sub_dll_filename in result:\n        sub_result = sub_result.union(\n            detectBinaryPathDLLsPosix(\n                dll_filename=sub_dll_filename,\n                package_name=package_name,\n                original_dir=original_dir,\n            )\n        )\n\n    return sub_result\n\n\n_linux_dll_ignore_list = [\n    # Do not include kernel / glibc specific libraries. This list has been\n    # assembled by looking what are the most common .so files provided by\n    # glibc packages from ArchLinux, Debian Stretch and CentOS.\n    #\n    # Online sources:\n    #  - https://centos.pkgs.org/7/puias-computational-x86_64/glibc-aarch64-linux-gnu-2.24-2.sdl7.2.noarch.rpm.html\n    #  - https://centos.pkgs.org/7/centos-x86_64/glibc-2.17-222.el7.x86_64.rpm.html\n    #  - https://archlinux.pkgs.org/rolling/archlinux-core-x86_64/glibc-2.28-5-x86_64.pkg.tar.xz.html\n    #  - https://packages.debian.org/stretch/amd64/libc6/filelist\n    #\n    # Note: This list may still be incomplete. Some additional libraries\n    # might be provided by glibc - it may vary between the package versions\n    # and between Linux distros. It might or might not be a problem in the\n    # future, but it should be enough for now.\n    \"linux-vdso.so.1\",\n    \"ld-linux-x86-64.so\",\n    \"libc.so\",\n    \"libpthread.so\",\n    \"libm.so\",\n    \"libdl.so\",\n    \"libBrokenLocale.so\",\n    \"libSegFault.so\",\n    \"libanl.so\",\n    \"libcidn.so\",\n    \"libcrypt.so\",\n    \"libmemusage.so\",\n    \"libmvec.so\",\n    \"libnsl.so\",\n    \"libnss3.so\",\n    \"libnssutil3.so\",\n    \"libnss_compat.so\",\n    \"libnss_db.so\",\n    \"libnss_dns.so\",\n    \"libnss_files.so\",\n    \"libnss_hesiod.so\",\n    \"libnss_nis.so\",\n    \"libnss_nisplus.so\",\n    \"libpcprofile.so\",\n    \"libresolv.so\",\n    \"librt.so\",\n    \"libthread_db-1.0.so\",\n    \"libthread_db.so\",\n    \"libutil.so\",\n    # The C++ standard library can also be ABI specific, and can cause system\n    # libraries like MESA to not load any drivers, so we exclude it too, and\n    # it can be assumed to be installed everywhere anyway.\n    \"libstdc++.so\",\n    # The DRM layer should also be taken from the OS in question and won't\n    # allow loading native drivers otherwise.\n    \"libdrm.so\",\n    # The zlib can be assumed to be everywhere, and outside dependencies\n    # may actually load it.\n    \"libz.so\",\n]\n\nif isAnacondaPython() or isAlpineLinux():\n    # Anaconda has these with e.g. torchvision, and insists on them being very new,\n    # so they have to be included.\n    # Alpine linux does not include `libstdc++.so` by default.\n    _linux_dll_ignore_list.remove(\"libstdc++.so\")\n\nif isAndroidBasedLinux():\n    _linux_dll_ignore_list.remove(\"libz.so\")\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/DllDependenciesWin32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"DLL dependency scan methods for Win32 Windows.\n\nNote: MSYS2, aka POSIX Windows is dealt with in the \"DllDependenciesPosix\" module.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.__past__ import iterItems\nfrom nuitka.build.SconsUtils import readSconsReport\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import isShowProgress\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getDirectoryRealPath,\n    getFileContentByLine,\n    getSubDirectoriesWithDlls,\n    listDllFilesFromDirectory,\n    makePath,\n    putTextFileContents,\n    withFileLock,\n)\nfrom nuitka.utils.Hashing import Hash\nfrom nuitka.utils.SharedLibraries import getPyWin32Dir\nfrom nuitka.Version import version_string\n\nfrom .DependsExe import detectDLLsWithDependencyWalker\nfrom .DllDependenciesCommon import getPackageSpecificDLLDirectories\n\n_scan_dir_cache = {}\n\n\ndef detectBinaryPathDLLsWin32(\n    is_main_executable,\n    source_dir,\n    original_dir,\n    binary_filename,\n    package_name,\n    use_cache,\n    update_cache,\n):\n    # This is the caching mechanism and plugin handling for DLL imports.\n    if use_cache or update_cache:\n        cache_filename = _getCacheFilename(\n            dependency_tool=\"depends.exe\",\n            is_main_executable=is_main_executable,\n            source_dir=source_dir,\n            original_dir=original_dir,\n            binary_filename=binary_filename,\n            package_name=package_name,\n        )\n\n        if use_cache:\n            with withFileLock():\n                if not os.path.exists(cache_filename):\n                    use_cache = False\n\n        if use_cache:\n            result = OrderedSet()\n\n            for line in getFileContentByLine(cache_filename):\n                line = line.strip()\n\n                # Detect files that have become missing by ignoring the cache.\n                if not os.path.exists(line):\n                    break\n\n                result.add(line)\n            else:\n                return result\n\n    if isShowProgress():\n        inclusion_logger.info(\"Analyzing dependencies of '%s'.\" % binary_filename)\n\n    scan_dirs = _getScanDirectories(package_name, original_dir)\n\n    result = detectDLLsWithDependencyWalker(\n        binary_filename=binary_filename, source_dir=source_dir, scan_dirs=scan_dirs\n    )\n\n    if update_cache:\n        putTextFileContents(filename=cache_filename, contents=result)\n\n    return result\n\n\ndef _getScanDirectories(package_name, original_dir):\n    # TODO: Move PyWin32 specific stuff to yaml dll section\n    # pylint: disable=too-many-branches\n\n    cache_key = package_name, original_dir\n\n    if cache_key in _scan_dir_cache:\n        return _scan_dir_cache[cache_key]\n\n    scan_dirs = [sys.prefix]\n\n    if package_name is not None:\n        scan_dirs.extend(getPackageSpecificDLLDirectories(package_name))\n\n    if original_dir is not None:\n        scan_dirs.append(original_dir)\n        scan_dirs.extend(getSubDirectoriesWithDlls(original_dir))\n\n    if package_name is not None and package_name.isBelowNamespace(\"win32com\"):\n        py_win32_dir = getPyWin32Dir()\n\n        if py_win32_dir is not None:\n            scan_dirs.append(py_win32_dir)\n\n    for path_dir in os.environ[\"PATH\"].split(\";\"):\n        if not os.path.isdir(path_dir):\n            continue\n\n        if areSamePaths(path_dir, os.path.join(os.environ[\"SYSTEMROOT\"])):\n            continue\n        if areSamePaths(path_dir, os.path.join(os.environ[\"SYSTEMROOT\"], \"System32\")):\n            continue\n        if areSamePaths(path_dir, os.path.join(os.environ[\"SYSTEMROOT\"], \"SysWOW64\")):\n            continue\n\n        scan_dirs.append(path_dir)\n\n    result = []\n\n    # Remove directories that hold no DLLs.\n    for scan_dir in scan_dirs:\n        scan_dir = getDirectoryRealPath(scan_dir)\n\n        # Not a directory, or no DLLs, or not accessible, no use.\n        try:\n            if not os.path.isdir(scan_dir) or not any(\n                listDllFilesFromDirectory(scan_dir)\n            ):\n                continue\n        except OSError:\n            continue\n\n        result.append(os.path.realpath(scan_dir))\n\n    _scan_dir_cache[cache_key] = result\n    return result\n\n\ndef _getCacheFilename(\n    dependency_tool,\n    is_main_executable,\n    source_dir,\n    original_dir,\n    binary_filename,\n    package_name,\n):\n    original_filename = os.path.join(original_dir, os.path.basename(binary_filename))\n    original_filename = os.path.normcase(original_filename)\n\n    hash_value = Hash()\n\n    if is_main_executable:\n        # Normalize main program name for caching as well, but need to use the\n        # scons information to distinguish different compilers, so we use\n        # different libs there.\n        hash_value.updateFromValues(\n            \"\".join(\n                key + value\n                for key, value in iterItems(readSconsReport(source_dir=source_dir))\n                # Ignore values, that are variable per compilation.\n                if key not in (\"CLCACHE_STATS\", \"CCACHE_LOGFILE\", \"CCACHE_DIR\")\n            )\n        )\n    else:\n        hash_value.updateFromValues(original_filename)\n        hash_value.updateFromFile(filename=original_filename)\n\n    # Have different values for different Python major versions.\n    hash_value.updateFromValues(sys.version, sys.executable)\n\n    # Plugins may change their influence.\n    hash_value.updateFromValues(*Plugins.getCacheContributionValues(package_name))\n\n    # Take Nuitka version into account as well, ought to catch code changes.\n    hash_value.updateFromValues(version_string)\n\n    cache_dir = os.path.join(getCacheDir(\"library_dependencies\"), dependency_tool)\n    makePath(cache_dir)\n\n    return os.path.join(cache_dir, hash_value.asHexDigest())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/ImportDetection.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Detect imports made for code by Python.\n\nIn the freezer, this is a step done to detect the technically needed modules to\ninitialize the CPython interpreter.\n\n\"\"\"\n\nimport os\nimport pkgutil\nimport sys\n\nfrom nuitka.importing.StandardLibrary import (\n    getStandardLibraryPaths,\n    isStandardLibraryNoAutoInclusionModule,\n    isStandardLibraryPath,\n    scanStandardLibraryPath,\n)\nfrom nuitka.Options import isStandaloneMode\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import general, printError\nfrom nuitka.utils.Execution import executeProcess\nfrom nuitka.utils.FileOperations import areSamePaths\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef _detectImports(command):\n    # This is pretty complicated stuff, with variants to deal with.\n    # pylint: disable=too-many-branches,too-many-statements\n\n    # Print statements for stuff to show, the modules loaded.\n    if python_version >= 0x300:\n        command += \"\"\"\nprint(\"\\\\n\".join(sorted(\n    \"import %s # sourcefile %s\" % (module.__name__, module.__file__)\n    for module in sys.modules.values()\n    if getattr(module, \"__file__\", None) not in (None, \"<frozen>\"\n))), file = sys.stderr)\"\"\"\n\n    reduced_path = [\n        path_element\n        for path_element in sys.path\n        if not areSamePaths(path_element, \".\")\n        if not areSamePaths(\n            path_element, os.path.dirname(sys.modules[\"__main__\"].__file__)\n        )\n    ]\n\n    # Make sure the right import path (the one Nuitka binary is running with)\n    # is used.\n    command = (\n        \"import sys; sys.path = %s; sys.real_prefix = sys.prefix;\" % repr(reduced_path)\n    ) + command\n\n    if str is not bytes:\n        command = command.encode(\"utf8\")\n\n    _stdout, stderr, exit_code = executeProcess(\n        command=(\n            sys.executable,\n            \"-s\",\n            \"-S\",\n            \"-v\",\n            \"-c\",\n            \"import sys;exec(sys.stdin.read())\",\n        ),\n        stdin=command,\n        env=dict(os.environ, PYTHONIOENCODING=\"utf-8\"),\n    )\n\n    assert type(stderr) is bytes\n\n    # Don't let errors here go unnoticed.\n    if exit_code != 0:\n        # An error by the user pressing CTRL-C should not lead to the below output.\n        if b\"KeyboardInterrupt\" in stderr:\n            general.sysexit(\"Pressed CTRL-C while detecting early imports.\")\n\n        general.warning(\"There is a problem with detecting imports, CPython said:\")\n        for line in stderr.split(b\"\\n\"):\n            printError(line)\n        general.sysexit(\"Error, please report the issue with above output.\")\n\n    detections = []\n\n    for line in stderr.replace(b\"\\r\", b\"\").split(b\"\\n\"):\n        if line.startswith(b\"import \"):\n            parts = line.split(b\" # \", 2)\n\n            module_name = parts[0].split(b\" \", 2)[1].strip(b\"'\")\n            origin = parts[1].split()[0]\n\n            if python_version >= 0x300:\n                module_name = module_name.decode(\"utf8\")\n\n            module_name = ModuleName(module_name)\n\n            if origin == b\"precompiled\":\n                # This is a \".pyc\" file that was imported, even before we have a\n                # chance to do anything, we need to preserve it.\n                filename = parts[1][len(b\"precompiled from \") :]\n                if python_version >= 0x300:\n                    filename = filename.decode(\"utf8\")\n\n                # Do not leave standard library when freezing.\n                if not isStandardLibraryPath(filename):\n                    continue\n\n                detections.append((module_name, 3, \"precompiled\", filename))\n            elif origin == b\"from\" and python_version < 0x300:\n                filename = parts[1][len(b\"from \") :]\n                if str is not bytes:  # For consistency, and maybe later reuse\n                    filename = filename.decode(\"utf8\")\n\n                # Do not leave standard library when freezing.\n                if not isStandardLibraryPath(filename):\n                    continue\n\n                if filename.endswith(\".py\"):\n                    detections.append((module_name, 2, \"sourcefile\", filename))\n                else:\n                    assert False\n            elif origin == b\"sourcefile\":\n                filename = parts[1][len(b\"sourcefile \") :]\n                if python_version >= 0x300:\n                    filename = filename.decode(\"utf8\")\n\n                # Do not leave standard library when freezing.\n                if not isStandardLibraryPath(filename):\n                    continue\n\n                # Python3 started lying in \"__name__\" for the \"_collections_abc\" module\n                # as well, which then is interpreted wrongly, this affects at least 3.9\n                if os.path.basename(filename) in (\n                    \"_collections_abc.py\",\n                    \"_collections_abc.pyc\",\n                ):\n                    module_name = ModuleName(\"_collections_abc\")\n\n                if filename.endswith(\".py\"):\n                    detections.append((module_name, 2, \"sourcefile\", filename))\n                elif filename.endswith(\".pyc\"):\n                    detections.append((module_name, 3, \"precompiled\", filename))\n                elif not filename.endswith(\"<frozen>\"):\n                    # Python3 started lying in \"__name__\" for the \"_decimal\"\n                    # calls itself \"decimal\", which then is wrong and also\n                    # clashes with \"decimal\" proper\n                    if python_version >= 0x300 and module_name == \"decimal\":\n                        module_name = ModuleName(\"_decimal\")\n\n                    detections.append((module_name, 2, \"extension\", filename))\n            elif origin == b\"dynamically\":\n                # Shared library in early load, happens on RPM based systems and\n                # or self compiled Python installations.\n                filename = parts[1][len(b\"dynamically loaded from \") :]\n                if python_version >= 0x300:\n                    filename = filename.decode(\"utf8\")\n\n                # Do not leave standard library when freezing.\n                if not isStandardLibraryPath(filename):\n                    continue\n\n                detections.append((module_name, 1, \"extension\", filename))\n\n    module_names = set()\n\n    for module_name, _priority, kind, filename in sorted(detections):\n        if isStandardLibraryNoAutoInclusionModule(module_name):\n            continue\n\n        if kind == \"extension\":\n            # Extension modules are not tracked outside of standalone\n            # mode.\n            if not isStandaloneMode():\n                continue\n\n            # That is not a shared library, but looks like one.\n            if module_name == \"__main__\":\n                continue\n\n            module_names.add(module_name)\n        elif kind == \"precompiled\":\n            module_names.add(module_name)\n        elif kind == \"sourcefile\":\n            module_names.add(module_name)\n        else:\n            assert False, kind\n\n    return module_names\n\n\ndef _detectEarlyImports():\n    encoding_names = [\n        m[1] for m in pkgutil.iter_modules(sys.modules[\"encodings\"].__path__)\n    ]\n\n    if os.name != \"nt\":\n        # On posix systems, and posix Python variants on Windows, these won't\n        # work and fail to import.\n        for encoding_name in (\"mbcs\", \"cp65001\", \"oem\"):\n            if encoding_name in encoding_names:\n                encoding_names.remove(encoding_name)\n\n    # Not for startup.\n    for non_locale_encoding in (\n        \"bz2_codec\",\n        \"idna\",\n        \"base64_codec\",\n        \"hex_codec\",\n        \"rot_13\",\n    ):\n        if non_locale_encoding in encoding_names:\n            encoding_names.remove(non_locale_encoding)\n\n    import_code = \";\".join(\n        \"import encodings.%s\" % encoding_name\n        for encoding_name in sorted(encoding_names)\n    )\n\n    import_code += \";import locale;\"\n\n    # For Python3 we patch inspect without knowing if it is used.\n    if python_version >= 0x300:\n        import_code += \"import inspect;import importlib._bootstrap\"\n\n    return _detectImports(command=import_code)\n\n\n_early_modules_names = None\n\n\ndef detectEarlyImports():\n    if not isStandaloneMode():\n        return ()\n\n    global _early_modules_names  # singleton, pylint: disable=global-statement\n\n    if _early_modules_names is None:\n        _early_modules_names = tuple(sorted(_detectEarlyImports()))\n\n    return _early_modules_names\n\n\ndef _detectStdlibAutoInclusionModules():\n    if not isStandaloneMode():\n        return ()\n\n    stdlib_modules = set()\n\n    # Scan the standard library paths (multiple in case of virtualenv).\n    for stdlib_dir in getStandardLibraryPaths():\n        for module_name in scanStandardLibraryPath(stdlib_dir):\n            if not isStandardLibraryNoAutoInclusionModule(module_name):\n                stdlib_modules.add(module_name)\n\n    # Put here ones that should be imported first.\n    first_ones = (\"Tkinter\",)\n\n    # We have to fight zombie modules in this, some things, e.g. Tkinter\n    # on newer Python 2.7, comes back after failure without a second error\n    # being raised, leading to other issues. So we fight it after each\n    # module that was tried, and prevent re-try by adding a meta path\n    # based loader that will never load it again, and remove it from the\n    # \"sys.modules\" over and over, once it sneaks back. The root cause is\n    # that extension modules sometimes only raise an error when first\n    # imported, not the second time around.\n    # Otherwise this just makes imports of everything so we can see where\n    # it comes from and what it requires.\n\n    import_code = \"\"\"\nimports = %r\n\nfailed = set()\n\nclass ImportBlocker(object):\n    def find_module(self, fullname, path = None):\n        if fullname in failed:\n            return self\n\n        return None\n\n    def load_module(self, name):\n        raise ImportError(\"%%s has failed before\" %% name)\n\nsys.meta_path.insert(0, ImportBlocker())\n\nfor imp in imports:\n    try:\n        __import__(imp)\n    except (ImportError, SyntaxError):\n        failed.add(imp)\n    except ValueError as e:\n        if \"cannot contain null bytes\" in e.args[0]:\n            failed.add(imp)\n        else:\n            sys.stderr.write(\"PROBLEM with '%%s'\\\\n\" %% imp)\n            raise\n    except Exception:\n        sys.stderr.write(\"PROBLEM with '%%s'\\\\n\" %% imp)\n        raise\n\n    for fail in failed:\n        if fail in sys.modules:\n            del sys.modules[fail]\n\"\"\" % (\n        tuple(\n            module_name.asString()\n            for module_name in sorted(\n                stdlib_modules, key=lambda name: (name not in first_ones, name)\n            )\n        ),\n    )\n\n    return _detectImports(command=import_code)\n\n\n_stdlib_modules_names = None\n\n\ndef detectStdlibAutoInclusionModules():\n    if not isStandaloneMode():\n        return ()\n\n    global _stdlib_modules_names  # singleton, pylint: disable=global-statement\n\n    if _stdlib_modules_names is None:\n        _stdlib_modules_names = _detectStdlibAutoInclusionModules()\n\n        for module_name in detectEarlyImports():\n            _stdlib_modules_names.discard(module_name)\n\n        _stdlib_modules_names = tuple(sorted(_stdlib_modules_names))\n\n    return _stdlib_modules_names\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/IncludedDataFiles.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Included data files for standalone mode.\n\nThis keeps track of data files for standalone mode. Do not should them for\nDLLs or extension modules, these need to be seen by Nuitka as entry points\nfor dependency analysis.\n\"\"\"\n\nimport fnmatch\nimport os\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import (\n    getOutputPath,\n    getShallIncludeDataDirs,\n    getShallIncludeDataFiles,\n    getShallIncludeExternallyDataFilePatterns,\n    getShallIncludePackageData,\n    getShallNotIncludeDataFilePatterns,\n    isOnefileMode,\n    isStandaloneMode,\n    shallMakeModule,\n)\nfrom nuitka.OutputDirectories import getStandaloneDirectoryPath\nfrom nuitka.Tracing import options_logger\nfrom nuitka.utils.FileOperations import (\n    containsPathElements,\n    copyFileWithPermissions,\n    getFileContents,\n    getFileList,\n    getFilenameExtension,\n    getFileSize,\n    isFilenameBelowPath,\n    isRelativePath,\n    makePath,\n    openTextFile,\n    relpath,\n    resolveShellPatternToFilenames,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffixes\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.Utils import isMacOS\n\ndata_file_tags = []\n\n\ndef addDataFileTags(pattern):\n    assert \":\" in pattern, pattern\n    data_file_tags.append(pattern)\n\n\ndef getDataFileTags(dest_path):\n    result = OrderedSet()\n\n    for value in data_file_tags:\n        pattern, tags = value.rsplit(\":\", 1)\n\n        if fnmatch.fnmatch(dest_path, pattern):\n            result.update(tags.split(\",\"))\n\n    return result\n\n\ndef decodeDataFileTags(tags):\n    \"\"\"In many places, strings are accepted for tags, convert to OrderedSet for internal use.\"\"\"\n\n    if type(tags) is str:\n        tags = tags.split(\",\") if tags else ()\n\n    return OrderedSet(tags)\n\n\nclass IncludedDataFile(object):\n    __slots__ = (\"kind\", \"source_path\", \"dest_path\", \"reason\", \"data\", \"tags\", \"tracer\")\n\n    def __init__(self, kind, source_path, dest_path, reason, data, tags, tracer):\n        tags_set = getDataFileTags(dest_path)\n\n        current = dest_path\n        while True:\n            current = os.path.dirname(current)\n            if not current:\n                break\n\n            tags_set.update(getDataFileTags(current))\n\n        tags_set.update(decodeDataFileTags(tags))\n\n        # Copy, unless specified otherwise.\n        if not any(tag.startswith(\"embed-\") for tag in tags_set):\n            tags_set.add(\"copy\")\n\n        self.kind = kind\n        self.source_path = source_path\n        self.dest_path = os.path.normpath(dest_path)\n        self.reason = reason\n        self.data = data\n        self.tags = tags_set\n        self.tracer = tracer\n\n    def __repr__(self):\n        return \"<%s %s source '%s' dest '%s' reason '%s' tags '%s'>\" % (\n            self.__class__.__name__,\n            self.kind,\n            self.source_path,\n            self.dest_path,\n            self.reason,\n            \",\".join(self.tags),\n        )\n\n    def needsCopy(self):\n        return \"copy\" in self.tags\n\n    def getFileContents(self):\n        if self.kind == \"data_file\":\n            return getFileContents(filename=self.source_path, mode=\"rb\")\n        elif self.kind == \"data_blob\":\n            return self.data\n        else:\n            assert False\n\n    def getFileSize(self):\n        if self.kind == \"data_file\":\n            return getFileSize(self.source_path)\n        elif self.kind == \"data_blob\":\n            return len(self.data)\n        else:\n            assert False\n\n\ndef makeIncludedEmptyDirectory(dest_path, reason, tracer, tags):\n    dest_path = os.path.join(dest_path, \".keep_dir.txt\")\n\n    return makeIncludedGeneratedDataFile(\n        data=\"\", dest_path=dest_path, reason=reason, tracer=tracer, tags=tags\n    )\n\n\ndef makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):\n    tags = decodeDataFileTags(tags)\n\n    if \"framework_resource\" in tags and not isMacOS():\n        tracer.sysexit(\"Using resource files on non-MacOS\")\n\n    inside = True\n    if not isRelativePath(dest_path):\n        if \"framework_resource\" in tags and not isOnefileMode():\n            inside = isRelativePath(os.path.join(\"Resources\", dest_path))\n        else:\n            inside = False\n\n    if not inside:\n        tracer.sysexit(\n            \"Error, cannot use dest path '%s' outside of distribution.\" % dest_path\n        )\n\n    # Refuse directories, these must be kept distinct.\n    if os.path.isdir(source_path):\n        tracer.sysexit(\n            \"Error, cannot include directory '%s' as a data file. Data directories have their own options.\"\n            % source_path\n        )\n\n    return IncludedDataFile(\n        kind=\"data_file\",\n        source_path=source_path,\n        dest_path=dest_path,\n        data=None,\n        reason=reason,\n        tracer=tracer,\n        tags=tags,\n    )\n\n\n# By default ignore all things that are code.\ndefault_ignored_suffixes = (\n    \".py\",\n    \".pyw\",\n    \".pyc\",\n    \".pyo\",\n    \".pyi\",\n    \".so\",\n    \".pyd\",\n    \".pyx\",\n    \".dll\",\n    \".dylib\",\n    \".exe\",\n    \".bin\",\n)\n\ndefault_ignored_suffixes += getSharedLibrarySuffixes()\n\ndefault_ignored_dirs = (\n    \"__pycache__\",\n    \"site-packages\",\n    \"dist-packages\",\n    \"vendor-packages\",\n)\n\ndefault_ignored_filenames = (\"py.typed\",)\nif not isMacOS():\n    default_ignored_filenames += (\".DS_Store\",)\n\n\ndef makeIncludedDataDirectory(\n    source_path,\n    dest_path,\n    reason,\n    tracer,\n    tags,\n    ignore_dirs=(),\n    ignore_filenames=(),\n    ignore_suffixes=(),\n    only_suffixes=(),\n    normalize=True,\n):\n    assert isRelativePath(dest_path), dest_path\n    assert os.path.isdir(source_path), source_path\n\n    ignore_dirs = tuple(ignore_dirs) + default_ignored_dirs\n    ignore_filenames = tuple(ignore_filenames) + default_ignored_filenames\n    ignore_suffixes = tuple(ignore_suffixes) + default_ignored_suffixes\n\n    for filename in getFileList(\n        source_path,\n        ignore_dirs=ignore_dirs,\n        ignore_filenames=ignore_filenames,\n        ignore_suffixes=ignore_suffixes,\n        only_suffixes=only_suffixes,\n        normalize=normalize,\n    ):\n        filename_relative = os.path.relpath(filename, source_path)\n\n        filename_dest = os.path.join(dest_path, filename_relative)\n\n        included_datafile = makeIncludedDataFile(\n            source_path=filename,\n            dest_path=filename_dest,\n            reason=reason,\n            tracer=tracer,\n            tags=tags,\n        )\n\n        included_datafile.tags.add(\"data-dir-contents\")\n\n        yield included_datafile\n\n\ndef makeIncludedGeneratedDataFile(data, dest_path, reason, tracer, tags):\n    assert isRelativePath(dest_path), dest_path\n\n    if type(data) is str and str is not bytes:\n        data = data.encode(\"utf8\")\n\n    assert type(data) is bytes, type(data)\n\n    return IncludedDataFile(\n        kind=\"data_blob\",\n        source_path=None,\n        dest_path=dest_path,\n        reason=reason,\n        data=data,\n        tracer=tracer,\n        tags=tags,\n    )\n\n\n_included_data_files = []\n\n\ndef addIncludedDataFile(included_datafile):\n    included_datafile.tags.update(getDataFileTags(included_datafile.dest_path))\n\n    for external_datafile_pattern in getShallNotIncludeDataFilePatterns():\n        if fnmatch.fnmatch(\n            included_datafile.dest_path, external_datafile_pattern\n        ) or isFilenameBelowPath(\n            path=external_datafile_pattern, filename=included_datafile.dest_path\n        ):\n            included_datafile.tags.add(\"inhibit\")\n            included_datafile.tags.remove(\"copy\")\n\n            return\n\n    # Cyclic dependency\n    from nuitka.plugins.Plugins import Plugins\n\n    Plugins.onDataFileTags(included_datafile)\n\n    # TODO: Catch duplicates sooner.\n    # for candidate in _included_data_files:\n    #     if candidate.dest_path == included_datafile.dest_path:\n    #         assert False, included_datafile\n\n    if included_datafile.needsCopy():\n        for external_datafile_pattern in getShallIncludeExternallyDataFilePatterns():\n            if fnmatch.fnmatch(\n                included_datafile.dest_path, external_datafile_pattern\n            ) or isFilenameBelowPath(\n                path=external_datafile_pattern, filename=included_datafile.dest_path\n            ):\n                included_datafile.tags.add(\"external\")\n\n    _included_data_files.append(included_datafile)\n\n\ndef getIncludedDataFiles():\n    return _included_data_files\n\n\ndef _addIncludedDataFilesFromFileOptions():\n    for pattern, source_path, dest_path, arg in getShallIncludeDataFiles():\n        filenames = resolveShellPatternToFilenames(pattern)\n\n        count = 0\n        for filename in filenames:\n            file_reason = \"specified data file '%s' on command line\" % arg\n\n            if source_path is None:\n                rel_path = dest_path\n\n                if rel_path.endswith((\"/\", os.path.sep)):\n                    rel_path = os.path.join(rel_path, os.path.basename(filename))\n            else:\n                rel_path = os.path.join(dest_path, relpath(filename, source_path))\n\n            if containsPathElements(rel_path, default_ignored_dirs):\n                continue\n\n            if os.path.basename(rel_path) in default_ignored_filenames:\n                continue\n\n            yield makeIncludedDataFile(\n                filename, rel_path, file_reason, tracer=options_logger, tags=\"user\"\n            )\n\n            count += 1\n\n        if count == 0:\n            options_logger.warning(\n                \"No matching data file to be included for '%s'.\" % pattern\n            )\n\n    for source_path, dest_path in getShallIncludeDataDirs():\n        count = 0\n\n        for included_datafile in makeIncludedDataDirectory(\n            source_path=source_path,\n            dest_path=dest_path,\n            reason=\"specified data dir '%s' on command line\" % source_path,\n            tracer=options_logger,\n            tags=\"user\",\n        ):\n            yield included_datafile\n\n            count += 1\n\n        if count == 0:\n            options_logger.warning(\"No data files in directory '%s.'\" % source_path)\n\n\ndef addIncludedDataFilesFromFileOptions():\n    \"\"\"Early data files, from user options that work with file system.\"\"\"\n\n    for included_datafile in _addIncludedDataFilesFromFileOptions():\n        addIncludedDataFile(included_datafile)\n\n\ndef scanIncludedPackageDataFiles(package_directory, pattern):\n    ignore_suffixes = default_ignored_suffixes\n\n    if pattern is not None:\n        pattern_extension = getFilenameExtension(pattern)\n\n        ignore_suffixes = tuple(\n            ignore_suffix\n            for ignore_suffix in ignore_suffixes\n            if ignore_suffix != pattern_extension\n        )\n\n    result = []\n\n    for pkg_filename in getFileList(\n        package_directory,\n        ignore_dirs=default_ignored_dirs,\n        ignore_suffixes=ignore_suffixes,\n        ignore_filenames=default_ignored_filenames,\n    ):\n        rel_path = os.path.relpath(pkg_filename, package_directory)\n\n        if pattern and not fnmatch.fnmatch(rel_path, pattern):\n            continue\n\n        result.append(pkg_filename)\n\n    return result\n\n\ndef makeIncludedPackageDataFiles(\n    tracer, package_name, package_directory, pattern, reason, tags\n):\n    tags = decodeDataFileTags(tags)\n    tags.add(\"package_data\")\n\n    file_reason = \"package '%s' %s\" % (package_name, reason)\n\n    for pkg_filename in scanIncludedPackageDataFiles(package_directory, pattern):\n        rel_path = os.path.relpath(pkg_filename, package_directory)\n\n        yield makeIncludedDataFile(\n            source_path=pkg_filename,\n            dest_path=os.path.join(package_name.asPath(), rel_path),\n            reason=file_reason,\n            tracer=tracer,\n            tags=tags,\n        )\n\n\ndef addIncludedDataFilesFromPlugins():\n    # Cyclic dependency\n    from nuitka import ModuleRegistry\n    from nuitka.plugins.Plugins import Plugins\n\n    # Plugins provide per module through this.\n    for module in ModuleRegistry.getDoneModules():\n        for included_datafile in Plugins.considerDataFiles(module=module):\n            addIncludedDataFile(included_datafile)\n\n\ndef addIncludedDataFilesFromPackageOptions():\n    \"\"\"Late data files, from plugins and user options that work with packages\"\"\"\n\n    # Cyclic dependency\n    from nuitka.importing.Importing import locateModule\n\n    # TODO: Should provide ModuleName objects directly.\n\n    for package_name, filename_pattern in getShallIncludePackageData():\n        package_name, package_directory, _module_kind, _finding = locateModule(\n            module_name=ModuleName(package_name),\n            parent_package=None,\n            level=0,\n        )\n\n        if package_directory is None:\n            options_logger.warning(\n                \"Failed to locate package directory of '%s'\" % package_name.asString()\n            )\n            continue\n\n        if os.path.isfile(package_directory):\n            options_logger.sysexit(\n                \"Error, '%s' is a module not a package, cannot have package data.\"\n                % package_name\n            )\n\n        # TODO: Maybe warn about packages that have no data files found.\n\n        for included_datafile in makeIncludedPackageDataFiles(\n            tracer=options_logger,\n            package_name=package_name,\n            package_directory=package_directory,\n            pattern=filename_pattern,\n            reason=\"package data\",\n            tags=\"user\",\n        ):\n            addIncludedDataFile(included_datafile)\n\n\n_data_file_traces = OrderedDict()\n\n\ndef _reportDataFiles():\n    for key in _data_file_traces:\n        count = len(_data_file_traces[key])\n        tracer, reason = key\n\n        # Avoid being too noisy, maybe add a control for increasing this.\n        if count > 10:\n            tracer.info(\"Included %d data files due to %s.\" % (count, reason))\n        else:\n            for kind, dest_path in _data_file_traces[key]:\n                if kind == \"data_blob\":\n                    tracer.info(\n                        \"Included data file '%s' due to %s.\"\n                        % (\n                            dest_path,\n                            reason,\n                        )\n                    )\n                elif kind == \"data_file\":\n                    tracer.info(\n                        \"Included data file '%s' due to %s.\"\n                        % (\n                            dest_path,\n                            reason,\n                        )\n                    )\n                else:\n                    assert False\n\n    # Release the memory\n    _data_file_traces.clear()\n\n\ndef _checkPathConflict(dest_path, standalone_entry_points):\n    assert os.path.normpath(dest_path) == dest_path\n\n    while dest_path:\n        for standalone_entry_point in standalone_entry_points:\n            if dest_path == standalone_entry_point.dest_path:\n                options_logger.sysexit(\n                    \"\"\"\\\nError, data file to be placed in distribution as '%s' conflicts with %s '%s'.\"\"\"\n                    % (\n                        dest_path,\n                        standalone_entry_point.kind,\n                        standalone_entry_point.dest_path,\n                    )\n                )\n        dest_path = os.path.dirname(dest_path)\n\n\ndef _handleDataFile(included_datafile, standalone_entry_points):\n    \"\"\"Handle a data file.\"\"\"\n    tracer = included_datafile.tracer\n\n    if not isinstance(included_datafile, IncludedDataFile):\n        tracer.sysexit(\"Error, can only accept 'IncludedData*' objects from plugins.\")\n\n    if not isStandaloneMode():\n        tracer.sysexit(\n            \"Error, package data files are only included in standalone or onefile mode.\"\n        )\n\n    key = tracer, included_datafile.reason\n    if key not in _data_file_traces:\n        _data_file_traces[key] = []\n\n    _data_file_traces[key].append((included_datafile.kind, included_datafile.dest_path))\n\n    dist_dir = getStandaloneDirectoryPath()\n\n    if \"external\" in included_datafile.tags:\n        dest_path = getOutputPath(included_datafile.dest_path)\n    else:\n        _checkPathConflict(included_datafile.dest_path, standalone_entry_points)\n        dest_path = os.path.join(dist_dir, included_datafile.dest_path)\n\n    if included_datafile.kind == \"data_blob\":\n        makePath(os.path.dirname(dest_path))\n\n        with openTextFile(filename=dest_path, mode=\"wb\") as output_file:\n            output_file.write(included_datafile.data)\n    elif included_datafile.kind == \"data_file\":\n        makePath(os.path.dirname(dest_path))\n\n        copyFileWithPermissions(\n            source_path=included_datafile.source_path,\n            dest_path=dest_path,\n            dist_dir=dist_dir,\n        )\n    else:\n        assert False, included_datafile\n\n\ndef copyDataFiles(standalone_entry_points):\n    \"\"\"Copy the data files needed for standalone distribution.\n\n    Notes:\n        This is for data files only, not DLLs or even extension modules,\n        those must be registered as entry points, and would not go through\n        necessary handling if provided like this.\n    \"\"\"\n\n    for included_datafile in getIncludedDataFiles():\n        # TODO: directories should be resolved to files.\n        if included_datafile.needsCopy():\n            if shallMakeModule():\n                options_logger.sysexit(\n                    \"\"\"\\\nError, data files for modules must be done via wheels, or commercial plugins \\\n'--embed-*' options. Not done for '%s'.\"\"\"\n                    % included_datafile.dest_path\n                )\n            elif not isStandaloneMode():\n                options_logger.sysexit(\n                    \"\"\"\\\nError, data files cannot be included in accelerated mode unless using commercial \\\nplugins '--embed-*' options. Not done for '%s'.\"\"\"\n                    % included_datafile.dest_path\n                )\n\n            _handleDataFile(\n                included_datafile=included_datafile,\n                standalone_entry_points=standalone_entry_points,\n            )\n\n    _reportDataFiles()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/IncludedEntryPoints.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Included entry points for standalone mode.\n\nThis keeps track of entry points for standalone. These should be extension\nmodules, added by core code, the main binary, added by core code, and from\nplugins in their getExtraDlls implementation, where they provide DLLs to be\nadded, and whose dependencies will also be included.\n\"\"\"\n\nimport collections\nimport fnmatch\nimport os\n\nfrom nuitka.Options import getShallNotIncludeDllFilePatterns, isShowInclusion\nfrom nuitka.Tracing import general, inclusion_logger\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getReportPath,\n    hasFilenameExtension,\n    haveSameFileContents,\n    isRelativePath,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\nfrom nuitka.utils.ModuleNames import ModuleName, checkModuleName\nfrom nuitka.utils.SharedLibraries import getDLLVersion\n\nIncludedEntryPoint = collections.namedtuple(\n    \"IncludedEntryPoint\",\n    (\n        \"logger\",\n        \"kind\",\n        \"source_path\",\n        \"dest_path\",\n        \"module_name\",\n        \"package_name\",\n        \"executable\",\n        \"reason\",\n    ),\n)\n\n\n# Since inheritance is not a thing with namedtuple, have factory functions\ndef _makeIncludedEntryPoint(\n    logger, kind, source_path, dest_path, module_name, package_name, reason, executable\n):\n    if package_name is not None:\n        package_name = ModuleName(package_name)\n\n    assert type(executable) is bool, executable\n\n    # Make sure outside code uses sane paths only.\n    assert source_path == os.path.normpath(source_path), source_path\n\n    # Avoid obvious mistakes, these files won't be binaries or DLL ever, right?\n    assert not hasFilenameExtension(path=source_path, extensions=(\".qml\", \".json\"))\n\n    return IncludedEntryPoint(\n        logger=logger,\n        kind=kind,\n        source_path=source_path,\n        dest_path=os.path.normpath(dest_path),\n        module_name=module_name,\n        package_name=package_name,\n        executable=executable,\n        reason=reason,\n    )\n\n\ndef _makeDllOrExeEntryPoint(\n    logger, kind, source_path, dest_path, module_name, package_name, reason, executable\n):\n    assert type(dest_path) not in (tuple, list)\n    assert type(source_path) not in (tuple, list)\n    assert isRelativePath(dest_path), dest_path\n    assert \".dist\" not in dest_path, dest_path\n    if module_name is not None:\n        assert checkModuleName(module_name), module_name\n        module_name = ModuleName(module_name)\n    if package_name is not None:\n        assert checkModuleName(package_name), package_name\n        package_name = ModuleName(package_name)\n\n    if not os.path.isfile(source_path):\n        logger.sysexit(\n            \"Error, attempting to include file '%s' (%s) that does not exist.\"\n            % (getReportPath(source_path), reason)\n        )\n\n    return _makeIncludedEntryPoint(\n        logger=logger,\n        kind=kind,\n        source_path=source_path,\n        dest_path=dest_path,\n        module_name=module_name,\n        package_name=package_name,\n        reason=reason,\n        executable=executable,\n    )\n\n\ndef makeExtensionModuleEntryPoint(\n    logger, source_path, dest_path, module_name, package_name, reason\n):\n    return _makeDllOrExeEntryPoint(\n        logger=logger,\n        kind=\"extension\",\n        source_path=source_path,\n        dest_path=dest_path,\n        module_name=module_name,\n        package_name=package_name,\n        reason=reason,\n        executable=False,\n    )\n\n\ndef makeDllEntryPoint(\n    logger, source_path, dest_path, module_name, package_name, reason\n):\n    return _makeDllOrExeEntryPoint(\n        logger=logger,\n        kind=\"dll\",\n        source_path=source_path,\n        dest_path=dest_path,\n        module_name=module_name,\n        package_name=package_name,\n        reason=reason,\n        executable=False,\n    )\n\n\ndef makeExeEntryPoint(\n    logger, source_path, dest_path, module_name, package_name, reason\n):\n    return _makeDllOrExeEntryPoint(\n        logger=logger,\n        kind=\"exe\",\n        source_path=source_path,\n        dest_path=dest_path,\n        module_name=module_name,\n        package_name=package_name,\n        reason=reason,\n        executable=True,\n    )\n\n\ndef makeMainExecutableEntryPoint(dest_path):\n    return _makeDllOrExeEntryPoint(\n        logger=general,\n        kind=\"executable\",\n        source_path=dest_path,\n        dest_path=os.path.basename(dest_path),\n        module_name=None,\n        package_name=None,\n        reason=\"main binary\",\n        executable=True,\n    )\n\n\ndef _makeIgnoredEntryPoint(entry_point):\n    return _makeDllOrExeEntryPoint(\n        logger=entry_point.logger,\n        kind=entry_point.kind + \"_ignored\",\n        source_path=entry_point.source_path,\n        dest_path=entry_point.dest_path,\n        module_name=entry_point.module_name,\n        package_name=entry_point.package_name,\n        reason=entry_point.reason,\n        executable=entry_point.executable,\n    )\n\n\nstandalone_entry_points = []\n\n\ndef _getTopLevelPackageName(package_name):\n    if package_name is None:\n        return None\n    else:\n        return package_name.getTopLevelPackageName()\n\n\ndef _warnNonIdenticalEntryPoints(entry_point1, entry_point2):\n    # Well know cases, where they duplicate all the DLLs, seems to work well\n    # enough to not report this. TODO: When we are adding to the report, it\n    # ought to be still added. spell-checker: ignore scipy\n    if frozenset(\n        (\n            _getTopLevelPackageName(entry_point1.package_name),\n            _getTopLevelPackageName(entry_point2.package_name),\n        )\n    ) == frozenset((\"numpy\", \"scipy\")):\n        return\n\n    if frozenset(\n        (\n            _getTopLevelPackageName(entry_point1.package_name),\n            _getTopLevelPackageName(entry_point2.package_name),\n        )\n    ) == frozenset((\"av\", \"cv2\")):\n        return\n\n    def _describe(entry_point):\n        if entry_point.package_name:\n            return \"'%s' of package '%s'\" % (\n                entry_point.source_path,\n                entry_point.package_name,\n            )\n        else:\n            return \"'%s'\" % entry_point.source_path\n\n    inclusion_logger.warning(\n        \"\"\"\\\nIgnoring non-identical DLLs for %s, %s different from %s. Using first one and hoping for the best.\"\"\"\n        % (entry_point1.dest_path, _describe(entry_point1), _describe(entry_point2))\n    )\n\n\ndef addIncludedEntryPoint(entry_point):\n    # Checking here if user or DLL version conflicts require it to be ignored,\n    # which has a couple of decisions to make, pylint: disable=too-many-branches\n\n    for count, standalone_entry_point in enumerate(standalone_entry_points):\n        if standalone_entry_point.kind.endswith(\"_ignored\"):\n            continue\n\n        if areSamePaths(entry_point.dest_path, standalone_entry_point.dest_path):\n            if areSamePaths(\n                entry_point.source_path, standalone_entry_point.source_path\n            ):\n                return\n\n            if isShowInclusion():\n                inclusion_logger.info(\n                    \"\"\"Colliding DLL names for %s, checking identity of \\\n'%s' <-> '%s'.\"\"\"\n                    % (\n                        entry_point.dest_path,\n                        entry_point.source_path,\n                        standalone_entry_point.source_path,\n                    )\n                )\n\n            # Check that if a DLL has the same name, if it's identical, then it's easy, we just\n            # want to remember, therefore we convert to an ignored type.\n            if haveSameFileContents(\n                entry_point.source_path, standalone_entry_point.source_path\n            ):\n                entry_point = _makeIgnoredEntryPoint(entry_point)\n                break\n\n            # For Win32 and macOS, we can check out file versions.\n            old_dll_version = getDLLVersion(standalone_entry_point.source_path)\n            new_dll_version = getDLLVersion(entry_point.source_path)\n\n            # No version information for both, warn and ignore the new one.\n            if old_dll_version is None and new_dll_version is None:\n                _warnNonIdenticalEntryPoints(standalone_entry_point, entry_point)\n\n                entry_point = _makeIgnoredEntryPoint(entry_point)\n                break\n\n            # The newly found one has version information, ignore old one\n            if old_dll_version is None and new_dll_version is not None:\n                standalone_entry_points[count] = _makeIgnoredEntryPoint(\n                    standalone_entry_point\n                )\n                break\n\n            # The old one has version information, but the new one does not, ignore new one\n            if old_dll_version is not None and new_dll_version is None:\n                entry_point = _makeIgnoredEntryPoint(entry_point)\n                break\n\n            # The old one has lower version, ignore it.s\n            if old_dll_version < new_dll_version:\n                standalone_entry_points[count] = _makeIgnoredEntryPoint(\n                    standalone_entry_point\n                )\n                break\n\n            # The old one has same or higher version, prefer it.\n            if old_dll_version >= new_dll_version:\n                entry_point = _makeIgnoredEntryPoint(entry_point)\n                break\n\n            # Ought to be impossible to get here.\n            assert False, (old_dll_version, new_dll_version)\n\n    if not entry_point.kind.endswith(\"_ignored\"):\n        for noinclude_dll_pattern in getShallNotIncludeDllFilePatterns():\n            if fnmatch.fnmatch(entry_point.dest_path, noinclude_dll_pattern):\n                entry_point = _makeIgnoredEntryPoint(entry_point)\n\n    standalone_entry_points.append(entry_point)\n\n\ndef addIncludedEntryPoints(entry_points):\n    for entry_point in entry_points:\n        addIncludedEntryPoint(entry_point)\n\n\ndef setMainEntryPoint(binary_filename):\n    entry_point = makeMainExecutableEntryPoint(binary_filename)\n\n    standalone_entry_points.insert(0, entry_point)\n\n\ndef addExtensionModuleEntryPoint(module):\n    standalone_entry_points.append(\n        makeExtensionModuleEntryPoint(\n            logger=general,\n            source_path=module.getFilename(),\n            dest_path=module.getFullName().asPath()\n            + getSharedLibrarySuffix(preferred=False),\n            module_name=module.getFullName(),\n            package_name=module.getFullName().getPackageName(),\n            reason=(\n                \"required extension module for CPython library startup\"\n                if module.isTechnical()\n                else \"used extension module\"\n            ),\n        )\n    )\n\n\ndef getStandaloneEntryPoints():\n    return tuple(standalone_entry_points)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/Onefile.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Pack distribution folders into a single file.\n\n\"\"\"\n\nimport os\nimport subprocess\nimport sys\n\nfrom nuitka import Options, OutputDirectories\nfrom nuitka.build.SconsInterface import (\n    asBoolStr,\n    cleanSconsDirectory,\n    runScons,\n    setCommonSconsOptions,\n)\nfrom nuitka.Options import getOnefileTempDirSpec, isOnefileTempDirMode\nfrom nuitka.OutputDirectories import getResultFullpath\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PostProcessing import executePostProcessingResources\nfrom nuitka.PythonVersions import (\n    getZstandardSupportingVersions,\n    python_version,\n)\nfrom nuitka.Tracing import onefile_logger, postprocessing_logger\nfrom nuitka.utils.Execution import withEnvironmentVarsOverridden\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getExternalUsePath,\n    getFileContents,\n    removeDirectory,\n)\nfrom nuitka.utils.InstalledPythons import findInstalledPython\nfrom nuitka.utils.SharedLibraries import cleanupHeaderForAndroid\nfrom nuitka.utils.Signing import addMacOSCodeSignature\nfrom nuitka.utils.Utils import (\n    isAndroidBasedLinux,\n    isMacOS,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n)\nfrom nuitka.utils.WindowsResources import RT_RCDATA, addResourceToFile\n\n\ndef packDistFolderToOnefile(dist_dir):\n    \"\"\"Pack distribution to onefile, i.e. a single file that is directly executable.\"\"\"\n\n    onefile_output_filename = getResultFullpath(onefile=True)\n\n    packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir)\n\n    Plugins.onOnefileFinished(onefile_output_filename)\n\n\ndef _runOnefileScons(onefile_compression, onefile_archive):\n    source_dir = OutputDirectories.getSourceDirectoryPath(onefile=True)\n\n    # Let plugins do their thing for onefile mode too.\n    Plugins.writeExtraCodeFiles(onefile=True)\n\n    options = {\n        \"result_name\": OutputDirectories.getResultBasePath(onefile=True),\n        \"result_exe\": OutputDirectories.getResultFullpath(onefile=True),\n        \"source_dir\": source_dir,\n        \"debug_mode\": asBoolStr(Options.is_debug),\n        \"trace_mode\": asBoolStr(Options.shallTraceExecution()),\n        \"onefile_splash_screen\": asBoolStr(\n            Options.getWindowsSplashScreen() is not None\n        ),\n    }\n\n    env_values = setCommonSconsOptions(options)\n\n    env_values[\"_NUITKA_ONEFILE_TEMP_SPEC\"] = getOnefileTempDirSpec()\n    env_values[\"_NUITKA_ONEFILE_TEMP_BOOL\"] = \"1\" if isOnefileTempDirMode() else \"0\"\n    env_values[\"_NUITKA_ONEFILE_COMPRESSION_BOOL\"] = \"1\" if onefile_compression else \"0\"\n    env_values[\"_NUITKA_ONEFILE_BUILD_BOOL\"] = \"1\" if onefile_compression else \"0\"\n    env_values[\"_NUITKA_ONEFILE_ARCHIVE_BOOL\"] = \"1\" if onefile_archive else \"0\"\n\n    # Allow plugins to build definitions.\n    env_values.update(Plugins.getBuildDefinitions())\n\n    result = runScons(\n        options=options,\n        env_values=env_values,\n        scons_filename=\"Onefile.scons\",\n    )\n\n    # Exit if compilation failed.\n    if not result:\n        onefile_logger.sysexit(\"Error, onefile bootstrap binary build failed.\")\n\n\n_compressor_python = None\n\n\ndef getCompressorPython():\n    # User may disable it.\n    if Options.shallNotCompressOnefile():\n        return None\n\n    global _compressor_python  # singleton, pylint: disable=global-statement\n\n    if _compressor_python is None:\n        _compressor_python = findInstalledPython(\n            python_versions=getZstandardSupportingVersions(),\n            module_name=\"zstandard\",\n            module_version=\"0.15\",\n        )\n\n        if _compressor_python is None:\n            if python_version < 0x350:\n                onefile_logger.warning(\n                    \"\"\"\\\nOnefile mode cannot compress without 'zstandard' module installed on \\\nanother discoverable Python >= 3.5 on your system.\"\"\"\n                )\n            else:\n                onefile_logger.warning(\n                    \"\"\"\\\nOnefile mode cannot compress without 'zstandard' module installed.\"\"\"\n                )\n\n    return _compressor_python\n\n\ndef runOnefileCompressor(\n    compressor_python, dist_dir, onefile_output_filename, start_binary\n):\n    file_checksums = not isOnefileTempDirMode()\n    win_path_sep = isWin32OrPosixWindows()\n\n    if compressor_python is None or areSamePaths(\n        compressor_python.getPythonExe(), sys.executable\n    ):\n        from nuitka.tools.onefile_compressor.OnefileCompressor import (\n            attachOnefilePayload,\n        )\n\n        attachOnefilePayload(\n            dist_dir=dist_dir,\n            onefile_output_filename=onefile_output_filename,\n            start_binary=start_binary,\n            expect_compression=compressor_python is not None,\n            as_archive=Options.shallOnefileAsArchive(),\n            use_compression_cache=not Options.shallDisableCompressionCacheUsage(),\n            file_checksums=file_checksums,\n            win_path_sep=win_path_sep,\n            low_memory=Options.isLowMemory(),\n        )\n    else:\n        onefile_compressor_path = os.path.normpath(\n            os.path.join(os.path.dirname(__file__), \"..\", \"tools\", \"onefile_compressor\")\n        )\n\n        mapping = {\n            \"NUITKA_PACKAGE_HOME\": os.path.dirname(\n                os.path.abspath(sys.modules[\"nuitka\"].__path__[0])\n            )\n        }\n\n        mapping[\"NUITKA_PROGRESS_BAR\"] = \"1\" if Options.shallUseProgressBar() else \"0\"\n\n        onefile_logger.info(\n            \"Using external Python '%s' to compress the payload.\"\n            % compressor_python.getPythonExe()\n        )\n\n        with withEnvironmentVarsOverridden(mapping):\n            subprocess.check_call(\n                [\n                    compressor_python.getPythonExe(),\n                    onefile_compressor_path,\n                    dist_dir,\n                    getExternalUsePath(onefile_output_filename, only_dirname=True),\n                    start_binary,\n                    str(file_checksums),\n                    str(win_path_sep),\n                    str(Options.isLowMemory()),\n                    str(Options.shallOnefileAsArchive()),\n                    str(not Options.shallDisableCompressionCacheUsage()),\n                ],\n                shell=False,\n            )\n\n\ndef packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir):\n    postprocessing_logger.info(\n        \"Creating single file from dist folder, this may take a while.\"\n    )\n\n    onefile_logger.info(\"Running bootstrap binary compilation via Scons.\")\n\n    # Cleanup first.\n    source_dir = OutputDirectories.getSourceDirectoryPath(onefile=True)\n    cleanSconsDirectory(source_dir)\n\n    # Used only in some configurations\n    onefile_payload_filename = os.path.join(source_dir, \"__payload.bin\")\n\n    # Now need to append to payload it, potentially compressing it.\n    compressor_python = getCompressorPython()\n\n    # Decide if we need the payload during build already, or if it should be\n    # attached.\n    payload_used_in_build = isMacOS()\n\n    if payload_used_in_build:\n        runOnefileCompressor(\n            compressor_python=compressor_python,\n            dist_dir=dist_dir,\n            onefile_output_filename=onefile_payload_filename,\n            start_binary=getResultFullpath(onefile=False),\n        )\n\n    # Create the bootstrap binary for unpacking.\n    _runOnefileScons(\n        onefile_compression=compressor_python is not None,\n        onefile_archive=Options.shallOnefileAsArchive(),\n    )\n\n    if isWin32Windows():\n        executePostProcessingResources(manifest=None, onefile=True)\n\n    if isAndroidBasedLinux():\n        cleanupHeaderForAndroid(onefile_output_filename)\n\n    Plugins.onBootstrapBinary(onefile_output_filename)\n\n    if isMacOS():\n        addMacOSCodeSignature(filenames=[onefile_output_filename])\n\n    if not payload_used_in_build:\n        runOnefileCompressor(\n            compressor_python=compressor_python,\n            dist_dir=dist_dir,\n            onefile_output_filename=(\n                onefile_payload_filename\n                if isWin32Windows()\n                else onefile_output_filename\n            ),\n            start_binary=getResultFullpath(onefile=False),\n        )\n\n        if isWin32Windows():\n            addResourceToFile(\n                target_filename=onefile_output_filename,\n                data=getFileContents(onefile_payload_filename, mode=\"rb\"),\n                resource_kind=RT_RCDATA,\n                lang_id=0,\n                res_name=27,\n                logger=postprocessing_logger,\n            )\n\n    if Options.isRemoveBuildDir():\n        onefile_logger.info(\"Removing onefile build directory '%s'.\" % source_dir)\n\n        removeDirectory(path=source_dir, ignore_errors=False)\n        assert not os.path.exists(source_dir)\n    else:\n        onefile_logger.info(\"Keeping onefile build directory '%s'.\" % source_dir)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/Standalone.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Pack and copy files for standalone mode.\n\nThis is expected to work for macOS, Windows, and Linux. Other things like\nFreeBSD are also very welcome, but might break with time and need your\nhelp.\n\"\"\"\n\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Errors import NuitkaForbiddenDLLEncounter\nfrom nuitka.importing.Importing import (\n    getPythonUnpackedSearchPath,\n    locateModule,\n)\nfrom nuitka.importing.StandardLibrary import isStandardLibraryPath\nfrom nuitka.Options import (\n    isShowProgress,\n    shallNotStoreDependsExeCachedResults,\n    shallNotUseDependsExeCachedResults,\n)\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.Progress import (\n    closeProgressBar,\n    reportProgressBar,\n    setupProgressBar,\n)\nfrom nuitka.Tracing import general, inclusion_logger\nfrom nuitka.utils.FileOperations import areInSamePaths, isFilenameBelowPath\nfrom nuitka.utils.SharedLibraries import copyDllFile, setSharedLibraryRPATH\nfrom nuitka.utils.Signing import addMacOSCodeSignature\nfrom nuitka.utils.Timing import TimerReport\nfrom nuitka.utils.Utils import (\n    getOS,\n    isDebianBasedLinux,\n    isMacOS,\n    isPosixWindows,\n    isWin32Windows,\n)\n\nfrom .DllDependenciesMacOS import (\n    detectBinaryPathDLLsMacOS,\n    fixupBinaryDLLPathsMacOS,\n)\nfrom .DllDependenciesPosix import detectBinaryPathDLLsPosix\nfrom .DllDependenciesWin32 import detectBinaryPathDLLsWin32\nfrom .IncludedEntryPoints import addIncludedEntryPoint, makeDllEntryPoint\n\n\ndef checkFreezingModuleSet():\n    \"\"\"Check the module set for troubles.\n\n    Typically Linux OS specific packages must be avoided, e.g. Debian packaging\n    does make sure the packages will not run on other OSes.\n    \"\"\"\n    # Cyclic dependency\n    from nuitka import ModuleRegistry\n\n    problem_modules = OrderedSet()\n\n    if isDebianBasedLinux():\n        message = \"Standalone with Python package from Debian installation may not be working.\"\n        mnemonic = \"debian-dist-packages\"\n\n        def checkModulePath(module):\n            module_filename = module.getCompileTimeFilename()\n            module_filename_parts = module_filename.split(\"/\")\n\n            if (\n                \"dist-packages\" in module_filename_parts\n                and \"local\" not in module_filename_parts\n            ):\n                module_name = module.getFullName()\n\n                package_name = module_name.getTopLevelPackageName()\n\n                if package_name is not None:\n                    problem_modules.add(package_name)\n                else:\n                    problem_modules.add(module_name)\n\n    else:\n        checkModulePath = None\n        message = None\n        mnemonic = None\n\n    # We intend for other platforms to join, e.g. Fedora, etc. but currently\n    # only Debian is done.\n    if checkModulePath is not None:\n        for module in ModuleRegistry.getDoneModules():\n            if not module.getFullName().isFakeModuleName():\n                checkModulePath(module)\n\n    if problem_modules:\n        general.info(\"Using Debian packages for '%s'.\" % \",\".join(problem_modules))\n        general.warning(message=message, mnemonic=mnemonic)\n\n\ndef _detectBinaryDLLs(\n    is_main_executable,\n    source_dir,\n    original_filename,\n    binary_filename,\n    package_name,\n    use_cache,\n    update_cache,\n):\n    \"\"\"Detect the DLLs used by a binary.\n\n    Using \"ldd\" (Linux), \"depends.exe\" (Windows), or\n    \"otool\" (macOS) the list of used DLLs is retrieved.\n    \"\"\"\n\n    if getOS() in (\"Linux\", \"NetBSD\", \"FreeBSD\", \"OpenBSD\") or isPosixWindows():\n        return detectBinaryPathDLLsPosix(\n            dll_filename=original_filename,\n            package_name=package_name,\n            original_dir=os.path.dirname(original_filename),\n        )\n    elif isWin32Windows():\n        with TimerReport(\n            message=\"Running 'depends.exe' for %s took %%.2f seconds\" % binary_filename,\n            decider=isShowProgress,\n        ):\n            return detectBinaryPathDLLsWin32(\n                is_main_executable=is_main_executable,\n                source_dir=source_dir,\n                original_dir=os.path.dirname(original_filename),\n                binary_filename=binary_filename,\n                package_name=package_name,\n                use_cache=use_cache,\n                update_cache=update_cache,\n            )\n    elif isMacOS():\n        return detectBinaryPathDLLsMacOS(\n            original_dir=os.path.dirname(original_filename),\n            binary_filename=original_filename,\n            package_name=package_name,\n            keep_unresolved=False,\n            recursive=True,\n        )\n    else:\n        # Support your platform above.\n        assert False, getOS()\n\n\ndef copyDllsUsed(dist_dir, standalone_entry_points):\n    # This is complex, because we also need to handle OS specifics.\n\n    # Only do ones not ignored\n    copy_standalone_entry_points = [\n        standalone_entry_point\n        for standalone_entry_point in standalone_entry_points[1:]\n        if not standalone_entry_point.kind.endswith(\"_ignored\")\n    ]\n    main_standalone_entry_point = standalone_entry_points[0]\n\n    if isMacOS():\n        fixupBinaryDLLPathsMacOS(\n            binary_filename=os.path.join(\n                dist_dir, main_standalone_entry_point.dest_path\n            ),\n            package_name=main_standalone_entry_point.package_name,\n            original_location=main_standalone_entry_point.source_path,\n            standalone_entry_points=standalone_entry_points,\n        )\n\n        # After dependency detection, we can change the RPATH for macOS main\n        # binary.\n        setSharedLibraryRPATH(\n            os.path.join(dist_dir, standalone_entry_points[0].dest_path), \"$ORIGIN\"\n        )\n\n    setupProgressBar(\n        stage=\"Copying used DLLs\",\n        unit=\"DLL\",\n        total=len(copy_standalone_entry_points),\n    )\n\n    for standalone_entry_point in copy_standalone_entry_points:\n        reportProgressBar(standalone_entry_point.dest_path)\n\n        copyDllFile(\n            source_path=standalone_entry_point.source_path,\n            dist_dir=dist_dir,\n            dest_path=standalone_entry_point.dest_path,\n            executable=standalone_entry_point.executable,\n        )\n\n        if isMacOS():\n            fixupBinaryDLLPathsMacOS(\n                binary_filename=os.path.join(\n                    dist_dir, standalone_entry_point.dest_path\n                ),\n                package_name=standalone_entry_point.package_name,\n                original_location=standalone_entry_point.source_path,\n                standalone_entry_points=standalone_entry_points,\n            )\n\n    closeProgressBar()\n\n    # Add macOS code signature\n    if isMacOS():\n        addMacOSCodeSignature(\n            filenames=[\n                os.path.join(dist_dir, standalone_entry_point.dest_path)\n                for standalone_entry_point in [main_standalone_entry_point]\n                + copy_standalone_entry_points\n            ]\n        )\n\n    Plugins.onCopiedDLLs(\n        dist_dir=dist_dir, standalone_entry_points=copy_standalone_entry_points\n    )\n\n\ndef _reduceToPythonPath(used_dlls):\n    inside_paths = getPythonUnpackedSearchPath()\n\n    def decideInside(dll_filename):\n        return any(\n            isFilenameBelowPath(path=inside_path, filename=dll_filename)\n            for inside_path in inside_paths\n        )\n\n    used_dlls = set(\n        dll_filename for dll_filename in used_dlls if decideInside(dll_filename)\n    )\n\n    return used_dlls\n\n\ndef _detectUsedDLLs(standalone_entry_point, source_dir):\n    binary_filename = standalone_entry_point.source_path\n    try:\n        used_dlls = _detectBinaryDLLs(\n            is_main_executable=standalone_entry_point.kind == \"executable\",\n            source_dir=source_dir,\n            original_filename=standalone_entry_point.source_path,\n            binary_filename=standalone_entry_point.source_path,\n            package_name=standalone_entry_point.package_name,\n            use_cache=not shallNotUseDependsExeCachedResults(),\n            update_cache=not shallNotStoreDependsExeCachedResults(),\n        )\n    except NuitkaForbiddenDLLEncounter:\n        inclusion_logger.info(\"Not including forbidden DLL '%s'.\" % binary_filename)\n    else:\n        # Plugins generally decide if they allow dependencies from the outside\n        # based on the package name.\n\n        if standalone_entry_point.module_name is not None and used_dlls:\n            module_name, module_filename, _kind, finding = locateModule(\n                standalone_entry_point.module_name, parent_package=None, level=0\n            )\n\n            # Make sure we are not surprised here.\n            assert (\n                module_name == standalone_entry_point.module_name\n            ), standalone_entry_point.module_name\n            assert finding == \"absolute\", standalone_entry_point.module_name\n\n            if isStandardLibraryPath(module_filename):\n                allow_outside_dependencies = True\n            else:\n                allow_outside_dependencies = Plugins.decideAllowOutsideDependencies(\n                    standalone_entry_point.module_name\n                )\n\n            if allow_outside_dependencies is False:\n                used_dlls = _reduceToPythonPath(used_dlls)\n\n        # Allow plugins can prevent inclusion, this may discard things from used_dlls.\n        removed_dlls = Plugins.removeDllDependencies(\n            dll_filename=binary_filename, dll_filenames=used_dlls\n        )\n        used_dlls = tuple(OrderedSet(used_dlls) - OrderedSet(removed_dlls))\n\n        for used_dll in used_dlls:\n            dest_path = os.path.basename(used_dll)\n\n            # TODO: If used by a DLL from the same folder, put it there,\n            # otherwise top level, but for now this is limited to a few cases\n            # where required that way (openvino) or known to be good only (av),\n            # because it broke other things.\n            if standalone_entry_point.package_name in (\n                \"openvino\",\n                \"av\",\n            ) and areInSamePaths(standalone_entry_point.source_path, used_dll):\n                dest_path = os.path.normpath(\n                    os.path.join(\n                        os.path.dirname(standalone_entry_point.dest_path),\n                        dest_path,\n                    )\n                )\n\n            dll_entry_point = makeDllEntryPoint(\n                logger=inclusion_logger,\n                source_path=used_dll,\n                dest_path=dest_path,\n                module_name=standalone_entry_point.module_name,\n                package_name=standalone_entry_point.package_name,\n                reason=\"Used by '%s'\" % standalone_entry_point.dest_path,\n            )\n\n            addIncludedEntryPoint(dll_entry_point)\n\n\ndef detectUsedDLLs(standalone_entry_points, source_dir):\n    setupProgressBar(\n        stage=\"Detecting used DLLs\",\n        unit=\"DLL\",\n        total=len(standalone_entry_points),\n    )\n\n    for standalone_entry_point in standalone_entry_points:\n        reportProgressBar(standalone_entry_point.dest_path)\n\n        _detectUsedDLLs(\n            standalone_entry_point=standalone_entry_point, source_dir=source_dir\n        )\n\n    closeProgressBar()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/freezer/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/IgnoreListing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Ignore listing of modules that are not found, but probably that's acceptable.\n\n\"\"\"\n\nimport sys\n\nfrom nuitka.Errors import NuitkaOptimizationError\nfrom nuitka.PythonFlavors import isNuitkaPython\n\n\ndef getModuleIgnoreList():\n    return (\n        \"mac\",\n        \"nt\",\n        \"os2\",\n        \"posix\",\n        \"_emx_link\",\n        \"riscos\",\n        \"ce\",\n        \"riscospath\",\n        \"riscosenviron\",\n        \"Carbon.File\",\n        \"org.python.core\",\n        \"_sha\",\n        \"_sha256\",\n        \"array\",\n        \"_sha512\",\n        \"_md5\",\n        \"_subprocess\",\n        \"msvcrt\",\n        \"cPickle\",\n        \"marshal\",\n        \"imp\",\n        \"sys\",\n        \"itertools\",\n        \"cStringIO\",\n        \"time\",\n        \"zlib\",\n        \"thread\",\n        \"math\",\n        \"errno\",\n        \"operator\",\n        \"signal\",\n        \"gc\",\n        \"exceptions\",\n        \"win32process\",\n        \"unicodedata\",\n        \"__builtin__\",\n        \"fcntl\",\n        \"_socket\",\n        \"_ssl\",\n        \"pwd\",\n        \"spwd\",\n        \"_random\",\n        \"grp\",\n        \"_io\",\n        \"_string\",\n        \"select\",\n        \"__main__\",\n        \"_winreg\",\n        \"_warnings\",\n        \"_sre\",\n        \"_functools\",\n        \"_hashlib\",\n        \"_collections\",\n        \"_locale\",\n        \"_codecs\",\n        \"_weakref\",\n        \"_struct\",\n        \"_dummy_threading\",\n        \"binascii\",\n        \"datetime\",\n        \"_ast\",\n        \"xxsubtype\",\n        \"_bytesio\",\n        \"cmath\",\n        \"_fileio\",\n        \"aetypes\",\n        \"aepack\",\n        \"MacOS\",\n        \"cd\",\n        \"cl\",\n        \"gdbm\",\n        \"gl\",\n        \"GL\",\n        \"aetools\",\n        \"_bisect\",\n        \"_heapq\",\n        \"_symtable\",\n        \"syslog\",\n        \"_datetime\",\n        \"_elementtree\",\n        \"_pickle\",\n        \"_posixsubprocess\",\n        \"_thread\",\n        \"atexit\",\n        \"pyexpat\",\n        \"_imp\",\n        \"_sha1\",\n        \"faulthandler\",\n        \"_osx_support\",\n        \"sysconfig\",\n        \"copyreg\",\n        \"ipaddress\",\n        \"reprlib\",\n        \"win32event\",\n        \"win32file\",\n        # Python-Qt4 does these if missing python3 parts:\n        \"PyQt4.uic.port_v3.string_io\",\n        \"PyQt4.uic.port_v3.load_plugin\",\n        \"PyQt4.uic.port_v3.ascii_upper\",\n        \"PyQt4.uic.port_v3.proxy_base\",\n        \"PyQt4.uic.port_v3.as_string\",\n        # CPython3 does these:\n        \"builtins\",\n        \"UserDict\",\n        \"os.path\",\n        \"StringIO\",\n        # \"test_array\",\n        \"_testcapi\",\n        # test_applesingle.py\n        \"applesingle\",\n        # test_buffer.py\n        \"_testbuffer\",\n        # test_bsddb.py\n        \"bsddb.test\",\n        # test_collections.py\n        \"collections.abc\",\n        # test_compile.py\n        \"__package__.module\",\n        \"__mangled_mod\",\n        \"__package__\",\n        # test_ctypes\n        \"ctypes.test\",\n        # test_dbm.py\n        \"dbm.dumb\",\n        # test_dbm_ndbm.py\n        \"dbm.ndbm\",\n        # test_distutils.py\n        \"distutils.tests\",\n        \"distutils.mwerkscompiler\",\n        # test_docxmlrpc.py\n        \"xmlrpc\",\n        # test_emails.py\n        \"email.test.test_email\",\n        \"email.test.test_email_renamed\",\n        \"email.test.test_email_codecs\",\n        # test_email_codecs.py\n        \"email.test\",\n        # test_enum.py\n        \"enum\",\n        # test_file.py\n        \"_pyio\",\n        # test_frozen.py\n        \"__hello__\",\n        \"__phello__\",\n        \"__phello__.spam\",\n        \"__phello__.foo\",\n        # test_fork1.py\n        \"fake test module\",\n        # test_html.py\n        \"html\",\n        \"html.entities\",\n        # test_http_cookiejar.py\n        \"urllib.request\",\n        \"http\",\n        # test_imp.py\n        \"importlib.test.import_\",\n        \"pep3147.foo\",\n        \"pep3147\",\n        # test_import.py\n        \"RAnDoM\",\n        \"infinite_reload\",\n        \"test_trailing_slash\",\n        \"nonexistent_xyzzy\",\n        \"_parent_foo.bar\",\n        \"_parent_foo\",\n        \"test_unc_path\",\n        # test_importhooks.py\n        \"hooktestmodule\",\n        \"hooktestpackage\",\n        \"hooktestpackage.sub\",\n        \"reloadmodule\",\n        \"hooktestpackage.sub.subber\",\n        \"hooktestpackage.oldabs\",\n        \"hooktestpackage.newrel\",\n        \"hooktestpackage.sub.subber.subest\",\n        \"hooktestpackage.futrel\",\n        \"sub\",\n        \"hooktestpackage.newabs\",\n        # test_imporlib.py\"\n        \"importlib.test.__main__\",\n        \"importlib\",\n        # test_inspect.py\n        \"inspect_fodder3\",\n        \"test.test_import\",\n        # test_imageop.py\n        \"imgfile\",\n        # test_json.py\n        \"json.tests\",\n        # test_lib2to3.py\n        \"lib2to3.tests\",\n        # test_logging.py\n        \"win32evtlog\",\n        \"win32evtlogutil\",\n        \"pywintypes\",\n        # test_lzma.py\n        \"lzma\",\n        # test_macostools.py\n        \"macostools\",\n        # test_msilib.py\n        \"msilib\",\n        # test_namespace_pkgs.py\n        \"foo.one\",\n        \"foo.two\",\n        \"parent.child.one\",\n        \"parent.child.two\",\n        \"parent.child.three\",\n        \"bar.two\",\n        \"a_test\",\n        \"parent.child\",\n        \"parent\",\n        \"bar\",\n        # test_new.py\n        \"Spam\",\n        # test_ossaudiodev.py\n        \"ossaudiodev\",\n        # test_pathlib.py\n        \"pathlib\",\n        # test_platform.py\n        \"gestalt\",\n        # test_pickleable.py\n        \"email.headerregistry\",\n        # test_pkg.py\n        \"t1\",\n        \"t2\",\n        \"t2.sub\",\n        \"t2.sub.subsub\",\n        \"t3.sub.subsub\",\n        \"t5\",\n        \"t6\",\n        \"t7\",\n        \"t7.sub\",\n        \"t7.sub.subsub\",\n        \"t8\",\n        \"t3.sub\",\n        \"t3\",\n        # test_pkgutil.py\n        \"foo\",\n        \"foo.bar\",\n        \"foo.baz\",\n        \"zipimport\",\n        \"pkg\",\n        \"pkg.subpkg\",\n        \"pkg.subpkg.c\",\n        \"pkg.subpkg.d\",\n        # test_policy.py\n        \"email.policy\",\n        # test_urllib.py\n        \"urllib.parse\",\n        # test_urllib_response.py\n        \"urllib.response\",\n        # test_repr.py\n        \"\"\"areallylongpackageandmodulenametotestreprtruncation.\\\nareallylongpackageandmodulenametotestreprtruncation\"\"\",\n        \"areallylongpackageandmodulenametotestreprtruncation\",\n        # test_robotparser.py\n        \"urllib.error\",\n        \"urllib.robotparser\",\n        # test_runpy.py\n        \"test.script_helper\",\n        # test_secrets.py\n        \"secrets\",\n        # test_selectors.py\n        \"selectors\",\n        # test_statistics.py\n        \"statistics\",\n        # test_shelve.py\n        \"test.test_dbm\",\n        # test_strftime.py\n        \"java\",\n        # test_strop.py\n        \"strop\",\n        # test_sqlite3.py\n        \"sqlite3.test\",\n        # test_sundry.py\n        \"distutils.emxccompiler\",\n        \"os2emxpath\",\n        # test_tcl.py\n        \"tkinter\",\n        # test_tk.py\n        \"runtktests\",\n        \"tkinter.test\",\n        \"tkinter.test.support\",\n        # test_tools.py\n        \"analyze_dxp\",\n        \"test_unparse\",\n        \"importlib.machinery\",\n        # test_traceback.py\n        \"test_bug737473\",\n        # test_tracemalloc\n        \"tracemalloc\",\n        # test_typing.py\n        \"mock\",\n        \"typing.io\",\n        \"typing.re\",\n        # test_unittest.py\n        \"unittest.test\",\n        # test_wsgiref.py\n        \"test.test_httpservers\",\n        # test_xml_etree.py\n        \"xml.parsers.expat.errors\",\n        # test_xmlrpc.py\n        \"xmlrpc.client\",\n        # test_zipimport_support.py\n        \"test_zipped_doctest\",\n        \"zip_pkg\",\n        # test/test_zipimport_support.py\n        \"test.test_cmd_line_script\",\n        # test_winconsoleio.py\n        \"_testconsole\",\n        # Python3: modules that no longer exist\n        \"commands\",\n        \"dummy_thread\",\n        \"_dummy_thread\",\n        \"httplib\",\n        \"Queue\",\n        \"sets\",\n        # Python2: modules that don't yet exit\n        \"http.client\",\n        \"queue\",\n        \"winreg\",\n        # Very old modules with older names\n        \"simplejson\",\n        \"sets\",\n        # Standalone mode \"site\" import flexibilities\n        \"sitecustomize\",\n        \"usercustomize\",\n        \"apport_python_hook\",\n        \"_frozen_importlib\",\n        # Standard library stuff that is optional\n        \"comtypes.server.inprocserver\",\n        \"_tkinter\",\n        \"_scproxy\",\n        \"EasyDialogs\",\n        \"SOCKS\",\n        \"rourl2path\",\n        \"_winapi\",\n        \"win32api\",\n        \"win32con\",\n        \"_gestalt\",\n        \"java.lang\",\n        \"vms_lib\",\n        \"ic\",\n        \"readline\",\n        \"termios\",\n        \"_sysconfigdata\",\n        \"al\",\n        \"AL\",\n        \"sunaudiodev\",\n        \"SUNAUDIODEV\",\n        \"Audio_mac\",\n        \"nis\",\n        \"test.test_MimeWriter\",\n        \"dos\",\n        \"win32pipe\",\n        \"Carbon\",\n        \"Carbon.Files\",\n        \"sgi\",\n        \"ctypes.macholib.dyld\",\n        \"bsddb3\",\n        \"_pybsddb\",\n        \"_xmlrpclib\",\n        \"netbios\",\n        \"win32wnet\",\n        \"email.Parser\",\n        \"elementree.cElementTree\",\n        \"elementree.ElementTree\",\n        \"_gbdm\",\n        \"resource\",\n        \"crypt\",\n        \"bz2\",\n        \"dbm\",\n        \"mmap\",\n        \"Mailman\",\n        # Mercurial test\n        \"statprof\",\n        \"email.Generator\",\n        \"email.Utils\",\n        # setuptools does a lot of speculative stuff\n        \"wincertstore\",\n        \"setuptools_svn\",\n        # reportlab does use this if present only and warns about itself.\n        \"pyfribidi2\",\n        \"macfs\",\n        # psutils\n        \"_psutil_windows\",\n        # nose\n        \"unittest2\",\n        \"IronPython\",\n        \"clr\",\n        \"compiler.consts\",\n        \"new\",\n        # pkg_resources\n        \"pkg_resources.extern\",\n        \"ordereddict\",\n        # appdirs\n        \"com\",\n        \"win32com\",\n        # gtk\n        \"gdk\",\n        # six\n        \"six.moves\",\n        # Python3 namespace packages.\n        \"_frozen_importlib_external\",\n        # Garbage from PyWin32\n        \"pywin32_bootstrap\",\n    )\n\n\ndef isIgnoreListedNotExistingModule(module_name):\n    if module_name in sys.builtin_module_names and not isNuitkaPython():\n        raise NuitkaOptimizationError(\n            \"\"\"\nYour CPython version has a built-in module '%s', that is not ignore listed\nplease report this as a bug.\"\"\"\n            % module_name,\n        )\n\n    return module_name.hasOneOfNamespaces(getModuleIgnoreList())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/ImportCache.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Import cache.\n\nThis is not about caching the search of modules in the file system, but about\nmaintaining a cache of module trees built.\n\nIt can happen that modules become unused, and then dropped from active modules,\nand then later active again, via another import, and in this case, we should\nnot start anew, but reuse what we already found out about it.\n\"\"\"\n\nimport os\n\nfrom nuitka.plugins.Plugins import Plugins\n\nimported_modules = {}\nimported_by_name = {}\n\n\ndef addImportedModule(imported_module):\n    module_filename = os.path.abspath(imported_module.getFilename())\n\n    if os.path.basename(module_filename) == \"__init__.py\":\n        module_filename = os.path.dirname(module_filename)\n\n    key = (module_filename, imported_module.getFullName())\n\n    if key in imported_modules:\n        assert imported_module is imported_modules[key], key\n    else:\n        Plugins.onModuleDiscovered(imported_module)\n\n    imported_modules[key] = imported_module\n    imported_by_name[imported_module.getFullName()] = imported_module\n\n    # We don't expect that to happen.\n    assert not imported_module.isMainModule()\n\n\ndef isImportedModuleByName(full_name):\n    return full_name in imported_by_name\n\n\ndef getImportedModuleByName(full_name):\n    return imported_by_name[full_name]\n\n\ndef getImportedModuleByNameAndPath(full_name, module_filename):\n    if module_filename is None:\n        # pyi deps only\n        return getImportedModuleByName(full_name)\n\n    # For caching we use absolute paths only.\n    module_filename = os.path.abspath(module_filename)\n\n    if os.path.basename(module_filename) == \"__init__.py\":\n        module_filename = os.path.dirname(module_filename)\n\n    # KeyError is valid result.\n    return imported_modules[module_filename, full_name]\n\n\ndef replaceImportedModule(old, new):\n    for key, value in imported_by_name.items():\n        if value == old:\n            imported_by_name[key] = new\n            break\n    else:\n        assert False\n\n    for key, value in imported_modules.items():\n        if value == old:\n            imported_modules[key] = new\n            break\n    else:\n        assert False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/ImportResolving.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This cares about resolving module names at compile time compensating meta path based importers.\n\n\"\"\"\n\nfrom nuitka.__past__ import unicode\nfrom nuitka.Options import isExperimental\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.ModuleNames import ModuleName\n\n# spell-checker: ignore Tkdnd gdbm cookielib htmlentitydefs CGIHTTPServer Tkconstants\n# spell-checker: ignore tkinter_tkfiledialog tkinter_tksimpledialog xmlrpclib\n\n_six_moves = {\n    \"six.moves.builtins\": \"__builtin__\" if python_version < 0x300 else \"builtins\",\n    \"six.moves.configparser\": (\n        \"ConfigParser\" if python_version < 0x300 else \"configparser\"\n    ),\n    \"six.moves.copyreg\": \"copy_reg\" if python_version < 0x300 else \"copyreg\",\n    \"six.moves.dbm_gnu\": \"gdbm\" if python_version < 0x300 else \"dbm.gnu\",\n    \"six.moves._dummy_thread\": (\n        \"dummy_thread\" if python_version < 0x300 else \"_dummy_thread\"\n    ),\n    \"six.moves.http_cookiejar\": (\n        \"cookielib\" if python_version < 0x300 else \"http.cookiejar\"\n    ),\n    \"six.moves.http_cookies\": \"Cookie\" if python_version < 0x300 else \"http.cookies\",\n    \"six.moves.html_entities\": (\n        \"htmlentitydefs\" if python_version < 0x300 else \"html.entities\"\n    ),\n    \"six.moves.html_parser\": \"HTMLParser\" if python_version < 0x300 else \"html.parser\",\n    \"six.moves.http_client\": \"httplib\" if python_version < 0x300 else \"http.client\",\n    \"six.moves.email_mime_multipart\": (\n        \"email.MIMEMultipart\" if python_version < 0x300 else \"email.mime.multipart\"\n    ),\n    \"six.moves.email_mime_nonmultipart\": (\n        \"email.MIMENonMultipart\"\n        if python_version < 0x300\n        else \"email.mime.nonmultipart\"\n    ),\n    \"six.moves.email_mime_text\": (\n        \"email.MIMEText\" if python_version < 0x300 else \"email.mime.text\"\n    ),\n    \"six.moves.email_mime_base\": (\n        \"email.MIMEBase\" if python_version < 0x300 else \"email.mime.base\"\n    ),\n    \"six.moves.BaseHTTPServer\": (\n        \"BaseHTTPServer\" if python_version < 0x300 else \"http.server\"\n    ),\n    \"six.moves.CGIHTTPServer\": (\n        \"CGIHTTPServer\" if python_version < 0x300 else \"http.server\"\n    ),\n    \"six.moves.SimpleHTTPServer\": (\n        \"SimpleHTTPServer\" if python_version < 0x300 else \"http.server\"\n    ),\n    \"six.moves.cPickle\": \"cPickle\" if python_version < 0x300 else \"pickle\",\n    \"six.moves.queue\": \"Queue\" if python_version < 0x300 else \"queue\",\n    \"six.moves.reprlib\": \"repr\" if python_version < 0x300 else \"reprlib\",\n    \"six.moves.socketserver\": (\n        \"SocketServer\" if python_version < 0x300 else \"socketserver\"\n    ),\n    \"six.moves._thread\": \"thread\" if python_version < 0x300 else \"_thread\",\n    \"six.moves.tkinter\": \"Tkinter\" if python_version < 0x300 else \"tkinter\",\n    \"six.moves.tkinter_dialog\": (\n        \"Dialog\" if python_version < 0x300 else \"tkinter.dialog\"\n    ),\n    \"six.moves.tkinter_filedialog\": (\n        \"FileDialog\" if python_version < 0x300 else \"tkinter.filedialog\"\n    ),\n    \"six.moves.tkinter_scrolledtext\": (\n        \"ScrolledText\" if python_version < 0x300 else \"tkinter.scrolledtext\"\n    ),\n    \"six.moves.tkinter_simpledialog\": (\n        \"SimpleDialog\" if python_version < 0x300 else \"tkinter.simpledialog\"\n    ),\n    \"six.moves.tkinter_tix\": \"Tix\" if python_version < 0x300 else \"tkinter.tix\",\n    \"six.moves.tkinter_ttk\": \"ttk\" if python_version < 0x300 else \"tkinter.ttk\",\n    \"six.moves.tkinter_constants\": (\n        \"Tkconstants\" if python_version < 0x300 else \"tkinter.constants\"\n    ),\n    \"six.moves.tkinter_dnd\": \"Tkdnd\" if python_version < 0x300 else \"tkinter.dnd\",\n    \"six.moves.tkinter_colorchooser\": (\n        \"tkColorChooser\" if python_version < 0x300 else \"tkinter_colorchooser\"\n    ),\n    \"six.moves.tkinter_commondialog\": (\n        \"tkCommonDialog\" if python_version < 0x300 else \"tkinter_commondialog\"\n    ),\n    \"six.moves.tkinter_tkfiledialog\": (\n        \"tkFileDialog\" if python_version < 0x300 else \"tkinter.filedialog\"\n    ),\n    \"six.moves.tkinter_font\": \"tkFont\" if python_version < 0x300 else \"tkinter.font\",\n    \"six.moves.tkinter_messagebox\": (\n        \"tkMessageBox\" if python_version < 0x300 else \"tkinter.messagebox\"\n    ),\n    \"six.moves.tkinter_tksimpledialog\": (\n        \"tkSimpleDialog\" if python_version < 0x300 else \"tkinter_tksimpledialog\"\n    ),\n    \"six.moves.urllib_parse\": None if python_version < 0x300 else \"urllib.parse\",\n    \"six.moves.urllib_error\": None if python_version < 0x300 else \"urllib.error\",\n    \"six.moves.urllib_robotparser\": (\n        \"robotparser\" if python_version < 0x300 else \"urllib.robotparser\"\n    ),\n    \"six.moves.xmlrpc_client\": (\n        \"xmlrpclib\" if python_version < 0x300 else \"xmlrpc.client\"\n    ),\n    \"six.moves.xmlrpc_server\": (\n        \"SimpleXMLRPCServer\" if python_version < 0x300 else \"xmlrpc.server\"\n    ),\n    \"six.moves.winreg\": \"_winreg\" if python_version < 0x300 else \"winreg\",\n    \"six.moves.urllib.request\": (\n        \"urllib2\" if python_version < 0x300 else \"urllib.request\"\n    ),\n}\n\n\ndef resolveModuleName(module_name):\n    \"\"\"Resolve a module name to its real module name.\"\"\"\n\n    # return driven, pylint: disable=too-many-return-statements\n\n    # TODO: This is not handling decoding errors all that well.\n    if str is not unicode and type(module_name) is unicode:\n        module_name = str(module_name)\n\n    module_name = ModuleName(module_name)\n\n    # TODO: Allow this to be done by plugins. We compensate meta path based\n    # importer effects here.\n    if module_name.isBelowNamespace(\"bottle.ext\"):\n        # bottle.ext.something -> bottle_something\n        return ModuleName(\n            \"bottle_\"\n            + module_name.splitPackageName()[1].splitPackageName()[1].asString()\n        )\n    elif module_name.isBelowNamespace(\"requests.packages\"):\n        # requests.packages.something -> something\n        return module_name.splitPackageName()[1].splitPackageName()[1]\n    elif module_name.isBelowNamespace(\"pkg_resources.extern\"):\n        # pkg_resources.extern.something -> pkg_resources._vendor.something\n        return ModuleName(\"pkg_resources._vendor\").getChildNamed(\n            module_name.getBasename()\n        )\n    elif module_name in _six_moves:\n        # six moves replicated\n        return ModuleName(_six_moves[module_name])\n    elif (\n        module_name.hasNamespace(\"importlib_metadata\")\n        and python_version >= 0x380\n        and isExperimental(\"eliminate-backports\")\n    ):\n        return module_name.relocateModuleNamespace(\n            \"importlib_metadata\", \"importlib.metadata\"\n        )\n    elif (\n        module_name.hasNamespace(\"importlib_resources\")\n        and python_version >= 0x390\n        and isExperimental(\"eliminate-backports\")\n    ):\n        # The backport has this, and we have no replacement.\n        if module_name == \"importlib_resources.abc\":\n            return module_name\n\n        return module_name.relocateModuleNamespace(\n            \"importlib_resources\", \"importlib.resources\"\n        )\n    else:\n        return module_name\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/Importing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Locating modules and package source on disk.\n\nThe actual import of a module would already execute code that changes things.\nImagine a module that does ``os.system()``, it would be done during\ncompilation. People often connect to databases, and these kind of things, at\nimport time.\n\nTherefore CPython exhibits the interfaces in an ``imp`` module in standard\nlibrary, which one can use those to know ahead of time, what file import would\nload. For us unfortunately there is nothing in CPython that is easily\naccessible and gives us this functionality for packages and search paths\nexactly like CPython does, so we implement here a multi step search process\nthat is compatible.\n\nThis approach is much safer of course and there is no loss. To determine if\nit's from the standard library, one can abuse the attribute ``__file__`` of the\n``os`` module like it's done in ``isStandardLibraryPath`` of this module.\n\n\"\"\"\n\nimport collections\nimport os\nimport sys\nimport zipfile\n\nfrom nuitka import SourceCodeReferences\nfrom nuitka.__past__ import iter_modules\nfrom nuitka.containers.Namedtuples import makeNamedtupleClass\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonFlavors import isNuitkaPython\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import my_print, recursion_logger\nfrom nuitka.tree.ReformulationMultidist import locateMultidistModule\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import listDir, removeDirectory\nfrom nuitka.utils.Hashing import getFileContentsHash\nfrom nuitka.utils.Importing import (\n    builtin_module_names,\n    getModuleFilenameSuffixes,\n    getSharedLibrarySuffixes,\n    isBuiltinModuleName,\n)\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.SharedLibraries import (\n    hasUniversalOrMatchingMacOSArchitecture,\n)\nfrom nuitka.utils.Utils import isMacOS, isWin32OrPosixWindows\n\nfrom .IgnoreListing import isIgnoreListedNotExistingModule\nfrom .PreloadedPackages import getPreloadedPackagePath, isPreloadedPackagePath\nfrom .StandardLibrary import isStandardLibraryPath\n\n# Debug traces, enabled via --explain-imports\n_debug_module_finding = None\n\n# Preference as expressed via --prefer-source-code\n_prefer_source_code_over_extension_modules = None\n\n\ndef setupImportingFromOptions():\n    \"\"\"Set up the importing layer from giving options.\"\"\"\n\n    # Should only be used inside of here.\n    from nuitka import Options\n\n    # singleton, pylint: disable=global-statement\n    global _debug_module_finding\n    _debug_module_finding = Options.shallExplainImports()\n\n    global _prefer_source_code_over_extension_modules\n    _prefer_source_code_over_extension_modules = (\n        Options.shallPreferSourceCodeOverExtensionModules()\n    )\n\n    # Lets try and have this complete, please report failures.\n    if Options.is_debug and not isNuitkaPython():\n        _checkRaisingBuiltinComplete()\n\n    main_filenames = Options.getMainEntryPointFilenames()\n    for filename in main_filenames:\n        # Inform the importing layer about the main script directory, so it can use\n        # it when attempting to follow imports.\n        addMainScriptDirectory(main_dir=os.path.dirname(os.path.abspath(filename)))\n\n\ndef _checkRaisingBuiltinComplete():\n    for module_name in builtin_module_names:\n        assert module_name in _stdlib_module_raises, module_name\n\n\nwarned_about = set()\n\n# Directory where the main script lives. Should attempt to import from there.\n_main_paths = OrderedSet()\n\n# Additions to sys.paths from plugins.\n_extra_paths = OrderedSet()\n\nModuleUsageAttempt = makeNamedtupleClass(\n    \"ModuleUsageAttempt\",\n    (\n        \"module_name\",\n        \"filename\",\n        \"module_kind\",\n        \"finding\",\n        \"level\",\n        \"source_ref\",\n        \"reason\",\n    ),\n)\n\n\ndef makeModuleUsageAttempt(\n    module_name, filename, module_kind, finding, level, source_ref, reason\n):\n    assert source_ref is not None\n\n    return ModuleUsageAttempt(\n        module_name=module_name,\n        filename=filename,\n        module_kind=module_kind,\n        finding=finding,\n        level=level,\n        source_ref=source_ref,\n        reason=reason,\n    )\n\n\ndef addMainScriptDirectory(main_dir):\n    \"\"\"Initialize the main script directory.\n\n    We use this as part of the search path for modules.\n    \"\"\"\n    _main_paths.add(main_dir)\n\n\ndef addExtraSysPaths(directories):\n    for directory in directories:\n        assert os.path.isdir(directory), directory\n\n        _extra_paths.add(directory)\n\n\ndef hasMainScriptDirectory():\n    return bool(_main_paths)\n\n\ndef isPackageDir(dirname):\n    \"\"\"Decide if a directory is a package.\n\n    Before Python3.3 it's required to have a \"__init__.py\" file, but then\n    it became impossible to decide, and for extra fun, there is also the\n    extra packages provided via \"*.pth\" file tricks by \"site.py\" loading.\n    \"\"\"\n\n    return (\n        \".\" not in os.path.basename(dirname)\n        and os.path.isdir(dirname)\n        and (\n            python_version >= 0x300\n            or os.path.isfile(os.path.join(dirname, \"__init__.py\"))\n            or isPreloadedPackagePath(dirname)\n        )\n    )\n\n\ndef getModuleNameAndKindFromFilename(module_filename):\n    \"\"\"Given a filename, decide the module name and kind.\n\n    Args:\n        module_name - file path of the module\n    Returns:\n        Tuple with the name of the module basename, and the kind of the\n        module derived from the file suffix. Can be None, None if is is not a\n        known file suffix.\n    Notes:\n        This doesn't concern itself with packages, that needs to be tracked\n        by the using code. It cannot be decided from the filename at all.\n    \"\"\"\n\n    if module_filename.endswith(\".py\"):\n        return ModuleName(os.path.basename(module_filename)[:-3]), \"py\"\n\n    if module_filename.endswith(\".pyc\"):\n        return ModuleName(os.path.basename(module_filename)[:-4]), \"pyc\"\n\n    for suffix in getSharedLibrarySuffixes():\n        if module_filename.endswith(suffix):\n            return (\n                ModuleName(os.path.basename(module_filename)[: -len(suffix)]),\n                \"extension\",\n            )\n\n    if os.path.isdir(module_filename):\n        return ModuleName(os.path.basename(module_filename)), \"py\"\n\n    return None, None\n\n\ndef isIgnoreListedImportMaker(source_ref):\n    if isNuitkaPython():\n        return True\n\n    return isStandardLibraryPath(source_ref.getFilename())\n\n\ndef warnAboutNotFoundImport(importing, module_name, level, source_ref):\n    # This probably should not be dealt with here\n    if module_name == \"\":\n        return\n\n    if not isIgnoreListedNotExistingModule(\n        module_name\n    ) and not isIgnoreListedImportMaker(source_ref):\n        key = module_name, level\n\n        if key not in warned_about:\n            warned_about.add(key)\n\n            if Plugins.suppressUnknownImportWarning(\n                importing=importing, source_ref=source_ref, module_name=module_name\n            ):\n                return\n\n            if level == 0:\n                level_desc = \"as absolute import\"\n            elif level == -1:\n                level_desc = \"as relative or absolute import\"\n            elif level == 1:\n                level_desc = \"%d package level up\" % level\n            else:\n                level_desc = \"%d package levels up\" % level\n\n            if _debug_module_finding:\n                if importing.getFullName().getPackageName() is not None:\n                    recursion_logger.warning(\n                        \"%s: Cannot find '%s' in package '%s' %s.\"\n                        % (\n                            importing.getSourceReference().getAsString(),\n                            module_name,\n                            importing.getFullName().getPackageName().asString(),\n                            level_desc,\n                        )\n                    )\n                else:\n                    recursion_logger.warning(\n                        \"%s: Cannot find '%s' %s.\"\n                        % (\n                            importing.getSourceReference().getAsString(),\n                            module_name,\n                            level_desc,\n                        )\n                    )\n\n\ndef normalizePackageName(module_name):\n    # The \"os.path\" is strangely hacked into the \"os\" module, dispatching per\n    # platform, we either cannot look into it, or we require that we resolve it\n    # here correctly.\n    if module_name == \"os.path\":\n        module_name = ModuleName(os.path.basename(os.path.__name__))\n\n    return module_name\n\n\ndef findModule(module_name, parent_package, level):\n    \"\"\"Find a module with given package name as parent.\n\n    The package name can be None of course. Level is the same\n    as with \"__import__\" built-in. Warnings are optional.\n\n    Returns:\n        Returns a triple of package name the module is in, filename of\n        it, which can be a directory for packages, and the location\n        method used.\n    \"\"\"\n    # We have many branches here, because there are a lot of cases to try.\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    assert type(module_name) is ModuleName, module_name\n\n    if _debug_module_finding:\n        my_print(\n            \"findModule: Enter to search %r in package %r level %s.\"\n            % (module_name, parent_package, level)\n        )\n\n    # Do not allow star imports to get here. We just won't find modules with\n    # that name, but it would be wasteful.\n    assert module_name != \"*\"\n\n    if level > 1:\n        # TODO: Should give a warning and return not found if the levels\n        # exceed the package name.\n        if parent_package is not None:\n            parent_package = parent_package.getRelativePackageName(level)\n        else:\n            return None, None, None, \"not-found\"\n\n    if level == 1 and not module_name:\n        # Not actually allowed, but we only catch that at run-time.\n        if parent_package is None:\n            return None, None, None, \"not-found\"\n\n        module_name = parent_package\n        parent_package = None\n        level = 0\n\n    # Try relative imports first if we have a parent package.\n    if level != 0 and parent_package is not None:\n        if module_name:\n            full_name = ModuleName(parent_package + \".\" + module_name)\n        else:\n            full_name = ModuleName(parent_package)\n\n        full_name = normalizePackageName(full_name)\n\n        preloaded_path = getPreloadedPackagePath(module_name)\n\n        if preloaded_path is not None:\n            for module_filename in preloaded_path:\n                if os.path.exists(module_filename):\n                    break\n            else:\n                module_filename = None\n\n            return full_name.getPackageName(), module_filename, \"py\", \"pth\"\n\n        try:\n            module_filename, module_kind = _findModule(module_name=full_name)\n        except ImportError:\n            # For relative import, that is OK, we will still try absolute.\n            pass\n        else:\n            if _debug_module_finding:\n                my_print(\n                    \"findModule: Relative imported module '%s' as '%s' in filename '%s':\"\n                    % (module_name, full_name, module_filename)\n                )\n\n            return full_name.getPackageName(), module_filename, module_kind, \"relative\"\n\n    if level < 1 and module_name:\n        module_name = normalizePackageName(module_name)\n\n        package_name = module_name.getPackageName()\n\n        preloaded_path = getPreloadedPackagePath(module_name)\n\n        if preloaded_path is not None:\n            for module_filename in preloaded_path:\n                if os.path.exists(module_filename):\n                    break\n            else:\n                module_filename = None\n\n            return package_name, module_filename, \"py\", \"pth\"\n\n        try:\n            module_filename, module_kind = _findModule(module_name=module_name)\n        except ImportError:\n            # For relative import, that is OK, we will still try absolute.\n            pass\n        else:\n            if _debug_module_finding:\n                my_print(\n                    \"findModule: Found absolute imported module '%s' in filename '%s':\"\n                    % (module_name, module_filename)\n                )\n\n            return package_name, module_filename, module_kind, \"absolute\"\n\n    return None, None, None, \"not-found\"\n\n\n# Some platforms are case insensitive.\ncase_sensitive = not isMacOS() and not isWin32OrPosixWindows()\n\nImportScanFinding = collections.namedtuple(\n    \"ImportScanFinding\",\n    (\"found_in\", \"module_type\", \"priority\", \"full_path\", \"search_order\"),\n)\n\n# We put here things that are not worth it (Cython is not really used by\n# anything really, or where it's know to not have a big # impact, e.g. lxml.\n\nunworthy_namespaces = (\"Cython\", \"lxml\")\n\n\ndef _reportCandidates(package_name, module_name, candidate, candidates):\n    module_name = (\n        package_name.getChildNamed(module_name)\n        if package_name is not None\n        else module_name\n    )\n\n    if candidate.priority == 1 and _prefer_source_code_over_extension_modules is None:\n        for c in candidates:\n            # Don't compare to itself and don't consider unused bytecode a problem.\n            if c is candidate or c.priority == 3:\n                continue\n\n            if c.search_order == candidate.search_order:\n                if not module_name.hasOneOfNamespaces(unworthy_namespaces):\n                    recursion_logger.info(\n                        \"\"\"\\\nShould decide '--prefer-source-code' vs. '--no-prefer-source-code', using \\\nexisting '%s' extension module by default. Candidates were: %s <-> %s.\"\"\"\n                        % (module_name, candidate, c)\n                    )\n\n\n_list_dir_cache = {}\n\n\ndef listDirCached(path):\n    \"\"\"Cached listing of a directory.\"\"\"\n\n    if path not in _list_dir_cache:\n        _list_dir_cache[path] = tuple(listDir(path))\n\n    return _list_dir_cache[path]\n\n\ndef flushImportCache():\n    \"\"\"Clear import related caches.\n\n    In some situations, e.g. during package rebuild, we scan and then decide to remove\n    files and scan again. This allows that. Nothing in standard Nuitka should do it,\n    as it throws away so much.\n    \"\"\"\n    _list_dir_cache.clear()\n    module_search_cache.clear()\n\n\ndef _findModuleInPath2(package_name, module_name, search_path):\n    \"\"\"This is out own module finding low level implementation.\n\n    Just the full module name and search path are given. This is then\n    tasked to raise \"ImportError\" or return a path if it finds it, or\n    None, if it is a built-in.\n    \"\"\"\n    # We have many branches here, because there are a lot of cases to try.\n    # pylint: disable=too-many-branches,too-many-locals\n\n    # We may have to decide between package and module, therefore build\n    # a list of candidates.\n    candidates = OrderedSet()\n\n    considered = set()\n\n    # Higher values are lower priority.\n    priority_map = {\n        \"PY_COMPILED\": 3,\n        \"PY_SOURCE\": 0 if _prefer_source_code_over_extension_modules else 2,\n        \"C_EXTENSION\": 1,\n    }\n\n    for count, entry in enumerate(search_path):\n        # Don't try again, just with an entry of different casing or complete\n        # duplicate.\n        if os.path.normcase(entry) in considered:\n            continue\n        considered.add(os.path.normcase(entry))\n\n        package_directory = os.path.join(entry, module_name.asPath())\n\n        # First, check for a package with an init file, that would be the\n        # first choice.\n        if os.path.isdir(package_directory):\n            found = False\n\n            for suffix, module_type in getModuleFilenameSuffixes():\n                if module_type == \"C_EXTENSION\":\n                    continue\n\n                package_file_name = \"__init__\" + suffix\n\n                file_path = os.path.join(package_directory, package_file_name)\n\n                if os.path.isfile(file_path):\n                    candidates.add(\n                        ImportScanFinding(\n                            found_in=entry,\n                            module_type=module_type,\n                            priority=priority_map[module_type],\n                            full_path=package_directory,\n                            search_order=count,\n                        )\n                    )\n                    found = True\n\n            if not found and python_version >= 0x300:\n                candidates.add(\n                    ImportScanFinding(\n                        found_in=entry,\n                        module_type=10,\n                        priority=10,\n                        full_path=package_directory,\n                        search_order=count + len(search_path),\n                    )\n                )\n\n        # Then, check out suffixes of all kinds, but only for one directory.\n        last_module_type = 0\n        for suffix, module_type in getModuleFilenameSuffixes():\n            # Use first match per kind only.\n            if module_type == last_module_type:\n                continue\n\n            full_path = os.path.join(entry, module_name + suffix)\n\n            if os.path.isfile(full_path):\n                candidates.add(\n                    ImportScanFinding(\n                        found_in=entry,\n                        module_type=module_type,\n                        priority=4 + priority_map[module_type],\n                        full_path=full_path,\n                        search_order=count,\n                    )\n                )\n                last_module_type = module_type\n\n    if _debug_module_finding:\n        my_print(\"Candidates:\", candidates)\n\n    found_candidate = None\n\n    if candidates:\n        # Sort by priority, with entries from same path element coming first, then desired type.\n        candidates = tuple(\n            sorted(candidates, key=lambda c: (c.search_order, c.priority))\n        )\n\n        # On case sensitive systems, no resolution needed.\n        if case_sensitive:\n            found_candidate = candidates[0]\n        else:\n            for candidate in candidates:\n                for fullname, _filename in listDirCached(candidate.found_in):\n                    if fullname == candidate.full_path:\n                        found_candidate = candidate\n                        break\n\n                if found_candidate:\n                    break\n\n            # Only exact case matches matter, all candidates were ignored,\n            # lets just fall through to raising the import error.\n\n    if found_candidate is None:\n        # Nothing found.\n        raise ImportError\n    if (\n        found_candidate.module_type == \"C_EXTENSION\"\n        and isMacOS()\n        and not hasUniversalOrMatchingMacOSArchitecture(found_candidate.full_path)\n    ):\n        # Not usable for target architecture.\n        raise ImportError\n\n    _reportCandidates(\n        package_name=package_name,\n        module_name=module_name,\n        candidate=found_candidate,\n        candidates=candidates,\n    )\n\n    return (\n        found_candidate.full_path,\n        \"extension\" if found_candidate.module_type == \"C_EXTENSION\" else \"py\",\n    )\n\n\n_egg_files = {}\n\n\ndef _unpackPathElement(path_entry):\n    if not path_entry:\n        return \".\"  # empty means current directory\n\n    if os.path.isfile(path_entry):\n        if path_entry.lower().endswith((\".egg\", \".zip\")):\n            if path_entry not in _egg_files:\n                checksum = getFileContentsHash(path_entry)\n\n                target_dir = os.path.join(getCacheDir(\"egg-content\"), checksum)\n\n                if not os.path.exists(target_dir):\n                    try:\n                        # Not all Python versions allow using with here, pylint: disable=consider-using-with\n                        zip_ref = zipfile.ZipFile(path_entry, \"r\")\n                        zip_ref.extractall(target_dir)\n                        zip_ref.close()\n                    except BaseException:\n                        removeDirectory(target_dir, ignore_errors=True)\n                        raise\n\n                _egg_files[path_entry] = target_dir\n\n            return _egg_files[path_entry]\n\n    return path_entry\n\n\ndef getPythonUnpackedSearchPath():\n    \"\"\"Python search path with with eggs unpacked.\"\"\"\n\n    # TODO: Maybe cache this for a given \"sys.path\" as we do IO checks each time.\n    return [_unpackPathElement(path_element) for path_element in sys.path]\n\n\ndef getPackageSearchPath(package_name):\n    if not _main_paths:\n        return None\n\n    if package_name is None:\n        result = (\n            [os.getcwd()]\n            + list(_main_paths)\n            + getPythonUnpackedSearchPath()\n            + list(_extra_paths)\n        )\n    elif \".\" in package_name:\n        parent_package_name, child_package_name = package_name.splitModuleBasename()\n\n        result = []\n        for element in getPackageSearchPath(parent_package_name):\n            package_dir = os.path.join(element, child_package_name.asPath())\n\n            if isPackageDir(package_dir):\n                result.append(package_dir)\n                # Hack for \"uniconvertor\". TODO: Move this to plug-in decision. This\n                # fails the above test, but at run time should be a package.\n                # spell-checker: ignore uniconvertor\n            elif package_name == \"uniconvertor.app.modules\":\n                result.append(package_dir)\n\n        return result\n\n    else:\n        preloaded_path = getPreloadedPackagePath(package_name)\n\n        if preloaded_path is not None:\n            return preloaded_path\n\n        def getPackageDirCandidates(element):\n            yield os.path.join(element, package_name.asPath()), False\n\n            for extra_path in Plugins.getPackageExtraScanPaths(package_name, element):\n                yield extra_path, True\n\n        result = []\n        for element in getPackageSearchPath(None):\n            for package_dir, force_package in getPackageDirCandidates(element):\n                if isPackageDir(package_dir) or force_package:\n                    result.append(package_dir)\n\n    result = [element for element in result if os.path.exists(element)]\n    return OrderedSet(result)\n\n\ndef _findModuleInPath(module_name):\n    package_name, module_name = module_name.splitModuleBasename()\n\n    if _debug_module_finding:\n        my_print(\"_findModuleInPath: Enter\", module_name, \"in\", package_name)\n\n    # The \"site\" module must be located based on PYTHONPATH before it was\n    # executed, while we normally search in PYTHONPATH after it was executed,\n    # and on some systems, that fails.\n    if package_name is None and module_name == \"site\":\n        candidate = os.getenv(\"NUITKA_SITE_FILENAME\")\n\n        if candidate:\n            return candidate, \"py\"\n\n    # Free pass for built-in modules, they need not exist.\n    if package_name is None and isBuiltinModuleName(module_name):\n        return None, \"built-in\"\n\n    search_path = getPackageSearchPath(package_name)\n\n    if _debug_module_finding:\n        my_print(\n            \"_findModuleInPath: Using search path\", search_path, \"for\", package_name\n        )\n\n    try:\n        module_filename, module_kind = _findModuleInPath2(\n            package_name=package_name, module_name=module_name, search_path=search_path\n        )\n    except SyntaxError:\n        # Warn user, as this is kind of unusual.\n        recursion_logger.warning(\n            \"%s: Module cannot be imported due to syntax errors.\",\n            module_name if package_name is None else package_name + \".\" + module_name,\n        )\n\n        return None, None\n\n    if _debug_module_finding:\n        my_print(\"_findModuleInPath: _findModuleInPath2 gave\", module_filename)\n\n    return module_filename, module_kind\n\n\nmodule_search_cache = {}\n\n\ndef _findModule(module_name):\n    # Not a good module name. TODO: Push this to ModuleName() creation maybe.\n    assert module_name != \"\"\n\n    if _debug_module_finding:\n        my_print(\"_findModule: Enter to search '%s'.\" % (module_name,))\n\n    assert module_name.getBasename(), module_name\n\n    key = module_name\n\n    if key in module_search_cache:\n        result = module_search_cache[key]\n\n        if _debug_module_finding:\n            my_print(\"_findModule: Cached result (see previous call).\")\n\n        if result is ImportError:\n            raise ImportError\n\n        return result\n\n    try:\n        module_search_cache[key] = _findModuleInPath(module_name)\n    except ImportError:\n        module_search_cache[key] = ImportError\n        raise\n\n    # assert len(module_search_cache[key]) == 2, (module_name, module_search_cache[key])\n\n    return module_search_cache[key]\n\n\ndef locateModule(module_name, parent_package, level):\n    \"\"\"Locate a module with given package name as parent.\n\n    The package name can be None of course. Level is the same\n    as with \"__import__\" built-in.\n\n    Returns:\n        Returns a tuple of module name the module has considering\n        package containing it, and filename of it which can be a\n        directory for packages, the module kind, and the finding\n        kind.\n    \"\"\"\n\n    if module_name.isMultidistModuleName():\n        return locateMultidistModule(module_name)\n\n    module_package, module_filename, module_kind, finding = findModule(\n        module_name=module_name,\n        parent_package=parent_package,\n        level=level,\n    )\n\n    # Allowing ourselves to be lazy.\n    assert module_kind is not None or module_filename is None, module_name\n\n    assert module_package is None or (\n        type(module_package) is ModuleName and module_package != \"\"\n    ), repr(module_package)\n\n    if module_filename is not None:\n        module_filename = os.path.normpath(module_filename)\n\n        module_name, module_kind = getModuleNameAndKindFromFilename(module_filename)\n        module_name = ModuleName.makeModuleNameInPackage(module_name, module_package)\n    elif finding == \"not-found\":\n        if parent_package is not None:\n            if not module_name:\n                module_name = parent_package\n            elif level != 0:\n                module_name = ModuleName.makeModuleNameInPackage(\n                    package_name=parent_package, module_name=module_name\n                )\n        elif level > 0:\n            module_name = ModuleName(\"\")\n\n    return module_name, module_filename, module_kind, finding\n\n\ndef locateModules(package_name):\n    \"\"\"Determine child module names.\n\n    Return:\n        generator of ModuleName objects\n    \"\"\"\n    package_name = ModuleName(package_name)\n\n    module_filename = locateModule(\n        module_name=ModuleName(package_name), parent_package=None, level=0\n    )[1]\n\n    if module_filename is not None:\n        for sub_module in iter_modules([module_filename]):\n            yield package_name.getChildNamed(sub_module.name)\n\n\ndef decideModuleSourceRef(filename, module_name, is_main, is_fake, logger):\n    # Many branches due to the many cases\n\n    assert type(module_name) is ModuleName, module_name\n    assert filename is not None\n\n    is_namespace = False\n    is_package = False\n\n    if is_main and os.path.isdir(filename):\n        source_filename = os.path.join(filename, \"__main__.py\")\n\n        if not os.path.isfile(source_filename):\n            sys.stderr.write(\n                \"%s: can't find '__main__' module in '%s'\\n\"\n                % (os.path.basename(sys.argv[0]), filename)\n            )\n            sys.exit(2)\n\n        filename = source_filename\n\n        main_added = True\n    else:\n        main_added = False\n\n    if is_fake:\n        source_filename = filename\n\n        source_ref = SourceCodeReferences.fromFilename(filename=filename)\n\n        module_name = is_fake\n\n    elif os.path.isfile(filename):\n        source_filename = filename\n\n        source_ref = SourceCodeReferences.fromFilename(filename=filename)\n\n    elif isPackageDir(filename):\n        is_package = True\n\n        source_filename = os.path.join(filename, \"__init__.py\")\n\n        if not os.path.isfile(source_filename):\n            source_ref = SourceCodeReferences.fromFilename(\n                filename=filename\n            ).atInternal()\n            is_namespace = True\n        else:\n            source_ref = SourceCodeReferences.fromFilename(\n                filename=os.path.abspath(source_filename)\n            )\n\n    else:\n        logger.sysexit(\n            \"%s: can't open file '%s'.\" % (os.path.basename(sys.argv[0]), filename),\n            exit_code=2,\n        )\n\n    return (\n        main_added,\n        is_package,\n        is_namespace,\n        source_ref,\n        source_filename,\n    )\n\n\n# spell-checker: ignore _posixsubprocess,pyexpat,xxsubtype\n\n_stdlib_module_raises = {\n    \"__builtin__\": False,\n    \"_abc\": False,\n    \"_ast\": False,\n    \"_bisect\": False,\n    \"_blake2\": False,\n    \"_bytesio\": False,\n    \"_codecs\": False,\n    \"_codecs_cn\": False,\n    \"_codecs_hk\": False,\n    \"_codecs_iso2022\": False,\n    \"_codecs_jp\": False,\n    \"_codecs_kr\": False,\n    \"_codecs_tw\": False,\n    \"_collections\": False,\n    \"_contextvars\": False,\n    \"_csv\": False,\n    \"_datetime\": False,\n    \"_elementtree\": False,\n    \"_fileio\": False,\n    \"_functools\": False,\n    \"_heapq\": False,\n    \"_hotshot\": False,\n    \"_imp\": False,\n    \"_io\": False,\n    \"_json\": False,\n    \"_locale\": False,\n    \"_lsprof\": False,\n    \"_md5\": False,\n    \"_multibytecodec\": False,\n    \"_opcode\": False,\n    \"_operator\": False,\n    \"_peg_parser\": False,\n    \"_pickle\": False,\n    \"_posixsubprocess\": False,\n    \"_random\": False,\n    \"_subprocess\": False,\n    \"_sha\": False,  # TODO: Not entirely clear if that's true\n    \"_sha1\": False,\n    \"_sha2\": False,\n    \"_sha256\": False,\n    \"_sha3\": False,\n    \"_sha512\": False,\n    \"_signal\": False,\n    \"_socket\": False,\n    \"_sre\": False,\n    \"_stat\": False,\n    \"_statistics\": False,\n    \"_string\": False,\n    \"_struct\": False,\n    \"_symtable\": False,\n    \"_thread\": False,\n    \"_tracemalloc\": False,\n    \"_tokenize\": False,\n    \"_typing\": False,\n    \"_warnings\": False,\n    \"_weakref\": False,\n    \"_winapi\": False,\n    \"_winreg\": False,\n    \"_xxsubinterpreters\": False,\n    \"array\": False,\n    \"atexit\": False,\n    \"audioop\": False,\n    \"binascii\": False,\n    \"builtins\": False,\n    \"cmath\": False,\n    \"cStringIO\": False,\n    \"cPickle\": False,\n    \"datetime\": False,\n    \"errno\": False,\n    \"exceptions\": False,\n    \"faulthandler\": False,\n    \"fcntl\": False,\n    \"future_builtins\": False,\n    \"gc\": False,\n    \"grp\": False,\n    \"itertools\": False,\n    \"imageop\": False,\n    \"imp\": False,\n    \"operator\": False,\n    \"marshal\": False,\n    \"math\": False,\n    \"mmap\": False,\n    \"msvcrt\": False,\n    \"nt\": False,\n    \"parser\": False,\n    \"posix\": False,\n    \"pwd\": False,\n    \"pyexpat\": False,\n    \"select\": False,\n    \"signal\": False,\n    \"strop\": False,\n    \"spwd\": False,\n    \"sys\": False,\n    \"syslog\": False,\n    \"time\": False,\n    \"thread\": False,\n    \"unicodedata\": False,\n    \"winreg\": False,\n    \"xxsubtype\": False,\n    \"zipimport\": False,\n    \"zlib\": False,\n    \"_ssl\": True,\n    \"_xxinterpchannels\": False,\n}\n\n\ndef isNonRaisingBuiltinModule(module_name):\n    assert isBuiltinModuleName(module_name), module_name\n\n    # Return None, if we don't know.\n    return _stdlib_module_raises.get(module_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/PreloadedPackages.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module abstracts what site.py is normally doing in .pth files.\n\nThis tries to extract \"namespaces\" packages that were manually created and\npoint to package directories, which need no \"__init__.py\" to count as a\npackage. Nuitka will pretend for those that there be one, but without content.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.Tracing import recursion_logger\nfrom nuitka.utils.FileOperations import getFileContentByLine, listDir\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef getLoadedPackages():\n    \"\"\"Extract packages with no __file__, i.e. they got added manually.\n\n    They are frequently created with \"*.pth\" files that then check for the\n    \"__init__.py\" to exist, and when it doesn't, then they create during the\n    loading of \"site.py\" an package with \"__path__\" set.\n    \"\"\"\n\n    for module_name, module in sys.modules.items():\n        if not getattr(module, \"__path__\", None):\n            continue\n\n        if hasattr(module, \"__file__\"):\n            continue\n\n        yield module_name, module\n\n\ndef detectPreLoadedPackagePaths():\n    result = {}\n\n    for package_name, module in getLoadedPackages():\n        result[package_name] = list(module.__path__)\n\n    return result\n\n\npreloaded_packages = None\n\n\ndef getPreloadedPackagePaths():\n    \"\"\"Return dictionary with preloaded package paths from .pth files\"\"\"\n\n    # We need to set this from the outside, pylint: disable=global-statement\n    global preloaded_packages\n\n    if preloaded_packages is None:\n        preloaded_packages = detectPreLoadedPackagePaths()\n\n    return preloaded_packages\n\n\ndef setPreloadedPackagePaths(value):\n    # We need to set this from the outside, pylint: disable=global-statement\n    global preloaded_packages\n\n    preloaded_packages = value\n\n\ndef getPreloadedPackagePath(package_name):\n    return getPreloadedPackagePaths().get(package_name)\n\n\ndef isPreloadedPackagePath(path):\n    path = os.path.normcase(path)\n\n    for paths in getPreloadedPackagePaths().values():\n        for element in paths:\n            if os.path.normcase(element) == path:\n                return True\n\n    return False\n\n\ndef _considerPthImportedPackage(module_name):\n    if module_name in (\"os\", \"sys\"):\n        return None\n\n    if module_name.startswith(\"__editable__\"):\n        finder_module = __import__(module_name)\n\n        paths = set()\n\n        mapping = getattr(finder_module, \"MAPPING\", {})\n        for package_name, path in mapping.items():\n            if os.path.basename(path) != package_name:\n                continue\n\n            paths.add(os.path.dirname(path))\n\n        sys.path.extend(sorted(paths))\n\n        return None\n\n    return module_name\n\n\ndef detectPthImportedPackages():\n    if not hasattr(sys.modules[\"site\"], \"getsitepackages\"):\n        return ()\n\n    pth_imports = set()\n\n    for prefix in sys.modules[\"site\"].getsitepackages():\n        if not os.path.isdir(prefix):\n            continue\n\n        for path, filename in listDir(prefix):\n            if filename.endswith(\".pth\"):\n                try:\n                    for line in getFileContentByLine(path, \"rU\"):\n                        if line.startswith(\"import \"):\n                            if \";\" in line:\n                                line = line[: line.find(\";\")]\n\n                            for part in line[7:].split(\",\"):\n                                pth_import = _considerPthImportedPackage(part.strip())\n\n                                if pth_import is not None:\n                                    pth_imports.add(pth_import)\n                except OSError:\n                    recursion_logger.warning(\n                        \"Python installation problem, cannot read file '%s'.\"\n                    )\n\n    return tuple(sorted(pth_imports))\n\n\npth_imported_packages = ()\n\n\ndef setPthImportedPackages(value):\n    # We need to set this from the outside, pylint: disable=global-statement\n    global pth_imported_packages\n\n    pth_imported_packages = tuple(ModuleName(module_name) for module_name in value)\n\n\ndef getPthImportedPackages():\n    return pth_imported_packages\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/Recursion.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Recursion into other modules.\n\n\"\"\"\n\nimport glob\nimport os\n\nfrom nuitka import ModuleRegistry, Options\nfrom nuitka.Errors import NuitkaForbiddenImportEncounter\nfrom nuitka.freezer.ImportDetection import (\n    detectEarlyImports,\n    detectStdlibAutoInclusionModules,\n)\nfrom nuitka.importing import ImportCache, StandardLibrary\nfrom nuitka.ModuleRegistry import addUsedModule, getRootTopModule\nfrom nuitka.pgo.PGO import decideInclusionFromPGO\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import recursion_logger\nfrom nuitka.utils.FileOperations import listDir\nfrom nuitka.utils.Importing import getSharedLibrarySuffixes\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .Importing import (\n    getModuleNameAndKindFromFilename,\n    isPackageDir,\n    locateModule,\n    warnAboutNotFoundImport,\n)\n\n\ndef _recurseTo(module_name, module_filename, module_kind, reason):\n    from nuitka.tree import Building\n\n    module = Building.buildModule(\n        module_name=module_name,\n        module_kind=module_kind,\n        module_filename=module_filename,\n        reason=reason,\n        source_code=None,\n        is_top=False,\n        is_main=False,\n        is_fake=False,\n        hide_syntax_error=True,\n    )\n\n    ImportCache.addImportedModule(module)\n\n    return module\n\n\ndef recurseTo(\n    module_name,\n    module_filename,\n    module_kind,\n    source_ref,\n    reason,\n    using_module_name,\n):\n    try:\n        module = ImportCache.getImportedModuleByNameAndPath(\n            module_name, module_filename\n        )\n    except KeyError:\n        module = None\n\n    if module is None:\n        Plugins.onModuleRecursion(\n            module_filename=module_filename,\n            module_name=module_name,\n            module_kind=module_kind,\n            using_module_name=using_module_name,\n            source_ref=source_ref,\n            reason=reason,\n        )\n\n        module = _recurseTo(\n            module_name=module_name,\n            module_filename=module_filename,\n            module_kind=module_kind,\n            reason=reason,\n        )\n\n    return module\n\n\n_recursion_decision_cache = {}\n\n\ndef getRecursionDecisions():\n    \"\"\"Access to recursion decisions, intended only for reporting.\"\"\"\n    return _recursion_decision_cache\n\n\ndef decideRecursion(\n    using_module_name, module_filename, module_name, module_kind, extra_recursion=False\n):\n    package_part, _remainder = module_name.splitModuleBasename()\n\n    if package_part is not None:\n        (\n            _package_part,\n            package_filename,\n            package_module_kind,\n            package_finding,\n        ) = locateModule(module_name=package_part, parent_package=None, level=0)\n        assert _package_part == package_part\n\n        # For bad decisions, this may already not work.\n        if package_finding != \"not-found\":\n            package_decision, package_reason = decideRecursion(\n                using_module_name=using_module_name,\n                module_filename=package_filename,\n                module_name=package_part,\n                module_kind=package_module_kind,\n                extra_recursion=extra_recursion,\n            )\n\n            if package_decision is False:\n                return package_decision, package_reason\n\n    key = using_module_name, module_filename, module_name, module_kind, extra_recursion\n\n    if key not in _recursion_decision_cache:\n        _recursion_decision_cache[key] = _decideRecursion(\n            using_module_name,\n            module_filename,\n            module_name,\n            module_kind,\n            extra_recursion,\n        )\n\n        # If decided true, give the plugins a chance to e.g. add more hard\n        # module information, this indicates tentatively, that a module might\n        # get used, but it may also not happen at all.\n        if _recursion_decision_cache[key][0]:\n            Plugins.onModuleUsageLookAhead(\n                module_name=module_name,\n                module_filename=module_filename,\n                module_kind=module_kind,\n            )\n\n    return _recursion_decision_cache[key]\n\n\ndef _decideRecursion(\n    using_module_name, module_filename, module_name, module_kind, extra_recursion\n):\n    # Many branches, which make decisions immediately, by returning\n    # pylint: disable=too-many-branches,too-many-return-statements\n    if module_name == \"__main__\":\n        return False, \"Main program is not followed to a second time.\"\n\n    if module_kind == \"extension\" and not Options.isStandaloneMode():\n        return False, \"Extension modules cannot be inspected.\"\n\n    if module_kind == \"built-in\":\n        return False, \"Built-in modules cannot be inspected.\"\n\n    if module_name in detectEarlyImports():\n        return True, \"Technically required for CPython library startup.\"\n\n    is_stdlib = module_filename is not None and StandardLibrary.isStandardLibraryPath(\n        module_filename\n    )\n\n    if is_stdlib and module_name in detectStdlibAutoInclusionModules():\n        return True, \"Including as part of the non-excluded parts of standard library.\"\n\n    # In '-m' mode, when including the package, do not duplicate main program.\n    if (\n        Options.hasPythonFlagPackageMode()\n        and not Options.shallMakeModule()\n        and module_name.getBasename() == \"__main__\"\n    ):\n        if module_name.getPackageName() == getRootTopModule().getRuntimePackageValue():\n            return False, \"Main program is already included in package mode.\"\n\n    plugin_decision, deciding_plugins = Plugins.onModuleEncounter(\n        using_module_name=using_module_name,\n        module_filename=module_filename,\n        module_name=module_name,\n        module_kind=module_kind,\n    )\n\n    # For checks, we do not consider anti-bloat plugin to be as important, to\n    # cause a conflict with the user choices. We could make an extra attribute\n    # out of that, but it seems overkill for now.\n    deciding_plugins = [\n        deciding_plugin\n        for deciding_plugin in deciding_plugins\n        if deciding_plugin.plugin_name != \"anti-bloat\"\n    ]\n\n    no_case, reason = module_name.matchesToShellPatterns(\n        patterns=Options.getShallFollowInNoCase()\n    )\n\n    if no_case:\n        if plugin_decision and plugin_decision[0]:\n            deciding_plugins[0].sysexit(\n                \"Conflict between user and plugin decision for module '%s'.\"\n                % module_name\n            )\n\n        return False, \"Module %s instructed by user to not follow to.\" % reason\n\n    any_case, reason = module_name.matchesToShellPatterns(\n        patterns=Options.getShallFollowModules()\n    )\n\n    if any_case:\n        if plugin_decision and not plugin_decision[0] and deciding_plugins:\n            deciding_plugins[0].sysexit(\n                \"Conflict between user and plugin decision for module '%s'.\"\n                % module_name\n            )\n\n        return True, \"Module %s instructed by user to follow to.\" % reason\n\n    if plugin_decision is not None:\n        return plugin_decision\n\n    if extra_recursion:\n        return True, \"Lives in user provided directory.\"\n\n    if module_kind == \"extension\" and Options.isStandaloneMode():\n        return True, \"Extension module needed for standalone mode.\"\n\n    # PGO decisions are not overruling plugins, but all command line options, they are\n    # supposed to be applied already.\n\n    if not is_stdlib or Options.shallFollowStandardLibrary():\n        # TODO: Bad placement of this function or should PGO also know about\n        # bytecode modules loaded or not.\n        from nuitka.tree.Building import decideCompilationMode\n\n        if (\n            decideCompilationMode(\n                is_top=False,\n                module_name=module_name,\n                module_filename=module_filename,\n                for_pgo=True,\n            )\n            == \"compiled\"\n        ):\n            pgo_decision = decideInclusionFromPGO(\n                module_name=module_name,\n                module_kind=module_kind,\n            )\n\n            if pgo_decision is not None:\n                return pgo_decision, \"PGO based decision\"\n\n    if (\n        is_stdlib\n        and not Options.isStandaloneMode()\n        and not Options.shallFollowStandardLibrary()\n    ):\n        return (\n            False,\n            \"Not following into stdlib unless standalone or requested to follow into stdlib.\",\n        )\n\n    if Options.shallFollowAllImports():\n        return (\n            True,\n            \"Instructed by user to follow to all modules.\",\n        )\n\n    if Options.shallFollowNoImports():\n        return (None, \"Instructed by user to not follow at all.\")\n\n    # Means, we were not given instructions how to handle things.\n    return (\n        None,\n        \"Default behavior in non-standalone mode, not following without request.\",\n    )\n\n\ndef isSameModulePath(path1, path2):\n    if os.path.basename(path1) == \"__init__.py\":\n        path1 = os.path.dirname(path1)\n    if os.path.basename(path2) == \"__init__.py\":\n        path2 = os.path.dirname(path2)\n\n    return os.path.abspath(path1) == os.path.abspath(path2)\n\n\ndef _addIncludedModule(module, package_only):\n    # Many branches, for the decision is very complex\n    # pylint: disable=too-many-branches\n\n    if Options.isShowInclusion():\n        recursion_logger.info(\n            \"Included '%s' as '%s'.\"\n            % (\n                module.getFullName(),\n                module,\n            )\n        )\n\n    ImportCache.addImportedModule(module)\n\n    if module.isCompiledPythonPackage() or module.isUncompiledPythonPackage():\n        package_filename = module.getFilename()\n\n        if os.path.isdir(package_filename):\n            # Must be a namespace package.\n            assert python_version >= 0x300\n\n            package_dir = package_filename\n\n            # Only include it, if it contains actual modules, which will\n            # recurse to this one and find it again.\n        else:\n            package_dir = os.path.dirname(package_filename)\n\n            # Real packages will always be included.\n            ModuleRegistry.addRootModule(module)\n\n        if Options.isShowInclusion():\n            recursion_logger.info(\"Package directory '%s'.\" % package_dir)\n\n        if not package_only:\n            for sub_path, sub_filename in listDir(package_dir):\n                if sub_filename in (\"__init__.py\", \"__pycache__\"):\n                    continue\n\n                if isPackageDir(sub_path) and not os.path.exists(sub_path + \".py\"):\n                    checkPluginSinglePath(\n                        sub_path,\n                        module_package=module.getFullName(),\n                        package_only=False,\n                    )\n                elif sub_path.endswith(\".py\"):\n                    checkPluginSinglePath(\n                        sub_path,\n                        module_package=module.getFullName(),\n                        package_only=False,\n                    )\n\n    elif module.isCompiledPythonModule() or module.isUncompiledPythonModule():\n        ModuleRegistry.addRootModule(module)\n    elif module.isPythonExtensionModule():\n        if Options.isStandaloneMode():\n            ModuleRegistry.addRootModule(module)\n    else:\n        assert False, module\n\n\ndef checkPluginSinglePath(plugin_filename, module_package, package_only):\n    # The importing wants these to be unique.\n    plugin_filename = os.path.abspath(plugin_filename)\n\n    if Options.isShowInclusion():\n        recursion_logger.info(\n            \"Checking detail plug-in path '%s' '%s':\"\n            % (plugin_filename, module_package)\n        )\n\n    module_name, module_kind = getModuleNameAndKindFromFilename(plugin_filename)\n\n    module_name = ModuleName.makeModuleNameInPackage(module_name, module_package)\n\n    if module_kind == \"extension\" and not Options.isStandaloneMode():\n        recursion_logger.warning(\n            \"\"\"\\\nCannot include extension module '%s' unless using at least standalone mode, \\\nwhere they would be copied. In this mode, extension modules are not part of \\\nthe compiled result, and therefore asking to include them makes no sense.\n\"\"\"\n            % module_name.asString()\n        )\n\n    if module_kind is not None:\n        decision, decision_reason = decideRecursion(\n            using_module_name=None,\n            module_filename=plugin_filename,\n            module_name=module_name,\n            module_kind=module_kind,\n            extra_recursion=True,\n        )\n\n        if decision:\n            module = recurseTo(\n                module_filename=plugin_filename,\n                module_name=module_name,\n                module_kind=module_kind,\n                source_ref=None,\n                reason=\"command line\",\n                using_module_name=None,\n            )\n\n            if module:\n                _addIncludedModule(module=module, package_only=package_only)\n            else:\n                recursion_logger.warning(\n                    \"Failed to include module from '%s'.\" % plugin_filename\n                )\n        else:\n            recursion_logger.warning(\n                \"Not allowed to include module '%s' due to '%s'.\"\n                % (module_name, decision_reason)\n            )\n\n\ndef checkPluginPath(plugin_filename, module_package):\n    if Options.isShowInclusion():\n        recursion_logger.info(\n            \"Checking top level inclusion path '%s' '%s'.\"\n            % (plugin_filename, module_package)\n        )\n\n    # Files and package directories are handled here.\n    if os.path.isfile(plugin_filename) or isPackageDir(plugin_filename):\n        checkPluginSinglePath(\n            plugin_filename,\n            module_package=module_package,\n            package_only=False,\n        )\n    # This effectively only covers files known to not be packages due to name\n    # or older Python version.\n    elif os.path.isdir(plugin_filename):\n        for sub_path, sub_filename in listDir(plugin_filename):\n            assert sub_filename != \"__init__.py\"\n\n            if isPackageDir(sub_path) or sub_path.endswith(\".py\"):\n                checkPluginSinglePath(\n                    sub_path,\n                    module_package=None,\n                    package_only=False,\n                )\n                continue\n\n            for suffix in getSharedLibrarySuffixes():\n                if sub_path.endswith(suffix):\n                    checkPluginSinglePath(\n                        sub_path,\n                        module_package=None,\n                        package_only=False,\n                    )\n\n    else:\n        recursion_logger.warning(\n            \"Failed to include module from '%s'.\" % plugin_filename\n        )\n\n\ndef checkPluginFilenamePattern(pattern):\n    if Options.isShowInclusion():\n        recursion_logger.info(\"Checking plug-in pattern '%s':\" % pattern)\n\n    assert not os.path.isdir(pattern), pattern\n\n    found = False\n\n    for filename in glob.iglob(pattern):\n        if filename.endswith(\".pyc\"):\n            continue\n\n        if not os.path.isfile(filename):\n            continue\n\n        found = True\n        checkPluginSinglePath(\n            filename,\n            module_package=None,\n            package_only=False,\n        )\n\n    if not found:\n        recursion_logger.warning(\n            \"Didn't match any files against pattern '%s'.\" % pattern\n        )\n\n\ndef considerUsedModules(module, pass_count):\n    # Modules that are only there because they are in standard library are not\n    # supposed to have dependencies included at all.\n    if module.reason == \"stdlib\":\n        return\n\n    for used_module in module.getUsedModules():\n        # The pass number is used to indicate if stdlib modules yet, or only them\n\n        if used_module.reason == \"stdlib\":\n            if pass_count == 1:\n                continue\n        else:\n            if pass_count == -1:\n                continue\n\n        if used_module.finding == \"not-found\":\n            warnAboutNotFoundImport(\n                importing=module,\n                source_ref=used_module.source_ref,\n                module_name=used_module.module_name,\n                level=used_module.level,\n            )\n\n        # Nothing was found here\n        if used_module.filename is None:\n            continue\n\n        try:\n            decision, decision_reason = decideRecursion(\n                using_module_name=module.getFullName(),\n                module_filename=used_module.filename,\n                module_name=used_module.module_name,\n                module_kind=used_module.module_kind,\n            )\n\n            if decision:\n                new_module = recurseTo(\n                    module_name=used_module.module_name,\n                    module_filename=used_module.filename,\n                    module_kind=used_module.module_kind,\n                    source_ref=used_module.source_ref,\n                    reason=used_module.reason,\n                    using_module_name=module.module_name,\n                )\n\n                addUsedModule(\n                    module=new_module,\n                    using_module=module,\n                    # TODO: Cleanup argument names here.\n                    usage_tag=used_module.reason,\n                    reason=decision_reason,\n                    source_ref=used_module.source_ref,\n                )\n        except NuitkaForbiddenImportEncounter as e:\n            recursion_logger.sysexit(\n                \"Error, forbidden import of '%s' (intending to avoid '%s') in module '%s' at '%s' encountered.\"\n                % (\n                    e.args[0],\n                    e.args[1],\n                    module.getFullName(),\n                    used_module.source_ref.getAsString(),\n                )\n            )\n\n    try:\n        Plugins.considerImplicitImports(module=module)\n    except NuitkaForbiddenImportEncounter as e:\n        recursion_logger.sysexit(\n            \"Error, forbidden import of '%s' (intending to avoid '%s') done implicitly by module '%s'.\"\n            % (e.args[0], e.args[1], module.getFullName())\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/StandardLibrary.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Access to standard library distinction.\n\nFor code to be in the standard library means that it's not written by the\nuser for sure. We treat code differently based on that information, by e.g.\nincluding as byte code.\n\nTo determine if a module from the standard library, we can abuse the attribute\n\"__file__\" of the \"os\" module like it's done in \"isStandardLibraryPath\" of this\nmodule.\n\"\"\"\n\nimport os\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.FileOperations import getFileContents, isFilenameBelowPath\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.Utils import (\n    isNetBSD,\n    isPosixWindows,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n)\n\n\ndef getStandardLibraryPaths():\n    \"\"\"Get the standard library paths.\"\"\"\n\n    # Using the function object to cache its result, avoiding global variable\n    # usage.\n    if not hasattr(getStandardLibraryPaths, \"result\"):\n        os_filename = os.__file__\n        if os_filename.endswith(\".pyc\"):\n            os_filename = os_filename[:-1]\n\n        os_path = os.path.normcase(os.path.dirname(os_filename))\n\n        stdlib_paths = set([os_path])\n\n        # Happens for virtualenv situation, some modules will come from the link\n        # this points to.\n        if os.path.islink(os_filename):\n            os_filename = os.readlink(os_filename)\n            stdlib_paths.add(os.path.normcase(os.path.dirname(os_filename)))\n\n        # Another possibility is \"orig-prefix.txt\" file near the os.py, which\n        # points to the original install.\n        orig_prefix_filename = os.path.join(os_path, \"orig-prefix.txt\")\n\n        if os.path.isfile(orig_prefix_filename):\n            # Scan upwards, until we find a \"bin\" folder, with \"activate\" to\n            # locate the structural path to be added. We do not know for sure\n            # if there is a sub-directory under \"lib\" to use or not. So we try\n            # to detect it.\n            search = os_path\n            lib_part = \"\"\n\n            while os.path.splitdrive(search)[1] not in (os.path.sep, \"\"):\n                if os.path.isfile(\n                    os.path.join(search, \"bin/activate\")\n                ) or os.path.isfile(os.path.join(search, \"scripts/activate\")):\n                    break\n\n                lib_part = os.path.join(os.path.basename(search), lib_part)\n\n                search = os.path.dirname(search)\n\n            assert search and lib_part\n\n            stdlib_paths.add(\n                os.path.normcase(\n                    os.path.join(getFileContents(orig_prefix_filename), lib_part)\n                )\n            )\n\n        # And yet another possibility, for macOS Homebrew created virtualenv\n        # at least is a link \".Python\", which points to the original install.\n        python_link_filename = os.path.join(os_path, \"..\", \".Python\")\n        if os.path.islink(python_link_filename):\n            stdlib_paths.add(\n                os.path.normcase(os.path.join(os.readlink(python_link_filename), \"lib\"))\n            )\n\n        for stdlib_path in set(stdlib_paths):\n            candidate = os.path.join(stdlib_path, \"lib-tk\")\n\n            if os.path.isdir(candidate):\n                stdlib_paths.add(candidate)\n\n        if isWin32OrPosixWindows():\n            from nuitka.Options import shallUseStaticLibPython\n\n            if not shallUseStaticLibPython():\n                import _ctypes\n\n                stdlib_paths.add(os.path.dirname(_ctypes.__file__))\n\n        getStandardLibraryPaths.result = [\n            os.path.normcase(os.path.normpath(stdlib_path))\n            for stdlib_path in stdlib_paths\n        ]\n\n    return getStandardLibraryPaths.result\n\n\ndef _isStandardLibraryPath(filename):\n    # In virtualenv, the \"site.py\" lives in a place that suggests it is not in\n    # standard library, although it is.\n    if os.path.basename(filename) == \"site.py\":\n        return True\n\n    # These never are in standard library paths.\n    if (\n        \"dist-packages\" in filename\n        or \"site-packages\" in filename\n        or \"vendor-packages\" in filename\n    ):\n        return False\n\n    for candidate in getStandardLibraryPaths():\n        if isFilenameBelowPath(path=candidate, filename=filename):\n            return True\n\n    return False\n\n\n_is_standard_library_path_cache = {}\n\n\ndef isStandardLibraryPath(filename):\n    \"\"\"Check if a path is in the standard library.\"\"\"\n\n    filename = os.path.normcase(os.path.normpath(filename))\n\n    if filename not in _is_standard_library_path_cache:\n        _is_standard_library_path_cache[filename] = _isStandardLibraryPath(filename)\n\n    return _is_standard_library_path_cache[filename]\n\n\n# Some modules we want to exclude entirely.\n_excluded_stdlib_modules = [\"__main__.py\", \"__init__.py\", \"antigravity.py\"]\n\nif not isWin32Windows():\n    # On posix systems, and posix Python variants on Windows, this won't\n    # work.\n    _excluded_stdlib_modules.append(\"wintypes.py\")\n    _excluded_stdlib_modules.append(\"cp65001.py\")\n\n\ndef scanStandardLibraryPath(stdlib_dir):\n    # There is a lot of filtering here, done in branches, so there is many of\n    # them, but that's acceptable, pylint: disable=too-many-branches,too-many-statements\n\n    for root, dirs, filenames in os.walk(stdlib_dir):\n        import_path = root[len(stdlib_dir) :].strip(\"/\\\\\")\n        import_path = import_path.replace(\"\\\\\", \".\").replace(\"/\", \".\")\n\n        if import_path == \"\":\n            if \"site-packages\" in dirs:\n                dirs.remove(\"site-packages\")\n            if \"dist-packages\" in dirs:\n                dirs.remove(\"dist-packages\")\n            if \"vendor-packages\" in dirs:\n                dirs.remove(\"vendor-packages\")\n            if \"test\" in dirs:\n                dirs.remove(\"test\")\n            if \"turtledemo\" in dirs:\n                dirs.remove(\"turtledemo\")\n\n            if \"ensurepip\" in filenames:\n                filenames.remove(\"ensurepip\")\n            if \"ensurepip\" in dirs:\n                dirs.remove(\"ensurepip\")\n\n            # Ignore \"lib-dynload\" and \"lib-tk\" and alike.\n            dirs[:] = [\n                dirname\n                for dirname in dirs\n                if not dirname.startswith(\"lib-\")\n                if dirname != \"Tools\"\n                if not dirname.startswith(\"plat-\")\n            ]\n\n        if import_path in (\n            \"tkinter\",\n            \"Tkinter\",\n            \"importlib\",\n            \"ctypes\",\n            \"unittest\",\n            \"sqlite3\",\n            \"distutils\",\n            \"email\",\n            \"bsddb\",\n        ):\n            if \"test\" in dirs:\n                dirs.remove(\"test\")\n\n        if import_path == \"distutils.command\":\n            # Misbehaving and crashing while importing the world.\n            if \"bdist_conda.py\" in filenames:\n                filenames.remove(\"bdist_conda.py\")\n\n        if import_path in (\"lib2to3\", \"json\", \"distutils\"):\n            if \"tests\" in dirs:\n                dirs.remove(\"tests\")\n\n        if import_path == \"asyncio\":\n            if \"test_utils.py\" in filenames:\n                filenames.remove(\"test_utils.py\")\n\n        if python_version >= 0x340 and isWin32Windows():\n            if import_path == \"multiprocessing\":\n                filenames.remove(\"popen_fork.py\")\n                filenames.remove(\"popen_forkserver.py\")\n                filenames.remove(\"popen_spawn_posix.py\")\n\n        if python_version >= 0x300 and isPosixWindows():\n            if import_path == \"curses\":\n                filenames.remove(\"has_key.py\")\n\n        if isNetBSD():\n            if import_path == \"xml.sax\":\n                filenames.remove(\"expatreader.py\")\n\n        for filename in filenames:\n            if filename.endswith(\".py\") and filename not in _excluded_stdlib_modules:\n                module_name = filename[:-3]\n\n                if import_path == \"\":\n                    yield ModuleName(module_name)\n                else:\n                    yield ModuleName(import_path + \".\" + module_name)\n\n        if python_version >= 0x300:\n            if \"__pycache__\" in dirs:\n                dirs.remove(\"__pycache__\")\n\n        # Ignore \".idea\", \".git\" and similar folders, they are not modules\n        dirs[:] = [dirname for dirname in dirs if not dirname.startswith(\".\")]\n\n        for dirname in dirs:\n            if import_path == \"\":\n                yield ModuleName(dirname)\n            else:\n                yield ModuleName(import_path + \".\" + dirname)\n\n\n_stdlib_no_auto_inclusion_list = (\n    # Avoid this to be included, implicit usages will be rare, but it triggers\n    # the Nuitka plugin \"multiprocessing\" that is always enabled.\n    \"multiprocessing\",\n    \"_multiprocessing\",\n    # Implicit usages of these will be rare, but it can have that costly extension module\n    \"curses\",\n    \"_curses\",\n    \"ctypes\",\n    \"_ctypes\",\n    \"_curses_panel\",\n    \"sqlite3\",\n    \"_sqlite3\",\n    \"shelve\",\n    \"dbm\",\n    \"_dbm\",\n    \"bdb\",\n    \"xml\",\n    \"_elementtree\",\n    \"queue\",\n    \"_queue\",\n    \"uuid\",\n    \"_uuid\",\n    \"hashlib\",\n    \"_hashlib\",\n    \"secrets\",\n    \"hmac\",\n    \"fractions\",\n    \"decimal\",\n    \"_pydecimal\",\n    \"_decimal\",\n    \"statistics\",\n    \"csv\",\n    \"_csv\",\n    \"lzma\",\n    \"_lzma\",\n    \"bz2\",\n    \"_bz2\",\n    \"logging\",\n    \"tempfile\",\n    \"subprocess\",\n    \"_posixsubprocess\",\n    \"socket\",\n    \"selectors\",\n    \"select\",\n    \"_socket\",\n    \"ssl\",\n    \"_ssl\",\n    \"pyexpat\",\n    # This one can have license issues attached, so avoid it.\n    \"readline\",\n    # Avoid tests and doc stuff, profiling, etc. if not used.\n    \"unittest\",\n    \"pydoc\",\n    \"pydoc_data\",\n    \"profile\",\n    \"cProfile\",\n    \"optparse\",\n    \"pdb\",\n    \"site\",\n    \"sitecustomize\",\n    \"runpy\",\n    \"lib2to3\",\n    \"doctest\",\n    # Optional dependency of json need not by collect by itself, but usage will\n    # go through \"json.encoder/json.decoder/json.scanner\" of course.\n    \"_json\",\n    # Optional dependency of \"bisect\" need not by collect by itself, but usage will\n    # go through \"bisect\" of course.\n    \"_bisect\",\n    # Optional dependency of \"heapq\" need not by collect by itself, but usage will\n    # go through \"heapq\" of course.\n    \"_heapq\",\n    # Dependency of crypt, that may not be used, requiring this to be explicit.\n    \"_crypt\",\n    # Dependency of contextvars, that may not be used, requiring this to be explicit.\n    \"_contextvars\",\n    # Dependency of random, that may not be used, requiring this to be explicit.\n    \"random\",\n    # Avoid this one if not built-in, since it's an extension module.\n    \"array\",\n    # Runners for programs\n    \"json.tool\",\n    \"zipapp\",\n    \"tabnanny\",\n    # Packages that will be imported rarely by extension modules\n    \"email\",\n    \"mailbox\",\n    \"argparse\",\n    \"telnetlib\",\n    \"smtplib\",\n    \"smtpd\",\n    \"nntplib\",\n    \"http\",\n    \"xmlrpc\",\n    \"urllib\",\n    \"select\",\n    \"wsgiref\",\n    \"sunau\",\n    \"aifc\",\n    \"wave\",\n    \"audioop\",\n    \"getpass\",\n    \"grp\",\n    \"pty\",\n    \"tty\",\n    \"termios\",\n    \"this\",\n    \"textwrap\",\n    # Distribution and bytecode related stuff\n    \"plistlib\",\n    \"distutils\",\n    \"compileall\",\n    \"venv\",\n    \"py_compile\",\n    \"msilib\",\n    \"_opcode\",\n    # tzdata is not always needed\n    \"zoneinfo\",\n    # tkinter under all its names\n    \"Tkinter\",\n    \"tkinter\",\n    \"_tkinter\",\n    # lib-tk from Python2\n    \"Tix\",\n    \"FixTk\",\n    \"ScrolledText\",\n    \"turtle\",\n    \"antigravity\",\n    \"Dialog\",\n    \"Tkdnd\",\n    \"tkMessageBox\",\n    \"tkSimpleDialog\",\n    \"Tkinter\",\n    \"tkFileDialog\",\n    \"Canvas\",\n    \"tkCommonDialog\",\n    \"Tkconstants\",\n    \"FileDialog\",\n    \"SimpleDialog\",\n    \"ttk\",\n    \"tkFont\",\n    \"tkColorChooser\",\n    \"idlelib\",\n    # test code in standard modules\n    \"asyncio.test_utils\",\n    # strange OS specific extensions\n    \"_distutils_system_mod\",\n    # async libraries\n    \"concurrent\",\n    \"asyncio\",\n    \"asyncore\",\n    \"asynchat\",\n)\n\nif not isWin32Windows():\n    _stdlib_no_auto_inclusion_list += (\"ntpath\",)\n\n\ndef isStandardLibraryNoAutoInclusionModule(module_name):\n    return module_name.hasOneOfNamespaces(*_stdlib_no_auto_inclusion_list)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/importing/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/AsyncgenNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for async generator objects and their creations.\n\nAsync generator are turned into normal functions that create generator objects,\nwhose implementation lives here. The creation itself also lives here.\n\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingAsyncgenRefMixin\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .FunctionNodes import ExpressionFunctionEntryPointBase\n\n\nclass ExpressionMakeAsyncgenObject(\n    ExpressionNoSideEffectsMixin, ChildHavingAsyncgenRefMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_MAKE_ASYNCGEN_OBJECT\"\n\n    named_children = (\"asyncgen_ref\",)\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    def __init__(self, asyncgen_ref, source_ref):\n        assert asyncgen_ref.getFunctionBody().isExpressionAsyncgenObjectBody()\n\n        ChildHavingAsyncgenRefMixin.__init__(self, asyncgen_ref=asyncgen_ref)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = []\n\n    def getDetailsForDisplay(self):\n        return {\"asyncgen\": self.subnode_asyncgen_ref.getFunctionBody().getCodeName()}\n\n    def computeExpression(self, trace_collection):\n        self.variable_closure_traces = []\n\n        for (\n            closure_variable\n        ) in self.subnode_asyncgen_ref.getFunctionBody().getClosureVariables():\n            trace = trace_collection.getVariableCurrentTrace(closure_variable)\n            trace.addNameUsage()\n\n            self.variable_closure_traces.append((closure_variable, trace))\n\n        # TODO: Asyncgen body may know something too.\n        return self, None, None\n\n    def getClosureVariableVersions(self):\n        return self.variable_closure_traces\n\n\nclass ExpressionAsyncgenObjectBody(ExpressionFunctionEntryPointBase):\n    kind = \"EXPRESSION_ASYNCGEN_OBJECT_BODY\"\n\n    __slots__ = (\"qualname_setup\", \"needs_generator_return_exit\")\n\n    def __init__(self, provider, name, code_object, flags, auto_release, source_ref):\n        ExpressionFunctionEntryPointBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_object=code_object,\n            code_prefix=\"asyncgen\",\n            flags=flags,\n            auto_release=auto_release,\n            source_ref=source_ref,\n        )\n\n        self.needs_generator_return_exit = False\n\n        self.qualname_setup = None\n\n    def getFunctionName(self):\n        return self.name\n\n    def markAsNeedsGeneratorReturnHandling(self, value):\n        self.needs_generator_return_exit = max(self.needs_generator_return_exit, value)\n\n    def needsGeneratorReturnHandling(self):\n        return self.needs_generator_return_exit == 2\n\n    def needsGeneratorReturnExit(self):\n        return bool(self.needs_generator_return_exit)\n\n    @staticmethod\n    def needsCreation():\n        return False\n\n    @staticmethod\n    def isUnoptimized():\n        return False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/AttributeLookupNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Attribute lookup nodes, generic one and base for generated ones.\n\nSee AttributeNodes otherwise.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingExpressionMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionBasesGenerated import ExpressionAttributeLookupBase\n\n\nclass ExpressionAttributeLookup(ExpressionAttributeLookupBase):\n    \"\"\"Looking up an attribute of an object.\n\n    Typically code like: source.attribute_name\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP\"\n\n    named_children = (\"expression\",)\n    node_attributes = (\"attribute_name\",)\n\n    def getAttributeName(self):\n        return self.attribute_name\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=self.attribute_name,\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(\n            exception_type\n        ) or self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=self.attribute_name\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # TODO: Could be known. We would need for computeExpressionAttribute to\n        # either return a new node, or a decision maker.\n        return None\n\n\nclass ExpressionAttributeLookupSpecial(ExpressionAttributeLookup):\n    \"\"\"Special lookup up an attribute of an object.\n\n    Typically from code like this: with source: pass\n\n    These directly go to slots, and are performed for with statements\n    of Python2.7 or higher.\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_SPECIAL\"\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_expression.computeExpressionAttributeSpecial(\n            lookup_node=self,\n            attribute_name=self.attribute_name,\n            trace_collection=trace_collection,\n        )\n\n\nclass ExpressionAttributeLookupFixedBase(ChildHavingExpressionMixin, ExpressionBase):\n    \"\"\"Looking up an attribute of an object.\n\n    Typically code like: source.attribute_name\n    \"\"\"\n\n    attribute_name = None\n\n    named_children = (\"expression\",)\n\n    def __init__(self, expression, source_ref):\n        ChildHavingExpressionMixin.__init__(self, expression=expression)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getAttributeName(self):\n        return self.attribute_name\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=self.attribute_name,\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(\n            exception_type\n        ) or self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=self.attribute_name\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # TODO: Could be known. We would need for computeExpressionAttribute to\n        # either return a new node, or a decision maker.\n        return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/AttributeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Attribute nodes\n\nKnowing attributes of an object is very important, esp. when it comes to 'self'\nand objects and classes.\n\nThere will be a methods \"computeExpression*Attribute\" to aid predicting them,\nwith many variants for setting, deleting, and accessing. Also there is some\ncomplication in the form of special lookups, that won't go through the normal\npath, but just check slots.\n\nDue to ``getattr`` and ``setattr`` built-ins, there is also a different in the\ncomputations for objects and for compile time known strings. This reflects what\nCPython also does with \"tp_getattr\" and \"tp_getattro\".\n\nThese nodes are therefore mostly delegating the work to expressions they\nwork on, and let them decide and do the heavy lifting of optimization\nand annotation is happening in the nodes that implement these compute slots.\n\"\"\"\n\nfrom nuitka.__past__ import unicode\n\nfrom .AttributeLookupNodes import ExpressionAttributeLookup\nfrom .ChildrenHavingMixins import (\n    ChildHavingExpressionMixin,\n    ChildrenExpressionBuiltinGetattrMixin,\n    ChildrenExpressionBuiltinSetattrMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionBasesGenerated import ExpressionBuiltinHasattrBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionNoneShapeExactMixin,\n)\nfrom .NodeMakingHelpers import (\n    makeCompileTimeConstantReplacementNode,\n    makeRaiseExceptionReplacementExpression,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .StatementBasesGenerated import (\n    StatementAssignmentAttributeBase,\n    StatementDelAttributeBase,\n)\n\n\nclass StatementAssignmentAttribute(StatementAssignmentAttributeBase):\n    \"\"\"Assignment to an attribute.\n\n    Typically from code like: source.attribute_name = expression\n\n    Both source and expression may be complex expressions, the source\n    is evaluated first. Assigning to an attribute has its on slot on\n    the source, which gets to decide if it knows it will work or not,\n    and what value it will be.\n    \"\"\"\n\n    kind = \"STATEMENT_ASSIGNMENT_ATTRIBUTE\"\n\n    named_children = (\"source\", \"expression\")\n    node_attributes = (\"attribute_name\",)\n    auto_compute_handling = \"operation\"\n\n    def getAttributeName(self):\n        return self.attribute_name\n\n    def computeStatementOperation(self, trace_collection):\n        return self.subnode_expression.computeExpressionSetAttribute(\n            set_node=self,\n            attribute_name=self.attribute_name,\n            value_node=self.subnode_source,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"attribute assignment statement\"\n\n\nclass StatementDelAttribute(StatementDelAttributeBase):\n    \"\"\"Deletion of an attribute.\n\n    Typically from code like: del source.attribute_name\n\n    The source may be complex expression. Deleting an attribute has its on\n    slot on the source, which gets to decide if it knows it will work or\n    not, and what value it will be.\n    \"\"\"\n\n    kind = \"STATEMENT_DEL_ATTRIBUTE\"\n\n    named_children = (\"expression\",)\n    node_attributes = (\"attribute_name\",)\n    auto_compute_handling = \"operation\"\n\n    def getAttributeName(self):\n        return self.attribute_name\n\n    def computeStatementOperation(self, trace_collection):\n        return self.subnode_expression.computeExpressionDelAttribute(\n            set_node=self,\n            attribute_name=self.attribute_name,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"attribute del statement\"\n\n\ndef makeExpressionAttributeLookup(expression, attribute_name, source_ref):\n    from .AttributeNodesGenerated import attribute_classes\n\n    attribute_class = attribute_classes.get(attribute_name)\n\n    if attribute_class is not None:\n        assert attribute_class.attribute_name == attribute_name\n        return attribute_class(expression=expression, source_ref=source_ref)\n    else:\n        return ExpressionAttributeLookup(\n            expression=expression, attribute_name=attribute_name, source_ref=source_ref\n        )\n\n\nclass ExpressionBuiltinGetattr(ChildrenExpressionBuiltinGetattrMixin, ExpressionBase):\n    \"\"\"Built-in \"getattr\".\n\n    Typical code like this: getattr(object_arg, name, default)\n\n    The default is optional, but computed before the lookup is done.\n    \"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_GETATTR\"\n\n    named_children = (\"expression\", \"name\", \"default|optional\")\n\n    def __init__(self, expression, name, default, source_ref):\n        ChildrenExpressionBuiltinGetattrMixin.__init__(\n            self, expression=expression, name=name, default=default\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        default = self.subnode_default\n\n        if default is None or not default.mayHaveSideEffects():\n            attribute = self.subnode_name\n\n            attribute_name = attribute.getStringValue()\n\n            if attribute_name is not None:\n                source = self.subnode_expression\n                if source.isKnownToHaveAttribute(attribute_name):\n                    # If source has side effects, they must be evaluated, before\n                    # the lookup, meaning, a temporary variable should be assigned.\n                    # For now, we give up in this case.\n\n                    side_effects = source.extractSideEffects()\n\n                    if not side_effects:\n                        result = makeExpressionAttributeLookup(\n                            expression=source,\n                            attribute_name=attribute_name,\n                            source_ref=self.source_ref,\n                        )\n\n                        result = wrapExpressionWithNodeSideEffects(\n                            new_node=result, old_node=attribute\n                        )\n\n                        return (\n                            result,\n                            \"new_expression\",\n                            \"\"\"Replaced call to built-in 'getattr' with constant \\\nattribute '%s' to mere attribute lookup\"\"\"\n                            % attribute_name,\n                        )\n\n        return self, None, None\n\n\nclass ExpressionBuiltinSetattr(\n    ExpressionNoneShapeExactMixin, ChildrenExpressionBuiltinSetattrMixin, ExpressionBase\n):\n    \"\"\"Built-in \"setattr\".\n\n    Typical code like this: setattr(source, attribute, value)\n    \"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_SETATTR\"\n\n    named_children = (\"expression\", \"name\", \"value\")\n\n    def __init__(self, expression, name, value, source_ref):\n        ChildrenExpressionBuiltinSetattrMixin.__init__(\n            self,\n            expression=expression,\n            name=name,\n            value=value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    # TODO: Enable this.\n    # auto_compute_handling=\"wait_constant:attribute,raise\"\n\n    def computeExpressionConstantAttribute(self, trace_collection):\n        return ExpressionAttributeLookup(\n            expression=self.subnode_expression,\n            attribute_name=self.subnode_attribute.getCompileTimeConstant(),\n            source_ref=self.source_ref,\n        )\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Might be possible to predict or downgrade to mere attribute set\n        # in case of a compile time string attribute value.\n        return self, None, None\n\n\nclass ExpressionBuiltinHasattr(ExpressionBuiltinHasattrBase):\n    kind = \"EXPRESSION_BUILTIN_HASATTR\"\n\n    named_children = (\"expression\", \"name\")\n\n    auto_compute_handling = \"wait_constant:name,raise\"\n\n    def computeExpression(self, trace_collection):\n        # We do at least for compile time constants optimization here, but more\n        # could be done, were we to know shapes.\n        source = self.subnode_expression\n\n        if source.isCompileTimeConstant():\n            attribute = self.subnode_name\n\n            attribute_name = attribute.getStringValue()\n\n            # TODO: Something needs to be done if it has no string value.\n            if attribute_name is not None:\n                # If source or attribute have side effects, they must be\n                # evaluated, before the lookup.\n                (\n                    result,\n                    tags,\n                    change_desc,\n                ) = trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: hasattr(\n                        source.getCompileTimeConstant(), attribute_name\n                    ),\n                    description=\"Call to 'hasattr' pre-computed.\",\n                )\n\n                result = wrapExpressionWithNodeSideEffects(\n                    new_node=result, old_node=attribute\n                )\n                result = wrapExpressionWithNodeSideEffects(\n                    new_node=result, old_node=source\n                )\n\n                return result, tags, change_desc\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def computeExpressionConstantName(self, trace_collection):\n        attribute_name = self.subnode_name.getCompileTimeConstant()\n\n        if type(attribute_name) not in (str, unicode):\n            result = makeRaiseExceptionReplacementExpression(\n                expression=self,\n                exception_type=\"TypeError\",\n                exception_value=\"attribute name must be string\",\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"Call to hasattr with non-str type %s attribute name\"\n                % type(attribute_name),\n            )\n\n        if str is not unicode:\n            attribute_name = attribute_name.encode()\n\n        result = ExpressionAttributeCheck(\n            expression=self.subnode_expression,\n            attribute_name=attribute_name,\n            source_ref=self.source_ref,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Built-in 'hasattr' with constant attribute name.\",\n        )\n\n\nclass ExpressionAttributeCheck(\n    ExpressionBoolShapeExactMixin, ChildHavingExpressionMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_ATTRIBUTE_CHECK\"\n\n    named_children = (\"expression\",)\n\n    __slots__ = (\"attribute_name\",)\n\n    def __init__(self, expression, attribute_name, source_ref):\n        ChildHavingExpressionMixin.__init__(self, expression=expression)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attribute_name = attribute_name\n\n    def getDetails(self):\n        return {\"attribute_name\": self.attribute_name}\n\n    def computeExpression(self, trace_collection):\n        source = self.subnode_expression\n\n        # For things that know their attributes, we can statically optimize this\n        # into true or false, preserving side effects of course.\n        has_attribute = source.isKnownToHaveAttribute(self.attribute_name)\n        if has_attribute is not None:\n            result = makeCompileTimeConstantReplacementNode(\n                value=has_attribute, node=self, user_provided=False\n            )\n\n            # If source has side effects, they must be evaluated.\n            result = wrapExpressionWithNodeSideEffects(new_node=result, old_node=source)\n\n            return (\n                result,\n                \"new_constant\",\n                \"Attribute check has been pre-computed to '%s'.\" % has_attribute,\n            )\n\n        # Attribute check does not raise is implemented by getting an attribute.\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_expression.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    if str is bytes:\n\n        @staticmethod\n        def mayRaiseExceptionOperation():\n            return False\n\n    else:\n\n        def mayRaiseExceptionOperation(self):\n            return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n                BaseException, self.attribute_name\n            )\n\n    def getAttributeName(self):\n        return self.attribute_name\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/AttributeNodesGenerated.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Specialized attribute nodes\n\nWARNING, this code is GENERATED. Modify the template AttributeNodeFixed.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\n\n\nfrom nuitka.specs.BuiltinBytesOperationSpecs import (\n    bytes_capitalize_spec,\n    bytes_center_spec,\n    bytes_count_spec,\n    bytes_decode_spec,\n    bytes_endswith_spec,\n    bytes_expandtabs_spec,\n    bytes_find_spec,\n    bytes_index_spec,\n    bytes_isalnum_spec,\n    bytes_isalpha_spec,\n    bytes_isdigit_spec,\n    bytes_islower_spec,\n    bytes_isspace_spec,\n    bytes_istitle_spec,\n    bytes_isupper_spec,\n    bytes_join_spec,\n    bytes_ljust_spec,\n    bytes_lower_spec,\n    bytes_lstrip_spec,\n    bytes_partition_spec,\n    bytes_replace_spec,\n    bytes_rfind_spec,\n    bytes_rindex_spec,\n    bytes_rjust_spec,\n    bytes_rpartition_spec,\n    bytes_rsplit_spec,\n    bytes_rstrip_spec,\n    bytes_split_spec,\n    bytes_splitlines_spec,\n    bytes_startswith_spec,\n    bytes_strip_spec,\n    bytes_swapcase_spec,\n    bytes_title_spec,\n    bytes_translate_spec,\n    bytes_upper_spec,\n    bytes_zfill_spec,\n)\nfrom nuitka.specs.BuiltinDictOperationSpecs import (\n    dict_clear_spec,\n    dict_copy_spec,\n    dict_fromkeys_spec,\n    dict_get_spec,\n    dict_has_key_spec,\n    dict_items_spec,\n    dict_iteritems_spec,\n    dict_iterkeys_spec,\n    dict_itervalues_spec,\n    dict_keys_spec,\n    dict_pop_spec,\n    dict_popitem_spec,\n    dict_setdefault_spec,\n    dict_update_spec,\n    dict_values_spec,\n    dict_viewitems_spec,\n    dict_viewkeys_spec,\n    dict_viewvalues_spec,\n)\nfrom nuitka.specs.BuiltinListOperationSpecs import (\n    list_append_spec,\n    list_clear_spec,\n    list_copy_spec,\n    list_count_spec,\n    list_extend_spec,\n    list_index_spec,\n    list_insert_spec,\n    list_pop_spec,\n    list_remove_spec,\n    list_reverse_spec,\n)\nfrom nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs\nfrom nuitka.specs.BuiltinStrOperationSpecs import (\n    str_capitalize_spec,\n    str_center_spec,\n    str_count_spec,\n    str_decode_spec,\n    str_encode_spec,\n    str_endswith_spec,\n    str_expandtabs_spec,\n    str_find_spec,\n    str_format_spec,\n    str_index_spec,\n    str_isalnum_spec,\n    str_isalpha_spec,\n    str_isdigit_spec,\n    str_islower_spec,\n    str_isspace_spec,\n    str_istitle_spec,\n    str_isupper_spec,\n    str_join_spec,\n    str_ljust_spec,\n    str_lower_spec,\n    str_lstrip_spec,\n    str_partition_spec,\n    str_replace_spec,\n    str_rfind_spec,\n    str_rindex_spec,\n    str_rjust_spec,\n    str_rpartition_spec,\n    str_rsplit_spec,\n    str_rstrip_spec,\n    str_split_spec,\n    str_splitlines_spec,\n    str_startswith_spec,\n    str_strip_spec,\n    str_swapcase_spec,\n    str_title_spec,\n    str_translate_spec,\n    str_upper_spec,\n    str_zfill_spec,\n)\nfrom nuitka.specs.BuiltinTypeOperationSpecs import type___prepare___spec\n\nfrom .AttributeLookupNodes import ExpressionAttributeLookupFixedBase\nfrom .AttributeNodes import makeExpressionAttributeLookup\nfrom .BuiltinTypeNodes import ExpressionTypeOperationPrepare\nfrom .BytesNodes import (\n    ExpressionBytesOperationCapitalize,\n    ExpressionBytesOperationCenter2,\n    ExpressionBytesOperationCenter3,\n    ExpressionBytesOperationCount2,\n    ExpressionBytesOperationCount3,\n    ExpressionBytesOperationCount4,\n    ExpressionBytesOperationDecode1,\n    ExpressionBytesOperationDecode2,\n    ExpressionBytesOperationEndswith2,\n    ExpressionBytesOperationEndswith3,\n    ExpressionBytesOperationEndswith4,\n    ExpressionBytesOperationExpandtabs1,\n    ExpressionBytesOperationExpandtabs2,\n    ExpressionBytesOperationFind2,\n    ExpressionBytesOperationFind3,\n    ExpressionBytesOperationFind4,\n    ExpressionBytesOperationIndex2,\n    ExpressionBytesOperationIndex3,\n    ExpressionBytesOperationIndex4,\n    ExpressionBytesOperationIsalnum,\n    ExpressionBytesOperationIsalpha,\n    ExpressionBytesOperationIsdigit,\n    ExpressionBytesOperationIslower,\n    ExpressionBytesOperationIsspace,\n    ExpressionBytesOperationIstitle,\n    ExpressionBytesOperationIsupper,\n    ExpressionBytesOperationJoin,\n    ExpressionBytesOperationLjust2,\n    ExpressionBytesOperationLjust3,\n    ExpressionBytesOperationLower,\n    ExpressionBytesOperationLstrip1,\n    ExpressionBytesOperationLstrip2,\n    ExpressionBytesOperationPartition,\n    ExpressionBytesOperationReplace3,\n    ExpressionBytesOperationReplace4,\n    ExpressionBytesOperationRfind2,\n    ExpressionBytesOperationRfind3,\n    ExpressionBytesOperationRfind4,\n    ExpressionBytesOperationRindex2,\n    ExpressionBytesOperationRindex3,\n    ExpressionBytesOperationRindex4,\n    ExpressionBytesOperationRjust2,\n    ExpressionBytesOperationRjust3,\n    ExpressionBytesOperationRpartition,\n    ExpressionBytesOperationRsplit1,\n    ExpressionBytesOperationRsplit2,\n    ExpressionBytesOperationRstrip1,\n    ExpressionBytesOperationRstrip2,\n    ExpressionBytesOperationSplit1,\n    ExpressionBytesOperationSplit2,\n    ExpressionBytesOperationSplitlines1,\n    ExpressionBytesOperationSplitlines2,\n    ExpressionBytesOperationStartswith2,\n    ExpressionBytesOperationStartswith3,\n    ExpressionBytesOperationStartswith4,\n    ExpressionBytesOperationStrip1,\n    ExpressionBytesOperationStrip2,\n    ExpressionBytesOperationSwapcase,\n    ExpressionBytesOperationTitle,\n    ExpressionBytesOperationTranslate2,\n    ExpressionBytesOperationTranslate3,\n    ExpressionBytesOperationUpper,\n    ExpressionBytesOperationZfill,\n    makeExpressionBytesOperationDecode3,\n    makeExpressionBytesOperationRsplit3,\n    makeExpressionBytesOperationSplit3,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .DictionaryNodes import (\n    ExpressionDictOperationClear,\n    ExpressionDictOperationCopy,\n    ExpressionDictOperationFromkeys2,\n    ExpressionDictOperationFromkeys3,\n    ExpressionDictOperationFromkeysRef,\n    ExpressionDictOperationGet2,\n    ExpressionDictOperationGet3,\n    ExpressionDictOperationHaskey,\n    ExpressionDictOperationItems,\n    ExpressionDictOperationIteritems,\n    ExpressionDictOperationIterkeys,\n    ExpressionDictOperationItervalues,\n    ExpressionDictOperationKeys,\n    ExpressionDictOperationPop2,\n    ExpressionDictOperationPop3,\n    ExpressionDictOperationPopitem,\n    ExpressionDictOperationSetdefault2,\n    ExpressionDictOperationSetdefault3,\n    ExpressionDictOperationUpdate2,\n    ExpressionDictOperationValues,\n    ExpressionDictOperationViewitems,\n    ExpressionDictOperationViewkeys,\n    ExpressionDictOperationViewvalues,\n    makeExpressionDictOperationUpdate3,\n)\nfrom .KeyValuePairNodes import makeKeyValuePairExpressionsFromKwArgs\nfrom .ListOperationNodes import (\n    ExpressionListOperationAppend,\n    ExpressionListOperationClear,\n    ExpressionListOperationCopy,\n    ExpressionListOperationCount,\n    ExpressionListOperationExtend,\n    ExpressionListOperationIndex2,\n    ExpressionListOperationIndex3,\n    ExpressionListOperationIndex4,\n    ExpressionListOperationInsert,\n    ExpressionListOperationPop1,\n    ExpressionListOperationPop2,\n    ExpressionListOperationRemove,\n    ExpressionListOperationReverse,\n)\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import wrapExpressionWithNodeSideEffects\nfrom .StrNodes import (\n    ExpressionStrOperationCapitalize,\n    ExpressionStrOperationCenter2,\n    ExpressionStrOperationCenter3,\n    ExpressionStrOperationCount2,\n    ExpressionStrOperationCount3,\n    ExpressionStrOperationCount4,\n    ExpressionStrOperationDecode1,\n    ExpressionStrOperationDecode2,\n    ExpressionStrOperationDecode3,\n    ExpressionStrOperationEncode1,\n    ExpressionStrOperationEncode2,\n    ExpressionStrOperationEndswith2,\n    ExpressionStrOperationEndswith3,\n    ExpressionStrOperationEndswith4,\n    ExpressionStrOperationExpandtabs1,\n    ExpressionStrOperationExpandtabs2,\n    ExpressionStrOperationFind2,\n    ExpressionStrOperationFind3,\n    ExpressionStrOperationFind4,\n    ExpressionStrOperationFormat,\n    ExpressionStrOperationIndex2,\n    ExpressionStrOperationIndex3,\n    ExpressionStrOperationIndex4,\n    ExpressionStrOperationIsalnum,\n    ExpressionStrOperationIsalpha,\n    ExpressionStrOperationIsdigit,\n    ExpressionStrOperationIslower,\n    ExpressionStrOperationIsspace,\n    ExpressionStrOperationIstitle,\n    ExpressionStrOperationIsupper,\n    ExpressionStrOperationJoin,\n    ExpressionStrOperationLjust2,\n    ExpressionStrOperationLjust3,\n    ExpressionStrOperationLower,\n    ExpressionStrOperationLstrip1,\n    ExpressionStrOperationLstrip2,\n    ExpressionStrOperationPartition,\n    ExpressionStrOperationReplace3,\n    ExpressionStrOperationReplace4,\n    ExpressionStrOperationRfind2,\n    ExpressionStrOperationRfind3,\n    ExpressionStrOperationRfind4,\n    ExpressionStrOperationRindex2,\n    ExpressionStrOperationRindex3,\n    ExpressionStrOperationRindex4,\n    ExpressionStrOperationRjust2,\n    ExpressionStrOperationRjust3,\n    ExpressionStrOperationRpartition,\n    ExpressionStrOperationRsplit1,\n    ExpressionStrOperationRsplit2,\n    ExpressionStrOperationRstrip1,\n    ExpressionStrOperationRstrip2,\n    ExpressionStrOperationSplit1,\n    ExpressionStrOperationSplit2,\n    ExpressionStrOperationSplitlines1,\n    ExpressionStrOperationSplitlines2,\n    ExpressionStrOperationStartswith2,\n    ExpressionStrOperationStartswith3,\n    ExpressionStrOperationStartswith4,\n    ExpressionStrOperationStrip1,\n    ExpressionStrOperationStrip2,\n    ExpressionStrOperationSwapcase,\n    ExpressionStrOperationTitle,\n    ExpressionStrOperationTranslate,\n    ExpressionStrOperationUpper,\n    ExpressionStrOperationZfill,\n    makeExpressionStrOperationEncode3,\n    makeExpressionStrOperationRsplit3,\n    makeExpressionStrOperationSplit3,\n)\n\nattribute_classes = {}\nattribute_typed_classes = set()\n\n\nclass ExpressionAttributeLookupFixedPrepare(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value '__prepare__' of an object.\n\n    Typically code like: source.__prepare__\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_PREPARE\"\n    attribute_name = \"__prepare__\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeTypeExact():\n            result = ExpressionAttributeLookupTypePrepare(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup '__prepare__' on type shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"__prepare__\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"__prepare__\"\n        )\n\n\nattribute_classes[\"__prepare__\"] = ExpressionAttributeLookupFixedPrepare\n\n\nclass ExpressionAttributeLookupTypePrepare(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPrepare\n):\n    \"\"\"Attribute '__prepare__' lookup on a type value.\n\n    Typically code like: some_type.__prepare__\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_TYPE_PREPARE\"\n    attribute_name = \"__prepare__\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the type.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, type_arg, trace_collection):\n        def wrapExpressionTypeOperationPrepare(args, kwargs, source_ref):\n            return ExpressionTypeOperationPrepare(\n                type_arg=type_arg, args=args, kwargs=kwargs, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionTypeOperationPrepare,\n            builtin_spec=type___prepare___spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to '__prepare__' of type recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        type_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, type_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupTypePrepare)\n\n\nclass ExpressionAttributeLookupFixedAppend(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'append' of an object.\n\n    Typically code like: source.append\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_APPEND\"\n    attribute_name = \"append\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListAppend(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'append' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"append\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"append\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"append\"] = ExpressionAttributeLookupFixedAppend\n\n\nclass ExpressionAttributeLookupListAppend(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedAppend\n):\n    \"\"\"Attribute append lookup on a list value.\n\n    Typically code like: some_list.append\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_APPEND\"\n    attribute_name = \"append\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationAppend(item, source_ref):\n            return ExpressionListOperationAppend(\n                list_arg=list_arg, item=item, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationAppend,\n            builtin_spec=list_append_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'append' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListAppend)\n\n\nclass ExpressionAttributeLookupFixedCapitalize(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'capitalize' of an object.\n\n    Typically code like: source.capitalize\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_CAPITALIZE\"\n    attribute_name = \"capitalize\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrCapitalize(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'capitalize' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesCapitalize(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'capitalize' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"capitalize\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"capitalize\"\n        )\n\n\nattribute_classes[\"capitalize\"] = ExpressionAttributeLookupFixedCapitalize\n\n\nclass ExpressionAttributeLookupStrCapitalize(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCapitalize\n):\n    \"\"\"Attribute 'capitalize' lookup on a str value.\n\n    Typically code like: some_str.capitalize\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_CAPITALIZE\"\n    attribute_name = \"capitalize\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationCapitalize(source_ref):\n            return ExpressionStrOperationCapitalize(\n                str_arg=str_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationCapitalize,\n            builtin_spec=str_capitalize_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'capitalize' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrCapitalize)\n\n\nclass ExpressionAttributeLookupBytesCapitalize(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCapitalize\n):\n    \"\"\"Attribute 'capitalize' lookup on a bytes value.\n\n    Typically code like: some_bytes.capitalize\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_CAPITALIZE\"\n    attribute_name = \"capitalize\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationCapitalize(source_ref):\n            return ExpressionBytesOperationCapitalize(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationCapitalize,\n            builtin_spec=bytes_capitalize_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'capitalize' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesCapitalize)\n\n\nclass ExpressionAttributeLookupFixedCasefold(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'casefold' of an object.\n\n    Typically code like: source.casefold\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_CASEFOLD\"\n    attribute_name = \"casefold\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrCasefold(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'casefold' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"casefold\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"casefold\"\n        )\n\n\nattribute_classes[\"casefold\"] = ExpressionAttributeLookupFixedCasefold\n\n\nclass ExpressionAttributeLookupStrCasefold(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCasefold\n):\n    \"\"\"Attribute 'casefold' lookup on a str value.\n\n    Typically code like: some_str.casefold\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_CASEFOLD\"\n    attribute_name = \"casefold\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationCasefold is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrCasefold)\n\n\nclass ExpressionAttributeLookupFixedCenter(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'center' of an object.\n\n    Typically code like: source.center\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_CENTER\"\n    attribute_name = \"center\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrCenter(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'center' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesCenter(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'center' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"center\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"center\"\n        )\n\n\nattribute_classes[\"center\"] = ExpressionAttributeLookupFixedCenter\n\n\nclass ExpressionAttributeLookupStrCenter(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCenter\n):\n    \"\"\"Attribute 'center' lookup on a str value.\n\n    Typically code like: some_str.center\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_CENTER\"\n    attribute_name = \"center\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationCenter(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionStrOperationCenter3(\n                    str_arg=str_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionStrOperationCenter2(\n                    str_arg=str_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationCenter,\n            builtin_spec=str_center_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'center' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrCenter)\n\n\nclass ExpressionAttributeLookupBytesCenter(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCenter\n):\n    \"\"\"Attribute 'center' lookup on a bytes value.\n\n    Typically code like: some_bytes.center\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_CENTER\"\n    attribute_name = \"center\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationCenter(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionBytesOperationCenter3(\n                    bytes_arg=bytes_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationCenter2(\n                    bytes_arg=bytes_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationCenter,\n            builtin_spec=bytes_center_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'center' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesCenter)\n\n\nclass ExpressionAttributeLookupFixedClear(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'clear' of an object.\n\n    Typically code like: source.clear\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_CLEAR\"\n    attribute_name = \"clear\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictClear(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'clear' on dict shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListClear(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'clear' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"clear\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"clear\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"clear\"] = ExpressionAttributeLookupFixedClear\n\n\nclass ExpressionAttributeLookupDictClear(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedClear\n):\n    \"\"\"Attribute 'clear' lookup on a dict value.\n\n    Typically code like: some_dict.clear\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_CLEAR\"\n    attribute_name = \"clear\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationClear(source_ref):\n            return ExpressionDictOperationClear(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationClear,\n            builtin_spec=dict_clear_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'clear' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictClear)\n\n\nclass ExpressionAttributeLookupListClear(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedClear\n):\n    \"\"\"Attribute clear lookup on a list value.\n\n    Typically code like: some_list.clear\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_CLEAR\"\n    attribute_name = \"clear\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationClear(source_ref):\n            return ExpressionListOperationClear(\n                list_arg=list_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationClear,\n            builtin_spec=list_clear_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'clear' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListClear)\n\n\nclass ExpressionAttributeLookupFixedCopy(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'copy' of an object.\n\n    Typically code like: source.copy\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_COPY\"\n    attribute_name = \"copy\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictCopy(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'copy' on dict shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListCopy(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'copy' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"copy\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"copy\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"copy\"] = ExpressionAttributeLookupFixedCopy\n\n\nclass ExpressionAttributeLookupDictCopy(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCopy\n):\n    \"\"\"Attribute 'copy' lookup on a dict value.\n\n    Typically code like: some_dict.copy\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_COPY\"\n    attribute_name = \"copy\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationCopy(source_ref):\n            return ExpressionDictOperationCopy(dict_arg=dict_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationCopy,\n            builtin_spec=dict_copy_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'copy' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictCopy)\n\n\nclass ExpressionAttributeLookupListCopy(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCopy\n):\n    \"\"\"Attribute copy lookup on a list value.\n\n    Typically code like: some_list.copy\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_COPY\"\n    attribute_name = \"copy\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationCopy(source_ref):\n            return ExpressionListOperationCopy(list_arg=list_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationCopy,\n            builtin_spec=list_copy_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'copy' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListCopy)\n\n\nclass ExpressionAttributeLookupFixedCount(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'count' of an object.\n\n    Typically code like: source.count\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_COUNT\"\n    attribute_name = \"count\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrCount(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'count' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesCount(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'count' on bytes shape resolved.\",\n            )\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListCount(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'count' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"count\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"count\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"count\"] = ExpressionAttributeLookupFixedCount\n\n\nclass ExpressionAttributeLookupStrCount(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCount\n):\n    \"\"\"Attribute 'count' lookup on a str value.\n\n    Typically code like: some_str.count\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_COUNT\"\n    attribute_name = \"count\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationCount(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationCount4(\n                    str_arg=str_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationCount3(\n                    str_arg=str_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationCount2(\n                    str_arg=str_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationCount,\n            builtin_spec=str_count_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'count' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrCount)\n\n\nclass ExpressionAttributeLookupBytesCount(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCount\n):\n    \"\"\"Attribute 'count' lookup on a bytes value.\n\n    Typically code like: some_bytes.count\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_COUNT\"\n    attribute_name = \"count\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationCount(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationCount4(\n                    bytes_arg=bytes_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationCount3(\n                    bytes_arg=bytes_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationCount2(\n                    bytes_arg=bytes_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationCount,\n            builtin_spec=bytes_count_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'count' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesCount)\n\n\nclass ExpressionAttributeLookupListCount(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedCount\n):\n    \"\"\"Attribute count lookup on a list value.\n\n    Typically code like: some_list.count\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_COUNT\"\n    attribute_name = \"count\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the list.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationCount(value, source_ref):\n            return ExpressionListOperationCount(\n                list_arg=list_arg, value=value, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationCount,\n            builtin_spec=list_count_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'count' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListCount)\n\n\nclass ExpressionAttributeLookupFixedDecode(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'decode' of an object.\n\n    Typically code like: source.decode\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_DECODE\"\n    attribute_name = \"decode\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrDecode(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'decode' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesDecode(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'decode' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"decode\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"decode\"\n        )\n\n\nattribute_classes[\"decode\"] = ExpressionAttributeLookupFixedDecode\n\n\nclass ExpressionAttributeLookupStrDecode(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedDecode\n):\n    \"\"\"Attribute 'decode' lookup on a str value.\n\n    Typically code like: some_str.decode\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_DECODE\"\n    attribute_name = \"decode\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationDecode(encoding, errors, source_ref):\n            if errors is not None:\n                return ExpressionStrOperationDecode3(\n                    str_arg=str_arg,\n                    encoding=encoding,\n                    errors=errors,\n                    source_ref=source_ref,\n                )\n            elif encoding is not None:\n                return ExpressionStrOperationDecode2(\n                    str_arg=str_arg, encoding=encoding, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationDecode1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationDecode,\n            builtin_spec=str_decode_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'decode' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrDecode)\n\n\nclass ExpressionAttributeLookupBytesDecode(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedDecode\n):\n    \"\"\"Attribute 'decode' lookup on a bytes value.\n\n    Typically code like: some_bytes.decode\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_DECODE\"\n    attribute_name = \"decode\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationDecode(encoding, errors, source_ref):\n            if errors is not None:\n                return makeExpressionBytesOperationDecode3(\n                    bytes_arg=bytes_arg,\n                    encoding=encoding,\n                    errors=errors,\n                    source_ref=source_ref,\n                )\n            elif encoding is not None:\n                return ExpressionBytesOperationDecode2(\n                    bytes_arg=bytes_arg, encoding=encoding, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationDecode1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationDecode,\n            builtin_spec=bytes_decode_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'decode' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesDecode)\n\n\nclass ExpressionAttributeLookupFixedEncode(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'encode' of an object.\n\n    Typically code like: source.encode\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ENCODE\"\n    attribute_name = \"encode\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrEncode(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'encode' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"encode\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"encode\"\n        )\n\n\nattribute_classes[\"encode\"] = ExpressionAttributeLookupFixedEncode\n\n\nclass ExpressionAttributeLookupStrEncode(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedEncode\n):\n    \"\"\"Attribute 'encode' lookup on a str value.\n\n    Typically code like: some_str.encode\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ENCODE\"\n    attribute_name = \"encode\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationEncode(encoding, errors, source_ref):\n            if errors is not None:\n                return makeExpressionStrOperationEncode3(\n                    str_arg=str_arg,\n                    encoding=encoding,\n                    errors=errors,\n                    source_ref=source_ref,\n                )\n            elif encoding is not None:\n                return ExpressionStrOperationEncode2(\n                    str_arg=str_arg, encoding=encoding, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationEncode1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationEncode,\n            builtin_spec=str_encode_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'encode' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrEncode)\n\n\nclass ExpressionAttributeLookupFixedEndswith(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'endswith' of an object.\n\n    Typically code like: source.endswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ENDSWITH\"\n    attribute_name = \"endswith\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrEndswith(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'endswith' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesEndswith(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'endswith' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"endswith\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"endswith\"\n        )\n\n\nattribute_classes[\"endswith\"] = ExpressionAttributeLookupFixedEndswith\n\n\nclass ExpressionAttributeLookupStrEndswith(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedEndswith\n):\n    \"\"\"Attribute 'endswith' lookup on a str value.\n\n    Typically code like: some_str.endswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ENDSWITH\"\n    attribute_name = \"endswith\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationEndswith(suffix, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationEndswith4(\n                    str_arg=str_arg,\n                    suffix=suffix,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationEndswith3(\n                    str_arg=str_arg, suffix=suffix, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationEndswith2(\n                    str_arg=str_arg, suffix=suffix, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationEndswith,\n            builtin_spec=str_endswith_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'endswith' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrEndswith)\n\n\nclass ExpressionAttributeLookupBytesEndswith(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedEndswith\n):\n    \"\"\"Attribute 'endswith' lookup on a bytes value.\n\n    Typically code like: some_bytes.endswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ENDSWITH\"\n    attribute_name = \"endswith\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationEndswith(suffix, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationEndswith4(\n                    bytes_arg=bytes_arg,\n                    suffix=suffix,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationEndswith3(\n                    bytes_arg=bytes_arg,\n                    suffix=suffix,\n                    start=start,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationEndswith2(\n                    bytes_arg=bytes_arg, suffix=suffix, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationEndswith,\n            builtin_spec=bytes_endswith_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'endswith' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesEndswith)\n\n\nclass ExpressionAttributeLookupFixedExpandtabs(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'expandtabs' of an object.\n\n    Typically code like: source.expandtabs\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_EXPANDTABS\"\n    attribute_name = \"expandtabs\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrExpandtabs(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'expandtabs' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesExpandtabs(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'expandtabs' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"expandtabs\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"expandtabs\"\n        )\n\n\nattribute_classes[\"expandtabs\"] = ExpressionAttributeLookupFixedExpandtabs\n\n\nclass ExpressionAttributeLookupStrExpandtabs(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedExpandtabs\n):\n    \"\"\"Attribute 'expandtabs' lookup on a str value.\n\n    Typically code like: some_str.expandtabs\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_EXPANDTABS\"\n    attribute_name = \"expandtabs\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationExpandtabs(tabsize, source_ref):\n            if tabsize is not None:\n                return ExpressionStrOperationExpandtabs2(\n                    str_arg=str_arg, tabsize=tabsize, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationExpandtabs1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationExpandtabs,\n            builtin_spec=str_expandtabs_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'expandtabs' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrExpandtabs)\n\n\nclass ExpressionAttributeLookupBytesExpandtabs(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedExpandtabs\n):\n    \"\"\"Attribute 'expandtabs' lookup on a bytes value.\n\n    Typically code like: some_bytes.expandtabs\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_EXPANDTABS\"\n    attribute_name = \"expandtabs\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationExpandtabs(tabsize, source_ref):\n            if tabsize is not None:\n                return ExpressionBytesOperationExpandtabs2(\n                    bytes_arg=bytes_arg, tabsize=tabsize, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationExpandtabs1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationExpandtabs,\n            builtin_spec=bytes_expandtabs_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'expandtabs' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesExpandtabs)\n\n\nclass ExpressionAttributeLookupFixedExtend(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'extend' of an object.\n\n    Typically code like: source.extend\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_EXTEND\"\n    attribute_name = \"extend\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListExtend(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'extend' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"extend\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"extend\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"extend\"] = ExpressionAttributeLookupFixedExtend\n\n\nclass ExpressionAttributeLookupListExtend(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedExtend\n):\n    \"\"\"Attribute extend lookup on a list value.\n\n    Typically code like: some_list.extend\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_EXTEND\"\n    attribute_name = \"extend\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationExtend(value, source_ref):\n            return ExpressionListOperationExtend(\n                list_arg=list_arg, value=value, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationExtend,\n            builtin_spec=list_extend_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'extend' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListExtend)\n\n\nclass ExpressionAttributeLookupFixedFind(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'find' of an object.\n\n    Typically code like: source.find\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_FIND\"\n    attribute_name = \"find\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrFind(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'find' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesFind(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'find' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"find\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"find\"\n        )\n\n\nattribute_classes[\"find\"] = ExpressionAttributeLookupFixedFind\n\n\nclass ExpressionAttributeLookupStrFind(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedFind\n):\n    \"\"\"Attribute 'find' lookup on a str value.\n\n    Typically code like: some_str.find\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_FIND\"\n    attribute_name = \"find\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationFind(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationFind4(\n                    str_arg=str_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationFind3(\n                    str_arg=str_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationFind2(\n                    str_arg=str_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationFind,\n            builtin_spec=str_find_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'find' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrFind)\n\n\nclass ExpressionAttributeLookupBytesFind(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedFind\n):\n    \"\"\"Attribute 'find' lookup on a bytes value.\n\n    Typically code like: some_bytes.find\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_FIND\"\n    attribute_name = \"find\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationFind(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationFind4(\n                    bytes_arg=bytes_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationFind3(\n                    bytes_arg=bytes_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationFind2(\n                    bytes_arg=bytes_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationFind,\n            builtin_spec=bytes_find_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'find' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesFind)\n\n\nclass ExpressionAttributeLookupFixedFormat(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'format' of an object.\n\n    Typically code like: source.format\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_FORMAT\"\n    attribute_name = \"format\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrFormat(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'format' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"format\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"format\"\n        )\n\n\nattribute_classes[\"format\"] = ExpressionAttributeLookupFixedFormat\n\n\nclass ExpressionAttributeLookupStrFormat(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedFormat\n):\n    \"\"\"Attribute 'format' lookup on a str value.\n\n    Typically code like: some_str.format\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_FORMAT\"\n    attribute_name = \"format\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationFormat(args, pairs, source_ref):\n            return ExpressionStrOperationFormat(\n                str_arg=str_arg,\n                args=args,\n                pairs=makeKeyValuePairExpressionsFromKwArgs(pairs),\n                source_ref=source_ref,\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationFormat,\n            builtin_spec=str_format_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'format' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrFormat)\n\n\nclass ExpressionAttributeLookupFixedFormatmap(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'format_map' of an object.\n\n    Typically code like: source.format_map\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_FORMATMAP\"\n    attribute_name = \"format_map\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrFormatmap(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'format_map' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"format_map\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"format_map\"\n        )\n\n\nattribute_classes[\"format_map\"] = ExpressionAttributeLookupFixedFormatmap\n\n\nclass ExpressionAttributeLookupStrFormatmap(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedFormatmap\n):\n    \"\"\"Attribute 'format_map' lookup on a str value.\n\n    Typically code like: some_str.format_map\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_FORMATMAP\"\n    attribute_name = \"format_map\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationFormatmap is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrFormatmap)\n\n\nclass ExpressionAttributeLookupFixedFromkeys(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'fromkeys' of an object.\n\n    Typically code like: source.fromkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_FROMKEYS\"\n    attribute_name = \"fromkeys\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.isExpressionConstantTypeDictRef():\n            return (\n                ExpressionDictOperationFromkeysRef(source_ref=self.source_ref),\n                \"new_expression\",\n                \"Reference to 'dict.fromkeys' resolved.\",\n            )\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictFromkeys(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'fromkeys' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"fromkeys\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"fromkeys\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"fromkeys\"] = ExpressionAttributeLookupFixedFromkeys\n\n\nclass ExpressionAttributeLookupDictFromkeys(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedFromkeys\n):\n    \"\"\"Attribute 'fromkeys' lookup on a dict value.\n\n    Typically code like: some_dict.fromkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_FROMKEYS\"\n    attribute_name = \"fromkeys\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationFromkeys(iterable, value, source_ref):\n            if value is not None:\n                return ExpressionDictOperationFromkeys3(\n                    iterable=iterable, value=value, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationFromkeys2(\n                    iterable=iterable, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationFromkeys,\n            builtin_spec=dict_fromkeys_spec,\n        )\n\n        result = wrapExpressionWithNodeSideEffects(old_node=dict_arg, new_node=result)\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'fromkeys' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictFromkeys)\n\n\nclass ExpressionAttributeLookupFixedGet(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'get' of an object.\n\n    Typically code like: source.get\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_GET\"\n    attribute_name = \"get\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictGet(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'get' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"get\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"get\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"get\"] = ExpressionAttributeLookupFixedGet\n\n\nclass ExpressionAttributeLookupDictGet(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedGet\n):\n    \"\"\"Attribute 'get' lookup on a dict value.\n\n    Typically code like: some_dict.get\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_GET\"\n    attribute_name = \"get\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationGet(key, default, source_ref):\n            if default is not None:\n                return ExpressionDictOperationGet3(\n                    dict_arg=dict_arg, key=key, default=default, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationGet2(\n                    dict_arg=dict_arg, key=key, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationGet,\n            builtin_spec=dict_get_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'get' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictGet)\n\n\nclass ExpressionAttributeLookupFixedHaskey(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'has_key' of an object.\n\n    Typically code like: source.has_key\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_HASKEY\"\n    attribute_name = \"has_key\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictHaskey(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'has_key' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"has_key\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"has_key\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"has_key\"] = ExpressionAttributeLookupFixedHaskey\n\n\nclass ExpressionAttributeLookupDictHaskey(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedHaskey\n):\n    \"\"\"Attribute 'has_key' lookup on a dict value.\n\n    Typically code like: some_dict.has_key\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_HASKEY\"\n    attribute_name = \"has_key\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationHaskey(key, source_ref):\n            return ExpressionDictOperationHaskey(\n                dict_arg=dict_arg, key=key, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationHaskey,\n            builtin_spec=dict_has_key_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'has_key' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictHaskey)\n\n\nclass ExpressionAttributeLookupFixedIndex(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'index' of an object.\n\n    Typically code like: source.index\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_INDEX\"\n    attribute_name = \"index\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIndex(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'index' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIndex(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'index' on bytes shape resolved.\",\n            )\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListIndex(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'index' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"index\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"index\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"index\"] = ExpressionAttributeLookupFixedIndex\n\n\nclass ExpressionAttributeLookupStrIndex(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIndex\n):\n    \"\"\"Attribute 'index' lookup on a str value.\n\n    Typically code like: some_str.index\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_INDEX\"\n    attribute_name = \"index\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIndex(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationIndex4(\n                    str_arg=str_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationIndex3(\n                    str_arg=str_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationIndex2(\n                    str_arg=str_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIndex,\n            builtin_spec=str_index_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'index' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIndex)\n\n\nclass ExpressionAttributeLookupBytesIndex(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIndex\n):\n    \"\"\"Attribute 'index' lookup on a bytes value.\n\n    Typically code like: some_bytes.index\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_INDEX\"\n    attribute_name = \"index\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIndex(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationIndex4(\n                    bytes_arg=bytes_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationIndex3(\n                    bytes_arg=bytes_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationIndex2(\n                    bytes_arg=bytes_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIndex,\n            builtin_spec=bytes_index_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'index' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIndex)\n\n\nclass ExpressionAttributeLookupListIndex(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIndex\n):\n    \"\"\"Attribute index lookup on a list value.\n\n    Typically code like: some_list.index\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_INDEX\"\n    attribute_name = \"index\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the list.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationIndex(value, start, stop, source_ref):\n            if stop is not None:\n                return ExpressionListOperationIndex4(\n                    list_arg=list_arg,\n                    value=value,\n                    start=start,\n                    stop=stop,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionListOperationIndex3(\n                    list_arg=list_arg, value=value, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionListOperationIndex2(\n                    list_arg=list_arg, value=value, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationIndex,\n            builtin_spec=list_index_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'index' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListIndex)\n\n\nclass ExpressionAttributeLookupFixedInsert(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'insert' of an object.\n\n    Typically code like: source.insert\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_INSERT\"\n    attribute_name = \"insert\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListInsert(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'insert' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"insert\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"insert\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"insert\"] = ExpressionAttributeLookupFixedInsert\n\n\nclass ExpressionAttributeLookupListInsert(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedInsert\n):\n    \"\"\"Attribute insert lookup on a list value.\n\n    Typically code like: some_list.insert\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_INSERT\"\n    attribute_name = \"insert\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationInsert(index, item, source_ref):\n            return ExpressionListOperationInsert(\n                list_arg=list_arg, index=index, item=item, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationInsert,\n            builtin_spec=list_insert_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'insert' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListInsert)\n\n\nclass ExpressionAttributeLookupFixedIsalnum(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isalnum' of an object.\n\n    Typically code like: source.isalnum\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISALNUM\"\n    attribute_name = \"isalnum\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsalnum(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isalnum' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIsalnum(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isalnum' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isalnum\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isalnum\"\n        )\n\n\nattribute_classes[\"isalnum\"] = ExpressionAttributeLookupFixedIsalnum\n\n\nclass ExpressionAttributeLookupStrIsalnum(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsalnum\n):\n    \"\"\"Attribute 'isalnum' lookup on a str value.\n\n    Typically code like: some_str.isalnum\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISALNUM\"\n    attribute_name = \"isalnum\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIsalnum(source_ref):\n            return ExpressionStrOperationIsalnum(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIsalnum,\n            builtin_spec=str_isalnum_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isalnum' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsalnum)\n\n\nclass ExpressionAttributeLookupBytesIsalnum(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsalnum\n):\n    \"\"\"Attribute 'isalnum' lookup on a bytes value.\n\n    Typically code like: some_bytes.isalnum\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISALNUM\"\n    attribute_name = \"isalnum\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIsalnum(source_ref):\n            return ExpressionBytesOperationIsalnum(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIsalnum,\n            builtin_spec=bytes_isalnum_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isalnum' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIsalnum)\n\n\nclass ExpressionAttributeLookupFixedIsalpha(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isalpha' of an object.\n\n    Typically code like: source.isalpha\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISALPHA\"\n    attribute_name = \"isalpha\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsalpha(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isalpha' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIsalpha(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isalpha' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isalpha\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isalpha\"\n        )\n\n\nattribute_classes[\"isalpha\"] = ExpressionAttributeLookupFixedIsalpha\n\n\nclass ExpressionAttributeLookupStrIsalpha(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsalpha\n):\n    \"\"\"Attribute 'isalpha' lookup on a str value.\n\n    Typically code like: some_str.isalpha\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISALPHA\"\n    attribute_name = \"isalpha\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIsalpha(source_ref):\n            return ExpressionStrOperationIsalpha(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIsalpha,\n            builtin_spec=str_isalpha_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isalpha' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsalpha)\n\n\nclass ExpressionAttributeLookupBytesIsalpha(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsalpha\n):\n    \"\"\"Attribute 'isalpha' lookup on a bytes value.\n\n    Typically code like: some_bytes.isalpha\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISALPHA\"\n    attribute_name = \"isalpha\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIsalpha(source_ref):\n            return ExpressionBytesOperationIsalpha(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIsalpha,\n            builtin_spec=bytes_isalpha_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isalpha' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIsalpha)\n\n\nclass ExpressionAttributeLookupFixedIsascii(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isascii' of an object.\n\n    Typically code like: source.isascii\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISASCII\"\n    attribute_name = \"isascii\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsascii(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isascii' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isascii\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isascii\"\n        )\n\n\nattribute_classes[\"isascii\"] = ExpressionAttributeLookupFixedIsascii\n\n\nclass ExpressionAttributeLookupStrIsascii(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsascii\n):\n    \"\"\"Attribute 'isascii' lookup on a str value.\n\n    Typically code like: some_str.isascii\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISASCII\"\n    attribute_name = \"isascii\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationIsascii is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsascii)\n\n\nclass ExpressionAttributeLookupFixedIsdecimal(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isdecimal' of an object.\n\n    Typically code like: source.isdecimal\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISDECIMAL\"\n    attribute_name = \"isdecimal\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsdecimal(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isdecimal' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isdecimal\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isdecimal\"\n        )\n\n\nattribute_classes[\"isdecimal\"] = ExpressionAttributeLookupFixedIsdecimal\n\n\nclass ExpressionAttributeLookupStrIsdecimal(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsdecimal\n):\n    \"\"\"Attribute 'isdecimal' lookup on a str value.\n\n    Typically code like: some_str.isdecimal\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISDECIMAL\"\n    attribute_name = \"isdecimal\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationIsdecimal is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsdecimal)\n\n\nclass ExpressionAttributeLookupFixedIsdigit(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isdigit' of an object.\n\n    Typically code like: source.isdigit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISDIGIT\"\n    attribute_name = \"isdigit\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsdigit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isdigit' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIsdigit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isdigit' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isdigit\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isdigit\"\n        )\n\n\nattribute_classes[\"isdigit\"] = ExpressionAttributeLookupFixedIsdigit\n\n\nclass ExpressionAttributeLookupStrIsdigit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsdigit\n):\n    \"\"\"Attribute 'isdigit' lookup on a str value.\n\n    Typically code like: some_str.isdigit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISDIGIT\"\n    attribute_name = \"isdigit\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIsdigit(source_ref):\n            return ExpressionStrOperationIsdigit(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIsdigit,\n            builtin_spec=str_isdigit_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isdigit' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsdigit)\n\n\nclass ExpressionAttributeLookupBytesIsdigit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsdigit\n):\n    \"\"\"Attribute 'isdigit' lookup on a bytes value.\n\n    Typically code like: some_bytes.isdigit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISDIGIT\"\n    attribute_name = \"isdigit\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIsdigit(source_ref):\n            return ExpressionBytesOperationIsdigit(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIsdigit,\n            builtin_spec=bytes_isdigit_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isdigit' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIsdigit)\n\n\nclass ExpressionAttributeLookupFixedIsidentifier(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isidentifier' of an object.\n\n    Typically code like: source.isidentifier\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISIDENTIFIER\"\n    attribute_name = \"isidentifier\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsidentifier(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isidentifier' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isidentifier\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isidentifier\"\n        )\n\n\nattribute_classes[\"isidentifier\"] = ExpressionAttributeLookupFixedIsidentifier\n\n\nclass ExpressionAttributeLookupStrIsidentifier(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsidentifier\n):\n    \"\"\"Attribute 'isidentifier' lookup on a str value.\n\n    Typically code like: some_str.isidentifier\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISIDENTIFIER\"\n    attribute_name = \"isidentifier\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationIsidentifier is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsidentifier)\n\n\nclass ExpressionAttributeLookupFixedIslower(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'islower' of an object.\n\n    Typically code like: source.islower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISLOWER\"\n    attribute_name = \"islower\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIslower(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'islower' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIslower(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'islower' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"islower\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"islower\"\n        )\n\n\nattribute_classes[\"islower\"] = ExpressionAttributeLookupFixedIslower\n\n\nclass ExpressionAttributeLookupStrIslower(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIslower\n):\n    \"\"\"Attribute 'islower' lookup on a str value.\n\n    Typically code like: some_str.islower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISLOWER\"\n    attribute_name = \"islower\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIslower(source_ref):\n            return ExpressionStrOperationIslower(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIslower,\n            builtin_spec=str_islower_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'islower' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIslower)\n\n\nclass ExpressionAttributeLookupBytesIslower(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIslower\n):\n    \"\"\"Attribute 'islower' lookup on a bytes value.\n\n    Typically code like: some_bytes.islower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISLOWER\"\n    attribute_name = \"islower\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIslower(source_ref):\n            return ExpressionBytesOperationIslower(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIslower,\n            builtin_spec=bytes_islower_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'islower' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIslower)\n\n\nclass ExpressionAttributeLookupFixedIsnumeric(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isnumeric' of an object.\n\n    Typically code like: source.isnumeric\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISNUMERIC\"\n    attribute_name = \"isnumeric\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsnumeric(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isnumeric' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isnumeric\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isnumeric\"\n        )\n\n\nattribute_classes[\"isnumeric\"] = ExpressionAttributeLookupFixedIsnumeric\n\n\nclass ExpressionAttributeLookupStrIsnumeric(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsnumeric\n):\n    \"\"\"Attribute 'isnumeric' lookup on a str value.\n\n    Typically code like: some_str.isnumeric\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISNUMERIC\"\n    attribute_name = \"isnumeric\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationIsnumeric is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsnumeric)\n\n\nclass ExpressionAttributeLookupFixedIsprintable(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isprintable' of an object.\n\n    Typically code like: source.isprintable\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISPRINTABLE\"\n    attribute_name = \"isprintable\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsprintable(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isprintable' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isprintable\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isprintable\"\n        )\n\n\nattribute_classes[\"isprintable\"] = ExpressionAttributeLookupFixedIsprintable\n\n\nclass ExpressionAttributeLookupStrIsprintable(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsprintable\n):\n    \"\"\"Attribute 'isprintable' lookup on a str value.\n\n    Typically code like: some_str.isprintable\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISPRINTABLE\"\n    attribute_name = \"isprintable\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationIsprintable is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsprintable)\n\n\nclass ExpressionAttributeLookupFixedIsspace(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isspace' of an object.\n\n    Typically code like: source.isspace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISSPACE\"\n    attribute_name = \"isspace\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsspace(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isspace' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIsspace(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isspace' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isspace\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isspace\"\n        )\n\n\nattribute_classes[\"isspace\"] = ExpressionAttributeLookupFixedIsspace\n\n\nclass ExpressionAttributeLookupStrIsspace(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsspace\n):\n    \"\"\"Attribute 'isspace' lookup on a str value.\n\n    Typically code like: some_str.isspace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISSPACE\"\n    attribute_name = \"isspace\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIsspace(source_ref):\n            return ExpressionStrOperationIsspace(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIsspace,\n            builtin_spec=str_isspace_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isspace' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsspace)\n\n\nclass ExpressionAttributeLookupBytesIsspace(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsspace\n):\n    \"\"\"Attribute 'isspace' lookup on a bytes value.\n\n    Typically code like: some_bytes.isspace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISSPACE\"\n    attribute_name = \"isspace\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIsspace(source_ref):\n            return ExpressionBytesOperationIsspace(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIsspace,\n            builtin_spec=bytes_isspace_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isspace' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIsspace)\n\n\nclass ExpressionAttributeLookupFixedIstitle(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'istitle' of an object.\n\n    Typically code like: source.istitle\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISTITLE\"\n    attribute_name = \"istitle\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIstitle(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'istitle' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIstitle(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'istitle' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"istitle\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"istitle\"\n        )\n\n\nattribute_classes[\"istitle\"] = ExpressionAttributeLookupFixedIstitle\n\n\nclass ExpressionAttributeLookupStrIstitle(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIstitle\n):\n    \"\"\"Attribute 'istitle' lookup on a str value.\n\n    Typically code like: some_str.istitle\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISTITLE\"\n    attribute_name = \"istitle\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIstitle(source_ref):\n            return ExpressionStrOperationIstitle(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIstitle,\n            builtin_spec=str_istitle_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'istitle' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIstitle)\n\n\nclass ExpressionAttributeLookupBytesIstitle(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIstitle\n):\n    \"\"\"Attribute 'istitle' lookup on a bytes value.\n\n    Typically code like: some_bytes.istitle\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISTITLE\"\n    attribute_name = \"istitle\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIstitle(source_ref):\n            return ExpressionBytesOperationIstitle(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIstitle,\n            builtin_spec=bytes_istitle_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'istitle' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIstitle)\n\n\nclass ExpressionAttributeLookupFixedIsupper(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'isupper' of an object.\n\n    Typically code like: source.isupper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ISUPPER\"\n    attribute_name = \"isupper\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrIsupper(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isupper' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesIsupper(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'isupper' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"isupper\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"isupper\"\n        )\n\n\nattribute_classes[\"isupper\"] = ExpressionAttributeLookupFixedIsupper\n\n\nclass ExpressionAttributeLookupStrIsupper(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsupper\n):\n    \"\"\"Attribute 'isupper' lookup on a str value.\n\n    Typically code like: some_str.isupper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ISUPPER\"\n    attribute_name = \"isupper\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationIsupper(source_ref):\n            return ExpressionStrOperationIsupper(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationIsupper,\n            builtin_spec=str_isupper_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isupper' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrIsupper)\n\n\nclass ExpressionAttributeLookupBytesIsupper(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIsupper\n):\n    \"\"\"Attribute 'isupper' lookup on a bytes value.\n\n    Typically code like: some_bytes.isupper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ISUPPER\"\n    attribute_name = \"isupper\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationIsupper(source_ref):\n            return ExpressionBytesOperationIsupper(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationIsupper,\n            builtin_spec=bytes_isupper_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'isupper' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesIsupper)\n\n\nclass ExpressionAttributeLookupFixedItems(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'items' of an object.\n\n    Typically code like: source.items\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ITEMS\"\n    attribute_name = \"items\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictItems(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'items' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"items\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"items\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"items\"] = ExpressionAttributeLookupFixedItems\n\n\nclass ExpressionAttributeLookupDictItems(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedItems\n):\n    \"\"\"Attribute 'items' lookup on a dict value.\n\n    Typically code like: some_dict.items\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_ITEMS\"\n    attribute_name = \"items\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationItems(source_ref):\n            if str is bytes:\n                return ExpressionDictOperationItems(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationIteritems(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationItems,\n            builtin_spec=dict_items_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'items' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictItems)\n\n\nclass ExpressionAttributeLookupFixedIteritems(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'iteritems' of an object.\n\n    Typically code like: source.iteritems\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ITERITEMS\"\n    attribute_name = \"iteritems\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictIteritems(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'iteritems' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"iteritems\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"iteritems\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"iteritems\"] = ExpressionAttributeLookupFixedIteritems\n\n\nclass ExpressionAttributeLookupDictIteritems(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIteritems\n):\n    \"\"\"Attribute 'iteritems' lookup on a dict value.\n\n    Typically code like: some_dict.iteritems\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_ITERITEMS\"\n    attribute_name = \"iteritems\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationIteritems(source_ref):\n            return ExpressionDictOperationIteritems(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationIteritems,\n            builtin_spec=dict_iteritems_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'iteritems' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictIteritems)\n\n\nclass ExpressionAttributeLookupFixedIterkeys(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'iterkeys' of an object.\n\n    Typically code like: source.iterkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ITERKEYS\"\n    attribute_name = \"iterkeys\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictIterkeys(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'iterkeys' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"iterkeys\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"iterkeys\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"iterkeys\"] = ExpressionAttributeLookupFixedIterkeys\n\n\nclass ExpressionAttributeLookupDictIterkeys(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedIterkeys\n):\n    \"\"\"Attribute 'iterkeys' lookup on a dict value.\n\n    Typically code like: some_dict.iterkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_ITERKEYS\"\n    attribute_name = \"iterkeys\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationIterkeys(source_ref):\n            return ExpressionDictOperationIterkeys(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationIterkeys,\n            builtin_spec=dict_iterkeys_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'iterkeys' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictIterkeys)\n\n\nclass ExpressionAttributeLookupFixedItervalues(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'itervalues' of an object.\n\n    Typically code like: source.itervalues\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ITERVALUES\"\n    attribute_name = \"itervalues\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictItervalues(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'itervalues' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"itervalues\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"itervalues\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"itervalues\"] = ExpressionAttributeLookupFixedItervalues\n\n\nclass ExpressionAttributeLookupDictItervalues(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedItervalues\n):\n    \"\"\"Attribute 'itervalues' lookup on a dict value.\n\n    Typically code like: some_dict.itervalues\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_ITERVALUES\"\n    attribute_name = \"itervalues\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationItervalues(source_ref):\n            return ExpressionDictOperationItervalues(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationItervalues,\n            builtin_spec=dict_itervalues_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'itervalues' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictItervalues)\n\n\nclass ExpressionAttributeLookupFixedJoin(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'join' of an object.\n\n    Typically code like: source.join\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_JOIN\"\n    attribute_name = \"join\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrJoin(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'join' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesJoin(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'join' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"join\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"join\"\n        )\n\n\nattribute_classes[\"join\"] = ExpressionAttributeLookupFixedJoin\n\n\nclass ExpressionAttributeLookupStrJoin(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedJoin\n):\n    \"\"\"Attribute 'join' lookup on a str value.\n\n    Typically code like: some_str.join\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_JOIN\"\n    attribute_name = \"join\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationJoin(iterable, source_ref):\n            return ExpressionStrOperationJoin(\n                str_arg=str_arg, iterable=iterable, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationJoin,\n            builtin_spec=str_join_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'join' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrJoin)\n\n\nclass ExpressionAttributeLookupBytesJoin(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedJoin\n):\n    \"\"\"Attribute 'join' lookup on a bytes value.\n\n    Typically code like: some_bytes.join\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_JOIN\"\n    attribute_name = \"join\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationJoin(iterable, source_ref):\n            return ExpressionBytesOperationJoin(\n                bytes_arg=bytes_arg, iterable=iterable, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationJoin,\n            builtin_spec=bytes_join_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'join' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesJoin)\n\n\nclass ExpressionAttributeLookupFixedKeys(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'keys' of an object.\n\n    Typically code like: source.keys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_KEYS\"\n    attribute_name = \"keys\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictKeys(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'keys' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"keys\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"keys\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"keys\"] = ExpressionAttributeLookupFixedKeys\n\n\nclass ExpressionAttributeLookupDictKeys(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedKeys\n):\n    \"\"\"Attribute 'keys' lookup on a dict value.\n\n    Typically code like: some_dict.keys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_KEYS\"\n    attribute_name = \"keys\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationKeys(source_ref):\n            if str is bytes:\n                return ExpressionDictOperationKeys(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationIterkeys(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationKeys,\n            builtin_spec=dict_keys_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'keys' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictKeys)\n\n\nclass ExpressionAttributeLookupFixedLjust(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'ljust' of an object.\n\n    Typically code like: source.ljust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_LJUST\"\n    attribute_name = \"ljust\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrLjust(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'ljust' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesLjust(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'ljust' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"ljust\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"ljust\"\n        )\n\n\nattribute_classes[\"ljust\"] = ExpressionAttributeLookupFixedLjust\n\n\nclass ExpressionAttributeLookupStrLjust(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLjust\n):\n    \"\"\"Attribute 'ljust' lookup on a str value.\n\n    Typically code like: some_str.ljust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_LJUST\"\n    attribute_name = \"ljust\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationLjust(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionStrOperationLjust3(\n                    str_arg=str_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionStrOperationLjust2(\n                    str_arg=str_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationLjust,\n            builtin_spec=str_ljust_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'ljust' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrLjust)\n\n\nclass ExpressionAttributeLookupBytesLjust(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLjust\n):\n    \"\"\"Attribute 'ljust' lookup on a bytes value.\n\n    Typically code like: some_bytes.ljust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_LJUST\"\n    attribute_name = \"ljust\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationLjust(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionBytesOperationLjust3(\n                    bytes_arg=bytes_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationLjust2(\n                    bytes_arg=bytes_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationLjust,\n            builtin_spec=bytes_ljust_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'ljust' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesLjust)\n\n\nclass ExpressionAttributeLookupFixedLower(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'lower' of an object.\n\n    Typically code like: source.lower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_LOWER\"\n    attribute_name = \"lower\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrLower(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'lower' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesLower(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'lower' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"lower\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"lower\"\n        )\n\n\nattribute_classes[\"lower\"] = ExpressionAttributeLookupFixedLower\n\n\nclass ExpressionAttributeLookupStrLower(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLower\n):\n    \"\"\"Attribute 'lower' lookup on a str value.\n\n    Typically code like: some_str.lower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_LOWER\"\n    attribute_name = \"lower\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationLower(source_ref):\n            return ExpressionStrOperationLower(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationLower,\n            builtin_spec=str_lower_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'lower' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrLower)\n\n\nclass ExpressionAttributeLookupBytesLower(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLower\n):\n    \"\"\"Attribute 'lower' lookup on a bytes value.\n\n    Typically code like: some_bytes.lower\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_LOWER\"\n    attribute_name = \"lower\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationLower(source_ref):\n            return ExpressionBytesOperationLower(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationLower,\n            builtin_spec=bytes_lower_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'lower' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesLower)\n\n\nclass ExpressionAttributeLookupFixedLstrip(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'lstrip' of an object.\n\n    Typically code like: source.lstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_LSTRIP\"\n    attribute_name = \"lstrip\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrLstrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'lstrip' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesLstrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'lstrip' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"lstrip\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"lstrip\"\n        )\n\n\nattribute_classes[\"lstrip\"] = ExpressionAttributeLookupFixedLstrip\n\n\nclass ExpressionAttributeLookupStrLstrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLstrip\n):\n    \"\"\"Attribute 'lstrip' lookup on a str value.\n\n    Typically code like: some_str.lstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_LSTRIP\"\n    attribute_name = \"lstrip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationLstrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionStrOperationLstrip2(\n                    str_arg=str_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationLstrip1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationLstrip,\n            builtin_spec=str_lstrip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'lstrip' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrLstrip)\n\n\nclass ExpressionAttributeLookupBytesLstrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedLstrip\n):\n    \"\"\"Attribute 'lstrip' lookup on a bytes value.\n\n    Typically code like: some_bytes.lstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_LSTRIP\"\n    attribute_name = \"lstrip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationLstrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionBytesOperationLstrip2(\n                    bytes_arg=bytes_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationLstrip1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationLstrip,\n            builtin_spec=bytes_lstrip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'lstrip' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesLstrip)\n\n\nclass ExpressionAttributeLookupFixedMaketrans(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'maketrans' of an object.\n\n    Typically code like: source.maketrans\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_MAKETRANS\"\n    attribute_name = \"maketrans\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is not bytes and subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrMaketrans(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'maketrans' on str shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"maketrans\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"maketrans\"\n        )\n\n\nattribute_classes[\"maketrans\"] = ExpressionAttributeLookupFixedMaketrans\n\n\nclass ExpressionAttributeLookupStrMaketrans(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedMaketrans\n):\n    \"\"\"Attribute 'maketrans' lookup on a str value.\n\n    Typically code like: some_str.maketrans\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_MAKETRANS\"\n    attribute_name = \"maketrans\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    # No computeExpressionCall as str operation ExpressionStrOperationMaketrans is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrMaketrans)\n\n\nclass ExpressionAttributeLookupFixedPartition(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'partition' of an object.\n\n    Typically code like: source.partition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_PARTITION\"\n    attribute_name = \"partition\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrPartition(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'partition' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesPartition(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'partition' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"partition\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"partition\"\n        )\n\n\nattribute_classes[\"partition\"] = ExpressionAttributeLookupFixedPartition\n\n\nclass ExpressionAttributeLookupStrPartition(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPartition\n):\n    \"\"\"Attribute 'partition' lookup on a str value.\n\n    Typically code like: some_str.partition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_PARTITION\"\n    attribute_name = \"partition\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationPartition(sep, source_ref):\n            return ExpressionStrOperationPartition(\n                str_arg=str_arg, sep=sep, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationPartition,\n            builtin_spec=str_partition_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'partition' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrPartition)\n\n\nclass ExpressionAttributeLookupBytesPartition(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPartition\n):\n    \"\"\"Attribute 'partition' lookup on a bytes value.\n\n    Typically code like: some_bytes.partition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_PARTITION\"\n    attribute_name = \"partition\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationPartition(sep, source_ref):\n            return ExpressionBytesOperationPartition(\n                bytes_arg=bytes_arg, sep=sep, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationPartition,\n            builtin_spec=bytes_partition_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'partition' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesPartition)\n\n\nclass ExpressionAttributeLookupFixedPop(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'pop' of an object.\n\n    Typically code like: source.pop\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_POP\"\n    attribute_name = \"pop\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictPop(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'pop' on dict shape resolved.\",\n            )\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListPop(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'pop' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"pop\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"pop\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"pop\"] = ExpressionAttributeLookupFixedPop\n\n\nclass ExpressionAttributeLookupDictPop(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPop\n):\n    \"\"\"Attribute 'pop' lookup on a dict value.\n\n    Typically code like: some_dict.pop\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_POP\"\n    attribute_name = \"pop\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationPop(key, default, source_ref):\n            if default is not None:\n                return ExpressionDictOperationPop3(\n                    dict_arg=dict_arg, key=key, default=default, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationPop2(\n                    dict_arg=dict_arg, key=key, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationPop,\n            builtin_spec=dict_pop_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'pop' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictPop)\n\n\nclass ExpressionAttributeLookupListPop(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPop\n):\n    \"\"\"Attribute pop lookup on a list value.\n\n    Typically code like: some_list.pop\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_POP\"\n    attribute_name = \"pop\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationPop(index, source_ref):\n            if index is not None:\n                return ExpressionListOperationPop2(\n                    list_arg=list_arg, index=index, source_ref=source_ref\n                )\n            else:\n                return ExpressionListOperationPop1(\n                    list_arg=list_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationPop,\n            builtin_spec=list_pop_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'pop' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListPop)\n\n\nclass ExpressionAttributeLookupFixedPopitem(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'popitem' of an object.\n\n    Typically code like: source.popitem\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_POPITEM\"\n    attribute_name = \"popitem\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictPopitem(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'popitem' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"popitem\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"popitem\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"popitem\"] = ExpressionAttributeLookupFixedPopitem\n\n\nclass ExpressionAttributeLookupDictPopitem(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedPopitem\n):\n    \"\"\"Attribute 'popitem' lookup on a dict value.\n\n    Typically code like: some_dict.popitem\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_POPITEM\"\n    attribute_name = \"popitem\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationPopitem(source_ref):\n            return ExpressionDictOperationPopitem(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationPopitem,\n            builtin_spec=dict_popitem_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'popitem' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictPopitem)\n\n\nclass ExpressionAttributeLookupFixedRemove(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'remove' of an object.\n\n    Typically code like: source.remove\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_REMOVE\"\n    attribute_name = \"remove\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListRemove(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'remove' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"remove\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"remove\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"remove\"] = ExpressionAttributeLookupFixedRemove\n\n\nclass ExpressionAttributeLookupListRemove(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRemove\n):\n    \"\"\"Attribute remove lookup on a list value.\n\n    Typically code like: some_list.remove\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_REMOVE\"\n    attribute_name = \"remove\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationRemove(value, source_ref):\n            return ExpressionListOperationRemove(\n                list_arg=list_arg, value=value, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationRemove,\n            builtin_spec=list_remove_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'remove' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListRemove)\n\n\nclass ExpressionAttributeLookupFixedReplace(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'replace' of an object.\n\n    Typically code like: source.replace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_REPLACE\"\n    attribute_name = \"replace\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrReplace(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'replace' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesReplace(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'replace' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"replace\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"replace\"\n        )\n\n\nattribute_classes[\"replace\"] = ExpressionAttributeLookupFixedReplace\n\n\nclass ExpressionAttributeLookupStrReplace(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedReplace\n):\n    \"\"\"Attribute 'replace' lookup on a str value.\n\n    Typically code like: some_str.replace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_REPLACE\"\n    attribute_name = \"replace\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationReplace(old, new, count, source_ref):\n            if count is not None:\n                return ExpressionStrOperationReplace4(\n                    str_arg=str_arg,\n                    old=old,\n                    new=new,\n                    count=count,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionStrOperationReplace3(\n                    str_arg=str_arg, old=old, new=new, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationReplace,\n            builtin_spec=str_replace_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'replace' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrReplace)\n\n\nclass ExpressionAttributeLookupBytesReplace(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedReplace\n):\n    \"\"\"Attribute 'replace' lookup on a bytes value.\n\n    Typically code like: some_bytes.replace\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_REPLACE\"\n    attribute_name = \"replace\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationReplace(old, new, count, source_ref):\n            if count is not None:\n                return ExpressionBytesOperationReplace4(\n                    bytes_arg=bytes_arg,\n                    old=old,\n                    new=new,\n                    count=count,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationReplace3(\n                    bytes_arg=bytes_arg, old=old, new=new, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationReplace,\n            builtin_spec=bytes_replace_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'replace' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesReplace)\n\n\nclass ExpressionAttributeLookupFixedReverse(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'reverse' of an object.\n\n    Typically code like: source.reverse\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_REVERSE\"\n    attribute_name = \"reverse\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListReverse(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'reverse' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"reverse\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"reverse\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"reverse\"] = ExpressionAttributeLookupFixedReverse\n\n\nclass ExpressionAttributeLookupListReverse(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedReverse\n):\n    \"\"\"Attribute reverse lookup on a list value.\n\n    Typically code like: some_list.reverse\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_REVERSE\"\n    attribute_name = \"reverse\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperationReverse(source_ref):\n            return ExpressionListOperationReverse(\n                list_arg=list_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperationReverse,\n            builtin_spec=list_reverse_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'reverse' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListReverse)\n\n\nclass ExpressionAttributeLookupFixedRfind(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rfind' of an object.\n\n    Typically code like: source.rfind\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RFIND\"\n    attribute_name = \"rfind\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRfind(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rfind' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRfind(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rfind' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rfind\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rfind\"\n        )\n\n\nattribute_classes[\"rfind\"] = ExpressionAttributeLookupFixedRfind\n\n\nclass ExpressionAttributeLookupStrRfind(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRfind\n):\n    \"\"\"Attribute 'rfind' lookup on a str value.\n\n    Typically code like: some_str.rfind\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RFIND\"\n    attribute_name = \"rfind\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRfind(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationRfind4(\n                    str_arg=str_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationRfind3(\n                    str_arg=str_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationRfind2(\n                    str_arg=str_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRfind,\n            builtin_spec=str_rfind_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rfind' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRfind)\n\n\nclass ExpressionAttributeLookupBytesRfind(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRfind\n):\n    \"\"\"Attribute 'rfind' lookup on a bytes value.\n\n    Typically code like: some_bytes.rfind\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RFIND\"\n    attribute_name = \"rfind\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRfind(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationRfind4(\n                    bytes_arg=bytes_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationRfind3(\n                    bytes_arg=bytes_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationRfind2(\n                    bytes_arg=bytes_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRfind,\n            builtin_spec=bytes_rfind_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rfind' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRfind)\n\n\nclass ExpressionAttributeLookupFixedRindex(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rindex' of an object.\n\n    Typically code like: source.rindex\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RINDEX\"\n    attribute_name = \"rindex\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRindex(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rindex' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRindex(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rindex' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rindex\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rindex\"\n        )\n\n\nattribute_classes[\"rindex\"] = ExpressionAttributeLookupFixedRindex\n\n\nclass ExpressionAttributeLookupStrRindex(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRindex\n):\n    \"\"\"Attribute 'rindex' lookup on a str value.\n\n    Typically code like: some_str.rindex\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RINDEX\"\n    attribute_name = \"rindex\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRindex(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationRindex4(\n                    str_arg=str_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationRindex3(\n                    str_arg=str_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationRindex2(\n                    str_arg=str_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRindex,\n            builtin_spec=str_rindex_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rindex' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRindex)\n\n\nclass ExpressionAttributeLookupBytesRindex(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRindex\n):\n    \"\"\"Attribute 'rindex' lookup on a bytes value.\n\n    Typically code like: some_bytes.rindex\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RINDEX\"\n    attribute_name = \"rindex\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRindex(sub, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationRindex4(\n                    bytes_arg=bytes_arg,\n                    sub=sub,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationRindex3(\n                    bytes_arg=bytes_arg, sub=sub, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationRindex2(\n                    bytes_arg=bytes_arg, sub=sub, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRindex,\n            builtin_spec=bytes_rindex_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rindex' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRindex)\n\n\nclass ExpressionAttributeLookupFixedRjust(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rjust' of an object.\n\n    Typically code like: source.rjust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RJUST\"\n    attribute_name = \"rjust\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRjust(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rjust' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRjust(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rjust' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rjust\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rjust\"\n        )\n\n\nattribute_classes[\"rjust\"] = ExpressionAttributeLookupFixedRjust\n\n\nclass ExpressionAttributeLookupStrRjust(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRjust\n):\n    \"\"\"Attribute 'rjust' lookup on a str value.\n\n    Typically code like: some_str.rjust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RJUST\"\n    attribute_name = \"rjust\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRjust(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionStrOperationRjust3(\n                    str_arg=str_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionStrOperationRjust2(\n                    str_arg=str_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRjust,\n            builtin_spec=str_rjust_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rjust' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRjust)\n\n\nclass ExpressionAttributeLookupBytesRjust(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRjust\n):\n    \"\"\"Attribute 'rjust' lookup on a bytes value.\n\n    Typically code like: some_bytes.rjust\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RJUST\"\n    attribute_name = \"rjust\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRjust(width, fillchar, source_ref):\n            if fillchar is not None:\n                return ExpressionBytesOperationRjust3(\n                    bytes_arg=bytes_arg,\n                    width=width,\n                    fillchar=fillchar,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationRjust2(\n                    bytes_arg=bytes_arg, width=width, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRjust,\n            builtin_spec=bytes_rjust_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rjust' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRjust)\n\n\nclass ExpressionAttributeLookupFixedRpartition(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rpartition' of an object.\n\n    Typically code like: source.rpartition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RPARTITION\"\n    attribute_name = \"rpartition\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRpartition(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rpartition' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRpartition(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rpartition' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rpartition\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rpartition\"\n        )\n\n\nattribute_classes[\"rpartition\"] = ExpressionAttributeLookupFixedRpartition\n\n\nclass ExpressionAttributeLookupStrRpartition(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRpartition\n):\n    \"\"\"Attribute 'rpartition' lookup on a str value.\n\n    Typically code like: some_str.rpartition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RPARTITION\"\n    attribute_name = \"rpartition\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRpartition(sep, source_ref):\n            return ExpressionStrOperationRpartition(\n                str_arg=str_arg, sep=sep, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRpartition,\n            builtin_spec=str_rpartition_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rpartition' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRpartition)\n\n\nclass ExpressionAttributeLookupBytesRpartition(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRpartition\n):\n    \"\"\"Attribute 'rpartition' lookup on a bytes value.\n\n    Typically code like: some_bytes.rpartition\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RPARTITION\"\n    attribute_name = \"rpartition\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRpartition(sep, source_ref):\n            return ExpressionBytesOperationRpartition(\n                bytes_arg=bytes_arg, sep=sep, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRpartition,\n            builtin_spec=bytes_rpartition_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rpartition' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRpartition)\n\n\nclass ExpressionAttributeLookupFixedRsplit(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rsplit' of an object.\n\n    Typically code like: source.rsplit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RSPLIT\"\n    attribute_name = \"rsplit\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRsplit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rsplit' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRsplit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rsplit' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rsplit\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rsplit\"\n        )\n\n\nattribute_classes[\"rsplit\"] = ExpressionAttributeLookupFixedRsplit\n\n\nclass ExpressionAttributeLookupStrRsplit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRsplit\n):\n    \"\"\"Attribute 'rsplit' lookup on a str value.\n\n    Typically code like: some_str.rsplit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RSPLIT\"\n    attribute_name = \"rsplit\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRsplit(sep, maxsplit, source_ref):\n            if maxsplit is not None:\n                return makeExpressionStrOperationRsplit3(\n                    str_arg=str_arg, sep=sep, maxsplit=maxsplit, source_ref=source_ref\n                )\n            elif sep is not None:\n                return ExpressionStrOperationRsplit2(\n                    str_arg=str_arg, sep=sep, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationRsplit1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRsplit,\n            builtin_spec=str_rsplit_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rsplit' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRsplit)\n\n\nclass ExpressionAttributeLookupBytesRsplit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRsplit\n):\n    \"\"\"Attribute 'rsplit' lookup on a bytes value.\n\n    Typically code like: some_bytes.rsplit\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RSPLIT\"\n    attribute_name = \"rsplit\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRsplit(sep, maxsplit, source_ref):\n            if maxsplit is not None:\n                return makeExpressionBytesOperationRsplit3(\n                    bytes_arg=bytes_arg,\n                    sep=sep,\n                    maxsplit=maxsplit,\n                    source_ref=source_ref,\n                )\n            elif sep is not None:\n                return ExpressionBytesOperationRsplit2(\n                    bytes_arg=bytes_arg, sep=sep, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationRsplit1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRsplit,\n            builtin_spec=bytes_rsplit_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rsplit' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRsplit)\n\n\nclass ExpressionAttributeLookupFixedRstrip(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'rstrip' of an object.\n\n    Typically code like: source.rstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_RSTRIP\"\n    attribute_name = \"rstrip\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrRstrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rstrip' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesRstrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'rstrip' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"rstrip\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"rstrip\"\n        )\n\n\nattribute_classes[\"rstrip\"] = ExpressionAttributeLookupFixedRstrip\n\n\nclass ExpressionAttributeLookupStrRstrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRstrip\n):\n    \"\"\"Attribute 'rstrip' lookup on a str value.\n\n    Typically code like: some_str.rstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_RSTRIP\"\n    attribute_name = \"rstrip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationRstrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionStrOperationRstrip2(\n                    str_arg=str_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationRstrip1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationRstrip,\n            builtin_spec=str_rstrip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rstrip' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrRstrip)\n\n\nclass ExpressionAttributeLookupBytesRstrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedRstrip\n):\n    \"\"\"Attribute 'rstrip' lookup on a bytes value.\n\n    Typically code like: some_bytes.rstrip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_RSTRIP\"\n    attribute_name = \"rstrip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationRstrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionBytesOperationRstrip2(\n                    bytes_arg=bytes_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationRstrip1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationRstrip,\n            builtin_spec=bytes_rstrip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'rstrip' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesRstrip)\n\n\nclass ExpressionAttributeLookupFixedSetdefault(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'setdefault' of an object.\n\n    Typically code like: source.setdefault\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_SETDEFAULT\"\n    attribute_name = \"setdefault\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictSetdefault(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'setdefault' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"setdefault\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"setdefault\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"setdefault\"] = ExpressionAttributeLookupFixedSetdefault\n\n\nclass ExpressionAttributeLookupDictSetdefault(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSetdefault\n):\n    \"\"\"Attribute 'setdefault' lookup on a dict value.\n\n    Typically code like: some_dict.setdefault\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_SETDEFAULT\"\n    attribute_name = \"setdefault\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationSetdefault(key, default, source_ref):\n            if default is not None:\n                return ExpressionDictOperationSetdefault3(\n                    dict_arg=dict_arg, key=key, default=default, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationSetdefault2(\n                    dict_arg=dict_arg, key=key, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationSetdefault,\n            builtin_spec=dict_setdefault_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'setdefault' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictSetdefault)\n\n\nclass ExpressionAttributeLookupFixedSort(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'sort' of an object.\n\n    Typically code like: source.sort\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_SORT\"\n    attribute_name = \"sort\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeListExact():\n            result = ExpressionAttributeLookupListSort(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'sort' on list shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"sort\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"sort\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"sort\"] = ExpressionAttributeLookupFixedSort\n\n\nclass ExpressionAttributeLookupListSort(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSort\n):\n    \"\"\"Attribute sort lookup on a list value.\n\n    Typically code like: some_list.sort\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_SORT\"\n    attribute_name = \"sort\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    # No computeExpressionCall as list operation ExpressionListOperationSort is not yet implemented\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupListSort)\n\n\nclass ExpressionAttributeLookupFixedSplit(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'split' of an object.\n\n    Typically code like: source.split\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_SPLIT\"\n    attribute_name = \"split\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrSplit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'split' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesSplit(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'split' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"split\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"split\"\n        )\n\n\nattribute_classes[\"split\"] = ExpressionAttributeLookupFixedSplit\n\n\nclass ExpressionAttributeLookupStrSplit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSplit\n):\n    \"\"\"Attribute 'split' lookup on a str value.\n\n    Typically code like: some_str.split\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_SPLIT\"\n    attribute_name = \"split\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationSplit(sep, maxsplit, source_ref):\n            if maxsplit is not None:\n                return makeExpressionStrOperationSplit3(\n                    str_arg=str_arg, sep=sep, maxsplit=maxsplit, source_ref=source_ref\n                )\n            elif sep is not None:\n                return ExpressionStrOperationSplit2(\n                    str_arg=str_arg, sep=sep, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationSplit1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationSplit,\n            builtin_spec=str_split_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'split' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrSplit)\n\n\nclass ExpressionAttributeLookupBytesSplit(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSplit\n):\n    \"\"\"Attribute 'split' lookup on a bytes value.\n\n    Typically code like: some_bytes.split\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_SPLIT\"\n    attribute_name = \"split\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationSplit(sep, maxsplit, source_ref):\n            if maxsplit is not None:\n                return makeExpressionBytesOperationSplit3(\n                    bytes_arg=bytes_arg,\n                    sep=sep,\n                    maxsplit=maxsplit,\n                    source_ref=source_ref,\n                )\n            elif sep is not None:\n                return ExpressionBytesOperationSplit2(\n                    bytes_arg=bytes_arg, sep=sep, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationSplit1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationSplit,\n            builtin_spec=bytes_split_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'split' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesSplit)\n\n\nclass ExpressionAttributeLookupFixedSplitlines(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'splitlines' of an object.\n\n    Typically code like: source.splitlines\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_SPLITLINES\"\n    attribute_name = \"splitlines\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrSplitlines(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'splitlines' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesSplitlines(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'splitlines' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"splitlines\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"splitlines\"\n        )\n\n\nattribute_classes[\"splitlines\"] = ExpressionAttributeLookupFixedSplitlines\n\n\nclass ExpressionAttributeLookupStrSplitlines(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSplitlines\n):\n    \"\"\"Attribute 'splitlines' lookup on a str value.\n\n    Typically code like: some_str.splitlines\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_SPLITLINES\"\n    attribute_name = \"splitlines\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationSplitlines(keepends, source_ref):\n            if keepends is not None:\n                return ExpressionStrOperationSplitlines2(\n                    str_arg=str_arg, keepends=keepends, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationSplitlines1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationSplitlines,\n            builtin_spec=str_splitlines_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'splitlines' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrSplitlines)\n\n\nclass ExpressionAttributeLookupBytesSplitlines(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSplitlines\n):\n    \"\"\"Attribute 'splitlines' lookup on a bytes value.\n\n    Typically code like: some_bytes.splitlines\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_SPLITLINES\"\n    attribute_name = \"splitlines\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationSplitlines(keepends, source_ref):\n            if keepends is not None:\n                return ExpressionBytesOperationSplitlines2(\n                    bytes_arg=bytes_arg, keepends=keepends, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationSplitlines1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationSplitlines,\n            builtin_spec=bytes_splitlines_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'splitlines' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesSplitlines)\n\n\nclass ExpressionAttributeLookupFixedStartswith(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'startswith' of an object.\n\n    Typically code like: source.startswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_STARTSWITH\"\n    attribute_name = \"startswith\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrStartswith(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'startswith' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesStartswith(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'startswith' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"startswith\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"startswith\"\n        )\n\n\nattribute_classes[\"startswith\"] = ExpressionAttributeLookupFixedStartswith\n\n\nclass ExpressionAttributeLookupStrStartswith(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedStartswith\n):\n    \"\"\"Attribute 'startswith' lookup on a str value.\n\n    Typically code like: some_str.startswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_STARTSWITH\"\n    attribute_name = \"startswith\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationStartswith(prefix, start, end, source_ref):\n            if end is not None:\n                return ExpressionStrOperationStartswith4(\n                    str_arg=str_arg,\n                    prefix=prefix,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionStrOperationStartswith3(\n                    str_arg=str_arg, prefix=prefix, start=start, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationStartswith2(\n                    str_arg=str_arg, prefix=prefix, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationStartswith,\n            builtin_spec=str_startswith_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'startswith' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrStartswith)\n\n\nclass ExpressionAttributeLookupBytesStartswith(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedStartswith\n):\n    \"\"\"Attribute 'startswith' lookup on a bytes value.\n\n    Typically code like: some_bytes.startswith\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_STARTSWITH\"\n    attribute_name = \"startswith\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationStartswith(prefix, start, end, source_ref):\n            if end is not None:\n                return ExpressionBytesOperationStartswith4(\n                    bytes_arg=bytes_arg,\n                    prefix=prefix,\n                    start=start,\n                    end=end,\n                    source_ref=source_ref,\n                )\n            elif start is not None:\n                return ExpressionBytesOperationStartswith3(\n                    bytes_arg=bytes_arg,\n                    prefix=prefix,\n                    start=start,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationStartswith2(\n                    bytes_arg=bytes_arg, prefix=prefix, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationStartswith,\n            builtin_spec=bytes_startswith_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'startswith' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesStartswith)\n\n\nclass ExpressionAttributeLookupFixedStrip(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'strip' of an object.\n\n    Typically code like: source.strip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_STRIP\"\n    attribute_name = \"strip\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrStrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'strip' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesStrip(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'strip' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"strip\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"strip\"\n        )\n\n\nattribute_classes[\"strip\"] = ExpressionAttributeLookupFixedStrip\n\n\nclass ExpressionAttributeLookupStrStrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedStrip\n):\n    \"\"\"Attribute 'strip' lookup on a str value.\n\n    Typically code like: some_str.strip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_STRIP\"\n    attribute_name = \"strip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationStrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionStrOperationStrip2(\n                    str_arg=str_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionStrOperationStrip1(\n                    str_arg=str_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationStrip,\n            builtin_spec=str_strip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'strip' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrStrip)\n\n\nclass ExpressionAttributeLookupBytesStrip(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedStrip\n):\n    \"\"\"Attribute 'strip' lookup on a bytes value.\n\n    Typically code like: some_bytes.strip\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_STRIP\"\n    attribute_name = \"strip\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationStrip(chars, source_ref):\n            if chars is not None:\n                return ExpressionBytesOperationStrip2(\n                    bytes_arg=bytes_arg, chars=chars, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperationStrip1(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationStrip,\n            builtin_spec=bytes_strip_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'strip' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesStrip)\n\n\nclass ExpressionAttributeLookupFixedSwapcase(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'swapcase' of an object.\n\n    Typically code like: source.swapcase\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_SWAPCASE\"\n    attribute_name = \"swapcase\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrSwapcase(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'swapcase' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesSwapcase(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'swapcase' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"swapcase\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"swapcase\"\n        )\n\n\nattribute_classes[\"swapcase\"] = ExpressionAttributeLookupFixedSwapcase\n\n\nclass ExpressionAttributeLookupStrSwapcase(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSwapcase\n):\n    \"\"\"Attribute 'swapcase' lookup on a str value.\n\n    Typically code like: some_str.swapcase\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_SWAPCASE\"\n    attribute_name = \"swapcase\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationSwapcase(source_ref):\n            return ExpressionStrOperationSwapcase(\n                str_arg=str_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationSwapcase,\n            builtin_spec=str_swapcase_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'swapcase' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrSwapcase)\n\n\nclass ExpressionAttributeLookupBytesSwapcase(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedSwapcase\n):\n    \"\"\"Attribute 'swapcase' lookup on a bytes value.\n\n    Typically code like: some_bytes.swapcase\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_SWAPCASE\"\n    attribute_name = \"swapcase\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationSwapcase(source_ref):\n            return ExpressionBytesOperationSwapcase(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationSwapcase,\n            builtin_spec=bytes_swapcase_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'swapcase' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesSwapcase)\n\n\nclass ExpressionAttributeLookupFixedTitle(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'title' of an object.\n\n    Typically code like: source.title\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_TITLE\"\n    attribute_name = \"title\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrTitle(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'title' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesTitle(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'title' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"title\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"title\"\n        )\n\n\nattribute_classes[\"title\"] = ExpressionAttributeLookupFixedTitle\n\n\nclass ExpressionAttributeLookupStrTitle(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedTitle\n):\n    \"\"\"Attribute 'title' lookup on a str value.\n\n    Typically code like: some_str.title\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_TITLE\"\n    attribute_name = \"title\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationTitle(source_ref):\n            return ExpressionStrOperationTitle(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationTitle,\n            builtin_spec=str_title_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'title' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrTitle)\n\n\nclass ExpressionAttributeLookupBytesTitle(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedTitle\n):\n    \"\"\"Attribute 'title' lookup on a bytes value.\n\n    Typically code like: some_bytes.title\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_TITLE\"\n    attribute_name = \"title\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationTitle(source_ref):\n            return ExpressionBytesOperationTitle(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationTitle,\n            builtin_spec=bytes_title_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'title' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesTitle)\n\n\nclass ExpressionAttributeLookupFixedTranslate(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'translate' of an object.\n\n    Typically code like: source.translate\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_TRANSLATE\"\n    attribute_name = \"translate\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrTranslate(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'translate' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesTranslate(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'translate' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"translate\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"translate\"\n        )\n\n\nattribute_classes[\"translate\"] = ExpressionAttributeLookupFixedTranslate\n\n\nclass ExpressionAttributeLookupStrTranslate(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedTranslate\n):\n    \"\"\"Attribute 'translate' lookup on a str value.\n\n    Typically code like: some_str.translate\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_TRANSLATE\"\n    attribute_name = \"translate\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationTranslate(table, source_ref):\n            return ExpressionStrOperationTranslate(\n                str_arg=str_arg, table=table, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationTranslate,\n            builtin_spec=str_translate_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'translate' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrTranslate)\n\n\nclass ExpressionAttributeLookupBytesTranslate(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedTranslate\n):\n    \"\"\"Attribute 'translate' lookup on a bytes value.\n\n    Typically code like: some_bytes.translate\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_TRANSLATE\"\n    attribute_name = \"translate\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationTranslate(table, delete, source_ref):\n            if delete is not None:\n                return ExpressionBytesOperationTranslate3(\n                    bytes_arg=bytes_arg,\n                    table=table,\n                    delete=delete,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionBytesOperationTranslate2(\n                    bytes_arg=bytes_arg, table=table, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationTranslate,\n            builtin_spec=bytes_translate_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'translate' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesTranslate)\n\n\nclass ExpressionAttributeLookupFixedUpdate(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'update' of an object.\n\n    Typically code like: source.update\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_UPDATE\"\n    attribute_name = \"update\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictUpdate(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'update' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"update\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"update\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"update\"] = ExpressionAttributeLookupFixedUpdate\n\n\nclass ExpressionAttributeLookupDictUpdate(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedUpdate\n):\n    \"\"\"Attribute 'update' lookup on a dict value.\n\n    Typically code like: some_dict.update\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_UPDATE\"\n    attribute_name = \"update\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationUpdate(iterable, pairs, source_ref):\n            if pairs:\n                return makeExpressionDictOperationUpdate3(\n                    dict_arg=dict_arg,\n                    iterable=iterable,\n                    pairs=makeKeyValuePairExpressionsFromKwArgs(pairs),\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionDictOperationUpdate2(\n                    dict_arg=dict_arg, iterable=iterable, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationUpdate,\n            builtin_spec=dict_update_spec,\n            empty_special_class=lambda source_ref: wrapExpressionWithNodeSideEffects(\n                new_node=makeConstantRefNode(constant=None, source_ref=source_ref),\n                old_node=dict_arg,\n            ),\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'update' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictUpdate)\n\n\nclass ExpressionAttributeLookupFixedUpper(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'upper' of an object.\n\n    Typically code like: source.upper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_UPPER\"\n    attribute_name = \"upper\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrUpper(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'upper' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesUpper(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'upper' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"upper\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"upper\"\n        )\n\n\nattribute_classes[\"upper\"] = ExpressionAttributeLookupFixedUpper\n\n\nclass ExpressionAttributeLookupStrUpper(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedUpper\n):\n    \"\"\"Attribute 'upper' lookup on a str value.\n\n    Typically code like: some_str.upper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_UPPER\"\n    attribute_name = \"upper\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationUpper(source_ref):\n            return ExpressionStrOperationUpper(str_arg=str_arg, source_ref=source_ref)\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationUpper,\n            builtin_spec=str_upper_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'upper' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrUpper)\n\n\nclass ExpressionAttributeLookupBytesUpper(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedUpper\n):\n    \"\"\"Attribute 'upper' lookup on a bytes value.\n\n    Typically code like: some_bytes.upper\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_UPPER\"\n    attribute_name = \"upper\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationUpper(source_ref):\n            return ExpressionBytesOperationUpper(\n                bytes_arg=bytes_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationUpper,\n            builtin_spec=bytes_upper_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'upper' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesUpper)\n\n\nclass ExpressionAttributeLookupFixedValues(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'values' of an object.\n\n    Typically code like: source.values\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_VALUES\"\n    attribute_name = \"values\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictValues(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'values' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"values\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"values\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"values\"] = ExpressionAttributeLookupFixedValues\n\n\nclass ExpressionAttributeLookupDictValues(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedValues\n):\n    \"\"\"Attribute 'values' lookup on a dict value.\n\n    Typically code like: some_dict.values\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_VALUES\"\n    attribute_name = \"values\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationValues(source_ref):\n            if str is bytes:\n                return ExpressionDictOperationValues(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationItervalues(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationValues,\n            builtin_spec=dict_values_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'values' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictValues)\n\n\nclass ExpressionAttributeLookupFixedViewitems(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'viewitems' of an object.\n\n    Typically code like: source.viewitems\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_VIEWITEMS\"\n    attribute_name = \"viewitems\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictViewitems(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'viewitems' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"viewitems\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"viewitems\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"viewitems\"] = ExpressionAttributeLookupFixedViewitems\n\n\nclass ExpressionAttributeLookupDictViewitems(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedViewitems\n):\n    \"\"\"Attribute 'viewitems' lookup on a dict value.\n\n    Typically code like: some_dict.viewitems\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_VIEWITEMS\"\n    attribute_name = \"viewitems\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationViewitems(source_ref):\n            return ExpressionDictOperationViewitems(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationViewitems,\n            builtin_spec=dict_viewitems_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'viewitems' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictViewitems)\n\n\nclass ExpressionAttributeLookupFixedViewkeys(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'viewkeys' of an object.\n\n    Typically code like: source.viewkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_VIEWKEYS\"\n    attribute_name = \"viewkeys\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictViewkeys(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'viewkeys' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"viewkeys\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"viewkeys\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"viewkeys\"] = ExpressionAttributeLookupFixedViewkeys\n\n\nclass ExpressionAttributeLookupDictViewkeys(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedViewkeys\n):\n    \"\"\"Attribute 'viewkeys' lookup on a dict value.\n\n    Typically code like: some_dict.viewkeys\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_VIEWKEYS\"\n    attribute_name = \"viewkeys\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationViewkeys(source_ref):\n            return ExpressionDictOperationViewkeys(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationViewkeys,\n            builtin_spec=dict_viewkeys_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'viewkeys' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictViewkeys)\n\n\nclass ExpressionAttributeLookupFixedViewvalues(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'viewvalues' of an object.\n\n    Typically code like: source.viewvalues\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_VIEWVALUES\"\n    attribute_name = \"viewvalues\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if str is bytes and subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionAttributeLookupDictViewvalues(\n                    expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'viewvalues' on dict shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"viewvalues\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"viewvalues\"\n        )\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n\n\nattribute_classes[\"viewvalues\"] = ExpressionAttributeLookupFixedViewvalues\n\n\nclass ExpressionAttributeLookupDictViewvalues(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedViewvalues\n):\n    \"\"\"Attribute 'viewvalues' lookup on a dict value.\n\n    Typically code like: some_dict.viewvalues\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_VIEWVALUES\"\n    attribute_name = \"viewvalues\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the dict.\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperationViewvalues(source_ref):\n            return ExpressionDictOperationViewvalues(\n                dict_arg=dict_arg, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationViewvalues,\n            builtin_spec=dict_viewvalues_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'viewvalues' of dictionary recognized.\",\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupDictViewvalues)\n\n\nclass ExpressionAttributeLookupFixedZfill(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value 'zfill' of an object.\n\n    Typically code like: source.zfill\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_ZFILL\"\n    attribute_name = \"zfill\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n        if subnode_expression.hasShapeStrExact():\n            result = ExpressionAttributeLookupStrZfill(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'zfill' on str shape resolved.\",\n            )\n        if str is not bytes and subnode_expression.hasShapeBytesExact():\n            result = ExpressionAttributeLookupBytesZfill(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup 'zfill' on bytes shape resolved.\",\n            )\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"zfill\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"zfill\"\n        )\n\n\nattribute_classes[\"zfill\"] = ExpressionAttributeLookupFixedZfill\n\n\nclass ExpressionAttributeLookupStrZfill(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedZfill\n):\n    \"\"\"Attribute 'zfill' lookup on a str value.\n\n    Typically code like: some_str.zfill\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_ZFILL\"\n    attribute_name = \"zfill\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperationZfill(width, source_ref):\n            return ExpressionStrOperationZfill(\n                str_arg=str_arg, width=width, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperationZfill,\n            builtin_spec=str_zfill_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'zfill' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupStrZfill)\n\n\nclass ExpressionAttributeLookupBytesZfill(\n    SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixedZfill\n):\n    \"\"\"Attribute 'zfill' lookup on a bytes value.\n\n    Typically code like: some_bytes.zfill\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_ZFILL\"\n    attribute_name = \"zfill\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperationZfill(width, source_ref):\n            return ExpressionBytesOperationZfill(\n                bytes_arg=bytes_arg, width=width, source_ref=source_ref\n            )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperationZfill,\n            builtin_spec=bytes_zfill_spec,\n        )\n\n        return result, \"new_expression\", \"Call to 'zfill' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(\n            call_node, self.subnode_expression, trace_collection\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytesZfill)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinAllNodes.py",
    "content": "#     Copyright 2024, Batakrishna Sahu, mailto:<Batakrishna.Sahu@suiit.ac.in> find license text at end of file\n\n\n\"\"\" Node for the calls to the 'all' built-in.\n\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ExpressionBases import ExpressionBuiltinSingleArgBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_str, tshape_unicode\n\n\nclass ExpressionBuiltinAll(\n    ExpressionBoolShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    \"\"\"Builtin All Node class.\n\n    Args:\n        ExpressionBase: 'all - expression'\n\n    Returns:\n        Node that represents built-in 'all' call.\n\n    \"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_ALL\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_all_spec\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n        shape = value.getTypeShape()\n        if shape.hasShapeSlotIter() is False:\n            # An exception is raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"'%s' object is not iterable\",\n                operation=\"all\",\n                original_node=value,\n                value_node=value,\n            )\n\n        if shape in (tshape_str, tshape_unicode):\n            return (\n                wrapExpressionWithNodeSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=True, node=self, user_provided=False\n                    ),\n                    old_node=value,\n                ),\n                \"new_constant\",\n                \"Predicted truth value of built-in 'all' string type argument\",\n            )\n\n        iteration_handle = value.getIterationHandle()\n\n        if iteration_handle is not None:\n            all_true = iteration_handle.getAllElementTruthValue()\n\n            if all_true is not None:\n                result = wrapExpressionWithNodeSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=all_true, node=self, user_provided=False\n                    ),\n                    old_node=value,\n                )\n\n                return (\n                    result,\n                    \"new_constant\",\n                    \"Predicted truth value of built-in 'all' argument\",\n                )\n\n        self.onContentEscapes(trace_collection)\n\n        # All code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # All exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        \"\"\"returns boolean True if try/except/finally is needed else False\"\"\"\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        return not value.getTypeShape().hasShapeSlotIter()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinAnyNodes.py",
    "content": "#     Copyright 2024, Batakrishna Sahu, mailto:<Batakrishna.Sahu@suiit.ac.in> find license text at end of file\n\n\n\"\"\" Node for the calls to the 'any' built-in.\n\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ExpressionBases import ExpressionBuiltinSingleArgBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n    wrapExpressionWithNodeSideEffects,\n)\n\n\nclass ExpressionBuiltinAny(\n    ExpressionBoolShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    \"\"\"Builtin Any Node class.\n\n    Node that represents built-in 'any' call.\n\n    \"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_ANY\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_any_spec\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n        shape = value.getTypeShape()\n        if shape.hasShapeSlotIter() is False:\n            # An exception is raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"'%s' object is not iterable\",\n                operation=\"any\",\n                original_node=value,\n                value_node=value,\n            )\n\n        iteration_handle = value.getIterationHandle()\n\n        if iteration_handle is not None:\n            all_false = True\n            count = 0\n            while True:\n                truth_value = iteration_handle.getNextValueTruth()\n                if truth_value is StopIteration:\n                    break\n                if count > 256:\n                    all_false = False\n                    break\n\n                if truth_value is True:\n                    result = wrapExpressionWithNodeSideEffects(\n                        new_node=makeConstantReplacementNode(\n                            constant=True, node=self, user_provided=False\n                        ),\n                        old_node=value,\n                    )\n\n                    return (\n                        result,\n                        \"new_constant\",\n                        \"Predicted truth value of built-in any argument\",\n                    )\n                elif truth_value is None:\n                    all_false = False\n\n                count += 1\n\n            if all_false is True:\n                result = wrapExpressionWithNodeSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=False, node=self, user_provided=False\n                    ),\n                    old_node=value,\n                )\n\n                return (\n                    result,\n                    \"new_constant\",\n                    \"Predicted truth value of built-in any argument\",\n                )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        \"\"\"returns boolean True if exception is raised else False\"\"\"\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        return not value.getTypeShape().hasShapeSlotIter()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinComplexNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for the calls to the 'complex' built-in.\n\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingValueMixin,\n    ChildrenHavingRealOptionalImagMixin,\n)\nfrom .ExpressionBases import (\n    ExpressionBase,\n    ExpressionSpecBasedComputationMixin,\n)\nfrom .ExpressionShapeMixins import ExpressionComplexShapeExactMixin\n\n\nclass ExpressionBuiltinComplex1(\n    ExpressionComplexShapeExactMixin, ChildHavingValueMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_COMPLEX1\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        return value.computeExpressionComplex(\n            complex_node=self, trace_collection=trace_collection\n        )\n\n\nclass ExpressionBuiltinComplex2(\n    ExpressionSpecBasedComputationMixin,\n    ExpressionComplexShapeExactMixin,\n    ChildrenHavingRealOptionalImagMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_COMPLEX2\"\n\n    named_children = (\"real|optional\", \"imag\")\n\n    builtin_spec = BuiltinParameterSpecs.builtin_complex_spec\n\n    def __init__(self, real, imag, source_ref):\n        ChildrenHavingRealOptionalImagMixin.__init__(\n            self,\n            real=real,\n            imag=imag,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        given_values = self.subnode_real, self.subnode_imag\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=given_values\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinDecodingNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in ord/chr nodes\n\nThese are good for optimizations, as they give a very well known result. In the case of\n'chr', it's one of 256 strings, and in case of 'ord' it's one of 256 numbers, so these can\nanswer quite a few questions at compile time.\n\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ExpressionBases import ExpressionBuiltinSingleArgBase\n\n\nclass ExpressionBuiltinOrd(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_BUILTIN_ORD\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_ord_spec\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        return False\n\n\nclass ExpressionBuiltinChr(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_BUILTIN_CHR\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_chr_spec\n\n    def isKnownToBeIterable(self, count):\n        if self.mayRaiseException(BaseException):\n            return None\n\n        return count is None or count == 1\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinDecoratorNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in staticmethod/classmethod nodes\n\nThese are good for optimizations, as they give a very well known result, changing\nonly the way a class member is being called. Being able to avoid going through a\nC call to the built-ins resulting wrapper, will speed up things.\n\"\"\"\n\nfrom .ExpressionBasesGenerated import (\n    ExpressionBuiltinClassmethodBase,\n    ExpressionBuiltinStaticmethodBase,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_classmethod, tshape_staticmethod\n\n\nclass BuiltinStaticmethodClassmethodMixin(object):\n    __slots__ = ()\n\n    # There is nothing to compute for it as a value.\n    auto_compute_handling = \"final,no_raise\"\n\n    # TODO: Make it part of auto-compute through a the shape provided.\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # pylint: disable=unused-argument\n        return False\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    # TODO: should be automatic due to final\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    # TODO: should be a auto_compute property.\n    def mayHaveSideEffect(self):\n        return self.subnode_value.mayHaveSideEffect()\n\n    def extractSideEffects(self):\n        return self.subnode_value.extractSideEffects()\n\n\nclass ExpressionBuiltinStaticmethod(\n    BuiltinStaticmethodClassmethodMixin, ExpressionBuiltinStaticmethodBase\n):\n    kind = \"EXPRESSION_BUILTIN_STATICMETHOD\"\n\n    # TODO: Allow these to be in class classes instead.\n    named_children = (\"value\",)\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_staticmethod\n\n\nclass ExpressionBuiltinClassmethod(\n    BuiltinStaticmethodClassmethodMixin, ExpressionBuiltinClassmethodBase\n):\n    kind = \"EXPRESSION_BUILTIN_CLASSMETHOD\"\n\n    # TODO: Allow these to be in mixin classes instead.\n    named_children = (\"value\",)\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_classmethod\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinDictNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for the calls to the 'dict' built-in.\n\n\"\"\"\n\nfrom nuitka.specs.BuiltinParameterSpecs import builtin_dict_spec\n\nfrom .BuiltinIteratorNodes import ExpressionBuiltinIter1\nfrom .ChildrenHavingMixins import ChildrenHavingPosArgOptionalPairsTupleMixin\nfrom .DictionaryNodes import makeExpressionMakeDict\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionDictShapeExactMixin\nfrom .NodeMakingHelpers import wrapExpressionWithNodeSideEffects\n\n\nclass ExpressionBuiltinDict(\n    ExpressionDictShapeExactMixin,\n    ChildrenHavingPosArgOptionalPairsTupleMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_DICT\"\n\n    named_children = (\"pos_arg|optional\", \"pairs|tuple\")\n\n    def __init__(self, pos_arg, pairs, source_ref):\n        ChildrenHavingPosArgOptionalPairsTupleMixin.__init__(\n            self,\n            pos_arg=pos_arg,\n            pairs=pairs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def hasOnlyConstantArguments(self):\n        pos_arg = self.subnode_pos_arg\n\n        if pos_arg is not None and not pos_arg.isCompileTimeConstant():\n            return False\n\n        for arg_pair in self.subnode_pairs:\n            if not arg_pair.isCompileTimeConstant():\n                return False\n\n        return True\n\n    def computeExpression(self, trace_collection):\n        pos_arg = self.subnode_pos_arg\n        pairs = self.subnode_pairs\n\n        if pos_arg is None:\n            new_node = makeExpressionMakeDict(\n                pairs=self.subnode_pairs, source_ref=self.source_ref\n            )\n\n            # This cannot raise anymore than its arguments, as the keys will\n            # be known as hashable, due to being Python parameters before.\n\n            return (\n                new_node,\n                \"new_expression\",\n                \"Replace 'dict' built-in call dictionary creation from arguments.\",\n            )\n\n        pos_iteration_length = pos_arg.getIterationLength()\n\n        if pos_iteration_length == 0:\n            new_node = makeExpressionMakeDict(\n                pairs=self.subnode_pairs, source_ref=self.source_ref\n            )\n\n            # Maintain potential side effects from the positional arguments.\n            new_node = wrapExpressionWithNodeSideEffects(\n                old_node=ExpressionBuiltinIter1(\n                    value=pos_arg, source_ref=self.source_ref\n                ),\n                new_node=new_node,\n            )\n\n            # Just in case, the iteration may do that.\n            if not pos_arg.hasShapeSlotIter():\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n            return (\n                new_node,\n                \"new_expression\",\n                \"Replace 'dict' built-in call dictionary creation from arguments.\",\n            )\n\n        if (\n            pos_iteration_length is not None\n            and pos_iteration_length + len(pairs) < 256\n            and self.hasOnlyConstantArguments()\n        ):\n            if pos_arg is not None:\n                pos_args = (pos_arg,)\n            else:\n                pos_args = None\n\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: builtin_dict_spec.simulateCall(\n                    (pos_args, self.subnode_pairs)\n                ),\n                description=\"Replace 'dict' call with constant arguments.\",\n            )\n        else:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        pos_arg = self.subnode_pos_arg\n\n        # TODO: Determining if it's sufficient is not easy but possible.\n        if pos_arg is not None:\n            return True\n\n        for arg_pair in self.subnode_pairs:\n            if arg_pair.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinFormatNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Format related nodes format/bin/oct/hex/ascii.\n\nThese will most often be used for outputs, and the hope is, the type prediction or the\nresult prediction will help to be smarter, but generally these should not be that much\nabout performance critical.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildrenHavingValueFormatSpecOptionalAutoNoneEmptyStrMixin,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase\nfrom .ExpressionShapeMixins import (\n    ExpressionIntOrLongExactMixin,\n    ExpressionStrOrUnicodeExactMixin,\n    ExpressionStrShapeExactMixin,\n)\nfrom .NodeMakingHelpers import makeStatementExpressionOnlyReplacementNode\n\n\nclass ExpressionBuiltinFormat(\n    ExpressionStrOrUnicodeExactMixin,\n    ChildrenHavingValueFormatSpecOptionalAutoNoneEmptyStrMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_FORMAT\"\n\n    named_children = (\"value\", \"format_spec|auto_none_empty_str\")\n\n    def __init__(self, value, format_spec, source_ref):\n        ChildrenHavingValueFormatSpecOptionalAutoNoneEmptyStrMixin.__init__(\n            self,\n            value=value,\n            format_spec=format_spec,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Can use the format built-in on compile time constants at least.\n\n        value = self.subnode_value\n        format_spec = self.subnode_format_spec\n\n        # TODO: Provide \"__format__\" slot based handling.\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Strings format themselves as what they are.\n        if format_spec is None:\n            if value.hasShapeStrOrUnicodeExact():\n                return (\n                    value,\n                    \"new_expression\",\n                    \"\"\"\\\nRemoved useless 'format' on '%s' value.\"\"\"\n                    % value.getTypeShape().getTypeName(),\n                )\n\n        return self, None, None\n\n\nclass ExpressionBuiltinAscii(\n    ExpressionStrShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_ASCII\"\n\n    if python_version >= 0x300:\n        builtin_spec = BuiltinParameterSpecs.builtin_ascii_spec\n\n\nclass ExpressionBuiltinBin(\n    ExpressionStrShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_BIN\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_bin_spec\n\n\nclass ExpressionBuiltinOct(\n    ExpressionStrShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_OCT\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_oct_spec\n\n\nclass ExpressionBuiltinHex(\n    ExpressionStrShapeExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_HEX\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_hex_spec\n\n\nclass ExpressionBuiltinId(\n    ExpressionIntOrLongExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_ID\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_id_spec\n\n    def computeExpression(self, trace_collection):\n        # Note: Quite impossible to predict the pointer value or anything, but\n        # we know the result will be a long.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def getIntValue(self):\n        return self\n\n    # TODO: Make use SideEffectsFromChildrenMixin in form of a SideEffectsFromChildMixin\n    def computeExpressionDrop(self, statement, trace_collection):\n        result = makeStatementExpressionOnlyReplacementNode(\n            expression=self.subnode_value, node=self\n        )\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nRemoved id taking for unused result.\"\"\",\n        )\n\n    def mayHaveSideEffects(self):\n        return self.subnode_value.mayHaveSideEffects()\n\n    def extractSideEffects(self):\n        return self.subnode_value.extractSideEffects()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinHashNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node the calls to the 'hash' built-in.\n\nThis is a specific thing, which must be calculated at run time, but we can\npredict things about its type, and the fact that it won't raise an exception\nfor some types, so it is still useful. Also calls to it can be accelerated\nslightly.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingValueMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionIntShapeExactMixin\n\n\nclass ExpressionBuiltinHash(\n    ExpressionIntShapeExactMixin, ChildHavingValueMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_HASH\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        # TODO: Have a computation slot for hashing and specialize for known cases.\n        if not value.isKnownToBeHashable():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Static raise if it's known not to be hashable.\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_value.mayRaiseException(exception_type)\n            or not self.subnode_value.isKnownToBeHashable()\n        )\n\n    def mayRaiseExceptionOperation(self):\n        return not self.subnode_value.isKnownToBeHashable()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinInputNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node the calls to the 'input' built-in.\n\nThis has a specific result value, which can be useful to know, but mostly\nwe want to apply hacks for redirected error output only, and still have\nthe \"input\" function being usable.\n\"\"\"\n\nfrom .ExpressionBasesGenerated import ExpressionBuiltinInputBase\nfrom .ExpressionShapeMixins import ExpressionStrShapeExactMixin\n\n\nclass ExpressionBuiltinInput(ExpressionStrShapeExactMixin, ExpressionBuiltinInputBase):\n    kind = \"EXPRESSION_BUILTIN_INPUT\"\n\n    named_children = (\"prompt|optional\",)\n    auto_compute_handling = \"final\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinIntegerNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for the calls to the 'int' and 'long' (Python2) built-ins.\n\nThese are divided into variants for one and two arguments and they have a\ncommon base class, because most of the behavior is the same there. The ones\nwith 2 arguments only work on strings, and give errors otherwise, the ones\nwith one argument, use slots, \"__int__\" and \"__long__\", so what they do does\nlargely depend on the arguments slot.\n\"\"\"\n\nfrom nuitka.__past__ import long\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingValueMixin,\n    ChildrenHavingValueOptionalBaseMixin,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import (\n    ExpressionBase,\n    ExpressionSpecBasedComputationMixin,\n)\nfrom .ExpressionShapeMixins import (\n    ExpressionIntOrLongExactMixin,\n    ExpressionLongShapeExactMixin,\n)\nfrom .shapes.BuiltinTypeShapes import (\n    tshape_int_or_long_derived,\n    tshape_long_derived,\n)\n\n\nclass ExpressionBuiltinInt1(ChildHavingValueMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_INT1\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Depending on input type shape and value, we should improve this.\n        return tshape_int_or_long_derived\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionInt(\n            int_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseExceptionInt(exception_type)\n\n\nclass ExpressionBuiltinIntLong2Base(\n    ExpressionSpecBasedComputationMixin,\n    ChildrenHavingValueOptionalBaseMixin,\n    ExpressionBase,\n):\n    named_children = (\"value|optional\", \"base\")\n\n    # Note: Python version specific, it may be allowed or not to leave out value.\n    try:\n        int(base=2)\n    except TypeError:\n        base_only_value = False\n    else:\n        base_only_value = True\n\n    # To be overloaded by child classes with int/long.\n    builtin = int\n\n    def __init__(self, value, base, source_ref):\n        if value is None and self.base_only_value:\n            value = makeConstantRefNode(\n                constant=\"0\", source_ref=source_ref, user_provided=True\n            )\n\n        ChildrenHavingValueOptionalBaseMixin.__init__(\n            self,\n            value=value,\n            base=base,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n        base = self.subnode_base\n\n        if value is None:\n            if base is not None:\n                if not self.base_only_value:\n                    return trace_collection.getCompileTimeComputationResult(\n                        node=self,\n                        computation=lambda: self.builtin(base=2),\n                        description=\"\"\"\\\n%s built-in call with only base argument\"\"\"\n                        % self.builtin.__name__,\n                    )\n\n            given_values = ()\n        else:\n            given_values = (value, base)\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=given_values\n        )\n\n\nclass ExpressionBuiltinInt2(\n    ExpressionIntOrLongExactMixin, ExpressionBuiltinIntLong2Base\n):\n    kind = \"EXPRESSION_BUILTIN_INT2\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_int_spec\n    builtin = int\n\n\nclass ExpressionBuiltinLong1(ChildHavingValueMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_LONG1\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Depending on input type shape and value, we should improve this.\n        return tshape_long_derived\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionLong(\n            long_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseExceptionLong(exception_type)\n\n\nclass ExpressionBuiltinLong2(\n    ExpressionLongShapeExactMixin, ExpressionBuiltinIntLong2Base\n):\n    kind = \"EXPRESSION_BUILTIN_LONG2\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_long_spec\n    builtin = long\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinIteratorNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in iterator nodes.\n\nThese play a role in for loops, and in unpacking. They can something be\npredicted to succeed or fail, in which case, code can become less complex.\n\nThe length of things is an important optimization issue for these to be\ngood.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .BuiltinLenNodes import ExpressionBuiltinLen\nfrom .ExpressionBases import ExpressionBuiltinSingleArgBase\nfrom .ExpressionBasesGenerated import ExpressionBuiltinIter2Base\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionReplacementStatement,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.StandardShapes import tshape_iterator\nfrom .StatementBasesGenerated import (\n    StatementSpecialUnpackCheckBase,\n    StatementSpecialUnpackCheckFromIteratedBase,\n)\nfrom .VariableRefNodes import ExpressionTempVariableRef\n\n\nclass ExpressionBuiltinIter1(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_BUILTIN_ITER1\"\n\n    simulator = iter\n\n    @staticmethod\n    def isExpressionBuiltinIter1():\n        return True\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionIter1(\n            iter_node=self, trace_collection=trace_collection\n        )\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Iteration over an iterator is that iterator.\n\n        return self, \"new_builtin\", \"Eliminated useless iterator creation.\"\n\n    def getTypeShape(self):\n        return self.subnode_value.getTypeShape().getShapeIter()\n\n    def computeExpressionNext1(self, next_node, trace_collection):\n        value = self.subnode_value\n\n        if value.isKnownToBeIterableAtMin(1) and value.canPredictIterationValues():\n            result = wrapExpressionWithSideEffects(\n                new_node=value.getIterationValue(0),\n                old_node=value,\n                side_effects=value.getIterationValueRange(1, None),\n            )\n\n            return False, (\n                result,\n                \"new_expression\",\n                \"Predicted 'next' value from iteration.\",\n            )\n\n        # TODO: This is only relevant for a few value types, use type shape to tell if\n        # it might escape or raise.\n        self.onContentEscapes(trace_collection)\n\n        if value.mayHaveSideEffectsNext():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return True, (next_node, None, None)\n\n    def isKnownToBeIterable(self, count):\n        if count is None:\n            return True\n\n        iter_length = self.subnode_value.getIterationLength()\n        return iter_length == count\n\n    def isKnownToBeIterableAtMin(self, count):\n        assert type(count) is int\n\n        iter_length = self.subnode_value.getIterationMinLength()\n        return iter_length is not None and count <= iter_length\n\n    def getIterationLength(self):\n        return self.subnode_value.getIterationLength()\n\n    def canPredictIterationValues(self):\n        return self.subnode_value.canPredictIterationValues()\n\n    def getIterationValue(self, element_index):\n        return self.subnode_value.getIterationValue(element_index)\n\n    def getIterationHandle(self):\n        return self.subnode_value.getIterationHandle()\n\n    def extractSideEffects(self):\n        # Iterator making is the side effect itself.\n        value = self.subnode_value\n\n        if value.isCompileTimeConstant() and value.isKnownToBeIterable(None):\n            return ()\n        else:\n            return (self,)\n\n    def mayHaveSideEffects(self):\n        value = self.subnode_value\n\n        if value.isCompileTimeConstant():\n            return not value.isKnownToBeIterable(None)\n\n        return True\n\n    def mayRaiseException(self, exception_type):\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        if value.isKnownToBeIterable(None):\n            return False\n\n        return True\n\n    def mayRaiseExceptionOperation(self):\n        value = self.subnode_value\n\n        return value.isKnownToBeIterable(None) is not True\n\n    def onRelease(self, trace_collection):\n        # print \"onRelease\", self\n        pass\n\n\nclass ExpressionBuiltinIterForUnpack(ExpressionBuiltinIter1):\n    kind = \"EXPRESSION_BUILTIN_ITER_FOR_UNPACK\"\n\n    def computeExpression(self, trace_collection):\n        result = self.subnode_value.computeExpressionIter1(\n            iter_node=self, trace_collection=trace_collection\n        )\n\n        result_node = result[0]\n\n        # Rewrite exceptions to correct message.\n        if (\n            result_node.isExpressionRaiseException()\n            and result_node.subnode_exception_type.isExpressionBuiltinExceptionRef()\n            and result_node.subnode_exception_type.getExceptionName() == \"TypeError\"\n        ):\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"cannot unpack non-iterable %s object\",\n                operation=\"iter\",\n                original_node=self,\n                value_node=self.subnode_value,\n            )\n\n        return result\n\n    @staticmethod\n    def simulator(value):\n        try:\n            return iter(value)\n        except TypeError:\n            raise TypeError(\n                \"cannot unpack non-iterable %s object\" % (type(value).__name__)\n            )\n\n\nclass StatementSpecialUnpackCheckFromIterated(\n    StatementSpecialUnpackCheckFromIteratedBase\n):\n    kind = \"STATEMENT_SPECIAL_UNPACK_CHECK_FROM_ITERATED\"\n\n    named_children = (\"iterated_length\",)\n    node_attributes = (\"count\",)\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        if self.subnode_iterated_length.isCompileTimeConstant():\n            iterated_length_value = (\n                self.subnode_iterated_length.getCompileTimeConstant()\n            )\n\n            if iterated_length_value <= self.count:\n                return (\n                    None,\n                    \"new_statements\",\n                    lambda: \"Determined iteration length check to be always true, because %d <= %d.\"\n                    % (iterated_length_value, self.count),\n                )\n            else:\n                result = makeRaiseExceptionReplacementStatement(\n                    statement=self,\n                    exception_type=\"ValueError\",\n                    exception_value=(\n                        \"too many values to unpack\"\n                        if python_version < 0x300\n                        else \"too many values to unpack (expected %d)\" % self.count\n                    ),\n                )\n\n                trace_collection.onExceptionRaiseExit(TypeError)\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"\"\"\\\nDetermined iteration end check to always raise.\"\"\",\n                )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeStatementSpecialUnpackCheckFromIterated(\n    tmp_iterated_variable, count, source_ref\n):\n    return StatementSpecialUnpackCheckFromIterated(\n        iterated_length=ExpressionBuiltinLen(\n            ExpressionTempVariableRef(\n                variable=tmp_iterated_variable, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n        count=count,\n        source_ref=source_ref,\n    )\n\n\nclass StatementSpecialUnpackCheck(StatementSpecialUnpackCheckBase):\n    kind = \"STATEMENT_SPECIAL_UNPACK_CHECK\"\n\n    named_children = (\"iterator\",)\n    node_attributes = (\"count\",)\n    auto_compute_handling = \"operation\"\n\n    def getCount(self):\n        return self.count\n\n    def computeStatementOperation(self, trace_collection):\n        iterator = self.subnode_iterator\n\n        if iterator.isExpressionTempVariableRef():\n            iteration_source_node = iterator.variable_trace.getIterationSourceNode()\n\n            if iteration_source_node is not None:\n                if iteration_source_node.parent.isStatementAssignmentVariableIterator():\n                    iterator_assign_node = iteration_source_node.parent\n\n                    if iterator_assign_node.tmp_iterated_variable is not None:\n                        result = makeStatementSpecialUnpackCheckFromIterated(\n                            tmp_iterated_variable=iterator_assign_node.tmp_iterated_variable,\n                            count=self.count,\n                            source_ref=self.source_ref,\n                        )\n\n                        return trace_collection.computedStatementResult(\n                            result,\n                            change_tags=\"new_statements\",\n                            change_desc=lambda: \"Iterator check of changed to iterated size check using '%s'.\"\n                            % iterator_assign_node.tmp_iterated_variable.getName(),\n                        )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"iteration check statement\"\n\n\nclass ExpressionBuiltinIter2(ExpressionBuiltinIter2Base):\n    kind = \"EXPRESSION_BUILTIN_ITER2\"\n\n    named_children = (\"callable_arg\", \"sentinel\")\n\n    auto_compute_handling = \"final\"\n\n    # TODO: The \"callable\" be investigated in a non-final\n    # \"auto_compute_handling\" here, as maybe it is not really callable.\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: This could be more specific, this one is a fixed well known thing!\n        return tshape_iterator\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        return self, \"new_builtin\", \"Eliminated useless iterator creation.\"\n\n\nclass ExpressionAsyncIter(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_ASYNC_ITER\"\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        return value.computeExpressionAsyncIter(\n            iter_node=self, trace_collection=trace_collection\n        )\n\n    def isKnownToBeIterable(self, count):\n        if count is None:\n            return True\n\n        # TODO: Should ask value if it is.\n        return None\n\n    def getIterationLength(self):\n        return self.subnode_value.getIterationLength()\n\n    def extractSideEffects(self):\n        # Iterator making is the side effect itself.\n        if self.subnode_value.isCompileTimeConstant():\n            return ()\n        else:\n            return (self,)\n\n    def mayHaveSideEffects(self):\n        if self.subnode_value.isCompileTimeConstant():\n            return self.subnode_value.isKnownToBeIterable(None)\n\n        return True\n\n    def mayRaiseException(self, exception_type):\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        if value.isKnownToBeIterable(None):\n            return False\n\n        return True\n\n    def isKnownToBeIterableAtMin(self, count):\n        assert type(count) is int\n\n        iter_length = self.subnode_value.getIterationMinLength()\n        return iter_length is not None and iter_length < count\n\n    def onRelease(self, trace_collection):\n        # print \"onRelease\", self\n        pass\n\n\nclass ExpressionAsyncNext(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_ASYNC_NEXT\"\n\n    def __init__(self, value, source_ref):\n        ExpressionBuiltinSingleArgBase.__init__(\n            self, value=value, source_ref=source_ref\n        )\n\n    def computeExpression(self, trace_collection):\n        # TODO: Predict iteration result if possible via SSA variable trace of\n        # the iterator state.\n\n        # Assume exception is possible. TODO: We might query the next from the\n        # source with a computeExpressionAsyncNext slot, but we delay that.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinLenNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in iterator nodes.\n\nThese play a role in for loops, and in unpacking. They can something be\npredicted to succeed or fail, in which case, code can become less complex.\n\nThe length of things is an important optimization issue for these to be\ngood.\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ExpressionBases import ExpressionBuiltinSingleArgBase\nfrom .ExpressionShapeMixins import ExpressionIntOrLongExactMixin\n\n\nclass ExpressionBuiltinLen(\n    ExpressionIntOrLongExactMixin, ExpressionBuiltinSingleArgBase\n):\n    kind = \"EXPRESSION_BUILTIN_LEN\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_len_spec\n\n    def getIntegerValue(self):\n        value = self.subnode_value\n\n        if value.hasShapeSlotLen():\n            return value.getIterationLength()\n        else:\n            return None\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionLen(\n            len_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        return not value.getTypeShape().hasShapeSlotLen()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinNextNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for the calls to the 'next' built-in and unpacking special next.\n\n    The unpacking next has only special that it raises a different exception\n    text, explaining things about its context.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildrenHavingIteratorDefaultMixin\nfrom .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase\n\n\nclass ExpressionBuiltinNext1(ExpressionBuiltinSingleArgBase):\n    __slots__ = (\"may_raise\",)\n\n    kind = \"EXPRESSION_BUILTIN_NEXT1\"\n\n    def __init__(self, value, source_ref):\n        ExpressionBuiltinSingleArgBase.__init__(\n            self, value=value, source_ref=source_ref\n        )\n\n        self.may_raise = True\n\n    def computeExpression(self, trace_collection):\n        self.may_raise, result = self.subnode_value.computeExpressionNext1(\n            next_node=self, trace_collection=trace_collection\n        )\n\n        return result\n\n    def mayRaiseExceptionOperation(self):\n        return self.may_raise\n\n    def mayRaiseException(self, exception_type):\n        return self.may_raise or self.subnode_value.mayRaiseException(exception_type)\n\n\nclass ExpressionSpecialUnpack(ExpressionBuiltinNext1):\n    __slots__ = (\"count\", \"expected\", \"starred\")\n\n    kind = \"EXPRESSION_SPECIAL_UNPACK\"\n\n    def __init__(self, value, count, expected, starred, source_ref):\n        ExpressionBuiltinNext1.__init__(self, value=value, source_ref=source_ref)\n\n        self.count = int(count)\n\n        # TODO: Unused before 3.5 or higher, and even then starred is rare, maybe specialize for it.\n        self.expected = int(expected)\n        self.starred = starred\n\n    def getDetails(self):\n        result = ExpressionBuiltinNext1.getDetails(self)\n        result[\"count\"] = self.getCount()\n        result[\"expected\"] = self.getExpected()\n        result[\"starred\"] = self.getStarred()\n        return result\n\n    def getCount(self):\n        return self.count\n\n    def getExpected(self):\n        return self.expected\n\n    def getStarred(self):\n        return self.starred\n\n\nclass ExpressionBuiltinNext2(ChildrenHavingIteratorDefaultMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_NEXT2\"\n\n    named_children = (\"iterator\", \"default\")\n\n    def __init__(self, iterator, default, source_ref):\n        ChildrenHavingIteratorDefaultMixin.__init__(\n            self,\n            iterator=iterator,\n            default=default,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: The \"iterator\" should be investigated here, if it is iterable,\n        # or if the default is raising.\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinOpenNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node the calls to the 'open' built-in.\n\nThis is a rather two sided beast, as it may be read or write. And we would like to be able\nto track it, so we can include files into the executable, or write more efficiently.\n\"\"\"\n\nfrom .ChildrenHavingMixins import (\n    ChildrenExpressionBuiltinOpenP2Mixin,\n    ChildrenExpressionBuiltinOpenP3Mixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .shapes.BuiltinTypeShapes import tshape_file\n\n\nclass ExpressionBuiltinOpenMixin(object):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_file\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Note: Quite impossible to predict without further assumptions, but we could look\n        # at the arguments at least.\n        return self, None, None\n\n\nclass ExpressionBuiltinOpenP2(\n    ExpressionBuiltinOpenMixin,\n    ChildrenExpressionBuiltinOpenP2Mixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_OPEN_P2\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"filename\", \"mode|optional\", \"buffering|optional\")\n\n    def __init__(self, filename, mode, buffering, source_ref):\n        ChildrenExpressionBuiltinOpenP2Mixin.__init__(\n            self,\n            filename=filename,\n            mode=mode,\n            buffering=buffering,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionBuiltinOpenP3(\n    ExpressionBuiltinOpenMixin,\n    ChildrenExpressionBuiltinOpenP3Mixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_OPEN_P3\"\n\n    python_version_spec = \">= 0x300\"\n\n    named_children = (\n        \"filename\",\n        \"mode|optional\",\n        \"buffering|optional\",\n        \"encoding|optional\",\n        \"errors|optional\",\n        \"newline|optional\",\n        \"closefd|optional\",\n        \"opener|optional\",\n    )\n\n    def __init__(\n        self,\n        filename,\n        mode,\n        buffering,\n        encoding,\n        errors,\n        newline,\n        closefd,\n        opener,\n        source_ref,\n    ):\n        ChildrenExpressionBuiltinOpenP3Mixin.__init__(\n            self,\n            filename=filename,\n            mode=mode,\n            buffering=buffering,\n            encoding=encoding,\n            errors=errors,\n            newline=newline,\n            closefd=closefd,\n            opener=opener,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\ndef makeExpressionBuiltinsOpenCall(\n    filename,\n    mode,\n    buffering,\n    encoding,\n    errors,\n    newline,\n    closefd,\n    opener,\n    source_ref,\n):\n    \"\"\"Function reference ctypes.CDLL\"\"\"\n\n    assert str is not bytes\n    return ExpressionBuiltinOpenP3(\n        filename=filename,\n        mode=mode,\n        buffering=buffering,\n        encoding=encoding,\n        errors=errors,\n        newline=newline,\n        closefd=closefd,\n        opener=opener,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinOperationNodeBasesGenerated.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Specialized attribute nodes\n\nWARNING, this code is GENERATED. Modify the template BuiltinOperationNodeBases.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\n\n\nfrom abc import abstractmethod\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingBytesArgMixin,\n    ChildHavingDictArgMixin,\n    ChildHavingIterableMixin,\n    ChildHavingStrArgMixin,\n    ChildrenHavingBytesArgCharsMixin,\n    ChildrenHavingBytesArgEncodingErrorsMixin,\n    ChildrenHavingBytesArgEncodingMixin,\n    ChildrenHavingBytesArgIterableMixin,\n    ChildrenHavingBytesArgKeependsMixin,\n    ChildrenHavingBytesArgOldNewCountMixin,\n    ChildrenHavingBytesArgOldNewMixin,\n    ChildrenHavingBytesArgPrefixMixin,\n    ChildrenHavingBytesArgPrefixStartEndMixin,\n    ChildrenHavingBytesArgPrefixStartMixin,\n    ChildrenHavingBytesArgSepMaxsplitMixin,\n    ChildrenHavingBytesArgSepMixin,\n    ChildrenHavingBytesArgSubMixin,\n    ChildrenHavingBytesArgSubStartEndMixin,\n    ChildrenHavingBytesArgSubStartMixin,\n    ChildrenHavingBytesArgSuffixMixin,\n    ChildrenHavingBytesArgSuffixStartEndMixin,\n    ChildrenHavingBytesArgSuffixStartMixin,\n    ChildrenHavingBytesArgTableDeleteMixin,\n    ChildrenHavingBytesArgTableMixin,\n    ChildrenHavingBytesArgTabsizeMixin,\n    ChildrenHavingBytesArgWidthFillcharMixin,\n    ChildrenHavingBytesArgWidthMixin,\n    ChildrenHavingDictArgIterableMixin,\n    ChildrenHavingDictArgIterablePairsTupleMixin,\n    ChildrenHavingDictArgKeyDefaultMixin,\n    ChildrenHavingDictArgKeyMixin,\n    ChildrenHavingIterableValueMixin,\n    ChildrenHavingStrArgArgsTuplePairsTupleMixin,\n    ChildrenHavingStrArgCharsMixin,\n    ChildrenHavingStrArgEncodingErrorsMixin,\n    ChildrenHavingStrArgEncodingMixin,\n    ChildrenHavingStrArgIterableMixin,\n    ChildrenHavingStrArgKeependsMixin,\n    ChildrenHavingStrArgOldNewCountMixin,\n    ChildrenHavingStrArgOldNewMixin,\n    ChildrenHavingStrArgPrefixMixin,\n    ChildrenHavingStrArgPrefixStartEndMixin,\n    ChildrenHavingStrArgPrefixStartMixin,\n    ChildrenHavingStrArgSepMaxsplitMixin,\n    ChildrenHavingStrArgSepMixin,\n    ChildrenHavingStrArgSubMixin,\n    ChildrenHavingStrArgSubStartEndMixin,\n    ChildrenHavingStrArgSubStartMixin,\n    ChildrenHavingStrArgSuffixMixin,\n    ChildrenHavingStrArgSuffixStartEndMixin,\n    ChildrenHavingStrArgSuffixStartMixin,\n    ChildrenHavingStrArgTableMixin,\n    ChildrenHavingStrArgTabsizeMixin,\n    ChildrenHavingStrArgWidthFillcharMixin,\n    ChildrenHavingStrArgWidthMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionBytesShapeExactMixin,\n    ExpressionDictShapeExactMixin,\n    ExpressionIntShapeExactMixin,\n    ExpressionListShapeExactMixin,\n    ExpressionNoneShapeExactMixin,\n    ExpressionStrShapeExactMixin,\n    ExpressionTupleShapeExactMixin,\n)\n\n\nclass ExpressionStrOperationCapitalizeBase(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.capitalize(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.capitalize' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCapitalizeBase(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.capitalize(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.capitalize' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationCasefoldBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.casefold(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.casefold' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationCenter3Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthFillcharMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, str_arg, width, fillchar, source_ref):\n        ChildrenHavingStrArgWidthFillcharMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.center(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.center' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationCenter2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n    )\n\n    def __init__(self, str_arg, width, source_ref):\n        ChildrenHavingStrArgWidthMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.center(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.center' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCenter3Base(\n    ExpressionBytesShapeExactMixin,\n    ChildrenHavingBytesArgWidthFillcharMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, bytes_arg, width, fillchar, source_ref):\n        ChildrenHavingBytesArgWidthFillcharMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.center(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.center' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCenter2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n    )\n\n    def __init__(self, bytes_arg, width, source_ref):\n        ChildrenHavingBytesArgWidthMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.center(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.center' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationClearBase(\n    ExpressionNoneShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationCopyBase(\n    ExpressionDictShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationCount4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, sub, start, end, source_ref):\n        ChildrenHavingStrArgSubStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.count(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.count' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationCount3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, sub, start, source_ref):\n        ChildrenHavingStrArgSubStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.count(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.count' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationCount2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, str_arg, sub, source_ref):\n        ChildrenHavingStrArgSubMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.count(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.count' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCount4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, end, source_ref):\n        ChildrenHavingBytesArgSubStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.count(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.count' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCount3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, source_ref):\n        ChildrenHavingBytesArgSubStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.count(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.count' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationCount2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, bytes_arg, sub, source_ref):\n        ChildrenHavingBytesArgSubMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.count(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.count' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationDecode3Base(\n    ChildrenHavingStrArgEncodingErrorsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"encoding\",\n        \"errors\",\n    )\n\n    def __init__(self, str_arg, encoding, errors, source_ref):\n        ChildrenHavingStrArgEncodingErrorsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n            and self.subnode_errors.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.decode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                    self.subnode_errors.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.decode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.subnode_errors.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationDecode2Base(\n    ChildrenHavingStrArgEncodingMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"encoding\",\n    )\n\n    def __init__(self, str_arg, encoding, source_ref):\n        ChildrenHavingStrArgEncodingMixin.__init__(\n            self,\n            str_arg=str_arg,\n            encoding=encoding,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.decode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.decode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationDecode1Base(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.decode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.decode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationDecode3Base(\n    ExpressionStrShapeExactMixin,\n    ChildrenHavingBytesArgEncodingErrorsMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"encoding\",\n        \"errors\",\n    )\n\n    def __init__(self, bytes_arg, encoding, errors, source_ref):\n        ChildrenHavingBytesArgEncodingErrorsMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n            and self.subnode_errors.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.decode(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                    self.subnode_errors.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.decode' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.subnode_errors.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationDecode2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingBytesArgEncodingMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"encoding\",\n    )\n\n    def __init__(self, bytes_arg, encoding, source_ref):\n        ChildrenHavingBytesArgEncodingMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            encoding=encoding,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.decode(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.decode' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationDecode1Base(\n    ExpressionStrShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.decode(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.decode' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEncode3Base(\n    ChildrenHavingStrArgEncodingErrorsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"encoding\",\n        \"errors\",\n    )\n\n    def __init__(self, str_arg, encoding, errors, source_ref):\n        ChildrenHavingStrArgEncodingErrorsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n            and self.subnode_errors.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.encode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                    self.subnode_errors.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.encode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.subnode_errors.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEncode2Base(\n    ChildrenHavingStrArgEncodingMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"encoding\",\n    )\n\n    def __init__(self, str_arg, encoding, source_ref):\n        ChildrenHavingStrArgEncodingMixin.__init__(\n            self,\n            str_arg=str_arg,\n            encoding=encoding,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_encoding.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.encode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_encoding.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.encode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_encoding.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEncode1Base(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.encode(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.encode' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEndswith4Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingStrArgSuffixStartEndMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"str_arg\",\n        \"suffix\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, suffix, start, end, source_ref):\n        ChildrenHavingStrArgSuffixStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            suffix=suffix,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.endswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.endswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEndswith3Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingStrArgSuffixStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"suffix\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, suffix, start, source_ref):\n        ChildrenHavingStrArgSuffixStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            suffix=suffix,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.endswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.endswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationEndswith2Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingStrArgSuffixMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"suffix\",\n    )\n\n    def __init__(self, str_arg, suffix, source_ref):\n        ChildrenHavingStrArgSuffixMixin.__init__(\n            self,\n            str_arg=str_arg,\n            suffix=suffix,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.endswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.endswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationEndswith4Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingBytesArgSuffixStartEndMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"suffix\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, suffix, start, end, source_ref):\n        ChildrenHavingBytesArgSuffixStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            suffix=suffix,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.endswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.endswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationEndswith3Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingBytesArgSuffixStartMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"suffix\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, suffix, start, source_ref):\n        ChildrenHavingBytesArgSuffixStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            suffix=suffix,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.endswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.endswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationEndswith2Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingBytesArgSuffixMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"suffix\",\n    )\n\n    def __init__(self, bytes_arg, suffix, source_ref):\n        ChildrenHavingBytesArgSuffixMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            suffix=suffix,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_suffix.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.endswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_suffix.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.endswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_suffix.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationExpandtabs2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgTabsizeMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"tabsize\",\n    )\n\n    def __init__(self, str_arg, tabsize, source_ref):\n        ChildrenHavingStrArgTabsizeMixin.__init__(\n            self,\n            str_arg=str_arg,\n            tabsize=tabsize,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_tabsize.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.expandtabs(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_tabsize.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.expandtabs' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_tabsize.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationExpandtabs1Base(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.expandtabs(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.expandtabs' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationExpandtabs2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgTabsizeMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"tabsize\",\n    )\n\n    def __init__(self, bytes_arg, tabsize, source_ref):\n        ChildrenHavingBytesArgTabsizeMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            tabsize=tabsize,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_tabsize.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.expandtabs(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_tabsize.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.expandtabs' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_tabsize.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationExpandtabs1Base(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.expandtabs(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.expandtabs' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationFind4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, sub, start, end, source_ref):\n        ChildrenHavingStrArgSubStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.find(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.find' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationFind3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, sub, start, source_ref):\n        ChildrenHavingStrArgSubStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.find(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.find' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationFind2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, str_arg, sub, source_ref):\n        ChildrenHavingStrArgSubMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.find(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.find' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationFind4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, end, source_ref):\n        ChildrenHavingBytesArgSubStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.find(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.find' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationFind3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, source_ref):\n        ChildrenHavingBytesArgSubStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.find(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.find' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationFind2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, bytes_arg, sub, source_ref):\n        ChildrenHavingBytesArgSubMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.find(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.find' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationFormatBase(\n    ExpressionStrShapeExactMixin,\n    ChildrenHavingStrArgArgsTuplePairsTupleMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"str_arg\",\n        \"args|tuple\",\n        \"pairs|tuple\",\n    )\n\n    def __init__(self, str_arg, args, pairs, source_ref):\n        ChildrenHavingStrArgArgsTuplePairsTupleMixin.__init__(\n            self,\n            str_arg=str_arg,\n            args=args,\n            pairs=pairs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_args.isCompileTimeConstant()\n            and self.subnode_pairs.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.format(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_args.getCompileTimeConstant(),\n                    self.subnode_pairs.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.format' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_args.mayRaiseException(exception_type)\n            or self.subnode_pairs.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationFormatmapBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.format_map(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.format_map' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationFromkeys3Base(\n    ExpressionDictShapeExactMixin, ChildrenHavingIterableValueMixin, ExpressionBase\n):\n    named_children = (\n        \"iterable\",\n        \"value\",\n    )\n\n    def __init__(self, iterable, value, source_ref):\n        ChildrenHavingIterableValueMixin.__init__(\n            self,\n            iterable=iterable,\n            value=value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationFromkeys2Base(\n    ExpressionDictShapeExactMixin, ChildHavingIterableMixin, ExpressionBase\n):\n    named_children = (\"iterable\",)\n\n    def __init__(self, iterable, source_ref):\n        ChildHavingIterableMixin.__init__(\n            self,\n            iterable=iterable,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationGet3Base(\n    ChildrenHavingDictArgKeyDefaultMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n        \"default\",\n    )\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ChildrenHavingDictArgKeyDefaultMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            default=default,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationGet2Base(ChildrenHavingDictArgKeyMixin, ExpressionBase):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n    )\n\n    def __init__(self, dict_arg, key, source_ref):\n        ChildrenHavingDictArgKeyMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationHaskeyBase(\n    ExpressionBoolShapeExactMixin, ChildrenHavingDictArgKeyMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n    )\n\n    def __init__(self, dict_arg, key, source_ref):\n        ChildrenHavingDictArgKeyMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationIndex4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, sub, start, end, source_ref):\n        ChildrenHavingStrArgSubStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.index(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.index' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIndex3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, sub, start, source_ref):\n        ChildrenHavingStrArgSubStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.index(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.index' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIndex2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, str_arg, sub, source_ref):\n        ChildrenHavingStrArgSubMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.index(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.index' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIndex4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, end, source_ref):\n        ChildrenHavingBytesArgSubStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.index(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.index' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIndex3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, source_ref):\n        ChildrenHavingBytesArgSubStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.index(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.index' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIndex2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, bytes_arg, sub, source_ref):\n        ChildrenHavingBytesArgSubMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.index(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.index' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsalnumBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isalnum(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isalnum' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIsalnumBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.isalnum(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.isalnum' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsalphaBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isalpha(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isalpha' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIsalphaBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.isalpha(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.isalpha' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsasciiBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isascii(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isascii' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsdecimalBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isdecimal(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isdecimal' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsdigitBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isdigit(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isdigit' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIsdigitBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.isdigit(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.isdigit' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsidentifierBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isidentifier(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isidentifier' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIslowerBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.islower(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.islower' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIslowerBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.islower(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.islower' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsnumericBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isnumeric(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isnumeric' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsprintableBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isprintable(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isprintable' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsspaceBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isspace(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isspace' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIsspaceBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.isspace(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.isspace' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIstitleBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.istitle(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.istitle' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIstitleBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.istitle(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.istitle' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationIsupperBase(\n    ExpressionBoolShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.isupper(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.isupper' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationIsupperBase(\n    ExpressionBoolShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.isupper(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.isupper' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationItemsBase(\n    ExpressionListShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationIteritemsBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationIterkeysBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationItervaluesBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationJoinBase(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgIterableMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"iterable\",\n    )\n\n    def __init__(self, str_arg, iterable, source_ref):\n        ChildrenHavingStrArgIterableMixin.__init__(\n            self,\n            str_arg=str_arg,\n            iterable=iterable,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_iterable.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.join(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_iterable.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.join' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_iterable.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationJoinBase(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgIterableMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"iterable\",\n    )\n\n    def __init__(self, bytes_arg, iterable, source_ref):\n        ChildrenHavingBytesArgIterableMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            iterable=iterable,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_iterable.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.join(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_iterable.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.join' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_iterable.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationKeysBase(\n    ExpressionListShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationLjust3Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthFillcharMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, str_arg, width, fillchar, source_ref):\n        ChildrenHavingStrArgWidthFillcharMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.ljust(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.ljust' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationLjust2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n    )\n\n    def __init__(self, str_arg, width, source_ref):\n        ChildrenHavingStrArgWidthMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.ljust(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.ljust' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationLjust3Base(\n    ExpressionBytesShapeExactMixin,\n    ChildrenHavingBytesArgWidthFillcharMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, bytes_arg, width, fillchar, source_ref):\n        ChildrenHavingBytesArgWidthFillcharMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.ljust(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.ljust' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationLjust2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n    )\n\n    def __init__(self, bytes_arg, width, source_ref):\n        ChildrenHavingBytesArgWidthMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.ljust(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.ljust' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationLowerBase(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.lower(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.lower' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationLowerBase(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.lower(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.lower' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationLstrip2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, str_arg, chars, source_ref):\n        ChildrenHavingStrArgCharsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.lstrip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.lstrip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationLstrip1Base(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.lstrip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.lstrip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationLstrip2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, bytes_arg, chars, source_ref):\n        ChildrenHavingBytesArgCharsMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.lstrip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.lstrip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationLstrip1Base(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.lstrip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.lstrip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationMaketransBase(ChildHavingStrArgMixin, ExpressionBase):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.maketrans(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.maketrans' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationPartitionBase(\n    ExpressionTupleShapeExactMixin, ChildrenHavingStrArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, str_arg, sep, source_ref):\n        ChildrenHavingStrArgSepMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.partition(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.partition' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationPartitionBase(\n    ExpressionTupleShapeExactMixin, ChildrenHavingBytesArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, bytes_arg, sep, source_ref):\n        ChildrenHavingBytesArgSepMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.partition(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.partition' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationPop3Base(\n    ChildrenHavingDictArgKeyDefaultMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n        \"default\",\n    )\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ChildrenHavingDictArgKeyDefaultMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            default=default,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationPop2Base(ChildrenHavingDictArgKeyMixin, ExpressionBase):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n    )\n\n    def __init__(self, dict_arg, key, source_ref):\n        ChildrenHavingDictArgKeyMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationPopitemBase(\n    ExpressionTupleShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationReplace4Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgOldNewCountMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"old\",\n        \"new\",\n        \"count\",\n    )\n\n    def __init__(self, str_arg, old, new, count, source_ref):\n        ChildrenHavingStrArgOldNewCountMixin.__init__(\n            self,\n            str_arg=str_arg,\n            old=old,\n            new=new,\n            count=count,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_old.isCompileTimeConstant()\n            and self.subnode_new.isCompileTimeConstant()\n            and self.subnode_count.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.replace(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_old.getCompileTimeConstant(),\n                    self.subnode_new.getCompileTimeConstant(),\n                    self.subnode_count.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.replace' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_old.mayRaiseException(exception_type)\n            or self.subnode_new.mayRaiseException(exception_type)\n            or self.subnode_count.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationReplace3Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgOldNewMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"old\",\n        \"new\",\n    )\n\n    def __init__(self, str_arg, old, new, source_ref):\n        ChildrenHavingStrArgOldNewMixin.__init__(\n            self,\n            str_arg=str_arg,\n            old=old,\n            new=new,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_old.isCompileTimeConstant()\n            and self.subnode_new.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.replace(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_old.getCompileTimeConstant(),\n                    self.subnode_new.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.replace' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_old.mayRaiseException(exception_type)\n            or self.subnode_new.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationReplace4Base(\n    ExpressionBytesShapeExactMixin,\n    ChildrenHavingBytesArgOldNewCountMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"old\",\n        \"new\",\n        \"count\",\n    )\n\n    def __init__(self, bytes_arg, old, new, count, source_ref):\n        ChildrenHavingBytesArgOldNewCountMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            old=old,\n            new=new,\n            count=count,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_old.isCompileTimeConstant()\n            and self.subnode_new.isCompileTimeConstant()\n            and self.subnode_count.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.replace(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_old.getCompileTimeConstant(),\n                    self.subnode_new.getCompileTimeConstant(),\n                    self.subnode_count.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.replace' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_old.mayRaiseException(exception_type)\n            or self.subnode_new.mayRaiseException(exception_type)\n            or self.subnode_count.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationReplace3Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgOldNewMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"old\",\n        \"new\",\n    )\n\n    def __init__(self, bytes_arg, old, new, source_ref):\n        ChildrenHavingBytesArgOldNewMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            old=old,\n            new=new,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_old.isCompileTimeConstant()\n            and self.subnode_new.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.replace(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_old.getCompileTimeConstant(),\n                    self.subnode_new.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.replace' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_old.mayRaiseException(exception_type)\n            or self.subnode_new.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRfind4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, sub, start, end, source_ref):\n        ChildrenHavingStrArgSubStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rfind(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rfind' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRfind3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, sub, start, source_ref):\n        ChildrenHavingStrArgSubStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rfind(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rfind' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRfind2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, str_arg, sub, source_ref):\n        ChildrenHavingStrArgSubMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rfind(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rfind' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRfind4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, end, source_ref):\n        ChildrenHavingBytesArgSubStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rfind(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rfind' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRfind3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, source_ref):\n        ChildrenHavingBytesArgSubStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rfind(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rfind' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRfind2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, bytes_arg, sub, source_ref):\n        ChildrenHavingBytesArgSubMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rfind(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rfind' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRindex4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, sub, start, end, source_ref):\n        ChildrenHavingStrArgSubStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rindex(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rindex' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRindex3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, sub, start, source_ref):\n        ChildrenHavingStrArgSubStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rindex(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rindex' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRindex2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingStrArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, str_arg, sub, source_ref):\n        ChildrenHavingStrArgSubMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rindex(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rindex' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRindex4Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartEndMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, end, source_ref):\n        ChildrenHavingBytesArgSubStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rindex(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rindex' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRindex3Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubStartMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, sub, start, source_ref):\n        ChildrenHavingBytesArgSubStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rindex(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rindex' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRindex2Base(\n    ExpressionIntShapeExactMixin, ChildrenHavingBytesArgSubMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sub\",\n    )\n\n    def __init__(self, bytes_arg, sub, source_ref):\n        ChildrenHavingBytesArgSubMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sub=sub,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sub.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rindex(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sub.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rindex' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sub.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRjust3Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthFillcharMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, str_arg, width, fillchar, source_ref):\n        ChildrenHavingStrArgWidthFillcharMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rjust(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rjust' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRjust2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n    )\n\n    def __init__(self, str_arg, width, source_ref):\n        ChildrenHavingStrArgWidthMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rjust(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rjust' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRjust3Base(\n    ExpressionBytesShapeExactMixin,\n    ChildrenHavingBytesArgWidthFillcharMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n        \"fillchar\",\n    )\n\n    def __init__(self, bytes_arg, width, fillchar, source_ref):\n        ChildrenHavingBytesArgWidthFillcharMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n            fillchar=fillchar,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n            and self.subnode_fillchar.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rjust(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                    self.subnode_fillchar.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rjust' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.subnode_fillchar.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRjust2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n    )\n\n    def __init__(self, bytes_arg, width, source_ref):\n        ChildrenHavingBytesArgWidthMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rjust(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rjust' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRpartitionBase(\n    ExpressionTupleShapeExactMixin, ChildrenHavingStrArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, str_arg, sep, source_ref):\n        ChildrenHavingStrArgSepMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rpartition(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rpartition' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRpartitionBase(\n    ExpressionTupleShapeExactMixin, ChildrenHavingBytesArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, bytes_arg, sep, source_ref):\n        ChildrenHavingBytesArgSepMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rpartition(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rpartition' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRsplit3Base(\n    ExpressionListShapeExactMixin, ChildrenHavingStrArgSepMaxsplitMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n        \"maxsplit\",\n    )\n\n    def __init__(self, str_arg, sep, maxsplit, source_ref):\n        ChildrenHavingStrArgSepMaxsplitMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n            maxsplit=maxsplit,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n            and self.subnode_maxsplit.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rsplit(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                    self.subnode_maxsplit.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rsplit' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.subnode_maxsplit.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRsplit2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingStrArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, str_arg, sep, source_ref):\n        ChildrenHavingStrArgSepMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rsplit(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rsplit' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRsplit1Base(\n    ExpressionListShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rsplit(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rsplit' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRsplit3Base(\n    ExpressionListShapeExactMixin,\n    ChildrenHavingBytesArgSepMaxsplitMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n        \"maxsplit\",\n    )\n\n    def __init__(self, bytes_arg, sep, maxsplit, source_ref):\n        ChildrenHavingBytesArgSepMaxsplitMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n            maxsplit=maxsplit,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n            and self.subnode_maxsplit.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rsplit(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                    self.subnode_maxsplit.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rsplit' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.subnode_maxsplit.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRsplit2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingBytesArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, bytes_arg, sep, source_ref):\n        ChildrenHavingBytesArgSepMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rsplit(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rsplit' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRsplit1Base(\n    ExpressionListShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rsplit(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rsplit' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRstrip2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, str_arg, chars, source_ref):\n        ChildrenHavingStrArgCharsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rstrip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rstrip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationRstrip1Base(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.rstrip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.rstrip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRstrip2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, bytes_arg, chars, source_ref):\n        ChildrenHavingBytesArgCharsMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rstrip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rstrip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationRstrip1Base(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.rstrip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.rstrip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationSetdefault3Base(\n    ChildrenHavingDictArgKeyDefaultMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n        \"default\",\n    )\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ChildrenHavingDictArgKeyDefaultMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            default=default,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationSetdefault2Base(\n    ChildrenHavingDictArgKeyMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"key\",\n    )\n\n    def __init__(self, dict_arg, key, source_ref):\n        ChildrenHavingDictArgKeyMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationSplit3Base(\n    ExpressionListShapeExactMixin, ChildrenHavingStrArgSepMaxsplitMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n        \"maxsplit\",\n    )\n\n    def __init__(self, str_arg, sep, maxsplit, source_ref):\n        ChildrenHavingStrArgSepMaxsplitMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n            maxsplit=maxsplit,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n            and self.subnode_maxsplit.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.split(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                    self.subnode_maxsplit.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.split' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.subnode_maxsplit.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationSplit2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingStrArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, str_arg, sep, source_ref):\n        ChildrenHavingStrArgSepMixin.__init__(\n            self,\n            str_arg=str_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.split(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.split' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationSplit1Base(\n    ExpressionListShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.split(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.split' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSplit3Base(\n    ExpressionListShapeExactMixin,\n    ChildrenHavingBytesArgSepMaxsplitMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n        \"maxsplit\",\n    )\n\n    def __init__(self, bytes_arg, sep, maxsplit, source_ref):\n        ChildrenHavingBytesArgSepMaxsplitMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n            maxsplit=maxsplit,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n            and self.subnode_maxsplit.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.split(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                    self.subnode_maxsplit.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.split' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.subnode_maxsplit.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSplit2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingBytesArgSepMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"sep\",\n    )\n\n    def __init__(self, bytes_arg, sep, source_ref):\n        ChildrenHavingBytesArgSepMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            sep=sep,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_sep.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.split(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_sep.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.split' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_sep.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSplit1Base(\n    ExpressionListShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.split(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.split' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationSplitlines2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingStrArgKeependsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"keepends\",\n    )\n\n    def __init__(self, str_arg, keepends, source_ref):\n        ChildrenHavingStrArgKeependsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            keepends=keepends,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_keepends.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.splitlines(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_keepends.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.splitlines' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_keepends.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationSplitlines1Base(\n    ExpressionListShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.splitlines(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.splitlines' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSplitlines2Base(\n    ExpressionListShapeExactMixin, ChildrenHavingBytesArgKeependsMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"keepends\",\n    )\n\n    def __init__(self, bytes_arg, keepends, source_ref):\n        ChildrenHavingBytesArgKeependsMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            keepends=keepends,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_keepends.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.splitlines(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_keepends.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.splitlines' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_keepends.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSplitlines1Base(\n    ExpressionListShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.splitlines(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.splitlines' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationStartswith4Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingStrArgPrefixStartEndMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"str_arg\",\n        \"prefix\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, str_arg, prefix, start, end, source_ref):\n        ChildrenHavingStrArgPrefixStartEndMixin.__init__(\n            self,\n            str_arg=str_arg,\n            prefix=prefix,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.startswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.startswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationStartswith3Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingStrArgPrefixStartMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"prefix\",\n        \"start\",\n    )\n\n    def __init__(self, str_arg, prefix, start, source_ref):\n        ChildrenHavingStrArgPrefixStartMixin.__init__(\n            self,\n            str_arg=str_arg,\n            prefix=prefix,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.startswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.startswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationStartswith2Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingStrArgPrefixMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"prefix\",\n    )\n\n    def __init__(self, str_arg, prefix, source_ref):\n        ChildrenHavingStrArgPrefixMixin.__init__(\n            self,\n            str_arg=str_arg,\n            prefix=prefix,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.startswith(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.startswith' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationStartswith4Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingBytesArgPrefixStartEndMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"prefix\",\n        \"start\",\n        \"end\",\n    )\n\n    def __init__(self, bytes_arg, prefix, start, end, source_ref):\n        ChildrenHavingBytesArgPrefixStartEndMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            prefix=prefix,\n            start=start,\n            end=end,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n            and self.subnode_end.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.startswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                    self.subnode_end.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.startswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_end.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationStartswith3Base(\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingBytesArgPrefixStartMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"prefix\",\n        \"start\",\n    )\n\n    def __init__(self, bytes_arg, prefix, start, source_ref):\n        ChildrenHavingBytesArgPrefixStartMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            prefix=prefix,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n            and self.subnode_start.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.startswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                    self.subnode_start.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.startswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.subnode_start.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationStartswith2Base(\n    ExpressionBoolShapeExactMixin, ChildrenHavingBytesArgPrefixMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"prefix\",\n    )\n\n    def __init__(self, bytes_arg, prefix, source_ref):\n        ChildrenHavingBytesArgPrefixMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            prefix=prefix,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_prefix.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.startswith(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_prefix.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.startswith' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_prefix.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationStrip2Base(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, str_arg, chars, source_ref):\n        ChildrenHavingStrArgCharsMixin.__init__(\n            self,\n            str_arg=str_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.strip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.strip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationStrip1Base(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.strip(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.strip' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationStrip2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgCharsMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"chars\",\n    )\n\n    def __init__(self, bytes_arg, chars, source_ref):\n        ChildrenHavingBytesArgCharsMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            chars=chars,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_chars.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.strip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_chars.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.strip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_chars.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationStrip1Base(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.strip(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.strip' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationSwapcaseBase(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.swapcase(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.swapcase' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationSwapcaseBase(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.swapcase(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.swapcase' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationTitleBase(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.title(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.title' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationTitleBase(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.title(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.title' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionStrOperationTranslateBase(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgTableMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"table\",\n    )\n\n    def __init__(self, str_arg, table, source_ref):\n        ChildrenHavingStrArgTableMixin.__init__(\n            self,\n            str_arg=str_arg,\n            table=table,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_table.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.translate(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_table.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.translate' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_table.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationTranslate3Base(\n    ExpressionBytesShapeExactMixin,\n    ChildrenHavingBytesArgTableDeleteMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"bytes_arg\",\n        \"table\",\n        \"delete\",\n    )\n\n    def __init__(self, bytes_arg, table, delete, source_ref):\n        ChildrenHavingBytesArgTableDeleteMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            table=table,\n            delete=delete,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_table.isCompileTimeConstant()\n            and self.subnode_delete.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.translate(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_table.getCompileTimeConstant(),\n                    self.subnode_delete.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.translate' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_table.mayRaiseException(exception_type)\n            or self.subnode_delete.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationTranslate2Base(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgTableMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"table\",\n    )\n\n    def __init__(self, bytes_arg, table, source_ref):\n        ChildrenHavingBytesArgTableMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            table=table,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_table.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.translate(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_table.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.translate' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_table.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationUpdate3Base(\n    ExpressionNoneShapeExactMixin,\n    ChildrenHavingDictArgIterablePairsTupleMixin,\n    ExpressionBase,\n):\n    named_children = (\n        \"dict_arg\",\n        \"iterable\",\n        \"pairs|tuple\",\n    )\n\n    def __init__(self, dict_arg, iterable, pairs, source_ref):\n        ChildrenHavingDictArgIterablePairsTupleMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            iterable=iterable,\n            pairs=pairs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationUpdate2Base(\n    ExpressionNoneShapeExactMixin, ChildrenHavingDictArgIterableMixin, ExpressionBase\n):\n    named_children = (\n        \"dict_arg\",\n        \"iterable\",\n    )\n\n    def __init__(self, dict_arg, iterable, source_ref):\n        ChildrenHavingDictArgIterableMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            iterable=iterable,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationUpperBase(\n    ExpressionStrShapeExactMixin, ChildHavingStrArgMixin, ExpressionBase\n):\n    named_children = (\"str_arg\",)\n\n    def __init__(self, str_arg, source_ref):\n        ChildHavingStrArgMixin.__init__(\n            self,\n            str_arg=str_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_str_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.upper(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.upper' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationUpperBase(\n    ExpressionBytesShapeExactMixin, ChildHavingBytesArgMixin, ExpressionBase\n):\n    named_children = (\"bytes_arg\",)\n\n    def __init__(self, bytes_arg, source_ref):\n        ChildHavingBytesArgMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bytes_arg.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.upper(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.upper' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionDictOperationValuesBase(\n    ExpressionListShapeExactMixin, ChildHavingDictArgMixin, ExpressionBase\n):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationViewitemsBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationViewkeysBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionDictOperationViewvaluesBase(ChildHavingDictArgMixin, ExpressionBase):\n    named_children = (\"dict_arg\",)\n\n    def __init__(self, dict_arg, source_ref):\n        ChildHavingDictArgMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionStrOperationZfillBase(\n    ExpressionStrShapeExactMixin, ChildrenHavingStrArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"str_arg\",\n        \"width\",\n    )\n\n    def __init__(self, str_arg, width, source_ref):\n        ChildrenHavingStrArgWidthMixin.__init__(\n            self,\n            str_arg=str_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_str_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.zfill(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'str.zfill' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\nclass ExpressionBytesOperationZfillBase(\n    ExpressionBytesShapeExactMixin, ChildrenHavingBytesArgWidthMixin, ExpressionBase\n):\n    named_children = (\n        \"bytes_arg\",\n        \"width\",\n    )\n\n    def __init__(self, bytes_arg, width, source_ref):\n        ChildrenHavingBytesArgWidthMixin.__init__(\n            self,\n            bytes_arg=bytes_arg,\n            width=width,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_bytes_arg.isCompileTimeConstant()\n            and self.subnode_width.isCompileTimeConstant()\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.zfill(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n                    self.subnode_width.getCompileTimeConstant(),\n                ),\n                description=\"Built-in 'bytes.zfill' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type)\n            or self.subnode_width.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinRangeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node the calls to the 'range' built-in.\n\nThis is a rather complex beast as it has many cases, is difficult to know if\nit's sizable enough to compute, and there are complex cases, where the bad\nresult of it can be predicted still, and these are interesting for warnings.\n\n\"\"\"\n\nimport math\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingLowMixin,\n    ChildrenHavingLowHighMixin,\n    ChildrenHavingLowHighStepMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionListShapeExactMixin\nfrom .IterationHandles import (\n    IterationHandleRange1,\n    IterationHandleRange2,\n    IterationHandleRange3,\n)\nfrom .NodeMakingHelpers import makeConstantReplacementNode\nfrom .shapes.BuiltinTypeShapes import tshape_xrange\n\n\nclass ExpressionBuiltinRangeMixin(ExpressionListShapeExactMixin):\n    \"\"\"Mixin class for range nodes with 1/2/3 arguments.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    builtin_spec = BuiltinParameterSpecs.builtin_range_spec\n\n    def getTruthValue(self):\n        length = self.getIterationLength()\n\n        if length is None:\n            return None\n        else:\n            return length > 0\n\n    def mayHaveSideEffects(self):\n        for child in self.getVisitableNodes():\n            if child.mayHaveSideEffects():\n                return True\n\n            if child.getIntegerValue() is None:\n                return True\n\n            if python_version >= 0x270 and child.isExpressionConstantFloatRef():\n                return True\n\n        return False\n\n    def mayRaiseException(self, exception_type):\n        for child in self.getVisitableNodes():\n            if child.mayRaiseException(exception_type):\n                return True\n\n            # TODO: Should take exception_type value into account here.\n            if child.getIntegerValue() is None:\n                return True\n\n            if python_version >= 0x270 and child.isExpressionConstantFloatRef():\n                return True\n\n        step = self.subnode_step\n\n        # A step of 0 will raise.\n        if step is not None and step.getIntegerValue() == 0:\n            return True\n\n        return False\n\n    def computeBuiltinSpec(self, trace_collection, given_values):\n        assert self.builtin_spec is not None, self\n\n        if not self.builtin_spec.isCompileTimeComputable(given_values):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            # TODO: Raise exception known step 0.\n\n            return self, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.builtin_spec.simulateCall(given_values),\n            description=\"Built-in call to '%s' computed.\"\n            % (self.builtin_spec.getName()),\n        )\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        assert python_version < 0x300\n\n        # TODO: The xrange is always faster and more memory usage than range, so this makes no sense, to\n        # use it as a source for any iteration, esp. as xrange is the Python3 only type that will be\n        # best optimized.\n        result = makeExpressionBuiltinXrange(\n            low=self.subnode_low,\n            high=self.subnode_high,\n            step=self.subnode_step,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        del self.parent\n\n        return (\n            iter_node,\n            \"new_expression\",\n            \"Replaced 'range' with 'xrange' built-in call for iteration.\",\n        )\n\n    def canPredictIterationValues(self):\n        return self.getIterationLength() is not None\n\n\nclass ExpressionBuiltinRange1(\n    ExpressionBuiltinRangeMixin, ChildHavingLowMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_RANGE1\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"low\",)\n\n    subnode_high = None\n    subnode_step = None\n\n    def __init__(self, low, source_ref):\n        ChildHavingLowMixin.__init__(self, low=low)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        low = self.subnode_low\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low,)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        return max(0, low)\n\n    def getIterationHandle(self):\n        low = self.subnode_low.getIntegerValue()\n        if low is None:\n            return None\n\n        return IterationHandleRange1(low, self.source_ref)\n\n    def getIterationValue(self, element_index):\n        length = self.getIterationLength()\n\n        if length is None:\n            return None\n\n        if element_index > length:\n            return None\n\n        # TODO: Make sure to cast element_index to what CPython will give, for\n        # now a downcast will do.\n        return makeConstantReplacementNode(\n            constant=int(element_index), node=self, user_provided=False\n        )\n\n    def isKnownToBeIterable(self, count):\n        return count is None or count == self.getIterationLength()\n\n\nclass ExpressionBuiltinRange2(\n    ExpressionBuiltinRangeMixin, ChildrenHavingLowHighMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_RANGE2\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"low\", \"high\")\n\n    # For the mixing to work generically\n    subnode_step = None\n\n    def __init__(self, low, high, source_ref):\n        ChildrenHavingLowHighMixin.__init__(\n            self,\n            low=low,\n            high=high,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    builtin_spec = BuiltinParameterSpecs.builtin_range_spec\n\n    def computeExpression(self, trace_collection):\n        assert python_version < 0x300\n\n        low = self.subnode_low\n        high = self.subnode_high\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low, high)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low\n        high = self.subnode_high\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        return max(0, high - low)\n\n    def getIterationHandle(self):\n        low = self.subnode_low.getIntegerValue()\n        if low is None:\n            return None\n\n        high = self.subnode_high.getIntegerValue()\n        if high is None:\n            return None\n\n        return IterationHandleRange2(low, high, self.source_ref)\n\n    def getIterationValue(self, element_index):\n        low = self.subnode_low\n        high = self.subnode_high\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        result = low + element_index\n\n        if result >= high:\n            return None\n        else:\n            return makeConstantReplacementNode(\n                constant=result, node=self, user_provided=False\n            )\n\n    def isKnownToBeIterable(self, count):\n        return count is None or count == self.getIterationLength()\n\n\nclass ExpressionBuiltinRange3(\n    ExpressionBuiltinRangeMixin, ChildrenHavingLowHighStepMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_RANGE3\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"low\", \"high\", \"step\")\n\n    def __init__(self, low, high, step, source_ref):\n        ChildrenHavingLowHighStepMixin.__init__(\n            self,\n            low=low,\n            high=high,\n            step=step,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    builtin_spec = BuiltinParameterSpecs.builtin_range_spec\n\n    def computeExpression(self, trace_collection):\n        low = self.subnode_low\n        high = self.subnode_high\n        step = self.subnode_step\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low, high, step)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low\n        high = self.subnode_high\n        step = self.subnode_step\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        step = step.getIntegerValue()\n\n        if step is None:\n            return None\n\n        # Give up on this, will raise ValueError.\n        if step == 0:\n            return None\n\n        if low < high:\n            if step < 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(high - low) / step)\n        else:\n            if step > 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(high - low) / step)\n\n        estimate = round(estimate)\n\n        assert estimate >= 0\n\n        return int(estimate)\n\n    def canPredictIterationValues(self):\n        return self.getIterationLength() is not None\n\n    def getIterationHandle(self):\n        low = self.subnode_low.getIntegerValue()\n        if low is None:\n            return None\n\n        high = self.subnode_high.getIntegerValue()\n        if high is None:\n            return None\n\n        step = self.subnode_step.getIntegerValue()\n        if step is None:\n            return None\n\n        # Give up on this, will raise ValueError.\n        if step == 0:\n            return None\n\n        return IterationHandleRange3(low, high, step, self.source_ref)\n\n    def getIterationValue(self, element_index):\n        low = self.subnode_low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = self.subnode_high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        step = self.subnode_step.getIntegerValue()\n\n        result = low + step * element_index\n\n        if result >= high:\n            return None\n        else:\n            return makeConstantReplacementNode(\n                constant=result, node=self, user_provided=False\n            )\n\n    def isKnownToBeIterable(self, count):\n        return count is None or count == self.getIterationLength()\n\n\nclass ExpressionBuiltinXrangeMixin(object):\n    \"\"\"Mixin class for xrange nodes with 1/2/3 arguments.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    builtin_spec = BuiltinParameterSpecs.builtin_xrange_spec\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_xrange\n\n    def canPredictIterationValues(self):\n        return self.getIterationLength() is not None\n\n    def getTruthValue(self):\n        length = self.getIterationLength()\n\n        if length is None:\n            return None\n        else:\n            return length > 0\n\n    def mayHaveSideEffects(self):\n        for child in self.getVisitableNodes():\n            if child.mayHaveSideEffects():\n                return True\n\n            if child.getIntegerValue() is None:\n                return True\n\n        return False\n\n    def mayRaiseException(self, exception_type):\n        for child in self.getVisitableNodes():\n            if child.mayRaiseException(exception_type):\n                return True\n\n            # TODO: Should take exception_type value into account here.\n            if child.getIntegerValue() is None:\n                return True\n\n        step = self.subnode_step\n\n        # A step of 0 will raise.\n        if step is not None and step.getIntegerValue() == 0:\n            return True\n\n        return False\n\n    def computeBuiltinSpec(self, trace_collection, given_values):\n        assert self.builtin_spec is not None, self\n\n        if not self.builtin_spec.isCompileTimeComputable(given_values):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            # TODO: Raise exception known step 0.\n\n            return self, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.builtin_spec.simulateCall(given_values),\n            description=\"Built-in call to '%s' computed.\"\n            % (self.builtin_spec.getName()),\n        )\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # No exception will be raised on xrange iteration, but there is nothing to\n        # lower for, virtual method: pylint: disable=no-self-use\n\n        return iter_node, None, None\n\n\nclass ExpressionBuiltinXrange1(\n    ExpressionBuiltinXrangeMixin, ChildHavingLowMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_XRANGE1\"\n\n    named_children = (\"low\",)\n\n    subnode_high = None\n    subnode_step = None\n\n    def __init__(self, low, source_ref):\n        ChildHavingLowMixin.__init__(self, low=low)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        low = self.subnode_low\n\n        # TODO: Optimize this if self.subnode_low.getIntegerValue() is Not None\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low,)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        return max(0, low)\n\n    def getIterationValue(self, element_index):\n        length = self.getIterationLength()\n\n        if length is None:\n            return None\n\n        if element_index > length:\n            return None\n\n        # TODO: Make sure to cast element_index to what CPython will give, for\n        # now a downcast will do.\n        return makeConstantReplacementNode(\n            constant=int(element_index), node=self, user_provided=False\n        )\n\n\nclass ExpressionBuiltinXrange2(\n    ExpressionBuiltinXrangeMixin, ChildrenHavingLowHighMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_XRANGE2\"\n\n    named_children = (\"low\", \"high\")\n\n    subnode_step = None\n\n    def __init__(self, low, high, source_ref):\n        ChildrenHavingLowHighMixin.__init__(\n            self,\n            low=low,\n            high=high,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        low = self.subnode_low\n        high = self.subnode_high\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low, high)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low\n        high = self.subnode_high\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        return max(0, high - low)\n\n    def getIterationValue(self, element_index):\n        low = self.subnode_low\n        high = self.subnode_high\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        result = low + element_index\n\n        if result >= high:\n            return None\n        else:\n            return makeConstantReplacementNode(\n                constant=result, node=self, user_provided=False\n            )\n\n\nclass ExpressionBuiltinXrange3(\n    ExpressionBuiltinXrangeMixin, ChildrenHavingLowHighStepMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_XRANGE3\"\n\n    named_children = (\"low\", \"high\", \"step\")\n\n    def __init__(self, low, high, step, source_ref):\n        ChildrenHavingLowHighStepMixin.__init__(\n            self,\n            low=low,\n            high=high,\n            step=step,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        low = self.subnode_low\n        high = self.subnode_high\n        step = self.subnode_step\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(low, high, step)\n        )\n\n    def getIterationLength(self):\n        low = self.subnode_low\n        high = self.subnode_high\n        step = self.subnode_step\n\n        low = low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        step = step.getIntegerValue()\n\n        if step is None:\n            return None\n\n        # Give up on this, will raise ValueError.\n        if step == 0:\n            return None\n\n        if low < high:\n            if step < 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(high - low) / step)\n        else:\n            if step > 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(high - low) / step)\n\n        estimate = round(estimate)\n\n        assert estimate >= 0\n\n        return int(estimate)\n\n    def getIterationValue(self, element_index):\n        low = self.subnode_low.getIntegerValue()\n\n        if low is None:\n            return None\n\n        high = self.subnode_high.getIntegerValue()\n\n        if high is None:\n            return None\n\n        step = self.subnode_step.getIntegerValue()\n\n        result = low + step * element_index\n\n        if result >= high:\n            return None\n        else:\n            return makeConstantReplacementNode(\n                constant=result, node=self, user_provided=False\n            )\n\n\ndef makeExpressionBuiltinXrange(low, high, step, source_ref):\n    if high is None:\n        return ExpressionBuiltinXrange1(low=low, source_ref=source_ref)\n    elif step is None:\n        return ExpressionBuiltinXrange2(low=low, high=high, source_ref=source_ref)\n    else:\n        return ExpressionBuiltinXrange3(\n            low=low, high=high, step=step, source_ref=source_ref\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinRefNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tree nodes for built-in references.\n\nThere is 2 major types of built-in references. One is the values from\nbuilt-ins, the other is built-in exceptions. They work differently and\nmean different things, but they have similar origin, that is, access\nto variables only ever read.\n\n\"\"\"\n\nfrom nuitka.Builtins import (\n    builtin_anon_names,\n    builtin_exception_names,\n    builtin_exception_values,\n    builtin_names,\n    builtin_type_names,\n)\nfrom nuitka.Options import hasPythonFlagNoAsserts\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExceptionNodes import (\n    ExpressionBuiltinMakeException,\n    ExpressionBuiltinMakeExceptionImportError,\n)\nfrom .ExpressionBases import CompileTimeConstantExpressionBase\nfrom .shapes.BuiltinTypeShapes import tshape_exception_class\n\n\nclass ExpressionBuiltinRefBase(CompileTimeConstantExpressionBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    __slots__ = (\"builtin_name\",)\n\n    def __init__(self, builtin_name, source_ref):\n        CompileTimeConstantExpressionBase.__init__(self, source_ref)\n\n        self.builtin_name = builtin_name\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"builtin_name\": self.builtin_name}\n\n    def getBuiltinName(self):\n        return self.builtin_name\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    def getStrValue(self):\n        return makeConstantRefNode(\n            constant=str(self.getCompileTimeConstant()),\n            user_provided=True,\n            source_ref=self.source_ref,\n        )\n\n\ndef makeExpressionBuiltinTypeRef(builtin_name, source_ref):\n    return makeConstantRefNode(\n        constant=__builtins__[builtin_name], source_ref=source_ref\n    )\n\n\nquick_names = {\"None\": None, \"True\": True, \"False\": False}\n\n\ndef makeExpressionBuiltinRef(builtin_name, locals_scope, source_ref):\n    assert builtin_name in builtin_names, builtin_name\n\n    if builtin_name in quick_names:\n        return makeConstantRefNode(\n            constant=quick_names[builtin_name], source_ref=source_ref\n        )\n    elif builtin_name == \"__debug__\":\n        return makeConstantRefNode(\n            constant=not hasPythonFlagNoAsserts(), source_ref=source_ref\n        )\n    elif builtin_name in builtin_type_names:\n        return makeExpressionBuiltinTypeRef(\n            builtin_name=builtin_name, source_ref=source_ref\n        )\n    elif builtin_name in (\"dir\", \"eval\", \"exec\", \"execfile\", \"locals\", \"vars\"):\n        return ExpressionBuiltinWithContextRef(\n            builtin_name=builtin_name, locals_scope=locals_scope, source_ref=source_ref\n        )\n    else:\n        return ExpressionBuiltinRef(builtin_name=builtin_name, source_ref=source_ref)\n\n\nclass ExpressionBuiltinRef(ExpressionBuiltinRefBase):\n    kind = \"EXPRESSION_BUILTIN_REF\"\n\n    __slots__ = ()\n\n    # For overload\n    locals_scope = None\n\n    @staticmethod\n    def isExpressionBuiltinRef():\n        return True\n\n    def __init__(self, builtin_name, source_ref):\n        ExpressionBuiltinRefBase.__init__(\n            self, builtin_name=builtin_name, source_ref=source_ref\n        )\n\n    def getCompileTimeConstant(self):\n        return __builtins__[self.builtin_name]\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        from nuitka.optimizations.OptimizeBuiltinCalls import (\n            computeBuiltinCall,\n        )\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        new_node, tags, message = computeBuiltinCall(\n            builtin_name=self.builtin_name, call_node=call_node\n        )\n\n        if self.builtin_name in (\"dir\", \"eval\", \"exec\", \"execfile\", \"locals\", \"vars\"):\n            # Just inform the collection that all has escaped.\n            trace_collection.onLocalsUsage(locals_scope=self.getLocalsScope())\n\n        return new_node, tags, message\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        return self.computeExpressionCall(\n            call_node=call_node,\n            call_args=call_args,\n            call_kw=call_kw,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # TODO: Why yes, some may be, could be told here.\n        return None\n\n\nclass ExpressionBuiltinWithContextRef(ExpressionBuiltinRef):\n    \"\"\"Same as ExpressionBuiltinRef, but with a context it refers to.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_WITH_CONTEXT_REF\"\n\n    __slots__ = (\"locals_scope\",)\n\n    def __init__(self, builtin_name, locals_scope, source_ref):\n        ExpressionBuiltinRef.__init__(\n            self, builtin_name=builtin_name, source_ref=source_ref\n        )\n\n        self.locals_scope = locals_scope\n\n    def getDetails(self):\n        return {\"builtin_name\": self.builtin_name, \"locals_scope\": self.locals_scope}\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n\nclass ExpressionBuiltinAnonymousRef(ExpressionBuiltinRefBase):\n    kind = \"EXPRESSION_BUILTIN_ANONYMOUS_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, builtin_name, source_ref):\n        assert builtin_name in builtin_anon_names, (builtin_name, source_ref)\n\n        ExpressionBuiltinRefBase.__init__(\n            self, builtin_name=builtin_name, source_ref=source_ref\n        )\n\n    def getCompileTimeConstant(self):\n        return builtin_anon_names[self.builtin_name]\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n\nclass ExpressionBuiltinExceptionRef(ExpressionBuiltinRefBase):\n    kind = \"EXPRESSION_BUILTIN_EXCEPTION_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, exception_name, source_ref):\n        assert exception_name in builtin_exception_names, exception_name\n\n        ExpressionBuiltinRefBase.__init__(\n            self, builtin_name=exception_name, source_ref=source_ref\n        )\n\n    def getDetails(self):\n        return {\"exception_name\": self.builtin_name}\n\n    getExceptionName = ExpressionBuiltinRefBase.getBuiltinName\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_exception_class\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def getCompileTimeConstant(self):\n        return builtin_exception_values[self.builtin_name]\n\n    def computeExpressionRaw(self, trace_collection):\n        # Not much that can be done here.\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        exception_name = self.getExceptionName()\n\n        def createBuiltinMakeException(args, name=None, path=None, source_ref=None):\n            if exception_name == \"ImportError\" and python_version >= 0x300:\n                return ExpressionBuiltinMakeExceptionImportError(\n                    args=args,\n                    name=name,\n                    path=path,\n                    source_ref=source_ref,\n                )\n            else:\n                # We expect to only get the star arguments for these.\n                assert name is None\n                assert path is None\n\n                return ExpressionBuiltinMakeException(\n                    exception_name=exception_name, args=args, source_ref=source_ref\n                )\n\n        new_node = BuiltinParameterSpecs.extractBuiltinArgs(\n            node=call_node,\n            builtin_class=createBuiltinMakeException,\n            builtin_spec=BuiltinParameterSpecs.makeBuiltinExceptionParameterSpec(\n                exception_name=exception_name\n            ),\n        )\n\n        assert new_node is not None\n\n        return new_node, \"new_expression\", \"Detected built-in exception making.\"\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        return self.computeExpressionCall(\n            call_node=call_node,\n            call_args=call_args,\n            call_kw=call_kw,\n            trace_collection=trace_collection,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinSumNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node the calls to the 'sum' built-in.\n\nThis is a rather challenging case for optimization, as it has C code behind\nit that could be in-lined sometimes for more static analysis.\n\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingSequenceMixin,\n    ChildrenHavingSequenceStartMixin,\n)\nfrom .ExpressionBases import ExpressionBase\n\n\nclass ExpressionBuiltinSumMixin(object):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    builtin_spec = BuiltinParameterSpecs.builtin_sum_spec\n\n    def computeBuiltinSpec(self, trace_collection, given_values):\n        assert self.builtin_spec is not None, self\n\n        if not self.builtin_spec.isCompileTimeComputable(given_values):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            # TODO: Raise exception known step 0.\n\n            return self, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.builtin_spec.simulateCall(given_values),\n            description=\"Built-in call to '%s' computed.\"\n            % (self.builtin_spec.getName()),\n        )\n\n\nclass ExpressionBuiltinSum1(\n    ExpressionBuiltinSumMixin, ChildHavingSequenceMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_SUM1\"\n\n    named_children = (\"sequence\",)\n\n    def __init__(self, sequence, source_ref):\n        ChildHavingSequenceMixin.__init__(self, sequence=sequence)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        sequence = self.subnode_sequence\n\n        # TODO: Protect against large xrange constants\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(sequence,)\n        )\n\n\nclass ExpressionBuiltinSum2(\n    ExpressionBuiltinSumMixin, ChildrenHavingSequenceStartMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_SUM2\"\n\n    named_children = (\"sequence\", \"start\")\n\n    def __init__(self, sequence, start, source_ref):\n        ChildrenHavingSequenceStartMixin.__init__(\n            self,\n            sequence=sequence,\n            start=start,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        sequence = self.subnode_sequence\n        start = self.subnode_start\n\n        # TODO: Protect against large xrange constants\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=(sequence, start)\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinTypeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Built-in type nodes tuple/list/set/float/str/unicode etc.\n\nThese are all very simple and have predictable properties, because we know their type and\nthat should allow some important optimizations.\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingValueMixin,\n    ChildrenExpressionBuiltinBytearray3Mixin,\n    ChildrenExpressionTypeOperationPrepareMixin,\n    ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import (\n    CompileTimeConstantExpressionBase,\n    ExpressionBase,\n    ExpressionBuiltinSingleArgBase,\n    ExpressionSpecBasedComputationMixin,\n)\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionBytearrayShapeExactMixin,\n    ExpressionBytesShapeExactMixin,\n    ExpressionFrozensetShapeExactMixin,\n    ExpressionListShapeExactMixin,\n    ExpressionSetShapeExactMixin,\n    ExpressionStrDerivedShapeMixin,\n    ExpressionStrOrUnicodeDerivedShapeMixin,\n    ExpressionTupleShapeExactMixin,\n)\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import (\n    tshape_bytes_derived,\n    tshape_float_derived,\n    tshape_str_derived,\n    tshape_unicode_derived,\n)\n\n\nclass ExpressionBuiltinTypeBase(ExpressionBuiltinSingleArgBase):\n    pass\n\n\nclass ExpressionBuiltinContainerBase(\n    ExpressionSpecBasedComputationMixin, ChildHavingValueMixin, ExpressionBase\n):\n    # For overload.\n    builtin_spec = None\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        if value is None:\n            return self.computeBuiltinSpec(\n                trace_collection=trace_collection, given_values=()\n            )\n        elif value.isExpressionConstantXrangeRef():\n            if value.getIterationLength() <= 256:\n                return self.computeBuiltinSpec(\n                    trace_collection=trace_collection, given_values=(value,)\n                )\n            else:\n                return self, None, None\n        else:\n            # They take over the variable content, exposing it to currently untraced usages.\n            value.onContentEscapes(trace_collection)\n\n            return self.computeBuiltinSpec(\n                trace_collection=trace_collection, given_values=(value,)\n            )\n\n\nclass ExpressionBuiltinTuple(\n    ExpressionTupleShapeExactMixin, ExpressionBuiltinContainerBase\n):\n    kind = \"EXPRESSION_BUILTIN_TUPLE\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_tuple_spec\n\n\nclass ExpressionBuiltinList(\n    ExpressionListShapeExactMixin, ExpressionBuiltinContainerBase\n):\n    kind = \"EXPRESSION_BUILTIN_LIST\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_list_spec\n\n\nclass ExpressionBuiltinSet(\n    ExpressionSetShapeExactMixin, ExpressionBuiltinContainerBase\n):\n    kind = \"EXPRESSION_BUILTIN_SET\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_set_spec\n\n\nclass ExpressionBuiltinFrozenset(\n    ExpressionFrozensetShapeExactMixin, ExpressionBuiltinContainerBase\n):\n    kind = \"EXPRESSION_BUILTIN_FROZENSET\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_frozenset_spec\n\n\nclass ExpressionBuiltinFloat(ChildHavingValueMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_FLOAT\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Depending on input type shape, we should improve this.\n        return tshape_float_derived\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionFloat(\n            float_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseExceptionFloat(exception_type)\n\n\nclass ExpressionBuiltinBool(ExpressionBoolShapeExactMixin, ExpressionBuiltinTypeBase):\n    kind = \"EXPRESSION_BUILTIN_BOOL\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_bool_spec\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        truth_value = value.getTruthValue()\n\n        if truth_value is not None:\n            result = wrapExpressionWithNodeSideEffects(\n                new_node=makeConstantReplacementNode(\n                    constant=truth_value, node=self, user_provided=False\n                ),\n                old_node=value,\n            )\n\n            return (\n                result,\n                \"new_constant\",\n                \"Predicted truth value of built-in bool argument\",\n            )\n\n        if value.hasShapeBoolExact():\n            return (\n                value,\n                \"new_expression\",\n                \"Eliminated boolean conversion of boolean value.\",\n            )\n\n        return ExpressionBuiltinTypeBase.computeExpression(self, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(\n            exception_type\n        ) or self.subnode_value.mayRaiseExceptionBool(exception_type)\n\n\nclass ExpressionBuiltinUnicodeBase(\n    ExpressionSpecBasedComputationMixin,\n    ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin,\n    ExpressionBase,\n):\n    named_children = (\"value|optional\", \"encoding|optional\", \"errors|optional\")\n\n    def __init__(self, value, encoding, errors, source_ref):\n        ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin.__init__(\n            self,\n            value=value,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        args = [self.subnode_value, self.subnode_encoding, self.subnode_errors]\n\n        while args and args[-1] is None:\n            del args[-1]\n\n        # The value of that node escapes and could change its contents.\n        if self.subnode_value is not None:\n            trace_collection.onValueEscapeStr(self.subnode_value)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection, given_values=tuple(args)\n        )\n\n\nclass ExpressionBuiltinStrP2(\n    ExpressionStrOrUnicodeDerivedShapeMixin, ExpressionBuiltinTypeBase\n):\n    \"\"\"Python2 built-in str call.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_STR_P2\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_str_spec\n\n    def computeExpression(self, trace_collection):\n        (\n            new_node,\n            change_tags,\n            change_desc,\n        ) = ExpressionBuiltinTypeBase.computeExpression(self, trace_collection)\n\n        if new_node is self:\n            str_value = self.subnode_value.getStrValue()\n\n            if str_value is not None:\n                new_node = wrapExpressionWithNodeSideEffects(\n                    new_node=str_value, old_node=self.subnode_value\n                )\n\n                change_tags = \"new_expression\"\n                change_desc = \"Predicted 'str' built-in result\"\n\n        return new_node, change_tags, change_desc\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_str_derived\n\n\nclass ExpressionBuiltinUnicodeP2(ExpressionBuiltinUnicodeBase):\n    \"\"\"Python2 built-in unicode call.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_UNICODE_P2\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_unicode_p2_spec\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unicode_derived\n\n\nclass ExpressionBuiltinStrP3(\n    ExpressionStrDerivedShapeMixin, ExpressionBuiltinUnicodeBase\n):\n    \"\"\"Python3 built-in str call.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_STR_P3\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_str_spec\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_str_derived\n\n\nclass ExpressionBuiltinBytes3(\n    ExpressionBytesShapeExactMixin, ExpressionBuiltinUnicodeBase\n):\n    kind = \"EXPRESSION_BUILTIN_BYTES3\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_bytes_p3_spec\n\n\nclass ExpressionBuiltinBytes1(ChildHavingValueMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_BYTES1\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Depending on input type shape, we should improve this.\n        return tshape_bytes_derived\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_value.computeExpressionBytes(\n            bytes_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseExceptionBytes(exception_type)\n\n\nclass ExpressionBuiltinBytearray1(\n    ExpressionBytearrayShapeExactMixin, ExpressionBuiltinTypeBase\n):\n    kind = \"EXPRESSION_BUILTIN_BYTEARRAY1\"\n\n    builtin_spec = BuiltinParameterSpecs.builtin_bytearray_spec\n\n    def __init__(self, value, source_ref):\n        ExpressionBuiltinTypeBase.__init__(self, value=value, source_ref=source_ref)\n\n\nclass ExpressionBuiltinBytearray3(\n    ExpressionBytearrayShapeExactMixin,\n    ChildrenExpressionBuiltinBytearray3Mixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_BYTEARRAY3\"\n\n    named_children = (\"string\", \"encoding|optional\", \"errors|optional\")\n\n    builtin_spec = BuiltinParameterSpecs.builtin_bytearray_spec\n\n    def __init__(self, string, encoding, errors, source_ref):\n        ChildrenExpressionBuiltinBytearray3Mixin.__init__(\n            self,\n            string=string,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionConstantGenericAlias(CompileTimeConstantExpressionBase):\n    kind = \"EXPRESSION_CONSTANT_GENERIC_ALIAS\"\n\n    __slots__ = (\"generic_alias\",)\n\n    def __init__(self, generic_alias, source_ref):\n        CompileTimeConstantExpressionBase.__init__(self, source_ref)\n\n        self.generic_alias = generic_alias\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"generic_alias\": self.generic_alias}\n\n    def getCompileTimeConstant(self):\n        return self.generic_alias\n\n    def getStrValue(self):\n        return makeConstantRefNode(\n            constant=str(self.getCompileTimeConstant()),\n            user_provided=True,\n            source_ref=self.source_ref,\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        # Nothing much to do.\n        return self, None, None\n\n\nclass ExpressionConstantUnionType(CompileTimeConstantExpressionBase):\n    kind = \"EXPRESSION_CONSTANT_UNION_TYPE\"\n\n    __slots__ = (\"union_type\",)\n\n    def __init__(self, union_type, source_ref):\n        CompileTimeConstantExpressionBase.__init__(self, source_ref)\n\n        self.union_type = union_type\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"union_type\": self.union_type}\n\n    def getCompileTimeConstant(self):\n        return self.union_type\n\n    def getStrValue(self):\n        return makeConstantRefNode(\n            constant=str(self.getCompileTimeConstant()),\n            user_provided=True,\n            source_ref=self.source_ref,\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        # Nothing much to do.\n        return self, None, None\n\n\nclass ExpressionTypeOperationPrepare(\n    ChildrenExpressionTypeOperationPrepareMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_TYPE_OPERATION_PREPARE\"\n\n    named_children = (\"type_arg\", \"args|optional\", \"kwargs|optional\")\n\n    def __init__(self, type_arg, args, kwargs, source_ref):\n        ChildrenExpressionTypeOperationPrepareMixin.__init__(\n            self, type_arg=type_arg, args=args, kwargs=kwargs\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_type_arg.isExpressionConstantTypeTypeRef():\n            result = makeConstantReplacementNode(\n                constant={}, node=self, user_provided=False\n            )\n\n            return (\n                result,\n                \"new_constant\",\n                \"Predicted result 'type.__prepare__' as empty dict.\",\n            )\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BuiltinVarsNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Builtin vars node.\n\nNot used much, esp. not in the form with arguments. Maybe used in some meta programming,\nand hopefully can be predicted, because at run time, it is hard to support.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingSourceMixin\nfrom .ExpressionBases import ExpressionBase\n\n\nclass ExpressionBuiltinVars(ChildHavingSourceMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_VARS\"\n\n    named_children = (\"source\",)\n\n    def __init__(self, source, source_ref):\n        ChildHavingSourceMixin.__init__(self, source=source)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Should be possible to predict this.\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/BytesNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that build and operate on bytes (Python3).\n\n\"\"\"\n\nfrom .BuiltinOperationNodeBasesGenerated import (\n    ExpressionBytesOperationCapitalizeBase,\n    ExpressionBytesOperationCenter2Base,\n    ExpressionBytesOperationCenter3Base,\n    ExpressionBytesOperationCount2Base,\n    ExpressionBytesOperationCount3Base,\n    ExpressionBytesOperationCount4Base,\n    ExpressionBytesOperationDecode1Base,\n    ExpressionBytesOperationDecode2Base,\n    ExpressionBytesOperationDecode3Base,\n    ExpressionBytesOperationEndswith2Base,\n    ExpressionBytesOperationEndswith3Base,\n    ExpressionBytesOperationEndswith4Base,\n    ExpressionBytesOperationExpandtabs1Base,\n    ExpressionBytesOperationExpandtabs2Base,\n    ExpressionBytesOperationFind2Base,\n    ExpressionBytesOperationFind3Base,\n    ExpressionBytesOperationFind4Base,\n    ExpressionBytesOperationIndex2Base,\n    ExpressionBytesOperationIndex3Base,\n    ExpressionBytesOperationIndex4Base,\n    ExpressionBytesOperationIsalnumBase,\n    ExpressionBytesOperationIsalphaBase,\n    ExpressionBytesOperationIsdigitBase,\n    ExpressionBytesOperationIslowerBase,\n    ExpressionBytesOperationIsspaceBase,\n    ExpressionBytesOperationIstitleBase,\n    ExpressionBytesOperationIsupperBase,\n    ExpressionBytesOperationJoinBase,\n    ExpressionBytesOperationLjust2Base,\n    ExpressionBytesOperationLjust3Base,\n    ExpressionBytesOperationLowerBase,\n    ExpressionBytesOperationLstrip1Base,\n    ExpressionBytesOperationLstrip2Base,\n    ExpressionBytesOperationPartitionBase,\n    ExpressionBytesOperationReplace3Base,\n    ExpressionBytesOperationReplace4Base,\n    ExpressionBytesOperationRfind2Base,\n    ExpressionBytesOperationRfind3Base,\n    ExpressionBytesOperationRfind4Base,\n    ExpressionBytesOperationRindex2Base,\n    ExpressionBytesOperationRindex3Base,\n    ExpressionBytesOperationRindex4Base,\n    ExpressionBytesOperationRjust2Base,\n    ExpressionBytesOperationRjust3Base,\n    ExpressionBytesOperationRpartitionBase,\n    ExpressionBytesOperationRsplit1Base,\n    ExpressionBytesOperationRsplit2Base,\n    ExpressionBytesOperationRsplit3Base,\n    ExpressionBytesOperationRstrip1Base,\n    ExpressionBytesOperationRstrip2Base,\n    ExpressionBytesOperationSplit1Base,\n    ExpressionBytesOperationSplit2Base,\n    ExpressionBytesOperationSplit3Base,\n    ExpressionBytesOperationSplitlines1Base,\n    ExpressionBytesOperationSplitlines2Base,\n    ExpressionBytesOperationStartswith2Base,\n    ExpressionBytesOperationStartswith3Base,\n    ExpressionBytesOperationStartswith4Base,\n    ExpressionBytesOperationStrip1Base,\n    ExpressionBytesOperationStrip2Base,\n    ExpressionBytesOperationSwapcaseBase,\n    ExpressionBytesOperationTitleBase,\n    ExpressionBytesOperationTranslate2Base,\n    ExpressionBytesOperationTranslate3Base,\n    ExpressionBytesOperationUpperBase,\n    ExpressionBytesOperationZfillBase,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionShapeMixins import ExpressionStrOrUnicodeExactMixin\nfrom .NodeMetaClasses import NodeCheckMetaClass\n\n\ndef getBytesOperationClasses():\n    \"\"\"Return all bytes operation nodes, for use by code generation.\"\"\"\n    return (\n        cls\n        for kind, cls in NodeCheckMetaClass.kinds.items()\n        if kind.startswith(\"EXPRESSION_BYTES_OPERATION_\")\n    )\n\n\nclass ExpressionBytesOperationJoin(ExpressionBytesOperationJoinBase):\n    \"\"\"This operation represents b.join(iterable).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_JOIN\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationPartition(ExpressionBytesOperationPartitionBase):\n    \"\"\"This operation represents b.partition(sep).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_PARTITION\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n    @staticmethod\n    def getIterationLength():\n        return 3\n\n\nclass ExpressionBytesOperationRpartition(ExpressionBytesOperationRpartitionBase):\n    \"\"\"This operation represents b.rpartition(sep).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RPARTITION\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n    @staticmethod\n    def getIterationLength():\n        return 3\n\n\nclass ExpressionBytesOperationStrip1(ExpressionBytesOperationStrip1Base):\n    \"\"\"This operation represents b.strip().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_STRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationStrip2(ExpressionBytesOperationStrip2Base):\n    \"\"\"This operation represents b.strip(chars).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_STRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationLstrip1(ExpressionBytesOperationLstrip1Base):\n    \"\"\"This operation represents b.lstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_LSTRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationLstrip2(ExpressionBytesOperationLstrip2Base):\n    \"\"\"This operation represents b.lstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_LSTRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRstrip1(ExpressionBytesOperationRstrip1Base):\n    \"\"\"This operation represents b.rstrip().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RSTRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationRstrip2(ExpressionBytesOperationRstrip2Base):\n    \"\"\"This operation represents b.rstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RSTRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationFind2(ExpressionBytesOperationFind2Base):\n    \"\"\"This operation represents b.find(sub).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_FIND2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationFind3(ExpressionBytesOperationFind3Base):\n    \"\"\"This operation represents b.find(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_FIND3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationFind4(ExpressionBytesOperationFind4Base):\n    \"\"\"This operation represents b.find(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_FIND4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRfind2(ExpressionBytesOperationRfind2Base):\n    \"\"\"This operation represents b.rfind(sub).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RFIND2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRfind3(ExpressionBytesOperationRfind3Base):\n    \"\"\"This operation represents b.rfind(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RFIND3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRfind4(ExpressionBytesOperationRfind4Base):\n    \"\"\"This operation represents b.rfind(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RFIND4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationIndex2(ExpressionBytesOperationIndex2Base):\n    \"\"\"This operation represents b.index(sub).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_INDEX2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationIndex3(ExpressionBytesOperationIndex3Base):\n    \"\"\"This operation represents b.index(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_INDEX3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationIndex4(ExpressionBytesOperationIndex4Base):\n    \"\"\"This operation represents b.index(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_INDEX4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRindex2(ExpressionBytesOperationRindex2Base):\n    \"\"\"This operation represents b.rindex(sub).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RINDEX2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRindex3(ExpressionBytesOperationRindex3Base):\n    \"\"\"This operation represents b.rindex(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RINDEX3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRindex4(ExpressionBytesOperationRindex4Base):\n    \"\"\"This operation represents b.rindex(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RINDEX4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationCapitalize(ExpressionBytesOperationCapitalizeBase):\n    \"\"\"This operation represents b.capitalize().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_CAPITALIZE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationUpper(ExpressionBytesOperationUpperBase):\n    \"\"\"This operation represents b.upper().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_UPPER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationLower(ExpressionBytesOperationLowerBase):\n    \"\"\"This operation represents b.lower().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_LOWER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationSwapcase(ExpressionBytesOperationSwapcaseBase):\n    \"\"\"This operation represents b.swapcase().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SWAPCASE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationTitle(ExpressionBytesOperationTitleBase):\n    \"\"\"This operation represents b.title().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_TITLE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIsalnum(ExpressionBytesOperationIsalnumBase):\n    \"\"\"This operation represents b.isalnum().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISALNUM\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIsalpha(ExpressionBytesOperationIsalphaBase):\n    \"\"\"This operation represents b.isalpha().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISALPHA\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIsdigit(ExpressionBytesOperationIsdigitBase):\n    \"\"\"This operation represents b.isdigit().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISDIGIT\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIslower(ExpressionBytesOperationIslowerBase):\n    \"\"\"This operation represents b.islower().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISLOWER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIsupper(ExpressionBytesOperationIsupperBase):\n    \"\"\"This operation represents b.isupper().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISUPPER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIsspace(ExpressionBytesOperationIsspaceBase):\n    \"\"\"This operation represents b.isspace().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISSPACE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationIstitle(ExpressionBytesOperationIstitleBase):\n    \"\"\"This operation represents b.istitle().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ISTITLE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationSplit1(ExpressionBytesOperationSplit1Base):\n    \"\"\"This operation represents b.split().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SPLIT1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationSplit2(ExpressionBytesOperationSplit2Base):\n    \"\"\"This operation represents b.split(sep).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SPLIT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\ndef makeExpressionBytesOperationSplit3(bytes_arg, sep, maxsplit, source_ref):\n    if sep is None:\n        sep = makeConstantRefNode(constant=None, source_ref=source_ref)\n\n    return ExpressionBytesOperationSplit3(\n        bytes_arg=bytes_arg,\n        sep=sep,\n        maxsplit=maxsplit,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionBytesOperationSplit3(ExpressionBytesOperationSplit3Base):\n    \"\"\"This operation represents b.split(sep, maxsplit).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SPLIT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\n# TODO: This one could be eliminated in favor of simple ExpressionBytesOperationSplit1\n# since without an argument, there is no difference.\nclass ExpressionBytesOperationRsplit1(ExpressionBytesOperationRsplit1Base):\n    \"\"\"This operation represents b.rsplit().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RSPLIT1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationRsplit2(ExpressionBytesOperationRsplit2Base):\n    \"\"\"This operation represents b.rsplit(sep).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RSPLIT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\ndef makeExpressionBytesOperationRsplit3(bytes_arg, sep, maxsplit, source_ref):\n    if sep is None:\n        sep = makeConstantRefNode(constant=None, source_ref=source_ref)\n\n    return ExpressionBytesOperationRsplit3(\n        bytes_arg=bytes_arg,\n        sep=sep,\n        maxsplit=maxsplit,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionBytesOperationRsplit3(ExpressionBytesOperationRsplit3Base):\n    \"\"\"This operation represents b.rsplit(sep, maxsplit).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_RSPLIT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationEndswith2(ExpressionBytesOperationEndswith2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_ENDSWITH2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationEndswith3(ExpressionBytesOperationEndswith3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_ENDSWITH3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationEndswith4(ExpressionBytesOperationEndswith4Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_ENDSWITH4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationStartswith2(ExpressionBytesOperationStartswith2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_STARTSWITH2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationStartswith3(ExpressionBytesOperationStartswith3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_STARTSWITH3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationStartswith4(ExpressionBytesOperationStartswith4Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_STARTSWITH4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationReplace3(ExpressionBytesOperationReplace3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_REPLACE3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationReplace4(ExpressionBytesOperationReplace4Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_REPLACE4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationDecodeMixin(ExpressionStrOrUnicodeExactMixin):\n    __slots__ = ()\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments cannot be decoded\n        return True\n\n\nclass ExpressionBytesOperationDecode1(\n    ExpressionBytesOperationDecodeMixin, ExpressionBytesOperationDecode1Base\n):\n    kind = \"EXPRESSION_BYTES_OPERATION_DECODE1\"\n\n\nclass ExpressionBytesOperationDecode2(\n    ExpressionBytesOperationDecodeMixin, ExpressionBytesOperationDecode2Base\n):\n    kind = \"EXPRESSION_BYTES_OPERATION_DECODE2\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Maybe demote for default values of encodings, e.g. UTF8, ASCII\n\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeExpressionBytesOperationDecode3(bytes_arg, encoding, errors, source_ref):\n    if encoding is None:\n        encoding = makeConstantRefNode(constant=\"utf-8\", source_ref=source_ref)\n\n    return ExpressionBytesOperationDecode3(\n        bytes_arg=bytes_arg,\n        encoding=encoding,\n        errors=errors,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionBytesOperationDecode3(\n    ExpressionBytesOperationDecodeMixin, ExpressionBytesOperationDecode3Base\n):\n    kind = \"EXPRESSION_BYTES_OPERATION_DECODE3\"\n\n    def computeExpression(self, trace_collection):\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionBytesOperationCount2(ExpressionBytesOperationCount2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_COUNT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationCount3(ExpressionBytesOperationCount3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_COUNT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationCount4(ExpressionBytesOperationCount4Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_COUNT4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationExpandtabs1(ExpressionBytesOperationExpandtabs1Base):\n    \"\"\"This operation represents b.expandtabs().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_EXPANDTABS1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBytesOperationExpandtabs2(ExpressionBytesOperationExpandtabs2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_EXPANDTABS2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationTranslate2(ExpressionBytesOperationTranslate2Base):\n    \"\"\"This operation represents b.translate(table).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_TRANSLATE2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationTranslate3(ExpressionBytesOperationTranslate3Base):\n    \"\"\"This operation represents b.translate(table, delete).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_TRANSLATE3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationZfill(ExpressionBytesOperationZfillBase):\n    \"\"\"This operation represents b.zfill(width).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_ZFILL\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationCenter2(ExpressionBytesOperationCenter2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_CENTER2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationCenter3(ExpressionBytesOperationCenter3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_CENTER3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationLjust2(ExpressionBytesOperationLjust2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_LJUST2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationLjust3(ExpressionBytesOperationLjust3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_LJUST3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRjust2(ExpressionBytesOperationRjust2Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_RJUST2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationRjust3(ExpressionBytesOperationRjust3Base):\n    kind = \"EXPRESSION_BYTES_OPERATION_RJUST3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionBytesOperationSplitlines1(ExpressionBytesOperationSplitlines1Base):\n    \"\"\"This operation represents b.splitlines().\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SPLITLINES1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # We do not count MemoryError\n        return False\n\n\nclass ExpressionBytesOperationSplitlines2(ExpressionBytesOperationSplitlines2Base):\n    \"\"\"This operation represents b.splitlines(keepends).\"\"\"\n\n    kind = \"EXPRESSION_BYTES_OPERATION_SPLITLINES2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/CallNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Call node\n\nFunction calls and generally calling expressions are the same thing. This is\nvery important, because it allows to predict most things, and avoid expensive\noperations like parameter parsing at run time.\n\nThere will be a method \"computeExpressionCall\" to aid predicting them in other\nnodes.\n\"\"\"\n\nfrom .ChildrenHavingMixins import (\n    ChildrenExpressionCallEmptyMixin,\n    ChildrenExpressionCallKeywordsOnlyMixin,\n    ChildrenExpressionCallMixin,\n    ChildrenExpressionCallNoKeywordsMixin,\n)\nfrom .ExpressionBases import ExpressionBase\n\n\nclass ExpressionCallMixin(object):\n    __slots__ = ()\n\n    @staticmethod\n    def isExpressionCall():\n        return True\n\n    # TODO: Depending on the called, and arguments we might know better.\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionCall(ExpressionCallMixin, ChildrenExpressionCallMixin, ExpressionBase):\n    kind = \"EXPRESSION_CALL\"\n\n    named_children = (\"called|setter\", \"args\", \"kwargs\")\n\n    def __init__(self, called, args, kwargs, source_ref):\n        ChildrenExpressionCallMixin.__init__(\n            self,\n            called=called,\n            args=args,\n            kwargs=kwargs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        called = self.subnode_called\n\n        return called.computeExpressionCall(\n            call_node=self,\n            call_args=self.subnode_args,\n            call_kw=self.subnode_kwargs,\n            trace_collection=trace_collection,\n        )\n\n    def extractSideEffectsPreCall(self):\n        args = self.subnode_args\n        kwargs = self.subnode_kwargs\n\n        return args.extractSideEffects() + kwargs.extractSideEffects()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_called.onContentEscapes(trace_collection)\n        self.subnode_args.onContentEscapes(trace_collection)\n        self.subnode_kwargs.onContentEscapes(trace_collection)\n\n\nclass ExpressionCallNoKeywords(\n    ExpressionCallMixin, ChildrenExpressionCallNoKeywordsMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_CALL_NO_KEYWORDS\"\n\n    named_children = (\"called|setter\", \"args\")\n\n    subnode_kwargs = None\n\n    def __init__(self, called, args, source_ref):\n        ChildrenExpressionCallNoKeywordsMixin.__init__(\n            self,\n            called=called,\n            args=args,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        called = self.subnode_called\n\n        return called.computeExpressionCall(\n            call_node=self,\n            call_args=self.subnode_args,\n            call_kw=None,\n            trace_collection=trace_collection,\n        )\n\n    def extractSideEffectsPreCall(self):\n        args = self.subnode_args\n\n        return args.extractSideEffects()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_called.onContentEscapes(trace_collection)\n        self.subnode_args.onContentEscapes(trace_collection)\n\n\nclass ExpressionCallKeywordsOnly(\n    ExpressionCallMixin, ChildrenExpressionCallKeywordsOnlyMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_CALL_KEYWORDS_ONLY\"\n\n    named_children = (\"called|setter\", \"kwargs\")\n\n    subnode_args = None\n\n    def __init__(self, called, kwargs, source_ref):\n        ChildrenExpressionCallKeywordsOnlyMixin.__init__(\n            self,\n            called=called,\n            kwargs=kwargs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        called = self.subnode_called\n\n        return called.computeExpressionCall(\n            call_node=self,\n            call_args=None,\n            call_kw=self.subnode_kwargs,\n            trace_collection=trace_collection,\n        )\n\n    def extractSideEffectsPreCall(self):\n        kwargs = self.subnode_kwargs\n\n        return kwargs.extractSideEffects()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_called.onContentEscapes(trace_collection)\n        self.subnode_kwargs.onContentEscapes(trace_collection)\n\n\nclass ExpressionCallEmpty(\n    ExpressionCallMixin, ChildrenExpressionCallEmptyMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_CALL_EMPTY\"\n\n    named_children = (\"called|setter\",)\n\n    subnode_args = None\n    subnode_kwargs = None\n\n    def __init__(self, called, source_ref):\n        ChildrenExpressionCallEmptyMixin.__init__(self, called=called)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        called = self.subnode_called\n\n        return called.computeExpressionCall(\n            call_node=self,\n            call_args=None,\n            call_kw=None,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def extractSideEffectsPreCall():\n        return ()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_called.onContentEscapes(trace_collection)\n\n\ndef makeExpressionCall(called, args, kw, source_ref):\n    \"\"\"Make the most simple call node possible.\n\n    By avoiding the more complex classes, we can achieve that there is\n    less work to do for analysis.\n    \"\"\"\n    has_kw = kw is not None and not kw.isExpressionConstantDictEmptyRef()\n\n    has_args = args is not None and not args.isExpressionConstantTupleEmptyRef()\n\n    if has_kw:\n        if has_args:\n            return ExpressionCall(called, args, kw, source_ref)\n        else:\n            return ExpressionCallKeywordsOnly(called, kw, source_ref)\n    else:\n        if has_args:\n            return ExpressionCallNoKeywords(called, args, source_ref)\n        else:\n            return ExpressionCallEmpty(called, source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/Checkers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node children checkers.\n\nThe role of checkers is to make sure that node children have specific value\ntypes only.\n\n\"\"\"\n\n\ndef checkStatementsSequenceOrNone(value):\n    if value is not None:\n        assert value.kind == \"STATEMENTS_SEQUENCE\", value\n\n        if not value.subnode_statements:\n            return None\n\n    return value\n\n\ndef checkStatementsSequence(value):\n    assert value is not None and value.kind == \"STATEMENTS_SEQUENCE\", value\n\n    return value\n\n\ndef convertNoneConstantToNone(node):\n    if node is None or node.isExpressionConstantNoneRef():\n        return None\n    else:\n        return node\n\n\ndef convertEmptyStrConstantToNone(node):\n    if node is None or node.isExpressionConstantStrEmptyRef():\n        return None\n    else:\n        return node\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ChildrenHavingMixins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Children having mixins\n\nWARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\n\n\n# Loop unrolling over child names, pylint: disable=too-many-branches\n\nfrom .Checkers import (\n    checkStatementsSequenceOrNone,\n    convertEmptyStrConstantToNone,\n    convertNoneConstantToNone,\n)\nfrom .NodeMakingHelpers import wrapExpressionWithSideEffects\n\n\nclass ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   CompiledPythonModule\n    #   CompiledPythonNamespacePackage\n    #   CompiledPythonPackage\n    #   PythonMainModule\n\n    def __init__(\n        self,\n        body,\n        functions,\n    ):\n        body = checkStatementsSequenceOrNone(body)\n        if body is not None:\n            body.parent = self\n\n        self.subnode_body = body\n\n        assert type(functions) is tuple\n\n        for val in functions:\n            val.parent = self\n\n        self.subnode_functions = functions\n\n    def setChildBody(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_body = value\n\n    def setChildFunctions(self, value):\n        assert type(value) is tuple, type(value)\n\n        for val in value:\n            val.parent = self\n\n        self.subnode_functions = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_body\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.extend(self.subnode_functions)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"body\", self.subnode_body),\n            (\"functions\", self.subnode_functions),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_body\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_body = new_node\n\n            return\n\n        value = self.subnode_functions\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_functions = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_functions = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"body\": (\n                self.subnode_body.makeClone() if self.subnode_body is not None else None\n            ),\n            \"functions\": tuple(v.makeClone() for v in self.subnode_functions),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_body is not None:\n            self.subnode_body.finalize()\n        del self.subnode_body\n        for c in self.subnode_functions:\n            c.finalize()\n        del self.subnode_functions\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_body = self.subnode_body\n\n        if subnode_body is not None:\n            self.subnode_body.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_functions:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenCompiledPythonModuleMixin = (\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin\n)\nChildrenCompiledPythonNamespacePackageMixin = (\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin\n)\nChildrenCompiledPythonPackageMixin = (\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin\n)\nChildrenPythonMainModuleMixin = (\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin\n)\n\n\nclass ChildHavingAsyncgenRefMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionMakeAsyncgenObject\n\n    def __init__(\n        self,\n        asyncgen_ref,\n    ):\n        asyncgen_ref.parent = self\n\n        self.subnode_asyncgen_ref = asyncgen_ref\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_asyncgen_ref,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"asyncgen_ref\", self.subnode_asyncgen_ref),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_asyncgen_ref\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_asyncgen_ref = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"asyncgen_ref\": self.subnode_asyncgen_ref.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_asyncgen_ref.finalize()\n        del self.subnode_asyncgen_ref\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_asyncgen_ref)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_asyncgen_ref.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionMakeAsyncgenObjectMixin = ChildHavingAsyncgenRefMixin\n\n\nclass ChildHavingBodyOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionAsyncgenObjectBody\n    #   ExpressionClassBodyP2\n    #   ExpressionClassBodyP3\n    #   ExpressionCoroutineObjectBody\n    #   ExpressionFunctionBody\n    #   ExpressionFunctionPureBody\n    #   ExpressionFunctionPureInlineConstBody\n    #   ExpressionGeneratorObjectBody\n    #   ExpressionOutlineBody\n    #   ExpressionOutlineFunction\n\n    def __init__(\n        self,\n        body,\n    ):\n        if body is not None:\n            body.parent = self\n\n        self.subnode_body = body\n\n    def setChildBody(self, value):\n        if value is not None:\n            value.parent = self\n\n        self.subnode_body = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_body\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"body\", self.subnode_body),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_body\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_body = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"body\": (\n                self.subnode_body.makeClone() if self.subnode_body is not None else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_body is not None:\n            self.subnode_body.finalize()\n        del self.subnode_body\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = self.subnode_body\n\n        if expression is not None:\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                return (\n                    expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_body = self.subnode_body\n\n        if subnode_body is not None:\n            self.subnode_body.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionAsyncgenObjectBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionClassBodyP2Mixin = ChildHavingBodyOptionalMixin\nChildrenExpressionClassBodyP3Mixin = ChildHavingBodyOptionalMixin\nChildrenExpressionCoroutineObjectBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionFunctionBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionFunctionPureBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionFunctionPureInlineConstBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionGeneratorObjectBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionOutlineBodyMixin = ChildHavingBodyOptionalMixin\nChildrenExpressionOutlineFunctionMixin = ChildHavingBodyOptionalMixin\n\n\nclass ChildHavingBytesArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCapitalize\n    #   ExpressionBytesOperationCapitalizeBase\n    #   ExpressionBytesOperationDecode1\n    #   ExpressionBytesOperationExpandtabs1\n    #   ExpressionBytesOperationIsalnum\n    #   ExpressionBytesOperationIsalpha\n    #   ExpressionBytesOperationIsalphaBase\n    #   ExpressionBytesOperationIsdigit\n    #   ExpressionBytesOperationIslower\n    #   ExpressionBytesOperationIsspace\n    #   ExpressionBytesOperationIsspaceBase\n    #   ExpressionBytesOperationIstitle\n    #   ExpressionBytesOperationIstitleBase\n    #   ExpressionBytesOperationIsupper\n    #   ExpressionBytesOperationLower\n    #   ExpressionBytesOperationLstrip1\n    #   ExpressionBytesOperationRsplit1\n    #   ExpressionBytesOperationRstrip1\n    #   ExpressionBytesOperationSplit1\n    #   ExpressionBytesOperationSplitlines1\n    #   ExpressionBytesOperationStrip1\n    #   ExpressionBytesOperationSwapcase\n    #   ExpressionBytesOperationSwapcaseBase\n    #   ExpressionBytesOperationTitle\n    #   ExpressionBytesOperationTitleBase\n    #   ExpressionBytesOperationUpper\n\n    def __init__(\n        self,\n        bytes_arg,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_bytes_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"bytes_arg\", self.subnode_bytes_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_bytes_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCapitalizeMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationCapitalizeBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationDecode1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationExpandtabs1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsalnumMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsalphaMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsalphaBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsdigitMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIslowerMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsspaceMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsspaceBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIstitleMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIstitleBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationIsupperMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationLowerMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationLstrip1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationRsplit1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationRstrip1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationSplit1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationSplitlines1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationStrip1Mixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationSwapcaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationSwapcaseBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationTitleMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationTitleBaseMixin = ChildHavingBytesArgMixin\nChildrenExpressionBytesOperationUpperMixin = ChildHavingBytesArgMixin\n\n\nclass ChildrenHavingBytesArgCharsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationLstrip2\n    #   ExpressionBytesOperationRstrip2\n    #   ExpressionBytesOperationStrip2\n\n    def __init__(\n        self,\n        bytes_arg,\n        chars,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        chars.parent = self\n\n        self.subnode_chars = chars\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_chars,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"chars\", self.subnode_chars),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_chars\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_chars = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"chars\": self.subnode_chars.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_chars.finalize()\n        del self.subnode_chars\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_chars.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationLstrip2Mixin = ChildrenHavingBytesArgCharsMixin\nChildrenExpressionBytesOperationRstrip2Mixin = ChildrenHavingBytesArgCharsMixin\nChildrenExpressionBytesOperationStrip2Mixin = ChildrenHavingBytesArgCharsMixin\n\n\nclass ChildrenHavingBytesArgEncodingMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationDecode2\n\n    def __init__(\n        self,\n        bytes_arg,\n        encoding,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_encoding,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"encoding\", self.subnode_encoding),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"encoding\": self.subnode_encoding.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_encoding.finalize()\n        del self.subnode_encoding\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationDecode2Mixin = ChildrenHavingBytesArgEncodingMixin\n\n\nclass ChildrenHavingBytesArgEncodingErrorsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationDecode3\n\n    def __init__(\n        self,\n        bytes_arg,\n        encoding,\n        errors,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        errors.parent = self\n\n        self.subnode_errors = errors\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_encoding,\n            self.subnode_errors,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"encoding\": self.subnode_encoding.makeClone(),\n            \"errors\": self.subnode_errors.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        self.subnode_errors.finalize()\n        del self.subnode_errors\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationDecode3Mixin = ChildrenHavingBytesArgEncodingErrorsMixin\n\n\nclass ChildrenHavingBytesArgIterableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationJoin\n\n    def __init__(\n        self,\n        bytes_arg,\n        iterable,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_iterable,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"iterable\", self.subnode_iterable),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"iterable\": self.subnode_iterable.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationJoinMixin = ChildrenHavingBytesArgIterableMixin\n\n\nclass ChildrenHavingBytesArgKeependsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationSplitlines2\n\n    def __init__(\n        self,\n        bytes_arg,\n        keepends,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        keepends.parent = self\n\n        self.subnode_keepends = keepends\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_keepends,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"keepends\", self.subnode_keepends),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_keepends\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_keepends = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"keepends\": self.subnode_keepends.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_keepends.finalize()\n        del self.subnode_keepends\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_keepends.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationSplitlines2Mixin = ChildrenHavingBytesArgKeependsMixin\n\n\nclass ChildrenHavingBytesArgOldNewMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationReplace3\n\n    def __init__(\n        self,\n        bytes_arg,\n        old,\n        new,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        old.parent = self\n\n        self.subnode_old = old\n\n        new.parent = self\n\n        self.subnode_new = new\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_old,\n            self.subnode_new,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"old\", self.subnode_old),\n            (\"new\", self.subnode_new),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_old\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_old = new_node\n\n            return\n\n        value = self.subnode_new\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_new = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"old\": self.subnode_old.makeClone(),\n            \"new\": self.subnode_new.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_old.finalize()\n        del self.subnode_old\n        self.subnode_new.finalize()\n        del self.subnode_new\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_old.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_new.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationReplace3Mixin = ChildrenHavingBytesArgOldNewMixin\n\n\nclass ChildrenHavingBytesArgOldNewCountMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationReplace4\n\n    def __init__(\n        self,\n        bytes_arg,\n        old,\n        new,\n        count,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        old.parent = self\n\n        self.subnode_old = old\n\n        new.parent = self\n\n        self.subnode_new = new\n\n        count.parent = self\n\n        self.subnode_count = count\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_old,\n            self.subnode_new,\n            self.subnode_count,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"old\", self.subnode_old),\n            (\"new\", self.subnode_new),\n            (\"count\", self.subnode_count),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_old\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_old = new_node\n\n            return\n\n        value = self.subnode_new\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_new = new_node\n\n            return\n\n        value = self.subnode_count\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_count = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"old\": self.subnode_old.makeClone(),\n            \"new\": self.subnode_new.makeClone(),\n            \"count\": self.subnode_count.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_old.finalize()\n        del self.subnode_old\n        self.subnode_new.finalize()\n        del self.subnode_new\n        self.subnode_count.finalize()\n        del self.subnode_count\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_old.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_new.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_count.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationReplace4Mixin = ChildrenHavingBytesArgOldNewCountMixin\n\n\nclass ChildrenHavingBytesArgPrefixMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationStartswith2\n\n    def __init__(\n        self,\n        bytes_arg,\n        prefix,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_prefix,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"prefix\", self.subnode_prefix),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationStartswith2Mixin = ChildrenHavingBytesArgPrefixMixin\n\n\nclass ChildrenHavingBytesArgPrefixStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationStartswith3\n\n    def __init__(\n        self,\n        bytes_arg,\n        prefix,\n        start,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_prefix,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"prefix\", self.subnode_prefix),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationStartswith3Mixin = (\n    ChildrenHavingBytesArgPrefixStartMixin\n)\n\n\nclass ChildrenHavingBytesArgPrefixStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationStartswith4\n\n    def __init__(\n        self,\n        bytes_arg,\n        prefix,\n        start,\n        end,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_prefix,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"prefix\", self.subnode_prefix),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationStartswith4Mixin = (\n    ChildrenHavingBytesArgPrefixStartEndMixin\n)\n\n\nclass ChildrenHavingBytesArgSepMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationPartition\n    #   ExpressionBytesOperationRpartition\n    #   ExpressionBytesOperationRsplit2\n    #   ExpressionBytesOperationSplit2\n\n    def __init__(\n        self,\n        bytes_arg,\n        sep,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        sep.parent = self\n\n        self.subnode_sep = sep\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_sep,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"sep\", self.subnode_sep),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_sep\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sep = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"sep\": self.subnode_sep.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_sep.finalize()\n        del self.subnode_sep\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sep.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationPartitionMixin = ChildrenHavingBytesArgSepMixin\nChildrenExpressionBytesOperationRpartitionMixin = ChildrenHavingBytesArgSepMixin\nChildrenExpressionBytesOperationRsplit2Mixin = ChildrenHavingBytesArgSepMixin\nChildrenExpressionBytesOperationSplit2Mixin = ChildrenHavingBytesArgSepMixin\n\n\nclass ChildrenHavingBytesArgSepMaxsplitMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationRsplit3\n    #   ExpressionBytesOperationSplit3\n\n    def __init__(\n        self,\n        bytes_arg,\n        sep,\n        maxsplit,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        sep.parent = self\n\n        self.subnode_sep = sep\n\n        maxsplit.parent = self\n\n        self.subnode_maxsplit = maxsplit\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_sep,\n            self.subnode_maxsplit,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"sep\", self.subnode_sep),\n            (\"maxsplit\", self.subnode_maxsplit),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_sep\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sep = new_node\n\n            return\n\n        value = self.subnode_maxsplit\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_maxsplit = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"sep\": self.subnode_sep.makeClone(),\n            \"maxsplit\": self.subnode_maxsplit.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_sep.finalize()\n        del self.subnode_sep\n        self.subnode_maxsplit.finalize()\n        del self.subnode_maxsplit\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sep.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_maxsplit.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationRsplit3Mixin = ChildrenHavingBytesArgSepMaxsplitMixin\nChildrenExpressionBytesOperationSplit3Mixin = ChildrenHavingBytesArgSepMaxsplitMixin\n\n\nclass ChildrenHavingBytesArgSubMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCount2\n    #   ExpressionBytesOperationFind2\n    #   ExpressionBytesOperationIndex2\n    #   ExpressionBytesOperationRfind2\n    #   ExpressionBytesOperationRindex2\n\n    def __init__(\n        self,\n        bytes_arg,\n        sub,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_sub,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"sub\", self.subnode_sub),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCount2Mixin = ChildrenHavingBytesArgSubMixin\nChildrenExpressionBytesOperationFind2Mixin = ChildrenHavingBytesArgSubMixin\nChildrenExpressionBytesOperationIndex2Mixin = ChildrenHavingBytesArgSubMixin\nChildrenExpressionBytesOperationRfind2Mixin = ChildrenHavingBytesArgSubMixin\nChildrenExpressionBytesOperationRindex2Mixin = ChildrenHavingBytesArgSubMixin\n\n\nclass ChildrenHavingBytesArgSubStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCount3\n    #   ExpressionBytesOperationFind3\n    #   ExpressionBytesOperationIndex3\n    #   ExpressionBytesOperationRfind3\n    #   ExpressionBytesOperationRindex3\n\n    def __init__(\n        self,\n        bytes_arg,\n        sub,\n        start,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_sub,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"sub\", self.subnode_sub),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCount3Mixin = ChildrenHavingBytesArgSubStartMixin\nChildrenExpressionBytesOperationFind3Mixin = ChildrenHavingBytesArgSubStartMixin\nChildrenExpressionBytesOperationIndex3Mixin = ChildrenHavingBytesArgSubStartMixin\nChildrenExpressionBytesOperationRfind3Mixin = ChildrenHavingBytesArgSubStartMixin\nChildrenExpressionBytesOperationRindex3Mixin = ChildrenHavingBytesArgSubStartMixin\n\n\nclass ChildrenHavingBytesArgSubStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCount4\n    #   ExpressionBytesOperationFind4\n    #   ExpressionBytesOperationIndex4\n    #   ExpressionBytesOperationRfind4\n    #   ExpressionBytesOperationRindex4\n\n    def __init__(\n        self,\n        bytes_arg,\n        sub,\n        start,\n        end,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_sub,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"sub\", self.subnode_sub),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCount4Mixin = ChildrenHavingBytesArgSubStartEndMixin\nChildrenExpressionBytesOperationFind4Mixin = ChildrenHavingBytesArgSubStartEndMixin\nChildrenExpressionBytesOperationIndex4Mixin = ChildrenHavingBytesArgSubStartEndMixin\nChildrenExpressionBytesOperationRfind4Mixin = ChildrenHavingBytesArgSubStartEndMixin\nChildrenExpressionBytesOperationRindex4Mixin = ChildrenHavingBytesArgSubStartEndMixin\n\n\nclass ChildrenHavingBytesArgSuffixMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationEndswith2\n\n    def __init__(\n        self,\n        bytes_arg,\n        suffix,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_suffix,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"suffix\", self.subnode_suffix),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationEndswith2Mixin = ChildrenHavingBytesArgSuffixMixin\n\n\nclass ChildrenHavingBytesArgSuffixStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationEndswith3\n\n    def __init__(\n        self,\n        bytes_arg,\n        suffix,\n        start,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_suffix,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"suffix\", self.subnode_suffix),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationEndswith3Mixin = ChildrenHavingBytesArgSuffixStartMixin\n\n\nclass ChildrenHavingBytesArgSuffixStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationEndswith4\n\n    def __init__(\n        self,\n        bytes_arg,\n        suffix,\n        start,\n        end,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_suffix,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"suffix\", self.subnode_suffix),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationEndswith4Mixin = (\n    ChildrenHavingBytesArgSuffixStartEndMixin\n)\n\n\nclass ChildrenHavingBytesArgTableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationTranslate2\n\n    def __init__(\n        self,\n        bytes_arg,\n        table,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        table.parent = self\n\n        self.subnode_table = table\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_table,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"table\", self.subnode_table),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_table\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_table = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"table\": self.subnode_table.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_table.finalize()\n        del self.subnode_table\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_table.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationTranslate2Mixin = ChildrenHavingBytesArgTableMixin\n\n\nclass ChildrenHavingBytesArgTableDeleteMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationTranslate3\n\n    def __init__(\n        self,\n        bytes_arg,\n        table,\n        delete,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        table.parent = self\n\n        self.subnode_table = table\n\n        delete.parent = self\n\n        self.subnode_delete = delete\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_table,\n            self.subnode_delete,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"table\", self.subnode_table),\n            (\"delete\", self.subnode_delete),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_table\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_table = new_node\n\n            return\n\n        value = self.subnode_delete\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_delete = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"table\": self.subnode_table.makeClone(),\n            \"delete\": self.subnode_delete.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_table.finalize()\n        del self.subnode_table\n        self.subnode_delete.finalize()\n        del self.subnode_delete\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_table.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_delete.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationTranslate3Mixin = ChildrenHavingBytesArgTableDeleteMixin\n\n\nclass ChildrenHavingBytesArgTabsizeMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationExpandtabs2\n\n    def __init__(\n        self,\n        bytes_arg,\n        tabsize,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        tabsize.parent = self\n\n        self.subnode_tabsize = tabsize\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_tabsize,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"tabsize\", self.subnode_tabsize),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_tabsize\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_tabsize = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"tabsize\": self.subnode_tabsize.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_tabsize.finalize()\n        del self.subnode_tabsize\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_tabsize.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationExpandtabs2Mixin = ChildrenHavingBytesArgTabsizeMixin\n\n\nclass ChildrenHavingBytesArgWidthMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCenter2\n    #   ExpressionBytesOperationLjust2\n    #   ExpressionBytesOperationRjust2\n    #   ExpressionBytesOperationZfill\n\n    def __init__(\n        self,\n        bytes_arg,\n        width,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        width.parent = self\n\n        self.subnode_width = width\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_width,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"width\", self.subnode_width),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_width\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_width = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"width\": self.subnode_width.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_width.finalize()\n        del self.subnode_width\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_width.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCenter2Mixin = ChildrenHavingBytesArgWidthMixin\nChildrenExpressionBytesOperationLjust2Mixin = ChildrenHavingBytesArgWidthMixin\nChildrenExpressionBytesOperationRjust2Mixin = ChildrenHavingBytesArgWidthMixin\nChildrenExpressionBytesOperationZfillMixin = ChildrenHavingBytesArgWidthMixin\n\n\nclass ChildrenHavingBytesArgWidthFillcharMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBytesOperationCenter3\n    #   ExpressionBytesOperationLjust3\n    #   ExpressionBytesOperationRjust3\n\n    def __init__(\n        self,\n        bytes_arg,\n        width,\n        fillchar,\n    ):\n        bytes_arg.parent = self\n\n        self.subnode_bytes_arg = bytes_arg\n\n        width.parent = self\n\n        self.subnode_width = width\n\n        fillchar.parent = self\n\n        self.subnode_fillchar = fillchar\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_bytes_arg,\n            self.subnode_width,\n            self.subnode_fillchar,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"bytes_arg\", self.subnode_bytes_arg),\n            (\"width\", self.subnode_width),\n            (\"fillchar\", self.subnode_fillchar),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_bytes_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bytes_arg = new_node\n\n            return\n\n        value = self.subnode_width\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_width = new_node\n\n            return\n\n        value = self.subnode_fillchar\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_fillchar = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"bytes_arg\": self.subnode_bytes_arg.makeClone(),\n            \"width\": self.subnode_width.makeClone(),\n            \"fillchar\": self.subnode_fillchar.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_bytes_arg.finalize()\n        del self.subnode_bytes_arg\n        self.subnode_width.finalize()\n        del self.subnode_width\n        self.subnode_fillchar.finalize()\n        del self.subnode_fillchar\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_bytes_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_width.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_fillchar.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBytesOperationCenter3Mixin = ChildrenHavingBytesArgWidthFillcharMixin\nChildrenExpressionBytesOperationLjust3Mixin = ChildrenHavingBytesArgWidthFillcharMixin\nChildrenExpressionBytesOperationRjust3Mixin = ChildrenHavingBytesArgWidthFillcharMixin\n\n\nclass ChildHavingCalledMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCallEmpty\n\n    def __init__(\n        self,\n        called,\n    ):\n        called.parent = self\n\n        self.subnode_called = called\n\n    def setChildCalled(self, value):\n        value.parent = self\n\n        self.subnode_called = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_called,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"called\", self.subnode_called),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_called\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_called = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"called\": self.subnode_called.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_called.finalize()\n        del self.subnode_called\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_called)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_called.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCallEmptyMixin = ChildHavingCalledMixin\n\n\nclass ChildrenHavingCalledArgsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCallNoKeywords\n\n    def __init__(\n        self,\n        called,\n        args,\n    ):\n        called.parent = self\n\n        self.subnode_called = called\n\n        args.parent = self\n\n        self.subnode_args = args\n\n    def setChildCalled(self, value):\n        value.parent = self\n\n        self.subnode_called = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_called,\n            self.subnode_args,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"called\", self.subnode_called),\n            (\"args\", self.subnode_args),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_called\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_called = new_node\n\n            return\n\n        value = self.subnode_args\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_args = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"called\": self.subnode_called.makeClone(),\n            \"args\": self.subnode_args.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_called.finalize()\n        del self.subnode_called\n        self.subnode_args.finalize()\n        del self.subnode_args\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_called.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_args.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCallNoKeywordsMixin = ChildrenHavingCalledArgsMixin\n\n\nclass ChildrenHavingCalledArgsKwargsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCall\n\n    def __init__(\n        self,\n        called,\n        args,\n        kwargs,\n    ):\n        called.parent = self\n\n        self.subnode_called = called\n\n        args.parent = self\n\n        self.subnode_args = args\n\n        kwargs.parent = self\n\n        self.subnode_kwargs = kwargs\n\n    def setChildCalled(self, value):\n        value.parent = self\n\n        self.subnode_called = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_called,\n            self.subnode_args,\n            self.subnode_kwargs,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"called\", self.subnode_called),\n            (\"args\", self.subnode_args),\n            (\"kwargs\", self.subnode_kwargs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_called\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_called = new_node\n\n            return\n\n        value = self.subnode_args\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_args = new_node\n\n            return\n\n        value = self.subnode_kwargs\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_kwargs = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"called\": self.subnode_called.makeClone(),\n            \"args\": self.subnode_args.makeClone(),\n            \"kwargs\": self.subnode_kwargs.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_called.finalize()\n        del self.subnode_called\n        self.subnode_args.finalize()\n        del self.subnode_args\n        self.subnode_kwargs.finalize()\n        del self.subnode_kwargs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_called.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_args.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_kwargs.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCallMixin = ChildrenHavingCalledArgsKwargsMixin\n\n\nclass ChildrenHavingCalledKwargsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCallKeywordsOnly\n\n    def __init__(\n        self,\n        called,\n        kwargs,\n    ):\n        called.parent = self\n\n        self.subnode_called = called\n\n        kwargs.parent = self\n\n        self.subnode_kwargs = kwargs\n\n    def setChildCalled(self, value):\n        value.parent = self\n\n        self.subnode_called = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_called,\n            self.subnode_kwargs,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"called\", self.subnode_called),\n            (\"kwargs\", self.subnode_kwargs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_called\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_called = new_node\n\n            return\n\n        value = self.subnode_kwargs\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_kwargs = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"called\": self.subnode_called.makeClone(),\n            \"kwargs\": self.subnode_kwargs.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_called.finalize()\n        del self.subnode_called\n        self.subnode_kwargs.finalize()\n        del self.subnode_kwargs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_called.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_kwargs.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCallKeywordsOnlyMixin = ChildrenHavingCalledKwargsMixin\n\n\nclass ChildHavingClsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionTypeCheck\n\n    def __init__(\n        self,\n        cls,\n    ):\n        cls.parent = self\n\n        self.subnode_cls = cls\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_cls,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"cls\", self.subnode_cls),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_cls\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_cls = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"cls\": self.subnode_cls.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_cls.finalize()\n        del self.subnode_cls\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_cls)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_cls.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionTypeCheckMixin = ChildHavingClsMixin\n\n\nclass ChildrenHavingClsClassesMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinIssubclass\n\n    def __init__(\n        self,\n        cls,\n        classes,\n    ):\n        cls.parent = self\n\n        self.subnode_cls = cls\n\n        classes.parent = self\n\n        self.subnode_classes = classes\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_cls,\n            self.subnode_classes,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"cls\", self.subnode_cls),\n            (\"classes\", self.subnode_classes),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_cls\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_cls = new_node\n\n            return\n\n        value = self.subnode_classes\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_classes = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"cls\": self.subnode_cls.makeClone(),\n            \"classes\": self.subnode_classes.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_cls.finalize()\n        del self.subnode_cls\n        self.subnode_classes.finalize()\n        del self.subnode_classes\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_cls.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_classes.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinIssubclassMixin = ChildrenHavingClsClassesMixin\n\n\nclass ChildrenHavingConditionExpressionYesExpressionNoMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionConditional\n\n    def __init__(\n        self,\n        condition,\n        expression_yes,\n        expression_no,\n    ):\n        condition.parent = self\n\n        self.subnode_condition = condition\n\n        expression_yes.parent = self\n\n        self.subnode_expression_yes = expression_yes\n\n        expression_no.parent = self\n\n        self.subnode_expression_no = expression_no\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_condition,\n            self.subnode_expression_yes,\n            self.subnode_expression_no,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"condition\", self.subnode_condition),\n            (\"expression_yes\", self.subnode_expression_yes),\n            (\"expression_no\", self.subnode_expression_no),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_condition\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_condition = new_node\n\n            return\n\n        value = self.subnode_expression_yes\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression_yes = new_node\n\n            return\n\n        value = self.subnode_expression_no\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression_no = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"condition\": self.subnode_condition.makeClone(),\n            \"expression_yes\": self.subnode_expression_yes.makeClone(),\n            \"expression_no\": self.subnode_expression_no.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_condition.finalize()\n        del self.subnode_condition\n        self.subnode_expression_yes.finalize()\n        del self.subnode_expression_yes\n        self.subnode_expression_no.finalize()\n        del self.subnode_expression_no\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_condition.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_expression_yes.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_expression_no.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionConditionalMixin = (\n    ChildrenHavingConditionExpressionYesExpressionNoMixin\n)\n\n\nclass ChildHavingCoroutineRefMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionMakeCoroutineObject\n\n    def __init__(\n        self,\n        coroutine_ref,\n    ):\n        coroutine_ref.parent = self\n\n        self.subnode_coroutine_ref = coroutine_ref\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_coroutine_ref,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"coroutine_ref\", self.subnode_coroutine_ref),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_coroutine_ref\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_coroutine_ref = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"coroutine_ref\": self.subnode_coroutine_ref.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_coroutine_ref.finalize()\n        del self.subnode_coroutine_ref\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_coroutine_ref)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_coroutine_ref.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionMakeCoroutineObjectMixin = ChildHavingCoroutineRefMixin\n\n\nclass ChildrenHavingDefaultsTupleKwDefaultsOptionalAnnotationsOptionalFunctionRefMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionFunctionCreation\n\n    def __init__(\n        self,\n        defaults,\n        kw_defaults,\n        annotations,\n        function_ref,\n    ):\n        assert type(defaults) is tuple\n\n        for val in defaults:\n            val.parent = self\n\n        self.subnode_defaults = defaults\n\n        if kw_defaults is not None:\n            kw_defaults.parent = self\n\n        self.subnode_kw_defaults = kw_defaults\n\n        if annotations is not None:\n            annotations.parent = self\n\n        self.subnode_annotations = annotations\n\n        function_ref.parent = self\n\n        self.subnode_function_ref = function_ref\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.extend(self.subnode_defaults)\n        value = self.subnode_kw_defaults\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_annotations\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_function_ref)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"defaults\", self.subnode_defaults),\n            (\"kw_defaults\", self.subnode_kw_defaults),\n            (\"annotations\", self.subnode_annotations),\n            (\"function_ref\", self.subnode_function_ref),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_defaults\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_defaults = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_defaults = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        value = self.subnode_kw_defaults\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_kw_defaults = new_node\n\n            return\n\n        value = self.subnode_annotations\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_annotations = new_node\n\n            return\n\n        value = self.subnode_function_ref\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_function_ref = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"defaults\": tuple(v.makeClone() for v in self.subnode_defaults),\n            \"kw_defaults\": (\n                self.subnode_kw_defaults.makeClone()\n                if self.subnode_kw_defaults is not None\n                else None\n            ),\n            \"annotations\": (\n                self.subnode_annotations.makeClone()\n                if self.subnode_annotations is not None\n                else None\n            ),\n            \"function_ref\": self.subnode_function_ref.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_defaults:\n            c.finalize()\n        del self.subnode_defaults\n        if self.subnode_kw_defaults is not None:\n            self.subnode_kw_defaults.finalize()\n        del self.subnode_kw_defaults\n        if self.subnode_annotations is not None:\n            self.subnode_annotations.finalize()\n        del self.subnode_annotations\n        self.subnode_function_ref.finalize()\n        del self.subnode_function_ref\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_defaults:\n            element.collectVariableAccesses(emit_read, emit_write)\n        subnode_kw_defaults = self.subnode_kw_defaults\n\n        if subnode_kw_defaults is not None:\n            self.subnode_kw_defaults.collectVariableAccesses(emit_read, emit_write)\n        subnode_annotations = self.subnode_annotations\n\n        if subnode_annotations is not None:\n            self.subnode_annotations.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_function_ref.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionFunctionCreationMixin = (\n    ChildrenHavingDefaultsTupleKwDefaultsOptionalAnnotationsOptionalFunctionRefMixin\n)\n\n\nclass ChildHavingDictArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationClear\n    #   ExpressionDictOperationCopy\n    #   ExpressionDictOperationItems\n    #   ExpressionDictOperationItemsBase\n    #   ExpressionDictOperationIteritems\n    #   ExpressionDictOperationIteritemsBase\n    #   ExpressionDictOperationIterkeys\n    #   ExpressionDictOperationIterkeysBase\n    #   ExpressionDictOperationItervalues\n    #   ExpressionDictOperationItervaluesBase\n    #   ExpressionDictOperationKeys\n    #   ExpressionDictOperationKeysBase\n    #   ExpressionDictOperationPopitem\n    #   ExpressionDictOperationValues\n    #   ExpressionDictOperationValuesBase\n    #   ExpressionDictOperationViewitems\n    #   ExpressionDictOperationViewitemsBase\n    #   ExpressionDictOperationViewkeys\n    #   ExpressionDictOperationViewkeysBase\n    #   ExpressionDictOperationViewvalues\n    #   ExpressionDictOperationViewvaluesBase\n\n    def __init__(\n        self,\n        dict_arg,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_dict_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"dict_arg\", self.subnode_dict_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_dict_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationClearMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationCopyMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationItemsMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationItemsBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationIteritemsMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationIteritemsBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationIterkeysMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationIterkeysBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationItervaluesMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationItervaluesBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationKeysMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationKeysBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationPopitemMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationValuesMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationValuesBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewitemsMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewitemsBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewkeysMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewkeysBaseMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewvaluesMixin = ChildHavingDictArgMixin\nChildrenExpressionDictOperationViewvaluesBaseMixin = ChildHavingDictArgMixin\n\n\nclass ChildrenHavingDictArgIterableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationUpdate2\n\n    def __init__(\n        self,\n        dict_arg,\n        iterable,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_dict_arg,\n            self.subnode_iterable,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"iterable\", self.subnode_iterable),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"iterable\": self.subnode_iterable.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationUpdate2Mixin = ChildrenHavingDictArgIterableMixin\n\n\nclass ChildrenHavingDictArgIterablePairsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationUpdate3\n\n    def __init__(\n        self,\n        dict_arg,\n        iterable,\n        pairs,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_dict_arg)\n        result.append(self.subnode_iterable)\n        result.extend(self.subnode_pairs)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"iterable\", self.subnode_iterable),\n            (\"pairs\", self.subnode_pairs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"iterable\": self.subnode_iterable.makeClone(),\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationUpdate3Mixin = (\n    ChildrenHavingDictArgIterablePairsTupleMixin\n)\n\n\nclass ChildrenHavingDictArgKeyMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationGet2\n    #   ExpressionDictOperationHaskey\n    #   ExpressionDictOperationItem\n    #   ExpressionDictOperationPop2\n    #   ExpressionDictOperationSetdefault2\n\n    def __init__(\n        self,\n        dict_arg,\n        key,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        key.parent = self\n\n        self.subnode_key = key\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_dict_arg,\n            self.subnode_key,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"key\", self.subnode_key),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_key.finalize()\n        del self.subnode_key\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationGet2Mixin = ChildrenHavingDictArgKeyMixin\nChildrenExpressionDictOperationHaskeyMixin = ChildrenHavingDictArgKeyMixin\nChildrenExpressionDictOperationItemMixin = ChildrenHavingDictArgKeyMixin\nChildrenExpressionDictOperationPop2Mixin = ChildrenHavingDictArgKeyMixin\nChildrenExpressionDictOperationSetdefault2Mixin = ChildrenHavingDictArgKeyMixin\n\n\nclass ChildrenHavingDictArgKeyDefaultMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationGet3\n    #   ExpressionDictOperationPop3\n    #   ExpressionDictOperationSetdefault3\n\n    def __init__(\n        self,\n        dict_arg,\n        key,\n        default,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        key.parent = self\n\n        self.subnode_key = key\n\n        default.parent = self\n\n        self.subnode_default = default\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_dict_arg,\n            self.subnode_key,\n            self.subnode_default,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"key\", self.subnode_key),\n            (\"default\", self.subnode_default),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        value = self.subnode_default\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_default = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n            \"default\": self.subnode_default.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_key.finalize()\n        del self.subnode_key\n        self.subnode_default.finalize()\n        del self.subnode_default\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_default.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationGet3Mixin = ChildrenHavingDictArgKeyDefaultMixin\nChildrenExpressionDictOperationPop3Mixin = ChildrenHavingDictArgKeyDefaultMixin\nChildrenExpressionDictOperationSetdefault3Mixin = ChildrenHavingDictArgKeyDefaultMixin\n\n\nclass ChildrenHavingDictArgPairsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationUpdatePairs\n\n    def __init__(\n        self,\n        dict_arg,\n        pairs,\n    ):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_dict_arg)\n        result.extend(self.subnode_pairs)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"pairs\", self.subnode_pairs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationUpdatePairsMixin = ChildrenHavingDictArgPairsTupleMixin\n\n\nclass ChildHavingDistMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionPkgResourcesGetDistribution\n    #   ExpressionPkgResourcesGetDistributionCall\n\n    def __init__(\n        self,\n        dist,\n    ):\n        dist.parent = self\n\n        self.subnode_dist = dist\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_dist,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"dist\", self.subnode_dist),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dist\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dist = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dist\": self.subnode_dist.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dist.finalize()\n        del self.subnode_dist\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_dist)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dist.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionPkgResourcesGetDistributionMixin = ChildHavingDistMixin\nChildrenExpressionPkgResourcesGetDistributionCallMixin = ChildHavingDistMixin\n\n\nclass ChildHavingDistributionNameMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportDistribution\n    #   ExpressionImportlibMetadataBackportDistributionCall\n    #   ExpressionImportlibMetadataBackportMetadata\n    #   ExpressionImportlibMetadataBackportVersion\n    #   ExpressionImportlibMetadataBackportVersionCall\n    #   ExpressionImportlibMetadataDistribution\n    #   ExpressionImportlibMetadataDistributionCall\n    #   ExpressionImportlibMetadataMetadata\n    #   ExpressionImportlibMetadataVersion\n    #   ExpressionImportlibMetadataVersionCall\n\n    def __init__(\n        self,\n        distribution_name,\n    ):\n        distribution_name.parent = self\n\n        self.subnode_distribution_name = distribution_name\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_distribution_name,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"distribution_name\", self.subnode_distribution_name),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_distribution_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_distribution_name = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"distribution_name\": self.subnode_distribution_name.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_distribution_name.finalize()\n        del self.subnode_distribution_name\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_distribution_name)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_distribution_name.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibMetadataBackportDistributionMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataBackportDistributionCallMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataBackportMetadataMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataBackportVersionMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataBackportVersionCallMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataDistributionMixin = ChildHavingDistributionNameMixin\nChildrenExpressionImportlibMetadataDistributionCallMixin = (\n    ChildHavingDistributionNameMixin\n)\nChildrenExpressionImportlibMetadataMetadataMixin = ChildHavingDistributionNameMixin\nChildrenExpressionImportlibMetadataVersionMixin = ChildHavingDistributionNameMixin\nChildrenExpressionImportlibMetadataVersionCallMixin = ChildHavingDistributionNameMixin\n\n\nclass ChildHavingElementsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionMakeList\n    #   ExpressionMakeSet\n    #   ExpressionMakeSetLiteral\n    #   ExpressionMakeTuple\n\n    def __init__(\n        self,\n        elements,\n    ):\n        assert type(elements) is tuple\n\n        for val in elements:\n            val.parent = self\n\n        self.subnode_elements = elements\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_elements\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"elements\", self.subnode_elements),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_elements\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_elements = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_elements = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"elements\": tuple(v.makeClone() for v in self.subnode_elements),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_elements:\n            c.finalize()\n        del self.subnode_elements\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_elements = self.subnode_elements\n\n        for sub_expression in old_subnode_elements:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_elements[\n                        : old_subnode_elements.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_elements:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionMakeListMixin = ChildHavingElementsTupleMixin\nChildrenExpressionMakeSetMixin = ChildHavingElementsTupleMixin\nChildrenExpressionMakeSetLiteralMixin = ChildHavingElementsTupleMixin\nChildrenExpressionMakeTupleMixin = ChildHavingElementsTupleMixin\n\n\nclass ChildrenHavingExceptionTypeExceptionValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionRaiseException\n\n    def __init__(\n        self,\n        exception_type,\n        exception_value,\n    ):\n        exception_type.parent = self\n\n        self.subnode_exception_type = exception_type\n\n        exception_value.parent = self\n\n        self.subnode_exception_value = exception_value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_exception_type,\n            self.subnode_exception_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"exception_type\", self.subnode_exception_type),\n            (\"exception_value\", self.subnode_exception_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_exception_type\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_exception_type = new_node\n\n            return\n\n        value = self.subnode_exception_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_exception_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"exception_type\": self.subnode_exception_type.makeClone(),\n            \"exception_value\": self.subnode_exception_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_exception_type.finalize()\n        del self.subnode_exception_type\n        self.subnode_exception_value.finalize()\n        del self.subnode_exception_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_exception_type.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_exception_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionRaiseExceptionMixin = ChildrenHavingExceptionTypeExceptionValueMixin\n\n\nclass ChildHavingExitCodeOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSysExit\n\n    def __init__(\n        self,\n        exit_code,\n    ):\n        if exit_code is not None:\n            exit_code.parent = self\n\n        self.subnode_exit_code = exit_code\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_exit_code\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"exit_code\", self.subnode_exit_code),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_exit_code\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_exit_code = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"exit_code\": (\n                self.subnode_exit_code.makeClone()\n                if self.subnode_exit_code is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_exit_code is not None:\n            self.subnode_exit_code.finalize()\n        del self.subnode_exit_code\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = self.subnode_exit_code\n\n        if expression is not None:\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                return (\n                    expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_exit_code = self.subnode_exit_code\n\n        if subnode_exit_code is not None:\n            self.subnode_exit_code.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSysExitMixin = ChildHavingExitCodeOptionalMixin\n\n\nclass ChildHavingExpressionMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionAsyncWait\n    #   ExpressionAsyncWaitEnter\n    #   ExpressionAsyncWaitExit\n    #   ExpressionAttributeCheck\n    #   ExpressionAttributeLookupBytesCapitalize\n    #   ExpressionAttributeLookupBytesCenter\n    #   ExpressionAttributeLookupBytesCount\n    #   ExpressionAttributeLookupBytesDecode\n    #   ExpressionAttributeLookupBytesEndswith\n    #   ExpressionAttributeLookupBytesExpandtabs\n    #   ExpressionAttributeLookupBytesFind\n    #   ExpressionAttributeLookupBytesIndex\n    #   ExpressionAttributeLookupBytesIsalnum\n    #   ExpressionAttributeLookupBytesIsalpha\n    #   ExpressionAttributeLookupBytesIsdigit\n    #   ExpressionAttributeLookupBytesIslower\n    #   ExpressionAttributeLookupBytesIsspace\n    #   ExpressionAttributeLookupBytesIstitle\n    #   ExpressionAttributeLookupBytesIsupper\n    #   ExpressionAttributeLookupBytesJoin\n    #   ExpressionAttributeLookupBytesLjust\n    #   ExpressionAttributeLookupBytesLower\n    #   ExpressionAttributeLookupBytesLstrip\n    #   ExpressionAttributeLookupBytesPartition\n    #   ExpressionAttributeLookupBytesReplace\n    #   ExpressionAttributeLookupBytesRfind\n    #   ExpressionAttributeLookupBytesRindex\n    #   ExpressionAttributeLookupBytesRjust\n    #   ExpressionAttributeLookupBytesRpartition\n    #   ExpressionAttributeLookupBytesRsplit\n    #   ExpressionAttributeLookupBytesRstrip\n    #   ExpressionAttributeLookupBytesSplit\n    #   ExpressionAttributeLookupBytesSplitlines\n    #   ExpressionAttributeLookupBytesStartswith\n    #   ExpressionAttributeLookupBytesStrip\n    #   ExpressionAttributeLookupBytesSwapcase\n    #   ExpressionAttributeLookupBytesTitle\n    #   ExpressionAttributeLookupBytesTranslate\n    #   ExpressionAttributeLookupBytesUpper\n    #   ExpressionAttributeLookupBytesZfill\n    #   ExpressionAttributeLookupDictClear\n    #   ExpressionAttributeLookupDictCopy\n    #   ExpressionAttributeLookupDictFromkeys\n    #   ExpressionAttributeLookupDictGet\n    #   ExpressionAttributeLookupDictHaskey\n    #   ExpressionAttributeLookupDictItems\n    #   ExpressionAttributeLookupDictIteritems\n    #   ExpressionAttributeLookupDictIterkeys\n    #   ExpressionAttributeLookupDictItervalues\n    #   ExpressionAttributeLookupDictKeys\n    #   ExpressionAttributeLookupDictPop\n    #   ExpressionAttributeLookupDictPopitem\n    #   ExpressionAttributeLookupDictSetdefault\n    #   ExpressionAttributeLookupDictUpdate\n    #   ExpressionAttributeLookupDictValues\n    #   ExpressionAttributeLookupDictViewitems\n    #   ExpressionAttributeLookupDictViewkeys\n    #   ExpressionAttributeLookupDictViewvalues\n    #   ExpressionAttributeLookupFixedAppend\n    #   ExpressionAttributeLookupFixedCapitalize\n    #   ExpressionAttributeLookupFixedCasefold\n    #   ExpressionAttributeLookupFixedCenter\n    #   ExpressionAttributeLookupFixedClear\n    #   ExpressionAttributeLookupFixedCopy\n    #   ExpressionAttributeLookupFixedCount\n    #   ExpressionAttributeLookupFixedDecode\n    #   ExpressionAttributeLookupFixedEncode\n    #   ExpressionAttributeLookupFixedEndswith\n    #   ExpressionAttributeLookupFixedExpandtabs\n    #   ExpressionAttributeLookupFixedExtend\n    #   ExpressionAttributeLookupFixedFind\n    #   ExpressionAttributeLookupFixedFormat\n    #   ExpressionAttributeLookupFixedFormatmap\n    #   ExpressionAttributeLookupFixedFromkeys\n    #   ExpressionAttributeLookupFixedGet\n    #   ExpressionAttributeLookupFixedHaskey\n    #   ExpressionAttributeLookupFixedIndex\n    #   ExpressionAttributeLookupFixedInsert\n    #   ExpressionAttributeLookupFixedIsalnum\n    #   ExpressionAttributeLookupFixedIsalpha\n    #   ExpressionAttributeLookupFixedIsascii\n    #   ExpressionAttributeLookupFixedIsdecimal\n    #   ExpressionAttributeLookupFixedIsdigit\n    #   ExpressionAttributeLookupFixedIsidentifier\n    #   ExpressionAttributeLookupFixedIslower\n    #   ExpressionAttributeLookupFixedIsnumeric\n    #   ExpressionAttributeLookupFixedIsprintable\n    #   ExpressionAttributeLookupFixedIsspace\n    #   ExpressionAttributeLookupFixedIstitle\n    #   ExpressionAttributeLookupFixedIsupper\n    #   ExpressionAttributeLookupFixedItems\n    #   ExpressionAttributeLookupFixedIteritems\n    #   ExpressionAttributeLookupFixedIterkeys\n    #   ExpressionAttributeLookupFixedItervalues\n    #   ExpressionAttributeLookupFixedJoin\n    #   ExpressionAttributeLookupFixedKeys\n    #   ExpressionAttributeLookupFixedLjust\n    #   ExpressionAttributeLookupFixedLower\n    #   ExpressionAttributeLookupFixedLstrip\n    #   ExpressionAttributeLookupFixedMaketrans\n    #   ExpressionAttributeLookupFixedPartition\n    #   ExpressionAttributeLookupFixedPop\n    #   ExpressionAttributeLookupFixedPopitem\n    #   ExpressionAttributeLookupFixedPrepare\n    #   ExpressionAttributeLookupFixedRemove\n    #   ExpressionAttributeLookupFixedReplace\n    #   ExpressionAttributeLookupFixedReverse\n    #   ExpressionAttributeLookupFixedRfind\n    #   ExpressionAttributeLookupFixedRindex\n    #   ExpressionAttributeLookupFixedRjust\n    #   ExpressionAttributeLookupFixedRpartition\n    #   ExpressionAttributeLookupFixedRsplit\n    #   ExpressionAttributeLookupFixedRstrip\n    #   ExpressionAttributeLookupFixedSetdefault\n    #   ExpressionAttributeLookupFixedSort\n    #   ExpressionAttributeLookupFixedSplit\n    #   ExpressionAttributeLookupFixedSplitlines\n    #   ExpressionAttributeLookupFixedStartswith\n    #   ExpressionAttributeLookupFixedStrip\n    #   ExpressionAttributeLookupFixedSwapcase\n    #   ExpressionAttributeLookupFixedTitle\n    #   ExpressionAttributeLookupFixedTranslate\n    #   ExpressionAttributeLookupFixedUpdate\n    #   ExpressionAttributeLookupFixedUpper\n    #   ExpressionAttributeLookupFixedValues\n    #   ExpressionAttributeLookupFixedViewitems\n    #   ExpressionAttributeLookupFixedViewkeys\n    #   ExpressionAttributeLookupFixedViewvalues\n    #   ExpressionAttributeLookupFixedZfill\n    #   ExpressionAttributeLookupListAppend\n    #   ExpressionAttributeLookupListClear\n    #   ExpressionAttributeLookupListCopy\n    #   ExpressionAttributeLookupListCount\n    #   ExpressionAttributeLookupListExtend\n    #   ExpressionAttributeLookupListIndex\n    #   ExpressionAttributeLookupListInsert\n    #   ExpressionAttributeLookupListPop\n    #   ExpressionAttributeLookupListRemove\n    #   ExpressionAttributeLookupListReverse\n    #   ExpressionAttributeLookupListSort\n    #   ExpressionAttributeLookupStrCapitalize\n    #   ExpressionAttributeLookupStrCasefold\n    #   ExpressionAttributeLookupStrCenter\n    #   ExpressionAttributeLookupStrCount\n    #   ExpressionAttributeLookupStrDecode\n    #   ExpressionAttributeLookupStrEncode\n    #   ExpressionAttributeLookupStrEndswith\n    #   ExpressionAttributeLookupStrExpandtabs\n    #   ExpressionAttributeLookupStrFind\n    #   ExpressionAttributeLookupStrFormat\n    #   ExpressionAttributeLookupStrFormatmap\n    #   ExpressionAttributeLookupStrIndex\n    #   ExpressionAttributeLookupStrIsalnum\n    #   ExpressionAttributeLookupStrIsalpha\n    #   ExpressionAttributeLookupStrIsascii\n    #   ExpressionAttributeLookupStrIsdecimal\n    #   ExpressionAttributeLookupStrIsdigit\n    #   ExpressionAttributeLookupStrIsidentifier\n    #   ExpressionAttributeLookupStrIslower\n    #   ExpressionAttributeLookupStrIsnumeric\n    #   ExpressionAttributeLookupStrIsprintable\n    #   ExpressionAttributeLookupStrIsspace\n    #   ExpressionAttributeLookupStrIstitle\n    #   ExpressionAttributeLookupStrIsupper\n    #   ExpressionAttributeLookupStrJoin\n    #   ExpressionAttributeLookupStrLjust\n    #   ExpressionAttributeLookupStrLower\n    #   ExpressionAttributeLookupStrLstrip\n    #   ExpressionAttributeLookupStrMaketrans\n    #   ExpressionAttributeLookupStrPartition\n    #   ExpressionAttributeLookupStrReplace\n    #   ExpressionAttributeLookupStrRfind\n    #   ExpressionAttributeLookupStrRindex\n    #   ExpressionAttributeLookupStrRjust\n    #   ExpressionAttributeLookupStrRpartition\n    #   ExpressionAttributeLookupStrRsplit\n    #   ExpressionAttributeLookupStrRstrip\n    #   ExpressionAttributeLookupStrSplit\n    #   ExpressionAttributeLookupStrSplitlines\n    #   ExpressionAttributeLookupStrStartswith\n    #   ExpressionAttributeLookupStrStrip\n    #   ExpressionAttributeLookupStrSwapcase\n    #   ExpressionAttributeLookupStrTitle\n    #   ExpressionAttributeLookupStrTranslate\n    #   ExpressionAttributeLookupStrUpper\n    #   ExpressionAttributeLookupStrZfill\n    #   ExpressionAttributeLookupTypePrepare\n    #   ExpressionMatchArgs\n    #   ExpressionYield\n    #   ExpressionYieldFrom\n    #   ExpressionYieldFromAwaitable\n\n    def __init__(\n        self,\n        expression,\n    ):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_expression,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"expression\", self.subnode_expression),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_expression)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionAsyncWaitMixin = ChildHavingExpressionMixin\nChildrenExpressionAsyncWaitEnterMixin = ChildHavingExpressionMixin\nChildrenExpressionAsyncWaitExitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeCheckMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesCapitalizeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesCenterMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesCountMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesDecodeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesEndswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesExpandtabsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesFindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIndexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIsalnumMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIsalphaMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIsdigitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIslowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIsspaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIstitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesIsupperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesJoinMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesLjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesLowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesLstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesPartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesReplaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRfindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRindexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRpartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRsplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesRstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesSplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesSplitlinesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesStartswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesStripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesSwapcaseMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesTitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesTranslateMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesUpperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupBytesZfillMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictClearMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictCopyMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictFromkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictGetMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictHaskeyMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictItemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictIteritemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictIterkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictItervaluesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictKeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictPopMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictPopitemMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictSetdefaultMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictUpdateMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictValuesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictViewitemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictViewkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupDictViewvaluesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedAppendMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedCapitalizeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedCasefoldMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedCenterMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedClearMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedCopyMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedCountMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedDecodeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedEncodeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedEndswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedExpandtabsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedExtendMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedFindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedFormatMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedFormatmapMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedFromkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedGetMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedHaskeyMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIndexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedInsertMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsalnumMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsalphaMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsasciiMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsdecimalMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsdigitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsidentifierMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIslowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsnumericMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsprintableMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsspaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIstitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIsupperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedItemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIteritemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedIterkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedItervaluesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedJoinMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedKeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedLjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedLowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedLstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedMaketransMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedPartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedPopMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedPopitemMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedPrepareMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRemoveMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedReplaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedReverseMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRfindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRindexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRpartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRsplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedRstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedSetdefaultMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedSortMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedSplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedSplitlinesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedStartswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedStripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedSwapcaseMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedTitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedTranslateMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedUpdateMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedUpperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedValuesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedViewitemsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedViewkeysMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedViewvaluesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupFixedZfillMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListAppendMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListClearMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListCopyMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListCountMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListExtendMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListIndexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListInsertMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListPopMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListRemoveMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListReverseMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupListSortMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrCapitalizeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrCasefoldMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrCenterMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrCountMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrDecodeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrEncodeMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrEndswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrExpandtabsMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrFindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrFormatMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrFormatmapMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIndexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsalnumMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsalphaMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsasciiMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsdecimalMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsdigitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsidentifierMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIslowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsnumericMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsprintableMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsspaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIstitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrIsupperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrJoinMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrLjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrLowerMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrLstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrMaketransMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrPartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrReplaceMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRfindMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRindexMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRjustMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRpartitionMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRsplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrRstripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrSplitMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrSplitlinesMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrStartswithMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrStripMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrSwapcaseMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrTitleMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrTranslateMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrUpperMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupStrZfillMixin = ChildHavingExpressionMixin\nChildrenExpressionAttributeLookupTypePrepareMixin = ChildHavingExpressionMixin\nChildrenExpressionMatchArgsMixin = ChildHavingExpressionMixin\nChildrenExpressionYieldMixin = ChildHavingExpressionMixin\nChildrenExpressionYieldFromMixin = ChildHavingExpressionMixin\nChildrenExpressionYieldFromAwaitableMixin = ChildHavingExpressionMixin\n\n\nclass ChildrenHavingExpressionLowerAutoNoneUpperAutoNoneMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSliceLookup\n\n    def __init__(\n        self,\n        expression,\n        lower,\n        upper,\n    ):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        lower = convertNoneConstantToNone(lower)\n        if lower is not None:\n            lower.parent = self\n\n        self.subnode_lower = lower\n\n        upper = convertNoneConstantToNone(upper)\n        if upper is not None:\n            upper.parent = self\n\n        self.subnode_upper = upper\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_expression)\n        value = self.subnode_lower\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_upper\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"lower\", self.subnode_lower),\n            (\"upper\", self.subnode_upper),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_lower\n        if old_node is value:\n            new_node = convertNoneConstantToNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_lower = new_node\n\n            return\n\n        value = self.subnode_upper\n        if old_node is value:\n            new_node = convertNoneConstantToNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_upper = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"lower\": (\n                self.subnode_lower.makeClone()\n                if self.subnode_lower is not None\n                else None\n            ),\n            \"upper\": (\n                self.subnode_upper.makeClone()\n                if self.subnode_upper is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        if self.subnode_lower is not None:\n            self.subnode_lower.finalize()\n        del self.subnode_lower\n        if self.subnode_upper is not None:\n            self.subnode_upper.finalize()\n        del self.subnode_upper\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        subnode_lower = self.subnode_lower\n\n        if subnode_lower is not None:\n            self.subnode_lower.collectVariableAccesses(emit_read, emit_write)\n        subnode_upper = self.subnode_upper\n\n        if subnode_upper is not None:\n            self.subnode_upper.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSliceLookupMixin = (\n    ChildrenHavingExpressionLowerAutoNoneUpperAutoNoneMixin\n)\n\n\nclass ChildrenHavingExpressionNameDefaultOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinGetattr\n\n    def __init__(\n        self,\n        expression,\n        name,\n        default,\n    ):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        name.parent = self\n\n        self.subnode_name = name\n\n        if default is not None:\n            default.parent = self\n\n        self.subnode_default = default\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_expression)\n        result.append(self.subnode_name)\n        value = self.subnode_default\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"name\", self.subnode_name),\n            (\"default\", self.subnode_default),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_default\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_default = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"name\": self.subnode_name.makeClone(),\n            \"default\": (\n                self.subnode_default.makeClone()\n                if self.subnode_default is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_default is not None:\n            self.subnode_default.finalize()\n        del self.subnode_default\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_default = self.subnode_default\n\n        if subnode_default is not None:\n            self.subnode_default.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinGetattrMixin = ChildrenHavingExpressionNameDefaultOptionalMixin\n\n\nclass ChildrenHavingExpressionNameValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSetattr\n\n    def __init__(\n        self,\n        expression,\n        name,\n        value,\n    ):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        name.parent = self\n\n        self.subnode_name = name\n\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_expression,\n            self.subnode_name,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"name\", self.subnode_name),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"name\": self.subnode_name.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        self.subnode_name.finalize()\n        del self.subnode_name\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSetattrMixin = ChildrenHavingExpressionNameValueMixin\n\n\nclass ChildrenHavingExpressionSubscriptMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSubscriptCheck\n    #   ExpressionSubscriptLookup\n    #   ExpressionSubscriptLookupForUnpack\n\n    def __init__(\n        self,\n        expression,\n        subscript,\n    ):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        subscript.parent = self\n\n        self.subnode_subscript = subscript\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_expression,\n            self.subnode_subscript,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"subscript\", self.subnode_subscript),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_subscript\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_subscript = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"subscript\": self.subnode_subscript.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        self.subnode_subscript.finalize()\n        del self.subnode_subscript\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_subscript.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSubscriptCheckMixin = ChildrenHavingExpressionSubscriptMixin\nChildrenExpressionSubscriptLookupMixin = ChildrenHavingExpressionSubscriptMixin\nChildrenExpressionSubscriptLookupForUnpackMixin = ChildrenHavingExpressionSubscriptMixin\n\n\nclass ChildHavingFallbackMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionLocalsMappingVariableRefOrFallback\n    #   ExpressionLocalsVariableRefOrFallback\n\n    def __init__(\n        self,\n        fallback,\n    ):\n        fallback.parent = self\n\n        self.subnode_fallback = fallback\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_fallback,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"fallback\", self.subnode_fallback),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_fallback\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_fallback = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"fallback\": self.subnode_fallback.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_fallback.finalize()\n        del self.subnode_fallback\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_fallback)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_fallback.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionLocalsMappingVariableRefOrFallbackMixin = ChildHavingFallbackMixin\nChildrenExpressionLocalsVariableRefOrFallbackMixin = ChildHavingFallbackMixin\n\n\nclass ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinsOpen\n\n    def __init__(\n        self,\n        file,\n        mode,\n        buffering,\n        encoding,\n        errors,\n        newline,\n        closefd,\n        opener,\n    ):\n        file.parent = self\n\n        self.subnode_file = file\n\n        if mode is not None:\n            mode.parent = self\n\n        self.subnode_mode = mode\n\n        if buffering is not None:\n            buffering.parent = self\n\n        self.subnode_buffering = buffering\n\n        if encoding is not None:\n            encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        if errors is not None:\n            errors.parent = self\n\n        self.subnode_errors = errors\n\n        if newline is not None:\n            newline.parent = self\n\n        self.subnode_newline = newline\n\n        if closefd is not None:\n            closefd.parent = self\n\n        self.subnode_closefd = closefd\n\n        if opener is not None:\n            opener.parent = self\n\n        self.subnode_opener = opener\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_file)\n        value = self.subnode_mode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_buffering\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_encoding\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_errors\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_newline\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_closefd\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_opener\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"file\", self.subnode_file),\n            (\"mode\", self.subnode_mode),\n            (\"buffering\", self.subnode_buffering),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n            (\"newline\", self.subnode_newline),\n            (\"closefd\", self.subnode_closefd),\n            (\"opener\", self.subnode_opener),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_file\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_file = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_buffering\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_buffering = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        value = self.subnode_newline\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_newline = new_node\n\n            return\n\n        value = self.subnode_closefd\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_closefd = new_node\n\n            return\n\n        value = self.subnode_opener\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_opener = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"file\": self.subnode_file.makeClone(),\n            \"mode\": (\n                self.subnode_mode.makeClone() if self.subnode_mode is not None else None\n            ),\n            \"buffering\": (\n                self.subnode_buffering.makeClone()\n                if self.subnode_buffering is not None\n                else None\n            ),\n            \"encoding\": (\n                self.subnode_encoding.makeClone()\n                if self.subnode_encoding is not None\n                else None\n            ),\n            \"errors\": (\n                self.subnode_errors.makeClone()\n                if self.subnode_errors is not None\n                else None\n            ),\n            \"newline\": (\n                self.subnode_newline.makeClone()\n                if self.subnode_newline is not None\n                else None\n            ),\n            \"closefd\": (\n                self.subnode_closefd.makeClone()\n                if self.subnode_closefd is not None\n                else None\n            ),\n            \"opener\": (\n                self.subnode_opener.makeClone()\n                if self.subnode_opener is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_file.finalize()\n        del self.subnode_file\n        if self.subnode_mode is not None:\n            self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_buffering is not None:\n            self.subnode_buffering.finalize()\n        del self.subnode_buffering\n        if self.subnode_encoding is not None:\n            self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        if self.subnode_errors is not None:\n            self.subnode_errors.finalize()\n        del self.subnode_errors\n        if self.subnode_newline is not None:\n            self.subnode_newline.finalize()\n        del self.subnode_newline\n        if self.subnode_closefd is not None:\n            self.subnode_closefd.finalize()\n        del self.subnode_closefd\n        if self.subnode_opener is not None:\n            self.subnode_opener.finalize()\n        del self.subnode_opener\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_file.collectVariableAccesses(emit_read, emit_write)\n        subnode_mode = self.subnode_mode\n\n        if subnode_mode is not None:\n            self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_buffering = self.subnode_buffering\n\n        if subnode_buffering is not None:\n            self.subnode_buffering.collectVariableAccesses(emit_read, emit_write)\n        subnode_encoding = self.subnode_encoding\n\n        if subnode_encoding is not None:\n            self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        subnode_errors = self.subnode_errors\n\n        if subnode_errors is not None:\n            self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n        subnode_newline = self.subnode_newline\n\n        if subnode_newline is not None:\n            self.subnode_newline.collectVariableAccesses(emit_read, emit_write)\n        subnode_closefd = self.subnode_closefd\n\n        if subnode_closefd is not None:\n            self.subnode_closefd.collectVariableAccesses(emit_read, emit_write)\n        subnode_opener = self.subnode_opener\n\n        if subnode_opener is not None:\n            self.subnode_opener.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinsOpenMixin = ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin\n\n\nclass ChildrenHavingFilenameModeOptionalBufferingOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinOpenP2\n\n    def __init__(\n        self,\n        filename,\n        mode,\n        buffering,\n    ):\n        filename.parent = self\n\n        self.subnode_filename = filename\n\n        if mode is not None:\n            mode.parent = self\n\n        self.subnode_mode = mode\n\n        if buffering is not None:\n            buffering.parent = self\n\n        self.subnode_buffering = buffering\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_filename)\n        value = self.subnode_mode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_buffering\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"filename\", self.subnode_filename),\n            (\"mode\", self.subnode_mode),\n            (\"buffering\", self.subnode_buffering),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_filename\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_filename = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_buffering\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_buffering = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"filename\": self.subnode_filename.makeClone(),\n            \"mode\": (\n                self.subnode_mode.makeClone() if self.subnode_mode is not None else None\n            ),\n            \"buffering\": (\n                self.subnode_buffering.makeClone()\n                if self.subnode_buffering is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_filename.finalize()\n        del self.subnode_filename\n        if self.subnode_mode is not None:\n            self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_buffering is not None:\n            self.subnode_buffering.finalize()\n        del self.subnode_buffering\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_filename.collectVariableAccesses(emit_read, emit_write)\n        subnode_mode = self.subnode_mode\n\n        if subnode_mode is not None:\n            self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_buffering = self.subnode_buffering\n\n        if subnode_buffering is not None:\n            self.subnode_buffering.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinOpenP2Mixin = (\n    ChildrenHavingFilenameModeOptionalBufferingOptionalMixin\n)\n\n\nclass ChildrenHavingFilenameModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinOpenP3\n\n    def __init__(\n        self,\n        filename,\n        mode,\n        buffering,\n        encoding,\n        errors,\n        newline,\n        closefd,\n        opener,\n    ):\n        filename.parent = self\n\n        self.subnode_filename = filename\n\n        if mode is not None:\n            mode.parent = self\n\n        self.subnode_mode = mode\n\n        if buffering is not None:\n            buffering.parent = self\n\n        self.subnode_buffering = buffering\n\n        if encoding is not None:\n            encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        if errors is not None:\n            errors.parent = self\n\n        self.subnode_errors = errors\n\n        if newline is not None:\n            newline.parent = self\n\n        self.subnode_newline = newline\n\n        if closefd is not None:\n            closefd.parent = self\n\n        self.subnode_closefd = closefd\n\n        if opener is not None:\n            opener.parent = self\n\n        self.subnode_opener = opener\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_filename)\n        value = self.subnode_mode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_buffering\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_encoding\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_errors\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_newline\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_closefd\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_opener\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"filename\", self.subnode_filename),\n            (\"mode\", self.subnode_mode),\n            (\"buffering\", self.subnode_buffering),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n            (\"newline\", self.subnode_newline),\n            (\"closefd\", self.subnode_closefd),\n            (\"opener\", self.subnode_opener),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_filename\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_filename = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_buffering\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_buffering = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        value = self.subnode_newline\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_newline = new_node\n\n            return\n\n        value = self.subnode_closefd\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_closefd = new_node\n\n            return\n\n        value = self.subnode_opener\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_opener = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"filename\": self.subnode_filename.makeClone(),\n            \"mode\": (\n                self.subnode_mode.makeClone() if self.subnode_mode is not None else None\n            ),\n            \"buffering\": (\n                self.subnode_buffering.makeClone()\n                if self.subnode_buffering is not None\n                else None\n            ),\n            \"encoding\": (\n                self.subnode_encoding.makeClone()\n                if self.subnode_encoding is not None\n                else None\n            ),\n            \"errors\": (\n                self.subnode_errors.makeClone()\n                if self.subnode_errors is not None\n                else None\n            ),\n            \"newline\": (\n                self.subnode_newline.makeClone()\n                if self.subnode_newline is not None\n                else None\n            ),\n            \"closefd\": (\n                self.subnode_closefd.makeClone()\n                if self.subnode_closefd is not None\n                else None\n            ),\n            \"opener\": (\n                self.subnode_opener.makeClone()\n                if self.subnode_opener is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_filename.finalize()\n        del self.subnode_filename\n        if self.subnode_mode is not None:\n            self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_buffering is not None:\n            self.subnode_buffering.finalize()\n        del self.subnode_buffering\n        if self.subnode_encoding is not None:\n            self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        if self.subnode_errors is not None:\n            self.subnode_errors.finalize()\n        del self.subnode_errors\n        if self.subnode_newline is not None:\n            self.subnode_newline.finalize()\n        del self.subnode_newline\n        if self.subnode_closefd is not None:\n            self.subnode_closefd.finalize()\n        del self.subnode_closefd\n        if self.subnode_opener is not None:\n            self.subnode_opener.finalize()\n        del self.subnode_opener\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_filename.collectVariableAccesses(emit_read, emit_write)\n        subnode_mode = self.subnode_mode\n\n        if subnode_mode is not None:\n            self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_buffering = self.subnode_buffering\n\n        if subnode_buffering is not None:\n            self.subnode_buffering.collectVariableAccesses(emit_read, emit_write)\n        subnode_encoding = self.subnode_encoding\n\n        if subnode_encoding is not None:\n            self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        subnode_errors = self.subnode_errors\n\n        if subnode_errors is not None:\n            self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n        subnode_newline = self.subnode_newline\n\n        if subnode_newline is not None:\n            self.subnode_newline.collectVariableAccesses(emit_read, emit_write)\n        subnode_closefd = self.subnode_closefd\n\n        if subnode_closefd is not None:\n            self.subnode_closefd.collectVariableAccesses(emit_read, emit_write)\n        subnode_opener = self.subnode_opener\n\n        if subnode_opener is not None:\n            self.subnode_opener.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinOpenP3Mixin = ChildrenHavingFilenameModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin\n\n\nclass ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionTensorflowFunction\n    #   ExpressionTensorflowFunctionCall\n\n    def __init__(\n        self,\n        func,\n        input_signature,\n        autograph,\n        jit_compile,\n        reduce_retracing,\n        experimental_implements,\n        experimental_autograph_options,\n        experimental_attributes,\n        experimental_relax_shapes,\n        experimental_compile,\n        experimental_follow_type_hints,\n    ):\n        if func is not None:\n            func.parent = self\n\n        self.subnode_func = func\n\n        if input_signature is not None:\n            input_signature.parent = self\n\n        self.subnode_input_signature = input_signature\n\n        if autograph is not None:\n            autograph.parent = self\n\n        self.subnode_autograph = autograph\n\n        if jit_compile is not None:\n            jit_compile.parent = self\n\n        self.subnode_jit_compile = jit_compile\n\n        if reduce_retracing is not None:\n            reduce_retracing.parent = self\n\n        self.subnode_reduce_retracing = reduce_retracing\n\n        if experimental_implements is not None:\n            experimental_implements.parent = self\n\n        self.subnode_experimental_implements = experimental_implements\n\n        if experimental_autograph_options is not None:\n            experimental_autograph_options.parent = self\n\n        self.subnode_experimental_autograph_options = experimental_autograph_options\n\n        if experimental_attributes is not None:\n            experimental_attributes.parent = self\n\n        self.subnode_experimental_attributes = experimental_attributes\n\n        if experimental_relax_shapes is not None:\n            experimental_relax_shapes.parent = self\n\n        self.subnode_experimental_relax_shapes = experimental_relax_shapes\n\n        if experimental_compile is not None:\n            experimental_compile.parent = self\n\n        self.subnode_experimental_compile = experimental_compile\n\n        if experimental_follow_type_hints is not None:\n            experimental_follow_type_hints.parent = self\n\n        self.subnode_experimental_follow_type_hints = experimental_follow_type_hints\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_func\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_input_signature\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_autograph\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_jit_compile\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_reduce_retracing\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_implements\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_autograph_options\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_attributes\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_relax_shapes\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_compile\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_experimental_follow_type_hints\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"func\", self.subnode_func),\n            (\"input_signature\", self.subnode_input_signature),\n            (\"autograph\", self.subnode_autograph),\n            (\"jit_compile\", self.subnode_jit_compile),\n            (\"reduce_retracing\", self.subnode_reduce_retracing),\n            (\"experimental_implements\", self.subnode_experimental_implements),\n            (\n                \"experimental_autograph_options\",\n                self.subnode_experimental_autograph_options,\n            ),\n            (\"experimental_attributes\", self.subnode_experimental_attributes),\n            (\"experimental_relax_shapes\", self.subnode_experimental_relax_shapes),\n            (\"experimental_compile\", self.subnode_experimental_compile),\n            (\n                \"experimental_follow_type_hints\",\n                self.subnode_experimental_follow_type_hints,\n            ),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_func\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_func = new_node\n\n            return\n\n        value = self.subnode_input_signature\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_input_signature = new_node\n\n            return\n\n        value = self.subnode_autograph\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_autograph = new_node\n\n            return\n\n        value = self.subnode_jit_compile\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_jit_compile = new_node\n\n            return\n\n        value = self.subnode_reduce_retracing\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_reduce_retracing = new_node\n\n            return\n\n        value = self.subnode_experimental_implements\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_implements = new_node\n\n            return\n\n        value = self.subnode_experimental_autograph_options\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_autograph_options = new_node\n\n            return\n\n        value = self.subnode_experimental_attributes\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_attributes = new_node\n\n            return\n\n        value = self.subnode_experimental_relax_shapes\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_relax_shapes = new_node\n\n            return\n\n        value = self.subnode_experimental_compile\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_compile = new_node\n\n            return\n\n        value = self.subnode_experimental_follow_type_hints\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_experimental_follow_type_hints = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"func\": (\n                self.subnode_func.makeClone() if self.subnode_func is not None else None\n            ),\n            \"input_signature\": (\n                self.subnode_input_signature.makeClone()\n                if self.subnode_input_signature is not None\n                else None\n            ),\n            \"autograph\": (\n                self.subnode_autograph.makeClone()\n                if self.subnode_autograph is not None\n                else None\n            ),\n            \"jit_compile\": (\n                self.subnode_jit_compile.makeClone()\n                if self.subnode_jit_compile is not None\n                else None\n            ),\n            \"reduce_retracing\": (\n                self.subnode_reduce_retracing.makeClone()\n                if self.subnode_reduce_retracing is not None\n                else None\n            ),\n            \"experimental_implements\": (\n                self.subnode_experimental_implements.makeClone()\n                if self.subnode_experimental_implements is not None\n                else None\n            ),\n            \"experimental_autograph_options\": (\n                self.subnode_experimental_autograph_options.makeClone()\n                if self.subnode_experimental_autograph_options is not None\n                else None\n            ),\n            \"experimental_attributes\": (\n                self.subnode_experimental_attributes.makeClone()\n                if self.subnode_experimental_attributes is not None\n                else None\n            ),\n            \"experimental_relax_shapes\": (\n                self.subnode_experimental_relax_shapes.makeClone()\n                if self.subnode_experimental_relax_shapes is not None\n                else None\n            ),\n            \"experimental_compile\": (\n                self.subnode_experimental_compile.makeClone()\n                if self.subnode_experimental_compile is not None\n                else None\n            ),\n            \"experimental_follow_type_hints\": (\n                self.subnode_experimental_follow_type_hints.makeClone()\n                if self.subnode_experimental_follow_type_hints is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_func is not None:\n            self.subnode_func.finalize()\n        del self.subnode_func\n        if self.subnode_input_signature is not None:\n            self.subnode_input_signature.finalize()\n        del self.subnode_input_signature\n        if self.subnode_autograph is not None:\n            self.subnode_autograph.finalize()\n        del self.subnode_autograph\n        if self.subnode_jit_compile is not None:\n            self.subnode_jit_compile.finalize()\n        del self.subnode_jit_compile\n        if self.subnode_reduce_retracing is not None:\n            self.subnode_reduce_retracing.finalize()\n        del self.subnode_reduce_retracing\n        if self.subnode_experimental_implements is not None:\n            self.subnode_experimental_implements.finalize()\n        del self.subnode_experimental_implements\n        if self.subnode_experimental_autograph_options is not None:\n            self.subnode_experimental_autograph_options.finalize()\n        del self.subnode_experimental_autograph_options\n        if self.subnode_experimental_attributes is not None:\n            self.subnode_experimental_attributes.finalize()\n        del self.subnode_experimental_attributes\n        if self.subnode_experimental_relax_shapes is not None:\n            self.subnode_experimental_relax_shapes.finalize()\n        del self.subnode_experimental_relax_shapes\n        if self.subnode_experimental_compile is not None:\n            self.subnode_experimental_compile.finalize()\n        del self.subnode_experimental_compile\n        if self.subnode_experimental_follow_type_hints is not None:\n            self.subnode_experimental_follow_type_hints.finalize()\n        del self.subnode_experimental_follow_type_hints\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_func = self.subnode_func\n\n        if subnode_func is not None:\n            self.subnode_func.collectVariableAccesses(emit_read, emit_write)\n        subnode_input_signature = self.subnode_input_signature\n\n        if subnode_input_signature is not None:\n            self.subnode_input_signature.collectVariableAccesses(emit_read, emit_write)\n        subnode_autograph = self.subnode_autograph\n\n        if subnode_autograph is not None:\n            self.subnode_autograph.collectVariableAccesses(emit_read, emit_write)\n        subnode_jit_compile = self.subnode_jit_compile\n\n        if subnode_jit_compile is not None:\n            self.subnode_jit_compile.collectVariableAccesses(emit_read, emit_write)\n        subnode_reduce_retracing = self.subnode_reduce_retracing\n\n        if subnode_reduce_retracing is not None:\n            self.subnode_reduce_retracing.collectVariableAccesses(emit_read, emit_write)\n        subnode_experimental_implements = self.subnode_experimental_implements\n\n        if subnode_experimental_implements is not None:\n            self.subnode_experimental_implements.collectVariableAccesses(\n                emit_read, emit_write\n            )\n        subnode_experimental_autograph_options = (\n            self.subnode_experimental_autograph_options\n        )\n\n        if subnode_experimental_autograph_options is not None:\n            self.subnode_experimental_autograph_options.collectVariableAccesses(\n                emit_read, emit_write\n            )\n        subnode_experimental_attributes = self.subnode_experimental_attributes\n\n        if subnode_experimental_attributes is not None:\n            self.subnode_experimental_attributes.collectVariableAccesses(\n                emit_read, emit_write\n            )\n        subnode_experimental_relax_shapes = self.subnode_experimental_relax_shapes\n\n        if subnode_experimental_relax_shapes is not None:\n            self.subnode_experimental_relax_shapes.collectVariableAccesses(\n                emit_read, emit_write\n            )\n        subnode_experimental_compile = self.subnode_experimental_compile\n\n        if subnode_experimental_compile is not None:\n            self.subnode_experimental_compile.collectVariableAccesses(\n                emit_read, emit_write\n            )\n        subnode_experimental_follow_type_hints = (\n            self.subnode_experimental_follow_type_hints\n        )\n\n        if subnode_experimental_follow_type_hints is not None:\n            self.subnode_experimental_follow_type_hints.collectVariableAccesses(\n                emit_read, emit_write\n            )\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionTensorflowFunctionMixin = ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin\nChildrenExpressionTensorflowFunctionCallMixin = ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin\n\n\nclass ChildrenHavingFunctionValuesTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionFunctionCall\n\n    def __init__(\n        self,\n        function,\n        values,\n    ):\n        function.parent = self\n\n        self.subnode_function = function\n\n        assert type(values) is tuple\n\n        for val in values:\n            val.parent = self\n\n        self.subnode_values = values\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_function)\n        result.extend(self.subnode_values)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"function\", self.subnode_function),\n            (\"values\", self.subnode_values),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_function\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_function = new_node\n\n            return\n\n        value = self.subnode_values\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_values = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_values = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"function\": self.subnode_function.makeClone(),\n            \"values\": tuple(v.makeClone() for v in self.subnode_values),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_function.finalize()\n        del self.subnode_function\n        for c in self.subnode_values:\n            c.finalize()\n        del self.subnode_values\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_function.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_values:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionFunctionCallMixin = ChildrenHavingFunctionValuesTupleMixin\n\n\nclass ChildHavingGeneratorRefMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionMakeGeneratorObject\n\n    def __init__(\n        self,\n        generator_ref,\n    ):\n        generator_ref.parent = self\n\n        self.subnode_generator_ref = generator_ref\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_generator_ref,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"generator_ref\", self.subnode_generator_ref),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_generator_ref\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_generator_ref = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"generator_ref\": self.subnode_generator_ref.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_generator_ref.finalize()\n        del self.subnode_generator_ref\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_generator_ref)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_generator_ref.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionMakeGeneratorObjectMixin = ChildHavingGeneratorRefMixin\n\n\nclass ChildrenHavingGroupNameOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionPkgResourcesIterEntryPoints\n    #   ExpressionPkgResourcesIterEntryPointsCall\n\n    def __init__(\n        self,\n        group,\n        name,\n    ):\n        group.parent = self\n\n        self.subnode_group = group\n\n        if name is not None:\n            name.parent = self\n\n        self.subnode_name = name\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_group)\n        value = self.subnode_name\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"group\", self.subnode_group),\n            (\"name\", self.subnode_name),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_group\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_group = new_node\n\n            return\n\n        value = self.subnode_name\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"group\": self.subnode_group.makeClone(),\n            \"name\": (\n                self.subnode_name.makeClone() if self.subnode_name is not None else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_group.finalize()\n        del self.subnode_group\n        if self.subnode_name is not None:\n            self.subnode_name.finalize()\n        del self.subnode_name\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_group.collectVariableAccesses(emit_read, emit_write)\n        subnode_name = self.subnode_name\n\n        if subnode_name is not None:\n            self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionPkgResourcesIterEntryPointsMixin = (\n    ChildrenHavingGroupNameOptionalMixin\n)\nChildrenExpressionPkgResourcesIterEntryPointsCallMixin = (\n    ChildrenHavingGroupNameOptionalMixin\n)\n\n\nclass ChildrenHavingInstanceClassesMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinIsinstance\n\n    def __init__(\n        self,\n        instance,\n        classes,\n    ):\n        instance.parent = self\n\n        self.subnode_instance = instance\n\n        classes.parent = self\n\n        self.subnode_classes = classes\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_instance,\n            self.subnode_classes,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"instance\", self.subnode_instance),\n            (\"classes\", self.subnode_classes),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_instance\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_instance = new_node\n\n            return\n\n        value = self.subnode_classes\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_classes = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"instance\": self.subnode_instance.makeClone(),\n            \"classes\": self.subnode_classes.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_instance.finalize()\n        del self.subnode_instance\n        self.subnode_classes.finalize()\n        del self.subnode_classes\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_instance.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_classes.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinIsinstanceMixin = ChildrenHavingInstanceClassesMixin\n\n\nclass ChildHavingIterableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationFromkeys2\n\n    def __init__(\n        self,\n        iterable,\n    ):\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_iterable,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"iterable\", self.subnode_iterable),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"iterable\": self.subnode_iterable.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_iterable)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationFromkeys2Mixin = ChildHavingIterableMixin\n\n\nclass ChildrenHavingIterableValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationFromkeys3\n\n    def __init__(\n        self,\n        iterable,\n        value,\n    ):\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_iterable,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"iterable\", self.subnode_iterable),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"iterable\": self.subnode_iterable.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationFromkeys3Mixin = ChildrenHavingIterableValueMixin\n\n\nclass ChildrenHavingIteratorDefaultMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinNext2\n\n    def __init__(\n        self,\n        iterator,\n        default,\n    ):\n        iterator.parent = self\n\n        self.subnode_iterator = iterator\n\n        default.parent = self\n\n        self.subnode_default = default\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_iterator,\n            self.subnode_default,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"iterator\", self.subnode_iterator),\n            (\"default\", self.subnode_default),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_iterator\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterator = new_node\n\n            return\n\n        value = self.subnode_default\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_default = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"iterator\": self.subnode_iterator.makeClone(),\n            \"default\": self.subnode_default.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_iterator.finalize()\n        del self.subnode_iterator\n        self.subnode_default.finalize()\n        del self.subnode_default\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_iterator.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_default.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinNext2Mixin = ChildrenHavingIteratorDefaultMixin\n\n\nclass ChildrenHavingKeyDictArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionDictOperationIn\n    #   ExpressionDictOperationNotIn\n\n    def __init__(\n        self,\n        key,\n        dict_arg,\n    ):\n        key.parent = self\n\n        self.subnode_key = key\n\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_key,\n            self.subnode_dict_arg,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"key\", self.subnode_key),\n            (\"dict_arg\", self.subnode_dict_arg),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"key\": self.subnode_key.makeClone(),\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_key.finalize()\n        del self.subnode_key\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionDictOperationInMixin = ChildrenHavingKeyDictArgMixin\nChildrenExpressionDictOperationNotInMixin = ChildrenHavingKeyDictArgMixin\n\n\nclass ChildrenHavingKeyValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionKeyValuePairNew\n\n    def __init__(\n        self,\n        key,\n        value,\n    ):\n        key.parent = self\n\n        self.subnode_key = key\n\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_key,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"key\", self.subnode_key),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"key\": self.subnode_key.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_key.finalize()\n        del self.subnode_key\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionKeyValuePairNewMixin = ChildrenHavingKeyValueMixin\n\n\nclass ChildrenHavingKwDefaultsOptionalDefaultsTupleAnnotationsOptionalFunctionRefMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionFunctionCreationOld\n\n    def __init__(\n        self,\n        kw_defaults,\n        defaults,\n        annotations,\n        function_ref,\n    ):\n        if kw_defaults is not None:\n            kw_defaults.parent = self\n\n        self.subnode_kw_defaults = kw_defaults\n\n        assert type(defaults) is tuple\n\n        for val in defaults:\n            val.parent = self\n\n        self.subnode_defaults = defaults\n\n        if annotations is not None:\n            annotations.parent = self\n\n        self.subnode_annotations = annotations\n\n        function_ref.parent = self\n\n        self.subnode_function_ref = function_ref\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_kw_defaults\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.extend(self.subnode_defaults)\n        value = self.subnode_annotations\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_function_ref)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"kw_defaults\", self.subnode_kw_defaults),\n            (\"defaults\", self.subnode_defaults),\n            (\"annotations\", self.subnode_annotations),\n            (\"function_ref\", self.subnode_function_ref),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_kw_defaults\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_kw_defaults = new_node\n\n            return\n\n        value = self.subnode_defaults\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_defaults = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_defaults = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        value = self.subnode_annotations\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_annotations = new_node\n\n            return\n\n        value = self.subnode_function_ref\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_function_ref = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"kw_defaults\": (\n                self.subnode_kw_defaults.makeClone()\n                if self.subnode_kw_defaults is not None\n                else None\n            ),\n            \"defaults\": tuple(v.makeClone() for v in self.subnode_defaults),\n            \"annotations\": (\n                self.subnode_annotations.makeClone()\n                if self.subnode_annotations is not None\n                else None\n            ),\n            \"function_ref\": self.subnode_function_ref.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_kw_defaults is not None:\n            self.subnode_kw_defaults.finalize()\n        del self.subnode_kw_defaults\n        for c in self.subnode_defaults:\n            c.finalize()\n        del self.subnode_defaults\n        if self.subnode_annotations is not None:\n            self.subnode_annotations.finalize()\n        del self.subnode_annotations\n        self.subnode_function_ref.finalize()\n        del self.subnode_function_ref\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_kw_defaults = self.subnode_kw_defaults\n\n        if subnode_kw_defaults is not None:\n            self.subnode_kw_defaults.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_defaults:\n            element.collectVariableAccesses(emit_read, emit_write)\n        subnode_annotations = self.subnode_annotations\n\n        if subnode_annotations is not None:\n            self.subnode_annotations.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_function_ref.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionFunctionCreationOldMixin = (\n    ChildrenHavingKwDefaultsOptionalDefaultsTupleAnnotationsOptionalFunctionRefMixin\n)\n\n\nclass ChildrenHavingLeftRightMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionComparisonEq\n    #   ExpressionComparisonExceptionMatch\n    #   ExpressionComparisonExceptionMismatch\n    #   ExpressionComparisonGt\n    #   ExpressionComparisonGte\n    #   ExpressionComparisonIn\n    #   ExpressionComparisonIs\n    #   ExpressionComparisonIsNot\n    #   ExpressionComparisonLt\n    #   ExpressionComparisonLte\n    #   ExpressionComparisonNeq\n    #   ExpressionComparisonNotIn\n    #   ExpressionConditionalAnd\n    #   ExpressionConditionalOr\n    #   ExpressionOperationBinaryAdd\n    #   ExpressionOperationBinaryBitAnd\n    #   ExpressionOperationBinaryBitOr\n    #   ExpressionOperationBinaryBitXor\n    #   ExpressionOperationBinaryDivmod\n    #   ExpressionOperationBinaryFloorDiv\n    #   ExpressionOperationBinaryLshift\n    #   ExpressionOperationBinaryMatMult\n    #   ExpressionOperationBinaryMod\n    #   ExpressionOperationBinaryMult\n    #   ExpressionOperationBinaryPow\n    #   ExpressionOperationBinaryRshift\n    #   ExpressionOperationBinarySub\n    #   ExpressionOperationBinaryTrueDiv\n    #   ExpressionOperationInplaceAdd\n    #   ExpressionOperationInplaceBitAnd\n    #   ExpressionOperationInplaceBitOr\n    #   ExpressionOperationInplaceBitXor\n    #   ExpressionOperationInplaceFloorDiv\n    #   ExpressionOperationInplaceLshift\n    #   ExpressionOperationInplaceMatMult\n    #   ExpressionOperationInplaceMod\n    #   ExpressionOperationInplaceMult\n    #   ExpressionOperationInplacePow\n    #   ExpressionOperationInplaceRshift\n    #   ExpressionOperationInplaceSub\n    #   ExpressionOperationInplaceTrueDiv\n\n    def __init__(\n        self,\n        left,\n        right,\n    ):\n        left.parent = self\n\n        self.subnode_left = left\n\n        right.parent = self\n\n        self.subnode_right = right\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_left,\n            self.subnode_right,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"left\", self.subnode_left),\n            (\"right\", self.subnode_right),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_left\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_left = new_node\n\n            return\n\n        value = self.subnode_right\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_right = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"left\": self.subnode_left.makeClone(),\n            \"right\": self.subnode_right.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_left.finalize()\n        del self.subnode_left\n        self.subnode_right.finalize()\n        del self.subnode_right\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_left.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_right.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionComparisonEqMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonExceptionMatchMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonExceptionMismatchMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonGtMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonGteMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonInMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonIsMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonIsNotMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonLtMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonLteMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonNeqMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionComparisonNotInMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionConditionalAndMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionConditionalOrMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryAddMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryBitAndMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryBitOrMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryBitXorMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryDivmodMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryFloorDivMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryLshiftMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryMatMultMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryModMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryMultMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryPowMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryRshiftMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinarySubMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationBinaryTrueDivMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceAddMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceBitAndMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceBitOrMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceBitXorMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceFloorDivMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceLshiftMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceMatMultMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceModMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceMultMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplacePowMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceRshiftMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceSubMixin = ChildrenHavingLeftRightMixin\nChildrenExpressionOperationInplaceTrueDivMixin = ChildrenHavingLeftRightMixin\n\n\nclass ChildHavingListArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationCopy\n    #   ExpressionListOperationPop1\n    #   ExpressionListOperationSort1\n\n    def __init__(\n        self,\n        list_arg,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_list_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"list_arg\", self.subnode_list_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_list_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationCopyMixin = ChildHavingListArgMixin\nChildrenExpressionListOperationPop1Mixin = ChildHavingListArgMixin\nChildrenExpressionListOperationSort1Mixin = ChildHavingListArgMixin\n\n\nclass ChildrenHavingListArgIndexMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationPop2\n\n    def __init__(\n        self,\n        list_arg,\n        index,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        index.parent = self\n\n        self.subnode_index = index\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_index,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"index\", self.subnode_index),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_index\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_index = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"index\": self.subnode_index.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_index.finalize()\n        del self.subnode_index\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_index.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationPop2Mixin = ChildrenHavingListArgIndexMixin\n\n\nclass ChildrenHavingListArgIndexItemMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationInsert\n\n    def __init__(\n        self,\n        list_arg,\n        index,\n        item,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        index.parent = self\n\n        self.subnode_index = index\n\n        item.parent = self\n\n        self.subnode_item = item\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_index,\n            self.subnode_item,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"index\", self.subnode_index),\n            (\"item\", self.subnode_item),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_index\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_index = new_node\n\n            return\n\n        value = self.subnode_item\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_item = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"index\": self.subnode_index.makeClone(),\n            \"item\": self.subnode_item.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_index.finalize()\n        del self.subnode_index\n        self.subnode_item.finalize()\n        del self.subnode_item\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_index.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_item.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationInsertMixin = ChildrenHavingListArgIndexItemMixin\n\n\nclass ChildrenHavingListArgKeyMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationSort2\n\n    def __init__(\n        self,\n        list_arg,\n        key,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        key.parent = self\n\n        self.subnode_key = key\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_key,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"key\", self.subnode_key),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_key.finalize()\n        del self.subnode_key\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationSort2Mixin = ChildrenHavingListArgKeyMixin\n\n\nclass ChildrenHavingListArgKeyOptionalReverseMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationSort3\n\n    def __init__(\n        self,\n        list_arg,\n        key,\n        reverse,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        if key is not None:\n            key.parent = self\n\n        self.subnode_key = key\n\n        reverse.parent = self\n\n        self.subnode_reverse = reverse\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_list_arg)\n        value = self.subnode_key\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_reverse)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"key\", self.subnode_key),\n            (\"reverse\", self.subnode_reverse),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        value = self.subnode_reverse\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_reverse = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"key\": (\n                self.subnode_key.makeClone() if self.subnode_key is not None else None\n            ),\n            \"reverse\": self.subnode_reverse.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        if self.subnode_key is not None:\n            self.subnode_key.finalize()\n        del self.subnode_key\n        self.subnode_reverse.finalize()\n        del self.subnode_reverse\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_key = self.subnode_key\n\n        if subnode_key is not None:\n            self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_reverse.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationSort3Mixin = ChildrenHavingListArgKeyOptionalReverseMixin\n\n\nclass ChildrenHavingListArgValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationExtend\n    #   ExpressionListOperationExtendForUnpack\n    #   ExpressionListOperationIndex2\n    #   ExpressionListOperationRemove\n\n    def __init__(\n        self,\n        list_arg,\n        value,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationExtendMixin = ChildrenHavingListArgValueMixin\nChildrenExpressionListOperationExtendForUnpackMixin = ChildrenHavingListArgValueMixin\nChildrenExpressionListOperationIndex2Mixin = ChildrenHavingListArgValueMixin\nChildrenExpressionListOperationRemoveMixin = ChildrenHavingListArgValueMixin\n\n\nclass ChildrenHavingListArgValueStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationIndex3\n\n    def __init__(\n        self,\n        list_arg,\n        value,\n        start,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_value,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"value\", self.subnode_value),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationIndex3Mixin = ChildrenHavingListArgValueStartMixin\n\n\nclass ChildrenHavingListArgValueStartStopMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationIndex4\n\n    def __init__(\n        self,\n        list_arg,\n        value,\n        start,\n        stop,\n    ):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        stop.parent = self\n\n        self.subnode_stop = stop\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_value,\n            self.subnode_start,\n            self.subnode_stop,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"value\", self.subnode_value),\n            (\"start\", self.subnode_start),\n            (\"stop\", self.subnode_stop),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_stop\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_stop = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"stop\": self.subnode_stop.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_stop.finalize()\n        del self.subnode_stop\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_stop.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionListOperationIndex4Mixin = ChildrenHavingListArgValueStartStopMixin\n\n\nclass ChildHavingLowMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinRange1\n    #   ExpressionBuiltinXrange1\n\n    def __init__(\n        self,\n        low,\n    ):\n        low.parent = self\n\n        self.subnode_low = low\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_low,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"low\", self.subnode_low),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_low\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_low = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"low\": self.subnode_low.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_low.finalize()\n        del self.subnode_low\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_low)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_low.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinRange1Mixin = ChildHavingLowMixin\nChildrenExpressionBuiltinXrange1Mixin = ChildHavingLowMixin\n\n\nclass ChildrenHavingLowHighMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinRange2\n    #   ExpressionBuiltinXrange2\n\n    def __init__(\n        self,\n        low,\n        high,\n    ):\n        low.parent = self\n\n        self.subnode_low = low\n\n        high.parent = self\n\n        self.subnode_high = high\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_low,\n            self.subnode_high,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"low\", self.subnode_low),\n            (\"high\", self.subnode_high),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_low\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_low = new_node\n\n            return\n\n        value = self.subnode_high\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_high = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"low\": self.subnode_low.makeClone(),\n            \"high\": self.subnode_high.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_low.finalize()\n        del self.subnode_low\n        self.subnode_high.finalize()\n        del self.subnode_high\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_low.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_high.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinRange2Mixin = ChildrenHavingLowHighMixin\nChildrenExpressionBuiltinXrange2Mixin = ChildrenHavingLowHighMixin\n\n\nclass ChildrenHavingLowHighStepMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinRange3\n    #   ExpressionBuiltinXrange3\n\n    def __init__(\n        self,\n        low,\n        high,\n        step,\n    ):\n        low.parent = self\n\n        self.subnode_low = low\n\n        high.parent = self\n\n        self.subnode_high = high\n\n        step.parent = self\n\n        self.subnode_step = step\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_low,\n            self.subnode_high,\n            self.subnode_step,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"low\", self.subnode_low),\n            (\"high\", self.subnode_high),\n            (\"step\", self.subnode_step),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_low\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_low = new_node\n\n            return\n\n        value = self.subnode_high\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_high = new_node\n\n            return\n\n        value = self.subnode_step\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_step = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"low\": self.subnode_low.makeClone(),\n            \"high\": self.subnode_high.makeClone(),\n            \"step\": self.subnode_step.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_low.finalize()\n        del self.subnode_low\n        self.subnode_high.finalize()\n        del self.subnode_high\n        self.subnode_step.finalize()\n        del self.subnode_step\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_low.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_high.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_step.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinRange3Mixin = ChildrenHavingLowHighStepMixin\nChildrenExpressionBuiltinXrange3Mixin = ChildrenHavingLowHighStepMixin\n\n\nclass ChildrenHavingMetaclassBasesMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSelectMetaclass\n\n    def __init__(\n        self,\n        metaclass,\n        bases,\n    ):\n        metaclass.parent = self\n\n        self.subnode_metaclass = metaclass\n\n        bases.parent = self\n\n        self.subnode_bases = bases\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_metaclass,\n            self.subnode_bases,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"metaclass\", self.subnode_metaclass),\n            (\"bases\", self.subnode_bases),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_metaclass\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_metaclass = new_node\n\n            return\n\n        value = self.subnode_bases\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bases = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"metaclass\": self.subnode_metaclass.makeClone(),\n            \"bases\": self.subnode_bases.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_metaclass.finalize()\n        del self.subnode_metaclass\n        self.subnode_bases.finalize()\n        del self.subnode_bases\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_metaclass.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_bases.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSelectMetaclassMixin = ChildrenHavingMetaclassBasesMixin\n\n\nclass ChildHavingModuleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportName\n\n    def __init__(\n        self,\n        module,\n    ):\n        module.parent = self\n\n        self.subnode_module = module\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_module,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"module\", self.subnode_module),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_module\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_module = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"module\": self.subnode_module.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_module.finalize()\n        del self.subnode_module\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_module)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_module.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportNameMixin = ChildHavingModuleMixin\n\n\nclass ChildrenHavingNameGlobalsArgOptionalLocalsArgOptionalFromlistOptionalLevelOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinImport\n\n    def __init__(\n        self,\n        name,\n        globals_arg,\n        locals_arg,\n        fromlist,\n        level,\n    ):\n        name.parent = self\n\n        self.subnode_name = name\n\n        if globals_arg is not None:\n            globals_arg.parent = self\n\n        self.subnode_globals_arg = globals_arg\n\n        if locals_arg is not None:\n            locals_arg.parent = self\n\n        self.subnode_locals_arg = locals_arg\n\n        if fromlist is not None:\n            fromlist.parent = self\n\n        self.subnode_fromlist = fromlist\n\n        if level is not None:\n            level.parent = self\n\n        self.subnode_level = level\n\n    def setChildName(self, value):\n        value.parent = self\n\n        self.subnode_name = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_name)\n        value = self.subnode_globals_arg\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_locals_arg\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_fromlist\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_level\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"name\", self.subnode_name),\n            (\"globals_arg\", self.subnode_globals_arg),\n            (\"locals_arg\", self.subnode_locals_arg),\n            (\"fromlist\", self.subnode_fromlist),\n            (\"level\", self.subnode_level),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_globals_arg\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_globals_arg = new_node\n\n            return\n\n        value = self.subnode_locals_arg\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_locals_arg = new_node\n\n            return\n\n        value = self.subnode_fromlist\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_fromlist = new_node\n\n            return\n\n        value = self.subnode_level\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_level = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"name\": self.subnode_name.makeClone(),\n            \"globals_arg\": (\n                self.subnode_globals_arg.makeClone()\n                if self.subnode_globals_arg is not None\n                else None\n            ),\n            \"locals_arg\": (\n                self.subnode_locals_arg.makeClone()\n                if self.subnode_locals_arg is not None\n                else None\n            ),\n            \"fromlist\": (\n                self.subnode_fromlist.makeClone()\n                if self.subnode_fromlist is not None\n                else None\n            ),\n            \"level\": (\n                self.subnode_level.makeClone()\n                if self.subnode_level is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_globals_arg is not None:\n            self.subnode_globals_arg.finalize()\n        del self.subnode_globals_arg\n        if self.subnode_locals_arg is not None:\n            self.subnode_locals_arg.finalize()\n        del self.subnode_locals_arg\n        if self.subnode_fromlist is not None:\n            self.subnode_fromlist.finalize()\n        del self.subnode_fromlist\n        if self.subnode_level is not None:\n            self.subnode_level.finalize()\n        del self.subnode_level\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_globals_arg = self.subnode_globals_arg\n\n        if subnode_globals_arg is not None:\n            self.subnode_globals_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_locals_arg = self.subnode_locals_arg\n\n        if subnode_locals_arg is not None:\n            self.subnode_locals_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_fromlist = self.subnode_fromlist\n\n        if subnode_fromlist is not None:\n            self.subnode_fromlist.collectVariableAccesses(emit_read, emit_write)\n        subnode_level = self.subnode_level\n\n        if subnode_level is not None:\n            self.subnode_level.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinImportMixin = ChildrenHavingNameGlobalsArgOptionalLocalsArgOptionalFromlistOptionalLevelOptionalMixin\n\n\nclass ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCtypesCdll\n\n    def __init__(\n        self,\n        name,\n        mode,\n        handle,\n        use_errno,\n        use_last_error,\n    ):\n        name.parent = self\n\n        self.subnode_name = name\n\n        if mode is not None:\n            mode.parent = self\n\n        self.subnode_mode = mode\n\n        if handle is not None:\n            handle.parent = self\n\n        self.subnode_handle = handle\n\n        if use_errno is not None:\n            use_errno.parent = self\n\n        self.subnode_use_errno = use_errno\n\n        if use_last_error is not None:\n            use_last_error.parent = self\n\n        self.subnode_use_last_error = use_last_error\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_name)\n        value = self.subnode_mode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_handle\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_use_errno\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_use_last_error\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"name\", self.subnode_name),\n            (\"mode\", self.subnode_mode),\n            (\"handle\", self.subnode_handle),\n            (\"use_errno\", self.subnode_use_errno),\n            (\"use_last_error\", self.subnode_use_last_error),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_handle\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_handle = new_node\n\n            return\n\n        value = self.subnode_use_errno\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_use_errno = new_node\n\n            return\n\n        value = self.subnode_use_last_error\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_use_last_error = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"name\": self.subnode_name.makeClone(),\n            \"mode\": (\n                self.subnode_mode.makeClone() if self.subnode_mode is not None else None\n            ),\n            \"handle\": (\n                self.subnode_handle.makeClone()\n                if self.subnode_handle is not None\n                else None\n            ),\n            \"use_errno\": (\n                self.subnode_use_errno.makeClone()\n                if self.subnode_use_errno is not None\n                else None\n            ),\n            \"use_last_error\": (\n                self.subnode_use_last_error.makeClone()\n                if self.subnode_use_last_error is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_mode is not None:\n            self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_handle is not None:\n            self.subnode_handle.finalize()\n        del self.subnode_handle\n        if self.subnode_use_errno is not None:\n            self.subnode_use_errno.finalize()\n        del self.subnode_use_errno\n        if self.subnode_use_last_error is not None:\n            self.subnode_use_last_error.finalize()\n        del self.subnode_use_last_error\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_mode = self.subnode_mode\n\n        if subnode_mode is not None:\n            self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_handle = self.subnode_handle\n\n        if subnode_handle is not None:\n            self.subnode_handle.collectVariableAccesses(emit_read, emit_write)\n        subnode_use_errno = self.subnode_use_errno\n\n        if subnode_use_errno is not None:\n            self.subnode_use_errno.collectVariableAccesses(emit_read, emit_write)\n        subnode_use_last_error = self.subnode_use_last_error\n\n        if subnode_use_last_error is not None:\n            self.subnode_use_last_error.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCtypesCdllMixin = ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin\n\n\nclass ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionCtypesCdll\n\n    def __init__(\n        self,\n        name,\n        mode,\n        handle,\n        use_errno,\n        use_last_error,\n        winmode,\n    ):\n        name.parent = self\n\n        self.subnode_name = name\n\n        if mode is not None:\n            mode.parent = self\n\n        self.subnode_mode = mode\n\n        if handle is not None:\n            handle.parent = self\n\n        self.subnode_handle = handle\n\n        if use_errno is not None:\n            use_errno.parent = self\n\n        self.subnode_use_errno = use_errno\n\n        if use_last_error is not None:\n            use_last_error.parent = self\n\n        self.subnode_use_last_error = use_last_error\n\n        if winmode is not None:\n            winmode.parent = self\n\n        self.subnode_winmode = winmode\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_name)\n        value = self.subnode_mode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_handle\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_use_errno\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_use_last_error\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_winmode\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"name\", self.subnode_name),\n            (\"mode\", self.subnode_mode),\n            (\"handle\", self.subnode_handle),\n            (\"use_errno\", self.subnode_use_errno),\n            (\"use_last_error\", self.subnode_use_last_error),\n            (\"winmode\", self.subnode_winmode),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_handle\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_handle = new_node\n\n            return\n\n        value = self.subnode_use_errno\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_use_errno = new_node\n\n            return\n\n        value = self.subnode_use_last_error\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_use_last_error = new_node\n\n            return\n\n        value = self.subnode_winmode\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_winmode = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"name\": self.subnode_name.makeClone(),\n            \"mode\": (\n                self.subnode_mode.makeClone() if self.subnode_mode is not None else None\n            ),\n            \"handle\": (\n                self.subnode_handle.makeClone()\n                if self.subnode_handle is not None\n                else None\n            ),\n            \"use_errno\": (\n                self.subnode_use_errno.makeClone()\n                if self.subnode_use_errno is not None\n                else None\n            ),\n            \"use_last_error\": (\n                self.subnode_use_last_error.makeClone()\n                if self.subnode_use_last_error is not None\n                else None\n            ),\n            \"winmode\": (\n                self.subnode_winmode.makeClone()\n                if self.subnode_winmode is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_mode is not None:\n            self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_handle is not None:\n            self.subnode_handle.finalize()\n        del self.subnode_handle\n        if self.subnode_use_errno is not None:\n            self.subnode_use_errno.finalize()\n        del self.subnode_use_errno\n        if self.subnode_use_last_error is not None:\n            self.subnode_use_last_error.finalize()\n        del self.subnode_use_last_error\n        if self.subnode_winmode is not None:\n            self.subnode_winmode.finalize()\n        del self.subnode_winmode\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_mode = self.subnode_mode\n\n        if subnode_mode is not None:\n            self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_handle = self.subnode_handle\n\n        if subnode_handle is not None:\n            self.subnode_handle.collectVariableAccesses(emit_read, emit_write)\n        subnode_use_errno = self.subnode_use_errno\n\n        if subnode_use_errno is not None:\n            self.subnode_use_errno.collectVariableAccesses(emit_read, emit_write)\n        subnode_use_last_error = self.subnode_use_last_error\n\n        if subnode_use_last_error is not None:\n            self.subnode_use_last_error.collectVariableAccesses(emit_read, emit_write)\n        subnode_winmode = self.subnode_winmode\n\n        if subnode_winmode is not None:\n            self.subnode_winmode.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionCtypesCdllMixin = ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin\n\n\nclass ChildrenHavingNamePackageOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibImportModuleCall\n\n    def __init__(\n        self,\n        name,\n        package,\n    ):\n        name.parent = self\n\n        self.subnode_name = name\n\n        if package is not None:\n            package.parent = self\n\n        self.subnode_package = package\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_name)\n        value = self.subnode_package\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"name\", self.subnode_name),\n            (\"package\", self.subnode_package),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_package\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_package = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"name\": self.subnode_name.makeClone(),\n            \"package\": (\n                self.subnode_package.makeClone()\n                if self.subnode_package is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_package is not None:\n            self.subnode_package.finalize()\n        del self.subnode_package\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_package = self.subnode_package\n\n        if subnode_package is not None:\n            self.subnode_package.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibImportModuleCallMixin = (\n    ChildrenHavingNamePackageOptionalMixin\n)\n\n\nclass ChildHavingOperandMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionOperationNot\n    #   ExpressionOperationUnaryAbs\n    #   ExpressionOperationUnaryAdd\n    #   ExpressionOperationUnaryInvert\n    #   ExpressionOperationUnaryRepr\n    #   ExpressionOperationUnarySub\n\n    def __init__(\n        self,\n        operand,\n    ):\n        operand.parent = self\n\n        self.subnode_operand = operand\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_operand,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"operand\", self.subnode_operand),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_operand\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_operand = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"operand\": self.subnode_operand.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_operand.finalize()\n        del self.subnode_operand\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_operand)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_operand.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionOperationNotMixin = ChildHavingOperandMixin\nChildrenExpressionOperationUnaryAbsMixin = ChildHavingOperandMixin\nChildrenExpressionOperationUnaryAddMixin = ChildHavingOperandMixin\nChildrenExpressionOperationUnaryInvertMixin = ChildHavingOperandMixin\nChildrenExpressionOperationUnaryReprMixin = ChildHavingOperandMixin\nChildrenExpressionOperationUnarySubMixin = ChildHavingOperandMixin\n\n\nclass ChildHavingPMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionOsPathBasename\n    #   ExpressionOsPathDirname\n\n    def __init__(\n        self,\n        p,\n    ):\n        p.parent = self\n\n        self.subnode_p = p\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_p,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"p\", self.subnode_p),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_p\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_p = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"p\": self.subnode_p.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_p.finalize()\n        del self.subnode_p\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_p)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_p.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionOsPathBasenameMixin = ChildHavingPMixin\nChildrenExpressionOsPathDirnameMixin = ChildHavingPMixin\n\n\nclass ChildHavingPackageMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibResourcesBackportFiles\n    #   ExpressionImportlibResourcesBackportFilesCall\n    #   ExpressionImportlibResourcesFiles\n    #   ExpressionImportlibResourcesFilesCall\n\n    def __init__(\n        self,\n        package,\n    ):\n        package.parent = self\n\n        self.subnode_package = package\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_package,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"package\", self.subnode_package),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_package\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_package = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"package\": self.subnode_package.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_package.finalize()\n        del self.subnode_package\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_package)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_package.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibResourcesBackportFilesMixin = ChildHavingPackageMixin\nChildrenExpressionImportlibResourcesBackportFilesCallMixin = ChildHavingPackageMixin\nChildrenExpressionImportlibResourcesFilesMixin = ChildHavingPackageMixin\nChildrenExpressionImportlibResourcesFilesCallMixin = ChildHavingPackageMixin\n\n\nclass ChildrenHavingPackageResourceMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibResourcesBackportReadBinary\n    #   ExpressionImportlibResourcesBackportReadBinaryCall\n    #   ExpressionImportlibResourcesReadBinary\n    #   ExpressionImportlibResourcesReadBinaryCall\n    #   ExpressionPkgutilGetData\n    #   ExpressionPkgutilGetDataCall\n\n    def __init__(\n        self,\n        package,\n        resource,\n    ):\n        package.parent = self\n\n        self.subnode_package = package\n\n        resource.parent = self\n\n        self.subnode_resource = resource\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_package,\n            self.subnode_resource,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"package\", self.subnode_package),\n            (\"resource\", self.subnode_resource),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_package\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_package = new_node\n\n            return\n\n        value = self.subnode_resource\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_resource = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"package\": self.subnode_package.makeClone(),\n            \"resource\": self.subnode_resource.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_package.finalize()\n        del self.subnode_package\n        self.subnode_resource.finalize()\n        del self.subnode_resource\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_package.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_resource.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibResourcesBackportReadBinaryMixin = (\n    ChildrenHavingPackageResourceMixin\n)\nChildrenExpressionImportlibResourcesBackportReadBinaryCallMixin = (\n    ChildrenHavingPackageResourceMixin\n)\nChildrenExpressionImportlibResourcesReadBinaryMixin = ChildrenHavingPackageResourceMixin\nChildrenExpressionImportlibResourcesReadBinaryCallMixin = (\n    ChildrenHavingPackageResourceMixin\n)\nChildrenExpressionPkgutilGetDataMixin = ChildrenHavingPackageResourceMixin\nChildrenExpressionPkgutilGetDataCallMixin = ChildrenHavingPackageResourceMixin\n\n\nclass ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibResourcesBackportReadText\n    #   ExpressionImportlibResourcesBackportReadTextCall\n    #   ExpressionImportlibResourcesReadText\n    #   ExpressionImportlibResourcesReadTextCall\n\n    def __init__(\n        self,\n        package,\n        resource,\n        encoding,\n        errors,\n    ):\n        package.parent = self\n\n        self.subnode_package = package\n\n        resource.parent = self\n\n        self.subnode_resource = resource\n\n        if encoding is not None:\n            encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        if errors is not None:\n            errors.parent = self\n\n        self.subnode_errors = errors\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_package)\n        result.append(self.subnode_resource)\n        value = self.subnode_encoding\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_errors\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"package\", self.subnode_package),\n            (\"resource\", self.subnode_resource),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_package\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_package = new_node\n\n            return\n\n        value = self.subnode_resource\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_resource = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"package\": self.subnode_package.makeClone(),\n            \"resource\": self.subnode_resource.makeClone(),\n            \"encoding\": (\n                self.subnode_encoding.makeClone()\n                if self.subnode_encoding is not None\n                else None\n            ),\n            \"errors\": (\n                self.subnode_errors.makeClone()\n                if self.subnode_errors is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_package.finalize()\n        del self.subnode_package\n        self.subnode_resource.finalize()\n        del self.subnode_resource\n        if self.subnode_encoding is not None:\n            self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        if self.subnode_errors is not None:\n            self.subnode_errors.finalize()\n        del self.subnode_errors\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_package.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_resource.collectVariableAccesses(emit_read, emit_write)\n        subnode_encoding = self.subnode_encoding\n\n        if subnode_encoding is not None:\n            self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        subnode_errors = self.subnode_errors\n\n        if subnode_errors is not None:\n            self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibResourcesBackportReadTextMixin = (\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin\n)\nChildrenExpressionImportlibResourcesBackportReadTextCallMixin = (\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin\n)\nChildrenExpressionImportlibResourcesReadTextMixin = (\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin\n)\nChildrenExpressionImportlibResourcesReadTextCallMixin = (\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin\n)\n\n\nclass ChildrenHavingPackageOrRequirementResourceNameMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionPkgResourcesResourceStream\n    #   ExpressionPkgResourcesResourceStreamCall\n    #   ExpressionPkgResourcesResourceString\n    #   ExpressionPkgResourcesResourceStringCall\n\n    def __init__(\n        self,\n        package_or_requirement,\n        resource_name,\n    ):\n        package_or_requirement.parent = self\n\n        self.subnode_package_or_requirement = package_or_requirement\n\n        resource_name.parent = self\n\n        self.subnode_resource_name = resource_name\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_package_or_requirement,\n            self.subnode_resource_name,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"package_or_requirement\", self.subnode_package_or_requirement),\n            (\"resource_name\", self.subnode_resource_name),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_package_or_requirement\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_package_or_requirement = new_node\n\n            return\n\n        value = self.subnode_resource_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_resource_name = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"package_or_requirement\": self.subnode_package_or_requirement.makeClone(),\n            \"resource_name\": self.subnode_resource_name.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_package_or_requirement.finalize()\n        del self.subnode_package_or_requirement\n        self.subnode_resource_name.finalize()\n        del self.subnode_resource_name\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_package_or_requirement.collectVariableAccesses(\n            emit_read, emit_write\n        )\n        self.subnode_resource_name.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionPkgResourcesResourceStreamMixin = (\n    ChildrenHavingPackageOrRequirementResourceNameMixin\n)\nChildrenExpressionPkgResourcesResourceStreamCallMixin = (\n    ChildrenHavingPackageOrRequirementResourceNameMixin\n)\nChildrenExpressionPkgResourcesResourceStringMixin = (\n    ChildrenHavingPackageOrRequirementResourceNameMixin\n)\nChildrenExpressionPkgResourcesResourceStringCallMixin = (\n    ChildrenHavingPackageOrRequirementResourceNameMixin\n)\n\n\nclass ChildHavingPairsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionMakeDict\n\n    def __init__(\n        self,\n        pairs,\n    ):\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_pairs\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"pairs\", self.subnode_pairs),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_pairs = self.subnode_pairs\n\n        for sub_expression in old_subnode_pairs:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_pairs[\n                        : old_subnode_pairs.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionMakeDictMixin = ChildHavingPairsTupleMixin\n\n\nclass ChildHavingParamsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportEntryPoints\n    #   ExpressionImportlibMetadataBackportEntryPointsCall\n    #   ExpressionImportlibMetadataEntryPoints\n    #   ExpressionImportlibMetadataEntryPointsSince310Call\n\n    def __init__(\n        self,\n        params,\n    ):\n        assert type(params) is tuple\n\n        for val in params:\n            val.parent = self\n\n        self.subnode_params = params\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_params\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"params\", self.subnode_params),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_params\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_params = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_params = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"params\": tuple(v.makeClone() for v in self.subnode_params),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_params:\n            c.finalize()\n        del self.subnode_params\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_params = self.subnode_params\n\n        for sub_expression in old_subnode_params:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_params[\n                        : old_subnode_params.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_params:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionImportlibMetadataBackportEntryPointsMixin = (\n    ChildHavingParamsTupleMixin\n)\nChildrenExpressionImportlibMetadataBackportEntryPointsCallMixin = (\n    ChildHavingParamsTupleMixin\n)\nChildrenExpressionImportlibMetadataEntryPointsMixin = ChildHavingParamsTupleMixin\nChildrenExpressionImportlibMetadataEntryPointsSince310CallMixin = (\n    ChildHavingParamsTupleMixin\n)\n\n\nclass ChildHavingPathMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionOsPathAbspath\n    #   ExpressionOsPathExists\n    #   ExpressionOsPathIsdir\n    #   ExpressionOsPathIsfile\n\n    def __init__(\n        self,\n        path,\n    ):\n        path.parent = self\n\n        self.subnode_path = path\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_path,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"path\", self.subnode_path),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_path\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_path = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"path\": self.subnode_path.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_path.finalize()\n        del self.subnode_path\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_path)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_path.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionOsPathAbspathMixin = ChildHavingPathMixin\nChildrenExpressionOsPathExistsMixin = ChildHavingPathMixin\nChildrenExpressionOsPathIsdirMixin = ChildHavingPathMixin\nChildrenExpressionOsPathIsfileMixin = ChildHavingPathMixin\n\n\nclass ChildHavingPathOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionOsListdir\n\n    def __init__(\n        self,\n        path,\n    ):\n        if path is not None:\n            path.parent = self\n\n        self.subnode_path = path\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_path\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"path\", self.subnode_path),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_path\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_path = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"path\": (\n                self.subnode_path.makeClone() if self.subnode_path is not None else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_path is not None:\n            self.subnode_path.finalize()\n        del self.subnode_path\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = self.subnode_path\n\n        if expression is not None:\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                return (\n                    expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_path = self.subnode_path\n\n        if subnode_path is not None:\n            self.subnode_path.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionOsListdirMixin = ChildHavingPathOptionalMixin\n\n\nclass ChildrenHavingPosArgOptionalPairsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinDict\n\n    def __init__(\n        self,\n        pos_arg,\n        pairs,\n    ):\n        if pos_arg is not None:\n            pos_arg.parent = self\n\n        self.subnode_pos_arg = pos_arg\n\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_pos_arg\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.extend(self.subnode_pairs)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"pos_arg\", self.subnode_pos_arg),\n            (\"pairs\", self.subnode_pairs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_pos_arg\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_pos_arg = new_node\n\n            return\n\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"pos_arg\": (\n                self.subnode_pos_arg.makeClone()\n                if self.subnode_pos_arg is not None\n                else None\n            ),\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_pos_arg is not None:\n            self.subnode_pos_arg.finalize()\n        del self.subnode_pos_arg\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_pos_arg = self.subnode_pos_arg\n\n        if subnode_pos_arg is not None:\n            self.subnode_pos_arg.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinDictMixin = ChildrenHavingPosArgOptionalPairsTupleMixin\n\n\nclass ChildrenHavingRealOptionalImagMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinComplex2\n\n    def __init__(\n        self,\n        real,\n        imag,\n    ):\n        if real is not None:\n            real.parent = self\n\n        self.subnode_real = real\n\n        imag.parent = self\n\n        self.subnode_imag = imag\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_real\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_imag)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"real\", self.subnode_real),\n            (\"imag\", self.subnode_imag),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_real\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_real = new_node\n\n            return\n\n        value = self.subnode_imag\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_imag = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"real\": (\n                self.subnode_real.makeClone() if self.subnode_real is not None else None\n            ),\n            \"imag\": self.subnode_imag.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_real is not None:\n            self.subnode_real.finalize()\n        del self.subnode_real\n        self.subnode_imag.finalize()\n        del self.subnode_imag\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_real = self.subnode_real\n\n        if subnode_real is not None:\n            self.subnode_real.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_imag.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinComplex2Mixin = ChildrenHavingRealOptionalImagMixin\n\n\nclass ChildHavingRequirementsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionPkgResourcesRequire\n    #   ExpressionPkgResourcesRequireCall\n\n    def __init__(\n        self,\n        requirements,\n    ):\n        assert type(requirements) is tuple\n\n        for val in requirements:\n            val.parent = self\n\n        self.subnode_requirements = requirements\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_requirements\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"requirements\", self.subnode_requirements),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_requirements\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_requirements = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_requirements = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"requirements\": tuple(v.makeClone() for v in self.subnode_requirements),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_requirements:\n            c.finalize()\n        del self.subnode_requirements\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_requirements = self.subnode_requirements\n\n        for sub_expression in old_subnode_requirements:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_requirements[\n                        : old_subnode_requirements.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_requirements:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionPkgResourcesRequireMixin = ChildHavingRequirementsTupleMixin\nChildrenExpressionPkgResourcesRequireCallMixin = ChildHavingRequirementsTupleMixin\n\n\nclass ChildHavingSMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionOsPathIsabs\n\n    def __init__(\n        self,\n        s,\n    ):\n        s.parent = self\n\n        self.subnode_s = s\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_s,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"s\", self.subnode_s),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_s\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_s = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"s\": self.subnode_s.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_s.finalize()\n        del self.subnode_s\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_s)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_s.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionOsPathIsabsMixin = ChildHavingSMixin\n\n\nclass ChildHavingSequenceMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSum1\n\n    def __init__(\n        self,\n        sequence,\n    ):\n        sequence.parent = self\n\n        self.subnode_sequence = sequence\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_sequence,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"sequence\", self.subnode_sequence),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_sequence\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sequence = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"sequence\": self.subnode_sequence.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_sequence.finalize()\n        del self.subnode_sequence\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_sequence)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_sequence.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSum1Mixin = ChildHavingSequenceMixin\n\n\nclass ChildrenHavingSequenceStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSum2\n\n    def __init__(\n        self,\n        sequence,\n        start,\n    ):\n        sequence.parent = self\n\n        self.subnode_sequence = sequence\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_sequence,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"sequence\", self.subnode_sequence),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_sequence\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sequence = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"sequence\": self.subnode_sequence.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_sequence.finalize()\n        del self.subnode_sequence\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_sequence.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSum2Mixin = ChildrenHavingSequenceStartMixin\n\n\nclass ChildrenHavingSetArgValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSetOperationUpdate\n\n    def __init__(\n        self,\n        set_arg,\n        value,\n    ):\n        set_arg.parent = self\n\n        self.subnode_set_arg = set_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_set_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"set_arg\", self.subnode_set_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_set_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_set_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"set_arg\": self.subnode_set_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_set_arg.finalize()\n        del self.subnode_set_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_set_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSetOperationUpdateMixin = ChildrenHavingSetArgValueMixin\n\n\nclass ChildrenHavingSideEffectsTupleExpressionMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSideEffects\n\n    def __init__(\n        self,\n        side_effects,\n        expression,\n    ):\n        assert type(side_effects) is tuple\n\n        for val in side_effects:\n            val.parent = self\n\n        self.subnode_side_effects = side_effects\n\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n    def setChildExpression(self, value):\n        value.parent = self\n\n        self.subnode_expression = value\n\n    def setChildSideEffects(self, value):\n        assert type(value) is tuple, type(value)\n\n        for val in value:\n            val.parent = self\n\n        self.subnode_side_effects = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.extend(self.subnode_side_effects)\n        result.append(self.subnode_expression)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"side_effects\", self.subnode_side_effects),\n            (\"expression\", self.subnode_expression),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_side_effects\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_side_effects = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_side_effects = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"side_effects\": tuple(v.makeClone() for v in self.subnode_side_effects),\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_side_effects:\n            c.finalize()\n        del self.subnode_side_effects\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_side_effects:\n            element.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionSideEffectsMixin = ChildrenHavingSideEffectsTupleExpressionMixin\n\n\nclass ChildHavingSourceMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinVars\n\n    def __init__(\n        self,\n        source,\n    ):\n        source.parent = self\n\n        self.subnode_source = source\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_source,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"source\", self.subnode_source),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_source)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinVarsMixin = ChildHavingSourceMixin\n\n\nclass ChildrenHavingSourceFilenameModeFlagsOptionalDontInheritOptionalOptimizeOptionalMixin(\n    object\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinCompile\n\n    def __init__(\n        self,\n        source,\n        filename,\n        mode,\n        flags,\n        dont_inherit,\n        optimize,\n    ):\n        source.parent = self\n\n        self.subnode_source = source\n\n        filename.parent = self\n\n        self.subnode_filename = filename\n\n        mode.parent = self\n\n        self.subnode_mode = mode\n\n        if flags is not None:\n            flags.parent = self\n\n        self.subnode_flags = flags\n\n        if dont_inherit is not None:\n            dont_inherit.parent = self\n\n        self.subnode_dont_inherit = dont_inherit\n\n        if optimize is not None:\n            optimize.parent = self\n\n        self.subnode_optimize = optimize\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_source)\n        result.append(self.subnode_filename)\n        result.append(self.subnode_mode)\n        value = self.subnode_flags\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_dont_inherit\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_optimize\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source\", self.subnode_source),\n            (\"filename\", self.subnode_filename),\n            (\"mode\", self.subnode_mode),\n            (\"flags\", self.subnode_flags),\n            (\"dont_inherit\", self.subnode_dont_inherit),\n            (\"optimize\", self.subnode_optimize),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        value = self.subnode_filename\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_filename = new_node\n\n            return\n\n        value = self.subnode_mode\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_mode = new_node\n\n            return\n\n        value = self.subnode_flags\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_flags = new_node\n\n            return\n\n        value = self.subnode_dont_inherit\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_dont_inherit = new_node\n\n            return\n\n        value = self.subnode_optimize\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_optimize = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n            \"filename\": self.subnode_filename.makeClone(),\n            \"mode\": self.subnode_mode.makeClone(),\n            \"flags\": (\n                self.subnode_flags.makeClone()\n                if self.subnode_flags is not None\n                else None\n            ),\n            \"dont_inherit\": (\n                self.subnode_dont_inherit.makeClone()\n                if self.subnode_dont_inherit is not None\n                else None\n            ),\n            \"optimize\": (\n                self.subnode_optimize.makeClone()\n                if self.subnode_optimize is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n        self.subnode_filename.finalize()\n        del self.subnode_filename\n        self.subnode_mode.finalize()\n        del self.subnode_mode\n        if self.subnode_flags is not None:\n            self.subnode_flags.finalize()\n        del self.subnode_flags\n        if self.subnode_dont_inherit is not None:\n            self.subnode_dont_inherit.finalize()\n        del self.subnode_dont_inherit\n        if self.subnode_optimize is not None:\n            self.subnode_optimize.finalize()\n        del self.subnode_optimize\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_filename.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_mode.collectVariableAccesses(emit_read, emit_write)\n        subnode_flags = self.subnode_flags\n\n        if subnode_flags is not None:\n            self.subnode_flags.collectVariableAccesses(emit_read, emit_write)\n        subnode_dont_inherit = self.subnode_dont_inherit\n\n        if subnode_dont_inherit is not None:\n            self.subnode_dont_inherit.collectVariableAccesses(emit_read, emit_write)\n        subnode_optimize = self.subnode_optimize\n\n        if subnode_optimize is not None:\n            self.subnode_optimize.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinCompileMixin = ChildrenHavingSourceFilenameModeFlagsOptionalDontInheritOptionalOptimizeOptionalMixin\n\n\nclass ChildrenHavingSourceCodeGlobalsArgLocalsArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinEval\n    #   ExpressionBuiltinExecfile\n\n    def __init__(\n        self,\n        source_code,\n        globals_arg,\n        locals_arg,\n    ):\n        source_code.parent = self\n\n        self.subnode_source_code = source_code\n\n        globals_arg.parent = self\n\n        self.subnode_globals_arg = globals_arg\n\n        locals_arg.parent = self\n\n        self.subnode_locals_arg = locals_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_source_code,\n            self.subnode_globals_arg,\n            self.subnode_locals_arg,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source_code\", self.subnode_source_code),\n            (\"globals_arg\", self.subnode_globals_arg),\n            (\"locals_arg\", self.subnode_locals_arg),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source_code\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source_code = new_node\n\n            return\n\n        value = self.subnode_globals_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_globals_arg = new_node\n\n            return\n\n        value = self.subnode_locals_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_locals_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source_code\": self.subnode_source_code.makeClone(),\n            \"globals_arg\": self.subnode_globals_arg.makeClone(),\n            \"locals_arg\": self.subnode_locals_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source_code.finalize()\n        del self.subnode_source_code\n        self.subnode_globals_arg.finalize()\n        del self.subnode_globals_arg\n        self.subnode_locals_arg.finalize()\n        del self.subnode_locals_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source_code.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_globals_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_locals_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinEvalMixin = ChildrenHavingSourceCodeGlobalsArgLocalsArgMixin\nChildrenExpressionBuiltinExecfileMixin = (\n    ChildrenHavingSourceCodeGlobalsArgLocalsArgMixin\n)\n\n\nclass ChildrenHavingSourceCodeGlobalsArgLocalsArgClosureOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinExec\n\n    def __init__(\n        self,\n        source_code,\n        globals_arg,\n        locals_arg,\n        closure,\n    ):\n        source_code.parent = self\n\n        self.subnode_source_code = source_code\n\n        globals_arg.parent = self\n\n        self.subnode_globals_arg = globals_arg\n\n        locals_arg.parent = self\n\n        self.subnode_locals_arg = locals_arg\n\n        if closure is not None:\n            closure.parent = self\n\n        self.subnode_closure = closure\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_source_code)\n        result.append(self.subnode_globals_arg)\n        result.append(self.subnode_locals_arg)\n        value = self.subnode_closure\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source_code\", self.subnode_source_code),\n            (\"globals_arg\", self.subnode_globals_arg),\n            (\"locals_arg\", self.subnode_locals_arg),\n            (\"closure\", self.subnode_closure),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source_code\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source_code = new_node\n\n            return\n\n        value = self.subnode_globals_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_globals_arg = new_node\n\n            return\n\n        value = self.subnode_locals_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_locals_arg = new_node\n\n            return\n\n        value = self.subnode_closure\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_closure = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source_code\": self.subnode_source_code.makeClone(),\n            \"globals_arg\": self.subnode_globals_arg.makeClone(),\n            \"locals_arg\": self.subnode_locals_arg.makeClone(),\n            \"closure\": (\n                self.subnode_closure.makeClone()\n                if self.subnode_closure is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source_code.finalize()\n        del self.subnode_source_code\n        self.subnode_globals_arg.finalize()\n        del self.subnode_globals_arg\n        self.subnode_locals_arg.finalize()\n        del self.subnode_locals_arg\n        if self.subnode_closure is not None:\n            self.subnode_closure.finalize()\n        del self.subnode_closure\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source_code.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_globals_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_locals_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_closure = self.subnode_closure\n\n        if subnode_closure is not None:\n            self.subnode_closure.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinExecMixin = (\n    ChildrenHavingSourceCodeGlobalsArgLocalsArgClosureOptionalMixin\n)\n\n\nclass ChildrenHavingStartStopMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSlice2\n\n    def __init__(\n        self,\n        start,\n        stop,\n    ):\n        start.parent = self\n\n        self.subnode_start = start\n\n        stop.parent = self\n\n        self.subnode_stop = stop\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_start,\n            self.subnode_stop,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"start\", self.subnode_start),\n            (\"stop\", self.subnode_stop),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_stop\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_stop = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"start\": self.subnode_start.makeClone(),\n            \"stop\": self.subnode_stop.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_stop.finalize()\n        del self.subnode_stop\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_stop.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSlice2Mixin = ChildrenHavingStartStopMixin\n\n\nclass ChildrenHavingStartStopStepMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSlice3\n\n    def __init__(\n        self,\n        start,\n        stop,\n        step,\n    ):\n        start.parent = self\n\n        self.subnode_start = start\n\n        stop.parent = self\n\n        self.subnode_stop = stop\n\n        step.parent = self\n\n        self.subnode_step = step\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_start,\n            self.subnode_stop,\n            self.subnode_step,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"start\", self.subnode_start),\n            (\"stop\", self.subnode_stop),\n            (\"step\", self.subnode_step),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_stop\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_stop = new_node\n\n            return\n\n        value = self.subnode_step\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_step = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"start\": self.subnode_start.makeClone(),\n            \"stop\": self.subnode_stop.makeClone(),\n            \"step\": self.subnode_step.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_stop.finalize()\n        del self.subnode_stop\n        self.subnode_step.finalize()\n        del self.subnode_step\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_stop.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_step.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSlice3Mixin = ChildrenHavingStartStopStepMixin\n\n\nclass ChildHavingStopMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSlice1\n\n    def __init__(\n        self,\n        stop,\n    ):\n        stop.parent = self\n\n        self.subnode_stop = stop\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_stop,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"stop\", self.subnode_stop),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_stop\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_stop = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"stop\": self.subnode_stop.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_stop.finalize()\n        del self.subnode_stop\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_stop)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_stop.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSlice1Mixin = ChildHavingStopMixin\n\n\nclass ChildHavingStrArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCapitalize\n    #   ExpressionStrOperationCapitalizeBase\n    #   ExpressionStrOperationCasefoldBase\n    #   ExpressionStrOperationDecode1\n    #   ExpressionStrOperationEncode1\n    #   ExpressionStrOperationExpandtabs1\n    #   ExpressionStrOperationFormatmapBase\n    #   ExpressionStrOperationIsalnum\n    #   ExpressionStrOperationIsalpha\n    #   ExpressionStrOperationIsalphaBase\n    #   ExpressionStrOperationIsasciiBase\n    #   ExpressionStrOperationIsdecimalBase\n    #   ExpressionStrOperationIsdigit\n    #   ExpressionStrOperationIsidentifierBase\n    #   ExpressionStrOperationIslower\n    #   ExpressionStrOperationIsnumericBase\n    #   ExpressionStrOperationIsprintableBase\n    #   ExpressionStrOperationIsspace\n    #   ExpressionStrOperationIsspaceBase\n    #   ExpressionStrOperationIstitle\n    #   ExpressionStrOperationIstitleBase\n    #   ExpressionStrOperationIsupper\n    #   ExpressionStrOperationLower\n    #   ExpressionStrOperationLstrip1\n    #   ExpressionStrOperationMaketransBase\n    #   ExpressionStrOperationRsplit1\n    #   ExpressionStrOperationRstrip1\n    #   ExpressionStrOperationSplit1\n    #   ExpressionStrOperationSplitlines1\n    #   ExpressionStrOperationStrip1\n    #   ExpressionStrOperationSwapcase\n    #   ExpressionStrOperationSwapcaseBase\n    #   ExpressionStrOperationTitle\n    #   ExpressionStrOperationTitleBase\n    #   ExpressionStrOperationUpper\n\n    def __init__(\n        self,\n        str_arg,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_str_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"str_arg\", self.subnode_str_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_str_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCapitalizeMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationCapitalizeBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationCasefoldBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationDecode1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationEncode1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationExpandtabs1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationFormatmapBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsalnumMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsalphaMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsalphaBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsasciiBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsdecimalBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsdigitMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsidentifierBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIslowerMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsnumericBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsprintableBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsspaceMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsspaceBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIstitleMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIstitleBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationIsupperMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationLowerMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationLstrip1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationMaketransBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationRsplit1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationRstrip1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationSplit1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationSplitlines1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationStrip1Mixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationSwapcaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationSwapcaseBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationTitleMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationTitleBaseMixin = ChildHavingStrArgMixin\nChildrenExpressionStrOperationUpperMixin = ChildHavingStrArgMixin\n\n\nclass ChildrenHavingStrArgArgsTuplePairsTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationFormat\n\n    def __init__(\n        self,\n        str_arg,\n        args,\n        pairs,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        assert type(args) is tuple\n\n        for val in args:\n            val.parent = self\n\n        self.subnode_args = args\n\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_str_arg)\n        result.extend(self.subnode_args)\n        result.extend(self.subnode_pairs)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"args\", self.subnode_args),\n            (\"pairs\", self.subnode_pairs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_args\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_args = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_args = tuple(val for val in value if val is not old_node)\n\n            return\n\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"args\": tuple(v.makeClone() for v in self.subnode_args),\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        for c in self.subnode_args:\n            c.finalize()\n        del self.subnode_args\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_args:\n            element.collectVariableAccesses(emit_read, emit_write)\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationFormatMixin = ChildrenHavingStrArgArgsTuplePairsTupleMixin\n\n\nclass ChildrenHavingStrArgCharsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationLstrip2\n    #   ExpressionStrOperationRstrip2\n    #   ExpressionStrOperationStrip2\n\n    def __init__(\n        self,\n        str_arg,\n        chars,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        chars.parent = self\n\n        self.subnode_chars = chars\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_chars,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"chars\", self.subnode_chars),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_chars\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_chars = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"chars\": self.subnode_chars.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_chars.finalize()\n        del self.subnode_chars\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_chars.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationLstrip2Mixin = ChildrenHavingStrArgCharsMixin\nChildrenExpressionStrOperationRstrip2Mixin = ChildrenHavingStrArgCharsMixin\nChildrenExpressionStrOperationStrip2Mixin = ChildrenHavingStrArgCharsMixin\n\n\nclass ChildrenHavingStrArgEncodingMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationDecode2\n    #   ExpressionStrOperationEncode2\n\n    def __init__(\n        self,\n        str_arg,\n        encoding,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_encoding,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"encoding\", self.subnode_encoding),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"encoding\": self.subnode_encoding.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_encoding.finalize()\n        del self.subnode_encoding\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationDecode2Mixin = ChildrenHavingStrArgEncodingMixin\nChildrenExpressionStrOperationEncode2Mixin = ChildrenHavingStrArgEncodingMixin\n\n\nclass ChildrenHavingStrArgEncodingErrorsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationDecode3\n    #   ExpressionStrOperationEncode3\n\n    def __init__(\n        self,\n        str_arg,\n        encoding,\n        errors,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        errors.parent = self\n\n        self.subnode_errors = errors\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_encoding,\n            self.subnode_errors,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"encoding\": self.subnode_encoding.makeClone(),\n            \"errors\": self.subnode_errors.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        self.subnode_errors.finalize()\n        del self.subnode_errors\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationDecode3Mixin = ChildrenHavingStrArgEncodingErrorsMixin\nChildrenExpressionStrOperationEncode3Mixin = ChildrenHavingStrArgEncodingErrorsMixin\n\n\nclass ChildrenHavingStrArgIterableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationJoin\n\n    def __init__(\n        self,\n        str_arg,\n        iterable,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        iterable.parent = self\n\n        self.subnode_iterable = iterable\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_iterable,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"iterable\", self.subnode_iterable),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_iterable\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterable = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"iterable\": self.subnode_iterable.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_iterable.finalize()\n        del self.subnode_iterable\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_iterable.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationJoinMixin = ChildrenHavingStrArgIterableMixin\n\n\nclass ChildrenHavingStrArgKeependsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationSplitlines2\n\n    def __init__(\n        self,\n        str_arg,\n        keepends,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        keepends.parent = self\n\n        self.subnode_keepends = keepends\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_keepends,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"keepends\", self.subnode_keepends),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_keepends\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_keepends = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"keepends\": self.subnode_keepends.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_keepends.finalize()\n        del self.subnode_keepends\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_keepends.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationSplitlines2Mixin = ChildrenHavingStrArgKeependsMixin\n\n\nclass ChildrenHavingStrArgOldNewMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationReplace3\n\n    def __init__(\n        self,\n        str_arg,\n        old,\n        new,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        old.parent = self\n\n        self.subnode_old = old\n\n        new.parent = self\n\n        self.subnode_new = new\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_old,\n            self.subnode_new,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"old\", self.subnode_old),\n            (\"new\", self.subnode_new),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_old\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_old = new_node\n\n            return\n\n        value = self.subnode_new\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_new = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"old\": self.subnode_old.makeClone(),\n            \"new\": self.subnode_new.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_old.finalize()\n        del self.subnode_old\n        self.subnode_new.finalize()\n        del self.subnode_new\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_old.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_new.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationReplace3Mixin = ChildrenHavingStrArgOldNewMixin\n\n\nclass ChildrenHavingStrArgOldNewCountMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationReplace4\n\n    def __init__(\n        self,\n        str_arg,\n        old,\n        new,\n        count,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        old.parent = self\n\n        self.subnode_old = old\n\n        new.parent = self\n\n        self.subnode_new = new\n\n        count.parent = self\n\n        self.subnode_count = count\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_old,\n            self.subnode_new,\n            self.subnode_count,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"old\", self.subnode_old),\n            (\"new\", self.subnode_new),\n            (\"count\", self.subnode_count),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_old\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_old = new_node\n\n            return\n\n        value = self.subnode_new\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_new = new_node\n\n            return\n\n        value = self.subnode_count\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_count = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"old\": self.subnode_old.makeClone(),\n            \"new\": self.subnode_new.makeClone(),\n            \"count\": self.subnode_count.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_old.finalize()\n        del self.subnode_old\n        self.subnode_new.finalize()\n        del self.subnode_new\n        self.subnode_count.finalize()\n        del self.subnode_count\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_old.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_new.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_count.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationReplace4Mixin = ChildrenHavingStrArgOldNewCountMixin\n\n\nclass ChildrenHavingStrArgPrefixMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationStartswith2\n\n    def __init__(\n        self,\n        str_arg,\n        prefix,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_prefix,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"prefix\", self.subnode_prefix),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationStartswith2Mixin = ChildrenHavingStrArgPrefixMixin\n\n\nclass ChildrenHavingStrArgPrefixStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationStartswith3\n\n    def __init__(\n        self,\n        str_arg,\n        prefix,\n        start,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_prefix,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"prefix\", self.subnode_prefix),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationStartswith3Mixin = ChildrenHavingStrArgPrefixStartMixin\n\n\nclass ChildrenHavingStrArgPrefixStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationStartswith4\n\n    def __init__(\n        self,\n        str_arg,\n        prefix,\n        start,\n        end,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        prefix.parent = self\n\n        self.subnode_prefix = prefix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_prefix,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"prefix\", self.subnode_prefix),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_prefix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_prefix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"prefix\": self.subnode_prefix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_prefix.finalize()\n        del self.subnode_prefix\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_prefix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationStartswith4Mixin = ChildrenHavingStrArgPrefixStartEndMixin\n\n\nclass ChildrenHavingStrArgSepMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationPartition\n    #   ExpressionStrOperationRpartition\n    #   ExpressionStrOperationRsplit2\n    #   ExpressionStrOperationSplit2\n\n    def __init__(\n        self,\n        str_arg,\n        sep,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        sep.parent = self\n\n        self.subnode_sep = sep\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_sep,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"sep\", self.subnode_sep),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_sep\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sep = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"sep\": self.subnode_sep.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_sep.finalize()\n        del self.subnode_sep\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sep.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationPartitionMixin = ChildrenHavingStrArgSepMixin\nChildrenExpressionStrOperationRpartitionMixin = ChildrenHavingStrArgSepMixin\nChildrenExpressionStrOperationRsplit2Mixin = ChildrenHavingStrArgSepMixin\nChildrenExpressionStrOperationSplit2Mixin = ChildrenHavingStrArgSepMixin\n\n\nclass ChildrenHavingStrArgSepMaxsplitMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationRsplit3\n    #   ExpressionStrOperationSplit3\n\n    def __init__(\n        self,\n        str_arg,\n        sep,\n        maxsplit,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        sep.parent = self\n\n        self.subnode_sep = sep\n\n        maxsplit.parent = self\n\n        self.subnode_maxsplit = maxsplit\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_sep,\n            self.subnode_maxsplit,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"sep\", self.subnode_sep),\n            (\"maxsplit\", self.subnode_maxsplit),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_sep\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sep = new_node\n\n            return\n\n        value = self.subnode_maxsplit\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_maxsplit = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"sep\": self.subnode_sep.makeClone(),\n            \"maxsplit\": self.subnode_maxsplit.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_sep.finalize()\n        del self.subnode_sep\n        self.subnode_maxsplit.finalize()\n        del self.subnode_maxsplit\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sep.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_maxsplit.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationRsplit3Mixin = ChildrenHavingStrArgSepMaxsplitMixin\nChildrenExpressionStrOperationSplit3Mixin = ChildrenHavingStrArgSepMaxsplitMixin\n\n\nclass ChildrenHavingStrArgSubMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCount2\n    #   ExpressionStrOperationFind2\n    #   ExpressionStrOperationIndex2\n    #   ExpressionStrOperationRfind2\n    #   ExpressionStrOperationRindex2\n\n    def __init__(\n        self,\n        str_arg,\n        sub,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_sub,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"sub\", self.subnode_sub),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCount2Mixin = ChildrenHavingStrArgSubMixin\nChildrenExpressionStrOperationFind2Mixin = ChildrenHavingStrArgSubMixin\nChildrenExpressionStrOperationIndex2Mixin = ChildrenHavingStrArgSubMixin\nChildrenExpressionStrOperationRfind2Mixin = ChildrenHavingStrArgSubMixin\nChildrenExpressionStrOperationRindex2Mixin = ChildrenHavingStrArgSubMixin\n\n\nclass ChildrenHavingStrArgSubStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCount3\n    #   ExpressionStrOperationFind3\n    #   ExpressionStrOperationIndex3\n    #   ExpressionStrOperationRfind3\n    #   ExpressionStrOperationRindex3\n\n    def __init__(\n        self,\n        str_arg,\n        sub,\n        start,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_sub,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"sub\", self.subnode_sub),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCount3Mixin = ChildrenHavingStrArgSubStartMixin\nChildrenExpressionStrOperationFind3Mixin = ChildrenHavingStrArgSubStartMixin\nChildrenExpressionStrOperationIndex3Mixin = ChildrenHavingStrArgSubStartMixin\nChildrenExpressionStrOperationRfind3Mixin = ChildrenHavingStrArgSubStartMixin\nChildrenExpressionStrOperationRindex3Mixin = ChildrenHavingStrArgSubStartMixin\n\n\nclass ChildrenHavingStrArgSubStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCount4\n    #   ExpressionStrOperationFind4\n    #   ExpressionStrOperationIndex4\n    #   ExpressionStrOperationRfind4\n    #   ExpressionStrOperationRindex4\n\n    def __init__(\n        self,\n        str_arg,\n        sub,\n        start,\n        end,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        sub.parent = self\n\n        self.subnode_sub = sub\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_sub,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"sub\", self.subnode_sub),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_sub\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sub = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"sub\": self.subnode_sub.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_sub.finalize()\n        del self.subnode_sub\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sub.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCount4Mixin = ChildrenHavingStrArgSubStartEndMixin\nChildrenExpressionStrOperationFind4Mixin = ChildrenHavingStrArgSubStartEndMixin\nChildrenExpressionStrOperationIndex4Mixin = ChildrenHavingStrArgSubStartEndMixin\nChildrenExpressionStrOperationRfind4Mixin = ChildrenHavingStrArgSubStartEndMixin\nChildrenExpressionStrOperationRindex4Mixin = ChildrenHavingStrArgSubStartEndMixin\n\n\nclass ChildrenHavingStrArgSuffixMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationEndswith2\n\n    def __init__(\n        self,\n        str_arg,\n        suffix,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_suffix,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"suffix\", self.subnode_suffix),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationEndswith2Mixin = ChildrenHavingStrArgSuffixMixin\n\n\nclass ChildrenHavingStrArgSuffixStartMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationEndswith3\n\n    def __init__(\n        self,\n        str_arg,\n        suffix,\n        start,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_suffix,\n            self.subnode_start,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"suffix\", self.subnode_suffix),\n            (\"start\", self.subnode_start),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n        self.subnode_start.finalize()\n        del self.subnode_start\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationEndswith3Mixin = ChildrenHavingStrArgSuffixStartMixin\n\n\nclass ChildrenHavingStrArgSuffixStartEndMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationEndswith4\n\n    def __init__(\n        self,\n        str_arg,\n        suffix,\n        start,\n        end,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        suffix.parent = self\n\n        self.subnode_suffix = suffix\n\n        start.parent = self\n\n        self.subnode_start = start\n\n        end.parent = self\n\n        self.subnode_end = end\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_suffix,\n            self.subnode_start,\n            self.subnode_end,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"suffix\", self.subnode_suffix),\n            (\"start\", self.subnode_start),\n            (\"end\", self.subnode_end),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_suffix\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_suffix = new_node\n\n            return\n\n        value = self.subnode_start\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_start = new_node\n\n            return\n\n        value = self.subnode_end\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_end = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"suffix\": self.subnode_suffix.makeClone(),\n            \"start\": self.subnode_start.makeClone(),\n            \"end\": self.subnode_end.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_suffix.finalize()\n        del self.subnode_suffix\n        self.subnode_start.finalize()\n        del self.subnode_start\n        self.subnode_end.finalize()\n        del self.subnode_end\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_suffix.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_start.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_end.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationEndswith4Mixin = ChildrenHavingStrArgSuffixStartEndMixin\n\n\nclass ChildrenHavingStrArgTableMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationTranslate\n    #   ExpressionStrOperationTranslateBase\n\n    def __init__(\n        self,\n        str_arg,\n        table,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        table.parent = self\n\n        self.subnode_table = table\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_table,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"table\", self.subnode_table),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_table\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_table = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"table\": self.subnode_table.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_table.finalize()\n        del self.subnode_table\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_table.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationTranslateMixin = ChildrenHavingStrArgTableMixin\nChildrenExpressionStrOperationTranslateBaseMixin = ChildrenHavingStrArgTableMixin\n\n\nclass ChildrenHavingStrArgTabsizeMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationExpandtabs2\n\n    def __init__(\n        self,\n        str_arg,\n        tabsize,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        tabsize.parent = self\n\n        self.subnode_tabsize = tabsize\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_tabsize,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"tabsize\", self.subnode_tabsize),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_tabsize\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_tabsize = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"tabsize\": self.subnode_tabsize.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_tabsize.finalize()\n        del self.subnode_tabsize\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_tabsize.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationExpandtabs2Mixin = ChildrenHavingStrArgTabsizeMixin\n\n\nclass ChildrenHavingStrArgWidthMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCenter2\n    #   ExpressionStrOperationLjust2\n    #   ExpressionStrOperationRjust2\n    #   ExpressionStrOperationZfill\n\n    def __init__(\n        self,\n        str_arg,\n        width,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        width.parent = self\n\n        self.subnode_width = width\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_width,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"width\", self.subnode_width),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_width\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_width = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"width\": self.subnode_width.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_width.finalize()\n        del self.subnode_width\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_width.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCenter2Mixin = ChildrenHavingStrArgWidthMixin\nChildrenExpressionStrOperationLjust2Mixin = ChildrenHavingStrArgWidthMixin\nChildrenExpressionStrOperationRjust2Mixin = ChildrenHavingStrArgWidthMixin\nChildrenExpressionStrOperationZfillMixin = ChildrenHavingStrArgWidthMixin\n\n\nclass ChildrenHavingStrArgWidthFillcharMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStrOperationCenter3\n    #   ExpressionStrOperationLjust3\n    #   ExpressionStrOperationRjust3\n\n    def __init__(\n        self,\n        str_arg,\n        width,\n        fillchar,\n    ):\n        str_arg.parent = self\n\n        self.subnode_str_arg = str_arg\n\n        width.parent = self\n\n        self.subnode_width = width\n\n        fillchar.parent = self\n\n        self.subnode_fillchar = fillchar\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_str_arg,\n            self.subnode_width,\n            self.subnode_fillchar,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"str_arg\", self.subnode_str_arg),\n            (\"width\", self.subnode_width),\n            (\"fillchar\", self.subnode_fillchar),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_str_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_str_arg = new_node\n\n            return\n\n        value = self.subnode_width\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_width = new_node\n\n            return\n\n        value = self.subnode_fillchar\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_fillchar = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"str_arg\": self.subnode_str_arg.makeClone(),\n            \"width\": self.subnode_width.makeClone(),\n            \"fillchar\": self.subnode_fillchar.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_str_arg.finalize()\n        del self.subnode_str_arg\n        self.subnode_width.finalize()\n        del self.subnode_width\n        self.subnode_fillchar.finalize()\n        del self.subnode_fillchar\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_str_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_width.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_fillchar.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStrOperationCenter3Mixin = ChildrenHavingStrArgWidthFillcharMixin\nChildrenExpressionStrOperationLjust3Mixin = ChildrenHavingStrArgWidthFillcharMixin\nChildrenExpressionStrOperationRjust3Mixin = ChildrenHavingStrArgWidthFillcharMixin\n\n\nclass ChildrenHavingStringEncodingOptionalErrorsOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinBytearray3\n\n    def __init__(\n        self,\n        string,\n        encoding,\n        errors,\n    ):\n        string.parent = self\n\n        self.subnode_string = string\n\n        if encoding is not None:\n            encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        if errors is not None:\n            errors.parent = self\n\n        self.subnode_errors = errors\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_string)\n        value = self.subnode_encoding\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_errors\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"string\", self.subnode_string),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_string\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_string = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"string\": self.subnode_string.makeClone(),\n            \"encoding\": (\n                self.subnode_encoding.makeClone()\n                if self.subnode_encoding is not None\n                else None\n            ),\n            \"errors\": (\n                self.subnode_errors.makeClone()\n                if self.subnode_errors is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_string.finalize()\n        del self.subnode_string\n        if self.subnode_encoding is not None:\n            self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        if self.subnode_errors is not None:\n            self.subnode_errors.finalize()\n        del self.subnode_errors\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_string.collectVariableAccesses(emit_read, emit_write)\n        subnode_encoding = self.subnode_encoding\n\n        if subnode_encoding is not None:\n            self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        subnode_errors = self.subnode_errors\n\n        if subnode_errors is not None:\n            self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinBytearray3Mixin = (\n    ChildrenHavingStringEncodingOptionalErrorsOptionalMixin\n)\n\n\nclass ChildHavingTypeArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSuper1\n\n    def __init__(\n        self,\n        type_arg,\n    ):\n        type_arg.parent = self\n\n        self.subnode_type_arg = type_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_type_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"type_arg\", self.subnode_type_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_type_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_type_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"type_arg\": self.subnode_type_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_type_arg.finalize()\n        del self.subnode_type_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_type_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_type_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSuper1Mixin = ChildHavingTypeArgMixin\n\n\nclass ChildrenHavingTypeArgArgsOptionalKwargsOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionTypeOperationPrepare\n\n    def __init__(\n        self,\n        type_arg,\n        args,\n        kwargs,\n    ):\n        type_arg.parent = self\n\n        self.subnode_type_arg = type_arg\n\n        if args is not None:\n            args.parent = self\n\n        self.subnode_args = args\n\n        if kwargs is not None:\n            kwargs.parent = self\n\n        self.subnode_kwargs = kwargs\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_type_arg)\n        value = self.subnode_args\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_kwargs\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"type_arg\", self.subnode_type_arg),\n            (\"args\", self.subnode_args),\n            (\"kwargs\", self.subnode_kwargs),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_type_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_type_arg = new_node\n\n            return\n\n        value = self.subnode_args\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_args = new_node\n\n            return\n\n        value = self.subnode_kwargs\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_kwargs = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"type_arg\": self.subnode_type_arg.makeClone(),\n            \"args\": (\n                self.subnode_args.makeClone() if self.subnode_args is not None else None\n            ),\n            \"kwargs\": (\n                self.subnode_kwargs.makeClone()\n                if self.subnode_kwargs is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_type_arg.finalize()\n        del self.subnode_type_arg\n        if self.subnode_args is not None:\n            self.subnode_args.finalize()\n        del self.subnode_args\n        if self.subnode_kwargs is not None:\n            self.subnode_kwargs.finalize()\n        del self.subnode_kwargs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_type_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_args = self.subnode_args\n\n        if subnode_args is not None:\n            self.subnode_args.collectVariableAccesses(emit_read, emit_write)\n        subnode_kwargs = self.subnode_kwargs\n\n        if subnode_kwargs is not None:\n            self.subnode_kwargs.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionTypeOperationPrepareMixin = (\n    ChildrenHavingTypeArgArgsOptionalKwargsOptionalMixin\n)\n\n\nclass ChildrenHavingTypeArgObjectArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinSuper0\n    #   ExpressionBuiltinSuper2\n\n    def __init__(\n        self,\n        type_arg,\n        object_arg,\n    ):\n        type_arg.parent = self\n\n        self.subnode_type_arg = type_arg\n\n        object_arg.parent = self\n\n        self.subnode_object_arg = object_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_type_arg,\n            self.subnode_object_arg,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"type_arg\", self.subnode_type_arg),\n            (\"object_arg\", self.subnode_object_arg),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_type_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_type_arg = new_node\n\n            return\n\n        value = self.subnode_object_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_object_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"type_arg\": self.subnode_type_arg.makeClone(),\n            \"object_arg\": self.subnode_object_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_type_arg.finalize()\n        del self.subnode_type_arg\n        self.subnode_object_arg.finalize()\n        del self.subnode_object_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_type_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_object_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinSuper0Mixin = ChildrenHavingTypeArgObjectArgMixin\nChildrenExpressionBuiltinSuper2Mixin = ChildrenHavingTypeArgObjectArgMixin\n\n\nclass ChildrenHavingTypeNameBasesDictArgMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinType3\n\n    def __init__(\n        self,\n        type_name,\n        bases,\n        dict_arg,\n    ):\n        type_name.parent = self\n\n        self.subnode_type_name = type_name\n\n        bases.parent = self\n\n        self.subnode_bases = bases\n\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_type_name,\n            self.subnode_bases,\n            self.subnode_dict_arg,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"type_name\", self.subnode_type_name),\n            (\"bases\", self.subnode_bases),\n            (\"dict_arg\", self.subnode_dict_arg),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_type_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_type_name = new_node\n\n            return\n\n        value = self.subnode_bases\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_bases = new_node\n\n            return\n\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"type_name\": self.subnode_type_name.makeClone(),\n            \"bases\": self.subnode_bases.makeClone(),\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_type_name.finalize()\n        del self.subnode_type_name\n        self.subnode_bases.finalize()\n        del self.subnode_bases\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_type_name.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_bases.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinType3Mixin = ChildrenHavingTypeNameBasesDictArgMixin\n\n\nclass ChildHavingValueMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionAsyncIter\n    #   ExpressionAsyncNext\n    #   ExpressionBuiltinAll\n    #   ExpressionBuiltinAny\n    #   ExpressionBuiltinAscii\n    #   ExpressionBuiltinBin\n    #   ExpressionBuiltinBool\n    #   ExpressionBuiltinBytearray1\n    #   ExpressionBuiltinBytes1\n    #   ExpressionBuiltinChr\n    #   ExpressionBuiltinComplex1\n    #   ExpressionBuiltinDir1\n    #   ExpressionBuiltinFloat\n    #   ExpressionBuiltinFrozenset\n    #   ExpressionBuiltinHash\n    #   ExpressionBuiltinHex\n    #   ExpressionBuiltinId\n    #   ExpressionBuiltinInt1\n    #   ExpressionBuiltinIter1\n    #   ExpressionBuiltinIterForUnpack\n    #   ExpressionBuiltinLen\n    #   ExpressionBuiltinList\n    #   ExpressionBuiltinLong1\n    #   ExpressionBuiltinNext1\n    #   ExpressionBuiltinOct\n    #   ExpressionBuiltinOrd\n    #   ExpressionBuiltinSet\n    #   ExpressionBuiltinStrP2\n    #   ExpressionBuiltinTuple\n    #   ExpressionBuiltinType1\n    #   ExpressionFunctionErrorStr\n    #   ExpressionKeyValuePairConstantKey\n    #   ExpressionMatchTypeCheckMapping\n    #   ExpressionMatchTypeCheckSequence\n    #   ExpressionSpecialUnpack\n\n    def __init__(\n        self,\n        value,\n    ):\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"value\", self.subnode_value),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_value)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionAsyncIterMixin = ChildHavingValueMixin\nChildrenExpressionAsyncNextMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinAllMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinAnyMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinAsciiMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinBinMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinBoolMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinBytearray1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinBytes1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinChrMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinComplex1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinDir1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinFloatMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinFrozensetMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinHashMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinHexMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinIdMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinInt1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinIter1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinIterForUnpackMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinLenMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinListMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinLong1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinNext1Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinOctMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinOrdMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinSetMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinStrP2Mixin = ChildHavingValueMixin\nChildrenExpressionBuiltinTupleMixin = ChildHavingValueMixin\nChildrenExpressionBuiltinType1Mixin = ChildHavingValueMixin\nChildrenExpressionFunctionErrorStrMixin = ChildHavingValueMixin\nChildrenExpressionKeyValuePairConstantKeyMixin = ChildHavingValueMixin\nChildrenExpressionMatchTypeCheckMappingMixin = ChildHavingValueMixin\nChildrenExpressionMatchTypeCheckSequenceMixin = ChildHavingValueMixin\nChildrenExpressionSpecialUnpackMixin = ChildHavingValueMixin\n\n\nclass ChildrenHavingValueOptionalBaseMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinInt2\n    #   ExpressionBuiltinLong2\n\n    def __init__(\n        self,\n        value,\n        base,\n    ):\n        if value is not None:\n            value.parent = self\n\n        self.subnode_value = value\n\n        base.parent = self\n\n        self.subnode_base = base\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_value\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_base)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"value\", self.subnode_value),\n            (\"base\", self.subnode_base),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_base\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_base = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": (\n                self.subnode_value.makeClone()\n                if self.subnode_value is not None\n                else None\n            ),\n            \"base\": self.subnode_base.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_value is not None:\n            self.subnode_value.finalize()\n        del self.subnode_value\n        self.subnode_base.finalize()\n        del self.subnode_base\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_value = self.subnode_value\n\n        if subnode_value is not None:\n            self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_base.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinInt2Mixin = ChildrenHavingValueOptionalBaseMixin\nChildrenExpressionBuiltinLong2Mixin = ChildrenHavingValueOptionalBaseMixin\n\n\nclass ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinBytes3\n    #   ExpressionBuiltinStrP3\n    #   ExpressionBuiltinUnicodeP2\n\n    def __init__(\n        self,\n        value,\n        encoding,\n        errors,\n    ):\n        if value is not None:\n            value.parent = self\n\n        self.subnode_value = value\n\n        if encoding is not None:\n            encoding.parent = self\n\n        self.subnode_encoding = encoding\n\n        if errors is not None:\n            errors.parent = self\n\n        self.subnode_errors = errors\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_value\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_encoding\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_errors\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"value\", self.subnode_value),\n            (\"encoding\", self.subnode_encoding),\n            (\"errors\", self.subnode_errors),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_encoding\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_encoding = new_node\n\n            return\n\n        value = self.subnode_errors\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_errors = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": (\n                self.subnode_value.makeClone()\n                if self.subnode_value is not None\n                else None\n            ),\n            \"encoding\": (\n                self.subnode_encoding.makeClone()\n                if self.subnode_encoding is not None\n                else None\n            ),\n            \"errors\": (\n                self.subnode_errors.makeClone()\n                if self.subnode_errors is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_value is not None:\n            self.subnode_value.finalize()\n        del self.subnode_value\n        if self.subnode_encoding is not None:\n            self.subnode_encoding.finalize()\n        del self.subnode_encoding\n        if self.subnode_errors is not None:\n            self.subnode_errors.finalize()\n        del self.subnode_errors\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_value = self.subnode_value\n\n        if subnode_value is not None:\n            self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        subnode_encoding = self.subnode_encoding\n\n        if subnode_encoding is not None:\n            self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)\n        subnode_errors = self.subnode_errors\n\n        if subnode_errors is not None:\n            self.subnode_errors.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinBytes3Mixin = (\n    ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin\n)\nChildrenExpressionBuiltinStrP3Mixin = (\n    ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin\n)\nChildrenExpressionBuiltinUnicodeP2Mixin = (\n    ChildrenHavingValueOptionalEncodingOptionalErrorsOptionalMixin\n)\n\n\nclass ChildrenHavingValueFormatSpecOptionalAutoNoneEmptyStrMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinFormat\n\n    def __init__(\n        self,\n        value,\n        format_spec,\n    ):\n        value.parent = self\n\n        self.subnode_value = value\n\n        format_spec = convertEmptyStrConstantToNone(format_spec)\n        if format_spec is not None:\n            format_spec.parent = self\n\n        self.subnode_format_spec = format_spec\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_value)\n        value = self.subnode_format_spec\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"value\", self.subnode_value),\n            (\"format_spec\", self.subnode_format_spec),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_format_spec\n        if old_node is value:\n            new_node = convertEmptyStrConstantToNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_format_spec = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": self.subnode_value.makeClone(),\n            \"format_spec\": (\n                self.subnode_format_spec.makeClone()\n                if self.subnode_format_spec is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_value.finalize()\n        del self.subnode_value\n        if self.subnode_format_spec is not None:\n            self.subnode_format_spec.finalize()\n        del self.subnode_format_spec\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        subnode_format_spec = self.subnode_format_spec\n\n        if subnode_format_spec is not None:\n            self.subnode_format_spec.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionBuiltinFormatMixin = (\n    ChildrenHavingValueFormatSpecOptionalAutoNoneEmptyStrMixin\n)\n\n\nclass ChildrenHavingValueKeyMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionKeyValuePairOld\n\n    def __init__(\n        self,\n        value,\n        key,\n    ):\n        value.parent = self\n\n        self.subnode_value = value\n\n        key.parent = self\n\n        self.subnode_key = key\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_value,\n            self.subnode_key,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"value\", self.subnode_value),\n            (\"key\", self.subnode_key),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": self.subnode_value.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_value.finalize()\n        del self.subnode_value\n        self.subnode_key.finalize()\n        del self.subnode_key\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionKeyValuePairOldMixin = ChildrenHavingValueKeyMixin\n\n\nclass ChildHavingValuesTupleMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionStringConcatenation\n\n    def __init__(\n        self,\n        values,\n    ):\n        assert type(values) is tuple\n\n        for val in values:\n            val.parent = self\n\n        self.subnode_values = values\n\n    def setChildValues(self, value):\n        assert type(value) is tuple, type(value)\n\n        for val in value:\n            val.parent = self\n\n        self.subnode_values = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_values\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"values\", self.subnode_values),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_values\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_values = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_values = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"values\": tuple(v.makeClone() for v in self.subnode_values),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_values:\n            c.finalize()\n        del self.subnode_values\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_values = self.subnode_values\n\n        for sub_expression in old_subnode_values:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_values[\n                        : old_subnode_values.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_values:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nChildrenExpressionStringConcatenationMixin = ChildHavingValuesTupleMixin\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ClassNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for classes and their creations.\n\nThe classes are are at the core of the language and have their complexities.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import (\n    ChildrenExpressionBuiltinType3Mixin,\n    ChildrenHavingMetaclassBasesMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionDictShapeExactMixin\nfrom .IndicatorMixins import MarkNeedsAnnotationsMixin\nfrom .LocalsScopes import getLocalsDictHandle\nfrom .OutlineNodes import ExpressionOutlineFunctionBase\n\n\nclass ExpressionClassBodyBase(ExpressionOutlineFunctionBase):\n    kind = \"EXPRESSION_CLASS_BODY\"\n\n    __slots__ = (\"doc\",)\n\n    def __init__(self, provider, name, doc, source_ref):\n        ExpressionOutlineFunctionBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            body=None,\n            code_prefix=\"class\",\n            source_ref=source_ref,\n        )\n\n        self.doc = doc\n\n        self.locals_scope = getLocalsDictHandle(\n            \"locals_%s_%d\" % (self.getCodeName(), source_ref.getLineNumber()),\n            self.locals_kind,\n            self,\n        )\n\n    @staticmethod\n    def isExpressionClassBodyBase():\n        return True\n\n    def getDetails(self):\n        return {\n            \"name\": self.getFunctionName(),\n            \"provider\": self.provider.getCodeName(),\n            \"doc\": self.doc,\n            \"flags\": self.flags,\n        }\n\n    def getDetailsForDisplay(self):\n        result = {\n            \"name\": self.getFunctionName(),\n            \"provider\": self.provider.getCodeName(),\n            \"flags\": \"\" if self.flags is None else \",\".join(sorted(self.flags)),\n        }\n\n        if self.doc is not None:\n            result[\"doc\"] = self.doc\n\n        return result\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        return cls(provider=provider, source_ref=source_ref, **args)\n\n    def getDoc(self):\n        return self.doc\n\n    @staticmethod\n    def isEarlyClosure():\n        return True\n\n    def getVariableForClosure(self, variable_name):\n        # print( \"getVariableForClosure\", self, variable_name )\n\n        # The class bodies provide no closure, except under CPython3.x, there\n        # they provide \"__class__\" but nothing else.\n\n        if variable_name == \"__class__\":\n            if python_version < 0x300:\n                return self.provider.getVariableForClosure(\"__class__\")\n            else:\n                return ExpressionOutlineFunctionBase.getVariableForClosure(\n                    self, variable_name=\"__class__\"\n                )\n        else:\n            result = self.provider.getVariableForClosure(variable_name)\n            self.taken.add(result)\n            return result\n\n    @staticmethod\n    def markAsDirectlyCalled():\n        pass\n\n    def getChildQualname(self, function_name):\n        return self.getFunctionQualname() + \".\" + function_name\n\n    @staticmethod\n    def mayHaveSideEffects():\n        # The function definition has no side effects, calculating the defaults\n        # would be, but that is done outside of this.\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_body.mayRaiseException(exception_type)\n\n    def isUnoptimized(self):\n        # Classes all are that.\n        return True\n\n\n# TODO: Have a variation that knows dict shape or not statically.\nclass ExpressionClassBodyP3(MarkNeedsAnnotationsMixin, ExpressionClassBodyBase):\n    kind = \"EXPRESSION_CLASS_BODY_P3\"\n\n    __slots__ = (\"needs_annotations_dict\",)\n\n    if python_version >= 0x340:\n        __slots__ += (\"qualname_setup\",)\n\n    # Force creation with proper type.\n    locals_kind = \"python3_class\"\n\n    def __init__(self, provider, name, doc, source_ref):\n        ExpressionClassBodyBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            doc=doc,\n            source_ref=source_ref,\n        )\n\n        MarkNeedsAnnotationsMixin.__init__(self)\n\n        if python_version >= 0x340:\n            self.qualname_setup = None\n\n\nclass ExpressionClassBodyP2(ExpressionDictShapeExactMixin, ExpressionClassBodyBase):\n    kind = \"EXPRESSION_CLASS_BODY_P2\"\n\n    __slots__ = ()\n\n    locals_kind = \"python2_class\"\n\n    def __init__(self, provider, name, doc, source_ref):\n        ExpressionClassBodyBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            doc=doc,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionSelectMetaclass(ChildrenHavingMetaclassBasesMixin, ExpressionBase):\n    kind = \"EXPRESSION_SELECT_METACLASS\"\n\n    named_children = (\"metaclass\", \"bases\")\n\n    def __init__(self, metaclass, bases, source_ref):\n        ChildrenHavingMetaclassBasesMixin.__init__(\n            self,\n            metaclass=metaclass,\n            bases=bases,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_bases.isExpressionConstantTupleEmptyRef():\n            return (\n                self.subnode_metaclass,\n                \"new_expression\",\n                \"Metaclass selection without bases is trivial.\",\n            )\n\n        # TODO: Meta class selection is very computable, and should be done, but we need\n        # dictionary tracing for that.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return not self.subnode_bases.isExpressionConstantTupleEmptyRef()\n\n\nclass ExpressionBuiltinType3(ChildrenExpressionBuiltinType3Mixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_TYPE3\"\n\n    named_children = (\"type_name\", \"bases\", \"dict_arg\")\n\n    def __init__(self, type_name, bases, dict_arg, source_ref):\n        ChildrenExpressionBuiltinType3Mixin.__init__(\n            self,\n            type_name=type_name,\n            bases=bases,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def _calculateMetaClass(self):\n        # TODO: Share code with ExpressionSelectMetaclass\n\n        if not self.subnode_bases.isCompileTimeConstant():\n            return None\n\n        # TODO: Want to cache this result probably for speed reasons and it may also\n        # contain allocations for dataclasses, generics, etc.\n\n        # Need to use private CPython API unless we want to re-implement it, pylint: disable=protected-access\n        import ctypes\n\n        ctypes.pythonapi._PyType_CalculateMetaclass.argtypes = (\n            ctypes.py_object,\n            ctypes.py_object,\n        )\n        ctypes.pythonapi._PyType_CalculateMetaclass.restype = ctypes.py_object\n\n        bases = self.subnode_bases.getCompileTimeConstant()\n\n        return ctypes.pythonapi._PyType_CalculateMetaclass(type, bases)\n\n    def mayRaiseException(self, exception_type):\n        # TODO: In many cases, this will not raise for compile time knowable\n        # case classes. We might ask the bases for the metaclass selected by\n        # compile time inspection.\n        return True\n\n    def computeExpression(self, trace_collection):\n        # TODO: Can use this to specialize to the correct metaclass at compile\n        # time.\n        # metacls = self._calculateMetaClass()\n\n        # TODO: Should be compile time computable if bases and dict are\n        # allowing that to happen into a dedicated class creation node,\n        # with known metaclass selection.\n\n        # Any exception may be raised.\n        if self.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/CodeObjectSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Code object specifications.\n\nFor code objects that will be attached to module, function, and generator\nobjects, as well as tracebacks. They might be shared.\n\n\"\"\"\n\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\n\n\nclass CodeObjectSpec(object):\n    # One attribute for each code object aspect, and even flags,\n    # pylint: disable=too-many-arguments,too-many-instance-attributes\n    __slots__ = (\n        \"co_name\",\n        \"co_qualname\",\n        \"co_kind\",\n        \"co_varnames\",\n        \"co_argcount\",\n        \"co_freevars\",\n        \"co_posonlyargcount\",\n        \"co_kwonlyargcount\",\n        \"co_has_starlist\",\n        \"co_has_stardict\",\n        \"filename\",\n        \"line_number\",\n        \"future_spec\",\n        \"new_locals\",\n        \"is_optimized\",\n    )\n\n    @counted_init\n    def __init__(\n        self,\n        co_name,\n        co_qualname,\n        co_kind,\n        co_varnames,\n        co_freevars,\n        co_argcount,\n        co_posonlyargcount,\n        co_kwonlyargcount,\n        co_has_starlist,\n        co_has_stardict,\n        co_filename,\n        co_lineno,\n        future_spec,\n        co_new_locals=None,\n        co_is_optimized=None,\n    ):\n        # pylint: disable=I0021,too-many-locals\n\n        self.co_name = co_name\n        self.co_qualname = co_qualname\n        self.co_kind = co_kind\n\n        self.future_spec = future_spec\n        assert future_spec\n\n        # Strings happens from XML parsing, make sure to convert them.\n        if type(co_varnames) is str:\n            if co_varnames == \"\":\n                co_varnames = ()\n            else:\n                co_varnames = co_varnames.split(\",\")\n\n        if type(co_freevars) is str:\n            if co_freevars == \"\":\n                co_freevars = ()\n            else:\n                co_freevars = co_freevars.split(\",\")\n\n        if type(co_has_starlist) is not bool:\n            co_has_starlist = co_has_starlist != \"False\"\n        if type(co_has_stardict) is not bool:\n            co_has_stardict = co_has_stardict != \"False\"\n\n        self.co_varnames = tuple(co_varnames)\n        self.co_freevars = tuple(co_freevars)\n\n        self.co_argcount = int(co_argcount)\n\n        self.co_posonlyargcount = int(co_posonlyargcount)\n        self.co_kwonlyargcount = int(co_kwonlyargcount)\n\n        self.co_has_starlist = co_has_starlist\n        self.co_has_stardict = co_has_stardict\n\n        self.filename = co_filename\n        self.line_number = int(co_lineno)\n\n        if type(co_has_starlist) is not bool:\n            co_new_locals = co_new_locals != \"False\"\n        if type(co_has_starlist) is not bool:\n            co_is_optimized = co_is_optimized != \"False\"\n\n        self.new_locals = co_new_locals\n        self.is_optimized = co_is_optimized\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def __repr__(self):\n        return (\n            \"\"\"\\\n<CodeObjectSpec %(co_kind)s '%(co_name)s' with %(co_varnames)r>\"\"\"\n            % self.getDetails()\n        )\n\n    def getDetails(self):\n        return {\n            \"co_name\": self.co_name,\n            \"co_kind\": self.co_kind,\n            \"co_varnames\": \",\".join(self.co_varnames),\n            \"co_freevars\": \",\".join(self.co_freevars),\n            \"co_argcount\": self.co_argcount,\n            \"co_posonlyargcount\": self.co_posonlyargcount,\n            \"co_kwonlyargcount\": self.co_kwonlyargcount,\n            \"co_has_starlist\": self.co_has_starlist,\n            \"co_has_stardict\": self.co_has_stardict,\n            \"co_filename\": self.filename,\n            \"co_lineno\": self.line_number,\n            \"co_new_locals\": self.new_locals,\n            \"co_is_optimized\": self.is_optimized,\n            \"code_flags\": \",\".join(self.future_spec.asFlags()),\n        }\n\n    def getCodeObjectKind(self):\n        return self.co_kind\n\n    def updateLocalNames(self, local_names, freevar_names):\n        \"\"\"Move detected local variables after closure has been decided.\"\"\"\n\n        self.co_varnames += tuple(\n            local_name\n            for local_name in local_names\n            if local_name not in self.co_varnames\n            # TODO: This is actually a bug, but we have a hard time without it to know\n            # frame locals easily. We use this in compiled function run time, that all\n            # variables, including closure variables are found there. This would have to\n            # be cleaned up, for potentially little gain.\n            # if local_name not in freevar_names\n        )\n\n        self.co_freevars = tuple(freevar_names)\n\n    def removeFreeVarname(self, freevar_name):\n        self.co_freevars = tuple(\n            var_name for var_name in self.co_freevars if var_name != freevar_name\n        )\n\n    def setFlagIsOptimizedValue(self, value):\n        self.is_optimized = value\n\n    def getFlagIsOptimizedValue(self):\n        return self.is_optimized\n\n    def setFlagNewLocalsValue(self, value):\n        self.new_locals = value\n\n    def getFlagNewLocalsValue(self):\n        return self.new_locals\n\n    def getFutureSpec(self):\n        return self.future_spec\n\n    def getVarNames(self):\n        return self.co_varnames\n\n    def getFreeVarNames(self):\n        return self.co_freevars\n\n    def getArgumentCount(self):\n        return self.co_argcount\n\n    def getPosOnlyParameterCount(self):\n        return self.co_posonlyargcount\n\n    def getKwOnlyParameterCount(self):\n        return self.co_kwonlyargcount\n\n    def getCodeObjectName(self):\n        return self.co_name\n\n    def getCodeObjectQualname(self):\n        return self.co_name\n\n    def hasStarListArg(self):\n        return self.co_has_starlist\n\n    def hasStarDictArg(self):\n        return self.co_has_stardict\n\n    def getFilename(self):\n        return self.filename\n\n    def getLineNumber(self):\n        return self.line_number\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ComparisonNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for comparisons.\n\n\"\"\"\n\nfrom nuitka import PythonOperators\nfrom nuitka.Errors import NuitkaAssumptionError\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildrenHavingLeftRightMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseExceptionReplacementExpressionFromInstance,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_bool, tshape_exception_class\nfrom .shapes.StandardShapes import tshape_unknown\n\n\nclass ExpressionComparisonBase(ChildrenHavingLeftRightMixin, ExpressionBase):\n    named_children = (\"left\", \"right\")\n\n    def __init__(self, left, right, source_ref):\n        ChildrenHavingLeftRightMixin.__init__(\n            self,\n            left=left,\n            right=right,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def copyTraceStateFrom(source):\n        pass\n\n    def getOperands(self):\n        return (self.subnode_left, self.subnode_right)\n\n    def getComparator(self):\n        return self.comparator\n\n    def getDetails(self):\n        return {\"comparator\": self.comparator}\n\n    @staticmethod\n    def isExpressionComparison():\n        return True\n\n    def getSimulator(self):\n        return PythonOperators.all_comparison_functions[self.comparator]\n\n    def _computeCompileTimeConstantComparison(self, trace_collection):\n        left_value = self.subnode_left.getCompileTimeConstant()\n        right_value = self.subnode_right.getCompileTimeConstant()\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.getSimulator()(left_value, right_value),\n            description=\"Comparison of constant arguments.\",\n        )\n\n    def makeInverseComparison(self):\n        # Making this accessing for tree building phase as well.\n        return makeComparisonExpression(\n            left=self.subnode_left,\n            right=self.subnode_right,\n            comparator=PythonOperators.comparison_inversions[self.comparator],\n            source_ref=self.source_ref,\n        )\n\n    def computeExpressionOperationNot(self, not_node, trace_collection):\n        if self.getTypeShape() is tshape_bool:\n            result = self.makeInverseComparison()\n\n            result.copyTraceStateFrom(self)\n\n            return (\n                result,\n                \"new_expression\",\n                \"\"\"Replaced negated comparison '%s' with inverse comparison '%s'.\"\"\"\n                % (self.comparator, result.comparator),\n            )\n\n        return not_node, None, None\n\n\nclass ExpressionComparisonRichBase(ExpressionComparisonBase):\n    __slots__ = (\n        \"type_shape\",\n        \"escape_desc\",\n        \"left_available\",\n        \"left_comparable\",\n        \"right_available\",\n        \"right_comparable\",\n    )\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n        self.type_shape = tshape_unknown\n        self.escape_desc = None\n\n        self.left_available = False\n        self.left_comparable = None\n        self.right_available = False\n        self.right_comparable = None\n\n    def getTypeShape(self):\n        return self.type_shape\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def copyTraceStateFrom(self, source):\n        self.type_shape = source.type_shape\n        self.escape_desc = source.escape_desc\n\n    def canCreateUnsupportedException(self):\n        return hasattr(self.subnode_left.getTypeShape(), \"typical_value\") and hasattr(\n            self.subnode_right.getTypeShape(), \"typical_value\"\n        )\n\n    def createUnsupportedException(self):\n        left = self.subnode_left.getTypeShape().typical_value\n        right = self.subnode_right.getTypeShape().typical_value\n\n        try:\n            self.getSimulator()(left, right)\n        except TypeError as e:\n            return e\n        else:\n            raise NuitkaAssumptionError(\n                \"Unexpected no-exception doing comparison simulation\",\n                self.operator,\n                self.simulator,\n                self.subnode_left.getTypeShape(),\n                self.subnode_right.getTypeShape(),\n                repr(left),\n                repr(right),\n            )\n\n    def computeExpression(self, trace_collection):\n        left = self.subnode_left\n        right = self.subnode_right\n\n        if not self.left_available:\n            self.left_available, self.left_comparable = left.getComparisonValue()\n\n        if self.left_available:\n            if not self.right_available:\n                self.right_available, self.right_comparable = right.getComparisonValue()\n\n            if self.right_available:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: self.getSimulator()(\n                        self.left_comparable, self.right_comparable\n                    ),\n                    description=\"Comparison of constant arguments.\",\n                )\n\n        left_shape = left.getTypeShape()\n        right_shape = right.getTypeShape()\n\n        self.type_shape, self.escape_desc = self.getComparisonShape(\n            left_shape, right_shape\n        )\n\n        exception_raise_exit = self.escape_desc.getExceptionExit()\n        if exception_raise_exit is not None:\n            trace_collection.onExceptionRaiseExit(exception_raise_exit)\n\n            if (\n                self.escape_desc.isUnsupported()\n                and self.canCreateUnsupportedException()\n            ):\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeRaiseExceptionReplacementExpressionFromInstance(\n                        expression=self, exception=self.createUnsupportedException()\n                    ),\n                    old_node=self,\n                    side_effects=(self.subnode_left, self.subnode_right),\n                )\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"\"\"Replaced comparator '%s' with %s %s arguments that cannot work.\"\"\"\n                    % (\n                        self.comparator,\n                        self.subnode_left.getTypeShape(),\n                        self.subnode_right.getTypeShape(),\n                    ),\n                )\n\n            # The value of these nodes escaped and could change its contents.\n\n            # TODO: Comparisons don't do much, but add this.\n            # if self.escape_desc.isValueEscaping():\n            #    trace_collection.onValueEscapeRichComparison(left, right, self.comparator)\n\n        if self.escape_desc.isControlFlowEscape():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        # TODO: Match more precisely\n        return (\n            self.escape_desc is None\n            or self.escape_desc.getExceptionExit() is not None\n            or self.subnode_left.mayRaiseException(exception_type)\n            or self.subnode_right.mayRaiseException(exception_type)\n        )\n\n    def mayRaiseExceptionBool(self, exception_type):\n        return self.type_shape.hasShapeSlotBool() is not True\n\n    def mayRaiseExceptionComparison(self):\n        return (\n            self.escape_desc is None or self.escape_desc.getExceptionExit() is not None\n        )\n\n\nclass ExpressionComparisonLt(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_LT\"\n\n    comparator = \"Lt\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonLtShape(right_shape)\n\n\nclass ExpressionComparisonLte(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_LTE\"\n\n    comparator = \"LtE\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonLteShape(right_shape)\n\n\nclass ExpressionComparisonGt(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_GT\"\n\n    comparator = \"Gt\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonGtShape(right_shape)\n\n\nclass ExpressionComparisonGte(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_GTE\"\n\n    comparator = \"GtE\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonGteShape(right_shape)\n\n\nclass ExpressionComparisonEq(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_EQ\"\n\n    comparator = \"Eq\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonEqShape(right_shape)\n\n\nclass ExpressionComparisonNeq(ExpressionComparisonRichBase):\n    kind = \"EXPRESSION_COMPARISON_NEQ\"\n\n    comparator = \"NotEq\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonRichBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getComparisonShape(left_shape, right_shape):\n        return left_shape.getComparisonNeqShape(right_shape)\n\n\nclass ExpressionComparisonIsIsNotBase(\n    ExpressionBoolShapeExactMixin, ExpressionComparisonBase\n):\n    __slots__ = (\n        \"left_available\",\n        \"left_comparable\",\n        \"right_available\",\n        \"right_comparable\",\n    )\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n        self.left_available = False\n        self.left_comparable = None\n        self.right_available = False\n        self.right_comparable = None\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_left.mayRaiseException(\n            exception_type\n        ) or self.subnode_right.mayRaiseException(exception_type)\n\n    def computeExpression(self, trace_collection):\n        left = self.subnode_left\n        right = self.subnode_right\n\n        if trace_collection.mustAlias(left, right):\n            result = makeConstantReplacementNode(\n                constant=self.comparator == \"Is\", node=self, user_provided=False\n            )\n\n            if left.mayHaveSideEffects() or right.mayHaveSideEffects():\n                result = wrapExpressionWithSideEffects(\n                    side_effects=self.extractSideEffects(),\n                    old_node=self,\n                    new_node=result,\n                )\n\n            return (\n                result,\n                \"new_constant\",\n                \"\"\"\\\nDetermined values to alias and therefore result of %s comparison.\"\"\"\n                % (self.comparator),\n            )\n\n        if trace_collection.mustNotAlias(left, right):\n            result = makeConstantReplacementNode(\n                constant=self.comparator != \"Is\", node=self, user_provided=False\n            )\n\n            if left.mayHaveSideEffects() or right.mayHaveSideEffects():\n                result = wrapExpressionWithSideEffects(\n                    side_effects=self.extractSideEffects(),\n                    old_node=self,\n                    new_node=result,\n                )\n\n            return (\n                result,\n                \"new_constant\",\n                \"\"\"\\\nDetermined values to not alias and therefore result of '%s' comparison.\"\"\"\n                % (self.comparator),\n            )\n\n        if not self.left_available:\n            self.left_available, self.left_comparable = left.getComparisonValue()\n\n        if self.left_available:\n            if not self.right_available:\n                self.right_available, self.right_comparable = right.getComparisonValue()\n\n            if self.right_available:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: self.getSimulator()(\n                        self.left_comparable, self.right_comparable\n                    ),\n                    description=\"Comparison '%s' with constant arguments.\"\n                    % self.comparator,\n                )\n\n        return self, None, None\n\n    def extractSideEffects(self):\n        return (\n            self.subnode_left.extractSideEffects()\n            + self.subnode_right.extractSideEffects()\n        )\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        from .NodeMakingHelpers import makeStatementOnlyNodesFromExpressions\n\n        result = makeStatementOnlyNodesFromExpressions(expressions=self.getOperands())\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nRemoved %s comparison for unused result.\"\"\"\n            % self.comparator,\n        )\n\n\nclass ExpressionComparisonIs(ExpressionComparisonIsIsNotBase):\n    kind = \"EXPRESSION_COMPARISON_IS\"\n\n    comparator = \"Is\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonIsIsNotBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n\nclass ExpressionComparisonIsNot(ExpressionComparisonIsIsNotBase):\n    kind = \"EXPRESSION_COMPARISON_IS_NOT\"\n\n    comparator = \"IsNot\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonIsIsNotBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n\nclass ExpressionComparisonExceptionMatchBase(\n    ExpressionBoolShapeExactMixin, ExpressionComparisonBase\n):\n    __slots__ = (\n        \"left_available\",\n        \"left_comparable\",\n        \"right_available\",\n        \"right_comparable\",\n    )\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n        self.left_available = False\n        self.left_comparable = None\n        self.right_available = False\n        self.right_comparable = None\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def computeExpression(self, trace_collection):\n        if not self.left_available:\n            (\n                self.left_available,\n                self.left_comparable,\n            ) = self.subnode_left.getComparisonValue()\n\n        if self.left_available:\n            if not self.right_available:\n                (\n                    self.right_available,\n                    self.right_comparable,\n                ) = self.subnode_right.getComparisonValue()\n\n            if self.right_available:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: self.getSimulator()(\n                        self.left_comparable, self.right_comparable\n                    ),\n                    description=\"Exception matched with constant arguments.\",\n                )\n\n        if self.mayRaiseExceptionComparison():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def getSimulator(self):\n        # TODO: Doesn't happen yet, but will once we trace exceptions.\n        assert False\n\n        return PythonOperators.all_comparison_functions[self.comparator]\n\n    def mayRaiseException(self, exception_type):\n        # TODO: Match errors that exception comparisons might raise more accurately.\n        return (\n            self.subnode_left.mayRaiseException(exception_type)\n            or self.subnode_right.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionComparison()\n        )\n\n    if python_version < 0x300:\n\n        @staticmethod\n        def mayRaiseExceptionComparison():\n            return False\n\n    else:\n\n        def mayRaiseExceptionComparison(self):\n            type_shape = self.subnode_right.getTypeShape()\n\n            if type_shape is tshape_exception_class:\n                return False\n\n            return True\n\n\nclass ExpressionComparisonExceptionMatch(ExpressionComparisonExceptionMatchBase):\n    kind = \"EXPRESSION_COMPARISON_EXCEPTION_MATCH\"\n\n    comparator = \"exception_match\"\n\n\nclass ExpressionComparisonExceptionMismatch(ExpressionComparisonExceptionMatchBase):\n    kind = \"EXPRESSION_COMPARISON_EXCEPTION_MISMATCH\"\n\n    comparator = \"exception_mismatch\"\n\n\nclass ExpressionComparisonInNotInBase(\n    ExpressionBoolShapeExactMixin, ExpressionComparisonBase\n):\n    __slots__ = (\n        \"left_available\",\n        \"left_comparable\",\n        \"right_available\",\n        \"right_comparable\",\n    )\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n        assert self.comparator in (\"In\", \"NotIn\")\n\n        self.left_available = False\n        self.left_comparable = None\n        self.right_available = False\n        self.right_comparable = None\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def mayRaiseException(self, exception_type):\n        left = self.subnode_left\n\n        if left.mayRaiseException(exception_type):\n            return True\n\n        right = self.subnode_right\n\n        if right.mayRaiseException(exception_type):\n            return True\n\n        return right.mayRaiseExceptionIn(exception_type, left)\n\n    def getSimulator(self):\n        return PythonOperators.other_comparison_functions[self.comparator]\n\n    def computeExpression(self, trace_collection):\n        if not self.left_available:\n            (\n                self.left_available,\n                self.left_comparable,\n            ) = self.subnode_left.getComparisonValue()\n\n        if self.left_available:\n            if not self.right_available:\n                (\n                    self.right_available,\n                    self.right_comparable,\n                ) = self.subnode_right.getComparisonValue()\n\n            if self.right_available:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: self.getSimulator()(\n                        self.left_comparable, self.right_comparable\n                    ),\n                    description=\"Contains check %s of constant arguments.\"\n                    % self.comparator,\n                )\n\n        return self.subnode_right.computeExpressionComparisonIn(\n            in_node=self,\n            value_node=self.subnode_left,\n            trace_collection=trace_collection,\n        )\n\n\nclass ExpressionComparisonIn(ExpressionComparisonInNotInBase):\n    kind = \"EXPRESSION_COMPARISON_IN\"\n\n    comparator = \"In\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonInNotInBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n\nclass ExpressionComparisonNotIn(ExpressionComparisonInNotInBase):\n    kind = \"EXPRESSION_COMPARISON_NOT_IN\"\n\n    comparator = \"NotIn\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionComparisonInNotInBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n\n_comparator_to_nodeclass = {\n    \"Is\": ExpressionComparisonIs,\n    \"IsNot\": ExpressionComparisonIsNot,\n    \"In\": ExpressionComparisonIn,\n    \"NotIn\": ExpressionComparisonNotIn,\n    \"Lt\": ExpressionComparisonLt,\n    \"LtE\": ExpressionComparisonLte,\n    \"Gt\": ExpressionComparisonGt,\n    \"GtE\": ExpressionComparisonGte,\n    \"Eq\": ExpressionComparisonEq,\n    \"NotEq\": ExpressionComparisonNeq,\n    \"exception_match\": ExpressionComparisonExceptionMatch,\n    \"exception_mismatch\": ExpressionComparisonExceptionMismatch,\n}\n\n\ndef makeComparisonExpression(left, right, comparator, source_ref):\n    return _comparator_to_nodeclass[comparator](\n        left=left, right=right, source_ref=source_ref\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ConditionalNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Conditional nodes.\n\nThese is the conditional expression '(a if b else c)' and the conditional\nstatement, 'if a: ... else: ...' and there is no 'elif', because that is\nexpressed via nesting of conditional statements.\n\"\"\"\n\nfrom nuitka.optimizations.TraceCollections import TraceCollectionBranch\n\nfrom .BuiltinTypeNodes import ExpressionBuiltinBool\nfrom .Checkers import checkStatementsSequenceOrNone\nfrom .ChildrenHavingMixins import (\n    ChildrenHavingConditionExpressionYesExpressionNoMixin,\n    ChildrenHavingLeftRightMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeStatementExpressionOnlyReplacementNode,\n    wrapExpressionWithNodeSideEffects,\n    wrapExpressionWithSideEffects,\n    wrapStatementWithSideEffects,\n)\nfrom .OperatorNodesUnary import ExpressionOperationNot\nfrom .shapes.BuiltinTypeShapes import tshape_bool, tshape_unknown\nfrom .StatementBasesGenerated import StatementConditionalBase\nfrom .StatementNodes import StatementsSequence\n\n\nclass ConditionalValueComputeMixin(object):\n    __slots__ = ()\n\n    def _computeConditionTruthValue(self, trace_collection):\n        condition = self.subnode_condition\n\n        truth_value, replacement, message = condition.computeExpressionBool(\n            trace_collection\n        )\n        if replacement is not None:\n            self.replaceChild(condition, replacement)\n\n            trace_collection.signalChange(\n                tags=\"new_constant\", source_ref=self.source_ref, message=message\n            )\n\n            return truth_value, replacement\n        else:\n            # Query the truth value after the expression is evaluated, once it is\n            # evaluated in onExpression, it is known.\n            return condition.getTruthValue(), condition\n\n\nclass ExpressionConditional(\n    ConditionalValueComputeMixin,\n    ChildrenHavingConditionExpressionYesExpressionNoMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_CONDITIONAL\"\n\n    named_children = (\"condition\", \"expression_yes\", \"expression_no\")\n\n    def __init__(self, condition, expression_yes, expression_no, source_ref):\n        ChildrenHavingConditionExpressionYesExpressionNoMixin.__init__(\n            self,\n            condition=condition,\n            expression_yes=expression_yes,\n            expression_no=expression_no,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getTypeShape(self):\n        yes_shape = self.subnode_expression_yes.getTypeShape()\n\n        if yes_shape is tshape_unknown:\n            return tshape_unknown\n        else:\n            no_shape = self.subnode_expression_no.getTypeShape()\n\n            if no_shape is yes_shape:\n                return no_shape\n            else:\n                return tshape_unknown\n\n    def getBranches(self):\n        return (self.subnode_expression_yes, self.subnode_expression_no)\n\n    def computeExpressionRaw(self, trace_collection):\n        # This is rather complex stuff, pylint: disable=too-many-branches\n\n        # Query the truth value after the expression is evaluated, once it is\n        # evaluated in onExpression, it is known.\n        condition = trace_collection.onExpression(self.subnode_condition)\n\n        # No need to look any further, if the condition raises, the branches do\n        # not matter at all.\n        if condition.willRaiseAnyException():\n            return (\n                condition,\n                \"new_raise\",\n                \"\"\"\\\nConditional expression already raises implicitly in condition, removing \\\nbranches.\"\"\",\n            )\n\n        # Tell it we are evaluation it for boolean value only, it may demote\n        # itself possibly.\n        truth_value, condition = self._computeConditionTruthValue(trace_collection)\n\n        # TODO: We now know that condition evaluates to true for the yes branch\n        # and to not true for no branch, the branch should know that.\n        yes_branch = self.subnode_expression_yes\n\n        # Continue to execute for yes branch unless we know it's not going to be\n        # relevant.\n        if truth_value is not False:\n            branch_yes_collection = TraceCollectionBranch(\n                parent=trace_collection, name=\"conditional expression yes branch\"\n            )\n\n            yes_branch = branch_yes_collection.onExpression(yes_branch)\n\n            # If it's aborting, it doesn't contribute to merging.\n            if truth_value is not True and yes_branch.willRaiseAnyException():\n                branch_yes_collection = None\n        else:\n            branch_yes_collection = None\n\n        no_branch = self.subnode_expression_no\n\n        # Continue to execute for yes branch.\n        if truth_value is not True:\n            branch_no_collection = TraceCollectionBranch(\n                parent=trace_collection, name=\"conditional expression no branch\"\n            )\n\n            no_branch = branch_no_collection.onExpression(no_branch)\n\n            # If it's aborting, it doesn't contribute to merging.\n            if truth_value is not False and no_branch.willRaiseAnyException():\n                branch_no_collection = None\n        else:\n            branch_no_collection = None\n\n        if truth_value is True:\n            trace_collection.replaceBranch(branch_yes_collection)\n        elif truth_value is False:\n            trace_collection.replaceBranch(branch_no_collection)\n        else:\n            # Merge into parent execution.\n            trace_collection.mergeBranches(branch_yes_collection, branch_no_collection)\n\n        if truth_value is True:\n            return (\n                wrapExpressionWithNodeSideEffects(\n                    new_node=self.subnode_expression_yes, old_node=condition\n                ),\n                \"new_expression\",\n                \"Conditional expression predicted to 'yes' case.\",\n            )\n        elif truth_value is False:\n            return (\n                wrapExpressionWithNodeSideEffects(\n                    new_node=self.subnode_expression_no, old_node=condition\n                ),\n                \"new_expression\",\n                \"Conditional expression predicted to 'no' case.\",\n            )\n        else:\n            return self, None, None\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        result = makeStatementConditional(\n            condition=self.subnode_condition,\n            yes_branch=makeStatementExpressionOnlyReplacementNode(\n                expression=self.subnode_expression_yes, node=self.subnode_expression_yes\n            ),\n            no_branch=makeStatementExpressionOnlyReplacementNode(\n                expression=self.subnode_expression_no, node=self.subnode_expression_no\n            ),\n            source_ref=self.source_ref,\n        )\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nConvert conditional expression with unused result into conditional statement.\"\"\",\n        )\n\n    def mayHaveSideEffectsBool(self):\n        # The bool will me made on either side.\n        if self.subnode_expression_yes.mayHaveSideEffectsBool():\n            return True\n\n        if self.subnode_expression_no.mayHaveSideEffectsBool():\n            return True\n\n        return False\n\n    def mayRaiseException(self, exception_type):\n        condition = self.subnode_condition\n\n        if condition.mayRaiseException(exception_type):\n            return True\n\n        if condition.mayRaiseExceptionBool(exception_type):\n            return True\n\n        yes_branch = self.subnode_expression_yes\n\n        # Handle branches that became empty behind our back\n        if yes_branch is not None and yes_branch.mayRaiseException(exception_type):\n            return True\n\n        no_branch = self.subnode_expression_no\n\n        # Handle branches that became empty behind our back\n        if no_branch is not None and no_branch.mayRaiseException(exception_type):\n            return True\n\n        return False\n\n    def mayRaiseExceptionBool(self, exception_type):\n        if self.subnode_condition.mayRaiseExceptionBool(exception_type):\n            return True\n\n        if self.subnode_expression_yes.mayRaiseExceptionBool(exception_type):\n            return True\n\n        if self.subnode_expression_no.mayRaiseExceptionBool(exception_type):\n            return True\n\n        return False\n\n    def getIntegerValue(self):\n        result_yes = self.subnode_expression_yes.getIntegerValue()\n        result_no = self.subnode_expression_no.getIntegerValue()\n\n        if result_yes == result_no:\n            return result_yes\n        else:\n            return None\n\n    def getExpressionDictInConstant(self, value):\n        result_yes = self.subnode_expression_yes.getExpressionDictInConstant(value)\n        result_no = self.subnode_expression_no.getExpressionDictInConstant(value)\n\n        if result_yes == result_no:\n            return result_yes\n        else:\n            return None\n\n\nclass ExpressionConditionalBoolBase(ChildrenHavingLeftRightMixin, ExpressionBase):\n    named_children = (\"left\", \"right\")\n\n    def __init__(self, left, right, source_ref):\n        ChildrenHavingLeftRightMixin.__init__(self, left=left, right=right)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpressionRaw(self, trace_collection):\n        # Query the truth value after the expression is evaluated, once it is\n        # evaluated in onExpression, it is known.\n        left = trace_collection.onExpression(self.subnode_left)\n\n        # No need to look any further, if the condition raises, the branches do\n        # not matter at all.\n        if left.willRaiseAnyException():\n            return (\n                left,\n                \"new_raise\",\n                \"\"\"\\\nConditional %s statements already raises implicitly in condition, removing \\\nbranches.\"\"\"\n                % self.conditional_kind,\n            )\n\n        if not left.mayRaiseException(BaseException) and left.mayRaiseExceptionBool(\n            BaseException\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Decide this based on truth value of condition.\n        truth_value = left.getTruthValue()\n\n        truth_value_use_left = self.conditional_kind == \"or\"\n        truth_value_use_right = not truth_value_use_left\n\n        right = self.subnode_right\n\n        # Continue to execute for yes branch unless we know it's not going to be\n        # relevant.\n        if truth_value is not truth_value_use_left:\n            # TODO: We now know that left evaluates and we should tell the\n            # branch that.\n            branch_yes_collection = TraceCollectionBranch(\n                parent=trace_collection,\n                name=\"boolean %s right branch\" % self.conditional_kind,\n            )\n\n            right = branch_yes_collection.onExpression(right)\n\n            # If it's aborting, it doesn't contribute to merging.\n            if right.willRaiseAnyException():\n                branch_yes_collection = None\n        else:\n            branch_yes_collection = None\n\n        if branch_yes_collection:\n            # Merge into parent execution.\n            trace_collection.mergeBranches(branch_yes_collection, None)\n\n        if truth_value is truth_value_use_left:\n            return (\n                left,\n                \"new_expression\",\n                \"Conditional '%s' expression predicted to left value.\"\n                % self.conditional_kind,\n            )\n        elif truth_value is truth_value_use_right:\n            return (\n                wrapExpressionWithNodeSideEffects(new_node=right, old_node=left),\n                \"new_expression\",\n                \"Conditional '%s' expression predicted right value.\"\n                % self.conditional_kind,\n            )\n        else:\n            return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        left = self.subnode_left\n\n        if left.mayRaiseException(exception_type):\n            return True\n\n        if left.mayRaiseExceptionBool(exception_type):\n            return True\n\n        right = self.subnode_right\n\n        if right.mayRaiseException(exception_type):\n            return True\n\n        return False\n\n    def computeExpressionBool(self, trace_collection):\n        truth_value = self.subnode_right.getTruthValue()\n\n        if not self.mayRaiseException(BaseException) and self.mayRaiseExceptionBool(\n            BaseException\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if truth_value is None:\n            # No action\n            pass\n        elif truth_value is True:\n            if self.isExpressionConditionalOr():\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=True, node=self.subnode_right, user_provided=False\n                    ),\n                    old_node=self,\n                    side_effects=(\n                        ExpressionBuiltinBool(\n                            value=self.subnode_left, source_ref=self.source_ref\n                        ),\n                    ),\n                )\n\n                return True, result, \"Predicted right hand side of 'or' to be true.\"\n            else:\n                # TODO: There are no side effects after something else, which\n                # would be needed, but for constant values, this works well.\n                if not self.subnode_right.mayHaveSideEffects():\n                    return (\n                        self.subnode_left.getTruthValue(),\n                        self.subnode_left,\n                        \"Predicted right hand side of 'and' to be true.\",\n                    )\n        elif truth_value is False:\n            if self.isExpressionConditionalAnd():\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=False, node=self.subnode_right, user_provided=False\n                    ),\n                    old_node=self,\n                    side_effects=(\n                        ExpressionBuiltinBool(\n                            value=self.subnode_left, source_ref=self.source_ref\n                        ),\n                    ),\n                )\n\n                return False, result, \"Predicted right hand side of 'and' to be false.\"\n            else:\n                # TODO: There are no side effects after something else, which\n                # would be needed, but for constant values, this works well.\n                if not self.subnode_right.mayHaveSideEffects():\n                    return (\n                        self.subnode_left.getTruthValue(),\n                        self.subnode_left,\n                        \"Predicted right hand side of 'or' to be false.\",\n                    )\n                else:\n                    truth_value = self.subnode_left.getTruthValue()\n\n        return truth_value, None, None\n\n    def mayRaiseExceptionBool(self, exception_type):\n        # The and/or bool will be working on either side.\n        if self.subnode_left.mayRaiseExceptionBool(exception_type):\n            return True\n\n        if self.subnode_right.mayRaiseExceptionBool(exception_type):\n            return True\n\n        return False\n\n    def mayHaveSideEffectsBool(self):\n        if self.subnode_left.mayHaveSideEffectsBool():\n            return True\n\n        if self.subnode_right.mayHaveSideEffectsBool():\n            return True\n\n        return False\n\n\nclass ExpressionConditionalOr(ExpressionConditionalBoolBase):\n    kind = \"EXPRESSION_CONDITIONAL_OR\"\n\n    conditional_kind = \"or\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionConditionalBoolBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        result = makeStatementConditional(\n            condition=self.subnode_left,\n            yes_branch=None,\n            no_branch=makeStatementExpressionOnlyReplacementNode(\n                expression=self.subnode_right, node=self.subnode_right\n            ),\n            source_ref=self.source_ref,\n        )\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nConvert conditional 'or' expression with unused result into conditional statement.\"\"\",\n        )\n\n\nclass ExpressionConditionalAnd(ExpressionConditionalBoolBase):\n    kind = \"EXPRESSION_CONDITIONAL_AND\"\n\n    conditional_kind = \"and\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionConditionalBoolBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        result = makeStatementConditional(\n            condition=self.subnode_left,\n            no_branch=None,\n            yes_branch=makeStatementExpressionOnlyReplacementNode(\n                expression=self.subnode_right, node=self.subnode_right\n            ),\n            source_ref=self.source_ref,\n        )\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nConvert conditional 'and' expression with unused result into conditional statement.\"\"\",\n        )\n\n\nclass StatementConditional(ConditionalValueComputeMixin, StatementConditionalBase):\n    kind = \"STATEMENT_CONDITIONAL\"\n\n    named_children = (\n        \"condition\",\n        \"yes_branch|statements_or_none+setter\",\n        \"no_branch|statements_or_none+setter\",\n    )\n\n    checkers = {\n        \"yes_branch\": checkStatementsSequenceOrNone,\n        \"no_branch\": checkStatementsSequenceOrNone,\n    }\n\n    def isStatementAborting(self):\n        yes_branch = self.subnode_yes_branch\n\n        if yes_branch is not None:\n            if yes_branch.isStatementAborting():\n                no_branch = self.subnode_no_branch\n\n                if no_branch is not None:\n                    return no_branch.isStatementAborting()\n                else:\n                    return False\n            else:\n                return False\n        else:\n            return False\n\n    def mayRaiseException(self, exception_type):\n        condition = self.subnode_condition\n\n        if condition.mayRaiseException(exception_type):\n            return True\n\n        if condition.mayRaiseExceptionBool(exception_type):\n            return True\n\n        yes_branch = self.subnode_yes_branch\n\n        # Handle branches that became empty behind our back\n        if yes_branch is not None and yes_branch.mayRaiseException(exception_type):\n            return True\n\n        no_branch = self.subnode_no_branch\n\n        # Handle branches that became empty behind our back\n        if no_branch is not None and no_branch.mayRaiseException(exception_type):\n            return True\n\n        return False\n\n    def needsFrame(self):\n        condition = self.subnode_condition\n\n        if condition.mayRaiseException(BaseException):\n            return True\n\n        if condition.mayRaiseExceptionBool(BaseException):\n            return True\n\n        yes_branch = self.subnode_yes_branch\n\n        # Handle branches that became empty behind our back\n        if yes_branch is not None and yes_branch.needsFrame():\n            return True\n\n        no_branch = self.subnode_no_branch\n\n        # Handle branches that became empty behind our back\n        if no_branch is not None and no_branch.needsFrame():\n            return True\n\n        return False\n\n    def computeStatement(self, trace_collection):\n        # This is rather complex stuff, pylint: disable=too-many-branches,too-many-statements\n\n        condition = trace_collection.onExpression(self.subnode_condition)\n\n        # No need to look any further, if the condition raises, the branches do\n        # not matter at all.\n        if condition.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=condition, node=self\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nConditional statements already raises implicitly in condition, removing \\\nbranches.\"\"\",\n            )\n\n        # Tell it we are evaluation it for boolean value only, it may demote\n        # itself possibly.\n        truth_value, condition = self._computeConditionTruthValue(trace_collection)\n\n        # TODO: We now know that condition evaluates to true for the yes branch\n        # and to not true for no branch, the branch collection should know that.\n        yes_branch = self.subnode_yes_branch\n        no_branch = self.subnode_no_branch\n\n        # Handle branches that became empty behind our back.\n        if yes_branch is not None:\n            if not yes_branch.subnode_statements:\n                yes_branch.finalize()\n                yes_branch = None\n\n                self.setChildYesBranch(None)\n\n        if no_branch is not None:\n            if not no_branch.subnode_statements:\n                no_branch.finalize()\n                no_branch = None\n\n                self.setChildNoBranch(None)\n\n        # Consider to not remove branches that we know won't be taken.\n        if yes_branch is not None and truth_value is False:\n            trace_collection.signalChange(\n                tags=\"new_statements\",\n                source_ref=yes_branch.source_ref,\n                message=\"Removed conditional branch that cannot be taken due to false condition value.\",\n            )\n\n            yes_branch.finalize()\n            yes_branch = None\n\n            self.setChildYesBranch(None)\n\n        if no_branch is not None and truth_value is True:\n            trace_collection.signalChange(\n                tags=\"new_statements\",\n                source_ref=no_branch.source_ref,\n                message=\"Removed 'else' branch that cannot be taken due to true condition value.\",\n            )\n\n            no_branch.finalize()\n            no_branch = None\n\n            self.setChildNoBranch(None)\n\n        # Do we need to merge branches\n        needs_merge = True\n\n        # Continue to execute for yes branch unless we know it's not going to be\n        # relevant.\n        if yes_branch is not None:\n            branch_yes_collection = TraceCollectionBranch(\n                parent=trace_collection, name=\"conditional yes branch\"\n            )\n\n            yes_branch = branch_yes_collection.computeBranch(branch=yes_branch)\n\n            # If it's aborting, it doesn't contribute to merging.\n            if yes_branch is None:\n                branch_yes_collection = None\n            elif yes_branch.isStatementAborting():\n                branch_yes_collection = None\n                needs_merge = False\n        else:\n            branch_yes_collection = None\n\n        # Continue to execute for yes branch.\n        if no_branch is not None:\n            branch_no_collection = TraceCollectionBranch(\n                parent=trace_collection, name=\"conditional no branch\"\n            )\n\n            no_branch = branch_no_collection.computeBranch(branch=no_branch)\n\n            # If it's aborting, it doesn't contribute to merging.\n            if no_branch is None:\n                branch_no_collection = None\n            elif no_branch.isStatementAborting():\n                branch_no_collection = None\n                needs_merge = False\n        else:\n            branch_no_collection = None\n\n        if truth_value is True:\n            if branch_yes_collection is not None:\n                trace_collection.replaceBranch(branch_yes_collection)\n        elif truth_value is False:\n            if branch_no_collection is not None:\n                trace_collection.replaceBranch(branch_no_collection)\n        else:\n            if needs_merge:\n                trace_collection.mergeBranches(\n                    branch_yes_collection, branch_no_collection\n                )\n            else:\n                if branch_yes_collection is not None:\n                    trace_collection.replaceBranch(branch_yes_collection)\n                elif branch_no_collection is not None:\n                    trace_collection.replaceBranch(branch_no_collection)\n\n        # Both branches may have become empty, which case, the statement needs\n        # not remain.\n        if yes_branch is None and no_branch is None:\n            # Need to keep the boolean check.\n            if truth_value is None:\n                condition = ExpressionBuiltinBool(\n                    value=condition, source_ref=condition.getSourceReference()\n                )\n\n            if condition.mayHaveSideEffects():\n                # With both branches eliminated, the condition remains as a side\n                # effect.\n                result = makeStatementExpressionOnlyReplacementNode(\n                    expression=condition, node=self\n                )\n\n                del self.parent\n\n                return (\n                    result,\n                    \"new_statements\",\n                    \"\"\"\\\nBoth branches have no effect, reduced to evaluate condition.\"\"\",\n                )\n            else:\n                self.finalize()\n\n                return (\n                    None,\n                    \"new_statements\",\n                    \"\"\"\\\nRemoved conditional statement without effect.\"\"\",\n                )\n\n        # Note: Checking the condition late, so that the surviving branch got\n        # processed already. Returning without doing that, will corrupt the SSA\n        # results. TODO: Could pretend the other branch didn't exist to save\n        # complexity the merging of processing.\n        if truth_value is not None:\n            if truth_value is True:\n                choice = \"true\"\n\n                new_statement = yes_branch\n                if no_branch is not None:\n                    no_branch.finalize()\n            else:\n                choice = \"false\"\n\n                new_statement = no_branch\n                if yes_branch is not None:\n                    yes_branch.finalize()\n\n            new_statement = wrapStatementWithSideEffects(\n                new_node=new_statement,\n                old_node=condition,\n                allow_none=True,  # surviving branch may empty\n            )\n\n            del self.parent\n\n            return (\n                new_statement,\n                \"new_statements\",\n                \"\"\"\\\nCondition for branch statement was predicted to be always %s.\"\"\"\n                % choice,\n            )\n\n        # If there is no \"yes\" branch, remove that. Maybe a bad idea though.\n        if yes_branch is None:\n            # Would be eliminated already, if there wasn't any \"no\" branch\n            # either.\n            assert no_branch is not None\n\n            new_statement = makeStatementConditional(\n                condition=ExpressionOperationNot(\n                    operand=condition, source_ref=condition.getSourceReference()\n                ),\n                yes_branch=no_branch,\n                no_branch=None,\n                source_ref=self.source_ref,\n            )\n\n            del self.parent\n\n            return (\n                new_statement,\n                \"new_statements\",\n                \"\"\"\\\nEmpty 'yes' branch for conditional statement treated with inverted condition check.\"\"\",\n            )\n\n        return self, None, None\n\n    def mayReturn(self):\n        yes_branch = self.subnode_yes_branch\n\n        if yes_branch is not None and yes_branch.mayReturn():\n            return True\n\n        no_branch = self.subnode_no_branch\n\n        if no_branch is not None and no_branch.mayReturn():\n            return True\n\n        return False\n\n    def mayBreak(self):\n        yes_branch = self.subnode_yes_branch\n\n        if yes_branch is not None and yes_branch.mayBreak():\n            return True\n\n        no_branch = self.subnode_no_branch\n\n        if no_branch is not None and no_branch.mayBreak():\n            return True\n\n        return False\n\n    def mayContinue(self):\n        yes_branch = self.subnode_yes_branch\n\n        if yes_branch is not None and yes_branch.mayContinue():\n            return True\n\n        no_branch = self.subnode_no_branch\n\n        if no_branch is not None and no_branch.mayContinue():\n            return True\n\n        return False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"branch statement\"\n\n\ndef makeNotExpression(expression):\n    # These are invertible with bool type shape.\n    if expression.isExpressionComparison() and expression.getTypeShape() is tshape_bool:\n        return expression.makeInverseComparison()\n    else:\n        return ExpressionOperationNot(\n            operand=expression, source_ref=expression.getSourceReference()\n        )\n\n\ndef makeStatementConditional(condition, yes_branch, no_branch, source_ref):\n    \"\"\"Create conditional statement, with yes_branch not being empty.\n\n    May have to invert condition to achieve that.\n    \"\"\"\n\n    if yes_branch is None:\n        condition = makeNotExpression(expression=condition)\n\n        yes_branch, no_branch = no_branch, yes_branch\n\n    if yes_branch is not None and not yes_branch.isStatementsSequence():\n        yes_branch = StatementsSequence(\n            statements=(yes_branch,), source_ref=yes_branch.source_ref\n        )\n\n    if no_branch is not None and not no_branch.isStatementsSequence():\n        no_branch = StatementsSequence(\n            statements=(no_branch,), source_ref=no_branch.source_ref\n        )\n\n    return StatementConditional(\n        condition=condition,\n        yes_branch=yes_branch,\n        no_branch=no_branch,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ConstantRefNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for constant expressions. Can be all common built-in types.\n\n\"\"\"\n\nimport sys\nfrom abc import abstractmethod\n\nfrom nuitka import Options\nfrom nuitka.__past__ import (\n    GenericAlias,\n    UnionType,\n    iterItems,\n    long,\n    unicode,\n    xrange,\n)\nfrom nuitka.Builtins import (\n    builtin_anon_values,\n    builtin_exception_values_list,\n    builtin_named_values,\n)\nfrom nuitka.Constants import (\n    getUnhashableConstant,\n    isConstant,\n    isHashable,\n    isMutable,\n    the_empty_dict,\n    the_empty_frozenset,\n    the_empty_list,\n    the_empty_set,\n    the_empty_tuple,\n    the_empty_unicode,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import optimization_logger\n\nfrom .ExpressionBases import CompileTimeConstantExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionBytearrayShapeExactMixin,\n    ExpressionBytesShapeExactMixin,\n    ExpressionComplexShapeExactMixin,\n    ExpressionDictShapeExactMixin,\n    ExpressionEllipsisShapeExactMixin,\n    ExpressionFloatShapeExactMixin,\n    ExpressionFrozensetShapeExactMixin,\n    ExpressionIntShapeExactMixin,\n    ExpressionListShapeExactMixin,\n    ExpressionLongShapeExactMixin,\n    ExpressionNoneShapeExactMixin,\n    ExpressionSetShapeExactMixin,\n    ExpressionSliceShapeExactMixin,\n    ExpressionStrShapeExactMixin,\n    ExpressionTupleShapeExactMixin,\n    ExpressionUnicodeShapeExactMixin,\n)\nfrom .IterationHandles import (\n    ConstantBytearrayIterationHandle,\n    ConstantBytesIterationHandle,\n    ConstantDictIterationHandle,\n    ConstantFrozensetIterationHandle,\n    ConstantListIterationHandle,\n    ConstantRangeIterationHandle,\n    ConstantSetIterationHandle,\n    ConstantStrIterationHandle,\n    ConstantTupleIterationHandle,\n    ConstantUnicodeIterationHandle,\n)\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionReplacementExpression,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import (\n    tshape_namedtuple,\n    tshape_type,\n    tshape_xrange,\n)\n\n\nclass ExpressionConstantUntrackedRefBase(CompileTimeConstantExpressionBase):\n    __slots__ = (\"constant\",)\n\n    def __init__(self, constant, source_ref):\n        CompileTimeConstantExpressionBase.__init__(self, source_ref)\n\n        self.constant = constant\n\n    def finalize(self):\n        del self.parent\n        del self.constant\n\n    def __repr__(self):\n        return \"<Node %s value %r at %s>\" % (\n            self.kind,\n            self.constant,\n            self.source_ref.getAsString(),\n        )\n\n    def getDetails(self):\n        return {\"constant\": self.constant}\n\n    def getDetailsForDisplay(self):\n        result = self.getDetails()\n\n        if \"constant\" in result:\n            result[\"constant\"] = repr(result[\"constant\"])\n\n        return result\n\n    @staticmethod\n    def isExpressionConstantRef():\n        return True\n\n    def computeExpressionRaw(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n    # Note: For computedExpressionResult to work, TODO: needed more generally?\n    def computeExpression(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        trace_collection.onExceptionRaiseExit(TypeError)\n\n        # The arguments don't matter. All constant values cannot be called, and\n        # we just need to make and error out of that.\n        new_node = wrapExpressionWithSideEffects(\n            new_node=makeRaiseExceptionReplacementExpression(\n                expression=self,\n                exception_type=\"TypeError\",\n                exception_value=\"'%s' object is not callable\"\n                % type(self.constant).__name__,\n            ),\n            old_node=call_node,\n            side_effects=call_node.extractSideEffectsPreCall(),\n        )\n\n        return (\n            new_node,\n            \"new_raise\",\n            \"Predicted call of constant %s value to exception raise.\"\n            % type(self.constant),\n        )\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        return self.computeExpressionCall(\n            call_node=call_node,\n            call_args=call_args,\n            call_kw=call_kw,\n            trace_collection=trace_collection,\n        )\n\n    def getCompileTimeConstant(self):\n        return self.constant\n\n    # TODO: Push this to singletons for being static functions\n    def getComparisonValue(self):\n        return True, self.constant\n\n    @staticmethod\n    def getIterationHandle():\n        return None\n\n    def isMutable(self):\n        # This is expected to be overloaded by child classes.\n        assert False, self\n\n    def isKnownToBeHashable(self):\n        # This is expected to be overloaded by child classes.\n        assert False, self\n\n    def extractUnhashableNodeType(self):\n        value = getUnhashableConstant(self.constant)\n\n        if value is not None:\n            return makeConstantRefNode(constant=type(value), source_ref=self.source_ref)\n\n    @staticmethod\n    def isNumberConstant():\n        # This is expected to be overloaded by child classes that disagree, bool, int, long and float\n        return False\n\n    @staticmethod\n    def isIndexConstant():\n        # This is expected to be overloaded by child classes that disagree, bool, int, long and float\n        return False\n\n    def isIndexable(self):\n        # TODO: Suspiciously this doesn't use isIndexConstant, which includes float, bug?\n        return self.constant is None or self.isNumberConstant()\n\n    def isKnownToBeIterable(self, count):\n        if self.isIterableConstant():\n            return count is None or len(self.constant) == count\n        else:\n            return False\n\n    def isKnownToBeIterableAtMin(self, count):\n        length = self.getIterationLength()\n\n        return length is not None and length >= count\n\n    def canPredictIterationValues(self):\n        return self.isKnownToBeIterable(None)\n\n    def getIterationValue(self, count):\n        assert count < len(self.constant)\n\n        return makeConstantRefNode(\n            constant=self.constant[count], source_ref=self.source_ref\n        )\n\n    def getIterationValueRange(self, start, stop):\n        return [\n            makeConstantRefNode(constant=value, source_ref=self.source_ref)\n            for value in self.constant[start:stop]\n        ]\n\n    def getIterationValues(self):\n        source_ref = self.source_ref\n\n        return tuple(\n            makeConstantRefNode(\n                constant=value, source_ref=source_ref, user_provided=self.user_provided\n            )\n            for value in self.constant\n        )\n\n    def getIntegerValue(self):\n        if self.isNumberConstant():\n            return int(self.constant)\n        else:\n            return None\n\n    @abstractmethod\n    def isIterableConstant(self):\n        \"\"\"Is the constant type iterable.\"\"\"\n        # This is expected to be overloaded by child classes, but it's actually wasteful\n        # to use it, we should have overloads of using methods too.\n\n    def getIterationLength(self):\n        # This is expected to be overloaded by child classes if they are iterable\n        assert not self.isIterableConstant(), self\n\n        return None\n\n    def getStrValue(self):\n        return makeConstantRefNode(\n            constant=str(self.constant),\n            user_provided=False,\n            source_ref=self.source_ref,\n        )\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note, this is overloaded for all the others.\n        assert not self.isIterableConstant()\n\n        # TODO: Raise static exception.\n\n        return iter_node, None, None\n\n\nclass ExpressionConstantRefBase(ExpressionConstantUntrackedRefBase):\n    \"\"\"Constants reference base class.\n\n    Use this for cases, for which it makes sense to track origin, e.g.\n    large lists are from computation or from user literals.\n    \"\"\"\n\n    # Base classes can be abstract, pylint: disable=I0021,abstract-method\n\n    __slots__ = (\"user_provided\",)\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n        self.user_provided = user_provided\n\n        if not user_provided and Options.is_debug:\n            try:\n                if type(constant) in (str, unicode, bytes):\n                    max_size = 1000\n                elif type(constant) is xrange:\n                    max_size = None\n                else:\n                    max_size = 256\n\n                if max_size is not None and len(constant) > max_size:\n                    optimization_logger.warning(\n                        \"Too large constant (%s %d) encountered at %s.\"\n                        % (\n                            type(constant),\n                            len(constant),\n                            source_ref.getAsString(),\n                        )\n                    )\n            except TypeError:\n                pass\n\n    def getDetails(self):\n        return {\"constant\": self.constant, \"user_provided\": self.user_provided}\n\n    def __repr__(self):\n        return \"<Node %s value %r at %s %s>\" % (\n            self.kind,\n            self.constant,\n            self.source_ref.getAsString(),\n            self.user_provided,\n        )\n\n    def getStrValue(self):\n        try:\n            return makeConstantRefNode(\n                constant=str(self.constant),\n                user_provided=self.user_provided,\n                source_ref=self.source_ref,\n            )\n        except UnicodeEncodeError:\n            # Unicode constants may not be possible to encode.\n            return None\n\n\nclass ExpressionConstantNoneRef(\n    ExpressionNoneShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_NONE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=None, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantBoolRefBase(\n    ExpressionBoolShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    @staticmethod\n    def isExpressionConstantBoolRef():\n        return True\n\n    @staticmethod\n    def computeExpressionBool(trace_collection):\n        # Best case already, None indicated no action.\n        return None, None, None\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def isNumberConstant():\n        return True\n\n    @staticmethod\n    def isIndexConstant():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantTrueRef(ExpressionConstantBoolRefBase):\n    kind = \"EXPRESSION_CONSTANT_TRUE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        ExpressionConstantBoolRefBase.__init__(\n            self, constant=True, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\"\"\"\n\n        return True\n\n    @staticmethod\n    def getIndexValue():\n        return 1\n\n\nclass ExpressionConstantFalseRef(ExpressionConstantBoolRefBase):\n    kind = \"EXPRESSION_CONSTANT_FALSE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        ExpressionConstantBoolRefBase.__init__(\n            self, constant=False, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\"\"\"\n\n        return False\n\n    @staticmethod\n    def getIndexValue():\n        return 0\n\n\nclass ExpressionConstantEllipsisRef(\n    ExpressionEllipsisShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_ELLIPSIS_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=Ellipsis, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantDictRef(\n    ExpressionDictShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_DICT_REF\"\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantDictRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return True\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantDictIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant dict lowered to tuple.\"\"\",\n        )\n\n    def isMappingWithConstantStringKeys(self):\n        return all(type(key) in (str, unicode) for key in self.constant)\n\n    def getMappingStringKeyPairs(self):\n        pairs = []\n\n        for key, value in iterItems(self.constant):\n            pairs.append(\n                (\n                    key,\n                    makeConstantRefNode(\n                        constant=value,\n                        user_provided=self.user_provided,\n                        source_ref=self.source_ref,\n                    ),\n                )\n            )\n\n        return pairs\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\n\n        The empty dict is not allowed here, so we can hardcode it.\n        \"\"\"\n\n        return True\n\n    def getExpressionDictInConstant(self, value):\n        return value in self.constant\n\n\nclass EmptyContainerMixin(object):\n    __slots__ = ()\n\n    def getDetails(self):\n        return {\"user_provided\": self.user_provided}\n\n    @staticmethod\n    def getIterationLength():\n        return 0\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\n\n        The empty container is false, so we can hardcode it.\n        \"\"\"\n\n        return False\n\n\nclass ExpressionConstantDictEmptyRef(EmptyContainerMixin, ExpressionConstantDictRef):\n    kind = \"EXPRESSION_CONSTANT_DICT_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantDictRef.__init__(\n            self,\n            constant=the_empty_dict,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantTupleRef(\n    ExpressionTupleShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_TUPLE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantTupleRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    def isKnownToBeHashable(self):\n        # There are a few exceptions, where non-mutable can be non-hashable, e.g. slice.\n        return isHashable(self.constant)\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantTupleIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note: Tuples are as good as it gets.\n        return iter_node, None, None\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\n\n        The empty dict is not allowed here, so we can hardcode it.\n        \"\"\"\n\n        return True\n\n\nclass ExpressionConstantTupleMutableRef(ExpressionConstantTupleRef):\n    kind = \"EXPRESSION_CONSTANT_TUPLE_MUTABLE_REF\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def isMutable():\n        return True\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionConstantTupleEmptyRef(EmptyContainerMixin, ExpressionConstantTupleRef):\n    kind = \"EXPRESSION_CONSTANT_TUPLE_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantTupleRef.__init__(\n            self,\n            constant=the_empty_tuple,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantListRef(\n    ExpressionListShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_LIST_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantListRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantListIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant list lowered to tuple.\"\"\",\n        )\n\n    def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        # We did not know this before\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return (\n            in_node,\n            \"new_constant\",\n            \"\"\"Contains test over constant list lowered to tuple.\"\"\",\n        )\n\n\nclass ExpressionConstantListEmptyRef(EmptyContainerMixin, ExpressionConstantListRef):\n    kind = \"EXPRESSION_CONSTANT_LIST_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantListRef.__init__(\n            self,\n            constant=the_empty_list,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantSetRef(ExpressionSetShapeExactMixin, ExpressionConstantRefBase):\n    kind = \"EXPRESSION_CONSTANT_SET_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantSetRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return True\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantSetIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant set lowered to tuple.\"\"\",\n        )\n\n    def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=frozenset(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        # We did not know this before\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return (\n            in_node,\n            \"new_constant\",\n            \"\"\"Contains test over constant set lowered to frozenset.\"\"\",\n        )\n\n\nclass ExpressionConstantSetEmptyRef(EmptyContainerMixin, ExpressionConstantSetRef):\n    kind = \"EXPRESSION_CONSTANT_SET_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantSetRef.__init__(\n            self,\n            constant=the_empty_set,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantFrozensetRef(\n    ExpressionFrozensetShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_FROZENSET_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantFrozensetRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantFrozensetIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant frozenset lowered to tuple.\"\"\",\n        )\n\n\nclass ExpressionConstantFrozensetEmptyRef(\n    EmptyContainerMixin, ExpressionConstantFrozensetRef\n):\n    kind = \"EXPRESSION_CONSTANT_FROZENSET_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantFrozensetRef.__init__(\n            self,\n            constant=the_empty_frozenset,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantIntRef(\n    ExpressionIntShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_INT_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantIntRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isNumberConstant():\n        return True\n\n    @staticmethod\n    def isIndexConstant():\n        return True\n\n    def getIndexValue(self):\n        return self.constant\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantLongRef(\n    ExpressionLongShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_LONG_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantLongRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isNumberConstant():\n        return True\n\n    @staticmethod\n    def isIndexConstant():\n        return True\n\n    def getIndexValue(self):\n        # Use the int value if possible, otherwise that remains a long, which is\n        # also OK, but often unnecessary.\n        return int(self.constant)\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantStrRef(ExpressionStrShapeExactMixin, ExpressionConstantRefBase):\n    kind = \"EXPRESSION_CONSTANT_STR_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantStrRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantStrIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def getStrValue(self):\n        return self\n\n    def getStringValue(self):\n        return self.constant\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note: str are as good as it gets.\n        return iter_node, None, None\n\n\nclass ExpressionConstantStrEmptyRef(EmptyContainerMixin, ExpressionConstantStrRef):\n    kind = \"EXPRESSION_CONSTANT_STR_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantStrRef.__init__(\n            self,\n            constant=\"\",\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantUnicodeRef(\n    ExpressionUnicodeShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_UNICODE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantUnicodeRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantUnicodeIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note: unicode are as good as it gets\n        return iter_node, None, None\n\n\nclass ExpressionConstantUnicodeEmptyRef(\n    EmptyContainerMixin, ExpressionConstantUnicodeRef\n):\n    kind = \"EXPRESSION_CONSTANT_UNICODE_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantUnicodeRef.__init__(\n            self,\n            constant=the_empty_unicode,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantBytesRef(\n    ExpressionBytesShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_BYTES_REF\"\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantBytesRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantBytesIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note: bytes are as good as it gets\n        return iter_node, None, None\n\n\nclass ExpressionConstantBytesEmptyRef(EmptyContainerMixin, ExpressionConstantBytesRef):\n    kind = \"EXPRESSION_CONSTANT_BYTES_EMPTY_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, user_provided, source_ref):\n        ExpressionConstantBytesRef.__init__(\n            self,\n            constant=b\"\",\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionConstantBytearrayRef(\n    ExpressionBytearrayShapeExactMixin, ExpressionConstantRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_BYTEARRAY_REF\"\n\n    def __init__(self, constant, user_provided, source_ref):\n        ExpressionConstantRefBase.__init__(\n            self, constant=constant, user_provided=user_provided, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantBytearrayRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantBytearrayIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = makeConstantRefNode(\n            constant=bytes(self.constant),\n            user_provided=self.user_provided,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant bytearray lowered to bytes.\"\"\",\n        )\n\n\nclass ExpressionConstantFloatRef(\n    ExpressionFloatShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_FLOAT_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantFloatRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isNumberConstant():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantComplexRef(\n    ExpressionComplexShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_COMPLEX_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantComplexRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n    # Overload what ExpressionComplexShapeExactMixin says, for a given instance we know all.\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(0j, attribute_name)\n\n\nclass ExpressionConstantSliceRef(\n    ExpressionSliceShapeExactMixin, ExpressionConstantUntrackedRefBase\n):\n    kind = \"EXPRESSION_CONSTANT_SLICE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantSliceRef():\n        return True\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n\nclass ExpressionConstantXrangeRef(ExpressionConstantUntrackedRefBase):\n    kind = \"EXPRESSION_CONSTANT_XRANGE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, constant, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=constant, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionConstantXrangeRef():\n        return True\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_xrange\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantRangeIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # Note: xrange are as good as it gets.\n        return iter_node, None, None\n\n\nclass ExpressionConstantTypeRef(ExpressionConstantUntrackedRefBase):\n    kind = \"EXPRESSION_CONSTANT_TYPE_REF\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def isExpressionConstantTypeRef():\n        return True\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_type\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        if call_kw is not None and not call_kw.isMappingWithConstantStringKeys():\n            return call_node, None, None\n        else:\n            from nuitka.optimizations.OptimizeBuiltinCalls import (\n                computeBuiltinCall,\n            )\n\n            new_node, tags, message = computeBuiltinCall(\n                builtin_name=self.constant.__name__, call_node=call_node\n            )\n\n            return new_node, tags, message\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        return self.computeExpressionCall(\n            call_node=call_node,\n            call_args=call_args,\n            call_kw=call_kw,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return False\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n\nclass ExpressionConstantTypeSubscriptableMixin(object):\n    __slots__ = ()\n\n    if python_version >= 0x390:\n\n        def computeExpressionSubscript(self, lookup_node, subscript, trace_collection):\n            if subscript.isCompileTimeConstant():\n                return trace_collection.getCompileTimeComputationResult(\n                    node=lookup_node,\n                    computation=lambda: self.getCompileTimeConstant()[\n                        subscript.getCompileTimeConstant()\n                    ],\n                    description=\"Subscript of subscriptable type with constant value.\",\n                )\n\n            # TODO: Not true, in fact these should become GenericAlias always.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return lookup_node, None, None\n\n\nclass ExpressionConstantConcreteTypeMixin(object):\n    __slots__ = ()\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n\nclass ExpressionConstantTypeDictRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_DICT_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(self, constant=dict, source_ref=source_ref)\n\n\nclass ExpressionConstantTypeSetRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_SET_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(self, constant=set, source_ref=source_ref)\n\n\nclass ExpressionConstantTypeFrozensetRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_FROZENSET_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(\n            self, constant=frozenset, source_ref=source_ref\n        )\n\n\nclass ExpressionConstantTypeListRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_LIST_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(self, constant=list, source_ref=source_ref)\n\n\nclass ExpressionConstantTypeTupleRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_TUPLE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(self, constant=tuple, source_ref=source_ref)\n\n\nclass ExpressionConstantTypeTypeRef(\n    ExpressionConstantConcreteTypeMixin,\n    ExpressionConstantTypeSubscriptableMixin,\n    ExpressionConstantTypeRef,\n):\n    kind = \"EXPRESSION_CONSTANT_TYPE_TYPE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionConstantTypeRef.__init__(self, constant=type, source_ref=source_ref)\n\n\ndef makeConstantRefNode(constant, source_ref, user_provided=False):\n    # This is dispatching per constant value and types, every case\n    # to be a return statement, pylint: disable=too-many-branches,too-many-return-statements,too-many-statements\n\n    # Dispatch based on constants first.\n    if constant is None:\n        return ExpressionConstantNoneRef(source_ref=source_ref)\n    elif constant is True:\n        return ExpressionConstantTrueRef(source_ref=source_ref)\n    elif constant is False:\n        return ExpressionConstantFalseRef(source_ref=source_ref)\n    elif constant is Ellipsis:\n        return ExpressionConstantEllipsisRef(source_ref=source_ref)\n\n    # Next, dispatch based on type.\n    constant_type = type(constant)\n\n    if constant_type is int:\n        return ExpressionConstantIntRef(constant=constant, source_ref=source_ref)\n    elif constant_type is str:\n        if constant:\n            return ExpressionConstantStrRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantStrEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is float:\n        return ExpressionConstantFloatRef(constant=constant, source_ref=source_ref)\n    elif constant_type is long:\n        return ExpressionConstantLongRef(\n            constant=constant,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n    elif constant_type is unicode:\n        if constant:\n            return ExpressionConstantUnicodeRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantUnicodeEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is bytes:\n        if constant:\n            return ExpressionConstantBytesRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantBytesEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is dict:\n        if constant:\n            assert isConstant(constant), repr(constant)\n\n            return ExpressionConstantDictRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantDictEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is tuple:\n        if constant:\n            assert isConstant(constant), repr(constant)\n\n            if isMutable(constant):\n                return ExpressionConstantTupleMutableRef(\n                    constant=constant,\n                    user_provided=user_provided,\n                    source_ref=source_ref,\n                )\n            else:\n                return ExpressionConstantTupleRef(\n                    constant=constant,\n                    user_provided=user_provided,\n                    source_ref=source_ref,\n                )\n        else:\n            return ExpressionConstantTupleEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is list:\n        if constant:\n            assert isConstant(constant), repr(constant)\n\n            return ExpressionConstantListRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantListEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is set:\n        if constant:\n            assert isConstant(constant), repr(constant)\n\n            return ExpressionConstantSetRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantSetEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is frozenset:\n        if constant:\n            assert isConstant(constant), repr(constant)\n\n            return ExpressionConstantFrozensetRef(\n                constant=constant,\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionConstantFrozensetEmptyRef(\n                user_provided=user_provided,\n                source_ref=source_ref,\n            )\n    elif constant_type is complex:\n        return ExpressionConstantComplexRef(\n            constant=constant,\n            source_ref=source_ref,\n        )\n    elif constant_type is slice:\n        return ExpressionConstantSliceRef(\n            constant=constant,\n            source_ref=source_ref,\n        )\n    elif constant_type is type:\n        if constant is dict:\n            return ExpressionConstantTypeDictRef(source_ref=source_ref)\n        if constant is set:\n            return ExpressionConstantTypeSetRef(source_ref=source_ref)\n        if constant is frozenset:\n            return ExpressionConstantTypeFrozensetRef(source_ref=source_ref)\n        if constant is tuple:\n            return ExpressionConstantTypeTupleRef(source_ref=source_ref)\n        if constant is list:\n            return ExpressionConstantTypeListRef(source_ref=source_ref)\n        if constant is type:\n            return ExpressionConstantTypeTypeRef(source_ref=source_ref)\n\n        # TODO: Need to get rid of these, and be sure we have complete coverage for\n        # code generation of all types. This lets constants be created that may not\n        # work. Needed for isExperimental(\"assume-type-complete\") to be workable.\n        return ExpressionConstantTypeRef(constant=constant, source_ref=source_ref)\n    elif constant_type is xrange:\n        return ExpressionConstantXrangeRef(\n            constant=constant,\n            source_ref=source_ref,\n        )\n    elif constant_type is bytearray:\n        return ExpressionConstantBytearrayRef(\n            constant=constant,\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n    elif constant_type is GenericAlias:\n        from .BuiltinTypeNodes import ExpressionConstantGenericAlias\n\n        return ExpressionConstantGenericAlias(\n            generic_alias=constant, source_ref=source_ref\n        )\n    elif constant_type is UnionType:\n        from .BuiltinTypeNodes import ExpressionConstantUnionType\n\n        return ExpressionConstantUnionType(union_type=constant, source_ref=source_ref)\n    elif constant is sys.version_info:\n        return ExpressionConstantSysVersionInfoRef(source_ref=source_ref)\n    elif constant in builtin_anon_values:\n        from .BuiltinRefNodes import ExpressionBuiltinAnonymousRef\n\n        return ExpressionBuiltinAnonymousRef(\n            builtin_name=builtin_anon_values[constant],\n            source_ref=source_ref,\n        )\n    elif constant in builtin_named_values:\n        from .BuiltinRefNodes import ExpressionBuiltinRef\n\n        return ExpressionBuiltinRef(\n            builtin_name=builtin_named_values[constant], source_ref=source_ref\n        )\n    elif constant in builtin_exception_values_list:\n        from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n\n        if constant is NotImplemented:\n            exception_name = \"NotImplemented\"\n        else:\n            exception_name = constant.__name__\n\n        return ExpressionBuiltinExceptionRef(\n            exception_name=exception_name, source_ref=source_ref\n        )\n    else:\n        # Missing constant type, ought to not happen, please report.\n        assert False, (constant, constant_type)\n\n\nclass ExpressionConstantSysVersionInfoRef(ExpressionConstantUntrackedRefBase):\n    kind = \"EXPRESSION_CONSTANT_SYS_VERSION_INFO_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        ExpressionConstantUntrackedRefBase.__init__(\n            self, constant=sys.version_info, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_namedtuple\n\n    @staticmethod\n    def isMutable():\n        return False\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def isIterableConstant():\n        return True\n\n    def getIterationHandle(self):\n        return ConstantTupleIterationHandle(self)\n\n    def getIterationLength(self):\n        return len(self.constant)\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        # For iteration, we are just a normal tuple.\n        result = makeConstantRefNode(\n            constant=tuple(self.constant),\n            user_provided=True,\n            source_ref=self.source_ref,\n        )\n\n        self.parent.replaceChild(self, result)\n        self.finalize()\n\n        return (\n            iter_node,\n            \"new_constant\",\n            \"\"\"Iteration over constant 'sys.version_info' lowered to tuple.\"\"\",\n        )\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ContainerMakingNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that build containers.\n\n\"\"\"\n\nimport functools\nfrom abc import abstractmethod\n\nfrom nuitka.PythonVersions import needsSetLiteralReverseInsertion\n\nfrom .ChildrenHavingMixins import ChildHavingElementsTupleMixin\nfrom .ConstantRefNodes import (\n    ExpressionConstantListEmptyRef,\n    ExpressionConstantSetEmptyRef,\n    ExpressionConstantTupleEmptyRef,\n    makeConstantRefNode,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionListShapeExactMixin,\n    ExpressionSetShapeExactMixin,\n    ExpressionTupleShapeExactMixin,\n)\nfrom .IterationHandles import ListAndTupleContainerMakingIterationHandle\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import makeStatementOnlyNodesFromExpressions\n\n\nclass ExpressionMakeSequenceMixin(object):\n    __slots__ = ()\n\n    def isKnownToBeIterable(self, count):\n        return count is None or count == len(self.subnode_elements)\n\n    def isKnownToBeIterableAtMin(self, count):\n        return count <= len(self.subnode_elements)\n\n    def getIterationValue(self, count):\n        return self.subnode_elements[count]\n\n    def getIterationValueRange(self, start, stop):\n        return self.subnode_elements[start:stop]\n\n    @staticmethod\n    def canPredictIterationValues():\n        return True\n\n    def getIterationValues(self):\n        return self.subnode_elements\n\n    def getIterationHandle(self):\n        return ListAndTupleContainerMakingIterationHandle(self.subnode_elements)\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n    def mayRaiseException(self, exception_type):\n        for element in self.subnode_elements:\n            if element.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    # TODO: Make this happen from auto-compute, children only side effects\n    def computeExpressionDrop(self, statement, trace_collection):\n        # Virtual method overload, pylint: disable=unused-argument\n\n        result = makeStatementOnlyNodesFromExpressions(\n            expressions=self.subnode_elements\n        )\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nRemoved %s creation for unused sequence.\"\"\"\n            % self.getSequenceName(),\n        )\n\n    def onContentEscapes(self, trace_collection):\n        for element in self.subnode_elements:\n            element.onContentEscapes(trace_collection)\n\n    @abstractmethod\n    def getSequenceName(self):\n        \"\"\"Get name for use in traces\"\"\"\n\n\nclass ExpressionMakeSequenceBase(\n    SideEffectsFromChildrenMixin,\n    ExpressionMakeSequenceMixin,\n    ChildHavingElementsTupleMixin,\n    ExpressionBase,\n):\n    named_children = (\"elements|tuple\",)\n\n    def __init__(self, elements, source_ref):\n        assert elements\n\n        ChildHavingElementsTupleMixin.__init__(\n            self,\n            elements=elements,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getSequenceName(self):\n        \"\"\"Get name for use in traces\"\"\"\n        simulator = self.getSimulator()\n        return simulator.__name__.capitalize()\n\n    @staticmethod\n    def isExpressionMakeSequence():\n        return True\n\n    @abstractmethod\n    def getSimulator(self):\n        \"\"\"The simulator for the container making, for overload.\"\"\"\n\n    def computeExpression(self, trace_collection):\n        for element in self.subnode_elements:\n            if not element.isCompileTimeConstant():\n                return self, None, None\n\n        simulator = self.getSimulator()\n        assert simulator is not None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: simulator(\n                element.getCompileTimeConstant() for element in self.subnode_elements\n            ),\n            description=\"%s with constant arguments.\" % simulator.__name__.capitalize(),\n            user_provided=True,\n        )\n\n\ndef makeExpressionMakeTuple(elements, source_ref):\n    if elements:\n        return ExpressionMakeTuple(elements, source_ref)\n    else:\n        # TODO: Get rid of user provided for empty tuple refs, makes no sense.\n        return ExpressionConstantTupleEmptyRef(\n            user_provided=False, source_ref=source_ref\n        )\n\n\ndef makeExpressionMakeTupleOrConstant(elements, user_provided, source_ref):\n    for element in elements:\n        # TODO: Compile time constant ought to be the criterion.\n        if not element.isExpressionConstantRef():\n            result = makeExpressionMakeTuple(elements, source_ref)\n            break\n    else:\n        result = makeConstantRefNode(\n            constant=tuple(element.getCompileTimeConstant() for element in elements),\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n    if elements:\n        result.setCompatibleSourceReference(\n            source_ref=elements[-1].getCompatibleSourceReference()\n        )\n\n    return result\n\n\nclass ExpressionMakeTuple(ExpressionTupleShapeExactMixin, ExpressionMakeSequenceBase):\n    kind = \"EXPRESSION_MAKE_TUPLE\"\n\n    def __init__(self, elements, source_ref):\n        ExpressionMakeSequenceBase.__init__(\n            self, elements=elements, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getSimulator():\n        return tuple\n\n    def getIterationLength(self):\n        return len(self.subnode_elements)\n\n\ndef makeExpressionMakeList(elements, source_ref):\n    if elements:\n        return ExpressionMakeList(elements, source_ref)\n    else:\n        # TODO: Get rid of user provided for empty list refs, makes no sense.\n        return ExpressionConstantListEmptyRef(\n            user_provided=False, source_ref=source_ref\n        )\n\n\ndef makeExpressionMakeListOrConstant(elements, user_provided, source_ref):\n    for element in elements:\n        # TODO: Compile time constant ought to be the criterion.\n        if not element.isExpressionConstantRef():\n            result = makeExpressionMakeList(elements, source_ref)\n            break\n    else:\n        result = makeConstantRefNode(\n            constant=[element.getCompileTimeConstant() for element in elements],\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n    if elements:\n        result.setCompatibleSourceReference(\n            source_ref=elements[-1].getCompatibleSourceReference()\n        )\n\n    return result\n\n\nclass ExpressionMakeListMixin(object):\n    __slots__ = ()\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = ExpressionMakeTuple(\n            elements=self.subnode_elements, source_ref=self.source_ref\n        )\n\n        self.parent.replaceChild(self, result)\n        del self.parent\n\n        return (\n            iter_node,\n            \"new_expression\",\n            \"\"\"\\\nIteration over list lowered to iteration over tuple.\"\"\",\n        )\n\n\nclass ExpressionMakeList(\n    ExpressionListShapeExactMixin, ExpressionMakeListMixin, ExpressionMakeSequenceBase\n):\n    kind = \"EXPRESSION_MAKE_LIST\"\n\n    def __init__(self, elements, source_ref):\n        ExpressionMakeSequenceBase.__init__(\n            self, elements=elements, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getSimulator():\n        return list\n\n    def getIterationLength(self):\n        return len(self.subnode_elements)\n\n\nclass ExpressionMakeSet(ExpressionSetShapeExactMixin, ExpressionMakeSequenceBase):\n    kind = \"EXPRESSION_MAKE_SET\"\n\n    def __init__(self, elements, source_ref):\n        ExpressionMakeSequenceBase.__init__(\n            self, elements=elements, source_ref=source_ref\n        )\n\n    @staticmethod\n    def getSimulator():\n        return set\n\n    def getIterationLength(self):\n        element_count = len(self.subnode_elements)\n\n        # Hashing and equality may consume elements of the produced set.\n        if element_count >= 2:\n            return None\n        else:\n            return element_count\n\n    @staticmethod\n    def getIterationMinLength():\n        # Hashing and equality may consume elements of the produced set.\n        return 1\n\n    def computeExpression(self, trace_collection):\n        # For sets, we need to consider hashing\n        are_constants = True\n        are_hashable = True\n\n        for element in self.subnode_elements:\n            if are_constants and not element.isCompileTimeConstant():\n                are_constants = False\n\n            if are_hashable and not element.isKnownToBeHashable():\n                are_hashable = False\n\n            if not are_hashable and not are_constants:\n                break\n\n        if not are_constants:\n            if not are_hashable:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        simulator = self.getSimulator()\n        assert simulator is not None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: simulator(\n                element.getCompileTimeConstant() for element in self.subnode_elements\n            ),\n            description=\"%s with constant arguments.\" % simulator.__name__.capitalize(),\n            user_provided=True,\n        )\n\n    def mayRaiseException(self, exception_type):\n        for element in self.subnode_elements:\n            if not element.isKnownToBeHashable():\n                return True\n\n            if element.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        result = ExpressionMakeTuple(\n            elements=self.subnode_elements, source_ref=self.source_ref\n        )\n\n        self.parent.replaceChild(self, result)\n        del self.parent\n\n        return (\n            iter_node,\n            \"new_expression\",\n            \"\"\"\\\nIteration over set lowered to iteration over tuple.\"\"\",\n        )\n\n\nneeds_set_literal_reverse = needsSetLiteralReverseInsertion()\n\n\ndef makeExpressionMakeSetLiteral(elements, source_ref):\n    if elements:\n        if needs_set_literal_reverse:\n            return ExpressionMakeSetLiteral(elements, source_ref)\n        else:\n            return ExpressionMakeSet(elements, source_ref)\n    else:\n        # TODO: Get rid of user provided for empty set refs, makes no sense.\n        return ExpressionConstantSetEmptyRef(user_provided=False, source_ref=source_ref)\n\n\n@functools.wraps(set)\ndef reversed_set(value):\n    return set(reversed(tuple(value)))\n\n\ndef makeExpressionMakeSetLiteralOrConstant(elements, user_provided, source_ref):\n    for element in elements:\n        # TODO: Compile time constant ought to be the criterion.\n        if not element.isExpressionConstantRef():\n            result = makeExpressionMakeSetLiteral(elements, source_ref)\n            break\n    else:\n        # Need to reverse now if needed.\n        if needs_set_literal_reverse:\n            elements = tuple(reversed(elements))\n\n        result = makeConstantRefNode(\n            constant=set(element.getCompileTimeConstant() for element in elements),\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n    if elements:\n        result.setCompatibleSourceReference(\n            source_ref=elements[-1].getCompatibleSourceReference()\n        )\n\n    return result\n\n\nclass ExpressionMakeSetLiteral(ExpressionMakeSet):\n    kind = \"EXPRESSION_MAKE_SET_LITERAL\"\n\n    @staticmethod\n    def getSimulator():\n        return reversed_set\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ContainerOperationNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Operations on Containers.\n\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildrenExpressionSetOperationUpdateMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .StatementBasesGenerated import (\n    StatementListOperationAppendBase,\n    StatementSetOperationAddBase,\n)\n\n\nclass StatementListOperationAppend(StatementListOperationAppendBase):\n    kind = \"STATEMENT_LIST_OPERATION_APPEND\"\n\n    named_children = (\"list_arg\", \"value\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_list_arg.mayRaiseException(\n            exception_type\n        ) or self.subnode_value.mayRaiseException(exception_type)\n\n\nclass StatementSetOperationAdd(StatementSetOperationAddBase):\n    kind = \"STATEMENT_SET_OPERATION_ADD\"\n\n    named_children = (\"set_arg\", \"value\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        # TODO: Until we have proper set tracing.\n        trace_collection.removeKnowledge(self.subnode_set_arg)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_set_arg.mayRaiseException(\n            exception_type\n        ) or self.subnode_value.mayRaiseException(exception_type)\n\n\nclass ExpressionSetOperationUpdate(\n    ChildrenExpressionSetOperationUpdateMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_SET_OPERATION_UPDATE\"\n\n    named_children = (\"set_arg\", \"value\")\n\n    def __init__(self, set_arg, value, source_ref):\n        ChildrenExpressionSetOperationUpdateMixin.__init__(\n            self,\n            set_arg=set_arg,\n            value=value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.removeKnowledge(self.subnode_set_arg)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/CoroutineNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for coroutine objects and their creations.\n\nCoroutines are turned into normal functions that create generator objects,\nwhose implementation lives here. The creation itself also lives here.\n\n\"\"\"\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingCoroutineRefMixin,\n    ChildHavingExpressionMixin,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .FunctionNodes import ExpressionFunctionEntryPointBase\n\n\nclass ExpressionMakeCoroutineObject(\n    ExpressionNoSideEffectsMixin, ChildHavingCoroutineRefMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_MAKE_COROUTINE_OBJECT\"\n\n    named_children = (\"coroutine_ref\",)\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    def __init__(self, coroutine_ref, source_ref):\n        assert coroutine_ref.getFunctionBody().isExpressionCoroutineObjectBody()\n\n        ChildHavingCoroutineRefMixin.__init__(self, coroutine_ref=coroutine_ref)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = None\n\n    def getDetailsForDisplay(self):\n        return {\"coroutine\": self.subnode_coroutine_ref.getFunctionBody().getCodeName()}\n\n    def computeExpression(self, trace_collection):\n        self.variable_closure_traces = []\n\n        for (\n            closure_variable\n        ) in self.subnode_coroutine_ref.getFunctionBody().getClosureVariables():\n            trace = trace_collection.getVariableCurrentTrace(closure_variable)\n            trace.addNameUsage()\n\n            self.variable_closure_traces.append((closure_variable, trace))\n\n        # TODO: Coroutine body may know something too.\n        return self, None, None\n\n    def getClosureVariableVersions(self):\n        return self.variable_closure_traces\n\n\nclass ExpressionCoroutineObjectBody(ExpressionFunctionEntryPointBase):\n    kind = \"EXPRESSION_COROUTINE_OBJECT_BODY\"\n\n    __slots__ = (\"qualname_setup\", \"needs_generator_return_exit\")\n\n    def __init__(self, provider, name, code_object, flags, auto_release, source_ref):\n        ExpressionFunctionEntryPointBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_object=code_object,\n            code_prefix=\"coroutine\",\n            flags=flags,\n            auto_release=auto_release,\n            source_ref=source_ref,\n        )\n\n        self.needs_generator_return_exit = False\n\n        self.qualname_setup = None\n\n    def getFunctionName(self):\n        return self.name\n\n    def markAsNeedsGeneratorReturnHandling(self, value):\n        self.needs_generator_return_exit = max(self.needs_generator_return_exit, value)\n\n    def needsGeneratorReturnHandling(self):\n        return self.needs_generator_return_exit == 2\n\n    def needsGeneratorReturnExit(self):\n        return bool(self.needs_generator_return_exit)\n\n    @staticmethod\n    def needsCreation():\n        return False\n\n    @staticmethod\n    def isUnoptimized():\n        return False\n\n\nclass ExpressionAsyncWait(ChildHavingExpressionMixin, ExpressionBase):\n    kind = \"EXPRESSION_ASYNC_WAIT\"\n\n    named_children = (\"expression\",)\n\n    __slots__ = (\"exception_preserving\",)\n\n    def __init__(self, expression, source_ref):\n        ChildHavingExpressionMixin.__init__(self, expression=expression)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.exception_preserving = False\n\n    @staticmethod\n    def isExpressionAsyncWait():\n        return True\n\n    def computeExpression(self, trace_collection):\n        # TODO: Might be predictable based awaitable analysis or for constants.\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionAsyncWaitEnter(ExpressionAsyncWait):\n    kind = \"EXPRESSION_ASYNC_WAIT_ENTER\"\n\n\nclass ExpressionAsyncWaitExit(ExpressionAsyncWait):\n    kind = \"EXPRESSION_ASYNC_WAIT_EXIT\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/CtypesNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for all things \"ctypes\" stdlib module.\n\n\"\"\"\n\nfrom .HardImportNodesGenerated import (\n    ExpressionCtypesCdllBefore38CallBase,\n    ExpressionCtypesCdllSince38CallBase,\n)\n\n\nclass ExpressionCtypesCdllSince38Call(ExpressionCtypesCdllSince38CallBase):\n    \"\"\"Function reference ctypes.CDLL\"\"\"\n\n    kind = \"EXPRESSION_CTYPES_CDLL_SINCE38_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # TODO: Locate DLLs and report to freezer\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionCtypesCdllBefore38Call(ExpressionCtypesCdllBefore38CallBase):\n    \"\"\"Function reference ctypes.CDLL\"\"\"\n\n    kind = \"EXPRESSION_CTYPES_CDLL_BEFORE38_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # TODO: Locate DLLs and report to freezer\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/DictionaryNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that build and operate on dictionaries.\n\nThe \"pair\" is a sub-structure of the dictionary, representing a key/value pair\nthat is the child of the dictionary creation.\n\n\"\"\"\n\nfrom nuitka import Constants\nfrom nuitka.specs.BuiltinDictOperationSpecs import dict_fromkeys_spec\nfrom nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs\n\nfrom .AttributeNodes import makeExpressionAttributeLookup\nfrom .BuiltinOperationNodeBasesGenerated import (\n    ExpressionDictOperationClearBase,\n    ExpressionDictOperationCopyBase,\n    ExpressionDictOperationFromkeys2Base,\n    ExpressionDictOperationFromkeys3Base,\n    ExpressionDictOperationGet2Base,\n    ExpressionDictOperationGet3Base,\n    ExpressionDictOperationHaskeyBase,\n    ExpressionDictOperationItemsBase,\n    ExpressionDictOperationIteritemsBase,\n    ExpressionDictOperationIterkeysBase,\n    ExpressionDictOperationItervaluesBase,\n    ExpressionDictOperationKeysBase,\n    ExpressionDictOperationPop2Base,\n    ExpressionDictOperationPop3Base,\n    ExpressionDictOperationPopitemBase,\n    ExpressionDictOperationSetdefault2Base,\n    ExpressionDictOperationSetdefault3Base,\n    ExpressionDictOperationUpdate2Base,\n    ExpressionDictOperationUpdate3Base,\n    ExpressionDictOperationValuesBase,\n    ExpressionDictOperationViewitemsBase,\n    ExpressionDictOperationViewkeysBase,\n    ExpressionDictOperationViewvaluesBase,\n)\nfrom .ChildrenHavingMixins import (\n    ChildrenExpressionDictOperationItemMixin,\n    ChildrenExpressionDictOperationUpdatePairsMixin,\n    ChildrenExpressionMakeDictMixin,\n    ChildrenHavingKeyDictArgMixin,\n)\nfrom .ConstantRefNodes import (\n    ExpressionConstantDictEmptyRef,\n    makeConstantRefNode,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionDictShapeExactMixin,\n)\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseExceptionExpressionFromTemplate,\n    makeRaiseExceptionReplacementExpression,\n    makeStatementOnlyNodesFromExpressions,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.StandardShapes import tshape_iterator\nfrom .StatementBasesGenerated import (\n    StatementDictOperationRemoveBase,\n    StatementDictOperationSetBase,\n    StatementDictOperationSetKeyValueBase,\n    StatementDictOperationUpdateBase,\n)\n\n\ndef makeExpressionMakeDict(pairs, source_ref):\n    if pairs:\n        return ExpressionMakeDict(pairs, source_ref)\n    else:\n        # TODO: Get rid of user provided for empty dict refs, makes no sense.\n        return ExpressionConstantDictEmptyRef(\n            user_provided=False, source_ref=source_ref\n        )\n\n\ndef makeExpressionMakeDictOrConstant(pairs, user_provided, source_ref):\n    # Create dictionary node or constant value if possible.\n\n    for pair in pairs:\n        if (\n            not pair.isCompileTimeConstant()\n            or pair.isKeyKnownToBeHashable() is not True\n        ):\n            result = makeExpressionMakeDict(pairs, source_ref)\n            break\n    else:\n        # Unless told otherwise, create the dictionary in its full size, so\n        # that no growing occurs and the constant becomes as similar as possible\n        # before being marshaled.\n        result = makeConstantRefNode(\n            constant=Constants.createConstantDict(\n                keys=[pair.getKeyCompileTimeConstant() for pair in pairs],\n                values=[pair.getValueCompileTimeConstant() for pair in pairs],\n            ),\n            user_provided=user_provided,\n            source_ref=source_ref,\n        )\n\n    if pairs:\n        result.setCompatibleSourceReference(\n            source_ref=pairs[-1].getCompatibleSourceReference()\n        )\n\n    return result\n\n\nclass ExpressionMakeDictMixin(object):\n    __slots__ = ()\n\n    def mayRaiseException(self, exception_type):\n        for pair in self.subnode_pairs:\n            if pair.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    def isKnownToBeIterable(self, count):\n        return count is None or count == len(self.subnode_pairs)\n\n    def getIterationLength(self):\n        pair_count = len(self.subnode_pairs)\n\n        # Hashing may consume elements.\n        if pair_count > 1:\n            return None\n        else:\n            return pair_count\n\n    @staticmethod\n    def getIterationMinLength():\n        return 1\n\n    @staticmethod\n    def canPredictIterationValues():\n        # Dictionaries are assumed to be fully predictable\n\n        # TODO: For some things, that may not be true, when key collisions\n        # happen for example. We will have to check that then.\n        return True\n\n    def getIterationValue(self, count):\n        return self.subnode_pairs[count].getKeyNode()\n\n    def isMappingWithConstantStringKeys(self):\n        return all(pair.isKeyExpressionConstantStrRef() for pair in self.subnode_pairs)\n\n    def getMappingStringKeyPairs(self):\n        return [\n            (pair.getKeyCompileTimeConstant(), pair.getValueNode())\n            for pair in self.subnode_pairs\n        ]\n\n    # TODO: Make this happen from auto-compute, children only side effects\n    def computeExpressionDrop(self, statement, trace_collection):\n        # Virtual method overload, pylint: disable=unused-argument\n        expressions = []\n\n        for pair in self.subnode_pairs:\n            expressions.extend(pair.extractSideEffects())\n\n        result = makeStatementOnlyNodesFromExpressions(expressions=expressions)\n\n        del self.parent\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nRemoved sequence creation for unused sequence.\"\"\",\n        )\n\n    # TODO: Missing computeExpressionIter1 here. For now it would require us to\n    # add lots of temporary variables for keys, which then becomes the tuple,\n    # but for as long as we don't have efficient forward propagation of these,\n    # we won't do that. Otherwise we loose execution order of values with them\n    # remaining as side effects. We could limit ourselves to cases where\n    # isMappingWithConstantStringKeys is true, or keys had no side effects, but\n    # that feels wasted effort as we are going to have full propagation.\n\n    @staticmethod\n    def computeExpressionIter1(iter_node, trace_collection):\n        return iter_node, None, None\n\n    def onContentEscapes(self, trace_collection):\n        for pair in self.subnode_pairs:\n            pair.onContentEscapes(trace_collection)\n\n\nclass ExpressionMakeDict(\n    ExpressionDictShapeExactMixin,\n    SideEffectsFromChildrenMixin,\n    ExpressionMakeDictMixin,\n    ChildrenExpressionMakeDictMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_MAKE_DICT\"\n\n    named_children = (\"pairs|tuple\",)\n\n    def __init__(self, pairs, source_ref):\n        assert pairs\n\n        ChildrenExpressionMakeDictMixin.__init__(\n            self,\n            pairs=pairs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        pairs = self.subnode_pairs\n\n        is_constant = True\n\n        for pair in pairs:\n            if pair.isKeyKnownToBeHashable() is False:\n                # The ones with constant keys are hashable.\n                key = pair.subnode_key\n\n                side_effects = []\n\n                for pair2 in pairs:\n                    side_effects.extend(pair2.extractSideEffects())\n\n                    if pair2 is pair:\n                        break\n\n                result = makeRaiseExceptionExpressionFromTemplate(\n                    exception_type=\"TypeError\",\n                    template=\"unhashable type: '%s'\",\n                    template_args=makeExpressionAttributeLookup(\n                        expression=key.extractUnhashableNodeType(),\n                        attribute_name=\"__name__\",\n                        source_ref=key.source_ref,\n                    ),\n                    source_ref=key.source_ref,\n                )\n                result = wrapExpressionWithSideEffects(\n                    side_effects=side_effects,\n                    old_node=key,\n                    new_node=result,\n                )\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"Dictionary key is known to not be hashable.\",\n                )\n\n            if is_constant:\n                if not pair.isCompileTimeConstant():\n                    is_constant = False\n\n        if not is_constant:\n            return self, None, None\n\n        constant_value = Constants.createConstantDict(\n            keys=[pair.getKeyCompileTimeConstant() for pair in pairs],\n            values=[pair.getValueCompileTimeConstant() for pair in pairs],\n        )\n\n        new_node = makeConstantReplacementNode(\n            constant=constant_value, node=self, user_provided=True\n        )\n\n        return (\n            new_node,\n            \"new_constant\",\n            \"\"\"\\\nCreated dictionary found to be constant.\"\"\",\n        )\n\n    @staticmethod\n    def getTruthValue():\n        # Cannot be empty\n        return True\n\n\nclass StatementDictOperationSetMixin(object):\n    __slots__ = ()\n\n    def computeStatementOperation(self, trace_collection):\n        key = self.subnode_key\n\n        if not key.isKnownToBeHashable():\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        key = self.subnode_key\n\n        if not key.isKnownToBeHashable():\n            return True\n\n        if key.mayRaiseException(exception_type):\n            return True\n\n        value = self.subnode_value\n\n        if value.mayRaiseException(exception_type):\n            return True\n\n        return False\n\n    def mayRaiseExceptionOperation(self):\n        return not self.subnode_key.isKnownToBeHashable()\n\n\nclass StatementDictOperationSet(\n    StatementDictOperationSetMixin, StatementDictOperationSetBase\n):\n    kind = \"STATEMENT_DICT_OPERATION_SET\"\n\n    named_children = (\"value\", \"dict_arg\", \"key\")\n    auto_compute_handling = \"operation\"\n\n\nclass StatementDictOperationSetKeyValue(\n    StatementDictOperationSetMixin, StatementDictOperationSetKeyValueBase\n):\n    kind = \"STATEMENT_DICT_OPERATION_SET_KEY_VALUE\"\n\n    named_children = (\"value\", \"dict_arg\", \"key\")\n    auto_compute_handling = \"operation\"\n\n\nclass StatementDictOperationRemove(StatementDictOperationRemoveBase):\n    kind = \"STATEMENT_DICT_OPERATION_REMOVE\"\n\n    named_children = (\"dict_arg\", \"key\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        # Any exception may be raised, we don't know if the key is present.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        key = self.subnode_key\n\n        if not key.isKnownToBeHashable():\n            return True\n\n        if key.mayRaiseException(exception_type):\n            return True\n\n        # TODO: Could check dict for knowledge about keys.\n        return True\n\n\nclass ExpressionDictOperationPop2(ExpressionDictOperationPop2Base):\n    \"\"\"This operation represents d.pop(key), i.e. default None.\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_POP2\"\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, source_ref):\n        ExpressionDictOperationPop2Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            source_ref=source_ref,\n        )\n\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.pop\",\n                    side_effects=(dict_arg, key),\n                )\n\n        # TODO: Check if dict_arg has key.\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(dict_arg)\n\n        # TODO: Until we can know KeyError won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Check for \"None\" default and demote to ExpressionDictOperationSetdefault3 in\n        # that case.\n        return self, None, None\n\n    # TODO: These turn this into dictionary item removals, as value is unused.\n    # def computeExpressionDrop(self, statement, trace_collection):\n\n    # TODO: Might raise KeyError depending on dictionary.\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n        # if self.known_hashable_key is None:\n        #     return True\n        # else:\n        #     return self.subnode_dict_arg.mayRaiseException(\n        #         exception_type\n        #     ) or self.subnode_key.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationPop3(ExpressionDictOperationPop3Base):\n    \"\"\"This operation represents d.pop(key, default).\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_POP3\"\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ExpressionDictOperationPop3Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            default=default,\n            source_ref=source_ref,\n        )\n\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.pop\",\n                    side_effects=(dict_arg, key, self.subnode_default),\n                )\n\n        # TODO: Check if dict_arg has key\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(dict_arg)\n\n        # TODO: Check for \"None\" default and demote to ExpressionDictOperationSetdefault3 in\n        # that case.\n        return self, None, None\n\n    # TODO: These turn this into dictionary item removals, as value is unused.\n    # def computeExpressionDrop(self, statement, trace_collection):\n\n    def mayRaiseException(self, exception_type):\n        if self.known_hashable_key is None:\n            return True\n        else:\n            return (\n                self.subnode_dict_arg.mayRaiseException(exception_type)\n                or self.subnode_key.mayRaiseException(exception_type)\n                or self.subnode_default.mayRaiseException(exception_type)\n            )\n\n\nclass ExpressionDictOperationPopitem(ExpressionDictOperationPopitemBase):\n    \"\"\"This operation represents d.popitem().\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_POPITEM\"\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n\n        # TODO: Check if dict_arg is not empty.\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(dict_arg)\n\n        # TODO: Until we can know KeyError won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    # TODO: These turn this into dictionary item removal, as value is unused.\n    # def computeExpressionDrop(self, statement, trace_collection):\n\n    # TODO: Might raise KeyError depending on dictionary.\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n\nclass ExpressionDictOperationSetdefault2(ExpressionDictOperationSetdefault2Base):\n    \"\"\"This operation represents d.setdefault(key), i.e. default None.\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_SETDEFAULT2\"\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, source_ref):\n        ExpressionDictOperationSetdefault2Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            source_ref=source_ref,\n        )\n\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.setdefault\",\n                    side_effects=(dict_arg, key),\n                )\n\n        # TODO: Check if dict_arg has key, and eliminate this node entirely\n        # if that's the case with hashing of the key as a remaining side effect\n        # though.\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(dict_arg)\n\n        # TODO: Check for \"None\" default and demote to ExpressionDictOperationSetdefault3 in\n        # that case.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        if self.known_hashable_key is not True:\n            return True\n        else:\n            return self.subnode_dict_arg.mayRaiseException(\n                exception_type\n            ) or self.subnode_key.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationSetdefault3(ExpressionDictOperationSetdefault3Base):\n    \"\"\"This operation represents d.setdefault(key, default).\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_SETDEFAULT3\"\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ExpressionDictOperationSetdefault3Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            key=key,\n            default=default,\n            source_ref=source_ref,\n        )\n\n        # TODO: Slots could be part of base class generation too.\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.setdefault\",\n                    side_effects=(dict_arg, key, self.subnode_default),\n                )\n\n        # TODO: Check if dict_arg has key, and eliminate this node entirely\n        # if that's the case with hashing of the key as a remaining side effect\n        # though.\n\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(dict_arg)\n\n        # TODO: Check for \"None\" default and demote to ExpressionDictOperationSetdefault3 in\n        # that case.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        if self.known_hashable_key is not True:\n            return True\n        else:\n            return (\n                self.subnode_dict_arg.mayRaiseException(exception_type)\n                or self.subnode_key.mayRaiseException(exception_type)\n                or self.subnode_default.mayRaiseException(exception_type)\n            )\n\n\nclass ExpressionDictOperationItem(\n    ChildrenExpressionDictOperationItemMixin, ExpressionBase\n):\n    \"\"\"This operation represents d[key] with an exception for missing key.\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_ITEM\"\n\n    named_children = (\"dict_arg\", \"key\")\n\n    def __init__(self, dict_arg, key, source_ref):\n        ChildrenExpressionDictOperationItemMixin.__init__(\n            self, dict_arg=dict_arg, key=key\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if dict_arg.isCompileTimeConstant() and key.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: self.getCompileTimeConstant()[\n                    dict_arg.getCompileTimeConstant()[key.getCompileTimeConstant()]\n                ],\n                user_provided=dict_arg.user_provided,\n                description=\"Dictionary item lookup with constant key.\",\n            )\n\n        # TODO: Only if the key is not hashable.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionDictOperationGet2(ExpressionDictOperationGet2Base):\n    \"\"\"This operation represents d.get(key) with no exception for missing key but None default.\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_GET2\"\n\n    named_children = (\"dict_arg\", \"key\")\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, source_ref):\n        ExpressionDictOperationGet2Base.__init__(\n            self, dict_arg=dict_arg, key=key, source_ref=source_ref\n        )\n\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = self.subnode_key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.get\",\n                    side_effects=(dict_arg, key),\n                )\n\n        if dict_arg.isCompileTimeConstant() and key.isCompileTimeConstant():\n            result = wrapExpressionWithSideEffects(\n                new_node=makeConstantReplacementNode(\n                    constant=dict_arg.getCompileTimeConstant().get(\n                        key.getCompileTimeConstant()\n                    ),\n                    node=self,\n                    user_provided=dict_arg.user_provided,\n                ),\n                old_node=self,\n                side_effects=(dict_arg, key),\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time computed 'dict.get' on constant argument.\",\n            )\n\n        if self.known_hashable_key is None:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        if self.known_hashable_key is None:\n            return True\n        else:\n            return self.subnode_dict_arg.mayRaiseException(\n                exception_type\n            ) or self.subnode_key.mayRaiseException(exception_type)\n\n    def mayHaveSideEffects(self):\n        if self.known_hashable_key is None:\n            return True\n        else:\n            return (\n                self.subnode_dict_arg.mayHaveSideEffects()\n                or self.subnode_key.mayHaveSideEffects()\n            )\n\n    def extractSideEffects(self):\n        if self.known_hashable_key is None:\n            return (self,)\n        else:\n            return (\n                self.subnode_dict_arg.extractSideEffects()\n                + self.subnode_key.extractSideEffects()\n            )\n\n\nclass ExpressionDictOperationGet3(ExpressionDictOperationGet3Base):\n    \"\"\"This operation represents d.get(key, default) with no exception for missing key but default value.\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_GET3\"\n\n    named_children = (\"dict_arg\", \"key\", \"default\")\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, dict_arg, key, default, source_ref):\n        ExpressionDictOperationGet3Base.__init__(\n            self, dict_arg=dict_arg, key=key, default=default, source_ref=source_ref\n        )\n\n        self.known_hashable_key = None\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n        key = self.subnode_key\n\n        if self.known_hashable_key is None:\n            self.known_hashable_key = key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=key,\n                    operation=\"dict.get\",\n                    side_effects=(dict_arg, key, self.subnode_default),\n                )\n\n        # TODO: With dictionary tracing, this could become more transparent.\n        if dict_arg.isCompileTimeConstant() and key.isCompileTimeConstant():\n            dict_value = dict_arg.getCompileTimeConstant()\n            key_value = key.getCompileTimeConstant()\n\n            if key_value in dict_value:\n                # Side effects of args must be retained, but it's not used.\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=dict_value[key_value],\n                        node=self,\n                        user_provided=dict_arg.user_provided,\n                    ),\n                    old_node=self,\n                    side_effects=(\n                        dict_arg,\n                        key,\n                        self.subnode_default,\n                    ),\n                )\n\n                description = \"Compile time computed 'dict.get' on constant argument to not use default.\"\n            else:\n                # Side effects of dict and key must be retained, but it's not used.\n                result = wrapExpressionWithSideEffects(\n                    new_node=self.subnode_default,\n                    old_node=self,\n                    side_effects=(dict_arg, key),\n                )\n\n                description = \"Compile time computed 'dict.get' on constant argument to use default.\"\n\n            return (result, \"new_expression\", description)\n\n        if self.known_hashable_key is None:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        if self.known_hashable_key is None:\n            return True\n        else:\n            return (\n                self.subnode_dict_arg.mayRaiseException(exception_type)\n                or self.subnode_key.mayRaiseException(exception_type)\n                or self.subnode_default.mayRaiseException(exception_type)\n            )\n\n    def mayHaveSideEffects(self):\n        if self.known_hashable_key is None:\n            return True\n        else:\n            return (\n                self.subnode_dict_arg.mayHaveSideEffects()\n                or self.subnode_key.mayHaveSideEffects()\n                or self.subnode_default.mayHaveSideEffects()\n            )\n\n    def extractSideEffects(self):\n        if self.known_hashable_key is None:\n            return (self,)\n        else:\n            return (\n                self.subnode_dict_arg.extractSideEffects()\n                + self.subnode_key.extractSideEffects()\n                + self.subnode_defaults.extractSideEffects()\n            )\n\n\nclass ExpressionDictOperationCopy(\n    SideEffectsFromChildrenMixin,\n    ExpressionDictOperationCopyBase,\n):\n    kind = \"EXPRESSION_DICT_OPERATION_COPY\"\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n\n        if dict_arg.isCompileTimeConstant():\n            result = makeConstantReplacementNode(\n                constant=dict_arg.getCompileTimeConstant().copy(),\n                node=self,\n                user_provided=dict_arg.user_provided,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time computed 'dict.copy' on constant argument.\",\n            )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationClear(ExpressionDictOperationClearBase):\n    kind = \"EXPRESSION_DICT_OPERATION_CLEAR\"\n\n    def computeExpression(self, trace_collection):\n        # Once we do dictionary tracing, we should tell it, we know its new value\n        # perfectly, and that we have no use for previous value.\n        # trace_collection.onDictionaryReplaceValueWithKnownValue(self.subnode_dict_arg, {})\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationKeys(\n    SideEffectsFromChildrenMixin,\n    ExpressionDictOperationKeysBase,\n):\n    kind = \"EXPRESSION_DICT_OPERATION_KEYS\"\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n\n        if dict_arg.isCompileTimeConstant():\n            result = makeConstantReplacementNode(\n                constant=dict_arg.getCompileTimeConstant().keys(),\n                node=self,\n                user_provided=dict_arg.user_provided,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time computed 'dict.keys' on constant argument.\",\n            )\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationViewkeys(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationViewkeysBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_VIEWKEYS\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually iterator that yields key values\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationIterkeys(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationIterkeysBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_ITERKEYS\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually iterator yield keys\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationValues(\n    SideEffectsFromChildrenMixin,\n    ExpressionDictOperationValuesBase,\n):\n    kind = \"EXPRESSION_DICT_OPERATION_VALUES\"\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n\n        if dict_arg.isCompileTimeConstant():\n            result = makeConstantReplacementNode(\n                constant=dict_arg.getCompileTimeConstant().values(),\n                node=self,\n                user_provided=dict_arg.user_provided,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time computed 'dict.values' on constant argument.\",\n            )\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationViewvalues(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationViewvaluesBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_VIEWVALUES\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually iterator that yields key values\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationItervalues(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationItervaluesBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_ITERVALUES\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually the iterator yield values.\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationItems(\n    SideEffectsFromChildrenMixin,\n    ExpressionDictOperationItemsBase,\n):\n    kind = \"EXPRESSION_DICT_OPERATION_ITEMS\"\n\n    def computeExpression(self, trace_collection):\n        dict_arg = self.subnode_dict_arg\n\n        if dict_arg.isCompileTimeConstant():\n            result = makeConstantReplacementNode(\n                constant=dict_arg.getCompileTimeConstant().items(),\n                node=self,\n                user_provided=dict_arg.user_provided,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time computed 'dict.items' on constant argument.\",\n            )\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationIteritems(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationIteritemsBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_ITERITEMS\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually iterator that yields 2 element tuples, add shapes\n        # for that too.\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationViewitems(\n    SideEffectsFromChildrenMixin, ExpressionDictOperationViewitemsBase\n):\n    kind = \"EXPRESSION_DICT_OPERATION_VIEWITEMS\"\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        # TODO: Actually iterator that yields key values\n        return tshape_iterator\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_dict_arg.mayRaiseException(exception_type)\n\n\nclass ExpressionDictOperationUpdate2(ExpressionDictOperationUpdate2Base):\n    \"\"\"This operation represents d.update(iterable).\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_UPDATE2\"\n\n    def __init__(self, dict_arg, iterable, source_ref):\n        # TODO: Change generation of attribute nodes to pass it like this already.\n        if type(iterable) is tuple:\n            (iterable,) = iterable\n\n        ExpressionDictOperationUpdate2Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            iterable=iterable,\n            source_ref=source_ref,\n        )\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n        # TODO: Using it might change it, unfortunately\n        trace_collection.removeKnowledge(self.subnode_iterable)\n\n        # TODO: Until we can know iteration error won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Check empty, and remove itself if that's the case.\n        return self, None, None\n\n    # TODO: Might raise non-iterable depending on value shape, or not hashable from content.\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n\ndef makeExpressionDictOperationUpdate3(dict_arg, iterable, pairs, source_ref):\n    # Artefact of star argument parsing iterable, where it is also optional\n    # revolved on the outside here\n    if type(iterable) is tuple:\n        if not iterable:\n            iterable = None\n        else:\n            (iterable,) = iterable\n\n    if iterable is not None:\n        return ExpressionDictOperationUpdate3(dict_arg, iterable, pairs, source_ref)\n    else:\n        return ExpressionDictOperationUpdatePairs(dict_arg, pairs, source_ref)\n\n\nclass ExpressionDictOperationUpdate3(ExpressionDictOperationUpdate3Base):\n    \"\"\"This operation represents d.update(iterable, **pairs).\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_UPDATE3\"\n\n    def __init__(self, dict_arg, iterable, pairs, source_ref):\n        ExpressionDictOperationUpdate3Base.__init__(\n            self,\n            dict_arg=dict_arg,\n            iterable=iterable,\n            pairs=pairs,\n            source_ref=source_ref,\n        )\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n        # TODO: Using it might change it, unfortunately\n        # TODO: When iterable is empty, this should be specialized further to\n        # ExpressionDictOperationUpdatePairs\n        trace_collection.removeKnowledge(self.subnode_iterable)\n\n        for pair in self.subnode_pairs:\n            trace_collection.removeKnowledge(pair)\n\n        # TODO: Until we can know iteration error won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Check empty, and remove itself if that's the case.\n        return self, None, None\n\n    # TODO: Might raise non-iterable depending on value shape, or not hashable from content.\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n\nclass ExpressionDictOperationUpdatePairs(\n    ChildrenExpressionDictOperationUpdatePairsMixin, ExpressionBase\n):\n    \"\"\"This operation represents d.update(iterable, **pairs).\"\"\"\n\n    kind = \"EXPRESSION_DICT_OPERATION_UPDATE_PAIRS\"\n\n    named_children = (\"dict_arg\", \"pairs|tuple\")\n\n    def __init__(self, dict_arg, pairs, source_ref):\n        ChildrenExpressionDictOperationUpdatePairsMixin.__init__(\n            self,\n            dict_arg=dict_arg,\n            pairs=pairs,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n        # TODO: Using it might change it, unfortunately\n        # TODO: When iterable is empty, this should be specialized further.\n\n        for pair in self.subnode_pairs:\n            trace_collection.removeKnowledge(pair)\n\n        # TODO: Until we can know KeyError won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Check empty, and remove itself if that's the case.\n        return self, None, None\n\n    # TODO: Might raise non-iterable depending on value shape, or not hashable from content.\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n\nclass StatementDictOperationUpdate(StatementDictOperationUpdateBase):\n    \"\"\"Update dict value.\n\n    This is mainly used for re-formulations, where a dictionary\n    update will be performed on what is known not to be a\n    general mapping.\n    \"\"\"\n\n    kind = \"STATEMENT_DICT_OPERATION_UPDATE\"\n\n    named_children = (\"dict_arg\", \"value\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        # TODO: Until we have proper dictionary tracing, do this.\n        trace_collection.removeKnowledge(self.subnode_dict_arg)\n        # TODO: Using it might change it, unfortunately\n        trace_collection.removeKnowledge(self.subnode_value)\n\n        # TODO: Until we can know iteration error won't happen, but then we should change into\n        # something else.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Check empty, and remove itself if that's the case.\n        return self, None, None\n\n\ndef makeUnhashableExceptionReplacementExpression(node, key, side_effects, operation):\n    unhashable_type_name = (\n        key.extractUnhashableNodeType().getCompileTimeConstant().__name__\n    )\n    result = makeRaiseExceptionReplacementExpression(\n        expression=node,\n        exception_type=\"TypeError\",\n        exception_value=\"unhashable type: '%s'\" % unhashable_type_name,\n    )\n    result = wrapExpressionWithSideEffects(\n        side_effects=side_effects,\n        old_node=node,\n        new_node=result,\n    )\n\n    return (\n        result,\n        \"new_raise\",\n        \"Dictionary operation '%s' with key of type '%s' that is known to not be hashable.\"\n        % (operation, unhashable_type_name),\n    )\n\n\nclass ExpressionDictOperationInNotInUncertainMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def computeExpression(self, trace_collection):\n        if self.known_hashable_key is None:\n            self.known_hashable_key = self.subnode_key.isKnownToBeHashable()\n\n            if self.known_hashable_key is False:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeUnhashableExceptionReplacementExpression(\n                    node=self,\n                    key=self.subnode_key,\n                    operation=\"in (dict)\",\n                    side_effects=self.getVisitableNodes(),\n                )\n\n        if self.known_hashable_key is None:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if self.subnode_key.isCompileTimeConstant():\n            truth_value = self.subnode_dict_arg.getExpressionDictInConstant(\n                self.subnode_key.getCompileTimeConstant()\n            )\n\n            if truth_value is not None:\n                # TODO: Ugly that this code is not drawing from derived class methods.\n                if \"NOT\" in self.kind:\n                    truth_value = not truth_value\n\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeConstantReplacementNode(\n                        constant=truth_value, node=self, user_provided=True\n                    ),\n                    old_node=self,\n                    side_effects=self.getVisitableNodes(),\n                )\n\n                return result, \"new_constant\", \"Predicted dict 'in' truth value\"\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_key.mayRaiseException(exception_type)\n            or self.subnode_dict_arg.mayRaiseException(exception_type)\n            or self.known_hashable_key is not True\n        )\n\n    def mayHaveSideEffects(self):\n        return self.mayRaiseException(BaseException)\n\n    def extractSideEffects(self):\n        if self.known_hashable_key is not True:\n            return (self,)\n        else:\n            # No side effects at all but from the children.\n            result = []\n\n            # The order of evaluation is different for \"in\" and \"has_key\", so we go\n            # through visitable nodes.\n            for child in self.getVisitableNodes():\n                result.extend(child.extractSideEffects())\n\n            return tuple(result)\n\n\nclass ExpressionDictOperationInNotInUncertainBase(\n    ExpressionDictOperationInNotInUncertainMixin,\n    ExpressionBoolShapeExactMixin,\n    ChildrenHavingKeyDictArgMixin,\n    ExpressionBase,\n):\n    # Follows the reversed nature of \"in\", with the dictionary on the right\n    # side of things.\n    named_children = (\"key\", \"dict_arg\")\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, key, dict_arg, source_ref):\n        ChildrenHavingKeyDictArgMixin.__init__(\n            self,\n            key=key,\n            dict_arg=dict_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.known_hashable_key = None\n\n\nclass ExpressionDictOperationIn(ExpressionDictOperationInNotInUncertainBase):\n    kind = \"EXPRESSION_DICT_OPERATION_IN\"\n\n\nclass ExpressionDictOperationNotIn(ExpressionDictOperationInNotInUncertainBase):\n    kind = \"EXPRESSION_DICT_OPERATION_NOT_IN\"\n\n\nclass ExpressionDictOperationHaskey(\n    ExpressionDictOperationInNotInUncertainMixin,\n    ExpressionDictOperationHaskeyBase,\n):\n    kind = \"EXPRESSION_DICT_OPERATION_HASKEY\"\n\n    # Different order of arguments.\n    named_children = (\"dict_arg\", \"key\")\n\n    __slots__ = (\"known_hashable_key\",)\n\n    def __init__(self, key, dict_arg, source_ref):\n        ExpressionDictOperationHaskeyBase.__init__(\n            self, key=key, dict_arg=dict_arg, source_ref=source_ref\n        )\n\n        self.known_hashable_key = None\n\n\nclass ExpressionDictOperationFromkeys2(ExpressionDictOperationFromkeys2Base):\n    kind = \"EXPRESSION_DICT_OPERATION_FROMKEYS2\"\n\n    def computeExpression(self, trace_collection):\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if self.subnode_iterable.isCompileTimeConstant():\n            # TODO: Could be assert against it being None with a compile time constant,\n            # we will usually be able to tell?\n            # This is actually OK to use like this, pylint: disable=bad-chained-comparison\n            if None is not self.subnode_iterable.getIterationLength() < 256:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: dict.fromkeys(\n                        self.subnode_iterable.getCompileTimeConstant()\n                    ),\n                    description=\"Computed 'dict.fromkeys' with constant value.\",\n                )\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_iterable.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    def mayRaiseExceptionOperation(self):\n        # This is actually OK to use like this, pylint: disable=bad-chained-comparison\n        return None is not self.subnode_iterable.getIterationLength() < 256\n\n\nclass ExpressionDictOperationFromkeys3(ExpressionDictOperationFromkeys3Base):\n    kind = \"EXPRESSION_DICT_OPERATION_FROMKEYS3\"\n\n    def computeExpression(self, trace_collection):\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if (\n            self.subnode_iterable.isCompileTimeConstant()\n            and self.subnode_value.isCompileTimeConstant()\n        ):\n            # TODO: Could be assert against it being None with a compile time constant,\n            # we will usually be able to tell?\n            # This is actually OK to use like this, pylint: disable=bad-chained-comparison\n            if None is not self.subnode_iterable.getIterationLength() < 256:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: dict.fromkeys(\n                        self.subnode_iterable.getCompileTimeConstant(),\n                        self.subnode_value.getCompileTimeConstant(),\n                    ),\n                    description=\"Computed 'dict.fromkeys' with constant values.\",\n                )\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_iterable.mayRaiseException(exception_type)\n            or self.subnode_value.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n        )\n\n    def mayRaiseExceptionOperation(self):\n        # This is actually OK to use like this, pylint: disable=bad-chained-comparison\n        return None is not self.subnode_iterable.getIterationLength() < 256\n\n\nclass ExpressionDictOperationFromkeysRef(ExpressionNoSideEffectsMixin, ExpressionBase):\n    kind = \"EXPRESSION_DICT_OPERATION_FROMKEYS_REF\"\n\n    def finalize(self):\n        del self.parent\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        def wrapExpressionDictOperationFromkeys(iterable, value, source_ref):\n            if value is None:\n                return ExpressionDictOperationFromkeys2(\n                    iterable=iterable, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperationFromkeys3(\n                    iterable=iterable, value=value, source_ref=source_ref\n                )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperationFromkeys,\n            builtin_spec=dict_fromkeys_spec,\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression=result,\n            change_tags=\"new_expression\",\n            change_desc=\"Call to 'dict.fromkeys' recognized.\",\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ExceptionNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes related to raising and making exceptions.\n\n\"\"\"\n\nfrom .ChildrenHavingMixins import (\n    ChildrenHavingExceptionTypeExceptionValueMixin,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .ExpressionBasesGenerated import (\n    ExpressionBuiltinMakeExceptionBase,\n    ExpressionBuiltinMakeExceptionImportErrorBase,\n)\nfrom .NodeBases import StatementBase\nfrom .StatementBasesGenerated import StatementRaiseExceptionBase\n\n\nclass StatementRaiseExceptionMixin(object):\n    # Mixins are required to also specify slots\n    __slots__ = ()\n\n    @staticmethod\n    def isStatementAborting():\n        return True\n\n    @staticmethod\n    def isStatementRaiseException():\n        return True\n\n    @staticmethod\n    def willRaiseAnyException():\n        return True\n\n\nclass StatementRaiseException(\n    StatementRaiseExceptionMixin, StatementRaiseExceptionBase\n):\n    kind = \"STATEMENT_RAISE_EXCEPTION\"\n\n    named_children = (\n        \"exception_type\",\n        \"exception_value|optional\",\n        \"exception_trace|optional\",\n        \"exception_cause|optional\",\n    )\n    auto_compute_handling = \"post_init,operation\"\n\n    __slots__ = (\"reraise_finally\",)\n\n    def postInitNode(self):\n        self.reraise_finally = False\n\n    def computeStatementOperation(self, trace_collection):\n        # TODO: Limit by known type.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def needsFrame():\n        return True\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"exception raise statement\"\n\n\nclass StatementRaiseExceptionImplicit(StatementRaiseException):\n    kind = \"STATEMENT_RAISE_EXCEPTION_IMPLICIT\"\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"implicit exception raise statement\"\n\n\nclass StatementReraiseException(StatementRaiseExceptionMixin, StatementBase):\n    kind = \"STATEMENT_RERAISE_EXCEPTION\"\n\n    def finalize(self):\n        del self.parent\n\n    def computeStatement(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    # TODO: Not actually true, leads to wrong frame attached if there is\n    # no pending exception.\n    @staticmethod\n    def needsFrame():\n        return False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"exception re-raise statement\"\n\n\nclass ExpressionRaiseException(\n    ChildrenHavingExceptionTypeExceptionValueMixin, ExpressionBase\n):\n    \"\"\"This node type is only produced via optimization.\n\n    CPython only knows exception raising as a statement, but often the raising\n    of exceptions can be predicted to occur as part of an expression, which it\n    replaces then.\n    \"\"\"\n\n    kind = \"EXPRESSION_RAISE_EXCEPTION\"\n\n    named_children = (\"exception_type\", \"exception_value\")\n\n    def __init__(self, exception_type, exception_value, source_ref):\n        ChildrenHavingExceptionTypeExceptionValueMixin.__init__(\n            self,\n            exception_type=exception_type,\n            exception_value=exception_value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def willRaiseAnyException():\n        return True\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        result = self.asStatement()\n\n        del self.parent\n\n        return (\n            result,\n            \"new_raise\",\n            \"\"\"\\\nPropagated implicit raise expression to raise statement.\"\"\",\n        )\n\n    def asStatement(self):\n        return StatementRaiseExceptionImplicit(\n            exception_type=self.subnode_exception_type,\n            exception_value=self.subnode_exception_value,\n            exception_trace=None,\n            exception_cause=None,\n            source_ref=self.source_ref,\n        )\n\n\nclass ExpressionBuiltinMakeException(ExpressionBuiltinMakeExceptionBase):\n    kind = \"EXPRESSION_BUILTIN_MAKE_EXCEPTION\"\n\n    named_children = (\"args|tuple\",)\n\n    __slots__ = (\"exception_name\",)\n\n    # There is nothing to compute for it as a value.\n    auto_compute_handling = \"final,no_raise\"\n\n    def __init__(self, exception_name, args, source_ref):\n        ExpressionBuiltinMakeExceptionBase.__init__(self, args, source_ref=source_ref)\n\n        self.exception_name = exception_name\n\n    def getDetails(self):\n        return {\"exception_name\": self.exception_name}\n\n    def getExceptionName(self):\n        return self.exception_name\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        for arg in self.subnode_args:\n            if arg.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionBuiltinMakeExceptionImportError(\n    ExpressionBuiltinMakeExceptionImportErrorBase\n):\n    \"\"\"Python3 ImportError dedicated node with extra arguments.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_MAKE_EXCEPTION_IMPORT_ERROR\"\n\n    named_children = (\"args|tuple\", \"name|optional\", \"path|optional\")\n\n    __slots__ = (\"exception_name\",)\n\n    # There is nothing to compute for it as a value.\n    auto_compute_handling = \"final,no_raise\"\n\n    @staticmethod\n    def getExceptionName():\n        return \"ImportError\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        for arg in self.subnode_args:\n            if arg.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionCaughtMixin(ExpressionNoSideEffectsMixin):\n    \"\"\"Common things for all caught exception references.\"\"\"\n\n    __slots__ = ()\n\n    def finalize(self):\n        del self.parent\n\n\nclass ExpressionCaughtExceptionTypeRef(ExpressionCaughtMixin, ExpressionBase):\n    kind = \"EXPRESSION_CAUGHT_EXCEPTION_TYPE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpressionRaw(self, trace_collection):\n        # TODO: Might be predictable based on the exception handler this is in.\n        return self, None, None\n\n\nclass ExpressionCaughtExceptionValueRef(ExpressionCaughtMixin, ExpressionBase):\n    kind = \"EXPRESSION_CAUGHT_EXCEPTION_VALUE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpressionRaw(self, trace_collection):\n        # TODO: Might be predictable based on the exception handler this is in.\n        return self, None, None\n\n\nclass ExpressionCaughtExceptionTracebackRef(ExpressionCaughtMixin, ExpressionBase):\n    kind = \"EXPRESSION_CAUGHT_EXCEPTION_TRACEBACK_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ExecEvalNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes concern with exec and eval builtins.\n\nThese are the dynamic codes, and as such rather difficult. We would like\nto eliminate or limit their impact as much as possible, but it's difficult\nto do.\n\"\"\"\n\nfrom .ChildrenHavingMixins import (\n    ChildrenExpressionBuiltinCompileMixin,\n    ChildrenExpressionBuiltinEvalMixin,\n    ChildrenExpressionBuiltinExecfileMixin,\n    ChildrenExpressionBuiltinExecMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .StatementBasesGenerated import (\n    StatementExecBase,\n    StatementLocalsDictSyncBase,\n)\n\n\nclass ExpressionBuiltinEval(ChildrenExpressionBuiltinEvalMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_EVAL\"\n\n    named_children = (\"source_code\", \"globals_arg\", \"locals_arg\")\n\n    def __init__(self, source_code, globals_arg, locals_arg, source_ref):\n        ChildrenExpressionBuiltinEvalMixin.__init__(\n            self,\n            source_code=source_code,\n            globals_arg=globals_arg,\n            locals_arg=locals_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Attempt for constant values to do it.\n        return self, None, None\n\n\nclass ExpressionBuiltinExec(ChildrenExpressionBuiltinExecMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_EXEC\"\n\n    python_version_spec = \">= 0x300\"\n\n    named_children = (\"source_code\", \"globals_arg\", \"locals_arg\", \"closure|optional\")\n\n    def __init__(self, source_code, globals_arg, locals_arg, closure, source_ref):\n        ChildrenExpressionBuiltinExecMixin.__init__(\n            self,\n            source_code=source_code,\n            globals_arg=globals_arg,\n            locals_arg=locals_arg,\n            closure=closure,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Attempt for constant values to do it.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        return statement, None, None\n\n\nclass ExpressionBuiltinExecfile(ChildrenExpressionBuiltinExecfileMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_EXECFILE\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"source_code\", \"globals_arg\", \"locals_arg\")\n\n    __slots__ = (\"in_class_body\",)\n\n    def __init__(self, in_class_body, source_code, globals_arg, locals_arg, source_ref):\n        ChildrenExpressionBuiltinExecfileMixin.__init__(\n            self,\n            source_code=source_code,\n            globals_arg=globals_arg,\n            locals_arg=locals_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.in_class_body = in_class_body\n\n    def getDetails(self):\n        return {\"in_class_body\": self.in_class_body}\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Nothing can be done for it really.\n        return self, None, None\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        # In this case, the copy-back must be done and will only be done\n        # correctly by the code for exec statements.\n\n        if self.in_class_body:\n            result = StatementExec(\n                source_code=self.subnode_source_code,\n                globals_arg=self.subnode_globals_arg,\n                locals_arg=self.subnode_locals_arg,\n                source_ref=self.source_ref,\n            )\n\n            del self.parent\n\n            return (\n                result,\n                \"new_statements\",\n                \"\"\"\\\nChanged 'execfile' with unused result to 'exec' on class level.\"\"\",\n            )\n        else:\n            return statement, None, None\n\n\nclass StatementExec(StatementExecBase):\n    kind = \"STATEMENT_EXEC\"\n\n    named_children = (\"source_code\", \"globals_arg|auto_none\", \"locals_arg|auto_none\")\n    auto_compute_handling = \"operation\"\n\n    python_version_spec = \"< 0x300\"\n\n    def computeStatementOperation(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Optimize strings for exec expression and statement again.\n        # str_value = self.subnode_source_code.getStrValue()\n\n        return self, None, None\n\n\nclass StatementLocalsDictSync(StatementLocalsDictSyncBase):\n    kind = \"STATEMENT_LOCALS_DICT_SYNC\"\n\n    named_children = (\"locals_arg\",)\n    node_attributes = (\"locals_scope\",)\n    auto_compute_handling = \"operation,post_init\"\n\n    __slots__ = (\"previous_traces\", \"variable_traces\")\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    def postInitNode(self):\n        self.previous_traces = None\n        self.variable_traces = None\n\n    def getPreviousVariablesTraces(self):\n        return self.previous_traces\n\n    def computeStatementOperation(self, trace_collection):\n        # TODO: Derive this from the locals scope instead, otherwise this is\n        # costly and a potentially wrong decision.\n        provider = self.getParentVariableProvider()\n        if provider.isCompiledPythonModule():\n            return None, \"new_statements\", \"Removed sync back to locals without locals.\"\n\n        self.previous_traces = trace_collection.onLocalsUsage(self.locals_scope)\n        if not self.previous_traces:\n            return None, \"new_statements\", \"Removed sync back to locals without locals.\"\n\n        trace_collection.removeAllKnowledge()\n        self.variable_traces = trace_collection.onLocalsUsage(self.locals_scope)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\nclass ExpressionBuiltinCompile(ChildrenExpressionBuiltinCompileMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_COMPILE\"\n\n    named_children = (\n        \"source\",\n        \"filename\",\n        \"mode\",\n        \"flags|optional\",\n        \"dont_inherit|optional\",\n        \"optimize|optional\",\n    )\n\n    def __init__(\n        self, source_code, filename, mode, flags, dont_inherit, optimize, source_ref\n    ):\n        ChildrenExpressionBuiltinCompileMixin.__init__(\n            self,\n            source=source_code,\n            filename=filename,\n            mode=mode,\n            flags=flags,\n            dont_inherit=dont_inherit,\n            optimize=optimize,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Attempt for constant values to do it.\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ExpressionBases.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Expression base classes.\n\nThese classes provide the generic base classes available for\nexpressions. They have a richer interface, mostly related to\nabstract execution, and different from statements.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka import Options\nfrom nuitka.__past__ import long\n\n# TODO: Probably should separate building reports out.\nfrom nuitka.code_generation.Reports import onMissingOverload\nfrom nuitka.Constants import isCompileTimeConstantValue\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildHavingValueMixin\nfrom .NodeBases import NodeBase\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_dict,\n    tshape_list,\n    tshape_str,\n    tshape_type,\n    tshape_unicode,\n)\nfrom .shapes.StandardShapes import tshape_unknown\n\n\nclass ExpressionBase(NodeBase):\n    # TODO: Maybe we can do this only for debug mode.\n    __slots__ = (\"code_generated\",)\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unknown\n\n    def getValueShape(self):\n        return self\n\n    @staticmethod\n    def isCompileTimeConstant():\n        \"\"\"Has a value that we can use at compile time.\n\n        Yes or no. If it has such a value, simulations can be applied at\n        compile time and e.g. operations or conditions, or even calls may\n        be executed against it.\n        \"\"\"\n        return False\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value. The \"None\" value indicates unknown.\"\"\"\n\n        return None\n\n    @staticmethod\n    def getComparisonValue():\n        \"\"\"Return known value used for compile time comparison. The \"None\" value indicates unknown.\"\"\"\n\n        return False, None\n\n    @staticmethod\n    def isMappingWithConstantStringKeys():\n        \"\"\"Is this a mapping with constant string keys. Used for call optimization.\"\"\"\n        return False\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        \"\"\"Can be iterated at all (count is None) or exactly count times.\n\n        Yes or no. If it can be iterated a known number of times, it may\n        be asked to unpack itself.\n        \"\"\"\n\n        # Virtual method, pylint: disable=unused-argument\n        return False\n\n    @staticmethod\n    def isKnownToBeIterableAtMin(count):\n        # Virtual method, pylint: disable=unused-argument\n        return False\n\n    def getIterationLength(self):\n        \"\"\"Value that \"len\" or \"PyObject_Size\" would give, if known.\n\n        Otherwise it is \"None\" to indicate unknown.\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def getIterationMinLength(self):\n        \"\"\"Value that \"len\" or \"PyObject_Size\" would give at minimum, if known.\n\n        Otherwise it is \"None\" to indicate unknown.\n        \"\"\"\n\n        return self.getIterationLength()\n\n    @staticmethod\n    def getStringValue():\n        \"\"\"Node as string value, if possible.\"\"\"\n        return None\n\n    def getStrValue(self):\n        \"\"\"Value that \"str\" or \"PyObject_Str\" would give, if known.\n\n        Otherwise it is \"None\" to indicate unknown. Users must not\n        forget to take side effects into account, when replacing a\n        node with its string value.\n        \"\"\"\n        string_value = self.getStringValue()\n\n        if string_value is not None:\n            # Those that are user provided, need to overload this.\n            return makeConstantReplacementNode(\n                node=self, constant=string_value, user_provided=False\n            )\n\n        return None\n\n    def getTypeValue(self):\n        \"\"\"Type of the node.\"\"\"\n\n        from .TypeNodes import ExpressionBuiltinType1\n\n        return ExpressionBuiltinType1(\n            value=self.makeClone(), source_ref=self.source_ref\n        )\n\n    def getIterationHandle(self):\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    @staticmethod\n    def isKnownToBeHashable():\n        \"\"\"Is the value hashable, i.e. suitable for dictionary/set key usage.\"\"\"\n\n        # Unknown by default.\n        return None\n\n    @staticmethod\n    def extractUnhashableNodeType():\n        \"\"\"Return the value type that is not hashable, if isKnowtoBeHashable() returns False.\"\"\"\n\n        # Not available by default.\n        return None\n\n    def onRelease(self, trace_collection):\n        # print \"onRelease\", self\n        pass\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    @abstractmethod\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Abstract execution of the node.\n\n        Returns:\n            tuple(node, tags, description)\n\n            The return value can be node itself.\n\n        Notes:\n            Replaces a node with computation result. This is the low level\n            form for the few cases, where the children are not simply all\n            evaluated first, but this allows e.g. to deal with branches, do\n            not overload this unless necessary.\n        \"\"\"\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        # By default, an attribute lookup may change everything about the lookup\n        # source.\n        # trace_collection.onValueEscapeAttributeLookup(self, attribute_name)\n\n        if self.mayRaiseExceptionAttributeLookup(BaseException, attribute_name):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        return lookup_node, None, None\n\n    def computeExpressionAttributeSpecial(\n        self, lookup_node, attribute_name, trace_collection\n    ):\n        # By default, an attribute lookup may change everything about the lookup\n        # source. Virtual method, pylint: disable=unused-argument\n        # trace_collection.onValueEscapeAttributeLookup(self, attribute_name)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionImportName(self, import_node, import_name, trace_collection):\n        if self.mayRaiseExceptionImportName(BaseException, import_name):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        return import_node, None, None\n\n    def computeExpressionSetAttribute(\n        self, set_node, attribute_name, value_node, trace_collection\n    ):\n        # Virtual method, pylint: disable=unused-argument\n\n        # By default, an attribute lookup may change everything about the lookup\n        # source and any code could run.\n        trace_collection.removeKnowledge(self)\n        trace_collection.removeKnowledge(value_node)\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Better mechanics?\n        return set_node, None, None\n\n    def computeExpressionDelAttribute(self, set_node, attribute_name, trace_collection):\n        # By default, an attribute lookup may change everything about the lookup\n        # source. Virtual method, pylint: disable=unused-argument\n        # trace_collection.removeKnowledge(self)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Better mechanics?\n        return set_node, None, None\n\n    def computeExpressionSubscript(self, lookup_node, subscript, trace_collection):\n        # By default, an subscript can execute any code and change all values\n        # that escaped. This is a virtual method that may consider the subscript\n        # but generally we don't know what to do. pylint: disable=unused-argument\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionSetSubscript(\n        self, set_node, subscript, value_node, trace_collection\n    ):\n        # By default, an subscript can execute any code and change all values\n        # that escaped. This is a virtual method that may consider the subscript\n        # but generally we don't know what to do.\n        trace_collection.removeKnowledge(value_node)\n        trace_collection.removeKnowledge(subscript)\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return set_node, None, None\n\n    def computeExpressionDelSubscript(self, del_node, subscript, trace_collection):\n        # By default, an subscript can execute any code and change all values\n        # that escaped. This is a virtual method that may consider the subscript\n        # but generally we don't know what to do. pylint: disable=unused-argument\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return del_node, None, None\n\n    def computeExpressionSlice(self, lookup_node, lower, upper, trace_collection):\n        # pylint: disable=unused-argument\n\n        # By default, a slicing may change everything about the lookup source.\n        # trace_collection.removeKnowledge(self)\n        # trace_collection.onValueEscapeSliceOperation(self, lower, upper)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionSetSlice(\n        self, set_node, lower, upper, value_node, trace_collection\n    ):\n        # pylint: disable=unused-argument\n\n        # By default, an subscript may change everything about the lookup\n        # source and the value is escaped.\n        trace_collection.removeKnowledge(value_node)\n        trace_collection.removeKnowledge(self)\n        trace_collection.onControlFlowEscape(self)\n\n        # trace_collection.onValueEscapeSliceArguments(self, lower, upper)\n\n        # trace_collection.onValueEscapeSliceSetSource(self, lower, upper)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return set_node, None, None\n\n    def computeExpressionDelSlice(self, set_node, lower, upper, trace_collection):\n        # pylint: disable=unused-argument\n\n        # By default, an subscript may change everything about the lookup\n        # source.\n        trace_collection.removeKnowledge(self)\n        trace_collection.onControlFlowEscape(self)\n\n        # trace_collection.onValueEscapeSliceArguments(self, lower, upper)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return set_node, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Virtual method, pylint: disable=unused-argument\n\n        # The called and the arguments escape for good.\n        call_node.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return call_node, None, None\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        # Virtual method, pylint: disable=unused-argument\n\n        # The called and the arguments escape for good.\n        self.onContentEscapes(trace_collection)\n        if call_args is not None:\n            call_args.onContentEscapes(trace_collection)\n        if call_kw is not None:\n            call_kw.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return call_node, None, None\n\n    def computeExpressionLen(self, len_node, trace_collection):\n        shape = self.getValueShape()\n\n        has_len = shape.hasShapeSlotLen()\n\n        if has_len is False:\n            # An exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"object of type '%s' has no len()\",\n                operation=\"len\",\n                original_node=len_node,\n                value_node=self,\n            )\n        elif has_len is True:\n            iter_length = self.getIterationLength()\n\n            if iter_length is not None:\n                from .ConstantRefNodes import makeConstantRefNode\n\n                result = makeConstantRefNode(\n                    constant=int(iter_length),  # make sure to downcast long\n                    source_ref=len_node.getSourceReference(),\n                )\n\n                result = wrapExpressionWithNodeSideEffects(\n                    new_node=result, old_node=self\n                )\n\n                return (\n                    result,\n                    \"new_constant\",\n                    \"Predicted 'len' result from value shape.\",\n                )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return len_node, None, None\n\n    def computeExpressionAbs(self, abs_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotAbs() is False:\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"bad operand type for abs(): '%s'\",\n                operation=\"abs\",\n                original_node=abs_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return abs_node, None, None\n\n    def computeExpressionInt(self, int_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotInt() is False:\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=(\n                    \"int() argument must be a string or a number, not '%s'\"\n                    if python_version < 0x300\n                    else \"int() argument must be a string, a bytes-like object or a number, not '%s'\"\n                ),\n                operation=\"int\",\n                original_node=int_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return int_node, None, None\n\n    def computeExpressionLong(self, long_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotLong() is False:\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"long() argument must be a string or a number, not '%s'\",\n                operation=\"long\",\n                original_node=long_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return long_node, None, None\n\n    def computeExpressionFloat(self, float_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotFloat() is False:\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                (\n                    \"float() argument must be a string or a number\"\n                    if Options.is_full_compat and python_version < 0x300\n                    else \"float() argument must be a string or a number, not '%s'\"\n                ),\n                operation=\"long\",\n                original_node=float_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return float_node, None, None\n\n    def computeExpressionBytes(self, bytes_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if (\n            shape.hasShapeSlotBytes() is False\n            and shape.hasShapeSlotInt() is False\n            and shape.hasShapeSlotIter() is False\n        ):\n            # An exception is raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                \"'%s' object is not iterable\",\n                operation=\"bytes\",\n                original_node=bytes_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return bytes_node, None, None\n\n    def computeExpressionComplex(self, complex_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotComplex() is False:\n            # Any exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                (\n                    \"complex() argument must be a string or a number\"\n                    if Options.is_full_compat and python_version < 0x300\n                    else \"complex() argument must be a string or a number, not '%s'\"\n                ),\n                operation=\"complex\",\n                original_node=complex_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return complex_node, None, None\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        shape = self.getTypeShape()\n\n        if shape.hasShapeSlotIter() is False:\n            # An exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"'%s' object is not iterable\",\n                operation=\"iter\",\n                original_node=iter_node,\n                value_node=self,\n            )\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return iter_node, None, None\n\n    def computeExpressionNext1(self, next_node, trace_collection):\n        # TODO: This is only true for a few value types, use type shape to tell if\n        # it might escape or raise.\n\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        if self.mayHaveSideEffectsNext():\n            trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return True, (next_node, None, None)\n\n    def computeExpressionAsyncIter(self, iter_node, trace_collection):\n        self.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return iter_node, None, None\n\n    def computeExpressionOperationNot(self, not_node, trace_collection):\n        # Virtual method, pylint: disable=no-self-use\n\n        # The value of that node escapes and could change its contents.\n        # trace_collection.onValueEscapeNot(self)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(not_node)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return not_node, None, None\n\n    def computeExpressionOperationRepr(self, repr_node, trace_collection):\n        type_shape = self.getTypeShape()\n\n        escape_desc = type_shape.getOperationUnaryReprEscape()\n\n        # Annotate if exceptions might be raised.\n        exception_raise_exit = escape_desc.getExceptionExit()\n        if exception_raise_exit is not None:\n            trace_collection.onExceptionRaiseExit(exception_raise_exit)\n\n        if escape_desc.isValueEscaping():\n            # The value of that node escapes and could change its contents during repr\n            # only, which might be more limited.\n            # trace_collection.onValueEscapeRepr(self)\n            trace_collection.removeKnowledge(self)\n\n        if escape_desc.isControlFlowEscape():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        return (repr_node, None, None), escape_desc\n\n    def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):\n        # Virtual method, pylint: disable=unused-argument\n\n        shape = self.getTypeShape()\n\n        assert shape is not None, self\n\n        if shape.hasShapeSlotContains() is False:\n            # An exception may be raised.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                template=\"argument of type '%s' object is not iterable\",\n                operation=\"in\",\n                original_node=in_node,\n                value_node=self,\n            )\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(in_node)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return in_node, None, None\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        if not self.mayHaveSideEffects():\n            return (\n                None,\n                \"new_statements\",\n                lambda: \"Removed %s without effect.\" % self.getDescription(),\n            )\n\n        return statement, None, None\n\n    def computeExpressionBool(self, trace_collection):\n        if not self.mayRaiseException(BaseException) and self.mayRaiseExceptionBool(\n            BaseException\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # None indicates no replacement action.\n        return None, None, None\n\n    @staticmethod\n    def onContentEscapes(trace_collection):\n        pass\n\n    @staticmethod\n    def onContentIteratedEscapes(trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionBool(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise being checked.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionAbs(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise in 'abs'.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionInt(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise in __int__.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionLong(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise in __long__.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionFloat(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise in __float__.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionBytes(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise in __bytes__.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionIn(exception_type, checked_value):\n        \"\"\"Unless we are told otherwise, everything may raise being iterated.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionAttributeLookup(exception_type, attribute_name):\n        \"\"\"Unless we are told otherwise, everything may raise for attribute access.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionAttributeLookupSpecial(exception_type, attribute_name):\n        \"\"\"Unless we are told otherwise, everything may raise for attribute access.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionAttributeLookupObject(exception_type, attribute):\n        \"\"\"Unless we are told otherwise, everything may raise for attribute access.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionImportName(exception_type, import_name):\n        \"\"\"Unless we are told otherwise, everything may raise for name import.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return True\n\n    @staticmethod\n    def mayHaveSideEffectsBool():\n        \"\"\"Unless we are told otherwise, everything may have a side effect for bool check.\"\"\"\n\n        return True\n\n    @staticmethod\n    def mayHaveSideEffectsAbs():\n        \"\"\"Unless we are told otherwise, everything may have a side effect for abs check.\"\"\"\n\n        # TODO: Bonus points for check type shapes that will be good\n        # for abs, i.e. number shapes like Int, Long, Float, Complex.\n\n        return True\n\n    def mayHaveSideEffectsNext(self):\n        \"\"\"The type shape tells us, if \"next\" may execute code.\"\"\"\n\n        return self.getTypeShape().hasShapeSlotNextCode()\n\n    def hasShapeSlotLen(self):\n        \"\"\"The type shape tells us, if \"len\" is available.\"\"\"\n        return self.getTypeShape().hasShapeSlotLen()\n\n    def hasShapeSlotIter(self):\n        \"\"\"The type shape tells us, if \"iter\" is available.\"\"\"\n        return self.getTypeShape().hasShapeSlotIter()\n\n    def hasShapeSlotNext(self):\n        \"\"\"The type shape tells us, if \"next\" is available.\"\"\"\n        return self.getTypeShape().hasShapeSlotNext()\n\n    # TODO: Maybe this is a shape slot thing.\n    @staticmethod\n    def isIndexable():\n        \"\"\"Unless we are told otherwise, it's not indexable.\"\"\"\n\n        return False\n\n    # TODO: There ought to be a type shape check for that too.\n    @staticmethod\n    def getIntegerValue():\n        \"\"\"Node as integer value, if possible.\"\"\"\n\n        return None\n\n    # TODO: There ought to be a type shape check for that too.\n    @staticmethod\n    def getIndexValue():\n        \"\"\"Node as index value, if possible.\n\n        This should only work for int, bool, and long values, but e.g. not floats.\n        \"\"\"\n\n        return None\n\n    @staticmethod\n    def getIntValue():\n        \"\"\"Value that \"int\" or \"PyNumber_Int\" (sp) would give, if known.\n\n        Otherwise it is \"None\" to indicate unknown. Users must not\n        forget to take side effects into account, when replacing a\n        node with its string value.\n        \"\"\"\n        return None\n\n    def getExpressionDictInConstant(self, value):\n        \"\"\"Value that the dict \"in\" operation would give, if known.\n\n        This is only called for values with known dict type shape. And those\n        nodes who are known to do it, have to overload it.\n        \"\"\"\n\n        # Virtual method, pylint: disable=unused-argument\n\n        # We want to have them all overloaded, so lets report cases where that\n        # has not been happening.\n        if Options.is_debug:\n            onMissingOverload(method_name=\"getExpressionDictInConstant\", node=self)\n\n        return None\n\n    def hasShapeTrustedAttributes(self):\n        return self.getTypeShape().hasShapeTrustedAttributes()\n\n    def hasShapeTypeExact(self):\n        \"\"\"Does a node have exactly a 'type' shape.\"\"\"\n\n        return self.getTypeShape() is tshape_type\n\n    def hasShapeListExact(self):\n        \"\"\"Does a node have exactly a list shape.\"\"\"\n\n        return self.getTypeShape() is tshape_list\n\n    def hasShapeDictionaryExact(self):\n        \"\"\"Does a node have exactly a dictionary shape.\"\"\"\n\n        return self.getTypeShape() is tshape_dict\n\n    def hasShapeStrExact(self):\n        \"\"\"Does an expression have exactly a string shape.\"\"\"\n        return self.getTypeShape() is tshape_str\n\n    def hasShapeUnicodeExact(self):\n        \"\"\"Does an expression have exactly a unicode shape.\"\"\"\n        return self.getTypeShape() is tshape_unicode\n\n    if str is bytes:\n\n        def hasShapeStrOrUnicodeExact(self):\n            return self.getTypeShape() in (tshape_str, tshape_unicode)\n\n    else:\n\n        def hasShapeStrOrUnicodeExact(self):\n            return self.getTypeShape() is tshape_str\n\n    def hasShapeBytesExact(self):\n        \"\"\"Does an expression have exactly a bytes shape.\"\"\"\n        return self.getTypeShape() is tshape_bytes\n\n    def hasShapeBoolExact(self):\n        \"\"\"Does an expression have exactly a bool shape.\"\"\"\n        return self.getTypeShape() is tshape_bool\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Trust that value will not be overwritten from the outside.\"\"\"\n        return False\n\n\nclass ExpressionNoSideEffectsMixin(object):\n    __slots__ = ()\n\n    @staticmethod\n    def mayHaveSideEffects():\n        # Virtual method overload\n        return False\n\n    @staticmethod\n    def extractSideEffects():\n        # Virtual method overload, we said we have no effects.\n        return ()\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        # Virtual method overload, pylint: disable=unused-argument\n        #\n        # We said we have no effects, so we can be removed.\n        return (\n            None,\n            \"new_statements\",\n            lambda: \"Removed %s that never has an effect.\" % self.getDescription(),\n        )\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # Virtual method overload, pylint: disable=unused-argument\n\n        # An exception would be considered a side effect too.\n        return False\n\n\nclass CompileTimeConstantExpressionBase(ExpressionNoSideEffectsMixin, ExpressionBase):\n    # TODO: Do this for all computations, do this in the base class of all\n    # nodes.\n    __slots__ = (\"computed_attribute\",)\n\n    def __init__(self, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.computed_attribute = None\n\n    @staticmethod\n    def isCompileTimeConstant():\n        \"\"\"Has a value that we can use at compile time.\n\n        Yes or no. If it has such a value, simulations can be applied at\n        compile time and e.g. operations or conditions, or even calls may\n        be executed against it.\n        \"\"\"\n        return True\n\n    def getTruthValue(self):\n        return bool(self.getCompileTimeConstant())\n\n    def getComparisonValue(self):\n        return True, self.getCompileTimeConstant()\n\n    @abstractmethod\n    def getCompileTimeConstant(self):\n        \"\"\"Return compile time constant.\n\n        Notes: Only available after passing \"isCompileTimeConstant()\".\n\n        \"\"\"\n\n    @staticmethod\n    def isMutable():\n        \"\"\"Return if compile time constant is mutable.\n\n        Notes: Only useful after passing \"isCompileTimeConstant()\".\n        \"\"\"\n        return False\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        # All compile time constants must be fixed for attributes.\n        return True\n\n    @staticmethod\n    def mayHaveSideEffectsBool():\n        # Virtual method overload\n        return False\n\n    @staticmethod\n    def mayRaiseExceptionBool(exception_type):\n        return False\n\n    def mayRaiseExceptionAttributeLookup(self, exception_type, attribute_name):\n        # We remember it from our computation.\n        return not self.computed_attribute\n\n    def mayRaiseExceptionAttributeLookupSpecial(self, exception_type, attribute_name):\n        # We remember it from our computation.\n        return not self.computed_attribute\n\n    def computeExpressionOperationNot(self, not_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=not_node,\n            computation=lambda: not self.getCompileTimeConstant(),\n            description=\"\"\"\\\nCompile time constant negation truth value pre-computed.\"\"\",\n        )\n\n    def computeExpressionOperationRepr(self, repr_node, trace_collection):\n        return (\n            trace_collection.getCompileTimeComputationResult(\n                node=repr_node,\n                computation=lambda: repr(self.getCompileTimeConstant()),\n                description=\"\"\"\\\nCompile time constant repr value pre-computed.\"\"\",\n            ),\n            None,\n        )\n\n    def computeExpressionLen(self, len_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=len_node,\n            computation=lambda: len(self.getCompileTimeConstant()),\n            description=\"\"\"\\\nCompile time constant len value pre-computed.\"\"\",\n        )\n\n    def computeExpressionAbs(self, abs_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=abs_node,\n            computation=lambda: abs(self.getCompileTimeConstant()),\n            description=\"\"\"\\\nCompile time constant abs value pre-computed.\"\"\",\n        )\n\n    def computeExpressionInt(self, int_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=int_node,\n            computation=lambda: int(self.getCompileTimeConstant()),\n            description=\"\"\"\\\nCompile time constant int value pre-computed.\"\"\",\n        )\n\n    def computeExpressionLong(self, long_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=long_node,\n            computation=lambda: long(self.getCompileTimeConstant()),\n            description=\"\"\"\\\nCompile time constant long value pre-computed.\"\"\",\n        )\n\n    def computeExpressionFloat(self, float_node, trace_collection):\n        return trace_collection.getCompileTimeComputationResult(\n            node=float_node,\n            computation=lambda: float(self.getCompileTimeConstant()),\n            description=\"\"\"\\\nCompile time constant float value pre-computed.\"\"\",\n        )\n\n    def computeExpressionBytes(self, bytes_node, trace_collection):\n        constant_value = self.getCompileTimeConstant()\n\n        if type(constant_value) in (int, long):\n            if constant_value > 1000:\n                return bytes_node, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=bytes_node,\n            computation=lambda: bytes(constant_value),\n            description=\"\"\"\\\nCompile time constant bytes value pre-computed.\"\"\",\n        )\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        if self.computed_attribute is None:\n            self.computed_attribute = hasattr(\n                self.getCompileTimeConstant(), attribute_name\n            )\n\n        return self.computed_attribute\n\n    def getKnownAttributeValue(self, attribute_name):\n        return getattr(self.getCompileTimeConstant(), attribute_name)\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        value = self.getCompileTimeConstant()\n\n        if self.computed_attribute is None:\n            self.computed_attribute = hasattr(value, attribute_name)\n\n        # If it raises, or the attribute itself is a compile time constant,\n        # then do execute it.\n        if not self.computed_attribute or isCompileTimeConstantValue(\n            getattr(value, attribute_name, None)\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=lookup_node,\n                computation=lambda: getattr(value, attribute_name),\n                description=\"Attribute '%s' pre-computed.\" % (attribute_name),\n            )\n\n        return lookup_node, None, None\n\n    def computeExpressionSubscript(self, lookup_node, subscript, trace_collection):\n        if subscript.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=lookup_node,\n                computation=lambda: self.getCompileTimeConstant()[\n                    subscript.getCompileTimeConstant()\n                ],\n                description=\"Subscript of constant with constant value.\",\n            )\n\n        # TODO: Look-up of subscript to index may happen.\n        # Any code could be run due to that, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionSlice(self, lookup_node, lower, upper, trace_collection):\n        # TODO: Could be happy with predictable index values and not require\n        # constants.\n        if lower is not None:\n            if upper is not None:\n                if lower.isCompileTimeConstant() and upper.isCompileTimeConstant():\n                    return trace_collection.getCompileTimeComputationResult(\n                        node=lookup_node,\n                        computation=lambda: self.getCompileTimeConstant()[\n                            lower.getCompileTimeConstant() : upper.getCompileTimeConstant()\n                        ],\n                        description=\"Slicing of constant with constant indexes.\",\n                        user_provided=False,\n                    )\n            else:\n                if lower.isCompileTimeConstant():\n                    return trace_collection.getCompileTimeComputationResult(\n                        node=lookup_node,\n                        computation=lambda: self.getCompileTimeConstant()[\n                            lower.getCompileTimeConstant() :\n                        ],\n                        description=\"Slicing of constant with constant lower index only.\",\n                        user_provided=False,\n                    )\n        else:\n            if upper is not None:\n                if upper.isCompileTimeConstant():\n                    return trace_collection.getCompileTimeComputationResult(\n                        node=lookup_node,\n                        computation=lambda: self.getCompileTimeConstant()[\n                            : upper.getCompileTimeConstant()\n                        ],\n                        description=\"Slicing of constant with constant upper index only.\",\n                        user_provided=False,\n                    )\n            else:\n                return trace_collection.getCompileTimeComputationResult(\n                    node=lookup_node,\n                    computation=lambda: self.getCompileTimeConstant()[:],\n                    description=\"Slicing of constant with no indexes.\",\n                    user_provided=False,\n                )\n\n        # Any exception might be raised, although it's not likely.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):\n        if value_node.isCompileTimeConstant():\n            return trace_collection.getCompileTimeComputationResult(\n                node=in_node,\n                computation=lambda: in_node.getSimulator()(\n                    value_node.getCompileTimeConstant(), self.getCompileTimeConstant()\n                ),\n                description=\"\"\"\\\nPredicted '%s' on compiled time constant values.\"\"\"\n                % in_node.comparator,\n                user_provided=False,\n            )\n\n        # Look-up of __contains__ on compile time constants does mostly nothing.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return in_node, None, None\n\n    def computeExpressionBool(self, trace_collection):\n        constant = self.getCompileTimeConstant()\n\n        # Dealt with through dedicated nodes.\n        assert type(constant) is not bool\n        truth_value = bool(constant)\n\n        result = makeConstantReplacementNode(\n            constant=truth_value, node=self, user_provided=False\n        )\n\n        return truth_value, result, \"Predicted compile time constant truth value.\"\n\n\nclass ExpressionSpecBasedComputationMixin(object):\n    # Mixins are not allowed to specify slots.\n    __slots__ = ()\n\n    builtin_spec = None\n\n    def computeBuiltinSpec(self, trace_collection, given_values):\n        assert self.builtin_spec is not None, self\n\n        if not self.builtin_spec.isCompileTimeComputable(given_values):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.builtin_spec.simulateCall(given_values),\n            description=\"Built-in call to '%s' pre-computed.\"\n            % (self.builtin_spec.getName()),\n            user_provided=self.builtin_spec.isUserProvided(given_values),\n        )\n\n\nclass ExpressionSpecBasedComputationNoRaiseMixin(object):\n    # Mixins are not allowed to specify slots.\n    __slots__ = ()\n\n    builtin_spec = None\n\n    def computeBuiltinSpec(self, trace_collection, given_values):\n        assert self.builtin_spec is not None, self\n\n        if not self.builtin_spec.isCompileTimeComputable(given_values):\n            return self, None, None\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.builtin_spec.simulateCall(given_values),\n            description=\"Built-in call to '%s' pre-computed.\"\n            % (self.builtin_spec.getName()),\n        )\n\n\nclass ExpressionBuiltinSingleArgBase(\n    ExpressionSpecBasedComputationMixin, ChildHavingValueMixin, ExpressionBase\n):\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        # TODO: Can this happen, where, and can we have a different base class then.\n        assert value is not None\n\n        if value is None:\n            return self.computeBuiltinSpec(\n                trace_collection=trace_collection, given_values=()\n            )\n        else:\n            return self.computeBuiltinSpec(\n                trace_collection=trace_collection, given_values=(value,)\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ExpressionBasesGenerated.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Children having expression bases\n\nWARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\n\n\n# Loop unrolling over child names, pylint: disable=too-many-branches\n\nfrom abc import abstractmethod\n\nfrom .ExpressionBases import ExpressionBase\nfrom .NodeMakingHelpers import wrapExpressionWithSideEffects\n\n\nclass NoChildHavingFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportEntryPointValueRef\n    #   ExpressionImportlibMetadataEntryPointValueRef\n\n    def finalize(self):\n        del self.parent\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionImportlibMetadataBackportEntryPointValueRefBase = (\n    NoChildHavingFinalNoRaiseMixin\n)\nExpressionImportlibMetadataEntryPointValueRefBase = NoChildHavingFinalNoRaiseMixin\n\n\nclass ChildHavingArgsTupleFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinMakeException\n\n    def __init__(self, args, source_ref):\n        assert type(args) is tuple\n\n        for val in args:\n            val.parent = self\n\n        self.subnode_args = args\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_args\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"args\", self.subnode_args),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_args\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_args = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_args = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"args\": tuple(v.makeClone() for v in self.subnode_args),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_args:\n            c.finalize()\n        del self.subnode_args\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_args = self.subnode_args\n\n        for sub_expression in old_subnode_args:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_args[\n                        : old_subnode_args.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return any(\n            value.mayRaiseException(exception_type) for value in self.subnode_args\n        )\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_args:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinMakeExceptionBase = ChildHavingArgsTupleFinalNoRaiseMixin\n\n\nclass ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinMakeExceptionImportError\n\n    def __init__(self, args, name, path, source_ref):\n        assert type(args) is tuple\n\n        for val in args:\n            val.parent = self\n\n        self.subnode_args = args\n\n        if name is not None:\n            name.parent = self\n\n        self.subnode_name = name\n\n        if path is not None:\n            path.parent = self\n\n        self.subnode_path = path\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.extend(self.subnode_args)\n        value = self.subnode_name\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_path\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"args\", self.subnode_args),\n            (\"name\", self.subnode_name),\n            (\"path\", self.subnode_path),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_args\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_args = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_args = tuple(val for val in value if val is not old_node)\n\n            return\n\n        value = self.subnode_name\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        value = self.subnode_path\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_path = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"args\": tuple(v.makeClone() for v in self.subnode_args),\n            \"name\": (\n                self.subnode_name.makeClone() if self.subnode_name is not None else None\n            ),\n            \"path\": (\n                self.subnode_path.makeClone() if self.subnode_path is not None else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_args:\n            c.finalize()\n        del self.subnode_args\n        if self.subnode_name is not None:\n            self.subnode_name.finalize()\n        del self.subnode_name\n        if self.subnode_path is not None:\n            self.subnode_path.finalize()\n        del self.subnode_path\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return (\n            any(value.mayRaiseException(exception_type) for value in self.subnode_args)\n            or (\n                self.subnode_name is not None\n                and self.subnode_name.mayRaiseException(exception_type)\n            )\n            or (\n                self.subnode_path is not None\n                and self.subnode_path.mayRaiseException(exception_type)\n            )\n        )\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_args:\n            element.collectVariableAccesses(emit_read, emit_write)\n        subnode_name = self.subnode_name\n\n        if subnode_name is not None:\n            self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n        subnode_path = self.subnode_path\n\n        if subnode_path is not None:\n            self.subnode_path.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinMakeExceptionImportErrorBase = (\n    ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin\n)\n\n\nclass ChildrenHavingCallableArgSentinelFinalMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinIter2\n\n    def __init__(self, callable_arg, sentinel, source_ref):\n        callable_arg.parent = self\n\n        self.subnode_callable_arg = callable_arg\n\n        sentinel.parent = self\n\n        self.subnode_sentinel = sentinel\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_callable_arg,\n            self.subnode_sentinel,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"callable_arg\", self.subnode_callable_arg),\n            (\"sentinel\", self.subnode_sentinel),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_callable_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_callable_arg = new_node\n\n            return\n\n        value = self.subnode_sentinel\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_sentinel = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"callable_arg\": self.subnode_callable_arg.makeClone(),\n            \"sentinel\": self.subnode_sentinel.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_callable_arg.finalize()\n        del self.subnode_callable_arg\n        self.subnode_sentinel.finalize()\n        del self.subnode_sentinel\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n        return self, None, None\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_callable_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_sentinel.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinIter2Base = ChildrenHavingCallableArgSentinelFinalMixin\n\n\nclass ChildHavingDistributionNameFinalChildrenMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportDistributionFailedCall\n    #   ExpressionImportlibMetadataDistributionFailedCall\n\n    def __init__(self, distribution_name, source_ref):\n        distribution_name.parent = self\n\n        self.subnode_distribution_name = distribution_name\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_distribution_name,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"distribution_name\", self.subnode_distribution_name),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_distribution_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_distribution_name = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"distribution_name\": self.subnode_distribution_name.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_distribution_name.finalize()\n        del self.subnode_distribution_name\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_distribution_name.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionImportlibMetadataBackportDistributionFailedCallBase = (\n    ChildHavingDistributionNameFinalChildrenMixin\n)\nExpressionImportlibMetadataDistributionFailedCallBase = (\n    ChildHavingDistributionNameFinalChildrenMixin\n)\n\n\nclass ChildHavingElementsTupleFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportEntryPointsValueRef\n    #   ExpressionImportlibMetadataEntryPointsValueRef\n\n    def __init__(self, elements, source_ref):\n        assert type(elements) is tuple\n\n        for val in elements:\n            val.parent = self\n\n        self.subnode_elements = elements\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_elements\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"elements\", self.subnode_elements),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_elements\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_elements = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_elements = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"elements\": tuple(v.makeClone() for v in self.subnode_elements),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_elements:\n            c.finalize()\n        del self.subnode_elements\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_elements = self.subnode_elements\n\n        for sub_expression in old_subnode_elements:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_elements[\n                        : old_subnode_elements.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return any(\n            value.mayRaiseException(exception_type) for value in self.subnode_elements\n        )\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_elements:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionImportlibMetadataBackportEntryPointsValueRefBase = (\n    ChildHavingElementsTupleFinalNoRaiseMixin\n)\nExpressionImportlibMetadataEntryPointsValueRefBase = (\n    ChildHavingElementsTupleFinalNoRaiseMixin\n)\n\n\nclass ChildHavingExpressionAttributeNameMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionAttributeLookup\n    #   ExpressionAttributeLookupSpecial\n\n    def __init__(self, expression, attribute_name, source_ref):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        self.attribute_name = attribute_name\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"attribute_name\": self.attribute_name,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_expression,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"expression\", self.subnode_expression),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_expression)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionAttributeLookupBase = ChildHavingExpressionAttributeNameMixin\nExpressionAttributeLookupSpecialBase = ChildHavingExpressionAttributeNameMixin\n\n\nclass ChildrenHavingExpressionNameRaiseWaitConstantNameMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinHasattr\n\n    def __init__(self, expression, name, source_ref):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        name.parent = self\n\n        self.subnode_name = name\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_expression,\n            self.subnode_name,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"name\", self.subnode_name),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_name\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_name = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"name\": self.subnode_name.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        self.subnode_name.finalize()\n        del self.subnode_name\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        if self.subnode_name.isCompileTimeConstant():\n            try:\n                return self.computeExpressionConstantName(trace_collection)\n            finally:\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_name.collectVariableAccesses(emit_read, emit_write)\n\n    @abstractmethod\n    def computeExpressionConstantName(self, trace_collection):\n        \"\"\"Called when attribute name is constant.\"\"\"\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinHasattrBase = ChildrenHavingExpressionNameRaiseWaitConstantNameMixin\n\n\nclass ChildrenHavingLeftRightFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionSubtypeCheck\n\n    def __init__(self, left, right, source_ref):\n        left.parent = self\n\n        self.subnode_left = left\n\n        right.parent = self\n\n        self.subnode_right = right\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_left,\n            self.subnode_right,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"left\", self.subnode_left),\n            (\"right\", self.subnode_right),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_left\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_left = new_node\n\n            return\n\n        value = self.subnode_right\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_right = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"left\": self.subnode_left.makeClone(),\n            \"right\": self.subnode_right.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_left.finalize()\n        del self.subnode_left\n        self.subnode_right.finalize()\n        del self.subnode_right\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_left.mayRaiseException(\n            exception_type\n        ) or self.subnode_right.mayRaiseException(exception_type)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_left.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_right.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionSubtypeCheckBase = ChildrenHavingLeftRightFinalNoRaiseMixin\n\n\nclass ChildHavingListArgNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationClear\n    #   ExpressionListOperationReverse\n\n    def __init__(self, list_arg, source_ref):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_list_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"list_arg\", self.subnode_list_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_list_arg)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_list_arg.mayRaiseException(exception_type)\n\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionListOperationClearBase = ChildHavingListArgNoRaiseMixin\nExpressionListOperationReverseBase = ChildHavingListArgNoRaiseMixin\n\n\nclass ChildrenHavingListArgItemNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationAppend\n\n    def __init__(self, list_arg, item, source_ref):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        item.parent = self\n\n        self.subnode_item = item\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_item,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"item\", self.subnode_item),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_item\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_item = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"item\": self.subnode_item.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_item.finalize()\n        del self.subnode_item\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_list_arg.mayRaiseException(\n            exception_type\n        ) or self.subnode_item.mayRaiseException(exception_type)\n\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_item.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionListOperationAppendBase = ChildrenHavingListArgItemNoRaiseMixin\n\n\nclass ChildrenHavingListArgValueFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionListOperationCount\n\n    def __init__(self, list_arg, value, source_ref):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_list_arg.mayRaiseException(\n            exception_type\n        ) or self.subnode_value.mayRaiseException(exception_type)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionListOperationCountBase = ChildrenHavingListArgValueFinalNoRaiseMixin\n\n\nclass ChildHavingPairsTupleFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionImportlibMetadataBackportSelectableGroupsValueRef\n    #   ExpressionImportlibMetadataSelectableGroupsValueRef\n\n    def __init__(self, pairs, source_ref):\n        assert type(pairs) is tuple\n\n        for val in pairs:\n            val.parent = self\n\n        self.subnode_pairs = pairs\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_pairs\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"pairs\", self.subnode_pairs),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_pairs\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_pairs = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_pairs = tuple(val for val in value if val is not old_node)\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"pairs\": tuple(v.makeClone() for v in self.subnode_pairs),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_pairs:\n            c.finalize()\n        del self.subnode_pairs\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        old_subnode_pairs = self.subnode_pairs\n\n        for sub_expression in old_subnode_pairs:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_pairs[\n                        : old_subnode_pairs.index(sub_expression)\n                    ],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return any(\n            value.mayRaiseException(exception_type) for value in self.subnode_pairs\n        )\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_pairs:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionImportlibMetadataBackportSelectableGroupsValueRefBase = (\n    ChildHavingPairsTupleFinalNoRaiseMixin\n)\nExpressionImportlibMetadataSelectableGroupsValueRefBase = (\n    ChildHavingPairsTupleFinalNoRaiseMixin\n)\n\n\nclass ChildHavingPromptOptionalFinalMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinInput\n\n    def __init__(self, prompt, source_ref):\n        if prompt is not None:\n            prompt.parent = self\n\n        self.subnode_prompt = prompt\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_prompt\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"prompt\", self.subnode_prompt),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_prompt\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_prompt = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"prompt\": (\n                self.subnode_prompt.makeClone()\n                if self.subnode_prompt is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_prompt is not None:\n            self.subnode_prompt.finalize()\n        del self.subnode_prompt\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = self.subnode_prompt\n\n        if expression is not None:\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                return (\n                    expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n        return self, None, None\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_prompt = self.subnode_prompt\n\n        if subnode_prompt is not None:\n            self.subnode_prompt.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinInputBase = ChildHavingPromptOptionalFinalMixin\n\n\nclass ChildHavingValueFinalNoRaiseMixin(ExpressionBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   ExpressionBuiltinClassmethod\n    #   ExpressionBuiltinStaticmethod\n\n    def __init__(self, value, source_ref):\n        value.parent = self\n\n        self.subnode_value = value\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"value\", self.subnode_value),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n        # First apply the sub-expression, as they it's evaluated before.\n        expression = trace_collection.onExpression(self.subnode_value)\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nExpressionBuiltinClassmethodBase = ChildHavingValueFinalNoRaiseMixin\nExpressionBuiltinStaticmethodBase = ChildHavingValueFinalNoRaiseMixin\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ExpressionShapeMixins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Mixins for expressions that have specific shapes.\n\nProviding derived implementation, such that e.g. for a given shape, shortcuts\nare automatically implemented.\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.Constants import (\n    the_empty_bytearray,\n    the_empty_dict,\n    the_empty_frozenset,\n    the_empty_list,\n    the_empty_set,\n    the_empty_slice,\n    the_empty_tuple,\n    the_empty_unicode,\n)\n\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n)\nfrom .shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytearray,\n    tshape_bytes,\n    tshape_complex,\n    tshape_dict,\n    tshape_ellipsis,\n    tshape_float,\n    tshape_frozenset,\n    tshape_int,\n    tshape_int_or_long,\n    tshape_list,\n    tshape_long,\n    tshape_none,\n    tshape_set,\n    tshape_slice,\n    tshape_str,\n    tshape_str_derived,\n    tshape_str_or_unicode,\n    tshape_str_or_unicode_derived,\n    tshape_tuple,\n    tshape_type,\n    tshape_unicode,\n    tshape_unicode_derived,\n)\n\n\nclass ExpressionSpecificDerivedMixinBase(object):\n    \"\"\"Mixin that provides all shapes exactly false overloads.\n\n    This is to be used as a base class for specific or derived shape\n    mixins, such that they automatically provide false for all other exact\n    shape checks except the one they care about.\n    \"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeNoneExact():\n        return False\n\n    @staticmethod\n    def hasShapeBoolExact():\n        return False\n\n    @staticmethod\n    def hasShapeDictionaryExact():\n        return False\n\n    @staticmethod\n    def hasShapeListExact():\n        return False\n\n    @staticmethod\n    def hasShapeSetExact():\n        return False\n\n    @staticmethod\n    def hasShapeFrozensetExact():\n        return False\n\n    @staticmethod\n    def hasShapeTupleExact():\n        return False\n\n    @staticmethod\n    def hasShapeStrExact():\n        return False\n\n    @staticmethod\n    def hasShapeUnicodeExact():\n        return False\n\n    @staticmethod\n    def hasShapeStrOrUnicodeExact():\n        return False\n\n    @staticmethod\n    def hasShapeBytesExact():\n        return False\n\n    @staticmethod\n    def hasShapeBytearrayExact():\n        return False\n\n    @staticmethod\n    def hasShapeFloatExact():\n        return False\n\n    @staticmethod\n    def hasShapeComplexExact():\n        return False\n\n    @staticmethod\n    def hasShapeIntExact():\n        return False\n\n    @staticmethod\n    def hasShapeLongExact():\n        return False\n\n    @staticmethod\n    def hasShapeSliceExact():\n        return False\n\n\nclass ExpressionSpecificExactMixinBase(ExpressionSpecificDerivedMixinBase):\n    \"\"\"Mixin that provides attribute knowledge for exact type shapes.\n\n    This is to be used as a base class for specific shape mixins,\n    such that they automatically provide false for all other exact\n    shape checks except the one they care about.\n    \"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return True\n\n    @abstractmethod\n    def isKnownToHaveAttribute(self, attribute_name):\n        return True\n\n    @abstractmethod\n    def getKnownAttributeValue(self, attribute_name):\n        \"\"\"Can be used as isKnownToHaveAttribute is True\"\"\"\n\n    def mayRaiseExceptionAttributeLookup(self, exception_type, attribute_name):\n        # TODO: The exception_type is not checked, pylint: disable=unused-argument\n        return not self.isKnownToHaveAttribute(attribute_name)\n\n    @staticmethod\n    def mayRaiseExceptionBool(exception_type):\n        # We cannot raise anything, pylint: disable=unused-argument\n        return False\n\n    @staticmethod\n    def mayHaveSideEffectsBool():\n        return False\n\n\nclass ExpressionNonIterableTypeShapeMixin(object):\n    \"\"\"Mixin for nodes known to not be iterable.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getIterationLength():\n        return None\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # virtual method overload, pylint: disable=unused-argument\n        return False\n\n    @staticmethod\n    def isKnownToBeIterableAtMin(count):\n        # virtual method overload, pylint: disable=unused-argument\n        return False\n\n    @staticmethod\n    def canPredictIterationValues():\n        return False\n\n    def computeExpressionIter1(self, iter_node, trace_collection):\n        shape = self.getTypeShape()\n\n        assert shape.hasShapeSlotIter() is False\n\n        # An exception will be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n            template=\"'%s' object is not iterable\",\n            operation=\"iter\",\n            original_node=iter_node,\n            value_node=self,\n        )\n\n\nclass ExpressionIterableTypeShapeMixin(object):\n    \"\"\"Mixin for nodes known to not be iterable.\"\"\"\n\n    __slots__ = ()\n\n    # Bad Implementation that the node can use, based on getIterationLength, which\n    def isKnownToBeIterable(self, count):\n        return count is None or self.getIterationLength() == count\n\n    def isKnownToBeIterableAtMin(self, count):\n        length = self.getIterationLength()\n\n        return length is not None and length >= count\n\n    def canPredictIterationValues(self):\n        return self.isKnownToBeIterable(None)\n\n\nclass ExpressionDictShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact dictionary shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_dict\n\n    @staticmethod\n    def hasShapeDictionaryExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_dict, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_dict, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    def extractUnhashableNodeType(self):\n        return makeConstantReplacementNode(\n            constant=dict, node=self, user_provided=False\n        )\n\n    # TODO: Make it really abstract to force all to take benefit of it.\n    # @abstractmethod\n    @staticmethod\n    def getExpressionDictInConstant(value):\n        # pylint: disable=unused-argument\n        return None\n\n\nclass ExpressionListShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact list shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_list\n\n    @staticmethod\n    def hasShapeListExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_list, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_list, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    def extractUnhashableNodeType(self):\n        return makeConstantReplacementNode(\n            constant=list, node=self, user_provided=False\n        )\n\n\nclass ExpressionFrozensetShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact frozenset shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_frozenset\n\n    @staticmethod\n    def hasShapeListExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_frozenset, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_frozenset, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionSetShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact set shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_set\n\n    @staticmethod\n    def hasShapeSetExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_set, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_set, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    def extractUnhashableNodeType(self):\n        return makeConstantReplacementNode(constant=set, node=self, user_provided=False)\n\n\nclass ExpressionTupleShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact tuple shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_tuple\n\n    @staticmethod\n    def hasShapeTupleExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_tuple, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_tuple, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return None\n\n\nclass ExpressionBoolShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact bool shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_bool\n\n    @staticmethod\n    def hasShapeBoolExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(False, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(False, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionStrShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact str shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_str\n\n    @staticmethod\n    def hasShapeStrExact():\n        return True\n\n    @staticmethod\n    def hasShapeStrOrUnicodeExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(\"\", attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(\"\", attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionBytesShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact bytes shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_bytes\n\n    @staticmethod\n    def hasShapeBytesExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(b\"\", attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(b\"\", attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionBytearrayShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact bytearray shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_bytearray\n\n    @staticmethod\n    def hasShapeBytearrayExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_bytearray, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_bytearray, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    def extractUnhashableNodeType(self):\n        return makeConstantReplacementNode(\n            constant=bytearray, node=self, user_provided=False\n        )\n\n\nclass ExpressionUnicodeShapeExactMixin(\n    ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact unicode shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unicode\n\n    @staticmethod\n    def hasShapeUnicodeExact():\n        return True\n\n    @staticmethod\n    def hasShapeStrOrUnicodeExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_unicode, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_unicode, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nif str is not bytes:\n    ExpressionStrOrUnicodeExactMixin = ExpressionStrShapeExactMixin\nelse:\n\n    class ExpressionStrOrUnicodeExactMixin(\n        ExpressionIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n    ):\n        \"\"\"Mixin for nodes with str_or_unicode shape.\"\"\"\n\n        __slots__ = ()\n\n        @staticmethod\n        def getTypeShape():\n            return tshape_str_or_unicode\n\n        @staticmethod\n        def hasShapeStrOrUnicodeExact():\n            return True\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(\"\", attribute_name) and hasattr(\n                the_empty_unicode, attribute_name\n            )\n\n        @staticmethod\n        def getKnownAttributeValue(attribute_name):\n            return getattr(\"\", attribute_name)\n\n        @staticmethod\n        def isKnownToBeHashable():\n            return True\n\n\nclass ExpressionFloatShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact float shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_float\n\n    @staticmethod\n    def hasShapeFloatExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(0.0, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(0.0, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionIntShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact int shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_int\n\n    @staticmethod\n    def hasShapeIntExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(0, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(0, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionLongShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact long shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_long\n\n    @staticmethod\n    def hasShapeLongExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(tshape_long.typical_value, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(tshape_long.typical_value, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nif str is not bytes:\n    ExpressionIntOrLongExactMixin = ExpressionIntShapeExactMixin\nelse:\n\n    class ExpressionIntOrLongExactMixin(\n        ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n    ):\n        \"\"\"Mixin for nodes with int_or_long shape.\"\"\"\n\n        __slots__ = ()\n\n        @staticmethod\n        def getTypeShape():\n            return tshape_int_or_long\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(0, attribute_name) and hasattr(\n                tshape_long.typical_value, attribute_name\n            )\n\n        @staticmethod\n        def getKnownAttributeValue(attribute_name):\n            return getattr(0, attribute_name)\n\n        @staticmethod\n        def isKnownToBeHashable():\n            return True\n\n\nclass ExpressionEllipsisShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact ellipsis shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_ellipsis\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(Ellipsis, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(Ellipsis, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\"\"\"\n\n        return True\n\n\nclass ExpressionNoneShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact None shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_none\n\n    @staticmethod\n    def hasShapeNoneExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(None, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(None, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        \"\"\"Return known truth value.\"\"\"\n\n        return False\n\n\nclass ExpressionComplexShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact complex shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_complex\n\n    @staticmethod\n    def hasShapeComplexExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        # These vary with instances, constant values should not enter here.\n        if attribute_name in (\"imag\", \"real\"):\n            return False\n\n        return hasattr(0j, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(0j, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n\nclass ExpressionSliceShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact complex shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_slice\n\n    @staticmethod\n    def hasShapeSliceExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(the_empty_slice, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(the_empty_slice, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionTypeShapeExactMixin(\n    ExpressionNonIterableTypeShapeMixin, ExpressionSpecificExactMixinBase\n):\n    \"\"\"Mixin for nodes with exact 'type' shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_type\n\n    @staticmethod\n    def hasShapeTypeExact():\n        return True\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(type, attribute_name)\n\n    @staticmethod\n    def getKnownAttributeValue(attribute_name):\n        return getattr(type, attribute_name)\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionStrDerivedShapeMixin(ExpressionSpecificDerivedMixinBase):\n    \"\"\"Mixin for nodes with str derived shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_str_derived\n\n\nclass ExpressionUnicodeDerivedShapeMixin(ExpressionSpecificDerivedMixinBase):\n    \"\"\"Mixin for nodes with unicode derived shape.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unicode_derived\n\n\nif str is not bytes:\n    ExpressionStrOrUnicodeDerivedShapeMixin = ExpressionUnicodeDerivedShapeMixin\nelse:\n\n    class ExpressionStrOrUnicodeDerivedShapeMixin(ExpressionSpecificDerivedMixinBase):\n        \"\"\"Mixin for nodes with str or unicode derived shape.\"\"\"\n\n        __slots__ = ()\n\n        @staticmethod\n        def getTypeShape():\n            return tshape_str_or_unicode_derived\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/FrameNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Frame nodes.\n\nThe frame attaches name and other frame properties to a scope, where it is\noptional. For use in tracebacks, their created frame objects, potentially\ncached are essential.\n\nOtherwise, they are similar to statement sequences, so they inherit from\nthem.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .CodeObjectSpecs import CodeObjectSpec\nfrom .FutureSpecs import fromFlags\nfrom .StatementNodes import StatementsSequence\n\n\ndef checkFrameStatements(value):\n    \"\"\"Check that frames statements list value proper.\n\n    Must not be None, must not contain None, may be empty though.\n    \"\"\"\n\n    assert value is not None\n    assert None not in value\n\n    return tuple(value)\n\n\nclass StatementsFrameBase(StatementsSequence):\n    checkers = {\"statements\": checkFrameStatements}\n\n    __slots__ = (\"code_object\", \"needs_frame_exception_preserve\")\n\n    def __init__(self, statements, code_object, source_ref):\n        StatementsSequence.__init__(self, statements=statements, source_ref=source_ref)\n\n        self.code_object = code_object\n\n        self.needs_frame_exception_preserve = False\n\n    def isStatementsFrame(self):\n        return True\n\n    def getDetails(self):\n        result = {\"code_object\": self.code_object}\n\n        result.update(StatementsSequence.getDetails(self))\n\n        return result\n\n    def getDetailsForDisplay(self):\n        result = StatementsSequence.getDetails(self)\n        result.update()\n\n        result.update(self.code_object.getDetails())\n\n        return result\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        code_object_args = {}\n        other_args = {}\n\n        for key, value in args.items():\n            if key.startswith(\"co_\"):\n                code_object_args[key] = value\n            elif key == \"code_flags\":\n                code_object_args[\"future_spec\"] = fromFlags(args[\"code_flags\"])\n            else:\n                other_args[key] = value\n\n        code_object = CodeObjectSpec(**code_object_args)\n\n        return cls(code_object=code_object, source_ref=source_ref, **other_args)\n\n    def getGuardMode(self):\n        provider = self.getParentVariableProvider()\n\n        while provider.isExpressionClassBodyBase():\n            provider = provider.getParentVariableProvider()\n\n        if provider.isCompiledPythonModule():\n            return \"once\"\n        else:\n            return \"full\"\n\n        return self.guard_mode\n\n    @staticmethod\n    def needsExceptionFramePreservation():\n        return True\n\n    def getVarNames(self):\n        return self.code_object.getVarNames()\n\n    def updateLocalNames(self):\n        \"\"\"For use during variable closure phase. Finalize attributes.\"\"\"\n        provider = self.getParentVariableProvider()\n\n        if not provider.isCompiledPythonModule():\n            if (\n                provider.isExpressionGeneratorObjectBody()\n                or provider.isExpressionCoroutineObjectBody()\n                or provider.isExpressionAsyncgenObjectBody()\n            ):\n                closure_provider = provider.getParentVariableProvider()\n            else:\n                closure_provider = provider\n\n            if closure_provider.isExpressionFunctionBody():\n                closure_variables = closure_provider.getClosureVariables()\n            else:\n                closure_variables = ()\n\n            self.code_object.updateLocalNames(\n                [variable.getName() for variable in provider.getLocalVariables()],\n                [\n                    variable.getName()\n                    for variable in closure_variables\n                    if variable.getOwner() is not closure_provider\n                ],\n            )\n\n        entry_point = provider.getEntryPoint()\n\n        is_optimized = (\n            not entry_point.isCompiledPythonModule()\n            and not entry_point.isExpressionClassBodyBase()\n            and not entry_point.isUnoptimized()\n        )\n\n        self.code_object.setFlagIsOptimizedValue(is_optimized)\n\n        new_locals = not provider.isCompiledPythonModule() and (\n            python_version < 0x340\n            or (\n                not provider.isExpressionClassBodyBase()\n                and not provider.isUnoptimized()\n            )\n        )\n\n        self.code_object.setFlagNewLocalsValue(new_locals)\n\n    def markAsFrameExceptionPreserving(self):\n        self.needs_frame_exception_preserve = True\n\n    def needsFrameExceptionPreserving(self):\n        return self.needs_frame_exception_preserve\n\n    def getCodeObject(self):\n        return self.code_object\n\n    def computeStatementsSequence(self, trace_collection):\n        # The extraction of parts of the frame that can be moved before or after\n        # the frame scope, takes it toll to complexity, pylint: disable=too-many-branches\n        new_statements = []\n\n        statements = self.subnode_statements\n\n        for count, statement in enumerate(statements):\n            # May be frames embedded.\n            if statement.isStatementsFrame():\n                new_statement = statement.computeStatementsSequence(\n                    trace_collection=trace_collection\n                )\n            else:\n                new_statement = trace_collection.onStatement(statement=statement)\n\n            if new_statement is not None:\n                if (\n                    new_statement.isStatementsSequence()\n                    and not new_statement.isStatementsFrame()\n                ):\n                    new_statements.extend(new_statement.subnode_statements)\n                else:\n                    new_statements.append(new_statement)\n\n                if (\n                    statement is not statements[-1]\n                    and new_statement.isStatementAborting()\n                ):\n                    trace_collection.signalChange(\n                        \"new_statements\",\n                        statements[count + 1].getSourceReference(),\n                        \"Removed dead statements.\",\n                    )\n\n                    break\n\n        if not new_statements:\n            trace_collection.signalChange(\n                \"new_statements\",\n                self.source_ref,\n                \"Removed empty frame object of '%s'.\"\n                % self.code_object.getCodeObjectName(),\n            )\n\n            return None\n\n        # TODO: It might be worth to do the step that is done when nothing\n        # changes in one go, avoiding the 2 micro passes here.\n\n        # If our statements changed just now, they are not immediately usable,\n        # so do this in two steps. Next time we can reduce the frame scope just\n        # as well.\n        new_statements_tuple = tuple(new_statements)\n        if statements != new_statements_tuple:\n            self.setChildStatements(new_statements_tuple)\n            return self\n\n        # Determine statements inside the frame, that need not be in a frame,\n        # because they wouldn't raise an exception.\n        outside_pre = []\n        while new_statements and not new_statements[0].needsFrame():\n            outside_pre.append(new_statements[0])\n            del new_statements[0]\n\n        outside_post = []\n        while new_statements and not new_statements[-1].needsFrame():\n            outside_post.insert(0, new_statements[-1])\n            del new_statements[-1]\n\n        if outside_pre or outside_post:\n            from .NodeMakingHelpers import (\n                makeStatementsSequenceReplacementNode,\n            )\n\n            if new_statements:\n                self.setChildStatements(tuple(new_statements))\n\n                return makeStatementsSequenceReplacementNode(\n                    statements=outside_pre + [self] + outside_post, node=self\n                )\n            else:\n                trace_collection.signalChange(\n                    \"new_statements\",\n                    self.source_ref,\n                    \"Removed useless frame object of '%s'.\"\n                    % self.code_object.getCodeObjectName(),\n                )\n\n                return makeStatementsSequenceReplacementNode(\n                    statements=outside_pre + outside_post, node=self\n                )\n        else:\n            if statements != new_statements:\n                self.setChildStatements(tuple(new_statements))\n\n            return self\n\n    @abstractmethod\n    def hasStructureMember(self):\n        \"\"\"Does the frame have a structure associated, like e.g. generator objects need.\"\"\"\n\n    def getStructureMember(self):\n        \"\"\"Get the frame structure member code name, generator, coroutine, asyncgen.\"\"\"\n        assert not self.hasStructureMember()\n\n        return None\n\n\nclass StatementsFrameModule(StatementsFrameBase):\n    kind = \"STATEMENTS_FRAME_MODULE\"\n\n    def __init__(self, statements, code_object, source_ref):\n        StatementsFrameBase.__init__(\n            self,\n            statements=statements,\n            code_object=code_object,\n            source_ref=source_ref,\n        )\n\n    @staticmethod\n    def hasStructureMember():\n        return False\n\n\nclass StatementsFrameFunction(StatementsFrameBase):\n    kind = \"STATEMENTS_FRAME_FUNCTION\"\n\n    def __init__(self, statements, code_object, source_ref):\n        StatementsFrameBase.__init__(\n            self,\n            statements=statements,\n            code_object=code_object,\n            source_ref=source_ref,\n        )\n\n    @staticmethod\n    def hasStructureMember():\n        return False\n\n\nclass StatementsFrameClass(StatementsFrameBase):\n    kind = \"STATEMENTS_FRAME_CLASS\"\n\n    __slots__ = (\"locals_scope\",)\n\n    def __init__(self, statements, code_object, locals_scope, source_ref):\n        StatementsFrameBase.__init__(\n            self,\n            statements=statements,\n            code_object=code_object,\n            source_ref=source_ref,\n        )\n\n        self.locals_scope = locals_scope\n\n    @staticmethod\n    def hasStructureMember():\n        return False\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n\nclass StatementsFrameGeneratorBase(StatementsFrameBase):\n    def __init__(self, statements, code_object, source_ref):\n        StatementsFrameBase.__init__(\n            self,\n            statements=statements,\n            code_object=code_object,\n            source_ref=source_ref,\n        )\n\n    @staticmethod\n    def getGuardMode():\n        # TODO: Can the \"once\" code be made usable for it.\n        return \"generator\"\n\n    @staticmethod\n    def hasStructureMember():\n        return True\n\n\nclass StatementsFrameGenerator(StatementsFrameGeneratorBase):\n    kind = \"STATEMENTS_FRAME_GENERATOR\"\n\n    if python_version < 0x300:\n\n        @staticmethod\n        def needsExceptionFramePreservation():\n            return False\n\n    @staticmethod\n    def getStructureMember():\n        return \"generator\"\n\n\nclass StatementsFrameCoroutine(StatementsFrameGeneratorBase):\n    kind = \"STATEMENTS_FRAME_COROUTINE\"\n\n    python_version_spec = \">= 0x350\"\n\n    @staticmethod\n    def getStructureMember():\n        return \"coroutine\"\n\n\nclass StatementsFrameAsyncgen(StatementsFrameGeneratorBase):\n    kind = \"STATEMENTS_FRAME_ASYNCGEN\"\n\n    python_version_spec = \">= 0x360\"\n\n    @staticmethod\n    def getStructureMember():\n        return \"asyncgen\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/FunctionAttributeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Function attribute nodes\n\nThe represent special values of the modules. The \"__qualname__\" value node\nis intended and to be resolved later. And the function output for error\nmessages, is also dynamic.\n\nThese nodes are intended to allow for as much compile time optimization as\npossible, despite this difficulty. In some modes these node become constants\nquickly, in others they will present boundaries for optimization.\n\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingValueMixin\nfrom .ExpressionBases import CompileTimeConstantExpressionBase, ExpressionBase\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import makeConstantReplacementNode\n\n\nclass ExpressionFunctionQualnameRef(CompileTimeConstantExpressionBase):\n    \"\"\"Node for value __qualname__ of function or class.\n\n    Notes:\n        This is for Python 3.4 and higher only, where classes calculate the __qualname__\n        value at runtime, then it's determined dynamically, while 3.3 set it more\n        statically, and Python2 didn't have this feature at all.\n    \"\"\"\n\n    kind = \"EXPRESSION_FUNCTION_QUALNAME_REF\"\n\n    __slots__ = (\"function_body\",)\n\n    def __init__(self, function_body, source_ref):\n        CompileTimeConstantExpressionBase.__init__(self, source_ref)\n\n        self.function_body = function_body\n\n    def finalize(self):\n        del self.parent\n        del self.function_body\n\n    def computeExpressionRaw(self, trace_collection):\n        result = makeConstantReplacementNode(\n            node=self,\n            constant=self.function_body.getFunctionQualname(),\n            user_provided=True,\n        )\n\n        return (\n            result,\n            \"new_constant\",\n            \"Executed '__qualname__' resolution to '%s'.\"\n            % self.function_body.getFunctionQualname(),\n        )\n\n    def getCompileTimeConstant(self):\n        return self.function_body.getFunctionQualname()\n\n\nclass ExpressionFunctionErrorStr(\n    SideEffectsFromChildrenMixin, ChildHavingValueMixin, ExpressionBase\n):\n    \"\"\"Node for value \"_PyObject_FunctionStr\" C-API of function or callable in general.\n\n    Notes:\n        This is for Python 3.9 and higher only, where functions have their module\n        added to the \"__qualname__\" value at runtime.\n    \"\"\"\n\n    kind = \"EXPRESSION_FUNCTION_ERROR_STR\"\n\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Could compile time compute these for concrete functions.\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/FunctionNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for functions and their creations.\n\nLambdas are functions too. The functions are at the core of the language and\nhave their complexities.\n\nCreating a CPython function object is an optional thing. Some things might\nonly be used to be called directly, while knowing exactly what it is. So\nthe \"ExpressionFunctionCreation\" might be used to provide that kind of\nCPython reference, and may escape.\n\nCoroutines and generators live in their dedicated module and share base\nclasses.\n\"\"\"\n\nimport inspect\nimport re\n\nfrom nuitka import Options, Variables\nfrom nuitka.Constants import isMutable\nfrom nuitka.optimizations.TraceCollections import (\n    TraceCollectionPureFunction,\n    withChangeIndicationsTo,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.ParameterSpecs import (\n    ParameterSpec,\n    TooManyArguments,\n    matchCall,\n)\nfrom nuitka.Tracing import optimization_logger, printError\nfrom nuitka.tree.Extractions import updateVariableUsage\nfrom nuitka.tree.SourceHandling import readSourceLines\nfrom nuitka.tree.TreeHelpers import makeDictCreationOrConstant2\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingBodyOptionalMixin,\n    ChildrenHavingDefaultsTupleKwDefaultsOptionalAnnotationsOptionalFunctionRefMixin,\n    ChildrenHavingFunctionValuesTupleMixin,\n    ChildrenHavingKwDefaultsOptionalDefaultsTupleAnnotationsOptionalFunctionRefMixin,\n)\nfrom .CodeObjectSpecs import CodeObjectSpec\nfrom .ContainerMakingNodes import makeExpressionMakeTupleOrConstant\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .FutureSpecs import fromFlags\nfrom .IndicatorMixins import (\n    EntryPointMixin,\n    MarkUnoptimizedFunctionIndicatorMixin,\n)\nfrom .LocalsScopes import getLocalsDictHandle\nfrom .NodeBases import (\n    ClosureGiverNodeMixin,\n    ClosureTakerMixin,\n    SideEffectsFromChildrenMixin,\n)\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionReplacementExpressionFromInstance,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_function\n\n\nclass MaybeLocalVariableUsage(Exception):\n    pass\n\n\nclass ExpressionFunctionBodyBase(\n    ClosureTakerMixin,\n    ClosureGiverNodeMixin,\n    ChildHavingBodyOptionalMixin,\n    ExpressionBase,\n):\n    # TODO: The code_prefix should be a class attribute instead.\n    __slots__ = (\n        \"provider\",\n        \"taken\",\n        \"name\",\n        \"code_prefix\",\n        \"code_name\",\n        \"uids\",\n        \"temp_variables\",\n        \"temp_scopes\",\n        \"preserver_id\",\n        \"flags\",\n    )\n\n    if python_version >= 0x340:\n        __slots__ += (\"qualname_provider\",)\n\n    if python_version >= 0x300:\n        __slots__ += (\"non_local_declarations\",)\n\n    # Might be None initially in some cases.\n    named_children = (\"body|optional+setter\",)\n\n    def __init__(self, provider, name, body, code_prefix, flags, source_ref):\n        while provider.isExpressionOutlineBody():\n            provider = provider.getParentVariableProvider()\n\n        ChildHavingBodyOptionalMixin.__init__(\n            self,\n            body=body,\n        )\n\n        ClosureTakerMixin.__init__(self, provider=provider)\n\n        ClosureGiverNodeMixin.__init__(self, name=name, code_prefix=code_prefix)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # Special things, \"has_super\" indicates presence of \"super\" in variable\n        # usage, which modifies some behaviors.\n        self.flags = flags or None\n\n        # Hack: This allows some APIs to work although this is not yet\n        # officially a child yet. Important during building.\n        self.parent = provider\n\n        # Python3.4: Might be overridden by global statement on the class name.\n        # TODO: Make this class only code.\n        if python_version >= 0x340:\n            self.qualname_provider = provider\n\n        # Non-local declarations.\n        if python_version >= 0x300:\n            self.non_local_declarations = None\n\n    @staticmethod\n    def isExpressionFunctionBodyBase():\n        return True\n\n    def getEntryPoint(self):\n        \"\"\"Entry point for code.\n\n        Normally ourselves. Only outlines will refer to their parent which\n        technically owns them.\n\n        \"\"\"\n\n        return self\n\n    def getContainingClassDictCreation(self):\n        current = self\n\n        while not current.isCompiledPythonModule():\n            if current.isExpressionClassBodyBase():\n                return current\n\n            current = current.getParentVariableProvider()\n\n        return None\n\n    def hasFlag(self, flag):\n        return self.flags is not None and flag in self.flags\n\n    def discardFlag(self, flag):\n        if self.flags is not None:\n            self.flags.discard(flag)\n\n    @staticmethod\n    def isEarlyClosure():\n        \"\"\"Early closure taking means immediate binding of references.\n\n        Normally it's good to lookup name references immediately, but not for\n        functions. In case of a function body it is not allowed to do that,\n        because a later assignment needs to be queried first. Nodes need to\n        indicate via this if they would like to resolve references at the same\n        time as assignments.\n        \"\"\"\n\n        return False\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    # TODO: Dubious function doing to distinct things, should be moved to users.\n    def hasVariableName(self, variable_name):\n        return (\n            self.locals_scope.hasProvidedVariable(variable_name)\n            or variable_name in self.temp_variables\n        )\n\n    def getProvidedVariables(self):\n        if self.locals_scope is not None:\n            return self.locals_scope.getProvidedVariables()\n        else:\n            return ()\n\n    def getLocalVariables(self):\n        return [\n            variable\n            for variable in self.getProvidedVariables()\n            if variable.isLocalVariable()\n        ]\n\n    def getUserLocalVariables(self):\n        return [\n            variable\n            for variable in self.getProvidedVariables()\n            if variable.isLocalVariable() and not variable.isParameterVariable()\n            if variable.getOwner() is self\n        ]\n\n    def getOutlineLocalVariables(self):\n        result = []\n\n        outlines = self.getTraceCollection().getOutlineFunctions()\n\n        if outlines is None:\n            return result\n\n        for outline in outlines:\n            result.extend(outline.getUserLocalVariables())\n\n        return result\n\n    def removeClosureVariable(self, variable):\n        # Do not remove parameter variables of ours.\n        assert not variable.isParameterVariable() or variable.getOwner() is not self\n\n        self.locals_scope.unregisterClosureVariable(variable)\n\n        self.taken.remove(variable)\n\n        self.code_object.removeFreeVarname(variable.getName())\n\n    def demoteClosureVariable(self, variable):\n        assert variable.isLocalVariable()\n\n        self.taken.remove(variable)\n\n        assert variable.getOwner() is not self\n\n        new_variable = Variables.LocalVariable(\n            owner=self, variable_name=variable.getName()\n        )\n        for variable_trace in variable.traces:\n            if variable_trace.getOwner() is self:\n                new_variable.addTrace(variable_trace)\n        new_variable.updateUsageState()\n\n        self.locals_scope.unregisterClosureVariable(variable)\n        self.locals_scope.registerProvidedVariable(new_variable)\n\n        updateVariableUsage(\n            provider=self, old_variable=variable, new_variable=new_variable\n        )\n\n    def hasClosureVariable(self, variable):\n        return variable in self.taken\n\n    def getVariableForAssignment(self, variable_name):\n        # print(\"ASS func\", self, variable_name)\n\n        if self.hasTakenVariable(variable_name):\n            result = self.getTakenVariable(variable_name)\n        else:\n            result = self.getProvidedVariable(variable_name)\n\n        return result\n\n    def getVariableForReference(self, variable_name):\n        # print( \"REF func\", self, variable_name )\n\n        if self.hasProvidedVariable(variable_name):\n            result = self.getProvidedVariable(variable_name)\n        else:\n            result = self.getClosureVariable(variable_name=variable_name)\n\n            # Remember that we need that closure variable for something, so\n            # we don't create it again all the time.\n            if not result.isModuleVariable():\n                self.locals_scope.registerClosureVariable(result)\n\n            entry_point = self.getEntryPoint()\n\n            # For \"exec\" containing/star import containing, we raise this exception to indicate\n            # that instead of merely a variable, to be assigned, we need to replace with locals\n            # dict access.\n            if (\n                python_version < 0x300\n                and not entry_point.isExpressionClassBodyBase()\n                and not entry_point.isPythonMainModule()\n                and result.isModuleVariable()\n                and entry_point.isUnoptimized()\n            ):\n                raise MaybeLocalVariableUsage\n\n        return result\n\n    def getVariableForClosure(self, variable_name):\n        # print( \"getVariableForClosure\", self.getCodeName(), variable_name, self.isUnoptimized() )\n\n        if self.hasProvidedVariable(variable_name):\n            return self.getProvidedVariable(variable_name)\n\n        return self.takeVariableForClosure(variable_name)\n\n    def takeVariableForClosure(self, variable_name):\n        result = self.provider.getVariableForClosure(variable_name)\n        self.taken.add(result)\n        return result\n\n    def createProvidedVariable(self, variable_name):\n        # print(\"createProvidedVariable\", self, variable_name)\n\n        assert self.locals_scope, self\n\n        return self.locals_scope.getLocalVariable(\n            variable_name=variable_name, owner=self\n        )\n\n    def addNonlocalsDeclaration(self, names, user_provided, source_ref):\n        \"\"\"Add a nonlocal declared name.\n\n        This happens during tree building, and is a Python3 only\n        feature. We remember the names for later use through the\n        function @consumeNonlocalDeclarations\n        \"\"\"\n        if self.non_local_declarations is None:\n            self.non_local_declarations = []\n\n        self.non_local_declarations.append((names, user_provided, source_ref))\n\n    def consumeNonlocalDeclarations(self):\n        \"\"\"Return the nonlocal declared names for this function.\n\n        There may not be any, which is why we assigned it to\n        None originally and now check and return empty tuple\n        in that case.\n        \"\"\"\n\n        result = self.non_local_declarations or ()\n        self.non_local_declarations = None\n        return result\n\n    def getFunctionName(self):\n        return self.name\n\n    def getFunctionQualname(self):\n        \"\"\"Function __qualname__ new in CPython3.3\n\n        Should contain some kind of full name descriptions for the closure to\n        recognize and will be used for outputs.\n        \"\"\"\n\n        function_name = self.getFunctionName()\n\n        if python_version < 0x340:\n            qualname_provider = self.getParentVariableProvider()\n        else:\n            qualname_provider = self.qualname_provider\n\n        return qualname_provider.getChildQualname(function_name)\n\n    def computeExpression(self, trace_collection):\n        assert False\n\n        # Function body is quite irreplaceable.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        body = self.subnode_body\n\n        if body is None:\n            return False\n        else:\n            return self.subnode_body.mayRaiseException(exception_type)\n\n    def getFunctionInlineCost(self, values):\n        \"\"\"Cost of inlining this function with given arguments\n\n        Returns: None or integer values, None means don't do it.\n        \"\"\"\n\n        # For overload, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def optimizeUnusedClosureVariables(self):\n        \"\"\"Gets called once module is complete, to consider giving up on closure variables.\"\"\"\n\n        changed = False\n\n        for closure_variable in self.getClosureVariables():\n            # Need to take closure of those either way\n            if (\n                closure_variable.isParameterVariable()\n                and self.isExpressionGeneratorObjectBody()\n            ):\n                continue\n\n            empty = self.trace_collection.hasEmptyTraces(closure_variable)\n\n            if empty:\n                changed = True\n\n                self.trace_collection.signalChange(\n                    \"var_usage\",\n                    self.source_ref,\n                    message=\"Remove unused closure variable '%s'.\"\n                    % closure_variable.getName(),\n                )\n\n                self.removeClosureVariable(closure_variable)\n\n        return changed\n\n    def optimizeVariableReleases(self):\n        for parameter_variable in self.getParameterVariablesWithManualRelease():\n            read_only = self.trace_collection.hasReadOnlyTraces(parameter_variable)\n\n            if read_only:\n                self.trace_collection.signalChange(\n                    \"var_usage\",\n                    self.source_ref,\n                    message=\"Schedule removal releases of unassigned parameter variable '%s'.\"\n                    % parameter_variable.getName(),\n                )\n\n                self.removeVariableReleases(parameter_variable)\n\n\nclass ExpressionFunctionEntryPointBase(EntryPointMixin, ExpressionFunctionBodyBase):\n    __slots__ = (\"trace_collection\", \"code_object\", \"locals_scope\", \"auto_release\")\n\n    def __init__(\n        self, provider, name, code_object, code_prefix, flags, auto_release, source_ref\n    ):\n        ExpressionFunctionBodyBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_prefix=code_prefix,\n            flags=flags,\n            body=None,\n            source_ref=source_ref,\n        )\n\n        EntryPointMixin.__init__(self)\n\n        self.code_object = code_object\n\n        provider.getParentModule().addFunction(self)\n\n        if flags is not None and \"has_exec\" in flags:\n            locals_kind = \"python2_function_exec\"\n        else:\n            locals_kind = \"python_function\"\n\n        self.locals_scope = getLocalsDictHandle(\n            \"locals_%s\" % self.getCodeName(), locals_kind, self\n        )\n\n        # Automatic parameter variable releases.\n        self.auto_release = auto_release or None\n\n    def getDetails(self):\n        result = ExpressionFunctionBodyBase.getDetails(self)\n\n        result[\"auto_release\"] = tuple(sorted(self.auto_release or ()))\n\n        return result\n\n    def getCodeObject(self):\n        return self.code_object\n\n    def getChildQualname(self, function_name):\n        return self.getFunctionQualname() + \".<locals>.\" + function_name\n\n    def computeFunctionRaw(self, trace_collection):\n        from nuitka.optimizations.TraceCollections import (\n            TraceCollectionFunction,\n        )\n\n        trace_collection = TraceCollectionFunction(\n            parent=trace_collection, function_body=self\n        )\n        old_collection = self.setTraceCollection(trace_collection)\n\n        self.computeFunction(trace_collection)\n\n        trace_collection.updateVariablesFromCollection(old_collection, self.source_ref)\n\n    def computeFunction(self, trace_collection):\n        statements_sequence = self.subnode_body\n\n        # TODO: Lift this restriction to only functions here and it code generation.\n        if statements_sequence is not None and self.isExpressionFunctionBody():\n            if statements_sequence.subnode_statements[0].isStatementReturnNone():\n                statements_sequence.finalize()\n                self.setChildBody(None)\n\n                statements_sequence = None\n\n        if statements_sequence is not None:\n            result = statements_sequence.computeStatementsSequence(\n                trace_collection=trace_collection\n            )\n\n            if result is not statements_sequence:\n                self.setChildBody(result)\n\n    def removeVariableReleases(self, variable):\n        assert variable in self.locals_scope.providing.values(), (self, variable)\n\n        if self.auto_release is None:\n            self.auto_release = set()\n\n        self.auto_release.add(variable)\n\n    def getParameterVariablesWithManualRelease(self):\n        \"\"\"Return the list of parameter variables that have release statements.\n\n        These are for consideration if these can be dropped, and if so, they\n        are releases automatically by function code.\n        \"\"\"\n        return tuple(\n            variable\n            for variable in self.locals_scope.getProvidedVariables()\n            if not self.auto_release or variable not in self.auto_release\n            if variable.isParameterVariable()\n            if variable.getOwner() is self\n        )\n\n    def isAutoReleaseVariable(self, variable):\n        \"\"\"Is this variable to be automatically released.\"\"\"\n        return self.auto_release is not None and variable in self.auto_release\n\n    def getFunctionVariablesWithAutoReleases(self):\n        \"\"\"Return the list of function variables that should be released at exit.\"\"\"\n        if self.auto_release is None:\n            return ()\n\n        return tuple(\n            variable\n            for variable in self.locals_scope.getProvidedVariables()\n            if variable in self.auto_release\n        )\n\n    @staticmethod\n    def getConstantReturnValue():\n        \"\"\"Special function that checks if code generation allows to use common C code.\n\n        Notes:\n            This is only done for standard functions.\n\n        \"\"\"\n        return False, False\n\n\nclass ExpressionFunctionBody(\n    ExpressionNoSideEffectsMixin,\n    MarkUnoptimizedFunctionIndicatorMixin,\n    ExpressionFunctionEntryPointBase,\n):\n    # TODO: There should be more special ones than this general type in order to\n    # not cover exec ones in the same object.\n\n    kind = \"EXPRESSION_FUNCTION_BODY\"\n\n    __slots__ = (\n        \"unoptimized_locals\",\n        \"unqualified_exec\",\n        \"doc\",\n        \"return_exception\",\n        \"needs_creation\",\n        \"needs_direct\",\n        \"cross_module_use\",\n        \"parameters\",\n    )\n\n    if python_version >= 0x340:\n        __slots__ += (\"qualname_setup\",)\n\n    def __init__(\n        self,\n        provider,\n        name,\n        code_object,\n        doc,\n        parameters,\n        flags,\n        auto_release,\n        source_ref,\n    ):\n        ExpressionFunctionEntryPointBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_object=code_object,\n            code_prefix=\"function\",\n            flags=flags,\n            auto_release=auto_release,\n            source_ref=source_ref,\n        )\n\n        MarkUnoptimizedFunctionIndicatorMixin.__init__(self, flags)\n\n        self.doc = doc\n\n        # Indicator if the return value exception might be required.\n        self.return_exception = False\n\n        # Indicator if the function needs to be created as a function object.\n        self.needs_creation = False\n\n        # Indicator if the function is called directly.\n        self.needs_direct = False\n\n        # Indicator if the function is used outside of where it's defined.\n        self.cross_module_use = False\n\n        if python_version >= 0x340:\n            self.qualname_setup = None\n\n        self.parameters = parameters\n        self.parameters.setOwner(self)\n\n        for variable in self.parameters.getAllVariables():\n            self.locals_scope.registerProvidedVariable(variable)\n\n    def getDetails(self):\n        return {\n            \"name\": self.getFunctionName(),\n            \"ref_name\": self.getCodeName(),\n            \"parameters\": self.getParameters(),\n            \"code_object\": self.code_object,\n            \"provider\": self.provider.getCodeName(),\n            \"doc\": self.doc,\n            \"flags\": self.flags,\n        }\n\n    def getDetailsForDisplay(self):\n        result = {\n            \"name\": self.getFunctionName(),\n            \"provider\": self.provider.getCodeName(),\n            \"flags\": self.flags,\n        }\n\n        result.update(self.parameters.getDetails())\n\n        if self.code_object:\n            result.update(self.code_object.getDetails())\n\n        if self.doc is not None:\n            result[\"doc\"] = self.doc\n\n        return result\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        assert provider is not None\n\n        parameter_spec_args = {}\n        code_object_args = {}\n        other_args = {}\n\n        for key, value in args.items():\n            if key.startswith(\"ps_\"):\n                parameter_spec_args[key] = value\n            elif key.startswith(\"co_\"):\n                code_object_args[key] = value\n            elif key == \"code_flags\":\n                code_object_args[\"future_spec\"] = fromFlags(args[\"code_flags\"])\n            else:\n                other_args[key] = value\n\n        parameters = ParameterSpec(**parameter_spec_args)\n        code_object = CodeObjectSpec(**code_object_args)\n\n        # The empty doc string and no doc string are distinguished by presence. The\n        # most common case is going to be not present.\n        if \"doc\" not in other_args:\n            other_args[\"doc\"] = None\n\n        return cls(\n            provider=provider,\n            parameters=parameters,\n            code_object=code_object,\n            source_ref=source_ref,\n            **other_args\n        )\n\n    @staticmethod\n    def isExpressionFunctionBody():\n        return True\n\n    def getParent(self):\n        assert False\n\n    def getDoc(self):\n        return self.doc\n\n    def getParameters(self):\n        return self.parameters\n\n    def needsCreation(self):\n        return self.needs_creation\n\n    def markAsNeedsCreation(self):\n        self.needs_creation = True\n\n    def needsDirectCall(self):\n        return self.needs_direct\n\n    def markAsDirectlyCalled(self):\n        self.needs_direct = True\n\n    def isCrossModuleUsed(self):\n        return self.cross_module_use\n\n    def markAsCrossModuleUsed(self):\n        self.cross_module_use = True\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # TODO: Until we have something to re-order the arguments, we need to\n        # skip this. For the immediate need, we avoid this complexity, as a\n        # re-ordering will be needed.\n\n        assert False, self\n\n    @staticmethod\n    def isCompileTimeConstant():\n        # TODO: It's actually pretty much compile time accessible maybe, but that\n        # would require extra effort.\n        return False\n\n    # TODO: This is an overload that contradicts no side effects, this might be\n    # used by outside code, not removed, but we should investigate this.\n    def mayRaiseException(self, exception_type):\n        body = self.subnode_body\n\n        return body is not None and body.mayRaiseException(exception_type)\n\n    def markAsExceptionReturnValue(self):\n        self.return_exception = True\n\n    def needsExceptionReturnValue(self):\n        return self.return_exception\n\n    def getConstantReturnValue(self):\n        \"\"\"Special function that checks if code generation allows to use common C code.\"\"\"\n        body = self.subnode_body\n\n        if body is None:\n            return True, None\n\n        first_statement = body.subnode_statements[0]\n\n        if first_statement.isStatementReturnConstant():\n            constant_value = first_statement.getConstant()\n\n            # TODO: For mutable constants, we could also have something, but it would require an indicator\n            # flag to make a deep copy.\n            if not isMutable(constant_value):\n                return True, constant_value\n            else:\n                return False, False\n        else:\n            return False, False\n\n\nclass ExpressionFunctionPureBody(ExpressionFunctionBody):\n    kind = \"EXPRESSION_FUNCTION_PURE_BODY\"\n\n    __slots__ = (\n        # These need only one optimization ever.\n        \"optimization_done\",\n    )\n\n    def __init__(\n        self,\n        provider,\n        name,\n        code_object,\n        doc,\n        parameters,\n        flags,\n        auto_release,\n        source_ref,\n    ):\n        ExpressionFunctionBody.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_object=code_object,\n            doc=doc,\n            parameters=parameters,\n            flags=flags,\n            auto_release=auto_release,\n            source_ref=source_ref,\n        )\n\n        self.optimization_done = False\n\n    def computeFunctionRaw(self, trace_collection):\n        if self.optimization_done:\n            for function_body in self.trace_collection.getUsedFunctions():\n                trace_collection.onUsedFunction(function_body)\n\n            return\n\n        def mySignal(tag, source_ref, change_desc):\n            if Options.is_verbose:\n                optimization_logger.info(\n                    \"{source_ref} : {tags} : {message}\".format(\n                        source_ref=source_ref.getAsString(),\n                        tags=tag,\n                        message=(\n                            change_desc()\n                            if inspect.isfunction(change_desc)\n                            else change_desc\n                        ),\n                    )\n                )\n\n            tags.add(tag)\n\n        tags = set()\n\n        while 1:\n            trace_collection = TraceCollectionPureFunction(function_body=self)\n            old_collection = self.setTraceCollection(trace_collection)\n\n            with withChangeIndicationsTo(mySignal):\n                self.computeFunction(trace_collection)\n\n            trace_collection.updateVariablesFromCollection(\n                old_collection, self.source_ref\n            )\n\n            if tags:\n                tags.clear()\n            else:\n                break\n\n        self.optimization_done = True\n\n\nclass ExpressionFunctionPureInlineConstBody(ExpressionFunctionBody):\n    kind = \"EXPRESSION_FUNCTION_PURE_INLINE_CONST_BODY\"\n\n    def getFunctionInlineCost(self, values):\n        return 0\n\n\n# TODO: Function direct call node ought to be here too.\n\n\ndef makeExpressionFunctionCreation(\n    function_ref, defaults, kw_defaults, annotations, source_ref\n):\n    if kw_defaults is not None and kw_defaults.isExpressionConstantDictEmptyRef():\n        kw_defaults = None\n\n    assert function_ref.isExpressionFunctionRef()\n\n    return ExpressionFunctionCreation(\n        function_ref=function_ref,\n        defaults=defaults,\n        kw_defaults=kw_defaults,\n        annotations=annotations,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionFunctionCreationMixin(SideEffectsFromChildrenMixin):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    @staticmethod\n    def isExpressionFunctionCreation():\n        return True\n\n    def getName(self):\n        return self.subnode_function_ref.getName()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_function\n\n    def computeExpression(self, trace_collection):\n        self.variable_closure_traces = []\n\n        for (\n            closure_variable\n        ) in self.subnode_function_ref.getFunctionBody().getClosureVariables():\n            trace = trace_collection.getVariableCurrentTrace(closure_variable)\n            trace.addNameUsage()\n\n            self.variable_closure_traces.append((closure_variable, trace))\n\n        kw_defaults = self.subnode_kw_defaults\n        if kw_defaults is not None:\n            kw_defaults.onContentEscapes(trace_collection)\n\n        for default in self.subnode_defaults:\n            default.onContentEscapes(trace_collection)\n\n        # TODO: Function body may know something too.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        for default in self.subnode_defaults:\n            if default.mayRaiseException(exception_type):\n                return True\n\n        kw_defaults = self.subnode_kw_defaults\n\n        if kw_defaults is not None and kw_defaults.mayRaiseException(exception_type):\n            return True\n\n        annotations = self.subnode_annotations\n\n        if annotations is not None and annotations.mayRaiseException(exception_type):\n            return True\n\n        return False\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Until we have something to re-order the keyword arguments, we\n        # need to skip this. For the immediate need, we avoid this complexity,\n        # as a re-ordering will be needed.\n        if call_kw is not None and not call_kw.isExpressionConstantDictEmptyRef():\n            return call_node, None, None\n\n        if call_args is None:\n            args_tuple = ()\n        else:\n            assert (\n                call_args.isExpressionConstantTupleRef()\n                or call_args.isExpressionMakeTuple()\n            )\n\n            args_tuple = call_args.getIterationValues()\n\n        function_body = self.subnode_function_ref.getFunctionBody()\n\n        # TODO: Actually the above disables it entirely, as it is at least\n        # the empty dictionary node in any case. We will need some enhanced\n        # interfaces for \"matchCall\" to work on.\n\n        call_spec = function_body.getParameters()\n\n        try:\n            args_dict = matchCall(\n                func_name=self.getName(),\n                args=call_spec.getArgumentNames(),\n                kw_only_args=call_spec.getKwOnlyParameterNames(),\n                star_list_arg=call_spec.getStarListArgumentName(),\n                star_dict_arg=call_spec.getStarDictArgumentName(),\n                star_list_single_arg=False,\n                num_defaults=call_spec.getDefaultCount(),\n                num_pos_only=call_spec.getPosOnlyParameterCount(),\n                positional=args_tuple,\n                pairs=(),\n            )\n\n            values = [args_dict[name] for name in call_spec.getParameterNames()]\n\n            # TODO: Not handling default values either yet.\n            if None in values:\n                return call_node, None, None\n\n            # TODO: This is probably something that the matchCall ought to do\n            # for us, but that will need cleanups. Also these functions and\n            # nodes ought to work with ordered dictionaries maybe.\n            if call_spec.getStarDictArgumentName():\n                values[-1] = makeDictCreationOrConstant2(\n                    keys=[value[0] for value in values[-1]],\n                    values=[value[1] for value in values[-1]],\n                    source_ref=call_node.source_ref,\n                )\n\n                star_list_offset = -2\n            else:\n                star_list_offset = -1\n\n            if call_spec.getStarListArgumentName():\n                values[star_list_offset] = makeExpressionMakeTupleOrConstant(\n                    elements=values[star_list_offset],\n                    user_provided=False,\n                    source_ref=call_node.source_ref,\n                )\n\n            result = makeExpressionFunctionCall(\n                function=self.makeClone(),\n                values=values,\n                source_ref=call_node.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",  # TODO: More appropriate tag maybe.\n                \"\"\"\\\nReplaced call to created function body '%s' with direct function call.\"\"\"\n                % self.getName(),\n            )\n\n        except TooManyArguments as e:\n            result = wrapExpressionWithSideEffects(\n                new_node=makeRaiseExceptionReplacementExpressionFromInstance(\n                    expression=call_node, exception=e.getRealException()\n                ),\n                old_node=call_node,\n                side_effects=call_node.extractSideEffectsPreCall(),\n            )\n\n            return (\n                result,\n                \"new_raise\",  # TODO: More appropriate tag maybe.\n                \"\"\"Replaced call to created function body '%s' to argument \\\nerror\"\"\"\n                % self.getName(),\n            )\n\n    def getClosureVariableVersions(self):\n        return self.variable_closure_traces\n\n\nclass ExpressionFunctionCreationOld(\n    ExpressionFunctionCreationMixin,\n    ChildrenHavingKwDefaultsOptionalDefaultsTupleAnnotationsOptionalFunctionRefMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_FUNCTION_CREATION_OLD\"\n\n    python_version_spec = \"< 0x340\"\n    # Note: The order of evaluation for these is a bit unexpected, but\n    # true. Keyword defaults go first, then normal defaults, and annotations of\n    # all kinds go last.\n\n    # A bug of CPython3.x was not fixed before version 3.4, this is to allow\n    # code generation to detect which one is used. bugs.python.org/issue16967\n    kw_defaults_before_defaults = True\n\n    named_children = (\n        \"kw_defaults|optional\",\n        \"defaults|tuple\",\n        \"annotations|optional\",\n        \"function_ref\",\n    )\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    def __init__(self, kw_defaults, defaults, annotations, function_ref, source_ref):\n        ChildrenHavingKwDefaultsOptionalDefaultsTupleAnnotationsOptionalFunctionRefMixin.__init__(\n            self,\n            kw_defaults=kw_defaults,\n            defaults=defaults,\n            annotations=annotations,\n            function_ref=function_ref,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = None\n\n\nclass ExpressionFunctionCreation(\n    ExpressionFunctionCreationMixin,\n    ChildrenHavingDefaultsTupleKwDefaultsOptionalAnnotationsOptionalFunctionRefMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_FUNCTION_CREATION\"\n\n    python_version_spec = \">= 0x340\"\n\n    # A bug of CPython3.x was not fixed before version 3.4, this is to allow\n    # code generation to detect which one is used. bugs.python.org/issue16967\n    kw_defaults_before_defaults = False\n\n    named_children = (\n        \"defaults|tuple\",\n        \"kw_defaults|optional\",\n        \"annotations|optional\",\n        \"function_ref\",\n    )\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    def __init__(self, defaults, kw_defaults, annotations, function_ref, source_ref):\n        ChildrenHavingDefaultsTupleKwDefaultsOptionalAnnotationsOptionalFunctionRefMixin.__init__(\n            self,\n            kw_defaults=kw_defaults,\n            defaults=defaults,\n            annotations=annotations,\n            function_ref=function_ref,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = None\n\n\nif python_version < 0x340:\n    ExpressionFunctionCreation = ExpressionFunctionCreationOld\n\n\nclass ExpressionFunctionRef(ExpressionNoSideEffectsMixin, ExpressionBase):\n    kind = \"EXPRESSION_FUNCTION_REF\"\n\n    __slots__ = \"function_body\", \"code_name\", \"function_source\"\n\n    def __init__(self, source_ref, function_body=None, code_name=None):\n        assert function_body is not None or code_name is not None\n        assert code_name != \"None\"\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.function_body = function_body\n        self.code_name = code_name\n        self.function_source = None\n\n    def finalize(self):\n        del self.parent\n        del self.function_body\n        del self.function_source\n\n    def getName(self):\n        return self.function_body.getName()\n\n    def getDetails(self):\n        return {\"function_body\": self.function_body}\n\n    def getDetailsForDisplay(self):\n        return {\"code_name\": self.getFunctionBody().getCodeName()}\n\n    def getFunctionBody(self):\n        if self.function_body is None:\n            module_code_name, _ = self.code_name.split(\"$$$\", 1)\n\n            from nuitka.ModuleRegistry import getModuleFromCodeName\n\n            module = getModuleFromCodeName(module_code_name)\n\n            self.function_body = module.getFunctionFromCodeName(self.code_name)\n\n        return self.function_body\n\n    def computeExpressionRaw(self, trace_collection):\n        trace_collection.onUsedFunction(self.getFunctionBody())\n\n        # TODO: Function after collection may now know something.\n        return self, None, None\n\n    def getFunctionSourceCode(self):\n        if self.function_source is None:\n            try:\n                lines = readSourceLines(self.getFunctionBody().source_ref)\n\n                # This needs to match \"inspect.findsource\".\n                pat = re.compile(\n                    r\"^(\\s*def\\s)|(\\s*async\\s+def\\s)|(.*(?<!\\w)lambda(:|\\s))|^(\\s*@)\"\n                )\n\n                line_number = self.source_ref.line - 1\n\n                while line_number > 0:\n                    line = lines[line_number]\n\n                    if pat.match(line):\n                        break\n\n                    line_number = line_number - 1\n\n                self.function_source = (\n                    \"\".join(inspect.getblock(lines[line_number:])),\n                    line_number,\n                )\n            except Exception:\n                printError(\n                    \"Problem with retrieving source code of '%s' at %s\"\n                    % (self.getFunctionSuperQualifiedName(), self.source_ref)\n                )\n                raise\n\n        return self.function_source\n\n    def getFunctionSuperQualifiedName(self):\n        return \"%s.%s\" % (\n            self.getParentModule().getFullName(),\n            self.getFunctionBody().getFunctionQualname(),\n        )\n\n\ndef makeExpressionFunctionCall(function, values, source_ref):\n    assert function.isExpressionFunctionCreation()\n\n    return ExpressionFunctionCall(\n        function=function, values=tuple(values), source_ref=source_ref\n    )\n\n\nclass ExpressionFunctionCall(ChildrenHavingFunctionValuesTupleMixin, ExpressionBase):\n    \"\"\"Shared function call.\n\n    This is for calling created function bodies with multiple users. Not\n    clear if such a thing should exist. But what this will do is to have\n    respect for the fact that there are multiple such calls.\n    \"\"\"\n\n    kind = \"EXPRESSION_FUNCTION_CALL\"\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    named_children = (\"function\", \"values|tuple\")\n\n    def __init__(self, function, values, source_ref):\n        ChildrenHavingFunctionValuesTupleMixin.__init__(\n            self,\n            function=function,\n            values=values,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = None\n\n    def computeExpression(self, trace_collection):\n        function = self.subnode_function\n        function_body = function.subnode_function_ref.getFunctionBody()\n\n        if function_body.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        values = self.subnode_values\n\n        # Ask for function for its cost.\n        cost = function_body.getFunctionInlineCost(values)\n\n        if cost is not None and cost < 50:\n            from nuitka.optimizations.FunctionInlining import (\n                convertFunctionCallToOutline,\n            )\n\n            result = convertFunctionCallToOutline(\n                provider=self.getParentVariableProvider(),\n                function_body=function_body,\n                values=values,\n                call_source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                lambda: \"Function call to '%s' in-lined.\" % function_body.getCodeName(),\n            )\n\n        self.variable_closure_traces = []\n\n        for closure_variable in function_body.getClosureVariables():\n            trace = trace_collection.getVariableCurrentTrace(closure_variable)\n            trace.addNameUsage()\n\n            self.variable_closure_traces.append((closure_variable, trace))\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        function = self.subnode_function\n\n        if function.subnode_function_ref.getFunctionBody().mayRaiseException(\n            exception_type\n        ):\n            return True\n\n        values = self.subnode_values\n\n        for value in values:\n            if value.mayRaiseException(exception_type):\n                return True\n\n        return False\n\n    def getClosureVariableVersions(self):\n        return self.variable_closure_traces\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/FutureSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Specification record for future flags.\n\nA source reference also implies a specific set of future flags in use by the\nparser at that location. Can be different inside a module due to e.g. the\nin-lining of \"exec\" statements with their own future imports, or in-lining of\ncode from other modules.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\n\n# These defaults have changed with Python versions.\n_future_division_default = python_version >= 0x300\n_future_absolute_import_default = python_version >= 0x300\n_future_generator_stop_default = python_version >= 0x370\n_future_annotations_default = python_version >= 0x400\n\n\nclass FutureSpec(object):\n    __slots__ = (\n        \"future_division\",\n        \"unicode_literals\",\n        \"absolute_import\",\n        \"future_print\",\n        \"barry_bdfl\",\n        \"generator_stop\",\n        \"future_annotations\",\n    )\n\n    @counted_init\n    def __init__(self):\n        self.future_division = _future_division_default\n        self.unicode_literals = False\n        self.absolute_import = _future_absolute_import_default\n        self.future_print = False\n        self.barry_bdfl = False\n        self.generator_stop = _future_generator_stop_default\n        self.future_annotations = _future_annotations_default\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def __repr__(self):\n        return \"<FutureSpec %s>\" % \",\".join(self.asFlags())\n\n    def clone(self):\n        result = FutureSpec()\n\n        result.future_division = self.future_division\n        result.unicode_literals = self.unicode_literals\n        result.absolute_import = self.absolute_import\n        result.future_print = self.future_print\n        result.barry_bdfl = self.barry_bdfl\n        result.generator_stop = self.generator_stop\n        result.future_annotations = result.future_annotations\n\n        return result\n\n    def isFutureDivision(self):\n        return self.future_division\n\n    def enableFutureDivision(self):\n        self.future_division = True\n\n    def isFuturePrint(self):\n        return self.future_print\n\n    def enableFuturePrint(self):\n        self.future_print = True\n\n    def enableUnicodeLiterals(self):\n        self.unicode_literals = True\n\n    def enableAbsoluteImport(self):\n        self.absolute_import = True\n\n    def enableBarry(self):\n        self.barry_bdfl = True\n\n    def enableGeneratorStop(self):\n        self.generator_stop = True\n\n    def isAbsoluteImport(self):\n        return self.absolute_import\n\n    def isGeneratorStop(self):\n        return self.generator_stop\n\n    def enableFutureAnnotations(self):\n        self.future_annotations = True\n\n    def isFutureAnnotations(self):\n        return self.future_annotations\n\n    def asFlags(self):\n        \"\"\"Create a list of C identifiers to represent the flag values.\n\n        This is for use in code generation and to restore from\n        saved modules.\n        \"\"\"\n\n        result = []\n\n        if python_version < 0x300 and self.future_division:\n            result.append(\"CO_FUTURE_DIVISION\")\n\n        if self.unicode_literals:\n            result.append(\"CO_FUTURE_UNICODE_LITERALS\")\n\n        if python_version < 0x300 and self.absolute_import:\n            result.append(\"CO_FUTURE_ABSOLUTE_IMPORT\")\n\n        if python_version < 0x300 and self.future_print:\n            result.append(\"CO_FUTURE_PRINT_FUNCTION\")\n\n        if python_version >= 0x300 and self.barry_bdfl:\n            result.append(\"CO_FUTURE_BARRY_AS_BDFL\")\n\n        if 0x350 <= python_version < 0x370 and self.generator_stop:\n            result.append(\"CO_FUTURE_GENERATOR_STOP\")\n\n        if python_version >= 0x370 and self.future_annotations:\n            result.append(\"CO_FUTURE_ANNOTATIONS\")\n\n        return tuple(result)\n\n\ndef fromFlags(flags):\n    flags = flags.split(\",\")\n    if \"\" in flags:\n        flags.remove(\"\")\n\n    result = FutureSpec()\n\n    if \"CO_FUTURE_DIVISION\" in flags:\n        result.enableFutureDivision()\n\n    if \"CO_FUTURE_UNICODE_LITERALS\" in flags:\n        result.enableUnicodeLiterals()\n\n    if \"CO_FUTURE_ABSOLUTE_IMPORT\" in flags:\n        result.enableAbsoluteImport()\n\n    if \"CO_FUTURE_PRINT_FUNCTION\" in flags:\n        result.enableFuturePrint()\n\n    if \"CO_FUTURE_BARRY_AS_BDFL\" in flags:\n        result.enableBarry()\n\n    if \"CO_FUTURE_GENERATOR_STOP\" in flags:\n        result.enableGeneratorStop()\n\n    # Check if we are going to give similar results than what we got.\n    assert tuple(result.asFlags()) == tuple(flags), (result, result.asFlags(), flags)\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/GeneratorNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for generator objects and their creations.\n\nGenerators are turned into normal functions that create generator objects,\nwhose implementation lives here. The creation itself also lives here.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildHavingGeneratorRefMixin\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .FunctionNodes import ExpressionFunctionEntryPointBase\nfrom .IndicatorMixins import MarkUnoptimizedFunctionIndicatorMixin\nfrom .ReturnNodes import StatementReturn, StatementReturnNone\n\n\nclass ExpressionMakeGeneratorObject(\n    ExpressionNoSideEffectsMixin, ChildHavingGeneratorRefMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_MAKE_GENERATOR_OBJECT\"\n\n    named_children = (\"generator_ref\",)\n\n    __slots__ = (\"variable_closure_traces\",)\n\n    def __init__(self, generator_ref, source_ref):\n        assert (\n            generator_ref.getFunctionBody().isExpressionGeneratorObjectBody()\n        ), generator_ref\n\n        ChildHavingGeneratorRefMixin.__init__(self, generator_ref=generator_ref)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_closure_traces = None\n\n    def getCodeObject(self):\n        return self.code_object\n\n    def computeExpression(self, trace_collection):\n        self.variable_closure_traces = []\n\n        for (\n            closure_variable\n        ) in self.subnode_generator_ref.getFunctionBody().getClosureVariables():\n            trace = trace_collection.getVariableCurrentTrace(closure_variable)\n            trace.addNameUsage()\n\n            self.variable_closure_traces.append((closure_variable, trace))\n\n        # TODO: Generator body may know something too.\n        return self, None, None\n\n    def getClosureVariableVersions(self):\n        return self.variable_closure_traces\n\n\nclass ExpressionGeneratorObjectBody(\n    MarkUnoptimizedFunctionIndicatorMixin, ExpressionFunctionEntryPointBase\n):\n    kind = \"EXPRESSION_GENERATOR_OBJECT_BODY\"\n\n    __slots__ = (\n        \"unoptimized_locals\",\n        \"unqualified_exec\",\n        \"needs_generator_return_exit\",\n        \"qualname_provider\",\n    )\n\n    if python_version >= 0x340:\n        __slots__ += (\"qualname_setup\",)\n\n    def __init__(self, provider, name, code_object, flags, auto_release, source_ref):\n        ExpressionFunctionEntryPointBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_object=code_object,\n            code_prefix=\"genexpr\" if name == \"<genexpr>\" else \"genobj\",\n            flags=flags,\n            auto_release=auto_release,\n            source_ref=source_ref,\n        )\n\n        MarkUnoptimizedFunctionIndicatorMixin.__init__(self, flags)\n\n        self.needs_generator_return_exit = False\n\n        self.trace_collection = None\n\n        if python_version >= 0x340:\n            self.qualname_setup = None\n\n    def getFunctionName(self):\n        return self.name\n\n    def markAsNeedsGeneratorReturnHandling(self, value):\n        self.needs_generator_return_exit = max(self.needs_generator_return_exit, value)\n\n    def needsGeneratorReturnHandling(self):\n        return self.needs_generator_return_exit == 2\n\n    def needsGeneratorReturnExit(self):\n        return bool(self.needs_generator_return_exit)\n\n    @staticmethod\n    def needsCreation():\n        return False\n\n    def getConstantReturnValue(self):\n        \"\"\"Special function that checks if code generation allows to use common C code.\"\"\"\n        body = self.subnode_body\n\n        if body is None:\n            return True, None\n\n        return False, False\n\n\nclass StatementGeneratorReturn(StatementReturn):\n    kind = \"STATEMENT_GENERATOR_RETURN\"\n\n    def __init__(self, expression, source_ref):\n        StatementReturn.__init__(self, expression=expression, source_ref=source_ref)\n\n    @staticmethod\n    def isStatementGeneratorReturn():\n        return True\n\n    def computeStatement(self, trace_collection):\n        expression = trace_collection.onExpression(self.subnode_expression)\n\n        if expression.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if expression.willRaiseAnyException():\n            from .NodeMakingHelpers import (\n                makeStatementExpressionOnlyReplacementNode,\n            )\n\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=expression, node=self\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nReturn statement raises in returned expression, removed return.\"\"\",\n            )\n\n        trace_collection.onFunctionReturn()\n\n        if expression.isExpressionConstantNoneRef():\n            result = StatementGeneratorReturnNone(source_ref=self.source_ref)\n\n            return (\n                result,\n                \"new_statements\",\n                \"\"\"\\\nGenerator return value is always None.\"\"\",\n            )\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"generator return statement\"\n\n\nclass StatementGeneratorReturnNone(StatementReturnNone):\n    kind = \"STATEMENT_GENERATOR_RETURN_NONE\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementReturnNone.__init__(self, source_ref=source_ref)\n\n    @staticmethod\n    def isStatementGeneratorReturn():\n        return True\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"generator return statement\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/GlobalsLocalsNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Globals/locals/single arg dir nodes\n\nThese nodes give access to variables, highly problematic, because using them,\nthe code may change or access anything about them, so nothing can be trusted\nanymore, if we start to not know where their value goes.\n\nThe \"dir()\" call without arguments is reformulated to locals or globals calls.\n\"\"\"\n\nfrom .DictionaryNodes import makeExpressionMakeDict\nfrom .ExpressionBases import (\n    ExpressionBase,\n    ExpressionBuiltinSingleArgBase,\n    ExpressionNoSideEffectsMixin,\n)\nfrom .KeyValuePairNodes import makeKeyValuePairExpressionsFromKwArgs\nfrom .VariableRefNodes import ExpressionTempVariableRef, ExpressionVariableRef\n\n\nclass ExpressionBuiltinGlobals(ExpressionNoSideEffectsMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_GLOBALS\"\n\n    def __init__(self, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n\nclass ExpressionBuiltinLocalsBase(ExpressionNoSideEffectsMixin, ExpressionBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    __slots__ = (\"variable_traces\", \"locals_scope\")\n\n    def __init__(self, locals_scope, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_traces = None\n        self.locals_scope = locals_scope\n\n    def finalize(self):\n        del self.locals_scope\n        del self.variable_traces\n\n    def getVariableTraces(self):\n        return self.variable_traces\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n\nclass ExpressionBuiltinLocalsUpdated(ExpressionBuiltinLocalsBase):\n    kind = \"EXPRESSION_BUILTIN_LOCALS_UPDATED\"\n\n    def __init__(self, locals_scope, source_ref):\n        ExpressionBuiltinLocalsBase.__init__(\n            self, locals_scope=locals_scope, source_ref=source_ref\n        )\n\n        assert locals_scope is not None\n\n    def computeExpressionRaw(self, trace_collection):\n        # Just inform the collection that all escaped.\n        self.variable_traces = trace_collection.onLocalsUsage(self.locals_scope)\n\n        return self, None, None\n\n\nclass ExpressionBuiltinLocalsRef(ExpressionBuiltinLocalsBase):\n    kind = \"EXPRESSION_BUILTIN_LOCALS_REF\"\n\n    def __init__(self, locals_scope, source_ref):\n        ExpressionBuiltinLocalsBase.__init__(\n            self, locals_scope=locals_scope, source_ref=source_ref\n        )\n\n    def getDetails(self):\n        return {\"locals_scope\": self.locals_scope}\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    # For overload.\n    def isFinalUseOfLocals(self):\n        return self.parent.isStatementReturn()\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.locals_scope.isMarkedForPropagation():\n            result = makeExpressionMakeDict(\n                pairs=makeKeyValuePairExpressionsFromKwArgs(\n                    pairs=(\n                        (\n                            variable_name,\n                            ExpressionTempVariableRef(\n                                variable=variable, source_ref=self.source_ref\n                            ),\n                        )\n                        for (\n                            variable_name,\n                            variable,\n                        ) in self.locals_scope.getPropagationVariables().items()\n                    )\n                ),\n                source_ref=self.source_ref,\n            )\n\n            new_result = result.computeExpressionRaw(trace_collection)\n\n            assert new_result[0] is result\n\n            self.finalize()\n\n            return result, \"new_expression\", \"Propagated locals dictionary reference.\"\n\n        # Just inform the collection that all escaped unless it is aborting or for\n        # a locals dict.\n        if not self.isFinalUseOfLocals():\n            trace_collection.onLocalsUsage(locals_scope=self.locals_scope)\n\n        return self, None, None\n\n\nclass ExpressionBuiltinLocalsCopy(ExpressionBuiltinLocalsBase):\n    kind = \"EXPRESSION_BUILTIN_LOCALS_COPY\"\n\n    def computeExpressionRaw(self, trace_collection):\n        # Just inform the collection that all escaped.\n\n        self.variable_traces = trace_collection.onLocalsUsage(\n            locals_scope=self.locals_scope\n        )\n\n        for variable, variable_trace in self.variable_traces:\n            if (\n                not variable_trace.mustHaveValue()\n                and not variable_trace.mustNotHaveValue()\n            ):\n                return self, None, None\n\n            # Other locals elsewhere.\n            if variable_trace.getNameUsageCount() > 1:\n                return self, None, None\n\n        pairs = makeKeyValuePairExpressionsFromKwArgs(\n            (\n                variable.getName(),\n                ExpressionVariableRef(variable=variable, source_ref=self.source_ref),\n            )\n            for variable, variable_trace in self.variable_traces\n            if variable_trace.mustHaveValue()\n        )\n\n        # Locals is sorted of course.\n        def _sorted(pairs):\n            names = [\n                variable.getName()\n                for variable in self.locals_scope.getProvidedVariables()\n            ]\n\n            return tuple(\n                sorted(\n                    pairs,\n                    key=lambda pair: names.index(pair.getKeyCompileTimeConstant()),\n                )\n            )\n\n        result = makeExpressionMakeDict(\n            pairs=_sorted(pairs), source_ref=self.source_ref\n        )\n\n        return result, \"new_expression\", \"Statically predicted locals dictionary.\"\n\n\nclass ExpressionBuiltinDir1(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_BUILTIN_DIR1\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict and this\n        # should be using a slot, with \"__dir__\" being overloaded or not.\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/HardImportNodesGenerated.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Hard import nodes\n\nWARNING, this code is GENERATED. Modify the template HardImportReferenceNode.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\nimport os\nfrom abc import abstractmethod\n\nfrom nuitka.Options import shallMakeModule\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs\nfrom nuitka.specs.HardImportSpecs import (\n    builtins_open_since_3_spec,\n    ctypes_cdll_before_38_spec,\n    ctypes_cdll_since_38_spec,\n    importlib_metadata_backport_distribution_spec,\n    importlib_metadata_backport_entry_points_spec,\n    importlib_metadata_backport_metadata_spec,\n    importlib_metadata_backport_version_spec,\n    importlib_metadata_distribution_spec,\n    importlib_metadata_entry_points_before_310_spec,\n    importlib_metadata_entry_points_since_310_spec,\n    importlib_metadata_metadata_spec,\n    importlib_metadata_version_spec,\n    importlib_resources_backport_files_spec,\n    importlib_resources_backport_read_binary_spec,\n    importlib_resources_backport_read_text_spec,\n    importlib_resources_files_spec,\n    importlib_resources_read_binary_spec,\n    importlib_resources_read_text_spec,\n    os_listdir_spec,\n    os_path_abspath_spec,\n    os_path_basename_spec,\n    os_path_dirname_spec,\n    os_path_exists_spec,\n    os_path_isabs_spec,\n    os_path_isdir_spec,\n    os_path_isfile_spec,\n    os_uname_spec,\n    pkg_resources_get_distribution_spec,\n    pkg_resources_iter_entry_points_spec,\n    pkg_resources_require_spec,\n    pkg_resources_resource_stream_spec,\n    pkg_resources_resource_string_spec,\n    pkgutil_get_data_spec,\n    sys_exit_spec,\n    tensorflow_function_spec,\n)\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingDistMixin,\n    ChildHavingDistributionNameMixin,\n    ChildHavingExitCodeOptionalMixin,\n    ChildHavingPackageMixin,\n    ChildHavingParamsTupleMixin,\n    ChildHavingPathMixin,\n    ChildHavingPathOptionalMixin,\n    ChildHavingPMixin,\n    ChildHavingRequirementsTupleMixin,\n    ChildHavingSMixin,\n    ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin,\n    ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,\n    ChildrenHavingGroupNameOptionalMixin,\n    ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,\n    ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,\n    ChildrenHavingPackageOrRequirementResourceNameMixin,\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,\n    ChildrenHavingPackageResourceMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionBytesShapeExactMixin,\n    ExpressionDictShapeExactMixin,\n    ExpressionStrShapeExactMixin,\n)\nfrom .ImportHardNodes import ExpressionImportModuleNameHardExistsSpecificBase\n\nhard_import_node_classes = {}\n\n\nclass ExpressionBuiltinsOpenRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference builtins.open\"\"\"\n\n    kind = \"EXPRESSION_BUILTINS_OPEN_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"builtins\",\n            import_name=\"open\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .BuiltinOpenNodes import makeExpressionBuiltinsOpenCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionBuiltinsOpenCall,\n            builtin_spec=builtins_open_since_3_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'builtins.open' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionBuiltinsOpenRef] = builtins_open_since_3_spec\n\n\nclass ExpressionBuiltinsOpenCallBase(\n    ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for BuiltinsOpenCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"file\",\n        \"mode|optional\",\n        \"buffering|optional\",\n        \"encoding|optional\",\n        \"errors|optional\",\n        \"newline|optional\",\n        \"closefd|optional\",\n        \"opener|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = builtins_open_since_3_spec\n\n    def __init__(\n        self,\n        file,\n        mode,\n        buffering,\n        encoding,\n        errors,\n        newline,\n        closefd,\n        opener,\n        source_ref,\n    ):\n\n        ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin.__init__(\n            self,\n            file=file,\n            mode=mode,\n            buffering=buffering,\n            encoding=encoding,\n            errors=errors,\n            newline=newline,\n            closefd=closefd,\n            opener=opener,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not builtins_open_since_3_spec.isCompileTimeComputable(\n            (\n                self.subnode_file,\n                self.subnode_mode,\n                self.subnode_buffering,\n                self.subnode_encoding,\n                self.subnode_errors,\n                self.subnode_newline,\n                self.subnode_closefd,\n                self.subnode_opener,\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionCtypesCdllRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference ctypes.CDLL\"\"\"\n\n    kind = \"EXPRESSION_CTYPES_CDLL_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"ctypes\",\n            import_name=\"CDLL\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        if python_version >= 0x380:\n            from .CtypesNodes import ExpressionCtypesCdllSince38Call\n\n            result = extractBuiltinArgs(\n                node=call_node,\n                builtin_class=ExpressionCtypesCdllSince38Call,\n                builtin_spec=ctypes_cdll_since_38_spec,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Call to 'ctypes.CDLL' recognized.\",\n            )\n\n        if python_version < 0x380:\n            from .CtypesNodes import ExpressionCtypesCdllBefore38Call\n\n            result = extractBuiltinArgs(\n                node=call_node,\n                builtin_class=ExpressionCtypesCdllBefore38Call,\n                builtin_spec=ctypes_cdll_before_38_spec,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Call to 'ctypes.CDLL' recognized.\",\n            )\n\n\nhard_import_node_classes[ExpressionCtypesCdllRef] = ctypes_cdll_since_38_spec\n\n\nclass ExpressionCtypesCdllSince38CallBase(\n    ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for CtypesCdllCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    python_version_spec = \">= 0x380\"\n\n    named_children = (\n        \"name\",\n        \"mode|optional\",\n        \"handle|optional\",\n        \"use_errno|optional\",\n        \"use_last_error|optional\",\n        \"winmode|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = ctypes_cdll_since_38_spec\n\n    def __init__(\n        self, name, mode, handle, use_errno, use_last_error, winmode, source_ref\n    ):\n\n        ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin.__init__(\n            self,\n            name=name,\n            mode=mode,\n            handle=handle,\n            use_errno=use_errno,\n            use_last_error=use_last_error,\n            winmode=winmode,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not ctypes_cdll_since_38_spec.isCompileTimeComputable(\n            (\n                self.subnode_name,\n                self.subnode_mode,\n                self.subnode_handle,\n                self.subnode_use_errno,\n                self.subnode_use_last_error,\n                self.subnode_winmode,\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionCtypesCdllBefore38CallBase(\n    ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for CtypesCdllCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    python_version_spec = \"< 0x380\"\n\n    named_children = (\n        \"name\",\n        \"mode|optional\",\n        \"handle|optional\",\n        \"use_errno|optional\",\n        \"use_last_error|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = ctypes_cdll_before_38_spec\n\n    def __init__(self, name, mode, handle, use_errno, use_last_error, source_ref):\n\n        ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin.__init__(\n            self,\n            name=name,\n            mode=mode,\n            handle=handle,\n            use_errno=use_errno,\n            use_last_error=use_last_error,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not ctypes_cdll_before_38_spec.isCompileTimeComputable(\n            (\n                self.subnode_name,\n                self.subnode_mode,\n                self.subnode_handle,\n                self.subnode_use_errno,\n                self.subnode_use_last_error,\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataBackportDistributionRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_metadata.distribution\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_metadata\",\n            import_name=\"distribution\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionImportlibMetadataBackportDistributionCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibMetadataBackportDistributionCall,\n            builtin_spec=importlib_metadata_backport_distribution_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_metadata.distribution' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataBackportDistributionRef] = (\n    importlib_metadata_backport_distribution_spec\n)\n\n\nclass ExpressionImportlibMetadataBackportDistributionCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataBackportDistributionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_backport_distribution_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_backport_distribution_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataBackportEntryPointsRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_metadata.entry_points\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_metadata\",\n            import_name=\"entry_points\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            makeExpressionImportlibMetadataBackportEntryPointsCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionImportlibMetadataBackportEntryPointsCall,\n            builtin_spec=importlib_metadata_backport_entry_points_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_metadata.entry_points' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataBackportEntryPointsRef] = (\n    importlib_metadata_backport_entry_points_spec\n)\n\n\nclass ExpressionImportlibMetadataBackportEntryPointsCallBase(\n    ChildHavingParamsTupleMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataBackportEntryPointsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"params|tuple\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_backport_entry_points_spec\n\n    def __init__(self, params, source_ref):\n\n        ChildHavingParamsTupleMixin.__init__(\n            self,\n            params=params,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_backport_entry_points_spec.isCompileTimeComputable(\n                () + self.subnode_params\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataBackportMetadataRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_metadata.metadata\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_METADATA_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_metadata\",\n            import_name=\"metadata\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            makeExpressionImportlibMetadataBackportMetadataCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionImportlibMetadataBackportMetadataCall,\n            builtin_spec=importlib_metadata_backport_metadata_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_metadata.metadata' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataBackportMetadataRef] = (\n    importlib_metadata_backport_metadata_spec\n)\n\n\nclass ExpressionImportlibMetadataBackportMetadataCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataBackportMetadataCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_backport_metadata_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_backport_metadata_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataBackportVersionRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_metadata.version\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_VERSION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_metadata\",\n            import_name=\"version\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionImportlibMetadataBackportVersionCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibMetadataBackportVersionCall,\n            builtin_spec=importlib_metadata_backport_version_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_metadata.version' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataBackportVersionRef] = (\n    importlib_metadata_backport_version_spec\n)\n\n\nclass ExpressionImportlibMetadataBackportVersionCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataBackportVersionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_backport_version_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_backport_version_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataDistributionRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.metadata.distribution\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.metadata\",\n            import_name=\"distribution\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionImportlibMetadataDistributionCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibMetadataDistributionCall,\n            builtin_spec=importlib_metadata_distribution_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.metadata.distribution' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataDistributionRef] = (\n    importlib_metadata_distribution_spec\n)\n\n\nclass ExpressionImportlibMetadataDistributionCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataDistributionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_distribution_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_distribution_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataEntryPointsRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.metadata.entry_points\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.metadata\",\n            import_name=\"entry_points\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        if python_version >= 0x3A0:\n            from .PackageMetadataNodes import (\n                makeExpressionImportlibMetadataEntryPointsSince310Call,\n            )\n\n            result = extractBuiltinArgs(\n                node=call_node,\n                builtin_class=makeExpressionImportlibMetadataEntryPointsSince310Call,\n                builtin_spec=importlib_metadata_entry_points_since_310_spec,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Call to 'importlib.metadata.entry_points' recognized.\",\n            )\n\n        if python_version < 0x3A0:\n            from .PackageMetadataNodes import (\n                ExpressionImportlibMetadataEntryPointsBefore310Call,\n            )\n\n            result = extractBuiltinArgs(\n                node=call_node,\n                builtin_class=ExpressionImportlibMetadataEntryPointsBefore310Call,\n                builtin_spec=importlib_metadata_entry_points_before_310_spec,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Call to 'importlib.metadata.entry_points' recognized.\",\n            )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataEntryPointsRef] = (\n    importlib_metadata_entry_points_since_310_spec\n)\n\n\nclass ExpressionImportlibMetadataEntryPointsSince310CallBase(\n    ChildHavingParamsTupleMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataEntryPointsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    python_version_spec = \">= 0x3a0\"\n\n    named_children = (\"params|tuple\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_entry_points_since_310_spec\n\n    def __init__(self, params, source_ref):\n\n        ChildHavingParamsTupleMixin.__init__(\n            self,\n            params=params,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_entry_points_since_310_spec.isCompileTimeComputable(\n                () + self.subnode_params\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataEntryPointsBefore310CallBase(\n    ExpressionDictShapeExactMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataEntryPointsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    python_version_spec = \"< 0x3a0\"\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_entry_points_before_310_spec\n\n    def __init__(self, source_ref):\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def finalize(self):\n        del self.parent\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.attempted:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataMetadataRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.metadata.metadata\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_METADATA_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.metadata\",\n            import_name=\"metadata\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            makeExpressionImportlibMetadataMetadataCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionImportlibMetadataMetadataCall,\n            builtin_spec=importlib_metadata_metadata_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.metadata.metadata' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataMetadataRef] = (\n    importlib_metadata_metadata_spec\n)\n\n\nclass ExpressionImportlibMetadataMetadataCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataMetadataCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_metadata_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_metadata_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataVersionRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.metadata.version\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_VERSION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.metadata\",\n            import_name=\"version\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionImportlibMetadataVersionCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibMetadataVersionCall,\n            builtin_spec=importlib_metadata_version_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.metadata.version' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibMetadataVersionRef] = (\n    importlib_metadata_version_spec\n)\n\n\nclass ExpressionImportlibMetadataVersionCallBase(\n    ChildHavingDistributionNameMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibMetadataVersionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"distribution_name\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_metadata_version_spec\n\n    def __init__(self, distribution_name, source_ref):\n\n        ChildHavingDistributionNameMixin.__init__(\n            self,\n            distribution_name=distribution_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_metadata_version_spec.isCompileTimeComputable(\n                (self.subnode_distribution_name,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesBackportFilesRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_resources.files\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_resources\",\n            import_name=\"files\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            ExpressionImportlibResourcesBackportFilesCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibResourcesBackportFilesCall,\n            builtin_spec=importlib_resources_backport_files_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_resources.files' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesBackportFilesRef] = (\n    importlib_resources_backport_files_spec\n)\n\n\nclass ExpressionImportlibResourcesBackportFilesCallBase(\n    ChildHavingPackageMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibResourcesBackportFilesCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"package\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_backport_files_spec\n\n    def __init__(self, package, source_ref):\n\n        ChildHavingPackageMixin.__init__(\n            self,\n            package=package,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_backport_files_spec.isCompileTimeComputable(\n                (self.subnode_package,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesBackportReadBinaryRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_resources.read_binary\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_BINARY_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_resources\",\n            import_name=\"read_binary\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            ExpressionImportlibResourcesBackportReadBinaryCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibResourcesBackportReadBinaryCall,\n            builtin_spec=importlib_resources_backport_read_binary_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_resources.read_binary' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesBackportReadBinaryRef] = (\n    importlib_resources_backport_read_binary_spec\n)\n\n\nclass ExpressionImportlibResourcesBackportReadBinaryCallBase(\n    ExpressionBytesShapeExactMixin, ChildrenHavingPackageResourceMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibResourcesBackportReadBinaryCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package\",\n        \"resource\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_backport_read_binary_spec\n\n    def __init__(self, package, resource, source_ref):\n\n        ChildrenHavingPackageResourceMixin.__init__(\n            self,\n            package=package,\n            resource=resource,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_backport_read_binary_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package,\n                    self.subnode_resource,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesBackportReadTextRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib_resources.read_text\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_TEXT_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib_resources\",\n            import_name=\"read_text\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            makeExpressionImportlibResourcesBackportReadTextCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionImportlibResourcesBackportReadTextCall,\n            builtin_spec=importlib_resources_backport_read_text_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib_resources.read_text' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesBackportReadTextRef] = (\n    importlib_resources_backport_read_text_spec\n)\n\n\nclass ExpressionImportlibResourcesBackportReadTextCallBase(\n    ExpressionStrShapeExactMixin,\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for ImportlibResourcesBackportReadTextCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package\",\n        \"resource\",\n        \"encoding|optional\",\n        \"errors|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_backport_read_text_spec\n\n    def __init__(self, package, resource, encoding, errors, source_ref):\n\n        ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(\n            self,\n            package=package,\n            resource=resource,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_backport_read_text_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package,\n                    self.subnode_resource,\n                    self.subnode_encoding,\n                    self.subnode_errors,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesFilesRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.resources.files\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.resources\",\n            import_name=\"files\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import ExpressionImportlibResourcesFilesCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibResourcesFilesCall,\n            builtin_spec=importlib_resources_files_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.resources.files' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesFilesRef] = (\n    importlib_resources_files_spec\n)\n\n\nclass ExpressionImportlibResourcesFilesCallBase(\n    ChildHavingPackageMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibResourcesFilesCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"package\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_files_spec\n\n    def __init__(self, package, source_ref):\n\n        ChildHavingPackageMixin.__init__(\n            self,\n            package=package,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_files_spec.isCompileTimeComputable(\n                (self.subnode_package,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesReadBinaryRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.resources.read_binary\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_READ_BINARY_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.resources\",\n            import_name=\"read_binary\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            ExpressionImportlibResourcesReadBinaryCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibResourcesReadBinaryCall,\n            builtin_spec=importlib_resources_read_binary_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.resources.read_binary' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesReadBinaryRef] = (\n    importlib_resources_read_binary_spec\n)\n\n\nclass ExpressionImportlibResourcesReadBinaryCallBase(\n    ExpressionBytesShapeExactMixin, ChildrenHavingPackageResourceMixin, ExpressionBase\n):\n    \"\"\"Base class for ImportlibResourcesReadBinaryCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package\",\n        \"resource\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_read_binary_spec\n\n    def __init__(self, package, resource, source_ref):\n\n        ChildrenHavingPackageResourceMixin.__init__(\n            self,\n            package=package,\n            resource=resource,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_read_binary_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package,\n                    self.subnode_resource,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibResourcesReadTextRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference importlib.resources.read_text\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_READ_TEXT_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib.resources\",\n            import_name=\"read_text\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            makeExpressionImportlibResourcesReadTextCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionImportlibResourcesReadTextCall,\n            builtin_spec=importlib_resources_read_text_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'importlib.resources.read_text' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionImportlibResourcesReadTextRef] = (\n    importlib_resources_read_text_spec\n)\n\n\nclass ExpressionImportlibResourcesReadTextCallBase(\n    ExpressionStrShapeExactMixin,\n    ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for ImportlibResourcesReadTextCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package\",\n        \"resource\",\n        \"encoding|optional\",\n        \"errors|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = importlib_resources_read_text_spec\n\n    def __init__(self, package, resource, encoding, errors, source_ref):\n\n        ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(\n            self,\n            package=package,\n            resource=resource,\n            encoding=encoding,\n            errors=errors,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not importlib_resources_read_text_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package,\n                    self.subnode_resource,\n                    self.subnode_encoding,\n                    self.subnode_errors,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsListdirRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.listdir\"\"\"\n\n    kind = \"EXPRESSION_OS_LISTDIR_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"os\",\n            import_name=\"listdir\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsListdirCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsListdirCall,\n            builtin_spec=os_listdir_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.listdir' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsListdirRef] = os_listdir_spec\n\n\nclass ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):\n    \"\"\"Base class for OsListdirCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"path|optional\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_listdir_spec\n\n    def __init__(self, path, source_ref):\n\n        ChildHavingPathOptionalMixin.__init__(\n            self,\n            path=path,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_listdir_spec.isCompileTimeComputable(\n            (self.subnode_path,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathAbspathRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.abspath\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_ABSPATH_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"abspath\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathAbspathCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathAbspathCall,\n            builtin_spec=os_path_abspath_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.abspath' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathAbspathRef] = os_path_abspath_spec\n\n\nclass ExpressionOsPathAbspathCallBase(ChildHavingPathMixin, ExpressionBase):\n    \"\"\"Base class for OsPathAbspathCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"path\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_abspath_spec\n\n    def __init__(self, path, source_ref):\n\n        ChildHavingPathMixin.__init__(\n            self,\n            path=path,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_abspath_spec.isCompileTimeComputable(\n            (self.subnode_path,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathBasenameRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.basename\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_BASENAME_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"basename\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathBasenameCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathBasenameCall,\n            builtin_spec=os_path_basename_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.basename' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathBasenameRef] = os_path_basename_spec\n\n\nclass ExpressionOsPathBasenameCallBase(ChildHavingPMixin, ExpressionBase):\n    \"\"\"Base class for OsPathBasenameCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"p\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_basename_spec\n\n    def __init__(self, p, source_ref):\n\n        ChildHavingPMixin.__init__(\n            self,\n            p=p,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_basename_spec.isCompileTimeComputable(\n            (self.subnode_p,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathDirnameRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.dirname\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_DIRNAME_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"dirname\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathDirnameCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathDirnameCall,\n            builtin_spec=os_path_dirname_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.dirname' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathDirnameRef] = os_path_dirname_spec\n\n\nclass ExpressionOsPathDirnameCallBase(ChildHavingPMixin, ExpressionBase):\n    \"\"\"Base class for OsPathDirnameCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"p\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_dirname_spec\n\n    def __init__(self, p, source_ref):\n\n        ChildHavingPMixin.__init__(\n            self,\n            p=p,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_dirname_spec.isCompileTimeComputable(\n            (self.subnode_p,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathExistsRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.exists\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_EXISTS_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"exists\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathExistsCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathExistsCall,\n            builtin_spec=os_path_exists_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.exists' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathExistsRef] = os_path_exists_spec\n\n\nclass ExpressionOsPathExistsCallBase(ChildHavingPathMixin, ExpressionBase):\n    \"\"\"Base class for OsPathExistsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"path\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_exists_spec\n\n    def __init__(self, path, source_ref):\n\n        ChildHavingPathMixin.__init__(\n            self,\n            path=path,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_exists_spec.isCompileTimeComputable(\n            (self.subnode_path,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathIsabsRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.isabs\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_ISABS_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"isabs\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathIsabsCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathIsabsCall,\n            builtin_spec=os_path_isabs_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.isabs' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathIsabsRef] = os_path_isabs_spec\n\n\nclass ExpressionOsPathIsabsCallBase(\n    ExpressionBoolShapeExactMixin, ChildHavingSMixin, ExpressionBase\n):\n    \"\"\"Base class for OsPathIsabsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"s\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_isabs_spec\n\n    def __init__(self, s, source_ref):\n\n        ChildHavingSMixin.__init__(\n            self,\n            s=s,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_isabs_spec.isCompileTimeComputable(\n            (self.subnode_s,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathIsdirRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.isdir\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_ISDIR_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"isdir\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathIsdirCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathIsdirCall,\n            builtin_spec=os_path_isdir_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.isdir' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathIsdirRef] = os_path_isdir_spec\n\n\nclass ExpressionOsPathIsdirCallBase(ChildHavingPathMixin, ExpressionBase):\n    \"\"\"Base class for OsPathIsdirCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"path\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_isdir_spec\n\n    def __init__(self, path, source_ref):\n\n        ChildHavingPathMixin.__init__(\n            self,\n            path=path,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_isdir_spec.isCompileTimeComputable(\n            (self.subnode_path,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsPathIsfileRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.path.isfile\"\"\"\n\n    kind = \"EXPRESSION_OS_PATH_ISFILE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=os.path.__name__,\n            import_name=\"isfile\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsPathIsfileCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsPathIsfileCall,\n            builtin_spec=os_path_isfile_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.path.isfile' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsPathIsfileRef] = os_path_isfile_spec\n\n\nclass ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):\n    \"\"\"Base class for OsPathIsfileCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"path\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_path_isfile_spec\n\n    def __init__(self, path, source_ref):\n\n        ChildHavingPathMixin.__init__(\n            self,\n            path=path,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not os_path_isfile_spec.isCompileTimeComputable(\n            (self.subnode_path,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference os.uname\"\"\"\n\n    kind = \"EXPRESSION_OS_UNAME_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"os\",\n            import_name=\"uname\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import ExpressionOsUnameCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionOsUnameCall,\n            builtin_spec=os_uname_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'os.uname' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionOsUnameRef] = os_uname_spec\n\n\nclass ExpressionOsUnameCallBase(ExpressionBase):\n    \"\"\"Base class for OsUnameCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    __slots__ = (\"attempted\",)\n\n    spec = os_uname_spec\n\n    def __init__(self, source_ref):\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def finalize(self):\n        del self.parent\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.attempted:\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgResourcesGetDistributionRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference pkg_resources.get_distribution\"\"\"\n\n    kind = \"EXPRESSION_PKG_RESOURCES_GET_DISTRIBUTION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkg_resources\",\n            import_name=\"get_distribution\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionPkgResourcesGetDistributionCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgResourcesGetDistributionCall,\n            builtin_spec=pkg_resources_get_distribution_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkg_resources.get_distribution' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgResourcesGetDistributionRef] = (\n    pkg_resources_get_distribution_spec\n)\n\n\nclass ExpressionPkgResourcesGetDistributionCallBase(\n    ChildHavingDistMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgResourcesGetDistributionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"dist\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkg_resources_get_distribution_spec\n\n    def __init__(self, dist, source_ref):\n\n        ChildHavingDistMixin.__init__(\n            self,\n            dist=dist,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not pkg_resources_get_distribution_spec.isCompileTimeComputable(\n                (self.subnode_dist,)\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgResourcesIterEntryPointsRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference pkg_resources.iter_entry_points\"\"\"\n\n    kind = \"EXPRESSION_PKG_RESOURCES_ITER_ENTRY_POINTS_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkg_resources\",\n            import_name=\"iter_entry_points\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import (\n            ExpressionPkgResourcesIterEntryPointsCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgResourcesIterEntryPointsCall,\n            builtin_spec=pkg_resources_iter_entry_points_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkg_resources.iter_entry_points' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgResourcesIterEntryPointsRef] = (\n    pkg_resources_iter_entry_points_spec\n)\n\n\nclass ExpressionPkgResourcesIterEntryPointsCallBase(\n    ChildrenHavingGroupNameOptionalMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgResourcesIterEntryPointsCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"group\",\n        \"name|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkg_resources_iter_entry_points_spec\n\n    def __init__(self, group, name, source_ref):\n\n        ChildrenHavingGroupNameOptionalMixin.__init__(\n            self,\n            group=group,\n            name=name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not pkg_resources_iter_entry_points_spec.isCompileTimeComputable(\n                (\n                    self.subnode_group,\n                    self.subnode_name,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgResourcesRequireRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference pkg_resources.require\"\"\"\n\n    kind = \"EXPRESSION_PKG_RESOURCES_REQUIRE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkg_resources\",\n            import_name=\"require\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageMetadataNodes import ExpressionPkgResourcesRequireCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgResourcesRequireCall,\n            builtin_spec=pkg_resources_require_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkg_resources.require' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgResourcesRequireRef] = pkg_resources_require_spec\n\n\nclass ExpressionPkgResourcesRequireCallBase(\n    ChildHavingRequirementsTupleMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgResourcesRequireCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"requirements|tuple\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkg_resources_require_spec\n\n    def __init__(self, requirements, source_ref):\n\n        ChildHavingRequirementsTupleMixin.__init__(\n            self,\n            requirements=requirements,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not pkg_resources_require_spec.isCompileTimeComputable(\n            () + self.subnode_requirements\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgResourcesResourceStreamRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference pkg_resources.resource_stream\"\"\"\n\n    kind = \"EXPRESSION_PKG_RESOURCES_RESOURCE_STREAM_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkg_resources\",\n            import_name=\"resource_stream\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            ExpressionPkgResourcesResourceStreamCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgResourcesResourceStreamCall,\n            builtin_spec=pkg_resources_resource_stream_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkg_resources.resource_stream' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgResourcesResourceStreamRef] = (\n    pkg_resources_resource_stream_spec\n)\n\n\nclass ExpressionPkgResourcesResourceStreamCallBase(\n    ChildrenHavingPackageOrRequirementResourceNameMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgResourcesResourceStreamCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package_or_requirement\",\n        \"resource_name\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkg_resources_resource_stream_spec\n\n    def __init__(self, package_or_requirement, resource_name, source_ref):\n\n        ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(\n            self,\n            package_or_requirement=package_or_requirement,\n            resource_name=resource_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not pkg_resources_resource_stream_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package_or_requirement,\n                    self.subnode_resource_name,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgResourcesResourceStringRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference pkg_resources.resource_string\"\"\"\n\n    kind = \"EXPRESSION_PKG_RESOURCES_RESOURCE_STRING_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkg_resources\",\n            import_name=\"resource_string\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import (\n            ExpressionPkgResourcesResourceStringCall,\n        )\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgResourcesResourceStringCall,\n            builtin_spec=pkg_resources_resource_string_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkg_resources.resource_string' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgResourcesResourceStringRef] = (\n    pkg_resources_resource_string_spec\n)\n\n\nclass ExpressionPkgResourcesResourceStringCallBase(\n    ChildrenHavingPackageOrRequirementResourceNameMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgResourcesResourceStringCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package_or_requirement\",\n        \"resource_name\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkg_resources_resource_string_spec\n\n    def __init__(self, package_or_requirement, resource_name, source_ref):\n\n        ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(\n            self,\n            package_or_requirement=package_or_requirement,\n            resource_name=resource_name,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.attempted\n            or not pkg_resources_resource_string_spec.isCompileTimeComputable(\n                (\n                    self.subnode_package_or_requirement,\n                    self.subnode_resource_name,\n                )\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionPkgutilGetDataRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference pkgutil.get_data\"\"\"\n\n    kind = \"EXPRESSION_PKGUTIL_GET_DATA_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"pkgutil\",\n            import_name=\"get_data\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .PackageResourceNodes import ExpressionPkgutilGetDataCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionPkgutilGetDataCall,\n            builtin_spec=pkgutil_get_data_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'pkgutil.get_data' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionPkgutilGetDataRef] = pkgutil_get_data_spec\n\n\nclass ExpressionPkgutilGetDataCallBase(\n    ChildrenHavingPackageResourceMixin, ExpressionBase\n):\n    \"\"\"Base class for PkgutilGetDataCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"package\",\n        \"resource\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = pkgutil_get_data_spec\n\n    def __init__(self, package, resource, source_ref):\n\n        ChildrenHavingPackageResourceMixin.__init__(\n            self,\n            package=package,\n            resource=resource,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.attempted = False\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not pkgutil_get_data_spec.isCompileTimeComputable(\n            (\n                self.subnode_package,\n                self.subnode_resource,\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionSysExitRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference sys.exit\"\"\"\n\n    kind = \"EXPRESSION_SYS_EXIT_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"sys\",\n            import_name=\"exit\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .OsSysNodes import makeExpressionSysExitCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=makeExpressionSysExitCall,\n            builtin_spec=sys_exit_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'sys.exit' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionSysExitRef] = sys_exit_spec\n\n\nclass ExpressionSysExitCallBase(ChildHavingExitCodeOptionalMixin, ExpressionBase):\n    \"\"\"Base class for SysExitCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\"exit_code|optional\",)\n\n    __slots__ = (\"attempted\",)\n\n    spec = sys_exit_spec\n\n    def __init__(self, exit_code, source_ref):\n\n        ChildHavingExitCodeOptionalMixin.__init__(\n            self,\n            exit_code=exit_code,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not sys_exit_spec.isCompileTimeComputable(\n            (self.subnode_exit_code,)\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionTensorflowFunctionRef(ExpressionImportModuleNameHardExistsSpecificBase):\n    \"\"\"Function reference tensorflow.function\"\"\"\n\n    kind = \"EXPRESSION_TENSORFLOW_FUNCTION_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"tensorflow\",\n            import_name=\"function\",\n            module_guaranteed=not shallMakeModule(),\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        from .TensorflowNodes import ExpressionTensorflowFunctionCall\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionTensorflowFunctionCall,\n            builtin_spec=tensorflow_function_spec,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Call to 'tensorflow.function' recognized.\",\n        )\n\n\nhard_import_node_classes[ExpressionTensorflowFunctionRef] = tensorflow_function_spec\n\n\nclass ExpressionTensorflowFunctionCallBase(\n    ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,\n    ExpressionBase,\n):\n    \"\"\"Base class for TensorflowFunctionCall\n\n    Generated boiler plate code.\n    \"\"\"\n\n    named_children = (\n        \"func|optional\",\n        \"input_signature|optional\",\n        \"autograph|optional\",\n        \"jit_compile|optional\",\n        \"reduce_retracing|optional\",\n        \"experimental_implements|optional\",\n        \"experimental_autograph_options|optional\",\n        \"experimental_attributes|optional\",\n        \"experimental_relax_shapes|optional\",\n        \"experimental_compile|optional\",\n        \"experimental_follow_type_hints|optional\",\n    )\n\n    __slots__ = (\"attempted\",)\n\n    spec = tensorflow_function_spec\n\n    def __init__(\n        self,\n        func,\n        input_signature,\n        autograph,\n        jit_compile,\n        reduce_retracing,\n        experimental_implements,\n        experimental_autograph_options,\n        experimental_attributes,\n        experimental_relax_shapes,\n        experimental_compile,\n        experimental_follow_type_hints,\n        source_ref,\n    ):\n\n        ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin.__init__(\n            self,\n            func=func,\n            input_signature=input_signature,\n            autograph=autograph,\n            jit_compile=jit_compile,\n            reduce_retracing=reduce_retracing,\n            experimental_implements=experimental_implements,\n            experimental_autograph_options=experimental_autograph_options,\n            experimental_attributes=experimental_attributes,\n            experimental_relax_shapes=experimental_relax_shapes,\n            experimental_compile=experimental_compile,\n            experimental_follow_type_hints=experimental_follow_type_hints,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n\n    def computeExpression(self, trace_collection):\n        if self.attempted or not tensorflow_function_spec.isCompileTimeComputable(\n            (\n                self.subnode_func,\n                self.subnode_input_signature,\n                self.subnode_autograph,\n                self.subnode_jit_compile,\n                self.subnode_reduce_retracing,\n                self.subnode_experimental_implements,\n                self.subnode_experimental_autograph_options,\n                self.subnode_experimental_attributes,\n                self.subnode_experimental_relax_shapes,\n                self.subnode_experimental_compile,\n                self.subnode_experimental_follow_type_hints,\n            )\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ImportHardNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes representing more trusted imports. \"\"\"\n\nfrom nuitka.importing.Importing import locateModule, makeModuleUsageAttempt\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .ExpressionBases import ExpressionBase\n\n\nclass ExpressionImportHardBase(ExpressionBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n    #\n    __slots__ = (\"module_name\", \"finding\", \"module_kind\", \"module_filename\")\n\n    def __init__(self, module_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.module_name = ModuleName(module_name)\n\n        (\n            _module_name,\n            self.module_filename,\n            self.module_kind,\n            self.finding,\n        ) = locateModule(\n            module_name=self.module_name,\n            parent_package=None,\n            level=0,\n        )\n\n        # Expect to find them and to match the name of course.\n        assert self.finding != \"not-found\", self.module_name\n        assert _module_name == self.module_name, (self.module_name, _module_name)\n\n    def getModuleUsageAttempt(self):\n        return makeModuleUsageAttempt(\n            module_name=self.module_name,\n            filename=self.module_filename,\n            module_kind=self.module_kind,\n            finding=self.finding,\n            level=0,\n            source_ref=self.source_ref,\n            reason=\"import\",\n        )\n\n\nclass ExpressionImportModuleNameHardBase(ExpressionImportHardBase):\n    \"\"\"Hard import names base class.\"\"\"\n\n    # Base classes can be abstract, pylint: disable=I0021,abstract-method\n\n    __slots__ = (\"import_name\", \"finding\", \"module_filename\", \"module_guaranteed\")\n\n    def __init__(self, module_name, import_name, module_guaranteed, source_ref):\n        ExpressionImportHardBase.__init__(\n            self, module_name=module_name, source_ref=source_ref\n        )\n\n        self.import_name = import_name\n\n        self.module_guaranteed = module_guaranteed\n\n    def getDetails(self):\n        return {\n            \"module_name\": self.module_name,\n            \"import_name\": self.import_name,\n            \"module_guaranteed\": self.module_guaranteed,\n        }\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        return True\n\n    def finalize(self):\n        del self.parent\n\n    def getModuleName(self):\n        return self.module_name\n\n    def getImportName(self):\n        return self.import_name\n\n\nclass ExpressionImportModuleNameHardMaybeExists(ExpressionImportModuleNameHardBase):\n    \"\"\"Hard coded import names, e.g. of \"site.something\"\n\n    These are created for attributes of hard imported modules that are not know if\n    they exist or not.\n    \"\"\"\n\n    kind = \"EXPRESSION_IMPORT_MODULE_NAME_HARD_MAYBE_EXISTS\"\n\n    def computeExpressionRaw(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(AttributeError)\n\n        # Trace the module usage attempt.\n        trace_collection.onModuleUsageAttempt(self.getModuleUsageAttempt())\n\n        return self, None, None\n\n    @staticmethod\n    def mayHaveSideEffects():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n\nclass ExpressionImportModuleNameHardExists(ExpressionImportModuleNameHardBase):\n    \"\"\"Hard coded import names, e.g. of \"sys.stdout\"\n\n    These are directly created for some Python mechanics.\n    \"\"\"\n\n    kind = \"EXPRESSION_IMPORT_MODULE_NAME_HARD_EXISTS\"\n\n    def computeExpressionRaw(self, trace_collection):\n        if not self.module_guaranteed:\n            trace_collection.onExceptionRaiseExit(ImportError)\n\n        # Trace the module usage attempt.\n        trace_collection.onModuleUsageAttempt(self.getModuleUsageAttempt())\n\n        # As good as it gets.\n        return self, None, None\n\n    def mayHaveSideEffects(self):\n        return not self.module_guaranteed\n\n    def mayRaiseException(self, exception_type):\n        return not self.module_guaranteed\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        # Hard imports being called, generally have no problem with forward propagation.\n        return self.computeExpressionCall(\n            call_node=call_node,\n            call_args=call_args,\n            call_kw=call_kw,\n            trace_collection=trace_collection,\n        )\n\n\nclass ExpressionImportModuleNameHardExistsSpecificBase(\n    ExpressionImportModuleNameHardExists\n):\n    \"\"\"Base class for nodes that hard coded import names, e.g. of \"importlib.import_module\" name.\"\"\"\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ImportNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes related to importing modules or names.\n\nNormally imports are mostly relatively static, but Nuitka also attempts to\ncover the uses of \"__import__\" built-in and other import techniques, that\nallow dynamic values.\n\nIf other optimizations make it possible to predict these, the compiler can go\ndeeper that what it normally could. The import expression node can lead to\nmodules being added. After optimization it will be asked about used modules.\n\"\"\"\n\nimport sys\n\nfrom nuitka.__past__ import long, unicode, xrange\nfrom nuitka.code_generation.Reports import onMissingTrust\nfrom nuitka.HardImportRegistry import (\n    addModuleSingleAttributeNodeFactory,\n    hard_modules_aliases,\n    hard_modules_limited,\n    hard_modules_non_stdlib,\n    hard_modules_stdlib,\n    hard_modules_trust,\n    isHardModule,\n    isHardModuleWithoutSideEffect,\n    trust_constant,\n    trust_importable,\n    trust_may_exist,\n    trust_node,\n    trust_node_factory,\n    trust_undefined,\n)\nfrom nuitka.importing.Importing import (\n    isNonRaisingBuiltinModule,\n    isPackageDir,\n    locateModule,\n    makeModuleUsageAttempt,\n)\nfrom nuitka.importing.ImportResolving import resolveModuleName\nfrom nuitka.importing.Recursion import decideRecursion\nfrom nuitka.importing.StandardLibrary import isStandardLibraryPath\nfrom nuitka.Options import (\n    isExperimental,\n    isStandaloneMode,\n    shallMakeModule,\n    shallWarnUnusualCode,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.BuiltinParameterSpecs import (\n    BuiltinParameterSpec,\n    extractBuiltinArgs,\n)\nfrom nuitka.Tracing import unusual_logger\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingModuleMixin,\n    ChildrenExpressionBuiltinImportMixin,\n    ChildrenExpressionImportlibImportModuleCallMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ImportHardNodes import (\n    ExpressionImportHardBase,\n    ExpressionImportModuleNameHardExists,\n    ExpressionImportModuleNameHardExistsSpecificBase,\n    ExpressionImportModuleNameHardMaybeExists,\n)\nfrom .LocalsScopes import GlobalsDictHandle\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeRaiseExceptionReplacementExpression,\n    makeRaiseImportErrorReplacementExpression,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_module, tshape_module_builtin\nfrom .StatementBasesGenerated import StatementImportStarBase\n\n\ndef makeExpressionImportModuleNameHard(\n    module_name, import_name, module_guaranteed, source_ref\n):\n    if hard_modules_trust[module_name].get(import_name) is None:\n        return ExpressionImportModuleNameHardMaybeExists(\n            module_name=module_name,\n            import_name=import_name,\n            module_guaranteed=module_guaranteed,\n            source_ref=source_ref,\n        )\n    else:\n        return ExpressionImportModuleNameHardExists(\n            module_name=module_name,\n            import_name=import_name,\n            module_guaranteed=module_guaranteed,\n            source_ref=source_ref,\n        )\n\n\nclass ExpressionImportAllowanceMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self, using_module_name):\n        self.using_module_name = using_module_name\n\n        if self.finding == \"not-found\":\n            self.allowed = False\n        elif self.finding == \"built-in\":\n            self.allowed = True\n        elif self.module_name in hard_modules_stdlib:\n            self.allowed = True\n        else:\n            self.allowed, _reason = decideRecursion(\n                using_module_name=self.using_module_name,\n                module_filename=self.module_filename,\n                module_name=self.module_name,\n                module_kind=self.module_kind,\n            )\n\n            # In case of hard imports, that are not forbidden explicitly, allow their use\n            # anyway.\n            if self.allowed is None and self.isExpressionImportModuleHard():\n                self.allowed = True\n\n\nclass ExpressionImportModuleFixed(ExpressionBase):\n    \"\"\"Hard coded import names, that we know to exist.\"\n\n    These created as result of builtin imports and \"importlib.import_module\" calls\n    that were compile time resolved, and for known module names.\n    \"\"\"\n\n    kind = \"EXPRESSION_IMPORT_MODULE_FIXED\"\n\n    __slots__ = (\n        \"module_name\",\n        \"value_name\",\n        \"found_module_name\",\n        \"found_module_filename\",\n        \"module_kind\",\n        \"finding\",\n    )\n\n    def __init__(self, module_name, value_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.module_name = ModuleName(module_name)\n        self.value_name = ModuleName(value_name)\n\n        self.finding = None\n\n        # If not found, we import the package at least\n        (\n            self.found_module_name,\n            self.found_module_filename,\n            self.module_kind,\n            self.finding,\n        ) = self._attemptFollow()\n\n    # TODO: This is called in constructor only, is it, then inline it.\n    def _attemptFollow(self):\n        found_module_name, found_module_filename, module_kind, finding = locateModule(\n            module_name=self.module_name,\n            parent_package=None,\n            level=0,\n        )\n\n        if self.finding == \"not-found\":\n            while True:\n                module_name = found_module_filename.getPackageName()\n\n                if module_name is None:\n                    break\n\n                (\n                    found_module_name,\n                    found_module_filename,\n                    module_kind,\n                    finding,\n                ) = locateModule(\n                    module_name=module_name,\n                    parent_package=None,\n                    level=0,\n                )\n\n                if self.finding != \"not-found\":\n                    break\n\n        return found_module_name, found_module_filename, module_kind, finding\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"module_name\": self.module_name, \"value_name\": self.value_name}\n\n    def getModuleName(self):\n        return self.module_name\n\n    def getValueName(self):\n        return self.value_name\n\n    @staticmethod\n    def mayHaveSideEffects():\n        # TODO: For included modules, we might be able to tell, not not done now.\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # TODO: For included modules, we might be able to tell, not not done now.\n        return True\n\n    def getTypeShape(self):\n        # TODO: This ought to be dead code, built-in modules have their own nodes now\n        # and may only be hard imports, but not this.\n        if self.module_name in sys.builtin_module_names:\n            return tshape_module_builtin\n        else:\n            return tshape_module\n\n    def getModuleUsageAttempt(self):\n        return makeModuleUsageAttempt(\n            module_name=self.found_module_name,\n            filename=self.found_module_filename,\n            finding=self.finding,\n            module_kind=self.module_kind,\n            level=0,\n            source_ref=self.source_ref,\n            reason=\"import\",\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Trace the module usage attempt.\n        trace_collection.onModuleUsageAttempt(self.getModuleUsageAttempt())\n\n        # Nothing to do about it.\n        return self, None, None\n\n    def computeExpressionImportName(self, import_node, import_name, trace_collection):\n        # TODO: For include modules, something might be possible here, consider self.allowance\n        # when that is implemented.\n        return self.computeExpressionAttribute(\n            lookup_node=import_node,\n            attribute_name=import_name,\n            trace_collection=trace_collection,\n        )\n\n\nclass ExpressionImportModuleBuiltin(ExpressionBase):\n    \"\"\"Hard coded import names, that we know to exist.\"\n\n    These created as result of builtin imports and \"importlib.import_module\" calls\n    that were compile time resolved, and for known module names.\n    \"\"\"\n\n    kind = \"EXPRESSION_IMPORT_MODULE_BUILTIN\"\n\n    __slots__ = (\n        \"module_name\",\n        \"value_name\",\n        \"module_kind\",\n        \"builtin_module\",\n    )\n\n    def __init__(self, module_name, value_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.module_name = ModuleName(module_name)\n        self.value_name = ModuleName(value_name)\n\n        self.builtin_module = __import__(module_name.asString())\n\n        # If not found, we import the package at least\n        _module_name, _module_filename, _module_kind, _finding = locateModule(\n            module_name=self.module_name,\n            parent_package=None,\n            level=0,\n        )\n\n        assert _module_name == self.module_name, _module_name\n        assert _finding == \"built-in\", _finding\n        assert _module_kind is None, _module_kind\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_module_builtin\n\n    def mayRaiseExceptionImportName(self, exception_type, import_name):\n        return not hasattr(self.builtin_module, import_name)\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"module_name\": self.module_name, \"value_name\": self.value_name}\n\n    def getModuleName(self):\n        return self.module_name\n\n    def getValueName(self):\n        return self.value_name\n\n    @staticmethod\n    def mayHaveSideEffects():\n        return True\n\n    def mayRaiseException(self, exception_type):\n        return isNonRaisingBuiltinModule(self.module_name) is not False\n\n    def getModuleUsageAttempt(self):\n        return makeModuleUsageAttempt(\n            module_name=self.module_name,\n            filename=None,\n            finding=\"built-in\",\n            module_kind=None,\n            level=0,\n            source_ref=self.source_ref,\n            reason=\"import\",\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Trace the module usage attempt.\n        trace_collection.onModuleUsageAttempt(self.getModuleUsageAttempt())\n\n        # Nothing to do about it.\n        return self, None, None\n\n    def computeExpressionImportName(self, import_node, import_name, trace_collection):\n        # TODO: For include modules, something might be possible here, consider self.allowance\n        # when that is implemented.\n        return self.computeExpressionAttribute(\n            lookup_node=import_node,\n            attribute_name=import_name,\n            trace_collection=trace_collection,\n        )\n\n\nclass ExpressionImportModuleHard(\n    ExpressionImportAllowanceMixin, ExpressionImportHardBase\n):\n    \"\"\"Hard coded import names, e.g. of \"__future__\"\n\n    These are directly created for some Python mechanics, but also due to\n    compile time optimization for imports of statically known modules.\n    \"\"\"\n\n    kind = \"EXPRESSION_IMPORT_MODULE_HARD\"\n\n    __slots__ = (\n        \"using_module_name\",\n        \"module\",\n        \"allowed\",\n        \"guaranteed\",\n        \"value_name\",\n        \"is_package\",\n    )\n\n    def __init__(self, using_module_name, module_name, value_name, source_ref):\n        ExpressionImportHardBase.__init__(\n            self, module_name=module_name, source_ref=source_ref\n        )\n\n        self.value_name = value_name\n\n        ExpressionImportAllowanceMixin.__init__(\n            self, using_module_name=using_module_name\n        )\n\n        if self.finding != \"not-found\" and isHardModuleWithoutSideEffect(\n            self.module_name\n        ):\n            __import__(self.module_name.asString())\n            self.module = sys.modules[self.value_name]\n\n            self.is_package = hasattr(self.module, \"__path__\")\n        else:\n            self.module = None\n            self.is_package = None\n\n        self.guaranteed = self.allowed and (\n            not shallMakeModule() or self.module_name not in hard_modules_non_stdlib\n        )\n\n    @staticmethod\n    def isExpressionImportModuleHard():\n        return True\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        return True\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\n            \"using_module_name\": self.using_module_name,\n            \"module_name\": self.module_name,\n            \"value_name\": self.value_name,\n        }\n\n    def getModuleName(self):\n        return self.module_name\n\n    def getValueName(self):\n        return self.value_name\n\n    def mayHaveSideEffects(self):\n        return self.module is None or not self.guaranteed\n\n    def mayRaiseException(self, exception_type):\n        return not self.allowed or self.mayHaveSideEffects()\n\n    def getTypeShape(self):\n        if self.module_name in sys.builtin_module_names:\n            return tshape_module_builtin\n        else:\n            return tshape_module\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Trace the module usage attempt.\n        trace_collection.onModuleUsageAttempt(self.getModuleUsageAttempt())\n\n        return self, None, None\n\n    def computeExpressionImportName(self, import_node, import_name, trace_collection):\n        return self._computeExpressionAttribute(\n            lookup_node=import_node,\n            attribute_name=import_name,\n            trace_collection=trace_collection,\n            is_import=True,\n        )\n\n    @staticmethod\n    def _getImportNameErrorString(module, module_name, name):\n        if python_version < 0x340:\n            return \"cannot import name %s\" % name\n        if python_version < 0x370:\n            return \"cannot import name %r\" % name\n        elif isStandaloneMode():\n            return \"cannot import name %r from %r\" % (name, module_name)\n        else:\n            return \"cannot import name %r from %r (%s)\" % (\n                name,\n                module_name,\n                module.__file__ if hasattr(module, \"__file__\") else \"unknown location\",\n            )\n\n    def _makeRaiseExceptionReplacementExpression(\n        self, lookup_node, attribute_name, is_import\n    ):\n        if is_import:\n            return makeRaiseExceptionReplacementExpression(\n                expression=lookup_node,\n                exception_type=\"ImportError\",\n                exception_value=self._getImportNameErrorString(\n                    self.module, self.value_name, attribute_name\n                ),\n            )\n        else:\n            return makeRaiseExceptionReplacementExpression(\n                expression=lookup_node,\n                exception_type=\"AttributeError\",\n                # TODO: Not the right error message\n                exception_value=self._getImportNameErrorString(\n                    self.module, self.value_name, attribute_name\n                ),\n            )\n\n    def _computeExpressionAttribute(\n        self, lookup_node, attribute_name, trace_collection, is_import\n    ):\n        # Return driven handling of many cases\n        # pylint: disable=too-many-branches,too-many-return-statements\n\n        if self.allowed:\n            full_name = self.value_name.getChildNamed(attribute_name)\n            full_name = ModuleName(hard_modules_aliases.get(full_name, full_name))\n\n            if isHardModule(full_name):\n                new_node = ExpressionImportModuleHard(\n                    using_module_name=self.using_module_name,\n                    module_name=full_name,\n                    value_name=full_name,\n                    source_ref=lookup_node.source_ref,\n                )\n\n                return (\n                    new_node,\n                    \"new_expression\",\n                    \"Hard module '%s' submodule '%s' pre-computed.\"\n                    % (self.value_name, attribute_name),\n                )\n\n            if self.value_name in hard_modules_trust:\n                trust = hard_modules_trust[self.value_name].get(\n                    attribute_name, trust_undefined\n                )\n            else:\n                trust = trust_undefined\n\n            if trust is trust_importable:\n                # TODO: Change this is a hard module import itself, currently these are not all trusted\n                # themselves yet. We do not have to indicate exception, but it makes no sense to annotate\n                # that here at this point.\n                trace_collection.onExceptionRaiseExit(BaseException)\n            elif trust is trust_may_exist:\n                trace_collection.onExceptionRaiseExit(BaseException)\n            elif (\n                trust is not trust_undefined\n                and self.module is not None\n                and not hasattr(self.module, attribute_name)\n            ):\n                # TODO: Unify with below branches.\n                trace_collection.onExceptionRaiseExit(ImportError)\n\n                new_node = self._makeRaiseExceptionReplacementExpression(\n                    lookup_node=lookup_node,\n                    attribute_name=attribute_name,\n                    is_import=is_import,\n                )\n\n                return (\n                    new_node,\n                    \"new_raise\",\n                    \"Hard module '%s' attribute missing '%s* pre-computed.\"\n                    % (self.value_name, attribute_name),\n                )\n            else:\n                if trust is trust_undefined:\n                    # Need to attempt module imports if this is for an import\n                    # lookup of code like \"from value_name import attribute_name\".\n                    if self.is_package:\n                        full_name = self.value_name.getChildNamed(attribute_name)\n\n                        (\n                            _sub_module_name,\n                            _sub_module_filename,\n                            _sub_module_kind,\n                            finding,\n                        ) = locateModule(\n                            module_name=full_name,\n                            parent_package=None,\n                            level=0,\n                        )\n\n                        if finding != \"not-found\":\n                            trace_collection.onExceptionRaiseExit(ImportError)\n\n                            result = makeExpressionImportModuleFixed(\n                                using_module_name=self.getParentModule().getFullName(),\n                                module_name=full_name,\n                                value_name=full_name,\n                                source_ref=lookup_node.getSourceReference(),\n                            )\n\n                            return (\n                                result,\n                                \"new_expression\",\n                                \"Attribute lookup '%s' of hard module '%s' becomes hard module name import.\"\n                                % (self.value_name, attribute_name),\n                            )\n\n                    trace_collection.onExceptionRaiseExit(ImportError)\n\n                    onMissingTrust(\n                        \"Hard module '%s' attribute '%s' missing trust config for existing value.\",\n                        lookup_node.getSourceReference(),\n                        self.value_name,\n                        attribute_name,\n                    )\n                elif trust is trust_constant and self.module is not None:\n                    # Make sure it's actually there, and not becoming the getattr default by accident.\n                    assert hasattr(self.module, attribute_name), self\n\n                    return (\n                        makeConstantReplacementNode(\n                            constant=getattr(self.module, attribute_name),\n                            node=lookup_node,\n                            user_provided=True,\n                        ),\n                        \"new_constant\",\n                        \"Hard module '%s' imported '%s' pre-computed to constant value.\"\n                        % (self.value_name, attribute_name),\n                    )\n                elif trust is trust_node:\n                    # TODO: Unify with other branches.\n                    trace_collection.onExceptionRaiseExit(ImportError)\n\n                    result = trust_node_factory[self.value_name, attribute_name](\n                        source_ref=lookup_node.source_ref\n                    )\n\n                    return (\n                        result,\n                        \"new_expression\",\n                        \"Attribute lookup '%s' of hard module '%s' becomes node '%s'.\"\n                        % (self.value_name, attribute_name, result.kind),\n                    )\n                else:\n                    result = makeExpressionImportModuleNameHard(\n                        module_name=self.value_name,\n                        import_name=attribute_name,\n                        module_guaranteed=self.guaranteed,\n                        source_ref=lookup_node.getSourceReference(),\n                    )\n\n                    return (\n                        result,\n                        \"new_expression\",\n                        \"Attribute lookup '%s' of hard module '%s' becomes hard module name import.\"\n                        % (self.value_name, attribute_name),\n                    )\n\n        else:\n            # Nothing can be known, but lets not do control flow escape, that is just\n            # too unlikely.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        return self._computeExpressionAttribute(\n            lookup_node=lookup_node,\n            attribute_name=attribute_name,\n            trace_collection=trace_collection,\n            is_import=False,\n        )\n\n    def hasShapeTrustedAttributes(self):\n        return True\n\n\nimportlib_import_module_spec = BuiltinParameterSpec(\n    \"importlib.import_module\", (\"name\", \"package\"), default_count=1\n)\n\n\nclass ExpressionImportlibImportModuleRef(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_IMPORT_MODULE_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name=\"importlib\",\n            import_name=\"import_module\",\n            module_guaranteed=True,\n            source_ref=source_ref,\n        )\n\n    @staticmethod\n    def getDetails():\n        return {}\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=ExpressionImportlibImportModuleCall,\n            builtin_spec=importlib_import_module_spec,\n        )\n\n        return result, \"new_expression\", \"Call of 'importlib.import_module' recognized.\"\n\n\ndef _getImportNameAsStr(value):\n    if value is None:\n        result = None\n    else:\n        result = value.getCompileTimeConstant()\n\n    if type(result) in (str, unicode):\n        # TODO: This is not handling decoding errors all that well.\n        if str is not unicode and type(result) is unicode:\n            result = str(result)\n\n    return result\n\n\nclass ExpressionImportlibImportModuleCall(\n    ChildrenExpressionImportlibImportModuleCallMixin, ExpressionBase\n):\n    \"\"\"Call to \"importlib.import_module\" \"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_IMPORT_MODULE_CALL\"\n\n    named_children = \"name\", \"package|optional\"\n\n    def __init__(self, name, package, source_ref):\n        ChildrenExpressionImportlibImportModuleCallMixin.__init__(\n            self,\n            name=name,\n            package=package,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def _resolveImportLibArgs(module_name, package_name):\n        # Relative imports need to be resolved by package name.\n        if module_name.startswith(\".\"):\n            if not package_name:\n                return None\n\n                # TODO: Static exception should be created and warned about, Python2/Python3 differ\n                # raise TypeError(\"relative imports require the 'package' argument\")\n                # msg = (\"the 'package' argument is required to perform a relative import for {!r}\")\n                # raise TypeError(msg.format(name))\n\n            level = 0\n            for character in module_name:\n                if character != \".\":\n                    break\n                level += 1\n            module_name = module_name[level:]\n\n            dot = len(package_name)\n            for _i in xrange(level, 1, -1):\n                try:\n                    dot = package_name.rindex(\".\", 0, dot)\n                except ValueError:\n                    return None\n                    # TODO: Static exception should be created and warned about.\n                    # raise ValueError(\"attempted relative import beyond top-level package\")\n\n            package_name = package_name[:dot]\n            if module_name == \"\":\n                return package_name\n            else:\n                return \"%s.%s\" % (package_name, module_name)\n\n        return module_name\n\n    def computeExpression(self, trace_collection):\n        module_name = self.subnode_name\n        package_name = self.subnode_package\n\n        if (\n            package_name is None or package_name.isCompileTimeConstant()\n        ) and module_name.isCompileTimeConstant():\n            imported_module_name = _getImportNameAsStr(module_name)\n            imported_package_name = _getImportNameAsStr(package_name)\n\n            if (\n                imported_package_name is None or type(imported_package_name) is str\n            ) and type(imported_module_name) is str:\n                resolved_module_name = self._resolveImportLibArgs(\n                    imported_module_name, imported_package_name\n                )\n\n                if resolved_module_name is not None:\n                    # Importing may raise an exception obviously, unless we know it will\n                    # not.\n                    trace_collection.onExceptionRaiseExit(BaseException)\n\n                    result = makeExpressionImportModuleFixed(\n                        using_module_name=self.getParentModule().getFullName(),\n                        module_name=resolved_module_name,\n                        value_name=resolved_module_name,\n                        source_ref=self.source_ref,\n                    )\n\n                    return (\n                        result,\n                        \"new_expression\",\n                        \"Resolved importlib.import_module call to import of '%s'.\"\n                        % resolved_module_name,\n                    )\n\n        # TODO: This is special for this node, need to support for for call base of hard imports\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Importing may raise an exception obviously, unless we know it will\n        # not.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: May return a module or module variable reference of some sort in\n        # the future with embedded modules.\n        return self, None, None\n\n\naddModuleSingleAttributeNodeFactory(\n    \"importlib\", \"import_module\", ExpressionImportlibImportModuleRef\n)\n\n\nclass ExpressionBuiltinImport(ChildrenExpressionBuiltinImportMixin, ExpressionBase):\n    __slots__ = (\n        \"follow_attempted\",\n        \"finding\",\n        \"used_modules\",\n    )\n\n    kind = \"EXPRESSION_BUILTIN_IMPORT\"\n\n    named_children = (\n        \"name|setter\",\n        \"globals_arg|optional\",\n        \"locals_arg|optional\",\n        \"fromlist|optional\",\n        \"level|optional\",\n    )\n\n    def __init__(self, name, globals_arg, locals_arg, fromlist, level, source_ref):\n        ChildrenExpressionBuiltinImportMixin.__init__(\n            self,\n            name=name,\n            globals_arg=globals_arg,\n            locals_arg=locals_arg,\n            fromlist=fromlist,\n            level=level,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.follow_attempted = False\n\n        # The modules actually referenced in that import if it can be detected. Name\n        # imports are considered too.\n        self.used_modules = []\n\n        self.finding = None\n\n    def _getLevelValue(self):\n        parent_module = self.getParentModule()\n        level = self.subnode_level\n\n        if level is None:\n            return 0 if parent_module.getFutureSpec().isAbsoluteImport() else -1\n        elif not level.isCompileTimeConstant():\n            return None\n        else:\n            level_value = level.getCompileTimeConstant()\n\n            # TODO: Catch this as a static error maybe.\n            if type(level_value) not in (int, long):\n                return None\n\n            return level_value\n\n    def _attemptFollow(self, module_name):\n        # Complex stuff, pylint: disable=too-many-branches,too-many-locals\n\n        # Without the level value, we don't know what it is.\n        level_value = self._getLevelValue()\n        if level_value is None:\n            return\n\n        parent_module = self.getParentModule()\n\n        if level_value != 0:\n            parent_package = parent_module.getFullName()\n            if not parent_module.isCompiledPythonPackage():\n                parent_package = parent_package.getPackageName()\n        else:\n            parent_package = None\n\n        module_name_resolved = resolveModuleName(module_name)\n        if module_name_resolved != module_name:\n            module_name = module_name_resolved\n\n            self.setChildName(\n                makeConstantReplacementNode(\n                    constant=module_name.asString(),\n                    node=self.subnode_name,\n                    user_provided=True,\n                )\n            )\n\n        module_name = ModuleName(module_name)\n        module_name_found, module_filename, module_kind, self.finding = locateModule(\n            module_name=ModuleName(module_name),\n            parent_package=parent_package,\n            level=level_value,\n        )\n\n        self.used_modules = [\n            makeModuleUsageAttempt(\n                module_name=module_name_found,\n                filename=module_filename,\n                module_kind=module_kind,\n                finding=self.finding,\n                level=level_value,\n                source_ref=self.source_ref,\n                reason=\"import\",\n            )\n        ]\n\n        if self.finding != \"not-found\":\n            module_name = module_name_found\n\n            import_list = self.subnode_fromlist\n\n            if import_list is not None:\n                if import_list.isCompileTimeConstant():\n                    import_list = import_list.getCompileTimeConstant()\n\n                if type(import_list) not in (tuple, list):\n                    import_list = None\n\n            if (\n                module_filename is not None\n                and import_list\n                and isPackageDir(module_filename)\n            ):\n                for import_item in import_list:\n                    if import_item == \"*\":\n                        continue\n\n                    (\n                        name_import_module_name,\n                        name_import_module_filename,\n                        name_import_module_kind,\n                        name_import_finding,\n                    ) = locateModule(\n                        module_name=ModuleName(import_item),\n                        parent_package=module_name,\n                        level=1,  # Relative import\n                    )\n\n                    self.used_modules.append(\n                        makeModuleUsageAttempt(\n                            module_name=name_import_module_name,\n                            filename=name_import_module_filename,\n                            module_kind=name_import_module_kind,\n                            finding=name_import_finding,\n                            level=1,\n                            source_ref=self.source_ref,\n                            reason=\"import\",\n                        )\n                    )\n\n            return module_filename\n        else:\n            while True:\n                module_name = module_name.getPackageName()\n\n                if not module_name:\n                    break\n\n                (\n                    found_module_name,\n                    module_filename,\n                    module_kind,\n                    finding,\n                ) = locateModule(\n                    module_name=module_name,\n                    parent_package=parent_package,\n                    level=level_value,\n                )\n\n                self.used_modules.append(\n                    makeModuleUsageAttempt(\n                        module_name=found_module_name,\n                        filename=module_filename,\n                        module_kind=module_kind,\n                        finding=finding,\n                        level=level_value,\n                        source_ref=self.source_ref,\n                        reason=\"import\",\n                    )\n                )\n\n                if finding != \"not-found\":\n                    break\n\n            return None\n\n    def _getImportedValueName(self, imported_module_name):\n        from_list_truth = (\n            self.subnode_fromlist is not None and self.subnode_fromlist.getTruthValue()\n        )\n\n        if from_list_truth is True:\n            return imported_module_name\n        else:\n            return imported_module_name.getTopLevelPackageName()\n\n    def computeExpression(self, trace_collection):\n        # Attempt to recurse if not already done, many cases to consider and its\n        # return driven, pylint: disable=too-many-branches,too-many-return-statements\n        if self.follow_attempted:\n            if self.finding == \"not-found\":\n                # Importing and not finding, may raise an exception obviously.\n                trace_collection.onExceptionRaiseExit(BaseException)\n            else:\n                # If we know it exists, only RuntimeError shall occur.\n                trace_collection.onExceptionRaiseExit(RuntimeError)\n\n            # Trace the module usage attempts.\n            for module_usage_attempt in self.used_modules:\n                trace_collection.onModuleUsageAttempt(module_usage_attempt)\n\n            # We stay here.\n            return self, None, None\n\n        # Importing may raise an exception obviously, unless we know it will\n        # not.\n        if self.finding != \"built-in\":\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        module_name = self.subnode_name\n\n        if module_name.isCompileTimeConstant():\n            imported_module_name = module_name.getCompileTimeConstant()\n\n            module_filename = self._attemptFollow(module_name=imported_module_name)\n            self.follow_attempted = True\n\n            # Trace the module usage attempts.\n            for module_usage_attempt in self.used_modules:\n                trace_collection.onModuleUsageAttempt(module_usage_attempt)\n\n            if type(imported_module_name) in (str, unicode):\n                if self.finding == \"relative\":\n                    parent_module = self.getParentModule()\n\n                    parent_package = parent_module.getFullName()\n                    if not parent_module.isCompiledPythonPackage():\n                        parent_package = parent_package.getPackageName()\n\n                    level_value = abs(self._getLevelValue())\n                    level_value -= 1\n\n                    while level_value > 0:\n                        parent_package = parent_package.getPackageName()\n                        level_value -= 1\n\n                    if imported_module_name != \"\":\n                        candidate_module_name = parent_package.getChildNamed(\n                            imported_module_name\n                        )\n                    else:\n                        candidate_module_name = parent_package\n\n                    if (\n                        candidate_module_name in hard_modules_non_stdlib\n                        or module_filename is None\n                        or isStandardLibraryPath(module_filename)\n                    ):\n                        result = ExpressionImportModuleHard(\n                            using_module_name=self.getParentModule().getFullName(),\n                            module_name=candidate_module_name,\n                            value_name=self._getImportedValueName(\n                                candidate_module_name\n                            ),\n                            source_ref=self.source_ref,\n                        )\n\n                        return (\n                            result,\n                            \"new_expression\",\n                            \"Lowered import %s module '%s' to hard import.\"\n                            % (\n                                (\n                                    \"hard import\"\n                                    if candidate_module_name in hard_modules_non_stdlib\n                                    else \"standard library\"\n                                ),\n                                candidate_module_name.asString(),\n                            ),\n                        )\n\n                imported_module_name = resolveModuleName(imported_module_name)\n\n                if self.finding == \"absolute\" and isHardModule(imported_module_name):\n                    if (\n                        imported_module_name in hard_modules_non_stdlib\n                        or module_filename is None\n                        or isStandardLibraryPath(module_filename)\n                    ):\n                        result = ExpressionImportModuleHard(\n                            using_module_name=self.getParentModule().getFullName(),\n                            module_name=imported_module_name,\n                            value_name=self._getImportedValueName(imported_module_name),\n                            source_ref=self.source_ref,\n                        )\n\n                        return (\n                            result,\n                            \"new_expression\",\n                            \"Lowered import %s module '%s' to hard import.\"\n                            % (\n                                (\n                                    \"hard import\"\n                                    if imported_module_name in hard_modules_non_stdlib\n                                    else \"standard library\"\n                                ),\n                                imported_module_name.asString(),\n                            ),\n                        )\n                    elif shallWarnUnusualCode():\n                        unusual_logger.warning(\n                            \"%s: Standard library module '%s' used from outside path %r.\"\n                            % (\n                                self.source_ref.getAsString(),\n                                imported_module_name.asString(),\n                                self.module_filename,\n                            )\n                        )\n\n                # Built-in module imports can be specialized right away.\n\n                if self.finding == \"built-in\":\n                    result = makeExpressionImportModuleBuiltin(\n                        using_module_name=self.getParentModule().getFullName(),\n                        module_name=imported_module_name,\n                        value_name=self._getImportedValueName(imported_module_name),\n                        source_ref=self.source_ref,\n                    )\n\n                    # TODO: This ought to preserve side effects from arguments\n                    # for full compatibility with strange uses of __import__\n                    return (\n                        result,\n                        \"new_expression\",\n                        \"Lowered import of built-in module '%s' to hard import.\"\n                        % imported_module_name.asString(),\n                    )\n\n                if self.finding == \"not-found\":\n                    if imported_module_name in hard_modules_limited:\n                        result = makeRaiseImportErrorReplacementExpression(\n                            expression=self, module_name=imported_module_name\n                        )\n\n                        return (\n                            result,\n                            \"new_raise\",\n                            \"Lowered import of missing standard library module '%s' to hard import.\"\n                            % imported_module_name.asString(),\n                        )\n\n                elif (\n                    isStandaloneMode()\n                    and self.used_modules\n                    and isExperimental(\"standalone-imports\")\n                ):\n                    result = makeExpressionImportModuleFixed(\n                        using_module_name=self.getParentModule().getFullName(),\n                        module_name=self.used_modules[0].module_name,\n                        value_name=self._getImportedValueName(\n                            self.used_modules[0].module_name\n                        ),\n                        source_ref=self.source_ref,\n                    )\n\n                    return (\n                        result,\n                        \"new_expression\",\n                        \"Lowered import of module '%s' to fixed import.\"\n                        % imported_module_name.asString(),\n                    )\n            else:\n                # TODO: This doesn't preserve side effects.\n\n                # Non-strings is going to raise an error.\n                (\n                    new_node,\n                    change_tags,\n                    message,\n                ) = trace_collection.getCompileTimeComputationResult(\n                    node=self,\n                    computation=lambda: __import__(\n                        module_name.getCompileTimeConstant()\n                    ),\n                    description=\"Replaced '__import__' call with non-string module name argument.\",\n                )\n\n                # Must fail, must not go on when it doesn't.\n                assert change_tags == \"new_raise\", module_name\n\n                return new_node, change_tags, message\n\n        # Trace the module usage attempts, doing it twice will not harm, this\n        # becomes a set.\n        for module_usage_attempt in self.used_modules:\n            trace_collection.onModuleUsageAttempt(module_usage_attempt)\n\n        # TODO: May return a module or module variable reference of some sort in\n        # the future with embedded modules.\n        return self, None, None\n\n    # TODO: Add computeExpressionImportName\n\n    def mayRaiseException(self, exception_type):\n        return self.finding != \"built-in\"\n\n\nclass StatementImportStar(StatementImportStarBase):\n    kind = \"STATEMENT_IMPORT_STAR\"\n\n    named_children = (\"module\",)\n    node_attributes = (\"target_scope\",)\n    auto_compute_handling = \"post_init,operation\"\n\n    def postInitNode(self):\n        # TODO: Abstract these things in some better way, and do not make it permanent.\n        if type(self.target_scope) is GlobalsDictHandle:\n            self.target_scope.markAsEscaped()\n\n    def getTargetDictScope(self):\n        return self.target_scope\n\n    def computeStatementOperation(self, trace_collection):\n        trace_collection.onLocalsDictEscaped(self.target_scope)\n\n        # Need to invalidate everything, and everything could be assigned to\n        # something else now.\n        trace_collection.removeAllKnowledge()\n\n        # We could always encounter that __all__ is a strange beast and causes\n        # the exception.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # Not done. TODO: Later we can try and check for \"__all__\" if it\n        # really can be that way.\n        return True\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"star import statement\"\n\n\nclass ExpressionImportName(ChildHavingModuleMixin, ExpressionBase):\n    kind = \"EXPRESSION_IMPORT_NAME\"\n\n    named_children = (\"module\",)\n\n    __slots__ = (\"import_name\", \"level\")\n\n    def __init__(self, module, import_name, level, source_ref):\n        ChildHavingModuleMixin.__init__(self, module=module)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.import_name = import_name\n        self.level = level\n\n        # Not allowed.\n        assert level is not None\n\n        assert module is not None\n\n    def getImportName(self):\n        return self.import_name\n\n    def getImportLevel(self):\n        return self.level\n\n    def getDetails(self):\n        return {\"import_name\": self.import_name, \"level\": self.level}\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_module.computeExpressionImportName(\n            import_node=self,\n            import_name=self.import_name,\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_module.mayRaiseExceptionImportName(\n            exception_type=exception_type, import_name=self.import_name\n        )\n\n\ndef makeExpressionImportModuleFixed(\n    using_module_name, module_name, value_name, source_ref\n):\n    module_name = resolveModuleName(module_name)\n    value_name = resolveModuleName(value_name)\n\n    if isHardModule(module_name):\n        return ExpressionImportModuleHard(\n            using_module_name=using_module_name,\n            module_name=module_name,\n            value_name=value_name,\n            source_ref=source_ref,\n        )\n    else:\n        return ExpressionImportModuleFixed(\n            module_name=module_name,\n            value_name=value_name,\n            source_ref=source_ref,\n        )\n\n\ndef makeExpressionImportModuleBuiltin(\n    using_module_name, module_name, value_name, source_ref\n):\n    module_name = resolveModuleName(module_name)\n    value_name = resolveModuleName(value_name)\n\n    if isHardModule(module_name):\n        return ExpressionImportModuleHard(\n            using_module_name=using_module_name,\n            module_name=module_name,\n            value_name=value_name,\n            source_ref=source_ref,\n        )\n    else:\n        return ExpressionImportModuleBuiltin(\n            module_name=module_name,\n            value_name=value_name,\n            source_ref=source_ref,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/IndicatorMixins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module for node class mixins that indicate runtime determined node facts.\n\nThese come into play after finalization only. All of the these attributes (and\nwe could use properties instead) are determined once or from a default and then\nused like this.\n\n\"\"\"\n\n\nclass MarkUnoptimizedFunctionIndicatorMixin(object):\n    \"\"\"Mixin for indication that a function contains an exec or star import.\n\n    These do not access global variables directly, but check a locals dictionary\n    first, because they do.\n    \"\"\"\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self, flags):\n        self.unoptimized_locals = flags is not None and \"has_exec\" in flags\n        self.unqualified_exec = flags is not None and \"has_unqualified_exec\" in flags\n\n    def isUnoptimized(self):\n        return self.unoptimized_locals\n\n    def isUnqualifiedExec(self):\n        return self.unoptimized_locals and self.unqualified_exec\n\n\nclass MarkNeedsAnnotationsMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        self.needs_annotations_dict = False\n\n    def markAsNeedsAnnotationsDictionary(self):\n        \"\"\"For use during building only. Indicate \"__annotations__\" need.\"\"\"\n        self.needs_annotations_dict = True\n\n    def needsAnnotationsDictionary(self):\n        \"\"\"For use during building only. Indicate \"__annotations__\" need.\"\"\"\n        return self.needs_annotations_dict\n\n\nclass EntryPointMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self):\n        self.trace_collection = None\n\n    def setTraceCollection(self, trace_collection):\n        previous = self.trace_collection\n        self.trace_collection = trace_collection\n        return previous\n\n    def getTraceCollection(self):\n        return self.trace_collection\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/InjectCNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes to inject C code into generated code. \"\"\"\n\nfrom .NodeBases import StatementBase\n\n\nclass StatementInjectCBase(StatementBase):\n    __slots__ = (\"c_code\",)\n\n    def __init__(self, c_code, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.c_code = c_code\n\n    def finalize(self):\n        del self.c_code\n\n    def computeStatement(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\nclass StatementInjectCCode(StatementInjectCBase):\n    kind = \"STATEMENT_INJECT_C_CODE\"\n\n\nclass StatementInjectCDecl(StatementInjectCBase):\n    kind = \"STATEMENT_INJECT_C_DECL\"\n\n    __slots__ = (\"c_code\",)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/IterationHandles.py",
    "content": "#     Copyright 2024, Batakrishna Sahu, mailto:<Batakrishna.Sahu@suiit.ac.in> find license text at end of file\n\n\n\"\"\" Node for Iteration Handles.\n\n\"\"\"\n\nimport math\nfrom abc import abstractmethod\n\nfrom nuitka.__past__ import xrange\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\n\n\nclass IterationHandleBase(getMetaClassBase(\"IterationHandle\", require_slots=True)):\n    \"\"\"Base class for Iteration Handles.\"\"\"\n\n    __slots__ = ()\n\n    @abstractmethod\n    def getNextValueExpression(self):\n        \"\"\"Abstract method to get next iteration value.\"\"\"\n\n    @abstractmethod\n    def getIterationValueWithIndex(self, value_index):\n        # TODO: Have one doc string, and it applies to all derived methods.\n        \"\"\"Abstract method for random access of the expression.\"\"\"\n\n    def getNextValueTruth(self):\n        \"\"\"Returns truth value of the next expression or Stops the\n        iteration handle if end is reached.\n        \"\"\"\n        iteration_value = self.getNextValueExpression()\n        if iteration_value is None:\n            return StopIteration\n        return iteration_value.getTruthValue()\n\n    def getAllElementTruthValue(self):\n        \"\"\"Returns truth value for 'all' on 'lists'. It returns\n        True: if all the elements of the list are True,\n        False: if any element in the list is False,\n        None: if number of elements in the list is greater than\n        256 or any element is Unknown.\n        \"\"\"\n        all_true = True\n        count = 0\n        while True:\n            truth_value = self.getNextValueTruth()\n            if truth_value is StopIteration:\n                break\n\n            if count > 256:\n                return None\n\n            if truth_value is False:\n                return False\n\n            if truth_value is None:\n                all_true = None\n\n            count += 1\n\n        return all_true\n\n\nclass ConstantIterationHandleBase(IterationHandleBase):\n    \"\"\"Base class for the Constant Iteration Handles.\n\n    Attributes\n    ----------\n    constant_node : node_object\n        Instance of the calling node.\n\n    Methods\n    -------\n    __repr__()\n        Prints representation of the ConstantIterationHandleBase\n        and it's children objects\n    getNextValueExpression()\n        Returns the next iteration value\n    getNextValueTruth()\n        Returns the boolean value of the next handle\n    \"\"\"\n\n    __slots__ = (\n        \"constant_node\",\n        \"iter\",\n    )\n\n    def __init__(self, constant_node):\n        assert constant_node.isIterableConstant()\n\n        self.constant_node = constant_node\n        self.iter = iter(self.constant_node.constant)\n\n    def __repr__(self):\n        return \"<%s of %r>\" % (self.__class__.__name__, self.constant_node)\n\n    def getNextValueExpression(self):\n        # TODO: Better doc string.\n        \"\"\"Returns truth value of the next expression or Stops the iteration handle\n        and returns None if end is reached.\n        \"\"\"\n        try:\n            from .ConstantRefNodes import makeConstantRefNode\n\n            return makeConstantRefNode(\n                constant=next(self.iter), source_ref=self.constant_node.source_ref\n            )\n        except StopIteration:\n            return None\n\n    def getNextValueTruth(self):\n        \"\"\"Return the truth value of the next iteration value or StopIteration.\"\"\"\n        try:\n            iteration_value = next(self.iter)\n        except StopIteration:\n            return StopIteration\n        return bool(iteration_value)\n\n    def getIterationValueWithIndex(self, value_index):\n        return None\n\n\nclass ConstantIndexableIterationHandle(ConstantIterationHandleBase):\n    \"\"\"Class for the constants that are indexable.\n\n    Attributes\n    ----------\n    constant_node : node_object\n        Instance of the calling node.\n\n    Methods\n    -------\n    getIterationValueWithIndex(value_index)\n        Sequential access of the constants\n    \"\"\"\n\n    __slots__ = ()\n\n    def getIterationValueWithIndex(self, value_index):\n        \"\"\"Tries to return constant value at the given index.\n\n        Parameters\n        ----------\n        value_index : int\n            Index value of the element to be returned\n        \"\"\"\n        try:\n            from .ConstantRefNodes import makeConstantRefNode\n\n            return makeConstantRefNode(\n                constant=self.constant_node.constant[value_index],\n                source_ref=self.constant_node.source_ref,\n            )\n        except IndexError:\n            return None\n\n\nclass ConstantTupleIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantListIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantStrIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantUnicodeIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantBytesIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantBytearrayIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantRangeIterationHandle(ConstantIndexableIterationHandle):\n    __slots__ = ()\n\n\nclass ConstantSetAndDictIterationHandleBase(ConstantIterationHandleBase):\n    \"\"\"Class for the set and dictionary constants.\"\"\"\n\n    __slots__ = ()\n\n\nclass ConstantSetIterationHandle(ConstantSetAndDictIterationHandleBase):\n    __slots__ = ()\n\n\nclass ConstantFrozensetIterationHandle(ConstantSetAndDictIterationHandleBase):\n    __slots__ = ()\n\n\nclass ConstantDictIterationHandle(ConstantSetAndDictIterationHandleBase):\n    __slots__ = ()\n\n\nclass ListAndTupleContainerMakingIterationHandle(IterationHandleBase):\n    \"\"\"Class for list and tuple container making expression\n\n    Attributes\n    ----------\n    constant_node : node_object\n        Instance of the calling node.\n\n    Methods\n    -------\n    __repr__()\n        Prints representation of the ListAndTupleContainerMakingIterationHandle\n        object\n    getNextValueExpression()\n        Returns the next iteration value\n    getNextValueTruth()\n        Returns the boolean value of the next handle\n    getIterationValueWithIndex(value_index)\n        Sequential access of the expression\n    \"\"\"\n\n    __slots__ = (\"elements\", \"iter\")\n\n    def __init__(self, elements):\n        self.elements = elements\n        self.iter = iter(self.elements)\n\n    def __repr__(self):\n        return \"<%s of %r>\" % (self.__class__.__name__, self.elements)\n\n    def getNextValueExpression(self):\n        \"\"\"Return the next iteration value or StopIteration exception\n        if the iteration has reached the end\n        \"\"\"\n        try:\n            return next(self.iter)\n        except StopIteration:\n            return None\n\n    def getIterationValueWithIndex(self, value_index):\n        \"\"\"Tries to return constant value at the given index.\n\n        Parameters\n        ----------\n        value_index : int\n            Index value of the element to be returned\n        \"\"\"\n        try:\n            return self.elements[value_index]\n        except IndexError:\n            return None\n\n\nclass RangeIterationHandleBase(IterationHandleBase):\n    \"\"\"Iteration handle class for range nodes\n\n    Attributes\n    ----------\n    low : int\n        Optional. An integer number specifying at which position to start. Default is 0\n    high : int\n        Optional. An integer number specifying at which position to end.\n    step : int\n        Optional. An integer number specifying the increment. Default is 1\n    \"\"\"\n\n    step = 1\n\n    __slots__ = (\"low\", \"iter\", \"source_ref\")\n\n    def __init__(self, low_value, range_value, source_ref):\n        self.low = low_value\n        self.iter = iter(range_value)\n        self.source_ref = source_ref\n\n    def getNextValueExpression(self):\n        \"\"\"Return the next iteration value or StopIteration exception\n        if the iteration has reached the end\n        \"\"\"\n        try:\n            from .ConstantRefNodes import makeConstantRefNode\n\n            return makeConstantRefNode(\n                constant=next(self.iter), source_ref=self.source_ref\n            )\n        except StopIteration:\n            return None\n\n    @abstractmethod\n    def getIterationLength(self):\n        \"\"\"return length\"\"\"\n\n    def getIterationValueWithIndex(self, value_index):\n        \"\"\"Tries to return constant value at the given index.\n\n        Parameters\n        ----------\n        value_index : int\n            Index value of the element to be returned\n        \"\"\"\n        if value_index < self.getIterationLength():\n            from .ConstantRefNodes import makeConstantRefNode\n\n            return makeConstantRefNode(\n                constant=value_index * self.step + self.low, source_ref=self.source_ref\n            )\n        else:\n            return IndexError\n\n    def getNextValueTruth(self):\n        \"\"\"Return the boolean value of the next iteration handle.\"\"\"\n        try:\n            iteration_value = next(self.iter)\n        except StopIteration:\n            return StopIteration\n        return bool(iteration_value)\n\n    @staticmethod\n    def getAllElementTruthValue():\n        return True\n\n\nclass IterationHandleRange1(RangeIterationHandleBase):\n    \"\"\"Iteration handle for range(low,)\"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, low_value, source_ref):\n        RangeIterationHandleBase.__init__(\n            self, low_value, xrange(low_value), source_ref\n        )\n\n    def getIterationLength(self):\n        return max(0, self.low)\n\n    @staticmethod\n    def getAllElementTruthValue():\n        return False\n\n\nclass IterationHandleRange2(RangeIterationHandleBase):\n    \"\"\"Iteration handle for ranges(low, high)\"\"\"\n\n    __slots__ = (\"high\",)\n\n    def __init__(self, low_value, high_value, source_ref):\n        RangeIterationHandleBase.__init__(\n            self, low_value, xrange(low_value, high_value), source_ref\n        )\n\n        self.high = high_value\n\n    def getIterationLength(self):\n        return max(0, self.high - self.low)\n\n\nclass IterationHandleRange3(RangeIterationHandleBase):\n    \"\"\"Iteration handle for ranges(low, high, step)\"\"\"\n\n    __slots__ = (\n        \"high\",\n        \"step\",\n    )\n\n    def __init__(self, low_value, high_value, step_value, source_ref):\n        RangeIterationHandleBase.__init__(\n            self, low_value, xrange(low_value, high_value, step_value), source_ref\n        )\n        self.high = high_value\n        self.step = step_value\n\n    def getIterationLength(self):\n        if self.low < self.high:\n            if self.step < 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(self.high - self.low) / self.step)\n        else:\n            if self.step > 0:\n                estimate = 0\n            else:\n                estimate = math.ceil(float(self.high - self.low) / self.step)\n\n        assert estimate >= 0\n\n        return int(estimate)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/KeyValuePairNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dictionary pairs, for use in dictionary building, calls, etc.\n\nThese represent the a=b part, as they occur in calls, and dictionary\nvalues, but they do not form a dictionary. As a sequence, they can\nhave order.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .BuiltinHashNodes import ExpressionBuiltinHash\nfrom .ChildrenHavingMixins import (\n    ChildHavingValueMixin,\n    ChildrenHavingKeyValueMixin,\n    ChildrenHavingValueKeyMixin,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\n\n\nclass ExpressionKeyValuePairMixin(object):\n    __slots__ = ()\n\n    @staticmethod\n    def isExpressionKeyValuePair():\n        return True\n\n    @abstractmethod\n    def mayKeyRaiseException(self, exception_type):\n        pass\n\n    @abstractmethod\n    def mayValueRaiseException(self, exception_type):\n        pass\n\n    @abstractmethod\n    def getKeyNode(self):\n        pass\n\n    @abstractmethod\n    def getValueNode(self):\n        pass\n\n\nclass ExpressionKeyValuePairNonConstantMixin(ExpressionKeyValuePairMixin):\n    __slots__ = ()\n\n    def computeExpression(self, trace_collection):\n        key = self.subnode_key\n\n        hashable = key.isKnownToBeHashable()\n\n        # If not known to be hashable, that can raise an exception.\n        if not hashable:\n            trace_collection.onExceptionRaiseExit(TypeError)\n\n        if hashable is False:\n            # TODO: If it's not hashable, we should turn it into a raise, it's\n            # just difficult to predict the exception value precisely, as it\n            # could be e.g. (2, []), and should then complain about the list.\n            pass\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        key = self.subnode_key\n\n        return (\n            key.mayRaiseException(exception_type)\n            or key.isKnownToBeHashable() is not True\n            or self.subnode_value.mayRaiseException(exception_type)\n        )\n\n    def isKeyKnownToBeHashable(self):\n        return self.subnode_key.isKnownToBeHashable()\n\n    def extractSideEffects(self):\n        if self.subnode_key.isKnownToBeHashable() is True:\n            key_part = self.subnode_key.extractSideEffects()\n        else:\n            key_part = (\n                ExpressionBuiltinHash(\n                    value=self.subnode_key, source_ref=self.subnode_key.source_ref\n                ),\n            )\n\n        if python_version < 0x350:\n            return self.subnode_value.extractSideEffects() + key_part\n        else:\n            return key_part + self.subnode_value.extractSideEffects()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_key.onContentEscapes(trace_collection)\n        self.subnode_value.onContentEscapes(trace_collection)\n\n    def isCompileTimeConstant(self):\n        # Note: Values are more often not constant, short circuits faster this way around\n        return (\n            self.subnode_value.isCompileTimeConstant()\n            and self.subnode_key.isCompileTimeConstant()\n        )\n\n    def isKeyExpressionConstantStrRef(self):\n        return self.subnode_key.isKeyExpressionConstantStrRef()\n\n    def getKeyCompileTimeConstant(self):\n        return self.subnode_key.getCompileTimeConstant()\n\n    def getValueCompileTimeConstant(self):\n        return self.subnode_value.getCompileTimeConstant()\n\n    def mayKeyRaiseException(self, exception_type):\n        return self.subnode_key.mayRaiseException(exception_type)\n\n    def mayValueRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def getKeyNode(self):\n        return self.subnode_key\n\n    def getValueNode(self):\n        return self.subnode_value\n\n    def getCompatibleSourceReference(self):\n        return self.subnode_value.getCompatibleSourceReference()\n\n\nclass ExpressionKeyValuePairOld(\n    ExpressionKeyValuePairNonConstantMixin,\n    SideEffectsFromChildrenMixin,\n    ChildrenHavingValueKeyMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_KEY_VALUE_PAIR_OLD\"\n\n    python_version_spec = \"< 0x350\"\n\n    # They changed the order of evaluation only with Python >=3.5 to what you normally would expect.\n    named_children = (\"value\", \"key\")\n\n    def __init__(self, value, key, source_ref):\n        ChildrenHavingValueKeyMixin.__init__(\n            self,\n            value=value,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\nclass ExpressionKeyValuePairNew(\n    ExpressionKeyValuePairNonConstantMixin,\n    SideEffectsFromChildrenMixin,\n    ChildrenHavingKeyValueMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_KEY_VALUE_PAIR_NEW\"\n\n    python_version_spec = \">= 0x350\"\n\n    # They changed the order of evaluation with 3.5 to what you normally would expect.\n    named_children = (\"key\", \"value\")\n\n    def __init__(self, key, value, source_ref):\n        ChildrenHavingKeyValueMixin.__init__(\n            self,\n            key=key,\n            value=value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n\n# Allow other code to forget about it.\nif python_version < 0x350:\n    ExpressionKeyValuePair = ExpressionKeyValuePairOld\nelse:\n    ExpressionKeyValuePair = ExpressionKeyValuePairNew\n\n\nclass ExpressionKeyValuePairConstantKey(\n    ExpressionKeyValuePairMixin,\n    SideEffectsFromChildrenMixin,\n    ChildHavingValueMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_KEY_VALUE_PAIR_CONSTANT_KEY\"\n\n    named_children = (\"value\",)\n\n    __slots__ = (\"key\",)\n\n    def __init__(self, key, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.key = key\n\n    def getDetails(self):\n        return {\"key\": self.key}\n\n    @staticmethod\n    def isKeyKnownToBeHashable():\n        return True\n\n    def computeExpression(self, trace_collection):\n        # Nothing to do, we are hashable and everything.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def extractSideEffects(self):\n        return self.subnode_value.extractSideEffects()\n\n    def onContentEscapes(self, trace_collection):\n        self.subnode_value.onContentEscapes(trace_collection)\n\n    def isCompileTimeConstant(self):\n        return self.subnode_value.isCompileTimeConstant()\n\n    def isKeyExpressionConstantStrRef(self):\n        return type(self.key) is str\n\n    def getKeyCompileTimeConstant(self):\n        return self.key\n\n    def getValueCompileTimeConstant(self):\n        return self.subnode_value.getCompileTimeConstant()\n\n    @staticmethod\n    def mayKeyRaiseException(exception_type):\n        # pylint: disable\n        return False\n\n    def mayValueRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def getKeyNode(self):\n        return makeConstantRefNode(constant=self.key, source_ref=self.source_ref)\n\n    def getValueNode(self):\n        return self.subnode_value\n\n    def getCompatibleSourceReference(self):\n        return self.subnode_value.getCompatibleSourceReference()\n\n\nclass ExpressionKeyValuePairConstantKeyValue(\n    ExpressionKeyValuePairMixin, ExpressionNoSideEffectsMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_KEY_VALUE_PAIR_CONSTANT_KEY_VALUE\"\n\n    __slots__ = (\"key\", \"value\")\n\n    def __init__(self, key, value, source_ref):\n        self.key = key\n        self.value = value\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def finalize(self):\n        del self.key\n        del self.value\n\n    def getDetails(self):\n        return {\"key\": self.key, \"value\": self.value}\n\n    @staticmethod\n    def isKeyKnownToBeHashable():\n        return True\n\n    def computeExpressionRaw(self, trace_collection):\n        # Nothing to do, we are hashable and everything.\n        return self, None, None\n\n    @staticmethod\n    def isCompileTimeConstant():\n        return True\n\n    def isKeyExpressionConstantStrRef(self):\n        return type(self.key) is str\n\n    def getKeyCompileTimeConstant(self):\n        return self.key\n\n    def getValueCompileTimeConstant(self):\n        return self.value\n\n    @staticmethod\n    def mayKeyRaiseException(exception_type):\n        return False\n\n    def mayValueRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def getKeyNode(self):\n        return makeConstantRefNode(\n            constant=self.key, source_ref=self.source_ref, user_provided=True\n        )\n\n    def getValueNode(self):\n        # TODO: Actually trace user provided for the key/value too, but\n        # it seems excessive now.\n        return makeConstantRefNode(\n            constant=self.value, source_ref=self.source_ref, user_provided=True\n        )\n\n\ndef makeExpressionPairs(keys, values):\n    assert len(keys) == len(values)\n\n    return tuple(\n        makeExpressionKeyValuePair(key=key, value=value)\n        for key, value in zip(keys, values)\n    )\n\n\ndef makeExpressionKeyValuePair(key, value):\n    # Detect constant key value that is hashable and use preferred node type for that.\n    if key.isCompileTimeConstant() and key.isKnownToBeHashable():\n        return makeExpressionKeyValuePairConstantKey(\n            key=key.getCompileTimeConstant(), value=value\n        )\n    else:\n        return ExpressionKeyValuePair(\n            key=key,\n            value=value,\n            source_ref=value.getSourceReference(),\n        )\n\n\ndef makeExpressionKeyValuePairConstantKey(key, value):\n    if value.isCompileTimeConstant():\n        return ExpressionKeyValuePairConstantKeyValue(\n            key=key,\n            value=value.getCompileTimeConstant(),\n            source_ref=value.getSourceReference(),\n        )\n    else:\n        return ExpressionKeyValuePairConstantKey(\n            key=key,\n            value=value,\n            source_ref=value.getSourceReference(),\n        )\n\n\ndef makeKeyValuePairExpressionsFromKwArgs(pairs):\n    return tuple(\n        makeExpressionKeyValuePairConstantKey(\n            key=key,\n            value=value,\n        )\n        for key, value in pairs\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ListOperationNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that build and operate on lists.\"\"\"\n\n# from .ExpressionBasesGenerated import ChildrenExpressionListOperationExtendMixin\nfrom .ChildrenHavingMixins import (\n    ChildHavingListArgMixin,\n    ChildrenExpressionListOperationExtendMixin,\n    ChildrenHavingListArgIndexItemMixin,\n    ChildrenHavingListArgIndexMixin,\n    ChildrenHavingListArgKeyMixin,\n    ChildrenHavingListArgKeyOptionalReverseMixin,\n    ChildrenHavingListArgValueMixin,\n    ChildrenHavingListArgValueStartMixin,\n    ChildrenHavingListArgValueStartStopMixin,\n)\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionBasesGenerated import (\n    ExpressionListOperationAppendBase,\n    ExpressionListOperationClearBase,\n    ExpressionListOperationCountBase,\n    ExpressionListOperationReverseBase,\n)\nfrom .ExpressionShapeMixins import ExpressionIntOrLongExactMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\n\n\nclass ExpressionListOperationAppend(ExpressionListOperationAppendBase):\n    \"\"\"This operation represents l.append(object).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_APPEND\"\n\n    named_children = (\"list_arg\", \"item\")\n    auto_compute_handling = \"no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # The state of the object changes, and we not yet trace list state.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # This lets the value added to the list escape.\n        self.subnode_item.onContentEscapes(trace_collection)\n\n        # No exception is raised, we ignore MemoryError.\n\n        return self, None, None\n\n\nclass ExpressionListOperationClear(ExpressionListOperationClearBase):\n    \"\"\"This operation represents l.clear().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_CLEAR\"\n\n    named_children = (\"list_arg\",)\n    auto_compute_handling = \"no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # The state of the object changes, and we not yet trace list state, but this would\n        # now of course be empty.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        return self, None, None\n\n\nclass ExpressionListOperationCopy(\n    SideEffectsFromChildrenMixin, ChildHavingListArgMixin, ExpressionBase\n):\n    \"\"\"This operation represents l.copy().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_COPY\"\n\n    named_children = (\"list_arg\",)\n\n    def __init__(self, list_arg, source_ref):\n        ChildHavingListArgMixin.__init__(\n            self,\n            list_arg=list_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # This lets the value previously in that list escape.\n        self.subnode_list_arg.onContentEscapes(trace_collection)\n\n        # Might give MemoryError\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n# TODO: The generator doesn't handle int or long yet.\nclass ExpressionListOperationCount(\n    SideEffectsFromChildrenMixin,\n    ExpressionIntOrLongExactMixin,\n    ExpressionListOperationCountBase,\n):\n    \"\"\"This operation represents l.count().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_COUNT\"\n\n    named_children = (\n        \"list_arg\",\n        \"value\",\n    )\n\n    auto_compute_handling = \"final,no_raise\"\n\n    # TODO: With list tracing, the size of the list should be a worthwhile first goal.\n    # TODO: Is not no_raise\n\n\nclass ExpressionListOperationExtend(\n    ChildrenExpressionListOperationExtendMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_LIST_OPERATION_EXTEND\"\n\n    named_children = (\"list_arg\", \"value\")\n\n    def __init__(self, list_arg, value, source_ref):\n        ChildrenExpressionListOperationExtendMixin.__init__(\n            self,\n            list_arg=list_arg,\n            value=value,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # This lets the value added to the list escape.\n        self.subnode_value.onContentEscapes(trace_collection)\n\n        # Iteration could escape or raise, but of course not for\n        # all shapes.\n        trace_collection.onControlFlowEscape(self)\n\n        # raises ValueError when the value is not found\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionListOperationExtendForUnpack(ExpressionListOperationExtend):\n    kind = \"EXPRESSION_LIST_OPERATION_EXTEND_FOR_UNPACK\"\n\n\n# TODO: The generator doesn't handle int or long yet.\nclass ExpressionListOperationIndex2(\n    ExpressionIntOrLongExactMixin, ChildrenHavingListArgValueMixin, ExpressionBase\n):\n    \"\"\"This operation represents l.index(value).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_INDEX2\"\n    named_children = (\"list_arg\", \"value\")\n\n    def __init__(self, list_arg, value, source_ref):\n        ChildrenHavingListArgValueMixin.__init__(self, list_arg=list_arg, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # Calling \"__index__\" may not have to do this for all shapes.\n        self.subnode_value.onContentEscapes(trace_collection)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # raises ValueError when the value is not found\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Could become more predictable, but then maybe it's optimized away too.\n        return True\n\n\n# TODO: The generator doesn't handle int or long yet.\nclass ExpressionListOperationIndex3(\n    ExpressionIntOrLongExactMixin, ChildrenHavingListArgValueStartMixin, ExpressionBase\n):\n    \"\"\"This operation represents l.index(value, start).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_INDEX3\"\n    named_children = (\"list_arg\", \"value\", \"start\")\n\n    def __init__(self, list_arg, value, start, source_ref):\n        ChildrenHavingListArgValueStartMixin.__init__(\n            self, list_arg=list_arg, value=value, start=start\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        self.subnode_value.onContentEscapes(trace_collection)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # raises ValueError when the value is not found\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Could become more predictable, but then maybe it's optimized away too.\n        return True\n\n\n# TODO: The generator doesn't handle int or long yet.\nclass ExpressionListOperationIndex4(\n    ExpressionIntOrLongExactMixin,\n    ChildrenHavingListArgValueStartStopMixin,\n    ExpressionBase,\n):\n    \"\"\"This operation represents l.index(value, start, stop).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_INDEX4\"\n    named_children = (\"list_arg\", \"value\", \"start\", \"stop\")\n\n    def __init__(self, list_arg, value, start, stop, source_ref):\n        ChildrenHavingListArgValueStartStopMixin.__init__(\n            self,\n            list_arg=list_arg,\n            value=value,\n            start=start,\n            stop=stop,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        self.subnode_value.onContentEscapes(trace_collection)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # raises ValueError when the value is not found\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Could become more predictable, but then maybe it's optimized away too.\n        return True\n\n\nclass ExpressionListOperationInsert(\n    ChildrenHavingListArgIndexItemMixin, ExpressionBase\n):\n    \"\"\"This operation represents l.insert(index, item).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_INSERT\"\n    named_children = (\"list_arg\", \"index\", \"item\")\n\n    def __init__(self, list_arg, index, item, source_ref):\n        ChildrenHavingListArgIndexItemMixin.__init__(\n            self,\n            list_arg=list_arg,\n            index=index,\n            item=item,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # This lets the value added to the list escape.\n        self.subnode_item.onContentEscapes(trace_collection)\n\n        # Could raise TypeError from wrong index type.\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(TypeError)\n\n        # it raises no index error, just appends\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_list_arg.mayRaiseException(exception_type)\n            or self.mayRaiseExceptionOperation()\n            or self.subnode_index.mayRaiseException(exception_type)\n            or self.subnode_item.mayRaiseException(exception_type)\n        )\n\n    def mayRaiseExceptionOperation(self):\n        # TODO: We do not yet have isIndexable from the type shape.\n        # Note that any index value will do for insert, it just has\n        # to be an integer.\n        return (\n            self.subnode_index.isExpressionConstantRef()\n            and self.subnode_index.isIndexConstant()\n        )\n\n\nclass ExpressionListOperationPop1(ChildHavingListArgMixin, ExpressionBase):\n    \"\"\"This operation represents l.pop().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_POP1\"\n    named_children = (\"list_arg\",)\n\n    def __init__(self, list_arg, source_ref):\n        ChildHavingListArgMixin.__init__(\n            self,\n            list_arg=list_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        non_empty = self.subnode_list_arg.isKnownToBeIterableAtMin(1)\n\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # raises \"IndexError\" from empty list only\n        if not non_empty:\n            trace_collection.onExceptionRaiseExit(IndexError)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionListOperationPop2(ChildrenHavingListArgIndexMixin, ExpressionBase):\n    \"\"\"This operation represents l.pop(index).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_POP2\"\n    named_children = (\"list_arg\", \"index\")\n\n    def __init__(self, list_arg, index, source_ref):\n        ChildrenHavingListArgIndexMixin.__init__(\n            self,\n            list_arg=list_arg,\n            index=index,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # raises \"IndexError\" from our of range\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionListOperationRemove(ChildrenHavingListArgValueMixin, ExpressionBase):\n    \"\"\"This operation represents l.remove(value).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_REMOVE\"\n    named_children = (\"list_arg\", \"value\")\n\n    def __init__(self, list_arg, value, source_ref):\n        ChildrenHavingListArgValueMixin.__init__(self, list_arg=list_arg, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # raises ValueError if the value is not found\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionListOperationReverse(ExpressionListOperationReverseBase):\n    \"\"\"This operation represents l.reverse().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_REVERSE\"\n\n    named_children = (\"list_arg\",)\n    auto_compute_handling = \"no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        return self, None, None\n\n\n# TODO: The sort nodes are not yet used, because of Python2/Python3 differences\n# and keyword only arguments for generation of list.sort calls.\n\n\nclass ExpressionListOperationSort1(ChildHavingListArgMixin, ExpressionBase):\n    \"\"\"This operation represents l.sort().\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_SORT1\"\n\n    named_children = (\"list_arg\",)\n\n    def __init__(self, list_arg, source_ref):\n        ChildHavingListArgMixin.__init__(\n            self,\n            list_arg=list_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # Only with no knowledge of list values\n        return True\n\n\nclass ExpressionListOperationSort2(ChildrenHavingListArgKeyMixin, ExpressionBase):\n    \"\"\"This operation represents l.sort(key).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_SORT2\"\n\n    named_children = (\"list_arg\", \"key\")\n\n    def __init__(self, list_arg, key, source_ref):\n        ChildrenHavingListArgKeyMixin.__init__(\n            self,\n            list_arg=list_arg,\n            key=key,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # Only with no knowledge of list values\n        return True\n\n\nclass ExpressionListOperationSort3(\n    ChildrenHavingListArgKeyOptionalReverseMixin, ExpressionBase\n):\n    \"\"\"This operation represents l.sort(key, reversed).\"\"\"\n\n    kind = \"EXPRESSION_LIST_OPERATION_SORT3\"\n\n    named_children = (\"list_arg\", \"key|optional\", \"reverse\")\n\n    def __init__(self, list_arg, key, reverse, source_ref):\n        ChildrenHavingListArgKeyOptionalReverseMixin.__init__(\n            self,\n            list_arg=list_arg,\n            key=key,\n            reverse=reverse,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Until we have proper list tracing.\n        trace_collection.removeKnowledge(self.subnode_list_arg)\n\n        # All code could be run when searching it does compare items, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # Only with no knowledge of list values\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/LocalsDictNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that deal with locals, as dict or mapping.\n\nThe mapping types can be optimized into dict types, and the ones with\nfallback can be optimized to no fallback variants.\n\n\"\"\"\n\nfrom nuitka.optimizations.TraceCollections import TraceCollectionBranch\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.tree.TreeHelpers import makeStatementsSequence\n\nfrom .ChildrenHavingMixins import ChildHavingFallbackMixin\nfrom .ConditionalNodes import ExpressionConditional\nfrom .ExpressionBases import ExpressionBase\nfrom .GlobalsLocalsNodes import ExpressionBuiltinLocalsRef\nfrom .NodeBases import StatementBase\nfrom .StatementBasesGenerated import (\n    StatementLocalsDictOperationSetBase,\n    StatementSetLocalsBase,\n    StatementSetLocalsDictionaryBase,\n)\nfrom .VariableAssignNodes import makeStatementAssignmentVariable\nfrom .VariableDelNodes import makeStatementDelVariable\nfrom .VariableRefNodes import ExpressionTempVariableRef\nfrom .VariableReleaseNodes import makeStatementReleaseVariable\n\n\nclass ExpressionLocalsVariableRefOrFallback(ChildHavingFallbackMixin, ExpressionBase):\n    kind = \"EXPRESSION_LOCALS_VARIABLE_REF_OR_FALLBACK\"\n\n    named_children = (\"fallback\",)\n\n    __slots__ = (\"locals_scope\", \"variable\", \"variable_trace\")\n\n    def __init__(self, locals_scope, variable_name, fallback, source_ref):\n        assert locals_scope is not None\n\n        ChildHavingFallbackMixin.__init__(self, fallback=fallback)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.locals_scope = locals_scope\n        self.variable = locals_scope.getLocalsDictVariable(variable_name)\n\n        self.variable_trace = None\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getLocalsDictScope(self):\n        return self.locals_scope\n\n    def computeExpressionRaw(self, trace_collection):\n        self.variable_trace = trace_collection.getVariableCurrentTrace(\n            variable=self.variable\n        )\n\n        replacement = self.variable_trace.getReplacementNode(self)\n\n        if replacement is not None:\n            trace_collection.signalChange(\n                \"new_expression\",\n                self.source_ref,\n                \"Value propagated for '%s' from '%s'.\"\n                % (\n                    self.variable.getName(),\n                    replacement.getSourceReference().getAsString(),\n                ),\n            )\n\n            # Need to compute the replacement still.\n            return replacement.computeExpressionRaw(trace_collection)\n\n        # TODO: Split exec locals variable references out to distinct node type.\n        no_exec = (\n            not self.locals_scope.isUnoptimizedFunctionScope()\n            and not self.locals_scope.isPreventedPropagation()\n        )\n\n        # If we can be sure it doesn't have a value set, go to the fallback directly.\n        if no_exec and self.variable_trace.mustNotHaveValue():\n            return trace_collection.computedExpressionResultRaw(\n                self.subnode_fallback,\n                \"new_expression\",\n                \"Name '%s' cannot be in locals dict.\" % self.variable.getName(),\n            )\n\n        # If we cannot be sure if the value is set, then we need the fallback,\n        # otherwise we could remove it simply.\n        if no_exec and self.variable_trace.mustHaveValue():\n            trace_collection.signalChange(\n                \"new_expression\",\n                self.source_ref,\n                \"Name '%s' must be in locals dict.\" % self.variable.getName(),\n            )\n\n            result = ExpressionLocalsVariableRef(\n                locals_scope=self.locals_scope,\n                variable_name=self.variable.getName(),\n                source_ref=self.source_ref,\n            )\n\n            # Need to compute the replacement still.\n            return result.computeExpressionRaw(trace_collection)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        branch_fallback = TraceCollectionBranch(\n            parent=trace_collection, name=\"fallback node usage\"\n        )\n\n        if (\n            self.variable_trace.isUnknownTrace()\n            and self.subnode_fallback.isExpressionVariableRef()\n        ):\n            fallback_variable_trace = self.subnode_fallback.variable_trace\n\n            if fallback_variable_trace is not None:\n                trusted_node = (\n                    self.subnode_fallback.variable_trace.getAttributeNodeVeryTrusted()\n                )\n\n                if trusted_node is not None:\n                    return trace_collection.computedExpressionResultRaw(\n                        expression=self.subnode_fallback,\n                        change_tags=\"var_usage\",\n                        change_desc=\"Hard value referenced in class not considering class dictionary.\",\n                    )\n\n        branch_fallback.onExpression(self.subnode_fallback)\n        trace_collection.mergeBranches(branch_fallback, None)\n\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        trace_collection.onControlFlowEscape(self)\n\n        if (\n            self.variable.getName()\n            in (\"dir\", \"eval\", \"exec\", \"execfile\", \"locals\", \"vars\")\n            and self.subnode_fallback.isExpressionVariableRef()\n            and self.subnode_fallback.getVariable().isIncompleteModuleVariable()\n        ):\n            # Just inform the collection that all escaped.\n            trace_collection.onLocalsUsage(self.getLocalsDictScope())\n\n        if (\n            self.subnode_fallback.isExpressionBuiltinRef()\n            or self.subnode_fallback.isExpressionConstantTypeRef()\n        ):\n            variable_name = self.variable.getName()\n\n            # Create a cloned node with the locals variable.\n            call_node_clone = call_node.makeClone()\n            call_node_clone.setChildCalled(\n                ExpressionLocalsVariableRef(\n                    locals_scope=self.locals_scope,\n                    variable_name=variable_name,\n                    source_ref=self.source_ref,\n                )\n            )\n\n            # Make the original one for the fallback\n            call_node = call_node.makeCloneShallow()\n            call_node.setChildCalled(self.subnode_fallback)\n\n            result = ExpressionConditional(\n                condition=ExpressionLocalsVariableCheck(\n                    locals_scope=self.locals_scope,\n                    variable_name=variable_name,\n                    source_ref=self.source_ref,\n                ),\n                expression_yes=call_node_clone,\n                expression_no=call_node,\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Moved call of uncertain dict variable '%s' to inside.\" % variable_name,\n            )\n\n        return call_node, None, None\n\n    # TODO: Specialize for Python3 maybe to save attribute for Python2.\n    may_raise_access = python_version >= 0x300\n\n    def mayRaiseException(self, exception_type):\n        if self.may_raise_access and self.locals_scope.hasShapeDictionaryExact():\n            return True\n\n        return self.subnode_fallback.mayRaiseException(exception_type)\n\n\n# TODO: Why is this unused.\nclass ExpressionLocalsMappingVariableRefOrFallback(\n    ExpressionLocalsVariableRefOrFallback\n):\n    kind = \"EXPRESSION_LOCALS_MAPPING_VARIABLE_REF_OR_FALLBACK\"\n\n\nclass ExpressionLocalsVariableRef(ExpressionBase):\n    kind = \"EXPRESSION_LOCALS_VARIABLE_REF\"\n\n    __slots__ = \"variable\", \"locals_scope\", \"variable_trace\"\n\n    def __init__(self, locals_scope, variable_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.locals_scope = locals_scope\n        self.variable = locals_scope.getLocalsDictVariable(variable_name)\n\n        self.variable_trace = None\n\n    def finalize(self):\n        del self.parent\n        del self.locals_scope\n        del self.variable\n\n    def getDetails(self):\n        return {\n            \"variable_name\": self.getVariableName(),\n            \"locals_scope\": self.locals_scope,\n        }\n\n    def getDetailsForDisplay(self):\n        return {\n            \"locals_scope\": self.locals_scope.getCodeName(),\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getLocalsDictScope(self):\n        return self.locals_scope\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.locals_scope.isMarkedForPropagation():\n            variable_name = self.getVariableName()\n\n            variable = self.locals_scope.allocateTempReplacementVariable(\n                trace_collection=trace_collection, variable_name=variable_name\n            )\n\n            result = ExpressionTempVariableRef(\n                variable=variable, source_ref=self.source_ref\n            )\n            result.parent = self.parent\n\n            self.finalize()\n\n            new_result = result.computeExpressionRaw(trace_collection)\n\n            if new_result[0] is not result:\n                assert False, (new_result, result)\n\n            return (\n                result,\n                \"new_expression\",\n                \"Replaced dictionary ref with temporary variable.\",\n            )\n\n        self.variable_trace = trace_collection.getVariableCurrentTrace(\n            variable=self.variable\n        )\n\n        replacement = self.variable_trace.getReplacementNode(self)\n\n        if replacement is not None:\n            trace_collection.signalChange(\n                \"new_expression\",\n                self.source_ref,\n                \"Value propagated for '%s' from '%s'.\"\n                % (\n                    self.variable.getName(),\n                    replacement.getSourceReference().getAsString(),\n                ),\n            )\n\n            # Need to compute the replacement still.\n            return replacement.computeExpressionRaw(trace_collection)\n\n        if not self.variable_trace.mustHaveValue():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        trace_collection.onControlFlowEscape(self)\n        return call_node, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.variable_trace is None or not self.variable_trace.mustHaveValue()\n\n\nclass ExpressionLocalsVariableCheck(ExpressionBase):\n    kind = \"EXPRESSION_LOCALS_VARIABLE_CHECK\"\n\n    __slots__ = \"variable_name\", \"locals_scope\"\n\n    def __init__(self, locals_scope, variable_name, source_ref):\n        self.variable_name = variable_name\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.locals_scope = locals_scope\n\n    def finalize(self):\n        del self.parent\n        del self.locals_scope\n\n    def getDetails(self):\n        return {\"locals_scope\": self.locals_scope, \"variable_name\": self.variable_name}\n\n    def getVariableName(self):\n        return self.variable_name\n\n    def getLocalsDictScope(self):\n        return self.locals_scope\n\n    def computeExpressionRaw(self, trace_collection):\n        assert not self.locals_scope.isMarkedForPropagation()\n        return self, None, None\n\n\nclass StatementLocalsDictOperationSet(StatementLocalsDictOperationSetBase):\n    kind = \"STATEMENT_LOCALS_DICT_OPERATION_SET\"\n\n    named_children = (\"source\",)\n    node_attributes = (\"locals_scope\", \"variable_name\")\n    auto_compute_handling = \"operation,post_init\"\n\n    __slots__ = (\"variable\", \"variable_version\", \"variable_trace\")\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    def postInitNode(self):\n        self.variable = self.locals_scope.getLocalsDictVariable(\n            variable_name=self.variable_name\n        )\n        self.variable_version = self.variable.allocateTargetNumber()\n        self.variable_trace = None\n\n    def finalize(self):\n        del self.parent\n        del self.locals_scope\n        del self.variable_trace\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getDetailsForDisplay(self):\n        return {\n            \"locals_scope\": self.locals_scope.getCodeName(),\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getLocalsDictScope(self):\n        return self.locals_scope\n\n    def getTypeShape(self):\n        return self.locals_scope.getMappingValueShape(self.variable)\n\n    # TODO: This is ugly to overload, to be sure we work on not-yet visited expressions.\n    def computeStatement(self, trace_collection):\n        if self.locals_scope.isMarkedForPropagation():\n            variable = self.locals_scope.allocateTempReplacementVariable(\n                trace_collection=trace_collection, variable_name=self.variable_name\n            )\n\n            result = makeStatementAssignmentVariable(\n                source=self.subnode_source,\n                variable=variable,\n                source_ref=self.source_ref,\n            )\n            result.parent = self.parent\n\n            new_result = result.computeStatement(trace_collection)\n            result = new_result[0]\n\n            assert result.isStatementAssignmentVariable(), new_result\n\n            self.finalize()\n            return (\n                result,\n                \"new_statements\",\n                \"Replaced dictionary assignment with temporary variable assignment.\",\n            )\n\n        return StatementLocalsDictOperationSetBase.computeStatement(\n            self, trace_collection\n        )\n\n    def computeStatementOperation(self, trace_collection):\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n        if not self.locals_scope.hasShapeDictionaryExact():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    if python_version >= 0x300:\n\n        def mayRaiseException(self, exception_type):\n            return (\n                not self.locals_scope.hasShapeDictionaryExact()\n                or self.subnode_source.mayRaiseException(exception_type)\n            )\n\n        def mayRaiseExceptionOperation(self):\n            return not self.locals_scope.hasShapeDictionaryExact()\n\n    else:\n\n        def mayRaiseException(self, exception_type):\n            return self.subnode_source.mayRaiseException(exception_type)\n\n        @staticmethod\n        def mayRaiseExceptionOperation():\n            return False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"locals dictionary value set statement\"\n\n\nclass StatementLocalsDictOperationDel(StatementBase):\n    kind = \"STATEMENT_LOCALS_DICT_OPERATION_DEL\"\n\n    __slots__ = (\n        \"variable\",\n        \"variable_version\",\n        \"previous_trace\",\n        \"locals_scope\",\n        \"tolerant\",\n    )\n\n    # TODO: Specialize for Python3 maybe to save attribute for Python2.\n    may_raise_del = python_version >= 0x300\n\n    def __init__(self, locals_scope, variable_name, tolerant, source_ref):\n        assert type(variable_name) is str\n\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        assert locals_scope is not None\n\n        self.locals_scope = locals_scope\n\n        self.variable = locals_scope.getLocalsDictVariable(variable_name)\n        self.variable_version = self.variable.allocateTargetNumber()\n\n        self.tolerant = tolerant\n\n        self.previous_trace = None\n\n    def finalize(self):\n        del self.parent\n        del self.locals_scope\n        del self.variable\n        del self.previous_trace\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getDetailsForDisplay(self):\n        return {\n            \"locals_scope\": self.locals_scope.getCodeName(),\n            \"variable_name\": self.getVariableName(),\n        }\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getLocalsDictScope(self):\n        return self.locals_scope\n\n    def computeStatement(self, trace_collection):\n        # Conversion from dictionary to normal nodes is done here.\n        if self.locals_scope.isMarkedForPropagation():\n            variable_name = self.getVariableName()\n\n            variable = self.locals_scope.allocateTempReplacementVariable(\n                trace_collection=trace_collection, variable_name=variable_name\n            )\n\n            result = makeStatementDelVariable(\n                variable=variable, tolerant=False, source_ref=self.source_ref\n            )\n            result.parent = self.parent\n\n            new_result = result.computeStatement(trace_collection)\n            result = new_result[0]\n\n            assert result.isStatementDelVariable(), new_result\n\n            return (\n                new_result,\n                \"new_statements\",\n                \"Replaced dictionary del with temporary variable.\",\n            )\n\n        self.previous_trace = trace_collection.getVariableCurrentTrace(self.variable)\n\n        # Deleting is usage of the value, and may call code on it. This is to inhibit\n        # just removing it.\n        self.previous_trace.addUsage()\n\n        # We may not exception exit now during the __del__ unless there is no value.\n        # TODO: In which case, there is doing to be a NameError or UnboundLocalError.\n        if not self.previous_trace.mustHaveValue():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Record the deletion, needs to start a new version then.\n        _variable_trace = trace_collection.onVariableDel(\n            variable=self.variable, version=self.variable_version, del_node=self\n        )\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.may_raise_del and not self.tolerant\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"locals dictionary value del statement\"\n\n\nclass StatementSetLocalsMixin(object):\n    __slots__ = ()\n\n    def getDetailsForDisplay(self):\n        return {\"locals_scope\": self.locals_scope.getCodeName()}\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n\nclass StatementSetLocals(StatementSetLocalsMixin, StatementSetLocalsBase):\n    kind = \"STATEMENT_SET_LOCALS\"\n\n    named_children = (\"new_locals\",)\n    node_attributes = (\"locals_scope\",)\n    auto_compute_handling = \"operation\"\n\n    # TODO: Convert to StatementSetLocals if known to be constant dictionary.\n\n    def getDetailsForDisplay(self):\n        return {\"locals_scope\": self.locals_scope.getCodeName()}\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_new_locals.mayRaiseException(exception_type)\n\n    def computeStatementOperation(self, trace_collection):\n        self.locals_scope.setTypeShape(self.subnode_new_locals.getTypeShape())\n\n        if self.locals_scope.isMarkedForPropagation():\n            self.finalize()\n\n            return (\n                None,\n                \"new_statements\",\n                \"\"\"\\\nForward propagating locals.\"\"\",\n            )\n\n        if self.subnode_new_locals.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"locals mapping init statement\"\n\n\nclass StatementSetLocalsDictionary(\n    StatementSetLocalsMixin, StatementSetLocalsDictionaryBase\n):\n    kind = \"STATEMENT_SET_LOCALS_DICTIONARY\"\n\n    node_attributes = (\"locals_scope\",)\n\n    def computeStatement(self, trace_collection):\n        if self.locals_scope.isMarkedForPropagation():\n            self.finalize()\n\n            return (\n                None,\n                \"new_statements\",\n                \"\"\"\\\nForward propagating locals.\"\"\",\n            )\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"locals dictionary init statement\"\n\n\nclass ExpressionLocalsDictRef(ExpressionBuiltinLocalsRef):\n    kind = \"EXPRESSION_LOCALS_DICT_REF\"\n\n    # Only way we use it.\n    @staticmethod\n    def isFinalUseOfLocals():\n        return True\n\n\nclass StatementReleaseLocals(StatementBase):\n    kind = \"STATEMENT_RELEASE_LOCALS\"\n\n    __slots__ = (\"locals_scope\",)\n\n    def __init__(self, locals_scope, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.locals_scope = locals_scope\n\n    def finalize(self):\n        del self.parent\n        del self.locals_scope\n\n    def computeStatement(self, trace_collection):\n        if self.locals_scope.isMarkedForPropagation():\n            statements = [\n                makeStatementReleaseVariable(\n                    variable=variable, source_ref=self.source_ref\n                )\n                for variable in self.locals_scope.getPropagationVariables().values()\n            ]\n\n            result = makeStatementsSequence(\n                statements=statements, allow_none=False, source_ref=self.source_ref\n            )\n\n            self.finalize()\n\n            return (\n                result,\n                \"new_statements\",\n                \"Releasing temp variables instead of locals dict.\",\n            )\n\n        return self, None, None\n\n    def getDetails(self):\n        return {\"locals_scope\": self.locals_scope}\n\n    def getDetailsForDisplay(self):\n        return {\n            \"locals_scope\": self.locals_scope.getCodeName(),\n        }\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"locals dictionary release statement\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/LocalsScopes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module maintains the locals dict handles. \"\"\"\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Errors import NuitkaOptimizationError\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\nfrom nuitka.Variables import LocalsDictVariable, LocalVariable\n\nfrom .shapes.BuiltinTypeShapes import tshape_dict\nfrom .shapes.StandardShapes import tshape_unknown\n\nlocals_dict_handles = {}\n\n\ndef getLocalsDictType(kind):\n    if kind == \"python2_function_exec\":\n        locals_scope = LocalsDictExecHandle\n    elif kind == \"python_function\":\n        locals_scope = LocalsDictFunctionHandle\n    elif kind == \"python3_class\":\n        locals_scope = LocalsMappingHandle\n    elif kind == \"python2_class\":\n        locals_scope = LocalsDictHandle\n    elif kind == \"module_dict\":\n        locals_scope = GlobalsDictHandle\n    else:\n        assert False, kind\n\n    return locals_scope\n\n\ndef getLocalsDictHandle(locals_name, kind, owner):\n    # Duplicates are bad and cannot be tolerated.\n    if locals_name in locals_dict_handles:\n        raise NuitkaOptimizationError(\n            \"duplicate locals name\",\n            locals_name,\n            kind,\n            owner.getFullName(),\n            owner.getCompileTimeFilename(),\n            locals_dict_handles[locals_name].owner.getFullName(),\n            locals_dict_handles[locals_name].owner.getCompileTimeFilename(),\n        )\n\n    locals_dict_handles[locals_name] = getLocalsDictType(kind)(\n        locals_name=locals_name, owner=owner\n    )\n    return locals_dict_handles[locals_name]\n\n\nclass LocalsDictHandleBase(object):\n    # TODO: Might remove some of these later, pylint: disable=too-many-instance-attributes\n\n    __slots__ = (\n        \"locals_name\",\n        # TODO: Specialize what the kinds really use what.\n        \"variables\",\n        \"local_variables\",\n        \"providing\",\n        \"mark_for_propagation\",\n        \"prevented_propagation\",\n        \"propagation\",\n        \"owner\",\n        \"complete\",\n    )\n\n    @counted_init\n    def __init__(self, locals_name, owner):\n        self.locals_name = locals_name\n        self.owner = owner\n\n        # For locals dict variables in this scope.\n        self.variables = {}\n\n        # For local variables in this scope.\n        self.local_variables = {}\n        self.providing = OrderedDict()\n\n        # Can this be eliminated through replacement of temporary variables, or has\n        # e.g. the use of locals prevented this, which it should in classes.\n        self.mark_for_propagation = False\n\n        self.propagation = None\n\n        self.complete = False\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def __repr__(self):\n        return \"<%s of %s>\" % (self.__class__.__name__, self.locals_name)\n\n    def getName(self):\n        return self.locals_name\n\n    def makeClone(self, new_owner):\n        count = 1\n\n        # Make it unique.\n        while 1:\n            locals_name = self.locals_name + \"_inline_%d\" % count\n\n            if locals_name not in locals_dict_handles:\n                break\n\n            count += 1\n\n        result = self.__class__(locals_name=locals_name, owner=new_owner)\n\n        variable_translation = {}\n\n        # Clone variables as well.\n        for variable_name, variable in self.variables.items():\n            new_variable = variable.makeClone(new_owner=new_owner)\n\n            variable_translation[variable] = new_variable\n            result.variables[variable_name] = new_variable\n\n        for variable_name, variable in self.local_variables.items():\n            new_variable = variable.makeClone(new_owner=new_owner)\n\n            variable_translation[variable] = new_variable\n            result.local_variables[variable_name] = new_variable\n\n        result.providing = OrderedDict()\n\n        for variable_name, variable in self.providing.items():\n            if variable in variable_translation:\n                new_variable = variable_translation[variable]\n            else:\n                new_variable = variable.makeClone(new_owner=new_owner)\n                variable_translation[variable] = new_variable\n\n            result.providing[variable_name] = new_variable\n\n        return result, variable_translation\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_dict\n\n    @staticmethod\n    def hasShapeDictionaryExact():\n        return True\n\n    def getCodeName(self):\n        return self.locals_name\n\n    @staticmethod\n    def isModuleScope():\n        return False\n\n    @staticmethod\n    def isClassScope():\n        return False\n\n    @staticmethod\n    def isFunctionScope():\n        return False\n\n    @staticmethod\n    def isUnoptimizedFunctionScope():\n        return False\n\n    def getProvidedVariables(self):\n        return self.providing.values()\n\n    def registerProvidedVariable(self, variable):\n        variable_name = variable.getName()\n\n        self.providing[variable_name] = variable\n\n    def unregisterProvidedVariable(self, variable):\n        \"\"\"Remove provided variable, e.g. because it became unused.\"\"\"\n\n        variable_name = variable.getName()\n\n        if variable_name in self.providing:\n            del self.providing[variable_name]\n\n    registerClosureVariable = registerProvidedVariable\n    unregisterClosureVariable = unregisterProvidedVariable\n\n    def hasProvidedVariable(self, variable_name):\n        \"\"\"Test if a variable is provided.\"\"\"\n\n        return variable_name in self.providing\n\n    def getProvidedVariable(self, variable_name):\n        \"\"\"Test if a variable is provided.\"\"\"\n\n        return self.providing[variable_name]\n\n    def getLocalsRelevantVariables(self):\n        \"\"\"The variables relevant to locals.\"\"\"\n\n        return self.providing.values()\n\n    def getLocalsDictVariable(self, variable_name):\n        if variable_name not in self.variables:\n            result = LocalsDictVariable(owner=self, variable_name=variable_name)\n\n            self.variables[variable_name] = result\n\n        return self.variables[variable_name]\n\n    # TODO: Have variable ownership moved to the locals scope, so owner becomes not needed here.\n    def getLocalVariable(self, owner, variable_name):\n        if variable_name not in self.local_variables:\n            result = LocalVariable(owner=owner, variable_name=variable_name)\n\n            self.local_variables[variable_name] = result\n\n        return self.local_variables[variable_name]\n\n    @staticmethod\n    def preventLocalsDictPropagation():\n        pass\n\n    @staticmethod\n    def isPreventedPropagation():\n        return False\n\n    def markForLocalsDictPropagation(self):\n        self.mark_for_propagation = True\n\n    def isMarkedForPropagation(self):\n        return self.mark_for_propagation\n\n    def allocateTempReplacementVariable(self, trace_collection, variable_name):\n        if self.propagation is None:\n            self.propagation = OrderedDict()\n\n        if variable_name not in self.propagation:\n            provider = trace_collection.getOwner()\n\n            self.propagation[variable_name] = provider.allocateTempVariable(\n                temp_scope=None,\n                name=self.getCodeName() + \"_key_\" + variable_name,\n                temp_type=\"object\",\n            )\n\n        return self.propagation[variable_name]\n\n    def getPropagationVariables(self):\n        if self.propagation is None:\n            return ()\n\n        return self.propagation\n\n    def finalize(self):\n        # Make it unusable when it's become empty, not used.\n        self.owner.locals_scope = None\n        del self.owner\n\n        del self.propagation\n        del self.mark_for_propagation\n\n        for variable in self.variables.values():\n            variable.finalize()\n\n        for variable in self.local_variables.values():\n            variable.finalize()\n\n        del self.variables\n        del self.providing\n\n    def markAsComplete(self, trace_collection):\n        self.complete = True\n\n        self._considerUnusedUserLocalVariables(trace_collection)\n        self._considerPropagation(trace_collection)\n\n    # TODO: Limited to Python2 classes for now, more overloads need to be added, this\n    # ought to be abstract and have variants with TODOs for each of them.\n    @staticmethod\n    def _considerPropagation(trace_collection):\n        \"\"\"For overload by scope type. Check if this can be replaced.\"\"\"\n\n    def onPropagationComplete(self):\n        self.variables = {}\n        self.mark_for_propagation = False\n\n    def _considerUnusedUserLocalVariables(self, trace_collection):\n        \"\"\"Check scope for unused variables.\"\"\"\n\n        provided = self.getProvidedVariables()\n        removals = []\n\n        for variable in provided:\n            if (\n                variable.isLocalVariable()\n                and not variable.isParameterVariable()\n                and variable.getOwner() is self.owner\n            ):\n                empty = trace_collection.hasEmptyTraces(variable)\n\n                if empty:\n                    removals.append(variable)\n\n        for variable in removals:\n            self.unregisterProvidedVariable(variable)\n\n            trace_collection.signalChange(\n                \"var_usage\",\n                self.owner.getSourceReference(),\n                message=\"Remove unused local variable '%s'.\" % variable.getName(),\n            )\n\n\nclass LocalsDictHandle(LocalsDictHandleBase):\n    \"\"\"Locals dict for a Python class with mere dict.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def isClassScope():\n        return True\n\n    @staticmethod\n    def getMappingValueShape(variable):\n        # We don't yet track dictionaries, let alone mapping values.\n        # pylint: disable=unused-argument\n        return tshape_unknown\n\n    def _considerPropagation(self, trace_collection):\n        if not self.variables:\n            return\n\n        for variable in self.variables.values():\n            for variable_trace in variable.traces:\n                if variable_trace.inhibitsClassScopeForwardPropagation():\n                    return\n\n        trace_collection.signalChange(\n            \"var_usage\",\n            self.owner.getSourceReference(),\n            message=\"Forward propagate locals dictionary.\",\n        )\n\n        self.markForLocalsDictPropagation()\n\n\nclass LocalsMappingHandle(LocalsDictHandle):\n    \"\"\"Locals dict of a Python3 class with a mapping.\"\"\"\n\n    __slots__ = (\"type_shape\",)\n\n    # TODO: Removable condition once Python 3.3 support is dropped.\n    if python_version >= 0x340:\n        __slots__ += (\"prevented_propagation\",)\n\n    def __init__(self, locals_name, owner):\n        LocalsDictHandle.__init__(self, locals_name=locals_name, owner=owner)\n\n        self.type_shape = tshape_unknown\n\n        if python_version >= 0x340:\n            self.prevented_propagation = False\n\n    def getTypeShape(self):\n        # TODO: Make mapping available for this.\n        return self.type_shape\n\n    def setTypeShape(self, type_shape):\n        self.type_shape = type_shape\n\n    def hasShapeDictionaryExact(self):\n        return self.type_shape is tshape_dict\n\n    if python_version >= 0x340:\n\n        def markAsComplete(self, trace_collection):\n            # For this run, it cannot be done yet.\n            if self.prevented_propagation:\n                # False alarm, this is available.\n                self.prevented_propagation = False\n                return\n\n            self.complete = True\n\n        def preventLocalsDictPropagation(self):\n            self.prevented_propagation = True\n\n        def isPreventedPropagation(self):\n            return self.prevented_propagation\n\n    def _considerPropagation(self, trace_collection):\n        if not self.variables:\n            return\n\n        if self.type_shape is not tshape_dict:\n            return\n\n        for variable in self.variables.values():\n            for variable_trace in variable.traces:\n                if variable_trace.inhibitsClassScopeForwardPropagation():\n                    return\n\n        trace_collection.signalChange(\n            \"var_usage\",\n            self.owner.getSourceReference(),\n            message=\"Forward propagate locals dictionary.\",\n        )\n\n        self.markForLocalsDictPropagation()\n\n    @staticmethod\n    def isClassScope():\n        return True\n\n\nclass LocalsDictExecHandle(LocalsDictHandleBase):\n    \"\"\"Locals dict of a Python2 function with an exec.\"\"\"\n\n    __slots__ = (\"closure_variables\",)\n\n    def __init__(self, locals_name, owner):\n        LocalsDictHandleBase.__init__(self, locals_name=locals_name, owner=owner)\n\n        self.closure_variables = None\n\n    @staticmethod\n    def isFunctionScope():\n        return True\n\n    @staticmethod\n    def isUnoptimizedFunctionScope():\n        return True\n\n    def getLocalsRelevantVariables(self):\n        if self.closure_variables is None:\n            return self.providing.values()\n        else:\n            return [\n                variable\n                for variable in self.providing.values()\n                if variable not in self.closure_variables\n            ]\n\n            # TODO: What about the \".0\" variety, we used to exclude it.\n\n    def registerClosureVariable(self, variable):\n        self.registerProvidedVariable(variable)\n\n        if self.closure_variables is None:\n            self.closure_variables = set()\n\n        self.closure_variables.add(variable)\n\n    def unregisterClosureVariable(self, variable):\n        self.unregisterProvidedVariable(variable)\n\n        variable_name = variable.getName()\n\n        if variable_name in self.providing:\n            del self.providing[variable_name]\n\n\nclass LocalsDictFunctionHandle(LocalsDictHandleBase):\n    \"\"\"Locals dict of a Python3 function or Python2 function without an exec.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def isFunctionScope():\n        return True\n\n\nclass GlobalsDictHandle(LocalsDictHandleBase):\n    __slots__ = (\"escaped\",)\n\n    def __init__(self, locals_name, owner):\n        LocalsDictHandleBase.__init__(self, locals_name=locals_name, owner=owner)\n\n        self.escaped = False\n\n    @staticmethod\n    def isModuleScope():\n        return True\n\n    def markAsEscaped(self):\n        self.escaped = True\n\n    def isEscaped(self):\n        return self.escaped\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/LoopNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Loop nodes.\n\nThere are for and loop nodes, but both are reduced to loops with break/continue\nstatements for it. These re-formulations require that optimization of loops has\nto be very general, yet the node type for loop, becomes very simple.\n\"\"\"\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.optimizations.TraceCollections import TraceCollectionBranch\n\nfrom .NodeBases import StatementBase\nfrom .shapes.StandardShapes import tshape_unknown, tshape_unknown_loop\nfrom .StatementBasesGenerated import StatementLoopBase\n\ntshape_unknown_set = frozenset([tshape_unknown])\n\n\ndef minimizeShapes(shapes):\n    # Merge some shapes automatically, no need to give a set.\n    if tshape_unknown in shapes:\n        return tshape_unknown_set\n\n    return shapes\n\n\nclass StatementLoop(StatementLoopBase):\n    kind = \"STATEMENT_LOOP\"\n\n    named_children = (\"loop_body|statements_or_none+setter\",)\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"loop_variables\",\n        \"loop_start\",\n        \"loop_resume\",\n        \"loop_previous_resume\",\n        \"incomplete_count\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    def postInitNode(self):\n        # Variables used inside the loop.\n        self.loop_variables = None\n\n        # Traces of the variable at the start of loop, to detect changes and make\n        # those restart optimization.\n        self.loop_start = {}\n\n        # Shapes currently known to be present when the loop is started or resumed\n        # with continue statements.\n        self.loop_resume = {}\n\n        # Shapes from last time around, to detect the when it becomes complete, i.e.\n        # we have seen it all.\n        self.loop_previous_resume = {}\n\n        # To allow an upper limit in case it doesn't terminate.\n        self.incomplete_count = 0\n\n    def mayReturn(self):\n        # TODO: Seems the trace collection should feed this after first pass of the loop.\n        loop_body = self.subnode_loop_body\n\n        if loop_body is not None and loop_body.mayReturn():\n            return True\n\n        return False\n\n    @staticmethod\n    def mayBreak():\n        # The loop itself may never break another loop.\n        return False\n\n    @staticmethod\n    def mayContinue():\n        # The loop itself may never continue another loop.\n        return False\n\n    def isStatementAborting(self):\n        loop_body = self.subnode_loop_body\n\n        if loop_body is None:\n            return True\n        else:\n            return not loop_body.mayBreak()\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # Loops can only raise, if their body does, but they also issue the\n        # async exceptions, so we must make them do it all the time.\n        return True\n        # loop_body = self.subnode_loop_body\n        #  return loop_body is not None and \\\n        #         self.subnode_loop_body.mayRaiseException(exception_type)\n\n    def _computeLoopBody(self, trace_collection):\n        # Rather complex stuff, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n        # print(\"Enter loop body\", self.source_ref)\n\n        loop_body = self.subnode_loop_body\n        if loop_body is None:\n            return None, None, None\n\n        # Look ahead. what will be written and degrade to initial loop traces\n        # about that if we are in the first iteration, later we # will have more\n        # precise knowledge.\n        if self.loop_variables is None:\n            self.loop_variables = OrderedSet()\n            loop_body.collectVariableAccesses(\n                self.loop_variables.add, self.loop_variables.add\n            )\n\n            all_first_pass = True\n        else:\n            all_first_pass = False\n\n        # Track if we got incomplete knowledge due to loop. If so, we are not done, even\n        # if no was optimization done, once we are complete, they can come.\n        incomplete_variables = None\n\n        # Mark all variables as loop wrap around that are written in the loop and\n        # hit a 'continue' and make them become loop merges. We will strive to\n        # reduce self.loop_variables if we find ones that have no change in all\n        # 'continue' exits.\n        loop_entry_traces = set()\n        for loop_variable in self.loop_variables:\n            current = trace_collection.getVariableCurrentTrace(loop_variable)\n\n            if all_first_pass:\n                if current.isAssignTraceVeryTrusted():\n                    continue\n\n                first_pass = True\n\n                # Remember what we started with, so we can detect changes from outside the\n                # loop and make them restart the collection process, if the pre-conditions\n                # got better.\n                self.loop_start[loop_variable] = current\n            else:\n                if not self.loop_start[loop_variable].compareValueTrace(current):\n                    if current.isAssignTraceVeryTrusted():\n                        continue\n\n                    first_pass = True\n                    self.loop_start[loop_variable] = current\n                else:\n                    first_pass = False\n\n            if first_pass:\n                incomplete = True\n\n                self.loop_previous_resume[loop_variable] = None\n\n                # Don't forget to initialize the loop resume traces with the starting point. We use\n                # a special trace class that will not take the list too serious though.\n                self.loop_resume[loop_variable] = set()\n                current.getTypeShape().emitAlternatives(\n                    self.loop_resume[loop_variable].add\n                )\n                # print(\"first\", self.source_ref, loop_variable, \":\",\n                #     self.loop_resume[loop_variable])\n            else:\n                if (\n                    self.loop_resume[loop_variable]\n                    != self.loop_previous_resume[loop_variable]\n                ):\n                    # print(\"incomplete\", self.source_ref, loop_variable, \":\",\n                    # self.loop_previous_resume[loop_variable], \"<->\", self.loop_resume[loop_variable])\n\n                    incomplete = True\n\n                    if incomplete_variables is None:\n                        incomplete_variables = set()\n\n                    incomplete_variables.add(loop_variable)\n                else:\n                    # print(\"complete\", self.source_ref, loop_variable, \":\",\n                    # self.loop_previous_resume[loop_variable], \"<->\", self.loop_resume[loop_variable])\n                    incomplete = False\n\n            # Mark the variable as loop usage before executing it.\n            # print(\"loop merge from shapes\", self.loop_resume[loop_variable])\n            loop_entry_traces.add(\n                (\n                    loop_variable,\n                    trace_collection.markActiveVariableAsLoopMerge(\n                        loop_node=self,\n                        current=current,\n                        variable=loop_variable,\n                        shapes=self.loop_resume[loop_variable],\n                        incomplete=incomplete,\n                    ),\n                )\n            )\n\n        abort_context = trace_collection.makeAbortStackContext(\n            catch_breaks=True,\n            catch_continues=True,\n            catch_returns=False,\n            catch_exceptions=False,\n        )\n\n        with abort_context:\n            # Forget all iterator and other value status. TODO: These should be using\n            # more proper tracing to benefit.\n            result = loop_body.computeStatementsSequence(\n                trace_collection=trace_collection\n            )\n\n            # Might be changed.\n            if result is not loop_body:\n                self.setChildLoopBody(result)\n                loop_body = result\n\n            if loop_body is not None:\n                # Emulate terminal continue if not aborting.\n                if not loop_body.isStatementAborting():\n                    trace_collection.onLoopContinue()\n\n            continue_collections = trace_collection.getLoopContinueCollections()\n\n            # Rebuild this with only the ones that actually changed in the loop.\n            self.loop_variables = []\n\n            for loop_variable, loop_entry_trace in loop_entry_traces:\n                # Giving up\n                if self.incomplete_count >= 20:\n                    self.loop_previous_resume[loop_variable] = self.loop_resume[\n                        loop_variable\n                    ] = set((tshape_unknown_loop,))\n                    continue\n\n                # Remember what it was at the start, to be able to tell if it changed.\n                self.loop_previous_resume[loop_variable] = self.loop_resume[\n                    loop_variable\n                ]\n                self.loop_resume[loop_variable] = set()\n\n                loop_resume_traces = set(\n                    continue_collection.getVariableCurrentTrace(loop_variable)\n                    for continue_collection in continue_collections\n                )\n\n                # Only if the variable is re-entering the loop, annotate that.\n                if not loop_resume_traces or (\n                    len(loop_resume_traces) == 1\n                    and loop_entry_trace.compareValueTrace(\n                        next(iter(loop_resume_traces))\n                    )\n                ):\n                    # Remove the variable, need not consider it\n                    # ever again.\n                    del self.loop_resume[loop_variable]\n                    del self.loop_previous_resume[loop_variable]\n                    del self.loop_start[loop_variable]\n\n                    continue\n\n                # Keep this as a loop variable\n                self.loop_variables.append(loop_variable)\n\n                # Tell the loop trace about the continue traces.\n                loop_entry_trace.addLoopContinueTraces(loop_resume_traces)\n\n                # Also consider the entry trace before loop from here on.\n                loop_resume_traces.add(self.loop_start[loop_variable])\n\n                shapes = set()\n\n                for loop_resume_trace in loop_resume_traces:\n                    loop_resume_trace.getTypeShape().emitAlternatives(shapes.add)\n\n                self.loop_resume[loop_variable] = minimizeShapes(shapes)\n\n            # If we break, the outer collections becomes a merge of all those breaks\n            # or just the one, if there is only one.\n            break_collections = trace_collection.getLoopBreakCollections()\n\n        if incomplete_variables:\n            self.incomplete_count += 1\n\n            trace_collection.signalChange(\n                \"loop_analysis\",\n                self.source_ref,\n                lambda: \"Loop has incomplete variable types after %d attempts for '%s'.\"\n                % (\n                    self.incomplete_count,\n                    \",\".join(variable.getName() for variable in incomplete_variables),\n                ),\n            )\n        else:\n            if self.incomplete_count:\n                trace_collection.signalChange(\n                    \"loop_analysis\",\n                    self.source_ref,\n                    lambda: \"Loop has complete variable types after %d attempts.\"\n                    % self.incomplete_count,\n                )\n\n                self.incomplete_count = 0\n\n        return loop_body, break_collections, continue_collections\n\n    def computeStatement(self, trace_collection):\n        outer_trace_collection = trace_collection\n        trace_collection = TraceCollectionBranch(parent=trace_collection, name=\"loop\")\n\n        loop_body, break_collections, continue_collections = self._computeLoopBody(\n            trace_collection\n        )\n\n        if break_collections:\n            outer_trace_collection.mergeMultipleBranches(break_collections)\n\n        # Consider trailing \"continue\" statements, these have no effect, so we\n        # can remove them.\n        if loop_body is not None:\n            assert loop_body.isStatementsSequence()\n\n            statements = loop_body.subnode_statements\n            assert statements  # Cannot be empty\n\n            # If the last statement is a \"continue\" statement, it can simply\n            # be discarded.\n            last_statement = statements[-1]\n            if last_statement.isStatementLoopContinue():\n                if len(statements) == 1:\n                    self.subnode_body.finalize()\n\n                    self.clearChild(\"loop_body\")\n                    loop_body = None\n                else:\n                    last_statement.parent.replaceChild(last_statement, None)\n                    last_statement.finalize()\n\n                trace_collection.signalChange(\n                    \"new_statements\",\n                    last_statement.getSourceReference(),\n                    \"\"\"\\\nRemoved useless terminal 'continue' as last statement of loop.\"\"\",\n                )\n            elif last_statement.isStatementLoopBreak():\n                if not continue_collections and len(break_collections) == 1:\n                    loop_body = loop_body.removeStatement(last_statement)\n\n                    return (\n                        loop_body,\n                        \"new_statements\",\n                        \"Removed useless loop with only a break at the end.\",\n                    )\n\n        # Also consider the threading intermission. TODO: We ought to make it\n        # explicit, so we can see it potentially disrupting and changing the\n        # global variables. It may also raise.\n        outer_trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"loop statement\"\n\n\nclass StatementLoopContinue(StatementBase):\n    kind = \"STATEMENT_LOOP_CONTINUE\"\n\n    def __init__(self, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    @staticmethod\n    def isStatementAborting():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def mayContinue():\n        return True\n\n    def computeStatement(self, trace_collection):\n        # This statement being aborting, will already tell everything.\n        trace_collection.onLoopContinue()\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"loop continue statement\"\n\n\nclass StatementLoopBreak(StatementBase):\n    kind = \"STATEMENT_LOOP_BREAK\"\n\n    def __init__(self, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    @staticmethod\n    def isStatementAborting():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def mayBreak():\n        return True\n\n    def computeStatement(self, trace_collection):\n        # This statement being aborting, will already tell everything.\n        trace_collection.onLoopBreak()\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"loop break statement\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/MatchNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for match statement for Python3.10+ \"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingExpressionMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionTupleShapeExactMixin\n\n\nclass ExpressionMatchArgs(\n    ExpressionTupleShapeExactMixin, ChildHavingExpressionMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_MATCH_ARGS\"\n\n    named_children = (\"expression\",)\n\n    __slots__ = (\"max_allowed\",)\n\n    def __init__(self, expression, max_allowed, source_ref):\n        ChildHavingExpressionMixin.__init__(self, expression=expression)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.max_allowed = max_allowed\n\n    def computeExpression(self, trace_collection):\n        # TODO: May know that match args doesn't raise from the shape of\n        # the matches expression, most don't.\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ModuleAttributeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module/Package attribute nodes\n\nThe represent special values of the modules. The \"__name__\", \"__package__\",\n\"__file__\", and \"__spec__\" values can all be highly dynamic and version\ndependent\n\nThese nodes are intended to allow for as much compile time optimization as\npossible, despite this difficulty. In some modes these node become constants\nquickly, in others they will present boundaries for optimization.\n\n\"\"\"\n\nfrom nuitka import Options\n\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\n\n\nclass ExpressionModuleAttributeBase(ExpressionBase):\n    \"\"\"Expression base class for module attributes.\n\n    This\n    \"\"\"\n\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    __slots__ = (\"variable\",)\n\n    def __init__(self, variable, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable = variable\n\n    def finalize(self):\n        del self.parent\n        del self.variable\n\n    def getDetails(self):\n        return {\"variable\": self.variable}\n\n    def getVariable(self):\n        return self.variable\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # These attributes can be expected to be present.\n\n        return False\n\n\nclass ExpressionModuleAttributeFileRef(ExpressionModuleAttributeBase):\n    \"\"\"Expression that represents accesses to __file__ of module.\n\n    The __file__ is a static or dynamic value depending on the\n    file reference mode. If it requests runtime, i.e. looks at\n    where it is loaded from, then there is not a lot to be said\n    about its value, otherwise it becomes a constant value\n    quickly.\n    \"\"\"\n\n    kind = \"EXPRESSION_MODULE_ATTRIBUTE_FILE_REF\"\n\n    def computeExpressionRaw(self, trace_collection):\n        # There is not a whole lot to do here, the path will change at run\n        # time, but options may disable that and make it predictable.\n        if Options.getFileReferenceMode() != \"runtime\":\n            result = makeConstantRefNode(\n                constant=self.variable.getModule().getRunTimeFilename(),\n                source_ref=self.source_ref,\n            )\n\n            return result, \"new_expression\", \"Using original '__file__' value.\"\n\n        return self, None, None\n\n\nclass ExpressionModuleAttributeNameRef(ExpressionModuleAttributeBase):\n    \"\"\"Expression that represents accesses to __name__ of module.\n\n    For binaries this can be relatively well known, but modules\n    living in a package, go by what loads them to ultimately\n    determine their name.\n    \"\"\"\n\n    kind = \"EXPRESSION_MODULE_ATTRIBUTE_NAME_REF\"\n\n    def computeExpressionRaw(self, trace_collection):\n        # For binaries, we can know it definite, but not for modules.\n\n        if Options.getModuleNameMode() != \"runtime\":\n            result = makeConstantRefNode(\n                constant=self.variable.getModule().getRuntimeNameValue(),\n                source_ref=self.source_ref,\n            )\n\n            return result, \"new_expression\", \"Using constant '__name__' value.\"\n\n        return self, None, None\n\n\nclass ExpressionModuleAttributePackageRef(ExpressionModuleAttributeBase):\n    \"\"\"Expression that represents accesses to __package__ of module.\n\n    For binaries this can be relatively well known, but modules\n    living in a package, go by what loads them to ultimately\n    determine their parent package.\n    \"\"\"\n\n    kind = \"EXPRESSION_MODULE_ATTRIBUTE_PACKAGE_REF\"\n\n    def computeExpressionRaw(self, trace_collection):\n        # For binaries, we can know it definite, but not for modules.\n\n        if Options.getModuleNameMode() != \"runtime\":\n            provider = self.variable.getModule()\n            value = provider.getRuntimePackageValue()\n\n            result = makeConstantRefNode(constant=value, source_ref=self.source_ref)\n\n            return result, \"new_expression\", \"Using constant '__package__' value.\"\n\n        return self, None, None\n\n\nclass ExpressionModuleAttributeLoaderRef(ExpressionModuleAttributeBase):\n    \"\"\"Expression that represents accesses to __loader__ of module.\n\n    The loader of Nuitka is going to load the module, and there\n    is not a whole lot to be said about it here, it is assumed\n    to be largely ignored in user code.\n    \"\"\"\n\n    kind = \"EXPRESSION_MODULE_ATTRIBUTE_LOADER_REF\"\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n\nclass ExpressionModuleAttributeSpecRef(ExpressionModuleAttributeBase):\n    \"\"\"Expression that represents accesses to __spec__ of module.\n\n    The __spec__ is used by the loader mechanism and sometimes\n    by code checking e.g. if something is a package. It exists\n    only for modern Python. For the main program module, it's\n    always None (it is also not really loaded in the same way\n    as other code).\n    \"\"\"\n\n    kind = \"EXPRESSION_MODULE_ATTRIBUTE_SPEC_REF\"\n\n    def computeExpressionRaw(self, trace_collection):\n        if self.variable.getModule().isMainModule():\n            result = makeConstantRefNode(constant=None, source_ref=self.source_ref)\n\n            return (\n                result,\n                \"new_expression\",\n                \"Using constant '__spec__' value for main module.\",\n            )\n\n        return self, None, None\n\n\nclass ExpressionNuitkaLoaderCreation(ExpressionNoSideEffectsMixin, ExpressionBase):\n    __slots__ = (\"provider\",)\n\n    kind = \"EXPRESSION_NUITKA_LOADER_CREATION\"\n\n    def __init__(self, provider, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.provider = provider\n\n    def finalize(self):\n        del self.parent\n        del self.provider\n\n    def computeExpressionRaw(self, trace_collection):\n        # Nothing can be done here.\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ModuleNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module/Package nodes\n\nThe top of the tree. Packages are also modules. Modules are what hold a program\ntogether and cross-module optimizations are the most difficult to tackle.\n\"\"\"\n\nimport os\n\nfrom nuitka import Options, Variables\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.Importing import locateModule, makeModuleUsageAttempt\nfrom nuitka.importing.Recursion import decideRecursion, recurseTo\nfrom nuitka.ModuleRegistry import getModuleByName, getOwnerFromCodeName\nfrom nuitka.optimizations.TraceCollections import TraceCollectionModule\nfrom nuitka.Options import hasPythonFlagIsolated\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.SourceCodeReferences import fromFilename\nfrom nuitka.tree.SourceHandling import parsePyIFile, readSourceCodeFromFilename\nfrom nuitka.utils.CStrings import encodePythonIdentifierToC\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .ChildrenHavingMixins import (\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin,\n)\nfrom .FutureSpecs import fromFlags\nfrom .IndicatorMixins import EntryPointMixin, MarkNeedsAnnotationsMixin\nfrom .LocalsScopes import getLocalsDictHandle\nfrom .NodeBases import (\n    ClosureGiverNodeMixin,\n    NodeBase,\n    extractKindAndArgsFromXML,\n    fromXML,\n)\n\n\nclass PythonModuleBase(NodeBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    __slots__ = (\"module_name\", \"reason\")\n\n    def __init__(self, module_name, reason, source_ref):\n        assert type(module_name) is ModuleName, module_name\n        assert module_name != \"\", source_ref\n\n        NodeBase.__init__(self, source_ref=source_ref)\n\n        self.module_name = module_name\n        self.reason = reason\n\n    def getDetails(self):\n        return {\"module_name\": self.module_name}\n\n    def getFullName(self):\n        return self.module_name\n\n    @staticmethod\n    def isMainModule():\n        return False\n\n    @staticmethod\n    def isTopModule():\n        return False\n\n    def attemptRecursion(self):\n        # Make sure the package is recursed to if any\n        package_name = self.module_name.getPackageName()\n        if package_name is None:\n            return ()\n\n        # Return the list of newly added modules.\n\n        package = getModuleByName(package_name)\n\n        if package_name is not None and package is None:\n            (\n                _package_name,\n                package_filename,\n                package_module_kind,\n                finding,\n            ) = locateModule(\n                module_name=package_name,\n                parent_package=None,\n                level=0,\n            )\n\n            # If we can't find the package for Python3.3 that is semi-OK, it might be in a\n            # namespace package, these have no init code.\n            if python_version >= 0x300 and not package_filename:\n                return ()\n\n            if package_name == \"uniconvertor.app.modules\":\n                return ()\n\n            assert package_filename is not None, (package_name, finding)\n\n            assert _package_name == package_name, (\n                package_filename,\n                _package_name,\n                package_name,\n            )\n\n            decision, _reason = decideRecursion(\n                using_module_name=self.getFullName(),\n                module_filename=package_filename,\n                module_name=package_name,\n                module_kind=package_module_kind,\n            )\n\n            if decision is not None:\n                package = recurseTo(\n                    module_name=package_name,\n                    module_filename=package_filename,\n                    module_kind=package_module_kind,\n                    source_ref=self.source_ref,\n                    reason=\"parent package\",\n                    using_module_name=self.module_name,\n                )\n\n        if package:\n            from nuitka.ModuleRegistry import addUsedModule\n\n            addUsedModule(\n                package,\n                using_module=self,\n                usage_tag=\"package\",\n                reason=\"Containing package of '%s'.\" % self.getFullName(),\n                source_ref=self.source_ref,\n            )\n\n    def getCodeName(self):\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def getCompileTimeFilename(self):\n        \"\"\"The compile time filename for the module.\n\n        Returns:\n            Full path to module file at compile time.\n        Notes:\n            We are getting the absolute path here, since we do\n            not want to have to deal with resolving paths at\n            all.\n\n        \"\"\"\n        return os.path.abspath(self.source_ref.getFilename())\n\n    def getCompileTimeDirectory(self):\n        \"\"\"The compile time directory for the module.\n\n        Returns:\n            Full path to module directory at compile time.\n        Notes:\n            For packages, we let the package directory be\n            the result, otherwise the containing directory\n            is the result.\n        Notes:\n            Use this to find files nearby a module, mainly\n            in plugin code.\n        \"\"\"\n        result = self.getCompileTimeFilename()\n        if not os.path.isdir(result):\n            result = os.path.dirname(result)\n        return result\n\n    def getRunTimeFilename(self):\n        reference_mode = Options.getFileReferenceMode()\n\n        if reference_mode == \"original\":\n            return self.getCompileTimeFilename()\n        elif reference_mode == \"frozen\":\n            return \"<frozen %s>\" % self.getFullName()\n        else:\n            filename = self.getCompileTimeFilename()\n\n            full_name = self.getFullName()\n\n            result = os.path.basename(filename)\n            current = filename\n\n            levels = full_name.count(\".\")\n            if (\n                self.isCompiledPythonPackage()\n                and not self.isCompiledPythonNamespacePackage()\n            ):\n                levels += 1\n\n            for _i in range(levels):\n                current = os.path.dirname(current)\n\n                result = os.path.join(os.path.basename(current), result)\n\n            # Avoid unnecessary unicode path values\n            if str is not bytes:\n                try:\n                    result = str(result)\n                except UnicodeDecodeError:\n                    pass\n\n            return result\n\n\nclass CompiledPythonModule(\n    ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin,\n    ClosureGiverNodeMixin,\n    MarkNeedsAnnotationsMixin,\n    EntryPointMixin,\n    PythonModuleBase,\n):\n    \"\"\"Compiled Python Module\"\"\"\n\n    # This one has a few indicators, pylint: disable=too-many-instance-attributes\n\n    kind = \"COMPILED_PYTHON_MODULE\"\n\n    __slots__ = (\n        \"is_top\",\n        \"name\",\n        \"code_prefix\",\n        \"code_name\",\n        \"uids\",\n        \"temp_variables\",\n        \"temp_scopes\",\n        \"preserver_id\",\n        \"needs_annotations_dict\",\n        \"trace_collection\",\n        \"mode\",\n        \"variables\",\n        \"active_functions\",\n        \"visited_functions\",\n        \"cross_used_functions\",\n        \"used_modules\",\n        \"future_spec\",\n        \"source_code\",\n        \"module_dict_name\",\n        \"locals_scope\",\n    )\n\n    named_children = (\"body|statements_or_none+setter\", \"functions|tuple+setter\")\n\n    def __init__(self, module_name, reason, is_top, mode, future_spec, source_ref):\n        PythonModuleBase.__init__(\n            self,\n            module_name=module_name,\n            reason=reason,\n            source_ref=source_ref,\n        )\n\n        ClosureGiverNodeMixin.__init__(\n            self, name=module_name.getBasename(), code_prefix=\"module\"\n        )\n\n        ModuleChildrenHavingBodyOptionalStatementsOrNoneFunctionsTupleMixin.__init__(\n            self,\n            body=None,  # delayed\n            functions=(),\n        )\n\n        MarkNeedsAnnotationsMixin.__init__(self)\n\n        EntryPointMixin.__init__(self)\n\n        self.is_top = is_top\n\n        self.mode = mode\n\n        self.variables = {}\n\n        # Functions that have been used.\n        self.active_functions = OrderedSet()\n\n        # Functions that should be visited again.\n        self.visited_functions = set()\n\n        self.cross_used_functions = OrderedSet()\n\n        self.used_modules = OrderedSet()\n\n        # Often \"None\" until tree building finishes its part.\n        self.future_spec = future_spec\n\n        # The source code of the module if changed or not from disk.\n        self.source_code = None\n\n        self.module_dict_name = \"globals_%s\" % (self.getCodeName(),)\n\n        self.locals_scope = getLocalsDictHandle(\n            self.module_dict_name, \"module_dict\", self\n        )\n\n        self.used_modules = OrderedSet()\n\n    @staticmethod\n    def isCompiledPythonModule():\n        return True\n\n    def getDetails(self):\n        return {\n            \"filename\": self.source_ref.getFilename(),\n            \"module_name\": self.module_name,\n        }\n\n    def getDetailsForDisplay(self):\n        result = self.getDetails()\n\n        if self.future_spec is not None:\n            result[\"code_flags\"] = \",\".join(self.future_spec.asFlags())\n\n        return result\n\n    def getCompilationMode(self):\n        return self.mode\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        # Modules are not having any provider, must not be used,\n        assert False\n\n    def getFutureSpec(self):\n        return self.future_spec\n\n    def setFutureSpec(self, future_spec):\n        self.future_spec = future_spec\n\n    def isTopModule(self):\n        return self.is_top\n\n    def asGraph(self, graph, desc):\n        graph = graph.add_subgraph(\n            name=\"cluster_%s\" % desc, comment=\"Graph for %s\" % self.getName()\n        )\n\n        #        graph.body.append(\"style=filled\")\n        #        graph.body.append(\"color=lightgrey\")\n        #        graph.body.append(\"label=Iteration_%d\" % desc)\n\n        def makeTraceNodeName(variable, version, variable_trace):\n            return \"%s/ %s %s %s\" % (\n                desc,\n                variable.getName(),\n                version,\n                variable_trace.__class__.__name__,\n            )\n\n        for function_body in self.active_functions:\n            trace_collection = function_body.trace_collection\n\n            node_names = {}\n\n            for (\n                (variable, version),\n                variable_trace,\n            ) in trace_collection.getVariableTracesAll().items():\n                node_name = makeTraceNodeName(variable, version, variable_trace)\n\n                node_names[variable_trace] = node_name\n\n            for (\n                (variable, version),\n                variable_trace,\n            ) in trace_collection.getVariableTracesAll().items():\n                node_name = node_names[variable_trace]\n\n                previous = variable_trace.getPrevious()\n\n                attrs = {\"style\": \"filled\"}\n\n                if variable_trace.getUsageCount():\n                    attrs[\"color\"] = \"blue\"\n                else:\n                    attrs[\"color\"] = \"red\"\n\n                graph.add_node(node_name, **attrs)\n\n                if type(previous) is tuple:\n                    for prev_trace in previous:\n                        graph.add_edge(node_names[prev_trace], node_name)\n\n                        assert prev_trace is not variable_trace\n\n                elif previous is not None:\n                    assert previous is not variable_trace\n                    graph.add_edge(node_names[previous], node_name)\n\n        return graph\n\n    def getSourceCode(self):\n        if self.source_code is not None:\n            return self.source_code\n        else:\n            # This should of course give same result as before.\n            return readSourceCodeFromFilename(\n                module_name=self.getFullName(),\n                source_filename=self.getCompileTimeFilename(),\n            )\n\n    def setSourceCode(self, code):\n        self.source_code = code\n\n    def getParent(self):\n        # We have never have a parent\n        return None\n\n    def getParentVariableProvider(self):\n        # We have never have a provider\n        return None\n\n    def hasVariableName(self, variable_name):\n        return variable_name in self.variables or variable_name in self.temp_variables\n\n    def getProvidedVariables(self):\n        return self.variables.values()\n\n    def getFilename(self):\n        return self.source_ref.getFilename()\n\n    def getVariableForAssignment(self, variable_name):\n        return self.getProvidedVariable(variable_name)\n\n    def getVariableForReference(self, variable_name):\n        return self.getProvidedVariable(variable_name)\n\n    def getVariableForClosure(self, variable_name):\n        return self.getProvidedVariable(variable_name=variable_name)\n\n    def createProvidedVariable(self, variable_name):\n        assert variable_name not in self.variables\n\n        result = Variables.ModuleVariable(module=self, variable_name=variable_name)\n\n        self.variables[variable_name] = result\n\n        return result\n\n    @staticmethod\n    def getContainingClassDictCreation():\n        return None\n\n    @staticmethod\n    def isEarlyClosure():\n        # Modules should immediately closure variables on use.\n        return True\n\n    def getEntryPoint(self):\n        return self\n\n    def getCodeName(self):\n        # For code name of modules, we need to translate to C identifiers,\n        # removing characters illegal for that.\n\n        if self.code_name is None:\n            self.code_name = encodePythonIdentifierToC(self.module_name)\n\n        return self.code_name\n\n    @staticmethod\n    def getChildQualname(function_name):\n        return function_name\n\n    def addFunction(self, function_body):\n        functions = self.subnode_functions\n        assert function_body not in functions\n        functions += (function_body,)\n        self.setChildFunctions(functions)\n\n    def startTraversal(self):\n        self.used_modules = None\n        self.active_functions = OrderedSet()\n\n    def restartTraversal(self):\n        self.visited_functions = set()\n        self.used_modules = None\n\n    def getUsedModules(self):\n        if self.trace_collection is None:\n            # Optimization is not yet done at all, but report writing for error\n            # exit may happen.\n            return ()\n\n        return self.trace_collection.getModuleUsageAttempts()\n\n    def getUsedDistributions(self):\n        return self.trace_collection.getUsedDistributions()\n\n    def addUsedFunction(self, function_body):\n        assert function_body in self.subnode_functions, function_body\n\n        assert (\n            function_body.isExpressionFunctionBody()\n            or function_body.isExpressionClassBodyBase()\n            or function_body.isExpressionGeneratorObjectBody()\n            or function_body.isExpressionCoroutineObjectBody()\n            or function_body.isExpressionAsyncgenObjectBody()\n        )\n\n        self.active_functions.add(function_body)\n\n        result = function_body not in self.visited_functions\n        self.visited_functions.add(function_body)\n\n        return result\n\n    def getUsedFunctions(self):\n        return self.active_functions\n\n    def getUnusedFunctions(self):\n        for function in self.subnode_functions:\n            if function not in self.active_functions:\n                yield function\n\n    def addCrossUsedFunction(self, function_body):\n        if function_body not in self.cross_used_functions:\n            self.cross_used_functions.add(function_body)\n\n    def getCrossUsedFunctions(self):\n        return self.cross_used_functions\n\n    def getFunctionFromCodeName(self, code_name):\n        for function in self.subnode_functions:\n            if function.getCodeName() == code_name:\n                return function\n\n    def getOutputFilename(self):\n        main_filename = self.getFilename()\n\n        if main_filename.endswith(\".py\"):\n            result = main_filename[:-3]\n        elif main_filename.endswith(\".pyw\"):\n            result = main_filename[:-4]\n        else:\n            result = main_filename\n\n        # There are some characters that somehow are passed to shell, by\n        # Scons or unknown, so lets avoid them for now.\n        return result.replace(\")\", \"\").replace(\"(\", \"\")\n\n    def computeModule(self):\n        self.restartTraversal()\n\n        old_collection = self.trace_collection\n\n        self.trace_collection = TraceCollectionModule(\n            self,\n            very_trusted_module_variables=(\n                old_collection.getVeryTrustedModuleVariables()\n                if old_collection is not None\n                else {}\n            ),\n        )\n\n        module_body = self.subnode_body\n\n        if module_body is not None:\n            result = module_body.computeStatementsSequence(\n                trace_collection=self.trace_collection\n            )\n\n            if result is not module_body:\n                self.setChildBody(result)\n\n        self.attemptRecursion()\n\n        # We determine the trusted module variable for use on next turnaround to provide functions with traces for them.\n        very_trusted_module_variables = {}\n        for module_variable in self.locals_scope.getLocalsRelevantVariables():\n            very_trusted_node = self.trace_collection.getVariableCurrentTrace(\n                module_variable\n            ).getAttributeNodeVeryTrusted()\n            if very_trusted_node is not None:\n                very_trusted_module_variables[module_variable] = very_trusted_node\n\n        if self.trace_collection.updateVeryTrustedModuleVariables(\n            very_trusted_module_variables\n        ):\n            self.trace_collection.signalChange(\n                tags=\"trusted_module_variables\",\n                message=\"Trusting module variable(s) '%s'\"\n                % \",\".join(\n                    variable.getName()\n                    for variable in self.trace_collection.getVeryTrustedModuleVariables()\n                ),\n                source_ref=self.source_ref,\n            )\n\n        # Finalize locals scopes previously determined for removal in last pass.\n        self.trace_collection.updateVariablesFromCollection(\n            old_collection=old_collection, source_ref=self.source_ref\n        )\n\n        # Indicate if this is pass 1 for the module as return value.\n        was_complete = not self.locals_scope.complete\n\n        def markAsComplete(body, trace_collection):\n            if body.locals_scope is not None:\n                # Make sure the propagated stuff releases memory.\n                if body.locals_scope.isMarkedForPropagation():\n                    body.locals_scope.onPropagationComplete()\n\n                body.locals_scope.markAsComplete(trace_collection)\n\n        def markEntryPointAsComplete(body):\n            markAsComplete(body, body.trace_collection)\n\n            outline_bodies = body.trace_collection.getOutlineFunctions()\n\n            if outline_bodies is not None:\n                for outline_body in outline_bodies:\n                    markAsComplete(outline_body, body.trace_collection)\n\n            body.optimizeUnusedTempVariables()\n\n        markEntryPointAsComplete(self)\n\n        for function_body in self.getUsedFunctions():\n            markEntryPointAsComplete(function_body)\n\n            function_body.optimizeUnusedClosureVariables()\n            function_body.optimizeVariableReleases()\n\n        return was_complete\n\n    def getTraceCollections(self):\n        yield self.trace_collection\n\n        for function in self.getUsedFunctions():\n            yield function.trace_collection\n\n    def isUnoptimized(self):\n        # Modules don't do this, pylint: disable=no-self-use\n        return False\n\n    def getLocalVariables(self):\n        # Modules don't do this, pylint: disable=no-self-use\n        return ()\n\n    def getUserLocalVariables(self):\n        # Modules don't do this, pylint: disable=no-self-use\n        return ()\n\n    @staticmethod\n    def getFunctionVariablesWithAutoReleases():\n        \"\"\"Return the list of function variables that should be released at exit.\"\"\"\n        return ()\n\n    def getOutlineLocalVariables(self):\n        outlines = self.getTraceCollection().getOutlineFunctions()\n\n        if outlines is None:\n            return ()\n\n        result = []\n\n        for outline in outlines:\n            result.extend(outline.getUserLocalVariables())\n\n        return result\n\n    def hasClosureVariable(self, variable):\n        # Modules don't do this, pylint: disable=no-self-use,unused-argument\n        return False\n\n    def removeUserVariable(self, variable):\n        outlines = self.getTraceCollection().getOutlineFunctions()\n\n        for outline in outlines:\n            user_locals = outline.getUserLocalVariables()\n\n            if variable in user_locals:\n                outline.removeUserVariable(variable)\n                break\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    def getRuntimePackageValue(self):\n        if self.isCompiledPythonPackage():\n            return self.getFullName().asString()\n\n        value = self.getFullName().getPackageName()\n\n        if value is not None:\n            return value.asString()\n\n        if self.isMainModule():\n            if self.main_added:\n                return \"\"\n            else:\n                return None\n        else:\n            return None\n\n    def getRuntimeNameValue(self):\n        if self.isMainModule() and Options.hasPythonFlagPackageMode():\n            return \"__main__\"\n        elif self.module_name.isMultidistModuleName():\n            return \"__main__\"\n        else:\n            return self.getFullName().asString()\n\n\nclass CompiledPythonPackage(CompiledPythonModule):\n    kind = \"COMPILED_PYTHON_PACKAGE\"\n\n    def __init__(self, module_name, reason, is_top, mode, future_spec, source_ref):\n        CompiledPythonModule.__init__(\n            self,\n            module_name=module_name,\n            reason=reason,\n            is_top=is_top,\n            mode=mode,\n            future_spec=future_spec,\n            source_ref=source_ref,\n        )\n\n    @staticmethod\n    def isCompiledPythonPackage():\n        return True\n\n    def getOutputFilename(self):\n        result = self.getFilename()\n\n        if os.path.isdir(result):\n            return result\n        else:\n            return os.path.dirname(result)\n\n    @staticmethod\n    def canHaveExternalImports():\n        return not hasPythonFlagIsolated()\n\n\nclass CompiledPythonNamespacePackage(CompiledPythonPackage):\n    kind = \"COMPILED_PYTHON_NAMESPACE_PACKAGE\"\n\n    @staticmethod\n    def isCompiledPythonNamespacePackage():\n        return True\n\n\ndef makeUncompiledPythonModule(\n    module_name, reason, filename, bytecode, is_package, technical\n):\n    source_ref = fromFilename(filename)\n\n    if is_package:\n        return UncompiledPythonPackage(\n            module_name=module_name,\n            reason=reason,\n            bytecode=bytecode,\n            filename=filename,\n            technical=technical,\n            source_ref=source_ref,\n        )\n    else:\n        return UncompiledPythonModule(\n            module_name=module_name,\n            reason=reason,\n            bytecode=bytecode,\n            filename=filename,\n            technical=technical,\n            source_ref=source_ref,\n        )\n\n\nclass UncompiledPythonModule(PythonModuleBase):\n    \"\"\"Uncompiled Python Module\"\"\"\n\n    kind = \"UNCOMPILED_PYTHON_MODULE\"\n\n    __slots__ = (\n        \"bytecode\",\n        \"filename\",\n        \"technical\",\n        \"used_modules\",\n        \"distribution_names\",\n    )\n\n    def __init__(\n        self,\n        module_name,\n        reason,\n        bytecode,\n        filename,\n        technical,\n        source_ref,\n    ):\n        PythonModuleBase.__init__(\n            self,\n            module_name=module_name,\n            reason=reason,\n            source_ref=source_ref,\n        )\n\n        self.bytecode = bytecode\n        self.filename = filename\n\n        self.technical = technical\n\n        self.used_modules = ()\n        self.distribution_names = ()\n\n    def finalize(self):\n        del self.used_modules\n        del self.bytecode\n\n    @staticmethod\n    def isUncompiledPythonModule():\n        return True\n\n    def isTechnical(self):\n        \"\"\"Must be bytecode as it's used in CPython library initialization.\"\"\"\n        return self.technical\n\n    def getByteCode(self):\n        return self.bytecode\n\n    def getFilename(self):\n        return self.filename\n\n    def getUsedModules(self):\n        return self.used_modules\n\n    def setUsedModules(self, used_modules):\n        self.used_modules = used_modules\n\n    def getUsedDistributions(self):\n        return self.distribution_names\n\n    def setUsedDistributions(self, distribution_names):\n        self.distribution_names = distribution_names\n\n    @staticmethod\n    def startTraversal():\n        pass\n\n\nclass UncompiledPythonPackage(UncompiledPythonModule):\n    kind = \"UNCOMPILED_PYTHON_PACKAGE\"\n\n\nclass PythonMainModule(CompiledPythonModule):\n    \"\"\"Main module of a program, typically \"__main__\" but can be inside a package too.\"\"\"\n\n    kind = \"PYTHON_MAIN_MODULE\"\n\n    __slots__ = (\"main_added\", \"standard_library_modules\")\n\n    def __init__(self, module_name, main_added, mode, future_spec, source_ref):\n        assert not Options.shallMakeModule()\n\n        # Is this one from a \"__main__.py\" file\n        self.main_added = main_added\n\n        CompiledPythonModule.__init__(\n            self,\n            module_name=module_name,\n            reason=\"main\",\n            is_top=True,\n            mode=mode,\n            future_spec=future_spec,\n            source_ref=source_ref,\n        )\n\n        self.standard_library_modules = ()\n\n    def getDetails(self):\n        return {\n            \"filename\": self.source_ref.getFilename(),\n            \"module_name\": self.module_name,\n            \"main_added\": self.main_added,\n            \"mode\": self.mode,\n        }\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        future_spec = fromFlags(args[\"code_flags\"])\n\n        result = cls(\n            main_added=args[\"main_added\"] == \"True\",\n            mode=args[\"mode\"],\n            module_name=ModuleName(args[\"module_name\"]),\n            future_spec=future_spec,\n            source_ref=source_ref,\n        )\n\n        from nuitka.ModuleRegistry import addRootModule\n\n        addRootModule(result)\n\n        function_work = []\n\n        for xml in args[\"functions\"]:\n            _kind, node_class, func_args, source_ref = extractKindAndArgsFromXML(\n                xml, source_ref\n            )\n\n            if \"provider\" in func_args:\n                func_args[\"provider\"] = getOwnerFromCodeName(func_args[\"provider\"])\n            else:\n                func_args[\"provider\"] = result\n\n            if \"flags\" in args:\n                func_args[\"flags\"] = set(func_args[\"flags\"].split(\",\"))\n\n            if \"doc\" not in args:\n                func_args[\"doc\"] = None\n\n            function = node_class.fromXML(source_ref=source_ref, **func_args)\n\n            # Could do more checks for look up of body here, but so what...\n            function_work.append((function, iter(iter(xml).next()).next()))\n\n        for function, xml in function_work:\n            function.setChildBody(\n                fromXML(\n                    provider=function, xml=xml, source_ref=function.getSourceReference()\n                )\n            )\n\n        result.setChildBody(\n            fromXML(provider=result, xml=args[\"body\"][0], source_ref=source_ref)\n        )\n\n        return result\n\n    @staticmethod\n    def isMainModule():\n        return True\n\n    def getOutputFilename(self):\n        if self.main_added:\n            return os.path.dirname(self.getFilename())\n        else:\n            return CompiledPythonModule.getOutputFilename(self)\n\n    def getUsedModules(self):\n        for used_module in CompiledPythonModule.getUsedModules(self):\n            yield used_module\n\n        for used_module in self.standard_library_modules:\n            yield used_module\n\n    def setStandardLibraryModules(self, early_module_names, stdlib_modules_names):\n        self.standard_library_modules = OrderedSet()\n\n        for early_module_name in early_module_names + stdlib_modules_names:\n            _early_module_name, module_filename, module_kind, finding = locateModule(\n                module_name=early_module_name,\n                parent_package=None,\n                level=0,\n            )\n\n            # Technically required, but not found must not happen\n            assert finding != \"not-found\", early_module_name\n\n            self.standard_library_modules.add(\n                makeModuleUsageAttempt(\n                    module_name=early_module_name,\n                    filename=module_filename,\n                    module_kind=module_kind,\n                    finding=finding,\n                    level=0,\n                    source_ref=self.source_ref,\n                    reason=\"stdlib\",\n                )\n            )\n\n\nclass PythonExtensionModule(PythonModuleBase):\n    kind = \"PYTHON_EXTENSION_MODULE\"\n\n    __slots__ = (\"used_modules\", \"technical\")\n\n    avoid_duplicates = set()\n\n    def __init__(\n        self,\n        module_name,\n        reason,\n        technical,\n        source_ref,\n    ):\n        PythonModuleBase.__init__(\n            self,\n            module_name=module_name,\n            reason=reason,\n            source_ref=source_ref,\n        )\n\n        # That would be a mistake we just made.\n        assert os.path.basename(source_ref.getFilename()) != \"<frozen>\"\n\n        # That is too likely a bug.\n        assert module_name != \"__main__\"\n\n        # Duplicates should be avoided by us caching elsewhere before creating\n        # the object.\n        assert self.getFullName() not in self.avoid_duplicates, self.getFullName()\n        self.avoid_duplicates.add(self.getFullName())\n\n        # Required to startup\n        self.technical = technical\n\n        self.used_modules = None\n\n    def finalize(self):\n        del self.used_modules\n\n    def getFilename(self):\n        return self.source_ref.getFilename()\n\n    @staticmethod\n    def startTraversal():\n        pass\n\n    def isTechnical(self):\n        \"\"\"Must be present as it's used in CPython library initialization.\"\"\"\n        return self.technical\n\n    def getPyIFilename(self):\n        \"\"\"Get Python type description filename.\"\"\"\n\n        path = self.getFilename()\n        filename = os.path.basename(path)\n        dirname = os.path.dirname(path)\n\n        return os.path.join(dirname, filename.split(\".\")[0]) + \".pyi\"\n\n    def _readPyIFile(self):\n        \"\"\"Read the .pyi file if present and scan for dependencies.\"\"\"\n\n        if self.used_modules is None:\n            pyi_filename = self.getPyIFilename()\n\n            if os.path.exists(pyi_filename):\n                pyi_deps = parsePyIFile(\n                    module_name=self.getFullName(), pyi_filename=pyi_filename\n                )\n\n                # These are not to be taken serious.\n                if \"typing\" in pyi_deps:\n                    pyi_deps.discard(\"typing\")\n                if \"__future__\" in pyi_deps:\n                    pyi_deps.discard(\"__future__\")\n\n                # Dependency on itself makes no sense.\n                if self.getFullName() in pyi_deps:\n                    pyi_deps.discard(self.getFullName())\n\n                # Dependency on containing package makes no sense.\n                if self.getFullName().getPackageName() in pyi_deps:\n                    pyi_deps.discard(self.getFullName().getPackageName())\n\n                self.used_modules = tuple(pyi_deps)\n            else:\n                self.used_modules = ()\n\n    def getPyIModuleImportedNames(self):\n        self._readPyIFile()\n\n        assert \".\" not in self.used_modules, self\n\n        return self.used_modules\n\n    @staticmethod\n    def getUsedModules():\n        # The PyI contents is currently delivered via implicit imports\n        # plugin.\n        return ()\n\n    @staticmethod\n    def getUsedDistributions():\n        return {}\n\n    def getParentModule(self):\n        return self\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/NodeBases.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node base classes.\n\nThese classes provide the generic base classes available for nodes,\nstatements or expressions alike. There is a dedicated module for\nexpression only stuff.\n\n\"\"\"\n\n# from abc import abstractmethod\n\nimport ast\nfrom abc import abstractmethod\n\nfrom nuitka import Options, Tracing, TreeXML\nfrom nuitka.__past__ import iterItems\nfrom nuitka.Errors import NuitkaNodeError\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.SourceCodeReferences import SourceCodeReference\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\nfrom nuitka.Variables import TempVariable\n\nfrom .FutureSpecs import fromFlags\nfrom .NodeMakingHelpers import makeStatementOnlyNodesFromExpressions\nfrom .NodeMetaClasses import NodeCheckMetaClass, NodeMetaClassBase\n\n\nclass NodeBase(NodeMetaClassBase):\n    __slots__ = \"parent\", \"source_ref\"\n\n    # This can trigger if this is included to early.\n    assert Options.is_full_compat is not None\n\n    # Avoid the attribute unless it's really necessary.\n    if Options.is_full_compat:\n        __slots__ += (\"effective_source_ref\",)\n\n    # String to identify the node class, to be consistent with its name.\n    kind = None\n\n    @counted_init\n    def __init__(self, source_ref):\n        # The base class has no __init__ worth calling.\n\n        # Check source reference to meet basic standards, so we note errors\n        # when they occur.\n        assert source_ref is not None\n        assert source_ref.line is not None\n\n        self.parent = None\n\n        self.source_ref = source_ref\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    @abstractmethod\n    def finalize(self):\n        pass\n\n    def __repr__(self):\n        return \"<Node %s>\" % (self.getDescription())\n\n    def getDescription(self):\n        \"\"\"Description of the node, intended for use in __repr__ and\n        graphical display.\n\n        \"\"\"\n        details = self.getDetailsForDisplay()\n\n        if details:\n            return \"'%s' with %s\" % (self.kind, details)\n        else:\n            return \"'%s'\" % self.kind\n\n    def getDetails(self):\n        \"\"\"Details of the node, intended for re-creation.\n\n        We are not using the pickle mechanisms, but this is basically\n        part of what the constructor call needs. Real children will\n        also be added.\n\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        return {}\n\n    def getDetailsForDisplay(self):\n        \"\"\"Details of the node, intended for use in __repr__ and dumps.\n\n        This is also used for XML.\n        \"\"\"\n        return self.getDetails()\n\n    def getCloneArgs(self):\n        return self.getDetails()\n\n    def makeClone(self):\n        try:\n            # Using star dictionary arguments here for generic use.\n            result = self.__class__(source_ref=self.source_ref, **self.getCloneArgs())\n        except TypeError as e:\n            raise NuitkaNodeError(\"Problem cloning node\", self, e)\n\n        effective_source_ref = self.getCompatibleSourceReference()\n\n        if effective_source_ref is not self.source_ref:\n            result.setCompatibleSourceReference(effective_source_ref)\n\n        return result\n\n    def makeCloneShallow(self):\n        args = self.getDetails()\n        args.update(self.getVisitableNodesNamed())\n\n        try:\n            # Using star dictionary arguments here for generic use.\n            result = self.__class__(source_ref=self.source_ref, **args)\n        except TypeError as e:\n            raise NuitkaNodeError(\"Problem cloning node\", self, e)\n\n        effective_source_ref = self.getCompatibleSourceReference()\n\n        if effective_source_ref is not self.source_ref:\n            result.setCompatibleSourceReference(effective_source_ref)\n\n        return result\n\n    def getParent(self):\n        \"\"\"Parent of the node. Every node except modules has to have a parent.\"\"\"\n\n        if self.parent is None and not self.isCompiledPythonModule():\n            assert False, (self, self.source_ref)\n\n        return self.parent\n\n    def getChildName(self):\n        \"\"\"Return the role in the current parent, subject to changes.\"\"\"\n        parent = self.getParent()\n\n        for key, value in parent.getVisitableNodesNamed():\n            if self is value:\n                return key\n\n            if type(value) is tuple:\n                if self in value:\n                    return key, value.index(self)\n\n        return None\n\n    def getChildNameNice(self):\n        child_name = self.getChildName()\n\n        if hasattr(self.parent, \"nice_children_dict\"):\n            return self.parent.nice_children_dict[child_name]\n        else:\n            return child_name\n\n    def getParentFunction(self):\n        \"\"\"Return the parent that is a function.\"\"\"\n\n        parent = self.getParent()\n\n        while parent is not None and not parent.isExpressionFunctionBodyBase():\n            parent = parent.getParent()\n\n        return parent\n\n    def getParentModule(self):\n        \"\"\"Return the parent that is module.\"\"\"\n        parent = self\n\n        while not parent.isCompiledPythonModule():\n            if hasattr(parent, \"provider\"):\n                # After we checked, we can use it, will be much faster route\n                # to take.\n                parent = parent.provider\n            else:\n                parent = parent.getParent()\n\n        return parent\n\n    def isParentVariableProvider(self):\n        # Check if it's a closure giver, in which cases it can provide variables,\n        return isinstance(self, ClosureGiverNodeMixin)\n\n    def getParentVariableProvider(self):\n        parent = self.getParent()\n\n        while not parent.isParentVariableProvider():\n            parent = parent.getParent()\n\n        return parent\n\n    def getParentReturnConsumer(self):\n        parent = self.getParent()\n\n        while (\n            not parent.isParentVariableProvider()\n            and not parent.isExpressionOutlineBody()\n        ):\n            parent = parent.getParent()\n\n        return parent\n\n    def getParentStatementsFrame(self):\n        current = self.getParent()\n\n        while True:\n            if current.isStatementsFrame():\n                return current\n\n            if current.isParentVariableProvider():\n                return None\n\n            if current.isExpressionOutlineBody():\n                return None\n\n            current = current.getParent()\n\n    def getSourceReference(self):\n        return self.source_ref\n\n    def setCompatibleSourceReference(self, source_ref):\n        \"\"\"Bug compatible line numbers information.\n\n        As CPython outputs the last bit of bytecode executed, and not the\n        line of the operation. For example calls, output the line of the\n        last argument, as opposed to the line of the operation start.\n\n        For tests, we wants to be compatible. In improved more, we are\n        not being fully compatible, and just drop it altogether.\n        \"\"\"\n\n        # Getting the same source reference can be dealt with quickly, so do\n        # this first.\n        if (\n            self.source_ref is not source_ref\n            and Options.is_full_compat\n            and self.source_ref != source_ref\n        ):\n            # An attribute outside of \"__init__\", so we save one memory for the\n            # most cases. Very few cases involve splitting across lines.\n            # false alarm for non-slot:\n            # pylint: disable=I0021,assigning-non-slot,attribute-defined-outside-init\n            self.effective_source_ref = source_ref\n\n    def getCompatibleSourceReference(self):\n        \"\"\"Bug compatible line numbers information.\n\n        See above.\n        \"\"\"\n        return getattr(self, \"effective_source_ref\", self.source_ref)\n\n    def asXml(self):\n        line = self.source_ref.getLineNumber()\n\n        result = TreeXML.Element(\"node\", kind=self.__class__.__name__, line=str(line))\n\n        compat_line = self.getCompatibleSourceReference().getLineNumber()\n\n        if compat_line != line:\n            result.attrib[\"compat_line\"] = str(compat_line)\n\n        for key, value in iterItems(self.getDetailsForDisplay()):\n            result.set(key, str(value))\n\n        for name, children in self.getVisitableNodesNamed():\n            role = TreeXML.Element(\"role\", name=name)\n\n            result.append(role)\n\n            if children is None:\n                role.attrib[\"type\"] = \"none\"\n            elif type(children) not in (list, tuple):\n                role.append(children.asXml())\n            else:\n                role.attrib[\"type\"] = \"list\"\n\n                for child in children:\n                    role.append(child.asXml())\n\n        return result\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        # Only some things need a provider, pylint: disable=unused-argument\n        return cls(source_ref=source_ref, **args)\n\n    def asXmlText(self):\n        xml = self.asXml()\n\n        return TreeXML.toString(xml)\n\n    def dump(self, level=0):\n        Tracing.printIndented(level, self)\n        Tracing.printSeparator(level)\n\n        for visitable in self.getVisitableNodes():\n            visitable.dump(level + 1)\n\n        Tracing.printSeparator(level)\n\n    @staticmethod\n    def isStatementsSequence():\n        return False\n\n    @staticmethod\n    def isStatementsFrame():\n        return False\n\n    @staticmethod\n    def isCompiledPythonModule():\n        # For overload by module nodes\n        return False\n\n    def isExpressionBuiltin(self):\n        return self.kind.startswith(\"EXPRESSION_BUILTIN_\")\n\n    @staticmethod\n    def isStatementAssignmentVariable():\n        return False\n\n    @staticmethod\n    def isStatementDelVariable():\n        return False\n\n    @staticmethod\n    def isStatementReleaseVariable():\n        return False\n\n    @staticmethod\n    def isExpressionConstantRef():\n        return False\n\n    @staticmethod\n    def isExpressionConstantBoolRef():\n        return False\n\n    @staticmethod\n    def isExpressionOperationUnary():\n        return False\n\n    @staticmethod\n    def isExpressionOperationBinary():\n        return False\n\n    @staticmethod\n    def isExpressionOperationInplace():\n        return False\n\n    @staticmethod\n    def isExpressionComparison():\n        return False\n\n    @staticmethod\n    def isExpressionSideEffects():\n        return False\n\n    @staticmethod\n    def isExpressionMakeSequence():\n        return False\n\n    @staticmethod\n    def isExpressionVariableRefOrTempVariableRef():\n        return False\n\n    @staticmethod\n    def isNumberConstant():\n        return False\n\n    @staticmethod\n    def isExpressionCall():\n        return False\n\n    @staticmethod\n    def isExpressionFunctionBodyBase():\n        return False\n\n    @staticmethod\n    def isExpressionOutlineFunctionBase():\n        return False\n\n    @staticmethod\n    def isExpressionClassBodyBase():\n        return False\n\n    @staticmethod\n    def isExpressionFunctionCreation():\n        return False\n\n    def visit(self, context, visitor):\n        visitor(self)\n\n        for visitable in self.getVisitableNodes():\n            visitable.visit(context, visitor)\n\n    @staticmethod\n    def getVisitableNodes():\n        return ()\n\n    @staticmethod\n    def getVisitableNodesNamed():\n        \"\"\"Named children dictionary.\n\n        For use in debugging and XML output.\n        \"\"\"\n\n        return ()\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n    @staticmethod\n    def getName():\n        \"\"\"Name of the node if any.\"\"\"\n\n        return None\n\n    @staticmethod\n    def mayHaveSideEffects():\n        \"\"\"Unless we are told otherwise, everything may have a side effect.\"\"\"\n\n        return True\n\n    def isOrderRelevant(self):\n        return self.mayHaveSideEffects()\n\n    def extractSideEffects(self):\n        \"\"\"Unless defined otherwise, the expression is the side effect.\"\"\"\n\n        return (self,)\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        \"\"\"Unless we are told otherwise, everything may raise everything.\"\"\"\n        # Virtual method, pylint: disable=unused-argument\n\n        return True\n\n    @staticmethod\n    def mayReturn():\n        \"\"\"May this node do a return exit, to be overloaded for things that might.\"\"\"\n        return False\n\n    @staticmethod\n    def mayBreak():\n        return False\n\n    @staticmethod\n    def mayContinue():\n        return False\n\n    def needsFrame(self):\n        \"\"\"Unless we are told otherwise, this depends on exception raise.\"\"\"\n\n        return self.mayRaiseException(BaseException)\n\n    @staticmethod\n    def willRaiseAnyException():\n        return False\n\n    @staticmethod\n    def isStatementAborting():\n        \"\"\"Is the node aborting, control flow doesn't continue after this node.\"\"\"\n        return False\n\n\nclass CodeNodeMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self, name, code_prefix):\n        assert name is not None\n\n        self.name = name\n        self.code_prefix = code_prefix\n\n        # The code name is determined on demand only.\n        self.code_name = None\n\n        # The \"UID\" values of children kinds are kept here.\n        self.uids = {}\n\n    def getName(self):\n        return self.name\n\n    def getCodeName(self):\n        if self.code_name is None:\n            provider = self.getParentVariableProvider().getEntryPoint()\n            parent_name = provider.getCodeName()\n\n            uid = \"_%d\" % provider.getChildUID(self)\n\n            assert isinstance(self, CodeNodeMixin)\n\n            if self.name:\n                name = uid + \"_\" + self.name.strip(\"<>\")\n            else:\n                name = uid\n\n            if str is not bytes:\n                name = name.encode(\"ascii\", \"c_identifier\").decode()\n\n            self.code_name = \"%s$$$%s_%s\" % (parent_name, self.code_prefix, name)\n\n        return self.code_name\n\n    def getChildUID(self, node):\n        if node.kind not in self.uids:\n            self.uids[node.kind] = 0\n\n        self.uids[node.kind] += 1\n\n        return self.uids[node.kind]\n\n\nclass ClosureGiverNodeMixin(CodeNodeMixin):\n    \"\"\"Base class for nodes that provide variables for closure takers.\"\"\"\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self, name, code_prefix):\n        CodeNodeMixin.__init__(self, name=name, code_prefix=code_prefix)\n\n        self.temp_variables = {}\n\n        self.temp_scopes = {}\n\n        self.preserver_id = 0\n\n    def hasProvidedVariable(self, variable_name):\n        return self.locals_scope.hasProvidedVariable(variable_name)\n\n    def getProvidedVariable(self, variable_name):\n        if not self.locals_scope.hasProvidedVariable(variable_name):\n            variable = self.createProvidedVariable(variable_name=variable_name)\n            self.locals_scope.registerProvidedVariable(variable)\n\n        return self.locals_scope.getProvidedVariable(variable_name)\n\n    @abstractmethod\n    def createProvidedVariable(self, variable_name):\n        \"\"\"Create a variable provided by this function.\"\"\"\n\n    def allocateTempScope(self, name):\n        self.temp_scopes[name] = self.temp_scopes.get(name, 0) + 1\n\n        return \"%s_%d\" % (name, self.temp_scopes[name])\n\n    def allocateTempVariable(self, temp_scope, name, temp_type):\n        if temp_scope is not None:\n            full_name = \"%s__%s\" % (temp_scope, name)\n        else:\n            assert name != \"result\"\n\n            full_name = name\n\n        # No duplicates please.\n        assert full_name not in self.temp_variables, full_name\n\n        result = self.createTempVariable(temp_name=full_name, temp_type=temp_type)\n\n        # Late added temp variables should be treated with care for the\n        # remaining trace.\n        if self.trace_collection is not None:\n            self.trace_collection.initVariableUnknown(result).addUsage()\n\n        return result\n\n    def createTempVariable(self, temp_name, temp_type):\n        if temp_name in self.temp_variables:\n            return self.temp_variables[temp_name]\n\n        result = TempVariable(\n            owner=self,\n            variable_name=temp_name,\n            variable_type=temp_type,\n        )\n\n        self.temp_variables[temp_name] = result\n\n        return result\n\n    def getTempVariable(self, temp_scope, name):\n        if temp_scope is not None:\n            full_name = \"%s__%s\" % (temp_scope, name)\n        else:\n            full_name = name\n\n        return self.temp_variables[full_name]\n\n    def getTempVariables(self):\n        return self.temp_variables.values()\n\n    def _removeTempVariable(self, variable):\n        del self.temp_variables[variable.getName()]\n\n    def optimizeUnusedTempVariables(self):\n        remove = []\n\n        for temp_variable in self.getTempVariables():\n            empty = self.trace_collection.hasEmptyTraces(variable=temp_variable)\n\n            if empty:\n                remove.append(temp_variable)\n\n        for temp_variable in remove:\n            self._removeTempVariable(temp_variable)\n\n    def allocatePreserverId(self):\n        if python_version >= 0x300:\n            self.preserver_id += 1\n\n        return self.preserver_id\n\n\nclass ClosureTakerMixin(object):\n    \"\"\"Mixin for nodes that accept variables from closure givers.\"\"\"\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def __init__(self, provider):\n        self.provider = provider\n\n        self.taken = set()\n\n    def getParentVariableProvider(self):\n        return self.provider\n\n    def getClosureVariable(self, variable_name):\n        result = self.provider.getVariableForClosure(variable_name=variable_name)\n        assert result is not None, variable_name\n\n        if not result.isModuleVariable():\n            self.addClosureVariable(result)\n\n        return result\n\n    def addClosureVariable(self, variable):\n        self.taken.add(variable)\n\n        return variable\n\n    def getClosureVariables(self):\n        return tuple(\n            sorted(\n                [take for take in self.taken if not take.isModuleVariable()],\n                key=lambda x: x.getName(),\n            )\n        )\n\n    def getClosureVariableIndex(self, variable):\n        closure_variables = self.getClosureVariables()\n\n        for count, closure_variable in enumerate(closure_variables):\n            if variable is closure_variable:\n                return count\n\n        raise IndexError(variable)\n\n    def hasTakenVariable(self, variable_name):\n        for variable in self.taken:\n            if variable.getName() == variable_name:\n                return True\n\n        return False\n\n    def getTakenVariable(self, variable_name):\n        for variable in self.taken:\n            if variable.getName() == variable_name:\n                return variable\n\n        return None\n\n\nclass StatementBase(NodeBase):\n    \"\"\"Base class for all statement nodes.\"\"\"\n\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    # TODO: Have them all.\n    # @abstractmethod\n    @staticmethod\n    def getStatementNiceName():\n        return \"un-described statement\"\n\n    def computeStatementSubExpressions(self, trace_collection):\n        \"\"\"Compute a statement.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeStatement\". For a few cases this needs to\n        be overloaded.\n        \"\"\"\n        expressions = self.getVisitableNodes()\n\n        for count, expression in enumerate(expressions):\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = makeStatementOnlyNodesFromExpressions(\n                    expressions[: count + 1]\n                )\n\n                assert wrapped_expression is not None\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For %s the child expression '%s' will raise.\"\n                    % (self.getStatementNiceName(), expression.getChildNameNice()),\n                )\n\n        return self, None, None\n\n\nclass SideEffectsFromChildrenMixin(object):\n    # Mixins are not allowed to specify slots.\n    __slots__ = ()\n\n    def mayHaveSideEffects(self):\n        for child in self.getVisitableNodes():\n            if child.mayHaveSideEffects():\n                return True\n        return False\n\n    def extractSideEffects(self):\n        # No side effects at all but from the children.\n        result = []\n\n        for child in self.getVisitableNodes():\n            result.extend(child.extractSideEffects())\n\n        return tuple(result)\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        # Expression only statement plays no role, pylint: disable=unused-argument\n\n        side_effects = self.extractSideEffects()\n\n        # TODO: Have a method for nicer output and remove existing overloads\n        # by using classes and prefer generic implementation here.\n        if side_effects:\n            return (\n                makeStatementOnlyNodesFromExpressions(side_effects),\n                \"new_statements\",\n                \"Lowered unused expression %s to its side effects.\" % self.kind,\n            )\n        else:\n            return (\n                None,\n                \"new_statements\",\n                \"Removed %s without side effects.\" % self.kind,\n            )\n\n\ndef makeChild(provider, child, source_ref):\n    child_type = child.attrib.get(\"type\")\n\n    if child_type == \"list\":\n        return [\n            fromXML(provider=provider, xml=sub_child, source_ref=source_ref)\n            for sub_child in child\n        ]\n    elif child_type == \"none\":\n        return None\n    else:\n        return fromXML(provider=provider, xml=child[0], source_ref=source_ref)\n\n\ndef getNodeClassFromKind(kind):\n    return NodeCheckMetaClass.kinds[kind]\n\n\ndef extractKindAndArgsFromXML(xml, source_ref):\n    kind = xml.attrib[\"kind\"]\n\n    args = dict(xml.attrib)\n    del args[\"kind\"]\n\n    if source_ref is None:\n        source_ref = SourceCodeReference.fromFilenameAndLine(\n            args[\"filename\"], int(args[\"line\"])\n        )\n\n        del args[\"filename\"]\n        del args[\"line\"]\n\n    else:\n        source_ref = source_ref.atLineNumber(int(args[\"line\"]))\n        del args[\"line\"]\n\n    node_class = getNodeClassFromKind(kind)\n\n    return kind, node_class, args, source_ref\n\n\ndef fromXML(provider, xml, source_ref=None):\n    assert xml.tag == \"node\", xml\n\n    kind, node_class, args, source_ref = extractKindAndArgsFromXML(xml, source_ref)\n\n    if \"constant\" in args:\n        args[\"constant\"] = ast.literal_eval(args[\"constant\"])\n\n    if kind in (\n        \"ExpressionFunctionBody\",\n        \"PythonMainModule\",\n        \"PythonCompiledModule\",\n        \"PythonCompiledPackage\",\n        \"PythonInternalModule\",\n    ):\n        delayed = node_class.named_children\n\n        if \"code_flags\" in args:\n            args[\"future_spec\"] = fromFlags(args[\"code_flags\"])\n    else:\n        delayed = ()\n\n    for child in xml:\n        assert child.tag == \"role\", child.tag\n\n        child_name = child.attrib[\"name\"]\n\n        # Might want to want until provider is updated with some\n        # children. In these cases, we pass the XML node, rather\n        # than a Nuitka node.\n        if child_name not in delayed:\n            args[child_name] = makeChild(provider, child, source_ref)\n        else:\n            args[child_name] = child\n\n    try:\n        return node_class.fromXML(provider=provider, source_ref=source_ref, **args)\n    except (TypeError, AttributeError):\n        Tracing.printLine(node_class, args, source_ref)\n        raise\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/NodeMakingHelpers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" These are just helpers to create nodes, often to replace existing nodes\n\nThese are for use in optimizations and computations, and therefore cover\nmostly exceptions and constants.\n\nOften cyclic dependencies kicks in, which is why this module is mostly only\nimported locally. Note: It's intended to be reversed, this module will make\nthe local imports instead, as these local imports look ugly everywhere else,\nmaking it more difficult to use.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.__past__ import GenericAlias, UnionType\nfrom nuitka.Builtins import builtin_names\nfrom nuitka.Constants import isConstant\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import my_print, unusual_logger\n\n\ndef makeConstantReplacementNode(constant, node, user_provided):\n    from .ConstantRefNodes import makeConstantRefNode\n\n    return makeConstantRefNode(\n        constant=constant, source_ref=node.source_ref, user_provided=user_provided\n    )\n\n\ndef makeRaiseExceptionReplacementExpression(\n    expression, exception_type, exception_value, no_warning=False\n):\n    from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n    from .ExceptionNodes import ExpressionRaiseException\n\n    source_ref = expression.source_ref\n\n    assert type(exception_type) is str\n\n    if not no_warning and Options.shallWarnImplicitRaises():\n        unusual_logger.warning(\n            '%s: Will always raise exception: \"%s(%s)\"'\n            % (\n                source_ref.getAsString(),\n                exception_type,\n                exception_value,\n            )\n        )\n\n    result = ExpressionRaiseException(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=exception_type, source_ref=source_ref\n        ),\n        exception_value=makeConstantReplacementNode(\n            constant=exception_value, node=expression, user_provided=False\n        ),\n        source_ref=source_ref,\n    )\n\n    return result\n\n\ndef makeRaiseExceptionReplacementStatement(statement, exception_type, exception_value):\n    from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n    from .ExceptionNodes import StatementRaiseExceptionImplicit\n\n    source_ref = statement.getSourceReference()\n\n    assert type(exception_type) is str\n\n    if Options.shallWarnImplicitRaises():\n        unusual_logger.warning(\n            '%s: Will always raise exception: \"%s(%s)\"'\n            % (\n                source_ref.getAsString(),\n                exception_type,\n                exception_value,\n            )\n        )\n\n    result = StatementRaiseExceptionImplicit(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=exception_type, source_ref=source_ref\n        ),\n        exception_value=makeConstantReplacementNode(\n            constant=exception_value, node=statement, user_provided=False\n        ),\n        exception_cause=None,\n        exception_trace=None,\n        source_ref=source_ref,\n    )\n\n    return result\n\n\ndef makeRaiseExceptionReplacementExpressionFromInstance(expression, exception):\n    assert isinstance(exception, Exception)\n\n    args = exception.args\n    if type(args) is tuple and len(args) == 1:\n        value = args[0]\n    else:\n        assert type(args) is tuple\n        value = args\n\n    return makeRaiseExceptionReplacementExpression(\n        expression=expression,\n        exception_type=exception.__class__.__name__,\n        exception_value=value,\n    )\n\n\ndef makeRaiseExceptionStatementFromInstance(exception, source_ref):\n    assert isinstance(exception, Exception)\n\n    args = exception.args\n    if type(args) is tuple and len(args) == 1:\n        value = args[0]\n    else:\n        assert type(args) is tuple\n        value = args\n\n    from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n    from .ConstantRefNodes import makeConstantRefNode\n    from .ExceptionNodes import StatementRaiseExceptionImplicit\n\n    return StatementRaiseExceptionImplicit(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=exception.__class__.__name__, source_ref=source_ref\n        ),\n        exception_value=makeConstantRefNode(\n            constant=value, source_ref=source_ref, user_provided=False\n        ),\n        exception_cause=None,\n        exception_trace=None,\n        source_ref=source_ref,\n    )\n\n\ndef makeRaiseExceptionExpressionFromTemplate(\n    exception_type, template, template_args, source_ref\n):\n    from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n    from .ConstantRefNodes import makeConstantRefNode\n    from .ContainerMakingNodes import makeExpressionMakeTupleOrConstant\n    from .ExceptionNodes import ExpressionRaiseException\n    from .OperatorNodes import makeBinaryOperationNode\n\n    if type(template_args) is tuple:\n        template_args = makeExpressionMakeTupleOrConstant(\n            elements=template_args, user_provided=False, source_ref=source_ref\n        )\n\n    return ExpressionRaiseException(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=exception_type, source_ref=source_ref\n        ),\n        exception_value=makeBinaryOperationNode(\n            operator=\"Mod\",\n            left=makeConstantRefNode(\n                constant=template, source_ref=source_ref, user_provided=True\n            ),\n            right=template_args,\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n    template, operation, original_node, value_node\n):\n    shape = value_node.getTypeShape()\n\n    type_name = shape.getTypeName()\n\n    if type_name is not None:\n        result = makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=original_node,\n            exception=TypeError(template % type_name if \"%\" in template else template),\n        )\n\n        result = wrapExpressionWithNodeSideEffects(new_node=result, old_node=value_node)\n    else:\n        from .AttributeNodes import makeExpressionAttributeLookup\n        from .TypeNodes import ExpressionBuiltinType1\n\n        source_ref = original_node.getSourceReference()\n\n        result = makeRaiseExceptionExpressionFromTemplate(\n            exception_type=\"TypeError\",\n            template=template,\n            template_args=makeExpressionAttributeLookup(\n                expression=ExpressionBuiltinType1(\n                    value=value_node.makeClone(), source_ref=source_ref\n                ),\n                attribute_name=\"__name__\",\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        type_name = shape.__name__\n\n    return (\n        result,\n        \"new_raise\",\n        \"Raising for use of '%s' on %s '%s'.\"\n        % (operation, \"type\" if type_name is not None else \"shape\", type_name),\n    )\n\n\ndef makeCompileTimeConstantReplacementNode(value, node, user_provided):\n    # This needs to match code in isCompileTimeConstantValue\n    if isConstant(value):\n        return makeConstantReplacementNode(\n            constant=value, node=node, user_provided=user_provided\n        )\n    elif type(value) is type:\n        if value.__name__ in builtin_names:\n            from .BuiltinRefNodes import makeExpressionBuiltinRef\n\n            # Need not provide locals_scope, not used for these kinds of built-in refs that\n            # refer to types.\n            return makeExpressionBuiltinRef(\n                builtin_name=value.__name__,\n                locals_scope=None,\n                source_ref=node.getSourceReference(),\n            )\n        else:\n            return node\n    elif GenericAlias is not None and isinstance(value, GenericAlias):\n        from .BuiltinTypeNodes import ExpressionConstantGenericAlias\n\n        return ExpressionConstantGenericAlias(\n            generic_alias=value,\n            source_ref=node.getSourceReference(),\n        )\n    elif UnionType is not None and isinstance(value, UnionType):\n        from .BuiltinTypeNodes import ExpressionConstantUnionType\n\n        return ExpressionConstantUnionType(\n            union_type=value,\n            source_ref=node.getSourceReference(),\n        )\n    else:\n        return node\n\n\ndef getComputationResult(node, computation, description, user_provided):\n    \"\"\"With a computation function, execute it and return constant result or\n    exception node.\n\n    \"\"\"\n\n    # Try and turn raised exceptions into static raises. pylint: disable=broad-except\n    try:\n        result = computation()\n    except Exception as e:\n        new_node = makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node, exception=e\n        )\n\n        change_tags = \"new_raise\"\n        change_desc = description + \" Predicted to raise an exception.\"\n    else:\n        new_node = makeCompileTimeConstantReplacementNode(\n            value=result, node=node, user_provided=user_provided\n        )\n\n        if Options.is_debug:\n            assert new_node is not node, (node, result)\n\n        if new_node is not node:\n            change_tags = \"new_constant\"\n            change_desc = description + \" Predicted constant result.\"\n        else:\n            change_tags = None\n            change_desc = None\n\n    return new_node, change_tags, change_desc\n\n\ndef makeStatementExpressionOnlyReplacementNode(expression, node):\n    from .StatementNodes import StatementExpressionOnly\n\n    return StatementExpressionOnly(\n        expression=expression, source_ref=node.getSourceReference()\n    )\n\n\ndef mergeStatements(statements, allow_none=False):\n    \"\"\"Helper function that merges nested statement sequences.\"\"\"\n    merged_statements = []\n\n    for statement in statements:\n        if statement is None and allow_none:\n            pass\n        elif type(statement) in (tuple, list):\n            merged_statements += mergeStatements(statement, allow_none)\n        elif statement.isStatementsFrame():\n            merged_statements.append(statement)\n        elif statement.isStatementsSequence():\n            merged_statements.extend(mergeStatements(statement.subnode_statements))\n        else:\n            merged_statements.append(statement)\n\n    return tuple(merged_statements)\n\n\ndef makeStatementsSequenceReplacementNode(statements, node):\n    from .StatementNodes import StatementsSequence\n\n    return StatementsSequence(\n        statements=mergeStatements(statements), source_ref=node.getSourceReference()\n    )\n\n\ndef wrapExpressionWithSideEffects(side_effects, old_node, new_node):\n    from .SideEffectNodes import ExpressionSideEffects\n\n    if side_effects:\n        try:\n            side_effects = sum(\n                (\n                    side_effect.extractSideEffects()\n                    for side_effect in side_effects\n                    if side_effect.mayHaveSideEffects()\n                ),\n                (),\n            )\n        except AttributeError:\n            my_print(\"Problem with side effects:\", side_effects)\n            raise\n\n        if side_effects:\n            new_node = ExpressionSideEffects(\n                expression=new_node,\n                side_effects=side_effects,\n                source_ref=old_node.getSourceReference(),\n            )\n\n    return new_node\n\n\ndef wrapExpressionWithNodeSideEffects(new_node, old_node):\n    return wrapExpressionWithSideEffects(\n        side_effects=old_node.extractSideEffects(), old_node=old_node, new_node=new_node\n    )\n\n\ndef wrapStatementWithSideEffects(new_node, old_node, allow_none=False):\n    assert new_node is not None or allow_none\n\n    side_effects = old_node.extractSideEffects()\n\n    if side_effects:\n        from .StatementNodes import StatementExpressionOnly\n\n        side_effects = tuple(\n            StatementExpressionOnly(\n                expression=side_effect, source_ref=side_effect.getSourceReference()\n            )\n            for side_effect in side_effects\n        )\n\n        if new_node is not None:\n            new_node = makeStatementsSequenceReplacementNode(\n                statements=side_effects + (new_node,), node=old_node\n            )\n        else:\n            new_node = makeStatementsSequenceReplacementNode(\n                statements=side_effects, node=old_node\n            )\n\n    return new_node\n\n\ndef makeStatementOnlyNodesFromExpressions(expressions):\n    from .StatementNodes import StatementExpressionOnly, StatementsSequence\n\n    statements = tuple(\n        StatementExpressionOnly(\n            expression=expression, source_ref=expression.getSourceReference()\n        )\n        for expression in expressions\n    )\n\n    if not statements:\n        return None\n    elif len(statements) == 1:\n        return statements[0]\n    else:\n        return StatementsSequence(\n            statements=statements, source_ref=statements[0].getSourceReference()\n        )\n\n\ndef makeVariableRefNode(variable, source_ref):\n    if variable.isTempVariable():\n        from .VariableRefNodes import ExpressionTempVariableRef\n\n        return ExpressionTempVariableRef(variable=variable, source_ref=source_ref)\n    else:\n        from .VariableRefNodes import ExpressionVariableRef\n\n        return ExpressionVariableRef(variable=variable, source_ref=source_ref)\n\n\ndef makeExpressionBuiltinLocals(locals_scope, source_ref):\n    if locals_scope.isModuleScope():\n        from .GlobalsLocalsNodes import ExpressionBuiltinGlobals\n\n        return ExpressionBuiltinGlobals(source_ref=source_ref)\n    else:\n        from .GlobalsLocalsNodes import (\n            ExpressionBuiltinLocalsCopy,\n            ExpressionBuiltinLocalsRef,\n            ExpressionBuiltinLocalsUpdated,\n        )\n\n        if locals_scope.isClassScope():\n            return ExpressionBuiltinLocalsRef(\n                locals_scope=locals_scope, source_ref=source_ref\n            )\n        elif python_version >= 0x300 or locals_scope.isUnoptimizedFunctionScope():\n            assert locals_scope.isFunctionScope(), locals_scope\n\n            return ExpressionBuiltinLocalsUpdated(\n                locals_scope=locals_scope, source_ref=source_ref\n            )\n        else:\n            return ExpressionBuiltinLocalsCopy(\n                locals_scope=locals_scope, source_ref=source_ref\n            )\n\n\ndef makeRaiseImportErrorReplacementExpression(expression, module_name):\n    return makeRaiseExceptionReplacementExpression(\n        expression=expression,\n        exception_type=\"ImportError\",\n        exception_value=module_name.asString(),\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/NodeMetaClasses.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node meta classes.\n\nThis provides meta classes for nodes, currently only one. These do all kinds\nof checks, and add methods automatically.\n\n\"\"\"\n\nfrom abc import ABCMeta\n\nfrom nuitka.__past__ import intern\nfrom nuitka.Errors import NuitkaAssumptionError, NuitkaNodeDesignError\nfrom nuitka.PythonVersions import python_version\n\n\ndef _checkBases(name, bases):\n    # Avoid duplicate base classes.\n    assert len(bases) == len(set(bases)), (name, bases)\n\n    # Insist on mixins being in proper place for inheritance.\n    last_mixin = None\n    for base in bases:\n        base_name = base.__name__\n        is_mixin = base_name.endswith(\"Mixin\")\n\n        if is_mixin and last_mixin is False:\n            raise NuitkaNodeDesignError(\n                name, \"Mixins must come first in base classes.\", bases\n            )\n\n        last_mixin = is_mixin\n\n        if base is not object and \"__slots__\" not in base.__dict__:\n            raise NuitkaNodeDesignError(name, \"All bases must set __slots__.\", base)\n\n\nclass NodeCheckMetaClass(ABCMeta):\n    kinds = {}\n\n    def __new__(mcs, name, bases, dictionary):  # pylint: disable=I0021,arguments-differ\n        _checkBases(name, bases)\n\n        if \"__slots__\" not in dictionary:\n            dictionary[\"__slots__\"] = ()\n\n        if \"named_children\" in dictionary:\n            assert type(dictionary[\"named_children\"]) is tuple\n\n            dictionary[\"__slots__\"] += tuple(\n                intern(\"subnode_\" + named_child.split(\"|\", 1)[0])\n                for named_child in dictionary[\"named_children\"]\n            )\n\n        if \"nice_children\" in dictionary:\n            assert type(dictionary[\"nice_children\"]) is tuple\n            assert len(dictionary[\"nice_children\"]) == len(dictionary[\"named_children\"])\n\n            dictionary[\"nice_children_dict\"] = dict(\n                (intern(named_child.split(\"|\", 1)[0]), nice_name)\n                for (named_child, nice_name) in zip(\n                    dictionary[\"named_children\"], dictionary[\"nice_children\"]\n                )\n            )\n\n        if \"node_attributes\" in dictionary:\n            dictionary[\"__slots__\"] += dictionary[\"node_attributes\"]\n\n        assert len(dictionary[\"__slots__\"]) == len(\n            set(dictionary[\"__slots__\"])\n        ), dictionary[\"__slots__\"]\n\n        if \"python_version_spec\" in dictionary:\n            condition = \"%s %s\" % (\n                hex(python_version),\n                dictionary[\"python_version_spec\"],\n            )\n\n            # We trust our node class files, pylint: disable=eval-used\n            if not eval(condition):\n\n                def __init__(self, *args, **kwargs):\n                    raise NuitkaAssumptionError(name, \"assumption violated\", condition)\n\n                dictionary[\"__init__\"] = __init__\n\n        # Not a method:\n        if \"checker\" in dictionary:\n            dictionary[\"checker\"] = staticmethod(dictionary[\"checker\"])\n\n        return ABCMeta.__new__(mcs, name, bases, dictionary)\n\n    def __init__(cls, name, bases, dictionary):\n        if not name.endswith((\"Base\", \"Mixin\")):\n            if \"kind\" not in dictionary:\n                raise NuitkaNodeDesignError(name, \"Must provide class variable 'kind'\")\n\n            kind = dictionary[\"kind\"]\n\n            assert type(kind) is str, name\n\n            if kind in NodeCheckMetaClass.kinds and \"replaces\" not in dictionary:\n                raise NuitkaNodeDesignError(\n                    name, \"Duplicate nodes for kind '%s'\" % kind\n                )\n\n            NodeCheckMetaClass.kinds[kind] = cls\n            NodeCheckMetaClass.kinds[name] = cls\n\n            kind_to_name_part = \"\".join([x.capitalize() for x in kind.split(\"_\")])\n            assert name.endswith(kind_to_name_part), (name, kind_to_name_part)\n\n            # Automatically add checker methods for everything to the common\n            # base class\n            checker_method = \"is\" + kind_to_name_part\n\n            # TODO: How about making these two functions, one to statically\n            # return True and False, and put one in the base class, and one\n            # in the new class, would be slightly faster.\n            def checkKind(self):\n                return self.kind == kind\n\n            # Add automatic checker methods to the node base class.\n            from .NodeBases import NodeBase\n\n            if not hasattr(NodeBase, checker_method):\n                setattr(NodeBase, checker_method, checkKind)\n\n        ABCMeta.__init__(cls, name, bases, dictionary)\n\n\n# For every node type, there is a test, and then some more members,\n\n# For Python2/3 compatible source, we create a base class that has the metaclass\n# used and doesn't require making a syntax choice.\nNodeMetaClassBase = NodeCheckMetaClass(\n    \"NodeMetaClassBase\", (object,), {\"__slots__\": ()}\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/OperatorNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for unary and binary operations.\n\nNo short-circuit involved, boolean 'not' is an unary operation like '-' is,\nno real difference.\n\"\"\"\n\nimport copy\nimport math\nfrom abc import abstractmethod\n\nfrom nuitka import PythonOperators\nfrom nuitka.Errors import NuitkaAssumptionError\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildrenHavingLeftRightMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionReplacementExpressionFromInstance,\n    wrapExpressionWithSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_bool, tshape_int_or_long\nfrom .shapes.StandardShapes import (\n    ShapeLargeConstantValue,\n    ShapeLargeConstantValuePredictable,\n    tshape_unknown,\n    vshape_unknown,\n)\n\n\nclass ExpressionPropertiesFromTypeShapeMixin(object):\n    \"\"\"Given a self.type_shape, this can derive default properties from there.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    def isKnownToBeHashable(self):\n        return self.type_shape.hasShapeSlotHash()\n\n\nclass ExpressionOperationBinaryBase(\n    ExpressionPropertiesFromTypeShapeMixin, ChildrenHavingLeftRightMixin, ExpressionBase\n):\n    \"\"\"Base class for all binary operation expression.\"\"\"\n\n    __slots__ = (\"type_shape\", \"escape_desc\", \"inplace_suspect\", \"shape\")\n\n    named_children = (\"left\", \"right\")\n    nice_children = tuple(child_name + \" operand\" for child_name in named_children)\n\n    def __init__(self, left, right, source_ref):\n        ChildrenHavingLeftRightMixin.__init__(self, left=left, right=right)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        # Question might be asked early on, later this is cached from last computation.\n        self.type_shape = tshape_unknown\n\n        self.escape_desc = None\n\n        self.inplace_suspect = False\n\n        self.shape = vshape_unknown\n\n    @staticmethod\n    def isExpressionOperationBinary():\n        return True\n\n    def getOperator(self):\n        return self.operator\n\n    def markAsInplaceSuspect(self):\n        self.inplace_suspect = True\n\n    def removeMarkAsInplaceSuspect(self):\n        self.inplace_suspect = False\n\n    def isInplaceSuspect(self):\n        return self.inplace_suspect\n\n    def getOperands(self):\n        return (self.subnode_left, self.subnode_right)\n\n    def mayRaiseExceptionOperation(self):\n        return self.escape_desc.getExceptionExit() is not None\n\n    def mayRaiseException(self, exception_type):\n        # TODO: Match getExceptionExit() more precisely against exception type given\n        return (\n            self.escape_desc is None\n            or self.escape_desc.getExceptionExit() is not None\n            or self.subnode_left.mayRaiseException(exception_type)\n            or self.subnode_right.mayRaiseException(exception_type)\n        )\n\n    def getTypeShape(self):\n        return self.type_shape\n\n    @abstractmethod\n    def _getOperationShape(self, left_shape, right_shape):\n        pass\n\n    @staticmethod\n    def canCreateUnsupportedException(left_shape, right_shape):\n        return hasattr(left_shape, \"typical_value\") and hasattr(\n            right_shape, \"typical_value\"\n        )\n\n    def createUnsupportedException(self, left_shape, right_shape):\n        left = left_shape.typical_value\n        right = right_shape.typical_value\n\n        try:\n            self.simulator(left, right)\n        except TypeError as e:\n            return e\n        except Exception as e:\n            raise NuitkaAssumptionError(\n                \"Unexpected exception type doing operation simulation\",\n                self.operator,\n                self.simulator,\n                left_shape,\n                right_shape,\n                repr(left),\n                repr(right),\n                e,\n                \"!=\",\n            )\n        else:\n            raise NuitkaAssumptionError(\n                \"Unexpected no-exception doing operation simulation\",\n                self.operator,\n                self.simulator,\n                left_shape,\n                right_shape,\n                repr(left),\n                repr(right),\n            )\n\n    @staticmethod\n    def _isTooLarge():\n        return False\n\n    def _simulateOperation(self, trace_collection):\n        left_value = self.subnode_left.getCompileTimeConstant()\n        right_value = self.subnode_right.getCompileTimeConstant()\n\n        # Avoid mutating owned by nodes values and potentially shared.\n        if self.subnode_left.isMutable():\n            left_value = copy.copy(left_value)\n\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: self.simulator(left_value, right_value),\n            description=\"Operator '%s' with constant arguments.\" % self.operator,\n        )\n\n    def computeExpression(self, trace_collection):\n        # Nothing to do anymore for large constants.\n        if self.shape is not None and self.shape.isConstant():\n            return self, None, None\n\n        left = self.subnode_left\n        left_shape = left.getTypeShape()\n        right = self.subnode_right\n        right_shape = right.getTypeShape()\n\n        self.type_shape, self.escape_desc = self._getOperationShape(\n            left_shape, right_shape\n        )\n\n        if left.isCompileTimeConstant() and right.isCompileTimeConstant():\n            if not self._isTooLarge():\n                return self._simulateOperation(trace_collection)\n\n        exception_raise_exit = self.escape_desc.getExceptionExit()\n        if exception_raise_exit is not None:\n            trace_collection.onExceptionRaiseExit(exception_raise_exit)\n\n            if self.escape_desc.isUnsupported() and self.canCreateUnsupportedException(\n                left_shape, right_shape\n            ):\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeRaiseExceptionReplacementExpressionFromInstance(\n                        expression=self,\n                        exception=self.createUnsupportedException(\n                            left_shape,\n                            right_shape,\n                        ),\n                    ),\n                    old_node=self,\n                    side_effects=(left, right),\n                )\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"Replaced operator '%s' with %s %s arguments that cannot work.\"\n                    % (self.operator, left_shape, right_shape),\n                )\n\n        if self.escape_desc.isValueEscaping():\n            # The value of these nodes escaped and could change its contents.\n            trace_collection.removeKnowledge(left)\n            trace_collection.removeKnowledge(right)\n\n        if self.escape_desc.isControlFlowEscape():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        return self, None, None\n\n    @staticmethod\n    def canPredictIterationValues():\n        # TODO: Actually we could very well, esp. for sequence repeats.\n        return False\n\n\nclass ExpressionOperationAddMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def getValueShape(self):\n        return self.shape\n\n    def _isTooLarge(self):\n        if self.subnode_left.isKnownToBeIterable(\n            None\n        ) and self.subnode_right.isKnownToBeIterable(None):\n            size = (\n                self.subnode_left.getIterationLength()\n                + self.subnode_right.getIterationLength()\n            )\n\n            # TODO: Actually could make a predictor, but we don't use it yet.\n            self.shape = ShapeLargeConstantValuePredictable(\n                size=size,\n                predictor=None,  # predictValuesFromRightAndLeftValue,\n                shape=self.subnode_left.getTypeShape(),\n            )\n\n            return size > 256\n        else:\n            return False\n\n\nclass ExpressionOperationBinaryAdd(\n    ExpressionOperationAddMixin, ExpressionOperationBinaryBase\n):\n    kind = \"EXPRESSION_OPERATION_BINARY_ADD\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionOperationBinaryBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    operator = \"Add\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryAddShape(right_shape)\n\n\nclass ExpressionOperationBinarySub(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_SUB\"\n\n    operator = \"Sub\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinarySubShape(right_shape)\n\n\nclass ExpressionOperationMultMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def getValueShape(self):\n        return self.shape\n\n    def _isTooLarge(self):\n        if self.subnode_right.isNumberConstant():\n            iter_length = self.subnode_left.getIterationLength()\n\n            if iter_length is not None:\n                size = iter_length * self.subnode_right.getCompileTimeConstant()\n                if size > 256:\n                    self.shape = ShapeLargeConstantValuePredictable(\n                        size=size,\n                        predictor=None,  # predictValuesFromRightAndLeftValue,\n                        shape=self.subnode_left.getTypeShape(),\n                    )\n\n                    return True\n\n            if self.subnode_left.isNumberConstant():\n                if (\n                    self.subnode_left.isIndexConstant()\n                    and self.subnode_right.isIndexConstant()\n                ):\n                    # Estimate with logarithm, if the result of number\n                    # calculations is computable with acceptable effort,\n                    # otherwise, we will have to do it at runtime.\n                    left_value = self.subnode_left.getCompileTimeConstant()\n\n                    if left_value != 0:\n                        right_value = self.subnode_right.getCompileTimeConstant()\n\n                        # TODO: Is this really useful, can this be really slow.\n                        if right_value != 0:\n                            if (\n                                math.log10(abs(left_value))\n                                + math.log10(abs(right_value))\n                                > 20\n                            ):\n                                self.shape = ShapeLargeConstantValue(\n                                    size=None, shape=tshape_int_or_long\n                                )\n\n                                return True\n\n        elif self.subnode_left.isNumberConstant():\n            iter_length = self.subnode_right.getIterationLength()\n\n            if iter_length is not None:\n                left_value = self.subnode_left.getCompileTimeConstant()\n\n                size = iter_length * left_value\n                if iter_length * left_value > 256:\n                    self.shape = ShapeLargeConstantValuePredictable(\n                        size=size,\n                        predictor=None,  # predictValuesFromRightAndLeftValue,\n                        shape=self.subnode_right.getTypeShape(),\n                    )\n\n                    return True\n\n        return False\n\n\nclass ExpressionOperationBinaryMult(\n    ExpressionOperationMultMixin, ExpressionOperationBinaryBase\n):\n    kind = \"EXPRESSION_OPERATION_BINARY_MULT\"\n\n    operator = \"Mult\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    def __init__(self, left, right, source_ref):\n        ExpressionOperationBinaryBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryMultShape(right_shape)\n\n    def getIterationLength(self):\n        left_length = self.subnode_left.getIterationLength()\n\n        if left_length is not None:\n            right_value = self.subnode_right.getIntegerValue()\n\n            if right_value is not None:\n                return left_length * right_value\n\n        right_length = self.subnode_right.getIterationLength()\n\n        if right_length is not None:\n            left_value = self.subnode_left.getIntegerValue()\n\n            if left_value is not None:\n                return right_length * left_value\n\n        return ExpressionOperationBinaryBase.getIterationLength(self)\n\n    def extractSideEffects(self):\n        left_length = self.subnode_left.getIterationLength()\n\n        if left_length is not None:\n            right_value = self.subnode_right.getIntegerValue()\n\n            if right_value is not None:\n                return (\n                    self.subnode_left.extractSideEffects()\n                    + self.subnode_right.extractSideEffects()\n                )\n\n        right_length = self.subnode_right.getIterationLength()\n\n        if right_length is not None:\n            left_value = self.subnode_left.getIntegerValue()\n\n            if left_value is not None:\n                return (\n                    self.subnode_left.extractSideEffects()\n                    + self.subnode_right.extractSideEffects()\n                )\n\n        return ExpressionOperationBinaryBase.extractSideEffects(self)\n\n\nclass ExpressionOperationBinaryFloorDiv(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_FLOOR_DIV\"\n\n    operator = \"FloorDiv\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryFloorDivShape(right_shape)\n\n\nif python_version < 0x300:\n\n    class ExpressionOperationBinaryOldDiv(ExpressionOperationBinaryBase):\n        kind = \"EXPRESSION_OPERATION_BINARY_OLD_DIV\"\n\n        operator = \"OldDiv\"\n        simulator = PythonOperators.binary_operator_functions[operator]\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationBinaryOldDivShape(right_shape)\n\n\nclass ExpressionOperationBinaryTrueDiv(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_TRUE_DIV\"\n\n    operator = \"TrueDiv\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryTrueDivShape(right_shape)\n\n\nclass ExpressionOperationBinaryMod(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_MOD\"\n\n    operator = \"Mod\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryModShape(right_shape)\n\n\nclass ExpressionOperationBinaryDivmod(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_DIVMOD\"\n\n    operator = \"Divmod\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    def __init__(self, left, right, source_ref):\n        ExpressionOperationBinaryBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryDivmodShape(right_shape)\n\n\nclass ExpressionOperationPowMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def getValueShape(self):\n        return self.shape\n\n    def _isTooLarge(self):\n        if self.subnode_right.isIndexConstant():\n            # Estimate with logarithm, if the result of number\n            # calculations is computable with acceptable effort,\n            # otherwise, we will have to do it at runtime.\n            left_value = abs(self.subnode_left.getCompileTimeConstant())\n\n            if left_value in (0, 1):\n                return False\n\n            if self.subnode_left.isIndexConstant():\n                right_value = self.subnode_right.getCompileTimeConstant()\n\n                # Negative values, and 0, 1 powers are not a problem.\n                if right_value <= 1:\n                    return False\n\n                # More than a typical pow, most likely a stupid test.\n                if math.log10(left_value) * right_value > 20:\n                    self.shape = ShapeLargeConstantValue(\n                        size=None, shape=tshape_int_or_long\n                    )\n\n                    return True\n\n        return False\n\n\nclass ExpressionOperationBinaryPow(\n    ExpressionOperationPowMixin, ExpressionOperationBinaryBase\n):\n    kind = \"EXPRESSION_OPERATION_BINARY_POW\"\n\n    operator = \"Pow\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryPowShape(right_shape)\n\n\nclass ExpressionOperationLshiftMixin(object):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    def getValueShape(self):\n        return self.shape\n\n    def _isTooLarge(self):\n        if self.subnode_right.isNumberConstant():\n            if self.subnode_left.isNumberConstant():\n                # Estimate with logarithm, if the result of number\n                # calculations is computable with acceptable effort,\n                # otherwise, we will have to do it at runtime.\n                left_value = self.subnode_left.getCompileTimeConstant()\n\n                if left_value != 0:\n                    right_value = self.subnode_right.getCompileTimeConstant()\n\n                    # More than a typical shift, most likely a stupid test.\n                    if right_value > 64:\n                        self.shape = ShapeLargeConstantValue(\n                            size=None, shape=tshape_int_or_long\n                        )\n\n                        return True\n\n        return False\n\n\nclass ExpressionOperationBinaryLshift(\n    ExpressionOperationLshiftMixin, ExpressionOperationBinaryBase\n):\n    kind = \"EXPRESSION_OPERATION_BINARY_LSHIFT\"\n\n    operator = \"LShift\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryLShiftShape(right_shape)\n\n\nclass ExpressionOperationBinaryRshift(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_RSHIFT\"\n\n    operator = \"RShift\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryRShiftShape(right_shape)\n\n\nclass ExpressionOperationBinaryBitOr(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_BIT_OR\"\n\n    operator = \"BitOr\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryBitOrShape(right_shape)\n\n\nclass ExpressionOperationBinaryBitAnd(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_BIT_AND\"\n\n    operator = \"BitAnd\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryBitAndShape(right_shape)\n\n\nclass ExpressionOperationBinaryBitXor(ExpressionOperationBinaryBase):\n    kind = \"EXPRESSION_OPERATION_BINARY_BIT_XOR\"\n\n    operator = \"BitXor\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryBitXorShape(right_shape)\n\n\nif python_version >= 0x350:\n\n    class ExpressionOperationBinaryMatMult(ExpressionOperationBinaryBase):\n        kind = \"EXPRESSION_OPERATION_BINARY_MAT_MULT\"\n\n        operator = \"MatMult\"\n        simulator = PythonOperators.binary_operator_functions[operator]\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationBinaryMatMultShape(right_shape)\n\n\n_operator2binary_operation_node_class = {\n    \"Add\": ExpressionOperationBinaryAdd,\n    \"Sub\": ExpressionOperationBinarySub,\n    \"Mult\": ExpressionOperationBinaryMult,\n    \"FloorDiv\": ExpressionOperationBinaryFloorDiv,\n    \"TrueDiv\": ExpressionOperationBinaryTrueDiv,\n    \"Mod\": ExpressionOperationBinaryMod,\n    # Divmod only from built-in call.\n    \"Pow\": ExpressionOperationBinaryPow,\n    \"LShift\": ExpressionOperationBinaryLshift,\n    \"RShift\": ExpressionOperationBinaryRshift,\n    \"BitOr\": ExpressionOperationBinaryBitOr,\n    \"BitAnd\": ExpressionOperationBinaryBitAnd,\n    \"BitXor\": ExpressionOperationBinaryBitXor,\n}\n\nif python_version < 0x300:\n    _operator2binary_operation_node_class[\"OldDiv\"] = ExpressionOperationBinaryOldDiv\n\nif python_version >= 0x350:\n    _operator2binary_operation_node_class[\"MatMult\"] = ExpressionOperationBinaryMatMult\n\n\ndef makeBinaryOperationNode(operator, left, right, source_ref):\n    node_class = _operator2binary_operation_node_class[operator]\n\n    return node_class(left=left, right=right, source_ref=source_ref)\n\n\nclass ExpressionOperationBinaryInplaceBase(ExpressionOperationBinaryBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n    \"\"\"Base class for all inplace operations.\"\"\"\n\n    def __init__(self, left, right, source_ref):\n        ExpressionOperationBinaryBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n        self.inplace_suspect = True\n\n    @staticmethod\n    def isExpressionOperationInplace():\n        return True\n\n    def computeExpression(self, trace_collection):\n        # Nothing to do anymore for large constants.\n        if self.shape is not None and self.shape.isConstant():\n            return self, None, None\n\n        left = self.subnode_left\n        left_shape = left.getTypeShape()\n        right = self.subnode_right\n        right_shape = right.getTypeShape()\n\n        self.type_shape, self.escape_desc = self._getOperationShape(\n            left_shape, right_shape\n        )\n\n        if left.isCompileTimeConstant() and right.isCompileTimeConstant():\n            if not self._isTooLarge():\n                return self._simulateOperation(trace_collection)\n\n        exception_raise_exit = self.escape_desc.getExceptionExit()\n        if exception_raise_exit is not None:\n            trace_collection.onExceptionRaiseExit(exception_raise_exit)\n\n            if self.escape_desc.isUnsupported() and self.canCreateUnsupportedException(\n                left_shape, right_shape\n            ):\n                result = wrapExpressionWithSideEffects(\n                    new_node=makeRaiseExceptionReplacementExpressionFromInstance(\n                        expression=self,\n                        exception=self.createUnsupportedException(\n                            left_shape,\n                            right_shape,\n                        ),\n                    ),\n                    old_node=self,\n                    side_effects=(left, right),\n                )\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"Replaced inplace-operator '%s' with %s %s arguments that cannot work.\"\n                    % (self.operator, left_shape, right_shape),\n                )\n\n        if self.escape_desc.isValueEscaping():\n            # The value of these nodes escaped and could change its contents.\n            trace_collection.removeKnowledge(left)\n            trace_collection.removeKnowledge(right)\n\n        if self.escape_desc.isControlFlowEscape():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        if left_shape is tshape_bool:\n            result = makeBinaryOperationNode(\n                self.operator[1:], left, right, self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                result,\n                \"new_expression\",\n                \"Lowered inplace-operator '%s' to binary operation.\" % self.operator,\n            )\n\n        return self, None, None\n\n\nclass ExpressionOperationInplaceAdd(\n    ExpressionOperationAddMixin, ExpressionOperationBinaryInplaceBase\n):\n    kind = \"EXPRESSION_OPERATION_INPLACE_ADD\"\n\n    operator = \"IAdd\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    def __init__(self, left, right, source_ref):\n        ExpressionOperationBinaryInplaceBase.__init__(\n            self, left=left, right=right, source_ref=source_ref\n        )\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationInplaceAddShape(right_shape)\n\n\nclass ExpressionOperationInplaceSub(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_SUB\"\n\n    operator = \"ISub\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinarySubShape(right_shape)\n\n\nclass ExpressionOperationInplaceMult(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_MULT\"\n\n    operator = \"IMult\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryMultShape(right_shape)\n\n\nclass ExpressionOperationInplaceFloorDiv(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_FLOOR_DIV\"\n\n    operator = \"IFloorDiv\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryFloorDivShape(right_shape)\n\n\nif python_version < 0x300:\n\n    class ExpressionOperationInplaceOldDiv(ExpressionOperationBinaryInplaceBase):\n        kind = \"EXPRESSION_OPERATION_INPLACE_OLD_DIV\"\n\n        operator = \"IOldDiv\"\n        simulator = PythonOperators.binary_operator_functions[operator]\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationBinaryOldDivShape(right_shape)\n\n\nclass ExpressionOperationInplaceTrueDiv(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_TRUE_DIV\"\n\n    operator = \"ITrueDiv\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryTrueDivShape(right_shape)\n\n\nclass ExpressionOperationInplaceMod(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_MOD\"\n\n    operator = \"IMod\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryModShape(right_shape)\n\n\nclass ExpressionOperationInplacePow(\n    ExpressionOperationPowMixin, ExpressionOperationBinaryInplaceBase\n):\n    kind = \"EXPRESSION_OPERATION_INPLACE_POW\"\n\n    operator = \"IPow\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryPowShape(right_shape)\n\n\nclass ExpressionOperationInplaceLshift(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_LSHIFT\"\n\n    operator = \"ILShift\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryLShiftShape(right_shape)\n\n\nclass ExpressionOperationInplaceRshift(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_RSHIFT\"\n\n    operator = \"IRShift\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryRShiftShape(right_shape)\n\n\nclass ExpressionOperationInplaceBitOr(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_BIT_OR\"\n\n    operator = \"IBitOr\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    # No inplace bitor special handling before 3.9\n    if python_version < 0x390:\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationBinaryBitOrShape(right_shape)\n\n    else:\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationInplaceBitOrShape(right_shape)\n\n\nclass ExpressionOperationInplaceBitAnd(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_BIT_AND\"\n\n    operator = \"IBitAnd\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryBitAndShape(right_shape)\n\n\nclass ExpressionOperationInplaceBitXor(ExpressionOperationBinaryInplaceBase):\n    kind = \"EXPRESSION_OPERATION_INPLACE_BIT_XOR\"\n\n    operator = \"IBitXor\"\n    simulator = PythonOperators.binary_operator_functions[operator]\n\n    @staticmethod\n    def _getOperationShape(left_shape, right_shape):\n        return left_shape.getOperationBinaryBitXorShape(right_shape)\n\n\nif python_version >= 0x350:\n\n    class ExpressionOperationInplaceMatMult(ExpressionOperationBinaryInplaceBase):\n        kind = \"EXPRESSION_OPERATION_INPLACE_MAT_MULT\"\n\n        operator = \"IMatMult\"\n        simulator = PythonOperators.binary_operator_functions[operator]\n\n        @staticmethod\n        def _getOperationShape(left_shape, right_shape):\n            return left_shape.getOperationBinaryMatMultShape(right_shape)\n\n\n_operator2binary_inplace_node_class = {\n    \"IAdd\": ExpressionOperationInplaceAdd,\n    \"ISub\": ExpressionOperationInplaceSub,\n    \"IMult\": ExpressionOperationInplaceMult,\n    \"IFloorDiv\": ExpressionOperationInplaceFloorDiv,\n    \"ITrueDiv\": ExpressionOperationInplaceTrueDiv,\n    \"IMod\": ExpressionOperationInplaceMod,\n    \"IPow\": ExpressionOperationInplacePow,\n    \"ILShift\": ExpressionOperationInplaceLshift,\n    \"IRShift\": ExpressionOperationInplaceRshift,\n    \"IBitOr\": ExpressionOperationInplaceBitOr,\n    \"IBitAnd\": ExpressionOperationInplaceBitAnd,\n    \"IBitXor\": ExpressionOperationInplaceBitXor,\n}\n\nif python_version < 0x300:\n    _operator2binary_inplace_node_class[\"IOldDiv\"] = ExpressionOperationInplaceOldDiv\n\nif python_version >= 0x350:\n    _operator2binary_inplace_node_class[\"IMatMult\"] = ExpressionOperationInplaceMatMult\n\n\ndef makeExpressionOperationBinaryInplace(operator, left, right, source_ref):\n    node_class = _operator2binary_inplace_node_class[operator]\n\n    return node_class(left=left, right=right, source_ref=source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/OperatorNodesUnary.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for unary operations.\n\nSome of these come from built-ins, e.g. abs, some from syntax, and repr from both.\n\"\"\"\n\nfrom nuitka import PythonOperators\n\nfrom .ChildrenHavingMixins import ChildHavingOperandMixin\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBoolShapeExactMixin,\n    ExpressionStrOrUnicodeDerivedShapeMixin,\n)\n\n\nclass ExpressionOperationUnaryBase(ChildHavingOperandMixin, ExpressionBase):\n    named_children = (\"operand\",)\n\n    __slots__ = (\"operator\", \"simulator\")\n\n    def __init__(self, operand, source_ref):\n        ChildHavingOperandMixin.__init__(self, operand=operand)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def getOperator(self):\n        return self.operator\n\n    def computeExpression(self, trace_collection):\n        operator = self.getOperator()\n        operand = self.subnode_operand\n\n        if operand.isCompileTimeConstant():\n            operand_value = operand.getCompileTimeConstant()\n\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: self.simulator(operand_value),\n                description=\"Operator '%s' with constant argument.\" % operator,\n            )\n        else:\n            # TODO: May go down to MemoryError for compile time constant overflow\n            # ones.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            # The value of that node escapes and could change its contents.\n            # TODO: The unary operations don't do much to an operator, add\n            # methods, that don't do stuff on common types though.\n            # trace_collection.onValueEscapeSomeUnaryOperator(operand)\n\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n            return self, None, None\n\n    @staticmethod\n    def isExpressionOperationUnary():\n        return True\n\n\nclass ExpressionOperationUnaryRepr(  # TODO: Not exact\n    ExpressionStrOrUnicodeDerivedShapeMixin, ExpressionOperationUnaryBase\n):\n    \"\"\"Python unary operator `x` and repr built-in.\"\"\"\n\n    kind = \"EXPRESSION_OPERATION_UNARY_REPR\"\n\n    operator = \"Repr\"\n\n    __slots__ = (\"escape_desc\",)\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n        self.escape_desc = None\n\n    def computeExpression(self, trace_collection):\n        result, self.escape_desc = self.subnode_operand.computeExpressionOperationRepr(\n            repr_node=self, trace_collection=trace_collection\n        )\n\n        return result\n\n    def mayRaiseException(self, exception_type):\n        # TODO: Match getExceptionExit() more precisely against exception type given\n        return (\n            self.escape_desc is None\n            or self.escape_desc.getExceptionExit() is not None\n            or self.subnode_operand.mayRaiseException(exception_type)\n        )\n\n    def mayHaveSideEffects(self):\n        operand = self.subnode_operand\n\n        if operand.mayHaveSideEffects():\n            return True\n\n        return self.escape_desc is None or self.escape_desc.isControlFlowEscape()\n\n\nclass ExpressionOperationUnarySub(ExpressionOperationUnaryBase):\n    \"\"\"Python unary operator -\"\"\"\n\n    kind = \"EXPRESSION_OPERATION_UNARY_SUB\"\n\n    operator = \"USub\"\n    simulator = PythonOperators.unary_operator_functions[operator]\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n\nclass ExpressionOperationUnaryAdd(ExpressionOperationUnaryBase):\n    \"\"\"Python unary operator +\"\"\"\n\n    kind = \"EXPRESSION_OPERATION_UNARY_ADD\"\n\n    operator = \"UAdd\"\n    simulator = PythonOperators.unary_operator_functions[operator]\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n\nclass ExpressionOperationUnaryInvert(ExpressionOperationUnaryBase):\n    \"\"\"Python unary operator ~\"\"\"\n\n    kind = \"EXPRESSION_OPERATION_UNARY_INVERT\"\n\n    operator = \"Invert\"\n    simulator = PythonOperators.unary_operator_functions[operator]\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n\nclass ExpressionOperationNot(\n    ExpressionBoolShapeExactMixin, ExpressionOperationUnaryBase\n):\n    kind = \"EXPRESSION_OPERATION_NOT\"\n\n    operator = \"Not\"\n    simulator = PythonOperators.unary_operator_functions[operator]\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_operand.computeExpressionOperationNot(\n            not_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_operand.mayRaiseException(\n            exception_type\n        ) or self.subnode_operand.mayRaiseExceptionBool(exception_type)\n\n    def getTruthValue(self):\n        result = self.subnode_operand.getTruthValue()\n\n        # Need to invert the truth value of operand of course here.\n        return None if result is None else not result\n\n    def mayHaveSideEffects(self):\n        operand = self.subnode_operand\n\n        if operand.mayHaveSideEffects():\n            return True\n\n        return operand.mayHaveSideEffectsBool()\n\n    def mayHaveSideEffectsBool(self):\n        return self.subnode_operand.mayHaveSideEffectsBool()\n\n    def extractSideEffects(self):\n        operand = self.subnode_operand\n\n        # TODO: Find the common ground of these, and make it an expression\n        # method.\n        if operand.isExpressionMakeSequence():\n            return operand.extractSideEffects()\n\n        if operand.isExpressionMakeDict():\n            return operand.extractSideEffects()\n\n        return (self,)\n\n\nclass ExpressionOperationUnaryAbs(ExpressionOperationUnaryBase):\n    kind = \"EXPRESSION_OPERATION_UNARY_ABS\"\n\n    operator = \"Abs\"\n    simulator = PythonOperators.unary_operator_functions[operator]\n\n    def __init__(self, operand, source_ref):\n        ExpressionOperationUnaryBase.__init__(\n            self, operand=operand, source_ref=source_ref\n        )\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_operand.computeExpressionAbs(\n            abs_node=self, trace_collection=trace_collection\n        )\n\n    def mayRaiseException(self, exception_type):\n        operand = self.subnode_operand\n\n        if operand.mayRaiseException(exception_type):\n            return True\n\n        return operand.mayRaiseExceptionAbs(exception_type)\n\n    def mayHaveSideEffects(self):\n        operand = self.subnode_operand\n\n        if operand.mayHaveSideEffects():\n            return True\n\n        return operand.mayHaveSideEffectsAbs()\n\n\ndef makeExpressionOperationUnary(operator, operand, source_ref):\n    if operator == \"Repr\":\n        unary_class = ExpressionOperationUnaryRepr\n    elif operator == \"USub\":\n        unary_class = ExpressionOperationUnarySub\n    elif operator == \"UAdd\":\n        unary_class = ExpressionOperationUnaryAdd\n    elif operator == \"Invert\":\n        unary_class = ExpressionOperationUnaryInvert\n    else:\n        assert False, operand\n\n    # Shortcut these unary operations, avoiding \"-1\", etc. to ever become one.\n    if operand.isCompileTimeConstant():\n        try:\n            constant = unary_class.simulator(operand.getCompileTimeConstant())\n        except Exception:  # Catch all the things, pylint: disable=broad-except\n            # Compile time detectable error, postpone these, so they get traced.\n            pass\n        else:\n            return makeConstantRefNode(\n                constant=constant,\n                source_ref=source_ref,\n                user_provided=getattr(operand, \"user_provided\", False),\n            )\n\n    return unary_class(operand=operand, source_ref=source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/OsSysNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes the represent ways to access os and sys functions. \"\"\"\n\nimport os\n\nfrom .BuiltinRefNodes import ExpressionBuiltinExceptionRef\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExceptionNodes import ExpressionRaiseException\nfrom .ExpressionBases import ExpressionNoSideEffectsMixin\nfrom .HardImportNodesGenerated import (\n    ExpressionOsListdirCallBase,\n    ExpressionOsPathAbspathCallBase,\n    ExpressionOsPathBasenameCallBase,\n    ExpressionOsPathExistsCallBase,\n    ExpressionOsPathIsabsCallBase,\n    ExpressionOsPathIsdirCallBase,\n    ExpressionOsPathIsfileCallBase,\n    ExpressionOsUnameCallBase,\n)\n\n\nclass ExpressionOsUnameCall(\n    # TODO: We don*t have this\n    # ExpressionTupleShapeDerivedMixin,\n    ExpressionNoSideEffectsMixin,\n    ExpressionOsUnameCallBase,\n):\n    kind = \"EXPRESSION_OS_UNAME_CALL\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # TODO: The value should be its own runtime constant value type which\n        # supports indexing.\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionOsPathExistsCall(ExpressionOsPathExistsCallBase):\n    kind = \"EXPRESSION_OS_PATH_EXISTS_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionOsPathIsfileCall(ExpressionOsPathIsfileCallBase):\n    kind = \"EXPRESSION_OS_PATH_ISFILE_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionOsPathIsdirCall(ExpressionOsPathIsdirCallBase):\n    kind = \"EXPRESSION_OS_PATH_ISDIR_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionOsPathBasenameCall(ExpressionOsPathBasenameCallBase):\n    kind = \"EXPRESSION_OS_PATH_BASENAME_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        result = makeConstantRefNode(\n            constant=os.path.basename(self.subnode_p.getCompileTimeConstant()),\n            source_ref=self.source_ref,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Compile time resolved 'os.path.basename' call.\",\n        )\n\n\nclass ExpressionOsPathDirnameCall(ExpressionOsPathBasenameCallBase):\n    kind = \"EXPRESSION_OS_PATH_DIRNAME_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        result = makeConstantRefNode(\n            constant=os.path.dirname(self.subnode_p.getCompileTimeConstant()),\n            source_ref=self.source_ref,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Compile time resolved 'os.path.dirname' call.\",\n        )\n\n\nclass ExpressionOsPathAbspathCall(ExpressionOsPathAbspathCallBase):\n    kind = \"EXPRESSION_OS_PATH_ABSPATH_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # Nothing we can do really\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionOsPathIsabsCall(ExpressionOsPathIsabsCallBase):\n    kind = \"EXPRESSION_OS_PATH_ISABS_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        result = makeConstantRefNode(\n            constant=os.path.isabs(self.subnode_s.getCompileTimeConstant()),\n            source_ref=self.source_ref,\n        )\n\n        return (\n            result,\n            \"new_expression\",\n            \"Compile time resolved 'os.path.isabs' call.\",\n        )\n\n\nclass ExpressionOsListdirCall(ExpressionOsListdirCallBase):\n    kind = \"EXPRESSION_OS_LISTDIR_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # Nothing we can do really\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeExpressionSysExitCall(exit_code, source_ref):\n    if exit_code is None:\n        exit_code = makeConstantRefNode(constant=None, source_ref=source_ref)\n\n    return ExpressionRaiseException(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=\"SystemExit\", source_ref=source_ref\n        ),\n        exception_value=exit_code,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/OutlineNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Outline nodes.\n\nWe use them for re-formulations and for in-lining of code. They are expressions\nthat get their value from return statements in their code body. They do not\nown anything by themselves. It's just a way of having try/finally for the\nexpressions, or multiple returns, without running in a too different context.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingBodyOptionalMixin\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExceptionNodes import ExpressionRaiseException\nfrom .ExpressionBases import ExpressionBase\nfrom .FunctionNodes import ExpressionFunctionBodyBase\nfrom .LocalsScopes import getLocalsDictHandle\n\n\nclass ExpressionOutlineBody(ChildHavingBodyOptionalMixin, ExpressionBase):\n    \"\"\"Outlined expression code.\n\n    This is for a call to a piece of code to be executed in a specific\n    context. It contains an exclusively owned function body, that has\n    no other references, and can be considered part of the calling\n    context.\n\n    It must return a value, to use as expression value.\n    \"\"\"\n\n    kind = \"EXPRESSION_OUTLINE_BODY\"\n\n    named_children = (\"body|optional+setter\",)\n\n    __slots__ = (\"provider\", \"name\", \"temp_scope\")\n\n    @staticmethod\n    def isExpressionOutlineBody():\n        return True\n\n    def __init__(self, provider, name, source_ref, body=None):\n        assert name != \"\"\n\n        ChildHavingBodyOptionalMixin.__init__(self, body=body)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.provider = provider\n        self.name = name\n\n        self.temp_scope = None\n\n        # Hack: This allows some APIs to work although this is not yet\n        # officially a child yet. Important during building.\n        self.parent = provider\n\n    def getDetails(self):\n        return {\"provider\": self.provider, \"name\": self.name}\n\n    def getOutlineTempScope(self):\n        # We use our own name as a temp_scope, cached from the parent, if the\n        # scope is None.\n        if self.temp_scope is None:\n            self.temp_scope = self.provider.allocateTempScope(self.name)\n\n        return self.temp_scope\n\n    def allocateTempVariable(self, temp_scope, name, temp_type):\n        if temp_scope is None:\n            temp_scope = self.getOutlineTempScope()\n\n        return self.provider.allocateTempVariable(\n            temp_scope=temp_scope, name=name, temp_type=temp_type\n        )\n\n    def allocateTempScope(self, name):\n        # Let's scope the temporary scopes by the outline they come from.\n        return self.provider.allocateTempScope(name=self.name + \"$\" + name)\n\n    def getContainingClassDictCreation(self):\n        return self.getParentVariableProvider().getContainingClassDictCreation()\n\n    def computeExpressionRaw(self, trace_collection):\n        owning_module = self.getParentModule()\n\n        # Make sure the owning module is added to the used set. This is most\n        # important for helper functions, or modules, which otherwise have\n        # become unused.\n        from nuitka.ModuleRegistry import addUsedModule\n\n        addUsedModule(\n            module=owning_module,\n            using_module=None,\n            usage_tag=\"outline\",\n            reason=\"Owning module\",\n            source_ref=self.source_ref,\n        )\n\n        abort_context = trace_collection.makeAbortStackContext(\n            catch_breaks=False,\n            catch_continues=False,\n            catch_returns=True,\n            catch_exceptions=False,\n        )\n\n        with abort_context:\n            body = self.subnode_body\n\n            result = body.computeStatementsSequence(trace_collection=trace_collection)\n\n            if result is not body:\n                self.setChildBody(result)\n                body = result\n\n            return_collections = trace_collection.getFunctionReturnCollections()\n\n        if return_collections:\n            trace_collection.mergeMultipleBranches(return_collections)\n\n        first_statement = body.subnode_statements[0]\n\n        if first_statement.isStatementReturnConstant():\n            return (\n                makeConstantRefNode(\n                    constant=first_statement.getConstant(),\n                    source_ref=first_statement.source_ref,\n                ),\n                \"new_expression\",\n                \"Outline '%s' is now simple return, use directly.\" % self.name,\n            )\n\n        if first_statement.isStatementReturn():\n            return (\n                first_statement.subnode_expression,\n                \"new_expression\",\n                \"Outline '%s' is now simple return, use directly.\" % self.name,\n            )\n\n        if first_statement.isStatementRaiseException():\n            # Exception exit was already annotated, need not repeat it.\n\n            result = ExpressionRaiseException(\n                exception_type=first_statement.subnode_exception_type,\n                exception_value=first_statement.subnode_exception_value,\n                source_ref=first_statement.getSourceReference(),\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Outline is now exception raise, use directly.\",\n            )\n\n        # TODO: Function outline may become too trivial to outline and return\n        # collections may tell us something.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_body.mayRaiseException(exception_type)\n\n    def willRaiseAnyException(self):\n        return self.subnode_body.willRaiseAnyException()\n\n    def getEntryPoint(self):\n        \"\"\"Entry point for code.\n\n        Normally ourselves. Only outlines will refer to their parent which\n        technically owns them.\n\n        \"\"\"\n\n        return self.provider.getEntryPoint()\n\n    def getCodeName(self):\n        return self.provider.getCodeName()\n\n\nclass ExpressionOutlineFunctionBase(ExpressionFunctionBodyBase):\n    \"\"\"Outlined function code.\n\n    This is for a call to a function to be called in-line to be executed\n    in a specific context. It contains an exclusively owned function body,\n    that has no other references, and can be considered part of the calling\n    context.\n\n    As normal function it must return a value, to use as expression value,\n    but we know we only exist once.\n\n    Once this has no frame, it can be changed to a mere outline expression.\n    \"\"\"\n\n    __slots__ = (\"temp_scope\", \"locals_scope\")\n\n    def __init__(self, provider, name, body, code_prefix, source_ref):\n        ExpressionFunctionBodyBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            body=body,\n            code_prefix=code_prefix,\n            flags=None,\n            source_ref=source_ref,\n        )\n\n        self.temp_scope = None\n\n        self.locals_scope = None\n\n    @staticmethod\n    def isExpressionOutlineFunctionBase():\n        return True\n\n    def getDetails(self):\n        return {\"name\": self.name, \"provider\": self.provider}\n\n    def getDetailsForDisplay(self):\n        return {\"name\": self.name, \"provider\": self.provider.getCodeName()}\n\n    def computeExpressionRaw(self, trace_collection):\n        # Keep track of these, so they can provide what variables are to be\n        # setup.\n        trace_collection.addOutlineFunction(self)\n\n        abort_context = trace_collection.makeAbortStackContext(\n            catch_breaks=False,\n            catch_continues=False,\n            catch_returns=True,\n            catch_exceptions=False,\n        )\n\n        with abort_context:\n            body = self.subnode_body\n\n            result = body.computeStatementsSequence(trace_collection=trace_collection)\n\n            if result is not body:\n                self.setChildBody(result)\n                body = result\n\n            return_collections = trace_collection.getFunctionReturnCollections()\n\n        if return_collections:\n            trace_collection.mergeMultipleBranches(return_collections)\n\n        first_statement = body.subnode_statements[0]\n\n        if first_statement.isStatementReturnConstant():\n            return (\n                makeConstantRefNode(\n                    constant=first_statement.getConstant(),\n                    source_ref=first_statement.source_ref,\n                ),\n                \"new_expression\",\n                \"Outline function '%s' is now simple return, use directly.\" % self.name,\n            )\n\n        if first_statement.isStatementReturn():\n            return (\n                first_statement.subnode_expression,\n                \"new_expression\",\n                \"Outline function '%s' is now simple return, use directly.\" % self.name,\n            )\n\n        if first_statement.isStatementRaiseException():\n            # Exception exit was already annotated, need not repeat it.\n\n            result = ExpressionRaiseException(\n                exception_type=first_statement.subnode_exception_type,\n                exception_value=first_statement.subnode_exception_value,\n                source_ref=first_statement.getSourceReference(),\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Outline function is now exception raise, use directly.\",\n            )\n\n        # TODO: Function outline may become too trivial to outline and return\n        # collections may tell us something.\n        return self, None, None\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_body.mayRaiseException(exception_type)\n\n    def willRaiseAnyException(self):\n        return self.subnode_body.willRaiseAnyException()\n\n    def getTraceCollection(self):\n        return self.provider.getTraceCollection()\n\n    def getOutlineTempScope(self):\n        # We use our own name as a temp_scope, cached from the parent, if the\n        # scope is None.\n        if self.temp_scope is None:\n            self.temp_scope = self.provider.allocateTempScope(self.name)\n\n        return self.temp_scope\n\n    def allocateTempVariable(self, temp_scope, name, temp_type):\n        if temp_scope is None:\n            temp_scope = self.getOutlineTempScope()\n\n        return self.provider.allocateTempVariable(\n            temp_scope=temp_scope, name=name, temp_type=temp_type\n        )\n\n    def allocateTempScope(self, name):\n        # Let's scope the temporary scopes by the outline they come from.\n        return self.provider.allocateTempScope(name=self.name + \"$\" + name)\n\n    def getEntryPoint(self):\n        \"\"\"Entry point for code.\n\n        Normally ourselves. Only outlines will refer to their parent which\n        technically owns them.\n\n        \"\"\"\n\n        return self.provider.getEntryPoint()\n\n    def getClosureVariable(self, variable_name):\n        # Simply try and get from our parent.\n        return self.provider.getVariableForReference(variable_name=variable_name)\n\n    def getLocalsScope(self):\n        return self.locals_scope\n\n    def isEarlyClosure(self):\n        return self.provider.isEarlyClosure()\n\n    def isUnoptimized(self):\n        return self.provider.isUnoptimized()\n\n\nclass ExpressionOutlineFunction(ExpressionOutlineFunctionBase):\n    kind = \"EXPRESSION_OUTLINE_FUNCTION\"\n\n    __slots__ = (\"locals_scope\",)\n\n    def __init__(self, provider, name, source_ref, body=None):\n        ExpressionOutlineFunctionBase.__init__(\n            self,\n            provider=provider,\n            name=name,\n            code_prefix=\"outline\",\n            body=body,\n            source_ref=source_ref,\n        )\n\n        self.locals_scope = getLocalsDictHandle(\n            \"locals_%s\" % self.getCodeName(), \"python_function\", self\n        )\n\n    def getChildQualname(self, function_name):\n        return self.provider.getChildQualname(function_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/PackageMetadataNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes the represent ways to access metadata pkg_resources, importlib.resources etc.\n\n\"\"\"\n\nfrom nuitka.Constants import isCompileTimeConstantValue\nfrom nuitka.Options import isStandaloneMode, shallMakeModule\nfrom nuitka.Tracing import inclusion_logger\nfrom nuitka.utils.Importing import importFromCompileTime\nfrom nuitka.utils.Utils import withNoDeprecationWarning\n\nfrom .AttributeNodes import makeExpressionAttributeLookup\nfrom .ContainerMakingNodes import (\n    ExpressionMakeSequenceMixin,\n    makeExpressionMakeList,\n    makeExpressionMakeTuple,\n)\nfrom .DictionaryNodes import ExpressionMakeDictMixin, makeExpressionMakeDict\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .ExpressionBasesGenerated import (\n    ExpressionImportlibMetadataBackportEntryPointsValueRefBase,\n    ExpressionImportlibMetadataBackportEntryPointValueRefBase,\n    ExpressionImportlibMetadataBackportSelectableGroupsValueRefBase,\n    ExpressionImportlibMetadataDistributionFailedCallBase,\n    ExpressionImportlibMetadataEntryPointsValueRefBase,\n    ExpressionImportlibMetadataEntryPointValueRefBase,\n    ExpressionImportlibMetadataSelectableGroupsValueRefBase,\n)\nfrom .HardImportNodesGenerated import (\n    ExpressionImportlibMetadataBackportEntryPointsCallBase,\n    ExpressionImportlibMetadataBackportVersionCallBase,\n    ExpressionImportlibMetadataDistributionCallBase,\n    ExpressionImportlibMetadataEntryPointsBefore310CallBase,\n    ExpressionImportlibMetadataEntryPointsSince310CallBase,\n    ExpressionImportlibMetadataVersionCallBase,\n    ExpressionPkgResourcesGetDistributionCallBase,\n    ExpressionPkgResourcesIterEntryPointsCallBase,\n    ExpressionPkgResourcesRequireCallBase,\n)\nfrom .KeyValuePairNodes import (\n    makeExpressionKeyValuePairConstantKey,\n    makeKeyValuePairExpressionsFromKwArgs,\n)\n\n\ndef _getPkgResourcesModule():\n    \"\"\"Helper for importing pkg_resources from installation at compile time.\n\n    This is not for using the inline copy, but the one from the actual\n    installation of the user. It suppresses warnings and caches the value\n    avoid making more __import__ calls that necessary.\n    \"\"\"\n\n    return importFromCompileTime(\"pkg_resources\", must_exist=True)\n\n\nclass ExpressionPkgResourcesRequireCall(ExpressionPkgResourcesRequireCallBase):\n    kind = \"EXPRESSION_PKG_RESOURCES_REQUIRE_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        resources_module = _getPkgResourcesModule()\n\n        require = resources_module.require\n        ResolutionError = resources_module.ResolutionError\n\n        try:\n            InvalidRequirement = (\n                resources_module.extern.packaging.requirements.InvalidRequirement\n            )\n        except AttributeError:\n            # Very old versions of pkg_resources do not have it\n            InvalidRequirement = TypeError\n\n        args = tuple(\n            element.getCompileTimeConstant() for element in self.subnode_requirements\n        )\n\n        try:\n            distributions = require(*args)\n        except ResolutionError:\n            inclusion_logger.warning(\n                \"Cannot find requirement %s at '%s', expect potential run time problem, unless this is unused code.\"\n                % (\",\".join(repr(s) for s in args), self.source_ref.getAsString())\n            )\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n        except (TypeError, InvalidRequirement):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find requirements '%s' at '%s' due to unhandled %s. Please report this bug.\"\n                % (\n                    \",\".join(repr(s) for s in args),\n                    self.source_ref.getAsString(),\n                    repr(e),\n                )\n            )\n        else:\n            result = makeExpressionMakeList(\n                elements=tuple(\n                    ExpressionPkgResourcesDistributionValueRef(\n                        distribution=distribution, source_ref=self.source_ref\n                    )\n                    for distribution in distributions\n                ),\n                source_ref=self.source_ref,\n            )\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted 'pkg_resources.require' result\",\n            )\n\n\nclass ExpressionPkgResourcesGetDistributionCall(\n    ExpressionPkgResourcesGetDistributionCallBase\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_GET_DISTRIBUTION_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pkg_resources_module = _getPkgResourcesModule()\n        get_distribution = pkg_resources_module.get_distribution\n        DistributionNotFound = pkg_resources_module.DistributionNotFound\n\n        arg = self.subnode_dist.getCompileTimeConstant()\n\n        try:\n            distribution = get_distribution(arg)\n        except DistributionNotFound:\n            trace_collection.onDistributionUsed(\n                distribution_name=arg, node=self, success=False\n            )\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find distribution '%s' at '%s' due to unhandled %s. Please report this bug.\"\n                % (arg, self.source_ref.getAsString(), repr(e))\n            )\n        else:\n            trace_collection.onDistributionUsed(\n                distribution_name=arg, node=self, success=True\n            )\n\n            result = ExpressionPkgResourcesDistributionValueRef(\n                distribution=distribution, source_ref=self.source_ref\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted 'pkg_resources.get_distribution' result\",\n            )\n\n\nclass ImportlibMetadataVersionCallMixin(object):\n    __slots__ = ()\n\n    def _getImportlibMetadataModule(self):\n        return importFromCompileTime(self.importlib_metadata_name, must_exist=True)\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        version = self._getImportlibMetadataModule().version\n        PackageNotFoundError = self._getImportlibMetadataModule().PackageNotFoundError\n\n        arg = self.subnode_distribution_name.getCompileTimeConstant()\n\n        try:\n            distribution = version(arg)\n        except PackageNotFoundError:\n            trace_collection.onDistributionUsed(\n                distribution_name=arg, node=self, success=False\n            )\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find distribution '%s' at '%s' due to unhandled %s. Please report this bug.\"\n                % (arg, self.source_ref.getAsString(), repr(e))\n            )\n        else:\n            trace_collection.onDistributionUsed(\n                distribution_name=arg, node=self, success=True\n            )\n\n            from .ConstantRefNodes import makeConstantRefNode\n\n            result = makeConstantRefNode(\n                constant=distribution, source_ref=self.source_ref\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted '%s.version' result\"\n                % self.importlib_metadata_name,\n            )\n\n\nclass ExpressionImportlibMetadataVersionCall(\n    ImportlibMetadataVersionCallMixin, ExpressionImportlibMetadataVersionCallBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_VERSION_CALL\"\n    python_version_spec = \">= 0x380\"\n    importlib_metadata_name = \"importlib.metadata\"\n\n\nclass ExpressionImportlibMetadataBackportVersionCall(\n    ImportlibMetadataVersionCallMixin,\n    ExpressionImportlibMetadataBackportVersionCallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_VERSION_CALL\"\n    importlib_metadata_name = \"importlib_metadata\"\n\n\n# TODO: This is much like a compile time variable, but not a good compile time\n# constant, have that too. Treating it as semi-constant, we should get away\n# with.\n\n\nclass ExpressionPkgResourcesDistributionValueRef(\n    ExpressionNoSideEffectsMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_DISTRIBUTION_VALUE_REF\"\n\n    __slots__ = (\"distribution\", \"computed_attributes\")\n\n    preserved_attributes = (\"py_version\", \"platform\", \"version\", \"project_name\")\n\n    def __init__(self, distribution, source_ref):\n        with withNoDeprecationWarning():\n            Distribution = _getPkgResourcesModule().Distribution\n\n            preserved_attributes = self.preserved_attributes\n            if not isStandaloneMode():\n                preserved_attributes += (\"location\",)\n\n            distribution = Distribution(\n                **dict(\n                    (key, getattr(distribution, key)) for key in preserved_attributes\n                )\n            )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.distribution = distribution\n        self.computed_attributes = {}\n\n    def finalize(self):\n        del self.distribution\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def computeExpressionRaw(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        if attribute_name not in self.computed_attributes:\n            self.computed_attributes[attribute_name] = hasattr(\n                self.distribution, attribute_name\n            )\n\n        return self.computed_attributes[attribute_name]\n\n    def getKnownAttributeValue(self, attribute_name):\n        return getattr(self.distribution, attribute_name)\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        # If it raises, or the attribute itself is a compile time constant,\n        # then do execute it.\n        if (\n            self.isKnownToHaveAttribute(attribute_name)\n            and isCompileTimeConstantValue(\n                getattr(self.distribution, attribute_name, None)\n            )\n            and (attribute_name != \"location\" or not isStandaloneMode())\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=lookup_node,\n                computation=lambda: getattr(self.distribution, attribute_name),\n                description=\"Attribute '%s' pre-computed.\" % (attribute_name),\n            )\n\n        return lookup_node, None, None\n\n    def mayRaiseExceptionAttributeLookup(self, exception_type, attribute_name):\n        return not self.isKnownToHaveAttribute(attribute_name)\n\n\nclass ExpressionImportlibMetadataDistributionValueRef(\n    ExpressionNoSideEffectsMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_VALUE_REF\"\n\n    # This is also usable with the backport, generated code finds what is working for it.\n\n    __slots__ = (\"distribution\", \"original_name\", \"computed_attributes\")\n\n    def __init__(self, distribution, original_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.distribution = distribution\n        self.original_name = original_name\n        self.computed_attributes = {}\n\n    def getDetails(self):\n        return {\"distribution\": self.distribution, \"original_name\": self.original_name}\n\n    def finalize(self):\n        del self.distribution\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def computeExpressionRaw(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n\nclass ExpressionPkgResourcesIterEntryPointsCall(\n    ExpressionPkgResourcesIterEntryPointsCallBase\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_ITER_ENTRY_POINTS_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pkg_resources_module = _getPkgResourcesModule()\n        iter_entry_points = pkg_resources_module.iter_entry_points\n        DistributionNotFound = pkg_resources_module.DistributionNotFound\n\n        group = self.subnode_group.getCompileTimeConstant()\n        if self.subnode_name is not None:\n            name = self.subnode_name.getCompileTimeConstant()\n        else:\n            name = None\n\n        try:\n            # Get entry point from generator, we cannot delay.\n            entry_points = tuple(iter_entry_points(group=group, name=name))\n        except DistributionNotFound:\n            trace_collection.onDistributionUsed(\n                distribution_name=name or group, node=self, success=False\n            )\n\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find distribution '%s' at '%s' due to unhandled %s. Please report this bug.\"\n                % (name, self.source_ref.getAsString(), repr(e))\n            )\n        else:\n            trace_collection.onDistributionUsed(\n                distribution_name=name or group, node=self, success=True\n            )\n\n            result = makeExpressionMakeList(\n                elements=tuple(\n                    ExpressionPkgResourcesEntryPointValueRef(\n                        entry_point=entry_point, source_ref=self.source_ref\n                    )\n                    for entry_point in entry_points\n                ),\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted 'pkg_resources.iter_entry_points' result\",\n            )\n\n\nclass ExpressionPkgResourcesEntryPointValueRef(\n    ExpressionNoSideEffectsMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_ENTRY_POINT_VALUE_REF\"\n\n    __slots__ = (\"entry_point\", \"computed_attributes\")\n\n    preserved_attributes = (\"name\", \"module_name\", \"attrs\", \"extras\")\n\n    def __init__(self, entry_point, source_ref):\n        with withNoDeprecationWarning():\n            EntryPoint = _getPkgResourcesModule().EntryPoint\n\n            entry_point = EntryPoint(\n                **dict(\n                    (key, getattr(entry_point, key))\n                    for key in self.preserved_attributes\n                )\n            )\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.entry_point = entry_point\n        self.computed_attributes = {}\n\n    def finalize(self):\n        del self.entry_point\n        del self.computed_attributes\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n    def computeExpressionRaw(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        if attribute_name not in self.computed_attributes:\n            self.computed_attributes[attribute_name] = hasattr(\n                self.entry_point, attribute_name\n            )\n\n        return self.computed_attributes[attribute_name]\n\n    def getKnownAttributeValue(self, attribute_name):\n        return getattr(self.entry_point, attribute_name)\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        # If it raises, or the attribute itself is a compile time constant,\n        # then do execute it.\n        if self.isKnownToHaveAttribute(attribute_name) and isCompileTimeConstantValue(\n            getattr(self.entry_point, attribute_name, None)\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=lookup_node,\n                computation=lambda: getattr(self.entry_point, attribute_name),\n                description=\"Attribute '%s' pre-computed.\" % (attribute_name),\n            )\n\n        return lookup_node, None, None\n\n\nclass ImportlibMetadataDistributionCallMixin(object):\n    __slots__ = ()\n\n    def _getImportlibMetadataModule(self):\n        return importFromCompileTime(self.importlib_metadata_name, must_exist=True)\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # In module mode, we cannot predict if the distribution is the same or not\n        # so lets not optimize this further and treat it as an unknown.\n        if shallMakeModule():\n            return\n\n        distribution_func = self._getImportlibMetadataModule().distribution\n        PackageNotFoundError = self._getImportlibMetadataModule().PackageNotFoundError\n\n        arg = self.subnode_distribution_name.getCompileTimeConstant()\n\n        try:\n            distribution = distribution_func(arg)\n        except PackageNotFoundError:\n            # TODO: In isolated standalone mode, we could go to the actual exception\n            # instead.\n\n            return trace_collection.computedExpressionResult(\n                expression=self.makeExpressionImportlibMetadataDistributionFailedCall(),\n                change_tags=\"new_expression\",\n                change_desc=\"Call to '%s.distribution' failed to resolve.\"\n                % self.importlib_metadata_name,\n            )\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find distribution '%s' at '%s' due to unhandled %s. Please report this bug.\"\n                % (arg, self.source_ref.getAsString(), repr(e))\n            )\n        else:\n            trace_collection.onDistributionUsed(\n                distribution_name=arg, node=self, success=False\n            )\n\n            # Remember the original name, distributions can other names.\n            result = ExpressionImportlibMetadataDistributionValueRef(\n                distribution=distribution, original_name=arg, source_ref=self.source_ref\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted '%s.distribution' result\"\n                % self.importlib_metadata_name,\n            )\n\n\nclass ExpressionImportlibMetadataDistributionCall(\n    ImportlibMetadataDistributionCallMixin,\n    ExpressionImportlibMetadataDistributionCallBase,\n):\n    \"\"\"Represents call to importlib.metadata.distribution(distribution_name)\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_CALL\"\n\n    python_version_spec = \">= 0x380\"\n\n    importlib_metadata_name = \"importlib.metadata\"\n\n    def makeExpressionImportlibMetadataDistributionFailedCall(self):\n        return ExpressionImportlibMetadataDistributionFailedCall(\n            distribution_name=self.subnode_distribution_name, source_ref=self.source_ref\n        )\n\n\nclass ExpressionImportlibMetadataDistributionFailedCallMixin(object):\n    __slots__ = ()\n\n    def computeExpression(self, trace_collection):\n        distribution_name = self.subnode_distribution_name.getCompileTimeConstant()\n\n        trace_collection.onDistributionUsed(\n            distribution_name=distribution_name, node=self, success=False\n        )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # We are kind of final, but we need to call \"onDistributionUsed\" still.\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n\nclass ExpressionImportlibMetadataDistributionFailedCall(\n    ExpressionImportlibMetadataDistributionFailedCallMixin,\n    ExpressionImportlibMetadataDistributionFailedCallBase,\n):\n    \"\"\"Represents compile time failed call to importlib.metadata.distribution(distribution_name)\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_FAILED_CALL\"\n\n    named_children = (\"distribution_name\",)\n\n    # We know it's a constant, no need to visit it anymore.\n    auto_compute_handling = \"final_children\"\n\n    python_version_spec = \">= 0x380\"\n\n    importlib_metadata_name = \"importlib.metadata\"\n\n\nclass ExpressionImportlibMetadataBackportDistributionFailedCall(\n    ExpressionImportlibMetadataDistributionFailedCallMixin,\n    ExpressionImportlibMetadataDistributionFailedCallBase,\n):\n    \"\"\"Represents compile time failed call to importlib_metadata.distribution(distribution_name)\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_FAILED_CALL\"\n\n    named_children = (\"distribution_name\",)\n\n    # We know it's a constant, no need to visit it anymore.\n    auto_compute_handling = \"final_children\"\n\n    importlib_metadata_name = \"importlib_metadata\"\n\n\nclass ExpressionImportlibMetadataBackportDistributionCall(\n    ImportlibMetadataDistributionCallMixin,\n    ExpressionImportlibMetadataDistributionCallBase,\n):\n    \"\"\"Represents call to importlib_metadata.distribution(distribution_name)\"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_CALL\"\n    importlib_metadata_name = \"importlib_metadata\"\n\n    def makeExpressionImportlibMetadataDistributionFailedCall(self):\n        return ExpressionImportlibMetadataBackportDistributionFailedCall(\n            distribution_name=self.subnode_distribution_name, source_ref=self.source_ref\n        )\n\n\ndef makeExpressionImportlibMetadataMetadataCall(distribution_name, source_ref):\n    return makeExpressionAttributeLookup(\n        expression=ExpressionImportlibMetadataDistributionCall(\n            distribution_name=distribution_name, source_ref=source_ref\n        ),\n        attribute_name=\"metadata\",\n        source_ref=source_ref,\n    )\n\n\ndef makeExpressionImportlibMetadataBackportMetadataCall(distribution_name, source_ref):\n    return makeExpressionAttributeLookup(\n        expression=ExpressionImportlibMetadataBackportDistributionCall(\n            distribution_name=distribution_name, source_ref=source_ref\n        ),\n        attribute_name=\"metadata\",\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionImportlibMetadataEntryPointValueMixin(object):\n    __slots__ = ()\n\n    preserved_attributes = (\"name\", \"value\", \"group\")\n\n    def _getImportlibMetadataModule(self):\n        return importFromCompileTime(self.importlib_metadata_name, must_exist=True)\n\n    def finalize(self):\n        del self.entry_point\n        del self.computed_attributes\n\n    @staticmethod\n    def isKnownToBeHashable():\n        return True\n\n    @staticmethod\n    def getTruthValue():\n        return True\n\n    def computeExpressionRaw(self, trace_collection):\n        # Cannot compute any further, this is already the best.\n        return self, None, None\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        if attribute_name not in self.computed_attributes:\n            self.computed_attributes[attribute_name] = hasattr(\n                self.entry_point, attribute_name\n            )\n\n        return self.computed_attributes[attribute_name]\n\n    def getKnownAttributeValue(self, attribute_name):\n        return getattr(self.entry_point, attribute_name)\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        # If it raises, or the attribute itself is a compile time constant,\n        # then do execute it.\n        if self.isKnownToHaveAttribute(attribute_name) and isCompileTimeConstantValue(\n            getattr(self.entry_point, attribute_name, None)\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=lookup_node,\n                computation=lambda: getattr(self.entry_point, attribute_name),\n                description=\"Attribute '%s' pre-computed.\" % (attribute_name),\n            )\n\n        return lookup_node, None, None\n\n\nclass ExpressionImportlibMetadataEntryPointValueRef(\n    ExpressionNoSideEffectsMixin,\n    ExpressionImportlibMetadataEntryPointValueMixin,\n    ExpressionImportlibMetadataEntryPointValueRefBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINT_VALUE_REF\"\n\n    python_version_spec = \">= 0x380\"\n\n    __slots__ = (\"entry_point\", \"computed_attributes\")\n\n    auto_compute_handling = \"final,no_raise\"\n\n    importlib_metadata_name = \"importlib.metadata\"\n\n    def __init__(self, entry_point, source_ref):\n        ExpressionImportlibMetadataEntryPointValueRefBase.__init__(self, source_ref)\n\n        EntryPoint = self._getImportlibMetadataModule().EntryPoint\n\n        entry_point = EntryPoint(\n            **dict(\n                (key, getattr(entry_point, key)) for key in self.preserved_attributes\n            )\n        )\n\n        self.entry_point = entry_point\n        self.computed_attributes = {}\n\n\nclass ExpressionImportlibMetadataBackportEntryPointValueRef(\n    ExpressionNoSideEffectsMixin,\n    ExpressionImportlibMetadataEntryPointValueMixin,\n    ExpressionImportlibMetadataBackportEntryPointValueRefBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINT_VALUE_REF\"\n\n    __slots__ = (\"entry_point\", \"computed_attributes\")\n\n    auto_compute_handling = \"final,no_raise\"\n\n    importlib_metadata_name = \"importlib_metadata\"\n\n    def __init__(self, entry_point, source_ref):\n        ExpressionImportlibMetadataBackportEntryPointValueRefBase.__init__(\n            self, source_ref\n        )\n\n        EntryPoint = self._getImportlibMetadataModule().EntryPoint\n\n        entry_point = EntryPoint(\n            **dict(\n                (key, getattr(entry_point, key)) for key in self.preserved_attributes\n            )\n        )\n\n        self.entry_point = entry_point\n        self.computed_attributes = {}\n\n\nclass ExpressionImportlibMetadataSelectableGroupsValueRef(\n    ExpressionMakeDictMixin, ExpressionImportlibMetadataSelectableGroupsValueRefBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_SELECTABLE_GROUPS_VALUE_REF\"\n\n    python_version_spec = \">= 0x3a0\"\n\n    named_children = (\"pairs|tuple\",)\n\n    auto_compute_handling = \"final,no_raise\"\n\n    # TODO: Derived from dict shape is missing here.\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionImportlibMetadataBackportSelectableGroupsValueRef(\n    ExpressionMakeDictMixin,\n    ExpressionImportlibMetadataBackportSelectableGroupsValueRefBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_SELECTABLE_GROUPS_VALUE_REF\"\n\n    named_children = (\"pairs|tuple\",)\n\n    auto_compute_handling = \"final,no_raise\"\n\n    # TODO: Derived from dict shape is missing here.\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionImportlibMetadataEntryPointsValueRef(\n    ExpressionMakeSequenceMixin,\n    ExpressionImportlibMetadataBackportEntryPointsValueRefBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_VALUE_REF\"\n\n    python_version_spec = \">= 0x3a0\"\n\n    named_children = (\"elements|tuple\",)\n\n    auto_compute_handling = \"final,no_raise\"\n\n    # TODO: Derived from dict shape is missing here.\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n    @staticmethod\n    def getSequenceName():\n        \"\"\"Get name for use in traces\"\"\"\n        return \"importlib.metadata.EntryPoints\"\n\n\nclass ExpressionImportlibMetadataBackportEntryPointsValueRef(\n    ExpressionMakeSequenceMixin, ExpressionImportlibMetadataEntryPointsValueRefBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_VALUE_REF\"\n\n    named_children = (\"elements|tuple\",)\n\n    auto_compute_handling = \"final,no_raise\"\n\n    @staticmethod\n    def getSequenceName():\n        \"\"\"Get name for use in traces\"\"\"\n        return \"importlib_metadata.EntryPoints\"\n\n    # TODO: Derived from dict shape is missing here.\n    @staticmethod\n    def isKnownToBeHashable():\n        return False\n\n\nclass ExpressionImportlibMetadataEntryPointsCallMixin(object):\n    __slots__ = ()\n\n    def _getImportlibMetadataModule(self):\n        return importFromCompileTime(self.importlib_metadata_name, must_exist=True)\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        metadata_importlib = self._getImportlibMetadataModule()\n\n        constant_args = dict(\n            (param.getKeyCompileTimeConstant(), param.getValueCompileTimeConstant())\n            for param in self.subnode_params\n        )\n\n        try:\n            entry_points_result = metadata_importlib.entry_points(**constant_args)\n        except Exception as e:  # Catch all the things, pylint: disable=broad-except\n            inclusion_logger.sysexit(\n                \"Error, failed to find entrypoints at '%s' due to unhandled %s. Please report this bug.\"\n                % (self.source_ref.getAsString(), repr(e))\n            )\n        else:\n            if (\n                hasattr(metadata_importlib, \"SelectableGroups\")\n                and type(entry_points_result) is metadata_importlib.SelectableGroups\n            ):\n                pairs = [\n                    makeExpressionKeyValuePairConstantKey(\n                        key=key,\n                        value=self.makeEntryPointsValueRef(\n                            elements=tuple(\n                                self.makeEntryPointValueRef(\n                                    entry_point=entry_point, source_ref=self.source_ref\n                                )\n                                for entry_point in value\n                            ),\n                            source_ref=self.source_ref,\n                        ),\n                    )\n                    for key, value in entry_points_result.items()\n                ]\n\n                result = self.makeSelectableGroupsValueRef(\n                    pairs=tuple(pairs), source_ref=self.source_ref\n                )\n            elif type(entry_points_result) is dict:\n                pairs = [\n                    makeExpressionKeyValuePairConstantKey(\n                        key=key,\n                        value=makeExpressionMakeTuple(\n                            elements=tuple(\n                                self.makeEntryPointValueRef(\n                                    entry_point=entry_point, source_ref=self.source_ref\n                                )\n                                for entry_point in value\n                            ),\n                            source_ref=self.source_ref,\n                        ),\n                    )\n                    for key, value in entry_points_result.items()\n                ]\n\n                result = makeExpressionMakeDict(\n                    pairs=tuple(pairs), source_ref=self.source_ref\n                )\n            elif (\n                hasattr(metadata_importlib, \"EntryPoints\")\n                and type(entry_points_result) is metadata_importlib.EntryPoints\n            ):\n                result = self.makeEntryPointsValueRef(\n                    elements=tuple(\n                        self.makeEntryPointValueRef(\n                            entry_point=entry_point, source_ref=self.source_ref\n                        )\n                        for entry_point in entry_points_result\n                    ),\n                    source_ref=self.source_ref,\n                )\n\n            else:\n                assert False, type(entry_points_result)\n\n            return (\n                result,\n                \"new_expression\",\n                \"Compile time predicted '%s' result\" % self.importlib_metadata_name,\n            )\n\n\nclass ExpressionImportlibMetadataEntryPointsBefore310Call(\n    ExpressionImportlibMetadataEntryPointsCallMixin,\n    ExpressionImportlibMetadataEntryPointsBefore310CallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_BEFORE310_CALL\"\n\n    # TODO: How to be sure, this is picked up on top of base class python\n    # version spec\n    python_version_spec = \">= 0x380\"\n\n    importlib_metadata_name = \"importlib.metadata\"\n\n    makeEntryPointValueRef = ExpressionImportlibMetadataEntryPointValueRef\n\n    # For the mixing to work properly.\n    subnode_params = ()\n\n\ndef makeExpressionImportlibMetadataEntryPointsSince310Call(params, source_ref):\n    return ExpressionImportlibMetadataEntryPointsSince310Call(\n        params=makeKeyValuePairExpressionsFromKwArgs(params), source_ref=source_ref\n    )\n\n\nclass ExpressionImportlibMetadataEntryPointsSince310Call(\n    ExpressionImportlibMetadataEntryPointsCallMixin,\n    ExpressionImportlibMetadataEntryPointsSince310CallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_SINCE310_CALL\"\n\n    importlib_metadata_name = \"importlib.metadata\"\n\n    makeEntryPointsValueRef = ExpressionImportlibMetadataEntryPointsValueRef\n    makeEntryPointValueRef = ExpressionImportlibMetadataEntryPointValueRef\n    makeSelectableGroupsValueRef = ExpressionImportlibMetadataSelectableGroupsValueRef\n\n\ndef makeExpressionImportlibMetadataBackportEntryPointsCall(params, source_ref):\n    return ExpressionImportlibMetadataBackportEntryPointsCall(\n        params=makeKeyValuePairExpressionsFromKwArgs(params), source_ref=source_ref\n    )\n\n\nclass ExpressionImportlibMetadataBackportEntryPointsCall(\n    ExpressionImportlibMetadataEntryPointsCallMixin,\n    ExpressionImportlibMetadataBackportEntryPointsCallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_CALL\"\n\n    importlib_metadata_name = \"importlib_metadata\"\n\n    makeEntryPointsValueRef = ExpressionImportlibMetadataBackportEntryPointsValueRef\n    makeEntryPointValueRef = ExpressionImportlibMetadataBackportEntryPointValueRef\n    makeSelectableGroupsValueRef = (\n        ExpressionImportlibMetadataBackportSelectableGroupsValueRef\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/PackageResourceNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes the represent ways to access package data for pkglib, pkg_resources, etc. \"\"\"\n\nfrom nuitka.importing.Importing import locateModule, makeModuleUsageAttempt\nfrom nuitka.importing.ImportResolving import resolveModuleName\nfrom nuitka.utils.Importing import importFromCompileTime\n\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import (\n    ExpressionBytesShapeExactMixin,\n    ExpressionStrShapeExactMixin,\n)\nfrom .HardImportNodesGenerated import (\n    ExpressionImportlibResourcesBackportFilesCallBase,\n    ExpressionImportlibResourcesBackportReadBinaryCallBase,\n    ExpressionImportlibResourcesBackportReadTextCallBase,\n    ExpressionImportlibResourcesFilesCallBase,\n    ExpressionImportlibResourcesReadBinaryCallBase,\n    ExpressionImportlibResourcesReadTextCallBase,\n    ExpressionPkgResourcesResourceStreamCallBase,\n    ExpressionPkgResourcesResourceStringCallBase,\n    ExpressionPkgutilGetDataCallBase,\n)\nfrom .NodeBases import SideEffectsFromChildrenMixin\n\n\nclass ExpressionPkgutilGetDataCall(\n    (\n        ExpressionBytesShapeExactMixin\n        if str is not bytes\n        else ExpressionStrShapeExactMixin\n    ),\n    SideEffectsFromChildrenMixin,\n    ExpressionPkgutilGetDataCallBase,\n):\n    kind = \"EXPRESSION_PKGUTIL_GET_DATA_CALL\"\n\n    named_children = (\"package\", \"resource\")\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionPkgResourcesResourceStringCall(\n    (\n        ExpressionBytesShapeExactMixin\n        if str is not bytes\n        else ExpressionStrShapeExactMixin\n    ),\n    SideEffectsFromChildrenMixin,\n    ExpressionPkgResourcesResourceStringCallBase,\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_RESOURCE_STRING_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionPkgResourcesResourceStreamCall(\n    ExpressionPkgResourcesResourceStreamCallBase\n):\n    kind = \"EXPRESSION_PKG_RESOURCES_RESOURCE_STREAM_CALL\"\n\n    def __init__(self, package_or_requirement, resource_name, source_ref):\n        ExpressionPkgResourcesResourceStreamCallBase.__init__(\n            self,\n            package_or_requirement=package_or_requirement,\n            resource_name=resource_name,\n            source_ref=source_ref,\n        )\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesReadBinaryCall(\n    SideEffectsFromChildrenMixin,\n    ExpressionImportlibResourcesReadBinaryCallBase,\n):\n    \"\"\"Call to \"importlib.resources.read_binary\" \"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_READ_BINARY_CALL\"\n\n    python_version_spec = \">= 0x370\"\n\n    def __init__(self, package, resource, source_ref):\n        ExpressionImportlibResourcesReadBinaryCallBase.__init__(\n            self,\n            package=package,\n            resource=resource,\n            source_ref=source_ref,\n        )\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesBackportReadBinaryCall(\n    SideEffectsFromChildrenMixin,\n    ExpressionImportlibResourcesBackportReadBinaryCallBase,\n):\n    \"\"\"Call to \"importlib.resources.read_binary\" \"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_BINARY_CALL\"\n\n    def __init__(self, package, resource, source_ref):\n        ExpressionImportlibResourcesBackportReadBinaryCallBase.__init__(\n            self,\n            package=package,\n            resource=resource,\n            source_ref=source_ref,\n        )\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeExpressionImportlibResourcesReadTextCall(\n    package, resource, encoding, errors, source_ref\n):\n    # Avoid making things optional.\n    if encoding is None:\n        encoding = makeConstantRefNode(constant=\"utf-8\", source_ref=source_ref)\n    if errors is None:\n        errors = makeConstantRefNode(constant=\"strict\", source_ref=source_ref)\n\n    return ExpressionImportlibResourcesReadTextCall(\n        package=package,\n        resource=resource,\n        encoding=encoding,\n        errors=errors,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionImportlibResourcesReadTextCall(\n    SideEffectsFromChildrenMixin,\n    ExpressionImportlibResourcesReadTextCallBase,\n):\n    \"\"\"Call to \"importlib.resources.read_text\" \"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_READ_TEXT_CALL\"\n\n    python_version_spec = \">= 0x370\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeExpressionImportlibResourcesBackportReadTextCall(\n    package, resource, encoding, errors, source_ref\n):\n    # Avoid making things optional.\n    if encoding is None:\n        encoding = makeConstantRefNode(constant=\"utf-8\", source_ref=source_ref)\n    if errors is None:\n        errors = makeConstantRefNode(constant=\"strict\", source_ref=source_ref)\n\n    return ExpressionImportlibResourcesBackportReadTextCall(\n        package=package,\n        resource=resource,\n        encoding=encoding,\n        errors=errors,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionImportlibResourcesBackportReadTextCall(\n    SideEffectsFromChildrenMixin,\n    ExpressionImportlibResourcesBackportReadTextCallBase,\n):\n    \"\"\"Call to \"importlib_resources.read_text\" \"\"\"\n\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_TEXT_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesFilesCallMixin:\n    __slots__ = ()\n\n    def _getImportlibResourcesModule(self):\n        return importFromCompileTime(self.importlib_resources_name, must_exist=True)\n\n    # TODO: Looks as if this could be a convenience function of more general use.\n    def makeModuleUsageAttempt(self, package_name):\n        _package_name, module_filename, module_kind, finding = locateModule(\n            module_name=package_name,\n            parent_package=None,\n            level=0,\n        )\n\n        return makeModuleUsageAttempt(\n            module_name=package_name,\n            filename=module_filename,\n            module_kind=module_kind,\n            finding=finding,\n            level=0,\n            source_ref=self.source_ref,\n            reason=\"%s.files call\" % self.importlib_resources_name,\n        )\n\n    # TODO: In standalone mode we could know a lot better.\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n    # Only for the not fixed ones.\n    def replaceWithCompileTimeValue(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        package_name = self.subnode_package.getCompileTimeConstant()\n\n        if type(package_name) is str:\n            package_name = resolveModuleName(package_name)\n            trace_collection.onModuleUsageAttempt(\n                self.makeModuleUsageAttempt(package_name)\n            )\n\n            result = self.makeImportlibResourcesFilesCallFixedExpression(\n                package_name=package_name, source_ref=self.source_ref\n            )\n\n            return (\n                result,\n                \"new_expression\",\n                \"Detected '%s.files' with constant package name '%s'.\"\n                % (self.importlib_resources_name, package_name),\n            )\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesFilesCallFixed(\n    ExpressionImportlibResourcesFilesCallMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_CALL_FIXED\"\n    python_version_spec = \">= 0x370\"\n    importlib_resources_name = \"importlib.resources\"\n\n    __slots__ = (\n        \"package_name\",\n        \"module_usage_attempt\",\n    )\n\n    def __init__(self, package_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.package_name = resolveModuleName(package_name)\n\n        self.module_usage_attempt = self.makeModuleUsageAttempt(\n            package_name=package_name\n        )\n\n    def finalize(self):\n        del self.module_usage_attempt\n\n    def getPackageNameUsed(self):\n        return makeConstantRefNode(\n            constant=self.package_name.asString(), source_ref=self.source_ref\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        trace_collection.onModuleUsageAttempt(self.module_usage_attempt)\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesBackportFilesCallFixed(\n    ExpressionImportlibResourcesFilesCallMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_CALL_FIXED\"\n    importlib_resources_name = \"importlib_resources\"\n\n    __slots__ = (\n        \"package_name\",\n        \"module_usage_attempt\",\n    )\n\n    def __init__(self, package_name, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.package_name = resolveModuleName(package_name)\n\n        self.module_usage_attempt = self.makeModuleUsageAttempt(\n            package_name=package_name\n        )\n\n    def finalize(self):\n        del self.module_usage_attempt\n\n    def getPackageNameUsed(self):\n        return makeConstantRefNode(\n            constant=self.package_name.asString(), source_ref=self.source_ref\n        )\n\n    def computeExpressionRaw(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        trace_collection.onModuleUsageAttempt(self.module_usage_attempt)\n\n        return self, None, None\n\n\nclass ExpressionImportlibResourcesFilesCall(\n    ExpressionImportlibResourcesFilesCallMixin,\n    ExpressionImportlibResourcesFilesCallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_FILES_CALL\"\n    python_version_spec = \">= 0x370\"\n    importlib_resources_name = \"importlib.resources\"\n    makeImportlibResourcesFilesCallFixedExpression = (\n        ExpressionImportlibResourcesFilesCallFixed\n    )\n\n    named_children = (\"package\",)\n\n    __slots__ = (\"module_usage_attempt\",)\n\n    def __init__(self, package, source_ref):\n        ExpressionImportlibResourcesFilesCallBase.__init__(\n            self, package=package, source_ref=source_ref\n        )\n\n        self.module_usage_attempt = None\n\n    def getPackageNameUsed(self):\n        return self.subnode_package\n\n\nclass ExpressionImportlibResourcesBackportFilesCall(\n    ExpressionImportlibResourcesFilesCallMixin,\n    ExpressionImportlibResourcesBackportFilesCallBase,\n):\n    kind = \"EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_CALL\"\n    importlib_resources_name = \"importlib_resources\"\n    makeImportlibResourcesFilesCallFixedExpression = (\n        ExpressionImportlibResourcesBackportFilesCallFixed\n    )\n\n    named_children = (\"package\",)\n\n    __slots__ = (\"module_usage_attempt\",)\n\n    def __init__(self, package, source_ref):\n        ExpressionImportlibResourcesBackportFilesCallBase.__init__(\n            self, package=package, source_ref=source_ref\n        )\n\n        self.module_usage_attempt = None\n\n    def getPackageNameUsed(self):\n        return self.subnode_package\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/PrintNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Print nodes.\n\nRight now there is only the print statement, but in principle, there should\nalso be the print function here. These perform output, which can be combined\nif possible, and could be detected to fail, which would be perfect.\n\nPredicting the behavior of 'print' is not trivial at all, due to many special\ncases.\n\"\"\"\n\nfrom .NodeMakingHelpers import (\n    makeStatementExpressionOnlyReplacementNode,\n    makeStatementsSequenceReplacementNode,\n)\nfrom .StatementBasesGenerated import (\n    StatementPrintNewlineBase,\n    StatementPrintValueBase,\n)\n\n\nclass StatementPrintValue(StatementPrintValueBase):\n    kind = \"STATEMENT_PRINT_VALUE\"\n\n    named_children = (\"dest|optional\", \"value|setter\")\n    auto_compute_handling = \"operation\"\n\n    python_version_spec = \"< 0x300\"\n\n    def computeStatementOperation(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        if self.subnode_dest is None and self.subnode_value.isExpressionSideEffects():\n            self.setChildValue(self.subnode_value.value.subnode_expression)\n\n            statements = [\n                makeStatementExpressionOnlyReplacementNode(side_effect, self)\n                for side_effect in self.subnode_value.value.subnode_side_effects\n            ]\n\n            statements.append(self)\n\n            result = makeStatementsSequenceReplacementNode(\n                statements=statements, node=self\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"\"\"\\\nSide effects printed item promoted to statements.\"\"\",\n            )\n\n        if (\n            self.subnode_value.isCompileTimeConstant()\n            and not self.subnode_value.hasShapeStrOrUnicodeExact()\n        ):\n            # Avoid unicode encoding issues.\n            new_value = self.subnode_value.getStrValue()\n            assert new_value is not None, self.subnode_value\n\n            self.setChildValue(new_value)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # Output may always fail due to external reasons.\n        return True\n\n\nclass StatementPrintNewline(StatementPrintNewlineBase):\n    kind = \"STATEMENT_PRINT_NEWLINE\"\n\n    named_children = (\"dest|optional\",)\n    python_version_spec = \"< 0x300\"\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # Output may always fail due to external reasons.\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/ReturnNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Return node\n\nThis one exits functions. The only other exit is the default exit of functions with 'None' value, if no return is done.\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom .NodeBases import StatementBase\nfrom .StatementBasesGenerated import StatementReturnBase\n\n\nclass StatementReturnMixin(object):\n    __slots__ = ()\n\n    @staticmethod\n    def isStatementReturn():\n        return True\n\n    @staticmethod\n    def mayReturn():\n        return True\n\n    @staticmethod\n    def isStatementAborting():\n        return True\n\n\nclass StatementReturn(StatementReturnMixin, StatementReturnBase):\n    kind = \"STATEMENT_RETURN\"\n\n    named_children = (\"expression\",)\n    nice_children = (\"return value\",)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n    def computeStatement(self, trace_collection):\n        # This happens so many times, until we also do \"trace_collection.onFunctionReturn()\" injection, and\n        # can wait for constant values from \"operation\", we do not use it yet.\n        expression = trace_collection.onExpression(self.subnode_expression)\n\n        if expression.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if expression.willRaiseAnyException():\n            from .NodeMakingHelpers import (\n                makeStatementExpressionOnlyReplacementNode,\n            )\n\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=expression, node=self\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nReturn statement raises in returned expression, removed return.\"\"\",\n            )\n\n        trace_collection.onFunctionReturn()\n\n        if expression.isExpressionConstantRef():\n            result = makeStatementReturnConstant(\n                constant=expression.getCompileTimeConstant(), source_ref=self.source_ref\n            )\n\n            del self.parent\n\n            return (\n                result,\n                \"new_statements\",\n                \"\"\"\\\nReturn value is constant.\"\"\",\n            )\n\n        return self, None, None\n\n\nclass StatementReturnConstantBase(StatementReturnMixin, StatementBase):\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n    @staticmethod\n    def isStatementReturnConstant():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def computeStatement(self, trace_collection):\n        trace_collection.onFunctionReturn()\n\n        return self, None, None\n\n    @abstractmethod\n    def getConstant(self):\n        \"\"\"The returned constant value.\"\"\"\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"return statement\"\n\n\nclass StatementReturnNone(StatementReturnConstantBase):\n    kind = \"STATEMENT_RETURN_NONE\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementReturnConstantBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    def getConstant(self):\n        return None\n\n\nclass StatementReturnFalse(StatementReturnConstantBase):\n    kind = \"STATEMENT_RETURN_FALSE\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementReturnConstantBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    def getConstant(self):\n        return False\n\n\nclass StatementReturnTrue(StatementReturnConstantBase):\n    kind = \"STATEMENT_RETURN_TRUE\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementReturnConstantBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    def getConstant(self):\n        return True\n\n\nclass StatementReturnConstant(StatementReturnConstantBase):\n    kind = \"STATEMENT_RETURN_CONSTANT\"\n\n    __slots__ = (\"constant\",)\n\n    def __init__(self, constant, source_ref):\n        StatementReturnConstantBase.__init__(self, source_ref=source_ref)\n\n        self.constant = constant\n\n    def finalize(self):\n        del self.parent\n        del self.constant\n\n    def getConstant(self):\n        return self.constant\n\n    def getDetails(self):\n        return {\"constant\": self.constant}\n\n\nclass StatementReturnReturnedValue(StatementBase):\n    kind = \"STATEMENT_RETURN_RETURNED_VALUE\"\n\n    __slots__ = ()\n\n    def __init__(self, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    @staticmethod\n    def isStatementReturnReturnedValue():\n        return True\n\n    @staticmethod\n    def isStatementReturn():\n        return True\n\n    @staticmethod\n    def isStatementAborting():\n        return True\n\n    @staticmethod\n    def mayReturn():\n        return True\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    def computeStatement(self, trace_collection):\n        trace_collection.onFunctionReturn()\n\n        return self, None, None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"rereturn statement\"\n\n\ndef makeStatementReturnConstant(constant, source_ref):\n    if constant is None:\n        return StatementReturnNone(source_ref=source_ref)\n    elif constant is True:\n        return StatementReturnTrue(source_ref=source_ref)\n    elif constant is False:\n        return StatementReturnFalse(source_ref=source_ref)\n    else:\n        return StatementReturnConstant(constant=constant, source_ref=source_ref)\n\n\ndef makeStatementReturn(expression, source_ref):\n    \"\"\"Create the best return statement variant.\"\"\"\n\n    if expression is None:\n        return StatementReturnNone(source_ref=source_ref)\n    elif expression.isCompileTimeConstant():\n        return makeStatementReturnConstant(\n            constant=expression.getCompileTimeConstant(), source_ref=source_ref\n        )\n    else:\n        return StatementReturn(expression=expression, source_ref=source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/SideEffectNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node that models side effects.\n\nSometimes, the effect of an expression needs to be had, but the value itself\ndoes not matter at all.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildrenHavingSideEffectsTupleExpressionMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .NodeMakingHelpers import makeStatementOnlyNodesFromExpressions\n\n\nclass ExpressionSideEffects(\n    ChildrenHavingSideEffectsTupleExpressionMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_SIDE_EFFECTS\"\n\n    named_children = (\"side_effects|tuple+setter\", \"expression|setter\")\n\n    def __init__(self, side_effects, expression, source_ref):\n        ChildrenHavingSideEffectsTupleExpressionMixin.__init__(\n            self, side_effects=side_effects, expression=expression\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    @staticmethod\n    def isExpressionSideEffects():\n        return True\n\n    def getTypeShape(self):\n        return self.subnode_expression.getTypeShape()\n\n    def computeExpressionRaw(self, trace_collection):\n        new_side_effects = []\n\n        side_effects = self.subnode_side_effects\n\n        for count, side_effect in enumerate(side_effects):\n            side_effect = trace_collection.onExpression(side_effect)\n\n            if side_effect.willRaiseAnyException():\n                for c in side_effects[count + 1 :]:\n                    c.finalize()\n\n                if new_side_effects:\n                    expression = self.subnode_expression\n                    expression.finalize()\n\n                    self.setChildExpression(side_effect)\n\n                    return (\n                        self,\n                        \"new_expression\",\n                        \"Side effects caused exception raise.\",\n                    )\n                else:\n                    del self.parent\n                    del self.subnode_side_effects\n\n                    return (\n                        side_effect,\n                        \"new_expression\",\n                        \"Side effects caused exception raise.\",\n                    )\n\n            if side_effect.isExpressionSideEffects():\n                new_side_effects.extend(side_effect.subnode_side_effects)\n\n                del side_effect.parent\n                del side_effect.subnode_side_effects\n            elif side_effect is not None and side_effect.mayHaveSideEffects():\n                new_side_effects.append(side_effect)\n\n        self.setChildSideEffects(tuple(new_side_effects))\n\n        trace_collection.onExpression(self.subnode_expression)\n\n        if not new_side_effects:\n            return (\n                self.subnode_expression,\n                \"new_expression\",\n                \"Removed now empty side effects.\",\n            )\n\n        return self, None, None\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n    def getTruthValue(self):\n        return self.subnode_expression.getTruthValue()\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type) or any(\n            side_effect.mayRaiseException(exception_type)\n            for side_effect in self.subnode_side_effects\n        )\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        # Side effects can  become statements.\n\n        expressions = self.subnode_side_effects + (self.subnode_expression,)\n\n        result = makeStatementOnlyNodesFromExpressions(expressions=expressions)\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nTurned side effects of expression only statement into statements.\"\"\",\n        )\n\n    @staticmethod\n    def canPredictIterationValues():\n        # TODO: Actually we could very well ask the expression, but retaining the side\n        # effects in optimization is not yet guaranteed.\n        return False\n\n    def willRaiseAnyException(self):\n        return self.subnode_expression.willRaiseAnyException()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/SliceNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Slice nodes.\n\nSlices are important when working with lists. Tracking them can allow to\nachieve more compact code, or predict results at compile time.\n\nThere will be a method \"computeExpressionSlice\" to aid predicting them.\n\"\"\"\n\nfrom nuitka.specs import BuiltinParameterSpecs\n\nfrom .ChildrenHavingMixins import (\n    ChildHavingStopMixin,\n    ChildrenHavingExpressionLowerAutoNoneUpperAutoNoneMixin,\n    ChildrenHavingStartStopMixin,\n    ChildrenHavingStartStopStepMixin,\n)\nfrom .ConstantRefNodes import ExpressionConstantNoneRef, makeConstantRefNode\nfrom .ExpressionBases import (\n    ExpressionBase,\n    ExpressionSpecBasedComputationNoRaiseMixin,\n)\nfrom .ExpressionShapeMixins import ExpressionSliceShapeExactMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import (\n    makeStatementExpressionOnlyReplacementNode,\n    makeStatementOnlyNodesFromExpressions,\n    wrapExpressionWithSideEffects,\n)\nfrom .StatementBasesGenerated import (\n    StatementAssignmentSliceBase,\n    StatementDelSliceBase,\n)\n\n\nclass StatementAssignmentSlice(StatementAssignmentSliceBase):\n    kind = \"STATEMENT_ASSIGNMENT_SLICE\"\n\n    named_children = (\"source\", \"expression\", \"lower|optional\", \"upper|optional\")\n\n    python_version_spec = \"< 0x300\"\n\n    def computeStatement(self, trace_collection):\n        source = trace_collection.onExpression(self.subnode_source)\n\n        # No assignment will occur, if the assignment source raises, so strip it\n        # away.\n        if source.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=source, node=self\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nSlice assignment raises exception in assigned value, removed assignment.\"\"\",\n            )\n\n        lookup_source = trace_collection.onExpression(self.subnode_expression)\n\n        if lookup_source.willRaiseAnyException():\n            result = makeStatementOnlyNodesFromExpressions(\n                expressions=(source, lookup_source)\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nSlice assignment raises exception in sliced value, removed assignment.\"\"\",\n            )\n\n        lower = trace_collection.onExpression(self.subnode_lower, allow_none=True)\n\n        if lower is not None and lower.willRaiseAnyException():\n            result = makeStatementOnlyNodesFromExpressions(\n                expressions=(source, lookup_source, lower)\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nSlice assignment raises exception in lower slice boundary value, removed \\\nassignment.\"\"\",\n            )\n\n        upper = trace_collection.onExpression(self.subnode_upper, allow_none=True)\n\n        if upper is not None and upper.willRaiseAnyException():\n            result = makeStatementOnlyNodesFromExpressions(\n                expressions=(source, lookup_source, lower, upper)\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nSlice assignment raises exception in upper slice boundary value, removed \\\nassignment.\"\"\",\n            )\n\n        return lookup_source.computeExpressionSetSlice(\n            set_node=self,\n            lower=lower,\n            upper=upper,\n            value_node=source,\n            trace_collection=trace_collection,\n        )\n\n\nclass StatementDelSlice(StatementDelSliceBase):\n    kind = \"STATEMENT_DEL_SLICE\"\n\n    named_children = (\"expression\", \"lower|optional\", \"upper|optional\")\n\n    def computeStatement(self, trace_collection):\n        lookup_source = trace_collection.onExpression(self.subnode_expression)\n\n        if lookup_source.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=lookup_source, node=self\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nSlice del raises exception in sliced value, removed del\"\"\",\n            )\n\n        lower = trace_collection.onExpression(self.subnode_lower, allow_none=True)\n\n        if lower is not None and lower.willRaiseAnyException():\n            result = makeStatementOnlyNodesFromExpressions(\n                expressions=(lookup_source, lower)\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\nSlice del raises exception in lower slice boundary value, removed del\"\"\",\n            )\n\n        trace_collection.onExpression(self.subnode_upper, allow_none=True)\n        upper = self.subnode_upper\n\n        if upper is not None and upper.willRaiseAnyException():\n            result = makeStatementOnlyNodesFromExpressions(\n                expressions=(lookup_source, lower, upper)\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\nSlice del raises exception in upper slice boundary value, removed del\"\"\",\n            )\n\n        return lookup_source.computeExpressionDelSlice(\n            set_node=self, lower=lower, upper=upper, trace_collection=trace_collection\n        )\n\n\nclass ExpressionSliceLookup(\n    ChildrenHavingExpressionLowerAutoNoneUpperAutoNoneMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_SLICE_LOOKUP\"\n\n    python_version_spec = \"< 0x300\"\n\n    named_children = (\"expression\", \"lower|auto_none\", \"upper|auto_none\")\n\n    def __init__(self, expression, lower, upper, source_ref):\n        ChildrenHavingExpressionLowerAutoNoneUpperAutoNoneMixin.__init__(\n            self,\n            expression=expression,\n            lower=lower,\n            upper=upper,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        lookup_source = self.subnode_expression\n\n        return lookup_source.computeExpressionSlice(\n            lookup_node=self,\n            lower=self.subnode_lower,\n            upper=self.subnode_upper,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        # TODO: Should ask SliceRegistry\n        return None\n\n\ndef makeExpressionBuiltinSlice(start, stop, step, source_ref):\n    if (\n        (start is None or start.isCompileTimeConstant())\n        and (stop is None or stop.isCompileTimeConstant())\n        and (step is None or step.isCompileTimeConstant())\n    ):\n        # Avoid going slices for what is effectively constant.\n\n        start_value = None if start is None else start.getCompileTimeConstant()\n        stop_value = None if stop is None else stop.getCompileTimeConstant()\n        step_value = None if step is None else step.getCompileTimeConstant()\n\n        return makeConstantRefNode(\n            constant=slice(start_value, stop_value, step_value), source_ref=source_ref\n        )\n\n    if start is None and step is None:\n        return ExpressionBuiltinSlice1(stop=stop, source_ref=source_ref)\n\n    if start is None:\n        start = ExpressionConstantNoneRef(source_ref=source_ref)\n    if stop is None:\n        stop = ExpressionConstantNoneRef(source_ref=source_ref)\n\n    if step is None:\n        return ExpressionBuiltinSlice2(start=start, stop=stop, source_ref=source_ref)\n\n    return ExpressionBuiltinSlice3(\n        start=start, stop=stop, step=step, source_ref=source_ref\n    )\n\n\nclass ExpressionBuiltinSliceMixin(\n    ExpressionSliceShapeExactMixin, SideEffectsFromChildrenMixin\n):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    builtin_spec = BuiltinParameterSpecs.builtin_slice_spec\n\n    # We use SideEffectsFromChildrenMixin for the other things.\n    def mayHaveSideEffects(self):\n        return self.mayRaiseException(BaseException)\n\n\nclass ExpressionBuiltinSlice3(\n    ExpressionBuiltinSliceMixin,\n    ExpressionSpecBasedComputationNoRaiseMixin,\n    ChildrenHavingStartStopStepMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_SLICE3\"\n\n    named_children = (\"start\", \"stop\", \"step\")\n\n    def __init__(self, start, stop, step, source_ref):\n        ChildrenHavingStartStopStepMixin.__init__(\n            self,\n            start=start,\n            stop=stop,\n            step=step,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            self.subnode_step.isExpressionConstantNoneRef()\n            or self.subnode_step.getIndexValue() == 1\n        ):\n            return trace_collection.computedExpressionResult(\n                wrapExpressionWithSideEffects(\n                    old_node=self,\n                    new_node=ExpressionBuiltinSlice2(\n                        start=self.subnode_start,\n                        stop=self.subnode_stop,\n                        source_ref=self.source_ref,\n                    ),\n                    side_effects=self.subnode_step.extractSideEffects(),\n                ),\n                \"new_expression\",\n                \"Reduce 3 argument slice object creation to two argument form.\",\n            )\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection,\n            given_values=(self.subnode_start, self.subnode_stop, self.subnode_step),\n        )\n\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_start.mayRaiseException(exception_type)\n            or self.subnode_stop.mayRaiseException(exception_type)\n            or self.subnode_step.mayRaiseException(exception_type)\n        )\n\n\nclass ExpressionBuiltinSlice2(\n    ExpressionBuiltinSliceMixin,\n    ExpressionSpecBasedComputationNoRaiseMixin,\n    ChildrenHavingStartStopMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_SLICE2\"\n\n    named_children = (\"start\", \"stop\")\n\n    def __init__(self, start, stop, source_ref):\n        ChildrenHavingStartStopMixin.__init__(\n            self,\n            start=start,\n            stop=stop,\n        )\n\n        ExpressionBase.__init__(\n            self,\n            source_ref,\n        )\n\n    def computeExpression(self, trace_collection):\n        if self.subnode_start.isExpressionConstantNoneRef():\n            return trace_collection.computedExpressionResult(\n                wrapExpressionWithSideEffects(\n                    old_node=self,\n                    new_node=ExpressionBuiltinSlice1(\n                        stop=self.subnode_stop, source_ref=self.source_ref\n                    ),\n                    side_effects=self.subnode_start.extractSideEffects(),\n                ),\n                \"new_expression\",\n                \"Reduce 2 argument slice object creation to single argument form.\",\n            )\n\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection,\n            given_values=(self.subnode_start, self.subnode_stop),\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_start.mayRaiseException(\n            exception_type\n        ) or self.subnode_stop.mayRaiseException(exception_type)\n\n\nclass ExpressionBuiltinSlice1(\n    ExpressionBuiltinSliceMixin,\n    ExpressionSpecBasedComputationNoRaiseMixin,\n    ChildHavingStopMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_BUILTIN_SLICE1\"\n\n    named_children = (\"stop\",)\n\n    def __init__(self, stop, source_ref):\n        ChildHavingStopMixin.__init__(self, stop=stop)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        return self.computeBuiltinSpec(\n            trace_collection=trace_collection,\n            given_values=(self.subnode_stop,),\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_stop.mayRaiseException(exception_type)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/StatementBasesGenerated.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\n\n\"\"\"Children having statement bases\n\nWARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!\n\nspell-checker: ignore __prepare__ append args autograph buffering capitalize casefold\nspell-checker: ignore center chars clear closefd copy count decode default delete dist\nspell-checker: ignore distribution_name encode encoding end endswith errors exit_code\nspell-checker: ignore expandtabs experimental_attributes experimental_autograph_options\nspell-checker: ignore experimental_compile experimental_follow_type_hints\nspell-checker: ignore experimental_implements experimental_relax_shapes extend file\nspell-checker: ignore fillchar find format format_map formatmap fromkeys func get group\nspell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha\nspell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable\nspell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys\nspell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower\nspell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package\nspell-checker: ignore package_or_requirement pairs partition path pop popitem prefix\nspell-checker: ignore prepare reduce_retracing remove replace resource resource_name\nspell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault\nspell-checker: ignore sort split splitlines start startswith stop strip sub suffix\nspell-checker: ignore swapcase table tabsize title translate update upper use_errno\nspell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width\nspell-checker: ignore winmode zfill\n\"\"\"\n\n\n# Loop unrolling over child names, pylint: disable=too-many-branches\n\nfrom abc import abstractmethod\n\nfrom .Checkers import (\n    checkStatementsSequence,\n    checkStatementsSequenceOrNone,\n    convertNoneConstantToNone,\n)\nfrom .NodeBases import StatementBase\n\n\nclass StatementNoChildHavingLocalsScopeMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementSetLocalsDictionary\n\n    def __init__(self, locals_scope, source_ref):\n        self.locals_scope = locals_scope\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return ()\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ()\n\n    def replaceChild(self, old_node, new_node):\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {}\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        del self.locals_scope\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n\n# Assign the names that are easier to import with a stable name.\nStatementSetLocalsDictionaryBase = StatementNoChildHavingLocalsScopeMixin\n\n\nclass StatementChildrenHavingConditionYesBranchOptionalStatementsOrNoneNoBranchOptionalStatementsOrNoneMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementConditional\n\n    def __init__(self, condition, yes_branch, no_branch, source_ref):\n        condition.parent = self\n\n        self.subnode_condition = condition\n\n        yes_branch = checkStatementsSequenceOrNone(yes_branch)\n        if yes_branch is not None:\n            yes_branch.parent = self\n\n        self.subnode_yes_branch = yes_branch\n\n        no_branch = checkStatementsSequenceOrNone(no_branch)\n        if no_branch is not None:\n            no_branch.parent = self\n\n        self.subnode_no_branch = no_branch\n\n        StatementBase.__init__(self, source_ref)\n\n    def setChildNoBranch(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_no_branch = value\n\n    def setChildYesBranch(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_yes_branch = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_condition)\n        value = self.subnode_yes_branch\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_no_branch\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"condition\", self.subnode_condition),\n            (\"yes_branch\", self.subnode_yes_branch),\n            (\"no_branch\", self.subnode_no_branch),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_condition\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_condition = new_node\n\n            return\n\n        value = self.subnode_yes_branch\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_yes_branch = new_node\n\n            return\n\n        value = self.subnode_no_branch\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_no_branch = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"condition\": self.subnode_condition.makeClone(),\n            \"yes_branch\": (\n                self.subnode_yes_branch.makeClone()\n                if self.subnode_yes_branch is not None\n                else None\n            ),\n            \"no_branch\": (\n                self.subnode_no_branch.makeClone()\n                if self.subnode_no_branch is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_condition.finalize()\n        del self.subnode_condition\n        if self.subnode_yes_branch is not None:\n            self.subnode_yes_branch.finalize()\n        del self.subnode_yes_branch\n        if self.subnode_no_branch is not None:\n            self.subnode_no_branch.finalize()\n        del self.subnode_no_branch\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_condition.collectVariableAccesses(emit_read, emit_write)\n        subnode_yes_branch = self.subnode_yes_branch\n\n        if subnode_yes_branch is not None:\n            self.subnode_yes_branch.collectVariableAccesses(emit_read, emit_write)\n        subnode_no_branch = self.subnode_no_branch\n\n        if subnode_no_branch is not None:\n            self.subnode_no_branch.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementConditionalBase = StatementChildrenHavingConditionYesBranchOptionalStatementsOrNoneNoBranchOptionalStatementsOrNoneMixin\n\n\nclass StatementChildHavingDestOptionalOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementPrintNewline\n\n    def __init__(self, dest, source_ref):\n        if dest is not None:\n            dest.parent = self\n\n        self.subnode_dest = dest\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_dest\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"dest\", self.subnode_dest),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dest\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_dest = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dest\": (\n                self.subnode_dest.makeClone() if self.subnode_dest is not None else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_dest is not None:\n            self.subnode_dest.finalize()\n        del self.subnode_dest\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_dest = self.subnode_dest\n\n        if subnode_dest is not None:\n            self.subnode_dest.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementPrintNewlineBase = StatementChildHavingDestOptionalOperationMixin\n\n\nclass StatementChildrenHavingDestOptionalValueOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementPrintValue\n\n    def __init__(self, dest, value, source_ref):\n        if dest is not None:\n            dest.parent = self\n\n        self.subnode_dest = dest\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        StatementBase.__init__(self, source_ref)\n\n    def setChildValue(self, value):\n        value.parent = self\n\n        self.subnode_value = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        value = self.subnode_dest\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        result.append(self.subnode_value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dest\", self.subnode_dest),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dest\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_dest = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dest\": (\n                self.subnode_dest.makeClone() if self.subnode_dest is not None else None\n            ),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_dest is not None:\n            self.subnode_dest.finalize()\n        del self.subnode_dest\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_dest = self.subnode_dest\n\n        if subnode_dest is not None:\n            self.subnode_dest.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementPrintValueBase = StatementChildrenHavingDestOptionalValueOperationMixin\n\n\nclass StatementChildrenHavingDictArgKeyOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDictOperationRemove\n\n    def __init__(self, dict_arg, key, source_ref):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        key.parent = self\n\n        self.subnode_key = key\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_dict_arg,\n            self.subnode_key,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"key\", self.subnode_key),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_key.finalize()\n        del self.subnode_key\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDictOperationRemoveBase = StatementChildrenHavingDictArgKeyOperationMixin\n\n\nclass StatementChildrenHavingDictArgValueOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDictOperationUpdate\n\n    def __init__(self, dict_arg, value, source_ref):\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_dict_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDictOperationUpdateBase = StatementChildrenHavingDictArgValueOperationMixin\n\n\nclass StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementRaiseException\n    #   StatementRaiseExceptionImplicit\n\n    def __init__(\n        self,\n        exception_type,\n        exception_value,\n        exception_trace,\n        exception_cause,\n        source_ref,\n    ):\n        exception_type.parent = self\n\n        self.subnode_exception_type = exception_type\n\n        if exception_value is not None:\n            exception_value.parent = self\n\n        self.subnode_exception_value = exception_value\n\n        if exception_trace is not None:\n            exception_trace.parent = self\n\n        self.subnode_exception_trace = exception_trace\n\n        if exception_cause is not None:\n            exception_cause.parent = self\n\n        self.subnode_exception_cause = exception_cause\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_exception_type)\n        value = self.subnode_exception_value\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_exception_trace\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_exception_cause\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"exception_type\", self.subnode_exception_type),\n            (\"exception_value\", self.subnode_exception_value),\n            (\"exception_trace\", self.subnode_exception_trace),\n            (\"exception_cause\", self.subnode_exception_cause),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_exception_type\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_exception_type = new_node\n\n            return\n\n        value = self.subnode_exception_value\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_exception_value = new_node\n\n            return\n\n        value = self.subnode_exception_trace\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_exception_trace = new_node\n\n            return\n\n        value = self.subnode_exception_cause\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_exception_cause = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"exception_type\": self.subnode_exception_type.makeClone(),\n            \"exception_value\": (\n                self.subnode_exception_value.makeClone()\n                if self.subnode_exception_value is not None\n                else None\n            ),\n            \"exception_trace\": (\n                self.subnode_exception_trace.makeClone()\n                if self.subnode_exception_trace is not None\n                else None\n            ),\n            \"exception_cause\": (\n                self.subnode_exception_cause.makeClone()\n                if self.subnode_exception_cause is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_exception_type.finalize()\n        del self.subnode_exception_type\n        if self.subnode_exception_value is not None:\n            self.subnode_exception_value.finalize()\n        del self.subnode_exception_value\n        if self.subnode_exception_trace is not None:\n            self.subnode_exception_trace.finalize()\n        del self.subnode_exception_trace\n        if self.subnode_exception_cause is not None:\n            self.subnode_exception_cause.finalize()\n        del self.subnode_exception_cause\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_exception_type.collectVariableAccesses(emit_read, emit_write)\n        subnode_exception_value = self.subnode_exception_value\n\n        if subnode_exception_value is not None:\n            self.subnode_exception_value.collectVariableAccesses(emit_read, emit_write)\n        subnode_exception_trace = self.subnode_exception_trace\n\n        if subnode_exception_trace is not None:\n            self.subnode_exception_trace.collectVariableAccesses(emit_read, emit_write)\n        subnode_exception_cause = self.subnode_exception_cause\n\n        if subnode_exception_cause is not None:\n            self.subnode_exception_cause.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementRaiseExceptionBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin\nStatementRaiseExceptionImplicitBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin\n\n\nclass StatementChildHavingExpressionOperationAttributeNameMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDelAttribute\n\n    def __init__(self, expression, attribute_name, source_ref):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        self.attribute_name = attribute_name\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"attribute_name\": self.attribute_name,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_expression,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"expression\", self.subnode_expression),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDelAttributeBase = StatementChildHavingExpressionOperationAttributeNameMixin\n\n\nclass StatementChildHavingExpressionMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementExpressionOnly\n    #   StatementGeneratorReturn\n    #   StatementReturn\n\n    def __init__(self, expression, source_ref):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_expression,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"expression\", self.subnode_expression),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementExpressionOnlyBase = StatementChildHavingExpressionMixin\nStatementGeneratorReturnBase = StatementChildHavingExpressionMixin\nStatementReturnBase = StatementChildHavingExpressionMixin\n\n\nclass StatementChildrenHavingExpressionLowerOptionalUpperOptionalMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDelSlice\n\n    def __init__(self, expression, lower, upper, source_ref):\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        if lower is not None:\n            lower.parent = self\n\n        self.subnode_lower = lower\n\n        if upper is not None:\n            upper.parent = self\n\n        self.subnode_upper = upper\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_expression)\n        value = self.subnode_lower\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_upper\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"expression\", self.subnode_expression),\n            (\"lower\", self.subnode_lower),\n            (\"upper\", self.subnode_upper),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_lower\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_lower = new_node\n\n            return\n\n        value = self.subnode_upper\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_upper = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"expression\": self.subnode_expression.makeClone(),\n            \"lower\": (\n                self.subnode_lower.makeClone()\n                if self.subnode_lower is not None\n                else None\n            ),\n            \"upper\": (\n                self.subnode_upper.makeClone()\n                if self.subnode_upper is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        if self.subnode_lower is not None:\n            self.subnode_lower.finalize()\n        del self.subnode_lower\n        if self.subnode_upper is not None:\n            self.subnode_upper.finalize()\n        del self.subnode_upper\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        subnode_lower = self.subnode_lower\n\n        if subnode_lower is not None:\n            self.subnode_lower.collectVariableAccesses(emit_read, emit_write)\n        subnode_upper = self.subnode_upper\n\n        if subnode_upper is not None:\n            self.subnode_upper.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDelSliceBase = StatementChildrenHavingExpressionLowerOptionalUpperOptionalMixin\n\n\nclass StatementChildHavingIteratedLengthOperationCountMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementSpecialUnpackCheckFromIterated\n\n    def __init__(self, iterated_length, count, source_ref):\n        iterated_length.parent = self\n\n        self.subnode_iterated_length = iterated_length\n\n        self.count = count\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"count\": self.count,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_iterated_length,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"iterated_length\", self.subnode_iterated_length),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_iterated_length\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterated_length = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"iterated_length\": self.subnode_iterated_length.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_iterated_length.finalize()\n        del self.subnode_iterated_length\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_iterated_length.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementSpecialUnpackCheckFromIteratedBase = (\n    StatementChildHavingIteratedLengthOperationCountMixin\n)\n\n\nclass StatementChildHavingIteratorOperationCountMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementSpecialUnpackCheck\n\n    def __init__(self, iterator, count, source_ref):\n        iterator.parent = self\n\n        self.subnode_iterator = iterator\n\n        self.count = count\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"count\": self.count,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_iterator,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"iterator\", self.subnode_iterator),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_iterator\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_iterator = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"iterator\": self.subnode_iterator.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_iterator.finalize()\n        del self.subnode_iterator\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_iterator.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementSpecialUnpackCheckBase = StatementChildHavingIteratorOperationCountMixin\n\n\nclass StatementChildrenHavingListArgValueOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementListOperationAppend\n\n    def __init__(self, list_arg, value, source_ref):\n        list_arg.parent = self\n\n        self.subnode_list_arg = list_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_list_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"list_arg\", self.subnode_list_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_list_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_list_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"list_arg\": self.subnode_list_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_list_arg.finalize()\n        del self.subnode_list_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_list_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementListOperationAppendBase = StatementChildrenHavingListArgValueOperationMixin\n\n\nclass StatementChildHavingLocalsArgOperationPostInitLocalsScopeMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementLocalsDictSync\n\n    def __init__(self, locals_arg, locals_scope, source_ref):\n        locals_arg.parent = self\n\n        self.subnode_locals_arg = locals_arg\n\n        self.locals_scope = locals_scope\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_locals_arg,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"locals_arg\", self.subnode_locals_arg),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_locals_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_locals_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"locals_arg\": self.subnode_locals_arg.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_locals_arg.finalize()\n        del self.subnode_locals_arg\n\n        del self.locals_scope\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_locals_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementLocalsDictSyncBase = (\n    StatementChildHavingLocalsArgOperationPostInitLocalsScopeMixin\n)\n\n\nclass StatementChildHavingLoopBodyOptionalStatementsOrNonePostInitMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementLoop\n\n    def __init__(self, loop_body, source_ref):\n        loop_body = checkStatementsSequenceOrNone(loop_body)\n        if loop_body is not None:\n            loop_body.parent = self\n\n        self.subnode_loop_body = loop_body\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def setChildLoopBody(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_loop_body = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        value = self.subnode_loop_body\n\n        if value is None:\n            return ()\n        else:\n            return (value,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"loop_body\", self.subnode_loop_body),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_loop_body\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_loop_body = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"loop_body\": (\n                self.subnode_loop_body.makeClone()\n                if self.subnode_loop_body is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        if self.subnode_loop_body is not None:\n            self.subnode_loop_body.finalize()\n        del self.subnode_loop_body\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        subnode_loop_body = self.subnode_loop_body\n\n        if subnode_loop_body is not None:\n            self.subnode_loop_body.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementLoopBase = StatementChildHavingLoopBodyOptionalStatementsOrNonePostInitMixin\n\n\nclass StatementChildHavingModuleOperationPostInitTargetScopeMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementImportStar\n\n    def __init__(self, module, target_scope, source_ref):\n        module.parent = self\n\n        self.subnode_module = module\n\n        self.target_scope = target_scope\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getDetails(self):\n        return {\n            \"target_scope\": self.target_scope,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_module,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"module\", self.subnode_module),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_module\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_module = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"module\": self.subnode_module.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_module.finalize()\n        del self.subnode_module\n\n        del self.target_scope\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_module.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementImportStarBase = StatementChildHavingModuleOperationPostInitTargetScopeMixin\n\n\nclass StatementChildHavingNewLocalsOperationLocalsScopeMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementSetLocals\n\n    def __init__(self, new_locals, locals_scope, source_ref):\n        new_locals.parent = self\n\n        self.subnode_new_locals = new_locals\n\n        self.locals_scope = locals_scope\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_new_locals,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"new_locals\", self.subnode_new_locals),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_new_locals\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_new_locals = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"new_locals\": self.subnode_new_locals.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_new_locals.finalize()\n        del self.subnode_new_locals\n\n        del self.locals_scope\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_new_locals.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementSetLocalsBase = StatementChildHavingNewLocalsOperationLocalsScopeMixin\n\n\nclass StatementChildrenHavingSetArgValueOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementSetOperationAdd\n\n    def __init__(self, set_arg, value, source_ref):\n        set_arg.parent = self\n\n        self.subnode_set_arg = set_arg\n\n        value.parent = self\n\n        self.subnode_value = value\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_set_arg,\n            self.subnode_value,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"set_arg\", self.subnode_set_arg),\n            (\"value\", self.subnode_value),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_set_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_set_arg = new_node\n\n            return\n\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"set_arg\": self.subnode_set_arg.makeClone(),\n            \"value\": self.subnode_value.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_set_arg.finalize()\n        del self.subnode_set_arg\n        self.subnode_value.finalize()\n        del self.subnode_value\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_set_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementSetOperationAddBase = StatementChildrenHavingSetArgValueOperationMixin\n\n\nclass StatementChildHavingSourcePostInitProviderVariableNameMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementAssignmentVariableName\n\n    def __init__(self, source, provider, variable_name, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        self.provider = provider\n        self.variable_name = variable_name\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getDetails(self):\n        return {\n            \"provider\": self.provider,\n            \"variable_name\": self.variable_name,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_source,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"source\", self.subnode_source),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementAssignmentVariableNameBase = (\n    StatementChildHavingSourcePostInitProviderVariableNameMixin\n)\n\n\nclass StatementChildHavingSourcePostInitVariableVariableVersionMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementAssignmentVariableConstantImmutable\n    #   StatementAssignmentVariableConstantImmutableTrusted\n    #   StatementAssignmentVariableConstantMutable\n    #   StatementAssignmentVariableConstantMutableTrusted\n    #   StatementAssignmentVariableFromTempVariable\n    #   StatementAssignmentVariableFromVariable\n    #   StatementAssignmentVariableGeneric\n    #   StatementAssignmentVariableHardValue\n    #   StatementAssignmentVariableIterator\n\n    def __init__(self, source, variable, variable_version, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        self.variable = variable\n        self.variable_version = variable_version\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getDetails(self):\n        return {\n            \"variable\": self.variable,\n            \"variable_version\": self.variable_version,\n        }\n\n    def setChildSource(self, value):\n        value.parent = self\n\n        self.subnode_source = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_source,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"source\", self.subnode_source),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n\n        del self.variable\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementAssignmentVariableConstantImmutableBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableConstantImmutableTrustedBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableConstantMutableBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableConstantMutableTrustedBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableFromTempVariableBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableFromVariableBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableGenericBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableHardValueBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\nStatementAssignmentVariableIteratorBase = (\n    StatementChildHavingSourcePostInitVariableVariableVersionMixin\n)\n\n\nclass StatementChildHavingSourceOperationPostInitLocalsScopeVariableNameMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementLocalsDictOperationSet\n\n    def __init__(self, source, locals_scope, variable_name, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        self.locals_scope = locals_scope\n        self.variable_name = variable_name\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def getDetails(self):\n        return {\n            \"locals_scope\": self.locals_scope,\n            \"variable_name\": self.variable_name,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (self.subnode_source,)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"source\", self.subnode_source),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n\n        del self.locals_scope\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementLocalsDictOperationSetBase = (\n    StatementChildHavingSourceOperationPostInitLocalsScopeVariableNameMixin\n)\n\n\nclass StatementChildrenHavingSourceExpressionOperationAttributeNameMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementAssignmentAttribute\n\n    def __init__(self, source, expression, attribute_name, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        self.attribute_name = attribute_name\n\n        StatementBase.__init__(self, source_ref)\n\n    def getDetails(self):\n        return {\n            \"attribute_name\": self.attribute_name,\n        }\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_source,\n            self.subnode_expression,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source\", self.subnode_source),\n            (\"expression\", self.subnode_expression),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n            \"expression\": self.subnode_expression.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementAssignmentAttributeBase = (\n    StatementChildrenHavingSourceExpressionOperationAttributeNameMixin\n)\n\n\nclass StatementChildrenHavingSourceExpressionLowerOptionalUpperOptionalMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementAssignmentSlice\n\n    def __init__(self, source, expression, lower, upper, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        expression.parent = self\n\n        self.subnode_expression = expression\n\n        if lower is not None:\n            lower.parent = self\n\n        self.subnode_lower = lower\n\n        if upper is not None:\n            upper.parent = self\n\n        self.subnode_upper = upper\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_source)\n        result.append(self.subnode_expression)\n        value = self.subnode_lower\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_upper\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source\", self.subnode_source),\n            (\"expression\", self.subnode_expression),\n            (\"lower\", self.subnode_lower),\n            (\"upper\", self.subnode_upper),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        value = self.subnode_expression\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_expression = new_node\n\n            return\n\n        value = self.subnode_lower\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_lower = new_node\n\n            return\n\n        value = self.subnode_upper\n        if old_node is value:\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_upper = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n            \"expression\": self.subnode_expression.makeClone(),\n            \"lower\": (\n                self.subnode_lower.makeClone()\n                if self.subnode_lower is not None\n                else None\n            ),\n            \"upper\": (\n                self.subnode_upper.makeClone()\n                if self.subnode_upper is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n        self.subnode_expression.finalize()\n        del self.subnode_expression\n        if self.subnode_lower is not None:\n            self.subnode_lower.finalize()\n        del self.subnode_lower\n        if self.subnode_upper is not None:\n            self.subnode_upper.finalize()\n        del self.subnode_upper\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_expression.collectVariableAccesses(emit_read, emit_write)\n        subnode_lower = self.subnode_lower\n\n        if subnode_lower is not None:\n            self.subnode_lower.collectVariableAccesses(emit_read, emit_write)\n        subnode_upper = self.subnode_upper\n\n        if subnode_upper is not None:\n            self.subnode_upper.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementAssignmentSliceBase = (\n    StatementChildrenHavingSourceExpressionLowerOptionalUpperOptionalMixin\n)\n\n\nclass StatementChildrenHavingSourceSubscribedSubscriptOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementAssignmentSubscript\n\n    def __init__(self, source, subscribed, subscript, source_ref):\n        source.parent = self\n\n        self.subnode_source = source\n\n        subscribed.parent = self\n\n        self.subnode_subscribed = subscribed\n\n        subscript.parent = self\n\n        self.subnode_subscript = subscript\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_source,\n            self.subnode_subscribed,\n            self.subnode_subscript,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source\", self.subnode_source),\n            (\"subscribed\", self.subnode_subscribed),\n            (\"subscript\", self.subnode_subscript),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source = new_node\n\n            return\n\n        value = self.subnode_subscribed\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_subscribed = new_node\n\n            return\n\n        value = self.subnode_subscript\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_subscript = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source\": self.subnode_source.makeClone(),\n            \"subscribed\": self.subnode_subscribed.makeClone(),\n            \"subscript\": self.subnode_subscript.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source.finalize()\n        del self.subnode_source\n        self.subnode_subscribed.finalize()\n        del self.subnode_subscribed\n        self.subnode_subscript.finalize()\n        del self.subnode_subscript\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_subscribed.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_subscript.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementAssignmentSubscriptBase = (\n    StatementChildrenHavingSourceSubscribedSubscriptOperationMixin\n)\n\n\nclass StatementChildrenHavingSourceCodeGlobalsArgAutoNoneLocalsArgAutoNoneOperationMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementExec\n\n    def __init__(self, source_code, globals_arg, locals_arg, source_ref):\n        source_code.parent = self\n\n        self.subnode_source_code = source_code\n\n        globals_arg = convertNoneConstantToNone(globals_arg)\n        if globals_arg is not None:\n            globals_arg.parent = self\n\n        self.subnode_globals_arg = globals_arg\n\n        locals_arg = convertNoneConstantToNone(locals_arg)\n        if locals_arg is not None:\n            locals_arg.parent = self\n\n        self.subnode_locals_arg = locals_arg\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_source_code)\n        value = self.subnode_globals_arg\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_locals_arg\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"source_code\", self.subnode_source_code),\n            (\"globals_arg\", self.subnode_globals_arg),\n            (\"locals_arg\", self.subnode_locals_arg),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_source_code\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_source_code = new_node\n\n            return\n\n        value = self.subnode_globals_arg\n        if old_node is value:\n            new_node = convertNoneConstantToNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_globals_arg = new_node\n\n            return\n\n        value = self.subnode_locals_arg\n        if old_node is value:\n            new_node = convertNoneConstantToNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_locals_arg = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"source_code\": self.subnode_source_code.makeClone(),\n            \"globals_arg\": (\n                self.subnode_globals_arg.makeClone()\n                if self.subnode_globals_arg is not None\n                else None\n            ),\n            \"locals_arg\": (\n                self.subnode_locals_arg.makeClone()\n                if self.subnode_locals_arg is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_source_code.finalize()\n        del self.subnode_source_code\n        if self.subnode_globals_arg is not None:\n            self.subnode_globals_arg.finalize()\n        del self.subnode_globals_arg\n        if self.subnode_locals_arg is not None:\n            self.subnode_locals_arg.finalize()\n        del self.subnode_locals_arg\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_source_code.collectVariableAccesses(emit_read, emit_write)\n        subnode_globals_arg = self.subnode_globals_arg\n\n        if subnode_globals_arg is not None:\n            self.subnode_globals_arg.collectVariableAccesses(emit_read, emit_write)\n        subnode_locals_arg = self.subnode_locals_arg\n\n        if subnode_locals_arg is not None:\n            self.subnode_locals_arg.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementExecBase = (\n    StatementChildrenHavingSourceCodeGlobalsArgAutoNoneLocalsArgAutoNoneOperationMixin\n)\n\n\nclass StatementChildHavingStatementsTupleMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementsFrameAsyncgen\n    #   StatementsFrameClass\n    #   StatementsFrameCoroutine\n    #   StatementsFrameFunction\n    #   StatementsFrameGenerator\n    #   StatementsFrameModule\n    #   StatementsSequence\n\n    def __init__(self, statements, source_ref):\n        assert type(statements) is tuple\n\n        for val in statements:\n            val.parent = self\n\n        self.subnode_statements = statements\n\n        StatementBase.__init__(self, source_ref)\n\n    def setChildStatements(self, value):\n        assert type(value) is tuple, type(value)\n\n        for val in value:\n            val.parent = self\n\n        self.subnode_statements = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return self.subnode_statements\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return ((\"statements\", self.subnode_statements),)\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_statements\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_statements = tuple(\n                    (val if val is not old_node else new_node) for val in value\n                )\n            else:\n                self.subnode_statements = tuple(\n                    val for val in value if val is not old_node\n                )\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"statements\": tuple(v.makeClone() for v in self.subnode_statements),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        for c in self.subnode_statements:\n            c.finalize()\n        del self.subnode_statements\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        for element in self.subnode_statements:\n            element.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementsFrameAsyncgenBase = StatementChildHavingStatementsTupleMixin\nStatementsFrameClassBase = StatementChildHavingStatementsTupleMixin\nStatementsFrameCoroutineBase = StatementChildHavingStatementsTupleMixin\nStatementsFrameFunctionBase = StatementChildHavingStatementsTupleMixin\nStatementsFrameGeneratorBase = StatementChildHavingStatementsTupleMixin\nStatementsFrameModuleBase = StatementChildHavingStatementsTupleMixin\nStatementsSequenceBase = StatementChildHavingStatementsTupleMixin\n\n\nclass StatementChildrenHavingSubscribedSubscriptOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDelSubscript\n\n    def __init__(self, subscribed, subscript, source_ref):\n        subscribed.parent = self\n\n        self.subnode_subscribed = subscribed\n\n        subscript.parent = self\n\n        self.subnode_subscript = subscript\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_subscribed,\n            self.subnode_subscript,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"subscribed\", self.subnode_subscribed),\n            (\"subscript\", self.subnode_subscript),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_subscribed\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_subscribed = new_node\n\n            return\n\n        value = self.subnode_subscript\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_subscript = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"subscribed\": self.subnode_subscribed.makeClone(),\n            \"subscript\": self.subnode_subscript.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_subscribed.finalize()\n        del self.subnode_subscribed\n        self.subnode_subscript.finalize()\n        del self.subnode_subscript\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_subscribed.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_subscript.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDelSubscriptBase = StatementChildrenHavingSubscribedSubscriptOperationMixin\n\n\nclass StatementChildrenHavingTriedStatementsExceptHandlerOptionalStatementsOrNoneBreakHandlerOptionalStatementsOrNoneContinueHandlerOptionalStatementsOrNoneReturnHandlerOptionalStatementsOrNonePostInitMixin(\n    StatementBase\n):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementTry\n\n    def __init__(\n        self,\n        tried,\n        except_handler,\n        break_handler,\n        continue_handler,\n        return_handler,\n        source_ref,\n    ):\n        tried = checkStatementsSequence(tried)\n        tried.parent = self\n\n        self.subnode_tried = tried\n\n        except_handler = checkStatementsSequenceOrNone(except_handler)\n        if except_handler is not None:\n            except_handler.parent = self\n\n        self.subnode_except_handler = except_handler\n\n        break_handler = checkStatementsSequenceOrNone(break_handler)\n        if break_handler is not None:\n            break_handler.parent = self\n\n        self.subnode_break_handler = break_handler\n\n        continue_handler = checkStatementsSequenceOrNone(continue_handler)\n        if continue_handler is not None:\n            continue_handler.parent = self\n\n        self.subnode_continue_handler = continue_handler\n\n        return_handler = checkStatementsSequenceOrNone(return_handler)\n        if return_handler is not None:\n            return_handler.parent = self\n\n        self.subnode_return_handler = return_handler\n\n        StatementBase.__init__(self, source_ref)\n\n        self.postInitNode()\n\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n\n    def setChildBreakHandler(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_break_handler = value\n\n    def setChildContinueHandler(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_continue_handler = value\n\n    def setChildExceptHandler(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_except_handler = value\n\n    def setChildReturnHandler(self, value):\n        value = checkStatementsSequenceOrNone(value)\n        if value is not None:\n            value.parent = self\n\n        self.subnode_return_handler = value\n\n    def setChildTried(self, value):\n        value = checkStatementsSequence(value)\n        value.parent = self\n\n        self.subnode_tried = value\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        result = []\n        result.append(self.subnode_tried)\n        value = self.subnode_except_handler\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_break_handler\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_continue_handler\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        value = self.subnode_return_handler\n        if value is None:\n            pass\n        else:\n            result.append(value)\n        return tuple(result)\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"tried\", self.subnode_tried),\n            (\"except_handler\", self.subnode_except_handler),\n            (\"break_handler\", self.subnode_break_handler),\n            (\"continue_handler\", self.subnode_continue_handler),\n            (\"return_handler\", self.subnode_return_handler),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_tried\n        if old_node is value:\n            new_node = checkStatementsSequence(new_node)\n            new_node.parent = self\n\n            self.subnode_tried = new_node\n\n            return\n\n        value = self.subnode_except_handler\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_except_handler = new_node\n\n            return\n\n        value = self.subnode_break_handler\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_break_handler = new_node\n\n            return\n\n        value = self.subnode_continue_handler\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_continue_handler = new_node\n\n            return\n\n        value = self.subnode_return_handler\n        if old_node is value:\n            new_node = checkStatementsSequenceOrNone(new_node)\n            if new_node is not None:\n                new_node.parent = self\n\n            self.subnode_return_handler = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"tried\": self.subnode_tried.makeClone(),\n            \"except_handler\": (\n                self.subnode_except_handler.makeClone()\n                if self.subnode_except_handler is not None\n                else None\n            ),\n            \"break_handler\": (\n                self.subnode_break_handler.makeClone()\n                if self.subnode_break_handler is not None\n                else None\n            ),\n            \"continue_handler\": (\n                self.subnode_continue_handler.makeClone()\n                if self.subnode_continue_handler is not None\n                else None\n            ),\n            \"return_handler\": (\n                self.subnode_return_handler.makeClone()\n                if self.subnode_return_handler is not None\n                else None\n            ),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_tried.finalize()\n        del self.subnode_tried\n        if self.subnode_except_handler is not None:\n            self.subnode_except_handler.finalize()\n        del self.subnode_except_handler\n        if self.subnode_break_handler is not None:\n            self.subnode_break_handler.finalize()\n        del self.subnode_break_handler\n        if self.subnode_continue_handler is not None:\n            self.subnode_continue_handler.finalize()\n        del self.subnode_continue_handler\n        if self.subnode_return_handler is not None:\n            self.subnode_return_handler.finalize()\n        del self.subnode_return_handler\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_tried.collectVariableAccesses(emit_read, emit_write)\n        subnode_except_handler = self.subnode_except_handler\n\n        if subnode_except_handler is not None:\n            self.subnode_except_handler.collectVariableAccesses(emit_read, emit_write)\n        subnode_break_handler = self.subnode_break_handler\n\n        if subnode_break_handler is not None:\n            self.subnode_break_handler.collectVariableAccesses(emit_read, emit_write)\n        subnode_continue_handler = self.subnode_continue_handler\n\n        if subnode_continue_handler is not None:\n            self.subnode_continue_handler.collectVariableAccesses(emit_read, emit_write)\n        subnode_return_handler = self.subnode_return_handler\n\n        if subnode_return_handler is not None:\n            self.subnode_return_handler.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementTryBase = StatementChildrenHavingTriedStatementsExceptHandlerOptionalStatementsOrNoneBreakHandlerOptionalStatementsOrNoneContinueHandlerOptionalStatementsOrNoneReturnHandlerOptionalStatementsOrNonePostInitMixin\n\n\nclass StatementChildrenHavingValueDictArgKeyOperationMixin(StatementBase):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n    #   StatementDictOperationSet\n    #   StatementDictOperationSetKeyValue\n\n    def __init__(self, value, dict_arg, key, source_ref):\n        value.parent = self\n\n        self.subnode_value = value\n\n        dict_arg.parent = self\n\n        self.subnode_dict_arg = dict_arg\n\n        key.parent = self\n\n        self.subnode_key = key\n\n        StatementBase.__init__(self, source_ref)\n\n    def getVisitableNodes(self):\n        \"\"\"The visitable nodes, with tuple values flattened.\"\"\"\n\n        return (\n            self.subnode_value,\n            self.subnode_dict_arg,\n            self.subnode_key,\n        )\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n        return (\n            (\"value\", self.subnode_value),\n            (\"dict_arg\", self.subnode_dict_arg),\n            (\"key\", self.subnode_key),\n        )\n\n    def replaceChild(self, old_node, new_node):\n        value = self.subnode_value\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_value = new_node\n\n            return\n\n        value = self.subnode_dict_arg\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_dict_arg = new_node\n\n            return\n\n        value = self.subnode_key\n        if old_node is value:\n            new_node.parent = self\n\n            self.subnode_key = new_node\n\n            return\n\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\"Get clones of all children to pass for a new node.\n\n        Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n            \"value\": self.subnode_value.makeClone(),\n            \"dict_arg\": self.subnode_dict_arg.makeClone(),\n            \"key\": self.subnode_key.makeClone(),\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n    def finalize(self):\n        del self.parent\n\n        self.subnode_value.finalize()\n        del self.subnode_value\n        self.subnode_dict_arg.finalize()\n        del self.subnode_dict_arg\n        self.subnode_key.finalize()\n        del self.subnode_key\n\n    def computeStatement(self, trace_collection):\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\"Collect variable reads and writes of child nodes.\"\"\"\n\n        self.subnode_value.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_dict_arg.collectVariableAccesses(emit_read, emit_write)\n        self.subnode_key.collectVariableAccesses(emit_read, emit_write)\n\n\n# Assign the names that are easier to import with a stable name.\nStatementDictOperationSetBase = StatementChildrenHavingValueDictArgKeyOperationMixin\nStatementDictOperationSetKeyValueBase = (\n    StatementChildrenHavingValueDictArgKeyOperationMixin\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/StatementNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for statements.\n\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .NodeBases import StatementBase\nfrom .StatementBasesGenerated import (\n    StatementExpressionOnlyBase,\n    StatementsSequenceBase,\n)\n\n\nclass StatementsSequenceMixin(object):\n    __slots__ = ()\n\n    def finalize(self):\n        del self.parent\n\n        for s in self.subnode_statements:\n            s.finalize()\n\n    @staticmethod\n    def isStatementsSequence():\n        return True\n\n    def trimStatements(self, statement):\n        assert statement.parent is self\n\n        old_statements = list(self.subnode_statements)\n        assert statement in old_statements, (statement, self)\n\n        new_statements = old_statements[: old_statements.index(statement) + 1]\n\n        self.setChildStatements(new_statements)\n\n    def removeStatement(self, statement):\n        assert statement.parent is self\n\n        statements = list(self.subnode_statements)\n        statements.remove(statement)\n        self.setChildStatements(tuple(statements))\n\n        if statements:\n            return self\n        else:\n            return None\n\n    def replaceStatement(self, statement, statements):\n        old_statements = list(self.subnode_statements)\n\n        merge_index = old_statements.index(statement)\n\n        new_statements = (\n            tuple(old_statements[:merge_index])\n            + tuple(statements)\n            + tuple(old_statements[merge_index + 1 :])\n        )\n\n        self.setChildStatements(new_statements)\n\n    def mayHaveSideEffects(self):\n        # Statement sequences have a side effect if one of the statements does.\n        for statement in self.subnode_statements:\n            if statement.mayHaveSideEffects():\n                return True\n        return False\n\n    def mayRaiseException(self, exception_type):\n        for statement in self.subnode_statements:\n            if statement.mayRaiseException(exception_type):\n                return True\n        return False\n\n    def needsFrame(self):\n        for statement in self.subnode_statements:\n            if statement.needsFrame():\n                return True\n        return False\n\n    def mayReturn(self):\n        for statement in self.subnode_statements:\n            if statement.mayReturn():\n                return True\n        return False\n\n    def mayBreak(self):\n        for statement in self.subnode_statements:\n            if statement.mayBreak():\n                return True\n        return False\n\n    def mayContinue(self):\n        for statement in self.subnode_statements:\n            if statement.mayContinue():\n                return True\n        return False\n\n    def mayRaiseExceptionOrAbort(self, exception_type):\n        return (\n            self.mayRaiseException(exception_type)\n            or self.mayReturn()\n            or self.mayBreak()\n            or self.mayContinue()\n        )\n\n    def isStatementAborting(self):\n        return self.subnode_statements[-1].isStatementAborting()\n\n    def willRaiseAnyException(self):\n        return self.subnode_statements[-1].willRaiseAnyException()\n\n\nclass StatementsSequence(StatementsSequenceMixin, StatementsSequenceBase):\n    kind = \"STATEMENTS_SEQUENCE\"\n\n    named_children = (\"statements|tuple+setter\",)\n\n    def computeStatement(self, trace_collection):\n        # Don't want to be called like this.\n        assert False, self\n\n    def computeStatementsSequence(self, trace_collection):\n        new_statements = []\n\n        statements = self.subnode_statements\n        assert statements, self\n\n        for count, statement in enumerate(statements):\n            # May be frames embedded.\n            if statement.isStatementsFrame():\n                new_statement = statement.computeStatementsSequence(trace_collection)\n            else:\n                new_statement = trace_collection.onStatement(statement=statement)\n\n            if new_statement is not None:\n                if (\n                    new_statement.isStatementsSequence()\n                    and not new_statement.isStatementsFrame()\n                ):\n                    new_statements.extend(new_statement.subnode_statements)\n                else:\n                    new_statements.append(new_statement)\n\n                if (\n                    statement is not statements[-1]\n                    and new_statement.isStatementAborting()\n                ):\n                    trace_collection.signalChange(\n                        \"new_statements\",\n                        statements[count + 1].getSourceReference(),\n                        \"Removed dead statements.\",\n                    )\n\n                    for s in statements[statements.index(statement) + 1 :]:\n                        s.finalize()\n\n                    break\n\n        new_statements = tuple(new_statements)\n        if statements != new_statements:\n            if new_statements:\n                self.setChildStatements(new_statements)\n\n                return self\n            else:\n                return None\n        else:\n            return self\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"statements sequence\"\n\n\nclass StatementExpressionOnly(StatementExpressionOnlyBase):\n    kind = \"STATEMENT_EXPRESSION_ONLY\"\n\n    named_children = (\"expression\",)\n\n    def mayHaveSideEffects(self):\n        return self.subnode_expression.mayHaveSideEffects()\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n\n    def computeStatement(self, trace_collection):\n        # TODO: Maybe also have a variant that will not attempt dropping anymore, for nodes\n        # that are known to not do it anymore, or wait for a node change, or make it part of\n        # the expression interface to be used in statement form as well.\n\n        expression = trace_collection.onExpression(self.subnode_expression)\n\n        return expression.computeExpressionDrop(\n            statement=self, trace_collection=trace_collection\n        )\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"expression only statement\"\n\n    def getDetailsForDisplay(self):\n        return {\"expression\": self.subnode_expression.kind}\n\n\nclass StatementPreserveFrameException(StatementBase):\n    kind = \"STATEMENT_PRESERVE_FRAME_EXCEPTION\"\n\n    __slots__ = (\"preserver_id\",)\n\n    def __init__(self, preserver_id, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.preserver_id = preserver_id\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"preserver_id\": self.preserver_id}\n\n    def getPreserverId(self):\n        return self.preserver_id\n\n    if python_version < 0x300:\n\n        def computeStatement(self, trace_collection):\n            # For Python2 generators, it's not necessary to preserve, the frame\n            # decides it. TODO: This check makes only sense once.\n\n            if self.getParentStatementsFrame().needsExceptionFramePreservation():\n                return self, None, None\n            else:\n                return (\n                    None,\n                    \"new_statements\",\n                    \"Removed frame preservation for generators.\",\n                )\n\n    else:\n\n        def computeStatement(self, trace_collection):\n            return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def needsFrame():\n        return True\n\n\nclass StatementRestoreFrameException(StatementBase):\n    kind = \"STATEMENT_RESTORE_FRAME_EXCEPTION\"\n\n    __slots__ = (\"preserver_id\",)\n\n    def __init__(self, preserver_id, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.preserver_id = preserver_id\n\n    def finalize(self):\n        del self.parent\n\n    def getDetails(self):\n        return {\"preserver_id\": self.preserver_id}\n\n    def getPreserverId(self):\n        return self.preserver_id\n\n    def computeStatement(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\nclass StatementPublishException(StatementBase):\n    kind = \"STATEMENT_PUBLISH_EXCEPTION\"\n\n    def __init__(self, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n    def finalize(self):\n        del self.parent\n\n    def computeStatement(self, trace_collection):\n        # TODO: Determine the need for it.\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/StrNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that build and operate on str.\n\n\"\"\"\n\nfrom .BuiltinOperationNodeBasesGenerated import (\n    ExpressionStrOperationCapitalizeBase,\n    ExpressionStrOperationCenter2Base,\n    ExpressionStrOperationCenter3Base,\n    ExpressionStrOperationCount2Base,\n    ExpressionStrOperationCount3Base,\n    ExpressionStrOperationCount4Base,\n    ExpressionStrOperationDecode1Base,\n    ExpressionStrOperationDecode2Base,\n    ExpressionStrOperationDecode3Base,\n    ExpressionStrOperationEncode1Base,\n    ExpressionStrOperationEncode2Base,\n    ExpressionStrOperationEncode3Base,\n    ExpressionStrOperationEndswith2Base,\n    ExpressionStrOperationEndswith3Base,\n    ExpressionStrOperationEndswith4Base,\n    ExpressionStrOperationExpandtabs1Base,\n    ExpressionStrOperationExpandtabs2Base,\n    ExpressionStrOperationFind2Base,\n    ExpressionStrOperationFind3Base,\n    ExpressionStrOperationFind4Base,\n    ExpressionStrOperationFormatBase,\n    ExpressionStrOperationIndex2Base,\n    ExpressionStrOperationIndex3Base,\n    ExpressionStrOperationIndex4Base,\n    ExpressionStrOperationIsalnumBase,\n    ExpressionStrOperationIsalphaBase,\n    ExpressionStrOperationIsdigitBase,\n    ExpressionStrOperationIslowerBase,\n    ExpressionStrOperationIsspaceBase,\n    ExpressionStrOperationIstitleBase,\n    ExpressionStrOperationIsupperBase,\n    ExpressionStrOperationJoinBase,\n    ExpressionStrOperationLjust2Base,\n    ExpressionStrOperationLjust3Base,\n    ExpressionStrOperationLowerBase,\n    ExpressionStrOperationLstrip1Base,\n    ExpressionStrOperationLstrip2Base,\n    ExpressionStrOperationPartitionBase,\n    ExpressionStrOperationReplace3Base,\n    ExpressionStrOperationReplace4Base,\n    ExpressionStrOperationRfind2Base,\n    ExpressionStrOperationRfind3Base,\n    ExpressionStrOperationRfind4Base,\n    ExpressionStrOperationRindex2Base,\n    ExpressionStrOperationRindex3Base,\n    ExpressionStrOperationRindex4Base,\n    ExpressionStrOperationRjust2Base,\n    ExpressionStrOperationRjust3Base,\n    ExpressionStrOperationRpartitionBase,\n    ExpressionStrOperationRsplit1Base,\n    ExpressionStrOperationRsplit2Base,\n    ExpressionStrOperationRsplit3Base,\n    ExpressionStrOperationRstrip1Base,\n    ExpressionStrOperationRstrip2Base,\n    ExpressionStrOperationSplit1Base,\n    ExpressionStrOperationSplit2Base,\n    ExpressionStrOperationSplit3Base,\n    ExpressionStrOperationSplitlines1Base,\n    ExpressionStrOperationSplitlines2Base,\n    ExpressionStrOperationStartswith2Base,\n    ExpressionStrOperationStartswith3Base,\n    ExpressionStrOperationStartswith4Base,\n    ExpressionStrOperationStrip1Base,\n    ExpressionStrOperationStrip2Base,\n    ExpressionStrOperationSwapcaseBase,\n    ExpressionStrOperationTitleBase,\n    ExpressionStrOperationTranslateBase,\n    ExpressionStrOperationUpperBase,\n    ExpressionStrOperationZfillBase,\n)\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionShapeMixins import (\n    ExpressionBytesShapeExactMixin,\n    ExpressionStrOrUnicodeExactMixin,\n    ExpressionStrShapeExactMixin,\n)\nfrom .NodeMetaClasses import NodeCheckMetaClass\n\n\ndef getStrOperationClasses():\n    \"\"\"Return all str operation nodes, for use by code generation.\"\"\"\n    return (\n        cls\n        for kind, cls in NodeCheckMetaClass.kinds.items()\n        if kind.startswith(\"EXPRESSION_STR_OPERATION_\")\n    )\n\n\nclass ExpressionStrOperationJoin(ExpressionStrOperationJoinBase):\n    \"\"\"This operation represents s.join(iterable).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_JOIN\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationPartition(ExpressionStrOperationPartitionBase):\n    \"\"\"This operation represents s.partition(sep).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_PARTITION\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n    @staticmethod\n    def getIterationLength():\n        return 3\n\n\nclass ExpressionStrOperationRpartition(ExpressionStrOperationRpartitionBase):\n    \"\"\"This operation represents s.rpartition(sep).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RPARTITION\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n    @staticmethod\n    def getIterationLength():\n        return 3\n\n\nclass ExpressionStrOperationStrip1(ExpressionStrOperationStrip1Base):\n    \"\"\"This operation represents s.strip().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_STRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationStrip2(ExpressionStrOperationStrip2Base):\n    \"\"\"This operation represents s.strip(chars).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_STRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationLstrip1(ExpressionStrOperationLstrip1Base):\n    \"\"\"This operation represents s.lstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_LSTRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationLstrip2(ExpressionStrOperationLstrip2Base):\n    \"\"\"This operation represents s.lstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_LSTRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRstrip1(ExpressionStrOperationRstrip1Base):\n    \"\"\"This operation represents s.rstrip().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RSTRIP1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationRstrip2(ExpressionStrOperationRstrip2Base):\n    \"\"\"This operation represents s.rstrip(chars).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RSTRIP2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationFind2(ExpressionStrOperationFind2Base):\n    \"\"\"This operation represents s.find(sub).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_FIND2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationFind3(ExpressionStrOperationFind3Base):\n    \"\"\"This operation represents s.find(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_FIND3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationFind4(ExpressionStrOperationFind4Base):\n    \"\"\"This operation represents s.find(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_FIND4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRfind2(ExpressionStrOperationRfind2Base):\n    \"\"\"This operation represents s.rfind(sub).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RFIND2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRfind3(ExpressionStrOperationRfind3Base):\n    \"\"\"This operation represents s.rfind(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RFIND3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRfind4(ExpressionStrOperationRfind4Base):\n    \"\"\"This operation represents s.rfind(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RFIND4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationIndex2(ExpressionStrOperationIndex2Base):\n    \"\"\"This operation represents s.index(sub).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_INDEX2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationIndex3(ExpressionStrOperationIndex3Base):\n    \"\"\"This operation represents s.index(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_INDEX3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationIndex4(ExpressionStrOperationIndex4Base):\n    \"\"\"This operation represents s.index(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_INDEX4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRindex2(ExpressionStrOperationRindex2Base):\n    \"\"\"This operation represents s.rindex(sub).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RINDEX2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRindex3(ExpressionStrOperationRindex3Base):\n    \"\"\"This operation represents s.rindex(sub, start).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RINDEX3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRindex4(ExpressionStrOperationRindex4Base):\n    \"\"\"This operation represents s.rindex(sub, start, end).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RINDEX4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationCapitalize(ExpressionStrOperationCapitalizeBase):\n    \"\"\"This operation represents s.capitalize().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_CAPITALIZE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationUpper(ExpressionStrOperationUpperBase):\n    \"\"\"This operation represents s.upper().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_UPPER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationLower(ExpressionStrOperationLowerBase):\n    \"\"\"This operation represents s.lower().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_LOWER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationSwapcase(ExpressionStrOperationSwapcaseBase):\n    \"\"\"This operation represents s.swapcase().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SWAPCASE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationTitle(ExpressionStrOperationTitleBase):\n    \"\"\"This operation represents s.title().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_TITLE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIsalnum(ExpressionStrOperationIsalnumBase):\n    \"\"\"This operation represents s.isalnum().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISALNUM\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIsalpha(ExpressionStrOperationIsalphaBase):\n    \"\"\"This operation represents s.isalpha().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISALPHA\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIsdigit(ExpressionStrOperationIsdigitBase):\n    \"\"\"This operation represents s.isdigit().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISDIGIT\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIslower(ExpressionStrOperationIslowerBase):\n    \"\"\"This operation represents s.islower().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISLOWER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIsupper(ExpressionStrOperationIsupperBase):\n    \"\"\"This operation represents s.isupper().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISUPPER\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIsspace(ExpressionStrOperationIsspaceBase):\n    \"\"\"This operation represents s.isspace().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISSPACE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationIstitle(ExpressionStrOperationIstitleBase):\n    \"\"\"This operation represents s.istitle().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ISTITLE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationSplit1(ExpressionStrOperationSplit1Base):\n    \"\"\"This operation represents s.split().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SPLIT1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationSplit2(ExpressionStrOperationSplit2Base):\n    \"\"\"This operation represents s.split(sep).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SPLIT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\ndef makeExpressionStrOperationSplit3(str_arg, sep, maxsplit, source_ref):\n    if sep is None:\n        sep = makeConstantRefNode(constant=None, source_ref=source_ref)\n\n    return ExpressionStrOperationSplit3(\n        str_arg=str_arg,\n        sep=sep,\n        maxsplit=maxsplit,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionStrOperationSplit3(ExpressionStrOperationSplit3Base):\n    \"\"\"This operation represents s.split(sep, maxsplit).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SPLIT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\n# TODO: This one could be eliminated in favor of simple ExpressionStrOperationSplit1\n# since without an argument, there is no difference.\nclass ExpressionStrOperationRsplit1(ExpressionStrOperationRsplit1Base):\n    \"\"\"This operation represents s.rsplit().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RSPLIT1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationRsplit2(ExpressionStrOperationRsplit2Base):\n    \"\"\"This operation represents s.rsplit(sep).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RSPLIT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\ndef makeExpressionStrOperationRsplit3(str_arg, sep, maxsplit, source_ref):\n    if sep is None:\n        sep = makeConstantRefNode(constant=None, source_ref=source_ref)\n\n    return ExpressionStrOperationRsplit3(\n        str_arg=str_arg,\n        sep=sep,\n        maxsplit=maxsplit,\n        source_ref=source_ref,\n    )\n\n\nclass ExpressionStrOperationRsplit3(ExpressionStrOperationRsplit3Base):\n    \"\"\"This operation represents s.rsplit(sep, maxsplit).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_RSPLIT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationEndswith2(ExpressionStrOperationEndswith2Base):\n    kind = \"EXPRESSION_STR_OPERATION_ENDSWITH2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationEndswith3(ExpressionStrOperationEndswith3Base):\n    kind = \"EXPRESSION_STR_OPERATION_ENDSWITH3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationEndswith4(ExpressionStrOperationEndswith4Base):\n    kind = \"EXPRESSION_STR_OPERATION_ENDSWITH4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationStartswith2(ExpressionStrOperationStartswith2Base):\n    kind = \"EXPRESSION_STR_OPERATION_STARTSWITH2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationStartswith3(ExpressionStrOperationStartswith3Base):\n    kind = \"EXPRESSION_STR_OPERATION_STARTSWITH3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationStartswith4(ExpressionStrOperationStartswith4Base):\n    kind = \"EXPRESSION_STR_OPERATION_STARTSWITH4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationReplace3(ExpressionStrOperationReplace3Base):\n    kind = \"EXPRESSION_STR_OPERATION_REPLACE3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationReplace4(ExpressionStrOperationReplace4Base):\n    kind = \"EXPRESSION_STR_OPERATION_REPLACE4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\n# TODO: Cannot yet do this with static code generation in the base class.\nclass ExpressionStrOperationEncodeMixin(\n    ExpressionBytesShapeExactMixin if str is not bytes else ExpressionStrShapeExactMixin\n):\n    __slots__ = ()\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments cannot be encoded\n        return True\n\n\nclass ExpressionStrOperationEncode1(\n    ExpressionStrOperationEncodeMixin, ExpressionStrOperationEncode1Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_ENCODE1\"\n\n\nclass ExpressionStrOperationEncode2(\n    ExpressionStrOperationEncodeMixin, ExpressionStrOperationEncode2Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_ENCODE2\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Maybe demote for default values of encodings, e.g. UTF8, ASCII\n        #\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\ndef makeExpressionStrOperationEncode3(str_arg, encoding, errors, source_ref):\n    if encoding is None:\n        encoding = makeConstantRefNode(constant=\"utf-8\", source_ref=source_ref)\n\n    return ExpressionStrOperationEncode3(\n        str_arg=str_arg, encoding=encoding, errors=errors, source_ref=source_ref\n    )\n\n\nclass ExpressionStrOperationEncode3(\n    ExpressionStrOperationEncodeMixin, ExpressionStrOperationEncode3Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_ENCODE3\"\n\n    def computeExpression(self, trace_collection):\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n# TODO: Cannot yet do this with static code generation in the base class.\nclass ExpressionStrOperationDecodeMixin(ExpressionStrOrUnicodeExactMixin):\n    __slots__ = ()\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments cannot be decoded\n        return True\n\n\nclass ExpressionStrOperationDecode1(\n    ExpressionStrOperationDecodeMixin, ExpressionStrOperationDecode1Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_DECODE1\"\n\n\nclass ExpressionStrOperationDecode2(\n    ExpressionStrOperationDecodeMixin, ExpressionStrOperationDecode2Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_DECODE2\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Maybe demote for default values of encodings, e.g. UTF8, ASCII\n\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionStrOperationDecode3(\n    ExpressionStrOperationDecodeMixin, ExpressionStrOperationDecode3Base\n):\n    kind = \"EXPRESSION_STR_OPERATION_DECODE3\"\n\n    def computeExpression(self, trace_collection):\n        # We cannot know what error handlers or encodings got registered.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\nclass ExpressionStrOperationCount2(ExpressionStrOperationCount2Base):\n    kind = \"EXPRESSION_STR_OPERATION_COUNT2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationCount3(ExpressionStrOperationCount3Base):\n    kind = \"EXPRESSION_STR_OPERATION_COUNT3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationCount4(ExpressionStrOperationCount4Base):\n    kind = \"EXPRESSION_STR_OPERATION_COUNT4\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationFormat(ExpressionStrOperationFormatBase):\n    \"\"\"This operation represents s.format() with only positional args.\"\"\"\n\n    named_children = (\"str_arg\", \"args|tuple\", \"pairs|tuple\")\n\n    kind = \"EXPRESSION_STR_OPERATION_FORMAT\"\n\n    # We do format manually because it its special optimization chances even for fully non-constants.\n    def computeExpression(self, trace_collection):\n        str_arg = self.subnode_str_arg\n        args = self.subnode_args\n        pairs = self.subnode_pairs\n\n        # TODO: Partially constant could also be propagated into there.\n\n        if (\n            str_arg.isCompileTimeConstant()\n            and all(arg.isCompileTimeConstant() for arg in args)\n            and all(pair.isCompileTimeConstant() for pair in pairs)\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.format(\n                    str_arg.getCompileTimeConstant(),\n                    *(arg.getCompileTimeConstant() for arg in args),\n                    **dict(\n                        (\n                            pair.getKeyCompileTimeConstant(),\n                            pair.getValueCompileTimeConstant(),\n                        )\n                        for pair in pairs\n                    )\n                ),\n                description=\"Built-in 'str.format' with constant values.\",\n                user_provided=str_arg.user_provided,\n            )\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    # TODO: Format strings are not yet looked at\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return True\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationExpandtabs1(ExpressionStrOperationExpandtabs1Base):\n    \"\"\"This operation represents s.expandtabs().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_EXPANDTABS1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n\nclass ExpressionStrOperationExpandtabs2(ExpressionStrOperationExpandtabs2Base):\n    kind = \"EXPRESSION_STR_OPERATION_EXPANDTABS2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationTranslate(ExpressionStrOperationTranslateBase):\n    \"\"\"This operation represents s.translate(table).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_TRANSLATE\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationZfill(ExpressionStrOperationZfillBase):\n    \"\"\"This operation represents s.zfill(width).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_ZFILL\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationCenter2(ExpressionStrOperationCenter2Base):\n    kind = \"EXPRESSION_STR_OPERATION_CENTER2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationCenter3(ExpressionStrOperationCenter3Base):\n    kind = \"EXPRESSION_STR_OPERATION_CENTER3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationLjust2(ExpressionStrOperationLjust2Base):\n    kind = \"EXPRESSION_STR_OPERATION_LJUST2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationLjust3(ExpressionStrOperationLjust3Base):\n    kind = \"EXPRESSION_STR_OPERATION_LJUST3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRjust2(ExpressionStrOperationRjust2Base):\n    kind = \"EXPRESSION_STR_OPERATION_RJUST2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationRjust3(ExpressionStrOperationRjust3Base):\n    kind = \"EXPRESSION_STR_OPERATION_RJUST3\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\nclass ExpressionStrOperationSplitlines1(ExpressionStrOperationSplitlines1Base):\n    \"\"\"This operation represents s.splitlines().\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SPLITLINES1\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # We do not count MemoryError\n        return False\n\n\nclass ExpressionStrOperationSplitlines2(ExpressionStrOperationSplitlines2Base):\n    \"\"\"This operation represents s.splitlines(keepends).\"\"\"\n\n    kind = \"EXPRESSION_STR_OPERATION_SPLITLINES2\"\n\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        # TODO: Only if the arguments have wrong shapes, code generation needs to use this too.\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/StringConcatenationNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node dedicated to \"\".join() code pattern.\n\nThis is used for Python 3.6 fstrings re-formulation and has pretty direct\ncode alternative to actually looking up that method from the empty string\nobject, so it got a dedicated node, also to perform optimizations specific\nto this.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingValuesTupleMixin\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionStrOrUnicodeExactMixin\n\n\nclass ExpressionStringConcatenation(\n    ExpressionStrOrUnicodeExactMixin, ChildHavingValuesTupleMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_STRING_CONCATENATION\"\n\n    named_children = (\"values|tuple+setter\",)\n\n    def __init__(self, values, source_ref):\n        assert values\n\n        ChildHavingValuesTupleMixin.__init__(self, values=values)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Could remove itself if only one argument or merge arguments\n        # of mergeable types.\n        streaks = []\n\n        start = None\n\n        values = self.subnode_values\n\n        for count, value in enumerate(values):\n            if value.isCompileTimeConstant() and value.hasShapeStrOrUnicodeExact():\n                if start is None:\n                    start = count\n            else:\n                if start is not None:\n                    if start != count - 1:\n                        streaks.append((start, count))\n\n                start = None\n\n        # Catch final one too.\n        if start is not None:\n            if start != len(values) - 1:\n                streaks.append((start, len(values)))\n\n        if streaks:\n            values = list(values)\n\n            for streak in reversed(streaks):\n                new_element = makeConstantRefNode(\n                    constant=\"\".join(\n                        value.getCompileTimeConstant()\n                        for value in values[streak[0] : streak[1]]\n                    ),\n                    source_ref=values[streak[0]].source_ref,\n                    user_provided=True,\n                )\n\n                values[streak[0] : streak[1]] = (new_element,)\n\n            if len(values) > 1:\n                self.setChildValues(tuple(values))\n                return (\n                    self,\n                    \"new_constant\",\n                    \"Partially combined strings for concatenation\",\n                )\n\n        if len(values) == 1 and values[0].hasShapeStrOrUnicodeExact():\n            return (\n                values[0],\n                \"new_constant\",\n                \"Removed strings concatenation of one value.\",\n            )\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/SubscriptNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Subscript node.\n\nSubscripts are important when working with lists and dictionaries. Tracking\nthem can allow to achieve more compact code, or predict results at compile time.\n\nThere is be a method \"computeExpressionSubscript\" to aid predicting them in the\nother nodes.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildrenHavingExpressionSubscriptMixin\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionExpressionFromTemplate,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .StatementBasesGenerated import (\n    StatementAssignmentSubscriptBase,\n    StatementDelSubscriptBase,\n)\n\n\nclass StatementAssignmentSubscript(StatementAssignmentSubscriptBase):\n    kind = \"STATEMENT_ASSIGNMENT_SUBSCRIPT\"\n\n    named_children = (\"source\", \"subscribed\", \"subscript\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        return self.subnode_subscribed.computeExpressionSetSubscript(\n            set_node=self,\n            subscript=self.subnode_subscript,\n            value_node=self.subnode_source,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"subscript assignment statement\"\n\n\nclass StatementDelSubscript(StatementDelSubscriptBase):\n    kind = \"STATEMENT_DEL_SUBSCRIPT\"\n\n    named_children = (\"subscribed\", \"subscript\")\n    auto_compute_handling = \"operation\"\n\n    def computeStatementOperation(self, trace_collection):\n        return self.subnode_subscribed.computeExpressionDelSubscript(\n            del_node=self,\n            subscript=self.subnode_subscript,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"subscript del statement\"\n\n\nclass ExpressionSubscriptLookup(ChildrenHavingExpressionSubscriptMixin, ExpressionBase):\n    kind = \"EXPRESSION_SUBSCRIPT_LOOKUP\"\n\n    named_children = (\"expression\", \"subscript\")\n\n    def __init__(self, expression, subscript, source_ref):\n        ChildrenHavingExpressionSubscriptMixin.__init__(\n            self,\n            expression=expression,\n            subscript=subscript,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        return self.subnode_expression.computeExpressionSubscript(\n            lookup_node=self,\n            subscript=self.subnode_subscript,\n            trace_collection=trace_collection,\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        return None\n\n\ndef makeExpressionSubscriptLookup(expression, subscript, source_ref):\n    return ExpressionSubscriptLookup(\n        expression=expression, subscript=subscript, source_ref=source_ref\n    )\n\n\ndef makeExpressionIndexLookup(expression, index_value, source_ref):\n    # TODO: Specialize index lookups to actual specific node.\n    return makeExpressionSubscriptLookup(\n        expression=expression,\n        subscript=makeConstantRefNode(\n            constant=index_value, source_ref=source_ref, user_provided=True\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef hasSubscript(value, subscript):\n    \"\"\"Check if a value has a subscript.\"\"\"\n\n    try:\n        value[subscript]\n    except Exception:  # Catch all the things, pylint: disable=broad-except\n        return False\n    else:\n        return True\n\n\nclass ExpressionSubscriptCheck(\n    ExpressionBoolShapeExactMixin,\n    SideEffectsFromChildrenMixin,\n    ChildrenHavingExpressionSubscriptMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_SUBSCRIPT_CHECK\"\n\n    named_children = (\"expression\", \"subscript\")\n\n    def __init__(self, expression, subscript, source_ref):\n        ChildrenHavingExpressionSubscriptMixin.__init__(\n            self,\n            expression=expression,\n            subscript=subscript,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # We do at least for compile time constants optimization here, but more\n        # could be done, were we to consider shapes.\n        source = self.subnode_expression\n        subscript = self.subnode_subscript\n\n        if source.isCompileTimeConstant() and subscript.isCompileTimeConstant():\n            (\n                result,\n                tags,\n                change_desc,\n            ) = trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: hasSubscript(\n                    source.getCompileTimeConstant(), subscript.getCompileTimeConstant()\n                ),\n                description=\"Subscript check has been pre-computed.\",\n            )\n\n            # If source has side effects, they must be evaluated.\n            result = wrapExpressionWithNodeSideEffects(new_node=result, old_node=source)\n\n            return result, tags, change_desc\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\nclass ExpressionSubscriptLookupForUnpack(ExpressionSubscriptLookup):\n    kind = \"EXPRESSION_SUBSCRIPT_LOOKUP_FOR_UNPACK\"\n\n    # TODO: Older Python doesn't need the slot.\n    __slots__ = (\"expected\",)\n\n    def __init__(self, expression, subscript, expected, source_ref):\n        ExpressionSubscriptLookup.__init__(\n            self, expression=expression, subscript=subscript, source_ref=source_ref\n        )\n\n        self.expected = expected\n\n    def computeExpression(self, trace_collection):\n        result = self.subnode_expression.computeExpressionSubscript(\n            lookup_node=self,\n            subscript=self.subnode_subscript,\n            trace_collection=trace_collection,\n        )\n\n        result_node = result[0]\n\n        # Rewrite exceptions to correct message.\n        if (\n            result_node.isExpressionRaiseException()\n            and result_node.subnode_exception_type.isExpressionBuiltinExceptionRef()\n            and result_node.subnode_exception_type.getExceptionName() == \"IndexError\"\n        ):\n            if python_version >= 0x360:\n                return (\n                    makeRaiseExceptionExpressionFromTemplate(\n                        exception_type=\"ValueError\",\n                        template=\"not enough values to unpack (expected %d, got %d)\",\n                        template_args=(\n                            makeConstantRefNode(\n                                constant=self.expected, source_ref=self.source_ref\n                            ),\n                            self.subnode_subscript,\n                        ),\n                        source_ref=self.source_ref,\n                    ),\n                    \"new_raise\",\n                    \"Raising for unpack too short iterator.\",\n                )\n            else:\n                return (\n                    makeRaiseExceptionExpressionFromTemplate(\n                        exception_type=\"ValueError\",\n                        template=\"need more than %d value to unpack\",\n                        template_args=self.subnode_subscript,\n                        source_ref=self.source_ref,\n                    ),\n                    \"new_raise\",\n                    \"Raising for unpack too short iterator.\",\n                )\n\n        return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/TensorflowNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes that represent tensorflow functions\n\n\"\"\"\n\nfrom nuitka.HardImportRegistry import addModuleDynamicHard\n\nfrom .HardImportNodesGenerated import ExpressionTensorflowFunctionCallBase\n\naddModuleDynamicHard(module_name=\"tensorflow\")\n\n\nclass ExpressionTensorflowFunctionCall(ExpressionTensorflowFunctionCallBase):\n    kind = \"EXPRESSION_TENSORFLOW_FUNCTION_CALL\"\n\n    def replaceWithCompileTimeValue(self, trace_collection):\n        # TODO: The node generation should allow for this to not be necessary\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/TryNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for try/except/finally handling.\n\nThis is the unified low level solution to trying a block, and executing code\nwhen it returns, break, continues, or raises an exception. See Developer\nManual for how this maps to try/finally and try/except as in Python.\n\"\"\"\n\nfrom nuitka.Errors import NuitkaOptimizationError\nfrom nuitka.optimizations.TraceCollections import TraceCollectionBranch\n\nfrom .StatementBasesGenerated import StatementTryBase\nfrom .StatementNodes import StatementsSequence\n\n\nclass StatementTry(StatementTryBase):\n    kind = \"STATEMENT_TRY\"\n\n    named_children = (\n        \"tried|statements+setter\",\n        \"except_handler|statements_or_none+setter\",\n        \"break_handler|statements_or_none+setter\",\n        \"continue_handler|statements_or_none+setter\",\n        \"return_handler|statements_or_none+setter\",\n    )\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\"tried_may_raise\",)\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    def postInitNode(self):\n        self.tried_may_raise = None\n\n    def getDetailsForDisplay(self):\n        return {\"aborting\": self.isStatementAborting()}\n\n    def computeStatement(self, trace_collection):\n        # This node has many children to handle, pylint: disable=I0021,too-many-branches,too-many-locals,too-many-statements\n        tried = self.subnode_tried\n\n        except_handler = self.subnode_except_handler\n        break_handler = self.subnode_break_handler\n        continue_handler = self.subnode_continue_handler\n        return_handler = self.subnode_return_handler\n\n        # The tried block must be considered as a branch, if it is not empty\n        # already.\n        collection_start = TraceCollectionBranch(\n            parent=trace_collection, name=\"try start\"\n        )\n\n        abort_context = trace_collection.makeAbortStackContext(\n            catch_breaks=break_handler is not None,\n            catch_continues=continue_handler is not None,\n            catch_returns=return_handler is not None,\n            catch_exceptions=True,\n        )\n\n        with abort_context:\n            # As a branch point for the many types of handlers.\n\n            result = tried.computeStatementsSequence(trace_collection=trace_collection)\n\n            # We might be done entirely already.\n            if result is None:\n                return None, \"new_statements\", \"Removed now empty try statement.\"\n\n            # Might be changed.\n            if result is not tried:\n                self.setChildTried(result)\n                tried = result\n\n            break_collections = trace_collection.getLoopBreakCollections()\n            continue_collections = trace_collection.getLoopContinueCollections()\n            return_collections = trace_collection.getFunctionReturnCollections()\n            exception_collections = trace_collection.getExceptionRaiseCollections()\n\n        # Not raising never turns into raising, but None (never calculated) and True\n        # may no longer be true, but not raising never becomes raising.\n        if self.tried_may_raise is not False:\n            self.tried_may_raise = tried.mayRaiseException(BaseException)\n\n        # Exception handling is useless if no exception is to be raised.\n        if not self.tried_may_raise:\n            if except_handler is not None:\n                # TODO: This is inconsistent with other handlers being cleared, might make sense there too.\n                trace_collection.signalChange(\n                    tags=\"new_statements\",\n                    message=\"Removed useless exception handler.\",\n                    source_ref=except_handler.source_ref,\n                )\n\n                except_handler.finalize()\n                except_handler = None\n\n                self.setChildExceptHandler(None)\n\n        # If tried may raise, even empty exception handler has a meaning to\n        # ignore that exception.\n        if self.tried_may_raise:\n            collection_exception_handling = TraceCollectionBranch(\n                parent=collection_start, name=\"except handler\"\n            )\n\n            # When no exception exits are there, this is a problem, we just\n            # found an inconsistency that is a bug.\n            if not exception_collections:\n                for statement in tried.subnode_statements:\n                    if statement.mayRaiseException(BaseException):\n                        raise NuitkaOptimizationError(\n                            \"This statement does raise but didn't annotate an exception exit.\",\n                            statement,\n                        )\n\n                raise NuitkaOptimizationError(\n                    \"Falsely assuming tried block may raise, but no statement says so.\",\n                    tried,\n                )\n\n            collection_exception_handling.mergeMultipleBranches(exception_collections)\n\n            if except_handler is not None:\n                result = except_handler.computeStatementsSequence(\n                    trace_collection=collection_exception_handling\n                )\n\n                # Might be changed.\n                if result is not except_handler:\n                    except_handler = result\n\n                    self.setChildExceptHandler(result)\n\n        if break_handler is not None:\n            if not tried.mayBreak():\n                break_handler.finalize()\n                break_handler = None\n\n                self.setChildBreakHandler(None)\n\n        if break_handler is not None:\n            collection_break = TraceCollectionBranch(\n                parent=collection_start, name=\"break handler\"\n            )\n\n            collection_break.mergeMultipleBranches(break_collections)\n\n            result = break_handler.computeStatementsSequence(\n                trace_collection=collection_break\n            )\n\n            # Might be changed.\n            if result is not break_handler:\n                self.setChildBreakHandler(result)\n                break_handler = result\n\n        if continue_handler is not None:\n            if not tried.mayContinue():\n                continue_handler.finalize()\n                continue_handler = None\n\n                self.setChildContinueHandler(None)\n\n        if continue_handler is not None:\n            collection_continue = TraceCollectionBranch(\n                parent=collection_start, name=\"continue handler\"\n            )\n\n            collection_continue.mergeMultipleBranches(continue_collections)\n\n            result = continue_handler.computeStatementsSequence(\n                trace_collection=collection_continue\n            )\n\n            # Might be changed.\n            if result is not continue_handler:\n                continue_handler = result\n\n                self.setChildContinueHandler(result)\n\n        if return_handler is not None:\n            if not tried.mayReturn():\n                return_handler.finalize()\n                return_handler = None\n\n                self.setChildReturnHandler(None)\n\n        if return_handler is not None:\n            collection_return = TraceCollectionBranch(\n                parent=collection_start, name=\"return handler\"\n            )\n\n            collection_return.mergeMultipleBranches(return_collections)\n\n            result = return_handler.computeStatementsSequence(\n                trace_collection=collection_return\n            )\n\n            # Might be changed.\n            if result is not return_handler:\n                return_handler = result\n\n                self.setChildReturnHandler(result)\n\n        # Check for trivial return handlers that immediately return, they can\n        # just be removed.\n        if return_handler is not None:\n            if return_handler.subnode_statements[0].isStatementReturnReturnedValue():\n                return_handler.finalize()\n                return_handler = None\n\n                self.setChildReturnHandler(None)\n\n        # Merge exception handler only if it is used. Empty means it is not\n        # aborting, as it swallows the exception.\n        if self.tried_may_raise and (\n            except_handler is None or not except_handler.isStatementAborting()\n        ):\n            if tried.isStatementAborting():\n                trace_collection.variable_actives = (\n                    collection_exception_handling.variable_actives\n                )\n            else:\n                trace_collection.mergeBranches(\n                    collection_yes=collection_exception_handling, collection_no=None\n                )\n\n        # An empty exception handler means we have to swallow exception.\n        if (\n            (\n                not self.tried_may_raise\n                or (\n                    except_handler is not None\n                    and except_handler.subnode_statements[\n                        0\n                    ].isStatementReraiseException()\n                )\n            )\n            and break_handler is None\n            and continue_handler is None\n            and return_handler is None\n        ):\n            return (\n                tried,\n                \"new_statements\",\n                \"Removed useless try, all handlers became empty.\",\n            )\n\n        tried_statements = tried.subnode_statements\n\n        pre_statements = []\n\n        while tried_statements:\n            tried_statement = tried_statements[0]\n\n            if tried_statement.mayRaiseException(BaseException):\n                break\n\n            if break_handler is not None and tried_statement.mayBreak():\n                break\n\n            if continue_handler is not None and tried_statement.mayContinue():\n                break\n\n            if return_handler is not None and tried_statement.mayReturn():\n                break\n\n            pre_statements.append(tried_statement)\n            tried_statements = list(tried_statements)\n\n            del tried_statements[0]\n\n        post_statements = []\n\n        if except_handler is not None and except_handler.isStatementAborting():\n            while tried_statements:\n                tried_statement = tried_statements[-1]\n\n                if tried_statement.mayRaiseException(BaseException):\n                    break\n\n                if break_handler is not None and tried_statement.mayBreak():\n                    break\n\n                if continue_handler is not None and tried_statement.mayContinue():\n                    break\n\n                if return_handler is not None and tried_statement.mayReturn():\n                    break\n\n                post_statements.insert(0, tried_statement)\n                tried_statements = list(tried_statements)\n\n                del tried_statements[-1]\n\n        if pre_statements or post_statements:\n            assert tried_statements  # Should be dealt with already\n\n            tried.setChildStatements(tuple(tried_statements))\n\n            result = StatementsSequence(\n                statements=tuple(pre_statements + [self] + post_statements),\n                source_ref=self.source_ref,\n            )\n\n            def explain():\n                # TODO: We probably don't want to say this for re-formulation ones.\n                result = \"Reduced scope of tried block.\"\n\n                if pre_statements:\n                    result += \" Leading statements at %s.\" % (\n                        \",\".join(\n                            x.getSourceReference().getAsString() + \"/\" + str(x)\n                            for x in pre_statements\n                        )\n                    )\n\n                if post_statements:\n                    result += \" Trailing statements at %s.\" % (\n                        \",\".join(\n                            x.getSourceReference().getAsString() + \"/\" + str(x)\n                            for x in post_statements\n                        )\n                    )\n\n                return result\n\n            return (result, \"new_statements\", explain)\n\n        return self, None, None\n\n    def mayReturn(self):\n        # TODO: If we optimized return handler away, this would be not needed\n        # or even non-optimal.\n        if self.subnode_tried.mayReturn():\n            return True\n\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is not None and except_handler.mayReturn():\n                return True\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and break_handler.mayReturn():\n            return True\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and continue_handler.mayReturn():\n            return True\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and return_handler.mayReturn():\n            return True\n\n        return False\n\n    def mayBreak(self):\n        # TODO: If we optimized return handler away, this would be not needed\n        # or even non-optimal.\n        if self.subnode_tried.mayBreak():\n            return True\n\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is not None and except_handler.mayBreak():\n                return True\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and break_handler.mayBreak():\n            return True\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and continue_handler.mayBreak():\n            return True\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and return_handler.mayBreak():\n            return True\n\n        return False\n\n    def mayContinue(self):\n        # TODO: If we optimized return handler away, this would be not needed\n        # or even non-optimal.\n        if self.subnode_tried.mayContinue():\n            return True\n\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is not None and except_handler.mayContinue():\n                return True\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and break_handler.mayContinue():\n            return True\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and continue_handler.mayContinue():\n            return True\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and return_handler.mayContinue():\n            return True\n\n        return False\n\n    def isStatementAborting(self):\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is None or not except_handler.isStatementAborting():\n                return False\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and not break_handler.isStatementAborting():\n            return False\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and not continue_handler.isStatementAborting():\n            return False\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and not return_handler.isStatementAborting():\n            return False\n\n        return self.subnode_tried.isStatementAborting()\n\n    def mayRaiseException(self, exception_type):\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is not None and except_handler.mayRaiseException(\n                exception_type\n            ):\n                return True\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and break_handler.mayRaiseException(\n            exception_type\n        ):\n            return True\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and continue_handler.mayRaiseException(\n            exception_type\n        ):\n            return True\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and return_handler.mayRaiseException(\n            exception_type\n        ):\n            return True\n\n        return False\n\n    def needsFrame(self):\n        if self.tried_may_raise is not False:\n            except_handler = self.subnode_except_handler\n\n            if except_handler is not None and except_handler.needsFrame():\n                return True\n\n        break_handler = self.subnode_break_handler\n\n        if break_handler is not None and break_handler.needsFrame():\n            return True\n\n        continue_handler = self.subnode_continue_handler\n\n        if continue_handler is not None and continue_handler.needsFrame():\n            return True\n\n        return_handler = self.subnode_return_handler\n\n        if return_handler is not None and return_handler.needsFrame():\n            return True\n\n        return self.subnode_tried.needsFrame()\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"tried block statement\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/TypeMatchNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Dedicated nodes used for the 3.10 matching\n\nNot usable with older Python as it depends on type flags not present.\n\"\"\"\n\nfrom .ChildrenHavingMixins import ChildHavingValueMixin\nfrom .ExpressionBases import ExpressionBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\n\n\nclass ExpressionMatchTypeCheckBase(\n    ExpressionBoolShapeExactMixin,\n    SideEffectsFromChildrenMixin,\n    ChildHavingValueMixin,\n    ExpressionBase,\n):\n    named_children = (\"value\",)\n\n    def __init__(self, value, source_ref):\n        ChildHavingValueMixin.__init__(self, value=value)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n\nclass ExpressionMatchTypeCheckSequence(ExpressionMatchTypeCheckBase):\n    kind = \"EXPRESSION_MATCH_TYPE_CHECK_SEQUENCE\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict, based on argument\n        # shape, this could evaluate to statically True/False and then will allow\n        # optimization into match branches.\n        return self, None, None\n\n\nclass ExpressionMatchTypeCheckMapping(ExpressionMatchTypeCheckBase):\n    kind = \"EXPRESSION_MATCH_TYPE_CHECK_MAPPING\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict, based on argument\n        # shape, this could evaluate to statically True/False and then will allow\n        # optimization into match branches.\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/TypeNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" The type nodes.\n\nThese ones deal with types and they are great for optimization. We need to know\nthem, their relationship or check for them in re-formulations.\n\n\"\"\"\n\nfrom nuitka.__past__ import GenericAlias\nfrom nuitka.Builtins import builtin_names\nfrom nuitka.Options import isExperimental\n\nfrom .BuiltinRefNodes import (\n    ExpressionBuiltinAnonymousRef,\n    ExpressionBuiltinRef,\n    makeExpressionBuiltinRef,\n)\nfrom .ChildrenHavingMixins import (\n    ChildHavingClsMixin,\n    ChildrenExpressionBuiltinIssubclassMixin,\n    ChildrenExpressionBuiltinSuper0Mixin,\n    ChildrenExpressionBuiltinSuper1Mixin,\n    ChildrenExpressionBuiltinSuper2Mixin,\n    ChildrenHavingInstanceClassesMixin,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase\nfrom .ExpressionBasesGenerated import ExpressionSubtypeCheckBase\nfrom .ExpressionShapeMixins import ExpressionBoolShapeExactMixin\nfrom .NodeBases import SideEffectsFromChildrenMixin\nfrom .NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    wrapExpressionWithNodeSideEffects,\n)\nfrom .shapes.BuiltinTypeShapes import tshape_type\n\n\nclass ExpressionBuiltinType1(ExpressionBuiltinSingleArgBase):\n    kind = \"EXPRESSION_BUILTIN_TYPE1\"\n\n    def computeExpression(self, trace_collection):\n        value = self.subnode_value\n\n        type_shape = value.getTypeShape()\n\n        if type_shape is not None:\n            type_name = type_shape.getTypeName()\n\n            if type_name is not None:\n                if isExperimental(\"assume-type-complete\") and hasattr(\n                    type_shape, \"typical_value\"\n                ):\n                    result = makeConstantReplacementNode(\n                        constant=type(getattr(type_shape, \"typical_value\")),\n                        node=self,\n                        user_provided=False,\n                    )\n                elif type_name in __builtins__:\n                    result = ExpressionBuiltinRef(\n                        builtin_name=type_name, source_ref=value.getSourceReference()\n                    )\n                else:\n                    result = None\n\n                # TODO: Does this even happen to be not None\n                if result is not None:\n                    result = wrapExpressionWithNodeSideEffects(\n                        new_node=result, old_node=value\n                    )\n\n                    return (\n                        result,\n                        \"new_builtin\",\n                        \"Replaced predictable type lookup with builtin type '%s'.\"\n                        % (type_name),\n                    )\n\n        if value.isCompileTimeConstant():\n            # The above code is supposed to catch these in a better way.\n            value = value.getCompileTimeConstant()\n\n            if type(value) is GenericAlias:\n                type_name = \"GenericAlias\"\n            else:\n                type_name = value.__class__.__name__\n\n            if type_name in builtin_names:\n                new_node = makeExpressionBuiltinRef(\n                    builtin_name=type_name,\n                    locals_scope=None,\n                    source_ref=self.source_ref,\n                )\n            else:\n                new_node = ExpressionBuiltinAnonymousRef(\n                    builtin_name=type_name, source_ref=self.source_ref\n                )\n\n            return (\n                new_node,\n                \"new_builtin\",\n                \"Replaced predictable type lookup with builtin type '%s'.\"\n                % (type_name),\n            )\n\n        return self, None, None\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_type\n\n    def computeExpressionDrop(self, statement, trace_collection):\n        from .NodeMakingHelpers import (\n            makeStatementExpressionOnlyReplacementNode,\n        )\n\n        result = makeStatementExpressionOnlyReplacementNode(\n            expression=self.subnode_value, node=statement\n        )\n\n        return (\n            result,\n            \"new_statements\",\n            \"\"\"\\\nRemoved type taking for unused result.\"\"\",\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_value.mayRaiseException(exception_type)\n\n    def mayHaveSideEffects(self):\n        return self.subnode_value.mayHaveSideEffects()\n\n\nclass ExpressionBuiltinSuper1(ChildrenExpressionBuiltinSuper1Mixin, ExpressionBase):\n    \"\"\"Two arguments form of super.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_SUPER1\"\n\n    named_children = (\"type_arg\",)\n\n    def __init__(self, type_arg, source_ref):\n        ChildrenExpressionBuiltinSuper1Mixin.__init__(\n            self,\n            type_arg=type_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Quite some cases should be possible to predict.\n        return self, None, None\n\n\nclass ExpressionBuiltinSuper2(ChildrenExpressionBuiltinSuper2Mixin, ExpressionBase):\n    \"\"\"Two arguments form of super.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_SUPER2\"\n\n    named_children = (\"type_arg\", \"object_arg\")\n\n    def __init__(self, type_arg, object_arg, source_ref):\n        ChildrenExpressionBuiltinSuper2Mixin.__init__(\n            self,\n            type_arg=type_arg,\n            object_arg=object_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Quite some cases should be possible to predict.\n        return self, None, None\n\n\nclass ExpressionBuiltinSuper0(ChildrenExpressionBuiltinSuper0Mixin, ExpressionBase):\n    \"\"\"Python3 form of super, arguments determined from cells and function arguments.\"\"\"\n\n    kind = \"EXPRESSION_BUILTIN_SUPER0\"\n\n    named_children = (\"type_arg\", \"object_arg\")\n\n    def __init__(self, type_arg, object_arg, source_ref):\n        ChildrenExpressionBuiltinSuper0Mixin.__init__(\n            self,\n            type_arg=type_arg,\n            object_arg=object_arg,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # TODO: Quite some cases should be possible to predict.\n        return self, None, None\n\n\nclass ExpressionBuiltinIsinstance(ChildrenHavingInstanceClassesMixin, ExpressionBase):\n    kind = \"EXPRESSION_BUILTIN_ISINSTANCE\"\n\n    named_children = (\"instance\", \"classes\")\n\n    def __init__(self, instance, classes, source_ref):\n        ChildrenHavingInstanceClassesMixin.__init__(\n            self,\n            instance=instance,\n            classes=classes,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict.\n\n        instance = self.subnode_instance\n\n        # TODO: Should be possible to query run time type instead, but we don't\n        # have that method yet. Later this will be essential.\n        if not instance.isCompileTimeConstant():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        classes = self.subnode_classes\n\n        if not classes.isCompileTimeConstant():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        # So if both are compile time constant, we are able to compute it.\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: isinstance(\n                instance.getCompileTimeConstant(), classes.getCompileTimeConstant()\n            ),\n            description=\"Built-in call to 'isinstance' computed.\",\n        )\n\n\nclass ExpressionBuiltinIssubclass(\n    ChildrenExpressionBuiltinIssubclassMixin, ExpressionBase\n):\n    kind = \"EXPRESSION_BUILTIN_ISSUBCLASS\"\n\n    named_children = (\"cls\", \"classes\")\n\n    def __init__(self, cls, classes, source_ref):\n        ChildrenExpressionBuiltinIssubclassMixin.__init__(\n            self,\n            cls=cls,\n            classes=classes,\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict.\n\n        cls = self.subnode_cls\n\n        # TODO: Should be possible to query run time type instead, but we don't\n        # have that method yet. Later this will be essential.\n        if not cls.isCompileTimeConstant():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        classes = self.subnode_classes\n\n        if not classes.isCompileTimeConstant():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        # So if both are compile time constant, we are able to compute it.\n        return trace_collection.getCompileTimeComputationResult(\n            node=self,\n            computation=lambda: issubclass(\n                cls.getCompileTimeConstant(), classes.getCompileTimeConstant()\n            ),\n            description=\"Built-in call to 'issubclass' computed.\",\n        )\n\n\nclass ExpressionTypeCheck(\n    ExpressionBoolShapeExactMixin,\n    SideEffectsFromChildrenMixin,\n    ChildHavingClsMixin,\n    ExpressionBase,\n):\n    kind = \"EXPRESSION_TYPE_CHECK\"\n\n    named_children = (\"cls\",)\n\n    def __init__(self, cls, source_ref):\n        ChildHavingClsMixin.__init__(self, cls=cls)\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        # TODO: Quite some cases should be possible to predict, but I am not aware of\n        # 100% true Python equivalent at this time.\n        return self, None, None\n\n\nclass ExpressionSubtypeCheck(\n    ExpressionBoolShapeExactMixin,\n    SideEffectsFromChildrenMixin,\n    ExpressionSubtypeCheckBase,\n):\n    kind = \"EXPRESSION_SUBTYPE_CHECK\"\n\n    named_children = (\"left\", \"right\")\n\n    auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # TODO: This needs to check the MRO and can assume the type nature, since it's only coming\n        # from re-formulations that guarantee that.\n        return self, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/VariableAssignNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Assignment related nodes.\n\nThe most simple assignment statement ``a = b`` is what we have here. All others\nare either re-formulated using temporary variables, e.g. ``a, b = c`` or are\nattribute, slice, subscript assignments.\n\nThe deletion is a separate node unlike in CPython where assigning to ``NULL`` is\ninternally what deletion is. But deleting is something entirely different to us\nduring code generation, which is why we keep them separate.\n\nTracing assignments in SSA form is the core of optimization for which we use\nthe traces.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.ModuleRegistry import getOwnerFromCodeName\nfrom nuitka.Options import isExperimental\n\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .NodeMakingHelpers import (\n    makeStatementExpressionOnlyReplacementNode,\n    makeStatementsSequenceReplacementNode,\n)\nfrom .shapes.ControlFlowDescriptions import (\n    ControlFlowDescriptionElementBasedEscape,\n    ControlFlowDescriptionFullEscape,\n    ControlFlowDescriptionNoEscape,\n)\nfrom .shapes.StandardShapes import tshape_iterator, tshape_unknown\nfrom .StatementBasesGenerated import (\n    StatementAssignmentVariableConstantImmutableBase,\n    StatementAssignmentVariableConstantMutableBase,\n    StatementAssignmentVariableFromTempVariableBase,\n    StatementAssignmentVariableFromVariableBase,\n    StatementAssignmentVariableGenericBase,\n    StatementAssignmentVariableHardValueBase,\n    StatementAssignmentVariableIteratorBase,\n)\nfrom .VariableDelNodes import makeStatementDelVariable\nfrom .VariableRefNodes import ExpressionTempVariableRef\n\n\nclass StatementAssignmentVariableMixin(object):\n    \"\"\"Assignment to a variable from an expression.\n\n    All assignment forms that are not to attributes, slices, subscripts\n    use this.\n\n    The source might be a complex expression. The target can be any kind\n    of variable, temporary, local, global, etc.\n\n    Assigning a variable is something we trace in a new version, this is\n    hidden behind target variable reference, which has this version once\n    it can be determined.\n    \"\"\"\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    @staticmethod\n    def isStatementAssignmentVariable():\n        return True\n\n    def finalize(self):\n        del self.variable\n        del self.variable_trace\n        self.subnode_source.finalize()\n        del self.subnode_source\n\n    def getDetailsForDisplay(self):\n        return {\n            \"variable_name\": self.getVariableName(),\n            \"is_temp\": self.variable.isTempVariable(),\n            \"var_type\": self.variable.getVariableType(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        # Virtual method overload, pylint: disable=unused-argument\n        owner = getOwnerFromCodeName(args[\"owner\"])\n\n        if args[\"is_temp\"] == \"True\":\n            variable = owner.createTempVariable(\n                args[\"variable_name\"], temp_type=[\"var_type\"]\n            )\n        else:\n            variable = owner.getProvidedVariable(args[\"variable_name\"])\n\n        del args[\"is_temp\"]\n        del args[\"var_type\"]\n        del args[\"owner\"]\n\n        version = variable.allocateTargetNumber()\n\n        return cls(variable=variable, version=version, source_ref=source_ref, **args)\n\n    def makeClone(self):\n        version = self.variable.allocateTargetNumber()\n\n        return self.__class__(\n            source=self.subnode_source.makeClone(),\n            variable=self.variable,\n            variable_version=version,\n            source_ref=self.source_ref,\n        )\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getVariable(self):\n        return self.variable\n\n    def setVariable(self, variable):\n        self.variable = variable\n        self.variable_version = variable.allocateTargetNumber()\n\n    def getVariableTrace(self):\n        return self.variable_trace\n\n    def markAsInplaceSuspect(self):\n        self.inplace_suspect = True\n\n    def isInplaceSuspect(self):\n        return self.inplace_suspect\n\n    def removeMarkAsInplaceSuspect(self):\n        self.inplace_suspect = False\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_source.mayRaiseException(exception_type)\n\n    def needsReleasePreviousValue(self):\n        previous = self.variable_trace.getPrevious()\n\n        if previous.mustNotHaveValue():\n            return False\n        elif previous.mustHaveValue():\n            return True\n        else:\n            return None\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"variable assignment statement\"\n\n    def getTypeShape(self):\n        # Might be finalized, e.g. due to being dead code.\n        try:\n            source = self.subnode_source\n        except AttributeError:\n            return tshape_unknown\n\n        return source.getTypeShape()\n\n    @staticmethod\n    def mayHaveSideEffects():\n        # TODO: May execute \"__del__\" code, it would be sweet to be able to predict\n        # if another reference will still be active for a value though, or if there\n        # is such a code for the type shape.\n        return True\n\n    def _considerSpecialization(self, old_source, source):\n        if source.isCompileTimeConstant():\n            result = makeStatementAssignmentVariableConstant(\n                source=source,\n                variable=self.variable,\n                variable_version=self.variable_version,\n                very_trusted=old_source.isExpressionImportName(),\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"Assignment source of '%s' is now compile time constant.\"\n                % self.getVariableName(),\n            )\n\n        if source.isExpressionVariableRef():\n            result = StatementAssignmentVariableFromVariable(\n                source=source,\n                variable=self.variable,\n                variable_version=self.variable_version,\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"Assignment source is now variable reference.\",\n            )\n\n        if source.isExpressionTempVariableRef():\n            result = StatementAssignmentVariableFromTempVariable(\n                source=source,\n                variable=self.variable,\n                variable_version=self.variable_version,\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"Assignment source is now temp variable reference.\",\n            )\n\n        if source.getTypeShape().isShapeIterator():\n            result = StatementAssignmentVariableIterator(\n                source=source,\n                variable=self.variable,\n                variable_version=self.variable_version,\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"Assignment source is now known to be iterator.\",\n            )\n\n        if source.hasVeryTrustedValue():\n            result = StatementAssignmentVariableHardValue(\n                source=source,\n                variable=self.variable,\n                variable_version=self.variable_version,\n                source_ref=self.source_ref,\n            )\n\n            return (\n                result,\n                \"new_statements\",\n                \"Assignment source is now known to be hard import.\",\n            )\n\n        return self, None, None\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        emit_write(self.variable)\n        self.subnode_source.collectVariableAccesses(emit_read, emit_write)\n\n    @abstractmethod\n    def hasVeryTrustedValue(self):\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n\n    @abstractmethod\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        \"\"\"Set the value trace for the assignment form.\"\"\"\n\n\nclass StatementAssignmentVariableGeneric(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableGenericBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_GENERIC\"\n\n    named_children = (\"source|setter\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionFullEscape\n\n    def computeStatement(self, trace_collection):\n        # TODO: Way too ugly to have global trace kinds just here, and needs to\n        # be abstracted somehow. But for now we let it live here.\n        old_source = self.subnode_source\n        variable = self.variable\n\n        if old_source.isExpressionSideEffects():\n            # If the assignment source has side effects, we can put them into a\n            # sequence and compute that instead.\n            statements = [\n                makeStatementExpressionOnlyReplacementNode(side_effect, self)\n                for side_effect in old_source.subnode_side_effects\n            ]\n\n            statements.append(self)\n\n            # Remember out parent, we will assign it for the sequence to use.\n            parent = self.parent\n\n            # Need to update ourselves to no longer reference the side effects,\n            # but go to the wrapped thing.\n            self.setChildSource(old_source.subnode_expression)\n\n            result = makeStatementsSequenceReplacementNode(\n                statements=statements, node=self\n            )\n            result.parent = parent\n\n            return (\n                result.computeStatementsSequence(trace_collection),\n                \"new_statements\",\n                \"\"\"\\\nSide effects of assignments promoted to statements.\"\"\",\n            )\n\n        # Let assignment source may re-compute first.\n        source = trace_collection.onExpression(self.subnode_source)\n\n        # No assignment will occur, if the assignment source raises, so give up\n        # on this, and return it as the only side effect.\n        if source.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=source, node=self\n            )\n\n            del self.parent\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nAssignment raises exception in assigned value, removed assignment.\"\"\",\n            )\n\n        # Assigning from and to the same variable, can be optimized away\n        # immediately, there is no point in doing it. Exceptions are of course\n        # module variables that collide with built-in names.\n\n        # TODO: The variable type checks ought to become unnecessary, as they\n        # are to be a feature of the trace. Assigning from known assigned is\n        # supposed to be possible to eliminate. If we get that wrong, we are\n        # doing it wrong.\n        if (\n            not variable.isModuleVariable()\n            and source.isExpressionVariableRef()\n            and source.getVariable() is variable\n        ):\n            # A variable access that has a side effect, must be preserved,\n            # so it can e.g. raise an exception, otherwise we can be fully\n            # removed.\n            if source.mayHaveSideEffects():\n                result = makeStatementExpressionOnlyReplacementNode(\n                    expression=source, node=self\n                )\n\n                return (\n                    result,\n                    \"new_statements\",\n                    \"\"\"\\\nLowered assignment of %s from itself to mere access of it.\"\"\"\n                    % variable.getDescription(),\n                )\n            else:\n                return (\n                    None,\n                    \"new_statements\",\n                    \"\"\"\\\nRemoved assignment of %s from itself which is known to be defined.\"\"\"\n                    % variable.getDescription(),\n                )\n\n        if source is old_source:\n            result = self, None, None\n        else:\n            result = self._considerSpecialization(old_source, source)\n            result[0].parent = self.parent\n\n        result[0].computeStatementAssignmentTraceUpdate(trace_collection, source)\n\n        return result\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        # Set-up the trace to the trace collection, so future references will\n        # find this assignment.\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n        # TODO: Determine from future use of assigned variable, if this is needed at all.\n        trace_collection.removeKnowledge(source)\n\n    def hasVeryTrustedValue(self):\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return self.subnode_source.hasVeryTrustedValue()\n\n\nclass StatementAssignmentVariableIterator(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableIteratorBase\n):\n    # Carries state for propagating iterators potentially.\n\n    # TODO: Maybe have a namedtuple with these intended for index replacement,\n    # they form once set of things pylint: disable=too-many-instance-attributes\n\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_ITERATOR\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n        \"type_shape\",\n        \"temp_scope\",\n        \"tmp_iterated_variable\",\n        \"tmp_iteration_count_variable\",\n        \"tmp_iteration_next_variable\",\n        \"is_indexable\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n        # Have a valid start value, later this will become more specific.\n        self.type_shape = tshape_iterator\n\n        # For replacing with indexing potentially.\n        self.temp_scope = None\n        self.tmp_iterated_variable = None\n        self.tmp_iteration_count_variable = None\n        self.tmp_iteration_next_variable = None\n\n        # When found non-indexable, we do not try again.\n        self.is_indexable = None\n\n    def getTypeShape(self):\n        return self.type_shape\n\n    @staticmethod\n    def getReleaseEscape():\n        # TODO: For iteration over constants that wouldn't be necessary,\n        # but if we know the iteration well enough, it's supposed to be\n        # converted to something else anyway.\n        return ControlFlowDescriptionElementBasedEscape\n\n    def getIterationIndexDesc(self):\n        \"\"\"For use in optimization outputs only, here and using nodes.\"\"\"\n        return \"'%s[%s]'\" % (\n            self.tmp_iterated_variable.getName(),\n            self.tmp_iteration_count_variable.getName(),\n        )\n\n    def _replaceWithDirectAccess(self, trace_collection, provider):\n        self.temp_scope = provider.allocateTempScope(\"iterator_access\")\n\n        self.tmp_iterated_variable = provider.allocateTempVariable(\n            temp_scope=self.temp_scope, name=\"iterated_value\", temp_type=\"object\"\n        )\n\n        reference_iterated = ExpressionTempVariableRef(\n            variable=self.tmp_iterated_variable,\n            source_ref=self.subnode_source.source_ref,\n        )\n\n        iterated_value = self.subnode_source.subnode_value\n\n        assign_iterated = makeStatementAssignmentVariable(\n            source=iterated_value,\n            variable=self.tmp_iterated_variable,\n            source_ref=iterated_value.source_ref,\n        )\n\n        self.tmp_iteration_count_variable = provider.allocateTempVariable(\n            temp_scope=self.temp_scope, name=\"iteration_count\", temp_type=\"object\"\n        )\n\n        assign_iteration_count = makeStatementAssignmentVariable(\n            source=makeConstantRefNode(constant=0, source_ref=self.source_ref),\n            variable=self.tmp_iteration_count_variable,\n            source_ref=iterated_value.source_ref,\n        )\n\n        # TODO: Unclear what node this really is right now, need to try out.\n        self.subnode_source.setChildValue(reference_iterated)\n\n        # Make sure variable trace is computed.\n        assign_iterated.computeStatement(trace_collection)\n        assign_iteration_count.computeStatement(trace_collection)\n        reference_iterated.computeExpressionRaw(trace_collection)\n\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable,\n            version=self.variable_version,\n            assign_node=self,\n        )\n\n        # For use when the \"next\" is replaced.\n        self.tmp_iteration_next_variable = provider.allocateTempVariable(\n            temp_scope=self.temp_scope, name=\"next_value\", temp_type=\"object\"\n        )\n\n        result = makeStatementsSequenceReplacementNode(\n            (assign_iteration_count, assign_iterated, self), self\n        )\n\n        return (\n            result,\n            \"new_statements\",\n            lambda: \"Enabling indexing of iterated value through %s.\"\n            % self.getIterationIndexDesc(),\n        )\n\n    def computeStatement(self, trace_collection):\n        # TODO: Way too ugly to have global trace kinds just here, and needs to\n        # be abstracted somehow. But for now we let it live here.\n        source = self.subnode_source\n        variable = self.variable\n\n        provider = trace_collection.getOwner()\n\n        # Let assignment source may re-compute first.\n        source = trace_collection.onExpression(self.subnode_source)\n\n        if (\n            self.tmp_iterated_variable is None\n            and self.is_indexable is None\n            and source.isExpressionBuiltinIterForUnpack()\n            and isExperimental(\"iterator-optimization\")\n        ):\n            if variable.hasAccessesOutsideOf(provider) is False:\n                last_trace = variable.getMatchingUnescapedAssignTrace(self)\n\n                if last_trace is not None:\n                    # Might not be allowed, remember if it's not allowed, otherwise retry.\n                    self.is_indexable = (\n                        source.subnode_value.getTypeShape().hasShapeIndexLookup()\n                    )\n\n                    if self.is_indexable:\n                        return self._replaceWithDirectAccess(\n                            trace_collection=trace_collection, provider=provider\n                        )\n\n        # No assignment will occur, if the assignment source raises, so give up\n        # on this, and return it as the only side effect.\n        if source.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=source, node=self\n            )\n\n            del self.parent\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nAssignment raises exception in assigned value, removed assignment.\"\"\",\n            )\n\n        self.type_shape = source.getTypeShape()\n\n        # Set-up the trace to the trace collection, so future references will\n        # find this assignment.\n        # Note: Keep this aligned with computeStatementAssignmentTraceUpdate\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=variable, version=self.variable_version, assign_node=self\n        )\n\n        return self, None, None\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return False\n\n\nclass StatementAssignmentVariableConstantMutable(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableConstantMutableBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_MUTABLE\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionNoEscape\n\n    def computeStatement(self, trace_collection):\n        variable = self.variable\n\n        # Set-up the trace to the trace collection, so future references will\n        # find this assignment.\n        # Note: Keep this aligned with computeStatementAssignmentTraceUpdate\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=variable, version=self.variable_version, assign_node=self\n        )\n\n        provider = trace_collection.getOwner()\n\n        if variable.hasAccessesOutsideOf(provider) is False:\n            last_trace = variable.getMatchingAssignTrace(self)\n\n            if last_trace is not None and not last_trace.getMergeOrNameUsageCount():\n                if (\n                    variable.isModuleVariable()\n                    or variable.owner.locals_scope.isUnoptimizedFunctionScope()\n                ):\n                    # TODO: We do not trust these yet a lot, but more might be\n                    pass\n                else:\n                    # Unused constants can be eliminated in any case.\n                    if not last_trace.getUsageCount():\n                        if not last_trace.getPrevious().isUnassignedTrace():\n                            result = makeStatementDelVariable(\n                                variable=self.variable,\n                                version=self.variable_version,\n                                tolerant=True,\n                                source_ref=self.source_ref,\n                            )\n                        else:\n                            result = None\n\n                        return (\n                            result,\n                            \"new_statements\",\n                            \"Dropped dead assignment statement to '%s'.\"\n                            % (self.getVariableName()),\n                        )\n\n                    # Can safely forward propagate only non-mutable constants.\n\n        return self, None, None\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return False\n\n\nclass StatementAssignmentVariableConstantImmutable(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableConstantImmutableBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_IMMUTABLE\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionNoEscape\n\n    def computeStatement(self, trace_collection):\n        variable = self.variable\n\n        # Set-up the trace to the trace collection, so future references will\n        # find this assignment.\n        provider = trace_collection.getOwner()\n\n        if variable.hasAccessesOutsideOf(provider) is False:\n            last_trace = variable.getMatchingAssignTrace(self)\n\n            if last_trace is not None and not last_trace.getMergeOrNameUsageCount():\n                if (\n                    variable.isModuleVariable()\n                    or variable.owner.locals_scope.isUnoptimizedFunctionScope()\n                ):\n                    # TODO: We do not trust these yet a lot, but more might be\n                    pass\n                else:\n                    # Unused constants can be eliminated in any case.\n                    if not last_trace.getUsageCount():\n                        if not last_trace.getPrevious().isUnassignedTrace():\n                            return trace_collection.computedStatementResult(\n                                statement=makeStatementDelVariable(\n                                    variable=self.variable,\n                                    version=self.variable_version,\n                                    tolerant=True,\n                                    source_ref=self.source_ref,\n                                ),\n                                change_tags=\"new_statements\",\n                                change_desc=\"Lowered dead assignment statement to '%s' to previous value 'del'.\"\n                                % self.getVariableName(),\n                            )\n                        else:\n                            return (\n                                None,\n                                \"new_statements\",\n                                \"Dropped dead assignment statement to '%s'.\"\n                                % (self.getVariableName()),\n                            )\n\n                    # Still trace or assignment, for the last time. TODO: Maybe this can be\n                    # used for the keeping of the \"replacement node\" as well.\n                    self.variable_trace = trace_collection.onVariableSetToUnescapablePropagatedValue(\n                        variable=variable,\n                        version=self.variable_version,\n                        assign_node=self,\n                        replacement=lambda _replaced_node: self.subnode_source.makeClone(),\n                    )\n\n                    if not last_trace.getPrevious().isUnassignedTrace():\n                        result = makeStatementDelVariable(\n                            variable=self.variable,\n                            version=self.variable_version,\n                            tolerant=True,\n                            source_ref=self.source_ref,\n                        )\n                    else:\n                        result = None\n\n                    return (\n                        result,\n                        \"new_statements\",\n                        \"Dropped propagated assignment statement to '%s'.\"\n                        % self.getVariableName(),\n                    )\n\n        # Note: Keep this aligned with computeStatementAssignmentTraceUpdate\n        self.variable_trace = trace_collection.onVariableSetToUnescapableValue(\n            variable=variable, version=self.variable_version, assign_node=self\n        )\n\n        return self, None, None\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        self.variable_trace = trace_collection.onVariableSetToUnescapableValue(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return False\n\n\nclass StatementAssignmentVariableConstantMutableTrusted(\n    StatementAssignmentVariableConstantImmutable\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_MUTABLE_TRUSTED\"\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        return True\n\n\nclass StatementAssignmentVariableConstantImmutableTrusted(\n    StatementAssignmentVariableConstantImmutable\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_CONSTANT_IMMUTABLE_TRUSTED\"\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        return True\n\n\nclass StatementAssignmentVariableHardValue(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableHardValueBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_HARD_VALUE\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionNoEscape\n\n    def computeStatement(self, trace_collection):\n        # TODO: Way too ugly to have global trace kinds just here, and needs to\n        # be abstracted somehow. But for now we let it live here.\n        variable = self.variable\n\n        # Let assignment source may re-compute first.\n        source = trace_collection.onExpression(self.subnode_source)\n\n        # No assignment will occur, if the assignment source raises, so give up\n        # on this, and return it as the only side effect.\n        if source.willRaiseAnyException():\n            result = makeStatementExpressionOnlyReplacementNode(\n                expression=source, node=self\n            )\n\n            del self.parent\n\n            return (\n                result,\n                \"new_raise\",\n                \"\"\"\\\nAssignment raises exception in assigned value, removed assignment.\"\"\",\n            )\n\n        # Note: Keep this aligned with computeStatementAssignmentTraceUpdate\n        self.variable_trace = trace_collection.onVariableSetToVeryTrustedValue(\n            variable=variable, version=self.variable_version, assign_node=self\n        )\n\n        return self, None, None\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        self.variable_trace = trace_collection.onVariableSetToVeryTrustedValue(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return True\n\n\nclass StatementAssignmentVariableFromVariable(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableFromVariableBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_FROM_VARIABLE\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def getReleaseEscape():\n        # TODO: Variable type may know better.\n        return ControlFlowDescriptionFullEscape\n\n    def computeStatement(self, trace_collection):\n        # TODO: Way too ugly to have global trace kinds just here, and needs to\n        # be abstracted somehow. But for now we let it live here.\n        old_source = self.subnode_source\n        variable = self.variable\n\n        # Assigning from and to the same variable, can be optimized away\n        # immediately, there is no point in doing it. Exceptions are of course\n        # module variables that collide with built-in names. TODO: In\n        # specialization this could be considered right away as its own node\n        # type, waiting for it to compute like this.\n        if not variable.isModuleVariable() and old_source.getVariable() is variable:\n            # A variable access that has a side effect, must be preserved,\n            # so it can e.g. raise an exception, otherwise we can be fully\n            # removed.\n            if old_source.mayHaveSideEffects():\n                result = makeStatementExpressionOnlyReplacementNode(\n                    expression=old_source, node=self\n                )\n\n                result = trace_collection.onStatement(result)\n\n                return (\n                    result,\n                    \"new_statements\",\n                    \"\"\"\\\nLowered assignment of %s from itself to mere access of it.\"\"\"\n                    % variable.getDescription(),\n                )\n            else:\n                return (\n                    None,\n                    \"new_statements\",\n                    \"\"\"\\\nRemoved assignment of %s from itself which is known to be defined.\"\"\"\n                    % variable.getDescription(),\n                )\n\n        # Let assignment source may re-compute first.\n        source = trace_collection.onExpression(self.subnode_source)\n\n        if source is old_source:\n            result = self, None, None\n        else:\n            if source.willRaiseAnyException():\n                result = makeStatementExpressionOnlyReplacementNode(\n                    expression=source, node=self\n                )\n\n                return (\n                    result,\n                    \"new_raise\",\n                    \"\"\"\\\nAssignment raises exception in assigned variable access, removed assignment.\"\"\",\n                )\n\n            result = self._considerSpecialization(old_source, source)\n            result[0].parent = self.parent\n\n        result[0].computeStatementAssignmentTraceUpdate(trace_collection, source)\n\n        return result\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        if source.isExpressionVariableRef():\n            self.variable_trace = trace_collection.onVariableSetAliasing(\n                variable=self.variable,\n                version=self.variable_version,\n                assign_node=self,\n                source=source,\n            )\n        else:\n            # Set-up the trace to the trace collection, so future references will\n            # find this assignment. TODO: We should for non-variables make sure we do\n            # always specialize, since this is no longer a variable once it was\n            # resolved.\n            self.variable_trace = trace_collection.onVariableSet(\n                variable=self.variable, version=self.variable_version, assign_node=self\n            )\n\n            # TODO: Determine from future use of assigned variable, if this is needed at all.\n            trace_collection.removeKnowledge(source)\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return False\n\n\nclass StatementAssignmentVariableFromTempVariable(\n    StatementAssignmentVariableMixin, StatementAssignmentVariableFromTempVariableBase\n):\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_FROM_TEMP_VARIABLE\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"variable\", \"variable_version\")\n    auto_compute_handling = \"post_init\"\n\n    __slots__ = (\n        \"variable_trace\",\n        # TODO: Does every variant have to care here\n        \"inplace_suspect\",\n    )\n\n    # False alarm due to post_init, pylint: disable=attribute-defined-outside-init\n\n    # TODO: Add parsing of node_attributes for init values, so we can avoid these too\n    def postInitNode(self):\n        self.variable_trace = None\n        self.inplace_suspect = None\n\n    @staticmethod\n    def getReleaseEscape():\n        # TODO: Variable type may know better.\n        return ControlFlowDescriptionFullEscape\n\n    def computeStatement(self, trace_collection):\n        # TODO: Way too ugly to have global trace kinds just here, and needs to\n        # be abstracted somehow. But for now we let it live here.\n        old_source = self.subnode_source\n        variable = self.variable\n\n        # Assigning from and to the same variable, can be optimized away\n        # immediately, there is no point in doing it. Exceptions are of course\n        # module variables that collide with built-in names.\n        if old_source.getVariable() is variable:\n            return (\n                None,\n                \"new_statements\",\n                \"\"\"\\\nRemoved assignment of %s from itself which is known to be defined.\"\"\"\n                % variable.getDescription(),\n            )\n\n        # Let assignment source may re-compute first.\n        source = trace_collection.onExpression(self.subnode_source)\n\n        if source is old_source:\n            result = self, None, None\n        else:\n            result = self._considerSpecialization(old_source, source)\n            result[0].parent = self.parent\n\n        result[0].computeStatementAssignmentTraceUpdate(trace_collection, source)\n\n        return result\n\n    def computeStatementAssignmentTraceUpdate(self, trace_collection, source):\n        # Set-up the trace to the trace collection, so future references will\n        # find this assignment.\n        self.variable_trace = trace_collection.onVariableSet(\n            variable=self.variable, version=self.variable_version, assign_node=self\n        )\n\n        # TODO: Determine from future use of assigned variable, if this is needed at all.\n        trace_collection.removeKnowledge(source)\n\n    @staticmethod\n    def hasVeryTrustedValue():\n        \"\"\"Does this assignment node have a very trusted value.\"\"\"\n        return False\n\n\ndef makeStatementAssignmentVariableConstant(\n    source, variable, variable_version, very_trusted, source_ref\n):\n    if source.isMutable():\n        if very_trusted:\n            return StatementAssignmentVariableConstantMutableTrusted(\n                source=source,\n                variable=variable,\n                source_ref=source_ref,\n                variable_version=variable_version,\n            )\n        else:\n            return StatementAssignmentVariableConstantMutable(\n                source=source,\n                variable=variable,\n                source_ref=source_ref,\n                variable_version=variable_version,\n            )\n    else:\n        if very_trusted:\n            return StatementAssignmentVariableConstantImmutableTrusted(\n                source=source,\n                variable=variable,\n                source_ref=source_ref,\n                variable_version=variable_version,\n            )\n        else:\n            return StatementAssignmentVariableConstantImmutable(\n                source=source,\n                variable=variable,\n                source_ref=source_ref,\n                variable_version=variable_version,\n            )\n\n\ndef makeStatementAssignmentVariable(\n    source, variable, source_ref, variable_version=None\n):\n    assert source is not None, source_ref\n\n    if variable_version is None:\n        variable_version = variable.allocateTargetNumber()\n\n    if source.isCompileTimeConstant():\n        return makeStatementAssignmentVariableConstant(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            very_trusted=False,\n            source_ref=source_ref,\n        )\n    elif source.isExpressionVariableRef():\n        return StatementAssignmentVariableFromVariable(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            source_ref=source_ref,\n        )\n    elif source.isExpressionTempVariableRef():\n        return StatementAssignmentVariableFromTempVariable(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            source_ref=source_ref,\n        )\n    elif source.getTypeShape().isShapeIterator():\n        return StatementAssignmentVariableIterator(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            source_ref=source_ref,\n        )\n    elif source.hasVeryTrustedValue():\n        return StatementAssignmentVariableHardValue(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            source_ref=source_ref,\n        )\n    else:\n        return StatementAssignmentVariableGeneric(\n            source=source,\n            variable=variable,\n            variable_version=variable_version,\n            source_ref=source_ref,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/VariableDelNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for variable deletion\n\nThese refer to resolved variable objects.\n\n\"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.ModuleRegistry import getOwnerFromCodeName\nfrom nuitka.Options import isExperimental\nfrom nuitka.PythonVersions import getUnboundLocalErrorErrorTemplate\n\nfrom .NodeBases import StatementBase\nfrom .NodeMakingHelpers import makeRaiseExceptionReplacementStatement\nfrom .VariableReleaseNodes import makeStatementReleaseVariable\n\n\nclass StatementDelVariableBase(StatementBase):\n    \"\"\"Deleting a variable.\n\n    All del forms that are not to attributes, slices, subscripts\n    use this.\n\n    The target can be any kind of variable, temporary, local, global, etc.\n\n    Deleting a variable is something we trace in a new version, this is\n    hidden behind target variable reference, which has this version once\n    it can be determined.\n\n    Tolerance means that the value might be unset. That can happen with\n    re-formulation of ours, and Python3 exception variables.\n    \"\"\"\n\n    kind = \"STATEMENT_DEL_VARIABLE\"\n\n    __slots__ = (\n        \"variable\",\n        \"variable_version\",\n        \"variable_trace\",\n        \"previous_trace\",\n    )\n\n    def __init__(self, variable, version, source_ref):\n        if variable is not None:\n            if version is None:\n                version = variable.allocateTargetNumber()\n\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.variable = variable\n        self.variable_version = version\n\n        self.variable_trace = None\n        self.previous_trace = None\n\n    @staticmethod\n    def isStatementDelVariable():\n        return True\n\n    def finalize(self):\n        del self.parent\n        del self.variable\n        del self.variable_trace\n        del self.previous_trace\n\n    def getDetails(self):\n        return {\n            \"variable\": self.variable,\n            \"version\": self.variable_version,\n        }\n\n    def getDetailsForDisplay(self):\n        return {\n            \"variable_name\": self.getVariableName(),\n            \"is_temp\": self.variable.isTempVariable(),\n            \"var_type\": self.variable.getVariableType(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        owner = getOwnerFromCodeName(args[\"owner\"])\n\n        if args[\"is_temp\"] == \"True\":\n            variable = owner.createTempVariable(\n                args[\"variable_name\"], temp_type=args[\"var_type\"]\n            )\n        else:\n            variable = owner.getProvidedVariable(args[\"variable_name\"])\n\n        del args[\"is_temp\"]\n        del args[\"var_type\"]\n        del args[\"owner\"]\n\n        version = variable.allocateTargetNumber()\n        variable.version_number = max(variable.version_number, version)\n\n        return cls(variable=variable, source_ref=source_ref, **args)\n\n    def makeClone(self):\n        if self.variable is not None:\n            version = self.variable.allocateTargetNumber()\n        else:\n            version = None\n\n        return self.__class__(\n            variable=self.variable,\n            version=version,\n            source_ref=self.source_ref,\n        )\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getVariableTrace(self):\n        return self.variable_trace\n\n    def getPreviousVariableTrace(self):\n        return self.previous_trace\n\n    def getVariable(self):\n        return self.variable\n\n    def setVariable(self, variable):\n        self.variable = variable\n        self.variable_version = variable.allocateTargetNumber()\n\n    @abstractmethod\n    def _computeDelWithoutValue(self, trace_collection):\n        \"\"\"For overload, produce result if deleted variable is found known unset.\"\"\"\n\n    def computeStatement(self, trace_collection):\n        variable = self.variable\n\n        # Special case, boolean temp variables need no \"del\".\n        # TODO: Later, these might not exist, if we forward propagate them not as \"del\"\n        # at all\n        if variable.isTempVariableBool():\n            return (\n                None,\n                \"new_statements\",\n                \"Removed 'del' statement of boolean '%s' without effect.\"\n                % (self.getVariableName(),),\n            )\n\n        self.previous_trace = trace_collection.getVariableCurrentTrace(variable)\n\n        # First eliminate us entirely if we can.\n        if self.previous_trace.mustNotHaveValue():\n            return self._computeDelWithoutValue(trace_collection)\n\n        if not self.is_tolerant:\n            self.previous_trace.addNameUsage()\n\n        # TODO: Why doesn't this module variable check not follow from other checks done here, e.g. name usages.\n        # TODO: This currently cannot be done as releases do not create successor traces yet, although they\n        # probably should.\n        if isExperimental(\"del_optimization\") and not variable.isModuleVariable():\n            provider = trace_collection.getOwner()\n\n            if variable.hasAccessesOutsideOf(provider) is False:\n                last_trace = variable.getMatchingDelTrace(self)\n\n                if last_trace is not None and not last_trace.getMergeOrNameUsageCount():\n                    if not last_trace.getUsageCount():\n                        result = makeStatementReleaseVariable(\n                            variable=variable, source_ref=self.source_ref\n                        )\n\n                        return trace_collection.computedStatementResult(\n                            result,\n                            \"new_statements\",\n                            \"Changed del to release for variable '%s' not used afterwards.\"\n                            % variable.getName(),\n                        )\n\n        # If not tolerant, we may exception exit now during the __del__\n        if not self.is_tolerant and not self.previous_trace.mustHaveValue():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Record the deletion, needs to start a new version then.\n        self.variable_trace = trace_collection.onVariableDel(\n            variable=variable, version=self.variable_version, del_node=self\n        )\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        return self, None, None\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        emit_write(self.variable)\n\n\nclass StatementDelVariableTolerant(StatementDelVariableBase):\n    \"\"\"Deleting a variable.\n\n    All del forms that are not to attributes, slices, subscripts\n    use this.\n\n    The target can be any kind of variable, temporary, local, global, etc.\n\n    Deleting a variable is something we trace in a new version, this is\n    hidden behind target variable reference, which has this version once\n    it can be determined.\n\n    Tolerance means that the value might be unset. That can happen with\n    re-formulation of ours, and Python3 exception variables.\n    \"\"\"\n\n    kind = \"STATEMENT_DEL_VARIABLE_TOLERANT\"\n\n    is_tolerant = True\n\n    def getDetailsForDisplay(self):\n        return {\n            \"variable_name\": self.getVariableName(),\n            \"is_temp\": self.variable.isTempVariable(),\n            \"var_type\": self.variable.getVariableType(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    def _computeDelWithoutValue(self, trace_collection):\n        return (\n            None,\n            \"new_statements\",\n            \"Removed tolerant 'del' statement of '%s' without effect.\"\n            % (self.getVariableName(),),\n        )\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n\n\nclass StatementDelVariableIntolerant(StatementDelVariableBase):\n    \"\"\"Deleting a variable.\n\n    All del forms that are not to attributes, slices, subscripts\n    use this.\n\n    The target can be any kind of variable, temporary, local, global, etc.\n\n    Deleting a variable is something we trace in a new version, this is\n    hidden behind target variable reference, which has this version once\n    it can be determined.\n\n    Tolerance means that the value might be unset. That can happen with\n    re-formulation of ours, and Python3 exception variables.\n    \"\"\"\n\n    kind = \"STATEMENT_DEL_VARIABLE_INTOLERANT\"\n\n    is_tolerant = False\n\n    def _computeDelWithoutValue(self, trace_collection):\n        if self.variable.isLocalVariable():\n            result = makeRaiseExceptionReplacementStatement(\n                statement=self,\n                exception_type=\"UnboundLocalError\",\n                exception_value=getUnboundLocalErrorErrorTemplate()\n                % self.variable.getName(),\n            )\n        else:\n            result = makeRaiseExceptionReplacementStatement(\n                statement=self,\n                exception_type=\"NameError\",\n                exception_value=\"\"\"name '%s' is not defined\"\"\"\n                % self.variable.getName(),\n            )\n\n        return trace_collection.computedStatementResult(\n            result,\n            \"new_raise\",\n            \"Variable del of not initialized variable '%s'\" % self.variable.getName(),\n        )\n\n    def mayRaiseException(self, exception_type):\n        if self.variable_trace is not None:\n            # Temporary variables deletions won't raise, just because we\n            # don't create them that way. We can avoid going through SSA in\n            # these cases.\n            if self.variable.isTempVariable():\n                return False\n\n            # If SSA knows, that's fine.\n            if self.previous_trace is not None and self.previous_trace.mustHaveValue():\n                return False\n\n        return True\n\n\ndef makeStatementDelVariable(variable, tolerant, source_ref, version=None):\n    if tolerant:\n        return StatementDelVariableTolerant(\n            variable=variable, version=version, source_ref=source_ref\n        )\n    else:\n        return StatementDelVariableIntolerant(\n            variable=variable, version=version, source_ref=source_ref\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/VariableNameNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for named variable reference, assignment, and deletion\n\nx = ...\ndel x\n... = x\n\nVariable name references might be in a class context, and then it\nis unclear what this really will become. These nodes are used in\nthe early tree building phase, but never reach optimization phase\nor even code generation.\n\"\"\"\n\nfrom .ExpressionBases import ExpressionBase\nfrom .NodeBases import StatementBase\nfrom .StatementBasesGenerated import StatementAssignmentVariableNameBase\n\n\nclass StatementAssignmentVariableName(StatementAssignmentVariableNameBase):\n    \"\"\"Precursor of StatementAssignmentVariable used during tree building phase\"\"\"\n\n    kind = \"STATEMENT_ASSIGNMENT_VARIABLE_NAME\"\n\n    named_children = (\"source\",)\n    nice_children = (\"assignment source\",)\n    node_attributes = (\"provider\", \"variable_name\")\n    auto_compute_handling = \"post_init\"\n\n    def postInitNode(self):\n        assert not self.provider.isExpressionOutlineBody(), self.source_ref\n\n    def getVariableName(self):\n        return self.variable_name\n\n    def computeStatement(self, trace_collection):\n        # Only for abc, pylint: disable=no-self-use\n\n        # These must not enter real optimization, they only live during the\n        # tree building.\n        assert False\n\n    @staticmethod\n    def getStatementNiceName():\n        return \"variable assignment statement\"\n\n\nclass StatementDelVariableName(StatementBase):\n    \"\"\"Precursor of StatementDelVariable used during tree building phase\"\"\"\n\n    kind = \"STATEMENT_DEL_VARIABLE_NAME\"\n\n    __slots__ = \"variable_name\", \"provider\", \"tolerant\"\n\n    def __init__(self, provider, variable_name, tolerant, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.variable_name = variable_name\n        self.provider = provider\n\n        self.tolerant = tolerant\n\n    def finalize(self):\n        del self.parent\n        del self.provider\n\n    def getDetails(self):\n        return {\n            \"variable_name\": self.variable_name,\n            \"provider\": self.provider,\n            \"tolerant\": self.tolerant,\n        }\n\n    def getVariableName(self):\n        return self.variable_name\n\n    def computeStatement(self, trace_collection):\n        # Only for abc, pylint: disable=no-self-use\n\n        # These must not enter real optimization, they only live during the\n        # tree building.\n        assert False\n\n\nclass ExpressionVariableNameRef(ExpressionBase):\n    \"\"\"These are used before the actual variable object is known from VariableClosure.\"\"\"\n\n    kind = \"EXPRESSION_VARIABLE_NAME_REF\"\n\n    __slots__ = \"variable_name\", \"provider\"\n\n    def __init__(self, provider, variable_name, source_ref):\n        assert not provider.isExpressionOutlineBody(), source_ref\n\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable_name = variable_name\n\n        self.provider = provider\n\n    def finalize(self):\n        del self.parent\n        del self.provider\n\n    @staticmethod\n    def isExpressionVariableNameRef():\n        return True\n\n    def getDetails(self):\n        return {\"variable_name\": self.variable_name, \"provider\": self.provider}\n\n    def getVariableName(self):\n        return self.variable_name\n\n    def computeExpressionRaw(self, trace_collection):\n        return self, None, None\n\n    @staticmethod\n    def needsFallback():\n        return True\n\n\nclass ExpressionVariableLocalNameRef(ExpressionVariableNameRef):\n    \"\"\"These are used before the actual variable object is known from VariableClosure.\n\n    The special thing about this as opposed to ExpressionVariableNameRef is that\n    these must remain local names and cannot fallback to outside scopes. This is\n    used for \"__annotations__\".\n\n    \"\"\"\n\n    kind = \"EXPRESSION_VARIABLE_LOCAL_NAME_REF\"\n\n    @staticmethod\n    def needsFallback():\n        return False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/VariableRefNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Node for variable references.\n\nThese represent all variable references in the node tree. Can be in assignments\nand its expressions, changing the meaning of course dramatically.\n\n\"\"\"\n\nfrom nuitka import Builtins, Variables\nfrom nuitka.ModuleRegistry import getOwnerFromCodeName\nfrom nuitka.PythonVersions import (\n    getUnboundLocalErrorErrorTemplate,\n    python_version,\n)\nfrom nuitka.tree.TreeHelpers import makeStatementsSequenceFromStatements\n\nfrom .ConstantRefNodes import makeConstantRefNode\nfrom .DictionaryNodes import (\n    ExpressionDictOperationIn,\n    ExpressionDictOperationItem,\n    ExpressionDictOperationNotIn,\n    StatementDictOperationRemove,\n    StatementDictOperationSet,\n)\nfrom .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin\nfrom .ModuleAttributeNodes import (\n    ExpressionModuleAttributeLoaderRef,\n    ExpressionModuleAttributeNameRef,\n    ExpressionModuleAttributePackageRef,\n    ExpressionModuleAttributeSpecRef,\n)\nfrom .NodeMakingHelpers import (\n    makeRaiseExceptionReplacementExpression,\n    makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,\n)\nfrom .OutlineNodes import ExpressionOutlineBody\nfrom .ReturnNodes import makeStatementReturn\nfrom .shapes.StandardShapes import tshape_unknown\nfrom .SubscriptNodes import ExpressionSubscriptLookupForUnpack\n\n\nclass ExpressionVariableRefBase(ExpressionBase):\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    __slots__ = \"variable\", \"variable_trace\"\n\n    def __init__(self, variable, source_ref):\n        ExpressionBase.__init__(self, source_ref)\n\n        self.variable = variable\n        self.variable_trace = None\n\n    def finalize(self):\n        del self.parent\n        del self.variable\n        del self.variable_trace\n\n    def getVariableName(self):\n        return self.variable.getName()\n\n    def getVariable(self):\n        return self.variable\n\n    def getVariableTrace(self):\n        return self.variable_trace\n\n    def getTypeShape(self):\n        if self.variable_trace is None:\n            return tshape_unknown\n        else:\n            return self.variable_trace.getTypeShape()\n\n    def onContentEscapes(self, trace_collection):\n        trace_collection.onVariableContentEscapes(self.variable)\n\n    def computeExpressionLen(self, len_node, trace_collection):\n        if self.variable_trace is not None and self.variable_trace.isAssignTrace():\n            value = self.variable_trace.getAssignNode().subnode_source\n\n            shape = value.getValueShape()\n\n            has_len = shape.hasShapeSlotLen()\n\n            if has_len is False:\n                # Any exception may be raised.\n                trace_collection.onExceptionRaiseExit(BaseException)\n\n                return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(\n                    template=\"object of type '%s' has no len()\",\n                    operation=\"len\",\n                    original_node=len_node,\n                    value_node=self,\n                )\n            elif has_len is True:\n                iter_length = value.getIterationLength()\n\n                if iter_length is not None:\n                    result = makeConstantRefNode(\n                        constant=int(iter_length),  # make sure to downcast long\n                        source_ref=len_node.getSourceReference(),\n                    )\n\n                    return (\n                        result,\n                        \"new_constant\",\n                        lambda: \"Predicted 'len' result of variable '%s'.\"\n                        % self.getVariableName(),\n                    )\n\n        # The variable itself is to be considered escaped.\n        trace_collection.markActiveVariableAsEscaped(self.variable)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return len_node, None, None\n\n    def computeExpressionAttribute(self, lookup_node, attribute_name, trace_collection):\n        if self.variable_trace is not None:\n            attribute_node = self.variable_trace.getAttributeNode()\n\n            if attribute_node is not None:\n                # The variable itself is to be considered escaped no matter what, since\n                # we don't know exactly what the attribute is used for later on. We would\n                # have to attach the variable to the result created here in such a way,\n                # that e.g. calling it will make it escaped only.\n                trace_collection.markActiveVariableAsEscaped(self.variable)\n\n                return attribute_node.computeExpressionAttribute(\n                    lookup_node=lookup_node,\n                    attribute_name=attribute_name,\n                    trace_collection=trace_collection,\n                )\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # The variable itself is to be considered escaped.\n        trace_collection.markActiveVariableAsEscaped(self.variable)\n\n        if not self.isKnownToHaveAttribute(attribute_name):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, None, None\n\n    def mayRaiseExceptionAttributeLookup(self, exception_type, attribute_name):\n        return not self.isKnownToHaveAttribute(attribute_name)\n\n    def isKnownToHaveAttribute(self, attribute_name):\n        if self.variable_trace is not None:\n            type_shape = self.variable_trace.getTypeShape()\n\n            if type_shape.isKnownToHaveAttribute(attribute_name):\n                return True\n\n            attribute_node = self.variable_trace.getAttributeNode()\n\n            if attribute_node is not None:\n                return attribute_node.isKnownToHaveAttribute(attribute_name)\n\n        return None\n\n    def computeExpressionImportName(self, import_node, import_name, trace_collection):\n        # TODO: For include modules, something might be possible here.\n        return self.computeExpressionAttribute(\n            lookup_node=import_node,\n            attribute_name=import_name,\n            trace_collection=trace_collection,\n        )\n\n    def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):\n        tags = None\n        message = None\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(in_node)\n\n        # TODO: Add \"set\" shape here as well.\n        if self.variable_trace.hasShapeDictionaryExact():\n            tags = \"new_expression\"\n            message = \"\"\"\\\nCheck '%s' on dictionary lowered to dictionary '%s'.\"\"\" % (\n                in_node.comparator,\n                in_node.comparator,\n            )\n\n            if in_node.comparator == \"In\":\n                in_node = ExpressionDictOperationIn(\n                    key=value_node,\n                    dict_arg=self,\n                    source_ref=in_node.getSourceReference(),\n                )\n            else:\n                in_node = ExpressionDictOperationNotIn(\n                    key=value_node,\n                    dict_arg=self,\n                    source_ref=in_node.getSourceReference(),\n                )\n\n        # Any exception may be raised.\n        if in_node.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return in_node, tags, message\n\n    def getExpressionDictInConstant(self, value):\n        return self.variable_trace.getDictInValue(value)\n\n    def computeExpressionSetSubscript(\n        self, set_node, subscript, value_node, trace_collection\n    ):\n        tags = None\n        message = None\n\n        # By default, an subscript may change everything about the lookup\n        # source.\n        if self.variable_trace.hasShapeDictionaryExact():\n            result = StatementDictOperationSet(\n                dict_arg=self,\n                key=subscript,\n                value=value_node,\n                source_ref=set_node.getSourceReference(),\n            )\n            change_tags = \"new_statements\"\n            change_desc = \"\"\"\\\nSubscript assignment to dictionary lowered to dictionary assignment.\"\"\"\n\n            trace_collection.removeKnowledge(self)\n\n            result2, change_tags2, change_desc2 = result.computeStatementOperation(\n                trace_collection\n            )\n\n            if result2 is not result:\n                trace_collection.signalChange(\n                    tags=change_tags,\n                    source_ref=self.source_ref,\n                    message=change_desc,\n                )\n\n                return result2, change_tags2, change_desc2\n            else:\n                return result, change_tags, change_desc\n\n        trace_collection.removeKnowledge(self)\n\n        trace_collection.removeKnowledge(value_node)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception might be raised.\n        if set_node.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return set_node, tags, message\n\n    def computeExpressionDelSubscript(self, del_node, subscript, trace_collection):\n        tags = None\n        message = None\n\n        if self.variable_trace.hasShapeDictionaryExact():\n            result = StatementDictOperationRemove(\n                dict_arg=self,\n                key=subscript,\n                source_ref=del_node.getSourceReference(),\n            )\n            change_tags = \"new_statements\"\n            change_desc = \"\"\"\\\nSubscript del to dictionary lowered to dictionary del.\"\"\"\n\n            trace_collection.removeKnowledge(self)\n\n            result2, change_tags2, change_desc2 = result.computeStatementOperation(\n                trace_collection\n            )\n\n            if result2 is not result:\n                trace_collection.signalChange(\n                    tags=change_tags,\n                    source_ref=self.source_ref,\n                    message=change_desc,\n                )\n\n                return result2, change_tags2, change_desc2\n            else:\n                return result, change_tags, change_desc\n\n        # By default, an subscript may change everything about the lookup\n        # source.\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception might be raised.\n        if del_node.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return del_node, tags, message\n\n    def computeExpressionSubscript(self, lookup_node, subscript, trace_collection):\n        tags = None\n        message = None\n\n        if self.variable_trace.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression=ExpressionDictOperationItem(\n                    dict_arg=self,\n                    key=subscript,\n                    source_ref=lookup_node.getSourceReference(),\n                ),\n                change_tags=\"new_expression\",\n                change_desc=\"\"\"\\\nSubscript look-up to dictionary lowered to dictionary look-up.\"\"\",\n            )\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception might be raised.\n        if lookup_node.mayRaiseException(BaseException):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return lookup_node, tags, message\n\n    def _applyReplacement(self, trace_collection, replacement):\n        trace_collection.signalChange(\n            \"new_expression\",\n            self.source_ref,\n            \"Value propagated for '%s' from '%s'.\"\n            % (self.variable.getName(), replacement.getSourceReference().getAsString()),\n        )\n\n        # Special case for in-place assignments.\n        if self.parent.isExpressionOperationInplace():\n            statement = self.parent.parent\n\n            if statement.isStatementAssignmentVariable():\n                statement.removeMarkAsInplaceSuspect()\n\n        # Need to compute the replacement still.\n        return replacement.computeExpressionRaw(trace_collection)\n\n    def getTruthValue(self):\n        return self.variable_trace.getTruthValue()\n\n    def getComparisonValue(self):\n        return self.variable_trace.getComparisonValue()\n\n\n_hard_names = (\"dir\", \"eval\", \"exec\", \"execfile\", \"locals\", \"vars\", \"super\")\n\n\nclass ExpressionVariableRef(ExpressionVariableRefBase):\n    kind = \"EXPRESSION_VARIABLE_REF\"\n\n    __slots__ = ()\n\n    def __init__(self, variable, source_ref):\n        assert variable is not None\n\n        ExpressionVariableRefBase.__init__(\n            self, variable=variable, source_ref=source_ref\n        )\n\n    @staticmethod\n    def isExpressionVariableRef():\n        return True\n\n    @staticmethod\n    def isExpressionVariableRefOrTempVariableRef():\n        return True\n\n    def getDetails(self):\n        return {\"variable\": self.variable}\n\n    def getDetailsForDisplay(self):\n        return {\n            \"variable_name\": self.variable.getName(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        assert cls is ExpressionVariableRef, cls\n\n        owner = getOwnerFromCodeName(args[\"owner\"])\n        variable = owner.getProvidedVariable(args[\"variable_name\"])\n\n        return cls(variable=variable, source_ref=source_ref)\n\n    def getVariable(self):\n        return self.variable\n\n    def setVariable(self, variable):\n        assert isinstance(variable, Variables.Variable), repr(variable)\n\n        self.variable = variable\n\n    def computeExpressionRaw(self, trace_collection):\n        # Terribly detailed, pylint: disable=too-many-branches,too-many-statements\n\n        variable = self.variable\n        assert variable is not None\n\n        self.variable_trace = trace_collection.getVariableCurrentTrace(\n            variable=variable\n        )\n\n        replacement = self.variable_trace.getReplacementNode(self)\n        if replacement is not None:\n            return self._applyReplacement(trace_collection, replacement)\n\n        if not self.variable_trace.mustHaveValue():\n            # TODO: This could be way more specific surely, either NameError or UnboundLocalError\n            # could be decided from context.\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        if variable.isModuleVariable() and (\n            variable.hasDefiniteWrites() is False or variable.getName() == \"super\"\n        ):\n            variable_name = self.variable.getName()\n\n            if variable_name in Builtins.builtin_exception_names:\n                if not self.variable.getOwner().getLocalsScope().isEscaped():\n                    from .BuiltinRefNodes import ExpressionBuiltinExceptionRef\n\n                    new_node = ExpressionBuiltinExceptionRef(\n                        exception_name=self.variable.getName(),\n                        source_ref=self.source_ref,\n                    )\n\n                    change_tags = \"new_builtin_ref\"\n                    change_desc = \"\"\"\\\nModule variable '%s' found to be built-in exception reference.\"\"\" % (\n                        variable_name\n                    )\n                else:\n                    self.variable_trace.addUsage()\n\n                    new_node = self\n                    change_tags = None\n                    change_desc = None\n\n            elif variable_name in Builtins.builtin_names:\n                if (\n                    variable_name in _hard_names\n                    or not self.variable.getOwner().getLocalsScope().isEscaped()\n                ):\n                    from .BuiltinRefNodes import makeExpressionBuiltinRef\n\n                    new_node = makeExpressionBuiltinRef(\n                        builtin_name=variable_name,\n                        locals_scope=self.getFunctionsLocalsScope(),\n                        source_ref=self.source_ref,\n                    )\n\n                    change_tags = \"new_builtin_ref\"\n                    change_desc = \"\"\"\\\nModule variable '%s' found to be built-in reference.\"\"\" % (\n                        variable_name\n                    )\n                else:\n                    self.variable_trace.addUsage()\n\n                    new_node = self\n                    change_tags = None\n                    change_desc = None\n            elif variable_name == \"__name__\":\n                new_node = ExpressionModuleAttributeNameRef(\n                    variable=variable, source_ref=self.source_ref\n                )\n\n                change_tags = \"new_expression\"\n                change_desc = \"\"\"\\\nReplaced read-only module attribute '__name__' with module attribute reference.\"\"\"\n            elif variable_name == \"__package__\":\n                new_node = ExpressionModuleAttributePackageRef(\n                    variable=variable, source_ref=self.source_ref\n                )\n\n                change_tags = \"new_expression\"\n                change_desc = \"\"\"\\\nReplaced read-only module attribute '__package__' with module attribute reference.\"\"\"\n            elif variable_name == \"__loader__\" and python_version >= 0x300:\n                new_node = ExpressionModuleAttributeLoaderRef(\n                    variable=variable, source_ref=self.source_ref\n                )\n\n                change_tags = \"new_expression\"\n                change_desc = \"\"\"\\\nReplaced read-only module attribute '__loader__' with module attribute reference.\"\"\"\n            elif variable_name == \"__spec__\" and python_version >= 0x340:\n                new_node = ExpressionModuleAttributeSpecRef(\n                    variable=variable, source_ref=self.source_ref\n                )\n\n                change_tags = \"new_expression\"\n                change_desc = \"\"\"\\\nReplaced read-only module attribute '__spec__' with module attribute reference.\"\"\"\n            else:\n                self.variable_trace.addUsage()\n\n                # Probably should give a warning once about it.\n                new_node = self\n                change_tags = None\n                change_desc = None\n\n            return new_node, change_tags, change_desc\n\n        self.variable_trace.addUsage()\n\n        if self.variable_trace.mustNotHaveValue():\n            assert self.variable.isLocalVariable(), self.variable\n\n            variable_name = self.variable.getName()\n\n            result = makeRaiseExceptionReplacementExpression(\n                expression=self,\n                exception_type=\"UnboundLocalError\",\n                exception_value=getUnboundLocalErrorErrorTemplate() % variable_name,\n            )\n\n            return (\n                result,\n                \"new_raise\",\n                \"Variable access of not initialized variable '%s'\" % variable_name,\n            )\n\n        return self, None, None\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        if self.variable_trace is not None:\n            attribute_node = self.variable_trace.getAttributeNode()\n\n            if attribute_node is not None:\n                # The variable itself is to be considered escaped no matter what, since\n                # we don't know exactly what the attribute is used for later on. We would\n                # have to attach the variable to the result created here in such a way,\n                # that e.g. calling it will make it escaped only.\n                trace_collection.markActiveVariableAsEscaped(self.variable)\n\n                return attribute_node.computeExpressionCallViaVariable(\n                    call_node=call_node,\n                    variable_ref_node=self,\n                    call_args=call_args,\n                    call_kw=call_kw,\n                    trace_collection=trace_collection,\n                )\n\n        # The called and the arguments escape for good.\n        self.onContentEscapes(trace_collection)\n        if call_args is not None:\n            call_args.onContentEscapes(trace_collection)\n        if call_kw is not None:\n            call_kw.onContentEscapes(trace_collection)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        if (\n            self.variable.getName() in _hard_names\n            and self.variable.isIncompleteModuleVariable()\n        ):\n            # Just inform the collection that all escaped.\n            trace_collection.onLocalsUsage(locals_scope=self.getFunctionsLocalsScope())\n\n        return call_node, None, None\n\n    def computeExpressionBool(self, trace_collection):\n        if self.variable_trace is not None:\n            attribute_node = self.variable_trace.getAttributeNode()\n\n            if attribute_node is not None:\n                if (\n                    attribute_node.isCompileTimeConstant()\n                    and not attribute_node.isMutable()\n                ):\n                    return (\n                        bool(attribute_node.getCompileTimeConstant()),\n                        attribute_node.makeClone(),\n                        \"Using very trusted constant truth value.\",\n                    )\n\n        # TODO: This is probably only default stuff here, that could be compressed.\n        if not self.mayRaiseException(BaseException) and self.mayRaiseExceptionBool(\n            BaseException\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return None, None, None\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        emit_read(self.variable)\n\n    def hasShapeListExact(self):\n        return (\n            self.variable_trace is not None and self.variable_trace.hasShapeListExact()\n        )\n\n    def hasShapeDictionaryExact(self):\n        return (\n            self.variable_trace is not None\n            and self.variable_trace.hasShapeDictionaryExact()\n        )\n\n    def hasShapeStrExact(self):\n        return (\n            self.variable_trace is not None and self.variable_trace.hasShapeStrExact()\n        )\n\n    def hasShapeUnicodeExact(self):\n        return (\n            self.variable_trace is not None\n            and self.variable_trace.hasShapeUnicodeExact()\n        )\n\n    def hasShapeBoolExact(self):\n        return (\n            self.variable_trace is not None and self.variable_trace.hasShapeBoolExact()\n        )\n\n    @staticmethod\n    def isKnownToBeIterable(count):\n        return None\n\n    def mayHaveSideEffects(self):\n        return self.variable_trace is None or not self.variable_trace.mustHaveValue()\n\n    def mayRaiseException(self, exception_type):\n        return self.variable_trace is None or not self.variable_trace.mustHaveValue()\n\n    def mayRaiseExceptionBool(self, exception_type):\n        return (\n            self.variable_trace is None\n            or not self.variable_trace.mustHaveValue()\n            or not self.variable_trace.getTypeShape().hasShapeSlotBool()\n        )\n\n    def getFunctionsLocalsScope(self):\n        return self.getParentVariableProvider().getLocalsScope()\n\n\nclass ExpressionVariableOrBuiltinRef(ExpressionVariableRef):\n    kind = \"EXPRESSION_VARIABLE_OR_BUILTIN_REF\"\n\n    __slots__ = (\"locals_scope\",)\n\n    def __init__(self, variable, locals_scope, source_ref):\n        ExpressionVariableRef.__init__(self, variable=variable, source_ref=source_ref)\n\n        self.locals_scope = locals_scope\n\n    def getDetails(self):\n        return {\"variable\": self.variable, \"locals_scope\": self.locals_scope}\n\n    def getFunctionsLocalsScope(self):\n        return self.locals_scope\n\n\ndef makeExpressionVariableRef(variable, locals_scope, source_ref):\n    if variable.getName() in _hard_names:\n        return ExpressionVariableOrBuiltinRef(\n            variable=variable, locals_scope=locals_scope, source_ref=source_ref\n        )\n    else:\n        return ExpressionVariableRef(variable=variable, source_ref=source_ref)\n\n\n# Note: Temporary variable references are to be guaranteed to not raise\n# therefore no side effects.\nclass ExpressionTempVariableRef(\n    ExpressionNoSideEffectsMixin, ExpressionVariableRefBase\n):\n    kind = \"EXPRESSION_TEMP_VARIABLE_REF\"\n\n    def __init__(self, variable, source_ref):\n        assert variable.isTempVariable()\n\n        ExpressionVariableRefBase.__init__(\n            self, variable=variable, source_ref=source_ref\n        )\n\n    def getDetailsForDisplay(self):\n        return {\n            \"temp_name\": self.variable.getName(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    def getDetails(self):\n        return {\"variable\": self.variable}\n\n    @staticmethod\n    def isExpressionTempVariableRef():\n        return True\n\n    @staticmethod\n    def isExpressionVariableRefOrTempVariableRef():\n        return True\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        assert cls is ExpressionTempVariableRef, cls\n\n        owner = getOwnerFromCodeName(args[\"owner\"])\n\n        variable = owner.getTempVariable(None, args[\"temp_name\"])\n\n        return cls(variable=variable, source_ref=source_ref)\n\n    def computeExpressionRaw(self, trace_collection):\n        self.variable_trace = trace_collection.getVariableCurrentTrace(\n            variable=self.variable\n        )\n\n        replacement = self.variable_trace.getReplacementNode(self)\n        if replacement is not None:\n            return self._applyReplacement(trace_collection, replacement)\n\n        self.variable_trace.addUsage()\n\n        # Nothing to do here.\n        return self, None, None\n\n    def _makeIterationNextReplacementNode(\n        self, trace_collection, next_node, iterator_assign_node\n    ):\n        from .OperatorNodes import makeExpressionOperationBinaryInplace\n        from .VariableAssignNodes import makeStatementAssignmentVariable\n\n        provider = trace_collection.getOwner()\n\n        outline_body = ExpressionOutlineBody(\n            provider=provider,\n            name=\"next_value_accessor\",\n            source_ref=self.source_ref,\n        )\n\n        if next_node.isExpressionSpecialUnpack():\n            source = ExpressionSubscriptLookupForUnpack(\n                expression=ExpressionTempVariableRef(\n                    variable=iterator_assign_node.tmp_iterated_variable,\n                    source_ref=self.source_ref,\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=iterator_assign_node.tmp_iteration_count_variable,\n                    source_ref=self.source_ref,\n                ),\n                expected=next_node.getExpected(),\n                source_ref=self.source_ref,\n            )\n        else:\n            source = ExpressionSubscriptLookupForUnpack(\n                expression=ExpressionTempVariableRef(\n                    variable=iterator_assign_node.tmp_iterated_variable,\n                    source_ref=self.source_ref,\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=iterator_assign_node.tmp_iteration_count_variable,\n                    source_ref=self.source_ref,\n                ),\n                expected=None,\n                source_ref=self.source_ref,\n            )\n\n        statements = (\n            makeStatementAssignmentVariable(\n                variable=iterator_assign_node.tmp_iteration_next_variable,\n                source=source,\n                source_ref=self.source_ref,\n            ),\n            makeStatementAssignmentVariable(\n                variable=iterator_assign_node.tmp_iteration_count_variable,\n                source=makeExpressionOperationBinaryInplace(\n                    left=ExpressionTempVariableRef(\n                        variable=iterator_assign_node.tmp_iteration_count_variable,\n                        source_ref=self.source_ref,\n                    ),\n                    right=makeConstantRefNode(constant=1, source_ref=self.source_ref),\n                    operator=\"IAdd\",\n                    source_ref=self.source_ref,\n                ),\n                source_ref=self.source_ref,\n            ),\n            makeStatementReturn(\n                expression=ExpressionTempVariableRef(\n                    variable=iterator_assign_node.tmp_iteration_next_variable,\n                    source_ref=self.source_ref,\n                ),\n                source_ref=self.source_ref,\n            ),\n        )\n\n        outline_body.setChildBody(makeStatementsSequenceFromStatements(*statements))\n\n        return False, trace_collection.computedExpressionResultRaw(\n            outline_body,\n            change_tags=\"new_expression\",\n            change_desc=lambda: \"Iterator 'next' converted to %s.\"\n            % iterator_assign_node.getIterationIndexDesc(),\n        )\n\n    def computeExpressionNext1(self, next_node, trace_collection):\n        iteration_source_node = self.variable_trace.getIterationSourceNode()\n\n        if iteration_source_node is not None:\n            if iteration_source_node.parent.isStatementAssignmentVariableIterator():\n                iterator_assign_node = iteration_source_node.parent\n\n                if iterator_assign_node.tmp_iterated_variable is not None:\n                    return self._makeIterationNextReplacementNode(\n                        trace_collection=trace_collection,\n                        next_node=next_node,\n                        iterator_assign_node=iterator_assign_node,\n                    )\n\n            iteration_source_node.onContentIteratedEscapes(trace_collection)\n\n            if iteration_source_node.mayHaveSideEffectsNext():\n                trace_collection.onControlFlowEscape(self)\n\n        else:\n            self.onContentEscapes(trace_collection)\n\n            # Any code could be run, note that.\n            if self.mayHaveSideEffectsNext():\n                trace_collection.onControlFlowEscape(self)\n\n        # Any exception may be raised.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        return True, (next_node, None, None)\n\n    def mayRaiseExceptionImportName(self, exception_type, import_name):\n        if self.variable_trace is not None and self.variable_trace.isAssignTrace():\n            return self.variable_trace.getAssignNode().subnode_source.mayRaiseExceptionImportName(\n                exception_type, import_name\n            )\n\n        else:\n            return True\n\n    @staticmethod\n    def isKnownToBeIterableAtMin(count):\n        # TODO: See through the variable current trace.\n        return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/VariableReleaseNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nodes for variable release\n\nThese refer to resolved variable objects.\n\n\"\"\"\n\nfrom nuitka.ModuleRegistry import getOwnerFromCodeName\n\nfrom .NodeBases import StatementBase\n\n\nclass StatementReleaseVariableBase(StatementBase):\n    \"\"\"Releasing a variable.\n\n    Just release the value, which of course is not to be used afterwards.\n\n    Typical code: Function exit user variables, try/finally release of temporary\n    variables.\n    \"\"\"\n\n    __slots__ = \"variable\", \"variable_trace\"\n\n    def __init__(self, variable, source_ref):\n        StatementBase.__init__(self, source_ref=source_ref)\n\n        self.variable = variable\n        self.variable_trace = None\n\n    @staticmethod\n    def isStatementReleaseVariable():\n        return True\n\n    def finalize(self):\n        del self.variable\n        del self.variable_trace\n        del self.parent\n\n    def getDetails(self):\n        return {\"variable\": self.variable}\n\n    def getDetailsForDisplay(self):\n        return {\n            \"variable_name\": self.variable.getName(),\n            \"owner\": self.variable.getOwner().getCodeName(),\n        }\n\n    @classmethod\n    def fromXML(cls, provider, source_ref, **args):\n        assert cls is makeStatementReleaseVariable, cls\n\n        owner = getOwnerFromCodeName(args[\"owner\"])\n        assert owner is not None, args[\"owner\"]\n\n        variable = owner.getProvidedVariable(args[\"variable_name\"])\n\n        return cls(variable=variable, source_ref=source_ref)\n\n    def getVariable(self):\n        return self.variable\n\n    def getVariableTrace(self):\n        return self.variable_trace\n\n    def setVariable(self, variable):\n        self.variable = variable\n\n    def computeStatement(self, trace_collection):\n        self.variable_trace = trace_collection.getVariableCurrentTrace(self.variable)\n\n        if self.variable_trace.mustNotHaveValue():\n            return (\n                None,\n                \"new_statements\",\n                \"Uninitialized %s is not released.\" % (self.variable.getDescription()),\n            )\n\n        escape_desc = self.variable_trace.getReleaseEscape()\n\n        assert escape_desc is not None, self.variable_trace\n\n        if escape_desc.isControlFlowEscape():\n            # Any code could be run, note that.\n            trace_collection.onControlFlowEscape(self)\n\n        # TODO: We might be able to remove ourselves based on the trace\n        # we belong to.\n\n        return self, None, None\n\n    @staticmethod\n    def mayRaiseException(exception_type):\n        # By default, __del__ is not allowed to raise an exception.\n        return False\n\n\nclass StatementReleaseVariableTemp(StatementReleaseVariableBase):\n    kind = \"STATEMENT_RELEASE_VARIABLE_TEMP\"\n\n\nclass StatementReleaseVariableLocal(StatementReleaseVariableBase):\n    kind = \"STATEMENT_RELEASE_VARIABLE_LOCAL\"\n\n\nclass StatementReleaseVariableParameter(StatementReleaseVariableLocal):\n    kind = \"STATEMENT_RELEASE_VARIABLE_PARAMETER\"\n\n    def computeStatement(self, trace_collection):\n        if self.variable.getOwner().isAutoReleaseVariable(self.variable):\n            return (\n                None,\n                \"new_statements\",\n                \"Original parameter variable value of '%s' is not released.\"\n                % self.variable.getName(),\n            )\n\n        return StatementReleaseVariableLocal.computeStatement(self, trace_collection)\n\n\ndef makeStatementReleaseVariable(variable, source_ref):\n    if variable.isTempVariable():\n        return StatementReleaseVariableTemp(variable=variable, source_ref=source_ref)\n    elif variable.isParameterVariable():\n        return StatementReleaseVariableParameter(\n            variable=variable, source_ref=source_ref\n        )\n    else:\n        return StatementReleaseVariableLocal(variable=variable, source_ref=source_ref)\n\n\ndef makeStatementsReleaseVariables(variables, source_ref):\n    return tuple(\n        makeStatementReleaseVariable(variable=variable, source_ref=source_ref)\n        for variable in variables\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/YieldNodes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Yield node.\n\nThe yield node returns to the caller of the generator and therefore may execute\nabsolutely arbitrary code, from the point of view of this code. It then returns\nsomething, which may often be 'None', but doesn't have to be.\n\nTODO: Often it will be used as a statement, which may also be reflected in a\ndedicated node to save a bit of memory.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\nfrom .ChildrenHavingMixins import ChildHavingExpressionMixin\nfrom .ExpressionBases import ExpressionBase\n\n\nclass ExpressionYieldBase(ChildHavingExpressionMixin, ExpressionBase):\n    named_children = (\"expression\",)\n\n    if python_version >= 0x300:\n        __slots__ = (\"exception_preserving\",)\n    else:\n        __slots__ = ()\n\n    def __init__(self, expression, source_ref):\n        ChildHavingExpressionMixin.__init__(self, expression=expression)\n\n        ExpressionBase.__init__(self, source_ref)\n\n        if python_version >= 0x300:\n            self.exception_preserving = False\n\n    if python_version >= 0x300:\n\n        def markAsExceptionPreserving(self):\n            self.exception_preserving = True\n\n        def isExceptionPreserving(self):\n            return self.exception_preserving\n\n    else:\n\n        @staticmethod\n        def isExceptionPreserving():\n            return False\n\n    def computeExpression(self, trace_collection):\n        # TODO: That's actually only needed if the value is mutable.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n        # Any code could be run, note that.\n        trace_collection.onControlFlowEscape(self)\n\n        trace_collection.onExceptionRaiseExit(BaseException)\n        # Nothing possible really here.\n        return self, None, None\n\n\nclass ExpressionYield(ExpressionYieldBase):\n    \"\"\"Yielding an expression.\n\n    Typical code: yield expression\n\n    Can only happen in a generator. Kind of explicitly suspends and\n    resumes the execution. The user may inject any kind of exception\n    or give any return value. The value of \"None\" is the most common\n    though, esp. if it's not used.\n\n    \"\"\"\n\n    kind = \"EXPRESSION_YIELD\"\n\n\nclass ExpressionYieldFrom(ExpressionYieldBase):\n    \"\"\"Yielding from an expression.\n\n    Typical code: yield from expression (Python3)\n\n    Can only happen in a generator and only in Python3. Similar to yield,\n    but implies a loop and exception propagation to the yield from generator\n    if such. Kind of explicitly suspends and resumes the execution. The\n    user may inject any kind of exception or give any return value. Having\n    a return value is what makes Python3 generators special, and with yield\n    from, that value is the expression result.\n    \"\"\"\n\n    kind = \"EXPRESSION_YIELD_FROM\"\n\n\nclass ExpressionYieldFromAwaitable(ExpressionYieldBase):\n    \"\"\"Yielding from an expression.\n\n    Typical code: await x, async for ..., async with (Python3.5)\n\n    Can only happen in a coroutine or asyncgen and only in Python3.5\n    or higher.\n\n    Similar to yield from. The actual lookups of awaitable go through\n    slots and have dedicated nodes.\n    \"\"\"\n\n    kind = \"EXPRESSION_YIELD_FROM_AWAITABLE\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/shapes/BuiltinTypeShapes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Shapes for Python built-in types.\n\n\"\"\"\n\nfrom nuitka.code_generation.c_types.CTypeNuitkaBooleans import (\n    CTypeNuitkaBoolEnum,\n)\nfrom nuitka.code_generation.c_types.CTypeNuitkaInts import (\n    CTypeNuitkaIntOrLongStruct,\n)\nfrom nuitka.code_generation.Reports import onMissingOperation\nfrom nuitka.Constants import the_empty_unicode\nfrom nuitka.Options import isExperimental\nfrom nuitka.PythonVersions import python_version\n\nfrom .ControlFlowDescriptions import (\n    ControlFlowDescriptionAddUnsupported,\n    ControlFlowDescriptionBitandUnsupported,\n    ControlFlowDescriptionBitorUnsupported,\n    ControlFlowDescriptionBitxorUnsupported,\n    ControlFlowDescriptionComparisonUnorderable,\n    ControlFlowDescriptionDivmodUnsupported,\n    ControlFlowDescriptionElementBasedEscape,\n    ControlFlowDescriptionFloorDivUnsupported,\n    ControlFlowDescriptionFormatError,\n    ControlFlowDescriptionLshiftUnsupported,\n    ControlFlowDescriptionMatmultUnsupported,\n    ControlFlowDescriptionModUnsupported,\n    ControlFlowDescriptionMulUnsupported,\n    ControlFlowDescriptionNoEscape,\n    ControlFlowDescriptionOldDivUnsupported,\n    ControlFlowDescriptionPowUnsupported,\n    ControlFlowDescriptionRshiftUnsupported,\n    ControlFlowDescriptionSubUnsupported,\n    ControlFlowDescriptionTrueDivUnsupported,\n    ControlFlowDescriptionValueErrorNoEscape,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\nfrom .ShapeMixins import (\n    ShapeContainerImmutableMixin,\n    ShapeContainerMixin,\n    ShapeContainerMutableMixin,\n    ShapeIteratorMixin,\n    ShapeNotContainerMixin,\n    ShapeNotNumberMixin,\n    ShapeNumberMixin,\n)\nfrom .StandardShapes import (\n    ShapeBase,\n    ShapeLoopCompleteAlternative,\n    ShapeLoopInitialAlternative,\n    ShapeTypeUnknown,\n    operation_result_unknown,\n    tshape_unknown,\n)\n\n# Updated later only, due to cyclic dependencies, make the dictionary\n# available for reference use in class definition.\nadd_shapes_none = {}\nsub_shapes_none = {}\nmult_shapes_none = {}\nfloordiv_shapes_none = {}\ntruediv_shapes_none = {}\nolddiv_shapes_none = {}\nmod_shapes_none = {}\ndivmod_shapes_none = {}\npow_shapes_none = {}\nbitor_shapes_none = {}\nbitand_shapes_none = {}\nbitxor_shapes_none = {}\nlshift_shapes_none = {}\nrshift_shapes_none = {}\nmatmult_shapes_none = {}\nadd_shapes_bool = {}\nsub_shapes_bool = {}\nmult_shapes_bool = {}\nfloordiv_shapes_bool = {}\ntruediv_shapes_bool = {}\nolddiv_shapes_bool = {}\nmod_shapes_bool = {}\ndivmod_shapes_bool = {}\npow_shapes_bool = {}\nbitor_shapes_bool = {}\nbitand_shapes_bool = {}\nbitxor_shapes_bool = {}\nlshift_shapes_bool = {}\nrshift_shapes_bool = {}\nmatmult_shapes_bool = matmult_shapes_none\nadd_shapes_int = {}\nsub_shapes_int = {}\nmult_shapes_int = {}\nfloordiv_shapes_int = {}\ntruediv_shapes_int = {}\nolddiv_shapes_int = {}\nmod_shapes_int = {}\ndivmod_shapes_int = divmod_shapes_bool\npow_shapes_int = {}\nbitor_shapes_int = {}\nbitand_shapes_int = {}\nbitxor_shapes_int = {}\nlshift_shapes_int = {}\nrshift_shapes_int = {}\nmatmult_shapes_int = matmult_shapes_none\nadd_shapes_long = {}\nsub_shapes_long = {}\nmult_shapes_long = {}\nfloordiv_shapes_long = {}\ntruediv_shapes_long = truediv_shapes_int\nolddiv_shapes_long = {}\nmod_shapes_long = {}\ndivmod_shapes_long = divmod_shapes_bool\npow_shapes_long = {}\nbitor_shapes_long = {}\nbitand_shapes_long = {}\nbitxor_shapes_long = {}\nlshift_shapes_long = {}\nrshift_shapes_long = {}\nmatmult_shapes_long = matmult_shapes_none\nadd_shapes_intorlong = {}\nsub_shapes_intorlong = {}\nmult_shapes_intorlong = {}\nfloordiv_shapes_intorlong = {}\ntruediv_shapes_intorlong = {}\nolddiv_shapes_intorlong = {}\nmod_shapes_intorlong = {}\ndivmod_shapes_intorlong = {}\npow_shapes_intorlong = {}\nbitor_shapes_intorlong = {}\nbitand_shapes_intorlong = {}\nbitxor_shapes_intorlong = {}\nlshift_shapes_intorlong = {}\nrshift_shapes_intorlong = {}\nmatmult_shapes_intorlong = matmult_shapes_none\nadd_shapes_float = {}\nsub_shapes_float = {}\nmult_shapes_float = {}\nfloordiv_shapes_float = {}\ntruediv_shapes_float = {}\nolddiv_shapes_float = {}\nmod_shapes_float = {}\ndivmod_shapes_float = divmod_shapes_bool\npow_shapes_float = {}\nbitor_shapes_float = bitor_shapes_none\nbitand_shapes_float = bitand_shapes_none\nbitxor_shapes_float = bitxor_shapes_none\nlshift_shapes_float = lshift_shapes_none\nrshift_shapes_float = rshift_shapes_none\nmatmult_shapes_float = matmult_shapes_none\nadd_shapes_complex = {}\nsub_shapes_complex = {}\nmult_shapes_complex = {}\n\nif python_version < 0x300:\n    floordiv_shapes_complex = {}\nelse:\n    floordiv_shapes_complex = floordiv_shapes_none\n\ntruediv_shapes_complex = {}\nolddiv_shapes_complex = {}\nmod_shapes_complex = {}\ndivmod_shapes_complex = divmod_shapes_bool\npow_shapes_complex = {}\nbitor_shapes_complex = bitor_shapes_none\nbitand_shapes_complex = bitand_shapes_none\nbitxor_shapes_complex = bitxor_shapes_none\nlshift_shapes_complex = lshift_shapes_none\nrshift_shapes_complex = rshift_shapes_none\nmatmult_shapes_complex = matmult_shapes_none\nadd_shapes_tuple = {}\nsub_shapes_tuple = sub_shapes_none\nmult_shapes_tuple = {}\nfloordiv_shapes_tuple = floordiv_shapes_none\ntruediv_shapes_tuple = truediv_shapes_none\nolddiv_shapes_tuple = olddiv_shapes_none\nmod_shapes_tuple = mod_shapes_none\ndivmod_shapes_tuple = divmod_shapes_none\npow_shapes_tuple = pow_shapes_none\nbitor_shapes_tuple = bitor_shapes_none\nbitand_shapes_tuple = bitand_shapes_none\nbitxor_shapes_tuple = bitxor_shapes_none\nlshift_shapes_tuple = lshift_shapes_none\nrshift_shapes_tuple = rshift_shapes_none\nmatmult_shapes_tuple = matmult_shapes_none\nadd_shapes_list = {}\niadd_shapes_list = {}\nsub_shapes_list = sub_shapes_none\nmult_shapes_list = {}\nfloordiv_shapes_list = floordiv_shapes_none\ntruediv_shapes_list = truediv_shapes_none\nolddiv_shapes_list = olddiv_shapes_none\nmod_shapes_list = mod_shapes_none\ndivmod_shapes_list = divmod_shapes_none\npow_shapes_list = pow_shapes_none\nbitor_shapes_list = bitor_shapes_none\nbitand_shapes_list = bitand_shapes_none\nbitxor_shapes_list = bitxor_shapes_none\nlshift_shapes_list = lshift_shapes_none\nrshift_shapes_list = rshift_shapes_none\nmatmult_shapes_list = matmult_shapes_none\nadd_shapes_set = {}\nsub_shapes_set = {}\nmult_shapes_set = mult_shapes_none\nfloordiv_shapes_set = floordiv_shapes_none\ntruediv_shapes_set = truediv_shapes_none\nolddiv_shapes_set = olddiv_shapes_none\nmod_shapes_set = mod_shapes_none\ndivmod_shapes_set = divmod_shapes_none\npow_shapes_set = pow_shapes_none\nbitor_shapes_set = {}\nbitand_shapes_set = {}\nbitxor_shapes_set = {}\nlshift_shapes_set = lshift_shapes_none\nrshift_shapes_set = rshift_shapes_none\nmatmult_shapes_set = matmult_shapes_none\nadd_shapes_frozenset = {}\nsub_shapes_frozenset = {}\nmult_shapes_frozenset = mult_shapes_none\nfloordiv_shapes_frozenset = floordiv_shapes_none\ntruediv_shapes_frozenset = truediv_shapes_none\nolddiv_shapes_frozenset = olddiv_shapes_none\nmod_shapes_frozenset = mod_shapes_none\ndivmod_shapes_frozenset = divmod_shapes_none\npow_shapes_frozenset = pow_shapes_none\nbitor_shapes_frozenset = {}\nbitand_shapes_frozenset = {}\nbitxor_shapes_frozenset = {}\nlshift_shapes_frozenset = lshift_shapes_none\nrshift_shapes_frozenset = rshift_shapes_none\nmatmult_shapes_frozenset = matmult_shapes_none\nadd_shapes_dict = {}\nsub_shapes_dict = sub_shapes_none\nmult_shapes_dict = mult_shapes_none\nfloordiv_shapes_dict = floordiv_shapes_none\ntruediv_shapes_dict = truediv_shapes_none\nolddiv_shapes_dict = olddiv_shapes_none\nmod_shapes_dict = mod_shapes_none\ndivmod_shapes_dict = divmod_shapes_none\npow_shapes_dict = pow_shapes_none\nbitor_shapes_dict = dict(bitor_shapes_none)\nibitor_shapes_dict = dict(bitor_shapes_none)\nbitand_shapes_dict = bitand_shapes_none\nbitxor_shapes_dict = bitxor_shapes_none\nlshift_shapes_dict = lshift_shapes_none\nrshift_shapes_dict = rshift_shapes_none\nmatmult_shapes_dict = matmult_shapes_none\nadd_shapes_str = {}\nsub_shapes_str = sub_shapes_none\nmult_shapes_str = {}\nfloordiv_shapes_str = floordiv_shapes_none\ntruediv_shapes_str = truediv_shapes_none\nolddiv_shapes_str = olddiv_shapes_none\nmod_shapes_str = {}\ndivmod_shapes_str = divmod_shapes_none\npow_shapes_str = pow_shapes_none\nbitor_shapes_str = bitor_shapes_none\nbitand_shapes_str = bitand_shapes_none\nbitxor_shapes_str = bitxor_shapes_none\nlshift_shapes_str = lshift_shapes_none\nrshift_shapes_str = rshift_shapes_none\nmatmult_shapes_str = matmult_shapes_none\nadd_shapes_bytes = {}\nsub_shapes_bytes = sub_shapes_none\nmult_shapes_bytes = {}\nfloordiv_shapes_bytes = floordiv_shapes_none\ntruediv_shapes_bytes = truediv_shapes_none\nolddiv_shapes_bytes = olddiv_shapes_none\nmod_shapes_bytes = {}\ndivmod_shapes_bytes = divmod_shapes_none\npow_shapes_bytes = pow_shapes_none\nbitor_shapes_bytes = bitor_shapes_none\nbitand_shapes_bytes = bitand_shapes_none\nbitxor_shapes_bytes = bitxor_shapes_none\nlshift_shapes_bytes = lshift_shapes_none\nrshift_shapes_bytes = rshift_shapes_none\nmatmult_shapes_bytes = matmult_shapes_none\nadd_shapes_bytearray = {}\nsub_shapes_bytearray = sub_shapes_none\nmult_shapes_bytearray = {}\nfloordiv_shapes_bytearray = floordiv_shapes_none\ntruediv_shapes_bytearray = truediv_shapes_none\nolddiv_shapes_bytearray = olddiv_shapes_none\nmod_shapes_bytearray = {}\ndivmod_shapes_bytearray = divmod_shapes_none\npow_shapes_bytearray = pow_shapes_none\nbitor_shapes_bytearray = bitor_shapes_none\nbitand_shapes_bytearray = bitand_shapes_none\nbitxor_shapes_bytearray = bitxor_shapes_none\nlshift_shapes_bytearray = lshift_shapes_none\nrshift_shapes_bytearray = rshift_shapes_none\nmatmult_shapes_bytearray = matmult_shapes_none\nadd_shapes_unicode = {}\nsub_shapes_unicode = sub_shapes_none\nmult_shapes_unicode = {}\nfloordiv_shapes_unicode = floordiv_shapes_none\ntruediv_shapes_unicode = truediv_shapes_none\nolddiv_shapes_unicode = olddiv_shapes_none\nmod_shapes_unicode = {}\ndivmod_shapes_unicode = divmod_shapes_none\npow_shapes_unicode = pow_shapes_none\nbitor_shapes_unicode = bitor_shapes_none\nbitand_shapes_unicode = bitand_shapes_none\nbitxor_shapes_unicode = bitxor_shapes_none\nlshift_shapes_unicode = lshift_shapes_none\nrshift_shapes_unicode = rshift_shapes_none\nmatmult_shapes_unicode = matmult_shapes_none\nadd_shapes_strorunicode = {}\nsub_shapes_strorunicode = {}\nmult_shapes_strorunicode = {}\nfloordiv_shapes_strorunicode = {}\ntruediv_shapes_strorunicode = {}\nolddiv_shapes_strorunicode = {}\nmod_shapes_strorunicode = {}\ndivmod_shapes_strorunicode = {}\npow_shapes_strorunicode = {}\nbitor_shapes_strorunicode = {}\nbitand_shapes_strorunicode = {}\nbitxor_shapes_strorunicode = {}\nlshift_shapes_strorunicode = {}\nrshift_shapes_strorunicode = {}\nmatmult_shapes_strorunicode = matmult_shapes_none\n\n\ndef _getComparisonLtShapeGeneric(self, right_shape):\n    if type(right_shape) is ShapeLoopCompleteAlternative:\n        return right_shape.getComparisonLtLShape(self)\n\n    if type(right_shape) is ShapeLoopInitialAlternative:\n        return operation_result_unknown\n\n    onMissingOperation(\"Lt\", self, right_shape)\n    return operation_result_unknown\n\n\ndef _getComparisonEqShapeGeneric(self, right_shape):\n    if type(right_shape) is ShapeLoopCompleteAlternative:\n        return right_shape.getComparisonEqLShape(self)\n\n    if type(right_shape) is ShapeLoopInitialAlternative:\n        return operation_result_unknown\n\n    onMissingOperation(\"Eq\", self, right_shape)\n    return operation_result_unknown\n\n\nclass ShapeTypeNoneType(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = None\n\n    @staticmethod\n    def getTypeName():\n        return \"NoneType\"\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return True\n\n    add_shapes = add_shapes_none\n    sub_shapes = sub_shapes_none\n    mult_shapes = mult_shapes_none\n    floordiv_shapes = floordiv_shapes_none\n    truediv_shapes = truediv_shapes_none\n    olddiv_shapes = olddiv_shapes_none\n    mod_shapes = mod_shapes_none\n    divmod_shapes = divmod_shapes_none\n    pow_shapes = pow_shapes_none\n    bitor_shapes = bitor_shapes_none\n    bitand_shapes = bitand_shapes_none\n    bitxor_shapes = bitxor_shapes_none\n    lshift_shapes = lshift_shapes_none\n    rshift_shapes = rshift_shapes_none\n    matmult_shapes = matmult_shapes_none\n\n    if python_version < 0x300:\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape.getTypeName() is not None:\n                return operation_result_bool_noescape\n\n            if right_shape in (tshape_int_or_long, tshape_str_or_unicode):\n                return operation_result_bool_noescape\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n    else:\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape.getTypeName() is not None:\n                return operation_result_unorderable_comparison\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n        def getComparisonEqShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape.getTypeName() is not None:\n                return operation_result_bool_noescape\n\n            return _getComparisonEqShapeGeneric(self, right_shape)\n\n        def getComparisonNeqShape(self, right_shape):\n            return self.getComparisonEqShape(right_shape)\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionNoEscape\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(None, attribute_name)\n\n\ntshape_none = ShapeTypeNoneType()\n\n\nclass ShapeTypeBool(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = True\n\n    @staticmethod\n    def getTypeName():\n        return \"bool\"\n\n    @staticmethod\n    def getCType():\n        return CTypeNuitkaBoolEnum\n\n    add_shapes = add_shapes_bool\n    sub_shapes = sub_shapes_bool\n    mult_shapes = mult_shapes_bool\n    floordiv_shapes = floordiv_shapes_bool\n    truediv_shapes = truediv_shapes_bool\n    olddiv_shapes = olddiv_shapes_bool\n    mod_shapes = mod_shapes_bool\n    divmod_shapes = divmod_shapes_bool\n    pow_shapes = pow_shapes_bool\n    bitor_shapes = bitor_shapes_bool\n    bitand_shapes = bitand_shapes_bool\n    bitxor_shapes = bitxor_shapes_bool\n    lshift_shapes = lshift_shapes_bool\n    rshift_shapes = rshift_shapes_bool\n    matmult_shapes = matmult_shapes_bool\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape in (\n            tshape_int,\n            tshape_long,\n            tshape_int_or_long,\n            tshape_bool,\n            tshape_float,\n        ):\n            return operation_result_bool_noescape\n\n        if right_shape is tshape_int_or_long_derived:\n            return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(True, attribute_name)\n\n\ntshape_bool = ShapeTypeBool()\n\n\nclass ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = 7\n\n    @staticmethod\n    def getTypeName():\n        return \"int\"\n\n    helper_code = \"INT\" if python_version < 0x300 else \"LONG\"\n\n    add_shapes = add_shapes_int\n    sub_shapes = sub_shapes_int\n    mult_shapes = mult_shapes_int\n    floordiv_shapes = floordiv_shapes_int\n    truediv_shapes = truediv_shapes_int\n    olddiv_shapes = olddiv_shapes_int\n    mod_shapes = mod_shapes_int\n    divmod_shapes = divmod_shapes_int\n    pow_shapes = pow_shapes_int\n    bitor_shapes = bitor_shapes_int\n    bitand_shapes = bitand_shapes_int\n    bitxor_shapes = bitxor_shapes_int\n    lshift_shapes = lshift_shapes_int\n    rshift_shapes = rshift_shapes_int\n    matmult_shapes = matmult_shapes_int\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape in (\n            tshape_int,\n            tshape_long,\n            tshape_int_or_long,\n            tshape_bool,\n            tshape_float,\n        ):\n            return operation_result_bool_noescape\n\n        if right_shape in (\n            tshape_long_derived,\n            tshape_int_or_long_derived,\n            tshape_float_derived,\n        ):\n            return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(7, attribute_name)\n\n\ntshape_int = ShapeTypeInt()\n\nif python_version < 0x300:\n    _the_typical_long_value = long(7)  # pylint: disable=I0021,undefined-variable\n\n    class ShapeTypeLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        typical_value = _the_typical_long_value\n\n        @staticmethod\n        def getTypeName():\n            return \"long\"\n\n        helper_code = \"LONG\" if python_version < 0x300 else \"INVALID\"\n\n        add_shapes = add_shapes_long\n        sub_shapes = sub_shapes_long\n        mult_shapes = mult_shapes_long\n        floordiv_shapes = floordiv_shapes_long\n        truediv_shapes = truediv_shapes_long\n        olddiv_shapes = olddiv_shapes_long\n        mod_shapes = mod_shapes_long\n        divmod_shapes = divmod_shapes_long\n        pow_shapes = pow_shapes_long\n        bitor_shapes = bitor_shapes_long\n        bitand_shapes = bitand_shapes_long\n        bitxor_shapes = bitxor_shapes_long\n        lshift_shapes = lshift_shapes_long\n        rshift_shapes = rshift_shapes_long\n        matmult_shapes = matmult_shapes_long\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape in (\n                tshape_int,\n                tshape_long,\n                tshape_int_or_long,\n                tshape_bool,\n                tshape_float,\n            ):\n                return operation_result_bool_noescape\n\n            if right_shape in (tshape_long_derived, tshape_int_or_long_derived):\n                return operation_result_unknown\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(_the_typical_long_value, attribute_name)\n\n    tshape_long = ShapeTypeLong()\n\n    class ShapeTypeLongDerived(ShapeTypeUnknown):\n        __slots__ = ()\n\n        @staticmethod\n        def getTypeName():\n            return None\n\n    tshape_long_derived = ShapeTypeLongDerived()\n\n    class ShapeTypeIntOrLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        if isExperimental(\"nuitka_ilong\"):\n\n            @staticmethod\n            def getCType():\n                return CTypeNuitkaIntOrLongStruct\n\n        @staticmethod\n        def emitAlternatives(emit):\n            emit(tshape_int)\n            emit(tshape_long)\n\n        add_shapes = add_shapes_intorlong\n        sub_shapes = sub_shapes_intorlong\n        mult_shapes = mult_shapes_intorlong\n        floordiv_shapes = floordiv_shapes_intorlong\n        truediv_shapes = truediv_shapes_intorlong\n        olddiv_shapes = olddiv_shapes_intorlong\n        mod_shapes = mod_shapes_intorlong\n        divmod_shapes = divmod_shapes_intorlong\n        pow_shapes = pow_shapes_intorlong\n        bitor_shapes = bitor_shapes_intorlong\n        bitand_shapes = bitand_shapes_intorlong\n        bitxor_shapes = bitxor_shapes_intorlong\n        lshift_shapes = lshift_shapes_intorlong\n        rshift_shapes = rshift_shapes_intorlong\n        matmult_shapes = matmult_shapes_intorlong\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape in (\n                tshape_int,\n                tshape_long,\n                tshape_int_or_long,\n                tshape_bool,\n                tshape_float,\n            ):\n                return operation_result_bool_noescape\n\n            if right_shape is tshape_int_or_long_derived:\n                return operation_result_unknown\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(7, attribute_name) and hasattr(\n                _the_typical_long_value, attribute_name\n            )\n\n    tshape_int_or_long = ShapeTypeIntOrLong()\n\n\nelse:\n    tshape_long = None\n    tshape_long_derived = None\n    tshape_int_or_long = tshape_int\n\n\n# TODO: Make this Python2 only, and use ShapeTypeIntDerived for Python3\nclass ShapeTypeIntOrLongDerived(ShapeTypeUnknown):\n    __slots__ = ()\n\n\ntshape_int_or_long_derived = ShapeTypeIntOrLongDerived()\n\n\nclass ShapeTypeFloat(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = 0.1\n\n    @staticmethod\n    def getTypeName():\n        return \"float\"\n\n    helper_code = \"FLOAT\"\n\n    add_shapes = add_shapes_float\n    sub_shapes = sub_shapes_float\n    mult_shapes = mult_shapes_float\n    floordiv_shapes = floordiv_shapes_float\n    truediv_shapes = truediv_shapes_float\n    olddiv_shapes = olddiv_shapes_float\n    mod_shapes = mod_shapes_float\n    divmod_shapes = divmod_shapes_float\n    pow_shapes = pow_shapes_float\n    bitor_shapes = bitor_shapes_float\n    bitand_shapes = bitand_shapes_float\n    bitxor_shapes = bitxor_shapes_float\n    lshift_shapes = lshift_shapes_float\n    rshift_shapes = rshift_shapes_float\n    matmult_shapes = matmult_shapes_float\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape in (\n            tshape_float,\n            tshape_long,\n            tshape_int,\n            tshape_int_or_long,\n            tshape_bool,\n        ):\n            return operation_result_bool_noescape\n\n        if right_shape is tshape_float_derived:\n            return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n\ntshape_float = ShapeTypeFloat()\n\n\nclass ShapeTypeFloatDerived(ShapeTypeUnknown):\n    __slots__ = ()\n\n\ntshape_float_derived = ShapeTypeFloatDerived()\n\n\nclass ShapeTypeComplex(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = 0j\n\n    @staticmethod\n    def getTypeName():\n        return \"complex\"\n\n    add_shapes = add_shapes_complex\n    sub_shapes = sub_shapes_complex\n    mult_shapes = mult_shapes_complex\n    floordiv_shapes = floordiv_shapes_complex\n    truediv_shapes = truediv_shapes_complex\n    olddiv_shapes = olddiv_shapes_complex\n    mod_shapes = mod_shapes_complex\n    divmod_shapes = divmod_shapes_complex\n    pow_shapes = pow_shapes_complex\n    bitor_shapes = bitor_shapes_complex\n    bitand_shapes = bitand_shapes_complex\n    bitxor_shapes = bitxor_shapes_complex\n    lshift_shapes = lshift_shapes_complex\n    rshift_shapes = rshift_shapes_complex\n    matmult_shapes = matmult_shapes_complex\n\n\ntshape_complex = ShapeTypeComplex()\n\n\nclass ShapeTypeTuple(ShapeContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = ()\n\n    @staticmethod\n    def getTypeName():\n        return \"tuple\"\n\n    helper_code = \"TUPLE\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_tuple_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    add_shapes = add_shapes_tuple\n    sub_shapes = sub_shapes_tuple\n    mult_shapes = mult_shapes_tuple\n    floordiv_shapes = floordiv_shapes_tuple\n    truediv_shapes = truediv_shapes_tuple\n    olddiv_shapes = olddiv_shapes_tuple\n    mod_shapes = mod_shapes_tuple\n    divmod_shapes = divmod_shapes_tuple\n    pow_shapes = pow_shapes_tuple\n    bitor_shapes = bitor_shapes_tuple\n    bitand_shapes = bitand_shapes_tuple\n    bitxor_shapes = bitxor_shapes_tuple\n    lshift_shapes = lshift_shapes_tuple\n    rshift_shapes = rshift_shapes_tuple\n    matmult_shapes = matmult_shapes_tuple\n\n    def getComparisonLtShape(self, right_shape):\n        # Need to consider value shape for this.\n        return operation_result_unknown\n\n\ntshape_tuple = ShapeTypeTuple()\n\n\nclass ShapeTypeNamedTuple(ShapeContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeName():\n        return \"namedtuple\"\n\n    helper_code = \"NAMEDTUPLE\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_tuple_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    # TODO: Unsupported operation would be different, account for that.\n    add_shapes = add_shapes_tuple\n    sub_shapes = sub_shapes_tuple\n    mult_shapes = mult_shapes_tuple\n    floordiv_shapes = floordiv_shapes_tuple\n    truediv_shapes = truediv_shapes_tuple\n    olddiv_shapes = olddiv_shapes_tuple\n    mod_shapes = mod_shapes_tuple\n    divmod_shapes = divmod_shapes_tuple\n    pow_shapes = pow_shapes_tuple\n    bitor_shapes = bitor_shapes_tuple\n    bitand_shapes = bitand_shapes_tuple\n    bitxor_shapes = bitxor_shapes_tuple\n    lshift_shapes = lshift_shapes_tuple\n    rshift_shapes = rshift_shapes_tuple\n    matmult_shapes = matmult_shapes_tuple\n\n    def getComparisonLtShape(self, right_shape):\n        # Need to consider value shape for this.\n        return operation_result_unknown\n\n\ntshape_namedtuple = ShapeTypeNamedTuple()\n\n\nclass ShapeTypeTupleIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_tuple.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"tupleiterator\" if python_version < 0x300 else \"tuple_iterator\"\n\n    @staticmethod\n    def getIteratedShape():\n        return tshape_tuple\n\n\ntshape_tuple_iterator = ShapeTypeTupleIterator()\n\n\nclass ShapeTypeList(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = []\n\n    @staticmethod\n    def getTypeName():\n        return \"list\"\n\n    helper_code = \"LIST\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_list_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    add_shapes = add_shapes_list\n    sub_shapes = sub_shapes_list\n    mult_shapes = mult_shapes_list\n    floordiv_shapes = floordiv_shapes_list\n    truediv_shapes = truediv_shapes_list\n    olddiv_shapes = olddiv_shapes_list\n    mod_shapes = mod_shapes_list\n    divmod_shapes = divmod_shapes_list\n    pow_shapes = pow_shapes_list\n    bitor_shapes = bitor_shapes_list\n    bitand_shapes = bitand_shapes_list\n    bitxor_shapes = bitxor_shapes_list\n    lshift_shapes = lshift_shapes_list\n    rshift_shapes = rshift_shapes_list\n    matmult_shapes = matmult_shapes_list\n\n    iadd_shapes = iadd_shapes_list\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        # Need to consider value shape for this.\n        if right_shape in (tshape_list, tshape_tuple):\n            return operation_result_bool_elementbased\n\n        if right_shape is tshape_xrange:\n            if python_version < 0x300:\n                return operation_result_bool_elementbased\n            else:\n                # TODO: Actually unorderable, but this requires making a\n                # difference with \"==\"\n                return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n\ntshape_list = ShapeTypeList()\n\n\nclass ShapeTypeListIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_list.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"listiterator\" if python_version < 0x300 else \"list_iterator\"\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_list_iterator = ShapeTypeListIterator()\n\n\nclass ShapeTypeSet(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = set()\n\n    @staticmethod\n    def getTypeName():\n        return \"set\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_set_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n    add_shapes = add_shapes_set\n    sub_shapes = sub_shapes_set\n    mult_shapes = mult_shapes_set\n    floordiv_shapes = floordiv_shapes_set\n    truediv_shapes = truediv_shapes_set\n    olddiv_shapes = olddiv_shapes_set\n    mod_shapes = mod_shapes_set\n    divmod_shapes = divmod_shapes_set\n    pow_shapes = pow_shapes_set\n    bitor_shapes = bitor_shapes_set\n    bitand_shapes = bitand_shapes_set\n    bitxor_shapes = bitxor_shapes_set\n    lshift_shapes = lshift_shapes_set\n    rshift_shapes = rshift_shapes_set\n    matmult_shapes = matmult_shapes_set\n\n    def getComparisonLtShape(self, right_shape):\n        # Need to consider value shape for this.\n        return operation_result_unknown\n\n\ntshape_set = ShapeTypeSet()\n\n\nclass ShapeTypeSetIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_set.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"setiterator\" if python_version < 0x300 else \"set_iterator\"\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_set_iterator = ShapeTypeSetIterator()\n\n\nclass ShapeTypeFrozenset(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = frozenset()\n\n    @staticmethod\n    def getTypeName():\n        return \"frozenset\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_set_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n    add_shapes = add_shapes_frozenset\n    sub_shapes = sub_shapes_frozenset\n    mult_shapes = mult_shapes_frozenset\n    floordiv_shapes = floordiv_shapes_frozenset\n    truediv_shapes = truediv_shapes_frozenset\n    olddiv_shapes = olddiv_shapes_frozenset\n    mod_shapes = mod_shapes_frozenset\n    divmod_shapes = divmod_shapes_frozenset\n    pow_shapes = pow_shapes_frozenset\n    bitor_shapes = bitor_shapes_frozenset\n    bitand_shapes = bitand_shapes_frozenset\n    bitxor_shapes = bitxor_shapes_frozenset\n    lshift_shapes = lshift_shapes_frozenset\n    rshift_shapes = rshift_shapes_frozenset\n    matmult_shapes = matmult_shapes_frozenset\n\n\ntshape_frozenset = ShapeTypeFrozenset()\n\n_the_empty_dict = {}\n\n\nclass ShapeTypeDict(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = _the_empty_dict\n\n    @staticmethod\n    def getTypeName():\n        return \"dict\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_dict_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n    add_shapes = add_shapes_dict\n    sub_shapes = sub_shapes_dict\n    mult_shapes = mult_shapes_dict\n    floordiv_shapes = floordiv_shapes_dict\n    truediv_shapes = truediv_shapes_dict\n    olddiv_shapes = olddiv_shapes_dict\n    mod_shapes = mod_shapes_dict\n    divmod_shapes = divmod_shapes_dict\n    pow_shapes = pow_shapes_dict\n    bitor_shapes = bitor_shapes_dict\n    bitand_shapes = bitand_shapes_dict\n    bitxor_shapes = bitxor_shapes_dict\n    lshift_shapes = lshift_shapes_dict\n    rshift_shapes = rshift_shapes_dict\n    matmult_shapes = matmult_shapes_dict\n\n    ibitor_shapes = ibitor_shapes_dict\n\n    def getComparisonLtShape(self, right_shape):\n        # Need to consider value shape for this\n\n        # TODO: Could return bool with annotation that exception is still\n        # possible..\n        return operation_result_unknown\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(_the_empty_dict, attribute_name)\n\n\ntshape_dict = ShapeTypeDict()\n\n\nclass ShapeTypeDictIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_dict.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return (\n            \"dictionary-keyiterator\" if python_version < 0x300 else \"dictkey_iterator\"\n        )\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_dict_iterator = ShapeTypeDictIterator()\n\n\nclass ShapeTypeStr(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = \"a\"\n\n    @staticmethod\n    def getTypeName():\n        return \"str\"\n\n    helper_code = \"STR\" if python_version < 0x300 else \"UNICODE\"\n\n    # Not a container, but has these.\n    @staticmethod\n    def hasShapeSlotIter():\n        return True\n\n    @staticmethod\n    def hasShapeSlotLen():\n        return True\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return True\n\n    # Not a number, but has these.\n    @staticmethod\n    def hasShapeSlotInt():\n        return True\n\n    @staticmethod\n    def hasShapeSlotLong():\n        return True\n\n    @staticmethod\n    def hasShapeSlotFloat():\n        return True\n\n    @staticmethod\n    def hasShapeSlotComplex():\n        return True\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_str_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return True\n\n    add_shapes = add_shapes_str\n    sub_shapes = sub_shapes_str\n    mult_shapes = mult_shapes_str\n    floordiv_shapes = floordiv_shapes_str\n    truediv_shapes = truediv_shapes_str\n    olddiv_shapes = olddiv_shapes_str\n    mod_shapes = mod_shapes_str\n    divmod_shapes = divmod_shapes_str\n    pow_shapes = pow_shapes_str\n    bitor_shapes = bitor_shapes_str\n    bitand_shapes = bitand_shapes_str\n    bitxor_shapes = bitxor_shapes_str\n    lshift_shapes = lshift_shapes_str\n    rshift_shapes = rshift_shapes_str\n    matmult_shapes = matmult_shapes_str\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape is tshape_str:\n            return operation_result_bool_noescape\n\n        if right_shape is tshape_str_derived:\n            return operation_result_unknown\n\n        if right_shape is tshape_bytearray:\n            if python_version < 0x300:\n                return operation_result_bool_noescape\n            else:\n                return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(\"a\", attribute_name)\n\n\ntshape_str = ShapeTypeStr()\n\n\nclass TypeShapeStrDerived(ShapeTypeUnknown):\n    __slots__ = ()\n\n\ntshape_str_derived = TypeShapeStrDerived()\n\n\nclass ShapeTypeStrIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_str.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"iterator\" if python_version < 0x300 else \"str_iterator\"\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_str_iterator = ShapeTypeStrIterator()\n\n\nif python_version < 0x300:\n\n    class ShapeTypeUnicode(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        typical_value = the_empty_unicode\n\n        @staticmethod\n        def getTypeName():\n            return \"unicode\"\n\n        helper_code = \"UNICODE\"\n\n        # Not a container, but has these.\n        @staticmethod\n        def hasShapeSlotIter():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLen():\n            return True\n\n        @staticmethod\n        def hasShapeSlotContains():\n            return True\n\n        # Not a number, but has these.\n        @staticmethod\n        def hasShapeSlotInt():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLong():\n            return True\n\n        @staticmethod\n        def hasShapeSlotFloat():\n            return True\n\n        @staticmethod\n        def hasShapeSlotComplex():\n            return True\n\n        @staticmethod\n        def hasShapeSlotHash():\n            return True\n\n        @staticmethod\n        def getShapeIter():\n            return tshape_unicode_iterator\n\n        @staticmethod\n        def hasShapeIndexLookup():\n            return True\n\n        @staticmethod\n        def hasShapeTrustedAttributes():\n            return True\n\n        add_shapes = add_shapes_unicode\n        sub_shapes = sub_shapes_unicode\n        mult_shapes = mult_shapes_unicode\n        floordiv_shapes = floordiv_shapes_unicode\n        truediv_shapes = truediv_shapes_unicode\n        olddiv_shapes = olddiv_shapes_unicode\n        mod_shapes = mod_shapes_unicode\n        divmod_shapes = divmod_shapes_unicode\n        pow_shapes = pow_shapes_unicode\n        bitor_shapes = bitor_shapes_unicode\n        bitand_shapes = bitand_shapes_unicode\n        bitxor_shapes = bitxor_shapes_unicode\n        lshift_shapes = lshift_shapes_unicode\n        rshift_shapes = rshift_shapes_unicode\n        matmult_shapes = matmult_shapes_unicode\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape is tshape_unicode:\n                return operation_result_bool_noescape\n\n            if right_shape is tshape_unicode_derived:\n                return operation_result_unknown\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(the_empty_unicode, attribute_name)\n\n    tshape_unicode = ShapeTypeUnicode()\n\n    class ShapeTypeUnicodeDerived(ShapeTypeUnknown):\n        __slots__ = ()\n\n    tshape_unicode_derived = ShapeTypeUnicodeDerived()\n\n    class ShapeTypeUnicodeIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        typical_value = iter(tshape_unicode.typical_value)\n\n        @staticmethod\n        def getTypeName():\n            return \"iterator\"\n\n        @staticmethod\n        def hasShapeIndexLookup():\n            return False\n\n    tshape_unicode_iterator = ShapeTypeUnicodeIterator()\nelse:\n    tshape_unicode = tshape_str\n    tshape_unicode_iterator = tshape_str_iterator\n    tshape_unicode_derived = tshape_str_derived\n\n\nif python_version < 0x300:\n\n    class ShapeTypeStrOrUnicode(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        @staticmethod\n        def emitAlternatives(emit):\n            emit(tshape_str)\n            emit(tshape_unicode)\n\n        @staticmethod\n        def hasShapeSlotIter():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLen():\n            return True\n\n        @staticmethod\n        def hasShapeSlotContains():\n            return True\n\n        @staticmethod\n        def hasShapeSlotInt():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLong():\n            return True\n\n        @staticmethod\n        def hasShapeSlotFloat():\n            return True\n\n        @staticmethod\n        def hasShapeSlotComplex():\n            return True\n\n        @staticmethod\n        def hasShapeSlotHash():\n            return True\n\n        @staticmethod\n        def hasShapeIndexLookup():\n            return True\n\n        @staticmethod\n        def hasShapeTrustedAttributes():\n            return True\n\n        # TODO: There seem to be missing a few here.\n        add_shapes = add_shapes_strorunicode\n        sub_shapes = sub_shapes_strorunicode\n        mult_shapes = mult_shapes_strorunicode\n        bitor_shapes = bitor_shapes_strorunicode\n        bitand_shapes = bitand_shapes_strorunicode\n        bitxor_shapes = bitxor_shapes_strorunicode\n        lshift_shapes = lshift_shapes_strorunicode\n        rshift_shapes = rshift_shapes_strorunicode\n        matmult_shapes = matmult_shapes_strorunicode\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(\"a\", attribute_name) and hasattr(\n                the_empty_unicode, attribute_name\n            )\n\n    tshape_str_or_unicode = ShapeTypeStrOrUnicode()\n\n    class ShapeTypeStrOrUnicodeDerived(ShapeTypeUnknown):\n        __slots__ = ()\n\n    tshape_str_or_unicode_derived = ShapeTypeStrOrUnicodeDerived()\n\nelse:\n    tshape_str_or_unicode = tshape_str\n    tshape_str_or_unicode_derived = tshape_str_derived\n\nif python_version >= 0x300:\n\n    class ShapeTypeBytes(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n        __slots__ = ()\n\n        typical_value = b\"b\"\n\n        @staticmethod\n        def getTypeName():\n            return \"bytes\"\n\n        helper_code = \"BYTES\"\n\n        # Not a container, but has these.\n        @staticmethod\n        def hasShapeSlotIter():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLen():\n            return True\n\n        @staticmethod\n        def hasShapeSlotContains():\n            return True\n\n        # Not a number, but has these.\n        @staticmethod\n        def hasShapeSlotInt():\n            return True\n\n        @staticmethod\n        def hasShapeSlotLong():\n            return True\n\n        @staticmethod\n        def hasShapeSlotFloat():\n            return True\n\n        @staticmethod\n        def hasShapeSlotHash():\n            return True\n\n        @staticmethod\n        def getShapeIter():\n            return tshape_bytes_iterator\n\n        @staticmethod\n        def hasShapeIndexLookup():\n            return True\n\n        @staticmethod\n        def hasShapeTrustedAttributes():\n            return True\n\n        add_shapes = add_shapes_bytes\n        sub_shapes = sub_shapes_bytes\n        mult_shapes = mult_shapes_bytes\n        floordiv_shapes = floordiv_shapes_bytes\n        truediv_shapes = truediv_shapes_bytes\n        olddiv_shapes = olddiv_shapes_bytes\n        mod_shapes = mod_shapes_bytes\n        divmod_shapes = divmod_shapes_bytes\n        pow_shapes = pow_shapes_bytes\n        bitor_shapes = bitor_shapes_bytes\n        bitand_shapes = bitand_shapes_bytes\n        bitxor_shapes = bitxor_shapes_bytes\n        lshift_shapes = lshift_shapes_bytes\n        rshift_shapes = rshift_shapes_bytes\n        matmult_shapes = matmult_shapes_bytes\n\n        def getComparisonLtShape(self, right_shape):\n            if right_shape is tshape_unknown:\n                return operation_result_unknown\n\n            if right_shape is tshape_bytes:\n                return operation_result_bool_noescape\n\n            if right_shape is tshape_bytes_derived:\n                return operation_result_unknown\n\n            return _getComparisonLtShapeGeneric(self, right_shape)\n\n        @staticmethod\n        def isKnownToHaveAttribute(attribute_name):\n            return hasattr(b\"b\", attribute_name)\n\n    tshape_bytes = ShapeTypeBytes()\n\n    class TypeShapeBytesDerived(ShapeTypeUnknown):\n        __slots__ = ()\n\n    tshape_bytes_derived = TypeShapeBytesDerived()\n\n    class TypeShapeBytesIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n        __slots__ = ()\n        typical_value = iter(tshape_bytes.typical_value)\n\n        @staticmethod\n        def getTypeName():\n            return \"bytes_iterator\"\n\n    tshape_bytes_iterator = TypeShapeBytesIterator()\n\n\nelse:\n    # Shouldn't happen with Python2\n    tshape_bytes = None\n    tshape_bytes_iterator = None\n    tshape_bytes_derived = None\n\n_the_typical_bytearray_value = bytearray(b\"b\")\n\n\nclass ShapeTypeBytearray(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = _the_typical_bytearray_value\n\n    @staticmethod\n    def getTypeName():\n        return \"bytearray\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_bytearray_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    add_shapes = add_shapes_bytearray\n    sub_shapes = sub_shapes_bytearray\n    mult_shapes = mult_shapes_bytearray\n    floordiv_shapes = floordiv_shapes_bytearray\n    truediv_shapes = truediv_shapes_bytearray\n    olddiv_shapes = olddiv_shapes_bytearray\n    mod_shapes = mod_shapes_bytearray\n    divmod_shapes = divmod_shapes_bytearray\n    pow_shapes = pow_shapes_bytearray\n    bitor_shapes = bitor_shapes_bytearray\n    bitand_shapes = bitand_shapes_bytearray\n    bitxor_shapes = bitxor_shapes_bytearray\n    lshift_shapes = lshift_shapes_bytearray\n    rshift_shapes = rshift_shapes_bytearray\n    matmult_shapes = matmult_shapes_bytearray\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape in (tshape_bytearray, tshape_bytes):\n            return operation_result_bool_noescape\n\n        if right_shape is tshape_str:\n            if python_version < 0x300:\n                return operation_result_bool_noescape\n            else:\n                # TODO: Exception actually for static optimization.\n                return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(_the_typical_bytearray_value, attribute_name)\n\n\ntshape_bytearray = ShapeTypeBytearray()\n\n\nclass ShapeTypeBytearrayIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_bytearray.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"bytearray_iterator\"\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_bytearray_iterator = ShapeTypeBytearrayIterator()\n\n\nclass ShapeTypeEllipsis(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = Ellipsis\n\n    @staticmethod\n    def getTypeName():\n        return \"ellipsis\"\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(Ellipsis, attribute_name)\n\n\ntshape_ellipsis = ShapeTypeEllipsis()\n\n_the_typical_slice_value = slice(7)\n\n\nclass ShapeTypeSlice(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = _the_typical_slice_value\n\n    @staticmethod\n    def getTypeName():\n        return \"slice\"\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return False\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(_the_typical_slice_value, attribute_name)\n\n\ntshape_slice = ShapeTypeSlice()\n\n_the_typical_xrange_value = (\n    xrange(1)  # pylint: disable=I0021,undefined-variable\n    if python_version < 0x300\n    else range(1)\n)\n\n\nclass ShapeTypeXrange(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = _the_typical_xrange_value\n\n    @staticmethod\n    def getTypeName():\n        return \"xrange\" if python_version < 0x300 else \"range\"\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_xrange_iterator\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return True\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        # TODO: Maybe split in two shapes, they are quite different in the\n        # end when it comes to operations.\n        if python_version < 0x300:\n            # Need to consider value shape for this.\n            if right_shape in (tshape_list, tshape_tuple):\n                return operation_result_bool_elementbased\n\n            if right_shape is tshape_xrange:\n                # TODO: This is value escaping, but that doesn't really apply\n                return operation_result_bool_elementbased\n        else:\n            # TODO: Actually unorderable, but this requires making a\n            # difference with \"==\"\n            return operation_result_unknown\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(_the_typical_xrange_value, attribute_name)\n\n\ntshape_xrange = ShapeTypeXrange()\n\n\nclass ShapeTypeXrangeIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = iter(tshape_xrange.typical_value)\n\n    @staticmethod\n    def getTypeName():\n        return \"rangeiterator\" if python_version < 0x300 else \"range_iterator\"\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return False\n\n\ntshape_xrange_iterator = ShapeTypeXrangeIterator()\n\n\nclass ShapeTypeType(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = int\n\n    @staticmethod\n    def getTypeName():\n        return \"type\"\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        if right_shape is tshape_type:\n            return tshape_unknown, ControlFlowDescriptionNoEscape\n\n        return _getComparisonLtShapeGeneric(self, right_shape)\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        return hasattr(int, attribute_name)\n\n\ntshape_type = ShapeTypeType()\n\n\nclass ShapeTypeModule(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    typical_value = __import__(\"sys\")\n\n    @staticmethod\n    def getTypeName():\n        return \"module\"\n\n    @staticmethod\n    def hasShapeModule():\n        return True\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n\ntshape_module = ShapeTypeModule()\n\n\nclass ShapeTypeFunction(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n    # TODO: Add typical value.\n\n    @staticmethod\n    def getTypeName():\n        return \"function\"\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n\ntshape_function = ShapeTypeFunction()\n\n\nclass ShapeTypeBuiltinModule(ShapeTypeModule):\n    __slots__ = ()\n\n    typical_value = __import__(\"_ctypes\")\n\n\ntshape_module_builtin = ShapeTypeBuiltinModule()\n\n\nclass ShapeTypeFile(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n    # TODO: That need not really be a file, find something better.\n    typical_value = __import__(\"sys\").stdout\n\n    @staticmethod\n    def getTypeName():\n        return \"file\"\n\n    # Files are self-iterators.\n    @staticmethod\n    def hasShapeSlotIter():\n        return True\n\n    @staticmethod\n    def hasShapeSlotNext():\n        return True\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return True\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n\ntshape_file = ShapeTypeFile()\n\n\nclass ShapeTypeStaticmethod(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n\n    # TODO: Add typical value.\n\n    @staticmethod\n    def getTypeName():\n        return \"staticmethod\"\n\n    # TODO: These probably reject all kinds of operations.\n\n\ntshape_staticmethod = ShapeTypeStaticmethod()\n\n\nclass ShapeTypeClassmethod(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):\n    __slots__ = ()\n    # TODO: Add typical value.\n\n    @staticmethod\n    def getTypeName():\n        return \"classmethod\"\n\n    # TODO: These probably reject all kinds of operations.\n\n\ntshape_classmethod = ShapeTypeClassmethod()\n\n\n# Prepared tuples to save creating return value tuples:\noperation_result_bool_noescape = tshape_bool, ControlFlowDescriptionNoEscape\noperation_result_float_noescape = tshape_float, ControlFlowDescriptionNoEscape\noperation_result_int_noescape = tshape_int, ControlFlowDescriptionNoEscape\noperation_result_long_noescape = tshape_long, ControlFlowDescriptionNoEscape\noperation_result_intorlong_noescape = tshape_int_or_long, ControlFlowDescriptionNoEscape\noperation_result_complex_noescape = tshape_complex, ControlFlowDescriptionNoEscape\noperation_result_tuple_noescape = tshape_tuple, ControlFlowDescriptionNoEscape\noperation_result_list_noescape = tshape_list, ControlFlowDescriptionNoEscape\noperation_result_set_noescape = tshape_set, ControlFlowDescriptionNoEscape\noperation_result_frozenset_noescape = tshape_frozenset, ControlFlowDescriptionNoEscape\noperation_result_str_noescape = tshape_str, ControlFlowDescriptionNoEscape\noperation_result_unicode_noescape = tshape_unicode, ControlFlowDescriptionNoEscape\noperation_result_strorunicode_noescape = (\n    tshape_str_or_unicode,\n    ControlFlowDescriptionNoEscape,\n)\noperation_result_bytes_noescape = tshape_bytes, ControlFlowDescriptionNoEscape\noperation_result_bytearray_noescape = tshape_bytearray, ControlFlowDescriptionNoEscape\n\noperation_result_dict_noescape = tshape_dict, ControlFlowDescriptionNoEscape\noperation_result_dict_valueerror = tshape_dict, ControlFlowDescriptionValueErrorNoEscape\n\n\noperation_result_bool_elementbased = (\n    tshape_bool,\n    ControlFlowDescriptionElementBasedEscape,\n)\n\noperation_result_unorderable_comparison = (\n    tshape_unknown,\n    ControlFlowDescriptionComparisonUnorderable,\n)\n\noperation_result_unsupported_add = tshape_unknown, ControlFlowDescriptionAddUnsupported\noperation_result_unsupported_sub = tshape_unknown, ControlFlowDescriptionSubUnsupported\noperation_result_unsupported_mul = tshape_unknown, ControlFlowDescriptionMulUnsupported\noperation_result_unsupported_floordiv = (\n    tshape_unknown,\n    ControlFlowDescriptionFloorDivUnsupported,\n)\noperation_result_unsupported_truediv = (\n    tshape_unknown,\n    ControlFlowDescriptionTrueDivUnsupported,\n)\noperation_result_unsupported_olddiv = (\n    tshape_unknown,\n    ControlFlowDescriptionOldDivUnsupported,\n)\noperation_result_unsupported_mod = tshape_unknown, ControlFlowDescriptionModUnsupported\n\noperation_result_unsupported_divmod = (\n    tshape_unknown,\n    ControlFlowDescriptionDivmodUnsupported,\n)\noperation_result_unsupported_pow = tshape_unknown, ControlFlowDescriptionPowUnsupported\noperation_result_unsupported_bitor = (\n    tshape_unknown,\n    ControlFlowDescriptionBitorUnsupported,\n)\noperation_result_unsupported_bitand = (\n    tshape_unknown,\n    ControlFlowDescriptionBitandUnsupported,\n)\noperation_result_unsupported_bitxor = (\n    tshape_unknown,\n    ControlFlowDescriptionBitxorUnsupported,\n)\noperation_result_unsupported_lshift = (\n    tshape_unknown,\n    ControlFlowDescriptionLshiftUnsupported,\n)\noperation_result_unsupported_rshift = (\n    tshape_unknown,\n    ControlFlowDescriptionRshiftUnsupported,\n)\noperation_result_unsupported_matmult = (\n    tshape_unknown,\n    ControlFlowDescriptionMatmultUnsupported,\n)\n\n\n# ZeroDivisionError can occur for some module and division operations, otherwise they\n# are fixed type.\noperation_result_zerodiv_int = tshape_int, ControlFlowDescriptionZeroDivisionNoEscape\noperation_result_zerodiv_long = (\n    tshape_long,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\noperation_result_zerodiv_intorlong = (\n    tshape_int_or_long,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\noperation_result_zerodiv_float = (\n    tshape_float,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\noperation_result_zerodiv_complex = (\n    tshape_complex,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\noperation_result_zerodiv_tuple = (\n    tshape_tuple,\n    ControlFlowDescriptionZeroDivisionNoEscape,\n)\noperation_result_valueerror_intorlong = (\n    tshape_int_or_long,\n    ControlFlowDescriptionValueErrorNoEscape,\n)\noperation_result_valueerror_long = (\n    tshape_long,\n    ControlFlowDescriptionValueErrorNoEscape,\n)\n\n# Format operations can do many things.\noperation_result_str_formaterror = (tshape_str, ControlFlowDescriptionFormatError)\noperation_result_unicode_formaterror = (\n    tshape_unicode,\n    ControlFlowDescriptionFormatError,\n)\noperation_result_bytes_formaterror = (tshape_bytes, ControlFlowDescriptionFormatError)\noperation_result_bytearray_formaterror = (\n    tshape_bytearray,\n    ControlFlowDescriptionFormatError,\n)\n\n\n# Prepared values, reject everything.\ndef _rejectEverything(shapes, operation_unsupported):\n    shapes.update(\n        {\n            # Standard\n            tshape_unknown: operation_result_unknown,\n            tshape_long_derived: operation_result_unknown,\n            tshape_int_or_long_derived: operation_result_unknown,\n            tshape_float_derived: operation_result_unknown,\n            tshape_str_derived: operation_result_unknown,\n            tshape_unicode_derived: operation_result_unknown,\n            tshape_bytes_derived: operation_result_unknown,\n            # None really hates everything concrete for all operations.\n            tshape_int: operation_unsupported,\n            tshape_long: operation_unsupported,\n            tshape_int_or_long: operation_unsupported,\n            tshape_bool: operation_unsupported,\n            tshape_long: operation_unsupported,\n            tshape_float: operation_unsupported,\n            tshape_complex: operation_unsupported,\n            # Sequence repeat:\n            tshape_str: operation_unsupported,\n            tshape_bytes: operation_unsupported,\n            tshape_bytearray: operation_unsupported,\n            tshape_unicode: operation_unsupported,\n            tshape_tuple: operation_unsupported,\n            tshape_list: operation_unsupported,\n            # Unsupported:\n            tshape_set: operation_unsupported,\n            tshape_frozenset: operation_unsupported,\n            tshape_dict: operation_unsupported,\n            tshape_type: operation_unsupported,\n            tshape_none: operation_unsupported,\n        }\n    )\n\n\n_rejectEverything(add_shapes_none, operation_result_unsupported_add)\n_rejectEverything(sub_shapes_none, operation_result_unsupported_sub)\n_rejectEverything(mult_shapes_none, operation_result_unsupported_mul)\n_rejectEverything(floordiv_shapes_none, operation_result_unsupported_floordiv)\n_rejectEverything(truediv_shapes_none, operation_result_unsupported_truediv)\n_rejectEverything(olddiv_shapes_none, operation_result_unsupported_olddiv)\n_rejectEverything(mod_shapes_none, operation_result_unsupported_mod)\n_rejectEverything(divmod_shapes_none, operation_result_unsupported_divmod)\n_rejectEverything(pow_shapes_none, operation_result_unsupported_pow)\n_rejectEverything(bitor_shapes_none, operation_result_unsupported_bitor)\n_rejectEverything(bitand_shapes_none, operation_result_unsupported_bitand)\n_rejectEverything(bitxor_shapes_none, operation_result_unsupported_bitxor)\n_rejectEverything(lshift_shapes_none, operation_result_unsupported_lshift)\n_rejectEverything(rshift_shapes_none, operation_result_unsupported_rshift)\n_rejectEverything(matmult_shapes_none, operation_result_unsupported_rshift)\n\n\ndef cloneWithUnsupportedChange(op_shapes, operation_result_unsupported):\n    r = {}\n\n    for key, value in op_shapes.items():\n        if value[1].getExceptionExit() is TypeError:\n            value = operation_result_unsupported\n\n        r[key] = value\n\n    return r\n\n\nadd_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_intorlong_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_int_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_bool.update(\n    cloneWithUnsupportedChange(add_shapes_bool, operation_result_unsupported_sub)\n)\n\n\nmult_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_int_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_int_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_str_noescape,\n        tshape_bytes: operation_result_bytes_noescape,\n        tshape_bytearray: operation_result_bytearray_noescape,\n        tshape_unicode: operation_result_unicode_noescape,\n        tshape_tuple: operation_result_tuple_noescape,\n        tshape_list: operation_result_list_noescape,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nfloordiv_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Ints do math\n        tshape_int: operation_result_zerodiv_int,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_floordiv,\n        tshape_bytes: operation_result_unsupported_floordiv,\n        tshape_bytearray: operation_result_unsupported_floordiv,\n        tshape_unicode: operation_result_unsupported_floordiv,\n        tshape_tuple: operation_result_unsupported_floordiv,\n        tshape_list: operation_result_unsupported_floordiv,\n        tshape_set: operation_result_unsupported_floordiv,\n        tshape_frozenset: operation_result_unsupported_floordiv,\n        tshape_dict: operation_result_unsupported_floordiv,\n        tshape_type: operation_result_unsupported_floordiv,\n        tshape_none: operation_result_unsupported_floordiv,\n    }\n)\n\ntruediv_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Bool act mostly like 0 or 1 int.\n        tshape_int: operation_result_zerodiv_float,\n        tshape_long: operation_result_zerodiv_float,\n        tshape_int_or_long: operation_result_zerodiv_float,\n        tshape_bool: operation_result_zerodiv_float,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_truediv,\n        tshape_bytes: operation_result_unsupported_truediv,\n        tshape_bytearray: operation_result_unsupported_truediv,\n        tshape_unicode: operation_result_unsupported_truediv,\n        tshape_tuple: operation_result_unsupported_truediv,\n        tshape_list: operation_result_unsupported_truediv,\n        tshape_set: operation_result_unsupported_truediv,\n        tshape_frozenset: operation_result_unsupported_truediv,\n        tshape_dict: operation_result_unsupported_truediv,\n        tshape_type: operation_result_unsupported_truediv,\n        tshape_none: operation_result_unsupported_truediv,\n    }\n)\n\nolddiv_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Bool act mostly like 0 or 1 int.\n        tshape_int: operation_result_zerodiv_int,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_olddiv,\n        tshape_bytes: operation_result_unsupported_olddiv,\n        tshape_bytearray: operation_result_unsupported_olddiv,\n        tshape_unicode: operation_result_unsupported_olddiv,\n        tshape_tuple: operation_result_unsupported_olddiv,\n        tshape_list: operation_result_unsupported_olddiv,\n        tshape_set: operation_result_unsupported_olddiv,\n        tshape_dict: operation_result_unsupported_olddiv,\n        tshape_type: operation_result_unsupported_olddiv,\n        tshape_none: operation_result_unsupported_olddiv,\n    }\n)\n\nmod_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_zerodiv_int,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: (\n            operation_result_zerodiv_complex\n            if python_version < 0x300\n            else operation_result_unsupported_mod\n        ),\n        # Unsupported:\n        tshape_str: operation_result_unsupported_mod,\n        tshape_bytes: operation_result_unsupported_mod,\n        tshape_bytearray: operation_result_unsupported_mod,\n        tshape_unicode: operation_result_unsupported_mod,\n        tshape_tuple: operation_result_unsupported_mod,\n        tshape_list: operation_result_unsupported_mod,\n        tshape_set: operation_result_unsupported_mod,\n        tshape_frozenset: operation_result_unsupported_mod,\n        tshape_dict: operation_result_unsupported_mod,\n        tshape_type: operation_result_unsupported_mod,\n        tshape_none: operation_result_unsupported_mod,\n    }\n)\n\ndivmod_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Divmod makes tuples of 2 elements\n        tshape_int: operation_result_zerodiv_tuple,\n        tshape_long: operation_result_zerodiv_tuple,\n        tshape_int_or_long: operation_result_zerodiv_tuple,\n        tshape_bool: operation_result_zerodiv_tuple,\n        tshape_float: operation_result_zerodiv_tuple,\n        tshape_complex: operation_result_zerodiv_tuple,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_divmod,\n        tshape_bytes: operation_result_unsupported_divmod,\n        tshape_bytearray: operation_result_unsupported_divmod,\n        tshape_unicode: operation_result_unsupported_divmod,\n        tshape_tuple: operation_result_unsupported_divmod,\n        tshape_list: operation_result_unsupported_divmod,\n        tshape_set: operation_result_unsupported_divmod,\n        tshape_frozenset: operation_result_unsupported_divmod,\n        tshape_dict: operation_result_unsupported_divmod,\n        tshape_type: operation_result_unsupported_divmod,\n        tshape_none: operation_result_unsupported_divmod,\n    }\n)\n\npow_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_unknown,  # TODO: operation_result_zerodiv_intorfloat,\n        tshape_long: operation_result_unknown,  # TODO: operation_result_zerodiv_longorfloat,\n        tshape_int_or_long: operation_result_unknown,  # TODO: operation_result_izerodiv_ntorlongorfloat,\n        tshape_bool: operation_result_int_noescape,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_pow,\n        tshape_bytes: operation_result_unsupported_pow,\n        tshape_bytearray: operation_result_unsupported_pow,\n        tshape_unicode: operation_result_unsupported_pow,\n        tshape_tuple: operation_result_unsupported_pow,\n        tshape_list: operation_result_unsupported_pow,\n        tshape_set: operation_result_unsupported_pow,\n        tshape_frozenset: operation_result_unsupported_pow,\n        tshape_dict: operation_result_unsupported_pow,\n        tshape_type: operation_result_unsupported_pow,\n        tshape_none: operation_result_unsupported_pow,\n    }\n)\n\nbitor_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_int_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_bool_noescape,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_bitor,\n        tshape_complex: operation_result_unsupported_bitor,\n        tshape_str: operation_result_unsupported_bitor,\n        tshape_bytes: operation_result_unsupported_bitor,\n        tshape_bytearray: operation_result_unsupported_bitor,\n        tshape_unicode: operation_result_unsupported_bitor,\n        tshape_tuple: operation_result_unsupported_bitor,\n        tshape_list: operation_result_unsupported_bitor,\n        tshape_set: operation_result_unsupported_bitor,\n        tshape_frozenset: operation_result_unsupported_bitor,\n        tshape_dict: operation_result_unsupported_bitor,\n        tshape_type: operation_result_unsupported_bitor,\n        tshape_none: operation_result_unsupported_bitor,\n    }\n)\n\nbitand_shapes_bool.update(\n    cloneWithUnsupportedChange(bitor_shapes_bool, operation_result_unsupported_bitand)\n)\nbitxor_shapes_bool.update(\n    cloneWithUnsupportedChange(bitor_shapes_bool, operation_result_unsupported_bitand)\n)\n\nlshift_shapes_bool.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_valueerror_intorlong,\n        tshape_long: operation_result_valueerror_long,\n        tshape_int_or_long: operation_result_valueerror_intorlong,\n        tshape_bool: operation_result_valueerror_intorlong,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_lshift,\n        tshape_complex: operation_result_unsupported_lshift,\n        tshape_str: operation_result_unsupported_lshift,\n        tshape_bytes: operation_result_unsupported_lshift,\n        tshape_bytearray: operation_result_unsupported_lshift,\n        tshape_unicode: operation_result_unsupported_lshift,\n        tshape_tuple: operation_result_unsupported_lshift,\n        tshape_list: operation_result_unsupported_lshift,\n        tshape_set: operation_result_unsupported_lshift,\n        tshape_frozenset: operation_result_unsupported_lshift,\n        tshape_dict: operation_result_unsupported_lshift,\n        tshape_type: operation_result_unsupported_lshift,\n        tshape_none: operation_result_unsupported_lshift,\n    }\n)\nrshift_shapes_bool.update(\n    cloneWithUnsupportedChange(lshift_shapes_bool, operation_result_unsupported_rshift)\n)\n\n\nadd_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_intorlong_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_intorlong_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_int.update(\n    cloneWithUnsupportedChange(add_shapes_int, operation_result_unsupported_sub)\n)\n\nmult_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_intorlong_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_int_noescape,  # cannot overflow\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_str_noescape,\n        tshape_bytes: operation_result_bytes_noescape,\n        tshape_bytearray: operation_result_bytearray_noescape,\n        tshape_unicode: operation_result_unicode_noescape,\n        tshape_tuple: operation_result_tuple_noescape,\n        tshape_list: operation_result_list_noescape,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nfloordiv_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math ops\n        tshape_int: operation_result_zerodiv_intorlong,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_floordiv,\n        tshape_bytes: operation_result_unsupported_floordiv,\n        tshape_bytearray: operation_result_unsupported_floordiv,\n        tshape_unicode: operation_result_unsupported_floordiv,\n        tshape_tuple: operation_result_unsupported_floordiv,\n        tshape_list: operation_result_unsupported_floordiv,\n        tshape_set: operation_result_unsupported_floordiv,\n        tshape_frozenset: operation_result_unsupported_floordiv,\n        tshape_dict: operation_result_unsupported_floordiv,\n        tshape_type: operation_result_unsupported_floordiv,\n        tshape_none: operation_result_unsupported_floordiv,\n    }\n)\n\ntruediv_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math ops\n        tshape_int: operation_result_zerodiv_float,\n        tshape_long: operation_result_zerodiv_float,\n        tshape_int_or_long: operation_result_zerodiv_float,\n        tshape_bool: operation_result_zerodiv_float,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_truediv,\n        tshape_bytes: operation_result_unsupported_truediv,\n        tshape_bytearray: operation_result_unsupported_truediv,\n        tshape_unicode: operation_result_unsupported_truediv,\n        tshape_tuple: operation_result_unsupported_truediv,\n        tshape_list: operation_result_unsupported_truediv,\n        tshape_set: operation_result_unsupported_truediv,\n        tshape_frozenset: operation_result_unsupported_truediv,\n        tshape_dict: operation_result_unsupported_truediv,\n        tshape_type: operation_result_unsupported_truediv,\n        tshape_none: operation_result_unsupported_truediv,\n    }\n)\n\nolddiv_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math\n        tshape_int: operation_result_zerodiv_intorlong,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_olddiv,\n        tshape_bytes: operation_result_unsupported_olddiv,\n        tshape_bytearray: operation_result_unsupported_olddiv,\n        tshape_unicode: operation_result_unsupported_olddiv,\n        tshape_tuple: operation_result_unsupported_olddiv,\n        tshape_list: operation_result_unsupported_olddiv,\n        tshape_set: operation_result_unsupported_olddiv,\n        tshape_dict: operation_result_unsupported_olddiv,\n        tshape_type: operation_result_unsupported_olddiv,\n        tshape_none: operation_result_unsupported_olddiv,\n    }\n)\n\nmod_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math\n        tshape_int: operation_result_zerodiv_intorlong,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_intorlong,\n        tshape_bool: operation_result_zerodiv_int,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: (\n            operation_result_zerodiv_complex\n            if python_version < 0x300\n            else operation_result_unsupported_mod\n        ),\n        # Unsupported:\n        tshape_str: operation_result_unsupported_mod,\n        tshape_bytes: operation_result_unsupported_mod,\n        tshape_bytearray: operation_result_unsupported_mod,\n        tshape_unicode: operation_result_unsupported_mod,\n        tshape_tuple: operation_result_unsupported_mod,\n        tshape_list: operation_result_unsupported_mod,\n        tshape_set: operation_result_unsupported_mod,\n        tshape_frozenset: operation_result_unsupported_mod,\n        tshape_dict: operation_result_unsupported_mod,\n        tshape_type: operation_result_unsupported_mod,\n        tshape_none: operation_result_unsupported_mod,\n    }\n)\n\npow_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_unknown,  # TODO: operation_result_intorlongorfloat,\n        tshape_long: operation_result_unknown,  # TODO: operation_result_longorfloat,\n        tshape_int_or_long: operation_result_unknown,  # TODO: operation_result_intorlongorfloat,\n        tshape_bool: operation_result_int_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_pow,\n        tshape_bytes: operation_result_unsupported_pow,\n        tshape_bytearray: operation_result_unsupported_pow,\n        tshape_unicode: operation_result_unsupported_pow,\n        tshape_tuple: operation_result_unsupported_pow,\n        tshape_list: operation_result_unsupported_pow,\n        tshape_set: operation_result_unsupported_pow,\n        tshape_frozenset: operation_result_unsupported_pow,\n        tshape_dict: operation_result_unsupported_pow,\n        tshape_type: operation_result_unsupported_pow,\n        tshape_none: operation_result_unsupported_pow,\n    }\n)\n\nbitor_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_int_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_intorlong_noescape,\n        tshape_bool: operation_result_int_noescape,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_bitor,\n        tshape_complex: operation_result_unsupported_bitor,\n        tshape_str: operation_result_unsupported_bitor,\n        tshape_bytes: operation_result_unsupported_bitor,\n        tshape_bytearray: operation_result_unsupported_bitor,\n        tshape_unicode: operation_result_unsupported_bitor,\n        tshape_tuple: operation_result_unsupported_bitor,\n        tshape_list: operation_result_unsupported_bitor,\n        tshape_set: operation_result_unsupported_bitor,\n        tshape_frozenset: operation_result_unsupported_bitor,\n        tshape_dict: operation_result_unsupported_bitor,\n        tshape_type: operation_result_unsupported_bitor,\n        tshape_none: operation_result_unsupported_bitor,\n    }\n)\n\nbitand_shapes_int.update(\n    cloneWithUnsupportedChange(bitor_shapes_int, operation_result_unsupported_bitand)\n)\nbitxor_shapes_int.update(\n    cloneWithUnsupportedChange(bitor_shapes_int, operation_result_unsupported_bitand)\n)\n\nlshift_shapes_int.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_valueerror_intorlong,\n        tshape_long: operation_result_valueerror_long,\n        tshape_int_or_long: operation_result_valueerror_intorlong,\n        tshape_bool: operation_result_valueerror_intorlong,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_lshift,\n        tshape_complex: operation_result_unsupported_lshift,\n        tshape_str: operation_result_unsupported_lshift,\n        tshape_bytes: operation_result_unsupported_lshift,\n        tshape_bytearray: operation_result_unsupported_lshift,\n        tshape_unicode: operation_result_unsupported_lshift,\n        tshape_tuple: operation_result_unsupported_lshift,\n        tshape_list: operation_result_unsupported_lshift,\n        tshape_set: operation_result_unsupported_lshift,\n        tshape_frozenset: operation_result_unsupported_lshift,\n        tshape_dict: operation_result_unsupported_lshift,\n        tshape_type: operation_result_unsupported_lshift,\n        tshape_none: operation_result_unsupported_lshift,\n    }\n)\nrshift_shapes_int.update(\n    cloneWithUnsupportedChange(lshift_shapes_int, operation_result_unsupported_rshift)\n)\n\n\nadd_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_long_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_long_noescape,\n        tshape_bool: operation_result_long_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_long_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_long_noescape,\n        tshape_bool: operation_result_long_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_unsupported_sub,\n        tshape_bytes: operation_result_unsupported_sub,\n        tshape_bytearray: operation_result_unsupported_sub,\n        tshape_unicode: operation_result_unsupported_sub,\n        tshape_tuple: operation_result_unsupported_sub,\n        tshape_list: operation_result_unsupported_sub,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_sub,\n        tshape_frozenset: operation_result_unsupported_sub,\n        tshape_dict: operation_result_unsupported_sub,\n        tshape_type: operation_result_unsupported_sub,\n        tshape_none: operation_result_unsupported_sub,\n    }\n)\n\n\nmult_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_long_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_long_noescape,\n        tshape_bool: operation_result_long_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat:\n        tshape_str: operation_result_str_noescape,\n        tshape_bytes: operation_result_bytes_noescape,\n        tshape_bytearray: operation_result_bytearray_noescape,\n        tshape_unicode: operation_result_unicode_noescape,\n        tshape_tuple: operation_result_tuple_noescape,\n        tshape_list: operation_result_list_noescape,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nfloordiv_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math ops\n        tshape_int: operation_result_zerodiv_long,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_long,\n        tshape_bool: operation_result_zerodiv_long,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_floordiv,\n        tshape_bytes: operation_result_unsupported_floordiv,\n        tshape_bytearray: operation_result_unsupported_floordiv,\n        tshape_unicode: operation_result_unsupported_floordiv,\n        tshape_tuple: operation_result_unsupported_floordiv,\n        tshape_list: operation_result_unsupported_floordiv,\n        tshape_set: operation_result_unsupported_floordiv,\n        tshape_frozenset: operation_result_unsupported_floordiv,\n        tshape_dict: operation_result_unsupported_floordiv,\n        tshape_type: operation_result_unsupported_floordiv,\n        tshape_none: operation_result_unsupported_floordiv,\n    }\n)\n\nolddiv_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math\n        tshape_int: operation_result_zerodiv_long,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_long,\n        tshape_bool: operation_result_zerodiv_long,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_olddiv,\n        tshape_bytes: operation_result_unsupported_olddiv,\n        tshape_bytearray: operation_result_unsupported_olddiv,\n        tshape_unicode: operation_result_unsupported_olddiv,\n        tshape_tuple: operation_result_unsupported_olddiv,\n        tshape_list: operation_result_unsupported_olddiv,\n        tshape_set: operation_result_unsupported_olddiv,\n        tshape_dict: operation_result_unsupported_olddiv,\n        tshape_type: operation_result_unsupported_olddiv,\n        tshape_none: operation_result_unsupported_olddiv,\n    }\n)\n\nmod_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # ints do math\n        tshape_int: operation_result_zerodiv_long,\n        tshape_long: operation_result_zerodiv_long,\n        tshape_int_or_long: operation_result_zerodiv_long,\n        tshape_bool: operation_result_zerodiv_long,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: (\n            operation_result_zerodiv_complex\n            if python_version < 0x300\n            else operation_result_unsupported_mod\n        ),\n        # Unsupported:\n        tshape_str: operation_result_unsupported_mod,\n        tshape_bytes: operation_result_unsupported_mod,\n        tshape_bytearray: operation_result_unsupported_mod,\n        tshape_unicode: operation_result_unsupported_mod,\n        tshape_tuple: operation_result_unsupported_mod,\n        tshape_list: operation_result_unsupported_mod,\n        tshape_set: operation_result_unsupported_mod,\n        tshape_frozenset: operation_result_unsupported_mod,\n        tshape_dict: operation_result_unsupported_mod,\n        tshape_type: operation_result_unsupported_mod,\n        tshape_none: operation_result_unsupported_mod,\n    }\n)\n\npow_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_unknown,  # TODO: operation_result_intorlongorfloat,\n        tshape_long: operation_result_unknown,  # TODO: operation_result_longorfloat,\n        tshape_int_or_long: operation_result_unknown,  # TODO: operation_result_intorlongorfloat,\n        tshape_bool: operation_result_long_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_pow,\n        tshape_bytes: operation_result_unsupported_pow,\n        tshape_bytearray: operation_result_unsupported_pow,\n        tshape_unicode: operation_result_unsupported_pow,\n        tshape_tuple: operation_result_unsupported_pow,\n        tshape_list: operation_result_unsupported_pow,\n        tshape_set: operation_result_unsupported_pow,\n        tshape_frozenset: operation_result_unsupported_pow,\n        tshape_dict: operation_result_unsupported_pow,\n        tshape_type: operation_result_unsupported_pow,\n        tshape_none: operation_result_unsupported_pow,\n    }\n)\n\nbitor_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Long keep their type\n        tshape_int: operation_result_long_noescape,\n        tshape_long: operation_result_long_noescape,\n        tshape_int_or_long: operation_result_long_noescape,\n        tshape_bool: operation_result_long_noescape,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_bitor,\n        tshape_complex: operation_result_unsupported_bitor,\n        tshape_str: operation_result_unsupported_bitor,\n        tshape_bytes: operation_result_unsupported_bitor,\n        tshape_bytearray: operation_result_unsupported_bitor,\n        tshape_unicode: operation_result_unsupported_bitor,\n        tshape_tuple: operation_result_unsupported_bitor,\n        tshape_list: operation_result_unsupported_bitor,\n        tshape_set: operation_result_unsupported_bitor,\n        tshape_frozenset: operation_result_unsupported_bitor,\n        tshape_dict: operation_result_unsupported_bitor,\n        tshape_type: operation_result_unsupported_bitor,\n        tshape_none: operation_result_unsupported_bitor,\n    }\n)\n\nbitand_shapes_long.update(\n    cloneWithUnsupportedChange(bitor_shapes_long, operation_result_unsupported_bitand)\n)\nbitxor_shapes_long.update(\n    cloneWithUnsupportedChange(bitor_shapes_long, operation_result_unsupported_bitand)\n)\n\nlshift_shapes_long.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Long keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_valueerror_long,\n        tshape_long: operation_result_valueerror_long,\n        tshape_int_or_long: operation_result_valueerror_long,\n        tshape_bool: operation_result_valueerror_long,\n        # Unsupported:\n        tshape_float: operation_result_unsupported_lshift,\n        tshape_complex: operation_result_unsupported_lshift,\n        tshape_str: operation_result_unsupported_lshift,\n        tshape_bytes: operation_result_unsupported_lshift,\n        tshape_bytearray: operation_result_unsupported_lshift,\n        tshape_unicode: operation_result_unsupported_lshift,\n        tshape_tuple: operation_result_unsupported_lshift,\n        tshape_list: operation_result_unsupported_lshift,\n        tshape_set: operation_result_unsupported_lshift,\n        tshape_frozenset: operation_result_unsupported_lshift,\n        tshape_dict: operation_result_unsupported_lshift,\n        tshape_type: operation_result_unsupported_lshift,\n        tshape_none: operation_result_unsupported_lshift,\n    }\n)\nrshift_shapes_long.update(\n    cloneWithUnsupportedChange(lshift_shapes_long, operation_result_unsupported_rshift)\n)\n\n\ndef mergeIntOrLong(op_shapes_int, op_shapes_long):\n    r = {}\n\n    for key, value in op_shapes_int.items():\n        value2 = op_shapes_long[key]\n\n        if value is value2:\n            r[key] = value\n        elif value[0] is tshape_int_or_long and value2[0] is tshape_long:\n            assert value[1] is value2[1]\n\n            r[key] = value\n        elif value[0] is tshape_int and value2[0] is tshape_long:\n            assert value[1] is value2[1]\n\n            if value[1] is operation_result_intorlong_noescape[1]:\n                r[key] = operation_result_intorlong_noescape\n            elif value[1] is operation_result_zerodiv_intorlong[1]:\n                r[key] = operation_result_zerodiv_intorlong\n            else:\n                assert False\n        else:\n            assert False, (key, \"->\", value, \"!=\", value2)\n\n    return r\n\n\nadd_shapes_intorlong.update(mergeIntOrLong(add_shapes_int, add_shapes_long))\nsub_shapes_intorlong.update(mergeIntOrLong(sub_shapes_int, sub_shapes_long))\nmult_shapes_intorlong.update(mergeIntOrLong(mult_shapes_int, mult_shapes_long))\nfloordiv_shapes_intorlong.update(\n    mergeIntOrLong(floordiv_shapes_int, floordiv_shapes_long)\n)\ntruediv_shapes_intorlong.update(mergeIntOrLong(truediv_shapes_int, truediv_shapes_long))\nolddiv_shapes_intorlong.update(mergeIntOrLong(olddiv_shapes_int, olddiv_shapes_long))\nmod_shapes_intorlong.update(mergeIntOrLong(mod_shapes_int, mod_shapes_long))\ndivmod_shapes_intorlong.update(mergeIntOrLong(divmod_shapes_int, divmod_shapes_long))\npow_shapes_intorlong.update(mergeIntOrLong(pow_shapes_int, pow_shapes_long))\nlshift_shapes_intorlong.update(mergeIntOrLong(lshift_shapes_int, lshift_shapes_long))\nrshift_shapes_intorlong.update(mergeIntOrLong(rshift_shapes_int, rshift_shapes_long))\nbitor_shapes_intorlong.update(mergeIntOrLong(bitor_shapes_int, bitor_shapes_long))\nbitand_shapes_intorlong.update(mergeIntOrLong(bitand_shapes_int, bitand_shapes_long))\nbitxor_shapes_intorlong.update(mergeIntOrLong(bitxor_shapes_int, bitxor_shapes_long))\n\nadd_shapes_float.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_float_noescape,\n        tshape_long: operation_result_float_noescape,\n        tshape_int_or_long: operation_result_float_noescape,\n        tshape_bool: operation_result_float_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_float.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_float_noescape,\n        tshape_long: operation_result_float_noescape,\n        tshape_int_or_long: operation_result_float_noescape,\n        tshape_bool: operation_result_float_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_sub,\n        tshape_bytes: operation_result_unsupported_sub,\n        tshape_bytearray: operation_result_unsupported_sub,\n        tshape_unicode: operation_result_unsupported_sub,\n        tshape_tuple: operation_result_unsupported_sub,\n        tshape_list: operation_result_unsupported_sub,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_sub,\n        tshape_frozenset: operation_result_unsupported_sub,\n        tshape_dict: operation_result_unsupported_sub,\n        tshape_type: operation_result_unsupported_sub,\n        tshape_none: operation_result_unsupported_sub,\n    }\n)\n\n\nmult_shapes_float.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_float_noescape,\n        tshape_long: operation_result_float_noescape,\n        tshape_int_or_long: operation_result_float_noescape,\n        tshape_bool: operation_result_float_noescape,\n        tshape_float: operation_result_float_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nfloordiv_shapes_float.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # floats do math ops\n        tshape_int: operation_result_zerodiv_float,\n        tshape_long: operation_result_zerodiv_float,\n        tshape_int_or_long: operation_result_zerodiv_float,\n        tshape_bool: operation_result_zerodiv_float,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_floordiv,\n        tshape_bytes: operation_result_unsupported_floordiv,\n        tshape_bytearray: operation_result_unsupported_floordiv,\n        tshape_unicode: operation_result_unsupported_floordiv,\n        tshape_tuple: operation_result_unsupported_floordiv,\n        tshape_list: operation_result_unsupported_floordiv,\n        tshape_set: operation_result_unsupported_floordiv,\n        tshape_frozenset: operation_result_unsupported_floordiv,\n        tshape_dict: operation_result_unsupported_floordiv,\n        tshape_type: operation_result_unsupported_floordiv,\n        tshape_none: operation_result_unsupported_floordiv,\n    }\n)\n\ntruediv_shapes_float.update(\n    cloneWithUnsupportedChange(\n        floordiv_shapes_float, operation_result_unsupported_truediv\n    )\n)\nolddiv_shapes_float.update(\n    cloneWithUnsupportedChange(\n        floordiv_shapes_float, operation_result_unsupported_olddiv\n    )\n)\n\nmod_shapes_float.update(\n    cloneWithUnsupportedChange(floordiv_shapes_float, operation_result_unsupported_mod)\n)\n\npow_shapes_float.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int keep their type, as bool is 0 or 1 int.\n        tshape_int: operation_result_zerodiv_float,\n        tshape_long: operation_result_zerodiv_float,\n        tshape_int_or_long: operation_result_zerodiv_float,\n        tshape_bool: operation_result_float_noescape,\n        tshape_float: operation_result_zerodiv_float,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_pow,\n        tshape_bytes: operation_result_unsupported_pow,\n        tshape_bytearray: operation_result_unsupported_pow,\n        tshape_unicode: operation_result_unsupported_pow,\n        tshape_tuple: operation_result_unsupported_pow,\n        tshape_list: operation_result_unsupported_pow,\n        tshape_set: operation_result_unsupported_pow,\n        tshape_frozenset: operation_result_unsupported_pow,\n        tshape_dict: operation_result_unsupported_pow,\n        tshape_type: operation_result_unsupported_pow,\n        tshape_none: operation_result_unsupported_pow,\n    }\n)\n\nadd_shapes_complex.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_complex_noescape,\n        tshape_long: operation_result_complex_noescape,\n        tshape_int_or_long: operation_result_complex_noescape,\n        tshape_bool: operation_result_complex_noescape,\n        tshape_float: operation_result_complex_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\n\nsub_shapes_complex.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_complex_noescape,\n        tshape_long: operation_result_complex_noescape,\n        tshape_int_or_long: operation_result_complex_noescape,\n        tshape_bool: operation_result_complex_noescape,\n        tshape_float: operation_result_complex_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_sub,\n        tshape_bytes: operation_result_unsupported_sub,\n        tshape_bytearray: operation_result_unsupported_sub,\n        tshape_unicode: operation_result_unsupported_sub,\n        tshape_tuple: operation_result_unsupported_sub,\n        tshape_list: operation_result_unsupported_sub,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_sub,\n        tshape_frozenset: operation_result_unsupported_sub,\n        tshape_dict: operation_result_unsupported_sub,\n        tshape_type: operation_result_unsupported_sub,\n        tshape_none: operation_result_unsupported_sub,\n    }\n)\n\nmult_shapes_complex.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int might turn into long when growing due to possible overflow.\n        tshape_int: operation_result_complex_noescape,\n        tshape_long: operation_result_complex_noescape,\n        tshape_int_or_long: operation_result_complex_noescape,\n        tshape_bool: operation_result_complex_noescape,\n        tshape_float: operation_result_complex_noescape,\n        tshape_complex: operation_result_complex_noescape,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\ntruediv_shapes_complex.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # floats do math ops\n        tshape_int: operation_result_zerodiv_complex,\n        tshape_long: operation_result_zerodiv_complex,\n        tshape_int_or_long: operation_result_zerodiv_complex,\n        tshape_bool: operation_result_zerodiv_complex,\n        tshape_float: operation_result_zerodiv_complex,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_truediv,\n        tshape_bytes: operation_result_unsupported_truediv,\n        tshape_bytearray: operation_result_unsupported_truediv,\n        tshape_unicode: operation_result_unsupported_truediv,\n        tshape_tuple: operation_result_unsupported_truediv,\n        tshape_list: operation_result_unsupported_truediv,\n        tshape_set: operation_result_unsupported_truediv,\n        tshape_frozenset: operation_result_unsupported_truediv,\n        tshape_dict: operation_result_unsupported_truediv,\n        tshape_type: operation_result_unsupported_truediv,\n        tshape_none: operation_result_unsupported_truediv,\n    }\n)\n\nif python_version < 0x300:\n    floordiv_shapes_complex.update(\n        {\n            # Standard\n            tshape_unknown: operation_result_unknown,\n            tshape_long_derived: operation_result_unknown,\n            tshape_int_or_long_derived: operation_result_unknown,\n            tshape_float_derived: operation_result_unknown,\n            tshape_str_derived: operation_result_unknown,\n            tshape_unicode_derived: operation_result_unknown,\n            tshape_bytes_derived: operation_result_unknown,\n            # floats do math ops\n            tshape_int: operation_result_zerodiv_complex,\n            tshape_long: operation_result_zerodiv_complex,\n            tshape_int_or_long: operation_result_zerodiv_complex,\n            tshape_bool: operation_result_zerodiv_complex,\n            tshape_float: operation_result_zerodiv_complex,\n            tshape_complex: operation_result_zerodiv_complex,\n            # Unsupported:\n            tshape_str: operation_result_unsupported_floordiv,\n            tshape_bytes: operation_result_unsupported_floordiv,\n            tshape_bytearray: operation_result_unsupported_floordiv,\n            tshape_unicode: operation_result_unsupported_floordiv,\n            tshape_tuple: operation_result_unsupported_floordiv,\n            tshape_list: operation_result_unsupported_floordiv,\n            tshape_set: operation_result_unsupported_floordiv,\n            tshape_frozenset: operation_result_unsupported_floordiv,\n            tshape_dict: operation_result_unsupported_floordiv,\n            tshape_type: operation_result_unsupported_floordiv,\n            tshape_none: operation_result_unsupported_floordiv,\n        }\n    )\n\nolddiv_shapes_complex.update(\n    cloneWithUnsupportedChange(\n        truediv_shapes_complex, operation_result_unsupported_olddiv\n    )\n)\n\nmod_shapes_complex.update(\n    cloneWithUnsupportedChange(truediv_shapes_complex, operation_result_unsupported_mod)\n)\n\npow_shapes_complex.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        tshape_int: operation_result_zerodiv_complex,\n        tshape_long: operation_result_zerodiv_complex,\n        tshape_int_or_long: operation_result_zerodiv_complex,\n        tshape_bool: operation_result_complex_noescape,\n        tshape_float: operation_result_zerodiv_complex,\n        tshape_complex: operation_result_zerodiv_complex,\n        # Unsupported:\n        tshape_str: operation_result_unsupported_pow,\n        tshape_bytes: operation_result_unsupported_pow,\n        tshape_bytearray: operation_result_unsupported_pow,\n        tshape_unicode: operation_result_unsupported_pow,\n        tshape_tuple: operation_result_unsupported_pow,\n        tshape_list: operation_result_unsupported_pow,\n        tshape_set: operation_result_unsupported_pow,\n        tshape_frozenset: operation_result_unsupported_pow,\n        tshape_dict: operation_result_unsupported_pow,\n        tshape_type: operation_result_unsupported_pow,\n        tshape_none: operation_result_unsupported_pow,\n    }\n)\n\nadd_shapes_tuple.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        tshape_complex: operation_result_unsupported_add,\n        # Sequence mixing is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_tuple_noescape,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nmult_shapes_tuple.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_tuple_noescape,\n        tshape_long: operation_result_tuple_noescape,\n        tshape_int_or_long: operation_result_tuple_noescape,\n        tshape_bool: operation_result_tuple_noescape,\n        tshape_float: operation_result_unsupported_mul,\n        tshape_complex: operation_result_unsupported_mul,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nadd_shapes_list.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        tshape_complex: operation_result_unsupported_add,\n        # Sequence concat mixing is not allowed except for list\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_list_noescape,\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\niadd_shapes_list.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        tshape_complex: operation_result_unsupported_add,\n        # Sequence concat mixing is not allowed\n        tshape_str: operation_result_list_noescape,\n        tshape_bytes: operation_result_list_noescape,\n        tshape_bytearray: operation_result_list_noescape,\n        tshape_unicode: operation_result_list_noescape,\n        tshape_tuple: operation_result_list_noescape,\n        tshape_list: operation_result_list_noescape,\n        tshape_set: operation_result_list_noescape,\n        tshape_frozenset: operation_result_list_noescape,\n        tshape_dict: operation_result_list_noescape,\n        # Unsupported:\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\n\n# These multiply with nothing really.\nnothing_multiplicants = (\n    tshape_none,\n    tshape_set,\n    tshape_dict,\n    tshape_type,\n    tshape_list_iterator,\n    tshape_dict_iterator,\n    tshape_set_iterator,\n    tshape_tuple_iterator,\n)\n\n\ndef updateNonMultiplicants(op_shapes):\n    for shape in nothing_multiplicants:\n        op_shapes[shape] = operation_result_unsupported_mul\n\n\nsequence_non_multiplicants = (\n    tshape_float,\n    tshape_str,\n    tshape_bytes,\n    tshape_bytearray,\n    tshape_unicode,\n    tshape_tuple,\n    tshape_list,\n    tshape_set,\n    tshape_frozenset,\n    tshape_dict,\n)\n\n\ndef updateSequenceNonMultiplicants(op_shapes):\n    updateNonMultiplicants(op_shapes)\n\n    for shape in sequence_non_multiplicants:\n        op_shapes[shape] = operation_result_unsupported_mul\n\n\nmult_shapes_list.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_list_noescape,\n        tshape_long: operation_result_list_noescape,\n        tshape_int_or_long: operation_result_list_noescape,\n        tshape_bool: operation_result_list_noescape,\n    }\n)\n\n# Sequence repeat is not allowed with most types.\nupdateSequenceNonMultiplicants(mult_shapes_list)\n\nadd_shapes_set.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Sets to do not multiply\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_set.update(sub_shapes_none)\nsub_shapes_set[tshape_set] = operation_result_set_noescape\nsub_shapes_set[tshape_frozenset] = operation_result_set_noescape\n\nbitor_shapes_set.update(bitor_shapes_none)\nbitor_shapes_set[tshape_set] = operation_result_set_noescape\nbitor_shapes_set[tshape_frozenset] = operation_result_set_noescape\nbitand_shapes_set.update(\n    cloneWithUnsupportedChange(bitor_shapes_set, operation_result_unsupported_bitand)\n)\nbitxor_shapes_set.update(\n    cloneWithUnsupportedChange(bitor_shapes_set, operation_result_unsupported_bitxor)\n)\n\nadd_shapes_frozenset.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Sets to do not multiply\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nsub_shapes_frozenset.update(sub_shapes_set)\nsub_shapes_frozenset[tshape_set] = operation_result_frozenset_noescape\nsub_shapes_frozenset[tshape_frozenset] = operation_result_frozenset_noescape\n\nbitor_shapes_frozenset.update(bitor_shapes_none)\nbitor_shapes_frozenset[tshape_set] = operation_result_frozenset_noescape\nbitor_shapes_frozenset[tshape_frozenset] = operation_result_frozenset_noescape\nbitand_shapes_frozenset.update(\n    cloneWithUnsupportedChange(\n        bitor_shapes_frozenset, operation_result_unsupported_bitand\n    )\n)\nbitxor_shapes_frozenset.update(\n    cloneWithUnsupportedChange(\n        bitor_shapes_frozenset, operation_result_unsupported_bitxor\n    )\n)\n\nadd_shapes_dict.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Sets to do not multiply\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nadd_shapes_str.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_str_noescape,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: (\n            operation_result_bytearray_noescape\n            if python_version < 0x300\n            else operation_result_unsupported_add\n        ),\n        tshape_unicode: operation_result_unicode_noescape,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nmult_shapes_str.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_str_noescape,\n        tshape_long: operation_result_str_noescape,\n        tshape_int_or_long: operation_result_str_noescape,\n        tshape_bool: operation_result_str_noescape,\n        tshape_float: operation_result_unsupported_mul,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nmod_shapes_str.update(\n    {\n        # Standard, TODO: should be string, but may escape with exception.\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # str formatting with all kinds of values\n        tshape_int: operation_result_str_formaterror,\n        tshape_long: operation_result_str_formaterror,\n        tshape_int_or_long: operation_result_str_formaterror,\n        tshape_bool: operation_result_str_formaterror,\n        tshape_float: operation_result_str_formaterror,\n        tshape_str: operation_result_str_formaterror,\n        tshape_bytes: operation_result_str_formaterror,\n        tshape_bytearray: operation_result_str_formaterror,\n        tshape_unicode: operation_result_str_formaterror,\n        tshape_tuple: operation_result_str_formaterror,\n        tshape_list: operation_result_str_formaterror,\n        tshape_set: operation_result_str_formaterror,\n        tshape_frozenset: operation_result_str_formaterror,\n        tshape_dict: operation_result_str_formaterror,\n        tshape_type: operation_result_str_formaterror,\n        tshape_none: operation_result_str_formaterror,\n    }\n)\n\nadd_shapes_bytes.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_add,\n        tshape_bytes: operation_result_bytes_noescape,\n        tshape_bytearray: operation_result_bytearray_noescape,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nmult_shapes_bytes.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_bytes_noescape,\n        tshape_long: operation_result_bytes_noescape,\n        tshape_int_or_long: operation_result_bytes_noescape,\n        tshape_bool: operation_result_bytes_noescape,\n        tshape_float: operation_result_unsupported_mul,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nif python_version < 0x350:\n    operation_result_350_bytes_mod_noescape = operation_result_unsupported_mod\nelse:\n    operation_result_350_bytes_mod_noescape = operation_result_bytes_formaterror\n\nmod_shapes_bytes.update(\n    {\n        # Standard, TODO: should be string, but may escape with exception.\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # bytes formatting with all kinds of values\n        tshape_int: operation_result_350_bytes_mod_noescape,\n        tshape_bool: operation_result_350_bytes_mod_noescape,\n        tshape_float: operation_result_350_bytes_mod_noescape,\n        tshape_bytes: operation_result_350_bytes_mod_noescape,\n        tshape_bytearray: operation_result_350_bytes_mod_noescape,\n        tshape_unicode: operation_result_350_bytes_mod_noescape,\n        tshape_tuple: operation_result_350_bytes_mod_noescape,\n        tshape_list: operation_result_350_bytes_mod_noescape,\n        tshape_set: operation_result_350_bytes_mod_noescape,\n        tshape_frozenset: operation_result_350_bytes_mod_noescape,\n        tshape_dict: operation_result_350_bytes_mod_noescape,\n        tshape_type: operation_result_350_bytes_mod_noescape,\n        tshape_none: operation_result_350_bytes_mod_noescape,\n    }\n)\n\nadd_shapes_bytearray.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: (\n            operation_result_bytearray_noescape\n            if python_version < 0x300\n            else operation_result_unsupported_add\n        ),\n        tshape_bytes: operation_result_bytearray_noescape,\n        tshape_bytearray: operation_result_bytearray_noescape,\n        tshape_unicode: operation_result_unsupported_add,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nmult_shapes_bytearray.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_bytearray_noescape,\n        tshape_long: operation_result_bytearray_noescape,\n        tshape_int_or_long: operation_result_bytearray_noescape,\n        tshape_bool: operation_result_bytearray_noescape,\n        tshape_float: operation_result_unsupported_mul,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nif python_version < 0x350:\n    operation_result_350_bytearray_mod_noescape = operation_result_unsupported_mod\nelse:\n    operation_result_350_bytearray_mod_noescape = operation_result_bytearray_formaterror\n\nmod_shapes_bytearray.update(\n    {\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # bytes formatting with all kinds of values\n        tshape_int: operation_result_350_bytearray_mod_noescape,\n        tshape_bool: operation_result_350_bytearray_mod_noescape,\n        tshape_float: operation_result_350_bytearray_mod_noescape,\n        tshape_bytes: operation_result_350_bytearray_mod_noescape,\n        tshape_bytearray: operation_result_350_bytearray_mod_noescape,\n        tshape_unicode: operation_result_350_bytearray_mod_noescape,\n        tshape_tuple: operation_result_350_bytearray_mod_noescape,\n        tshape_list: operation_result_350_bytearray_mod_noescape,\n        tshape_set: operation_result_350_bytearray_mod_noescape,\n        tshape_frozenset: operation_result_350_bytes_mod_noescape,\n        tshape_dict: operation_result_350_bytearray_mod_noescape,\n        tshape_type: operation_result_350_bytearray_mod_noescape,\n        tshape_none: operation_result_350_bytearray_mod_noescape,\n    }\n)\n\n\nadd_shapes_unicode.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unsupported_add,\n        tshape_long: operation_result_unsupported_add,\n        tshape_int_or_long: operation_result_unsupported_add,\n        tshape_bool: operation_result_unsupported_add,\n        tshape_float: operation_result_unsupported_add,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unicode_noescape,\n        tshape_bytes: operation_result_unsupported_add,\n        tshape_bytearray: operation_result_unsupported_add,\n        tshape_unicode: operation_result_unicode_noescape,\n        tshape_tuple: operation_result_unsupported_add,\n        tshape_list: operation_result_unsupported_add,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_add,\n        tshape_frozenset: operation_result_unsupported_add,\n        tshape_dict: operation_result_unsupported_add,\n        tshape_type: operation_result_unsupported_add,\n        tshape_none: operation_result_unsupported_add,\n    }\n)\n\nmult_shapes_unicode.update(\n    {\n        # Standard\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # Int is sequence repeat\n        tshape_int: operation_result_unicode_noescape,\n        tshape_long: operation_result_unicode_noescape,\n        tshape_int_or_long: operation_result_unicode_noescape,\n        tshape_bool: operation_result_unicode_noescape,\n        tshape_float: operation_result_unsupported_mul,\n        # Sequence repeat is not allowed\n        tshape_str: operation_result_unsupported_mul,\n        tshape_bytes: operation_result_unsupported_mul,\n        tshape_bytearray: operation_result_unsupported_mul,\n        tshape_unicode: operation_result_unsupported_mul,\n        tshape_tuple: operation_result_unsupported_mul,\n        tshape_list: operation_result_unsupported_mul,\n        # Unsupported:\n        tshape_set: operation_result_unsupported_mul,\n        tshape_frozenset: operation_result_unsupported_mul,\n        tshape_dict: operation_result_unsupported_mul,\n        tshape_type: operation_result_unsupported_mul,\n        tshape_none: operation_result_unsupported_mul,\n    }\n)\n\nmod_shapes_unicode.update(\n    {\n        # Standard, TODO: should be unicode, but may escape with exception.\n        tshape_unknown: operation_result_unknown,\n        tshape_long_derived: operation_result_unknown,\n        tshape_int_or_long_derived: operation_result_unknown,\n        tshape_float_derived: operation_result_unknown,\n        tshape_str_derived: operation_result_unknown,\n        tshape_unicode_derived: operation_result_unknown,\n        tshape_bytes_derived: operation_result_unknown,\n        # str formatting with all kinds of values\n        tshape_int: operation_result_unicode_formaterror,\n        tshape_long: operation_result_unicode_formaterror,\n        tshape_int_or_long: operation_result_unicode_formaterror,\n        tshape_bool: operation_result_unicode_formaterror,\n        tshape_float: operation_result_unicode_formaterror,\n        tshape_str: operation_result_unicode_formaterror,\n        tshape_bytes: operation_result_unicode_formaterror,\n        tshape_bytearray: operation_result_unicode_formaterror,\n        tshape_unicode: operation_result_unicode_formaterror,\n        tshape_tuple: operation_result_unicode_formaterror,\n        tshape_list: operation_result_unicode_formaterror,\n        tshape_set: operation_result_unicode_formaterror,\n        tshape_frozenset: operation_result_unicode_formaterror,\n        tshape_dict: operation_result_unicode_formaterror,\n        tshape_type: operation_result_unicode_formaterror,\n        tshape_none: operation_result_unicode_formaterror,\n    }\n)\n\n\ndef mergeStrOrUnicode(op_shapes_str, op_shapes_unicode):\n    r = {}\n\n    for key, value in op_shapes_str.items():\n        value2 = op_shapes_unicode[key]\n\n        if value is value2:\n            r[key] = value\n        elif value[0] is tshape_str_or_unicode and value2[0] is tshape_unicode:\n            assert value[1] is value2[1]\n\n            r[key] = value\n        elif value[0] is tshape_str and value2[0] is tshape_unicode:\n            # Actually as intended, pylint: disable=bad-chained-comparison\n            assert (\n                value[1]\n                is value2[1]\n                in (\n                    operation_result_strorunicode_noescape[1],\n                    ControlFlowDescriptionFormatError,\n                )\n            ), (value, value2)\n\n            r[key] = operation_result_strorunicode_noescape\n        elif key == tshape_bytearray:\n            # They differ here on Python2\n            r[key] = operation_result_unknown\n        else:\n            assert False, (key, \"->\", value, \"!=\", value2)\n\n    return r\n\n\nadd_shapes_strorunicode.update(mergeStrOrUnicode(add_shapes_str, add_shapes_unicode))\nsub_shapes_strorunicode.update(mergeStrOrUnicode(sub_shapes_str, sub_shapes_unicode))\nmult_shapes_strorunicode.update(mergeStrOrUnicode(mult_shapes_str, mult_shapes_unicode))\nfloordiv_shapes_strorunicode.update(\n    mergeStrOrUnicode(floordiv_shapes_str, floordiv_shapes_unicode)\n)\ntruediv_shapes_strorunicode.update(\n    mergeStrOrUnicode(truediv_shapes_str, truediv_shapes_unicode)\n)\nolddiv_shapes_strorunicode.update(\n    mergeStrOrUnicode(olddiv_shapes_str, olddiv_shapes_unicode)\n)\nmod_shapes_strorunicode.update(mergeStrOrUnicode(mod_shapes_str, mod_shapes_unicode))\ndivmod_shapes_strorunicode.update(\n    mergeStrOrUnicode(divmod_shapes_str, divmod_shapes_unicode)\n)\npow_shapes_strorunicode.update(mergeStrOrUnicode(pow_shapes_str, pow_shapes_unicode))\nlshift_shapes_strorunicode.update(\n    mergeStrOrUnicode(lshift_shapes_str, lshift_shapes_unicode)\n)\nrshift_shapes_strorunicode.update(\n    mergeStrOrUnicode(rshift_shapes_str, rshift_shapes_unicode)\n)\nbitor_shapes_strorunicode.update(\n    mergeStrOrUnicode(bitor_shapes_str, bitor_shapes_unicode)\n)\nbitand_shapes_strorunicode.update(\n    mergeStrOrUnicode(bitand_shapes_str, bitand_shapes_unicode)\n)\nbitxor_shapes_strorunicode.update(\n    mergeStrOrUnicode(bitxor_shapes_str, bitxor_shapes_unicode)\n)\n\nif python_version >= 0x390:\n    bitor_shapes_dict[tshape_dict] = operation_result_dict_noescape\n\n    ibitor_shapes_dict[tshape_dict] = operation_result_dict_noescape\n    ibitor_shapes_dict[tshape_tuple] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_list] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_set] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_frozenset] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_str] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_bytes] = operation_result_dict_valueerror\n    ibitor_shapes_dict[tshape_bytearray] = operation_result_dict_valueerror\n\n\nclass ShapeTypeBuiltinExceptionClass(\n    ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase\n):\n    __slots__ = ()\n\n    # TODO: Add a typical value, that should be easy.\n    typical_value = None\n\n\ntshape_exception_class = ShapeTypeBuiltinExceptionClass()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/shapes/ControlFlowDescriptions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Objects use to describe control flow escapes.\n\nTypically returned by shape operations to indicate what can and can not\nhave happened.\n\n\"\"\"\n\n\nclass ControlFlowDescriptionBase(object):\n    @staticmethod\n    def isUnsupported():\n        return False\n\n\nclass ControlFlowDescriptionElementBasedEscape(ControlFlowDescriptionBase):\n    @staticmethod\n    def getExceptionExit():\n        return BaseException\n\n    @staticmethod\n    def isValueEscaping():\n        return True\n\n    @staticmethod\n    def isControlFlowEscape():\n        return True\n\n\nclass ControlFlowDescriptionFullEscape(ControlFlowDescriptionBase):\n    @staticmethod\n    def getExceptionExit():\n        return BaseException\n\n    @staticmethod\n    def isValueEscaping():\n        return True\n\n    @staticmethod\n    def isControlFlowEscape():\n        return True\n\n\nclass ControlFlowDescriptionNoEscape(ControlFlowDescriptionBase):\n    @staticmethod\n    def getExceptionExit():\n        return None\n\n    @staticmethod\n    def isValueEscaping():\n        return False\n\n    @staticmethod\n    def isControlFlowEscape():\n        return False\n\n\nclass ControlFlowDescriptionZeroDivisionNoEscape(ControlFlowDescriptionNoEscape):\n    @staticmethod\n    def getExceptionExit():\n        return ZeroDivisionError\n\n\nclass ControlFlowDescriptionValueErrorNoEscape(ControlFlowDescriptionNoEscape):\n    @staticmethod\n    def getExceptionExit():\n        return ValueError\n\n\nclass ControlFlowDescriptionComparisonUnorderable(ControlFlowDescriptionNoEscape):\n    @staticmethod\n    def getExceptionExit():\n        return TypeError\n\n    @staticmethod\n    def isUnsupported():\n        return True\n\n\nclass ControlFlowDescriptionFormatError(ControlFlowDescriptionFullEscape):\n    pass\n\n\nclass ControlFlowDescriptionOperationUnsupportedBase(ControlFlowDescriptionNoEscape):\n    @staticmethod\n    def getExceptionExit():\n        return TypeError\n\n    @staticmethod\n    def isUnsupported():\n        return True\n\n\nclass ControlFlowDescriptionAddUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionSubUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionMulUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionFloorDivUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionTrueDivUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionOldDivUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionModUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionDivmodUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionPowUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionBitorUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionBitandUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionBitxorUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionLshiftUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionRshiftUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\nclass ControlFlowDescriptionMatmultUnsupported(\n    ControlFlowDescriptionOperationUnsupportedBase\n):\n    pass\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/shapes/ShapeMixins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Mixins to use for composing type shapes.\n\n\"\"\"\n\nfrom .ControlFlowDescriptions import (\n    ControlFlowDescriptionElementBasedEscape,\n    ControlFlowDescriptionNoEscape,\n)\n\n\nclass ShapeContainerMixin(object):\n    \"\"\"Mixin that defines the common container shape functions.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return True\n\n    @staticmethod\n    def hasShapeSlotLen():\n        return True\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return True\n\n    @staticmethod\n    def hasShapeSlotIter():\n        return True\n\n    @staticmethod\n    def hasShapeSlotNext():\n        return False\n\n    @staticmethod\n    def hasShapeModule():\n        return False\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionElementBasedEscape\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return True\n\n\nclass ShapeContainerMutableMixin(ShapeContainerMixin):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return False\n\n\nclass ShapeContainerImmutableMixin(ShapeContainerMixin):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n\nclass ShapeNotContainerMixin(object):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return True\n\n    @staticmethod\n    def hasShapeSlotLen():\n        return False\n\n    @staticmethod\n    def hasShapeSlotIter():\n        return False\n\n    @staticmethod\n    def hasShapeSlotNext():\n        return False\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return False\n\n    @staticmethod\n    def hasShapeModule():\n        return False\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionNoEscape\n\n\nclass ShapeNotNumberMixin(object):\n    \"\"\"Mixin that defines the number slots to be set.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return True\n\n    @staticmethod\n    def hasShapeSlotAbs():\n        return False\n\n    @staticmethod\n    def hasShapeSlotInt():\n        return False\n\n    @staticmethod\n    def hasShapeSlotLong():\n        return False\n\n    @staticmethod\n    def hasShapeSlotFloat():\n        return False\n\n    @staticmethod\n    def hasShapeSlotComplex():\n        return False\n\n    @staticmethod\n    def hasShapeModule():\n        return False\n\n\nclass ShapeNumberMixin(object):\n    \"\"\"Mixin that defines the number slots to be set.\"\"\"\n\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return True\n\n    @staticmethod\n    def hasShapeSlotAbs():\n        return True\n\n    @staticmethod\n    def hasShapeSlotInt():\n        return True\n\n    @staticmethod\n    def hasShapeSlotLong():\n        return True\n\n    @staticmethod\n    def hasShapeSlotFloat():\n        return True\n\n    @staticmethod\n    def hasShapeSlotComplex():\n        return True\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n    @staticmethod\n    def hasShapeModule():\n        return False\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return True\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionNoEscape\n\n\nclass ShapeIteratorMixin(ShapeNotContainerMixin):\n    # Mixins are required to define empty slots\n    __slots__ = ()\n\n    @staticmethod\n    def isShapeIterator():\n        return True\n\n    @staticmethod\n    def getIteratedShape():\n        return None\n\n    @staticmethod\n    def hasShapeSlotIter():\n        return True\n\n    @staticmethod\n    def hasShapeSlotNext():\n        return True\n\n    @staticmethod\n    def hasShapeSlotNextCode():\n        \"\"\"Does next execute code, i.e. control flow escaped.\n\n        For most known iterators that is not the case, only the generic\n        tshape_iterator needs to say \"do not know\", aka None.\n        \"\"\"\n        return False\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return True\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/shapes/StandardShapes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard shapes that commonly appear. \"\"\"\n\nfrom abc import abstractmethod\n\nfrom nuitka.code_generation.c_types.CTypePyObjectPointers import (\n    CTypePyObjectPtr,\n)\nfrom nuitka.code_generation.Reports import onMissingOperation\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\n\nfrom .ControlFlowDescriptions import ControlFlowDescriptionFullEscape\nfrom .ShapeMixins import ShapeIteratorMixin\n\n\nclass ShapeBase(getMetaClassBase(\"Shape\", require_slots=True)):\n    __slots__ = ()\n\n    def __repr__(self):\n        return \"<%s %s %s>\" % (\n            self.__class__.__name__,\n            self.getTypeName(),\n            self.helper_code,\n        )\n\n    @staticmethod\n    def getTypeName():\n        return None\n\n    helper_code = \"OBJECT\"\n\n    @staticmethod\n    def getCType():\n        return CTypePyObjectPtr\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_unknown\n\n    @staticmethod\n    def hasShapeIndexLookup():\n        return None\n\n    @staticmethod\n    def hasShapeModule():\n        return None\n\n    @staticmethod\n    def hasShapeSlotBytes():\n        return None\n\n    @staticmethod\n    def hasShapeSlotComplex():\n        return None\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return None\n\n    @staticmethod\n    def hasShapeSlotAbs():\n        return None\n\n    @staticmethod\n    def hasShapeSlotLen():\n        return None\n\n    @staticmethod\n    def hasShapeSlotInt():\n        return None\n\n    @staticmethod\n    def hasShapeSlotLong():\n        return None\n\n    @staticmethod\n    def hasShapeSlotFloat():\n        return None\n\n    @staticmethod\n    def hasShapeSlotIter():\n        return None\n\n    @staticmethod\n    def hasShapeSlotNext():\n        return None\n\n    @staticmethod\n    def hasShapeSlotNextCode():\n        return None\n\n    @staticmethod\n    def hasShapeSlotContains():\n        return None\n\n    @staticmethod\n    def hasShapeSlotHash():\n        return None\n\n    @staticmethod\n    def hasShapeTrustedAttributes():\n        return None\n\n    @staticmethod\n    def isShapeIterator():\n        return None\n\n    add_shapes = {}\n\n    def getOperationBinaryAddShape(self, right_shape):\n        result = self.add_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryAddLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Add\", self, right_shape)\n\n            return operation_result_unknown\n\n    # TODO: Change defaults to be \"None\" for easier catching of\n    # non-overloaders\n    iadd_shapes = {}\n\n    def getOperationInplaceAddShape(self, right_shape):\n        \"\"\"Inplace add operation shape, for overload.\"\"\"\n        if self.iadd_shapes:\n            result = self.iadd_shapes.get(right_shape)\n\n            if result is not None:\n                return result\n            else:\n                right_shape_type = type(right_shape)\n                if right_shape_type is ShapeLoopCompleteAlternative:\n                    return right_shape.getOperationBinaryAddLShape(self)\n\n                if right_shape_type is ShapeLoopInitialAlternative:\n                    return operation_result_unknown\n\n                onMissingOperation(\"IAdd\", self, right_shape)\n\n                return operation_result_unknown\n        else:\n            # By default, inplace add is the same as plain add, the\n            # only exception known right now is list, which extend\n            # from all iterables, but don't add with them.\n            return self.getOperationBinaryAddShape(right_shape)\n\n    sub_shapes = {}\n\n    def getOperationBinarySubShape(self, right_shape):\n        result = self.sub_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinarySubLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Sub\", self, right_shape)\n\n            return operation_result_unknown\n\n    mult_shapes = {}\n\n    def getOperationBinaryMultShape(self, right_shape):\n        result = self.mult_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryMultLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Mult\", self, right_shape)\n\n            return operation_result_unknown\n\n    floordiv_shapes = {}\n\n    def getOperationBinaryFloorDivShape(self, right_shape):\n        result = self.floordiv_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryFloorDivLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"FloorDiv\", self, right_shape)\n\n            return operation_result_unknown\n\n    olddiv_shapes = {}\n\n    def getOperationBinaryOldDivShape(self, right_shape):\n        result = self.olddiv_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryOldDivLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"OldDiv\", self, right_shape)\n\n            return operation_result_unknown\n\n    truediv_shapes = {}\n\n    def getOperationBinaryTrueDivShape(self, right_shape):\n        result = self.truediv_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryTrueDivLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"TrueDiv\", self, right_shape)\n\n            return operation_result_unknown\n\n    mod_shapes = {}\n\n    def getOperationBinaryModShape(self, right_shape):\n        result = self.mod_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryModLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Mod\", self, right_shape)\n\n            return operation_result_unknown\n\n    divmod_shapes = {}\n\n    def getOperationBinaryDivmodShape(self, right_shape):\n        result = self.divmod_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryDivmodLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Divmod\", self, right_shape)\n\n            return operation_result_unknown\n\n    pow_shapes = {}\n\n    def getOperationBinaryPowShape(self, right_shape):\n        result = self.pow_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryPowLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"Pow\", self, right_shape)\n\n            return operation_result_unknown\n\n    lshift_shapes = {}\n\n    def getOperationBinaryLShiftShape(self, right_shape):\n        result = self.lshift_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryLShiftLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"LShift\", self, right_shape)\n\n            return operation_result_unknown\n\n    rshift_shapes = {}\n\n    def getOperationBinaryRShiftShape(self, right_shape):\n        result = self.rshift_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryRShiftLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"RShift\", self, right_shape)\n\n            return operation_result_unknown\n\n    bitor_shapes = {}\n\n    def getOperationBinaryBitOrShape(self, right_shape):\n        result = self.bitor_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryBitOrLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"BitOr\", self, right_shape)\n\n            return operation_result_unknown\n\n    bitand_shapes = {}\n\n    def getOperationBinaryBitAndShape(self, right_shape):\n        result = self.bitand_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryBitAndLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"BitAnd\", self, right_shape)\n\n            return operation_result_unknown\n\n    bitxor_shapes = {}\n\n    def getOperationBinaryBitXorShape(self, right_shape):\n        result = self.bitxor_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryBitXorLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"BitXor\", self, right_shape)\n\n            return operation_result_unknown\n\n    ibitor_shapes = {}\n\n    def getOperationInplaceBitOrShape(self, right_shape):\n        \"\"\"Inplace bitor operation shape, for overload.\"\"\"\n        if self.ibitor_shapes:\n            result = self.ibitor_shapes.get(right_shape)\n\n            if result is not None:\n                return result\n            else:\n                right_shape_type = type(right_shape)\n                if right_shape_type is ShapeLoopCompleteAlternative:\n                    return right_shape.getOperationBinaryBitOrLShape(self)\n\n                if right_shape_type is ShapeLoopInitialAlternative:\n                    return operation_result_unknown\n\n                onMissingOperation(\"IBitOr\", self, right_shape)\n\n                return operation_result_unknown\n        else:\n            # By default, inplace add is the same as plain add, the\n            # only exception known right now is list, which extend\n            # from all iterables, but don't add with them.\n            return self.getOperationBinaryBitOrShape(right_shape)\n\n    matmult_shapes = {}\n\n    def getOperationBinaryMatMultShape(self, right_shape):\n        result = self.matmult_shapes.get(right_shape)\n\n        if result is not None:\n            return result\n        else:\n            right_shape_type = type(right_shape)\n            if right_shape_type is ShapeLoopCompleteAlternative:\n                return right_shape.getOperationBinaryBitMatMultLShape(self)\n\n            if right_shape_type is ShapeLoopInitialAlternative:\n                return operation_result_unknown\n\n            onMissingOperation(\"MatMult\", self, right_shape)\n\n            return operation_result_unknown\n\n    def getComparisonLtShape(self, right_shape):\n        onMissingOperation(\"Lt\", self, right_shape)\n\n        return operation_result_unknown\n\n    def getComparisonLteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGtShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonEqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonNeqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    @abstractmethod\n    def getOperationUnaryReprEscape(self):\n        pass\n\n    @staticmethod\n    def isKnownToHaveAttribute(attribute_name):\n        # Virtual method, pylint: disable=unused-argument\n\n        return None\n\n    def emitAlternatives(self, emit):\n        emit(self)\n\n\nclass ShapeTypeUnknown(ShapeBase):\n    __slots__ = ()\n\n    @staticmethod\n    def getOperationBinaryAddShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinarySubShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryMultShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryFloorDivShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryOldDivShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryTrueDivShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryModShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryDivmodShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryPowShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryLShiftShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryRShiftShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryBitOrShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryBitAndShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryBitXorShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationBinaryMatMultShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getComparisonLtShape(right_shape):\n        return operation_result_unknown\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionFullEscape\n\n\ntshape_unknown = ShapeTypeUnknown()\n\n\nclass ShapeTypeUninitialized(ShapeTypeUnknown):\n    __slots__ = ()\n\n\ntshape_uninitialized = ShapeTypeUninitialized()\n\n\nclass ValueShapeBase(object):\n    __slots__ = ()\n\n    def hasShapeSlotLen(self):\n        return self.getTypeShape().hasShapeSlotLen()\n\n\nclass ValueShapeUnknown(ValueShapeBase):\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unknown\n\n    @staticmethod\n    def isConstant():\n        \"\"\"Can't say if it's constant, we don't know anything.\"\"\"\n        return None\n\n\n# Singleton value for sharing.\nvshape_unknown = ValueShapeUnknown()\n\n\nclass ShapeLargeConstantValue(object):\n    __slots__ = \"shape\", \"size\"\n\n    def __init__(self, size, shape):\n        self.size = size\n        self.shape = shape\n\n    def getTypeShape(self):\n        return self.shape\n\n    @staticmethod\n    def isConstant():\n        return True\n\n    def hasShapeSlotLen(self):\n        return self.shape.hasShapeSlotLen()\n\n\nclass ShapeLargeConstantValuePredictable(ShapeLargeConstantValue):\n    __slots__ = (\"predictor\",)\n\n    def __init__(self, size, predictor, shape):\n        ShapeLargeConstantValue.__init__(self, size, shape)\n\n        self.predictor = predictor\n\n\nclass ShapeIterator(ShapeBase, ShapeIteratorMixin):\n    \"\"\"Iterator created by iter with 2 arguments, TODO: could be way more specific.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def isShapeIterator():\n        return None\n\n    @staticmethod\n    def hasShapeSlotBool():\n        return None\n\n    @staticmethod\n    def hasShapeSlotLen():\n        return None\n\n    @staticmethod\n    def hasShapeSlotInt():\n        return None\n\n    @staticmethod\n    def hasShapeSlotLong():\n        return None\n\n    @staticmethod\n    def hasShapeSlotFloat():\n        return None\n\n    @staticmethod\n    def getShapeIter():\n        return tshape_iterator\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionFullEscape\n\n\ntshape_iterator = ShapeIterator()\n\n\nclass ShapeLoopInitialAlternative(ShapeBase):\n    \"\"\"Merge of loop wrap around with loop start value.\n\n    Happens at the start of loop blocks. This is for loop closed SSA, to\n    make it clear, that the entered value, can be anything really, and\n    will only later be clarified.\n\n    They will start out with just one previous, and later be updated with\n    all of the variable versions at loop continue times.\n    \"\"\"\n\n    __slots__ = (\"type_shapes\",)\n\n    def __init__(self, shapes):\n        self.type_shapes = shapes\n\n    def emitAlternatives(self, emit):\n        for type_shape in self.type_shapes:\n            type_shape.emitAlternatives(emit)\n\n    def _collectInitialShape(self, operation):\n        result = set()\n\n        for type_shape in self.type_shapes:\n            try:\n                entry, _description = operation(type_shape)\n            except TypeError:\n                assert False, type_shape\n\n            if entry is tshape_unknown:\n                return tshape_unknown\n\n            result.add(entry)\n\n        return ShapeLoopInitialAlternative(result)\n\n    def getOperationBinaryAddShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryAddShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationInplaceAddShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationInplaceAddShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinarySubShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinarySubShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryMultShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryMultShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryFloorDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryFloorDivShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryOldDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryOldDivShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryTrueDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryTrueDivShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryModShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryModShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryDivmodShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryDivmodShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryPowShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryPowShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryLShiftShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryLShiftShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryRShiftShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryRShiftShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryBitOrShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryBitOrShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryBitAndShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryBitAndShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryBitXorShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryBitXorShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getOperationBinaryMatMultShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getOperationBinaryMatMultShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n        else:\n            return (\n                self._collectInitialShape(\n                    operation=lambda left_shape: left_shape.getComparisonLtShape(\n                        right_shape\n                    )\n                ),\n                ControlFlowDescriptionFullEscape,\n            )\n\n    def getComparisonLteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGtShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonEqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonNeqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        return ControlFlowDescriptionFullEscape\n\n\nclass ShapeLoopCompleteAlternative(ShapeBase):\n    \"\"\"Merge of loop wrap around with loop start value.\n\n    Happens at the start of loop blocks. This is for loop closed SSA, to\n    make it clear, that the entered value, can be one of multiple types,\n    but only those.\n\n    They will start out with just one previous, and later be updated with\n    all of the variable versions at loop continue times.\n    \"\"\"\n\n    __slots__ = (\"type_shapes\",)\n\n    def __init__(self, shapes):\n        self.type_shapes = shapes\n\n    def __hash__(self):\n        # We are unhashable set, and need deep comparison.\n        return 27\n\n    def __eq__(self, other):\n        if self.__class__ is not other.__class__:\n            return False\n\n        return self.type_shapes == other.type_shapes\n\n    def emitAlternatives(self, emit):\n        for type_shape in self.type_shapes:\n            type_shape.emitAlternatives(emit)\n\n    def _collectShapeOperation(self, operation):\n        result = None\n        escape_description = None\n        single = True\n\n        for type_shape in self.type_shapes:\n            entry, description = operation(type_shape)\n\n            if entry is tshape_unknown:\n                return operation_result_unknown\n\n            if single:\n                if result is None:\n                    # First entry, fine.\n                    result = entry\n                    escape_description = description\n                else:\n                    # Second entry, not the same, convert to set.\n                    if result is not entry:\n                        single = False\n                        result = set((result, entry))\n\n                        escape_description = set((escape_description, description))\n            else:\n                result.add(entry)\n                escape_description.add(description)\n\n        if single:\n            assert result is not None\n            return result, escape_description\n        else:\n            if len(escape_description) > 1:\n                if ControlFlowDescriptionFullEscape in escape_description:\n                    escape_description = ControlFlowDescriptionFullEscape\n                else:\n                    assert False\n            else:\n                (escape_description,) = escape_description\n\n            return ShapeLoopCompleteAlternative(result), escape_description\n\n    def getOperationBinaryAddShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryAddShape(\n                right_shape\n            )\n        )\n\n    def getOperationInplaceAddShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationInplaceAddShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinarySubShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinarySubShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryMultShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryMultShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryFloorDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryFloorDivShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryOldDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryOldDivShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryTrueDivShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryTrueDivShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryModShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryModShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryDivmodShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryDivmodShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryPowShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryPowShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryLShiftShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryLShiftShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryRShiftShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryRShiftShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryBitOrShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryBitOrShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryBitAndShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryBitAndShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryBitXorShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryBitXorShape(\n                right_shape\n            )\n        )\n\n    def getOperationBinaryMatMultShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getOperationBinaryMatMultShape(\n                right_shape\n            )\n        )\n\n    # Special method to be called by other shapes encountering this type on\n    # the right side.\n    def getOperationBinaryAddLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryAddShape\n        )\n\n    # Special method to be called by other shapes encountering this type on\n    # the right side.\n    def getOperationBinarySubLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinarySubShape\n        )\n\n    def getOperationBinaryMultLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryMultShape\n        )\n\n    def getOperationBinaryFloorDivLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryFloorDivShape\n        )\n\n    def getOperationBinaryOldDivLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryOldDivShape\n        )\n\n    def getOperationBinaryTrueDivLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryTrueDivShape\n        )\n\n    def getOperationBinaryModLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryModShape\n        )\n\n    def getOperationBinaryDivmodLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryDivmodShape\n        )\n\n    def getOperationBinaryPowLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryPowShape\n        )\n\n    def getOperationBinaryLShiftLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryLShiftShape\n        )\n\n    def getOperationBinaryRShiftLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryRShiftShape\n        )\n\n    def getOperationBinaryBitOrLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryBitOrShape\n        )\n\n    def getOperationBinaryBitAndLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryBitAndShape\n        )\n\n    def getOperationBinaryBitXorLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryBitXorShape\n        )\n\n    def getOperationBinaryMatMultLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(\n            operation=left_shape.getOperationBinaryMatMultShape\n        )\n\n    def getComparisonLtShape(self, right_shape):\n        if right_shape is tshape_unknown:\n            return operation_result_unknown\n\n        return self._collectShapeOperation(\n            operation=lambda left_shape: left_shape.getComparisonLtShape(right_shape)\n        )\n\n    # Special method to be called by other shapes encountering this type on\n    # the right side.\n    def getComparisonLtLShape(self, left_shape):\n        assert left_shape is not tshape_unknown\n\n        return self._collectShapeOperation(operation=left_shape.getComparisonLtShape)\n\n    def getComparisonLteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGtShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonGteShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonEqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    def getComparisonNeqShape(self, right_shape):\n        return self.getComparisonLtShape(right_shape)\n\n    @staticmethod\n    def getOperationUnaryReprEscape():\n        # TODO: We could collect information.\n        return ControlFlowDescriptionFullEscape\n\n    def _delegatedCheck(self, check):\n        result = None\n\n        for type_shape in self.type_shapes:\n            r = check(type_shape)\n\n            if r is None:\n                return None\n            elif r is True:\n                if result is False:\n                    return None\n                elif result is None:\n                    result = True\n            elif r is False:\n                if result is True:\n                    return None\n                elif result is None:\n                    result = False\n\n        return result\n\n    def hasShapeSlotBool(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotBool())\n\n    def hasShapeSlotLen(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotLen())\n\n    def hasShapeSlotIter(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotIter())\n\n    def hasShapeSlotNext(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotNext())\n\n    def hasShapeSlotContains(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotContains())\n\n    def hasShapeSlotInt(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotInt())\n\n    def hasShapeSlotLong(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotLong())\n\n    def hasShapeSlotFloat(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotFloat())\n\n    def hasShapeSlotComplex(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotComplex())\n\n    def hasShapeSlotBytes(self):\n        return self._delegatedCheck(lambda x: x.hasShapeSlotBytes())\n\n    def hasShapeModule(self):\n        return self._delegatedCheck(lambda x: x.hasShapeModule())\n\n\ntshape_unknown_loop = ShapeLoopCompleteAlternative(shapes=(tshape_unknown,))\n\noperation_result_unknown = tshape_unknown, ControlFlowDescriptionFullEscape\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/nodes/shapes/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/BytecodeDemotion.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Demotion of compiled modules to bytecode modules.\n\n\"\"\"\n\nimport marshal\n\nfrom nuitka.BytecodeCaching import writeImportedModulesNamesToCache\nfrom nuitka.Bytecodes import compileSourceToBytecode\nfrom nuitka.freezer.ImportDetection import detectEarlyImports\nfrom nuitka.importing.ImportCache import (\n    isImportedModuleByName,\n    replaceImportedModule,\n)\nfrom nuitka.ModuleRegistry import replaceRootModule\nfrom nuitka.nodes.ModuleNodes import makeUncompiledPythonModule\nfrom nuitka.Options import isShowProgress, isStandaloneMode\nfrom nuitka.plugins.Plugins import (\n    Plugins,\n    isTriggerModule,\n    replaceTriggerModule,\n)\nfrom nuitka.Tracing import inclusion_logger\n\n\ndef demoteSourceCodeToBytecode(module_name, source_code, filename):\n    if isStandaloneMode():\n        filename = module_name.asPath() + \".py\"\n\n    bytecode = compileSourceToBytecode(source_code, filename)\n\n    bytecode = Plugins.onFrozenModuleBytecode(\n        module_name=module_name, is_package=False, bytecode=bytecode\n    )\n\n    return marshal.dumps(bytecode)\n\n\ndef demoteCompiledModuleToBytecode(module):\n    \"\"\"Demote a compiled module to uncompiled (bytecode).\"\"\"\n\n    full_name = module.getFullName()\n    filename = module.getCompileTimeFilename()\n\n    if isShowProgress():\n        inclusion_logger.info(\n            \"Demoting module '%s' to bytecode from '%s'.\"\n            % (full_name.asString(), filename)\n        )\n\n    source_code = module.getSourceCode()\n\n    bytecode = demoteSourceCodeToBytecode(\n        module_name=full_name, source_code=source_code, filename=filename\n    )\n\n    uncompiled_module = makeUncompiledPythonModule(\n        module_name=full_name,\n        reason=module.reason,\n        filename=filename,\n        bytecode=bytecode,\n        is_package=module.isCompiledPythonPackage(),\n        technical=full_name in detectEarlyImports(),\n    )\n\n    used_modules = module.getUsedModules()\n    uncompiled_module.setUsedModules(used_modules)\n\n    distribution_names = module.getUsedDistributions()\n    uncompiled_module.setUsedDistributions(distribution_names)\n\n    module.finalize()\n\n    if isImportedModuleByName(full_name):\n        replaceImportedModule(old=module, new=uncompiled_module)\n    replaceRootModule(old=module, new=uncompiled_module)\n\n    if isTriggerModule(module):\n        replaceTriggerModule(old=module, new=uncompiled_module)\n\n    writeImportedModulesNamesToCache(\n        module_name=full_name,\n        source_code=source_code,\n        used_modules=used_modules,\n        distribution_names=distribution_names,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/FunctionInlining.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" In-lining of functions.\n\nDone by assigning the argument values to variables, and producing an outline\nfrom the in-lined function.\n\"\"\"\n\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables\nfrom nuitka.tree.Operations import VisitorNoopMixin, visitTree\nfrom nuitka.tree.ReformulationTryFinallyStatements import (\n    makeTryFinallyStatement,\n)\nfrom nuitka.tree.TreeHelpers import makeStatementsSequence\n\n\nclass VariableScopeUpdater(VisitorNoopMixin):\n    def __init__(self, locals_scope, variable_translation):\n        self.locals_scope = locals_scope\n        self.variable_translation = variable_translation\n\n    def onEnterNode(self, node):\n        if hasattr(node, \"variable\"):\n            if node.variable in self.variable_translation:\n                node.variable = self.variable_translation[node.variable]\n\n        if hasattr(node, \"locals_scope\"):\n            node.locals_scope = self.locals_scope\n\n\ndef updateLocalsScope(provider, locals_scope, variable_translation):\n    visitor = VariableScopeUpdater(\n        locals_scope=locals_scope, variable_translation=variable_translation\n    )\n\n    visitTree(provider, visitor)\n\n\ndef convertFunctionCallToOutline(provider, function_body, values, call_source_ref):\n    # This has got to have pretty man details\n    function_source_ref = function_body.getSourceReference()\n\n    outline_body = ExpressionOutlineBody(\n        provider=provider, name=\"inline\", source_ref=function_source_ref\n    )\n\n    # Make a clone first, so we do not harm other references.\n    clone = function_body.subnode_body.makeClone()\n\n    locals_scope_clone, variable_translation = function_body.locals_scope.makeClone(\n        clone\n    )\n\n    # TODO: Lets update all at once maybe, it would take less visits.\n    updateLocalsScope(\n        clone,\n        locals_scope=locals_scope_clone,\n        variable_translation=variable_translation,\n    )\n\n    argument_names = function_body.getParameters().getParameterNames()\n    assert len(argument_names) == len(values), (argument_names, values)\n\n    statements = []\n\n    for argument_name, value in zip(argument_names, values):\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=variable_translation[argument_name],\n                source=value,\n                source_ref=call_source_ref,\n            )\n        )\n\n    body = makeStatementsSequence(\n        statements=(statements, clone), allow_none=False, source_ref=function_source_ref\n    )\n\n    auto_releases = function_body.getFunctionVariablesWithAutoReleases()\n\n    # TODO: Not possible to auto release with outline bodies too?\n    if auto_releases:\n        body = makeTryFinallyStatement(\n            provider=outline_body,\n            tried=body,\n            final=makeStatementsReleaseVariables(\n                variables=auto_releases, source_ref=function_source_ref\n            ),\n            source_ref=function_source_ref,\n        )\n\n    outline_body.setChildBody(body)\n\n    return outline_body\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/Graphs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Graph optimization states.\n\nThese are not the graphs you might be thinking of. This is for rending the\nprogress of optimization into images.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.ModuleRegistry import getDoneModules\nfrom nuitka.Tracing import general\n\ngraph = None\ncomputation_counters = {}\n\nprogressive = False\n\n\ndef _addModuleGraph(module, desc):\n    module_graph = module.asGraph(graph, desc)\n\n    return module_graph\n\n\ndef onModuleOptimizationStep(module):\n    # Update the graph if active.\n    if graph is not None:\n        computation_counters[module] = computation_counters.get(module, 0) + 1\n\n        if progressive:\n            _addModuleGraph(module, computation_counters[module])\n\n\ndef startGraph():\n    # We maintain this globally to make it accessible, pylint: disable=global-statement\n    global graph\n\n    if Options.shallCreateGraph():\n        try:\n            from pygraphviz import AGraph  # pylint: disable=I0021,import-error\n\n            graph = AGraph(name=\"Optimization\", directed=True)\n            graph.layout()\n        except ImportError:\n            general.sysexit(\"Cannot import pygraphviz module, no graphing capability.\")\n\n\ndef endGraph(output_filename):\n    if graph is not None:\n        for module in getDoneModules():\n            _addModuleGraph(module, \"final\")\n\n        graph.draw(output_filename + \".dot\", prog=\"dot\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/Optimization.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Control the flow of optimizations applied to node tree.\n\nApplies abstract execution on all so far known modules until no more\noptimization is possible. Every successful optimization to anything might\nmake others possible.\n\"\"\"\n\nimport inspect\n\nfrom nuitka import ModuleRegistry, Options, Variables\nfrom nuitka.importing.Importing import addExtraSysPaths\nfrom nuitka.importing.Recursion import considerUsedModules\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.Progress import (\n    closeProgressBar,\n    reportProgressBar,\n    setupProgressBar,\n)\nfrom nuitka.Tracing import general, optimization_logger, progress_logger\nfrom nuitka.utils.MemoryUsage import MemoryWatch, reportMemoryUsage\nfrom nuitka.utils.Timing import TimerReport\n\nfrom . import Graphs\nfrom .BytecodeDemotion import demoteCompiledModuleToBytecode\nfrom .Tags import TagSet\nfrom .TraceCollections import withChangeIndicationsTo\n\ntag_set = None\n\n\ndef signalChange(tags, source_ref, message):\n    \"\"\"Indicate a change to the optimization framework.\"\"\"\n    if message is not None:\n        # Try hard to not call a delayed evaluation of node descriptions.\n\n        if Options.is_verbose:\n            optimization_logger.info(\n                \"{source_ref} : {tags} : {message}\".format(\n                    source_ref=source_ref.getAsString(),\n                    tags=tags,\n                    message=message() if inspect.isfunction(message) else message,\n                )\n            )\n\n        # assert pass_count < 2\n\n    tag_set.onSignal(tags)\n\n\ndef optimizeCompiledPythonModule(module):\n    optimization_logger.info_if_file(\n        \"Doing module local optimizations for '{module_name}'.\".format(\n            module_name=module.getFullName()\n        ),\n        other_logger=progress_logger,\n    )\n\n    touched = False\n\n    if Options.isShowProgress() and Options.isShowMemory():\n        memory_watch = MemoryWatch()\n\n    # Temporary workaround, since we do some optimization based on the last pass results\n    # that are then not yet fully seen in the traces yet until another time around, we\n    # allow to continue the loop even without changes one more time.\n    unchanged_count = 0\n\n    while True:\n        tag_set.clear()\n\n        try:\n            # print(\"Compute module\")\n            with withChangeIndicationsTo(signalChange):\n                scopes_were_incomplete = module.computeModule()\n        except SystemExit:\n            raise\n        except BaseException:\n            general.info(\"Interrupted while working on '%s'.\" % module)\n            raise\n\n        if scopes_were_incomplete:\n            tag_set.add(\"var_usage\")\n\n        Graphs.onModuleOptimizationStep(module)\n\n        # Search for local change tags.\n        if not tag_set:\n            unchanged_count += 1\n\n            if unchanged_count == 1 and pass_count == 1:\n                optimization_logger.info_if_file(\n                    \"Not changed, but retrying one more time.\",\n                    other_logger=progress_logger,\n                )\n                continue\n\n            optimization_logger.info_if_file(\n                \"Finished with the module.\", other_logger=progress_logger\n            )\n            break\n\n        unchanged_count = 0\n\n        optimization_logger.info_if_file(\n            \"Not finished with the module due to following change kinds: %s\"\n            % \",\".join(sorted(tag_set)),\n            other_logger=progress_logger,\n        )\n\n        # Otherwise we did stuff, so note that for return value.\n        touched = True\n\n    if Options.isShowProgress() and Options.isShowMemory():\n        memory_watch.finish(\n            \"Memory usage changed during optimization of '%s'\" % (module.getFullName())\n        )\n\n    considerUsedModules(module=module, pass_count=pass_count)\n\n    return touched\n\n\ndef optimizeUncompiledPythonModule(module):\n    full_name = module.getFullName()\n    progress_logger.info(\n        \"Doing module dependency considerations for '{module_name}':\".format(\n            module_name=full_name\n        )\n    )\n\n    # Pick up parent package if any.\n    module.attemptRecursion()\n\n    considerUsedModules(module=module, pass_count=pass_count)\n\n    Plugins.considerImplicitImports(module=module)\n\n\ndef optimizeExtensionModule(module):\n    # Pick up parent package if any.\n    module.attemptRecursion()\n\n    Plugins.considerImplicitImports(module=module)\n\n\ndef optimizeModule(module):\n    # The tag set is global, so it can track changes without context.\n    # pylint: disable=global-statement\n    global tag_set\n    tag_set = TagSet()\n\n    addExtraSysPaths(Plugins.getModuleSysPathAdditions(module.getFullName()))\n\n    if module.isPythonExtensionModule():\n        optimizeExtensionModule(module)\n        changed = False\n    elif module.isCompiledPythonModule():\n        changed = optimizeCompiledPythonModule(module)\n    else:\n        optimizeUncompiledPythonModule(module)\n        changed = False\n\n    return changed\n\n\npass_count = 0\nlast_total = 0\n\n\ndef _restartProgress():\n    global pass_count  # Singleton, pylint: disable=global-statement\n\n    closeProgressBar()\n    pass_count += 1\n\n    optimization_logger.info_if_file(\n        \"PASS %d:\" % pass_count, other_logger=progress_logger\n    )\n\n    if not Options.is_verbose or optimization_logger.isFileOutput():\n        setupProgressBar(\n            stage=\"PASS %d\" % pass_count,\n            unit=\"module\",\n            total=ModuleRegistry.getRemainingModulesCount()\n            + ModuleRegistry.getDoneModulesCount(),\n            min_total=last_total,\n        )\n\n\ndef _traceProgressModuleStart(current_module):\n    optimization_logger.info_if_file(\n        \"\"\"\\\nOptimizing module '{module_name}', {remaining:d} more modules to go \\\nafter that.\"\"\".format(\n            module_name=current_module.getFullName(),\n            remaining=ModuleRegistry.getRemainingModulesCount(),\n        ),\n        other_logger=progress_logger,\n    )\n\n    reportProgressBar(\n        item=current_module.getFullName(),\n        total=ModuleRegistry.getRemainingModulesCount()\n        + ModuleRegistry.getDoneModulesCount(),\n        update=False,\n    )\n\n    if Options.isShowProgress() and Options.isShowMemory():\n        reportMemoryUsage(\n            \"optimization/%d/%s\" % (pass_count, current_module.getFullName()),\n            (\n                (\n                    \"Total memory usage before optimizing module '%s'\"\n                    % current_module.getFullName()\n                )\n                if Options.isShowProgress() or Options.isShowMemory()\n                else None\n            ),\n        )\n\n\ndef _traceProgressModuleEnd(current_module):\n    reportProgressBar(\n        item=current_module.getFullName(),\n        total=ModuleRegistry.getRemainingModulesCount()\n        + ModuleRegistry.getDoneModulesCount(),\n        update=True,\n    )\n\n\ndef _endProgress():\n    global last_total  # Singleton, pylint: disable=global-statement\n    last_total = closeProgressBar()\n\n\ndef restoreFromXML(text):\n    from nuitka.nodes.NodeBases import fromXML\n    from nuitka.TreeXML import fromString\n\n    xml = fromString(text)\n\n    module = fromXML(provider=None, xml=xml)\n\n    return module\n\n\ndef makeOptimizationPass():\n    \"\"\"Make a single pass for optimization, indication potential completion.\"\"\"\n\n    # Controls complex optimization\n\n    finished = True\n\n    ModuleRegistry.startTraversal()\n\n    _restartProgress()\n\n    main_module = None\n    stdlib_phase_done = False\n\n    while True:\n        current_module = ModuleRegistry.nextModule()\n\n        if current_module is None:\n            if main_module is not None and pass_count == 1:\n                considerUsedModules(module=main_module, pass_count=-1)\n\n                stdlib_phase_done = True\n                main_module = None\n                continue\n\n            break\n\n        if current_module.isMainModule() and not stdlib_phase_done:\n            main_module = current_module\n\n        _traceProgressModuleStart(current_module)\n\n        module_name = current_module.getFullName()\n\n        with TimerReport(\n            message=\"Optimizing %s\" % module_name, decider=False\n        ) as module_timer:\n            changed = optimizeModule(current_module)\n\n            # module_timer=module_time_report.getTimer()\n\n        ModuleRegistry.addModuleOptimizationTimeInformation(\n            module_name=module_name,\n            pass_number=pass_count,\n            time_used=module_timer.getDelta(),\n        )\n\n        _traceProgressModuleEnd(current_module)\n\n        if changed:\n            finished = False\n\n    # Unregister collection traces from now unused code, dropping the trace\n    # collections of functions no longer used. This must be done after global\n    # optimization due to cross module usages.\n    for current_module in ModuleRegistry.getDoneModules():\n        if current_module.isCompiledPythonModule():\n            for unused_function in current_module.getUnusedFunctions():\n                Variables.updateVariablesFromCollection(\n                    old_collection=unused_function.trace_collection,\n                    new_collection=None,\n                    source_ref=unused_function.getSourceReference(),\n                )\n\n                unused_function.trace_collection = None\n                unused_function.finalize()\n\n            current_module.subnode_functions = tuple(\n                function\n                for function in current_module.subnode_functions\n                if function in current_module.getUsedFunctions()\n            )\n\n    _endProgress()\n\n    return finished\n\n\ndef optimizeModules(output_filename):\n    Graphs.startGraph()\n\n    finished = makeOptimizationPass()\n\n    # Demote compiled modules to bytecode, now that imports had a chance to be resolved, and\n    # dependencies were handled.\n    for module in ModuleRegistry.getDoneModules():\n        if (\n            module.isCompiledPythonModule()\n            and module.getCompilationMode() == \"bytecode\"\n        ):\n            demoteCompiledModuleToBytecode(module)\n\n    # Second, \"endless\" pass.\n    while not finished:\n        finished = makeOptimizationPass()\n\n    Graphs.endGraph(output_filename)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/OptimizeBuiltinCalls.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Optimize calls to built-in references to specific built-in calls.\n\nFor built-in name references, we check if it's one of the supported built-in\ntypes, and then specialize for the ones, where it makes sense.\n\"\"\"\n\nfrom nuitka.__past__ import unicode, xrange\nfrom nuitka.Errors import NuitkaAssumptionError\nfrom nuitka.nodes.AttributeNodes import (\n    ExpressionBuiltinGetattr,\n    ExpressionBuiltinHasattr,\n    ExpressionBuiltinSetattr,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinAllNodes import ExpressionBuiltinAll\nfrom nuitka.nodes.BuiltinAnyNodes import ExpressionBuiltinAny\nfrom nuitka.nodes.BuiltinComplexNodes import (\n    ExpressionBuiltinComplex1,\n    ExpressionBuiltinComplex2,\n)\nfrom nuitka.nodes.BuiltinDecodingNodes import (\n    ExpressionBuiltinChr,\n    ExpressionBuiltinOrd,\n)\nfrom nuitka.nodes.BuiltinDecoratorNodes import (\n    ExpressionBuiltinClassmethod,\n    ExpressionBuiltinStaticmethod,\n)\nfrom nuitka.nodes.BuiltinDictNodes import ExpressionBuiltinDict\nfrom nuitka.nodes.BuiltinFormatNodes import (\n    ExpressionBuiltinAscii,\n    ExpressionBuiltinBin,\n    ExpressionBuiltinFormat,\n    ExpressionBuiltinHex,\n    ExpressionBuiltinId,\n    ExpressionBuiltinOct,\n)\nfrom nuitka.nodes.BuiltinHashNodes import ExpressionBuiltinHash\nfrom nuitka.nodes.BuiltinInputNodes import ExpressionBuiltinInput\nfrom nuitka.nodes.BuiltinIntegerNodes import (\n    ExpressionBuiltinInt1,\n    ExpressionBuiltinInt2,\n)\nfrom nuitka.nodes.BuiltinIteratorNodes import (\n    ExpressionBuiltinIter1,\n    ExpressionBuiltinIter2,\n)\nfrom nuitka.nodes.BuiltinLenNodes import ExpressionBuiltinLen\nfrom nuitka.nodes.BuiltinNextNodes import (\n    ExpressionBuiltinNext1,\n    ExpressionBuiltinNext2,\n)\nfrom nuitka.nodes.BuiltinOpenNodes import (\n    ExpressionBuiltinOpenP2,\n    ExpressionBuiltinOpenP3,\n)\nfrom nuitka.nodes.BuiltinRangeNodes import (\n    ExpressionBuiltinRange1,\n    ExpressionBuiltinRange2,\n    ExpressionBuiltinRange3,\n    ExpressionBuiltinXrange1,\n    ExpressionBuiltinXrange2,\n    ExpressionBuiltinXrange3,\n)\nfrom nuitka.nodes.BuiltinRefNodes import (\n    ExpressionBuiltinAnonymousRef,\n    makeExpressionBuiltinTypeRef,\n)\nfrom nuitka.nodes.BuiltinSumNodes import (\n    ExpressionBuiltinSum1,\n    ExpressionBuiltinSum2,\n)\nfrom nuitka.nodes.BuiltinTypeNodes import (\n    ExpressionBuiltinBool,\n    ExpressionBuiltinBytearray1,\n    ExpressionBuiltinBytearray3,\n    ExpressionBuiltinFloat,\n    ExpressionBuiltinFrozenset,\n    ExpressionBuiltinList,\n    ExpressionBuiltinSet,\n    ExpressionBuiltinStrP2,\n    ExpressionBuiltinStrP3,\n    ExpressionBuiltinTuple,\n    ExpressionBuiltinUnicodeP2,\n)\nfrom nuitka.nodes.BuiltinVarsNodes import ExpressionBuiltinVars\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.ClassNodes import ExpressionBuiltinType3\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditional,\n    makeStatementConditional,\n)\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTupleOrConstant\nfrom nuitka.nodes.ExecEvalNodes import (\n    ExpressionBuiltinCompile,\n    ExpressionBuiltinEval,\n)\nfrom nuitka.nodes.GlobalsLocalsNodes import (\n    ExpressionBuiltinDir1,\n    ExpressionBuiltinGlobals,\n)\nfrom nuitka.nodes.ImportNodes import ExpressionBuiltinImport\nfrom nuitka.nodes.KeyValuePairNodes import (\n    makeKeyValuePairExpressionsFromKwArgs,\n)\nfrom nuitka.nodes.NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    makeExpressionBuiltinLocals,\n    makeRaiseExceptionReplacementExpression,\n    makeRaiseExceptionReplacementExpressionFromInstance,\n)\nfrom nuitka.nodes.OperatorNodes import ExpressionOperationBinaryDivmod\nfrom nuitka.nodes.OperatorNodesUnary import (\n    ExpressionOperationNot,\n    ExpressionOperationUnaryAbs,\n    ExpressionOperationUnaryRepr,\n)\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import makeStatementReturn\nfrom nuitka.nodes.SliceNodes import makeExpressionBuiltinSlice\nfrom nuitka.nodes.TypeNodes import (\n    ExpressionBuiltinIsinstance,\n    ExpressionBuiltinIssubclass,\n    ExpressionBuiltinSuper0,\n    ExpressionBuiltinSuper1,\n    ExpressionBuiltinSuper2,\n    ExpressionBuiltinType1,\n)\nfrom nuitka.nodes.VariableAssignNodes import (\n    makeStatementAssignmentVariable,\n    makeStatementDelVariable,\n)\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs import BuiltinParameterSpecs\nfrom nuitka.tree.ReformulationExecStatements import wrapEvalGlobalsAndLocals\nfrom nuitka.tree.ReformulationTryFinallyStatements import (\n    makeTryFinallyStatement,\n)\nfrom nuitka.tree.TreeHelpers import (\n    makeCallNode,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n)\n\n\ndef dir_extractor(node):\n    locals_scope = node.subnode_called.getLocalsScope()\n\n    def buildDirEmptyCase(source_ref):\n        source = makeExpressionBuiltinLocals(\n            locals_scope=locals_scope, source_ref=source_ref\n        )\n\n        result = makeCallNode(\n            makeExpressionAttributeLookup(\n                expression=source, attribute_name=\"keys\", source_ref=source_ref\n            ),\n            source_ref,\n        )\n\n        # For Python3, keys doesn't really return values, but instead a handle\n        # only, but we want it to be a list.\n        if python_version >= 0x300:\n            result = ExpressionBuiltinList(value=result, source_ref=source_ref)\n\n        return result\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        # TODO: Needs locals_scope attached.\n        builtin_class=ExpressionBuiltinDir1,\n        builtin_spec=BuiltinParameterSpecs.builtin_dir_spec,\n        empty_special_class=buildDirEmptyCase,\n    )\n\n\ndef vars_extractor(node):\n    locals_scope = node.subnode_called.getLocalsScope()\n\n    def selectVarsEmptyClass(source_ref):\n        return makeExpressionBuiltinLocals(\n            locals_scope=locals_scope, source_ref=source_ref\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        # TODO: Needs locals_cope attached\n        builtin_class=ExpressionBuiltinVars,\n        builtin_spec=BuiltinParameterSpecs.builtin_vars_spec,\n        empty_special_class=selectVarsEmptyClass,\n    )\n\n\ndef import_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinImport,\n        builtin_spec=BuiltinParameterSpecs.builtin_import_spec,\n    )\n\n\ndef type_extractor(node):\n    args = node.subnode_args\n\n    if args is None:\n        iter_length = 0\n    else:\n        iter_length = args.getIterationLength()\n\n    if iter_length == 1:\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=ExpressionBuiltinType1,\n            builtin_spec=BuiltinParameterSpecs.builtin_type1_spec,\n        )\n    elif iter_length == 3:\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=ExpressionBuiltinType3,\n            builtin_spec=BuiltinParameterSpecs.builtin_type3_spec,\n        )\n    else:\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node, exception=TypeError(\"type() takes 1 or 3 arguments\")\n        )\n\n\ndef iter_extractor(node):\n    def wrapIterCreation(callable_arg, sentinel, source_ref):\n        if sentinel is None:\n            return ExpressionBuiltinIter1(value=callable_arg, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinIter2(\n                callable_arg=callable_arg, sentinel=sentinel, source_ref=source_ref\n            )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapIterCreation,\n        builtin_spec=BuiltinParameterSpecs.builtin_iter_spec,\n    )\n\n\ndef next_extractor(node):\n    # Split up next with and without defaults, they are not going to behave\n    # really very similar.\n    def selectNextBuiltinClass(iterator, default, source_ref):\n        if default is None:\n            return ExpressionBuiltinNext1(value=iterator, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinNext2(\n                iterator=iterator, default=default, source_ref=source_ref\n            )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectNextBuiltinClass,\n        builtin_spec=BuiltinParameterSpecs.builtin_next_spec,\n    )\n\n\ndef sum_extractor(node):\n    # Split up sumwith and without start value, one is much easier.\n    def selectSumBuiltinClass(sequence, start, source_ref):\n        if start is None:\n            return ExpressionBuiltinSum1(sequence=sequence, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinSum2(\n                sequence=sequence, start=start, source_ref=source_ref\n            )\n\n    def makeSum0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node,\n            exception=TypeError(\n                \"sum expected at least 1 arguments, got 0\"\n                if python_version < 0x380\n                else \"sum() takes at least 1 positional argument (0 given)\"\n            ),\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectSumBuiltinClass,\n        builtin_spec=BuiltinParameterSpecs.builtin_sum_spec,\n        empty_special_class=makeSum0,\n    )\n\n\ndef dict_extractor(node):\n    # The \"dict\" built-in is a bit strange in that it accepts a position\n    # parameter, or not, but won't have a default value.\n    def wrapExpressionBuiltinDictCreation(positional_args, dict_star_arg, source_ref):\n        if positional_args:\n            # Only one allowed, the spec converted too many into an exception.\n            (pos_arg,) = positional_args\n        else:\n            pos_arg = None\n\n        return ExpressionBuiltinDict(\n            pos_arg=pos_arg,\n            pairs=makeKeyValuePairExpressionsFromKwArgs(dict_star_arg),\n            source_ref=source_ref,\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapExpressionBuiltinDictCreation,\n        builtin_spec=BuiltinParameterSpecs.builtin_dict_spec,\n    )\n\n\ndef chr_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinChr,\n        builtin_spec=BuiltinParameterSpecs.builtin_chr_spec,\n    )\n\n\ndef ord_extractor(node):\n    def makeOrd0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node,\n            exception=TypeError(\"ord() takes exactly one argument (0 given)\"),\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinOrd,\n        builtin_spec=BuiltinParameterSpecs.builtin_ord_spec,\n        empty_special_class=makeOrd0,\n    )\n\n\ndef bin_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinBin,\n        builtin_spec=BuiltinParameterSpecs.builtin_bin_spec,\n    )\n\n\ndef oct_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinOct,\n        builtin_spec=BuiltinParameterSpecs.builtin_oct_spec,\n    )\n\n\ndef hex_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinHex,\n        builtin_spec=BuiltinParameterSpecs.builtin_hex_spec,\n    )\n\n\ndef id_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinId,\n        builtin_spec=BuiltinParameterSpecs.builtin_id_spec,\n    )\n\n\ndef repr_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionOperationUnaryRepr,\n        builtin_spec=BuiltinParameterSpecs.builtin_repr_spec,\n    )\n\n\nif python_version >= 0x300:\n\n    def ascii_extractor(node):\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=ExpressionBuiltinAscii,\n            builtin_spec=BuiltinParameterSpecs.builtin_repr_spec,\n        )\n\n\ndef range_extractor(node):\n    def selectRangeBuiltin(low, high, step, source_ref):\n        if high is None:\n            return ExpressionBuiltinRange1(low=low, source_ref=source_ref)\n        elif step is None:\n            return ExpressionBuiltinRange2(low=low, high=high, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinRange3(\n                low=low, high=high, step=step, source_ref=source_ref\n            )\n\n    def makeRange0(source_ref):\n        # pylint: disable=unused-argument\n        try:\n            range()\n        except Exception as e:  # We want to broad here, pylint: disable=broad-except\n            return makeRaiseExceptionReplacementExpressionFromInstance(\n                expression=node, exception=e\n            )\n        else:\n            raise NuitkaAssumptionError(\"range without argument is expected to raise\")\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectRangeBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_range_spec,\n        empty_special_class=makeRange0,\n    )\n\n\ndef xrange_extractor(node):\n    def selectXrangeBuiltin(low, high, step, source_ref):\n        if high is None:\n            return ExpressionBuiltinXrange1(low=low, source_ref=source_ref)\n        elif step is None:\n            return ExpressionBuiltinXrange2(low=low, high=high, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinXrange3(\n                low=low, high=high, step=step, source_ref=source_ref\n            )\n\n    def makeXrange0(source_ref):\n        # pylint: disable=unused-argument\n        try:\n            xrange()\n        except Exception as e:  # We want to broad here, pylint: disable=broad-except\n            return makeRaiseExceptionReplacementExpressionFromInstance(\n                expression=node, exception=e\n            )\n        else:\n            raise NuitkaAssumptionError(\"range without argument is expected to raise\")\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectXrangeBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_xrange_spec,\n        empty_special_class=makeXrange0,\n    )\n\n\ndef len_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinLen,\n        builtin_spec=BuiltinParameterSpecs.builtin_len_spec,\n    )\n\n\ndef all_extractor(node):\n    # pylint: disable=unused-argument\n    def makeAll0(source_ref):\n        exception_message = \"all() takes exactly one argument (0 given)\"\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node, exception=TypeError(exception_message)\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinAll,\n        builtin_spec=BuiltinParameterSpecs.builtin_all_spec,\n        empty_special_class=makeAll0,\n    )\n\n\ndef abs_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionOperationUnaryAbs,\n        builtin_spec=BuiltinParameterSpecs.builtin_abs_spec,\n    )\n\n\ndef any_extractor(node):\n    # pylint: disable=unused-argument\n    def makeAny0(source_ref):\n        exception_message = \"any() takes exactly one argument (0 given)\"\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node, exception=TypeError(exception_message)\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinAny,\n        builtin_spec=BuiltinParameterSpecs.builtin_any_spec,\n        empty_special_class=makeAny0,\n    )\n\n\ndef tuple_extractor(node):\n    def makeTuple0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(constant=(), node=node, user_provided=False)\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinTuple,\n        builtin_spec=BuiltinParameterSpecs.builtin_tuple_spec,\n        empty_special_class=makeTuple0,\n    )\n\n\ndef list_extractor(node):\n    def makeList0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(constant=[], node=node, user_provided=False)\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinList,\n        builtin_spec=BuiltinParameterSpecs.builtin_list_spec,\n        empty_special_class=makeList0,\n    )\n\n\ndef set_extractor(node):\n    def makeSet0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=set(), node=node, user_provided=False\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinSet,\n        builtin_spec=BuiltinParameterSpecs.builtin_set_spec,\n        empty_special_class=makeSet0,\n    )\n\n\ndef frozenset_extractor(node):\n    def makeFrozenset0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=frozenset(), node=node, user_provided=False\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinFrozenset,\n        builtin_spec=BuiltinParameterSpecs.builtin_frozenset_spec,\n        empty_special_class=makeFrozenset0,\n    )\n\n\ndef float_extractor(node):\n    def makeFloat0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=float(), node=node, user_provided=False\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinFloat,\n        builtin_spec=BuiltinParameterSpecs.builtin_float_spec,\n        empty_special_class=makeFloat0,\n    )\n\n\ndef complex_extractor(node):\n    def makeComplex0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=complex(), node=node, user_provided=False\n        )\n\n    def selectComplexBuiltin(real, imag, source_ref):\n        if imag is None:\n            return ExpressionBuiltinComplex1(value=real, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinComplex2(\n                real=real, imag=imag, source_ref=source_ref\n            )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectComplexBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_complex_spec,\n        empty_special_class=makeComplex0,\n    )\n\n\ndef str_extractor(node):\n    def makeStr0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=str(), node=node, user_provided=False\n        )\n\n    builtin_class = ExpressionBuiltinStrP2 if str is bytes else ExpressionBuiltinStrP3\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=builtin_class,\n        builtin_spec=builtin_class.builtin_spec,\n        empty_special_class=makeStr0,\n    )\n\n\nif python_version < 0x300:\n\n    def unicode_extractor(node):\n        def makeUnicode0(source_ref):\n            # pylint: disable=unused-argument\n\n            return makeConstantReplacementNode(\n                constant=unicode(), node=node, user_provided=False\n            )\n\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=ExpressionBuiltinUnicodeP2,\n            builtin_spec=ExpressionBuiltinUnicodeP2.builtin_spec,\n            empty_special_class=makeUnicode0,\n        )\n\nelse:\n    from nuitka.nodes.BuiltinTypeNodes import (\n        ExpressionBuiltinBytes1,\n        ExpressionBuiltinBytes3,\n    )\n\n    def bytes_extractor(node):\n        def makeBytes0(source_ref):\n            # pylint: disable=unused-argument\n\n            return makeConstantReplacementNode(\n                constant=bytes(), node=node, user_provided=False\n            )\n\n        def selectBytesBuiltin(string, encoding, errors, source_ref):\n            if encoding is None and errors is None:\n                return ExpressionBuiltinBytes1(value=string, source_ref=source_ref)\n            else:\n                return ExpressionBuiltinBytes3(\n                    value=string,\n                    encoding=encoding,\n                    errors=errors,\n                    source_ref=source_ref,\n                )\n\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=selectBytesBuiltin,\n            builtin_spec=BuiltinParameterSpecs.builtin_bytes_p3_spec,\n            empty_special_class=makeBytes0,\n        )\n\n\ndef bool_extractor(node):\n    def makeBool0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=bool(), node=node, user_provided=False\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinBool,\n        builtin_spec=BuiltinParameterSpecs.builtin_bool_spec,\n        empty_special_class=makeBool0,\n    )\n\n\ndef int_extractor(node):\n    def makeInt0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeConstantReplacementNode(\n            constant=int(), node=node, user_provided=False\n        )\n\n    def selectIntBuiltin(value, base, source_ref):\n        if base is None:\n            return ExpressionBuiltinInt1(value=value, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinInt2(value=value, base=base, source_ref=source_ref)\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectIntBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_int_spec,\n        empty_special_class=makeInt0,\n    )\n\n\nif python_version < 0x300:\n    from nuitka.nodes.BuiltinIntegerNodes import (\n        ExpressionBuiltinLong1,\n        ExpressionBuiltinLong2,\n    )\n\n    def long_extractor(node):\n        def makeLong0(source_ref):\n            # pylint: disable=unused-argument\n\n            return makeConstantReplacementNode(\n                constant=int(), node=node, user_provided=False\n            )\n\n        def selectIntBuiltin(value, base, source_ref):\n            if base is None:\n                return ExpressionBuiltinLong1(value=value, source_ref=source_ref)\n            else:\n                return ExpressionBuiltinLong2(\n                    value=value, base=base, source_ref=source_ref\n                )\n\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=selectIntBuiltin,\n            builtin_spec=BuiltinParameterSpecs.builtin_int_spec,\n            empty_special_class=makeLong0,\n        )\n\n\ndef globals_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinGlobals,\n        builtin_spec=BuiltinParameterSpecs.builtin_globals_spec,\n    )\n\n\ndef locals_extractor(node):\n    locals_scope = node.subnode_called.getLocalsScope()\n\n    def makeLocalsNode(source_ref):\n        return makeExpressionBuiltinLocals(\n            locals_scope=locals_scope, source_ref=source_ref\n        )\n\n    # Note: Locals on the module level is really globals.\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=makeLocalsNode,\n        builtin_spec=BuiltinParameterSpecs.builtin_locals_spec,\n    )\n\n\nif python_version < 0x300:\n    from nuitka.nodes.ExecEvalNodes import ExpressionBuiltinExecfile\n\n    def execfile_extractor(node):\n        def wrapExpressionBuiltinExecfileCreation(\n            filename, globals_arg, locals_arg, source_ref\n        ):\n            outline_body = ExpressionOutlineBody(\n                provider=node.getParentVariableProvider(),\n                name=\"execfile_call\",\n                source_ref=source_ref,\n            )\n\n            globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(\n                provider=node.getParentVariableProvider(),\n                globals_node=globals_arg,\n                locals_node=locals_arg,\n                temp_scope=outline_body.getOutlineTempScope(),\n                source_ref=source_ref,\n            )\n\n            tried = makeStatementsSequence(\n                statements=(\n                    tried,\n                    makeStatementReturn(\n                        expression=ExpressionBuiltinExecfile(\n                            in_class_body=node.getParentVariableProvider().isExpressionClassBodyBase(),\n                            source_code=makeCallNode(\n                                makeExpressionAttributeLookup(\n                                    expression=ExpressionBuiltinOpenP2(\n                                        filename=filename,\n                                        mode=makeConstantRefNode(\n                                            constant=\"rU\", source_ref=source_ref\n                                        ),\n                                        buffering=None,\n                                        source_ref=source_ref,\n                                    ),\n                                    attribute_name=\"read\",\n                                    source_ref=source_ref,\n                                ),\n                                source_ref,\n                            ),\n                            globals_arg=globals_ref,\n                            locals_arg=locals_ref,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                ),\n                allow_none=False,\n                source_ref=source_ref,\n            )\n\n            outline_body.setChildBody(\n                makeStatementsSequenceFromStatement(\n                    statement=makeTryFinallyStatement(\n                        provider=outline_body,\n                        tried=tried,\n                        final=final,\n                        source_ref=source_ref,\n                    )\n                )\n            )\n\n            return outline_body\n\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=wrapExpressionBuiltinExecfileCreation,\n            builtin_spec=BuiltinParameterSpecs.builtin_execfile_spec,\n        )\n\n\ndef eval_extractor(node):\n    def wrapEvalBuiltin(source, globals_arg, locals_arg, source_ref):\n        provider = node.getParentVariableProvider()\n\n        outline_body = ExpressionOutlineBody(\n            provider=node.getParentVariableProvider(),\n            name=\"eval_call\",\n            source_ref=source_ref,\n        )\n\n        globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(\n            provider=provider,\n            globals_node=globals_arg,\n            locals_node=locals_arg,\n            temp_scope=outline_body.getOutlineTempScope(),\n            source_ref=source_ref,\n        )\n\n        # The wrapping should not relocate to the \"source_ref\".\n        assert (\n            globals_arg is None\n            or globals_ref.getSourceReference() == globals_arg.getSourceReference()\n        )\n        assert (\n            locals_arg is None\n            or locals_ref.getSourceReference() == locals_arg.getSourceReference()\n        )\n\n        source_variable = outline_body.allocateTempVariable(\n            temp_scope=None, name=\"source\", temp_type=\"object\"\n        )\n\n        final.setChildStatements(\n            final.subnode_statements\n            + (\n                makeStatementDelVariable(\n                    variable=source_variable, tolerant=True, source_ref=source_ref\n                ),\n            )\n        )\n\n        strip_choice = makeConstantRefNode(constant=(\" \\t\",), source_ref=source_ref)\n\n        if python_version >= 0x300:\n            strip_choice = ExpressionConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionBuiltinType1(\n                        value=ExpressionTempVariableRef(\n                            variable=source_variable, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    right=makeExpressionBuiltinTypeRef(\n                        builtin_name=\"bytes\", source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                expression_yes=makeConstantRefNode(\n                    constant=(b\" \\t\",), source_ref=source_ref\n                ),\n                expression_no=strip_choice,\n                source_ref=source_ref,\n            )\n\n        # Source needs some special treatment for eval, if it's a string, it\n        # must be stripped.\n        string_fixup = makeStatementAssignmentVariable(\n            variable=source_variable,\n            source=makeExpressionCall(\n                called=makeExpressionAttributeLookup(\n                    expression=ExpressionTempVariableRef(\n                        variable=source_variable, source_ref=source_ref\n                    ),\n                    attribute_name=\"strip\",\n                    source_ref=source_ref,\n                ),\n                args=strip_choice,  # This is a tuple\n                kw=None,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        acceptable_builtin_types = [\n            ExpressionBuiltinAnonymousRef(builtin_name=\"code\", source_ref=source_ref)\n        ]\n\n        if python_version >= 0x270:\n            acceptable_builtin_types.append(\n                makeExpressionBuiltinTypeRef(\n                    builtin_name=\"memoryview\", source_ref=source_ref\n                )\n            )\n\n        statements = (\n            makeStatementAssignmentVariable(\n                variable=source_variable, source=source, source_ref=source_ref\n            ),\n            makeStatementConditional(\n                condition=ExpressionOperationNot(\n                    operand=ExpressionBuiltinIsinstance(\n                        instance=ExpressionTempVariableRef(\n                            variable=source_variable, source_ref=source_ref\n                        ),\n                        classes=makeExpressionMakeTupleOrConstant(\n                            elements=tuple(acceptable_builtin_types),\n                            user_provided=True,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                ),\n                yes_branch=string_fixup,\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n            makeStatementReturn(\n                expression=ExpressionBuiltinEval(\n                    source_code=ExpressionTempVariableRef(\n                        variable=source_variable, source_ref=source_ref\n                    ),\n                    globals_arg=globals_ref,\n                    locals_arg=locals_ref,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n        )\n\n        tried = makeStatementsSequence(\n            statements=(tried,) + statements, allow_none=False, source_ref=source_ref\n        )\n\n        outline_body.setChildBody(\n            makeStatementsSequenceFromStatement(\n                statement=makeTryFinallyStatement(\n                    provider=outline_body,\n                    tried=tried,\n                    final=final,\n                    source_ref=source_ref,\n                )\n            )\n        )\n\n        return outline_body\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapEvalBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_eval_spec,\n    )\n\n\nif python_version >= 0x300:\n    from nuitka.nodes.ExecEvalNodes import ExpressionBuiltinExec\n\n    def exec_extractor(node):\n        def wrapExpressionBuiltinExecCreation(\n            source, globals_arg, locals_arg, closure=None, source_ref=None\n        ):\n            provider = node.getParentVariableProvider()\n\n            outline_body = ExpressionOutlineBody(\n                provider=provider, name=\"exec_call\", source_ref=source_ref\n            )\n\n            globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(\n                provider=provider,\n                globals_node=globals_arg,\n                locals_node=locals_arg,\n                temp_scope=outline_body.getOutlineTempScope(),\n                source_ref=source_ref,\n            )\n\n            tried = makeStatementsSequence(\n                statements=(\n                    tried,\n                    makeStatementReturn(\n                        expression=ExpressionBuiltinExec(\n                            source_code=source,\n                            globals_arg=globals_ref,\n                            locals_arg=locals_ref,\n                            closure=closure,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                ),\n                allow_none=False,\n                source_ref=source_ref,\n            )\n\n            # Hack: Allow some APIs to work already\n            tried.parent = outline_body\n\n            outline_body.setChildBody(\n                makeStatementsSequenceFromStatement(\n                    statement=makeTryFinallyStatement(\n                        provider=provider,\n                        tried=tried,\n                        final=final,\n                        source_ref=source_ref,\n                    )\n                )\n            )\n\n            return outline_body\n\n        return BuiltinParameterSpecs.extractBuiltinArgs(\n            node=node,\n            builtin_class=wrapExpressionBuiltinExecCreation,\n            builtin_spec=BuiltinParameterSpecs.builtin_exec_spec,\n        )\n\n\ndef compile_extractor(node):\n    def wrapExpressionBuiltinCompileCreation(\n        source_code, filename, mode, flags, dont_inherit, optimize=None, source_ref=None\n    ):\n        return ExpressionBuiltinCompile(\n            source_code=source_code,\n            filename=filename,\n            mode=mode,\n            flags=flags,\n            dont_inherit=dont_inherit,\n            optimize=optimize,\n            source_ref=source_ref,\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapExpressionBuiltinCompileCreation,\n        builtin_spec=BuiltinParameterSpecs.builtin_compile_spec,\n    )\n\n\ndef open_extractor(node):\n    def makeOpen0(source_ref):\n        # pylint: disable=unused-argument\n        try:\n            # Not giving arguments or context on purpose\n            # pylint: disable=consider-using-with,unspecified-encoding\n            open()\n        except Exception as e:  # We want to broad here, pylint: disable=broad-except\n            return makeRaiseExceptionReplacementExpressionFromInstance(\n                expression=node, exception=e\n            )\n        else:\n            raise NuitkaAssumptionError(\"open without argument is expected to raise\")\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=(\n            ExpressionBuiltinOpenP3 if str is not bytes else ExpressionBuiltinOpenP2\n        ),\n        builtin_spec=BuiltinParameterSpecs.builtin_open_spec,\n        empty_special_class=makeOpen0,\n    )\n\n\ndef super_extractor(node):\n    def wrapSuperBuiltin(type_arg, object_arg, source_ref):\n        # Many cases due to complex defaulting behavior, pylint: disable=too-many-return-statements\n\n        if type_arg is None and python_version >= 0x300:\n            if provider.isCompiledPythonModule():\n                return makeRaiseExceptionReplacementExpression(\n                    expression=node,\n                    exception_type=\"RuntimeError\",\n                    exception_value=\"super(): no arguments\",\n                )\n\n            class_variable = provider.getVariableForReference(variable_name=\"__class__\")\n\n            provider.trace_collection.getVariableCurrentTrace(class_variable).addUsage()\n\n            type_arg = ExpressionVariableRef(\n                # Ought to be already closure taken due to \"super\" flag in\n                # tree building.\n                variable=class_variable,\n                source_ref=source_ref,\n            )\n\n            # If we already have this as a local variable, then use that\n            # instead.\n            type_arg_owner = class_variable.getOwner()\n            if type_arg_owner is provider or not (\n                type_arg_owner.isExpressionFunctionBody()\n                or type_arg_owner.isExpressionClassBodyBase()\n            ):\n                return makeRaiseExceptionReplacementExpression(\n                    expression=node,\n                    exception_type=(\n                        \"SystemError\" if python_version < 0x331 else \"RuntimeError\"\n                    ),\n                    exception_value=\"super(): __class__ cell not found\",\n                )\n\n            if object_arg is None:\n                if (\n                    provider.isExpressionGeneratorObjectBody()\n                    or provider.isExpressionCoroutineObjectBody()\n                    or provider.isExpressionAsyncgenObjectBody()\n                ):\n                    parameter_provider = provider.getParentVariableProvider()\n                else:\n                    parameter_provider = provider\n\n                if parameter_provider.getParameters().getArgumentCount() == 0:\n                    return makeRaiseExceptionReplacementExpression(\n                        expression=node,\n                        exception_type=\"RuntimeError\",\n                        exception_value=\"super(): no arguments\",\n                    )\n                else:\n                    par1_name = parameter_provider.getParameters().getArgumentNames()[0]\n\n                    object_variable = provider.getVariableForReference(\n                        variable_name=par1_name\n                    )\n\n                    provider.trace_collection.getVariableCurrentTrace(\n                        object_variable\n                    ).addUsage()\n\n                    object_arg = ExpressionVariableRef(\n                        variable=object_variable, source_ref=source_ref\n                    )\n\n                    if not object_arg.getVariable().isParameterVariable():\n                        return makeRaiseExceptionReplacementExpression(\n                            expression=node,\n                            exception_type=(\n                                \"SystemError\"\n                                if python_version < 0x300\n                                else \"RuntimeError\"\n                            ),\n                            exception_value=\"super(): __class__ cell not found\",\n                        )\n\n            return ExpressionBuiltinSuper0(\n                type_arg=type_arg,\n                object_arg=object_arg,\n                source_ref=source_ref,\n            )\n\n        if object_arg is None:\n            return ExpressionBuiltinSuper1(\n                type_arg=type_arg,\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionBuiltinSuper2(\n                type_arg=type_arg,\n                object_arg=object_arg,\n                source_ref=source_ref,\n            )\n\n    provider = node.getParentVariableProvider().getEntryPoint()\n\n    if not provider.isCompiledPythonModule():\n        provider.discardFlag(\"has_super\")\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapSuperBuiltin,\n        builtin_spec=BuiltinParameterSpecs.builtin_super_spec,\n    )\n\n\ndef hasattr_extractor(node):\n    # We need to have to builtin arguments, pylint: disable=redefined-builtin\n    def makeExpressionBuiltinHasattr(object, name, source_ref):\n        return ExpressionBuiltinHasattr(\n            expression=object, name=name, source_ref=source_ref\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=makeExpressionBuiltinHasattr,\n        builtin_spec=BuiltinParameterSpecs.builtin_hasattr_spec,\n    )\n\n\ndef getattr_extractor(node):\n    # We need to have to builtin arguments, pylint: disable=redefined-builtin\n    def makeExpressionBuiltinGetattr(object, name, default, source_ref):\n        return ExpressionBuiltinGetattr(\n            expression=object, name=name, default=default, source_ref=source_ref\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=makeExpressionBuiltinGetattr,\n        builtin_spec=BuiltinParameterSpecs.builtin_getattr_spec,\n    )\n\n\ndef setattr_extractor(node):\n    # We need to have to builtin arguments, pylint: disable=redefined-builtin\n    def makeExpressionBuiltinSetattr(object, name, value, source_ref):\n        return ExpressionBuiltinSetattr(\n            expression=object, name=name, value=value, source_ref=source_ref\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=makeExpressionBuiltinSetattr,\n        builtin_spec=BuiltinParameterSpecs.builtin_setattr_spec,\n    )\n\n\ndef isinstance_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinIsinstance,\n        builtin_spec=BuiltinParameterSpecs.builtin_isinstance_spec,\n    )\n\n\ndef issubclass_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinIssubclass,\n        builtin_spec=BuiltinParameterSpecs.builtin_isinstance_spec,\n    )\n\n\ndef bytearray_extractor(node):\n    def makeBytearray0(source_ref):\n        return makeConstantRefNode(constant=bytearray(), source_ref=source_ref)\n\n    def selectBytearrayBuiltinClass(string, encoding, errors, source_ref):\n        # TODO: Highly suspicious that \"errors\"\n        if encoding is None:\n            return ExpressionBuiltinBytearray1(value=string, source_ref=source_ref)\n        else:\n            return ExpressionBuiltinBytearray3(\n                string=string, encoding=encoding, errors=errors, source_ref=source_ref\n            )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=selectBytearrayBuiltinClass,\n        builtin_spec=BuiltinParameterSpecs.builtin_bytearray_spec,\n        empty_special_class=makeBytearray0,\n    )\n\n\ndef slice_extractor(node):\n    def wrapSlice(start, stop, step, source_ref):\n        if start is not None and stop is None:\n            # Default rules are strange. If one argument is given, it's the\n            # second one then.\n            stop = start\n            start = None\n\n        return makeExpressionBuiltinSlice(\n            start=start, stop=stop, step=step, source_ref=source_ref\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=wrapSlice,\n        builtin_spec=BuiltinParameterSpecs.builtin_slice_spec,\n    )\n\n\ndef hash_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinHash,\n        builtin_spec=BuiltinParameterSpecs.builtin_hash_spec,\n    )\n\n\ndef input_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinInput,\n        builtin_spec=BuiltinParameterSpecs.builtin_input_spec,\n    )\n\n\ndef format_extractor(node):\n    def makeFormat0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node,\n            exception=TypeError(\"format() takes at least 1 argument (0 given)\"),\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinFormat,\n        builtin_spec=BuiltinParameterSpecs.builtin_format_spec,\n        empty_special_class=makeFormat0,\n    )\n\n\ndef staticmethod_extractor(node):\n    def makeStaticmethod0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node,\n            exception=TypeError(\"staticmethod expected 1 arguments, got 0\"),\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinStaticmethod,\n        builtin_spec=BuiltinParameterSpecs.builtin_staticmethod_spec,\n        empty_special_class=makeStaticmethod0,\n    )\n\n\ndef classmethod_extractor(node):\n    def makeStaticmethod0(source_ref):\n        # pylint: disable=unused-argument\n\n        return makeRaiseExceptionReplacementExpressionFromInstance(\n            expression=node,\n            exception=TypeError(\"classmethod expected 1 arguments, got 0\"),\n        )\n\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionBuiltinClassmethod,\n        builtin_spec=BuiltinParameterSpecs.builtin_classmethod_spec,\n        empty_special_class=makeStaticmethod0,\n    )\n\n\ndef divmod_extractor(node):\n    return BuiltinParameterSpecs.extractBuiltinArgs(\n        node=node,\n        builtin_class=ExpressionOperationBinaryDivmod,\n        builtin_spec=BuiltinParameterSpecs.builtin_divmod_spec,\n    )\n\n\n_dispatch_dict = {\n    \"compile\": compile_extractor,\n    \"globals\": globals_extractor,\n    \"locals\": locals_extractor,\n    \"eval\": eval_extractor,\n    \"dir\": dir_extractor,\n    \"vars\": vars_extractor,\n    \"__import__\": import_extractor,\n    \"chr\": chr_extractor,\n    \"ord\": ord_extractor,\n    \"bin\": bin_extractor,\n    \"oct\": oct_extractor,\n    \"hex\": hex_extractor,\n    \"id\": id_extractor,\n    \"type\": type_extractor,\n    \"iter\": iter_extractor,\n    \"next\": next_extractor,\n    \"sum\": sum_extractor,\n    \"tuple\": tuple_extractor,\n    \"list\": list_extractor,\n    \"dict\": dict_extractor,\n    \"set\": set_extractor,\n    \"frozenset\": frozenset_extractor,\n    \"float\": float_extractor,\n    \"complex\": complex_extractor,\n    \"str\": str_extractor,\n    \"bool\": bool_extractor,\n    \"int\": int_extractor,\n    \"repr\": repr_extractor,\n    \"len\": len_extractor,\n    \"any\": any_extractor,\n    \"abs\": abs_extractor,\n    \"all\": all_extractor,\n    \"super\": super_extractor,\n    \"hasattr\": hasattr_extractor,\n    \"getattr\": getattr_extractor,\n    \"setattr\": setattr_extractor,\n    \"isinstance\": isinstance_extractor,\n    \"issubclass\": issubclass_extractor,\n    \"bytearray\": bytearray_extractor,\n    \"slice\": slice_extractor,\n    \"hash\": hash_extractor,\n    \"format\": format_extractor,\n    \"open\": open_extractor,\n    \"staticmethod\": staticmethod_extractor,\n    \"classmethod\": classmethod_extractor,\n    \"divmod\": divmod_extractor,\n    \"input\": input_extractor,\n}\n\nif python_version < 0x300:\n    # These are not in Python3\n    _dispatch_dict[\"long\"] = long_extractor\n    _dispatch_dict[\"unicode\"] = unicode_extractor\n    _dispatch_dict[\"execfile\"] = execfile_extractor\n    _dispatch_dict[\"xrange\"] = xrange_extractor\n\n    _dispatch_dict[\"range\"] = range_extractor\nelse:\n    # This one is not in Python2:\n    _dispatch_dict[\"bytes\"] = bytes_extractor\n    _dispatch_dict[\"ascii\"] = ascii_extractor\n    _dispatch_dict[\"exec\"] = exec_extractor\n\n    # The Python3 range is really an xrange, use that.\n    _dispatch_dict[\"range\"] = xrange_extractor\n\n\ndef check():\n    from nuitka.Builtins import builtin_names\n\n    for builtin_name in _dispatch_dict:\n        assert builtin_name in builtin_names, builtin_name\n\n\ncheck()\n\n_builtin_ignore_list = (\n    # Not supporting 'print', because it could be replaced, and is not\n    # worth the effort yet.\n    \"print\",\n    # TODO: This could, and should be supported, as we could e.g. lower\n    # types easily for it.\n    \"sorted\",\n    # TODO: This would be very worthwhile, as it could easily optimize\n    # its iteration away.\n    \"zip\",\n    # TODO: This would be most precious due to the type hint it gives\n    \"enumerate\",\n    # TODO: Also worthwhile for known values.\n    \"reversed\",\n    # TODO: Not sure what this really is about.\n    \"memoryview\",\n)\n\n\ndef _describeNewNode(builtin_name, inspect_node):\n    \"\"\"Describe the change for better understanding.\"\"\"\n\n    # Don't mention side effects, that's not what we care about.\n    if inspect_node.isExpressionSideEffects():\n        inspect_node = inspect_node.subnode_expression\n\n    if inspect_node.isExpressionBuiltinImport():\n        tags = \"new_import\"\n        message = \"\"\"\\\nReplaced dynamic \"__import__\" call with static built-in call.\"\"\"\n    elif inspect_node.isExpressionBuiltin() or inspect_node.isStatementExec():\n        tags = \"new_builtin\"\n        message = \"Replaced call to built-in '%s' with built-in call '%s'.\" % (\n            builtin_name,\n            inspect_node.kind,\n        )\n    elif inspect_node.isExpressionRaiseException():\n        tags = \"new_raise\"\n        message = \"\"\"\\\nReplaced call to built-in '%s' with exception raise.\"\"\" % (\n            builtin_name,\n        )\n    elif inspect_node.isExpressionOperationBinary():\n        tags = \"new_expression\"\n        message = \"\"\"\\\nReplaced call to built-in '%s' with binary operation '%s'.\"\"\" % (\n            builtin_name,\n            inspect_node.getOperator(),\n        )\n    elif inspect_node.isExpressionOperationUnary():\n        tags = \"new_expression\"\n        message = \"\"\"\\\nReplaced call to built-in '%s' with unary operation '%s'.\"\"\" % (\n            builtin_name,\n            inspect_node.getOperator(),\n        )\n    elif inspect_node.isExpressionCall():\n        tags = \"new_expression\"\n        message = \"\"\"\\\nReplaced call to built-in '%s' with call.\"\"\" % (\n            builtin_name,\n        )\n    elif inspect_node.isExpressionOutlineBody():\n        tags = \"new_expression\"\n        message = (\n            \"\"\"\\\nReplaced call to built-in '%s' with outlined call.\"\"\"\n            % builtin_name\n        )\n    elif inspect_node.isExpressionConstantRef():\n        tags = \"new_expression\"\n        message = (\n            \"\"\"\\\nReplaced call to built-in '%s' with constant value.\"\"\"\n            % builtin_name\n        )\n    else:\n        assert False, (builtin_name, \"->\", inspect_node)\n\n    return tags, message\n\n\ndef computeBuiltinCall(builtin_name, call_node):\n    # There is some dispatching for how to output various types of changes,\n    # with lots of cases.\n    if builtin_name in _dispatch_dict:\n        new_node = _dispatch_dict[builtin_name](call_node)\n\n        assert new_node is not call_node, builtin_name\n        assert new_node is not None, builtin_name\n\n        # For traces, we are going to ignore side effects, and output traces\n        # only based on the basis of it.\n        tags, message = _describeNewNode(builtin_name, new_node)\n\n        return new_node, tags, message\n    else:\n        # TODO: Achieve coverage of all built-ins in at least the ignore list.\n        # if False and builtin_name not in _builtin_ignore_list:\n        #     optimization_logger.warning(\n        #         \"Not handling built-in %r, consider support.\" % builtin_name\n        #     )\n\n        return call_node, None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/Tags.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tags and set of it.\n\nUsed by optimization to keep track of the current state of optimization, these\ntags trigger the execution of optimization steps, which in turn may emit these\ntags to execute other steps.\n\n\"\"\"\n\nallowed_tags = (\n    # New code means new statements.\n    # Could be an inlined exec statement.\n    \"new_code\",\n    # Added new import.\n    \"new_import\",\n    # New statements added, removed.\n    \"new_statements\",\n    # New expression added.\n    \"new_expression\",\n    # Loop analysis is incomplete, or only just now completed.\n    \"loop_analysis\",\n    # TODO: A bit unclear what this it, potentially a changed variable.\n    \"var_usage\",\n    # Detected module variable to be read only.\n    \"read_only_mvar\",\n    # Trusting module variables in functions.\n    \"trusted_module_variables\",\n    # New built-in reference detected.\n    \"new_builtin_ref\",\n    # New built-in call detected.\n    \"new_builtin\",\n    # New raise statement detected.\n    \"new_raise\",\n    # New constant introduced.\n    \"new_constant\",\n)\n\n\nclass TagSet(set):\n    def onSignal(self, signal):\n        if type(signal) is str:\n            signal = signal.split()\n\n        for tag in signal:\n            self.add(tag)\n\n    def check(self, tags):\n        for tag in tags.split():\n            assert tag in allowed_tags, tag\n\n            if tag in self:\n                return True\n        return False\n\n    def add(self, tag):\n        assert tag in allowed_tags, tag\n\n        set.add(self, tag)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/TraceCollections.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Trace collection (also often still referred to as constraint collection).\n\nAt the core of value propagation there is the collection of constraints that\nallow to propagate knowledge forward or not.\n\nThis is about collecting these constraints and to manage them.\n\"\"\"\n\nimport contextlib\nfrom collections import defaultdict\nfrom contextlib import contextmanager\n\nfrom nuitka import Variables\nfrom nuitka.__past__ import iterItems  # Python3 compatibility.\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.importing.Importing import locateModule, makeModuleUsageAttempt\nfrom nuitka.importing.Recursion import decideRecursion\nfrom nuitka.ModuleRegistry import addUsedModule\nfrom nuitka.nodes.NodeMakingHelpers import getComputationResult\nfrom nuitka.nodes.shapes.StandardShapes import tshape_uninitialized\nfrom nuitka.Tracing import (\n    inclusion_logger,\n    printError,\n    printLine,\n    printSeparator,\n)\nfrom nuitka.tree.SourceHandling import readSourceLine\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\nfrom nuitka.utils.Timing import TimerReport\n\nfrom .ValueTraces import (\n    ValueTraceAssign,\n    ValueTraceAssignUnescapable,\n    ValueTraceAssignUnescapablePropagated,\n    ValueTraceAssignVeryTrusted,\n    ValueTraceDeleted,\n    ValueTraceEscaped,\n    ValueTraceInit,\n    ValueTraceInitStarArgs,\n    ValueTraceInitStarDict,\n    ValueTraceLoopComplete,\n    ValueTraceLoopIncomplete,\n    ValueTraceMerge,\n    ValueTraceUninitialized,\n    ValueTraceUnknown,\n)\n\nsignalChange = None\n\n\n@contextmanager\ndef withChangeIndicationsTo(signal_change):\n    \"\"\"Decide where change indications should go to.\"\"\"\n\n    global signalChange  # Singleton, pylint: disable=global-statement\n\n    old = signalChange\n    signalChange = signal_change\n    yield\n    signalChange = old\n\n\nclass CollectionUpdateMixin(object):\n    \"\"\"Mixin to use in every collection to add traces.\"\"\"\n\n    # Mixins are not allowed to specify slots.\n    __slots__ = ()\n\n    def hasVariableTrace(self, variable, version):\n        return (variable, version) in self.variable_traces\n\n    def getVariableTrace(self, variable, version):\n        return self.variable_traces[(variable, version)]\n\n    def getVariableTraces(self, variable):\n        result = []\n\n        for key, variable_trace in iterItems(self.variable_traces):\n            candidate = key[0]\n\n            if variable is candidate:\n                result.append(variable_trace)\n\n        return result\n\n    def getVariableTracesAll(self):\n        return self.variable_traces\n\n    def addVariableTrace(self, variable, version, trace):\n        key = variable, version\n\n        assert key not in self.variable_traces, (key, self)\n        self.variable_traces[key] = trace\n\n    def addVariableMergeMultipleTrace(self, variable, traces):\n        version = variable.allocateTargetNumber()\n\n        trace_merge = ValueTraceMerge(traces)\n\n        self.addVariableTrace(variable, version, trace_merge)\n\n        return version\n\n\nclass CollectionStartPointMixin(CollectionUpdateMixin):\n    \"\"\"Mixin to use in start points of collections.\n\n    These are modules, functions, etc. typically entry points.\n    \"\"\"\n\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # Many things are traced\n\n    def __init__(self):\n        # Variable assignments performed in here, last issued number, only used\n        # to determine the next number that should be used for a new assignment.\n        self.variable_versions = {}\n\n        # The full trace of a variable with a version for the function or module\n        # this is.\n        self.variable_traces = {}\n\n        self.break_collections = None\n        self.continue_collections = None\n        self.return_collections = None\n        self.exception_collections = None\n\n        self.outline_functions = None\n\n    def getLoopBreakCollections(self):\n        return self.break_collections\n\n    def onLoopBreak(self, collection=None):\n        if collection is None:\n            collection = self\n\n        self.break_collections.append(\n            TraceCollectionBranch(parent=collection, name=\"loop break\")\n        )\n\n    def getLoopContinueCollections(self):\n        return self.continue_collections\n\n    def onLoopContinue(self, collection=None):\n        if collection is None:\n            collection = self\n\n        self.continue_collections.append(\n            TraceCollectionBranch(parent=collection, name=\"loop continue\")\n        )\n\n    def onFunctionReturn(self, collection=None):\n        if collection is None:\n            collection = self\n\n        if self.return_collections is not None:\n            self.return_collections.append(\n                TraceCollectionBranch(parent=collection, name=\"return\")\n            )\n\n    def onExceptionRaiseExit(self, raisable_exceptions, collection=None):\n        \"\"\"Indicate to the trace collection what exceptions may have occurred.\n\n        Args:\n            raisable_exception: Currently ignored, one or more exceptions that\n            could occur, e.g. \"BaseException\".\n            collection: To pass the collection that will be the parent\n        Notes:\n            Currently this is unused. Passing \"collection\" as an argument, so\n            we know the original collection to attach the branch to, is maybe\n            not the most clever way to do this\n\n            We also might want to specialize functions for specific exceptions,\n            there is little point in providing BaseException as an argument in\n            so many places.\n\n            The actual storage of the exceptions that can occur is currently\n            missing entirely. We just use this to detect \"any exception\" by\n            not being empty.\n        \"\"\"\n\n        # TODO: We might want to track per exception, pylint: disable=unused-argument\n\n        if collection is None:\n            collection = self\n\n        if self.exception_collections is not None:\n            self.exception_collections.append(\n                TraceCollectionBranch(parent=collection, name=\"exception\")\n            )\n\n    def getFunctionReturnCollections(self):\n        return self.return_collections\n\n    def getExceptionRaiseCollections(self):\n        return self.exception_collections\n\n    def hasEmptyTraces(self, variable):\n        # TODO: Combine these steps into one for performance gains.\n        traces = self.getVariableTraces(variable)\n        return areEmptyTraces(traces)\n\n    def hasReadOnlyTraces(self, variable):\n        # TODO: Combine these steps into one for performance gains.\n        traces = self.getVariableTraces(variable)\n        return areReadOnlyTraces(traces)\n\n    def initVariableUnknown(self, variable):\n        trace = ValueTraceUnknown(owner=self.owner, previous=None)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def initVariableModule(self, variable):\n        trace = ValueTraceUnknown(owner=self.owner, previous=None)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def initVariableInit(self, variable):\n        trace = ValueTraceInit(self.owner)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def initVariableInitStarArgs(self, variable):\n        trace = ValueTraceInitStarArgs(self.owner)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def initVariableInitStarDict(self, variable):\n        trace = ValueTraceInitStarDict(self.owner)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def initVariableUninitialized(self, variable):\n        trace = ValueTraceUninitialized(owner=self.owner, previous=None)\n\n        self.addVariableTrace(variable, 0, trace)\n\n        return trace\n\n    def updateVariablesFromCollection(self, old_collection, source_ref):\n        Variables.updateVariablesFromCollection(old_collection, self, source_ref)\n\n    @contextlib.contextmanager\n    def makeAbortStackContext(\n        self, catch_breaks, catch_continues, catch_returns, catch_exceptions\n    ):\n        if catch_breaks:\n            old_break_collections = self.break_collections\n            self.break_collections = []\n        if catch_continues:\n            old_continue_collections = self.continue_collections\n            self.continue_collections = []\n        if catch_returns:\n            old_return_collections = self.return_collections\n            self.return_collections = []\n        if catch_exceptions:\n            old_exception_collections = self.exception_collections\n            self.exception_collections = []\n\n        yield\n\n        if catch_breaks:\n            self.break_collections = old_break_collections\n        if catch_continues:\n            self.continue_collections = old_continue_collections\n        if catch_returns:\n            self.return_collections = old_return_collections\n        if catch_exceptions:\n            self.exception_collections = old_exception_collections\n\n    def initVariable(self, variable):\n        return variable.initVariable(self)\n\n    def addOutlineFunction(self, outline):\n        if self.outline_functions is None:\n            self.outline_functions = [outline]\n        else:\n            self.outline_functions.append(outline)\n\n    def getOutlineFunctions(self):\n        return self.outline_functions\n\n    def onLocalsDictEscaped(self, locals_scope):\n        locals_scope.preventLocalsDictPropagation()\n\n        for variable in locals_scope.variables.values():\n            self.markActiveVariableAsEscaped(variable)\n\n        # TODO: Limit to the scope.\n        # TODO: Does the above code not do that already?\n        for variable in self.variable_actives:\n            if variable.isTempVariable() or variable.isModuleVariable():\n                continue\n\n            self.markActiveVariableAsEscaped(variable)\n\n    def onUsedFunction(self, function_body):\n        owning_module = function_body.getParentModule()\n\n        # Make sure the owning module is added to the used set. This is most\n        # important for helper functions, or modules, which otherwise have\n        # become unused.\n        addUsedModule(\n            module=owning_module,\n            using_module=None,\n            usage_tag=\"function\",\n            reason=\"Function %s\" % self.name,\n            source_ref=owning_module.source_ref,\n        )\n\n        needs_visit = owning_module.addUsedFunction(function_body)\n\n        if needs_visit or function_body.isExpressionFunctionPureBody():\n            function_body.computeFunctionRaw(self)\n\n\nclass TraceCollectionBase(object):\n    \"\"\"This contains for logic for maintaining active traces.\n\n    They are kept for \"variable\" and versions.\n    \"\"\"\n\n    __slots__ = (\"owner\", \"parent\", \"name\", \"variable_actives\")\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    @counted_init\n    def __init__(self, owner, name, parent):\n        self.owner = owner\n        self.parent = parent\n        self.name = name\n\n        # Currently active values in the tracing.\n        self.variable_actives = {}\n\n    def __repr__(self):\n        return \"<%s for %s at 0x%x>\" % (self.__class__.__name__, self.name, id(self))\n\n    def getOwner(self):\n        return self.owner\n\n    def dumpActiveTraces(self, indent=\"\"):\n        printSeparator()\n        printLine(\"Active are:\")\n        for variable, version in sorted(\n            self.variable_actives.items(), key=lambda var: var[0].variable_name\n        ):\n            printLine(\"%s %s:\" % (variable, version))\n            self.getVariableCurrentTrace(variable).dump(indent)\n\n        printSeparator()\n\n    def getVariableCurrentTrace(self, variable):\n        \"\"\"Get the current value trace associated to this variable\n\n        It is also created on the fly if necessary. We create them\n        lazy so to keep the tracing branches minimal where possible.\n        \"\"\"\n\n        return self.getVariableTrace(\n            variable=variable, version=self._getCurrentVariableVersion(variable)\n        )\n\n    def markCurrentVariableTrace(self, variable, version):\n        self.variable_actives[variable] = version\n\n    def _getCurrentVariableVersion(self, variable):\n        try:\n            return self.variable_actives[variable]\n        except KeyError:\n            # Initialize variables on the fly.\n            if not self.hasVariableTrace(variable, 0):\n                self.initVariable(variable)\n\n            self.markCurrentVariableTrace(variable, 0)\n\n            return self.variable_actives[variable]\n\n    def markActiveVariableAsEscaped(self, variable):\n        current = self.getVariableCurrentTrace(variable)\n\n        if current.isTraceThatNeedsEscape():\n            version = variable.allocateTargetNumber()\n\n            self.addVariableTrace(\n                variable,\n                version,\n                ValueTraceEscaped(owner=self.owner, previous=current),\n            )\n\n            self.markCurrentVariableTrace(variable, version)\n\n    def markClosureVariableAsUnknown(self, variable):\n        current = self.getVariableCurrentTrace(variable)\n\n        if not current.isUnknownTrace():\n            version = variable.allocateTargetNumber()\n\n            self.addVariableTrace(\n                variable,\n                version,\n                ValueTraceUnknown(owner=self.owner, previous=current),\n            )\n\n            self.markCurrentVariableTrace(variable, version)\n\n    def markActiveVariableAsUnknown(self, variable):\n        current = self.getVariableCurrentTrace(variable)\n\n        if not current.isUnknownOrVeryTrustedTrace():\n            version = variable.allocateTargetNumber()\n\n            self.addVariableTrace(\n                variable,\n                version,\n                ValueTraceUnknown(owner=self.owner, previous=current),\n            )\n\n            self.markCurrentVariableTrace(variable, version)\n\n    def markActiveVariableAsLoopMerge(\n        self, loop_node, current, variable, shapes, incomplete\n    ):\n        if incomplete:\n            result = ValueTraceLoopIncomplete(loop_node, current, shapes)\n        else:\n            # TODO: Empty is a missing optimization somewhere, but it also happens that\n            # a variable is getting released in a loop.\n            # assert shapes, (variable, current)\n\n            if not shapes:\n                shapes.add(tshape_uninitialized)\n\n            result = ValueTraceLoopComplete(loop_node, current, shapes)\n\n        version = variable.allocateTargetNumber()\n        self.addVariableTrace(variable, version, result)\n\n        self.markCurrentVariableTrace(variable, version)\n\n        return result\n\n    @staticmethod\n    def signalChange(tags, source_ref, message):\n        # This is monkey patched from another module. pylint: disable=I0021,not-callable\n        signalChange(tags, source_ref, message)\n\n    @staticmethod\n    def mustAlias(a, b):\n        if a.isExpressionVariableRef() and b.isExpressionVariableRef():\n            return a.getVariable() is b.getVariable()\n\n        return False\n\n    @staticmethod\n    def mustNotAlias(a, b):\n        # TODO: not yet really implemented\n        if a.isExpressionConstantRef() and b.isExpressionConstantRef():\n            if a.isMutable() or b.isMutable():\n                return True\n\n        return False\n\n    def onControlFlowEscape(self, node):\n        # TODO: One day, we should trace which nodes exactly cause a variable\n        # to be considered escaped, pylint: disable=unused-argument\n        for variable in self.variable_actives:\n            variable.onControlFlowEscape(self)\n\n    def removeKnowledge(self, node):\n        if node.isExpressionVariableRef():\n            node.variable.removeKnowledge(self)\n\n    def onValueEscapeStr(self, node):\n        # TODO: We can ignore these for now.\n        pass\n\n    def removeAllKnowledge(self):\n        for variable in self.variable_actives:\n            variable.removeAllKnowledge(self)\n\n    def onVariableSet(self, variable, version, assign_node):\n        variable_trace = ValueTraceAssign(\n            owner=self.owner,\n            assign_node=assign_node,\n            previous=self.getVariableCurrentTrace(variable),\n        )\n\n        self.addVariableTrace(variable, version, variable_trace)\n\n        # Make references point to it.\n        self.markCurrentVariableTrace(variable, version)\n\n        return variable_trace\n\n    def onVariableSetAliasing(self, variable, version, assign_node, source):\n        other_variable_trace = source.variable_trace\n\n        if other_variable_trace.__class__ is ValueTraceAssignUnescapable:\n            return self.onVariableSetToUnescapableValue(\n                variable=variable, version=version, assign_node=assign_node\n            )\n        elif other_variable_trace.__class__ is ValueTraceAssignVeryTrusted:\n            return self.onVariableSetToVeryTrustedValue(\n                variable=variable, version=version, assign_node=assign_node\n            )\n        else:\n            result = self.onVariableSet(\n                variable=variable, version=version, assign_node=assign_node\n            )\n\n            self.removeKnowledge(source)\n\n            return result\n\n    def onVariableSetToUnescapableValue(self, variable, version, assign_node):\n        variable_trace = ValueTraceAssignUnescapable(\n            owner=self.owner,\n            assign_node=assign_node,\n            previous=self.getVariableCurrentTrace(variable),\n        )\n\n        self.addVariableTrace(variable, version, variable_trace)\n\n        # Make references point to it.\n        self.markCurrentVariableTrace(variable, version)\n\n        return variable_trace\n\n    def onVariableSetToVeryTrustedValue(self, variable, version, assign_node):\n        variable_trace = ValueTraceAssignVeryTrusted(\n            owner=self.owner,\n            assign_node=assign_node,\n            previous=self.getVariableCurrentTrace(variable),\n        )\n\n        self.addVariableTrace(variable, version, variable_trace)\n\n        # Make references point to it.\n        self.markCurrentVariableTrace(variable, version)\n\n        return variable_trace\n\n    def onVariableSetToUnescapablePropagatedValue(\n        self, variable, version, assign_node, replacement\n    ):\n        variable_trace = ValueTraceAssignUnescapablePropagated(\n            owner=self.owner,\n            assign_node=assign_node,\n            previous=self.getVariableCurrentTrace(variable),\n            replacement=replacement,\n        )\n\n        self.addVariableTrace(variable, version, variable_trace)\n\n        # Make references point to it.\n        self.markCurrentVariableTrace(variable, version)\n\n        return variable_trace\n\n    def onVariableDel(self, variable, version, del_node):\n        # Add a new trace, allocating a new version for the variable, and\n        # remember the delete of the current\n        old_trace = self.getVariableCurrentTrace(variable)\n\n        # TODO: Annotate value content as escaped.\n\n        variable_trace = ValueTraceDeleted(\n            owner=self.owner, del_node=del_node, previous=old_trace\n        )\n\n        # Assign to not initialized again.\n        self.addVariableTrace(variable, version, variable_trace)\n\n        # Make references point to it.\n        self.markCurrentVariableTrace(variable, version)\n\n        return variable_trace\n\n    def onLocalsUsage(self, locals_scope):\n        self.onLocalsDictEscaped(locals_scope)\n\n        result = []\n\n        scope_locals_variables = locals_scope.getLocalsRelevantVariables()\n\n        for variable in self.variable_actives:\n            if variable.isLocalVariable() and variable in scope_locals_variables:\n                variable_trace = self.getVariableCurrentTrace(variable)\n\n                variable_trace.addNameUsage()\n                result.append((variable, variable_trace))\n\n        return result\n\n    def onVariableContentEscapes(self, variable):\n        self.markActiveVariableAsEscaped(variable)\n\n    def onExpression(self, expression, allow_none=False):\n        if expression is None and allow_none:\n            return None\n\n        parent = expression.parent\n        assert parent, expression\n\n        # Now compute this expression, allowing it to replace itself with\n        # something else as part of a local peep hole optimization.\n        new_node, change_tags, change_desc = expression.computeExpressionRaw(self)\n\n        if change_tags is not None:\n            # This is mostly for tracing and indication that a change occurred\n            # and it may be interesting to look again.\n            self.signalChange(change_tags, expression.getSourceReference(), change_desc)\n\n        if new_node is not expression:\n            parent.replaceChild(expression, new_node)\n\n        return new_node\n\n    def onStatement(self, statement):\n        try:\n            new_statement, change_tags, change_desc = statement.computeStatement(self)\n\n            # print new_statement, change_tags, change_desc\n            if new_statement is not statement:\n                self.signalChange(\n                    change_tags, statement.getSourceReference(), change_desc\n                )\n\n            return new_statement\n        except Exception:\n            printError(\n                \"Problem with statement at %s:\\n-> %s\"\n                % (\n                    statement.source_ref.getAsString(),\n                    readSourceLine(statement.source_ref),\n                )\n            )\n            raise\n\n    def computedStatementResult(self, statement, change_tags, change_desc):\n        \"\"\"Make sure the replacement statement is computed.\n\n        Use this when a replacement expression needs to be seen by the trace\n        collection and be computed, without causing any duplication, but where\n        otherwise there would be loss of annotated effects.\n\n        This may e.g. be true for nodes that need an initial run to know their\n        exception result and type shape.\n        \"\"\"\n        # Need to compute the replacement still.\n        new_statement = statement.computeStatement(self)\n\n        if new_statement[0] is not statement:\n            # Signal intermediate result as well.\n            self.signalChange(change_tags, statement.getSourceReference(), change_desc)\n\n            return new_statement\n        else:\n            return statement, change_tags, change_desc\n\n    def computedExpressionResult(self, expression, change_tags, change_desc):\n        \"\"\"Make sure the replacement expression is computed.\n\n        Use this when a replacement expression needs to be seen by the trace\n        collection and be computed, without causing any duplication, but where\n        otherwise there would be loss of annotated effects.\n\n        This may e.g. be true for nodes that need an initial run to know their\n        exception result and type shape.\n        \"\"\"\n\n        # Need to compute the replacement still.\n        new_expression = expression.computeExpression(self)\n\n        if new_expression[0] is not expression:\n            # Signal intermediate result as well.\n            self.signalChange(change_tags, expression.getSourceReference(), change_desc)\n\n            return new_expression\n        else:\n            return expression, change_tags, change_desc\n\n    def computedExpressionResultRaw(self, expression, change_tags, change_desc):\n        \"\"\"Make sure the replacement expression is computed.\n\n        Use this when a replacement expression needs to be seen by the trace\n        collection and be computed, without causing any duplication, but where\n        otherwise there would be loss of annotated effects.\n\n        This may e.g. be true for nodes that need an initial run to know their\n        exception result and type shape.\n\n        This is for raw, i.e. subnodes are not yet computed automatically.\n        \"\"\"\n\n        # Need to compute the replacement still.\n        new_expression = expression.computeExpressionRaw(self)\n\n        if new_expression[0] is not expression:\n            # Signal intermediate result as well.\n            self.signalChange(change_tags, expression.getSourceReference(), change_desc)\n\n            return new_expression\n        else:\n            return expression, change_tags, change_desc\n\n    def mergeBranches(self, collection_yes, collection_no):\n        \"\"\"Merge two alternative branches into this trace.\n\n        This is mostly for merging conditional branches, or other ways\n        of having alternative control flow. This deals with up to two\n        alternative branches to both change this collection.\n        \"\"\"\n\n        # Many branches due to inlining the actual merge and preparing it\n        # pylint: disable=too-many-branches\n\n        if collection_yes is None:\n            if collection_no is not None:\n                # Handle one branch case, we need to merge versions backwards as\n                # they may make themselves obsolete.\n                collection1 = self\n                collection2 = collection_no\n            else:\n                # Refuse to do stupid work\n                return\n        elif collection_no is None:\n            # Handle one branch case, we need to merge versions backwards as\n            # they may make themselves obsolete.\n            collection1 = self\n            collection2 = collection_yes\n        else:\n            # Handle two branch case, they may or may not do the same things.\n            collection1 = collection_yes\n            collection2 = collection_no\n\n        variable_versions = {}\n\n        for variable, version in iterItems(collection1.variable_actives):\n            variable_versions[variable] = version\n\n        for variable, version in iterItems(collection2.variable_actives):\n            if variable not in variable_versions:\n                if version != 0:\n                    variable_versions[variable] = 0, version\n                else:\n                    variable_versions[variable] = 0\n            else:\n                other = variable_versions[variable]\n\n                if other != version:\n                    variable_versions[variable] = other, version\n\n        # That would not be fast, pylint: disable=consider-using-dict-items\n        for variable in variable_versions:\n            if variable not in collection2.variable_actives:\n                if variable_versions[variable] != 0:\n                    variable_versions[variable] = variable_versions[variable], 0\n\n        self.variable_actives = {}\n\n        for variable, versions in iterItems(variable_versions):\n            if type(versions) is tuple:\n                trace1 = self.getVariableTrace(variable, versions[0])\n                trace2 = self.getVariableTrace(variable, versions[1])\n\n                if trace1.isEscapeTrace() and trace1.previous is trace2:\n                    version = versions[0]\n                elif trace2.isEscapeTrace() and trace2.previous is trace1:\n                    version = versions[1]\n                else:\n                    version = self.addVariableMergeMultipleTrace(\n                        variable=variable,\n                        traces=(\n                            trace1,\n                            trace2,\n                        ),\n                    )\n            else:\n                version = versions\n\n            self.markCurrentVariableTrace(variable, version)\n\n    def mergeMultipleBranches(self, collections):\n        # This one is really complex, pylint: disable=too-many-branches\n\n        assert collections\n\n        # Optimize for length 1, which is trivial merge and needs not a\n        # lot of work, and length 2 has dedicated code as it's so frequent.\n        merge_size = len(collections)\n\n        if merge_size == 1:\n            self.replaceBranch(collections[0])\n            return\n        elif merge_size == 2:\n            return self.mergeBranches(*collections)\n\n        # print(\"Enter mergeMultipleBranches\", len(collections))\n        with TimerReport(\n            message=\"Running merge for %s took %%.2f seconds\" % collections,\n            decider=False,\n        ):\n            variable_versions = defaultdict(OrderedSet)\n\n            for collection in collections:\n                for variable, version in iterItems(collection.variable_actives):\n                    variable_versions[variable].add(version)\n\n            for collection in collections:\n                for variable, versions in iterItems(variable_versions):\n                    if variable not in collection.variable_actives:\n                        versions.add(0)\n\n            self.variable_actives = {}\n\n            for variable, versions in iterItems(variable_versions):\n                if len(versions) == 1:\n                    (version,) = versions\n                else:\n                    traces = []\n                    escaped = []\n                    winner_version = None\n\n                    for version in versions:\n                        trace = self.getVariableTrace(variable, version)\n\n                        if trace.isEscapeTrace():\n                            winner_version = version\n                            escaped_trace = trace.previous\n\n                            if escaped_trace in traces:\n                                traces.remove(trace.previous)\n\n                            escaped.append(escaped)\n                            traces.append(trace)\n                        else:\n                            if trace not in escaped:\n                                traces.append(trace)\n\n                    if len(traces) == 1:\n                        version = winner_version\n                        assert winner_version is not None\n                    else:\n                        version = self.addVariableMergeMultipleTrace(\n                            variable=variable, traces=tuple(traces)\n                        )\n\n                self.markCurrentVariableTrace(variable, version)\n\n            # print(\"Leave mergeMultipleBranches\", len(collections))\n\n    def replaceBranch(self, collection_replace):\n        self.variable_actives.update(collection_replace.variable_actives)\n        collection_replace.variable_actives = None\n\n    def onLoopBreak(self, collection=None):\n        if collection is None:\n            collection = self\n\n        return self.parent.onLoopBreak(collection)\n\n    def onLoopContinue(self, collection=None):\n        if collection is None:\n            collection = self\n\n        return self.parent.onLoopContinue(collection)\n\n    def onFunctionReturn(self, collection=None):\n        if collection is None:\n            collection = self\n\n        return self.parent.onFunctionReturn(collection)\n\n    def onExceptionRaiseExit(self, raisable_exceptions, collection=None):\n        if collection is None:\n            collection = self\n\n        return self.parent.onExceptionRaiseExit(raisable_exceptions, collection)\n\n    def getLoopBreakCollections(self):\n        return self.parent.getLoopBreakCollections()\n\n    def getLoopContinueCollections(self):\n        return self.parent.getLoopContinueCollections()\n\n    def getFunctionReturnCollections(self):\n        return self.parent.getFunctionReturnCollections()\n\n    def getExceptionRaiseCollections(self):\n        return self.parent.getExceptionRaiseCollections()\n\n    def makeAbortStackContext(\n        self, catch_breaks, catch_continues, catch_returns, catch_exceptions\n    ):\n        return self.parent.makeAbortStackContext(\n            catch_breaks=catch_breaks,\n            catch_continues=catch_continues,\n            catch_returns=catch_returns,\n            catch_exceptions=catch_exceptions,\n        )\n\n    def onLocalsDictEscaped(self, locals_scope):\n        self.parent.onLocalsDictEscaped(locals_scope)\n\n    def getCompileTimeComputationResult(\n        self, node, computation, description, user_provided=False\n    ):\n        new_node, change_tags, message = getComputationResult(\n            node=node,\n            computation=computation,\n            description=description,\n            user_provided=user_provided,\n        )\n\n        if change_tags == \"new_raise\":\n            self.onExceptionRaiseExit(BaseException)\n\n        return new_node, change_tags, message\n\n    def addOutlineFunction(self, outline):\n        self.parent.addOutlineFunction(outline)\n\n    def getVeryTrustedModuleVariables(self):\n        return self.parent.getVeryTrustedModuleVariables()\n\n    def onUsedFunction(self, function_body):\n        return self.parent.onUsedFunction(function_body)\n\n    def onModuleUsageAttempt(self, module_usage_attempt):\n        self.parent.onModuleUsageAttempt(module_usage_attempt)\n\n    def onDistributionUsed(self, distribution_name, node, success):\n        self.parent.onDistributionUsed(\n            distribution_name=distribution_name, node=node, success=success\n        )\n\n\nclass TraceCollectionBranch(CollectionUpdateMixin, TraceCollectionBase):\n    __slots__ = (\"variable_traces\",)\n\n    def __init__(self, name, parent):\n        TraceCollectionBase.__init__(self, owner=parent.owner, name=name, parent=parent)\n\n        # Detach from others\n        self.variable_actives = dict(parent.variable_actives)\n\n        # For quick access without going to parent.\n        self.variable_traces = parent.variable_traces\n\n    def computeBranch(self, branch):\n        assert branch.isStatementsSequence()\n\n        result = branch.computeStatementsSequence(self)\n\n        if result is not branch:\n            branch.parent.replaceChild(branch, result)\n\n        return result\n\n    def initVariable(self, variable):\n        variable_trace = self.parent.initVariable(variable)\n\n        self.variable_actives[variable] = 0\n\n        return variable_trace\n\n\nclass TraceCollectionFunction(CollectionStartPointMixin, TraceCollectionBase):\n    __slots__ = (\n        \"variable_versions\",\n        \"variable_traces\",\n        \"break_collections\",\n        \"continue_collections\",\n        \"return_collections\",\n        \"exception_collections\",\n        \"outline_functions\",\n        \"very_trusted_module_variables\",\n    )\n\n    def __init__(self, parent, function_body):\n        assert (\n            function_body.isExpressionFunctionBody()\n            or function_body.isExpressionGeneratorObjectBody()\n            or function_body.isExpressionCoroutineObjectBody()\n            or function_body.isExpressionAsyncgenObjectBody()\n        ), function_body\n\n        CollectionStartPointMixin.__init__(self)\n\n        TraceCollectionBase.__init__(\n            self,\n            owner=function_body,\n            name=\"collection_\" + function_body.getCodeName(),\n            parent=parent,\n        )\n\n        if parent is not None:\n            self.very_trusted_module_variables = parent.getVeryTrustedModuleVariables()\n        else:\n            self.very_trusted_module_variables = ()\n\n        if function_body.isExpressionFunctionBody():\n            parameters = function_body.getParameters()\n\n            for parameter_variable in parameters.getTopLevelVariables():\n                self.initVariableInit(parameter_variable)\n                self.variable_actives[parameter_variable] = 0\n\n            list_star_variable = parameters.getListStarArgVariable()\n            if list_star_variable is not None:\n                self.initVariableInitStarArgs(list_star_variable)\n                self.variable_actives[list_star_variable] = 0\n\n            dict_star_variable = parameters.getDictStarArgVariable()\n            if dict_star_variable is not None:\n                self.initVariableInitStarDict(dict_star_variable)\n                self.variable_actives[dict_star_variable] = 0\n\n        for closure_variable in function_body.getClosureVariables():\n            self.initVariableUnknown(closure_variable)\n            self.variable_actives[closure_variable] = 0\n\n        # TODO: Have special function type for exec functions stuff.\n        locals_scope = function_body.getLocalsScope()\n\n        if locals_scope is not None:\n            if not locals_scope.isMarkedForPropagation():\n                for locals_dict_variable in locals_scope.variables.values():\n                    self.initVariableUninitialized(locals_dict_variable)\n            else:\n                function_body.locals_scope = None\n\n    def initVariableModule(self, variable):\n        trusted_node = self.very_trusted_module_variables.get(variable)\n\n        if trusted_node is None:\n            return CollectionStartPointMixin.initVariableModule(self, variable)\n\n        assign_trace = ValueTraceAssignVeryTrusted(\n            self.owner, assign_node=trusted_node.getParent(), previous=None\n        )\n\n        # This is rare enough to not need a more optimized code.\n        self.addVariableTrace(variable, 0, assign_trace)\n        self.markActiveVariableAsEscaped(variable)\n\n        return self.getVariableCurrentTrace(variable)\n\n\nclass TraceCollectionPureFunction(TraceCollectionFunction):\n    \"\"\"Pure functions don't feed their parent.\"\"\"\n\n    __slots__ = (\"used_functions\",)\n\n    def __init__(self, function_body):\n        TraceCollectionFunction.__init__(self, parent=None, function_body=function_body)\n\n        self.used_functions = OrderedSet()\n\n    def getUsedFunctions(self):\n        return self.used_functions\n\n    def onUsedFunction(self, function_body):\n        self.used_functions.add(function_body)\n\n        TraceCollectionFunction.onUsedFunction(self, function_body=function_body)\n\n\nclass TraceCollectionModule(CollectionStartPointMixin, TraceCollectionBase):\n    __slots__ = (\n        \"variable_versions\",\n        \"variable_traces\",\n        \"break_collections\",\n        \"continue_collections\",\n        \"return_collections\",\n        \"exception_collections\",\n        \"outline_functions\",\n        \"very_trusted_module_variables\",\n        \"module_usage_attempts\",\n        \"distribution_names\",\n    )\n\n    def __init__(self, module, very_trusted_module_variables):\n        assert module.isCompiledPythonModule(), module\n\n        CollectionStartPointMixin.__init__(self)\n\n        TraceCollectionBase.__init__(\n            self, owner=module, name=\"module:\" + module.getFullName(), parent=None\n        )\n\n        self.very_trusted_module_variables = very_trusted_module_variables\n\n        # Attempts to use a module in this module.\n        self.module_usage_attempts = OrderedSet()\n\n        # Attempts to use a distribution in this module.\n        self.distribution_names = OrderedDict()\n\n    def getVeryTrustedModuleVariables(self):\n        return self.very_trusted_module_variables\n\n    def updateVeryTrustedModuleVariables(self, very_trusted_module_variables):\n        result = self.very_trusted_module_variables != very_trusted_module_variables\n\n        self.very_trusted_module_variables = very_trusted_module_variables\n\n        return result\n\n    def getModuleUsageAttempts(self):\n        return self.module_usage_attempts\n\n    def onModuleUsageAttempt(self, module_usage_attempt):\n        if module_usage_attempt.finding != \"not-found\":\n            decision, _reason = decideRecursion(\n                using_module_name=self.owner.getFullName(),\n                module_name=module_usage_attempt.module_name,\n                module_filename=module_usage_attempt.filename,\n                module_kind=module_usage_attempt.module_kind,\n            )\n\n            # When sub-package module import is rejected for whatever reason,\n            # still this implies an attempt of the parent, because nothing else\n            # will do it otherwise, it of course may also be rejected, but if it\n            # is not, otherwise it will be missing.\n            #\n            # A common case of this happening are extension modules in\n            # accelerated mode, for standalone this will of course be rare.\n            if decision is False:\n                parent_package_name = module_usage_attempt.module_name.getPackageName()\n\n                if parent_package_name is not None:\n                    (\n                        package_module_name,\n                        module_filename,\n                        module_kind,\n                        finding,\n                    ) = locateModule(\n                        module_name=parent_package_name,\n                        parent_package=None,\n                        level=0,\n                    )\n\n                    # Should not be possible to happen.\n                    assert finding != \"not-found\", package_module_name\n\n                    decision, _reason = decideRecursion(\n                        using_module_name=self.owner.getFullName(),\n                        module_name=package_module_name,\n                        module_filename=module_filename,\n                        module_kind=module_kind,\n                    )\n\n                    if decision is True:\n                        self.onModuleUsageAttempt(\n                            makeModuleUsageAttempt(\n                                module_name=package_module_name,\n                                filename=module_filename,\n                                finding=finding,\n                                module_kind=module_kind,\n                                level=0,\n                                source_ref=module_usage_attempt.source_ref,\n                                reason=\"parent import\",\n                            )\n                        )\n\n        self.module_usage_attempts.add(module_usage_attempt)\n\n    def getUsedDistributions(self):\n        return self.distribution_names\n\n    def onDistributionUsed(self, distribution_name, node, success):\n        inclusion_logger.info_to_file_only(\n            \"Cannot find distribution '%s' at '%s', expect potential run time problem, unless this is unused code.\"\n            % (distribution_name, node.source_ref.getAsString())\n        )\n\n        self.distribution_names[distribution_name] = success\n\n\n# TODO: This should not exist, but be part of decision at the time these are collected.\ndef areEmptyTraces(variable_traces):\n    \"\"\"Do these traces contain any writes or accesses.\"\"\"\n    # Many cases immediately return, that is how we do it here,\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    for variable_trace in variable_traces:\n        if variable_trace.isAssignTrace():\n            return False\n        elif variable_trace.isInitTrace():\n            return False\n        elif variable_trace.isDeletedTrace():\n            # A \"del\" statement can do this, and needs to prevent variable\n            # from being removed.\n\n            return False\n        elif variable_trace.isUninitializedTrace():\n            if variable_trace.getUsageCount():\n                # Checking definite is enough, the merges, we shall see\n                # them as well.\n                return False\n        elif variable_trace.isUnknownTrace():\n            if variable_trace.getUsageCount():\n                # Checking definite is enough, the merges, we shall see\n                # them as well.\n                return False\n        elif variable_trace.isEscapeTrace():\n            if variable_trace.getUsageCount():\n                # Checking definite is enough, the merges, we shall see\n                # them as well.\n                return False\n        elif variable_trace.isMergeTrace():\n            if variable_trace.getUsageCount():\n                # Checking definite is enough, the merges, we shall see\n                # them as well.\n                return False\n        elif variable_trace.isLoopTrace():\n            return False\n        else:\n            assert False, variable_trace\n\n    return True\n\n\ndef areReadOnlyTraces(variable_traces):\n    \"\"\"Do these traces contain any writes.\"\"\"\n\n    # Many cases immediately return, that is how we do it here,\n    for variable_trace in variable_traces:\n        if variable_trace.isAssignTrace():\n            return False\n        elif variable_trace.isInitTrace():\n            pass\n        elif variable_trace.isDeletedTrace():\n            # A \"del\" statement can do this, and needs to prevent variable\n            # from being not released.\n\n            return False\n        elif variable_trace.isUninitializedTrace():\n            pass\n        elif variable_trace.isUnknownTrace():\n            return False\n        elif variable_trace.isEscapeTrace():\n            pass\n        elif variable_trace.isMergeTrace():\n            pass\n        elif variable_trace.isLoopTrace():\n            pass\n        else:\n            assert False, variable_trace\n\n    return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/ValueTraces.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Value trace objects.\n\nValue traces indicate the flow of values and merges their versions for\nthe SSA (Single State Assignment) form being used in Nuitka.\n\nValues can be seen as:\n\n* Unknown (maybe initialized, maybe not, we cannot know)\n* Uninitialized (definitely not initialized, first version)\n* Init (definitely initialized, e.g. parameter variables)\n* Assign (assignment was done)\n* Deleted (del was done, now unassigned, uninitialized)\n* Merge (result of diverged code paths, loop potentially)\n* LoopIncomplete (aggregation during loops, not yet fully known)\n* LoopComplete (complete knowledge of loop types)\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_dict,\n    tshape_list,\n    tshape_str,\n    tshape_tuple,\n    tshape_unicode,\n)\nfrom nuitka.nodes.shapes.ControlFlowDescriptions import (\n    ControlFlowDescriptionElementBasedEscape,\n    ControlFlowDescriptionFullEscape,\n    ControlFlowDescriptionNoEscape,\n)\nfrom nuitka.nodes.shapes.StandardShapes import (\n    ShapeLoopCompleteAlternative,\n    ShapeLoopInitialAlternative,\n    tshape_uninitialized,\n    tshape_unknown,\n)\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\n\n\nclass ValueTraceBase(object):\n    # We are going to have many instance attributes, but should strive to minimize, as\n    # there is going to be a lot of fluctuation in these objects.\n\n    __slots__ = (\n        \"owner\",\n        \"usage_count\",\n        \"name_usage_count\",\n        \"merge_usage_count\",\n        \"closure_usages\",\n        \"previous\",\n    )\n\n    @counted_init\n    def __init__(self, owner, previous):\n        self.owner = owner\n\n        # Definite usage indicator.\n        self.usage_count = 0\n\n        # If 0, this indicates, the variable name needs to be assigned as name.\n        self.name_usage_count = 0\n\n        # If 0, this indicates no value merges happened on the value.\n        self.merge_usage_count = 0\n\n        self.closure_usages = False\n\n        # Previous trace this is replacing.\n        self.previous = previous\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def __repr__(self):\n        return \"<%s of %s>\" % (self.__class__.__name__, self.owner.getCodeName())\n\n    def dump(self, indent=\"  \"):\n        my_print(\"%s%s %s:\" % (indent, self.__class__.__name__, id(self)))\n\n        if type(self.previous) is tuple:\n            for trace in self.previous:\n                trace.dump(indent + \"  \")\n        elif self.previous is not None:\n            self.previous.dump(indent + \"  \")\n\n    def getOwner(self):\n        return self.owner\n\n    @staticmethod\n    def isLoopTrace():\n        return False\n\n    def addUsage(self):\n        self.usage_count += 1\n\n    def addNameUsage(self):\n        self.usage_count += 1\n        self.name_usage_count += 1\n\n        if self.name_usage_count <= 2 and self.previous is not None:\n            self.previous.addNameUsage()\n\n    def addMergeUsage(self):\n        self.usage_count += 1\n        self.merge_usage_count += 1\n\n    def getUsageCount(self):\n        return self.usage_count\n\n    def getNameUsageCount(self):\n        return self.name_usage_count\n\n    def getMergeUsageCount(self):\n        return self.merge_usage_count\n\n    def getMergeOrNameUsageCount(self):\n        return self.merge_usage_count + self.name_usage_count\n\n    def getPrevious(self):\n        return self.previous\n\n    @staticmethod\n    def isAssignTrace():\n        return False\n\n    @staticmethod\n    def isUnassignedTrace():\n        return False\n\n    @staticmethod\n    def isDeletedTrace():\n        return False\n\n    @staticmethod\n    def isUninitializedTrace():\n        return False\n\n    @staticmethod\n    def isInitTrace():\n        return False\n\n    @staticmethod\n    def isUnknownTrace():\n        return False\n\n    @staticmethod\n    def isAssignTraceVeryTrusted():\n        return False\n\n    @staticmethod\n    def isUnknownOrVeryTrustedTrace():\n        return False\n\n    @staticmethod\n    def isEscapeTrace():\n        return False\n\n    @staticmethod\n    def isTraceThatNeedsEscape():\n        return True\n\n    @staticmethod\n    def isMergeTrace():\n        return False\n\n    def mustHaveValue(self):\n        \"\"\"Will this definitely have a value.\n\n        Every trace has this overloaded.\n        \"\"\"\n        assert False, self\n\n    def mustNotHaveValue(self):\n        \"\"\"Will this definitely have a value.\n\n        Every trace has this overloaded.\n        \"\"\"\n        assert False, self\n\n    def getReplacementNode(self, usage):\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n\n        return None\n\n    @staticmethod\n    def hasShapeListExact():\n        return False\n\n    @staticmethod\n    def hasShapeDictionaryExact():\n        return False\n\n    @staticmethod\n    def hasShapeStrExact():\n        return False\n\n    @staticmethod\n    def hasShapeUnicodeExact():\n        return False\n\n    @staticmethod\n    def hasShapeTupleExact():\n        return False\n\n    @staticmethod\n    def hasShapeBoolExact():\n        return False\n\n    @staticmethod\n    def getTruthValue():\n        return None\n\n    @staticmethod\n    def getComparisonValue():\n        return False, None\n\n    @staticmethod\n    def getAttributeNode():\n        \"\"\"Node to use for attribute lookups.\"\"\"\n        return None\n\n    @staticmethod\n    def getAttributeNodeTrusted():\n        \"\"\"Node to use for attribute lookups, with increased trust.\n\n        Used with hard imports mainly.\n        \"\"\"\n        return None\n\n    @staticmethod\n    def getAttributeNodeVeryTrusted():\n        \"\"\"Node to use for attribute lookups, with highest trust.\n\n        Used for hard imports mainly.\n        \"\"\"\n        return None\n\n    @staticmethod\n    def getIterationSourceNode():\n        \"\"\"Node to use for iteration decisions.\"\"\"\n        return None\n\n    @staticmethod\n    def getDictInValue(key):\n        \"\"\"Value to use for dict in decisions.\"\"\"\n\n        # virtual method, pylint: disable=unused-argument\n        return None\n\n    @staticmethod\n    def inhibitsClassScopeForwardPropagation():\n        return True\n\n\nclass ValueTraceUnassignedBase(ValueTraceBase):\n    __slots__ = ()\n\n    @staticmethod\n    def isUnassignedTrace():\n        return True\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_uninitialized\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionNoEscape\n\n    def compareValueTrace(self, other):\n        # We are unassigned, just need to know if the other one is, pylint: disable=no-self-use\n        return other.isUnassignedTrace()\n\n    @staticmethod\n    def mustHaveValue():\n        return False\n\n    @staticmethod\n    def mustNotHaveValue():\n        return True\n\n\nclass ValueTraceUninitialized(ValueTraceUnassignedBase):\n    __slots__ = ()\n\n    def __init__(self, owner, previous):\n        ValueTraceUnassignedBase.__init__(self, owner=owner, previous=previous)\n\n    @staticmethod\n    def isUninitializedTrace():\n        return True\n\n    @staticmethod\n    def isTraceThatNeedsEscape():\n        return False\n\n    def inhibitsClassScopeForwardPropagation(self):\n        return False\n\n\nclass ValueTraceDeleted(ValueTraceUnassignedBase):\n    \"\"\"Trace caused by a deletion.\"\"\"\n\n    __slots__ = (\"del_node\",)\n\n    def __init__(self, owner, previous, del_node):\n        ValueTraceUnassignedBase.__init__(self, owner=owner, previous=previous)\n\n        self.del_node = del_node\n\n    @staticmethod\n    def isDeletedTrace():\n        return True\n\n    def getDelNode(self):\n        return self.del_node\n\n\nclass ValueTraceInit(ValueTraceBase):\n    __slots__ = ()\n\n    def __init__(self, owner):\n        ValueTraceBase.__init__(self, owner=owner, previous=None)\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unknown\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionFullEscape\n\n    def compareValueTrace(self, other):\n        # We are initialized, just need to know if the other one is, pylint: disable=no-self-use\n        return other.isInitTrace()\n\n    @staticmethod\n    def isInitTrace():\n        return True\n\n    @staticmethod\n    def mustHaveValue():\n        return True\n\n    @staticmethod\n    def mustNotHaveValue():\n        return False\n\n\nclass ValueTraceInitStarArgs(ValueTraceInit):\n    @staticmethod\n    def getTypeShape():\n        return tshape_tuple\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionElementBasedEscape\n\n    @staticmethod\n    def hasShapeTupleExact():\n        return True\n\n\nclass ValueTraceInitStarDict(ValueTraceInit):\n    @staticmethod\n    def getTypeShape():\n        return tshape_dict\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionElementBasedEscape\n\n    @staticmethod\n    def hasShapeDictionaryExact():\n        return True\n\n\nclass ValueTraceUnknown(ValueTraceBase):\n    __slots__ = ()\n\n    @staticmethod\n    def getTypeShape():\n        return tshape_unknown\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionFullEscape\n\n    def addUsage(self):\n        self.usage_count += 1\n\n        if self.previous:\n            self.previous.addUsage()\n\n    def addMergeUsage(self):\n        self.usage_count += 1\n        self.merge_usage_count += 1\n\n        if self.previous:\n            self.previous.addMergeUsage()\n\n    def compareValueTrace(self, other):\n        # We are unknown, just need to know if the other one is, pylint: disable=no-self-use\n        return other.isUnknownTrace()\n\n    @staticmethod\n    def isUnknownTrace():\n        return True\n\n    @staticmethod\n    def isUnknownOrVeryTrustedTrace():\n        return True\n\n    @staticmethod\n    def isTraceThatNeedsEscape():\n        return False\n\n    @staticmethod\n    def mustHaveValue():\n        return False\n\n    @staticmethod\n    def mustNotHaveValue():\n        return False\n\n    def getAttributeNode(self):\n        # TODO: Differentiate unknown with not previous node from ones with for performance and\n        # clarity.\n        if self.previous is not None:\n            return self.previous.getAttributeNodeVeryTrusted()\n\n    def getAttributeNodeTrusted(self):\n        if self.previous is not None:\n            return self.previous.getAttributeNodeVeryTrusted()\n\n    def getAttributeNodeVeryTrusted(self):\n        if self.previous is not None:\n            return self.previous.getAttributeNodeVeryTrusted()\n\n\nclass ValueTraceEscaped(ValueTraceUnknown):\n    __slots__ = ()\n\n    def __init__(self, owner, previous):\n        if previous.isMergeTrace():\n            assert self not in previous.previous\n\n        ValueTraceUnknown.__init__(self, owner=owner, previous=previous)\n\n    def addUsage(self):\n        self.usage_count += 1\n\n        # The previous must be prevented from optimization if still used afterwards.\n        if self.usage_count <= 2:\n            self.previous.addNameUsage()\n\n    def addMergeUsage(self):\n        self.usage_count += 1\n        if self.usage_count <= 2:\n            self.previous.addNameUsage()\n\n        self.merge_usage_count += 1\n        if self.merge_usage_count <= 2:\n            self.previous.addMergeUsage()\n\n    def getTypeShape(self):\n        return self.previous.getTypeShape()\n\n    def mustHaveValue(self):\n        return self.previous.mustHaveValue()\n\n    def mustNotHaveValue(self):\n        return self.previous.mustNotHaveValue()\n\n    def getReplacementNode(self, usage):\n        return self.previous.getReplacementNode(usage)\n\n    @staticmethod\n    def isUnknownTrace():\n        return False\n\n    @staticmethod\n    def isUnknownOrVeryTrustedTrace():\n        return False\n\n    @staticmethod\n    def isEscapeTrace():\n        return True\n\n    @staticmethod\n    def isTraceThatNeedsEscape():\n        return False\n\n    def getAttributeNode(self):\n        return self.previous.getAttributeNodeTrusted()\n\n    def getAttributeNodeTrusted(self):\n        return self.previous.getAttributeNodeTrusted()\n\n    def getAttributeNodeVeryTrusted(self):\n        return self.previous.getAttributeNodeVeryTrusted()\n\n    # For escaped values, these do not have to forget their shape, the mutable ones\n    # and the only ones affected.\n    def hasShapeListExact(self):\n        trusted_node = self.previous.getAttributeNodeTrusted()\n        return trusted_node is not None and trusted_node.hasShapeListExact()\n\n    def hasShapeDictionaryExact(self):\n        trusted_node = self.previous.getAttributeNodeTrusted()\n        return trusted_node is not None and trusted_node.hasShapeDictionaryExact()\n\n\nclass ValueTraceAssign(ValueTraceBase):\n    __slots__ = (\"assign_node\",)\n\n    def __init__(self, owner, assign_node, previous):\n        ValueTraceBase.__init__(self, owner=owner, previous=previous)\n\n        self.assign_node = assign_node\n\n    def __repr__(self):\n        return \"<%s at %s of %s>\" % (\n            self.__class__.__name__,\n            self.assign_node.getSourceReference().getAsString(),\n            self.assign_node.subnode_source,\n        )\n\n    @staticmethod\n    def isAssignTrace():\n        return True\n\n    def compareValueTrace(self, other):\n        return other.isAssignTrace() and self.assign_node is other.assign_node\n\n    @staticmethod\n    def mustHaveValue():\n        return True\n\n    @staticmethod\n    def mustNotHaveValue():\n        return False\n\n    def getTypeShape(self):\n        return self.assign_node.getTypeShape()\n\n    def getReleaseEscape(self):\n        return self.assign_node.getReleaseEscape()\n\n    def getAssignNode(self):\n        return self.assign_node\n\n    def hasShapeListExact(self):\n        return self.assign_node.subnode_source.hasShapeListExact()\n\n    def hasShapeDictionaryExact(self):\n        return self.assign_node.subnode_source.hasShapeDictionaryExact()\n\n    def hasShapeStrExact(self):\n        return self.assign_node.subnode_source.hasShapeStrExact()\n\n    def hasShapeUnicodeExact(self):\n        return self.assign_node.subnode_source.hasShapeUnicodeExact()\n\n    def hasShapeBoolExact(self):\n        return self.assign_node.subnode_source.hasShapeBoolExact()\n\n    def getTruthValue(self):\n        return self.assign_node.subnode_source.getTruthValue()\n\n    def getComparisonValue(self):\n        return self.assign_node.subnode_source.getComparisonValue()\n\n    def getAttributeNode(self):\n        return self.assign_node.subnode_source\n\n    def getAttributeNodeTrusted(self):\n        source_node = self.assign_node.subnode_source\n\n        if source_node.hasShapeTrustedAttributes():\n            return source_node\n        else:\n            return None\n\n    def getAttributeNodeVeryTrusted(self):\n        # Hard imports typically.\n        if self.assign_node.hasVeryTrustedValue():\n            return self.assign_node.subnode_source\n        else:\n            return None\n\n    def getIterationSourceNode(self):\n        return self.assign_node.subnode_source\n\n    def getDictInValue(self, key):\n        \"\"\"Value to use for dict in decisions.\"\"\"\n        return self.assign_node.subnode_source.getExpressionDictInConstant(key)\n\n    def inhibitsClassScopeForwardPropagation(self):\n        return self.assign_node.subnode_source.mayHaveSideEffects()\n\n\nclass ValueTraceAssignUnescapable(ValueTraceAssign):\n    @staticmethod\n    def isTraceThatNeedsEscape():\n        return False\n\n\nclass ValueTraceAssignVeryTrusted(ValueTraceAssignUnescapable):\n    @staticmethod\n    def isAssignTraceVeryTrusted():\n        return True\n\n    @staticmethod\n    def isUnknownOrVeryTrustedTrace():\n        return True\n\n\nclass ValueTraceAssignUnescapablePropagated(ValueTraceAssignUnescapable):\n    \"\"\"Assignment from value where it is not that escaping doesn't matter.\"\"\"\n\n    __slots__ = (\"replacement\",)\n\n    def __init__(self, owner, assign_node, previous, replacement):\n        ValueTraceAssignUnescapable.__init__(\n            self, owner=owner, assign_node=assign_node, previous=previous\n        )\n\n        self.replacement = replacement\n\n    def getReplacementNode(self, usage):\n        return self.replacement(usage)\n\n\nclass ValueTraceMergeBase(ValueTraceBase):\n    \"\"\"Merge of two or more traces or start of loops.\"\"\"\n\n    __slots__ = ()\n\n    def addNameUsage(self):\n        self.usage_count += 1\n        self.name_usage_count += 1\n\n        if self.name_usage_count <= 2 and self.previous is not None:\n            for previous in self.previous:\n                previous.addNameUsage()\n\n    def addUsage(self):\n        self.usage_count += 1\n\n        # Only do it once.\n        if self.usage_count == 1:\n            for trace in self.previous:\n                trace.addMergeUsage()\n\n    def addMergeUsage(self):\n        self.addUsage()\n        self.merge_usage_count += 1\n\n\nclass ValueTraceMerge(ValueTraceMergeBase):\n    \"\"\"Merge of two or more traces.\n\n    Happens at the end of conditional blocks. This is \"phi\" in\n    SSA theory. Also used for merging multiple \"return\", \"break\" or\n    \"continue\" exits.\n    \"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, traces):\n        shorted = []\n\n        for trace in traces:\n            if type(trace) is ValueTraceMerge:\n                for trace2 in trace.previous:\n                    if trace2 not in shorted:\n                        shorted.append(trace2)\n            else:\n                if trace not in shorted:\n                    shorted.append(trace)\n\n        traces = tuple(shorted)\n\n        assert len(traces) > 1\n\n        # assert len(set(traces)) == len(traces), [(v) for v in traces]\n\n        ValueTraceMergeBase.__init__(self, owner=traces[0].owner, previous=traces)\n\n    def __repr__(self):\n        return \"<ValueTraceMerge of {previous}>\".format(previous=self.previous)\n\n    def getTypeShape(self):\n        type_shape_found = None\n\n        for trace in self.previous:\n            type_shape = trace.getTypeShape()\n\n            if type_shape is tshape_unknown:\n                return tshape_unknown\n\n            if type_shape_found is None:\n                type_shape_found = type_shape\n            elif type_shape is not type_shape_found:\n                # TODO: Find the lowest common denominator.\n                return tshape_unknown\n\n        return type_shape_found\n\n    def getReleaseEscape(self):\n        release_escape_found = None\n\n        for trace in self.previous:\n            release_escape = trace.getReleaseEscape()\n\n            if release_escape is ControlFlowDescriptionFullEscape:\n                return ControlFlowDescriptionFullEscape\n\n            if release_escape_found is None:\n                release_escape_found = release_escape\n            elif release_escape is not release_escape_found:\n                # TODO: Find the lowest common denominator.\n                return ControlFlowDescriptionFullEscape\n\n        return release_escape_found\n\n    @staticmethod\n    def isMergeTrace():\n        return True\n\n    def compareValueTrace(self, other):\n        if not other.isMergeTrace():\n            return False\n\n        if len(self.previous) != len(other.previous):\n            return False\n\n        for a, b in zip(self.previous, other.previous):\n            if not a.compareValueTrace(b):\n                return False\n\n        return True\n\n    def mustHaveValue(self):\n        for previous in self.previous:\n            if not previous.isInitTrace() and not previous.isAssignTrace():\n                return False\n\n        return True\n\n    def mustNotHaveValue(self):\n        for previous in self.previous:\n            if not previous.mustNotHaveValue():\n                return False\n\n        return True\n\n    def hasShapeListExact(self):\n        return all(previous.hasShapeListExact() for previous in self.previous)\n\n    def hasShapeDictionaryExact(self):\n        return all(previous.hasShapeDictionaryExact() for previous in self.previous)\n\n    def getTruthValue(self):\n        any_false = False\n        any_true = False\n\n        for previous in self.previous:\n            truth_value = previous.getTruthValue()\n\n            # One unknown kills it.\n            if truth_value is None:\n                return None\n            elif truth_value is True:\n                # True and false values resembled unknown.\n                if any_false:\n                    return None\n                any_true = True\n            else:\n                # True and false values resembled unknown.\n                if any_true:\n                    return None\n                any_false = True\n\n        # Now all agreed and were not unknown, so we can conclude all false or all true.\n        return any_true\n\n    def getComparisonValue(self):\n        # TODO: Support multiple values as candidates, e.g. both 1, 3 could be compared to 2, for\n        # now we are delaying that.\n        return False, None\n\n\nclass ValueTraceLoopBase(ValueTraceMergeBase):\n    __slots__ = (\"loop_node\", \"type_shapes\", \"type_shape\", \"recursion\")\n\n    def __init__(self, loop_node, previous, type_shapes):\n        # Note: That previous is being added to later.\n        ValueTraceMergeBase.__init__(self, owner=previous.owner, previous=(previous,))\n\n        self.loop_node = loop_node\n        self.type_shapes = type_shapes\n        self.type_shape = None\n\n        self.recursion = False\n\n    def __repr__(self):\n        return \"<%s shapes %s of %s>\" % (\n            self.__class__.__name__,\n            self.type_shapes,\n            self.owner.getCodeName(),\n        )\n\n    @staticmethod\n    def isLoopTrace():\n        return True\n\n    def getTypeShape(self):\n        if self.type_shape is None:\n            if len(self.type_shapes) > 1:\n                self.type_shape = ShapeLoopCompleteAlternative(self.type_shapes)\n            else:\n                self.type_shape = next(iter(self.type_shapes))\n\n        return self.type_shape\n\n    def addLoopContinueTraces(self, continue_traces):\n        self.previous += tuple(continue_traces)\n\n        for previous in continue_traces:\n            previous.addMergeUsage()\n\n    def mustHaveValue(self):\n        # To handle recursion, we lie to ourselves.\n        if self.recursion:\n            return True\n\n        self.recursion = True\n\n        for previous in self.previous:\n            if not previous.mustHaveValue():\n                self.recursion = False\n                return False\n\n        self.recursion = False\n        return True\n\n    def hasShapeListExact(self):\n        return self.type_shapes == _only_list_shape\n\n    def hasShapeDictionaryExact(self):\n        return self.type_shapes == _only_dict_shape\n\n    def hasShapeStrExact(self):\n        return self.type_shapes == _only_str_shape\n\n    def hasShapeUnicodeExact(self):\n        return self.type_shapes == _only_unicode_shape\n\n    if str is bytes:\n\n        def hasShapeStrOrUnicodeExact(self):\n            return (\n                self.hasShapeStrExact()\n                or self.hasShapeUnicodeExact()\n                or self.type_shapes == _str_plus_unicode_shape\n            )\n\n    else:\n\n        hasShapeStrOrUnicodeExact = hasShapeUnicodeExact\n\n    def hasShapeBytesExact(self):\n        return self.type_shapes == _only_bytes_shape\n\n    def hasShapeBoolExact(self):\n        return self.type_shapes == _only_bool_shape\n\n\n_only_list_shape = frozenset((tshape_list,))\n_only_dict_shape = frozenset((tshape_dict,))\n_only_str_shape = frozenset((tshape_str,))\n_only_unicode_shape = frozenset((tshape_unicode,))\n_str_plus_unicode_shape = frozenset((tshape_unicode, tshape_str))\n_only_bytes_shape = frozenset((tshape_bytes,))\n_only_bool_shape = frozenset((tshape_bool,))\n\n\nclass ValueTraceLoopComplete(ValueTraceLoopBase):\n    __slots__ = ()\n\n    @staticmethod\n    def getReleaseEscape():\n        # TODO: May consider the shapes for better result\n        return ControlFlowDescriptionFullEscape\n\n    def compareValueTrace(self, other):\n        # Incomplete loop value traces behave the same.\n        return (\n            self.__class__ is other.__class__\n            and self.loop_node == other.loop_node\n            and self.type_shapes == other.type_shapes\n        )\n\n    # TODO: These could be better\n    @staticmethod\n    def mustHaveValue():\n        return False\n\n    @staticmethod\n    def mustNotHaveValue():\n        return False\n\n    @staticmethod\n    def getTruthValue():\n        return None\n\n    @staticmethod\n    def getComparisonValue():\n        return False, None\n\n\nclass ValueTraceLoopIncomplete(ValueTraceLoopBase):\n    __slots__ = ()\n\n    def getTypeShape(self):\n        if self.type_shape is None:\n            self.type_shape = ShapeLoopInitialAlternative(self.type_shapes)\n\n        return self.type_shape\n\n    @staticmethod\n    def getReleaseEscape():\n        return ControlFlowDescriptionFullEscape\n\n    def compareValueTrace(self, other):\n        # Incomplete loop value traces behave the same.\n        return self.__class__ is other.__class__ and self.loop_node == other.loop_node\n\n    @staticmethod\n    def mustHaveValue():\n        return False\n\n    @staticmethod\n    def mustNotHaveValue():\n        return False\n\n    @staticmethod\n    def getTruthValue():\n        return None\n\n    @staticmethod\n    def getComparisonValue():\n        return False, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/optimizations/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/pgo/PGO.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Python level PGO handling in Nuitka.\"\"\"\n\nimport os\nimport struct\n\nfrom nuitka.__past__ import xrange\nfrom nuitka.Options import getPythonPgoUnseenModulePolicy\nfrom nuitka.Tracing import pgo_logger\n\n_pgo_active = False\n\n_pgo_strings = None\n\n_module_entries = {}\n_module_exits = {}\n\n\ndef _readCString(input_file):\n    return b\"\".join(iter(lambda: input_file.read(1), b\"\\0\"))\n\n\ndef _readCIntValue(input_file):\n    return struct.unpack(\"i\", input_file.read(4))[0]\n\n\ndef _readStringValue(input_file):\n    return _pgo_strings[_readCIntValue(input_file)]\n\n\ndef _readModuleIdentifierValue(input_file):\n    module_identifier = _readStringValue(input_file)\n    if str is not bytes:\n        module_identifier = module_identifier.decode(\"utf8\")\n\n    return module_identifier\n\n\ndef readPGOInputFile(input_filename):\n    \"\"\"Read PGO information produced by a PGO run.\"\"\"\n\n    # Using global here, as this is really a singleton, in the form of a module,\n    # pylint: disable=global-statement\n    global _pgo_strings, _pgo_active\n\n    with open(input_filename, \"rb\") as input_file:\n        header = input_file.read(7)\n\n        if header != b\"KAY.PGO\":\n            pgo_logger.sysexit(\n                \"Error, file '%s' is not a valid PGO input for this version of Nuitka.\"\n                % input_filename\n            )\n\n        input_file.seek(-7, os.SEEK_END)\n        header = input_file.read(7)\n\n        if header != b\"YAK.PGO\":\n            pgo_logger.sysexit(\n                \"Error, file '%s' was not completed correctly.\" % input_filename\n            )\n\n        input_file.seek(-8 - 7, os.SEEK_END)\n        count, offset = struct.unpack(\"ii\", input_file.read(8))\n\n        input_file.seek(offset, os.SEEK_SET)\n\n        _pgo_strings = [None] * count\n\n        for i in xrange(count):\n            _pgo_strings[i] = _readCString(input_file)\n\n        input_file.seek(7, os.SEEK_SET)\n\n        while True:\n            # Which probe is it.\n            probe_name = _readStringValue(input_file)\n\n            if probe_name == b\"ModuleEnter\":\n                module_name = _readModuleIdentifierValue(input_file)\n                arg = _readCIntValue(input_file)\n\n                _module_entries[module_name] = arg\n            elif probe_name == b\"ModuleExit\":\n                module_name = _readModuleIdentifierValue(input_file)\n                had_error = _readCIntValue(input_file) != 0\n\n                _module_exits[module_name] = had_error\n            elif probe_name == b\"END\":\n                break\n            else:\n                pgo_logger.sysexit(\n                    \"Error, unknown probe '%s' encountered.\" % probe_name\n                )\n\n    _pgo_active = True\n\n\ndef decideInclusionFromPGO(module_name, module_kind):\n    \"\"\"Decide module inclusion based on PGO input.\n\n    At this point, PGO can decide the inclusion to not be done. It will\n    ask to include things it has seen at run time, and that won't be a\n    problem, but it will ask to exclude modules not seen entered at runtime,\n    the decision for bytecode is same as inclusion, but the demotion is done\n    later, after first compiling it. Caching might save compile time a second\n    time around once the cache is populated, but care must be taken for that\n    to not cause inclusions that are not used.\n    \"\"\"\n\n    # Only if we had input of course.\n    if not _pgo_active:\n        return None\n\n    # At this time, we do not yet detect the loading of extension modules,\n    # but of course we could and should do that.\n    if module_kind == \"extension\":\n        return None\n\n    if module_name in _module_entries:\n        return True\n\n    unseen_module_policy = getPythonPgoUnseenModulePolicy()\n\n    if unseen_module_policy == \"exclude\":\n        return False\n    else:\n        return None\n\n\ndef decideCompilationFromPGO(module_name):\n    # Only if we had input of course.\n    if not _pgo_active:\n        return None\n\n    # TODO: Could become more complicated.\n    unseen_module_policy = getPythonPgoUnseenModulePolicy()\n\n    if module_name not in _module_entries and unseen_module_policy == \"bytecode\":\n        return \"bytecode\"\n    else:\n        return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/pgo/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/PluginBase.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nPlugins: Welcome to Nuitka! This is your shortest way to become part of it.\n\nThis is to provide the base class for all plugins. Some of which are part of\nproper Nuitka, and some of which are waiting to be created and submitted for\ninclusion by you.\n\nThe base class will serve as documentation. And it will point to examples of\nit being used.\n\"\"\"\n\nimport ast\nimport functools\nimport inspect\nimport os\nimport sys\nimport unittest\n\nfrom nuitka import Options\nfrom nuitka.__past__ import iter_modules, unicode\nfrom nuitka.containers.Namedtuples import makeNamedtupleClass\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.freezer.IncludedDataFiles import (\n    decodeDataFileTags,\n    makeIncludedDataDirectory,\n    makeIncludedDataFile,\n    makeIncludedEmptyDirectory,\n    makeIncludedGeneratedDataFile,\n    makeIncludedPackageDataFiles,\n)\nfrom nuitka.freezer.IncludedEntryPoints import (\n    makeDllEntryPoint,\n    makeExeEntryPoint,\n)\nfrom nuitka.ModuleRegistry import (\n    addModuleInfluencingCondition,\n    addModuleInfluencingDetection,\n    addModuleInfluencingParameter,\n    addModuleInfluencingVariable,\n    getModuleInclusionInfoByName,\n)\nfrom nuitka.Options import (\n    hasPythonFlagNoAnnotations,\n    hasPythonFlagNoAsserts,\n    hasPythonFlagNoDocStrings,\n    isDeploymentMode,\n    isStandaloneMode,\n    shallCreateAppBundle,\n    shallMakeModule,\n    shallShowExecutedCommands,\n)\nfrom nuitka.PythonFlavors import isAnacondaPython, isDebianPackagePython\nfrom nuitka.PythonVersions import (\n    getTestExecutionPythonVersions,\n    python_version,\n    python_version_full_str,\n    python_version_str,\n)\nfrom nuitka.Tracing import plugins_logger\nfrom nuitka.utils.AppDirs import getAppdirsModule\nfrom nuitka.utils.Distributions import (\n    getDistributionFromModuleName,\n    getDistributionName,\n    isDistributionCondaPackage,\n)\nfrom nuitka.utils.Execution import NuitkaCalledProcessError, check_output\nfrom nuitka.utils.FileOperations import (\n    changeFilenameExtension,\n    getFileContents,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix, isBuiltinModuleName\nfrom nuitka.utils.ModuleNames import (\n    ModuleName,\n    makeTriggerModuleName,\n    post_module_load_trigger_name,\n    pre_module_load_trigger_name,\n)\nfrom nuitka.utils.SharedLibraries import locateDLL, locateDLLsInDirectory\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\nfrom nuitka.utils.Utils import (\n    getArchitecture,\n    isAndroidBasedLinux,\n    isLinux,\n    isMacOS,\n    isWin32Windows,\n    withNoWarning,\n)\nfrom nuitka.utils.Yaml import getYamlPackageConfiguration\n\n_warned_unused_plugins = set()\n\n# TODO: Could share data cache with meta data nodes\n_package_versions = {}\n\n# Populated during plugin instance creation from their tags given by\n# \"getEvaluationConditionControlTags\" value.\ncontrol_tags = {}\n\n_context_dict = None\n\n# Populated when \"constants\" and \"variables\" yaml sections get evaluated.\n_module_config_constants = {}\n_module_config_variables = {}\n\n\ndef _getImportLibModule():\n    try:\n        import importlib\n    except ImportError:\n        return None\n    else:\n        return importlib\n\n\ndef _getEvaluationContext():\n    # Using global here, as this is really a singleton, in the form of a module,\n    # pylint: disable=global-statement\n    global _context_dict\n\n    if _context_dict is None:\n        _context_dict = {\n            \"macos\": isMacOS(),\n            \"win32\": isWin32Windows(),\n            \"linux\": isLinux(),\n            \"android\": isAndroidBasedLinux(),\n            \"android32\": isAndroidBasedLinux() and sys.maxsize < 2**32,\n            \"android64\": isAndroidBasedLinux() and sys.maxsize >= 2**64 - 1,\n            \"anaconda\": isAnacondaPython(),\n            \"is_conda_package\": isDistributionCondaPackage,\n            \"debian_python\": isDebianPackagePython(),\n            \"standalone\": isStandaloneMode(),\n            \"module_mode\": shallMakeModule(),\n            \"deployment\": isDeploymentMode(),\n            # Querying package versions.\n            \"version\": _getPackageVersion,\n            \"version_str\": _getPackageVersionStr,\n            \"get_dist_name\": _getDistributionNameFromPackageName,\n            \"plugin\": _isPluginActive,\n            \"no_asserts\": hasPythonFlagNoAsserts(),\n            \"no_docstrings\": hasPythonFlagNoDocStrings(),\n            \"no_annotations\": hasPythonFlagNoAnnotations(),\n            # Iterating packages\n            \"iterate_modules\": _iterate_module_names,\n            # Locating package directories\n            \"_get_module_directory\": _getModuleDirectory,\n            # Querying package properties\n            \"has_builtin_module\": isBuiltinModuleName,\n            # Architectures\n            \"arch_x86\": getArchitecture() == \"x86\",\n            \"arch_amd64\": getArchitecture() == \"x86_64\",\n            \"arch_arm64\": getArchitecture() == \"arm64\",\n            # Frequent used modules\n            \"sys\": sys,\n            \"os\": os,\n            \"importlib\": _getImportLibModule(),\n            \"appdirs\": getAppdirsModule(),\n            \"unittest\": unittest,\n            # Python version string\n            \"python_version_str\": python_version_str,\n            \"python_version_full_str\": python_version_full_str,\n            # Builtins\n            \"True\": True,\n            \"False\": False,\n            \"None\": None,\n            \"repr\": repr,\n            \"len\": len,\n            \"str\": str,\n            \"bool\": bool,\n            \"int\": int,\n            \"tuple\": tuple,\n            \"list\": list,\n            \"dict\": dict,\n            \"set\": set,\n            \"getattr\": getattr,\n            \"hasattr\": hasattr,\n            \"frozenset\": frozenset,\n            \"__import__\": __import__,\n        }\n\n        versions = getTestExecutionPythonVersions()\n\n        for version in versions:\n            big, major = version.split(\".\")\n            numeric_version = int(big) * 256 + int(major) * 16\n            is_same_or_higher_version = python_version >= numeric_version\n\n            _context_dict[\"python\" + big + major + \"_or_higher\"] = (\n                is_same_or_higher_version\n            )\n            _context_dict[\"before_python\" + big + major] = not is_same_or_higher_version\n\n        _context_dict[\"before_python3\"] = python_version < 0x300\n        _context_dict[\"python3_or_higher\"] = python_version >= 0x300\n\n        _context_dict[\"extension_std_suffix\"] = getSharedLibrarySuffix(preferred=True)\n        _context_dict[\"extension_suffix\"] = getSharedLibrarySuffix(preferred=False)\n\n    return _context_dict\n\n\ndef _convertVersionToTuple(version_str):\n    def numberize(v):\n        # For now, we ignore rc/post stuff, hoping it doesn't matter for us.\n        return int(\"\".join(d for d in v if d.isdigit()))\n\n    return tuple(numberize(d) for d in version_str.split(\".\"))\n\n\ndef _getPackageNameFromDistributionName(distribution_name):\n    if distribution_name in (\"opencv-python\", \"opencv-python-headless\"):\n        return \"cv2\"\n    elif distribution_name == \"pyobjc\":\n        return \"objc\"\n    else:\n        return distribution_name\n\n\ndef _getDistributionNameFromPackageName(package_name):\n    package_name = ModuleName(package_name)\n    distribution = getDistributionFromModuleName(package_name)\n\n    if distribution is None:\n        return package_name.asString()\n    else:\n        return getDistributionName(distribution)\n\n\ndef _getPackageVersion(distribution_name):\n    if distribution_name not in _package_versions:\n        try:\n            if python_version >= 0x380:\n                from importlib.metadata import version\n            else:\n                from importlib_metadata import version\n\n            result = _convertVersionToTuple(version(distribution_name))\n        except ImportError:\n            try:\n                from pkg_resources import (\n                    DistributionNotFound,\n                    extern,\n                    get_distribution,\n                )\n            except ImportError:\n                result = None\n            else:\n                try:\n                    result = _convertVersionToTuple(\n                        get_distribution(distribution_name).version\n                    )\n                except DistributionNotFound:\n                    result = None\n                except extern.packaging.version.InvalidVersion:\n                    result = None\n\n        if result is None:\n            # Fallback if nothing is available, which may happen if no package is installed,\n            # but only source code is found.\n            try:\n                result = _convertVersionToTuple(\n                    __import__(\n                        _getPackageNameFromDistributionName(distribution_name)\n                    ).__version__\n                )\n            except ImportError:\n                result = None\n\n        _package_versions[distribution_name] = result\n\n    return _package_versions[distribution_name]\n\n\ndef _getPackageVersionStr(distribution_name):\n    version = _getPackageVersion(distribution_name)\n\n    if version is not None:\n        version = \".\".join(str(d) for d in version)\n\n    return version\n\n\ndef _getModuleDirectory(module_name):\n    from nuitka.importing.Importing import locateModule\n\n    _module_name, module_filename, _module_kind, _finding = locateModule(\n        module_name=ModuleName(module_name), parent_package=None, level=0\n    )\n\n    return module_filename\n\n\ndef _iterate_module_names(package_name):\n    package_name = ModuleName(package_name)\n    package_path = _getModuleDirectory(module_name=package_name)\n\n    result = []\n\n    for module_info in iter_modules([package_path]):\n        module_name = package_name.getChildNamed(module_info.name)\n        result.append(module_name.asString())\n\n        if module_info.ispkg:\n            result.extend(_iterate_module_names(package_name=module_name))\n\n    return result\n\n\ndef _isPluginActive(plugin_name):\n    from .Plugins import getUserActivatedPluginNames\n\n    return plugin_name in getUserActivatedPluginNames()\n\n\nclass NuitkaPluginBase(getMetaClassBase(\"Plugin\", require_slots=False)):\n    \"\"\"Nuitka base class for all plugins.\n\n    Derive your plugin from \"NuitkaPluginBase\" please.\n    For instructions, see https://github.com/Nuitka/Nuitka/blob/orsiris/UserPlugin-Creation.rst\n\n    Plugins allow to adapt Nuitka's behavior in a number of ways as explained\n    below at the individual methods.\n\n    It is used to deal with special requirements some packages may have (e.g. PyQt\n    and tkinter), data files to be included (e.g. \"certifi\"), inserting hidden\n    code, coping with otherwise undetectable needs, or issuing messages in\n    certain situations.\n\n    A plugin in general must be enabled to be used by Nuitka. This happens by\n    specifying \"--enable-plugin\" (standard plugins) or by \"--user-plugin\" (user\n    plugins) in the Nuitka command line. However, some plugins are always enabled\n    and invisible to the user.\n\n    Nuitka comes with a number of \"standard\" plugins to be enabled as needed.\n    What they are can be displayed using \"nuitka --plugin-list file.py\" (filename\n    required but ignored).\n\n    User plugins may be specified (and implicitly enabled) using their Python\n    script pathname.\n    \"\"\"\n\n    # Standard plugins must provide this as a unique string which Nuitka\n    # then uses to identify them.\n    #\n    # User plugins are identified by their path and implicitly activated.\n    # They however still need to specify some arbitrary non-blank string here,\n    # which does not equal the name of an inactivated standard plugin.\n    # For working with options, user plugins must set this variable to\n    # the script's path (use __file__, __module__ or __name__).\n    plugin_name = None\n\n    @staticmethod\n    def isAlwaysEnabled():\n        \"\"\"Request to be always enabled.\n\n        Notes:\n            Setting this to true is only applicable to standard plugins. In\n            this case, the plugin will be enabled upon Nuitka start-up. Any\n            plugin detector class will then be ignored. Method isRelevant() may\n            also be present and can be used to fine-control enabling the\n            plugin: A to-be-enabled, but irrelevant plugin will still not be\n            activated.\n        Returns:\n            True or False\n        \"\"\"\n        return False\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"Consider if the plugin is relevant.\n\n        Notes:\n            A plugin may only be a needed on a certain OS, or with some options,\n            but this is only a class method, so you will not have much run time\n            information.\n\n        Returns:\n            True or False\n\n        \"\"\"\n        return not cls.isDeprecated()\n\n    @classmethod\n    def isDeprecated(cls):\n        \"\"\"Is this a deprecated plugin, i.e. one that has no use anymore.\"\"\"\n        return False\n\n    @classmethod\n    def isDetector(cls):\n        \"\"\"Is this a detection plugin, i.e. one which is only there to inform.\"\"\"\n        return hasattr(cls, \"detector_for\")\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        # Call group.add_option() here.\n        pass\n\n    def isRequiredImplicitImport(self, module, full_name):\n        \"\"\"Indicate whether an implicitly imported module should be accepted.\n\n        Notes:\n            You may negate importing a module specified as \"implicit import\",\n            although this is an unexpected event.\n\n        Args:\n            module: the module object\n            full_name: of the implicitly import module\n        Returns:\n            True or False\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return True\n\n    def getImplicitImports(self, module):\n        \"\"\"Return the implicit imports for a given module (iterator).\n\n        Args:\n            module: the module object\n        Yields:\n            implicit imports for the module\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        \"\"\"Inspect or modify source code.\n\n        Args:\n            module_name: (str) name of module\n            source_code: (str) its source code\n        Returns:\n            source_code (str)\n        Notes:\n            Default implementation forwards to `checkModuleSourceCode` which is\n            going to allow simply checking the source code without the need to\n            pass it back.\n        \"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        self.checkModuleSourceCode(module_name, source_code)\n\n        return source_code\n\n    def checkModuleSourceCode(self, module_name, source_code):\n        \"\"\"Inspect source code.\n\n        Args:\n            module_name: (str) name of module\n            source_code: (str) its source code\n        Returns:\n            None\n        \"\"\"\n\n    def onFrozenModuleBytecode(self, module_name, is_package, bytecode):\n        \"\"\"Inspect or modify frozen module byte code.\n\n        Args:\n            module_name: (str) name of module\n            is_package: (bool) True indicates a package\n            bytecode: (bytes) byte code\n        Returns:\n            bytecode (bytes)\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return bytecode\n\n    @staticmethod\n    def createPreModuleLoadCode(module):\n        \"\"\"Create code to execute before importing a module.\n\n        Notes:\n            Called by @onModuleDiscovered.\n\n        Args:\n            module: the module object\n        Returns:\n            None (does not apply, default)\n            tuple (code, documentary string)\n            tuple (code, documentary string, flags)\n        \"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return None\n\n    @staticmethod\n    def createPostModuleLoadCode(module):\n        \"\"\"Create code to execute after loading to a module.\n\n        Notes:\n            Called by @onModuleDiscovered.\n\n        Args:\n            module: the module object\n\n        Returns:\n            None (does not apply, default)\n            tuple (code, documentary string)\n            tuple (code, documentary string, flags)\n        \"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return None\n\n    @staticmethod\n    def createFakeModuleDependency(module):\n        \"\"\"Create module to depend on.\n\n        Notes:\n            Called by @onModuleDiscovered.\n\n        Args:\n            module: the module object\n\n        Returns:\n            None (does not apply, default)\n            tuple (code, reason)\n            tuple (code, reason, flags)\n        \"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return None\n\n    @staticmethod\n    def hasPreModuleLoadCode(module_name):\n        return (\n            getModuleInclusionInfoByName(\n                makeTriggerModuleName(module_name, pre_module_load_trigger_name)\n            )\n            is not None\n        )\n\n    @staticmethod\n    def hasPostModuleLoadCode(module_name):\n        return (\n            getModuleInclusionInfoByName(\n                makeTriggerModuleName(module_name, post_module_load_trigger_name)\n            )\n            is not None\n        )\n\n    def onModuleDiscovered(self, module):\n        \"\"\"Called with a module to be loaded.\n\n        Notes:\n            We may specify code to be prepended and/or appended to this module.\n            This code is stored in the appropriate dict.\n            For every imported module and each of these two options, only one plugin may do this.\n            We check this condition here.\n\n        Args:\n            module: the module object\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def getPackageExtraScanPaths(self, package_name, package_dir):\n        \"\"\"Provide other directories to consider submodules to live in.\n\n        Args:\n            module_name: full module name\n            package_dir: directory of the package\n\n        Returns:\n            Iterable list of directories, non-existent ones are ignored.\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        \"\"\"Help decide whether to include a module.\n\n        Args:\n            using_module_name: module that does this (can be None if user)\n            module_name: full module name\n            module_filename: filename\n            module_kind: one of \"py\", \"extension\" (shared library)\n        Returns:\n            True or False\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def onModuleUsageLookAhead(\n        self, module_name, module_filename, module_kind, get_module_source\n    ):\n        \"\"\"React to tentative recursion of a module coming up.\n\n        For definite usage, use onModuleRecursion where it's a fact and\n        happening next. This may be a usage that is later optimized away\n        and doesn't impact anything. The main usage is to setup e.g.\n        hard imports as a factory, e.g. with detectable lazy loaders.\n\n        Args:\n            module_name: full module name\n            module_filename: filename\n            module_kind: one of \"py\", \"extension\" (shared library)\n            get_module_source: callable to get module source code if any\n        Returns:\n            None\n        \"\"\"\n\n    def onModuleRecursion(\n        self,\n        module_name,\n        module_filename,\n        module_kind,\n        using_module_name,\n        source_ref,\n        reason,\n    ):\n        \"\"\"React to recursion of a module coming up.\n\n        Args:\n            module_name: full module name\n            module_filename: filename\n            module_kind: one of \"py\", \"extension\" (shared library)\n            using_module_name: name of module that does the usage (None if it is a user choice)\n            source_ref: code making the import (None if it is a user choice)\n        Returns:\n            None\n        \"\"\"\n\n    def onModuleInitialSet(self):\n        \"\"\"Provide extra modules to the initial root module set.\n\n        Args:\n            None\n        Returns:\n            Iterable of modules, may yield.\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        return ()\n\n    def onModuleCompleteSet(self, module_set):\n        \"\"\"Provide extra modules to the initial root module set.\n\n        Args:\n            module_set - tuple of module objects\n        Returns:\n            None\n        Notes:\n            You must not change anything, this is purely for warning\n            and error checking, and potentially for later stages to\n            prepare.\n        \"\"\"\n\n    def onModuleCompleteSetGUI(self, module_set, plugin_binding_name):\n        from .Plugins import getOtherGUIBindingNames, getQtBindingNames\n\n        for module in module_set:\n            module_name = module.getFullName()\n\n            if module_name == plugin_binding_name:\n                continue\n\n            if module_name in getOtherGUIBindingNames():\n                if plugin_binding_name in getQtBindingNames():\n                    recommendation = \"Use '--nofollow-import-to=%s'\" % module_name\n\n                    if module_name in getQtBindingNames():\n                        problem = \"conflicts with\"\n                    else:\n                        problem = \"is redundant with\"\n                else:\n                    recommendation = \"Use '--enable-plugin=no-qt'\"\n                    problem = \"is redundant with\"\n\n                self.warning(\n                    \"\"\"\\\nUnwanted import of '%(unwanted)s' that %(problem)s '%(binding_name)s' encountered. \\\n%(recommendation)s or uninstall it for best compatibility with pure Python execution.\"\"\"\n                    % {\n                        \"unwanted\": module_name,\n                        \"binding_name\": plugin_binding_name,\n                        \"recommendation\": recommendation,\n                        \"problem\": problem,\n                    }\n                )\n\n    @staticmethod\n    def locateModule(module_name):\n        \"\"\"Provide a filename / -path for a to-be-imported module.\n\n        Args:\n            module_name: (str or ModuleName) full name of module\n        Returns:\n            filename for module\n        \"\"\"\n\n        from nuitka.importing.Importing import locateModule\n\n        _module_name, module_filename, _module_kind, _finding = locateModule(\n            module_name=ModuleName(module_name), parent_package=None, level=0\n        )\n\n        return module_filename\n\n    @staticmethod\n    def locateModules(module_name):\n        \"\"\"Provide a filename / -path for a to-be-imported module.\n\n        Args:\n            module_name: (str or ModuleName) full name of module\n        Returns:\n            list of ModuleName\n        \"\"\"\n\n        from nuitka.importing.Importing import locateModules\n\n        return locateModules(module_name)\n\n    @classmethod\n    def locateDLL(cls, dll_name):\n        \"\"\"Locate a DLL by name.\"\"\"\n        return locateDLL(dll_name)\n\n    @classmethod\n    def locateDLLsInDirectory(cls, directory):\n        \"\"\"Locate all DLLs in a folder\n\n        Returns:\n            list of (filename, filename_relative, dll_extension)\n        \"\"\"\n        return locateDLLsInDirectory(directory)\n\n    def makeDllEntryPoint(\n        self, source_path, dest_path, module_name, package_name, reason\n    ):\n        \"\"\"Create an entry point, as expected to be provided by getExtraDlls.\"\"\"\n        return makeDllEntryPoint(\n            logger=self,\n            source_path=source_path,\n            dest_path=dest_path,\n            module_name=module_name,\n            package_name=package_name,\n            reason=reason,\n        )\n\n    def makeExeEntryPoint(\n        self, source_path, dest_path, module_name, package_name, reason\n    ):\n        \"\"\"Create an entry point, as expected to be provided by getExtraDlls.\"\"\"\n        return makeExeEntryPoint(\n            logger=self,\n            source_path=source_path,\n            dest_path=dest_path,\n            module_name=module_name,\n            package_name=package_name,\n            reason=reason,\n        )\n\n    def reportFileCount(self, module_name, count, section=None):\n        if count:\n            msg = \"Found %d %s DLLs from %s%s installation.\" % (\n                count,\n                \"file\" if count < 2 else \"files\",\n                \"\" if not section else (\"'%s' \" % section),\n                module_name.asString(),\n            )\n\n            self.info(msg)\n\n    def getExtraDlls(self, module):\n        \"\"\"Provide IncludedEntryPoint named tuples describing extra needs of the module.\n\n        Args:\n            module: the module object needing the binaries\n        Returns:\n            yields IncludedEntryPoint objects\n\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def onCopiedDLL(self, dll_filename):\n        \"\"\"Chance for a plugin to modify DLLs after copy, e.g. to compress it, remove attributes, etc.\n\n        Args:\n            dll_filename: the filename of the DLL\n\n        Notes:\n            Do not remove or add any files in this method, this will not work well, there\n            is e.g. getExtraDLLs API to add things. This is only for post processing as\n            described above.\n\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def getModuleSpecificDllPaths(self, module_name):\n        \"\"\"Provide a list of directories, where DLLs should be searched for this package (or module).\n\n        Args:\n            module_name: name of a package or module, for which the DLL path addition applies.\n        Returns:\n            iterable of paths\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def getModuleSysPathAdditions(self, module_name):\n        \"\"\"Provide a list of directories, that should be considered in 'PYTHONPATH' when this module is used.\n\n        Args:\n            module_name: name of a package or module\n        Returns:\n            iterable of paths\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def removeDllDependencies(self, dll_filename, dll_filenames):\n        \"\"\"Yield any DLLs / shared libraries not to be included in distribution.\n\n        Args:\n            dll_filename: DLL name\n            dll_filenames: list of DLLs\n        Yields:\n            yielded filenames to exclude\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def considerDataFiles(self, module):\n        \"\"\"Yield data file names (source|func, target) for inclusion (iterator).\n\n        Args:\n            module: module object that may need extra data files\n        Yields:\n            Data file description pairs, either (source, dest) or (func, dest)\n            where the func will be called to create the content dynamically.\n\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return ()\n\n    def isAcceptableMissingDLL(self, package_name, dll_basename):\n        \"\"\"Check if a missing DLL is acceptable to the plugin.\n\n        Args:\n            package_name: name of the package using the DLL\n            dll_basename : basename of the DLL, i.e. no suffix\n        Returns:\n            None (no opinion for that file), True (yes) or False (no)\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def makeIncludedDataFile(self, source_path, dest_path, reason, tags=\"\"):\n        return makeIncludedDataFile(\n            source_path=source_path,\n            dest_path=dest_path,\n            reason=reason,\n            tracer=self,\n            tags=tags,\n        )\n\n    def makeIncludedAppBundleResourceFile(\n        self, source_path, dest_path, reason, tags=\"\"\n    ):\n        tags = decodeDataFileTags(tags)\n        tags.add(\"framework_resource\")\n\n        assert isMacOS() and shallCreateAppBundle()\n\n        # The default dest path root is the \"Contents\" folder\n        dest_path = os.path.join(\"..\", \"Resources\", dest_path)\n\n        return self.makeIncludedDataFile(\n            source_path=source_path,\n            dest_path=dest_path,\n            reason=reason,\n            tags=tags,\n        )\n\n    def makeIncludedGeneratedDataFile(self, data, dest_path, reason, tags=\"\"):\n        return makeIncludedGeneratedDataFile(\n            data=data, dest_path=dest_path, reason=reason, tracer=self, tags=tags\n        )\n\n    def makeIncludedDataDirectory(\n        self,\n        source_path,\n        dest_path,\n        reason,\n        tags=\"\",\n        ignore_dirs=(),\n        ignore_filenames=(),\n        ignore_suffixes=(),\n        only_suffixes=(),\n        normalize=True,\n    ):\n        return makeIncludedDataDirectory(\n            source_path=source_path,\n            dest_path=dest_path,\n            reason=reason,\n            tracer=self,\n            tags=tags,\n            ignore_dirs=ignore_dirs,\n            ignore_filenames=ignore_filenames,\n            ignore_suffixes=ignore_suffixes,\n            only_suffixes=only_suffixes,\n            normalize=normalize,\n        )\n\n    def makeIncludedEmptyDirectory(self, dest_path, reason, tags):\n        return makeIncludedEmptyDirectory(\n            dest_path=dest_path,\n            reason=reason,\n            tracer=self,\n            tags=tags,\n        )\n\n    def makeIncludedPackageDataFiles(\n        self, package_name, package_directory, pattern, reason, tags\n    ):\n        return makeIncludedPackageDataFiles(\n            tracer=self,\n            package_name=ModuleName(package_name),\n            package_directory=package_directory,\n            pattern=pattern,\n            reason=reason,\n            tags=tags,\n        )\n\n    def updateDataFileTags(self, included_datafile):\n        \"\"\"Add or remove data file tags.\"\"\"\n\n    def onDataFileTags(self, included_datafile):\n        \"\"\"Action on data file tags.\"\"\"\n\n    def onBeforeCodeParsing(self):\n        \"\"\"Prepare for code parsing, normally not needed.\"\"\"\n\n    def onStandaloneDistributionFinished(self, dist_dir):\n        \"\"\"Called after successfully creating a standalone distribution.\n\n        Note:\n            It is up to the plugin to take subsequent action. Examples are:\n            insert additional information (license, copyright, company or\n            application description), create installation material, further\n            folder clean-up, start downstream applications etc.\n\n        Args:\n            dist_dir: the created distribution folder\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def onOnefileFinished(self, filename):\n        \"\"\"Called after successfully creating a onefile executable.\n\n        Note:\n            It is up to the plugin to take subsequent action. Examples are:\n            insert additional information (license, copyright, company or\n            application description), create installation material, further\n            folder clean-up, start downstream applications etc.\n\n        Args:\n            filename: the created onefile executable\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def onBootstrapBinary(self, filename):\n        \"\"\"Called after successfully creating a bootstrap binary, but without payload.\n\n        Args:\n            filename: the created bootstrap binary, will be modified later\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def onStandaloneBinary(self, filename):\n        \"\"\"Called after successfully creating a standalone binary.\n\n        Args:\n            filename: the created standalone binary\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def onFinalResult(self, filename):\n        \"\"\"Called after successfully finishing a compilation.\n\n        Note:\n            Plugins normally don't need this, and what filename is will be\n            heavily dependent on compilation modes. Actions can be take here,\n            e.g. commercial plugins output generated keys near that executable\n            path.\n        Args:\n            filename: the created binary (module, accelerated exe, dist exe, onefile exe)\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def suppressUnknownImportWarning(self, importing, module_name, source_ref):\n        \"\"\"Suppress import warnings for unknown modules.\n\n        Args:\n            importing: the module object\n            module_name: name of module\n            source_ref: ???\n        Returns:\n            True or False\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return False\n\n    def decideCompilation(self, module_name):\n        \"\"\"Decide whether to compile a module (or just use its bytecode).\n\n        Notes:\n            The first plugin not returning None makes the decision. Thereafter,\n            no other plugins will be checked. If all plugins return None, the\n            module will be compiled.\n\n        Args:\n            module_name: name of module\n\n        Returns:\n            \"compiled\" or \"bytecode\" or None (no opinion, use by default)\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def getPreprocessorSymbols(self):\n        \"\"\"Decide which C defines to be used in compilation.\n\n        Notes:\n            The plugins can each contribute, but are hopefully using\n            a namespace for their defines.\n\n        Returns:\n            None for no defines, otherwise dictionary of key to be\n            defined, and non-None values if any, i.e. no \"-Dkey\" only\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        # spell-checker: ignore -Dkey\n        return None\n\n    def getBuildDefinitions(self):\n        \"\"\"Decide C source defines to be used in compilation.\n\n        Notes:\n            Make sure to use a namespace for your defines, and prefer\n            `getPreprocessorSymbols` if you can.\n\n        Returns:\n            dict or None for no values\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def getExtraIncludeDirectories(self):\n        \"\"\"Decide which extra directories to use for C includes in compilation.\n\n        Returns:\n            List of directories or None by default\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    @classmethod\n    def getPluginDataFilesDir(cls):\n        \"\"\"Helper function that returns path, where data files for the plugin are stored.\"\"\"\n        plugin_filename = sys.modules[cls.__module__].__file__\n        return changeFilenameExtension(plugin_filename, \"\")\n\n    def getPluginDataFileContents(self, filename):\n        \"\"\"Helper function that returns contents of a plugin data file.\"\"\"\n        return getFileContents(\n            os.path.join(\n                self.getPluginDataFilesDir(),\n                filename,\n            )\n        )\n\n    def getExtraCodeFiles(self):\n        \"\"\"Add extra code files to the compilation.\n\n        Notes:\n            This is generally a bad idea to use unless you absolutely\n            know what you are doing.\n\n        Returns:\n            None for no extra codes, otherwise dictionary of key to be\n            filename, and value to be source code.\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def getExtraLinkLibraries(self):\n        \"\"\"Decide which link library should be added.\n\n        Notes:\n            Names provided multiple times, e.g. by multiple plugins are\n            only added once.\n\n        Returns:\n            None for no extra link library, otherwise the name as a **str**\n            or an iterable of names of link libraries.\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def getExtraLinkDirectories(self):\n        \"\"\"Decide which link directories should be added.\n\n        Notes:\n            Directories provided multiple times, e.g. by multiple plugins are\n            only added once.\n\n        Returns:\n            None for no extra link directory, otherwise the name as a **str**\n            or an iterable of names of link directories.\n        \"\"\"\n\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def warnUnusedPlugin(self, message):\n        \"\"\"An inactive plugin may issue a warning if it believes this may be wrong.\n\n        Returns:\n            None\n        \"\"\"\n        if self.plugin_name not in _warned_unused_plugins:\n            _warned_unused_plugins.add(self.plugin_name)\n\n            plugins_logger.warning(\n                \"Use '--enable-plugin=%s' for: %s\" % (self.plugin_name, message)\n            )\n\n    def onDataComposerRun(self):\n        \"\"\"Internal use only.\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        return None\n\n    def onDataComposerResult(self, blob_filename):\n        \"\"\"Internal use only.\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    def encodeDataComposerName(self, data_name):\n        \"\"\"Internal use only.\n\n        Returns:\n            None\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    _runtime_information_cache = {}\n\n    def queryRuntimeInformationMultiple(self, info_name, setup_codes, values):\n        info_name = self.plugin_name + \"_\" + info_name\n        info_name = info_name.replace(\"-\", \"_\").replace(\".\", \"_\")\n\n        if info_name in self._runtime_information_cache:\n            return self._runtime_information_cache[info_name]\n\n        keys = []\n        query_codes = []\n\n        for key, value_expression in values:\n            keys.append(key)\n\n            query_codes.append(\"print(repr(%s))\" % value_expression)\n            query_codes.append('print(\"-\" * 27)')\n\n        if type(setup_codes) is str:\n            setup_codes = setup_codes.splitlines()\n\n        if not setup_codes:\n            setup_codes = [\"pass\"]\n\n        cmd = r\"\"\"\\\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\ntry:\n%(setup_codes)s\nexcept ImportError:\n    import sys\n    sys.exit(38)\n%(query_codes)s\n\"\"\" % {\n            \"setup_codes\": \"\\n\".join(\"   %s\" % line for line in setup_codes),\n            \"query_codes\": \"\\n\".join(query_codes),\n        }\n\n        if shallShowExecutedCommands():\n            self.info(\"Executing query command:\\n%s\" % cmd, keep_format=True)\n\n        env = dict(os.environ)\n        env[\"PYTHONIOENCODING\"] = \"utf8\"\n\n        try:\n            feedback = check_output([sys.executable, \"-c\", cmd], env=env)\n        except NuitkaCalledProcessError as e:\n            if e.returncode == 38:\n                return None\n\n            if Options.is_debug:\n                self.info(cmd)\n\n            raise\n\n        if str is not bytes:  # We want to work with strings, that's hopefully OK.\n            feedback = feedback.decode(\"utf8\")\n\n        if shallShowExecutedCommands():\n            self.info(\"Result of query command:\\n%s\" % feedback)\n\n        # Ignore Windows newlines difference.\n        feedback = [line.strip() for line in feedback.splitlines()]\n\n        if feedback.count(\"-\" * 27) != len(keys):\n            self.sysexit(\n                \"Error, mismatch in output retrieving %r information.\" % info_name\n            )\n\n        feedback = [line for line in feedback if line != \"-\" * 27]\n\n        NamedtupleResultClass = makeNamedtupleClass(info_name, keys)\n\n        self._runtime_information_cache[info_name] = NamedtupleResultClass(\n            *(ast.literal_eval(value) for value in feedback)\n        )\n\n        return self._runtime_information_cache[info_name]\n\n    def queryRuntimeInformationSingle(self, setup_codes, value, info_name=None):\n        if info_name is None:\n            info_name = \"temp_info_for_\" + self.plugin_name.replace(\"-\", \"_\")\n\n        return self.queryRuntimeInformationMultiple(\n            info_name=info_name,\n            setup_codes=setup_codes,\n            values=((\"key\", value),),\n        ).key\n\n    def onFunctionBodyParsing(self, module_name, function_name, body):\n        \"\"\"Provide a different function body for the function of that module.\n\n        Should return a boolean, indicating if any actual change was done.\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return False\n\n    def onClassBodyParsing(self, module_name, class_name, node):\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        \"\"\"Provide a different class body for the class of that module.\n\n        Should return a boolean, indicating if any actual change was done.\n        \"\"\"\n        return False\n\n    def getCacheContributionValues(self, module_name):\n        \"\"\"Provide values that represent the include of a plugin on the compilation.\n\n        This must be used to invalidate cache results, e.g. when using the\n        onFunctionBodyParsing function, and other things, that do not directly\n        affect the source code. By default a plugin being enabled changes the\n        result unless it makes it clear that is not the case.\n        \"\"\"\n        # Virtual method, pylint: disable=unused-argument\n        return self.plugin_name\n\n    def getExtraConstantDefaultPopulation(self):\n        \"\"\"Provide extra global constant values to code generation.\"\"\"\n        # Virtual method, pylint: disable=no-self-use\n        return ()\n\n    def decideAllowOutsideDependencies(self, module_name):\n        \"\"\"Decide if outside of Python dependencies are allowed.\n\n        Returns:\n            None (no opinion for that module), True (yes) or False (no)\n        \"\"\"\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return None\n\n    @staticmethod\n    def getPackageVersion(module_name):\n        \"\"\"Provide package version of a distribution.\"\"\"\n        distribution_name = _getDistributionNameFromPackageName(module_name)\n\n        return _getPackageVersion(distribution_name)\n\n    def getEvaluationConditionControlTags(self):\n        # Virtual method, pylint: disable=no-self-use\n        return {}\n\n    @staticmethod\n    def isValueForEvaluation(expression):\n        return '\"' in expression or \"'\" in expression or \"(\" in expression\n\n    def evaluateExpressionOrConstant(\n        self, full_name, expression, config_name, extra_context, single_value\n    ):\n        if self.isValueForEvaluation(expression):\n            return self.evaluateExpression(\n                full_name=full_name,\n                expression=expression,\n                config_name=config_name,\n                extra_context=extra_context,\n                single_value=single_value,\n            )\n        else:\n            return expression\n\n    def getExpressionConstants(self, full_name):\n        if full_name not in _module_config_constants:\n            constants = {}\n\n            for count, constant_config in enumerate(\n                self.config.get(full_name, section=\"constants\"), start=1\n            ):\n                declarations = constant_config.get(\"declarations\")\n\n                if declarations and self.evaluateCondition(\n                    full_name=full_name,\n                    condition=constant_config.get(\"when\", \"True\"),\n                ):\n                    for constant_name, constant_value in declarations.items():\n                        constants[constant_name] = self.evaluateExpressionOrConstant(\n                            full_name=full_name,\n                            expression=constant_value,\n                            config_name=\"constants config #%d\" % count,\n                            extra_context=None,\n                            single_value=False,\n                        )\n\n            _module_config_constants[full_name] = constants\n\n        return _module_config_constants[full_name]\n\n    def getExpressionVariables(self, full_name):\n        if full_name not in _module_config_variables:\n            variables = {}\n\n            for count, variable_config in enumerate(\n                self.config.get(full_name, section=\"variables\")\n            ):\n                setup_codes = variable_config.get(\"setup_code\")\n                declarations = variable_config.get(\"declarations\")\n\n                if declarations and self.evaluateCondition(\n                    full_name=full_name,\n                    condition=variable_config.get(\"when\", \"True\"),\n                ):\n                    if type(setup_codes) is str:\n                        setup_codes = setup_codes.splitlines()\n\n                    setup_codes.extend(\n                        \"%s=%r\" % (constant_name, constant_value)\n                        for (\n                            constant_name,\n                            constant_value,\n                        ) in self.getExpressionConstants(full_name=full_name).items()\n                    )\n\n                    info = self.queryRuntimeInformationMultiple(\n                        \"%s_variables_%s\" % (full_name.asString(), count),\n                        setup_codes=setup_codes,\n                        values=tuple(declarations.items()),\n                    )\n\n                    variables.update(info.asDict())\n\n            _module_config_variables[full_name] = variables\n\n        return _module_config_variables[full_name]\n\n    def evaluateExpression(\n        self, full_name, expression, config_name, extra_context, single_value\n    ):\n        context = TagContext(logger=self, full_name=full_name, config_name=config_name)\n        context.update(control_tags)\n\n        context.update(_getEvaluationContext())\n\n        def get_variable(variable_name):\n            assert type(variable_name) is str, variable_name\n\n            result = self.getExpressionVariables(full_name=full_name)[variable_name]\n\n            addModuleInfluencingVariable(\n                module_name=full_name,\n                plugin_name=self.plugin_name,\n                variable_name=variable_name,\n                control_tags=context.used_tags,\n                result=result,\n            )\n\n            return result\n\n        def get_constant(constant_name):\n            assert type(constant_name) is str, constant_name\n\n            result = self.getExpressionConstants(full_name=full_name)[constant_name]\n\n            # TODO: Record the constant value in report.\n\n            return result\n\n        context[\"get_variable\"] = get_variable\n        context[\"get_constant\"] = get_constant\n\n        def get_parameter(parameter_name, default):\n            result = Options.getModuleParameter(full_name, parameter_name)\n\n            if result is None:\n                result = default\n\n            self.addModuleInfluencingParameter(\n                module_name=full_name,\n                parameter_name=parameter_name,\n                condition_tags_used=context.used_tags,\n                result=result,\n            )\n\n            return result\n\n        context[\"get_parameter\"] = get_parameter\n\n        if extra_context:\n            context.update(extra_context)\n\n        with withNoWarning():\n            # We trust the yaml files, pylint: disable=eval-used\n            try:\n                result = eval(expression, context)\n            except Exception as e:  # Catch all the things, pylint: disable=broad-except\n                if Options.is_debug:\n                    raise\n\n                self.sysexit(\n                    \"Error, failed to evaluate expression %r in this context, exception was '%s'.\"\n                    % (expression, e)\n                )\n\n        if type(result) not in (str, unicode):\n            if single_value:\n                self.sysexit(\n                    \"\"\"\\\nError, expression '%s' for module '%s' did not evaluate to 'str' result.\"\"\"\n                    % (expression, full_name)\n                )\n            else:\n                if type(result) not in (tuple, list):\n                    self.sysexit(\n                        \"\"\"\\\nError, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result.\"\"\"\n                        % (expression, full_name)\n                    )\n\n                for v in result:\n                    if type(v) not in (str, unicode):\n                        self.sysexit(\n                            \"\"\"\\\nError, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result.\"\"\"\n                            % (expression, full_name)\n                        )\n\n                # Make it immutable in case it's a list.\n                result = tuple(result)\n\n        return result\n\n    def evaluateCondition(self, full_name, condition):\n        # Note: Caching makes no sense yet, this should all be very fast and\n        # cache themselves. TODO: Allow plugins to contribute their own control\n        # tag values during creation and during certain actions.\n        if condition == \"True\":\n            return True\n        if condition == \"False\":\n            return False\n\n        context = TagContext(\n            logger=self, full_name=full_name, config_name=\"'when' configuration\"\n        )\n        context.update(control_tags)\n\n        context.update(_getEvaluationContext())\n\n        def get_parameter(parameter_name, default):\n            result = Options.getModuleParameter(full_name, parameter_name)\n\n            if result is None:\n                result = default\n\n            self.addModuleInfluencingParameter(\n                module_name=full_name,\n                parameter_name=parameter_name,\n                condition_tags_used=context.used_tags,\n                result=result,\n            )\n\n            return result\n\n        context[\"get_parameter\"] = get_parameter\n\n        with withNoWarning():\n            # We trust the yaml files, pylint: disable=eval-used\n            try:\n                result = eval(condition, context)\n            except Exception as e:  # Catch all the things, pylint: disable=broad-except\n                if Options.is_debug:\n                    raise\n\n                self.sysexit(\n                    \"Error, failed to evaluate condition '%s' in this context, exception was '%s'.\"\n                    % (condition, e)\n                )\n\n        if type(result) is not bool:\n            self.sysexit(\n                \"Error, condition '%s' for module '%s' did not evaluate to boolean result.\"\n                % (condition, full_name)\n            )\n\n        addModuleInfluencingCondition(\n            module_name=full_name,\n            plugin_name=self.plugin_name,\n            condition=condition,\n            control_tags=context.used_tags,\n            result=result,\n        )\n\n        return result\n\n    def addModuleInfluencingParameter(\n        self, module_name, parameter_name, condition_tags_used, result\n    ):\n        addModuleInfluencingParameter(\n            module_name=module_name,\n            plugin_name=self.plugin_name,\n            parameter_name=parameter_name,\n            condition_tags_used=condition_tags_used,\n            result=result,\n        )\n\n    def addModuleInfluencingDetection(\n        self, module_name, detection_name, detection_value\n    ):\n        addModuleInfluencingDetection(\n            module_name=module_name,\n            plugin_name=self.plugin_name,\n            detection_name=detection_name,\n            detection_value=detection_value,\n        )\n\n    @classmethod\n    def warning(cls, message, **kwargs):\n        # Doing keyword only arguments manually, to keep older Python compatibility, and avoid\n        # user errors still.\n        mnemonic = kwargs.pop(\"mnemonic\", None)\n        if kwargs:\n            plugins_logger.sysexit(\"Illegal keyword arguments for self.warning\")\n\n        plugins_logger.warning(cls.plugin_name + \": \" + message, mnemonic=mnemonic)\n\n    @classmethod\n    def info(cls, message, keep_format=False):\n        plugins_logger.info(message, prefix=cls.plugin_name, keep_format=keep_format)\n\n    @classmethod\n    def sysexit(cls, message, mnemonic=None, reporting=True):\n        plugins_logger.sysexit(\n            cls.plugin_name + \": \" + message, mnemonic=mnemonic, reporting=reporting\n        )\n\n\nclass NuitkaYamlPluginBase(NuitkaPluginBase):\n    \"\"\"Nuitka base class for all plugins that use yaml config\"\"\"\n\n    def __init__(self):\n        self.config = getYamlPackageConfiguration()\n\n    def getYamlConfigItem(\n        self, module_name, section, item_name, decide_relevant, default, recursive\n    ):\n        while True:\n            module_configs = self.config.get(module_name, section=section)\n\n            if module_configs is not None:\n                for module_config in module_configs:\n                    config_item = module_config.get(item_name, default)\n\n                    # Avoid condition, if the item is not relevant\n                    if decide_relevant is not None and not decide_relevant(config_item):\n                        continue\n\n                    if not self.evaluateCondition(\n                        full_name=module_name,\n                        condition=module_config.get(\"when\", \"True\"),\n                    ):\n                        continue\n\n                    if recursive:\n                        yield module_name, config_item\n                    else:\n                        yield config_item\n\n            if not recursive:\n                break\n\n            module_name = module_name.getPackageName()\n            if not module_name:\n                break\n\n    def getYamlConfigItemItems(\n        self, module_name, section, item_name, decide_relevant, recursive\n    ):\n        def dict_decide_relevant(item_dict):\n            if not item_dict:\n                return False\n\n            if decide_relevant is None:\n                return True\n\n            for key, value in item_dict.items():\n                if decide_relevant(key, value):\n                    return True\n\n            return False\n\n        for item_config in self.getYamlConfigItem(\n            module_name=module_name,\n            section=section,\n            item_name=item_name,\n            decide_relevant=dict_decide_relevant,\n            default={},\n            recursive=recursive,\n        ):\n            if recursive:\n                for key, value in item_config[1].items():\n                    if decide_relevant(key, value):\n                        yield item_config[0], key, value\n            else:\n                for key, value in item_config.items():\n                    if decide_relevant(key, value):\n                        yield key, value\n\n\ndef standalone_only(func):\n    \"\"\"For plugins that have functionality that should be done in standalone mode only.\"\"\"\n\n    @functools.wraps(func)\n    def wrapped(*args, **kwargs):\n        if isStandaloneMode():\n            return func(*args, **kwargs)\n        else:\n            if inspect.isgeneratorfunction(func):\n                return ()\n            else:\n                return None\n\n    return wrapped\n\n\nclass TagContext(dict):\n    def __init__(self, logger, full_name, config_name):\n        dict.__init__(self)\n\n        self.logger = logger\n        self.full_name = full_name\n        self.config_name = config_name\n\n        self.used_tags = OrderedSet()\n        self.used_variables = OrderedSet()\n\n    def __getitem__(self, key):\n        try:\n            self.used_tags.add(key)\n\n            return dict.__getitem__(self, key)\n        except KeyError:\n            if key.startswith(\"use_\"):\n                return False\n\n            self.logger.sysexit(\n                \"Identifier '%s' in %s of module '%s' is unknown.\"\n                % (key, self.config_name, self.full_name)\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/Plugins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\n\nPlugins: Welcome to Nuitka! This is your shortest way to become part of it.\n\nThis is to provide the base class for all plugins. Some of which are part of\nproper Nuitka, and some of which are waiting to be created and submitted for\ninclusion by you.\n\nThe base class in PluginBase will serve as documentation of available.\n\n\"\"\"\n\nimport inspect\nimport os\nimport sys\nimport traceback\nfrom contextlib import contextmanager\nfrom optparse import OptionConflictError, OptionGroup\n\nfrom nuitka import Options, OutputDirectories\nfrom nuitka.__past__ import basestring, iter_modules\nfrom nuitka.build.DataComposerInterface import deriveModuleConstantsBlobName\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.freezer.IncludedDataFiles import IncludedDataFile\nfrom nuitka.freezer.IncludedEntryPoints import IncludedEntryPoint\nfrom nuitka.ModuleRegistry import addUsedModule\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import plugins_logger, printLine\nfrom nuitka.utils.FileOperations import (\n    getDllBasename,\n    makePath,\n    putTextFileContents,\n)\nfrom nuitka.utils.Importing import importFileAsModule\nfrom nuitka.utils.ModuleNames import (\n    ModuleName,\n    checkModuleName,\n    makeTriggerModuleName,\n    post_module_load_trigger_name,\n    pre_module_load_trigger_name,\n)\n\nfrom .PluginBase import NuitkaPluginBase, control_tags\n\n# Maps plugin name to plugin instances.\nactive_plugins = OrderedDict()\nplugin_name2plugin_classes = {}\nplugin_options = {}\nplugin_values = {}\nuser_plugins = OrderedSet()\n\n# Trigger modules\npre_modules = {}\npre_modules_reasons = {}\npost_modules = {}\npost_modules_reasons = {}\nfake_modules = {}\nhas_active_gui_toolkit_plugin = False\n\n\n@contextmanager\ndef withPluginProblemReporting(plugin, template, args):\n    try:\n        yield\n    except Exception:  # Catch all the things, pylint: disable=broad-except\n        message = \"\"\"\\\nPlugin issue while working on '%s'. Please report the bug with the above \\\ntraceback included.\"\"\" % (\n            template % args\n        )\n\n        if Options.is_debug:\n            plugin.warning(message)\n            raise\n\n        traceback.print_exception(*sys.exc_info())\n\n        plugin.sysexit(message)\n\n\ndef withPluginModuleNameProblemReporting(plugin, module_name):\n    return withPluginProblemReporting(plugin, \"module '%s'\", module_name.asString())\n\n\ndef withPluginModuleProblemReporting(plugin, module):\n    return withPluginModuleNameProblemReporting(plugin, module.getFullName())\n\n\ndef _addActivePlugin(plugin_class, args, force=False):\n    plugin_name = plugin_class.plugin_name\n\n    # No duplicates please.\n    if not force:\n        assert plugin_name not in active_plugins.keys(), (\n            plugin_name,\n            active_plugins[plugin_name],\n        )\n\n    if args:\n        plugin_args = getPluginOptions(plugin_name)\n    else:\n        plugin_args = {}\n\n    with withPluginProblemReporting(plugin_class, \"Plugin initialization failed\", ()):\n        plugin_instance = plugin_class(**plugin_args)\n\n    assert isinstance(plugin_instance, NuitkaPluginBase), plugin_instance\n\n    active_plugins[plugin_name] = plugin_instance\n\n    is_gui_toolkit_plugin = getattr(plugin_class, \"plugin_gui_toolkit\", False)\n\n    # Singleton, pylint: disable=global-statement\n    global has_active_gui_toolkit_plugin\n    has_active_gui_toolkit_plugin = (\n        has_active_gui_toolkit_plugin or is_gui_toolkit_plugin\n    )\n\n    # Do GUI toolkit exclusion control tags generically. You may have two of\n    # them and we don't want them to override each other.\n    if is_gui_toolkit_plugin:\n        for binding_name in getGUIBindingNames():\n            is_matching = binding_name.lower() == plugin_class.binding_name.lower()\n\n            tag_name = \"use_%s\" % binding_name.lower()\n\n            # Set if matching, set to False only if not matching and not already set.\n            if is_matching:\n                control_tags[tag_name] = True\n            elif is_matching not in control_tags:\n                control_tags[tag_name] = False\n\n    control_tags.update(plugin_instance.getEvaluationConditionControlTags())\n\n\ndef getActivePlugins():\n    \"\"\"Return list of active plugins.\n\n    Returns:\n        list of plugins\n\n    \"\"\"\n\n    return active_plugins.values()\n\n\ndef getActiveQtPlugin():\n    \"\"\"Get active Qt plugin name.\"\"\"\n    for plugin_name in getQtPluginNames():\n        if hasActivePlugin(plugin_name):\n            if hasActivePlugin(plugin_name):\n                return plugin_name\n\n    return None\n\n\ndef getActiveQtPluginBindingName():\n    \"\"\"Get active Qt plugin binding name.\"\"\"\n    plugin_name = getActiveQtPlugin()\n\n    if plugin_name is None:\n        return None\n    else:\n        return getPluginClass(plugin_name).binding_name\n\n\ndef getQtBindingNames():\n    return (\"PySide\", \"PySide2\", \"PySide6\", \"PyQt4\", \"PyQt5\", \"PyQt6\")\n\n\ndef getOtherGUIBindingNames():\n    return (\"wx\", \"tkinter\", \"Tkinter\")\n\n\ndef getGUIBindingNames():\n    return getQtBindingNames() + getOtherGUIBindingNames()\n\n\ndef getQtPluginNames():\n    return tuple(qt_binding_name.lower() for qt_binding_name in getQtBindingNames())\n\n\ndef getOtherGuiPluginNames():\n    return (\"tk-inter\",)\n\n\ndef getGuiPluginNames():\n    return getQtPluginNames() + getOtherGuiPluginNames()\n\n\ndef hasActiveGuiPluginForBinding(binding_name):\n    if binding_name in (\"tkinter\", \"Tkinter\"):\n        return hasActivePlugin(\"tk-inter\")\n    elif binding_name in getQtBindingNames():\n        return hasActivePlugin(binding_name.lower())\n    else:\n        # For wx, we do not have a plugin right now, it just works, but\n        # also means it cannot be picked.\n        return False\n\n\ndef hasActivePlugin(plugin_name):\n    \"\"\"Decide if a plugin is active.\n\n    Args:\n        plugin_name - name of the plugin\n\n    Notes:\n        Detectors do not count as an active plugin and ignored.\n\n    Returns:\n        bool - plugin is loaded\n\n    \"\"\"\n    if plugin_name not in active_plugins:\n        return False\n\n    # Detectors do not count.\n    plugin_instance = active_plugins.get(plugin_name)\n    return not hasattr(plugin_instance, \"detector_for\")\n\n\ndef getUserActivatedPluginNames():\n    for plugin_name, plugin_instance in active_plugins.items():\n        # Detectors do not count.\n        if hasattr(plugin_instance, \"detector_for\"):\n            continue\n\n        # Always activated does not count either\n        if plugin_instance.isAlwaysEnabled():\n            continue\n\n        yield plugin_name\n\n\ndef getPluginClass(plugin_name):\n    # First, load plugin classes, to know what we are talking about.\n    loadPlugins()\n\n    # Backward compatibility.\n    plugin_name = Options.getPluginNameConsideringRenames(plugin_name)\n\n    if plugin_name not in plugin_name2plugin_classes:\n        for plugin_name2 in plugin_name2plugin_classes:\n            if plugin_name.lower() == plugin_name2.lower():\n                plugins_logger.sysexit(\n                    \"\"\"\\\nError, unknown plug-in '%s' in wrong case referenced, use '%s' instead.\"\"\"\n                    % (plugin_name, plugin_name2)\n                )\n\n        plugins_logger.sysexit(\"Error, unknown plug-in '%s' referenced.\" % plugin_name)\n\n    return plugin_name2plugin_classes[plugin_name][0]\n\n\ndef _addPluginClass(plugin_class, detector):\n    plugin_name = plugin_class.plugin_name\n\n    if plugin_name in plugin_name2plugin_classes:\n        plugins_logger.sysexit(\n            \"Error, plugins collide by name %s: %s <-> %s\"\n            % (plugin_name, plugin_class, plugin_name2plugin_classes[plugin_name])\n        )\n\n    plugin_name2plugin_classes[plugin_name] = (\n        plugin_class,\n        detector,\n    )\n\n\ndef _loadPluginClassesFromPackage(scan_package):\n    scan_path = scan_package.__path__\n\n    for item in iter_modules(scan_path):\n        if item.ispkg:  # spell-checker: ignore ispkg\n            continue\n\n        if python_version < 0x3C0:\n            module_loader = item.module_finder.find_module(item.name)\n        else:\n            module_loader = item.module_finder.find_spec(item.name).loader\n\n        # Ignore bytecode only left overs.\n        try:\n            if module_loader.get_filename().endswith(\".pyc\"):\n                continue\n        except AttributeError:\n            # Not a bytecode loader, but e.g. extension module, which is OK in case\n            # it was compiled with Nuitka.\n            pass\n\n        try:\n            plugin_module = module_loader.load_module(item.name)\n        except Exception:\n            if Options.is_non_debug:\n                plugins_logger.warning(\n                    \"Problem loading plugin %r ('%s'), ignored. Use '--debug' to make it visible.\"\n                    % (item.name, module_loader.get_filename())\n                )\n                continue\n\n            raise\n\n        # At least for Python2, this is not set properly, but we use it for package\n        # data loading.\n        plugin_module.__package__ = scan_package.__name__\n\n        plugin_classes = set(\n            obj\n            for obj in plugin_module.__dict__.values()\n            if isObjectAUserPluginBaseClass(obj)\n        )\n\n        detectors = [\n            plugin_class\n            for plugin_class in plugin_classes\n            if hasattr(plugin_class, \"detector_for\")\n        ]\n\n        # First the ones with detectors.\n        for detector in detectors:\n            plugin_class = detector.detector_for\n\n            if detector.__name__.replace(\n                \"NuitkaPluginDetector\", \"\"\n            ) != plugin_class.__name__.replace(\"NuitkaPlugin\", \"\"):\n                plugins_logger.warning(\n                    \"Class names %r and %r do not match NuitkaPlugin* and NuitkaPluginDetector* naming convention.\"\n                    % (plugin_class.__name__, detector.__name__)\n                )\n\n            assert detector.plugin_name is None, detector\n            detector.plugin_name = plugin_class.plugin_name\n\n            if plugin_class not in plugin_classes:\n                plugins_logger.sysexit(\n                    \"Plugin detector %r references unknown plugin %r\"\n                    % (detector, plugin_class)\n                )\n\n            plugin_classes.remove(detector)\n            plugin_classes.remove(plugin_class)\n\n            _addPluginClass(\n                plugin_class=plugin_class,\n                detector=detector,\n            )\n\n        # Remaining ones have no detector.\n        for plugin_class in plugin_classes:\n            _addPluginClass(plugin_class=plugin_class, detector=None)\n\n\ndef loadStandardPluginClasses():\n    \"\"\"Load plugin files located in 'standard' folder.\n\n    Notes:\n        Scan through the 'standard' and 'commercial' plugins. Import each valid\n        Python module (but not packages) and process it as a plugin.\n    Returns:\n        None\n    \"\"\"\n    import nuitka.plugins.standard\n\n    _loadPluginClassesFromPackage(nuitka.plugins.standard)\n\n    try:\n        import nuitka.plugins.commercial\n    except ImportError:\n        pass\n    else:\n        _loadPluginClassesFromPackage(nuitka.plugins.commercial)\n\n\nclass Plugins(object):\n    implicit_imports_cache = {}\n    extra_scan_paths_cache = {}\n\n    @staticmethod\n    def _considerImplicitImports(plugin, module):\n        result = []\n\n        def iterateModuleNames(value):\n            for v in value:\n                if type(v) in (tuple, list):\n                    plugin.sysexit(\n                        \"Plugin '%s' needs to be change to only return modules names, not %r (for module '%s')\"\n                        % (plugin.plugin_name, v, module.getFullName())\n                    )\n\n                if inspect.isgenerator(v):\n                    for w in iterateModuleNames(v):\n                        yield w\n\n                    return\n\n                if not checkModuleName(v):\n                    plugin.sysexit(\n                        \"Plugin '%s' returned an invalid module name, not %r (for module '%s')\"\n                        % (plugin, v, module.getFullName())\n                    )\n\n                yield ModuleName(v)\n\n        seen = set()\n\n        for full_name in iterateModuleNames(plugin.getImplicitImports(module)):\n            if full_name in seen:\n                continue\n            seen.add(full_name)\n\n            # Ignore dependencies on self. TODO: Make this an error for the\n            # plugin.\n            if full_name == module.getFullName():\n                continue\n\n            try:\n                module_filename = plugin.locateModule(full_name)\n            except Exception:\n                plugin.warning(\n                    \"Problem locating '%s' for implicit imports of '%s'.\"\n                    % (module.getFullName(), full_name)\n                )\n                raise\n\n            if module_filename is None:\n                if Options.isShowInclusion():\n                    plugin.info(\n                        \"Implicit module '%s' suggested for '%s' not found.\"\n                        % (full_name, module.getFullName())\n                    )\n\n                continue\n\n            result.append((full_name, module_filename))\n\n        if result and Options.isShowInclusion():\n            plugin.info(\n                \"Implicit dependencies of module '%s' added '%s'.\"\n                % (module.getFullName(), \",\".join(r[0] for r in result))\n            )\n\n        return result\n\n    @staticmethod\n    def _reportImplicitImports(plugin, module, implicit_imports):\n        from nuitka.importing.Importing import getModuleNameAndKindFromFilename\n        from nuitka.importing.Recursion import decideRecursion, recurseTo\n\n        for full_name, module_filename in implicit_imports:\n            # TODO: The module_kind should be forwarded from previous in the class using locateModule code.\n            _module_name2, module_kind = getModuleNameAndKindFromFilename(\n                module_filename\n            )\n\n            # This will get back to all other plugins allowing them to inhibit it though.\n            decision, decision_reason = decideRecursion(\n                using_module_name=module.getFullName(),\n                module_filename=module_filename,\n                module_name=full_name,\n                module_kind=module_kind,\n            )\n\n            if decision:\n                imported_module = recurseTo(\n                    module_name=full_name,\n                    module_filename=module_filename,\n                    module_kind=module_kind,\n                    source_ref=module.getSourceReference(),\n                    reason=\"implicit import\",\n                    using_module_name=module.module_name,\n                )\n\n                addUsedModule(\n                    module=imported_module,\n                    using_module=module,\n                    usage_tag=\"plugin:\" + plugin.plugin_name,\n                    reason=decision_reason,\n                    source_ref=module.source_ref,\n                )\n\n    @classmethod\n    def _getPackageExtraScanPaths(cls, plugin, package_name, package_dir):\n        with withPluginModuleNameProblemReporting(plugin, package_name):\n            for path in plugin.getPackageExtraScanPaths(package_name, package_dir):\n                if os.path.isdir(path):\n                    yield path\n\n    @classmethod\n    def getPackageExtraScanPaths(cls, package_name, package_dir):\n        key = package_name, package_dir\n\n        if key not in cls.extra_scan_paths_cache:\n            cls.extra_scan_paths_cache[key] = ()\n\n            for plugin in getActivePlugins():\n                cls.extra_scan_paths_cache[key] += tuple(\n                    cls._getPackageExtraScanPaths(\n                        plugin=plugin,\n                        package_name=package_name,\n                        package_dir=package_dir,\n                    )\n                )\n\n        return cls.extra_scan_paths_cache[key]\n\n    @classmethod\n    def considerImplicitImports(cls, module):\n        for plugin in getActivePlugins():\n            key = (module.getFullName(), plugin)\n\n            if key not in cls.implicit_imports_cache:\n                with withPluginModuleProblemReporting(plugin, module):\n                    cls.implicit_imports_cache[key] = tuple(\n                        cls._considerImplicitImports(plugin=plugin, module=module)\n                    )\n\n            cls._reportImplicitImports(\n                plugin=plugin,\n                module=module,\n                implicit_imports=cls.implicit_imports_cache[key],\n            )\n\n        # Pre and post load code may have been created, if so indicate it's used.\n        full_name = module.getFullName()\n\n        if full_name in pre_modules:\n            addUsedModule(\n                pre_modules[full_name],\n                using_module=module,\n                usage_tag=\"plugins\",\n                reason=\" \".join(pre_modules_reasons[full_name]),\n                source_ref=module.source_ref,\n            )\n\n        if full_name in post_modules:\n            addUsedModule(\n                module=post_modules[full_name],\n                using_module=module,\n                usage_tag=\"plugins\",\n                reason=\" \".join(post_modules_reasons[full_name]),\n                source_ref=module.source_ref,\n            )\n\n        if full_name in fake_modules:\n            for fake_module, plugin, reason in fake_modules[full_name]:\n                addUsedModule(\n                    module=fake_module,\n                    using_module=module,\n                    usage_tag=\"plugins\",\n                    reason=reason,\n                    source_ref=module.source_ref,\n                )\n\n    @staticmethod\n    def onCopiedDLLs(dist_dir, standalone_entry_points):\n        \"\"\"Lets the plugins modify entry points on disk.\"\"\"\n        for entry_point in standalone_entry_points:\n            if entry_point.kind.endswith(\"_ignored\"):\n                continue\n\n            for plugin in getActivePlugins():\n                dll_path = os.path.join(dist_dir, entry_point.dest_path)\n\n                with withPluginProblemReporting(plugin, \"DLL '%s'\", dll_path):\n                    plugin.onCopiedDLL(dll_path)\n\n    @staticmethod\n    def onBeforeCodeParsing():\n        \"\"\"Let plugins prepare for code parsing\"\"\"\n        for plugin in getActivePlugins():\n            plugin.onBeforeCodeParsing()\n\n    @staticmethod\n    def onStandaloneDistributionFinished(dist_dir):\n        \"\"\"Let plugins post-process the distribution folder in standalone mode\"\"\"\n        for plugin in getActivePlugins():\n            plugin.onStandaloneDistributionFinished(dist_dir)\n\n        standalone_binary = OutputDirectories.getResultFullpath(onefile=False)\n\n        for plugin in getActivePlugins():\n            plugin.onStandaloneBinary(standalone_binary)\n\n    @staticmethod\n    def onOnefileFinished(filename):\n        \"\"\"Let plugins post-process the onefile executable in onefile mode\"\"\"\n        for plugin in getActivePlugins():\n            plugin.onStandaloneDistributionFinished(filename)\n\n    @staticmethod\n    def onBootstrapBinary(filename):\n        \"\"\"Let plugins add to bootstrap binary in some way\"\"\"\n        for plugin in getActivePlugins():\n            plugin.onBootstrapBinary(filename)\n\n    @staticmethod\n    def onFinalResult(filename):\n        \"\"\"Let plugins add to final binary in some way\"\"\"\n        for plugin in getActivePlugins():\n            plugin.onFinalResult(filename)\n\n    @staticmethod\n    def considerExtraDlls(module):\n        \"\"\"Ask plugins to provide extra DLLs.\n\n        Notes:\n            These will be of type IncludedEntryPoint or generators providing them, so\n            we get \"yield from\" effective with simple yield.\n\n        \"\"\"\n\n        result = []\n\n        # TODO: This is probably something generic that only different\n        def _iterateExtraBinaries(plugin, value):\n            if value is None:\n                pass\n            elif isinstance(value, IncludedEntryPoint):\n                yield value\n            elif isinstance(value, (tuple, list)) or inspect.isgenerator(value):\n                for val in value:\n                    for v in _iterateExtraBinaries(plugin, val):\n                        yield v\n            else:\n                plugin.sysexit(\n                    \"Returned object '%s' for module '%s' but should do 'IncludedEntryPoint' or generator.\"\n                    % (repr(value), module.asString())\n                )\n\n        for plugin in getActivePlugins():\n            with withPluginModuleProblemReporting(plugin, module):\n                for entry_point in _iterateExtraBinaries(\n                    plugin, plugin.getExtraDlls(module)\n                ):\n                    result.append(entry_point)\n\n        return result\n\n    @staticmethod\n    def getModuleSpecificDllPaths(module_name):\n        \"\"\"Provide a list of directories, where DLLs should be searched for this package (or module).\n\n        Args:\n            module_name: name of a package or module, for which the DLL path addition applies.\n\n        \"\"\"\n        result = OrderedSet()\n        for plugin in getActivePlugins():\n            for dll_path in plugin.getModuleSpecificDllPaths(module_name):\n                result.add(dll_path)\n\n        return result\n\n    sys_path_additions_cache = {}\n\n    @classmethod\n    def getModuleSysPathAdditions(cls, module_name):\n        \"\"\"Provide a list of directories, that should be considered in 'PYTHONPATH' when this module is used.\n\n        Args:\n            module_name: name of a package or module\n        Returns:\n            iterable of paths\n        \"\"\"\n\n        if module_name not in cls.sys_path_additions_cache:\n            cls.sys_path_additions_cache[module_name] = OrderedSet()\n\n            for plugin in getActivePlugins():\n                for dll_path in plugin.getModuleSysPathAdditions(module_name):\n                    cls.sys_path_additions_cache[module_name].add(dll_path)\n\n        return cls.sys_path_additions_cache[module_name]\n\n    @staticmethod\n    def removeDllDependencies(dll_filename, dll_filenames):\n        \"\"\"Create list of removable shared libraries by scanning through the plugins.\n\n        Args:\n            dll_filename: shared library filename\n            dll_filenames: list of shared library filenames\n        Returns:\n            list of removable files\n        \"\"\"\n        dll_filenames = tuple(sorted(dll_filenames))\n\n        to_remove = OrderedSet()\n\n        for plugin in getActivePlugins():\n            removed_dlls = tuple(\n                plugin.removeDllDependencies(dll_filename, dll_filenames)\n            )\n\n            if removed_dlls and Options.isShowInclusion():\n                plugin.info(\n                    \"Removing DLLs %s of %s by plugin decision.\"\n                    % (dll_filename, removed_dlls)\n                )\n\n            for removed_dll in removed_dlls:\n                to_remove.add(removed_dll)\n\n        return to_remove\n\n    @staticmethod\n    def considerDataFiles(module):\n        \"\"\"For a given module, ask plugins for any needed data files it may require.\n\n        Args:\n            module: module object\n        Yields:\n            Data file description pairs, either (source, dest) or (func, dest)\n            where the func will be called to create the content dynamically.\n        \"\"\"\n\n        def _iterateIncludedDataFiles(plugin, value):\n            if value is None:\n                pass\n            elif isinstance(value, IncludedDataFile):\n                yield value\n            elif inspect.isgenerator(value):\n                for val in value:\n                    for v in _iterateIncludedDataFiles(plugin, val):\n                        yield v\n            else:\n                plugin.sysexit(\"Plugin return non-datafile '%s'\" % repr(value))\n\n        for plugin in getActivePlugins():\n            for value in plugin.considerDataFiles(module):\n                for included_datafile in _iterateIncludedDataFiles(plugin, value):\n                    yield included_datafile\n\n    @staticmethod\n    def getDataFileTags(included_datafile):\n        tags = OrderedSet([included_datafile.kind])\n\n        tags.update(Options.getDataFileTags(tags))\n\n        for plugin in getActivePlugins():\n            plugin.updateDataFileTags(included_datafile)\n\n        return tags\n\n    @staticmethod\n    def onDataFileTags(included_datafile):\n        for plugin in getActivePlugins():\n            plugin.onDataFileTags(included_datafile)\n\n    @classmethod\n    def _createTriggerLoadedModule(cls, module, trigger_name, code, flags):\n        \"\"\"Create a \"trigger\" for a module to be imported.\n\n        Notes:\n            The trigger will incorporate the code to be prepended / appended.\n            Called by @onModuleDiscovered.\n\n        Args:\n            module: the module object (serves as dict key)\n            trigger_name: string (\"preLoad\"/\"postLoad\")\n            code: the code string\n\n        Returns\n            trigger_module\n        \"\"\"\n\n        from nuitka.tree.Building import buildModule\n\n        module_name = makeTriggerModuleName(module.getFullName(), trigger_name)\n\n        # In debug mode, put the files in the build folder, so they can be looked up easily.\n        if Options.is_debug and \"HIDE_SOURCE\" not in flags:\n            source_path = os.path.join(\n                OutputDirectories.getSourceDirectoryPath(), module_name + \".py\"\n            )\n\n            putTextFileContents(filename=source_path, contents=code)\n\n        try:\n            trigger_module = buildModule(\n                module_filename=os.path.join(\n                    os.path.dirname(module.getCompileTimeFilename()),\n                    module_name.asPath() + \".py\",\n                ),\n                module_name=module_name,\n                reason=\"trigger\",\n                source_code=code,\n                is_top=False,\n                is_main=False,\n                module_kind=\"py\",\n                is_fake=module_name,\n                hide_syntax_error=False,\n            )\n        except SyntaxError as e:\n            plugins_logger.sysexit(\n                \"SyntaxError in plugin provided source code for '%s': %s.\"\n                % (module_name, e)\n            )\n\n        if trigger_module.getCompilationMode() == \"bytecode\":\n            trigger_module.setSourceCode(code)\n\n        return trigger_module\n\n    @classmethod\n    def onModuleDiscovered(cls, module):\n        # We offer plugins many ways to provide extra stuff\n        # pylint: disable=too-many-locals,too-many-statements\n        full_name = module.getFullName()\n\n        def _untangleLoadDescription(description):\n            if description and inspect.isgenerator(description):\n                description = tuple(description)\n\n            if description:\n                if type(description[0]) not in (tuple, list):\n                    description = [description]\n\n                for desc in description:\n                    if desc is None:\n                        pass\n                    elif len(desc) == 2:\n                        code, reason = desc\n                        flags = ()\n                    else:\n                        code, reason, flags = desc\n\n                        if flags is None:\n                            flags = ()\n                        elif type(flags) is str:\n                            flags = (flags,)\n\n                    yield plugin, code, reason, flags\n\n        def _untangleFakeDesc(description):\n            if description and inspect.isgenerator(description):\n                description = tuple(description)\n\n            if description:\n                if type(description[0]) not in (tuple, list):\n                    description = [description]\n\n                for desc in description:\n                    assert len(desc) == 4, desc\n                    yield plugin, desc[0], desc[1], desc[2], desc[3]\n\n        pre_module_load_descriptions = []\n        post_module_load_descriptions = []\n        fake_module_descriptions = []\n\n        if module.isMainModule():\n            plugin = None\n            pre_module_load_descriptions.extend(\n                _untangleLoadDescription(_getMainModulePreloadCodes())\n            )\n\n        for plugin in getActivePlugins():\n            plugin.onModuleDiscovered(module)\n\n            pre_module_load_descriptions.extend(\n                _untangleLoadDescription(\n                    description=plugin.createPreModuleLoadCode(module)\n                )\n            )\n            post_module_load_descriptions.extend(\n                _untangleLoadDescription(\n                    description=plugin.createPostModuleLoadCode(module)\n                )\n            )\n            fake_module_descriptions.extend(\n                _untangleFakeDesc(description=plugin.createFakeModuleDependency(module))\n            )\n\n        def combineLoadCodes(module_load_descriptions):\n            future_imports_code = []\n            normal_code_code = []\n            total_flags = OrderedSet()\n            reasons = []\n\n            for _plugin, code, reason, flags in module_load_descriptions:\n                if code:\n                    for line in code.splitlines():\n                        line = line + \"\\n\"\n\n                        if line.startswith(\"from __future__\"):\n                            future_imports_code.append(line)\n                        else:\n                            normal_code_code.append(line)\n\n                    total_flags.update(flags)\n                    reasons.append(reason)\n\n            total_code = future_imports_code + normal_code_code\n\n            return total_code, reasons, total_flags\n\n        if pre_module_load_descriptions:\n            total_code, reasons, total_flags = combineLoadCodes(\n                module_load_descriptions=pre_module_load_descriptions\n            )\n\n            if total_code:\n                assert full_name not in pre_modules\n\n                pre_modules[full_name] = cls._createTriggerLoadedModule(\n                    module=module,\n                    trigger_name=pre_module_load_trigger_name,\n                    code=\"\".join(total_code),\n                    flags=total_flags,\n                )\n                pre_modules_reasons[full_name] = tuple(reasons)\n\n        if post_module_load_descriptions:\n            total_code, reasons, total_flags = combineLoadCodes(\n                module_load_descriptions=post_module_load_descriptions\n            )\n\n            if total_code:\n                assert full_name not in post_modules\n\n                post_modules[full_name] = cls._createTriggerLoadedModule(\n                    module=module,\n                    trigger_name=post_module_load_trigger_name,\n                    code=\"\".join(total_code),\n                    flags=total_flags,\n                )\n                post_modules_reasons[full_name] = reasons\n\n        if fake_module_descriptions:\n            fake_modules[full_name] = []\n\n            from nuitka.tree.Building import buildModule\n\n            for (\n                plugin,\n                fake_module_name,\n                source_code,\n                fake_filename,\n                reason,\n            ) in fake_module_descriptions:\n                fake_module = buildModule(\n                    module_filename=fake_filename,\n                    module_name=fake_module_name,\n                    reason=\"fake\",\n                    source_code=source_code,\n                    is_top=False,\n                    is_main=False,\n                    module_kind=\"py\",\n                    is_fake=fake_module_name,\n                    hide_syntax_error=False,\n                )\n\n                if fake_module.getCompilationMode() == \"bytecode\":\n                    fake_module.setSourceCode(source_code)\n\n                fake_modules[full_name].append((fake_module, plugin, reason))\n\n    @staticmethod\n    def onModuleSourceCode(module_name, source_filename, source_code):\n        assert type(module_name) is ModuleName\n        assert type(source_code) is str\n\n        contributing_plugins = OrderedSet()\n\n        for plugin in getActivePlugins():\n            with withPluginModuleNameProblemReporting(plugin, module_name):\n                new_source_code = plugin.onModuleSourceCode(\n                    module_name=module_name,\n                    source_filename=source_filename,\n                    source_code=source_code,\n                )\n                if new_source_code is not None and new_source_code != source_code:\n                    source_code = new_source_code\n                    contributing_plugins.add(plugin)\n\n                assert type(source_code) is str\n\n        return source_code, contributing_plugins\n\n    @staticmethod\n    def onFrozenModuleBytecode(module_name, is_package, bytecode):\n        assert type(module_name) is ModuleName\n        assert bytecode.__class__.__name__ == \"code\"\n\n        for plugin in getActivePlugins():\n            bytecode = plugin.onFrozenModuleBytecode(module_name, is_package, bytecode)\n            assert bytecode.__class__.__name__ == \"code\"\n\n        return bytecode\n\n    @staticmethod\n    def onModuleEncounter(using_module_name, module_name, module_filename, module_kind):\n        result = None\n        deciding_plugins = []\n\n        for plugin in getActivePlugins():\n            must_recurse = plugin.onModuleEncounter(\n                using_module_name=using_module_name,\n                module_name=module_name,\n                module_filename=module_filename,\n                module_kind=module_kind,\n            )\n\n            if must_recurse is None:\n                continue\n\n            if type(must_recurse) is not tuple and must_recurse not in (True, False):\n                plugin.sysexit(\n                    \"Error, onModuleEncounter code failed to return a None or tuple(bool, reason) result.\"\n                )\n\n            if result is not None:\n                if result[0] != must_recurse[0]:\n                    plugin.sysexit(\n                        \"Error, decision %s does not match other plugin '%s' decision.\"\n                        % (\n                            must_recurse[0],\n                            \".\".join(\n                                deciding_plugin.plugin_name\n                                for deciding_plugin in deciding_plugins\n                            ),\n                        )\n                    )\n\n            deciding_plugins.append(plugin)\n            result = must_recurse\n\n        return result, deciding_plugins\n\n    module_usage_looked_ahead_cache = set()\n\n    @classmethod\n    def onModuleUsageLookAhead(cls, module_name, module_filename, module_kind):\n        if module_name in cls.module_usage_looked_ahead_cache:\n            return\n\n        cls.module_usage_looked_ahead_cache.add(module_name)\n\n        # Lazy load the source code if a plugin wants it, the pre_load caches\n        # the result for later usage.\n        def getModuleSourceCode():\n            if module_kind != \"py\":\n                return None\n\n            from nuitka.tree.SourceHandling import readSourceCodeFromFilename\n\n            if os.path.isdir(module_filename):\n                source_filename = os.path.join(module_filename, \"__init__.py\")\n            else:\n                source_filename = module_filename\n\n            if not os.path.isfile(source_filename):\n                return None\n\n            return readSourceCodeFromFilename(\n                module_name=module_name, source_filename=source_filename, pre_load=True\n            )\n\n        for plugin in getActivePlugins():\n            plugin.onModuleUsageLookAhead(\n                module_name=module_name,\n                module_filename=module_filename,\n                module_kind=module_kind,\n                get_module_source=getModuleSourceCode,\n            )\n\n    @staticmethod\n    def onModuleRecursion(\n        module_name, module_filename, module_kind, using_module_name, source_ref, reason\n    ):\n        for plugin in getActivePlugins():\n            plugin.onModuleRecursion(\n                module_name=module_name,\n                module_filename=module_filename,\n                module_kind=module_kind,\n                using_module_name=using_module_name,\n                source_ref=source_ref,\n                reason=reason,\n            )\n\n    @staticmethod\n    def onModuleInitialSet():\n        \"\"\"The initial set of root modules is complete, plugins may add more.\"\"\"\n\n        from nuitka.ModuleRegistry import addRootModule\n\n        for plugin in getActivePlugins():\n            for module in plugin.onModuleInitialSet():\n                addRootModule(module)\n\n    @staticmethod\n    def onModuleCompleteSet():\n        \"\"\"The final set of modules is determined, this is only for inspection, cannot change.\"\"\"\n        from nuitka.ModuleRegistry import getDoneModules\n\n        # Make sure it's immutable.\n        module_set = tuple(getDoneModules())\n\n        for plugin in getActivePlugins():\n            plugin.onModuleCompleteSet(module_set)\n\n    @staticmethod\n    def suppressUnknownImportWarning(importing, source_ref, module_name):\n        \"\"\"Let plugins decide whether to suppress import warnings for an unknown module.\n\n        Notes:\n            If all plugins return False or None, the return will be False, else True.\n        Args:\n            importing: the module which is importing \"module_name\"\n            source_ref: pointer to file source code or bytecode\n            module_name: the module to be imported\n        returns:\n            True or False (default)\n        \"\"\"\n        source_ref = importing.getSourceReference()\n\n        for plugin in getActivePlugins():\n            if plugin.suppressUnknownImportWarning(importing, module_name, source_ref):\n                return True\n\n        return False\n\n    @staticmethod\n    def decideCompilation(module_name):\n        \"\"\"Let plugins decide whether to C compile a module or include as bytecode.\n\n        Notes:\n            The decision is made by the first plugin not returning None.\n\n        Returns:\n            \"compiled\" (default) or \"bytecode\".\n        \"\"\"\n        for plugin in getActivePlugins():\n            value = plugin.decideCompilation(module_name)\n\n            if value is not None:\n                assert value in (\"compiled\", \"bytecode\")\n                return value\n\n        return None\n\n    preprocessor_symbols = None\n\n    @classmethod\n    def getPreprocessorSymbols(cls):\n        \"\"\"Let plugins provide C defines to be used in compilation.\n\n        Notes:\n            The plugins can each contribute, but are hopefully using\n            a namespace for their defines.\n\n        Returns:\n            OrderedDict(), where None value indicates no define value,\n            i.e. \"-Dkey=value\" vs. \"-Dkey\"\n        \"\"\"\n\n        # spell-checker: ignore -Dkey\n\n        if cls.preprocessor_symbols is None:\n            cls.preprocessor_symbols = OrderedDict()\n\n            for plugin in getActivePlugins():\n                value = plugin.getPreprocessorSymbols()\n\n                if value is not None:\n                    assert type(value) is dict, value\n\n                    # We order per plugin, but from the plugins, lets just take a dict\n                    # and achieve determinism by ordering the defines by name.\n                    for key, value in sorted(value.items()):\n                        # False alarm, pylint: disable=I0021,unsupported-assignment-operation\n                        cls.preprocessor_symbols[key] = value\n\n        return cls.preprocessor_symbols\n\n    build_definitions = None\n\n    @classmethod\n    def getBuildDefinitions(cls):\n        \"\"\"Let plugins provide C source defines to be used in compilation.\n\n        Notes:\n            The plugins can each contribute, but are hopefully using\n            a namespace for their defines. Only specific code sees these\n            if it chooses to include \"build_definitions.h\" file.\n\n        Returns:\n            OrderedDict() with keys and values.\"\n        \"\"\"\n\n        if cls.build_definitions is None:\n            cls.build_definitions = OrderedDict()\n\n            for plugin in getActivePlugins():\n                value = plugin.getBuildDefinitions()\n\n                if value is not None:\n                    assert type(value) is dict, value\n\n                    # We order per plugin, but from the plugins themselves, lets just assume\n                    # unordered dict and achieve determinism by ordering the defines by name.\n                    for key, value in sorted(value.items()):\n                        # False alarm, pylint: disable=I0021,unsupported-assignment-operation\n                        cls.build_definitions[key] = value\n\n        return cls.build_definitions\n\n    extra_include_directories = None\n\n    @classmethod\n    def getExtraIncludeDirectories(cls):\n        \"\"\"Let plugins extra directories to use for C includes in compilation.\n\n        Notes:\n            The plugins can each contribute, but are hopefully not colliding,\n            order will be plugin order.\n\n        Returns:\n            OrderedSet() of paths to include as well.\n        \"\"\"\n        if cls.extra_include_directories is None:\n            cls.extra_include_directories = OrderedSet()\n\n            for plugin in getActivePlugins():\n                value = plugin.getExtraIncludeDirectories()\n\n                if value:\n                    cls.extra_include_directories.update(value)\n\n        return cls.extra_include_directories\n\n    @staticmethod\n    def _getExtraCodeFiles(for_onefile):\n        result = OrderedDict()\n\n        for plugin in getActivePlugins():\n            value = plugin.getExtraCodeFiles()\n\n            if value is not None:\n                assert type(value) is dict\n\n                # We order per plugin, but from the plugins, lets just take a dict\n                # and achieve determinism by ordering the files by name.\n                for key, value in sorted(value.items()):\n                    if (for_onefile and \"onefile_\" not in key) or (\n                        not for_onefile and \"onefile_\" in key\n                    ):\n                        continue\n\n                    if not key.startswith(\"nuitka_\"):\n                        key = \"plugin.\" + plugin.plugin_name + \".\" + key\n\n                    assert key not in result, key\n                    result[key] = value\n\n        return result\n\n    @staticmethod\n    def writeExtraCodeFiles(onefile):\n        # Circular dependency.\n        from nuitka.tree.SourceHandling import writeSourceCode\n\n        source_dir = OutputDirectories.getSourceDirectoryPath(onefile=onefile)\n\n        for filename, source_code in Plugins._getExtraCodeFiles(onefile).items():\n            target_dir = os.path.join(source_dir, \"plugins\")\n\n            if not os.path.isdir(target_dir):\n                makePath(target_dir)\n\n            writeSourceCode(\n                filename=os.path.join(target_dir, filename), source_code=source_code\n            )\n\n    extra_link_libraries = None\n\n    @classmethod\n    def getExtraLinkLibraries(cls):\n        if cls.extra_link_libraries is None:\n            cls.extra_link_libraries = OrderedSet()\n\n            for plugin in getActivePlugins():\n                value = plugin.getExtraLinkLibraries()\n\n                if value is not None:\n                    if isinstance(value, basestring):\n                        cls.extra_link_libraries.add(os.path.normcase(value))\n                    else:\n                        for library_name in value:\n                            cls.extra_link_libraries.add(os.path.normcase(library_name))\n\n        return cls.extra_link_libraries\n\n    extra_link_directories = None\n\n    @classmethod\n    def getExtraLinkDirectories(cls):\n        if cls.extra_link_directories is None:\n            cls.extra_link_directories = OrderedSet()\n\n            for plugin in getActivePlugins():\n                value = plugin.getExtraLinkDirectories()\n\n                if value is not None:\n                    if isinstance(value, basestring):\n                        cls.extra_link_directories.add(value)\n                    else:\n                        for dir_name in value:\n                            cls.extra_link_directories.add(dir_name)\n\n        return cls.extra_link_directories\n\n    @classmethod\n    def onDataComposerRun(cls):\n        for plugin in getActivePlugins():\n            plugin.onDataComposerRun()\n\n    @classmethod\n    def onDataComposerResult(cls, blob_filename):\n        for plugin in getActivePlugins():\n            plugin.onDataComposerResult(blob_filename)\n\n    @classmethod\n    def deriveModuleConstantsBlobName(cls, data_filename):\n        result = deriveModuleConstantsBlobName(data_filename)\n\n        return cls.encodeDataComposerName(result)\n\n    @classmethod\n    def encodeDataComposerName(cls, name):\n        # Encoding needs to match generated source code output.\n        if str is not bytes:\n            name = name.encode(\"utf8\")\n\n        for plugin in getActivePlugins():\n            r = plugin.encodeDataComposerName(name)\n\n            if r is not None:\n                name = r\n                break\n\n        return name\n\n    @classmethod\n    def onFunctionBodyParsing(cls, provider, function_name, body):\n        module_name = provider.getParentModule().getFullName()\n\n        for plugin in getActivePlugins():\n            # TODO: Could record what functions got modified by what plugin\n            # and in what way checking the return value\n            plugin.onFunctionBodyParsing(\n                module_name=module_name,\n                function_name=function_name,\n                body=body,\n            )\n\n    @classmethod\n    def onClassBodyParsing(cls, provider, class_name, node):\n        module_name = provider.getParentModule().getFullName()\n\n        for plugin in getActivePlugins():\n            # TODO: Could record what classes got modified by what plugin\n            # and in what way checking the return value\n            plugin.onClassBodyParsing(\n                module_name=module_name,\n                class_name=class_name,\n                node=node,\n            )\n\n    @classmethod\n    def getCacheContributionValues(cls, module_name):\n        for plugin in getActivePlugins():\n            for value in plugin.getCacheContributionValues(module_name):\n                yield value\n\n    @classmethod\n    def getExtraConstantDefaultPopulation(cls):\n        for plugin in getActivePlugins():\n            for value in plugin.getExtraConstantDefaultPopulation():\n                yield value\n\n    @classmethod\n    def decideAllowOutsideDependencies(cls, module_name):\n        result = None\n        plugin_name = None\n\n        assert module_name is not None\n\n        for plugin in getActivePlugins():\n            value = plugin.decideAllowOutsideDependencies(module_name)\n\n            if value is True:\n                if result is False:\n                    plugin.sysexit(\n                        \"Error, conflicting allow/disallow outside dependencies of plug-in '%s'.\"\n                        % plugin_name\n                    )\n\n                result = True\n                plugin_name = plugin.plugin_name\n\n            elif value is False:\n                if result is False:\n                    plugin.sysexit(\n                        \"Error, conflicting allow/disallow outside dependencies of plug-in '%s'.\"\n                        % plugin_name\n                    )\n\n                result = False\n                plugin_name = plugin.plugin_name\n            elif value is not None:\n                plugin.sysexit(\n                    \"Error, can only return True, False, None from 'decideAllowOutsideDependencies' not %r\"\n                    % value\n                )\n\n        return result\n\n    @classmethod\n    def isAcceptableMissingDLL(cls, package_name, filename):\n        dll_basename = getDllBasename(os.path.basename(filename))\n\n        # Not a DLL filename, then it cannot be true, but it's kind of strange\n        # to get asked.\n        if dll_basename is None:\n            return False\n\n        result = None\n        plugin_name = None\n\n        for plugin in getActivePlugins():\n            value = plugin.isAcceptableMissingDLL(\n                package_name=package_name, dll_basename=dll_basename\n            )\n\n            if value is True:\n                if result is False:\n                    plugin.sysexit(\n                        \"Error, conflicting accept/reject missing DLLs of plug-in '%s'.\"\n                        % plugin_name\n                    )\n\n                result = True\n                plugin_name = plugin.plugin_name\n\n            elif value is False:\n                if result is False:\n                    plugin.sysexit(\n                        \"Error, conflicting accept/reject missing DLLs of plug-in '%s'.\"\n                        % plugin_name\n                    )\n\n                result = False\n                plugin_name = plugin.plugin_name\n            elif value is not None:\n                plugin.sysexit(\n                    \"Error, can only return True, False, None from 'isAcceptableMissingDLL' not %r\"\n                    % value\n                )\n\n        return result, plugin_name\n\n\ndef listPlugins():\n    \"\"\"Print available standard plugins.\"\"\"\n\n    loadPlugins()\n\n    printLine(\"The following plugins are available in Nuitka\".center(80))\n    printLine(\"-\" * 80)\n\n    plist = []\n    max_name_length = 0\n    for plugin_name in sorted(plugin_name2plugin_classes):\n        plugin = plugin_name2plugin_classes[plugin_name][0]\n\n        if plugin.isDeprecated():\n            continue\n\n        if hasattr(plugin, \"plugin_desc\"):\n            plist.append((plugin_name, plugin.plugin_desc))\n        else:\n            plist.append((plugin_name, \"\"))\n\n        max_name_length = max(len(plugin_name), max_name_length)\n\n    for line in plist:\n        printLine(\" \" + line[0].ljust(max_name_length + 1), line[1])\n\n\ndef isObjectAUserPluginBaseClass(obj):\n    \"\"\"Verify that a user plugin inherits from UserPluginBase.\"\"\"\n    try:\n        return (\n            obj is not NuitkaPluginBase\n            and issubclass(obj, NuitkaPluginBase)\n            and not inspect.isabstract(obj)\n            and not obj.__name__.endswith(\"PluginBase\")\n        )\n    except TypeError:\n        return False\n\n\ndef loadUserPlugin(plugin_filename):\n    \"\"\"Load of a user plugins and store them in list of active plugins.\n\n    Notes:\n        A plugin is accepted only if it has a non-empty variable plugin_name, which\n        does not equal that of a disabled (standard) plugin.\n        Supports plugin option specifications.\n    Returns:\n        None\n    \"\"\"\n    if not os.path.exists(plugin_filename):\n        plugins_logger.sysexit(\"Error, cannot find '%s'.\" % plugin_filename)\n\n    user_plugin_module = importFileAsModule(plugin_filename)\n\n    valid_file = False\n    plugin_class = None\n    for key in dir(user_plugin_module):\n        obj = getattr(user_plugin_module, key)\n        if not isObjectAUserPluginBaseClass(obj):\n            continue\n\n        plugin_name = getattr(obj, \"plugin_name\", None)\n        if plugin_name and plugin_name not in Options.getPluginsDisabled():\n            plugin_class = obj\n\n            valid_file = True\n            break  # do not look for more in that module\n\n    if not valid_file:  # this is not a plugin file ...\n        plugins_logger.sysexit(\"Error, '%s' is not a plugin file.\" % plugin_filename)\n\n    return plugin_class\n\n\n_loaded_plugins = False\n\n\ndef loadPlugins():\n    \"\"\"Initialize plugin class\n\n    Notes:\n        Load user plugins provided as Python script file names, and standard\n        plugins via their class attribute 'plugin_name'.\n\n        Several checks are made, see the loader functions.\n\n        User plugins are enabled as a first step, because they themselves may\n        enable standard plugins.\n\n    Returns:\n        None\n    \"\"\"\n\n    # Singleton, called potentially multiple times, pylint: disable=global-statement\n    global _loaded_plugins\n    if not _loaded_plugins:\n        _loaded_plugins = True\n\n        # now enable standard plugins\n        loadStandardPluginClasses()\n\n\ndef addStandardPluginCommandLineOptions(parser):\n    loadPlugins()\n\n    for _plugin_name, (plugin_class, _plugin_detector) in sorted(\n        plugin_name2plugin_classes.items()\n    ):\n        if plugin_class.isAlwaysEnabled():\n            _addPluginCommandLineOptions(\n                parser=parser,\n                plugin_class=plugin_class,\n            )\n\n\ndef activatePlugins():\n    \"\"\"Activate selected plugin classes\n\n    Args:\n        None\n\n    Notes:\n        This creates actual plugin instances, before only class objects were\n        used.\n\n        User plugins are activated as a first step, because they themselves may\n        enable standard plugins.\n\n    Returns:\n        None\n    \"\"\"\n    # Many cases, often with UI related decisions, pylint: disable=too-many-branches\n\n    loadPlugins()\n\n    # ensure plugin is known and not both, enabled and disabled\n    for plugin_name in Options.getPluginsEnabled() + Options.getPluginsDisabled():\n        if plugin_name not in plugin_name2plugin_classes:\n            plugins_logger.sysexit(\n                \"Error, unknown plug-in '%s' referenced.\" % plugin_name\n            )\n\n        if (\n            plugin_name in Options.getPluginsEnabled()\n            and plugin_name in Options.getPluginsDisabled()\n        ):\n            plugins_logger.sysexit(\n                \"Error, conflicting enable/disable of plug-in '%s'.\" % plugin_name\n            )\n\n    plugin_detectors = OrderedSet()\n\n    for plugin_name, (plugin_class, plugin_detector) in sorted(\n        plugin_name2plugin_classes.items()\n    ):\n        if plugin_name in Options.getPluginsEnabled():\n            if plugin_class.isAlwaysEnabled():\n                plugin_class.warning(\n                    \"Plugin is defined as always enabled, no need to enable it.\"\n                )\n\n            if plugin_class.isRelevant():\n                _addActivePlugin(plugin_class, args=True)\n            elif plugin_class.isDeprecated():\n                plugin_class.warning(\n                    \"This plugin has been deprecated, do not enable it anymore.\"\n                )\n            else:\n                plugin_class.warning(\n                    \"Not relevant with this OS, or Nuitka arguments given, not activated.\"\n                )\n        elif plugin_name in Options.getPluginsDisabled():\n            pass\n        elif plugin_class.isAlwaysEnabled() and plugin_class.isRelevant():\n            _addActivePlugin(plugin_class, args=True)\n        elif (\n            plugin_detector is not None\n            and Options.shallDetectMissingPlugins()\n            and plugin_detector.isRelevant()\n        ):\n            plugin_detectors.add(plugin_detector)\n\n    for plugin_class in user_plugins:\n        _addActivePlugin(plugin_class, args=True)\n\n    # Suppress GUI toolkit detectors automatically.\n    for plugin_detector in plugin_detectors:\n        if (\n            not has_active_gui_toolkit_plugin\n            or plugin_detector.plugin_name not in getGuiPluginNames()\n        ):\n            _addActivePlugin(plugin_detector, args=False)\n\n\ndef _addPluginCommandLineOptions(parser, plugin_class):\n    plugin_name = plugin_class.plugin_name\n\n    if plugin_name not in plugin_options:\n        option_group = OptionGroup(parser, \"Plugin options of '%s'\" % plugin_name)\n        try:\n            plugin_class.addPluginCommandLineOptions(option_group)\n        except OptionConflictError as e:\n            for other_plugin_name, other_plugin_option_list in plugin_options.items():\n                for other_plugin_option in other_plugin_option_list:\n                    # no public interface for that, pylint: disable=protected-access\n                    if (\n                        e.option_id in other_plugin_option._long_opts\n                        or other_plugin_option._short_opts\n                    ):\n                        plugins_logger.sysexit(\n                            \"Plugin '%s' failed to add options due to conflict with '%s' from plugin '%s.\"\n                            % (plugin_name, e.option_id, other_plugin_name)\n                        )\n\n        if option_group.option_list:\n            parser.add_option_group(option_group)\n            plugin_options[plugin_name] = option_group.option_list\n        else:\n            plugin_options[plugin_name] = ()\n\n\ndef addPluginCommandLineOptions(parser, plugin_names):\n    \"\"\"Add option group for the plugin to the parser.\n\n    Notes:\n        This is exclusively for use in the command line parsing. Not all\n        plugins have to have options. But this will add them to the\n        parser in a first pass, so they can be recognized in a second\n        pass with them included.\n\n    Returns:\n        None\n    \"\"\"\n    for plugin_name in plugin_names:\n        plugin_class = getPluginClass(plugin_name)\n        _addPluginCommandLineOptions(parser=parser, plugin_class=plugin_class)\n\n\ndef addUserPluginCommandLineOptions(parser, filename):\n    plugin_class = loadUserPlugin(filename)\n    _addPluginCommandLineOptions(parser=parser, plugin_class=plugin_class)\n\n    user_plugins.add(plugin_class)\n\n\ndef setPluginOptions(plugin_name, values):\n    \"\"\"Set the option values for the specified plugin.\n\n    Args:\n        plugin_name: plugin identifier\n        values: dictionary to be used for the plugin constructor\n    Notes:\n        Use this function, if you want to set the plugin values, without using\n        the actual command line parsing.\n\n        Normally the command line arguments are populating the dictionary for\n        the plugin, but this will be used if given, and command line parsing\n        is not done.\n    \"\"\"\n    assert isinstance(values, dict), values\n    plugin_values[plugin_name] = values\n\n\ndef getPluginOptions(plugin_name):\n    \"\"\"Return the options values for the specified plugin.\n\n    Args:\n        plugin_name: plugin identifier\n    Returns:\n        dict with key, value of options given, potentially from default values.\n    \"\"\"\n    result = plugin_values.get(plugin_name, {})\n\n    for option in plugin_options.get(plugin_name, {}):\n        option_name = option._long_opts[0]  # pylint: disable=protected-access\n\n        arg_value = getattr(Options.options, option.dest)\n\n        if \"[REQUIRED]\" in option.help:\n            if not arg_value:\n                plugins_logger.sysexit(\n                    \"Error, required plugin argument '%s' of Nuitka plugin '%s' not given.\"\n                    % (option_name, plugin_name)\n                )\n\n        result[option.dest] = arg_value\n\n    return result\n\n\ndef replaceTriggerModule(old, new):\n    \"\"\"Replace a trigger module with another form if it. For use in bytecode demotion.\"\"\"\n\n    found = None\n    for key, value in pre_modules.items():\n        if value is old:\n            found = key\n            break\n\n    if found is not None:\n        pre_modules[found] = new\n\n    found = None\n    for key, value in post_modules.items():\n        if value is old:\n            found = key\n            break\n\n    if found is not None:\n        post_modules[found] = new\n\n\ndef isTriggerModule(module):\n    \"\"\"Decide of a module is a trigger module.\"\"\"\n    return module in pre_modules.values() or module in post_modules.values()\n\n\n# TODO: Make this a dedicated thing generally.\ndef _getMainModulePreloadCodes():\n    forced_runtime_env_variable_values = (\n        Options.getForcedRuntimeEnvironmentVariableValues()\n    )\n    if not forced_runtime_env_variable_values:\n        return\n\n    result = [\"import os\"]\n\n    for (\n        forced_runtime_env_variable_name,\n        forced_runtime_env_variable_value,\n    ) in forced_runtime_env_variable_values:\n        result.append(\n            \"os.environ['%s'] = '%s'\"\n            % (forced_runtime_env_variable_name, forced_runtime_env_variable_value)\n        )\n\n    yield (\"\\n\".join(result), \"forcing environment variable(s)\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/AntiBloatPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to avoid bloat at compile time.\n\nNuitka hard codes stupid monkey patching normally not needed here and avoids\nthat to be done and causing massive degradations.\n\n\"\"\"\n\nimport ast\nimport re\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Errors import NuitkaForbiddenImportEncounter\nfrom nuitka.ModuleRegistry import getModuleByName\nfrom nuitka.plugins.PluginBase import NuitkaYamlPluginBase\nfrom nuitka.utils.ModuleNames import ModuleName\n\n# spell-checker: ignore dask,numba,statsmodels,matplotlib,sqlalchemy,ipykernel\n\n_mode_choices = (\"error\", \"warning\", \"nofollow\", \"allow\")\n\n\nclass NuitkaPluginAntiBloat(NuitkaYamlPluginBase):\n    # Lots of details, a bunch of state is cached and tracked across functions\n    # pylint: disable=too-many-instance-attributes\n\n    plugin_name = \"anti-bloat\"\n    plugin_desc = (\n        \"Patch stupid imports out of widely used library modules source codes.\"\n    )\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def __init__(\n        self,\n        noinclude_setuptools_mode,\n        noinclude_pytest_mode,\n        noinclude_unittest_mode,\n        noinclude_ipython_mode,\n        noinclude_dask_mode,\n        noinclude_numba_mode,\n        noinclude_default_mode,\n        custom_choices,\n        show_changes,\n    ):\n        # Many details, due to many repetitive arguments, pylint: disable=too-many-branches,too-many-statements\n\n        NuitkaYamlPluginBase.__init__(self)\n\n        self.show_changes = show_changes\n\n        # Default manually to default argument value:\n        if noinclude_setuptools_mode is None:\n            noinclude_setuptools_mode = noinclude_default_mode\n        if noinclude_pytest_mode is None:\n            noinclude_pytest_mode = noinclude_default_mode\n        if noinclude_unittest_mode is None:\n            noinclude_unittest_mode = noinclude_default_mode\n        if noinclude_ipython_mode is None:\n            noinclude_ipython_mode = noinclude_default_mode\n        if noinclude_dask_mode is None:\n            noinclude_dask_mode = noinclude_default_mode\n        if noinclude_numba_mode is None:\n            noinclude_numba_mode = noinclude_default_mode\n\n        self.handled_modules = OrderedDict()\n\n        # These should be checked, to allow disabling anti-bloat contents.\n        self.control_tags = OrderedDict()\n\n        if noinclude_setuptools_mode != \"allow\":\n            self.handled_modules[\"setuptools\"] = noinclude_setuptools_mode, \"setuptools\"\n            self.handled_modules[\"setuptools_scm\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"triton\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"Cython\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"cython\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"pyximport\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"paddle.utils.cpp_extension\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n            self.handled_modules[\"torch.utils.cpp_extension\"] = (\n                noinclude_setuptools_mode,\n                \"setuptools\",\n            )\n        else:\n            self.control_tags[\"use_setuptools\"] = True\n\n        if noinclude_pytest_mode != \"allow\":\n            self.handled_modules[\"_pytest\"] = noinclude_pytest_mode, \"pytest\"\n            self.handled_modules[\"pytest\"] = noinclude_pytest_mode, \"pytest\"\n            self.handled_modules[\"py\"] = noinclude_pytest_mode, \"pytest\"\n            self.handled_modules[\"nose2\"] = noinclude_pytest_mode, \"pytest\"\n            self.handled_modules[\"nose\"] = noinclude_pytest_mode, \"pytest\"\n            self.handled_modules[\"statsmodels.tools._testing\"] = (\n                noinclude_pytest_mode,\n                \"pytest\",\n            )\n            self.handled_modules[\"sqlalchemy.testing\"] = (\n                noinclude_pytest_mode,\n                \"pytest\",\n            )\n            self.handled_modules[\"distributed.utils_test\"] = (\n                noinclude_pytest_mode,\n                \"pytest\",\n            )\n        else:\n            self.control_tags[\"use_pytest\"] = True\n\n        if noinclude_unittest_mode != \"allow\":\n            self.handled_modules[\"unittest\"] = noinclude_unittest_mode, \"unittest\"\n            self.handled_modules[\"doctest\"] = noinclude_unittest_mode, \"unittest\"\n            self.handled_modules[\"test.support\"] = noinclude_unittest_mode, \"unittest\"\n            self.handled_modules[\"test.test_support\"] = (\n                noinclude_unittest_mode,\n                \"unittest\",\n            )\n            self.handled_modules[\"future.moves.test.support\"] = (\n                noinclude_unittest_mode,\n                \"unittest\",\n            )\n            self.handled_modules[\"keras.src.testing_infra\"] = (\n                noinclude_unittest_mode,\n                \"unittest\",\n            )\n            self.handled_modules[\"tf_keras.src.testing_infra\"] = (\n                noinclude_unittest_mode,\n                \"unittest\",\n            )\n        else:\n            self.control_tags[\"use_unittest\"] = True\n\n        if noinclude_ipython_mode != \"allow\":\n            self.handled_modules[\"IPython\"] = noinclude_ipython_mode, \"IPython\"\n            self.handled_modules[\"ipykernel\"] = noinclude_ipython_mode, \"IPython\"\n            self.handled_modules[\"jupyter_client\"] = (\n                noinclude_ipython_mode,\n                \"IPython\",\n            )\n            self.handled_modules[\"matplotlib_inline.backend_inline\"] = (\n                noinclude_ipython_mode,\n                \"IPython\",\n            )\n            self.handled_modules[\"altair._magics\"] = (\n                noinclude_ipython_mode,\n                \"IPython\",\n            )\n        else:\n            self.control_tags[\"use_ipython\"] = True\n\n        if noinclude_dask_mode != \"allow\":\n            self.handled_modules[\"dask\"] = noinclude_dask_mode, \"dask\"\n            self.handled_modules[\"distributed\"] = noinclude_dask_mode, \"dask\"\n        else:\n            self.control_tags[\"use_dask\"] = True\n\n        if noinclude_numba_mode != \"allow\":\n            self.handled_modules[\"numba\"] = noinclude_numba_mode, \"numba\"\n            self.handled_modules[\"sparse\"] = noinclude_numba_mode, \"numba\"\n            self.handled_modules[\"stumpy\"] = noinclude_numba_mode, \"numba\"\n            self.handled_modules[\"pandas.core._numba.kernels\"] = (\n                noinclude_numba_mode,\n                \"numba\",\n            )\n        else:\n            self.control_tags[\"use_numba\"] = True\n\n        for custom_choice in custom_choices:\n            if custom_choice.count(\":\") != 1:\n                self.sysexit(\n                    \"\"\"\\\nError, malformed value '%s' for '--noinclude-custom-mode' used. It has to be of \\\nform 'module_name:[%s]'.\"\"\"\n                    % (custom_choice, \"|\".join(_mode_choices))\n                )\n\n            module_name, mode = custom_choice.rsplit(\":\", 1)\n\n            if mode not in _mode_choices and mode != \"bytecode\":\n                self.sysexit(\n                    \"Error, illegal mode given '%s' in '--noinclude-custom-mode=%s'\"\n                    % (mode, custom_choice)\n                )\n\n            self.handled_modules[ModuleName(module_name)] = mode, module_name\n\n            if mode == \"allow\":\n                self.control_tags[\"use_%s\" % module_name] = True\n\n        self.handled_module_namespaces = {}\n\n        for handled_module_name, (\n            mode,\n            intended_module_name,\n        ) in self.handled_modules.items():\n            if mode == \"warning\":\n                if intended_module_name not in self.handled_module_namespaces:\n                    self.handled_module_namespaces[intended_module_name] = set()\n                self.handled_module_namespaces[intended_module_name].add(\n                    handled_module_name\n                )\n\n        self.warnings_given = set()\n\n        # Keep track of modules prevented from automatically following and the\n        # information given for that.\n        self.no_auto_follows = {}\n\n        # Keep track of modules prevented from being followed at all.\n        self.no_follows = OrderedDict()\n\n        # Cache execution context for anti-bloat configs.\n        self.context_codes = {}\n\n    def getEvaluationConditionControlTags(self):\n        return self.control_tags\n\n    def getCacheContributionValues(self, module_name):\n        config = self.config.get(module_name, section=\"anti-bloat\")\n\n        if config:\n            yield str(config)\n\n            # TODO: Until we can change the evaluation to tell us exactly what\n            # control tag values were used, we have to make this one. We sort\n            # the values, to try and have order changes in code not matter.\n            yield str(tuple(sorted(self.handled_modules.items())))\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--show-anti-bloat-changes\",\n            action=\"store_true\",\n            dest=\"show_changes\",\n            default=False,\n            help=\"\"\"\\\nAnnotate what changes are by the plugin done.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-setuptools-mode\",\n            action=\"store\",\n            dest=\"noinclude_setuptools_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a 'setuptools' or import is encountered. This package can be big with\ndependencies, and should definitely be avoided. Also handles 'setuptools_scm'.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-pytest-mode\",\n            action=\"store\",\n            dest=\"noinclude_pytest_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a 'pytest' import is encountered. This package can be big with\ndependencies, and should definitely be avoided. Also handles 'nose' imports.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-unittest-mode\",\n            action=\"store\",\n            dest=\"noinclude_unittest_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a unittest import is encountered. This package can be big with\ndependencies, and should definitely be avoided.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-IPython-mode\",\n            action=\"store\",\n            dest=\"noinclude_ipython_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a IPython import is encountered. This package can be big with\ndependencies, and should definitely be avoided.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-dask-mode\",\n            action=\"store\",\n            dest=\"noinclude_dask_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a 'dask' import is encountered. This package can be big with\ndependencies, and should definitely be avoided.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-numba-mode\",\n            action=\"store\",\n            dest=\"noinclude_numba_mode\",\n            choices=_mode_choices,\n            default=None,\n            help=\"\"\"\\\nWhat to do if a 'numba' import is encountered. This package can be big with\ndependencies, and is currently not working for standalone. This package is\nbig with dependencies, and should definitely be avoided.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-default-mode\",\n            action=\"store\",\n            dest=\"noinclude_default_mode\",\n            choices=_mode_choices,\n            default=\"warning\",\n            help=\"\"\"\\\nThis actually provides the default \"warning\" value for above options, and\ncan be used to turn all of these on.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-custom-mode\",\n            action=\"append\",\n            dest=\"custom_choices\",\n            default=[],\n            help=\"\"\"\\\nWhat to do if a specific import is encountered. Format is module name,\nwhich can and should be a top level package and then one choice, \"error\",\n\"warning\", \"nofollow\", e.g. PyQt5:error.\"\"\",\n        )\n\n    def _getContextCode(self, module_name, anti_bloat_config):\n        context_code = anti_bloat_config.get(\"context\", \"\")\n        if type(context_code) in (tuple, list):\n            context_code = \"\\n\".join(context_code)\n\n        if context_code not in self.context_codes:\n            context = {}\n\n            try:\n                # We trust the yaml files, pylint: disable=exec-used\n                exec(context_code, context)\n            except Exception as e:  # pylint: disable=broad-except\n                self.sysexit(\n                    \"\"\"\\\nError, cannot exec module '%s', context code '%s' due to: %s\"\"\"\n                    % (module_name, context_code, e)\n                )\n\n            self.context_codes[context_code] = context\n\n        return dict(self.context_codes[context_code])\n\n    def _onModuleSourceCode(self, module_name, anti_bloat_config, source_code):\n        # Complex dealing with many cases, pylint: disable=too-many-branches\n\n        description = anti_bloat_config.get(\"description\", \"description not given\")\n\n        # To allow detection if it did anything.\n        change_count = 0\n\n        for replace_src, replace_code in anti_bloat_config.get(\n            \"replacements\", {}\n        ).items():\n            # Avoid the eval, if the replace doesn't hit.\n            if replace_src not in source_code:\n                continue\n\n            if replace_code:\n                replace_dst = self.evaluateExpression(\n                    full_name=module_name,\n                    expression=replace_code,\n                    config_name=\"module '%s' config 'replacements' \" % module_name,\n                    extra_context=self._getContextCode(\n                        module_name=module_name, anti_bloat_config=anti_bloat_config\n                    ),\n                    single_value=True,\n                )\n            else:\n                replace_dst = \"\"\n\n            old = source_code\n            source_code = source_code.replace(replace_src, replace_dst)\n\n            if old != source_code:\n                change_count += 1\n\n        for replace_src, replace_dst in anti_bloat_config.get(\n            \"replacements_plain\", {}\n        ).items():\n            old = source_code\n            source_code = source_code.replace(replace_src, replace_dst)\n\n            if old != source_code:\n                change_count += 1\n\n        for replace_src, replace_dst in anti_bloat_config.get(\n            \"replacements_re\", {}\n        ).items():\n            old = source_code\n            source_code = re.sub(replace_src, replace_dst, source_code)\n\n            if old != source_code:\n                change_count += 1\n\n        append_code = anti_bloat_config.get(\"append_result\", \"\")\n        if type(append_code) in (tuple, list):\n            append_code = \"\\n\".join(append_code)\n\n        if append_code:\n            append_result = self.evaluateExpression(\n                full_name=module_name,\n                expression=append_code,\n                config_name=\"module '%s' config 'append_code'\" % module_name,\n                extra_context=self._getContextCode(\n                    module_name=module_name, anti_bloat_config=anti_bloat_config\n                ),\n                single_value=True,\n            )\n\n            source_code += \"\\n\" + append_result\n            change_count += 1\n\n        append_plain = anti_bloat_config.get(\"append_plain\", \"\")\n        if type(append_plain) in (tuple, list):\n            append_plain = \"\\n\".join(append_plain)\n\n        if append_plain:\n            source_code += \"\\n\" + append_plain\n            change_count += 1\n\n        if change_count > 0 and self.show_changes:\n            self.info(\n                \"Handling module '%s' with %d change(s) for: %s.\"\n                % (module_name.asString(), change_count, description)\n            )\n\n        module_code = anti_bloat_config.get(\"module_code\", None)\n\n        if module_code is not None:\n            assert not change_count\n\n            if self.show_changes:\n                self.info(\n                    \"Handling module '%s' with full replacement : %s.\"\n                    % (module_name.asString(), description)\n                )\n\n            source_code = module_code\n\n        return source_code\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        for anti_bloat_config in self.config.get(module_name, section=\"anti-bloat\"):\n            if self.evaluateCondition(\n                full_name=module_name, condition=anti_bloat_config.get(\"when\", \"True\")\n            ):\n                source_code = self._onModuleSourceCode(\n                    module_name=module_name,\n                    anti_bloat_config=anti_bloat_config,\n                    source_code=source_code,\n                )\n\n        return source_code\n\n    def _onFunctionBodyParsing(\n        self, module_name, anti_bloat_config, function_name, body\n    ):\n        replace_code = anti_bloat_config.get(\"change_function\", {}).get(function_name)\n\n        if replace_code == \"un-callable\":\n            replace_code = \"\"\"'raise RuntimeError(\"Must not call %s.%s\")'\"\"\" % (\n                module_name,\n                function_name,\n            )\n\n        if replace_code is None:\n            return False\n\n        replacement = self.evaluateExpression(\n            full_name=module_name,\n            expression=replace_code,\n            config_name=\"module '%s' config 'change_function' of '%s'\"\n            % (module_name, function_name),\n            extra_context=self._getContextCode(\n                module_name=module_name, anti_bloat_config=anti_bloat_config\n            ),\n            single_value=True,\n        )\n\n        # Single node is required, extract the generated module body with\n        # single expression only statement value or a function body.\n        replacement = ast.parse(replacement).body[0]\n\n        if type(replacement) is ast.Expr:\n            if type(replacement.value) is ast.Lambda:\n                body[:] = [ast.Return(replacement.value.body)]\n            else:\n                body[:] = [ast.Return(replacement.value)]\n        elif type(replacement) is ast.Raise:\n            body[:] = [replacement]\n        else:\n            body[:] = replacement.body\n\n        if self.show_changes:\n            self.info(\n                \"Updated module '%s' function '%s'.\"\n                % (module_name.asString(), function_name)\n            )\n\n        return True\n\n    def onFunctionBodyParsing(self, module_name, function_name, body):\n        result = False\n\n        config = self.config.get(module_name, section=\"anti-bloat\")\n\n        if config:\n            for anti_bloat_config in config:\n                if self._onFunctionBodyParsing(\n                    module_name=module_name,\n                    anti_bloat_config=anti_bloat_config,\n                    function_name=function_name,\n                    body=body,\n                ):\n                    result = True\n\n        return result\n\n    def _onClassBodyParsing(self, module_name, anti_bloat_config, class_name, node):\n        replace_code = anti_bloat_config.get(\"change_class\", {}).get(class_name)\n\n        if replace_code == \"un-usable\":\n            replace_code = \"\"\"\n'''\nclass %(class_name)s:\n    def __init__(self, *args, **kwargs):\n        raise RuntimeError(\"Must not call %(module_name)s.%(class_name)s\")\n'''\n\"\"\" % {\n                \"module_name\": module_name,\n                \"class_name\": class_name,\n            }\n\n        if replace_code is None:\n            return False\n\n        replacement = self.evaluateExpression(\n            full_name=module_name,\n            expression=replace_code,\n            config_name=\"module '%s' config 'change_class' of '%s'\"\n            % (module_name, class_name),\n            extra_context=self._getContextCode(\n                module_name=module_name, anti_bloat_config=anti_bloat_config\n            ),\n            single_value=True,\n        )\n\n        # Single node is required, extract the generated module body with\n        # single expression only statement value or a function body.\n        replacement = ast.parse(replacement).body[0]\n\n        node.body[:] = replacement.body\n        node.bases = replacement.bases\n\n        if self.show_changes:\n            self.info(\n                \"Updated module '%s' class '%s'.\" % (module_name.asString(), class_name)\n            )\n\n        return True\n\n    def onClassBodyParsing(self, module_name, class_name, node):\n        result = False\n\n        config = self.config.get(module_name, section=\"anti-bloat\")\n\n        if config:\n            for anti_bloat_config in config:\n                if self._onClassBodyParsing(\n                    module_name=module_name,\n                    anti_bloat_config=anti_bloat_config,\n                    class_name=class_name,\n                    node=node,\n                ):\n                    result = True\n\n        return result\n\n    def _getModuleBloatModeOverrides(self, using_module_name, intended_module_name):\n        while 1:\n            config = self.config.get(using_module_name, section=\"anti-bloat\")\n\n            if config:\n                for anti_bloat_config in config:\n                    bloat_mode_overrides = anti_bloat_config.get(\n                        \"bloat-mode-overrides\", ()\n                    )\n\n                    if not bloat_mode_overrides:\n                        continue\n\n                    if self.evaluateCondition(\n                        full_name=intended_module_name,\n                        condition=anti_bloat_config.get(\"when\", \"True\"),\n                    ):\n                        for module_name, mode in bloat_mode_overrides.items():\n                            if module_name == intended_module_name:\n                                return mode\n\n            using_module_name = using_module_name.getPackageName()\n\n            if not using_module_name:\n                break\n\n        return None\n\n    def _applyNoFollowConfiguration(self, module_name):\n        for (\n            config_of_module_name,\n            no_follow,\n            description,\n        ) in self.getYamlConfigItemItems(\n            module_name=module_name,\n            section=\"anti-bloat\",\n            item_name=\"no-follow\",\n            decide_relevant=lambda key, value: True,\n            recursive=True,\n        ):\n            self.no_follows[no_follow] = (config_of_module_name, description)\n\n    def onModuleRecursion(\n        self,\n        module_name,\n        module_filename,\n        module_kind,\n        using_module_name,\n        source_ref,\n        reason,\n    ):\n        # pylint: disable=too-many-branches\n\n        # First off, activate \"no-follow\" configurations of this module.\n        self._applyNoFollowConfiguration(module_name=module_name)\n\n        # Do not even look at these. It's either included by a module that is in standard\n        # library, or included for a module in standard library.\n        if reason == \"stdlib\" or (\n            using_module_name is not None\n            and getModuleByName(using_module_name).reason == \"stdlib\"\n        ):\n            return\n\n        # This will allow \"unittest.mock\" to pass \"unittest\". It's kind of a hack and\n        # hopefully unusual.\n        if module_name == \"unittest.mock\" and module_name not in self.handled_modules:\n            return\n\n        for handled_module_name, (\n            mode,\n            intended_module_name,\n        ) in self.handled_modules.items():\n            # This will ignore internal usages. In case of error, e.g. above unittest\n            # could cause them to happen.\n            if using_module_name is not None and using_module_name.hasNamespace(\n                handled_module_name\n            ):\n                return\n\n            if module_name.hasNamespace(handled_module_name):\n                if using_module_name is not None:\n                    override_mode = self._getModuleBloatModeOverrides(\n                        using_module_name=using_module_name,\n                        intended_module_name=intended_module_name,\n                    )\n\n                    if override_mode is not None:\n                        mode = override_mode\n\n                # Make sure the compilation aborts or warns if asked to\n                if mode == \"error\":\n                    raise NuitkaForbiddenImportEncounter(\n                        module_name, intended_module_name\n                    )\n                if mode == \"warning\" and source_ref is not None:\n                    if using_module_name.hasOneOfNamespaces(\n                        self.handled_module_namespaces[intended_module_name]\n                    ):\n                        continue\n\n                    key = (\n                        module_name,\n                        using_module_name,\n                        source_ref.getLineNumber(),\n                    )\n\n                    if key not in self.warnings_given:\n                        if handled_module_name == intended_module_name:\n                            handled_module_name_desc = \"'%s'\" % handled_module_name\n                        else:\n                            handled_module_name_desc = (\n                                \"'%s' (intending to avoid '%s')\"\n                                % (handled_module_name, intended_module_name)\n                            )\n\n                        self.warning(\n                            \"\"\"\\\nUndesirable import of %s in '%s' (at '%s') encountered. It may \\\nslow down compilation.\"\"\"\n                            % (\n                                handled_module_name_desc,\n                                using_module_name,\n                                source_ref.getAsString(),\n                            ),\n                            mnemonic=\"unwanted-module\",\n                        )\n\n                        self.warnings_given.add(key)\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        for handled_module_name, (\n            mode,\n            intended_module_name,\n        ) in self.handled_modules.items():\n            if module_name.hasNamespace(handled_module_name):\n                # Either issue a warning, or pretend the module doesn't exist for standalone or\n                # at least will not be included.\n                if mode == \"nofollow\":\n                    if self.show_changes:\n                        self.info(\n                            \"Forcing import of '%s' (intending to avoid '%s') to not be followed.\"\n                            % (module_name, intended_module_name)\n                        )\n                    return (\n                        False,\n                        \"user requested to not follow '%s' (intending to avoid '%s') import\"\n                        % (module_name, intended_module_name),\n                    )\n\n        if using_module_name is not None:\n\n            def decideRelevant(key, value):\n                # Only checking keys of configs, pylint: disable=unused-argument\n\n                return module_name.hasNamespace(key)\n\n            for (\n                config_of_module_name,\n                no_auto_follow,\n                description,\n            ) in self.getYamlConfigItemItems(\n                module_name=using_module_name,\n                section=\"anti-bloat\",\n                item_name=\"no-auto-follow\",\n                decide_relevant=decideRelevant,\n                recursive=True,\n            ):\n                assert module_name.hasNamespace(no_auto_follow), no_auto_follow\n\n                self.no_auto_follows[no_auto_follow] = description\n\n                return (\n                    False,\n                    \"according to yaml 'no-auto-follow' configuration of '%s' for '%s'\"\n                    % (config_of_module_name, no_auto_follow),\n                )\n\n        for no_follow_pattern, (\n            config_of_module_name,\n            description,\n        ) in self.no_follows.items():\n            if module_name.matchesToShellPattern(no_follow_pattern)[0]:\n                return (\n                    False,\n                    \"according to yaml 'no-follow' configuration of '%s' for '%s'\"\n                    % (config_of_module_name, no_follow_pattern),\n                )\n\n        # Do not provide an opinion about it.\n        return None\n\n    def decideCompilation(self, module_name):\n        for handled_module_name, (\n            mode,\n            _intended_module_name,\n        ) in self.handled_modules.items():\n            if mode != \"bytecode\":\n                continue\n\n            if module_name.hasNamespace(handled_module_name):\n                return \"bytecode\"\n\n    def onModuleCompleteSet(self, module_set):\n        # TODO: Maybe have an entry point that works on the set of names\n        # instead, we are not looking at the modules, and most plugins probably\n        # do not care.\n        module_names = set(module.getFullName() for module in module_set)\n\n        for module_name, description in self.no_auto_follows.items():\n            # Some are irrelevant, e.g. when registering to a module that would have to\n            # be used elsewhere.\n            if description == \"ignore\":\n                continue\n\n            if module_name not in module_names:\n                self.info(\n                    \"\"\"\\\nNot including '%s' automatically in order to avoid bloat, but this may cause: %s.\"\"\"\n                    % (module_name, description)\n                )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to take advantage of pylint or PyDev annotations.\n\nNuitka can detect some things that PyLint and PyDev will complain about too,\nand sometimes it's a false alarm, so people add disable markers into their\nsource code. Nuitka does it itself.\n\nThis tries to parse the code for these markers and uses hooks to prevent Nuitka\nfrom warning about things, disabled to PyLint or Eclipse. The idea is that we\nwon't have another mechanism for Nuitka, but use existing ones instead.\n\nThe code for this is very incomplete, barely good enough to cover Nuitka's own\nusage of PyLint markers. PyDev is still largely to be started. You are welcome\nto grow both.\n\n\"\"\"\n\nimport re\n\nfrom nuitka.__past__ import intern\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginPylintEclipseAnnotations(NuitkaPluginBase):\n    plugin_name = \"pylint-warnings\"\n    plugin_desc = \"Support PyLint / PyDev linting source markers.\"\n\n    def __init__(self):\n        self.line_annotations = {}\n\n    def checkModuleSourceCode(self, module_name, source_code):\n        annotations = {}\n\n        for count, line in enumerate(source_code.split(\"\\n\"), 1):\n            match = re.search(r\"#.*pylint:\\s*disable=\\s*([\\w,-]+)\", line)\n\n            if match:\n                comment_only = line[: line.find(\"#\") - 1].strip() == \"\"\n\n                if comment_only:\n                    # TODO: Parse block wide annotations too.\n                    pass\n                else:\n                    annotations[count] = set(\n                        intern(match.strip()) for match in match.group(1).split(\",\")\n                    )\n\n        # Only remember them if there were any.\n        if annotations:\n            self.line_annotations[module_name] = annotations\n\n    def suppressUnknownImportWarning(self, importing, module_name, source_ref):\n        annotations = self.line_annotations.get(importing.getFullName(), {})\n\n        line_annotations = annotations.get(source_ref.getLineNumber(), ())\n\n        if \"F0401\" in line_annotations or \"import-error\" in line_annotations:\n            return True\n\n        return False\n\n\n# Disabled until it will be actually really useful, pylint: disable=using-constant-test\nif False:\n\n    class NuitkaPluginDetectorPylintEclipseAnnotations(NuitkaPluginBase):\n        detector_for = NuitkaPluginPylintEclipseAnnotations\n\n        def onModuleSourceCode(self, module_name, source_filename, source_code):\n            if re.search(r\"#\\s*pylint:\\s*disable=\\s*(\\w+)\", source_code):\n                self.warnUnusedPlugin(\n                    \"Understand PyLint/PyDev annotations for warnings.\"\n                )\n\n            # Do nothing to it.\n            return source_code\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DataFilesPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to find data files.\n\n\"\"\"\n\nimport os\nimport pkgutil\n\nfrom nuitka import Options\nfrom nuitka.code_generation.ConstantCodes import addDistributionMetadataValue\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonFlavors import isDebianPackagePython\nfrom nuitka.utils.Distributions import getDistribution\nfrom nuitka.utils.FileOperations import (\n    changeFilenameExtension,\n    getFileList,\n    resolveShellPatternToFilenames,\n)\nfrom nuitka.utils.Yaml import getYamlPackageConfiguration\n\n\nclass NuitkaPluginDataFileCollector(NuitkaPluginBase):\n    plugin_name = \"data-files\"\n\n    plugin_desc = \"Include data files specified by package configuration files.\"\n\n    def __init__(self):\n        self.config = getYamlPackageConfiguration()\n\n    @classmethod\n    def isRelevant(cls):\n        return Options.isStandaloneMode()\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def _considerDataFiles(self, module, data_file_config):\n        # Many details and cases to deal with\n        # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n        module_name = module.getFullName()\n        module_folder = module.getCompileTimeDirectory()\n\n        target_dir = data_file_config.get(\"dest_path\")\n\n        # Default to near module or inside package folder.\n        if target_dir is None:\n            if module.isCompiledPythonPackage() or module.isUncompiledPythonPackage():\n                target_dir = module_name.asPath()\n            else:\n                package_name = module_name.getPackageName()\n\n                if package_name is not None:\n                    target_dir = module_name.getPackageName().asPath()\n                else:\n                    target_dir = \".\"\n\n        patterns = data_file_config.get(\"patterns\")\n        if patterns is not None:\n            if type(patterns) is not list or not patterns:\n                self.sysexit(\n                    \"Error, requiring list below 'pattern' entry for '%s' entry.\"\n                    % module_name\n                )\n\n            # TODO: Pattern should be data file kind potentially.\n            for pattern in patterns:\n                pattern = self.evaluateExpressionOrConstant(\n                    full_name=module_name,\n                    expression=pattern,\n                    config_name=\"data file pattern for '%s'\" % module_name,\n                    extra_context=None,\n                    single_value=True,\n                )\n\n                pattern = os.path.join(module_folder, pattern)\n\n                for filename in resolveShellPatternToFilenames(pattern):\n                    filename_base = os.path.relpath(filename, module_folder)\n\n                    yield self.makeIncludedDataFile(\n                        source_path=filename,\n                        dest_path=os.path.normpath(\n                            os.path.join(target_dir, filename_base)\n                        ),\n                        reason=\"package data for '%s'\" % module_name.asString(),\n                        tags=\"config\",\n                    )\n\n        empty_dirs = data_file_config.get(\"empty_dirs\")\n        if empty_dirs is not None:\n            if type(empty_dirs) is not list or not empty_dirs:\n                self.sysexit(\n                    \"Error, requiring list below 'empty_dirs' entry for '%s' entry.\"\n                    % module_name\n                )\n\n            for empty_dir in empty_dirs:\n                yield self.makeIncludedEmptyDirectory(\n                    dest_path=os.path.join(target_dir, empty_dir),\n                    reason=\"empty dir needed for %r\" % module_name.asString(),\n                    tags=\"config\",\n                )\n\n        empty_dir_structures = data_file_config.get(\"empty_dir_structures\")\n        if empty_dir_structures is not None:\n            if type(empty_dir_structures) is not list or not empty_dir_structures:\n                self.sysexit(\n                    \"Error, requiring list below 'empty_dirs_structure' entry for '%s' entry.\"\n                    % module_name\n                )\n\n            # TODO: This ignored config dest_path, which is unused, but not consistent.\n            for included_data_file in self._getSubDirectoryFolders(\n                module, sub_dirs=empty_dir_structures\n            ):\n                yield included_data_file\n\n        dirs = data_file_config.get(\"dirs\")\n        if dirs is not None:\n            if type(dirs) is not list or not dirs:\n                self.sysexit(\n                    \"Error, requiring list below 'empty_dirs_structure' entry for '%s' entry.\"\n                    % module_name\n                )\n\n            for data_dir in dirs:\n                source_path = os.path.join(module_folder, data_dir)\n\n                if os.path.isdir(source_path):\n                    yield self.makeIncludedDataDirectory(\n                        source_path=source_path,\n                        dest_path=os.path.join(target_dir, data_dir),\n                        reason=\"package data directory '%s' for %r\"\n                        % (data_dir, module_name.asString()),\n                        tags=\"config\",\n                    )\n\n        include_pyi_file = data_file_config.get(\"include-pyi-file\")\n\n        if include_pyi_file == \"yes\":\n            pyi_filename = changeFilenameExtension(\n                path=module.getCompileTimeFilename(), extension=\".pyi\"\n            )\n\n            if os.path.exists(pyi_filename):\n                if (\n                    module.isCompiledPythonPackage()\n                    or module.isUncompiledPythonPackage()\n                ):\n                    module_path = module_name.asPath()\n                else:\n                    module_path = os.path.dirname(module_name.asPath())\n\n                yield self.makeIncludedDataFile(\n                    source_path=pyi_filename,\n                    dest_path=os.path.join(module_path, os.path.basename(pyi_filename)),\n                    reason=\"runtime required '.pyi' file for '%s'\"\n                    % module_name.asString(),\n                    tags=\"config\",\n                )\n\n        distribution_names = data_file_config.get(\"include-metadata\", ())\n\n        for distribution_name in distribution_names:\n            distribution = getDistribution(distribution_name)\n\n            if distribution is not None:\n                addDistributionMetadataValue(distribution_name, distribution)\n\n    def considerDataFiles(self, module):\n        full_name = module.getFullName()\n\n        for entry in self.config.get(full_name, section=\"data-files\"):\n            if self.evaluateCondition(\n                full_name=full_name, condition=entry.get(\"when\", \"True\")\n            ):\n                for included_data_file in self._considerDataFiles(\n                    module=module, data_file_config=entry\n                ):\n                    yield included_data_file\n\n        # TODO: Until the data files are a list and support features to do similar, namely\n        # to look up via package data interface \"pkgutil.get_data\" rather than file scan.\n        if full_name == \"lib2to3.pygram\" and isDebianPackagePython():\n            yield self.makeIncludedGeneratedDataFile(\n                data=pkgutil.get_data(\"lib2to3\", \"Grammar.txt\"),\n                dest_path=\"lib2to3/Grammar.txt\",\n                reason=\"package data for '%s'\" % full_name,\n                tags=\"config\",\n            )\n\n            yield self.makeIncludedGeneratedDataFile(\n                data=pkgutil.get_data(\"lib2to3\", \"PatternGrammar.txt\"),\n                dest_path=\"lib2to3/PatternGrammar.txt\",\n                reason=\"package data for '%s'\" % full_name,\n                tags=\"config\",\n            )\n\n    def _getSubDirectoryFolders(self, module, sub_dirs):\n        \"\"\"Get dirnames in given subdirectories of the module.\n\n        Notes:\n            All dirnames in folders below one of the sub_dirs are recursively\n            retrieved and returned shortened to begin with the string of subdir.\n        Args:\n            module: module object\n            sub_dirs: sub folder name(s) - tuple\n        Returns:\n            makeIncludedEmptyDirectory of found dirnames.\n        \"\"\"\n\n        module_dir = module.getCompileTimeDirectory()\n        file_list = []\n\n        data_dirs = [os.path.join(module_dir, subdir) for subdir in sub_dirs]\n\n        # Gather the full file list, probably makes no sense to include bytecode files\n        file_list = sum(\n            (\n                getFileList(\n                    data_dir, ignore_dirs=(\"__pycache__\",), ignore_suffixes=(\".pyc\",)\n                )\n                for data_dir in data_dirs\n            ),\n            [],\n        )\n\n        if not file_list:\n            msg = \"No files or folders found for '%s' in subfolder(s) '%s' (%r).\" % (\n                module.getFullName(),\n                sub_dirs,\n                data_dirs,\n            )\n            self.warning(msg)\n\n        is_package = (\n            module.isCompiledPythonPackage() or module.isUncompiledPythonPackage()\n        )\n\n        # We need to preserve the package target path in the dist folder.\n        if is_package:\n            package_part = module.getFullName().asPath()\n        else:\n            package = module.getFullName().getPackageName()\n\n            if package is None:\n                package_part = \"\"\n            else:\n                package_part = package.asPath()\n\n        item_set = OrderedSet()\n\n        for f in file_list:\n            target = os.path.join(package_part, os.path.relpath(f, module_dir))\n\n            dir_name = os.path.dirname(target)\n            item_set.add(dir_name)\n\n        for dest_path in item_set:\n            yield self.makeIncludedEmptyDirectory(\n                dest_path=dest_path,\n                reason=\"Subdirectories of module %s\" % module.getFullName(),\n                tags=\"config\",\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DelvewheelPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Support for delvewheel, details in below class definitions.\n\n\"\"\"\n\nimport os\nimport re\n\nfrom nuitka import Options\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonFlavors import isAnacondaPython\nfrom nuitka.utils.FileOperations import listDllFilesFromDirectory\n\n# spell-checker: ignore delvewheel\n\n\nclass NuitkaPluginDelvewheel(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the delvewheel plugin.\n\n    This is a plugin to ensure that delvewheel DLLs are loading properly in\n    standalone mode. This needed to include the correct DLLs to the correct\n    place.\n    \"\"\"\n\n    plugin_name = \"delvewheel\"  # Nuitka knows us by this name\n    plugin_desc = (\n        \"Required for 'support' of delvewheel using packages in standalone mode.\"\n    )\n\n    def __init__(self):\n        # Special DLL directories if detected for a module.\n        self.dll_directories = {}\n\n        # Temporary variable when capturing current DLL directory of a module.\n        self.dll_directory = None\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @staticmethod\n    def isRelevant():\n        return Options.isStandaloneMode()\n\n    # This is used by our exec below, to capture the dll directory without using a free\n    # variable.\n    def _add_dll_directory(self, arg):\n        self.dll_directory = arg\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        # Avoid regular expression match if possible.\n        if \"_delvewheel_\" not in source_code:\n            return None\n\n        match = re.search(\n            r\"(def _delvewheel_(?:init_)?patch_(.*?)\\(\\):\\n.*?_delvewheel_(?:init_)?patch_\\2\\(\\))\",\n            source_code,\n            re.S,\n        )\n\n        if not match:\n            return None\n\n        delvewheel_version = match.group(2).replace(\"_\", \".\")\n\n        code = match.group(1)\n\n        code = code.replace(\"os.add_dll_directory\", \"add_dll_directory\")\n        code = code.replace(\"sys.version_info[:2] >= (3, 8)\", \"True\")\n        code = code.replace(\"sys.version_info[:2] >= (3, 10)\", \"True\")\n\n        self.dll_directory = None\n\n        # Fake the \"__file__\" to the proper value to the exec.\n        exec_globals = {\n            \"__file__\": self.locateModule(module_name) + \"\\\\__init__.py\",\n            \"add_dll_directory\": self._add_dll_directory,\n        }\n\n        self.dll_directory = None\n\n        # We believe this should be the easiest, pylint: disable=exec-used\n        exec(code, exec_globals)\n\n        # Copy it over. For Anaconda we allow exceptions, when it's not an\n        # Anaconda package, but a PyPI package, those mixes are acting strange.\n        if not isAnacondaPython():\n            assert self.dll_directory is not None, module_name\n\n        # At least the \"scs\" package puts the top level package folder there\n        # even with there being no DLLs anywhere, maybe a wrong usage of\n        # delvewheel SCS, maybe only on Windows.\n        if self.dll_directory is not None:\n            self.dll_directory = os.path.normpath(self.dll_directory)\n\n            if os.path.basename(self.dll_directory) in (\n                \"site-packages\",\n                \"dist-packages\",\n                \"vendor-packages\",\n            ):\n                self.dll_directory = None\n\n        self.dll_directories[module_name] = self.dll_directory\n\n        if self.dll_directories[module_name]:\n            self.addModuleInfluencingDetection(\n                module_name=module_name,\n                detection_name=\"delvewheel_version\",\n                detection_value=delvewheel_version,\n            )\n\n    def getExtraDlls(self, module):\n        full_name = module.getFullName()\n\n        dll_directory = self.dll_directories.get(full_name)\n\n        if dll_directory is not None:\n            for dll_filename, dll_basename in listDllFilesFromDirectory(dll_directory):\n                yield self.makeDllEntryPoint(\n                    source_path=dll_filename,\n                    dest_path=os.path.join(\n                        os.path.basename(dll_directory), dll_basename\n                    ),\n                    module_name=full_name,\n                    package_name=full_name,\n                    reason=\"needed by '%s'\" % full_name.asString(),\n                )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DillPlugin/DillPlugin.c",
    "content": "//     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n// C code for use when the dill-plugin is active\n\n#include \"nuitka/prelude.h\"\n\nvoid registerDillPluginTables(PyThreadState *tstate, char const *module_name, PyMethodDef *reduce_compiled_function,\n                              PyMethodDef *create_compiled_function) {\n    PyObject *function_tables = PyObject_GetAttrString((PyObject *)builtin_module, \"compiled_function_tables\");\n\n    if (function_tables == NULL) {\n        CLEAR_ERROR_OCCURRED(tstate);\n\n        function_tables = MAKE_DICT_EMPTY();\n        PyObject_SetAttrString((PyObject *)builtin_module, \"compiled_function_tables\", function_tables);\n    }\n\n    PyObject *funcs =\n        MAKE_TUPLE2_0(PyCFunction_New(reduce_compiled_function, NULL), PyCFunction_New(create_compiled_function, NULL));\n\n    PyDict_SetItemString(function_tables, module_name, funcs);\n}\n\n//     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n//     integrates with CPython, but also works on its own.\n//\n//     Licensed under the Apache License, Version 2.0 (the \"License\");\n//     you may not use this file except in compliance with the License.\n//     You may obtain a copy of the License at\n//\n//        http://www.apache.org/licenses/LICENSE-2.0\n//\n//     Unless required by applicable law or agreed to in writing, software\n//     distributed under the License is distributed on an \"AS IS\" BASIS,\n//     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//     See the License for the specific language governing permissions and\n//     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DillPlugin/dill-postLoad.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Plugin dill-compat has this as post load code for the \"dill\" package.\n# Not supposed to be good code,\n# pylint: disable=invalid-name,missing-module-docstring,protected-access\n# pylint: disable=too-many-branches,too-many-statements,used-before-assignment\nfrom types import CodeType\n\n# spell-checker: ignore kwdefaults,globalvars\n# Nuitka will optimize this away, but VS code will warn about them otherwise.\nfrom typing import TYPE_CHECKING\n\nimport dill._dill\n\nif str is bytes:\n    import __builtin__ as builtins  # Python2 code, pylint: disable=import-error\nelse:\n    import builtins\n\nif TYPE_CHECKING:\n    compiled_function_tables = {}\n\n\nclass ForCompiledTypeLookups:\n    def for_compiled_type(self):\n        pass\n\n\ncompiled_function = type(ForCompiledTypeLookups.for_compiled_type)\ncompiled_method = type(ForCompiledTypeLookups().for_compiled_type)\nassert \"__compiled__\" in globals()\n\ndill_version = tuple(int(d) for d in dill.__version__.split(\".\"))\n\n\n# Compiled methods need to be created.\n@dill.register(compiled_method)\ndef save_compiled_method(pickler, obj):\n    if str is not bytes:\n        pickler.save_reduce(compiled_method, (obj.__func__, obj.__self__), obj=obj)\n    else:\n        pickler.save_reduce(\n            compiled_method, (obj.im_func, obj.im_self, obj.im_class), obj=obj\n        )\n\n\nif str is bytes:\n\n    def _create_compiled_function2(module_name, func_values, func_dict, func_defaults):\n        if module_name not in compiled_function_tables:\n            __import__(module_name)\n\n        # This gets the \"_create_compiled_function\" of the module and calls it.\n        func = compiled_function_tables[module_name][1](*func_values)\n        if func_dict:\n            for key, value in func_dict.items():\n                func[key] = value\n\n        func.__defaults__ = func_defaults\n\n        return func\n\n\nif str is not bytes:\n\n    def _create_compiled_function3(\n        module_name, func_values, func_dict, func_defaults, func_kwdefaults\n    ):\n        if module_name not in compiled_function_tables:\n            __import__(module_name)\n\n        func = compiled_function_tables[module_name][1](*func_values)\n        if func_dict:\n            for key, value in func_dict.items():\n                func[key] = value\n\n        func.__defaults__ = func_defaults\n        func.__kwdefaults__ = func_kwdefaults\n\n        return func\n\n\n# Compiled methods might have to be created as well. This is very closely following\n# the code of \"dill._dill.save_function\" that is intended to do things for the\n# uncompiled function.\n@dill.register(compiled_function)\ndef save_compiled_function(pickler, obj):\n    # Complex beast, pylint: disable=too-many-locals\n\n    if dill_version >= (0, 3):\n        if not dill._dill._locate_function(obj, pickler):\n            if type(obj.__code__) is not CodeType:\n                # Some PyPy builtin functions have no module name, and thus are not\n                # able to be located\n                module_name = getattr(obj, \"__module__\", None)\n                if module_name is None:\n                    module_name = builtins.__name__\n\n                _module = dill._dill._import_module(module_name, safe=True)\n\n            _recurse = getattr(pickler, \"_recurse\", None)\n            _postproc = getattr(pickler, \"_postproc\", None)\n            _main_modified = getattr(pickler, \"_main_modified\", None)\n            _original_main = getattr(pickler, \"_original_main\", builtins)\n\n            postproc_list = []\n            if _recurse:\n                # recurse to get all globals referred to by obj\n                from dill.detect import globalvars\n\n                globs_copy = globalvars(obj, recurse=True, builtin=True)\n\n                # Add the name of the module to the globs dictionary to prevent\n                # the duplication of the dictionary. Pickle the unpopulated\n                # globals dictionary and set the remaining items after the function\n                # is created to correctly handle recursion.\n                globs = {\"__name__\": obj.__module__}\n            else:\n                globs_copy = obj.__globals__\n\n                # If the globals is the __dict__ from the module being saved as a\n                # session, substitute it by the dictionary being actually saved.\n                if _main_modified and globs_copy is _original_main.__dict__:\n                    globs_copy = getattr(pickler, \"_main\", _original_main).__dict__\n                    globs = globs_copy\n                # If the globals is a module __dict__, do not save it in the pickle.\n                elif (\n                    globs_copy is not None\n                    and obj.__module__ is not None\n                    and getattr(\n                        dill._dill._import_module(obj.__module__, True),\n                        \"__dict__\",\n                        None,\n                    )\n                    is globs_copy\n                ):\n                    globs = globs_copy\n                else:\n                    globs = {\"__name__\": obj.__module__}\n\n            if globs_copy is not None and globs is not globs_copy:\n                # In the case that the globals are copied, we need to ensure that\n                # the globals dictionary is updated when all objects in the\n                # dictionary are already created.\n                glob_ids = {id(g) for g in globs_copy.values()}\n                for stack_element in _postproc:\n                    if stack_element in glob_ids:\n                        _postproc[stack_element].append(\n                            (dill._dill._setitems, (globs, globs_copy))\n                        )\n                        break\n                else:\n                    postproc_list.append((dill._dill._setitems, (globs, globs_copy)))\n\n            state_dict = {}\n            for fattrname in (\"__doc__\", \"__kwdefaults__\", \"__annotations__\"):\n                fattr = getattr(obj, fattrname, None)\n                if fattr is not None:\n                    state_dict[fattrname] = fattr\n            if obj.__qualname__ != obj.__name__:\n                state_dict[\"__qualname__\"] = obj.__qualname__\n            if \"__name__\" not in globs or obj.__module__ != globs[\"__name__\"]:\n                state_dict[\"__module__\"] = obj.__module__\n\n            pickler.save_reduce(\n                _create_compiled_function3,\n                (\n                    obj.__module__,\n                    # This gets the \"_reduce_compiled_function\" of the module and calls it.\n                    compiled_function_tables[obj.__module__][0](obj),\n                    obj.__dict__,\n                    obj.__defaults__,\n                    obj.__kwdefaults__,\n                ),\n            )\n        else:\n            name = getattr(obj, \"__qualname__\", getattr(obj, \"__name__\", None))\n            dill._dill.StockPickler.save_global(pickler, obj, name=name)\n    else:\n        if not dill._dill._locate_function(obj):\n            stack = dill._dill.stack\n\n            _byref = getattr(pickler, \"_byref\", None)\n            _recurse = getattr(pickler, \"_recurse\", None)\n            _memo = (id(obj) in stack) and (_recurse is not None)\n            stack[id(obj)] = len(stack), obj\n\n            if str is not bytes:\n                # Python3\n                _super = (\"super\" in getattr(obj.__code__, \"co_names\", ())) and (\n                    _byref is not None\n                )\n                if _super:\n                    pickler._byref = True\n                if _memo:\n                    pickler._recurse = False\n\n                pickler.save_reduce(\n                    _create_compiled_function3,\n                    (\n                        obj.__module__,\n                        compiled_function_tables[obj.__module__][0](obj),\n                        obj.__dict__,\n                        obj.__defaults__,\n                        obj.__kwdefaults__,\n                    ),\n                )\n            else:\n                # Python2\n                _super = (\n                    (\"super\" in getattr(obj.__code__, \"co_names\", ()))\n                    and (_byref is not None)\n                    and getattr(pickler, \"_recurse\", False)\n                )\n                if _super:\n                    pickler._byref = True\n                if _memo:\n                    pickler._recurse = False\n\n                pickler.save_reduce(\n                    _create_compiled_function2,\n                    (\n                        obj.__module__,\n                        compiled_function_tables[obj.__module__][0](obj),\n                        obj.__dict__,\n                        obj.__defaults__,\n                    ),\n                )\n\n            if _super:\n                pickler._byref = _byref\n            if _memo:\n                pickler._recurse = _recurse\n        else:\n            dill._dill.StockPickler.save_global(pickler, obj)\n\n\nif __compiled__.standalone:  # pylint: disable=undefined-variable\n    builtins.compiled_method = compiled_method\n    builtins.compiled_function = compiled_function\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DillPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to make dill module work for compiled stuff.\n\n\"\"\"\n\nfrom nuitka.Options import shallMakeModule\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginDillWorkarounds(NuitkaPluginBase):\n    \"\"\"This is to make dill module work with compiled methods.\"\"\"\n\n    plugin_name = \"dill-compat\"\n\n    plugin_desc = \"Required for 'dill' package compatibility.\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return False\n\n    def createPostModuleLoadCode(self, module):\n        full_name = module.getFullName()\n\n        if full_name == \"dill\" and not shallMakeModule():\n            return (\n                self.getPluginDataFileContents(\"dill-postLoad.py\"),\n                \"\"\"\\\nExtending \"dill\" for compiled types to be pickle-able as well.\"\"\",\n            )\n\n        if shallMakeModule() and module.isTopModule():\n            return (\n                \"\"\"\\\nimport sys\nsys.modules[\"%(module_name)s\"]._create_compiled_function%(version)s = \\\n    sys.modules[\"%(module_name)s-preLoad\"]._create_compiled_function%(version)s\nsys.modules[\"%(module_name)s\"]._create_compiled_function%(version)s.__module__ = \\\n    \"%(module_name)s\"\n\"\"\"\n                % {\"module_name\": full_name, \"version\": \"2\" if str is bytes else \"3\"},\n                \"\"\"\nExtending \"dill\" for compiled types to be pickle-able as well.\"\"\",\n            )\n\n    def createPreModuleLoadCode(self, module):\n        if shallMakeModule() and module.isTopModule():\n            return (\n                self.getPluginDataFileContents(\"dill-postLoad.py\"),\n                \"\"\"\\\nExtending \"dill\" for compiled types to be pickle-able as well.\"\"\",\n            )\n\n    @staticmethod\n    def getPreprocessorSymbols():\n        return {\"_NUITKA_PLUGIN_DILL_ENABLED\": \"1\"}\n\n    def getExtraCodeFiles(self):\n        return {\"DillPlugin.c\": self.getPluginDataFileContents(\"DillPlugin.c\")}\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/DllFilesPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to tell Nuitka about DLLs needed for standalone imports.\n\nWhen DLLs are imported, we cannot see this and need to be told that. This\nencodes the knowledge we have for various modules. Feel free to add to this\nand submit patches to make it more complete.\n\"\"\"\n\nimport fnmatch\nimport os\nimport sys\n\nfrom nuitka.Options import isStandaloneMode\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Distributions import (\n    getDistributionFromModuleName,\n    getDistributionName,\n    isDistributionSystemPackage,\n)\nfrom nuitka.utils.FileOperations import (\n    listDllFilesFromDirectory,\n    listExeFilesFromDirectory,\n)\nfrom nuitka.utils.SharedLibraries import getPyWin32Dir\nfrom nuitka.utils.Utils import isFreeBSD, isLinux, isWin32Windows\nfrom nuitka.utils.Yaml import getYamlPackageConfiguration\n\n\nclass NuitkaPluginDllFiles(NuitkaPluginBase):\n    plugin_name = \"dll-files\"\n\n    plugin_desc = \"Include DLLs as per package configuration files.\"\n\n    def __init__(self):\n        self.config = getYamlPackageConfiguration()\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @staticmethod\n    def isRelevant():\n        return isStandaloneMode()\n\n    def _handleDllConfigFromFilenames(self, dest_path, dll_config, full_name):\n        # A lot of details here, pylint: disable=too-many-locals\n\n        # The \"when\" is at that level too for these.\n        if not self.evaluateCondition(\n            full_name=full_name, condition=dll_config.get(\"when\", \"True\")\n        ):\n            return\n\n        config_name = \"module '%s' DLL config\" % full_name\n\n        relative_path = self.evaluateExpressionOrConstant(\n            full_name=full_name,\n            expression=dll_config.get(\"relative_path\", \".\"),\n            config_name=config_name,\n            extra_context=None,\n            single_value=True,\n        )\n\n        module_filename = self.locateModule(full_name)\n\n        if os.path.isdir(module_filename):\n            module_directory = module_filename\n\n            if dest_path is None:\n                dest_path = os.path.join(full_name.asPath(), relative_path)\n        else:\n            module_directory = os.path.dirname(module_filename)\n\n            if dest_path is None:\n                dest_path = os.path.join(full_name.asPath(), \"..\", relative_path)\n\n        dll_dir = os.path.normpath(os.path.join(module_directory, relative_path))\n\n        if os.path.exists(dll_dir):\n            exe = dll_config.get(\"executable\", \"no\") == \"yes\"\n\n            suffixes = tuple(\n                self.evaluateExpressionOrConstant(\n                    full_name=full_name,\n                    expression=suffix,\n                    config_name=config_name,\n                    extra_context=None,\n                    single_value=True,\n                ).lstrip(\".\")\n                for suffix in dll_config.get(\"suffixes\", ())\n            )\n\n            prefixes = tuple(\n                self.evaluateExpressionOrConstant(\n                    full_name=full_name,\n                    expression=prefix,\n                    config_name=config_name,\n                    extra_context=None,\n                    single_value=True,\n                ).lstrip(\".\")\n                for prefix in dll_config.get(\"prefixes\", ())\n            )\n\n            for prefix in prefixes:\n                if exe:\n                    for exe_filename, filename in listExeFilesFromDirectory(\n                        dll_dir, prefix=prefix, suffixes=suffixes\n                    ):\n                        yield self.makeExeEntryPoint(\n                            source_path=exe_filename,\n                            dest_path=os.path.normpath(\n                                os.path.join(\n                                    dest_path,\n                                    filename,\n                                )\n                            ),\n                            module_name=full_name,\n                            package_name=full_name,\n                            reason=\"Yaml config of '%s'\" % full_name.asString(),\n                        )\n                else:\n                    for dll_filename, filename in listDllFilesFromDirectory(\n                        dll_dir, prefix=prefix, suffixes=suffixes\n                    ):\n                        yield self.makeDllEntryPoint(\n                            source_path=dll_filename,\n                            dest_path=os.path.normpath(\n                                os.path.join(\n                                    dest_path,\n                                    filename,\n                                )\n                            ),\n                            module_name=full_name,\n                            package_name=full_name,\n                            reason=\"Yaml config of '%s'\" % full_name.asString(),\n                        )\n\n    def _handleDllConfigByCodeResult(self, filename, full_name, dest_path, executable):\n        # Expecting absolute paths internally for DLL sources.\n        filename = os.path.abspath(filename)\n\n        if dest_path is None:\n            module_filename = self.locateModule(full_name)\n\n            if os.path.isdir(module_filename):\n                dest_path = full_name.asPath()\n            else:\n                dest_path = os.path.join(full_name.asPath(), \"..\")\n\n            dest_path = os.path.join(\n                dest_path,\n                os.path.relpath(filename, os.path.dirname(module_filename)),\n            )\n        else:\n            dest_path = os.path.join(\n                dest_path,\n                os.path.basename(filename),\n            )\n\n        dest_path = os.path.normpath(dest_path)\n\n        if executable:\n            yield self.makeExeEntryPoint(\n                source_path=filename,\n                dest_path=dest_path,\n                module_name=full_name,\n                package_name=full_name,\n                reason=\"Yaml config of '%s'\" % full_name.asString(),\n            )\n        else:\n            yield self.makeDllEntryPoint(\n                source_path=filename,\n                dest_path=dest_path,\n                module_name=full_name,\n                package_name=full_name,\n                reason=\"Yaml config of '%s'\" % full_name.asString(),\n            )\n\n    def _handleDllConfigByCode(self, dll_config, full_name, dest_path, count):\n        # The \"when\" is at that level too for these.\n        if not self.evaluateCondition(\n            full_name=full_name, condition=dll_config.get(\"when\", \"True\")\n        ):\n            return\n\n        setup_codes = dll_config.get(\"setup_code\")\n        filename_code = dll_config.get(\"filename_code\")\n\n        filename = self.queryRuntimeInformationMultiple(\n            \"%s_%s\" % (full_name.asString(), count),\n            setup_codes=setup_codes,\n            values=((\"filename\", filename_code),),\n        ).filename\n\n        if not filename:\n            self.warning(\n                \"\"\"\\\nDLL configuration by filename code for '%s' did not give a result. Either \\\nconditions are missing, or this version of the module needs treatment added.\"\"\"\n                % full_name.asString()\n            )\n\n        if type(filename) in (tuple, list):\n            filenames = filename\n        else:\n            filenames = (filename,)\n\n        for filename in filenames:\n            yield self._handleDllConfigByCodeResult(\n                filename=filename,\n                full_name=full_name,\n                dest_path=dest_path,\n                executable=dll_config.get(\"executable\", \"no\") == \"yes\",\n            )\n\n    def _handleDllConfig(self, dll_config, full_name, count):\n        dest_path = dll_config.get(\"dest_path\")\n\n        found = False\n\n        if \"by_code\" in dll_config:\n            for result in self._handleDllConfigByCode(\n                dll_config=dll_config.get(\"by_code\"),\n                full_name=full_name,\n                dest_path=dest_path,\n                count=count,\n            ):\n                yield result\n\n            found = True\n\n        if \"from_filenames\" in dll_config:\n            for result in self._handleDllConfigFromFilenames(\n                dll_config=dll_config.get(\"from_filenames\"),\n                full_name=full_name,\n                dest_path=dest_path,\n            ):\n                yield result\n\n            found = True\n\n        if not found:\n            self.sysexit(\n                \"Unsupported DLL config for module '%s' encountered.\"\n                % full_name.asString()\n            )\n\n    def getExtraDlls(self, module):\n        # TODO: Need to move all code here into configuration file usage.\n\n        full_name = module.getFullName()\n\n        # Checking for config, but also allowing fall through for cases that have to\n        # have some code still here.\n        found = 0\n\n        for count, dll_config in enumerate(\n            self.config.get(full_name, section=\"dlls\"), start=1\n        ):\n            if self.evaluateCondition(\n                full_name=full_name, condition=dll_config.get(\"when\", \"True\")\n            ):\n                for dll_entry_point in self._handleDllConfig(\n                    dll_config=dll_config, full_name=full_name, count=count\n                ):\n                    yield dll_entry_point\n                    found += 1\n\n        if found > 0:\n            self.reportFileCount(full_name, found)\n\n        # TODO: This is legacy code, ideally moved to yaml config over time.\n        if (\n            full_name == \"uuid\"\n            and (isLinux() or isFreeBSD())\n            and python_version < 0x300\n        ):\n            uuid_dll_path = self.locateDLL(\"uuid\")\n\n            if uuid_dll_path is not None:\n                yield self.makeDllEntryPoint(\n                    source_path=uuid_dll_path,\n                    dest_path=os.path.basename(uuid_dll_path),\n                    module_name=full_name,\n                    package_name=None,\n                    reason=\"needed by uuid package\",\n                )\n        elif full_name == \"iptc\" and isLinux():\n            import iptc.util  # pylint: disable=I0021,import-error\n\n            xtwrapper_dll = iptc.util.find_library(\"xtwrapper\")[0]\n            xtwrapper_dll_path = xtwrapper_dll._name  # pylint: disable=protected-access\n\n            yield self.makeDllEntryPoint(\n                source_path=xtwrapper_dll_path,\n                dest_path=os.path.basename(xtwrapper_dll_path),\n                module_name=full_name,\n                package_name=None,\n                reason=\"needed by 'iptc'\",\n            )\n        elif full_name == \"coincurve._libsecp256k1\" and isWin32Windows():\n            yield self.makeDllEntryPoint(\n                source_path=os.path.join(\n                    module.getCompileTimeDirectory(), \"libsecp256k1.dll\"\n                ),\n                dest_path=os.path.join(full_name.getPackageName(), \"libsecp256k1.dll\"),\n                module_name=full_name,\n                package_name=full_name.getPackageName(),\n                reason=\"needed by 'coincurve._libsecp256k1'\",\n            )\n        # TODO: This should be its own plugin.\n        elif (\n            full_name\n            in (\n                \"pythoncom\",\n                \"win32api\",\n                \"win32clipboard\",\n                \"win32console\",\n                \"win32cred\",\n                \"win32crypt\",\n                \"win32event\",\n                \"win32evtlog\",\n                \"win32file\",\n                \"win32gui\",\n                \"win32help\",\n                \"win32inet\",\n                \"win32job\",\n                \"win32lz\",\n                \"win32net\",\n                \"win32pdh\",\n                \"win32pipe\",\n                \"win32print\",\n                \"win32process\",\n                \"win32profile\",\n                \"win32ras\",\n                \"win32security\",\n                \"win32service\",\n                \"win32trace\",\n                \"win32transaction\",\n                \"win32ts\",\n                \"win32wnet\",\n                \"win32ui\",\n            )\n            and isWin32Windows()\n        ):\n            pywin_dir = getPyWin32Dir()\n\n            if pywin_dir is not None:\n                for dll_name in \"pythoncom\", \"pywintypes\":\n                    pythoncom_filename = \"%s%d%d.dll\" % (\n                        dll_name,\n                        sys.version_info[0],\n                        sys.version_info[1],\n                    )\n                    pythoncom_dll_path = os.path.join(pywin_dir, pythoncom_filename)\n\n                    if os.path.exists(pythoncom_dll_path):\n                        yield self.makeDllEntryPoint(\n                            source_path=pythoncom_dll_path,\n                            dest_path=pythoncom_filename,\n                            module_name=full_name,\n                            package_name=None,\n                            reason=\"needed by '%s'\" % full_name.asString(),\n                        )\n\n    def getModuleSpecificDllPaths(self, module_name):\n        for entry in self.config.get(module_name, section=\"import-hacks\"):\n            if self.evaluateCondition(\n                full_name=module_name, condition=entry.get(\"when\", \"True\")\n            ):\n                for item in self._getModuleSpecificDllPaths(config=entry):\n                    yield item\n\n    def _getModuleSpecificDllPaths(self, config):\n        for config_package_name in config.get(\"find-dlls-near-module\", ()):\n            module_filename = self.locateModule(config_package_name)\n\n            if module_filename is not None:\n                if os.path.isfile(module_filename):\n                    yield os.path.dirname(module_filename)\n                else:\n                    yield module_filename\n\n    def isAcceptableMissingDLL(self, package_name, dll_basename):\n        for entry in self.config.get(package_name, section=\"import-hacks\"):\n            if self.evaluateCondition(\n                full_name=package_name, condition=entry.get(\"when\", \"True\")\n            ):\n                result = self._isAcceptableMissingDLL(\n                    config=entry, dll_basename=dll_basename\n                )\n\n                if result is not None:\n                    return result\n\n        return None\n\n    @staticmethod\n    def _isAcceptableMissingDLL(config, dll_basename):\n        for config_dll_name in config.get(\"acceptable-missing-dlls\", ()):\n            if fnmatch.fnmatch(dll_basename, config_dll_name):\n                return True\n\n        return None\n\n    def decideAllowOutsideDependencies(self, module_name):\n        distribution = None\n\n        assert module_name != \"_ctypes\", self.config.get(\n            module_name, section=\"import-hacks\"\n        )\n\n        while 1:\n            for entry in self.config.get(module_name, section=\"import-hacks\"):\n                if self.evaluateCondition(\n                    full_name=module_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    if \"package-system-dlls\" in entry:\n                        return entry[\"package-system-dlls\"] == \"yes\"\n\n            if distribution is None:\n                distribution = getDistributionFromModuleName(module_name)\n\n            module_name = module_name.getPackageName()\n            if not module_name:\n                break\n\n        if distribution is None:\n            return None\n\n        if not isDistributionSystemPackage(getDistributionName(distribution)):\n            return False\n        else:\n            return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/EnumPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to make enum module work when compiled.\n\nThe enum module provides a free function __new__ in class dictionaries to\nmanual metaclass calls. These become then unbound methods instead of static\nmethods, due to CPython only checking for plain uncompiled functions.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonVersions import python_version\n\n\nclass NuitkaPluginEnumWorkarounds(NuitkaPluginBase):\n    \"\"\"This is to make enum module work when compiled with Nuitka.\"\"\"\n\n    plugin_name = \"enum-compat\"\n\n    plugin_desc = \"Required for Python2 and 'enum' package.\"\n\n    @classmethod\n    def isRelevant(cls):\n        return python_version < 0x300\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @staticmethod\n    def createPostModuleLoadCode(module):\n        full_name = module.getFullName()\n\n        if full_name == \"enum\":\n            code = \"\"\"\\\nfrom __future__ import absolute_import\nimport enum\ntry:\n    enum.Enum.__new__ = staticmethod(enum.Enum.__new__.__func__)\n    enum.IntEnum.__new__ = staticmethod(enum.IntEnum.__new__.__func__)\nexcept AttributeError:\n    pass\n\"\"\"\n            return (\n                code,\n                \"\"\"\\\nMonkey patching \"enum\" for compiled '__new__' methods.\"\"\",\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/EventletPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginEventlet(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the plugin.\"\"\"\n\n    plugin_name = \"eventlet\"\n    plugin_desc = \"Support for including 'eventlet' dependencies and its need for 'dns' package monkey patching.\"\n\n    # TODO: Change this to Yaml configuration.\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def getImplicitImports(self, module):\n        full_name = module.getFullName()\n\n        if full_name == \"eventlet\":\n            yield self.locateModules(\"dns\")\n            yield \"eventlet.hubs\"\n\n        elif full_name == \"eventlet.hubs\":\n            yield \"eventlet.hubs.epolls\"\n            yield \"eventlet.hubs.hub\"\n            yield \"eventlet.hubs.kqueue\"\n            yield \"eventlet.hubs.poll\"\n            yield \"eventlet.hubs.pyevent\"\n            yield \"eventlet.hubs.selects\"\n            yield \"eventlet.hubs.timer\"\n\n    def decideCompilation(self, module_name):\n        if module_name.hasNamespace(\"dns\"):\n            return \"bytecode\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/GeventPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginGevent(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the plugin.\"\"\"\n\n    plugin_name = \"gevent\"\n    plugin_desc = \"Required by the 'gevent' package.\"\n\n    # TODO: Change this to Yaml configuration.\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"One time only check: may this plugin be required?\n\n        Returns:\n            True if this is a standalone compilation.\n        \"\"\"\n        return Options.isStandaloneMode()\n\n    @staticmethod\n    def createPostModuleLoadCode(module):\n        \"\"\"Make sure greentlet tree tracking is switched off.\"\"\"\n        full_name = module.getFullName()\n\n        if full_name == \"gevent\":\n            code = r\"\"\"\\\nimport gevent._config\ngevent._config.config.track_greenlet_tree = False\n\"\"\"\n\n            return (\n                code,\n                \"\"\"\\\nDisabling 'gevent' greenlet tree tracking.\"\"\",\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/GiPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Support for gi typelib files and DLLs\n\"\"\"\n\nimport os\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase, standalone_only\n\n\nclass NuitkaPluginGi(NuitkaPluginBase):\n    plugin_name = \"gi\"\n    plugin_desc = \"Support for GI package typelib dependency.\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        \"\"\"Request to be always enabled.\"\"\"\n\n        return True\n\n    @staticmethod\n    @standalone_only\n    def createPreModuleLoadCode(module):\n        \"\"\"Add typelib search path\"\"\"\n\n        if module.getFullName() == \"gi\":\n            code = r\"\"\"\nimport os\nif not os.getenv(\"GI_TYPELIB_PATH\"):\n    os.environ[\"GI_TYPELIB_PATH\"] = os.path.join(__nuitka_binary_dir, \"girepository\")\"\"\"\n\n            return code, \"Set typelib search path\"\n\n    @standalone_only\n    def considerDataFiles(self, module):\n        \"\"\"Copy typelib files from the default installation path\"\"\"\n        if module.getFullName() == \"gi\":\n            gi_typelib_info = self.queryRuntimeInformationMultiple(\n                info_name=\"gi_info\",\n                setup_codes=\"import gi; from gi.repository import GObject\",\n                values=(\n                    (\n                        \"introspection_module\",\n                        \"gi.Repository.get_default().get_typelib_path('GObject')\",\n                    ),\n                ),\n            )\n\n            if gi_typelib_info is not None:\n                gi_repository_path = os.path.dirname(\n                    gi_typelib_info.introspection_module\n                )\n                yield self.makeIncludedDataDirectory(\n                    source_path=gi_repository_path,\n                    dest_path=\"girepository\",\n                    reason=\"typelib files for gi modules\",\n                )\n\n    @staticmethod\n    def getImplicitImports(module):\n        full_name = module.getFullName()\n\n        if full_name == \"gi.overrides\":\n            yield \"gi.overrides.Gtk\"\n            yield \"gi.overrides.Gdk\"\n            yield \"gi.overrides.GLib\"\n            yield \"gi.overrides.GObject\"\n        elif full_name == \"gi._gi\":\n            yield \"gi._error\"\n        elif full_name == \"gi._gi_cairo\":\n            yield \"cairo\"\n\n    @standalone_only\n    def getExtraDlls(self, module):\n        def tryLocateAndLoad(dll_name):\n            # Support various name forms in MSYS2 over time.\n            dll_path = self.locateDLL(dll_name)\n            if dll_path is None:\n                dll_path = self.locateDLL(\"%s\" % dll_name)\n            if dll_path is None:\n                dll_path = self.locateDLL(\"lib%s\" % dll_name)\n\n            if dll_path is not None:\n                yield self.makeDllEntryPoint(\n                    source_path=dll_path,\n                    dest_path=os.path.basename(dll_path),\n                    module_name=\"gi._gi\",\n                    package_name=\"gi\",\n                    reason=\"needed by 'gi._gi'\",\n                )\n\n        if module.getFullName() == \"gi._gi\":\n            # TODO: Get local relevant DLL names from GI\n            for dll_name in (\n                \"gtk-3-0\",\n                \"soup-2.4-1\",\n                \"soup-gnome-2.4-1\",\n                \"libsecret-1-0\",\n            ):\n                yield tryLocateAndLoad(dll_name)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/GlfwPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Support for glfw, details in below class definitions.\n\n\"\"\"\n\nimport os\nimport re\n\nfrom nuitka import Options\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.utils.FileOperations import getFileContents\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.Utils import isLinux, isMacOS, isWin32Windows\n\n# spell-checker: ignore glfw,opengl,osmesa,pyglfw,xwayland\n\n\nclass NuitkaPluginGlfw(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the glfw plugin.\n\n    This is a plugin to ensure that glfw platform specific backends are loading\n    properly. This need to include the correct DLL and make sure it's used by\n    setting an environment variable.\n\n    \"\"\"\n\n    # TODO: Maybe rename to opengl maybe\n    plugin_name = \"glfw\"  # Nuitka knows us by this name\n    plugin_desc = (\n        \"Required for 'OpenGL' (PyOpenGL) and 'glfw' package in standalone mode.\"\n    )\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"Check whether plugin might be required.\n\n        Returns:\n            True if this is a standalone compilation.\n        \"\"\"\n        return Options.isStandaloneMode()\n\n    def getImplicitImports(self, module):\n        if module.getFullName() == \"OpenGL\":\n            opengl_infos = self.queryRuntimeInformationSingle(\n                setup_codes=\"import OpenGL.plugins\",\n                value=\"[(f.name, f.import_path) for f in OpenGL.plugins.FormatHandler.all()]\",\n            )\n\n            # TODO: Filter by name.\n            for _name, import_path in opengl_infos:\n                yield ModuleName(import_path).getPackageName()\n\n            code = getFileContents(module.getCompileTimeFilename())\n\n            for os_part, plugin_name_part in re.findall(\n                r\"\"\"PlatformPlugin\\(\\s*['\"](\\w+)['\"]\\s*,\\s*['\"]([\\w\\.]+)['\"]\\s*\\)\"\"\",\n                code,\n            ):\n                plugin_name_part = ModuleName(plugin_name_part).getPackageName()\n\n                if os_part == \"nt\":\n                    if isWin32Windows():\n                        yield plugin_name_part\n                elif os_part.startswith(\"linux\"):\n                    if isLinux():\n                        yield plugin_name_part\n                elif os_part.startswith(\"darwin\"):\n                    if isMacOS():\n                        yield plugin_name_part\n                elif os_part.startswith(\n                    (\"posix\", \"osmesa\", \"egl\", \"x11\", \"wayland\", \"xwayland\", \"glx\")\n                ):\n                    if not isWin32Windows() and not isMacOS():\n                        yield plugin_name_part\n                else:\n                    self.sysexit(\n                        \"Undetected OS specific PyOpenGL plugin '%s', please report bug for.\"\n                        % os_part\n                    )\n\n    def _getDLLFilename(self):\n        glfw_info = self.queryRuntimeInformationMultiple(\n            info_name=\"glfw_info\",\n            setup_codes=\"import glfw.library\",\n            values=((\"dll_filename\", \"glfw.library.glfw._name\"),),\n        )\n\n        return glfw_info.dll_filename\n\n    def getExtraDlls(self, module):\n        if module.getFullName() == \"glfw\":\n            dll_filename = self._getDLLFilename()\n\n            yield self.makeDllEntryPoint(\n                source_path=dll_filename,\n                dest_path=os.path.join(\"glfw\", os.path.basename(dll_filename)),\n                module_name=\"glfw\",\n                package_name=\"glfw.library\",\n                reason=\"needed by 'glfw'\",\n            )\n\n    def createPreModuleLoadCode(self, module):\n        if module.getFullName() == \"glfw\":\n            dll_filename = self._getDLLFilename()\n\n            code = r\"\"\"\nimport os\nos.environ[\"PYGLFW_LIBRARY\"] = os.path.join(__nuitka_binary_dir, \"glfw\", \"%s\")\n\"\"\" % os.path.basename(\n                dll_filename\n            )\n            return (\n                code,\n                \"Setting 'PYGLFW_LIBRARY' environment variable for glfw to find platform DLL.\",\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/ImplicitImports.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to tell Nuitka about implicit imports.\n\nWhen C extension modules import other modules, we cannot see this and need to\nbe told that. This encodes the knowledge we have for various modules. Feel free\nto add to this and submit patches to make it more complete.\n\"\"\"\n\nimport ast\nimport fnmatch\nimport os\n\nfrom nuitka.__past__ import iter_modules, unicode\nfrom nuitka.importing.Importing import locateModule\nfrom nuitka.importing.Recursion import decideRecursion\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.Utils import isMacOS, isWin32Windows\nfrom nuitka.utils.Yaml import getYamlPackageConfiguration\n\n\nclass NuitkaPluginImplicitImports(NuitkaPluginBase):\n    plugin_name = \"implicit-imports\"\n\n    plugin_desc = (\n        \"Provide implicit imports of package as per package configuration files.\"\n    )\n\n    def __init__(self):\n        self.config = getYamlPackageConfiguration()\n\n        self.lazy_loader_usages = {}\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def _resolveModulePattern(self, pattern):\n        parts = pattern.split(\".\")\n\n        current = None\n\n        for count, part in enumerate(parts):\n            if not part:\n                self.sysexit(\n                    \"Error, invalid pattern with empty parts used '%s'.\" % pattern\n                )\n\n            # TODO: Checking for shell pattern should be done in more places and shared code.\n            if \"?\" in part or \"*\" in part or \"[\" in part:\n                if current is None:\n                    self.sysexit(\n                        \"Error, cannot use pattern for first part '%s'.\" % pattern\n                    )\n\n                module_filename = self.locateModule(\n                    module_name=ModuleName(current),\n                )\n\n                if module_filename is not None:\n                    for sub_module in iter_modules([module_filename]):\n                        if not fnmatch.fnmatch(sub_module.name, part):\n                            continue\n\n                        if count == len(parts) - 1:\n                            yield current.getChildNamed(sub_module.name)\n                        else:\n                            child_name = current.getChildNamed(\n                                sub_module.name\n                            ).asString()\n\n                            for value in self._resolveModulePattern(\n                                child_name + \".\" + \".\".join(parts[count + 1 :])\n                            ):\n                                yield value\n\n                return\n            else:\n                if current is None:\n                    current = ModuleName(part)\n                else:\n                    current = current.getChildNamed(part)\n\n        yield current\n\n    def _handleImplicitImportsConfig(self, module, config):\n        full_name = module.getFullName()\n\n        for dependency in config.get(\"depends\", ()):\n            if dependency.startswith(\".\"):\n                if (\n                    module.isUncompiledPythonPackage()\n                    or module.isCompiledPythonPackage()\n                ):\n                    dependency = full_name.getChildNamed(dependency[1:]).asString()\n                elif full_name.getPackageName() is None:\n                    # Not a package, potentially a naming conflict, when\n                    # compiling with \"--module\" something that matches a PyPI\n                    # name.\n                    continue\n                else:\n                    dependency = full_name.getSiblingNamed(dependency[1:]).asString()\n\n            if \"(\" in dependency:\n                value = self.evaluateExpression(\n                    full_name=full_name,\n                    expression=dependency,\n                    config_name=\"depends value\",\n                    extra_context=None,\n                    single_value=False,\n                )\n\n                if type(value) in (str, unicode):\n                    value = (value,)\n\n                for v in value:\n                    yield v\n            elif \"*\" in dependency or \"?\" in dependency:\n                for resolved in self._resolveModulePattern(dependency):\n                    yield resolved\n            else:\n                yield dependency\n\n    def _getImportsByFullname(self, module, full_name):\n        \"\"\"Provides names of modules to imported implicitly.\"\"\"\n        # Many variables, branches, due to the many cases, pylint: disable=too-many-branches,too-many-statements\n\n        # Checking for config, but also allowing fall through.\n        for entry in self.config.get(full_name, section=\"implicit-imports\"):\n            if self.evaluateCondition(\n                full_name=full_name, condition=entry.get(\"when\", \"True\")\n            ):\n                for dependency in self._handleImplicitImportsConfig(\n                    config=entry, module=module\n                ):\n                    yield dependency\n\n        # Support for both pycryotodome (module name Crypto) and pycyptodomex (module name Cryptodome)\n        if full_name.hasOneOfNamespaces(\"Crypto\", \"Cryptodome\"):\n            crypto_module_name = full_name.getTopLevelPackageName()\n\n            if full_name == crypto_module_name + \".Cipher._mode_ofb\":\n                yield crypto_module_name + \".Cipher._raw_ofb\"\n\n            elif full_name == crypto_module_name + \".Cipher.CAST\":\n                yield crypto_module_name + \".Cipher._raw_cast\"\n\n            elif full_name == crypto_module_name + \".Cipher.DES3\":\n                yield crypto_module_name + \".Cipher._raw_des3\"\n\n            elif full_name == crypto_module_name + \".Cipher.DES\":\n                yield crypto_module_name + \".Cipher._raw_des\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_ecb\":\n                yield crypto_module_name + \".Cipher._raw_ecb\"\n\n            elif full_name == crypto_module_name + \".Cipher.AES\":\n                yield crypto_module_name + \".Cipher._raw_aes\"\n                yield crypto_module_name + \".Cipher._raw_aesni\"\n                yield crypto_module_name + \".Util._cpuid\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_cfb\":\n                yield crypto_module_name + \".Cipher._raw_cfb\"\n\n            elif full_name == crypto_module_name + \".Cipher.ARC2\":\n                yield crypto_module_name + \".Cipher._raw_arc2\"\n\n            elif full_name == crypto_module_name + \".Cipher.DES3\":\n                yield crypto_module_name + \".Cipher._raw_des3\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_ocb\":\n                yield crypto_module_name + \".Cipher._raw_ocb\"\n\n            elif full_name == crypto_module_name + \".Cipher._EKSBlowfish\":\n                yield crypto_module_name + \".Cipher._raw_eksblowfish\"\n\n            elif full_name == crypto_module_name + \".Cipher.Blowfish\":\n                yield crypto_module_name + \".Cipher._raw_blowfish\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_ctr\":\n                yield crypto_module_name + \".Cipher._raw_ctr\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_cbc\":\n                yield crypto_module_name + \".Cipher._raw_cbc\"\n\n            elif full_name == crypto_module_name + \".Util.strxor\":\n                yield crypto_module_name + \".Util._strxor\"\n\n            elif full_name == crypto_module_name + \".Util._cpu_features\":\n                yield crypto_module_name + \".Util._cpuid_c\"\n\n            elif full_name == crypto_module_name + \".Hash.BLAKE2s\":\n                yield crypto_module_name + \".Hash._BLAKE2s\"\n\n            elif full_name == crypto_module_name + \".Hash.BLAKE2b\":\n                yield crypto_module_name + \".Hash._BLAKE2b\"\n\n            elif full_name == crypto_module_name + \".Hash.SHA1\":\n                yield crypto_module_name + \".Hash._SHA1\"\n\n            elif full_name == crypto_module_name + \".Hash.SHA224\":\n                yield crypto_module_name + \".Hash._SHA224\"\n\n            elif full_name == crypto_module_name + \".Hash.SHA256\":\n                yield crypto_module_name + \".Hash._SHA256\"\n\n            elif full_name == crypto_module_name + \".Hash.SHA384\":\n                yield crypto_module_name + \".Hash._SHA384\"\n\n            elif full_name == crypto_module_name + \".Hash.SHA512\":\n                yield crypto_module_name + \".Hash._SHA512\"\n\n            elif full_name == crypto_module_name + \".Hash.MD2\":\n                yield crypto_module_name + \".Hash._MD2\"\n\n            elif full_name == crypto_module_name + \".Hash.MD4\":\n                yield crypto_module_name + \".Hash._MD4\"\n\n            elif full_name == crypto_module_name + \".Hash.MD5\":\n                yield crypto_module_name + \".Hash._MD5\"\n\n            elif full_name == crypto_module_name + \".Hash.keccak\":\n                yield crypto_module_name + \".Hash._keccak\"\n\n            elif full_name == crypto_module_name + \".Hash.RIPEMD160\":\n                yield crypto_module_name + \".Hash._RIPEMD160\"\n\n            elif full_name == crypto_module_name + \".Hash.Poly1305\":\n                yield crypto_module_name + \".Hash._poly1305\"\n\n            elif full_name == crypto_module_name + \".Protocol.KDF\":\n                yield crypto_module_name + \".Cipher._Salsa20\"\n                yield crypto_module_name + \".Protocol._scrypt\"\n\n            elif full_name == crypto_module_name + \".Cipher._mode_gcm\":\n                yield crypto_module_name + \".Hash._ghash_clmul\"\n                yield crypto_module_name + \".Hash._ghash_portable\"\n                yield crypto_module_name + \".Util._galois\"\n\n            elif full_name == crypto_module_name + \".Cipher.Salsa20\":\n                yield crypto_module_name + \".Cipher._Salsa20\"\n\n            elif full_name == crypto_module_name + \".Cipher.ChaCha20\":\n                yield crypto_module_name + \".Cipher._chacha20\"\n\n            elif full_name == crypto_module_name + \".PublicKey.ECC\":\n                yield crypto_module_name + \".PublicKey._ec_ws\"\n                yield crypto_module_name + \".PublicKey._ed25519\"\n                yield crypto_module_name + \".PublicKey._ed448\"\n\n            elif full_name == crypto_module_name + \".Cipher.ARC4\":\n                yield crypto_module_name + \".Cipher._ARC4\"\n\n            elif full_name == crypto_module_name + \".Cipher.PKCS1_v1_5\":\n                yield crypto_module_name + \".Cipher._pkcs1_decode\"\n\n            elif full_name == crypto_module_name + \".Math._IntegerCustom\":\n                yield crypto_module_name + \".Math._modexp\"\n\n        elif full_name in (\"pynput.keyboard\", \"pynput.mouse\"):\n            if isMacOS():\n                yield full_name.getChildNamed(\"_darwin\")\n            elif isWin32Windows():\n                yield full_name.getChildNamed(\"_win32\")\n            else:\n                yield full_name.getChildNamed(\"_xorg\")\n        elif full_name == \"cryptography\":\n            yield \"_cffi_backend\"\n        elif full_name == \"bcrypt._bcrypt\":\n            yield \"_cffi_backend\"\n\n    def getImplicitImports(self, module):\n        full_name = module.getFullName()\n\n        # TODO: This code absolutely doesn't belong here.\n        # Read the .pyi file, and provide as implicit dependency.\n        if module.isPythonExtensionModule():\n            for used_module_name in module.getPyIModuleImportedNames():\n                yield used_module_name\n\n        if full_name == \"pkg_resources.extern\":\n            # TODO: A package specific lookup of compile time \"pkg_resources.extern\" could\n            # be done here, but this might be simpler to hardcode for now. Once we have\n            # the infrastructure to ask a module that after optimization, we should do\n            # that instead, as it will not use a separate process.\n            for part in (\n                \"packaging\",\n                \"pyparsing\",\n                \"appdirs\",\n                \"jaraco\",\n                \"importlib_resources\",\n                \"more_itertools\",\n                \"six\",\n                \"platformdirs\",\n            ):\n                yield \"pkg_resources._vendor.\" + part\n\n        for item in self._getImportsByFullname(module=module, full_name=full_name):\n            yield item\n\n    def _getPackageExtraScanPaths(self, package_dir, config):\n        for config_package_dir in config.get(\"package-dirs\", ()):\n            yield os.path.normpath(os.path.join(package_dir, \"..\", config_package_dir))\n\n            yield package_dir\n\n        for config_package_name in config.get(\"package-paths\", ()):\n            module_filename = self.locateModule(config_package_name)\n\n            if module_filename is not None:\n                if os.path.isfile(module_filename):\n                    yield os.path.dirname(module_filename)\n                else:\n                    yield module_filename\n\n    def getPackageExtraScanPaths(self, package_name, package_dir):\n        for entry in self.config.get(package_name, section=\"import-hacks\"):\n            if self.evaluateCondition(\n                full_name=package_name, condition=entry.get(\"when\", \"True\")\n            ):\n                for item in self._getPackageExtraScanPaths(\n                    package_dir=package_dir, config=entry\n                ):\n                    yield item\n\n    def _getModuleSysPathAdditions(self, module_name, config):\n        module_filename = self.locateModule(module_name)\n\n        if os.path.isfile(module_filename):\n            module_filename = os.path.dirname(module_filename)\n\n        for relative_path in config.get(\"global-sys-path\", ()):\n            candidate = os.path.abspath(os.path.join(module_filename, relative_path))\n\n            if os.path.isdir(candidate):\n                yield candidate\n\n    def getModuleSysPathAdditions(self, module_name):\n        for entry in self.config.get(module_name, section=\"import-hacks\"):\n            if self.evaluateCondition(\n                full_name=module_name, condition=entry.get(\"when\", \"True\")\n            ):\n                for item in self._getModuleSysPathAdditions(\n                    module_name=module_name, config=entry\n                ):\n                    yield item\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        # Too much code here, pylint: disable=too-many-branches\n        # TODO: Move the ones that would be possible to yaml config,\n        # e.g. the numexpr hack.\n\n        if module_name == \"numexpr.cpuinfo\":\n            # We cannot intercept \"is\" tests, but need it to be \"isinstance\",\n            # so we patch it on the file. TODO: This is only temporary, in\n            # the future, we may use optimization that understands the right\n            # hand size of the \"is\" argument well enough to allow for our\n            # type too.\n            source_code = source_code.replace(\n                \"type(attr) is types.MethodType\", \"isinstance(attr, types.MethodType)\"\n            )\n\n        if module_name == \"site\":\n            if source_code.startswith(\"def \") or source_code.startswith(\"class \"):\n                source_code = \"\\n\" + source_code\n\n            source_code = \"\"\"\\\n__file__ = (__nuitka_binary_dir + '%ssite.py') if '__nuitka_binary_dir' in dict(__builtins__ ) else '<frozen>';%s\"\"\" % (\n                os.path.sep,\n                source_code,\n            )\n\n            # Debian stretch site.py\n            source_code = source_code.replace(\n                \"PREFIXES = [sys.prefix, sys.exec_prefix]\", \"PREFIXES = []\"\n            )\n\n        # Source code should use lazy_loader, this may not be good enough\n        # for all things yet.\n        attach_call_replacements = (\n            (\n                \"lazy.attach_stub(__name__, __file__)\",\n                \"lazy.attach('%(module_name)s', %(submodules)s, %(attrs)s)\",\n            ),\n        )\n\n        for attach_call, attach_call_replacement in attach_call_replacements:\n            if attach_call in source_code:\n                result = self._handleLazyLoad(\n                    module_name=module_name,\n                    source_filename=source_filename,\n                )\n\n                # Inline the values, to avoid the data files.\n                if result is not None:\n                    replacement = attach_call_replacement % {\n                        \"module_name\": module_name.asString(),\n                        \"submodules\": tuple(\n                            sub_module_name.asString() for sub_module_name in result[0]\n                        ),\n                        \"attrs\": dict(\n                            (\n                                sub_module_name.getChildNameFromPackage(\n                                    module_name\n                                ).asString(),\n                                module_attributes,\n                            )\n                            for (sub_module_name, module_attributes) in sorted(\n                                result[1].items()\n                            )\n                        ),\n                    }\n\n                    source_code = source_code.replace(attach_call, replacement)\n\n        if module_name == \"huggingface_hub\":\n            # Special handling for huggingface that uses the source code variant\n            # of lazy module. spell-checker: ignore huggingface\n            if (\n                \"__getattr__, __dir__, __all__ = _attach(__name__, submodules=[], submod_attrs=_SUBMOD_ATTRS)\"\n                in source_code\n            ):\n                huggingface_hub_lazy_loader_info = self.queryRuntimeInformationSingle(\n                    setup_codes=\"import huggingface_hub\",\n                    value=\"huggingface_hub._SUBMOD_ATTRS\",\n                    info_name=\"huggingface_hub_lazy_loader\",\n                )\n\n                self._addLazyLoader(\n                    module_name,\n                    submodules=(),\n                    submodule_attrs=dict(\n                        (\".\" + submodule_name, attributes)\n                        for (\n                            submodule_name,\n                            attributes,\n                        ) in huggingface_hub_lazy_loader_info.items()\n                    ),\n                )\n\n        if module_name == \"pydantic\":\n            # Pydantic has its own lazy loading, spell-checker: ignore pydantic\n            if \"def __getattr__(\" in source_code:\n                pydantic_info = self.queryRuntimeInformationSingle(\n                    setup_codes=\"import pydantic\",\n                    value=\"pydantic._dynamic_imports\",\n                    info_name=\"pydantic_lazy_loader\",\n                )\n\n                pydantic_lazy_loader_info = {}\n                for key, value in pydantic_info.items():\n                    # Older pydantic had only a string for the attribute.\n                    if type(value) is tuple:\n                        value = \"\".join(value).rstrip(\".\")\n\n                    if value not in pydantic_lazy_loader_info:\n                        pydantic_lazy_loader_info[value] = []\n                    pydantic_lazy_loader_info[value].append(key)\n\n                self._addLazyLoader(\n                    module_name=module_name,\n                    submodules=(),\n                    submodule_attrs=pydantic_lazy_loader_info,\n                )\n\n        return source_code\n\n    def _addLazyLoader(self, module_name, submodules, submodule_attrs):\n        \"\"\"Add lazy loader information for a module.\n\n        Args:\n            module_name: name of the module to work on\n            submodules: list of attributes that are known submodules\n            submodule_attrs: dict of module name to list of attributes\n\n        Notes:\n            It converts to modules names on the fly. If in submodule_attr\n            the module name starts with a \".\" then it's relative to the\n            module_name value.\n\n        \"\"\"\n\n        submodules = tuple(ModuleName(submodule) for submodule in submodules)\n\n        submodule_attrs = dict(\n            (\n                (\n                    module_name.getChildNamed(submodule[1:])\n                    if submodule.startswith(\".\")\n                    else ModuleName(submodule)\n                ),\n                tuple(attribute_names),\n            )\n            for (submodule, attribute_names) in sorted(submodule_attrs.items())\n        )\n\n        self.lazy_loader_usages[module_name] = (\n            submodules,\n            submodule_attrs,\n        )\n\n    def _handleLazyLoad(self, module_name, source_filename):\n        pyi_filename = source_filename + \"i\"\n\n        if os.path.exists(pyi_filename):\n            try:\n                import lazy_loader\n            except ImportError:\n                pass\n            else:\n                with open(pyi_filename, \"rb\") as f:\n                    stub_node = ast.parse(f.read())\n\n                # We are using private code here, to avoid use duplicating,\n                # pylint: disable=protected-access\n                visitor = lazy_loader._StubVisitor()\n                visitor.visit(stub_node)\n\n                self._addLazyLoader(\n                    module_name=module_name,\n                    submodules=visitor._submodules,\n                    submodule_attrs=dict(\n                        (\".\" + submodule_name, attributes)\n                        for (\n                            submodule_name,\n                            attributes,\n                        ) in visitor._submod_attrs.items()\n                    ),\n                )\n\n                return self.lazy_loader_usages[module_name]\n\n    def createPreModuleLoadCode(self, module):\n        full_name = module.getFullName()\n\n        for entry in self.config.get(full_name, section=\"implicit-imports\"):\n            if \"pre-import-code\" in entry:\n                if self.evaluateCondition(\n                    full_name=full_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    code = \"\\n\".join(entry.get(\"pre-import-code\"))\n\n        for entry in self.config.get(full_name, section=\"import-hacks\"):\n            if \"force-environment-variables\" in entry:\n                if self.evaluateCondition(\n                    full_name=full_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    for (\n                        environment_variable_name,\n                        environment_variable_value,\n                    ) in entry.get(\"force-environment-variables\").items():\n                        code = \"\"\"\\\nimport os\nos.environ['%(environment_variable_name)s'] = \"%(environment_variable_value)s\"\n\"\"\" % {\n                            \"environment_variable_name\": environment_variable_name,\n                            \"environment_variable_value\": environment_variable_value,\n                        }\n                        yield code, \"\"\"\\\nAccording to Yaml 'force-environment-variables' configuration.\"\"\"\n\n        for entry in self.config.get(full_name, section=\"import-hacks\"):\n            if \"overridden-environment-variables\" in entry:\n                if self.evaluateCondition(\n                    full_name=full_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    for (\n                        environment_variable_name,\n                        environment_variable_value,\n                    ) in entry.get(\"overridden-environment-variables\").items():\n                        code = \"\"\"\\\nimport os\nif os.getenv(\"%(environment_variable_name)s\") is not None:\n    os.environ[\"%(environment_variable_name)s\" + \"_OLD\"] = os.getenv(\"%(environment_variable_name)s\")\nos.environ['%(environment_variable_name)s'] = \"%(environment_variable_value)s\"\n\"\"\" % {\n                            \"environment_variable_name\": environment_variable_name,\n                            \"environment_variable_value\": environment_variable_value,\n                        }\n                        yield code, \"\"\"\\\nAccording to Yaml 'overridden-environment-variables' configuration.\"\"\"\n\n    def createPostModuleLoadCode(self, module):\n        full_name = module.getFullName()\n\n        for entry in self.config.get(full_name, section=\"implicit-imports\"):\n            if \"post-import-code\" in entry:\n                if self.evaluateCondition(\n                    full_name=full_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    code = \"\\n\".join(entry.get(\"post-import-code\"))\n\n                    # TODO: Add a description to the Yaml file.\n                    yield code, \"\"\"\\\nAccording to Yaml 'post-import-code' configuration.\"\"\"\n\n        for entry in self.config.get(full_name, section=\"import-hacks\"):\n            if \"overridden-environment-variables\" in entry:\n                if self.evaluateCondition(\n                    full_name=full_name, condition=entry.get(\"when\", \"True\")\n                ):\n                    for environment_variable_name in entry.get(\n                        \"overridden-environment-variables\"\n                    ):\n                        code = \"\"\"\\\nimport os\nif os.getenv(\"%(environment_variable_name)s\" + \"_OLD\") is None:\n    del os.environ[\"%(environment_variable_name)s\"]\nelse:\n    os.environ[\"%(environment_variable_name)s\"] = os.environ[\"%(environment_variable_name)s\" + \"_OLD\"]\n    del os.environ[\"%(environment_variable_name)s\" + \"_OLD\"]\n\"\"\" % {\n                            \"environment_variable_name\": environment_variable_name\n                        }\n\n                        yield code, \"\"\"\\\nAccording to Yaml 'overridden-environment-variables' configuration.\"\"\"\n\n    unworthy_namespaces = (\n        \"setuptools\",  # Not performance relevant.\n        \"distutils\",  # Not performance relevant.\n        \"wheel\",  # Not performance relevant.\n        \"pkg_resources\",  # Not performance relevant.\n        \"pycparser\",  # Not performance relevant.\n        #        \"cffi\",  # Not performance relevant.\n        \"numpy.distutils\",  # Largely unused, and a lot of modules.\n        \"numpy.f2py\",  # Mostly unused, only numpy.distutils import it.\n        \"numpy.testing\",  # Useless.\n        \"nose\",  # Not performance relevant.\n        \"coverage\",  # Not performance relevant.\n        \"docutils\",  # Not performance relevant.\n        \"pytest\",  # Not performance relevant.\n        \"_pytest\",  # Not performance relevant.\n        \"unittest\",  # Not performance relevant.\n        \"pexpect\",  # Not performance relevant.\n        \"Cython\",  # Mostly unused, and a lot of modules.\n        \"cython\",\n        \"pyximport\",\n        \"IPython\",  # Mostly unused, and a lot of modules.\n        \"wx._core\",  # Too large generated code\n        \"pyVmomi.ServerObjects\",  # Too large generated code\n        \"pyglet.gl\",  # Too large generated code\n        \"telethon.tl.types\",  # Not performance relevant and slow C compile\n        \"importlib_metadata\",  # Not performance relevant and slow C compile\n        \"comtypes.gen\",  # Not performance relevant and slow C compile\n        \"win32com.gen_py\",  # Not performance relevant and slow C compile\n        \"phonenumbers.geodata\",  # Not performance relevant and slow C compile\n        \"site\",  # Not performance relevant and problems with .pth files\n        \"packaging\",  # Not performance relevant.\n        \"appdirs\",  # Not performance relevant.\n        \"dropbox.team_log\",  # Too large generated code\n        \"asyncua.ua.object_ids\",  # Too large generated code\n        \"asyncua.ua.uaerrors._auto\",  # Too large generated code\n        \"asyncua.server.standard_address_space.standard_address_space_services\",  # Too large generated code\n        \"azure.mgmt.network\",  # Too large generated code\n        \"azure.mgmt.compute\",  # Too large generated code\n        \"transformers.utils.dummy_pt_objects\",  # Not performance relevant.\n        \"transformers.utils.dummy_flax_objects\",  # Not performance relevant.\n        \"transformers.utils.dummy_tf_objects\",  # Not performance relevant.\n        \"rich\",  #  Not performance relevant and memory leaking due to empty compiled cell leaks\n        \"altair.vegalite.v5.schema\",  # Not performance relevant.\n        \"azure\",  # Not performance relevant.\n    )\n\n    unworthy_modulename_patterns = (\n        \"tensorflow.*test\",  # Not performance relevant.\n        \"tensorflow.**.test_util\",  # Not performance relevant.\n    )\n\n    def decideCompilation(self, module_name):\n        if module_name.hasOneOfNamespaces(self.unworthy_namespaces):\n            return \"bytecode\"\n\n        is_match, _reason = module_name.matchesToShellPatterns(\n            self.unworthy_modulename_patterns\n        )\n        if is_match:\n            return \"bytecode\"\n\n    def onModuleUsageLookAhead(\n        self, module_name, module_filename, module_kind, get_module_source\n    ):\n        # Getting the source code will also trigger our modification\n        # and potentially tell us if any lazy loading applies.\n        if get_module_source() is None:\n            return\n\n        if module_name in self.lazy_loader_usages:\n            from nuitka.HardImportRegistry import (\n                addModuleAttributeFactory,\n                addModuleDynamicHard,\n                addModuleTrust,\n                trust_module,\n                trust_node,\n            )\n\n            addModuleDynamicHard(module_name)\n\n            sub_module_names, sub_module_attr = self.lazy_loader_usages[module_name]\n\n            for sub_module_name in sub_module_names:\n                addModuleTrust(module_name, sub_module_name, trust_module)\n\n                sub_module_name = module_name.getChildNamed(sub_module_name)\n                addModuleDynamicHard(sub_module_name)\n\n                _lookAhead(using_module_name=module_name, module_name=sub_module_name)\n\n            for (\n                sub_module_name,\n                attribute_names,\n            ) in sub_module_attr.items():\n                addModuleDynamicHard(sub_module_name)\n\n                _lookAhead(using_module_name=module_name, module_name=sub_module_name)\n\n                for attribute_name in attribute_names:\n                    addModuleTrust(module_name, attribute_name, trust_node)\n                    addModuleAttributeFactory(\n                        module_name,\n                        attribute_name,\n                        makeExpressionImportModuleNameHardExistsAfterImportFactory(\n                            sub_module_name=sub_module_name,\n                            attribute_name=attribute_name,\n                        ),\n                    )\n\n\ndef makeExpressionImportModuleNameHardExistsAfterImportFactory(\n    sub_module_name,\n    attribute_name,\n):\n    from nuitka.HardImportRegistry import trust_node_factory\n    from nuitka.nodes.ImportHardNodes import (\n        ExpressionImportModuleNameHardExists,\n    )\n\n    key = (sub_module_name, attribute_name)\n    if key in trust_node_factory:\n        return lambda source_ref: trust_node_factory[key](source_ref=source_ref)\n\n    return lambda source_ref: ExpressionImportModuleNameHardExists(\n        module_name=sub_module_name,\n        import_name=attribute_name,\n        module_guaranteed=False,\n        source_ref=source_ref,\n    )\n\n\ndef _lookAhead(using_module_name, module_name):\n    (\n        _module_name,\n        package_filename,\n        package_module_kind,\n        finding,\n    ) = locateModule(\n        module_name=module_name,\n        parent_package=None,\n        level=0,\n    )\n\n    assert module_name == _module_name\n\n    if finding != \"not-found\":\n        decideRecursion(\n            using_module_name=using_module_name,\n            module_filename=package_filename,\n            module_name=module_name,\n            module_kind=package_module_kind,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/KivyPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nfrom nuitka.Options import isStandaloneMode\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginKivy(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the plugin.\"\"\"\n\n    plugin_name = \"kivy\"\n    plugin_desc = \"Required by 'kivy' package.\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"One time only check: may this plugin be required?\n\n        Returns:\n            True if this is a standalone compilation.\n        \"\"\"\n        return isStandaloneMode()\n\n    def _getKivyInformation(self):\n        setup_codes = r\"\"\"\nimport kivy.core.image\nimport kivy.core.text\n# Prevent Window from being created at compile time.\nkivy.core.core_select_lib=(lambda *args, **kwargs: None)\nimport kivy.core.window\n\n# Kivy has packages designed to provide these on Windows\ntry:\n    from kivy_deps.sdl2 import dep_bins as sdl2_dep_bins\nexcept ImportError:\n    sdl2_dep_bins = []\ntry:\n    from kivy_deps.glew import dep_bins as glew_dep_bins\nexcept ImportError:\n    glew_dep_bins = []\n\"\"\"\n        info = self.queryRuntimeInformationMultiple(\n            info_name=\"kivy_info\",\n            setup_codes=setup_codes,\n            values=(\n                (\"libs_loaded\", \"kivy.core.image.libs_loaded\"),\n                (\"window_impl\", \"kivy.core.window.window_impl\"),\n                (\"label_libs\", \"kivy.core.text.label_libs\"),\n                (\"sdl2_dep_bins\", \"sdl2_dep_bins\"),\n                (\"glew_dep_bins\", \"glew_dep_bins\"),\n            ),\n        )\n\n        if info is None:\n            self.sysexit(\"Error, it seems Kivy is not installed.\")\n\n        return info\n\n    def getImplicitImports(self, module):\n        # Using branches to dispatch, pylint: disable=too-many-branches\n\n        full_name = module.getFullName()\n\n        if full_name == \"kivy.core.image\":\n            for module_name in self._getKivyInformation().libs_loaded:\n                yield full_name.getChildNamed(module_name)\n        elif full_name == \"kivy.core.window\":\n            # TODO: It seems only one is actually picked, so this could be made\n            # to also reflect decision making.\n            for _, module_name, _ in self._getKivyInformation().window_impl:\n                yield full_name.getChildNamed(module_name)\n        elif full_name == \"kivy.core.text\":\n            for _, module_name, _ in self._getKivyInformation().label_libs:\n                yield full_name.getChildNamed(module_name)\n        elif full_name == \"kivy.core.window.window_sdl2\":\n            yield \"kivy.core.window._window_sdl2\"\n        elif full_name == \"kivy.core.window._window_sdl2\":\n            yield \"kivy.core.window.window_info\"\n        elif full_name == \"kivy.core.window.window_x11\":\n            yield \"kivy.core.window.window_info\"\n        elif full_name == \"kivy.graphics.cgl\":\n            yield \"kivy.graphics.cgl_backend\"\n        elif full_name == \"kivy.graphics.cgl_backend\":\n            yield \"kivy.graphics.cgl_backend.cgl_glew\"\n        elif full_name == \"kivy.graphics.cgl_backend.cgl_glew\":\n            yield \"kivy.graphics.cgl_backend.cgl_gl\"\n        elif full_name == \"kivymd.app\":\n            yield self.locateModules(\"kivymd.uix\")\n\n    def getExtraDlls(self, module):\n        \"\"\"Copy extra shared libraries or data for this installation.\n\n        Args:\n            module: module object\n        Yields:\n            DLL entry point objects\n        \"\"\"\n\n        full_name = module.getFullName()\n\n        if full_name == \"kivy\":\n            kivy_info = self._getKivyInformation()\n\n            kivy_dlls = []\n            for dll_folder in kivy_info.sdl2_dep_bins + kivy_info.glew_dep_bins:\n                kivy_dlls.extend(self.locateDLLsInDirectory(dll_folder))\n\n            for full_path, target_filename, _dll_extension in kivy_dlls:\n                yield self.makeDllEntryPoint(\n                    source_path=full_path,\n                    dest_path=target_filename,\n                    module_name=full_name,\n                    package_name=full_name,\n                    reason=\"needed by 'kivy'\",\n                )\n\n            self.reportFileCount(full_name, len(kivy_dlls))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/MatplotlibPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Matplotlib standard plugin module. \"\"\"\n\nimport os\n\nfrom nuitka.Options import isStandaloneMode\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.plugins.Plugins import (\n    getActiveQtPluginBindingName,\n    hasActivePlugin,\n)\nfrom nuitka.utils.Execution import NuitkaCalledProcessError\nfrom nuitka.utils.FileOperations import getFileContentByLine\nfrom nuitka.utils.Jinja2 import renderTemplateFromString\nfrom nuitka.utils.Utils import isMacOS\n\n# spell-checker: ignore matplotlib, scipy, scikit, matplotlibrc, matplotlibdata\n# spell-checker: ignore mpl_toolkits, tkagg, MPLBACKEND\n\n\nclass NuitkaPluginMatplotlib(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the plugin.\n\n    This is a plugin to ensure scripts using numpy, scipy, matplotlib, pandas,\n    scikit-learn, etc. work well in standalone mode.\n\n    While there already are relevant entries in the \"ImplicitImports.py\" plugin,\n    this plugin copies any additional binary or data files required by many\n    installations.\n\n    \"\"\"\n\n    plugin_name = \"matplotlib\"  # Nuitka knows us by this name\n    plugin_desc = \"Required for 'matplotlib' module.\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        \"\"\"Request to be always enabled.\"\"\"\n\n        return True\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"Check whether plugin might be required.\n\n        Returns:\n            True if this is a standalone compilation.\n        \"\"\"\n        return isStandaloneMode()\n\n    def _getMatplotlibInfo(self):\n        \"\"\"Determine the filename of matplotlibrc and the default backend, etc.\n\n        Notes:\n            There might exist a local version outside 'matplotlib/mpl-data' which\n            we then must use instead. Determine its name by asking matplotlib.\n        \"\"\"\n        try:\n            info = self.queryRuntimeInformationMultiple(\n                info_name=\"matplotlib_info\",\n                setup_codes=\"\"\"\nfrom matplotlib import matplotlib_fname, get_backend, __version__\ntry:\n    from matplotlib import get_data_path\nexcept ImportError:\n    from matplotlib import _get_data_path as get_data_path\nfrom inspect import getsource\n\"\"\",\n                values=(\n                    (\"matplotlibrc_filename\", \"matplotlib_fname()\"),\n                    (\"backend\", \"get_backend()\"),\n                    (\"data_path\", \"get_data_path()\"),\n                    (\"matplotlib_version\", \"__version__\"),\n                ),\n            )\n        except NuitkaCalledProcessError:\n            if \"MPLBACKEND\" not in os.environ:\n                self.sysexit(\n                    \"\"\"\\\nError, failed to detect matplotlib backend. Please set 'MPLBACKEND' \\\nenvironment variable during compilation.\"\"\",\n                    mnemonic=\"\"\"\\\nhttps://matplotlib.org/stable/users/installing/environment_variables_faq.html#envvar-MPLBACKEND\"\"\",\n                )\n\n            raise\n\n        if info is None:\n            self.sysexit(\"Error, it seems 'matplotlib' is not installed or broken.\")\n\n        return info\n\n    def getImplicitImports(self, module):\n        # Make sure the used Qt namespace is included in compilation, mostly for\n        # accelerated mode, but also to prevent people from accidentally\n        # removing it.\n        if module.getFullName() != \"matplotlib\":\n            return\n\n        matplotlib_info = self._getMatplotlibInfo()\n\n        # Make sure, the default backend is included.\n        yield \"matplotlib.backends.backend_%s\" % matplotlib_info.backend.lower()\n\n    def considerDataFiles(self, module):\n        if module.getFullName() != \"matplotlib\":\n            return\n\n        matplotlib_info = self._getMatplotlibInfo()\n\n        if not os.path.isdir(matplotlib_info.data_path):\n            self.sysexit(\n                \"mpl-data missing, matplotlib installation appears to be broken\"\n            )\n\n        self.info(\n            \"Using %s backend '%s'.\"\n            % (\n                (\n                    \"configuration file or default\"\n                    if \"MPLBACKEND\" not in os.environ\n                    else \"as per 'MPLBACKEND' environment variable\"\n                ),\n                matplotlib_info.backend,\n            )\n        )\n\n        # Include the \"mpl-data\" files.\n        yield self.makeIncludedDataDirectory(\n            source_path=matplotlib_info.data_path,\n            dest_path=os.path.join(\"matplotlib\", \"mpl-data\"),\n            ignore_dirs=(\"sample_data\",),\n            ignore_filenames=(\"matplotlibrc\",),\n            reason=\"package data for 'matplotlib\",\n            tags=\"mpl-data\",\n        )\n\n        # Handle the config file with an update.\n        new_lines = []  # new config file lines\n\n        found = False  # checks whether backend definition encountered\n        for line in getFileContentByLine(matplotlib_info.matplotlibrc_filename):\n            line = line.rstrip()\n\n            # omit meaningless lines\n            if line.startswith(\"#\") and matplotlib_info.matplotlib_version < \"3\":\n                continue\n\n            new_lines.append(line)\n\n            if line.startswith((\"backend \", \"backend:\")):\n                # old config file has a backend definition\n                found = True\n\n        if not found and matplotlib_info.matplotlib_version < \"4\":\n            # Set the backend, so even if it was run time determined, we now enforce it.\n            new_lines.append(\"backend: %s\" % matplotlib_info.backend)\n\n        yield self.makeIncludedGeneratedDataFile(\n            data=\"\\n\".join(new_lines),\n            dest_path=os.path.join(\"matplotlib\", \"mpl-data\", \"matplotlibrc\"),\n            reason=\"updated matplotlib config file with backend to use\",\n        )\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        if module_name.hasNamespace(\"mpl_toolkits\"):\n            return True, \"Needed by matplotlib\"\n\n        # some special handling for matplotlib:\n        # depending on whether 'tk-inter' resp. 'qt-plugins' are enabled,\n        # their matplotlib backends are included.\n        if module_name in (\n            \"matplotlib.backends.backend_tk\",\n            \"matplotlib.backends.backend_tkagg\",\n            \"matplotlib.backend.tkagg\",\n        ):\n            if hasActivePlugin(\"tk-inter\"):\n                return True, \"Needed for tkinter matplotlib backend\"\n\n        if module_name == \"matplotlib.backends.backend_qtagg\":\n            if getActiveQtPluginBindingName() is not None:\n                return True, \"Needed for qt matplotlib backend\"\n\n    def createPreModuleLoadCode(self, module):\n        \"\"\"Method called when a module is being imported.\n\n        Notes:\n            If full name equals \"matplotlib\" we insert code to set the\n            environment variable that e.g. Debian versions of matplotlib\n            use.\n\n        Args:\n            module: the module object\n        Returns:\n            Code to insert and descriptive text (tuple), or (None, None).\n        \"\"\"\n\n        # The version may not need the environment variable.\n        if module.getFullName() == \"matplotlib\":\n            code = renderTemplateFromString(\n                r\"\"\"\nimport os\nos.environ[\"MATPLOTLIBDATA\"] = os.path.join(__nuitka_binary_dir, \"matplotlib\", \"mpl-data\")\nos.environ[\"MATPLOTLIBRC\"] = os.path.join(__nuitka_binary_dir, \"matplotlib\", \"mpl-data\", \"matplotlibrc\")\nos.environ[\"MPLBACKEND\"] = \"{{matplotlib_info.backend}}\"\n{% if qt_binding_name %}\nos.environ[\"QT_API\"] = \"{{qt_binding_name}}\"\n{% endif %}\n\"\"\",\n                matplotlib_info=self._getMatplotlibInfo(),\n                qt_binding_name=getActiveQtPluginBindingName(),\n            )\n            return (\n                code,\n                \"Setting environment variables for 'matplotlib' to find package configuration.\",\n            )\n\n    def decideCompilation(self, module_name):\n        # The C code for macOS requires Python functions rather than compiled\n        # ones, let it have its way\n        if isMacOS() and module_name == \"matplotlib.backend_bases\":\n            return \"bytecode\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/MultiprocessingPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to make multiprocessing and joblib work well.\n\nOn Windows, the multiprocessing modules forks new processes which then have\nto start from scratch. This won't work if there is no \"sys.executable\" to\npoint to a \"Python.exe\" and won't use compiled code by default.\n\nThe issue applies to accelerated and standalone mode alike.\n\nspell-checker: ignore joblib\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.ModuleRegistry import (\n    getModuleInclusionInfoByName,\n    getRootTopModule,\n)\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.tree.SourceHandling import readSourceCodeFromFilename\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\nclass NuitkaPluginMultiprocessingWorkarounds(NuitkaPluginBase):\n    \"\"\"This is to make multiprocessing work with Nuitka and use compiled code.\n\n    When running in accelerated mode, it's not good to fork a new Python\n    instance to run other code, as that won't be accelerated. And when\n    run in standalone mode, there may not even be a Python, but it's the\n    same principle.\n\n    So by default, this module is on and works around the behavior of the\n    \"multiprocessing.forking/multiprocessing.spawn/multiprocessing.manager\"\n    expectations.\n    \"\"\"\n\n    plugin_name = \"multiprocessing\"\n    plugin_desc = \"Required by Python's 'multiprocessing' module.\"\n\n    @classmethod\n    def isRelevant(cls):\n        return not Options.shallMakeModule()\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @staticmethod\n    def createPreModuleLoadCode(module):\n        full_name = module.getFullName()\n\n        # TODO: Replace the setting of \"sys.frozen\" with a change to the source code of the\n        # modules we want to affect from this plugin, it's a huge impact on compatibility\n        # with other things potentially. We should do it, once the anti-bloat engine is\n        # reusable or supports conditional replacements based on plugin activity and is\n        # always on.\n        if full_name == \"multiprocessing\":\n            code = \"\"\"\\\nimport sys, os\nsys.frozen = 1\nargv0 = sys.argv[0]\nif sys.platform == \"win32\" and not os.path.exists(argv0) and not argv0.endswith(\".exe\"):\n    argv0 += \".exe\"\n\nsys.executable = %s\nsys._base_executable = sys.executable\n\"\"\" % (\n                \"__nuitka_binary_exe\" if Options.isStandaloneMode() else \"argv0\"\n            )\n            return (\n                code,\n                \"\"\"\\\nMonkey patching \"multiprocessing\" load environment.\"\"\",\n            )\n\n    @staticmethod\n    def createPostModuleLoadCode(module):\n        full_name = module.getFullName()\n\n        if full_name == \"multiprocessing\":\n            code = \"\"\"\\\ntry:\n    from multiprocessing.forking import ForkingPickler\nexcept ImportError:\n    from multiprocessing.reduction import ForkingPickler\n\nclass C:\n   def f():\n       pass\n\ndef _reduce_compiled_method(m):\n    if m.im_self is None:\n        return getattr, (m.im_class, m.im_func.__name__)\n    else:\n        return getattr, (m.im_self, m.im_func.__name__)\n\nForkingPickler.register(type(C().f), _reduce_compiled_method)\nif str is bytes:\n    ForkingPickler.register(type(C.f), _reduce_compiled_method)\n\"\"\"\n\n            return (\n                code,\n                \"\"\"\\\nMonkey patching \"multiprocessing\" for compiled methods.\"\"\",\n            )\n\n    @staticmethod\n    def createFakeModuleDependency(module):\n        full_name = module.getFullName()\n\n        if full_name != \"multiprocessing\":\n            return\n\n        # First, build the module node and then read again from the\n        # source code.\n        root_module = getRootTopModule()\n\n        module_name = ModuleName(\"__parents_main__\")\n\n        source_code = readSourceCodeFromFilename(module_name, root_module.getFilename())\n\n        # For the call stack, this may look bad or different to what CPython\n        # does, but such is life. The forking module was split up into multiple\n        # modules in Python 3.4 so this is doubled. TODO: Move the version check\n        # into the code and let Nuitka compile time optimize it, which will also\n        # make sure joblib support is there for Python2 as well.\n        if python_version >= 0x340:\n            source_code += \"\"\"\ndef __nuitka_freeze_support():\n    import sys\n\n    # Not needed, and can crash from minor __file__ differences, depending on invocation\n    import multiprocessing.spawn\n    multiprocessing.spawn._fixup_main_from_path = lambda mod_name : None\n\n    # This is a variant of freeze_support that will work for multiprocessing and\n    # joblib equally well.\n    kwds = {}\n    args = []\n    for arg in sys.argv[2:]:\n        try:\n            name, value = arg.split('=')\n        except ValueError:\n            name = \"pipe_handle\"\n            value = arg\n\n        if value == 'None':\n            kwds[name] = None\n        else:\n            kwds[name] = int(value)\n\n    # Otherwise main module names will not work.\n    sys.modules[\"__main__\"] = sys.modules[\"__parents_main__\"]\n\n    multiprocessing.spawn.spawn_main(*args, **kwds)\n__nuitka_freeze_support()\n\"\"\"\n        else:\n            source_code += \"\"\"\n__import__(\"sys\").modules[\"__main__\"] = __import__(\"sys\").modules[__name__]\n__import__(\"multiprocessing.forking\").forking.freeze_support()\"\"\"\n\n        yield (\n            module_name,\n            source_code,\n            root_module.getCompileTimeFilename(),\n            \"Auto enable multiprocessing freeze support\",\n        )\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        # Enforce recursion in to multiprocessing for accelerated mode, which\n        # would normally avoid this.\n        if module_name.hasNamespace(\"multiprocessing\"):\n            return True, \"Multiprocessing plugin needs this to monkey patch it.\"\n\n    def decideCompilation(self, module_name):\n        if module_name.hasNamespace(\"multiprocessing\"):\n            return \"bytecode\"\n\n        # TODO: Make this demoted too.\n        # or module_name in( \"multiprocessing-preLoad\", \"multiprocessing-postLoad\"):\n\n    @staticmethod\n    def getPreprocessorSymbols():\n        if getModuleInclusionInfoByName(\"__parents_main__\"):\n            return {\"_NUITKA_PLUGIN_MULTIPROCESSING_ENABLED\": \"1\"}\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/NumpyPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginNumpy(NuitkaPluginBase):\n    \"\"\"This plugin is now not doing anything anymore.\"\"\"\n\n    plugin_name = \"numpy\"  # Nuitka knows us by this name\n    plugin_desc = \"Deprecated, was once required by the numpy package\"\n\n    @classmethod\n    def isDeprecated(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/OptionsNannyPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to tell user about needed or useful options for packages.\n\nWhen certain GUI packages are used, disabling the console may or may not be what\nthe user wants, or even be required, as e.g. \"wx\" on macOS will crash unless the\nconsole is disabled. This reads Yaml configuration.\n\"\"\"\n\nfrom nuitka.Options import (\n    isOnefileMode,\n    isStandaloneMode,\n    mayDisableConsoleWindow,\n    shallCreateAppBundle,\n    shallDisableConsoleWindow,\n)\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.utils.Utils import isMacOS\nfrom nuitka.utils.Yaml import getYamlPackageConfiguration\n\n\nclass NuitkaPluginOptionsNanny(NuitkaPluginBase):\n    plugin_name = \"options-nanny\"\n\n    plugin_desc = (\n        \"Inform the user about potential problems as per package configuration files.\"\n    )\n\n    def __init__(self):\n        self.config = getYamlPackageConfiguration()\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def sysexitIllegalOptionValue(self, full_name, option, value):\n        self.sysexit(\n            \"Illegal value for package '%s' option '%s' ('%s')\"\n            % (full_name, option, value)\n        )\n\n    def _checkSupportedVersion(self, full_name, support_info, description, condition):\n        # Configured to not report, default value.\n        if support_info == \"ignore\":\n            return\n\n        if support_info == \"parameter\":\n            message = \"Module has parameter: \" + description\n        elif support_info == \"plugin\":\n            message = \"Module has plugin consideration: \" + description\n        else:\n            if condition != \"True\":\n                problem_desc = (\n                    \" with incomplete support due to untrue condition '%s'\" % condition\n                )\n            else:\n                problem_desc = \" with incomplete support\"\n\n            message = \"Using module '%s' (version %s)%s: %s\" % (\n                full_name,\n                \".\".join(str(d) for d in self.getPackageVersion(full_name)),\n                problem_desc,\n                description,\n            )\n\n        if support_info == \"error\":\n            self.sysexit(message)\n        elif support_info in (\"warning\", \"parameter\", \"plugin\"):\n            self.warning(message)\n        elif support_info == \"info\":\n            self.info(message)\n        else:\n            self.sysexit(\n                \"Error, unknown support_info level '%s' for module '%s'\"\n                % full_name.asString()\n            )\n\n    def _checkConsoleMode(self, full_name, console):\n        if console == \"no\":\n            if shallDisableConsoleWindow() is not True:\n                self.sysexit(\n                    \"Error, when using '%s', you have to use '--disable-console' option.\"\n                    % full_name\n                )\n        elif console == \"yes\":\n            pass\n        elif console == \"recommend\":\n            if shallDisableConsoleWindow() is None:\n                if isMacOS():\n                    downside_message = \"\"\"\\\nOtherwise high resolution will not be available and a terminal window will open\"\"\"\n                else:\n                    downside_message = \"\"\"\\\nOtherwise a terminal window will open\"\"\"\n\n                self.info(\n                    \"\"\"\\\nNote, when using '%s', consider using '--disable-console' option. %s. However \\\nfor debugging, terminal output is the easiest way to see informative traceback \\\nand error information, so delay this until your program is working and remove \\\nonce you find it non-working, and use '--enable-console' to make it explicit \\\nand not see this message.\"\"\"\n                    % (full_name, downside_message)\n                )\n\n        else:\n            self.sysexitIllegalOptionValue(full_name, \"console\", console)\n\n    def _checkMacOSBundleMode(self, full_name, macos_bundle):\n        if macos_bundle == \"yes\":\n            if isStandaloneMode() and not shallCreateAppBundle():\n                self.sysexit(\n                    \"\"\"\\\nError, package '%s' requires '--macos-create-app-bundle' to be used or else it cannot work.\"\"\"\n                    % full_name\n                )\n        elif macos_bundle == \"no\":\n            pass\n        elif macos_bundle == \"recommend\":\n            # TODO: Not really recommending with a message it yet.\n            pass\n        else:\n            self.sysexitIllegalOptionValue(full_name, \"macos_bundle\", macos_bundle)\n\n    def _checkMacOSBundleOnefileMode(self, full_name, macos_bundle_as_onefile):\n        if macos_bundle_as_onefile == \"yes\":\n            if isStandaloneMode() and shallCreateAppBundle() and not isOnefileMode():\n                self.sysexit(\n                    \"\"\"\\\nError, package '%s' requires '--onefile' to be used on top of '--macos-create-app-bundle' or else it cannot work.\"\"\"\n                    % full_name\n                )\n        elif macos_bundle_as_onefile == \"no\":\n            pass\n        else:\n            self.sysexitIllegalOptionValue(\n                full_name, \"macos_bundle_onefile_mode\", macos_bundle_as_onefile\n            )\n\n    # TODO: Definitely the wrong function to use, but we migrated this out of\n    # implicit imports, where it was done there.\n    def getImplicitImports(self, module):\n        full_name = module.getFullName()\n\n        for options_config in self.config.get(full_name, section=\"options\"):\n            for check in options_config.get(\"checks\", ()):\n                condition = check.get(\"when\", \"True\")\n\n                if self.evaluateCondition(full_name=full_name, condition=condition):\n                    self._checkSupportedVersion(\n                        full_name=full_name,\n                        support_info=check.get(\"support_info\", \"ignore\"),\n                        description=check.get(\"description\", \"not given\"),\n                        condition=condition,\n                    )\n\n                    if mayDisableConsoleWindow():\n                        self._checkConsoleMode(\n                            full_name=full_name,\n                            console=check.get(\"console\", \"yes\"),\n                        )\n\n                    if isMacOS():\n                        self._checkMacOSBundleMode(\n                            full_name=full_name,\n                            macos_bundle=check.get(\"macos_bundle\", \"no\"),\n                        )\n\n                        self._checkMacOSBundleOnefileMode(\n                            full_name=full_name,\n                            macos_bundle_as_onefile=check.get(\n                                \"macos_bundle_as_onefile\", \"no\"\n                            ),\n                        )\n\n        return ()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/PbrPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Standard plug-in to make pbr module work when compiled.\n\nThe pbr module needs to find a version number in compiled mode. The value\nitself seems less important than the fact that some value does exist.\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginPbrWorkarounds(NuitkaPluginBase):\n    \"\"\"This is to make pbr module work when compiled with Nuitka.\"\"\"\n\n    plugin_name = \"pbr-compat\"\n\n    plugin_desc = \"Required by the 'pbr' package in standalone mode.\"\n\n    @classmethod\n    def isRelevant(cls):\n        return Options.isStandaloneMode()\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @staticmethod\n    def createPreModuleLoadCode(module):\n        full_name = module.getFullName()\n\n        if full_name == \"pbr.packaging\":\n            code = \"\"\"\\\nimport os\nversion = os.getenv(\n        \"PBR_VERSION\",\n        os.getenv(\"OSLO_PACKAGE_VERSION\"))\nif not version:\n    os.environ[\"OSLO_PACKAGE_VERSION\"] = \"1.0\"\n\"\"\"\n            return (\n                code,\n                \"\"\"\\\nMonkey patching \"pbr\" version number.\"\"\",\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/PkgResourcesPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to handle pkg_resource special needs.\n\nNuitka can detect some things that \"pkg_resources\" may not even be able to during\nruntime, but that is done by nodes and optimization. But there are other things,\nthat need special case, e.g. the registration of the loader class.\n\"\"\"\n\nimport re\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Utils import withNoDeprecationWarning\n\n\nclass NuitkaPluginResources(NuitkaPluginBase):\n    plugin_name = \"pkg-resources\"\n    plugin_desc = \"Workarounds for 'pkg_resources'.\"\n\n    def __init__(self):\n        with withNoDeprecationWarning():\n            try:\n                import pkg_resources\n            except (ImportError, RuntimeError):\n                self.pkg_resources = None\n            else:\n                self.pkg_resources = pkg_resources\n\n        try:\n            if python_version >= 0x380:\n                from importlib import metadata\n            else:\n                import importlib_metadata as metadata\n        except (ImportError, SyntaxError, RuntimeError):\n            self.metadata = None\n        else:\n            self.metadata = metadata\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    def _handleEasyInstallEntryScript(self, dist, group, name):\n        module_name = None\n        main_name = None\n\n        # First try metadata, which is what the runner also does first.\n        if self.metadata:\n            dist = self.metadata.distribution(dist.partition(\"==\")[0])\n\n            for entry_point in dist.entry_points:\n                if entry_point.group == group and entry_point.name == name:\n                    module_name = entry_point.module\n                    main_name = entry_point.attr\n\n                    break\n\n        if module_name is None and self.pkg_resources:\n            with withNoDeprecationWarning():\n                entry_point = self.pkg_resources.get_entry_info(dist, group, name)\n\n            module_name = entry_point.module_name\n            main_name = entry_point.name\n\n        if module_name is None:\n            self.sysexit(\n                \"Error, failed to resolve easy install entry script, is the installation broken?\"\n            )\n\n        return r\"\"\"\nimport sys, re\nsys.argv[0] = re.sub(r'(-script\\.pyw?|\\.exe)?$', '', sys.argv[0])\nimport %(module_name)s\nsys.exit(%(module_name)s.%(main_name)s)\n\"\"\" % {\n            \"module_name\": module_name,\n            \"main_name\": main_name,\n        }\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        if module_name == \"__main__\":\n            match = re.search(\n                \"\\n# EASY-INSTALL-ENTRY-SCRIPT: '(.*?)','(.*?)','(.*?)'\", source_code\n            )\n\n            if match is not None:\n                self.info(\n                    \"Detected easy install entry script, compile time detecting entry point.\"\n                )\n\n                return self._handleEasyInstallEntryScript(*match.groups())\n\n        return source_code\n\n    def createPostModuleLoadCode(self, module):\n        \"\"\"Create code to load after a module was successfully imported.\n\n        For pkg_resources we need to register a provider.\n        \"\"\"\n        if module.getFullName() != \"pkg_resources\":\n            return\n\n        code = \"\"\"\\\nfrom __future__ import absolute_import\n\nimport os\nfrom pkg_resources import register_loader_type, EggProvider\n\nclass NuitkaProvider(EggProvider):\n    def _has(self, path):\n        return os.path.exists(path)\n\n    def _isdir(self, path):\n        return os.path.isdir(path)\n\n    def _listdir(self, path):\n        return os.listdir(path)\n\n    def get_resource_stream(self, manager, resource_name):\n        return open(self._fn(self.module_path, resource_name), 'rb')\n\n    def _get(self, path):\n        with open(path, 'rb') as stream:\n            return stream.read()\n\nregister_loader_type(__nuitka_loader_type, NuitkaProvider)\n\"\"\"\n\n        yield (\n            code,\n            \"\"\"Registering Nuitka loader with \"pkg_resources\".\"\"\",\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/PmwPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Plugin to pre-process PMW for inclusion.\n\n\"\"\"\n\nimport os\nimport re\n\nfrom nuitka import Options\nfrom nuitka.__past__ import StringIO\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.utils.FileOperations import getFileContents, listDir\n\n# The main logic of this is from StackOverflow answer:\n# http://stackoverflow.com/questions/6772916/python-pmw-and-cx-freeze\n\n\n# The order of these files is significant.  Files which reference\n# other files must appear later.  Files may be deleted if they are not\n# used.\nfiles = [\n    \"Dialog\",\n    \"TimeFuncs\",\n    \"Balloon\",\n    \"ButtonBox\",\n    \"EntryField\",\n    \"Group\",\n    \"LabeledWidget\",\n    \"MainMenuBar\",\n    \"MenuBar\",\n    \"MessageBar\",\n    \"MessageDialog\",\n    \"NoteBook\",\n    \"OptionMenu\",\n    \"PanedWidget\",\n    \"PromptDialog\",\n    \"RadioSelect\",\n    \"ScrolledCanvas\",\n    \"ScrolledField\",\n    \"ScrolledFrame\",\n    \"ScrolledListBox\",\n    \"ScrolledText\",\n    \"HistoryText\",\n    \"SelectionDialog\",\n    \"TextDialog\",\n    \"TimeCounter\",\n    \"AboutDialog\",\n    \"ComboBox\",\n    \"ComboBoxDialog\",\n    \"Counter\",\n    \"CounterDialog\",\n]\n\n# Work out which version is being bundled.\n\n\nclass NuitkaPluginPmw(NuitkaPluginBase):\n    plugin_name = \"pmw-freezer\"\n    plugin_desc = \"Required by the 'Pmw' package.\"\n\n    def __init__(self, need_blt, need_color):\n        self.need_blt = need_blt\n        self.need_color = need_color\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--include-pmw-blt\",\n            action=\"store_true\",\n            dest=\"need_blt\",\n            default=False,\n            help=\"\"\"\\\nShould 'Pmw.Blt' not be included, Default is to include it.\"\"\",\n        )\n\n        group.add_option(\n            \"--include-pmw-color\",\n            action=\"store_true\",\n            dest=\"need_color\",\n            default=False,\n            help=\"\"\"\\\nShould 'Pmw.Color' not be included, Default is to include it.\"\"\",\n        )\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        if module_name == \"Pmw\":\n            pmw_path = self.locateModule(module_name=module_name)\n\n            return self._packagePmw(pmw_path)\n\n        return source_code\n\n    def _packagePmw(self, pmw_path):\n        self.info(\"Packaging Pmw into single module fpor freezing.\")\n\n        # Algorithm is from the \"__init__.py\" of Pwm:\n\n        def _hasLoader(dirname):\n            # Only accept Pmw_V_R_P with single digits, since ordering will\n            # not work correctly with multiple digits (for example, Pmw_10_0\n            # will be before Pmw_9_9).\n            if re.search(\"^Pmw_[0-9]_[0-9](_[0-9])?$\", dirname) is not None:\n                for suffix in (\".py\", \".pyc\", \".pyo\"):\n                    path = os.path.join(pmw_path, dirname, \"lib\", \"PmwLoader\" + suffix)\n                    if os.path.isfile(path):\n                        return 1\n            return 0\n\n        # This mimics the scan the __init__.py does.\n        candidates = []\n        for _fullpath, candidate in listDir(pmw_path):\n            if _hasLoader(candidate):\n                candidates.append(candidate)\n\n        candidates.sort()\n        candidates.reverse()\n\n        if not candidates:\n            self.sysexit(\"Error, cannot find any Pmw versions.\")\n\n        self.info(\n            \"Found the following Pmw version candidates %s.\" % \",\".join(candidates)\n        )\n\n        candidate = os.path.join(pmw_path, candidates[0], \"lib\")\n        version = candidates[0][4:].replace(\"_\", \".\")\n\n        self.info(\"Picked version %s.\" % version)\n\n        return self._packagePmw2(candidate, version)\n\n    def _packagePmw2(self, srcdir, version):\n        def mungeFile(filename):\n            # Read the filename and modify it so that it can be bundled with the\n            # other Pmw files.\n            filename = \"Pmw\" + filename + \".py\"\n            text = getFileContents(os.path.join(srcdir, filename))\n            text = re.sub(r\"import Pmw\\>\", \"\", text)\n            text = re.sub(\"INITOPT = Pmw.INITOPT\", \"\", text)\n            text = re.sub(r\"\\<Pmw\\.\", \"\", text)\n            text = \"\\n\" + (\"#\" * 70) + \"\\n\" + \"### File: \" + filename + \"\\n\" + text\n            return text\n\n        # Code to import the Color module.\n        color_code = \"\"\"\nfrom . import PmwColor\nColor = PmwColor\ndel PmwColor\n\"\"\"\n        # Code to import the Blt module.\n        blt_code = \"\"\"\nfrom . import PmwBlt\nBlt = PmwBlt\ndel PmwBlt\n\"\"\"\n        # Code used when not linking with PmwBlt.py.\n        ignore_blt_code = \"\"\"\n_bltImported = 1\n_bltbusyOK = 0\n\"\"\"\n        # Code to define the functions normally supplied by the dynamic loader.\n        extra_code = \"\"\"\n\n### Loader functions:\n\n_VERSION = '%s'\n\ndef setversion(version):\n    if version != _VERSION:\n        raise ValueError('Dynamic versioning not available')\n\ndef setalphaversions(*alpha_versions):\n    if alpha_versions != ():\n        raise ValueError('Dynamic versioning not available')\n\ndef version(alpha = 0):\n    if alpha:\n        return ()\n    else:\n        return _VERSION\n\ndef installedversions(alpha = 0):\n    if alpha:\n        return ()\n    else:\n        return (_VERSION,)\n\n\"\"\"\n\n        outfile = StringIO()\n\n        if self.need_color:\n            outfile.write(color_code)\n\n        if self.need_blt:\n            outfile.write(blt_code)\n\n        outfile.write(extra_code % version)\n\n        # Specially handle PmwBase.py filename:\n        text = mungeFile(\"Base\")\n        text = re.sub(\"from . import PmwLogicalFont\", \"\", text)\n        text = re.sub(\"import PmwLogicalFont\", \"\", text)\n        text = re.sub(\"PmwLogicalFont._font_initialise\", \"_font_initialise\", text)\n        outfile.write(text)\n\n        if not self.need_blt:\n            outfile.write(ignore_blt_code)\n\n        files.append(\"LogicalFont\")\n\n        for filename in files:\n            text = mungeFile(filename)\n            outfile.write(text)\n\n        return outfile.getvalue()\n\n\nclass NuitkaPluginDetectorPmw(NuitkaPluginBase):\n    detector_for = NuitkaPluginPmw\n\n    @classmethod\n    def isRelevant(cls):\n        return Options.isStandaloneMode()\n\n    def onModuleDiscovered(self, module):\n        if module.getFullName() == \"Pmw\":\n            self.warnUnusedPlugin(\"Proper freezing of Pmw package.\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/PySidePyQtPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Standard plug-in to make PyQt and PySide work well in standalone mode.\n\nTo run properly, these need the Qt plugins copied along, which have their\nown dependencies.\n\"\"\"\n\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import (\n    isOnefileMode,\n    isStandaloneMode,\n    shallCreateAppBundle,\n)\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.plugins.Plugins import (\n    getActiveQtPlugin,\n    getOtherGUIBindingNames,\n    getQtBindingNames,\n    getQtPluginNames,\n    hasActiveGuiPluginForBinding,\n)\nfrom nuitka.PythonFlavors import isAnacondaPython\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.Distributions import (\n    getDistributionFromModuleName,\n    getDistributionInstallerName,\n    getDistributionName,\n)\nfrom nuitka.utils.FileOperations import getFileList, listDir\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.Utils import getArchitecture, isMacOS, isWin32Windows\n\n\nclass NuitkaPluginQtBindingsPluginBase(NuitkaPluginBase):\n    # We are a bit detail rich and caching a bunch,\n    # pylint: disable=too-many-instance-attributes\n\n    # Automatically suppress detectors for any other toolkit\n    plugin_gui_toolkit = True\n\n    # For overload in the derived bindings plugin.\n    binding_name = None\n\n    warned_about = set()\n\n    def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):\n        self.distribution = getDistributionFromModuleName(self.binding_name)\n\n        if self.distribution is None:\n            self.sysexit(\n                \"Error, failed to locate the %s installation.\" % self.binding_name\n            )\n\n        self.distribution_name = getDistributionName(self.distribution)\n\n        self.installer_name = getDistributionInstallerName(self.distribution_name)\n\n        # Qt plugin directories found.\n        self.qt_plugins_dirs = None\n\n        sensible_qt_plugins = self._getSensiblePlugins()\n\n        include_qt_plugins = OrderedSet(\n            sum([value.split(\",\") for value in include_qt_plugins], [])\n        )\n\n        # Useless, but nice for old option usage, where expanding it meant to repeat it.\n        if \"sensible\" in include_qt_plugins:\n            include_qt_plugins.remove(\"sensible\")\n\n        self.qt_plugins = sensible_qt_plugins\n        self.qt_plugins.update(include_qt_plugins)\n\n        for noinclude_qt_plugin in noinclude_qt_plugins:\n            self.qt_plugins.discard(noinclude_qt_plugin)\n\n        self.no_qt_translations = no_qt_translations\n\n        self.web_engine_done_binaries = False\n        self.web_engine_done_data = False\n\n        self.binding_package_name = ModuleName(self.binding_name)\n\n        # Allow to specify none.\n        if self.qt_plugins == set([\"none\"]):\n            self.qt_plugins = set()\n\n        # Prevent the list of binding names from being incomplete, it's used for conflicts.\n        assert self.binding_name in getQtBindingNames(), self.binding_name\n\n        # Also lets have consistency in naming.\n        assert self.plugin_name in getQtPluginNames()\n\n        active_qt_plugin_name = getActiveQtPlugin()\n\n        if active_qt_plugin_name is not None:\n            self.sysexit(\n                \"Error, conflicting plugin '%s', you can only have one enabled.\"\n                % active_qt_plugin_name\n            )\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--include-qt-plugins\",\n            action=\"append\",\n            dest=\"include_qt_plugins\",\n            default=[],\n            help=\"\"\"\\\nWhich Qt plugins to include. These can be big with dependencies, so\nby default only the \"sensible\" ones are included, but you can also put\n\"all\" or list them individually. If you specify something that does\nnot exist, a list of all available will be given.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-qt-plugins\",\n            action=\"append\",\n            dest=\"noinclude_qt_plugins\",\n            default=[],\n            help=\"\"\"\\\nWhich Qt plugins to not include. This removes things, so you can\nask to include \"all\" and selectively remove from there, or even\nfrom the default sensible list.\"\"\",\n        )\n\n        group.add_option(\n            \"--noinclude-qt-translations\",\n            action=\"store_true\",\n            dest=\"no_qt_translations\",\n            default=False,\n            help=\"\"\"\\\nInclude Qt translations with QtWebEngine if used. These can be a lot\nof files that you may not want to be included.\"\"\",\n        )\n\n    def _getQmlTargetDir(self):\n        \"\"\"Where does the Qt bindings package expect the QML files.\"\"\"\n        return os.path.join(self.binding_name, \"qml\")\n\n    def _isUsingMacOSFrameworks(self):\n        \"\"\"Is this a framework based build, or one that shared more commonality with Linux\"\"\"\n        if isMacOS() and self.binding_name in (\"PySide6\", \"PySide2\"):\n            return os.path.exists(\n                os.path.join(\n                    self._getQtInformation().data_path,\n                    \"lib/QtWebEngineCore.framework\",\n                )\n            )\n        else:\n            return False\n\n    def _getWebEngineResourcesTargetDir(self):\n        \"\"\"Where does the Qt bindings package expect the resources files.\"\"\"\n        if isWin32Windows():\n            if self.binding_name in (\"PySide2\", \"PyQt5\"):\n                return \"resources\"\n            else:\n                # While PyQt6/PySide6 complains about these, they are not working\n                # return os.path.join(self.binding_name, \"resources\")\n                return \".\"\n        else:\n            if self.binding_name in (\"PySide2\", \"PySide6\", \"PyQt6\"):\n                return \".\"\n            elif self.binding_name == \"PyQt5\":\n                return \"resources\"\n            else:\n                assert False\n\n    def _getTranslationsTargetDir(self):\n        \"\"\"Where does the Qt bindings package expect the translation files.\"\"\"\n        if isMacOS():\n            # default name of PySide6, spell-checker: ignore qtwebengine_locales\n            return os.path.join(self.binding_name, \"Qt\", \"translations\")\n        elif isWin32Windows():\n            if self.binding_name in (\"PySide2\", \"PyQt5\"):\n                return \"translations\"\n            elif self.binding_name == \"PyQt6\":\n                # TODO: PyQt6 is complaining about not being in \"translations\", but ignores it there.\n                return \".\"\n            else:\n                return os.path.join(self.binding_name, \"translations\")\n        else:\n            if self.binding_name in (\"PySide2\", \"PySide6\", \"PyQt6\"):\n                return \".\"\n            elif self.binding_name == \"PyQt5\":\n                return \"translations\"\n            else:\n                assert False\n\n    @staticmethod\n    def _getWebEngineTargetDir():\n        \"\"\"Where does the Qt bindings package expect the web process executable.\"\"\"\n        return \".\"\n\n    def _getSensiblePlugins(self):\n        # spell-checker: ignore imageformats,iconengines,mediaservice,printsupport\n        # spell-checker: ignore platformthemes,egldeviceintegrations,xcbglintegrations\n        return OrderedSet(\n            tuple(\n                family\n                for family in (\n                    \"imageformats\",\n                    \"iconengines\",\n                    \"mediaservice\",\n                    \"printsupport\",\n                    \"platforms\",\n                    \"platformthemes\",\n                    \"styles\",\n                    # Wayland on Linux needs these\n                    \"wayland-shell-integration\",\n                    \"wayland-decoration-client\",\n                    \"wayland-graphics-integration-client\",\n                    \"egldeviceintegrations\",\n                    # OpenGL rendering, maybe should be something separate.\n                    \"xcbglintegrations\",\n                    # SSL network needs those\n                    \"tls\",\n                )\n                if self.hasPluginFamily(family)\n            )\n        )\n\n    def getQtPluginsSelected(self):\n        return self.qt_plugins\n\n    def hasQtPluginSelected(self, plugin_name):\n        selected = self.getQtPluginsSelected()\n\n        return \"all\" in selected or plugin_name in selected\n\n    def _getQtInformation(self):\n        # This is generic, and therefore needs to apply this to a lot of strings.\n        def applyBindingName(template):\n            return template % {\"binding_name\": self.binding_name}\n\n        def getLocationQueryCode(path_name):\n            if self.binding_name == \"PyQt6\":\n                template = \"\"\"\\\n%(binding_name)s.QtCore.QLibraryInfo.path(%(binding_name)s.QtCore.QLibraryInfo.LibraryPath.%(path_name)s)\"\"\"\n            else:\n                template = \"\"\"\\\n%(binding_name)s.QtCore.QLibraryInfo.location(%(binding_name)s.QtCore.QLibraryInfo.%(path_name)s)\"\"\"\n\n            return template % {\n                \"binding_name\": self.binding_name,\n                \"path_name\": path_name,\n            }\n\n        setup_codes = applyBindingName(\n            r\"\"\"\nimport os\nimport %(binding_name)s.QtCore\n\"\"\"\n        )\n\n        info = self.queryRuntimeInformationMultiple(\n            info_name=applyBindingName(\"%(binding_name)s_info\"),\n            setup_codes=setup_codes,\n            values=(\n                (\n                    \"library_paths\",\n                    applyBindingName(\n                        \"%(binding_name)s.QtCore.QCoreApplication.libraryPaths()\"\n                    ),\n                ),\n                (\n                    \"guess_path1\",\n                    applyBindingName(\n                        \"os.path.join(os.path.dirname(%(binding_name)s.__file__), 'plugins')\"\n                    ),\n                ),\n                (\n                    \"guess_path2\",\n                    applyBindingName(\n                        \"os.path.join(os.path.dirname(%(binding_name)s.__file__), '..', '..', '..', 'Library', 'plugins')\"\n                    ),\n                ),\n                (\n                    \"version\",\n                    applyBindingName(\n                        \"%(binding_name)s.__version_info__\"\n                        if \"PySide\" in self.binding_name\n                        else \"%(binding_name)s.QtCore.PYQT_VERSION_STR\"\n                    ),\n                ),\n                (\n                    \"nuitka_patch_level\",\n                    applyBindingName(\n                        \"getattr(%(binding_name)s, '_nuitka_patch_level', 0)\"\n                    ),\n                ),\n                (\"translations_path\", getLocationQueryCode(\"TranslationsPath\")),\n                (\n                    \"library_executables_path\",\n                    getLocationQueryCode(\"LibraryExecutablesPath\"),\n                ),\n                (\"data_path\", getLocationQueryCode(\"DataPath\")),\n            ),\n        )\n\n        if info is None:\n            self.sysexit(\n                \"Error, it seems '%s' is not installed or broken.\" % self.binding_name\n            )\n\n        return info\n\n    def _getBindingVersion(self):\n        \"\"\"Get the version of the binding in tuple digit form, e.g. (6,0,3)\"\"\"\n        return self._getQtInformation().version\n\n    def _getNuitkaPatchLevel(self):\n        \"\"\"Does it include the Nuitka patch, i.e. is a self-built one with it applied.\"\"\"\n        return self._getQtInformation().nuitka_patch_level\n\n    def _getTranslationsPath(self):\n        \"\"\"Get the path to the Qt translations.\"\"\"\n        return self._getQtInformation().translations_path\n\n    def _getWebEngineResourcesPath(self):\n        \"\"\"Get the path to the Qt web engine resources.\"\"\"\n        if self._isUsingMacOSFrameworks():\n            return os.path.join(\n                self._getQtInformation().data_path,\n                \"lib/QtWebEngineCore.framework/Resources\",\n            )\n        else:\n            return os.path.join(self._getQtInformation().data_path, \"resources\")\n\n    def _getWebEngineExecutablePath(self):\n        \"\"\"Get the path to QtWebEngine binary.\"\"\"\n        return os.path.normpath(self._getQtInformation().library_executables_path)\n\n    def getQtPluginDirs(self):\n        if self.qt_plugins_dirs is not None:\n            return self.qt_plugins_dirs\n\n        qt_info = self._getQtInformation()\n\n        self.qt_plugins_dirs = qt_info.library_paths\n\n        if not self.qt_plugins_dirs and os.path.exists(qt_info.guess_path1):\n            self.qt_plugins_dirs.append(qt_info.guess_path1)\n\n        if not self.qt_plugins_dirs and os.path.exists(qt_info.guess_path2):\n            self.qt_plugins_dirs.append(qt_info.guess_path2)\n\n        # Avoid duplicates.\n        self.qt_plugins_dirs = [\n            os.path.normpath(dirname) for dirname in self.qt_plugins_dirs\n        ]\n        self.qt_plugins_dirs = tuple(sorted(set(self.qt_plugins_dirs)))\n\n        if not self.qt_plugins_dirs:\n            self.warning(\"Couldn't detect Qt plugin directories.\")\n\n        return self.qt_plugins_dirs\n\n    def _getQtBinDirs(self):\n        for plugin_dir in self.getQtPluginDirs():\n            if \"PyQt\" in self.binding_name:\n                qt_bin_dir = os.path.normpath(os.path.join(plugin_dir, \"..\", \"bin\"))\n\n                if os.path.isdir(qt_bin_dir):\n                    yield qt_bin_dir\n            else:\n                qt_bin_dir = os.path.normpath(os.path.join(plugin_dir, \"..\"))\n\n                yield qt_bin_dir\n\n    def hasPluginFamily(self, family):\n        return any(\n            os.path.isdir(os.path.join(plugin_dir, family))\n            for plugin_dir in self.getQtPluginDirs()\n        )\n\n    def _getQmlDirectory(self):\n        for plugin_dir in self.getQtPluginDirs():\n            qml_plugin_dir = os.path.normpath(os.path.join(plugin_dir, \"..\", \"qml\"))\n\n            if os.path.exists(qml_plugin_dir):\n                return qml_plugin_dir\n\n        self.sysexit(\"Error, no such Qt plugin family: qml\")\n\n    def _getQmlFileList(self, dlls):\n        qml_plugin_dir = self._getQmlDirectory()\n\n        # List all file types of the QML plugin folder that are data files and\n        # not DLLs, spell-checker: ignore qmlc,qmltypes,metainfo,qmldir\n        datafile_suffixes = (\n            \".qml\",\n            \".qmlc\",\n            \".qmltypes\",\n            \".js\",\n            \".jsc\",\n            \".json\",\n            \".png\",\n            \".ttf\",\n            \".metainfo\",\n            \".mesh\",\n            \".frag\",\n            \"qmldir\",\n        )\n\n        if dlls:\n            ignore_suffixes = datafile_suffixes\n            only_suffixes = ()\n        else:\n            ignore_suffixes = ()\n            only_suffixes = datafile_suffixes\n\n        return getFileList(\n            qml_plugin_dir,\n            ignore_suffixes=ignore_suffixes,\n            only_suffixes=only_suffixes,\n        )\n\n    def _findQtPluginDLLs(self):\n        for qt_plugins_dir in self.getQtPluginDirs():\n            for filename in getFileList(qt_plugins_dir):\n                filename_relative = os.path.relpath(filename, start=qt_plugins_dir)\n\n                qt_plugin_name = filename_relative.split(os.path.sep, 1)[0]\n\n                if not self.hasQtPluginSelected(qt_plugin_name):\n                    continue\n\n                yield self.makeDllEntryPoint(\n                    source_path=filename,\n                    dest_path=os.path.join(\n                        self.getQtPluginTargetPath(),\n                        filename_relative,\n                    ),\n                    module_name=self.binding_package_name,\n                    package_name=self.binding_package_name,\n                    reason=\"qt plugin\",\n                )\n\n    def _getChildNamed(self, *child_names):\n        for child_name in child_names:\n            return ModuleName(self.binding_name).getChildNamed(child_name)\n\n    def getImplicitImports(self, module):\n        # Way too many indeed, pylint: disable=too-many-branches,too-many-statements\n\n        full_name = module.getFullName()\n        top_level_package_name, child_name = full_name.splitPackageName()\n\n        if top_level_package_name != self.binding_name:\n            return\n\n        # These are alternatives depending on PyQt5 version\n        if child_name == \"QtCore\" and \"PyQt\" in self.binding_name:\n            if python_version < 0x300:\n                yield \"atexit\"\n\n            yield \"sip\"\n            yield self._getChildNamed(\"sip\")\n\n        if child_name in (\n            \"QtGui\",\n            \"QtAssistant\",\n            \"QtDBus\",\n            \"QtDeclarative\",\n            \"QtSql\",\n            \"QtDesigner\",\n            \"QtHelp\",\n            \"QtNetwork\",\n            \"QtScript\",\n            \"QtQml\",\n            \"QtGui\",\n            \"QtScriptTools\",\n            \"QtSvg\",\n            \"QtTest\",\n            \"QtWebKit\",\n            \"QtOpenGL\",\n            \"QtXml\",\n            \"QtXmlPatterns\",\n            \"QtPrintSupport\",\n            \"QtNfc\",\n            \"QtWebKitWidgets\",\n            \"QtBluetooth\",\n            \"QtMultimediaWidgets\",\n            \"QtQuick\",\n            \"QtWebChannel\",\n            \"QtWebSockets\",\n            \"QtX11Extras\",\n            \"_QOpenGLFunctions_2_0\",\n            \"_QOpenGLFunctions_2_1\",\n            \"_QOpenGLFunctions_4_1_Core\",\n        ):\n            yield self._getChildNamed(\"QtCore\")\n\n        if child_name in (\n            \"QtDeclarative\",\n            \"QtWebKit\",\n            \"QtXmlPatterns\",\n            \"QtQml\",\n            \"QtPrintSupport\",\n            \"QtWebKitWidgets\",\n            \"QtMultimedia\",\n            \"QtMultimediaWidgets\",\n            \"QtQuick\",\n            \"QtQuickWidgets\",\n            \"QtWebSockets\",\n            \"QtWebEngineWidgets\",\n        ):\n            yield self._getChildNamed(\"QtNetwork\")\n\n        if child_name == \"QtWebEngineWidgets\":\n            yield self._getChildNamed(\"QtWebEngineCore\")\n            yield self._getChildNamed(\"QtWebChannel\")\n            yield self._getChildNamed(\"QtPrintSupport\")\n        elif child_name == \"QtScriptTools\":\n            yield self._getChildNamed(\"QtScript\")\n        elif child_name in (\n            \"QtWidgets\",\n            \"QtDeclarative\",\n            \"QtDesigner\",\n            \"QtHelp\",\n            \"QtScriptTools\",\n            \"QtSvg\",\n            \"QtTest\",\n            \"QtWebKit\",\n            \"QtPrintSupport\",\n            \"QtWebKitWidgets\",\n            \"QtMultimedia\",\n            \"QtMultimediaWidgets\",\n            \"QtOpenGL\",\n            \"QtQuick\",\n            \"QtQuickWidgets\",\n            \"QtSql\",\n            \"_QOpenGLFunctions_2_0\",\n            \"_QOpenGLFunctions_2_1\",\n            \"_QOpenGLFunctions_4_1_Core\",\n        ):\n            yield self._getChildNamed(\"QtGui\")\n\n        if child_name in (\n            \"QtDesigner\",\n            \"QtHelp\",\n            \"QtTest\",\n            \"QtPrintSupport\",\n            \"QtSvg\",\n            \"QtOpenGL\",\n            \"QtWebKitWidgets\",\n            \"QtMultimediaWidgets\",\n            \"QtQuickWidgets\",\n            \"QtSql\",\n        ):\n            yield self._getChildNamed(\"QtWidgets\")\n\n        if child_name in (\"QtPrintSupport\",):\n            yield self._getChildNamed(\"QtSvg\")\n\n        if child_name in (\"QtWebKitWidgets\",):\n            yield self._getChildNamed(\"QtWebKit\")\n            yield self._getChildNamed(\"QtPrintSupport\")\n\n        if child_name in (\"QtMultimediaWidgets\",):\n            yield self._getChildNamed(\"QtMultimedia\")\n\n        if child_name in (\"QtQuick\", \"QtQuickWidgets\"):\n            yield self._getChildNamed(\"QtQml\")\n            yield self._getChildNamed(\"QtOpenGL\")\n\n        if child_name in (\"QtQuickWidgets\", \"QtQml\", \"QtQuickControls2\"):\n            yield self._getChildNamed(\"QtQuick\")\n\n        if child_name == \"Qt\":\n            yield self._getChildNamed(\"QtCore\")\n            yield self._getChildNamed(\"QtDBus\")\n            yield self._getChildNamed(\"QtGui\")\n            yield self._getChildNamed(\"QtNetwork\")\n            yield self._getChildNamed(\"QtNetworkAuth\")\n            yield self._getChildNamed(\"QtSensors\")\n            yield self._getChildNamed(\"QtSerialPort\")\n            yield self._getChildNamed(\"QtMultimedia\")\n            yield self._getChildNamed(\"QtQml\")\n            yield self._getChildNamed(\"QtWidgets\")\n\n        # TODO: Questionable if this still exists in newer PySide.\n        if child_name == \"QtUiTools\":\n            yield self._getChildNamed(\"QtGui\")\n            yield self._getChildNamed(\"QtXml\")\n\n        # TODO: Questionable if this still exists in newer PySide.\n        if full_name == \"phonon\":\n            yield self._getChildNamed(\"QtGui\")\n\n    def createPostModuleLoadCode(self, module):\n        \"\"\"Create code to load after a module was successfully imported.\n\n        For Qt we need to set the library path to the distribution folder\n        we are running from. The code is immediately run after the code\n        and therefore makes sure it's updated properly.\n        \"\"\"\n\n        # Only in standalone mode, this will be needed.\n        if not isStandaloneMode():\n            return\n\n        full_name = module.getFullName()\n\n        if full_name == \"%s.QtCore\" % self.binding_name:\n            code = \"\"\"\\\nfrom __future__ import absolute_import\n\nfrom %(package_name)s import QCoreApplication\nimport os\n\nqt_plugins_path = %(qt_plugins_path)s\n\nif qt_plugins_path is not None:\n    QCoreApplication.setLibraryPaths(\n        [\n            os.path.join(\n                os.path.dirname(__file__),\n                \"..\",\n                %(qt_plugins_path)s\n            )\n        ]\n    )\n\nos.environ[\"QML2_IMPORT_PATH\"] = os.path.join(\n    os.path.dirname(__file__),\n    \"qml\"\n)\n\"\"\" % {\n                \"package_name\": full_name,\n                \"qt_plugins_path\": repr(\n                    None\n                    if self.isDefaultQtPluginTargetPath()\n                    else self.getQtPluginTargetPath()\n                ),\n            }\n\n            yield (\n                code,\n                \"\"\"\\\nSetting Qt library path to distribution folder. We need to avoid loading target\nsystem Qt plugins, which may be from another Qt version.\"\"\",\n            )\n\n    def isQtWebEngineModule(self, full_name):\n        return full_name in (\n            self.binding_name + \".QtWebEngine\",\n            self.binding_name + \".QtWebEngineCore\",\n        )\n\n    def createPreModuleLoadCode(self, module):\n        \"\"\"Method called when a module is being imported.\n\n        Notes:\n            If full name equals to the binding we insert code to include the dist\n            folder in the 'PATH' environment variable (on Windows only).\n\n        Args:\n            module: the module object\n        Returns:\n            Code to insert and descriptive text (tuple), or (None, None).\n        \"\"\"\n\n        # This is only relevant on standalone mode for Windows\n        if not isStandaloneMode():\n            return\n\n        full_name = module.getFullName()\n\n        if full_name == self.binding_name and isWin32Windows():\n            code = \"\"\"\\\nimport os\npath = os.getenv(\"PATH\", \"\")\nif not path.startswith(__nuitka_binary_dir):\n    os.environ[\"PATH\"] = __nuitka_binary_dir + \";\" + path\n\"\"\"\n            yield (\n                code,\n                \"Adding binary folder to runtime 'PATH' environment variable for proper Qt loading.\",\n            )\n\n        # We need to set these variables, to force the layout\n        # spell-checker: ignore QTWEBENGINEPROCESS_PATH,QTWEBENGINE_DISABLE_SANDBOX\n\n        if self.isQtWebEngineModule(full_name) and self._isUsingMacOSFrameworks():\n            code = r\"\"\"\nimport os\nos.environ[\"QTWEBENGINEPROCESS_PATH\"] = os.path.join(\n    __nuitka_binary_dir,\n    \"%(web_engine_process_path)s\"\n)\nos.environ[\"QTWEBENGINE_LOCALES_PATH\"] = os.path.join(\n    __nuitka_binary_dir,\n    \"qtwebengine_locales\"\n)\nos.environ[\"QTWEBENGINE_DISABLE_SANDBOX\"]=\"1\"\n\"\"\" % {\n                \"web_engine_process_path\": \"\"\"\\\n%s/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess\"\"\"\n                % self.binding_name\n            }\n\n            yield (\n                code,\n                \"Setting WebEngine binary and translation path'.\",\n            )\n\n    def _handleWebEngineDataFiles(self):\n        # Do it only once\n        if self.web_engine_done_data:\n            return\n\n        yield self.makeIncludedGeneratedDataFile(\n            data=\"\"\"\\\n[Paths]\nPrefix = .\n\"\"\",\n            dest_path=\"qt6.conf\" if \"6\" in self.binding_name else \"qt.conf\",\n            reason=\"QtWebEngine needs Qt configuration file\",\n        )\n\n        if self._isUsingMacOSFrameworks():\n            yield self._handleWebEngineDataFilesMacOSFrameworks()\n        else:\n            yield self._handleWebEngineDataFilesGeneric()\n\n        self.web_engine_done_data = True\n\n    def _handleWebEngineDataFilesMacOSFrameworks(self):\n        if not shallCreateAppBundle():\n            self.sysexit(\n                \"Error, cannot include required Qt WebEngine binaries unless in an application bundle.\"\n            )\n\n        resources_dir = self._getWebEngineResourcesPath()\n\n        for filename in getFileList(resources_dir):\n            filename_relative = os.path.relpath(filename, resources_dir)\n\n            if not isOnefileMode():\n                yield self.makeIncludedAppBundleResourceFile(\n                    source_path=filename,\n                    dest_path=filename_relative,\n                    reason=\"Qt WebEngine resources\",\n                )\n            yield self.makeIncludedDataFile(\n                source_path=filename,\n                dest_path=filename_relative,\n                reason=\"Qt WebEngine resources\",\n            )\n\n        used_frameworks = [\n            \"QtWebEngineCore\",\n            \"QtCore\",\n            \"QtQuick\",\n            \"QtQml\",\n            \"QtQmlModels\",\n            \"QtNetwork\",\n            \"QtGui\",\n            \"QtWebChannel\",\n            \"QtPositioning\",\n        ]\n        if self.binding_name in (\"PySide6\", \"PyQt6\"):\n            used_frameworks += [\"QtOpenGL\", \"QtDBus\"]\n\n        for used_framework in used_frameworks:\n            yield self.makeIncludedAppBundleFramework(\n                source_path=os.path.join(self._getQtInformation().data_path, \"lib\"),\n                framework_name=used_framework,\n                reason=\"Qt WebEngine dependency\",\n            )\n\n    def makeIncludedAppBundleFramework(\n        self, source_path, framework_name, reason, tags=\"\"\n    ):\n        framework_basename = framework_name + \".framework\"\n        framework_path = os.path.join(source_path, framework_basename)\n\n        for filename in getFileList(framework_path):\n            filename_relative = os.path.relpath(filename, framework_path)\n\n            yield self.makeIncludedDataFile(\n                source_path=filename,\n                dest_path=os.path.join(\n                    self.binding_name,\n                    \"Qt\",\n                    \"lib\",\n                    framework_basename,\n                    filename_relative,\n                ),\n                reason=reason,\n                tags=tags,\n            )\n\n    def _handleWebEngineDataFilesGeneric(self):\n        resources_dir = self._getWebEngineResourcesPath()\n\n        for filename in getFileList(resources_dir):\n            filename_relative = os.path.relpath(filename, resources_dir)\n\n            yield self.makeIncludedDataFile(\n                source_path=filename,\n                dest_path=os.path.join(\n                    self._getWebEngineResourcesTargetDir(), filename_relative\n                ),\n                reason=\"Qt resources\",\n            )\n\n        if not self.no_qt_translations:\n            translations_path = self._getTranslationsPath()\n            dest_path = self._getTranslationsTargetDir()\n\n            for filename in getFileList(translations_path):\n                filename_relative = os.path.relpath(filename, translations_path)\n\n                yield self.makeIncludedDataFile(\n                    source_path=filename,\n                    dest_path=os.path.join(dest_path, filename_relative),\n                    reason=\"Qt translation\",\n                    tags=\"translation\",\n                )\n\n    def considerDataFiles(self, module):\n        full_name = module.getFullName()\n\n        if full_name == self.binding_name and (\n            \"qml\" in self.getQtPluginsSelected() or \"all\" in self.getQtPluginsSelected()\n        ):\n            qml_plugin_dir = self._getQmlDirectory()\n            qml_target_dir = self._getQmlTargetDir()\n\n            self.info(\"Including Qt plugins 'qml' below '%s'.\" % qml_target_dir)\n\n            for filename in self._getQmlFileList(dlls=False):\n                filename_relative = os.path.relpath(filename, qml_plugin_dir)\n\n                yield self.makeIncludedDataFile(\n                    source_path=filename,\n                    dest_path=os.path.join(\n                        qml_target_dir,\n                        filename_relative,\n                    ),\n                    reason=\"Qt QML datafile\",\n                    tags=\"qml\",\n                )\n        elif self.isQtWebEngineModule(full_name):\n            yield self._handleWebEngineDataFiles()\n\n    def _getExtraBinariesWebEngineGeneric(self, full_name):\n        if self.web_engine_done_binaries:\n            return\n\n        self.info(\"Including QtWebEngine executable.\")\n\n        qt_web_engine_dir = self._getWebEngineExecutablePath()\n\n        for filename, filename_relative in listDir(qt_web_engine_dir):\n            if filename_relative.startswith(\"QtWebEngineProcess\"):\n                yield self.makeExeEntryPoint(\n                    source_path=filename,\n                    dest_path=os.path.normpath(\n                        os.path.join(self._getWebEngineTargetDir(), filename_relative)\n                    ),\n                    module_name=full_name,\n                    package_name=full_name,\n                    reason=\"needed by '%s'\" % full_name.asString(),\n                )\n\n                break\n        else:\n            self.sysexit(\n                \"Error, cannot locate 'QtWebEngineProcess' executable at '%s'.\"\n                % qt_web_engine_dir\n            )\n\n        self.web_engine_done_binaries = True  # prevent multiple copies\n\n    def getQtPluginTargetPath(self):\n        if self.binding_name == \"PyQt6\":\n            return os.path.join(self.binding_name, \"Qt6\", \"plugins\")\n        else:\n            return os.path.join(self.binding_name, \"qt-plugins\")\n\n    def isDefaultQtPluginTargetPath(self):\n        # So far we use the default only with PyQt6, since our post load code to\n        # change it crashes on macOS, probably being called too soon.\n        return self.binding_name == \"PyQt6\"\n\n    def getExtraDlls(self, module):\n        # pylint: disable=too-many-branches\n        full_name = module.getFullName()\n\n        if full_name == self.binding_name:\n            if not self.getQtPluginDirs():\n                self.sysexit(\n                    \"Error, failed to detect '%s' plugin directories.\"\n                    % self.binding_name\n                )\n\n            self.info(\n                \"Including Qt plugins '%s' below '%s'.\"\n                % (\n                    \",\".join(\n                        sorted(x for x in self.getQtPluginsSelected() if x != \"xml\")\n                    ),\n                    self.getQtPluginTargetPath(),\n                )\n            )\n\n            # TODO: Yielding a generator should become OK too.\n            for r in self._findQtPluginDLLs():\n                yield r\n\n            if isWin32Windows():\n                # Those 2 vars will be used later, just saving some resources\n                # by caching the files list\n                qt_bin_files = sum(\n                    (getFileList(qt_bin_dir) for qt_bin_dir in self._getQtBinDirs()),\n                    [],\n                )\n\n                count = 0\n                for filename in qt_bin_files:\n                    basename = os.path.basename(filename).lower()\n                    # spell-checker: ignore libeay32,ssleay32\n\n                    if basename in (\"libeay32.dll\", \"ssleay32.dll\"):\n                        yield self.makeDllEntryPoint(\n                            source_path=filename,\n                            dest_path=basename,\n                            module_name=full_name,\n                            package_name=full_name,\n                            reason=\"needed by '%s'\" % full_name.asString(),\n                        )\n\n                        count += 1\n\n                self.reportFileCount(full_name, count, section=\"OpenSSL\")\n\n            if (\n                \"qml\" in self.getQtPluginsSelected()\n                or \"all\" in self.getQtPluginsSelected()\n            ):\n                qml_plugin_dir = self._getQmlDirectory()\n                qml_target_dir = self._getQmlTargetDir()\n\n                for filename in self._getQmlFileList(dlls=True):\n                    filename_relative = os.path.relpath(filename, qml_plugin_dir)\n\n                    yield self.makeDllEntryPoint(\n                        source_path=filename,\n                        dest_path=os.path.join(\n                            qml_target_dir,\n                            filename_relative,\n                        ),\n                        module_name=full_name,\n                        package_name=full_name,\n                        reason=\"Qt QML plugin DLL\",\n                    )\n\n                # Also copy required OpenGL DLLs on Windows,\n                # spell-checker: ignore libegl,libglesv2,opengl32sw,d3dcompiler_\n                if isWin32Windows():\n                    gl_dlls = (\"libegl.dll\", \"libglesv2.dll\", \"opengl32sw.dll\")\n\n                    count = 0\n                    for filename in qt_bin_files:\n                        basename = os.path.basename(filename).lower()\n\n                        if basename in gl_dlls or basename.startswith(\"d3dcompiler_\"):\n                            yield self.makeDllEntryPoint(\n                                source_path=filename,\n                                dest_path=basename,\n                                module_name=full_name,\n                                package_name=full_name,\n                                reason=\"needed by OpenGL for '%s'\"\n                                % full_name.asString(),\n                            )\n\n                    self.reportFileCount(full_name, count, section=\"OpenGL\")\n        elif full_name == self.binding_name + \".QtNetwork\":\n            yield self._getExtraBinariesQtNetwork(full_name=full_name)\n        elif self.isQtWebEngineModule(full_name):\n            if not self._isUsingMacOSFrameworks():\n                yield self._getExtraBinariesWebEngineGeneric(full_name=full_name)\n\n    def _getExtraBinariesQtNetwork(self, full_name):\n        if isWin32Windows():\n            if self.binding_name == \"PyQt5\":\n                arch_name = getArchitecture()\n\n                if arch_name == \"x86\":\n                    arch_suffix = \"\"\n                elif arch_name == \"x86_64\":\n                    arch_suffix = \"-x64\"\n                else:\n                    self.sysexit(\n                        \"Error, unknown architecture encountered, need to add support for %s.\"\n                        % arch_name\n                    )\n\n                # Manually loaded DLLs by Qt5.\n                # spell-checker: ignore libcrypto\n                for dll_basename in (\"libssl-1_1\", \"libcrypto-1_1\"):\n                    dll_filename = dll_basename + arch_suffix + \".dll\"\n\n                    for plugin_dir in self._getQtBinDirs():\n                        candidate = os.path.join(plugin_dir, dll_filename)\n\n                        if os.path.exists(candidate):\n                            yield self.makeDllEntryPoint(\n                                source_path=candidate,\n                                dest_path=dll_filename,\n                                module_name=full_name,\n                                package_name=full_name,\n                                reason=\"needed by '%s'\" % full_name.asString(),\n                            )\n\n                            break\n\n        else:\n            dll_path = self.locateDLL(\"crypto\")\n            if dll_path is not None:\n                yield self.makeDllEntryPoint(\n                    source_path=dll_path,\n                    dest_path=os.path.basename(dll_path),\n                    module_name=full_name,\n                    package_name=full_name,\n                    reason=\"needed by '%s'\" % full_name.asString(),\n                )\n\n            dll_path = self.locateDLL(\"ssl\")\n            if dll_path is not None:\n                yield self.makeDllEntryPoint(\n                    source_path=dll_path,\n                    dest_path=os.path.basename(dll_path),\n                    module_name=full_name,\n                    package_name=full_name,\n                    reason=\"needed by '%s'\" % full_name.asString(),\n                )\n\n    def removeDllDependencies(self, dll_filename, dll_filenames):\n        for value in self.getQtPluginDirs():\n            # TODO: That is not a proper check if a file is below that.\n            if dll_filename.startswith(value):\n                for sub_dll_filename in dll_filenames:\n                    for badword in (\n                        \"libKF5\",\n                        \"libkfontinst\",\n                        \"libkorganizer\",\n                        \"libplasma\",\n                        \"libakregator\",\n                        \"libdolphin\",\n                        \"libnoteshared\",\n                        \"libknotes\",\n                        \"libsystemsettings\",\n                        \"libkerfuffle\",\n                        \"libkaddressbook\",\n                        \"libkworkspace\",\n                        \"libkmail\",\n                        \"libmilou\",\n                        \"libtaskmanager\",\n                        \"libkonsole\",\n                        \"libgwenview\",\n                        \"libweather_ion\",\n                    ):\n                        if os.path.basename(sub_dll_filename).startswith(badword):\n                            yield sub_dll_filename\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        top_package_name = module_name.getTopLevelPackageName()\n\n        if isStandaloneMode():\n            if (\n                top_package_name in getQtBindingNames()\n                and top_package_name != self.binding_name\n            ):\n                if top_package_name not in self.warned_about:\n                    self.info(\n                        \"\"\"\\\nUnwanted import of '%(unwanted)s' that conflicts with '%(binding_name)s' \\\nencountered, preventing its inclusion. As a result an \"ImportError\" might \\\nbe given at run time. Uninstall the module it for fully compatible \\\nbehavior with the uncompiled code.\"\"\"\n                        % {\n                            \"unwanted\": top_package_name,\n                            \"binding_name\": self.binding_name,\n                        }\n                    )\n\n                    self.warned_about.add(top_package_name)\n\n                return (\n                    False,\n                    \"Not included due to potentially conflicting Qt versions with selected Qt binding '%s'.\"\n                    % self.binding_name,\n                )\n\n            if (\n                top_package_name in getOtherGUIBindingNames()\n                and not hasActiveGuiPluginForBinding(top_package_name)\n            ):\n                return (\n                    False,\n                    \"Not included due to its plugin not being active, but a Qt plugin is.\",\n                )\n\n    def onModuleCompleteSet(self, module_set):\n        self.onModuleCompleteSetGUI(\n            module_set=module_set, plugin_binding_name=self.binding_name\n        )\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        \"\"\"Third party packages that make binding selections.\"\"\"\n        # spell-checker: ignore pyqtgraph\n        if module_name.hasNamespace(\"pyqtgraph\"):\n            # TODO: Add a mechanism to force all variable references of a name to something\n            # during tree building, that would cover all uses in a nicer way.\n            source_code = source_code.replace(\n                \"{QT_LIB.lower()}\", self.binding_name.lower()\n            )\n            source_code = source_code.replace(\n                \"QT_LIB.lower()\", repr(self.binding_name.lower())\n            )\n\n        return source_code\n\n    def onDataFileTags(self, included_datafile):\n        if included_datafile.dest_path.endswith(\n            \".qml\"\n        ) and not self.hasQtPluginSelected(\"qml\"):\n            self.warning(\n                \"\"\"Including QML file %s, but not having Qt qml plugins is unlikely \\\nto work. Consider using '--include-qt-plugins=qml' to include the \\\nnecessary files to use it.\"\"\"\n                % included_datafile.dest_path\n            )\n\n\nclass NuitkaPluginPyQt5QtPluginsPlugin(NuitkaPluginQtBindingsPluginBase):\n    \"\"\"This is for plugins of PyQt5.\n\n    When loads an image, it may use a plug-in, which in turn used DLLs,\n    which for standalone mode, can cause issues of not having it.\n    \"\"\"\n\n    plugin_name = \"pyqt5\"\n    plugin_desc = \"Required by the PyQt5 package.\"\n\n    binding_name = \"PyQt5\"\n\n    def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):\n        NuitkaPluginQtBindingsPluginBase.__init__(\n            self,\n            include_qt_plugins=include_qt_plugins,\n            noinclude_qt_plugins=noinclude_qt_plugins,\n            no_qt_translations=no_qt_translations,\n        )\n\n        # TODO: make this into yaml instead, so we do not pollute this constructor.\n        self.warning(\n            \"\"\"\\\nFor the obsolete PyQt5 the Nuitka support is incomplete. Threading, callbacks \\\nto compiled functions, etc. may not be working.\"\"\",\n            mnemonic=\"pyqt5\",\n        )\n\n    def _getQtInformation(self):\n        result = NuitkaPluginQtBindingsPluginBase._getQtInformation(self)\n\n        if isAnacondaPython():\n            if \"CONDA_PREFIX\" in os.environ:\n                conda_prefix = os.environ[\"CONDA_PREFIX\"]\n            elif \"CONDA_PYTHON_EXE\" in os.environ:\n                conda_prefix = os.path.dirname(os.environ[\"CONDA_PYTHON_EXE\"])\n\n            if conda_prefix is not None:\n                values = result._asdict()\n\n                def updateStaticPath(value):\n                    path_parts = value.split(\"/\")\n\n                    # That is how it is built for Anaconda.\n                    if \"_h_env\" in path_parts:\n                        return os.path.normpath(\n                            os.path.join(\n                                conda_prefix,\n                                *path_parts[path_parts.index(\"_h_env\") + 1 :]\n                            )\n                        )\n                    else:\n                        return value\n\n                for key in \"translations_path\", \"library_executables_path\", \"data_path\":\n                    values[key] = updateStaticPath(values[key])\n\n                # Update the \"namedtuple\".\n                result = result.__class__(**values)\n\n        return result\n\n    @classmethod\n    def isRelevant(cls):\n        return isStandaloneMode()\n\n\nclass NuitkaPluginDetectorPyQt5QtPluginsPlugin(NuitkaPluginBase):\n    detector_for = NuitkaPluginPyQt5QtPluginsPlugin\n\n    @classmethod\n    def isRelevant(cls):\n        return isStandaloneMode()\n\n    def onModuleDiscovered(self, module):\n        full_name = module.getFullName()\n\n        if full_name == NuitkaPluginPyQt5QtPluginsPlugin.binding_name + \".QtCore\":\n            self.warnUnusedPlugin(\"Inclusion of Qt plugins.\")\n        elif full_name == \"PyQt4.QtCore\":\n            self.warning(\n                \"Support for PyQt4 has been dropped. Please contact Nuitka commercial if you need it.\"\n            )\n\n\nclass NuitkaPluginPySide2Plugins(NuitkaPluginQtBindingsPluginBase):\n    \"\"\"This is for plugins of PySide2.\n\n    When Qt loads an image, it may use a plug-in, which in turn used DLLs,\n    which for standalone mode, can cause issues of not having it.\n    \"\"\"\n\n    plugin_name = \"pyside2\"\n    plugin_desc = \"Required by the PySide2 package.\"\n\n    binding_name = \"PySide2\"\n\n    def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):\n        if self._getNuitkaPatchLevel() < 1:\n            self.warning(\n                \"\"\"\\\nFor the standard PySide2 incomplete workarounds are applied. For \\\nfull support consider provided information.\"\"\",\n                mnemonic=\"pyside2\",\n            )\n\n            if python_version < 0x360:\n                self.sysexit(\n                    \"\"\"\\\nThe standard PySide2 is not supported before CPython <3.6. For full support: https://nuitka.net/pages/pyside2.html\"\"\"\n                )\n\n        NuitkaPluginQtBindingsPluginBase.__init__(\n            self,\n            include_qt_plugins=include_qt_plugins,\n            noinclude_qt_plugins=noinclude_qt_plugins,\n            no_qt_translations=no_qt_translations,\n        )\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        if module_name == self.binding_name and self._getNuitkaPatchLevel() < 1:\n            return True, \"Need to monkey patch PySide2 for abstract methods.\"\n\n        return NuitkaPluginQtBindingsPluginBase.onModuleEncounter(\n            self,\n            using_module_name=using_module_name,\n            module_name=module_name,\n            module_filename=module_filename,\n            module_kind=module_kind,\n        )\n\n    def createPostModuleLoadCode(self, module):\n        \"\"\"Create code to load after a module was successfully imported.\n\n        For Qt we need to set the library path to the distribution folder\n        we are running from. The code is immediately run after the code\n        and therefore makes sure it's updated properly.\n        \"\"\"\n\n        for result in NuitkaPluginQtBindingsPluginBase.createPostModuleLoadCode(\n            self, module\n        ):\n            yield result\n\n        if (\n            self._getNuitkaPatchLevel() < 1\n            and module.getFullName() == self.binding_name\n        ):\n            code = r\"\"\"\n# Make them unique and count them.\nwrapper_count = 0\nimport functools\nimport inspect\n\ndef nuitka_wrap(cls):\n    global wrapper_count\n\n    for attr in cls.__dict__:\n        if attr.startswith(\"__\") and attr.endswith(\"__\"):\n            continue\n\n        value = getattr(cls, attr)\n\n        if type(value).__name__ == \"compiled_function\":\n            # Only work on overloaded attributes.\n            for base in cls.__bases__:\n                base_value = getattr(base, attr, None)\n\n                if base_value:\n                    module = inspect.getmodule(base_value)\n\n                    # PySide C stuff does this, and we only need to cover that.\n                    if module is None:\n                        break\n            else:\n                continue\n\n            wrapper_count += 1\n            wrapper_name = \"_wrapped_function_%s_%d\" % (attr, wrapper_count)\n\n            signature = inspect.signature(value)\n\n            # Remove annotations junk that cannot be executed.\n            signature = signature.replace(\n                return_annotation = inspect.Signature.empty,\n                parameters=[\n                    parameter.replace(default=inspect.Signature.empty,annotation=inspect.Signature.empty)\n                    for parameter in\n                    signature.parameters.values()\n                ]\n            )\n\n            v = r'''\ndef %(wrapper_name)s%(signature)s:\n    return %(wrapper_name)s.func(%(parameters)s)\n            ''' % {\n                    \"signature\": signature,\n                    \"parameters\": \",\".join(signature.parameters),\n                    \"wrapper_name\": wrapper_name\n                }\n\n            # TODO: Nuitka does not currently statically optimize this, might change!\n            exec(\n                v,\n                globals(),\n            )\n\n            wrapper = globals()[wrapper_name]\n            wrapper.func = value\n            wrapper.__defaults__ = value.__defaults__\n\n            setattr(cls, attr, wrapper)\n\n    return cls\n\n@classmethod\ndef my_init_subclass(cls, *args):\n    return nuitka_wrap(cls)\n\nimport PySide2.QtCore\nPySide2.QtCore.QAbstractItemModel.__init_subclass__ = my_init_subclass\nPySide2.QtCore.QAbstractTableModel.__init_subclass__ = my_init_subclass\nPySide2.QtCore.QObject.__init_subclass__ = my_init_subclass\n\"\"\"\n            yield (\n                code,\n                \"\"\"\\\nMonkey patching classes derived from PySide2 base classes to pass PySide2 checks.\"\"\",\n            )\n\n\nclass NuitkaPluginDetectorPySide2Plugins(NuitkaPluginBase):\n    detector_for = NuitkaPluginPySide2Plugins\n\n    def onModuleDiscovered(self, module):\n        if (\n            module.getFullName() == NuitkaPluginPySide2Plugins.binding_name + \".QtCore\"\n            and getActiveQtPlugin() is None\n        ):\n            self.warnUnusedPlugin(\"Making callbacks work and include Qt plugins.\")\n\n\nclass NuitkaPluginPySide6Plugins(NuitkaPluginQtBindingsPluginBase):\n    \"\"\"This is for plugins of PySide6.\n\n    When Qt loads an image, it may use a plug-in, which in turn used DLLs,\n    which for standalone mode, can cause issues of not having it.\n    \"\"\"\n\n    plugin_name = \"pyside6\"\n    plugin_desc = \"Required by the PySide6 package for standalone mode.\"\n\n    binding_name = \"PySide6\"\n\n    def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):\n        NuitkaPluginQtBindingsPluginBase.__init__(\n            self,\n            include_qt_plugins=include_qt_plugins,\n            noinclude_qt_plugins=noinclude_qt_plugins,\n            no_qt_translations=no_qt_translations,\n        )\n\n        if self._getBindingVersion() < (6, 5, 0):\n            self.warning(\n                \"\"\"\\\nMake sure to use PySide 6.5.0 or higher, otherwise Qt slots won't work in all cases.\"\"\"\n            )\n\n        if self._getBindingVersion() < (6, 1, 2):\n            self.warning(\n                \"\"\"\\\nMake sure to use PySide 6.1.2 or higher, otherwise Qt callbacks to Python won't work.\"\"\"\n            )\n\n\nclass NuitkaPluginDetectorPySide6Plugins(NuitkaPluginBase):\n    detector_for = NuitkaPluginPySide6Plugins\n\n    def onModuleDiscovered(self, module):\n        if module.getFullName() == NuitkaPluginPySide6Plugins.binding_name + \".QtCore\":\n            self.warnUnusedPlugin(\"Standalone mode support and Qt plugins.\")\n\n\nclass NuitkaPluginPyQt6Plugins(NuitkaPluginQtBindingsPluginBase):\n    \"\"\"This is for plugins of PyQt6.\n\n    When Qt loads an image, it may use a plug-in, which in turn used DLLs,\n    which for standalone mode, can cause issues of not having it.\n    \"\"\"\n\n    plugin_name = \"pyqt6\"\n    plugin_desc = \"Required by the PyQt6 package for standalone mode.\"\n\n    binding_name = \"PyQt6\"\n\n    def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):\n        NuitkaPluginQtBindingsPluginBase.__init__(\n            self,\n            include_qt_plugins=include_qt_plugins,\n            noinclude_qt_plugins=noinclude_qt_plugins,\n            no_qt_translations=no_qt_translations,\n        )\n\n        self.info(\n            \"\"\"\\\nSupport for PyQt6 is not perfect, e.g. Qt threading does not work, so prefer PySide6 if you can.\"\"\"\n        )\n\n\nclass NuitkaPluginNoQt(NuitkaPluginBase):\n    \"\"\"This is a plugins for suppression of all Qt binding plugins.\"\"\"\n\n    plugin_name = \"no-qt\"\n    plugin_desc = \"Disable all Qt bindings for standalone mode.\"\n\n    warned_about = set()\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        top_package_name = module_name.getTopLevelPackageName()\n\n        if isStandaloneMode():\n            if top_package_name in getQtBindingNames():\n                if top_package_name not in self.warned_about:\n                    self.info(\n                        \"\"\"\\\nUnwanted import of '%(unwanted)s' that is forbidden encountered, preventing \\\nits use. As a result an \"ImportError\" might be given at run time. Uninstall \\\nit for full compatible behavior with the uncompiled code to debug it.\"\"\"\n                        % {\n                            \"unwanted\": top_package_name,\n                        }\n                    )\n\n                    self.warned_about.add(top_package_name)\n\n                return (False, \"Not included due to all Qt bindings disallowed.\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/PywebViewPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nfrom nuitka.Options import isStandaloneMode\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.plugins.Plugins import getActiveQtPlugin\nfrom nuitka.utils.Utils import getOS, isMacOS, isWin32Windows\n\n# spell-checker: ignore pywebview,mshtml\n\n\nclass NuitkaPluginPywebview(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the plugin.\"\"\"\n\n    plugin_name = \"pywebview\"\n    plugin_desc = \"Required by the 'webview' package (pywebview on PyPI).\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"One time only check: may this plugin be required?\n\n        Returns:\n            True if this is a standalone compilation.\n        \"\"\"\n        return isStandaloneMode()\n\n    def onModuleEncounter(\n        self, using_module_name, module_name, module_filename, module_kind\n    ):\n        # Make sure webview platforms are included as needed.\n        if module_name.isBelowNamespace(\"webview.platforms\"):\n            if isWin32Windows():\n                result = module_name in (\n                    \"webview.platforms.winforms\",\n                    \"webview.platforms.edgechromium\",\n                    \"webview.platforms.edgehtml\",\n                    \"webview.platforms.mshtml\",\n                    \"webview.platforms.cef\",\n                )\n                reason = \"Platforms package of webview used on '%s'.\" % getOS()\n            elif isMacOS():\n                result = module_name == \"webview.platforms.cocoa\"\n                reason = \"Platforms package of webview used on '%s'.\" % getOS()\n            elif getActiveQtPlugin() is not None:\n                result = module_name = \"webview.platforms.qt\"\n                reason = (\n                    \"Platforms package of webview used due to '%s' plugin being active.\"\n                    % getActiveQtPlugin()\n                )\n            else:\n                result = module_name = \"webview.platforms.gtk\"\n                reason = (\n                    \"Platforms package of webview used on '%s' without Qt plugin enabled.\"\n                    % getOS()\n                )\n\n            return result, reason\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/TensorflowPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Deprecated tensorflow plugin.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginTensorflow(NuitkaPluginBase):\n    \"\"\"This plugin is now not doing anything anymore.\"\"\"\n\n    plugin_name = \"tensorflow\"\n    plugin_desc = \"Deprecated, was once required by the tensorflow package\"\n\n    @classmethod\n    def isDeprecated(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/TkinterPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Details see below in class definition.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.Options import isStandaloneMode, shallCreateAppBundle\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.PythonFlavors import isHomebrewPython\nfrom nuitka.PythonVersions import getSystemPrefixPath, getTkInterVersion\nfrom nuitka.utils.FileOperations import listDllFilesFromDirectory, relpath\nfrom nuitka.utils.Utils import isMacOS, isWin32Windows\n\n# spell-checker: ignore tkinterdnd,tkdnd,tcltk\n\n\ndef _isTkInterModule(module):\n    full_name = module.getFullName()\n    return full_name in (\"Tkinter\", \"tkinter\", \"PySimpleGUI\", \"PySimpleGUI27\")\n\n\ndef _getHomebrewPrefix(logger):\n    result = os.path.normpath(\n        os.path.join(getSystemPrefixPath(), \"..\", \"..\", \"..\", \"..\", \"..\", \"..\", \"..\")\n    )\n\n    if not os.path.isdir(result):\n        logger.sysexit(\"Error, failed to determine Homebrew prefix, report this bug.\")\n\n    return result\n\n\nclass NuitkaPluginTkinter(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the TkInter plugin.\n\n     This is a plug-in to make programs work well in standalone mode which are using tkinter.\n     These programs require the presence of certain libraries written in the TCL language.\n     On Windows platforms, and even on Linux, the existence of these libraries cannot be\n     assumed. We therefore\n\n     1. Copy the TCL libraries as sub-folders to the program's dist folder\n     2. Redirect the program's tkinter requests to these library copies. This is\n        done by setting appropriate variables in the os.environ dictionary.\n        Tkinter will use these variable value to locate the library locations.\n\n     Each time before the program issues an import to a tkinter module, we make\n     sure, that the TCL environment variables are correctly set.\n\n    Notes:\n         You can enforce using a specific TCL folder by using TCL_LIBRARY\n         and a Tk folder by using TK_LIBRARY, but that ought to normally\n         not be necessary.\n    \"\"\"\n\n    plugin_name = \"tk-inter\"  # Nuitka knows us by this name\n    plugin_desc = \"Required by Python's Tk modules.\"\n    # Automatically suppress detectors for any other toolkit\n    plugin_gui_toolkit = True\n\n    # Only used in control tags\n    binding_name = \"tkinter\"\n\n    def __init__(self, tcl_library_dir, tk_library_dir):\n        self.tcl_library_dir = tcl_library_dir\n        self.tk_library_dir = tk_library_dir\n\n        # ensure one-time action, we deal with two names for the execution, yet we\n        # only want to do it once.\n        self.files_copied = False\n\n        self.tk_inter_version = getTkInterVersion()\n\n        if self.tk_inter_version is None:\n            self.sysexit(\"Error, it seems tk-inter is not installed.\")\n\n        # Only ever saw these 2 in use.\n        assert self.tk_inter_version in (\"8.5\", \"8.6\"), self.tk_inter_version\n\n        return None\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"This method is called one time only to check, whether the plugin might make sense at all.\n\n        Returns:\n            True if this is a standalone, else False.\n        \"\"\"\n        return isStandaloneMode()\n\n    @staticmethod\n    def createPreModuleLoadCode(module):\n        \"\"\"This method is called with a module that will be imported.\n\n        Notes:\n            If the word \"tkinter\" occurs in its full name, we know that the correct\n            setting of the TCL environment must be ensured before this happens.\n\n        Args:\n            module: the module object\n        Returns:\n            Code to insert and None (tuple)\n        \"\"\"\n        # only insert code for tkinter related modules\n        if _isTkInterModule(module):\n            # The following code will be executed before importing the module.\n            # If required we set the respective environment values.\n            code = r\"\"\"\nimport os\nos.environ[\"TCL_LIBRARY\"] = os.path.join(__nuitka_binary_dir, \"tcl\")\nos.environ[\"TK_LIBRARY\"] = os.path.join(__nuitka_binary_dir, \"tk\")\"\"\"\n\n            return code, \"Need to make sure we set environment variables for TCL.\"\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--tk-library-dir\",\n            action=\"store\",\n            dest=\"tk_library_dir\",\n            default=None,\n            help=\"\"\"\\\nThe Tk library dir. Nuitka is supposed to automatically detect it, but you can\noverride it here. Default is automatic detection.\"\"\",\n        )\n\n        group.add_option(\n            \"--tcl-library-dir\",\n            action=\"store\",\n            dest=\"tcl_library_dir\",\n            default=None,\n            help=\"\"\"\\\nThe Tcl library dir. See comments for Tk library dir.\"\"\",\n        )\n\n    @staticmethod\n    def _getTkinterDnDPlatformDirectory():\n        # From their code:\n        import platform\n\n        if platform.system() == \"Darwin\":\n            return \"osx64\"\n        elif platform.system() == \"Linux\":\n            return \"linux64\"\n        elif platform.system() == \"Windows\":\n            return \"win64\"\n        else:\n            return None\n\n    def _considerDataFilesTkinterDnD(self, module):\n        platform_rep = self._getTkinterDnDPlatformDirectory()\n\n        if platform_rep is None:\n            return\n\n        yield self.makeIncludedPackageDataFiles(\n            package_name=\"tkinterdnd2\",\n            package_directory=module.getCompileTimeDirectory(),\n            pattern=os.path.join(\"tkdnd\", platform_rep, \"**\"),\n            reason=\"Tcl needed for 'tkinterdnd2' usage\",\n            tags=\"tcl\",\n        )\n\n    def _getTclCandidatePaths(self):\n        # Check typical locations of the dirs\n        yield os.getenv(\"TCL_LIBRARY\")\n\n        # Inside the Python install, esp. on Windows.\n        for sys_prefix_path in (sys.prefix, getSystemPrefixPath()):\n            yield os.path.join(sys_prefix_path, \"tcl\", \"tcl%s\" % self.tk_inter_version)\n            yield os.path.join(sys_prefix_path, \"lib\", \"tcl%s\" % self.tk_inter_version)\n\n            # Newer Anaconda.\n            yield os.path.join(\n                sys_prefix_path, \"Library\", \"lib\", \"tcl%s\" % self.tk_inter_version\n            )\n\n        # System installs on non-Windows\n        if not isWin32Windows():\n            yield \"/usr/share/tcltk/tcl%s\" % self.tk_inter_version\n            yield \"/usr/share/tcl%s\" % self.tk_inter_version\n            yield \"/usr/lib64/tcl/tcl%s\" % self.tk_inter_version\n            yield \"/usr/lib/tcl%s\" % self.tk_inter_version\n\n        if isHomebrewPython():\n            yield os.path.normpath(\n                os.path.join(\n                    _getHomebrewPrefix(self),\n                    \"lib\",\n                    \"tcl%s\" % self.tk_inter_version,\n                )\n            )\n\n    def _getTkCandidatePaths(self):\n        yield os.getenv(\"TK_LIBRARY\")\n\n        for sys_prefix_path in (sys.prefix, getSystemPrefixPath()):\n            yield os.path.join(sys_prefix_path, \"tcl\", \"tk%s\" % self.tk_inter_version)\n            yield os.path.join(sys_prefix_path, \"lib\", \"tk%s\" % self.tk_inter_version)\n\n            # Newer Anaconda.\n            yield os.path.join(\n                sys_prefix_path, \"Library\", \"lib\", \"tk%s\" % self.tk_inter_version\n            )\n\n        if not isWin32Windows():\n            yield \"/usr/share/tcltk/tk%s\" % self.tk_inter_version\n            yield \"/usr/share/tk%s\" % self.tk_inter_version\n            yield \"/usr/lib64/tcl/tk%s\" % self.tk_inter_version\n            yield \"/usr/lib/tk%s\" % self.tk_inter_version\n\n        if isHomebrewPython():\n            yield os.path.normpath(\n                os.path.join(\n                    _getHomebrewPrefix(self),\n                    \"lib\",\n                    \"tk%s\" % self.tk_inter_version,\n                )\n            )\n\n    def considerDataFiles(self, module):\n        \"\"\"Provide TCL libraries to the dist folder.\n\n        Notes:\n            We will provide the copy the TCL/TK directories to the program's root directory,\n            that might be shiftable with some work.\n\n        Args:\n            module: the module in question, maybe ours\n\n        Yields:\n            IncludedDataFile objects.\n        \"\"\"\n\n        # Extra TCL providing module go here:\n        if module.getFullName() == \"tkinterdnd2.TkinterDnD\":\n            yield self._considerDataFilesTkinterDnD(module)\n\n            return\n\n        if not _isTkInterModule(module) or self.files_copied:\n            return\n\n        tcl_library_dir = self.tcl_library_dir\n        if tcl_library_dir is None:\n            for tcl_library_dir in self._getTclCandidatePaths():\n                if tcl_library_dir is not None and os.path.exists(\n                    os.path.join(tcl_library_dir, \"init.tcl\")\n                ):\n                    break\n\n        if tcl_library_dir is None or not os.path.exists(tcl_library_dir):\n            self.sysexit(\n                \"\"\"\\\nCould not find Tcl, you might need to use '--tcl-library-dir' and if \\\nthat works, report a bug so it can be added to Nuitka.\"\"\"\n            )\n\n        tk_library_dir = self.tk_library_dir\n        if tk_library_dir is None:\n            for tk_library_dir in self._getTkCandidatePaths():\n                if tk_library_dir is not None and os.path.exists(\n                    os.path.join(tk_library_dir, \"dialog.tcl\")\n                ):\n                    break\n\n        if tk_library_dir is None or not os.path.exists(tk_library_dir):\n            self.sysexit(\n                \"\"\"\\\nCould not find Tk, you might need to use '--tk-library-dir' and if \\\nthat works, report a bug.\"\"\"\n            )\n\n        # survived the above, now do provide the locations\n        yield self.makeIncludedDataDirectory(\n            source_path=tk_library_dir,\n            dest_path=\"tk\",\n            reason=\"Tk needed for tkinter usage\",\n            ignore_dirs=(\"demos\",),\n            tags=\"tk\",\n        )\n        yield self.makeIncludedDataDirectory(\n            source_path=tcl_library_dir,\n            ignore_dirs=(\n                (\"opt0.4\", \"http1.0\") if isMacOS() and shallCreateAppBundle() else ()\n            ),\n            dest_path=\"tcl\",\n            reason=\"Tcl needed for tkinter usage\",\n            tags=\"tcl\",\n        )\n\n        if isWin32Windows():\n            yield self.makeIncludedDataDirectory(\n                source_path=os.path.join(tcl_library_dir, \"..\", \"tcl8\"),\n                dest_path=\"tcl8\",\n                reason=\"Tcl needed for tkinter usage\",\n                tags=\"tcl\",\n            )\n\n        self.files_copied = True\n\n    def getExtraDlls(self, module):\n        if module.getFullName() == \"tkinterdnd2.TkinterDnD\":\n            platform_rep = self._getTkinterDnDPlatformDirectory()\n\n            if platform_rep is None:\n                return\n\n            module_directory = module.getCompileTimeDirectory()\n\n            for filename, _dll_filename in listDllFilesFromDirectory(\n                os.path.join(module_directory, \"tkdnd\", platform_rep)\n            ):\n                dest_path = relpath(filename, module_directory)\n                yield self.makeDllEntryPoint(\n                    source_path=filename,\n                    dest_path=os.path.join(\"tkinterdnd2\", dest_path),\n                    module_name=\"tkinterdnd2\",\n                    package_name=\"tkinterdnd2\",\n                    reason=\"tkinterdnd2 package DLL\",\n                )\n\n    def onModuleCompleteSet(self, module_set):\n        if str is bytes:\n            plugin_binding_name = \"Tkinter\"\n        else:\n            plugin_binding_name = \"tkinter\"\n\n        self.onModuleCompleteSetGUI(\n            module_set=module_set, plugin_binding_name=plugin_binding_name\n        )\n\n\nclass NuitkaPluginDetectorTkinter(NuitkaPluginBase):\n    \"\"\"Used only if plugin is not activated.\n\n    Notes:\n        We are given the chance to issue a warning if we think we may be required.\n    \"\"\"\n\n    detector_for = NuitkaPluginTkinter\n\n    @classmethod\n    def isRelevant(cls):\n        \"\"\"This method is called one time only to check, whether the plugin might make sense at all.\n\n        Returns:\n            True if this is a standalone compilation on Windows, else False.\n        \"\"\"\n        return isStandaloneMode()\n\n    def checkModuleSourceCode(self, module_name, source_code):\n        \"\"\"This method checks the source code\n\n        Notes:\n            We only use it to check whether this is the main module, and whether\n            it contains the keyword \"tkinter\".\n            We assume that the main program determines whether tkinter is used.\n            References by dependent or imported modules are assumed irrelevant.\n\n        Args:\n            module_name: the name of the module\n            source_code: the module's source code\n\n        Returns:\n            None\n        \"\"\"\n        if module_name == \"__main__\":\n            for line in source_code.splitlines():\n                # Ignore comments.\n                if \"#\" in line:\n                    line = line[: line.find(\"#\")]\n\n                if \"tkinter\" in line or \"Tkinter\" in line:\n                    self.warnUnusedPlugin(\"Tkinter needs TCL included.\")\n                    break\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/TorchPlugin.py",
    "content": "#     Copyright 2024, Jorj McKie, mailto:<jorj.x.mckie@outlook.de> find license text at end of file\n\n\n\"\"\" Deprecated torch plugin.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginTorch(NuitkaPluginBase):\n    \"\"\"This plugin is now not doing anything anymore.\"\"\"\n\n    plugin_name = \"torch\"\n    plugin_desc = \"Deprecated, was once required by the torch package\"\n\n    @classmethod\n    def isDeprecated(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/TransformersPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Plugin to provide transformers implicit dependencies.\n\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginTransformers(NuitkaPluginBase):\n    plugin_name = \"transformers\"\n\n    plugin_desc = \"Provide implicit imports for transformers package.\"\n\n    @staticmethod\n    def isAlwaysEnabled():\n        return True\n\n    # Found via grep -re \"_import_structure = {\"\n    _import_structure_modules = (\n        \"transformers\",\n        \"transformers.generation\",\n        \"transformers.integrations\",\n        \"transformers.models.albert\",\n        \"transformers.models.align\",\n        \"transformers.models.altclip\",\n        \"transformers.models.audio_spectrogram_transformer\",\n        \"transformers.models.auto\",\n        \"transformers.models.autoformer\",\n        \"transformers.models.bark\",\n        \"transformers.models.bart\",\n        \"transformers.models.barthez\",\n        \"transformers.models.bartpho\",\n        \"transformers.models.beit\",\n        \"transformers.models.bert\",\n        \"transformers.models.bert_generation\",\n        \"transformers.models.bert_japanese\",\n        \"transformers.models.bertweet\",\n        \"transformers.models.big_bird\",\n        \"transformers.models.bigbird_pegasus\",\n        \"transformers.models.biogpt\",\n        \"transformers.models.bit\",\n        \"transformers.models.blenderbot\",\n        \"transformers.models.blenderbot_small\",\n        \"transformers.models.blip\",\n        \"transformers.models.blip_2\",\n        \"transformers.models.bloom\",\n        \"transformers.models.bridgetower\",\n        \"transformers.models.bros\",\n        \"transformers.models.byt5\",\n        \"transformers.models.camembert\",\n        \"transformers.models.canine\",\n        \"transformers.models.chinese_clip\",\n        \"transformers.models.clap\",\n        \"transformers.models.clip\",\n        \"transformers.models.clipseg\",\n        \"transformers.models.clvp\",\n        \"transformers.models.code_llama\",\n        \"transformers.models.codegen\",\n        \"transformers.models.cohere\",\n        \"transformers.models.conditional_detr\",\n        \"transformers.models.convbert\",\n        \"transformers.models.convnext\",\n        \"transformers.models.convnextv2\",\n        \"transformers.models.cpm\",\n        \"transformers.models.cpmant\",\n        \"transformers.models.ctrl\",\n        \"transformers.models.cvt\",\n        \"transformers.models.data2vec\",\n        \"transformers.models.deberta\",\n        \"transformers.models.deberta_v2\",\n        \"transformers.models.decision_transformer\",\n        \"transformers.models.deformable_detr\",\n        \"transformers.models.deit\",\n        \"transformers.models.depth_anything\",\n        \"transformers.models.deta\",\n        \"transformers.models.detr\",\n        \"transformers.models.dinat\",\n        \"transformers.models.dinov2\",\n        \"transformers.models.distilbert\",\n        \"transformers.models.donut\",\n        \"transformers.models.dpr\",\n        \"transformers.models.dpt\",\n        \"transformers.models.efficientformer\",\n        \"transformers.models.efficientnet\",\n        \"transformers.models.electra\",\n        \"transformers.models.encodec\",\n        \"transformers.models.encoder_decoder\",\n        \"transformers.models.ernie\",\n        \"transformers.models.ernie_m\",\n        \"transformers.models.esm\",\n        \"transformers.models.falcon\",\n        \"transformers.models.fastspeech2_conformer\",\n        \"transformers.models.flaubert\",\n        \"transformers.models.flava\",\n        \"transformers.models.fnet\",\n        \"transformers.models.focalnet\",\n        \"transformers.models.fsmt\",\n        \"transformers.models.funnel\",\n        \"transformers.models.fuyu\",\n        \"transformers.models.gemma\",\n        \"transformers.models.git\",\n        \"transformers.models.glpn\",\n        \"transformers.models.gpt2\",\n        \"transformers.models.gpt_bigcode\",\n        \"transformers.models.gpt_neo\",\n        \"transformers.models.gpt_neox\",\n        \"transformers.models.gpt_neox_japanese\",\n        \"transformers.models.gpt_sw3\",\n        \"transformers.models.gptj\",\n        \"transformers.models.gptsan_japanese\",\n        \"transformers.models.graphormer\",\n        \"transformers.models.groupvit\",\n        \"transformers.models.herbert\",\n        \"transformers.models.hubert\",\n        \"transformers.models.ibert\",\n        \"transformers.models.idefics\",\n        \"transformers.models.imagegpt\",\n        \"transformers.models.informer\",\n        \"transformers.models.instructblip\",\n        \"transformers.models.jukebox\",\n        \"transformers.models.kosmos2\",\n        \"transformers.models.layoutlm\",\n        \"transformers.models.layoutlmv2\",\n        \"transformers.models.layoutlmv3\",\n        \"transformers.models.layoutxlm\",\n        \"transformers.models.led\",\n        \"transformers.models.levit\",\n        \"transformers.models.lilt\",\n        \"transformers.models.llama\",\n        \"transformers.models.llava\",\n        \"transformers.models.llava_next\",\n        \"transformers.models.longformer\",\n        \"transformers.models.longt5\",\n        \"transformers.models.luke\",\n        \"transformers.models.lxmert\",\n        \"transformers.models.m2m_100\",\n        \"transformers.models.mamba\",\n        \"transformers.models.marian\",\n        \"transformers.models.markuplm\",\n        \"transformers.models.mask2former\",\n        \"transformers.models.maskformer\",\n        \"transformers.models.mbart\",\n        \"transformers.models.mbart50\",\n        \"transformers.models.mctct\",\n        \"transformers.models.mega\",\n        \"transformers.models.megatron_bert\",\n        \"transformers.models.mgp_str\",\n        \"transformers.models.mistral\",\n        \"transformers.models.mixtral\",\n        \"transformers.models.mluke\",\n        \"transformers.models.mmbt\",\n        \"transformers.models.mobilebert\",\n        \"transformers.models.mobilenet_v1\",\n        \"transformers.models.mobilenet_v2\",\n        \"transformers.models.mobilevit\",\n        \"transformers.models.mobilevitv2\",\n        \"transformers.models.mpnet\",\n        \"transformers.models.mpt\",\n        \"transformers.models.mra\",\n        \"transformers.models.mt5\",\n        \"transformers.models.musicgen\",\n        \"transformers.models.musicgen_melody\",\n        \"transformers.models.mvp\",\n        \"transformers.models.nat\",\n        \"transformers.models.nezha\",\n        \"transformers.models.nllb\",\n        \"transformers.models.nllb_moe\",\n        \"transformers.models.nougat\",\n        \"transformers.models.nystromformer\",\n        \"transformers.models.oneformer\",\n        \"transformers.models.open_llama\",\n        \"transformers.models.openai\",\n        \"transformers.models.opt\",\n        \"transformers.models.owlv2\",\n        \"transformers.models.owlvit\",\n        \"transformers.models.patchtsmixer\",\n        \"transformers.models.patchtst\",\n        \"transformers.models.pegasus\",\n        \"transformers.models.pegasus_x\",\n        \"transformers.models.perceiver\",\n        \"transformers.models.persimmon\",\n        \"transformers.models.phi\",\n        \"transformers.models.phobert\",\n        \"transformers.models.pix2struct\",\n        \"transformers.models.plbart\",\n        \"transformers.models.poolformer\",\n        \"transformers.models.pop2piano\",\n        \"transformers.models.prophetnet\",\n        \"transformers.models.pvt\",\n        \"transformers.models.pvt_v2\",\n        \"transformers.models.qdqbert\",\n        \"transformers.models.qwen2\",\n        \"transformers.models.rag\",\n        \"transformers.models.realm\",\n        \"transformers.models.reformer\",\n        \"transformers.models.regnet\",\n        \"transformers.models.rembert\",\n        \"transformers.models.resnet\",\n        \"transformers.models.retribert\",\n        \"transformers.models.roberta\",\n        \"transformers.models.roberta_prelayernorm\",\n        \"transformers.models.roc_bert\",\n        \"transformers.models.roformer\",\n        \"transformers.models.rwkv\",\n        \"transformers.models.sam\",\n        \"transformers.models.seamless_m4t\",\n        \"transformers.models.seamless_m4t_v2\",\n        \"transformers.models.segformer\",\n        \"transformers.models.seggpt\",\n        \"transformers.models.sew\",\n        \"transformers.models.sew_d\",\n        \"transformers.models.siglip\",\n        \"transformers.models.speech_encoder_decoder\",\n        \"transformers.models.speech_to_text\",\n        \"transformers.models.speech_to_text_2\",\n        \"transformers.models.speecht5\",\n        \"transformers.models.splinter\",\n        \"transformers.models.squeezebert\",\n        \"transformers.models.stablelm\",\n        \"transformers.models.starcoder2\",\n        \"transformers.models.superpoint\",\n        \"transformers.models.swiftformer\",\n        \"transformers.models.swin\",\n        \"transformers.models.swin2sr\",\n        \"transformers.models.swinv2\",\n        \"transformers.models.switch_transformers\",\n        \"transformers.models.t5\",\n        \"transformers.models.table_transformer\",\n        \"transformers.models.tapas\",\n        \"transformers.models.tapex\",\n        \"transformers.models.time_series_transformer\",\n        \"transformers.models.timesformer\",\n        \"transformers.models.timm_backbone\",\n        \"transformers.models.trajectory_transformer\",\n        \"transformers.models.deprecated.mctct\",\n        \"transformers.models.deprecated.mmbt\",\n        \"transformers.models.deprecated.open_llama\",\n        \"transformers.models.deprecated.retribert\",\n        \"transformers.models.deprecated.tapex\",\n        \"transformers.models.deprecated.trajectory_transformer\",\n        \"transformers.models.deprecated.transfo_xl\",\n        \"transformers.models.deprecated.van\",\n        \"transformers.models.trocr\",\n        \"transformers.models.tvlt\",\n        \"transformers.models.tvp\",\n        \"transformers.models.udop\",\n        \"transformers.models.umt5\",\n        \"transformers.models.unispeech\",\n        \"transformers.models.unispeech_sat\",\n        \"transformers.models.univnet\",\n        \"transformers.models.upernet\",\n        \"transformers.models.van\",\n        \"transformers.models.videomae\",\n        \"transformers.models.vilt\",\n        \"transformers.models.vipllava\",\n        \"transformers.models.vision_encoder_decoder\",\n        \"transformers.models.vision_text_dual_encoder\",\n        \"transformers.models.visual_bert\",\n        \"transformers.models.vit\",\n        \"transformers.models.vit_hybrid\",\n        \"transformers.models.vit_mae\",\n        \"transformers.models.vit_msn\",\n        \"transformers.models.vitdet\",\n        \"transformers.models.vitmatte\",\n        \"transformers.models.vits\",\n        \"transformers.models.vivit\",\n        \"transformers.models.wav2vec2\",\n        \"transformers.models.wav2vec2_bert\",\n        \"transformers.models.wav2vec2_conformer\",\n        \"transformers.models.wav2vec2_phoneme\",\n        \"transformers.models.wav2vec2_with_lm\",\n        \"transformers.models.wavlm\",\n        \"transformers.models.whisper\",\n        \"transformers.models.x_clip\",\n        \"transformers.models.xglm\",\n        \"transformers.models.xlm\",\n        \"transformers.models.xlm_prophetnet\",\n        \"transformers.models.xlm_roberta\",\n        \"transformers.models.xlm_roberta_xl\",\n        \"transformers.models.xlnet\",\n        \"transformers.models.xmod\",\n        \"transformers.models.yolos\",\n        \"transformers.models.yoso\",\n        \"transformers.onnx\",\n        \"transformers.tools\",\n    )\n\n    def getImplicitImports(self, module):\n        full_name = module.getFullName()\n\n        if full_name in self._import_structure_modules:\n            for sub_module_name in self.queryRuntimeInformationSingle(\n                setup_codes=\"import %s\" % full_name.asString(),\n                value=\"list(getattr(%(module_name)s, '_import_structure', {}).keys())\"\n                % {\"module_name\": full_name.asString()},\n                info_name=\"import_structure_for_%s\" % full_name.asString(),\n            ):\n                sub_module_name = full_name.getChildNamed(sub_module_name)\n\n                if (\n                    sub_module_name == \"transformers.testing_utils\"\n                    and not self.evaluateCondition(\n                        full_name=\"transformers\", condition=\"use_pytest\"\n                    )\n                ):\n                    continue\n\n                yield sub_module_name\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/TrioPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Deprecated trio plugin.\n\"\"\"\n\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginTrio(NuitkaPluginBase):\n    plugin_name = \"trio\"\n    plugin_desc = \"Deprecated, was once required by the 'trio' package\"\n\n    @classmethod\n    def isDeprecated(cls):\n        return True\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/UpxPlugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"UPX plugin. \"\"\"\n\nimport os\n\nfrom nuitka.Options import isOnefileMode, isOnefileTempDirMode\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.Execution import executeToolChecked, getExecutablePath\nfrom nuitka.utils.FileOperations import copyFile, makePath\nfrom nuitka.utils.Hashing import Hash, getFileContentsHash\nfrom nuitka.utils.Utils import isLinux\n\n\nclass NuitkaPluginUpx(NuitkaPluginBase):\n    \"\"\"This class represents the main logic of the UPX plugin.\n\n    This is a plugin that removes useless stuff from DLLs and compresses the\n    code at the cost of run time increases.\n\n    \"\"\"\n\n    plugin_name = \"upx\"  # Nuitka knows us by this name\n    plugin_desc = \"Compress created binaries with UPX automatically.\"\n\n    def __init__(self, upx_path, upx_nocache):\n        self.upx_binary = getExecutablePath(\"upx\", upx_path)\n        self.upx_binary_hash = None\n        self.upx_nocache = upx_nocache\n\n        self.warning_given = False\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--upx-binary\",\n            action=\"store\",\n            dest=\"upx_path\",\n            default=None,\n            help=\"\"\"\\\nThe UPX binary to use or the directory it lives in, by default `upx` from PATH is used.\"\"\",\n        )\n        group.add_option(\n            \"--upx-disable-cache\",\n            action=\"store_true\",\n            dest=\"upx_nocache\",\n            default=False,\n            help=\"\"\"\\\nDo not cache UPX compression result, by default DLLs are cached, exe files are not.\"\"\",\n        )\n\n    @staticmethod\n    def _filterUpxError(stderr):\n        new_result = None\n\n        if (\n            b\"NotCompressibleException\" in stderr\n            or b\"CantPackException\" in stderr\n            or b\"AlreadyPackedException\" in stderr\n        ):\n            stderr = b\"\"\n            new_result = 0\n\n        return new_result, stderr\n\n    def _compressFile(self, filename, use_cache):\n        upx_options = [\"-q\", \"--no-progress\"]\n\n        if os.path.basename(filename).startswith(\"vcruntime140\"):\n            return\n\n        if use_cache:\n            if self.upx_binary_hash is None:\n                self.upx_binary_hash = getFileContentsHash(\n                    self.upx_binary, as_string=False\n                )\n\n            upx_hash = Hash()\n            upx_hash.updateFromBytes(self.upx_binary_hash)\n            upx_hash.updateFromValues(*upx_options)\n            upx_hash.updateFromFile(filename)\n\n            # TODO: Repeating pattern\n            upx_cache_dir = getCacheDir(\"upx\")\n            makePath(upx_cache_dir)\n\n            upx_cache_filename = os.path.join(\n                upx_cache_dir, upx_hash.asHexDigest() + \".bin\"\n            )\n\n            if os.path.exists(upx_cache_filename):\n                copyFile(upx_cache_filename, filename)\n                return\n\n        if use_cache:\n            self.info(\n                \"Uncached file, compressing '%s' may take a while.\"\n                % os.path.basename(filename)\n            )\n        else:\n            self.info(\"Compressing '%s'.\" % filename)\n\n        command = [self.upx_binary] + upx_options + [filename]\n\n        executeToolChecked(\n            logger=self,\n            command=command,\n            absence_message=\"UPX not found\",\n            stderr_filter=self._filterUpxError,\n        )\n\n        if use_cache:\n            copyFile(filename, upx_cache_filename)\n\n    def _warnNoUpx(self):\n        if not self.warning_given:\n            self.warning(\n                \"No UPX binary found, please use '--upx-binary' option to specify it.\"\n            )\n            self.warning_given = True\n\n    def onCopiedDLL(self, dll_filename):\n        if isOnefileMode():\n            pass\n        elif self.upx_binary is not None:\n            self._compressFile(filename=dll_filename, use_cache=not self.upx_nocache)\n        else:\n            self._warnNoUpx()\n\n    # Cannot compress after payload has been added for onefile on Linux,\n    # so have a dedicated point for that.\n    def onBootstrapBinary(self, filename):\n        if not isLinux():\n            return\n\n        if self.upx_binary is not None:\n            self._compressFile(filename=filename, use_cache=False)\n        else:\n            self._warnNoUpx()\n\n    def onFinalResult(self, filename):\n        if isLinux() and isOnefileMode():\n            if not isOnefileTempDirMode():\n                self.warning(\n                    \"UPX cannot compress '%s' as AppImage doesn't support that.\"\n                    % filename\n                )\n\n            # Bootstrap was compressed already right after creation.\n            return\n        else:\n            if self.upx_binary is not None:\n                self._compressFile(filename=filename, use_cache=False)\n            else:\n                self._warnNoUpx()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/plugins/standard/standard.nuitka-package.config.yml",
    "content": "# yamllint disable rule:line-length\n# yamllint disable rule:indentation\n# yamllint disable rule:comments-indentation\n# yamllint disable rule:comments\n# too many spelling things, spell-checker: disable\n---\n- module-name: '_dbus_glib_bindings' # checksum: 437428e9\n  implicit-imports:\n    - depends:\n        - '_dbus_bindings'\n\n- module-name: '_distutils_hack.override' # checksum: f6295952\n  anti-bloat:\n    - description: 'disable distutils hacks'\n      module_code: ''\n      when: 'standalone'\n\n- module-name: '_mplcairo' # checksum: c9116f66\n  implicit-imports:\n    - depends:\n        - 'pydoc'\n\n- module-name: '_mysql' # checksum: 543f6964\n  implicit-imports:\n    - depends:\n        - '_mysql_exceptions'\n\n- module-name: '_pytest._code.code' # checksum: a25bbb4b\n  implicit-imports:\n    - depends:\n        - 'py._path.local'\n\n- module-name: '_ruamel_yaml' # checksum: bbdbd674\n  implicit-imports:\n    - depends:\n        - 'ruamel.yaml.error'\n\n- module-name: '_yaml' # checksum: 35d3c787\n  implicit-imports:\n    - depends:\n        - 'yaml'\n\n- module-name: 'accessible_output2' # checksum: 89128972\n  data-files:\n    dirs:\n      - 'lib'\n\n- module-name: 'altair' # checksum: c120bb25\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'load_ipython_extension': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'altair.utils.core' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'altair.utils.v5.display' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'altair.vegalite.v5.api' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'altair.vegalite.v5.display' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'altair.vegalite.v5.schema' # checksum: 22795308\n  data-files:\n    patterns:\n      - '*.json'\n\n- module-name: 'androguard.core.resources' # checksum: 1d442429\n  data-files:\n    patterns:\n      - 'public.xml'\n\n- module-name: 'antlr4.FileStream' # checksum: b7fe4fce\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'import unittest': ''\n      change_class:\n        'TestFileStream': 'un-usable'\n\n- module-name: 'antlr4.InputStream' # checksum: e9e7bd9b\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'import unittest': ''\n      change_class:\n        'TestInputStream': 'un-usable'\n\n- module-name: 'antlr4.IntervalSet' # checksum: 214ba83e\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'import unittest': ''\n      change_class:\n        'TestIntervalSet': 'un-usable'\n\n- module-name: 'antlr4.Recognizer' # checksum: 6e605dda\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'import unittest': ''\n      change_class:\n        'Test': 'un-usable'\n\n- module-name: 'anyio._core._eventloop' # checksum: c0b82a1e\n  implicit-imports:\n    - depends:\n        - 'anyio._backends._asyncio'\n\n- module-name: 'apkutils.axml' # checksum: 1d442429\n  data-files:\n    patterns:\n      - 'public.xml'\n\n- module-name: 'appdirs' # checksum: 9d4faeee\n  anti-bloat:\n    # Keep this the same as for 'pkg_resources._vendor.appdirs' module.\n    # TODO: May allow naming specific \"anti-bloat\" blocks, and reference them by\n    # name, that works like an include statement to the module.\n    - description: 'remove pywin32 reference'\n      replacements_plain:\n        'import win32com.shell': 'raise ImportError'\n      change_function:\n        '_get_win_folder_with_pywin32': 'un-callable'\n      when: 'not use_pywin32 or not win32'\n\n- module-name: 'apscheduler' # checksum: 9df05a43\n  implicit-imports:\n    - depends:\n        - 'apscheduler.triggers.*'\n        - 'apscheduler.triggers.*.*'\n\n- module-name: 'apsw' # checksum: 8ef3407b\n  implicit-imports:\n    - depends:\n        - '.shell'\n\n- module-name: 'apt_inst' # checksum: 92a19929\n  implicit-imports:\n    - depends:\n        - 'apt_pkg'\n\n- module-name: 'arcade' # checksum: 3f9f0b7d\n  data-files:\n    dirs:\n      - 'resources'\n\n- module-name: 'aspose' # checksum: 4f20a71e\n  data-files:\n    patterns:\n      - '\"**/*\"+extension_std_suffix'\n      - '**/*.dll'\n  anti-bloat:\n    - no-follow:\n        'aspose.*': 'workaround for aspose needing to load its submodules'\n\n- module-name: 'astor' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'astropy' # checksum: a8187224\n  data-files:\n    patterns:\n      - 'CITATION'\n\n  anti-bloat:\n    - description: 'remove pytest reference'\n      replacements_plain:\n        'from .tests.runner import TestRunner': ''\n        'test = TestRunner.make_test_runner_in(__path__[0])': 'test = None'\n      when: 'not use_pytest'\n\n- module-name: 'astropy.constants.config' # checksum: 71da0564\n  implicit-imports:\n    - depends:\n        # TODO: These should probably be compile time computed\n        - 'astropy.constants.codata2018'\n        - 'astropy.constants.iau2015'\n\n- module-name: 'astropy.table.table' # checksum: 6fb51e0f\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'show_in_notebook': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'astropy.utils.console' # checksum: fbf167a8\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython import get_ipython': 'raise ImportError'\n        'from IPython.utils import io': 'raise ImportError'\n        'from IPython import version_info': 'raise ImportError'\n        'from IPython.display import display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'astropy.visualization.wcsaxes' # checksum: efd86e9d\n  anti-bloat:\n    - description: 'remove pytest reference'\n      replacements_plain:\n        'import pytest': 'raise ImportError'\n      when: 'not use_pytest'\n\n- module-name: 'asyncpg.pgproto.pgproto' # checksum: dadd25bf\n  implicit-imports:\n    - depends:\n        - 'asyncpg.pgproto.exceptions'\n\n- module-name: 'asyncpg.protocol.protocol' # checksum: 7da1344f\n  implicit-imports:\n    - depends:\n        - 'asyncpg.pgproto.pgproto'\n\n- module-name: 'atk' # checksum: 7d2edca1\n  implicit-imports:\n    - depends:\n        - 'gobject'\n\n- module-name: 'attr' # checksum: bcbcb80\n  options:\n    checks:\n      - description: \"'attrs' is not fully supported before version 23.1.0\"\n        support_info: 'warning'\n        when: 'version(\"attrs\") < (23,1)'\n\n- module-name: 'autoit' # checksum: f4a80874\n  dlls:\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'AutoIt'\n      when: 'win32'\n\n- module-name: 'av.audio.frame' # checksum: f3ef0d81\n  implicit-imports:\n    - depends:\n        - 'av.frame'\n        - 'av.audio.plane'\n\n- module-name: 'av.audio.resampler' # checksum: a63582df\n  implicit-imports:\n    - depends:\n        - 'av.filter'\n\n- module-name: 'av.buffer' # checksum: 916e6f7c\n  implicit-imports:\n    - depends:\n        - 'av.bytesource'\n        - 'av.deprecation'\n\n- module-name: 'av.codec.codec' # checksum: a82f4c60\n  implicit-imports:\n    - depends:\n        - 'av.descriptor'\n\n- module-name: 'av.codec.context' # checksum: 750c8827\n  implicit-imports:\n    - depends:\n        - 'av.video.codeccontext'\n        - 'av.audio.codeccontext'\n\n- module-name: 'av.container.core' # checksum: 9c9c5cd3\n  implicit-imports:\n    - depends:\n        - 'av.container.pyio'\n\n- module-name: 'av.container.streams' # checksum: 291863de\n  implicit-imports:\n    - depends:\n        - 'av.stream'\n\n- module-name: 'av.descriptor' # checksum: 8377dd72\n  implicit-imports:\n    - depends:\n        - 'av.option'\n\n- module-name: 'av.filter.context' # checksum: 39338ab9\n  implicit-imports:\n    - depends:\n        - 'av.filter.link'\n\n- module-name: 'av.filter.graph' # checksum: 9d8b964e\n  implicit-imports:\n    - depends:\n        - 'av.filter.context'\n\n- module-name: 'av.filter.link' # checksum: 26332ac\n  implicit-imports:\n    - depends:\n        - 'av.filter.pad'\n\n- module-name: 'av.frame' # checksum: e8ab2d30\n  implicit-imports:\n    - depends:\n        - 'av.buffer'\n\n- module-name: 'av.logging' # checksum: 7da91901\n  implicit-imports:\n    - depends:\n        - 'logging'\n\n- module-name: 'av.option' # checksum: d97fbec8\n  implicit-imports:\n    - depends:\n        - 'av.enum'\n        - 'av.utils'\n\n- module-name: 'av.packet' # checksum: 13e9006a\n  implicit-imports:\n    - depends:\n        - 'av.dictionary'\n        - 'av.sidedata.sidedata'\n\n- module-name: 'av.sidedata.sidedata' # checksum: 6adb0fe2\n  implicit-imports:\n    - depends:\n        - 'av.container.streams'\n        - 'av.sidedata.motionvectors'\n\n- module-name: 'av.utils' # checksum: 8fbe7302\n  implicit-imports:\n    - depends:\n        - 'fractions'\n\n- module-name: 'av.video.frame' # checksum: 13e95bc4\n  implicit-imports:\n    - depends:\n        - 'av.video.reformatter'\n        - 'av.plane'\n        - 'av.video.plane'\n\n- module-name: 'babel' # checksum: 37b8fa6d\n  data-files:\n    dirs:\n      - 'locale-data'\n    patterns:\n      - 'global.dat'\n\n  implicit-imports:\n    - depends:\n        - 'babel.dates'\n        - 'babel.numbers'\n\n- module-name: 'backports.zoneinfo._common' # checksum: 70450440\n  implicit-imports:\n    - depends:\n        - 'tzdata.zoneinfo'\n\n- module-name: 'backports.zoneinfo._czoneinfo' # checksum: 22b5f04e\n  implicit-imports:\n    - depends:\n        - '._common'\n\n- module-name: 'betterproto' # checksum: c9dc915d\n  data-files:\n    patterns:\n      - 'templates/*.j2'\n\n- module-name: 'bindings' # checksum: 7e84029d\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'zaber-motion-lib'\n      when: 'None is not version(\"zaber_motion\") >= (5,1,2)'\n\n- module-name: 'bitarray' # checksum: b157a72f\n  anti-bloat:\n    - description: 'remove unittest reference'\n      change_function:\n        'test': 'un-callable'\n\n- module-name: 'bitsandbytes' # checksum: 14f2c5d0\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libbitsandbytes_'\n        suffixes:\n          # Applied to all OSes in bitsandbytes wheels.\n          - 'so'\n      when: 'version(\"bitsandbytes\") < (0,43)'\n    - from_filenames:\n        prefixes:\n          - 'libbitsandbytes_'\n      when: 'version(\"bitsandbytes\") >= (0,43)'\n\n- module-name: 'bitsandbytes.triton.dequantize_rowwise' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'bitsandbytes.triton.int8_matmul_mixed_dequanitze' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'bitsandbytes.triton.int8_matmul_rowwise_dequantize' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'bitsandbytes.triton.quantize_columnwise_and_transpose' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'bitsandbytes.triton.quantize_global' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'bitsandbytes.triton.quantize_rowwise' # checksum: 291bbd89\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'is_triton_available()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'boto' # checksum: 22795308\n  data-files:\n    patterns:\n      - '*.json'\n\n- module-name: 'boto3' # checksum: b316019a\n  data-files:\n    dirs:\n      - 'data'\n\n  implicit-imports:\n    - depends:\n        - 'boto3.ec2'\n        - 'boto3.ec2.createtags'\n        - 'boto3.ec2.deletetags'\n        - 'boto3.dynamodb'\n        - 'boto3.s3'\n        - 'boto3.s3.inject'\n        - 'boto3.s3.transfer'\n\n- module-name: 'botocore' # checksum: c24c2a5b\n  data-files:\n    dirs:\n      - 'data'\n    patterns:\n      - 'cacert.pem'\n\n- module-name: 'branca' # checksum: 7c7e6a4e\n  data-files:\n    dirs:\n      - 'templates'\n    patterns:\n      - '*.json'\n\n- module-name: 'brotli._brotli' # checksum: ff2e6560\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n\n- module-name: 'cairo' # checksum: 16042494\n  implicit-imports:\n    - depends:\n        - 'gi._gi_cairo'\n\n- module-name: 'cairo._cairo' # checksum: 81e49455\n  implicit-imports:\n    - depends:\n        - 'gi._gobject'\n\n- module-name: 'cairocffi' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'cairosvg' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'cassandra.cluster' # checksum: 5e0046a4\n  implicit-imports:\n    - depends:\n        - 'cassandra.auth'\n        - 'cassandra.connection'\n        - 'concurrent.futures'\n        - 'cassandra.encoder'\n        - 'cassandra.metadata'\n        - 'cassandra.timestamps'\n        - 'cassandra.datastax.insights.reporter'\n        - 'cassandra.datastax.cloud'\n        - 'cassandra.io.libevreactor'\n        - 'cassandra.io.twistedreactor'\n        - 'cassandra.io.eventletreactor'\n        - 'cassandra.io.asyncorereactor'\n        - 'six'\n        - 'uuid'\n\n- module-name: 'cassandra.connection' # checksum: b8c24515\n  implicit-imports:\n    - depends:\n        - 'cassandra.marshal'\n        - 'cassandra.protocol'\n        - 'cassandra.segment'\n\n- module-name: 'cassandra.cqltypes' # checksum: e2377d83\n  implicit-imports:\n    - depends:\n        - 'cassandra.util'\n\n- module-name: 'cassandra.metadata' # checksum: 8f22557b\n  implicit-imports:\n    - depends:\n        - 'cassandra.query'\n        - 'cassandra.pool'\n\n- module-name: 'cassandra.protocol' # checksum: c71f52cb\n  implicit-imports:\n    - depends:\n        - 'cassandra.type_codes'\n        - 'cassandra.cqltypes'\n        - 'cassandra.policies'\n        - 'cassandra.cython_deps'\n\n- module-name: 'cassandra.util' # checksum: cac5354\n  implicit-imports:\n    - depends:\n        - 'cassandra.compat'\n\n- module-name: 'cefpython3' # checksum: cd02718a\n  data-files:\n    dirs:\n      - 'locales'\n    patterns:\n      - '*.bin'\n      - '*.pak'\n      - '*.dat'\n\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'subprocess'\n        executable: 'yes'\n    - from_filenames:\n        prefixes:\n          - ''\n\n  implicit-imports:\n    - depends:\n        - 'urllib.request'\n\n- module-name: 'celery' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'certifi' # checksum: 73df1a1e\n  data-files:\n    patterns:\n      - 'cacert.pem'\n\n- module-name: 'certifi.core' # checksum: 40d902d3\n  anti-bloat:\n    - description: 'avoid using importlib.resources without need'\n      replacements_plain:\n        # Make sure to use fallback to file using code, old ones use import attempts,\n        # now ones check versions first.\n        'from importlib.resources import path as get_path, read_text': 'raise ImportError'\n        'sys.version_info': '(0,)'\n\n- module-name: 'cffi.api' # checksum: 4743eaca\n  anti-bloat:\n    - description: 'disable source recompile'\n      change_function:\n        'emit_python_code': 'un-callable'\n        'emit_c_code': 'un-callable'\n        'compile': 'un-callable'\n        'distutils_extension': 'un-callable'\n      when: 'not use_cffi_recompiler'\n\n- module-name: 'cffi.ffiplatform' # checksum: 96258a71\n  anti-bloat:\n    - description: 'disable distutils hacks'\n      replacements_plain:\n        'import setuptools': 'pass'\n    - description: 'disable distutils hacks'\n      change_function:\n        'get_extension': 'un-callable'\n        '_build': 'un-callable'\n      when: 'not use_cffi_recompiler'\n\n- module-name: 'chainer' # checksum: c481af6a\n  implicit-imports:\n    - depends:\n        - 'chainer.distributions'\n        - 'chainer.distributions.utils'\n\n- module-name: 'chainer.distributions' # checksum: 80520696\n  implicit-imports:\n    - depends:\n        - 'chainer.distributions.utils'\n\n- module-name: 'charset_normalizer' # checksum: 3a81fa9\n  implicit-imports:\n    - depends:\n        - 'charset_normalizer.md__mypyc'\n\n- module-name: 'chia.ssl.create_ssl' # checksum: d95c1483\n  implicit-imports:\n    - depends:\n        - 'mozilla-ca'\n\n- module-name: 'chromadb' # checksum: efc1cb3a\n  implicit-imports:\n    - depends:\n        - 'chromadb.telemetry.posthog'\n        - 'chromadb.telemetry.product.posthog'\n        - 'chromadb.api.local'\n        - 'chromadb.db.duckdb'\n        - 'chromadb.db.impl.sqlite'\n        - 'chromadb.api.segment'\n        - 'chromadb.api.fastapi'\n        - 'chromadb.segment.impl.manager.local'\n        - 'chromadb.segment.impl.metadata.sqlite'\n        - 'chromadb.migrations.embeddings_queue'\n        - 'chromadb.migrations.sysdb'\n        - 'chromadb.migrations.metadb'\n        - 'chromadb.ingest.impl.simple_policy'\n\n- module-name: 'chromadb.migrations.embeddings_queue' # checksum: cce76a39\n  data-files:\n    patterns:\n      - '*.sql'\n\n- module-name: 'chromadb.migrations.metadb' # checksum: cce76a39\n  data-files:\n    patterns:\n      - '*.sql'\n\n- module-name: 'chromadb.migrations.sysdb' # checksum: cce76a39\n  data-files:\n    patterns:\n      - '*.sql'\n\n- module-name: 'clr' # checksum: ba8734b8\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'Python.Runtime'\n\n- module-name: 'clr_loader.ffi' # checksum: 5d37d102\n  dlls:\n    - from_filenames:\n        relative_path: 'dlls/x86'\n        prefixes:\n          - 'ClrLoader'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'dlls/amd64'\n        prefixes:\n          - 'ClrLoader'\n      when: 'win32 and arch_amd64'\n\n- module-name: 'clvm.version' # checksum: 5736ab2\n  anti-bloat:\n    - description: 'workaround buggy metadata usage'\n      replacements_plain:\n        '__version__ = get_distribution(__name__).version': 'raise DistributionNotFound'\n\n- module-name: 'cmsis_pack_manager.cmsis_pack_manager' # checksum: a25e9cc1\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'native'\n\n- module-name: 'connexion' # checksum: 3f9f0b7d\n  data-files:\n    dirs:\n      - 'resources'\n\n- module-name: 'Crypto.Util._raw_api' # checksum: 6e46e262\n  data-files:\n    empty_dirs:\n      - '.'\n\n- module-name: 'cryptoauthlib' # checksum: e97d909e\n  data-files:\n    patterns:\n      - '*.json'\n\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'cryptoauth'\n\n- module-name: 'Cryptodome.Util._raw_api' # checksum: 6e46e262\n  data-files:\n    empty_dirs:\n      - '.'\n\n- module-name: 'ctypes' # checksum: d5efbb6f\n  anti-bloat:\n    - description: 'remove comtypes dependency'\n      no-auto-follow:\n        'comtypes': 'ignore'\n\n- module-name: 'curl_cffi' # checksum: b6c1ff52\n  data-files:\n    patterns:\n      - 'cacert.pem'\n\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n\n- module-name: 'curses' # checksum: 6982eea\n  implicit-imports:\n    - depends:\n        - '_curses'\n\n- module-name: 'customtkinter' # checksum: 3e40e57\n  data-files:\n    dirs:\n      - 'assets'\n\n- module-name: 'customtkinter.windows.widgets.theme.theme_manager' # checksum: 9a59423e\n  anti-bloat:\n    - description: 'workaround for file path on non-Windows'\n      replacements_plain:\n        'script_directory, \"../../../assets\"': 'os.path.normpath(os.path.join(script_directory, \"../../../assets\"))'\n      # Not necessary on Windows\n      when: 'not win32'\n\n- module-name: 'cv2' # checksum: 2aa22aa9\n  data-files:\n    dirs:\n      - 'qt/fonts'\n  dlls:\n    - from_filenames:\n        relative_path: 'qt/plugins/platforms'\n        prefixes:\n          - 'lib'\n      when: 'linux'\n    - from_filenames:\n        prefixes:\n          - 'opencv_videoio'\n      when: 'win32'\n  anti-bloat:\n    - description: 'workaround for colliding native module import'\n      context:\n        - 'import textwrap'\n        - 'import pkgutil'\n        - 'from nuitka.utils.Importing import getSharedLibrarySuffix'\n      replacements_plain:\n        ? \"load_first_config([\\n\"\n        : 'if False: (['\n      replacements:\n        \"load_first_config(['config.py'], True)\": \"textwrap.indent(pkgutil.get_data('cv2', 'config.py').decode('utf8'), '    ') + textwrap.indent(pkgutil.get_data('cv2', 'config-3.py').decode('utf8'), '    ')\"\n        # Before OpenCV 4.6\n        'native_module = importlib.import_module(\"cv2.cv2\")': '\"import imp; native_module = imp.load_dynamic(\\\"cv2\\\", os.path.join(os.path.dirname(__file__), \\\"cv2%s\\\"))\" % getSharedLibrarySuffix(False)'\n        # After OpenCV 4.6\n        'native_module = importlib.import_module(\"cv2\")': '\"import imp; native_module = imp.load_dynamic(\\\"cv2\\\", os.path.join(os.path.dirname(__file__), \\\"cv2%s\\\"))\" % getSharedLibrarySuffix(False)'\n      when: 'standalone'\n  implicit-imports:\n    - depends:\n        - 'cv2.cv2'\n        - 'numpy'\n        - 'numpy.core'\n    - pre-import-code:\n        - |\n          import os\n          os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(os.path.dirname(__file__), 'qt/plugins')\n          os.environ['QT_QPA_FONTDIR'] = os.path.join(os.path.dirname(__file__), 'qt/fonts')\n      when: 'linux and standalone'\n  options:\n    checks:\n      - description: 'OpenCV2 is best supported with 4.6 or later'\n        support_info: 'warning'\n        when: 'version(get_dist_name(\"cv2\")) < (4,6)'\n\n- module-name: 'cvxpy.utilities.key_utils' # checksum: fc2bb323\n  anti-bloat:\n    - description: 'workaround for disallowed slice optimization'\n      replacements_plain:\n        'key[i].step': '(key[i].step if key[i].step is not None else 1)'\n\n- module-name: 'cytoolz.functoolz' # checksum: e6faf7b7\n  implicit-imports:\n    - depends:\n        - 'cytoolz._signatures'\n\n- module-name: 'cytoolz.itertoolz' # checksum: 30f1e27\n  implicit-imports:\n    - depends:\n        - 'cytoolz.utils'\n\n- module-name: 'dash._jupyter' # checksum: 681007fe\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython import get_ipython': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'dash.dash' # checksum: 18d125cd\n  anti-bloat:\n    - description: 'remove pytest reference'\n      replacements_plain:\n        '\"_pytest\" in sys.modules': 'False'\n      when: 'not use_pytest'\n\n- module-name: 'dash.dash_table' # checksum: 73ba5443\n  data-files:\n    patterns:\n      - 'package-info.json'\n\n- module-name: 'dash.dcc' # checksum: 73ba5443\n  data-files:\n    patterns:\n      - 'package-info.json'\n\n- module-name: 'dash.html' # checksum: 73ba5443\n  data-files:\n    patterns:\n      - 'package-info.json'\n\n- module-name: 'dask' # checksum: c72c99e9\n  data-files:\n    patterns:\n      - 'dask.yaml'\n\n- module-name: 'dask.dataframe' # checksum: b6b8eaf\n  implicit-imports:\n    - depends:\n        - 'pyarrow._*'\n\n- module-name: 'dask.dataframe._compat' # checksum: 78ecb250\n  anti-bloat:\n    - description: 'remove pandas.testing reference'\n      replacements_plain:\n        'import pandas.testing as tm': ''\n\n- module-name: 'dask.dataframe.utils' # checksum: 5af31dde\n  anti-bloat:\n    - description: 'remove pandas.testing reference'\n      replacements_plain:\n        'from dask.dataframe._compat import PANDAS_GE_150, tm': ''\n\n- module-name: 'dask.dot' # checksum: ddcb31f2\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import IPython.display as display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'datasets.packaged_modules' # checksum: 4c45e344\n  anti-bloat:\n    - description: 'workaround dependency source code usages'\n      context:\n        - 'import datasets.packaged_modules'\n      replacements_re:\n        'inspect\\.getsource\\((.*?)\\)': '\"\"'\n      append_result: '\"_PACKAGED_DATASETS_MODULES = %r\" % datasets.packaged_modules._PACKAGED_DATASETS_MODULES'\n\n- module-name: 'datasets.utils.py_utils' # checksum: b4c9faa1\n  anti-bloat:\n    - description: 'add support for compiled functions'\n      append_plain: |\n        def copyfunc(func):\n            try:\n                g = func.clone()\n            except AttributeError:\n                g = types.FunctionType(func.__code__, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n                g.__kwdefaults__ = func.__kwdefaults__\n\n            return g\n\n- module-name: 'datatree' # checksum: 70125037\n  anti-bloat:\n    - description: 'remove useless metadata usage'\n      replacements_plain:\n        '__version__ = get_distribution(__name__).version': 'raise DistributionNotFound'\n\n- module-name: 'deepspeed' # checksum: 5af29274\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      no-auto-follow:\n        'triton': 'ignore'\n        'torch.utils.cpp_extension': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'delphifmx' # checksum: f818d46e\n  dlls:\n    - from_filenames:\n        relative_path: 'Win32'\n        prefixes:\n          - 'DelphiFMX'\n        suffixes:\n          - 'pyd'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'Win64'\n        prefixes:\n          - 'DelphiFMX'\n        suffixes:\n          - 'pyd'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: 'Linux64'\n        prefixes:\n          - 'libDelphiFMX'\n      when: 'linux and not android'\n    - from_filenames:\n        relative_path: 'Android64'\n        prefixes:\n          - 'libDelphiFMX'\n      when: 'android64'\n    - from_filenames:\n        relative_path: 'Android'\n        prefixes:\n          - 'libDelphiFMX'\n      when: 'android32'\n    - from_filenames:\n        relative_path: 'OSX64'\n        prefixes:\n          - 'libDelphiFMX'\n      when: 'macos and arch_amd64'\n    - from_filenames:\n        relative_path: 'OSXARM64'\n        prefixes:\n          - 'libDelphiFMX'\n      when: 'macos and arch_arm64'\n\n- module-name: 'dependency_injector._cwiring' # checksum: 86bf476b\n  implicit-imports:\n    - depends:\n        - 'asyncio'\n\n- module-name: 'dependency_injector.containers' # checksum: 9e1b9ce9\n  implicit-imports:\n    - depends:\n        - 'six'\n        - 'dependency_injector.wiring'\n\n- module-name: 'dependency_injector.providers' # checksum: d30f2c6e\n  implicit-imports:\n    - depends:\n        - 'dependency_injector.errors'\n\n- module-name: 'diatheke' # checksum: ad402cfe\n  import-hacks:\n    - global-sys-path:\n        # This package forces itself into \"sys.path\" and expects absolute\n        # imports to be available.\n        - ''\n\n- module-name: 'dipy' # checksum: 6059075a\n  anti-bloat:\n    - description: 'remove dipy and numpy testing framework'\n      replacements_plain:\n        'from .testing import setup_test': ''\n\n- module-name: 'distributed.client' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'distributed.config' # checksum: b9f1bba2\n  data-files:\n    patterns:\n      - 'distributed.yaml'\n\n- module-name: 'distributed.deploy.cluster' # checksum: 95c04b64\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.display import display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'distributed.diagnostics.progressbar' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'distributed.scheduler' # checksum: ab59707f\n  anti-bloat:\n    - description: 'remove cython support'\n      # TODO: We should replace this with a nuitkarize in Cython maybe.\n      replacements_plain:\n        'from cython import compiled': 'raise ImportError'\n        'if compiled:': 'if False:'\n\n- module-name: 'distributed.utils' # checksum: af35df37\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'is_kernel': \"'(lambda : False)'\"\n      when: 'not use_ipython'\n\n- module-name: 'dns.rdtypes' # checksum: 119feab4\n  implicit-imports:\n    - depends:\n        - '.ANY.*'\n        - '.IN.*'\n        - '.CH.A'\n\n- module-name: 'dotenv' # checksum: c120bb25\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'load_ipython_extension': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'dotenv.main' # checksum: cb869e1f\n  anti-bloat:\n    - description: 'workaround to avoid dotenv requiring package directories'\n      replacements_plain:\n        \"raise IOError('Starting path not found')\": 'pass'\n    - description: 'workaround to avoid dotenv requiring python filenames'\n      replacements_plain:\n        'while frame.f_code.co_filename == current_file': 'if False'\n        'frame_filename = frame.f_code.co_filename': 'frame_filename = os.path.dirname(__file__)'\n\n- module-name: 'easyocr' # checksum: fb59d361\n  data-files:\n    patterns:\n      - 'character/*.txt'\n\n- module-name: 'echopype.echodata.convention' # checksum: 2707b2b2\n  data-files:\n    patterns:\n      - '*.yml'\n\n- module-name: 'eel' # checksum: ac2af84a\n  data-files:\n    patterns:\n      - 'eel.js'\n\n- module-name: 'eliot._traceback' # checksum: 9793c465\n  anti-bloat:\n    - description: 'avoid useless duplication of traceback module'\n      replacements_plain:\n        'load_module(str(\"_traceback_no_io\"), traceback)': '__import__(\"traceback\")'\n\n- module-name: 'enchant' # checksum: 810a705a\n  data-files:\n    dirs:\n      - 'data'\n\n- module-name: 'engineio' # checksum: 136f2310\n  implicit-imports:\n    - depends:\n        - 'engineio.async_drivers'\n\n- module-name: 'engineio.async_drivers' # checksum: 6b1810c1\n  implicit-imports:\n    - depends:\n        - 'engineio.async_drivers.aiohttp'\n        - 'engineio.async_drivers.asgi'\n        - 'engineio.async_drivers.eventlet'\n        - 'engineio.async_drivers.gevent'\n        - 'engineio.async_drivers.gevent_uwsgi'\n        - 'engineio.async_drivers.sanic'\n        - 'engineio.async_drivers.threading'\n        - 'engineio.async_drivers.tornado'\n\n- module-name: 'ens._normalization' # checksum: 82e073cb\n  data-files:\n    patterns:\n      - 'specs/*.json'\n\n- module-name: 'Equation' # checksum: aa47a17f\n  anti-bloat:\n    - description: 'workaround for standalone mode'\n      replacements:\n        'os.listdir(dirname)': 'repr(os.listdir(_get_module_directory(\"Equation\")))'\n      when: 'standalone'\n  implicit-imports:\n    - depends:\n        - 'Equation.equation_*'\n\n- module-name: 'eth_utils' # checksum: c62fca1b\n  data-files:\n    dirs:\n      - '__json'\n\n- module-name: 'evaluate.config' # checksum: becc1d28\n  anti-bloat:\n    - description: 'workaround python version test not compile time recognized'\n      replacements:\n        'PY_VERSION < version.parse(\"3.8\")': 'str(__import__(\"sys\").version_info < (3,8))'\n\n- module-name: 'evaluate.module' # checksum: b9453130\n  anti-bloat:\n    - description: 'add support for compiled methods'\n      replacements_plain:\n        'self.compute = types.MethodType(': 'self.compute = self.compute.__class__('\n        'self.add_batch = types.MethodType(': 'self.add_batch = self.add_batch.__class__('\n        'self.add = types.MethodType(': 'self.add = self.add.__class__('\n\n- module-name: 'exchangelib' # checksum: 9f83fa1b\n  implicit-imports:\n    - depends:\n        - 'tzdata'\n\n- module-name: 'facenet_pytorch.models.mtcnn' # checksum: f1b3250\n  data-files:\n    dirs:\n      - '../data'\n\n- module-name: 'faker.config' # checksum: c4a114e\n  implicit-imports:\n    - depends:\n        - 'faker.providers.*'\n        - 'faker.providers.*.*'\n\n- module-name: 'falcon.app' # checksum: 6ad57efc\n  implicit-imports:\n    - depends:\n        - '.app_helpers'\n        - '.responders'\n        - '.routing'\n\n- module-name: 'falcon.media.handlers' # checksum: e7933ddb\n  implicit-imports:\n    - depends:\n        - 'falcon.vendor.mimeparse'\n\n- module-name: 'falcon.request' # checksum: be9e88c3\n  implicit-imports:\n    - depends:\n        - '.request_helpers'\n        - '.forwarded'\n        - '.media'\n\n- module-name: 'falcon.response' # checksum: 9c6b607c\n  implicit-imports:\n    - depends:\n        - '.response_helpers'\n\n- module-name: 'fastapi' # checksum: 583d2408\n  implicit-imports:\n    - depends:\n        - 'fastapi.routing'\n\n- module-name: 'feedparser.html' # checksum: 65e0a1\n  anti-bloat:\n    - description: 'use SGML code more naturally'\n      context:\n        - 'import inspect'\n        - 'import textwrap'\n        - 'import sgmllib'\n      replacements:\n        '__parse_starttag.__code__ = sgmllib.SGMLParser.parse_starttag.__code__': \"'pass'\"\n        'def goahead(self, i):': \"'def goahead(self, end):'\"\n        'goahead.__code__ = sgmllib.SGMLParser.goahead.__code__': \"'pass'\"\n      change_function:\n        '__parse_starttag': 'textwrap.dedent(inspect.getsource(sgmllib.SGMLParser.parse_starttag))'\n        'goahead': 'textwrap.dedent(inspect.getsource(sgmllib.SGMLParser.goahead))'\n\n- module-name: 'fiona' # checksum: ca43c510\n  data-files:\n    dirs:\n      - 'proj_data'\n\n- module-name: 'fiona.crs' # checksum: 46b3b3db\n  implicit-imports:\n    - depends:\n        - 'fiona.enums'\n\n- module-name: 'fiona.ogrext' # checksum: 56a9bc3d\n  implicit-imports:\n    - depends:\n        - 'fiona.schema'\n        - 'fiona._shim'\n\n- module-name: 'fire' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'fitz.fitz' # checksum: d0a93b71\n  implicit-imports:\n    - depends:\n        - 'fitz._fitz'\n\n- module-name: 'flask.app' # checksum: f5f4a7d\n  implicit-imports:\n    - depends:\n        - 'jinja2.ext'\n        - 'jinja2.ext.autoescape'\n        - 'jinja2.ext.with_'\n\n- module-name: 'flask_restx' # checksum: 324bf0e5\n  data-files:\n    dirs:\n      - 'static'\n      - 'schemas'\n\n- module-name: 'flask_restx.swagger' # checksum: fd15d8\n  # Templates are put on application level for flask to find it.\n  data-files:\n    dest_path: '.'\n    dirs:\n      - 'templates'\n\n- module-name: 'folium' # checksum: bfd19d5d\n  data-files:\n    dirs:\n      - 'templates'\n\n- module-name: 'Foundation' # checksum: f269907b\n  options:\n    checks:\n      - description: \"The 'Foundation' module requires bundle module\"\n        macos_bundle: 'yes'\n        when: 'macos'\n\n- module-name: 'frozendict' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'fsspec.transaction' # checksum: f49a0729\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import distributed': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'future.standard_library' # checksum: 27611f9\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'from future.moves.test import support': 'raise ImportError'\n      when: 'not use_unittest'\n\n- module-name: 'geopandas.datasets' # checksum: d6c28237\n  data-files:\n    dirs:\n      - 'naturalearth_cities'\n      - 'naturalearth_lowres'\n    patterns:\n      - '*.zip'\n\n- module-name: 'gevent' # checksum: ce776b5f\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n        - 'gevent._config'\n        - 'gevent.core'\n        - 'gevent.resolver_thread'\n        - 'gevent.resolver_ares'\n        - 'gevent.socket'\n        - 'gevent.threadpool'\n        - 'gevent.thread'\n        - 'gevent.threading'\n        - 'gevent.select'\n        - 'gevent.hub'\n        - 'gevent.greenlet'\n        - 'gevent.local'\n        - 'gevent.event'\n        - 'gevent.queue'\n        - 'gevent.resolver'\n        - 'gevent.subprocess'\n\n    - depends:\n        - 'gevent.libuv'\n      when: 'win32'\n\n    - depends:\n        - 'gevent.libev'\n      when: 'not win32'\n\n- module-name: 'gevent._abstract_linkable' # checksum: 2e3ebe49\n  implicit-imports:\n    - depends:\n        - 'gevent.__abstract_linkable'\n        - 'gevent._gevent_c_abstract_linkable'\n\n- module-name: 'gevent._ffi' # checksum: fd37b7a8\n  implicit-imports:\n    - depends:\n        - 'gevent._ffi.loop'\n        - 'gevent._ffi.callback'\n        - 'gevent._ffi.watcher'\n\n- module-name: 'gevent._gevent_c_hub_local' # checksum: 9390e659\n  implicit-imports:\n    - depends:\n        - 'gevent._gevent_c_greenlet_primitives'\n\n- module-name: 'gevent._greenlet' # checksum: 46dfe125\n  implicit-imports:\n    - depends:\n        - 'gevent.__ident'\n\n- module-name: 'gevent._hub_local' # checksum: 23497efa\n  implicit-imports:\n    - depends:\n        - 'gevent.__hub_local'\n        - 'gevent.__greenlet_primitives'\n        - 'gevent._gevent_c_hub_local'\n\n- module-name: 'gevent._hub_primitives' # checksum: 9235fa67\n  implicit-imports:\n    - depends:\n        - 'gevent.__hub_primitives'\n        - 'gevent._gevent_cgreenlet'\n        - 'gevent._gevent_c_hub_primitives'\n\n- module-name: 'gevent._imap' # checksum: 75a23344\n  implicit-imports:\n    - depends:\n        - 'gevent.__imap'\n        - 'gevent._gevent_c_imap'\n\n- module-name: 'gevent._semaphore' # checksum: d784ce59\n  implicit-imports:\n    - depends:\n        - 'gevent._abstract_linkable'\n        - 'gevent.__semaphore'\n        - 'gevent._gevent_c_semaphore'\n\n- module-name: 'gevent._util' # checksum: 99746425\n  anti-bloat:\n    - description: 'remove gevent release framework'\n      change_function:\n        'postreleaser_before': \"'(lambda data: None)'\"\n        'prereleaser_middle': \"'(lambda data: None)'\"\n\n- module-name: 'gevent._waiter' # checksum: b3e9fa49\n  implicit-imports:\n    - depends:\n        - 'gevent.__waiter'\n        - 'gevent._gevent_c_waiter'\n\n- module-name: 'gevent.event' # checksum: 3fabec99\n  implicit-imports:\n    - depends:\n        - 'gevent._event'\n        - 'gevent._gevent_cevent'\n\n- module-name: 'gevent.greenlet' # checksum: 80f53d1d\n  implicit-imports:\n    - depends:\n        - 'gevent._hub_local'\n        - 'gevent._greenlet'\n        - 'gevent._gevent_c_ident'\n\n- module-name: 'gevent.hub' # checksum: 6b6ccad9\n  implicit-imports:\n    - depends:\n        - 'gevent._hub_primitives'\n        - 'gevent._greenlet_primitives'\n        - 'gevent._hub_local'\n        - 'gevent._waiter'\n        - 'gevent._util'\n        - 'gevent._ident'\n        - 'gevent.exceptions'\n\n- module-name: 'gevent.libev' # checksum: 300a9601\n  implicit-imports:\n    - depends:\n        - 'gevent.libev.corecext'\n        - 'gevent.libev.corecffi'\n        - 'gevent.libev.watcher'\n\n- module-name: 'gevent.libuv' # checksum: a72411fa\n  implicit-imports:\n    - depends:\n        - 'gevent._interfaces'\n        - 'gevent._ffi'\n        - 'gevent.libuv.loop'\n        - 'gevent.libuv.watcher'\n\n- module-name: 'gevent.libuv.loop' # checksum: c73ddb2a\n  implicit-imports:\n    - depends:\n        - 'gevent.libuv._corecffi'\n        - 'gevent._interfaces'\n\n- module-name: 'gevent.local' # checksum: 3af924b3\n  implicit-imports:\n    - depends:\n        - 'gevent._local'\n        - 'gevent._gevent_clocal'\n\n- module-name: 'gevent.monkey' # checksum: 8498f7cb\n  implicit-imports:\n    - depends:\n        - 'gevent.builtins'\n        - 'gevent.time'\n        - 'gevent.local'\n        - 'gevent.ssl'\n        - 'gevent.events'\n        - 'gevent.signal'\n\n- module-name: 'gevent.pool' # checksum: 9e719b31\n  implicit-imports:\n    - depends:\n        - 'gevent._imap'\n\n- module-name: 'gevent.queue' # checksum: 722307e\n  implicit-imports:\n    - depends:\n        - 'gevent._queue'\n        - 'gevent._gevent_cqueue'\n\n- module-name: 'gevent.resolver' # checksum: 27625b1f\n  implicit-imports:\n    - depends:\n        - 'gevent.resolver.blocking'\n        - 'gevent.resolver.cares'\n        - 'gevent.resolver.thread'\n\n- module-name: 'git.objects.submodule.base' # checksum: 3c6d40d1\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'if HIDE_WINDOWS_KNOWN_ERRORS': 'if False'\n      when: 'not use_unittest'\n\n- module-name: 'git.util' # checksum: 3c6d40d1\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'if HIDE_WINDOWS_KNOWN_ERRORS': 'if False'\n      when: 'not use_unittest'\n\n- module-name: 'gmsh' # checksum: 713accff\n  dlls:\n    - by_code:\n        setup_code: 'import gmsh'\n        filename_code: 'gmsh.libpath'\n      dest_path: 'lib'\n\n- module-name: 'gooey' # checksum: 3e8811a7\n  data-files:\n    dirs:\n      - 'languages'\n      - 'images'\n\n- module-name: 'gradio' # checksum: 1c49bcc7\n  data-files:\n    dirs:\n      - 'templates'\n      - 'node'\n      - '_frontend_code'\n    patterns:\n      - '*.json'\n\n- module-name: 'gradio.blocks' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'gradio.component_meta' # checksum: c9db8138\n  anti-bloat:\n    - description: 'workaround attempt to create .pyi files during execution'\n      change_function:\n        'create_or_modify_pyi': \"'(lambda *args, **kwargs: None)'\"\n\n- module-name: 'gradio.ipython_ext' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'gradio.utils' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'gradio_client' # checksum: 22795308\n  data-files:\n    patterns:\n      - '*.json'\n\n- module-name: 'grpc' # checksum: 52c0eb37\n  data-files:\n    patterns:\n      - '_cython/_credentials/roots.pem'\n\n- module-name: 'gruut' # checksum: 19583930\n  data-files:\n    patterns:\n      - 'VERSION'\n\n  implicit-imports:\n    - depends:\n        - 'gruut_ipa'\n        - 'gruut_lang_en'\n\n- module-name: 'gruut_ipa' # checksum: 810a705a\n  data-files:\n    dirs:\n      - 'data'\n\n- module-name: 'gruut_lang_en' # checksum: 206e4c65\n  data-files:\n    dirs:\n      - 'espeak'\n      - 'g2p'\n      - 'pos'\n    patterns:\n      - 'VERSION'\n      - 'lexicon.db'\n\n- module-name: 'gtk._gtk' # checksum: 4fb4a03b\n  implicit-imports:\n    - depends:\n        - 'pangocairo'\n        - 'pango'\n        - 'cairo'\n        - 'gio'\n        - 'atk'\n\n- module-name: 'gtkunixprint' # checksum: 33e02294\n  implicit-imports:\n    - depends:\n        - 'gobject'\n        - 'cairo'\n        - 'gtk'\n\n- module-name: 'gymnasium.envs.registration' # checksum: 4f0b7bbb\n  anti-bloat:\n    - description: 'better error message for environment backends'\n      replacements_plain:\n        '    mod = importlib.import_module(mod_name)': |\n          #\n              try:\n                mod = importlib.import_module(mod_name)\n              except ModuleNotFoundError:\n                import sys\n                sys.exit(\"Nuitka: For this environment to load, need to use this as an option to compile with '--include-module=%s'.\" % mod_name)\n      when: 'not deployment'\n\n- module-name: 'h2o' # checksum: 416e6006\n  data-files:\n    dirs:\n      - 'h2o_data'\n      - 'backend/bin'\n    patterns:\n      - '*.txt'\n      - '*.csv'\n      - '*.jar'\n\n- module-name: 'h5py' # checksum: 5a8caf97\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'enable_ipython_completer': \"'(lambda: None)'\"\n      when: 'not use_ipython'\n    - description: 'remove h5py testing framework'\n      replacements_plain:\n        'from .tests import run_tests': ''\n      change_function:\n        'run_tests': \"'(lambda args=None: None)'\"\n\n- module-name: 'h5py.h5' # checksum: 4247d58a\n  implicit-imports:\n    - depends:\n        - 'h5py.defs'\n\n- module-name: 'h5py.h5a' # checksum: b4c94904\n  implicit-imports:\n    - depends:\n        - 'h5py._proxy'\n\n- module-name: 'h5py.h5p' # checksum: 36dbc221\n  implicit-imports:\n    - depends:\n        - 'h5py.h5ac'\n\n- module-name: 'h5py.h5s' # checksum: 6502258b\n  implicit-imports:\n    - depends:\n        - 'h5py.utils'\n\n- module-name: 'huggingface_hub._login' # checksum: 3c12cb9a\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import ipywidgets.widgets as widgets': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'huggingface_hub._snapshot_download' # checksum: 94377758\n  anti-bloat:\n    - description: 'workaround hard module import attribute bug'\n      replacements_plain:\n        'from .utils import tqdm as hf_tqdm': 'from .utils.tqdm import tqdm as hf_tqdm'\n\n- module-name: 'huggingface_hub.commands.user' # checksum: 3c12cb9a\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import ipywidgets.widgets as widgets': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'huggingface_hub.file_download' # checksum: da417692\n  anti-bloat:\n    - description: 'workaround hard module import attribute bug'\n      append_plain: 'from .utils.tqdm import tqdm'\n\n- module-name: 'hydra' # checksum: 380a0a91\n  data-files:\n    dirs:\n      - 'conf'\n\n- module-name: 'hydra.core.plugins' # checksum: f4d9feae\n  implicit-imports:\n    - depends:\n        - 'hydra._internal.core_plugins.*'\n        - 'hydra_plugins.*'\n\n- module-name: 'imageio.core.imopen' # checksum: 7af58240\n  anti-bloat:\n    - replacements_plain:\n        '`pip install imageio[{config.install_name}]` to install it': '`--include-module={config.module_name}` with Nuitka to include it'\n        'err_type = ImportError': 'err_type = RuntimeError'\n      when: 'not deployment'\n\n  implicit-imports:\n    - depends:\n        - 'imageio.plugins.pillow_legacy'\n        - 'imageio.plugins.freeimage'\n        - 'imageio.plugins.simpleitk'\n        - 'imageio.plugins.pillow'\n\n- module-name: 'imagej' # checksum: 763ace32\n  anti-bloat:\n    - description: 'compile time resolve version metadata'\n      # This is necessary, because they have a function that prevents compile\n      # time from seeing it. We might later force those to be inlined instead.\n      replacements:\n        'sj.get_version(\"pyimagej\")': 'repr(version(\"pyimagej\"))'\n\n- module-name: 'importlib_metadata' # checksum: 37dae78\n  anti-bloat:\n    - description: 'remove useless metadata usage'\n      replacements:\n        '__version__ = version(__name__)': 'repr(version(\"importlib_metadata\"))'\n      when: 'standalone'\n\n- module-name: 'importlib_resources._compat' # checksum: 1251a882\n  anti-bloat:\n    - description: 'workaround for file reader not used'\n      replacements_plain:\n        '_file_reader(self.spec)': '_native_reader(self.spec) or _file_reader(self.spec)'\n\n- module-name: 'ipcqueue' # checksum: ff2e6560\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n\n- module-name: 'IPython.core.oinspect' # checksum: e7304002\n  implicit-imports:\n    - depends:\n        - 'pygments.lexers.python'\n\n- module-name: 'jaraco.text' # checksum: c4665ab4\n  data-files:\n    patterns:\n      - 'Lorem ipsum.txt'\n\n- module-name: 'jarowinkler' # checksum: ac739d1f\n  implicit-imports:\n    - depends:\n        - 'jarowinkler._initialize_cpp'\n\n- module-name: 'joblib._dask' # checksum: e3ae7a22\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import distributed': 'raise ImportError'\n        'import dask': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'joblib._memmapping_reducer' # checksum: 685c89b4\n  anti-bloat:\n    - description: 'workaround incorrect warning'\n      replacements_plain:\n        'warnings.warn': ''\n\n- module-name: 'joblib._parallel_backends' # checksum: 850f2858\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'from distributed import get_worker': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'joblib.externals.cloudpickle.cloudpickle' # checksum: 1d738df0\n  anti-bloat:\n    - no-auto-follow:\n        'tornado': 'can break tornado integration of joblib'\n\n- module-name: 'joblib.externals.loky.backend.popen_loky_posix' # checksum: 2f19f091\n  anti-bloat:\n    - description: 'workaround for forking itself'\n      replacements_plain:\n        'if __name__ == \"__main__\":': 'def main():'\n      append_plain: |\n        if __name__ == \"__main__\": main()\n      when: 'not win32'\n\n- module-name: 'joblib.externals.loky.backend.popen_loky_win32' # checksum: 1c46facc\n  anti-bloat:\n    - description: 'workaround for forking itself'\n      replacements_plain:\n        \"getattr(sys, 'frozen', False)\": 'False'\n        'getattr(sys, \"frozen\", False)': 'False'\n        'assert is_forking(sys.argv), \"Not forking\"': ''\n      when: 'win32'\n\n- module-name: 'joblib.externals.loky.backend.resource_tracker' # checksum: 685c89b4\n  anti-bloat:\n    - description: 'workaround incorrect warning'\n      replacements_plain:\n        'warnings.warn': ''\n\n- module-name: 'jpype' # checksum: f75160d3\n  data-files:\n    dest_path: 'jpype'\n    patterns:\n      - '../org.jpype.jar'\n    when: 'is_conda_package(\"jpype\")'\n\n- module-name: 'jsonrpcserver.main' # checksum: 22795308\n  data-files:\n    patterns:\n      - '*.json'\n\n- module-name: 'jsonschema' # checksum: 61a62e91\n  data-files:\n    dirs:\n      - 'schemas'\n\n- module-name: 'jsonschema_specifications' # checksum: 61a62e91\n  data-files:\n    dirs:\n      - 'schemas'\n\n- module-name: 'keras.api._v2.keras.__internal__.utils' # checksum: 63342938\n  anti-bloat:\n    - description: 'remove keras testing tools reference'\n      replacements_plain:\n        'from keras.testing_infra.test_utils import layer_test': ''\n\n- module-name: 'keras.src.utils.vis_utils' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'keras.utils.vis_utils' # checksum: 6cba68c8\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython import display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'keyring' # checksum: 9e501f24\n  data-files:\n    include-metadata:\n      - 'keyring'\n  implicit-imports:\n    - depends:\n        - 'keyring.backends.*'\n\n- module-name: 'keyring.backends.Windows' # checksum: 2531fce0\n  implicit-imports:\n    - depends:\n        - 'win32timezone'\n\n- module-name: 'kivy' # checksum: 810a705a\n  data-files:\n    dirs:\n      - 'data'\n\n- module-name: 'kivy._clock' # checksum: fbb1ca92\n  implicit-imports:\n    - depends:\n        - 'kivy.weakmethod'\n\n- module-name: 'kivy.graphics.compiler' # checksum: c064234c\n  implicit-imports:\n    - depends:\n        - 'kivy.graphics.shader'\n\n- module-name: 'kivy.graphics.instructions' # checksum: b7c2a5f3\n  implicit-imports:\n    - depends:\n        - 'kivy.graphics.buffer'\n        - 'kivy.graphics.vertex'\n        - 'kivy.graphics.vbo'\n\n- module-name: 'kivy.graphics.vbo' # checksum: 1e23e34c\n  implicit-imports:\n    - depends:\n        - 'kivy.graphics.compiler'\n\n- module-name: 'kivymd' # checksum: 5737ee84\n  data-files:\n    dirs:\n      - 'fonts'\n      - 'images'\n      - 'data'\n      - 'uix'\n\n- module-name: 'kiwisolver' # checksum: a0fc11a6\n  dlls:\n    - from_filenames:\n        prefixes:\n          - '_cext'\n\n- module-name: 'langchain.chains.llm_summarization_checker' # checksum: b065fa3\n  data-files:\n    patterns:\n      - '*.txt'\n\n- module-name: 'lark' # checksum: ab5b4914\n  data-files:\n    dirs:\n      - 'grammars'\n\n- module-name: 'librosa.core.intervals' # checksum: fc442d1\n  data-files:\n    patterns:\n      - 'intervals.msgpack'\n\n- module-name: 'libusb_package' # checksum: 5cbb45ba\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libusb'\n\n- module-name: 'lightgbm' # checksum: 38422ad6\n  data-files:\n    dirs:\n      - 'locales'\n    patterns:\n      - '*.bin'\n      - 'VERSION.txt'\n  dlls:\n    - from_filenames:\n        relative_path: 'bin'\n        prefixes:\n          - 'lib_lightgbm'\n\n- module-name: 'lightgbm.dask' # checksum: f12519e1\n  anti-bloat:\n    - description: 'remove docstrings'\n      replacements_plain:\n        \"    _before_kwargs, _kwargs, _after_kwargs = _base_doc.partition('**kwargs')  # type: ignore\": ''\n        '        {_before_kwargs}client : dask.distributed.Client or None, optional (default=None)': ''\n        ? \"        {' ':4}Dask client. If ``None``, ``distributed.default_client()`` will be used at runtime. The Dask client used by this class will not be saved if the model object is pickled.\"\n        : ''\n        '        {_kwargs}{_after_kwargs}': ''\n\n- module-name: 'lightgbm.libpath' # checksum: f4a8da46\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'lib_lightgbm'\n\n- module-name: 'lightning' # checksum: 3167b040\n  data-files:\n    patterns:\n      - 'version.info'\n\n- module-name: 'lightning.app.runners.cloud' # checksum: 19428428\n  anti-bloat:\n    - description: 'remove lightning.app.testing dependency'\n      no-auto-follow:\n        'lightning.app.testing.helpers': 'ignore'\n\n- module-name: 'lightning_fabric' # checksum: 3167b040\n  data-files:\n    patterns:\n      - 'version.info'\n\n- module-name: 'llvmlite.binding.analysis' # checksum: 3083141d\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        '__IPYTHON__': 'raise NameError'\n      when: 'not use_ipython'\n\n- module-name: 'llvmlite.binding.ffi' # checksum: 57dc7edf\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'llvmlite'\n          - 'libllvmlite'\n\n- module-name: 'loguru._colorama' # checksum: 34c7690c\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'ipykernel': 'ignore'\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'lxml' # checksum: f89961a7\n  implicit-imports:\n    - depends:\n        - '.builder'\n        - '.etree'\n        - '.objectify'\n        - '.sax'\n        - '._elementpath'\n\n- module-name: 'lxml.etree' # checksum: dfaed226\n  implicit-imports:\n    - depends:\n        - '._elementpath'\n        - 'gzip'\n\n- module-name: 'lxml.html' # checksum: 1e539447\n  implicit-imports:\n    - depends:\n        - '.html.clean'\n        - '.html.diff'\n        - '.etree'\n\n- module-name: 'lxml.objectify' # checksum: c4e92339\n  implicit-imports:\n    - depends:\n        - 'lxml.etree'\n\n- module-name: 'markdown' # checksum: 827a8bc8\n  implicit-imports:\n    - depends:\n        - 'markdown.extensions.*'\n\n- module-name: 'matplotlib' # checksum: 977975bb\n  anti-bloat:\n    - description: 'remove setuptools and pytest testing framework reference'\n      replacements:\n        '(root / \".git\").exists()\"': \"'None'\"\n        'test.__test__ = False': ''\n      change_function:\n        '_init_tests': \"'None'\"\n        'test': \"'None'\"\n        '_get_version': \"'(lambda : _version.version)'\"\n    - description: 'avoid PySide6 unless used'\n      no-auto-follow:\n        'PySide6': 'ignore'\n      when: 'not use_pyside6'\n    - description: 'avoid PySide2 unless used'\n      no-auto-follow:\n        'PySide2': 'ignore'\n      when: 'not use_pyside2'\n    - description: 'avoid PyQt5 unless used'\n      no-auto-follow:\n        'PyQt5': 'ignore'\n      when: 'not use_pyqt5'\n    - description: 'avoid PyQt6 unless used'\n      no-auto-follow:\n        'PyQt6': 'ignore'\n      when: 'not use_pyqt6'\n\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backend_managers'\n        - 'matplotlib.backend_bases'\n        - 'mpl_toolkits'\n  options:\n    checks:\n      - description: \"For matplotlib a GUI tooltkit selection might be needed use, use '--enable-plugin=tk-inter|PySide6|PySide2|PyQt6|PyQt5', or use '--enable-plugin=no-qt' for headless mode.\"\n        support_info: 'plugin'\n        when: 'not macos and not (use_noqt or use_pyqt5 or use_pyqt6 or use_pyside2 or use_pyside6)'\n\n- module-name: 'matplotlib.backend_bases' # checksum: 5954e33d\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        '_fix_ipython_backend2gui': \"'(lambda cls: None)'\"\n      when: 'not use_ipython'\n\n- module-name: 'matplotlib.backends' # checksum: b30e7761\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends._backend_agg'\n        - 'matplotlib.backends.backend_agg'\n    - depends:\n        - 'matplotlib.backends._tkagg'\n        - 'matplotlib.backends.backend_tkagg'\n      when: 'use_tkinter'\n    - depends:\n        - 'matplotlib.backends._tkagg'\n        - 'matplotlib.backends.backend_tkagg'\n      when: 'use_tkinter'\n    - depends:\n        - 'matplotlib.backends.backend_qt5'\n        - 'matplotlib.backends.backend_qt5cairo'\n      when: 'use_pyqt5'\n    - depends:\n        - 'matplotlib.backends.backend_qtagg'\n        - 'matplotlib.backends.backend_qt'\n      when: 'use_pyqt5 or use_pyqt6 or use_pyside2 or use_pyside6'\n    - depends:\n        - 'matplotlib.backends.backend_macosx'\n      when: 'macos and not (use_pyqt5 or use_pyqt6 or use_pyside2 or use_pyside6)'\n\n- module-name: 'matplotlib.backends.backend_cairo' # checksum: 7ada20bb\n  implicit-imports:\n    - depends:\n        - 'cairo'\n        - 'cairocffi'\n\n- module-name: 'matplotlib.backends.backend_gtk3' # checksum: cdcdf5f1\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_gtk3agg'\n        - 'gi'\n\n- module-name: 'matplotlib.backends.backend_gtk3agg' # checksum: 821bb8e1\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_gtk3'\n        - 'gi'\n\n- module-name: 'matplotlib.backends.backend_qt5' # checksum: 9df6d473\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_qt5agg'\n        - 'PyQt5'\n\n- module-name: 'matplotlib.backends.backend_qt5agg' # checksum: 169ad914\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_qt5'\n        - 'PyQt5'\n\n- module-name: 'matplotlib.backends.backend_webagg' # checksum: a81a3b73\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_webagg_core'\n        - 'tornado'\n\n- module-name: 'matplotlib.backends.backend_webagg_core' # checksum: 42394f38\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_webagg'\n        - 'tornado'\n\n- module-name: 'matplotlib.backends.backend_wx' # checksum: 91d13ceb\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_wxagg'\n        - 'wx'\n\n- module-name: 'matplotlib.backends.backend_wxagg' # checksum: 1b2160ae\n  implicit-imports:\n    - depends:\n        - 'matplotlib.backends.backend_wx'\n        - 'wx'\n\n- module-name: 'matplotlib.figure' # checksum: e03fe475\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        '_repr_html_': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'matplotlib.pyplot' # checksum: 1b72a2b5\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'install_repl_displayhook': \"'(lambda: None)'\"\n        'uninstall_repl_displayhook': \"'(lambda: None)'\"\n      when: 'not use_ipython'\n\n- module-name: 'mercurial.encoding' # checksum: de4741d0\n  implicit-imports:\n    - depends:\n        - 'mercurial.charencode'\n        - 'mercurial.cext.parsers'\n\n- module-name: 'mkl._mklinit' # checksum: f45333f2\n  dlls:\n    - by_code:\n        setup_code: 'import os;import sys'\n        filename_code: \"os.path.join(sys.prefix, 'lib', 'libmkl_mc3.1.dylib')\"\n      dest_path: '.'\n      when: 'is_conda_package(\"mkl\") and macos'\n\n- module-name: 'mmcv.utils' # checksum: 7f54a1b\n  anti-bloat:\n    - description: 'remove mmcv testing framework'\n      replacements_plain:\n        'from .testing import': 'if False: from .testing import'\n      append_plain: '__all__ = [_name for _name in __all__ if _name in globals()]'\n\n- module-name: 'mmcv.utils.parrots_wrapper' # checksum: 8b72a836\n  anti-bloat:\n    - description: 'remove torch.utils.cpp_extension usage'\n      change_function:\n        '_get_extension': \"'(lambda: None, None, None)'\"\n        'is_rocm_pytorch': \"'(lambda: False)'\"\n        '_get_cuda_home': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'mmengine.utils.dl_utils.collect_env' # checksum: 5b16a015\n  anti-bloat:\n    - description: 'remove torch.utils.cpp_extension usage'\n      change_function:\n        '_get_cuda_home': 'un-callable'\n\n- module-name: 'mmengine.utils.dl_utils.parrots_wrapper' # checksum: 8b72a836\n  anti-bloat:\n    - description: 'remove torch.utils.cpp_extension usage'\n      change_function:\n        '_get_extension': \"'(lambda: None, None, None)'\"\n        'is_rocm_pytorch': \"'(lambda: False)'\"\n        '_get_cuda_home': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'mnemonic' # checksum: 686b054a\n  data-files:\n    dirs:\n      - 'wordlist'\n\n- module-name: 'mock.mock' # checksum: 76ad686f\n  anti-bloat:\n    - replacements_plain:\n        'from unittest.util import safe_repr': ''\n      append_plain: |\n        def safe_repr(obj, short=False):\n          _MAX_LENGTH = 80\n\n          try:\n            result = repr(obj)\n          except Exception:\n            result = object.__repr__(obj)\n          if not short or len(result) < _MAX_LENGTH:\n            return result\n          return result[:_MAX_LENGTH] + ' [truncated]...'\n      when: 'not use_unittest'\n\n- module-name: 'moto' # checksum: cd522fec\n  data-files:\n    patterns:\n      - 'ec2/resources/instance_types.json'\n      - 'ec2/resources/amis.json'\n  anti-bloat:\n    - description: 'remove pytest testing framework'\n      replacements:\n        \"imp.find_module('pytest')\": \"'None'\"\n      when: 'not use_pytest'\n\n- module-name: 'moviepy.audio.fx' # checksum: 1851bf53\n  implicit-imports:\n    - depends:\n        - '.*'\n\n- module-name: 'moviepy.video.fx' # checksum: 1851bf53\n  implicit-imports:\n    - depends:\n        - '.*'\n\n- module-name: 'moviepy.video.io.html_tools' # checksum: f97c4550\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.display import HTML': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'mozilla-ca' # checksum: 970833a3\n  data-files:\n    patterns:\n      - '*.pem'\n\n- module-name: 'mpmath' # checksum: 843223c1\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'doctests': 'un-callable'\n        'runtests': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'multiprocess.util' # checksum: bbf4504b\n  anti-bloat:\n    - description: 'remove unittest reference'\n      change_function:\n        '_cleanup_tests': 'un-callable'\n      when: 'not use_unittest'\n\n- module-name: 'multiprocessing.util' # checksum: bbf4504b\n  anti-bloat:\n    - description: 'remove unittest reference'\n      change_function:\n        '_cleanup_tests': 'un-callable'\n      when: 'not use_unittest'\n\n- module-name: 'nacl._sodium' # checksum: ff2e6560\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n\n- module-name: 'names' # checksum: 4d754910\n  data-files:\n    patterns:\n      - 'dist.*'\n\n- module-name: 'networkx' # checksum: 6f2aa88a\n  anti-bloat:\n    - description: 'remove networkx.testing usage and pytest reference (via nose)'\n      replacements_plain:\n        'from networkx.testing.test import run as test': 'test = None'\n        'from networkx.tests.test import run as test': 'test = None'\n      no-auto-follow:\n        'nose': 'ignore'\n        'pytest': 'ignore'\n      when: 'not use_pytest'\n\n- module-name: 'networkx.classes.backends' # checksum: 29bf8c92\n  anti-bloat:\n    - description: 'remove pytest reference'\n      replacements_plain:\n        'os.environ.get(\"NETWORKX_GRAPH_CONVERT\")': 'None'\n      when: 'not use_pytest'\n\n- module-name: 'networkx.utils.decorators' # checksum: 7f34ff95\n  anti-bloat:\n    - description: 'required for decorator compatibility'\n      replacements_plain:\n        'func.__defaults__ = f.__defaults__': ''\n        'real_func = func.__argmap__.compile(func.__wrapped__)': 'return func'\n        '    return argmap(_not_implemented_for, 0)': |\n          #\n              import functools\n              def inner(func):\n                  @functools.wraps(func)\n                  def _not_implemented_for(g):\n                      if (mval is None or mval == g.is_multigraph()) and (\n                          dval is None or dval == g.is_directed()\n                      ):\n                          raise nx.NetworkXNotImplemented(errmsg)\n                      return func(g)\n                  return _not_implemented_for\n              return inner\n\n- module-name: 'nose.core' # checksum: 8247f58b\n  data-files:\n    patterns:\n      - 'usage.txt'\n\n- module-name: 'numba' # checksum: a8eab062\n  parameters:\n    - 'name': 'disable-jit'\n      'values': 'value in (\"yes\", \"no\")'\n  anti-bloat:\n    - description: 'remove numba testing reference'\n      change_function:\n        'test': 'un-callable'\n  options:\n    checks:\n      - description: \"Numba is not yet fully working with Nuitka standalone, try to use '--noinclude-numba-mode=nofollow', but it may fail.\"\n        support_info: 'warning'\n        when: 'not use_numba and standalone'\n      - description: \"Numba JIT is disabled by default in standalone mode, make a choice explicit with '--module-parameter=numba-disable-jit=yes|no'\"\n        support_info: 'parameter'\n        when: 'standalone and get_parameter(\"disable-jit\", None) is None'\n  import-hacks:\n    - force-environment-variables:\n        'NUMBA_DISABLE_JIT': '1'\n      when: 'get_parameter(\"disable-jit\", \"yes\" if standalone else \"no\") == \"yes\"'\n\n- module-name: 'numba.core.caching' # checksum: dce4aaa0\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.paths import get_ipython_cache_dir': 'raise ImportError'\n        'from IPython.utils.path import get_ipython_cache_dir': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'numba.cuda' # checksum: 3173fc81\n  anti-bloat:\n    - description: 'remove numba testing reference'\n      replacements_plain:\n        'from numba import runtests': ''\n      change_function:\n        'test': 'un-callable'\n\n- module-name: 'numba.misc.inspection' # checksum: d1c24af1\n  anti-bloat:\n    - description: 'remove numba.pycc reference'\n      change_function:\n        'disassemble_elf_to_cfg': 'un-callable'\n\n- module-name: 'numcodecs.blosc' # checksum: 52bdb974\n  implicit-imports:\n    - depends:\n        - 'numcodecs.compat_ext'\n\n- module-name: 'numexpr' # checksum: f51f1799\n  anti-bloat:\n    - description: 'remove numexpr.tests usage'\n      replacements_plain:\n        'import numexpr.tests': 'raise ImportError'\n\n- module-name: 'numpy' # checksum: c99de05\n  dlls:\n    - from_filenames:\n        relative_path: '.libs'\n        prefixes:\n          - 'lib'\n      when: 'win32'\n    - by_code:\n        setup_code: |\n          import os, sys\n          library_path = os.path.join(\"Library\", \"bin\") if os.name == \"nt\" else \"lib\"\n          library_path = os.path.join(sys.prefix, library_path)\n          library_prefix = \"mkl_\" if os.name == \"nt\" else \"libmkl_\"\n        filename_code: |\n          [os.path.join(library_path, filename)\n           for filename in os.listdir(library_path)\n           if filename.startswith(library_prefix)] if os.path.isdir(library_path) else []\n      dest_path: '.'\n      when: 'is_conda_package(\"numpy\")'\n\n  anti-bloat:\n    - replacements_plain:\n        'https://': ''\n  implicit-imports:\n    - depends:\n        - 'numpy._mklinit'\n        - 'numpy.compat'\n        - 'numpy.lib'\n        - 'numpy.linalg'\n        - 'numpy.fft'\n        - 'numpy.polynomial'\n        - 'numpy.random'\n        - 'numpy.ctypeslib'\n        - 'numpy.ma'\n        - 'numpy.matrixlib'\n\n- module-name: 'numpy._pytesttester' # checksum: 5e3b539b\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, name):\n            pass\n\n- module-name: 'numpy.core' # checksum: 5769f3c9\n  anti-bloat:\n    - description: 'remove misleading numpy message'\n      replacements_plain:\n        'except ImportError as exc:': |\n          except ImportError as exc:\n              raise\n\n  implicit-imports:\n    - depends:\n        - 'numpy.core._dtype_ctypes'\n        - 'numpy.core._multiarray_tests'\n\n- module-name: 'numpy.core.overrides' # checksum: 48ac7e42\n  anti-bloat:\n    - description: 'workaround numpy issues with compiled code'\n      replacements:\n        'add_docstring(implementation, dispatcher.__doc__)': \"'''add_docstring(implementation, dispatcher.__doc__ or '')'''\"\n        'public_api.__code__ = ': ''\n\n- module-name: 'numpy.ctypeslib' # checksum: 664cfa3e\n  anti-bloat:\n    - description: 'remove numpy.distutils references'\n      context:\n        - 'import numpy.distutils.misc_util'\n      replacements:\n        'from numpy.distutils.misc_util import get_shared_lib_extension': ''\n        'get_shared_lib_extension()': 'repr(numpy.distutils.misc_util.get_shared_lib_extension())'\n        'get_shared_lib_extension(is_python_ext=True)': 'repr(numpy.distutils.misc_util.get_shared_lib_extension(is_python_ext=True))'\n\n- module-name: 'numpy.lib.utils' # checksum: 26f115fc\n  anti-bloat:\n    - description: 'remove pydoc usage'\n      replacements_plain:\n        '.pydoc.allmethods(object)': '()'\n        'import pydoc': ''\n\n- module-name: 'numpy.random' # checksum: e43161e7\n  implicit-imports:\n    - depends:\n        # These are post-1.18 names. TODO: Once we detect versions of packages, be proper selective here.\n        - 'numpy.random._bit_generator'\n        - 'numpy.random._bounded_integers'\n        - 'numpy.random._common'\n        - 'numpy.random._generator'\n        - 'numpy.random._mt19937'\n        - 'numpy.random._pcg64'\n        - 'numpy.random._philox'\n        - 'numpy.random._sfc64'\n\n        # These are pre-1.18 names\n        - 'numpy.random.bit_generator'\n        - 'numpy.random.bounded_integers'\n        - 'numpy.random.common'\n        - 'numpy.random.generator'\n        - 'numpy.random.mt19937'\n        - 'numpy.random.pcg64'\n        - 'numpy.random.philox'\n        - 'numpy.random.sfc64'\n\n        # TODO: Clarify if entropy is needed for 1.18 or at all.\n        - 'numpy.random.entropy'\n        - 'numpy.random.mtrand'\n\n- module-name: 'numpy.random.bit_generator' # checksum: 7c0e00ef\n  implicit-imports:\n    - depends:\n        - 'secrets'\n\n- module-name: 'numpy.testing' # checksum: 4d5ed09e\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      module_code: |\n        from contextlib import contextmanager\n        class Tester:\n          test = None\n          bench = None\n\n        class suppress_warnings:\n          def __init__(self, forwarding_rule=\"always\"):\n            pass\n\n          def filter(self, category=Warning, message=\"\", module=None):\n            pass\n\n          def __enter__(self):\n            return self\n\n          def __exit__(self, *exc_info):\n            pass\n\n          def __call__(self, func):\n            def new_func(*args, **kwargs):\n              with self:\n                return func(*args, **kwargs)\n\n            return new_func\n\n        def assert_allclose(*args, **kwargs):\n          return True\n\n        @contextmanager\n        def _assert_warns_context(warning_class, name=None):\n            yield\n\n        def assert_warns(warning_class, *args, **kwargs):\n          if not args:\n              return _assert_warns_context(warning_class)\n\n          func = args[0]\n          args = args[1:]\n          with _assert_warns_context(warning_class, name=func.__name__):\n              return func(*args, **kwargs)\n\n        def assert_(val, msg=''):\n          if not val:\n              try:\n                  smsg = msg()\n              except TypeError:\n                  smsg = msg\n              raise AssertionError(smsg)\n\n        def assert_equal(*args, **kwargs):\n          pass\n\n        def assert_approx_equal(*args, **kwargs):\n          pass\n\n        def assert_almost_equal(*args, **kwargs):\n          pass\n\n        def assert_array_equal(*args, **kwargs):\n          pass\n\n        def assert_array_less(*args, **kwargs):\n          pass\n\n        def assert_array_almost_equal(*args, **kwargs):\n          pass\n\n- module-name: 'numpy.testing._private.pytesttester' # checksum: 5e3b539b\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, name):\n            pass\n\n- module-name: 'numpy.testing._private.utils' # checksum: 8f5f4b69\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'rundocs': 'un-callable'\n      when: 'not use_unittest'\n\n- module-name: 'objc' # checksum: 5c6f45a7\n  options:\n    checks:\n      - description: 'pyobjc is not supported before 9.0 or later'\n        support_info: 'error'\n        when: 'version(\"pyobjc\") < (9,)'\n\n- module-name: 'onnxruntime' # checksum: 37a94e21\n  dlls:\n    - from_filenames:\n        relative_path: 'capi'\n        prefixes:\n          - 'onnxruntime'\n      when: 'win32'\n    - from_filenames:\n        relative_path: 'capi'\n        prefixes:\n          - 'libonnxruntime'\n      dest_path: '.'\n      when: 'linux'\n\n- module-name: 'onnxruntime.capi.onnxruntime_pybind11_state' # checksum: 63fe3556\n  implicit-imports:\n    - depends:\n        - 'numpy'\n\n- module-name: 'open_clip' # checksum: 1fe63667\n  data-files:\n    dirs:\n      - 'model_configs'\n    patterns:\n      - '*.tar.gz'\n\n- module-name: 'openapi_spec_validator' # checksum: bcd85a05\n  data-files:\n    dirs:\n      - 'resources/schemas'\n\n- module-name: 'opencc' # checksum: 37b61183\n  data-files:\n    dirs:\n      - 'clib/share/opencc'\n    patterns:\n      - '*.json'\n      - '*.ocd2'\n\n  dlls:\n    - from_filenames:\n        relative_path: 'clib/bin'\n        prefixes:\n          - 'opencc'\n      when: 'win32'\n\n- module-name: 'opentele.exception' # checksum: b9552185\n  anti-bloat:\n    - description: 'workaround compiled functions not updating locals'\n      replacements_plain:\n        'parameters = {arg: locals[arg] for arg in args}': 'parameters = {}'\n\n- module-name: 'opentele.utils' # checksum: 32790776\n  anti-bloat:\n    - description: 'workaround compiled function decorator issues'\n      replacements_plain:\n        'bases = func.__class__.__bases__': 'bases = func.__class__.__bases__ if func.__class__.__bases__ != (FunctionType,) else (object,)'\n\n- module-name: 'opentelemetry.exporter.jaeger.thrift' # checksum: f0eea343\n  import-hacks:\n    - global-sys-path:\n        # This package forces itself into \"sys.path\" and expects absolute\n        # imports like \"jaeger\" to be available.\n        - 'gen'\n\n- module-name: 'opentelemetry.exporter.jaeger.thrift.gen' # checksum: f7810856\n  anti-bloat:\n    - description: 'remove \"sys.path\" hack'\n      replacements_plain:\n        'sys.path.append': ''\n\n- module-name: 'opentelemetry.propagate' # checksum: 7c38a584\n  data-files:\n    include-metadata:\n      - 'opentelemetry-api'\n\n  implicit-imports:\n    - depends:\n        - 'opentelemetry.trace.propagation.tracecontext'\n        - 'opentelemetry.baggage.propagation'\n\n- module-name: 'opentelemetry.sdk.resources' # checksum: f173f283\n  data-files:\n    include-metadata:\n      - 'opentelemetry-sdk'\n  anti-bloat:\n    - description: 'workaround for metadata functions'\n      replacements_plain:\n        'opentelemetry.util._importlib_metadata': 'importlib_metadata'\n\n- module-name: 'openvino' # checksum: a58ccd92\n  data-files:\n    dirs:\n      - 'libs'\n\n- module-name: 'openvino.inference_engine' # checksum: 9100f948\n  dlls:\n    - from_filenames:\n        relative_path: '../libs'\n        prefixes:\n          - ''\n\n  implicit-imports:\n    - depends:\n        - 'openvino.inference_engine.ie_api'\n\n- module-name: 'openvino.inference_engine.constants' # checksum: 63fe3556\n  implicit-imports:\n    - depends:\n        - 'numpy'\n\n- module-name: 'openvino.inference_engine.ie_api' # checksum: e6f9aa73\n  implicit-imports:\n    - depends:\n        - 'openvino.inference_engine.constants'\n\n- module-name: 'orderedmultidict' # checksum: 43e79eae\n  anti-bloat:\n    - description: 'remove manual version file import'\n      context:\n        - 'import orderedmultidict.__version__'\n      replacements_plain:\n        \"with open(pjoin(dirname(__file__), '__version__.py')) as f\": 'if True'\n      replacements:\n        'exec(f.read(), meta)': \"'__version__ = %r' % orderedmultidict.__version__.__version__\"\n\n- module-name: 'orjson' # checksum: 539d17a9\n  implicit-imports:\n    - depends:\n        - 'zoneinfo'\n        - 'json'\n        - 'uuid'\n\n- module-name: 'osgeo' # checksum: 94304fdd\n  data-files:\n    dirs:\n      - 'data'\n  implicit-imports:\n    - depends:\n        - 'osgeo._gdal'\n        - 'osgeo._gdalconst'\n        - 'osgeo._gdal_array'\n        - 'osgeo._gnm'\n        - 'osgeo._ogr'\n        - 'osgeo._osr'\n\n- module-name: 'overrides.enforce' # checksum: 8ae9a206\n  anti-bloat:\n    - description: 'disable overrides function checking'\n      module_code: |\n        from abc import ABCMeta\n        class EnforceOverridesMeta(ABCMeta):\n          pass\n        class EnforceOverrides(metaclass=EnforceOverridesMeta):\n          pass\n\n- module-name: 'overrides.overrides' # checksum: 4937ee18\n  anti-bloat:\n    - description: 'disable overrides function checking'\n      change_function:\n        '_overrides': \"'(lambda method, *args, **kwargs: method)'\"\n\n- module-name: 'paddle' # checksum: 11103e47\n  dlls:\n    - from_filenames:\n        relative_path: 'libs'\n        prefixes:\n          - 'lib'\n          - 'mkl'\n          - 'war'\n          - 'common'\n\n- module-name: 'paddle.base.core' # checksum: a81e13c9\n  anti-bloat:\n    - replacements_plain:\n        \"third_lib_path = current_path + os.sep + '..' + os.sep + 'libs'\": \"third_lib_path = os.path.normpath(current_path + os.sep + '..' + os.sep + 'libs')\"\n      change_function:\n        'set_paddle_lib_path': \"'(lambda: None)'\"\n\n- module-name: 'paddle.distributed.fleet.launch_utils' # checksum: 69fc840a\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'import paddle.utils.cpp_extension.extension_utils as utils': ''\n      replacements:\n        \"utils.OS_NAME.startswith('darwin')\": 'repr(macos)'\n        'utils.IS_WINDOWS': 'repr(win32)'\n      when: 'not use_setuptools'\n\n- module-name: 'paddle.fluid.core' # checksum: a81e13c9\n  anti-bloat:\n    - replacements_plain:\n        \"third_lib_path = current_path + os.sep + '..' + os.sep + 'libs'\": \"third_lib_path = os.path.normpath(current_path + os.sep + '..' + os.sep + 'libs')\"\n      change_function:\n        'set_paddle_lib_path': \"'(lambda: None)'\"\n\n- module-name: 'paddle.jit.sot.opcode_translator.skip_files' # checksum: 5721def1\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'import setuptools': ''\n        'setuptools,': ''\n      when: 'not use_setuptools'\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'import unittest': ''\n        'unittest,': ''\n      when: 'not use_unittest'\n\n- module-name: 'paddle.utils' # checksum: 9f797eec\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      # TODO: We need a special form of removing import assignments\n      replacements_plain:\n        'cpp_extension,': ''\n      when: 'not use_setuptools'\n\n- module-name: 'paddleocr' # checksum: 90264499\n  import-hacks:\n    - global-sys-path:\n          # This package forces itself into \"sys.path\" and expects absolute\n          # imports from all of these to be available.\n        - ''\n        - 'ppstructure'\n        - 'tools/infer'\n        - 'ppocr/postprocess'\n        - 'ppocr'\n        - 'ppocr/utils/e2e_utils'\n        - 'ppocr/utils'\n        - 'ppstructure/layout'\n        - 'ppstructure/table'\n\n- module-name: 'paddleocr.paddleocr' # checksum: 8cf243fc\n  anti-bloat:\n    - replacements_plain:\n        'tools = _import_file(': ''\n        \"    'tools', os.path.join(__dir__, 'tools/__init__.py'), make_importable=True)\": 'from . import tools'\n\n- module-name: 'panda3d' # checksum: ed772c0a\n  data-files:\n    dest_path: '.'\n    dirs:\n      - 'etc'\n\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libpandagl'\n          - 'libpandadx9'\n          - 'libp3tinydisplay'\n          - 'libp3assimp'\n          - 'libp3ffmpeg'\n          - 'libp3fmod_audio'\n          - 'libp3openal_audio'\n          - 'libp3ptloader'\n          - 'libpandaegg'\n      dest_path: '.'\n\n- module-name: 'pandas' # checksum: 5c2e9d81\n  anti-bloat:\n    - description: 'remove pandas testing framework'\n      replacements_plain:\n        'from pandas.util._tester import test': ''\n        'import pandas.testing': ''\n        'from pandas import testing': 'testing = None'\n        'from pandas import api, arrays, errors, io, plotting, testing': 'from pandas import api, arrays, errors, io, plotting'\n\n- module-name: 'pandas._libs' # checksum: 582d52b9\n  implicit-imports:\n    - depends:\n        - 'pandas._libs.tslibs.np_datetime'\n        - 'pandas._libs.tslibs.nattype'\n        - 'pandas._libs.tslibs.base'\n\n- module-name: 'pandas._libs.testing' # checksum: 9059205\n  implicit-imports:\n    - depends:\n        - 'cmath'\n\n- module-name: 'pandas._libs.tslibs.fields' # checksum: d61757d5\n  implicit-imports:\n    - depends:\n        - 'pandas._config.localization'\n\n- module-name: 'pandas._testing' # checksum: 6fb47e3c\n  anti-bloat:\n    - description: 'remove pytest testing framework'\n      change_function:\n        'ensure_clean': \"'(lambda: None)'\"\n        # TODO: See pandas._testing._io TODO as well.\n        'external_error_raised': \"'(lambda: None)'\"\n        'network': \"'(lambda: None)'\"\n        'round_trip_localpath': \"'(lambda: None)'\"\n        'round_trip_pathlib': \"'(lambda: None)'\"\n\n- module-name: 'pandas._testing._io' # checksum: c724cbab\n  anti-bloat:\n    - description: 'remove pytest testing framework'\n      change_function:\n        'network': \"'(lambda: None)'\"\n        # TODO: Actually it would be nice to specify \"un-callable\" rather than\n        # wrong signature for cases, where the function is not usable\n        # afterwards. That will make sure we have a nice error exit in case,\n        # some test code is run an attempts to use it.\n        'round_trip_localpath': \"'(lambda: None)'\"\n        'round_trip_pathlib': \"'(lambda: None)'\"\n\n- module-name: 'pandas.compat._optional' # checksum: a8712d2\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements_plain:\n        'distutils.version.LooseVersion(version) < minimum_version': 'False'\n        'import distutils.version': ''\n\n- module-name: 'pandas.compat.numpy' # checksum: a21ef6ec\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        # TODO: Smells not only like regexp, must be one.\n        'LooseVersion(\"1.14\")': \"'\\\"1.14\\\"'\"\n        'LooseVersion(\"1.15\")': \"'\\\"1.15\\\"'\"\n        'LooseVersion(\"1.16\")': \"'\\\"1.16\\\"'\"\n        'LooseVersion(\"1.17\")': \"'\\\"1.17\\\"'\"\n        'LooseVersion(\"1.18\")': \"'\\\"1.18\\\"'\"\n        'LooseVersion(\"1.19\")': \"'\\\"1.19\\\"'\"\n        'LooseVersion(\"1.20\")': \"'\\\"1.20\\\"'\"\n        'LooseVersion(_np_version)': \"'_np_version'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.compat.numpy.function' # checksum: 5fbf97fa\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(__version__) >= LooseVersion(\"1.17.0\")': \"'__version__ >= \\\"1.17.0\\\"'\"\n        'LooseVersion(_np_version) >= LooseVersion(\"1.17.0\")': \"'_np_version >= \\\"1.17.0\\\"'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.core.arrays._arrow_utils' # checksum: 398ecf0\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(pyarrow.__version__) >= LooseVersion(\"0.15\")': \"'pyarrow.__version__ >= \\\"0.15\\\"'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.core.arrays.string_arrow' # checksum: 6ff6617\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(pa.__version__) < \"1.0.0\"': \"'pa.__version__ < \\\"1.0.0\\\"'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.core.computation.ops' # checksum: ce7ab56e\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'NUMEXPR_VERSION < LooseVersion(\"2.6.9\")': \"'False'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.core.groupby.groupby' # checksum: fa0161e8\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'maybe_use_numba(engine)': 'False'\n      when: 'not use_numba'\n\n- module-name: 'pandas.core.util.numba_' # checksum: a126e56b\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(numba.__version__) >= LooseVersion(\"0.49.0\")': \"'True'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.core.window' # checksum: e748c8ea\n  implicit-imports:\n    - depends:\n        - 'pandas._libs.window'\n        - 'pandas._libs.skiplist'\n\n- module-name: 'pandas.core.window.rolling' # checksum: fa0161e8\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'maybe_use_numba(engine)': 'False'\n      when: 'not use_numba'\n\n- module-name: 'pandas.io.clipboard' # checksum: 5d37f784\n  anti-bloat:\n    - description: 'avoid Qt dependency'\n      no-auto-follow:\n        'qtpy': 'pandas will not be able to use Qt for clipboard interaction'\n        'PyQt5': 'pandas will not be able to use Qt for clipboard interaction'\n        'PyQt4': 'pandas will not be able to use Qt for clipboard interaction'\n      when: 'not plugin(\"pyqt5\") and not plugin(\"pyqt6\") and not plugin(\"pyside2\") and not plugin(\"pyside6\")'\n    - description: 'avoid Qt dependency'\n      no-auto-follow:\n        'qtpy': 'ignore'\n        'PyQt5': 'ignore'\n        'PyQt4': 'ignore'\n      when: 'plugin(\"no-qt\")'\n\n- module-name: 'pandas.io.excel._base' # checksum: 53d399ba\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(xlrd.__version__)': \"'xlrd.__version__'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.io.formats' # checksum: bfd19d5d\n  data-files:\n    dirs:\n      - 'templates'\n\n- module-name: 'pandas.io.formats.printing' # checksum: 9548db34\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'enable_data_resource_formatter': \"'(lambda enable: None)'\"\n      when: 'not use_ipython'\n\n- module-name: 'pandas.io.formats.style' # checksum: 27209d7d\n  implicit-imports:\n    - depends:\n        - 'jinja2'\n\n- module-name: 'pandas.io.orc' # checksum: a9b1ffdc\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'distutils.version.LooseVersion(pyarrow.__version__) < \"0.13.0\"': \"'pyarrow.__version__ < \\\"0.13.0\\\"'\"\n        'import distutils': \"''\"\n\n- module-name: 'pandas.io.parquet' # checksum: 4f4a3110\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'LooseVersion(self.api.__version__) >= \"0.16\"': \"'self.api.__version__ >= \\\"0.16\\\"'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'pandas.plotting._matplotlib.compat' # checksum: 837616d5\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'from distutils.version import LooseVersion': \"''\"\n        'op(LooseVersion(mpl.__version__), LooseVersion(version))': \"'op(mpl.__version__, version)'\"\n\n- module-name: 'pandas.util' # checksum: 94cd3530\n  anti-bloat:\n    - description: 'remove pandas testing framework'\n      replacements_plain:\n        'if name == \"testing\":': 'if False:'\n\n- module-name: 'pango' # checksum: 7d2edca1\n  implicit-imports:\n    - depends:\n        - 'gobject'\n\n- module-name: 'pangocairo' # checksum: ac364fb1\n  implicit-imports:\n    - depends:\n        - 'pango'\n        - 'cairo'\n\n- module-name: 'passlib.apache' # checksum: 4e9f8101\n  implicit-imports:\n    - depends:\n        - 'passlib.handlers.digests'\n        - 'passlib.handlers.bcrypt'\n        - 'passlib.handlers.md5_crypt'\n        - 'passlib.handlers.des_crypt'\n        - 'passlib.handlers.ldap_digests'\n\n- module-name: 'passlib.hash' # checksum: 7794431b\n  implicit-imports:\n    - depends:\n        - 'passlib.handlers.sha2_crypt'\n\n- module-name: 'patsy.build' # checksum: 20b0ea72\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test__max_allowed_dim': 'un-callable'\n        'test__eval_factor_numerical': 'un-callable'\n        'test__eval_factor_categorical': 'un-callable'\n        'test__subterm_column_names_iter_and__build_subterm': 'un-callable'\n        'test__examine_factor_types': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.builtins' # checksum: f1b048a7\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_Q': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.categorical' # checksum: 864cd3ca\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_CategoricalSniffer': 'un-callable'\n        'test_categorical_to_int': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.constraint' # checksum: 27c4f57c\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_LinearConstraint': 'un-callable'\n        'test_LinearConstraint_combine': 'un-callable'\n        'test__tokenize_constraint': 'un-callable'\n        'test_linear_constraint': 'un-callable'\n        '_check_lincon': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.contrasts' # checksum: c9f75dca\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_ContrastMatrix': 'un-callable'\n        'test__get_level': 'un-callable'\n        'test_Poly': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.design_info' # checksum: 1124a13a\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_FactorInfo': 'un-callable'\n        'test_DesignInfo': 'un-callable'\n        'test_DesignInfo_from_array': 'un-callable'\n        'test_design_matrix': 'un-callable'\n        'test_SubtermInfo': 'un-callable'\n\n- module-name: 'patsy.eval' # checksum: 48d81ab1\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_VarLookupDict': 'un-callable'\n        'test_ast_names_disallowed_nodes': 'un-callable'\n        'test_EvalEnvironment_capture_namespace': 'un-callable'\n        'test_EvalEnvironment_eval_namespace': 'un-callable'\n        'test_EvalEnvironment_eval_flags': 'un-callable'\n        'test_EvalEnvironment_subset': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.infix_parser' # checksum: 548bc9c8\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_infix_parse': 'un-callable'\n\n- module-name: 'patsy.mgcv_cubic_splines' # checksum: 53510f22\n  anti-bloat:\n    - description: 'remove unittest reference'\n      change_function:\n        'test__map_cyclic_errors': 'un-callable'\n        'test__get_all_sorted_knots': 'un-callable'\n        'test_crs_errors': 'un-callable'\n        'test_te_errors': 'un-callable'\n        'test__row_tensor_product_errors': 'un-callable'\n\n- module-name: 'patsy.missing' # checksum: 600a0c86\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_NAAction_basic': 'un-callable'\n\n- module-name: 'patsy.splines' # checksum: cf7e3269\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_bs_errors': 'un-callable'\n\n- module-name: 'patsy.tokens' # checksum: b500d8e5\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_python_tokenize': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.user_util' # checksum: c68f8f74\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_demo_data': 'un-callable'\n        'test_LookupFactor': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'patsy.util' # checksum: 8cff2f16\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test_pandas_friendly_reshape': 'un-callable'\n        'test_wide_dtype_for_and_widen': 'un-callable'\n        'assert_no_pickling': 'un-callable'\n      when: 'not use_pytest'\n    - description: 'remove IPython reference'\n      replacements_plain:\n        '\"IPython\" in sys.modules': 'False'\n      when: 'not use_ipython'\n\n- module-name: 'pendulum' # checksum: 465878b9\n  data-files:\n    empty_dir_structures:\n      - 'locales'\n    when: 'version(\"pendulum\") >= (2,)'\n\n- module-name: 'pendulum.locales' # checksum: 9bd33105\n  implicit-imports:\n    - depends:\n        - '.*.locale'\n\n- module-name: 'persistent._compat' # checksum: c8c2659a\n  anti-bloat:\n    - description: 'use own compilation for compatibility'\n      replacements:\n        \"os.environ.get('PURE_PYTHON')\": \"'\\\"1\\\"'\"\n\n- module-name: 'persistent.ring' # checksum: ff2e6560\n  implicit-imports:\n    - depends:\n        - '_cffi_backend'\n\n- module-name: 'phonenumbers.data' # checksum: ed193c22\n  implicit-imports:\n    - depends:\n        - '.region_*'\n\n- module-name: 'PIL._imagingtk' # checksum: 52df48a8\n  implicit-imports:\n    - depends:\n        - 'PIL._tkinter_finder'\n\n- module-name: 'PIL.Image' # checksum: bf79a54d\n  anti-bloat:\n    - description: 'avoid Qt dependency'\n      no-auto-follow:\n        'PIL.ImageQt': 'PIL will not be able to create Qt image objects'\n      when: 'not plugin(\"pyqt5\") and not plugin(\"pyqt6\") and not plugin(\"pyside2\") and not plugin(\"pyside6\") and not plugin(\"no-qt\")'\n    - description: 'avoid Qt dependency'\n      no-auto-follow:\n        'PIL.ImageQt': 'ignore'\n      when: 'plugin(\"no-qt\")'\n\n  implicit-imports:\n    - depends:\n        - 'PIL.BlpImagePlugin'\n        - 'PIL.BmpImagePlugin'\n        - 'PIL.BufrStubImagePlugin'\n        - 'PIL.CurImagePlugin'\n        - 'PIL.DcxImagePlugin'\n        - 'PIL.DdsImagePlugin'\n        - 'PIL.EpsImagePlugin'\n        - 'PIL.FitsStubImagePlugin'\n        - 'PIL.FliImagePlugin'\n        - 'PIL.FpxImagePlugin'\n        - 'PIL.FtexImagePlugin'\n        - 'PIL.GbrImagePlugin'\n        - 'PIL.GifImagePlugin'\n        - 'PIL.GribStubImagePlugin'\n        - 'PIL.Hdf5StubImagePlugin'\n        - 'PIL.IcnsImagePlugin'\n        - 'PIL.IcoImagePlugin'\n        - 'PIL.ImImagePlugin'\n        - 'PIL.ImtImagePlugin'\n        - 'PIL.IptcImagePlugin'\n        - 'PIL.Jpeg2KImagePlugin'\n        - 'PIL.JpegImagePlugin'\n        - 'PIL.McIdasImagePlugin'\n        - 'PIL.MicImagePlugin'\n        - 'PIL.MpegImagePlugin'\n        - 'PIL.MpoImagePlugin'\n        - 'PIL.MspImagePlugin'\n        - 'PIL.PalmImagePlugin'\n        - 'PIL.PcdImagePlugin'\n        - 'PIL.PcxImagePlugin'\n        - 'PIL.PdfImagePlugin'\n        - 'PIL.PixarImagePlugin'\n        - 'PIL.PngImagePlugin'\n        - 'PIL.PpmImagePlugin'\n        - 'PIL.PsdImagePlugin'\n        - 'PIL.SgiImagePlugin'\n        - 'PIL.SpiderImagePlugin'\n        - 'PIL.SunImagePlugin'\n        - 'PIL.TgaImagePlugin'\n        - 'PIL.TiffImagePlugin'\n        - 'PIL.WebPImagePlugin'\n        - 'PIL.WmfImagePlugin'\n        - 'PIL.XbmImagePlugin'\n        - 'PIL.XpmImagePlugin'\n        - 'PIL.XVThumbImagePlugin'\n\n- module-name: 'PIL.ImageShow' # checksum: e11ea042\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements:\n        'from IPython.display import display as ipython_display': \"'raise ImportError'\"\n      when: 'not use_ipython'\n\n- module-name: 'PIL.SpiderImagePlugin' # checksum: cb3e1ec1\n  anti-bloat:\n    - description: 'remove tkinter reference'\n      change_function:\n        'tkPhotoImage': 'un-callable'\n      when: 'not use_tkinter'\n\n- module-name: 'pint.compat' # checksum: 3e1a4258\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'from dask import array as dask_array': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'pint.registry' # checksum: b065fa3\n  data-files:\n    patterns:\n      - '*.txt'\n\n- module-name: 'pint.util' # checksum: a21874f7\n  anti-bloat:\n    - description: 'workaround __new__ decorator issue'\n      append_plain: 'SharedRegistryObject.__new__ = staticmethod(SharedRegistryObject.__new__)'\n\n- module-name: 'pip._vendor.rich.jupyter' # checksum: b346e77\n  # See rich.jupyter\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'display': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'pkg_resources' # checksum: 9cc15580\n  anti-bloat:\n    - description: 'avoid using plistlib dependency on non-macOS'\n      replacements_plain:\n        'import plistlib': ''\n      when: 'not macos'\n    - description: 'avoid requiring entry points at runtime'\n      replacements_plain:\n        'def load(self, require=True,': 'def load(self, require=False,'\n        'if not require or args or kwargs:': 'if False:'\n\n- module-name: 'pkg_resources._vendor.appdirs' # checksum: 9d4faeee\n  anti-bloat:\n    # Keep this the same as for 'appdirs' module\n    - description: 'remove pywin32 reference'\n      replacements_plain:\n        'import win32com.shell': 'raise ImportError'\n      change_function:\n        '_get_win_folder_with_pywin32': 'un-callable'\n      when: 'not use_pywin32 or not win32'\n\n- module-name: 'pkg_resources._vendor.jaraco' # checksum: e791ac67\n  implicit-imports:\n    - depends:\n        - 'pkg_resources._vendor.jaraco.text'\n        - 'pkg_resources._vendor.jaraco.functools'\n        - 'pkg_resources._vendor.jaraco.context'\n\n- module-name: 'pkg_resources._vendor.jaraco.text' # checksum: 306c0234\n  anti-bloat:\n    - description: 'remove useless data file dependency'\n      replacements_plain:\n        \"lorem_ipsum: str = files(__name__).joinpath('Lorem ipsum.txt').read_text()\": ''\n\n- module-name: 'pkg_resources._vendor.packaging' # checksum: 595be034\n  implicit-imports:\n    - depends:\n        - 'pkg_resources._vendor.packaging.version'\n        - 'pkg_resources._vendor.packaging.specifiers'\n        - 'pkg_resources._vendor.packaging.requirements'\n\n- module-name: 'pkg_resources._vendor.pyparsing' # checksum: 8caa976e\n  anti-bloat:\n    - description: 'remove pdb usage'\n      change_function:\n        'setBreak': \"'(lambda self: None)'\"\n\n- module-name: 'platform_utils.paths' # checksum: e9e64aec\n  anti-bloat:\n    - description: 'workaround embedded data files bug'\n      change_function:\n        'embedded_data_path': \"'(lambda: app_path())'\"\n\n- module-name: 'plotly.graph_objects' # checksum: bf6dd64b\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import ipywidgets as _ipywidgets': 'raise ImportError'\n        'import ipywidgets': 'raise ImportError'\n        # Disable lazy loading implicit imports.\n        'sys.version_info < (3, 7) or TYPE_CHECKING': 'True'\n      when: 'not use_ipython'\n\n- module-name: 'plotly.graph_objs' # checksum: bf6dd64b\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import ipywidgets as _ipywidgets': 'raise ImportError'\n        'import ipywidgets': 'raise ImportError'\n        # Disable lazy loading implicit imports.\n        'sys.version_info < (3, 7) or TYPE_CHECKING': 'True'\n      when: 'not use_ipython'\n\n- module-name: 'plotly.io' # checksum: bc9ae932\n  anti-bloat:\n    - description: 'include plotly templates'\n      replacements_plain:\n        # Disable lazy loading implicit imports.\n        'sys.version_info < (3, 7) or TYPE_CHECKING': 'True'\n\n- module-name: 'plotly.validator_cache' # checksum: 4e4fa5ab\n  implicit-imports:\n    - depends:\n        # Disable lazy loading implicit imports.\n        - 'plotly.validators.*'\n        - 'plotly.validators.*.*'\n        # Maybe misplaced those here. TODO: Also make recursive dependency a thing.\n        - 'plotly.graph_objs.layout.*'\n        - 'plotly.graph_objs.layout.*.*'\n\n- module-name: 'plumbum.cli.progress' # checksum: 8a7f9d4c\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        '__IPYTHON__': 'raise NameError'\n      no-auto-follow:\n        'IPython': 'ignore'\n        'ipywidgets': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'plumbum.colorlib' # checksum: 29865712\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'plumbum.colorlib._ipython_ext': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'plyer' # checksum: c06d8897\n  implicit-imports:\n    - depends:\n        - 'plyer.platforms.win.*'\n      when: 'win32'\n    - depends:\n        - 'plyer.platforms.linux.*'\n      when: 'linux'\n    - depends:\n        - 'plyer.platforms.macosx.*'\n      when: 'macos'\n    - depends:\n        - 'plyer.platforms.android.*'\n      when: 'android'\n\n- module-name: 'polars.lazyframe.frame' # checksum: e9afa6bc\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.display import SVG, display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'polars.series.utils' # checksum: 65b85a57\n  anti-bloat:\n    - description: 'workaround for compiled method support'\n      append_plain: |\n        _orig_is_empty_method = _is_empty_method\n        def _is_empty_method(func):\n          if hasattr(func, \"__compiled_constant__\"):\n              return getattr(func, \"__compiled_constant__\") is None\n\n          return _orig_is_empty_method(func)\n\n- module-name: 'polars.utils.various' # checksum: 681007fe\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython import get_ipython': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'polyfactory.fields' # checksum: 16abf322\n  anti-bloat:\n    - description: 'remove pytest reference'\n      no-auto-follow:\n        'polyfactory.pytest_plugin': 'ignore'\n      when: 'not use_pytest'\n\n- module-name: 'pony' # checksum: 3776d9aa\n  implicit-imports:\n    - depends:\n        - 'pony.orm.dbproviders.*'\n\n- module-name: 'pooch' # checksum: e07f91ff\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'test': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'ppocr.utils.e2e_utils.pgnet_pp_utils' # checksum: 935978cf\n  anti-bloat:\n    - replacements_plain:\n        'from extract_textpoint_slow import *': 'from .extract_textpoint_slow import *'\n        'from extract_textpoint_fast import generate_pivot_list_fast, restore_poly': 'from .extract_textpoint_fast import generate_pivot_list_fast, restore_poly'\n  import-hacks:\n    - global-sys-path:\n          # This package forces itself into \"sys.path\" and expects absolute\n          # imports to be available.\n        - ''\n\n- module-name: 'psutil' # checksum: 24d7eb52\n  anti-bloat:\n    - description: 'resolve platform specific imports at compile time'\n      context:\n        - 'import psutil'\n      replacements:\n        'from ._common import AIX': \"'AIX = %r' % psutil.AIX\"\n        'from ._common import BSD': \"'BSD = %r' % psutil.BSD\"\n        'from ._common import FREEBSD': \"'FREEBSD = %r' % + psutil.FREEBSD\"\n        'from ._common import LINUX': \"'LINUX = %r' % + psutil.LINUX\"\n        'from ._common import MACOS': \"'MACOS = %r' % + psutil.MACOS\"\n        'from ._common import NETBSD': \"'NETBSD = %r' % + psutil.NETBSD\"\n        'from ._common import OPENBSD': \"'OPENBSD = %r' % + psutil.OPENBSD\"\n        'from ._common import OSX': \"'OSX = %r' % psutil.OSX\"\n        'from ._common import POSIX': \"'POSIX = %r' % psutil.POSIX\"\n        'from ._common import SUNOS': \"'SUNOS = %r' % psutil.SUNOS\"\n        'from ._common import WINDOWS': \"'WINDOWS = %r' % psutil.WINDOWS\"\n\n- module-name: 'pyarrow' # checksum: 9da51f71\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      no-auto-follow:\n        'setuptools_scm': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'pyarrow.dataset' # checksum: 37675d7a\n  implicit-imports:\n    - depends:\n        - 'pyarrow._acero'\n        - 'pyarrow._json'\n\n- module-name: 'pyarrow.lib' # checksum: 302be0c2\n  implicit-imports:\n    - depends:\n        - 'pyarrow.vendored.version'\n\n- module-name: 'pyarrow.vendored.docscrape' # checksum: f18b6919\n  anti-bloat:\n    - description: 'remove sphinx reference'\n      replacements_plain:\n        \"if 'sphinx' in sys.modules:\": 'if False:'\n    - description: 'workaround for MSVC bug with scipy docscrape 1.8.x'\n      replacements_plain:\n        \"return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))\": \"r = l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1)); return r\"\n\n- module-name: 'pyaxmlparser.resources' # checksum: 1d442429\n  data-files:\n    patterns:\n      - 'public.xml'\n\n- module-name: 'pycountry' # checksum: 17e87111\n  data-files:\n    dirs:\n      - 'databases'\n\n- module-name: 'pycparser.c_parser' # checksum: 908ed561\n  implicit-imports:\n    - depends:\n        - 'pycparser.yacctab'\n        - 'pycparser.lextab'\n\n- module-name: 'pycrfsuite' # checksum: 452bfc81\n  dlls:\n    - from_filenames:\n        prefixes:\n          - '_pycrfsuite'\n\n  implicit-imports:\n    - depends:\n        - 'pycrfsuite._dumpparser'\n        - 'pycrfsuite._logparser'\n\n- module-name: 'pydantic' # checksum: fb2935eb\n  implicit-imports:\n    - depends:\n        - 'pydantic.typing'\n        - 'pydantic.fields'\n        - 'pydantic.utils'\n        - 'pydantic.schema'\n        - 'pydantic.env_settings'\n        - 'pydantic.main'\n        - 'pydantic.error_wrappers'\n        - 'pydantic.validators'\n        - 'pydantic.mypy'\n        - 'pydantic.version'\n        - 'pydantic.types'\n        - 'pydantic.color'\n        - 'pydantic.parse'\n        - 'pydantic.json'\n        - 'pydantic.datetime_parse'\n        - 'pydantic.dataclasses'\n        - 'pydantic.class_validators'\n        - 'pydantic.networks'\n        - 'pydantic.errors'\n\n- module-name: 'pydantic.errors' # checksum: edc1c868\n  implicit-imports:\n    - depends:\n        - 'decimal'\n\n- module-name: 'pydantic.json' # checksum: e9d3ea5\n  implicit-imports:\n    - depends:\n        - 'uuid'\n\n- module-name: 'pydantic.typing' # checksum: 20909c2d\n  implicit-imports:\n    - depends:\n        - 'typing_extensions'\n\n- module-name: 'pydantic.v1.version' # checksum: e038cd11\n  anti-bloat:\n    - description: 'remove setuptools usage via cython'\n      append_plain: |\n        compiled = True\n      no-auto-follow:\n        'cython': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'pyfiglet' # checksum: b8621a7d\n  implicit-imports:\n    - depends:\n        - '.fonts'\n\n- module-name: 'pyfiglet.fonts' # checksum: 3ebe1284\n  data-files:\n    dirs:\n      - '.'\n\n- module-name: 'pygame' # checksum: 74ba6d7b\n  data-files:\n    patterns:\n      - 'freesansbold.ttf'\n\n  options:\n    checks:\n      - description: 'PyGame is a GUI framework'\n        console: 'recommend'\n\n- module-name: 'pygame_menu' # checksum: 3f9f0b7d\n  data-files:\n    dirs:\n      - 'resources'\n\n- module-name: 'pygeos._geometry' # checksum: 6a3a4737\n  implicit-imports:\n    - depends:\n        - 'pygeos._geos'\n\n- module-name: 'pyglet' # checksum: 942fae5e\n  implicit-imports:\n    - depends:\n        - 'pyglet.app'\n        - 'pyglet.canvas'\n        - 'pyglet.clock'\n        - 'pyglet.com'\n        - 'pyglet.event'\n        - 'pyglet.font'\n        - 'pyglet.gl'\n        - 'pyglet.graphics'\n        - 'pyglet.input'\n        - 'pyglet.image'\n        - 'pyglet.lib'\n        - 'pyglet.media'\n        - 'pyglet.model'\n        - 'pyglet.resource'\n        - 'pyglet.sprite'\n        - 'pyglet.shapes'\n        - 'pyglet.text'\n        - 'pyglet.window'\n\n- module-name: 'pygments.styles' # checksum: 1851bf53\n  implicit-imports:\n    - depends:\n        - '.*'\n\n- module-name: 'pygsheets' # checksum: 810a705a\n  data-files:\n    dirs:\n      - 'data'\n\n- module-name: 'pymoo.cython' # checksum: 158685c1\n  implicit-imports:\n    - depends:\n        - 'pymoo.cython.*'\n\n- module-name: 'pymoo.gradient.toolbox' # checksum: ef4099af\n  implicit-imports:\n    - depends:\n        - 'autograd.numpy'\n\n- module-name: 'pymssql' # checksum: 1767fe26\n  implicit-imports:\n    - depends:\n        - 'pymssql._mssql'\n\n- module-name: 'pyocd' # checksum: 5c06f0b9\n  data-files:\n    patterns:\n      - 'debug/sequences/*.lark'\n      - 'debug/svd/*.zip'\n\n- module-name: 'pyodbc' # checksum: 893567d5\n  implicit-imports:\n    - depends:\n        - 'hashlib'\n        - 'decimal'\n\n- module-name: 'pyparsing' # checksum: 8caa976e\n  anti-bloat:\n    - description: 'remove pdb usage'\n      change_function:\n        'setBreak': \"'(lambda self: None)'\"\n\n- module-name: 'pyparsing.core' # checksum: d71d2c07\n  anti-bloat:\n    - description: 'remove pdb reference'\n      change_function:\n        'set_break': 'un-callable'\n\n- module-name: 'pypdfium2' # checksum: 91e9a452\n  data-files:\n    patterns:\n      - 'version.json'\n\n- module-name: 'pypdfium2_raw' # checksum: 3c8f2a8f\n  data-files:\n    patterns:\n      - 'version.json'\n\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'pdfium'\n\n- module-name: 'pyphen' # checksum: 708b31da\n  data-files:\n    dirs:\n      - 'dictionaries'\n  anti-bloat:\n    - description: 'remove doctest usage'\n\n- module-name: 'pyproj' # checksum: d7d7c58b\n  data-files:\n    dirs:\n      - 'proj_dir'\n\n- module-name: 'PyQt5' # checksum: c7182cc5\n  data-files:\n    empty_dirs:\n      - 'Qt5'\n      - 'Qt'\n\n  options:\n    checks:\n      - description: 'PyQt5 is a GUI framework'\n        console: 'recommend'\n        when: 'use_pyqt5'\n      - description: 'PyQt5 cannot be used without bundle'\n        macos_bundle: 'yes'\n        when: 'macos and not is_conda_package(\"pyqt5\") and use_pyqt5'\n      - description: 'PyQt5 cannot be signed unless onefile'\n        macos_bundle_as_onefile: 'yes'\n        when: 'macos and use_pyqt5'\n\n  import-hacks:\n    - acceptable-missing-dlls:\n        - 'libqpdf'\n\n- module-name: 'PyQt6' # checksum: 884033ec\n  options:\n    checks:\n      - description: 'PyQt6 is a GUI framework'\n        console: 'recommend'\n        when: 'use_pyqt6'\n      - description: 'PyQt6 on macOS is not supported, use PySide6 instead'\n        support_info: 'error'\n        when: 'macos and use_pyqt6'\n\n- module-name: 'pyqtgraph' # checksum: 1d763dc\n  data-files:\n    dirs:\n      - 'colors'\n      - 'icons'\n\n- module-name: 'pyqtgraph.util.numba_helper' # checksum: 731dde6\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'getConfigOption(\"useNumba\")': 'False'\n      when: 'not use_numba'\n\n- module-name: 'pyqtlet2' # checksum: 35d48aef\n  data-files:\n    dirs:\n      - 'web'\n\n- module-name: 'pyreadstat._readstat_parser' # checksum: be58ab4d\n  implicit-imports:\n    - depends:\n        - 'pandas'\n\n- module-name: 'pyreadstat.pyreadstat' # checksum: 7ce70624\n  implicit-imports:\n    - depends:\n        - 'pyreadstat._readstat_writer'\n        - 'pyreadstat.worker'\n        - 'multiprocessing'\n\n- module-name: 'pyrect' # checksum: 7a072535\n  anti-bloat:\n    - description: 'remove doctest reference'\n      replacements_plain:\n        'import doctest': ''\n\n- module-name: 'pyscf' # checksum: ec3da3c3\n  anti-bloat:\n    - description: 'remove useless plugin warning'\n      replacements_plain:\n        \"not all('/site-packages/' in p for p in __path__[1:])\": 'False'\n\n- module-name: 'pyscf.agf2._agf2' # checksum: c57648ff\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libagf2'\n\n- module-name: 'pyscf.ao2mo' # checksum: b1eae599\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libao2mo'\n\n- module-name: 'pyscf.cc._ccsd' # checksum: 2f8edb26\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libcc'\n\n- module-name: 'pyscf.df.df_jk' # checksum: 9c821128\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libri'\n\n- module-name: 'pyscf.dft' # checksum: 2f70b34e\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libdft'\n\n- module-name: 'pyscf.dft.libxc' # checksum: f3d52af4\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libxc_itrf'\n\n- module-name: 'pyscf.dft.xcfun' # checksum: c7fd93f9\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libxcfun_itrf'\n\n- module-name: 'pyscf.fci' # checksum: 3285ffbc\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libfci'\n\n- module-name: 'pyscf.gto' # checksum: 251ddee\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libcgto'\n\n- module-name: 'pyscf.gto.basis' # checksum: e00afdfb\n  data-files:\n    patterns:\n      - '**/*.dat'\n\n- module-name: 'pyscf.lib.numpy_helper' # checksum: 6a0e9d08\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libnp_helper'\n\n- module-name: 'pyscf.mcscf' # checksum: a8cbc5fd\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libmcscf'\n\n- module-name: 'pyscf.mrpt.nevpt2' # checksum: a8cbc5fd\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libmcscf'\n\n- module-name: 'pyscf.pbc' # checksum: d3e0f821\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libpbc'\n\n- module-name: 'pyscf.scf._vhf' # checksum: 801ef150\n  dlls:\n    - from_filenames:\n        relative_path: '../lib'\n        prefixes:\n          - 'libcvhf'\n\n- module-name: 'PySide2' # checksum: 4e71be92\n  implicit-imports:\n    - post-import-code:\n        - |\n          def patched_disconnect(self, slot=None):\n              if hasattr(slot, \"im_func\"):\n                  if hasattr(slot.im_func, \"__compiled__\"):\n                      patched_disconnect._protected = getattr(patched_disconnect, \"_protected\", [])\n                      patched_disconnect._protected.append(slot)\n\n              return orig_disconnect(self, slot)\n\n          from PySide2 import QtCore\n          orig_disconnect = QtCore.SignalInstance.disconnect\n          QtCore.SignalInstance.disconnect = patched_disconnect\n\n  options:\n    checks:\n      - description: 'PySide2 is a GUI framework'\n        console: 'recommend'\n        when: 'use_pyside2'\n      - description: 'PySide2 cannot be signed unless onefile'\n        macos_bundle_as_onefile: 'yes'\n        when: 'macos and use_pyside2'\n  import-hacks:\n    - find-dlls-near-module:\n        - 'shiboken2'\n\n- module-name: 'PySide6' # checksum: db68a9cc\n  implicit-imports:\n    - post-import-code:\n        - |\n          def patched_disconnect(self, slot=None):\n              if hasattr(slot, \"im_func\"):\n                  if hasattr(slot.im_func, \"__compiled__\"):\n                      patched_disconnect._protected = getattr(patched_disconnect, \"_protected\", [])\n                      patched_disconnect._protected.append(slot)\n\n              return orig_disconnect(self, slot)\n\n          def patched_connect(self, slot, type=None):\n              type = type or QtCore.Qt.ConnectionType.AutoConnection\n              if hasattr(slot, \"im_func\"):\n                  if hasattr(slot.im_func, \"__compiled__\"):\n                      patched_connect._protected = getattr(patched_connect, \"_protected\", [])\n                      patched_connect._protected.append(slot)\n\n                      if not slot.im_func.__name__.startswith(\"_pyside6_workaround_\"):\n                        slot.im_func.__name__ = \"_pyside6_workaround_\" + slot.im_func.__name__\n\n                        try:\n                          setattr(slot.im_self.__class__, slot.im_func.__name__, slot.im_func)\n                        except Exception:\n                          pass\n\n              return orig_connect(self, slot, type)\n\n          from PySide6 import QtCore\n          orig_disconnect = QtCore.SignalInstance.disconnect\n          QtCore.SignalInstance.disconnect = patched_disconnect\n          orig_connect = QtCore.SignalInstance.connect\n          QtCore.SignalInstance.connect = patched_connect\n\n  options:\n    checks:\n      - description: 'PySide6 is a GUI framework'\n        console: 'recommend'\n        when: 'use_pyside6'\n\n  import-hacks:\n    - find-dlls-near-module:\n        - 'shiboken6'\n    - acceptable-missing-dlls:\n        - 'libeffectsplugin'\n        - 'libeffects'\n        - 'libpdfquickplugin'\n        - 'libqpdf'\n        - 'libqtquick3dhelpersimplplugin'\n        - 'libquick3dspatialaudioplugin'\n\n- module-name: 'PySide6.QtCore' # checksum: be0d99ac\n  implicit-imports:\n    - depends:\n        - 'PySide6.support.deprecated'\n\n- module-name: 'pysnmp.smi' # checksum: d8623e4b\n  data-files:\n    patterns:\n      - 'mibs/**/*.py'\n  implicit-imports:\n    - depends:\n        - 'pysnmp.smi.exval'\n        - 'pysnmp.cache'\n        - 'pysnmp.smi.mibs'\n        - 'pysnmp.smi.mibs.instances'\n\n- module-name: 'python_utils.terminal' # checksum: 681007fe\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython import get_ipython': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'pythonnet' # checksum: 2f2ee1ca\n  # These is a dotnet assembly, not a platform DLL, esp. not on Linux, macOS,\n  # etc.\n  data-files:\n    patterns:\n      - 'runtime/Python.Runtime.dll'\n\n- module-name: 'pytorch_lightning' # checksum: 3167b040\n  data-files:\n    patterns:\n      - 'version.info'\n\n- module-name: 'pytorch_lightning.utilities.imports' # checksum: a95c6e78\n  anti-bloat:\n    # TODO: It would be better if we had a form of replacements, e.g. through\n    # the use of variables, that would use the result of the comparison, or if\n    # we could force inline of \"compare_version\" with constant values.\n    - description: 'workaround for dynamic rich version check'\n      replacements_plain:\n        'compare_version(\"rich\", operator.ge, \"10.2.2\")': 'True'\n      when: 'version(\"rich\") is not None and version(\"rich\") >= (10, 2, 2)'\n    - description: 'workaround for dynamic rich version check'\n      replacements_plain:\n        'compare_version(\"rich\", operator.ge, \"10.2.2\")': 'False'\n      when: 'version(\"rich\") is not None and version(\"rich\") < (10, 2, 2)'\n\n- module-name: 'pytorch_lightning.utilities.model_helpers' # checksum: b4f61938\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'from unittest.mock import Mock': ''\n        'isinstance(instance_attr, Mock)': 'False'\n\n- module-name: 'pytz' # checksum: 4df2d158\n  data-files:\n    dirs:\n      - 'zoneinfo'\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'pytzdata' # checksum: 355b3284\n  data-files:\n    dirs:\n      - 'zoneinfo'\n\n- module-name: 'pyvista' # checksum: e4ffea88\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from pyvista.jupyter import set_jupyter_backend, PlotterITK': 'set_jupyter_backend = PlotterITK = None'\n      when: 'not use_ipython'\n\n- module-name: 'pyvista.core.dataobject' # checksum: b73d0183\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.display import HTML, display as _display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'pyvista.plotting.mapper' # checksum: b64967f7\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from ..jupyter.pv_ipygany import check_colormap': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'pyvista.plotting.plotting' # checksum: cb73cde5\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from ..jupyter.notebook import handle_plotter': 'raise ImportError'\n      change_function:\n        # This uses IPython to convert to HTML.\n        '_save_panel': 'un-callable'\n        'export_html': 'un-callable'\n        'to_pythreejs': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'pyvista.themes' # checksum: e2134fcd\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from pyvista.jupyter import _validate_jupyter_backend': '_validate_jupyter_backend = str'\n      when: 'not use_ipython'\n\n- module-name: 'pywt' # checksum: 889e5afa\n  data-files:\n    dirs:\n      - 'data'\n  implicit-imports:\n    - depends:\n        - 'pywt._extensions'\n\n- module-name: 'pywt._extensions' # checksum: 5436eb56\n  implicit-imports:\n    - depends:\n        - 'pywt._extensions._cwt'\n        - 'pywt._extensions._dwt'\n        - 'pywt._extensions._pywt'\n        - 'pywt._extensions._swt'\n\n- module-name: 'pywt._pytesttester' # checksum: 51b37a6d\n  anti-bloat:\n    - description: 'remove pywt testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, name):\n            pass\n\n- module-name: 'pywt._utils' # checksum: 9e6d9638\n  anti-bloat:\n    - description: 'remove pytest reference (via nose)'\n      no-auto-follow:\n        'nose': 'ignore'\n      when: 'not use_pytest'\n\n- module-name: 'pyzbar' # checksum: a2a725bb\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libiconv'\n          - 'libzbar'\n\n- module-name: 'qt_material' # checksum: 136a33c2\n  data-files:\n    dirs:\n      - 'fonts'\n      - 'resources'\n      - 'themes'\n    patterns:\n      - '*.ui'\n      - '*.xml'\n      - '*.svg'\n      - '*.template'\n      - '*.ttf'\n\n- module-name: 'qtawesome' # checksum: 2c2a9970\n  data-files:\n    dirs:\n      - 'fonts'\n\n- module-name: 'randomname' # checksum: 8d6f0c80\n  data-files:\n    dirs:\n      - 'wordlists'\n\n- module-name: 'rapidfuzz' # checksum: 2248cb4c\n  implicit-imports:\n    - depends:\n        - '.utils_py'\n        - '.utils_cpp'\n        - '.fuzz_py'\n        - '.fuzz_cpp'\n        - '.process_cdist_py'\n        - '.process_cdist_cpp'\n        - '.process_py'\n        - '.process_cpp'\n        - '.string_metric_py'\n        - '.string_metric_cpp'\n\n- module-name: 'rapidfuzz.distance' # checksum: 42cced33\n  implicit-imports:\n    - depends:\n        - '._initialize_py'\n        - '._initialize_cpp'\n        - '.Hamming_py'\n        - '.Hamming_cpp'\n        - '.Indel_py'\n        - '.Indel_cpp'\n        - '.LCSseq_py'\n        - '.LCSseq_cpp'\n        - '.Levenshtein_py'\n        - '.Levenshtein_cpp'\n        - '.DamerauLevenshtein_py'\n        - '.DamerauLevenshtein_cpp'\n        - '.OSA_cpp'\n        - '.OSA_py'\n        - '.Jaro_py'\n        - '.Jaro_cpp'\n        - '.JaroWinkler_py'\n        - '.JaroWinkler_cpp'\n        - '.Postfix_py'\n        - '.Postfix_cpp'\n        - '.Prefix_py'\n        - '.Prefix_cpp'\n        - '.metrics_cpp'\n        - '.metrics_py'\n\n- module-name: 'rasterio._io' # checksum: 5acc49ae\n  implicit-imports:\n    - depends:\n        - 'rasterio.sample'\n        - 'rasterio.vrt'\n\n- module-name: 'rasterio._warp' # checksum: 178bc482\n  implicit-imports:\n    - depends:\n        - 'rasterio._features'\n\n- module-name: 'rdkit' # checksum: e6ef3220\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'kernel_name = get_ipython().__class__.__name__': 'raise NameError'\n      when: 'not use_ipython'\n\n- module-name: 'reportlab.rl_config' # checksum: 8e035d91\n  implicit-imports:\n    - depends:\n        - 'reportlab.rl_settings'\n\n- module-name: 'requests_toolbelt._compat' # checksum: aed85e8e\n  implicit-imports:\n    - depends:\n        - 'urllib3'\n        - 'urllib3._collections'\n        - 'urllib3.connection'\n        - 'urllib3.connection.appengine'\n        - 'urllib3.connectionpool'\n        - 'urllib3.contrib'\n        - 'urllib3.contrib.appengine'\n        - 'urllib3.exceptions'\n        - 'urllib3.fields'\n        - 'urllib3.filepost'\n        - 'urllib3.packages'\n        - 'urllib3.packages.six'\n        - 'urllib3.packages.ssl_match_hostname'\n        - 'urllib3.poolmanager'\n        - 'urllib3.request'\n        - 'urllib3.response'\n        - 'urllib3.util'\n        - 'urllib3.util.connection'\n        - 'urllib3.util.queue'\n        - 'urllib3.util.request'\n        - 'urllib3.util.response'\n        - 'urllib3.util.retry'\n        - 'urllib3.util.ssl_'\n        - 'urllib3.util.timeout'\n        - 'urllib3.util.url'\n        - 'urllib3.util.wait'\n        - 'urllib.error'\n        - 'urllib.parse'\n        - 'urllib.request'\n        - 'urllib.response'\n\n- module-name: 'rich.jupyter' # checksum: b346e77\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'display': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'rich.live' # checksum: f0442975\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'self.console.is_jupyter': 'False'\n      when: 'not use_ipython'\n\n- module-name: 'rich.pretty' # checksum: bdd67adb\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'ip = get_ipython()': 'raise NameError'\n      when: 'not use_ipython'\n\n- module-name: 'rlottie_python.rlottie_wrapper' # checksum: 3b2bad36\n  dlls:\n    # TODO: The \"lib\" difference out to be handled automatically.\n    - from_filenames:\n        prefixes:\n          - 'rlottie'\n      when: 'win32'\n    - from_filenames:\n        prefixes:\n          - 'librlottie'\n      when: 'not win32'\n\n- module-name: 'rtree' # checksum: 7b6be18\n  dlls:\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'spatialindex'\n      when: 'win32'\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'libspatialindex'\n      when: 'not win32'\n\n- module-name: 'scapy.all' # checksum: 8a9944ce\n  implicit-imports:\n    - depends:\n        - 'scapy.layers.*'\n\n- module-name: 'scipy' # checksum: 30cb05e1\n  data-files:\n    patterns:\n      - 'stats/_sobol_direction_numbers.npz' # for scipy.stats._sobol._initialize_direction_numbers\n\n  dlls:\n    - from_filenames:\n        relative_path: '.libs'\n        prefixes:\n          - ''\n    - from_filenames:\n        relative_path: 'extra_dll'\n        prefixes:\n          - ''\n      when: 'win32'\n\n  anti-bloat:\n    - description: 'torch and cupy checks should not cause usage'\n      no-auto-follow:\n        'cupy': 'ignore'\n        'torch': 'ignore'\n\n- module-name: 'scipy._distributor_init' # checksum: 3316da5c\n  anti-bloat:\n    - description: 'workaround for scipy DLL loading'\n      append_plain: |\n        if os.name == \"nt\":\n          libs_dir = os.path.join(os.path.dirname(__file__), '..', 'scipy.libs')\n          for filename in glob.glob(os.path.join(libs_dir, '*openblas*dll')):\n            WinDLL(filename)\n      when: 'win32 and version(\"scipy\") >= (1, 9, 2)'\n\n- module-name: 'scipy._lib' # checksum: 4063ed73\n  implicit-imports:\n    - depends:\n        - 'scipy._lib.messagestream'\n\n- module-name: 'scipy._lib._docscrape' # checksum: e4a58ca7\n  anti-bloat:\n    - description: 'remove sphinx reference'\n      replacements_plain:\n        \"if 'sphinx' in sys.modules:\": 'if False:'\n    - description: 'workaround for MSVC bug with scipy 1.8.x'\n      replacements_plain:\n        \"return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))\": \"r = l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1)); return r\"\n\n- module-name: 'scipy._lib._numpy_compat' # checksum: c054044d\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      replacements:\n        \"NumpyVersion(np.__version__) > '1.7.0.dev'\": \"'0'\"\n        'from numpy.testing import suppress_warnings': \"r'suppress_warnings = __import__(\\\"contextmanager\\\").contextmanager(lambda : (yield))'\"\n\n- module-name: 'scipy._lib._testutils' # checksum: 5e3b539b\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, name):\n            pass\n\n- module-name: 'scipy.integrate._quadrature' # checksum: 97a85907\n  anti-bloat:\n    - description: 'remove useless function copying'\n      change_function:\n        '_copy_func': \"'(lambda f: f)'\"\n\n- module-name: 'scipy.lib.numpy_compat' # checksum: c054044d\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      replacements:\n        \"NumpyVersion(np.__version__) > '1.7.0.dev'\": \"'0'\"\n        'from numpy.testing import suppress_warnings': \"r'suppress_warnings = __import__(\\\"contextmanager\\\").contextmanager(lambda : (yield))'\"\n\n- module-name: 'scipy.linalg' # checksum: 3f43474e\n  implicit-imports:\n    - depends:\n        - 'scipy.linalg.cython_blas'\n        - 'scipy.linalg.cython_lapack'\n\n- module-name: 'scipy.optimize._cobyla_py' # checksum: 62fa2e97\n  anti-bloat:\n    - replacements_plain:\n        '    info = np.zeros(4, np.float64)': |\n          #\n              info = np.zeros(4, np.float64)\n              def calcfc2(x, con):\n                  f = fun(np.copy(x), *args)\n                  i = 0\n                  for size, c in izip(cons_lengths, constraints):\n                      con[i: i + size] = c['fun'](x, *c['args'])\n                      i += size\n                  return f\n\n              calcfc = eval(\"lambda x, con: calcfc2(x,con)\", locals())\n\n              def wrapped_callback2(x):\n                  if callback is not None:\n                      callback(np.copy(x))\n\n              wrapped_callback = eval(\"lambda x: wrapped_callback2(x)\", locals())\n\n- module-name: 'scipy.optimize._shgo_lib.triangulation' # checksum: 7547ad25\n  anti-bloat:\n    - no-auto-follow:\n        'matplotlib': 'plotting will lack matplotlib'\n\n- module-name: 'scipy.sparse.csgraph' # checksum: 8997608e\n  implicit-imports:\n    - depends:\n        - 'scipy.sparse.csgraph._validation'\n\n- module-name: 'scipy.sparse.linalg._expm_multiply' # checksum: 8baee295\n  anti-bloat:\n    - description: 'remove numba reference (via sparse)'\n      replacements_plain:\n        'import sparse': 'raise ImportError'\n      when: 'not use_numba and standalone'\n\n- module-name: 'scipy.sparse.linalg._matfuncs' # checksum: 8baee295\n  anti-bloat:\n    - description: 'remove numba reference (via sparse)'\n      replacements_plain:\n        'import sparse': 'raise ImportError'\n      when: 'not use_numba and standalone'\n\n- module-name: 'scipy.sparse.linalg.matfuncs' # checksum: 8baee295\n  anti-bloat:\n    - description: 'remove numba reference (via sparse)'\n      replacements_plain:\n        'import sparse': 'raise ImportError'\n      when: 'not use_numba and standalone'\n\n- module-name: 'scipy.spatial' # checksum: 9701797c\n  implicit-imports:\n    - depends:\n        - 'scipy.spatial.transform'\n\n- module-name: 'scipy.spatial._plotutils' # checksum: 7547ad25\n  anti-bloat:\n    - no-auto-follow:\n        'matplotlib': 'plotting will lack matplotlib'\n\n- module-name: 'scipy.spatial.transform' # checksum: 2634b8e1\n  implicit-imports:\n    - depends:\n        - 'scipy.spatial.transform._rotation_groups'\n\n- module-name: 'scipy.special' # checksum: 93a78ec1\n  implicit-imports:\n    - depends:\n        - 'scipy.special._ufuncs_cxx'\n\n- module-name: 'scipy.special._ufuncs' # checksum: 4ded0e67\n  implicit-imports:\n    - depends:\n        - 'scipy.special._cdflib'\n\n- module-name: 'scipy.stats._fit' # checksum: 7547ad25\n  anti-bloat:\n    - no-auto-follow:\n        'matplotlib': 'plotting will lack matplotlib'\n\n- module-name: 'scipy.stats._stats' # checksum: 41c1ec8f\n  implicit-imports:\n    - depends:\n        - 'scipy.special.cython_special'\n\n- module-name: 'scipy.stats._survival' # checksum: 7547ad25\n  anti-bloat:\n    - no-auto-follow:\n        'matplotlib': 'plotting will lack matplotlib'\n\n- module-name: 'scipy.stats.morestats' # checksum: 8c6ba801\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      replacements:\n        '@setastest(False)': ''\n        'from numpy.testing.decorators import setastest': ''\n\n- module-name: 'scrapy' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'scyjava' # checksum: 51174dbf\n  anti-bloat:\n    - description: 'compile time resolve version metadata'\n      # This is necessary, because they have a function that prevents compile\n      # time from seeing it. We might later force those to be inlined instead.\n      replacements:\n        'get_version(\"scyjava\")': 'repr(version(\"scyjava\"))'\n\n- module-name: 'seaborn.external.docscrape' # checksum: f18b6919\n  anti-bloat:\n    # TODO: Keep the same as 'scipy._lib._docscrape' module\n    - description: 'remove sphinx reference'\n      replacements_plain:\n        \"if 'sphinx' in sys.modules:\": 'if False:'\n    # TODO: Keep the same as 'scipy._lib._docscrape' module\n    - description: 'workaround for MSVC bug with scipy docscrape 1.8.x'\n      replacements_plain:\n        \"return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))\": \"r = l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1)); return r\"\n\n- module-name: 'seedir.printing' # checksum: b8a76fb6\n  data-files:\n    patterns:\n      - 'words.txt'\n\n- module-name: 'selenium' # checksum: 19747624\n  data-files:\n    dirs:\n      - '.'\n  dlls:\n    - from_filenames:\n        relative_path: 'webdriver/common/windows'\n        prefixes:\n          - 'selenium-manager'\n        executable: 'yes'\n      when: 'win32'\n\n- module-name: 'sentence_transformers.SentenceTransformer' # checksum: c6062648\n  implicit-imports:\n    - depends:\n        - 'huggingface_hub.repository'\n\n- module-name: 'setuptools.extern' # checksum: 2b2a3793\n  # TODO: Vendor importers should maybe get their own thing, pkg_resources does\n  # similar, and we might try and avoid duplication between the two of them on\n  # some level.\n  implicit-imports:\n    - depends:\n        - 'setuptools._vendor.*'\n        - 'setuptools._vendor.*.*'\n\n- module-name: 'setuptools.monkey' # checksum: 1ea728a1\n  anti-bloat:\n    - description: 'remove MSVC patching on non-Windows'\n      replacements_plain:\n        \"msvc = import_module('setuptools.msvc')\": 'return'\n      change_function:\n        # TODO: No effect if bytecode is used, we might have to change how\n        # these are done, and try to do it in source code somehow.\n        'patch_for_msvc_specialized_compiler': \"'(lambda: None)'\"\n      when: 'standalone and not win32'\n  implicit-imports:\n    - depends:\n        - '.msvc'\n      when: 'standalone and win32'\n\n- module-name: 'setuptools.version' # checksum: 76d680ea\n  anti-bloat:\n    - description: 'workaround for metadata version of setuptools'\n      replacements:\n        \"pkg_resources.get_distribution('setuptools').version\": \"repr(__import__('setuptools.version').version.__version__)\"\n\n- module-name: 'sgmllib' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'shap.explainers._exact' # checksum: 74320da4\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.explainers._partition' # checksum: 74320da4\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.links' # checksum: 7e198b88\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'import numba': ''\n        '@numba.jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.maskers._image' # checksum: e81228ef\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n        \"warnings.simplefilter('ignore', category=NumbaPendingDeprecationWarning)\": ''\n        'from numba.core.errors import NumbaPendingDeprecationWarning': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.maskers._tabular' # checksum: 74320da4\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.utils._clustering' # checksum: 74320da4\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shap.utils._masked_model' # checksum: 74320da4\n  anti-bloat:\n    - description: 'remove numba reference'\n      replacements_plain:\n        'from numba import jit': ''\n        '@jit': ''\n      when: 'not use_numba and standalone'\n\n- module-name: 'shapely._geometry_helpers' # checksum: 669d5ef2\n  implicit-imports:\n    - depends:\n        - 'shapely._geos'\n\n- module-name: 'shapely.geometry.base' # checksum: f7162159\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'shapely.geometry.collection' # checksum: f7162159\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'shapely.geometry.multilinestring' # checksum: f7162159\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'shapely.geometry.multipolygon' # checksum: f7162159\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'shapely.geos' # checksum: ad839ab3\n  dlls:\n    # PyPI has it contained, but not for Windows.\n    - by_code:\n        setup_code: 'import shapely.geos'\n        filename_code: 'shapely.geos._lgeos._name'\n      when: 'not is_conda_package(\"shapely\") and not win32 and version(\"shapely\") < (2,0)'\n    # Anaconda or Win32 are forced to specific path.\n    - by_code:\n        setup_code: 'import shapely.geos'\n        filename_code: 'shapely.geos._lgeos._name'\n      dest_path: 'shapely'\n      when: 'version(\"shapely\") < (2,0) and (is_conda_package(\"shapely\") or win32 and version(\"shapely\") < (1,8,1))'\n  anti-bloat:\n    - description: 'change geos DLL location'\n      replacements_plain:\n        '_lgeos = load_dll(\"geos_c.dll\")': '_lgeos = load_dll(\"geos_c.dll\", fallbacks=[os.path.join(os.path.dirname(__file__), \"geos_c.dll\")])'\n      when: 'win32'\n    - description: 'avoid runtime Anaconda environment influence'\n      replacements_plain:\n        \"os.getenv('CONDA_PREFIX', '')\": \"''\"\n\n- module-name: 'shiboken6' # checksum: 9f9886af\n  implicit-imports:\n    - depends:\n        - 'argparse'\n        - 'enum'\n        - 'logging'\n\n- module-name: 'sip' # checksum: 1cf87ab4\n  implicit-imports:\n    - depends:\n        - 'enum'\n      when: 'before_python3'\n\n- module-name: 'six' # checksum: e62bccb7\n  implicit-imports:\n    - depends:\n        - 'queue'\n\n- module-name: 'skimage' # checksum: 2265010b\n  data-files:\n    dirs:\n      - 'data'\n  anti-bloat:\n    - description: 'remove pytest reference (via nose)'\n      no-auto-follow:\n        'nose': 'ignore'\n      when: 'not use_pytest'\n\n# TODO: Our lazy loader support may mean these are not really necessary anymore.\n- module-name: 'skimage._shared' # checksum: 9e389afa\n  implicit-imports:\n    - depends:\n        - 'skimage._shared.geometry'\n        - 'skimage._shared.interpolation'\n        - 'skimage._shared.transform'\n\n- module-name: 'skimage._shared.tester' # checksum: 32a31c1c\n  anti-bloat:\n    - description: 'remove skimage testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, name):\n            pass\n\n- module-name: 'skimage.data' # checksum: a060f06f\n  implicit-imports:\n    - depends:\n        - '._fetchers'\n\n- module-name: 'skimage.data._fetchers' # checksum: 93b01f88\n  anti-bloat:\n    - description: 'remove pytest testing framework'\n      replacements_plain:\n        \"'PYTEST_CURRENT_TEST' in os.environ\": 'False'\n      when: 'not use_pytest'\n\n- module-name: 'skimage.draw' # checksum: 8b2051fc\n  implicit-imports:\n    - depends:\n        - 'skimage.draw._draw'\n\n- module-name: 'skimage.external.tifffile' # checksum: ca551805\n  implicit-imports:\n    - depends:\n        - 'skimage.external.tifffile._tifffile'\n\n- module-name: 'skimage.external.tifffile.tifffile_local' # checksum: 9838c964\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': 'un-callable'\n\n- module-name: 'skimage.feature' # checksum: 3caac2d\n  implicit-imports:\n    - depends:\n        - 'skimage.feature.brief_cy'\n        - 'skimage.feature.censure_cy'\n        - 'skimage.feature.corner_cy'\n        - 'skimage.feature.orb_cy'\n        - 'skimage.feature._cascade'\n        - 'skimage.feature._haar'\n        - 'skimage.feature._hessian_det_appx'\n        - 'skimage.feature._hoghistogram'\n        - 'skimage.feature._texture'\n\n- module-name: 'skimage.feature._orb_descriptor_positions' # checksum: 1d5a142a\n  data-files:\n    patterns:\n      - 'orb_descriptor_positions.txt'\n\n- module-name: 'skimage.feature.orb_cy' # checksum: c8ba0e7d\n  implicit-imports:\n    - depends:\n        - 'skimage.feature._orb_descriptor_positions'\n\n- module-name: 'skimage.filters.rank' # checksum: bfef07a9\n  implicit-imports:\n    - depends:\n        - 'skimage.filters.rank.bilateral_cy'\n        - 'skimage.filters.rank.core_cy'\n        - 'skimage.filters.rank.core_cy_3d'\n        - 'skimage.filters.rank.generic_cy'\n        - 'skimage.filters.rank.percentile_cy'\n\n- module-name: 'skimage.future.graph' # checksum: 1a5551d3\n  implicit-imports:\n    - depends:\n        - 'skimage.future.graph._ncut_cy'\n\n- module-name: 'skimage.graph' # checksum: 1307b067\n  implicit-imports:\n    - depends:\n        - 'skimage.graph.heap'\n        - 'skimage.graph._mcp'\n        - 'skimage.graph._spath'\n\n- module-name: 'skimage.io' # checksum: a2fdda9a\n  data-files:\n    patterns:\n      - '_plugins/*.ini'\n\n  implicit-imports:\n    - depends:\n        - 'skimage.io._plugins'\n        - 'skimage.io._plugins._histograms'\n        - 'skimage.io._plugins.fits_plugin'\n        - 'skimage.io._plugins.gdal_plugin'\n        - 'skimage.io._plugins.gtk_plugin'\n        - 'skimage.io._plugins.imageio_plugin'\n        - 'skimage.io._plugins.imread_plugin'\n        - 'skimage.io._plugins.matplotlib_plugin'\n        - 'skimage.io._plugins.pil_plugin'\n        - 'skimage.io._plugins.qt_plugin'\n        - 'skimage.io._plugins.simpleitk_plugin'\n        - 'skimage.io._plugins.skivi_plugin'\n        - 'skimage.io._plugins.tifffile_plugin'\n        - 'skimage.io._plugins.util'\n\n- module-name: 'skimage.io._io' # checksum: 1d1c0f59\n  implicit-imports:\n    - depends:\n        - 'skimage.exposure.exposure'\n\n- module-name: 'skimage.measure' # checksum: 32204708\n  implicit-imports:\n    - depends:\n        - 'skimage.measure._ccomp'\n        - 'skimage.measure._find_contours_cy'\n        - 'skimage.measure._marching_cubes_classic_cy'\n        - 'skimage.measure._marching_cubes_lewiner_cy'\n        - 'skimage.measure._moments_cy'\n        - 'skimage.measure._pnpoly'\n\n- module-name: 'skimage.morphology' # checksum: ce2f76e5\n  data-files:\n    patterns:\n      - '*.npy'\n\n  implicit-imports:\n    - depends:\n        - 'skimage.morphology._convex_hull'\n        - 'skimage.morphology._extrema_cy'\n        - 'skimage.morphology._flood_fill_cy'\n        - 'skimage.morphology._greyreconstruct'\n        - 'skimage.morphology._max_tree'\n        - 'skimage.morphology._skeletonize_3d_cy'\n        - 'skimage.morphology._skeletonize_cy'\n        - 'skimage.morphology._watershed'\n\n- module-name: 'skimage.restoration' # checksum: fd820a1d\n  implicit-imports:\n    - depends:\n        - 'skimage.restoration._denoise_cy'\n        - 'skimage.restoration._nl_means_denoising'\n        - 'skimage.restoration._unwrap_1d'\n        - 'skimage.restoration._unwrap_2d'\n        - 'skimage.restoration._unwrap_3d'\n\n- module-name: 'skimage.restoration._cycle_spin' # checksum: 37f8ca49\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'skimage.segmentation' # checksum: e950c621\n  implicit-imports:\n    - depends:\n        - 'skimage.segmentation._felzenszwalb_cy'\n        - 'skimage.segmentation._quickshift_cy'\n        - 'skimage.segmentation._slic'\n\n- module-name: 'skimage.transform' # checksum: fdc67d7\n  implicit-imports:\n    - depends:\n        - 'skimage.transform._hough_transform'\n        - 'skimage.transform._radon_transform'\n        - 'skimage.transform._warps_cy'\n\n- module-name: 'skimage.transform._hough_transform' # checksum: 3b3932aa\n  implicit-imports:\n    - depends:\n        - 'skimage.draw.draw'\n\n- module-name: 'skimage.util.apply_parallel' # checksum: 72ef561b\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask.array as da': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'sklearn._distributor_init' # checksum: f9ef476\n  dlls:\n    - from_filenames:\n        relative_path: '.libs'\n        prefixes:\n          - ''\n  anti-bloat:\n    - description: 'remove site module and distutils usage'\n      replacements:\n        '_site.ENABLE_USER_SITE': \"'False'\"\n        'if _running_from_pip_package()': \"'if False'\"\n        'import distutils as _distutils': \"'_distutils = None'\"\n        'import site as _site': \"'_site = None'\"\n  implicit-imports:\n    - depends:\n        - '.python.keras'\n\n- module-name: 'sklearn.cluster' # checksum: f5aadf01\n  implicit-imports:\n    - depends:\n        - 'sklearn.cluster._dbscan_inner'\n        - 'sklearn.cluster._hierarchical'\n        - 'sklearn.cluster._k_means'\n        - 'sklearn.cluster._k_means_elkan'\n\n- module-name: 'sklearn.datasets' # checksum: feb92785\n  data-files:\n    dirs:\n      - 'data'\n      - 'descr'\n  implicit-imports:\n    - depends:\n        - 'sklearn.datasets._svmlight_format'\n        - 'sklearn.datasets.data'\n        - 'sklearn.datasets.descr'\n\n- module-name: 'sklearn.decomposition' # checksum: 61c8cb5d\n  implicit-imports:\n    - depends:\n        - 'sklearn.decomposition.cdnmf_fast'\n        - 'sklearn.decomposition._online_lda'\n\n- module-name: 'sklearn.ensemble' # checksum: 22d20aac\n  implicit-imports:\n    - depends:\n        - 'sklearn.ensemble._gradient_boosting'\n\n- module-name: 'sklearn.ensemble._hist_gradient_boosting' # checksum: 530838bc\n  implicit-imports:\n    - depends:\n        - 'sklearn.ensemble._hist_gradient_boosting.histogram'\n        - 'sklearn.ensemble._hist_gradient_boosting.splitting'\n        - 'sklearn.ensemble._hist_gradient_boosting.types'\n        - 'sklearn.ensemble._hist_gradient_boosting.utils'\n        - 'sklearn.ensemble._hist_gradient_boosting._binning'\n        - 'sklearn.ensemble._hist_gradient_boosting._gradient_boosting'\n        - 'sklearn.ensemble._hist_gradient_boosting._loss'\n        - 'sklearn.ensemble._hist_gradient_boosting._predictor'\n\n- module-name: 'sklearn.externals' # checksum: 75fb09a8\n  implicit-imports:\n    - depends:\n        - 'sklearn.externals.joblib'\n\n- module-name: 'sklearn.externals.joblib' # checksum: d27fe3d7\n  implicit-imports:\n    - depends:\n        - 'sklearn.externals.joblib.numpy_pickle'\n\n- module-name: 'sklearn.feature_extraction' # checksum: defc6c9f\n  implicit-imports:\n    - depends:\n        - 'sklearn.feature_extraction._hashing'\n\n- module-name: 'sklearn.linear_model' # checksum: 653af0a9\n  implicit-imports:\n    - depends:\n        - 'sklearn.linear_model.cd_fast'\n        - 'sklearn.linear_model.sag_fast'\n        - 'sklearn.linear_model.sgd_fast'\n\n- module-name: 'sklearn.linear_model._sgd_fast' # checksum: 52ff905c\n  implicit-imports:\n    - depends:\n        - 'sklearn.utils._weight_vector'\n\n- module-name: 'sklearn.manifold' # checksum: 9c747b4c\n  implicit-imports:\n    - depends:\n        - 'sklearn.manifold._barnes_hut_tsne'\n        - 'sklearn.manifold._utils'\n\n- module-name: 'sklearn.manifold._barnes_hut_tsne' # checksum: 327dee3d\n  implicit-imports:\n    - depends:\n        - 'sklearn.neighbors._quad_tree'\n\n- module-name: 'sklearn.metrics' # checksum: 311c41ca\n  implicit-imports:\n    - depends:\n        - 'sklearn.metrics.pairwise_fast'\n\n- module-name: 'sklearn.metrics._dist_metrics' # checksum: 4d2b7e03\n  implicit-imports:\n    - depends:\n        - 'sklearn.utils._typedefs'\n\n- module-name: 'sklearn.metrics._pairwise_distances_reduction._argkmin' # checksum: 12b0ab2b\n  implicit-imports:\n    - depends:\n        - 'sklearn.metrics._pairwise_distances_reduction._middle_term_computer'\n\n- module-name: 'sklearn.metrics._pairwise_distances_reduction._base' # checksum: 22841aae\n  implicit-imports:\n    - depends:\n        - 'sklearn.metrics._pairwise_distances_reduction._datasets_pair'\n\n- module-name: 'sklearn.metrics.cluster' # checksum: 386d575c\n  implicit-imports:\n    - depends:\n        - 'sklearn.metrics.cluster.expected_mutual_info_fast'\n\n- module-name: 'sklearn.neighbors' # checksum: d45018d2\n  implicit-imports:\n    - depends:\n        - 'sklearn.neighbors.ball_tree'\n        - 'sklearn.neighbors.dist_metrics'\n        - 'sklearn.neighbors.kd_tree'\n        - 'sklearn.neighbors.quad_tree'\n        - 'sklearn.neighbors.typedefs'\n\n- module-name: 'sklearn.neighbors._ball_tree' # checksum: b80297a4\n  implicit-imports:\n    - depends:\n        - 'sklearn.neighbors._partition_nodes'\n\n- module-name: 'sklearn.neighbors._dist_metrics' # checksum: 30f6e612\n  implicit-imports:\n    - depends:\n        - 'sklearn.neighbors._typedefs'\n\n- module-name: 'sklearn.neighbors._quad_tree' # checksum: 3e37d9f0\n  implicit-imports:\n    - depends:\n        - 'sklearn.tree'\n\n- module-name: 'sklearn.preprocessing' # checksum: db64027b\n  implicit-imports:\n    - depends:\n        - 'sklearn.preprocessing._csr_polynomial_expansion'\n\n- module-name: 'sklearn.random_projection' # checksum: 88257b1b\n  anti-bloat:\n    - description: 'remove numpy testing framework'\n      replacements:\n        'from numpy.testing import assert_equal': \"r'assert_equal = (lambda actual, desired, err_msg=None, verbose=True: True)'\"\n\n- module-name: 'sklearn.svm' # checksum: 1126ac74\n  implicit-imports:\n    - depends:\n        - 'sklearn.svm.liblinear'\n        - 'sklearn.svm.libsvm'\n        - 'sklearn.svm.libsvm_sparse'\n\n- module-name: 'sklearn.tree' # checksum: 74b20e12\n  implicit-imports:\n    - depends:\n        - 'sklearn.tree._criterion'\n        - 'sklearn.tree._splitter'\n        - 'sklearn.tree._tree'\n        - 'sklearn.tree._utils'\n\n- module-name: 'sklearn.tree._tree' # checksum: 327dee3d\n  implicit-imports:\n    - depends:\n        - 'sklearn.neighbors._quad_tree'\n\n- module-name: 'sklearn.utils' # checksum: d3a557f9\n  data-files:\n    patterns:\n      - '*.css'\n  anti-bloat:\n    - description: 'pandas and matplotlib checks should not cause usage'\n      no-auto-follow:\n        'pandas': 'ignore'\n        'matplotlib': 'ignore'\n  implicit-imports:\n    - depends:\n        - 'sklearn.utils.arrayfuncs'\n        - 'sklearn.utils.fast_dict'\n        - 'sklearn.utils.graph_shortest_path'\n        - 'sklearn.utils.lgamma'\n        - 'sklearn.utils.murmurhash'\n        - 'sklearn.utils.seq_dataset'\n        - 'sklearn.utils.sparsefuncs_fast'\n        - 'sklearn.utils.weight_vector'\n        - 'sklearn.utils._cython_blas'\n        - 'sklearn.utils._logistic_sigmoid'\n        - 'sklearn.utils._weight_vector'\n        - 'sklearn.utils._typedefs'\n        - 'sklearn.utils._heap'\n        - 'sklearn.utils._sorting'\n        - 'sklearn.utils._vector_sentinel'\n        - 'sklearn.utils._seq_dataset'\n        - 'sklearn.utils._readonly_array_wrapper'\n        - 'sklearn.utils._openmp_helpers'\n        - 'sklearn.utils._fast_dict'\n        - 'sklearn.utils._random'\n\n- module-name: 'sklearn.utils._hough_transform' # checksum: fb2b10d5\n  implicit-imports:\n    - depends:\n        - 'skimage.draw'\n\n- module-name: 'sklearn.utils._testing' # checksum: 8b4de7fe\n  anti-bloat:\n    - description: 'remove pytest testing framework'\n      replacements_plain:\n        '_dummy = TestCase(\"__init__\")': ''\n        'assert_dict_equal = _dummy.assert_dict_equal': 'def assert_dict_equal(*args, **kwargs): pass'\n        'assert_raises = _dummy.assertRaises': 'def assert_raises(*args, **kwargs): pass'\n        'assert_raises_regex = _dummy.assert_raises_regex': 'def assert_raises_regex(*args, **kwargs): pass'\n        'assert_dict_equal = _dummy.assertDictEqual': 'def assert_dict_equal(*args, **kwargs): pass'\n        'assert_raises_regex = _dummy.assertRaisesRegex': 'def assert_raises_regex(*args, **kwargs): pass'\n        'from unittest import TestCase': ''\n        'import pytest': 'raise ImportError'\n        'import unittest': ''\n        'unittest.case.SkipTest': 'None'\n\n- module-name: 'sklearn.utils.estimator_checks' # checksum: 1356b841\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'parametrize_with_checks': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'sklearn.utils.sparsetools' # checksum: 3780099b\n  implicit-imports:\n    - depends:\n        - 'sklearn.utils.sparsetools._graph_validation'\n        - 'sklearn.utils.sparsetools._graph_tools'\n\n- module-name: 'sound_lib' # checksum: f8f59602\n  dlls:\n    - from_filenames:\n        relative_path: 'lib/x64'\n        prefixes:\n          - ''\n        suffixes:\n          - 'dylib'\n      when: 'macos'\n    - from_filenames:\n        relative_path: 'lib/x64'\n        prefixes:\n          - ''\n        suffixes:\n          - 'so'\n      when: 'linux'\n    - from_filenames:\n        relative_path: 'lib/x64'\n        prefixes:\n          - ''\n        suffixes:\n          - 'dll'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: 'lib/x86'\n        prefixes:\n          - ''\n        suffixes:\n          - 'dll'\n      when: 'win32 and arch_x86'\n\n- module-name: 'sounddevice' # checksum: 4bff6c5b\n  dlls:\n    - from_filenames:\n        relative_path: '_sounddevice_data/portaudio-binaries'\n        prefixes:\n          - 'libportaudio64bit'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: '_sounddevice_data/portaudio-binaries'\n        prefixes:\n          - 'libportaudio32bit'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: '_sounddevice_data/portaudio-binaries'\n        prefixes:\n          - 'libportaudio'\n      when: 'macos'\n\n- module-name: 'soundfile' # checksum: ea2aad42\n  dlls:\n    - from_filenames:\n        relative_path: '_soundfile_data'\n        prefixes:\n          - 'libsndfile*64bit'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: '_soundfile_data'\n        prefixes:\n          - 'libsndfile*32bit'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: '_soundfile_data'\n        prefixes:\n          - 'libsndfile'\n      when: 'macos'\n\n- module-name: 'sparse' # checksum: 7a56f74f\n  options:\n    checks:\n      - description: \"Numba (via sparse) is not yet working with Nuitka standalone, recommended to use '--noinclude-numba-mode'.\"\n        support_info: 'warning'\n        when: 'not use_numba and standalone'\n\n- module-name: 'speech_recognition' # checksum: 1b8b6249\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'flac-win32'\n        executable: 'yes'\n      when: 'win32'\n    - from_filenames:\n        prefixes:\n          - 'flac-linux'\n        executable: 'yes'\n      when: 'linux'\n\n- module-name: 'sphinx.util.docutils' # checksum: 6b3e2205\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        '__version_info__ = tuple(LooseVersion(docutils.__version__).version)': \"'tuple(int(d) for d in docutils.__version__.split(\\\".\\\"))'\"\n        'from distutils.version import LooseVersion': \"''\"\n\n- module-name: 'sqlalchemy' # checksum: c3efbf7\n  implicit-imports:\n    - depends:\n        - '.dialects.*'\n\n- module-name: 'sqlalchemy.dialects.mssql' # checksum: 9755bd16\n  implicit-imports:\n    - depends:\n        - 'sqlalchemy.dialects.mssql.pyodbc'\n\n- module-name: 'sqlalchemy.orm.util' # checksum: 629852fa\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'randomize_unitofwork': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'sqlalchemy.sql' # checksum: 74d06e19\n  implicit-imports:\n    - depends:\n        - 'sqlalchemy.sql.default_comparator'\n\n- module-name: 'sqlalchemy.util.preloaded' # checksum: e2f7fa57\n  implicit-imports:\n    - depends:\n        - 'sqlalchemy.orm.dependency'\n\n- module-name: 'sqlfluff' # checksum: 17fc165a\n  anti-bloat:\n    - description: 'remove pytest reference'\n      replacements_plain:\n        'import pytest': ''\n        'pytest.register_assert_rewrite(\"sqlfluff.utils.testing\")': ''\n\n- module-name: 'sqlfluff.api.simple' # checksum: 55a3b9b2\n  implicit-imports:\n    - depends:\n        - 'sqlfluff.dialects.*'\n\n- module-name: 'sqlfluff.core' # checksum: e03d34a3\n  data-files:\n    patterns:\n      - '*.cfg'\n  implicit-imports:\n    - depends:\n        - 'sqlfluff.core.plugin.*'\n        - 'sqlfluff.rules.*'\n\n- module-name: 'srsly.msgpack._packer' # checksum: ef9e3a96\n  implicit-imports:\n    - depends:\n        - 'srsly.msgpack.util'\n\n- module-name: 'statsmodels' # checksum: 9664932\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      change_function:\n        'test': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.api' # checksum: 3eb995ba\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        # TODO: Should make an un-callable object that is not just None for non-deployment.\n        'from .tools.print_version import show_versions': 'show_versions = None'\n        'from .__init__ import test': 'from . import test'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.base' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.compat' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.datasets' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.discrete' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.distributions' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.duration' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.emplike' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.formula' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.gam' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.genmod' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.genmod.families' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.graphics' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.imputation' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.iolib' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.miscmodels' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.multivariate' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.multivariate.factor_rotation' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.nonparametric' # checksum: 6e8ca713\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n  implicit-imports:\n    - depends:\n        - 'statsmodels.nonparametric.linbin'\n        - 'statsmodels.nonparametric._smoothers_lowess'\n\n- module-name: 'statsmodels.othermod' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.regression' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.robust' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.sandbox' # checksum: b4023396\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      module_code: |\n        class PytestTester:\n          def __init__(self, package_path=None):\n            pass\n        test = PytestTester()\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.stats' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.stats.libqsturng' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tools' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tsa' # checksum: ae76895b\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa._exponential_smoothers'\n\n- module-name: 'statsmodels.tsa.base' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tsa.filters' # checksum: f7235f0e\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.regime_switching._hamilton_filter'\n        - 'statsmodels.tsa.regime_switching._kim_smoother'\n\n- module-name: 'statsmodels.tsa.innovations' # checksum: 986e010e\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.innovations._arma_innovations'\n\n- module-name: 'statsmodels.tsa.interp' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tsa.kalmanf' # checksum: 84951770\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.kalmanf.kalman_loglike'\n\n- module-name: 'statsmodels.tsa.regime_switching' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tsa.statespace' # checksum: 7b4ee6b9\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.statespace._filters'\n        - 'statsmodels.tsa.statespace._initialization'\n        - 'statsmodels.tsa.statespace._kalman_filter'\n        - 'statsmodels.tsa.statespace._kalman_smoother'\n        - 'statsmodels.tsa.statespace._representation'\n        - 'statsmodels.tsa.statespace._simulation_smoother'\n        - 'statsmodels.tsa.statespace._smoothers'\n        - 'statsmodels.tsa.statespace._tools'\n\n- module-name: 'statsmodels.tsa.statespace._filters' # checksum: a38bd53f\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.statespace._filters._conventional'\n        - 'statsmodels.tsa.statespace._filters._inversions'\n        - 'statsmodels.tsa.statespace._filters._univariate'\n        - 'statsmodels.tsa.statespace._filters._univariate_diffuse'\n\n- module-name: 'statsmodels.tsa.statespace._smoothers' # checksum: 6051e02c\n  implicit-imports:\n    - depends:\n        - 'statsmodels.tsa.statespace._smoothers._alternative'\n        - 'statsmodels.tsa.statespace._smoothers._classical'\n        - 'statsmodels.tsa.statespace._smoothers._conventional'\n        - 'statsmodels.tsa.statespace._smoothers._univariate'\n        - 'statsmodels.tsa.statespace._smoothers._univariate_diffuse'\n\n- module-name: 'statsmodels.tsa.stl' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'statsmodels.tsa.vector_ar' # checksum: 29fd834d\n  anti-bloat:\n    - description: 'remove statsmodels testing framework'\n      replacements_plain:\n        'from statsmodels.tools._testing import PytestTester': 'from statsmodels.sandbox import PytestTester'\n      when: 'not use_pytest'\n\n- module-name: 'strawberry' # checksum: faf55bfc\n  data-files:\n    dirs:\n      - 'static'\n\n- module-name: 'streamlit.runtime.caching.cache_utils' # checksum: e430da94\n  anti-bloat:\n    - description: 'remove warning for compiled functions'\n      replacements_plain:\n        '_LOGGER.debug(': '('\n\n- module-name: 'sv_ttk' # checksum: da9eb9ef\n  data-files:\n    dirs:\n      - 'theme'\n    patterns:\n      - 'sv.tcl'\n\n- module-name: 'swagger_ui_bundle' # checksum: 8f17402f\n  data-files:\n    dirs:\n      - 'vendor'\n\n- module-name: 'sympy' # checksum: 246a1729\n  anti-bloat:\n    - description: 'remove sympy.testing reference'\n      replacements_plain:\n        \"'test', 'doctest',\": ''\n        'from .testing import test, doctest': ''\n      when: 'not use_pytest'\n\n- module-name: 'sympy.interactive.printing' # checksum: 712c2518\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        \"'IPython' not in modules\": 'True'\n        'import IPython': 'raise ImportError'\n        'from IPython import get_ipython': 'raise ImportError'\n        'from IPython.terminal.interactiveshell import TerminalInteractiveShell': 'raise ImportError'\n        'from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell': 'raise ImportError'\n        'from IPython.lib.latextools import latex_to_png': 'raise ImportError'\n        'from IPython.core.interactiveshell import InteractiveShell': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'sympy.interactive.session' # checksum: 1c9a5216\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'import IPython': 'raise ImportError'\n        'from IPython import get_ipython': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'sympy.utilities.decorator' # checksum: f8ef59fe\n  anti-bloat:\n    - description: 'remove sympy.testing reference'\n      replacements_plain:\n        'from sympy.testing.runtests import DependencyError, SymPyDocTests, PyTestReporter': ''\n      change_function:\n        'skiptests': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'tables' # checksum: 590cadeb\n  anti-bloat:\n    - description: 'remove tables.tests usage'\n      replacements_plain:\n        'from .tests import print_versions, test': ''\n\n- module-name: 'tables.filters' # checksum: 4cc95bab\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tables.flavor' # checksum: 4cc95bab\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tables.misc.enum' # checksum: 4cc95bab\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tables.path' # checksum: 4cc95bab\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tables.utils' # checksum: 4cc95bab\n  anti-bloat:\n    - description: 'remove docutils usage'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tenacity' # checksum: 64bd1802\n  anti-bloat:\n    # It would be nice\n    - description: 'remove tornado dependency'\n      replacements_plain:\n        'import tornado': 'raise ImportError'\n        'from tenacity.tornadoweb import TornadoRetrying': 'pass'\n      when: 'not use_tornado'\n\n- module-name: 'tensorboard' # checksum: 5e3de759\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'load_ipython_extension': \"'(lambda ipython: None)'\"\n        'notebook': \"'(lambda: None)'\"\n      when: 'not use_ipython'\n\n- module-name: 'tensorflow' # checksum: 13d6e6a5\n  dlls:\n    - from_filenames:\n        relative_path: 'core/platform'\n        prefixes:\n          - '_cpu_feature_guard'\n  anti-bloat:\n    - description: 'allow unittest inside of tensorflow, too dependent to remove'\n      bloat-mode-overrides:\n        'unittest': 'allow'\n    - description: 'remove useless distutils and test framework usage'\n      replacements_plain:\n        'import distutils as _distutils': '_distutils = None'\n        'import site as _site': '_site = None'\n        'if _running_from_pip_package()': 'if False'\n        '_site.ENABLE_USER_SITE': 'False'\n        '_site_packages_dirs += [_site.USER_SITE]': 'pass'\n        # TODO: Have \"unusable\", something that triggers a telling \"RuntimeError\" when used.\n        'from tensorflow._api.v1 import test': 'test = None'\n        'from ._api.v2 import test': 'test = None'\n        'from tensorflow._api.v2 import test': 'test = None'\n      append_plain: |\n        import sys\n        sys.modules[\"tensorflow.compat\"] = compat\n        sys.modules[\"tensorflow.experimental\"] = experimental\n        sys.modules[\"tensorflow.compat.v1\"] = compat.v1\n        sys.modules[\"tensorflow.compat.v2\"] = compat.v2\n        sys.modules[\"tensorflow.compat.v1.logging\"] = compat.v1.logging\n        sys.modules[\"tensorflow.compat.v2.experimental\"] = compat.v2.experimental\n        sys.modules[\"tensorflow.keras\"] = keras\n      when: 'standalone'\n    - description: 'remove kubernetes as default dependency'\n      no-auto-follow:\n        'kubernetes': 'tensorflow clustering with kubernetes not available'\n      when: 'standalone'\n\n  implicit-imports:\n    - depends:\n        - 'tensorboard'\n        - 'tensorflow_estimator'\n        - 'keras.api._v2.keras'\n\n  options:\n    checks:\n      - description: \"'tensorflow' is not fully supported before version 2.16\"\n        support_info: 'warning'\n        when: 'version(\"tensorflow\") < (2,16)'\n\n- module-name: 'tensorflow._api.v1.compat.v1' # checksum: 3e84bd8b\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v1.compat.v1 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v1.compat.v2' # checksum: 669a14a3\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v1.compat.v2 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.__internal__' # checksum: 92facfb8\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v2.__internal__ import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v1' # checksum: 53024ed1\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v2.compat.v1 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v1.compat.v1' # checksum: 31fdcb26\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from tensorflow._api.v2.compat.v1 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v1.compat.v2' # checksum: 69e3620e\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from tensorflow._api.v2.compat.v2 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v2' # checksum: b1ce7f9\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v2.compat.v2 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v2.__internal__' # checksum: 970797b3\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from . import test': 'test = None'\n        'from tensorflow._api.v2.compat.v2.__internal__ import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v2.compat.v1' # checksum: 31fdcb26\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from tensorflow._api.v2.compat.v1 import test': 'test = None'\n\n- module-name: 'tensorflow._api.v2.compat.v2.compat.v2' # checksum: 69e3620e\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from tensorflow._api.v2.compat.v2 import test': 'test = None'\n\n- module-name: 'tensorflow.compiler.tf2tensorrt' # checksum: d9b49de3\n  implicit-imports:\n    - depends:\n        - 'tensorflow.compiler.tf2tensorrt._wrap_py_utils'\n      when: 'not win32'\n\n- module-name: 'tensorflow.compiler.tf2tensorrt.python.ops' # checksum: f9f714ff\n  implicit-imports:\n    - depends:\n        - 'tensorflow.compiler.tf2tensorrt.python.ops.libtftrt'\n      when: 'not win32'\n\n- module-name: 'tensorflow.compiler.tf2xla.ops' # checksum: 43cd50f5\n  implicit-imports:\n    - depends:\n        - 'tensorflow.compiler.tf2xla.ops._xla_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib' # checksum: e2ec935f\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'from tensorflow.contrib import testing': 'testing=None'\n      when: 'not use_unittest'\n\n- module-name: 'tensorflow.contrib.bigtable.python.ops' # checksum: 549b8309\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.bigtable.python.ops._bigtable'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.boosted_trees.python.ops' # checksum: 7bbc7f0\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.boosted_trees.python.ops._boosted_trees_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.factorization.python.ops.factorization_ops' # checksum: 4ea2083\n  dlls:\n    - from_filenames:\n        prefixes:\n          - '_factorization_ops'\n\n- module-name: 'tensorflow.contrib.factorization.python.opso' # checksum: 280169f9\n  implicit-imports:\n    - depends:\n        - 'tensorflw.contrib.factorization.python.ops._factorization_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.ffmpeg' # checksum: 92e98eca\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.ffmpeg.ffmpeg'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.framework.python.ops' # checksum: baeae338\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.framework.python.ops._variable_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.fused_conv.python.ops' # checksum: 9eb93fc7\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.fused_conv.python.ops._fused_conv2d_bias_activation_op'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.hadoop' # checksum: 651d6357\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.hadoop._dataset_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.ignite' # checksum: ee2d74ad\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.ignite._ignite_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.image.python.ops' # checksum: e180afc5\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.image.python.ops._distort_image_ops'\n        - 'tensorflow.contrib.image.python.ops._image_ops'\n        - 'tensorflow.contrib.image.python.ops._single_image_random_dot_stereograms'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.input_pipeline.python.ops' # checksum: ee4d7566\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.input_pipeline.python.ops._input_pipeline_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.kafka' # checksum: b4138bd7\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.kafka._dataset_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.kinesis' # checksum: 42f2ac20\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.kinesis._dataset_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.layers.python.ops' # checksum: 74ec77d5\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.layers.python.ops._sparse_feature_cross_op'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.libsvm.python.ops' # checksum: cd37a313\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.libsvm.python.ops._libsvm_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.memory_stats.python.ops' # checksum: df529e66\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.memory_stats.python.ops._memory_stats_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.nearest_neighbor.python.ops' # checksum: 8fc80318\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.nearest_neighbor.python.ops._nearest_neighbor_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.periodic_resample.python.ops' # checksum: 667ca39b\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.periodic_resample.python.ops._periodic_resample_op'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.reduce_slice_ops.python.ops' # checksum: 90556f44\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.reduce_slice_ops.python.ops._reduce_slice_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.resampler.python.ops' # checksum: 12b7cc7a\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.resampler.python.ops._resampler_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.rnn.python.ops' # checksum: a7b9da5d\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.rnn.python.ops._gru_ops'\n        - 'tensorflow.contrib.rnn.python.ops._lstm_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.rpc.python.kernel_tests' # checksum: 1805430\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.rpc.python.kernel_tests.libtestexample'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.seq2seq.python.ops' # checksum: aac3a043\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.seq2seq.python.ops._beam_search_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.tensor_forest' # checksum: f1216a35\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.tensor_forest.libforestprotos'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.tensor_forest.hybrid.python.ops' # checksum: 615056ec\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.tensor_forest.hybrid.python.ops._training.ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.tensor_forest.python.ops' # checksum: 24df0a8d\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.tensor_forest.python.ops._model_ops'\n        - 'tensorflow.contrib.tensor_forest.python.ops._stats_ops'\n        - 'tensorflow.contrib.tensor_forest.python.ops._tensor_forest_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.contrib.text.python.ops' # checksum: 1ceed33b\n  implicit-imports:\n    - depends:\n        - 'tensorflow.contrib.text.python.ops._skip_gram_ops'\n      when: 'not win32'\n\n- module-name: 'tensorflow.include.external.protobuf_archive.python.google.protobuf.internal' # checksum: aa796e3d\n  implicit-imports:\n    - depends:\n        - 'tensorflow.include.external.protobuf_archive.python.google.protobuf.internal._api_implementation'\n      when: 'not win32'\n\n- module-name: 'tensorflow.include.external.protobuf_archive.python.google.protobuf.pyext' # checksum: 654de2d1\n  implicit-imports:\n    - depends:\n        - 'tensorflow.include.external.protobuf_archive.python.google.protobuf.pyext._message'\n      when: 'not win32'\n\n- module-name: 'tensorflow.lite.experimental.microfrontend.python.ops.audio_microfrontend_op' # checksum: 78612df0\n  dlls:\n    - from_filenames:\n        prefixes:\n          - '_audio_microfrontend_op'\n\n# TODO: Maybe not really necessary, this should be avoided by itself instead.\n- module-name: 'tensorflow.lite.python.convert' # checksum: 83de5047\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'distutils.spawn.find_executable(_deprecated_conversion_binary) is None': \"'False'\"\n        'import distutils.spawn': ''\n\n- module-name: 'tensorflow.lite.python.interpreter_wrapper' # checksum: 6742ae49\n  implicit-imports:\n    - depends:\n        - 'tensorflow.lite.python.interpreter_wrapper._tensorflow_wrap_interpreter_wrapper'\n\n- module-name: 'tensorflow.lite.python.optimize' # checksum: 9dbd14ab\n  implicit-imports:\n    - depends:\n        - 'tensorflow.lite.python.optimize._tensorflow_lite_wrap_calibration_wrapper'\n\n- module-name: 'tensorflow.lite.toco.python' # checksum: 20ccf7c9\n  implicit-imports:\n    - depends:\n        - 'tensorflow.lite.toco.python._tensorflow_wrap_toco'\n\n- module-name: 'tensorflow.python' # checksum: a6d5f88\n  anti-bloat:\n    - description: 'remove useless tensorflow testing usage'\n      replacements_plain:\n        'from tensorflow.python.platform import test': 'test = None'\n  implicit-imports:\n    - depends:\n        - 'tensorflow.python._pywrap_tensorflow_internal'\n        - 'tensorflow.python.ops'\n        - 'tensorflow.python.ops.cond_v2'\n\n- module-name: 'tensorflow.python.autograph.core.ag_ctx' # checksum: 680413fa\n  anti-bloat:\n    - description: 'remove useless no-source warning'\n      replacements_plain:\n        'ag_logging.warning(': 'if False: ag_logging.warning('\n\n- module-name: 'tensorflow.python.autograph.pyct.inspect_utils' # checksum: 791d410a\n  anti-bloat:\n    - description: 'workaround to enable Tensorflow JIT support'\n      append_plain: |\n        orig_getimmediatesource = getimmediatesource\n        def getimmediatesource(obj):\n          module_name = getattr(obj, '__module__', None)\n          if module_name:\n            qualname = getattr(obj, '__qualname__', None)\n\n            _uncompiled_function_sources_dict=getattr(\n              builtins,\n              \"_uncompiled_function_sources_dict\",\n              {}\n            )\n            key = \"%s.%s\" % (module_name, qualname)\n            source, line_number = _uncompiled_function_sources_dict.get(key, (None, None))\n\n            if source is not None:\n              return source\n\n          return orig_getimmediatesource(obj)\n      when: 'standalone'\n\n- module-name: 'tensorflow.python.compiler.tensorrt.trt_convert' # checksum: 9471824c\n  implicit-imports:\n    - depends:\n        - 'tensorflow.compiler.tf2tensorrt.ops.gen_trt_ops'\n        - 'tensorflow.compiler.tf2tensorrt._pywrap_py_utils'\n\n- module-name: 'tensorflow.python.compiler.tensorrt.utils' # checksum: 356eeadf\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements_plain:\n        'distutils_version.LooseVersion': 'str'\n        ? \"from distutils import version\\n\"\n        : \"\\n\"\n        'from distutils import version as distutils_version': ''\n\n- module-name: 'tensorflow.python.data.ops.dataset_ops' # checksum: 1077d47d\n  implicit-imports:\n    - depends:\n        - 'tensorflow.python.data.ops.shuffle_op'\n\n- module-name: 'tensorflow.python.framework' # checksum: 98664efa\n  implicit-imports:\n    - depends:\n        - 'tensorflow.python.framework.fast_tensor_util'\n      when: 'not win32'\n\n- module-name: 'tensorflow.python.framework.dtypes' # checksum: 25144a68\n  implicit-imports:\n    - depends:\n        - 'ml_dtypes'\n\n- module-name: 'tensorflow.python.framework.meta_graph' # checksum: b0a05a68\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'distutils_version.LooseVersion': \"'str'\"\n        'from distutils import version as distutils_version': ''\n\n- module-name: 'tensorflow.python.keras.utils.vis_utils' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'tensorflow.python.ops.distributions.distribution' # checksum: 2f12fb17\n  anti-bloat:\n    - description: 'remove useless function copying'\n      replacements:\n        'class_attr_value.__doc__ = _update_docstring': \"'class_attr_value___doc__ = _update_docstring'\"\n      change_function:\n        '_copy_fn': \"'(lambda fn: fn)'\"\n\n- module-name: 'tensorflow.python.util.lazy_loader' # checksum: d4c83239\n  anti-bloat:\n    - description: 'reduce keras usage'\n      replacements:\n        'os.environ.get(\"TF_USE_LEGACY_KERAS\", None)': 'repr(os.environ.get(\"TF_USE_LEGACY_KERAS\", None))'\n        'keras.__version__': 'repr(version_str(\"keras\"))'\n\n- module-name: 'tensorflow.python.util.tf_inspect' # checksum: 8e3a3cbf\n  anti-bloat:\n    - description: 'workaround to enable Tensorflow JIT support'\n      append_plain: |\n        import builtins\n        orig_getsourcelines = getsourcelines\n        def getsourcelines(object):\n          module_name = getattr(object, '__module__', None)\n          if module_name:\n            qualname = getattr(object, '__qualname__', None)\n\n            _uncompiled_function_sources_dict=getattr(\n              builtins,\n              \"_uncompiled_function_sources_dict\",\n              {}\n            )\n            key = \"%s.%s\" % (module_name, qualname)\n            source, line_number = _uncompiled_function_sources_dict.get(key, (None, None))\n\n            if source is not None:\n              return source.splitlines(), line_number\n\n          return orig_getsourcelines(obj)\n      when: 'standalone'\n\n- module-name: 'tensorflow_core' # checksum: f377875c\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements:\n        'import distutils as _distutils': \"'_distutils = None'\"\n        'import site as _site': \"'_site = None'\"\n        'if _running_from_pip_package()': \"'if False'\"\n\n- module-name: 'tensorflow_probability.python' # checksum: 33557ce7\n  anti-bloat:\n    - description: 'remove useless distutils usage'\n      replacements_plain:\n        'distutils.version.LooseVersion': ''\n        'import distutils.version': ''\n  implicit-imports:\n    - depends:\n        - 'tensorflow_probability.python.experimental'\n\n- module-name: 'tensorflow_probability.python.bijectors.glow' # checksum: 44c3c53b\n  implicit-imports:\n    - depends:\n        - 'keras.api._v2'\n\n- module-name: 'tensorrt_libs' # checksum: cb30dde5\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libnv'\n      dest_path: '.'\n\n- module-name: 'text_unidecode' # checksum: e24d920b\n  data-files:\n    patterns:\n      - 'data.bin'\n\n- module-name: 'textual' # checksum: c965c84e\n  implicit-imports:\n    - depends:\n        - 'pygments.lexers.css'\n\n- module-name: 'textual.widgets' # checksum: a98bfa19\n  implicit-imports:\n    - depends:\n        - '._*'\n\n- module-name: 'tf_keras.src' # checksum: 9760fd72\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'from keras.src.testing_infra import test_utils': 'test_utils = None'\n      when: 'not use_unittest'\n\n- module-name: 'tf_keras.src.utils.vis_utils' # checksum: 7d07a2d1\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'thinc.backends.cblas' # checksum: 53774cbb\n  implicit-imports:\n    - depends:\n        - 'blis'\n\n- module-name: 'tifffile.tifffile' # checksum: 9838c964\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': 'un-callable'\n\n- module-name: 'tiktoken.registry' # checksum: 6350df24\n  implicit-imports:\n    - depends:\n        - 'tiktoken_ext.*'\n\n- module-name: 'timm.models.hrnet' # checksum: fdbe0e63\n  anti-bloat:\n    - replacements_plain:\n        '@torch.jit.interface': ''\n\n- module-name: 'timm.models.layers.config' # checksum: cc2107ee\n  anti-bloat:\n    - description: 'remove torchscript JIT usage'\n      replacements_plain:\n        '_NO_JIT = False': '_NO_JIT = True'\n        '_NO_ACTIVATION_JIT = False': '_NO_ACTIVATION_JIT = True'\n\n- module-name: 'tinycss2' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'tkextrafont' # checksum: 1bd90a67\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libextrafont'\n      when: 'win32'\n\n- module-name: 'tkinterweb' # checksum: e9dd14cc\n  data-files:\n    dirs:\n      - 'tkhtml'\n\n  dlls:\n    - from_filenames:\n        relative_path: 'tkhtml/Windows/32-bit'\n        prefixes:\n          - 'Tkhtml'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'tkhtml/Windows/64-bit'\n        prefixes:\n          - 'Tkhtml'\n      when: 'win32 and arch_amd64'\n\n  anti-bloat:\n    - description: 'remove \"sys.path\" hack'\n      replacements_plain:\n        'sys.path.append': ''\n  import-hacks:\n    - global-sys-path:\n        # This package forces itself into \"sys.path\" and expects absolute\n        # imports to be available.\n        - ''\n\n- module-name: 'tls_client.cffi' # checksum: 97b24774\n  dlls:\n    - by_code:\n        setup_code: 'import tls_client.cffi'\n        filename_code: 'tls_client.cffi.library._name'\n      dest_path: 'tls_client/dependencies'\n\n- module-name: 'toga' # checksum: 575aecbd\n  data-files:\n    include-metadata:\n      - 'toga-core'\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      no-auto-follow:\n        'setuptools_scm': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'toga.platform' # checksum: 4db91cac\n  variables:\n    setup_code: 'import toga.platform'\n    declarations:\n      'toga_backend_module_name': 'toga.platform.get_platform_factory().__name__'\n  anti-bloat:\n    - change_function:\n        'get_platform_factory': \"'importlib.import_module(%r)' % get_variable('toga_backend_module_name')\"\n\n- module-name: 'toga_gtk' # checksum: 3f9f0b7d\n  data-files:\n    dirs:\n      - 'resources'\n\n- module-name: 'toga_winforms' # checksum: 5dda2bcf\n  data-files:\n    dirs:\n      - 'resources'\n    include-metadata:\n      - 'toga-winforms'\n  dlls:\n    - from_filenames:\n        relative_path: 'libs/WebView2/arm64'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_arm64'\n    - from_filenames:\n        relative_path: 'libs/WebView2/x86'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'libs/WebView2/x64'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_amd64'\n\n    - from_filenames:\n        relative_path: 'libs/WebView2'\n        prefixes:\n          - 'Microsoft.'\n      when: 'win32'\n  implicit-imports:\n    - depends:\n        - 'toga_winforms.libs.wrapper'\n        - 'ctypes.wintypes'\n\n- module-name: 'tokenizers.tools.visualizer' # checksum: afab16ac\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from IPython.core.display import HTML, display': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'torch' # checksum: 5dee33ed\n  parameters:\n    - 'name': 'disable-jit'\n      'values': 'value in (\"yes\", \"no\")'\n  data-files:\n    dirs:\n      - 'bin'\n      - 'include'\n    patterns:\n      - 'bin/*.h'\n  dlls:\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - ''\n  anti-bloat:\n    - description: 'allow unittest inside of torch, too dependent to remove'\n      bloat-mode-overrides:\n        'unittest': 'allow'\n      when: 'not use_unittest'\n    - description: 'remove setuptools usage via triton'\n      no-auto-follow:\n        'triton': 'ignore'\n      when: 'not use_setuptools'\n    - description: 'remove numba reference'\n      no-auto-follow:\n        'numba': 'ignore'\n      when: 'not use_numba and standalone'\n\n  options:\n    checks:\n      - description: \"Torch JIT is disabled by default in standalone mode, make a choice explicit with '--module-parameter=torch-disable-jit=yes|no'\"\n        support_info: 'parameter'\n        when: 'standalone and get_parameter(\"disable-jit\", None) is None'\n  import-hacks:\n    - force-environment-variables:\n        'PYTORCH_JIT': '0'\n      when: 'get_parameter(\"disable-jit\", \"yes\" if standalone else \"no\") == \"yes\"'\n\n- module-name: 'torch._dynamo.skipfiles' # checksum: 120e0012\n  anti-bloat:\n    # When calling inspect.getfile() on Nuitka's loader, it will yield\n    # \"__module__\" as \"__nuitka__\" but that's not in \"sys.modules\" and won't\n    # have a \"__file__\" value, so make sure to ignore it.\n    - description: \"work around our '__loader__' failing check\"\n      replacements_plain:\n        'if inspect.isclass(obj)': 'if inspect.isclass(obj) and obj is not __loader__'\n\n- module-name: 'torch._dynamo.variables.builder' # checksum: 6ef7624b\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'has_triton()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.codecache' # checksum: bb14e715\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from torch.utils import cpp_extension': ''\n      change_function:\n        'get_include_and_linking_paths': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.codegen.common' # checksum: 5d438f8d\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from .cpp import DTYPE_TO_CPP, INDEX_TYPE': 'raise ImportError'\n        'from .cpp import DTYPE_TO_CPP': 'raise ImportError'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.coordinate_descent_tuner' # checksum: 3a49d1a\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'if has_triton()': 'if False'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.decomposition' # checksum: 54e7450c\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      change_function:\n        'should_pad_bench': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.graph' # checksum: a09372f0\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from .codegen.wrapper import CppWrapperCodeGen, WrapperCodeGen': ''\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.ir' # checksum: f4ea1725\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from torch._inductor.codegen.wrapper import CppWrapperCodeGen': 'raise ImportError'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.scheduler' # checksum: 78900add\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from .codegen.wrapper import buffer_reuse_key': 'raise ImportError'\n        'from .codegen.cpp import CppScheduling': 'raise ImportError'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.sizevars' # checksum: bc71cf2e\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        # This could actually be done, by creating the \"PythonPrinter().doprint\"\n        # locally\n        'from .codegen.wrapper import pexpr': 'raise ImportError'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.triton_heuristics' # checksum: 3a49d1a\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'if has_triton()': 'if False'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.triton_ops.autotune' # checksum: f3c779b5\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from ..codecache import cache_dir': ''\n        'cache_dir()': '__nuitka_binary_dir, \".cache\"'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.triton_ops.conv' # checksum: 6185b84c\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'has_triton()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.triton_ops.conv1x1' # checksum: 6185b84c\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'has_triton()': 'False'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._inductor.utils' # checksum: 7dd0005\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'if _has_triton()': 'if False'\n      change_function:\n        'has_triton': \"'(lambda: False)'\"\n        'do_bench': 'un-callable'\n        'get_device_tflops': 'un-callable'\n        'get_gpu_dram_gbps': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'torch._jit_internal' # checksum: f49ee799\n  anti-bloat:\n    - description: 'disable jit warnings'\n      replacements_plain:\n        'warnings.warn(': 'if False: warnings.warn('\n\n- module-name: 'torch.fx._symbolic_trace' # checksum: d4866b6d\n  anti-bloat:\n    - description: 'workaround incompatible check'\n      replacements_plain:\n        \"f.f_code.co_name != '<module>'\": \"not f.f_code.co_name.startswith('<module')\"\n        'f.f_code.co_name != \"<module>\"': \"not f.f_code.co_name.startswith('<module')\"\n\n- module-name: 'torch.onnx.symbolic_registry' # checksum: 836242c\n  implicit-imports:\n    - depends:\n        - 'torch.onnx.symbolic_opset7'\n        - 'torch.onnx.symbolic_opset12'\n        - 'torch.onnx.symbolic_opset14'\n        - 'torch.onnx.symbolic_opset15'\n\n- module-name: 'torch.sparse._triton_ops' # checksum: 8eb5107d\n  anti-bloat:\n    - description: 'remove setuptools usage via triton'\n      replacements_plain:\n        'if _has_triton()': 'if False'\n        'if has_triton()': 'if False'\n      change_function:\n        '_has_triton': \"'(lambda: False)'\"\n      when: 'not use_setuptools'\n\n- module-name: 'torch.testing._internal.common_utils' # checksum: c0669cf\n  anti-bloat:\n    - description: 'remove pytest reference'\n      change_function:\n        'run_tests': 'un-callable'\n        'get_pytest_test_cases': 'un-callable'\n      when: 'not use_pytest'\n\n- module-name: 'torch.utils._config_module' # checksum: 95196bd9\n  constants:\n    declarations:\n      'torch_config_module_candidates': '[m for m in iterate_modules(\"torch\") if m.split(\".\")[-1] in (\"config\", \"_config\")]'\n  variables:\n    setup_code: 'import importlib'\n    declarations:\n      'torch_config_modules': 'dict((m,importlib.import_module(m)._compile_ignored_keys) for m in torch_config_module_candidates if hasattr(importlib.import_module(m), \"_compile_ignored_keys\"))'\n\n  anti-bloat:\n    - description: 'workaround for torch config modules'\n      append_result: |\n        \"\"\"_static_compile_ignored_keys = %s\n\n        def get_assignments_with_compile_ignored_comments(module):\n          return _static_compile_ignored_keys[module.__name__]\n        \"\"\" % repr(get_variable(\"torch_config_modules\"))\n\n- module-name: 'torch.utils.data._typing' # checksum: f6ea0eb5\n  anti-bloat:\n    - description: 'compatibility workaround'\n      replacements_plain:\n        ? \"\\ndef _dp_init_subclass\"\n        : |-\n          @classmethod\n          def _dp_init_subclass\n\n- module-name: 'torch_scatter' # checksum: 81d9f6ec\n  anti-bloat:\n    - description: 'workaround finding DLLs as modules by wrong names'\n      replacements_plain:\n        \"f'{library}_cuda', [osp.dirname(__file__)]\": \"f'torch_scatter.{library}_cuda'\"\n        \"f'{library}_cpu', [osp.dirname(__file__)]\": \"f'torch_scatter.{library}_cpu'\"\n        'importlib.machinery.PathFinder()': 'importlib.util'\n  implicit-imports:\n    - depends:\n        - '._version_cpu'\n        - '._scatter_cpu'\n        - '._segment_csr_cpu'\n        - '._segment_coo_cpu'\n        - '._version_cuda'\n        - '._scatter_cuda'\n        - '._segment_csr_cuda'\n        - '._segment_coo_cuda'\n\n- module-name: 'torchaudio' # checksum: e38b176e\n  import-hacks:\n    - find-dlls-near-module:\n        - 'torch'\n    - acceptable-missing-dlls:\n        - '_torchaudio_ffmpeg'\n\n- module-name: 'torchaudio.lib._torchaudio' # checksum: 7b940206\n  implicit-imports:\n    - depends:\n        - 'torchaudio.lib.libtorchaudio'\n\n- module-name: 'torchmetrics.utilities.checks' # checksum: b4f61938\n  anti-bloat:\n    - description: 'remove unittest reference'\n      replacements_plain:\n        'from unittest.mock import Mock': ''\n        'isinstance(instance_attr, Mock)': 'False'\n\n- module-name: 'torchvision' # checksum: 32aa7aff\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'zlib'\n          - 'libjpeg'\n          - 'libpng*'\n\n- module-name: 'torchvision.extension' # checksum: 9de523e5\n  implicit-imports:\n    - depends:\n        # This is really only a DLL, but named according to extension module rules.\n        - '._C'\n\n- module-name: 'torchvision.io.image' # checksum: 2f2fb05c\n  implicit-imports:\n    - depends:\n        - 'torchvision.image'\n\n- module-name: 'torchvision.ops._register_onnx_ops' # checksum: a35b139f\n  implicit-imports:\n    - depends:\n        - 'torch.onnx.symbolic_opset8'\n\n- module-name: 'tornado.httputil' # checksum: 4d59551a\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        'doctests': \"'(lambda: None)'\"\n\n- module-name: 'tornado.iostream' # checksum: 4d59551a\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        'doctests': \"'(lambda: None)'\"\n\n- module-name: 'tornado.util' # checksum: 4d59551a\n  anti-bloat:\n    - description: 'remove doctest usage'\n      change_function:\n        'doctests': \"'(lambda: None)'\"\n\n- module-name: 'tqdm' # checksum: dac19097\n  anti-bloat:\n    - description: 'remove IPython reference'\n      change_function:\n        'tnrange': \"'(lambda *args, **kwargs: None)'\"\n        'tqdm_notebook': \"'(lambda *args, **kwargs: None)'\"\n      when: 'not use_ipython'\n\n- module-name: 'tqdm.autonotebook' # checksum: 6ac095cb\n  anti-bloat:\n    - description: 'remove IPython reference'\n      module_code: \"from .std import tqdm, trange\\n\"\n      when: 'not use_ipython'\n\n- module-name: 'tqdm.std' # checksum: 2e350129\n  anti-bloat:\n    - no-auto-follow:\n        'pandas': 'ignore'\n\n- module-name: 'tqdm.version' # checksum: 6b612ba4\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'setuptools_scm': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'tracerite' # checksum: 6fffa63e\n  data-files:\n    patterns:\n      - '*.css'\n\n- module-name: 'transformers' # checksum: a442ab87\n  data-files:\n    include-metadata:\n      - 'accelerate'\n      - 'bitsandbytes'\n      - 'datasets'\n      - 'flax'\n      - 'ftfy'\n      - 'jinja2'\n      - 'pandas'\n      - 'peft'\n      - 'psutil'\n      - 'tensorflow'\n      - 'torch'\n      - 'tokenizers'\n      - 'torchvision'\n      - 'scipy'\n      - 'safetensors'\n      - 'sentencepiece'\n      - 'timm'\n      - 'openai'\n\n  anti-bloat:\n    - description: 'remove IPython reference'\n      no-auto-follow:\n        'IPython': 'ignore'\n      when: 'not use_ipython'\n\n- module-name: 'transformers.integrations' # checksum: ccb3fd3\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'from transformers.utils.notebook import NotebookProgressCallback': 'raise ImportError'\n      when: 'not use_ipython'\n\n- module-name: 'transformers.models.auto.configuration_auto' # checksum: d40efb44\n  anti-bloat:\n    - description: 'remove docstring dependency'\n      change_function:\n        'docstring_decorator': \"'(lambda fn: fn)'\"\n      when: 'no_docstrings'\n\n- module-name: 'transformers.models.deformable_detr.load_custom' # checksum: baab8e6b\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_cuda_kernels': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.deformable_detr.modeling_deformable_detr' # checksum: baab8e6b\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_cuda_kernels': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.deta.modeling_deta' # checksum: baab8e6b\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_cuda_kernels': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.mra.modeling_mra' # checksum: a554c6d\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      replacements_plain:\n        'from torch.utils.cpp_extension import load': ''\n      change_function:\n        'load_cuda_kernels': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.rwkv.modeling_rwkv' # checksum: f186b69e\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_wkv_cuda_kernel': \"'(lambda : None)'\"\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.yoso.modeling_deta' # checksum: baab8e6b\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_cuda_kernels': 'un-callable'\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.models.yoso.modeling_yoso' # checksum: 7f1a78b7\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      change_function:\n        'load_cuda_kernels': \"'(lambda : False)'\"\n      when: 'not use_setuptools'\n\n- module-name: 'transformers.processing_utils' # checksum: cdb3f70d\n  anti-bloat:\n    - description: 'workaround manual import issue'\n      replacements_plain:\n        'transformers_module = direct_transformers_import(Path(__file__).parent)': 'import transformers as transformers_module'\n\n- module-name: 'transformers.trainer' # checksum: f71d17eb\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'is_in_notebook()': 'False'\n      when: 'not use_ipython'\n\n- module-name: 'transformers.utils.doc' # checksum: e7a27fa2\n  anti-bloat:\n    - description: 'add support for compiled functions'\n      append_plain: |\n        def copy_func(f):\n            try:\n                g = f.clone()\n            except AttributeError:\n                g = types.FunctionType(f.__code__, f.__globals__, name=f.__name__, argdefs=f.__defaults__, closure=f.__closure__)\n                g = functools.update_wrapper(g, f)\n                g.__kwdefaults__ = f.__kwdefaults__\n\n            return g\n    - description: 'remove docstring dependency'\n      change_function:\n        '_prepare_output_docstrings': \"'(lambda *args, **kwargs: str())'\"\n        'docstring_decorator': \"'(lambda fn: fn)'\"\n      when: 'no_docstrings'\n\n- module-name: 'transformers.utils.hub' # checksum: 81f43bda\n  implicit-imports:\n    - depends:\n        - 'huggingface_hub.hf_api'\n\n- module-name: 'transformers.utils.import_utils' # checksum: 705fafc4\n  anti-bloat:\n    - description: 'workaround for metadata checks not recognized'\n      replacements_plain:\n        'from .versions import importlib_metadata': 'import importlib.metadata as importlib_metadata'\n      when: 'python38_or_higher'\n    - description: 'workaround for metadata checks not recognized'\n      replacements_plain:\n        'from .versions import importlib_metadata': 'import importlib_metadata'\n      when: 'before_python38'\n    - description: 'workaround for tensorflow checks preventing pytorch usage'\n      replacements_plain:\n        'importlib.util.find_spec(\"tensorflow\") is not None': 'False'\n    - description: 'more clear missing metadata error message'\n      replacements_plain:\n        'package_exists = False': \"sys.exit('''Nuitka: Need to use this as an option to compile with '--include-distribution-metadata=%s'.''' % pkg_name)\"\n      when: 'not deployment'\n\n- module-name: 'transformers.utils.versions' # checksum: 7a77f5b1\n  anti-bloat:\n    - description: 'disable runtime metadata check for core dependencies'\n      change_function:\n        # TODO: Forcing inline of this will be better solution.\n        'require_version_core': \"'(lambda requirement: None)'\"\n\n- module-name: 'travertino' # checksum: 9da51f71\n  anti-bloat:\n    - description: 'remove setuptools usage'\n      no-auto-follow:\n        'setuptools_scm': 'ignore'\n      when: 'not use_setuptools'\n\n- module-name: 'trimesh.viewer.notebook' # checksum: d055e332\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        'ipy = get_ipython()': 'raise ImportError'\n      change_function:\n        'scene_to_notebook': 'un-callable'\n      when: 'not use_ipython'\n\n- module-name: 'trimesh.viewer.windowed' # checksum: 8dcf1242\n  anti-bloat:\n    - description: 'remove IPython reference (used for profiling)'\n      replacements_plain:\n        'if self._profile:': 'if False:'\n      when: 'not use_ipython'\n\n- module-name: 'trimesh.voxel.ops' # checksum: 73918e24\n  anti-bloat:\n    - description: 'remove numba reference'\n      change_function:\n        'boolean_sparse': 'un-callable'\n      when: 'not use_numba'\n\n- module-name: 'trio._core._ki' # checksum: 40560a43\n  anti-bloat:\n    - description: 'workaround for trio compatibility'\n      # The only incompatibility in Trio is the way it handles KeyboardInterrupt exceptions (ctrl+C):\n      # https://github.com/Nuitka/Nuitka/issues/561\n      # https://github.com/python-trio/trio/issues/1752\n      # It does this to ensure that Trio's internal data structures stay consistent and that the\n      # `finally` blocks in suspended coroutines are all run:\n      # https://vorpus.org/blog/control-c-handling-in-python-and-trio/\n      # So, be warned, when this plugin is enabled, your Trio code may not behave as expected when the\n      # user hits CTRL+C. One option to cope with this is to run your Trio code in a separate thread,\n      # listen for it in the main thread (with a try/except block), then notify the Trio thread to\n      # shutdown (e.g. with `trio_token.run_sync_soon(cancel_scope.cancel())`).\n      append_plain: |\n        def enable_ki_protection(fn):\n          return fn\n        def disable_ki_protection(fn):\n          return fn\n  options:\n    checks:\n      - description: \"Disabled careful handling of KeyboardInterrupt in 'trio'\"\n        support_info: 'info'\n\n- module-name: 'trio._core._multierror' # checksum: 15c0e7fc\n  anti-bloat:\n    - description: 'remove IPython reference'\n      replacements_plain:\n        '\"IPython\" in sys.modules': 'False'\n      when: 'not use_ipython'\n\n- module-name: 'trio._core._run' # checksum: 44a998aa\n  anti-bloat:\n    - description: 'workaround for trio compatibility'\n      replacements_plain:\n        'coro.cr_frame.f_locals.setdefault(LOCALS_KEY_KI_PROTECTION_ENABLED, system_task)': ''\n\n- module-name: 'tsfresh.feature_extraction.data' # checksum: 59682295\n  anti-bloat:\n    - description: 'remove dask reference via distributed module'\n      replacements_plain:\n        'from dask import dataframe as dd': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'tsfresh.feature_extraction.feature_calculators' # checksum: e0796376\n  anti-bloat:\n    - description: 'remove numba reference via stumpy module'\n      replacements_plain:\n        'import stumpy': ''\n      when: 'not use_numba'\n\n- module-name: 'tsfresh.utilities.distribution' # checksum: e497e012\n  anti-bloat:\n    - description: 'remove dask reference via distributed module'\n      replacements_plain:\n        'from distributed import Client, LocalCluster': 'raise ImportError'\n        'from distributed import Client': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'twofish' # checksum: c8ae9b1e\n  implicit-imports:\n    - depends:\n        - '_twofish'\n\n- module-name: 'tzdata' # checksum: dae3c0e3\n  data-files:\n    dirs:\n      - 'zones'\n\n- module-name: 'tzdata.zoneinfo' # checksum: 2cc2c86f\n  data-files:\n    dirs:\n      - '.'\n\n  implicit-imports:\n    - depends:\n        - '.*'\n\n- module-name: 'unstructured' # checksum: daba5bfa\n  data-files:\n    patterns:\n      - 'nlp/english-words.txt'\n\n- module-name: 'urllib3' # checksum: aed85e8e\n  implicit-imports:\n    - depends:\n        - 'urllib3'\n        - 'urllib3._collections'\n        - 'urllib3.connection'\n        - 'urllib3.connection.appengine'\n        - 'urllib3.connectionpool'\n        - 'urllib3.contrib'\n        - 'urllib3.contrib.appengine'\n        - 'urllib3.exceptions'\n        - 'urllib3.fields'\n        - 'urllib3.filepost'\n        - 'urllib3.packages'\n        - 'urllib3.packages.six'\n        - 'urllib3.packages.ssl_match_hostname'\n        - 'urllib3.poolmanager'\n        - 'urllib3.request'\n        - 'urllib3.response'\n        - 'urllib3.util'\n        - 'urllib3.util.connection'\n        - 'urllib3.util.queue'\n        - 'urllib3.util.request'\n        - 'urllib3.util.response'\n        - 'urllib3.util.retry'\n        - 'urllib3.util.ssl_'\n        - 'urllib3.util.timeout'\n        - 'urllib3.util.url'\n        - 'urllib3.util.wait'\n        - 'urllib.error'\n        - 'urllib.parse'\n        - 'urllib.request'\n        - 'urllib.response'\n\n- module-name: 'urllib3.packages.six' # checksum: e62bccb7\n  implicit-imports:\n    - depends:\n        - 'queue'\n\n- module-name: 'uvicorn' # checksum: e24c61dd\n  implicit-imports:\n    - depends:\n        - 'uvicorn.loops'\n        - 'uvicorn.lifespan'\n        - 'uvicorn.protocols'\n\n- module-name: 'uvicorn.config' # checksum: 243a5175\n  implicit-imports:\n    - depends:\n        - 'websockets.legacy.server'\n        - 'uvicorn.logging'\n\n- module-name: 'uvicorn.importer' # checksum: ada37bba\n  anti-bloat:\n    - description: 'better error message for string imports'\n      replacements_plain:\n        'Could not import module \"{module_str}\"': 'Nuitka: Could not import module \"{module_str}\" use \"--include-module={module_str}\" option during compilation'\n      when: 'not deployment'\n\n- module-name: 'uvicorn.lifespan' # checksum: f7b81412\n  implicit-imports:\n    - depends:\n        - 'uvicorn.lifespan.off'\n        - 'uvicorn.lifespan.on'\n\n- module-name: 'uvicorn.loops' # checksum: bf1f093c\n  implicit-imports:\n    - depends:\n        - 'uvicorn.loops.auto'\n        - 'uvicorn.loops.uvloop'\n\n- module-name: 'uvicorn.protocols' # checksum: 77f78781\n  implicit-imports:\n    - depends:\n        - 'uvicorn.protocols.http'\n        - 'uvicorn.protocols.websockets'\n\n- module-name: 'uvicorn.protocols.http' # checksum: e25f6bce\n  implicit-imports:\n    - depends:\n        - 'uvicorn.protocols.http.auto'\n        - 'uvicorn.protocols.http.h11_impl'\n        - 'uvicorn.protocols.http.httptools_impl'\n\n- module-name: 'uvicorn.protocols.websockets' # checksum: 561c2732\n  implicit-imports:\n    - depends:\n        - 'uvicorn.protocols.websockets.auto'\n        - 'uvicorn.protocols.websockets.websockets_impl'\n        - 'uvicorn.protocols.websockets.wsproto_impl'\n\n- module-name: 'uvloop.loop' # checksum: d4d134f3\n  implicit-imports:\n    - depends:\n        - 'uvloop._noop'\n\n- module-name: 'vedo' # checksum: 2c2a9970\n  data-files:\n    dirs:\n      - 'fonts'\n\n- module-name: 'vibora' # checksum: 3e4e581a\n  anti-bloat:\n    - description: 'remove test code'\n      replacements_plain:\n        'from .tests import *': ''\n\n- module-name: 'vibora.protocol.cprotocol' # checksum: 9b7c23b0\n  implicit-imports:\n    - depends:\n        - 'vibora.protocol.cwebsocket'\n\n- module-name: 'vibora.responses.responses' # checksum: e0de35c7\n  implicit-imports:\n    - depends:\n        - 'vibora.constants'\n\n- module-name: 'vibora.router.router' # checksum: ec60a103\n  implicit-imports:\n    - depends:\n        - 'vibora.router.parser'\n\n- module-name: 'vosk' # checksum: 77da6060\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'libvosk'\n\n- module-name: 'vtk' # checksum: e1e59251\n  import-hacks:\n    # This module aliases itself to another package, for which we will\n    # not find packages in unless added.\n    - package-paths:\n        - 'vtkmodules'\n\n- module-name: 'vtkmodules' # checksum: 8db0fa0f\n  implicit-imports:\n    - depends:\n        - 'vtkmodules.all'\n        - 'vtkmodules.util'\n\n- module-name: 'vtkmodules.qt' # checksum: e9590444\n  implicit-imports:\n    - depends:\n        - 'vtkmodules.qt.QVTKRenderWindowInteractor'\n\n- module-name: 'vtkmodules.tk' # checksum: 29689455\n  implicit-imports:\n    - depends:\n        - 'vtkmodules.tk.vtkLoadPythonTkWidgets'\n        - 'vtkmodules.tk.vtkTkImageViewerWidget'\n        - 'vtkmodules.tk.vtkTkPhotoImage'\n        - 'vtkmodules.tk.vtkTkRenderWidget'\n        - 'vtkmodules.tk.vtkTkRenderWindowInteractor'\n\n- module-name: 'vtkmodules.util' # checksum: 510a8c9e\n  implicit-imports:\n    - depends:\n        - 'vtkmodules.util.misc'\n        - 'vtkmodules.util.numpy_support'\n        - 'vtkmodules.util.vtkAlgorithm'\n        - 'vtkmodules.util.vtkConstants'\n        - 'vtkmodules.util.vtkImageExportToArray'\n        - 'vtkmodules.util.vtkImageImportFromArray'\n        - 'vtkmodules.util.vtkMethodParser'\n        - 'vtkmodules.util.vtkVariant'\n\n- module-name: 'vtkmodules.wx' # checksum: cfc06181\n  implicit-imports:\n    - depends:\n        - 'vtkmodules.wx.wxVTKRenderWindow'\n        - 'vtkmodules.wx.wxVTKRenderWindowInteractor'\n\n- module-name: 'weasyprint' # checksum: 976492f8\n  data-files:\n    dirs:\n      - 'css'\n    patterns:\n      - 'VERSION'\n\n- module-name: 'webview' # checksum: b3be88e0\n  data-files:\n    dirs:\n      - 'lib'\n  dlls:\n    - from_filenames:\n        relative_path: 'lib/runtimes/win-x86/native'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'lib/runtimes/win-x64/native'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: 'lib/runtimes/win-arm64/native'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_arm64'\n    - from_filenames:\n        relative_path: 'lib/x86'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'lib/x64'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_amd64'\n    - from_filenames:\n        relative_path: 'lib/arm64'\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32 and arch_arm64'\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'Microsoft.'\n      when: 'win32'\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'WebBrowserInterop.x86'\n      when: 'win32 and arch_x86'\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'WebBrowserInterop.x64'\n      when: 'win32 and arch_amd64'\n\n- module-name: 'webview.platforms.edgechromium' # checksum: e798fc8d\n  anti-bloat:\n    - description: 'workaround unused platform DLL checks'\n      replacements_plain:\n        \"';' + interop_dll_path(platform)\": \"';' + os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib', platform))\"\n\n- module-name: 'werkzeug.serving' # checksum: fcfdb30e\n  anti-bloat:\n    - description: 'remove ability to run with reloader'\n      replacements_plain:\n        'if use_reloader:': 'if False:'\n\n- module-name: 'win32com' # checksum: 8d4a0be8\n  import-hacks:\n    # This package adds another directory to the search path of itself,\n    # which we will not find packages in unless added.\n    - package-dirs:\n        - 'win32comext'\n      when: 'win32'\n\n- module-name: 'win32com.server.register' # checksum: d2ea40f3\n  anti-bloat:\n    - replacements_plain:\n        'not pythoncom.frozen': 'False'\n      change_function:\n        'ReExecuteElevated': \"'''raise (RuntimeError('Nuitka: Needs to be elevated already, use --windows-uac-admin'))'''\"\n  implicit-imports:\n    - depends:\n        - 'win32timezone'\n\n- module-name: 'win32ui' # checksum: 2f1beca2\n  implicit-imports:\n    - pre-import-code:\n        # That is a namespace module only, but it seems the extension modules needs it,\n        # despite the DLLs being present.\n        - 'import pywin32_system32'\n      when: 'win32'\n\n- module-name: 'winloop' # checksum: 9d1257f8\n  implicit-imports:\n    - depends:\n        - '._noop'\n\n- module-name: 'wx' # checksum: 154e95cb\n  options:\n    checks:\n      - description: 'wx will crash in console mode during startup'\n        console: 'yes'\n        when: 'macos'\n      - description: 'wx requires program to be in bundle form'\n        macos_bundle: 'yes'\n        when: 'macos'\n\n- module-name: 'wx.html2' # checksum: bc8985c4\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'WebView2Loader'\n      when: 'win32'\n\n- module-name: 'xarray' # checksum: faf55bfc\n  data-files:\n    dirs:\n      - 'static'\n\n- module-name: 'xarray.backends.locks' # checksum: 3d3302db\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        # TODO: This should be something special, where imports for a name\n        # are all forced to ImportError during building and/or optimization.\n        'from dask.utils import SerializableLock': 'raise ImportError'\n        'from dask.distributed import Lock as DistributedLock': 'raise ImportError'\n        'import dask': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'xarray.coding.variables' # checksum: a79667c9\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'if is_duck_dask_array(array):': 'if False:'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.dask_array_ops' # checksum: dc644550\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask.array as dask_array': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.dataset' # checksum: 1599cfc0\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask.array as dask_array': 'raise ImportError'\n        'if lazy_data:': 'if False:'\n        'from dask.delayed import Delayed': 'raise ImportError'\n      change_function:\n        '__dask_tokenize__': 'un-callable'\n        '__dask_graph__': 'un-callable'\n        '__dask_keys__': 'un-callable'\n        '__dask_layers__': 'un-callable'\n        '__dask_optimize__': 'un-callable'\n        '__dask_scheduler__': 'un-callable'\n        '_dask_postcompute': 'un-callable'\n        'to_dask_dataframe': 'un-callable'\n        '_get_chunk': 'un-callable'\n        '_maybe_chunk': 'un-callable'\n        '_dask_postpersist': 'un-callable'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.duck_array_ops' # checksum: ad7bcf75\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask.array as dask_array': 'raise ImportError'\n        'dask_array_compat, dask_array_ops, ': ''\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.indexing' # checksum: 5c2e5b3e\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      change_function:\n        '_dask_array_with_chunks_hint': 'un-callable'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.missing' # checksum: c9a72fc3\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'if is_duck_dask_array(var):': 'if False:'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.nanops' # checksum: dc644550\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask.array as dask_array': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.nputils' # checksum: 46ca5d07\n  data-files:\n    include-metadata:\n      - 'numpy'\n\n- module-name: 'xarray.core.parallel' # checksum: 37f8ca49\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'import dask': 'raise ImportError'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.pycompat' # checksum: e171aa31\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      replacements_plain:\n        'mod == \"dask\"': 'False'\n        'dsk.available': 'False'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.utils' # checksum: ff47c8d1\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      change_function:\n        # TODO: Rather than un-callable, these we may want to just skip\n        '__dask_tokenize__': 'un-callable'\n      when: 'not use_dask'\n\n- module-name: 'xarray.core.variable' # checksum: df985c92\n  anti-bloat:\n    - description: 'remove optional dask usage'\n      change_function:\n        # TODO: Rather than un-callable, these we may want to just skip\n        '__dask_tokenize__': 'un-callable'\n        'chunk': 'un-callable'\n      when: 'not use_dask'\n\n- module-name: 'xgboost' # checksum: 85584475\n  data-files:\n    patterns:\n      - 'VERSION'\n\n- module-name: 'xgboost.core' # checksum: a8cb2e6d\n  dlls:\n    - from_filenames:\n        relative_path: 'lib'\n        prefixes:\n          - 'xgboost'\n\n- module-name: 'xgboost.sklearn' # checksum: 5480616e\n  anti-bloat:\n    - description: 'remove docstring dependency'\n      replacements_plain:\n        'fit.__doc__ = XGBModel.fit.__doc__.replace(': 'fit.__doc__ = \"Fit gradient boosting model\".replace('\n      when: 'no_docstrings and no_asserts'\n\n- module-name: 'Xlib.display' # checksum: 3b1d6e64\n  implicit-imports:\n    - depends:\n        - 'Xlib.ext.*'\n\n- module-name: 'Xlib.support.connect' # checksum: 60d321da\n  implicit-imports:\n    - depends:\n        - 'Xlib.support.unix_connect'\n\n- module-name: 'Xlib.XK' # checksum: 6b59ce94\n  implicit-imports:\n    - depends:\n        - 'Xlib.keysymdef.*'\n\n- module-name: 'xmlschema' # checksum: 61a62e91\n  data-files:\n    dirs:\n      - 'schemas'\n\n- module-name: 'yapf_third_party._ylib2to3' # checksum: 4ec82d9d\n  data-files:\n    patterns:\n      - 'Grammar.txt'\n      - 'PatternGrammar.txt'\n\n- module-name: 'zaber_motion' # checksum: 7af9b202\n  implicit-imports:\n    - depends:\n        - 'zaber_motion_bindings_windows'\n      when: 'win32 and version(\"zaber_motion\") < (5,1,2)'\n    - depends:\n        - 'zaber_motion_bindings_linux'\n      when: 'linux and version(\"zaber_motion\") < (5,1,2)'\n    - depends:\n        - 'zaber_motion_bindings_darwin'\n      when: 'macos and version(\"zaber_motion\") < (5,1,2)'\n    - depends:\n        - 'bindings'\n      when: 'version(\"zaber_motion\") >= (5,1,2)'\n\n- module-name: 'zaber_motion.bindings' # checksum: ebad5220\n  anti-bloat:\n    - description: 'normalize path for DLLs'\n      replacements_plain:\n        'os.path.join(os.path.dirname(__file__), \"..\", \"bindings\", lib_name)': 'os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\", \"bindings\", lib_name))'\n\n- module-name: 'zaber_motion_bindings_darwin' # checksum: dbde56ea\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'zaber-motion-lib'\n\n- module-name: 'zaber_motion_bindings_linux' # checksum: dbde56ea\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'zaber-motion-lib'\n\n- module-name: 'zaber_motion_bindings_windows' # checksum: dbde56ea\n  dlls:\n    - from_filenames:\n        prefixes:\n          - 'zaber-motion-lib'\n\n- module-name: 'zmq' # checksum: b0320bcc\n  dlls:\n    # Do not look at this one, using dest_path and suffixes is not\n    # needed at all normally, but this one is trange and for old PyZMQ\n    # only.\n    - from_filenames:\n        prefixes:\n          - 'libzmq'\n        suffixes:\n          - 'pyd'\n      dest_path: '.'\n      when: 'win32'\n\n- module-name: 'zmq.backend' # checksum: 139febbd\n  implicit-imports:\n    - depends:\n        - 'zmq.backend.cython'\n\n- module-name: 'zope.interface._compat' # checksum: 5a8f0d92\n  anti-bloat:\n    - description: 'remove unittest reference'\n      change_function:\n        # TODO: For a decorator, this looks breaking\n        '_skip_under_py2': \"'(lambda test_method: None)'\"\n        '_skip_under_py3k': \"'(lambda test_method: None)'\"\n      when: 'not use_unittest'\n"
  },
  {
    "path": "nuitka/plugins/standard/stdlib2.nuitka-package.config.yml",
    "content": "# yamllint disable rule:line-length\n# yamllint disable rule:indentation\n# yamllint disable rule:comments-indentation\n# yamllint disable rule:comments\n# too many spelling things, spell-checker: disable\n---\n- module-name: 'audiodev' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'BaseHTTPServer' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'Bastion' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'Cookie' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'fpformat' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'mhlib' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'modulefinder' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'rexec' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'StringIO' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'Tkinter' # checksum: 16ff58dd\n  options:\n    checks:\n      - console: 'recommend'\n        when: 'plugin(\"tk-inter\")'\n\n- module-name: 'xml.sax.xmlreader' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'xmllib' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n"
  },
  {
    "path": "nuitka/plugins/standard/stdlib3.nuitka-package.config.yml",
    "content": "# yamllint disable rule:line-length\n# yamllint disable rule:indentation\n# yamllint disable rule:comments-indentation\n# yamllint disable rule:comments\n# too many spelling things, spell-checker: disable\n---\n- module-name: '_asyncio' # checksum: 86bf476b\n  implicit-imports:\n    - depends:\n        - 'asyncio'\n\n- module-name: '_zoneinfo' # checksum: 8de2a2bd\n  implicit-imports:\n    - depends:\n        - 'zoneinfo._common'\n\n- module-name: 'ast' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'base64' # checksum: dedabd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'binhex' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'bisect' # checksum: 8255002d\n  anti-bloat:\n    - description: 'avoid _bisect module usage'\n      no-auto-follow:\n        '_bisect': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_bisect\")'\n\n- module-name: 'calendar' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'copy' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'crypt' # checksum: 7d2653dc\n  anti-bloat:\n    - description: 'avoid _crypt module usage'\n      replacements_plain:\n        '_crypt module was not built as part of CPython': '_crypt module was not included, used --include-module=_crypt'\n      when: 'not has_builtin_module(\"_crypt\")'\n\n- module-name: 'ctypes.util' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'datetime' # checksum: e5cb7fa3\n  anti-bloat:\n    - description: 'avoid _datetime module usage'\n      no-auto-follow:\n        '_datetime': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_datetime\")'\n\n- module-name: 'difflib' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'dis' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'doctest' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'email.utils' # checksum: 58ebf00f\n  anti-bloat:\n    - description: 'avoid socket module usage'\n      replacements_plain:\n        'import socket': ''\n        'socket.': '__import__(\"socket\").'\n      no-auto-follow:\n        'socket': \"can break calls of 'email.utils.make_msgid()'\"\n      when: 'not has_builtin_module(\"_socket\")'\n\n- module-name: 'ensurepip' # checksum: fe3524b2\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_main': \"'(lambda: None)'\"\n\n- module-name: 'ensurepip._uninstall' # checksum: fe3524b2\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_main': \"'(lambda: None)'\"\n\n- module-name: 'enum' # checksum: a9e2240c\n  anti-bloat:\n    - replacements_plain:\n        'def __call__(cls, value,': 'def __call__(cls, value=None,'\n        'return cls.__new__(cls, value)': 'return cls.__new__(cls, value if value is not None or cls.__module__ != \"PySide6.QtCore\" else 0)'\n      when: 'plugin(\"pyside6\")'\n\n- module-name: 'formatter' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'ftplib' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'gzip' # checksum: 5428c614\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'heapq' # checksum: 406ad100\n  anti-bloat:\n    - description: 'avoid _heapq module usage'\n      no-auto-follow:\n        '_datetime': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_heapq\")'\n\n- module-name: 'imghdr' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'inspect' # checksum: fe3524b2\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_main': \"'(lambda: None)'\"\n\n- module-name: 'json.decoder' # checksum: f0af106d\n  anti-bloat:\n    - description: 'avoid _json module usage'\n      no-auto-follow:\n        '_json': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_json\")'\n\n- module-name: 'json.encoder' # checksum: f0af106d\n  anti-bloat:\n    - description: 'avoid _json module usage'\n      no-auto-follow:\n        '_json': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_json\")'\n\n- module-name: 'json.scanner' # checksum: f0af106d\n  anti-bloat:\n    - description: 'avoid _json module usage'\n      no-auto-follow:\n        '_json': 'may slow down by using fallback implementation'\n      when: 'not has_builtin_module(\"_json\")'\n\n- module-name: 'keyword' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'lib2to3.pgen2' # checksum: d93c2df9\n  data-files:\n    patterns:\n      - '../*.pickle'\n    when: 'not debian_python'\n\n- module-name: 'lib2to3.pgen2.literals' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'lib2to3.refactor' # checksum: e884a866\n  implicit-imports:\n    - depends:\n        - 'lib2to3.fixes.*'\n\n- module-name: 'locale' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'mailbox' # checksum: 2dd8f89e\n  anti-bloat:\n    - description: 'avoid fcntl module usage'\n      no-auto-follow:\n        'fcntl': 'may not lock mailbox files properly using fallback implementation'\n      when: 'not has_builtin_module(\"fcntl\")'\n\n- module-name: 'mailcap' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'mimetypes' # checksum: fe3524b2\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_main': \"'(lambda: None)'\"\n\n- module-name: 'multiprocessing.resource_tracker' # checksum: e8bba98a\n  anti-bloat:\n    - description: \"workaround for starting 'multiprocessing resource tracker\"\n      replacements_plain:\n        \"args += ['-c', cmd % r]\": \"args += ['--multiprocessing-resource-tracker', str(r)]\"\n      when: 'not module_mode'\n\n- module-name: 'pdb' # checksum: 447bd07e\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n        'help': \"'(lambda: None)'\"\n\n- module-name: 'pickle' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'pickletools' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'platform' # checksum: 2852471a\n  anti-bloat:\n    - description: 'avoid using plistlib dependency on non-macOS'\n      replacements_plain:\n        'import plistlib': 'return None'\n      when: 'not macos'\n\n- module-name: 'pyclbr' # checksum: fe3524b2\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_main': \"'(lambda: None)'\"\n\n- module-name: 'pydoc' # checksum: 89c34a73\n  anti-bloat:\n    - description: 'remove module ability to display GUI with tkinter and topics data'\n      replacements:\n        'import pydoc_data.topics': \"'raise ImportError'\"\n      change_function:\n        'gui': \"'(lambda : None)'\"\n\n- module-name: 'quopri' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'random' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'site' # checksum: af03d0bd\n  data-files:\n    patterns:\n      - 'orig-prefix.txt'\n\n- module-name: 'sndhdr' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'tabnanny' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'tarfile' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'telnetlib' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'threading' # checksum: 167cb032\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        '_test': \"'(lambda: None)'\"\n\n- module-name: 'tkinter' # checksum: cef6b613\n  anti-bloat:\n    - description: 'enhanced tk-inter in case of missing tcl'\n      context:\n        - 'import textwrap'\n      replacements:\n        'self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)': |\n          textwrap.indent(\"\"\"\n          try:\n            self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)\n          except _tkinter.TclError as e:\n            if \"usable init.tcl\" not in str(e):\n              raise\\n\\\n            sys.exit(\"Nuitka: Need to use '--enable-plugin=tk-inter' option during compilation for tk-inter to work!\")\n          \"\"\", \"        \")\n      when: 'not deployment and not plugin(\"tk-inter\")'\n  options:\n    checks:\n      - console: 'recommend'\n        when: 'plugin(\"tk-inter\")'\n\n- module-name: 'tokenize' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'trace' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'uu' # checksum: 820d21fd\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'test': \"'(lambda: None)'\"\n\n- module-name: 'wsgiref.simple_server' # checksum: 24359f69\n  implicit-imports:\n    - depends:\n        - 'http.server'\n\n- module-name: 'xml.sax' # checksum: 82b0a965\n  implicit-imports:\n    - depends:\n        - 'xml.sax.expatreader'\n\n- module-name: 'zipapp' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'zipfile' # checksum: 6a44b57d\n  anti-bloat:\n    - description: 'remove module ability to run as a binary'\n      change_function:\n        'main': \"'(lambda: None)'\"\n\n- module-name: 'zoneinfo' # checksum: 70450440\n  # This tries to find non-stdlib module when being used.\n  implicit-imports:\n    - depends:\n        - 'tzdata.zoneinfo'\n"
  },
  {
    "path": "nuitka/reports/CompilationReportReader.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This is for use in testing, but also for user tools too.\"\"\"\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.TreeXML import fromFile\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef parseCompilationReport(filename):\n    return fromFile(filename)\n\n\ndef extractModulesUsedByModule(compilation_report, module_name):\n    # Note: Avoiding usage of \"xpath\", to lower requirements to not need lxml.\n    for module_node in compilation_report.findall(\"module\"):\n        if module_node.attrib[\"name\"] != module_name:\n            continue\n\n        result = OrderedDict()\n\n        for module_usage_node in module_node.find(\"module_usages\").findall(\n            \"module_usage\"\n        ):\n            entry = OrderedDict(module_usage_node.attrib)\n\n            used_module_name = ModuleName(entry[\"name\"])\n            del entry[\"name\"]\n            entry[\"line\"] = int(entry[\"line\"])\n            entry[\"excluded\"] = bool(entry[\"finding\"] == \"excluded\")\n\n            result[used_module_name] = entry\n\n        return result\n\n    # Not found, no usages, user needs to handle that.\n    return None\n\n\ndef _getResolvedCompilationPath(path, prefixes):\n    for prefix_name, prefix_path in prefixes:\n        path = path.replace(prefix_name, prefix_path)\n\n    return path\n\n\ndef getCompilationOutputBinary(compilation_report, prefixes):\n    return _getResolvedCompilationPath(\n        path=compilation_report.find(\"output\").attrib[\"run_filename\"], prefixes=prefixes\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/reports/LicenseReport.rst.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nLicense Report\n--------------\n\nThis software was compiled with Nuitka and contains parts of the following software\n\n{% for distribution in all_distributions %}\n\n{{ get_distribution_name(distribution) }}\n=========================================\n\nVersion {{ get_distribution_version(distribution) }} of {{ get_distribution_name(distribution) }} was included and is\nunder license \"{{ get_distribution_license(distribution) }}\".\n\n{% if distribution_modules[distribution] != [get_distribution_name(distribution)] %}\nThe contained {{\"packages are\" if len(distribution_modules[distribution]) > 1 else \"package is\"}} {{\" ,\".join(quoted(distribution_modules[distribution]))}}.\n{% endif %}\n\n{% if distribution.read_text(\"LICENSE.txt\") %}\n.. code::\n\n{{ distribution.read_text(\"LICENSE.txt\") | indent(4, True) }}\n{% endif %}\n\n{% endfor %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/reports/Reports.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Collection of information for reports and their writing.\n\nThese reports are in XML form, and with Jinja2 templates in any form you like.\n\n\"\"\"\n\nimport atexit\nimport os\nimport sys\nimport traceback\n\nfrom nuitka import TreeXML\nfrom nuitka.__past__ import unicode\nfrom nuitka.build.DataComposerInterface import getDataComposerReportValues\nfrom nuitka.build.SconsUtils import readSconsErrorReport\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.freezer.IncludedDataFiles import getIncludedDataFiles\nfrom nuitka.freezer.IncludedEntryPoints import getStandaloneEntryPoints\nfrom nuitka.importing.Importing import getPackageSearchPath\nfrom nuitka.importing.Recursion import getRecursionDecisions\nfrom nuitka.ModuleRegistry import (\n    getDoneModules,\n    getModuleInclusionInfoByName,\n    getModuleInfluences,\n    getModuleOptimizationTimingInfos,\n)\nfrom nuitka.Options import (\n    getCompilationReportFilename,\n    getCompilationReportTemplates,\n    getCompilationReportUserData,\n    isOnefileMode,\n    shallCreateDiffableCompilationReport,\n)\nfrom nuitka.OutputDirectories import (\n    getResultRunFilename,\n    getSourceDirectoryPath,\n)\nfrom nuitka.plugins.Plugins import getActivePlugins\nfrom nuitka.PythonFlavors import getPythonFlavorName\nfrom nuitka.PythonVersions import getSystemPrefixPath, python_version_full_str\nfrom nuitka.Tracing import ReportingSystemExit, reports_logger\nfrom nuitka.utils.Distributions import (\n    getDistributionInstallerName,\n    getDistributionLicense,\n    getDistributionName,\n    getDistributionsFromModuleName,\n    getDistributionVersion,\n)\nfrom nuitka.utils.FileOperations import (\n    getReportPath,\n    putBinaryFileContents,\n    putTextFileContents,\n)\nfrom nuitka.utils.Jinja2 import getTemplate\nfrom nuitka.utils.MemoryUsage import getMemoryInfos\nfrom nuitka.utils.Utils import (\n    getArchitecture,\n    getLinuxDistribution,\n    getMacOSRelease,\n    getOS,\n    getWindowsRelease,\n    isLinux,\n    isMacOS,\n    isWin32OrPosixWindows,\n)\nfrom nuitka.Version import getCommercialVersion, getNuitkaVersion\n\n\ndef _getReportInputData(aborted):\n    \"\"\"Collect all information for reporting into a dictionary.\"\"\"\n\n    # used with locals for laziness and these are to populate a dictionary with\n    # many entries,\n    # pylint: disable=possibly-unused-variable,too-many-branches,too-many-locals,too-many-statements\n\n    module_names = tuple(module.getFullName() for module in getDoneModules())\n\n    module_kinds = dict(\n        (module.getFullName(), module.__class__.__name__) for module in getDoneModules()\n    )\n\n    module_sources = dict(\n        (module.getFullName(), module.source_ref) for module in getDoneModules()\n    )\n\n    module_inclusion_infos = dict(\n        (module.getFullName(), getModuleInclusionInfoByName(module.getFullName()))\n        for module in getDoneModules()\n    )\n\n    module_plugin_influences = dict(\n        (module.getFullName(), getModuleInfluences(module.getFullName()))\n        for module in getDoneModules()\n    )\n\n    module_timing_infos = dict(\n        (module.getFullName(), getModuleOptimizationTimingInfos(module.getFullName()))\n        for module in getDoneModules()\n    )\n\n    module_usages = dict(\n        (module.getFullName(), tuple(module.getUsedModules()))\n        for module in getDoneModules()\n    )\n\n    module_distributions = {}\n    distribution_modules = {}\n\n    for module in getDoneModules():\n        module_distributions[module.getFullName()] = getDistributionsFromModuleName(\n            module.getFullName()\n        )\n        for _distribution in module_distributions[module.getFullName()]:\n            if _distribution not in distribution_modules:\n                distribution_modules[_distribution] = OrderedSet()\n\n            distribution_modules[_distribution].add(module.getFullName())\n\n    module_distribution_usages = {}\n    for module in getDoneModules():\n        module_distribution_usages[module.getFullName()] = OrderedSet()\n\n        for _module_usage in module_usages[module.getFullName()]:\n            if _module_usage.module_name not in module_usages:\n                continue\n\n            module_distribution_usages[module.getFullName()].update(\n                dist\n                for dist in module_distributions[_module_usage.module_name]\n                if dist not in module_distributions[module.getFullName()]\n            )\n\n    module_distribution_names = dict(\n        (module.getFullName(), module.getUsedDistributions())\n        for module in getDoneModules()\n    )\n\n    all_distributions = tuple(\n        sorted(\n            set(sum(module_distributions.values(), ())),\n            key=getDistributionName,\n        )\n    )\n\n    module_distribution_installers = dict(\n        (\n            getDistributionName(dist),\n            getDistributionInstallerName(getDistributionName(dist)),\n        )\n        for dist in all_distributions\n    )\n\n    module_exclusions = dict((module.getFullName(), {}) for module in getDoneModules())\n\n    # TODO: The module filename, and other things can be None. Once we change to\n    # namedtuples, we need to adapt the type check.\n    def _replaceNoneWithString(value):\n        if type(value) is tuple:\n            return tuple(_replaceNoneWithString(element) for element in value)\n\n        return value if value is not None else \"\"\n\n    for (\n        _using_module_name,\n        _module_filename,\n        _module_name,\n        _module_kind,\n        _extra_recursion,\n    ), (_decision, _reason) in sorted(\n        getRecursionDecisions().items(), key=_replaceNoneWithString\n    ):\n        if _decision is not False:\n            continue\n\n        if _using_module_name is None:\n            continue\n\n        # We might be interrupted, and have this information, but never actually\n        # finished the module.\n        if _using_module_name not in module_exclusions:\n            continue\n\n        module_exclusions[_using_module_name][_module_name] = _reason\n\n    memory_infos = getMemoryInfos()\n\n    python_exe = sys.executable\n\n    python_flavor = getPythonFlavorName()\n    python_version = python_version_full_str\n    os_name = getOS()\n    arch_name = getArchitecture()\n\n    if isWin32OrPosixWindows():\n        os_release = getWindowsRelease()\n    elif isLinux():\n        os_release = \"-\".join(x for x in getLinuxDistribution() if x)\n    elif isMacOS():\n        os_release = getMacOSRelease()\n    else:\n        os_release = \"unknown\"\n\n    nuitka_version = getNuitkaVersion()\n    nuitka_commercial_version = getCommercialVersion() or \"not installed\"\n\n    nuitka_aborted = aborted\n\n    nuitka_exception = sys.exc_info()\n\n    user_data = getCompilationReportUserData()\n\n    data_composer = getDataComposerReportValues()\n\n    output_run_filename = os.path.abspath(getResultRunFilename(onefile=isOnefileMode()))\n\n    scons_error_report_data = readSconsErrorReport(source_dir=getSourceDirectoryPath())\n\n    return dict(\n        (var_name, var_value)\n        for var_name, var_value in locals().items()\n        if not var_name.startswith(\"_\")\n    )\n\n\n_report_prefixes = None\n\n\ndef _getReportPathPrefixes():\n    # Using global here, as this is really a singleton, in the form of a module,\n    # pylint: disable=global-statement\n    global _report_prefixes\n\n    if _report_prefixes is None:\n        _report_prefixes = []\n\n        sys_prefix = os.getenv(\"NUITKA_SYS_PREFIX\", sys.prefix)\n        real_sys_prefix = getSystemPrefixPath()\n\n        if real_sys_prefix != sys_prefix:\n            _report_prefixes.append((\"${sys.real_prefix}\", real_sys_prefix))\n\n        _report_prefixes.append((\"${sys.prefix}\", sys_prefix))\n        _report_prefixes.append((\"${cwd}\", os.getcwd()))\n\n    return _report_prefixes\n\n\ndef _getCompilationReportPath(path):\n    return getReportPath(path, prefixes=_getReportPathPrefixes())\n\n\ndef _addModulesToReport(root, report_input_data, diffable):\n    # Many details to work with, pylint: disable=too-many-branches,too-many-locals\n\n    for module_name in report_input_data[\"module_names\"]:\n        active_module_info = report_input_data[\"module_inclusion_infos\"][module_name]\n\n        module_xml_node = TreeXML.appendTreeElement(\n            root,\n            \"module\",\n            name=module_name,\n            kind=report_input_data[\"module_kinds\"][module_name],\n            usage=active_module_info.usage_tag,\n            reason=active_module_info.reason,\n            source_path=_getCompilationReportPath(\n                report_input_data[\"module_sources\"][module_name].getFilename()\n            ),\n        )\n\n        distributions = report_input_data[\"module_distributions\"][module_name]\n\n        if distributions:\n            module_xml_node.attrib[\"distribution\"] = \",\".join(\n                getDistributionName(dist) for dist in distributions\n            )\n\n        for plugin_name, influence, detail in report_input_data[\n            \"module_plugin_influences\"\n        ][module_name]:\n            influence_xml_node = TreeXML.Element(\n                \"plugin-influence\", name=plugin_name, influence=influence\n            )\n\n            if influence == \"condition-used\":\n                condition, condition_tags_used, condition_result = detail\n\n                influence_xml_node.attrib[\"condition\"] = condition\n                if condition_tags_used:\n                    influence_xml_node.attrib[\"tags_used\"] = \",\".join(\n                        condition_tags_used\n                    )\n                influence_xml_node.attrib[\"result\"] = str(condition_result).lower()\n            elif influence == \"variable-used\":\n                variable_name, condition_tags_used, variable_value = detail\n\n                influence_xml_node.attrib[\"variable\"] = variable_name\n                if condition_tags_used:\n                    influence_xml_node.attrib[\"tags_used\"] = \",\".join(\n                        condition_tags_used\n                    )\n                influence_xml_node.attrib[\"value\"] = variable_value\n            elif influence == \"parameter-used\":\n                parameter_name, condition_tags_used, parameter_value = detail\n\n                influence_xml_node.attrib[\"parameter\"] = parameter_name\n                if condition_tags_used:\n                    influence_xml_node.attrib[\"tags_used\"] = \",\".join(\n                        condition_tags_used\n                    )\n                influence_xml_node.attrib[\"value\"] = repr(parameter_value)\n            elif influence == \"detection\":\n                detection_name, detection_value = detail\n\n                influence_xml_node.attrib[\"detection\"] = detection_name\n                influence_xml_node.attrib[\"value\"] = repr(detection_value)\n            else:\n                assert False, influence\n\n            module_xml_node.append(influence_xml_node)\n\n        for timing_info in report_input_data[\"module_timing_infos\"][module_name]:\n            timing_xml_node = TreeXML.Element(\n                \"optimization-time\",\n            )\n\n            # Going via attrib, because pass is a keyword in Python.\n            timing_xml_node.attrib[\"pass\"] = str(timing_info.pass_number)\n            timing_xml_node.attrib[\"time\"] = (\n                \"volatile\" if diffable else \"%.2f\" % timing_info.time_used\n            )\n\n            module_xml_node.append(timing_xml_node)\n\n        distributions = report_input_data[\"module_distribution_usages\"][module_name]\n\n        if distributions:\n            distributions_xml_node = TreeXML.appendTreeElement(\n                module_xml_node,\n                \"distribution-usages\",\n            )\n\n            for distribution in distributions:\n                TreeXML.appendTreeElement(\n                    distributions_xml_node,\n                    \"distribution-usage\",\n                    name=getDistributionName(distribution),\n                )\n\n        module_distribution_names = report_input_data[\"module_distribution_names\"][\n            module_name\n        ]\n\n        if module_distribution_names:\n            module_distribution_names_xml_node = TreeXML.appendTreeElement(\n                module_xml_node,\n                \"distribution-lookups\",\n            )\n\n            for distribution_name, found in module_distribution_names.items():\n                TreeXML.appendTreeElement(\n                    module_distribution_names_xml_node,\n                    \"distribution-lookup\",\n                    name=distribution_name,\n                    found=\"yes\" if found else \"no\",\n                )\n\n        used_modules_xml_node = TreeXML.appendTreeElement(\n            module_xml_node,\n            \"module_usages\",\n        )\n\n        for used_module in report_input_data[\"module_usages\"][module_name]:\n            module_usage_node = TreeXML.appendTreeElement(\n                used_modules_xml_node,\n                \"module_usage\",\n                name=used_module.module_name.asString(),\n                finding=used_module.finding,\n                line=str(used_module.source_ref.getLineNumber()),\n            )\n\n            exclusion_reason = report_input_data[\"module_exclusions\"][module_name].get(\n                used_module.module_name\n            )\n\n            # Include reason why a module was excluded unless it is obvious like\n            # with built-in modules.\n            if exclusion_reason is not None and used_module.module_kind != \"built-in\":\n                module_usage_node.attrib[\"finding\"] = \"excluded\"\n                module_usage_node.attrib[\"exclusion_reason\"] = exclusion_reason\n\n\ndef _addMemoryInfosToReport(performance_xml_node, memory_infos, diffable):\n    for key, value in memory_infos.items():\n        # Only top level values for now.\n        if type(value) is not int:\n            continue\n\n        TreeXML.appendTreeElement(\n            performance_xml_node,\n            \"memory_usage\",\n            name=key,\n            value=\"volatile\" if diffable else str(value),\n        )\n\n\ndef _addUserDataToReport(root, user_data):\n    if user_data:\n        user_data_xml_node = TreeXML.appendTreeElement(\n            root,\n            \"user-data\",\n        )\n\n        for key, value in user_data.items():\n            user_data_value_xml_node = TreeXML.appendTreeElement(\n                user_data_xml_node,\n                key,\n            )\n\n            user_data_value_xml_node.text = value\n\n\ndef writeCompilationReport(report_filename, report_input_data, diffable):\n    \"\"\"Write the compilation report in XML format.\"\"\"\n    # Many details, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    # When failing to write the crash report, we need to indicate that it was\n    # not done to the atexit handler, pylint: disable=global-statement\n    global _crash_report_filename\n\n    exit_message = None\n    if not report_input_data[\"nuitka_aborted\"]:\n        completion = \"yes\"\n    elif report_input_data[\"nuitka_exception\"][0] is KeyboardInterrupt:\n        completion = \"interrupted\"\n    elif report_input_data[\"nuitka_exception\"][0] is SystemExit:\n        completion = \"error exit (%s)\" % report_input_data[\"nuitka_exception\"][1].code\n    elif report_input_data[\"nuitka_exception\"][0] is ReportingSystemExit:\n        completion = (\n            \"error exit message (%s)\" % report_input_data[\"nuitka_exception\"][1].code\n        )\n        exit_message = report_input_data[\"nuitka_exception\"][1].exit_message\n    else:\n        completion = \"exception\"\n\n    root = TreeXML.Element(\n        \"nuitka-compilation-report\",\n        nuitka_version=report_input_data[\"nuitka_version\"],\n        nuitka_commercial_version=report_input_data[\"nuitka_commercial_version\"],\n        completion=completion,\n    )\n\n    if exit_message is not None:\n        root.attrib[\"exit_message\"] = exit_message\n\n    if completion == \"exception\":\n        exception_xml_node = TreeXML.appendTreeElement(\n            root,\n            \"exception\",\n            exception_type=str(sys.exc_info()[0].__name__),\n            exception_value=str(sys.exc_info()[1]),\n        )\n\n        exception_xml_node.text = \"\\n\" + traceback.format_exc()\n\n    if report_input_data[\"scons_error_report_data\"]:\n        scons_error_reports_node = TreeXML.appendTreeElement(\n            root, \"scons_error_reports\"\n        )\n\n        for cmd, (stdout, stderr) in report_input_data[\n            \"scons_error_report_data\"\n        ].items():\n            scons_error_report_node = TreeXML.appendTreeElement(\n                scons_error_reports_node, \"scons_error_report\"\n            )\n\n            TreeXML.appendTreeElement(\n                scons_error_report_node,\n                \"command\",\n            ).text = cmd\n\n            if stdout:\n                if not stdout.startswith(\"\\n\"):\n                    stdout = \"\\n\" + stdout\n\n                stdout = stdout.rstrip(\"\\n\") + \"\\n\"\n\n                TreeXML.appendTreeElement(\n                    scons_error_report_node,\n                    \"stdout\",\n                ).text = stdout\n\n            if stderr:\n                if not stderr.startswith(\"\\n\"):\n                    stderr = \"\\n\" + stderr\n\n                stderr = stderr.rstrip(\"\\n\") + \"\\n\"\n\n                TreeXML.appendTreeElement(\n                    scons_error_report_node,\n                    \"stderr\",\n                ).text = stderr\n\n    _addModulesToReport(\n        root=root, report_input_data=report_input_data, diffable=diffable\n    )\n\n    if report_input_data[\"memory_infos\"]:\n        performance_xml_node = TreeXML.appendTreeElement(\n            root,\n            \"performance\",\n        )\n\n        _addMemoryInfosToReport(\n            performance_xml_node=performance_xml_node,\n            memory_infos=report_input_data[\"memory_infos\"],\n            diffable=diffable,\n        )\n\n    for included_datafile in getIncludedDataFiles():\n        if included_datafile.kind == \"data_file\":\n            TreeXML.appendTreeElement(\n                root,\n                \"data_file\",\n                name=included_datafile.dest_path,\n                source=_getCompilationReportPath(included_datafile.source_path),\n                size=str(included_datafile.getFileSize()),\n                reason=included_datafile.reason,\n                tags=\",\".join(included_datafile.tags),\n            )\n        elif included_datafile.kind == \"data_blob\":\n            TreeXML.appendTreeElement(\n                root,\n                \"data_blob\",\n                name=included_datafile.dest_path,\n                size=str(included_datafile.getFileSize()),\n                reason=included_datafile.reason,\n                tags=\",\".join(included_datafile.tags),\n            )\n\n    for standalone_entry_point in getStandaloneEntryPoints():\n        if standalone_entry_point.kind == \"executable\":\n            continue\n\n        kind = standalone_entry_point.kind\n\n        if kind.endswith(\"_ignored\"):\n            ignored = True\n            kind = kind.replace(\"_ignored\", \"\")\n        else:\n            ignored = False\n\n        TreeXML.appendTreeElement(\n            root,\n            \"included_\" + kind,\n            name=os.path.basename(standalone_entry_point.dest_path),\n            dest_path=standalone_entry_point.dest_path,\n            source_path=_getCompilationReportPath(standalone_entry_point.source_path),\n            package=standalone_entry_point.package_name or \"\",\n            ignored=\"yes\" if ignored else \"no\",\n            reason=standalone_entry_point.reason,\n            # TODO: No reason yet.\n        )\n\n    if not diffable:\n        data_composer_values = getDataComposerReportValues()\n\n        data_composer_xml_node = TreeXML.appendTreeElement(\n            root,\n            \"data_composer\",\n            blob_size=str(data_composer_values[\"blob_size\"]),\n        )\n\n        data_composer_stats = data_composer_values[\"stats\"]\n        if data_composer_stats:\n            for item, item_value in data_composer_stats.items():\n                assert type(item) in (str, unicode)\n                if type(item_value) is int:\n                    data_composer_xml_node.attrib[item] = str(item_value)\n                else:\n                    for key in item_value:\n                        item_value[key] = str(item_value[key])\n\n                    TreeXML.appendTreeElement(\n                        data_composer_xml_node,\n                        \"module_data\",\n                        filename=item,\n                        **item_value\n                    )\n\n    options_xml_node = TreeXML.appendTreeElement(\n        root,\n        \"command_line\",\n    )\n\n    for arg in sys.argv[1:]:\n        TreeXML.appendTreeElement(options_xml_node, \"option\", value=arg)\n\n    active_plugins_xml_node = TreeXML.appendTreeElement(\n        root,\n        \"plugins\",\n    )\n\n    for plugin in getActivePlugins():\n        if plugin.isDetector():\n            continue\n\n        TreeXML.appendTreeElement(\n            active_plugins_xml_node,\n            \"plugin\",\n            name=plugin.plugin_name,\n            user_enabled=\"no\" if plugin.isAlwaysEnabled() else \"yes\",\n        )\n\n    distributions_xml_node = TreeXML.appendTreeElement(\n        root,\n        \"distributions\",\n    )\n\n    for distribution in report_input_data[\"all_distributions\"]:\n        TreeXML.appendTreeElement(\n            distributions_xml_node,\n            \"distribution\",\n            name=getDistributionName(distribution),\n            version=getDistributionVersion(distribution),\n            installer=report_input_data[\"module_distribution_installers\"][\n                getDistributionName(distribution)\n            ],\n        )\n\n    python_xml_node = TreeXML.appendTreeElement(\n        root,\n        \"python\",\n        python_exe=_getCompilationReportPath(report_input_data[\"python_exe\"]),\n        python_flavor=report_input_data[\"python_flavor\"],\n        python_version=report_input_data[\"python_version\"],\n        os_name=report_input_data[\"os_name\"],\n        os_release=report_input_data[\"os_release\"],\n        arch_name=report_input_data[\"arch_name\"],\n    )\n\n    search_path = getPackageSearchPath(None)\n\n    if search_path is not None:\n        search_path_xml_node = TreeXML.appendTreeElement(\n            python_xml_node,\n            \"search_path\",\n        )\n\n        for search_path in getPackageSearchPath(None):\n            TreeXML.appendTreeElement(\n                search_path_xml_node,\n                \"path\",\n                value=_getCompilationReportPath(search_path),\n            )\n\n    _addUserDataToReport(root=root, user_data=report_input_data[\"user_data\"])\n\n    python_xml_node = TreeXML.appendTreeElement(\n        root,\n        \"output\",\n        run_filename=_getCompilationReportPath(\n            report_input_data[\"output_run_filename\"]\n        ),\n    )\n\n    contents = TreeXML.toString(root)\n\n    if type(contents) is not bytes:\n        contents = contents.encode(\"utf8\")\n\n    try:\n        putBinaryFileContents(filename=report_filename, contents=contents)\n    except OSError as e:\n        reports_logger.warning(\n            \"Compilation report write to file '%s' failed due to: %s.\"\n            % (report_filename, e)\n        )\n\n        if _crash_report_filename == report_filename:\n            _crash_report_filename = None\n    else:\n        if _crash_report_filename != report_filename:\n            reports_logger.info(\n                \"Compilation report written to file '%s'.\" % report_filename\n            )\n\n\ndef writeCompilationReportFromTemplate(\n    template_filename, report_filename, report_input_data\n):\n    template = getTemplate(\n        package_name=None,\n        template_subdir=os.path.dirname(template_filename) or \".\",\n        template_name=os.path.basename(template_filename),\n        extensions=(\"jinja2.ext.do\",),\n    )\n\n    def quoted(value):\n        if isinstance(value, str):\n            return \"'%s'\" % value\n        else:\n            return [quoted(element) for element in value]\n\n    report_text = template.render(\n        # Get the license text.\n        get_distribution_license=getDistributionLicense,\n        # get the distribution_name\n        get_distribution_name=getDistributionName,\n        # get the distribution version\n        get_distribution_version=getDistributionVersion,\n        # Quote a list of strings.\n        quoted=quoted,\n        # For checking length of lists.\n        len=len,\n        **report_input_data\n    )\n\n    try:\n        putTextFileContents(filename=report_filename, contents=report_text)\n    except OSError as e:\n        reports_logger.warning(\n            \"Compilation report from template failed write file '%s' due to: %s.\"\n            % (report_filename, e)\n        )\n    else:\n        reports_logger.info(\n            \"Compilation report from template written to file '%s'.\" % report_filename\n        )\n\n\n_crash_report_filename = \"nuitka-crash-report.xml\"\n_crash_report_bug_message = True\n\n\ndef _informAboutCrashReport():\n    if _crash_report_filename is not None:\n        message = (\n            \"Compilation crash report written to file '%s'.\" % _crash_report_filename\n        )\n\n        if _crash_report_bug_message:\n            message += \" Please include it in your bug report.\"\n\n        reports_logger.info(\n            message,\n            style=\"red\",\n        )\n\n\ndef writeCompilationReports(aborted):\n    report_filename = getCompilationReportFilename()\n    template_specs = getCompilationReportTemplates()\n    diffable = shallCreateDiffableCompilationReport()\n\n    if (\n        report_filename is None\n        and aborted\n        and sys.exc_info()[0] not in (KeyboardInterrupt, SystemExit)\n    ):\n        report_filename = _crash_report_filename\n\n        # Inform user about bug reporting of a bug only, if this is not some sort\n        # of reporting exit, these do not constitute definitive bugs of Nuitka but\n        # are often usage errors only.\n\n        # Using global here, as this is really a singleton\n        # pylint: disable=global-statement\n        global _crash_report_bug_message\n        _crash_report_bug_message = sys.exc_info()[0] is not ReportingSystemExit\n\n        atexit.register(_informAboutCrashReport)\n\n    if report_filename or template_specs:\n        report_input_data = _getReportInputData(aborted)\n\n        if report_filename:\n            writeCompilationReport(\n                report_filename=report_filename,\n                report_input_data=report_input_data,\n                diffable=diffable,\n            )\n\n        for template_filename, report_filename in template_specs:\n            if (\n                not os.path.exists(template_filename)\n                and os.path.sep not in template_filename\n            ):\n                candidate = os.path.join(os.path.dirname(__file__), template_filename)\n\n                if not candidate.endswith(\".rst.j2\"):\n                    candidate += \".rst.j2\"\n\n                if os.path.exists(candidate):\n                    template_filename = candidate\n\n            if not os.path.exists(template_filename):\n                reports_logger.warning(\n                    \"Cannot find report template '%s' ignoring report request.\"\n                    % template_filename\n                )\n                continue\n\n            writeCompilationReportFromTemplate(\n                template_filename=template_filename,\n                report_filename=report_filename,\n                report_input_data=report_input_data,\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/reports/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinBytesOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Bytes operation specs.\n\nPython3 only, Python2 has no bytes, but only str\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_int,\n    tshape_list,\n    tshape_str,\n    tshape_tuple,\n)\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinMethodParameterSpecBase,\n    BuiltinMethodParameterSpecNoKeywordsBase,\n)\n\n\nclass BytesMethodSpecNoKeywords(BuiltinMethodParameterSpecNoKeywordsBase):\n    __slots__ = ()\n\n    method_prefix = \"bytes\"\n\n\nclass BytesMethodSpec(BuiltinMethodParameterSpecBase):\n    __slots__ = ()\n\n    method_prefix = \"bytes\"\n\n\nbytes_decode_spec = BytesMethodSpec(\n    \"decode\", arg_names=(\"encoding\", \"errors\"), default_count=2, type_shape=tshape_str\n)\n\nbytes_join_spec = BytesMethodSpecNoKeywords(\n    \"join\", arg_names=(\"iterable\",), type_shape=tshape_bytes\n)\nbytes_partition_spec = BytesMethodSpecNoKeywords(\n    \"partition\", arg_names=(\"sep\",), type_shape=tshape_tuple\n)\nbytes_rpartition_spec = BytesMethodSpecNoKeywords(\n    \"rpartition\", arg_names=(\"sep\",), type_shape=tshape_tuple\n)\nbytes_strip_spec = BytesMethodSpecNoKeywords(\n    \"strip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_bytes\n)\nbytes_lstrip_spec = BytesMethodSpecNoKeywords(\n    \"lstrip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_bytes\n)\nbytes_rstrip_spec = BytesMethodSpecNoKeywords(\n    \"rstrip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_bytes\n)\nbytes_find_spec = BytesMethodSpecNoKeywords(\n    \"find\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nbytes_rfind_spec = BytesMethodSpecNoKeywords(\n    \"rfind\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nbytes_index_spec = BytesMethodSpecNoKeywords(\n    \"index\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nbytes_rindex_spec = BytesMethodSpecNoKeywords(\n    \"rindex\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\n\nbytes_split_spec = BytesMethodSpec(\n    \"split\", arg_names=(\"sep\", \"maxsplit\"), default_count=2, type_shape=tshape_list\n)\nbytes_rsplit_spec = BytesMethodSpec(\n    \"rsplit\", arg_names=(\"sep\", \"maxsplit\"), default_count=2, type_shape=tshape_list\n)\n\nbytes_startswith_spec = BytesMethodSpecNoKeywords(\n    \"startswith\",\n    arg_names=(\"prefix\", \"start\", \"end\"),\n    default_count=2,\n    type_shape=tshape_bool,\n)\nbytes_endswith_spec = BytesMethodSpecNoKeywords(\n    \"endswith\",\n    arg_names=(\"suffix\", \"start\", \"end\"),\n    default_count=2,\n    type_shape=tshape_bool,\n)\n\nbytes_replace_spec = BytesMethodSpecNoKeywords(\n    \"replace\",\n    arg_names=(\"old\", \"new\", \"count\"),\n    default_count=1,\n    type_shape=tshape_bytes,\n)\n\nbytes_count_spec = BytesMethodSpecNoKeywords(\n    \"count\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\n\nbytes_capitalize_spec = BytesMethodSpecNoKeywords(\n    \"capitalize\", arg_names=(), type_shape=tshape_bytes\n)\nbytes_upper_spec = BytesMethodSpecNoKeywords(\n    \"upper\", arg_names=(), type_shape=tshape_bytes\n)\nbytes_lower_spec = BytesMethodSpecNoKeywords(\n    \"lower\", arg_names=(), type_shape=tshape_bytes\n)\nbytes_swapcase_spec = BytesMethodSpecNoKeywords(\n    \"swapcase\", arg_names=(), type_shape=tshape_bytes\n)\nbytes_title_spec = BytesMethodSpecNoKeywords(\n    \"title\", arg_names=(), type_shape=tshape_bytes\n)\nbytes_isalnum_spec = BytesMethodSpecNoKeywords(\n    \"isalnum\", arg_names=(), type_shape=tshape_bool\n)\nbytes_isalpha_spec = BytesMethodSpecNoKeywords(\n    \"isalpha\", arg_names=(), type_shape=tshape_bool\n)\nbytes_isdigit_spec = BytesMethodSpecNoKeywords(\n    \"isdigit\", arg_names=(), type_shape=tshape_bool\n)\nbytes_islower_spec = BytesMethodSpecNoKeywords(\n    \"islower\", arg_names=(), type_shape=tshape_bool\n)\nbytes_isupper_spec = BytesMethodSpecNoKeywords(\n    \"isupper\", arg_names=(), type_shape=tshape_bool\n)\nbytes_isspace_spec = BytesMethodSpecNoKeywords(\n    \"isspace\", arg_names=(), type_shape=tshape_bool\n)\nbytes_istitle_spec = BytesMethodSpecNoKeywords(\n    \"istitle\", arg_names=(), type_shape=tshape_bool\n)\n\n# Python2 only, Python3 this is in bytes\nbytes_decode_spec = BytesMethodSpec(\n    \"decode\", arg_names=(\"encoding\", \"errors\"), default_count=2, type_shape=tshape_str\n)\n\nbytes_expandtabs_spec = BytesMethodSpec(\n    \"expandtabs\", arg_names=(\"tabsize\",), default_count=1, type_shape=tshape_bytes\n)\n\nbytes_center_spec = BytesMethodSpecNoKeywords(\n    \"center\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_bytes\n)\nbytes_ljust_spec = BytesMethodSpecNoKeywords(\n    \"ljust\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_bytes\n)\nbytes_rjust_spec = BytesMethodSpecNoKeywords(\n    \"rjust\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_bytes\n)\nbytes_zfill_spec = BytesMethodSpecNoKeywords(\n    \"zfill\", arg_names=(\"width\",), type_shape=tshape_bytes\n)\nbytes_translate_spec = BytesMethodSpecNoKeywords(\n    \"translate\", arg_names=(\"table\", \"delete\"), default_count=1, type_shape=tshape_bytes\n)\nbytes_splitlines_spec = BytesMethodSpec(\n    \"splitlines\", arg_names=(\"keepends\"), default_count=1, type_shape=tshape_list\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinDictOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Dictionary operation specs. \"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_dict,\n    tshape_list,\n    tshape_none,\n    tshape_tuple,\n)\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinMethodParameterSpecBase,\n    BuiltinParameterSpecSinglePosArgStarDictArgs,\n)\n\n\nclass DictMethodSpec(BuiltinMethodParameterSpecBase):\n    __slots__ = ()\n\n    method_prefix = \"dict\"\n\n\ndict_copy_spec = DictMethodSpec(\"copy\", type_shape=tshape_dict)\ndict_clear_spec = DictMethodSpec(\"clear\", type_shape=tshape_none)\n\n# items is the Python2 variant, iteritems is the Python3 variant of items\ndict_items_spec = DictMethodSpec(\"items\", type_shape=tshape_list)\ndict_iteritems_spec = DictMethodSpec(\"iteritems\")\ndict_viewitems_spec = DictMethodSpec(\"viewitems\")\n\n# keys is the Python2 variant, iterkeys is the Python3 variant of keys\ndict_keys_spec = DictMethodSpec(\"keys\", type_shape=tshape_list)\ndict_iterkeys_spec = DictMethodSpec(\"iterkeys\")\ndict_viewkeys_spec = DictMethodSpec(\"viewkeys\")\n\n# values is the Python2 variant, itervalues is the Python3 variant of keys\ndict_values_spec = DictMethodSpec(\"values\", type_shape=tshape_list)\ndict_itervalues_spec = DictMethodSpec(\"itervalues\")\ndict_viewvalues_spec = DictMethodSpec(\"viewvalues\")\n\ndict_get_spec = DictMethodSpec(\"get\", arg_names=(\"key\", \"default\"), default_count=1)\n\ndict_has_key_spec = DictMethodSpec(\n    \"has_key\", arg_names=(\"key\",), type_shape=tshape_bool\n)\n\ndict_setdefault_spec = DictMethodSpec(\n    \"setdefault\", arg_names=(\"key\", \"default\"), default_count=1\n)\n\ndict_pop_spec = DictMethodSpec(\"pop\", arg_names=(\"key\", \"default\"), default_count=1)\n\ndict_popitem_spec = DictMethodSpec(\"popitem\", type_shape=tshape_tuple)\n\ndict_update_spec = BuiltinParameterSpecSinglePosArgStarDictArgs(\n    \"dict.update\",\n    list_star_arg=\"iterable\",\n    dict_star_arg=\"pairs\",\n    type_shape=tshape_none,\n)\n\ndict_fromkeys_spec = DictMethodSpec(\n    \"fromkeys\", arg_names=(\"iterable\", \"value\"), default_count=1, type_shape=tshape_dict\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinListOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"List operation specs. \"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_int_or_long,\n    tshape_list,\n    tshape_none,\n)\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinMethodParameterSpecBase,\n    BuiltinMethodParameterSpecNoKeywordsBase,\n)\n\n\nclass ListMethodSpecNoKeywords(BuiltinMethodParameterSpecNoKeywordsBase):\n    __slots__ = ()\n\n    method_prefix = \"list\"\n\n\nclass ListMethodSpec(BuiltinMethodParameterSpecBase):\n    __slots__ = ()\n\n    method_prefix = \"list\"\n\n\n# Python3 only\nlist_clear_spec = ListMethodSpecNoKeywords(\n    \"clear\", arg_names=(), type_shape=tshape_none\n)\n\nlist_append_spec = ListMethodSpecNoKeywords(\n    \"append\", arg_names=(\"item\",), type_shape=tshape_none\n)\nlist_copy_spec = ListMethodSpecNoKeywords(\"copy\", arg_names=(), type_shape=tshape_list)\nlist_count_spec = ListMethodSpecNoKeywords(\n    \"count\", arg_names=(\"value\",), type_shape=tshape_int_or_long\n)\nlist_extend_spec = ListMethodSpecNoKeywords(\n    \"extend\", arg_names=(\"value\",), type_shape=tshape_none\n)\nlist_index_spec = ListMethodSpecNoKeywords(\n    \"index\",\n    arg_names=(\"value\", \"start\", \"stop\"),\n    default_count=2,\n    type_shape=tshape_int_or_long,\n)\nlist_insert_spec = ListMethodSpecNoKeywords(\n    \"insert\", arg_names=(\"index\", \"item\"), type_shape=tshape_none\n)\nlist_pop_spec = ListMethodSpecNoKeywords(\"pop\", arg_names=(\"index\",), default_count=1)\nlist_remove_spec = ListMethodSpecNoKeywords(\n    \"remove\", arg_names=(\"value\",), type_shape=tshape_none\n)\nlist_reverse_spec = ListMethodSpecNoKeywords(\n    \"reverse\", arg_names=(), type_shape=tshape_none\n)\n\n# TODO: Version dependent with keyword only args in Python3\n# list_sort_spec = ListMethodSpec(\n#     \"sort\", arg_names=(\"key\", \"reverse\"), default_count=2, type_shape=tshape_none\n# )\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinParameterSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Optimizations of built-ins to built-in calls.\n\n\"\"\"\n\nimport math\n\nfrom nuitka import Options\nfrom nuitka.__past__ import builtins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import optimization_logger\n\nfrom .ParameterSpecs import ParameterSpec, TooManyArguments, matchCall\n\n\nclass BuiltinParameterSpec(ParameterSpec):\n    __slots__ = (\"builtin\",)\n\n    def __init__(\n        self,\n        name,\n        arg_names,\n        default_count,\n        list_star_arg=None,\n        is_list_star_arg_single=False,\n        dict_star_arg=None,\n        pos_only_args=(),\n        kw_only_args=(),\n        type_shape=None,\n    ):\n        ParameterSpec.__init__(\n            self,\n            ps_name=name,\n            ps_normal_args=arg_names,\n            ps_list_star_arg=list_star_arg,\n            ps_is_list_star_arg_single=is_list_star_arg_single,\n            ps_dict_star_arg=dict_star_arg,\n            ps_default_count=default_count,\n            ps_pos_only_args=pos_only_args,\n            ps_kw_only_args=kw_only_args,\n            type_shape=type_shape,\n        )\n\n        self.builtin = getattr(builtins, name, None)\n\n        assert default_count <= len(arg_names) + len(kw_only_args) + len(pos_only_args)\n\n    def __repr__(self):\n        return \"<BuiltinParameterSpec %s>\" % self.name\n\n    def getName(self):\n        return self.name\n\n    def isCompileTimeComputable(self, values):\n        # By default, we make this dependent on the ability to compute the\n        # arguments, which is of course a good start for most cases, so this\n        # is for overloads, pylint: disable=no-self-use\n\n        for value in values:\n            if value is not None and not value.isCompileTimeConstant():\n                return False\n\n        return True\n\n    @staticmethod\n    def isUserProvided(values):\n        if Options.is_debug:\n            for value in values:\n                if (\n                    value is not None\n                    and not value.isExpressionConstantRef()\n                    and getattr(value, \"user_provided\", True)\n                ):\n                    return False\n\n            return True\n        else:\n            return False\n\n    def simulateCall(self, given_values):\n        # Using star dict call for simulation and catch any exception as really\n        # fatal, pylint: disable=broad-except,too-many-branches\n\n        try:\n            given_normal_args = given_values[: self.getArgumentCount()]\n\n            if self.list_star_arg:\n                given_list_star_args = given_values[self.getArgumentCount()]\n            else:\n                given_list_star_args = None\n\n            if self.dict_star_arg:\n                given_dict_star_args = given_values[-1]\n            else:\n                given_dict_star_args = None\n\n            arg_dict = {}\n\n            for arg_name, given_value in zip(\n                self.getArgumentNames(), given_normal_args\n            ):\n                assert type(given_value) not in (\n                    tuple,\n                    list,\n                ), \"do not like a tuple %s\" % (given_value,)\n\n                if given_value is not None:\n                    arg_dict[arg_name] = given_value.getCompileTimeConstant()\n\n            if given_dict_star_args:\n                for given_dict_star_arg in reversed(given_dict_star_args):\n                    arg_name = given_dict_star_arg.getKeyCompileTimeConstant()\n                    arg_value = given_dict_star_arg.getValueCompileTimeConstant()\n\n                    arg_dict[arg_name] = arg_value\n\n            arg_list = []\n\n            for arg_name in self.getArgumentNames():\n                if arg_name not in arg_dict:\n                    break\n\n                arg_list.append(arg_dict[arg_name])\n                del arg_dict[arg_name]\n\n        except Exception as e:\n            optimization_logger.sysexit_exception(\"Fatal optimization problem\", e)\n\n        if given_list_star_args:\n            return self.builtin(\n                *(\n                    arg_list\n                    + list(\n                        value.getCompileTimeConstant() for value in given_list_star_args\n                    )\n                ),\n                **arg_dict\n            )\n        else:\n            return self.builtin(*arg_list, **arg_dict)\n\n\nclass BuiltinParameterSpecNoKeywords(BuiltinParameterSpec):\n    __slots__ = ()\n\n    def allowsKeywords(self):\n        return False\n\n    def simulateCall(self, given_values):\n        # Using star dict call for simulation and catch any exception as really fatal,\n        # pylint: disable=broad-except\n\n        try:\n            if self.list_star_arg:\n                given_list_star_arg = given_values[self.getArgumentCount()]\n            else:\n                given_list_star_arg = None\n\n            arg_list = []\n            refuse_more = False\n\n            for _arg_name, given_value in zip(self.getArgumentNames(), given_values):\n                assert type(given_value) not in (\n                    tuple,\n                    list,\n                ), \"do not like tuple %s\" % (given_value,)\n\n                if given_value is not None:\n                    if not refuse_more:\n                        arg_list.append(given_value.getCompileTimeConstant())\n                    else:\n                        assert False\n                else:\n                    refuse_more = True\n\n            if given_list_star_arg is not None:\n                arg_list += [\n                    value.getCompileTimeConstant() for value in given_list_star_arg\n                ]\n        except Exception as e:\n            optimization_logger.sysexit_exception(\"matching call\", e)\n\n        return self.builtin(*arg_list)\n\n\nclass BuiltinParameterSpecExceptionsKwOnly(BuiltinParameterSpec):\n    def __init__(self, exception_name, kw_only_args):\n        BuiltinParameterSpec.__init__(\n            self,\n            name=exception_name,\n            arg_names=(),\n            default_count=len(kw_only_args),  # For exceptions, they will be required.\n            list_star_arg=\"args\",\n            kw_only_args=kw_only_args,\n        )\n\n\nclass BuiltinParameterSpecExceptions(BuiltinParameterSpec):\n    def __init__(self, exception_name):\n        BuiltinParameterSpec.__init__(\n            self,\n            name=exception_name,\n            arg_names=(),\n            default_count=0,\n            list_star_arg=\"args\",\n        )\n\n    def allowsKeywords(self):\n        return False\n\n    def getKeywordRefusalText(self):\n        return \"exceptions.%s does not take keyword arguments\" % self.name\n\n    def getCallableName(self):\n        return \"exceptions.\" + self.getName()\n\n\ndef makeBuiltinExceptionParameterSpec(exception_name):\n    \"\"\"Factory function to create parameter spec for an exception from its name.\n\n    Args:\n        exception_name - (str) name of the built-in exception\n\n    Returns:\n        ParameterSpec that can be used to evaluate calls of these exceptions.\n    \"\"\"\n    if exception_name == \"ImportError\" and python_version >= 0x300:\n        # This is currently the only known built-in exception that does it, but let's\n        # be general, as surely that list is going to expand only.\n\n        return BuiltinParameterSpecExceptionsKwOnly(\n            exception_name=exception_name, kw_only_args=(\"name\", \"path\")\n        )\n    else:\n        return BuiltinParameterSpecExceptions(exception_name=exception_name)\n\n\nclass BuiltinParameterSpecPosArgs(BuiltinParameterSpec):\n    def __init__(\n        self,\n        name,\n        pos_only_args,\n        arg_names,\n        default_count,\n        list_star_arg=None,\n        dict_star_arg=None,\n    ):\n        BuiltinParameterSpec.__init__(\n            self,\n            name=name,\n            arg_names=arg_names,\n            default_count=default_count,\n            pos_only_args=pos_only_args,\n            list_star_arg=list_star_arg,\n            dict_star_arg=dict_star_arg,\n        )\n\n\nif python_version < 0x370:\n    builtin_int_spec = BuiltinParameterSpec(\"int\", (\"x\", \"base\"), default_count=2)\nelse:\n    builtin_int_spec = BuiltinParameterSpecPosArgs(\n        \"int\", (\"x\",), (\"base\",), default_count=2\n    )\n\n\n# These builtins are only available for Python2\nbuiltin_long_spec = BuiltinParameterSpec(\"long\", (\"x\", \"base\"), default_count=2)\nbuiltin_execfile_spec = BuiltinParameterSpecNoKeywords(\n    \"execfile\", (\"filename\", \"globals\", \"locals\"), default_count=2\n)\n\nbuiltin_unicode_p2_spec = BuiltinParameterSpec(\n    \"unicode\", (\"string\", \"encoding\", \"errors\"), default_count=3\n)\n\nbuiltin_xrange_spec = BuiltinParameterSpecNoKeywords(\n    \"xrange\" if python_version < 0x300 else \"range\",\n    (\"start\", \"stop\", \"step\"),\n    default_count=2,\n)\n\n\nif python_version < 0x370:\n    builtin_bool_spec = BuiltinParameterSpec(\"bool\", (\"x\",), default_count=1)\nelse:\n    builtin_bool_spec = BuiltinParameterSpecNoKeywords(\"bool\", (\"x\",), default_count=1)\n\nif python_version < 0x370:\n    builtin_float_spec = BuiltinParameterSpec(\"float\", (\"x\",), default_count=1)\nelse:\n    builtin_float_spec = BuiltinParameterSpecNoKeywords(\n        \"float\", (\"x\",), default_count=1\n    )\n\nbuiltin_complex_spec = BuiltinParameterSpec(\n    \"complex\", (\"real\", \"imag\"), default_count=2\n)\n\n# This built-in have variable parameters for Python2/3\nif python_version < 0x300:\n    builtin_str_spec = BuiltinParameterSpec(\"str\", (\"object\",), default_count=1)\nelse:\n    builtin_str_spec = BuiltinParameterSpec(\n        \"str\", (\"object\", \"encoding\", \"errors\"), default_count=3\n    )\n\nbuiltin_len_spec = BuiltinParameterSpecNoKeywords(\"len\", (\"object\",), default_count=0)\n\n\nclass BuiltinParameterSpecSinglePosArgStarDictArgs(BuiltinParameterSpec):\n    def __init__(\n        self, name, list_star_arg=\"list_args\", dict_star_arg=\"kw_args\", type_shape=None\n    ):\n        BuiltinParameterSpec.__init__(\n            self,\n            name=name,\n            arg_names=(),\n            default_count=0,\n            list_star_arg=list_star_arg,\n            is_list_star_arg_single=True,\n            dict_star_arg=dict_star_arg,\n            type_shape=type_shape,\n        )\n\n\nbuiltin_dict_spec = BuiltinParameterSpecSinglePosArgStarDictArgs(\"dict\")\nbuiltin_any_spec = BuiltinParameterSpecNoKeywords(\"any\", (\"object\",), default_count=0)\nbuiltin_abs_spec = BuiltinParameterSpecNoKeywords(\"abs\", (\"object\",), default_count=0)\nbuiltin_all_spec = BuiltinParameterSpecNoKeywords(\"all\", (\"object\",), default_count=0)\n\nif python_version < 0x370:\n    builtin_tuple_spec = BuiltinParameterSpec(\"tuple\", (\"sequence\",), default_count=1)\n    builtin_list_spec = BuiltinParameterSpec(\"list\", (\"sequence\",), default_count=1)\nelse:\n    builtin_tuple_spec = BuiltinParameterSpecNoKeywords(\n        \"tuple\", (\"sequence\",), default_count=1\n    )\n    builtin_list_spec = BuiltinParameterSpecNoKeywords(\n        \"list\", (\"sequence\",), default_count=1\n    )\n\nbuiltin_set_spec = BuiltinParameterSpecNoKeywords(\"set\", (\"iterable\",), default_count=1)\nbuiltin_frozenset_spec = BuiltinParameterSpecNoKeywords(\n    \"frozenset\", (\"iterable\",), default_count=1\n)\n\nbuiltin_import_spec = BuiltinParameterSpec(\n    \"__import__\", (\"name\", \"globals\", \"locals\", \"fromlist\", \"level\"), default_count=4\n)\n\nif python_version < 0x300:\n    builtin_open_spec = BuiltinParameterSpec(\n        \"open\", (\"name\", \"mode\", \"buffering\"), default_count=3\n    )\nelse:\n    builtin_open_spec = BuiltinParameterSpec(\n        \"open\",\n        (\n            \"file\",\n            \"mode\",\n            \"buffering\",\n            \"encoding\",\n            \"errors\",\n            \"newline\",\n            \"closefd\",\n            \"opener\",\n        ),\n        default_count=7,\n    )\n\nbuiltin_chr_spec = BuiltinParameterSpecNoKeywords(\"chr\", (\"i\",), default_count=0)\nbuiltin_ord_spec = BuiltinParameterSpecNoKeywords(\"ord\", (\"c\",), default_count=0)\nbuiltin_bin_spec = BuiltinParameterSpecNoKeywords(\"bin\", (\"number\",), default_count=0)\nbuiltin_oct_spec = BuiltinParameterSpecNoKeywords(\"oct\", (\"number\",), default_count=0)\nbuiltin_hex_spec = BuiltinParameterSpecNoKeywords(\"hex\", (\"number\",), default_count=0)\nbuiltin_id_spec = BuiltinParameterSpecNoKeywords(\"id\", (\"object\",), default_count=0)\nbuiltin_repr_spec = BuiltinParameterSpecNoKeywords(\"repr\", (\"object\",), default_count=0)\n\nbuiltin_dir_spec = BuiltinParameterSpecNoKeywords(\"dir\", (\"object\",), default_count=1)\nbuiltin_vars_spec = BuiltinParameterSpecNoKeywords(\"vars\", (\"object\",), default_count=1)\n\nbuiltin_locals_spec = BuiltinParameterSpecNoKeywords(\"locals\", (), default_count=0)\nbuiltin_globals_spec = BuiltinParameterSpecNoKeywords(\"globals\", (), default_count=0)\nbuiltin_eval_spec = BuiltinParameterSpecNoKeywords(\n    \"eval\", (\"source\", \"globals\", \"locals\"), 2\n)\nif python_version < 0x300:\n    builtin_compile_spec = BuiltinParameterSpec(\n        \"compile\",\n        (\"source\", \"filename\", \"mode\", \"flags\", \"dont_inherit\"),\n        default_count=2,\n    )\nelse:\n    builtin_compile_spec = BuiltinParameterSpec(\n        \"compile\",\n        (\"source\", \"filename\", \"mode\", \"flags\", \"dont_inherit\", \"optimize\"),\n        default_count=3,\n    )\n\nif python_version >= 0x3B0:\n    builtin_exec_spec = BuiltinParameterSpec(\n        \"exec\",\n        (\"source\", \"globals\", \"locals\"),\n        default_count=3,\n        kw_only_args=(\"closure\",),\n    )\nelif python_version >= 0x300:\n    builtin_exec_spec = BuiltinParameterSpecNoKeywords(\n        \"exec\", (\"source\", \"globals\", \"locals\"), default_count=2\n    )\n\n# Note: Iter in fact names its first argument if the default applies\n# \"collection\", fixed up in a wrapper.\nbuiltin_iter_spec = BuiltinParameterSpecNoKeywords(\n    \"iter\", (\"callable\", \"sentinel\"), default_count=1\n)\nbuiltin_next_spec = BuiltinParameterSpecNoKeywords(\n    \"next\", (\"iterator\", \"default\"), default_count=1\n)\n\n# Note: type with 1 and type with 3 arguments are too different.\nbuiltin_type1_spec = BuiltinParameterSpecNoKeywords(\n    \"type\", (\"object\",), default_count=0\n)\nbuiltin_type3_spec = BuiltinParameterSpecNoKeywords(\n    \"type\", (\"name\", \"bases\", \"dict\"), default_count=0\n)\n\nbuiltin_super_spec = BuiltinParameterSpecNoKeywords(\n    \"super\", (\"type\", \"object\"), default_count=1 if python_version < 0x300 else 2\n)\n\nbuiltin_hasattr_spec = BuiltinParameterSpecNoKeywords(\n    \"hasattr\", (\"object\", \"name\"), default_count=0\n)\nbuiltin_getattr_spec = BuiltinParameterSpecNoKeywords(\n    \"getattr\", (\"object\", \"name\", \"default\"), default_count=1\n)\nbuiltin_setattr_spec = BuiltinParameterSpecNoKeywords(\n    \"setattr\", (\"object\", \"name\", \"value\"), default_count=0\n)\n\nbuiltin_isinstance_spec = BuiltinParameterSpecNoKeywords(\n    \"isinstance\", (\"instance\", \"classes\"), default_count=0\n)\n\nbuiltin_issubclass_spec = BuiltinParameterSpecNoKeywords(\n    \"issubclass\", (\"cls\", \"classes\"), default_count=0\n)\n\n\nclass BuiltinBytearraySpec(BuiltinParameterSpecPosArgs):\n    def isCompileTimeComputable(self, values):\n        # For bytearrays, we need to avoid the case of large bytearray\n        # construction from an integer at compile time.\n\n        result = BuiltinParameterSpec.isCompileTimeComputable(self, values=values)\n\n        if result and len(values) == 1:\n            index_value = values[0].getIndexValue()\n\n            if index_value is None:\n                return result\n\n            return index_value < 256\n        else:\n            return result\n\n\nbuiltin_bytearray_spec = BuiltinBytearraySpec(\n    \"bytearray\", (\"string\",), (\"encoding\", \"errors\"), default_count=2\n)\n\nbuiltin_bytes_p3_spec = BuiltinBytearraySpec(\n    \"bytes\", (\"string\",), (\"encoding\", \"errors\"), default_count=3\n)\n\n\n# Beware: One argument version defines \"stop\", not \"start\".\nbuiltin_slice_spec = BuiltinParameterSpecNoKeywords(\n    \"slice\", (\"start\", \"stop\", \"step\"), default_count=2\n)\n\nbuiltin_hash_spec = BuiltinParameterSpecNoKeywords(\"hash\", (\"object\",), default_count=0)\n\nbuiltin_input_spec = BuiltinParameterSpecNoKeywords(\n    \"input\", (\"prompt\",), default_count=1\n)\n\nbuiltin_format_spec = BuiltinParameterSpecNoKeywords(\n    \"format\", (\"value\", \"format_spec\"), default_count=1\n)\n\nif python_version < 0x380:\n    builtin_sum_spec = BuiltinParameterSpecNoKeywords(\n        \"sum\", (\"sequence\", \"start\"), default_count=1\n    )\nelse:\n    builtin_sum_spec = BuiltinParameterSpecPosArgs(\n        \"sum\", (\"sequence\",), (\"start\",), default_count=1\n    )\n\nbuiltin_staticmethod_spec = BuiltinParameterSpecNoKeywords(\n    \"staticmethod\", (\"function\",), default_count=0\n)\nbuiltin_classmethod_spec = BuiltinParameterSpecNoKeywords(\n    \"classmethod\", (\"function\",), default_count=0\n)\n\nif python_version < 0x300:\n    builtin_sorted_spec = BuiltinParameterSpecNoKeywords(\n        \"sorted\", (\"iterable\", \"cmp\", \"key\", \"reverse\"), default_count=2\n    )\nelse:\n    builtin_sorted_spec = BuiltinParameterSpecNoKeywords(\n        \"sorted\", (\"iterable\", \"key\", \"reverse\"), default_count=2\n    )\n\nbuiltin_reversed_spec = BuiltinParameterSpecNoKeywords(\n    \"reversed\", (\"object\",), default_count=0\n)\n\nbuiltin_reversed_spec = BuiltinParameterSpecNoKeywords(\n    \"reversed\", (\"object\",), default_count=0\n)\n\nif python_version < 0x300:\n    builtin_enumerate_spec = BuiltinParameterSpec(\n        \"enumerate\", (\"sequence\", \"start\"), default_count=1\n    )\nelse:\n    builtin_enumerate_spec = BuiltinParameterSpec(\n        \"enumerate\", (\"iterable\", \"start\"), default_count=1\n    )\n\n\nclass BuiltinRangeSpec(BuiltinParameterSpecNoKeywords):\n    def isCompileTimeComputable(self, values):\n        # For ranges, we need have many cases that can prevent the ability\n        # to pre-compute, pylint: disable=too-many-branches,too-many-return-statements\n\n        result = BuiltinParameterSpecNoKeywords.isCompileTimeComputable(\n            self, values=values\n        )\n\n        if result:\n            arg_count = len(values)\n\n            if arg_count == 1:\n                low = values[0]\n\n                # If it's not a number constant, we can compute the exception\n                # that will be raised.\n                if not low.isNumberConstant():\n                    return True\n\n                return low.getCompileTimeConstant() < 256\n            elif arg_count == 2:\n                low, high = values\n\n                # If it's not a number constant, we can compute the exception\n                # that will be raised.\n                if not low.isNumberConstant() or not high.isNumberConstant():\n                    return True\n\n                return (\n                    high.getCompileTimeConstant() - low.getCompileTimeConstant() < 256\n                )\n            elif arg_count == 3:\n                low, high, step = values\n\n                if (\n                    not low.isNumberConstant()\n                    or not high.isNumberConstant()\n                    or not step.isNumberConstant()\n                ):\n                    return True\n\n                low = low.getCompileTimeConstant()\n                high = high.getCompileTimeConstant()\n                step = step.getCompileTimeConstant()\n\n                # It's going to give a ZeroDivisionError in this case.\n                if step == 0:\n                    return True\n\n                if low < high:\n                    if step < 0:\n                        return True\n                    else:\n                        return math.ceil(float(high - low) / step) < 256\n                else:\n                    if step > 0:\n                        return True\n                    else:\n                        return math.ceil(float(high - low) / step) < 256\n            else:\n                assert False\n        else:\n            return False\n\n\nbuiltin_range_spec = BuiltinRangeSpec(\n    \"range\", (\"start\", \"stop\", \"step\"), default_count=2\n)\n\nif python_version >= 0x300:\n    builtin_ascii_spec = BuiltinParameterSpecNoKeywords(\n        \"ascii\", (\"object\",), default_count=0\n    )\n\n\nbuiltin_divmod_spec = BuiltinParameterSpecNoKeywords(\n    \"divmod\", (\"left\", \"right\"), default_count=0\n)\n\n\ndef extractBuiltinArgs(node, builtin_spec, builtin_class, empty_special_class=None):\n    # Many cases to deal with, pylint: disable=too-many-branches\n\n    # TODO: Special hack for type.__prepare__(*args, **kwargs) to work with even\n    # unknown dictionaries.\n\n    if (\n        builtin_spec.getStarListArgumentName()\n        and builtin_spec.getStarDictArgumentName() == \"kwargs\"\n        and not builtin_spec.getArgumentNames()\n    ):\n        return builtin_class(\n            node.subnode_args, node.subnode_kwargs, source_ref=node.getSourceReference()\n        )\n\n    try:\n        kw = node.subnode_kwargs\n\n        # TODO: Could check for too many / too few, even if they are unknown, we\n        # might raise that error, but that need not be optimized immediately.\n        if kw is not None:\n            if not kw.isMappingWithConstantStringKeys():\n                return None\n\n            pairs = kw.getMappingStringKeyPairs()\n\n            if pairs and not builtin_spec.allowsKeywords():\n                raise TooManyArguments(TypeError(builtin_spec.getKeywordRefusalText()))\n        else:\n            pairs = ()\n\n        args = node.subnode_args\n\n        if args:\n            if not args.canPredictIterationValues():\n                return None\n\n            positional = args.getIterationValues()\n        else:\n            positional = ()\n\n        if not positional and not pairs and empty_special_class is not None:\n            return empty_special_class(source_ref=node.getSourceReference())\n\n        args_dict = matchCall(\n            func_name=builtin_spec.getName(),\n            args=builtin_spec.getArgumentNames(),\n            kw_only_args=builtin_spec.getKwOnlyParameterNames(),\n            star_list_arg=builtin_spec.getStarListArgumentName(),\n            star_list_single_arg=builtin_spec.isStarListSingleArg(),\n            star_dict_arg=builtin_spec.getStarDictArgumentName(),\n            num_defaults=builtin_spec.getDefaultCount(),\n            num_pos_only=builtin_spec.getPosOnlyParameterCount(),\n            positional=positional,\n            pairs=pairs,\n        )\n    except TooManyArguments as e:\n        from nuitka.nodes.NodeMakingHelpers import (\n            makeRaiseExceptionReplacementExpressionFromInstance,\n            wrapExpressionWithSideEffects,\n        )\n\n        return wrapExpressionWithSideEffects(\n            new_node=makeRaiseExceptionReplacementExpressionFromInstance(\n                expression=node, exception=e.getRealException()\n            ),\n            old_node=node,\n            side_effects=node.extractSideEffectsPreCall(),\n        )\n\n    # Using list reference for passing the arguments without names where it\n    # it possible, otherwise dictionary to make those distinguishable.\n    args_list = []\n\n    for argument_name in builtin_spec.getArgumentNames():\n        args_list.append(args_dict[argument_name])\n\n    if builtin_spec.getStarListArgumentName() is not None:\n        args_list.append(args_dict[builtin_spec.getStarListArgumentName()])\n\n    if builtin_spec.getStarDictArgumentName() is not None:\n        args_list.append(args_dict[builtin_spec.getStarDictArgumentName()])\n\n    for argument_name in builtin_spec.getKwOnlyParameterNames():\n        args_list.append(args_dict[argument_name])\n\n    # Using list reference for passing the arguments without names,\n    result = builtin_class(*args_list, source_ref=node.getSourceReference())\n\n    if python_version < 0x380:\n        result.setCompatibleSourceReference(node.getCompatibleSourceReference())\n\n    return result\n\n\nclass BuiltinMethodParameterSpecBase(BuiltinParameterSpec):\n    __slots__ = ()\n\n    def __init__(\n        self,\n        name,\n        arg_names=(),\n        default_count=0,\n        list_star_arg=None,\n        dict_star_arg=None,\n        pos_only_args=(),\n        kw_only_args=(),\n        type_shape=None,\n    ):\n        BuiltinParameterSpec.__init__(\n            self,\n            name=\"bytes.\" + name,\n            arg_names=arg_names,\n            default_count=default_count,\n            list_star_arg=list_star_arg,\n            dict_star_arg=dict_star_arg,\n            pos_only_args=pos_only_args,\n            kw_only_args=kw_only_args,\n            type_shape=type_shape,\n        )\n\n\nclass BuiltinMethodParameterSpecNoKeywordsBase(BuiltinParameterSpecNoKeywords):\n    __slots__ = ()\n\n    # For overload\n    method_prefix = None\n\n    def __init__(\n        self,\n        name,\n        arg_names=(),\n        default_count=0,\n        list_star_arg=None,\n        dict_star_arg=None,\n        pos_only_args=(),\n        kw_only_args=(),\n        type_shape=None,\n    ):\n        BuiltinParameterSpecNoKeywords.__init__(\n            self,\n            name=self.method_prefix + \".\" + name,\n            arg_names=arg_names,\n            default_count=default_count,\n            list_star_arg=list_star_arg,\n            dict_star_arg=dict_star_arg,\n            pos_only_args=pos_only_args,\n            kw_only_args=kw_only_args,\n            type_shape=type_shape,\n        )\n\n    if Options.is_full_compat:\n\n        def getKeywordRefusalText(self):\n            assert \".\" in self.name, self.name\n\n            if self.method_prefix == \"bytes\":\n                type_example_value = \"b''\"\n            elif self.method_prefix == \"str\":\n                type_example_value = \"''\"\n            elif self.method_prefix == \"unicode\":\n                type_example_value = \"u''\"\n            elif self.method_prefix == \"dict\":\n                type_example_value = \"{}\"\n            elif self.method_prefix == \"list\":\n                type_example_value = \"[]\"\n            elif self.method_prefix == \"type\":\n                type_example_value = \"type\"\n            else:\n                return \"%s() takes no keyword arguments\" % self.name\n\n            try:\n                eval(  # These are harmless calls, pylint: disable=eval-used\n                    \"%s.%s(x=1)\" % (type_example_value, self.name.split(\".\")[-1])\n                )\n            except TypeError as e:\n                return str(e)\n            else:\n                assert False, self.name\n\n    else:\n\n        def getKeywordRefusalText(self):\n            return \"%s() takes no keyword arguments\" % self.name\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinStrOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Str operation specs. \"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_int,\n    tshape_list,\n    tshape_str,\n    tshape_tuple,\n)\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinMethodParameterSpecBase,\n    BuiltinMethodParameterSpecNoKeywordsBase,\n)\n\n\nclass StrMethodSpecNoKeywords(BuiltinMethodParameterSpecNoKeywordsBase):\n    __slots__ = ()\n\n    method_prefix = \"str\"\n\n\nclass StrMethodSpec(BuiltinMethodParameterSpecBase):\n    __slots__ = ()\n\n    method_prefix = \"str\"\n\n\nstr_join_spec = StrMethodSpecNoKeywords(\n    \"join\", arg_names=(\"iterable\",), type_shape=tshape_str\n)\nstr_partition_spec = StrMethodSpecNoKeywords(\n    \"partition\", arg_names=(\"sep\",), type_shape=tshape_tuple\n)\nstr_rpartition_spec = StrMethodSpecNoKeywords(\n    \"rpartition\", arg_names=(\"sep\",), type_shape=tshape_tuple\n)\nstr_strip_spec = StrMethodSpecNoKeywords(\n    \"strip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_str\n)\nstr_lstrip_spec = StrMethodSpecNoKeywords(\n    \"lstrip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_str\n)\nstr_rstrip_spec = StrMethodSpecNoKeywords(\n    \"rstrip\", arg_names=(\"chars\",), default_count=1, type_shape=tshape_str\n)\nstr_find_spec = StrMethodSpecNoKeywords(\n    \"find\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nstr_rfind_spec = StrMethodSpecNoKeywords(\n    \"rfind\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nstr_index_spec = StrMethodSpecNoKeywords(\n    \"index\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\nstr_rindex_spec = StrMethodSpecNoKeywords(\n    \"rindex\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\n\nstr_split_spec = (StrMethodSpecNoKeywords if str is bytes else StrMethodSpec)(\n    \"split\", arg_names=(\"sep\", \"maxsplit\"), default_count=2, type_shape=tshape_list\n)\nstr_rsplit_spec = (StrMethodSpecNoKeywords if str is bytes else StrMethodSpec)(\n    \"rsplit\", arg_names=(\"sep\", \"maxsplit\"), default_count=2, type_shape=tshape_list\n)\n\nstr_startswith_spec = StrMethodSpecNoKeywords(\n    \"startswith\",\n    arg_names=(\"prefix\", \"start\", \"end\"),\n    default_count=2,\n    type_shape=tshape_bool,\n)\nstr_endswith_spec = StrMethodSpecNoKeywords(\n    \"endswith\",\n    arg_names=(\"suffix\", \"start\", \"end\"),\n    default_count=2,\n    type_shape=tshape_bool,\n)\n\nstr_replace_spec = StrMethodSpecNoKeywords(\n    \"replace\", arg_names=(\"old\", \"new\", \"count\"), default_count=1, type_shape=tshape_str\n)\n\nstr_count_spec = StrMethodSpecNoKeywords(\n    \"count\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2, type_shape=tshape_int\n)\n\nstr_format_spec = StrMethodSpec(\n    \"format\", list_star_arg=\"args\", dict_star_arg=\"pairs\", type_shape=tshape_str\n)\n\nstr_capitalize_spec = StrMethodSpecNoKeywords(\n    \"capitalize\", arg_names=(), type_shape=tshape_str\n)\nstr_upper_spec = StrMethodSpecNoKeywords(\"upper\", arg_names=(), type_shape=tshape_str)\nstr_lower_spec = StrMethodSpecNoKeywords(\"lower\", arg_names=(), type_shape=tshape_str)\nstr_swapcase_spec = StrMethodSpecNoKeywords(\n    \"swapcase\", arg_names=(), type_shape=tshape_str\n)\nstr_title_spec = StrMethodSpecNoKeywords(\"title\", arg_names=(), type_shape=tshape_str)\nstr_isalnum_spec = StrMethodSpecNoKeywords(\n    \"isalnum\", arg_names=(), type_shape=tshape_bool\n)\nstr_isalpha_spec = StrMethodSpecNoKeywords(\n    \"isalpha\", arg_names=(), type_shape=tshape_bool\n)\nstr_isdigit_spec = StrMethodSpecNoKeywords(\n    \"isdigit\", arg_names=(), type_shape=tshape_bool\n)\nstr_islower_spec = StrMethodSpecNoKeywords(\n    \"islower\", arg_names=(), type_shape=tshape_bool\n)\nstr_isupper_spec = StrMethodSpecNoKeywords(\n    \"isupper\", arg_names=(), type_shape=tshape_bool\n)\nstr_isspace_spec = StrMethodSpecNoKeywords(\n    \"isspace\", arg_names=(), type_shape=tshape_bool\n)\nstr_istitle_spec = StrMethodSpecNoKeywords(\n    \"istitle\", arg_names=(), type_shape=tshape_bool\n)\n\nstr_encode_spec = StrMethodSpec(\n    \"encode\",\n    arg_names=(\"encoding\", \"errors\"),\n    default_count=2,\n    # TODO: Resolve Python2/Python3 runtime differences\n    #\n    # type_shape=tshape_bytes\n)\n\n# Python2 only, Python3 this is in bytes\nstr_decode_spec = StrMethodSpec(\n    \"decode\",\n    arg_names=(\"encoding\", \"errors\"),\n    default_count=2,\n    # TODO: Resolve Python2/Python3 runtime differences\n    #\n    # type_shape=tshape_str_or_unicode\n)\n\nstr_expandtabs_spec = (StrMethodSpecNoKeywords if str is bytes else StrMethodSpec)(\n    \"expandtabs\", arg_names=(\"tabsize\",), default_count=1, type_shape=tshape_str\n)\n\nstr_center_spec = StrMethodSpecNoKeywords(\n    \"center\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_str\n)\nstr_ljust_spec = StrMethodSpecNoKeywords(\n    \"ljust\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_str\n)\nstr_rjust_spec = StrMethodSpecNoKeywords(\n    \"rjust\", arg_names=(\"width\", \"fillchar\"), default_count=1, type_shape=tshape_str\n)\nstr_zfill_spec = StrMethodSpecNoKeywords(\n    \"zfill\", arg_names=(\"width\",), type_shape=tshape_str\n)\nstr_translate_spec = StrMethodSpecNoKeywords(\n    \"translate\", arg_names=(\"table\",), type_shape=tshape_str\n)\nstr_splitlines_spec = (StrMethodSpecNoKeywords if str is bytes else StrMethodSpec)(\n    \"splitlines\", arg_names=(\"keepends\"), default_count=1, type_shape=tshape_list\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinTypeOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Type operation specs. \"\"\"\n\nfrom .BuiltinParameterSpecs import BuiltinMethodParameterSpecBase\n\n\nclass TypeMethodSpec(BuiltinMethodParameterSpecBase):\n    \"\"\"Method spec of exactly the `type` built-in value/type.\"\"\"\n\n    __slots__ = ()\n\n    method_prefix = \"type\"\n\n\ntype___prepare___spec = TypeMethodSpec(\n    name=\"__prepare__\", list_star_arg=\"args\", dict_star_arg=\"kwargs\"\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/BuiltinUnicodeOperationSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Unicode operation specs, Python2 only. \"\"\"\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinMethodParameterSpecBase,\n    BuiltinMethodParameterSpecNoKeywordsBase,\n)\n\n\nclass UnicodeMethodSpecNoKeywords(BuiltinMethodParameterSpecNoKeywordsBase):\n    __slots__ = ()\n\n    method_prefix = \"unicode\"\n\n\nclass UnicodeMethodSpec(BuiltinMethodParameterSpecBase):\n    __slots__ = ()\n\n    method_prefix = \"unicode\"\n\n\nunicode_join_spec = UnicodeMethodSpecNoKeywords(\"join\", arg_names=(\"iterable\",))\nunicode_partition_spec = UnicodeMethodSpecNoKeywords(\"partition\", arg_names=(\"sep\",))\nunicode_rpartition_spec = UnicodeMethodSpecNoKeywords(\"rpartition\", arg_names=(\"sep\",))\nunicode_strip_spec = UnicodeMethodSpecNoKeywords(\n    \"strip\", arg_names=(\"chars\",), default_count=1\n)\nunicode_lstrip_spec = UnicodeMethodSpecNoKeywords(\n    \"lstrip\", arg_names=(\"chars\",), default_count=1\n)\nunicode_rstrip_spec = UnicodeMethodSpecNoKeywords(\n    \"rstrip\", arg_names=(\"chars\",), default_count=1\n)\nunicode_find_spec = UnicodeMethodSpecNoKeywords(\n    \"find\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2\n)\nunicode_rfind_spec = UnicodeMethodSpecNoKeywords(\n    \"rfind\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2\n)\nunicode_index_spec = UnicodeMethodSpecNoKeywords(\n    \"index\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2\n)\nunicode_rindex_spec = UnicodeMethodSpecNoKeywords(\n    \"rindex\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2\n)\nunicode_split_spec = UnicodeMethodSpecNoKeywords(\n    \"split\", arg_names=(\"sep\", \"maxsplit\"), default_count=2\n)\nunicode_rsplit_spec = UnicodeMethodSpecNoKeywords(\n    \"rsplit\", arg_names=(\"sep\", \"maxsplit\"), default_count=2\n)\n\nunicode_startswith_spec = UnicodeMethodSpecNoKeywords(\n    \"startswith\", arg_names=(\"prefix\", \"start\", \"end\"), default_count=2\n)\nunicode_endswith_spec = UnicodeMethodSpecNoKeywords(\n    \"endswith\", arg_names=(\"suffix\", \"start\", \"end\"), default_count=2\n)\n\nunicode_replace_spec = UnicodeMethodSpecNoKeywords(\n    \"replace\", arg_names=(\"old\", \"new\", \"count\"), default_count=1\n)\n\nunicode_count_spec = UnicodeMethodSpecNoKeywords(\n    \"count\", arg_names=(\"sub\", \"start\", \"end\"), default_count=2\n)\n\nunicode_format_spec = UnicodeMethodSpec(\n    \"format\", list_star_arg=\"args\", dict_star_arg=\"pairs\"\n)\n\nunicode_capitalize_spec = UnicodeMethodSpecNoKeywords(\"capitalize\", arg_names=())\nunicode_upper_spec = UnicodeMethodSpecNoKeywords(\"upper\", arg_names=())\nunicode_lower_spec = UnicodeMethodSpecNoKeywords(\"lower\", arg_names=())\nunicode_swapcase_spec = UnicodeMethodSpecNoKeywords(\"swapcase\", arg_names=())\nunicode_title_spec = UnicodeMethodSpecNoKeywords(\"title\", arg_names=())\nunicode_isalnum_spec = UnicodeMethodSpecNoKeywords(\"isalnum\", arg_names=())\nunicode_isalpha_spec = UnicodeMethodSpecNoKeywords(\"isalpha\", arg_names=())\nunicode_isdigit_spec = UnicodeMethodSpecNoKeywords(\"isdigit\", arg_names=())\nunicode_islower_spec = UnicodeMethodSpecNoKeywords(\"islower\", arg_names=())\nunicode_isupper_spec = UnicodeMethodSpecNoKeywords(\"isupper\", arg_names=())\nunicode_isspace_spec = UnicodeMethodSpecNoKeywords(\"isspace\", arg_names=())\nunicode_istitle_spec = UnicodeMethodSpecNoKeywords(\"istitle\", arg_names=())\n\nunicode_encode_spec = UnicodeMethodSpec(\n    \"encode\", arg_names=(\"encoding\", \"errors\"), default_count=2\n)\n\nunicode_expandtabs_spec = UnicodeMethodSpecNoKeywords(\n    \"expandtabs\", arg_names=(\"tabsize\",), default_count=1\n)\n\nunicode_center_spec = UnicodeMethodSpecNoKeywords(\n    \"center\", arg_names=(\"width\", \"fillchar\"), default_count=1\n)\nunicode_ljust_spec = UnicodeMethodSpecNoKeywords(\n    \"ljust\", arg_names=(\"width\", \"fillchar\"), default_count=1\n)\nunicode_rjust_spec = UnicodeMethodSpecNoKeywords(\n    \"rjust\", arg_names=(\"width\", \"fillchar\"), default_count=1\n)\nunicode_zfill_spec = UnicodeMethodSpecNoKeywords(\"zfill\", arg_names=(\"width\",))\nunicode_translate_spec = UnicodeMethodSpecNoKeywords(\"translate\", arg_names=(\"table\",))\nunicode_splitlines_spec = UnicodeMethodSpecNoKeywords(\n    \"splitlines\", arg_names=(\"keepends\"), default_count=1\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/HardImportSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Hard import specs.\n\nCentralized here for code generation purposes. When a spec gets added here,\nit automatically creates a reference node and a base class for the call node\nto use.\n\"\"\"\n\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_dict,\n    tshape_str,\n)\n\nfrom .BuiltinParameterSpecs import (\n    BuiltinParameterSpec,\n    BuiltinParameterSpecNoKeywords,\n)\n\n# Metadata:\n\npkg_resources_iter_entry_points_spec = BuiltinParameterSpec(\n    \"pkg_resources.iter_entry_points\", (\"group\", \"name\"), default_count=1\n)\npkg_resources_get_distribution_spec = BuiltinParameterSpec(\n    \"pkg_resources.get_distribution\", (\"dist\",), default_count=0\n)\npkg_resources_require_spec = BuiltinParameterSpec(\n    \"pkg_resources.require\", (), default_count=0, list_star_arg=\"requirements\"\n)\n\nimportlib_metadata_distribution_spec = BuiltinParameterSpec(\n    \"importlib.metadata.distribution\", (\"distribution_name\",), default_count=0\n)\nimportlib_metadata_backport_distribution_spec = BuiltinParameterSpec(\n    \"importlib_metadata.distribution\", (\"distribution_name\",), default_count=0\n)\nimportlib_metadata_version_spec = BuiltinParameterSpec(\n    \"importlib.metadata.version\", (\"distribution_name\",), default_count=0\n)\nimportlib_metadata_backport_version_spec = BuiltinParameterSpec(\n    \"importlib_metadata.version\", (\"distribution_name\",), default_count=0\n)\nimportlib_metadata_metadata_spec = BuiltinParameterSpec(\n    \"importlib.metadata.metadata\", (\"distribution_name\",), default_count=0\n)\nimportlib_metadata_backport_metadata_spec = BuiltinParameterSpec(\n    \"importlib_metadata.metadata\", (\"distribution_name\",), default_count=0\n)\n\nimportlib_metadata_entry_points_before_310_spec = BuiltinParameterSpec(\n    \"importlib.metadata.entry_points\", (), default_count=0, type_shape=tshape_dict\n)\nimportlib_metadata_entry_points_since_310_spec = BuiltinParameterSpec(\n    \"importlib.metadata.entry_points\", (), default_count=0, dict_star_arg=\"params\"\n)\nimportlib_metadata_backport_entry_points_spec = BuiltinParameterSpec(\n    \"importlib_metadata.entry_points\", (), default_count=0, dict_star_arg=\"params\"\n)\n\n# TODO: Once we have selectable group under control, we can do this too.\n# importlib_metadata_backport_entry_points_spec = BuiltinParameterSpec(\n#    \"importlib_metadata.entry_points\", (), default_count=0, type_shape=tshape_dict\n# )\n\n# Resources:\n\npkgutil_get_data_spec = BuiltinParameterSpec(\n    \"pkgutil.get_data\", (\"package\", \"resource\"), default_count=0\n)\npkg_resources_resource_string_spec = BuiltinParameterSpec(\n    \"pkg_resources.resource_string\",\n    (\"package_or_requirement\", \"resource_name\"),\n    default_count=0,\n)\npkg_resources_resource_stream_spec = BuiltinParameterSpec(\n    \"pkg_resources.resource_stream\",\n    (\"package_or_requirement\", \"resource_name\"),\n    default_count=0,\n)\nimportlib_resources_read_binary_spec = BuiltinParameterSpec(\n    \"importlib.resources.read_binary\",\n    (\"package\", \"resource\"),\n    default_count=0,\n    type_shape=tshape_bytes,\n)\nimportlib_resources_backport_read_binary_spec = BuiltinParameterSpec(\n    \"importlib_resources.read_binary\",\n    (\"package\", \"resource\"),\n    default_count=0,\n    type_shape=tshape_bytes,\n)\nimportlib_resources_read_text_spec = BuiltinParameterSpec(\n    \"importlib.resources.read_text\",\n    (\"package\", \"resource\", \"encoding\", \"errors\"),\n    default_count=2,\n    type_shape=tshape_str,\n)\nimportlib_resources_backport_read_text_spec = BuiltinParameterSpec(\n    \"importlib_resources.read_text\",\n    (\"package\", \"resource\", \"encoding\", \"errors\"),\n    default_count=2,\n    type_shape=tshape_str,\n)\nimportlib_resources_files_spec = BuiltinParameterSpec(\n    \"importlib.resources.files\",\n    (\"package\",),\n    default_count=0,\n)\nimportlib_resources_backport_files_spec = BuiltinParameterSpec(\n    \"importlib_resources.files\",\n    (\"package\",),\n    default_count=0,\n)\n\n\n# os functions:\nos_uname_spec = BuiltinParameterSpec(\n    \"os.uname\",\n    (),\n    default_count=0,\n)\n\nos_path_exists_spec = BuiltinParameterSpec(\"os.path.exists\", (\"path\",), default_count=0)\nos_path_isfile_spec = BuiltinParameterSpec(\"os.path.isfile\", (\"path\",), default_count=0)\nos_path_isdir_spec = BuiltinParameterSpec(\"os.path.isdir\", (\"path\",), default_count=0)\nos_path_basename_spec = BuiltinParameterSpec(\n    \"os.path.basename\", (\"p\",), default_count=0\n)\nos_path_dirname_spec = BuiltinParameterSpec(\"os.path.dirname\", (\"p\",), default_count=0)\nos_path_abspath_spec = BuiltinParameterSpec(\n    \"os.path.abspath\", (\"path\",), default_count=0\n)\nos_path_isabs_spec = BuiltinParameterSpec(\n    \"os.path.isabs\", (\"s\",), default_count=0, type_shape=tshape_bool\n)\n\nos_listdir_spec = BuiltinParameterSpec(\"os.listdir\", (\"path\",), default_count=1)\n\nctypes_cdll_since_38_spec = BuiltinParameterSpec(\n    \"ctypes.CDLL\",\n    (\n        \"name\",\n        \"mode\",\n        \"handle\",\n        \"use_errno\",\n        \"use_last_error\",\n        \"winmode\",  # spell-checker: ignore winmode\n    ),\n    default_count=5,\n)\n\nctypes_cdll_before_38_spec = BuiltinParameterSpec(\n    \"ctypes.CDLL\",\n    (\n        \"name\",\n        \"mode\",\n        \"handle\",\n        \"use_errno\",\n        \"use_last_error\",\n    ),\n    default_count=4,\n)\n\nbuiltins_open_since_3_spec = BuiltinParameterSpec(\n    \"builtins.open\",\n    (\"file\", \"mode\", \"buffering\", \"encoding\", \"errors\", \"newline\", \"closefd\", \"opener\"),\n    default_count=7,\n)\n\nsys_exit_spec = BuiltinParameterSpecNoKeywords(\n    \"sys.exit\", (\"exit_code\",), default_count=1\n)\n\n# Tensorflow\n\ntensorflow_function_spec = BuiltinParameterSpec(\n    \"tensorflow.function\",\n    (\n        \"func\",\n        \"input_signature\",\n        \"autograph\",\n        \"jit_compile\",\n        \"reduce_retracing\",\n        \"experimental_implements\",\n        \"experimental_autograph_options\",\n        \"experimental_attributes\",\n        \"experimental_relax_shapes\",\n        \"experimental_compile\",\n        \"experimental_follow_type_hints\",\n    ),\n    default_count=11,\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/ParameterSpecs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module maintains the parameter specification classes.\n\nThese are used for function, lambdas, generators. They are also a factory\nfor the respective variable objects. One of the difficulty of Python and\nits parameter parsing is that they are allowed to be nested like this:\n\n(a,b), c\n\nMuch like in assignments, which are very similar to parameters, except\nthat parameters may also be assigned from a dictionary, they are no less\nflexible.\n\n\"\"\"\n\nfrom nuitka import Variables\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.InstanceCounters import (\n    counted_del,\n    counted_init,\n    isCountingInstances,\n)\n\n\nclass TooManyArguments(Exception):\n    def __init__(self, real_exception):\n        Exception.__init__(self)\n\n        self.real_exception = real_exception\n\n    def getRealException(self):\n        return self.real_exception\n\n\nclass ParameterSpec(object):\n    # These got many attributes, in part duplicating name and instance of\n    # variables, pylint: disable=too-many-instance-attributes\n\n    __slots__ = (\n        \"name\",\n        \"owner\",\n        \"normal_args\",\n        \"normal_variables\",\n        \"list_star_arg\",\n        \"is_list_star_arg_single\",\n        \"dict_star_arg\",\n        \"list_star_variable\",\n        \"dict_star_variable\",\n        \"default_count\",\n        \"kw_only_args\",\n        \"kw_only_variables\",\n        \"pos_only_args\",\n        \"pos_only_variables\",\n        \"type_shape\",\n    )\n\n    @counted_init\n    def __init__(\n        self,\n        ps_name,\n        ps_normal_args,\n        ps_pos_only_args,\n        ps_kw_only_args,\n        ps_list_star_arg,\n        ps_dict_star_arg,\n        ps_default_count,\n        ps_is_list_star_arg_single=False,\n        type_shape=None,\n    ):\n        if type(ps_normal_args) is str:\n            if ps_normal_args == \"\":\n                ps_normal_args = ()\n            else:\n                ps_normal_args = ps_normal_args.split(\",\")\n\n        if type(ps_kw_only_args) is str:\n            if ps_kw_only_args == \"\":\n                ps_kw_only_args = ()\n            else:\n                ps_kw_only_args = ps_kw_only_args.split(\",\")\n\n        assert None not in ps_normal_args\n\n        self.owner = None\n\n        self.name = ps_name\n        self.normal_args = tuple(ps_normal_args)\n        self.normal_variables = None\n\n        assert (\n            ps_list_star_arg is None or type(ps_list_star_arg) is str\n        ), ps_list_star_arg\n        assert (\n            ps_dict_star_arg is None or type(ps_dict_star_arg) is str\n        ), ps_dict_star_arg\n\n        assert type(ps_is_list_star_arg_single) is bool, ps_is_list_star_arg_single\n\n        self.list_star_arg = ps_list_star_arg if ps_list_star_arg else None\n        self.is_list_star_arg_single = ps_is_list_star_arg_single\n        self.dict_star_arg = ps_dict_star_arg if ps_dict_star_arg else None\n\n        self.list_star_variable = None\n        self.dict_star_variable = None\n\n        self.default_count = ps_default_count\n\n        self.kw_only_args = tuple(ps_kw_only_args)\n        self.kw_only_variables = None\n\n        self.pos_only_args = tuple(ps_pos_only_args)\n        self.pos_only_variables = None\n\n        self.type_shape = type_shape\n\n    if isCountingInstances():\n        __del__ = counted_del()\n\n    def makeClone(self):\n        return ParameterSpec(\n            ps_name=self.name,\n            ps_normal_args=self.normal_args,\n            ps_pos_only_args=self.pos_only_args,\n            ps_kw_only_args=self.kw_only_args,\n            ps_list_star_arg=self.list_star_arg,\n            ps_dict_star_arg=self.dict_star_arg,\n            ps_default_count=self.default_count,\n            type_shape=self.type_shape,\n        )\n\n    def getDetails(self):\n        return {\n            \"ps_name\": self.name,\n            \"ps_normal_args\": \",\".join(self.normal_args),\n            \"ps_pos_only_args\": self.pos_only_args,\n            \"ps_kw_only_args\": \",\".join(self.kw_only_args),\n            \"ps_list_star_arg\": (\n                self.list_star_arg if self.list_star_arg is not None else \"\"\n            ),\n            \"ps_dict_star_arg\": (\n                self.dict_star_arg if self.dict_star_arg is not None else \"\"\n            ),\n            \"ps_default_count\": self.default_count,\n            \"type_shape\": self.type_shape,\n        }\n\n    def checkParametersValid(self):\n        arg_names = self.getParameterNames()\n\n        # Check for duplicate arguments, could happen.\n        for arg_name in arg_names:\n            if arg_names.count(arg_name) != 1:\n                return \"duplicate argument '%s' in function definition\" % arg_name\n\n        return None\n\n    def __repr__(self):\n        parts = [str(normal_arg) for normal_arg in self.pos_only_args]\n        if parts:\n            parts.append(\"/\")\n\n        parts += [str(normal_arg) for normal_arg in self.normal_args]\n\n        if self.list_star_arg is not None:\n            parts.append(\"*%s\" % self.list_star_arg)\n\n        if self.dict_star_variable is not None:\n            parts.append(\"**%s\" % self.dict_star_variable)\n\n        if parts:\n            return \"<ParameterSpec '%s'>\" % \",\".join(parts)\n        else:\n            return \"<NoParameters>\"\n\n    def setOwner(self, owner):\n        if self.owner is not None:\n            return\n\n        self.owner = owner\n        self.normal_variables = []\n\n        for normal_arg in self.normal_args:\n            if type(normal_arg) is str:\n                normal_variable = Variables.ParameterVariable(\n                    owner=self.owner, parameter_name=normal_arg\n                )\n            else:\n                assert False, normal_arg\n\n            self.normal_variables.append(normal_variable)\n\n        if self.list_star_arg:\n            self.list_star_variable = Variables.ParameterVariable(\n                owner=owner, parameter_name=self.list_star_arg\n            )\n        else:\n            self.list_star_variable = None\n\n        if self.dict_star_arg:\n            self.dict_star_variable = Variables.ParameterVariable(\n                owner=owner, parameter_name=self.dict_star_arg\n            )\n        else:\n            self.dict_star_variable = None\n\n        self.kw_only_variables = [\n            Variables.ParameterVariable(owner=self.owner, parameter_name=kw_only_arg)\n            for kw_only_arg in self.kw_only_args\n        ]\n\n        self.pos_only_variables = [\n            Variables.ParameterVariable(owner=self.owner, parameter_name=pos_only_arg)\n            for pos_only_arg in self.pos_only_args\n        ]\n\n    def getDefaultCount(self):\n        return self.default_count\n\n    def hasDefaultParameters(self):\n        return self.getDefaultCount() > 0\n\n    def getTopLevelVariables(self):\n        return self.pos_only_variables + self.normal_variables + self.kw_only_variables\n\n    def getAllVariables(self):\n        result = list(self.pos_only_variables)\n        result += self.normal_variables\n        result += self.kw_only_variables\n\n        if self.list_star_variable is not None:\n            result.append(self.list_star_variable)\n\n        if self.dict_star_variable is not None:\n            result.append(self.dict_star_variable)\n\n        return result\n\n    def getParameterNames(self):\n        result = list(self.pos_only_args + self.normal_args)\n\n        result += self.kw_only_args\n\n        if self.list_star_arg is not None:\n            result.append(self.list_star_arg)\n\n        if self.dict_star_arg is not None:\n            result.append(self.dict_star_arg)\n\n        return tuple(result)\n\n    def getStarListArgumentName(self):\n        return self.list_star_arg\n\n    def isStarListSingleArg(self):\n        return self.is_list_star_arg_single\n\n    def getListStarArgVariable(self):\n        return self.list_star_variable\n\n    def getStarDictArgumentName(self):\n        return self.dict_star_arg\n\n    def getDictStarArgVariable(self):\n        return self.dict_star_variable\n\n    def getKwOnlyVariables(self):\n        return self.kw_only_variables\n\n    def allowsKeywords(self):\n        # Abstract method, pylint: disable=no-self-use\n        return True\n\n    def getKeywordRefusalText(self):\n        return \"%s() takes no keyword arguments\" % self.name\n\n    def getArgumentNames(self):\n        return self.pos_only_args + self.normal_args\n\n    def getArgumentCount(self):\n        return len(self.normal_args) + len(self.pos_only_args)\n\n    def getKwOnlyParameterNames(self):\n        return self.kw_only_args\n\n    def getKwOnlyParameterCount(self):\n        return len(self.kw_only_args)\n\n    def getPosOnlyParameterCount(self):\n        return len(self.pos_only_args)\n\n    def getTypeShape(self):\n        return self.type_shape\n\n\ndef matchCall(\n    func_name,\n    args,\n    kw_only_args,\n    star_list_arg,\n    star_list_single_arg,\n    star_dict_arg,\n    num_defaults,\n    num_pos_only,\n    positional,\n    pairs,\n    improved=False,\n):\n    \"\"\"Match a call arguments to a signature.\n\n    Args:\n        func_name - Name of the function being matched, used to construct exception texts.\n        args - normal argument names\n        kw_only_args -  keyword only argument names (Python3)\n        star_list_arg - name of star list argument if any\n        star_dict_arg - name of star dict argument if any\n        num_defaults - amount of arguments that have default values\n        num_pos_only - amount of arguments that must be given by position\n        positional - tuple of argument values given for simulated call\n        pairs - tuple of pairs arg argument name and argument values\n        improved - (bool) should we give better errors than CPython or not.\n    Returns:\n        Dictionary of argument name to value mappings\n    Notes:\n        Based loosely on \"inspect.getcallargs\" with corrections.\n    \"\"\"\n\n    # This is of incredible code complexity, but there really is no other way to\n    # express this with less statements, branches, or variables.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    assert type(positional) is tuple, positional\n    assert type(pairs) in (tuple, list), pairs\n\n    # Make a copy, we are going to modify it.\n    pairs = list(pairs)\n\n    result = {}\n\n    assigned_tuple_params = []\n\n    def assign(arg, value):\n        if type(arg) is str:\n            # Normal case:\n            result[arg] = value\n        else:\n            # Tuple argument case:\n\n            assigned_tuple_params.append(arg)\n            value = iter(value.getIterationValues())\n\n            for i, subarg in enumerate(arg):\n                try:\n                    subvalue = next(value)\n                except StopIteration:\n                    raise TooManyArguments(\n                        ValueError(\n                            \"need more than %d %s to unpack\"\n                            % (i, \"values\" if i > 1 else \"value\")\n                        )\n                    )\n\n                # Recurse into tuple argument values, could be more tuples.\n                assign(subarg, subvalue)\n\n            # Check that not too many values we provided.\n            try:\n                next(value)\n            except StopIteration:\n                pass\n            else:\n                raise TooManyArguments(ValueError(\"too many values to unpack\"))\n\n    def isAssigned(arg):\n        if type(arg) is str:\n            return arg in result\n\n        return arg in assigned_tuple_params\n\n    num_pos = len(positional)\n    num_total = num_pos + len(pairs)\n    num_args = len(args)\n\n    for arg, value in zip(args, positional):\n        assign(arg, value)\n\n    # Python3 does this check earlier.\n    if python_version >= 0x300 and not star_dict_arg:\n        for pair in pairs:\n            try:\n                arg_index = (args + kw_only_args).index(pair[0])\n            except ValueError:\n                if improved or python_version >= 0x370:\n                    message = \"'%s' is an invalid keyword argument for %s()\" % (\n                        pair[0],\n                        func_name,\n                    )\n                else:\n                    message = (\n                        \"'%s' is an invalid keyword argument for this function\"\n                        % pair[0]\n                    )\n\n                raise TooManyArguments(TypeError(message))\n\n            if arg_index < num_pos_only:\n                message = \"'%s' is an invalid keyword argument for %s()\" % (\n                    pair[0],\n                    func_name,\n                )\n\n                raise TooManyArguments(TypeError(message))\n\n    if star_list_arg:\n        if num_pos > num_args:\n            value = positional[-(num_pos - num_args) :]\n            assign(star_list_arg, value)\n\n            if star_list_single_arg:\n                if len(value) > 1:\n                    raise TooManyArguments(\n                        TypeError(\n                            \"%s expected at most 1 arguments, got %d\"\n                            % (func_name, len(value))\n                        )\n                    )\n        else:\n            assign(star_list_arg, ())\n    elif 0 < num_args < num_total:\n        # Special case for no default values.\n        if num_defaults == 0:\n            # Special cases text for one argument.\n            if num_args == 1:\n                raise TooManyArguments(\n                    TypeError(\n                        \"%s() takes exactly one argument (%d given)\"\n                        % (func_name, num_total)\n                    )\n                )\n\n            raise TooManyArguments(\n                TypeError(\n                    \"%s expected %d arguments, got %d\"\n                    % (func_name, num_args, num_total)\n                )\n            )\n\n        raise TooManyArguments(\n            TypeError(\n                \"%s() takes at most %d %s (%d given)\"\n                % (\n                    func_name,\n                    num_args,\n                    \"argument\" if num_args == 1 else \"arguments\",\n                    num_total,\n                )\n            )\n        )\n    elif num_args == 0 and num_total:\n        if star_dict_arg:\n            if num_pos:\n                # Could use num_pos, but Python also uses num_total.\n                raise TooManyArguments(\n                    TypeError(\n                        \"%s() takes exactly 0 arguments (%d given)\"\n                        % (func_name, num_total)\n                    )\n                )\n        else:\n            raise TooManyArguments(\n                TypeError(\"%s() takes no arguments (%d given)\" % (func_name, num_total))\n            )\n\n    named_argument_names = [pair[0] for pair in pairs]\n\n    for arg in args + kw_only_args:\n        if type(arg) is str and arg in named_argument_names:\n            if isAssigned(arg):\n                raise TooManyArguments(\n                    TypeError(\n                        \"%s() got multiple values for keyword argument '%s'\"\n                        % (func_name, arg)\n                    )\n                )\n\n            new_pairs = []\n\n            for pair in pairs:\n                if arg == pair[0]:\n                    assign(arg, pair[1])\n                else:\n                    new_pairs.append(pair)\n\n            assert len(new_pairs) == len(pairs) - 1\n\n            pairs = new_pairs\n\n    # Fill in any missing values with the None to indicate \"default\".\n    if num_defaults > 0:\n        for arg in (args + kw_only_args)[-num_defaults:]:\n            if not isAssigned(arg):\n                assign(arg, None)\n\n    if star_dict_arg:\n        assign(star_dict_arg, pairs)\n    elif pairs:\n        unexpected = next(iter(dict(pairs)))\n\n        if improved:\n            message = \"%s() got an unexpected keyword argument '%s'\" % (\n                func_name,\n                unexpected,\n            )\n        else:\n            message = (\n                \"'%s' is an invalid keyword argument for this function\" % unexpected\n            )\n\n        raise TooManyArguments(TypeError(message))\n\n    unassigned = num_args - len([arg for arg in args if isAssigned(arg)])\n\n    if unassigned:\n        num_required = num_args - num_defaults\n\n        # Special case required arguments.\n        if num_required > 0 or improved:\n            if num_defaults == 0 and num_args != 1:\n                raise TooManyArguments(\n                    TypeError(\n                        \"%s expected %d arguments, got %d\"\n                        % (func_name, num_args, num_total)\n                    )\n                )\n\n            if num_required == 1:\n                arg_desc = \"1 argument\" if python_version < 0x350 else \"one argument\"\n            else:\n                arg_desc = \"%d arguments\" % num_required\n\n            raise TooManyArguments(\n                TypeError(\n                    \"%s() takes %s %s (%d given)\"\n                    % (\n                        func_name,\n                        \"at least\" if num_defaults > 0 else \"exactly\",\n                        arg_desc,\n                        num_total,\n                    )\n                )\n            )\n\n        raise TooManyArguments(\n            TypeError(\n                \"%s expected %s%s, got %d\"\n                % (\n                    func_name,\n                    (\n                        (\"at least \" if python_version < 0x300 else \"\")\n                        if num_defaults > 0\n                        else \"exactly \"\n                    ),\n                    \"%d arguments\" % num_required,\n                    num_total,\n                )\n            )\n        )\n\n    unassigned = len(kw_only_args) - len(\n        [arg for arg in kw_only_args if isAssigned(arg)]\n    )\n    if unassigned:\n        raise TooManyArguments(\n            TypeError(\n                \"%s missing %d required keyword-only argument%s: %s\"\n                % (\n                    func_name,\n                    unassigned,\n                    \"s\" if unassigned > 1 else \"\",\n                    \" and \".join(\n                        \"'%s'\" % [arg for arg in kw_only_args if not isAssigned(arg)]\n                    ),\n                )\n            )\n        )\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/specs/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/Basics.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Basics for Nuitka tools.\n\n\"\"\"\n\nimport os\nimport sys\n\n\ndef goHome():\n    \"\"\"Go its own directory, to have it easy with path knowledge.\"\"\"\n    os.chdir(getHomePath())\n\n\nmy_abs_path = os.path.abspath(__file__)\n\n\ndef getHomePath():\n    return os.path.normpath(os.path.join(os.path.dirname(my_abs_path), \"..\", \"..\"))\n\n\ndef setupPATH():\n    \"\"\"Make sure installed tools are in PATH.\n\n    For Windows, add this to the PATH, so pip installed PyLint will be found\n    near the Python executing this script.\n    \"\"\"\n    os.environ[\"PATH\"] = (\n        os.environ[\"PATH\"]\n        + os.pathsep\n        + os.path.join(os.path.dirname(sys.executable), \"scripts\")\n    )\n\n\ndef addPYTHONPATH(path):\n    python_path = os.getenv(\"PYTHONPATH\", \"\")\n    os.environ[\"PYTHONPATH\"] = os.pathsep.join(python_path.split(os.pathsep) + [path])\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/commercial/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Commercial tools package.\n\n\"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/data_composer/DataComposer.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Data composer, crunch constants into binary blobs to load. \"\"\"\n\nimport binascii\nimport os\nimport re\nimport struct\nimport sys\nfrom math import copysign, isinf, isnan\n\nfrom nuitka.__past__ import BytesIO, long, to_byte, unicode, xrange\nfrom nuitka.build.DataComposerInterface import deriveModuleConstantsBlobName\nfrom nuitka.Builtins import builtin_exception_values_list, builtin_named_values\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.PythonVersions import (\n    isPythonValidCLongLongValue,\n    isPythonValidCLongValue,\n    python_version,\n    sizeof_clonglong,\n)\nfrom nuitka.Serialization import (\n    BlobData,\n    BuiltinAnonValue,\n    BuiltinGenericAliasValue,\n    BuiltinSpecialValue,\n    BuiltinUnionTypeValue,\n    ConstantStreamReader,\n)\nfrom nuitka.Tracing import data_composer_logger\nfrom nuitka.utils.FileOperations import getFileSize, listDir, syncFileOutput\nfrom nuitka.utils.Json import writeJsonToFilename\n\n_max_uint64_t_value = 2**64 - 1\n\n\ndef _encodeVariableLength(value):\n    \"\"\"Get the variable length size encoding of a uint64_t value.\"\"\"\n\n    assert 0 <= value <= _max_uint64_t_value\n\n    result = b\"\"\n\n    while value >= 128:\n        # Need to take the last seven bits as a byte value\n        result += to_byte((value & 255) | 128)\n        value >>= 7\n\n    # Last byte or whole value small enough.\n    return result + to_byte(value)\n\n\ndef scanConstFiles(build_dir):\n    result = []\n\n    for fullpath, filename in listDir(build_dir):\n        if not filename.endswith(\".const\"):\n            continue\n\n        result.append((fullpath, filename))\n\n    return result\n\n\n# TODO: The determination of this should already happen in Building or in a\n# helper not during code generation.\n_match_attribute_names = re.compile(r\"[a-zA-Z_][a-zA-Z0-9_]*$\")\n\n\ndef _isAttributeName(value):\n    # TODO: The exception is to make sure we intern the \".0\" argument name\n    # used for generator expressions, iterator value.\n    return _match_attribute_names.match(value) or value == \".0\"\n\n\n_last_written = None\n\n\ndef _writeConstantValue(output, constant_value):\n    # Massively many details per value, pylint: disable=too-many-branches,too-many-statements\n\n    # We are a singleton, pylint: disable=global-statement\n    global _last_written\n\n    constant_type = type(constant_value)\n\n    if constant_value is None:\n        output.write(b\"n\")\n    elif constant_value is _last_written:\n        output.write(b\"p\")\n    elif constant_value is True:\n        output.write(b\"t\")\n    elif constant_value is False:\n        output.write(b\"F\")\n    elif constant_type is tuple:\n        output.write(b\"T\" + _encodeVariableLength(len(constant_value)))\n\n        _last_written = None\n\n        for element in constant_value:\n            _writeConstantValue(output, element)\n    elif constant_type is list:\n        output.write(b\"L\" + _encodeVariableLength(len(constant_value)))\n\n        _last_written = None\n\n        for element in constant_value:\n            _writeConstantValue(output, element)\n    elif constant_type is dict:\n        output.write(b\"D\" + _encodeVariableLength(len(constant_value)))\n\n        # Write keys first, and values second, such that we allow for the\n        # last_written to have an impact.\n        items = constant_value.items()\n\n        _last_written = None\n        for key, value in items:\n            _writeConstantValue(output, key)\n\n        _last_written = None\n        for key, value in items:\n            _writeConstantValue(output, value)\n    elif constant_type is set:\n        output.write(b\"S\" + _encodeVariableLength(len(constant_value)))\n\n        _last_written = None\n        for element in constant_value:\n            _writeConstantValue(output, element)\n    elif constant_type is frozenset:\n        output.write(b\"P\" + _encodeVariableLength(len(constant_value)))\n\n        _last_written = None\n        for element in constant_value:\n            _writeConstantValue(output, element)\n    elif constant_type is long:\n        if isPythonValidCLongValue(constant_value):\n            output.write(b\"l\" + struct.pack(\"l\", constant_value))\n        elif isPythonValidCLongLongValue(constant_value):\n            output.write(b\"q\" + struct.pack(\"q\", constant_value))\n        else:\n            output.write(b\"g\")\n\n            if constant_value < 0:\n                abs_constant_value = abs(constant_value)\n                output.write(b\"-\")\n            else:\n                abs_constant_value = constant_value\n                output.write(b\"+\")\n\n            parts = []\n\n            mod_value = 2 ** (sizeof_clonglong * 8)\n            while abs_constant_value > 0:\n                parts.append(abs_constant_value % mod_value)\n                abs_constant_value >>= sizeof_clonglong * 8\n\n            output.write(struct.pack(\"i\", len(parts)))\n            for part in reversed(parts):\n                output.write(struct.pack(\"Q\", part))\n\n    elif constant_type is int:\n        # This is Python2 then. TODO: Special case smaller values.\n        output.write(b\"i\" + struct.pack(\"l\", constant_value))\n    elif constant_type is float:\n        if constant_value == 0.0:\n            if copysign(1, constant_value) == 1:\n                output.write(b\"Z\" + to_byte(0))\n            else:\n                output.write(b\"Z\" + to_byte(1))\n        elif isnan(constant_value):\n            if copysign(1, constant_value) == 1:\n                output.write(b\"Z\" + to_byte(2))\n            else:\n                output.write(b\"Z\" + to_byte(3))\n        elif isinf(constant_value):\n            if copysign(1, constant_value) == 1:\n                output.write(b\"Z\" + to_byte(4))\n            else:\n                output.write(b\"Z\" + to_byte(5))\n        else:\n            output.write(b\"f\" + struct.pack(\"d\", constant_value))\n    elif constant_type is unicode:\n        if str is not bytes:\n            encoded = constant_value.encode(\"utf8\", \"surrogatepass\")\n        else:\n            encoded = constant_value.encode(\"utf8\")\n\n        if len(encoded) == 1:\n            output.write(b\"w\" + encoded)\n        # Zero termination if possible.\n        elif b\"\\0\" in encoded:\n            output.write(b\"v\" + _encodeVariableLength(len(encoded)))\n            output.write(encoded)\n        else:\n            if str is not bytes and _isAttributeName(constant_value):\n                indicator = b\"a\"\n            else:\n                indicator = b\"u\"\n\n            output.write(indicator + encoded + b\"\\0\")\n    elif constant_type is bytes:\n        if len(constant_value) == 1:\n            output.write(b\"d\" + constant_value)\n        # Zero termination if possible.\n        elif b\"\\0\" in constant_value:\n            output.write(b\"b\" + _encodeVariableLength(len(constant_value)))\n            output.write(constant_value)\n        else:\n            if str is bytes and _isAttributeName(constant_value):\n                indicator = b\"a\"\n            else:\n                indicator = b\"c\"\n\n            output.write(indicator + constant_value + b\"\\0\")\n    elif constant_type is slice:\n        output.write(b\":\")\n        _last_written = None\n        _writeConstantValue(output, constant_value.start)\n        _writeConstantValue(output, constant_value.stop)\n        _writeConstantValue(output, constant_value.step)\n    elif constant_type is range:\n        output.write(b\";\")\n        _last_written = None\n        _writeConstantValue(output, constant_value.start)\n        _writeConstantValue(output, constant_value.stop)\n        _writeConstantValue(output, constant_value.step)\n    elif constant_type is xrange:\n        output.write(b\";\")\n        range_args = [\n            int(v)\n            for v in str(constant_value)[7 if str is bytes else 6 : -1].split(\",\")\n        ]\n\n        # Default start.\n        if len(range_args) == 1:\n            range_args.insert(0, 0)\n\n        # Default step\n        if len(range_args) < 3:\n            range_args.append(1)\n\n        output.write(struct.pack(\"lll\", *range_args))\n    elif constant_type is complex:\n        # Some float values do not transport well, use float streaming then.\n        if (\n            constant_value.real == 0\n            or constant_value.imag == 0\n            or isnan(constant_value.real)\n            or isnan(constant_value.imag)\n            or isinf(constant_value.real)\n            or isinf(constant_value.imag)\n        ):\n            output.write(b\"J\")\n\n            _last_written = None\n            _writeConstantValue(output, constant_value.real)\n            _writeConstantValue(output, constant_value.imag)\n        else:\n            output.write(b\"j\")\n            output.write(struct.pack(\"dd\", constant_value.real, constant_value.imag))\n\n    elif constant_type is bytearray:\n        output.write(b\"B\" + _encodeVariableLength(len(constant_value)))\n\n        if python_version < 0x270:\n            constant_value = constant_value.decode(\"latin1\")\n        output.write(constant_value)\n    elif constant_type is BuiltinAnonValue:\n        output.write(b\"M\")\n        output.write(constant_value.getStreamValueByte())\n    elif constant_type is BuiltinSpecialValue:\n        output.write(b\"Q\")\n        output.write(constant_value.getStreamValueByte())\n    elif constant_type is BlobData:\n        constant_value = constant_value.getData()\n        output.write(b\"X\")\n        output.write(struct.pack(\"i\", len(constant_value)))\n        output.write(constant_value)\n    elif constant_type is BuiltinGenericAliasValue:\n        output.write(b\"G\")\n        _last_written = None\n        _writeConstantValue(output, constant_value.origin)\n        _writeConstantValue(output, constant_value.args)\n    elif constant_type is BuiltinUnionTypeValue:\n        output.write(b\"H\")\n        _last_written = None\n        _writeConstantValue(output, constant_value.args)\n    elif constant_value in builtin_named_values:\n        output.write(b\"O\")\n        output.write(builtin_named_values[constant_value].encode(\"utf8\"))\n        output.write(b\"\\0\")\n    elif constant_value in builtin_exception_values_list:\n        output.write(b\"E\")\n        output.write(constant_value.__name__.encode(\"utf8\"))\n        output.write(b\"\\0\")\n    else:\n        assert False, (type(constant_value), constant_value)\n\n    _last_written = constant_value\n\n\ndef _writeConstantStream(constants_reader):\n    result = BytesIO()\n\n    # We are a singleton, pylint: disable=global-statement\n    global _last_written\n    _last_written = None\n\n    count = 0\n    while 1:\n        try:\n            constant_value = constants_reader.readConstantValue()\n        except EOFError:\n            break\n\n        old_size = result.tell()\n        _writeConstantValue(result, constant_value)\n\n        if not data_composer_logger.is_quiet:\n            new_size = result.tell()\n\n            result.seek(old_size)\n            type_char = result.read(1)\n            result.seek(new_size)\n\n            data_composer_logger.info(\n                \"Size of constant %r is %d with type %r\"\n                % (constant_value, new_size - old_size, type_char)\n            )\n\n        count += 1\n\n    # Dirty end of things marker that would trigger an assertion in the decoder.\n    # TODO: Debug mode only?\n    result.write(b\".\")\n\n    return count, struct.pack(\"H\", count) + result.getvalue()\n\n\ncrc32 = 0\n\n\ndef _writeConstantsBlob(output_filename, desc):\n    global crc32  # singleton, pylint: disable=global-statement\n\n    with open(output_filename, \"w+b\") as output:\n        output.write(b\"\\0\" * 8)\n\n        def write(data):\n            global crc32  # singleton, pylint: disable=global-statement\n\n            output.write(data)\n            crc32 = binascii.crc32(data, crc32)\n\n        for name, part in desc:\n            write(name + b\"\\0\")\n            write(struct.pack(\"I\", len(part)))\n            write(part)\n\n        data_size = output.tell() - 8\n\n        if str is bytes:\n            # Python2 is doing signed CRC32, but we want unsigned.\n            crc32 %= 1 << 32\n\n        output.seek(0)\n        output.write(struct.pack(\"II\", crc32, data_size))\n\n        assert output.tell() == 8\n\n        data_composer_logger.info(\n            \"Total constants blob size without header %d.\" % data_size\n        )\n        data_composer_logger.info(\"Total constants blob CRC32 is %d.\" % crc32)\n\n        syncFileOutput(output)\n\n\ndef main():\n    # many details, mostly needed for reporting: pylint: disable=too-many-locals\n\n    data_composer_logger.is_quiet = (\n        os.getenv(\"NUITKA_DATA_COMPOSER_VERBOSE\", \"0\") != \"1\"\n    )\n\n    # Internal tool, most simple command line handling. This is the build directory\n    # where main Nuitka put the .const files.\n    build_dir = sys.argv[1]\n    output_filename = sys.argv[2]\n    stats_filename = sys.argv[3]\n\n    # Scan file \".const\" files from the build directory.\n    const_files = scanConstFiles(build_dir)\n\n    total = 0\n\n    desc = []\n\n    names = set()\n\n    stats = OrderedDict()\n\n    for fullpath, filename in const_files:\n        data_composer_logger.info(\"Working on constant file '%s'.\" % filename)\n\n        try:\n            with open(fullpath, \"rb\") as const_file:\n                constants_reader = ConstantStreamReader(const_file)\n                count, part = _writeConstantStream(constants_reader)\n            total += count\n\n            name = deriveModuleConstantsBlobName(filename)\n\n            # Make sure that is not repeated.\n            assert name not in names, name\n            names.add(name)\n\n            data_composer_logger.info(\n                \"Storing %r chunk with %s values size %r.\" % (name, count, len(part))\n            )\n\n            if str is not bytes:\n                encoded_name = name.encode(\"utf8\")\n            else:\n                encoded_name = name\n\n            desc.append((encoded_name, part))\n        except Exception:\n            data_composer_logger.warning(\"Problem with constant file '%s'.\" % filename)\n            raise\n\n        stats[filename] = {\n            \"input_size\": getFileSize(fullpath),\n            \"blob_name\": name,\n            \"blob_size\": len(part),\n        }\n\n    stats[\"total\"] = total\n\n    data_composer_logger.info(\"Total amount of constants is %d.\" % total)\n\n    _writeConstantsBlob(output_filename=output_filename, desc=desc)\n\n    writeJsonToFilename(stats_filename, contents=stats)\n\n    sys.exit(0)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/data_composer/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/data_composer/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Internal tool, assemble a constants blob for Nuitka from module constants.\n\n\"\"\"\n\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n    sys.path.insert(0, os.environ[\"NUITKA_PACKAGE_HOME\"])\n\n    import nuitka  # just to have it loaded from there, pylint: disable=unused-import\n\n    del sys.path[0]\n\n    sys.path = [\n        path_element\n        for path_element in sys.path\n        if os.path.dirname(os.path.abspath(__file__)) != path_element\n    ]\n\n    from nuitka.tools.data_composer.DataComposer import main\n\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/environments/CreateEnvironment.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" For creating virtual environments.\n\nThis can create empty virtualenv, but also populate them with packages from\nthe reports.\n\"\"\"\n\nimport os\n\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.TreeXML import fromFile\nfrom nuitka.utils.FileOperations import openTextFile\n\nfrom .Virtualenv import withVirtualenv\n\n\ndef createEnvironmentFromReport(environment_folder, report_filename):\n    if os.path.exists(environment_folder):\n        tools_logger.sysexit(\"Error, environment folder must not exist already.\")\n    containing_folder = os.path.dirname(environment_folder)\n\n    if not os.path.exists(containing_folder):\n        tools_logger.sysexit(\n            \"Error, environment folder must be in existing folder, not '%s'.\"\n            % containing_folder\n        )\n\n    if not os.path.isfile(report_filename):\n        tools_logger.sysexit(\"Error, no such report file '%s'.\" % report_filename)\n\n    with openTextFile(report_filename, \"r\", encoding=\"utf8\") as report_file:\n        root = fromFile(report_file, use_lxml=True)\n\n    requirements_filename = os.path.join(environment_folder, \"requirements.txt\")\n\n    with withVirtualenv(\n        os.path.basename(environment_folder),\n        base_dir=containing_folder,\n        style=\"blue\",\n        delete=False,\n    ) as venv:\n        with openTextFile(\n            requirements_filename, \"w\", encoding=\"utf8\"\n        ) as requirements_file:\n            for node in root.xpath(\"distributions/distribution\"):\n                requirements_file.write(\n                    \"%s==%s\\n\" % (node.attrib[\"name\"], node.attrib[\"version\"])\n                )\n\n        venv.runCommand(\"pip install -r requirements.txt\", style=\"blue\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/environments/Virtualenv.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Creating virtualenvs and running commands in them.\n\n\"\"\"\n\nimport os\nimport sys\nfrom contextlib import contextmanager\n\nfrom nuitka.__past__ import unicode\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import (\n    NuitkaCalledProcessError,\n    check_call,\n    executeProcess,\n    withEnvironmentVarsOverridden,\n)\nfrom nuitka.utils.FileOperations import (\n    getDirectoryRealPath,\n    removeDirectory,\n    withDirectoryChange,\n)\n\n\nclass Virtualenv(object):\n    def __init__(self, env_dir):\n        self.env_dir = os.path.abspath(env_dir)\n\n    def runCommand(self, commands, env=None, style=None):\n        if type(commands) in (str, unicode):\n            commands = [commands]\n\n        with withDirectoryChange(self.env_dir):\n            if os.name == \"nt\":\n                commands = [r\"call scripts\\activate.bat\"] + commands\n            else:\n                commands = [\". bin/activate\"] + commands\n\n            command = \" && \".join(commands)\n\n            if style is not None:\n                my_print(\"Executing: %s\" % command, style=style)\n\n            with withEnvironmentVarsOverridden(env):\n                exit_code = os.system(command)\n                if exit_code != 0:\n                    my_print(\"Failure %s for: %s\" % (exit_code, command), style=style)\n\n                    raise NuitkaCalledProcessError(\n                        exit_code, command, output=None, stderr=None\n                    )\n\n    def runCommandWithOutput(self, commands, style=None):\n        \"\"\"\n        Returns the stdout,stderr,exit_code from running command\n        \"\"\"\n        if type(commands) in (str, unicode):\n            commands = [commands]\n\n        with withDirectoryChange(self.env_dir):\n            if os.name == \"nt\":\n                commands = [r\"call scripts\\activate.bat\"] + commands\n            else:\n                commands = [\". bin/activate\"] + commands\n\n            # Build shell command.\n            command = \" && \".join(commands)\n\n            if style is not None:\n                my_print(\"Executing: %s\" % command, style=style)\n\n            # Use subprocess and also return outputs, stdout, stderr, result\n            return executeProcess(\n                command=command,\n                shell=True,\n            )\n\n    def getVirtualenvDir(self):\n        return self.env_dir\n\n\n@contextmanager\ndef withVirtualenv(env_name, base_dir=None, python=None, delete=True, style=None):\n    \"\"\"Create a virtualenv and change into it.\n\n    Activating for actual use will be your task.\n    \"\"\"\n\n    if style is not None:\n        my_print(\"Creating a virtualenv:\")\n\n    if python is None:\n        python = sys.executable\n\n    # Avoid symlinks on Windows, they won't work for virtualenv e.g.\n    python = os.path.join(\n        getDirectoryRealPath(os.path.dirname(python)),\n        os.path.basename(python),\n    )\n\n    if base_dir is not None:\n        env_dir = os.path.join(base_dir, env_name)\n    else:\n        env_dir = env_name\n\n    removeDirectory(env_dir, ignore_errors=False)\n\n    with withDirectoryChange(base_dir, allow_none=True):\n        command = [python, \"-m\", \"virtualenv\", env_name]\n        if style is not None:\n            my_print(\"Executing: %s\" % \" \".join(command), style=style)\n        check_call(command)\n\n    try:\n        yield Virtualenv(env_dir)\n    finally:\n        if delete:\n            removeDirectory(env_dir, ignore_errors=False)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/environments/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/general/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/general/dll_report/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/general/dll_report/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for DLL checker tool.\n\n\"\"\"\n\nimport os\nimport sys\nimport tempfile\nfrom optparse import OptionParser\n\nfrom nuitka.freezer.DllDependenciesWin32 import detectBinaryPathDLLsWin32\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.SharedLibraries import getDLLVersion, getSxsFromDLL\nfrom nuitka.utils.Timing import TimerReport\n\n\ndef main():\n    parser = OptionParser()\n\n    _options, positional_args = parser.parse_args()\n\n    if not positional_args:\n        sys.exit(\"No DLLs given.\")\n\n    for filename in positional_args:\n        my_print(\"Filename: %s\" % filename)\n        my_print(\"Version Information: %s\" % (getDLLVersion(filename),))\n\n        my_print(\"SXS information (manifests):\")\n        sxs = getSxsFromDLL(filename=filename, with_data=True)\n        if sxs:\n            my_print(sxs)\n\n        my_print(\"DLLs recursively depended (depends.exe):\")\n\n        with TimerReport(\n            message=\"Finding dependencies for %s took %%.2f seconds\" % filename\n        ):\n            r = detectBinaryPathDLLsWin32(\n                is_main_executable=False,\n                source_dir=tempfile.gettempdir(),\n                original_dir=os.path.dirname(filename),\n                binary_filename=filename,\n                package_name=None,\n                use_cache=False,\n                update_cache=False,\n            )\n\n            for dll_filename in sorted(r):\n                my_print(\"   %s\" % dll_filename)\n\n            my_print(\"Total: %d\" % len(r))\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/general/find_module/FindModuleCode.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Find module code and open it in Visual Code.\n\nThe idea is that this can be used during development, to accept module names,\nbut also standalone filenames, etc. to simply find the original code in the\ncompiling environment with \"--edit-module-code\" option.\n\nTODO: At this time it doesn't do all desired things yet.\n\"\"\"\n\nimport os\n\nfrom nuitka.importing.Importing import (\n    ModuleName,\n    addMainScriptDirectory,\n    locateModule,\n)\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.Execution import callProcess, getExecutablePath\nfrom nuitka.utils.FileOperations import relpath\nfrom nuitka.utils.Utils import isWin32Windows\n\n\ndef findModuleCode(module_name):\n    module_name = ModuleName(module_name)\n\n    return locateModule(module_name=module_name, parent_package=None, level=0)[1]\n\n\ndef editModuleCode(module_search_desc):\n    # plenty of checks to resolved, pylint: disable=too-many-branches\n\n    module_filename = None\n    module_name = None\n\n    if isWin32Windows() and \"\\\\\" in module_search_desc:\n        if os.path.exists(module_search_desc):\n            module_filename = module_search_desc\n        else:\n            if module_search_desc.endswith(\".py\"):\n                module_search_desc = module_search_desc[:-3]\n\n            candidate = module_search_desc\n\n            while not candidate.endswith(\".DIS\") and not os.path.basename(\n                candidate\n            ).startswith(\"ONEFIL\"):\n                candidate = os.path.dirname(candidate)\n\n            module_name = relpath(module_search_desc, start=candidate).replace(\n                \"\\\\\", \".\"\n            )\n    elif not isWin32Windows() and \"/\" in module_search_desc:\n        if os.path.exists(module_search_desc):\n            module_filename = module_search_desc\n        else:\n            if module_search_desc.endswith(\".py\"):\n                module_search_desc = module_search_desc[:-3]\n\n            candidate = module_search_desc\n\n            while not candidate.endswith(\".dist\"):\n                candidate = os.path.dirname(candidate)\n\n            module_name = relpath(module_search_desc, start=candidate).replace(\"/\", \".\")\n    else:\n        module_name = ModuleName(module_search_desc)\n\n    if module_name is not None:\n        addMainScriptDirectory(os.getcwd())\n        module_filename = findModuleCode(module_name)\n\n    if module_filename is None:\n        tools_logger.sysexit(\"Error, did not find '%s' module\" % module_name)\n    else:\n        if os.path.isdir(module_filename):\n            candidate = os.path.join(module_filename, (\"__init__.py\"))\n\n            if os.path.isfile(candidate):\n                module_filename = candidate\n\n        if os.path.isdir(module_filename):\n            tools_logger.sysexit(\n                \"Error, %s is a namespace package with no code\" % module_name\n            )\n\n        if module_name is not None:\n            tools_logger.info(\"Found '%s' as '%s'\" % (module_name, module_filename))\n\n        visual_code_binary = getExecutablePath(\n            \"code.cmd\" if isWin32Windows() else \"code\"\n        )\n\n        if visual_code_binary:\n            callProcess([visual_code_binary, module_filename])\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/general/find_module/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/onefile_compressor/OnefileCompressor.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Internal tool, compression standalone distribution files and attach to onefile bootstrap binary.\n\n\"\"\"\n\nimport os\nimport shutil\nimport struct\nimport sys\nfrom contextlib import contextmanager\n\nfrom nuitka.__past__ import to_byte\nfrom nuitka.Progress import (\n    closeProgressBar,\n    enableProgressBar,\n    reportProgressBar,\n    setupProgressBar,\n)\nfrom nuitka.Tracing import onefile_logger\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import getFileList, getFileSize, makePath\nfrom nuitka.utils.Hashing import Hash, HashCRC32\nfrom nuitka.utils.Utils import (\n    decoratorRetries,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n)\nfrom nuitka.Version import version_string\n\n\ndef getCompressorLevel(low_memory):\n    return 3 if low_memory else 22\n\n\ndef getCompressorFunction(expect_compression, low_memory):\n    # spell-checker: ignore zstd, closefd\n\n    if expect_compression:\n        from zstandard import ZstdCompressor  # pylint: disable=I0021,import-error\n\n        compressor_context = ZstdCompressor(level=getCompressorLevel(low_memory))\n\n        @contextmanager\n        def useCompressedFile(output_file):\n            with compressor_context.stream_writer(\n                output_file, closefd=False\n            ) as compressed_file:\n                yield compressed_file\n\n        onefile_logger.info(\"Using compression for onefile payload.\")\n\n        return b\"Y\", useCompressedFile\n    else:\n\n        @contextmanager\n        def useSameFile(output_file):\n            yield output_file\n\n        return b\"X\", useSameFile\n\n\ndef _attachOnefilePayloadFile(\n    output_file,\n    is_archive,\n    is_compressing,\n    use_compression_cache,\n    low_memory,\n    file_compressor,\n    filename_full,\n    count,\n    dist_dir,\n    filename_encoding,\n    file_checksums,\n    win_path_sep,\n):\n    # Somewhat detail rich, at least unless we make more things mandatory, and\n    # we also need to pass all modes, since this can be run in a separate process\n    # that has no access to options.\n    # pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements\n\n    payload_item_size = 0\n\n    filename_relative = os.path.relpath(filename_full, dist_dir)\n\n    reportProgressBar(\n        item=filename_relative,\n        update=False,\n    )\n\n    # Might be changing from POSIX to Win32 Python on Windows.\n    if win_path_sep:\n        filename_relative = filename_relative.replace(\"/\", \"\\\\\")\n    else:\n        filename_relative = filename_relative.replace(\"\\\\\", \"/\")\n\n    filename_encoded = (filename_relative + \"\\0\").encode(filename_encoding)\n\n    output_file.write(filename_encoded)\n    payload_item_size += len(filename_encoded)\n\n    file_flags = 0\n    if not isWin32OrPosixWindows() and os.path.islink(filename_full):\n        link_target = os.readlink(filename_full)\n\n        file_flags |= 2\n        file_header = to_byte(file_flags)\n\n        output_file.write(file_header)\n        payload_item_size += len(file_header)\n\n        link_target_encoded = (link_target + \"\\0\").encode(filename_encoding)\n\n        output_file.write(link_target_encoded)\n        payload_item_size += len(link_target_encoded)\n    else:\n        # This flag is only relevant for non-links.\n        if not isWin32OrPosixWindows() and os.access(filename_full, os.X_OK):\n            file_flags |= 1\n\n        with open(filename_full, \"rb\") as input_file:\n            input_file.seek(0, 2)\n            input_size = input_file.tell()\n            input_file.seek(0, 0)\n\n            file_header = b\"\"\n\n            if not isWin32OrPosixWindows():\n                file_header += to_byte(file_flags)\n\n            file_header += struct.pack(\"Q\", input_size)\n\n            if file_checksums:\n                hash_crc32 = HashCRC32()\n                hash_crc32.updateFromFileHandle(input_file)\n                input_file.seek(0, 0)\n\n                # CRC32 value 0 is avoided, used as error indicator in C code.\n                file_header += struct.pack(\"I\", hash_crc32.asDigest() or 1)\n\n            if is_archive and is_compressing:\n                compression_cache_filename = _getCacheFilename(\n                    binary_filename=filename_full, low_memory=low_memory\n                )\n\n                if not os.path.exists(compression_cache_filename):\n                    with open(compression_cache_filename, \"wb\") as archive_entry_file:\n                        with file_compressor(\n                            archive_entry_file\n                        ) as compressed_file_tmp2:\n                            shutil.copyfileobj(input_file, compressed_file_tmp2)\n\n                        compressed_size = archive_entry_file.tell()\n                else:\n                    compressed_size = getFileSize(compression_cache_filename)\n\n                file_header += struct.pack(\"I\", compressed_size)\n\n            output_file.write(file_header)\n            payload_item_size += len(file_header)\n\n            if is_archive and is_compressing:\n                with open(compression_cache_filename, \"rb\") as archive_entry_file:\n                    pos1 = output_file.tell()\n                    shutil.copyfileobj(archive_entry_file, output_file)\n                    pos2 = output_file.tell()\n                    assert pos2 - pos1 == compressed_size\n\n                if count == 0 or not use_compression_cache:\n                    os.unlink(compression_cache_filename)\n\n                payload_item_size += compressed_size\n\n            else:\n                shutil.copyfileobj(input_file, output_file)\n                payload_item_size += input_size\n\n    reportProgressBar(\n        item=filename_relative,\n        update=True,\n    )\n\n    return payload_item_size\n\n\ndef _getCacheFilename(binary_filename, low_memory):\n    hash_value = Hash()\n\n    hash_value.updateFromFile(filename=binary_filename)\n\n    # Have different values for different Python major versions.\n    hash_value.updateFromValues(sys.version, sys.executable)\n\n    # Take Nuitka version into account as well, ought to catch code changes.\n    hash_value.updateFromValues(version_string)\n\n    # Take zstandard version and compression level into account.\n    from zstandard import __version__\n\n    hash_value.updateFromValues(__version__, getCompressorLevel(low_memory))\n\n    cache_dir = getCacheDir(\"onefile-compression\")\n    makePath(cache_dir)\n\n    return os.path.join(cache_dir, hash_value.asHexDigest())\n\n\ndef attachOnefilePayload(\n    dist_dir,\n    onefile_output_filename,\n    start_binary,\n    expect_compression,\n    as_archive,\n    use_compression_cache,\n    file_checksums,\n    win_path_sep,\n    low_memory,\n):\n    compression_indicator, compressor = getCompressorFunction(\n        expect_compression=expect_compression,\n        low_memory=low_memory,\n    )\n\n    @decoratorRetries(\n        logger=onefile_logger,\n        purpose=\"write payload to '%s'\" % onefile_output_filename,\n        consequence=\"the result is unusable\",\n    )\n    def _attachOnefilePayload():\n        with open(onefile_output_filename, \"ab\") as output_file:\n            # Seeking to end of file seems necessary on Python2 at least, maybe it's\n            # just that tell reports wrong value initially.\n            output_file.seek(0, 2)\n            start_pos = output_file.tell()\n            output_file.write(b\"KA\" + compression_indicator)\n\n            # Move the binary to start immediately to the start position\n            file_list = getFileList(dist_dir, normalize=False)\n            file_list.remove(start_binary)\n            file_list.insert(0, start_binary)\n\n            if isWin32Windows():\n                filename_encoding = \"utf-16le\"\n            else:\n                filename_encoding = \"utf8\"\n\n            payload_size = 0\n\n            setupProgressBar(\n                stage=\"Onefile Payload\",\n                unit=\"module\",\n                total=len(file_list),\n            )\n\n            # Abstract the differences here for the time being.\n            if as_archive:\n                # Fake compressor then\n                @contextmanager\n                def overall_compressor(f):\n                    yield f\n\n                file_compressor = compressor\n                is_archive = True\n            else:\n                overall_compressor = compressor\n\n                @contextmanager\n                def file_compressor(f):\n                    yield f\n\n                is_archive = False\n\n            with overall_compressor(output_file) as compressed_file:\n                for count, filename_full in enumerate(file_list, start=1):\n                    payload_size += _attachOnefilePayloadFile(\n                        output_file=compressed_file,\n                        is_archive=is_archive,\n                        file_compressor=file_compressor,\n                        is_compressing=compression_indicator == b\"Y\",\n                        use_compression_cache=use_compression_cache,\n                        low_memory=low_memory,\n                        filename_full=filename_full,\n                        count=count,\n                        dist_dir=dist_dir,\n                        filename_encoding=filename_encoding,\n                        file_checksums=file_checksums,\n                        win_path_sep=win_path_sep,\n                    )\n\n                # Using empty filename as a terminator.\n                filename_encoded = \"\\0\".encode(filename_encoding)\n                compressed_file.write(filename_encoded)\n                payload_size += len(filename_encoded)\n\n                compressed_size = compressed_file.tell()\n\n            if compression_indicator == b\"Y\":\n                onefile_logger.info(\n                    \"Onefile payload compression ratio (%.2f%%) size %d to %d.\"\n                    % (\n                        (float(compressed_size) / payload_size) * 100,\n                        payload_size,\n                        compressed_size,\n                    )\n                )\n\n            # TODO: If put into a resource, this is not really needed anymore.\n            if isWin32Windows():\n                # add padding to have the start position at a double world boundary\n                # this is needed on windows so that a possible certificate immediately\n                # follows the start position\n                pad = output_file.tell() % 8\n                if pad != 0:\n                    output_file.write(bytes(8 - pad))\n\n            output_file.seek(0, 2)\n            end_pos = output_file.tell()\n\n            # Size of the payload data plus the size of that size storage, so C code can\n            # jump directly to it.\n            output_file.write(struct.pack(\"Q\", end_pos - start_pos))\n\n        closeProgressBar()\n\n    _attachOnefilePayload()\n\n\ndef main():\n    # Internal tool, most simple command line handling. This is the build directory\n    # where main Nuitka put the .const files.\n    dist_dir = sys.argv[1]\n    onefile_output_filename = sys.argv[2]\n    start_binary = os.path.normpath(sys.argv[3])  # Might switch from MSYS2 to CPython\n    file_checksums = sys.argv[4] == \"True\"\n    win_path_sep = sys.argv[5] == \"True\"\n    low_memory = sys.argv[6] == \"True\"\n    as_archive = sys.argv[7] == \"True\"\n    use_compression_cache = sys.argv[8] == \"True\"\n\n    if os.getenv(\"NUITKA_PROGRESS_BAR\") == \"1\":\n        enableProgressBar()\n\n    attachOnefilePayload(\n        dist_dir=dist_dir,\n        onefile_output_filename=onefile_output_filename,\n        start_binary=start_binary,\n        # We wouldn't be here, if that was not the case.\n        expect_compression=True,\n        as_archive=as_archive,\n        use_compression_cache=use_compression_cache,\n        file_checksums=file_checksums,\n        win_path_sep=win_path_sep,\n        low_memory=low_memory,\n    )\n\n    sys.exit(0)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/onefile_compressor/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/onefile_compressor/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Internal tool, attach the standalone distribution in compressed form.\n\n\"\"\"\n\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n    sys.path.insert(0, os.environ[\"NUITKA_PACKAGE_HOME\"])\n\n    import nuitka  # just to have it loaded from there, pylint: disable=unused-import\n\n    del sys.path[0]\n\n    sys.path = [\n        path_element\n        for path_element in sys.path\n        if os.path.dirname(os.path.abspath(__file__)) != path_element\n    ]\n\n    from nuitka.tools.onefile_compressor.OnefileCompressor import main\n\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/podman/Podman.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Podman container usage tools. \"\"\"\n\nfrom nuitka.utils.Execution import getExecutablePath\nfrom nuitka.utils.Utils import (\n    isDebianBasedLinux,\n    isFedoraBasedLinux,\n    isLinux,\n    isWin32Windows,\n)\n\n\ndef getPodmanExecutablePath(logger):\n    result = getExecutablePath(\"podman\")\n\n    if getExecutablePath(\"podman\") is None:\n        if isWin32Windows():\n            logger.sysexit(\n                \"\"\"\\\nCannot find 'podman'. Install it from \\\n'https://github.com/containers/podman/blob/main/docs/tutorials/podman-for-windows.md'.\"\"\"\n            )\n        elif isLinux():\n            if isDebianBasedLinux():\n                logger.sysexit(\n                    \"Cannot find 'podman'. Install it with 'apt-get install podman'.\"\n                )\n            elif isFedoraBasedLinux():\n                logger.sysexit(\n                    \"Cannot find 'podman'. Install it with 'dnf install podman'.\"\n                )\n            else:\n                logger.sysexit(\n                    \"Cannot find 'podman'. Install it with your package manager.\"\n                )\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/podman/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/podman/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for running a script inside a container.\n\nPodman and Docker should both work, but the first one is recommended.\n\"\"\"\n\nimport os\nimport shutil\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.release.Release import (\n    getBranchName,\n    getBranchRemoteIdentifier,\n)\nfrom nuitka.Tracing import OurLogger\nfrom nuitka.utils.Download import getCachedDownloadedMinGW64\nfrom nuitka.utils.Execution import (\n    callProcess,\n    check_output,\n    getExecutablePath,\n    withEnvironmentPathAdded,\n)\nfrom nuitka.utils.FileOperations import (\n    changeFilenameExtension,\n    putTextFileContents,\n)\nfrom nuitka.utils.Utils import getArchitecture, isWin32Windows\n\nfrom .Podman import getPodmanExecutablePath\n\ncontainers_logger = OurLogger(\"Nuitka-Containers\", base_style=\"blue\")\n\n\ndef parseOptions():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--container-id\",\n        action=\"store\",\n        dest=\"container_id\",\n        default=\"CI\",\n        help=\"\"\"\nName of the container to use. Defaults to \"CI\" which is used for testing\nNuitka with Linux.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-build-container\",\n        action=\"store_true\",\n        dest=\"no_build_container\",\n        help=\"\"\"\nDo not update the the container, use it if updating was done recently.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--command\",\n        action=\"store\",\n        dest=\"command\",\n        help=\"\"\"\nCommand to execute, all in one value.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--podman-path\",\n        action=\"store\",\n        dest=\"podman_path\",\n        default=None,\n        help=\"\"\"\nPodman binary in case you do not have it in your path.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--podman-verbose\",\n        action=\"store_false\",\n        dest=\"quiet\",\n        default=True,\n        help=\"\"\"\nDot not use podman quietly, giving more messages during build.\"\"\",\n    )\n\n    parser.add_option(\n        \"--shared-path\",\n        action=\"append\",\n        dest=\"shared_paths\",\n        default=[],\n        help=\"\"\"\nPath to share with container, use \"--shared-path=src=dst\" format for directory names.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--network\",\n        action=\"store_true\",\n        dest=\"network\",\n        default=False,\n        help=\"\"\"\nThis container run should be allowed to use network.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--isolated\",\n        action=\"store_true\",\n        dest=\"isolated\",\n        default=None,\n        help=\"\"\"\nThis container run should not be provided host access of any kind.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-isolated\",\n        action=\"store_false\",\n        dest=\"isolated\",\n        default=None,\n        help=\"\"\"\nThis container run should be provided host access even if the name suggests otherwise.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--pbuilder\",\n        action=\"store_true\",\n        dest=\"pbuilder\",\n        default=False,\n        help=\"\"\"\nThis container run should be allowed to use pbuilder.\n\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if positional_args:\n        containers_logger.sysexit(\n            \"This command takes no positional arguments, check help output.\"\n        )\n\n    if options.podman_path is None:\n        options.podman_path = getPodmanExecutablePath(containers_logger)\n\n        assert options.podman_path is not None\n\n    return options\n\n\ndef isPodman(podman_path):\n    return \"podman\" in os.path.normcase(os.path.basename(podman_path))\n\n\ndef updateContainer(podman_path, container_tag_name, container_file_path, quiet):\n    requirements_file = os.path.join(\n        os.path.dirname(__file__), \"..\", \"..\", \"..\", \"requirements-devel.txt\"\n    )\n\n    if not os.path.exists(requirements_file):\n        containers_logger.sysexit(\n            \"Error, cannot find expected requirements-devel.txt file.\"\n        )\n\n    containers_logger.info(\"Updating container '%s'...\" % container_tag_name)\n\n    requirements_tmp_file = os.path.join(\n        os.path.dirname(container_file_path), \"requirements-devel.txt\"\n    )\n\n    shutil.copy(requirements_file, requirements_tmp_file)\n\n    try:\n        command = [\n            podman_path,\n            \"build\",\n            # Tolerate errors checking for image download, and use old one\n            \"--tag\",\n            container_tag_name,\n            \"-f\",\n            container_file_path,\n        ]\n\n        if quiet:\n            command.append(\"--quiet\")\n\n        if isPodman(podman_path):\n            # Podman only.\n            command.append(\"--pull=newer\")\n        else:\n            # Context directory needed for Docker.\n            command.append(\".\")\n\n        exit_code = callProcess(command)\n\n        if exit_code:\n            containers_logger.sysexit(\n                \"Failed to update container with exit code '%d'. Command used was: %s\"\n                % (exit_code, \" \".join(command)),\n                exit_code=exit_code,\n            )\n\n        containers_logger.info(\n            \"Updated container '%s' successfully.\" % container_tag_name\n        )\n\n    finally:\n        os.unlink(requirements_tmp_file)\n\n\ndef getCppPath():\n    cpp_path = getExecutablePath(\"cpp_path\")\n\n    # Windows extra ball, attempt the downloaded one.\n    if isWin32Windows() and cpp_path is None:\n        from nuitka.Options import assumeYesForDownloads\n\n        mingw64_gcc_path = getCachedDownloadedMinGW64(\n            target_arch=getArchitecture(),\n            assume_yes_for_downloads=assumeYesForDownloads(),\n        )\n\n        with withEnvironmentPathAdded(\"PATH\", os.path.dirname(mingw64_gcc_path)):\n            cpp_path = getExecutablePath(\"cpp\")\n\n            os.environ[\"CPP_PATH\"] = cpp_path\n\n    if cpp_path is None:\n        containers_logger.sysexit(\n            \"Error, need 'cpp' binary to execute this container file using.'\"\n        )\n\n    return cpp_path\n\n\ndef _makeMountDesc(options, src_path, dst_path, flags):\n    src_path = os.path.expanduser(src_path)\n\n    mount_desc = \"type=bind,source=%s,dst=%s\" % (src_path, dst_path)\n\n    if isPodman(options.podman_path):\n        mount_desc += \",relabel=shared\"\n\n    if flags:\n        mount_desc += \",%s\" % flags\n\n    if options.isolated:\n        mount_desc += \",ro\"\n\n    return mount_desc\n\n\ndef _checkIsolated(options, container_tag_name):\n    if options.isolated:\n        containers_logger.info(\"Running isolated as per user choice.\")\n    # Auto-isolate by container name.\n    elif \"isolated\" in container_tag_name.lower() and options.isolated is None:\n        containers_logger.info(\"Running isolated as per container name default.\")\n        options.isolated = True\n    elif options.isolated is False:\n        containers_logger.info(\"Running NOT isolated as per user choice.\")\n    else:\n        containers_logger.info(\"Running NOT isolated as per default.\")\n\n\ndef _checkContainerArgument(options, default_container_directory):\n    if (\"/\" in options.container_id or \"\\\\\" in options.container_id) and os.path.exists(\n        options.container_id\n    ):\n        container_file_path = options.container_id\n\n        if container_file_path.endswith(\".in\"):\n            container_file_path_template = container_file_path\n            container_file_path = container_file_path[:-3]\n        else:\n            assert False\n\n        options.container_id = changeFilenameExtension(\n            os.path.basename(container_file_path), \"\"\n        )\n    else:\n        container_file_path = os.path.join(\n            default_container_directory, options.container_id + \".containerfile\"\n        )\n        container_file_path_template = container_file_path + \".in\"\n\n    return container_file_path_template, container_file_path\n\n\ndef main():\n    options = parseOptions()\n\n    if options.command is None:\n        options.command = \"python3 -m nuitka --version\"\n\n    containers_logger.info(\n        \"Running in container '%s' this command: %s\"\n        % (options.container_id, options.command)\n    )\n\n    default_container_directory = os.path.join(os.path.dirname(__file__), \"containers\")\n\n    container_file_path_template, container_file_path = _checkContainerArgument(\n        options=options, default_container_directory=default_container_directory\n    )\n\n    if os.path.isfile(container_file_path_template):\n        # Check requirement.\n        cpp_path = getCppPath()\n        command = [\n            cpp_path,\n            \"-E\",\n            \"-I\",\n            default_container_directory,\n            container_file_path_template,\n        ]\n\n        output = check_output(command, shell=False)\n        if str is not bytes:\n            output = output.decode(\"utf8\")\n\n        putTextFileContents(container_file_path, output, encoding=\"utf8\")\n\n    if not os.path.isfile(container_file_path):\n        containers_logger.sysexit(\n            \"Error, no container ID '%s' found\" % options.container_id\n        )\n\n    getBranchRemoteIdentifier()\n\n    container_tag_name = \"nuitka-build-%s-%s:latest\" % (\n        options.container_id.lower(),\n        getBranchRemoteIdentifier() + \"-\" + getBranchName(),\n    )\n\n    _checkIsolated(options, container_tag_name)\n\n    if not options.no_build_container:\n        updateContainer(\n            podman_path=options.podman_path,\n            container_tag_name=container_tag_name,\n            container_file_path=container_file_path,\n            quiet=options.quiet,\n        )\n\n    command = [options.podman_path, \"run\"]\n\n    command.extend(\n        (\n            \"--mount\",\n            _makeMountDesc(options=options, src_path=\".\", dst_path=\"/src\", flags=\"\"),\n        )\n    )\n\n    if options.network:\n        command.append(\"--add-host=ssh.nuitka.net:116.202.30.188\")\n    else:\n        command.append(\"--network=none\")\n\n    # May need to allow pbuilder to create device nodes, makes the container insecure\n    # though.\n    if options.pbuilder:\n        command += [\"--privileged\"]\n\n    for path_desc in options.shared_paths:\n        if path_desc.count(\"=\") == 1:\n            src_path, dst_path = path_desc.split(\"=\")\n            flags = \"\"\n        else:\n            src_path, dst_path, flags = path_desc.split(\"=\", 2)\n\n        src_path = os.path.expanduser(src_path)\n\n        command.extend(\n            (\n                \"--mount\",\n                _makeMountDesc(\n                    options=options, src_path=src_path, dst_path=dst_path, flags=flags\n                ),\n            )\n        )\n\n    # Interactive if possible only.\n    if sys.stdout.isatty():\n        command.append(\"-it\")\n\n    command += [\n        container_tag_name,\n        \"bash\",\n        \"-l\",\n        \"-c\",\n        \"cd /src;\" + options.command + \"; exit $?\",\n    ]\n\n    exit_code = callProcess(command, shell=False, logger=containers_logger)\n\n    containers_logger.sysexit(\n        \"Finished container run with exit code '%d'.\" % exit_code, exit_code=exit_code\n    )\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/podman/containers/CI.containerfile",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\nFROM debian:11-slim\nENV container docker\n\nVOLUME [ \"/sys/fs/cgroup\" ]\n\n## Install what we use for CI generally\nCOPY requirements-devel.txt /etc/requirements-devel.txt\nRUN mkdir /src\nRUN echo >>/etc/apt/sources.list \"deb http://deb.debian.org/debian bullseye-backports main\"\nRUN apt-get update && apt-get install -y apt-utils gcc python2 python2-dev python3 python3-dev python3-pip git rst2pdf help2man chrpath dput lintian gdb strace ccache\n\n## Install pbuilder extra stuff along with Nuitka build dependencies.\nRUN apt-get install -y pbuilder python3-stdeb lintian devscripts reprepro python3-appdirs scons dh-python python3-all-dev python3-all-dbg rsync python3-yaml python3-glob2 patchelf libzstd-dev\n\n## Update reprepro from backports\nRUN apt-get install -y -t bullseye-backports reprepro\n\nRUN python3 -m pip install -U -r /etc/requirements-devel.txt wheel\n\n## Clean up APT when done.\nRUN apt-get clean && rm -rf \"/var/lib/apt/lists/*\" \"/tmp/*\" \"/var/tmp/*\"\n\n## Do what git asks us to do, for working with git checkouts.\nRUN git config --global --add safe.directory /src\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/podman/containers/Python-Minor-Versions.containerfile",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\nFROM debian:buster\n\n# Install dependencies\nRUN apt-get update && apt-get install -y curl wget build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev gdb\n\n# Install Python 3.7.3\nRUN wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz \\\n && tar -xf Python-3.7.3.tgz \\\n && cd Python-3.7.3 \\\n && ./configure --prefix=/opt/python3.7.3/ --disable-shared --enable-ipv6 --enable-optimizations LDFLAGS='-Xlinker -export-dynamic -rdynamic' \\\n && make LDFLAGS='-Xlinker -export-dynamic -rdynamic' \\\n && make install\n\n# Install Python 3.7.4\nRUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \\\n && tar -xf Python-3.7.4.tgz \\\n && cd Python-3.7.4 \\\n && ./configure --prefix=/opt/python3.7.4/ --disable-shared --enable-ipv6 --enable-optimizations LDFLAGS='-Xlinker -export-dynamic -rdynamic' \\\n && make LDFLAGS='-Xlinker -export-dynamic -rdynamic' \\\n && make install\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/profiler/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/profiler/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Profiling for Nuitka and CPython.\n\nThis provides the capability of comparing performance results of Nuitka and\nCPython relatively to one another.\n\"\"\"\n\n# Note: This is currently severely broken.\n\nimport runpy\nimport sys\nimport tempfile\n\nfrom nuitka.Tracing import my_print\n\n\ndef _namelen(e):\n    if e.startswith(\"py:\"):\n        return len(e.split(\":\")[1])\n    else:\n        return len(e)\n\n\ndef show(stats):\n    p = stats.top_profile()\n    if not p:\n        my_print(\"no stats\")\n        return\n\n    p.sort(key=lambda x: x[1], reverse=True)\n    top = p[0][1]\n\n    max_len = max(_namelen(e[0]) for e in p)\n\n    my_print(\" vmprof output:\")\n    my_print(\" %:      name:\" + \" \" * (max_len - 3) + \"location:\")\n\n    for k, v in p:\n        v = \"%.1f%%\" % (float(v) / top * 100)\n        if v == \"0.0%\":\n            v = \"<0.1%\"\n        if k.startswith(\"py:\"):\n            _, func_name, lineno, filename = k.split(\":\", 3)\n            lineno = int(lineno)\n            my_print(\n                \" %s %s %s:%d\"\n                % (v.ljust(7), func_name.ljust(max_len + 1), filename, lineno)\n            )\n        else:\n            my_print(\" %s %s\" % (v.ljust(7), k.ljust(max_len + 1)))\n\n\ndef main():\n    import vmprof  # pylint: disable=I0021,import-error\n\n    with tempfile.NamedTemporaryFile() as prof_file:\n        vmprof.enable(prof_file.fileno(), 0.001)\n\n        try:\n            program = sys.argv[1]\n            del sys.argv[1]\n\n            #            sys.argv = [args.program] + args.args\n            runpy.run_path(program, run_name=\"__main__\")\n        except (KeyboardInterrupt, SystemExit):\n            pass\n\n        vmprof.disable()\n\n        stats = vmprof.read_profile(prof_file.name)\n\n        show(stats)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/Git.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Functions to handle git staged content.\n\nInspired from https://raw.githubusercontent.com/hallettj/git-format-staged/master/git-format-staged\n\nOriginal author: Jesse Hallett <jesse@sitr.us>\n\n\"\"\"\n\nimport os\nimport re\n\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.CStrings import decodeCStringToPython\nfrom nuitka.utils.Execution import (\n    NuitkaCalledProcessError,\n    check_call,\n    check_output,\n    executeProcess,\n)\nfrom nuitka.utils.FileOperations import openTextFile\n\n\n# Parse output from `git diff-index`\ndef _parseIndexDiffLine(line):\n    pattern = re.compile(\n        r\"^:(\\d+) (\\d+) ([a-f0-9]+) ([a-f0-9]+) ([A-Z])(\\d+)?\\t([^\\t]+)(?:\\t([^\\t]+))?$\"\n    )\n\n    zeroed_pat = re.compile(\"^0+$\")\n\n    # Returns the argument unless the argument is a string of zeroes, in which case\n    # returns `None`\n    def unless_zeroed(s):\n        return s if not zeroed_pat.match(s) else None\n\n    match = pattern.match(line)\n    if not match:\n        raise ValueError(\"Failed to parse diff-index line: \" + line)\n\n    def parseGitPath(value):\n        if value is None:\n            return None\n\n        if value.startswith('\"'):\n            return decodeCStringToPython(value).decode(\"utf8\")\n\n        return value\n\n    return {\n        \"src_mode\": unless_zeroed(match.group(1)),\n        \"dst_mode\": unless_zeroed(match.group(2)),\n        \"src_hash\": unless_zeroed(match.group(3)),\n        \"dst_hash\": unless_zeroed(match.group(4)),\n        \"status\": match.group(5),\n        \"score\": int(match.group(6)) if match.group(6) else None,\n        \"src_path\": parseGitPath(match.group(7)),\n        \"dst_path\": parseGitPath(match.group(8)),\n    }\n\n\ndef getStagedFileChangeDesc():\n    # Only file additions and modifications\n    output = check_output(\n        [\"git\", \"diff-index\", \"--cached\", \"--diff-filter=AM\", \"--no-renames\", \"HEAD\"]\n    )\n\n    for line in output.splitlines():\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        yield _parseIndexDiffLine(line)\n\n\ndef getModifiedPaths():\n    result = set()\n\n    output = check_output([\"git\", \"diff\", \"--name-only\"])\n\n    for line in output.splitlines():\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        result.add(line)\n\n    output = check_output([\"git\", \"diff\", \"--cached\", \"--name-only\"])\n\n    for line in output.splitlines():\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        result.add(line)\n\n    return tuple(sorted(filename for filename in result if os.path.exists(filename)))\n\n\ndef getRemoteURL(remote_name):\n    output = check_output([\"git\", \"remote\", \"get-url\", remote_name])\n\n    if str is not bytes:\n        output = output.decode(\"utf8\")\n\n    return output.strip()\n\n\ndef getCurrentBranchName():\n    try:\n        output = check_output([\"git\", \"branch\", \"--show-current\"])\n    except NuitkaCalledProcessError:\n        output = check_output([\"git\", \"symbolic-ref\", \"--short\", \"HEAD\"])\n\n    if str is not bytes:\n        output = output.decode(\"utf8\")\n\n    return output.strip()\n\n\ndef getUnPushedPaths():\n    result = set()\n\n    try:\n        output = check_output([\"git\", \"diff\", \"--stat\", \"--name-only\", \"@{upstream}\"])\n    except NuitkaCalledProcessError:\n        return result\n\n    for line in output.splitlines():\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        # Removed files appear too, but are useless to talk about.\n        if not os.path.exists(line):\n            continue\n\n        result.add(line)\n\n    return tuple(sorted(result))\n\n\ndef getFileHashContent(object_hash):\n    return check_output([\"git\", \"cat-file\", \"-p\", object_hash])\n\n\ndef putFileHashContent(filename):\n    with openTextFile(filename, \"r\") as input_file:\n        new_hash = check_output(\n            [\"git\", \"hash-object\", \"-w\", \"--stdin\"], stdin=input_file\n        )\n\n    if str is not bytes:\n        new_hash = new_hash.decode(\"utf8\")\n\n    assert new_hash\n    return new_hash.rstrip()\n\n\ndef updateFileIndex(diff_entry, new_object_hash):\n    check_call(\n        [\n            \"git\",\n            \"update-index\",\n            \"--cacheinfo\",\n            \"%s,%s,%s\"\n            % (diff_entry[\"dst_mode\"], new_object_hash, diff_entry[\"src_path\"]),\n        ]\n    )\n\n\ndef updateWorkingFile(path, orig_object_hash, new_object_hash):\n    patch = check_output(\n        [\"git\", \"diff\", \"--no-color\", orig_object_hash, new_object_hash]\n    )\n\n    git_path = path.replace(os.path.sep, \"/\").encode(\"utf8\")\n\n    def updateLine(line):\n        if line.startswith(b\"diff --git\"):\n            line = b\"diff --git a/%s b/%s\" % (git_path, git_path)\n        elif line.startswith(b\"--- a/\"):\n            line = b\"--- a/\" + git_path\n        elif line.startswith(b\"+++ b/\"):\n            line = b\"+++ b/\" + git_path\n\n        return line\n\n    # Substitute object hashes in patch header with path to working tree file\n    patch = b\"\\n\".join(updateLine(line) for line in patch.splitlines()) + b\"\\n\"\n\n    # Apply the patch.\n    output, err, exit_code = executeProcess(\n        [\"git\", \"apply\", \"-\"],\n        stdin=patch,\n    )\n\n    # Windows extra ball, new files have new lines that make the patch fail.\n    if exit_code != 0 and os.name == \"nt\":\n        from .auto_format.AutoFormat import cleanupWindowsNewlines\n\n        cleanupWindowsNewlines(path, path)\n\n        output, err, exit_code = executeProcess(\n            [\"git\", \"apply\", \"-\"],\n            stdin=patch,\n        )\n\n    success = exit_code == 0\n\n    if not success:\n        # TODO: In case of failure, do we need to abort, or what do we do.\n\n        if output:\n            my_print(output, style=\"yellow\")\n        if err:\n            my_print(err, style=\"yellow\")\n\n    return success\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/ScanSources.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Many tools work on Nuitka sources and need to find the files.\n\n\"\"\"\n\nimport os\n\nfrom nuitka.utils.Shebang import getShebangFromFile\n\n_default_ignore_list = (\"inline_copy\", \"tblib\", \"__pycache__\")\n\n\ndef _addFromDirectory(path, suffixes, ignore_list):\n    for dirpath, dirnames, filenames in os.walk(path):\n        dirnames.sort()\n\n        # Remove things we never care about.\n        dirnames[:] = [\n            dirname\n            for dirname in dirnames\n            if dirname not in _default_ignore_list\n            if not dirname.endswith((\".build\", \".dist\", \".egg-info\"))\n            if not dirname.startswith(\"CPython\")\n        ]\n\n        filenames.sort()\n\n        for filename in filenames:\n            if filename in ignore_list:\n                continue\n\n            fullpath = os.path.join(dirpath, filename)\n\n            # Ignore links\n            if os.path.islink(fullpath):\n                continue\n\n            # Skip temporary files from flymake mode of Emacs.\n            if filename.endswith(\"_flymake.py\"):\n                continue\n            # Skip temporary files from unsaved files of Emacs.\n            if filename.startswith(\".#\"):\n                continue\n            # Skip bytecode files\n            if filename.endswith((\".pyc\", \".pyo\")):\n                continue\n            # Skip executables\n            if filename.endswith((\".exe\", \".bin\")):\n                continue\n\n            # Python files only might include files with a shebang that points\n            # to Python.\n            if \".py\" in suffixes and not filename.endswith(suffixes):\n                shebang = getShebangFromFile(fullpath)\n\n                if shebang is None or \"python\" not in shebang:\n                    continue\n\n            yield fullpath\n\n\ndef scanTargets(positional_args, suffixes, ignore_list=()):\n    for positional_arg in positional_args:\n        positional_arg = os.path.normpath(positional_arg)\n\n        if os.path.isdir(positional_arg):\n            for value in _addFromDirectory(positional_arg, suffixes, ignore_list):\n                yield value\n        else:\n            yield positional_arg\n\n\ndef isPythonFile(filename, effective_filename=None):\n    if effective_filename is None:\n        effective_filename = filename\n\n    if effective_filename.endswith((\".py\", \".pyw\", \".scons\")):\n        return True\n    elif os.path.isdir(filename):\n        return False\n    else:\n        shebang = getShebangFromFile(filename)\n\n        if shebang is not None:\n            shebang = shebang[2:].lstrip()\n            if shebang.startswith(\"/usr/bin/env\"):\n                shebang = shebang[12:].lstrip()\n\n            if shebang.startswith(\"python\"):\n                return True\n\n    return False\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/apidoc/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/apidoc/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Generated API documentation for Nuitka source.\n\n\"\"\"\n\nimport os\nimport shutil\nimport stat\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import (\n    check_call,\n    getExecutablePath,\n    withEnvironmentPathAdded,\n)\nfrom nuitka.utils.FileOperations import getFileContents, withTemporaryFile\nfrom nuitka.utils.Utils import isWin32OrPosixWindows\n\n\ndef main():\n    goHome()\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--upload\",\n        action=\"store_true\",\n        dest=\"upload\",\n        default=False,\n        help=\"\"\"\\\nUpload to https://nuitka.net/apidoc requires access rights and is done by the\nofficial servers automatically only. Without this, create the local html folder\nonly.\n\nDefault is %default.\"\"\",\n    )\n\n    options, _positional_args = parser.parse_args()\n\n    shutil.rmtree(\"html\", ignore_errors=True)\n\n    doxygen_path = getExecutablePath(\"doxygen\")\n\n    # Extra ball on Windows, check default installation PATH too.\n    if not doxygen_path and isWin32OrPosixWindows():\n        with withEnvironmentPathAdded(\"PATH\", r\"C:\\Program Files\\Doxygen\\bin\"):\n            doxygen_path = getExecutablePath(\"doxygen\")\n\n    if not doxygen_path:\n        sys.exit(\"Error, need to install Doxygen and add it to PATH for this to work.\")\n\n    try:\n        import doxypypy  # pylint: disable=I0021,unused-import,unused-variable\n    except ImportError:\n        sys.exit(\"Error, needs to install doxypypy into this Python.\")\n\n    with withTemporaryFile(suffix=\".doxyfile\", delete=False) as doxy_file:\n        doxy_config = getFileContents(\"doc/Doxyfile.template\")\n\n        with withTemporaryFile(\n            suffix=\".bat\" if isWin32OrPosixWindows() else \".sh\", delete=False\n        ) as doxy_batch_file:\n            if isWin32OrPosixWindows():\n                doxy_batch_file.write(\n                    \"%s -m doxypypy.doxypypy -a -c %%1\" % sys.executable\n                )\n            else:\n                doxy_batch_file.write(\n                    \"#!/bin/sh\\nexec '%s' -m doxypypy.doxypypy -a -c $1\"\n                    % sys.executable\n                )\n\n        doxy_batch_filename = doxy_batch_file.name\n\n        st = os.stat(doxy_batch_filename)\n        os.chmod(doxy_batch_filename, st.st_mode | stat.S_IEXEC)\n\n        doxy_config = doxy_config.replace(\"%DOXYPYPY%\", doxy_batch_filename)\n        doxy_file.write(doxy_config)\n\n        doxy_filename = doxy_file.name\n\n    my_print(\"Running doxygen:\", style=\"blue\")\n    try:\n        check_call([doxygen_path, doxy_filename])\n    finally:\n        os.unlink(doxy_filename)\n        os.unlink(doxy_batch_filename)\n\n    # Update the repository on the web site.\n    if options.upload:\n        assert (\n            os.system(\n                \"rsync -avz --delete html/ --chown www-data root@ssh.nuitka.net:/var/www/apidoc/\"\n            )\n            == 0\n        )\n\n    my_print(\"Finished.\", style=\"blue\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/auto_format/AutoFormat.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tool to automatically format source code in Nuitka style.\n\nspell-checker: ignore mdformat,rstfmt,thirdparty,cpptools,pybench\nspell-checker: ignore containerfile,rpmlintrc,gitmodules\n\"\"\"\n\nimport contextlib\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\n\nfrom nuitka.tools.quality.Git import (\n    getFileHashContent,\n    putFileHashContent,\n    updateFileIndex,\n    updateWorkingFile,\n)\nfrom nuitka.tools.quality.ScanSources import isPythonFile\nfrom nuitka.tools.quality.yamllint.YamlChecker import checkYamlSchema\nfrom nuitka.tools.release.Documentation import extra_rst_keywords\nfrom nuitka.Tracing import general, my_print, tools_logger\nfrom nuitka.utils.Execution import (\n    NuitkaCalledProcessError,\n    check_call,\n    check_output,\n    getExecutablePath,\n    withEnvironmentPathAdded,\n)\nfrom nuitka.utils.FileOperations import (\n    copyFile,\n    getFileContentByLine,\n    getFileContents,\n    listDir,\n    openTextFile,\n    putBinaryFileContents,\n    putTextFileContents,\n    withPreserveFileMode,\n    withTemporaryFile,\n)\nfrom nuitka.utils.Utils import isWin32OrPosixWindows\n\nfrom .YamlFormatter import formatYaml\n\n# black no longer supports Python 2 syntax, and sometimes removes import\n# parts of syntax used in tests\nBLACK_SKIP_LIST = [\n    \"tests/basics/ClassesTest.py\",\n    \"tests/basics/ExecEvalTest.py\",\n    \"tests/basics/HelloWorldTest_2.py\",\n    \"tests/basics/OverflowFunctionsTest_2.py\",\n    \"tests/basics/PrintingTest_2.py\",\n    \"tests/benchmarks/binary-trees.py\",\n    \"tests/benchmarks/comparisons/GeneratorFunctionVsGeneratorExpression.py\",\n    \"tests/benchmarks/constructs/InplaceOperationUnicodeAdd_27.py\",\n    \"tests/benchmarks/constructs/RichComparisonConditionStrings.py\",\n    \"tests/programs/syntax_errors/IndentationErroring.py\",\n    \"tests/syntax/ClosureDel_2.py\",\n    \"tests/syntax/ExecWithNesting_2.py\",\n    \"tests/syntax/IndentationError.py\",\n    \"tests/syntax/StarImportExtra.py\",\n    \"tests/syntax/SyntaxError.py\",\n    \"tests/type_inference/Test1.py\",\n    \"tests/type_inference/Test2.py\",\n    \"tests/type_inference/Test3.py\",\n    \"tests/type_inference/Test4.py\",\n    \"tests/benchmarks/pystone.py\",\n]\nBLACK_SKIP_LIST = [os.path.normpath(path) for path in BLACK_SKIP_LIST]\n\n\ndef cleanupWindowsNewlines(filename, effective_filename):\n    \"\"\"Remove Windows new-lines from a file.\n\n    Simple enough to not depend on external binary and used by\n    the doctest extractions of the CPython test suites.\n    \"\"\"\n\n    with open(filename, \"rb\") as f:\n        source_code = f.read()\n\n    updated_code = source_code.replace(b\"\\r\\n\", b\"\\n\")\n    updated_code = updated_code.replace(b\"\\n\\r\", b\"\\n\")\n\n    # Smuggle consistency replacement in here.\n    if \"AutoFormat.py\" not in effective_filename:\n        updated_code = updated_code.replace(b'.decode(\"utf-8\")', b'.decode(\"utf8\")')\n        updated_code = updated_code.replace(b'.encode(\"utf-8\")', b'.encode(\"utf8\")')\n        updated_code = updated_code.replace(b\"# spellchecker\", b\"# spell-checker\")\n\n        def replacer(match):\n            return b\"PYTHON_VERSION %s %s\" % (match.group(1), match.group(2).lower())\n\n        updated_code = re.sub(\n            b\"PYTHON_VERSION\\\\s+([=<>]+)\\\\s+(0x3[A-F])\", replacer, updated_code\n        )\n\n    if updated_code != source_code:\n        with open(filename, \"wb\") as out_file:\n            out_file.write(updated_code)\n\n\ndef _cleanupTrailingWhitespace(filename):\n    \"\"\"Remove trailing white spaces from a file.\"\"\"\n    source_lines = list(getFileContentByLine(filename, encoding=\"utf8\"))\n\n    clean_lines = [line.rstrip().replace(\"\\t\", \"    \") for line in source_lines]\n\n    while clean_lines and clean_lines[-1] == \"\":\n        del clean_lines[-1]\n\n    if clean_lines != source_lines or (clean_lines and clean_lines[-1] != \"\"):\n        putTextFileContents(filename, contents=clean_lines, encoding=\"utf8\")\n\n\ndef _getRequirementsContentsByLine():\n    return getFileContentByLine(\n        os.path.join(\n            os.path.dirname(__file__), \"..\", \"..\", \"..\", \"..\", \"requirements-devel.txt\"\n        )\n    )\n\n\ndef _getRequiredVersion(tool):\n    for line in _getRequirementsContentsByLine():\n        if line.startswith(tool + \" ==\"):\n            return line.split()[2]\n\n    tools_logger.sysexit(\"Error, cannot find %r in requirements-devel.txt\" % tool)\n\n\ndef _checkRequiredVersion(tool, tool_call):\n    required_version = _getRequiredVersion(tool)\n\n    for line in _getRequirementsContentsByLine():\n        if line.startswith(tool + \" ==\"):\n            required_version = line.split()[2]\n            break\n    else:\n        tools_logger.sysexit(\n            \"Error, cannot find %r in 'requirements-devel.txt' file.\" % tool\n        )\n\n    tool_call = list(tool_call) + [\"--version\"]\n\n    try:\n        version_output = check_output(tool_call)\n    except NuitkaCalledProcessError as e:\n        return False, \"failed to execute: %s\" % e.stderr\n\n    if str is not bytes:\n        version_output = version_output.decode(\"utf8\")\n\n    for line in version_output.splitlines():\n        line = line.strip()\n\n        if line.startswith(\n            (\"black, \", \"python -m black,\", \"__main__.py, \", \"mdformat \")\n        ):\n            if \"(\" in line:\n                line = line[: line.rfind(\"(\")].strip()\n\n            actual_version = line.split()[-1]\n            break\n        if line.startswith(\"VERSION \"):\n            actual_version = line.split()[-1]\n            break\n        if line.startswith(\"rstfmt \"):\n            actual_version = line.split()[-1]\n            break\n\n    else:\n        tools_logger.sysexit(\n            \"Error, couldn't determine version output of '%s' ('%s')\"\n            % (tool, \" \".join(tool_call))\n        )\n\n    message = \"Version of '%s' via '%s' is required to be %r and not %r.\" % (\n        tool,\n        \" \".join(tool_call),\n        required_version,\n        actual_version,\n    )\n\n    return required_version == actual_version, message\n\n\ndef _cleanupPyLintComments(filename, effective_filename):\n    try:\n        new_code = old_code = getFileContents(filename, encoding=\"utf8\")\n    except UnicodeDecodeError:\n        my_print(\"Problem with file %s not having UTF8 encoding.\" % effective_filename)\n        raise\n\n    def replacer(part):\n        def changePyLintTagName(pylint_token):\n            pylint_token = pylint_token.strip()\n            # Save line length for this until isort is better at long lines.\n            if pylint_token == \"useless-suppression\":\n                return \"I0021\"\n            else:\n                return pylint_token\n\n        return part.group(1) + \",\".join(\n            sorted(\n                set(\n                    changePyLintTagName(token)\n                    for token in part.group(2).split(\",\")\n                    if token\n                )\n            )\n        )\n\n    new_code = re.sub(r\"(pylint\\: disable=)\\s*(.*)\", replacer, new_code, flags=re.M)\n\n    if new_code != old_code:\n        putTextFileContents(filename, new_code, encoding=\"utf8\")\n\n\ndef _cleanupImportRelative(filename, effective_filename):\n    \"\"\"Make imports of Nuitka package when possible.\"\"\"\n\n    # Avoid doing it for \"__main__\" packages, because for those the Visual Code\n    # IDE doesn't like it and it may not run\n    if os.path.basename(effective_filename) == \"__main__.py\":\n        return\n\n    package_name = os.path.dirname(effective_filename).replace(os.path.sep, \".\")\n\n    # Make imports local if possible.\n    if not package_name.startswith(\"nuitka.\"):\n        return\n\n    source_code = getFileContents(filename, encoding=\"utf8\")\n    updated_code = re.sub(\n        r\"from %s import\" % package_name, \"from . import\", source_code\n    )\n    updated_code = re.sub(r\"from %s\\.\" % package_name, \"from .\", source_code)\n\n    if source_code != updated_code:\n        putTextFileContents(filename, contents=updated_code, encoding=\"utf8\")\n\n\n_binary_calls = {}\n\n\ndef _getPythonBinaryCall(binary_name):\n    if binary_name not in _binary_calls:\n        messages = []\n\n        # Try running Python installation.\n        try:\n            __import__(binary_name)\n        except ImportError:\n            pass\n        else:\n            call = [sys.executable, \"-m\", binary_name]\n\n            ok, message = _checkRequiredVersion(binary_name, call)\n\n            if ok:\n                _binary_calls[binary_name] = call\n                return _binary_calls[binary_name]\n            else:\n                messages.append(message)\n\n        with withEnvironmentPathAdded(\n            \"PATH\",\n            os.path.join(sys.prefix, \"Scripts\"),\n            os.path.join(sys.prefix, \"bin\"),\n            prefix=True,\n        ):\n            binary_path = getExecutablePath(binary_name)\n\n        if binary_path:\n            call = [binary_path]\n\n            ok, message = _checkRequiredVersion(binary_name, call)\n\n            if ok:\n                _binary_calls[binary_name] = call\n                return _binary_calls[binary_name]\n            else:\n                messages.append(message)\n\n        if messages:\n            my_print(\"ERROR\")\n        for message in messages:\n            my_print(message, style=\"red\")\n\n        tools_logger.sysexit(\n            \"Error, cannot find '%s' version %r, not installed or wrong version for this Python?\"\n            % (binary_name, _getRequiredVersion(binary_name))\n        )\n\n    return _binary_calls[binary_name]\n\n\ndef _cleanupImportSortOrder(filename, effective_filename):\n    _cleanupImportRelative(filename, effective_filename)\n\n    isort_call = _getPythonBinaryCall(\"isort\")\n\n    contents = getFileContents(filename, encoding=\"utf8\")\n\n    start_index = None\n    if \"\\n# isort:start\" in contents:\n        parts = contents.splitlines()\n\n        start_index = parts.index(\"# isort:start\")\n        contents = \"\\n\".join(parts[start_index + 1 :]) + \"\\n\"\n\n        putTextFileContents(filename, contents=contents, encoding=\"utf8\")\n\n    isort_output = check_output(\n        isort_call\n        + [\n            \"-q\",  # quiet, but stdout is still garbage\n            \"--stdout\",  # avoid using another temp file, this is already on one.\n            \"--order-by-type\",  # Order imports by type in addition to alphabetically\n            \"--multi-line=VERTICAL_HANGING_INDENT\",\n            \"--trailing-comma\",\n            \"--project=nuitka\",  # make sure nuitka is first party package in import sorting.\n            \"--float-to-top\",  # move imports to start\n            \"--thirdparty=SCons\",\n            filename,\n        ]\n    )\n\n    if isort_output == b\"\" and contents != \"\":\n        tools_logger.warning(\n            \"The 'isort' failed to handle '%s' properly.\" % effective_filename\n        )\n    else:\n        putBinaryFileContents(filename, isort_output)\n\n    cleanupWindowsNewlines(filename, effective_filename)\n\n    if start_index is not None:\n        contents = getFileContents(filename, encoding=\"utf8\")\n\n        contents = \"\\n\".join(parts[: start_index + 1]) + \"\\n\\n\" + contents.lstrip(\"\\n\")\n\n        putTextFileContents(filename, contents=contents, encoding=\"utf8\")\n\n\ndef _cleanupMarkdownFmt(filename):\n    mdformat_call = _getPythonBinaryCall(\"mdformat\")\n\n    check_call(mdformat_call + [\"--number\", \"--wrap=100\", filename])\n\n\ndef _cleanupRstFmt(filename, effective_filename):\n    updated_contents = contents = getFileContents(filename, mode=\"rb\")\n\n    for keyword in extra_rst_keywords:\n        updated_contents = updated_contents.replace(\n            b\".. %s::\" % keyword, b\".. raw:: %s\" % keyword\n        )\n\n    if updated_contents != contents:\n        with open(filename, \"wb\") as out_file:\n            out_file.write(updated_contents)\n\n    rstfmt_call = _getPythonBinaryCall(\"rstfmt\")\n\n    check_call(\n        rstfmt_call\n        + [\n            filename,\n        ],\n        #        stdout=devnull,\n    )\n\n    cleanupWindowsNewlines(filename, effective_filename)\n\n    contents = getFileContents(filename, mode=\"rb\")\n\n    # Enforce choice between \"bash\" and \"sh\" for code directive. Use bash as\n    # more people will know it.\n    updated_contents = contents.replace(b\".. code:: sh\\n\", b\".. code:: bash\\n\")\n\n    for keyword in extra_rst_keywords:\n        updated_contents = updated_contents.replace(\n            b\".. raw:: %s\" % keyword, b\".. %s::\" % keyword\n        )\n\n    lines = []\n    inside = False\n    needs_empty = False\n\n    for line in updated_contents.splitlines():\n        if line.startswith(b\"-\"):\n            if inside and needs_empty:\n                lines.append(b\"\")\n\n            inside = True\n            needs_empty = True\n            lines.append(line)\n        elif inside and line == b\"\":\n            needs_empty = False\n            lines.append(line)\n        elif inside and line.startswith(b\"  \"):\n            needs_empty = True\n            lines.append(line)\n        else:\n            inside = False\n            lines.append(line)\n\n    updated_contents = b\"\\n\".join(lines) + b\"\\n\"\n\n    if updated_contents != contents:\n        with open(filename, \"wb\") as out_file:\n            out_file.write(updated_contents)\n\n\nwarned_clang_format = False\n_clang_format_path = False\n\n\ndef _getClangFormatPath(trace):\n    # Lots of checks and attempts done here, to find it.\n    # pylint: disable=too-many-branches\n\n    # Using global here, as this is really a singleton, in\n    # the form of a module, pylint: disable=global-statement\n    global warned_clang_format, _clang_format_path\n\n    # Do not try a second time.\n    if warned_clang_format:\n        return None\n\n    if _clang_format_path is not False:\n        return _clang_format_path\n\n    # Search Visual Code C++ extension for LLVM path.\n    for candidate in \".vscode\", \".vscode-server\":\n        vs_code_extension_path = os.path.expanduser(\"~/%s/extensions\" % candidate)\n\n        if not _clang_format_path and os.path.exists(vs_code_extension_path):\n            for extension_path, extension_filename in listDir(vs_code_extension_path):\n                if extension_filename.startswith(\"ms-vscode.cpptools-\"):\n                    with withEnvironmentPathAdded(\n                        \"PATH\", os.path.join(extension_path, \"LLVM/bin\"), prefix=True\n                    ):\n                        _clang_format_path = getExecutablePath(\"clang-format\")\n\n                    break\n\n    # Extra ball on Windows, check default installations paths in MSVC and LLVM too.\n    if not _clang_format_path and isWin32OrPosixWindows():\n        with withEnvironmentPathAdded(\n            \"PATH\",\n            r\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\bin\",\n            r\"C:\\Program Files\\LLVM\\bin\",\n            prefix=True,\n        ):\n            _clang_format_path = getExecutablePath(\"clang-format\")\n\n    if not _clang_format_path:\n        _clang_format_path = (\n            getExecutablePath(\"clang-format-19\")\n            or getExecutablePath(\"clang-format-18\")\n            or getExecutablePath(\"clang-format-17\")\n            or getExecutablePath(\"clang-format-16\")\n            or getExecutablePath(\"clang-format-15\")\n            or getExecutablePath(\"clang-format-14\")\n            or getExecutablePath(\"clang-format-13\")\n            or getExecutablePath(\"clang-format-12\")\n            or getExecutablePath(\"clang-format-12\")\n            or getExecutablePath(\"clang-format\")\n        )\n\n    if _clang_format_path:\n        try:\n            version_output = check_output([_clang_format_path, \"--version\"])\n\n            try:\n                clang_version = int(version_output.split(b\"version \")[1].split(b\".\")[0])\n            except (ValueError, IndexError, TypeError):\n                general.sysexit(\n                    \"Failure to parse this '%s --version' output: %s\"\n                    % (_clang_format_path, version_output),\n                )\n\n            if clang_version < 12:\n                general.warning(\n                    \"\"\"\\\nYou need to install clang-format version 12 or higher. Easiest is to have Visual Code with\nthe recommended extensions installed under your user, as that will then be used by default.\n\"\"\"\n                )\n            elif trace:\n                general.info(\n                    \"Using clang-format version %s to format C code.\" % clang_version\n                )\n        except NuitkaCalledProcessError as e:\n            general.warning(\n                \"failed to execute clang-format version check: %s\" % e.stderr\n            )\n            _clang_format_path = None\n\n    if not _clang_format_path and not warned_clang_format:\n        general.warning(\"Need to install LLVM for C files format.\")\n        warned_clang_format = True\n\n    return _clang_format_path\n\n\ndef _cleanupClangFormat(filename, trace):\n    \"\"\"Call clang-format on a given filename to format C code.\n\n    Args:\n        filename: What file to re-format.\n    \"\"\"\n\n    clang_format_path = _getClangFormatPath(trace=trace)\n\n    if clang_format_path:\n        subprocess.call(\n            [\n                clang_format_path,\n                \"-i\",\n                \"-style={BasedOnStyle: llvm, IndentWidth: 4, ColumnLimit: 120}\",\n                filename,\n            ]\n        )\n\n\ndef _cleanupPngImage(filename):\n    _optipng_path = getExecutablePath(\"optipng\")\n\n    if _optipng_path:\n        check_call([_optipng_path, \"-o7\", \"-zm1-9\", filename])\n    else:\n        my_print(\"Cannot find 'optipng' binary to compress PNG image\")\n\n\ndef _cleanupJpegImage(filename):\n    # spell-checker: ignore jpegoptim\n    _jpegoptim_path = getExecutablePath(\"jpegoptim\")\n\n    if _jpegoptim_path:\n        check_call([_jpegoptim_path, filename])\n    else:\n        my_print(\"Cannot find 'jpegoptim' binary to compress JPEG image\")\n\n\ndef _shouldNotFormatCode(filename):\n    # return driven with more cases than necessary to group things\n    # pylint:disable=too-many-return-statements\n\n    parts = os.path.normpath(filename).split(os.path.sep)\n\n    if \"inline_copy\" in parts:\n        # Our Scons runner should be formatted.\n        if os.path.basename(filename) == \"scons.py\":\n            return False\n\n        return True\n    if \"pybench\" in parts:\n        return True\n    if \"mercurial\" in parts:\n        return True\n    if \"tests\" in parts and parts[parts.index(\"tests\") + 1].startswith(\"CPython\"):\n        return True\n    if \"tests\" in parts and \"syntax\" in parts:\n        return True\n    if \".dist/\" in filename:\n        return True\n    if parts[-1] in (\"incbin.h\", \"hedley.h\"):\n        return True\n\n    if filename.endswith(\".py\"):\n        for line in getFileContentByLine(filename, encoding=\"utf8\"):\n            if \"# encoding: nuitka-protection\" in line:\n                return True\n\n            break\n\n    return False\n\n\ndef _transferBOM(source_filename, target_filename):\n    with open(source_filename, \"rb\") as f:\n        source_code = f.read()\n\n    if source_code.startswith(b\"\\xef\\xbb\\xbf\"):\n        with open(target_filename, \"rb\") as f:\n            source_code = f.read()\n\n        if not source_code.startswith(b\"\\xef\\xbb\\xbf\"):\n            with open(target_filename, \"wb\") as f:\n                f.write(b\"\\xef\\xbb\\xbf\")\n                f.write(source_code)\n\n\ndef autoFormatFile(\n    filename,\n    git_stage,\n    check_only=False,\n    effective_filename=None,\n    trace=True,\n    limit_yaml=False,\n    limit_python=False,\n    limit_c=False,\n    limit_rst=False,\n    limit_md=False,\n    ignore_errors=False,\n    ignore_yaml_diff=True,\n):  # a bit many knobs but that's fine, pylint: disable=too-many-arguments\n    \"\"\"Format source code with external tools\n\n    Args:\n        filename: str - filename to work on\n        git_stage: bool - indicate if this is to be done on staged content\n        abort: bool - error exit in case a tool shows a problem\n        effective_filename: str - derive type of file from this name\n\n    Notes:\n        The effective filename can be used in case this is already a\n        temporary filename intended to replace another.\n\n    Returns:\n        None\n    \"\"\"\n\n    # This does a lot of distinctions\n    # pylint: disable=too-many-branches,too-many-locals,too-many-return-statements,too-many-statements\n\n    if effective_filename is None:\n        effective_filename = filename\n\n    # From git, we sometimes get directories.\n    if os.path.isdir(effective_filename):\n        return\n\n    filename = os.path.normpath(filename)\n    effective_filename = os.path.normpath(effective_filename)\n\n    is_c = effective_filename.endswith((\".c\", \".h\"))\n    is_cpp = effective_filename.endswith((\".cpp\", \".h\"))\n\n    is_txt = effective_filename.endswith(\n        (\n            \".patch\",\n            \".txt\",\n            \".qml\",\n            \".rst\",\n            \".inc\",\n            \".sh\",\n            \".in\",\n            \".md\",\n            \".toml\",\n            \".asciidoc\",\n            \".nuspec\",\n            \".yml\",\n            \".stylesheet\",\n            \".j2\",\n            \".gitignore\",\n            \".gitattributes\",\n            \".gitmodules\",\n            \".json\",\n            \".spec\",\n            \"-rpmlintrc\",\n            \"Containerfile\",\n            \"Containerfile\",\n            \".containerfile\",\n            \".containerfile.in\",\n            \".1\",\n        )\n    ) or os.path.basename(filename) in (\n        \"changelog\",\n        \"compat\",\n        \"control\",\n        \"copyright\",\n        \"lintian-overrides\",\n    )\n\n    is_rst = effective_filename.endswith((\".rst\", \".inc\"))\n    is_md = effective_filename.endswith(\".md\")\n    is_package_config_yaml = effective_filename.endswith(\".nuitka-package.config.yml\")\n\n    is_png = effective_filename.endswith(\".png\")\n    is_jpeg = effective_filename.endswith((\".jpeg\", \".jpg\"))\n\n    is_python = not (\n        is_c or is_cpp or is_txt or is_rst or is_png or is_jpeg\n    ) and isPythonFile(filename=filename, effective_filename=effective_filename)\n\n    # Some parts of Nuitka must not be re-formatted with black or clang-format\n    # as they have different intentions.\n    if not (is_python or is_c or is_cpp or is_txt or is_rst or is_png or is_jpeg):\n        my_print(\"Ignored file type.\")\n        return\n\n    if limit_yaml or limit_python or limit_c or limit_rst or limit_md:\n        if is_package_config_yaml and not limit_yaml:\n            return\n\n        if (is_c or is_cpp) and not limit_c:\n            return\n\n        if is_python and not limit_python:\n            return\n\n        if is_rst and not limit_rst:\n            return\n\n        if is_md and not limit_md:\n            return\n\n        if is_txt and not is_rst and not is_md and not is_package_config_yaml:\n            return\n\n    # Work on a temporary copy\n    tmp_filename = filename + \".tmp\"\n\n    if git_stage:\n        old_code = getFileHashContent(git_stage[\"dst_hash\"])\n    else:\n        old_code = getFileContents(filename, \"rb\")\n\n    with withTemporaryFile(mode=\"wb\", delete=False) as output_file:\n        tmp_filename = output_file.name\n        output_file.write(old_code)\n        output_file.close()\n\n        if is_python:\n            cleanupWindowsNewlines(tmp_filename, effective_filename)\n\n            if not _shouldNotFormatCode(effective_filename):\n                # TODO: isort cannot handle chinese code identifiers.\n                if (\n                    not os.path.basename(\n                        os.path.dirname(os.path.abspath(effective_filename))\n                    )\n                    .lower()\n                    .startswith(\"chinese\")\n                ):\n                    _cleanupImportSortOrder(tmp_filename, effective_filename)\n\n                _cleanupPyLintComments(tmp_filename, effective_filename)\n\n                if effective_filename not in BLACK_SKIP_LIST:\n                    black_call = _getPythonBinaryCall(\"black\")\n\n                    old_contents = getFileContents(tmp_filename, \"rb\")\n\n                    try:\n                        check_call(black_call + [\"-q\", \"--fast\", tmp_filename])\n                    # Catch all the things, pylint: disable=broad-except\n                    except Exception:\n                        tools_logger.warning(\n                            \"Problem formatting for '%s'.\" % effective_filename\n                        )\n\n                        if not ignore_errors:\n                            raise\n\n                    if getFileContents(tmp_filename) == \"\" and old_contents != b\"\":\n                        if ignore_errors:\n                            tools_logger.warning(\n                                \"Problem formatting for '%s'.\" % effective_filename\n                            )\n                        else:\n                            tools_logger.sysexit(\n                                \"Problem formatting for '%s'.\" % effective_filename\n                            )\n\n                            return\n\n                cleanupWindowsNewlines(tmp_filename, effective_filename)\n\n        elif is_c or is_cpp:\n            if not _shouldNotFormatCode(effective_filename):\n                cleanupWindowsNewlines(tmp_filename, effective_filename)\n                _cleanupClangFormat(tmp_filename, trace=trace)\n                cleanupWindowsNewlines(tmp_filename, effective_filename)\n        elif is_txt:\n            if not _shouldNotFormatCode(effective_filename):\n                cleanupWindowsNewlines(tmp_filename, effective_filename)\n                _cleanupTrailingWhitespace(tmp_filename)\n                cleanupWindowsNewlines(tmp_filename, effective_filename)\n\n                if is_rst:\n                    _cleanupRstFmt(tmp_filename, effective_filename)\n\n                if is_md:\n                    _cleanupMarkdownFmt(tmp_filename)\n\n                if is_package_config_yaml:\n                    formatYaml(tmp_filename, ignore_diff=ignore_yaml_diff)\n                    cleanupWindowsNewlines(tmp_filename, effective_filename)\n                    _cleanupTrailingWhitespace(tmp_filename)\n                    checkYamlSchema(\n                        logger=tools_logger,\n                        filename=tmp_filename,\n                        effective_filename=effective_filename,\n                        update=True,\n                    )\n                    formatYaml(tmp_filename, ignore_diff=ignore_yaml_diff)\n                    cleanupWindowsNewlines(tmp_filename, effective_filename)\n                    _cleanupTrailingWhitespace(tmp_filename)\n        elif is_png:\n            _cleanupPngImage(tmp_filename)\n        elif is_jpeg:\n            _cleanupJpegImage(tmp_filename)\n\n        _transferBOM(filename, tmp_filename)\n\n    changed = old_code != getFileContents(tmp_filename, \"rb\")\n\n    if changed:\n        if check_only:\n            my_print(\"%s: FAIL.\" % filename, style=\"red\")\n        else:\n            if trace:\n                my_print(\"Updated %s.\" % filename)\n\n            with withPreserveFileMode(filename):\n                if git_stage:\n                    new_hash_value = putFileHashContent(tmp_filename)\n                    updateFileIndex(git_stage, new_hash_value)\n                    updateWorkingFile(filename, git_stage[\"dst_hash\"], new_hash_value)\n                else:\n                    copyFile(tmp_filename, filename)\n\n    return changed\n\n\n@contextlib.contextmanager\ndef withFileOpenedAndAutoFormatted(filename, ignore_errors=False):\n    my_print(\"Auto-format '%s' ...\" % filename)\n\n    tmp_filename = filename + \".tmp\"\n    with openTextFile(tmp_filename, \"w\") as output:\n        yield output\n\n    autoFormatFile(\n        filename=tmp_filename,\n        git_stage=None,\n        effective_filename=filename,\n        trace=False,\n        ignore_errors=ignore_errors,\n    )\n\n    # TODO: No idea why, but this helps. Would be nice to become able to remove it though.\n    if os.name == \"nt\":\n        autoFormatFile(\n            filename=tmp_filename,\n            git_stage=None,\n            effective_filename=filename,\n            trace=False,\n            ignore_errors=ignore_errors,\n        )\n\n    shutil.copy(tmp_filename, filename)\n    os.unlink(tmp_filename)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/auto_format/YamlFormatter.py",
    "content": "#     Copyright 2024, Fire-Cube <ben7@gmx.ch> find license text at end of file\n\n\n\"\"\" Automatic formatting of Yaml files.\n\nspell-checker: ignore ruamel, scalarstring\n\"\"\"\n\nimport json\nimport sys\n\nfrom nuitka.__past__ import StringIO\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    openTextFile,\n    renameFile,\n)\nfrom nuitka.utils.Yaml import (\n    PackageConfigYaml,\n    getYamlPackageConfigurationSchemaFilename,\n    parseYaml,\n)\n\nMASTER_KEYS = None\nVARIABLE_KEYS = None\nDATA_FILES_KEYS = None\nDLLS_KEYS = None\nDLLS_BY_CODE_KEYS = None\nDLLS_FROM_FILENAMES_KEYS = None\nANTI_BLOAT_KEYS = None\nIMPLICIT_IMPORTS_KEYS = None\nOPTIONS_KEYS = None\nOPTIONS_CHECKS_KEYS = None\nIMPORT_HACK_KEYS = None\n\nSINGLE_QUOTE = \"'\"\nDOUBLE_QUOTE = '\"'\n\nYAML_HEADER = \"\"\"\\\n# yamllint disable rule:line-length\n# yamllint disable rule:indentation\n# yamllint disable rule:comments-indentation\n# yamllint disable rule:comments\n# too many spelling things, spell-checker: disable\n\"\"\"\n\n\ndef _initNuitkaPackageSchema():\n    # Singleton, pylint: disable=global-statement\n    global MASTER_KEYS, VARIABLE_KEYS, DATA_FILES_KEYS, DLLS_KEYS, DLLS_BY_CODE_KEYS\n    global DLLS_FROM_FILENAMES_KEYS, ANTI_BLOAT_KEYS, IMPLICIT_IMPORTS_KEYS\n    global OPTIONS_KEYS, OPTIONS_CHECKS_KEYS, IMPORT_HACK_KEYS\n\n    with openTextFile(\n        getYamlPackageConfigurationSchemaFilename(),\n        \"r\",\n    ) as schema_file:\n        schema = json.load(schema_file)\n\n    MASTER_KEYS = tuple(schema[\"items\"][\"properties\"].keys())\n    VARIABLE_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"variables\"][\"properties\"].keys()\n    )\n    DATA_FILES_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"data-files\"][\"properties\"].keys()\n    )\n    DLLS_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"dlls\"][\"items\"][\"properties\"].keys()\n    )\n    DLLS_BY_CODE_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"dlls\"][\"items\"][\"properties\"][\"by_code\"][\n            \"properties\"\n        ].keys()\n    )\n    DLLS_FROM_FILENAMES_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"dlls\"][\"items\"][\"properties\"][\"from_filenames\"][\n            \"properties\"\n        ].keys()\n    )\n    ANTI_BLOAT_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"anti-bloat\"][\"items\"][\"properties\"].keys()\n    )\n    IMPLICIT_IMPORTS_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"implicit-imports\"][\"items\"][\"properties\"].keys()\n    )\n    OPTIONS_KEYS = tuple(schema[\"items\"][\"properties\"][\"options\"][\"properties\"].keys())\n    OPTIONS_CHECKS_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"options\"][\"properties\"][\"checks\"][\"items\"][\n            \"properties\"\n        ].keys()\n    )\n    IMPORT_HACK_KEYS = tuple(\n        schema[\"items\"][\"properties\"][\"import-hacks\"][\"items\"][\"properties\"].keys()\n    )\n\n\ndef _decideStrFormat(string_value):\n    \"\"\"\n    take the character that is not closest to the beginning or end\n    \"\"\"\n    # Singleton, pylint: disable=too-many-boolean-expressions,too-many-return-statements\n    if (\n        string_value not in MASTER_KEYS\n        and string_value not in DATA_FILES_KEYS\n        and string_value not in VARIABLE_KEYS\n        and string_value not in DLLS_KEYS\n        and string_value not in DLLS_BY_CODE_KEYS\n        and string_value not in DLLS_FROM_FILENAMES_KEYS\n        and string_value not in ANTI_BLOAT_KEYS\n        and string_value not in IMPLICIT_IMPORTS_KEYS\n        and string_value not in OPTIONS_KEYS\n        and string_value not in IMPORT_HACK_KEYS\n        and string_value not in OPTIONS_CHECKS_KEYS\n    ):\n        single_quote_left_pos = string_value.find(\"'\")\n        single_quote_right_pos = string_value.rfind(\"'\")\n        double_quote_left_pos = string_value.find('\"')\n        double_quote_right_pos = string_value.rfind('\"')\n\n        if single_quote_left_pos == -1 and not double_quote_left_pos == -1:\n            return SINGLE_QUOTE\n\n        elif double_quote_left_pos == -1 and not single_quote_left_pos == -1:\n            return DOUBLE_QUOTE\n\n        elif (\n            single_quote_left_pos == -1\n            and single_quote_right_pos == -1\n            and double_quote_left_pos == -1\n            and double_quote_right_pos == -1\n        ):\n            if \"\\n\" in string_value:\n                return DOUBLE_QUOTE\n            else:\n                return SINGLE_QUOTE\n\n        elif (\n            single_quote_left_pos > double_quote_left_pos\n            and single_quote_right_pos < double_quote_right_pos\n        ):\n            return SINGLE_QUOTE\n\n        else:\n            return DOUBLE_QUOTE\n\n    else:\n        return \"\"\n\n\ndef _reorderDictionary(entry, key_order):\n    import ruamel\n\n    # Yes, friends with ruamel here, to make a sorted copy\n    # pylint: disable=protected-access\n\n    result = ruamel.yaml.comments.CommentedMap()\n    for key, value in sorted(\n        entry._items(),\n        key=lambda item: key_order.index(item[0]) if item[0] in key_order else 1000,\n    ):\n        result[key] = value\n\n        # Strip trailing new lines from end of sequence. It is attached to\n        # the last key.\n        if type(value) is ruamel.yaml.comments.CommentedMap and value.items():\n            sub_mapping_key, _submapping_value = list(value._items())[-1]\n\n            if sub_mapping_key in value.ca.items:\n                ca_value = value.ca.items[sub_mapping_key]\n\n                if type(ca_value[2]) is ruamel.yaml.tokens.CommentToken:\n                    ca_value[2]._value = ca_value[2]._value.rstrip() + \"\\n\"\n\n    entry.copy_attributes(result)\n\n    return result\n\n\ndef _reorderDictionaryList(entry_list, key_order):\n    import ruamel\n\n    result = ruamel.yaml.comments.CommentedSeq()\n    result.extend(_reorderDictionary(entry, key_order) for entry in entry_list)\n\n    for attribute_name in entry_list.ca.__slots__:\n        setattr(result.ca, attribute_name, getattr(entry_list.ca, attribute_name))\n\n    return result\n\n\ndef deepCompareYamlFiles(path1, path2):\n    yaml1 = PackageConfigYaml(path1, parseYaml(getFileContents(path1)))\n    yaml2 = PackageConfigYaml(path2, parseYaml(getFileContents(path2)))\n\n    import deepdiff\n\n    diff = deepdiff.diff.DeepDiff(yaml1.items(), yaml2.items(), ignore_order=True)\n\n    return diff\n\n\ndef formatYaml(path, ignore_diff=False):\n    \"\"\"\n    format and sort a yaml file\n    \"\"\"\n    # local on purpose, so no imports are deferred, and complex code\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    sys.setrecursionlimit(100000)\n\n    _initNuitkaPackageSchema()\n\n    import ruamel\n    from ruamel.yaml import YAML\n    from ruamel.yaml.compat import _F\n    from ruamel.yaml.constructor import ConstructorError\n    from ruamel.yaml.nodes import ScalarNode\n    from ruamel.yaml.scalarstring import (\n        DoubleQuotedScalarString,\n        FoldedScalarString,\n        LiteralScalarString,\n        PlainScalarString,\n        SingleQuotedScalarString,\n    )\n\n    class CustomConstructor(ruamel.yaml.constructor.RoundTripConstructor):\n        def construct_scalar(self, node):\n            # foreign code , pylint: disable=too-many-branches,too-many-return-statements\n            if not isinstance(node, ScalarNode):\n                raise ConstructorError(\n                    None,\n                    None,\n                    _F(\n                        \"expected a scalar node, but found {node_id!s}\", node_id=node.id\n                    ),\n                    node.start_mark,\n                )\n\n            if node.style == \"|\" and isinstance(node.value, str):\n                lss = LiteralScalarString(node.value, anchor=node.anchor)\n                if self.loader and self.loader.comment_handling is None:\n                    if node.comment and node.comment[1]:\n                        lss.comment = node.comment[1][0]\n\n                else:\n                    if node.comment is not None and node.comment[1]:\n                        lss.comment = self.comment(node.comment[1][0])\n\n                return lss\n\n            if node.style == \">\" and isinstance(node.value, str):\n                fold_positions = []\n                idx = -1\n                while True:\n                    idx = node.value.find(\"\\a\", idx + 1)\n                    if idx < 0:\n                        break\n\n                    fold_positions.append(idx - len(fold_positions))\n\n                fss = FoldedScalarString(\n                    node.value.replace(\"\\a\", \"\"), anchor=node.anchor\n                )\n                if self.loader and self.loader.comment_handling is None:\n                    if node.comment and node.comment[1]:\n                        fss.comment = node.comment[1][0]\n\n                else:\n                    # NEWCMNT\n                    if node.comment is not None and node.comment[1]:\n                        # nprintf('>>>>nc2', node.comment)\n                        # EOL comment after >\n                        fss.comment = self.comment(node.comment[1][0])  # type: ignore\n\n                if fold_positions:\n                    fss.fold_pos = fold_positions  # type: ignore\n\n                return fss\n\n            elif isinstance(node.value, str):\n                node.style = _decideStrFormat(node.value)\n                if node.style == \"'\":\n                    return SingleQuotedScalarString(node.value, anchor=node.anchor)\n\n                if node.style == '\"':\n                    return DoubleQuotedScalarString(node.value, anchor=node.anchor)\n\n                if node.style == \"\":\n                    return PlainScalarString(node.value, anchor=node.anchor)\n\n            if node.anchor:\n                return PlainScalarString(node.value, anchor=node.anchor)\n\n            return node.value\n\n    ruamel.yaml.constructor.RoundTripConstructor = CustomConstructor\n\n    yaml = YAML(typ=\"rt\", pure=True)\n    yaml.width = 100000000  # high value to not wrap lines\n    yaml.explicit_start = True\n    yaml.indent(sequence=4, offset=2)\n\n    file_data = getFileContents(path, mode=\"rb\")\n\n    data = yaml.load(file_data)\n\n    new_data = []\n    for entry in data:\n        sorted_entry = _reorderDictionary(entry, MASTER_KEYS)\n\n        if \"data-files\" in sorted_entry:\n            sorted_entry[\"data-files\"] = _reorderDictionary(\n                entry[\"data-files\"], DATA_FILES_KEYS\n            )\n\n        if \"dlls\" in sorted_entry:\n            sorted_entry[\"dlls\"] = _reorderDictionaryList(\n                sorted_entry[\"dlls\"], DLLS_KEYS\n            )\n\n        if \"anti-bloat\" in sorted_entry:\n            sorted_entry[\"anti-bloat\"] = _reorderDictionaryList(\n                sorted_entry[\"anti-bloat\"], ANTI_BLOAT_KEYS\n            )\n\n        if \"implicit-imports\" in sorted_entry:\n            sorted_entry[\"implicit-imports\"] = _reorderDictionaryList(\n                sorted_entry[\"implicit-imports\"], IMPLICIT_IMPORTS_KEYS\n            )\n\n        if \"options\" in sorted_entry:\n            sorted_entry[\"options\"][\"checks\"] = _reorderDictionaryList(\n                sorted_entry[\"options\"][\"checks\"], OPTIONS_CHECKS_KEYS\n            )\n\n        if \"import-hacks\" in sorted_entry:\n            sorted_entry[\"import-hacks\"] = _reorderDictionaryList(\n                sorted_entry[\"import-hacks\"], IMPORT_HACK_KEYS\n            )\n\n        new_data.append(sorted_entry)\n\n    new_data = sorted(new_data, key=lambda d: d[\"module-name\"].lower())\n\n    tmp_path = path + \".tmp\"\n\n    with open(tmp_path, \"w\", encoding=\"utf-8\") as output_file:\n        output_file.write(YAML_HEADER)\n\n        string_io = StringIO()\n        yaml.dump(new_data, string_io)\n\n        last_line = None\n        pipe_block = False\n        for line in string_io.getvalue().splitlines():\n            # Duplicate new-lines are a no-go.\n            if last_line == \"\" and line == \"\":\n                continue\n\n            if line.startswith(\"  \"):\n                if not line.lstrip().startswith(\"#\") or pipe_block:\n                    line = line[2:]\n\n            if line.endswith(\"|\"):\n                pipe_block = True\n                pipe_block_prefix = (len(line) - len(line.lstrip()) + 2) * \" \"\n            elif pipe_block and not line.startswith(pipe_block_prefix):\n                pipe_block = False\n\n            if line.startswith(\"- module-name:\"):\n                if (\n                    last_line != \"\"\n                    and not last_line.startswith(\"#\")\n                    and not last_line == \"---\"\n                ):\n                    output_file.write(\"\\n\")\n\n            last_line = line\n\n            output_file.write(line + \"\\n\")\n\n    if not ignore_diff:\n        diff = deepCompareYamlFiles(path, tmp_path)\n        if diff:\n            tools_logger.sysexit(\n                \"Error, auto-format for Yaml file %s is changing contents %s\"\n                % (path, diff)\n            )\n\n    renameFile(tmp_path, path)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/auto_format/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/auto_format/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for auto format tool.\n\n\"\"\"\n\nfrom optparse import OptionParser\n\nfrom nuitka.Progress import enableProgressBar, wrapWithProgressBar\nfrom nuitka.tools.quality.auto_format.AutoFormat import autoFormatFile\nfrom nuitka.tools.quality.Git import getStagedFileChangeDesc\nfrom nuitka.tools.quality.ScanSources import scanTargets\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.FileOperations import resolveShellPatternToFilenames\n\n\ndef main():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--verbose\",\n        action=\"store_true\",\n        dest=\"verbose\",\n        default=False,\n        help=\"\"\"Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--from-commit\",\n        action=\"store_true\",\n        dest=\"from_commit\",\n        default=False,\n        help=\"\"\"From commit hook, do not descend into directories. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--check-only\",\n        action=\"store_true\",\n        dest=\"check_only\",\n        default=False,\n        help=\"\"\"For CI testing, check if it's properly formatted. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-progressbar\",\n        action=\"store_false\",\n        dest=\"progress_bar\",\n        default=True,\n        help=\"\"\"Disable progress bar outputs (if tqdm is installed).\nDefaults to off.\"\"\",\n    )\n\n    parser.add_option(\n        \"--yaml\",\n        action=\"store_true\",\n        dest=\"yaml\",\n        default=False,\n        help=\"\"\"Format only matching Yaml files\nDefaults to off.\"\"\",\n    )\n\n    parser.add_option(\n        \"--python\",\n        action=\"store_true\",\n        dest=\"python\",\n        default=False,\n        help=\"\"\"Format only matching Python files\nDefaults to off.\"\"\",\n    )\n\n    parser.add_option(\n        \"--c\",\n        action=\"store_true\",\n        dest=\"c\",\n        default=False,\n        help=\"\"\"Format only matching C files\nDefaults to off.\"\"\",\n    )\n\n    parser.add_option(\n        \"--rst\",\n        action=\"store_true\",\n        dest=\"rst\",\n        default=False,\n        help=\"\"\"Format only matching rst files\nDefaults to off.\"\"\",\n    )\n\n    parser.add_option(\n        \"--md\",\n        action=\"store_true\",\n        dest=\"md\",\n        default=False,\n        help=\"\"\"Format only matching markdown files\nDefaults to off.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if options.from_commit:\n        assert not positional_args\n        for desc in getStagedFileChangeDesc():\n            autoFormatFile(desc[\"src_path\"], git_stage=desc)\n    else:\n        if not positional_args:\n            positional_args = [\n                \"bin\",\n                \"lib\",\n                \"misc\",\n                \"nuitka\",\n                \"rpm\",\n                \"setup.py\",\n                \"tests\",\n                \".github\",\n            ]\n\n        my_print(\"Working on:\", \", \".join(positional_args))\n\n        positional_args = sum(\n            (\n                resolveShellPatternToFilenames(positional_arg)\n                for positional_arg in positional_args\n            ),\n            [],\n        )\n\n        filenames = list(\n            scanTargets(\n                positional_args,\n                suffixes=(\n                    \".py\",\n                    \".scons\",\n                    \".rst\",\n                    \".txt\",\n                    \".j2\",\n                    \".md\",\n                    \".c\",\n                    \".h\",\n                    \".yml\",\n                ),\n            )\n        )\n        if options.verbose:\n            my_print(\"Selected:\", \", \".join(filenames))\n\n        if not filenames:\n            tools_logger.sysexit(\"No files found.\")\n\n        result = 0\n\n        if options.progress_bar:\n            enableProgressBar()\n\n        for filename in wrapWithProgressBar(\n            filenames, stage=\"Auto format\", unit=\"files\"\n        ):\n            if autoFormatFile(\n                filename,\n                git_stage=False,\n                check_only=options.check_only,\n                limit_yaml=options.yaml,\n                limit_c=options.c,\n                limit_python=options.python,\n                limit_rst=options.rst,\n                limit_md=options.md,\n            ):\n                result += 1\n\n        # Tool is named without separator, spellchecker: ignore autoformat\n\n        if options.check_only and result > 0:\n            tools_logger.sysexit(\n                \"\"\"Error, 'bin/autoformat-nuitka-source' would make changes to %d files, \\\nmake sure to have commit hook installed or run it manually.\"\"\"\n                % result\n            )\n        elif result > 0:\n            tools_logger.info(\"autoformat: Changes to formatting of %d files\" % result)\n        else:\n            tools_logger.info(\"autoformat: No files needed formatting changes.\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/codespell/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/codespell/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for codespell checker tool.\n\n\"\"\"\n\nimport os\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.quality.auto_format.AutoFormat import cleanupWindowsNewlines\nfrom nuitka.tools.quality.ScanSources import scanTargets\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.Execution import callProcess, check_output, getExecutablePath\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getFileContents,\n    putTextFileContents,\n    resolveShellPatternToFilenames,\n)\n\nreplacements = [\n    (\"organizational\", \"organisational\"),\n    (\"developer manual\", \"Developer Manual\"),\n    (\"user manual\", \"User Manual\"),\n]\n\n\ndef runCodespell(filenames, verbose, write):\n    if verbose:\n        my_print(\"Consider\", \" \".join(filenames))\n\n    if os.name == \"nt\":\n        extra_path = os.path.join(sys.prefix, \"Scripts\")\n    else:\n        extra_path = None\n\n    codespell_binary = getExecutablePath(\"codespell\", extra_dir=extra_path)\n\n    codespell_version = check_output([codespell_binary, \"--version\"])\n\n    if str is not bytes:\n        codespell_version = codespell_version.decode(\"utf8\").strip()\n\n    my_print(\"Using codespell version:\", codespell_version)\n\n    command = [\n        codespell_binary,\n        \"-f\",\n        \"-I\",\n        os.path.join(\n            os.path.dirname(__file__),\n            \"..\",\n            \"..\",\n            \"..\",\n            \"..\",\n            \"misc/codespell-ignore.txt\",\n        ),\n    ]\n\n    if write:\n        command.append(\"-w\")\n    command += filenames\n\n    result = callProcess(command, logger=tools_logger if verbose else None)\n\n    if result == 0:\n        for filename in filenames:\n            if areSamePaths(__file__, filename):\n                continue\n\n            contents = getFileContents(filename)\n            old_contents = contents\n\n            for word, replacement in replacements:\n                contents = contents.replace(word, replacement)\n                contents = contents.replace(word.title(), replacement.title())\n\n            if old_contents != contents:\n                putTextFileContents(filename, contents)\n                cleanupWindowsNewlines(filename, filename)\n\n    return result == 0\n\n\ndef main():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--verbose\",\n        action=\"store_true\",\n        dest=\"verbose\",\n        default=False,\n        help=\"\"\"Show what it is doing. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--write\",\n        \"-w\",\n        action=\"store_true\",\n        dest=\"write\",\n        default=False,\n        help=\"\"\"Write changes to the files. Default is %default.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if not positional_args:\n        positional_args = [\n            \"bin\",\n            \"nuitka\",\n            \"rpm\",\n            \"misc\",\n            \"tests/*/run_all.py\",\n            \"*.rst\",\n        ]\n        goHome()\n\n    my_print(\"Working on:\", positional_args)\n\n    positional_args = sum(\n        (\n            resolveShellPatternToFilenames(positional_arg)\n            for positional_arg in positional_args\n        ),\n        [],\n    )\n\n    filenames = list(\n        scanTargets(\n            positional_args,\n            suffixes=(\".py\", \".scons\", \".rst\", \".txt\", \".j2\", \".md\", \".c\", \".h\"),\n            ignore_list=(\"get-pip-2.6.py\",),\n        )\n    )\n    if not filenames:\n        sys.exit(\"No files found.\")\n\n    result = runCodespell(\n        filenames=filenames, verbose=options.verbose, write=options.write\n    )\n\n    if result:\n        my_print(\"OK.\")\n    else:\n        my_print(\"FAILED.\")\n        tools_logger.sysexit(\n            \"\\nError, please correct the spelling problems found or extend 'misc/codespell-ignore.txt' if applicable.\"\n        )\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/pylint/PyLint.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" PyLint handling for Nuitka.\n\nOur usage of PyLint also works around a few issues that PyLint\nhas.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.tools.testing.Common import hasModule, my_print\nfrom nuitka.utils.Execution import check_output, executeProcess, getNullOutput\n\n_pylint_version = None\n\n\ndef checkVersion():\n    # pylint: disable=global-statement\n    global _pylint_version\n\n    if not hasModule(\"pylint\"):\n        sys.exit(\n            \"Error, pylint is not installed for this interpreter '%s' version.\"\n            % os.environ[\"PYTHON\"]\n        )\n\n    if _pylint_version is None:\n        _pylint_version = check_output(\n            [os.environ[\"PYTHON\"], \"-m\", \"pylint\", \"--version\"], stderr=getNullOutput()\n        )\n\n        if str is not bytes:\n            _pylint_version = _pylint_version.decode(\"utf8\")\n\n        _pylint_version = _pylint_version.split(\"\\n\")[0].split()[-1].strip(\",\")\n\n    my_print(\"Using PyLint version:\", _pylint_version)\n\n    return tuple(int(d) for d in _pylint_version.split(\".\"))\n\n\n# Disabled globally:\n#\n# no-init: Class has no __init__ method\n# Who cares, we are using overrides that don't need to change object init a lot\n# and rarely ever made a mistake with forgetting to call used __init__ of the\n# parent.\n#\n# I0011: Locally disabling W....\n# Strange one anyway, we want to locally disable stuff. And that just makes it\n# a different warning. Amazing. Luckily we can decide to ignore that globally\n# then.\n#\n# I0012: Locally enabling W....\n# Sure, we disabled it for a block, and re-enabled it then.\n#\n# bad-whitespace: No space allowed...\n# Our spaces before keyword argument calls are not allowed, and this is\n# not possible to distinguish.\n#\n# bad-continuation: Wrong hanging line indentation\n# No it's not wrong.\n#\n# E1120 / E1123: ....\n# Constructor call checks frequently fail miserably, so this is full of\n# mysterious false alarms, while it's unlikely to help much.\n#\n# E1103: Instance of 'x' has no 'y' member but some types could not be inferred\n# Rarely is this any help, but it's full of false alarms.\n#\n# W0632: Possible unbalanced tuple unpacking with sequence defined at ...\n# It's not really good at guessing these things.\n#\n# W1504: Using type() instead of isinstance() for typechecking.\n# Nuitka is all about exact type checks, so this doesn't apply\n#\n# C0123: Using type() instead of isinstance() for typechecking.\n# Nuitka is all about exact type checks, so this doesn't apply\n#\n# C0413: Import \"...\" should be placed at the top of the module\n# There is no harm to this and imports are deal with by isort binary.\n#\n# C0411: external import \"external\" comes before \"local\"\n# There is no harm to this and imports are deal with by \"isort\" binary.\n#\n# R0204: Redefinition of var type from x to y\n# We do this all the time, e.g. to convert \"str\" to \"unicode\", or \"list\" to \"str\".\n#\n# R1705: Unnecessary \"else\" after \"return\"\n# Frequently we use multiple branches where each returns.\n#\n# inconsistent-return-statements\n# This makes no sense, having to have a variable for return is bad in my mind.\n#\n# c-extension-no-member\n# Not too useful for us.\n#\n# useless-object-inheritance\n# The code is for Python2 still, where it makes a difference, if you do\n# not specify a base class, object is not the default there, but old style\n# classes are, which perform different/worse.\n#\n# useless-return\n# We like explicit None returns where the return value can be overloaded\n# to something else, or the function is used along others that do return\n# other things.\n#\n# ungrouped-imports\n# We let isort do its thing most of the time, and where not, it's good\n# enough for us to handle it manually.\n#\n# assignment-from-no-return\n# assignment-from-none\n# Overloaded functions are not detected, default value returns are all\n# warned about, not worth it.\n#\n# raise-missing-from\n# cannot do that, as long as we are backwards compatible\n\n# import-outside-toplevel\n# We do this deliberately, to avoid importing modules we do not use in\n# all cases, e.g. Windows/macOS specific stuff.\n\n# consider-using-f-string\n# We need to be backward compatible for Python versions that do not have\n# it.\n\n# super-with-arguments\n# Keeping code portable to Python2 is still good.\n\n# consider-using-dict-comprehension\n# Keeping code portable to Python2 is still good.\n\n# unnecessary-lambda-assignment\n# For deciders, we do this and like it.\n\n# unnecessary-dunder-call\n# We do make those intentionally only.\n\n# arguments-differ\n# We override static methods with non-static all the time.\n\n\ndef getOptions():\n    pylint_version = checkVersion()\n\n    # spell-checker: ignore setrecursionlimit,rcfile\n\n    default_pylint_options = \"\"\"\\\n--init-hook=import sys;sys.setrecursionlimit(1024*sys.getrecursionlimit())\n--disable=I0011,E1103,W0632,\\\nC0123,C0411,C0413,cyclic-import,duplicate-code,\\\ndeprecated-module,deprecated-method,deprecated-argument,assignment-from-none,\\\nungrouped-imports,no-else-return,c-extension-no-member,\\\ninconsistent-return-statements,raise-missing-from,import-outside-toplevel,\\\nuseless-object-inheritance,useless-return,assignment-from-no-return,\\\nredundant-u-string-prefix,consider-using-f-string,consider-using-dict-comprehension,\n--enable=useless-suppression\n--msg-template=\"{path}:{line} {msg_id} {symbol} {obj} {msg}\"\n--reports=no\n--persistent=no\n--method-rgx=[a-z_][a-zA-Z0-9_]{2,55}$\n--module-rgx=.*\n--function-rgx=.*\n--variable-rgx=.*\n--argument-rgx=.*\n--dummy-variables-rgx=_.*|trace_collection\n--ignored-argument-names=_.*|trace_collection\n--const-rgx=.*\n--max-line-length=125\n--no-docstring-rgx=.*\n--max-module-lines=6000\n--min-public-methods=0\n--max-public-methods=100\n--max-args=11\n--max-parents=14\n--max-statements=50\n--max-nested-blocks=10\n--max-bool-expr=10\n--score=no\\\n\"\"\".split(\n        \"\\n\"\n    )\n\n    if os.name != \"nt\":\n        default_pylint_options.append(\"--rcfile=%s\" % os.devnull)\n\n    if pylint_version < (2, 17):\n        default_pylint_options.append(\"--disable=bad-whitespace\")\n        default_pylint_options.append(\"--disable=bad-continuation\")\n        default_pylint_options.append(\"--disable=no-init\")\n        default_pylint_options.append(\"--disable=similar-code\")\n        default_pylint_options.append(\"--disable=I0012\")\n        default_pylint_options.append(\"--disable=W1504\")\n        default_pylint_options.append(\"--disable=R0204\")\n    else:\n        default_pylint_options.append(\"--load-plugins=pylint.extensions.no_self_use\")\n        default_pylint_options.append(\"--disable=unnecessary-lambda-assignment\")\n        default_pylint_options.append(\"--disable=unnecessary-dunder-call\")\n        default_pylint_options.append(\"--disable=arguments-differ\")\n        default_pylint_options.append(\"--disable=redefined-slots-in-subclass\")\n\n    return default_pylint_options\n\n\nour_exit_code = 0\n\n\ndef _cleanupPylintOutput(output):\n    if str is not bytes:\n        output = output.decode(\"utf8\")\n\n    # Normalize from Windows newlines potentially\n    output = output.replace(\"\\r\\n\", \"\\n\")\n\n    lines = [\n        line\n        for line in output.split(\"\\n\")\n        if line\n        if \"Using config file\" not in line\n        if \"Unable to import 'resource'\" not in line\n        if \"Bad option value 'self-assigning-variable'\" not in line\n    ]\n\n    try:\n        error_line = lines.index(\"No config file found, using default configuration\")\n        del lines[error_line]\n\n        if error_line < len(lines):\n            del lines[error_line]\n    except ValueError:\n        pass\n\n    return lines\n\n\ndef _executePylint(filenames, pylint_options, extra_options):\n    # This is kind of a singleton module, pylint: disable=global-statement\n    global our_exit_code\n\n    command = (\n        [os.environ[\"PYTHON\"], \"-m\", \"pylint\"]\n        + pylint_options\n        + extra_options\n        + filenames\n    )\n\n    stdout, stderr, exit_code = executeProcess(command)\n\n    if exit_code == -11:\n        sys.exit(\"Error, segfault from pylint.\")\n\n    stdout = _cleanupPylintOutput(stdout)\n    stderr = _cleanupPylintOutput(stderr)\n\n    if stderr:\n        our_exit_code = 1\n\n        for line in stderr:\n            my_print(line)\n\n    if stdout:\n        # If we filtered everything away, remove the leading file name reports.\n        while stdout and stdout[-1].startswith(\"******\"):\n            del stdout[-1]\n\n        for line in stdout:\n            my_print(line)\n\n        if stdout:\n            our_exit_code = 1\n\n    sys.stdout.flush()\n\n\ndef hasPyLintBugTrigger(filename):\n    \"\"\"Decide if a filename should be skipped.\"\"\"\n    # Currently everything is good, but it's a useful hook, pylint_: disable=unused-argument\n    if filename == \"nuitka/distutils/Build.py\":\n        return True\n\n    return False\n\n\ndef isSpecificPythonOnly(filename):\n    \"\"\"Decide if something is not used for this specific Python.\"\"\"\n\n    # Currently everything is portable, but it's a useful hook, pylint: disable=unused-argument\n    return False\n\n\ndef executePyLint(filenames, show_todo, verbose, one_by_one):\n    filenames = list(filenames)\n\n    if verbose:\n        my_print(\"Checking\", filenames, \"...\")\n\n    pylint_options = getOptions()\n    if not show_todo:\n        pylint_options.append(\"--notes=\")\n\n    filenames = [\n        filename\n        for filename in filenames\n        if not hasPyLintBugTrigger(filename)\n        if not isSpecificPythonOnly(filename)\n    ]\n\n    extra_options = os.getenv(\"PYLINT_EXTRA_OPTIONS\", \"\").split()\n    if \"\" in extra_options:\n        extra_options.remove(\"\")\n\n    if one_by_one:\n        for filename in filenames:\n            my_print(\"Checking\", filename, \":\")\n            _executePylint([filename], pylint_options, extra_options)\n    else:\n        _executePylint(filenames, pylint_options, extra_options)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/pylint/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/pylint/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for PyLint checker tool.\n\nspell-checker: ignore unpushed\n\"\"\"\n\nfrom optparse import OptionParser\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.tools.Basics import addPYTHONPATH, getHomePath, goHome, setupPATH\nfrom nuitka.tools.quality.Git import getModifiedPaths, getUnPushedPaths\nfrom nuitka.tools.quality.pylint import PyLint\nfrom nuitka.tools.quality.ScanSources import isPythonFile, scanTargets\nfrom nuitka.tools.testing.Common import hasModule, setup\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.FileOperations import resolveShellPatternToFilenames\n\n\ndef isIgnoredFile(filename):\n    if filename.startswith(\"Mini\"):\n        return True\n    if filename.startswith(\"examples/\"):\n        return True\n    if filename.startswith(\"tests/\") and not filename.endswith(\"/run_all.py\"):\n        return True\n    if \"inline_copy\" in filename:\n        return True\n\n    return False\n\n\ndef main():\n    setup(go_main=False)\n\n    # So PyLint finds nuitka package.\n    addPYTHONPATH(getHomePath())\n    setupPATH()\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--diff\",\n        action=\"store_true\",\n        dest=\"diff\",\n        default=False,\n        help=\"\"\"\\\nAnalyze the changed files in git checkout. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--unpushed\",\n        action=\"store_true\",\n        dest=\"unpushed\",\n        default=False,\n        help=\"\"\"\\\nAnalyze the changed files in git not yet pushed. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--show-todo\",\n        \"--todo\",\n        action=\"store_true\",\n        dest=\"todo\",\n        default=False,\n        help=\"\"\"\\\nShow TODO items. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--verbose\",\n        action=\"store_true\",\n        dest=\"verbose\",\n        default=False,\n        help=\"\"\"\\\nBe verbose in output. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--one-by-one\",\n        action=\"store_true\",\n        dest=\"one_by_one\",\n        default=False,\n        help=\"\"\"\\\nCheck files one by one. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--not-installed-is-no-error\",\n        action=\"store_true\",\n        dest=\"not_installed_is_no_error\",\n        default=False,\n        help=\"\"\"\\\nInsist on PyLint to be installed. Default is %default.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if options.not_installed_is_no_error and not hasModule(\"pylint\"):\n        tools_logger.warning(\n            \"PyLint is not installed for this interpreter version: SKIPPED\",\n            style=\"yellow\",\n        )\n        tools_logger.sysexit(exit_code=0)\n\n    if positional_args:\n        if options.diff or options.unpushed:\n            tools_logger.sysexit(\n                \"Error, no filenames argument allowed in git diff mode.\"\n            )\n\n    else:\n        goHome()\n\n        if options.diff:\n            positional_args = [\n                filename\n                for filename in getModifiedPaths()\n                if isPythonFile(filename)\n                if not isIgnoredFile(filename)\n            ]\n        elif options.unpushed:\n            positional_args = [\n                filename\n                for filename in getUnPushedPaths()\n                if isPythonFile(filename)\n                if not isIgnoredFile(filename)\n            ]\n\n        if not positional_args:\n            positional_args = [\"bin\", \"nuitka\", \"setup.py\", \"tests/*/run_all.py\"]\n\n    positional_args = sum(\n        (\n            resolveShellPatternToFilenames(positional_arg)\n            for positional_arg in positional_args\n        ),\n        [],\n    )\n\n    if not positional_args:\n        tools_logger.sysexit(\"No files found.\")\n\n    my_print(\"Working on: %s\" % \" \".join(positional_args))\n\n    ignore_list = []\n\n    # Avoid checking the Python2 runner along with the one for Python3, it has name collisions.\n    if python_version >= 0x300:\n        ignore_list.append(\"nuitka\")\n\n    filenames = list(\n        scanTargets(\n            positional_args, suffixes=(\".py\", \".scons\"), ignore_list=ignore_list\n        )\n    )\n    PyLint.executePyLint(\n        filenames=filenames,\n        show_todo=options.todo,\n        verbose=options.verbose,\n        one_by_one=options.one_by_one,\n    )\n\n    if not filenames:\n        tools_logger.sysexit(\"No matching files found.\")\n\n    tools_logger.sysexit(exit_code=PyLint.our_exit_code)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/restlint/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/restlint/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for restlint checker tool.\n\n\"\"\"\n\nimport sys\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.release.Documentation import (\n    checkReleaseDocumentation,\n    checkRstLint,\n)\n\n\ndef main():\n    if len(sys.argv) < 2:\n        goHome()\n        checkReleaseDocumentation()\n    else:\n        for document in sys.argv[1:]:\n            checkRstLint(document)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/yamllint/YamlChecker.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Check and update Yaml checksum if possible.\"\"\"\n\nimport ast\nfrom posixpath import normpath\n\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    openTextFile,\n    putTextFileContents,\n)\nfrom nuitka.utils.Yaml import (\n    PackageConfigYaml,\n    getYamlDataHash,\n    getYamlPackage,\n    getYamlPackageConfigurationSchemaFilename,\n    parsePackageYaml,\n)\n\n\ndef checkSchema(logger, document):\n    import json  # pylint: disable=I0021,import-error\n\n    from jsonschema import validators  # pylint: disable=I0021,import-error\n    from jsonschema.exceptions import ValidationError\n\n    yaml = getYamlPackage()\n\n    with openTextFile(getYamlPackageConfigurationSchemaFilename(), \"r\") as schema_file:\n        with openTextFile(document, \"r\") as yaml_file:\n            yaml_data = yaml.load(yaml_file, yaml.BaseLoader)\n\n            try:\n                validators.Draft202012Validator(\n                    schema=json.loads(schema_file.read())\n                ).validate(instance=yaml_data)\n            except ValidationError as e:\n                try:\n                    module_name = repr(yaml_data[e.path[0]][\"module-name\"])\n                except Exception:  # pylint: disable=broad-except\n                    module_name = \"unknown\"\n\n                logger.sysexit(\n                    \"Error, please fix the schema error in yaml file '%s' for %s module:\\n%s\"\n                    % (document, module_name, e.message)\n                )\n            else:\n                logger.info(\"OK, schema validated.\", style=\"blue\")\n\n\ndef _isParsable(value):\n    try:\n        ast.parse(value)\n    except (SyntaxError, IndentationError):\n        return False\n    else:\n        return True\n\n\ndef _checkValues(logger, filename, module_name, section, value):\n    # many checks of course, pylint: disable=too-many-branches\n\n    result = True\n\n    if type(value) is dict:\n        for k, v in value.items():\n            if k == \"description\" and v != v.strip():\n                logger.info(\n                    \"\"\"\\\n%s: %s config value of %s %s should not contain trailing or leading spaces\"\"\"\n                    % (filename, module_name, section, k)\n                )\n                result = False\n\n            if k in (\"when\", \"append_result\"):\n                if not _isParsable(v):\n                    logger.info(\n                        \"\"\"\\\n%s: %s config value of '%s' '%s' contains invalid syntax in value '%s'\"\"\"\n                        % (filename, module_name, section, k, v),\n                        keep_format=True,\n                    )\n                    result = False\n\n            if k in (\"dest_path\", \"relative_path\") and v != normpath(v):\n                logger.info(\n                    \"%s: %s config value of %s %s should be normalized posix path, with '/' style slashes.\"\n                    % (filename, module_name, section, k)\n                )\n                result = False\n\n            if k == \"no-auto-follow\":\n                for m, d in v.items():\n                    if d == \"\":\n                        logger.info(\n                            \"\"\"\\\n%s: %s config value of %s %s should not use empty value for %s, use 'ignore' \\\nif you want no message.\"\"\"\n                            % (filename, module_name, section, k, m)\n                        )\n                        result = False\n\n            if k == \"declarations\":\n                for m, d in v.items():\n                    if m == \"\":\n                        logger.info(\n                            \"\"\"\\\n%s: %s config value of %s %s should not use empty value for declaration name.\"\"\"\n                            % (filename, module_name, section, k)\n                        )\n                        result = False\n\n                    if d == \"\":\n                        logger.info(\n                            \"\"\"\\\n%s: %s config value of %s %s should not use empty value for declaration name.\"\"\"\n                            % (filename, module_name, section, k)\n                        )\n                        result = False\n                    elif not _isParsable(d):\n                        logger.info(\n                            \"\"\"\\\n%s: %s config value of '%s' '%s' contains invalid syntax in value '%s'\"\"\"\n                            % (filename, module_name, section, k, v),\n                            keep_format=True,\n                        )\n                        result = False\n\n            if not _checkValues(logger, filename, module_name, section, v):\n                result = False\n    elif type(value) in (list, tuple):\n        for item in value:\n            if not _checkValues(logger, filename, module_name, section, item):\n                result = False\n\n    return result\n\n\ndef checkValues(logger, filename):\n    yaml = PackageConfigYaml(\n        name=filename,\n        file_data=getFileContents(filename, mode=\"rb\"),\n    )\n\n    result = True\n    for module_name, config in yaml.items():\n        for section, section_config in config.items():\n            if not _checkValues(logger, filename, module_name, section, section_config):\n                result = False\n\n    if result:\n        logger.info(\"OK, manual value tests passed.\", style=\"blue\")\n    else:\n        logger.sysexit(\"Error, manual value checks are not clean.\")\n\n\ndef checkYamllint(logger, document):\n    import yamllint.cli  # pylint: disable=I0021,import-error\n\n    try:\n        yamllint.cli.run([\"--strict\", document])\n    except SystemExit as e:\n        lint_result = e.code\n\n        if lint_result != 0:\n            logger.sysexit(\"Error, not lint clean yaml.\")\n    else:\n        logger.sysexit(\"Error, yamllint didn't raise expected SystemExit exception.\")\n\n    logger.info(\"OK, yamllint passed.\", style=\"blue\")\n\n\ndef checkOrUpdateChecksum(filename, update, logger):\n    yaml_file_text = getFileContents(filename, encoding=\"utf8\")\n\n    yaml_data = parsePackageYaml(package_name=None, filename=filename)\n\n    lines = []\n\n    for line in yaml_file_text.splitlines():\n        if line.startswith(\"- module-name:\"):\n            parts = line.split(\"'\", 2)\n            module_name = parts[1]\n\n            checksum = getYamlDataHash(yaml_data.data.get(module_name))\n\n            line = \"- module-name: '%s' # checksum: %s\" % (module_name, checksum)\n\n        lines.append(line)\n\n    if update:\n        putTextFileContents(filename, lines, encoding=\"utf8\")\n        logger.info(\"OK, checksums updated.\", style=\"blue\")\n\n\ndef checkYamlSchema(logger, filename, effective_filename, update):\n    logger.info(\"Checking '%s' for proper contents:\" % effective_filename, style=\"blue\")\n\n    checkSchema(logger, filename)\n    checkValues(logger, filename)\n    checkOrUpdateChecksum(filename=filename, update=update, logger=logger)\n    checkYamllint(logger, filename)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/yamllint/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/quality/yamllint/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main program for yamllint checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(\n    0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\"))\n)\n\n# isort:start\n\nfrom optparse import OptionParser\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.quality.ScanSources import scanTargets\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.FileOperations import resolveShellPatternToFilenames\n\nfrom .YamlChecker import checkYamlSchema\n\n\ndef main():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--update-checksum\",\n        dest=\"update_checksum\",\n        action=\"store_true\",\n        default=False,\n        help=\"\"\"\\\nUpdate the version checksum after checking, so Nuitka knowns it can be trusted.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if not positional_args:\n        positional_args = [\n            \"nuitka/plugins/standard/*.yml\",\n            \"nuitka/plugins/commercial/*.yml\",\n        ]\n\n    my_print(\"Working on:\", positional_args)\n\n    positional_args = sum(\n        (\n            resolveShellPatternToFilenames(positional_arg)\n            for positional_arg in positional_args\n        ),\n        [],\n    )\n\n    goHome()\n\n    filenames = list(\n        scanTargets(\n            positional_args,\n            suffixes=(\".yaml\",),\n        )\n    )\n    if not filenames:\n        tools_logger.sysexit(\"No files found.\")\n\n    for filename in filenames:\n        checkYamlSchema(\n            filename=filename,\n            effective_filename=filename,\n            update=options.update_checksum,\n            logger=tools_logger,\n        )\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/Debian.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Release tools related to Debian packaging.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.utils.Execution import check_call, getNullInput\nfrom nuitka.utils.FileOperations import (\n    copyFile,\n    getFileContentByLine,\n    getFileContents,\n    listDir,\n    openTextFile,\n)\n\n\ndef _callDebchange(*args):\n    # spell-checker: ignore debchange\n    args = [\"debchange\"] + list(args)\n\n    os.environ[\"EDITOR\"] = \"\"\n\n    check_call(args, stdin=getNullInput())\n\n\n_discarded_last_entry = False\n\n\ndef _discardDebianChangelogLastEntry():\n    # Kind of weak, but we do not keep track if we do a lot of things,\n    # for every program run this is only done once to simplify code,\n    # but it's not reusable therefore.\n    # pylint: disable=global-statement\n    global _discarded_last_entry\n\n    if _discarded_last_entry:\n        return\n    changelog_lines = getFileContents(\"debian/changelog\").splitlines()\n\n    with openTextFile(\"debian/changelog\", \"w\") as output:\n        first = True\n        for line in changelog_lines[1:]:\n            if line.startswith(\"nuitka\") and first:\n                first = False\n\n            if not first:\n                output.write(line + \"\\n\")\n\n    _discarded_last_entry = True\n\n\ndef updateDebianChangelog(old_version, new_version, distribution):\n    debian_version = new_version.replace(\"rc\", \"~rc\") + \"+ds-1\"\n\n    if old_version == new_version:\n        _discardDebianChangelogLastEntry()\n\n    os.environ[\"DEBEMAIL\"] = \"Kay Hayen <kay.hayen@gmail.com>\"\n\n    if \"rc\" in new_version:\n        if \"rc\" in old_version:\n            # Initial final release after pre-releases.\n            _discardDebianChangelogLastEntry()\n\n        message = \"New upstream pre-release.\"\n    else:\n        if \"rc\" in old_version:\n            # Initial final release after pre-releases.\n            _discardDebianChangelogLastEntry()\n\n            message = \"New upstream release.\"\n        else:\n            # Initial final release after pre-releases.\n\n            # Hotfix release after previous final or hotfix release.\n            message = \"New upstream hotfix release.\"\n\n    _callDebchange(\"--newversion=%s\" % debian_version, message)\n    _callDebchange(\"-r\", \"--distribution\", distribution, \"\")\n\n\ndef checkChangeLog(message):\n    \"\"\"Check debian changelog for given message to be present.\"\"\"\n\n    for line in getFileContentByLine(\"debian/changelog\"):\n        if line.startswith(\" --\"):\n            return False\n\n        if message in line:\n            return True\n\n    sys.exit(\"Error, didn't find in debian/changelog: '%s'\" % message)\n\n\ndef shallNotIncludeInlineCopy(codename):\n    # Keep inline copy for old variants that cannot otherwise work\n    return codename not in (\"stretch\", \"jessie\", \"xenial\")\n\n\ndef cleanupTarfileForDebian(codename, filename, new_name):\n    \"\"\"Remove files that shouldn't be in Debian.\n\n    The inline copies should definitely not be there. Also remove the\n    PDF files.\n    \"\"\"\n\n    copyFile(filename, new_name)\n    check_call([\"gunzip\", new_name])\n\n    if shallNotIncludeInlineCopy(codename):\n        command = [\n            \"tar\",\n            \"--wildcards\",\n            \"--delete\",\n            \"--file\",\n            new_name[:-3],\n            \"Nuitka*/build/inline_copy\",\n        ]\n\n        check_call(command)\n\n    check_call([\"gzip\", \"-9\", \"-n\", new_name[:-3]])\n\n\ndef runPy2dsc(filename, new_name):\n    check_call([\"py2dsc\", new_name])\n\n    # Fixup for py2dsc not taking our custom suffix into account, so we need\n    # to rename it ourselves.\n    before_deb_name = filename[:-7].lower().replace(\"-\", \"_\")\n    after_deb_name = before_deb_name.replace(\"rc\", \"~rc\")\n\n    os.rename(\n        \"deb_dist/%s.orig.tar.gz\" % before_deb_name,\n        \"deb_dist/%s+ds.orig.tar.gz\" % after_deb_name,\n    )\n\n    check_call([\"rm -f deb_dist/*_source*\"], shell=True)\n\n    # Remove the now useless input, py2dsc has copied it, and we don't\n    # publish it.\n    os.unlink(new_name)\n\n    # Assert that the unpacked directory is there and find it. Otherwise fail badly.\n\n    entry = None\n    for fullname, entry in listDir(\"deb_dist\"):\n        if (\n            os.path.isdir(fullname)\n            and entry.startswith(\"nuitka\")\n            and not entry.endswith(\".orig\")\n        ):\n            break\n\n    if entry is None:\n        assert False\n\n    # Import the \"debian\" directory from above. It's not in the original tar and\n    # overrides fully what py2dsc did.\n    check_call([\"rm -r deb_dist/%s/debian/*\" % entry], shell=True)\n\n    check_call(\n        [\n            \"rsync\",\n            \"-a\",\n            \"--exclude\",\n            \"pbuilder-hookdir\",\n            \"../debian/\",\n            \"deb_dist/%s/debian/\" % entry,\n        ]\n    )\n\n    check_call([\"rm deb_dist/*.dsc deb_dist/*.debian.tar.xz\"], shell=True)\n\n    return entry\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/Documentation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Generation of Nuitka documentation.\n\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import check_call\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    getFileList,\n    openTextFile,\n    putTextFileContents,\n)\n\n\ndef _optimizePNGs(pngList):\n    for png in pngList:\n        check_call([\"optipng\", \"-o2\", \"%s.png\" % png])\n\n\ndef makeLogoImages():\n    basePathLogo = \"doc/Logo/Nuitka-Logo-%s\"\n\n    for logo in (\"Vertical\", \"Symbol\", \"Horizontal\"):\n        cmd = \"convert -background none %s.svg %s.png\" % (basePathLogo, basePathLogo)\n        check_call((cmd % (logo, logo)).split())\n\n    _optimizePNGs(\n        [basePathLogo % item for item in (\"Vertical\", \"Symbol\", \"Horizontal\")]\n    )\n\n    if os.path.exists(\"../Nuitka-website\"):\n        cmd = \"convert -resize %s doc/Logo/Nuitka-Logo-Symbol.svg %s\"\n        for icon, size in {\n            \"../Nuitka-website/files/favicon.ico\": \"32x32\",\n            \"../Nuitka-website/files/favicon.png\": \"32x32\",\n            \"../Nuitka-website/doc/_static/favicon.ico\": \"32x32\",\n            \"../Nuitka-website/doc/_static/favicon.png\": \"32x32\",\n            \"../Nuitka-website/doc/_static/apple-touch-icon-ipad.png\": \"72x72\",\n            \"../Nuitka-website/doc/_static/apple-touch-icon-ipad3.png\": \"144x144\",\n            \"../Nuitka-website/doc/_static/apple-touch-icon-iphone.png\": \"57x57\",\n            \"../Nuitka-website/doc/_static/apple-touch-icon-iphone4.png\": \"114x114\",\n            \"../Nuitka-website/doc/_static/apple-touch-icon-180x180.png\": \"180x180\",\n        }.items():\n            check_call((cmd % (icon, size)).split())\n\n\nextra_rst_keywords = (\n    b\"asciinema\",\n    b\"postlist\",\n    b\"post\",\n    b\"youtube\",\n    b\"grid\",\n    b\"toctree\",\n    b\"automodule\",\n    b\"dropdown\",\n    b\"rst-class\",\n)\n\n\ndef checkRstLint(document):\n    contents = getFileContents(document, mode=\"rb\")\n\n    for keyword in extra_rst_keywords:\n        contents = contents.replace(b\".. %s::\" % keyword, b\".. raw:: %s\" % keyword)\n\n    import restructuredtext_lint  # pylint: disable=I0021,import-error\n\n    my_print(\"Checking '%s' for proper restructured text ...\" % document, style=\"blue\")\n    lint_results = restructuredtext_lint.lint(\n        contents.decode(\"utf8\"),\n        document,\n    )\n\n    lint_error = False\n    for lint_result in lint_results:\n        # Not an issue.\n        if lint_result.message.startswith(\"Duplicate implicit target name:\"):\n            continue\n\n        # We switched to raw, but attributes will still bne unknown.\n        if lint_result.message.startswith(\n            'Error in \"raw\" directive:\\nunknown option: \"hidden\"'\n        ):\n            continue\n        if lint_result.message.startswith(\n            'Error in \"raw\" directive:\\nunknown option: \"excerpts\"'\n        ):\n            continue\n        if lint_result.message.startswith(\n            'Error in \"raw\" directive:\\nunknown option: \"members\"'\n        ):\n            continue\n\n        my_print(lint_result, style=\"yellow\")\n        lint_error = True\n\n    if lint_error:\n        sys.exit(\"Error, no lint clean rest.\")\n\n    my_print(\"OK.\", style=\"blue\")\n\n\ndef updateManPages():\n    if not os.path.exists(\"man\"):\n        os.mkdir(\"man\")\n\n    cmd = [\n        \"help2man\",\n        \"-n\",\n        \"the Python compiler\",\n        \"--no-discard-stderr\",\n        \"--no-info\",\n        \"--include\",\n        \"doc/nuitka-man-include.txt\",\n        \"%s ./bin/nuitka\" % sys.executable,\n    ]\n\n    with openTextFile(\"doc/nuitka.1\", \"wb\") as output:\n        check_call(cmd, stdout=output)\n\n    cmd[-1] += \"-run\"\n    with openTextFile(\"doc/nuitka-run.1\", \"wb\") as output:\n        check_call(cmd, stdout=output)\n\n    for manpage in (\"doc/nuitka.1\", \"doc/nuitka-run.1\"):\n        manpage_contents = getFileContents(manpage).splitlines()\n\n        for month in (\n            \"January\",\n            \"February\",\n            \"March\",\n            \"April\",\n            \"May\",\n            \"June\",\n            \"July\",\n            \"August\",\n            \"September\",\n            \"October\",\n            \"November\",\n            \"December\",\n        ):\n            manpage_contents[1] = manpage_contents[1].replace(month + \" \", \"\")\n        manpage_contents[1] = manpage_contents[1].replace(\"rc0\", \"\")\n\n        new_contents = []\n        mark = False\n\n        for count, line in enumerate(manpage_contents):\n            if line.startswith(\n                (\n                    \"Python:\",\n                    \"Commercial:\",\n                    \"Flavor:\",\n                    \"Executable:\",\n                    \"OS:\",\n                    \"Arch:\",\n                    \"Distribution:\",\n                    \"Version C compiler:\",\n                )\n            ):\n                continue\n\n            if mark:\n                line = \".SS \" + line + \".BR\\n\"\n                mark = False\n            elif line == \".IP\\n\" and manpage_contents[count + 1].endswith(\":\\n\"):\n                mark = True\n                continue\n\n            if line == r\"\\fB\\-\\-g\\fR++\\-only\" + \"\\n\":\n                line = r\"\\fB\\-\\-g\\++\\-only\\fR\" + \"\\n\"\n\n            new_contents.append(line)\n\n        putTextFileContents(manpage, contents=new_contents)\n\n\ndef checkReleaseDocumentation():\n    documents = [\n        entry\n        for entry in getFileList(\".\")\n        if entry.endswith(\".rst\") and not entry.startswith(\"web\" + os.path.sep)\n        if \"inline_copy\" not in entry\n    ]\n\n    for document in (\"README.rst\", \"Developer_Manual.rst\", \"Changelog.rst\"):\n        assert document in documents, documents\n\n    for document in documents:\n        checkRstLint(document)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/Release.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Release related common functionality.\n\n\"\"\"\n\nimport os\n\nfrom nuitka.tools.Basics import getHomePath\nfrom nuitka.utils.Execution import NuitkaCalledProcessError, check_output\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    getFileFirstLine,\n    withDirectoryChange,\n)\nfrom nuitka.Version import getNuitkaVersion\n\n\ndef checkAtHome(expected=\"Nuitka Staging\"):\n    assert os.path.isfile(\"setup.py\")\n\n    if os.path.isdir(\".git\"):\n        git_dir = \".git\"\n    else:\n        line = getFileFirstLine(\".git\", \"r\").strip()\n        git_dir = line[8:]\n\n    git_description_filename = os.path.join(git_dir, \"description\")\n    description = getFileContents(git_description_filename).strip()\n\n    assert description == expected, (expected, description)\n\n\ndef _getGitCommandOutput(command):\n    if type(command) is str:\n        command = command.split()\n\n    home_path = getHomePath()\n\n    with withDirectoryChange(home_path):\n        output = check_output(command).strip()\n\n    if str is not bytes:\n        output = output.decode()\n\n    return output\n\n\ndef getBranchName():\n    \"\"\"Get the git branch name currently running from.\"\"\"\n    # Using a fallback for old git, hopefully not necessary as much anymore.\n    try:\n        return _getGitCommandOutput(\"git branch --show-current\")\n    except NuitkaCalledProcessError:\n        return _getGitCommandOutput(\"git symbolic-ref --short HEAD\")\n\n\ndef getBranchRemoteName():\n    \"\"\"Get the git remote name of the branch currently running from.\"\"\"\n    return _getGitCommandOutput(\"git config branch.%s.remote\" % getBranchName())\n\n\ndef getBranchRemoteUrl():\n    \"\"\"Get the git remote url of the branch currently running from.\"\"\"\n    return _getGitCommandOutput(\"git config remote.%s.url\" % getBranchRemoteName())\n\n\ndef getBranchRemoteIdentifier():\n    \"\"\"Get the git remote identifier of the branch currently running from.\n\n    This identifier is used to classify git origins, they might be github,\n    private git, or unknown.\n    \"\"\"\n\n    branch_remote_url = getBranchRemoteUrl()\n\n    branch_remote_host = branch_remote_url.split(\":\", 1)[0].split(\"@\")[-1]\n\n    if branch_remote_host.endswith(\".home\"):\n        branch_remote_host = branch_remote_host.rsplit(\".\", 1)[0]\n\n    if branch_remote_host == \"mastermind\":\n        return \"private\"\n    elif branch_remote_host.endswith(\"nuitka.net\"):\n        return \"private\"\n    elif branch_remote_host == \"github\":\n        return \"public\"\n    else:\n        return \"unknown\"\n\n\ndef checkBranchName():\n    branch_name = getBranchName()\n\n    nuitka_version = getNuitkaVersion()\n\n    assert branch_name in (\n        \"main\",\n        \"develop\",\n        \"factory\",\n        \"release/\" + nuitka_version,\n        \"hotfix/\" + nuitka_version,\n    ), branch_name\n\n    return branch_name\n\n\ndef getBranchCategory(branch_name):\n    \"\"\"There are 3 categories of releases. Map branch name on them.\"\"\"\n\n    if (\n        branch_name.startswith(\"release\")\n        or branch_name == \"main\"\n        or branch_name.startswith(\"hotfix/\")\n    ):\n        category = \"stable\"\n    elif branch_name == \"factory\":\n        category = \"factory\"\n    elif branch_name == \"develop\":\n        category = \"develop\"\n    else:\n        assert False\n\n    return category\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/bump/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/bump/__main__.py",
    "content": "#!/usr/bin/python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Make version bump for Nuitka. \"\"\"\n\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.quality.auto_format.AutoFormat import (\n    withFileOpenedAndAutoFormatted,\n)\nfrom nuitka.tools.release.Debian import updateDebianChangelog\nfrom nuitka.tools.release.Release import getBranchName\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.FileOperations import getFileContents, openTextFile\n\n\ndef getBumpedVersion(mode, old_version):\n    if mode == \"prerelease\":\n        if \"rc\" in old_version:\n            parts = old_version.split(\"rc\")\n\n            new_version = \"rc\".join([parts[0], str(int(parts[1]) + 1)])\n        else:\n            old_version = \".\".join(old_version.split(\".\")[:3])\n            parts = old_version.split(\".\")\n            parts[-1] = str(int(parts[-1]) + 1)\n\n            new_version = \".\".join(parts) + \"rc1\"\n    elif mode == \"release\":\n        if \"rc\" in old_version:\n            old_version = old_version[: old_version.find(\"rc\")]\n            was_pre = True\n        else:\n            was_pre = False\n\n        new_version = \".\".join(old_version.split(\".\")[:3])\n\n        if not was_pre:\n            parts = new_version.split(\".\")\n            parts[-1] = str(int(parts[-1]) + 1)\n\n            new_version = \".\".join(parts)\n    elif mode == \"hotfix\":\n        assert \"pre\" not in old_version and \"rc\" not in old_version\n\n        parts = old_version.split(\".\")\n\n        if len(parts) == 2:\n            parts.append(\"1\")\n        else:\n            parts[-1] = str(int(parts[-1]) + 1)\n\n        new_version = \".\".join(parts)\n\n    else:\n        sys.exit(\"Error, unknown mode '%s'.\" % mode)\n\n    return new_version\n\n\ndef main():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--mode\",\n        action=\"store\",\n        dest=\"mode\",\n        default=None,\n        help=\"\"\"\\\nThe mode of version number update, \"prerelease\", \"hotfix\", \"release\",\n\"auto\" (default auto determined from branch name), and \"redate\" bumps\nthe changelog date only.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if positional_args:\n        parser.print_help()\n\n        sys.exit(\"\\nError, no positional argument allowed.\")\n\n    # Go its own directory, to have it easy with path knowledge.\n    goHome()\n\n    with openTextFile(\"nuitka/Version.py\", \"r\") as f:\n        option_lines = f.readlines()\n\n    (version_line,) = [line for line in option_lines if line.startswith(\"Nuitka V\")]\n\n    old_version = version_line[8:].rstrip()\n\n    mode = options.mode\n    branch_name = getBranchName()\n\n    if mode is None:\n        if branch_name.startswith(\"hotfix/\"):\n            mode = \"hotfix\"\n        elif branch_name == \"main\" or branch_name.startswith(\"release/\"):\n            mode = \"release\"\n        elif branch_name == \"develop\":\n            mode = \"prerelease\"\n        else:\n            sys.exit(\"Error, cannot detect mode from branch name '%s'.\" % branch_name)\n\n    if mode != \"redate\":\n        new_version = getBumpedVersion(mode, old_version)\n        my_print(\"Bumped %s '%s' -> '%s'.\" % (mode, old_version, new_version))\n\n        with openTextFile(\"nuitka/Version.py\", \"w\") as options_file:\n            for line in option_lines:\n                if line.startswith(\"Nuitka V\"):\n                    line = \"Nuitka V\" + new_version + \"\\n\"\n\n                options_file.write(line)\n\n        # Debian is currently in not freeze, change to \"experimental\" once that changes.\n        updateDebianChangelog(old_version, new_version, \"unstable\")\n    else:\n        # Debian is currently in not freeze, change to \"experimental\" once that changes.\n        updateDebianChangelog(old_version, old_version, \"unstable\")\n\n    if mode == \"release\":\n        with withFileOpenedAndAutoFormatted(\"Changelog.rst\") as changelog_file:\n            changelog_file.write(\n                getFileContents(\"Changelog.rst\").replace(\" (Draft)\", \"\")\n            )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/debian/__init__.py",
    "content": "\"\"\" Dummy file to make this directory a package. \"\"\"\n"
  },
  {
    "path": "nuitka/tools/release/debian/__main__.py",
    "content": "#!/usr/bin/env python\n\n\"\"\" Debian/Ubuntu package release.\n\n\"\"\"\n\nimport os\nimport shutil\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.release.Debian import (\n    checkChangeLog,\n    cleanupTarfileForDebian,\n    runPy2dsc,\n    shallNotIncludeInlineCopy,\n)\nfrom nuitka.tools.release.Release import checkBranchName, getBranchCategory\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.Execution import check_call, withEnvironmentVarOverridden\nfrom nuitka.utils.FileOperations import (\n    copyTree,\n    getFileList,\n    putTextFileContents,\n    resolveShellPatternToFilenames,\n    withDirectoryChange,\n)\nfrom nuitka.Version import getNuitkaVersion\n\n\ndef parseArgs():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--no-pbuilder-update\",\n        action=\"store_false\",\n        dest=\"update_pbuilder\",\n        default=True,\n        help=\"\"\"\\\nUpdate the pbuilder chroot before building. Default %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--check\",\n        action=\"store_true\",\n        dest=\"check\",\n        default=False,\n        help=\"\"\"\\\nCheck only, if the package builds, do not upload. Default %default.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    assert len(positional_args) == 1, positional_args\n    codename = positional_args[0]\n\n    return options, codename\n\n\ndef fixupPermissionsInplace(\n    dest_path,\n    file_perm,\n    dir_perm,\n    ignore_filenames=(),\n):\n    for filename in getFileList(dest_path, ignore_filenames=ignore_filenames):\n        os.chmod(filename, file_perm)\n        os.chmod(os.path.dirname(filename), dir_perm)\n\n\ndef fixupPermissionsCopy(source_path, dest_path, ignore_filenames=()):\n    copyTree(source_path=source_path, dest_path=dest_path)\n\n    fixupPermissionsInplace(\n        dest_path=dest_path,\n        file_perm=int(\"600\", 8),\n        dir_perm=int(\"700\", 8),\n        ignore_filenames=ignore_filenames,\n    )\n\n\ndef main():\n    # Complex stuff, pylint: disable=too-many-statements\n\n    # Make sure error messages are in English.\n    os.environ[\"LANG\"] = \"C\"\n\n    options, codename = parseArgs()\n\n    nuitka_version = getNuitkaVersion()\n\n    branch_name = checkBranchName()\n\n    category = getBranchCategory(branch_name)\n\n    if category == \"stable\":\n        if nuitka_version.count(\".\") == 1:\n            assert checkChangeLog(\"New upstream release.\")\n        else:\n            assert checkChangeLog(\"New upstream hotfix release.\")\n    else:\n        assert checkChangeLog(\"New upstream pre-release.\")\n\n    # Clean the stage for the debian package. The name \"deb_dist\" is what \"py2dsc\"\n    # uses for its output later on.\n    shutil.rmtree(\"dist\", ignore_errors=True)\n    shutil.rmtree(\"build\", ignore_errors=True)\n\n    tools_logger.info(\n        \"Copying src to temporary location before modifying it.\", style=\"blue\"\n    )\n    copyTree(\"/src\", \"/var/tmp/src\")\n    os.chdir(\"/var/tmp/src\")\n\n    fixupPermissionsInplace(\n        \"debian\", int(\"644\", 8), int(\"755\", 8), ignore_filenames=(\"rules\",)\n    )\n    fixupPermissionsInplace(\"nuitka\", int(\"644\", 8), int(\"755\", 8))\n\n    # Build the source distribution as per our setup, however that's not going\n    # to be good enough for Debian packages. We may want to avoid inline copies\n    # being added to sdist for the Debian that do not need it.\n    # spell-checker: ignore gztar\n    with withEnvironmentVarOverridden(\n        \"NUITKA_NO_INLINE_COPY\", \"1\" if shallNotIncludeInlineCopy(codename) else \"0\"\n    ):\n        tools_logger.info(\"Creating dist archive.\", style=\"blue\")\n        check_call([sys.executable, \"setup.py\", \"sdist\", \"--formats=gztar\"])\n\n        with withDirectoryChange(\"dist\"):\n            # Provide a re-packed tar.gz for the Debian package as input.\n\n            # Create it as a \"+ds\" file, removing:\n            # - the benchmarks (too many sources, not useful to end users, potential license\n            #   issues)\n            # - the inline copy of scons (not wanted for Debian)\n\n            for filename in os.listdir(\".\"):\n                if filename.endswith(\".tar.gz\"):\n                    new_name = filename[:-7] + \"+ds.tar.gz\"\n\n                    cleanupTarfileForDebian(\n                        codename=codename, filename=filename, new_name=new_name\n                    )\n\n                    tools_logger.info(\"Running py2dsc.\", style=\"blue\")\n\n                    entry = runPy2dsc(filename, new_name)\n\n                    break\n            else:\n                assert False\n\n        # Copy gnupg folder, to control the permissions.\n        fixupPermissionsCopy(source_path=\"/root/.gnupg\", dest_path=\"/root/.gnupg2\")\n        os.environ[\"GNUPGHOME\"] = \"/root/.gnupg2\"\n\n        # Copy ssh folder to control permissions.\n        fixupPermissionsCopy(source_path=\"/root/.ssh2\", dest_path=\"/root/.ssh\")\n\n        with withDirectoryChange(os.path.join(\"dist\", \"deb_dist\", entry)):\n            for filename in getFileList(\"debian\", ignore_filenames=(\"rules\",)):\n                os.chmod(filename, int(\"644\", 8))\n\n            # Build the debian package, but disable the running of tests, will be done later\n            # in the pbuilder test steps, pass inline copy setting on, and make sure that\n            # the signing works, gpg-agent otherwise refuses to start.\n            check_call(\n                [\n                    \"debuild\",\n                    \"--set-envvar=DEB_BUILD_OPTIONS=nocheck\",\n                    \"--set-envvar=NUITKA_NO_INLINE_COPY=%s\"\n                    % os.environ[\"NUITKA_NO_INLINE_COPY\"],\n                    \"--set-envvar=GNUPGHOME=%s\" % os.environ[\"GNUPGHOME\"],\n                ]\n            )\n\n    # Check with pylint in pedantic mode and don't proceed if there were any\n    # warnings given. Nuitka is lintian clean and shall remain that way. For\n    # hotfix releases, i.e. \"stable\" builds, we skip this test though.\n    if category == \"stable\":\n        my_print(\"Skipped lintian checks for stable releases.\", style=\"blue\")\n    else:\n        # TODO: Do the lintian checks inside the pbuilder, we do not build\n        # the package locally anymore, or with a builder that focusses on\n        # that with e.g. the develop branch as a target on a regular basis.\n        my_print(\"Skipped lintian checks for now.\", style=\"blue\")\n        # assert os.system(\"lintian --pedantic --allow-root dist/deb_dist/*.changes\") == 0\n\n    # Move the created debian package files out.\n    assert os.system(\"cp dist/deb_dist/*.deb dist/\") == 0\n\n    # Build inside the pbuilder chroot, and output to dedicated directory.\n    shutil.rmtree(\"package\", ignore_errors=True)\n    os.makedirs(\"package\")\n\n    # Now update the pbuilder, spell-checker: ignore basetgz\n\n    basetgz_filename = \"/pbuilder/%s.tgz\" % codename\n\n    if options.update_pbuilder:\n        command = \"\"\"\\\nsudo /usr/sbin/pbuilder --update --basetgz %s\"\"\" % (\n            basetgz_filename\n        )\n\n        check_call(\n            [\"sudo\", \"/usr/sbin/pbuilder\", \"--update\", \"--basetgz\", basetgz_filename]\n        )\n\n    (dsc_filename,) = resolveShellPatternToFilenames(\"dist/deb_dist/*.dsc\")\n\n    # Execute the package build in the pbuilder with tests.\n    # spell-checker: ignore hookdir,debemail,buildresult\n    command = (\n        \"sudo\",\n        \"/usr/sbin/pbuilder\",\n        \"--build\",\n        \"--basetgz\",\n        basetgz_filename,\n        \"--hookdir\",\n        \"debian/pbuilder-hookdir\",\n        \"--debemail\",\n        \"Kay Hayen <kay.hayen@gmail.com>\",\n        \"--buildresult\",\n        \"package\",\n        dsc_filename,\n    )\n\n    check_call(command, shell=False)\n\n    # Cleanup the build directory, not needed anymore.\n    shutil.rmtree(\"build\", ignore_errors=True)\n\n    # Now build the repository.\n    my_print(\"Building repository ...\", style=\"blue\")\n\n    os.chdir(\"package\")\n\n    os.makedirs(\"repo\")\n    os.chdir(\"repo\")\n\n    os.makedirs(\"conf\")\n\n    # spell-checker: ignore armel armhf\n    putTextFileContents(\n        \"conf/distributions\",\n        contents=\"\"\"\\\nOrigin: Nuitka\nLabel: Nuitka\nCodename: %(codename)s\nArchitectures: i386 amd64 armel armhf powerpc\nComponents: main\nDescription: Apt repository for project Nuitka %(codename)s\nSignWith: D96ADCA1377F1CEB6B5103F11BFC33752912B99C\n\"\"\"\n        % {\"codename\": codename},\n    )\n\n    # spell-checker: ignore reprepro includedeb\n    command = [\"reprepro\", \"includedeb\", codename]\n    command.extend(resolveShellPatternToFilenames(\"../*.deb\"))\n\n    check_call(command, shell=False)\n\n    if options.check:\n        tools_logger.sysexit(\"Finished check.\", exit_code=0)\n\n    my_print(\"Uploading ...\", style=\"blue\")\n\n    # Create repo folder unless already done. This is needed for the first\n    # build only. It also prevents us from talking to foreign servers, by\n    # letting ssh check all it wants.\n    assert (\n        os.system(\n            \"ssh root@ssh.nuitka.net mkdir -p /var/www/deb/%s/%s/\"\n            % (category, codename)\n        )\n        == 0\n    )\n\n    # Update the repository on the web site.\n    assert (\n        os.system(\n            \"rsync -avz --delete dists pool --chown www-data root@ssh.nuitka.net:/var/www/deb/%s/%s/\"\n            % (category, codename)\n        )\n        == 0\n    )\n\n    my_print(\"Finished.\", style=\"blue\")\n"
  },
  {
    "path": "nuitka/tools/release/debian_mentors/__init__.py",
    "content": "\"\"\" Dummy file to make this directory a package. \"\"\"\n"
  },
  {
    "path": "nuitka/tools/release/debian_mentors/__main__.py",
    "content": "\"\"\" Debian/Ubuntu package release.\n\n\"\"\"\n\nimport os\nimport shutil\nimport sys\n\nfrom nuitka.tools.release.Debian import cleanupTarfileForDebian, runPy2dsc\nfrom nuitka.tools.release.Documentation import checkReleaseDocumentation\nfrom nuitka.tools.release.Release import checkBranchName\nfrom nuitka.Tracing import my_print\n\n\ndef main():\n    branch_name = checkBranchName()\n    assert branch_name == \"main\"\n\n    checkReleaseDocumentation()\n    assert os.system(\"%s setup.py sdist --formats=gztar\" % sys.executable) == 0\n\n    os.chdir(\"dist\")\n\n    # Clean the stage for the debian package. The name \"deb_dist\" is what \"py2dsc\"\n    # uses for its output later on.\n    shutil.rmtree(\"deb_dist\", ignore_errors=True)\n\n    # Provide a re-packed tar.gz for the Debian package as input.\n\n    # Create it as a \"+ds\" file, removing:\n    # - the benchmarks (too many sources, not useful to end users, potential license\n    #   issues)\n    # - the inline copy of scons (not wanted for Debian)\n\n    # Then run \"py2dsc\" on it.\n\n    for filename in os.listdir(\".\"):\n        if filename.endswith(\".tar.gz\"):\n            new_name = filename[:-7] + \"+ds.tar.gz\"\n\n            cleanupTarfileForDebian(\n                codename=\"sid\", filename=filename, new_name=new_name\n            )\n\n            entry = runPy2dsc(filename, new_name)\n\n            break\n    else:\n        assert False\n\n    os.chdir(\"deb_dist\")\n    os.chdir(entry)\n\n    # Build the debian package, but disable the running of tests, will be done later\n    # in the pbuilder test steps.\n    assert os.system(\"debuild --set-envvar=DEB_BUILD_OPTIONS=nocheck\") == 0\n\n    os.chdir(\"../../..\")\n    assert os.path.exists(\"dist/deb_dist\")\n\n    # Cleanup the build directory, not needed anymore.\n    shutil.rmtree(\"build\", ignore_errors=True)\n\n    my_print(\"Uploading...\", style=\"blue\")\n    os.chdir(\"dist/deb_dist\")\n\n    assert os.system(\"dput mentors *.changes\") == 0\n\n    my_print(\"Finished.\", style=\"blue\")\n"
  },
  {
    "path": "nuitka/tools/release/osc_check/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/osc_check/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" OpenSUSE Build Service (OSC) status check.\n\nConfirms that all relevant packages are successfully built. For use in\nBuildbot on a timer basis.\n\n\"\"\"\n\n\nimport csv\nimport sys\n\nfrom nuitka.__past__ import StringIO\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import check_output\n\n\ndef main():\n    # many cases, pylint: disable=too-many-branches\n\n    my_print(\"Querying openSUSE build service status of Nuitka packages.\")\n\n    # spell-checker: ignore kayhayen\n    osc_cmd = [\"osc\", \"pr\", \"-c\", \"home:kayhayen\"]\n\n    stdout_osc = check_output(args=osc_cmd)\n\n    if str is not bytes:\n        stdout_osc = stdout_osc.decode(\"utf8\")\n\n    # Response is really a CSV file, so use that for parsing.\n    csv_file = StringIO(stdout_osc)\n    osc_reader = csv.reader(csv_file, delimiter=\";\")\n\n    osc_reader = iter(osc_reader)\n\n    bad = (\"failed\", \"unresolvable\", \"broken\", \"blocked\")\n\n    titles = next(osc_reader)[1:]\n\n    # Nuitka (follow git main branch)\n    row1 = next(osc_reader)\n    # Nuitka-Unstable (follow git develop branch)\n    row2 = next(osc_reader)\n    # Nuitka-Experimental (follow git factory branch)\n    row3 = next(osc_reader)\n\n    problems = []\n\n    def decideConsideration(title, status):\n        # Ignore other arch builds, they might to not even boot at times.\n        # spell-checker: ignore aarch\n        if \"ppc\" in title or \"aarch\" in title or \"arm\" in title:\n            return False\n\n        # This fails for other reasons often, and is not critical to Nuitka.\n        if \"openSUSE_Tumbleweed\" in title:\n            return False\n\n        # Ignore old Fedora and RHEL6 32 bit being blocked.\n        if status == \"blocked\":\n            if (\n                \"Fedora_2\" in title\n                or \"RedHat_RHEL-6/i586\" in title\n                or \"CentOS_CentOS-6/i586\" in title\n            ):\n                return False\n\n        # It makes building visible now, that's not an error of course.\n        if status == \"building\":\n            return False\n\n        # It makes need to build visible as well, that too is not an error\n        # really.\n        if status == \"outdated\":\n            return False\n\n        return True\n\n    for count, title in enumerate(titles):\n        status = row1[count + 1]\n\n        if not decideConsideration(title, status):\n            continue\n\n        if status in bad:\n            problems.append((row1[0], title, status))\n\n    for count, title in enumerate(titles):\n        status = row2[count + 1]\n\n        if not decideConsideration(title, status):\n            continue\n\n        if status in bad:\n            problems.append((row2[0], title, status))\n\n    for count, title in enumerate(titles):\n        status = row3[count + 1]\n\n        if not decideConsideration(title, status):\n            continue\n\n        if status in bad:\n            problems.append((row3[0], title, status))\n\n    if problems:\n        my_print(\"There are problems with:\", style=\"yellow\")\n        my_print(\n            \"\\n\".join(\"%s: %s (%s)\" % problem for problem in problems), style=\"yellow\"\n        )\n\n        if any(problem[0] == \"Nuitka\" for problem in problems):\n            my_print(\n                \"Check here: https://build.opensuse.org/package/show/home:kayhayen/Nuitka\"\n            )\n\n        if any(problem[0] == \"Nuitka-Unstable\" for problem in problems):\n            my_print(\n                \"Check here: https://build.opensuse.org/package/show/home:kayhayen/Nuitka-Unstable\"\n            )\n\n        if any(problem[0] == \"Nuitka-experimental\" for problem in problems):\n            my_print(\n                \"Check here: https://build.opensuse.org/package/show/home:kayhayen/Nuitka-experimental\"\n            )\n\n        sys.exit(1)\n    else:\n        my_print(\"Looks good.\", style=\"blue\")\n        sys.exit(0)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/osc_upload/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/osc_upload/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" OpenSUSE Build Service (OSC) upload release tool.\n\nUploads Nuitka branches adapting the RPM configuration to the different\nprojects on OSC.\n\"\"\"\n\nimport os\nimport shutil\nimport sys\n\nfrom nuitka.tools.release.Documentation import checkReleaseDocumentation\nfrom nuitka.tools.release.Release import checkBranchName\nfrom nuitka.Version import getNuitkaVersion\n\n\ndef main():\n    nuitka_version = getNuitkaVersion()\n    branch_name = checkBranchName()\n\n    shutil.rmtree(\"dist\", ignore_errors=True)\n    shutil.rmtree(\"build\", ignore_errors=True)\n\n    checkReleaseDocumentation()\n    assert os.system(\"%s setup.py sdist --formats=gztar\" % sys.executable) == 0\n\n    # Upload stable releases to OpenSUSE Build Service:\n    if (\n        branch_name.startswith(\"release\")\n        or branch_name.startswith(\"hotfix\")\n        or branch_name == \"main\"\n    ):\n        osc_project_name = \"Nuitka\"\n        spec_suffix = \"\"\n    elif branch_name == \"develop\":\n        osc_project_name = \"Nuitka-Unstable\"\n        spec_suffix = \"-unstable\"\n    elif branch_name == \"factory\":\n        osc_project_name = \"Nuitka-experimental\"\n        spec_suffix = \"-experimental\"\n    else:\n        sys.exit(\"Skipping OSC for branch '%s'\" % branch_name)\n\n    # Cleanup the osc directory.\n    shutil.rmtree(\"osc\", ignore_errors=True)\n    os.makedirs(\"osc\")\n\n    # Stage the \"osc\" checkout from the ground up.\n    assert (\n        os.system(\n            f\"\"\"\\\ncd osc && \\\nosc checkout home:kayhayen {osc_project_name} && \\\nrm home:kayhayen/{osc_project_name}/* && \\\ncp ../dist/Nuitka-*.tar.gz home:kayhayen/{osc_project_name}/ && \\\nsed -e s/VERSION/{nuitka_version}/ ../rpm/nuitka.spec >home:kayhayen/{osc_project_name}/nuitka{spec_suffix}.spec && \\\nsed -i home:kayhayen/{osc_project_name}/nuitka{spec_suffix}.spec -e \\\n    's/Name: *nuitka/Name:           nuitka{spec_suffix}/' && \\\ncp ../rpm/nuitka-rpmlintrc home:kayhayen/{osc_project_name}/ && \\\ncd home:kayhayen/{osc_project_name}/ && \\\nosc addremove -r && \\\necho 'New release' >ci_message && \\\nosc ci --file ci_message\n\"\"\"\n        )\n        == 0\n    )\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/pypi/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/pypi/__main__.py",
    "content": "#!/usr/bin/python -u\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Make PyPI upload of Nuitka, and check success of it. \"\"\"\n\nimport os\nimport shutil\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.tools.environments.Virtualenv import withVirtualenv\nfrom nuitka.tools.release.Documentation import checkReleaseDocumentation\nfrom nuitka.tools.release.Release import checkBranchName\nfrom nuitka.Tracing import my_print, tools_logger\nfrom nuitka.utils.InstalledPythons import findInstalledPython\nfrom nuitka.Version import getNuitkaVersion\n\n\ndef _checkNuitkaInVirtualenv(python):\n    with withVirtualenv(\n        \"venv_nuitka\", style=\"blue\", python=python.getPythonExe()\n    ) as venv:\n        my_print(\"Installing Nuitka into virtualenv:\", style=\"blue\")\n        my_print(\"*\" * 40, style=\"blue\")\n        venv.runCommand(\"python -m pip install ../dist/Nuitka*.tar.gz\")\n        my_print(\"*\" * 40, style=\"blue\")\n\n        my_print(\"Compiling basic test with runner:\", style=\"blue\")\n        my_print(\"*\" * 40, style=\"blue\")\n        venv.runCommand(\n            \"nuitka%s ../tests/basics/AssertsTest.py\" % python.getPythonVersion()[0],\n            style=\"blue\",\n        )\n        my_print(\"*\" * 40, style=\"blue\")\n\n        my_print(\"Compiling basic test with recommended -m mode:\", style=\"blue\")\n        my_print(\"*\" * 40, style=\"blue\")\n        venv.runCommand(\n            \"python -m nuitka ../tests/basics/AssertsTest.py\",\n            style=\"blue\",\n        )\n        my_print(\"*\" * 40, style=\"blue\")\n\n\ndef main():\n    nuitka_version = getNuitkaVersion()\n\n    branch_name = checkBranchName()\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--token\",\n        action=\"store\",\n        dest=\"token\",\n        help=\"\"\"\nToken to use for upload.\n\"\"\",\n    )\n\n    parser.add_option(\n        \"--check\",\n        action=\"store_true\",\n        dest=\"check\",\n        help=\"\"\"\nDo not update the the container, use it if updating was done recently.\n\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if positional_args:\n        tools_logger.sysexit(\n            \"This command takes no positional arguments, check help output.\"\n        )\n\n    # Only real main releases so far.\n    if not options.check:\n        assert branch_name == \"main\", branch_name\n        assert \"pre\" not in nuitka_version and \"rc\" not in nuitka_version\n\n    my_print(\"Working on Nuitka %r.\" % nuitka_version, style=\"blue\")\n\n    shutil.rmtree(\"check_nuitka\", ignore_errors=True)\n    shutil.rmtree(\"dist\", ignore_errors=True)\n\n    my_print(\"Creating documentation.\", style=\"blue\")\n    checkReleaseDocumentation()\n    my_print(\"Creating source distribution.\", style=\"blue\")\n    assert (\n        os.system(\"umask 0022 && chmod -R a+rX . && %s setup.py sdist\" % sys.executable)\n        == 0\n    )\n\n    # Delete requires.txt as it confuses poetry and potentially other tools\n    assert os.system(\"gunzip dist/Nuitka*.tar.gz\") == 0\n    assert (\n        os.system(\n            \"tar --wildcards --delete --file dist/Nuitka*.tar Nuitka-*/Nuitka.egg-info/requires.txt\"\n        )\n        == 0\n    )\n    assert os.system(\"gzip -9 dist/Nuitka*.tar\") == 0\n\n    # Test with these Pythons if the installed package would work.\n    pythons = [\n        findInstalledPython(\n            python_versions=(\"2.7\",), module_name=None, module_version=None\n        ),\n        findInstalledPython(\n            python_versions=(\"3.10\",), module_name=None, module_version=None\n        ),\n    ]\n\n    for python in pythons:\n        _checkNuitkaInVirtualenv(python)\n\n    assert os.system(\"twine check dist/*\") == 0\n\n    if not options.check:\n        my_print(\"Uploading source dist\")\n        assert (\n            os.system(\n                \"twine upload --username=__token__ --password=%s dist/* \"\n                % options.token\n            )\n            == 0\n        )\n        my_print(\"Uploaded.\")\n    else:\n        my_print(\"Checked OK, but not uploaded.\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/rpm/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/rpm/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" OpenSUSE Build Service (OSC) upload release tool.\n\nUploads Nuitka branches adapting the RPM configuration to the different\nprojects on OSC.\n\"\"\"\n\nimport os\nimport shutil\nimport sys\n\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.release.Release import checkBranchName\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    makePath,\n    putTextFileContents,\n    renameFile,\n    withDirectoryChange,\n)\nfrom nuitka.Version import getNuitkaVersion\n\n\ndef main():\n    goHome()\n\n    nuitka_version = getNuitkaVersion()\n    branch_name = checkBranchName()\n\n    shutil.rmtree(\"build\", ignore_errors=True)\n    makePath(\"build\")\n\n    # Used by rpmbuild\n    makePath(os.path.expanduser(\"~/rpmbuild/SOURCES\"))\n\n    # Upload stable releases to OpenSUSE Build Service:\n    if (\n        branch_name.startswith(\"release\")\n        or branch_name.startswith(\"hotfix\")\n        or branch_name == \"main\"\n    ):\n        rpm_project_name = \"Nuitka\"\n        spec_suffix = \"\"\n    elif branch_name == \"develop\":\n        rpm_project_name = \"Nuitka-Develop\"\n        spec_suffix = \"-develop\"\n    elif branch_name == \"factory\":\n        rpm_project_name = \"Nuitka-Factory\"\n        spec_suffix = \"-factory\"\n    else:\n        tools_logger.sysexit(\"Skipping RPM build for branch '%s'\" % branch_name)\n\n    with withDirectoryChange(\"build\"):\n        tools_logger.info(\n            \"Building source distribution for %s %s\"\n            % (rpm_project_name, nuitka_version)\n        )\n        assert os.system(\"%s ../setup.py sdist --formats=gztar\" % sys.executable) == 0\n        nuitka_dist_filename = \"Nuitka%s-%s.tar.gz\" % (spec_suffix, nuitka_version)\n        renameFile(\n            source_filename=os.path.join(\"..\", \"dist\", nuitka_dist_filename),\n            dest_filename=os.path.join(\"/root/rpmbuild/SOURCES\", nuitka_dist_filename),\n        )\n\n        # Adapt the spec file dynamically to version and project name of Nuitka being built.\n        spec_contents = getFileContents(\n            os.path.join(os.path.dirname(__file__), \"nuitka.spec\")\n        )\n        spec_contents = spec_contents.replace(\"PROJECT_NAME\", \"nuitka\" + spec_suffix)\n        spec_contents = spec_contents.replace(\"PROJECT_VERSION\", nuitka_version)\n\n        spec_filename = \"nuitka%s.spec\" % spec_suffix\n        putTextFileContents(\n            filename=spec_filename,\n            contents=spec_contents,\n        )\n\n        os.system(\"rpmbuild --target x86_64 -bb %s\" % spec_filename)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/rpm/nuitka.spec",
    "content": "%if 0%{?rhel} < 8\n# detect python site-packages path, use get_python_lib(0) as nuitka using\n%if 0%{?fedora} < 31\n%global python_sitearch %(%{__python} -c \"import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0))\")\n%endif\n%global python3_sitearch %(%{__python3} -c \"import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0))\")\n%endif\n\n%global _python_bytecompile_errors_terminate_build 0\n\nName:           PROJECT_NAME\nVersion:        PROJECT_VERSION\nRelease:        5%{?dist}\nSummary:        Python compiler with full language support and CPython compatibility\nGroup:          Development/Languages/Python\nLicense:        Apache-2.0\nURL:            https://nuitka.net/\nSource0:        https://nuitka.net/releases/Nuitka-%{version}.tar.gz\nSource1:        nuitka-rpmlintrc\nBuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)\n%if 0%{?fedora} < 28 && 0%{?rhel} < 8\nBuildRequires:  python\nBuildRequires:  python-devel\nBuildRequires:  python-setuptools\n%endif\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\nBuildRequires:  python-markupsafe\n%endif\n%if 0%{?fedora} >= 24\nBuildRequires:  python-libs\nBuildRequires:  python-debug\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\nBuildRequires:  python3\nBuildRequires:  python3-devel\n%endif\n%if 0%{?rhel} == 8\nBuildRequires:  python36\nBuildRequires:  python36-devel\n%endif\n%if 0%{?fedora} >= 24 || 0%{?rhel} == 8\nBuildRequires:  python3-markupsafe\n%endif\n%if 0%{?suse_version} >= 1500\nBuildRequires:  python3-MarkupSafe\n%if 0%{?sle_version} == 0\nBuildRequires:  openSUSE-release\n%else\nBuildRequires:  dummy-release\n%endif\n%endif\n%if 0%{?fedora} >= 27\nBuildRequires:  python3-tools\n%endif\n%if 0%{?fedora} >= 35 || 0%{?suse_version} >= 1500\nBuildRequires:  python3-setuptools\n%endif\nBuildRequires:  gcc\nBuildRequires:  strace\nBuildRequires:  patchelf\nBuildRequires:  ccache\nBuildRequires:  gdb\n\n%if 0%{?fedora} < 28 && 0%{?rhel} < 8\nRequires:       python-devel\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\nRequires:       python3-devel\n%endif\n%if 0%{?rhel} == 8\nRequires:       python36-devel\n%endif\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\nRequires:       python-markupsafe\n%endif\n%if 0%{?fedora} >= 24 || 0%{?rhel} == 8\nRequires:       python3-markupsafe\n%endif\n%if 0%{?suse_version} >= 1500\nRequires:       python3-MarkupSafe\n%if 0%{?sle_version} == 0\nRequires:       openSUSE-release\n%else\nRequires:       dummy-release\n%endif\n%endif\nRequires:       gcc-c++\nRequires:       strace\nRequires:       patchelf\nRequires:       ccache\n\nBuildArchitectures: noarch\n\n%description\nPython compiler with full language support and CPython compatibility\n\nThis Python compiler achieves full language compatibility and compiles Python\ncode into compiled objects that are not second class at all. Instead they can\nbe used in the same way as pure Python objects.\n\n%prep\n%setup -q -n Nuitka-%{version}\n\n%build\n\npython2=`which python2 2>/dev/null || true`\nif [ \"$python2\" != \"\" ]\nthen\n    python2_version=`$python2 -c \"import sys; print '.'.join(str(s) for s in sys.version_info[0:2])\"`\nfi\npython3=`which python3 2>/dev/null || true`\n\n# Only used on Windows:\nrm -rf nuitka/build/inline_copy/lib/scons-4*\n\nif [ \"$python2_version\" != \"2.6\" ]\nthen\n    # Remove files needed only for Python 2.6, they only cause errors during\n    # compilation with Python3.\n    rm -rf nuitka/build/inline_copy/lib/scons-2.3.2\nelse\n    # Remove files mot needed for Python 2.6, they only cause errors during\n    # compilation with Python 2.6.\n    rm -rf nuitka/build/inline_copy/lib/scons-3.1.2\n    rm -rf nuitka/build/inline_copy/tqdm\nfi\n\n# These are all Windows only or used only there.\nrm -rf nuitka/build/inline_copy/clcache\nrm -rf nuitka/build/inline_copy/atomicwrites\nrm -rf nuitka/build/inline_copy/colorama\n\nif [ \"$python2\" != \"\" ]\nthen\n    python2_version=`$python2 -c \"import sys; print '.'.join(str(s) for s in sys.version_info[0:2])\"`\n    $python2 setup.py build\nfi\n\nif [ \"$python3\" != \"\" ]\nthen\n    $python3 setup.py build\nfi\n\n%check\n\necho \"Environment variables during build:\"\nenv\n\necho \"OS information during build:\"\nif [ -f /etc/os-release ]\nthen\n    echo \"Contents of /etc/os-release :\"\n    cat /etc/os-release\nelse\n    echo \"No /etc/os-release file found\"\nfi\n\nif [ -f /etc/SuSE-release ]\nthen\n    echo \"Contents of /etc/SuSE-release :\"\n    cat /etc/SuSE-release\nelse\n    echo \"No /etc/SuSE-release file found\"\nfi\n\nif [ -f /etc/issue ]\nthen\n    echo \"Contents of /etc/issue :\"\n    cat /etc/issue\nelse\n    echo \"No /etc/issue file found\"\nfi\n\n\nif [ -x \"$(command -v lsb_release)\" ]\nthen\n    lsb_release -a\nelse\n    echo \"No lsb_release binary found\"\nfi\n\n\npython2=`which python2 || true`\n\nif [ \"$python2\" != \"\" ]\nthen\n    echo \"Nuitka Version information\"\n    $python2 -m nuitka.__main__ --version\n    echo \"Basic compilation test of empty module:\"\n    $python2 -m nuitka.__main__ --module --show-scons --run --report=out.xml tests/basics/EmptyModuleTest.py\n    echo \"Basic compilation test of empty program:\"\n    $python2 -m nuitka.__main__ --show-scons --run --report=compilation-report-exe.xml --experimental=debug-report-traceback tests/basics/EmptyModuleTest.py\n\n    $python2 ./tests/run-tests --skip-reflection-test\nelse\n    echo \"Nuitka Version information\"\n    python3 -m nuitka --version\n    echo \"Basic compilation test of empty module:\"\n    python3 -m nuitka --module --show-scons --run tests/basics/EmptyModuleTest.py\n    echo \"Basic compilation test of empty program:\"\n    python3 -m nuitka --show-scons --run tests/basics/EmptyModuleTest.py\n\n    python3 ./tests/run-tests --skip-reflection-test\nfi\n\n%install\nrm -rf %{buildroot}\n\npython2=`which python2 || true`\npython3=`which python3 || true`\n\nif [ \"$python2\" != \"\" ]\nthen\n    $python2 setup.py install --skip-build --prefix %{_prefix} --root=%{buildroot}\nfi\n\nif [ \"$python3\" != \"\" ]\nthen\n    $python3 setup.py install --skip-build --prefix %{_prefix} --root=%{buildroot}\nfi\n\n%clean\nrm -rf %{buildroot}\n\n%files\n%defattr(-,root,root,-)\n%doc README.rst Changelog.rst\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\n%{_bindir}/nuitka2\n%{_bindir}/nuitka2-run\n%{python_sitearch}/*\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\n%{python3_sitearch}/*\n%{_bindir}/nuitka3\n%{_bindir}/nuitka3-run\n%endif\n%if 0%{?rhel} == 8\n/usr/lib/python3.6/site-packages/\n%{_bindir}/nuitka3\n%{_bindir}/nuitka3-run\n%endif\n%changelog\n* Thu Nov 23 2023 Kay Hayen <kay.hayen@gmail.com> - 1.9\n- changes to build without OBS, removed man pages they\n  are not really needed anyway and are too difficult to\n  maintain.\n\n* Sat Dec 28 2019 Kay Hayen <kay.hayen@gmail.com> - 0.6.7\n- adapted for Fedora31 and CentOS 8, Python3 enhancements\n- added Python3 for openSUSE 15 or higher too.\n\n* Fri Jun 07 2019 Kay Hayen <kay.hayen@gmail.com> - 0.6.4\n- adapted for Fedora30\n\n* Mon Mar 26 2018 Kay Hayen <kay.hayen@gmail.com> - 0.5.29\n- added Python3 packaging\n\n* Sun Sep 08 2013 Kay Hayen <kay.hayen@gmail.com> - 0.4.6\n- changed description to match what we use for Debian\n\n* Fri Mar 15 2013 Kay Hayen <kay.hayen@gmail.com> - 0.4.2\n- addressed complaints from opensuse buildservice\n- moved to group \"/Development/Languages/Python\"\n- no trailing dot for description,\n- man pages also for Python3 related binaries\n\n* Sun Mar 10 2013 ownssh <ownssh@gmail.com> - 0.4.1-3\n- use shortcut files to support python3 (remove python3 base package)\n- change requires python to python-devel\n\n* Thu Mar 07 2013 ownssh <ownssh@gmail.com> - 0.4.1-2\n- Add python3 support\n\n* Thu Mar 07 2013 ownssh <ownssh@gmail.com> - 0.4.1-1\n- Initial packaging of Nuitka as RPM.\n"
  },
  {
    "path": "nuitka/tools/release/sync_doc/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/release/sync_doc/__main__.py",
    "content": "#!/usr/bin/python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Release tool to sync Developer Manual with code comments. \"\"\"\n\nimport inspect\nimport re\nimport sys\n\nfrom nuitka.utils.FileOperations import getFileContentByLine\n\n\ndef main():\n    quote_start_re = re.compile(\"[Qq]uoting the ``(.*)`` documentation\")\n    quote_end_re = re.compile(\"(End|end) quoting the ``(.*)`` documentation\")\n\n    quoting = False\n\n    for line in getFileContentByLine(\"Developer_Manual.rst\"):\n        if not quoting:\n            print(line, end=\"\")\n\n        if not quoting:\n            match = quote_start_re.search(line)\n\n            if match:\n                quoting = match.group(1)\n\n                if \".\" in quoting:\n                    import_from, import_value = quoting.rsplit(\".\", 1)\n\n                    # Hopefully OK for us, pylint: disable=W0122\n                    exec(\"from %s import %s\" % (import_from, import_value))\n                    item = getattr(sys.modules[import_from], import_value)\n\n                    # Should potentially be derived from quoting line.\n                    indentation = \" \" * line.find(\"Quoting\")\n\n                    # Empty line to separate\n                    print()\n\n                    for quote_line in inspect.getdoc(item).splitlines():\n                        if quote_line:\n                            print(indentation + quote_line)\n                        else:\n                            print()\n\n                    print()\n                else:\n                    assert False, quoting\n\n        if quoting:\n            match = quote_end_re.search(line)\n\n            if match:\n                assert quoting == match.group(1)\n                quoting = False\n\n                print(line, end=\"\")\n\n    if quoting:\n        sys.exit(\"Error, waiting for end of quote for %s failed\" % quoting)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/scanning/DisplayPackageDLLs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Display the DLLs in a package. \"\"\"\n\nimport os\n\nfrom nuitka.freezer.DllDependenciesCommon import (\n    getPackageSpecificDLLDirectories,\n)\nfrom nuitka.importing.Importing import (\n    addMainScriptDirectory,\n    hasMainScriptDirectory,\n    locateModule,\n)\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.FileOperations import listDllFilesFromDirectory, relpath\nfrom nuitka.utils.Importing import getSharedLibrarySuffixes\nfrom nuitka.utils.ModuleNames import ModuleName\nfrom nuitka.utils.SharedLibraries import getDllExportedSymbols\nfrom nuitka.utils.Utils import isMacOS\n\n\ndef getPythonEntryPointExportedSymbolName(module_name):\n    result = \"%s%s\" % (\"init\" if str is bytes else \"PyInit_\", module_name.asString())\n\n    if isMacOS():\n        result = \"_\" + result\n\n    return result\n\n\ndef isExtensionModule(module_filename):\n    for suffix in getSharedLibrarySuffixes():\n        if module_filename.endswith(suffix):\n            module_name = ModuleName(os.path.basename(module_filename)[: -len(suffix)])\n\n            exported_symbols = getDllExportedSymbols(\n                logger=tools_logger, filename=module_filename\n            )\n\n            if exported_symbols is None:\n                return None\n\n            return (\n                getPythonEntryPointExportedSymbolName(module_name) in exported_symbols\n            )\n\n    return False\n\n\ndef displayDLLs(module_name):\n    \"\"\"Display the DLLs for a module name.\"\"\"\n    module_name = ModuleName(module_name)\n\n    if not hasMainScriptDirectory():\n        addMainScriptDirectory(os.getcwd())\n\n    module_name, package_directory, _module_kind, finding = locateModule(\n        module_name=module_name, parent_package=None, level=0\n    )\n\n    if finding == \"not-found\":\n        tools_logger.sysexit(\n            \"Error, cannot find '%s' package.\" % module_name.asString()\n        )\n\n    if not os.path.isdir(package_directory):\n        tools_logger.sysexit(\n            \"Error, doesn't seem that '%s' is a package on disk.\"\n            % module_name.asString()\n        )\n\n    tools_logger.info(\"Checking package directory '%s' .. \" % package_directory)\n\n    count = 0\n\n    for package_dll_dir in getPackageSpecificDLLDirectories(\n        module_name, consider_plugins=False\n    ):\n        first = True\n\n        for package_dll_filename, _dll_basename in listDllFilesFromDirectory(\n            package_dll_dir\n        ):\n            if isExtensionModule(package_dll_filename):\n                continue\n\n            if first:\n                tools_logger.my_print(package_dll_dir)\n                first = False\n\n            tools_logger.my_print(\n                \"  %s\" % relpath(package_dll_filename, start=package_dll_dir),\n            )\n\n            count += 1\n\n    tools_logger.info(\"Found %s DLLs.\" % count)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/scanning/DisplayPackageData.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Display the DLLs in a package. \"\"\"\n\nimport os\n\nfrom nuitka.freezer.IncludedDataFiles import scanIncludedPackageDataFiles\nfrom nuitka.importing.Importing import (\n    addMainScriptDirectory,\n    hasMainScriptDirectory,\n    locateModule,\n)\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef displayPackageData(module_name):\n    \"\"\"Display the package data for a module name.\"\"\"\n    module_name = ModuleName(module_name)\n\n    if not hasMainScriptDirectory():\n        addMainScriptDirectory(os.getcwd())\n\n    module_name, package_directory, _module_kind, finding = locateModule(\n        module_name=module_name, parent_package=None, level=0\n    )\n\n    if finding == \"not-found\":\n        tools_logger.sysexit(\n            \"Error, cannot find '%s' package.\" % module_name.asString()\n        )\n\n    if not os.path.isdir(package_directory):\n        tools_logger.sysexit(\n            \"Error, doesn't seem that '%s' is a package on disk but rather a plain module.\"\n            % module_name.asString()\n        )\n\n    tools_logger.info(\"Checking package directory '%s' .. \" % package_directory)\n\n    count = 0\n\n    first = True\n\n    for pkg_filename in scanIncludedPackageDataFiles(\n        package_directory=package_directory, pattern=None\n    ):\n        if first:\n            tools_logger.my_print(package_directory)\n            first = False\n\n        tools_logger.my_print(pkg_filename)\n\n        count += 1\n\n    tools_logger.info(\"Found %s data files.\" % count)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/scanning/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/CTypeDescriptions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" C type descriptions. For specific or general C types, provide code generation help.\n\n\"\"\"\n\nimport math\nfrom abc import abstractmethod\n\nfrom nuitka.__past__ import long\nfrom nuitka.code_generation.Namify import namifyConstant\nfrom nuitka.utils.SlotMetaClasses import getMetaClassBase\n\n\nclass TypeDescBase(getMetaClassBase(\"Type\", require_slots=False)):\n    # To be overloaded\n    type_name = None\n    type_desc = None\n    type_decl = None\n\n    python_requirement = None\n\n    def __init__(self):\n        assert self.type_name\n        assert self.type_desc\n        assert self.type_decl\n\n    def __repr__(self):\n        return \"<%s %s %s>\" % (self.__class__.__name__, self.type_name, self.type_desc)\n\n    @classmethod\n    def getHelperCodeName(cls):\n        return cls.type_name.upper()\n\n    @classmethod\n    def getTypeName2(cls):\n        return cls.type_name\n\n    @classmethod\n    def getTypeName3(cls):\n        return cls.type_name\n\n    @classmethod\n    def getVariableDecl(cls, variable_name):\n        if cls.type_decl.endswith(\"*\"):\n            return cls.type_decl + variable_name\n        else:\n            return cls.type_decl + \" \" + variable_name\n\n    @classmethod\n    def getTypeDecl(cls):\n        return cls.type_decl\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"CHECK_OBJECT(%s);\" % operand\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"Py_TYPE(%s)\" % operand\n\n    def getTypeNameExpression(self, type_name):\n        if self is object_desc:\n            return \"%s->tp_name\" % type_name\n\n        if self.getTypeName2() == self.getTypeName3():\n            return '\"%s\"' % self.getTypeName2()\n\n        if self.python_requirement == \"PYTHON_VERSION < 0x300\":\n            return '\"%s\"' % self.getTypeName2()\n        elif self.python_requirement == \"PYTHON_VERSION >= 0x300\":\n            return '\"%s\"' % self.getTypeName3()\n        elif self.python_requirement is None:\n            return '(PYTHON_VERSION < 0x300 ? \"%s\" : \"%s\")' % (\n                self.getTypeName2(),\n                self.getTypeName3(),\n            )\n        else:\n            assert False, self.python_requirement\n\n    def getTypeValueVariableExpression(self, type_name):\n        if self is object_desc:\n            return type_name\n        else:\n            return self.getTypeValueExpression(None)\n\n    @abstractmethod\n    def getNewStyleNumberTypeCheckExpression(self, operand):\n        pass\n\n    @staticmethod\n    def needsIndexConversion():\n        return True\n\n    def isKnownToNotCoerce(self, right):\n        if right is self and right is not object_desc:\n            return True\n\n        if self in (int_desc, long_desc, float_desc):\n            if right in (\n                str_desc,\n                unicode_desc,\n                tuple_desc,\n                list_desc,\n                set_desc,\n                dict_desc,\n                bytes_desc,\n            ):\n                return True\n\n        if (\n            self.getNewStyleNumberTypeCheckExpression(\"dummy\") == \"1\"\n            and right.getNewStyleNumberTypeCheckExpression(\"dummy\") == \"1\"\n        ):\n            return True\n\n        if self is not object_desc:\n            return not self.hasSlot(\"nb_coerce\")\n        else:\n            return False\n\n    def getMostSpecificType(self, right):\n        if self is not object_desc:\n            return self\n        else:\n            return right\n\n    def getLeastSpecificType(self, right):\n        if self is object_desc:\n            return self\n        else:\n            return right\n\n    @classmethod\n    def hasOneOrBothType(cls, right, type_name):\n        # At least one match\n        if type_name not in (cls.type_name, right.type_name):\n            return False\n\n        # Two matches perfect.\n        if cls.type_name == right.type_name:\n            return True\n\n        if \"object\" not in (cls.type_name, right.type_name):\n            return False\n\n        return True\n\n    @classmethod\n    def mayBothHaveType(cls, right, type_name):\n        return cls.type_name in (type_name, \"object\") and right.type_name in (\n            type_name,\n            \"object\",\n        )\n\n    @classmethod\n    def getTypeCheckExactExpression(cls, operand):\n        if cls.type_name == \"str\":\n            return \"PyStr_CheckExact(%s)\" % operand\n        elif cls.type_name == \"dict\":\n            return \"PyDict_CheckExact(%s)\" % operand\n        else:\n            assert False, cls\n\n    @classmethod\n    def getIntCheckExpression(cls, operand):\n        if cls.type_name == \"int\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyInt_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getLongCheckExpression(cls, operand):\n        if cls.type_name == \"long\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyLong_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getStringCheckExpression(cls, operand):\n        if cls.type_name == \"str\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyString_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getBytesCheckExpression(cls, operand):\n        if cls.type_name == \"bytes\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyBytes_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getUnicodeCheckExpression(cls, operand):\n        if cls.type_name == \"unicode\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyUnicode_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getFloatCheckExpression(cls, operand):\n        if cls.type_name == \"float\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyFloat_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    @classmethod\n    def getListCheckExpression(cls, operand):\n        if cls.type_name == \"list\":\n            return \"1\"\n        elif cls.type_name == \"object\":\n            return \"PyList_CheckExact(%s)\" % operand\n        else:\n            return \"0\"\n\n    def getSequenceCheckExpression(self, operand, right):\n        # Dictionaries are not really sequences despite slots.\n        if self.type_name == \"dict\":\n            return \"0\"\n        elif self.type_name == \"object\":\n            if right.type_name == \"tuple\":\n                return \"(PyTuple_CheckExact(%s) || PySequence_Check(%s))\" % (\n                    operand,\n                    operand,\n                )\n            else:\n                return \"PySequence_Check(%s)\" % operand\n        elif self.hasSlot(\"sq_item\"):\n            return \"1\"\n        else:\n            return \"0\"\n\n    def getInstanceCheckCode(self, operand):\n        # We do not yet specialize for instances, therefore everything but object is one.\n        if self.type_name == \"object\":\n            return \"PyInstance_Check(%s)\" % operand\n        else:\n            return \"0\"\n\n    def getIndexCheckExpression(self, operand):\n        if self.hasSlot(\"nb_index\"):\n            return \"1\"\n        elif self.type_name == \"object\":\n            return \"Nuitka_Index_Check(%s)\" % operand\n        else:\n            return \"0\"\n\n    def getSaneTypeCheckCode(self, operand):\n        # Is the type known to behave well for comparisons and object identity, e.g. not float.\n        if self.type_name == \"object\":\n            return \"IS_SANE_TYPE(Py_TYPE(%s))\" % operand\n        elif self in (str_desc, int_desc, long_desc, list_desc, tuple_desc):\n            return \"1\"\n        elif self in (float_desc,):\n            return \"0\"\n        else:\n            # Detect types not yet annotated.\n            assert False, self\n            return \"0\"\n\n    def getTypeIdenticalCheckExpression(self, other, type1, type2):\n        if self is object_desc or other is object_desc:\n            return \"%s == %s\" % (\n                self.getTypeValueExpression(None) if self is not object_desc else type1,\n                (\n                    other.getTypeValueExpression(None)\n                    if other is not object_desc\n                    else type2\n                ),\n            )\n        elif self is other:\n            return \"1\"\n        else:\n            return \"0\"\n\n    def getTypeNonIdenticalCheckExpression(self, other, type1, type2):\n        if self is object_desc or other is object_desc:\n            return \"%s != %s\" % (\n                self.getTypeValueExpression(None) if self is not object_desc else type1,\n                (\n                    other.getTypeValueExpression(None)\n                    if other is not object_desc\n                    else type2\n                ),\n            )\n        elif self is other:\n            return \"0\"\n        else:\n            return \"1\"\n\n    def getTypeSubTypeCheckExpression(self, other, type2, type1):\n        return \"Nuitka_Type_IsSubtype(%s, %s)\" % (\n            other.getTypeValueExpression(None) if other is not object_desc else type2,\n            self.getTypeValueExpression(None) if self is not object_desc else type1,\n        )\n\n    def getRealSubTypeCheckCode(self, other, type2, type1):\n        # Our concrete types, cannot be subtypes of any other type.\n        if other is object_desc:\n            return \"Nuitka_Type_IsSubtype(%s, %s)\" % (\n                type2,\n                self.getTypeValueExpression(None) if self is not object_desc else type1,\n            )\n        else:\n            return 0\n\n    @abstractmethod\n    def hasSlot(self, slot):\n        pass\n\n    @staticmethod\n    def hasPreferredSlot(right, slot):\n        # Virtual method, pylint: disable=unused-argument\n        return False\n\n    def _getSlotValueExpression(self, operand, slot):\n        if slot.startswith(\"nb_\"):\n            return \"(%s) ? %s : NULL\" % (\n                operand\n                + \"->tp_as_number != NULL && \"\n                + self.getNewStyleNumberTypeCheckExpression(operand),\n                operand + \"->tp_as_number->\" + slot,\n            )\n        elif slot.startswith(\"sq_\"):\n            return \"%s ? %s : NULL\" % (\n                operand + \"->tp_as_sequence\" + \" != NULL\",\n                operand + \"->tp_as_sequence->\" + slot,\n            )\n        elif slot == \"tp_richcompare\":\n            # Try to detect fallbacks, this needs version specific management\n            # for at least \"LONG\", maybe others. spell-checker: ignore RICHCOMPARE\n\n            assert self is object_desc, self\n            return \"RICHCOMPARE(%s)\" % operand\n        elif slot == \"tp_compare\":\n            return operand + \"->tp_compare\"\n        else:\n            assert False, slot\n\n    @staticmethod\n    def getSlotType(slot):\n        if slot in (\"nb_power\", \"nb_inplace_power\"):\n            return \"ternaryfunc\"\n        elif slot in (\"sq_repeat\", \"sq_inplace_repeat\"):\n            return \"ssizeargfunc\"\n        else:\n            return \"binaryfunc\"\n\n    @staticmethod\n    def getSlotCallExpression(nb_slot, slot_var, operand1, operand2):\n        if nb_slot in (\"nb_power\", \"nb_inplace_power\"):\n            return \"%s(%s, %s, Py_None)\" % (slot_var, operand1, operand2)\n        else:\n            return \"%s(%s, %s)\" % (slot_var, operand1, operand2)\n\n    def getSlotValueExpression(self, operand, slot):\n        assert (\n            \"inplace_\" not in slot\n            or not self.hasSlot(slot)\n            or self in (set_desc, list_desc)\n        ), self.hasSlot\n\n        if not self.hasSlot(slot):\n            return \"NULL\"\n\n        return self._getSlotValueExpression(operand, slot)\n\n    def getSlotValueCheckExpression(self, operand, slot):\n        # Virtual method, pylint: disable=unused-argument\n        return \"true\" if self.hasSlot(slot) else \"false\"\n\n    @abstractmethod\n    def getNoSequenceSlotAccessTestCode(self, type_name):\n        pass\n\n    @staticmethod\n    def getOperationErrorMessageName(operator):\n        if operator == \"%\":\n            return \"%%\"\n        elif operator == \"**\":\n            return \"** or pow()\"\n        elif operator == \"divmod\":\n            return \"divmod()\"\n        else:\n            return operator\n\n    def getReturnUnorderableTypeErrorCode(\n        self, operator, left, right, operand1, operand2\n    ):\n        args = []\n\n        if left is object_desc:\n            args.append(\"%s->tp_name\" % operand1)\n        if right is object_desc:\n            args.append(\"%s->tp_name\" % operand2)\n\n        if args:\n            args = \", \" + \", \".join(args)\n        else:\n            args = \"\"\n\n        if (\n            left.getTypeName2() != left.getTypeName3()\n            or right.getTypeName2() != right.getTypeName3()\n        ):\n            # TODO: The message for Python2, can it be triggered at all for non-objects?\n            return \"\"\"\\\n#if PYTHON_VERSION < 0x300\nPyErr_Format(PyExc_TypeError, \"unorderable types: %(left_type2)s() %(operator)s %(right_type2)s()\"%(args)s);\n#elif PYTHON_VERSION < 0x360\nPyErr_Format(PyExc_TypeError, \"unorderable types: %(left_type3)s() %(operator)s %(right_type3)s()\"%(args)s);\n#else\nPyErr_Format(PyExc_TypeError, \"'%(operator)s' not supported between instances of '%(left_type3)s' and '%(right_type3)s'\"%(args)s);\n#endif\nreturn %(return_value)s;\"\"\" % {\n                \"operator\": operator,\n                \"left_type2\": \"%s\" if left is object_desc else left.getTypeName2(),\n                \"right_type2\": \"%s\" if right is object_desc else right.getTypeName2(),\n                \"left_type3\": \"%s\" if left is object_desc else left.getTypeName3(),\n                \"right_type3\": \"%s\" if right is object_desc else right.getTypeName3(),\n                \"args\": args,\n                \"return_value\": self.getExceptionResultIndicatorValue(),\n            }\n        else:\n            return \"\"\"\\\n#if PYTHON_VERSION < 0x360\nPyErr_Format(PyExc_TypeError, \"unorderable types: %(left_type)s() %(operator)s %(right_type)s()\"%(args)s);\n#else\nPyErr_Format(PyExc_TypeError, \"'%(operator)s' not supported between instances of '%(left_type)s' and '%(right_type)s'\"%(args)s);\n#endif\nreturn %(return_value)s;\"\"\" % {\n                \"operator\": operator,\n                \"left_type\": \"%s\" if left is object_desc else left.getTypeName2(),\n                \"right_type\": \"%s\" if right is object_desc else right.getTypeName2(),\n                \"args\": args,\n                \"return_value\": self.getExceptionResultIndicatorValue(),\n            }\n\n    def hasSameTypeOperationSpecializationCode(self, other, nb_slot, sq_slot):\n        # Many cases, pylint: disable=too-many-branches,too-many-return-statements\n\n        candidate = self if self is not object_desc else other\n\n        # Both are objects, nothing to be done.\n        if candidate is object_desc:\n            assert self is object_desc\n            assert other is object_desc\n            return False\n\n        # Special case for sequence concat/repeats.\n        if (\n            sq_slot is not None\n            and not candidate.hasSlot(nb_slot)\n            and candidate.hasSlot(sq_slot)\n        ):\n            slot = sq_slot\n        else:\n            slot = nb_slot\n\n        if slot == \"sq_repeat\":\n            if candidate in (\n                list_desc,\n                tuple_desc,\n                set_desc,\n                dict_desc,\n                unicode_desc,\n                str_desc,\n                bytes_desc,\n            ):\n                # No repeat with themselves.\n                return False\n\n        if slot == \"nb_remainder\":\n            if candidate in (list_desc, tuple_desc, set_desc, dict_desc):\n                # No remainder with themselves.\n                return False\n\n        if slot == \"nb_multiply\":\n            if candidate in (\n                str_desc,\n                bytes_desc,\n                list_desc,\n                tuple_desc,\n                set_desc,\n                dict_desc,\n            ):\n                # No multiply with themselves.\n                return False\n\n        if slot == \"nb_add\":\n            # Tuple and list, etc. use sq_concat.\n            # TODO: What about unicode_desc\n            if candidate in (\n                str_desc,\n                bytes_desc,\n                tuple_desc,\n                list_desc,\n                set_desc,\n                dict_desc,\n            ):\n                # No add with themselves.\n                return False\n\n        if slot in (\"nb_and\", \"nb_or\", \"nb_xor\"):\n            if candidate in (\n                str_desc,\n                bytes_desc,\n                unicode_desc,\n                list_desc,\n                tuple_desc,\n                dict_desc,\n                float_desc,\n            ):\n                return False\n\n        if slot in (\"nb_lshift\", \"nb_rshift\"):\n            if candidate in (\n                str_desc,\n                bytes_desc,\n                unicode_desc,\n                tuple_desc,\n                list_desc,\n                set_desc,\n                dict_desc,\n                float_desc,\n            ):\n                return False\n\n        if slot == \"nb_matrix_multiply\":\n            # Nobody has it for anything\n            return False\n\n        return True\n\n    def hasSimilarTypeSpecializationCode(self, other):\n        return other in related_types.get(self, ())\n\n    def getSameTypeType(self, other):\n        if self is object_desc:\n            return other\n        elif other is object_desc:\n            return self\n        else:\n            return object_desc\n\n    def isSimilarOrSameTypesAsOneOf(self, *others):\n        for other in others:\n            assert other is not None\n\n            if self is other or other in related_types.get(self, ()):\n                return True\n\n        return False\n\n    def hasTypeSpecializationCode(self, other, nb_slot, sq_slot):\n        if self is object_desc and other is object_desc:\n            return False\n\n        if self is other:\n            return self.hasSameTypeOperationSpecializationCode(\n                other=other,\n                nb_slot=nb_slot,\n                sq_slot=sq_slot,\n            )\n\n        return self.hasSimilarTypeSpecializationCode(\n            other=other,\n        )\n\n    def getTypeComparisonSpecializationHelper(\n        self, other, op_code, target, operand1, operand2\n    ):\n        candidate1 = self if self is not object_desc else other\n        candidate2 = other if other is not object_desc else self\n\n        if candidate1 is object_desc:\n            return \"\", None, None, None, None, None\n\n        if long_desc in (candidate1, candidate2) and int_desc in (\n            candidate1,\n            candidate2,\n        ):\n            if candidate1 == int_desc:\n                operand1 = int_desc.getAsLongValueExpression(operand1)\n                candidate1 = c_long_desc\n            elif candidate2 == int_desc:\n                operand2 = int_desc.getAsLongValueExpression(operand1)\n                candidate2 = c_long_desc\n            else:\n                assert False\n\n        if (\n            target is n_bool_desc\n            and candidate1 is candidate2\n            and candidate1 not in (tuple_desc, list_desc)\n        ):\n            target = c_bool_desc\n\n        return (\n            \"COMPARE_%s_%s_%s_%s\"\n            % (\n                op_code,\n                target.getHelperCodeName(),\n                candidate1.getHelperCodeName(),\n                candidate2.getHelperCodeName(),\n            ),\n            target,\n            candidate1,\n            candidate2,\n            operand1,\n            operand2,\n        )\n\n    def getTypeComparisonSpecializationCode(\n        self, other, op_code, target, operand1, operand2\n    ):\n        if (\n            target is n_bool_desc\n            and self not in (tuple_desc, list_desc)\n            and other not in (tuple_desc, list_desc)\n        ):\n            helper_target = c_bool_desc\n        else:\n            helper_target = target\n\n        (\n            helper_name,\n            _helper_target,\n            _type_desc1,\n            _type_desc2,\n            operand1,\n            operand2,\n        ) = self.getTypeComparisonSpecializationHelper(\n            other=other,\n            op_code=op_code,\n            target=helper_target,\n            operand1=operand1,\n            operand2=operand2,\n        )\n\n        if not helper_name:\n            return \"\"\n\n        assert helper_name != \"COMPARE_GE_NBOOL_INT_INT\"\n\n        if helper_target is target:\n            return \"return %s(%s, %s);\" % (\n                helper_name,\n                operand1,\n                operand2,\n            )\n        else:\n            return \"return %s(%s, %s) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;\" % (\n                helper_name,\n                operand1,\n                operand2,\n            )\n\n    @staticmethod\n    def getTakeReferenceStatement(operand):\n        return \"Py_INCREF(%s);\" % operand\n\n    @classmethod\n    def hasReferenceCounting(cls):\n        return True\n\n    @classmethod\n    def getReturnFromObjectExpressionCode(\n        cls, operand, take_ref=False, check_exception=True\n    ):\n        if check_exception and not (cls.type_name == \"object\" and not take_ref):\n            r = \"\"\"if (unlikely(%s == NULL)) { return %s; }\\n\\n\"\"\" % (\n                operand,\n                cls.getExceptionResultIndicatorValue(),\n            )\n        else:\n            r = \"\"\n\n        return r + cls._getReturnFromObjectExpressionCode(\n            operand=operand, take_ref=take_ref\n        )\n\n    @classmethod\n    def getAssignFromObjectExpressionCode(cls, result, operand, take_ref=False):\n        if cls.type_name == \"object\":\n            if take_ref:\n                return \"Py_INCREF(%s); %s = %s;\" % (operand, result, operand)\n            else:\n                return \"%s = %s;\" % (result, operand)\n        else:\n            if take_ref:\n                return \"\"\"%s = %s; \"\"\" % (\n                    result,\n                    cls.getToValueFromObjectExpression(operand),\n                )\n            else:\n                return \"\"\"%s = %s; Py_DECREF(%s); \"\"\" % (\n                    result,\n                    cls.getToValueFromObjectExpression(operand),\n                    operand,\n                )\n\n    @classmethod\n    def _getReturnFromObjectExpressionCode(cls, operand, take_ref):\n        if cls.type_name == \"object\":\n            if take_ref:\n                return \"Py_INCREF(%s); return %s;\" % (operand, operand)\n            else:\n                return \"return %s;\" % operand\n        else:\n            if take_ref:\n                return \"\"\"{ %s r = %s; return r; }\"\"\" % (\n                    cls.getTypeDecl(),\n                    cls.getToValueFromObjectExpression(operand),\n                )\n            else:\n                return \"\"\"{ %s r = %s; Py_DECREF(%s); return r; }\"\"\" % (\n                    cls.getTypeDecl(),\n                    cls.getToValueFromObjectExpression(operand),\n                    operand,\n                )\n\n    @classmethod\n    def getReturnFromLongExpressionCode(cls, operand):\n        if cls.type_name == \"object\":\n            # Pick one specific.\n            # return \"return PyInt_FromLong(%s);\" % operand\n            assert False\n        elif cls.type_name == \"nbool\":\n            return \"return %s;\" % cls.getToValueFromBoolExpression(\"%s != 0\" % operand)\n        else:\n            assert False, cls\n\n    @classmethod\n    def getAssignFromLongExpressionCode(cls, result, operand):\n        if cls.type_name == \"object\":\n            # Need to not use that, but pick one.\n            assert False\n        elif cls.type_name == \"int\":\n            return \"%s = PyInt_FromLong(%s);\" % (result, operand)\n        elif cls.type_name == \"long\":\n            return \"%s = Nuitka_LongFromCLong(%s);\" % (result, operand)\n        elif cls.type_name == \"nbool\":\n            return \"%s = %s;\" % (\n                result,\n                cls.getToValueFromBoolExpression(\"%s != 0\" % operand),\n            )\n        else:\n            assert False, cls\n\n    @classmethod\n    def getAssignFromBoolExpressionCode(cls, result, operand, give_ref):\n        if cls.type_name == \"object\":\n            # TODO: Python3?\n            code = \"%s = BOOL_FROM(%s);\" % (result, operand)\n            if give_ref:\n                code += \"Py_INCREF(%s);\" % result\n\n            return code\n        elif cls.type_name == \"nbool\":\n            return \"%s = %s;\" % (\n                result,\n                cls.getToValueFromBoolExpression(\"%s\" % operand),\n            )\n        else:\n            assert False, cls\n\n    @classmethod\n    def getReturnFromFloatExpressionCode(cls, operand):\n        if cls.type_name == \"object\":\n            return \"return MAKE_FLOAT_FROM_DOUBLE(%s);\" % operand\n        elif cls.type_name == \"nbool\":\n            return \"return %s;\" % cls.getToValueFromBoolExpression(\n                \"%s == 0.0\" % operand\n            )\n        elif cls.type_name == \"float\":\n            return \"return %s;\" % operand\n        else:\n            assert False, cls\n\n    @classmethod\n    def getAssignFromFloatExpressionCode(cls, result, operand):\n        if cls.type_name in (\"object\", \"int\", \"float\"):\n            return \"%s = MAKE_FLOAT_FROM_DOUBLE(%s);\" % (result, operand)\n        elif cls.type_name == \"nbool\":\n            return \"%s = %s;\" % (\n                result,\n                cls.getToValueFromBoolExpression(\"%s != 0.0\" % operand),\n            )\n        elif cls.type_name == \"float\":\n            return \"%s = %s;\" % (result, operand)\n        else:\n            assert False, cls\n\n    @classmethod\n    def getReturnFromFloatConstantCode(cls, value):\n        if cls.type_name == \"object\":\n            const_name = \"const_\" + namifyConstant(value)\n\n            return \"Py_INCREF(%(const_name)s); return %(const_name)s;\" % {\n                \"const_name\": const_name\n            }\n        elif cls.type_name in (\"nbool\", \"float\"):\n            return cls.getReturnFromFloatExpressionCode(value)\n        else:\n            assert False, cls\n\n    @classmethod\n    def getAssignFromFloatConstantCode(cls, result, value):\n        if value == \"nan\":\n            value = float(value)\n\n        if cls.type_name in (\"object\", \"int\"):\n            # TODO: Type checks for value are needed for \"int\".\n\n            const_name = \"const_\" + namifyConstant(value)\n\n            return \"Py_INCREF(%(const_name)s); %(result)s = %(const_name)s;\" % {\n                \"result\": result,\n                \"const_name\": const_name,\n            }\n        elif cls.type_name in (\"nbool\", \"float\"):\n            if math.isnan(value):\n                value = \"Py_NAN\"\n\n            return cls.getAssignFromFloatExpressionCode(result, value)\n        else:\n            assert False, cls\n\n    @classmethod\n    def getReturnFromIntConstantCode(cls, value):\n        if cls.type_name == \"object\":\n            const_name = \"const_\" + namifyConstant(value)\n\n            return \"Py_INCREF(%(const_name)s); return %(const_name)s;\" % {\n                \"const_name\": const_name\n            }\n        elif cls.type_name in (\"nbool\", \"float\"):\n            return cls.getReturnFromLongExpressionCode(value)\n        else:\n            assert False, cls\n\n    @classmethod\n    def getAssignFromIntConstantCode(cls, result, value):\n        if cls.type_name in (\"object\", \"int\"):\n            const_name = \"const_\" + namifyConstant(value)\n\n            return \"Py_INCREF(%(const_name)s); %(result)s = %(const_name)s;\" % {\n                \"result\": result,\n                \"const_name\": const_name,\n            }\n        elif cls.type_name in (\"nbool\", \"float\"):\n            return cls.getAssignFromLongExpressionCode(result, value)\n        else:\n            assert False, (cls, cls.type_name)\n\n    @classmethod\n    def getAssignFromLongConstantCode(cls, result, value):\n        if cls.type_name in (\"object\", \"long\"):\n            if str is bytes:\n                # Cannot put \"L\" in Jinja code for constant value.\n                value = long(value)\n\n            # The only on we surely know right now.\n            assert value == 0\n\n            # TODO: This works for small constants only and only for Python3.\n            const_name2 = \"const_\" + namifyConstant(value)\n            const_name3 = \"Nuitka_Long_GetSmallValue(%s)\" % value\n\n            assert -5 >= value < 256, value\n\n            return \"\"\"\\\n#if PYTHON_VERSION < 0x300\n%(result)s = %(const_name2)s;\n#else\n%(result)s = %(const_name3)s;\n#endif\nPy_INCREF(%(result)s);\"\"\" % {\n                \"result\": result,\n                \"const_name2\": const_name2,\n                \"const_name3\": const_name3,\n            }\n        elif cls.type_name in (\"nbool\", \"float\"):\n            return cls.getAssignFromLongExpressionCode(result, value)\n        else:\n            assert False, (cls, cls.type_name)\n\n    @classmethod\n    def getAssignConversionCode(cls, result, left, value):\n        def _getObjectObject():\n            code = \"%s = %s;\" % (result, value)\n            code += cls.getTakeReferenceStatement(result)\n\n            return code\n\n        if cls is left:\n            return _getObjectObject()\n        else:\n            if cls.type_name in (\"object\", \"float\"):\n                if left.type_name in (\"int\", \"float\"):\n                    return _getObjectObject()\n                elif left.type_name == \"clong\":\n                    return cls.getAssignFromLongExpressionCode(result, value)\n                else:\n                    assert False, left.type_name\n            elif cls.type_name == \"nbool\":\n                if left.type_name == \"int\":\n                    return \"%s = %s;\" % (\n                        result,\n                        cls.getToValueFromBoolExpression(\n                            \"%s != 0\" % left.getAsLongValueExpression(value)\n                        ),\n                    )\n                elif left.type_name == \"float\":\n                    return \"%s = %s;\" % (\n                        result,\n                        cls.getToValueFromBoolExpression(\n                            \"%s != 0.0\" % left.getAsDoubleValueExpression(value)\n                        ),\n                    )\n                else:\n                    assert False, left.type_name\n            else:\n                assert False, cls.type_name\n\n\nclass ConcreteTypeBase(TypeDescBase):\n    type_decl = \"PyObject *\"\n\n    def _getSlotValueExpression(self, operand, slot):\n        if slot.startswith(\"nb_\"):\n            return self.getTypeValueExpression(operand)[1:] + \".tp_as_number->\" + slot\n        elif slot.startswith(\"sq_\"):\n            return self.getTypeValueExpression(operand)[1:] + \".tp_as_sequence->\" + slot\n        elif slot.startswith(\"tp_\"):\n            return self.getTypeValueExpression(operand)[1:] + \".\" + slot\n        else:\n            assert False, slot\n\n    def getCheckValueCode(self, operand):\n        return \"\"\"\\\nCHECK_OBJECT(%(operand)s);\nassert(%(type_name)s_CheckExact(%(operand)s));\"\"\" % {\n            \"operand\": operand,\n            \"type_name\": self.getTypeValueExpression(operand)[1:].split(\"_\")[0],\n        }\n\n    @abstractmethod\n    def getTypeValueExpression(self, operand):\n        pass\n\n    @staticmethod\n    def getTakeReferenceStatement(operand):\n        return \"\"\n\n\nclass ConcreteNonSequenceTypeBase(ConcreteTypeBase):\n    \"\"\"Base class for concrete types that are not sequences.\"\"\"\n\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    def getNoSequenceSlotAccessTestCode(self, type_name):\n        \"\"\"Test if type has no sequence slots at all.\"\"\"\n        return \"true\"\n\n\nclass ConcreteSequenceTypeBase(ConcreteTypeBase):\n    \"\"\"Base class for concrete types that are sequences.\"\"\"\n\n    # Base classes can be abstract, pylint: disable=abstract-method\n\n    def getNoSequenceSlotAccessTestCode(self, type_name):\n        \"\"\"Test if type has no sequence slots at all.\"\"\"\n        return \"false\"\n\n\nclass IntDesc(ConcreteNonSequenceTypeBase):\n    type_name = \"int\"\n    type_desc = \"Python2 'int'\"\n\n    python_requirement = \"PYTHON_VERSION < 0x300\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyInt_Type\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"1\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_inplace\"):\n            return False\n        elif slot.startswith(\"nb_\"):\n            return slot != \"nb_matrix_multiply\"\n        elif slot.startswith(\"sq_\"):\n            return False\n        elif slot == \"tp_richcompare\":\n            return False\n        elif slot == \"tp_compare\":\n            return True\n        else:\n            assert False\n\n    @staticmethod\n    def needsIndexConversion():\n        return False\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return \"PyInt_AS_LONG(%s)\" % operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def releaseAsObjectValueStatement(operand):\n        # Virtual method, pylint: disable=unused-argument\n        return \"\"\n\n\nint_desc = IntDesc()\n\n\nclass StrDesc(ConcreteSequenceTypeBase):\n    type_name = \"str\"\n    type_desc = \"Python2 'str'\"\n\n    python_requirement = \"PYTHON_VERSION < 0x300\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyString_Type\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"1\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return slot == \"nb_remainder\"\n        elif slot.startswith(\"sq_\"):\n            return \"ass\" not in slot and \"inplace\" not in slot\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return False\n        else:\n            assert False, (self, slot)\n\n    def hasPreferredSlot(self, right, slot):\n        if slot == \"nb_multiply\":\n            return right in (int_desc, long_desc)\n\n        return False\n\n\nstr_desc = StrDesc()\n\n\nclass UnicodeDesc(ConcreteSequenceTypeBase):\n    type_name = \"unicode\"\n    type_desc = \"Python2 'unicode', Python3 'str'\"\n\n    @classmethod\n    def getTypeName3(cls):\n        return \"str\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyUnicode_Type\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\"\\\nCHECK_OBJECT(%(operand)s);\nassert(PyUnicode_CheckExact(%(operand)s));\"\"\" % {\n            \"operand\": operand\n        }\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"1\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return slot == \"nb_remainder\"\n        elif slot.startswith(\"sq_\"):\n            return \"ass\" not in slot and \"inplace\" not in slot\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return True\n        else:\n            assert False, slot\n\n    def hasPreferredSlot(self, right, slot):\n        # TODO: Same applies to bytearray once we add it.\n        if slot == \"sq_concat\" and right is str_desc:\n            return True\n\n        if slot == \"nb_multiply\":\n            return right in (int_desc, long_desc)\n\n        return False\n\n\nunicode_desc = UnicodeDesc()\n\n\nclass FloatDesc(ConcreteNonSequenceTypeBase):\n    type_name = \"float\"\n    type_desc = \"Python 'float'\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyFloat_Type\"\n\n    @staticmethod\n    def getAsDoubleValueExpression(operand):\n        return \"PyFloat_AS_DOUBLE(%s)\" % operand\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_inplace\"):\n            return False\n        elif slot.startswith(\"nb_\"):\n            return slot != \"nb_matrix_multiply\"\n        elif slot.startswith(\"sq_\"):\n            return False\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return False\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"1\"\n\n    def hasPreferredSlot(self, right, slot):\n        if right in (int_desc, long_desc):\n            return True\n\n        return False\n\n\nfloat_desc = FloatDesc()\n\n\nclass TupleDesc(ConcreteSequenceTypeBase):\n    type_name = \"tuple\"\n    type_desc = \"Python 'tuple'\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyTuple_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return False\n        elif slot.startswith(\"sq_\"):\n            return \"ass\" not in slot and \"inplace\" not in slot\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return False\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    def hasPreferredSlot(self, right, slot):\n        if slot == \"nb_multiply\":\n            return right in (int_desc, long_desc)\n\n        return False\n\n\ntuple_desc = TupleDesc()\n\n\nclass ListDesc(ConcreteSequenceTypeBase):\n    type_name = \"list\"\n    type_desc = \"Python 'list'\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyList_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return False\n        elif slot.startswith(\"sq_\"):\n            return True\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return False\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    def hasPreferredSlot(self, right, slot):\n        if slot == \"nb_multiply\":\n            return right in (int_desc, long_desc)\n\n        return False\n\n\nlist_desc = ListDesc()\n\n\nclass SetDesc(ConcreteSequenceTypeBase):\n    type_name = \"set\"\n    type_desc = \"Python 'set'\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PySet_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_inplace_\"):\n            return slot in (\n                \"nb_inplace_subtract\",\n                \"nb_inplace_and\",\n                \"nb_inplace_or\",\n                \"nb_inplace_xor\",\n            )\n        elif slot.startswith(\"nb_\"):\n            return slot in (\"nb_subtract\", \"nb_and\", \"nb_or\", \"nb_xor\")\n        elif slot.startswith(\"sq_\"):\n            return True\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n\nset_desc = SetDesc()\n\n\nclass DictDesc(ConcreteSequenceTypeBase):\n    type_name = \"dict\"\n    type_desc = \"Python 'dict'\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyDict_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return False\n        elif slot.startswith(\"sq_\"):\n            return True\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n\ndict_desc = DictDesc()\n\n\nclass BytesDesc(ConcreteSequenceTypeBase):\n    type_name = \"bytes\"\n    type_desc = \"Python3 'bytes'\"\n\n    python_requirement = \"PYTHON_VERSION >= 0x300\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyBytes_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_\"):\n            return slot == \"nb_remainder\"\n        elif slot.startswith(\"sq_\"):\n            return \"ass\" not in slot and slot != \"sq_slice\" and \"inplace\" not in slot\n        elif slot == \"tp_richcompare\":\n            return True\n        elif slot == \"tp_compare\":\n            return False\n        else:\n            assert False, slot\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    def hasPreferredSlot(self, right, slot):\n        if slot == \"nb_multiply\":\n            return right in (int_desc, long_desc)\n\n        return False\n\n\nbytes_desc = BytesDesc()\n\n\nclass LongDesc(ConcreteNonSequenceTypeBase):\n    type_name = \"long\"\n    type_desc = \"Python2 'long', Python3 'int'\"\n\n    @classmethod\n    def getTypeName3(cls):\n        return \"int\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"&PyLong_Type\"\n\n    def hasSlot(self, slot):\n        if slot.startswith(\"nb_inplace_\"):\n            return False\n        elif slot.startswith(\"nb_\"):\n            return slot != \"nb_matrix_multiply\"\n        elif slot.startswith(\"sq_\"):\n            return False\n        elif slot == \"tp_richcompare\":\n            assert False\n            # For Python3 it's there though\n            return False\n        elif slot == \"tp_compare\":\n            # For Python2 it's tp_compare though\n            return True\n        else:\n            assert False, slot\n\n    def getSlotValueExpression(self, operand, slot):\n        # Python2 long does have \"tp_compare\", Python3 does have \"tp_richcompare\",\n        # therefore create code that makes this a conditional expression on the\n        # Python version\n        if slot == \"tp_richcompare\":\n            return \"(PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare)\"\n\n        return ConcreteTypeBase.getSlotValueExpression(self, operand=operand, slot=slot)\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"1\"\n\n    @staticmethod\n    def needsIndexConversion():\n        return False\n\n    def hasPreferredSlot(self, right, slot):\n        if right is int_desc:\n            return True\n\n        return False\n\n    @staticmethod\n    def getLongValueSizeExpression(operand):\n        return \"Py_SIZE(%s_long_object)\" % operand\n\n    @staticmethod\n    def getLongValueIsNegativeTestExpression(operand):\n        return \"Py_SIZE(%s_long_object) < 0\" % operand\n\n    @staticmethod\n    def getLongValueDigitCountExpression(operand):\n        return \"Py_ABS(Py_SIZE(%s_long_object))\" % operand\n\n    @staticmethod\n    def getLongValueDigitExpression(operand, index):\n        return \"Nuitka_LongGetDigitPointer(%s_long_object)[%s]\" % (operand, index)\n\n    @staticmethod\n    def getLongValueDigitsPointerExpression(operand):\n        return \"Nuitka_LongGetDigitPointer(%s_long_object)\" % operand\n\n    @staticmethod\n    def getLongValueMediumValueExpression(operand):\n        return \"MEDIUM_VALUE(%s_long_object)\" % (operand)\n\n\nlong_desc = LongDesc()\n\n\nclass ObjectDesc(TypeDescBase):\n    type_name = \"object\"\n    type_desc = \"any Python object\"\n    type_decl = \"PyObject *\"\n\n    def hasSlot(self, slot):\n        # Don't want to get asked, we cannot know.\n        assert False\n\n    def getIndexCheckExpression(self, operand):\n        return \"Nuitka_Index_Check(%s)\" % operand\n\n    def getNewStyleNumberTypeCheckExpression(self, operand):\n        return \"NEW_STYLE_NUMBER_TYPE(%s)\" % operand\n\n    def getSlotValueExpression(self, operand, slot):\n        # Always check.\n        return self._getSlotValueExpression(operand, slot)\n\n    def getSlotValueCheckExpression(self, operand, slot):\n        return \"(%s) != NULL\" % self._getSlotValueExpression(operand, slot)\n\n    @staticmethod\n    def getToValueFromBoolExpression(operand):\n        return \"BOOL_FROM(%s)\" % operand\n\n    @staticmethod\n    def getToValueFromObjectExpression(operand):\n        return operand\n\n    @staticmethod\n    def getExceptionResultIndicatorValue():\n        return \"NULL\"\n\n    def getNoSequenceSlotAccessTestCode(self, type_name):\n        return \"%s->tp_as_sequence == NULL\" % type_name\n\n\nobject_desc = ObjectDesc()\n\n\nclass ConcreteCTypeBase(TypeDescBase):\n    \"\"\"Base class for non-Python (C) concrete types.\"\"\"\n\n    def hasSlot(self, slot):\n        return False\n\n    def getNoSequenceSlotAccessTestCode(self, type_name):\n        assert False, self\n\n    def getNewStyleNumberTypeCheckExpression(self, operand):\n        # We don't have that.\n        assert False, self\n\n    @classmethod\n    def hasReferenceCounting(cls):\n        return False\n\n    @staticmethod\n    def hasPreferredSlot(right, slot):\n        return False\n\n\nclass CLongDesc(ConcreteCTypeBase):\n    type_name = \"clong\"\n    type_desc = \"C platform long value\"\n    type_decl = \"long\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"NULL\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        return \"PyLong_FromLong(%s)\" % operand\n\n    @staticmethod\n    def releaseAsObjectValueStatement(operand):\n        return \"Py_DECREF(%s);\" % operand\n\n    @staticmethod\n    def getLongValueSizeExpression(operand):\n        return \"%s_size\" % operand\n\n    @staticmethod\n    def getLongValueIsNegativeTestExpression(operand):\n        return \"%s_is_negative\" % operand\n\n    @staticmethod\n    def getLongValueDigitCountExpression(operand):\n        return \"%s_digit_count\" % operand\n\n    @staticmethod\n    def getLongValueDigitExpression(operand, index):\n        return \"%s_digits[%s]\" % (operand, index)\n\n    @staticmethod\n    def getLongValueDigitsPointerExpression(operand):\n        return \"%s_digits\" % operand\n\n    @staticmethod\n    def getLongValueMediumValueExpression(operand):\n        # spell-checker: disable=sdigit\n        return \"(sdigit)%s\" % (operand)\n\n\nc_long_desc = CLongDesc()\n\n\nclass CDigitDesc(CLongDesc):\n    type_name = \"digit\"\n    type_desc = \"C platform digit value for long Python objects\"\n    type_decl = \"long\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"assert(Py_ABS(%s) < (1 << PyLong_SHIFT));\" % operand\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return \"(long)(%s)\" % operand\n\n    @staticmethod\n    def getLongValueDigitCountExpression(operand):\n        # Can be 0 or 1.\n        return \"(%s == 0 ? 0 : 1)\" % operand\n\n    @staticmethod\n    def getLongValueSizeExpression(operand):\n        return (\n            \"(Py_ssize_t)((%(operand)s == 0) ? 0 : ((%(operand)s < 0 ) ? -1 : 1))\"\n            % {\"operand\": operand}\n        )\n\n    @staticmethod\n    def getLongValueIsNegativeTestExpression(operand):\n        return \"%s < 0\" % operand\n\n    @staticmethod\n    def getLongValueDigitExpression(operand, index):\n        return \"(digit)Py_ABS(%s)\" % operand\n\n    @staticmethod\n    def getLongValueDigitsPointerExpression(operand):\n        return \"(digit *)&%s\" % operand\n\n\nc_digit_desc = CDigitDesc()\n\n\nclass CBoolDesc(ConcreteCTypeBase):\n    type_name = \"cbool\"\n    type_desc = \"C platform bool value\"\n    type_decl = \"bool\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"NULL\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        return \"BOOL_FROM(%s)\" % operand\n\n    @staticmethod\n    def getToValueFromBoolExpression(operand):\n        return operand\n\n    @staticmethod\n    def getToValueFromObjectExpression(operand):\n        return \"CHECK_IF_TRUE(%s) == 1\" % operand\n\n    @staticmethod\n    def getTakeReferenceStatement(operand):\n        return \"\"\n\n    @staticmethod\n    def getExceptionResultIndicatorValue():\n        return \"false\"\n\n\nc_bool_desc = CBoolDesc()\n\n\nclass NBoolDesc(ConcreteCTypeBase):\n    type_name = \"nbool\"\n    type_desc = \"Nuitka C bool value\"\n    type_decl = \"nuitka_bool\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"NULL\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        return \"BOOL_FROM(%s)\" % operand\n\n    @staticmethod\n    def getToValueFromBoolExpression(operand):\n        return \"%s ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE\" % operand\n\n    @classmethod\n    def getToValueFromObjectExpression(cls, operand):\n        # TODO: Seems wrong, int return values only happen to match nuitka_bool here\n        return cls.getToValueFromBoolExpression(\"CHECK_IF_TRUE(%s)\" % operand)\n\n    @staticmethod\n    def getTakeReferenceStatement(operand):\n        return \"\"\n\n    @staticmethod\n    def getExceptionResultIndicatorValue():\n        return \"NUITKA_BOOL_EXCEPTION\"\n\n\nn_bool_desc = NBoolDesc()\n\n\nclass NVoidDesc(ConcreteCTypeBase):\n    type_name = \"nvoid\"\n    type_desc = \"Nuitka C void value\"\n    type_decl = \"nuitka_void\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"NULL\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        assert False\n\n        return operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        assert False\n\n        return \"BOOL_FROM(%s)\" % operand\n\n    @staticmethod\n    def getToValueFromBoolExpression(operand):\n        # All values are the same, pylint: disable=unused-argument\n        return \"NUITKA_VOID_OK\"\n\n    @classmethod\n    def getToValueFromObjectExpression(cls, operand):\n        # All values are the same, pylint: disable=unused-argument\n        return \"NUITKA_VOID_OK\"\n\n    @staticmethod\n    def getTakeReferenceStatement(operand):\n        return \"\"\n\n    @staticmethod\n    def getExceptionResultIndicatorValue():\n        return \"NUITKA_VOID_EXCEPTION\"\n\n\nnvoid_desc = NVoidDesc()\n\n\nclass CFloatDesc(ConcreteCTypeBase):\n    type_name = \"cfloat\"\n    type_desc = \"C platform float value\"\n    type_decl = \"double\"\n\n    @classmethod\n    def getCheckValueCode(cls, operand):\n        return \"\"\n\n    @classmethod\n    def getTypeValueExpression(cls, operand):\n        return \"NULL\"\n\n    @classmethod\n    def getNewStyleNumberTypeCheckExpression(cls, operand):\n        return \"0\"\n\n    @staticmethod\n    def getAsLongValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def getAsDoubleValueExpression(operand):\n        return operand\n\n    @staticmethod\n    def getAsObjectValueExpression(operand):\n        return \"MAKE_FLOAT_FROM_DOUBLE(%s)\" % operand\n\n    @staticmethod\n    def releaseAsObjectValueStatement(operand):\n        return \"Py_DECREF(%s);\" % operand\n\n\nc_float_desc = CFloatDesc()\n\n\nrelated_types = {}\n\n\ndef _addRelatedTypes(type_desc_1, type_desc_2):\n    related_types[type_desc_1] = (type_desc_2,)\n    related_types[type_desc_2] = (type_desc_1,)\n\n\n_addRelatedTypes(int_desc, c_long_desc)\n_addRelatedTypes(long_desc, c_digit_desc)\n_addRelatedTypes(float_desc, c_float_desc)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/Common.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Common helper functions for specializing code.\"\"\"\n\nfrom nuitka.Constants import the_empty_unicode\nfrom nuitka.tools.quality.auto_format.AutoFormat import (  # For import from here, pylint: disable=unused-import\n    withFileOpenedAndAutoFormatted,\n)\n\n\ndef writeLine(output, *args):\n    if not args:\n        output.write(\"\\n\")\n    elif len(args) == 1:\n        output.write(args[0] + \"\\n\")\n    else:\n        assert False, args\n\n\n# Python2 dict methods:\npython2_dict_methods = (  # we have full coverage for all methods\n    \"clear\",\n    \"copy\",\n    \"fromkeys\",\n    \"get\",\n    \"has_key\",\n    \"items\",\n    \"iteritems\",\n    \"iterkeys\",\n    \"itervalues\",\n    \"keys\",\n    \"pop\",\n    \"popitem\",\n    \"setdefault\",\n    \"update\",\n    \"values\",\n    \"viewitems\",\n    \"viewkeys\",\n    \"viewvalues\",\n)\n\npython3_dict_methods = (\n    # see Python2 methods, these are only less\n    \"clear\",\n    \"copy\",\n    \"fromkeys\",\n    \"get\",\n    \"items\",\n    \"keys\",\n    \"pop\",\n    \"popitem\",\n    \"setdefault\",\n    \"update\",\n    \"values\",\n)\n\npython2_str_methods = (  # we have full coverage for all methods\n    \"capitalize\",\n    \"center\",\n    \"count\",\n    \"decode\",\n    \"encode\",\n    \"endswith\",\n    \"expandtabs\",\n    \"find\",\n    \"format\",\n    \"index\",\n    \"isalnum\",\n    \"isalpha\",\n    \"isdigit\",\n    \"islower\",\n    \"isspace\",\n    \"istitle\",\n    \"isupper\",\n    \"join\",\n    \"ljust\",\n    \"lower\",\n    \"lstrip\",\n    \"partition\",\n    \"replace\",\n    \"rfind\",\n    \"rindex\",\n    \"rjust\",\n    \"rpartition\",\n    \"rsplit\",\n    \"rstrip\",\n    \"split\",\n    \"splitlines\",\n    \"startswith\",\n    \"strip\",\n    \"swapcase\",\n    \"title\",\n    \"translate\",\n    \"upper\",\n    \"zfill\",\n)\n\npython3_str_methods = (  # we have full coverage for all methods\n    \"capitalize\",\n    \"casefold\",\n    \"center\",\n    \"count\",\n    \"encode\",\n    \"endswith\",\n    \"expandtabs\",\n    \"find\",\n    \"format\",\n    \"format_map\",\n    \"index\",\n    \"isalnum\",\n    \"isalpha\",\n    \"isascii\",\n    \"isdecimal\",\n    \"isdigit\",\n    \"isidentifier\",\n    \"islower\",\n    \"isnumeric\",\n    \"isprintable\",\n    \"isspace\",\n    \"istitle\",\n    \"isupper\",\n    \"join\",\n    \"ljust\",\n    \"lower\",\n    \"lstrip\",\n    \"maketrans\",\n    \"partition\",\n    # TODO: Python3.9 or higher:\n    # \"removeprefix\",\n    # \"removesuffix\",\n    \"replace\",\n    \"rfind\",\n    \"rindex\",\n    \"rjust\",\n    \"rpartition\",\n    \"rsplit\",\n    \"rstrip\",\n    \"split\",\n    \"splitlines\",\n    \"startswith\",\n    \"strip\",\n    \"swapcase\",\n    \"title\",\n    \"translate\",\n    \"upper\",\n    \"zfill\",\n)\n\npython2_unicode_methods = (\n    \"capitalize\",\n    \"center\",\n    \"count\",\n    \"decode\",\n    \"encode\",\n    \"endswith\",\n    \"expandtabs\",\n    \"find\",\n    \"format\",\n    \"index\",\n    \"isalnum\",\n    \"isalpha\",\n    \"isdecimal\",\n    \"isdigit\",\n    \"islower\",\n    \"isnumeric\",\n    \"isspace\",\n    \"istitle\",\n    \"isupper\",\n    \"join\",\n    \"ljust\",\n    \"lower\",\n    \"lstrip\",\n    \"partition\",\n    \"replace\",\n    \"rfind\",\n    \"rindex\",\n    \"rjust\",\n    \"rpartition\",\n    \"rsplit\",\n    \"rstrip\",\n    \"split\",\n    \"splitlines\",\n    \"startswith\",\n    \"strip\",\n    \"swapcase\",\n    \"title\",\n    \"translate\",\n    \"upper\",\n    \"zfill\",\n)\n\npython3_bytes_methods = (\n    \"capitalize\",\n    \"center\",\n    \"count\",\n    \"decode\",\n    \"endswith\",\n    \"expandtabs\",\n    \"find\",\n    # static method\n    # \"fromhex\",\n    # TODO: Python3.5 or higher:\n    # \"hex\",\n    \"index\",\n    \"isalnum\",\n    \"isalpha\",\n    \"isdigit\",\n    \"islower\",\n    \"isspace\",\n    \"istitle\",\n    \"isupper\",\n    # TODO: Python3.7 or higher:\n    # \"ishex\",\n    # \"isascii\",\n    \"join\",\n    \"ljust\",\n    \"lower\",\n    \"lstrip\",\n    # static method\n    # \"maketrans\",\n    \"partition\",\n    # TODO: Python3.9 or higher:\n    # \"removeprefix\",\n    # \"removesuffix\",\n    \"replace\",\n    \"rfind\",\n    \"rindex\",\n    \"rjust\",\n    \"rpartition\",\n    \"rsplit\",\n    \"rstrip\",\n    \"split\",\n    \"splitlines\",\n    \"startswith\",\n    \"strip\",\n    \"swapcase\",\n    \"title\",\n    \"translate\",\n    \"upper\",\n    \"zfill\",\n)\n\npython2_list_methods = (\n    \"append\",\n    \"count\",\n    \"extend\",\n    \"index\",\n    \"insert\",\n    \"pop\",\n    \"remove\",\n    \"reverse\",\n    \"sort\",\n)\n\npython3_list_methods = (\n    \"append\",\n    \"clear\",\n    \"copy\",\n    \"count\",\n    \"extend\",\n    \"index\",\n    \"insert\",\n    \"pop\",\n    \"remove\",\n    \"reverse\",\n    \"sort\",\n)\n\npython2_type_methods = (\n    # TODO: Totally incomplete\n)\n\npython3_type_methods = (\n    # TODO: Totally incomplete\n    \"__prepare__\",\n)\n\n\ndef getMethodVariations(spec_module, shape_name, method_name, must_exist=False):\n    spec_name = shape_name.split(\"_\")[-1] + \"_\" + method_name + \"_spec\"\n    spec = getattr(spec_module, spec_name, None)\n\n    present = spec is not None\n\n    if not present and must_exist:\n        assert False, spec_name\n\n    if present:\n        if spec.isStarListSingleArg():\n            required = 1\n\n            arg_counts = tuple(range(required, required + 2))\n\n            arg_names = (\n                spec.getStarListArgumentName(),\n                spec.getStarDictArgumentName(),\n            )\n\n            arg_name_mapping = {\n                \"list_args\": spec.getStarListArgumentName(),\n            }\n        else:\n            required = spec.getArgumentCount() - spec.getDefaultCount()\n\n            arg_counts = tuple(range(required, spec.getArgumentCount() + 1))\n\n            arg_names = spec.getParameterNames()\n            arg_name_mapping = {}\n\n        arg_tests = [\n            (\n                \"\"\n                if arg_name\n                in (spec.getStarListArgumentName(), spec.getStarDictArgumentName())\n                else \"is not None\"\n            )\n            for arg_name in arg_names\n        ]\n\n        result_shape = spec.getTypeShape()\n\n    else:\n        arg_names = arg_name_mapping = arg_counts = arg_tests = result_shape = None\n\n    return present, arg_names, arg_tests, arg_name_mapping, arg_counts, result_shape\n\n\ndef getSpecs(spec_module):\n    for name in sorted(dir(spec_module)):\n        if name.endswith(\"_spec\"):\n            yield name, getattr(spec_module, name)\n\n\ndef formatArgs(args, starting=True, finishing=True, quoted=False):\n    result = []\n    if args:\n        if not starting:\n            result.append(\",\")\n\n        for arg in args:\n            result.append('\"%s\"' % arg if quoted else arg)\n\n            if arg is not args[-1] or not finishing:\n                result.append(\",\")\n\n    return \"\".join(result)\n\n\ndef check():\n    if str is bytes:\n        for method_name in python2_str_methods:\n            assert hasattr(\"\", method_name), method_name\n        for method_name in python2_unicode_methods:\n            assert hasattr(the_empty_unicode, method_name), method_name\n        for method_name in python2_dict_methods:\n            assert hasattr({}, method_name), method_name\n    else:\n        for method_name in python3_str_methods:\n            assert hasattr(\"\", method_name), method_name\n        for method_name in python3_dict_methods:\n            assert hasattr({}, method_name), method_name\n\n\ncheck()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/SpecializeC.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This tool is generating code variants for helper codes from Jinja templates.\n\n\"\"\"\n\nimport nuitka.Options\n\nnuitka.Options.is_full_compat = False\n\n# isort:start\n\nimport os\n\nimport nuitka.specs.BuiltinBytesOperationSpecs\nimport nuitka.specs.BuiltinDictOperationSpecs\nimport nuitka.specs.BuiltinListOperationSpecs\nimport nuitka.specs.BuiltinStrOperationSpecs\nimport nuitka.specs.BuiltinUnicodeOperationSpecs\nfrom nuitka.code_generation.BinaryOperationHelperDefinitions import (\n    getSpecializedBinaryOperations,\n    parseTypesFromHelper,\n)\nfrom nuitka.code_generation.c_types.CTypePyObjectPointers import (\n    make_list_constant_direct_threshold,\n    make_list_constant_hinted_threshold,\n)\nfrom nuitka.code_generation.CallCodes import (\n    getQuickCallCode,\n    getQuickMethodCallCode,\n    getQuickMethodDescriptorCallCode,\n    getQuickMixedCallCode,\n    getTemplateCodeDeclaredFunction,\n    max_quick_call,\n)\nfrom nuitka.code_generation.ComparisonHelperDefinitions import (\n    getSpecializedComparisonOperations,\n)\nfrom nuitka.code_generation.ImportCodes import getImportModuleHardCodeName\nfrom nuitka.HardImportRegistry import (\n    hard_modules,\n    hard_modules_non_stdlib,\n    hard_modules_version,\n)\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_dict,\n    tshape_int,\n    tshape_list,\n    tshape_none,\n    tshape_str,\n    tshape_tuple,\n)\nfrom nuitka.utils.Jinja2 import getTemplateC\n\nfrom .Common import (\n    formatArgs,\n    getMethodVariations,\n    python2_dict_methods,\n    python2_list_methods,\n    python2_str_methods,\n    python2_unicode_methods,\n    python3_bytes_methods,\n    python3_dict_methods,\n    python3_list_methods,\n    python3_str_methods,\n    withFileOpenedAndAutoFormatted,\n    writeLine,\n)\nfrom .CTypeDescriptions import (\n    bytes_desc,\n    c_bool_desc,\n    c_digit_desc,\n    c_float_desc,\n    c_long_desc,\n    dict_desc,\n    float_desc,\n    int_desc,\n    list_desc,\n    long_desc,\n    n_bool_desc,\n    object_desc,\n    set_desc,\n    str_desc,\n    tuple_desc,\n    unicode_desc,\n)\n\n\ndef getDoExtensionUsingTemplateC(template_name):\n    return getTemplateC(\n        package_name=\"nuitka.code_generation\",\n        template_subdir=\"templates_c\",\n        template_name=template_name,\n        extensions=(\"jinja2.ext.do\",),\n    )\n\n\nclass AlternativeTypeBase(object):\n    # TODO: Base class for alternative types\n    pass\n\n\nclass AlternativeIntOrClong(AlternativeTypeBase):\n    # TODO: Base class for alternative type int or clong.\n    pass\n\n\ntypes = (\n    int_desc,\n    str_desc,\n    unicode_desc,\n    float_desc,\n    tuple_desc,\n    list_desc,\n    set_desc,\n    dict_desc,\n    bytes_desc,\n    long_desc,\n    c_long_desc,\n    c_digit_desc,\n    c_float_desc,\n    c_bool_desc,\n    n_bool_desc,\n    object_desc,\n)\n\n\ndef findTypeFromCodeName(code_name):\n    for candidate in types:\n        if candidate.getHelperCodeName() == code_name:\n            return candidate\n\n\nop_slot_codes = set()\n\n# Reverse operation mapping.\nreversed_args_compare_op_codes = {\n    \"LE\": \"GE\",\n    \"LT\": \"GT\",\n    \"EQ\": \"EQ\",\n    \"NE\": \"NE\",\n    \"GT\": \"LT\",\n    \"GE\": \"LE\",\n}\n\n\ndef makeCompareSlotCode(operator, op_code, target, left, right, emit):\n    # Many variations to consider, pylint: disable=too-many-branches\n\n    key = operator, op_code, target, left, right\n    if key in op_slot_codes:\n        return\n\n    int_types_family = (int_desc, c_long_desc)\n    long_types_family = (int_desc, long_desc, c_long_desc, c_digit_desc)\n    float_types_family = (int_desc, long_desc, float_desc, c_long_desc, c_float_desc)\n\n    if left in int_types_family and right in int_types_family:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonInt.c.j2\")\n    elif left in long_types_family and right in long_types_family:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonLong.c.j2\")\n    elif left in float_types_family and right in float_types_family:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonFloat.c.j2\")\n    elif left == int_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonInt.c.j2\")\n    elif left == long_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonLong.c.j2\")\n    elif left == float_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonFloat.c.j2\")\n    elif left == tuple_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonTuple.c.j2\")\n    elif left == list_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonList.c.j2\")\n    # elif left == set_desc:\n    #     template = env.get_template(\"HelperOperationComparisonSet.c.j2\")\n    elif left == bytes_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonBytes.c.j2\")\n    elif left == str_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonStr.c.j2\")\n    elif left == unicode_desc:\n        template = getDoExtensionUsingTemplateC(\"HelperOperationComparisonUnicode.c.j2\")\n    else:\n        return\n\n    assert left is not int_desc or right is not int_desc or target is not n_bool_desc\n\n    code = template.render(\n        operand=operator,  # TODO: rename\n        target=target,\n        left=left,\n        right=right,\n        op_code=op_code,\n        reversed_args_op_code=reversed_args_compare_op_codes[op_code],\n        name=template.name,\n        long_desc=long_desc,\n        c_long_desc=c_long_desc,\n        c_digit_desc=c_digit_desc,\n    )\n\n    emit(code)\n\n    op_slot_codes.add(key)\n\n\nmul_repeats = set()\n\n\ndef makeMulRepeatCode(target, left, right, emit):\n    key = right, left\n    if key in mul_repeats:\n        return\n\n    template = getDoExtensionUsingTemplateC(\"HelperOperationMulRepeatSlot.c.j2\")\n\n    code = template.render(target=target, left=left, right=right)\n\n    emit(code)\n\n    mul_repeats.add(key)\n\n\ndef _getNbSlotFromOperand(operand, op_code):\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    if operand == \"+\":\n        return \"nb_add\"\n    elif operand == \"*\":\n        return \"nb_multiply\"\n    elif operand == \"-\":\n        return \"nb_subtract\"\n    elif operand == \"//\":\n        return \"nb_floor_divide\"\n    elif operand == \"/\":\n        if op_code == \"TRUEDIV\":\n            return \"nb_true_divide\"\n        else:\n            return \"nb_divide\"\n    elif operand == \"%\":\n        return \"nb_remainder\"\n    elif operand == \"**\":\n        return \"nb_power\"\n    elif operand == \"<<\":\n        return \"nb_lshift\"\n    elif operand == \">>\":\n        return \"nb_rshift\"\n    elif operand == \"|\":\n        return \"nb_or\"\n    elif operand == \"&\":\n        return \"nb_and\"\n    elif operand == \"^\":\n        return \"nb_xor\"\n    elif operand == \"@\":\n        return \"nb_matrix_multiply\"\n    elif operand == \"divmod\":\n        return \"nb_divmod\"\n    else:\n        assert False, operand\n\n\ndef _getNbInplaceSlotFromOperand(operand, op_code):\n    if operand == \"divmod\":\n        return None\n\n    nb_slot = _getNbSlotFromOperand(operand, op_code)\n    return nb_slot.replace(\"nb_\", \"nb_inplace_\")\n\n\ndef _parseTypesFromHelper(helper_name):\n    (\n        target_code,\n        left_code,\n        right_code,\n    ) = parseTypesFromHelper(helper_name)\n\n    if target_code is not None:\n        target = findTypeFromCodeName(target_code)\n    else:\n        target = None\n\n    left = findTypeFromCodeName(left_code)\n    right = findTypeFromCodeName(right_code)\n\n    return target_code, target, left, right\n\n\ndef _parseRequirements(op_code, target, left, right, emit):\n    python_requirement = set()\n\n    # There is an obsolete Python2 operation too, making sure it's guarded in code.\n    if op_code == \"OLDDIV\":\n        python_requirement.add(int_desc.python_requirement)\n    if op_code == \"MATMULT\":\n        python_requirement.add(\"PYTHON_VERSION >= 0x350\")\n    if target is not None and target.python_requirement:\n        python_requirement.add(target.python_requirement)\n    if left.python_requirement:\n        python_requirement.add(left.python_requirement)\n    if right.python_requirement:\n        python_requirement.add(right.python_requirement)\n\n    if python_requirement:\n        assert len(python_requirement) == 1, (target, left, right)\n        python_requirement = python_requirement.pop()\n\n        emit(\"#if %s\" % python_requirement)\n\n    return python_requirement\n\n\ndef makeHelperOperations(\n    template, inplace, helpers_set, operator, op_code, emit_h, emit_c, emit\n):\n    # Complexity comes natural, pylint: disable=too-many-locals\n\n    emit(\n        '/* C helpers for type %s \"%s\" (%s) operations */'\n        % (\"in-place\" if inplace else \"specialized\", operator, op_code)\n    )\n    emit()\n\n    for helper_name in helpers_set:\n        target_code, target, left, right = _parseTypesFromHelper(helper_name)\n\n        assert target is None or not inplace, helper_name\n\n        if target is None and not inplace:\n            assert False, target_code\n\n        python_requirement = _parseRequirements(op_code, target, left, right, emit)\n\n        emit(\n            '/* Code referring to \"%s\" corresponds to %s and \"%s\" to %s. */'\n            % (\n                left.getHelperCodeName(),\n                left.type_desc,\n                right.getHelperCodeName(),\n                right.type_desc,\n            )\n        )\n\n        if operator == \"+\":\n            sq_slot = \"sq_concat\"\n        elif operator == \"*\":\n            sq_slot = \"sq_repeat\"\n        else:\n            sq_slot = None\n\n        if inplace and sq_slot is not None:\n            sq_inplace_slot = sq_slot.replace(\"sq_\", \"sq_inplace_\")\n        else:\n            sq_inplace_slot = None\n\n        code = template.render(\n            target=target,\n            left=left,\n            right=right,\n            op_code=op_code,\n            operator=operator,\n            nb_slot=_getNbSlotFromOperand(operator, op_code),\n            nb_inplace_slot=(\n                _getNbInplaceSlotFromOperand(operator, op_code) if inplace else None\n            ),\n            sq_slot=sq_slot,\n            sq_inplace_slot=sq_inplace_slot,\n            object_desc=object_desc,\n            int_desc=int_desc,\n            long_desc=long_desc,\n            float_desc=float_desc,\n            list_desc=list_desc,\n            tuple_desc=tuple_desc,\n            set_desc=set_desc,\n            str_desc=str_desc,\n            unicode_desc=unicode_desc,\n            bytes_desc=bytes_desc,\n            c_long_desc=c_long_desc,\n            c_digit_desc=c_digit_desc,\n        )\n\n        emit_c(code)\n        emit_h(getTemplateCodeDeclaredFunction(code))\n\n        if python_requirement:\n            emit(\"#endif\")\n\n        emit()\n\n\ndef makeHelperComparisons(\n    template, helpers_set, operator, op_code, emit_h, emit_c, emit\n):\n    # Details to look for, pylint: disable=too-many-locals\n\n    emit(\n        '/* C helpers for type specialized \"%s\" (%s) comparisons */'\n        % (operator, op_code)\n    )\n    emit()\n\n    for target in (object_desc, c_bool_desc):\n        python_requirement = _parseRequirements(\n            op_code, target, int_desc, int_desc, emit_c\n        )\n\n        makeCompareSlotCode(operator, op_code, target, int_desc, int_desc, emit_c)\n\n        if python_requirement:\n            emit_c(\"#endif\")\n\n    for helper_name in helpers_set:\n        assert helper_name.split(\"_\")[:2] == [\"RICH\", \"COMPARE\"], (helper_name,)\n\n        # Filter for the operation.\n        if helper_name.split(\"_\")[2] != op_code:\n            continue\n\n        _target_code, target, left, right = _parseTypesFromHelper(helper_name)\n\n        assert target is not None, helper_name\n        assert left is not None, helper_name\n        assert right is not None, helper_name\n\n        python_requirement = _parseRequirements(op_code, target, left, right, emit)\n\n        (\n            code,\n            helper_target,\n            type_desc1,\n            type_desc2,\n            _operand1,\n            _operand2,\n        ) = left.getTypeComparisonSpecializationHelper(\n            other=right,\n            op_code=op_code,\n            target=target,\n            operand1=\"operand1\",\n            operand2=\"operand2\",\n        )\n\n        if code:\n            makeCompareSlotCode(\n                operator, op_code, helper_target, type_desc1, type_desc2, emit_c\n            )\n\n        emit(\n            '/* Code referring to \"%s\" corresponds to %s and \"%s\" to %s. */'\n            % (\n                left.getHelperCodeName(),\n                left.type_desc,\n                right.getHelperCodeName(),\n                right.type_desc,\n            )\n        )\n\n        if not python_requirement:\n            is_py3_only = False\n            is_py2_only = False\n        elif python_requirement == \"PYTHON_VERSION < 0x300\":\n            is_py3_only = False\n            is_py2_only = True\n        elif python_requirement == \"PYTHON_VERSION >= 0x300\":\n            is_py3_only = True\n            is_py2_only = False\n        else:\n            assert False, python_requirement\n\n        code = template.render(\n            target=target,\n            left=left,\n            right=right,\n            op_code=op_code,\n            reversed_args_op_code=reversed_args_compare_op_codes[op_code],\n            operator=operator,\n            is_py3_only=is_py3_only,\n            is_py2_only=is_py2_only,\n            object_desc=object_desc,\n            int_desc=int_desc,\n        )\n\n        emit_c(code)\n        emit_h(getTemplateCodeDeclaredFunction(code))\n\n        if python_requirement:\n            emit(\"#endif\")\n\n        emit()\n\n\ndef emitGenerationWarning(emit, template_name):\n    emit(\n        \"/* WARNING, this code is GENERATED. Modify the template %s instead! */\"\n        % template_name\n    )\n\n\ndef emitIDE(emit):\n    emit(\n        \"\"\"\n/* This file is included from another C file, help IDEs to still parse it on its own. */\n#ifdef __IDE_ONLY__\n#include \"nuitka/prelude.h\"\n#endif\n\"\"\"\n    )\n\n\ndef makeHelpersComparisonOperation(operand, op_code):\n    specialized_cmp_helpers_set = getSpecializedComparisonOperations()\n\n    template = getDoExtensionUsingTemplateC(\"HelperOperationComparison.c.j2\")\n\n    filename_c = \"nuitka/build/static_src/HelpersComparison%s.c\" % op_code.capitalize()\n    filename_h = \"nuitka/build/include/nuitka/helper/comparisons_%s.h\" % op_code.lower()\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            filename_utils = filename_c[:-2] + \"Utils.c\"\n\n            if os.path.exists(filename_utils):\n                emit_c('#include \"%s\"' % os.path.basename(filename_utils))\n\n            makeHelperComparisons(\n                template,\n                specialized_cmp_helpers_set,\n                operand,\n                op_code,\n                emit_h,\n                emit_c,\n                emit,\n            )\n\n\ndef makeHelpersBinaryOperation(operand, op_code):\n    specialized_op_helpers_set = getSpecializedBinaryOperations(op_code)\n\n    template = getDoExtensionUsingTemplateC(\"HelperOperationBinary.c.j2\")\n\n    filename_c = (\n        \"nuitka/build/static_src/HelpersOperationBinary%s.c\" % op_code.capitalize()\n    )\n    filename_h = (\n        \"nuitka/build/include/nuitka/helper/operations_binary_%s.h\" % op_code.lower()\n    )\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            filename_utils = filename_c[:-2] + \"Utils.c\"\n\n            if os.path.exists(filename_utils):\n                emit_c('#include \"%s\"' % os.path.basename(filename_utils))\n\n            makeHelperOperations(\n                template,\n                False,\n                specialized_op_helpers_set,\n                operand,\n                op_code,\n                emit_h,\n                emit_c,\n                emit,\n            )\n\n\ndef makeHelpersInplaceOperation(operand, op_code):\n    specialized_op_helpers_set = getSpecializedBinaryOperations(\"I\" + op_code)\n\n    template = getDoExtensionUsingTemplateC(\"HelperOperationInplace.c.j2\")\n\n    filename_c = (\n        \"nuitka/build/static_src/HelpersOperationInplace%s.c\" % op_code.capitalize()\n    )\n    filename_h = (\n        \"nuitka/build/include/nuitka/helper/operations_inplace_%s.h\" % op_code.lower()\n    )\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            filename_utils = filename_c[:-2] + \"Utils.c\"\n\n            if os.path.exists(filename_utils):\n                emit_c('#include \"%s\"' % os.path.basename(filename_utils))\n\n            makeHelperOperations(\n                template,\n                True,\n                specialized_op_helpers_set,\n                operand,\n                op_code,\n                emit_h,\n                emit_c,\n                emit,\n            )\n\n\ndef makeHelpersImportHard():\n    filename_c = \"nuitka/build/static_src/HelpersImportHard.c\"\n    filename_h = \"nuitka/build/include/nuitka/helper/import_hard.h\"\n\n    template = getDoExtensionUsingTemplateC(\"HelperImportHard.c.j2\")\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            for module_name in sorted(hard_modules):\n                makeHelperImportModuleHard(\n                    template,\n                    module_name,\n                    emit_h,\n                    emit_c,\n                    emit,\n                )\n\n\ndef makeHelperImportModuleHard(template, module_name, emit_h, emit_c, emit):\n    emit('/* C helper for hard import of module \"%s\" import. */' % module_name)\n\n    python_min_max_os_version = hard_modules_version.get(module_name)\n\n    if python_min_max_os_version is not None:\n        assert len(python_min_max_os_version) == 3, module_name\n        python_min_version, python_max_version, os_limit = python_min_max_os_version\n\n        parts = []\n\n        if python_min_version is not None:\n            parts.append(\"PYTHON_VERSION >= %s\" % hex(python_min_version))\n        if python_max_version is not None:\n            parts.append(\"PYTHON_VERSION < %s\" % hex(python_max_version))\n        if os_limit is not None:\n            parts.append({\"win32\": \"defined(_WIN32)\"}[os_limit])\n\n        python_requirement = \" && \".join(parts)\n\n    else:\n        python_requirement = None\n\n    if python_requirement:\n        emit(\"#if %s\" % python_requirement)\n\n    code = template.render(\n        module_name=module_name,\n        module_code_name=getImportModuleHardCodeName(module_name),\n        name=template.name,\n        target=object_desc,\n        is_stdlib=module_name not in hard_modules_non_stdlib,\n    )\n\n    emit_c(code)\n    emit_h(getTemplateCodeDeclaredFunction(code))\n\n    if python_requirement:\n        emit(\"#endif\")\n\n    emit()\n\n\ndef makeHelperCalls():\n    filename_c = \"nuitka/build/static_src/HelpersCallingGenerated.c\"\n    filename_h = \"nuitka/build/include/nuitka/helper/calling_generated.h\"\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                assert args[0] != \"extern \"\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            template = getTemplateC(\n                \"nuitka.code_generation\", \"CodeTemplateCallsPositional.c.j2\"\n            )\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            for args_count in range(max_quick_call + 1):\n                code = getQuickCallCode(args_count=args_count, has_tuple_arg=False)\n\n                emit_c(code)\n                emit_h(getTemplateCodeDeclaredFunction(code))\n\n                if args_count >= 1:\n                    code = getQuickCallCode(args_count=args_count, has_tuple_arg=True)\n\n                    emit_c(code)\n                    emit_h(getTemplateCodeDeclaredFunction(code))\n\n            template = getTemplateC(\n                \"nuitka.code_generation\", \"CodeTemplateCallsMixed.c.j2\"\n            )\n\n            # Only keywords, but not positional arguments, via split args.\n            code = getQuickMixedCallCode(\n                args_count=0,\n                has_tuple_arg=False,\n                has_dict_values=True,\n            )\n\n            emit_c(code)\n            emit_h(getTemplateCodeDeclaredFunction(code))\n\n            for args_count in range(1, max_quick_call + 1):\n                for has_tuple_arg in (False, True):\n                    for has_dict_values in (False, True):\n                        # We do not do that.\n                        if not has_dict_values and has_tuple_arg:\n                            continue\n\n                        code = getQuickMixedCallCode(\n                            args_count=args_count,\n                            has_tuple_arg=has_tuple_arg,\n                            has_dict_values=has_dict_values,\n                        )\n\n                        emit_c(code)\n                        emit_h(getTemplateCodeDeclaredFunction(code))\n\n            for args_count in range(1, 5):\n                code = getQuickMethodDescriptorCallCode(args_count=args_count)\n\n                emit_c(code)\n                emit_h(getTemplateCodeDeclaredFunction(code))\n\n            for args_count in range(max_quick_call + 1):\n                code = getQuickMethodCallCode(args_count=args_count)\n\n                emit_c(code)\n                emit_h(getTemplateCodeDeclaredFunction(code))\n\n\ndef makeHelperLists():\n    filename_c = \"nuitka/build/static_src/HelpersListsGenerated.c\"\n    filename_h = \"nuitka/build/include/nuitka/helper/lists_generated.h\"\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                assert args[0] != \"extern \"\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            template = getTemplateC(\n                \"nuitka.code_generation\", \"CodeTemplateMakeListSmall.c.j2\"\n            )\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            for args_count in range(1, make_list_constant_direct_threshold):\n                code = template.render(args_count=args_count)\n\n                emit_c(code)\n                emit_h(getTemplateCodeDeclaredFunction(code))\n\n            template = getTemplateC(\n                \"nuitka.code_generation\", \"CodeTemplateMakeListHinted.c.j2\"\n            )\n\n            for args_count in range(\n                make_list_constant_direct_threshold, make_list_constant_hinted_threshold\n            ):\n                code = template.render(args_count=args_count)\n\n                emit_c(code)\n                emit_h(getTemplateCodeDeclaredFunction(code))\n\n\ndef _makeHelperBuiltinTypeAttributes(\n    type_prefix, type_name, python2_methods, python3_methods, emit_c, emit_h\n):\n    # many cases to deal with, pylint: disable=too-many-branches\n\n    def getVarName(method_name):\n        return \"%s_builtin_%s\" % (type_prefix, method_name)\n\n    for method_name in sorted(set(python2_methods + python3_methods)):\n        is_public = method_name in (\n            \"format\",\n            \"fromkeys\",\n        )\n\n        if method_name in python2_methods and method_name not in python3_methods:\n            emit_c(\"#if PYTHON_VERSION < 0x300\")\n            if is_public:\n                emit_h(\"#if PYTHON_VERSION < 0x300\")\n            needs_endif = True\n        elif method_name not in python2_methods and method_name in python3_methods:\n            emit_c(\"#if PYTHON_VERSION >= 0x300\")\n            if is_public:\n                emit_h(\"#if PYTHON_VERSION >= 0x300\")\n            needs_endif = True\n        else:\n            needs_endif = False\n\n        if not is_public:\n            emit_c(\"static\")\n\n        emit_c(\"PyObject *%s = NULL;\" % getVarName(method_name))\n\n        if is_public:\n            emit_h(\"extern PyObject *%s;\" % getVarName(method_name))\n\n        if needs_endif:\n            emit_c(\"#endif\")\n\n            if is_public:\n                emit_h(\"#endif\")\n\n    if not python3_methods:\n        emit_c(\"#if PYTHON_VERSION < 0x300\")\n    if not python2_methods:\n        emit_c(\"#if PYTHON_VERSION >= 0x300\")\n\n    emit_c(\"static void _init%sBuiltinMethods(void) {\" % type_prefix.capitalize())\n    for method_name in sorted(set(python2_methods + python3_methods)):\n        if (\n            method_name in python2_methods\n            and method_name not in python3_methods\n            and python3_methods\n        ):\n            emit_c(\"#if PYTHON_VERSION < 0x300\")\n            needs_endif = True\n        elif (\n            method_name not in python2_methods\n            and method_name in python3_methods\n            and python2_methods\n        ):\n            emit_c(\"#if PYTHON_VERSION >= 0x300\")\n            needs_endif = True\n        else:\n            needs_endif = False\n\n        emit_c(\n            '%s = PyObject_GetAttrString((PyObject *)&%s, \"%s\");'\n            % (getVarName(method_name), type_name, method_name)\n        )\n\n        if needs_endif:\n            emit_c(\"#endif\")\n\n    emit_c(\"}\")\n\n    if not python2_methods or not python3_methods:\n        emit_c(\"#endif\")\n\n\ngenerate_builtin_type_operations = [\n    # TODO: For these, we would need an implementation for adding/deleting dictionary values. That\n    # has turned out to be too hard so far and these are very good friends, not doing hashing\n    # multiple times when reading and writing, so can't do it unless we add something for the\n    # Nuitka-Python eventually.\n    (\n        \"tshape_dict\",\n        dict_desc,\n        nuitka.specs.BuiltinDictOperationSpecs,\n        (\"pop\", \"popitem\", \"setdefault\"),\n    ),\n    (\n        \"tshape_list\",\n        list_desc,\n        nuitka.specs.BuiltinListOperationSpecs,\n        (\n            \"pop\",\n            # TODO: template doesn't do positional only yet.\n            # \"sort\",\n        ),\n    ),\n    # TODO: These are very complex things using \"string lib\" code in CPython,\n    # that we do not have easy access to, but we might one day for Nuitka-Python\n    # expose it for the static linking of it and then we could in fact call\n    # these directly.\n    (\n        \"tshape_str\",\n        str_desc,\n        nuitka.specs.BuiltinStrOperationSpecs,\n        (\n            \"strip\",\n            \"rstrip\",\n            \"lstrip\",\n            \"partition\",\n            \"rpartition\",\n            \"find\",\n            \"rfind\",\n            \"index\",\n            \"rindex\",\n            \"capitalize\",\n            \"upper\",\n            \"lower\",\n            \"swapcase\",\n            \"title\",\n            \"isalnum\",\n            \"isalpha\",\n            \"isdigit\",\n            \"islower\",\n            \"isupper\",\n            \"isspace\",\n            \"istitle\",\n            \"split\",\n            \"rsplit\",\n            \"startswith\",\n            \"endswith\",\n            \"replace\",\n            \"encode\",\n            \"decode\",\n            \"count\",\n            \"expandtabs\",\n            \"translate\",\n            \"ljust\",\n            \"rjust\",\n            \"center\",\n            \"zfill\",\n            \"splitlines\",\n        ),\n    ),\n    # TODO: This is using Python2 spec module for Python3 strings, that will be a problem down the\n    # road, when version specifics come in.\n    (\n        \"tshape_unicode\",\n        unicode_desc,\n        nuitka.specs.BuiltinUnicodeOperationSpecs,\n        (\n            \"strip\",\n            \"rstrip\",\n            \"lstrip\",\n            \"find\",\n            \"rfind\",\n            \"index\",\n            \"rindex\",\n            \"capitalize\",\n            \"upper\",\n            \"lower\",\n            \"swapcase\",\n            \"title\",\n            \"isalnum\",\n            \"isalpha\",\n            \"isdigit\",\n            \"islower\",\n            \"isupper\",\n            \"isspace\",\n            \"istitle\",\n            \"split\",\n            \"rsplit\",\n            \"startswith\",\n            \"endswith\",\n            \"replace\",\n            \"encode\",\n            \"count\",\n            \"expandtabs\",\n            \"translate\",\n            \"ljust\",\n            \"rjust\",\n            \"center\",\n            \"zfill\",\n            \"splitlines\",\n        ),\n    ),\n    (\n        \"tshape_bytes\",\n        bytes_desc,\n        nuitka.specs.BuiltinBytesOperationSpecs,\n        (\n            \"capitalize\",\n            \"center\",\n            \"count\",\n            \"decode\",\n            \"endswith\",\n            \"expandtabs\",\n            \"find\",\n            \"index\",\n            \"isalnum\",\n            \"isalpha\",\n            \"isdigit\",\n            \"islower\",\n            \"isspace\",\n            \"istitle\",\n            \"isupper\",\n            \"join\",\n            \"ljust\",\n            \"lower\",\n            \"lstrip\",\n            \"partition\",\n            \"replace\",\n            \"rfind\",\n            \"rindex\",\n            \"rjust\",\n            \"rpartition\",\n            \"rsplit\",\n            \"rstrip\",\n            \"split\",\n            \"splitlines\",\n            \"startswith\",\n            \"strip\",\n            \"swapcase\",\n            \"title\",\n            \"translate\",\n            \"upper\",\n            \"zfill\",\n        ),\n    ),\n]\n\n\ndef makeDictCopyHelperCodes():\n    filename_c = \"nuitka/build/static_src/HelpersDictionariesGenerated.c\"\n\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n\n        def emit(*args):\n            writeLine(output_c, *args)\n\n        emitIDE(emit)\n\n        template = getDoExtensionUsingTemplateC(\"HelperDictionaryCopy.c.j2\")\n\n        emitGenerationWarning(emit, template.name)\n\n        code = template.render()\n\n        emit(code)\n\n\ndef _getCheckForShape(shape):\n    # Return driven for better debugging experience, pylint: disable=too-many-return-statements\n\n    if shape is tshape_str:\n        return \"Nuitka_String_CheckExact\"\n    elif shape is tshape_list:\n        return \"PyList_CheckExact\"\n    elif shape is tshape_tuple:\n        return \"PyTuple_CheckExact\"\n    elif shape is tshape_int:\n        # TODO: Not defined a version independent one yet in prelude.h\n        return None\n    elif shape is tshape_bool:\n        return \"PyBool_Check\"\n    elif shape is tshape_none:\n        # TODO: Not defined one in prelude.h yet\n        return None\n    elif shape is tshape_dict:\n        return \"PyDict_CheckExact\"\n    elif shape is tshape_bytes:\n        return \"PyBytes_CheckExact\"\n    else:\n        assert False, shape\n\n\ndef makeHelperBuiltinTypeMethods():\n    # Many details, pylint: disable=too-many-locals\n    filename_c = \"nuitka/build/static_src/HelpersBuiltinTypeMethods.c\"\n    filename_h = \"nuitka/build/include/nuitka/helper/operations_builtin_types.h\"\n    with withFileOpenedAndAutoFormatted(filename_c) as output_c:\n        with withFileOpenedAndAutoFormatted(filename_h) as output_h:\n\n            def emit_h(*args):\n                writeLine(output_h, *args)\n\n            def emit_c(*args):\n                writeLine(output_c, *args)\n\n            def emit(*args):\n                emit_h(*args)\n                emit_c(*args)\n\n            template = getDoExtensionUsingTemplateC(\"HelperBuiltinMethodOperation.c.j2\")\n\n            emitGenerationWarning(emit, template.name)\n\n            emitIDE(emit)\n\n            # TODO: Isn't this creating more than necessary, we don't use all of them, e.g.\n            # not with lists and dicts.\n            _makeHelperBuiltinTypeAttributes(\n                \"str\", \"PyString_Type\", python2_str_methods, (), emit_c, emit_h\n            )\n            _makeHelperBuiltinTypeAttributes(\n                \"bytes\", \"PyBytes_Type\", (), python3_bytes_methods, emit_c, emit_h\n            )\n            _makeHelperBuiltinTypeAttributes(\n                \"unicode\",\n                \"PyUnicode_Type\",\n                python2_unicode_methods,\n                python3_str_methods,\n                emit_c,\n                emit_h,\n            )\n            _makeHelperBuiltinTypeAttributes(\n                \"dict\",\n                \"PyDict_Type\",\n                python2_dict_methods,\n                python3_dict_methods,\n                emit_c,\n                emit_h,\n            )\n            _makeHelperBuiltinTypeAttributes(\n                \"list\",\n                \"PyList_Type\",\n                python2_list_methods,\n                python3_list_methods,\n                emit_c,\n                emit_h,\n            )\n\n            for (\n                shape_name,\n                type_desc,\n                spec_module,\n                method_names,\n            ) in generate_builtin_type_operations:\n                if type_desc.python_requirement:\n                    emit(\"#if %s\" % type_desc.python_requirement)\n\n                for method_name in sorted(method_names):\n                    (\n                        present,\n                        arg_names,\n                        _arg_tests,\n                        arg_name_mapping,\n                        arg_counts,\n                        result_shape,\n                    ) = getMethodVariations(\n                        spec_module=spec_module,\n                        shape_name=shape_name,\n                        method_name=method_name,\n                        must_exist=True,\n                    )\n\n                    assert present, method_name\n\n                    def formatArgumentDeclaration(arg_types, arg_names, starting):\n                        return formatArgs(\n                            [\n                                arg_type.getVariableDecl(arg_name)\n                                for arg_type, arg_name in zip(arg_types, arg_names)\n                            ],\n                            starting=starting,\n                        )\n\n                    # Function is used immediately in same loop, pylint: disable=cell-var-from-loop\n                    def replaceArgNameForC(arg_name):\n                        if arg_name in arg_name_mapping:\n                            arg_name = arg_name_mapping[arg_name]\n\n                        if arg_name in (\"default\", \"new\", \"delete\"):\n                            return arg_name + \"_value\"\n                        else:\n                            return arg_name\n\n                    for arg_count in arg_counts:\n                        variant_args = [\n                            replaceArgNameForC(arg_name)\n                            for arg_name in arg_names[:arg_count]\n                        ]\n\n                        code = template.render(\n                            object_desc=object_desc,\n                            builtin_type=type_desc,\n                            builtin_arg_name=type_desc.type_name,\n                            method_name=method_name,\n                            api_suffix=(\n                                str(arg_count + 1) if len(arg_counts) > 1 else \"\"\n                            ),\n                            arg_names=variant_args,\n                            arg_types=[object_desc] * len(variant_args),\n                            formatArgumentDeclaration=formatArgumentDeclaration,\n                            extra_check=(\n                                _getCheckForShape(result_shape)\n                                if result_shape is not None\n                                else None\n                            ),\n                            zip=zip,\n                            len=len,\n                            name=template.name,\n                        )\n\n                        emit_c(code)\n                        emit_h(getTemplateCodeDeclaredFunction(code))\n                if type_desc.python_requirement:\n                    emit(\"#endif\")\n\n\ndef main():\n    makeDictCopyHelperCodes()\n\n    # Cover many things once first, then cover all for quicker turnaround during development.\n    makeHelpersComparisonOperation(\"==\", \"EQ\")\n    makeHelpersBinaryOperation(\"+\", \"ADD\")\n    makeHelpersInplaceOperation(\"+\", \"ADD\")\n\n    makeHelperBuiltinTypeMethods()\n\n    makeHelpersImportHard()\n\n    makeHelperCalls()\n    makeHelperLists()\n\n    makeHelpersBinaryOperation(\"-\", \"SUB\")\n    makeHelpersBinaryOperation(\"*\", \"MULT\")\n    makeHelpersBinaryOperation(\"%\", \"MOD\")\n    makeHelpersBinaryOperation(\"|\", \"BITOR\")\n    makeHelpersBinaryOperation(\"&\", \"BITAND\")\n    makeHelpersBinaryOperation(\"^\", \"BITXOR\")\n    makeHelpersBinaryOperation(\"<<\", \"LSHIFT\")\n    makeHelpersBinaryOperation(\">>\", \"RSHIFT\")\n    makeHelpersBinaryOperation(\"//\", \"FLOORDIV\")\n    makeHelpersBinaryOperation(\"/\", \"TRUEDIV\")\n    makeHelpersBinaryOperation(\"/\", \"OLDDIV\")\n    makeHelpersBinaryOperation(\"divmod\", \"DIVMOD\")\n    makeHelpersBinaryOperation(\"**\", \"POW\")\n    makeHelpersBinaryOperation(\"@\", \"MATMULT\")\n\n    makeHelpersInplaceOperation(\"-\", \"SUB\")\n    makeHelpersInplaceOperation(\"*\", \"MULT\")\n    makeHelpersInplaceOperation(\"%\", \"MOD\")\n    makeHelpersInplaceOperation(\"|\", \"BITOR\")\n    makeHelpersInplaceOperation(\"&\", \"BITAND\")\n    makeHelpersInplaceOperation(\"^\", \"BITXOR\")\n    makeHelpersInplaceOperation(\"<<\", \"LSHIFT\")\n    makeHelpersInplaceOperation(\">>\", \"RSHIFT\")\n    makeHelpersInplaceOperation(\"//\", \"FLOORDIV\")\n    makeHelpersInplaceOperation(\"/\", \"TRUEDIV\")\n    makeHelpersInplaceOperation(\"/\", \"OLDDIV\")\n    makeHelpersInplaceOperation(\"**\", \"POW\")\n    makeHelpersInplaceOperation(\"@\", \"MATMULT\")\n\n    makeHelpersComparisonOperation(\"!=\", \"NE\")\n    makeHelpersComparisonOperation(\"<=\", \"LE\")\n    makeHelpersComparisonOperation(\">=\", \"GE\")\n    makeHelpersComparisonOperation(\">\", \"GT\")\n    makeHelpersComparisonOperation(\"<\", \"LT\")\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/SpecializePython.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This tool is generating node variants from Jinja templates.\n\n\"\"\"\n\nimport sys\nimport nuitka.Options\n\nnuitka.Options.is_full_compat = False\n\n# isort:start\n\nimport textwrap\nfrom collections import namedtuple\n\nimport nuitka.code_generation.BinaryOperationHelperDefinitions\nimport nuitka.code_generation.CodeGeneration\nimport nuitka.code_generation.ComparisonCodes\nimport nuitka.code_generation.Namify\nimport nuitka.nodes.PackageMetadataNodes\nimport nuitka.nodes.PackageResourceNodes\nimport nuitka.nodes.SideEffectNodes\nimport nuitka.nodes.TensorflowNodes\nimport nuitka.specs.BuiltinBytesOperationSpecs\nimport nuitka.specs.BuiltinDictOperationSpecs\nimport nuitka.specs.BuiltinListOperationSpecs\nimport nuitka.specs.BuiltinStrOperationSpecs\nimport nuitka.specs.BuiltinTypeOperationSpecs\nimport nuitka.specs.HardImportSpecs\nimport nuitka.tree.Building\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.nodes.ImportNodes import hard_modules_non_stdlib\nfrom nuitka.nodes.NodeMetaClasses import NodeCheckMetaClass\nfrom nuitka.nodes.shapes.BuiltinTypeShapes import (\n    tshape_bool,\n    tshape_bytes,\n    tshape_dict,\n    tshape_int,\n    tshape_list,\n    tshape_none,\n    tshape_str,\n    tshape_tuple,\n)\nfrom nuitka.utils.Jinja2 import getTemplate\n\nfrom .Common import (\n    formatArgs,\n    getMethodVariations,\n    getSpecs,\n    python2_dict_methods,\n    python2_list_methods,\n    python2_str_methods,\n    python2_type_methods,\n    python3_bytes_methods,\n    python3_dict_methods,\n    python3_list_methods,\n    python3_str_methods,\n    python3_type_methods,\n    withFileOpenedAndAutoFormatted,\n    writeLine,\n)\n\n# This defines which attribute nodes are to specialize and how\n# to do that.\nattribute_information = {}\n\n# Which ones have operations implemented.\nattribute_shape_operations = {}\n\n# What result shape is known for the operation if used.\nattribute_shape_operations_result_types = {}\n\n# What mixing class should be used for the operation if used.\nattribute_shape_operations_mixin_classes = {}\n\n# Version specific tests for attributes.\nattribute_shape_versions = {}\n\n# Argument count specific operation nodes if used.\nattribute_shape_variations = {}\n\n# Arguments names differences in spec vs. node\nattribute_shape_node_arg_mapping = {}\n\n# Argument names of an operation.\nattribute_shape_args = {}\n\n# How to test for argument name presence\nattribute_shape_arg_tests = {}\n\n# Some methods are static, but we still do them\nattribute_shape_static = {}\n\n# Translations for node names.\nnode_factory_translations = {}\n\n\ndef _getMixinForShape(shape):\n    # Return driven for better debugging experience, pylint: disable=too-many-return-statements\n\n    if shape is tshape_str:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionStrShapeExactMixin\"\n    elif shape is tshape_list:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionListShapeExactMixin\"\n    elif shape is tshape_tuple:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionTupleShapeExactMixin\"\n    elif shape is tshape_int:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionIntShapeExactMixin\"\n    elif shape is tshape_bool:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionBoolShapeExactMixin\"\n    elif shape is tshape_none:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionNoneShapeExactMixin\"\n    elif shape is tshape_dict:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionDictShapeExactMixin\"\n    elif shape is tshape_bytes:\n        return \"nuitka.nodes.ExpressionShapeMixins.ExpressionBytesShapeExactMixin\"\n    else:\n        assert False, shape\n\n\ndef processTypeShapeAttribute(\n    shape_name, spec_module, python2_methods, python3_methods, staticmethod_names=()\n):\n    for method_name in python2_methods:\n        attribute_information.setdefault(method_name, set()).add(shape_name)\n        key = method_name, shape_name\n\n        if method_name not in python3_methods:\n            attribute_shape_versions[key] = \"str is bytes\"\n\n        (\n            present,\n            arg_names,\n            arg_tests,\n            arg_name_mapping,\n            arg_counts,\n            result_shape,\n        ) = getMethodVariations(\n            spec_module=spec_module, shape_name=shape_name, method_name=method_name\n        )\n\n        attribute_shape_operations[key] = present\n        attribute_shape_operations_result_types[key] = result_shape\n\n        if result_shape is not None:\n            attribute_shape_operations_mixin_classes[key] = [\n                _getMixinForShape(result_shape)\n            ]\n\n        if present:\n            attribute_shape_args[key] = tuple(arg_names)\n            attribute_shape_arg_tests[key] = arg_tests\n            attribute_shape_static[key] = method_name in staticmethod_names\n\n            if len(arg_counts) > 1:\n                attribute_shape_variations[key] = arg_counts\n\n            attribute_shape_node_arg_mapping[key] = arg_name_mapping\n\n    for method_name in python3_methods:\n        attribute_information.setdefault(method_name, set()).add(shape_name)\n        key = method_name, shape_name\n\n        if method_name not in python2_methods:\n            attribute_shape_versions[key] = \"str is not bytes\"\n\n        (\n            present,\n            arg_names,\n            arg_tests,\n            arg_name_mapping,\n            arg_counts,\n            result_shape,\n        ) = getMethodVariations(\n            spec_module=spec_module, shape_name=shape_name, method_name=method_name\n        )\n\n        attribute_shape_operations[key] = present\n        attribute_shape_operations_result_types[key] = result_shape\n\n        if result_shape is not None:\n            attribute_shape_operations_mixin_classes[key] = [\n                _getMixinForShape(result_shape)\n            ]\n\n        if present:\n            attribute_shape_args[key] = tuple(arg_names)\n            attribute_shape_arg_tests[key] = arg_tests\n            attribute_shape_static[key] = method_name in staticmethod_names\n\n            if len(arg_counts) > 1:\n                attribute_shape_variations[key] = arg_counts\n\n            attribute_shape_node_arg_mapping[key] = arg_name_mapping\n\n\nprocessTypeShapeAttribute(\n    \"tshape_dict\",\n    nuitka.specs.BuiltinDictOperationSpecs,\n    python2_dict_methods,\n    python3_dict_methods,\n    (\"fromkeys\",),\n)\n\n\nprocessTypeShapeAttribute(\n    \"tshape_str\",\n    nuitka.specs.BuiltinStrOperationSpecs,\n    python2_str_methods,\n    python3_str_methods,\n)\n\nprocessTypeShapeAttribute(\n    \"tshape_bytes\",\n    nuitka.specs.BuiltinBytesOperationSpecs,\n    (),\n    python3_bytes_methods,\n)\n\nprocessTypeShapeAttribute(\n    \"tshape_list\",\n    nuitka.specs.BuiltinListOperationSpecs,\n    python2_list_methods,\n    python3_list_methods,\n)\n\nprocessTypeShapeAttribute(\n    \"tshape_type\",\n    nuitka.specs.BuiltinTypeOperationSpecs,\n    python2_type_methods,\n    python3_type_methods,\n)\n\n\nattribute_shape_empty = {}\n\nattribute_shape_empty[\n    \"update\", \"tshape_dict\"\n] = \"\"\"\\\nlambda source_ref: wrapExpressionWithNodeSideEffects(\n    new_node=makeConstantRefNode(\n        constant=None,\n        source_ref=source_ref\n    ),\n    old_node=dict_arg\n)\n\"\"\"\n\n\ndef emitGenerationWarning(emit, doc_string, template_name):\n    generate_names = set()\n\n    generate_names.update(attribute_information.keys())\n    generate_names.update(\n        attribute_name.replace(\"_\", \"\") for attribute_name in attribute_information\n    )\n\n    generate_names.update(sum(attribute_shape_args.values(), ()))\n\n    for spec_descriptions in getSpecVersions(nuitka.specs.HardImportSpecs):\n        spec = spec_descriptions[0][2]\n        generate_names.update(spec.getArgumentNames())\n\n    ignores = textwrap.fill(\n        \" \".join(sorted(generate_names)),\n        width=90,\n        initial_indent=\"spell-checker: ignore \",\n        subsequent_indent=\"spell-checker: ignore \",\n        break_on_hyphens=False,\n        break_long_words=False,\n        expand_tabs=False,\n        replace_whitespace=False,\n    )\n\n    emit(\n        \"\"\"\n# We are not avoiding these in generated code at all\n# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines\n# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements\n\"\"\"\n    )\n\n    emit(\n        '''\n\"\"\"%s\n\nWARNING, this code is GENERATED. Modify the template %s instead!\n\n%s\n\"\"\"\n\n'''\n        % (doc_string, template_name, ignores)\n    )\n\n\ndef formatCallArgs(operation_node_arg_mapping, args, starting=True):\n    def mapName(arg):\n        if not operation_node_arg_mapping:\n            return arg\n        else:\n            return operation_node_arg_mapping.get(arg, arg)\n\n    def mapValue(arg):\n        if arg == \"pairs\":\n            return \"makeKeyValuePairExpressionsFromKwArgs(pairs)\"\n        else:\n            return arg\n\n    if args is None:\n        result = \"\"\n    else:\n        result = \",\".join(\"%s=%s\" % (mapName(arg), mapValue(arg)) for arg in args)\n\n    if not starting and result:\n        result = \",\" + result\n\n    # print(\"args\", args, \"->\", result)\n\n    return result\n\n\ndef _getPython3OperationName(attribute_name):\n    # Some attributes lead to different operations for Python3.\n    if attribute_name == \"items\":\n        return \"iteritems\"\n    elif attribute_name == \"keys\":\n        return \"iterkeys\"\n    elif attribute_name == \"values\":\n        return \"itervalues\"\n    else:\n        return None\n\n\ndef makeAttributeNodes():\n    filename_python = \"nuitka/nodes/AttributeNodesGenerated.py\"\n\n    template = getTemplate(\n        package_name=__package__,\n        template_subdir=\"templates_python\",\n        template_name=\"AttributeNodeFixed.py.j2\",\n    )\n\n    with withFileOpenedAndAutoFormatted(\n        filename_python, ignore_errors=True\n    ) as output_python:\n\n        def emit(*args):\n            writeLine(output_python, *args)\n\n        emitGenerationWarning(emit, \"Specialized attribute nodes\", template.name)\n\n        emit(\"from .AttributeLookupNodes import ExpressionAttributeLookupFixedBase\")\n        emit(\"from nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs\")\n\n        emit(\"from nuitka.nodes.ConstantRefNodes import makeConstantRefNode\")\n        emit(\n            \"from nuitka.nodes.NodeMakingHelpers import wrapExpressionWithNodeSideEffects\"\n        )\n\n        emit(\n            \"from nuitka.nodes.KeyValuePairNodes import makeKeyValuePairExpressionsFromKwArgs\"\n        )\n\n        emit(\"from nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup\")\n\n        # TODO: Maybe generate its effect instead of using a base class.\n        emit(\"from .NodeBases import SideEffectsFromChildrenMixin\")\n\n        emit(\"attribute_classes = {}\")\n        emit(\"attribute_typed_classes = set()\")\n\n        for attribute_name, shape_names in sorted(attribute_information.items()):\n            code = template.render(\n                attribute_name=attribute_name,\n                python3_operation_name=_getPython3OperationName(attribute_name),\n                shape_names=shape_names,\n                attribute_shape_versions=attribute_shape_versions,\n                attribute_shape_operations=attribute_shape_operations,\n                attribute_shape_variations=attribute_shape_variations,\n                attribute_shape_node_arg_mapping=attribute_shape_node_arg_mapping,\n                attribute_shape_args=attribute_shape_args,\n                attribute_shape_arg_tests=attribute_shape_arg_tests,\n                attribute_shape_empty=attribute_shape_empty,\n                attribute_shape_static=attribute_shape_static,\n                formatArgs=formatArgs,\n                formatCallArgs=formatCallArgs,\n                translateNodeClassName=translateNodeClassName,\n                reversed=reversed,\n                str=str,\n                name=template.name,\n            )\n\n            emit(code)\n\n\ndef makeBuiltinOperationNodes():\n    filename_python = \"nuitka/nodes/BuiltinOperationNodeBasesGenerated.py\"\n\n    template = getTemplate(\n        package_name=__package__,\n        template_subdir=\"templates_python\",\n        template_name=\"BuiltinOperationNodeBases.py.j2\",\n    )\n\n    with withFileOpenedAndAutoFormatted(\n        filename_python, ignore_errors=True\n    ) as output_python:\n\n        def emit(*args):\n            writeLine(output_python, *args)\n\n        emitGenerationWarning(emit, \"Specialized attribute nodes\", template.name)\n\n        for attribute_name, shape_names in sorted(attribute_information.items()):\n            attribute_name_class = attribute_name.replace(\"_\", \"\").title()\n\n            code = template.render(\n                attribute_name=attribute_name,\n                attribute_name_class=attribute_name_class,\n                python3_operation_name=_getPython3OperationName(attribute_name),\n                shape_names=shape_names,\n                attribute_shape_versions=attribute_shape_versions,\n                attribute_shape_operations=attribute_shape_operations,\n                attribute_shape_variations=attribute_shape_variations,\n                attribute_shape_node_arg_mapping=attribute_shape_node_arg_mapping,\n                attribute_shape_args=attribute_shape_args,\n                attribute_shape_arg_tests=attribute_shape_arg_tests,\n                attribute_shape_empty=attribute_shape_empty,\n                attribute_shape_static=attribute_shape_static,\n                attribute_shape_operations_mixin_classes=attribute_shape_operations_mixin_classes,\n                formatArgs=formatArgs,\n                formatCallArgs=formatCallArgs,\n                addChildrenMixin=addChildrenMixin,\n                reversed=reversed,\n                str=str,\n                name=template.name,\n            )\n\n            emit(code)\n\n\ndef adaptModuleName(value):\n    if value == \"importlib_metadata\":\n        return \"importlib_metadata_backport\"\n\n    if value == \"importlib_resources\":\n        return \"importlib_resources_backport\"\n\n    return value\n\n\ndef makeTitleCased(value):\n    return \"\".join(s.title() for s in value.split(\"_\")).replace(\".\", \"\")\n\n\ndef makeCodeCased(value):\n    return value.replace(\".\", \"_\")\n\n\ndef getCallModuleName(module_name, function_name):\n    # return driven, pylint: disable=too-many-return-statements\n\n    if module_name in (\"pkg_resources\", \"importlib.metadata\", \"importlib_metadata\"):\n        if function_name in (\"resource_stream\", \"resource_string\"):\n            return \"PackageResourceNodes\"\n\n        return \"PackageMetadataNodes\"\n    if module_name in (\"pkgutil\", \"importlib.resources\", \"importlib_resources\"):\n        return \"PackageResourceNodes\"\n    if module_name in (\"os\", \"sys\", \"os.path\"):\n        return \"OsSysNodes\"\n    if module_name == \"ctypes\":\n        return \"CtypesNodes\"\n    if module_name == \"builtins\":\n        if function_name == \"open\":\n            return \"BuiltinOpenNodes\"\n\n    if module_name == \"tensorflow\":\n        return \"TensorflowNodes\"\n\n    assert False, (module_name, function_name)\n\n\ndef translateNodeClassName(node_class_name):\n    return node_factory_translations.get(node_class_name, node_class_name)\n\n\ndef makeMixinName(\n    is_expression,\n    is_statement,\n    named_children,\n    named_children_types,\n    named_children_checkers,\n    auto_compute_handling,\n    node_attributes,\n):\n    def _addType(name):\n        if name in named_children_types:\n            if (\n                named_children_types[name] == \"optional\"\n                and named_children_checkers.get(name) == \"convertNoneConstantToNone\"\n            ):\n                return \"\"\n\n            return \"_\" + named_children_types[name]\n        else:\n            return \"\"\n\n    def _addChecker(name):\n        if name in named_children_checkers:\n            if named_children_checkers[name] == \"convertNoneConstantToNone\":\n                return \"_auto_none\"\n            if named_children_checkers[name] == \"convertEmptyStrConstantToNone\":\n                return \"_auto_none_empty_str\"\n            if named_children_checkers[name] == \"checkStatementsSequenceOrNone\":\n                return \"_statements_or_none\"\n            if named_children_checkers[name] == \"checkStatementsSequence\":\n                return \"_statements\"\n            else:\n                assert False, named_children_checkers[name]\n        else:\n            return \"\"\n\n    mixin_name = \"\".join(\n        makeTitleCased(named_child + _addType(named_child) + _addChecker(named_child))\n        for named_child in named_children\n    )\n\n    mixin_name += (\n        \"_\".join(sorted(auto_compute_handling))\n        .title()\n        .replace(\"_\", \"\")\n        .replace(\":\", \"\")\n    )\n\n    mixin_name += \"_\".join(sorted(node_attributes)).title().replace(\"_\", \"\")\n\n    if len(named_children) == 0:\n        mixin_name = \"NoChildHaving\" + mixin_name + \"Mixin\"\n    elif len(named_children) == 1:\n        mixin_name = \"ChildHaving\" + mixin_name + \"Mixin\"\n    else:\n        mixin_name = \"ChildrenHaving\" + mixin_name + \"Mixin\"\n\n    if is_statement:\n        mixin_name = \"Statement\" + mixin_name\n    elif is_expression:\n        pass\n    else:\n        mixin_name = \"Module\" + mixin_name\n\n    return mixin_name\n\n\nchildren_mixins = []\n\nchildren_mixins_intentions = {}\n\nchildren_mixing_setters_needed = {}\n\n\ndef addChildrenMixin(\n    is_expression,\n    is_statement,\n    intended_for,\n    named_children,\n    named_children_types,\n    named_children_checkers,\n    auto_compute_handling=(),\n    node_attributes=(),\n):\n    assert type(is_statement) is bool\n\n    children_mixins.append(\n        (\n            is_expression,\n            is_statement,\n            named_children,\n            named_children_types,\n            named_children_checkers,\n            auto_compute_handling,\n            node_attributes,\n        )\n    )\n\n    mixin_name = makeMixinName(\n        is_expression,\n        is_statement,\n        named_children,\n        named_children_types,\n        named_children_checkers,\n        auto_compute_handling,\n        node_attributes,\n    )\n\n    if mixin_name not in children_mixins_intentions:\n        children_mixins_intentions[mixin_name] = []\n    if intended_for not in children_mixins_intentions[mixin_name]:\n        children_mixins_intentions[mixin_name].append(intended_for)\n\n    for named_child in named_children_types:\n        assert named_child in named_children, named_child\n\n    for named_child, named_child_checker in named_children_checkers.items():\n        if named_child_checker == \"convertNoneConstantToNone\":\n            assert named_children_types[named_child] == \"optional\"\n\n    return mixin_name\n\n\ndef _parseNamedChildrenSpec(named_children):\n    new_named_children = []\n\n    setters_needed = set()\n    named_children_types = {}\n    named_children_checkers = {}\n\n    for named_child_spec in named_children:\n        if \"|\" in named_child_spec:\n            named_child, named_child_properties = named_child_spec.split(\"|\", 1)\n\n            for named_child_property in named_child_properties.split(\"+\"):\n                if named_child_property == \"setter\":\n                    setters_needed.add(named_child)\n                elif named_child_property == \"tuple\":\n                    named_children_types[named_child] = \"tuple\"\n                elif named_child_property == \"auto_none\":\n                    named_children_types[named_child] = \"optional\"\n                    named_children_checkers[named_child] = \"convertNoneConstantToNone\"\n                elif named_child_property == \"auto_none_empty_str\":\n                    named_children_types[named_child] = \"optional\"\n                    named_children_checkers[named_child] = (\n                        \"convertEmptyStrConstantToNone\"\n                    )\n                elif named_child_property == \"statements_or_none\":\n                    named_children_types[named_child] = \"optional\"\n                    named_children_checkers[named_child] = (\n                        \"checkStatementsSequenceOrNone\"\n                    )\n                elif named_child_property == \"statements\":\n                    named_children_checkers[named_child] = \"checkStatementsSequence\"\n                elif named_child_property == \"optional\":\n                    named_children_types[named_child] = \"optional\"\n                else:\n                    assert False, named_child_property\n        else:\n            named_child = named_child_spec\n\n        new_named_children.append(named_child)\n\n    return (\n        new_named_children,\n        named_children_types,\n        named_children_checkers,\n        setters_needed,\n    )\n\n\ndef _addFromNode(node_class):\n    named_children = getattr(node_class, \"named_children\", ())\n    # assert not hasattr(node_class, \"named_child\"), node_class\n\n    if hasattr(node_class, \"auto_compute_handling\"):\n        auto_compute_handling = frozenset(\n            getattr(node_class, \"auto_compute_handling\").split(\",\")\n        )\n    else:\n        auto_compute_handling = ()\n\n    node_attributes = getattr(node_class, \"node_attributes\", ())\n\n    if not named_children and not auto_compute_handling and not node_attributes:\n        return\n\n    (\n        new_named_children,\n        named_children_types,\n        named_children_checkers,\n        setters_needed,\n    ) = _parseNamedChildrenSpec(named_children)\n\n    mixin_name = makeMixinName(\n        # TODO: Subject to dying, we now make this up on the fly.\n        node_class.kind.startswith(\"EXPRESSION\"),\n        node_class.kind.startswith(\"STATEMENT\"),\n        tuple(new_named_children),\n        named_children_types,\n        named_children_checkers,\n        auto_compute_handling,\n        node_attributes,\n    )\n\n    if mixin_name not in children_mixing_setters_needed:\n        children_mixing_setters_needed[mixin_name] = set()\n    children_mixing_setters_needed[mixin_name].update(setters_needed)\n\n    for base in node_class.__mro__:\n        if base.__name__ == mixin_name:\n            break\n    else:\n        # if named_children == (\"operand\",):\n        print(\"Not done\", node_class.__name__, named_children, mixin_name)\n\n    addChildrenMixin(\n        # TODO: Subject to dying, we now make this up on the fly.\n        node_class.kind.startswith(\"EXPRESSION\"),\n        node_class.kind.startswith(\"STATEMENT\"),\n        node_class.__name__,\n        tuple(new_named_children),\n        named_children_types,\n        named_children_checkers,\n        auto_compute_handling,\n        node_attributes,\n    )\n\n\ndef addFromNodes():\n    for node_class in NodeCheckMetaClass.kinds.values():\n        # Find nodes with a make variant.\n        if hasattr(sys.modules[node_class.__module__], \"make\" + node_class.__name__):\n            node_factory_translations[node_class.__name__] = (\n                \"make\" + node_class.__name__\n            )\n\n        _addFromNode(node_class)\n\n    # Fake factories:\n    node_factory_translations[\"ExpressionImportlibMetadataMetadataCall\"] = (\n        \"makeExpressionImportlibMetadataMetadataCall\"\n    )\n    node_factory_translations[\"ExpressionImportlibMetadataBackportMetadataCall\"] = (\n        \"makeExpressionImportlibMetadataBackportMetadataCall\"\n    )\n    node_factory_translations[\"ExpressionBuiltinsOpenCall\"] = (\n        \"makeExpressionBuiltinsOpenCall\"\n    )\n    node_factory_translations[\"ExpressionSysExitCall\"] = \"makeExpressionSysExitCall\"\n\n\naddFromNodes()\n\n\ndef makeChildrenHavingMixinNodes():\n    # Complex stuff with many details due to 2 files and modes,\n    # pylint: disable=too-many-locals,too-many-statements\n\n    filename_python = \"nuitka/nodes/ChildrenHavingMixins.py\"\n    filename_python2 = \"nuitka/nodes/ExpressionBasesGenerated.py\"\n    filename_python3 = \"nuitka/nodes/StatementBasesGenerated.py\"\n\n    template = getTemplate(\n        package_name=__package__,\n        template_subdir=\"templates_python\",\n        template_name=\"ChildrenHavingMixin.py.j2\",\n    )\n\n    mixins_done = set()\n\n    with withFileOpenedAndAutoFormatted(\n        filename_python, ignore_errors=True\n    ) as output_python, withFileOpenedAndAutoFormatted(\n        filename_python2, ignore_errors=True\n    ) as output_python2, withFileOpenedAndAutoFormatted(\n        filename_python3, ignore_errors=True\n    ) as output_python3:\n\n        def emit1(*args):\n            writeLine(output_python, *args)\n\n        def emit2(*args):\n            writeLine(output_python2, *args)\n\n        def emit3(*args):\n            writeLine(output_python3, *args)\n\n        def emit(*args):\n            emit1(*args)\n            emit2(*args)\n            emit3(*args)\n\n        emitGenerationWarning(emit1, \"Children having mixins\", template.name)\n        emitGenerationWarning(emit2, \"Children having expression bases\", template.name)\n        emitGenerationWarning(emit3, \"Children having statement bases\", template.name)\n\n        emit(\"# Loop unrolling over child names, pylint: disable=too-many-branches\")\n\n        emit1(\n            \"\"\"\nfrom nuitka.nodes.Checkers import (\n    checkStatementsSequenceOrNone,\n    convertNoneConstantToNone,\n    convertEmptyStrConstantToNone\n)\n\"\"\"\n        )\n\n        emit3(\n            \"\"\"\nfrom nuitka.nodes.Checkers import (\n    checkStatementsSequenceOrNone, \\\n    checkStatementsSequence,\n    convertNoneConstantToNone\n)\n\"\"\"\n        )\n\n        for (\n            is_expression,\n            is_statement,\n            named_children,\n            named_children_types,\n            named_children_checkers,\n            auto_compute_handling,\n            node_attributes,\n        ) in sorted(\n            children_mixins,\n            key=lambda x: (x[0], x[1], x[2], x[3].items(), x[4].items()),\n        ):\n            mixin_name = makeMixinName(\n                is_expression,\n                is_statement,\n                named_children,\n                named_children_types,\n                named_children_checkers,\n                auto_compute_handling,\n                node_attributes,\n            )\n\n            if mixin_name in mixins_done:\n                continue\n\n            intended_for = [\n                value\n                for value in children_mixins_intentions[mixin_name]\n                if (\n                    not value.endswith(\"Base\")\n                    or value.rstrip(\"Base\")\n                    not in children_mixins_intentions[mixin_name]\n                )\n            ]\n            intended_for.sort()\n\n            auto_compute_handling_set = set(auto_compute_handling)\n\n            def pop(name):\n                # only used inside of the loop, pylint: disable=cell-var-from-loop\n                result = name in auto_compute_handling_set\n                auto_compute_handling_set.discard(name)\n\n                return result\n\n            is_compute_final = pop(\"final\")\n\n            is_compute_final_children = pop(\"final_children\")\n\n            is_compute_no_raise = pop(\"no_raise\")\n            is_compute_raise = pop(\"raise\")\n            is_compute_raise_operation = pop(\"raise_operation\")\n            assert (\n                is_compute_no_raise + is_compute_raise + is_compute_raise_operation < 2\n            )\n\n            if is_compute_raise:\n                raise_mode = \"raise\"\n            elif is_compute_no_raise:\n                raise_mode = \"no_raise\"\n            elif is_compute_raise_operation:\n                raise_mode = \"raise_operation\"\n            else:\n                raise_mode = None\n\n            is_compute_statement = pop(\"operation\")\n            has_post_node_init = pop(\"post_init\")\n\n            awaited_constant_attributes = OrderedSet(\n                value.split(\":\", 1)[1]\n                for value in auto_compute_handling_set\n                if value.startswith(\"wait_constant:\")\n            )\n\n            auto_compute_handling_set -= {\n                \"wait_constant:%s\" % value for value in awaited_constant_attributes\n            }\n\n            assert not auto_compute_handling_set, auto_compute_handling_set\n\n            code = template.render(\n                name=template.name,\n                is_expression=is_expression,\n                is_statement=is_statement,\n                mixin_name=mixin_name,\n                named_children=named_children,\n                named_children_types=named_children_types,\n                named_children_checkers=named_children_checkers,\n                children_mixing_setters_needed=sorted(\n                    tuple(children_mixing_setters_needed.get(mixin_name, ()))\n                ),\n                intended_for=intended_for,\n                is_compute_final=is_compute_final,\n                is_compute_final_children=is_compute_final_children,\n                raise_mode=raise_mode,\n                is_compute_statement=is_compute_statement,\n                awaited_constant_attributes=awaited_constant_attributes,\n                has_post_node_init=has_post_node_init,\n                node_attributes=node_attributes,\n                len=len,\n            )\n\n            if is_statement:\n                emit3(code)\n            elif auto_compute_handling or node_attributes:\n                emit2(code)\n            else:\n                emit1(code)\n\n            mixins_done.add(mixin_name)\n\n\nSpecVersion = namedtuple(\n    \"SpecVersion\", (\"spec_name\", \"python_criterion\", \"spec\", \"suffix\")\n)\n\n\ndef getSpecVersions(spec_module):\n    result = {}\n\n    for spec_name, spec in getSpecs(spec_module):\n        for version, str_version in (\n            (0x370, \"37\"),\n            (0x380, \"38\"),\n            (0x390, \"39\"),\n            (0x3A0, \"310\"),\n            (0x3B0, \"311\"),\n        ):\n            if \"since_%s\" % str_version in spec_name:\n                python_criterion = \">= 0x%x\" % version\n                suffix = \"Since%s\" % str_version\n                break\n\n            if \"before_%s\" % str_version in spec_name:\n                python_criterion = \"< 0x%x\" % version\n                suffix = \"Before%s\" % str_version\n                break\n        else:\n            python_criterion = None\n            suffix = \"\"\n\n        assert \".entry_points\" not in spec_name or python_criterion is not None\n\n        if spec.name not in result:\n            result[spec.name] = []\n\n        result[spec.name].append(SpecVersion(spec_name, python_criterion, spec, suffix))\n        result[spec.name].sort(\n            key=lambda spec_version: spec_version.python_criterion or \"\", reverse=True\n        )\n\n    return tuple(sorted(result.values()))\n\n\ndef makeHardImportNodes():\n    # Too many details, pylint: disable=too-many-locals\n\n    filename_python = \"nuitka/nodes/HardImportNodesGenerated.py\"\n\n    template_ref_node = getTemplate(\n        package_name=__package__,\n        template_subdir=\"templates_python\",\n        template_name=\"HardImportReferenceNode.py.j2\",\n    )\n\n    template_call_node = getTemplate(\n        package_name=__package__,\n        template_subdir=\"templates_python\",\n        template_name=\"HardImportCallNode.py.j2\",\n    )\n\n    with withFileOpenedAndAutoFormatted(\n        filename_python, ignore_errors=True\n    ) as output_python:\n\n        def emit(*args):\n            writeLine(output_python, *args)\n\n        emitGenerationWarning(emit, \"Hard import nodes\", template_ref_node.name)\n\n        emit(\n            \"\"\"\nhard_import_node_classes = {}\n\n\"\"\"\n        )\n\n        for spec_descriptions in getSpecVersions(nuitka.specs.HardImportSpecs):\n            spec = spec_descriptions[0][2]\n\n            named_children_checkers = {}\n\n            module_name, function_name = spec.name.rsplit(\".\", 1)\n            module_name_title = makeTitleCased(adaptModuleName(module_name))\n            function_name_title = makeTitleCased(function_name)\n\n            node_class_name = \"Expression%s%s\" % (\n                module_name_title,\n                function_name_title,\n            )\n\n            code = template_ref_node.render(\n                name=template_ref_node.name,\n                parameter_names_count=len(spec.getParameterNames()),\n                function_name=function_name,\n                function_name_title=function_name_title,\n                function_name_code=makeCodeCased(function_name),\n                module_name=module_name,\n                module_name_code=makeCodeCased(adaptModuleName(module_name)),\n                module_name_title=module_name_title,\n                call_node_module_name=getCallModuleName(module_name, function_name),\n                translateNodeClassName=translateNodeClassName,\n                is_stdlib=module_name not in hard_modules_non_stdlib,\n                specs=spec_descriptions,\n            )\n\n            emit(code)\n\n            for spec_desc in spec_descriptions:\n                spec = spec_desc.spec\n                parameter_names = spec.getParameterNames()\n\n                named_children_types = {}\n                if spec.name == \"pkg_resources.require\":\n                    named_children_types[\"requirements\"] = \"tuple\"\n\n                if spec.getDefaultCount():\n                    for optional_name in spec.getArgumentNames()[\n                        -spec.getDefaultCount() :\n                    ]:\n                        assert optional_name not in named_children_types\n                        named_children_types[optional_name] = \"optional\"\n\n                if spec.getStarDictArgumentName():\n                    named_children_types[spec.getStarDictArgumentName()] = \"tuple\"\n\n                if parameter_names:\n                    mixin_name = addChildrenMixin(\n                        True,\n                        False,\n                        node_class_name,\n                        parameter_names,\n                        named_children_types,\n                        named_children_checkers,\n                    )\n                else:\n                    mixin_name = None\n\n                extra_mixins = []\n\n                result_shape = spec.getTypeShape()\n                if result_shape is not None:\n                    extra_mixins.append(_getMixinForShape(result_shape))\n\n                code = template_call_node.render(\n                    name=template_call_node.name,\n                    mixin_name=mixin_name,\n                    suffix=spec_desc.suffix,\n                    python_criterion=spec_desc.python_criterion,\n                    extra_mixins=extra_mixins,\n                    parameter_names_count=len(spec.getParameterNames()),\n                    named_children=parameter_names,\n                    named_children_types=named_children_types,\n                    argument_names=spec.getArgumentNames(),\n                    star_list_argument_name=spec.getStarListArgumentName(),\n                    star_dict_argument_name=spec.getStarDictArgumentName(),\n                    function_name=function_name,\n                    function_name_title=function_name_title,\n                    function_name_code=makeCodeCased(function_name),\n                    module_name=module_name,\n                    is_stdlib_module=module_name\n                    in (\n                        \"builtins\",\n                        \"os\",\n                        \"os.path\",\n                        \"pkgutil\",\n                        \"ctypes\",\n                        \"importlib.metadata\",\n                        \"importlib.resources\",\n                    ),\n                    module_name_code=makeCodeCased(adaptModuleName(module_name)),\n                    module_name_title=module_name_title,\n                    call_node_module_name=getCallModuleName(module_name, function_name),\n                    spec_name=spec_desc.spec_name,\n                )\n\n                emit(code)\n\n\ndef main():\n    makeHardImportNodes()\n    makeAttributeNodes()\n    makeBuiltinOperationNodes()\n    makeChildrenHavingMixinNodes()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/specialize/templates_python/AttributeNodeFixed.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% set attribute_name_class = attribute_name.replace(\"_\", \"\").title() %}\n\n{% if \"tshape_dict\" in shape_names %}\n{% set dict_shape = 1 %}\n{% set dict_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_args = attribute_shape_args.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_dict\"), \"None\") %}\n{% set dict_operation_static = attribute_shape_static.get((attribute_name, \"tshape_dict\")) %}\n{% else %}\n{% set dict_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_str\" in shape_names %}\n{% set str_shape = 1 %}\n{% set str_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_args = attribute_shape_args.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_str\"), \"None\") %}\n{% else %}\n{% set str_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_bytes\" in shape_names %}\n{% set bytes_shape = 1 %}\n{% set bytes_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_args = attribute_shape_args.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_bytes\")) %}\n{% else %}\n{% set bytes_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_list\" in shape_names %}\n{% set list_shape = 1 %}\n{% set list_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_list\")) %}\n{% set list_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_list\")) %}\n{% set list_operation_args = attribute_shape_args.get((attribute_name, \"tshape_list\")) %}\n{% set list_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_list\")) %}\n{% set list_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_list\")) %}\n{% set list_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_list\")) %}\n{% else %}\n{% set list_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_type\" in shape_names %}\n{% set type_shape = 1 %}\n{% set type_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_args = attribute_shape_args.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_type\")) %}\n{% set type_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_type\"), \"None\") %}\n{% else %}\n{% set type_shape = 0 %}\n{% endif %}\n\n\n{% set attribute_name_class = attribute_name.replace(\"_\", \"\").title() %}\n\nclass ExpressionAttributeLookupFixed{{attribute_name_class}}(ExpressionAttributeLookupFixedBase):\n    \"\"\"Looking up an attribute value '{{attribute_name}}' of an object.\n\n    Typically code like: source.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_FIXED_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    def computeExpression(self, trace_collection):\n        subnode_expression = self.subnode_expression\n\n{% if dict_shape %}\n{% if dict_operation_static %}\n        if subnode_expression.isExpressionConstantTypeDictRef():\n            return (\n                ExpressionDictOperation{{attribute_name_class}}Ref(\n                   source_ref=self.source_ref\n                ),\n                \"new_expression\",\n                \"Reference to 'dict.{{attribute_name}}' resolved.\"\n            )\n{% endif %}\n        if {% if dict_operation_version_check %}{{dict_operation_version_check}} and {% endif %} \\\n           subnode_expression.hasShapeDictionaryExact():\n            return trace_collection.computedExpressionResult(\n                expression = ExpressionAttributeLookupDict{{attribute_name_class}}(\n                   expression=subnode_expression, source_ref=self.source_ref\n                ),\n                change_tags = \"new_expression\",\n                change_desc = \"Attribute lookup '{{attribute_name}}' on dict shape resolved.\"\n            )\n{% endif %}\n{% if str_shape %}\n{% if str_operation_version_check %}\n        if {{str_operation_version_check}} and subnode_expression.hasShapeStrExact():\n{% else %}\n        if subnode_expression.hasShapeStrExact():\n{% endif %}\n            result = ExpressionAttributeLookupStr{{attribute_name_class}}(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup '{{attribute_name}}' on str shape resolved.\"\n            )\n{% endif %}\n{% if bytes_shape %}\n{% if bytes_operation_version_check %}\n        if {{bytes_operation_version_check}} and subnode_expression.hasShapeBytesExact():\n{% else %}\n        if subnode_expression.hasShapeBytesExact():\n{% endif %}\n            result = ExpressionAttributeLookupBytes{{attribute_name_class}}(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup '{{attribute_name}}' on bytes shape resolved.\"\n            )\n{% endif %}\n{% if list_shape %}\n{% if list_operation_version_check %}\n        if {{list_operation_version_check}} and subnode_expression.hasShapeListExact():\n{% else %}\n        if subnode_expression.hasShapeListExact():\n{% endif %}\n            result = ExpressionAttributeLookupList{{attribute_name_class}}(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup '{{attribute_name}}' on list shape resolved.\"\n            )\n{% endif %}\n{% if type_shape %}\n{% if type_operation_version_check %}\n        if {{type_operation_version_check}} and subnode_expression.hasShapeTypeExact():\n{% else %}\n        if subnode_expression.hasShapeTypeExact():\n{% endif %}\n            result = ExpressionAttributeLookupType{{attribute_name_class}}(\n                expression=subnode_expression, source_ref=self.source_ref\n            )\n\n            return trace_collection.computedExpressionResult(\n                expression=result,\n                change_tags=\"new_expression\",\n                change_desc=\"Attribute lookup '{{attribute_name}}' on type shape resolved.\"\n            )\n{% endif %}\n\n        return subnode_expression.computeExpressionAttribute(\n            lookup_node=self,\n            attribute_name=\"{{attribute_name}}\",\n            trace_collection=trace_collection,\n        )\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseExceptionAttributeLookup(\n            exception_type=exception_type, attribute_name=\"{{attribute_name}}\"\n        )\n\n{% if dict_shape or list_shape %}\n    def onContentEscapes(self, trace_collection):\n        self.subnode_expression.onContentEscapes(trace_collection)\n{% endif %}\n\nattribute_classes[\"{{attribute_name}}\"] = ExpressionAttributeLookupFixed{{attribute_name_class}}\n\n{% if dict_shape %}\n\n{% if dict_operation_version_presence %}\nfrom nuitka.specs.BuiltinDictOperationSpecs import dict_{{attribute_name}}_spec\n{% if python3_operation_name %}\nfrom .DictionaryNodes import ExpressionDictOperation{{attribute_name_class}}\nfrom .DictionaryNodes import ExpressionDictOperation{{python3_operation_name.title()}}\n{% else %}\n{% if dict_operation_variation %}\n{% for count in reversed(dict_operation_variation) %}\nfrom .DictionaryNodes import {{translateNodeClassName(\"ExpressionDictOperation\" + attribute_name_class + str(count+1))}}\n{% endfor %}\n{% else %}\nfrom .DictionaryNodes import {{translateNodeClassName(\"ExpressionDictOperation\" + attribute_name_class)}}\n{% endif %}\n{% endif %}\n{% endif %}\n\n{% if dict_operation_static %}\nfrom .DictionaryNodes import ExpressionDictOperation{{attribute_name_class}}Ref\n{% endif %}\n\nclass ExpressionAttributeLookupDict{{attribute_name_class}}(SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixed{{attribute_name_class}}):\n    \"\"\"Attribute '{{attribute_name}}' lookup on a dict value.\n\n    Typically code like: some_dict.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_DICT_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n{% if attribute_name not in (\n    \"keys\", \"values\", \"items\",\n    \"iterkeys\", \"itervalues\", \"iteritems\",\n    \"viewkeys\", \"viewvalues\", \"viewitems\",\n    \"get\", \"has_key\", \"fromkeys\") %}\n        # Might be used to modify the dict.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n{% else %}\n        # Cannot be used to modify the dict.\n{% endif %}\n        return self, None, None\n\n{% if dict_operation_version_presence %}\n    @staticmethod\n    def _computeExpressionCall(call_node, dict_arg, trace_collection):\n        def wrapExpressionDictOperation{{attribute_name_class}}({{formatArgs(dict_operation_args, starting=True, finishing=False)}} source_ref):\n{% if python3_operation_name %}\n            if str is bytes:\n                return ExpressionDictOperation{{attribute_name_class}}(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionDictOperation{{python3_operation_name.title()}}(\n                    dict_arg=dict_arg, source_ref=source_ref\n                )\n{% else %}\n{% if dict_operation_variation %}\n{% for count in reversed(dict_operation_variation[1:]) %}\n            {{\"if\" if count == dict_operation_variation[-1] else \"elif\"}} {{dict_operation_args[count-1]}} {{dict_operation_arg_tests[count-1]}}:\n                return {{translateNodeClassName(\"ExpressionDictOperation\" + attribute_name_class + str(count+1))}}(\n                        {% if not dict_operation_static %} dict_arg=dict_arg {% endif %}\n                        {{formatCallArgs(dict_operation_node_arg_mapping, dict_operation_args[:count], starting=dict_operation_static)}},\n                        source_ref=source_ref\n                )\n{% endfor %}\n            else:\n                return {{translateNodeClassName(\"ExpressionDictOperation\" + attribute_name_class + str(dict_operation_variation[0]+1))}}(\n                    {% if not dict_operation_static %} dict_arg=dict_arg {% endif %}\n                    {{formatCallArgs(dict_operation_node_arg_mapping, dict_operation_args[:dict_operation_variation[0]], starting=dict_operation_static)}},\n                    source_ref=source_ref\n                )\n\n{% else %}\n            return {{translateNodeClassName(\"ExpressionDictOperation\" + attribute_name_class)}}(\n                dict_arg=dict_arg {{formatCallArgs(dict_operation_node_arg_mapping, dict_operation_args, starting=False)}}, source_ref=source_ref\n            )\n{% endif %}\n{% endif %}\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionDictOperation{{attribute_name_class}},\n            builtin_spec=dict_{{attribute_name}}_spec,\n{% if dict_operation_empty != \"None\" %}\n            empty_special_class={{dict_operation_empty}}\n{% endif %}\n        )\n\n{% if dict_operation_static %}\n        result = wrapExpressionWithNodeSideEffects(\n            old_node=dict_arg,\n            new_node=result\n        )\n{% endif %}\n\n        return trace_collection.computedExpressionResult(\n            expression = result,\n            change_tags = \"new_expression\",\n            change_desc = \"Call to '{{attribute_name}}' of dictionary recognized.\"\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(call_node, self.subnode_expression, trace_collection)\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        dict_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, dict_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n{% else %}\n    # No computeExpressionCall as dict operation ExpressionDictOperation{{attribute_name_class}} is not yet implemented\n{% endif %}\n\nattribute_typed_classes.add(ExpressionAttributeLookupDict{{attribute_name_class}})\n\n{% endif %}\n\n{% if str_shape %}\n\n{% if str_operation_version_presence %}\nfrom nuitka.specs.BuiltinStrOperationSpecs import str_{{attribute_name}}_spec\n{% if str_operation_variation %}\n{% for count in reversed(str_operation_variation) %}\nfrom .StrNodes import {{translateNodeClassName(\"ExpressionStrOperation\" + attribute_name_class + str(count+1))}}\n{% endfor %}\n{% else %}\nfrom .StrNodes import {{translateNodeClassName(\"ExpressionStrOperation\" + attribute_name_class)}}\n{% endif %}\n{% endif %}\n\nclass ExpressionAttributeLookupStr{{attribute_name_class}}(SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixed{{attribute_name_class}}):\n    \"\"\"Attribute '{{attribute_name}}' lookup on a str value.\n\n    Typically code like: some_str.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_STR_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n{% if str_operation_version_presence %}\n    @staticmethod\n    def _computeExpressionCall(call_node, str_arg, trace_collection):\n        def wrapExpressionStrOperation{{attribute_name_class}}({{formatArgs(str_operation_args, starting=True, finishing=False)}} source_ref):\n{% if str_operation_variation %}\n{% for count in reversed(str_operation_variation[1:]) %}\n            {{\"if\" if count == str_operation_variation[-1] else \"elif\"}} {{str_operation_args[count-1]}} {{str_operation_arg_tests[count-1]}}:\n                return {{translateNodeClassName(\"ExpressionStrOperation\" + attribute_name_class + str(count+1))}}(\n                    str_arg=str_arg {{formatCallArgs(str_operation_node_arg_mapping, str_operation_args[:count], starting=False)}}, source_ref=source_ref\n                )\n{% endfor %}\n            else:\n                return {{translateNodeClassName(\"ExpressionStrOperation\" + attribute_name_class + str(str_operation_variation[0]+1))}}(\n                    str_arg=str_arg {{formatCallArgs(str_operation_node_arg_mapping, str_operation_args[:str_operation_variation[0]], starting=False)}}, source_ref=source_ref\n                )\n\n{% else %}\n            return {{translateNodeClassName(\"ExpressionStrOperation\" + attribute_name_class)}}(\n                str_arg=str_arg {{formatCallArgs(str_operation_node_arg_mapping, str_operation_args, starting=False)}}, source_ref=source_ref\n            )\n{% endif %}\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionStrOperation{{attribute_name_class}},\n            builtin_spec=str_{{attribute_name}}_spec,\n{% if str_operation_empty != \"None\" %}\n            empty_special_class={{str_operation_empty}}\n{% endif %}\n        )\n\n        return result, \"new_expression\", \"Call to '{{attribute_name}}' of str recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(call_node, self.subnode_expression, trace_collection)\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        str_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, str_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n{% else %}\n    # No computeExpressionCall as str operation ExpressionStrOperation{{attribute_name_class}} is not yet implemented\n{% endif %}\n\nattribute_typed_classes.add(ExpressionAttributeLookupStr{{attribute_name_class}})\n\n{% endif %}\n\n{% if \"tshape_bytes\" in shape_names %}\n\n{% if bytes_operation_version_presence %}\nfrom nuitka.specs.BuiltinBytesOperationSpecs import bytes_{{attribute_name}}_spec\n{% if bytes_operation_variation %}\n{% for count in reversed(bytes_operation_variation) %}\nfrom .BytesNodes import {{translateNodeClassName(\"ExpressionBytesOperation\" + attribute_name_class + str(count+1))}}\n{% endfor %}\n{% else %}\nfrom .BytesNodes import {{translateNodeClassName(\"ExpressionBytesOperation\" + attribute_name_class)}}\n{% endif %}\n{% endif %}\n\nclass ExpressionAttributeLookupBytes{{attribute_name_class}}(SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixed{{attribute_name_class}}):\n    \"\"\"Attribute '{{attribute_name}}' lookup on a bytes value.\n\n    Typically code like: some_bytes.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_BYTES_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        return self, None, None\n\n{% if bytes_operation_version_presence %}\n    @staticmethod\n    def _computeExpressionCall(call_node, bytes_arg, trace_collection):\n        def wrapExpressionBytesOperation{{attribute_name_class}}({{formatArgs(bytes_operation_args, starting=True, finishing=False)}} source_ref):\n{% if python3_operation_name %}\n            if str is bytes:\n                return ExpressionBytesOperation{{attribute_name_class}}(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionBytesOperation{{python3_operation_name.title()}}(\n                    bytes_arg=bytes_arg, source_ref=source_ref\n                )\n{% else %}\n{% if bytes_operation_variation %}\n{% for count in reversed(bytes_operation_variation[1:]) %}\n            {{\"if\" if count == bytes_operation_variation[-1] else \"elif\"}} {{bytes_operation_args[count-1]}} {{bytes_operation_arg_tests[count-1]}}:\n                return {{translateNodeClassName(\"ExpressionBytesOperation\" + attribute_name_class + str(count+1))}}(\n                    bytes_arg=bytes_arg {{formatCallArgs(bytes_operation_node_arg_mapping, bytes_operation_args[:count], starting=False)}}, source_ref=source_ref\n                )\n{% endfor %}\n            else:\n                return {{translateNodeClassName(\"ExpressionBytesOperation\" + attribute_name_class + str(bytes_operation_variation[0]+1))}}(\n                    bytes_arg=bytes_arg {{formatCallArgs(bytes_operation_node_arg_mapping, bytes_operation_args[:bytes_operation_variation[0]], starting=False)}}, source_ref=source_ref\n                )\n\n{% else %}\n            return {{translateNodeClassName(\"ExpressionBytesOperation\" + attribute_name_class)}}(\n                bytes_arg=bytes_arg {{formatCallArgs(bytes_operation_node_arg_mapping, bytes_operation_args, starting=False)}}, source_ref=source_ref\n            )\n{% endif %}\n{% endif %}\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionBytesOperation{{attribute_name_class}},\n            builtin_spec=bytes_{{attribute_name}}_spec,\n        )\n\n        return result, \"new_expression\", \"Call to '{{attribute_name}}' of bytes recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(call_node, self.subnode_expression, trace_collection)\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        bytes_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, bytes_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n{% else %}\n    # No computeExpressionCall as bytes operation ExpressionBytesOperation{{attribute_name_class}} is not yet implemented\n{% endif %}\n\nattribute_typed_classes.add(ExpressionAttributeLookupBytes{{attribute_name_class}})\n\n{% endif %}\n\n{% if \"tshape_list\" in shape_names %}\n\n{% if list_operation_version_presence %}\nfrom nuitka.specs.BuiltinListOperationSpecs import list_{{attribute_name}}_spec\n{% if python3_operation_name %}\nfrom .ListOperationNodes import ExpressionListOperation{{attribute_name_class}}\nfrom .ListOperationNodes import ExpressionListOperation{{python3_operation_name.title()}}\n{% else %}\n{% if list_operation_variation %}\n{% for count in reversed(list_operation_variation[1:]) %}\nfrom .ListOperationNodes import ExpressionListOperation{{attribute_name_class}}{{count+1}}\n{% endfor %}\nfrom .ListOperationNodes import ExpressionListOperation{{attribute_name_class}}{{list_operation_variation[0]+1}}\n{% else %}\nfrom .ListOperationNodes import ExpressionListOperation{{attribute_name_class}}\n{% endif %}\n{% endif %}\n{% endif %}\n\nclass ExpressionAttributeLookupList{{attribute_name_class}}(SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixed{{attribute_name_class}}):\n    \"\"\"Attribute {{attribute_name}} lookup on a list value.\n\n    Typically code like: some_list.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_LIST_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    def computeExpression(self, trace_collection):\n{% if attribute_name not in (\"count\", \"index\") %}\n        # Might be used to modify the list.\n        trace_collection.removeKnowledge(self.subnode_expression)\n\n{% else %}\n        # Cannot be used to modify the list.\n{% endif %}\n        return self, None, None\n\n{% if list_operation_version_presence %}\n    @staticmethod\n    def _computeExpressionCall(call_node, list_arg, trace_collection):\n        def wrapExpressionListOperation{{attribute_name_class}}({{formatArgs(list_operation_args, starting=True, finishing=False)}} source_ref):\n{% if python3_operation_name %}\n            if str is bytes:\n                return ExpressionListOperation{{attribute_name_class}}(\n                    list_arg=list_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionListOperation{{python3_operation_name.title()}}(\n                    list_arg=list_arg, source_ref=source_ref\n                )\n{% else %}\n{% if list_operation_variation %}\n{% for count in reversed(list_operation_variation[1:]) %}\n            {{\"if\" if count == list_operation_variation[-1] else \"elif\"}} {{list_operation_args[count-1]}} {{list_operation_arg_tests[count-1]}}:\n                return ExpressionListOperation{{attribute_name_class}}{{count+1}}(\n                    list_arg=list_arg {{formatCallArgs(list_operation_node_arg_mapping, list_operation_args[:count], starting=False)}}, source_ref=source_ref\n                )\n{% endfor %}\n            else:\n                return ExpressionListOperation{{attribute_name_class}}{{list_operation_variation[0]+1}}(\n                    list_arg=list_arg {{formatCallArgs(list_operation_node_arg_mapping, list_operation_args[:list_operation_variation[0]], starting=False)}}, source_ref=source_ref\n                )\n\n{% else %}\n            return ExpressionListOperation{{attribute_name_class}}(\n                list_arg=list_arg {{formatCallArgs(list_operation_node_arg_mapping, list_operation_args, starting=False)}}, source_ref=source_ref\n            )\n{% endif %}\n{% endif %}\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionListOperation{{attribute_name_class}},\n            builtin_spec=list_{{attribute_name}}_spec,\n        )\n\n        return result, \"new_expression\", \"Call to '{{attribute_name}}' of list recognized.\"\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(call_node, self.subnode_expression, trace_collection)\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        list_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, list_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n{% else %}\n    # No computeExpressionCall as list operation ExpressionListOperation{{attribute_name_class}} is not yet implemented\n{% endif %}\n\nattribute_typed_classes.add(ExpressionAttributeLookupList{{attribute_name_class}})\n\n{% endif %}\n\n\n{% if \"tshape_type\" in shape_names %}\n\n{% if type_operation_version_presence %}\nfrom nuitka.specs.BuiltinTypeOperationSpecs import type_{{attribute_name}}_spec\nfrom .BuiltinTypeNodes import ExpressionTypeOperation{{attribute_name_class}}\n{% endif %}\n\nclass ExpressionAttributeLookupType{{attribute_name_class}}(SideEffectsFromChildrenMixin, ExpressionAttributeLookupFixed{{attribute_name_class}}):\n    \"\"\"Attribute '{{attribute_name}}' lookup on a type value.\n\n    Typically code like: some_type.{{attribute_name}}\n    \"\"\"\n\n    kind = \"EXPRESSION_ATTRIBUTE_LOOKUP_TYPE_{{attribute_name_class.upper()}}\"\n    attribute_name = \"{{attribute_name}}\"\n\n    # There is nothing to compute for it as a value.\n    # TODO: Enable this once we can also say removal of knowable for an argument.\n    # auto_compute_handling = \"final,no_raise\"\n\n    def computeExpression(self, trace_collection):\n        # Cannot be used to modify the type.\n        return self, None, None\n\n{% if type_operation_version_presence %}\n    @staticmethod\n    def _computeExpressionCall(call_node, type_arg, trace_collection):\n        def wrapExpressionTypeOperation{{attribute_name_class}}({{formatArgs(type_operation_args, starting=True, finishing=False)}} source_ref):\n{% if python3_operation_name %}\n            if str is bytes:\n                return ExpressionTypeOperation{{attribute_name_class}}(\n                    type_arg=type_arg, source_ref=source_ref\n                )\n            else:\n                return ExpressionTypeOperation{{python3_operation_name.title()}}(\n                    type_arg=type_arg, source_ref=source_ref\n                )\n{% else %}\n{% if type_operation_variation %}\n{% for count in reversed(type_operation_variation[1:]) %}\n            {{\"if\" if count == type_operation_variation[-1] else \"elif\"}} {{type_operation_args[count-1]}} {{type_operation_arg_tests[count-1]}}:\n                return {{translateNodeClassName(\"ExpressionTypeOperation\" + attribute_name_class + str(count+1))}}(\n                        type_arg=type_arg\n                        {{formatCallArgs(type_operation_node_arg_mapping, type_operation_args[:count], starting=False)}},\n                        source_ref=source_ref\n                )\n{% endfor %}\n            else:\n                return {{translateNodeClassName(\"ExpressionTypeOperation\" + attribute_name_class + str(type_operation_variation[0]+1))}}(\n                    type_arg=type_arg\n                    {{formatCallArgs(type_operation_node_arg_mapping, type_operation_args[:type_operation_variation[0]], starting=False)}},\n                    source_ref=source_ref\n                )\n\n{% else %}\n            return {{translateNodeClassName(\"ExpressionTypeOperation\" + attribute_name_class)}}(\n                type_arg=type_arg {{formatCallArgs(type_operation_node_arg_mapping, type_operation_args, starting=False)}}, source_ref=source_ref\n            )\n{% endif %}\n{% endif %}\n\n        # Anything may happen. On next pass, if replaced, we might be better\n        # but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n        # Make sure we wait with knowing if the content is safe to use until its time.\n        call_node.onContentEscapes(trace_collection)\n\n        result = extractBuiltinArgs(\n            node=call_node,\n            builtin_class=wrapExpressionTypeOperation{{attribute_name_class}},\n            builtin_spec=type_{{attribute_name}}_spec,\n{% if type_operation_empty != \"None\" %}\n            empty_special_class={{type_operation_empty}}\n{% endif %}\n        )\n\n        return trace_collection.computedExpressionResult(\n            expression = result,\n            change_tags = \"new_expression\",\n            change_desc = \"Call to '{{attribute_name}}' of type recognized.\"\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        return self._computeExpressionCall(call_node, self.subnode_expression, trace_collection)\n\n    def computeExpressionCallViaVariable(\n        self, call_node, variable_ref_node, call_args, call_kw, trace_collection\n    ):\n        type_node = makeExpressionAttributeLookup(\n            expression=variable_ref_node,\n            attribute_name=\"__self__\",\n            # TODO: Would be nice to have the real source reference here, but it feels\n            # a bit expensive.\n            source_ref=variable_ref_node.source_ref,\n        )\n\n        return self._computeExpressionCall(call_node, type_node, trace_collection)\n\n    def mayRaiseException(self, exception_type):\n        return self.subnode_expression.mayRaiseException(exception_type)\n{% else %}\n    # No computeExpressionCall as type operation ExpressionTypeOperation{{attribute_name_class}} is not yet implemented\n{% endif %}\n\nattribute_typed_classes.add(ExpressionAttributeLookupType{{attribute_name_class}})\n\n{% endif %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/tools/specialize/templates_python/BuiltinOperationNodeBases.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro make_bytes_class(class_name, arg_names) %}\n{% set bytes_operation_arg_types = {} %}\n{% set bytes_operation_mixin_name = addChildrenMixin(True, False, class_name, (\"bytes_arg\",) + arg_names, bytes_operation_arg_types, {}) %}\nfrom .ChildrenHavingMixins import {{bytes_operation_mixin_name}}\n\nclass {{class_name}}(\n{% for extra_mixin in bytes_operation_mixin_classes %}\n    {{extra_mixin.rsplit(\".\", 1)[1]}},\n{% endfor %}\n    {{bytes_operation_mixin_name}},\n    ExpressionBase):\n    named_children = (\"bytes_arg\",\n{% for named_child in arg_names %}\n{% if named_child in bytes_operation_arg_types %}\n        \"{{named_child}}|{{bytes_operation_arg_types[named_child]}}\",\n{% else %}\n        \"{{named_child}}\",\n{% endif %}\n{% endfor %}\n    )\n\n    def __init__(self, bytes_arg,\n{{formatArgs(arg_names, starting=True, finishing=False)}} source_ref):\n        {{bytes_operation_mixin_name}}.__init__(self, bytes_arg = bytes_arg,\n{% for named_child in arg_names %}\n            {{named_child}} = {{named_child}},\n{% endfor %}\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            ( self.subnode_bytes_arg.isCompileTimeConstant()\n{% for named_child in arg_names %}\n                and self.subnode_{{named_child}}.isCompileTimeConstant()\n{% endfor %}\n            )\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: bytes.{{attribute_name}}(\n                    self.subnode_bytes_arg.getCompileTimeConstant(),\n{% for named_child in arg_names %}\n                    self.subnode_{{named_child}}.getCompileTimeConstant(),\n{% endfor %}\n                ),\n                description=\"Built-in 'bytes.{{attribute_name}}' with constant values.\",\n                user_provided=self.subnode_bytes_arg.user_provided,\n            )\n\n        {# TODO: For actual implementers, lets use this: return self.computeExpressionOperation(trace_collection) #}\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n{#\n    TODO: We could implement computeExpression and do things in a fashion, where\n    we remember raising and compile time constant nature of our children, for now\n    this will work, and ultimately a negative result of this.\n#}\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_bytes_arg.mayRaiseException(exception_type) or\n{% for named_child in arg_names %}\n            self.subnode_{{named_child}}.mayRaiseException(exception_type) or\n{% endfor %}\n            self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n{% endmacro %}\n\n{% macro make_str_class(class_name, arg_names) %}\n{% if attribute_name == \"format\" %}\n{% set str_operation_arg_types = {\"args\": \"tuple\", \"pairs\": \"tuple\"} %}\n{% else %}\n{% set str_operation_arg_types = {} %}\n{% endif %}\n{% set str_operation_mixin_name = addChildrenMixin(True, False, class_name, (\"str_arg\",) + arg_names, str_operation_arg_types, {}) %}\nfrom .ChildrenHavingMixins import {{str_operation_mixin_name}}\n\nclass {{class_name}}(\n{% for extra_mixin in str_operation_mixin_classes %}\n    {{extra_mixin.rsplit(\".\", 1)[1]}},\n{% endfor %}\n    {{str_operation_mixin_name}},\n    ExpressionBase):\n    named_children = (\"str_arg\",\n{% for named_child in arg_names %}\n{% if named_child in str_operation_arg_types %}\n        \"{{named_child}}|{{str_operation_arg_types[named_child]}}\",\n{% else %}\n        \"{{named_child}}\",\n{% endif %}\n{% endfor %}\n    )\n\n    def __init__(self, str_arg,\n{{formatArgs(arg_names, starting=True, finishing=False)}} source_ref):\n        {{str_operation_mixin_name}}.__init__(self, str_arg = str_arg,\n{% for named_child in arg_names %}\n            {{named_child}} = {{named_child}},\n{% endfor %}\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n    def computeExpression(self, trace_collection):\n        if (\n            ( self.subnode_str_arg.isCompileTimeConstant()\n{% for named_child in arg_names %}\n                and self.subnode_{{named_child}}.isCompileTimeConstant()\n{% endfor %}\n            )\n        ):\n            return trace_collection.getCompileTimeComputationResult(\n                node=self,\n                computation=lambda: str.{{attribute_name}}(\n                    self.subnode_str_arg.getCompileTimeConstant(),\n{% for named_child in arg_names %}\n                    self.subnode_{{named_child}}.getCompileTimeConstant(),\n{% endfor %}\n                ),\n                description=\"Built-in 'str.{{attribute_name}}' with constant values.\",\n                user_provided=self.subnode_str_arg.user_provided,\n            )\n\n        {# TODO: For actual implementers, lets use this: return self.computeExpressionOperation(trace_collection) #}\n        if self.mayRaiseExceptionOperation():\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n        return self, None, None\n\n{#\n    TODO: We could implement computeExpression and do things in a fashion, where\n    we remember raising and compile time constant nature of our children, for now\n    this will work, and ultimately a negative result of this.\n#}\n    def mayRaiseException(self, exception_type):\n        return (\n            self.subnode_str_arg.mayRaiseException(exception_type) or\n{% for named_child in arg_names %}\n            self.subnode_{{named_child}}.mayRaiseException(exception_type) or\n{% endfor %}\n            self.mayRaiseExceptionOperation()\n        )\n\n    @abstractmethod\n    def mayRaiseExceptionOperation(self):\n        \"\"\"Does the operation part raise an exception possibly.\"\"\"\n\n{% endmacro %}\n\n\n{% macro make_dict_class(class_name, arg_names) %}\n{% if \"pairs\" in arg_names %}\n{% set dict_operation_arg_types = {\"pairs\": \"tuple\"} %}\n{% else %}\n{% set dict_operation_arg_types = {} %}\n{% endif %}\n{% if dict_operation_static %}\n{% set dict_operation_arg_names = arg_names %}\n{% else %}\n{% set dict_operation_arg_names = (\"dict_arg\",) + arg_names %}\n{% endif %}\n\n{% set dict_operation_mixin_name = addChildrenMixin(True, False, class_name, dict_operation_arg_names, dict_operation_arg_types, {}) %}\nfrom .ChildrenHavingMixins import {{dict_operation_mixin_name}}\n\nclass {{class_name}}(\n{% for extra_mixin in dict_operation_mixin_classes %}\n    {{extra_mixin.rsplit(\".\", 1)[1]}},\n{% endfor %}\n    {{dict_operation_mixin_name}},\n    ExpressionBase):\n    named_children = (\n{% for named_child in dict_operation_arg_names %}\n{% if named_child in dict_operation_arg_types %}\n        \"{{named_child}}|{{dict_operation_arg_types[named_child]}}\",\n{% else %}\n        \"{{named_child}}\",\n{% endif %}\n{% endfor %}\n    )\n\n    def __init__(self,\n{{formatArgs(dict_operation_arg_names, starting=True, finishing=False)}} source_ref):\n        {{dict_operation_mixin_name}}.__init__(self,\n{% for named_child in dict_operation_arg_names %}\n            {{named_child}} = {{named_child}},\n{% endfor %}\n        )\n\n        ExpressionBase.__init__(self, source_ref)\n\n{% endmacro %}\n\n{% set attribute_name_class = attribute_name.replace(\"_\", \"\").title() %}\n\n{% if \"tshape_dict\" in shape_names %}\n{% set dict_shape = 1 %}\n{% set dict_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_args = attribute_shape_args.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_dict\")) %}\n{% set dict_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_dict\"), \"None\") %}\n{% set dict_operation_mixin_classes = attribute_shape_operations_mixin_classes.get((attribute_name, \"tshape_dict\"), ()) %}\n{% set dict_operation_static = attribute_shape_static.get((attribute_name, \"tshape_dict\")) %}\n\n{% else %}\n{% set dict_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_str\" in shape_names %}\n{% set str_shape = 1 %}\n{% set str_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_args = attribute_shape_args.get((attribute_name, \"tshape_str\"), ()) %}\n{% set str_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_str\")) %}\n{% set str_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_str\"), \"None\") %}\n{% set str_operation_mixin_classes = attribute_shape_operations_mixin_classes.get((attribute_name, \"tshape_str\"), ()) %}\n{% else %}\n{% set str_shape = 0 %}\n{% endif %}\n\n{% if \"tshape_bytes\" in shape_names %}\n{% set bytes_shape = 1 %}\n{% set bytes_operation_version_check = attribute_shape_versions.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_version_presence = attribute_shape_operations.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_args = attribute_shape_args.get((attribute_name, \"tshape_bytes\"), ()) %}\n{% set bytes_operation_arg_tests = attribute_shape_arg_tests.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_variation = attribute_shape_variations.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_node_arg_mapping = attribute_shape_node_arg_mapping.get((attribute_name, \"tshape_bytes\")) %}\n{% set bytes_operation_empty = attribute_shape_empty.get((attribute_name, \"tshape_bytes\"), \"None\") %}\n{% set bytes_operation_mixin_classes = attribute_shape_operations_mixin_classes.get((attribute_name, \"tshape_bytes\"), ()) %}\n{% else %}\n{% set bytes_shape = 0 %}\n{% endif %}\n\n\n{% if str_shape %}\n\nfrom .ExpressionBases import ExpressionBase\nfrom abc import abstractmethod\n\n{% for extra_mixin in str_operation_mixin_classes %}\nfrom {{extra_mixin.rsplit(\".\", 1)[0]}} import {{extra_mixin.rsplit(\".\", 1)[1]}}\n{% endfor %}\n\n{% if str_operation_variation %}\n\n{% for count in reversed(str_operation_variation) %}\n{{ make_str_class(\"ExpressionStrOperation\" + attribute_name_class + str(count+1) + \"Base\", str_operation_args[:count] )}}\n{% endfor %}\n\n{% else %}\n{{ make_str_class(\"ExpressionStrOperation\" + attribute_name_class + \"Base\", str_operation_args )}}\n{% endif %}\n\n{% endif %}\n\n{% if bytes_shape %}\n\nfrom .ExpressionBases import ExpressionBase\nfrom abc import abstractmethod\n\n{% for extra_mixin in bytes_operation_mixin_classes %}\nfrom {{extra_mixin.rsplit(\".\", 1)[0]}} import {{extra_mixin.rsplit(\".\", 1)[1]}}\n{% endfor %}\n\n{% if bytes_operation_variation %}\n\n{% for count in reversed(bytes_operation_variation) %}\n{{ make_bytes_class(\"ExpressionBytesOperation\" + attribute_name_class + str(count+1) + \"Base\", bytes_operation_args[:count] )}}\n{% endfor %}\n\n{% else %}\n{{ make_bytes_class(\"ExpressionBytesOperation\" + attribute_name_class + \"Base\", bytes_operation_args )}}\n{% endif %}\n\n{% endif %}\n\n\n{% if dict_shape %}\n\nfrom .ExpressionBases import ExpressionBase\nfrom abc import abstractmethod\n\n{% for extra_mixin in dict_operation_mixin_classes %}\nfrom {{extra_mixin.rsplit(\".\", 1)[0]}} import {{extra_mixin.rsplit(\".\", 1)[1]}}\n{% endfor %}\n\n{% if dict_operation_variation %}\n\n{% for count in reversed(dict_operation_variation) %}\n{{ make_dict_class(\"ExpressionDictOperation\" + attribute_name_class + str(count+1) + \"Base\", dict_operation_args[:count] )}}\n{% endfor %}\n\n{% else %}\n{{ make_dict_class(\"ExpressionDictOperation\" + attribute_name_class + \"Base\", dict_operation_args )}}\n{% endif %}\n\n{% endif %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/tools/specialize/templates_python/ChildrenHavingMixin.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{# macro for code to updating one child value #}\n{% macro named_child_setter_code(named_child, value, needs_parent) %}\n{% if named_child in named_children_checkers %}\n    {{value}} = {{named_children_checkers[named_child]}}({{value}})\n{% endif %}\n{% if needs_parent %}\n{% if named_children_types.get(named_child) == \"tuple\" %}\n    assert type({{value}}) is tuple, type(value)\n\n    for val in {{value}}:\n        val.parent = self\n{% elif named_children_types.get(named_child) == \"optional\" %}\n    if {{value}} is not None:\n        {{value}}.parent = self\n{% else %}\n    {{value}}.parent = self\n{% endif %}\n{% endif %}\n\n    self.subnode_{{named_child}} = {{value}}\n{% endmacro %}\n\n{% if is_statement %}\n{% set base_class = \"StatementBase\" %}\nfrom nuitka.nodes.NodeBases import StatementBase\n{% elif is_compute_final or is_compute_final_children or node_attributes or raise_mode in (\"no_raise\", \"raise\") or awaited_constant_attributes %}\n{% set base_class = \"ExpressionBase\" %}\nfrom nuitka.nodes.ExpressionBases import ExpressionBase\n{% else %}\n{% set base_class = \"object\" %}\n{% endif %}\n\n{% if named_children and is_expression %}\nfrom nuitka.nodes.NodeMakingHelpers import wrapExpressionWithSideEffects\n{% endif %}\n{% if not is_compute_final and named_children and base_class == \"ExpressionBase\" %}\nfrom abc import abstractmethod\n{% endif %}\n{% if is_compute_statement %}\nfrom abc import abstractmethod\n{% endif %}\n\nclass {{mixin_name}}({{base_class}}):\n    # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot\n    __slots__ = ()\n\n    # This is generated for use in\n{% for node_class_name in intended_for %}\n    #   {{node_class_name}}\n{% endfor %}\n\n{% if named_children or node_attributes %}\n    def __init__(self,\n{% for named_child in named_children %}\n                 {{named_child}},\n{% endfor %}\n{% for node_attribute in node_attributes %}\n                 {{node_attribute}},\n{% endfor %}\n{% if base_class in (\"ExpressionBase\", \"StatementBase\") %}\n                 source_ref\n{% endif %}\n    ):\n{% for named_child in named_children %}\n{% if named_child in named_children_checkers %}\n        {{named_child}} = {{named_children_checkers[named_child]}}({{named_child}})\n{% endif %}\n{% if named_children_types.get(named_child) == \"tuple\" %}\n        assert type({{named_child}}) is tuple\n\n        for val in {{named_child}}:\n            val.parent = self\n{% elif named_children_types.get(named_child) == \"optional\" %}\n        if {{named_child}} is not None:\n            {{named_child}}.parent = self\n{% else %}\n        {{named_child}}.parent = self\n{% endif %}\n\n        self.subnode_{{named_child}} = {{named_child}}\n\n{% endfor %}\n{% for node_attribute in node_attributes %}\n        self.{{node_attribute}} = {{node_attribute}}\n{% endfor %}\n\n{% if base_class != \"object\" %}\n        {{base_class}}.__init__(self, source_ref)\n{% endif %}\n\n{% if has_post_node_init %}\n        self.postInitNode()\n{% endif %}\n\n{% if has_post_node_init %}\n    @abstractmethod\n    def postInitNode(self):\n        \"\"\"For overload\"\"\"\n{% endif %}\n\n{% if node_attributes %}\n    def getDetails(self):\n        return {\n{% for node_attribute in node_attributes %}\n            \"{{node_attribute}}\" : self.{{node_attribute}},\n{% endfor %}\n        }\n{% endif %}\n\n{% for named_child in children_mixing_setters_needed %}\n    def setChild{{named_child.title().replace(\"_\", \"\")}}(self, value):\n{{ named_child_setter_code(named_child, \"value\", needs_parent=True) | indent(8, True) }}\n{% endfor %}\n\n    def getVisitableNodes(self):\n        \"\"\" The visitable nodes, with tuple values flattened. \"\"\"\n\n{% if \"tuple\" not in named_children_types.values() and \"optional\" not in named_children_types.values() %}\n        return (\n{% for named_child in named_children %}\n            self.subnode_{{named_child}},\n{% endfor %}\n        )\n{% elif len(named_children) == 1 and named_children_types.get(named_children[0]) == \"tuple\" %}\n        return self.subnode_{{named_children[0]}}\n{% elif len(named_children) == 1 and named_children_types.get(named_children[0]) == \"optional\" %}\n        value = self.subnode_{{named_children[0]}}\n\n        {# In this case, generator is not faster. #}\n        if value is None:\n            return ()\n        else:\n            return (value,)\n{% elif len(named_children) == 1 %}\n        return (self.subnode_{{named_children[0]}},)\n{% else %}\n        result = []\n{% for named_child in named_children %}\n{% if named_children_types.get(named_child) == \"optional\" %}\n        value = self.subnode_{{named_child}}\n        if value is None:\n            pass\n        else:\n            result.append(value)\n{% elif named_children_types.get(named_child) == \"tuple\" %}\n        result.extend(self.subnode_{{named_child}})\n{% else %}\n        result.append(self.subnode_{{named_child}})\n{% endif %}\n{% endfor %}\n        return tuple(result)\n{% endif %}\n\n    def getVisitableNodesNamed(self):\n        \"\"\"Named children dictionary.\n\n        For use in cloning nodes, debugging and XML output.\n        \"\"\"\n\n{% if len(named_children) == 1 %}\n        return (\n            (\"{{named_children[0]}}\", self.subnode_{{named_children[0]}}),\n        )\n{% else %}\n        return (\n{% for named_child in named_children %}\n            (\"{{named_child}}\", self.subnode_{{named_child}}),\n{% endfor %}\n        )\n{% endif %}\n\n    def replaceChild(self, old_node, new_node):\n{% for named_child in named_children %}\n        value = self.subnode_{{named_child}}\n{% if named_children_types.get(named_child) == \"tuple\" %}\n        if old_node in value:\n            if new_node is not None:\n                new_node.parent = self\n\n                self.subnode_{{named_child}} = tuple(\n                    (val if val is not old_node else new_node)\n                    for val in value\n                )\n            else:\n                self.subnode_{{named_child}} = tuple(\n                    val\n                    for val in value\n                    if val is not old_node\n                )\n\n\n            return\n{% else %}\n        if old_node is value:\n{{ named_child_setter_code(named_child, \"new_node\", needs_parent=True) | indent(8, True) }}\n            return\n{% endif %}\n\n{% endfor %}\n        raise AssertionError(\"Didn't find child\", old_node, \"in\", self)\n\n    def getCloneArgs(self):\n        \"\"\" Get clones of all children to pass for a new node.\n\n            Needs to make clones of child nodes too.\n        \"\"\"\n\n        values = {\n{% for named_child in named_children %}\n{% if named_children_types.get(named_child) == \"tuple\" %}\n            \"{{named_child}}\" : tuple(v.makeClone() for v in self.subnode_{{named_child}}),\n{% elif named_children_types.get(named_child) == \"optional\" %}\n            \"{{named_child}}\" : self.subnode_{{named_child}}.makeClone() if self.subnode_{{named_child}} is not None else None,\n{% else %}\n            \"{{named_child}}\" : self.subnode_{{named_child}}.makeClone(),\n{% endif %}\n{% endfor %}\n        }\n\n        values.update(self.getDetails())\n\n        return values\n\n{% endif %}\n\n    def finalize(self):\n        del self.parent\n\n{% for named_child in named_children %}\n{% if named_children_types.get(named_child) == \"optional\" %}\n        if self.subnode_{{named_child}} is not None:\n            self.subnode_{{named_child}}.finalize()\n{% elif named_children_types.get(named_child) == \"tuple\" %}\n        for c in self.subnode_{{named_child}}:\n            c.finalize()\n{% else %}\n        self.subnode_{{named_child}}.finalize()\n{% endif %}\n        del self.subnode_{{named_child}}\n{% endfor %}\n\n{% for node_attribute in node_attributes %}\n{% if node_attribute in (\"locals_scope\", \"target_scope\", \"variable\") %}\n        del self.{{node_attribute}}\n{% endif %}\n{% endfor %}\n\n\n{% if is_expression %}\n    def computeExpressionRaw(self, trace_collection):\n        \"\"\"Compute an expression.\n\n        Default behavior is to just visit the child expressions first, and\n        then the node \"computeExpression\". For a few cases this needs to\n        be overloaded, e.g. conditional expressions.\n        \"\"\"\n\n{% if named_children and not is_compute_final_children %}\n{% if len(named_children) == 1 %}\n{% if named_children_types.get(named_children[0]) == \"tuple\" %}\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        {# Keep this around, so we can look up its index, even after it got replaced. This\n           avoids an enumeration that will not be used unless something will raise an\n           exception. #}\n        old_subnode_{{named_children[0]}} = self.subnode_{{named_children[0]}}\n\n        for sub_expression in old_subnode_{{named_children[0]}}:\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=self.subnode_{{named_children[0]}}[:old_subnode_{{named_children[0]}}.index(sub_expression)],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n{% else %}\n        # First apply the sub-expression, as they it's evaluated before.\n{% if named_children_types.get(named_children[0]) == \"optional\" %}\n        expression = self.subnode_{{named_children[0]}}\n\n        if expression is not None:\n            expression = trace_collection.onExpression(expression)\n\n            if expression.willRaiseAnyException():\n                return (\n                    expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n{% else %}\n        expression = trace_collection.onExpression(self.subnode_{{named_children[0]}})\n\n        if expression.willRaiseAnyException():\n            return (\n                expression,\n                \"new_raise\",\n                lambda: \"For '%s' the child expression '%s' will raise.\"\n                % (self.getChildNameNice(), expression.getChildNameNice()),\n            )\n{% endif %}\n{% endif %}\n{% else %}\n        # First apply the sub-expressions, as they are evaluated before\n        # the actual operation.\n        for count, sub_expression in enumerate(self.getVisitableNodes()):\n            expression = trace_collection.onExpression(sub_expression)\n\n            if expression.willRaiseAnyException():\n                sub_expressions = self.getVisitableNodes()\n\n                wrapped_expression = wrapExpressionWithSideEffects(\n                    side_effects=sub_expressions[:count],\n                    old_node=sub_expression,\n                    new_node=expression,\n                )\n\n                return (\n                    wrapped_expression,\n                    \"new_raise\",\n                    lambda: \"For '%s' the child expression '%s' will raise.\"\n                    % (self.getChildNameNice(), expression.getChildNameNice()),\n                )\n{% endif %}\n{% endif %}\n\n{% for named_child in awaited_constant_attributes %}\n        if self.subnode_{{named_child}}.isCompileTimeConstant():\n{% if raise_mode in (\"raise\", \"raise_operation\") %}\n            try:\n                return self.computeExpressionConstant{{named_child.title()}}(trace_collection)\n            finally:\n{% if raise_mode ==\"raise\" %}\n                trace_collection.onExceptionRaiseExit(BaseException)\n{% elif raise_mode ==\"raise_operation\" %}\n                if self.mayRaiseExceptionOperation():\n                    trace_collection.onExceptionRaiseExit(BaseException)\n{% endif %}\n{% else %}\n            return self.computeExpressionConstant{{named_child.title()}}(trace_collection)\n{% endif %}\n{% endfor %}\n\n{% if is_compute_final %}\n{% if raise_mode != \"no_raise\" %}\n        trace_collection.onExceptionRaiseExit(BaseException)\n{% endif %}\n        return self, None, None\n{% else %}\n        # Then ask ourselves to work on it.\n        return self.computeExpression(trace_collection)\n{% endif %}\n\n{% if raise_mode == \"no_raise\" %}\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return False\n\n{% if named_children %}\n    def mayRaiseException(self, exception_type):\n        return \\\n{% for named_child in named_children %}\n{% if named_children_types.get(named_child) == \"optional\" %}\n            (self.subnode_{{named_child}} is not None and self.subnode_{{named_child}}.mayRaiseException(exception_type)) \\\n{% elif named_children_types.get(named_child) == \"tuple\" %}\n            any(value.mayRaiseException(exception_type) for value in self.subnode_{{named_child}}) \\\n{% else %}\n            self.subnode_{{named_child}}.mayRaiseException(exception_type) \\\n{% endif %}\n{% if named_child != named_children[-1] %}\n            or \\\n{% endif %}\n{% endfor %}\n{% else %}\n    @staticmethod\n    def mayRaiseException(exception_type):\n        return False\n{% endif %}\n\n{% endif %}\n\n{# TODO: Should make it abstract for mere mixins too, but too much work now. #}\n{% if not is_compute_final and named_children and base_class == \"ExpressionBase\" %}\n    @abstractmethod\n    def computeExpression(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n{% endif %}\n\n{% endif %}\n\n{% if is_compute_statement %}\n    def computeStatement(self, trace_collection):\n        {# TODO: Role this out for better performance and eliminate computeStatementSubExpressions globally #}\n        result, change_tags, change_desc = self.computeStatementSubExpressions(\n            trace_collection=trace_collection\n        )\n\n        if result is not self:\n            return result, change_tags, change_desc\n\n        return self.computeStatementOperation(trace_collection)\n\n    @abstractmethod\n    def computeStatementOperation(self, trace_collection):\n        \"\"\"Must be overloaded for non-final node.\"\"\"\n{% endif %}\n\n    def collectVariableAccesses(self, emit_read, emit_write):\n        \"\"\" Collect variable reads and writes of child nodes.\"\"\"\n\n{% for named_child in named_children %}\n{% if named_children_types.get(named_child) == \"optional\" %}\n        subnode_{{named_child}} = self.subnode_{{named_child}}\n\n        if subnode_{{named_child}} is not None:\n            self.subnode_{{named_child}}.collectVariableAccesses(emit_read, emit_write)\n{% elif named_children_types.get(named_child) == \"tuple\" %}\n        for element in self.subnode_{{named_child}}:\n            element.collectVariableAccesses(emit_read, emit_write)\n{% else  %}\n        self.subnode_{{named_child}}.collectVariableAccesses(emit_read, emit_write)\n{% endif %}\n{% endfor %}\n\n{% for named_child in awaited_constant_attributes %}\n    @abstractmethod\n    def computeExpressionConstant{{named_child.title()}}(self, trace_collection):\n        \"\"\"Called when attribute {{named_child}} is constant.\"\"\"\n{% endfor %}\n\n# Assign the names that are easier to import with a stable name.\n{% for node_class_name in intended_for %}\n{% if base_class in (\"ExpressionBase\", \"StatementBase\") %}\n{{node_class_name}}Base = {{mixin_name}}\n{% else %}\nChildren{{node_class_name}}Mixin = {{mixin_name}}\n{% endif %}\n{% endfor %}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/tools/specialize/templates_python/HardImportCallNode.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\nfrom .ExpressionBases import ExpressionBase\n{% if mixin_name %}\nfrom .ChildrenHavingMixins import {{mixin_name}}\n{% endif %}\nfrom abc import abstractmethod\n\n{% for extra_mixin in extra_mixins %}\nfrom {{extra_mixin.rsplit(\".\", 1)[0]}} import {{extra_mixin.rsplit(\".\", 1)[1]}}\n{% endfor %}\n\nclass Expression{{module_name_title}}{{function_name_title}}{{suffix}}CallBase(\n{% for extra_mixin in extra_mixins %}\n    {{extra_mixin.rsplit(\".\", 1)[1]}},\n{% endfor %}\n{% if mixin_name %}\n    {{mixin_name}},\n{% endif %}\n    ExpressionBase\n):\n    \"\"\"Base class for {{module_name_title}}{{function_name_title}}Call\n\n       Generated boiler plate code.\n    \"\"\"\n{% if python_criterion %}\n    python_version_spec = \"{{python_criterion}}\"\n{% endif %}\n\n{% if mixin_name %}\n    named_children = (\n{% for named_child in named_children %}\n{% if named_child in named_children_types %}\n        \"{{named_child}}|{{named_children_types[named_child]}}\",\n{% else %}\n        \"{{named_child}}\",\n{% endif %}\n{% endfor %}\n    )\n{% endif %}\n\n    __slots__ = (\"attempted\",)\n\n    spec = {{spec_name}}\n\n    def __init__(self,\n{% for named_child in named_children %}\n                      {{named_child}},\n{% endfor %}\n        source_ref):\n\n{% if mixin_name %}\n        {{mixin_name}}.__init__(\n            self,\n{% for named_child in named_children %}\n            {{named_child}} = {{named_child}},\n{% endfor %}\n        )\n{% endif %}\n\n        ExpressionBase.__init__(self, source_ref)\n\n{% if is_stdlib_module %}\n        self.attempted = False\n{% else %}\n        # In module mode, we expect a changing environment, cannot optimize this\n        self.attempted = shallMakeModule()\n{% endif %}\n\n{% if not mixin_name %}\n    def finalize(self):\n        del self.parent\n{% endif %}\n\n{% if mixin_name %}\n    def computeExpression(self, trace_collection):\n{% else %}\n    def computeExpressionRaw(self, trace_collection):\n{% endif %}\n        if (\n            self.attempted\n{% if mixin_name %}\n            or not {{spec_name}}.isCompileTimeComputable(\n                (\n{% for argument_name in argument_names %}\n                    self.subnode_{{argument_name}},\n{% endfor %}\n                )\n{% if star_list_argument_name %}\n                + self.subnode_{{star_list_argument_name}}\n{% endif %}\n{% if star_dict_argument_name %}\n                + self.subnode_{{star_dict_argument_name}}\n{% endif %}\n            )\n{% endif %}\n        ):\n            trace_collection.onExceptionRaiseExit(BaseException)\n\n            return self, None, None\n\n        try:\n            return self.replaceWithCompileTimeValue(trace_collection)\n        finally:\n            self.attempted = True\n\n    @abstractmethod\n    def replaceWithCompileTimeValue(self, trace_collection):\n        pass\n\n    {# TODO: Know this from the spec too, some things won't raise during call. #}\n    @staticmethod\n    def mayRaiseExceptionOperation():\n        return True\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/tools/specialize/templates_python/HardImportReferenceNode.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n{% macro apply_builtin_extraction(spec_name, call_suffix) %}\nfrom nuitka.nodes.{{call_node_module_name}} import {{translateNodeClassName(\"Expression\" + module_name_title + function_name_title + call_suffix + \"Call\")}}\n\nresult = extractBuiltinArgs(\n    node=call_node,\n    builtin_class={{translateNodeClassName(\"Expression\" + module_name_title + function_name_title + call_suffix + \"Call\")}},\n    builtin_spec={{spec_name}},\n)\n\nreturn (\n    result,\n    \"new_expression\",\n    \"Call to '{{module_name}}.{{function_name}}' recognized.\",\n)\n{% endmacro %}\n\nfrom nuitka.Options import shallMakeModule\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.nodes.ImportHardNodes import ExpressionImportModuleNameHardExistsSpecificBase\nfrom nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs\nfrom nuitka.specs.HardImportSpecs import (\n{% for spec in specs %}\n    {{spec.spec_name}},\n{% endfor %}\n)\n{% if module_name == \"os.path\" %}\nimport os\n{% endif %}\n\nclass Expression{{module_name_title}}{{function_name_title}}Ref(\n    ExpressionImportModuleNameHardExistsSpecificBase\n):\n    \"\"\"Function reference {{module_name}}.{{function_name}}\"\"\"\n\n    kind = \"EXPRESSION_{{module_name_code.upper()}}_{{function_name_code.upper()}}_REF\"\n\n    def __init__(self, source_ref):\n        ExpressionImportModuleNameHardExistsSpecificBase.__init__(\n            self,\n            module_name={%if module_name != 'os.path'%}\"{{module_name}}\" {% else %} os.path.__name__{% endif %},\n            import_name=\"{{function_name}}\",\n            module_guaranteed={% if is_stdlib %}True{% else %}not shallMakeModule(){% endif %},\n            source_ref=source_ref,\n        )\n\n    def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):\n        # Anything may happen on call trace before this. On next pass, if\n        # replaced, we might be better but not now.\n        trace_collection.onExceptionRaiseExit(BaseException)\n\n{% for spec in specs %}\n{% if spec.python_criterion %}\n        if python_version {{spec.python_criterion}}:\n{{apply_builtin_extraction(spec.spec_name, spec.suffix)| indent(12, True)}}\n{% else %}\n{{apply_builtin_extraction(spec.spec_name, spec.suffix)| indent(8, True)}}\n{% endif %}\n{% endfor %}\n\nhard_import_node_classes[Expression{{module_name_title}}{{function_name_title}}Ref] = {{specs[0].spec_name}}\n\n{#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and   #}\n{#     integrates with CPython, but also works on its own.                      #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#        http://www.apache.org/licenses/LICENSE-2.0                            #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "nuitka/tools/testing/Common.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Common test infrastructure functions. To be used by test runners. \"\"\"\n\nimport ast\nimport atexit\nimport gc\nimport os\nimport re\nimport shutil\nimport signal\nimport sys\nimport tempfile\nimport threading\nimport time\nfrom contextlib import contextmanager\nfrom optparse import OptionParser\n\nfrom nuitka.__past__ import md5, subprocess\nfrom nuitka.PythonVersions import getTestExecutionPythonVersions, isDebugPython\nfrom nuitka.Tracing import OurLogger, my_print\nfrom nuitka.tree.SourceHandling import readSourceCodeFromFilename\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.Execution import (\n    check_output,\n    createProcess,\n    getNullInput,\n    getNullOutput,\n)\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getExternalUsePath,\n    getFileContentByLine,\n    getFileContents,\n    getFileList,\n    isFilenameSameAsOrBelowPath,\n    makePath,\n    openTextFile,\n    removeDirectory,\n)\nfrom nuitka.utils.InstalledPythons import findInstalledPython\nfrom nuitka.utils.Jinja2 import getTemplate\nfrom nuitka.utils.Utils import getOS, isMacOS, isWin32Windows\n\nfrom .SearchModes import (\n    SearchModeByPattern,\n    SearchModeCoverage,\n    SearchModeImmediate,\n    SearchModeOnly,\n    SearchModeResume,\n)\n\n# spell-checker: ignore popenargs,pathsep,killpg\n\ntest_logger = OurLogger(\"\", base_style=\"blue\")\n\n\ndef check_result(*popenargs, **kwargs):\n    if \"stdout\" in kwargs:\n        raise ValueError(\"stdout argument not allowed, it will be overridden.\")\n\n    process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)\n    _unused_output, _unused_err = process.communicate()\n    ret_value = process.poll()\n\n    if ret_value:\n        return False\n    else:\n        return True\n\n\n_start_dir = None\n\n\ndef goMainDir():\n    global _start_dir  # singleton, pylint: disable=global-statement\n    _start_dir = os.getcwd()\n\n    # Go its own directory, to have it easy with path knowledge.\n    os.chdir(os.path.dirname(os.path.abspath(sys.modules[\"__main__\"].__file__)))\n\n\ndef getStartDir():\n    return _start_dir\n\n\n_python_version_str = None\n_python_version = None\n_python_arch = None\n_python_executable = None\n_python_vendor = None\n\n\ndef _parsePythonVersionOutput(python_binary):\n    version_output = check_output(\n        (\n            python_binary,\n            \"-c\",\n            \"\"\"\\\nimport sys, os;\\\nprint(\".\".join(str(s) for s in list(sys.version_info)[:3]));\\\nprint((\"x86_64\" if \"AMD64\" in sys.version else \"x86\") if os.name == \"nt\" else os.uname()[4]);\\\nprint(sys.executable);\\\nprint(\"Anaconda\" if os.path.exists(os.path.join(sys.prefix, 'conda-meta')) else \"Unknown\")\\\n\"\"\",\n        ),\n        stderr=subprocess.STDOUT,\n    )\n\n    python_version_str = version_output.split(b\"\\n\")[0].strip()\n    python_arch = version_output.split(b\"\\n\")[1].strip()\n    python_executable = version_output.split(b\"\\n\")[2].strip()\n    python_vendor = version_output.split(b\"\\n\")[3].strip()\n\n    if str is not bytes:\n        python_version_str = python_version_str.decode(\"utf8\")\n        python_arch = python_arch.decode(\"utf8\")\n        python_executable = python_executable.decode(\"utf8\")\n        python_vendor = python_vendor.decode(\"utf8\")\n\n    assert type(python_version_str) is str, repr(python_version_str)\n    assert type(python_arch) is str, repr(python_arch)\n    assert type(python_executable) is str, repr(_python_executable)\n\n    python_version = tuple(int(d) for d in python_version_str.split(\".\"))\n\n    return (\n        python_version,\n        python_version_str,\n        python_arch,\n        python_executable,\n        python_vendor,\n    )\n\n\ndef setup(suite=\"\", needs_io_encoding=False, silent=False, go_main=True):\n    if go_main:\n        goMainDir()\n\n    if \"PYTHON\" not in os.environ:\n        os.environ[\"PYTHON\"] = sys.executable\n\n    # Allow test code to use this to make caching specific.\n    os.environ[\"NUITKA_TEST_SUITE\"] = suite\n\n    # Allow providing 33, 27, and expand that to python2.7\n    if (\n        len(os.environ[\"PYTHON\"]) == 2\n        and os.environ[\"PYTHON\"].isdigit()\n        and not isWin32Windows()\n    ):\n        os.environ[\"PYTHON\"] = \"python%s.%s\" % (\n            os.environ[\"PYTHON\"][0],\n            os.environ[\"PYTHON\"][1],\n        )\n\n    if needs_io_encoding and \"PYTHONIOENCODING\" not in os.environ:\n        os.environ[\"PYTHONIOENCODING\"] = \"utf-8\"\n\n    global _python_version_str, _python_version, _python_arch, _python_executable, _python_vendor  # singleton, pylint: disable=global-statement\n\n    (\n        _python_version,\n        _python_version_str,\n        _python_arch,\n        _python_executable,\n        _python_vendor,\n    ) = _parsePythonVersionOutput(python_binary=os.environ[\"PYTHON\"])\n\n    if not silent:\n        my_print(\"Using concrete python\", _python_version_str, \"on\", _python_arch)\n\n    if \"COVERAGE_FILE\" not in os.environ:\n        os.environ[\"COVERAGE_FILE\"] = os.path.join(\n            os.path.dirname(__file__), \"..\", \"..\", \"..\", \".coverage\"\n        )\n\n    return _python_version\n\n\ndef getPythonArch():\n    return _python_arch\n\n\ndef getPythonVendor():\n    return _python_vendor\n\n\ndef getPythonVersionString():\n    return _python_version_str\n\n\ntmp_dir = None\n\n\ndef getTempDir():\n    # Create a temporary directory to work in, automatically remove it in case\n    # it is empty in the end.\n    global tmp_dir  # singleton, pylint: disable=global-statement\n\n    if tmp_dir is None:\n        tmp_dir = tempfile.mkdtemp(\n            prefix=os.path.basename(\n                os.path.dirname(os.path.abspath(sys.modules[\"__main__\"].__file__))\n            )\n            + \"-\",\n            dir=tempfile.gettempdir() if not os.path.exists(\"/var/tmp\") else \"/var/tmp\",\n        )\n\n        def removeTempDir():\n            removeDirectory(path=tmp_dir, ignore_errors=True)\n\n        atexit.register(removeTempDir)\n\n    return tmp_dir\n\n\ndef convertUsing2to3(path, force=False):\n    command = [os.environ[\"PYTHON\"], \"-m\", \"py_compile\", path]\n\n    if not force:\n        if \"xrange\" not in getFileContents(path):\n            if check_result(command, stderr=getNullOutput()):\n                return path, False\n\n    filename = os.path.basename(path)\n\n    new_path = os.path.join(getTempDir(), filename)\n\n    # This may already be a temp file, e.g. because of construct creation.\n    try:\n        shutil.copy(path, new_path)\n    except shutil.Error:\n        pass\n\n    # For Python2.6 and 3.2 the -m lib2to3 was not yet supported.\n    use_binary = sys.version_info[:2] in ((2, 6), (3, 2))\n\n    if use_binary:\n        # On Windows, we cannot rely on 2to3 to be in the path.\n        if isWin32Windows():\n            command = [\n                sys.executable,\n                os.path.join(os.path.dirname(sys.executable), \"Tools/Scripts/2to3.py\"),\n            ]\n        else:\n            command = [\"2to3\"]\n    else:\n        command = [sys.executable, \"-m\", \"lib2to3\"]\n\n    command += (\"-w\", \"-n\", \"--no-diffs\", new_path)\n\n    try:\n        check_output(command, stderr=getNullOutput())\n\n    except subprocess.CalledProcessError:\n        if isWin32Windows():\n            raise\n\n        command[0:3] = [\"2to3\"]\n\n        check_output(command, stderr=getNullOutput())\n\n    data = getFileContents(new_path)\n\n    with openTextFile(new_path, \"w\") as result_file:\n        result_file.write(\"__file__ = %r\\n\" % os.path.abspath(path))\n        result_file.write(data)\n\n    return new_path, True\n\n\ndef decideFilenameVersionSkip(filename):\n    \"\"\"Make decision whether to skip based on filename and Python version.\n\n    This codifies certain rules that files can have as suffixes or prefixes\n    to make them be part of the set of tests executed for a version or not.\n\n    Generally, an ending of \"<major><minor>.py\" indicates that it must be that\n    Python version or higher. There is no need for ending in \"26.py\" as this\n    is the minimum version anyway.\n\n    The \"_2.py\" indicates a maximum version of 2.7, i.e. not Python 3.x, for\n    language syntax no more supported.\n    \"\"\"\n\n    # This will make many decisions with immediate returns.\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    assert type(filename) is str, repr(filename)\n\n    # Skip runner scripts by default.\n    if filename.startswith(\"run_\"):\n        return False\n\n    if filename.endswith(\".j2\"):\n        filename = filename[:-3]\n\n    # Skip tests that require Python 2.7 at least.\n    if filename.endswith(\"27.py\") and _python_version < (2, 7):\n        return False\n\n    # Skip tests that require Python 2 at maximum.\n    if filename.endswith(\"_2.py\") and _python_version >= (3,):\n        return False\n\n    # Skip tests that require Python 3.7 at maximum.\n    if filename.endswith(\"_37.py\") and _python_version >= (3, 8):\n        return False\n\n    # Skip tests that require Python 3.2 at least.\n    if filename.endswith(\"32.py\") and _python_version < (3, 2):\n        return False\n\n    # Skip tests that require Python 3.3 at least.\n    if filename.endswith(\"33.py\") and _python_version < (3, 3):\n        return False\n\n    # Skip tests that require Python 3.4 at least.\n    if filename.endswith(\"34.py\") and _python_version < (3, 4):\n        return False\n\n    # Skip tests that require Python 3.5 at least.\n    if filename.endswith(\"35.py\") and _python_version < (3, 5):\n        return False\n\n    # Skip tests that require Python 3.6 at least.\n    if filename.endswith(\"36.py\") and _python_version < (3, 6):\n        return False\n\n    # Skip tests that require Python 3.7 at least.\n    if filename.endswith(\"37.py\") and _python_version < (3, 7):\n        return False\n\n    # Skip tests that require Python 3.8 at least.\n    if filename.endswith(\"38.py\") and _python_version < (3, 8):\n        return False\n\n    # Skip tests that require Python 3.9 at least.\n    if filename.endswith(\"39.py\") and _python_version < (3, 9):\n        return False\n\n    # Skip tests that require Python 3.10 at least.\n    if filename.endswith(\"310.py\") and _python_version < (3, 10):\n        return False\n\n    # Skip tests that require Python 3.11 at least.\n    if filename.endswith(\"311.py\") and _python_version < (3, 11):\n        return False\n\n    return True\n\n\ndef decideNeeds2to3(filename):\n    return _python_version >= (3,) and not re.match(r\".*3\\d+\\.py\", filename)\n\n\ndef _removeCPythonTestSuiteDir():\n    # Cleanup, some tests apparently forget that.\n    try:\n        if os.path.isdir(\"@test\"):\n            removeDirectory(\"@test\", ignore_errors=False)\n        elif os.path.isfile(\"@test\"):\n            os.unlink(\"@test\")\n    except OSError:\n        # TODO: Move this into removeDirectory maybe. Doing an external\n        # call as last resort could be a good idea.\n\n        # This seems to work for broken \"lnk\" files.\n        if isWin32Windows():\n            os.system(\"rmdir /S /Q @test\")\n\n        if os.path.exists(\"@test\"):\n            raise\n\n\ndef compareWithCPython(\n    dirname, filename, extra_flags, search_mode, needs_2to3, on_error=None\n):\n    \"\"\"Call the comparison tool. For a given directory filename.\n\n    The search mode decides if the test case aborts on error or gets extra\n    flags that are exceptions.\n\n    \"\"\"\n\n    # Many cases to consider here, pylint: disable=too-many-branches\n\n    if dirname is None:\n        path = filename\n    else:\n        path = os.path.join(dirname, filename)\n\n    # Apply 2to3 conversion if necessary.\n    if needs_2to3:\n        path, converted = convertUsing2to3(path)\n    else:\n        converted = False\n\n    if os.getenv(\"NUITKA_TEST_INSTALLED\", \"\") == \"1\":\n        command = [\n            sys.executable,\n            \"-m\",\n            \"nuitka.tools.testing.compare_with_cpython\",\n            path,\n            \"silent\",\n        ]\n    else:\n        compare_with_cpython = os.path.join(\"..\", \"..\", \"bin\", \"compare_with_cpython\")\n        if os.path.exists(compare_with_cpython):\n            command = [sys.executable, compare_with_cpython, path, \"silent\"]\n        else:\n            test_logger.sysexit(\"Error, cannot locate Nuitka comparison runner.\")\n\n    if extra_flags is not None:\n        command += extra_flags\n\n    command += search_mode.getExtraFlags(dirname, filename)\n\n    # Cleanup before and after test stage directory.\n    _removeCPythonTestSuiteDir()\n\n    try:\n        result = subprocess.call(command)\n    except KeyboardInterrupt:\n        result = 2\n\n    # Cleanup before and after test stage directory.\n    _removeCPythonTestSuiteDir()\n\n    if result != 0 and result != 2 and search_mode.abortOnFinding(dirname, filename):\n        if on_error is not None:\n            on_error(dirname, filename)\n\n        search_mode.onErrorDetected(\"Error exit! %s\" % result)\n\n    if converted:\n        os.unlink(path)\n\n    if result == 2:\n        test_logger.sysexit(\"Interrupted, with CTRL-C\\n\", exit_code=2)\n\n\ndef checkCompilesNotWithCPython(dirname, filename, search_mode):\n    if dirname is None:\n        path = filename\n    else:\n        path = os.path.join(dirname, filename)\n\n    command = [_python_executable, \"-mcompileall\", path]\n\n    try:\n        result = subprocess.call(command)\n    except KeyboardInterrupt:\n        result = 2\n\n    if result != 1 and result != 2 and search_mode.abortOnFinding(dirname, filename):\n        search_mode.onErrorDetected(\"Error exit! %s\" % result)\n\n\ndef checkSucceedsWithCPython(filename):\n    command = [_python_executable, filename]\n\n    result = subprocess.call(command, stdout=getNullOutput(), stderr=subprocess.STDOUT)\n\n    return result == 0\n\n\ndef getDebugPython():\n    # For all Python, if it's the one also executing the runner, which is\n    # very probably the case, we check that. We don't check the provided\n    # binary here, this could be done as well.\n    if sys.executable == os.environ[\"PYTHON\"] and isDebugPython():\n        return sys.executable\n\n    # On Debian systems, these work.\n    debug_python = os.path.join(\"/usr/bin/\", os.environ[\"PYTHON\"] + \"-dbg\")\n    if os.path.exists(debug_python):\n        return debug_python\n\n    # On Fedora systems, these work, but on for Python3\n    debug_python = os.path.join(\"/usr/bin/\", os.environ[\"PYTHON\"] + \"-debug\")\n    if os.path.exists(debug_python) and _parsePythonVersionOutput(debug_python)[0] >= (\n        3,\n    ):\n        return debug_python\n\n    # On Windows systems, these work. TODO: Python asserts in Nuitka with\n    # these, not sure why, pylint: disable=using-constant-test\n    if False:\n        debug_python = os.environ[\"PYTHON\"]\n        if debug_python.lower().endswith(\".exe\"):\n            debug_python = debug_python[:-4]\n        debug_python = debug_python + \"_d.exe\"\n        if os.path.exists(debug_python):\n            return debug_python\n\n    # Otherwise no.\n    return None\n\n\ndef displayRuntimeTraces(logger, path):\n    if not os.path.exists(path):\n        # TODO: Have a logger package passed.\n        logger.sysexit(\"Error, cannot find %r (%r).\" % (path, os.path.abspath(path)))\n\n    path = os.path.abspath(path)\n\n    # TODO: Merge code for building command with below function, this is otherwise\n    # horribly bad.\n\n    if os.name == \"posix\":\n        # Run with traces to help debugging, specifically in CI environment.\n        if getOS() in (\"Darwin\", \"FreeBSD\"):\n            test_logger.info(\"dtruss:\")\n            os.system(\"sudo dtruss %s\" % path)\n        else:\n            test_logger.info(\"strace:\")\n            os.system(\"strace -s4096 -e file %s\" % path)\n\n\ndef hasModule(module_name):\n    result = subprocess.call(\n        (os.environ[\"PYTHON\"], \"-c\", \"import %s\" % module_name),\n        stdout=getNullOutput(),\n        stderr=subprocess.STDOUT,\n    )\n\n    return result == 0\n\n\nm1 = {}\nm2 = {}\n\n\ndef cleanObjRefCntMaps():\n    m1.clear()\n    m2.clear()\n\n    # Warm out repr\n    for x in gc.get_objects():\n        try:\n            str(x)\n        except Exception:  # Catch all the things, pylint: disable=broad-except\n            pass\n\n\ndef snapObjRefCntMap(before):\n    # Inherently complex, pylint: disable=too-many-branches\n\n    if before:\n        m = m1\n    else:\n        m = m2\n\n    m.clear()\n    gc.collect()\n\n    for x in gc.get_objects():\n        # The dictionary is cyclic, and contains itself, avoid that.\n        if x is m1 or x is m2:\n            continue\n\n        if type(x) is str and (x in m1 or x in m2):\n            continue\n\n        if type(x) is not str and isinstance(x, str):\n            k = \"str_overload_\" + x.__class__.__name__ + str(x)\n        elif type(x) is dict:\n            if \"__builtins__\" in x:\n                k = \"<module dict %s>\" % x[\"__name__\"]\n            elif \"__spec__\" in x and \"__name__\" in x:\n                k = \"<module dict %s>\" % x[\"__name__\"]\n            else:\n                k = str(x)\n        elif hasattr(x, \"__class__\") and x.__class__.__name__ == \"compiled_frame\":\n            k = \"<compiled_frame at xxx, line %d code %s\" % (x.f_lineno, x.f_code)\n        else:\n            k = str(x)\n\n        c = sys.getrefcount(x)\n\n        if k in m:\n            m[k] += c\n        else:\n            m[k] = c\n\n\norig_print = None\n\n\ndef disablePrinting():\n    # Singleton, pylint: disable=global-statement\n    global orig_print\n\n    if orig_print is None:\n        orig_print = __builtins__[\"print\"]\n        __builtins__[\"print\"] = lambda *args, **kwargs: None\n\n\ndef reenablePrinting():\n    # Singleton, pylint: disable=global-statement\n    global orig_print\n\n    if orig_print is not None:\n        __builtins__[\"print\"] = orig_print\n        orig_print = None\n\n\n_debug_python = isDebugPython()\n\n\ndef getTotalReferenceCount():\n    if _debug_python:\n        gc.collect()\n        return sys.gettotalrefcount()\n    else:\n        gc.collect()\n        all_objects = gc.get_objects()\n\n        # Sum object reference twice, once without the sum value type, then switch\n        # the type, and use the type used to avoid the integers before that.\n        result = 0.0\n        for obj in all_objects:\n            if type(obj) is float:\n                continue\n\n            result += sys.getrefcount(obj)\n\n        result = int(result)\n\n        for obj in all_objects:\n            if type(obj) is not float:\n                continue\n\n            result += sys.getrefcount(obj)\n\n        return result\n\n\ndef checkReferenceCount(checked_function, max_rounds=20, explain=False):\n    # This is obviously going to be complex, pylint: disable=too-many-branches\n\n    # Clean start conditions.\n    assert sys.exc_info() == (None, None, None), sys.exc_info()\n\n    my_print(checked_function.__name__ + \": \", end=\"\")\n    sys.stdout.flush()\n\n    disablePrinting()\n\n    # Make sure reference for these are already taken at the start.\n    ref_count1 = 17\n    ref_count2 = 17\n\n    if explain:\n        cleanObjRefCntMaps()\n\n    assert max_rounds > 0\n\n    result = False\n\n    for count in range(max_rounds):\n        if explain and count == max_rounds - 1:\n            snapObjRefCntMap(before=True)\n\n        ref_count1 = getTotalReferenceCount()\n\n        checked_function()\n\n        ref_count2 = getTotalReferenceCount()\n\n        # Not allowed, but happens when bugs occur.\n        assert sys.exc_info() == (None, None, None), sys.exc_info()\n\n        if ref_count1 == ref_count2:\n            result = True\n            break\n\n        if explain and count == max_rounds - 1:\n            snapObjRefCntMap(before=False)\n\n    reenablePrinting()\n\n    if result:\n        my_print(\"PASSED\")\n    else:\n        my_print(\n            \"FAILED %d %d leaked %d\" % (ref_count1, ref_count2, ref_count2 - ref_count1)\n        )\n\n        if explain:\n            print(\"REPORT of differences:\")\n            assert m1\n            assert m2\n\n            # Using items will unwanted usages, pylint: disable=consider-using-dict-items\n            for key in m1:\n                if key not in m2:\n                    my_print(\"*\" * 80)\n                    my_print(\"extra:\", m1[key], key)\n                elif m1[key] != m2[key]:\n                    my_print(\"*\" * 80)\n                    my_print(m1[key], \"->\", m2[key], key)\n                else:\n                    pass\n\n            for key in m2:\n                if key not in m1:\n                    my_print(\"*\" * 80)\n                    my_print(\"missing:\", m2[key], key)\n\n                    # print m1[key]\n\n    assert sys.exc_info() == (None, None, None), sys.exc_info()\n\n    gc.collect()\n    sys.stdout.flush()\n\n    return result\n\n\ndef createSearchMode():\n    # Dealing with many options, pylint: disable=too-many-branches\n\n    parser = OptionParser()\n\n    select_group = parser.add_option_group(\"Select Tests\")\n\n    select_group.add_option(\n        \"--pattern\",\n        action=\"store\",\n        dest=\"pattern\",\n        default=\"\",\n        help=\"\"\"\\\nExecute only tests matching the pattern. Defaults to all tests.\"\"\",\n    )\n    select_group.add_option(\n        \"--all\",\n        action=\"store_true\",\n        dest=\"all\",\n        default=False,\n        help=\"\"\"\\\nExecute all tests, continue execution even after failure of one.\"\"\",\n    )\n\n    del select_group\n\n    debug_group = parser.add_option_group(\"Test features\")\n\n    debug_group.add_option(\n        \"--debug\",\n        action=\"store_true\",\n        dest=\"debug\",\n        default=False,\n        help=\"\"\"\\\nExecuting all self checks possible to find errors in Nuitka, good for test coverage.\nDefaults to off.\"\"\",\n    )\n\n    debug_group.add_option(\n        \"--commands\",\n        action=\"store_true\",\n        dest=\"show_commands\",\n        default=False,\n        help=\"\"\"Output commands being done in output comparison.\nDefaults to off.\"\"\",\n    )\n\n    del debug_group\n\n    options, positional_args = parser.parse_args()\n\n    if options.debug:\n        addExtendedExtraOptions(\"--debug\")\n\n    if options.show_commands:\n        os.environ[\"NUITKA_TRACE_COMMANDS\"] = \"1\"\n\n    # Default to searching.\n    mode = positional_args[0] if positional_args else \"search\"\n\n    # Avoid having to use options style.\n    if mode in (\"search\", \"only\", \"coverage\"):\n        if len(positional_args) >= 2 and not options.pattern:\n            options.pattern = positional_args[1]\n\n    if mode == \"search\":\n        if options.all:\n            return SearchModeByPattern(start_at=None)\n        elif options.pattern:\n            return SearchModeByPattern(\n                start_at=options.pattern.replace(\"/\", os.path.sep)\n            )\n        else:\n            return SearchModeImmediate()\n    elif mode == \"resume\":\n        return SearchModeResume(sys.modules[\"__main__\"].__file__)\n    elif mode == \"only\":\n        if options.pattern:\n            pattern = options.pattern.replace(\"/\", os.path.sep)\n            return SearchModeOnly(pattern)\n        else:\n            assert False\n    elif mode == \"coverage\":\n        return SearchModeCoverage(\n            start_at=(\n                options.pattern.replace(\"/\", os.path.sep) if options.pattern else None\n            )\n        )\n    else:\n        test_logger.sysexit(\"Error, using unknown search mode %r\" % mode)\n\n\ndef reportSkip(reason, dirname, filename):\n    case = os.path.join(dirname, filename)\n    case = os.path.normpath(case)\n\n    test_logger.info(\"Skipped, %s (%s).\" % (case, reason))\n\n\ndef executeReferenceChecked(\n    prefix, names, tests_skipped=(), tests_stderr=(), explain=False\n):\n    gc.disable()\n\n    extract_number = lambda name: int(name.replace(prefix, \"\"))\n\n    # Find the function names.\n    matching_names = tuple(\n        name for name in names if name.startswith(prefix) and name[-1].isdigit()\n    )\n\n    old_stderr = sys.stderr\n\n    # Everything passed\n    result = True\n\n    for name in sorted(matching_names, key=extract_number):\n        number = extract_number(name)\n\n        # print(tests_skipped)\n        if number in tests_skipped:\n            my_print(name + \": SKIPPED (%s)\" % tests_skipped[number])\n            continue\n\n        # Avoid non-raisable output.\n        try:\n            if number in tests_stderr:\n                sys.stderr = getNullOutput()\n        except OSError:  # Windows\n            if not checkReferenceCount(names[name], explain=explain):\n                result = False\n        else:\n            if not checkReferenceCount(names[name], explain=explain):\n                result = False\n\n            if number in tests_stderr:\n                new_stderr = sys.stderr\n                sys.stderr = old_stderr\n                new_stderr.close()\n\n    gc.enable()\n    return result\n\n\ndef addToPythonPath(python_path, in_front=False):\n    if type(python_path) in (tuple, list):\n        python_path = os.pathsep.join(python_path)\n\n    if python_path:\n        if \"PYTHONPATH\" in os.environ:\n            if in_front:\n                os.environ[\"PYTHONPATH\"] = (\n                    python_path + os.pathsep + os.environ[\"PYTHONPATH\"]\n                )\n            else:\n                os.environ[\"PYTHONPATH\"] += os.pathsep + python_path\n        else:\n            os.environ[\"PYTHONPATH\"] = python_path\n\n\n@contextmanager\ndef withPythonPathChange(python_path):\n    if python_path:\n        if type(python_path) not in (tuple, list):\n            python_path = python_path.split(os.pathsep)\n\n        python_path = [\n            os.path.normpath(os.path.abspath(element)) for element in python_path\n        ]\n\n        python_path = os.pathsep.join(python_path)\n\n        if \"PYTHONPATH\" in os.environ:\n            old_path = os.environ[\"PYTHONPATH\"]\n            os.environ[\"PYTHONPATH\"] += os.pathsep + python_path\n        else:\n            old_path = None\n            os.environ[\"PYTHONPATH\"] = python_path\n\n    yield\n\n    if python_path:\n        if old_path is None:\n            del os.environ[\"PYTHONPATH\"]\n        else:\n            os.environ[\"PYTHONPATH\"] = old_path\n\n\ndef addExtendedExtraOptions(*args):\n    old_value = os.getenv(\"NUITKA_EXTRA_OPTIONS\")\n\n    value = old_value\n\n    for arg in args:\n        if value is None:\n            value = arg\n        else:\n            value += \" \" + arg\n\n    os.environ[\"NUITKA_EXTRA_OPTIONS\"] = value\n\n    return old_value\n\n\n@contextmanager\ndef withExtendedExtraOptions(*args):\n    assert args\n\n    old_value = addExtendedExtraOptions(*args)\n\n    yield\n\n    if old_value is None:\n        del os.environ[\"NUITKA_EXTRA_OPTIONS\"]\n    else:\n        os.environ[\"NUITKA_EXTRA_OPTIONS\"] = old_value\n\n\ndef indentedCode(codes, count):\n    \"\"\"Indent code, used for generating test codes.\"\"\"\n    indent = \" \" * count\n    return \"\\n\".join(indent + line if line else \"\" for line in codes)\n\n\ndef convertToPython(doctests, line_filter=None):\n    \"\"\"Convert give doctest string to static Python code.\"\"\"\n    # This is convoluted, but it just needs to work, pylint: disable=too-many-branches\n\n    import doctest\n\n    code = doctest.script_from_examples(doctests)\n\n    if code.endswith(\"\\n\"):\n        code += \"#\\n\"\n    else:\n        assert False\n\n    output = []\n    inside = False\n\n    def getPrintPrefixed(evaluated, line_number):\n        try:\n            node = ast.parse(evaluated.lstrip(), \"eval\")\n        except SyntaxError:\n            return evaluated\n\n        if node.body[0].__class__.__name__ == \"Expr\":\n            count = 0\n\n            while evaluated.startswith(\" \" * count):\n                count += 1\n\n            if sys.version_info < (3,):\n                modified = (count - 1) * \" \" + \"print \" + evaluated\n                return (\n                    (count - 1) * \" \"\n                    + (\"print 'Line %d'\" % line_number)\n                    + \"\\n\"\n                    + modified\n                )\n            else:\n                modified = (count - 1) * \" \" + \"print(\" + evaluated + \"\\n)\\n\"\n                return (\n                    (count - 1) * \" \"\n                    + (\"print('Line %d'\" % line_number)\n                    + \")\\n\"\n                    + modified\n                )\n        else:\n            return evaluated\n\n    def getTried(evaluated, line_number):\n        if sys.version_info < (3,):\n            return \"\"\"\ntry:\n%(evaluated)s\nexcept Exception as __e:\n    print \"Occurred\", type(__e), __e\n\"\"\" % {\n                \"evaluated\": indentedCode(\n                    getPrintPrefixed(evaluated, line_number).split(\"\\n\"), 4\n                )\n            }\n        else:\n            return \"\"\"\ntry:\n%(evaluated)s\nexcept Exception as __e:\n    print(\"Occurred\", type(__e), __e)\n\"\"\" % {\n                \"evaluated\": indentedCode(\n                    getPrintPrefixed(evaluated, line_number).split(\"\\n\"), 4\n                )\n            }\n\n    def isOpener(evaluated):\n        evaluated = evaluated.lstrip()\n\n        if evaluated == \"\":\n            return False\n\n        return evaluated.split()[0] in (\n            \"def\",\n            \"with\",\n            \"class\",\n            \"for\",\n            \"while\",\n            \"try:\",\n            \"except\",\n            \"except:\",\n            \"finally:\",\n            \"else:\",\n        )\n\n    chunk = None\n    for line_number, line in enumerate(code.split(\"\\n\")):\n        # print \"->\", inside, line\n\n        if line_filter is not None and line_filter(line):\n            continue\n\n        if inside and line and line[0].isalnum() and not isOpener(line):\n            output.append(getTried(\"\\n\".join(chunk), line_number))\n\n            chunk = []\n            inside = False\n\n        if inside and not (line.startswith(\"#\") and line.find(\"SyntaxError:\") != -1):\n            chunk.append(line)\n        elif line.startswith(\"#\"):\n            if line.find(\"SyntaxError:\") != -1:\n                # print \"Syntax error detected\"\n\n                if inside:\n                    # print \"Dropping chunk\", chunk\n\n                    chunk = []\n                    inside = False\n                else:\n                    del output[-1]\n        elif isOpener(line):\n            inside = True\n            chunk = [line]\n        elif line.strip() == \"\":\n            output.append(line)\n        else:\n            output.append(getTried(line, line_number))\n\n    return \"\\n\".join(output).rstrip() + \"\\n\"\n\n\ndef compileLibraryPath(search_mode, path, stage_dir, decide, action):\n    my_print(\"Checking standard library path:\", path)\n\n    for root, dirnames, filenames in os.walk(path):\n        dirnames_to_remove = [dirname for dirname in dirnames if \"-\" in dirname]\n\n        for dirname in dirnames_to_remove:\n            dirnames.remove(dirname)\n\n        dirnames.sort()\n\n        filenames = [filename for filename in filenames if decide(root, filename)]\n\n        for filename in sorted(filenames):\n            if not search_mode.consider(root, filename):\n                continue\n\n            full_path = os.path.join(root, filename)\n\n            my_print(full_path, \":\", end=\" \")\n            sys.stdout.flush()\n\n            action(stage_dir, path, full_path)\n\n\ndef compileLibraryTest(search_mode, stage_dir, decide, action):\n    if not os.path.exists(stage_dir):\n        os.makedirs(stage_dir)\n\n    my_dirname = os.path.join(os.path.dirname(__file__), \"../../..\")\n    my_dirname = os.path.normpath(my_dirname)\n\n    paths = [path for path in sys.path if not path.startswith(my_dirname)]\n\n    my_print(\"Using standard library paths:\")\n    for path in paths:\n        my_print(path)\n\n    for path in paths:\n        print(\"Checking path:\", path)\n        compileLibraryPath(\n            search_mode=search_mode,\n            path=path,\n            stage_dir=stage_dir,\n            decide=decide,\n            action=action,\n        )\n\n    search_mode.finish()\n\n\ndef run_async(coro):\n    \"\"\"Execute a coroutine until it's done.\"\"\"\n\n    values = []\n    result = None\n    while True:\n        try:\n            values.append(coro.send(None))\n        except StopIteration as ex:\n            result = ex.args[0] if ex.args else None\n            break\n    return values, result\n\n\ndef async_iterate(g):\n    \"\"\"Execute async generator until it's done.\"\"\"\n\n    # Test code for Python3, catches all kinds of exceptions.\n    # pylint: disable=broad-except\n\n    # Also Python3 only, pylint: disable=I0021,undefined-variable\n\n    res = []\n    while True:\n        try:\n            g.__anext__().__next__()\n        except StopAsyncIteration:\n            res.append(\"STOP\")\n            break\n        except StopIteration as ex:\n            if ex.args:\n                res.append(\"ex arg %s\" % ex.args[0])\n            else:\n                res.append(\"EMPTY StopIteration\")\n                break\n        except Exception as ex:\n            res.append(str(type(ex)))\n\n    return res\n\n\ndef getTestingCacheDir():\n    cache_dir = getCacheDir(\"tests_state\")\n    makePath(cache_dir)\n    return cache_dir\n\n\ndef getTestingCPythonOutputsCacheDir():\n    cache_dir = getCacheDir(\"cpython_outputs\")\n\n    result = os.path.join(cache_dir, os.getenv(\"NUITKA_TEST_SUITE\", \"\"))\n\n    makePath(result)\n    return result\n\n\ndef scanDirectoryForTestCases(dirname, template_context=None):\n    filenames = os.listdir(dirname)\n\n    filenames = [\n        filename\n        for filename in filenames\n        if (filename.endswith(\".py\") and filename + \".j2\" not in filenames)\n        or filename.endswith(\".j2\")\n    ]\n\n    for filename in sorted(filenames):\n        if not decideFilenameVersionSkip(filename):\n            continue\n\n        if filename.endswith(\".j2\"):\n            # Needs to be a dictionary with template arguments.\n            assert template_context is not None\n\n            template = getTemplate(\n                package_name=None,\n                template_name=filename,\n                template_subdir=dirname,\n                extensions=(\"jinja2.ext.do\",),\n            )\n\n            code = template.render(name=template.name, **template_context)\n\n            filename = filename[:-3]\n            with openTextFile(filename, \"w\") as output:\n                output.write(\n                    \"'''Automatically generated test, not part of releases or git.\\n\\n'''\\n\"\n                )\n\n                output.write(code)\n\n        yield filename\n\n\ndef scanDirectoryForTestCaseFolders(dirname):\n    filenames = os.listdir(dirname)\n\n    for filename in sorted(filenames):\n        if not decideFilenameVersionSkip(filename + \".py\"):\n            continue\n\n        filename = os.path.join(dirname, filename)\n        filename = os.path.relpath(filename)\n\n        if (\n            not os.path.isdir(filename)\n            or filename.endswith((\".dist\", \".build\"))\n            or os.path.basename(filename).startswith(\"venv_\")\n        ):\n            continue\n\n        filename_main = getMainProgramFilename(filename)\n\n        yield filename, filename_main\n\n\ndef setupCacheHashSalt(test_code_path):\n    assert os.path.exists(test_code_path)\n\n    if os.path.exists(os.path.join(test_code_path, \".git\")):\n        git_cmd = [\"git\", \"ls-tree\", \"-r\", \"HEAD\", test_code_path]\n\n        process = subprocess.Popen(\n            args=git_cmd,\n            stdin=getNullInput(),\n            stdout=subprocess.PIPE,\n            stderr=subprocess.PIPE,\n        )\n\n        stdout_git, stderr_git = process.communicate()\n        assert process.returncode == 0, stderr_git\n\n        salt_value = md5(stdout_git)\n    else:\n        salt_value = md5()\n\n        for filename in getFileList(test_code_path):\n            if filename.endswith(\".py\"):\n                salt_value.update(getFileContents(filename, mode=\"rb\"))\n\n    os.environ[\"NUITKA_HASH_SALT\"] = salt_value.hexdigest()\n\n\ndef displayFolderContents(name, path):\n    test_logger.info(\"Listing of %s '%s':\" % (name, path))\n\n    if os.path.exists(path):\n        if isWin32Windows():\n            command = \"dir /b /s /a:-D %s\" % path\n        else:\n            command = \"ls -Rla %s\" % path\n\n        os.system(command)\n    else:\n        test_logger.info(\"Does not exist.\")\n\n\ndef displayFileContents(name, path):\n    test_logger.info(\"Contents of %s %r:\" % (name, path))\n\n    if os.path.exists(path):\n        for line in getFileContentByLine(path):\n            my_print(line)\n    else:\n        test_logger.info(\"Does not exist.\")\n\n\ndef someGenerator():\n    yield 1\n    yield 2\n    yield 3\n\n\ndef someGeneratorRaising():\n    yield 1\n    raise TypeError(2)\n\n\n# checks requirements needed to run each test module, according to the specified special comment\n# special comments are in the following formats:\n#     \"# nuitka-skip-unless-expression: expression to be evaluated\"\n#       OR\n#     \"# nuitka-skip-unless-imports: module1,module2,...\"\ndef checkTestRequirements(filename):\n    if os.path.isdir(filename):\n        candidate = os.path.join(filename, \"__main__.py\")\n\n        if os.path.isfile(candidate):\n            filename = candidate\n\n    for line in readSourceCodeFromFilename(None, filename).splitlines():\n        if line.startswith(\"# nuitka-skip-unless-\"):\n            if line[21:33] == \"expression: \":\n                expression = line[33:]\n                result = subprocess.call(\n                    (\n                        os.environ[\"PYTHON\"],\n                        \"-c\",\n                        \"import sys, os; sys.exit(not bool(%s))\" % expression,\n                    ),\n                    stdout=getNullOutput(),\n                    stderr=subprocess.STDOUT,\n                )\n                if result != 0:\n                    return (False, \"Expression '%s' evaluated to false\" % expression)\n\n            elif line[21:30] == \"imports: \":\n                imports_needed = line[30:].rstrip().split(\",\")\n                for i in imports_needed:\n                    if not hasModule(i):\n                        return (\n                            False,\n                            i\n                            + \" not installed for this Python version, but test needs it\",\n                        )\n    # default return value\n    return (True, \"\")\n\n\nclass DelayedExecutionThread(threading.Thread):\n    def __init__(self, timeout, func):\n        threading.Thread.__init__(self)\n        self.timeout = timeout\n\n        self.func = func\n\n    def run(self):\n        time.sleep(self.timeout)\n        self.func()\n\n\ndef executeAfterTimePassed(message, timeout, func):\n    test_logger.info(message % timeout)\n\n    alarm = DelayedExecutionThread(timeout=timeout, func=func)\n    alarm.start()\n\n\ndef killProcessGroup(process_name, pid):\n    \"\"\"Kill a process in a portable way.\n\n    Right now SIGINT is used, unclear what to do on Windows\n    with Python2 or non-related processes.\n    \"\"\"\n\n    if isWin32Windows():\n        test_logger.sysexit(\"Error, cannot send kill signal on Windows\")\n    else:\n        test_logger.info(\"Killing test process group '%s'.\" % process_name)\n        os.killpg(pid, signal.SIGINT)\n\n\ndef checkLoadedFileAccesses(loaded_filenames, current_dir):\n    # Many details to consider, pylint: disable=too-many-branches,too-many-statements\n\n    current_dir = os.path.normpath(current_dir)\n    current_dir = os.path.normcase(current_dir)\n    current_dir_ext = os.path.normcase(getExternalUsePath(current_dir))\n\n    illegal_accesses = []\n\n    for loaded_filename in loaded_filenames:\n        orig_loaded_filename = loaded_filename\n\n        loaded_filename = os.path.normpath(loaded_filename)\n        loaded_filename = os.path.normcase(loaded_filename)\n        loaded_basename = os.path.basename(loaded_filename)\n\n        if isWin32Windows():\n            if areSamePaths(\n                os.path.dirname(loaded_filename),\n                os.path.normpath(os.path.join(os.environ[\"SYSTEMROOT\"], \"System32\")),\n            ):\n                continue\n            if areSamePaths(\n                os.path.dirname(loaded_filename),\n                os.path.normpath(os.path.join(os.environ[\"SYSTEMROOT\"], \"SysWOW64\")),\n            ):\n                continue\n\n            if r\"windows\\winsxs\" in loaded_filename:\n                continue\n\n            # GitHub actions have these in PATH overriding SYSTEMROOT\n            if r\"windows performance toolkit\" in loaded_filename:\n                continue\n            if r\"powershell\" in loaded_filename:\n                continue\n            if r\"azure dev spaces cli\" in loaded_filename:\n                continue\n            if r\"tortoisesvn\" in loaded_filename:\n                continue\n\n        if loaded_filename.startswith(current_dir):\n            continue\n\n        if loaded_filename.startswith(os.path.abspath(current_dir)):\n            continue\n\n        if loaded_filename.startswith(current_dir_ext):\n            continue\n\n        ignore = True\n        for ignored_dir in (\n            # System configuration is OK\n            \"/etc\",\n            \"/usr/etc\",\n            \"/usr/local/etc\",\n            # Runtime user state and kernel information is OK.\n            \"/proc\",\n            \"/dev\",\n            \"/run\",\n            \"/sys\",\n            \"/tmp\",\n            \"/var\",\n            # Locals may of course be loaded.\n            \"/usr/lib/locale\",\n            \"/usr/share/locale\",\n            \"/usr/share/X11/locale\",\n            # Themes may of course be loaded.\n            \"/usr/share/themes\",\n            # Terminal info files are OK too.\n            \"/lib/terminfo\",\n        ):\n            if isFilenameSameAsOrBelowPath(ignored_dir, loaded_filename):\n                ignore = False\n                break\n        if not ignore:\n            continue\n\n        # Themes may of course be loaded.\n        if loaded_filename.startswith(\"/usr/share/themes\"):\n            continue\n        if \"gtk\" in loaded_filename and \"/engines/\" in loaded_filename:\n            continue\n\n        if loaded_filename in (\n            \"/usr\",\n            \"/usr/local\",\n            \"/usr/local/lib\",\n            \"/usr/share\",\n            \"/usr/local/share\",\n            \"/usr/lib64\",\n        ):\n            continue\n\n        # TCL/tk for tkinter for non-Windows is OK.\n        if loaded_filename.startswith(\n            (\n                \"/usr/lib/tcltk/\",\n                \"/usr/share/tcltk/\",\n                \"/usr/lib/tcl/\",\n                \"/usr/lib64/tcl/\",\n            )\n        ):\n            continue\n        if loaded_filename in (\n            \"/usr/lib/tcltk\",\n            \"/usr/share/tcltk\",\n            \"/usr/lib/tcl\",\n            \"/usr/lib64/tcl\",\n        ):\n            continue\n\n        if loaded_filename in (\n            \"/lib\",\n            \"/lib64\",\n            \"/lib/sse2\",\n            \"/lib/tls\",\n            \"/lib64/tls\",\n            \"/usr/lib/sse2\",\n            \"/usr/lib/tls\",\n            \"/usr/lib64/tls\",\n        ):\n            continue\n\n        if loaded_filename in (\"/usr/share/tcl8.6\", \"/usr/share/tcl8.5\"):\n            continue\n        if loaded_filename in (\n            \"/usr/share/tcl8.6/init.tcl\",\n            \"/usr/share/tcl8.5/init.tcl\",\n        ):\n            continue\n        if loaded_filename in (\n            \"/usr/share/tcl8.6/encoding\",\n            \"/usr/share/tcl8.5/encoding\",\n        ):\n            continue\n\n        # System SSL config on Linux. TODO: Should this not be included and\n        # read from dist folder.\n        if loaded_basename == \"openssl.cnf\":\n            continue\n\n        # Taking these from system is harmless and desirable\n        if loaded_basename.startswith((\"libz.so\", \"libgcc_s.so\")):\n            continue\n\n        # System C libraries are to be expected.\n        if loaded_basename.startswith(\n            (\n                \"ld-linux-x86-64.so\",\n                \"libc.so.\",\n                \"libpthread.so.\",\n                \"libm.so.\",\n                \"libdl.so.\",\n                \"libBrokenLocale.so.\",\n                \"libSegFault.so\",\n                \"libanl.so.\",\n                \"libcidn.so.\",\n                \"libcrypt.so.\",\n                \"libmemusage.so\",\n                \"libmvec.so.\",\n                \"libnsl.so.\",\n                \"libnss_compat.so.\",\n                \"libnss_db.so.\",\n                \"libnss_dns.so.\",\n                \"libnss_files.so.\",\n                \"libnss_hesiod.so.\",\n                \"libnss_nis.so.\",\n                \"libnss_nisplus.so.\",\n                \"libpcprofile.so\",\n                \"libresolv.so.\",\n                \"librt.so.\",\n                \"libthread_db-1.0.so\",\n                \"libthread_db.so.\",\n                \"libutil.so.\",\n            )\n        ):\n            continue\n\n        # System C++ standard library is also OK.\n        if loaded_basename.startswith(\"libstdc++.\"):\n            continue\n\n        # Curses library is OK from system too.\n        if loaded_basename.startswith(\"libtinfo.so.\"):\n            continue\n\n        # Loaded by C library potentially for DNS lookups.\n        if loaded_basename.startswith(\n            (\n                \"libnss_\",\n                \"libnsl\",\n                # Some systems load a lot more, this is CentOS 7 on OBS\n                \"libattr.so.\",\n                \"libbz2.so.\",\n                \"libcap.so.\",\n                \"libdw.so.\",\n                \"libelf.so.\",\n                \"liblzma.so.\",\n                # Some systems load a lot more, this is Fedora 26 on OBS\n                \"libselinux.so.\",\n                \"libpcre.so.\",\n                # And this is Fedora 29 on OBS\n                \"libblkid.so.\",\n                \"libmount.so.\",\n                \"libpcre2-8.so.\",\n                # CentOS 8 on OBS\n                \"libuuid.so.\",\n            )\n        ):\n            continue\n\n        # Loaded by dtruss on macOS X.\n        if loaded_filename.startswith(\"/usr/lib/dtrace/\"):\n            continue\n\n        # Loaded by cowbuilder and pbuilder on Debian\n        if loaded_basename == \".ilist\":\n            continue\n        if \"cowdancer\" in loaded_filename:\n            continue\n        if \"eatmydata\" in loaded_filename:\n            continue\n\n        # Loading from home directories is OK too.\n        if any(\n            isFilenameSameAsOrBelowPath(path, loaded_filename)\n            for path in (\n                \"/home\",\n                \"/data\",\n                \"/root\",\n                \"/Users\",\n                \"/Library/Preferences\",\n                \"/agent\",  # Azure\n            )\n        ):\n            continue\n\n        # For Debian builders, /build is OK too.\n        if loaded_filename.startswith(\"/build/\") or loaded_filename == \"/build\":\n            continue\n\n        # TODO: Unclear, loading gconv from filesystem of installed system\n        # may be OK or not. I think it should be.\n        if loaded_basename == \"gconv-modules.cache\":\n            continue\n        if \"/gconv/\" in loaded_filename:\n            continue\n        if loaded_basename.startswith(\"libicu\"):\n            continue\n        if loaded_filename.startswith(\"/usr/share/icu/\"):\n            continue\n\n        # Loading from caches is OK.\n        if loaded_filename.startswith(\"/var/cache/\"):\n            continue\n\n        # At least Python3.7 considers the default Python3 path and checks it.\n        if loaded_filename == \"/usr/bin/python3\":\n            continue\n\n        # Accessing the versioned Python3.x binary is also happening.\n        if loaded_filename in (\n            \"/usr/bin/python.\" + version for version in getTestExecutionPythonVersions()\n        ):\n            continue\n\n        binary_path = _python_executable\n\n        found = False\n        while binary_path:\n            if loaded_filename == binary_path:\n                found = True\n                break\n\n            if binary_path == os.path.dirname(binary_path):\n                break\n\n            binary_path = os.path.dirname(binary_path)\n\n            if loaded_filename == os.path.join(\n                binary_path,\n                \"python\" + (\"%d%d\" % (_python_version[0], _python_version[1])),\n            ):\n                found = True\n                break\n\n        if found:\n            continue\n\n        lib_prefix_dir = \"/usr/lib/python%d.%s\" % (\n            _python_version[0],\n            _python_version[1],\n        )\n\n        # TODO: These must all go away, we should not compile from Debian packages at all,\n        # it is warned against, and it really don't matter what wrong files that accesses\n        # or not.\n\n        # PySide accesses its directory.\n        if loaded_filename == os.path.join(lib_prefix_dir, \"dist-packages/PySide\"):\n            continue\n\n        # GTK accesses package directories only.\n        if loaded_filename == os.path.join(lib_prefix_dir, \"dist-packages/gtk-2.0/gtk\"):\n            continue\n        if loaded_filename == os.path.join(lib_prefix_dir, \"dist-packages/glib\"):\n            continue\n        if loaded_filename == os.path.join(lib_prefix_dir, \"dist-packages/gtk-2.0/gio\"):\n            continue\n        if loaded_filename == os.path.join(lib_prefix_dir, \"dist-packages/gobject\"):\n            continue\n\n        # PyQt5 and PySide6 seems to do this, but won't use contents then.\n        if loaded_filename in (\n            \"/usr/lib/qt6/plugins\",\n            \"/usr/lib/qt6\",\n            \"/usr/lib64/qt6/plugins\",\n            \"/usr/lib64/qt6\",\n            \"/usr/lib/qt5/plugins\",\n            \"/usr/lib/qt5\",\n            \"/usr/lib64/qt5/plugins\",\n            \"/usr/lib64/qt5\",\n            \"/usr/lib/x86_64-linux-gnu/qt5/plugins\",\n            \"/usr/lib/x86_64-linux-gnu/qt5\",\n            \"/usr/lib/x86_64-linux-gnu\",\n            \"/usr/lib\",\n        ):\n            continue\n\n        # Can look at the interpreters of the system.\n        if loaded_basename in \"python3\":\n            continue\n        if loaded_basename in (\n            \"python%s\" + supported_version\n            for supported_version in getTestExecutionPythonVersions()\n        ):\n            continue\n\n        # Current Python executable can actually be a symlink and\n        # the real executable which it points to will be on the\n        # loaded_filenames list. This is all fine, let's ignore it.\n        # Also, because the loaded_filename can be yet another symlink\n        # (this is weird, but it's true), let's better resolve its real\n        # path too.\n        if os.path.realpath(loaded_filename) == os.path.realpath(sys.executable):\n            continue\n\n        # Accessing SE-Linux is OK.\n        if loaded_filename in (\"/sys/fs/selinux\", \"/selinux\"):\n            continue\n\n        # Looking at device is OK.\n        if loaded_filename.startswith(\"/sys/devices/\"):\n            continue\n\n        # Allow reading time zone info of local system.\n        if loaded_filename.startswith(\"/usr/share/zoneinfo/\"):\n            continue\n\n        # The access to .pth files has no effect.\n        if loaded_filename.endswith(\".pth\"):\n            continue\n\n        # Looking at site-package dir alone is alone.\n        if loaded_filename.endswith(\n            (\"site-packages\", \"dist-packages\", \"vendor-packages\")\n        ):\n            continue\n\n        # QtNetwork insist on doing this it seems.\n        if loaded_basename.startswith((\"libcrypto.so\", \"libssl.so\")):\n            continue\n\n        # macOS uses these:\n        if loaded_basename in (\n            \"libcrypto.1.0.0.dylib\",\n            \"libssl.1.0.0.dylib\",\n            \"libcrypto.1.1.dylib\",\n            \"libffi.dylib\",\n        ):\n            continue\n\n        # Linux onefile uses this\n        if loaded_basename.startswith(\"libfuse.so.\"):\n            continue\n\n        # MSVC run time DLLs, due to SxS come from system.\n        if loaded_basename.upper() in (\"MSVCRT.DLL\", \"MSVCR90.DLL\"):\n            continue\n\n        if isMacOS():\n            ignore = True\n            for ignored_dir in (\n                \"/System/Library/PrivateFrameworks\",\n                \"/System/Library/CoreServices\",\n                \"/System/Library/Frameworks/\",\n                \"/System/Library/dyld\",\n                \"/AppleInternal\",\n                \"/System/Volumes/Preboot\",\n                \"/usr/lib/system/\",\n            ):\n                if isFilenameSameAsOrBelowPath(ignored_dir, loaded_filename):\n                    ignore = False\n                    break\n            if not ignore:\n                continue\n\n            if loaded_filename == \"/usr/libexec/rosetta/runtime\":\n                continue\n\n            if loaded_filename in (\n                \"/usr/lib/libSystem.B.dylib\",\n                \"/usr/lib/libc++.1.dylib\",\n                \"/usr/lib/libc++abi.dylib\",\n                \"/usr/lib/libfakelink.dylib\",\n                \"/usr/lib/liboah.dylib\",\n                \"/usr/lib/libobjc.A.dylib\",\n            ):\n                continue\n\n        illegal_accesses.append(orig_loaded_filename)\n\n    return illegal_accesses\n\n\ndef getMainProgramFilename(filename):\n    for filename_main in os.listdir(filename):\n        if filename_main.endswith((\"Main.py\", \"Main\")):\n            return filename_main\n\n        if filename_main in (\n            \"setup.py\",\n            \"setup.cfg\",\n            \"pyproject.cpython.toml\",\n            \"pyproject.nuitka.toml\",\n        ):\n            return filename_main\n\n    test_logger.sysexit(\n        \"\"\"\\\nError, no file ends with 'Main.py' or 'Main' in '%s', incomplete test case.\"\"\"\n        % (filename)\n    )\n\n\ndef getInstalledPythonVersion(python_version, must_exist):\n    result = findInstalledPython(\n        python_versions=(python_version,), module_name=None, module_version=None\n    )\n\n    if result is None and must_exist:\n        test_logger.sysexit(\n            \"Error, cannot find required Python version %s installation.\"\n            % python_version\n        )\n\n    return result\n\n\n_sys_path_path = None\n\n\ndef getPythonSysPath():\n    global _sys_path_path  # singleton, pylint: disable=global-statement\n\n    if _sys_path_path is None:\n        _sys_path_path = check_output(\n            [\n                os.environ[\"PYTHON\"],\n                \"-c\",\n                \"import sys, os; print(os.pathsep.join(sys.path))\",\n            ]\n        )\n\n        if str is not bytes:\n            _sys_path_path = _sys_path_path.decode(\"utf8\")\n\n        _sys_path_path = _sys_path_path.strip()\n\n    return _sys_path_path\n\n\n_web_server_process = None\n_web_server_port = 27272\n_web_server_hostname = \"localhost\"\n\n\ndef getLocalWebServerUrl():\n    return \"http://%s:%d\" % (_web_server_hostname, _web_server_port)\n\n\ndef getLocalWebServerDir(base_dir):\n    global _web_server_process  # singleton, pylint: disable=global-statement\n\n    web_dir = os.path.join(getTempDir(), \"local-web-server\", base_dir)\n\n    if _web_server_process is None:\n        web_server_directory_supporting_pythons = (\"3.11\", \"3.10\", \"3.9\", \"3.8\", \"3.7\")\n\n        web_server_python = findInstalledPython(\n            python_versions=web_server_directory_supporting_pythons,\n            module_name=None,\n            module_version=None,\n        )\n\n        if web_server_python is None:\n            return None\n\n        os.makedirs(web_dir)\n\n        command = [\n            web_server_python.getPythonExe(),\n            \"-m\",\n            \"http.server\",\n            \"--bind\",\n            _web_server_hostname,\n            \"--dir\",\n            web_dir,\n            str(_web_server_port),\n        ]\n\n        test_logger.my_print(\" \".join(command))\n\n        _web_server_process = createProcess(\n            command,\n            stdout=sys.stderr,\n            stderr=sys.stderr,\n        )\n\n        def killWebServerProcess():\n            _web_server_process.kill()\n\n        atexit.register(killWebServerProcess)\n\n    return web_dir\n\n\ndef traceExecutedCommand(description, command):\n    my_print(description, \":\", *command, style=\"pink\")\n\n\ndef extractNuitkaVersionFromFilePath(version_filename):\n    with openTextFile(version_filename, \"r\") as f:\n        option_lines = f.readlines()\n\n    (version_line,) = [line for line in option_lines if line.startswith(\"Nuitka V\")]\n\n    return version_line[8:].rstrip()\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/Constructs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tools for construct tests.\n\n\"\"\"\n\n\ndef generateConstructCases(construct_source_code):\n    inside = False\n    case = 0\n\n    case_1 = []\n    case_2 = []\n\n    for line in construct_source_code.splitlines():\n        if not inside or case == 1:\n            case_1.append(line)\n        else:\n            case_1.append(\"\")\n\n        if \"# construct_end\" in line:\n            inside = False\n\n        if \"# construct_alternative\" in line:\n            case = 2\n\n        if not inside or case == 2:\n            case_2.append(line)\n        else:\n            case_2.append(\"\")\n\n        if \"# construct_begin\" in line:\n            inside = True\n            case = 1\n\n    return \"\\n\".join(case_1), \"\\n\".join(case_2)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/OutputComparison.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tools to compare outputs of compiled and not compiled programs.\n\nThere is a couple of replacements to be done for compiled programs to\nmake the diff meaningful. The compiled type representations are just\nan example.\n\n\"\"\"\n\nimport difflib\nimport os\nimport re\n\nfrom nuitka.Tracing import my_print\n\nran_tests_re = re.compile(r\"^(Ran \\d+ tests? in )\\-?\\d+\\.\\d+s$\")\ninstance_re = re.compile(r\"at (?:0x)?[0-9a-fA-F]+(;?\\s|\\>)\")\nthread_re = re.compile(r\"[Tt]hread 0x[0-9a-fA-F]+\")\ncompiled_types_re = re.compile(\n    r\"compiled_(module|function|generator|method|frame|coroutine|async_generator|cell)\"\n)\nmodule_repr_re = re.compile(r\"(\\<module '.*?' from ').*?('\\>)\")\n\nglobal_name_error_re = re.compile(r\"global (name ')(.*?)(' is not defined)\")\nnon_ascii_error_rt = re.compile(r\"(SyntaxError: Non-ASCII character.*? on line) \\d+\")\npython_win_lib_re = re.compile(r\"[a-zA-Z]:\\\\\\\\?[Pp]ython(.*?\\\\\\\\?)[Ll]ib\")\nlocal_port_re = re.compile(r\"(127\\.0\\.0\\.1):\\d{2,5}\")\n\n\ntraceback_re = re.compile(r'(F|f)ile \"(.*?)\", line (\\d+)')\n\n\ndef traceback_re_callback(match):\n    return r'%sile \"%s\", line %s' % (\n        match.group(1),\n        os.path.realpath(os.path.abspath(match.group(2))),\n        match.group(3),\n    )\n\n\nimporterror_re = re.compile(\n    r\"\"\"(ImportError(?:\\(\"|: )cannot import name '\\w+' from '.*?' )\\((.*?)\\)\"\"\"\n)\n\n\ndef import_re_callback(match):\n    #    print (match.groups(), os.path.abspath(match.group(2)))\n\n    return r\"%s( >> %s)\" % (\n        match.group(1),\n        os.path.realpath(os.path.abspath(match.group(2))),\n    )\n\n\ntempfile_re = re.compile(r\"/tmp/tmp[a-z0-9_]*\")\n\nlogging_info_re = re.compile(r\"^Nuitka(-\\w+)?:([-\\w]+:)? \")\nlogging_warning_re = re.compile(r\"^Nuitka.*?:WARNING\")\n\n# Python3.11 style traceback carets are not done by Nuitka (yet?)\nsyntax_error_caret_re = re.compile(r\"^\\s*~*\\^*~*$\")\n\ntiming_re = re.compile(r\"in [0-9]+.[0-9][0-9](s| seconds)\")\n\n\ndef makeDiffable(output, ignore_warnings, syntax_errors):\n    # Of course many cases to deal with,\n    # pylint: disable=too-many-branches,too-many-statements\n\n    result = []\n\n    # Fix import \"readline\" because output sometimes starts with \"\\x1b[?1034h\"\n    m = re.match(b\"\\\\x1b\\\\[[^h]+h\", output)\n    if m:\n        output = output[len(m.group()) :]\n\n    lines = output.split(b\"\\n\")\n    if syntax_errors:\n        for line in lines:\n            if line.startswith(b\"SyntaxError:\"):\n                lines = [line]\n                break\n\n    for line in lines:\n        if type(line) is not str:\n            try:\n                line = line.decode(\"utf-8\" if os.name != \"nt\" else \"cp850\")\n            except UnicodeDecodeError:\n                line = repr(line)\n\n        if line.endswith(\"\\r\"):\n            line = line[:-1]\n\n        if line.startswith(\"REFCOUNTS\"):\n            first_value = line[line.find(\"[\") + 1 : line.find(\",\")]\n            last_value = line[line.rfind(\" \") + 1 : line.rfind(\"]\")]\n            line = line.replace(first_value, \"xxxxx\").replace(last_value, \"xxxxx\")\n\n        if line.startswith(\"[\") and line.endswith(\"refs]\"):\n            continue\n\n        if ignore_warnings and logging_warning_re.match(line):\n            continue\n\n        # Infos are always ignored.\n        if logging_info_re.match(line):\n            continue\n\n        if line.startswith(\"Nuitka-Inclusion:WARNING: Cannot follow import to module\"):\n            continue\n        if line.startswith(\"Nuitka:WARNING: Cannot detect Linux distribution\"):\n            continue\n        if line.startswith(\n            \"Nuitka-Options:WARNING: You did not specify to follow or include\"\n        ):\n            continue\n        if line.startswith(\"Nuitka:WARNING: Using very slow fallback for ordered sets\"):\n            continue\n        if line.startswith(\"Nuitka:WARNING: On Windows, support for input/output\"):\n            continue\n        if line.startswith(\"Nuitka:WARNING:     Complex topic\"):\n            continue\n        if line.startswith(\"Nuitka:WARNING:\") and \"matching checksum\" in line:\n            continue\n\n        if syntax_error_caret_re.match(line):\n            continue\n\n        line = instance_re.sub(r\"at 0xxxxxxxxx\\1\", line)\n        line = thread_re.sub(r\"Thread 0xXXXXXXXX\", line)\n        line = compiled_types_re.sub(r\"\\1\", line)\n        line = global_name_error_re.sub(r\"\\1\\2\\3\", line)\n\n        line = module_repr_re.sub(r\"\\1xxxxx\\2\", line)\n\n        # Frozen modules of 3.11, _imp._frozen_module_names\n        for module_name in (\n            \"zipimport\",\n            \"abc\",\n            \"codecs\",\n            \"io\",\n            \"_collections_abc\",\n            \"_sitebuiltins\",\n            \"genericpath\",\n            \"ntpath\",\n            \"posixpath\",\n            \"os.path\",\n            \"os\",\n            \"site\",\n            \"stat\",\n        ):\n            line = line.replace(\n                \"<module '%s' (frozen)>\" % module_name,\n                \"<module '%s' from 'xxxxx'>\" % module_name,\n            )\n\n        line = non_ascii_error_rt.sub(r\"\\1 xxxx\", line)\n        line = timing_re.sub(r\"in x.xx seconds\", line)\n\n        # Windows has a different \"os.path\", update according to it.\n        line = line.replace(\"ntpath\", \"posixpath\")\n\n        # This URL is updated, and Nuitka outputs the new one, but we test\n        # against versions that don't have that.\n        line = line.replace(\n            \"http://www.python.org/peps/pep-0263.html\",\n            \"http://python.org/dev/peps/pep-0263/\",\n        )\n\n        line = ran_tests_re.sub(r\"\\1x.xxxs\", line)\n\n        line = traceback_re.sub(traceback_re_callback, line)\n\n        line = importerror_re.sub(import_re_callback, line)\n\n        line = tempfile_re.sub(r\"/tmp/tmpxxxxxxx\", line)\n\n        # This is a bug potentially, occurs only for CPython when re-directed,\n        # we are going to ignore the issue as Nuitka is fine.\n        if (\n            line\n            == \"\"\"\\\nException RuntimeError: 'maximum recursion depth \\\nexceeded while calling a Python object' in \\\n<type 'exceptions.AttributeError'> ignored\"\"\"\n        ):\n            continue\n\n        # TODO: Harmonize exception ignored in function or method.\n        if re.match(\"Exception ignored in:.*__del__\", line):\n            continue\n\n        # This is also a bug potentially, but only visible under\n        # CPython\n        line = python_win_lib_re.sub(r\"C:\\\\Python\\1Lib\", line)\n\n        # Port numbers can be random, lets ignore them\n        line = local_port_re.sub(r\"\\1:xxxxx\", line)\n\n        # This is a bug with clang potentially, can't find out why it says that.\n        if line == \"/usr/bin/ld: warning: .init_array section has zero size\":\n            continue\n\n        # This occurs if 32bit libs exist on a 64bit system.\n        if re.match(\".*ld: skipping incompatible .* when searching for .*\", line):\n            continue\n\n        # This is for NetBSD and OpenBSD, which seems to build \"libpython\" so\n        # that it gives such warnings.\n        if \"() possibly used unsafely\" in line or \"() is almost always misused\" in line:\n            continue\n\n        # This is for CentOS5, where the linker says this, and it's hard to\n        # disable\n        if \"skipping incompatible /usr/lib/libpython2.6.so\" in line:\n            continue\n\n        # This is for self compiled Python with default options, gives this\n        # harmless option for every time we link to \"libpython\".\n        if (\n            \"is dangerous, better use `mkstemp'\" in line\n            or \"In function `posix_tempnam'\" in line\n            or \"In function `posix_tmpnam'\" in line\n        ):\n            continue\n\n        # Ignore spurious clcache warning.\n        if \"clcache: persistent json file\" in line or \"clcache: manifest file\" in line:\n            continue\n\n        # Some tests do malloc too large things on purpose\n        if \"WARNING: AddressSanitizer failed to allocate\" in line:\n            continue\n\n        # Ignore manual error message of CPython 3.11 that is different from the generic one for super\n        line = line.replace(\n            \"super() argument 1 must be a type, not NoneType\",\n            \"super() argument 1 must be type, not None\",\n        )\n        line = line.replace(\n            \"super() argument 1 must be a type\", \"super() argument 1 must be type\"\n        )\n\n        # Ignore logger message on macOS that will have timestamps and program name\n        # that differ without forcing logger config to avoid it.\n        if \"XType: Using static font registry\" in line:\n            continue\n\n        result.append(line)\n\n    return result\n\n\ndef compareOutput(\n    kind, out_cpython, out_nuitka, ignore_warnings, syntax_errors, trace_result=True\n):\n    from_date = \"\"\n    to_date = \"\"\n\n    diff = difflib.unified_diff(\n        makeDiffable(out_cpython, ignore_warnings, syntax_errors),\n        makeDiffable(out_nuitka, ignore_warnings, syntax_errors),\n        \"{program} ({detail})\".format(program=os.environ[\"PYTHON\"], detail=kind),\n        \"{program} ({detail})\".format(program=\"nuitka\", detail=kind),\n        from_date,\n        to_date,\n        n=3,\n    )\n\n    result = list(diff)\n\n    if result:\n        if trace_result:\n            for line in result:\n                my_print(line, end=\"\\n\" if not line.startswith(\"---\") else \"\")\n\n        return 1\n    else:\n        return 0\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/Pythons.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test tool to run a program with various Pythons. \"\"\"\n\nfrom nuitka.PythonVersions import getSupportedPythonVersions\nfrom nuitka.utils.Execution import check_output\nfrom nuitka.utils.InstalledPythons import findPythons\n\n\ndef findAllPythons():\n    for python_version in getSupportedPythonVersions():\n        for python in findPythons(python_version):\n            yield python, python_version\n\n\ndef executeWithInstalledPython(python, args):\n    return check_output([python.getPythonExe()] + args)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/RuntimeTracing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runtime tracing\n\nAt this time we detect DLLs used by a program with this code, such\nthat we can check if it loads things outside of the program, but we\ncan also use this to determine what to include, so some plugins will\nbe using this.\n\n\"\"\"\n\nimport os\nimport re\nimport sys\n\nfrom nuitka.freezer.DependsExe import getDependsExePath, parseDependsExeOutput\nfrom nuitka.utils.Execution import (\n    callProcess,\n    executeProcess,\n    isExecutableCommand,\n    withEnvironmentVarOverridden,\n)\nfrom nuitka.utils.FileOperations import deleteFile\nfrom nuitka.utils.Utils import isFreeBSD, isMacOS, isWin32Windows\n\nfrom .Common import traceExecutedCommand\n\n\ndef _getRuntimeTraceOfLoadedFilesWin32(logger, command, required):\n    path = command[0]\n\n    output_filename = path + \".depends\"\n\n    command = (\n        getDependsExePath(),\n        \"-c\",  # Console mode\n        \"-ot%s\" % output_filename,\n        \"-f1\",\n        \"-pb\",\n        \"-pa1\",  # Turn on all profiling options.\n        \"-ps1\",  # Simulate ShellExecute with app dirs in PATH.\n        \"-pp1\",  # Do not long DllMain calls.\n        \"-po1\",  # Log DllMain call for all other messages.\n        \"-ph1\",  # Hook the process.\n        \"-pl1\",  # Log LoadLibrary calls.\n        \"-pt1\",  # Thread information.\n        \"-pe1\",  # First chance exceptions.\n        \"-pg1\",  # Log GetProcAddress calls.\n        \"-pf1\",  # Use full paths.\n        \"-pc1\",  # Profile child processes.\n    ) + tuple(command)\n\n    # TODO: Move the handling of this into nuitka.tools.Execution module methods.\n    try:\n        callProcess(command, timeout=5 * 60)\n    except Exception as e:  # Catch all the things, pylint: disable=broad-except\n        if e.__class__.__name__ == \"TimeoutExpired\":\n            if required:\n                logger.sysexit(\"Timeout encountered when running dependency walker.\")\n\n            logger.warning(\"Timeout encountered when running dependency walker.\")\n            return []\n        else:\n            raise\n\n    result = parseDependsExeOutput(output_filename)\n\n    deleteFile(output_filename, must_exist=False)\n\n    return result\n\n\ndef _takeSystemCallTraceOutput(logger, path, command):\n    tracing_tool = command[0] if command[0] != \"sudo\" else command[1]\n\n    result = []\n\n    # Ensure executable is not polluted with third party stuff,\n    # tests may fail otherwise due to unexpected libs being loaded\n    # spell-checker: ignore ENOENT,write_nocancel\n    with withEnvironmentVarOverridden(\"LD_PRELOAD\", None):\n        if os.getenv(\"NUITKA_TRACE_COMMANDS\", \"0\") != \"0\":\n            traceExecutedCommand(\"Tracing with:\", command)\n\n        _stdout_strace, stderr_strace, exit_strace = executeProcess(\n            command, stdin=False, timeout=5 * 60\n        )\n\n        if exit_strace != 0:\n            if str is not bytes:\n                stderr_strace = stderr_strace.decode(\"utf8\")\n\n            logger.warning(stderr_strace)\n            logger.sysexit(\"Failed to run '%s'.\" % tracing_tool)\n\n        if b\"dtrace: system integrity protection is on\" in stderr_strace:\n            logger.sysexit(\"System integrity protection prevents system call tracing.\")\n\n        with open(path + \".\" + tracing_tool, \"wb\") as f:\n            f.write(stderr_strace)\n\n        for line in stderr_strace.split(b\"\\n\"):\n            if exit_strace != 0:\n                logger.my_print(line)\n\n            if not line:\n                continue\n\n            # Don't consider files not found. The \"site\" module checks lots\n            # of things.\n            if b\"ENOENT\" in line:\n                continue\n\n            if line.startswith((b\"write(\", b\"write_nocancel(\", b\"read(\")):\n                continue\n\n            if line.startswith((b\"stat(\", b\"newfstatat(\")) and b\"S_IFDIR\" in line:\n                continue\n\n            # Don't consider files not found.\n            if line.startswith(b\"stat64(\") and b\"= -1\" in line:\n                continue\n\n            result.extend(\n                os.path.abspath(match)\n                for match in re.findall(b'\"(.*?)(?:\\\\\\\\0)?\"', line)\n            )\n\n        if str is not bytes:\n            result = [s.decode(\"utf8\") for s in result]\n\n    return result\n\n\ndef _getRuntimeTraceOfLoadedFilesDtruss(logger, command):\n    if not isExecutableCommand(\"dtruss\"):\n        logger.sysexit(\n            \"\"\"\\\nError, needs 'dtruss' on your system to scan used libraries.\"\"\"\n        )\n\n    if not isExecutableCommand(\"sudo\"):\n        logger.sysexit(\n            \"\"\"\\\nError, needs 'sudo' on your system to scan used libraries.\"\"\"\n        )\n\n    binary_path = os.path.abspath(command[0])\n    command = (\"sudo\", \"dtruss\", binary_path) + tuple(command[1:])\n\n    return _takeSystemCallTraceOutput(logger=logger, command=command, path=binary_path)\n\n\ndef _getRuntimeTraceOfLoadedFilesStrace(logger, command):\n    if not isExecutableCommand(\"strace\"):\n        logger.sysexit(\n            \"\"\"\\\nError, needs 'strace' on your system to scan used libraries.\"\"\"\n        )\n\n    binary_path = os.path.abspath(command[0])\n\n    command = (\n        \"strace\",\n        \"-e\",\n        \"file\",\n        \"-s4096\",  # Some paths are truncated in output otherwise\n        binary_path,\n    ) + tuple(command[1:])\n\n    return _takeSystemCallTraceOutput(logger=logger, command=command, path=binary_path)\n\n\n_supports_taking_runtime_traces = None\n\n\ndef doesSupportTakingRuntimeTrace():\n    if not isMacOS():\n        return True\n\n    # Python2 hangs calling dtruss for no good reason, probably a bug in\n    # subprocess32 with Python2 that we do not care about.\n    if str is bytes:\n        return False\n\n    # singleton, pylint: disable=global-statement\n    global _supports_taking_runtime_traces\n\n    if _supports_taking_runtime_traces is None:\n        command = (\"sudo\", \"dtruss\", \"echo\")\n\n        _stdout, stderr, exit_code = executeProcess(\n            command, stdin=False, timeout=5 * 60\n        )\n\n        _supports_taking_runtime_traces = (\n            exit_code == 0\n            and b\"dtrace: system integrity protection is on\" not in stderr\n        )\n\n    return _supports_taking_runtime_traces\n\n\ndef getRuntimeTraceOfLoadedFiles(logger, command, required=False):\n    \"\"\"Returns the files loaded when executing a binary.\"\"\"\n\n    # This will make a crazy amount of work,\n    # pylint: disable=I0021,too-many-branches,too-many-locals,too-many-statements\n\n    path = command[0]\n\n    if not os.path.exists(path):\n        logger.sysexit(\n            \"Error, cannot find '%s' ('%s').\" % (path, os.path.abspath(path))\n        )\n\n    result = []\n\n    if isWin32Windows():\n        result = _getRuntimeTraceOfLoadedFilesWin32(\n            logger=logger, command=command, required=required\n        )\n    elif isMacOS() or isFreeBSD():\n        # On macOS and FreeBSD, we can use dtruss, which is similar to strace.\n        result = _getRuntimeTraceOfLoadedFilesDtruss(logger=logger, command=command)\n    elif os.name == \"posix\":\n        result = _getRuntimeTraceOfLoadedFilesStrace(logger=logger, command=command)\n\n    result = tuple(sorted(set(result)))\n\n    return result\n\n\ndef main():\n    from nuitka.Tracing import tools_logger\n\n    for filename in getRuntimeTraceOfLoadedFiles(\n        logger=tools_logger, command=sys.argv[1:]\n    ):\n        print(filename)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/SearchModes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Search modes for Nuitka's test runner.\n\nThe test runner can handle found errors, skip tests, etc. with search\nmodes, which are implemented here.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.__past__ import md5\nfrom nuitka.utils.FileOperations import (\n    areSamePaths,\n    getFileContents,\n    putTextFileContents,\n)\n\n\nclass SearchModeBase(object):\n    def __init__(self):\n        self.may_fail = []\n\n    def consider(self, dirname, filename):\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return True\n\n    def finish(self):\n        pass\n\n    def abortOnFinding(self, dirname, filename):\n        for candidate in self.may_fail:\n            if self._match(dirname, filename, candidate):\n                return False\n\n        return True\n\n    def getExtraFlags(self, dirname, filename):\n        # Virtual method, pylint: disable=no-self-use,unused-argument\n        return []\n\n    def mayFailFor(self, *names):\n        self.may_fail += names\n\n    @classmethod\n    def _match(cls, dirname, filename, candidate):\n        # Cyclic dependency.\n        from .Common import getStartDir\n\n        parts = [dirname, filename]\n\n        while None in parts:\n            parts.remove(None)\n        assert parts\n\n        path = os.path.join(*parts)\n\n        candidates = (\n            dirname,\n            filename,\n            filename.rsplit(\".\", 1)[0],\n            filename.rsplit(\".\", 1)[0].replace(\"Test\", \"\"),\n            path,\n            path.rsplit(\".\", 1)[0],\n            path.rsplit(\".\", 1)[0].replace(\"Test\", \"\"),\n        )\n\n        return candidate.rstrip(\"/\") in candidates or areSamePaths(\n            os.path.join(getStartDir(), candidate), filename\n        )\n\n    def exit(self, message):\n        # Virtual method, pylint: disable=no-self-use\n        sys.exit(message)\n\n    def isCoverage(self):\n        # Virtual method, pylint: disable=no-self-use\n        return False\n\n    def onErrorDetected(self, message):\n        self.exit(message)\n\n\nclass SearchModeImmediate(SearchModeBase):\n    pass\n\n\nclass SearchModeByPattern(SearchModeBase):\n    def __init__(self, start_at):\n        SearchModeBase.__init__(self)\n\n        self.active = False\n        self.start_at = start_at\n\n    def consider(self, dirname, filename):\n        if self.start_at is None:\n            self.active = True\n\n        if self.active:\n            return True\n\n        self.active = self._match(dirname, filename, self.start_at)\n        return self.active\n\n    def finish(self):\n        if not self.active:\n            sys.exit(\"Error, became never active.\")\n\n\nclass SearchModeResume(SearchModeBase):\n    def __init__(self, tests_path):\n        SearchModeBase.__init__(self)\n\n        tests_path = os.path.normcase(os.path.abspath(tests_path))\n        version = sys.version\n\n        if str is not bytes:\n            tests_path = tests_path.encode(\"utf8\")\n            version = version.encode(\"utf8\")\n\n        case_hash = md5(tests_path)\n        case_hash.update(version)\n\n        from .Common import getTestingCacheDir\n\n        cache_filename = os.path.join(getTestingCacheDir(), case_hash.hexdigest())\n\n        self.cache_filename = cache_filename\n\n        if os.path.exists(cache_filename):\n            self.resume_from = getFileContents(cache_filename) or None\n        else:\n            self.resume_from = None\n\n        self.active = not self.resume_from\n\n    def consider(self, dirname, filename):\n        parts = [dirname, filename]\n\n        while None in parts:\n            parts.remove(None)\n        assert parts\n\n        path = os.path.join(*parts)\n\n        if self.active:\n            putTextFileContents(self.cache_filename, contents=path)\n\n            return True\n\n        if areSamePaths(path, self.resume_from):\n            self.active = True\n\n        return self.active\n\n    def finish(self):\n        os.unlink(self.cache_filename)\n        if not self.active:\n            sys.exit(\"Error, became never active, restarting next time.\")\n\n\nclass SearchModeCoverage(SearchModeByPattern):\n    def getExtraFlags(self, dirname, filename):\n        return [\"coverage\"]\n\n    def isCoverage(self):\n        return True\n\n\nclass SearchModeOnly(SearchModeByPattern):\n    def __init__(self, start_at):\n        SearchModeByPattern.__init__(self, start_at=start_at)\n\n        self.done = False\n\n    def consider(self, dirname, filename):\n        if self.done:\n            return False\n        else:\n            active = SearchModeByPattern.consider(\n                self, dirname=dirname, filename=filename\n            )\n\n            if active:\n                self.done = True\n\n            return active\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/Valgrind.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Valgrind tool usage.\n\nWe are using it for benchmarking purposes, as it's an analysis tool at the\nsame time and gives deterministic results.\n\"\"\"\n\nimport sys\n\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import check_output, executeProcess\nfrom nuitka.utils.FileOperations import (\n    copyFile,\n    getFileContentByLine,\n    withTemporaryFile,\n)\nfrom nuitka.utils.Utils import isWin32Windows\n\n\ndef runValgrind(descr, tool, args, include_startup, save_logfilename=None):\n    # Many cases to deal with, pylint: disable=too-many-branches\n\n    if isWin32Windows():\n        sys.exit(\"Error, valgrind is not available on Windows.\")\n\n    if descr:\n        my_print(descr, tool, file=sys.stderr, end=\"... \")\n\n    with withTemporaryFile() as log_file:\n        log_filename = log_file.name\n\n        command = [\"valgrind\", \"-q\"]\n\n        if tool == \"callgrind\":\n            command += (\"--tool=callgrind\", \"--callgrind-out-file=%s\" % log_filename)\n        elif tool == \"massif\":\n            command += (\"--tool=massif\", \"--massif-out-file=%s\" % log_filename)\n        else:\n            sys.exit(\"Error, no support for tool '%s' yet.\" % tool)\n\n        # Do not count things before main module starts its work.\n        if not include_startup:\n            command += (\n                \"--zero-before=init__main__()\",\n                \"--zero-before=init__main__\",\n                \"--zero-before=PyInit___main__\",\n                \"--zero-before=PyInit___main__()\",\n            )\n\n        command.extend(args)\n\n        _stdout_valgrind, stderr_valgrind, exit_valgrind = executeProcess(command)\n\n        assert exit_valgrind == 0, stderr_valgrind\n        if descr:\n            my_print(\"OK\", file=sys.stderr)\n\n        if save_logfilename is not None:\n            copyFile(log_filename, save_logfilename)\n\n        max_mem = None\n\n        for line in getFileContentByLine(log_filename):\n            if tool == \"callgrind\" and line.startswith(\"summary:\"):\n                return int(line.split()[1])\n            elif tool == \"massif\" and line.startswith(\"mem_heap_B=\"):\n                mem = int(line.split(\"=\")[1])\n\n                if max_mem is None:\n                    max_mem = 0\n\n                max_mem = max(mem, max_mem)\n\n        if tool == \"massif\" and max_mem is not None:\n            return max_mem\n\n        sys.exit(\"Error, didn't parse Valgrind log file successfully.\")\n\n\ndef getBinarySizes(filename):\n    command = [\"size\", filename]\n    sizes = check_output(command).strip()\n    sizes = sizes.split(b\"\\n\")[-1].replace(b\"\\t\", b\"\").split()\n\n    return int(sizes[0]), int(sizes[1])\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/check_reference_counts/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/check_reference_counts/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tool to compare reference counting behaviour of CPython and Nuitka.\n\n\"\"\"\n\nimport os\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.PythonVersions import isDebugPython\nfrom nuitka.tools.testing.Common import checkReferenceCount, getTempDir\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import check_call\nfrom nuitka.utils.Importing import importFileAsModule\n\n\ndef main():\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--checked-module\",\n        action=\"store\",\n        dest=\"checked_module\",\n        help=\"\"\"\\\nModule with main() function to be checked for reference count stability.\"\"\",\n    )\n\n    parser.add_option(\n        \"--explain\",\n        action=\"store_true\",\n        dest=\"explain\",\n        default=False,\n        help=\"\"\"\\\nTry to explain the differences by comparing object counts.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if positional_args and options.checked_module is None:\n        options.checked_module = positional_args.pop()\n\n    if positional_args and options.checked_module:\n        parser.print_help()\n\n        sys.exit(\"\\nError, no positional argument allowed.\")\n\n    # First with pure Python.\n    checked_module = importFileAsModule(options.checked_module)\n    my_print(\"Using %s\" % checked_module.main, style=\"blue\")\n    checkReferenceCount(checked_module.main, explain=options.explain)\n\n    temp_dir = getTempDir()\n    command = [\n        sys.executable,\n        \"-m\",\n        \"nuitka\",\n        \"--module\",\n        options.checked_module,\n        \"--output-dir=%s\" % temp_dir,\n    ]\n\n    if isDebugPython():\n        command.append(\"--python-debug\")\n\n    check_call(command)\n\n    module_name = os.path.basename(options.checked_module).split(\".\")[0]\n\n    sys.path.insert(0, temp_dir)\n    checked_module = __import__(module_name)\n\n    my_print(\"Using %s\" % checked_module.main, style=\"blue\")\n    checkReferenceCount(checked_module.main)\n\n\nif __name__ == \"__main__\":\n    nuitka_package_dir = os.path.normpath(\n        os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\", \"..\"))\n    )\n\n    # Unchanged, running from checkout, use the parent directory, the nuitka\n    # package ought be there.\n    sys.path.insert(0, nuitka_package_dir)\n\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/compare_with_cpython/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/compare_with_cpython/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tool to compare output of CPython and Nuitka.\n\n\"\"\"\n\nimport os\nimport pickle\nimport re\nimport sys\nimport time\n\nfrom nuitka.__past__ import md5\nfrom nuitka.OptionParsing import getNuitkaProjectOptions\nfrom nuitka.tools.testing.Common import (\n    addToPythonPath,\n    executeAfterTimePassed,\n    getDebugPython,\n    getTempDir,\n    getTestingCPythonOutputsCacheDir,\n    killProcessGroup,\n    test_logger,\n    traceExecutedCommand,\n    withPythonPathChange,\n)\nfrom nuitka.tools.testing.OutputComparison import compareOutput\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.Execution import (\n    callProcess,\n    check_output,\n    createProcess,\n    executeProcess,\n    wrapCommandForDebuggerForSubprocess,\n)\nfrom nuitka.utils.FileOperations import deleteFile\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\nfrom nuitka.utils.Timing import StopWatch\n\n\ndef displayOutput(stdout, stderr):\n    if type(stdout) is not str:\n        stdout = stdout.decode(\"utf-8\" if os.name != \"nt\" else \"cp850\")\n        stderr = stderr.decode(\"utf-8\" if os.name != \"nt\" else \"cp850\")\n\n    my_print(stdout, end=\" \")\n    if stderr:\n        my_print(stderr)\n\n\ndef checkNoPermissionError(output):\n    # Forms of permission errors.\n    for candidate in (\n        b\"Permission denied:\",\n        b\"PermissionError:\",\n        b\"DBPermissionsError:\",\n    ):\n        if candidate in output:\n            return False\n\n    # These are localized it seems, spell-checker: ignore totest\n    if re.search(\n        b\"(WindowsError|FileNotFoundError|FileExistsError|WinError 145):\"\n        b\".*(@test|totest|xx|Error 145)\",\n        output,\n    ):\n        return False\n\n    # Give those a retry as well.\n    if b\"clcache.__main__.CacheLockException\" in output:\n        return False\n\n    return True\n\n\ndef _getCPythonResults(cpython_cmd, send_kill):\n    stop_watch = StopWatch()\n\n    # Try a compile of times for permission denied, on Windows it can\n    # be transient.\n    for _i in range(5):\n        stop_watch.start()\n\n        with withPythonPathChange(os.getcwd()):\n            process = createProcess(command=cpython_cmd, new_group=send_kill)\n\n        if send_kill:\n            # Doing it per loop iteration hopefully, pylint: disable=cell-var-from-loop\n            executeAfterTimePassed(\n                message=\"Scheduling process kill in %.02fs\",\n                timeout=2.0,\n                func=lambda: killProcessGroup(\"Uncompiled Python program\", process.pid),\n            )\n\n        stdout_cpython, stderr_cpython = process.communicate()\n        exit_cpython = process.returncode\n\n        stop_watch.stop()\n\n        if checkNoPermissionError(stdout_cpython) and checkNoPermissionError(\n            stderr_cpython\n        ):\n            break\n\n        my_print(\"Retrying CPython due to permission problems after delay.\")\n        time.sleep(2)\n\n    cpython_time = stop_watch.getDelta()\n\n    return cpython_time, stdout_cpython, stderr_cpython, exit_cpython\n\n\ndef getCPythonResults(cpython_cmd, cpython_cached, force_update, send_kill):\n    # Many details, pylint: disable=too-many-locals\n\n    cached = False\n    if cpython_cached:\n        # TODO: Hashing stuff and creating cache filename is duplicate code\n        # and should be shared.\n        hash_input = \" -- \".join(cpython_cmd)\n        if str is not bytes:\n            hash_input = hash_input.encode(\"utf8\")\n\n        command_hash = md5(hash_input)\n\n        for element in cpython_cmd:\n            if os.path.exists(element):\n                with open(element, \"rb\") as element_file:\n                    command_hash.update(element_file.read())\n\n        hash_salt = os.getenv(\"NUITKA_HASH_SALT\", \"\")\n\n        if str is not bytes:\n            hash_salt = hash_salt.encode(\"utf8\")\n        command_hash.update(hash_salt)\n\n        if os.name == \"nt\" and str is bytes:\n            curdir = os.getcwdu()  # spell-checker: ignore getcwdu\n        else:\n            curdir = os.getcwd()\n\n        command_hash.update(curdir.encode(\"utf8\"))\n\n        cache_filename = os.path.join(\n            getTestingCPythonOutputsCacheDir(), command_hash.hexdigest()\n        )\n\n        if os.path.exists(cache_filename) and not force_update:\n            try:\n                with open(cache_filename, \"rb\") as cache_file:\n                    (\n                        cpython_time,\n                        stdout_cpython,\n                        stderr_cpython,\n                        exit_cpython,\n                    ) = pickle.load(cache_file)\n            except (IOError, EOFError, ValueError):\n                # Broken cache content.\n                pass\n            else:\n                cached = True\n\n    if not cached:\n        cpython_time, stdout_cpython, stderr_cpython, exit_cpython = _getCPythonResults(\n            cpython_cmd=cpython_cmd, send_kill=send_kill\n        )\n\n        if cpython_cached:\n            with open(cache_filename, \"wb\") as cache_file:\n                pickle.dump(\n                    (cpython_time, stdout_cpython, stderr_cpython, exit_cpython),\n                    cache_file,\n                )\n\n    return cpython_time, stdout_cpython, stderr_cpython, exit_cpython\n\n\ndef main():\n    # Of course many cases to deal with, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    filename = sys.argv[1]\n    args = sys.argv[2:]\n\n    def hasArg(arg):\n        if arg in args:\n            args.remove(arg)\n            return True\n        else:\n            return False\n\n    def hasArgValue(arg_option, default=None):\n        for arg in args:\n            if arg.startswith(arg_option + \"=\"):\n                args.remove(arg)\n                return arg[len(arg_option) + 1 :]\n        return default\n\n    def hasArgValues(arg_option):\n        result = []\n\n        for arg in tuple(args):\n            if arg.startswith(arg_option + \"=\"):\n                args.remove(arg)\n                result.append(arg[len(arg_option) + 1 :])\n\n        return result\n\n    # For output keep it\n    arguments = list(args)\n\n    silent_mode = hasArg(\"silent\")\n    ignore_stderr = hasArg(\"ignore_stderr\")\n    ignore_warnings = hasArg(\"ignore_warnings\")\n    expect_success = hasArg(\"expect_success\")\n    expect_failure = hasArg(\"expect_failure\")\n    python_debug = hasArg(\"python_debug\") or hasArg(\"--python-debug\")\n    module_mode = hasArg(\"--module\")\n    module_entry_point = hasArgValue(\"--module-entry-point\")\n    coverage_mode = hasArg(\"coverage\")\n    two_step_execution = hasArg(\"two_step_execution\")\n    binary_python_path = hasArg(\"binary_python_path\")\n    trace_command = (\n        hasArg(\"trace_command\") or os.getenv(\"NUITKA_TRACE_COMMANDS\", \"0\") != \"0\"\n    )\n    remove_output = hasArg(\"remove_output\")\n    remove_binary = not hasArg(\"--keep-binary\")\n    standalone_mode = hasArg(\"--standalone\")\n    onefile_mode = hasArg(\"--onefile\")\n    no_site = hasArg(\"no_site\") or coverage_mode\n    report = hasArgValue(\"--report\")\n    nofollow_imports = hasArg(\"recurse_none\") or hasArg(\"--nofollow-imports\")\n    follow_imports = hasArg(\"recurse_all\") or hasArg(\"--follow-imports\")\n    timing = hasArg(\"timing\")\n    original_file = hasArg(\"original_file\") or hasArg(\n        \"--file-reference-choice=original\"\n    )\n    runtime_file = hasArg(\"runtime_file\") or hasArg(\"--file-reference-choice=runtime\")\n    no_warnings = not hasArg(\"warnings\")\n    full_compat = not hasArg(\"improved\")\n    cpython_cached = hasArg(\"cpython_cache\")\n    syntax_errors = hasArg(\"syntax_errors\")\n    no_prefer_source = hasArg(\"--no-prefer-source\")\n    no_verbose_log = hasArg(\"no_verbose_log\")\n    no_inclusion_log = hasArg(\"no_inclusion_log\")\n    send_kill = hasArg(\"--send-ctrl-c\")\n    output_dir = hasArgValue(\"--output-dir\", None)\n    include_packages = hasArgValues(\"--include-package\")\n    include_modules = hasArgValues(\"--include-module\")\n    python_flag_m = hasArg(\"--python-flag=-m\")\n    python_version = hasArgValue(\"--python-version\")\n\n    if python_version:\n        python_version = tuple(int(d) for d in python_version.split(\".\"))\n\n    plugins_enabled = []\n    for count, arg in reversed(tuple(enumerate(args))):\n        if arg.startswith(\"plugin_enable:\"):\n            plugins_enabled.append(arg[len(\"plugin_enable:\") :])\n            del args[count]\n\n    plugins_disabled = []\n    for count, arg in reversed(tuple(enumerate(args))):\n        if arg.startswith(\"plugin_disable:\"):\n            plugins_disabled.append(arg[len(\"plugin_disable:\") :])\n            del args[count]\n\n    user_plugins = []\n    for count, arg in reversed(tuple(enumerate(args))):\n        if arg.startswith(\"user_plugin:\"):\n            user_plugins.append(arg[len(\"user_plugin:\") :])\n            del args[count]\n\n    nowarn_mnemonics = []\n\n    for count, arg in reversed(tuple(enumerate(args))):\n        if arg.startswith(\"--nowarn-mnemonic=\"):\n            nowarn_mnemonics.append(arg[len(\"--nowarn-mnemonic=\") :])\n            del args[count]\n\n    if args:\n        sys.exit(\"Error, non understood mode(s) '%s',\" % \",\".join(args))\n\n    project_options = tuple(\n        getNuitkaProjectOptions(\n            logger=test_logger, filename_arg=filename, module_mode=module_mode\n        )\n    )\n\n    if \"--standalone\" in project_options:\n        standalone_mode = True\n    if \"--onefile\" in project_options:\n        standalone_mode = True\n        onefile_mode = True\n\n    # In coverage mode, we don't want to execute, and to do this only in one mode,\n    # we enable two step execution, which splits running the binary from the actual\n    # compilation:\n    if coverage_mode:\n        two_step_execution = True\n\n    # The coverage mode doesn't work with debug mode.\n    if coverage_mode:\n        python_debug = False\n\n    comparison_mode = not coverage_mode\n\n    # We need to split it, so we know when to kill.\n    if send_kill:\n        two_step_execution = True\n\n    assert not standalone_mode or not module_mode\n    assert not follow_imports or not nofollow_imports\n\n    if \"PYTHONHASHSEED\" not in os.environ:\n        os.environ[\"PYTHONHASHSEED\"] = \"0\"\n\n    os.environ[\"PYTHONWARNINGS\"] = \"ignore\"\n\n    if \"PYTHON\" not in os.environ:\n        os.environ[\"PYTHON\"] = sys.executable\n\n    extra_options = os.getenv(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n    if os.path.normcase(os.environ[\"PYTHON\"]).endswith((\"-dbg\", \"-debug\", \"_d.exe\")):\n        python_debug = True\n    elif \"--python-debug\" in extra_options or \"--python-dbg\" in extra_options:\n        python_debug = True\n\n    if python_debug:\n        os.environ[\"PYTHON\"] = getDebugPython() or os.environ[\"PYTHON\"]\n\n    if comparison_mode:\n        my_print(\n            \"\"\"\\\nComparing output of '{filename}' using '{python}' with flags {args} ...\"\"\".format(\n                filename=filename,\n                python=os.environ[\"PYTHON\"],\n                args=\", \".join(arguments),\n            )\n        )\n    else:\n        my_print(\n            \"\"\"\\\nTaking coverage of '{filename}' using '{python}' with flags {args} ...\"\"\".format(\n                filename=filename,\n                python=os.environ[\"PYTHON\"],\n                args=\", \".join(arguments),\n            )\n        )\n\n    if comparison_mode and not silent_mode:\n        my_print(\"*\" * 80)\n        my_print(\"CPython:\")\n        my_print(\"*\" * 80)\n\n    if two_step_execution:\n        filename = os.path.abspath(filename)\n\n    if module_mode:\n        module_name = os.path.basename(filename)\n\n        if module_name.endswith(\".py\"):\n            module_name = module_name[:-3]\n\n        mini_script = \"import %s\" % module_name\n        if module_entry_point:\n            mini_script += \"; %s.%s()\" % (module_name, module_entry_point)\n\n        cpython_cmd = [\n            os.environ[\"PYTHON\"],\n            \"-c\",\n            \"import sys; sys.path.append(%s); %s\"\n            % (repr(os.path.dirname(filename)), mini_script),\n        ]\n\n        if python_version and python_version >= (3, 11):\n            cpython_cmd += [\"-X\", \"frozen_modules=off\"]\n\n        if no_warnings:\n            cpython_cmd[1:1] = [\n                \"-W\",\n                \"ignore\",\n            ]\n    else:\n        cpython_cmd = [os.environ[\"PYTHON\"]]\n\n        if no_warnings:\n            cpython_cmd[1:1] = [\n                \"-W\",\n                \"ignore\",\n            ]\n\n        if python_version and python_version >= (3, 11):\n            cpython_cmd += [\"-X\", \"frozen_modules=off\"]\n\n        if python_flag_m:\n            cpython_cmd += [\"-m\", os.path.basename(filename)]\n            os.chdir(os.path.dirname(filename))\n        else:\n            cpython_cmd.append(filename)\n\n    if no_site:\n        cpython_cmd.insert(1, \"-S\")\n\n    if \"NUITKA\" in os.environ:\n        # Would need to extract which \"python\" this is going to use.\n        assert not coverage_mode, \"Not implemented for binaries.\"\n\n        nuitka_call = [os.environ[\"PYTHON\"], os.environ[\"NUITKA\"]]\n    else:\n        if comparison_mode:\n            nuitka_call = [\n                os.environ[\"PYTHON\"],\n                \"-m\",\n                \"nuitka.__main__\",  # Note: Needed for Python2.6\n            ]\n        else:\n            assert coverage_mode\n\n            # spell-checker: ignore rcfile\n\n            nuitka_call = [\n                os.environ[\"PYTHON\"],\n                \"-S\",\n                \"-m\",\n                \"coverage\",\n                \"run\",\n                \"--rcfile\",\n                os.devnull,\n                \"-a\",\n                \"-m\",\n                \"nuitka.__main__\",  # Note: Needed for Python2.6\n            ]\n\n    if python_debug:\n        extra_options.append(\"--python-debug\")\n\n    if no_warnings:\n        extra_options.append(\"--python-flag=no_warnings\")\n\n    if remove_output:\n        extra_options.append(\"--remove-output\")\n\n    if original_file:\n        extra_options.append(\"--file-reference-choice=original\")\n\n    if runtime_file:\n        extra_options.append(\"--file-reference-choice=runtime\")\n\n    if full_compat:\n        extra_options.append(\"--full-compat\")\n\n    if no_prefer_source:\n        extra_options.append(\"--no-prefer-source\")\n\n    if python_flag_m:\n        extra_options.append(\"--python-flag=-m\")\n\n    if coverage_mode:\n        # Coverage modules hates Nuitka to re-execute, and so we must avoid\n        # that.\n        python_path = check_output(\n            [\n                os.environ[\"PYTHON\"],\n                \"-c\",\n                \"import sys, os; print(os.pathsep.join(sys.path))\",\n            ]\n        )\n\n        if sys.version_info >= (3,):\n            python_path = python_path.decode(\"utf8\")\n\n        os.environ[\"PYTHONPATH\"] = python_path.strip()\n\n    if binary_python_path:\n        addToPythonPath(os.path.dirname(os.path.abspath(filename)))\n\n    if report:\n        extra_options.append(\"--report=%s\" % report)\n        deleteFile(report, must_exist=False)\n\n    if nofollow_imports or (not follow_imports and not standalone_mode):\n        extra_options.append(\"--nofollow-imports\")\n\n    if follow_imports:\n        extra_options.append(\"--follow-imports\")\n\n    if nowarn_mnemonics:\n        extra_options.extend(\"--nowarn-mnemonic=\" + v for v in nowarn_mnemonics)\n\n    if coverage_mode:\n        extra_options.append(\"--must-not-re-execute\")\n        extra_options.append(\"--generate-c-only\")\n\n    for plugin_enabled in plugins_enabled:\n        extra_options.append(\"--enable-plugin=\" + plugin_enabled)\n\n    for plugin_disabled in plugins_disabled:\n        extra_options.append(\"--disable-plugin=\" + plugin_disabled)\n\n    for user_plugin in user_plugins:\n        extra_options.append(\"--user-plugin=\" + user_plugin)\n\n    if not no_verbose_log:\n        extra_options.append(\"--verbose-output=%s.optimization.log\" % filename)\n\n    if not no_inclusion_log:\n        extra_options.append(\"--show-modules-output=%s.inclusion.log\" % filename)\n\n    if output_dir is not None:\n        extra_options.append(\"--output-dir=%s\" % output_dir)\n    else:\n        # TODO: The run-tests uses NUITKA_EXTRA_OPTIONS still.\n        for extra_option in extra_options:\n            dir_match = re.search(r\"--output-dir=(.*?)(\\s|$)\", extra_option)\n\n            if dir_match:\n                output_dir = dir_match.group(1)\n                break\n        else:\n            # The default.\n            output_dir = \".\"\n\n    for include_package in include_packages:\n        extra_options.append(\"--include-package=%s\" % include_package)\n\n    for include_module in include_modules:\n        extra_options.append(\"--include-module=%s\" % include_module)\n\n    # Progress bar is not used.\n    extra_options.append(\"--no-progressbar\")\n\n    # Now build the command to run Nuitka.\n    if not two_step_execution:\n        if module_mode:\n            extra_options.append(\"--module\")\n        elif onefile_mode:\n            extra_options.append(\"--onefile\")\n        elif standalone_mode:\n            extra_options.append(\"--standalone\")\n\n        nuitka_cmd = nuitka_call + extra_options + [\"--run\", filename]\n\n        if no_site:\n            nuitka_cmd.insert(len(nuitka_cmd) - 1, \"--python-flag=-S\")\n\n    else:\n        if module_mode:\n            nuitka_cmd1 = (\n                nuitka_call + extra_options + [\"--module\", os.path.abspath(filename)]\n            )\n        elif standalone_mode:\n            nuitka_cmd1 = nuitka_call + extra_options + [\"--standalone\", filename]\n        else:\n            nuitka_cmd1 = nuitka_call + extra_options + [filename]\n\n        if no_site:\n            nuitka_cmd1.insert(len(nuitka_cmd1) - 1, \"--python-flag=-S\")\n\n    if module_mode:\n        module_name = os.path.basename(filename)\n\n        if module_name.endswith(\".py\"):\n            module_name = module_name[:-3]\n\n        nuitka_cmd2 = [os.environ[\"PYTHON\"], \"-W\", \"ignore\", \"-c\", mini_script]\n    else:\n        exe_filename = os.path.basename(filename)\n\n        if filename.endswith(\".py\"):\n            exe_filename = exe_filename[:-3]\n\n        exe_filename = exe_filename.replace(\")\", \"\").replace(\"(\", \"\")\n\n        if os.name == \"nt\":\n            exe_filename += \".exe\"\n        else:\n            exe_filename += \".bin\"\n\n        nuitka_cmd2 = [os.path.join(output_dir, exe_filename)]\n\n        pdb_filename = exe_filename[:-4] + \".pdb\"\n\n    if trace_command:\n        traceExecutedCommand(\"CPython command\", cpython_cmd)\n\n    if comparison_mode:\n        cpython_time, stdout_cpython, stderr_cpython, exit_cpython = getCPythonResults(\n            cpython_cmd=cpython_cmd,\n            cpython_cached=cpython_cached,\n            force_update=False,\n            send_kill=send_kill,\n        )\n\n        if not silent_mode:\n            displayOutput(stdout_cpython, stderr_cpython)\n\n    if comparison_mode and not silent_mode:\n        my_print(\"*\" * 80)\n        my_print(\"Nuitka:\")\n        my_print(\"*\" * 80)\n\n    if two_step_execution:\n        if output_dir:\n            os.chdir(output_dir)\n        else:\n            tmp_dir = getTempDir()\n            os.chdir(tmp_dir)\n\n        if trace_command:\n            my_print(\"Going to output directory\", os.getcwd())\n\n    stop_watch = StopWatch()\n    stop_watch.start()\n\n    if not two_step_execution:\n        if trace_command:\n            traceExecutedCommand(\"Nuitka command\", nuitka_cmd)\n\n        # Try a couple of times for permission denied, on Windows it can\n        # be transient.\n        for _i in range(5):\n            with withPythonPathChange(nuitka_package_dir):\n                process = createProcess(command=nuitka_cmd)\n\n            stdout_nuitka, stderr_nuitka = process.communicate()\n            exit_nuitka = process.returncode\n\n            if checkNoPermissionError(stdout_nuitka) and checkNoPermissionError(\n                stderr_nuitka\n            ):\n                break\n\n            my_print(\"Retrying nuitka exe due to permission problems after delay.\")\n            time.sleep(2)\n\n    else:\n        if trace_command:\n            my_print(\"Nuitka command 1:\", nuitka_cmd1)\n\n        for _i in range(5):\n            with withPythonPathChange(nuitka_package_dir):\n                stdout_nuitka1, stderr_nuitka1, exit_nuitka1 = executeProcess(\n                    nuitka_cmd1\n                )\n\n                python_path_used = os.environ[\"PYTHONPATH\"]\n\n            if exit_nuitka1 != 0:\n                if (\n                    not expect_failure\n                    and not comparison_mode\n                    and not os.path.exists(\".coverage\")\n                ):\n                    sys.exit(\n                        \"\"\"\\\nError, failed to take coverage with '%s' (PYTHONPATH was '%s').\n\nStderr was:\n%s\n\"\"\"\n                        % (nuitka_cmd1, python_path_used, stderr_nuitka1)\n                    )\n\n                exit_nuitka = exit_nuitka1\n                stdout_nuitka, stderr_nuitka = stdout_nuitka1, stderr_nuitka1\n                stdout_nuitka2 = b\"not run due to compilation error:\\n\" + stdout_nuitka1\n                stderr_nuitka2 = stderr_nuitka1\n            else:\n                # No execution second step for coverage mode.\n                if comparison_mode:\n                    if os.path.exists(nuitka_cmd2[0][:-4] + \".cmd\"):\n                        nuitka_cmd2[0] = nuitka_cmd2[0][:-4] + \".cmd\"\n\n                    if trace_command:\n                        my_print(\"Nuitka command 2:\", nuitka_cmd2)\n\n                    # Need full manual control\n                    process = createProcess(command=nuitka_cmd2, new_group=send_kill)\n\n                    if send_kill:\n                        # Lambda is used immediately in same loop, pylint: disable=cell-var-from-loop\n                        executeAfterTimePassed(\n                            message=\"Scheduling process kill in %.02fs\",\n                            timeout=2.0,\n                            func=lambda: killProcessGroup(\n                                \"Nuitka compiled program\", process.pid\n                            ),\n                        )\n\n                    stdout_nuitka2, stderr_nuitka2 = process.communicate()\n                    stdout_nuitka = stdout_nuitka1 + stdout_nuitka2\n                    stderr_nuitka = stderr_nuitka1 + stderr_nuitka2\n                    exit_nuitka = process.returncode\n\n                    # In case of segfault or assertion triggered, run in debugger.\n                    if exit_nuitka in (-11, -6) and sys.platform != \"nt\":\n                        nuitka_cmd2 = wrapCommandForDebuggerForSubprocess(*nuitka_cmd2)\n\n                        callProcess(nuitka_cmd2, shell=False)\n                else:\n                    exit_nuitka = exit_nuitka1\n                    stdout_nuitka, stderr_nuitka = stdout_nuitka1, stderr_nuitka1\n\n            if checkNoPermissionError(stdout_nuitka) and checkNoPermissionError(\n                stderr_nuitka\n            ):\n                break\n\n            my_print(\"Retrying nuitka exe due to permission problems after delay.\")\n            time.sleep(2)\n\n    stop_watch.stop()\n    nuitka_time = stop_watch.getDelta()\n\n    if not silent_mode:\n        displayOutput(stdout_nuitka, stderr_nuitka)\n\n        if coverage_mode:\n            assert not stdout_nuitka\n            assert not stderr_nuitka\n\n    if comparison_mode:\n\n        def makeComparisons(trace_result):\n            exit_code_stdout = compareOutput(\n                \"stdout\",\n                stdout_cpython,\n                stdout_nuitka2 if two_step_execution else stdout_nuitka,\n                ignore_warnings,\n                syntax_errors,\n            )\n\n            if ignore_stderr:\n                exit_code_stderr = 0\n            else:\n                exit_code_stderr = compareOutput(\n                    \"stderr\",\n                    stderr_cpython,\n                    stderr_nuitka2 if two_step_execution else stderr_nuitka,\n                    ignore_warnings,\n                    syntax_errors,\n                )\n\n            exit_code_return = exit_cpython != exit_nuitka\n\n            if exit_code_return and trace_result:\n                my_print(\n                    \"\"\"Exit codes {exit_cpython:d} (CPython) != {exit_nuitka:d} (Nuitka)\"\"\".format(\n                        exit_cpython=exit_cpython, exit_nuitka=exit_nuitka\n                    )\n                )\n\n            return exit_code_stdout, exit_code_stderr, exit_code_return\n\n        if cpython_cached:\n            exit_code_stdout, exit_code_stderr, exit_code_return = makeComparisons(\n                trace_result=False\n            )\n\n            if not int(os.getenv(\"NUITKA_CPYTHON_NO_CACHE_UPDATE\", \"0\")):\n                if exit_code_stdout or exit_code_stderr or exit_code_return:\n                    old_stdout_cpython = stdout_cpython\n                    old_stderr_cpython = stderr_cpython\n                    old_exit_cpython = exit_cpython\n\n                    my_print(\n                        \"Updating CPython cache by force due to non-matching comparison results.\",\n                        style=\"yellow\",\n                    )\n\n                    (\n                        cpython_time,\n                        stdout_cpython,\n                        stderr_cpython,\n                        exit_cpython,\n                    ) = getCPythonResults(\n                        cpython_cmd=cpython_cmd,\n                        cpython_cached=cpython_cached,\n                        force_update=True,\n                        send_kill=send_kill,\n                    )\n\n                    if not silent_mode:\n                        if (\n                            old_stdout_cpython != stdout_cpython\n                            or old_stderr_cpython != stderr_cpython\n                            or old_exit_cpython != exit_cpython\n                        ):\n                            displayOutput(stdout_cpython, stderr_cpython)\n\n        exit_code_stdout, exit_code_stderr, exit_code_return = makeComparisons(\n            trace_result=True\n        )\n\n        # In case of segfault, also output the call stack by entering debugger\n        # without stdin forwarded.\n        if (\n            exit_code_return\n            and exit_nuitka in (-11, -6)\n            and sys.platform != \"nt\"\n            and not module_mode\n            and not two_step_execution\n        ):\n            nuitka_cmd.insert(len(nuitka_cmd) - 1, \"--debugger\")\n\n            with withPythonPathChange(nuitka_package_dir):\n                callProcess(nuitka_cmd, shell=False)\n\n        exit_code = exit_code_stdout or exit_code_stderr or exit_code_return\n\n        if exit_code:\n            problems = []\n            if exit_code_stdout:\n                problems.append(\"stdout\")\n            if exit_code_stderr:\n                problems.append(\"stderr\")\n            if exit_code_return:\n                problems.append(\"exit_code\")\n\n            sys.exit(\"Error, results differed (%s).\" % \",\".join(problems))\n\n        if expect_success and exit_cpython != 0:\n            if silent_mode:\n                displayOutput(stdout_cpython, stderr_cpython)\n\n            sys.exit(\"Unexpected error exit from CPython.\")\n\n        if expect_failure and exit_cpython == 0:\n            sys.exit(\"Unexpected success exit from CPython.\")\n\n    if remove_output:\n        if not module_mode:\n            if os.path.exists(nuitka_cmd2[0]) and remove_binary:\n                if os.name == \"nt\":\n                    # It appears there is a tiny lock race that we randomly cause,\n                    # likely because --run spawns a subprocess that might still\n                    # be doing the cleanup work.\n                    if os.path.exists(nuitka_cmd2[0] + \".away\"):\n                        os.unlink(nuitka_cmd2[0] + \".away\")\n\n                    for _i in range(10):\n                        try:\n                            os.rename(nuitka_cmd2[0], nuitka_cmd2[0] + \".away\")\n                        except OSError:\n                            time.sleep(0.1)\n                            continue\n\n                    for _i in range(10):\n                        try:\n                            os.unlink(nuitka_cmd2[0] + \".away\")\n                        except OSError:\n                            time.sleep(2)\n                            continue\n                        else:\n                            break\n\n                    if os.path.exists(pdb_filename):\n                        os.unlink(pdb_filename)\n                else:\n                    os.unlink(nuitka_cmd2[0])\n        else:\n            module_filename = os.path.basename(filename) + getSharedLibrarySuffix(\n                preferred=True\n            )\n\n            if os.path.exists(module_filename) and remove_binary:\n                os.unlink(module_filename)\n\n    if comparison_mode and timing:\n        my_print(\"CPython took %.2fs vs %0.2fs Nuitka.\" % (cpython_time, nuitka_time))\n\n    if comparison_mode and not silent_mode:\n        my_print(\"OK, same outputs.\")\n\n\nnuitka_package_dir = os.path.normpath(\n    os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\", \"..\"))\n)\n\n\nif __name__ == \"__main__\":\n    # Unchanged, running from checkout, use the parent directory, the nuitka\n    # package ought be there.\n    sys.path.insert(0, nuitka_package_dir)\n\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/find_sxs_modules/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/find_sxs_modules/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tool to compare find SxS using modules.\n\n\"\"\"\n\nimport os\nimport sys\nimport tempfile\n\nfrom nuitka.tools.testing.Common import (\n    compileLibraryTest,\n    createSearchMode,\n    setup,\n)\nfrom nuitka.Tracing import my_print\nfrom nuitka.utils.SharedLibraries import getSxsFromDLL\n\n\ndef decide(root, filename):\n    return (\n        filename.endswith((\".so\", \".pyd\"))\n        and not filename.startswith(\"libpython\")\n        and getSxsFromDLL(os.path.join(root, filename))\n    )\n\n\ndef action(stage_dir, root, path):\n    # We need only the actual path, pylint: disable=unused-argument\n\n    sxs = getSxsFromDLL(path)\n    if sxs:\n        my_print(path, sxs)\n\n\ndef main():\n    if os.name != \"nt\":\n        sys.exit(\"Error, this is only for use on Windows where SxS exists.\")\n\n    setup(needs_io_encoding=True)\n    search_mode = createSearchMode()\n\n    tmp_dir = tempfile.gettempdir()\n\n    compileLibraryTest(\n        search_mode=search_mode,\n        stage_dir=os.path.join(tmp_dir, \"find_sxs_modules\"),\n        decide=decide,\n        action=action,\n    )\n\n    my_print(\"FINISHED, all extension modules checked.\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/measure_construct_performance/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/measure_construct_performance/__main__.py",
    "content": "#!/usr/bin/python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Run a construct based comparison test.\n\nThis executes a program with and without snippet of code and\nstores the numbers about it, extracted with Valgrind for use\nin comparisons.\n\n\"\"\"\n\nimport os\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.__past__ import md5\nfrom nuitka.tools.testing.Common import (\n    check_output,\n    convertUsing2to3,\n    decideNeeds2to3,\n    getPythonSysPath,\n    getPythonVersionString,\n    getTempDir,\n    my_print,\n    setup,\n)\nfrom nuitka.tools.testing.Constructs import generateConstructCases\nfrom nuitka.tools.testing.Valgrind import runValgrind\nfrom nuitka.utils.Execution import check_call\nfrom nuitka.utils.FileOperations import (\n    copyFile,\n    getFileContentByLine,\n    getFileContents,\n    putTextFileContents,\n)\n\n\ndef _setPythonPath(case_name):\n    if \"Numpy\" in case_name:\n        os.environ[\"PYTHONPATH\"] = getPythonSysPath()\n\n\ndef main():\n    # Complex stuff, not broken down yet\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--nuitka\", action=\"store\", dest=\"nuitka\", default=os.getenv(\"NUITKA\", \"\")\n    )\n\n    parser.add_option(\n        \"--cpython\",\n        action=\"store\",\n        dest=\"cpython\",\n        default=os.getenv(\"PYTHON\", sys.executable),\n    )\n\n    parser.add_option(\"--code-diff\", action=\"store\", dest=\"diff_filename\", default=\"\")\n\n    parser.add_option(\"--copy-source-to\", action=\"store\", dest=\"target_dir\", default=\"\")\n\n    options, positional_args = parser.parse_args()\n\n    if len(positional_args) != 1:\n        sys.exit(\"Error, need to give test case file name as positional argument.\")\n\n    test_case = positional_args[0]\n\n    if os.path.exists(test_case):\n        test_case = os.path.abspath(test_case)\n\n    case_name = os.path.basename(test_case)\n\n    if options.cpython == \"no\":\n        options.cpython = \"\"\n\n    nuitka = options.nuitka\n\n    if os.path.exists(nuitka):\n        nuitka = os.path.abspath(nuitka)\n    elif nuitka:\n        sys.exit(\"Error, nuitka binary '%s' not found.\" % nuitka)\n\n    diff_filename = options.diff_filename\n    if diff_filename:\n        diff_filename = os.path.abspath(diff_filename)\n\n    setup(silent=True, go_main=False)\n\n    _setPythonPath(case_name)\n\n    assert os.path.exists(test_case), (test_case, os.getcwd())\n\n    my_print(\"PYTHON='%s'\" % getPythonVersionString())\n    my_print(\"PYTHON_BINARY='%s'\" % os.environ[\"PYTHON\"])\n    my_print(\"TEST_CASE_HASH='%s'\" % md5(getFileContents(test_case, \"rb\")).hexdigest())\n\n    needs_2to3 = decideNeeds2to3(test_case)\n\n    if options.target_dir:\n        copyFile(\n            test_case, os.path.join(options.target_dir, os.path.basename(test_case))\n        )\n\n    # First produce two variants.\n    temp_dir = getTempDir()\n\n    test_case_1 = os.path.join(temp_dir, \"Variant1_\" + os.path.basename(test_case))\n    test_case_2 = os.path.join(temp_dir, \"Variant2_\" + os.path.basename(test_case))\n\n    case_1_source, case_2_source = generateConstructCases(getFileContents(test_case))\n\n    putTextFileContents(test_case_1, case_1_source)\n    putTextFileContents(test_case_2, case_2_source)\n\n    if needs_2to3:\n        test_case_1, _needs_delete = convertUsing2to3(test_case_1)\n        test_case_2, _needs_delete = convertUsing2to3(test_case_2)\n\n    os.environ[\"PYTHONHASHSEED\"] = \"0\"\n\n    if nuitka:\n        nuitka_id = check_output(\n            \"cd %s; git rev-parse HEAD\" % os.path.dirname(nuitka), shell=True\n        )\n        nuitka_id = nuitka_id.strip()\n\n        if sys.version_info > (3,):\n            nuitka_id = nuitka_id.decode()\n\n        my_print(\"NUITKA_COMMIT='%s'\" % nuitka_id)\n\n    os.chdir(getTempDir())\n\n    if nuitka:\n        nuitka_call = [\n            os.environ[\"PYTHON\"],\n            nuitka,\n            \"--quiet\",\n            \"--no-progressbar\",\n            \"--nofollow-imports\",\n            \"--python-flag=no_site\",\n        ]\n\n        nuitka_call.extend(os.getenv(\"NUITKA_EXTRA_OPTIONS\", \"\").split())\n\n        nuitka_call.append(case_name)\n\n        # We want to compile under the same filename to minimize differences, and\n        # then copy the resulting files afterwards.\n        copyFile(test_case_1, case_name)\n\n        check_call(nuitka_call)\n\n        if os.path.exists(case_name.replace(\".py\", \".exe\")):\n            exe_suffix = \".exe\"\n        else:\n            exe_suffix = \".bin\"\n\n        os.rename(\n            os.path.basename(test_case).replace(\".py\", \".build\"),\n            os.path.basename(test_case_1).replace(\".py\", \".build\"),\n        )\n        os.rename(\n            os.path.basename(test_case).replace(\".py\", exe_suffix),\n            os.path.basename(test_case_1).replace(\".py\", exe_suffix),\n        )\n\n        copyFile(test_case_2, os.path.basename(test_case))\n\n        check_call(nuitka_call)\n\n        os.rename(\n            os.path.basename(test_case).replace(\".py\", \".build\"),\n            os.path.basename(test_case_2).replace(\".py\", \".build\"),\n        )\n        os.rename(\n            os.path.basename(test_case).replace(\".py\", exe_suffix),\n            os.path.basename(test_case_2).replace(\".py\", exe_suffix),\n        )\n\n        if diff_filename:\n            suffixes = [\".c\", \".cpp\"]\n\n            for suffix in suffixes:\n                cpp_1 = os.path.join(\n                    test_case_1.replace(\".py\", \".build\"), \"module.__main__\" + suffix\n                )\n\n                if os.path.exists(cpp_1):\n                    break\n            else:\n                assert False\n\n            for suffix in suffixes:\n                cpp_2 = os.path.join(\n                    test_case_2.replace(\".py\", \".build\"), \"module.__main__\" + suffix\n                )\n                if os.path.exists(cpp_2):\n                    break\n            else:\n                assert False\n\n            import difflib\n\n            putTextFileContents(\n                diff_filename,\n                difflib.HtmlDiff().make_table(\n                    getFileContentByLine(cpp_1),\n                    getFileContentByLine(cpp_2),\n                    \"Construct\",\n                    \"Baseline\",\n                    True,\n                ),\n            )\n\n        nuitka_1 = runValgrind(\n            \"Nuitka construct\",\n            \"callgrind\",\n            (test_case_1.replace(\".py\", exe_suffix),),\n            include_startup=True,\n        )\n\n        nuitka_2 = runValgrind(\n            \"Nuitka baseline\",\n            \"callgrind\",\n            (test_case_2.replace(\".py\", exe_suffix),),\n            include_startup=True,\n        )\n\n        nuitka_diff = nuitka_1 - nuitka_2\n\n        my_print(\"NUITKA_COMMAND='%s'\" % \" \".join(nuitka_call), file=sys.stderr)\n        my_print(\"NUITKA_RAW=%s\" % nuitka_1)\n        my_print(\"NUITKA_BASE=%s\" % nuitka_2)\n        my_print(\"NUITKA_CONSTRUCT=%s\" % nuitka_diff)\n\n    if options.cpython:\n        os.environ[\"PYTHON\"] = options.cpython\n\n        cpython_call = [os.environ[\"PYTHON\"], \"-S\", test_case_1]\n\n        cpython_1 = runValgrind(\n            \"CPython construct\",\n            \"callgrind\",\n            cpython_call,\n            include_startup=True,\n        )\n\n        cpython_call = [os.environ[\"PYTHON\"], \"-S\", test_case_2]\n\n        cpython_2 = runValgrind(\n            \"CPython baseline\",\n            \"callgrind\",\n            cpython_call,\n            include_startup=True,\n        )\n\n        cpython_diff = cpython_1 - cpython_2\n\n        my_print(\"CPYTHON_RAW=%d\" % cpython_1)\n        my_print(\"CPYTHON_BASE=%d\" % cpython_2)\n        my_print(\"CPYTHON_CONSTRUCT=%d\" % cpython_diff)\n\n    if options.cpython and options.nuitka:\n        if nuitka_diff == 0:\n            nuitka_gain = float(\"inf\")\n        else:\n            nuitka_gain = float(100 * cpython_diff) / nuitka_diff\n\n        my_print(\"NUITKA_GAIN=%.3f\" % nuitka_gain)\n        my_print(\"RAW_GAIN=%.3f\" % (float(100 * cpython_1) / nuitka_1))\n        my_print(\"BASE_GAIN=%.3f\" % (float(100 * cpython_2) / nuitka_2))\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/run_nuitka_tests/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/testing/run_nuitka_tests/__main__.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main front-end to the tests of Nuitka.\n\nHas many options, read --help output.\n\"\"\"\n\nimport os\nimport subprocess\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.PythonVersions import getTestExecutionPythonVersions\nfrom nuitka.tools.Basics import goHome\nfrom nuitka.tools.testing.Common import (\n    getInstalledPythonVersion,\n    getTempDir,\n    my_print,\n    test_logger,\n    withExtendedExtraOptions,\n)\nfrom nuitka.utils.Execution import check_call, check_output, getNullOutput\nfrom nuitka.utils.FileOperations import (\n    getFileContents,\n    openTextFile,\n    putTextFileContents,\n    withDirectoryChange,\n)\nfrom nuitka.utils.Timing import TimerReport\nfrom nuitka.utils.Utils import hasOnefileSupportedOS, hasStandaloneSupportedOS\n\n\ndef parseOptions():\n    # There are freaking many options to honor,\n    # pylint: disable=too-many-branches,too-many-statements\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--skip-basic-tests\",\n        action=\"store_false\",\n        dest=\"basic_tests\",\n        default=True,\n        help=\"\"\"\\\nThe basic tests, execute these to check if Nuitka is healthy.\nDefault is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-syntax-tests\",\n        action=\"store_false\",\n        dest=\"syntax_tests\",\n        default=True,\n        help=\"\"\"\\\nThe syntax tests, execute these to check if Nuitka handles Syntax errors fine.\nDefault is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-program-tests\",\n        action=\"store_false\",\n        dest=\"program_tests\",\n        default=True,\n        help=\"\"\"\\\nThe programs tests, execute these to check if Nuitka handles programs, e.g.\nimport recursions, etc. fine. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-package-tests\",\n        action=\"store_false\",\n        dest=\"package_tests\",\n        default=True,\n        help=\"\"\"\\\nThe packages tests, execute these to check if Nuitka handles packages, e.g.\nimport recursions, etc. fine. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-plugins-tests\",\n        action=\"store_false\",\n        dest=\"plugin_tests\",\n        default=True,\n        help=\"\"\"\\\nThe plugins tests, execute these to check if Nuitka handles its own plugin\ninterfaces, e.g. user plugins, etc. fine. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-optimizations-tests\",\n        action=\"store_false\",\n        dest=\"optimization_tests\",\n        default=True,\n        help=\"\"\"\\\nThe optimization tests, execute these to check if Nuitka does optimize certain\nconstructs fully away. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-standalone-tests\",\n        action=\"store_false\",\n        dest=\"standalone_tests\",\n        default=hasStandaloneSupportedOS(),\n        help=\"\"\"\\\nThe standalone tests, execute these to check if Nuitka standalone mode, e.g.\nnot referring to outside, important 3rd library packages like PyQt fine.\nDefault is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-onefile-tests\",\n        action=\"store_false\",\n        dest=\"onefile_tests\",\n        default=hasOnefileSupportedOS(),\n        help=\"\"\"\\\nThe onefile tests, execute these to check if Nuitka works in onefile mode, e.g.\nnot referring to outside, important 3rd library packages like PyQt fine.\nDefault is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-reflection-test\",\n        action=\"store_false\",\n        dest=\"reflection_test\",\n        default=True,\n        help=\"\"\"\\\nThe reflection test compiles Nuitka with Nuitka, and then Nuitka with the\ncompile Nuitka and compares the outputs. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython26-tests\",\n        action=\"store_false\",\n        dest=\"cpython26\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython2.6 test suite. Execute this for all corner cases to be\ncovered. With Python 2.7 this covers exception behavior quite well. Default\nis %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython27-tests\",\n        action=\"store_false\",\n        dest=\"cpython27\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython2.7 test suite. Execute this for all corner cases to be\ncovered. With Python 2.6 these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython32-tests\",\n        action=\"store_false\",\n        dest=\"cpython32\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.2 test suite. Execute this for all corner cases to be\ncovered. With Python 2.6 these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython34-tests\",\n        action=\"store_false\",\n        dest=\"cpython34\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.4 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython35-tests\",\n        action=\"store_false\",\n        dest=\"cpython35\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.5 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython36-tests\",\n        action=\"store_false\",\n        dest=\"cpython36\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.6 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython37-tests\",\n        action=\"store_false\",\n        dest=\"cpython37\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.7 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython38-tests\",\n        action=\"store_false\",\n        dest=\"cpython38\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.8 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython39-tests\",\n        action=\"store_false\",\n        dest=\"cpython39\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.9 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython310-tests\",\n        action=\"store_false\",\n        dest=\"cpython310\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.10 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-cpython311-tests\",\n        action=\"store_false\",\n        dest=\"cpython311\",\n        default=True,\n        help=\"\"\"\\\nThe standard CPython3.11 test suite. Execute this for all corner cases to be\ncovered. With Python 2.x these are not run. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-other-cpython-tests\",\n        action=\"store_true\",\n        dest=\"cpython_no_other\",\n        default=False,\n        help=\"\"\"\\\nDo not execute any CPython test suite other than the one matching the running\nPython. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--skip-all-cpython-tests\",\n        action=\"store_true\",\n        dest=\"cpython_none\",\n        default=False,\n        help=\"\"\"\\\nDo not execute any CPython test suite other than the one matching the running\nPython. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-other-python\",\n        action=\"store_true\",\n        dest=\"no_other\",\n        default=False,\n        help=\"\"\"\\\nDo not use any other Python than the one running, even if available on\nthe system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python2.6\",\n        action=\"store_true\",\n        dest=\"no26\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python2.6 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python2.7\",\n        action=\"store_true\",\n        dest=\"no27\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python2.7 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.3\",\n        action=\"store_true\",\n        dest=\"no33\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.3 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.4\",\n        action=\"store_true\",\n        dest=\"no34\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.4 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.5\",\n        action=\"store_true\",\n        dest=\"no35\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.5 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.6\",\n        action=\"store_true\",\n        dest=\"no36\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.6 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.7\",\n        action=\"store_true\",\n        dest=\"no37\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.7 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.8\",\n        action=\"store_true\",\n        dest=\"no38\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.8 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.9\",\n        action=\"store_true\",\n        dest=\"no39\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.9 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.10\",\n        action=\"store_true\",\n        dest=\"no310\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.10 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-python3.11\",\n        action=\"store_true\",\n        dest=\"no311\",\n        default=False,\n        help=\"\"\"\\\nDo not use Python3.11 even if available on the system. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--coverage\",\n        action=\"store_true\",\n        dest=\"coverage\",\n        default=False,\n        help=\"\"\"\\\nMake a coverage analysis, that does not really check. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-debug\",\n        action=\"store_false\",\n        dest=\"debug\",\n        default=True,\n        help=\"\"\"\\\nMake a coverage analysis, that does not really check. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--assume-yes-for-downloads\",\n        action=\"store_true\",\n        dest=\"assume_yes_for_downloads\",\n        default=False,\n        help=\"\"\"\\\nAllow Nuitka to download code if necessary, e.g. dependency walker on Windows. Default is %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--mingw64\",\n        action=\"store_true\",\n        dest=\"mingw64\",\n        default=False,\n        help=\"\"\"\\\nEnforce the use of MinGW64 on Windows. Defaults to off.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    if positional_args:\n        parser.print_help()\n\n        sys.exit(\"\\nError, no positional argument allowed.\")\n\n    if options.no_other:\n        if sys.version_info[0:2] != (2, 6):\n            options.no26 = True\n        if sys.version_info[0:2] != (2, 7):\n            options.no27 = True\n        if sys.version_info[0:2] != (3, 3):\n            options.no33 = True\n        if sys.version_info[0:2] != (3, 4):\n            options.no34 = True\n        if sys.version_info[0:2] != (3, 5):\n            options.no35 = True\n        if sys.version_info[0:2] != (3, 6):\n            options.no36 = True\n        if sys.version_info[0:2] != (3, 7):\n            options.no37 = True\n        if sys.version_info[0:2] != (3, 8):\n            options.no38 = True\n        if sys.version_info[0:2] != (3, 9):\n            options.no39 = True\n        if sys.version_info[0:2] != (3, 10):\n            options.no310 = True\n        if sys.version_info[0:2] != (3, 11):\n            options.no311 = True\n\n    if options.cpython_no_other:\n        if sys.version_info[0:2] != (2, 6):\n            options.cpython26 = False\n        if sys.version_info[0:2] != (2, 7):\n            options.cpython27 = False\n        if sys.version_info[0:2] != (3, 2):\n            options.cpython32 = False\n        if sys.version_info[0:2] != (3, 4):\n            options.cpython34 = False\n        if sys.version_info[0:2] != (3, 5):\n            options.cpython35 = False\n        if sys.version_info[0:2] != (3, 6):\n            options.cpython36 = False\n        if sys.version_info[0:2] != (3, 7):\n            options.cpython37 = False\n        if sys.version_info[0:2] != (3, 8):\n            options.cpython38 = False\n        if sys.version_info[0:2] != (3, 9):\n            options.cpython39 = False\n        if sys.version_info[0:2] != (3, 10):\n            options.cpython310 = False\n        if sys.version_info[0:2] != (3, 11):\n            options.cpython311 = False\n\n    if options.cpython_none:\n        options.cpython26 = False\n        options.cpython27 = False\n        options.cpython32 = False\n        options.cpython34 = False\n        options.cpython35 = False\n        options.cpython36 = False\n        options.cpython37 = False\n        options.cpython38 = False\n        options.cpython39 = False\n        options.cpython310 = False\n        options.cpython311 = False\n\n    if options.coverage and os.path.exists(\".coverage\"):\n        os.unlink(\".coverage\")\n\n    return options\n\n\ndef publishCoverageData():\n    def copyToGlobalCoverageData(source, target):\n        coverage_dir = os.getenv(\"COVERAGE_DIR\")\n\n        if coverage_dir is None:\n            return\n\n        check_call((\"scp\", source, os.path.join(coverage_dir, target)))\n\n    if os.name == \"nt\":\n        suffix = \"win\"\n    else:\n        import platform\n\n        suffix = platform.uname()[0] + \".\" + platform.uname()[4]\n\n    with openTextFile(\"data.coverage\", \"w\") as data_file:\n        source_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))\n\n        with withDirectoryChange(source_dir):\n            nuitka_id = check_output(\"git rev-parse HEAD\".split())\n        nuitka_id = nuitka_id.strip()\n\n        if sys.version_info > (3,):\n            nuitka_id = nuitka_id.decode()\n\n        data_file.write(\"NUITKA_SOURCE_DIR='%s'\\n\" % source_dir)\n        data_file.write(\"NUITKA_COMMIT='%s'\\n\" % nuitka_id)\n\n    copyToGlobalCoverageData(\"data.coverage\", \"meta.coverage.\" + suffix)\n\n    def makeCoverageRelative(filename):\n        \"\"\"Normalize coverage data.\"\"\"\n\n        data = getFileContents(filename)\n\n        data = data.replace(\n            (os.path.abspath(\".\") + os.path.sep).replace(\"\\\\\", \"\\\\\\\\\"), \"\"\n        )\n\n        if os.path.sep != \"/\":\n            data.replace(os.path.sep, \"/\")\n\n        putTextFileContents(filename, contents=data)\n\n    coverage_file = os.getenv(\"COVERAGE_FILE\", \".coverage\")\n\n    makeCoverageRelative(coverage_file)\n    copyToGlobalCoverageData(coverage_file, \"data.coverage.\" + suffix)\n\n\ndef main():\n    # There are many cases to deal with,\n    # pylint: disable=too-many-branches,too-many-statements\n\n    # Lets honor this Debian option here, spell-checker: ignore nocheck\n    if \"nocheck\" in os.getenv(\"DEB_BUILD_OPTIONS\", \"\").split():\n        my_print(\"Skipped all tests as per DEB_BUILD_OPTIONS environment.\")\n        sys.exit(0)\n\n    # Make sure our resolving of \"python2\" to \"python\" doesn't get in the way.\n    os.environ[\"PYTHON_DISALLOW_AMBIGUOUS_VERSION\"] = \"0\"\n\n    goHome()\n\n    options = parseOptions()\n\n    # Add the local bin directory to search path start.\n    os.environ[\"PATH\"] = (\n        os.path.join(os.getcwd(), \"bin\") + os.pathsep + os.environ[\"PATH\"]\n    )\n\n    def checkExecutableCommand(command):\n        \"\"\"Check if a command is executable.\"\"\"\n\n        # Many cases, pylint: disable=too-many-branches,too-many-return-statements\n\n        # Do respect given options to disable specific Python versions\n        if command == \"python2.6\" and options.no26:\n            return False\n        if command == \"python2.7\" and options.no27:\n            return False\n        if command == \"python3.3\" and options.no33:\n            return False\n        if command == \"python3.4\" and options.no34:\n            return False\n        if command == \"python3.5\" and options.no35:\n            return False\n        if command == \"python3.6\" and options.no36:\n            return False\n        if command == \"python3.7\" and options.no37:\n            return False\n        if command == \"python3.8\" and options.no38:\n            return False\n        if command == \"python3.9\" and options.no39:\n            return False\n        if command == \"python3.10\" and options.no310:\n            return False\n        if command == \"python3.11\" and options.no311:\n            return False\n\n        # Shortcuts for python versions, also needed for Windows as it won't have\n        # the version number in the Python binaries at all.\n        if command == \"python2.6\" and sys.version_info[0:2] == (2, 6):\n            return True\n        if command == \"python2.7\" and sys.version_info[0:2] == (2, 7):\n            return True\n        if command == \"python3.3\" and sys.version_info[0:2] == (3, 3):\n            return True\n        if command == \"python3.4\" and sys.version_info[0:2] == (3, 4):\n            return True\n        if command == \"python3.5\" and sys.version_info[0:2] == (3, 5):\n            return True\n        if command == \"python3.6\" and sys.version_info[0:2] == (3, 6):\n            return True\n        if command == \"python3.7\" and sys.version_info[0:2] == (3, 7):\n            return True\n        if command == \"python3.8\" and sys.version_info[0:2] == (3, 8):\n            return True\n        if command == \"python3.9\" and sys.version_info[0:2] == (3, 9):\n            return True\n        if command == \"python3.10\" and sys.version_info[0:2] == (3, 10):\n            return True\n        if command == \"python3.11\" and sys.version_info[0:2] == (3, 11):\n            return True\n\n        path = os.environ[\"PATH\"]\n\n        suffixes = (\".exe\",) if os.name == \"nt\" else (\"\",)\n\n        for part in path.split(os.pathsep):\n            if not part:\n                continue\n\n            for suffix in suffixes:\n                if os.path.exists(os.path.join(part, command + suffix)):\n                    return True\n\n        if os.name == \"nt\":\n            if command.startswith(\"python\"):\n                remainder = command[6:]\n\n                if 3 <= len(remainder) <= 4 and remainder[1] == \".\":\n                    return (\n                        getInstalledPythonVersion(\n                            python_version=remainder, must_exist=False\n                        )\n                        is not None\n                    )\n\n        return False\n\n    def getExtraFlags(where, name, flags):\n        if options.assume_yes_for_downloads and name in (\n            \"onefile\",\n            \"standalone\",\n            \"plugins\",\n        ):\n            yield \"--assume-yes-for-downloads\"\n\n        if os.name == \"nt\" and options.mingw64:\n            yield \"--mingw64\"\n\n        if where is not None:\n            tmp_dir = getTempDir()\n\n            where = os.path.join(tmp_dir, name, where)\n\n            if not os.path.exists(where):\n                os.makedirs(where)\n\n            yield \"--output-dir=%s\" % where\n\n        yield flags\n\n    def executeSubTest(command, hide_output=False):\n        with TimerReport(\n            message=\"Overall execution of %r took %%.2f seconds\" % command\n        ):\n            _executeSubTest(command, hide_output)\n\n    def _executeSubTest(command, hide_output):\n        if options.coverage and \"search\" in command:\n            command = command.replace(\"search\", \"coverage\")\n\n        parts = command.split()\n        parts[0] = parts[0].replace(\"/\", os.path.sep)\n\n        # The running Python will be good enough, on some platforms there is no\n        # \"python\", and we need to pass this alone then.\n        parts.insert(0, sys.executable)\n\n        my_print(\"Run '%s' in '%s'.\" % (\" \".join(parts), os.getcwd()))\n\n        if hide_output:\n            result = subprocess.call(parts, stdout=getNullOutput())\n        else:\n            result = subprocess.call(parts)\n\n        if result != 0:\n            sys.exit(result)\n\n    def execute_tests(where, use_python, flags):\n        # Many cases, pylint: disable=too-many-branches,too-many-statements\n\n        my_print(\n            \"Executing test case called '%s' with CPython '%s' and extra flags '%s'.\"\n            % (where, use_python, flags)\n        )\n\n        intended_version = use_python[6:]\n        if sys.version.startswith(intended_version):\n            os.environ[\"PYTHON\"] = sys.executable\n        else:\n            os.environ[\"PYTHON\"] = getInstalledPythonVersion(\n                intended_version, must_exist=True\n            ).getPythonExe()\n\n        if options.basic_tests:\n            my_print(\n                \"Running the basic tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(where, \"basics\", flags)):\n                executeSubTest(\"./tests/basics/run_all.py search\")\n\n        if options.syntax_tests:\n            my_print(\n                \"Running the syntax tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(where, \"syntax\", flags)):\n                executeSubTest(\"./tests/syntax/run_all.py search\")\n\n        if options.program_tests:\n            my_print(\n                \"Running the program tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(where, \"programs\", flags)):\n                executeSubTest(\"./tests/programs/run_all.py search\")\n\n        if options.package_tests:\n            my_print(\n                \"Running the package tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(where, \"packages\", flags)):\n                executeSubTest(\"./tests/packages/run_all.py search\")\n\n        if options.plugin_tests:\n            my_print(\n                \"Running the plugin tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(where, \"plugins\", flags)):\n                executeSubTest(\"./tests/plugins/run_all.py search\")\n\n        # At least one Debian Jessie, these versions won't have lxml installed, so\n        # don't run them there. Also these won't be very version dependent in their\n        # results.\n        if use_python != \"python2.6\":\n            if options.optimization_tests:\n                my_print(\n                    \"Running the optimizations tests with options '%s' with '%s':\"\n                    % (flags, use_python)\n                )\n                with withExtendedExtraOptions(\n                    *getExtraFlags(where, \"optimizations\", flags)\n                ):\n                    executeSubTest(\"./tests/optimizations/run_all.py search\")\n\n        if options.standalone_tests and not options.coverage:\n            my_print(\n                \"Running the standalone tests with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(None, \"standalone\", flags)):\n                executeSubTest(\"./tests/standalone/run_all.py search\")\n\n        if options.onefile_tests and not options.coverage:\n            if hasOnefileSupportedOS():\n                my_print(\n                    \"Running the onefile tests with options '%s' with '%s':\"\n                    % (flags, use_python)\n                )\n                with withExtendedExtraOptions(*getExtraFlags(None, \"onefile\", flags)):\n                    executeSubTest(\"./tests/onefile/run_all.py search\")\n            else:\n                my_print(\"The onefile tests are not run due to missing requirements.\")\n\n        if options.reflection_test and not options.coverage:\n            my_print(\n                \"Running the reflection test with options '%s' with '%s':\"\n                % (flags, use_python)\n            )\n            with withExtendedExtraOptions(*getExtraFlags(None, \"reflected\", flags)):\n                executeSubTest(\"./tests/reflected/compile_itself.py search\")\n\n        if not use_python.startswith(\"python3\"):\n            if os.path.exists(\"./tests/CPython26/run_all.py\"):\n                if options.cpython26:\n                    my_print(\n                        \"Running the CPython 2.6 tests with options '%s' with '%s':\"\n                        % (flags, use_python)\n                    )\n\n                    with withExtendedExtraOptions(\n                        *getExtraFlags(where, \"26tests\", flags)\n                    ):\n                        executeSubTest(\"./tests/CPython26/run_all.py search\")\n            else:\n                my_print(\"The CPython2.6 tests are not present, not run.\")\n\n            # Running the Python 2.7 test suite with CPython 2.6 gives little\n            # insight, because \"importlib\" will not be there and that's it.\n            if use_python != \"python2.6\":\n                if os.path.exists(\"./tests/CPython27/run_all.py\"):\n                    if options.cpython27:\n                        my_print(\n                            \"Running the CPython 2.7 tests with options '%s' with '%s':\"\n                            % (flags, use_python)\n                        )\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"27tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython27/run_all.py search\")\n                else:\n                    my_print(\"The CPython2.7 tests are not present, not run.\")\n\n        if \"--debug\" not in flags:\n            # Not running the Python 3.2 test suite with CPython2.6, as that's about\n            # the same as CPython2.7 and won't have any new insights.\n            if use_python not in (\"python2.6\", \"python2.7\") or not options.coverage:\n                if options.cpython32:\n                    if os.path.exists(\"./tests/CPython32/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"32tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython32/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.2 tests are not present, not run.\")\n\n            # Running the Python 3.4 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython34:\n                    if os.path.exists(\"./tests/CPython34/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"34tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython34/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.4 tests are not present, not run.\")\n\n            # Running the Python 3.5 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython35:\n                    if os.path.exists(\"./tests/CPython35/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"35tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython35/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.5 tests are not present, not run.\")\n\n            # Running the Python 3.6 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython36:\n                    if os.path.exists(\"./tests/CPython36/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"36tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython36/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.6 tests are not present, not run.\")\n\n            # Running the Python 3.7 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython37:\n                    if os.path.exists(\"./tests/CPython37/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"37tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython37/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.7 tests are not present, not run.\")\n\n            # Running the Python 3.8 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython38:\n                    if os.path.exists(\"./tests/CPython38/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"38tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython38/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.8 tests are not present, not run.\")\n\n            # Running the Python 3.9 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython39:\n                    if os.path.exists(\"./tests/CPython39/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"39tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython39/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.9 tests are not present, not run.\")\n\n            # Running the Python 3.10 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython310:\n                    if os.path.exists(\"./tests/CPython310/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"310tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython310/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.10 tests are not present, not run.\")\n\n            # Running the Python 3.11 test suite only with CPython3.x.\n            if not use_python.startswith(\"python2\"):\n                if options.cpython311:\n                    if os.path.exists(\"./tests/CPython311/run_all.py\"):\n                        with withExtendedExtraOptions(\n                            *getExtraFlags(where, \"311tests\", flags)\n                        ):\n                            executeSubTest(\"./tests/CPython311/run_all.py search\")\n                    else:\n                        my_print(\"The CPython3.11 tests are not present, not run.\")\n\n    if not any(\n        checkExecutableCommand(\"python%s\" % python_version)\n        for python_version in getTestExecutionPythonVersions()\n    ):\n        test_logger.sysexit(\"No Python usable for testing found installed\")\n\n    if options.debug:\n        if checkExecutableCommand(\"python2.6\"):\n            execute_tests(\"python2.6-debug\", \"python2.6\", \"--debug\")\n        else:\n            my_print(\"Cannot execute tests with Python 2.6, disabled or not installed.\")\n\n        if checkExecutableCommand(\"python2.7\"):\n            execute_tests(\"python2.7-debug\", \"python2.7\", \"--debug\")\n        else:\n            my_print(\"Cannot execute tests with Python 2.7, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python2.6\"):\n        execute_tests(\"python2.6-nodebug\", \"python2.6\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 2.6, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python2.7\"):\n        execute_tests(\"python2.7-nodebug\", \"python2.7\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 2.7, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.3\"):\n        execute_tests(\"python3.3-nodebug\", \"python3.3\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.3, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.4\"):\n        execute_tests(\"python3.4-nodebug\", \"python3.4\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.4, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.5\"):\n        execute_tests(\"python3.5-nodebug\", \"python3.5\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.5, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.6\"):\n        execute_tests(\"python3.6-nodebug\", \"python3.6\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.6, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.7\"):\n        execute_tests(\"python3.7-nodebug\", \"python3.7\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.7, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.8\"):\n        execute_tests(\"python3.8-nodebug\", \"python3.8\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.8, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.9\"):\n        execute_tests(\"python3.9-nodebug\", \"python3.9\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.9, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.10\"):\n        execute_tests(\"python3.10-nodebug\", \"python3.10\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.10, disabled or not installed.\")\n\n    if checkExecutableCommand(\"python3.11\"):\n        execute_tests(\"python3.11-nodebug\", \"python3.11\", \"\")\n    else:\n        my_print(\"Cannot execute tests with Python 3.11, disabled or not installed.\")\n\n    if options.coverage:\n        publishCoverageData()\n\n    my_print(\"OK.\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/watch/GitHub.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" GitHub interfacing for nuitka-watch. \"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.tools.quality.Git import (\n    getCurrentBranchName,\n    getModifiedPaths,\n    getRemoteURL,\n)\nfrom nuitka.Tracing import tools_logger\nfrom nuitka.utils.Execution import callProcess, check_call\n\n\ndef checkInNuitkaWatch():\n    remote_url = getRemoteURL(\"origin\")\n    assert remote_url in (\n        \"git@github.com:Nuitka/Nuitka-Watch.git\",\n        \"https://github.com/Nuitka/Nuitka-Watch\",\n    ), remote_url\n    branch_name = getCurrentBranchName()\n    assert branch_name == \"main\", branch_name\n    assert os.path.exists(\".git\")\n\n\ndef createNuitkaWatchPR(category, description):\n    checkInNuitkaWatch()\n\n    modified_files = list(getModifiedPaths())\n\n    if not modified_files:\n        tools_logger.sysexit(\"Nothing to do\", exit_code=0)\n\n    changed_flavors = set()\n\n    for modified_file in modified_files:\n        if os.path.basename(modified_file) == \"compilation-report.xml\":\n            flavor = os.path.basename(os.path.dirname(modified_file))\n            changed_flavors.add(flavor)\n\n    if not changed_flavors:\n        tools_logger.sysexit(\"No changes in compilation reports, only other things.\")\n\n    if len(changed_flavors) != 1:\n        tools_logger.sysexit(\"Only a single flavor is supported at a time currently.\")\n\n    (changed_flavor,) = changed_flavors\n\n    tools_logger.info(\n        \"Detected changes for %s in results of '%s'.\" % (description, changed_flavor)\n    )\n\n    commit_message = \"\"\"\nChanges for %s in results of '%s'\n\nThis change is automatically generated and the result of executing %s on\ncurrent Nuitka-Watch state.\n\"\"\" % (\n        description,\n        changed_flavor,\n        \" \".join(sys.argv),\n    )\n\n    branch_name = \"auto-%s-%s\" % (category, changed_flavor)\n\n    # May not exist of course.\n    callProcess([\"git\", \"branch\", \"-D\", branch_name])\n\n    check_call([\"git\", \"branch\", branch_name])\n\n    check_call([\"git\", \"checkout\", branch_name])\n\n    check_call([\"git\", \"add\", \".\"])\n\n    check_call([\"git\", \"commit\", \"-m\", commit_message])\n\n    check_call([\"git\", \"checkout\", \"main\"])\n\n    tools_logger.info(\"Change is now on branch '%s'.\" % branch_name)\n\n\nif __name__ == \"__main__\":\n    # TODO: This runner should be directly used from nuitka-watch binary,\n    # but for development purposes, we keep it separately accessible.\n\n    from optparse import OptionParser\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--desc\",\n        action=\"store\",\n        dest=\"desc\",\n        help=\"\"\"\\\nDescription of the change, e.g. \"Nuitka update 1.9.3\".\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n    assert not positional_args\n\n    createNuitkaWatchPR(category=\"hotfix\", description=options.desc)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/watch/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tools/watch/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nuitka watch main part.\n\nThis tool is used to monitor effect of PyPI changes on Nuitka and effect\nof Nuitka changes on PyPI packages.\n\"\"\"\n\nimport os\nimport sys\nfrom optparse import OptionParser\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.PythonFlavors import isAnacondaPython, isMSYS2MingwPython\nfrom nuitka.PythonVersions import getTestExecutionPythonVersions\nfrom nuitka.tools.testing.Common import extractNuitkaVersionFromFilePath\nfrom nuitka.Tracing import OurLogger\nfrom nuitka.TreeXML import fromFile\nfrom nuitka.utils.Execution import (\n    check_call,\n    executeProcess,\n    executeToolChecked,\n    withEnvironmentVarOverridden,\n)\nfrom nuitka.utils.FileOperations import (\n    changeTextFileContents,\n    getFileContents,\n    getFileList,\n    listDir,\n    makePath,\n    relpath,\n    withDirectoryChange,\n)\nfrom nuitka.utils.Hashing import getFileContentsHash\nfrom nuitka.utils.InstalledPythons import findPythons\nfrom nuitka.utils.Utils import isLinux, isMacOS, isWin32Windows\nfrom nuitka.utils.Yaml import parseYaml\nfrom nuitka.Version import parseNuitkaVersionToTuple\n\nfrom .GitHub import createNuitkaWatchPR\n\nwatch_logger = OurLogger(\"\", base_style=\"blue\")\n\n\ndef _compareNuitkaVersions(version_a, version_b, consider_rc):\n    if not consider_rc:\n        version_a = version_a.split(\"rc\")[0]\n        version_b = version_b.split(\"rc\")[0]\n\n    return parseNuitkaVersionToTuple(version_a) < parseNuitkaVersionToTuple(version_b)\n\n\ndef scanCases(path):\n    candidate = os.path.join(path, \"case.yml\")\n\n    if os.path.exists(candidate):\n        yield candidate\n\n    for case_dir_full, _case_name in listDir(path):\n        if os.path.isdir(case_dir_full):\n            for case in scanCases(case_dir_full):\n                yield case\n\n\ndef selectPythons(python_version_req, anaconda, msys2_mingw64):\n    for _python_version_str, installed_python_for_version in installed_pythons.items():\n        for installed_python in installed_python_for_version:\n            if anaconda and not installed_python.isAnacondaPython():\n                continue\n\n            if msys2_mingw64 and not installed_python.isMSYS2MingwPython():\n                continue\n\n            if python_version_req is not None:\n                # We trust the case yaml files, pylint: disable=eval-used\n                if not eval(\n                    python_version_req,\n                    None,\n                    {\"python_version\": installed_python.getHexVersion()},\n                ):\n                    continue\n\n            yield installed_python\n            break\n\n\ndef selectOS(os_values):\n    # return driven, pylint: disable=too-many-return-statements\n\n    for value in os_values:\n        if value not in (\"Linux\", \"Win32\", \"macOS\", \"Win32-MSYS2\", \"Win32-Anaconda\"):\n            watch_logger.sysexit(\"Illegal value for OS: %s\" % value)\n\n    if isLinux() and \"Linux\" in os_values:\n        return \"Linux\"\n    if isWin32Windows():\n        if isMSYS2MingwPython():\n            if \"Win32-MSYS2\" in os_values:\n                return \"Win32-MSYS2\"\n\n            return None\n        if isAnacondaPython():\n            if \"Win32-Anaconda\" in os_values:\n                return \"Win32-Anaconda\"\n\n            return None\n        if \"Win32\" in os_values:\n            return \"Win32\"\n    if isMacOS() and \"macOS\" in os_values:\n        return \"macOS\"\n\n    return None\n\n\ndef getPlatformRequirements(installed_python, case_data):\n    requirements = list(case_data[\"requirements\"])\n\n    # Nuitka house keeping, these are from setup.py but we ignore onefile needs\n    # as that is not currently covered in watches.\n    # spell-checker: ignore orderedset,imageio\n    needs_onefile = False\n\n    if installed_python.getHexVersion() >= 0x370:\n        requirements.append(\"ordered-set >= 4.1.0\")\n    if installed_python.getHexVersion() < 0x300:\n        requirements.append(\"subprocess32\")\n    if needs_onefile and installed_python.getHexVersion() >= 0x370:\n        requirements.append(\"zstandard >= 0.15\")\n    if (\n        os.name != \"nt\"\n        and sys.platform != \"darwin\"\n        and installed_python.getHexVersion() < 0x370\n    ):\n        requirements.append(\"orderedset >= 2.0.3\")\n    if sys.platform == \"darwin\" and installed_python.getHexVersion() < 0x370:\n        requirements.append(\"orderedset >= 2.0.3\")\n\n    # For icon conversion.\n    if case_data.get(\"icons\", \"no\") == \"yes\":\n        requirements.append(\"imageio\")\n\n    return requirements\n\n\ndef _updatePipenvFile(installed_python, case_data, dry_run, result_path):\n    pipenv_filename = os.path.join(result_path, \"Pipfile\")\n    pipenv_package_requirements = []\n\n    for requirement in getPlatformRequirements(\n        installed_python=installed_python, case_data=case_data\n    ):\n        # Ignore spaces in requirements.\n        requirement = requirement.replace(\" \", \"\")\n\n        if all(char not in requirement for char in \"=><\"):\n            pipenv_package_requirements.append('\"%s\" = \"*\"' % requirement)\n        else:\n            operator_index = min(\n                requirement.find(char) for char in \"=><\" if char in requirement\n            )\n\n            pipenv_package_requirements.append(\n                '\"%s\" = \"%s\"'\n                % (requirement[:operator_index], requirement[operator_index:])\n            )\n\n    # TODO: Other indexes, e.g. nvidia might be needed too\n    changed_pipenv_file = changeTextFileContents(\n        pipenv_filename,\n        \"\"\"\\\n[[source]]\nname = \"pypi\"\nurl = \"https://pypi.org/simple\"\nverify_ssl = true\n\n[requires]\npython_version = \"%(python_version)s\"\n\n[packages]\n%(pipenv_package_requirements)s\n\"\"\"\n        % {\n            \"pipenv_package_requirements\": \"\\n\".join(pipenv_package_requirements),\n            \"python_version\": installed_python.getPythonVersion(),\n        },\n        compare_only=dry_run,\n    )\n\n    return changed_pipenv_file, pipenv_filename\n\n\ndef _updatePacmanFile(installed_python, case_data, dry_run, result_path):\n    pipenv_filename = os.path.join(result_path, \"Pacman.txt\")\n    pipenv_package_requirements = []\n\n    for requirement in getPlatformRequirements(\n        installed_python=installed_python, case_data=case_data\n    ):\n        # Ignore spaces in requirements.\n        requirement = requirement.replace(\" \", \"\")\n\n    # TODO: Other indexes, e.g. nvidia might be needed too\n    changed_pipenv_file = changeTextFileContents(\n        pipenv_filename,\n        \"\"\"\\\n[python]\n%(python_version)s\n[packages]\n%(pipenv_package_requirements)s\n\"\"\"\n        % {\n            \"pipenv_package_requirements\": \"\\n\".join(pipenv_package_requirements),\n            \"python_version\": installed_python.getPythonVersion(),\n        },\n        compare_only=dry_run,\n    )\n\n    return changed_pipenv_file, pipenv_filename\n\n\ndef _updatePipenvLockFile(\n    installed_python, dry_run, pipenv_filename_full, no_pipenv_update\n):\n    if os.path.exists(\"Pipfile.lock\"):\n        if no_pipenv_update:\n            watch_logger.info(\n                \"Keeping existing lock file with pipenv file '%s'.\"\n                % pipenv_filename_full\n            )\n\n            check_call(\n                [\n                    installed_python.getPythonExe(),\n                    \"-m\",\n                    \"pipenv\",\n                    \"install\",\n                    \"--python\",\n                    installed_python.getPythonExe(),\n                ]\n            )\n\n        elif not dry_run:\n            watch_logger.info(\n                \"Working with pipenv file '%s' to update virtualenv, may take a while.\"\n                % pipenv_filename_full\n            )\n\n            check_call(\n                [\n                    installed_python.getPythonExe(),\n                    \"-m\",\n                    \"pipenv\",\n                    \"update\",\n                    \"--python\",\n                    installed_python.getPythonExe(),\n                ]\n            )\n    else:\n        watch_logger.info(\n            \"Working with pipenv file '%s' to install virtualenv, may take a while.\"\n            % pipenv_filename_full\n        )\n\n        check_call(\n            [\n                installed_python.getPythonExe(),\n                \"-m\",\n                \"pipenv\",\n                \"install\",\n                \"--python\",\n                installed_python.getPythonExe(),\n            ]\n        )\n\n    return \"Pipfile.lock\"\n\n\ndef _updatePacmanLockFile():\n    pacman_lock_filename = \"Pacman.lock\"\n\n    pacman_output = executeToolChecked(\n        logger=watch_logger,\n        command=[\"pacman\", \"-Q\"],\n        absence_message=\"needs pacman to query package status on MSYS2\",\n    )\n\n    if str is not bytes:\n        pacman_output = pacman_output.decode(\"utf8\")\n\n    changeTextFileContents(filename=pacman_lock_filename, contents=pacman_output)\n\n    return pacman_lock_filename\n\n\ndef _compileCase(case_data, case_dir, installed_python, lock_filename):\n    preferred_package_type = installed_python.getPreferredPackageType()\n\n    if preferred_package_type == \"pip\":\n        run_command = [\n            installed_python.getPythonExe(),\n            \"-m\",\n            \"pipenv\",\n            \"run\",\n            \"--python\",\n            installed_python.getPythonExe(),\n            \"python\",\n        ]\n        extra_options = []\n    elif preferred_package_type == \"pacman\":\n        run_command = [\"python\"]\n\n        # TODO: Bug in MSYS2 ccache, avoid using that.\n        extra_options = [\"--disable-ccache\"]\n    else:\n        assert False\n\n    check_call(\n        run_command\n        + [\n            nuitka_binary,\n            os.path.join(case_dir, case_data[\"filename\"]),\n            \"--assume-yes-for-downloads\",\n            \"--report=compilation-report.xml\",\n            \"--report-diffable\",\n            \"--report-user-provided=pipenv_hash=%s\"\n            % getFileContentsHash(lock_filename),\n        ]\n        + extra_options\n    )\n\n    if case_data[\"interactive\"] == \"no\":\n        binaries = getFileList(\n            \".\",\n            ignore_filenames=(\"__constants.bin\",),\n            only_suffixes=(\".exe\" if os.name == \"nt\" else \".bin\"),\n        )\n\n        if len(binaries) != 1:\n            sys.exit(\"Error, failed to identify created binary.\")\n\n        with withEnvironmentVarOverridden(\"NUITKA_LAUNCH_TOKEN\", \"1\"):\n            stdout, stderr, exit_nuitka = executeProcess([binaries[0]], timeout=5 * 60)\n\n        with open(\"compiled-stdout.txt\", \"wb\") as output:\n            output.write(stdout)\n        with open(\"compiled-stderr.txt\", \"wb\") as output:\n            output.write(stderr)\n\n        if exit_nuitka != 0:\n            sys.exit(\n                \"Error, failed to execute %s with code %d.\" % (binaries[0], exit_nuitka)\n            )\n\n\ndef _updateCase(\n    case_dir,\n    case_data,\n    dry_run,\n    no_pipenv_update,\n    nuitka_update_mode,\n    installed_python,\n    result_path,\n):\n    # Many details and cases due to package method being handled here.\n    # pylint: disable=too-many-branches,too-many-locals\n\n    # Not good for dry run, but tough life.\n    makePath(result_path)\n\n    # Update the pipenv file in any case, ought to be stable but we follow\n    # global changes this way.\n    preferred_package_type = installed_python.getPreferredPackageType()\n    if preferred_package_type == \"pip\":\n        changed_pipenv_file, pipenv_filename = _updatePipenvFile(\n            installed_python=installed_python,\n            case_data=case_data,\n            dry_run=dry_run,\n            result_path=result_path,\n        )\n\n        pipenv_filename_full = os.path.join(case_dir, pipenv_filename)\n\n        if dry_run and changed_pipenv_file:\n            watch_logger.info(\"Would create pipenv file '%s'.\" % pipenv_filename_full)\n            return\n\n        with withDirectoryChange(result_path):\n            # Update or create lockfile of pipenv.\n            lock_filename = _updatePipenvLockFile(\n                installed_python=installed_python,\n                dry_run=dry_run,\n                pipenv_filename_full=pipenv_filename_full,\n                no_pipenv_update=no_pipenv_update,\n            )\n    elif preferred_package_type == \"pacman\":\n        changed_pipenv_file, pipenv_filename = _updatePacmanFile(\n            installed_python=installed_python,\n            case_data=case_data,\n            dry_run=dry_run,\n            result_path=result_path,\n        )\n\n        with withDirectoryChange(result_path):\n            # Update or create lockfile of pipenv.\n            lock_filename = _updatePacmanLockFile()\n\n    # Check if compilation is required.\n    with withDirectoryChange(result_path):\n        if os.path.exists(\"compilation-report.xml\"):\n            old_report_root = fromFile(\"compilation-report.xml\")\n\n            existing_hash = getFileContentsHash(lock_filename)\n            old_report_root_hash = (\n                old_report_root.find(\"user-data\").find(\"pipenv_hash\").text\n            )\n\n            old_nuitka_version = old_report_root.attrib[\"nuitka_version\"]\n\n            if nuitka_update_mode == \"force\":\n                need_compile = True\n            elif nuitka_update_mode == \"newer\":\n                if _compareNuitkaVersions(\n                    old_nuitka_version, nuitka_version, consider_rc=True\n                ):\n                    need_compile = True\n                else:\n                    if existing_hash != old_report_root_hash:\n                        watch_logger.info(\n                            \"Recompilation with identical Nuitka for '%s' due to changed pipfile.\"\n                            % pipenv_filename_full\n                        )\n\n                        need_compile = True\n                    elif old_nuitka_version == nuitka_version:\n                        watch_logger.info(\n                            \"Skipping compilation with identical Nuitka for '%s'.\"\n                            % pipenv_filename_full\n                        )\n\n                        need_compile = False\n                    else:\n                        watch_logger.info(\n                            \"Skipping compilation of old Nuitka %s result with Nuitka %s for '%s'.\"\n                            % (\n                                old_nuitka_version,\n                                nuitka_version,\n                                pipenv_filename_full,\n                            )\n                        )\n\n                        need_compile = False\n            else:\n                need_compile = False\n        else:\n            need_compile = True\n\n        if need_compile:\n            _compileCase(\n                case_data=case_data,\n                case_dir=case_dir,\n                installed_python=installed_python,\n                lock_filename=lock_filename,\n            )\n\n\ndef updateCase(case_dir, case_data, dry_run, no_pipenv_update, nuitka_update_mode):\n    case_name = case_data[\"case\"]\n\n    # Wrong OS maybe.\n    os_name = selectOS(case_data[\"os\"])\n    if os_name is None:\n        return\n\n    nuitka_min_version = case_data.get(\"nuitka\")\n\n    # Too old Nuitka version maybe.\n    if nuitka_min_version is not None and _compareNuitkaVersions(\n        nuitka_version, nuitka_min_version, consider_rc=False\n    ):\n        return\n\n    # For all relevant Pythons applicable to this case.\n    for installed_python in selectPythons(\n        # TODO: Enable Anaconda support through options/detection.\n        anaconda=\"Anaconda\" in os_name,\n        msys2_mingw64=\"MSYS2\" in os_name,\n        python_version_req=case_data.get(\"python_version_req\"),\n    ):\n        watch_logger.info(\"Consider with Python %s.\" % installed_python)\n\n        result_path = \"result/%(case_name)s/%(python_version)s-%(os_name)s\" % {\n            \"case_name\": case_name,\n            \"os_name\": os_name,\n            \"python_version\": installed_python.getPythonVersion(),\n        }\n\n        _updateCase(\n            case_dir=case_dir,\n            case_data=case_data,\n            dry_run=dry_run,\n            no_pipenv_update=no_pipenv_update,\n            nuitka_update_mode=nuitka_update_mode,\n            installed_python=installed_python,\n            result_path=result_path,\n        )\n\n\ndef updateCases(case_dir, dry_run, no_pipenv_update, nuitka_update_mode):\n    for case_data in parseYaml(getFileContents(\"case.yml\", mode=\"rb\")):\n        updateCase(\n            case_dir=case_dir,\n            case_data=case_data,\n            dry_run=dry_run,\n            no_pipenv_update=no_pipenv_update,\n            nuitka_update_mode=nuitka_update_mode,\n        )\n\n\ninstalled_pythons = OrderedDict()\n\nnuitka_binary = None\nnuitka_version = None\n\n\ndef main():\n    global nuitka_binary  # shared for all run, pylint: disable=global-statement\n    nuitka_binary = os.path.normpath(\n        os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\", \"bin\", \"nuitka\")\n    )\n\n    parser = OptionParser()\n\n    parser.add_option(\n        \"--python-version\",\n        action=\"append\",\n        dest=\"python_versions\",\n        default=[],\n        help=\"\"\"\\\nPython versions to consider, by default all supported versions in descending order or in given order.\"\"\",\n    )\n\n    parser.add_option(\n        \"--nuitka-binary\",\n        action=\"store\",\n        dest=\"nuitka_binary\",\n        default=nuitka_binary,\n        help=\"\"\"\\\nNuitka binary to compile with. Defaults to one near the nuitka-watch usage.\"\"\",\n    )\n\n    parser.add_option(\n        \"--no-pipenv-update\",\n        action=\"store_true\",\n        dest=\"no_pipenv_update\",\n        default=False,\n        help=\"\"\"\\\nDo not update the pipenv environment. Best to see only effect of Nuitka update. Default %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--dry-run\",\n        action=\"store_false\",\n        dest=\"dry_run\",\n        default=False,\n        help=\"\"\"\\\nDo not change anything, just report what would be done. Not yet perfectly true. Default %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--nuitka-update-mode\",\n        action=\"store\",\n        choices=(\"newer\", \"force\", \"never\"),\n        dest=\"nuitka_update_mode\",\n        default=\"newer\",\n        help=\"\"\"\\\nRecompile even if the versions seems not changed. Default %default.\"\"\",\n    )\n\n    parser.add_option(\n        \"--pr\",\n        action=\"store\",\n        dest=\"nuitka_pr_mode\",\n        default=None,\n        help=\"\"\"\\\nPR to create. Default not making a PR.\"\"\",\n    )\n\n    options, positional_args = parser.parse_args()\n\n    assert len(positional_args) <= 1, positional_args\n\n    if positional_args:\n        base_dir = positional_args[0]\n\n        if not os.path.isdir(base_dir):\n            watch_logger.sysexit(\"Error, '%s' is not a directory\" % base_dir)\n\n    else:\n        base_dir = os.getcwd()\n\n    for python_version in options.python_versions or reversed(\n        getTestExecutionPythonVersions()\n    ):\n        installed_pythons[python_version] = findPythons(\n            python_version, module_name=\"pipenv\"\n        )\n\n    nuitka_binary = os.path.abspath(os.path.expanduser(options.nuitka_binary))\n    assert os.path.exists(nuitka_binary)\n\n    global nuitka_version  # singleton, pylint: disable=global-statement\n    nuitka_version = extractNuitkaVersionFromFilePath(\n        os.path.join(os.path.dirname(nuitka_binary), \"..\", \"nuitka\", \"Version.py\")\n    )\n\n    watch_logger.info(\"Working with Nuitka %s.\" % nuitka_version)\n\n    base_dir = os.path.abspath(base_dir)\n\n    if options.nuitka_pr_mode is not None:\n        pr_category, pr_description = options.nuitka_pr_mode.split(\",\")\n    else:\n        pr_category = pr_description = None\n\n    with withDirectoryChange(base_dir):\n        for case_filename in scanCases(base_dir):\n            case_relpath = relpath(case_filename, start=base_dir)\n\n            watch_logger.info(\n                \"Consider watch cases from Yaml file '%s'.\" % case_relpath\n            )\n\n            with withDirectoryChange(os.path.dirname(case_filename)):\n                updateCases(\n                    os.path.dirname(case_filename),\n                    dry_run=options.dry_run,\n                    no_pipenv_update=options.no_pipenv_update,\n                    nuitka_update_mode=options.nuitka_update_mode,\n                )\n\n        if pr_category is not None:\n            createNuitkaWatchPR(category=pr_category, description=pr_description)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/Building.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Build the internal node tree from source code.\n\nDoes all the Python parsing and puts it into a tree structure for use in later\nstages of the compilation process.\n\nIn the \"nuitka.tree.TreeHelpers\" module, the dispatching is happening. One function\ndeals with every node kind as found in the AST. The parsing is centered around\nthe module \"ast\" output.\n\nMany higher level language features and translated into lower level ones.\n\nIn-place assignments, for loops, while loops, classes, complex calls, with\nstatements, and even or/and etc. are all translated to simpler constructs.\n\nThe output of this module is a node tree, which contains only relatively low\nlevel operations. A property of the output is also an overlaid tree of provider\nstructure that indicates variable provision.\n\nClasses are handled in a separate module. They are re-formulated into functions\nproducing dictionaries used to call the metaclass with.\n\nTry/except/else statements are handled in a separate module. They are\nre-formulated into using a temporary variable to track if the else branch\nshould execute.\n\nTry/finally statements are handled in a separate module. They are re-formulated\nto use a nested try/finally for (un)publishing the exception for Python3.\n\nWith statements are handled in a separate module. They are re-formulated into\nspecial attribute lookups for \"__enter__\" and \"__exit__\", calls of them,\ncatching and passing in exceptions raised.\n\n\"\"\"\n\nimport marshal\nimport os\n\nfrom nuitka import (\n    ModuleRegistry,\n    Options,\n    OutputDirectories,\n    SourceCodeReferences,\n)\nfrom nuitka.__past__ import long, unicode\nfrom nuitka.BytecodeCaching import (\n    getCachedImportedModuleUsageAttempts,\n    hasCachedImportedModuleUsageAttempts,\n)\nfrom nuitka.Bytecodes import loadCodeObjectData\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Errors import CodeTooComplexCode\nfrom nuitka.freezer.ImportDetection import (\n    detectEarlyImports,\n    detectStdlibAutoInclusionModules,\n)\nfrom nuitka.importing import Importing\nfrom nuitka.importing.ImportCache import addImportedModule\nfrom nuitka.importing.PreloadedPackages import getPthImportedPackages\nfrom nuitka.importing.StandardLibrary import isStandardLibraryPath\nfrom nuitka.nodes.AttributeNodes import (\n    StatementAssignmentAttribute,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinFormatNodes import (\n    ExpressionBuiltinAscii,\n    ExpressionBuiltinFormat,\n)\nfrom nuitka.nodes.BuiltinRefNodes import quick_names\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinStrP3\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditional,\n    makeStatementConditional,\n)\nfrom nuitka.nodes.ConstantRefNodes import (\n    ExpressionConstantEllipsisRef,\n    ExpressionConstantNoneRef,\n    makeConstantRefNode,\n)\nfrom nuitka.nodes.ExceptionNodes import (\n    StatementRaiseException,\n    StatementReraiseException,\n)\nfrom nuitka.nodes.FutureSpecs import FutureSpec\nfrom nuitka.nodes.GeneratorNodes import (\n    StatementGeneratorReturn,\n    StatementGeneratorReturnNone,\n)\nfrom nuitka.nodes.ImportNodes import (\n    isHardModuleWithoutSideEffect,\n    makeExpressionImportModuleFixed,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoopBreak, StatementLoopContinue\nfrom nuitka.nodes.ModuleAttributeNodes import (\n    ExpressionModuleAttributeFileRef,\n    ExpressionModuleAttributeSpecRef,\n)\nfrom nuitka.nodes.ModuleNodes import (\n    CompiledPythonModule,\n    CompiledPythonPackage,\n    PythonExtensionModule,\n    PythonMainModule,\n    makeUncompiledPythonModule,\n)\nfrom nuitka.nodes.NodeMakingHelpers import (\n    makeRaiseExceptionStatementFromInstance,\n)\nfrom nuitka.nodes.OperatorNodes import makeBinaryOperationNode\nfrom nuitka.nodes.OperatorNodesUnary import makeExpressionOperationUnary\nfrom nuitka.nodes.ReturnNodes import makeStatementReturn\nfrom nuitka.nodes.SliceNodes import makeExpressionBuiltinSlice\nfrom nuitka.nodes.StatementNodes import StatementExpressionOnly\nfrom nuitka.nodes.StringConcatenationNodes import ExpressionStringConcatenation\nfrom nuitka.nodes.VariableNameNodes import (\n    ExpressionVariableNameRef,\n    StatementAssignmentVariableName,\n)\nfrom nuitka.optimizations.BytecodeDemotion import demoteSourceCodeToBytecode\nfrom nuitka.Options import shallWarnUnusualCode\nfrom nuitka.pgo.PGO import decideCompilationFromPGO\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import (\n    general,\n    optimization_logger,\n    plugins_logger,\n    recursion_logger,\n    unusual_logger,\n)\nfrom nuitka.utils import MemoryUsage\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom . import SyntaxErrors\nfrom .ReformulationAssertStatements import buildAssertNode\nfrom .ReformulationAssignmentStatements import (\n    buildAnnAssignNode,\n    buildAssignNode,\n    buildDeleteNode,\n    buildInplaceAssignNode,\n    buildNamedExprNode,\n)\nfrom .ReformulationBooleanExpressions import buildBoolOpNode\nfrom .ReformulationCallExpressions import buildCallNode\nfrom .ReformulationClasses import buildClassNode\nfrom .ReformulationComparisonExpressions import buildComparisonNode\nfrom .ReformulationContractionExpressions import (\n    buildDictContractionNode,\n    buildGeneratorExpressionNode,\n    buildListContractionNode,\n    buildSetContractionNode,\n)\nfrom .ReformulationDictionaryCreation import buildDictionaryNode\nfrom .ReformulationExecStatements import buildExecNode\nfrom .ReformulationForLoopStatements import (\n    buildAsyncForLoopNode,\n    buildForLoopNode,\n)\nfrom .ReformulationFunctionStatements import (\n    buildAsyncFunctionNode,\n    buildFunctionNode,\n)\nfrom .ReformulationImportStatements import (\n    buildImportFromNode,\n    buildImportModulesNode,\n    checkFutureImportsOnlyAtStart,\n    getFutureSpec,\n    popFutureSpec,\n    pushFutureSpec,\n)\nfrom .ReformulationLambdaExpressions import buildLambdaNode\nfrom .ReformulationMatchStatements import buildMatchNode\nfrom .ReformulationNamespacePackages import (\n    createNamespacePackage,\n    createPathAssignment,\n)\nfrom .ReformulationPrintStatements import buildPrintNode\nfrom .ReformulationSequenceCreation import (\n    buildListCreationNode,\n    buildSetCreationNode,\n    buildTupleCreationNode,\n)\nfrom .ReformulationSubscriptExpressions import buildSubscriptNode\nfrom .ReformulationTryExceptStatements import (\n    buildTryExceptionNode,\n    buildTryStarExceptionNode,\n)\nfrom .ReformulationTryFinallyStatements import buildTryFinallyNode\nfrom .ReformulationWhileLoopStatements import buildWhileLoopNode\nfrom .ReformulationWithStatements import buildAsyncWithNode, buildWithNode\nfrom .ReformulationYieldExpressions import (\n    buildAwaitNode,\n    buildYieldFromNode,\n    buildYieldNode,\n)\nfrom .SourceHandling import (\n    checkPythonVersionFromCode,\n    getSourceCodeDiff,\n    readSourceCodeFromFilenameWithInformation,\n)\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    buildStatementsNode,\n    extractDocFromBody,\n    getBuildContext,\n    getKind,\n    makeModuleFrame,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    mangleName,\n    mergeStatements,\n    parseSourceCodeToAst,\n    setBuildingDispatchers,\n)\nfrom .VariableClosure import completeVariableClosures\n\nif str is not bytes:\n\n    def buildVariableReferenceNode(provider, node, source_ref):\n        # Shortcut for Python3, which gives syntax errors for assigning these.\n        if node.id in quick_names:\n            return makeConstantRefNode(\n                constant=quick_names[node.id], source_ref=source_ref\n            )\n\n        return ExpressionVariableNameRef(\n            provider=provider,\n            variable_name=mangleName(node.id, provider),\n            source_ref=source_ref,\n        )\n\nelse:\n\n    def buildVariableReferenceNode(provider, node, source_ref):\n        return ExpressionVariableNameRef(\n            provider=provider,\n            variable_name=mangleName(node.id, provider),\n            source_ref=source_ref,\n        )\n\n\n# Python3.4 or higher, True and False, are not given as variables anymore.\n# Python3.8, all kinds of constants are like this.\ndef buildNamedConstantNode(node, source_ref):\n    return makeConstantRefNode(\n        constant=node.value, source_ref=source_ref, user_provided=True\n    )\n\n\ndef buildConditionNode(provider, node, source_ref):\n    # Conditional statements may have one or two branches. We will never see an\n    # \"elif\", because that's already dealt with by module \"ast\", which turns it\n    # into nested conditional statements. spell-checker: ignore orelse\n\n    return makeStatementConditional(\n        condition=buildNode(provider, node.test, source_ref),\n        yes_branch=buildStatementsNode(\n            provider=provider, nodes=node.body, source_ref=source_ref\n        ),\n        no_branch=buildStatementsNode(\n            provider=provider,\n            nodes=node.orelse if node.orelse else None,\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef buildTryFinallyNode2(provider, node, source_ref):\n    # Try/finally node statements of old style.\n\n    return buildTryFinallyNode(\n        provider=provider,\n        build_tried=lambda: buildStatementsNode(\n            provider=provider, nodes=node.body, source_ref=source_ref\n        ),\n        node=node,\n        source_ref=source_ref,\n    )\n\n\ndef buildTryNode(provider, node, source_ref):\n    # Note: This variant is used for Python3.3 or higher only, older stuff uses\n    # the above ones, this one merges try/except with try/finally in the\n    # \"ast\". We split it up again, as it's logically separated of course.\n\n    # Shortcut missing try/finally.\n    if not node.handlers:\n        return buildTryFinallyNode2(provider, node, source_ref)\n\n    if not node.finalbody:  # spell-checker: ignore finalbody\n        return buildTryExceptionNode(\n            provider=provider, node=node, source_ref=source_ref\n        )\n\n    return buildTryFinallyNode(\n        provider=provider,\n        build_tried=lambda: makeStatementsSequence(\n            statements=mergeStatements(\n                (\n                    buildTryExceptionNode(\n                        provider=provider, node=node, source_ref=source_ref\n                    ),\n                ),\n                allow_none=True,\n            ),\n            allow_none=True,\n            source_ref=source_ref,\n        ),\n        node=node,\n        source_ref=source_ref,\n    )\n\n\ndef buildTryStarNode(provider, node, source_ref):\n    # Note: This variant is used for Python3.11 or higher only, where an exception\n    # group is caught. Mixing groups and non-group catches is not allowed.\n\n    # Without handlers, this would not be used, but instead \"Try\" would be used,\n    # but assert against it.\n    assert node.handlers\n\n    if not node.finalbody:  # spell-checker: ignore finalbody\n        return buildTryStarExceptionNode(\n            provider=provider, node=node, source_ref=source_ref\n        )\n\n    return buildTryFinallyNode(\n        provider=provider,\n        build_tried=lambda: makeStatementsSequence(\n            statements=mergeStatements(\n                (\n                    buildTryStarExceptionNode(\n                        provider=provider, node=node, source_ref=source_ref\n                    ),\n                ),\n                allow_none=True,\n            ),\n            allow_none=True,\n            source_ref=source_ref,\n        ),\n        node=node,\n        source_ref=source_ref,\n    )\n\n\ndef buildRaiseNode(provider, node, source_ref):\n    # Raise statements. Under Python2 they may have type, value and traceback\n    # attached, for Python3, you can only give type (actually value) and cause.\n    # spell-checker: ignore tback\n    if python_version < 0x300:\n        exception_type = buildNode(provider, node.type, source_ref, allow_none=True)\n        exception_value = buildNode(provider, node.inst, source_ref, allow_none=True)\n        exception_trace = buildNode(provider, node.tback, source_ref, allow_none=True)\n        exception_cause = None\n    else:\n        exception_type = buildNode(provider, node.exc, source_ref, allow_none=True)\n        exception_value = None\n        exception_trace = None\n        exception_cause = buildNode(provider, node.cause, source_ref, allow_none=True)\n\n    if exception_type is None:\n        assert exception_value is None\n        assert exception_trace is None\n        assert exception_cause is None\n\n        result = StatementReraiseException(source_ref=source_ref)\n    else:\n        result = StatementRaiseException(\n            exception_type=exception_type,\n            exception_value=exception_value,\n            exception_trace=exception_trace,\n            exception_cause=exception_cause,\n            source_ref=source_ref,\n        )\n\n        if exception_cause is not None:\n            result.setCompatibleSourceReference(\n                source_ref=exception_cause.getCompatibleSourceReference()\n            )\n        elif exception_trace is not None:\n            result.setCompatibleSourceReference(\n                source_ref=exception_trace.getCompatibleSourceReference()\n            )\n        elif exception_value is not None:\n            result.setCompatibleSourceReference(\n                source_ref=exception_value.getCompatibleSourceReference()\n            )\n        elif exception_type is not None:\n            result.setCompatibleSourceReference(\n                source_ref=exception_type.getCompatibleSourceReference()\n            )\n\n    return result\n\n\ndef handleGlobalDeclarationNode(provider, node, source_ref):\n    # On the module level, there is nothing to do.\n    if provider.isCompiledPythonModule():\n        if shallWarnUnusualCode():\n            unusual_logger.warning(\n                \"%s: Using 'global' statement on module level has no effect.\"\n                % source_ref.getAsString(),\n            )\n\n        return None\n\n    # Need to catch the error of declaring a parameter variable as global\n    # ourselves here. The AST parsing doesn't catch it, so we check here.\n    if provider.isExpressionFunctionBody():\n        parameters = provider.getParameters()\n\n        for variable_name in node.names:\n            if variable_name in parameters.getParameterNames():\n                SyntaxErrors.raiseSyntaxError(\n                    \"name '%s' is %s and global\"\n                    % (\n                        variable_name,\n                        \"local\" if python_version < 0x300 else \"parameter\",\n                    ),\n                    source_ref.atColumnNumber(node.col_offset),\n                )\n\n    # The module the \"global\" statement refers to.\n    module = provider.getParentModule()\n\n    # Can give multiple names.\n    for variable_name in node.names:\n        closure_variable = None\n\n        # Reuse already taken global variables, in order to avoid creating yet\n        # another instance, esp. as the indications could then potentially not\n        # be shared.\n        if provider.hasTakenVariable(variable_name):\n            closure_variable = provider.getTakenVariable(variable_name)\n\n            # Only global variables count. Could have a closure reference to\n            # a location of a parent function here.\n            if not closure_variable.isModuleVariable():\n                closure_variable = None\n\n        if closure_variable is None:\n            module_variable = module.getVariableForAssignment(\n                variable_name=variable_name\n            )\n\n            closure_variable = provider.addClosureVariable(variable=module_variable)\n\n        assert closure_variable.isModuleVariable()\n\n        # Special case, since Python 3.5 it is allowed to use global on the \"__class__\"\n        # variable as well, but it's not changing visibility of implicit \"__class__\" of\n        # functions, and as such it will just not be registered.\n        if (\n            provider.isExpressionClassBodyBase()\n            and closure_variable.getName() == \"__class__\"\n        ):\n            if python_version < 0x340:\n                SyntaxErrors.raiseSyntaxError(\n                    \"cannot make __class__ global\", source_ref\n                )\n        else:\n            provider.getLocalsScope().registerClosureVariable(\n                variable=closure_variable,\n            )\n\n    # Drop this, not really part of our tree.\n    return None\n\n\ndef handleNonlocalDeclarationNode(provider, node, source_ref):\n    # Need to catch the error of declaring a parameter variable as global\n    # ourselves here. The AST parsing doesn't catch it, but we can do it here.\n    parameter_provider = provider\n\n    while (\n        parameter_provider.isExpressionGeneratorObjectBody()\n        or parameter_provider.isExpressionCoroutineObjectBody()\n        or parameter_provider.isExpressionAsyncgenObjectBody()\n    ):\n        parameter_provider = parameter_provider.getParentVariableProvider()\n\n    if parameter_provider.isExpressionClassBodyBase():\n        parameter_names = ()\n    else:\n        parameter_names = parameter_provider.getParameters().getParameterNames()\n\n    for variable_name in node.names:\n        if variable_name in parameter_names:\n            SyntaxErrors.raiseSyntaxError(\n                \"name '%s' is parameter and nonlocal\" % (variable_name),\n                source_ref.atColumnNumber(node.col_offset),\n            )\n\n    provider.addNonlocalsDeclaration(\n        names=tuple(node.names),\n        user_provided=True,\n        source_ref=source_ref.atColumnNumber(node.col_offset),\n    )\n\n    # Drop this, not really part of our tree.\n    return None\n\n\ndef buildStringNode(node, source_ref):\n    assert type(node.s) in (str, unicode)\n\n    return makeConstantRefNode(\n        constant=node.s, source_ref=source_ref, user_provided=True\n    )\n\n\ndef buildNumberNode(node, source_ref):\n    assert type(node.n) in (int, long, float, complex), type(node.n)\n\n    return makeConstantRefNode(\n        constant=node.n, source_ref=source_ref, user_provided=True\n    )\n\n\ndef buildBytesNode(node, source_ref):\n    return makeConstantRefNode(\n        constant=node.s, source_ref=source_ref, user_provided=True\n    )\n\n\ndef buildEllipsisNode(source_ref):\n    return ExpressionConstantEllipsisRef(source_ref=source_ref)\n\n\ndef buildStatementLoopContinue(node, source_ref):\n    source_ref = source_ref.atColumnNumber(node.col_offset)\n\n    # Python forbids this, although technically it's probably not much of\n    # an issue.\n    if getBuildContext() == \"finally\" and python_version < 0x380:\n        SyntaxErrors.raiseSyntaxError(\n            \"'continue' not supported inside 'finally' clause\", source_ref\n        )\n\n    return StatementLoopContinue(source_ref=source_ref)\n\n\ndef buildStatementLoopBreak(provider, node, source_ref):\n    # A bit unusual, we need the provider, but not the node,\n    # pylint: disable=unused-argument\n\n    return StatementLoopBreak(source_ref=source_ref.atColumnNumber(node.col_offset))\n\n\ndef buildAttributeNode(provider, node, source_ref):\n    return makeExpressionAttributeLookup(\n        expression=buildNode(provider, node.value, source_ref),\n        attribute_name=mangleName(node.attr, provider),\n        source_ref=source_ref,\n    )\n\n\ndef buildReturnNode(provider, node, source_ref):\n    if provider.isExpressionClassBodyBase() or provider.isCompiledPythonModule():\n        SyntaxErrors.raiseSyntaxError(\n            \"'return' outside function\", source_ref.atColumnNumber(node.col_offset)\n        )\n\n    expression = buildNode(provider, node.value, source_ref, allow_none=True)\n\n    if provider.isExpressionGeneratorObjectBody():\n        if expression is not None and python_version < 0x300:\n            SyntaxErrors.raiseSyntaxError(\n                \"'return' with argument inside generator\",\n                source_ref.atColumnNumber(node.col_offset),\n            )\n\n    if provider.isExpressionAsyncgenObjectBody():\n        if expression is not None:\n            SyntaxErrors.raiseSyntaxError(\n                \"'return' with value in async generator\",\n                source_ref.atColumnNumber(node.col_offset),\n            )\n\n    if (\n        provider.isExpressionGeneratorObjectBody()\n        or provider.isExpressionAsyncgenObjectBody()\n    ):\n        if expression is None or expression.isExpressionConstantNoneRef():\n            return StatementGeneratorReturnNone(source_ref=source_ref)\n        else:\n            return StatementGeneratorReturn(\n                expression=expression, source_ref=source_ref\n            )\n    else:\n        return makeStatementReturn(expression=expression, source_ref=source_ref)\n\n\ndef buildExprOnlyNode(provider, node, source_ref):\n    result = StatementExpressionOnly(\n        expression=buildNode(provider, node.value, source_ref), source_ref=source_ref\n    )\n\n    result.setCompatibleSourceReference(\n        result.subnode_expression.getCompatibleSourceReference()\n    )\n\n    return result\n\n\ndef buildUnaryOpNode(provider, node, source_ref):\n    operator = getKind(node.op)\n\n    # Delegate this one to boolean operation code.\n    if operator == \"Not\":\n        return buildBoolOpNode(provider=provider, node=node, source_ref=source_ref)\n\n    operand = buildNode(provider, node.operand, source_ref)\n\n    return makeExpressionOperationUnary(\n        operator=operator, operand=operand, source_ref=source_ref\n    )\n\n\ndef buildBinaryOpNode(provider, node, source_ref):\n    operator = getKind(node.op)\n\n    if operator == \"Div\":\n        operator = \"TrueDiv\" if getFutureSpec().isFutureDivision() else \"OldDiv\"\n\n    left = buildNode(provider, node.left, source_ref)\n    right = buildNode(provider, node.right, source_ref)\n\n    result = makeBinaryOperationNode(\n        operator=operator, left=left, right=right, source_ref=source_ref\n    )\n\n    result.setCompatibleSourceReference(source_ref=right.getCompatibleSourceReference())\n\n    return result\n\n\ndef buildReprNode(provider, node, source_ref):\n    return makeExpressionOperationUnary(\n        operator=\"Repr\",\n        operand=buildNode(provider, node.value, source_ref),\n        source_ref=source_ref,\n    )\n\n\ndef buildConditionalExpressionNode(provider, node, source_ref):\n    return ExpressionConditional(\n        condition=buildNode(provider, node.test, source_ref),\n        expression_yes=buildNode(provider, node.body, source_ref),\n        expression_no=buildNode(provider, node.orelse, source_ref),\n        source_ref=source_ref,\n    )\n\n\ndef buildFormattedValueNode(provider, node, source_ref):\n    value = buildNode(provider, node.value, source_ref)\n\n    conversion = node.conversion % 4 if node.conversion > 0 else 0\n\n    if conversion == 0:\n        pass\n    elif conversion == 3:\n        # TODO: We might start using this for Python2 too.\n        assert str is not bytes\n\n        value = ExpressionBuiltinStrP3(\n            value=value, encoding=None, errors=None, source_ref=source_ref\n        )\n    elif conversion == 2:\n        value = makeExpressionOperationUnary(\n            operator=\"Repr\", operand=value, source_ref=source_ref\n        )\n    elif conversion == 1:\n        value = ExpressionBuiltinAscii(value=value, source_ref=source_ref)\n    else:\n        assert False, conversion\n\n    return ExpressionBuiltinFormat(\n        value=value,\n        format_spec=buildNode(provider, node.format_spec, source_ref, allow_none=True),\n        source_ref=source_ref,\n    )\n\n\ndef buildJoinedStrNode(provider, node, source_ref):\n    if node.values:\n        return ExpressionStringConcatenation(\n            values=buildNodeTuple(provider, node.values, source_ref),\n            source_ref=source_ref,\n        )\n    else:\n        return makeConstantRefNode(constant=\"\", source_ref=source_ref)\n\n\ndef buildSliceNode(provider, node, source_ref):\n    \"\"\"Python3.9 or higher, slice notations.\"\"\"\n    return makeExpressionBuiltinSlice(\n        start=buildNode(provider, node.lower, source_ref, allow_none=True),\n        stop=buildNode(provider, node.upper, source_ref, allow_none=True),\n        step=buildNode(provider, node.step, source_ref, allow_none=True),\n        source_ref=source_ref,\n    )\n\n\nsetBuildingDispatchers(\n    path_args3={\n        \"Name\": buildVariableReferenceNode,\n        \"Assign\": buildAssignNode,\n        \"AnnAssign\": buildAnnAssignNode,\n        \"Delete\": buildDeleteNode,\n        \"Lambda\": buildLambdaNode,\n        \"GeneratorExp\": buildGeneratorExpressionNode,\n        \"If\": buildConditionNode,\n        \"While\": buildWhileLoopNode,\n        \"For\": buildForLoopNode,\n        \"AsyncFor\": buildAsyncForLoopNode,\n        \"Compare\": buildComparisonNode,\n        \"ListComp\": buildListContractionNode,\n        \"DictComp\": buildDictContractionNode,\n        \"SetComp\": buildSetContractionNode,\n        \"Dict\": buildDictionaryNode,\n        \"Set\": buildSetCreationNode,\n        \"Tuple\": buildTupleCreationNode,\n        \"List\": buildListCreationNode,\n        \"Global\": handleGlobalDeclarationNode,\n        \"Nonlocal\": handleNonlocalDeclarationNode,\n        \"TryExcept\": buildTryExceptionNode,\n        \"TryFinally\": buildTryFinallyNode2,\n        \"Try\": buildTryNode,\n        \"Raise\": buildRaiseNode,\n        # Python3.11 exception group catching\n        \"TryStar\": buildTryStarNode,\n        \"Import\": buildImportModulesNode,\n        \"ImportFrom\": buildImportFromNode,\n        \"Assert\": buildAssertNode,\n        \"Exec\": buildExecNode,\n        \"With\": buildWithNode,\n        \"AsyncWith\": buildAsyncWithNode,\n        \"FunctionDef\": buildFunctionNode,\n        \"AsyncFunctionDef\": buildAsyncFunctionNode,\n        \"Await\": buildAwaitNode,\n        \"ClassDef\": buildClassNode,\n        \"Print\": buildPrintNode,\n        \"Call\": buildCallNode,\n        \"Subscript\": buildSubscriptNode,\n        \"BoolOp\": buildBoolOpNode,\n        \"Attribute\": buildAttributeNode,\n        \"Return\": buildReturnNode,\n        \"Yield\": buildYieldNode,\n        \"YieldFrom\": buildYieldFromNode,\n        \"Expr\": buildExprOnlyNode,\n        \"UnaryOp\": buildUnaryOpNode,\n        \"BinOp\": buildBinaryOpNode,\n        \"Repr\": buildReprNode,\n        \"AugAssign\": buildInplaceAssignNode,\n        \"IfExp\": buildConditionalExpressionNode,\n        \"Break\": buildStatementLoopBreak,\n        \"JoinedStr\": buildJoinedStrNode,\n        \"FormattedValue\": buildFormattedValueNode,\n        \"NamedExpr\": buildNamedExprNode,\n        \"Slice\": buildSliceNode,\n        \"Match\": buildMatchNode,\n    },\n    path_args2={\n        \"Constant\": buildNamedConstantNode,  # Python3.8\n        \"NameConstant\": buildNamedConstantNode,  # Python3.8 or below\n        \"Str\": buildStringNode,\n        \"Num\": buildNumberNode,\n        \"Bytes\": buildBytesNode,\n        \"Continue\": buildStatementLoopContinue,\n    },\n    path_args1={\"Ellipsis\": buildEllipsisNode},\n)\n\n\ndef buildParseTree(provider, ast_tree, source_ref, is_module, is_main):\n    # There are a bunch of branches here, mostly to deal with version\n    # differences for module default variables. pylint: disable=too-many-branches\n\n    # Maybe one day, we do exec inlining again, that is what this is for,\n    # then is_module won't be True, for now it always is.\n    pushFutureSpec()\n    if is_module:\n        provider.setFutureSpec(getFutureSpec())\n\n    body, doc = extractDocFromBody(ast_tree)\n\n    if is_module and is_main and python_version >= 0x360:\n        provider.markAsNeedsAnnotationsDictionary()\n\n    try:\n        result = buildStatementsNode(\n            provider=provider, nodes=body, source_ref=source_ref\n        )\n    except RuntimeError as e:\n        if \"maximum recursion depth\" in e.args[0]:\n            raise CodeTooComplexCode(\n                provider.getFullName(), provider.getCompileTimeFilename()\n            )\n\n    # After building, we can verify that all future statements were where they\n    # belong, namely at the start of the module.\n    checkFutureImportsOnlyAtStart(body)\n\n    internal_source_ref = source_ref.atInternal()\n\n    statements = []\n\n    if is_module:\n        # Add import of \"site\" module of main programs visibly in the node tree,\n        # so recursion and optimization can pick it up, checking its effects.\n        if is_main and not Options.hasPythonFlagNoSite():\n            statements.append(\n                StatementExpressionOnly(\n                    expression=makeExpressionImportModuleFixed(\n                        using_module_name=provider.getParentModule().getFullName(),\n                        module_name=\"site\",\n                        value_name=\"site\",\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n            for path_imported_name in getPthImportedPackages():\n                if isHardModuleWithoutSideEffect(path_imported_name):\n                    continue\n\n                statements.append(\n                    StatementExpressionOnly(\n                        expression=makeExpressionImportModuleFixed(\n                            using_module_name=provider.getParentModule().getFullName(),\n                            module_name=path_imported_name,\n                            value_name=path_imported_name.getTopLevelPackageName(),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                )\n\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__doc__\",\n                source=makeConstantRefNode(\n                    constant=doc, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__file__\",\n                source=ExpressionModuleAttributeFileRef(\n                    variable=provider.getVariableForReference(\"__file__\"),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n\n        if provider.isCompiledPythonPackage():\n            # This assigns \"__path__\" value.\n            statements.append(createPathAssignment(provider, internal_source_ref))\n\n        if python_version >= 0x340 and not is_main:\n            statements += (\n                StatementAssignmentAttribute(\n                    expression=ExpressionModuleAttributeSpecRef(\n                        variable=provider.getVariableForReference(\"__spec__\"),\n                        source_ref=internal_source_ref,\n                    ),\n                    attribute_name=\"origin\",\n                    source=ExpressionModuleAttributeFileRef(\n                        variable=provider.getVariableForReference(\"__file__\"),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                StatementAssignmentAttribute(\n                    expression=ExpressionModuleAttributeSpecRef(\n                        variable=provider.getVariableForReference(\"__spec__\"),\n                        source_ref=internal_source_ref,\n                    ),\n                    attribute_name=\"has_location\",\n                    source=makeConstantRefNode(True, internal_source_ref),\n                    source_ref=internal_source_ref,\n                ),\n            )\n\n            if provider.isCompiledPythonPackage():\n                statements.append(\n                    StatementAssignmentAttribute(\n                        expression=ExpressionModuleAttributeSpecRef(\n                            variable=provider.getVariableForReference(\"__spec__\"),\n                            source_ref=internal_source_ref,\n                        ),\n                        attribute_name=\"submodule_search_locations\",\n                        source=ExpressionVariableNameRef(\n                            provider=provider,\n                            variable_name=\"__path__\",\n                            source_ref=internal_source_ref,\n                        ),\n                        source_ref=internal_source_ref,\n                    )\n                )\n\n    if python_version >= 0x300:\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__cached__\",\n                source=ExpressionConstantNoneRef(source_ref=internal_source_ref),\n                source_ref=internal_source_ref,\n            )\n        )\n\n    needs__initializing__ = (\n        not provider.isMainModule() and 0x300 <= python_version < 0x340\n    )\n\n    if needs__initializing__:\n        # Set \"__initializing__\" at the beginning to True\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__initializing__\",\n                source=makeConstantRefNode(\n                    constant=True, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n\n    if provider.needsAnnotationsDictionary():\n        # Set \"__annotations__\" on module level to {}\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__annotations__\",\n                source=makeConstantRefNode(\n                    constant={}, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n\n    # Now the module body if there is any at all.\n    if result is not None:\n        statements.extend(result.subnode_statements)\n\n    if needs__initializing__:\n        # Set \"__initializing__\" at the end to False\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=\"__initializing__\",\n                source=makeConstantRefNode(\n                    constant=False, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n\n    if is_module:\n        result = makeModuleFrame(\n            module=provider, statements=statements, source_ref=source_ref\n        )\n\n        popFutureSpec()\n\n        return result\n    else:\n        assert False\n\n\ndef decideCompilationMode(is_top, module_name, module_filename, for_pgo):\n    \"\"\"Decide the compilation mode for a module.\n\n    module_name - The module to decide compilation mode for.\n    for_pgo - consider PGO information or not\n    \"\"\"\n\n    is_stdlib = module_filename is not None and isStandardLibraryPath(module_filename)\n\n    # Technically required modules must be bytecode\n    if is_stdlib and module_name in detectEarlyImports():\n        return \"bytecode\"\n\n    result = Plugins.decideCompilation(module_name)\n\n    # Cannot change mode of __main__ to bytecode, that is not going\n    # to work currently.\n    if result == \"bytecode\" and is_top:\n        plugins_logger.warning(\n            \"\"\"\\\nIgnoring plugin decision to compile top level package '%s' \\\nas bytecode, the extension module entry point is technically \\\nrequired to compiled.\"\"\"\n            % module_name\n        )\n        result = \"compiled\"\n\n    # Include all of standard library as bytecode, for now. We need to identify\n    # which ones really need that.\n    if not is_top and is_stdlib:\n        result = \"bytecode\"\n\n    # Plugins need to win over PGO, as they might know it better\n    if result is None and not for_pgo:\n        result = decideCompilationFromPGO(module_name=module_name)\n\n    # Default if neither plugins nor PGO have expressed an opinion\n    if result is None:\n        if is_stdlib and module_name in detectStdlibAutoInclusionModules():\n            result = \"bytecode\"\n        else:\n            result = \"compiled\"\n\n    return result\n\n\ndef _loadUncompiledModuleFromCache(\n    module_name, reason, is_package, source_code, source_ref\n):\n    result = makeUncompiledPythonModule(\n        module_name=module_name,\n        reason=reason,\n        filename=source_ref.getFilename(),\n        bytecode=demoteSourceCodeToBytecode(\n            module_name=module_name,\n            source_code=source_code,\n            filename=source_ref.getFilename(),\n        ),\n        technical=module_name in detectEarlyImports(),\n        is_package=is_package,\n    )\n\n    used_modules = OrderedSet()\n\n    used_modules = getCachedImportedModuleUsageAttempts(\n        module_name=module_name, source_code=source_code, source_ref=source_ref\n    )\n\n    # assert not is_package, (module_name, used_modules, result, result.getCompileTimeFilename())\n\n    result.setUsedModules(used_modules)\n\n    return result\n\n\ndef _createModule(\n    module_name,\n    module_filename,\n    module_kind,\n    reason,\n    source_code,\n    source_ref,\n    is_namespace,\n    is_package,\n    is_top,\n    is_main,\n    main_added,\n):\n    is_stdlib = module_filename is not None and isStandardLibraryPath(module_filename)\n\n    if module_kind == \"extension\":\n        result = PythonExtensionModule(\n            module_name=module_name,\n            reason=reason,\n            technical=is_stdlib and module_name in detectEarlyImports(),\n            source_ref=source_ref,\n        )\n    elif is_main:\n        assert reason == \"main\", reason\n\n        result = PythonMainModule(\n            main_added=main_added,\n            module_name=module_name,\n            mode=decideCompilationMode(\n                is_top=is_top,\n                module_name=module_name,\n                module_filename=module_filename,\n                for_pgo=False,\n            ),\n            future_spec=None,\n            source_ref=source_ref,\n        )\n\n        checkPythonVersionFromCode(source_code)\n    elif is_namespace:\n        result = createNamespacePackage(\n            module_name=module_name,\n            reason=reason,\n            is_top=is_top,\n            source_ref=source_ref,\n        )\n    else:\n        mode = decideCompilationMode(\n            is_top=is_top,\n            module_name=module_name,\n            module_filename=module_filename,\n            for_pgo=False,\n        )\n\n        if (\n            mode == \"bytecode\"\n            and not is_top\n            and not Options.shallDisableBytecodeCacheUsage()\n            and hasCachedImportedModuleUsageAttempts(\n                module_name=module_name, source_code=source_code, source_ref=source_ref\n            )\n        ):\n            result = _loadUncompiledModuleFromCache(\n                module_name=module_name,\n                reason=reason,\n                is_package=is_package,\n                source_code=source_code,\n                source_ref=source_ref,\n            )\n\n            # Not used anymore\n            source_code = None\n        else:\n            if is_package:\n                result = CompiledPythonPackage(\n                    module_name=module_name,\n                    reason=reason,\n                    is_top=is_top,\n                    mode=mode,\n                    future_spec=None,\n                    source_ref=source_ref,\n                )\n            else:\n                result = CompiledPythonModule(\n                    module_name=module_name,\n                    reason=reason,\n                    is_top=is_top,\n                    mode=mode,\n                    future_spec=None,\n                    source_ref=source_ref,\n                )\n\n    return result\n\n\ndef createModuleTree(module, source_ref, ast_tree, is_main):\n    if Options.isShowMemory():\n        memory_watch = MemoryUsage.MemoryWatch()\n\n    module_body = buildParseTree(\n        provider=module,\n        ast_tree=ast_tree,\n        source_ref=source_ref,\n        is_module=True,\n        is_main=is_main,\n    )\n\n    if module_body.isStatementsFrame():\n        module_body = makeStatementsSequenceFromStatement(statement=module_body)\n\n    module.setChildBody(module_body)\n\n    completeVariableClosures(module)\n\n    if Options.isShowMemory():\n        memory_watch.finish(\n            \"Memory usage changed loading module '%s'\" % module.getFullName()\n        )\n\n\ndef buildMainModuleTree(filename, source_code):\n    # Detect to be frozen modules if any, so we can consider to not follow\n    # to them.\n\n    if Options.shallMakeModule():\n        module_name = Importing.getModuleNameAndKindFromFilename(filename)[0]\n\n        if module_name is None:\n            general.sysexit(\n                \"Error, filename '%s' suffix does not appear to be Python module code.\"\n                % filename\n            )\n    else:\n        # TODO: Doesn't work for deeply nested packages at all.\n        if Options.hasPythonFlagPackageMode():\n            module_name = ModuleName(os.path.basename(filename) + \".__main__\")\n        else:\n            module_name = ModuleName(\"__main__\")\n\n    module = buildModule(\n        module_name=module_name,\n        reason=\"main\",\n        module_filename=filename,\n        source_code=source_code,\n        is_top=True,\n        is_main=not Options.shallMakeModule(),\n        module_kind=\"py\",\n        is_fake=source_code is not None,\n        hide_syntax_error=False,\n    )\n\n    if Options.isStandaloneMode():\n        module.setStandardLibraryModules(\n            early_module_names=detectEarlyImports(),\n            stdlib_modules_names=detectStdlibAutoInclusionModules(),\n        )\n\n    # Main modules do not get added to the import cache, but plugins get to see it.\n    if module.isMainModule():\n        Plugins.onModuleDiscovered(module)\n    else:\n        addImportedModule(imported_module=module)\n\n    return module\n\n\ndef _makeModuleBodyFromSyntaxError(exc, module_name, reason, module_filename):\n    if module_filename not in Importing.warned_about:\n        Importing.warned_about.add(module_filename)\n\n        recursion_logger.warning(\n            \"\"\"\\\nCannot follow import to module '%s' because of '%s'.\"\"\"\n            % (module_name, exc.__class__.__name__)\n        )\n\n    source_ref = SourceCodeReferences.fromFilename(filename=module_filename)\n\n    module = CompiledPythonModule(\n        module_name=module_name,\n        reason=reason,\n        is_top=False,\n        mode=\"compiled\",\n        future_spec=FutureSpec(),\n        source_ref=source_ref,\n    )\n\n    module_body = makeModuleFrame(\n        module=module,\n        statements=(\n            makeRaiseExceptionStatementFromInstance(\n                source_ref=source_ref, exception=exc\n            ),\n        ),\n        source_ref=source_ref,\n    )\n\n    module_body = makeStatementsSequenceFromStatement(statement=module_body)\n    module.setChildBody(module_body)\n\n    return module\n\n\ndef _makeModuleBodyTooComplex(\n    module_name, reason, module_filename, source_code, is_package\n):\n    if module_filename not in Importing.warned_about:\n        Importing.warned_about.add(module_filename)\n\n        # Known harmless case, not causing issues, lets not warn about it.\n        if module_name != \"sympy.polys.numberfields.resolvent_lookup\":\n            recursion_logger.info(\n                \"\"\"\\\nCannot compile module '%s' because its code is too complex, included as bytecode.\"\"\"\n                % module_name\n            )\n\n    return makeUncompiledPythonModule(\n        module_name=module_name,\n        reason=reason,\n        filename=module_filename,\n        bytecode=marshal.dumps(\n            compile(source_code, module_filename, \"exec\", dont_inherit=True)\n        ),\n        is_package=is_package,\n        technical=module_name in detectEarlyImports(),\n    )\n\n\ndef buildModule(\n    module_name,\n    module_kind,\n    module_filename,\n    reason,\n    source_code,\n    is_top,\n    is_main,\n    is_fake,\n    hide_syntax_error,\n):\n    # Many details to deal with,\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n    (\n        main_added,\n        is_package,\n        is_namespace,\n        source_ref,\n        source_filename,\n    ) = Importing.decideModuleSourceRef(\n        filename=module_filename,\n        module_name=module_name,\n        is_main=is_main,\n        is_fake=is_fake,\n        logger=general,\n    )\n\n    if Options.hasPythonFlagPackageMode():\n        if is_top and Options.shallMakeModule():\n            optimization_logger.warning(\n                \"Python flag -m (package_mode) has no effect in module mode, it's only for executables.\"\n            )\n        elif is_main and not main_added:\n            optimization_logger.warning(\n                \"Python flag -m (package_mode) only works on packages with '__main__.py'.\"\n            )\n\n    # Handle bytecode module case immediately.\n    if module_kind == \"pyc\":\n        return makeUncompiledPythonModule(\n            module_name=module_name,\n            reason=reason,\n            filename=module_filename,\n            bytecode=loadCodeObjectData(module_filename),\n            is_package=is_package,\n            technical=module_name in detectEarlyImports(),\n        )\n\n    # Read source code if necessary. Might give a SyntaxError due to not being proper\n    # encoded source.\n    if source_filename is not None and not is_namespace and module_kind == \"py\":\n        # For fake modules, source is provided directly.\n        original_source_code = None\n        contributing_plugins = ()\n\n        if source_code is None:\n            try:\n                (\n                    source_code,\n                    original_source_code,\n                    contributing_plugins,\n                ) = readSourceCodeFromFilenameWithInformation(\n                    module_name=module_name, source_filename=source_filename\n                )\n            except SyntaxError as e:\n                # Avoid hiding our own syntax errors.\n                if not hasattr(e, \"generated_by_nuitka\"):\n                    raise\n\n                # Do not hide SyntaxError in main module.\n                if not hide_syntax_error:\n                    raise\n\n                return _makeModuleBodyFromSyntaxError(\n                    exc=e,\n                    module_name=module_name,\n                    reason=reason,\n                    module_filename=module_filename,\n                )\n\n        try:\n            ast_tree = parseSourceCodeToAst(\n                source_code=source_code,\n                module_name=module_name,\n                filename=source_filename,\n                line_offset=0,\n            )\n        except (SyntaxError, IndentationError) as e:\n            # Do not hide SyntaxError if asked not to.\n            if not hide_syntax_error:\n                raise\n\n            if original_source_code is not None:\n                try:\n                    parseSourceCodeToAst(\n                        source_code=original_source_code,\n                        module_name=module_name,\n                        filename=source_filename,\n                        line_offset=0,\n                    )\n                except (SyntaxError, IndentationError):\n                    # Also an exception without the plugins, that is OK\n                    pass\n                else:\n                    source_diff = getSourceCodeDiff(original_source_code, source_code)\n\n                    for line in source_diff:\n                        plugins_logger.warning(line, keep_format=True)\n\n                    if len(contributing_plugins) == 1:\n                        next(iter(contributing_plugins)).sysexit(\n                            \"Making changes to '%s' that cause SyntaxError '%s'\"\n                            % (module_name, e)\n                        )\n                    else:\n                        plugins_logger.sysexit(\n                            \"One of the plugins '%s' is making changes to '%s' that cause SyntaxError '%s'\"\n                            % (\",\".join(contributing_plugins), module_name, e)\n                        )\n\n            return _makeModuleBodyFromSyntaxError(\n                exc=e,\n                module_name=module_name,\n                reason=reason,\n                module_filename=module_filename,\n            )\n        except CodeTooComplexCode:\n            # Do not hide CodeTooComplexCode in main module.\n            if is_main:\n                raise\n\n            return _makeModuleBodyTooComplex(\n                module_name=module_name,\n                reason=reason,\n                module_filename=module_filename,\n                source_code=source_code,\n                is_package=is_package,\n            )\n    else:\n        ast_tree = None\n        source_code = None\n\n    module = _createModule(\n        module_name=module_name,\n        module_filename=None if is_fake else module_filename,\n        module_kind=module_kind,\n        reason=reason,\n        source_code=source_code,\n        source_ref=source_ref,\n        is_top=is_top,\n        is_main=is_main,\n        is_namespace=is_namespace,\n        is_package=is_package,\n        main_added=main_added,\n    )\n\n    if is_top:\n        ModuleRegistry.addRootModule(module)\n\n        OutputDirectories.setMainModule(module)\n\n    if module.isCompiledPythonModule() and source_code is not None:\n        try:\n            createModuleTree(\n                module=module,\n                source_ref=source_ref,\n                ast_tree=ast_tree,\n                is_main=is_main,\n            )\n        except CodeTooComplexCode:\n            # Do not hide CodeTooComplexCode in main module.\n            if is_main or is_top:\n                raise\n\n            return _makeModuleBodyTooComplex(\n                module_name=module_name,\n                reason=reason,\n                module_filename=module_filename,\n                source_code=source_code,\n                is_package=is_package,\n            )\n\n    return module\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ComplexCallHelperFunctions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module is providing helper functions for complex call re-formulations.\n\nOne for each type of call. \"\"\"\n\nfrom nuitka.nodes.AttributeNodes import (\n    ExpressionAttributeCheck,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinDictNodes import ExpressionBuiltinDict\nfrom nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.BuiltinRefNodes import (\n    ExpressionBuiltinAnonymousRef,\n    makeExpressionBuiltinTypeRef,\n)\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinTuple\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.ComparisonNodes import (\n    ExpressionComparisonIn,\n    ExpressionComparisonIsNot,\n)\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditionalOr,\n    makeStatementConditional,\n)\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTuple\nfrom nuitka.nodes.DictionaryNodes import (\n    ExpressionDictOperationIteritems,\n    StatementDictOperationSet,\n    StatementDictOperationSetKeyValue,\n)\nfrom nuitka.nodes.ExceptionNodes import (\n    ExpressionBuiltinMakeException,\n    StatementRaiseException,\n)\nfrom nuitka.nodes.FunctionAttributeNodes import ExpressionFunctionErrorStr\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCall,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.OperatorNodes import makeBinaryOperationNode\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.SubscriptNodes import (\n    ExpressionSubscriptLookup,\n    StatementAssignmentSubscript,\n)\nfrom nuitka.nodes.TypeNodes import (\n    ExpressionBuiltinIsinstance,\n    ExpressionBuiltinType1,\n)\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables\nfrom nuitka.PythonVersions import (\n    getComplexCallSequenceErrorTemplate,\n    python_version,\n)\nfrom nuitka.specs.ParameterSpecs import ParameterSpec\n\nfrom .InternalModule import (\n    internal_source_ref,\n    makeInternalHelperFunctionBody,\n    once_decorator,\n)\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    makeCallNode,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n)\n\n# TODO: Consider using ExpressionOutlineNodes for at least some of these\n# or their own helpers.\n\n\ndef orderArgs(*args):\n    if python_version >= 0x350:\n\n        def weight(arg):\n            result = args.index(arg)\n\n            if arg == \"kw\":\n                result += 1.5\n            elif arg == \"star_arg_list\":\n                result -= 1.5\n\n            return result\n\n        return tuple(sorted(args, key=weight))\n\n    return args\n\n\ndef _makeNameAttributeLookup(node, attribute_name=\"__name__\"):\n    return makeExpressionAttributeLookup(\n        expression=node, attribute_name=attribute_name, source_ref=internal_source_ref\n    )\n\n\n@once_decorator\ndef getCallableNameDescBody():\n    helper_name = \"get_callable_name_desc\"\n\n    # Equivalent of:\n    #\n    # Note: The \"called_type\" is a temporary variable.\n    #\n    # called_type = type(BuiltinFunctionType)\n    #\n    # if isinstance(called, (FunctionType, MethodType, BuiltinFunctionType)):\n    #     return called.__name__\n    # elif python_version < 0x3 and isinstance(called, ClassType):\n    #     return called_type.__name__ + \" constructor\"\n    # elif python_version < 0x3 and isinstance(called, InstanceType):\n    #     return called_type.__name__ + \" instance\"\n    # else:\n    #     return called_type.__name__ + \" object\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\",),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    if python_version < 0x390:\n        function_name = makeBinaryOperationNode(\n            operator=\"Add\",\n            left=_makeNameAttributeLookup(\n                node=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                attribute_name=\"__name__\",\n            ),\n            right=makeConstantRefNode(\n                constant=\"()\",\n                source_ref=internal_source_ref,\n                user_provided=True,\n            ),\n            source_ref=internal_source_ref,\n        )\n    else:\n        # TODO: Make it usable for pre-Python 3.9 too.\n        function_name = ExpressionFunctionErrorStr(\n            value=ExpressionVariableRef(\n                variable=called_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        )\n\n    functions_case = makeStatementsSequenceFromStatement(\n        statement=(\n            StatementReturn(\n                expression=function_name,\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    if python_version >= 0x390:\n        result.setChildBody(functions_case)\n\n        return result\n\n    no_branch = StatementReturn(\n        expression=makeBinaryOperationNode(\n            operator=\"Add\",\n            right=makeConstantRefNode(\n                constant=\" object\", source_ref=internal_source_ref, user_provided=True\n            ),\n            left=_makeNameAttributeLookup(\n                ExpressionBuiltinType1(\n                    value=ExpressionVariableRef(\n                        variable=called_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                )\n            ),\n            source_ref=internal_source_ref,\n        ),\n        source_ref=internal_source_ref,\n    )\n\n    if python_version < 0x300:\n        instance_case = StatementReturn(\n            expression=makeBinaryOperationNode(\n                operator=\"Add\",\n                right=makeConstantRefNode(\n                    constant=\" instance\",\n                    source_ref=internal_source_ref,\n                    user_provided=True,\n                ),\n                left=_makeNameAttributeLookup(\n                    _makeNameAttributeLookup(\n                        ExpressionVariableRef(\n                            variable=called_variable, source_ref=internal_source_ref\n                        ),\n                        attribute_name=\"__class__\",\n                    )\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n\n        no_branch = makeStatementConditional(\n            condition=ExpressionBuiltinIsinstance(\n                instance=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                classes=ExpressionBuiltinAnonymousRef(\n                    builtin_name=\"instance\", source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=instance_case,\n            no_branch=no_branch,\n            source_ref=internal_source_ref,\n        )\n\n        class_case = StatementReturn(\n            expression=makeBinaryOperationNode(\n                operator=\"Add\",\n                right=makeConstantRefNode(\n                    constant=\" constructor\",\n                    source_ref=internal_source_ref,\n                    user_provided=True,\n                ),\n                left=_makeNameAttributeLookup(\n                    ExpressionVariableRef(\n                        variable=called_variable, source_ref=internal_source_ref\n                    )\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n\n        no_branch = makeStatementConditional(\n            condition=ExpressionBuiltinIsinstance(\n                instance=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                classes=ExpressionBuiltinAnonymousRef(\n                    builtin_name=\"classobj\", source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=class_case,\n            no_branch=no_branch,\n            source_ref=internal_source_ref,\n        )\n\n    if python_version < 0x300:\n        normal_cases = (\"function\", \"builtin_function_or_method\", \"instancemethod\")\n    else:\n        normal_cases = (\"function\", \"builtin_function_or_method\")\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=makeStatementConditional(\n                condition=ExpressionBuiltinIsinstance(\n                    instance=ExpressionVariableRef(\n                        variable=called_variable, source_ref=internal_source_ref\n                    ),\n                    classes=makeExpressionMakeTuple(\n                        elements=tuple(\n                            ExpressionBuiltinAnonymousRef(\n                                builtin_name=builtin_name,\n                                source_ref=internal_source_ref,\n                            )\n                            for builtin_name in normal_cases\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                yes_branch=functions_case,\n                no_branch=no_branch,\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\ndef makeStarListArgumentErrorRaise(called_variable, star_list_variable):\n    return StatementRaiseException(\n        exception_type=ExpressionBuiltinMakeException(\n            exception_name=\"TypeError\",\n            args=(\n                makeBinaryOperationNode(\n                    operator=\"Mod\",\n                    left=makeConstantRefNode(\n                        constant=getComplexCallSequenceErrorTemplate(),\n                        source_ref=internal_source_ref,\n                        user_provided=True,\n                    ),\n                    right=makeExpressionMakeTuple(\n                        elements=(\n                            makeExpressionFunctionCall(\n                                function=makeExpressionFunctionCreation(\n                                    function_ref=ExpressionFunctionRef(\n                                        function_body=getCallableNameDescBody(),\n                                        source_ref=internal_source_ref,\n                                    ),\n                                    defaults=(),\n                                    kw_defaults=None,\n                                    annotations=None,\n                                    source_ref=internal_source_ref,\n                                ),\n                                values=(\n                                    ExpressionVariableRef(\n                                        variable=called_variable,\n                                        source_ref=internal_source_ref,\n                                    ),\n                                ),\n                                source_ref=internal_source_ref,\n                            ),\n                            _makeNameAttributeLookup(\n                                ExpressionBuiltinType1(\n                                    value=ExpressionVariableRef(\n                                        variable=star_list_variable,\n                                        source_ref=internal_source_ref,\n                                    ),\n                                    source_ref=internal_source_ref,\n                                )\n                            ),\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n            ),\n            source_ref=internal_source_ref,\n        ),\n        exception_value=None,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeStarListArgumentToTupleStatement(called_variable, star_list_variable):\n    if python_version >= 0x350:\n        non_tuple_code = makeStatementConditional(\n            condition=ExpressionConditionalOr(\n                left=ExpressionAttributeCheck(\n                    expression=ExpressionVariableRef(\n                        variable=star_list_variable, source_ref=internal_source_ref\n                    ),\n                    attribute_name=\"__iter__\",\n                    source_ref=internal_source_ref,\n                ),\n                right=ExpressionAttributeCheck(\n                    expression=ExpressionVariableRef(\n                        variable=star_list_variable, source_ref=internal_source_ref\n                    ),\n                    attribute_name=\"__getitem__\",\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=makeStatementAssignmentVariable(\n                variable=star_list_variable,\n                source=ExpressionBuiltinTuple(\n                    value=ExpressionVariableRef(\n                        variable=star_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            no_branch=makeStarListArgumentErrorRaise(\n                called_variable=called_variable, star_list_variable=star_list_variable\n            ),\n            source_ref=internal_source_ref,\n        )\n    else:\n        non_tuple_code = makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=star_list_variable,\n                source=ExpressionBuiltinTuple(\n                    value=ExpressionVariableRef(\n                        variable=star_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"TypeError\",\n            handler_body=makeStarListArgumentErrorRaise(\n                called_variable=called_variable, star_list_variable=star_list_variable\n            ),\n            source_ref=internal_source_ref,\n        )\n\n    return makeStatementConditional(\n        condition=ExpressionComparisonIsNot(\n            left=ExpressionBuiltinType1(\n                value=ExpressionVariableRef(\n                    variable=star_list_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            right=makeExpressionBuiltinTypeRef(\n                builtin_name=\"tuple\", source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        yes_branch=non_tuple_code,\n        no_branch=None,\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeRaiseExceptionMustBeMapping(called_variable, star_dict_variable):\n    return StatementRaiseException(\n        exception_type=ExpressionBuiltinMakeException(\n            exception_name=\"TypeError\",\n            args=(\n                makeBinaryOperationNode(\n                    operator=\"Mod\",\n                    left=makeConstantRefNode(\n                        constant=\"\"\"\\\n%s argument after ** must be a mapping, not %s\"\"\",\n                        source_ref=internal_source_ref,\n                        user_provided=True,\n                    ),\n                    right=makeExpressionMakeTuple(\n                        elements=(\n                            makeExpressionFunctionCall(\n                                function=makeExpressionFunctionCreation(\n                                    function_ref=ExpressionFunctionRef(\n                                        function_body=getCallableNameDescBody(),\n                                        source_ref=internal_source_ref,\n                                    ),\n                                    defaults=(),\n                                    kw_defaults=None,\n                                    annotations=None,\n                                    source_ref=internal_source_ref,\n                                ),\n                                values=(\n                                    ExpressionVariableRef(\n                                        variable=called_variable,\n                                        source_ref=internal_source_ref,\n                                    ),\n                                ),\n                                source_ref=internal_source_ref,\n                            ),\n                            _makeNameAttributeLookup(\n                                ExpressionBuiltinType1(\n                                    value=ExpressionVariableRef(\n                                        variable=star_dict_variable,\n                                        source_ref=internal_source_ref,\n                                    ),\n                                    source_ref=internal_source_ref,\n                                )\n                            ),\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n            ),\n            source_ref=internal_source_ref,\n        ),\n        exception_value=None,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeIteratingLoopStatement(tmp_iter_variable, tmp_item_variable, statements):\n    loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        *statements\n    )\n\n    return StatementLoop(loop_body=loop_body, source_ref=internal_source_ref)\n\n\ndef _makeStarDictArgumentToDictStatement(result, called_variable, star_dict_variable):\n    temp_scope = result.allocateTempScope(\"mapping\")\n\n    tmp_dict_variable = result.allocateTempVariable(\n        temp_scope, \"dict\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_keys_variable = result.allocateTempVariable(\n        temp_scope, \"keys\", temp_type=\"object\"\n    )\n    tmp_key_variable = result.allocateTempVariable(\n        temp_scope, \"key\", temp_type=\"object\"\n    )\n\n    loop_body = []\n\n    if python_version >= 0x380:\n        loop_body.append(\n            makeStatementConditional(\n                condition=ExpressionComparisonIn(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_key_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionVariableRef(\n                        variable=tmp_dict_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                yes_branch=_makeRaiseDuplicationItem(\n                    called_variable=called_variable, tmp_key_variable=tmp_key_variable\n                ),\n                no_branch=None,\n                source_ref=internal_source_ref,\n            )\n        )\n\n    loop_body.append(\n        StatementDictOperationSet(\n            dict_arg=ExpressionTempVariableRef(\n                variable=tmp_dict_variable, source_ref=internal_source_ref\n            ),\n            key=ExpressionTempVariableRef(\n                variable=tmp_key_variable, source_ref=internal_source_ref\n            ),\n            value=ExpressionSubscriptLookup(\n                expression=ExpressionVariableRef(\n                    variable=star_dict_variable, source_ref=internal_source_ref\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    mapping_case = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_keys_variable,\n                source=makeCallNode(\n                    _makeNameAttributeLookup(\n                        ExpressionVariableRef(\n                            variable=star_dict_variable, source_ref=internal_source_ref\n                        ),\n                        attribute_name=\"keys\",\n                    ),\n                    internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"AttributeError\",\n            handler_body=_makeRaiseExceptionMustBeMapping(\n                called_variable=called_variable, star_dict_variable=star_dict_variable\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionTempVariableRef(\n                    variable=tmp_keys_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_dict_variable,\n            source=makeConstantRefNode(\n                constant={}, source_ref=internal_source_ref, user_provided=True\n            ),\n            source_ref=internal_source_ref,\n        ),\n        _makeIteratingLoopStatement(\n            tmp_iter_variable=tmp_iter_variable,\n            tmp_item_variable=tmp_key_variable,\n            statements=loop_body,\n        ),\n        makeStatementAssignmentVariable(\n            variable=star_dict_variable,\n            source=ExpressionTempVariableRef(\n                variable=tmp_dict_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    tried = makeStatementConditional(\n        condition=ExpressionComparisonIsNot(\n            left=ExpressionBuiltinType1(\n                value=ExpressionVariableRef(\n                    variable=star_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            right=makeExpressionBuiltinTypeRef(\n                builtin_name=\"dict\", source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        yes_branch=mapping_case,\n        no_branch=None,\n        source_ref=internal_source_ref,\n    )\n\n    return makeTryFinallyStatement(\n        provider=result,\n        tried=tried,\n        final=makeStatementsReleaseVariables(\n            variables=(\n                tmp_dict_variable,\n                tmp_iter_variable,\n                tmp_keys_variable,\n                tmp_key_variable,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeRaiseNoStringItem(called_variable):\n    if python_version < 0x390:\n        raise_arg = makeBinaryOperationNode(\n            operator=\"Mod\",\n            left=makeConstantRefNode(\n                constant=\"%s keywords must be strings\",\n                source_ref=internal_source_ref,\n                user_provided=True,\n            ),\n            right=makeExpressionFunctionCall(\n                function=makeExpressionFunctionCreation(\n                    function_ref=ExpressionFunctionRef(\n                        function_body=getCallableNameDescBody(),\n                        source_ref=internal_source_ref,\n                    ),\n                    defaults=(),\n                    kw_defaults=None,\n                    annotations=None,\n                    source_ref=internal_source_ref,\n                ),\n                values=(\n                    ExpressionVariableRef(\n                        variable=called_variable, source_ref=internal_source_ref\n                    ),\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    else:\n        raise_arg = makeConstantRefNode(\n            constant=\"keywords must be strings\",\n            source_ref=internal_source_ref,\n            user_provided=True,\n        )\n\n    return StatementRaiseException(\n        exception_type=ExpressionBuiltinMakeException(\n            exception_name=\"TypeError\",\n            args=(raise_arg,),\n            source_ref=internal_source_ref,\n        ),\n        exception_value=None,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeRaiseDuplicationItem(called_variable, tmp_key_variable):\n    return StatementRaiseException(\n        exception_type=ExpressionBuiltinMakeException(\n            exception_name=\"TypeError\",\n            args=(\n                makeBinaryOperationNode(\n                    operator=\"Mod\",\n                    left=makeConstantRefNode(\n                        constant=\"\"\"\\\n%s got multiple values for keyword argument '%s'\"\"\",\n                        source_ref=internal_source_ref,\n                        user_provided=True,\n                    ),\n                    right=makeExpressionMakeTuple(\n                        elements=(\n                            makeExpressionFunctionCall(\n                                function=makeExpressionFunctionCreation(\n                                    function_ref=ExpressionFunctionRef(\n                                        function_body=getCallableNameDescBody(),\n                                        source_ref=internal_source_ref,\n                                    ),\n                                    defaults=(),\n                                    kw_defaults=None,\n                                    annotations=None,\n                                    source_ref=internal_source_ref,\n                                ),\n                                values=(\n                                    ExpressionVariableRef(\n                                        variable=called_variable,\n                                        source_ref=internal_source_ref,\n                                    ),\n                                ),\n                                source_ref=internal_source_ref,\n                            ),\n                            ExpressionTempVariableRef(\n                                variable=tmp_key_variable,\n                                source_ref=internal_source_ref,\n                            ),\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n            ),\n            source_ref=internal_source_ref,\n        ),\n        exception_value=None,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=internal_source_ref,\n    )\n\n\ndef _makeStarDictArgumentMergeToKwStatement(\n    result, called_variable, kw_variable, star_dict_variable\n):\n    # This is plain terribly complex\n    temp_scope = result.allocateTempScope(\"dict\")\n\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_keys_variable = result.allocateTempVariable(\n        temp_scope, \"keys\", temp_type=\"object\"\n    )\n    tmp_key_variable = result.allocateTempVariable(\n        temp_scope, \"key_xxx\", temp_type=\"object\"\n    )\n\n    tmp_variables = [tmp_iter_variable, tmp_keys_variable, tmp_key_variable]\n    mapping_loop_body = (\n        makeStatementConditional(\n            condition=ExpressionComparisonIn(\n                left=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                right=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=_makeRaiseDuplicationItem(\n                called_variable=called_variable, tmp_key_variable=tmp_key_variable\n            ),\n            no_branch=None,\n            source_ref=internal_source_ref,\n        ),\n        StatementAssignmentSubscript(\n            subscribed=ExpressionVariableRef(\n                variable=kw_variable, source_ref=internal_source_ref\n            ),\n            subscript=ExpressionTempVariableRef(\n                variable=tmp_key_variable, source_ref=internal_source_ref\n            ),\n            source=ExpressionSubscriptLookup(\n                expression=ExpressionVariableRef(\n                    variable=star_dict_variable, source_ref=internal_source_ref\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    mapping_case = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_keys_variable,\n                source=makeCallNode(\n                    _makeNameAttributeLookup(\n                        ExpressionVariableRef(\n                            variable=star_dict_variable, source_ref=internal_source_ref\n                        ),\n                        attribute_name=\"keys\",\n                    ),\n                    internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"AttributeError\",\n            handler_body=_makeRaiseExceptionMustBeMapping(\n                called_variable=called_variable, star_dict_variable=star_dict_variable\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionTempVariableRef(\n                    variable=tmp_keys_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        _makeIteratingLoopStatement(\n            tmp_iter_variable=tmp_iter_variable,\n            tmp_item_variable=tmp_key_variable,\n            statements=mapping_loop_body,\n        ),\n    )\n\n    temp_scope = result.allocateTempScope(\"dict\")\n\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"item\", temp_type=\"object\"\n    )\n    tmp_key_variable = result.allocateTempVariable(\n        temp_scope, \"key\", temp_type=\"object\"\n    )\n\n    tmp_variables += [tmp_iter_variable, tmp_item_variable, tmp_key_variable]\n    dict_loop_body = (\n        makeStatementAssignmentVariable(\n            variable=tmp_key_variable,\n            source=ExpressionSubscriptLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                subscript=makeConstantRefNode(\n                    constant=0, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIn(\n                left=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                right=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=_makeRaiseDuplicationItem(\n                called_variable=called_variable, tmp_key_variable=tmp_key_variable\n            ),\n            no_branch=None,\n            source_ref=internal_source_ref,\n        ),\n        StatementAssignmentSubscript(\n            subscribed=ExpressionVariableRef(\n                variable=kw_variable, source_ref=internal_source_ref\n            ),\n            subscript=ExpressionTempVariableRef(\n                variable=tmp_key_variable, source_ref=internal_source_ref\n            ),\n            source=ExpressionSubscriptLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                subscript=makeConstantRefNode(\n                    constant=1, source_ref=internal_source_ref, user_provided=True\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    dict_case = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=kw_variable,\n            source=ExpressionBuiltinDict(\n                pos_arg=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                pairs=(),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionDictOperationIteritems(\n                    dict_arg=ExpressionVariableRef(\n                        variable=star_dict_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        _makeIteratingLoopStatement(\n            tmp_iter_variable=tmp_iter_variable,\n            tmp_item_variable=tmp_item_variable,\n            statements=dict_loop_body,\n        ),\n    )\n\n    dict_case = makeStatementConditional(\n        condition=ExpressionVariableRef(\n            variable=star_dict_variable, source_ref=internal_source_ref\n        ),\n        yes_branch=dict_case,\n        no_branch=None,\n        source_ref=internal_source_ref,\n    )\n\n    tried = makeStatementConditional(\n        condition=ExpressionComparisonIsNot(\n            left=ExpressionBuiltinType1(\n                value=ExpressionVariableRef(\n                    variable=star_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            right=makeExpressionBuiltinTypeRef(\n                builtin_name=\"dict\", source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        yes_branch=mapping_case,\n        no_branch=dict_case,\n        source_ref=internal_source_ref,\n    )\n\n    return makeTryFinallyStatement(\n        provider=result,\n        tried=tried,\n        final=makeStatementsReleaseVariables(\n            variables=tmp_variables,\n            source_ref=internal_source_ref,\n        ),\n        source_ref=internal_source_ref,\n    )\n\n\n@once_decorator\ndef getFunctionCallHelperStarList():\n    helper_name = \"complex_call_helper_star_list\"\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_list, tuple):\n    #     try:\n    #         star_arg_list = tuple(star_arg_list)\n    #     except TypeError:\n    #         raise TypeError, \"%s argument after * must be a sequence, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_list).__name__\n    #         )\n    #\n    # return called(*star_arg_list)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"star_arg_list\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarListArgumentToTupleStatement(\n            called_variable=called_variable, star_list_variable=star_arg_list_variable\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=star_arg_list_variable, source_ref=internal_source_ref\n                ),\n                kw=None,\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperKeywordsStarList():\n    helper_name = \"complex_call_helper_keywords_star_list\"\n\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_list, tuple):\n    #     try:\n    #         star_arg_list = tuple(star_arg_list)\n    #     except TypeError:\n    #         raise TypeError, \"%s argument after * must be a sequence, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_list).__name__\n    #         )\n    #\n    # return called(*star_arg_list)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=orderArgs(\"called\", \"kw\", \"star_arg_list\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarListArgumentToTupleStatement(\n            called_variable=called_variable, star_list_variable=star_arg_list_variable\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=star_arg_list_variable, source_ref=internal_source_ref\n                ),\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosStarList():\n    helper_name = \"complex_call_helper_pos_star_list\"\n\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_list, tuple):\n    #     try:\n    #         star_arg_list = tuple(star_arg_list)\n    #     except TypeError:\n    #         raise TypeError, \"%s argument after * must be a sequence, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_list).__name__\n    #         )\n    #\n    # return called(*star_arg_list)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"args\", \"star_arg_list\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarListArgumentToTupleStatement(\n            called_variable=called_variable, star_list_variable=star_arg_list_variable\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=makeBinaryOperationNode(\n                    operator=\"Add\",\n                    left=ExpressionVariableRef(\n                        variable=args_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionVariableRef(\n                        variable=star_arg_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                kw=None,\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosKeywordsStarList():\n    helper_name = \"complex_call_helper_pos_keywords_star_list\"\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_list, tuple):\n    #     try:\n    #         star_arg_list = tuple(star_arg_list)\n    #     except TypeError:\n    #         raise TypeError, \"%s argument after * must be a sequence, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_list).__name__\n    #         )\n    #\n    # return called(*star_arg_list)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=orderArgs(\"called\", \"args\", \"kw\", \"star_arg_list\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarListArgumentToTupleStatement(\n            called_variable=called_variable, star_list_variable=star_arg_list_variable\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=makeBinaryOperationNode(\n                    operator=\"Add\",\n                    left=ExpressionVariableRef(\n                        variable=args_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionVariableRef(\n                        variable=star_arg_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperStarDict():\n    helper_name = \"complex_call_helper_star_dict\"\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_dict, dict):\n    #     try:\n    #         tmp_keys =  star_arg_dict.keys()\n    #     except AttributeError:\n    #         raise TypeError, \"\"%s argument after ** must be a mapping, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_dict).__name__\n    #         )\n    #\n    #     tmp_iter = iter(keys)\n    #     tmp_dict = {}\n    #\n    #     while 1:\n    #         try:\n    #             tmp_key = tmp_iter.next()\n    #         except StopIteration:\n    #             break\n    #\n    #         tmp_dict[tmp_key] = star_dict_arg[tmp_key]\n    #\n    #     star_arg_dict = new\n    #\n    # return called(**star_arg_dict)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarDictArgumentToDictStatement(\n            result=result,\n            called_variable=called_variable,\n            star_dict_variable=star_arg_dict_variable,\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=None,\n                kw=ExpressionVariableRef(\n                    variable=star_arg_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosStarDict():\n    helper_name = \"complex_call_helper_pos_star_dict\"\n\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call.\n    #\n    # if not isinstance(star_arg_dict, dict):\n    #     try:\n    #         tmp_keys =  star_arg_dict.keys()\n    #     except AttributeError:\n    #         raise TypeError, \"\"%s argument after ** must be a mapping, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_dict).__name__\n    #         )\n    #\n    #     tmp_iter = iter(keys)\n    #     tmp_dict = {}\n    #\n    #     while 1:\n    #         try:\n    #             tmp_key = tmp_iter.next()\n    #         except StopIteration:\n    #             break\n    #\n    #         tmp_dict[tmp_key] = star_dict_arg[tmp_key]\n    #\n    #     star_arg_dict = new\n    #\n    # return called(args, **star_arg_dict)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"args\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarDictArgumentToDictStatement(\n            result=result,\n            called_variable=called_variable,\n            star_dict_variable=star_arg_dict_variable,\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                kw=ExpressionVariableRef(\n                    variable=star_arg_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperKeywordsStarDict():\n    helper_name = \"complex_call_helper_keywords_star_dict\"\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call. One goal is to avoid copying \"kw\" unless really\n    # necessary, and to take the slow route only for non-dictionaries.\n    #\n    # if not isinstance(star_arg_dict, dict):\n    #     try:\n    #         tmp_keys =  star_arg_dict.keys()\n    #     except AttributeError:\n    #         raise TypeError, \"\"%s argument after ** must be a mapping, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_dict).__name__\n    #         )\n    #\n    #     if keys:\n    #         kw = dict(kw)\n    #\n    #         tmp_iter = iter(keys)\n    #         tmp_dict = {}\n    #\n    #         while 1:\n    #             try:\n    #                 tmp_key = tmp_iter.next()\n    #             except StopIteration:\n    #                  break\n    #\n    #             if tmp_key in kw:\n    #                 raise TypeError, \"%s got multiple values for keyword argument '%s'\" % (\n    #                     get_callable_name_desc(function),\n    #                     tmp_key\n    #                 )\n    #\n    #             kw[tmp_key] = star_dict_arg[tmp_key)\n    #\n    # elif star_arg_dict:\n    #    tmp_iter = star_arg_dict.iteritems()\n    #\n    #    kw = dict(kw)\n    #    while 1:\n    #        try:\n    #            tmp_key, tmp_value = tmp_iter.next()\n    #        except StopIteration:\n    #            break\n    #\n    #        if tmp_key in kw:\n    #            raise TypeError, \"%s got multiple values for keyword argument '%s'\" % (\n    #                 get_callable_name_desc(function),\n    #                 tmp_key\n    #            )\n    #\n    #        kw[tmp_key] = tmp_value\n    #\n    # return called(**kw)\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"kw\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarDictArgumentMergeToKwStatement(\n            result=result,\n            called_variable=called_variable,\n            kw_variable=kw_variable,\n            star_dict_variable=star_arg_dict_variable,\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=None,\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosKeywordsStarDict():\n    helper_name = \"complex_call_helper_pos_keywords_star_dict\"\n    # Equivalent of:\n    #\n    # Note: Call in here is not the same, as it can go without checks directly\n    # to PyObject_Call. One goal is to avoid copying \"kw\" unless really\n    # necessary, and to take the slow route only for non-dictionaries.\n    #\n    # if not isinstance(star_arg_dict, dict):\n    #     try:\n    #         tmp_keys =  star_arg_dict.keys()\n    #     except AttributeError:\n    #         raise TypeError, \"\"%s argument after ** must be a mapping, not %s\" % (\n    #             get_callable_name_desc(function),\n    #             type(star_arg_dict).__name__\n    #         )\n    #\n    #     if keys:\n    #         kw = dict(kw)\n    #\n    #         tmp_iter = iter(keys)\n    #         tmp_dict = {}\n    #\n    #         while 1:\n    #             try:\n    #                 tmp_key = tmp_iter.next()\n    #             except StopIteration:\n    #                  break\n    #\n    #             if tmp_key in kw:\n    #                 raise TypeError, \"%s got multiple values for keyword argument '%s'\" % (\n    #                     get_callable_name_desc(function),\n    #                     tmp_key\n    #                 )\n    #\n    #             kw[tmp_key] = star_dict_arg[tmp_key]\n    #\n    # elif star_arg_dict:\n    #    tmp_iter = star_arg_dict.iteritems()\n    #\n    #    kw = dict(kw)\n    #    while 1:\n    #        try:\n    #            tmp_key, tmp_value = tmp_iter.next()\n    #        except StopIteration:\n    #            break\n    #\n    #        if tmp_key in kw:\n    #            raise TypeError, \"%s got multiple values for keyword argument '%s'\" % (\n    #                 get_callable_name_desc(function),\n    #                 tmp_key\n    #            )\n    #\n    #        kw[tmp_key] = tmp_value\n    #\n    # return called(**kw )\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"args\", \"kw\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    body = makeStatementsSequenceFromStatements(\n        _makeStarDictArgumentMergeToKwStatement(\n            result=result,\n            called_variable=called_variable,\n            kw_variable=kw_variable,\n            star_dict_variable=star_arg_dict_variable,\n        ),\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\ndef getDoubleStarArgsConversion(\n    result, called_variable, kw_variable, star_arg_list_variable, star_arg_dict_variable\n):\n    statements = []\n\n    if kw_variable is not None:\n        statements.append(\n            _makeStarDictArgumentMergeToKwStatement(\n                result=result,\n                called_variable=called_variable,\n                kw_variable=kw_variable,\n                star_dict_variable=star_arg_dict_variable,\n            )\n        )\n    else:\n        statements.append(\n            _makeStarDictArgumentToDictStatement(\n                result=result,\n                called_variable=called_variable,\n                star_dict_variable=star_arg_dict_variable,\n            )\n        )\n\n    statements.append(\n        _makeStarListArgumentToTupleStatement(\n            called_variable=called_variable, star_list_variable=star_arg_list_variable\n        )\n    )\n\n    return statements\n\n\n@once_decorator\ndef getFunctionCallHelperStarListStarDict():\n    helper_name = \"complex_call_helper_star_list_star_dict\"\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"star_arg_list\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    statements = getDoubleStarArgsConversion(\n        result=result,\n        called_variable=called_variable,\n        star_arg_list_variable=star_arg_list_variable,\n        kw_variable=None,\n        star_arg_dict_variable=star_arg_dict_variable,\n    )\n\n    statements.append(\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=star_arg_list_variable, source_ref=internal_source_ref\n                ),\n                kw=ExpressionVariableRef(\n                    variable=star_arg_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    body = makeStatementsSequenceFromStatements(*statements)\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosStarListStarDict():\n    helper_name = \"complex_call_helper_pos_star_list_star_dict\"\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\", \"args\", \"star_arg_list\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    statements = getDoubleStarArgsConversion(\n        result=result,\n        called_variable=called_variable,\n        star_arg_list_variable=star_arg_list_variable,\n        kw_variable=None,\n        star_arg_dict_variable=star_arg_dict_variable,\n    )\n\n    if python_version >= 0x360:\n        statements.reverse()\n\n    statements.append(\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=makeBinaryOperationNode(\n                    operator=\"Add\",\n                    left=ExpressionVariableRef(\n                        variable=args_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionVariableRef(\n                        variable=star_arg_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                kw=ExpressionVariableRef(\n                    variable=star_arg_dict_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    body = makeStatementsSequenceFromStatements(*statements)\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperKeywordsStarListStarDict():\n    helper_name = \"complex_call_helper_keywords_star_list_star_dict\"\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=orderArgs(\"called\", \"kw\", \"star_arg_list\", \"star_arg_dict\"),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    statements = getDoubleStarArgsConversion(\n        result=result,\n        called_variable=called_variable,\n        star_arg_list_variable=star_arg_list_variable,\n        kw_variable=kw_variable,\n        star_arg_dict_variable=star_arg_dict_variable,\n    )\n\n    statements.append(\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=ExpressionVariableRef(\n                    variable=star_arg_list_variable, source_ref=internal_source_ref\n                ),\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    body = makeStatementsSequenceFromStatements(*statements)\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperPosKeywordsStarListStarDict():\n    helper_name = \"complex_call_helper_pos_keywords_star_list_star_dict\"\n\n    # Only need to check if the star argument value is a sequence and then\n    # convert to tuple.\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=orderArgs(\n                \"called\", \"args\", \"kw\", \"star_arg_list\", \"star_arg_dict\"\n            ),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    kw_variable = result.getVariableForAssignment(variable_name=\"kw\")\n\n    star_arg_list_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_list\"\n    )\n\n    star_arg_dict_variable = result.getVariableForAssignment(\n        variable_name=\"star_arg_dict\"\n    )\n\n    statements = getDoubleStarArgsConversion(\n        result=result,\n        called_variable=called_variable,\n        star_arg_list_variable=star_arg_list_variable,\n        kw_variable=kw_variable,\n        star_arg_dict_variable=star_arg_dict_variable,\n    )\n\n    if python_version >= 0x360:\n        statements.reverse()\n\n    statements.append(\n        StatementReturn(\n            expression=makeExpressionCall(\n                called=ExpressionVariableRef(\n                    variable=called_variable, source_ref=internal_source_ref\n                ),\n                args=makeBinaryOperationNode(\n                    operator=\"Add\",\n                    left=ExpressionVariableRef(\n                        variable=args_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionVariableRef(\n                        variable=star_arg_list_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                kw=ExpressionVariableRef(\n                    variable=kw_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    body = makeStatementsSequenceFromStatements(*statements)\n\n    result.setChildBody(body)\n\n    return result\n\n\n@once_decorator\ndef getFunctionCallHelperDictionaryUnpacking():\n    helper_name = \"complex_call_helper_dict_unpacking_checks\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"called\",),\n            ps_list_star_arg=\"args\",\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n    called_variable = result.getVariableForAssignment(variable_name=\"called\")\n\n    temp_scope = None\n\n    tmp_result_variable = result.allocateTempVariable(\n        temp_scope, \"dict\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"dicts_iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"args_item\", temp_type=\"object\"\n    )\n    tmp_iter2_variable = result.allocateTempVariable(\n        temp_scope, \"dict_iter\", temp_type=\"object\"\n    )\n    tmp_key_variable = result.allocateTempVariable(\n        temp_scope, \"dict_key\", temp_type=\"object\"\n    )\n\n    update_body = (\n        makeStatementConditional(\n            condition=ExpressionComparisonIsNot(\n                left=ExpressionBuiltinType1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_key_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                right=makeExpressionBuiltinTypeRef(\n                    builtin_name=\"str\", source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=_makeRaiseNoStringItem(called_variable=called_variable),\n            no_branch=None,\n            source_ref=internal_source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIn(\n                left=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                right=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=_makeRaiseDuplicationItem(\n                called_variable=called_variable, tmp_key_variable=tmp_key_variable\n            ),\n            no_branch=None,\n            source_ref=internal_source_ref,\n        ),\n        StatementDictOperationSetKeyValue(\n            dict_arg=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            key=ExpressionTempVariableRef(\n                variable=tmp_key_variable, source_ref=internal_source_ref\n            ),\n            value=ExpressionSubscriptLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=tmp_key_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    loop_body = (\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementsSequenceFromStatements(\n                makeStatementAssignmentVariable(\n                    variable=tmp_iter2_variable,\n                    source=ExpressionBuiltinIter1(\n                        value=makeCallNode(\n                            _makeNameAttributeLookup(\n                                ExpressionTempVariableRef(\n                                    variable=tmp_item_variable,\n                                    source_ref=internal_source_ref,\n                                ),\n                                attribute_name=\"keys\",\n                            ),\n                            internal_source_ref,\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                _makeIteratingLoopStatement(\n                    tmp_iter_variable=tmp_iter2_variable,\n                    tmp_item_variable=tmp_key_variable,\n                    statements=update_body,\n                ),\n            ),\n            exception_name=\"AttributeError\",\n            handler_body=_makeRaiseExceptionMustBeMapping(\n                called_variable=called_variable, star_dict_variable=tmp_item_variable\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    tried = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_result_variable,\n            source=makeConstantRefNode(constant={}, source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        _makeIteratingLoopStatement(\n            tmp_iter_variable=tmp_iter_variable,\n            tmp_item_variable=tmp_item_variable,\n            statements=loop_body,\n        ),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    body = makeStatementsSequenceFromStatement(\n        makeTryFinallyStatement(\n            provider=result,\n            tried=tried,\n            final=makeStatementsReleaseVariables(\n                variables=(\n                    tmp_result_variable,\n                    tmp_iter_variable,\n                    tmp_item_variable,\n                    tmp_iter2_variable,\n                    tmp_key_variable,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        )\n    )\n\n    result.setChildBody(body)\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/Extractions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Extracting visitors.\n\nThis is used for lookahead supporting abstract execution. We need to e.g.\nknow the variables written by a piece of code ahead of abstractly executing a\nloop.\n\"\"\"\n\nfrom .Operations import VisitorNoopMixin, visitTree\n\n\nclass VariableUsageUpdater(VisitorNoopMixin):\n    def __init__(self, old_variable, new_variable):\n        self.old_variable = old_variable\n        self.new_variable = new_variable\n\n    def onEnterNode(self, node):\n        if (\n            node.isStatementAssignmentVariable()\n            or node.isStatementDelVariable()\n            or node.isStatementReleaseVariable()\n        ):\n            if node.getVariable() is self.old_variable:\n                node.setVariable(self.new_variable)\n\n\ndef updateVariableUsage(provider, old_variable, new_variable):\n    visitor = VariableUsageUpdater(old_variable=old_variable, new_variable=new_variable)\n\n    visitTree(provider, visitor)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/InternalModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Internal module\n\nThis is a container for helper functions that are shared across modules. It\nmay not exist, and is treated specially in code generation. This avoids to\nown these functions to a random module.\n\nTODO: Clarify by renaming that the top module is now used, and these are\nmerely helpers to do it.\n\"\"\"\n\nfrom nuitka.ModuleRegistry import getRootTopModule\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionPureBody,\n    ExpressionFunctionPureInlineConstBody,\n)\nfrom nuitka.SourceCodeReferences import fromFilename\n\ninternal_source_ref = fromFilename(\"internal\").atInternal()\n\n\ndef once_decorator(func):\n    \"\"\"Cache result of a function call without arguments.\n\n    Used for all internal function accesses to become a singleton.\n\n    Note: This doesn't much specific anymore, but we are not having\n    this often enough to warrant reuse or generalization.\n\n    \"\"\"\n\n    func.cached_value = None\n\n    def replacement():\n        if func.cached_value is None:\n            func.cached_value = func()\n\n        return func.cached_value\n\n    return replacement\n\n\n@once_decorator\ndef getInternalModule():\n    \"\"\"Get the singleton internal module.\"\"\"\n\n    return getRootTopModule()\n\n\ndef makeInternalHelperFunctionBody(name, parameters, inline_const_args=False):\n    if inline_const_args:\n        node_class = ExpressionFunctionPureInlineConstBody\n    else:\n        node_class = ExpressionFunctionPureBody\n\n    result = node_class(\n        provider=getInternalModule(),\n        name=name,\n        code_object=None,\n        doc=None,\n        parameters=parameters,\n        flags=None,\n        auto_release=None,\n        source_ref=internal_source_ref,\n    )\n\n    for variable in parameters.getAllVariables():\n        result.removeVariableReleases(variable)\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/Operations.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Operations on the tree.\n\nThis is mostly for the different kinds of visits that the node tree can have.\nYou can visit a scope, a tree (module), or every scope of a tree (module).\n\n\"\"\"\n\n\ndef visitTree(tree, visitor):\n    visitor.onEnterNode(tree)\n\n    for visitable in tree.getVisitableNodes():\n        if visitable is None:\n            raise AssertionError(\"'None' child encountered\", tree, tree.source_ref)\n\n        visitTree(visitable, visitor)\n\n    visitor.onLeaveNode(tree)\n\n\nclass VisitorNoopMixin(object):\n    def onEnterNode(self, node):\n        \"\"\"Overloaded for operation before the node children were done.\"\"\"\n\n    def onLeaveNode(self, node):\n        \"\"\"Overloaded for operation after the node children were done.\"\"\"\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationAssertStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of assert statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.BuiltinRefNodes import ExpressionBuiltinExceptionRef\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTuple\nfrom nuitka.nodes.ExceptionNodes import StatementRaiseException\nfrom nuitka.nodes.OperatorNodesUnary import ExpressionOperationNot\nfrom nuitka.Options import hasPythonFlagNoAsserts\nfrom nuitka.PythonVersions import python_version\n\nfrom .TreeHelpers import buildNode\n\n\ndef buildAssertNode(provider, node, source_ref):\n    # Build assert statements. These are re-formulated as described in the\n    # Developer Manual too. They end up as conditional statement with raises of\n    # AssertionError exceptions.\n\n    # Underlying assumption:\n    #\n    # Assert x, y is the same as:\n    # if not x:\n    #     raise AssertionError, y\n\n    # Therefore assert statements are really just conditional statements with a\n    # static raise contained.\n    #\n\n    exception_value = buildNode(provider, node.msg, source_ref, True)\n\n    if hasPythonFlagNoAsserts():\n        return None\n\n    if exception_value is not None and python_version >= 0x272:\n        exception_value = makeExpressionMakeTuple(\n            elements=(exception_value,), source_ref=source_ref\n        )\n\n    raise_statement = StatementRaiseException(\n        exception_type=ExpressionBuiltinExceptionRef(\n            exception_name=\"AssertionError\", source_ref=source_ref\n        ),\n        exception_value=exception_value,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=source_ref,\n    )\n\n    return makeStatementConditional(\n        condition=ExpressionOperationNot(\n            operand=buildNode(provider, node.test, source_ref), source_ref=source_ref\n        ),\n        yes_branch=raise_statement,\n        no_branch=None,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationAssignmentStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of assignment statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.AttributeNodes import (\n    StatementAssignmentAttribute,\n    StatementDelAttribute,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinIteratorNodes import (\n    ExpressionBuiltinIter1,\n    ExpressionBuiltinIterForUnpack,\n    StatementSpecialUnpackCheck,\n)\nfrom nuitka.nodes.BuiltinLenNodes import ExpressionBuiltinLen\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionSpecialUnpack\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinList\nfrom nuitka.nodes.ComparisonNodes import makeComparisonExpression\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import (\n    ExpressionConstantEllipsisRef,\n    makeConstantRefNode,\n)\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTupleOrConstant\nfrom nuitka.nodes.InjectCNodes import (\n    StatementInjectCCode,\n    StatementInjectCDecl,\n)\nfrom nuitka.nodes.ListOperationNodes import ExpressionListOperationPop1\nfrom nuitka.nodes.NodeMakingHelpers import (\n    makeRaiseExceptionExpressionFromTemplate,\n)\nfrom nuitka.nodes.OperatorNodes import (\n    makeBinaryOperationNode,\n    makeExpressionOperationBinaryInplace,\n)\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.SliceNodes import (\n    ExpressionSliceLookup,\n    StatementAssignmentSlice,\n    StatementDelSlice,\n    makeExpressionBuiltinSlice,\n)\nfrom nuitka.nodes.SubscriptNodes import (\n    ExpressionSubscriptLookup,\n    StatementAssignmentSubscript,\n    StatementDelSubscript,\n)\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableDelNodes import makeStatementDelVariable\nfrom nuitka.nodes.VariableNameNodes import (\n    ExpressionVariableLocalNameRef,\n    ExpressionVariableNameRef,\n    StatementAssignmentVariableName,\n    StatementDelVariableName,\n)\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import (\n    makeStatementReleaseVariable,\n    makeStatementsReleaseVariables,\n)\nfrom nuitka.Options import hasPythonFlagNoAnnotations, isExperimental\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import general\n\nfrom .ReformulationImportStatements import getFutureSpec\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .SyntaxErrors import raiseSyntaxError\nfrom .TreeHelpers import (\n    buildAnnotationNode,\n    buildNode,\n    getKind,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n    makeStatementsSequenceOrStatement,\n    mangleName,\n)\n\n\ndef buildExtSliceNode(provider, node, source_ref):\n    elements = []\n\n    for dim in node.slice.dims:\n        dim_kind = getKind(dim)\n\n        if dim_kind == \"Slice\":\n            lower = buildNode(provider, dim.lower, source_ref, True)\n            upper = buildNode(provider, dim.upper, source_ref, True)\n            step = buildNode(provider, dim.step, source_ref, True)\n\n            element = makeExpressionBuiltinSlice(\n                start=lower, stop=upper, step=step, source_ref=source_ref\n            )\n        elif dim_kind == \"Ellipsis\":\n            element = ExpressionConstantEllipsisRef(source_ref=source_ref)\n        elif dim_kind == \"Index\":\n            element = buildNode(\n                provider=provider, node=dim.value, source_ref=source_ref\n            )\n        else:\n            assert False, dim\n\n        elements.append(element)\n\n    return makeExpressionMakeTupleOrConstant(\n        elements=tuple(elements), user_provided=True, source_ref=source_ref\n    )\n\n\ndef buildAssignmentStatementsFromDecoded(provider, kind, detail, source, source_ref):\n    # This is using many variable names on purpose, so as to give names to the\n    # unpacked detail values, and has many branches due to the many cases\n    # dealt with and it is return driven.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-return-statements,too-many-statements\n\n    if kind == \"Name\":\n        if detail in (\"_inject_c_code\", \"_inject_c_decl\") and isExperimental(\n            \"c-code-injection\"\n        ):\n            if not source.isExpressionConstantStrRef():\n                general.sysexit(\n                    \"Error, value assigned to '%s' not be constant str\" % detail\n                )\n\n            if detail == \"_inject_c_code\":\n                return StatementInjectCCode(\n                    c_code=source.getCompileTimeConstant(), source_ref=source_ref\n                )\n            else:\n                return StatementInjectCDecl(\n                    c_code=source.getCompileTimeConstant(), source_ref=source_ref\n                )\n\n        return StatementAssignmentVariableName(\n            provider=provider,\n            variable_name=detail,\n            source=source,\n            source_ref=source_ref,\n        )\n    elif kind == \"Attribute\":\n        lookup_source, attribute_name = detail\n\n        return StatementAssignmentAttribute(\n            expression=lookup_source,\n            attribute_name=mangleName(attribute_name, provider),\n            source=source,\n            source_ref=source_ref,\n        )\n    elif kind == \"Subscript\":\n        subscribed, subscript = detail\n\n        return StatementAssignmentSubscript(\n            subscribed=subscribed,\n            subscript=subscript,\n            source=source,\n            source_ref=source_ref,\n        )\n    elif kind == \"Slice\":\n        lookup_source, lower, upper = detail\n\n        # For Python3 there is no slicing operation, this is always done\n        # with subscript using a slice object. For Python2, it is only done\n        # if no \"step\" is provided.\n        use_slice_object = python_version >= 0x300\n\n        if use_slice_object:\n            return StatementAssignmentSubscript(\n                subscribed=lookup_source,\n                source=source,\n                subscript=makeExpressionBuiltinSlice(\n                    start=lower, stop=upper, step=None, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n\n        else:\n            return StatementAssignmentSlice(\n                expression=lookup_source,\n                lower=lower,\n                upper=upper,\n                source=source,\n                source_ref=source_ref,\n            )\n    elif kind == \"Tuple\":\n        temp_scope = provider.allocateTempScope(\"tuple_unpack\")\n\n        source_iter_var = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"source_iter\", temp_type=\"object\"\n        )\n\n        element_vars = [\n            provider.allocateTempVariable(\n                temp_scope=temp_scope,\n                name=\"element_%d\" % (element_index + 1),\n                temp_type=\"object\",\n            )\n            for element_index in range(len(detail))\n        ]\n\n        starred_list_var = None\n        starred_index = None\n\n        statements = []\n\n        for element_index, element in enumerate(detail):\n            if element[0] == \"Starred\":\n                if starred_index is not None:\n                    raiseSyntaxError(\n                        (\n                            \"two starred expressions in assignment\"\n                            if python_version < 0x390\n                            else \"multiple starred expressions in assignment\"\n                        ),\n                        source_ref.atColumnNumber(0),\n                    )\n\n                starred_index = element_index\n\n        for element_index, element in enumerate(detail):\n            element_var = element_vars[element_index]\n\n            if starred_list_var is not None:\n                statements.insert(\n                    starred_index + 1,\n                    makeStatementAssignmentVariable(\n                        variable=element_var,\n                        source=ExpressionListOperationPop1(\n                            list_arg=ExpressionTempVariableRef(\n                                variable=starred_list_var, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                )\n            elif element[0] != \"Starred\":\n                statements.append(\n                    makeStatementAssignmentVariable(\n                        variable=element_var,\n                        source=ExpressionSpecialUnpack(\n                            value=ExpressionTempVariableRef(\n                                variable=source_iter_var, source_ref=source_ref\n                            ),\n                            count=element_index + 1,\n                            expected=starred_index or len(detail),\n                            starred=starred_index is not None,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                )\n            else:\n                assert starred_index == element_index\n                starred_list_var = element_var\n\n                statements.append(\n                    makeStatementAssignmentVariable(\n                        variable=element_var,\n                        source=ExpressionBuiltinList(\n                            value=ExpressionTempVariableRef(\n                                variable=source_iter_var, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                )\n\n        if starred_list_var is None:\n            statements.append(\n                StatementSpecialUnpackCheck(\n                    iterator=ExpressionTempVariableRef(\n                        variable=source_iter_var, source_ref=source_ref\n                    ),\n                    count=len(detail),\n                    source_ref=source_ref,\n                )\n            )\n        else:\n            statements.insert(\n                starred_index + 1,\n                makeStatementConditional(\n                    condition=makeComparisonExpression(\n                        comparator=\"Lt\",\n                        left=ExpressionBuiltinLen(\n                            value=ExpressionTempVariableRef(\n                                variable=starred_list_var, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        right=makeConstantRefNode(\n                            constant=len(statements) - starred_index - 1,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    yes_branch=makeRaiseExceptionExpressionFromTemplate(\n                        exception_type=\"ValueError\",\n                        template=\"\"\"\\\nnot enough values to unpack (expected at least %d, got %%d)\"\"\"\n                        % (len(statements) - 1),\n                        template_args=makeBinaryOperationNode(\n                            operator=\"Add\",\n                            left=ExpressionBuiltinLen(\n                                value=ExpressionTempVariableRef(\n                                    variable=starred_list_var, source_ref=source_ref\n                                ),\n                                source_ref=source_ref,\n                            ),\n                            right=makeConstantRefNode(\n                                constant=starred_index, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ).asStatement(),\n                    no_branch=None,\n                    source_ref=source_ref,\n                ),\n            )\n\n        if python_version >= 0x370:\n            iter_creation_class = ExpressionBuiltinIterForUnpack\n        else:\n            iter_creation_class = ExpressionBuiltinIter1\n\n        statements = [\n            makeStatementAssignmentVariable(\n                variable=source_iter_var,\n                source=iter_creation_class(value=source, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            makeTryFinallyStatement(\n                provider=provider,\n                tried=statements,\n                final=(\n                    makeStatementReleaseVariable(\n                        variable=source_iter_var, source_ref=source_ref\n                    ),\n                ),\n                source_ref=source_ref,\n            ),\n        ]\n\n        # When all is done, copy over to the actual assignment targets, starred\n        # or not makes no difference here anymore.\n        for element_index, element in enumerate(detail):\n            if element[0] == \"Starred\":\n                element = element[1]\n\n            element_var = element_vars[element_index]\n\n            statements.append(\n                buildAssignmentStatementsFromDecoded(\n                    provider=provider,\n                    kind=element[0],\n                    detail=element[1],\n                    source=ExpressionTempVariableRef(\n                        variable=element_var, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n            # Need to release temporary variables right after successful\n            # usage.\n            statements.append(\n                makeStatementDelVariable(\n                    variable=element_var, tolerant=True, source_ref=source_ref\n                )\n            )\n\n        final_statements = []\n\n        for element_var in element_vars:\n            final_statements.append(\n                makeStatementReleaseVariable(\n                    variable=element_var, source_ref=source_ref\n                )\n            )\n\n        return makeTryFinallyStatement(\n            provider=provider,\n            tried=statements,\n            final=final_statements,\n            source_ref=source_ref,\n        )\n    elif kind == \"Starred\":\n        raiseSyntaxError(\n            \"starred assignment target must be in a list or tuple\",\n            source_ref.atColumnNumber(0),\n        )\n    else:\n        assert False, (kind, source_ref, detail)\n\n\ndef buildAssignmentStatements(\n    provider, node, source, source_ref, allow_none=False, temp_provider=None\n):\n    if node is None and allow_none:\n        return None\n\n    if temp_provider is None:\n        temp_provider = provider\n\n    kind, detail = decodeAssignTarget(\n        provider=provider, node=node, source_ref=source_ref\n    )\n\n    return buildAssignmentStatementsFromDecoded(\n        provider=provider,\n        kind=kind,\n        detail=detail,\n        source=source,\n        source_ref=source_ref,\n    )\n\n\ndef decodeAssignTarget(provider, node, source_ref, allow_none=False):\n    # Many cases to deal with, because of the different assign targets,\n    # pylint: disable=too-many-branches,too-many-return-statements\n\n    if node is None and allow_none:\n        return None\n\n    if type(node) is str:\n        return \"Name\", mangleName(node, provider)\n\n    kind = getKind(node)\n\n    if hasattr(node, \"ctx\"):\n        assert getKind(node.ctx) in (\"Store\", \"Del\")\n\n    if kind == \"Name\":\n        return kind, mangleName(node.id, provider)\n    elif kind == \"Attribute\":\n        return kind, (buildNode(provider, node.value, source_ref), node.attr)\n    elif kind == \"Subscript\":\n        slice_kind = getKind(node.slice)\n\n        if slice_kind == \"Index\":\n            return (\n                \"Subscript\",\n                (\n                    buildNode(provider, node.value, source_ref),\n                    buildNode(provider, node.slice.value, source_ref),\n                ),\n            )\n        elif slice_kind == \"Slice\":\n            lower = buildNode(provider, node.slice.lower, source_ref, True)\n            upper = buildNode(provider, node.slice.upper, source_ref, True)\n\n            if node.slice.step is not None:\n                step = buildNode(provider, node.slice.step, source_ref)\n\n                return (\n                    \"Subscript\",\n                    (\n                        buildNode(provider, node.value, source_ref),\n                        makeExpressionBuiltinSlice(\n                            start=lower, stop=upper, step=step, source_ref=source_ref\n                        ),\n                    ),\n                )\n            else:\n                return (\n                    \"Slice\",\n                    (buildNode(provider, node.value, source_ref), lower, upper),\n                )\n        elif slice_kind == \"ExtSlice\":\n            return (\n                \"Subscript\",\n                (\n                    buildNode(provider, node.value, source_ref),\n                    buildExtSliceNode(provider, node, source_ref),\n                ),\n            )\n        elif slice_kind == \"Ellipsis\":\n            return (\n                \"Subscript\",\n                (\n                    buildNode(provider, node.value, source_ref),\n                    ExpressionConstantEllipsisRef(source_ref=source_ref),\n                ),\n            )\n        elif python_version >= 0x390:\n            return (\n                \"Subscript\",\n                (\n                    buildNode(provider, node.value, source_ref),\n                    buildNode(provider, node.slice, source_ref),\n                ),\n            )\n        else:\n            assert False, slice_kind\n    elif kind in (\"Tuple\", \"List\"):\n        return (\n            \"Tuple\",\n            tuple(\n                decodeAssignTarget(\n                    provider=provider,\n                    node=sub_node,\n                    source_ref=source_ref,\n                    allow_none=False,\n                )\n                for sub_node in node.elts\n            ),\n        )\n    elif kind == \"Starred\":\n        return (\n            \"Starred\",\n            decodeAssignTarget(\n                provider=provider,\n                node=node.value,\n                source_ref=source_ref,\n                allow_none=False,\n            ),\n        )\n    else:\n        assert False, (source_ref, kind)\n\n\ndef buildAssignNode(provider, node, source_ref):\n    assert len(node.targets) >= 1, source_ref\n\n    # Evaluate the right hand side first, so it can get names provided\n    # before the left hand side exists.\n    source = buildNode(provider, node.value, source_ref)\n\n    if len(node.targets) == 1:\n        # Simple assignment case, one source, one target.\n\n        return buildAssignmentStatements(\n            provider=provider,\n            node=node.targets[0],\n            source=source,\n            source_ref=source_ref,\n        )\n    else:\n        # Complex assignment case, one source, but multiple targets. We keep the\n        # source in a temporary variable, and then assign from it multiple\n        # times.\n\n        temp_scope = provider.allocateTempScope(\"assign_unpack\")\n\n        tmp_source = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"assign_source\", temp_type=\"object\"\n        )\n\n        statements = [\n            makeStatementAssignmentVariable(\n                variable=tmp_source, source=source, source_ref=source_ref\n            )\n        ]\n\n        for target in node.targets:\n            statements.append(\n                buildAssignmentStatements(\n                    provider=provider,\n                    node=target,\n                    source=ExpressionTempVariableRef(\n                        variable=tmp_source, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n        return makeTryFinallyStatement(\n            provider=provider,\n            tried=statements,\n            final=makeStatementReleaseVariable(\n                variable=tmp_source, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n\n\ndef buildAnnAssignNode(provider, node, source_ref):\n    \"\"\"Python3.6 annotation assignment.\"\"\"\n    # There are many cases to deal with here.\n\n    if provider.isCompiledPythonModule() or provider.isExpressionClassBodyBase():\n        provider.markAsNeedsAnnotationsDictionary()\n\n    # Evaluate the right hand side first, so it can get names provided\n    # before the left hand side exists.\n    statements = []\n\n    if node.value is not None:\n        source = buildNode(provider, node.value, source_ref)\n\n        statements.append(\n            buildAssignmentStatements(\n                provider=provider,\n                node=node.target,\n                source=source,\n                source_ref=source_ref,\n            )\n        )\n\n        # Only name referencing annotations are effective right now.\n        if statements[-1].isStatementAssignmentVariableName():\n            variable_name = statements[-1].getVariableName()\n        else:\n            variable_name = None\n    else:\n        # Only name referencing annotations are effective right now.\n        kind, detail = decodeAssignTarget(\n            provider=provider, node=node.target, source_ref=source_ref\n        )\n\n        if kind == \"Name\":\n            variable_name = detail\n        else:\n            variable_name = None\n\n    # Only annotations for modules and classes are really made, for functions\n    # they are ignored like comments.\n    if variable_name is not None:\n        if not hasPythonFlagNoAnnotations() and (\n            provider.isExpressionClassBodyBase() or provider.isCompiledPythonModule()\n        ):\n            annotation = buildAnnotationNode(provider, node.annotation, source_ref)\n\n            # TODO: As CPython core considers this implementation detail, and it seems\n            # mostly useless to support having this as a closure taken name after a\n            # __del__ on annotations, we might do this except in full compat mode. It\n            # will produce only noise for all annotations in classes otherwise.\n            if python_version < 0x370:\n                ref_class = ExpressionVariableLocalNameRef\n            else:\n                ref_class = ExpressionVariableNameRef\n\n            statements.append(\n                StatementAssignmentSubscript(\n                    subscribed=ref_class(\n                        provider=provider,\n                        variable_name=\"__annotations__\",\n                        source_ref=source_ref,\n                    ),\n                    subscript=makeConstantRefNode(\n                        constant=variable_name, source_ref=source_ref\n                    ),\n                    source=annotation,\n                    source_ref=source_ref,\n                )\n            )\n        else:\n            # Functions or disabled.\n            if node.simple:\n                provider.getVariableForAssignment(variable_name)\n\n    return makeStatementsSequence(\n        statements=statements, allow_none=True, source_ref=source_ref\n    )\n\n\ndef buildDeleteStatementFromDecoded(provider, kind, detail, source_ref):\n    # This function is a case driven by returns, pylint: disable=too-many-return-statements\n\n    if kind in (\"Name\", \"Name_Exception\"):\n        # Note: Name_Exception is a \"del\" for exception handlers that doesn't\n        # insist on the variable being defined, user code may do it too, and\n        # that will be fine, so make that tolerant.\n        return StatementDelVariableName(\n            provider=provider,\n            variable_name=detail,\n            tolerant=kind == \"Name_Exception\",\n            source_ref=source_ref,\n        )\n    elif kind == \"Attribute\":\n        lookup_source, attribute_name = detail\n\n        return StatementDelAttribute(\n            expression=lookup_source,\n            attribute_name=mangleName(attribute_name, provider),\n            source_ref=source_ref,\n        )\n    elif kind == \"Subscript\":\n        subscribed, subscript = detail\n\n        return StatementDelSubscript(\n            subscribed=subscribed, subscript=subscript, source_ref=source_ref\n        )\n    elif kind == \"Slice\":\n        lookup_source, lower, upper = detail\n\n        use_slice_object = python_version >= 0x300\n\n        if use_slice_object:\n            return StatementDelSubscript(\n                subscribed=lookup_source,\n                subscript=makeExpressionBuiltinSlice(\n                    start=lower, stop=upper, step=None, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        else:\n            return StatementDelSlice(\n                expression=lookup_source,\n                lower=lower,\n                upper=upper,\n                source_ref=source_ref,\n            )\n    elif kind == \"Tuple\":\n        result = []\n\n        for sub_node in detail:\n            result.append(\n                buildDeleteStatementFromDecoded(\n                    provider=provider,\n                    kind=sub_node[0],\n                    detail=sub_node[1],\n                    source_ref=source_ref,\n                )\n            )\n\n        if result:\n            return makeStatementsSequenceOrStatement(\n                statements=result, source_ref=source_ref\n            )\n        else:\n            return None\n    else:\n        assert False, (kind, detail, source_ref)\n\n\ndef buildDeleteNode(provider, node, source_ref):\n    # Build \"del\" statements.\n\n    # Note: Each delete is sequential. It can succeed, and the failure of a\n    # later one does not prevent the former to succeed. We can therefore have a\n    # simple sequence of \"del\" statements that each only delete one thing\n    # therefore. In output tree \"del\" therefore only ever has single arguments.\n\n    statements = []\n\n    for target in node.targets:\n        kind, detail = decodeAssignTarget(\n            provider=provider, node=target, source_ref=source_ref\n        )\n\n        statements.append(\n            buildDeleteStatementFromDecoded(\n                provider=provider, kind=kind, detail=detail, source_ref=source_ref\n            )\n        )\n\n    return makeStatementsSequenceOrStatement(\n        statements=statements, source_ref=source_ref\n    )\n\n\ndef _buildInplaceAssignVariableNode(\n    provider, variable_name, operator, expression, source_ref\n):\n    inplace_node = makeExpressionOperationBinaryInplace(\n        operator=operator,\n        left=ExpressionVariableNameRef(\n            provider=provider, variable_name=variable_name, source_ref=source_ref\n        ),\n        right=expression,\n        source_ref=source_ref,\n    )\n\n    inplace_node.markAsInplaceSuspect()\n\n    return (\n        StatementAssignmentVariableName(\n            provider=provider,\n            variable_name=variable_name,\n            source=inplace_node,\n            source_ref=source_ref,\n        ),\n    )\n\n\ndef _buildInplaceAssignAttributeNode(\n    provider, lookup_source, attribute_name, operator, expression, source_ref\n):\n    temp_scope = provider.allocateTempScope(\"inplace_assign\")\n\n    tmp_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"value\", temp_type=\"object\"\n    )\n\n    # First assign the target value to a temporary variable.\n    preserve_to_tmp = makeStatementAssignmentVariable(\n        variable=tmp_variable,\n        source=makeExpressionAttributeLookup(\n            expression=lookup_source.makeClone(),\n            attribute_name=attribute_name,\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n    # Second assign the in-place result to a temporary variable\n    inplace_to_tmp = makeStatementAssignmentVariable(\n        variable=tmp_variable,\n        source=makeExpressionOperationBinaryInplace(\n            operator=operator,\n            left=ExpressionTempVariableRef(\n                variable=tmp_variable, source_ref=source_ref\n            ),\n            right=expression,\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n    # Third, copy it back.\n    copy_back_from_tmp = StatementAssignmentAttribute(\n        expression=lookup_source.makeClone(),\n        attribute_name=attribute_name,\n        source=ExpressionTempVariableRef(variable=tmp_variable, source_ref=source_ref),\n        source_ref=source_ref,\n    )\n\n    return (\n        preserve_to_tmp,\n        # making sure the above temporary variable is deleted in any case.\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=(inplace_to_tmp, copy_back_from_tmp),\n            final=makeStatementReleaseVariable(\n                variable=tmp_variable, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n\ndef _buildInplaceAssignSubscriptNode(\n    provider,\n    subscribed,\n    subscript,\n    tmp_variable1,\n    tmp_variable2,\n    tmp_variable3,\n    operator,\n    expression,\n    source_ref,\n):\n    # First assign the subscribed value to a temporary variable.\n    preserve_to_tmp1 = makeStatementAssignmentVariable(\n        variable=tmp_variable1, source=subscribed, source_ref=source_ref\n    )\n    # Second assign the subscript value to a temporary variable\n    statements = (\n        makeStatementAssignmentVariable(\n            variable=tmp_variable2, source=subscript, source_ref=source_ref\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_variable3,\n            source=ExpressionSubscriptLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_variable1, source_ref=source_ref\n                ),\n                subscript=ExpressionTempVariableRef(\n                    variable=tmp_variable2, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_variable3,\n            source=makeExpressionOperationBinaryInplace(\n                operator=operator,\n                left=ExpressionTempVariableRef(\n                    variable=tmp_variable3, source_ref=source_ref\n                ),\n                right=expression,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        StatementAssignmentSubscript(\n            subscribed=ExpressionTempVariableRef(\n                variable=tmp_variable1, source_ref=source_ref\n            ),\n            subscript=ExpressionTempVariableRef(\n                variable=tmp_variable2, source_ref=source_ref\n            ),\n            source=ExpressionTempVariableRef(\n                variable=tmp_variable3, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    return (\n        preserve_to_tmp1,\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=statements,\n            final=makeStatementsReleaseVariables(\n                variables=(tmp_variable1, tmp_variable2, tmp_variable3),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n\ndef _buildInplaceAssignSliceNode(\n    provider,\n    lookup_source,\n    lower,\n    upper,\n    tmp_variable1,\n    tmp_variable2,\n    tmp_variable3,\n    tmp_variable4,\n    operator,\n    expression,\n    source_ref,\n):\n    # Due to the 3 inputs, which we need to also put into temporary variables,\n    # there are too many variables here, but they are needed.\n    # pylint: disable=too-many-locals\n\n    # First assign the target value, lower and upper to temporary variables.\n    copy_to_tmp = makeStatementAssignmentVariable(\n        variable=tmp_variable1, source=lookup_source, source_ref=source_ref\n    )\n\n    final_statements = [\n        makeStatementReleaseVariable(variable=tmp_variable1, source_ref=source_ref)\n    ]\n    statements = []\n\n    if lower is not None:\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=tmp_variable2, source=lower, source_ref=source_ref\n            )\n        )\n        final_statements.append(\n            makeStatementReleaseVariable(variable=tmp_variable2, source_ref=source_ref)\n        )\n\n        lower_ref1 = ExpressionTempVariableRef(\n            variable=tmp_variable2, source_ref=source_ref\n        )\n        lower_ref2 = ExpressionTempVariableRef(\n            variable=tmp_variable2, source_ref=source_ref\n        )\n    else:\n        assert tmp_variable2 is None\n\n        lower_ref1 = lower_ref2 = None\n\n    if upper is not None:\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=tmp_variable3, source=upper, source_ref=source_ref\n            )\n        )\n        final_statements.append(\n            makeStatementReleaseVariable(variable=tmp_variable3, source_ref=source_ref)\n        )\n\n        upper_ref1 = ExpressionTempVariableRef(\n            variable=tmp_variable3, source_ref=source_ref\n        )\n        upper_ref2 = ExpressionTempVariableRef(\n            variable=tmp_variable3, source_ref=source_ref\n        )\n    else:\n        assert tmp_variable3 is None\n\n        upper_ref1 = upper_ref2 = None\n\n    use_slice_object = python_version >= 0x300\n\n    # Second assign the in-place result over the original value.\n    if use_slice_object:\n        statements += (\n            makeStatementAssignmentVariable(\n                variable=tmp_variable4,\n                source=ExpressionSubscriptLookup(\n                    expression=ExpressionTempVariableRef(\n                        variable=tmp_variable1, source_ref=source_ref\n                    ),\n                    subscript=makeExpressionBuiltinSlice(\n                        start=lower_ref2,\n                        stop=upper_ref2,\n                        step=None,\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            makeStatementAssignmentVariable(\n                variable=tmp_variable4,\n                source=makeExpressionOperationBinaryInplace(\n                    operator=operator,\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_variable4, source_ref=source_ref\n                    ),\n                    right=expression,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            StatementAssignmentSubscript(\n                subscribed=ExpressionTempVariableRef(\n                    variable=tmp_variable1, source_ref=source_ref\n                ),\n                subscript=makeExpressionBuiltinSlice(\n                    start=lower_ref1, stop=upper_ref1, step=None, source_ref=source_ref\n                ),\n                source=ExpressionTempVariableRef(\n                    variable=tmp_variable4, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n        )\n    else:\n        statements += (\n            makeStatementAssignmentVariable(\n                variable=tmp_variable4,\n                source=ExpressionSliceLookup(\n                    expression=ExpressionTempVariableRef(\n                        variable=tmp_variable1, source_ref=source_ref\n                    ),\n                    lower=lower_ref2,\n                    upper=upper_ref2,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            makeStatementAssignmentVariable(\n                variable=tmp_variable4,\n                source=makeExpressionOperationBinaryInplace(\n                    operator=operator,\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_variable4, source_ref=source_ref\n                    ),\n                    right=expression,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            StatementAssignmentSlice(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_variable1, source_ref=source_ref\n                ),\n                lower=lower_ref1,\n                upper=upper_ref1,\n                source=ExpressionTempVariableRef(\n                    variable=tmp_variable4, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n        )\n\n    final_statements.append(\n        makeStatementReleaseVariable(variable=tmp_variable4, source_ref=source_ref)\n    )\n\n    return (\n        copy_to_tmp,\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=statements,\n            final=final_statements,\n            source_ref=source_ref,\n        ),\n    )\n\n\ndef buildInplaceAssignNode(provider, node, source_ref):\n    # There are many inplace assignment variables, and the detail is unpacked\n    # into names, so we end up with a lot of variables, which is on purpose,\n    # pylint: disable=too-many-locals\n\n    operator = getKind(node.op)\n\n    operator = \"I\" + operator\n    if operator == \"IDiv\":\n        operator = \"ITrueDiv\" if getFutureSpec().isFutureDivision() else \"IOldDiv\"\n\n    expression = buildNode(provider, node.value, source_ref)\n\n    kind, detail = decodeAssignTarget(\n        provider=provider, node=node.target, source_ref=source_ref\n    )\n\n    if kind == \"Name\":\n        statements = _buildInplaceAssignVariableNode(\n            provider=provider,\n            variable_name=detail,\n            operator=operator,\n            expression=expression,\n            source_ref=source_ref,\n        )\n    elif kind == \"Attribute\":\n        lookup_source, attribute_name = detail\n\n        statements = _buildInplaceAssignAttributeNode(\n            provider=provider,\n            lookup_source=lookup_source,\n            attribute_name=mangleName(attribute_name, provider),\n            operator=operator,\n            expression=expression,\n            source_ref=source_ref,\n        )\n    elif kind == \"Subscript\":\n        subscribed, subscript = detail\n\n        temp_scope = provider.allocateTempScope(\"inplace_assign_subscr\")\n\n        tmp_variable1 = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"target\", temp_type=\"object\"\n        )\n        tmp_variable2 = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"subscript\", temp_type=\"object\"\n        )\n        tmp_variable3 = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"value\", temp_type=\"object\"\n        )\n\n        statements = _buildInplaceAssignSubscriptNode(\n            provider=provider,\n            subscribed=subscribed,\n            subscript=subscript,\n            tmp_variable1=tmp_variable1,\n            tmp_variable2=tmp_variable2,\n            tmp_variable3=tmp_variable3,\n            operator=operator,\n            expression=expression,\n            source_ref=source_ref,\n        )\n    elif kind == \"Slice\":\n        lookup_source, lower, upper = detail\n\n        temp_scope = provider.allocateTempScope(\"inplace_assign_slice\")\n\n        tmp_variable1 = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"target\", temp_type=\"object\"\n        )\n        if lower is not None:\n            tmp_variable2 = provider.allocateTempVariable(\n                temp_scope=temp_scope, name=\"lower\", temp_type=\"object\"\n            )\n        else:\n            tmp_variable2 = None\n\n        if upper is not None:\n            tmp_variable3 = provider.allocateTempVariable(\n                temp_scope=temp_scope, name=\"upper\", temp_type=\"object\"\n            )\n        else:\n            tmp_variable3 = None\n\n        tmp_variable4 = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"value\", temp_type=\"object\"\n        )\n\n        statements = _buildInplaceAssignSliceNode(\n            provider=provider,\n            lookup_source=lookup_source,\n            lower=lower,\n            upper=upper,\n            tmp_variable1=tmp_variable1,\n            tmp_variable2=tmp_variable2,\n            tmp_variable3=tmp_variable3,\n            tmp_variable4=tmp_variable4,\n            operator=operator,\n            expression=expression,\n            source_ref=source_ref,\n        )\n    else:\n        assert False, kind\n\n    return makeStatementsSequenceFromStatements(*statements)\n\n\ndef buildNamedExprNode(provider, node, source_ref):\n    \"\"\"Assignment expressions, Python3.8 or higher only.\"\"\"\n\n    outline_body = ExpressionOutlineBody(\n        provider=provider, name=\"assignment_expr\", source_ref=source_ref\n    )\n\n    tmp_value = outline_body.allocateTempVariable(\n        temp_scope=None, name=\"value\", temp_type=\"object\"\n    )\n\n    value = buildNode(provider=provider, node=node.value, source_ref=source_ref)\n\n    locals_owner = provider\n    while locals_owner.isExpressionOutlineFunction():\n        locals_owner = locals_owner.getParentVariableProvider()\n\n    variable_name = node.target.id\n\n    if (\n        locals_owner.isExpressionGeneratorObjectBody()\n        and locals_owner.name == \"<genexpr>\"\n    ):\n        locals_owner.addNonlocalsDeclaration(\n            (variable_name,), user_provided=False, source_ref=source_ref\n        )\n\n    statements = (\n        makeStatementAssignmentVariable(\n            variable=tmp_value, source=value, source_ref=source_ref\n        ),\n        StatementAssignmentVariableName(\n            provider=locals_owner,\n            variable_name=variable_name,\n            source=ExpressionTempVariableRef(variable=tmp_value, source_ref=source_ref),\n            source_ref=source_ref,\n        ),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_value, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    outline_body.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=makeTryFinallyStatement(\n                provider=provider,\n                tried=statements,\n                final=makeStatementReleaseVariable(\n                    variable=tmp_value, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        )\n    )\n\n    return outline_body\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationBooleanExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of boolean and/or expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditionalAnd,\n    ExpressionConditionalOr,\n    makeNotExpression,\n)\n\nfrom .TreeHelpers import buildNode, buildNodeList, getKind\n\n\ndef buildBoolOpNode(provider, node, source_ref):\n    bool_op = getKind(node.op)\n\n    if bool_op == \"Or\":\n        # The \"or\" may be short circuit and is therefore not a plain operation.\n        values = buildNodeList(provider, node.values, source_ref)\n\n        for value in values[:-1]:\n            value.setCompatibleSourceReference(values[-1].getSourceReference())\n\n        source_ref = values[-1].getSourceReference()\n\n        return makeOrNode(values=values, source_ref=source_ref)\n\n    elif bool_op == \"And\":\n        # The \"and\" may be short circuit and is therefore not a plain operation.\n        values = buildNodeList(provider, node.values, source_ref)\n\n        for value in values[:-1]:\n            value.setCompatibleSourceReference(values[-1].getSourceReference())\n\n        source_ref = values[-1].getSourceReference()\n\n        return makeAndNode(values=values, source_ref=source_ref)\n    elif bool_op == \"Not\":\n        # The \"not\" is really only a unary operation and no special.\n        return makeNotExpression(\n            expression=buildNode(provider, node.operand, source_ref)\n        )\n    else:\n        assert False, bool_op\n\n\ndef makeOrNode(values, source_ref):\n    values = list(values)\n\n    result = values.pop()\n\n    # When we encounter, \"or\", we expect it to be at least two values.\n    assert values\n\n    while values:\n        result = ExpressionConditionalOr(\n            left=values.pop(), right=result, source_ref=source_ref\n        )\n\n    return result\n\n\ndef makeAndNode(values, source_ref):\n    values = list(values)\n\n    result = values.pop()\n\n    # Unlike \"or\", for \"and\", this is used with only one value.\n\n    while values:\n        result = ExpressionConditionalAnd(\n            left=values.pop(), right=result, source_ref=source_ref\n        )\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationCallExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of call expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import (\n    makeExpressionMakeTuple,\n    makeExpressionMakeTupleOrConstant,\n)\nfrom nuitka.nodes.DictionaryNodes import makeExpressionMakeDictOrConstant\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCall,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.KeyValuePairNodes import makeExpressionPairs\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.PythonVersions import python_version\n\nfrom .ComplexCallHelperFunctions import (\n    getFunctionCallHelperDictionaryUnpacking,\n    getFunctionCallHelperKeywordsStarDict,\n    getFunctionCallHelperKeywordsStarList,\n    getFunctionCallHelperKeywordsStarListStarDict,\n    getFunctionCallHelperPosKeywordsStarDict,\n    getFunctionCallHelperPosKeywordsStarList,\n    getFunctionCallHelperPosKeywordsStarListStarDict,\n    getFunctionCallHelperPosStarDict,\n    getFunctionCallHelperPosStarList,\n    getFunctionCallHelperPosStarListStarDict,\n    getFunctionCallHelperStarDict,\n    getFunctionCallHelperStarList,\n    getFunctionCallHelperStarListStarDict,\n)\nfrom .ReformulationDictionaryCreation import buildDictionaryUnpackingArgs\nfrom .ReformulationSequenceCreation import buildListUnpacking\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    getKind,\n    makeStatementsSequenceFromStatements,\n)\n\n\ndef buildCallNode(provider, node, source_ref):\n    called = buildNode(provider, node.func, source_ref)\n\n    if python_version >= 0x350:\n        list_star_arg = None\n        dict_star_arg = None\n\n    positional_args = []\n\n    # For Python3.5 compatibility, the error handling with star argument last\n    # is the old one, only with a starred argument before that, things use the\n    # new unpacking code.\n    for node_arg in node.args[:-1]:\n        if getKind(node_arg) == \"Starred\":\n            assert python_version >= 0x350\n            list_star_arg = buildListUnpacking(provider, node.args, source_ref)\n            positional_args = ()\n            break\n    else:\n        if node.args and getKind(node.args[-1]) == \"Starred\":\n            assert python_version >= 0x350\n\n            list_star_arg = buildNode(provider, node.args[-1].value, source_ref)\n            positional_args = buildNodeTuple(provider, node.args[:-1], source_ref)\n        else:\n            positional_args = buildNodeTuple(provider, node.args, source_ref)\n\n    # Only the values of keyword pairs have a real source ref, and those only\n    # really matter, so that makes sense.\n    keys = []\n    values = []\n\n    for keyword in node.keywords[:-1]:\n        if keyword.arg is None:\n            assert python_version >= 0x350\n\n            outline_body = ExpressionOutlineBody(\n                provider=provider, name=\"dict_unpacking_call\", source_ref=source_ref\n            )\n\n            tmp_called = outline_body.allocateTempVariable(\n                temp_scope=None, name=\"called\", temp_type=\"object\"\n            )\n\n            helper_args = [\n                ExpressionTempVariableRef(variable=tmp_called, source_ref=source_ref),\n                makeExpressionMakeTuple(\n                    elements=buildDictionaryUnpackingArgs(\n                        provider=provider,\n                        keys=(keyword.arg for keyword in node.keywords),\n                        values=(keyword.value for keyword in node.keywords),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                ),\n            ]\n\n            dict_star_arg = makeExpressionFunctionCall(\n                function=makeExpressionFunctionCreation(\n                    function_ref=ExpressionFunctionRef(\n                        function_body=getFunctionCallHelperDictionaryUnpacking(),\n                        source_ref=source_ref,\n                    ),\n                    defaults=(),\n                    kw_defaults=None,\n                    annotations=None,\n                    source_ref=source_ref,\n                ),\n                values=helper_args,\n                source_ref=source_ref,\n            )\n\n            outline_body.setChildBody(\n                makeStatementsSequenceFromStatements(\n                    makeStatementAssignmentVariable(\n                        variable=tmp_called, source=called, source_ref=source_ref\n                    ),\n                    StatementReturn(\n                        expression=_makeCallNode(\n                            called=ExpressionTempVariableRef(\n                                variable=tmp_called, source_ref=source_ref\n                            ),\n                            positional_args=positional_args,\n                            keys=keys,\n                            values=values,\n                            list_star_arg=list_star_arg,\n                            dict_star_arg=dict_star_arg,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                )\n            )\n\n            return outline_body\n\n    # For Python3.5 compatibility, the error handling with star argument last\n    # is the old one, only with a starred argument before that, things use the\n    # new unpacking code.\n\n    if node.keywords and node.keywords[-1].arg is None:\n        assert python_version >= 0x350\n\n        dict_star_arg = buildNode(provider, node.keywords[-1].value, source_ref)\n        keywords = node.keywords[:-1]\n    else:\n        keywords = node.keywords\n\n    for keyword in keywords:\n        keys.append(\n            makeConstantRefNode(\n                constant=keyword.arg, source_ref=source_ref, user_provided=True\n            )\n        )\n        values.append(buildNode(provider, keyword.value, source_ref))\n\n    if python_version < 0x350:\n        list_star_arg = buildNode(provider, node.starargs, source_ref, True)\n        dict_star_arg = buildNode(provider, node.kwargs, source_ref, True)\n\n    return _makeCallNode(\n        called=called,\n        positional_args=positional_args,\n        keys=keys,\n        values=values,\n        list_star_arg=list_star_arg,\n        dict_star_arg=dict_star_arg,\n        source_ref=source_ref,\n    )\n\n\ndef _makeCallNode(\n    called, positional_args, keys, values, list_star_arg, dict_star_arg, source_ref\n):\n    # Many variables, but only to cover the many complex call cases.\n\n    if list_star_arg is None and dict_star_arg is None:\n        result = makeExpressionCall(\n            called=called,\n            args=makeExpressionMakeTupleOrConstant(\n                elements=positional_args,\n                user_provided=True,\n                source_ref=source_ref,\n            ),\n            kw=makeExpressionMakeDictOrConstant(\n                makeExpressionPairs(keys=keys, values=values),\n                user_provided=True,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        # Bug compatible line numbers before Python 3.8\n        if python_version < 0x380:\n            if values:\n                result.setCompatibleSourceReference(\n                    source_ref=values[-1].getCompatibleSourceReference()\n                )\n            elif positional_args:\n                result.setCompatibleSourceReference(\n                    source_ref=positional_args[-1].getCompatibleSourceReference()\n                )\n\n        return result\n    else:\n        # Dispatch to complex helper function for each case. These do\n        # re-formulation of complex calls according to Developer Manual.\n\n        key = (\n            bool(positional_args),\n            bool(keys),\n            list_star_arg is not None,\n            dict_star_arg is not None,\n        )\n\n        table = {\n            (True, True, True, False): getFunctionCallHelperPosKeywordsStarList,\n            (True, False, True, False): getFunctionCallHelperPosStarList,\n            (False, True, True, False): getFunctionCallHelperKeywordsStarList,\n            (False, False, True, False): getFunctionCallHelperStarList,\n            (True, True, False, True): getFunctionCallHelperPosKeywordsStarDict,\n            (True, False, False, True): getFunctionCallHelperPosStarDict,\n            (False, True, False, True): getFunctionCallHelperKeywordsStarDict,\n            (False, False, False, True): getFunctionCallHelperStarDict,\n            (True, True, True, True): getFunctionCallHelperPosKeywordsStarListStarDict,\n            (True, False, True, True): getFunctionCallHelperPosStarListStarDict,\n            (False, True, True, True): getFunctionCallHelperKeywordsStarListStarDict,\n            (False, False, True, True): getFunctionCallHelperStarListStarDict,\n        }\n\n        get_helper = table[key]\n\n        helper_args = [called]\n\n        if positional_args:\n            helper_args.append(\n                makeExpressionMakeTupleOrConstant(\n                    elements=positional_args,\n                    user_provided=True,\n                    source_ref=source_ref,\n                )\n            )\n\n        # Order of evaluation changed in Python3.5.\n        if python_version >= 0x350 and list_star_arg is not None:\n            helper_args.append(list_star_arg)\n\n        if keys:\n            helper_args.append(\n                makeExpressionMakeDictOrConstant(\n                    pairs=makeExpressionPairs(keys=keys, values=values),\n                    user_provided=True,\n                    source_ref=source_ref,\n                )\n            )\n\n        # Order of evaluation changed in Python3.5.\n        if python_version < 0x350 and list_star_arg is not None:\n            helper_args.append(list_star_arg)\n\n        if dict_star_arg is not None:\n            helper_args.append(dict_star_arg)\n\n        result = makeExpressionFunctionCall(\n            function=makeExpressionFunctionCreation(\n                function_ref=ExpressionFunctionRef(\n                    function_body=get_helper(), source_ref=source_ref\n                ),\n                defaults=(),\n                kw_defaults=None,\n                annotations=None,\n                source_ref=source_ref,\n            ),\n            values=helper_args,\n            source_ref=source_ref,\n        )\n\n        # Bug compatible line numbers before Python 3.8\n        if python_version < 0x380:\n            result.setCompatibleSourceReference(\n                source_ref=helper_args[-1].getCompatibleSourceReference()\n            )\n\n        return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationClasses.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of Python2 class statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup\nfrom nuitka.nodes.BuiltinRefNodes import ExpressionBuiltinAnonymousRef\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.ClassNodes import ExpressionClassBodyP2\nfrom nuitka.nodes.CodeObjectSpecs import CodeObjectSpec\nfrom nuitka.nodes.ConditionalNodes import ExpressionConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import (\n    makeExpressionMakeTuple,\n    makeExpressionMakeTupleOrConstant,\n)\nfrom nuitka.nodes.DictionaryNodes import (\n    ExpressionDictOperationGet2,\n    ExpressionDictOperationIn,\n)\nfrom nuitka.nodes.GlobalsLocalsNodes import ExpressionBuiltinLocalsRef\nfrom nuitka.nodes.LocalsDictNodes import (\n    StatementReleaseLocals,\n    StatementSetLocalsDictionary,\n)\nfrom nuitka.nodes.ModuleAttributeNodes import ExpressionModuleAttributeNameRef\nfrom nuitka.nodes.NodeMakingHelpers import mergeStatements\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.SubscriptNodes import makeExpressionIndexLookup\nfrom nuitka.nodes.TryNodes import StatementTry\nfrom nuitka.nodes.TypeNodes import ExpressionBuiltinType1\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableNameNodes import (\n    ExpressionVariableNameRef,\n    StatementAssignmentVariableName,\n)\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import (\n    makeStatementReleaseVariable,\n    makeStatementsReleaseVariables,\n)\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationClasses3 import buildClassNode3\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildFrameNode,\n    buildNodeTuple,\n    extractDocFromBody,\n    getKind,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    mangleName,\n)\n\n\ndef buildClassNode2(provider, node, source_ref):\n    # This function is the Python2 special case with special re-formulation as\n    # according to Developer Manual, and it's very detailed, pylint: disable=too-many-locals\n\n    # First, allow plugins to modify the code if they want to.\n    Plugins.onClassBodyParsing(provider=provider, class_name=node.name, node=node)\n\n    class_statement_nodes, class_doc = extractDocFromBody(node)\n\n    function_body = ExpressionClassBodyP2(\n        provider=provider, name=node.name, doc=class_doc, source_ref=source_ref\n    )\n\n    parent_module = provider.getParentModule()\n\n    code_object = CodeObjectSpec(\n        co_name=node.name,\n        co_qualname=provider.getChildQualname(node.name),\n        co_kind=\"Class\",\n        co_varnames=(),\n        co_freevars=(),\n        co_argcount=0,\n        co_posonlyargcount=0,\n        co_kwonlyargcount=0,\n        co_has_starlist=False,\n        co_has_stardict=False,\n        co_filename=parent_module.getRunTimeFilename(),\n        co_lineno=source_ref.getLineNumber(),\n        future_spec=parent_module.getFutureSpec(),\n    )\n\n    body = buildFrameNode(\n        provider=function_body,\n        nodes=class_statement_nodes,\n        code_object=code_object,\n        source_ref=source_ref,\n    )\n\n    if body is not None:\n        # The frame guard has nothing to tell its line number to.\n        body.source_ref = source_ref.atInternal()\n\n    locals_scope = function_body.getLocalsScope()\n\n    # The class body is basically a function that implicitly, at the end\n    # returns its locals and cannot have other return statements contained, and\n    # starts out with a variables \"__module__\" and potentially \"__doc__\" set.\n    statements = [\n        StatementSetLocalsDictionary(locals_scope=locals_scope, source_ref=source_ref),\n        StatementAssignmentVariableName(\n            provider=function_body,\n            variable_name=\"__module__\",\n            source=ExpressionModuleAttributeNameRef(\n                variable=provider.getParentModule().getVariableForReference(\"__name__\"),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref.atInternal(),\n        ),\n    ]\n\n    if class_doc is not None:\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=function_body,\n                variable_name=\"__doc__\",\n                source=makeConstantRefNode(\n                    constant=class_doc, source_ref=source_ref, user_provided=True\n                ),\n                source_ref=source_ref.atInternal(),\n            )\n        )\n\n    statements += (\n        body,\n        StatementReturn(\n            expression=ExpressionBuiltinLocalsRef(\n                locals_scope=locals_scope, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    body = makeStatementsSequenceFromStatement(\n        statement=makeTryFinallyStatement(\n            provider=function_body,\n            tried=mergeStatements(statements, True),\n            final=StatementReleaseLocals(\n                locals_scope=locals_scope, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n    )\n\n    # The class body is basically a function that implicitly, at the end\n    # returns its locals and cannot have other return statements contained.\n\n    function_body.setChildBody(body)\n\n    temp_scope = provider.allocateTempScope(\"class_creation\")\n\n    tmp_bases = provider.allocateTempVariable(temp_scope, \"bases\", temp_type=\"object\")\n    tmp_class_dict = provider.allocateTempVariable(\n        temp_scope, \"class_dict\", temp_type=\"object\"\n    )\n    tmp_metaclass = provider.allocateTempVariable(\n        temp_scope, \"metaclass\", temp_type=\"object\"\n    )\n    tmp_class = provider.allocateTempVariable(temp_scope, \"class\", temp_type=\"object\")\n\n    select_metaclass = ExpressionOutlineBody(\n        provider=provider, name=\"select_metaclass\", body=None, source_ref=source_ref\n    )\n\n    if node.bases:\n        tmp_base = select_metaclass.allocateTempVariable(\n            temp_scope=None, name=\"base\", temp_type=\"object\"\n        )\n\n        statements = (\n            makeStatementAssignmentVariable(\n                variable=tmp_base,\n                source=makeExpressionIndexLookup(\n                    expression=ExpressionTempVariableRef(\n                        variable=tmp_bases, source_ref=source_ref\n                    ),\n                    index_value=0,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            makeTryFinallyStatement(\n                provider,\n                tried=StatementTry(\n                    tried=makeStatementsSequenceFromStatement(\n                        statement=StatementReturn(\n                            expression=makeExpressionAttributeLookup(\n                                expression=ExpressionTempVariableRef(\n                                    variable=tmp_base, source_ref=source_ref\n                                ),\n                                attribute_name=\"__class__\",\n                                source_ref=source_ref,\n                            ),\n                            source_ref=source_ref,\n                        )\n                    ),\n                    except_handler=makeStatementsSequenceFromStatement(\n                        statement=StatementReturn(\n                            expression=ExpressionBuiltinType1(\n                                value=ExpressionTempVariableRef(\n                                    variable=tmp_base, source_ref=source_ref\n                                ),\n                                source_ref=source_ref,\n                            ),\n                            source_ref=source_ref,\n                        )\n                    ),\n                    break_handler=None,\n                    continue_handler=None,\n                    return_handler=None,\n                    source_ref=source_ref,\n                ),\n                final=makeStatementReleaseVariable(\n                    variable=tmp_base, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n                public_exc=False,\n            ),\n        )\n    else:\n        statements = (\n            StatementTry(\n                tried=makeStatementsSequenceFromStatement(\n                    statement=StatementReturn(\n                        # TODO: Should avoid checking __builtins__ for this.\n                        expression=ExpressionVariableNameRef(\n                            variable_name=\"__metaclass__\",\n                            provider=parent_module,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                ),\n                except_handler=makeStatementsSequenceFromStatement(\n                    statement=StatementReturn(\n                        expression=ExpressionBuiltinAnonymousRef(\n                            builtin_name=\"classobj\", source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    )\n                ),\n                break_handler=None,\n                continue_handler=None,\n                return_handler=None,\n                source_ref=source_ref,\n            ),\n        )\n\n    select_metaclass.setChildBody(\n        makeStatementsSequence(\n            statements=statements, allow_none=False, source_ref=source_ref\n        )\n    )\n\n    statements = [\n        makeStatementAssignmentVariable(\n            variable=tmp_bases,\n            source=makeExpressionMakeTupleOrConstant(\n                elements=buildNodeTuple(\n                    provider=provider, nodes=node.bases, source_ref=source_ref\n                ),\n                user_provided=True,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_class_dict, source=function_body, source_ref=source_ref\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_metaclass,\n            source=ExpressionConditional(\n                condition=ExpressionDictOperationIn(\n                    key=makeConstantRefNode(\n                        constant=\"__metaclass__\",\n                        source_ref=source_ref,\n                        user_provided=True,\n                    ),\n                    dict_arg=ExpressionTempVariableRef(\n                        variable=tmp_class_dict, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                expression_yes=ExpressionDictOperationGet2(\n                    dict_arg=ExpressionTempVariableRef(\n                        variable=tmp_class_dict, source_ref=source_ref\n                    ),\n                    key=makeConstantRefNode(\n                        constant=\"__metaclass__\",\n                        source_ref=source_ref,\n                        user_provided=True,\n                    ),\n                    source_ref=source_ref,\n                ),\n                expression_no=select_metaclass,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_class,\n            source=makeExpressionCall(\n                called=ExpressionTempVariableRef(\n                    variable=tmp_metaclass, source_ref=source_ref\n                ),\n                args=makeExpressionMakeTuple(\n                    elements=(\n                        makeConstantRefNode(\n                            constant=node.name,\n                            source_ref=source_ref,\n                            user_provided=True,\n                        ),\n                        ExpressionTempVariableRef(\n                            variable=tmp_bases, source_ref=source_ref\n                        ),\n                        ExpressionTempVariableRef(\n                            variable=tmp_class_dict, source_ref=source_ref\n                        ),\n                    ),\n                    source_ref=source_ref,\n                ),\n                kw=None,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n    ]\n\n    for decorator in buildNodeTuple(\n        provider, reversed(node.decorator_list), source_ref\n    ):\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=tmp_class,\n                source=makeExpressionCall(\n                    called=decorator,\n                    args=makeExpressionMakeTuple(\n                        elements=(\n                            ExpressionTempVariableRef(\n                                variable=tmp_class, source_ref=source_ref\n                            ),\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    kw=None,\n                    source_ref=decorator.getSourceReference(),\n                ),\n                source_ref=decorator.getSourceReference(),\n            )\n        )\n\n    statements.append(\n        StatementAssignmentVariableName(\n            provider=provider,\n            variable_name=mangleName(node.name, provider),\n            source=ExpressionTempVariableRef(variable=tmp_class, source_ref=source_ref),\n            source_ref=source_ref,\n        )\n    )\n\n    return makeTryFinallyStatement(\n        provider=function_body,\n        tried=statements,\n        final=makeStatementsReleaseVariables(\n            variables=(tmp_class, tmp_bases, tmp_class_dict, tmp_metaclass),\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef buildClassNode(provider, node, source_ref):\n    assert getKind(node) == \"ClassDef\"\n\n    # There appears to be a inconsistency with the top level line number\n    # not being the one really the class has, if there are bases, and a\n    # decorator.\n    if node.bases:\n        source_ref = source_ref.atLineNumber(node.bases[-1].lineno)\n\n    # Python2 and Python3 are similar, but fundamentally different, so handle\n    # them in dedicated code.\n    if python_version < 0x300:\n        return buildClassNode2(provider, node, source_ref)\n    else:\n        return buildClassNode3(provider, node, source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationClasses3.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of Python3 class statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.AttributeNodes import (\n    ExpressionAttributeCheck,\n    ExpressionBuiltinGetattr,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.BuiltinRefNodes import makeExpressionBuiltinTypeRef\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinTuple\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.ClassNodes import (\n    ExpressionClassBodyP3,\n    ExpressionSelectMetaclass,\n)\nfrom nuitka.nodes.CodeObjectSpecs import CodeObjectSpec\nfrom nuitka.nodes.ComparisonNodes import makeComparisonExpression\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditional,\n    makeStatementConditional,\n)\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import (\n    makeExpressionMakeTuple,\n    makeExpressionMakeTupleOrConstant,\n)\nfrom nuitka.nodes.ContainerOperationNodes import StatementListOperationAppend\nfrom nuitka.nodes.DictionaryNodes import (\n    ExpressionDictOperationGet2,\n    ExpressionDictOperationIn,\n    StatementDictOperationRemove,\n    StatementDictOperationUpdate,\n)\nfrom nuitka.nodes.ExceptionNodes import (\n    ExpressionBuiltinMakeException,\n    StatementRaiseException,\n)\nfrom nuitka.nodes.FunctionAttributeNodes import ExpressionFunctionQualnameRef\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCall,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.ListOperationNodes import ExpressionListOperationExtend\nfrom nuitka.nodes.LocalsDictNodes import (\n    ExpressionLocalsDictRef,\n    StatementLocalsDictOperationSet,\n    StatementReleaseLocals,\n    StatementSetLocals,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.ModuleAttributeNodes import ExpressionModuleAttributeNameRef\nfrom nuitka.nodes.NodeMakingHelpers import (\n    makeRaiseExceptionExpressionFromTemplate,\n    mergeStatements,\n)\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.StatementNodes import StatementExpressionOnly\nfrom nuitka.nodes.SubscriptNodes import makeExpressionIndexLookup\nfrom nuitka.nodes.TypeNodes import (\n    ExpressionBuiltinType1,\n    ExpressionSubtypeCheck,\n    ExpressionTypeCheck,\n)\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableNameNodes import StatementAssignmentVariableName\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables\nfrom nuitka.Options import isExperimental\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.ParameterSpecs import ParameterSpec\n\nfrom .InternalModule import (\n    internal_source_ref,\n    makeInternalHelperFunctionBody,\n    once_decorator,\n)\nfrom .ReformulationSequenceCreation import buildTupleUnpacking\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildFrameNode,\n    buildNode,\n    buildNodeTuple,\n    extractDocFromBody,\n    getKind,\n    makeDictCreationOrConstant2,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n    mangleName,\n)\n\n\ndef _buildBasesTupleCreationNode(provider, elements, source_ref):\n    \"\"\"For use in Python3 classes for the bases.\"\"\"\n\n    for element in elements:\n        if getKind(element) == \"Starred\":\n            return buildTupleUnpacking(\n                provider=provider, elements=elements, source_ref=source_ref\n            )\n\n    return makeExpressionMakeTupleOrConstant(\n        elements=buildNodeTuple(provider, elements, source_ref),\n        user_provided=True,\n        source_ref=source_ref,\n    )\n\n\ndef buildClassNode3(provider, node, source_ref):\n    # Many variables, due to the huge re-formulation that is going on here,\n    # which just has the complexity and optimization checks:\n    # pylint: disable=I0021,too-many-branches,too-many-locals,too-many-statements\n\n    # This function is the Python3 special case with special re-formulation as\n    # according to Developer Manual.\n\n    # First, allow plugins to modify the code if they want to.\n    Plugins.onClassBodyParsing(provider=provider, class_name=node.name, node=node)\n\n    class_statement_nodes, class_doc = extractDocFromBody(node)\n\n    # We need a scope for the temporary variables, and they might be closured.\n    temp_scope = provider.allocateTempScope(name=\"class_creation\")\n\n    tmp_class_decl_dict = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"class_decl_dict\", temp_type=\"object\"\n    )\n    tmp_metaclass = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"metaclass\", temp_type=\"object\"\n    )\n    tmp_prepared = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"prepared\", temp_type=\"object\"\n    )\n\n    class_creation_function = ExpressionClassBodyP3(\n        provider=provider, name=node.name, doc=class_doc, source_ref=source_ref\n    )\n\n    class_locals_scope = class_creation_function.getLocalsScope()\n\n    # Only local variable, for provision to methods.\n    class_variable = class_locals_scope.getLocalVariable(\n        owner=class_creation_function, variable_name=\"__class__\"\n    )\n\n    class_locals_scope.registerProvidedVariable(class_variable)\n\n    class_variable_ref = ExpressionVariableRef(\n        variable=class_variable, source_ref=source_ref\n    )\n\n    parent_module = provider.getParentModule()\n\n    code_object = CodeObjectSpec(\n        co_name=node.name,\n        co_qualname=provider.getChildQualname(node.name),\n        co_kind=\"Class\",\n        co_varnames=(),\n        co_freevars=(),\n        co_argcount=0,\n        co_posonlyargcount=0,\n        co_kwonlyargcount=0,\n        co_has_starlist=False,\n        co_has_stardict=False,\n        co_filename=parent_module.getRunTimeFilename(),\n        co_lineno=source_ref.getLineNumber(),\n        future_spec=parent_module.getFutureSpec(),\n    )\n\n    body = buildFrameNode(\n        provider=class_creation_function,\n        nodes=class_statement_nodes,\n        code_object=code_object,\n        source_ref=source_ref,\n    )\n\n    source_ref_orig = source_ref\n\n    if body is not None:\n        # The frame guard has nothing to tell its line number to.\n        body.source_ref = source_ref\n\n    locals_scope = class_creation_function.getLocalsScope()\n\n    statements = [\n        StatementSetLocals(\n            locals_scope=locals_scope,\n            new_locals=ExpressionTempVariableRef(\n                variable=tmp_prepared, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n        StatementAssignmentVariableName(\n            provider=class_creation_function,\n            variable_name=\"__module__\",\n            source=ExpressionModuleAttributeNameRef(\n                variable=provider.getParentModule().getVariableForReference(\"__name__\"),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n    ]\n\n    if class_doc is not None:\n        statements.append(\n            StatementAssignmentVariableName(\n                provider=class_creation_function,\n                variable_name=\"__doc__\",\n                source=makeConstantRefNode(\n                    constant=class_doc, source_ref=source_ref, user_provided=True\n                ),\n                source_ref=source_ref,\n            )\n        )\n\n    # The \"__qualname__\" attribute is new in Python3.\n    qualname = class_creation_function.getFunctionQualname()\n\n    if python_version < 0x340:\n        qualname_ref = makeConstantRefNode(\n            constant=qualname, source_ref=source_ref, user_provided=True\n        )\n    else:\n        qualname_ref = ExpressionFunctionQualnameRef(\n            function_body=class_creation_function, source_ref=source_ref\n        )\n\n    statements.append(\n        StatementLocalsDictOperationSet(\n            locals_scope=locals_scope,\n            variable_name=\"__qualname__\",\n            source=qualname_ref,\n            source_ref=source_ref,\n        )\n    )\n\n    if python_version >= 0x340:\n        qualname_assign = statements[-1]\n\n    if python_version >= 0x360 and class_creation_function.needsAnnotationsDictionary():\n        statements.append(\n            StatementLocalsDictOperationSet(\n                locals_scope=locals_scope,\n                variable_name=\"__annotations__\",\n                source=makeConstantRefNode(\n                    constant={}, source_ref=source_ref, user_provided=True\n                ),\n                source_ref=source_ref,\n            )\n        )\n\n    statements.append(body)\n\n    if node.bases:\n        tmp_bases = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"bases\", temp_type=\"object\"\n        )\n\n        if python_version >= 0x370:\n            tmp_bases_orig = provider.allocateTempVariable(\n                temp_scope=temp_scope, name=\"bases_orig\", temp_type=\"object\"\n            )\n\n        def makeBasesRef():\n            return ExpressionTempVariableRef(variable=tmp_bases, source_ref=source_ref)\n\n    else:\n\n        def makeBasesRef():\n            return makeConstantRefNode(constant=(), source_ref=source_ref)\n\n    if python_version >= 0x370 and node.bases:\n        statements.append(\n            makeStatementConditional(\n                condition=makeComparisonExpression(\n                    comparator=\"NotEq\",\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_bases, source_ref=source_ref\n                    ),\n                    right=ExpressionTempVariableRef(\n                        variable=tmp_bases_orig, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                yes_branch=StatementLocalsDictOperationSet(\n                    locals_scope=locals_scope,\n                    variable_name=\"__orig_bases__\",\n                    source=ExpressionTempVariableRef(\n                        variable=tmp_bases_orig, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                no_branch=None,\n                source_ref=source_ref,\n            )\n        )\n\n    statements += (\n        makeStatementAssignmentVariable(\n            variable=class_variable,\n            source=makeExpressionCall(\n                called=ExpressionTempVariableRef(\n                    variable=tmp_metaclass, source_ref=source_ref\n                ),\n                args=makeExpressionMakeTuple(\n                    elements=(\n                        makeConstantRefNode(\n                            constant=node.name,\n                            source_ref=source_ref,\n                            user_provided=True,\n                        ),\n                        makeBasesRef(),\n                        ExpressionLocalsDictRef(\n                            locals_scope=locals_scope, source_ref=source_ref\n                        ),\n                    ),\n                    source_ref=source_ref,\n                ),\n                kw=ExpressionTempVariableRef(\n                    variable=tmp_class_decl_dict, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        StatementReturn(expression=class_variable_ref, source_ref=source_ref),\n    )\n\n    body = makeStatementsSequenceFromStatement(\n        statement=makeTryFinallyStatement(\n            provider=class_creation_function,\n            tried=mergeStatements(statements, True),\n            final=StatementReleaseLocals(\n                locals_scope=locals_scope, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n    )\n\n    # The class body is basically a function that implicitly, at the end\n    # returns its locals and cannot have other return statements contained.\n    class_creation_function.setChildBody(body)\n\n    # The class body is basically a function that implicitly, at the end\n    # returns its created class and cannot have other return statements\n    # contained.\n\n    decorated_body = class_creation_function\n\n    for decorator in buildNodeTuple(\n        provider, reversed(node.decorator_list), source_ref\n    ):\n        decorated_body = makeExpressionCall(\n            called=decorator,\n            args=makeExpressionMakeTuple(\n                elements=(decorated_body,), source_ref=source_ref\n            ),\n            kw=None,\n            source_ref=decorator.getSourceReference(),\n        )\n\n    if node.keywords and node.keywords[-1].arg is None:\n        keywords = node.keywords[:-1]\n    else:\n        keywords = node.keywords\n\n    statements = []\n\n    if node.bases:\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=tmp_bases if python_version < 0x370 else tmp_bases_orig,\n                source=_buildBasesTupleCreationNode(\n                    provider=provider, elements=node.bases, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        )\n\n        if python_version >= 0x370:\n            bases_conversion = makeExpressionFunctionCall(\n                function=makeExpressionFunctionCreation(\n                    function_ref=ExpressionFunctionRef(\n                        function_body=getClassBasesMroConversionHelper(),\n                        source_ref=source_ref,\n                    ),\n                    defaults=(),\n                    kw_defaults=None,\n                    annotations=None,\n                    source_ref=source_ref,\n                ),\n                values=(\n                    ExpressionTempVariableRef(\n                        variable=tmp_bases_orig, source_ref=source_ref\n                    ),\n                ),\n                source_ref=source_ref,\n            )\n\n            statements.append(\n                makeStatementAssignmentVariable(\n                    variable=tmp_bases, source=bases_conversion, source_ref=source_ref\n                )\n            )\n\n    statements.append(\n        makeStatementAssignmentVariable(\n            variable=tmp_class_decl_dict,\n            source=makeDictCreationOrConstant2(\n                keys=[keyword.arg for keyword in keywords],\n                values=[\n                    buildNode(provider, keyword.value, source_ref)\n                    for keyword in keywords\n                ],\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n    )\n\n    if node.keywords and node.keywords[-1].arg is None:\n        statements.append(\n            StatementDictOperationUpdate(\n                dict_arg=ExpressionVariableRef(\n                    variable=tmp_class_decl_dict, source_ref=source_ref\n                ),\n                value=buildNode(provider, node.keywords[-1].value, source_ref),\n                source_ref=source_ref,\n            )\n        )\n\n    # Check if there are bases, and if there are, go with the type of the\n    # first base class as a metaclass unless it was specified in the class\n    # decl dict of course.\n    if node.bases:\n        unspecified_metaclass_expression = ExpressionBuiltinType1(\n            value=makeExpressionIndexLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_bases, source_ref=source_ref\n                ),\n                index_value=0,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        # Might become empty behind our back during conversion, therefore make the\n        # check at run time for 3.7 or higher.\n        if python_version >= 0x370:\n            unspecified_metaclass_expression = ExpressionConditional(\n                condition=ExpressionTempVariableRef(\n                    variable=tmp_bases, source_ref=source_ref\n                ),\n                expression_yes=unspecified_metaclass_expression,\n                expression_no=makeExpressionBuiltinTypeRef(\n                    builtin_name=\"type\", source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n    else:\n        unspecified_metaclass_expression = makeExpressionBuiltinTypeRef(\n            builtin_name=\"type\", source_ref=source_ref\n        )\n\n    call_prepare = makeStatementAssignmentVariable(\n        variable=tmp_prepared,\n        source=makeExpressionCall(\n            called=makeExpressionAttributeLookup(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_metaclass, source_ref=source_ref\n                ),\n                attribute_name=\"__prepare__\",\n                source_ref=source_ref,\n            ),\n            args=makeExpressionMakeTuple(\n                elements=(\n                    makeConstantRefNode(\n                        constant=node.name, source_ref=source_ref, user_provided=True\n                    ),\n                    makeBasesRef(),\n                ),\n                source_ref=source_ref,\n            ),\n            kw=ExpressionTempVariableRef(\n                variable=tmp_class_decl_dict, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n    if python_version >= 0x364:\n        call_prepare = makeStatementsSequenceFromStatements(\n            call_prepare,\n            makeStatementConditional(\n                condition=ExpressionAttributeCheck(\n                    expression=ExpressionTempVariableRef(\n                        variable=tmp_prepared, source_ref=source_ref\n                    ),\n                    attribute_name=\"__getitem__\",\n                    source_ref=source_ref,\n                ),\n                yes_branch=None,\n                no_branch=makeRaiseExceptionExpressionFromTemplate(\n                    exception_type=\"TypeError\",\n                    template=\"%s.__prepare__() must return a mapping, not %s\",\n                    template_args=(\n                        ExpressionBuiltinGetattr(\n                            expression=ExpressionTempVariableRef(\n                                variable=tmp_metaclass, source_ref=source_ref\n                            ),\n                            name=makeConstantRefNode(\n                                constant=\"__name__\", source_ref=source_ref\n                            ),\n                            default=makeConstantRefNode(\n                                constant=\"<metaclass>\", source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        makeExpressionAttributeLookup(\n                            expression=ExpressionBuiltinType1(\n                                value=ExpressionTempVariableRef(\n                                    variable=tmp_prepared, source_ref=source_ref\n                                ),\n                                source_ref=source_ref,\n                            ),\n                            attribute_name=\"__name__\",\n                            source_ref=source_ref,\n                        ),\n                    ),\n                    source_ref=source_ref,\n                ).asStatement(),\n                source_ref=source_ref,\n            ),\n        )\n\n    statements += (\n        makeStatementAssignmentVariable(\n            variable=tmp_metaclass,\n            source=makeExpressionSelectMetaclass(\n                metaclass=ExpressionConditional(\n                    condition=ExpressionDictOperationIn(\n                        key=makeConstantRefNode(\n                            constant=\"metaclass\",\n                            source_ref=source_ref,\n                            user_provided=True,\n                        ),\n                        dict_arg=ExpressionTempVariableRef(\n                            variable=tmp_class_decl_dict, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    expression_yes=ExpressionDictOperationGet2(\n                        dict_arg=ExpressionTempVariableRef(\n                            variable=tmp_class_decl_dict, source_ref=source_ref\n                        ),\n                        key=makeConstantRefNode(\n                            constant=\"metaclass\",\n                            source_ref=source_ref,\n                            user_provided=True,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    expression_no=unspecified_metaclass_expression,\n                    source_ref=source_ref,\n                ),\n                bases=makeBasesRef(),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref_orig,\n        ),\n        makeStatementConditional(\n            condition=ExpressionDictOperationIn(\n                key=makeConstantRefNode(\n                    constant=\"metaclass\", source_ref=source_ref, user_provided=True\n                ),\n                dict_arg=ExpressionTempVariableRef(\n                    variable=tmp_class_decl_dict, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            no_branch=None,\n            yes_branch=StatementDictOperationRemove(\n                dict_arg=ExpressionTempVariableRef(\n                    variable=tmp_class_decl_dict, source_ref=source_ref\n                ),\n                key=makeConstantRefNode(\n                    constant=\"metaclass\", source_ref=source_ref, user_provided=True\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionAttributeCheck(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_metaclass, source_ref=source_ref\n                ),\n                attribute_name=\"__prepare__\",\n                source_ref=source_ref,\n            ),\n            yes_branch=call_prepare,\n            no_branch=makeStatementAssignmentVariable(\n                variable=tmp_prepared,\n                source=makeConstantRefNode(\n                    constant={}, source_ref=source_ref, user_provided=True\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        StatementAssignmentVariableName(\n            provider=provider,\n            variable_name=mangleName(node.name, provider),\n            source=decorated_body,\n            source_ref=source_ref,\n        ),\n    )\n\n    if python_version >= 0x340:\n        class_creation_function.qualname_setup = node.name, qualname_assign\n\n    tmp_variables = [tmp_class_decl_dict, tmp_metaclass, tmp_prepared]\n    if node.bases:\n        tmp_variables.insert(0, tmp_bases)\n        if python_version >= 0x370:\n            tmp_variables.insert(0, tmp_bases_orig)\n\n    return makeTryFinallyStatement(\n        provider=provider,\n        tried=statements,\n        final=makeStatementsReleaseVariables(\n            variables=tmp_variables, source_ref=source_ref\n        ),\n        source_ref=source_ref,\n    )\n\n\n# Note: This emulates \"Python/bltinmodule.c/update_bases\" function. We have it\n# here, so we can hope to statically optimize it later on.\n@once_decorator\ndef getClassBasesMroConversionHelper():\n    helper_name = \"_mro_entries_conversion\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\"bases\",),\n            ps_pos_only_args=(),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n        ),\n        inline_const_args=False,  # TODO: Allow this.\n    )\n\n    temp_scope = None\n\n    tmp_result_variable = result.allocateTempVariable(\n        temp_scope, \"list\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"base\", temp_type=\"object\"\n    )\n\n    args_variable = result.getVariableForAssignment(variable_name=\"bases\")\n\n    non_type_case = makeStatementConditional(\n        condition=ExpressionAttributeCheck(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_item_variable, source_ref=internal_source_ref\n            ),\n            attribute_name=\"__mro_entries__\",\n            source_ref=internal_source_ref,\n        ),\n        yes_branch=StatementExpressionOnly(\n            expression=ExpressionListOperationExtend(\n                list_arg=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                value=makeExpressionCall(\n                    called=makeExpressionAttributeLookup(\n                        expression=ExpressionTempVariableRef(\n                            variable=tmp_item_variable, source_ref=internal_source_ref\n                        ),\n                        attribute_name=\"__mro_entries__\",\n                        source_ref=internal_source_ref,\n                    ),\n                    args=makeExpressionMakeTuple(\n                        elements=(\n                            ExpressionVariableRef(\n                                variable=args_variable, source_ref=internal_source_ref\n                            ),\n                        ),\n                        source_ref=internal_source_ref,\n                    ),\n                    kw=None,\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        no_branch=StatementListOperationAppend(\n            list_arg=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            value=ExpressionTempVariableRef(\n                variable=tmp_item_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        source_ref=internal_source_ref,\n    )\n\n    type_case = StatementListOperationAppend(\n        list_arg=ExpressionTempVariableRef(\n            variable=tmp_result_variable, source_ref=internal_source_ref\n        ),\n        value=ExpressionTempVariableRef(\n            variable=tmp_item_variable, source_ref=internal_source_ref\n        ),\n        source_ref=internal_source_ref,\n    )\n\n    loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionTypeCheck(\n                cls=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=type_case,\n            no_branch=non_type_case,\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    tried = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_result_variable,\n            source=makeConstantRefNode(constant=[], source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementLoop(loop_body=loop_body, source_ref=internal_source_ref),\n        StatementReturn(\n            expression=ExpressionBuiltinTuple(\n                value=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            makeTryFinallyStatement(\n                provider=result,\n                tried=tried,\n                final=makeStatementsReleaseVariables(\n                    variables=(\n                        args_variable,\n                        tmp_result_variable,\n                        tmp_iter_variable,\n                        tmp_item_variable,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\ndef makeExpressionSelectMetaclass(metaclass, bases, source_ref):\n    if isExperimental(\"select-metaclass-helper\"):\n        return makeExpressionFunctionCall(\n            function=makeExpressionFunctionCreation(\n                function_ref=ExpressionFunctionRef(\n                    function_body=getClassSelectMetaClassHelper(),\n                    source_ref=source_ref,\n                ),\n                defaults=(),\n                kw_defaults=None,\n                annotations=None,\n                source_ref=source_ref,\n            ),\n            values=(metaclass, bases),\n            source_ref=source_ref,\n        )\n\n    else:\n        return ExpressionSelectMetaclass(\n            metaclass=metaclass, bases=bases, source_ref=source_ref\n        )\n\n\ndef _makeRaiseExceptionMetaclassConflict():\n    return StatementRaiseException(\n        exception_type=ExpressionBuiltinMakeException(\n            exception_name=\"TypeError\",\n            args=(\n                makeConstantRefNode(\n                    constant=\"\"\"\\\nmetaclass conflict: the metaclass of a derived class must be a (non-strict) \\\nsubclass of the metaclasses of all its bases\"\"\",\n                    source_ref=internal_source_ref,\n                ),\n            ),\n            source_ref=internal_source_ref,\n        ),\n        exception_value=None,\n        exception_trace=None,\n        exception_cause=None,\n        source_ref=internal_source_ref,\n    )\n\n\n# Note: This emulates selection of meta class based on base classes\n@once_decorator\ndef getClassSelectMetaClassHelper():\n    helper_name = \"_select_metaclass\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(\n                \"metaclass\",\n                \"bases\",\n            ),\n            ps_pos_only_args=(),\n            ps_list_star_arg=None,\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n        ),\n        inline_const_args=False,  # TODO: Allow this.\n    )\n\n    metaclass_variable = result.getVariableForAssignment(variable_name=\"metaclass\")\n    bases_variable = result.getVariableForAssignment(variable_name=\"bases\")\n\n    temp_scope = None\n\n    tmp_winner_variable = result.allocateTempVariable(\n        temp_scope, \"winner\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"base\", temp_type=\"object\"\n    )\n    tmp_item_type_variable = result.allocateTempVariable(\n        temp_scope, \"base_type\", temp_type=\"object\"\n    )\n\n    # For non-types, the metaclass cannot be overruled by bases.\n    non_type_case = StatementReturn(\n        expression=ExpressionVariableRef(\n            variable=metaclass_variable, source_ref=internal_source_ref\n        ),\n        source_ref=internal_source_ref,\n    )\n\n    type_loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_item_type_variable,\n            source=ExpressionBuiltinType1(\n                value=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionSubtypeCheck(\n                left=ExpressionTempVariableRef(\n                    variable=tmp_winner_variable, source_ref=internal_source_ref\n                ),\n                right=ExpressionTempVariableRef(\n                    variable=tmp_item_type_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            yes_branch=None,  # Ignore if current winner is already a subtype.\n            no_branch=makeStatementConditional(\n                condition=ExpressionSubtypeCheck(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_item_type_variable, source_ref=internal_source_ref\n                    ),\n                    right=ExpressionTempVariableRef(\n                        variable=tmp_winner_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                yes_branch=makeStatementAssignmentVariable(\n                    variable=tmp_winner_variable,\n                    source=ExpressionTempVariableRef(\n                        variable=tmp_item_type_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                no_branch=_makeRaiseExceptionMetaclassConflict(),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    type_case = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_winner_variable,\n            source=ExpressionVariableRef(\n                variable=metaclass_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=bases_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        StatementLoop(loop_body=type_loop_body, source_ref=internal_source_ref),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_winner_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    tried = makeStatementConditional(\n        condition=ExpressionTypeCheck(\n            cls=ExpressionVariableRef(\n                variable=metaclass_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n        yes_branch=type_case,\n        no_branch=non_type_case,\n        source_ref=internal_source_ref,\n    )\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            makeTryFinallyStatement(\n                provider=result,\n                tried=tried,\n                final=makeStatementsReleaseVariables(\n                    variables=(\n                        tmp_winner_variable,\n                        tmp_iter_variable,\n                        tmp_item_variable,\n                        tmp_item_type_variable,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationComparisonExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of comparison chain expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.ComparisonNodes import makeComparisonExpression\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.OperatorNodesUnary import ExpressionOperationNot\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\n\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    getKind,\n    makeStatementsSequenceFromStatement,\n)\n\n\ndef _makeComparisonNode(left, right, comparator, source_ref):\n    result = makeComparisonExpression(left, right, comparator, source_ref)\n    result.setCompatibleSourceReference(source_ref=right.getCompatibleSourceReference())\n\n    return result\n\n\ndef buildComparisonNode(provider, node, source_ref):\n    assert len(node.comparators) == len(node.ops)\n\n    # Comparisons are re-formulated as described in the Developer Manual. When\n    # having multiple comparators, things require assignment expressions and\n    # references of them to work properly. Then they can become normal \"and\"\n    # code.\n\n    # The operands are split out in two parts strangely.\n    left = buildNode(provider, node.left, source_ref)\n    rights = [\n        buildNode(provider, comparator, source_ref) for comparator in node.comparators\n    ]\n    comparators = [getKind(comparator) for comparator in node.ops]\n    # Normal, and simple case, we only have one comparison, which is what our\n    # node handles only. Then we can handle it\n    if len(rights) == 1:\n        return _makeComparisonNode(\n            left=left,\n            right=rights[0],\n            # TODO: The terminology of Nuitka might be messed up here.\n            comparator=comparators[0],\n            source_ref=source_ref,\n        )\n\n    return buildComplexComparisonNode(provider, left, rights, comparators, source_ref)\n\n\ndef buildComplexComparisonNode(provider, left, rights, comparators, source_ref):\n    # This is a bit complex, due to the many details, pylint: disable=too-many-locals\n\n    outline_body = ExpressionOutlineBody(\n        provider=provider, name=\"comparison_chain\", source_ref=source_ref\n    )\n\n    variables = [\n        outline_body.allocateTempVariable(\n            temp_scope=None, name=\"operand_%d\" % count, temp_type=\"object\"\n        )\n        for count in range(2, len(rights) + 2)\n    ]\n\n    tmp_variable = outline_body.allocateTempVariable(\n        temp_scope=None, name=\"comparison_result\", temp_type=\"object\"\n    )\n\n    def makeTempAssignment(count, value):\n        return makeStatementAssignmentVariable(\n            variable=variables[count], source=value, source_ref=source_ref\n        )\n\n    def makeReleaseStatement(count):\n        return makeStatementReleaseVariable(\n            variable=variables[count], source_ref=source_ref\n        )\n\n    def makeValueComparisonReturn(left, right, comparator):\n        yield makeStatementAssignmentVariable(\n            variable=tmp_variable,\n            source=_makeComparisonNode(\n                left=left, right=right, comparator=comparator, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n\n        yield makeStatementConditional(\n            condition=ExpressionOperationNot(\n                operand=ExpressionTempVariableRef(\n                    variable=tmp_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            yes_branch=StatementReturn(\n                expression=ExpressionTempVariableRef(\n                    variable=tmp_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            no_branch=None,\n            source_ref=source_ref,\n        )\n\n    statements = []\n    final = []\n\n    for count, value in enumerate(rights):\n        if value is not rights[-1]:\n            statements.append(makeTempAssignment(count, value))\n            final.append(makeReleaseStatement(count))\n            right = ExpressionTempVariableRef(\n                variable=variables[count], source_ref=source_ref\n            )\n        else:\n            right = value\n\n        if count != 0:\n            left = ExpressionTempVariableRef(\n                variable=variables[count - 1], source_ref=source_ref\n            )\n\n        comparator = comparators[count]\n\n        if value is not rights[-1]:\n            statements.extend(makeValueComparisonReturn(left, right, comparator))\n        else:\n            statements.append(\n                StatementReturn(\n                    expression=_makeComparisonNode(\n                        left=left,\n                        right=right,\n                        comparator=comparator,\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n            final.append(\n                makeStatementReleaseVariable(\n                    variable=tmp_variable, source_ref=source_ref\n                )\n            )\n\n    outline_body.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=makeTryFinallyStatement(\n                provider=outline_body,\n                tried=statements,\n                final=final,\n                source_ref=source_ref,\n            )\n        )\n    )\n\n    return outline_body\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationContractionExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of contraction expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.__past__ import intern\nfrom nuitka.nodes.AsyncgenNodes import (\n    ExpressionAsyncgenObjectBody,\n    ExpressionMakeAsyncgenObject,\n)\nfrom nuitka.nodes.BuiltinIteratorNodes import (\n    ExpressionAsyncIter,\n    ExpressionAsyncNext,\n    ExpressionBuiltinIter1,\n)\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.CodeObjectSpecs import CodeObjectSpec\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerOperationNodes import (\n    StatementListOperationAppend,\n    StatementSetOperationAdd,\n)\nfrom nuitka.nodes.DictionaryNodes import (\n    StatementDictOperationSet,\n    StatementDictOperationSetKeyValue,\n)\nfrom nuitka.nodes.FrameNodes import (\n    StatementsFrameAsyncgen,\n    StatementsFrameGenerator,\n)\nfrom nuitka.nodes.FunctionNodes import ExpressionFunctionRef\nfrom nuitka.nodes.GeneratorNodes import (\n    ExpressionGeneratorObjectBody,\n    ExpressionMakeGeneratorObject,\n    StatementGeneratorReturnNone,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.NodeMakingHelpers import makeVariableRefNode\nfrom nuitka.nodes.OutlineNodes import (\n    ExpressionOutlineBody,\n    ExpressionOutlineFunction,\n)\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.StatementNodes import (\n    StatementExpressionOnly,\n    StatementsSequence,\n)\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import (\n    makeStatementReleaseVariable,\n    makeStatementsReleaseVariables,\n)\nfrom nuitka.nodes.YieldNodes import (\n    ExpressionYield,\n    ExpressionYieldFromAwaitable,\n)\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationAssignmentStatements import buildAssignmentStatements\nfrom .ReformulationBooleanExpressions import makeAndNode\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeList,\n    detectFunctionBodyKind,\n    getKind,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n    mergeStatements,\n)\n\n\ndef _makeIteratorCreation(provider, qual, for_asyncgen, source_ref):\n    if getattr(qual, \"is_async\", 0):\n        result = ExpressionAsyncIter(\n            value=buildNode(provider=provider, node=qual.iter, source_ref=source_ref),\n            source_ref=source_ref,\n        )\n\n        if not for_asyncgen or python_version < 0x370:\n            result = ExpressionYieldFromAwaitable(\n                expression=result, source_ref=source_ref\n            )\n\n        return result\n    else:\n        return ExpressionBuiltinIter1(\n            value=buildNode(provider=provider, node=qual.iter, source_ref=source_ref),\n            source_ref=source_ref,\n        )\n\n\ndef _makeIteratorNext(qual, iterator_ref, source_ref):\n    if getattr(qual, \"is_async\", 0):\n        return ExpressionYieldFromAwaitable(\n            expression=ExpressionAsyncNext(value=iterator_ref, source_ref=source_ref),\n            source_ref=source_ref,\n        )\n    else:\n        return ExpressionBuiltinNext1(value=iterator_ref, source_ref=source_ref)\n\n\ndef _getStopIterationName(qual):\n    if getattr(qual, \"is_async\", 0):\n        return \"StopAsyncIteration\"\n    else:\n        return \"StopIteration\"\n\n\ndef _buildPython2ListContraction(provider, node, source_ref):\n    # The contraction nodes are reformulated to function bodies, with loops as\n    # described in the Developer Manual. They use a lot of temporary names,\n    # nested blocks, etc. and so a lot of variable names.\n\n    # Note: The assign_provider is only to cover Python2 list contractions,\n    # assigning one of the loop variables to the outside scope.\n    function_body = ExpressionOutlineBody(\n        provider=provider, name=\"list_contraction\", source_ref=source_ref\n    )\n\n    iter_tmp = function_body.allocateTempVariable(\n        temp_scope=None, name=\".0\", temp_type=\"object\"\n    )\n\n    container_tmp = function_body.allocateTempVariable(\n        temp_scope=None, name=\"contraction_result\", temp_type=\"object\"\n    )\n\n    statements, release_statements = _buildContractionBodyNode(\n        provider=provider,\n        node=node,\n        emit_class=StatementListOperationAppend,\n        iter_tmp=iter_tmp,\n        temp_scope=None,\n        start_value=[],\n        container_tmp=container_tmp,\n        function_body=function_body,\n        assign_provider=True,\n        for_asyncgen=False,\n        source_ref=source_ref,\n    )\n\n    return_statement = StatementReturn(\n        expression=ExpressionTempVariableRef(\n            variable=container_tmp, source_ref=source_ref\n        ),\n        source_ref=source_ref,\n    )\n\n    statement = makeTryFinallyStatement(\n        provider=function_body,\n        tried=mergeStatements((statements, return_statement)),\n        final=release_statements,\n        source_ref=source_ref.atInternal(),\n    )\n\n    function_body.setChildBody(makeStatementsSequenceFromStatement(statement=statement))\n\n    return function_body\n\n\ndef buildListContractionNode(provider, node, source_ref):\n    # List contractions are dealt with by general code.\n    if python_version < 0x300:\n        return _buildPython2ListContraction(\n            provider=provider, node=node, source_ref=source_ref\n        )\n\n    return _buildContractionNode(\n        provider=provider,\n        node=node,\n        name=\"<listcomp>\",\n        emit_class=StatementListOperationAppend,\n        start_value=[],\n        source_ref=source_ref,\n    )\n\n\ndef buildSetContractionNode(provider, node, source_ref):\n    # Set contractions are dealt with by general code.\n\n    return _buildContractionNode(\n        provider=provider,\n        node=node,\n        name=\"<setcontraction>\",\n        emit_class=StatementSetOperationAdd,\n        start_value=set(),\n        source_ref=source_ref,\n    )\n\n\ndef buildDictContractionNode(provider, node, source_ref):\n    # Dict contractions are dealt with by general code.\n\n    return _buildContractionNode(\n        provider=provider,\n        node=node,\n        name=\"<dictcontraction>\",\n        emit_class=(\n            StatementDictOperationSet\n            if python_version < 0x380\n            else StatementDictOperationSetKeyValue\n        ),\n        start_value={},\n        source_ref=source_ref,\n    )\n\n\ndef buildGeneratorExpressionNode(provider, node, source_ref):\n    # Generator expressions are dealt with by general code.\n\n    assert getKind(node) == \"GeneratorExp\"\n\n    function_body = ExpressionOutlineBody(\n        provider=provider, name=\"genexpr\", source_ref=source_ref\n    )\n\n    iter_tmp = function_body.allocateTempVariable(\n        temp_scope=None, name=\".0\", temp_type=\"object\"\n    )\n\n    parent_module = provider.getParentModule()\n\n    code_object = CodeObjectSpec(\n        co_name=\"<genexpr>\",\n        co_qualname=provider.getChildQualname(\"<genexpr>\"),\n        co_kind=\"Generator\",\n        co_varnames=(\".0\",),\n        co_freevars=(),\n        co_argcount=1,\n        co_posonlyargcount=0,\n        co_kwonlyargcount=0,\n        co_has_starlist=False,\n        co_has_stardict=False,\n        co_filename=parent_module.getRunTimeFilename(),\n        co_lineno=source_ref.getLineNumber(),\n        future_spec=parent_module.getFutureSpec(),\n    )\n\n    is_async = any(getattr(qual, \"is_async\", 0) for qual in node.generators)\n\n    # Some of the newly allowed stuff in 3.7 fails to set the async flag.\n    if not is_async and python_version >= 0x370:\n        is_async = detectFunctionBodyKind(nodes=node.generators + [node.elt])[0] in (\n            \"Asyncgen\",\n            \"Coroutine\",\n        )\n\n    if is_async:\n        code_body = ExpressionAsyncgenObjectBody(\n            provider=provider,\n            name=\"<genexpr>\",\n            code_object=code_object,\n            flags=None,\n            auto_release=None,\n            source_ref=source_ref,\n        )\n\n        maker_class = ExpressionMakeAsyncgenObject\n    else:\n        code_body = ExpressionGeneratorObjectBody(\n            provider=provider,\n            name=\"<genexpr>\",\n            code_object=code_object,\n            flags=None,\n            auto_release=None,\n            source_ref=source_ref.atColumnNumber(node.col_offset + 1),\n        )\n\n        maker_class = ExpressionMakeGeneratorObject\n\n    function_body.setChildBody(\n        makeStatementsSequenceFromStatements(\n            makeStatementAssignmentVariable(\n                variable=iter_tmp,\n                source=_makeIteratorCreation(\n                    provider=provider,\n                    qual=node.generators[0],\n                    for_asyncgen=is_async,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            makeTryFinallyStatement(\n                provider=function_body,\n                tried=StatementReturn(\n                    expression=maker_class(\n                        ExpressionFunctionRef(\n                            function_body=code_body, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                ),\n                final=makeStatementReleaseVariable(\n                    variable=iter_tmp, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n        )\n    )\n\n    statements, release_statements = _buildContractionBodyNode(\n        provider=provider,\n        node=node,\n        emit_class=ExpressionYield,\n        iter_tmp=iter_tmp,\n        temp_scope=None,\n        start_value=None,\n        container_tmp=None,\n        function_body=code_body,\n        assign_provider=False,\n        for_asyncgen=is_async,\n        source_ref=source_ref,\n    )\n\n    if is_async:\n        statements += (StatementGeneratorReturnNone(source_ref=source_ref),)\n\n    statements = (\n        makeTryFinallyStatement(\n            provider=function_body,\n            tried=statements,\n            final=release_statements,\n            source_ref=source_ref.atInternal(),\n        ),\n    )\n\n    frame_node_class = StatementsFrameAsyncgen if is_async else StatementsFrameGenerator\n\n    code_body.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=frame_node_class(\n                statements=mergeStatements(statements, False),\n                code_object=code_object,\n                source_ref=source_ref,\n            )\n        )\n    )\n\n    return function_body\n\n\ndef _buildContractionBodyNode(\n    provider,\n    node,\n    emit_class,\n    start_value,\n    container_tmp,\n    iter_tmp,\n    temp_scope,\n    assign_provider,\n    function_body,\n    for_asyncgen,\n    source_ref,\n):\n    # This uses lots of variables and branches. There is no good way\n    # around that, and we deal with many cases, due to having generator\n    # expressions sharing this code, pylint: disable=too-many-branches,too-many-locals\n\n    # Note: The assign_provider is only to cover Python2 list contractions,\n    # assigning one of the loop variables to the outside scope.\n\n    tmp_variables = []\n    if emit_class is not ExpressionYield:\n        tmp_variables.append(iter_tmp)\n\n    if container_tmp is not None:\n        tmp_variables.append(container_tmp)\n\n    statements = []\n\n    # First assign the iterator if we are an outline.\n    if assign_provider:\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=iter_tmp,\n                source=_makeIteratorCreation(\n                    provider=provider,\n                    qual=node.generators[0],\n                    for_asyncgen=False,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref.atInternal(),\n            )\n        )\n\n    if start_value is not None:\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=container_tmp,\n                source=makeConstantRefNode(constant=start_value, source_ref=source_ref),\n                source_ref=source_ref.atInternal(),\n            )\n        )\n\n    if hasattr(node, \"elt\"):\n        if start_value is not None:\n            current_body = emit_class(\n                ExpressionTempVariableRef(\n                    variable=container_tmp, source_ref=source_ref\n                ),\n                buildNode(\n                    provider=function_body if not assign_provider else provider,\n                    node=node.elt,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            )\n        else:\n            assert emit_class is ExpressionYield\n\n            current_body = emit_class(\n                buildNode(\n                    provider=function_body,\n                    node=node.elt,\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            )\n    else:\n        current_body = emit_class(\n            dict_arg=ExpressionTempVariableRef(\n                variable=container_tmp, source_ref=source_ref\n            ),\n            key=buildNode(\n                provider=function_body if not assign_provider else provider,\n                node=node.key,\n                source_ref=source_ref,\n            ),\n            value=buildNode(\n                provider=function_body if not assign_provider else provider,\n                node=node.value,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n    # TODO: For as long as statement/expression merge are not complete.\n    if current_body.kind.startswith(\"EXPRESSION\"):\n        current_body = StatementExpressionOnly(\n            expression=current_body, source_ref=source_ref\n        )\n\n    for count, qual in enumerate(reversed(node.generators)):\n        tmp_value_variable = function_body.allocateTempVariable(\n            temp_scope=temp_scope, name=\"iter_value_%d\" % count, temp_type=\"object\"\n        )\n\n        tmp_variables.append(tmp_value_variable)\n\n        # The first iterated value is to be calculated outside of the function\n        # and will be given as a parameter \"_iterated\", the others are built\n        # inside the function.\n\n        if qual is node.generators[0]:\n            iterator_ref = makeVariableRefNode(variable=iter_tmp, source_ref=source_ref)\n\n            if for_asyncgen and python_version >= 0x370:\n                iterator_ref = ExpressionYieldFromAwaitable(\n                    expression=iterator_ref, source_ref=source_ref\n                )\n\n            tmp_iter_variable = None\n\n            nested_statements = []\n        else:\n            # First create the iterator and store it, next should be loop body\n            value_iterator = _makeIteratorCreation(\n                provider=provider if assign_provider else function_body,\n                qual=qual,\n                for_asyncgen=False,\n                source_ref=source_ref,\n            )\n\n            tmp_iter_variable = function_body.allocateTempVariable(\n                temp_scope=temp_scope,\n                name=\"contraction_iter_%d\" % count,\n                temp_type=\"object\",\n            )\n\n            tmp_variables.append(tmp_iter_variable)\n\n            nested_statements = [\n                makeStatementAssignmentVariable(\n                    variable=tmp_iter_variable,\n                    source=value_iterator,\n                    source_ref=source_ref,\n                )\n            ]\n\n            iterator_ref = ExpressionTempVariableRef(\n                variable=tmp_iter_variable, source_ref=source_ref\n            )\n\n        loop_statements = [\n            makeTryExceptSingleHandlerNode(\n                tried=makeStatementAssignmentVariable(\n                    variable=tmp_value_variable,\n                    source=_makeIteratorNext(\n                        iterator_ref=iterator_ref, qual=qual, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                exception_name=_getStopIterationName(qual),\n                handler_body=StatementLoopBreak(source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            buildAssignmentStatements(\n                provider=provider if assign_provider else function_body,\n                temp_provider=function_body,\n                node=qual.target,\n                source=ExpressionTempVariableRef(\n                    variable=tmp_value_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n        ]\n\n        conditions = buildNodeList(\n            provider=provider if assign_provider else function_body,\n            nodes=qual.ifs,\n            source_ref=source_ref,\n        )\n\n        if len(conditions) >= 1:\n            loop_statements.append(\n                makeStatementConditional(\n                    condition=makeAndNode(values=conditions, source_ref=source_ref),\n                    yes_branch=current_body,\n                    no_branch=None,\n                    source_ref=source_ref,\n                )\n            )\n        else:\n            loop_statements.append(current_body)\n\n        nested_statements.append(\n            StatementLoop(\n                loop_body=StatementsSequence(\n                    statements=mergeStatements(loop_statements), source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        )\n\n        if tmp_iter_variable is not None:\n            nested_statements.append(\n                makeStatementReleaseVariable(\n                    variable=tmp_iter_variable, source_ref=source_ref\n                )\n            )\n\n        current_body = StatementsSequence(\n            statements=mergeStatements(nested_statements, False), source_ref=source_ref\n        )\n\n    statements.append(current_body)\n    statements = mergeStatements(statements)\n\n    release_statements = makeStatementsReleaseVariables(\n        variables=tmp_variables, source_ref=source_ref\n    )\n\n    return statements, release_statements\n\n\ndef _buildContractionNode(provider, node, name, emit_class, start_value, source_ref):\n    # The contraction nodes are reformulated to function bodies, with loops as\n    # described in the Developer Manual. They use a lot of temporary names,\n    # nested blocks, etc. and so a lot of variable names.\n    # pylint: disable=too-many-locals\n\n    function_body = ExpressionOutlineFunction(\n        provider=provider, name=intern(name[1:-1]), source_ref=source_ref\n    )\n\n    iter_tmp = function_body.allocateTempVariable(\n        temp_scope=None, name=\".0\", temp_type=\"object\"\n    )\n\n    container_tmp = function_body.allocateTempVariable(\n        temp_scope=None, name=\"contraction\", temp_type=\"object\"\n    )\n\n    statements, release_statements = _buildContractionBodyNode(\n        provider=provider,\n        node=node,\n        emit_class=emit_class,\n        iter_tmp=iter_tmp,\n        temp_scope=None,\n        start_value=start_value,\n        container_tmp=container_tmp,\n        function_body=function_body,\n        assign_provider=False,\n        for_asyncgen=False,\n        source_ref=source_ref,\n    )\n\n    assign_iter_statement = makeStatementAssignmentVariable(\n        source=_makeIteratorCreation(\n            provider=provider,\n            qual=node.generators[0],\n            for_asyncgen=False,\n            source_ref=source_ref,\n        ),\n        variable=iter_tmp,\n        source_ref=source_ref,\n    )\n\n    return_statement = StatementReturn(\n        expression=ExpressionTempVariableRef(\n            variable=container_tmp, source_ref=source_ref\n        ),\n        source_ref=source_ref,\n    )\n\n    statements = (\n        makeTryFinallyStatement(\n            provider=function_body,\n            tried=mergeStatements((statements, return_statement)),\n            final=release_statements,\n            source_ref=source_ref.atInternal(),\n        ),\n    )\n\n    if python_version < 0x300 or emit_class is not ExpressionYield:\n        body = makeStatementsSequenceFromStatements(assign_iter_statement, statements)\n    else:\n        parent_module = provider.getParentModule()\n\n        code_object = CodeObjectSpec(\n            co_name=name,\n            co_qualname=provider.getChildQualname(name),\n            co_kind=\"Function\",\n            co_varnames=(),\n            co_freevars=(),\n            co_argcount=1,\n            co_posonlyargcount=0,\n            co_kwonlyargcount=0,\n            co_has_starlist=False,\n            co_has_stardict=False,\n            co_filename=parent_module.getRunTimeFilename(),\n            co_lineno=source_ref.getLineNumber(),\n            future_spec=parent_module.getFutureSpec(),\n        )\n\n        body = makeStatementsSequenceFromStatements(\n            assign_iter_statement,\n            StatementsFrameGenerator(\n                statements=mergeStatements(statements, False),\n                code_object=code_object,\n                source_ref=source_ref,\n            ),\n        )\n\n    function_body.setChildBody(body)\n\n    return function_body\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationDictionaryCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of dictionary creations.\n\nDictionary creations might be directly translated to constants, or they might\nbecome nodes that build dictionaries.\n\nFor Python3.5, unpacking can happen while creating dictionaries, these are\nbeing re-formulated to an internal function.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup\nfrom nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTuple\nfrom nuitka.nodes.DictionaryNodes import (\n    StatementDictOperationUpdate,\n    makeExpressionMakeDict,\n    makeExpressionMakeDictOrConstant,\n)\nfrom nuitka.nodes.ExceptionNodes import (\n    ExpressionBuiltinMakeException,\n    StatementRaiseException,\n)\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCall,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.KeyValuePairNodes import (\n    makeExpressionKeyValuePair,\n    makeExpressionKeyValuePairConstantKey,\n    makeExpressionPairs,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.OperatorNodes import makeBinaryOperationNode\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.TypeNodes import ExpressionBuiltinType1\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.ParameterSpecs import ParameterSpec\n\nfrom .InternalModule import (\n    internal_source_ref,\n    makeInternalHelperFunctionBody,\n    once_decorator,\n)\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n)\n\n\ndef buildDictionaryNode(provider, node, source_ref):\n    if python_version >= 0x350:\n        for key in node.keys:\n            if key is None:\n                return buildDictionaryUnpacking(\n                    provider=provider, node=node, source_ref=source_ref\n                )\n\n    return makeExpressionMakeDictOrConstant(\n        pairs=makeExpressionPairs(\n            keys=buildNodeTuple(provider, node.keys, source_ref),\n            values=buildNodeTuple(provider, node.values, source_ref),\n        ),\n        user_provided=True,\n        source_ref=source_ref,\n    )\n\n\n@once_decorator\ndef getDictUnpackingHelper():\n    helper_name = \"_unpack_dict\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(),\n            ps_list_star_arg=\"args\",\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    temp_scope = None\n\n    tmp_result_variable = result.allocateTempVariable(\n        temp_scope, \"dict\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"keys\", temp_type=\"object\"\n    )\n\n    loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        makeTryExceptSingleHandlerNode(\n            tried=StatementDictOperationUpdate(\n                dict_arg=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                value=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"AttributeError\",\n            handler_body=StatementRaiseException(\n                exception_type=ExpressionBuiltinMakeException(\n                    exception_name=\"TypeError\",\n                    args=(\n                        makeBinaryOperationNode(\n                            operator=\"Mod\",\n                            left=makeConstantRefNode(\n                                constant=\"\"\"\\\n'%s' object is not a mapping\"\"\",\n                                source_ref=internal_source_ref,\n                                user_provided=True,\n                            ),\n                            right=makeExpressionMakeTuple(\n                                elements=(\n                                    makeExpressionAttributeLookup(\n                                        expression=ExpressionBuiltinType1(\n                                            value=ExpressionTempVariableRef(\n                                                variable=tmp_item_variable,\n                                                source_ref=internal_source_ref,\n                                            ),\n                                            source_ref=internal_source_ref,\n                                        ),\n                                        attribute_name=\"__name__\",\n                                        source_ref=internal_source_ref,\n                                    ),\n                                ),\n                                source_ref=internal_source_ref,\n                            ),\n                            source_ref=internal_source_ref,\n                        ),\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                exception_value=None,\n                exception_trace=None,\n                exception_cause=None,\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    tried = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_result_variable,\n            source=makeConstantRefNode(constant={}, source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementLoop(loop_body=loop_body, source_ref=internal_source_ref),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            makeTryFinallyStatement(\n                provider=result,\n                tried=tried,\n                final=makeStatementsReleaseVariables(\n                    variables=(\n                        tmp_result_variable,\n                        tmp_iter_variable,\n                        tmp_item_variable,\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\ndef buildDictionaryUnpackingArgs(provider, keys, values, source_ref):\n    result = []\n\n    for key, value in zip(keys, values):\n        # TODO: We could be a lot cleverer about the dictionaries for non-starred\n        # arguments, but lets get this to work first.\n        if key is None:\n            result.append(buildNode(provider, value, source_ref))\n        elif type(key) is str:\n            result.append(\n                makeExpressionMakeDict(\n                    pairs=(\n                        makeExpressionKeyValuePairConstantKey(\n                            key=key,\n                            value=buildNode(provider, value, source_ref),\n                        ),\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n        else:\n            result.append(\n                makeExpressionMakeDict(\n                    pairs=(\n                        makeExpressionKeyValuePair(\n                            key=buildNode(provider, key, source_ref),\n                            value=buildNode(provider, value, source_ref),\n                        ),\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n    return tuple(result)\n\n\ndef buildDictionaryUnpacking(provider, node, source_ref):\n    helper_args = buildDictionaryUnpackingArgs(\n        provider, node.keys, node.values, source_ref\n    )\n\n    result = makeExpressionFunctionCall(\n        function=makeExpressionFunctionCreation(\n            function_ref=ExpressionFunctionRef(\n                function_body=getDictUnpackingHelper(), source_ref=source_ref\n            ),\n            defaults=(),\n            kw_defaults=None,\n            annotations=None,\n            source_ref=source_ref,\n        ),\n        values=(makeExpressionMakeTuple(helper_args, source_ref),),\n        source_ref=source_ref,\n    )\n\n    result.setCompatibleSourceReference(helper_args[-1].getCompatibleSourceReference())\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationExecStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of \"exec\" statements\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.BuiltinRefNodes import ExpressionBuiltinExceptionRef\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import (\n    ExpressionConditional,\n    makeStatementConditional,\n)\nfrom nuitka.nodes.ConstantRefNodes import (\n    ExpressionConstantNoneRef,\n    makeConstantRefNode,\n)\nfrom nuitka.nodes.ExceptionNodes import StatementRaiseException\nfrom nuitka.nodes.ExecEvalNodes import StatementExec, StatementLocalsDictSync\nfrom nuitka.nodes.GlobalsLocalsNodes import ExpressionBuiltinGlobals\nfrom nuitka.nodes.NodeMakingHelpers import makeExpressionBuiltinLocals\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementsReleaseVariables\n\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    getKind,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n)\n\n\ndef wrapEvalGlobalsAndLocals(\n    provider, globals_node, locals_node, temp_scope, source_ref\n):\n    \"\"\"Wrap the locals and globals arguments for \"eval\".\n\n    This is called from the outside, and when the node tree\n    already exists.\n    \"\"\"\n\n    locals_scope = provider.getLocalsScope()\n\n    globals_keeper_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"globals\", temp_type=\"object\"\n    )\n\n    locals_keeper_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"locals\", temp_type=\"object\"\n    )\n\n    if locals_node is None:\n        locals_node = ExpressionConstantNoneRef(source_ref=source_ref)\n\n    if globals_node is None:\n        globals_node = ExpressionConstantNoneRef(source_ref=source_ref)\n\n    post_statements = []\n\n    if provider.isExpressionClassBodyBase():\n        post_statements.append(\n            StatementLocalsDictSync(\n                locals_scope=locals_scope,\n                locals_arg=ExpressionTempVariableRef(\n                    variable=locals_keeper_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref.atInternal(),\n            )\n        )\n\n    post_statements += makeStatementsReleaseVariables(\n        variables=(globals_keeper_variable, locals_keeper_variable),\n        source_ref=source_ref,\n    )\n\n    # The locals default is dependent on exec_mode, globals or locals.\n    locals_default = ExpressionConditional(\n        condition=ExpressionComparisonIs(\n            left=ExpressionTempVariableRef(\n                variable=globals_keeper_variable, source_ref=source_ref\n            ),\n            right=ExpressionConstantNoneRef(source_ref=source_ref),\n            source_ref=source_ref,\n        ),\n        expression_no=ExpressionTempVariableRef(\n            variable=globals_keeper_variable, source_ref=source_ref\n        ),\n        expression_yes=makeExpressionBuiltinLocals(\n            locals_scope=locals_scope, source_ref=source_ref\n        ),\n        source_ref=source_ref,\n    )\n\n    pre_statements = [\n        # First assign globals and locals temporary the values given.\n        makeStatementAssignmentVariable(\n            variable=globals_keeper_variable, source=globals_node, source_ref=source_ref\n        ),\n        makeStatementAssignmentVariable(\n            variable=locals_keeper_variable, source=locals_node, source_ref=source_ref\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIs(\n                left=ExpressionTempVariableRef(\n                    variable=locals_keeper_variable, source_ref=source_ref\n                ),\n                right=ExpressionConstantNoneRef(source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            yes_branch=makeStatementAssignmentVariable(\n                variable=locals_keeper_variable,\n                source=locals_default,\n                source_ref=source_ref,\n            ),\n            no_branch=None,\n            source_ref=source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIs(\n                left=ExpressionTempVariableRef(\n                    variable=globals_keeper_variable, source_ref=source_ref\n                ),\n                right=ExpressionConstantNoneRef(source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            yes_branch=makeStatementAssignmentVariable(\n                variable=globals_keeper_variable,\n                source=ExpressionBuiltinGlobals(source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            no_branch=None,\n            source_ref=source_ref,\n        ),\n    ]\n\n    return (\n        ExpressionTempVariableRef(\n            variable=globals_keeper_variable,\n            source_ref=(\n                source_ref\n                if globals_node is None\n                else globals_node.getSourceReference()\n            ),\n        ),\n        ExpressionTempVariableRef(\n            variable=locals_keeper_variable,\n            source_ref=(\n                source_ref if locals_node is None else locals_node.getSourceReference()\n            ),\n        ),\n        makeStatementsSequence(pre_statements, False, source_ref),\n        makeStatementsSequence(post_statements, False, source_ref),\n    )\n\n\ndef buildExecNode(provider, node, source_ref):\n    # \"exec\" statements, should only occur with Python2.\n\n    # This is using many variables, due to the many details this is\n    # dealing with. The locals and globals need to be dealt with in\n    # temporary variables, and we need handling of indicators, so\n    # that is just the complexity, pylint: disable=too-many-locals\n\n    exec_globals = node.globals\n    exec_locals = node.locals\n    body = node.body\n\n    # Handle exec(a,b,c) to be same as exec a, b, c\n    if exec_locals is None and exec_globals is None and getKind(body) == \"Tuple\":\n        parts = body.elts\n        body = parts[0]\n\n        if len(parts) > 1:\n            exec_globals = parts[1]\n\n            if len(parts) > 2:\n                exec_locals = parts[2]\n        else:\n            return StatementRaiseException(\n                exception_type=ExpressionBuiltinExceptionRef(\n                    exception_name=\"TypeError\", source_ref=source_ref\n                ),\n                exception_value=makeConstantRefNode(\n                    constant=\"\"\"\\\nexec: arg 1 must be a string, file, or code object\"\"\",\n                    source_ref=source_ref,\n                ),\n                exception_trace=None,\n                exception_cause=None,\n                source_ref=source_ref,\n            )\n\n    temp_scope = provider.allocateTempScope(\"exec\")\n\n    locals_value = buildNode(provider, exec_locals, source_ref, True)\n\n    if locals_value is None:\n        locals_value = ExpressionConstantNoneRef(source_ref=source_ref)\n\n    globals_value = buildNode(provider, exec_globals, source_ref, True)\n\n    if globals_value is None:\n        globals_value = ExpressionConstantNoneRef(source_ref=source_ref)\n\n    source_code = buildNode(provider, body, source_ref)\n\n    source_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"exec_source\", temp_type=\"object\"\n    )\n\n    globals_keeper_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"globals\", temp_type=\"object\"\n    )\n\n    locals_keeper_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"locals\", temp_type=\"object\"\n    )\n\n    plain_indicator_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"plain\", temp_type=\"bool\"\n    )\n\n    tried = (\n        # First evaluate the source code expressions.\n        makeStatementAssignmentVariable(\n            variable=source_variable, source=source_code, source_ref=source_ref\n        ),\n        # Assign globals and locals temporary the values given, then fix it\n        # up, taking note in the \"plain\" temporary variable, if it was an\n        # \"exec\" statement with None arguments, in which case the copy back\n        # will be necessary.\n        makeStatementAssignmentVariable(\n            variable=globals_keeper_variable,\n            source=globals_value,\n            source_ref=source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=locals_keeper_variable, source=locals_value, source_ref=source_ref\n        ),\n        makeStatementAssignmentVariable(\n            variable=plain_indicator_variable,\n            source=makeConstantRefNode(constant=False, source_ref=source_ref),\n            source_ref=source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIs(\n                left=ExpressionTempVariableRef(\n                    variable=globals_keeper_variable, source_ref=source_ref\n                ),\n                right=ExpressionConstantNoneRef(source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            yes_branch=makeStatementsSequenceFromStatements(\n                makeStatementAssignmentVariable(\n                    variable=globals_keeper_variable,\n                    source=ExpressionBuiltinGlobals(source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                makeStatementConditional(\n                    condition=ExpressionComparisonIs(\n                        left=ExpressionTempVariableRef(\n                            variable=locals_keeper_variable, source_ref=source_ref\n                        ),\n                        right=ExpressionConstantNoneRef(source_ref=source_ref),\n                        source_ref=source_ref,\n                    ),\n                    yes_branch=makeStatementsSequenceFromStatements(\n                        makeStatementAssignmentVariable(\n                            variable=locals_keeper_variable,\n                            source=makeExpressionBuiltinLocals(\n                                locals_scope=provider.getLocalsScope(),\n                                source_ref=source_ref,\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        makeStatementAssignmentVariable(\n                            variable=plain_indicator_variable,\n                            source=makeConstantRefNode(\n                                constant=True, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                    ),\n                    no_branch=None,\n                    source_ref=source_ref,\n                ),\n            ),\n            no_branch=makeStatementsSequenceFromStatements(\n                makeStatementConditional(\n                    condition=ExpressionComparisonIs(\n                        left=ExpressionTempVariableRef(\n                            variable=locals_keeper_variable, source_ref=source_ref\n                        ),\n                        right=ExpressionConstantNoneRef(source_ref=source_ref),\n                        source_ref=source_ref,\n                    ),\n                    yes_branch=makeStatementsSequenceFromStatement(\n                        statement=makeStatementAssignmentVariable(\n                            variable=locals_keeper_variable,\n                            source=ExpressionTempVariableRef(\n                                variable=globals_keeper_variable, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        )\n                    ),\n                    no_branch=None,\n                    source_ref=source_ref,\n                )\n            ),\n            source_ref=source_ref,\n        ),\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=StatementExec(\n                source_code=ExpressionTempVariableRef(\n                    variable=source_variable, source_ref=source_ref\n                ),\n                globals_arg=ExpressionTempVariableRef(\n                    variable=globals_keeper_variable, source_ref=source_ref\n                ),\n                locals_arg=ExpressionTempVariableRef(\n                    variable=locals_keeper_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            final=makeStatementConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionTempVariableRef(\n                        variable=plain_indicator_variable, source_ref=source_ref\n                    ),\n                    right=makeConstantRefNode(constant=True, source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=StatementLocalsDictSync(\n                    locals_scope=provider.getLocalsScope(),\n                    locals_arg=ExpressionTempVariableRef(\n                        variable=locals_keeper_variable, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    return makeTryFinallyStatement(\n        provider=provider,\n        tried=tried,\n        final=makeStatementsReleaseVariables(\n            variables=(\n                source_variable,\n                globals_keeper_variable,\n                locals_keeper_variable,\n                plain_indicator_variable,\n            ),\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\n# This is here, to make sure it can register, pylint: disable=W0611\nimport nuitka.optimizations.OptimizeBuiltinCalls  # isort:skip\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationForLoopStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of for loop statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.BuiltinIteratorNodes import (\n    ExpressionAsyncIter,\n    ExpressionAsyncNext,\n    ExpressionBuiltinIter1,\n)\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.StatementNodes import StatementsSequence\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.nodes.YieldNodes import ExpressionYieldFromAwaitable\n\nfrom .ReformulationAssignmentStatements import buildAssignmentStatements\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildStatementsNode,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatements,\n    popBuildContext,\n    pushBuildContext,\n)\n\n\ndef _buildForLoopNode(provider, node, sync, source_ref):\n    # The for loop is re-formulated according to Developer Manual. An iterator\n    # is created, and looped until it gives StopIteration. The else block is\n    # taken if a for loop exits normally, i.e. because of iterator\n    # exhaustion. We do this by introducing an indicator variable.\n\n    # We handle async and sync both here, leading to cases, pylint: disable=too-many-locals\n\n    source = buildNode(provider, node.iter, source_ref)\n\n    # Temporary variables, we need one for the iterator, and one for the current\n    # value.\n    temp_scope = provider.allocateTempScope(\"for_loop\")\n\n    tmp_iter_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"for_iterator\", temp_type=\"object\"\n    )\n    tmp_value_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"iter_value\", temp_type=\"object\"\n    )\n\n    else_block = buildStatementsNode(\n        provider=provider,\n        nodes=node.orelse if node.orelse else None,\n        source_ref=source_ref,\n    )\n\n    if else_block is not None:\n        # Indicator variable, will end up with C bool type, and need not be released.\n        tmp_break_indicator = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"break_indicator\", temp_type=\"bool\"\n        )\n\n        statements = [\n            makeStatementAssignmentVariable(\n                variable=tmp_break_indicator,\n                source=makeConstantRefNode(constant=True, source_ref=source_ref),\n                source_ref=source_ref,\n            )\n        ]\n    else:\n        statements = []\n\n    statements.append(StatementLoopBreak(source_ref=source_ref))\n\n    handler_body = makeStatementsSequence(\n        statements=statements, allow_none=False, source_ref=source_ref\n    )\n\n    if sync:\n        next_node = ExpressionBuiltinNext1(\n            value=ExpressionTempVariableRef(\n                variable=tmp_iter_variable, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n    else:\n        next_node = ExpressionYieldFromAwaitable(\n            expression=ExpressionAsyncNext(\n                value=ExpressionTempVariableRef(\n                    variable=tmp_iter_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n    statements = (\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_value_variable, source=next_node, source_ref=source_ref\n            ),\n            exception_name=\"StopIteration\" if sync else \"StopAsyncIteration\",\n            handler_body=handler_body,\n            source_ref=source_ref,\n        ),\n        buildAssignmentStatements(\n            provider=provider,\n            node=node.target,\n            source=ExpressionTempVariableRef(\n                variable=tmp_value_variable, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    pushBuildContext(\"loop_body\")\n    statements += (\n        buildStatementsNode(provider=provider, nodes=node.body, source_ref=source_ref),\n    )\n    popBuildContext()\n\n    loop_body = makeStatementsSequence(\n        statements=statements, allow_none=True, source_ref=source_ref\n    )\n\n    cleanup_statements = (\n        makeStatementReleaseVariable(\n            variable=tmp_value_variable, source_ref=source_ref\n        ),\n        makeStatementReleaseVariable(variable=tmp_iter_variable, source_ref=source_ref),\n    )\n\n    if else_block is not None:\n        statements = [\n            makeStatementAssignmentVariable(\n                variable=tmp_break_indicator,\n                source=makeConstantRefNode(constant=False, source_ref=source_ref),\n                source_ref=source_ref,\n            )\n        ]\n    else:\n        statements = []\n\n    if sync:\n        iter_source = ExpressionBuiltinIter1(\n            value=source, source_ref=source.getSourceReference()\n        )\n    else:\n        iter_source = ExpressionYieldFromAwaitable(\n            expression=ExpressionAsyncIter(\n                value=source, source_ref=source.getSourceReference()\n            ),\n            source_ref=source.getSourceReference(),\n        )\n\n    statements += (\n        # First create the iterator and store it.\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable, source=iter_source, source_ref=source_ref\n        ),\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=StatementLoop(loop_body=loop_body, source_ref=source_ref),\n            final=StatementsSequence(\n                statements=cleanup_statements, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    if else_block is not None:\n        statements.append(\n            makeStatementConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_break_indicator, source_ref=source_ref\n                    ),\n                    right=makeConstantRefNode(constant=True, source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=else_block,\n                no_branch=None,\n                source_ref=source_ref,\n            )\n        )\n\n    return makeStatementsSequenceFromStatements(*statements)\n\n\ndef buildForLoopNode(provider, node, source_ref):\n    return _buildForLoopNode(provider, node, True, source_ref)\n\n\ndef buildAsyncForLoopNode(provider, node, source_ref):\n    return _buildForLoopNode(provider, node, False, source_ref)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationFunctionStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of function statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nimport ast\n\nfrom nuitka.nodes.AsyncgenNodes import (\n    ExpressionAsyncgenObjectBody,\n    ExpressionMakeAsyncgenObject,\n)\nfrom nuitka.nodes.BuiltinIteratorNodes import (\n    ExpressionBuiltinIter1,\n    StatementSpecialUnpackCheck,\n)\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionSpecialUnpack\nfrom nuitka.nodes.BuiltinRefNodes import makeExpressionBuiltinTypeRef\nfrom nuitka.nodes.CodeObjectSpecs import CodeObjectSpec\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.CoroutineNodes import (\n    ExpressionCoroutineObjectBody,\n    ExpressionMakeCoroutineObject,\n)\nfrom nuitka.nodes.ExecEvalNodes import ExpressionBuiltinExec\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionBody,\n    ExpressionFunctionRef,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.GeneratorNodes import (\n    ExpressionGeneratorObjectBody,\n    ExpressionMakeGeneratorObject,\n    StatementGeneratorReturnNone,\n)\nfrom nuitka.nodes.LocalsDictNodes import StatementSetLocalsDictionary\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineFunction\nfrom nuitka.nodes.ReturnNodes import StatementReturn, StatementReturnNone\nfrom nuitka.nodes.StatementNodes import StatementExpressionOnly\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableNameNodes import (\n    ExpressionVariableNameRef,\n    StatementAssignmentVariableName,\n)\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.Options import hasPythonFlagNoAnnotations\nfrom nuitka.plugins.Plugins import Plugins, hasActivePlugin\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.ParameterSpecs import ParameterSpec\n\nfrom .ReformulationExecStatements import wrapEvalGlobalsAndLocals\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .SyntaxErrors import raiseSyntaxError\nfrom .TreeHelpers import (\n    buildAnnotationNode,\n    buildFrameNode,\n    buildNode,\n    buildNodeList,\n    buildNodeTuple,\n    detectFunctionBodyKind,\n    extractDocFromBody,\n    getKind,\n    makeCallNode,\n    makeDictCreationOrConstant2,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    mangleName,\n)\n\n\ndef _insertFinalReturnStatement(function_statements_body, return_statement):\n    if function_statements_body is None:\n        function_statements_body = makeStatementsSequenceFromStatement(\n            statement=return_statement\n        )\n    elif not function_statements_body.isStatementAborting():\n        function_statements_body.setChildStatements(\n            function_statements_body.subnode_statements + (return_statement,)\n        )\n\n    return function_statements_body\n\n\ndef _insertInitialSetLocalsDictStatement(function_body, function_statements_body):\n    locals_statement = StatementSetLocalsDictionary(\n        locals_scope=function_body.getLocalsScope(), source_ref=function_body.source_ref\n    )\n\n    if function_statements_body is None:\n        function_statements_body = makeStatementsSequenceFromStatement(\n            statement=locals_statement\n        )\n    else:\n        function_statements_body.setChildStatements(\n            (locals_statement,) + function_statements_body.subnode_statements\n        )\n\n    return function_statements_body\n\n\ndef _injectDecorator(decorators, inject, acceptable, source_ref):\n    assert type(decorators) is list\n    assert type(inject) is str\n    assert type(acceptable) is tuple\n\n    for decorator in decorators:\n        if (\n            decorator.isExpressionVariableNameRef()\n            and decorator.getVariableName() in acceptable\n        ):\n            break\n    else:\n        decorators.append(\n            makeExpressionBuiltinTypeRef(builtin_name=inject, source_ref=source_ref)\n        )\n\n\n_has_pyqt_plugin = None\n\n\ndef decideFunctionCompilationMode(decorators):\n    \"\"\"Decide how to compile a function based on decorator names.\"\"\"\n\n    global _has_pyqt_plugin  # singleton, pylint: disable=global-statement\n\n    if _has_pyqt_plugin is None:\n        _has_pyqt_plugin = hasActivePlugin(\"pyqt5\") or hasActivePlugin(\"pyqt6\")\n\n    # TODO: Expose the interface to plugins, so we don't hardcode stuff for\n    # specific plugins here, but for performance I guess, we would have to add a\n    # registry for the plugins to use, so not every decorator name is being\n    # called for every plugin.\n\n    # TODO: This can only work with 3.9 or higher so far.\n    if _has_pyqt_plugin and python_version >= 0x390:\n        for decorator in decorators:\n            if (\n                decorator.isExpressionCall()\n                and decorator.subnode_called.isExpressionVariableNameRef()\n            ):\n                if decorator.subnode_called.variable_name in (\"pyqtSlot\", \"asyncSlot\"):\n                    return \"bytecode\"\n\n    return \"compiled\"\n\n\ndef _buildBytecodeOrSourceFunction(provider, node, compilation_mode, source_ref):\n    # TODO: We should have a compile() builtin usage here, lookup \"co_code\" and\n    # support that as a constant value. We then would have the \"bytecode\" only\n    # in the binary, right now \"bytecode\" and \"source\" make no difference. For\n    # commercial, we need to protect this constant just like all the others, and\n    # ideally maybe, we add (delayed creation) code objects from blobs for use\n    # by compiled code, while doing this. pylint: disable=unused-argument\n    source_code = ast.unparse(node)\n\n    source = makeConstantRefNode(\n        constant=source_code,\n        source_ref=source_ref,\n        user_provided=True,\n    )\n\n    # if compilation_mode == \"bytecode\":\n    #     source = ExpressionBuiltinCompile(\n    #         source_code=source,\n    #         filename=makeConstantRefNode(constant=\"<exec>\", source_ref=source_ref),\n    #         mode=makeConstantRefNode(constant=\"exec\", source_ref=source_ref),\n    #         flags=None,\n    #         dont_inherit=None,\n    #         optimize=None,\n    #         source_ref=source_ref\n    #     )\n\n    # This is actually for the globals locals usage to be default values of the\n    # scope.\n\n    temp_scope = provider.allocateTempScope(\"function_exec\")\n\n    globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(\n        provider=provider,\n        globals_node=None,\n        locals_node=None,\n        temp_scope=temp_scope,\n        source_ref=source_ref,\n    )\n\n    tried = makeStatementsSequence(\n        statements=(\n            tried,\n            (\n                StatementExpressionOnly(\n                    expression=ExpressionBuiltinExec(\n                        source_code=source,\n                        globals_arg=globals_ref,\n                        locals_arg=locals_ref,\n                        closure=None,\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            ),\n        ),\n        allow_none=False,\n        source_ref=source_ref,\n    )\n\n    # Hack: Allow some APIs to work already\n    # tried.parent = provider\n\n    return makeTryFinallyStatement(\n        provider=provider,\n        tried=tried,\n        final=final,\n        source_ref=source_ref,\n    )\n\n\ndef buildFunctionNode(provider, node, source_ref):\n    # Functions have way too many details, pylint: disable=too-many-branches,too-many-locals\n\n    assert getKind(node) == \"FunctionDef\"\n\n    decorators = buildNodeList(\n        provider=provider, nodes=reversed(node.decorator_list), source_ref=source_ref\n    )\n\n    compilation_mode = decideFunctionCompilationMode(decorators)\n\n    Plugins.onFunctionBodyParsing(\n        provider=provider, function_name=node.name, body=node.body\n    )\n\n    if compilation_mode != \"compiled\":\n        node.name = mangleName(node.name, provider)\n\n        return _buildBytecodeOrSourceFunction(\n            provider=provider,\n            node=node,\n            compilation_mode=compilation_mode,\n            source_ref=source_ref,\n        )\n\n    function_statement_nodes, function_doc = extractDocFromBody(node)\n\n    function_kind, flags = detectFunctionBodyKind(nodes=function_statement_nodes)\n\n    function_body, code_body, code_object = buildFunctionWithParsing(\n        provider=provider,\n        function_kind=function_kind,\n        name=node.name,\n        function_doc=function_doc,\n        flags=flags,\n        node=node,\n        source_ref=source_ref,\n    )\n\n    if function_kind in (\"Generator\", \"Coroutine\"):\n        if function_kind == \"Coroutine\":\n            code_body = ExpressionCoroutineObjectBody(\n                provider=function_body,\n                name=node.name,\n                code_object=code_object,\n                flags=flags,\n                auto_release=None,\n                source_ref=source_ref,\n            )\n\n            maker_class = ExpressionMakeCoroutineObject\n        else:\n            code_body = ExpressionGeneratorObjectBody(\n                provider=function_body,\n                name=node.name,\n                code_object=code_object,\n                flags=flags,\n                auto_release=None,\n                source_ref=source_ref,\n            )\n\n            maker_class = ExpressionMakeGeneratorObject\n\n        code_body.qualname_provider = provider\n\n        for variable in function_body.getProvidedVariables():\n            code_body.getVariableForReference(variable.getName())\n\n        function_body.setChildBody(\n            makeStatementsSequenceFromStatement(\n                statement=StatementReturn(\n                    expression=maker_class(\n                        ExpressionFunctionRef(\n                            function_body=code_body, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n        )\n\n    defaults = buildNodeTuple(\n        provider=provider, nodes=node.args.defaults, source_ref=source_ref\n    )\n\n    kw_defaults = buildParameterKwDefaults(\n        provider=provider, node=node, function_body=function_body, source_ref=source_ref\n    )\n\n    function_statements_body = buildFrameNode(\n        provider=code_body,\n        nodes=function_statement_nodes,\n        code_object=code_object,\n        source_ref=source_ref,\n    )\n\n    if function_kind == \"Function\":\n        # TODO: Generators might have to raise GeneratorExit instead.\n        function_statements_body = _insertFinalReturnStatement(\n            function_statements_body=function_statements_body,\n            return_statement=StatementReturnNone(source_ref=source_ref),\n        )\n\n    if \"has_exec\" in flags:\n        function_statements_body = _insertInitialSetLocalsDictStatement(\n            function_body=code_body, function_statements_body=function_statements_body\n        )\n\n    if function_statements_body.isStatementsFrame():\n        function_statements_body = makeStatementsSequenceFromStatement(\n            statement=function_statements_body\n        )\n\n    code_body.setChildBody(function_statements_body)\n\n    annotations = buildParameterAnnotations(provider, node, source_ref)\n\n    function_creation = makeExpressionFunctionCreation(\n        function_ref=ExpressionFunctionRef(\n            function_body=function_body, source_ref=source_ref\n        ),\n        defaults=defaults,\n        kw_defaults=kw_defaults,\n        annotations=annotations,\n        source_ref=source_ref,\n    )\n\n    # Add the \"staticmethod\" decorator to __new__ methods if not provided.\n\n    # CPython 2.x made these optional, but secretly applies them when it does\n    # \"class __new__\".  We add them earlier, so our optimization will see it.\n    if (\n        python_version < 0x300\n        and node.name == \"__new__\"\n        and provider.isExpressionClassBodyBase()\n    ):\n        _injectDecorator(\n            decorators, \"staticmethod\", (\"staticmethod\", \"classmethod\"), source_ref\n        )\n\n    # Add the \"classmethod\" decorator to __init_subclass__ methods if not provided.\n    if (\n        python_version >= 0x360\n        and node.name == \"__init_subclass__\"\n        and provider.isExpressionClassBodyBase()\n    ):\n        _injectDecorator(decorators, \"classmethod\", (\"classmethod\",), source_ref)\n\n    if (\n        python_version >= 0x370\n        and node.name == \"__class_getitem__\"\n        and provider.isExpressionClassBodyBase()\n    ):\n        _injectDecorator(decorators, \"classmethod\", (\"classmethod\",), source_ref)\n\n    decorated_function = function_creation\n    for decorator in decorators:\n        decorated_function = makeCallNode(\n            decorator, decorated_function, decorator.getSourceReference()\n        )\n\n    result = StatementAssignmentVariableName(\n        provider=provider,\n        variable_name=mangleName(node.name, provider),\n        source=decorated_function,\n        source_ref=source_ref,\n    )\n\n    if python_version >= 0x340:\n        function_body.qualname_setup = result.getVariableName()\n\n    return result\n\n\ndef buildAsyncFunctionNode(provider, node, source_ref):\n    # We are creating a function here that creates coroutine objects, with\n    # many details each, pylint: disable=too-many-locals\n    assert getKind(node) == \"AsyncFunctionDef\"\n\n    decorators = buildNodeList(\n        provider=provider, nodes=reversed(node.decorator_list), source_ref=source_ref\n    )\n\n    compilation_mode = decideFunctionCompilationMode(decorators)\n\n    Plugins.onFunctionBodyParsing(\n        provider=provider, function_name=node.name, body=node.body\n    )\n\n    if compilation_mode != \"compiled\":\n        return _buildBytecodeOrSourceFunction(\n            provider=provider,\n            node=node,\n            compilation_mode=compilation_mode,\n            source_ref=source_ref,\n        )\n\n    function_statement_nodes, function_doc = extractDocFromBody(node)\n\n    function_kind, flags = detectFunctionBodyKind(\n        nodes=function_statement_nodes, start_value=\"Coroutine\"\n    )\n\n    creator_function_body, _, code_object = buildFunctionWithParsing(\n        provider=provider,\n        function_kind=function_kind,\n        name=node.name,\n        function_doc=function_doc,\n        flags=(),\n        node=node,\n        source_ref=source_ref,\n    )\n\n    if function_kind == \"Coroutine\":\n        function_body = ExpressionCoroutineObjectBody(\n            provider=creator_function_body,\n            name=node.name,\n            code_object=code_object,\n            flags=flags,\n            auto_release=None,\n            source_ref=source_ref,\n        )\n    else:\n        function_body = ExpressionAsyncgenObjectBody(\n            provider=creator_function_body,\n            name=node.name,\n            code_object=code_object,\n            flags=flags,\n            auto_release=None,\n            source_ref=source_ref,\n        )\n\n    function_body.qualname_provider = provider\n\n    for variable in creator_function_body.getProvidedVariables():\n        function_body.getVariableForReference(variable.getName())\n\n    defaults = buildNodeTuple(\n        provider=provider, nodes=node.args.defaults, source_ref=source_ref\n    )\n\n    function_statements_body = buildFrameNode(\n        provider=function_body,\n        nodes=function_statement_nodes,\n        code_object=code_object,\n        source_ref=source_ref,\n    )\n\n    function_statements_body = _insertFinalReturnStatement(\n        function_statements_body=function_statements_body,\n        return_statement=StatementGeneratorReturnNone(source_ref=source_ref),\n    )\n\n    if function_statements_body.isStatementsFrame():\n        function_statements_body = makeStatementsSequenceFromStatement(\n            statement=function_statements_body\n        )\n\n    function_body.setChildBody(function_statements_body)\n\n    annotations = buildParameterAnnotations(provider, node, source_ref)\n\n    kw_defaults = buildParameterKwDefaults(\n        provider=provider,\n        node=node,\n        function_body=creator_function_body,\n        source_ref=source_ref,\n    )\n\n    if function_kind == \"Coroutine\":\n        creation_node = ExpressionMakeCoroutineObject(\n            coroutine_ref=ExpressionFunctionRef(\n                function_body=function_body, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n    else:\n        creation_node = ExpressionMakeAsyncgenObject(\n            asyncgen_ref=ExpressionFunctionRef(\n                function_body=function_body, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n\n    creator_function_body.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=StatementReturn(expression=creation_node, source_ref=source_ref)\n        )\n    )\n\n    function_creation = makeExpressionFunctionCreation(\n        function_ref=ExpressionFunctionRef(\n            function_body=creator_function_body, source_ref=source_ref\n        ),\n        defaults=defaults,\n        kw_defaults=kw_defaults,\n        annotations=annotations,\n        source_ref=source_ref,\n    )\n\n    decorated_function = function_creation\n    for decorator in decorators:\n        decorated_function = makeCallNode(\n            decorator, decorated_function, decorator.getSourceReference()\n        )\n\n    result = StatementAssignmentVariableName(\n        provider=provider,\n        variable_name=mangleName(node.name, provider),\n        source=decorated_function,\n        source_ref=source_ref,\n    )\n\n    function_body.qualname_setup = result.getVariableName()\n\n    # Share the non-local declarations. TODO: This may also apply to generators\n    # and async generators.\n    creator_function_body.non_local_declarations = function_body.non_local_declarations\n\n    return result\n\n\ndef buildParameterKwDefaults(provider, node, function_body, source_ref):\n    # Build keyword only arguments default values. We are hiding here, that it\n    # is a Python3 only feature.\n\n    if python_version >= 0x300:\n        kw_only_names = function_body.getParameters().getKwOnlyParameterNames()\n\n        if kw_only_names:\n            keys = []\n            values = []\n\n            for kw_only_name, kw_default in zip(kw_only_names, node.args.kw_defaults):\n                if kw_default is not None:\n                    keys.append(kw_only_name)\n                    values.append(buildNode(provider, kw_default, source_ref))\n\n            kw_defaults = makeDictCreationOrConstant2(\n                keys=keys, values=values, source_ref=source_ref\n            )\n        else:\n            kw_defaults = None\n    else:\n        kw_defaults = None\n\n    return kw_defaults\n\n\ndef buildParameterAnnotations(provider, node, source_ref):\n    # Too many branches, because there is too many cases, pylint: disable=too-many-branches\n\n    # The ast uses funny names a bunch.\n    # spell-checker: ignore elts,posonlyargs,kwonlyargs,varargannotation,vararg\n    # spell-checker: ignore kwargannotation\n\n    # Build annotations. We are hiding here, that it is a Python3 only feature.\n    if python_version < 0x300 or hasPythonFlagNoAnnotations():\n        return None\n\n    # Starting with Python 3.4, the names of parameters are mangled in\n    # annotations as well.\n    if python_version < 0x340:\n        mangle = lambda variable_name: variable_name\n    else:\n        mangle = lambda variable_name: mangleName(variable_name, provider)\n\n    keys = []\n    values = []\n\n    def addAnnotation(key, value):\n        keys.append(mangle(key))\n        values.append(value)\n\n    def extractArgAnnotation(arg):\n        if getKind(arg) == \"Name\":\n            assert arg.annotation is None\n        elif getKind(arg) == \"arg\":\n            if arg.annotation is not None:\n                addAnnotation(\n                    key=arg.arg,\n                    value=buildAnnotationNode(provider, arg.annotation, source_ref),\n                )\n        elif getKind(arg) == \"Tuple\":\n            for sub_arg in arg.elts:\n                extractArgAnnotation(sub_arg)\n        else:\n            assert False, getKind(arg)\n\n    if python_version >= 0x380:\n        for arg in node.args.posonlyargs:\n            extractArgAnnotation(arg)\n\n    for arg in node.args.args:\n        extractArgAnnotation(arg)\n\n    for arg in node.args.kwonlyargs:\n        extractArgAnnotation(arg)\n\n    if python_version < 0x340:\n        if node.args.varargannotation is not None:\n            addAnnotation(\n                key=node.args.vararg,\n                value=buildNode(provider, node.args.varargannotation, source_ref),\n            )\n\n        if node.args.kwargannotation is not None:\n            addAnnotation(\n                key=node.args.kwarg,\n                value=buildNode(provider, node.args.kwargannotation, source_ref),\n            )\n    else:\n        if node.args.vararg is not None:\n            extractArgAnnotation(node.args.vararg)\n        if node.args.kwarg is not None:\n            extractArgAnnotation(node.args.kwarg)\n\n    # Return value annotation (not there for lambdas)\n    if hasattr(node, \"returns\") and node.returns is not None:\n        addAnnotation(\n            key=\"return\", value=buildAnnotationNode(provider, node.returns, source_ref)\n        )\n\n    if keys:\n        return makeDictCreationOrConstant2(\n            keys=keys, values=values, source_ref=source_ref\n        )\n    else:\n        return None\n\n\ndef _wrapFunctionWithSpecialNestedArgs(\n    name, outer_body, parameters, special_args, source_ref\n):\n    inner_name = name.strip(\"<>\") + \"$inner\"\n    iter_vars = []\n\n    values = []\n\n    statements = []\n\n    def unpackFrom(source, arg_names):\n        accesses = []\n\n        sub_special_index = 0\n\n        iter_var = outer_body.allocateTempVariable(\n            temp_scope=None, name=\"arg_iter_%d\" % len(iter_vars), temp_type=\"object\"\n        )\n        iter_vars.append(iter_var)\n\n        statements.append(\n            makeStatementAssignmentVariable(\n                variable=iter_var,\n                source=ExpressionBuiltinIter1(value=source, source_ref=source_ref),\n                source_ref=source_ref,\n            )\n        )\n\n        for element_index, arg_name in enumerate(arg_names):\n            if getKind(arg_name) == \"Name\":\n                arg_var = outer_body.createProvidedVariable(arg_name.id)\n                outer_body.getLocalsScope().registerProvidedVariable(arg_var)\n\n                statements.append(\n                    makeStatementAssignmentVariable(\n                        variable=arg_var,\n                        source=ExpressionSpecialUnpack(\n                            value=ExpressionTempVariableRef(\n                                variable=iter_var, source_ref=source_ref\n                            ),\n                            count=element_index + 1,\n                            expected=len(arg_names),\n                            starred=False,\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                )\n\n                accesses.append(\n                    ExpressionVariableRef(variable=arg_var, source_ref=source_ref)\n                )\n            elif getKind(arg_name) == \"Tuple\":\n                accesses.extend(\n                    unpackFrom(\n                        source=ExpressionSpecialUnpack(\n                            value=ExpressionTempVariableRef(\n                                variable=iter_var, source_ref=source_ref\n                            ),\n                            count=element_index + 1,\n                            expected=len(arg_names),\n                            starred=False,\n                            source_ref=source_ref,\n                        ),\n                        arg_names=arg_name.elts,\n                    )\n                )\n\n                sub_special_index += 1\n            else:\n                assert False, arg_name\n\n        statements.append(\n            StatementSpecialUnpackCheck(\n                iterator=ExpressionTempVariableRef(\n                    variable=iter_var, source_ref=source_ref\n                ),\n                count=len(arg_names),\n                source_ref=source_ref,\n            )\n        )\n\n        return accesses\n\n    for arg_name in parameters.getParameterNames():\n        if arg_name.startswith(\".\"):\n            source = ExpressionVariableNameRef(\n                provider=outer_body, variable_name=arg_name, source_ref=source_ref\n            )\n\n            values.extend(unpackFrom(source, special_args[arg_name]))\n        else:\n            values.append(\n                ExpressionVariableNameRef(\n                    provider=outer_body, variable_name=arg_name, source_ref=source_ref\n                )\n            )\n\n    code_body = ExpressionOutlineFunction(\n        provider=outer_body, name=inner_name, source_ref=source_ref\n    )\n\n    statements.append(StatementReturn(expression=code_body, source_ref=source_ref))\n\n    outer_body.setChildBody(\n        makeStatementsSequenceFromStatement(\n            statement=makeTryFinallyStatement(\n                provider=outer_body,\n                tried=statements,\n                final=[\n                    makeStatementReleaseVariable(\n                        variable=variable, source_ref=source_ref\n                    )\n                    for variable in sorted(\n                        outer_body.getTempVariables(),\n                        key=lambda variable: variable.getName(),\n                    )\n                ],\n                source_ref=source_ref,\n                public_exc=False,\n            )\n        )\n    )\n\n    return code_body\n\n\ndef buildFunctionWithParsing(\n    provider, function_kind, name, function_doc, flags, node, source_ref\n):\n    # This contains a complex re-formulation for nested parameter functions.\n    # pylint: disable=too-many-locals\n\n    kind = getKind(node)\n    assert kind in (\"FunctionDef\", \"Lambda\", \"AsyncFunctionDef\"), (\n        \"unsupported for kind \" + kind\n    )\n\n    def extractArg(arg):\n        if arg is None:\n            return None\n        elif type(arg) is str:\n            return mangleName(arg, provider)\n        elif getKind(arg) == \"Name\":\n            return mangleName(arg.id, provider)\n        elif getKind(arg) == \"arg\":\n            return mangleName(arg.arg, provider)\n        elif getKind(arg) == \"Tuple\":\n            # These are to be re-formulated on the outside.\n            assert False\n        else:\n            assert False, getKind(arg)\n\n    special_args = {}\n\n    def extractNormalArgs(args):\n        normal_args = []\n\n        for arg in args:\n            if type(arg) is not str and getKind(arg) == \"Tuple\":\n                special_arg_name = \".%d\" % (len(special_args) + 1)\n\n                special_args[special_arg_name] = arg.elts\n                normal_args.append(special_arg_name)\n            else:\n                normal_args.append(extractArg(arg))\n\n        return normal_args\n\n    parameters = ParameterSpec(\n        ps_name=name,\n        ps_normal_args=extractNormalArgs(node.args.args),\n        ps_pos_only_args=(\n            [extractArg(arg) for arg in node.args.posonlyargs]\n            if python_version >= 0x380\n            else ()\n        ),\n        ps_kw_only_args=(\n            [extractArg(arg) for arg in node.args.kwonlyargs]\n            if python_version >= 0x300\n            else ()\n        ),\n        ps_list_star_arg=extractArg(node.args.vararg),\n        ps_dict_star_arg=extractArg(node.args.kwarg),\n        ps_default_count=len(node.args.defaults),\n    )\n\n    message = parameters.checkParametersValid()\n\n    if message is not None:\n        raiseSyntaxError(message, source_ref.atColumnNumber(node.col_offset))\n\n    parent_module = provider.getParentModule()\n\n    code_object = CodeObjectSpec(\n        co_name=name,\n        co_qualname=provider.getChildQualname(name),\n        co_kind=function_kind,\n        co_varnames=parameters.getParameterNames(),\n        co_freevars=(),\n        co_argcount=parameters.getArgumentCount(),\n        co_posonlyargcount=parameters.getPosOnlyParameterCount(),\n        co_kwonlyargcount=parameters.getKwOnlyParameterCount(),\n        co_has_starlist=parameters.getStarListArgumentName() is not None,\n        co_has_stardict=parameters.getStarDictArgumentName() is not None,\n        co_filename=parent_module.getRunTimeFilename(),\n        co_lineno=source_ref.getLineNumber(),\n        future_spec=parent_module.getFutureSpec(),\n    )\n\n    outer_body = ExpressionFunctionBody(\n        provider=provider,\n        name=name,\n        code_object=code_object,\n        flags=flags,\n        doc=function_doc,\n        parameters=parameters,\n        auto_release=None,\n        source_ref=source_ref,\n    )\n\n    # Wrap if necessary for special nested arguments.\n    if special_args:\n        code_body = _wrapFunctionWithSpecialNestedArgs(\n            name=name,\n            outer_body=outer_body,\n            parameters=parameters,\n            special_args=special_args,\n            source_ref=source_ref,\n        )\n\n    else:\n        code_body = outer_body\n\n    return outer_body, code_body, code_object\n\n\ndef addFunctionVariableReleases(function):\n    assert function.isExpressionFunctionBodyBase()\n\n    releases = []\n\n    # We attach everything to the function definition source location.\n    source_ref = function.getSourceReference()\n\n    for variable in function.getLocalVariables():\n        # Shared variables are freed by function attachment.\n        if variable.getOwner() is not function:\n            continue\n\n        releases.append(\n            makeStatementReleaseVariable(variable=variable, source_ref=source_ref)\n        )\n\n    if releases:\n        body = function.subnode_body\n\n        if body.isStatementsFrame():\n            body = makeStatementsSequenceFromStatement(statement=body)\n\n        body = makeTryFinallyStatement(\n            provider=function, tried=body, final=releases, source_ref=source_ref\n        )\n\n        function.setChildBody(makeStatementsSequenceFromStatement(statement=body))\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationImportStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of import statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\n# spell-checker: ignore fromlist,asname\n\nfrom nuitka.importing.ImportResolving import resolveModuleName\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.FutureSpecs import FutureSpec\nfrom nuitka.nodes.GlobalsLocalsNodes import ExpressionBuiltinGlobals\nfrom nuitka.nodes.ImportNodes import (\n    ExpressionBuiltinImport,\n    ExpressionImportName,\n    StatementImportStar,\n    makeExpressionImportModuleFixed,\n)\nfrom nuitka.nodes.NodeMakingHelpers import mergeStatements\nfrom nuitka.nodes.StatementNodes import StatementsSequence\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableNameNodes import StatementAssignmentVariableName\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.utils.ModuleNames import ModuleName\n\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .SyntaxErrors import raiseSyntaxError\nfrom .TreeHelpers import makeStatementsSequenceOrStatement, mangleName\n\n# For checking afterwards, if __future__ imports really were at the beginning\n# of the file.\n_future_import_nodes = []\n\n\ndef checkFutureImportsOnlyAtStart(body):\n    # Check if a __future__ imports really were at the beginning of the file.\n    for node in body:\n        if node in _future_import_nodes:\n            _future_import_nodes.remove(node)\n        else:\n            if _future_import_nodes:\n                raiseSyntaxError(\n                    \"\"\"\\\nfrom __future__ imports must occur at the beginning of the file\"\"\",\n                    _future_import_nodes[0].source_ref.atColumnNumber(\n                        _future_import_nodes[0].col_offset\n                    ),\n                )\n\n\ndef _handleFutureImport(provider, node, source_ref):\n    # Don't allow future imports in functions or classes.\n    if not provider.isCompiledPythonModule():\n        raiseSyntaxError(\n            \"\"\"\\\nfrom __future__ imports must occur at the beginning of the file\"\"\",\n            source_ref.atColumnNumber(node.col_offset),\n        )\n\n    for import_desc in node.names:\n        object_name, _local_name = import_desc.name, import_desc.asname\n\n        _enableFutureFeature(node=node, object_name=object_name, source_ref=source_ref)\n\n    # Remember it for checks to be applied once module is complete, e.g. if\n    # they are all at module start.\n    node.source_ref = source_ref\n    _future_import_nodes.append(node)\n\n\n_future_specs = []\n\n\ndef pushFutureSpec():\n    _future_specs.append(FutureSpec())\n\n\ndef getFutureSpec():\n    return _future_specs[-1]\n\n\ndef popFutureSpec():\n    del _future_specs[-1]\n\n\ndef _enableFutureFeature(node, object_name, source_ref):\n    future_spec = _future_specs[-1]\n\n    if object_name == \"unicode_literals\":\n        future_spec.enableUnicodeLiterals()\n    elif object_name == \"absolute_import\":\n        future_spec.enableAbsoluteImport()\n    elif object_name == \"division\":\n        future_spec.enableFutureDivision()\n    elif object_name == \"print_function\":\n        future_spec.enableFuturePrint()\n    elif object_name == \"barry_as_FLUFL\" and python_version >= 0x300:\n        future_spec.enableBarry()\n    elif object_name == \"generator_stop\":\n        future_spec.enableGeneratorStop()\n    elif object_name == \"braces\":\n        raiseSyntaxError(\"not a chance\", source_ref.atColumnNumber(node.col_offset))\n    elif object_name in (\"nested_scopes\", \"generators\", \"with_statement\"):\n        # These are enabled in all cases already.\n        pass\n    elif object_name == \"annotations\" and python_version >= 0x370:\n        future_spec.enableFutureAnnotations()\n    else:\n        raiseSyntaxError(\n            \"future feature %s is not defined\" % object_name,\n            source_ref.atColumnNumber(node.col_offset),\n        )\n\n\ndef _resolveImportModuleName(module_name):\n    if module_name:\n        module_name = resolveModuleName(ModuleName(module_name)).asString()\n\n    return module_name\n\n\ndef buildImportFromNode(provider, node, source_ref):\n    # \"from .. import ..\" statements. This may trigger a star import, or\n    # multiple names being looked up from the given module variable name.\n    # This is pretty complex.\n    # pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    module_name = node.module if node.module is not None else \"\"\n\n    module_name = _resolveImportModuleName(module_name)\n\n    level = node.level\n\n    # Use default level under some circumstances.\n    if level == -1:\n        level = None\n    elif level == 0 and not _future_specs[-1].isAbsoluteImport():\n        level = None\n\n    if level is not None:\n        level_obj = makeConstantRefNode(level, source_ref, True)\n    else:\n        level_obj = None\n\n    # Importing from \"__future__\" module may enable flags to the parser,\n    # that we need to know about, handle that.\n    if module_name == \"__future__\":\n        _handleFutureImport(provider, node, source_ref)\n\n    target_names = []\n    import_names = []\n\n    # Mapping imported \"fromlist\" to assigned \"fromlist\" if any, handling the\n    # star case as well.\n    for import_desc in node.names:\n        object_name, local_name = import_desc.name, import_desc.asname\n\n        if object_name == \"*\":\n            target_names.append(None)\n            assert local_name is None\n        else:\n            target_names.append(local_name if local_name is not None else object_name)\n\n        import_names.append(object_name)\n\n    # Star imports get special treatment.\n    if None in target_names:\n        # More than \"*\" is a syntax error in Python, need not care about this at\n        # all, it's only allowed value for import list in  this case.\n        assert target_names == [None]\n\n        # Python3 made it so that these can only occur on the module level,\n        # so this a syntax error if not there. For Python2 it is OK to\n        # occur everywhere though.\n        if not provider.isCompiledPythonModule() and python_version >= 0x300:\n            raiseSyntaxError(\n                \"import * only allowed at module level\",\n                source_ref.atColumnNumber(node.col_offset),\n            )\n\n        if provider.isCompiledPythonModule():\n            import_globals = ExpressionBuiltinGlobals(source_ref)\n            import_locals = ExpressionBuiltinGlobals(source_ref)\n        else:\n            import_globals = ExpressionBuiltinGlobals(source_ref)\n            import_locals = makeConstantRefNode({}, source_ref, True)\n\n        return StatementImportStar(\n            target_scope=provider.getLocalsScope(),\n            module=ExpressionBuiltinImport(\n                name=makeConstantRefNode(module_name, source_ref, True),\n                globals_arg=import_globals,\n                locals_arg=import_locals,\n                fromlist=makeConstantRefNode((\"*\",), source_ref, True),\n                level=level_obj,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n    else:\n        if module_name == \"__future__\":\n            imported_from_module = makeExpressionImportModuleFixed(\n                using_module_name=provider.getParentModule().getFullName(),\n                module_name=\"__future__\",\n                value_name=\"__future__\",\n                source_ref=source_ref,\n            )\n        else:\n            imported_from_module = ExpressionBuiltinImport(\n                name=makeConstantRefNode(module_name, source_ref, True),\n                globals_arg=ExpressionBuiltinGlobals(source_ref),\n                locals_arg=makeConstantRefNode(None, source_ref, True),\n                fromlist=makeConstantRefNode(tuple(import_names), source_ref, True),\n                level=level_obj,\n                source_ref=source_ref,\n            )\n\n        # If we have multiple names to import, consider each.\n        multi_names = len(target_names) > 1\n\n        statements = []\n\n        if multi_names:\n            tmp_import_from = provider.allocateTempVariable(\n                temp_scope=provider.allocateTempScope(\"import_from\"),\n                name=\"module\",\n                temp_type=\"object\",\n            )\n\n            statements.append(\n                makeStatementAssignmentVariable(\n                    variable=tmp_import_from,\n                    source=imported_from_module,\n                    source_ref=source_ref,\n                )\n            )\n\n            imported_from_module = ExpressionTempVariableRef(\n                variable=tmp_import_from, source_ref=source_ref\n            )\n\n        import_statements = []\n        first = True\n\n        for target_name, import_name in zip(target_names, import_names):\n            # Make a clone of the variable reference, if we are going to use\n            # another one.\n            if not first:\n                imported_from_module = imported_from_module.makeClone()\n            first = False\n\n            import_statements.append(\n                StatementAssignmentVariableName(\n                    provider=provider,\n                    variable_name=mangleName(target_name, provider),\n                    source=ExpressionImportName(\n                        module=imported_from_module,\n                        import_name=import_name,\n                        level=0,\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n        # Release the temporary module value as well.\n        if multi_names:\n            statements.append(\n                makeTryFinallyStatement(\n                    provider=provider,\n                    tried=import_statements,\n                    final=(\n                        makeStatementReleaseVariable(\n                            variable=tmp_import_from, source_ref=source_ref\n                        ),\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n        else:\n            statements.extend(import_statements)\n\n        # Note: Each import is sequential. It can succeed, and the failure of a\n        # later one is not undoing previous ones. We can therefore have a\n        # sequence of imports that each only import one thing therefore.\n        return StatementsSequence(\n            statements=mergeStatements(statements), source_ref=source_ref\n        )\n\n\ndef buildImportModulesNode(provider, node, source_ref):\n    # Import modules statement. As described in the Developer Manual, these\n    # statements can be treated as several ones.\n\n    import_names = [\n        (import_desc.name, import_desc.asname) for import_desc in node.names\n    ]\n\n    import_nodes = []\n\n    for import_desc in import_names:\n        module_name, local_name = import_desc\n\n        module_top_name = module_name.split(\".\")[0]\n\n        # Note: The \"level\" of import is influenced by the future absolute\n        # imports.\n        level = (\n            makeConstantRefNode(0, source_ref, True)\n            if _future_specs[-1].isAbsoluteImport()\n            else None\n        )\n\n        module_name = _resolveImportModuleName(module_name)\n\n        # TODO: Go to fixed node directly, avoiding the optimization for the\n        # node to do it, with absolute imports we can use makeExpressionImportModuleFixed\n        # instead.\n        import_node = ExpressionBuiltinImport(\n            name=makeConstantRefNode(module_name, source_ref, True),\n            globals_arg=ExpressionBuiltinGlobals(source_ref),\n            locals_arg=makeConstantRefNode(None, source_ref, True),\n            fromlist=makeConstantRefNode(None, source_ref, True),\n            level=level,\n            source_ref=source_ref,\n        )\n\n        if local_name:\n            # If is gets a local name, the real name must be used as a\n            # temporary value only, being looked up recursively.\n            for import_name in module_name.split(\".\")[1:]:\n                import_node = ExpressionImportName(\n                    module=import_node,\n                    import_name=import_name,\n                    # TODO: Does level make sense at all, should be removed.\n                    level=0,\n                    source_ref=source_ref,\n                )\n\n        # If a name was given, use the one provided, otherwise the import gives\n        # the top level package name given for assignment of the imported\n        # module.\n\n        import_nodes.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=mangleName(\n                    local_name if local_name is not None else module_top_name, provider\n                ),\n                source=import_node,\n                source_ref=source_ref,\n            )\n        )\n\n    # Note: Each import is sequential. It will potentially succeed, and the\n    # failure of a later one is not changing that one bit . We can therefore\n    # have a sequence of imports that only import one thing therefore.\n    return makeStatementsSequenceOrStatement(\n        statements=import_nodes, source_ref=source_ref\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationLambdaExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of lambda expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIsNot\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import ExpressionConstantNoneRef\nfrom nuitka.nodes.FrameNodes import (\n    StatementsFrameFunction,\n    StatementsFrameGenerator,\n)\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.GeneratorNodes import (\n    ExpressionGeneratorObjectBody,\n    ExpressionMakeGeneratorObject,\n)\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.StatementNodes import StatementExpressionOnly\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.nodes.YieldNodes import ExpressionYield\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationFunctionStatements import (\n    buildFunctionWithParsing,\n    buildParameterAnnotations,\n    buildParameterKwDefaults,\n)\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    detectFunctionBodyKind,\n    getKind,\n    makeStatementsSequenceFromStatement,\n    mergeStatements,\n)\n\n\ndef buildLambdaNode(provider, node, source_ref):\n    # Many details to deal with, pylint: disable=too-many-locals\n\n    assert getKind(node) == \"Lambda\"\n\n    function_kind, flags = detectFunctionBodyKind(nodes=(node.body,))\n\n    outer_body, function_body, code_object = buildFunctionWithParsing(\n        provider=provider,\n        function_kind=function_kind,\n        name=\"<lambda>\",\n        function_doc=None,\n        flags=flags,\n        node=node,\n        source_ref=source_ref,\n    )\n\n    if function_kind == \"Function\":\n        code_body = function_body\n    else:\n        code_body = ExpressionGeneratorObjectBody(\n            provider=function_body,\n            name=\"<lambda>\",\n            code_object=code_object,\n            flags=None,\n            auto_release=None,\n            source_ref=source_ref,\n        )\n        code_body.qualname_provider = provider\n\n    if function_kind == \"Generator\":\n        function_body.setChildBody(\n            makeStatementsSequenceFromStatement(\n                statement=StatementReturn(\n                    expression=ExpressionMakeGeneratorObject(\n                        generator_ref=ExpressionFunctionRef(\n                            function_body=code_body, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n        )\n\n    defaults = buildNodeTuple(provider, node.args.defaults, source_ref)\n    kw_defaults = buildParameterKwDefaults(\n        provider=provider, node=node, function_body=function_body, source_ref=source_ref\n    )\n\n    body = buildNode(provider=code_body, node=node.body, source_ref=source_ref)\n\n    if function_kind == \"Generator\":\n        if python_version < 0x270:\n            tmp_return_value = code_body.allocateTempVariable(\n                temp_scope=None, name=\"yield_return\", temp_type=\"object\"\n            )\n\n            statements = (\n                makeStatementAssignmentVariable(\n                    variable=tmp_return_value, source=body, source_ref=source_ref\n                ),\n                makeStatementConditional(\n                    condition=ExpressionComparisonIsNot(\n                        left=ExpressionTempVariableRef(\n                            variable=tmp_return_value, source_ref=source_ref\n                        ),\n                        right=ExpressionConstantNoneRef(source_ref=source_ref),\n                        source_ref=source_ref,\n                    ),\n                    yes_branch=StatementExpressionOnly(\n                        expression=ExpressionYield(\n                            expression=ExpressionTempVariableRef(\n                                variable=tmp_return_value, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    ),\n                    no_branch=None,\n                    source_ref=source_ref,\n                ),\n            )\n            body = makeTryFinallyStatement(\n                provider=provider,\n                tried=statements,\n                final=makeStatementReleaseVariable(\n                    variable=tmp_return_value, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        else:\n            body = StatementExpressionOnly(expression=body, source_ref=source_ref)\n    else:\n        body = StatementReturn(expression=body, source_ref=source_ref)\n\n    if function_kind == \"Generator\":\n        frame_class = StatementsFrameGenerator\n    else:\n        frame_class = StatementsFrameFunction\n\n    body = frame_class(\n        statements=mergeStatements((body,)),\n        code_object=code_object,\n        source_ref=body.getSourceReference(),\n    )\n\n    body = makeStatementsSequenceFromStatement(statement=body)\n\n    code_body.setChildBody(body)\n\n    annotations = buildParameterAnnotations(provider, node, source_ref)\n\n    return makeExpressionFunctionCreation(\n        function_ref=ExpressionFunctionRef(\n            function_body=outer_body, source_ref=source_ref\n        ),\n        defaults=defaults,\n        kw_defaults=kw_defaults,\n        annotations=annotations,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationMatchStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of Python3.10 match statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nimport ast\n\nfrom nuitka.nodes.AttributeNodes import (\n    ExpressionAttributeCheck,\n    makeExpressionAttributeLookup,\n)\nfrom nuitka.nodes.BuiltinLenNodes import ExpressionBuiltinLen\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinList\nfrom nuitka.nodes.ComparisonNodes import makeComparisonExpression\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.MatchNodes import ExpressionMatchArgs\nfrom nuitka.nodes.OutlineNodes import ExpressionOutlineBody\nfrom nuitka.nodes.ReturnNodes import makeStatementReturnConstant\nfrom nuitka.nodes.SubscriptNodes import (\n    ExpressionSubscriptCheck,\n    ExpressionSubscriptLookup,\n)\nfrom nuitka.nodes.TypeMatchNodes import (\n    ExpressionMatchTypeCheckMapping,\n    ExpressionMatchTypeCheckSequence,\n)\nfrom nuitka.nodes.TypeNodes import ExpressionBuiltinIsinstance\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableNameNodes import StatementAssignmentVariableName\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\n\nfrom .ReformulationBooleanExpressions import makeAndNode, makeOrNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildStatementsNode,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n)\n\n\ndef _makeMatchComparison(left, right, source_ref):\n    if right.isExpressionConstantBoolRef() or right.isExpressionConstantNoneRef():\n        comparator = \"Is\"\n    else:\n        comparator = \"Eq\"\n\n    return makeComparisonExpression(\n        left=left,\n        right=right,\n        comparator=comparator,\n        source_ref=source_ref,\n    )\n\n\ndef _buildCaseBodyCode(provider, case, source_ref):\n    guard_condition = buildNode(\n        provider=provider,\n        node=case.guard,\n        source_ref=source_ref,\n        allow_none=True,\n    )\n\n    body_code = buildStatementsNode(provider, case.body, source_ref)\n\n    return body_code, guard_condition\n\n\ndef _buildMatchAs(provider, pattern, make_against, source_ref):\n    variable_name = pattern.name\n\n    if variable_name is None:\n        # case _:\n\n        # Assigns to nothing and should be last one in a match\n        # statement, anything after that will be syntax error. TODO: This\n        # ought to only happen once, Python raises it, we do not yet:\n        # SyntaxError: name capture 'var' makes remaining patterns\n        # unreachable\n        assignments = None\n        conditions = None\n    else:\n        assert \".\" not in variable_name, variable_name\n        assert \"!\" not in variable_name, variable_name\n\n        if pattern.pattern is not None:\n            conditions, assignments = _buildMatch(\n                provider=provider,\n                pattern=pattern.pattern,\n                make_against=make_against,\n                source_ref=source_ref,\n            )\n\n            if assignments is None:\n                assignments = []\n        else:\n            assignments = []\n            conditions = None\n\n        assignments.append(\n            StatementAssignmentVariableName(\n                provider=provider,\n                variable_name=variable_name,\n                source=make_against(),\n                source_ref=source_ref,\n            )\n        )\n\n    return conditions, assignments\n\n\ndef _buildMatchValue(provider, make_against, pattern, source_ref):\n    if type(pattern) is ast.MatchValue:\n        right = buildNode(provider, pattern.value, source_ref)\n    else:\n        right = makeConstantRefNode(constant=pattern.value, source_ref=source_ref)\n\n    return _makeMatchComparison(\n        left=make_against(),\n        right=right,\n        source_ref=source_ref,\n    )\n\n\ndef _buildMatchSequence(provider, pattern, make_against, source_ref):\n    # Many cases due to recursion, pylint: disable=too-many-locals\n\n    conditions = [\n        ExpressionMatchTypeCheckSequence(\n            value=make_against(),\n            source_ref=source_ref,\n        )\n    ]\n\n    assignments = []\n\n    min_length = len(\n        tuple(\n            seq_pattern\n            for seq_pattern in pattern.patterns\n            if seq_pattern.__class__ is not ast.MatchStar\n        )\n    )\n\n    exact = all(\n        seq_pattern.__class__ is not ast.MatchStar for seq_pattern in pattern.patterns\n    )\n\n    # Could special case \">=1\" or \"==0\" with truth checks potentially, but that\n    # is for generic optimization to recognize, we don't know much about the\n    # matched value at this point yet.\n    conditions.append(\n        makeComparisonExpression(\n            left=ExpressionBuiltinLen(\n                value=make_against(),\n                source_ref=source_ref,\n            ),\n            right=makeConstantRefNode(constant=min_length, source_ref=source_ref),\n            comparator=\"Eq\" if exact else \"GtE\",\n            source_ref=source_ref,\n        )\n    )\n\n    star_pos = None\n\n    count = seq_pattern = None\n\n    for count, seq_pattern in enumerate(pattern.patterns):\n        # offset from the start.\n        if star_pos is None:\n            offset = count\n        else:\n            # offset from the end.\n            offset = -(len(pattern.patterns) - count)\n\n        if seq_pattern.__class__ is ast.MatchStar:\n            star_pos = count\n\n            variable_name = seq_pattern.name\n\n            if variable_name is not None:\n                assert \".\" not in variable_name, variable_name\n                assert \"!\" not in variable_name, variable_name\n\n                # Last one\n                if star_pos == len(pattern.patterns):\n                    slice_value = slice(count)\n                else:\n                    slice_value = slice(count, -(len(pattern.patterns) - (count + 1)))\n\n                assignments.append(\n                    StatementAssignmentVariableName(\n                        provider=provider,\n                        variable_name=variable_name,\n                        source=ExpressionBuiltinList(\n                            ExpressionSubscriptLookup(\n                                expression=make_against(),\n                                subscript=makeConstantRefNode(\n                                    constant=slice_value, source_ref=source_ref\n                                ),\n                                source_ref=source_ref,\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        source_ref=source_ref,\n                    )\n                )\n        else:\n            item_conditions, item_assignments = _buildMatch(\n                provider=provider,\n                pattern=seq_pattern,\n                # It's called before return, pylint: disable=cell-var-from-loop\n                make_against=lambda: ExpressionSubscriptLookup(\n                    expression=make_against(),\n                    subscript=makeConstantRefNode(\n                        constant=offset, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            )\n\n            if item_conditions:\n                conditions.extend(item_conditions)\n\n            if item_assignments:\n                assignments.extend(item_assignments)\n\n    return conditions, assignments\n\n\ndef _buildMatchMapping(provider, pattern, make_against, source_ref):\n    conditions = [\n        ExpressionMatchTypeCheckMapping(\n            value=make_against(),\n            source_ref=source_ref,\n        )\n    ]\n\n    assignments = []\n\n    assert len(pattern.keys) == len(pattern.patterns), ast.dump(pattern)\n\n    key = kwd_pattern = None\n\n    for key, kwd_pattern in zip(pattern.keys, pattern.patterns):\n        conditions.append(\n            ExpressionSubscriptCheck(\n                expression=make_against(),\n                subscript=buildNode(provider, key, source_ref),\n                source_ref=source_ref,\n            )\n        )\n\n        # It's called before return, pylint: disable=cell-var-from-loop\n        item_conditions, item_assignments = _buildMatch(\n            provider=provider,\n            make_against=lambda: ExpressionSubscriptLookup(\n                expression=make_against(),\n                subscript=buildNode(provider, key, source_ref),\n                source_ref=source_ref,\n            ),\n            pattern=kwd_pattern,\n            source_ref=source_ref,\n        )\n\n        if item_conditions:\n            conditions.extend(item_conditions)\n\n        if item_assignments:\n            assignments.extend(item_assignments)\n\n    return conditions, assignments\n\n\ndef _buildMatchClass(provider, pattern, make_against, source_ref):\n    cls_node = buildNode(provider, pattern.cls, source_ref)\n\n    assignments = []\n\n    conditions = [\n        ExpressionBuiltinIsinstance(\n            instance=make_against(),\n            classes=cls_node,\n            source_ref=source_ref,\n        )\n    ]\n\n    assert not (pattern.patterns and pattern.kwd_patterns), (\n        source_ref,\n        ast.dump(pattern),\n    )\n    assert len(pattern.kwd_attrs) == len(pattern.kwd_patterns), (\n        source_ref,\n        ast.dump(pattern),\n    )\n\n    for count, pos_pattern in enumerate(pattern.patterns):\n        # TODO: Not reusing Match args, is very wasteful for performance, but\n        # temporary variable handling is a bit of a problem in this so far,\n        # we should create an outline function for it, but match value args\n        # ought to be global probably, so they can be shared.\n\n        # It's called before return, pylint: disable=cell-var-from-loop\n        item_conditions, item_assignments = _buildMatch(\n            provider=provider,\n            make_against=lambda: ExpressionSubscriptLookup(\n                expression=ExpressionMatchArgs(\n                    expression=make_against(),\n                    max_allowed=len(pattern.patterns),\n                    source_ref=source_ref,\n                ),\n                subscript=makeConstantRefNode(constant=count, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            pattern=pos_pattern,\n            source_ref=source_ref,\n        )\n\n        if item_conditions:\n            conditions.extend(item_conditions)\n\n        if item_assignments:\n            assignments.extend(item_assignments)\n\n    for key, kwd_pattern in zip(pattern.kwd_attrs, pattern.kwd_patterns):\n        conditions.append(\n            ExpressionAttributeCheck(\n                expression=make_against(),\n                attribute_name=key,\n                source_ref=source_ref,\n            )\n        )\n\n        # It's called before return, pylint: disable=cell-var-from-loop\n        item_conditions, item_assignments = _buildMatch(\n            provider=provider,\n            make_against=lambda: makeExpressionAttributeLookup(\n                expression=make_against(),\n                attribute_name=key,\n                source_ref=source_ref,\n            ),\n            pattern=kwd_pattern,\n            source_ref=source_ref,\n        )\n\n        if item_conditions:\n            conditions.extend(item_conditions)\n\n        if item_assignments:\n            assignments.extend(item_assignments)\n\n    return conditions, assignments\n\n\ndef _buildMatchOr(provider, pattern, make_against, source_ref):\n    # Slightly complicated, due to using an outline body, pylint: disable=too-many-locals\n\n    or_condition_list = []\n    or_assignments_list = []\n\n    for or_pattern in pattern.patterns:\n        or_conditions, or_assignments = _buildMatch(\n            provider=provider,\n            pattern=or_pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n\n        if or_conditions:\n            or_condition_list.append(\n                makeAndNode(values=or_conditions, source_ref=source_ref)\n            )\n        else:\n            or_condition_list.append(\n                makeConstantRefNode(constant=True, source_ref=source_ref)\n            )\n\n        # TODO: Inconsistency somewhere, can return empty.\n        or_assignments_list.append(or_assignments or None)\n\n    if all(or_assignments is None for or_assignments in or_assignments_list):\n        condition = makeOrNode(values=or_condition_list, source_ref=source_ref)\n        conditions = (condition,)\n        assignments = None\n    else:\n        body = None\n\n        for or_condition, or_assignments in zip(\n            reversed(or_condition_list), reversed(or_assignments_list)\n        ):\n            assert or_assignments is not None, (source_ref, or_assignments_list)\n            statements = list(or_assignments)\n            statements.append(\n                makeStatementReturnConstant(constant=True, source_ref=source_ref)\n            )\n\n            if body is None:\n                body = makeStatementConditional(\n                    condition=or_condition,\n                    yes_branch=makeStatementsSequence(\n                        statements=statements, allow_none=False, source_ref=source_ref\n                    ),\n                    no_branch=makeStatementReturnConstant(\n                        constant=False, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                )\n            else:\n                body = makeStatementConditional(\n                    condition=or_condition,\n                    yes_branch=makeStatementsSequence(\n                        statements=statements, allow_none=False, source_ref=source_ref\n                    ),\n                    no_branch=body,\n                    source_ref=source_ref,\n                )\n\n        body = makeStatementsSequenceFromStatement(body)\n\n        outline_body = ExpressionOutlineBody(\n            provider=provider, name=\"match_or\", source_ref=source_ref\n        )\n\n        outline_body.setChildBody(body)\n\n        conditions = (outline_body,)\n        assignments = None\n\n    return conditions, assignments\n\n\ndef _buildMatch(provider, pattern, make_against, source_ref):\n    if pattern.__class__ is ast.MatchOr:\n        conditions, assignments = _buildMatchOr(\n            provider=provider,\n            pattern=pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n    elif pattern.__class__ is ast.MatchClass:\n        conditions, assignments = _buildMatchClass(\n            provider=provider,\n            pattern=pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n    elif pattern.__class__ is ast.MatchMapping:\n        conditions, assignments = _buildMatchMapping(\n            provider=provider,\n            pattern=pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n    elif pattern.__class__ is ast.MatchSequence:\n        conditions, assignments = _buildMatchSequence(\n            provider=provider,\n            pattern=pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n    elif pattern.__class__ is ast.MatchAs:\n        conditions, assignments = _buildMatchAs(\n            provider=provider,\n            pattern=pattern,\n            make_against=make_against,\n            source_ref=source_ref,\n        )\n    elif pattern.__class__ is ast.MatchValue or pattern.__class__ is ast.MatchSingleton:\n        conditions = [\n            _buildMatchValue(\n                provider=provider,\n                make_against=make_against,\n                pattern=pattern,\n                source_ref=source_ref,\n            )\n        ]\n\n        assignments = None\n\n    else:\n        assert False, ast.dump(pattern)\n\n    return conditions, assignments\n\n\ndef _buildCase(provider, case, tmp_subject, source_ref):\n    assert case.__class__ is ast.match_case, case\n\n    pattern = case.pattern\n\n    make_against = lambda: ExpressionTempVariableRef(\n        variable=tmp_subject, source_ref=source_ref\n    )\n\n    conditions, assignments = _buildMatch(\n        provider=provider,\n        pattern=pattern,\n        make_against=make_against,\n        source_ref=source_ref,\n    )\n\n    branch_code, guard = _buildCaseBodyCode(provider, case, source_ref)\n    return (conditions, assignments, guard, branch_code)\n\n\ndef buildMatchNode(provider, node, source_ref):\n    \"\"\"Python3.10 or higher, match statements.\"\"\"\n\n    subject_node = buildNode(provider, node.subject, source_ref)\n\n    temp_scope = provider.allocateTempScope(\"match_statement\")\n\n    # The value matched against, must be released in the end.\n    tmp_subject = provider.allocateTempVariable(\n        temp_scope, \"subject\", temp_type=\"object\"\n    )\n\n    # Indicator variable, will end up with C bool type, and need not be released.\n    tmp_indicator_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"indicator\", temp_type=\"bool\"\n    )\n\n    cases = []\n\n    for case in node.cases:\n        cases.append(\n            _buildCase(\n                provider=provider,\n                case=case,\n                tmp_subject=tmp_subject,\n                source_ref=source_ref,\n            )\n        )\n\n    case_statements = []\n\n    for case in cases:\n        conditions, assignments, guard, branch_code = case\n\n        # Set indicator variable at end of branch code, unless it's last branch\n        # where there would be no usage of it.\n        if case is not cases[-1]:\n            branch_code = makeStatementsSequence(\n                statements=(\n                    branch_code,\n                    makeStatementAssignmentVariable(\n                        variable=tmp_indicator_variable,\n                        source=makeConstantRefNode(\n                            constant=True, source_ref=source_ref\n                        ),\n                        source_ref=source_ref,\n                    ),\n                ),\n                allow_none=True,\n                source_ref=source_ref,\n            )\n\n        if guard is not None:\n            branch_code = makeStatementConditional(\n                condition=guard,\n                yes_branch=branch_code,\n                no_branch=None,\n                source_ref=source_ref,\n            )\n\n        del guard\n\n        branch_code = makeStatementsSequence(\n            statements=(assignments, branch_code),\n            allow_none=True,\n            source_ref=source_ref,\n        )\n\n        del assignments\n\n        if conditions is not None:\n            branch_code = makeStatementConditional(\n                condition=makeAndNode(values=conditions, source_ref=source_ref),\n                yes_branch=branch_code,\n                no_branch=None,\n                source_ref=source_ref,\n            )\n\n        del conditions\n\n        if case is not cases[0]:\n            statement = makeStatementConditional(\n                condition=makeComparisonExpression(\n                    comparator=\"Is\",\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_indicator_variable, source_ref=source_ref\n                    ),\n                    right=makeConstantRefNode(constant=False, source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=branch_code,\n                no_branch=None,\n                source_ref=source_ref,\n            )\n        else:\n            statement = branch_code\n\n        case_statements.append(statement)\n\n    return makeStatementsSequence(\n        statements=(\n            makeStatementAssignmentVariable(\n                variable=tmp_indicator_variable,\n                source=makeConstantRefNode(constant=False, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            makeStatementAssignmentVariable(\n                variable=tmp_subject,\n                source=subject_node,\n                source_ref=subject_node.getSourceReference(),\n            ),\n            makeTryFinallyStatement(\n                provider=provider,\n                tried=case_statements,\n                final=makeStatementReleaseVariable(\n                    variable=tmp_indicator_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n        ),\n        allow_none=False,\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationMultidist.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Multidist re-formulation. \"\"\"\n\nimport os\n\nfrom nuitka.Options import getMainEntryPointFilenames\nfrom nuitka.utils.ModuleNames import makeMultidistModuleName\n\n\ndef _stripPythonSuffix(filename):\n    if filename.lower().endswith(\".py\"):\n        return filename[:-3]\n    elif filename.lower().endswith(\".pyw\"):\n        return filename[:-4]\n    else:\n        return filename\n\n\ndef createMultidistMainSourceCode(main_filenames):\n    main_basenames = [\n        _stripPythonSuffix(os.path.basename(main_filename))\n        for main_filename in main_filenames\n    ]\n\n    main_module_names = [\n        makeMultidistModuleName(count, main_basename)\n        for count, main_basename in enumerate(main_basenames, start=1)\n    ]\n\n    from nuitka.utils.Jinja2 import renderTemplateFromString\n\n    source_code = renderTemplateFromString(\n        r\"\"\"\nimport sys, re, os\nmain_basename = re.sub(r'(.pyw?|\\.exe|\\.bin)?$', '', os.path.normcase(os.path.basename(sys.argv[0])))\n{% for main_module_name, main_basename in zip(main_module_names, main_basenames) %}\nif main_basename == \"{{main_basename}}\":\n    __import__(\"{{main_module_name.asString()}}\")\n    sys.exit(0)\n{% endfor %}\n\nsys.exit(\"Error, failed to detect what to do for filename derived name '%s'.\" % main_basename)\n\"\"\",\n        main_module_names=main_module_names,\n        main_basenames=main_basenames,\n        zip=zip,\n    )\n\n    return source_code\n\n\ndef locateMultidistModule(module_name):\n    multidist_index = int(str(module_name).split(\"-\")[1])\n\n    return (\n        module_name,\n        getMainEntryPointFilenames()[multidist_index - 1],\n        \"py\",\n        \"absolute\",\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationNamespacePackages.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nNamespace packages of Python3\n\n\"\"\"\n\nimport os\n\nfrom nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup\nfrom nuitka.nodes.CallNodes import ExpressionCallNoKeywords\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import (\n    makeExpressionMakeList,\n    makeExpressionMakeTuple,\n    makeExpressionMakeTupleOrConstant,\n)\nfrom nuitka.nodes.FutureSpecs import FutureSpec\nfrom nuitka.nodes.ImportNodes import (\n    ExpressionImportName,\n    makeExpressionImportModuleFixed,\n    makeExpressionImportModuleNameHard,\n)\nfrom nuitka.nodes.ModuleAttributeNodes import ExpressionModuleAttributeFileRef\nfrom nuitka.nodes.ModuleNodes import CompiledPythonNamespacePackage\nfrom nuitka.nodes.VariableNameNodes import StatementAssignmentVariableName\nfrom nuitka.Options import getFileReferenceMode\nfrom nuitka.PythonVersions import python_version\n\nfrom .TreeHelpers import makeStatementsSequenceFromStatement\nfrom .VariableClosure import completeVariableClosures\n\n\ndef _makeCall(module_name, import_name, attribute_name, source_ref, *args):\n    return ExpressionCallNoKeywords(\n        called=makeExpressionAttributeLookup(\n            expression=makeExpressionImportModuleNameHard(\n                module_name=module_name,\n                import_name=import_name,\n                module_guaranteed=True,\n                source_ref=source_ref,\n            ),\n            attribute_name=attribute_name,\n            source_ref=source_ref,\n        ),\n        args=makeExpressionMakeTupleOrConstant(\n            elements=args, user_provided=True, source_ref=source_ref\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef getNameSpacePathExpression(package, source_ref):\n    \"\"\"Create the __path__ expression for a package.\"\"\"\n\n    reference_mode = getFileReferenceMode()\n\n    if reference_mode == \"original\":\n        return makeConstantRefNode(\n            constant=[package.getCompileTimeDirectory()],\n            source_ref=source_ref,\n        )\n    elif reference_mode == \"frozen\":\n        return makeConstantRefNode(\n            constant=[],\n            source_ref=source_ref,\n        )\n    else:\n        file_ref_node = ExpressionModuleAttributeFileRef(\n            variable=package.getVariableForReference(\"__file__\"),\n            source_ref=source_ref,\n        )\n\n        if package.isCompiledPythonNamespacePackage():\n            elements = [file_ref_node]\n        else:\n            elements = [\n                ExpressionCallNoKeywords(\n                    called=makeExpressionAttributeLookup(\n                        expression=makeExpressionImportModuleNameHard(\n                            module_name=\"os\",\n                            import_name=\"path\",\n                            module_guaranteed=True,\n                            source_ref=source_ref,\n                        ),\n                        attribute_name=\"dirname\",\n                        source_ref=source_ref,\n                    ),\n                    args=makeExpressionMakeTuple(\n                        elements=(file_ref_node,),\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                )\n            ]\n\n        if package.canHaveExternalImports():\n            parts = package.getFullName().asString().split(\".\")\n\n            for count in range(len(parts)):\n                path_part = _makeCall(\n                    \"os\",\n                    \"environ\",\n                    \"get\",\n                    source_ref,\n                    makeConstantRefNode(\n                        constant=\"NUITKA_PACKAGE_%s\" % \"_\".join(parts[: count + 1]),\n                        source_ref=source_ref,\n                    ),\n                    makeConstantRefNode(\n                        constant=os.path.sep + \"not_existing\", source_ref=source_ref\n                    ),\n                )\n\n                if parts[count + 1 :]:\n                    path_part = _makeCall(\n                        \"os\",\n                        \"path\",\n                        \"join\",\n                        source_ref,\n                        path_part,\n                        makeConstantRefNode(\n                            constant=os.path.join(*parts[count + 1 :]),\n                            source_ref=source_ref,\n                        ),\n                    )\n\n                elements.append(path_part)\n\n        return makeExpressionMakeList(elements=tuple(elements), source_ref=source_ref)\n\n\ndef createPathAssignment(package, source_ref):\n    return StatementAssignmentVariableName(\n        provider=package,\n        variable_name=\"__path__\",\n        source=getNameSpacePathExpression(package=package, source_ref=source_ref),\n        source_ref=source_ref,\n    )\n\n\ndef createPython3NamespacePath(package, source_ref):\n    module_name = (\n        \"_frozen_importlib\" if python_version < 0x350 else \"_frozen_importlib_external\"\n    )\n\n    return StatementAssignmentVariableName(\n        provider=package,\n        variable_name=\"__path__\",\n        source=ExpressionCallNoKeywords(\n            called=ExpressionImportName(\n                module=makeExpressionImportModuleFixed(\n                    using_module_name=package.getFullName(),\n                    module_name=module_name,\n                    value_name=module_name,\n                    source_ref=source_ref,\n                ),\n                import_name=\"_NamespacePath\",\n                level=0,\n                source_ref=source_ref,\n            ),\n            args=makeExpressionMakeTupleOrConstant(\n                elements=(\n                    makeConstantRefNode(\n                        constant=package.getFullName().asString(),\n                        user_provided=True,\n                        source_ref=source_ref,\n                    ),\n                    getNameSpacePathExpression(package=package, source_ref=source_ref),\n                    makeConstantRefNode(constant=None, source_ref=source_ref),\n                ),\n                user_provided=True,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef createNamespacePackage(module_name, reason, is_top, source_ref):\n    package = CompiledPythonNamespacePackage(\n        module_name=module_name,\n        reason=reason,\n        is_top=is_top,\n        mode=\"compiled\",\n        future_spec=FutureSpec(),\n        source_ref=source_ref,\n    )\n\n    if python_version >= 0x300:\n        statement = createPython3NamespacePath(package=package, source_ref=source_ref)\n    else:\n        statement = createPathAssignment(package, source_ref)\n\n    package.setChildBody(makeStatementsSequenceFromStatement(statement=statement))\n\n    completeVariableClosures(package)\n\n    return package\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationPrintStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of print statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import ExpressionConstantNoneRef\nfrom nuitka.nodes.ImportNodes import makeExpressionImportModuleNameHard\nfrom nuitka.nodes.PrintNodes import StatementPrintNewline, StatementPrintValue\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\n\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    makeStatementsSequenceFromStatements,\n)\n\n\ndef buildPrintNode(provider, node, source_ref):\n    # \"print\" statements, should only occur with Python2.\n\n    if node.dest is not None:\n        temp_scope = provider.allocateTempScope(\"print\")\n\n        tmp_target_variable = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"target\", temp_type=\"object\"\n        )\n\n        target_default_statement = makeStatementAssignmentVariable(\n            variable=tmp_target_variable,\n            source=makeExpressionImportModuleNameHard(\n                module_name=\"sys\",\n                import_name=\"stdout\",\n                module_guaranteed=True,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        statements = [\n            makeStatementAssignmentVariable(\n                variable=tmp_target_variable,\n                source=buildNode(\n                    provider=provider, node=node.dest, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            makeStatementConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_target_variable, source_ref=source_ref\n                    ),\n                    right=ExpressionConstantNoneRef(source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=target_default_statement,\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n        ]\n\n    values = buildNodeTuple(provider=provider, nodes=node.values, source_ref=source_ref)\n\n    if node.dest is not None:\n        print_statements = [\n            StatementPrintValue(\n                dest=ExpressionTempVariableRef(\n                    variable=tmp_target_variable, source_ref=source_ref\n                ),\n                value=value,\n                source_ref=source_ref,\n            )\n            for value in values\n        ]\n\n        if node.nl:\n            print_statements.append(\n                StatementPrintNewline(\n                    dest=ExpressionTempVariableRef(\n                        variable=tmp_target_variable, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                )\n            )\n\n        statements.append(\n            makeTryFinallyStatement(\n                provider=provider,\n                tried=print_statements,\n                final=makeStatementReleaseVariable(\n                    variable=tmp_target_variable, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        )\n    else:\n        statements = [\n            StatementPrintValue(dest=None, value=value, source_ref=source_ref)\n            for value in values\n        ]\n\n        if node.nl:\n            statements.append(StatementPrintNewline(dest=None, source_ref=source_ref))\n\n    return makeStatementsSequenceFromStatements(*statements)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationSequenceCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of sequence creations.\n\nSequences might be directly translated to constants, or they might become\nnodes that build tuples, lists, or sets.\n\nFor Python3.5, unpacking can happen while creating sequences, these are\nbeing re-formulated to an internal function.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1\nfrom nuitka.nodes.BuiltinNextNodes import ExpressionBuiltinNext1\nfrom nuitka.nodes.BuiltinTypeNodes import ExpressionBuiltinTuple\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import (\n    makeExpressionMakeListOrConstant,\n    makeExpressionMakeSetLiteralOrConstant,\n    makeExpressionMakeTuple,\n    makeExpressionMakeTupleOrConstant,\n)\nfrom nuitka.nodes.ContainerOperationNodes import ExpressionSetOperationUpdate\nfrom nuitka.nodes.FunctionNodes import (\n    ExpressionFunctionRef,\n    makeExpressionFunctionCall,\n    makeExpressionFunctionCreation,\n)\nfrom nuitka.nodes.ListOperationNodes import (\n    ExpressionListOperationExtend,\n    ExpressionListOperationExtendForUnpack,\n)\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.ReturnNodes import StatementReturn\nfrom nuitka.nodes.StatementNodes import StatementExpressionOnly\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    ExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.specs.ParameterSpecs import ParameterSpec\n\nfrom . import SyntaxErrors\nfrom .InternalModule import (\n    internal_source_ref,\n    makeInternalHelperFunctionBody,\n    once_decorator,\n)\nfrom .ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildNodeTuple,\n    getKind,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n)\n\n\ndef _raiseStarredSyntaxError(element, source_ref):\n    SyntaxErrors.raiseSyntaxError(\n        \"can use starred expression only as assignment target\",\n        source_ref.atColumnNumber(element.col_offset),\n    )\n\n\ndef buildTupleCreationNode(provider, node, source_ref):\n    if python_version >= 0x300:\n        for element in node.elts:\n            if getKind(element) == \"Starred\":\n                if python_version < 0x350:\n                    _raiseStarredSyntaxError(element, source_ref)\n                else:\n                    return buildTupleUnpacking(\n                        provider=provider, elements=node.elts, source_ref=source_ref\n                    )\n\n    return makeExpressionMakeTupleOrConstant(\n        elements=buildNodeTuple(provider, node.elts, source_ref),\n        user_provided=True,\n        source_ref=source_ref,\n    )\n\n\ndef buildListCreationNode(provider, node, source_ref):\n    if python_version >= 0x300:\n        for element in node.elts:\n            if getKind(element) == \"Starred\":\n                if python_version < 0x350:\n                    _raiseStarredSyntaxError(element, source_ref)\n                else:\n                    return buildListUnpacking(\n                        provider=provider, elements=node.elts, source_ref=source_ref\n                    )\n\n    return makeExpressionMakeListOrConstant(\n        elements=buildNodeTuple(provider, node.elts, source_ref),\n        user_provided=True,\n        source_ref=source_ref,\n    )\n\n\ndef buildSetCreationNode(provider, node, source_ref):\n    if python_version >= 0x300:\n        for element in node.elts:\n            if getKind(element) == \"Starred\":\n                if python_version < 0x350:\n                    _raiseStarredSyntaxError(element, source_ref)\n                else:\n                    return _buildSetUnpacking(\n                        provider=provider, elements=node.elts, source_ref=source_ref\n                    )\n\n    return makeExpressionMakeSetLiteralOrConstant(\n        elements=buildNodeTuple(provider, node.elts, source_ref),\n        user_provided=True,\n        source_ref=source_ref,\n    )\n\n\n@once_decorator\ndef getListUnpackingHelper():\n    helper_name = \"_unpack_list\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(),\n            ps_list_star_arg=\"args\",\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    temp_scope = None\n\n    tmp_result_variable = result.allocateTempVariable(\n        temp_scope, \"list\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"keys\", temp_type=\"object\"\n    )\n\n    if python_version < 0x390:\n        list_operation_extend = ExpressionListOperationExtend\n    else:\n        list_operation_extend = ExpressionListOperationExtendForUnpack\n\n    loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementExpressionOnly(\n            expression=list_operation_extend(\n                list_arg=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                value=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    final = (\n        makeStatementReleaseVariable(\n            variable=tmp_result_variable, source_ref=internal_source_ref\n        ),\n        makeStatementReleaseVariable(\n            variable=tmp_iter_variable, source_ref=internal_source_ref\n        ),\n        makeStatementReleaseVariable(\n            variable=tmp_item_variable, source_ref=internal_source_ref\n        ),\n    )\n\n    tried = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_result_variable,\n            source=makeConstantRefNode(constant=[], source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementLoop(loop_body=loop_body, source_ref=internal_source_ref),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            makeTryFinallyStatement(\n                provider=result,\n                tried=tried,\n                final=final,\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\n@once_decorator\ndef getSetUnpackingHelper():\n    helper_name = \"_unpack_set\"\n\n    result = makeInternalHelperFunctionBody(\n        name=helper_name,\n        parameters=ParameterSpec(\n            ps_name=helper_name,\n            ps_normal_args=(),\n            ps_list_star_arg=\"args\",\n            ps_dict_star_arg=None,\n            ps_default_count=0,\n            ps_kw_only_args=(),\n            ps_pos_only_args=(),\n        ),\n    )\n\n    temp_scope = None\n\n    tmp_result_variable = result.allocateTempVariable(\n        temp_scope, \"set\", temp_type=\"object\"\n    )\n    tmp_iter_variable = result.allocateTempVariable(\n        temp_scope, \"iter\", temp_type=\"object\"\n    )\n    tmp_item_variable = result.allocateTempVariable(\n        temp_scope, \"keys\", temp_type=\"object\"\n    )\n\n    loop_body = makeStatementsSequenceFromStatements(\n        makeTryExceptSingleHandlerNode(\n            tried=makeStatementAssignmentVariable(\n                variable=tmp_item_variable,\n                source=ExpressionBuiltinNext1(\n                    value=ExpressionTempVariableRef(\n                        variable=tmp_iter_variable, source_ref=internal_source_ref\n                    ),\n                    source_ref=internal_source_ref,\n                ),\n                source_ref=internal_source_ref,\n            ),\n            exception_name=\"StopIteration\",\n            handler_body=StatementLoopBreak(source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementExpressionOnly(\n            expression=ExpressionSetOperationUpdate(\n                set_arg=ExpressionTempVariableRef(\n                    variable=tmp_result_variable, source_ref=internal_source_ref\n                ),\n                value=ExpressionTempVariableRef(\n                    variable=tmp_item_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    args_variable = result.getVariableForAssignment(variable_name=\"args\")\n\n    final = (\n        makeStatementReleaseVariable(\n            variable=tmp_result_variable, source_ref=internal_source_ref\n        ),\n        makeStatementReleaseVariable(\n            variable=tmp_iter_variable, source_ref=internal_source_ref\n        ),\n        makeStatementReleaseVariable(\n            variable=tmp_item_variable, source_ref=internal_source_ref\n        ),\n    )\n\n    tried = makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_iter_variable,\n            source=ExpressionBuiltinIter1(\n                value=ExpressionVariableRef(\n                    variable=args_variable, source_ref=internal_source_ref\n                ),\n                source_ref=internal_source_ref,\n            ),\n            source_ref=internal_source_ref,\n        ),\n        makeStatementAssignmentVariable(\n            variable=tmp_result_variable,\n            source=makeConstantRefNode(constant=set(), source_ref=internal_source_ref),\n            source_ref=internal_source_ref,\n        ),\n        StatementLoop(loop_body=loop_body, source_ref=internal_source_ref),\n        StatementReturn(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_result_variable, source_ref=internal_source_ref\n            ),\n            source_ref=internal_source_ref,\n        ),\n    )\n\n    result.setChildBody(\n        makeStatementsSequenceFromStatement(\n            makeTryFinallyStatement(\n                provider=result,\n                tried=tried,\n                final=final,\n                source_ref=internal_source_ref,\n            )\n        )\n    )\n\n    return result\n\n\ndef buildListUnpacking(provider, elements, source_ref):\n    helper_args = []\n\n    for element in elements:\n        # We could be a lot cleverer about the tuples for non-starred\n        # arguments, but lets get this to work first. And then rely on\n        # future optimization to inline the list unpacking helper in a\n        # way that has the same effect.\n        if getKind(element) == \"Starred\":\n            helper_args.append(buildNode(provider, element.value, source_ref))\n        else:\n            helper_args.append(\n                makeExpressionMakeTupleOrConstant(\n                    elements=(buildNode(provider, element, source_ref),),\n                    user_provided=True,\n                    source_ref=source_ref,\n                )\n            )\n\n    result = makeExpressionFunctionCall(\n        function=makeExpressionFunctionCreation(\n            function_ref=ExpressionFunctionRef(\n                function_body=getListUnpackingHelper(), source_ref=source_ref\n            ),\n            defaults=(),\n            kw_defaults=None,\n            annotations=None,\n            source_ref=source_ref,\n        ),\n        values=(makeExpressionMakeTuple(tuple(helper_args), source_ref),),\n        source_ref=source_ref,\n    )\n\n    result.setCompatibleSourceReference(helper_args[-1].getCompatibleSourceReference())\n\n    return result\n\n\ndef buildTupleUnpacking(provider, elements, source_ref):\n    return ExpressionBuiltinTuple(\n        value=buildListUnpacking(provider, elements, source_ref), source_ref=source_ref\n    )\n\n\ndef _buildSetUnpacking(provider, elements, source_ref):\n    helper_args = []\n\n    for element in elements:\n        # We could be a lot cleverer about the tuples for non-starred\n        # arguments, but lets get this to work first. And then rely on\n        # future optimization to inline the list unpacking helper in a\n        # way that has the same effect.\n        if getKind(element) == \"Starred\":\n            helper_args.append(buildNode(provider, element.value, source_ref))\n        else:\n            helper_args.append(\n                makeExpressionMakeTupleOrConstant(\n                    elements=(buildNode(provider, element, source_ref),),\n                    user_provided=True,\n                    source_ref=source_ref,\n                )\n            )\n\n    result = makeExpressionFunctionCall(\n        function=makeExpressionFunctionCreation(\n            function_ref=ExpressionFunctionRef(\n                function_body=getSetUnpackingHelper(), source_ref=source_ref\n            ),\n            defaults=(),\n            kw_defaults=None,\n            annotations=None,\n            source_ref=source_ref,\n        ),\n        values=(makeExpressionMakeTuple(tuple(helper_args), source_ref),),\n        source_ref=source_ref,\n    )\n\n    result.setCompatibleSourceReference(helper_args[-1].getCompatibleSourceReference())\n\n    return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationSubscriptExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of subscript into slicing.\n\nFor Python2, there is a difference between x[a], x[a:b], x[a:b:c] whereas\nPython3 treats the later by making a slice object, Python2 tries to have\nspecial slice access, if available, or building a slice object only at the\nend.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\"\"\"\n\nfrom nuitka.nodes.ConstantRefNodes import ExpressionConstantEllipsisRef\nfrom nuitka.nodes.SliceNodes import (\n    ExpressionSliceLookup,\n    makeExpressionBuiltinSlice,\n)\nfrom nuitka.nodes.SubscriptNodes import ExpressionSubscriptLookup\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationAssignmentStatements import buildExtSliceNode\nfrom .TreeHelpers import buildNode, getKind\n\n\ndef buildSubscriptNode(provider, node, source_ref):\n    # Subscript expression nodes, various types are dispatched here.\n\n    assert getKind(node.ctx) == \"Load\", source_ref\n\n    # The subscript \"[]\" operator is one of many different things. This is\n    # expressed by this kind, there are \"slice\" lookups (two values, even if one\n    # is using default), and then \"index\" lookups. The form with three argument\n    # is really an \"index\" lookup, with a slice object. And the \"...\" lookup is\n    # also an index loop-up, with it as the argument. So this splits things into\n    # two different operations, \"subscript\" with a single \"subscript\" object. Or\n    # a slice lookup with a lower and higher boundary. These things should\n    # behave similar, but they are different slots.\n    kind = getKind(node.slice)\n\n    if kind == \"Index\":\n        return ExpressionSubscriptLookup(\n            expression=buildNode(provider, node.value, source_ref),\n            subscript=buildNode(provider, node.slice.value, source_ref),\n            source_ref=source_ref,\n        )\n    elif kind == \"Slice\":\n        lower = buildNode(\n            provider=provider,\n            node=node.slice.lower,\n            source_ref=source_ref,\n            allow_none=True,\n        )\n        upper = buildNode(\n            provider=provider,\n            node=node.slice.upper,\n            source_ref=source_ref,\n            allow_none=True,\n        )\n        step = buildNode(\n            provider=provider,\n            node=node.slice.step,\n            source_ref=source_ref,\n            allow_none=True,\n        )\n\n        # For Python3 there is no slicing operation, this is always done\n        # with subscript using a slice object. For Python2, it is only done\n        # if no \"step\" is provided.\n        use_slice_object = step is not None or python_version >= 0x300\n\n        if use_slice_object:\n            return ExpressionSubscriptLookup(\n                expression=buildNode(provider, node.value, source_ref),\n                subscript=makeExpressionBuiltinSlice(\n                    start=lower, stop=upper, step=step, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            )\n        else:\n            return ExpressionSliceLookup(\n                expression=buildNode(provider, node.value, source_ref),\n                lower=lower,\n                upper=upper,\n                source_ref=source_ref,\n            )\n    elif kind == \"ExtSlice\":\n        return ExpressionSubscriptLookup(\n            expression=buildNode(provider, node.value, source_ref),\n            subscript=buildExtSliceNode(provider, node, source_ref),\n            source_ref=source_ref,\n        )\n    elif kind == \"Ellipsis\":\n        return ExpressionSubscriptLookup(\n            expression=buildNode(provider, node.value, source_ref),\n            subscript=ExpressionConstantEllipsisRef(source_ref=source_ref),\n            source_ref=source_ref,\n        )\n    elif python_version >= 0x390:\n        return ExpressionSubscriptLookup(\n            expression=buildNode(provider, node.value, source_ref),\n            subscript=buildNode(provider, node.slice, source_ref),\n            source_ref=source_ref,\n        )\n    else:\n        assert False, kind\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationTryExceptStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of try/except statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.BuiltinRefNodes import ExpressionBuiltinExceptionRef\nfrom nuitka.nodes.ComparisonNodes import (\n    ExpressionComparisonExceptionMatch,\n    ExpressionComparisonIs,\n)\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ExceptionNodes import (\n    ExpressionCaughtExceptionTypeRef,\n    ExpressionCaughtExceptionValueRef,\n)\nfrom nuitka.nodes.StatementNodes import (\n    StatementPreserveFrameException,\n    StatementPublishException,\n    StatementRestoreFrameException,\n    StatementsSequence,\n)\nfrom nuitka.nodes.TryNodes import StatementTry\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationAssignmentStatements import (\n    buildAssignmentStatements,\n    buildDeleteStatementFromDecoded,\n    decodeAssignTarget,\n)\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .SyntaxErrors import raiseSyntaxError\nfrom .TreeHelpers import (\n    buildNode,\n    buildStatementsNode,\n    makeReraiseExceptionStatement,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n    mergeStatements,\n)\n\n\ndef makeTryExceptNoRaise(provider, temp_scope, tried, handling, no_raise, source_ref):\n    # This helper executes the core re-formulation of \"no_raise\" blocks, which\n    # are the \"else\" blocks of \"try\"/\"except\" statements. In order to limit the\n    # execution, we use an indicator variable instead, which will signal that\n    # the tried block executed up to the end. And then we make the else block be\n    # a conditional statement checking that.\n\n    # Indicator variable, will end up with C bool type, and need not be released.\n    tmp_handler_indicator_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"unhandled_indicator\", temp_type=\"bool\"\n    )\n\n    statements = mergeStatements(\n        (\n            makeStatementAssignmentVariable(\n                variable=tmp_handler_indicator_variable,\n                source=makeConstantRefNode(constant=False, source_ref=source_ref),\n                source_ref=no_raise.getSourceReference(),\n            ),\n            handling,\n        ),\n        allow_none=True,\n    )\n\n    handling = StatementsSequence(statements=statements, source_ref=source_ref)\n\n    return makeStatementsSequenceFromStatements(\n        makeStatementAssignmentVariable(\n            variable=tmp_handler_indicator_variable,\n            source=makeConstantRefNode(constant=True, source_ref=source_ref),\n            source_ref=source_ref,\n        ),\n        StatementTry(\n            tried=tried,\n            except_handler=handling,\n            break_handler=None,\n            continue_handler=None,\n            return_handler=None,\n            source_ref=source_ref,\n        ),\n        makeStatementConditional(\n            condition=ExpressionComparisonIs(\n                left=ExpressionTempVariableRef(\n                    variable=tmp_handler_indicator_variable, source_ref=source_ref\n                ),\n                right=makeConstantRefNode(constant=True, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            yes_branch=no_raise,\n            no_branch=None,\n            source_ref=source_ref,\n        ),\n    )\n\n\ndef _makeTryExceptSingleHandlerNode(\n    provider, public_exc, tried, exception_name, handler_body, source_ref\n):\n    # No need to create this in the first place if nothing is tried.\n    if tried is None:\n        return None\n\n    if public_exc:\n        preserver_id = provider.allocatePreserverId()\n\n        handling = [\n            StatementPreserveFrameException(\n                preserver_id=preserver_id, source_ref=source_ref\n            ),\n            StatementPublishException(source_ref=source_ref),\n        ]\n    else:\n        handling = []\n\n    if not handler_body.isStatementsSequence():\n        handler_body = makeStatementsSequenceFromStatement(statement=handler_body)\n\n    if not tried.isStatementsSequence():\n        tried = makeStatementsSequenceFromStatement(statement=tried)\n\n    handling.append(\n        makeStatementConditional(\n            condition=ExpressionComparisonExceptionMatch(\n                left=ExpressionCaughtExceptionTypeRef(source_ref=source_ref),\n                right=ExpressionBuiltinExceptionRef(\n                    exception_name=exception_name, source_ref=source_ref\n                ),\n                source_ref=source_ref,\n            ),\n            yes_branch=handler_body,\n            no_branch=makeReraiseExceptionStatement(source_ref=source_ref),\n            source_ref=source_ref,\n        )\n    )\n\n    if python_version >= 0x300 and public_exc:\n        handling = (\n            makeTryFinallyStatement(\n                provider=provider,\n                tried=handling,\n                final=StatementRestoreFrameException(\n                    preserver_id=preserver_id, source_ref=source_ref.atInternal()\n                ),\n                source_ref=source_ref.atInternal(),\n            ),\n        )\n\n    handling = makeStatementsSequenceFromStatements(*handling)\n\n    return StatementTry(\n        tried=tried,\n        except_handler=handling,\n        break_handler=None,\n        continue_handler=None,\n        return_handler=None,\n        source_ref=source_ref,\n    )\n\n\ndef makeTryExceptSingleHandlerNode(tried, exception_name, handler_body, source_ref):\n    return _makeTryExceptSingleHandlerNode(\n        provider=None,\n        public_exc=False,\n        tried=tried,\n        exception_name=exception_name,\n        handler_body=handler_body,\n        source_ref=source_ref,\n    )\n\n\ndef makeTryExceptSingleHandlerNodeWithPublish(\n    provider, public_exc, tried, exception_name, handler_body, source_ref\n):\n    return _makeTryExceptSingleHandlerNode(\n        provider=provider,\n        public_exc=public_exc,\n        tried=tried,\n        exception_name=exception_name,\n        handler_body=handler_body,\n        source_ref=source_ref,\n    )\n\n\ndef buildTryExceptionNode(provider, node, source_ref, is_star_try=False):\n    # Try/except nodes. Re-formulated as described in the Developer Manual.\n    # Exception handlers made the assignment to variables explicit. Same for the\n    # \"del\" as done for Python3. Also catches always work a tuple of exception\n    # types and hides away that they may be built or not.\n\n    # For Python3.11, the is_star_try indicates \"except*\" usage.\n\n    # Many variables and branches, due to the re-formulation that is going on\n    # here, which just has the complexity, pylint: disable=too-many-branches,too-many-locals\n\n    tried = buildStatementsNode(\n        provider=provider, nodes=node.body, source_ref=source_ref\n    )\n\n    handlers = []\n\n    for handler in node.handlers:\n        exception_expression, exception_assign, exception_block = (\n            handler.type,\n            handler.name,\n            handler.body,\n        )\n\n        if exception_assign is None:\n            statements = [\n                buildStatementsNode(\n                    provider=provider, nodes=exception_block, source_ref=source_ref\n                )\n            ]\n        elif python_version < 0x300:\n            assert not is_star_try\n\n            statements = [\n                buildAssignmentStatements(\n                    provider=provider,\n                    node=exception_assign,\n                    source=ExpressionCaughtExceptionValueRef(\n                        source_ref=source_ref.atInternal()\n                    ),\n                    source_ref=source_ref.atInternal(),\n                ),\n                buildStatementsNode(\n                    provider=provider, nodes=exception_block, source_ref=source_ref\n                ),\n            ]\n        else:\n            # Python3 requires temporary assignment of exception assignment.\n            target_info = decodeAssignTarget(\n                provider=provider, node=exception_assign, source_ref=source_ref\n            )\n\n            kind, detail = target_info\n\n            assert kind == \"Name\", kind\n            kind = \"Name_Exception\"\n\n            statements = [\n                buildAssignmentStatements(\n                    provider=provider,\n                    node=exception_assign,\n                    source=ExpressionCaughtExceptionValueRef(\n                        source_ref=source_ref.atInternal()\n                    ),\n                    source_ref=source_ref.atInternal(),\n                ),\n                makeTryFinallyStatement(\n                    provider=provider,\n                    tried=buildStatementsNode(\n                        provider=provider, nodes=exception_block, source_ref=source_ref\n                    ),\n                    final=buildDeleteStatementFromDecoded(\n                        provider=provider,\n                        kind=kind,\n                        detail=detail,\n                        source_ref=source_ref,\n                    ),\n                    source_ref=source_ref,\n                ),\n            ]\n\n        handler_body = makeStatementsSequence(\n            statements=statements, allow_none=True, source_ref=source_ref\n        )\n\n        exception_types = buildNode(\n            provider=provider,\n            node=exception_expression,\n            source_ref=source_ref,\n            allow_none=True,\n        )\n\n        # The exception types should be a tuple, so as to be most general.\n        if exception_types is None:\n            if handler is not node.handlers[-1]:\n                raiseSyntaxError(\n                    \"default 'except:' must be last\",\n                    source_ref.atLineNumber(handler.lineno).atColumnNumber(\n                        handler.col_offset\n                    ),\n                )\n\n        handlers.append((exception_types, handler_body))\n\n    # Re-raise by default\n    exception_handling = makeReraiseExceptionStatement(source_ref=source_ref)\n\n    for exception_type, handler in reversed(handlers):\n        if exception_type is None:\n            # A default handler was given, so use that indeed.\n            exception_handling = handler\n        else:\n            exception_handling = StatementsSequence(\n                statements=(\n                    makeStatementConditional(\n                        condition=ExpressionComparisonExceptionMatch(\n                            left=ExpressionCaughtExceptionTypeRef(\n                                source_ref=exception_type.source_ref\n                            ),\n                            right=exception_type,\n                            source_ref=exception_type.source_ref,\n                        ),\n                        yes_branch=handler,\n                        no_branch=exception_handling,\n                        source_ref=exception_type.source_ref,\n                    ),\n                ),\n                source_ref=exception_type.source_ref,\n            )\n\n    if exception_handling is None:\n        # For Python3, we need not publish at all, if all we do is to revert\n        # that immediately. For Python2, the publish may release previously\n        # published exception, which has side effects potentially.\n        if python_version < 0x300:\n            exception_handling = StatementsSequence(\n                statements=(\n                    StatementPreserveFrameException(\n                        preserver_id=0,  # unused with Python2\n                        source_ref=source_ref.atInternal(),\n                    ),\n                    StatementPublishException(source_ref=source_ref.atInternal()),\n                ),\n                source_ref=source_ref.atInternal(),\n            )\n    else:\n        if python_version < 0x300:\n            exception_handling.setChildStatements(\n                (\n                    StatementPreserveFrameException(\n                        preserver_id=0,  # unused with Python2\n                        source_ref=source_ref.atInternal(),\n                    ),\n                    StatementPublishException(source_ref=source_ref.atInternal()),\n                )\n                + exception_handling.subnode_statements,\n            )\n        else:\n            preserver_id = provider.allocatePreserverId()\n\n            exception_handling = makeStatementsSequenceFromStatements(\n                StatementPreserveFrameException(\n                    preserver_id=preserver_id, source_ref=source_ref.atInternal()\n                ),\n                StatementPublishException(source_ref=source_ref.atInternal()),\n                makeTryFinallyStatement(\n                    provider=provider,\n                    tried=exception_handling,\n                    final=StatementRestoreFrameException(\n                        preserver_id=preserver_id, source_ref=source_ref.atInternal()\n                    ),\n                    source_ref=source_ref,\n                ),\n            )\n\n    no_raise = buildStatementsNode(\n        provider=provider, nodes=node.orelse, source_ref=source_ref\n    )\n\n    if no_raise is None:\n        if tried is None:\n            return None\n\n        return StatementTry(\n            tried=tried,\n            except_handler=exception_handling,\n            break_handler=None,\n            continue_handler=None,\n            return_handler=None,\n            source_ref=source_ref,\n        )\n    else:\n        if tried is None:\n            return no_raise\n\n        return makeTryExceptNoRaise(\n            provider=provider,\n            temp_scope=provider.allocateTempScope(\"try_except\"),\n            handling=exception_handling,\n            tried=tried,\n            no_raise=no_raise,\n            source_ref=source_ref,\n        )\n\n\ndef buildTryStarExceptionNode(provider, node, source_ref):\n    return buildTryExceptionNode(\n        provider=provider, node=node, source_ref=source_ref, is_star_try=True\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationTryFinallyStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of try/finally statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka.nodes.LoopNodes import StatementLoopBreak, StatementLoopContinue\nfrom nuitka.nodes.ReturnNodes import StatementReturnReturnedValue\nfrom nuitka.nodes.StatementNodes import (\n    StatementPreserveFrameException,\n    StatementPublishException,\n    StatementRestoreFrameException,\n    StatementsSequence,\n)\nfrom nuitka.nodes.TryNodes import StatementTry\nfrom nuitka.PythonVersions import python_version\n\nfrom .TreeHelpers import (\n    buildStatementsNode,\n    getStatementsAppended,\n    getStatementsPrepended,\n    makeReraiseExceptionStatement,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatement,\n    makeStatementsSequenceFromStatements,\n    mergeStatements,\n    popBuildContext,\n    pushBuildContext,\n)\n\n\ndef _checkCloning(final, provider):\n    final2 = final.makeClone()\n    final2.parent = provider\n\n    import nuitka.TreeXML\n\n    if nuitka.TreeXML.Element is not None:\n        f1 = final.asXml()\n        f2 = final2.asXml()\n\n        def compare(a, b):\n            for c1, c2 in zip(a, b):\n                compare(c1, c2)\n\n            assert a.attrib == b.attrib, (a.attrib, b.attrib)\n\n        compare(f1, f2)\n\n\ndef makeTryFinallyStatement(provider, tried, final, source_ref, public_exc=False):\n    # Complex handling, due to the many variants, pylint: disable=too-many-branches\n\n    if type(tried) in (tuple, list):\n        if tried:\n            tried = makeStatementsSequenceFromStatements(*tried)\n        else:\n            tried = None\n    if type(final) in (tuple, list):\n        if final:\n            final = StatementsSequence(\n                statements=mergeStatements(final, False), source_ref=source_ref\n            )\n        else:\n            final = None\n\n    if tried is not None and not tried.isStatementsSequence():\n        tried = makeStatementsSequenceFromStatement(tried)\n    if final is not None and not final.isStatementsSequence():\n        final = makeStatementsSequenceFromStatement(final)\n\n    # Trivial case, nothing tried needs only do the final stuff.\n    if tried is None:\n        return final\n\n    # Trivial case, nothing final needs nothing but the tried stuff.\n    if final is None:\n        return tried\n\n    # Parent them to us already.\n    if provider is not None:\n        tried.parent = provider\n        final.parent = provider\n\n    def getFinal():\n        # Make a clone of \"final\" only if necessary.\n        if hasattr(getFinal, \"used\"):\n            return final.makeClone()\n        else:\n            getFinal.used = True\n            return final\n\n    if tried.mayRaiseException(BaseException):\n        except_handler = getStatementsAppended(\n            statement_sequence=getFinal(),\n            statements=makeReraiseExceptionStatement(source_ref=source_ref),\n        )\n\n        if public_exc:\n            preserver_id = provider.allocatePreserverId()\n\n            except_handler = getStatementsPrepended(\n                statement_sequence=except_handler,\n                statements=(\n                    StatementPreserveFrameException(\n                        preserver_id=preserver_id, source_ref=source_ref.atInternal()\n                    ),\n                    StatementPublishException(source_ref=source_ref),\n                ),\n            )\n\n            except_handler = makeTryFinallyStatement(\n                provider=provider,\n                tried=except_handler,\n                final=StatementRestoreFrameException(\n                    preserver_id=preserver_id, source_ref=source_ref.atInternal()\n                ),\n                public_exc=False,\n                source_ref=source_ref,\n            )\n\n            except_handler = makeStatementsSequenceFromStatement(\n                statement=except_handler\n            )\n    else:\n        except_handler = None\n\n    if tried.mayBreak():\n        break_handler = getStatementsAppended(\n            statement_sequence=getFinal(),\n            statements=StatementLoopBreak(source_ref=source_ref),\n        )\n    else:\n        break_handler = None\n\n    if tried.mayContinue():\n        continue_handler = getStatementsAppended(\n            statement_sequence=getFinal(),\n            statements=StatementLoopContinue(source_ref=source_ref),\n        )\n    else:\n        continue_handler = None\n\n    if tried.mayReturn():\n        return_handler = getStatementsAppended(\n            statement_sequence=getFinal(),\n            statements=StatementReturnReturnedValue(\n                source_ref=source_ref,\n            ),\n        )\n    else:\n        return_handler = None\n\n    result = StatementTry(\n        tried=tried,\n        except_handler=except_handler,\n        break_handler=break_handler,\n        continue_handler=continue_handler,\n        return_handler=return_handler,\n        source_ref=source_ref,\n    )\n\n    if result.isStatementAborting():\n        return result\n    else:\n        return makeStatementsSequence(\n            statements=(result, getFinal()), allow_none=False, source_ref=source_ref\n        )\n\n\ndef buildTryFinallyNode(provider, build_tried, node, source_ref):\n    if python_version < 0x300:\n        # Prevent \"continue\" statements in the final blocks\n        pushBuildContext(\"finally\")\n        final = buildStatementsNode(\n            provider=provider, nodes=node.finalbody, source_ref=source_ref\n        )\n        popBuildContext()\n\n        return makeTryFinallyStatement(\n            provider=provider,\n            tried=build_tried(),\n            final=final,\n            source_ref=source_ref,\n            public_exc=False,\n        )\n    else:\n        tried = build_tried()\n\n        # Prevent \"continue\" statements in the final blocks, these have to\n        # become \"SyntaxError\".\n        pushBuildContext(\"finally\")\n        final = buildStatementsNode(\n            provider=provider, nodes=node.finalbody, source_ref=source_ref\n        )\n        popBuildContext()\n\n        return makeTryFinallyStatement(\n            provider=provider,\n            tried=tried,\n            final=final,\n            public_exc=True,\n            source_ref=source_ref,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationWhileLoopStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of while loop statements.\n\nLoops in Nuitka have no condition attached anymore, so while loops are\nre-formulated like this:\n\n.. code-block:: python\n\n    while condition:\n        something()\n\n.. code-block:: python\n\n    while 1:\n        if not condition:\n            break\n\n        something()\n\nThis is to totally remove the specialization of loops, with the condition moved\nto the loop body in an initial conditional statement, which contains a ``break``\nstatement.\n\nThat achieves, that only ``break`` statements exit the loop, and allow for\noptimization to remove always true loop conditions, without concerning code\ngeneration about it, and to detect such a situation, consider e.g. endless\nloops.\n\n.. note::\n\n   Loop analysis (not yet done) can then work on a reduced problem (which\n   ``break`` statements are executed under what conditions) and is then\n   automatically very general.\n\n   The fact that the loop body may not be entered at all, is still optimized,\n   but also in the general sense. Explicit breaks at the loop start and loop\n   conditions are the same.\n\n\"\"\"\n\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.LoopNodes import StatementLoop, StatementLoopBreak\nfrom nuitka.nodes.OperatorNodesUnary import ExpressionOperationNot\nfrom nuitka.nodes.StatementNodes import StatementsSequence\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\n\nfrom .TreeHelpers import (\n    buildNode,\n    buildStatementsNode,\n    makeStatementsSequence,\n    makeStatementsSequenceFromStatements,\n    popBuildContext,\n    pushBuildContext,\n)\n\n\ndef buildWhileLoopNode(provider, node, source_ref):\n    # The while loop is re-formulated according to Developer Manual. The\n    # condition becomes an early condition to break the loop. The else block is\n    # taken if a while loop exits normally, i.e. because of condition not being\n    # true. We do this by introducing an indicator variable.\n\n    else_block = buildStatementsNode(\n        provider=provider,\n        nodes=node.orelse if node.orelse else None,\n        source_ref=source_ref,\n    )\n\n    if else_block is not None:\n        temp_scope = provider.allocateTempScope(\"while_loop\")\n\n        # Indicator variable, will end up with C bool type, and need not be released.\n        tmp_break_indicator = provider.allocateTempVariable(\n            temp_scope=temp_scope, name=\"break_indicator\", temp_type=\"bool\"\n        )\n\n        statements = (\n            makeStatementAssignmentVariable(\n                variable=tmp_break_indicator,\n                source=makeConstantRefNode(constant=True, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            StatementLoopBreak(source_ref=source_ref),\n        )\n    else:\n        statements = (StatementLoopBreak(source_ref=source_ref),)\n\n    pushBuildContext(\"loop_body\")\n    loop_statements = buildStatementsNode(\n        provider=provider, nodes=node.body, source_ref=source_ref\n    )\n    popBuildContext()\n\n    # The loop body contains a conditional statement at the start that breaks\n    # the loop if it fails.\n    loop_body = makeStatementsSequence(\n        statements=(\n            makeStatementConditional(\n                condition=ExpressionOperationNot(\n                    operand=buildNode(provider, node.test, source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=StatementsSequence(\n                    statements=statements, source_ref=source_ref\n                ),\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n            loop_statements,\n        ),\n        allow_none=True,\n        source_ref=source_ref,\n    )\n\n    loop_statement = StatementLoop(loop_body=loop_body, source_ref=source_ref)\n\n    if else_block is None:\n        return loop_statement\n    else:\n        return makeStatementsSequenceFromStatements(\n            makeStatementAssignmentVariable(\n                variable=tmp_break_indicator,\n                source=makeConstantRefNode(constant=False, source_ref=source_ref),\n                source_ref=source_ref,\n            ),\n            loop_statement,\n            makeStatementConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_break_indicator, source_ref=source_ref\n                    ),\n                    right=makeConstantRefNode(constant=True, source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=else_block,\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationWithStatements.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of with statements.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nfrom nuitka import Options\nfrom nuitka.nodes.AttributeLookupNodes import ExpressionAttributeLookupSpecial\nfrom nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup\nfrom nuitka.nodes.CallNodes import (\n    ExpressionCallEmpty,\n    ExpressionCallNoKeywords,\n)\nfrom nuitka.nodes.ComparisonNodes import ExpressionComparisonIs\nfrom nuitka.nodes.ConditionalNodes import makeStatementConditional\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTuple\nfrom nuitka.nodes.CoroutineNodes import (\n    ExpressionAsyncWaitEnter,\n    ExpressionAsyncWaitExit,\n)\nfrom nuitka.nodes.ExceptionNodes import (\n    ExpressionCaughtExceptionTracebackRef,\n    ExpressionCaughtExceptionTypeRef,\n    ExpressionCaughtExceptionValueRef,\n)\nfrom nuitka.nodes.StatementNodes import (\n    StatementExpressionOnly,\n    StatementsSequence,\n)\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.nodes.YieldNodes import ExpressionYieldFromAwaitable\nfrom nuitka.PythonVersions import python_version\n\nfrom .ReformulationAssignmentStatements import buildAssignmentStatements\nfrom .ReformulationTryExceptStatements import (\n    makeTryExceptSingleHandlerNodeWithPublish,\n)\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .TreeHelpers import (\n    buildNode,\n    buildStatementsNode,\n    makeReraiseExceptionStatement,\n    makeStatementsSequence,\n)\n\n\ndef _buildWithNode(provider, context_expr, assign_target, body, sync, source_ref):\n    # Many details, pylint: disable=too-many-branches,too-many-locals\n    with_source = buildNode(provider, context_expr, source_ref)\n\n    if python_version < 0x380 and Options.is_full_compat:\n        source_ref = with_source.getCompatibleSourceReference()\n\n    temp_scope = provider.allocateTempScope(\"with\")\n\n    tmp_source_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"source\", temp_type=\"object\"\n    )\n    tmp_exit_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"exit\", temp_type=\"object\"\n    )\n    tmp_enter_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"enter\", temp_type=\"object\"\n    )\n\n    # Indicator variable, will end up with C bool type, and need not be released.\n    tmp_indicator_variable = provider.allocateTempVariable(\n        temp_scope=temp_scope, name=\"indicator\", temp_type=\"bool\"\n    )\n\n    statements = (\n        buildAssignmentStatements(\n            provider=provider,\n            node=assign_target,\n            allow_none=True,\n            source=ExpressionTempVariableRef(\n                variable=tmp_enter_variable, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        ),\n        body,\n    )\n\n    with_body = makeStatementsSequence(\n        statements=statements, allow_none=True, source_ref=source_ref\n    )\n\n    if body and python_version < 0x3A0:\n        deepest = body\n\n        while deepest.getVisitableNodes():\n            deepest = deepest.getVisitableNodes()[-1]\n\n        if python_version < 0x370:\n            body_lineno = deepest.getCompatibleSourceReference().getLineNumber()\n        else:\n            body_lineno = deepest.getSourceReference().getLineNumber()\n\n        with_exit_source_ref = source_ref.atLineNumber(body_lineno)\n    else:\n        with_exit_source_ref = source_ref\n\n    # The \"__enter__\" and \"__exit__\" were normal attribute lookups under\n    # CPython2.6, but that changed with CPython2.7.\n    if python_version < 0x270:\n        attribute_lookup_maker = makeExpressionAttributeLookup\n    else:\n        attribute_lookup_maker = ExpressionAttributeLookupSpecial\n\n    enter_value = ExpressionCallEmpty(\n        called=attribute_lookup_maker(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_source_variable, source_ref=source_ref\n            ),\n            attribute_name=\"__enter__\" if sync else \"__aenter__\",\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n    exit_value_exception = ExpressionCallNoKeywords(\n        called=ExpressionTempVariableRef(\n            variable=tmp_exit_variable, source_ref=with_exit_source_ref\n        ),\n        args=makeExpressionMakeTuple(\n            elements=(\n                ExpressionCaughtExceptionTypeRef(source_ref=with_exit_source_ref),\n                ExpressionCaughtExceptionValueRef(source_ref=with_exit_source_ref),\n                ExpressionCaughtExceptionTracebackRef(source_ref=source_ref),\n            ),\n            source_ref=source_ref,\n        ),\n        source_ref=with_exit_source_ref,\n    )\n\n    exit_value_no_exception = ExpressionCallNoKeywords(\n        called=ExpressionTempVariableRef(\n            variable=tmp_exit_variable, source_ref=source_ref\n        ),\n        args=makeConstantRefNode(constant=(None, None, None), source_ref=source_ref),\n        source_ref=with_exit_source_ref,\n    )\n\n    # For \"async with\", await the entered value and exit value must be awaited.\n    if not sync:\n        exit_value_exception = ExpressionYieldFromAwaitable(\n            expression=ExpressionAsyncWaitExit(\n                expression=exit_value_exception, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n        exit_value_no_exception = ExpressionYieldFromAwaitable(\n            ExpressionAsyncWaitExit(\n                expression=exit_value_no_exception, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n\n    # First assign the with context to a temporary variable.\n    statements = [\n        makeStatementAssignmentVariable(\n            variable=tmp_source_variable, source=with_source, source_ref=source_ref\n        )\n    ]\n\n    # Before 3.9, __aenter__ is immediately awaited, after we first do __aexit__ lookup.\n    if not sync and python_version < 0x390:\n        enter_value = ExpressionYieldFromAwaitable(\n            expression=ExpressionAsyncWaitEnter(\n                expression=enter_value, source_ref=source_ref\n            ),\n            source_ref=source_ref,\n        )\n\n    attribute_enter_assignment = makeStatementAssignmentVariable(\n        variable=tmp_enter_variable, source=enter_value, source_ref=source_ref\n    )\n\n    attribute_exit_assignment = makeStatementAssignmentVariable(\n        variable=tmp_exit_variable,\n        source=attribute_lookup_maker(\n            expression=ExpressionTempVariableRef(\n                variable=tmp_source_variable, source_ref=source_ref\n            ),\n            attribute_name=\"__exit__\" if sync else \"__aexit__\",\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n    # Next, assign \"__enter__\" and \"__exit__\" attributes to temporary variables, and\n    # depending on Python versions switch the order of these lookups and the order of\n    # awaiting enter.\n    # Normal \"with\" statements are enter, exit ordered after 3.6, and \"async with\"\n    # are since 3.9, and since 3.9 the enter is not awaited, until an exit is present.\n    if python_version >= 0x390 and not sync:\n        enter_await_statement = makeStatementAssignmentVariable(\n            variable=tmp_enter_variable,\n            source=ExpressionYieldFromAwaitable(\n                expression=ExpressionAsyncWaitEnter(\n                    expression=ExpressionTempVariableRef(\n                        variable=tmp_enter_variable, source_ref=source_ref\n                    ),\n                    source_ref=source_ref,\n                ),\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        )\n\n        attribute_assignments = (\n            attribute_enter_assignment,\n            attribute_exit_assignment,\n            enter_await_statement,\n        )\n    elif python_version >= 0x360 and sync:\n        attribute_assignments = (attribute_enter_assignment, attribute_exit_assignment)\n    else:\n        attribute_assignments = (attribute_exit_assignment, attribute_enter_assignment)\n\n    statements.extend(attribute_assignments)\n\n    statements.append(\n        makeStatementAssignmentVariable(\n            variable=tmp_indicator_variable,\n            source=makeConstantRefNode(constant=True, source_ref=source_ref),\n            source_ref=source_ref,\n        )\n    )\n\n    statements += (\n        makeTryFinallyStatement(\n            provider=provider,\n            tried=makeTryExceptSingleHandlerNodeWithPublish(\n                provider=provider,\n                tried=with_body,\n                exception_name=\"BaseException\",\n                handler_body=StatementsSequence(\n                    statements=(\n                        # Prevents final block from calling __exit__ as\n                        # well.\n                        makeStatementAssignmentVariable(\n                            variable=tmp_indicator_variable,\n                            source=makeConstantRefNode(\n                                constant=False, source_ref=source_ref\n                            ),\n                            source_ref=source_ref,\n                        ),\n                        makeStatementConditional(\n                            condition=exit_value_exception,\n                            no_branch=makeReraiseExceptionStatement(\n                                source_ref=with_exit_source_ref\n                            ),\n                            yes_branch=None,\n                            source_ref=with_exit_source_ref,\n                        ),\n                    ),\n                    source_ref=source_ref,\n                ),\n                public_exc=python_version >= 0x270,\n                source_ref=source_ref,\n            ),\n            final=makeStatementConditional(\n                condition=ExpressionComparisonIs(\n                    left=ExpressionTempVariableRef(\n                        variable=tmp_indicator_variable, source_ref=source_ref\n                    ),\n                    right=makeConstantRefNode(constant=True, source_ref=source_ref),\n                    source_ref=source_ref,\n                ),\n                yes_branch=StatementExpressionOnly(\n                    expression=exit_value_no_exception, source_ref=source_ref\n                ),\n                no_branch=None,\n                source_ref=source_ref,\n            ),\n            source_ref=source_ref,\n        ),\n    )\n\n    return makeTryFinallyStatement(\n        provider=provider,\n        tried=statements,\n        final=(\n            makeStatementReleaseVariable(\n                variable=tmp_source_variable, source_ref=with_exit_source_ref\n            ),\n            makeStatementReleaseVariable(\n                variable=tmp_enter_variable, source_ref=with_exit_source_ref\n            ),\n            makeStatementReleaseVariable(\n                variable=tmp_exit_variable, source_ref=with_exit_source_ref\n            ),\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef buildWithNode(provider, node, source_ref):\n    # \"with\" statements are re-formulated as described in the developer\n    # manual. Catches exceptions, and provides them to \"__exit__\", while making\n    # the \"__enter__\" value available under a given name.\n\n    # Before Python3.3, multiple context managers are not visible in the parse\n    # tree, now we need to handle it ourselves.\n    if hasattr(node, \"items\"):\n        context_exprs = [item.context_expr for item in node.items]\n        assign_targets = [item.optional_vars for item in node.items]\n    else:\n        # Make it a list for before Python3.3\n        context_exprs = [node.context_expr]\n        assign_targets = [node.optional_vars]\n\n    # The body for the first context manager is the other things.\n    body = buildStatementsNode(provider, node.body, source_ref)\n\n    assert context_exprs and len(context_exprs) == len(assign_targets)\n\n    context_exprs.reverse()\n    assign_targets.reverse()\n\n    for context_expr, assign_target in zip(context_exprs, assign_targets):\n        body = _buildWithNode(\n            provider=provider,\n            body=body,\n            context_expr=context_expr,\n            assign_target=assign_target,\n            sync=True,\n            source_ref=source_ref,\n        )\n\n    return body\n\n\ndef buildAsyncWithNode(provider, node, source_ref):\n    # \"with\" statements are re-formulated as described in the developer\n    # manual. Catches exceptions, and provides them to \"__exit__\", while making\n    # the \"__enter__\" value available under a given name.\n\n    # Before Python3.3, multiple context managers are not visible in the parse\n    # tree, now we need to handle it ourselves.\n    context_exprs = [item.context_expr for item in node.items]\n    assign_targets = [item.optional_vars for item in node.items]\n\n    # The body for the first context manager is the other things.\n    body = buildStatementsNode(provider, node.body, source_ref)\n\n    assert context_exprs and len(context_exprs) == len(assign_targets)\n\n    context_exprs.reverse()\n    assign_targets.reverse()\n\n    for context_expr, assign_target in zip(context_exprs, assign_targets):\n        body = _buildWithNode(\n            provider=provider,\n            body=body,\n            context_expr=context_expr,\n            assign_target=assign_target,\n            sync=False,\n            source_ref=source_ref,\n        )\n\n    return body\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/ReformulationYieldExpressions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reformulation of \"yield\" and \"yield from\" expressions.\n\nConsult the Developer Manual for information. TODO: Add ability to sync\nsource code comments with Developer Manual sections.\n\n\"\"\"\n\nimport ast\n\nfrom nuitka.nodes.ConstantRefNodes import ExpressionConstantNoneRef\nfrom nuitka.nodes.CoroutineNodes import ExpressionAsyncWait\nfrom nuitka.nodes.YieldNodes import (\n    ExpressionYield,\n    ExpressionYieldFrom,\n    ExpressionYieldFromAwaitable,\n)\nfrom nuitka.PythonVersions import python_version\n\nfrom .SyntaxErrors import raiseSyntaxError\nfrom .TreeHelpers import buildNode\n\n\ndef _checkInsideGenerator(construct_name, provider, node, source_ref):\n    if provider.isCompiledPythonModule():\n        raiseSyntaxError(\n            \"'%s' outside function\"\n            % (construct_name if construct_name == \"await\" else \"yield\"),\n            source_ref.atColumnNumber(node.col_offset),\n        )\n\n    # This yield is forbidden in 3.5, but allowed in 3.6, but yield_from\n    # is neither.\n    if provider.isExpressionAsyncgenObjectBody() and construct_name == \"yield_from\":\n        raiseSyntaxError(\n            \"'%s' inside async function\"\n            % (\"yield\" if node.__class__ is ast.Yield else \"yield from\",),\n            source_ref.atColumnNumber(node.col_offset),\n        )\n\n    if (\n        python_version >= 0x380\n        and provider.isExpressionGeneratorObjectBody()\n        and provider.name == \"<genexpr>\"\n        and construct_name != \"await\"\n    ):\n        raiseSyntaxError(\n            \"'%s' inside generator expression\"\n            % (\"yield\" if node.__class__ is ast.Yield else \"yield from\",),\n            provider.getSourceReference(),\n        )\n\n    while provider.isExpressionOutlineFunction():\n        provider = provider.getParentVariableProvider()\n\n    assert (\n        provider.isExpressionGeneratorObjectBody()\n        or provider.isExpressionAsyncgenObjectBody()\n        or provider.isExpressionCoroutineObjectBody()\n    ), provider\n\n\ndef buildYieldNode(provider, node, source_ref):\n    _checkInsideGenerator(\"yield\", provider, node, source_ref)\n\n    if node.value is not None:\n        return ExpressionYield(\n            expression=buildNode(provider, node.value, source_ref),\n            source_ref=source_ref,\n        )\n    else:\n        return ExpressionYield(\n            expression=ExpressionConstantNoneRef(source_ref=source_ref),\n            source_ref=source_ref,\n        )\n\n\ndef buildYieldFromNode(provider, node, source_ref):\n    assert python_version >= 0x300\n\n    _checkInsideGenerator(\"yield_from\", provider, node, source_ref)\n\n    return ExpressionYieldFrom(\n        expression=buildNode(provider, node.value, source_ref), source_ref=source_ref\n    )\n\n\ndef buildAwaitNode(provider, node, source_ref):\n    _checkInsideGenerator(\"await\", provider, node, source_ref)\n\n    return ExpressionYieldFromAwaitable(\n        expression=ExpressionAsyncWait(\n            expression=buildNode(provider, node.value, source_ref),\n            source_ref=source_ref,\n        ),\n        source_ref=source_ref,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/SourceHandling.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Read/write source code from files.\n\nReading is tremendously more complex than one might think, due to encoding\nissues and version differences of Python versions.\n\"\"\"\n\nimport os\nimport re\nimport sys\n\nfrom nuitka import Options, SourceCodeReferences\nfrom nuitka.__past__ import unicode\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.plugins.Plugins import Plugins\nfrom nuitka.PythonVersions import python_version, python_version_str\nfrom nuitka.Tracing import general, my_print\nfrom nuitka.utils.FileOperations import (\n    getFileContentByLine,\n    putTextFileContents,\n)\nfrom nuitka.utils.Shebang import getShebangFromSource, parseShebang\nfrom nuitka.utils.Utils import isWin32OrPosixWindows\n\nfrom .SyntaxErrors import raiseSyntaxError\n\n_fstrings_installed = False\n\n\ndef _installFutureFStrings():\n    \"\"\"Install fake UTF8 handle just as future-fstrings does.\"\"\"\n\n    # Singleton, pylint: disable=global-statement\n    global _fstrings_installed\n\n    if _fstrings_installed:\n        return\n\n    # TODO: Not supporting anything before that.\n    if python_version >= 0x360:\n        import codecs\n\n        # Play trick for of \"future_strings\" PyPI package support. It's not needed,\n        # but some people use it even on newer Python.\n        try:\n            codecs.lookup(\"future-fstrings\")\n        except LookupError:\n            import encodings\n\n            utf8 = encodings.search_function(\"utf8\")\n            codec_map = {\"future-fstrings\": utf8, \"future_fstrings\": utf8}\n            codecs.register(codec_map.get)\n    else:\n        try:\n            import future_fstrings\n        except ImportError:\n            pass\n        else:\n            future_fstrings.register()\n\n    _fstrings_installed = True\n\n\ndef _readSourceCodeFromFilename3(source_filename):\n    # Only using this for Python3, for Python2 it's too buggy.\n    import tokenize\n\n    _installFutureFStrings()\n\n    with tokenize.open(source_filename) as source_file:\n        return source_file.read()\n\n\ndef _detectEncoding2(source_file):\n    # Detect the encoding.\n    encoding = \"ascii\"\n\n    line1 = source_file.readline()\n\n    if line1.startswith(b\"\\xef\\xbb\\xbf\"):\n        # BOM marker makes it clear.\n        encoding = \"utf-8\"\n    else:\n        line1_match = re.search(b\"coding[:=]\\\\s*([-\\\\w.]+)\", line1)\n\n        if line1_match:\n            encoding = line1_match.group(1)\n        else:\n            line2 = source_file.readline()\n\n            line2_match = re.search(b\"coding[:=]\\\\s*([-\\\\w.]+)\", line2)\n\n            if line2_match:\n                encoding = line2_match.group(1)\n\n    source_file.seek(0)\n\n    return encoding\n\n\ndef _readSourceCodeFromFilename2(source_filename):\n    _installFutureFStrings()\n\n    # Detect the encoding, we do not know it, pylint: disable=unspecified-encoding\n    with open(source_filename, \"rU\") as source_file:\n        encoding = _detectEncoding2(source_file)\n\n        source_code = source_file.read()\n\n        # Try and detect SyntaxError from missing or wrong encodings.\n        if type(source_code) is not unicode and encoding == \"ascii\":\n            try:\n                _source_code = source_code.decode(encoding)\n            except UnicodeDecodeError as e:\n                lines = source_code.split(\"\\n\")\n                so_far = 0\n\n                for count, line in enumerate(lines):\n                    so_far += len(line) + 1\n\n                    if so_far > e.args[2]:\n                        break\n                else:\n                    # Cannot happen, decode error implies non-empty.\n                    count = -1\n\n                wrong_byte = re.search(\n                    \"byte 0x([a-f0-9]{2}) in position\", str(e)\n                ).group(1)\n\n                raiseSyntaxError(\n                    \"\"\"\\\nNon-ASCII character '\\\\x%s' in file %s on line %d, but no encoding declared; \\\nsee http://python.org/dev/peps/pep-0263/ for details\"\"\"\n                    % (wrong_byte, source_filename, count + 1),\n                    SourceCodeReferences.fromFilename(source_filename).atLineNumber(\n                        count + 1\n                    ),\n                    display_line=False,\n                )\n\n    return source_code\n\n\ndef getSourceCodeDiff(source_code, source_code_modified):\n    import difflib\n\n    diff = difflib.unified_diff(\n        source_code.splitlines(),\n        source_code_modified.splitlines(),\n        \"original\",\n        \"modified\",\n        \"\",\n        \"\",\n        n=3,\n    )\n\n    return list(diff)\n\n\n_source_code_cache = {}\n\n\ndef readSourceCodeFromFilenameWithInformation(\n    module_name, source_filename, pre_load=False\n):\n    key = (module_name, source_filename)\n\n    if key in _source_code_cache:\n        if pre_load:\n            return _source_code_cache[key]\n        else:\n            return _source_code_cache.pop(key)\n\n    if python_version < 0x300:\n        source_code = _readSourceCodeFromFilename2(source_filename)\n    else:\n        source_code = _readSourceCodeFromFilename3(source_filename)\n\n    # Allow plugins to mess with source code. Test code calls this without a\n    # module and doesn't want any changes from plugins in that case.\n    if module_name is not None:\n        source_code_modified, contributing_plugins = Plugins.onModuleSourceCode(\n            module_name=module_name,\n            source_filename=source_filename,\n            source_code=source_code,\n        )\n    else:\n        source_code_modified = source_code\n        contributing_plugins = ()\n\n    if (\n        Options.shallShowSourceModifications(module_name)\n        and source_code_modified != source_code\n    ):\n        source_diff = getSourceCodeDiff(source_code, source_code_modified)\n\n        if source_diff:\n            my_print(\"%s:\" % module_name.asString())\n            for line in source_diff:\n                my_print(line, end=\"\\n\" if not line.startswith(\"---\") else \"\")\n\n    result = source_code_modified, source_code, contributing_plugins\n\n    if pre_load:\n        _source_code_cache[key] = result\n\n    return result\n\n\ndef readSourceCodeFromFilename(module_name, source_filename, pre_load=False):\n    return readSourceCodeFromFilenameWithInformation(\n        module_name=module_name,\n        source_filename=source_filename,\n        pre_load=pre_load,\n    )[0]\n\n\ndef checkPythonVersionFromCode(source_code):\n    # There is a lot of cases to consider, pylint: disable=too-many-branches\n\n    shebang = getShebangFromSource(source_code)\n\n    if shebang is not None:\n        binary, _args = parseShebang(shebang)\n\n        if not isWin32OrPosixWindows():\n            try:\n                if os.path.samefile(sys.executable, binary):\n                    return True\n            except OSError:  # Might not exist\n                pass\n\n        basename = os.path.basename(binary)\n\n        # Not sure if we should do that.\n        if basename == \"python\":\n            result = python_version < 0x300\n        elif basename == \"python3\":\n            result = python_version >= 0x300\n        elif basename == \"python2\":\n            result = python_version < 0x300\n        elif basename == \"python2.7\":\n            result = python_version < 0x300\n        elif basename == \"python2.6\":\n            result = python_version < 0x270\n        elif basename == \"python3.2\":\n            result = 0x330 > python_version >= 0x300\n        elif basename == \"python3.3\":\n            result = 0x340 > python_version >= 0x330\n        elif basename == \"python3.4\":\n            result = 0x350 > python_version >= 0x340\n        elif basename == \"python3.5\":\n            result = 0x360 > python_version >= 0x350\n        elif basename == \"python3.6\":\n            result = 0x370 > python_version >= 0x360\n        elif basename == \"python3.7\":\n            result = 0x380 > python_version >= 0x370\n        elif basename == \"python3.8\":\n            result = 0x390 > python_version >= 0x380\n        elif basename == \"python3.9\":\n            result = 0x3A0 > python_version >= 0x390\n        elif basename == \"python3.10\":\n            result = 0x3B0 > python_version >= 0x3A0\n        elif basename == \"python3.11\":\n            result = 0x3C0 > python_version >= 0x3B0\n        else:\n            result = None\n\n        if result is False:\n            general.sysexit(\n                \"\"\"\\\nThe program you compiled wants to be run with: %s.\n\nNuitka is currently running with Python version '%s', which seems to not\nmatch that. Nuitka cannot guess the Python version of your source code. You\ntherefore might want to specify: '%s -m nuitka'.\n\nThat will make use the correct Python version for Nuitka.\n\"\"\"\n                % (shebang, python_version_str, binary)\n            )\n\n\ndef readSourceLine(source_ref):\n    \"\"\"Read a single source line, mainly for use in error reporting only.\"\"\"\n    import linecache\n\n    return linecache.getline(\n        filename=source_ref.getFilename(), lineno=source_ref.getLineNumber()\n    )\n\n\ndef readSourceLines(source_ref):\n    \"\"\"Read a source lines with linecache, for use with cached function source finding.\"\"\"\n    import linecache\n\n    return linecache.getlines(source_ref.filename)\n\n\ndef writeSourceCode(filename, source_code):\n    # Prevent accidental overwriting. When this happens the collision detection\n    # or something else has failed.\n    assert not os.path.isfile(filename), filename\n\n    putTextFileContents(filename=filename, contents=source_code, encoding=\"latin1\")\n\n\ndef parsePyIFile(module_name, pyi_filename):\n    \"\"\"Parse a pyi file for the given module name and extract imports made.\"\"\"\n\n    # Complex stuff, pylint: disable=too-many-branches,too-many-statements\n\n    pyi_deps = OrderedSet()\n\n    # Flag signalling multiline import handling\n    in_import = False\n    in_import_part = \"\"\n    in_quote = None\n\n    for line in getFileContentByLine(pyi_filename):\n        line = line.strip()\n\n        if in_quote:\n            if line.endswith(in_quote):\n                in_quote = None\n\n            continue\n\n        if line.startswith('\"\"\"'):\n            in_quote = '\"\"\"'\n            continue\n\n        if line.startswith(\"'''\"):\n            in_quote = \"'''\"\n            continue\n\n        if not in_import:\n            if line.startswith(\"import \"):\n                imported = line[7:]\n\n                pyi_deps.add(imported)\n            elif line.startswith(\"from \"):\n                parts = line.split(None, 3)\n                assert parts[0] == \"from\"\n                if parts[2] != \"import\":\n                    continue\n\n                origin_name = parts[1]\n\n                # These are never submodules.\n                if origin_name in (\"typing\", \"__future__\"):\n                    continue\n\n                if origin_name == \".\":\n                    origin_name = module_name\n                else:\n                    dot_count = 0\n                    while origin_name.startswith(\".\"):\n                        origin_name = origin_name[1:]\n                        dot_count += 1\n\n                    if dot_count > 0:\n                        if origin_name:\n                            origin_name = module_name.getRelativePackageName(\n                                level=dot_count + 1\n                            ).getChildNamed(origin_name)\n                        else:\n                            origin_name = module_name.getRelativePackageName(\n                                level=dot_count + 1\n                            )\n\n                if origin_name != module_name:\n                    pyi_deps.add(origin_name)\n\n                imported = parts[3]\n                if imported.startswith(\"(\"):\n                    # Handle multiline imports\n                    if not imported.endswith(\")\"):\n                        in_import = True\n                        imported = imported[1:]\n                        in_import_part = origin_name\n                        assert in_import_part, (\n                            \"Multiline part in file %s cannot be empty\" % pyi_filename\n                        )\n                    else:\n                        in_import = False\n                        imported = imported[1:-1]\n                        assert imported\n\n                if imported == \"*\":\n                    continue\n\n                for name in imported.split(\",\"):\n                    if name:\n                        name = name.strip()\n                        pyi_deps.add(origin_name + \".\" + name)\n\n        else:  # In import\n            imported = line\n            if imported.endswith(\")\"):\n                imported = imported[0:-1]\n                in_import = False\n\n            for name in imported.split(\",\"):\n                name = name.strip()\n                if name:\n                    pyi_deps.add(in_import_part + \".\" + name)\n\n    return pyi_deps\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/SyntaxErrors.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Handling of syntax errors.\n\nFormat SyntaxError/IndentationError exception for output, as well as\nraise it for the given source code reference.\n\"\"\"\n\nfrom nuitka.PythonVersions import python_version\n\n\ndef formatOutput(e):\n    if len(e.args) > 1:\n        if len(e.args[1]) == 4:\n            reason, (filename, lineno, colno, message) = e.args\n        else:\n            reason, (filename, lineno, colno, message, _lineno2, _colno2) = e.args\n\n        if message is None and colno is not None:\n            colno = None\n\n        if lineno is not None and lineno == 0:\n            lineno = 1\n    else:\n        (reason,) = e.args\n\n        filename = None\n        lineno = None\n        colno = None\n        message = None\n\n    # On CPython3.4 at least, this attribute appears to override reason for\n    # SyntaxErrors at least.\n    if hasattr(e, \"msg\"):\n        reason = e.msg\n\n    if colno is not None and (\n        not e.__class__ is IndentationError or python_version < 0x390\n    ):\n        colno = colno - len(message) + len(message.lstrip())\n\n        return \"\"\"\\\n  File \"%s\", line %d\n    %s\n    %s^\n%s: %s\"\"\" % (\n            filename,\n            lineno,\n            message.strip(),\n            \" \" * (colno - 1) if colno is not None else \"\",\n            e.__class__.__name__,\n            reason,\n        )\n    elif message is not None:\n        return \"\"\"\\\n  File \"%s\", line %d\n    %s\n%s: %s\"\"\" % (\n            filename,\n            lineno,\n            message.strip(),\n            e.__class__.__name__,\n            reason,\n        )\n    elif filename is not None:\n        return \"\"\"\\\n  File \"%s\", line %s\n%s: %s\"\"\" % (\n            filename,\n            lineno,\n            e.__class__.__name__,\n            reason,\n        )\n    else:\n        return \"\"\"\\\n%s: %s\"\"\" % (\n            e.__class__.__name__,\n            reason,\n        )\n\n\ndef raiseSyntaxError(reason, source_ref, display_file=True, display_line=True):\n    col_offset = source_ref.getColumnNumber()\n\n    def readSource():\n        # Cyclic dependency.\n        from .SourceHandling import readSourceLine\n\n        return readSourceLine(source_ref)\n\n    # Special case being asked to display.\n    if display_file and display_line:\n        source_line = readSource()\n\n        raise SyntaxError(\n            reason,\n            (\n                source_ref.getFilename(),\n                source_ref.getLineNumber(),\n                col_offset,\n                source_line,\n            ),\n        )\n\n    # Special case given source reference.\n    if source_ref is not None:\n        if display_line:\n            source_line = readSource()\n        else:\n            source_line = None\n\n        exc = SyntaxError(\n            reason,\n            (\n                source_ref.getFilename(),\n                source_ref.getLineNumber(),\n                col_offset,\n                source_line,\n            ),\n        )\n\n    exc = SyntaxError(reason, (None, None, None, None))\n\n    exc.generated_by_nuitka = True\n\n    raise exc\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/TreeHelpers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Helper functions for parsing the AST nodes and building the Nuitka node tree.\n\n\"\"\"\n\nimport __future__\n\nimport ast\n\nfrom nuitka import Constants, Options\nfrom nuitka.Errors import CodeTooComplexCode\nfrom nuitka.nodes.CallNodes import makeExpressionCall\nfrom nuitka.nodes.CodeObjectSpecs import CodeObjectSpec\nfrom nuitka.nodes.ConstantRefNodes import makeConstantRefNode\nfrom nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTupleOrConstant\nfrom nuitka.nodes.DictionaryNodes import makeExpressionMakeDict\nfrom nuitka.nodes.ExceptionNodes import StatementReraiseException\nfrom nuitka.nodes.FrameNodes import (\n    StatementsFrameAsyncgen,\n    StatementsFrameClass,\n    StatementsFrameCoroutine,\n    StatementsFrameFunction,\n    StatementsFrameGenerator,\n    StatementsFrameModule,\n)\nfrom nuitka.nodes.KeyValuePairNodes import (\n    makeKeyValuePairExpressionsFromKwArgs,\n)\nfrom nuitka.nodes.NodeBases import NodeBase\nfrom nuitka.nodes.NodeMakingHelpers import mergeStatements\nfrom nuitka.nodes.StatementNodes import StatementsSequence\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import optimization_logger, printLine\n\n\ndef dump(node):\n    printLine(ast.dump(node))\n\n\ndef getKind(node):\n    return node.__class__.__name__.rsplit(\".\", 1)[-1]\n\n\ndef extractDocFromBody(node):\n    body = node.body\n    doc = None\n\n    # Work around \"ast.get_docstring\" breakage.\n    if body and getKind(body[0]) == \"Expr\":\n        if getKind(body[0].value) == \"Str\":  # python3.7 or earlier\n            doc = body[0].value.s\n            body = body[1:]\n        elif getKind(body[0].value) == \"Constant\":  # python3.8\n            # Only strings should be used, but all other constants can immediately be ignored,\n            # it seems that e.g. Ellipsis is common.\n            if type(body[0].value.value) is str:\n                doc = body[0].value.value\n            body = body[1:]\n\n        if Options.hasPythonFlagNoDocStrings():\n            doc = None\n\n    return body, doc\n\n\ndef parseSourceCodeToAst(source_code, module_name, filename, line_offset):\n    # Workaround: ast.parse cannot cope with some situations where a file is not\n    # terminated by a new line.\n    if not source_code.endswith(\"\\n\"):\n        source_code = source_code + \"\\n\"\n\n    try:\n        body = ast.parse(source_code, filename)\n    except RuntimeError as e:\n        if \"maximum recursion depth\" in e.args[0]:\n            raise CodeTooComplexCode(module_name, filename)\n\n        raise\n\n    assert getKind(body) == \"Module\"\n\n    if line_offset > 0:\n        ast.increment_lineno(body, line_offset)\n\n    return body\n\n\ndef detectFunctionBodyKind(nodes, start_value=None):\n    # This is a complex mess, following the scope means a lot of checks need\n    # to be done. pylint: disable=too-many-branches,too-many-statements\n\n    indications = set()\n    if start_value is not None:\n        indications.add(start_value)\n\n    flags = set()\n\n    def _checkCoroutine(field):\n        \"\"\"Check only for co-routine nature of the field and only update that.\"\"\"\n        # TODO: This is clumsy code, trying to achieve what non-local does for\n        # Python2 as well.\n\n        old = set(indications)\n        indications.clear()\n\n        _check(field)\n\n        if \"Coroutine\" in indications:\n            old.add(\"Coroutine\")\n\n        indications.clear()\n        indications.update(old)\n\n    def _check(node):\n        node_class = node.__class__\n\n        if node_class is ast.Yield:\n            indications.add(\"Generator\")\n        elif python_version >= 0x300 and node_class is ast.YieldFrom:\n            indications.add(\"Generator\")\n        elif python_version >= 0x350 and node_class in (ast.Await, ast.AsyncWith):\n            indications.add(\"Coroutine\")\n\n        # Recurse to children, but do not cross scope boundary doing so.\n        if node_class is ast.ClassDef:\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"body\"):\n                    pass\n                elif name in (\"bases\", \"decorator_list\", \"keywords\"):\n                    for child in field:\n                        _check(child)\n                elif name == \"starargs\":\n                    if field is not None:\n                        _check(field)\n                elif name == \"kwargs\":\n                    if field is not None:\n                        _check(field)\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif node_class in (ast.FunctionDef, ast.Lambda) or (\n            python_version >= 0x350 and node_class is ast.AsyncFunctionDef\n        ):\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"body\"):\n                    pass\n                elif name in (\"bases\", \"decorator_list\"):\n                    for child in field:\n                        _check(child)\n                elif name == \"args\":\n                    for child in field.defaults:\n                        _check(child)\n\n                    if python_version >= 0x300:\n                        for child in node.args.kw_defaults:\n                            if child is not None:\n                                _check(child)\n\n                        for child in node.args.args:\n                            if child.annotation is not None:\n                                _check(child.annotation)\n\n                elif name == \"returns\":\n                    if field is not None:\n                        _check(field)\n                elif name == \"type_comment\":\n                    # Python3.8: We don't have structure here.\n                    assert field is None or type(field) is str\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif node_class is ast.GeneratorExp:\n            for name, field in ast.iter_fields(node):\n                if name == \"name\":\n                    pass\n                elif name in (\"body\", \"comparators\", \"elt\"):\n                    if python_version >= 0x370:\n                        _checkCoroutine(field)\n                elif name == \"generators\":\n                    _check(field[0].iter)\n\n                    # New syntax in 3.7 allows these to be present in functions not\n                    # declared with \"async def\", so we need to check them, but\n                    # only if top level.\n                    if python_version >= 0x370 and node in nodes:\n                        for gen in field:\n                            if gen.is_async:\n                                indications.add(\"Coroutine\")\n                                break\n\n                            if _checkCoroutine(gen):\n                                break\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif node_class is ast.ListComp and python_version >= 0x300:\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"body\", \"comparators\"):\n                    pass\n                elif name == \"generators\":\n                    _check(field[0].iter)\n                elif name in (\"body\", \"elt\"):\n                    _check(field)\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif python_version >= 0x270 and node_class is ast.SetComp:\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"body\", \"comparators\", \"elt\"):\n                    pass\n                elif name == \"generators\":\n                    _check(field[0].iter)\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif python_version >= 0x270 and node_class is ast.DictComp:\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"body\", \"comparators\", \"key\", \"value\"):\n                    pass\n                elif name == \"generators\":\n                    _check(field[0].iter)\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif python_version >= 0x370 and node_class is ast.comprehension:\n            for name, field in ast.iter_fields(node):\n                if name in (\"name\", \"target\"):\n                    pass\n                elif name == \"iter\":\n                    # Top level comprehension iterators do not influence those.\n                    if node not in nodes:\n                        _check(field)\n                elif name == \"ifs\":\n                    for child in field:\n                        _check(child)\n                elif name == \"is_async\":\n                    if field:\n                        indications.add(\"Coroutine\")\n                else:\n                    assert False, (name, field, ast.dump(node))\n        elif node_class is ast.Name:\n            if python_version >= 0x300 and node.id == \"super\":\n                flags.add(\"has_super\")\n        elif python_version < 0x300 and node_class is ast.Exec:\n            flags.add(\"has_exec\")\n\n            if node.globals is None:\n                flags.add(\"has_unqualified_exec\")\n\n            for child in ast.iter_child_nodes(node):\n                _check(child)\n        elif python_version < 0x300 and node_class is ast.ImportFrom:\n            for import_desc in node.names:\n                if import_desc.name[0] == \"*\":\n                    flags.add(\"has_exec\")\n            for child in ast.iter_child_nodes(node):\n                _check(child)\n        else:\n            for child in ast.iter_child_nodes(node):\n                _check(child)\n\n    for node in nodes:\n        _check(node)\n\n    if indications:\n        if \"Coroutine\" in indications and \"Generator\" in indications:\n            function_kind = \"Asyncgen\"\n        else:\n            # If we found something, make sure we agree on all clues.\n            assert len(indications) == 1, indications\n            function_kind = indications.pop()\n    else:\n        function_kind = \"Function\"\n\n    return function_kind, flags\n\n\nbuild_nodes_args3 = None\nbuild_nodes_args2 = None\nbuild_nodes_args1 = None\n\n\ndef setBuildingDispatchers(path_args3, path_args2, path_args1):\n    # Using global here, as this is really a singleton, in the form of a module,\n    # and this is to break the cyclic dependency it has, pylint: disable=global-statement\n\n    global build_nodes_args3, build_nodes_args2, build_nodes_args1\n\n    build_nodes_args3 = path_args3\n    build_nodes_args2 = path_args2\n    build_nodes_args1 = path_args1\n\n\ndef buildNode(provider, node, source_ref, allow_none=False):\n    if node is None and allow_none:\n        return None\n\n    try:\n        kind = getKind(node)\n\n        if hasattr(node, \"lineno\"):\n            source_ref = source_ref.atLineNumber(node.lineno)\n\n        if kind in build_nodes_args3:\n            result = build_nodes_args3[kind](\n                provider=provider, node=node, source_ref=source_ref\n            )\n        elif kind in build_nodes_args2:\n            result = build_nodes_args2[kind](node=node, source_ref=source_ref)\n        elif kind in build_nodes_args1:\n            result = build_nodes_args1[kind](source_ref=source_ref)\n        elif kind == \"Pass\":\n            result = None\n        else:\n            assert False, ast.dump(node)\n\n        if result is None and allow_none:\n            return None\n\n        assert isinstance(result, NodeBase), result\n\n        return result\n    except SyntaxError:\n        raise\n    except RuntimeError:\n        # Very likely the stack overflow, which we will turn into too complex\n        # code exception, don't warn about it with a code dump then.\n        raise\n    except KeyboardInterrupt:\n        # User interrupting is not a problem with the source, but tell where\n        # we got interrupted.\n        optimization_logger.info(\"Interrupted at '%s'.\" % source_ref)\n        raise\n    except:\n        optimization_logger.warning(\n            \"Problem at '%s' with %s.\" % (source_ref.getAsString(), ast.dump(node))\n        )\n        raise\n\n\ndef buildNodeList(provider, nodes, source_ref, allow_none=False):\n    if nodes is not None:\n        result = []\n\n        for node in nodes:\n            if hasattr(node, \"lineno\"):\n                node_source_ref = source_ref.atLineNumber(node.lineno)\n            else:\n                node_source_ref = source_ref\n\n            entry = buildNode(provider, node, node_source_ref, allow_none)\n\n            if entry is not None:\n                result.append(entry)\n\n        return result\n    else:\n        return []\n\n\ndef buildNodeTuple(provider, nodes, source_ref, allow_none=False):\n    if nodes is not None:\n        result = []\n\n        for node in nodes:\n            if hasattr(node, \"lineno\"):\n                node_source_ref = source_ref.atLineNumber(node.lineno)\n            else:\n                node_source_ref = source_ref\n\n            entry = buildNode(provider, node, node_source_ref, allow_none)\n\n            if entry is not None:\n                result.append(entry)\n\n        return tuple(result)\n    else:\n        return ()\n\n\n_host_node = None\n\n\ndef buildAnnotationNode(provider, node, source_ref):\n    if (\n        python_version >= 0x370\n        and provider.getParentModule().getFutureSpec().isFutureAnnotations()\n    ):\n        # Using global value for cache, to avoid creating it over and over,\n        # avoiding the pylint: disable=global-statement\n        global _host_node\n\n        if _host_node is None:\n            _host_node = ast.parse(\"x:1\")\n\n        _host_node.body[0].annotation = node\n\n        r = compile(\n            _host_node,\n            \"<annotations>\",\n            \"exec\",\n            __future__.CO_FUTURE_ANNOTATIONS,\n            dont_inherit=True,\n        )\n\n        # Using exec here, to compile the ast node tree back to string,\n        # there is no accessible \"ast.unparse\", and this works as a hack\n        # to convert our node to a string annotation, pylint: disable=exec-used\n        m = {}\n        exec(r, m)\n\n        value = m[\"__annotations__\"][\"x\"]\n\n        if Options.is_debug and python_version >= 0x390:\n            # TODO: In Python3.9+, we should only use ast.unparse\n            assert value == ast.unparse(node)\n\n        return makeConstantRefNode(constant=value, source_ref=source_ref)\n\n    return buildNode(provider, node, source_ref)\n\n\ndef makeModuleFrame(module, statements, source_ref):\n    assert module.isCompiledPythonModule()\n\n    if Options.is_full_compat:\n        code_name = \"<module>\"\n    else:\n        if module.isMainModule():\n            code_name = \"<module>\"\n        else:\n            code_name = \"<module %s>\" % module.getFullName()\n\n    return StatementsFrameModule(\n        statements=tuple(statements),\n        code_object=CodeObjectSpec(\n            co_name=code_name,\n            co_qualname=code_name,\n            co_kind=\"Module\",\n            co_varnames=(),\n            co_freevars=(),\n            co_argcount=0,\n            co_posonlyargcount=0,\n            co_kwonlyargcount=0,\n            co_has_starlist=False,\n            co_has_stardict=False,\n            co_filename=module.getRunTimeFilename(),\n            co_lineno=source_ref.getLineNumber(),\n            future_spec=module.getFutureSpec(),\n        ),\n        source_ref=source_ref,\n    )\n\n\ndef buildStatementsNode(provider, nodes, source_ref):\n    # We are not creating empty statement sequences.\n    if nodes is None:\n        return None\n\n    # Build as list of statements, throw away empty ones, and remove useless\n    # nesting.\n    statements = buildNodeList(provider, nodes, source_ref, allow_none=True)\n    statements = mergeStatements(statements)\n\n    # We are not creating empty statement sequences. Might be empty, because\n    # e.g. a global node generates not really a statement, or pass statements.\n    if not statements:\n        return None\n    else:\n        return StatementsSequence(statements=statements, source_ref=source_ref)\n\n\ndef buildFrameNode(provider, nodes, code_object, source_ref):\n    # We are not creating empty statement sequences.\n    if nodes is None:\n        return None\n\n    # Build as list of statements, throw away empty ones, and remove useless\n    # nesting.\n    statements = buildNodeList(provider, nodes, source_ref, allow_none=True)\n    statements = mergeStatements(statements)\n\n    # We are not creating empty statement sequences. Might be empty, because\n    # e.g. a global node generates not really a statement, or pass statements.\n    if not statements:\n        return None\n\n    if provider.isExpressionOutlineFunction():\n        provider = provider.getParentVariableProvider()\n\n    if provider.isExpressionFunctionBody():\n        result = StatementsFrameFunction(\n            statements=statements, code_object=code_object, source_ref=source_ref\n        )\n    elif provider.isExpressionClassBodyBase():\n        result = StatementsFrameClass(\n            statements=statements,\n            code_object=code_object,\n            locals_scope=provider.getLocalsScope(),\n            source_ref=source_ref,\n        )\n    elif provider.isExpressionGeneratorObjectBody():\n        result = StatementsFrameGenerator(\n            statements=statements, code_object=code_object, source_ref=source_ref\n        )\n    elif provider.isExpressionCoroutineObjectBody():\n        result = StatementsFrameCoroutine(\n            statements=statements, code_object=code_object, source_ref=source_ref\n        )\n    elif provider.isExpressionAsyncgenObjectBody():\n        result = StatementsFrameAsyncgen(\n            statements=statements, code_object=code_object, source_ref=source_ref\n        )\n    else:\n        assert False, provider\n\n    return result\n\n\ndef makeStatementsSequenceOrStatement(statements, source_ref):\n    \"\"\"Make a statement sequence, but only if more than one statement\n\n    Useful for when we can unroll constructs already here, but are not sure if\n    we actually did that. This avoids the branch or the pollution of doing it\n    always.\n    \"\"\"\n\n    if len(statements) > 1:\n        return StatementsSequence(\n            statements=mergeStatements(statements), source_ref=source_ref\n        )\n    else:\n        return statements[0]\n\n\ndef makeStatementsSequence(statements, allow_none, source_ref):\n    if allow_none:\n        statements = tuple(\n            statement for statement in statements if statement is not None\n        )\n\n    if statements:\n        return StatementsSequence(\n            statements=mergeStatements(statements, allow_none=allow_none),\n            source_ref=source_ref,\n        )\n    else:\n        return None\n\n\ndef makeStatementsSequenceFromStatement(statement):\n    return StatementsSequence(\n        statements=mergeStatements((statement,)),\n        source_ref=statement.getSourceReference(),\n    )\n\n\ndef makeStatementsSequenceFromStatements(*statements):\n    assert statements\n    assert None not in statements\n\n    statements = mergeStatements(statements, allow_none=False)\n\n    return StatementsSequence(\n        statements=statements, source_ref=statements[0].getSourceReference()\n    )\n\n\ndef makeDictCreationOrConstant2(keys, values, source_ref):\n    # Create dictionary node. Tries to avoid it for constant values that are not\n    # mutable. Keys are Python strings here.\n\n    assert len(keys) == len(values)\n    for value in values:\n        if not value.isExpressionConstantRef():\n            constant = False\n            break\n    else:\n        constant = True\n\n    # Note: This would happen in optimization instead, but lets just do it\n    # immediately to save some time.\n    if constant:\n        # Unless told otherwise, create the dictionary in its full size, so\n        # that no growing occurs and the constant becomes as similar as possible\n        # before being marshaled.\n        result = makeConstantRefNode(\n            constant=Constants.createConstantDict(\n                keys=keys, values=[value.getCompileTimeConstant() for value in values]\n            ),\n            user_provided=True,\n            source_ref=source_ref,\n        )\n    else:\n        result = makeExpressionMakeDict(\n            pairs=makeKeyValuePairExpressionsFromKwArgs(zip(keys, values)),\n            source_ref=source_ref,\n        )\n\n    if values:\n        result.setCompatibleSourceReference(\n            source_ref=values[-1].getCompatibleSourceReference()\n        )\n\n    return result\n\n\ndef getStatementsAppended(statement_sequence, statements):\n    return makeStatementsSequence(\n        statements=(statement_sequence, statements),\n        allow_none=False,\n        source_ref=statement_sequence.getSourceReference(),\n    )\n\n\ndef getStatementsPrepended(statement_sequence, statements):\n    return makeStatementsSequence(\n        statements=(statements, statement_sequence),\n        allow_none=False,\n        source_ref=statement_sequence.getSourceReference(),\n    )\n\n\ndef makeReraiseExceptionStatement(source_ref):\n    return StatementReraiseException(source_ref=source_ref)\n\n\ndef mangleName(name, owner):\n    \"\"\"Mangle names with leading \"__\" for usage in a class owner.\n\n    Notes: The is the private name handling for Python classes.\n    \"\"\"\n\n    if not name.startswith(\"__\") or name.endswith(\"__\"):\n        return name\n    else:\n        # The mangling of function variable names depends on being inside a\n        # class.\n        class_container = owner.getContainingClassDictCreation()\n\n        if class_container is None:\n            return name\n        else:\n            return \"_%s%s\" % (class_container.getName().lstrip(\"_\"), name)\n\n\ndef makeCallNode(called, *args, **kwargs):\n    source_ref = args[-1]\n\n    if len(args) > 1:\n        args = makeExpressionMakeTupleOrConstant(\n            elements=args[:-1], user_provided=True, source_ref=source_ref\n        )\n    else:\n        args = None\n\n    if kwargs:\n        kwargs = makeDictCreationOrConstant2(\n            keys=tuple(kwargs.keys()),\n            values=tuple(kwargs.values()),\n            source_ref=source_ref,\n        )\n    else:\n        kwargs = None\n\n    return makeExpressionCall(\n        called=called, args=args, kw=kwargs, source_ref=source_ref\n    )\n\n\nbuild_contexts = [None]\n\n\ndef pushBuildContext(value):\n    build_contexts.append(value)\n\n\ndef popBuildContext():\n    del build_contexts[-1]\n\n\ndef getBuildContext():\n    return build_contexts[-1]\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/VariableClosure.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Variable closure taking.\n\nThis is the completion of variable object completion. The variables were not\nimmediately resolved to be bound to actual scopes, but are only now.\n\nOnly after this is executed, variable reference nodes can be considered\ncomplete.\n\"\"\"\n\nfrom nuitka.nodes.FunctionNodes import MaybeLocalVariableUsage\nfrom nuitka.nodes.LocalsDictNodes import (\n    ExpressionLocalsVariableRef,\n    ExpressionLocalsVariableRefOrFallback,\n    StatementLocalsDictOperationDel,\n    StatementLocalsDictOperationSet,\n)\nfrom nuitka.nodes.NodeMakingHelpers import (\n    makeConstantReplacementNode,\n    mergeStatements,\n)\nfrom nuitka.nodes.OperatorNodes import makeExpressionOperationBinaryInplace\nfrom nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable\nfrom nuitka.nodes.VariableDelNodes import makeStatementDelVariable\nfrom nuitka.nodes.VariableRefNodes import (\n    ExpressionTempVariableRef,\n    makeExpressionVariableRef,\n)\nfrom nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable\nfrom nuitka.PythonVersions import (\n    getErrorMessageExecWithNestedFunction,\n    python_version,\n)\nfrom nuitka.Variables import isSharedAmongScopes, releaseSharedScopeInformation\n\nfrom .Operations import VisitorNoopMixin, visitTree\nfrom .ReformulationFunctionStatements import addFunctionVariableReleases\nfrom .ReformulationTryFinallyStatements import makeTryFinallyStatement\nfrom .SyntaxErrors import raiseSyntaxError\n\n# Note: We do the variable scope assignment, as an extra step from tree\n# building, because tree building creates the tree without any consideration of\n# evaluation order. And the ordered way these visitors are entered, will ensure\n# this order.\n\n# The main complexity is that there are two ways of visiting. One where variable\n# lookups are to be done immediately, and one where it is delayed. This is\n# basically class vs. function scope handling.\n\n\nclass VariableClosureLookupVisitorPhase1(VisitorNoopMixin):\n    \"\"\"Variable closure phase 1: Find assignments and early closure references.\n\n    In class context, a reference to a variable must be obeyed immediately,\n    so that \"variable = variable\" takes first \"variable\" as a closure and\n    then adds a new local \"variable\" to override it from there on. For the\n    not early closure case of a function, this will not be done and only\n    assignments shall add local variables, and references will be ignored\n    until phase 2.\n    \"\"\"\n\n    @staticmethod\n    def _handleNonLocal(node):\n        # Take closure variables for non-local declarations.\n\n        for (\n            non_local_names,\n            user_provided,\n            source_ref,\n        ) in node.consumeNonlocalDeclarations():\n            for non_local_name in non_local_names:\n                variable = node.takeVariableForClosure(variable_name=non_local_name)\n\n                if variable.isModuleVariable() and user_provided:\n                    raiseSyntaxError(\n                        \"no binding for nonlocal '%s' found\" % (non_local_name),\n                        source_ref,\n                    )\n\n                if node.isExpressionClassBodyBase() and non_local_name == \"__class__\":\n                    pass\n                else:\n                    node.getLocalsScope().registerClosureVariable(variable)\n\n                variable.addVariableUser(node)\n\n    @staticmethod\n    def _handleQualnameSetup(node):\n        if node.qualname_setup is not None:\n            provider = node.getParentVariableProvider()\n\n            if node.isExpressionClassBodyBase():\n                class_variable_name, qualname_assign = node.qualname_setup\n\n                if provider.hasProvidedVariable(class_variable_name):\n                    class_variable = provider.getVariableForReference(\n                        class_variable_name\n                    )\n\n                    if class_variable.isModuleVariable():\n                        qualname_node = qualname_assign.subnode_source\n\n                        new_node = makeConstantReplacementNode(\n                            constant=class_variable.getName(),\n                            node=qualname_node,\n                            user_provided=True,\n                        )\n\n                        parent = qualname_node.parent\n                        qualname_node.finalize()\n                        parent.replaceChild(qualname_node, new_node)\n\n                        node.qualname_provider = node.getParentModule()\n            else:\n                if provider.hasProvidedVariable(node.qualname_setup):\n                    function_variable = provider.getVariableForReference(\n                        node.qualname_setup\n                    )\n\n                    if function_variable.isModuleVariable():\n                        node.qualname_provider = node.getParentModule()\n\n            # TODO: Actually for nested global classes, this approach\n            # may not work, as their \"qualname\" will be wrong. In that\n            # case a dedicated node for \"qualname\" references might be\n            # needed.\n\n            node.qualname_setup = None\n\n    @staticmethod\n    def _shouldUseLocalsDict(provider, variable_name):\n        return provider.isExpressionClassBodyBase() and (\n            not provider.hasProvidedVariable(variable_name)\n            or provider.getProvidedVariable(variable_name).getOwner() is provider\n        )\n\n    def onLeaveNode(self, node):\n        if node.isStatementAssignmentVariableName():\n            variable_name = node.getVariableName()\n            provider = node.provider\n\n            # Classes always assign to locals dictionary except for closure\n            # variables taken.\n            if self._shouldUseLocalsDict(provider, variable_name):\n                if node.subnode_source.isExpressionOperationInplace():\n                    temp_scope = provider.allocateTempScope(\"class_inplace\")\n\n                    tmp_variable = provider.allocateTempVariable(\n                        temp_scope=temp_scope, name=\"value\", temp_type=\"object\"\n                    )\n\n                    statements = mergeStatements(\n                        statements=(\n                            makeStatementAssignmentVariable(\n                                variable=tmp_variable,\n                                source=node.subnode_source.subnode_left,\n                                source_ref=node.source_ref,\n                            ),\n                            makeTryFinallyStatement(\n                                provider=provider,\n                                tried=(\n                                    makeStatementAssignmentVariable(\n                                        variable=tmp_variable,\n                                        source=makeExpressionOperationBinaryInplace(\n                                            left=ExpressionTempVariableRef(\n                                                variable=tmp_variable,\n                                                source_ref=node.source_ref,\n                                            ),\n                                            right=node.subnode_source.subnode_right,\n                                            operator=node.subnode_source.getOperator(),\n                                            source_ref=node.source_ref,\n                                        ),\n                                        source_ref=node.source_ref,\n                                    ),\n                                    StatementLocalsDictOperationSet(\n                                        locals_scope=provider.getLocalsScope(),\n                                        variable_name=variable_name,\n                                        source=ExpressionTempVariableRef(\n                                            variable=tmp_variable,\n                                            source_ref=node.source_ref,\n                                        ),\n                                        source_ref=node.source_ref,\n                                    ),\n                                ),\n                                final=makeStatementReleaseVariable(\n                                    variable=tmp_variable, source_ref=node.source_ref\n                                ),\n                                source_ref=node.source_ref,\n                            ),\n                        )\n                    )\n\n                    node.parent.replaceStatement(node, statements)\n\n                else:\n                    new_node = StatementLocalsDictOperationSet(\n                        locals_scope=provider.getLocalsScope(),\n                        variable_name=variable_name,\n                        source=node.subnode_source,\n                        source_ref=node.source_ref,\n                    )\n\n                    node.parent.replaceChild(node, new_node)\n            else:\n                variable = provider.getVariableForAssignment(\n                    variable_name=variable_name\n                )\n\n                new_node = makeStatementAssignmentVariable(\n                    variable=variable,\n                    source=node.subnode_source,\n                    source_ref=node.source_ref,\n                )\n\n                variable.addVariableUser(provider)\n\n                node.parent.replaceChild(node, new_node)\n\n            del node.parent\n            del node.provider\n        elif node.isStatementDelVariableName():\n            variable_name = node.getVariableName()\n\n            provider = node.provider\n\n            if self._shouldUseLocalsDict(provider, variable_name):\n                # Classes always assign to locals dictionary except for closure\n                # variables taken.\n                new_node = StatementLocalsDictOperationDel(\n                    locals_scope=provider.getLocalsScope(),\n                    variable_name=variable_name,\n                    tolerant=node.tolerant,\n                    source_ref=node.source_ref,\n                )\n            else:\n                variable = provider.getVariableForAssignment(\n                    variable_name=variable_name\n                )\n\n                new_node = makeStatementDelVariable(\n                    variable=variable,\n                    tolerant=node.tolerant,\n                    source_ref=node.source_ref,\n                )\n\n                variable.addVariableUser(provider)\n\n            parent = node.parent\n            node.finalize()\n\n            parent.replaceChild(node, new_node)\n\n    def onEnterNode(self, node):\n        # Mighty complex code with lots of branches, but we aim to get rid of it.\n        # pylint: disable=too-many-branches\n\n        if node.isExpressionVariableNameRef():\n            provider = node.provider\n\n            if provider.isExpressionClassBodyBase():\n                if node.needsFallback():\n                    variable = provider.getVariableForReference(\n                        variable_name=node.getVariableName()\n                    )\n\n                    new_node = ExpressionLocalsVariableRefOrFallback(\n                        locals_scope=provider.getLocalsScope(),\n                        variable_name=node.getVariableName(),\n                        fallback=makeExpressionVariableRef(\n                            variable=variable,\n                            locals_scope=provider.getLocalsScope(),\n                            source_ref=node.source_ref,\n                        ),\n                        source_ref=node.source_ref,\n                    )\n\n                    variable.addVariableUser(provider)\n                else:\n                    new_node = ExpressionLocalsVariableRef(\n                        locals_scope=provider.getLocalsScope(),\n                        variable_name=node.getVariableName(),\n                        source_ref=node.source_ref,\n                    )\n\n                parent = node.parent\n                node.finalize()\n\n                parent.replaceChild(node, new_node)\n        elif node.isExpressionTempVariableRef():\n            if node.getVariable().getOwner() != node.getParentVariableProvider():\n                node.getParentVariableProvider().addClosureVariable(node.getVariable())\n        elif node.isExpressionGeneratorObjectBody():\n            if python_version >= 0x300:\n                self._handleNonLocal(node)\n\n            # Only Python3.4 or later allows for generators to have qualname.\n            if python_version >= 0x340:\n                self._handleQualnameSetup(node)\n        elif node.isExpressionCoroutineObjectBody():\n            self._handleNonLocal(node)\n\n            self._handleQualnameSetup(node)\n        elif node.isExpressionAsyncgenObjectBody():\n            self._handleNonLocal(node)\n\n            self._handleQualnameSetup(node)\n        elif node.isExpressionClassBodyP3():\n            self._handleNonLocal(node)\n\n            # Python3.4 allows for class declarations to be made global, even\n            # after they were declared, so we need to fix this up.\n            if python_version >= 0x340:\n                self._handleQualnameSetup(node)\n        elif node.isExpressionFunctionBody():\n            if python_version >= 0x300:\n                self._handleNonLocal(node)\n\n            # Python 3.4 allows for class declarations to be made global, even\n            # after they were declared, so we need to fix this up.\n            if python_version >= 0x340:\n                self._handleQualnameSetup(node)\n        # Check if continue and break are properly in loops. If not, raise a\n        # syntax error.\n        elif node.isStatementLoopBreak() or node.isStatementLoopContinue():\n            current = node\n\n            while True:\n                current = current.getParent()\n\n                if current.isStatementLoop():\n                    break\n\n                if current.isParentVariableProvider():\n                    if node.isStatementLoopContinue():\n                        message = \"'continue' not properly in loop\"\n                    else:\n                        message = \"'break' outside loop\"\n\n                    raiseSyntaxError(message, node.getSourceReference())\n\n\nclass VariableClosureLookupVisitorPhase2(VisitorNoopMixin):\n    \"\"\"Variable closure phase 2: Find assignments and references.\n\n    In class context, a reference to a variable must be obeyed immediately,\n    so that \"variable = variable\" takes first \"variable\" as a closure and\n    then adds a new local \"variable\" to override it from there on.\n\n    So, assignments for early closure, accesses will already have a\n    variable set now, the others, only in this phase.\n    \"\"\"\n\n    @staticmethod\n    def _attachVariable(node, provider):\n        # print \"Late reference\", node.getVariableName(), \"for\", provider, \"caused at\", node, \"of\", node.getParent()\n\n        variable_name = node.getVariableName()\n\n        variable = provider.getVariableForReference(variable_name=variable_name)\n\n        # Need to catch functions with \"exec\" and closure variables not allowed.\n        if python_version < 0x300 and provider.isExpressionFunctionBodyBase():\n            was_taken = provider.hasTakenVariable(variable_name)\n\n            if not was_taken and variable.getOwner() is not provider:\n                parent_provider = provider.getParentVariableProvider()\n\n                while parent_provider.isExpressionClassBodyBase():\n                    parent_provider = parent_provider.getParentVariableProvider()\n\n                if (\n                    parent_provider.isExpressionFunctionBody()\n                    and parent_provider.isUnqualifiedExec()\n                ):\n                    raiseSyntaxError(\n                        getErrorMessageExecWithNestedFunction()\n                        % parent_provider.getName(),\n                        node.getSourceReference(),\n                        display_line=False,  # Wrong line anyway\n                    )\n\n        return variable\n\n    def onEnterNode(self, node):\n        if node.isExpressionVariableNameRef():\n            provider = node.provider\n\n            try:\n                variable = self._attachVariable(node, provider)\n            except MaybeLocalVariableUsage:\n                variable_name = node.getVariableName()\n\n                new_node = ExpressionLocalsVariableRefOrFallback(\n                    locals_scope=provider.getLocalsScope(),\n                    variable_name=variable_name,\n                    fallback=makeExpressionVariableRef(\n                        variable=node.getParentModule().getVariableForReference(\n                            variable_name\n                        ),\n                        locals_scope=provider.getLocalsScope(),\n                        source_ref=node.source_ref,\n                    ),\n                    source_ref=node.source_ref,\n                )\n            else:\n                new_node = makeExpressionVariableRef(\n                    variable=variable,\n                    locals_scope=provider.getLocalsScope(),\n                    source_ref=node.source_ref,\n                )\n\n                variable.addVariableUser(provider)\n\n            parent = node.parent\n            node.finalize()\n\n            parent.replaceChild(node, new_node)\n\n\nclass VariableClosureLookupVisitorPhase3(VisitorNoopMixin):\n    \"\"\"Variable closure phase 3: Find errors and complete frame variables.\n\n    In this phase, we can do some fix-ups and find errors. We might e.g.\n    detect that a \"del\" was executed on a shared variable, which is not\n    allowed for Python 2.x, so it must be caught. The parsing wouldn't do\n    that.\n\n    Also, frame objects for functions should learn their variable names.\n    \"\"\"\n\n    def onEnterNode(self, node):\n        if python_version < 0x300 and node.isStatementDelVariable():\n            variable = node.getVariable()\n\n            if not variable.isModuleVariable() and isSharedAmongScopes(variable):\n                raiseSyntaxError(\n                    \"\"\"\\\ncan not delete variable '%s' referenced in nested scope\"\"\"\n                    % (variable.getName()),\n                    node.getSourceReference(),\n                )\n        elif node.isStatementsFrame():\n            node.updateLocalNames()\n        elif node.isExpressionFunctionBodyBase():\n            addFunctionVariableReleases(node)\n\n            # Python3 is influenced by the mere use of a variable named as\n            # \"super\". So we need to prepare ability to take closure.\n            if node.hasFlag(\"has_super\"):\n                if not node.hasVariableName(\"__class__\"):\n                    class_var = node.takeVariableForClosure(\"__class__\")\n                    class_var.addVariableUser(node)\n\n                    node.getLocalsScope().registerClosureVariable(class_var)\n                    while node != class_var.getOwner():\n                        node = node.getParentVariableProvider()\n                        node.getLocalsScope().registerClosureVariable(class_var)\n        elif node.isStatementAssignmentVariableGeneric():\n            node.parent.replaceChild(\n                node,\n                makeStatementAssignmentVariable(\n                    source=node.subnode_source,\n                    variable=node.variable,\n                    variable_version=node.variable_version,\n                    source_ref=node.source_ref,\n                ),\n            )\n\n\ndef completeVariableClosures(tree):\n    visitors = (\n        VariableClosureLookupVisitorPhase1(),\n        VariableClosureLookupVisitorPhase2(),\n        VariableClosureLookupVisitorPhase3(),\n    )\n\n    for visitor in visitors:\n        visitTree(tree, visitor)\n\n    # Only used to detect syntax errors.\n    releaseSharedScopeInformation(tree)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/tree/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/AppDirs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Wrapper around appdirs from PyPI\n\nWe do not assume to be installed and fallback to an inline copy and if that\nis not installed, we use our own code for best effort.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport errno\nimport os\nimport tempfile\n\nfrom nuitka.__past__ import (  # pylint: disable=redefined-builtin\n    PermissionError,\n)\nfrom nuitka.Tracing import general\n\nfrom .FileOperations import makePath\nfrom .Importing import importFromInlineCopy\n\nappdirs = importFromInlineCopy(\"appdirs\", must_exist=False, delete_module=True)\n\nif appdirs is None:\n    import appdirs  # pylint: disable=I0021,import-error\n\n\ndef getAppdirsModule():\n    return appdirs\n\n\n_cache_dir = None\n\n\ndef _getCacheDir():\n    global _cache_dir  # singleton, pylint: disable=global-statement\n\n    if _cache_dir is None:\n        _cache_dir = os.getenv(\"NUITKA_CACHE_DIR\")\n\n        if _cache_dir:\n            _cache_dir = os.path.expanduser(_cache_dir)\n        elif appdirs is not None:\n            _cache_dir = appdirs.user_cache_dir(\"Nuitka\", None)\n        else:\n            _cache_dir = os.path.join(os.path.expanduser(\"~\"), \".cache\", \"Nuitka\")\n\n        # For people that build with HOME set this, e.g. Debian, and other package\n        # managers. spell-checker: ignore sbuild\n        if _cache_dir.startswith(\n            (\"/nonexistent/\", \"/sbuild-nonexistent/\", \"/homeless-shelter/\")\n        ):\n            _cache_dir = os.path.join(tempfile.gettempdir(), \"Nuitka\")\n\n        try:\n            makePath(_cache_dir)\n        except PermissionError as e:\n            if e.errno != errno.EACCES:\n                raise\n\n            general.sysexit(\n                \"\"\"\\\nError, failed to create cache directory '%s'. If this is due to a special environment, \\\nplease consider making a PR for a general solution that adds support for it, or use \\\n'NUITKA_CACHE_DIR' set to a writable directory.\"\"\"\n                % _cache_dir\n            )\n\n    return _cache_dir\n\n\ndef getCacheDirEnvironmentVariableName(cache_basename):\n    env_name = cache_basename.replace(\"-\", \"_\").upper()\n\n    return \"NUITKA_CACHE_DIR_\" + env_name\n\n\ndef getCacheDir(cache_basename):\n    cache_dir = os.getenv(getCacheDirEnvironmentVariableName(cache_basename))\n    if cache_dir is None:\n        cache_dir = os.path.join(_getCacheDir(), cache_basename)\n\n    return cache_dir\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/CStrings.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" C string encoding\n\nThis contains the code to create string literals for C to represent the given\nvalues.\n\"\"\"\n\nimport codecs\nimport re\n\nfrom nuitka.__past__ import to_byte, unicode\n\n\ndef _identifierEncode(c):\n    \"\"\"Nuitka handler to encode unicode to ASCII identifiers for C compiler.\"\"\"\n    return \"$%02x$\" % ord(c.object[c.end - 1]), c.end\n\n\ncodecs.register_error(\"c_identifier\", _identifierEncode)\n\n\ndef _encodePythonStringToC(value):\n    \"\"\"Encode a string, so that it gives a C string literal.\n\n    This doesn't handle limits.\n    \"\"\"\n    assert type(value) is bytes, type(value)\n\n    result = \"\"\n    octal = False\n\n    for c in value:\n        if str is bytes:\n            cv = ord(c)\n        else:\n            cv = c\n\n        if c in b'\\\\\\t\\r\\n\"?':\n            result += r\"\\%03o\" % cv\n\n            octal = True\n        elif 32 <= cv <= 127:\n            if octal and c in b\"0123456789\":\n                result += '\" \"'\n\n            result += chr(cv)\n\n            octal = False\n        else:\n            result += r\"\\%o\" % cv\n\n            octal = True\n\n    result = result.replace('\" \"\\\\', \"\\\\\")\n\n    return '\"%s\"' % result\n\n\ndef encodePythonUnicodeToC(value):\n    \"\"\"Encode a string, so that it gives a wide C string literal.\"\"\"\n    assert type(value) is unicode, type(value)\n\n    result = \"\"\n\n    for c in value:\n        cv = ord(c)\n\n        if c == \"\\\\\":\n            result += \"\\\\\\\\\"\n        elif 34 < cv < 128:\n            result += c\n        else:\n            result += r\"\\x%04x\" % cv\n\n    return 'L\"%s\"' % result\n\n\ndef encodePythonStringToC(value):\n    \"\"\"Encode bytes, so that it gives a C string literal.\"\"\"\n\n    # Not all compilers allow arbitrary large C strings, therefore split it up\n    # into chunks. That changes nothing to the meanings, but is easier on the\n    # parser. Currently only MSVC is known to have this issue, but the\n    # workaround can be used universally.\n\n    result = _encodePythonStringToC(value[:16000])\n    value = value[16000:]\n\n    while value:\n        result += \" \"\n        result += _encodePythonStringToC(value[:16000])\n        value = value[16000:]\n\n    return result\n\n\ndef decodeCStringToPython(value):\n    assert value.startswith('\"')\n    value = value[1:-1]\n\n    result = b\"\"\n\n    while value:\n        if value[0] == \"\\\\\":\n            value = value[1:]\n            if value[0] == \"\\\\\":\n                result += b\"\\\\\"\n                continue\n\n            if value[0].isdigit():\n                assert value[1].isdigit(), value\n                assert value[2].isdigit(), value\n\n                octal_number = int(value[2]) + int(value[1]) * 8 + int(value[0]) * 64\n                value = value[3:]\n\n                result += to_byte(octal_number)\n                continue\n\n            assert False, value[0]\n\n        result += value[0].encode(\"ascii\")\n        value = value[1:]\n\n    return result\n\n\ndef encodePythonIdentifierToC(value):\n    \"\"\"Encode an identifier from a given Python string.\"\"\"\n\n    # Python identifiers allow almost of characters except a very\n    # few, much more than C identifiers support. This attempts to\n    # be bi-directional, so we can reverse it.\n\n    def r(match):\n        c = match.group()\n\n        if c == \".\":\n            return \"$\"\n        else:\n            return \"$$%d$\" % ord(c)\n\n    return re.sub(\"[^a-zA-Z0-9_]\", r, value)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/CommandLineOptions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tools for command line options.\"\"\"\n\nimport sys\nfrom optparse import (\n    AmbiguousOptionError,\n    BadOptionError,\n    IndentedHelpFormatter,\n    OptionGroup,\n    OptionParser,\n)\n\n# For re-export only:\nfrom optparse import SUPPRESS_HELP  # isort:skip pylint: disable=unused-import\n\n\nclass OurOptionGroup(OptionGroup):\n    def add_option(self, *args, **kwargs):\n        require_compiling = kwargs.pop(\"require_compiling\", True)\n        github_action = kwargs.pop(\"github_action\", True)\n        github_action_default = kwargs.pop(\"github_action_default\", None)\n\n        result = OptionGroup.add_option(self, *args, **kwargs)\n\n        result.require_compiling = require_compiling\n        result.github_action = github_action\n        result.github_action_default = github_action_default\n\n        return result\n\n\nclass OurOptionParser(OptionParser):\n    # spell-checker: ignore rargs\n    def _process_long_opt(self, rargs, values):\n        arg = rargs[0]\n\n        if \"=\" not in arg:\n            opt = self._match_long_opt(arg)\n            option = self._long_opt[opt]\n            if option.takes_value():\n                self.error(\n                    \"The '%s' option requires an argument with '%s='.\" % (opt, opt)\n                )\n\n        return OptionParser._process_long_opt(self, rargs, values)\n\n    def _match_long_opt(self, opt):\n        \"\"\"_match_long_opt(opt : string) -> string\n\n        Determine which long option string 'opt' matches, ie. which one\n        it is an unambiguous abbreviation for.  Raises BadOptionError if\n        'opt' doesn't unambiguously match any long option string.\n\n        Nuitka: We overload it, in order avoid issues with conflicting\n        options that are really only aliases of the same option.\n        \"\"\"\n        matched_options = set()\n        possibilities = []\n\n        # Exact matches are never ambiguous. We sometimes append to option names\n        # in order to detail things.\n        for option_name in self._long_opt:\n            if opt == option_name:\n                return opt\n\n        for option_name, option_obj in self._long_opt.items():\n            if option_name.startswith(opt):\n                if option_obj not in matched_options:\n                    matched_options.add(option_obj)\n                    possibilities.append(option_name)\n\n        # No exact match, so there had better be just one possibility.\n        if len(matched_options) > 1:\n            raise AmbiguousOptionError(opt, possibilities)\n\n        if possibilities:\n            assert len(possibilities) == 1, possibilities\n            return possibilities[0]\n        else:\n            raise BadOptionError(opt)\n\n    def add_option(self, *args, **kwargs):\n        require_compiling = kwargs.pop(\"require_compiling\", True)\n        github_action = kwargs.pop(\"github_action\", True)\n        github_action_default = kwargs.pop(\"github_action_default\", None)\n\n        default_values = self.get_default_values()\n\n        result = OptionParser.add_option(self, *args, **kwargs)\n        result.require_compiling = require_compiling\n        result.github_action = github_action\n        result.github_action_default = github_action_default\n\n        if result.dest is not None:\n            if hasattr(default_values, result.dest):\n                assert result.default == getattr(default_values, result.dest)\n\n        return result\n\n    def add_option_group(self, group):\n        # We restrain ourselves here, pylint: disable=arguments-differ\n\n        if isinstance(group, str):\n            group = OurOptionGroup(self, group)\n        self.option_groups.append(group)\n\n        return group\n\n    def iterateOptions(self):\n        for option in self.option_list:\n            yield option\n\n        for option_group in self.option_groups:\n            for option in option_group.option_list:\n                yield option\n\n    def hasNonCompilingAction(self, options):\n        for option in self.iterateOptions():\n            # Help option\n            if not hasattr(option, \"require_compiling\"):\n                continue\n\n            if not option.require_compiling and getattr(options, option.dest):\n                return True\n\n        return False\n\n    def isBooleanOption(self, option_name):\n        for option in self.iterateOptions():\n            # Need to use private option attribute, pylint: disable=protected-access\n            if option_name in option._long_opts:\n                return option.action in (\"store_true\", \"store_false\")\n\n        return False\n\n    def isListOption(self, option_name):\n        for option in self.iterateOptions():\n            # Need to use private option attribute, pylint: disable=protected-access\n            if option_name in option._long_opts:\n                return option.action == \"append\"\n\n        return False\n\n\nclass OurHelpFormatter(IndentedHelpFormatter):\n    def format_option_strings(self, option):\n        \"\"\"Return a comma-separated list of option strings & meta variables.\"\"\"\n\n        # Need to use private option list of our parent, pylint: disable=protected-access\n        if option.takes_value():\n            metavar = option.metavar or option.dest.upper()\n            long_opts = [\n                self._long_opt_fmt % (lopt, metavar) for lopt in option._long_opts\n            ]\n        else:\n            long_opts = option._long_opts\n\n        if option._short_opts and not long_opts:\n            sys.exit(\"Error, cannot have short only options with no long option name.\")\n\n        return long_opts[0]\n\n\ndef makeOptionsParser(usage):\n    return OurOptionParser(usage=usage, formatter=OurHelpFormatter())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Distributions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tools for accessing distributions and resolving package names for them. \"\"\"\n\nimport os\n\nfrom nuitka.__past__ import (  # pylint: disable=redefined-builtin\n    FileNotFoundError,\n    unicode,\n)\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import isExperimental\nfrom nuitka.PythonFlavors import (\n    isAnacondaPython,\n    isMSYS2MingwPython,\n    isPosixWindows,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import metadata_logger\n\nfrom .FileOperations import searchPrefixPath\nfrom .Importing import getModuleNameAndKindFromFilenameSuffix\nfrom .ModuleNames import ModuleName, checkModuleName\nfrom .Utils import isMacOS, isWin32Windows\n\n_package_to_distribution = None\n\n\ndef getDistributionFiles(distribution):\n    try:\n        hasattr_files = hasattr(distribution, \"files\")\n    except OSError:\n        metadata_logger.warning(\n            \"\"\"\\\nError, failure to access '.files()' of distribution '%s', path '%s', this \\\nis typically caused by corruption of its installation.\"\"\"\n            % (distribution, _getDistributionPath(distribution))\n        )\n        hasattr_files = False\n\n    if hasattr_files:\n        for filename in distribution.files or ():\n            filename = filename.as_posix()\n\n            yield filename\n    else:\n        record_data = _getDistributionMetadataFileContents(distribution, \"RECORD\")\n\n        if record_data is not None:\n            for line in record_data.splitlines():\n                filename = line.split(\",\", 1)[0]\n\n                yield filename\n\n\ndef _getDistributionMetadataFileContents(distribution, filename):\n    try:\n        if hasattr(distribution, \"read_text\"):\n            result = distribution.read_text(filename)\n        else:\n            result = \"\\n\".join(distribution.get_metadata_lines(filename))\n\n        return result\n    except (FileNotFoundError, KeyError):\n        return None\n    except OSError:\n        metadata_logger.warning(\n            \"\"\"\\\nError, failure to access '%s' of distribution '%s', path '%s', this \\\nis typically caused by corruption of its installation.\"\"\"\n            % (filename, distribution, _getDistributionPath(distribution))\n        )\n        return None\n\n\ndef getDistributionTopLevelPackageNames(distribution):\n    \"\"\"Returns the top level package names for a distribution.\"\"\"\n    top_level_txt = _getDistributionMetadataFileContents(distribution, \"top_level.txt\")\n\n    if top_level_txt is not None:\n        result = [dirname.replace(\"/\", \".\") for dirname in top_level_txt.splitlines()]\n    else:\n        # If the file is not present, fall back to scanning all files in the\n        # distribution.\n        result = OrderedSet()\n\n        for filename in getDistributionFiles(distribution):\n            if filename.startswith(\".\"):\n                continue\n\n            first_path_element, _, remainder = filename.partition(\"/\")\n\n            if first_path_element.endswith(\"dist-info\"):\n                continue\n            if first_path_element == \"__pycache__\":\n                continue\n            if not checkModuleName(first_path_element) or first_path_element == \".\":\n                continue\n\n            if remainder:\n                module_name = ModuleName(first_path_element)\n            else:\n                module_name, _kind = getModuleNameAndKindFromFilenameSuffix(\n                    first_path_element\n                )\n\n                # Ignore top level files that are not modules.\n                if module_name is None:\n                    continue\n\n            result.add(module_name)\n\n        result = OrderedSet(\n            package_name.asString()\n            for package_name in result\n            if not any(\n                package_name.isBelowNamespace(other_package_name)\n                for other_package_name in result\n            )\n        )\n\n    if not result:\n        result = (getDistributionName(distribution),)\n\n    return tuple(result)\n\n\ndef _get_pkg_resource_distributions():\n    \"\"\"Small replacement of distributions() of importlib.metadata that uses pkg_resources\"\"\"\n\n    # Prepare \"site\" for the \"pip\" module to find what it wants.\n    import site\n\n    if _user_site_directory is not None:\n        site.USER_SITE = _user_site_directory\n\n    # pip and vendored pkg_resources are optional of course, but of course very\n    # omnipresent generally, so we don't handle failure here.\n\n    # pylint: disable=I0021,no-name-in-module\n    from pip._vendor import pkg_resources\n\n    return lambda: pkg_resources.working_set\n\n\ndef _initPackageToDistributionName():\n    try:\n        if isExperimental(\"force-pkg-resources-metadata\"):\n            raise ImportError\n\n        try:\n            from importlib.metadata import distributions\n        except ImportError:\n            from importlib_metadata import distributions\n\n    except (ImportError, SyntaxError, RuntimeError):\n        try:\n            distributions = _get_pkg_resource_distributions()\n        except ImportError:\n            # No pip installed, not very many distributions in that case.\n            distributions = lambda: ()\n\n    # Cyclic dependency\n    result = {}\n\n    for distribution in distributions():\n        distribution_name = getDistributionName(distribution)\n\n        if distribution_name is None:\n            metadata_logger.warning(\n                \"\"\"\\\nError, failure to detect name of distribution '%s', path '%s', this \\\nis typically caused by corruption of its installation.\"\"\"\n                % (distribution, _getDistributionPath(distribution))\n            )\n            continue\n\n        assert isValidDistributionName(distribution_name), (\n            distribution,\n            distribution_name,\n            _getDistributionPath(distribution),\n        )\n\n        for package_name in getDistributionTopLevelPackageNames(distribution):\n            # Protect against buggy packages.\n            if not checkModuleName(package_name):\n                continue\n\n            package_name = ModuleName(package_name)\n\n            if package_name not in result:\n                result[package_name] = set()\n\n            # Skip duplicates, e.g. user package vs. site package installation.\n            if any(\n                distribution_name == getDistributionName(dist)\n                for dist in result[package_name]\n            ):\n                continue\n\n            result[package_name].add(distribution)\n\n    return result\n\n\ndef getDistributionsFromModuleName(module_name):\n    \"\"\"Get the distribution names associated with a module name.\n\n    This can be more than one in case of namespace modules.\n    \"\"\"\n\n    # Cached result, pylint: disable=global-statement\n\n    global _package_to_distribution\n    if _package_to_distribution is None:\n        _package_to_distribution = _initPackageToDistributionName()\n\n    module_name = ModuleName(module_name)\n    # Go upwards until we find something, such that contained module names are\n    # usable too.\n    while (\n        module_name not in _package_to_distribution\n        and module_name.getPackageName() is not None\n    ):\n        module_name = module_name.getPackageName()\n\n    return tuple(\n        sorted(\n            _package_to_distribution.get(module_name, ()),\n            key=getDistributionName,\n        )\n    )\n\n\ndef getDistributionFromModuleName(module_name):\n    \"\"\"Get the distribution name associated with a module name.\"\"\"\n    distributions = getDistributionsFromModuleName(module_name)\n\n    if not distributions:\n        return None\n    elif len(distributions) == 1:\n        return distributions[0]\n    else:\n        return min(distributions, key=lambda dist: len(getDistributionName(dist)))\n\n\ndef getDistribution(distribution_name):\n    \"\"\"Get a distribution by name.\"\"\"\n    assert isValidDistributionName(distribution_name), distribution_name\n\n    try:\n        if isExperimental(\"force-pkg-resources-metadata\"):\n            raise ImportError\n\n        if python_version >= 0x380:\n            from importlib import metadata\n        else:\n            import importlib_metadata as metadata\n    except ImportError:\n        from pip._vendor.pkg_resources import (\n            DistributionNotFound,\n            get_distribution,\n        )\n\n        try:\n            return get_distribution(distribution_name)\n        except DistributionNotFound:\n            return None\n    else:\n        try:\n            return metadata.distribution(distribution_name)\n        except metadata.PackageNotFoundError:\n            return None\n\n\n_distribution_to_installer = {}\n\n\ndef isDistributionCondaPackage(distribution_name):\n    if not isAnacondaPython():\n        return False\n\n    return getDistributionInstallerName(distribution_name) == \"conda\"\n\n\ndef isDistributionMsys2Package(distribution_name):\n    if not isAnacondaPython():\n        return False\n\n    return getDistributionInstallerName(distribution_name).startswith(\"MSYS2\")\n\n\ndef isDistributionPipPackage(distribution_name):\n    return getDistributionInstallerName(distribution_name) == \"pip\"\n\n\ndef isDistributionPoetryPackage(distribution_name):\n    return getDistributionInstallerName(distribution_name).startswith(\"poetry\")\n\n\ndef isDistributionSystemPackage(distribution_name):\n    return (\n        not isMacOS()\n        and not isWin32Windows()\n        and not isDistributionPipPackage(distribution_name)\n        and not isDistributionPoetryPackage(distribution_name)\n        and not isDistributionCondaPackage(distribution_name)\n    )\n\n\n_pdm_dir_cache = {}\n\n\ndef _getDistributionPath(distribution):\n    return getattr(distribution, \"_path\", None)\n\n\ndef isPdmPackageInstallation(distribution):\n    distribution_path = _getDistributionPath(distribution)\n    if distribution_path is None:\n        return False\n\n    site_packages_path = searchPrefixPath(str(distribution_path), \"site-packages\")\n    if site_packages_path is None:\n        return False\n\n    # spell-checker: ignore pyvenv\n    candidate = os.path.join(site_packages_path, \"..\", \"..\", \"pyvenv.cfg\")\n\n    result = _pdm_dir_cache.get(candidate)\n    if result is None:\n        _pdm_dir_cache[candidate] = os.path.exists(candidate)\n\n    return _pdm_dir_cache[candidate]\n\n\ndef getDistributionInstallerName(distribution_name):\n    \"\"\"Get the installer name from a distribution object.\n\n    We might care of pip, anaconda, Debian, or whatever installed a\n    package.\n    \"\"\"\n\n    # many cases due to fallback variants, pylint: disable=too-many-branches\n\n    if distribution_name not in _distribution_to_installer:\n        distribution = getDistribution(distribution_name)\n\n        if distribution is None:\n            if distribution_name == \"Pip\":\n                _distribution_to_installer[distribution_name] = \"default\"\n            else:\n                _distribution_to_installer[distribution_name] = \"not_found\"\n        else:\n            installer_name = _getDistributionMetadataFileContents(\n                distribution, \"INSTALLER\"\n            )\n\n            if installer_name:\n                _distribution_to_installer[distribution_name] = (\n                    installer_name.strip().lower()\n                )\n            elif isAnacondaPython():\n                _distribution_to_installer[distribution_name] = \"conda\"\n            elif isPdmPackageInstallation(distribution):\n                _distribution_to_installer[distribution_name] = \"pip\"\n            elif isMSYS2MingwPython():\n                _distribution_to_installer[distribution_name] = \"MSYS2 MinGW\"\n            elif isPosixWindows():\n                _distribution_to_installer[distribution_name] = \"MSYS2 Posix\"\n            else:\n                distribution_path = _getDistributionPath(distribution)\n                if distribution_path is not None:\n                    distribution_path_parts = str(distribution_path).split(\"/\")\n\n                    if (\n                        \"dist-packages\" in distribution_path_parts\n                        and \"local\" not in distribution_path_parts\n                    ):\n                        _distribution_to_installer[distribution_name] = \"Debian\"\n                    else:\n                        _distribution_to_installer[distribution_name] = \"Unknown\"\n                else:\n                    _distribution_to_installer[distribution_name] = \"Unknown\"\n\n    return _distribution_to_installer[distribution_name]\n\n\ndef isValidDistributionName(distribution_name):\n    return type(distribution_name) in (str, unicode)\n\n\ndef getDistributionName(distribution):\n    \"\"\"Get the distribution name from a distribution object.\n\n    We use importlib.metadata and pkg_resources version tuples interchangeable\n    and this is to abstract the difference is how to look up the name from\n    one.\n    \"\"\"\n\n    if hasattr(distribution, \"metadata\"):\n        result = distribution.metadata[\"Name\"]\n    else:\n        result = distribution.project_name\n\n    return result\n\n\ndef getDistributionVersion(distribution):\n    \"\"\"Get the distribution version string from a distribution object.\n\n    We use importlib.metadata and pkg_resources version tuples interchangeable\n    and this is to abstract the difference is how to look up the version from\n    one.\n    \"\"\"\n    # Avoiding use of public interface for pkg_resources, pylint: disable=protected-access\n    if hasattr(distribution, \"metadata\"):\n        return distribution.metadata[\"Version\"]\n    else:\n        return distribution._version\n\n\ndef getDistributionLicense(distribution):\n    \"\"\"Get the distribution license from a distribution object.\"\"\"\n\n    license_name = distribution.metadata[\"License\"]\n\n    if not license_name or license_name == \"UNKNOWN\":\n        for classifier in (\n            value\n            for (key, value) in distribution.metadata.items()\n            if \"Classifier\" in key\n        ):\n            parts = [part.strip() for part in classifier.split(\"::\")]\n            if not parts:\n                continue\n\n            if parts[0] == \"License\":\n                license_name = parts[-1]\n                break\n\n    return license_name\n\n\n# User site directory if any\n_user_site_directory = None\n\n\ndef setUserSiteDirectory(user_site_directory):\n    global _user_site_directory  # singleton, pylint: disable=global-statement\n    _user_site_directory = user_site_directory\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Download.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Download utilities and extract locally when allowed.\n\nMostly used on Windows, for dependency walker and ccache binaries.\n\"\"\"\n\nimport os\n\nfrom nuitka import Tracing\nfrom nuitka.__past__ import urlretrieve\nfrom nuitka.Progress import withNuitkaDownloadProgressBar\n\nfrom .AppDirs import getCacheDir\nfrom .FileOperations import (\n    addFileExecutablePermission,\n    deleteFile,\n    makePath,\n    queryUser,\n)\n\n\ndef getDownload(name, url, download_path):\n    # requests api, spell-checker: ignore reporthook\n\n    with withNuitkaDownloadProgressBar(desc=\"Download %s\" % name) as reporthook:\n        try:\n            try:\n                urlretrieve(url, download_path, reporthook=reporthook)\n            except Exception:  # Any kind of error, pylint: disable=broad-except\n                urlretrieve(\n                    url.replace(\"https://\", \"http://\"),\n                    download_path,\n                    reporthook=reporthook,\n                )\n        except KeyboardInterrupt:\n            deleteFile(download_path, must_exist=False)\n\n            raise\n\n\ndef getDownloadCacheName():\n    return \"downloads\"\n\n\ndef getDownloadCacheDir():\n    return getCacheDir(getDownloadCacheName())\n\n\ndef getCachedDownload(\n    name,\n    url,\n    binary,\n    flatten,\n    is_arch_specific,\n    specificity,\n    message,\n    reject,\n    assume_yes_for_downloads,\n):\n    # Many branches to deal with.\n    # pylint: disable=too-many-branches,too-many-locals\n\n    nuitka_download_dir = getDownloadCacheDir()\n\n    nuitka_download_dir = os.path.join(\n        nuitka_download_dir, os.path.basename(binary).replace(\".exe\", \"\")\n    )\n\n    if is_arch_specific:\n        nuitka_download_dir = os.path.join(nuitka_download_dir, is_arch_specific)\n\n    if specificity:\n        nuitka_download_dir = os.path.join(nuitka_download_dir, specificity)\n\n    download_path = os.path.join(nuitka_download_dir, os.path.basename(url))\n    exe_path = os.path.join(nuitka_download_dir, binary)\n\n    makePath(nuitka_download_dir)\n\n    if not os.path.isfile(download_path) and not os.path.isfile(exe_path):\n        if assume_yes_for_downloads:\n            reply = \"yes\"\n        else:\n            reply = queryUser(\n                question=\"\"\"\\\n%s\n\nIs it OK to download and put it in '%s'.\n\nFully automatic, cached. Proceed and download\"\"\"\n                % (message, nuitka_download_dir),\n                choices=(\"yes\", \"no\"),\n                default=\"yes\",\n                default_non_interactive=\"no\",\n            )\n\n        if reply != \"yes\":\n            if reject is not None:\n                Tracing.general.sysexit(reject)\n        else:\n            Tracing.general.info(\"Downloading '%s'.\" % url)\n\n            try:\n                getDownload(\n                    name=name,\n                    url=url,\n                    download_path=download_path,\n                )\n            except Exception as e:  # Any kind of error, pylint: disable=broad-except\n                Tracing.general.sysexit(\n                    \"Failed to download '%s' due to '%s'. Contents should manually be copied to '%s'.\"\n                    % (url, e, download_path)\n                )\n\n    if not os.path.isfile(exe_path) and os.path.isfile(download_path):\n        Tracing.general.info(\"Extracting to '%s'\" % exe_path)\n\n        import zipfile\n\n        try:\n            # Not all Python versions support using it as a context manager, pylint: disable=consider-using-with\n            zip_file = zipfile.ZipFile(download_path)\n\n            for zip_info in zip_file.infolist():\n                if zip_info.filename[-1] == \"/\":\n                    continue\n\n                if flatten:\n                    zip_info.filename = os.path.basename(zip_info.filename)\n\n                zip_file.extract(zip_info, nuitka_download_dir)\n\n        except Exception:  # Catching anything zip throws, pylint: disable=broad-except\n            Tracing.general.info(\"Problem with the downloaded zip file, deleting it.\")\n\n            deleteFile(binary, must_exist=False)\n            deleteFile(download_path, must_exist=True)\n\n            Tracing.general.sysexit(\n                \"Error, need '%s' as extracted from '%s'.\" % (binary, url)\n            )\n\n    # Check success here, and make sure it's executable.\n    if os.path.isfile(exe_path):\n        addFileExecutablePermission(exe_path)\n    else:\n        if reject:\n            Tracing.general.sysexit(reject)\n\n        exe_path = None\n\n    return exe_path\n\n\ndef getCachedDownloadedMinGW64(target_arch, assume_yes_for_downloads):\n    # Large URLs, pylint: disable=line-too-long\n\n    if target_arch == \"x86_64\":\n        url = \"https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.1-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt-11.0.1-r1.zip\"\n        binary = r\"mingw64\\bin\\gcc.exe\"\n    elif target_arch == \"x86\":\n        url = \"https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.1-msvcrt-r1/winlibs-i686-posix-dwarf-gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt-11.0.1-r1.zip\"\n        binary = r\"mingw32\\bin\\gcc.exe\"\n    elif target_arch == \"arm64\":\n        url = None\n    else:\n        assert False, target_arch\n\n    if url is None:\n        return None\n\n    gcc_binary = getCachedDownload(\n        name=\"mingw64\",\n        url=url,\n        is_arch_specific=target_arch,\n        specificity=url.rsplit(\"/\", 2)[1],\n        binary=binary,\n        flatten=False,\n        message=\"Nuitka will use gcc from MinGW64 of winlibs to compile on Windows.\",\n        reject=\"Only this specific gcc is supported with Nuitka.\",\n        assume_yes_for_downloads=assume_yes_for_downloads,\n    )\n\n    return gcc_binary\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Execution.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Program execution related stuff.\n\nBasically a layer for os, subprocess, shutil to come together. It can find\nbinaries (needed for exec) and run them capturing outputs.\n\"\"\"\n\nimport os\nfrom contextlib import contextmanager\n\nfrom nuitka.__past__ import subprocess\nfrom nuitka.Tracing import general\n\nfrom .Download import getCachedDownloadedMinGW64\nfrom .FileOperations import getExternalUsePath\nfrom .Utils import getArchitecture, isWin32OrPosixWindows, isWin32Windows\n\n# Cache, so we avoid repeated command lookups.\n_executable_command_cache = {}\n\n# We emulate and use APIs of stdlib, spell-checker: ignore popenargs,creationflags,preexec_fn,setsid\n\n\ndef _getExecutablePath(filename, search_path):\n    # Append \".exe\" suffix  on Windows if not already present.\n    if isWin32OrPosixWindows() and not filename.lower().endswith((\".exe\", \".cmd\")):\n        filename += \".exe\"\n\n    # Now check in each path element, much like the shell will.\n    path_elements = search_path.split(os.pathsep)\n\n    for path_element in path_elements:\n        path_element = path_element.strip('\"')\n        path_element = os.path.expanduser(path_element)\n\n        candidate = None\n\n        if os.path.isfile(path_element):\n            if os.path.normcase(os.path.basename(path_element)) == os.path.normcase(\n                filename\n            ):\n                candidate = path_element\n        else:\n            full = os.path.join(path_element, filename)\n\n            if os.path.exists(full):\n                candidate = full\n\n        if candidate is not None:\n            if os.access(candidate, os.X_OK):\n                return candidate\n\n\ndef getExecutablePath(filename, extra_dir=None):\n    \"\"\"Find an execute in PATH environment.\"\"\"\n\n    # Search in PATH environment.\n    search_path = os.getenv(\"PATH\", \"\")\n\n    if extra_dir is not None:\n        search_path = extra_dir + os.pathsep + search_path\n\n    key = (filename, search_path)\n    if key not in _executable_command_cache:\n        _executable_command_cache[key] = _getExecutablePath(filename, search_path)\n\n    return _executable_command_cache[key]\n\n\ndef isExecutableCommand(command):\n    return getExecutablePath(command) is not None\n\n\nclass NuitkaCalledProcessError(subprocess.CalledProcessError):\n    def __init__(self, exit_code, cmd, output, stderr):\n        # False alarm, pylint: disable=super-init-not-called\n\n        subprocess.CalledProcessError(self, exit_code, cmd)\n\n        # Python2 doesn't have this otherwise, but needs it.\n        self.stderr = stderr\n        self.output = output\n        self.cmd = cmd\n        self.returncode = exit_code\n\n    def __str__(self):\n        result = subprocess.CalledProcessError.__str__(self)\n\n        if self.output:\n            result += \" Output was %r.\" % self.output.strip()\n\n        if self.stderr:\n            result += \" Error was %r.\" % self.stderr.strip()\n\n        return result\n\n\ndef check_output(*popenargs, **kwargs):\n    \"\"\"Call a process and check result code.\n\n    This is for Python 2.6 compatibility, which doesn't have that in its\n    standard library.\n\n    Note: We use same name as in Python stdlib, violating our rules to\n    make it more recognizable what this does.\n    \"\"\"\n    logger = kwargs.pop(\"logger\", None)\n\n    if logger is not None:\n        logger.info(\"Executing command '%s'.\" % popenargs[0], keep_format=True)\n\n    if \"stdout\" in kwargs:\n        raise ValueError(\"stdout argument not allowed, it will be overridden.\")\n\n    if \"stderr\" not in kwargs:\n        kwargs[\"stderr\"] = subprocess.PIPE\n\n    process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)\n\n    output, stderr = process.communicate()\n    exit_code = process.poll()\n\n    if exit_code:\n        cmd = kwargs.get(\"args\")\n        if cmd is None:\n            cmd = popenargs[0]\n\n        raise NuitkaCalledProcessError(exit_code, cmd, output=output, stderr=stderr)\n\n    return output\n\n\ndef check_call(*popenargs, **kwargs):\n    \"\"\"Call a process and check result code.\n\n    Note: This catches the error, and makes it nicer, and an error\n    exit. So this is for tooling only.\n\n    Note: We use same name as in Python stdlib, violating our rules to\n    make it more recognizable what this does.\n    \"\"\"\n    logger = kwargs.pop(\"logger\", None)\n\n    if logger is not None:\n        logger.info(\"Executing command '%s'.\" % popenargs[0], keep_format=True)\n\n    try:\n        subprocess.check_call(*popenargs, **kwargs)\n    except OSError:\n        general.sysexit(\n            \"Error, failed to execute '%s'. Is it installed?\" % popenargs[0]\n        )\n\n\ndef callProcess(*popenargs, **kwargs):\n    \"\"\"Call a process and return result code.\"\"\"\n    logger = kwargs.pop(\"logger\", None)\n\n    if logger is not None:\n        logger.info(\"Executing command '%s'.\" % popenargs[0], keep_format=True)\n\n    return subprocess.call(*popenargs, **kwargs)\n\n\n@contextmanager\ndef withEnvironmentPathAdded(env_var_name, *paths, **kw):\n    # Workaround star args with keyword args on older Python\n    prefix = kw.pop(\"prefix\", False)\n    assert not kw, kw\n\n    assert os.path.sep not in env_var_name\n\n    paths = [path for path in paths if path]\n    path = os.pathsep.join(paths)\n\n    if path:\n        if str is not bytes and type(path) is bytes:\n            path = path.decode(\"utf8\")\n\n        if env_var_name in os.environ:\n            old_path = os.environ[env_var_name]\n\n            if not old_path:\n                os.environ[env_var_name] = path\n            elif prefix:\n                os.environ[env_var_name] = path + os.pathsep + os.environ[env_var_name]\n            else:\n                os.environ[env_var_name] += os.pathsep + path\n        else:\n            old_path = None\n            os.environ[env_var_name] = path\n\n    yield\n\n    if path:\n        if old_path is None:\n            del os.environ[env_var_name]\n        else:\n            os.environ[env_var_name] = old_path\n\n\n@contextmanager\ndef withEnvironmentVarOverridden(env_var_name, value):\n    \"\"\"Change an environment and restore it after context.\"\"\"\n\n    if env_var_name in os.environ:\n        old_value = os.environ[env_var_name]\n    else:\n        old_value = None\n\n    if value is not None:\n        os.environ[env_var_name] = value\n    elif old_value is not None:\n        del os.environ[env_var_name]\n\n    yield\n\n    if old_value is None:\n        if value is not None:\n            del os.environ[env_var_name]\n    else:\n        os.environ[env_var_name] = old_value\n\n\n@contextmanager\ndef withEnvironmentVarsOverridden(mapping):\n    \"\"\"Change multiple environment variables and restore them after context.\"\"\"\n\n    if mapping is None:\n        mapping = {}\n\n    old_values = {}\n\n    for env_var_name, value in mapping.items():\n        if env_var_name in os.environ:\n            old_values[env_var_name] = os.environ[env_var_name]\n        else:\n            old_values[env_var_name] = None\n\n        if value is not None:\n            os.environ[env_var_name] = value\n        elif old_values[env_var_name] is not None:\n            del os.environ[env_var_name]\n\n    yield\n\n    for env_var_name, value in mapping.items():\n        if old_values[env_var_name] is None:\n            if value is not None:\n                del os.environ[env_var_name]\n        else:\n            os.environ[env_var_name] = old_values[env_var_name]\n\n\ndef wrapCommandForDebuggerForExec(*args):\n    \"\"\"Wrap a command for system debugger to call exec\n\n    Args:\n        args: (list of str) args for call to be debugged\n    Returns:\n        args tuple with debugger command inserted\n\n    Notes:\n        Currently only gdb and lldb are supported, but adding more\n        debuggers would be very welcome.\n    \"\"\"\n\n    gdb_path = getExecutablePath(\"gdb\")\n    lldb_path = None\n\n    # Windows extra ball, attempt the downloaded one.\n    if isWin32Windows() and gdb_path is None:\n        from nuitka.Options import assumeYesForDownloads\n\n        mingw64_gcc_path = getCachedDownloadedMinGW64(\n            target_arch=getArchitecture(),\n            assume_yes_for_downloads=assumeYesForDownloads(),\n        )\n\n        with withEnvironmentPathAdded(\"PATH\", os.path.dirname(mingw64_gcc_path)):\n            lldb_path = getExecutablePath(\"lldb\")\n\n    if gdb_path is None and lldb_path is None:\n        lldb_path = getExecutablePath(\"lldb\")\n\n        if lldb_path is None:\n            general.sysexit(\"Error, no 'gdb' or 'lldb' binary found in path.\")\n\n    if gdb_path is not None:\n        args = (gdb_path, \"gdb\", \"-ex=run\", \"-ex=where\", \"-ex=quit\", \"--args\") + args\n    else:\n        args = (lldb_path, \"lldb\", \"-o\", \"run\", \"-o\", \"bt\", \"-o\", \"quit\", \"--\") + args\n\n    return args\n\n\ndef wrapCommandForDebuggerForSubprocess(*args):\n    \"\"\"Wrap a command for system debugger with subprocess module.\n\n    Args:\n        args: (list of str) args for call to be debugged\n    Returns:\n        args tuple with debugger command inserted\n\n    Notes:\n        Currently only gdb and lldb are supported, but adding more\n        debuggers would be very welcome.\n    \"\"\"\n\n    args = wrapCommandForDebuggerForExec(*args)\n\n    # Discard exec only argument.\n    args = args[0:1] + args[2:]\n\n    return args\n\n\ndef getNullOutput():\n    try:\n        return subprocess.NULLDEV\n    except AttributeError:\n        return open(os.devnull, \"wb\")\n\n\ndef getNullInput():\n    # spell-checker: ignore NULLDEV\n    try:\n        return subprocess.NULLDEV\n    except AttributeError:\n        # File is supposed to stay open, pylint: disable=consider-using-with\n        subprocess.NULLDEV = open(os.devnull, \"rb\")\n        return subprocess.NULLDEV\n\n\ndef executeToolChecked(\n    logger, command, absence_message, stderr_filter=None, optional=False\n):\n    \"\"\"Execute external tool, checking for success and no error outputs, returning result.\"\"\"\n\n    command = list(command)\n    tool = command[0]\n\n    if not isExecutableCommand(tool):\n        if optional:\n            logger.warning(absence_message)\n            return \"\"\n        else:\n            logger.sysexit(absence_message)\n\n    # Allow to avoid repeated scans in PATH for the tool.\n    command[0] = getExecutablePath(tool)\n\n    process = subprocess.Popen(\n        command,\n        stdin=getNullInput(),\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        shell=False,\n    )\n\n    stdout, stderr = process.communicate()\n    result = process.poll()\n\n    if stderr_filter is not None:\n        new_result, stderr = stderr_filter(stderr)\n\n        if new_result is not None:\n            result = new_result\n\n    if result != 0:\n        logger.sysexit(\n            \"Error, call to '%s' failed: %s -> %s.\" % (tool, command, stderr)\n        )\n    elif stderr:\n        logger.sysexit(\n            \"Error, call to '%s' gave warnings: %s -> %s.\" % (tool, command, stderr)\n        )\n\n    return stdout\n\n\ndef createProcess(\n    command,\n    env=None,\n    stdin=False,\n    stdout=None,\n    stderr=None,\n    shell=False,\n    external_cwd=False,\n    new_group=False,\n):\n    if not env:\n        env = os.environ\n\n    kw_args = {}\n    if new_group:\n        if isWin32Windows():\n            kw_args[\"creationflags\"] = subprocess.CREATE_NEW_PROCESS_GROUP\n        else:\n            kw_args[\"preexec_fn\"] = os.setsid\n\n    process = subprocess.Popen(\n        command,\n        # Note: Empty string should also be allowed for stdin, therefore check\n        # for default \"False\" and \"None\" precisely.\n        stdin=subprocess.PIPE if stdin not in (False, None) else getNullInput(),\n        stdout=subprocess.PIPE if stdout is None else stdout,\n        stderr=subprocess.PIPE if stderr is None else stderr,\n        shell=shell,\n        # On Windows, closing file descriptions is not working with capturing outputs.\n        close_fds=not isWin32Windows(),\n        env=env,\n        # For tools that want short paths to work.\n        cwd=getExternalUsePath(os.getcwd()) if external_cwd else None,\n        **kw_args\n    )\n\n    return process\n\n\ndef executeProcess(\n    command, env=None, stdin=False, shell=False, external_cwd=False, timeout=None\n):\n    process = createProcess(\n        command=command, env=env, stdin=stdin, shell=shell, external_cwd=external_cwd\n    )\n\n    if stdin is True:\n        process_input = None\n    elif stdin is not False:\n        process_input = stdin\n    else:\n        process_input = None\n\n    kw_args = {}\n    if timeout is not None:\n        # Apply timeout if possible.\n        if \"timeout\" in subprocess.Popen.communicate.__code__.co_varnames:\n            kw_args[\"timeout\"] = timeout\n\n    stdout, stderr = process.communicate(input=process_input)\n    exit_code = process.wait()\n\n    return stdout, stderr, exit_code\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/FileOperations.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Utils for file and directory operations.\n\nThis provides enhanced and more error resilient forms of standard\nstuff. It will also frequently add sorting for determinism.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport errno\nimport fnmatch\nimport glob\nimport os\nimport pickle\nimport shutil\nimport stat\nimport sys\nimport tempfile\nimport time\nimport unicodedata\nfrom contextlib import contextmanager\n\nfrom nuitka.__past__ import (  # pylint: disable=redefined-builtin\n    FileNotFoundError,\n    PermissionError,\n    basestring,\n    raw_input,\n    unicode,\n)\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import (\n    flushStandardOutputs,\n    general,\n    my_print,\n    options_logger,\n    printLine,\n)\n\nfrom .Importing import importFromInlineCopy\nfrom .ThreadedExecutor import RLock, getThreadIdent\nfrom .Utils import (\n    isLinux,\n    isMacOS,\n    isWin32OrPosixWindows,\n    isWin32Windows,\n    raiseWindowsError,\n)\n\n# Locking seems to be only required for Windows mostly, but we can keep\n# it for all.\nfile_lock = RLock()\n\n# Use this in case of dead locks or even to see file operations being done.\n_lock_tracing = False\n\n\n@contextmanager\ndef withFileLock(reason=\"unknown\"):\n    \"\"\"Acquire file handling lock.\n\n    Args:\n        reason: What is being done.\n\n    Notes: This is most relevant for Windows, but prevents concurrent access\n    from threads generally, which could lead to observing half ready things.\n    \"\"\"\n\n    if _lock_tracing:\n        my_print(getThreadIdent(), \"Want file lock for %s\" % reason)\n    file_lock.acquire()\n    if _lock_tracing:\n        my_print(getThreadIdent(), \"Acquired file lock for %s\" % reason)\n    yield\n    if _lock_tracing:\n        my_print(getThreadIdent(), \"Released file lock for %s\" % reason)\n    file_lock.release()\n\n\ndef areSamePaths(path1, path2):\n    \"\"\"Decide if two paths the same.\n\n    Args:\n        path1: First path\n        path2: Second path\n\n    Returns:\n        Boolean value indicating if the two paths point to the\n        same path.\n\n    Notes:\n\n        Case differences ignored on platforms where that is the\n        norm, and with it normalized, and turned absolute paths, and\n        even short paths, it then becomes a mere string compare after that.\n    \"\"\"\n\n    path1 = os.path.abspath(os.path.normpath(path1))\n    path2 = os.path.abspath(os.path.normpath(path2))\n\n    if os.path.exists(path1) and os.path.exists(path2):\n        path1 = getExternalUsePath(path1)\n        path2 = getExternalUsePath(path2)\n\n    path1 = os.path.normcase(path1)\n    path2 = os.path.normcase(path2)\n\n    return path1 == path2\n\n\ndef areInSamePaths(path1, path2):\n    \"\"\"Decide if two paths are in the same directory\n\n    Args:\n        path1: First path\n        path2: Second path\n\n    Returns:\n        Boolean value indicating if the two paths point into the\n        same directory.\"\"\"\n    return areSamePaths(os.path.dirname(path1), os.path.dirname(path2))\n\n\ndef haveSameFileContents(path1, path2):\n    # Local import, to avoid this for normal use cases.\n    import filecmp\n\n    return filecmp.cmp(path1, path2)\n\n\ndef getFileSize(path):\n    return os.path.getsize(path)\n\n\ndef relpath(path, start=\".\"):\n    \"\"\"Make it a relative path, if possible.\n\n    Args:\n        path: path to work on\n        start: where to start from, defaults to current directory\n\n    Returns:\n        Changed path, pointing to the same path relative to current\n        directory if possible.\n\n    Notes:\n        On Windows, a relative path is not possible across device\n        names, therefore it may have to return the absolute path\n        instead.\n    \"\"\"\n    if start == \".\":\n        start = os.curdir\n\n    try:\n        return os.path.relpath(path, start)\n    except ValueError:\n        # On Windows, paths on different devices prevent it to work. Use that\n        # full path then.\n        if isWin32OrPosixWindows():\n            return os.path.abspath(path)\n        raise\n\n\ndef isRelativePath(path):\n    if os.path.isabs(path):\n        return False\n    if path.startswith((\"..\" + os.path.sep, \"../\")):\n        return False\n\n    return True\n\n\ndef makePath(path):\n    \"\"\"Create a directory if it doesn't exist.\n\n    Args:\n        path: path to create as a directory\n\n    Notes:\n        This also is thread safe on Windows, i.e. no race is\n        possible.\n\n    \"\"\"\n\n    with withFileLock(\"creating directory %s\" % path):\n        if not os.path.isdir(path):\n            os.makedirs(path)\n\n\ndef makeContainingPath(filename):\n    target_dir = os.path.dirname(filename)\n\n    if not os.path.isdir(target_dir):\n        makePath(target_dir)\n\n\ndef isPathExecutable(path):\n    \"\"\"Is the given path executable.\"\"\"\n    return os.path.isfile(path) and os.access(path, os.X_OK)\n\n\n# Make sure we don't repeat this too much.\n_real_path_windows_cache = {}\n_powershell_path = None\n\n\ndef _getRealPathWindows(path):\n    # Slow on Python2, because we are using an external process.\n    # Singleton, pylint: disable=global-statement\n    global _powershell_path\n    if _powershell_path is None:\n        from .Execution import getExecutablePath\n\n        _powershell_path = getExecutablePath(\"powershell\")\n\n        # Try to find it only once, otherwise ignore its absence, symlinks are not\n        # that important.\n        if _powershell_path is None:\n            _powershell_path = False\n\n    if path not in _real_path_windows_cache:\n        if _powershell_path:\n            from .Execution import check_output\n\n            result = check_output(\n                [\n                    _powershell_path,\n                    \"-NoProfile\",\n                    'Get-Item \"%s\" | Select-Object -ExpandProperty Target' % path,\n                ],\n                shell=False,\n            )\n\n            if str is not bytes:\n                result = result.decode(\"utf8\")\n\n            if result.startswith(\"UNC\\\\\"):\n                # Avoid network mounts being converted to UNC shared paths by newer\n                # Python versions, many tools won't work with those.\n                _real_path_windows_cache[path] = path\n            else:\n                _real_path_windows_cache[path] = os.path.join(\n                    os.path.dirname(path), result.rstrip(\"\\r\\n\")\n                )\n        else:\n            _real_path_windows_cache[path] = path\n\n    return _real_path_windows_cache[path]\n\n\ndef getDirectoryRealPath(path):\n    \"\"\"Get os.path.realpath with Python2 and Windows symlink workaround applied.\n\n    Args:\n        path: path to get realpath of\n\n    Returns:\n        path with symlinks resolved\n\n    Notes:\n        Workaround for Windows symlink is applied. This function is not recursive\n        at all with older Python, i.e. only the last part, the directory itself\n        is being resolved there.\n\n    \"\"\"\n    path = os.path.realpath(path)\n\n    # Attempt to resolve Windows symlinks older Python\n    if os.name == \"nt\":\n        if os.path.islink(path) or (not os.path.isdir(path) and os.path.exists(path)):\n            path = _getRealPathWindows(path)\n\n    return path\n\n\ndef _restoreWindowsPath(orig_path, path):\n    if path.startswith(\"\\\\\\\\\"):\n        drive, _remaining_path = os.path.splitdrive(orig_path)\n\n        if drive and not drive.startswith(\"\\\\\\\\\"):\n            drive_real_path = os.path.realpath(drive + \"\\\\\")\n            assert path.startswith(drive_real_path)\n\n            path = drive + path[len(drive_real_path) :]\n    else:\n        path = path.strip(os.path.sep)\n\n        if os.path.sep in path:\n            dirname = os.path.dirname(path)\n            filename = os.path.basename(path)\n\n            if dirname:\n                dirname = getDirectoryRealPath(dirname)\n\n                # Drive letters do not get slashes from \"os.path.join\", so\n                # we inject this here and normalize the path afterwards to\n                # remove any duplication added.\n                if os.path.sep not in dirname:\n                    dirname = dirname + os.path.sep\n\n                path = os.path.normpath(os.path.join(dirname, filename))\n\n    return path\n\n\ndef getFilenameRealPath(path):\n    \"\"\"Get os.path.realpath with Python2 and Windows symlink workaround applied.\n\n    Args:\n        path: path to get realpath of\n\n    Returns:\n        path with symlinks resolved\n\n    Notes:\n        Workaround for Windows symlinks are applied, this works recursive and\n        assumes that the path given itself is a file and not a directory, and\n        doesn't handle file symlinks at the end on older Python currently, but\n        we shouldn't deal with those.\n    \"\"\"\n    orig_path = path\n    path = os.path.realpath(path)\n\n    # Avoid network mounts being converted to UNC shared paths by newer\n    # Python versions, many tools won't work with those.\n    if os.name == \"nt\":\n        path = _restoreWindowsPath(orig_path=orig_path, path=path)\n\n    return path\n\n\ndef listDir(path):\n    \"\"\"Give a sorted listing of a path.\n\n    Args:\n        path: directory to create a listing from\n\n    Returns:\n        Sorted list of tuples of full filename, and basename of\n        files in that directory.\n\n    Notes:\n        Typically the full name and the basename are both needed\n        so this function simply does both, for ease of use on the\n        calling side.\n\n        This should be used, because it makes sure to resolve the\n        symlinks to directories on Windows, that a naive \"os.listdir\"\n        won't do by default.\n    \"\"\"\n    real_path = getDirectoryRealPath(path)\n\n    # The \"os.listdir\" output needs to be unicode paths, or else it can be unusable\n    # for Python2 on Windows at least. We try to go back on the result.\n    if str is bytes and type(real_path) is str:\n        real_path = unicode(real_path)\n\n    def _tryDecodeToStr(value):\n        if str is bytes:\n            if type(value) is unicode:\n                # File system paths, that should be usable for names of modules,\n                # as Python2 code objects will e.g. hate unicode values.\n\n                # spell-checker: ignore getfilesystemencoding\n                try:\n                    return value.decode(sys.getfilesystemencoding())\n                except UnicodeDecodeError:\n                    return value\n        else:\n            return value\n\n    return sorted(\n        (_tryDecodeToStr(os.path.join(path, filename)), _tryDecodeToStr(filename))\n        for filename in os.listdir(real_path)\n    )\n\n\ndef getFileList(\n    path,\n    ignore_dirs=(),\n    ignore_filenames=(),\n    ignore_suffixes=(),\n    only_suffixes=(),\n    normalize=True,\n):\n    \"\"\"Get all files below a given path.\n\n    Args:\n        path: directory to create a recursive listing from\n        ignore_dirs: Don't descend into these directory, ignore them\n        ignore_filenames: Ignore files named exactly like this\n        ignore_suffixes: Don't return files with these suffixes\n        only_suffixes: If not empty, limit returned files to these suffixes\n\n    Returns:\n        Sorted list of all filenames below that directory,\n        include the path given.\n\n    Notes:\n        This function descends into directories, but does\n        not follow symlinks.\n    \"\"\"\n    # We work with a lot of details here\n    result = []\n\n    # Normalize \"ignore_dirs\" for better matching.\n    ignore_dirs = [os.path.normcase(ignore_dir) for ignore_dir in ignore_dirs]\n    ignore_filenames = [\n        os.path.normcase(ignore_filename) for ignore_filename in ignore_filenames\n    ]\n\n    for root, dirnames, filenames in os.walk(path):\n        dirnames.sort()\n        filenames.sort()\n\n        # Normalize dirnames for better matching.\n        dirnames_normalized = [os.path.normcase(dirname) for dirname in dirnames]\n        for ignore_dir in ignore_dirs:\n            if ignore_dir in dirnames_normalized:\n                dirnames.remove(ignore_dir)\n\n        # Compare to normalized filenames for better matching.\n        filenames = [\n            filename\n            for filename in filenames\n            if os.path.normcase(filename) not in ignore_filenames\n        ]\n\n        for filename in filenames:\n            if os.path.normcase(filename).endswith(ignore_suffixes):\n                continue\n\n            if only_suffixes and not os.path.normcase(filename).endswith(only_suffixes):\n                continue\n\n            fullname = os.path.join(root, filename)\n\n            if normalize:\n                fullname = os.path.normpath(fullname)\n\n            result.append(fullname)\n\n    return result\n\n\ndef getSubDirectories(path, ignore_dirs=()):\n    \"\"\"Get all directories below a given path.\n\n    Args:\n        path: directory to create a recursive listing from\n        ignore_dirs: directories named that like will be ignored\n\n    Returns:\n        Sorted list of all directories below that directory,\n        relative to it.\n\n    Notes:\n        This function descends into directories, but does\n        not follow symlinks.\n    \"\"\"\n\n    result = []\n\n    ignore_dirs = [os.path.normcase(ignore_dir) for ignore_dir in ignore_dirs]\n\n    for root, dirnames, _filenames in os.walk(path):\n        # Normalize dirnames for better matching.\n        dirnames_normalized = [os.path.normcase(dirname) for dirname in dirnames]\n        for ignore_dir in ignore_dirs:\n            if ignore_dir in dirnames_normalized:\n                dirnames.remove(ignore_dir)\n\n        dirnames.sort()\n\n        for dirname in dirnames:\n            result.append(os.path.join(root, dirname))\n\n    result.sort()\n    return result\n\n\ndef getDllBasename(path):\n    compare_path = os.path.normcase(path)\n\n    for suffix in (\".dll\", \".so\", \".dylib\"):\n        if compare_path.endswith(suffix):\n            return path[: -len(suffix)]\n\n    # Linux us not case sensitive, but lets still do it properly,\n    # sometimes, it is done on non-Linux too. So we split on the\n    # normcase, but only to find out what is going on there.\n    if \".so.\" in compare_path:\n        return path[: len(compare_path.split(\".so.\")[0])]\n\n    return None\n\n\ndef listDllFilesFromDirectory(path, prefix=None, suffixes=None):\n    \"\"\"Give a sorted listing of DLLs filenames in a path.\n\n    Args:\n        path: directory to create a DLL listing from\n        prefix: shell pattern to match filename start against, can be None\n        suffixes: shell patch to match filename end against, defaults to all platform ones\n\n    Returns:\n        Sorted list of tuples of full filename, and basename of\n        DLLs in that directory.\n\n    Notes:\n        Typically the full name and the basename are both needed\n        so this function simply does both, for ease of use on the\n        calling side.\n    \"\"\"\n\n    # Accept None value as well.\n    prefix = prefix or \"\"\n\n    suffixes = suffixes or (\"dll\", \"so.*\", \"so\", \"dylib\")\n\n    pattern_list = [prefix + \"*.\" + suffix for suffix in suffixes]\n\n    for fullpath, filename in listDir(path):\n        for pattern in pattern_list:\n            if fnmatch.fnmatch(filename, pattern):\n                yield fullpath, filename\n                break\n\n\ndef listExeFilesFromDirectory(path, prefix=None, suffixes=None):\n    \"\"\"Give a sorted listing of EXE filenames in a path.\n\n    Args:\n        path: directory to create a DLL listing from\n        prefix: shell pattern to match filename start against, can be None\n        suffixes: shell patch to match filename end against, can be None\n\n    Returns:\n        Sorted list of tuples of full filename, and basename of\n        DLLs in that directory.\n\n    Notes:\n        Typically the full name and the basename are both needed\n        so this function simply does both, for ease of use on the\n        calling side.\n    \"\"\"\n\n    # Accept None value as well.\n    prefix = prefix or \"\"\n\n    # On Windows, we check exe suffixes, on other platforms we shell all filenames,\n    # matching the prefix, but they have to the executable bit set.\n    if suffixes is None and isWin32OrPosixWindows():\n        suffixes = \"exe\", \"bin\"\n\n    if suffixes:\n        pattern_list = [prefix + \"*.\" + suffix for suffix in suffixes]\n    else:\n        pattern_list = [prefix + \"*\"]\n\n    for fullpath, filename in listDir(path):\n        for pattern in pattern_list:\n            if fnmatch.fnmatch(filename, pattern):\n                if not isWin32OrPosixWindows() and not os.access(fullpath, os.X_OK):\n                    continue\n\n                yield fullpath, filename\n                break\n\n\ndef getSubDirectoriesWithDlls(path):\n    \"\"\"Get all directories below a given path.\n\n    Args:\n        path: directory to create a recursive listing from\n\n    Returns:\n        Sorted tuple of all directories below that directory,\n        relative to it, that contain DLL files.\n\n    Notes:\n        This function descends into directories, but does\n        not follow symlinks.\n    \"\"\"\n\n    result = set()\n\n    for dll_sub_directory in _getSubDirectoriesWithDlls(path):\n        result.add(dll_sub_directory)\n\n    return tuple(sorted(result))\n\n\ndef _getSubDirectoriesWithDlls(path):\n    for sub_directory in getSubDirectories(path=path, ignore_dirs=(\"__pycache__\",)):\n        if any(listDllFilesFromDirectory(sub_directory)) or _isMacOSFramework(\n            sub_directory\n        ):\n            yield sub_directory\n\n            candidate = os.path.dirname(sub_directory)\n\n            # Should be string identical, no normalization in is done in \"getSubDirectories\"\n            while candidate != path:\n                yield candidate\n                candidate = os.path.dirname(candidate)\n\n\ndef _isMacOSFramework(path):\n    \"\"\"Decide if a folder is a framework folder.\"\"\"\n    return isMacOS() and os.path.isdir(path) and path.endswith(\".framework\")\n\n\ndef isLink(path):\n    result = os.path.islink(path)\n\n    # Special handling for Junctions.\n    if not result and isWin32Windows():\n        import ctypes.wintypes\n\n        GetFileAttributesW = ctypes.windll.kernel32.GetFileAttributesW\n        GetFileAttributesW.restype = ctypes.wintypes.DWORD\n        GetFileAttributesW.argtypes = (ctypes.wintypes.LPCWSTR,)\n\n        INVALID_FILE_ATTRIBUTES = 0xFFFFFFFF\n        FILE_ATTRIBUTE_REPARSE_POINT = 0x00400\n\n        result = GetFileAttributesW(path)\n\n        if result != INVALID_FILE_ATTRIBUTES:\n            result = bool(result & FILE_ATTRIBUTE_REPARSE_POINT)\n\n    return result\n\n\ndef deleteFile(path, must_exist):\n    \"\"\"Delete a file, potentially making sure it exists.\n\n    Args:\n        path: file to delete\n\n    Notes:\n        This also is thread safe on Windows, i.e. no race is\n        possible.\n    \"\"\"\n    with withFileLock(\"deleting file %s\" % path):\n        if isLink(path) or os.path.isfile(path):\n            try:\n                os.unlink(path)\n            except OSError:\n                if must_exist:\n                    raise\n        elif must_exist:\n            raise OSError(\"Does not exist\", path)\n\n\ndef searchPrefixPath(path, element):\n    \"\"\"Search element and return prefix in path, if any.\"\"\"\n\n    while path:\n        if os.path.normcase(os.path.basename(path)) == os.path.normcase(element):\n            return path\n\n        new_path = os.path.dirname(path)\n        if new_path == path:\n            break\n        path = new_path\n\n    return None\n\n\ndef getFilenameExtension(path):\n    \"\"\"Get the filename extension (dot included)\n\n    Note: The extension is case normalized, i.e. it may actually be \".TXT\"\n    rather than \".txt\", use \"changeFilenameExtension\" if you want to replace\n    it with something else.\n\n    Note: For checks on extension, use hasFilenameExtension instead.\n    \"\"\"\n    return os.path.splitext(os.path.normcase(path))[1]\n\n\ndef changeFilenameExtension(path, extension):\n    \"\"\"Change the filename extension.\"\"\"\n    return os.path.splitext(path)[0] + extension\n\n\ndef hasFilenameExtension(path, extensions):\n    \"\"\"Has a filename one of the given extensions.\n\n    Note: The extensions should be normalized, i.e. lower case and will match other\n    cases where the file system does that on a platform. Also they include a dot,\n    e.g. \".qml\" is a good value.\n    \"\"\"\n\n    extension = getFilenameExtension(path)\n\n    if isinstance(extensions, basestring):\n        return extension == extensions\n    else:\n        return extension in extensions\n\n\ndef addFilenameExtension(path, extension):\n    if not hasFilenameExtension(path, extension):\n        path += extension\n\n    return path\n\n\ndef removeDirectory(path, ignore_errors):\n    \"\"\"Remove a directory recursively.\n\n    On Windows, it happens that operations fail, and succeed when retried,\n    so added a retry and small delay, then another retry. Should make it\n    much more stable during tests.\n\n    All kinds of programs that scan files might cause this, but they do\n    it hopefully only briefly.\n    \"\"\"\n\n    def onError(func, path, exc_info):\n        # Try again immediately, ignore what happened, pylint: disable=unused-argument\n        try:\n            func(path)\n        except OSError:\n            time.sleep(0.1)\n\n        func(path)\n\n    with withFileLock(\"removing directory %s\" % path):\n        if os.path.exists(path):\n            try:\n                shutil.rmtree(path, ignore_errors=False, onerror=onError)\n            except OSError:\n                if ignore_errors:\n                    shutil.rmtree(path, ignore_errors=ignore_errors)\n                else:\n                    raise\n\n\ndef resetDirectory(path, ignore_errors):\n    removeDirectory(path=path, ignore_errors=ignore_errors)\n    makePath(path)\n\n\n@contextmanager\ndef withTemporaryFile(suffix=\"\", mode=\"w\", delete=True, temp_path=None):\n    with tempfile.NamedTemporaryFile(\n        suffix=suffix, mode=mode, delete=delete, dir=temp_path\n    ) as temp_file:\n        yield temp_file\n\n\ndef getFileContentByLine(filename, mode=\"r\", encoding=None):\n    # We read the whole, to keep lock times minimal. We only deal with small\n    # files like this normally.\n    return getFileContents(filename, mode, encoding=encoding).splitlines()\n\n\ndef getFileContents(filename, mode=\"r\", encoding=None):\n    \"\"\"Get the contents of a file.\n\n    Args:\n        filename: str with the file to be read\n        mode: \"r\" for str, \"rb\" for bytes result\n        encoding: optional encoding to used when reading the file, e.g. \"utf8\"\n\n    Returns:\n        str or bytes - depending on mode.\n\n    \"\"\"\n\n    with withFileLock(\"reading file %s\" % filename):\n        with openTextFile(filename, mode, encoding=encoding) as f:\n            return f.read()\n\n\ndef getFileFirstLine(filename, mode=\"r\", encoding=None):\n    \"\"\"Get the contents of a file.\n\n    Args:\n        filename: str with the file to be read\n        mode: \"r\" for str, \"rb\" for bytes result\n        encoding: optional encoding to used when reading the file, e.g. \"utf8\"\n\n    Returns:\n        str or bytes - depending on mode.\n\n    \"\"\"\n\n    with withFileLock(\"reading file %s\" % filename):\n        with openTextFile(filename, mode, encoding=encoding) as f:\n            return f.readline()\n\n\ndef openTextFile(filename, mode, encoding=None):\n    if encoding is not None:\n        import codecs\n\n        return codecs.open(filename, mode, encoding=encoding)\n    else:\n        # Avoid deprecation warning, is now the default.\n        if python_version >= 0x370:\n            mode = mode.replace(\"U\", \"\")\n\n        # Encoding was checked to be not needed.\n        return open(filename, mode)  # pylint: disable=unspecified-encoding\n\n\ndef putTextFileContents(filename, contents, encoding=None):\n    \"\"\"Write a text file from given contents.\n\n    Args:\n        filename: str with the file to be created\n        contents: str or iterable of strings with what should be written into the file\n        encoding: optional encoding to used when writing the file\n\n    Returns:\n        None\n    \"\"\"\n\n    def _writeContents(output_file):\n        if isinstance(contents, basestring):\n            print(contents, file=output_file, end=\"\")\n        else:\n            for line in contents:\n                print(line, file=output_file)\n\n    with withFileLock(\"writing file %s\" % filename):\n        with openTextFile(filename, \"w\", encoding=encoding) as output_file:\n            _writeContents(output_file)\n\n\ndef putBinaryFileContents(filename, contents):\n    \"\"\"Write a binary file from given contents.\n\n    Args:\n        filename: str with the file to be created\n        contents: bytes that should be written into the file\n\n    Returns:\n        None\n    \"\"\"\n\n    with withFileLock(\"writing file %s\" % filename):\n        with openTextFile(filename, \"wb\") as output_file:\n            output_file.write(contents)\n\n\ndef changeTextFileContents(filename, contents, encoding=None, compare_only=False):\n    \"\"\"Write a text file from given contents.\n\n    Args:\n        filename: str with the file to be created or updated\n        contents: str\n        encoding: optional encoding to used when writing the file\n\n    Returns:\n        change indication for existing file if any\n    \"\"\"\n\n    if (\n        not os.path.isfile(filename)\n        or getFileContents(filename, encoding=encoding) != contents\n    ):\n        if not compare_only:\n            putTextFileContents(filename, contents)\n\n        return True\n    else:\n        return False\n\n\n@contextmanager\ndef withPreserveFileMode(filenames):\n    if isinstance(filenames, basestring):\n        filenames = [filenames]\n\n    old_modes = {}\n    for filename in filenames:\n        old_modes[filename] = os.stat(filename).st_mode\n\n    yield\n\n    for filename in filenames:\n        os.chmod(filename, old_modes[filename])\n\n\n@contextmanager\ndef withMadeWritableFileMode(filenames):\n    if isinstance(filenames, basestring):\n        filenames = [filenames]\n\n    with withPreserveFileMode(filenames):\n        for filename in filenames:\n            os.chmod(filename, int(\"644\", 8))\n\n        yield\n\n\ndef removeFileExecutablePermission(filename):\n    old_stat = os.stat(filename)\n\n    mode = old_stat.st_mode\n    mode &= ~(stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n    if mode != old_stat.st_mode:\n        os.chmod(filename, mode)\n\n\ndef addFileExecutablePermission(filename):\n    old_stat = os.stat(filename)\n\n    mode = old_stat.st_mode\n    mode |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH\n\n    if mode != old_stat.st_mode:\n        os.chmod(filename, mode)\n\n\ndef renameFile(source_filename, dest_filename):\n    # There is no way to safely update a file on Windows, but lets\n    # try on Linux at least.\n    old_stat = os.stat(source_filename)\n\n    try:\n        os.rename(source_filename, dest_filename)\n    except OSError:\n        copyFile(source_filename, dest_filename)\n        os.unlink(source_filename)\n\n    os.chmod(dest_filename, old_stat.st_mode)\n\n\ndef copyTree(source_path, dest_path):\n    \"\"\"Copy whole directory tree, preserving attributes.\n\n    Args:\n        source_path: where to copy from\n        dest_path: where to copy to, may already exist\n\n    Notes:\n        This must be used over `shutil.copytree` which has troubles\n        with existing directories on some Python versions.\n    \"\"\"\n    if python_version >= 0x380:\n        # Python 3.8+ has dirs_exist_ok\n        return shutil.copytree(source_path, dest_path, dirs_exist_ok=True)\n\n    from distutils.dir_util import copy_tree\n\n    return copy_tree(source_path, dest_path)\n\n\ndef copyFileWithPermissions(source_path, dest_path, dist_dir):\n    \"\"\"Improved version of shutil.copy2 for putting things to dist folder\n\n    File systems might not allow to transfer extended attributes, which we then ignore\n    and only copy permissions.\n    \"\"\"\n\n    if os.path.islink(source_path) and not isWin32Windows():\n        link_source_abs = os.path.abspath(source_path)\n        link_target_abs = os.path.abspath(\n            os.path.join(os.path.dirname(source_path), os.readlink(source_path))\n        )\n\n        link_target_rel = relpath(link_target_abs, os.path.dirname(link_source_abs))\n\n        if isFilenameBelowPath(\n            path=dist_dir,\n            filename=os.path.join(os.path.dirname(dest_path), link_target_rel),\n        ):\n            os.symlink(link_target_rel, dest_path)\n            return\n\n    try:\n        shutil.copy2(\n            source_path,\n            dest_path,\n        )\n    except PermissionError as e:\n        if e.errno != errno.EACCES:\n            raise\n\n        source_mode = os.stat(source_path).st_mode\n        shutil.copy(source_path, dest_path)\n        os.chmod(dest_path, source_mode)\n\n\ndef queryUser(question, choices, default, default_non_interactive):\n    assert default in choices, (default, choices)\n    assert default_non_interactive in choices, (default, choices)\n\n    prompt = \"%s? %s : \" % (\n        question,\n        \"/\".join(\n            \"[%s]\" % choice.title() if choice == default else choice.title()\n            for choice in choices\n        ),\n    )\n\n    # Integrates with progress bar by closing it.\n    printLine(prompt, end=\"\")\n    flushStandardOutputs()\n\n    try:\n        reply = raw_input() or default\n    except EOFError:\n        reply = default_non_interactive\n\n    if reply == \"y\":\n        reply = \"yes\"\n\n    return reply.lower()\n\n\ndef copyFile(source_path, dest_path):\n    \"\"\"Improved version of shutil.copy\n\n    This handles errors with a chance to correct them, e.g. on Windows, files might be\n    locked by running program or virus checkers.\n    \"\"\"\n\n    while 1:\n        try:\n            shutil.copyfile(source_path, dest_path)\n        except PermissionError as e:\n            if e.errno != errno.EACCES:\n                raise\n\n            general.warning(\"Problem copying file %s:\" % e)\n\n            if (\n                queryUser(\n                    \"Retry?\",\n                    choices=(\"yes\", \"no\"),\n                    default=\"yes\",\n                    default_non_interactive=\"no\",\n                )\n                == \"yes\"\n            ):\n                continue\n\n            raise\n\n        break\n\n\ndef getWindowsDrive(path):\n    \"\"\"Windows drive for a given path.\"\"\"\n\n    drive, _ = os.path.splitdrive(os.path.abspath(path))\n    return os.path.normcase(drive)\n\n\ndef isFilenameBelowPath(path, filename, consider_short=True):\n    \"\"\"Is a filename inside of a given directory path\n\n    Args:\n        path: location to be below\n        filename: candidate being checked\n    \"\"\"\n    if type(path) in (tuple, list):\n        for p in path:\n            if isFilenameBelowPath(\n                path=p, filename=filename, consider_short=consider_short\n            ):\n                return True\n\n        return False\n\n    path = os.path.abspath(path)\n    filename = os.path.abspath(filename)\n\n    if isWin32Windows():\n        if getWindowsDrive(path) != getWindowsDrive(filename):\n            return False\n\n    result = os.path.relpath(filename, path).split(os.path.sep)[0] != \"..\"\n\n    if not result and consider_short:\n        if os.path.exists(filename) and os.path.exists(path):\n            filename = getExternalUsePath(filename)\n            path = getExternalUsePath(path)\n\n            if isWin32Windows():\n                if getWindowsDrive(path) != getWindowsDrive(filename):\n                    return False\n\n            result = os.path.relpath(filename, path).split(os.path.sep)[0] != \"..\"\n\n    return result\n\n\ndef isFilenameSameAsOrBelowPath(path, filename):\n    \"\"\"Is a filename inside of a given directory path or the same path as that directory.\"\"\"\n    return isFilenameBelowPath(path, filename) or areSamePaths(path, filename)\n\n\ndef getWindowsShortPathName(filename):\n    \"\"\"Gets the short path name of a given long path.\n\n    Args:\n        filename - long Windows filename\n    Returns:\n        Path that is a short filename pointing at the same file.\n    Notes:\n        Originally from http://stackoverflow.com/a/23598461/200291\n    \"\"\"\n    import ctypes.wintypes\n\n    GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW\n    GetShortPathNameW.argtypes = (\n        ctypes.wintypes.LPCWSTR,\n        ctypes.wintypes.LPWSTR,\n        ctypes.wintypes.DWORD,\n    )\n    GetShortPathNameW.restype = ctypes.wintypes.DWORD\n\n    output_buf_size = 0\n    while True:\n        output_buf = ctypes.create_unicode_buffer(output_buf_size)\n        needed = GetShortPathNameW(\n            os.path.abspath(filename), output_buf, output_buf_size\n        )\n\n        if needed == 0:\n            # Windows only code, pylint: disable=I0021,undefined-variable\n\n            # Permission denied.\n            if ctypes.GetLastError() == 5:\n                return filename\n\n            raiseWindowsError(\"getWindowsShortPathName for %s\" % filename)\n        if output_buf_size >= needed:\n            # Short paths should be ASCII. Don't return unicode without a need,\n            # as e.g. Scons hates that in environment variables.\n            if str is bytes:\n                return output_buf.value.encode(\"utf8\")\n            else:\n                return output_buf.value\n        else:\n            output_buf_size = needed\n\n\ndef getWindowsLongPathName(filename):\n    \"\"\"Gets the long path name of a given long path.\n\n    Args:\n        filename - short Windows filename\n    Returns:\n        Path that is a long filename pointing at the same file.\n    \"\"\"\n    import ctypes.wintypes\n\n    GetLongPathNameW = ctypes.windll.kernel32.GetLongPathNameW\n    GetLongPathNameW.argtypes = (\n        ctypes.wintypes.LPCWSTR,\n        ctypes.wintypes.LPWSTR,\n        ctypes.wintypes.DWORD,\n    )\n    GetLongPathNameW.restype = ctypes.wintypes.DWORD\n\n    output_buf_size = 0\n    while True:\n        output_buf = ctypes.create_unicode_buffer(output_buf_size)\n        needed = GetLongPathNameW(\n            os.path.abspath(filename), output_buf, output_buf_size\n        )\n\n        if needed == 0:\n            # Windows only code, pylint: disable=I0021,undefined-variable\n\n            # Permission denied.\n            if ctypes.GetLastError() == 5:\n                return filename\n\n            raiseWindowsError(\"getWindowsLongPathName for %s\" % filename)\n        if output_buf_size >= needed:\n            return output_buf.value\n        else:\n            output_buf_size = needed\n\n\n_external_use_path_cache = {}\n\n\ndef getExternalUsePath(filename, only_dirname=False):\n    \"\"\"Gets the externally usable absolute path for a given relative path.\n\n    Args:\n        filename - filename, potentially relative\n    Returns:\n        Path that is a absolute and (on Windows) short filename pointing at the same file.\n    Notes:\n        This is only \"os.path.abspath\" except on Windows, where is converts\n        to a short path too.\n    \"\"\"\n\n    filename = os.path.abspath(filename)\n\n    if os.name == \"nt\":\n        key = filename, only_dirname\n\n        if filename not in _external_use_path_cache:\n            filename = getFilenameRealPath(filename)\n\n            if only_dirname:\n                dirname = getWindowsShortPathName(os.path.dirname(filename))\n                assert os.path.exists(dirname)\n                filename = os.path.join(dirname, os.path.basename(filename))\n            else:\n                filename = getWindowsShortPathName(filename)\n\n            _external_use_path_cache[key] = filename\n\n            # Looking up again should give same result immediately.\n            key = filename, only_dirname\n            _external_use_path_cache[key] = filename\n\n        return _external_use_path_cache[key]\n    else:\n        return filename\n\n\n_report_path_cache = {}\n\n\ndef getReportPath(filename, prefixes=()):\n    \"\"\"Convert filename into a path suitable for reporting, avoiding home directory paths.\"\"\"\n    key = filename, tuple(prefixes)\n\n    if key not in _report_path_cache:\n        _report_path_cache[key] = _getReportPath(filename, prefixes)\n\n    return _report_path_cache[key]\n\n\ndef _getReportPath(filename, prefixes):\n    if os.path.isabs(os.path.expanduser(filename)):\n        prefixes = list(prefixes)\n        prefixes.append(\n            (\"~\", os.path.expanduser(\"~\")),\n        )\n\n        abs_filename = os.path.abspath(os.path.expanduser(filename))\n\n        for prefix_name, prefix_path in prefixes:\n            if isFilenameBelowPath(\n                path=prefix_path, filename=abs_filename, consider_short=False\n            ):\n                return os.path.normpath(\n                    os.path.join(\n                        prefix_name, relpath(path=abs_filename, start=prefix_path)\n                    )\n                )\n\n            if isFilenameBelowPath(\n                path=prefix_path, filename=abs_filename, consider_short=True\n            ):\n                return os.path.normpath(\n                    os.path.join(\n                        prefix_name,\n                        relpath(\n                            path=abs_filename, start=getExternalUsePath(prefix_path)\n                        ),\n                    )\n                )\n\n    if isWin32Windows():\n        try:\n            old_filename = filename\n\n            filename = getWindowsLongPathName(filename)\n        except FileNotFoundError:\n            dirname = os.path.dirname(filename)\n\n            if dirname:\n                try:\n                    dirname = getWindowsLongPathName(dirname)\n                except FileNotFoundError:\n                    pass\n                else:\n                    filename = os.path.join(dirname, os.path.basename(filename))\n        else:\n            if old_filename != filename:\n                return _getReportPath(filename, prefixes)\n\n    return filename\n\n\ndef getLinkTarget(filename):\n    \"\"\"Return the path a link is pointing too, if any.\n\n    Args:\n        filename - check this path, need not be a filename\n\n    Returns:\n        (bool, link_target) - first value indicates if it is a link, second the link target\n\n    Notes:\n        This follows symlinks to the very end.\n    \"\"\"\n    is_link = False\n    while os.path.exists(filename) and os.path.islink(filename):\n        link_target = os.readlink(filename)\n\n        filename = os.path.join(os.path.dirname(filename), link_target)\n        is_link = True\n\n    return is_link, filename\n\n\n# Late import and optional to be there.\natomicwrites = None\n\n\ndef replaceFileAtomic(source_path, dest_path):\n    \"\"\"\n    Move ``src`` to ``dst``. If ``dst`` exists, it will be silently\n    overwritten.\n\n    Both paths must reside on the same filesystem for the operation to be\n    atomic.\n\n    spellchecker: ignore atomicwrites\n    \"\"\"\n\n    if python_version >= 0x300:\n        os.replace(source_path, dest_path)\n    else:\n        global atomicwrites  # singleton, pylint: disable=global-statement\n\n        if atomicwrites is None:\n            atomicwrites = importFromInlineCopy(\"atomicwrites\", must_exist=True)\n\n        atomicwrites.replace_atomic(source_path, dest_path)\n\n\ndef resolveShellPatternToFilenames(pattern):\n    \"\"\"Resolve shell pattern to filenames.\n\n    Args:\n        pattern - str\n\n    Returns:\n        list - filenames that matched.\n    \"\"\"\n\n    if \"**\" in pattern:\n        if python_version >= 0x350:\n            result = glob.glob(pattern, recursive=True)\n        else:\n            glob2 = importFromInlineCopy(\"glob2\", must_exist=False)\n\n            if glob2 is None:\n                options_logger.sysexit(\n                    \"Using pattern with '**' is not supported before Python 3.5 unless glob2 is installed.\"\n                )\n\n            result = glob2.glob(pattern)\n    else:\n        result = glob.glob(pattern)\n\n    result = [os.path.normpath(filename) for filename in result]\n    result.sort()\n    return result\n\n\n@contextmanager\ndef withDirectoryChange(path, allow_none=False):\n    \"\"\"Change current directory temporarily in a context.\"\"\"\n\n    # spell-checker: ignore chdir\n\n    if path is not None or not allow_none:\n        old_cwd = os.getcwd()\n        os.chdir(path)\n\n    yield\n\n    if path is not None or not allow_none:\n        os.chdir(old_cwd)\n\n\ndef containsPathElements(path, elements):\n    \"\"\"Test if a path contains any unwanted elements.\"\"\"\n\n    elements = tuple(os.path.normcase(element) for element in elements)\n    path = os.path.normpath(path)\n\n    parts = os.path.normpath(path).split(os.path.sep)\n\n    return any(element in parts for element in elements)\n\n\ndef syncFileOutput(file_handle):\n    \"\"\"Synchronize a file contents to disk\n\n    On this, this not only flushes, but calls \"syncfs\" to make sure things work\n    properly.\n\n    # spell-checker: ignore syncfs\n    \"\"\"\n\n    file_handle.flush()\n\n    if isLinux():\n        import ctypes\n\n        try:\n            libc = ctypes.CDLL(\"libc.so.6\")\n        except OSError:\n            # We cannot do it easily for this Linux apparently.\n            return\n\n        try:\n            libc.syncfs(file_handle.fileno())\n        except AttributeError:\n            # Too old to have \"syncfs\" available.\n            return\n\n\ndef isFilesystemEncodable(filename):\n    \"\"\"Decide if a filename is safe for use as a file system path with tools.\"\"\"\n    if os.name == \"nt\":\n        value = (\n            unicodedata.normalize(\"NFKD\", filename)\n            .encode(\"ascii\", \"ignore\")\n            .decode(\"ascii\")\n        )\n\n        return value == filename\n    else:\n        return True\n\n\ndef openPickleFile(filename, mode, protocol=-1):\n    file_handle = openTextFile(filename, mode)\n\n    if python_version < 0x300:\n        return file_handle, pickle.Pickler(file_handle, protocol)\n    else:\n        return file_handle, pickle._Pickler(  # pylint: disable=protected-access\n            file_handle, protocol\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Hashing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module for working with hashes in Nuitka.\n\nOffers support for hashing incrementally and files esp. without having\nto read their contents.\n\"\"\"\n\nfrom binascii import crc32\n\nfrom nuitka.__past__ import md5, unicode\n\nfrom .FileOperations import openTextFile\n\n\nclass HashBase(object):\n    __slots__ = (\"hash\",)\n\n    def updateFromValues(self, *values):\n        for value in values:\n            if type(value) is int:\n                value = str(int)\n\n            if type(value) in (str, unicode):\n                if str is not bytes:\n                    value = value.encode(\"utf8\")\n\n                self.updateFromBytes(value)\n            elif type(value) is bytes:\n                self.updateFromBytes(value)\n            elif type(value) is dict:\n                self.updateFromBytes(b\"dict\")\n                self.updateFromValues(*list(value.items()))\n            elif type(value) is tuple:\n                self.updateFromBytes(b\"tuple\")\n                self.updateFromValues(*value)\n            elif type(value) is list:\n                self.updateFromBytes(b\"list\")\n                self.updateFromValues(*value)\n            else:\n                assert False, type(value)\n\n    def updateFromFile(self, filename, line_filter=None):\n        with openTextFile(filename, \"rb\") as input_file:\n            self.updateFromFileHandle(input_file, line_filter=line_filter)\n\n    def updateFromFileHandle(self, file_handle, line_filter=None):\n        if line_filter is None:\n            while 1:\n                chunk = file_handle.read(1024 * 1024)\n\n                if not chunk:\n                    break\n\n                self.updateFromBytes(chunk)\n        else:\n            for line in file_handle:\n                line = line_filter(line)\n\n                if line is not None:\n                    self.updateFromBytes(line)\n\n\nclass Hash(HashBase):\n    def __init__(self):\n        self.hash = md5()\n\n    def updateFromBytes(self, value):\n        self.hash.update(value)\n\n    def asDigest(self):\n        return self.hash.digest()\n\n    def asHexDigest(self):\n        return self.hash.hexdigest()\n\n\ndef getFileContentsHash(filename, as_string=True, line_filter=None):\n    result = Hash()\n    result.updateFromFile(filename=filename, line_filter=line_filter)\n\n    if as_string:\n        return result.asHexDigest()\n    else:\n        return result.asDigest()\n\n\ndef getStringHash(value, as_string=True):\n    result = Hash()\n    result.updateFromValues(value)\n\n    if as_string:\n        return result.asHexDigest()\n    else:\n        return result.asDigest()\n\n\ndef getHashFromValues(*values):\n    result = Hash()\n    result.updateFromValues(*values)\n\n    return result.asHexDigest()\n\n\nclass HashCRC32(HashBase):\n    def __init__(self):\n        self.hash = 0\n\n    def updateFromBytes(self, value):\n        self.hash = crc32(value, self.hash)\n\n    def asDigest(self):\n        return self.hash\n\n    def asHexDigest(self):\n        return hex(self.hash)[2:]\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Images.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Handling of images, esp. format conversions for icons.\n\n\"\"\"\n\nfrom .FileOperations import getFilenameExtension, hasFilenameExtension\nfrom .Utils import isMacOS, isWin32Windows\n\n\ndef checkIconUsage(logger, icon_path):\n    icon_format = getFilenameExtension(icon_path)\n\n    if icon_format != \".icns\" and isMacOS():\n        needs_conversion = True\n    elif icon_format != \".ico\" and isWin32Windows():\n        needs_conversion = True\n    else:\n        needs_conversion = False\n\n    if needs_conversion:\n        try:\n            import imageio  # pylint: disable=I0021,import-error,unused-import\n        except ImportError:\n            logger.sysexit(\n                \"\"\"\\\nNeed to install 'imageio' to let automatically convert the non native \\\nicon image (%s) in file in '%s'.\"\"\"\n                % (icon_format[1:].upper(), icon_path)\n            )\n\n\ndef convertImageToIconFormat(logger, image_filename, converted_icon_filename):\n    \"\"\"Convert image file to icon file.\"\"\"\n    icon_format = converted_icon_filename.rsplit(\".\", 1)[1].lower()\n\n    # Limit to supported icon formats.\n    assert hasFilenameExtension(converted_icon_filename, (\".ico\", \".icns\")), icon_format\n\n    # Avoid importing unless actually used.\n    import imageio  # pylint: disable=I0021,import-error\n\n    try:\n        image = imageio.imread(image_filename)\n    except ValueError:\n        logger.sysexit(\n            \"Unsupported file format for 'imageio' in '%s', use e.g. PNG or other supported file formats instead.\"\n            % image_filename\n        )\n\n    imageio.imwrite(converted_icon_filename, image)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Importing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Helper to import a file as a module.\n\nUsed for Nuitka plugins and for test code.\n\"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import general\n\nfrom .ModuleNames import ModuleName\nfrom .Utils import withNoDeprecationWarning\n\n\ndef _importFilePy3NewWay(filename):\n    \"\"\"Import a file for Python versions 3.5+.\"\"\"\n    import importlib.util  # pylint: disable=I0021,import-error,no-name-in-module\n\n    spec = importlib.util.spec_from_file_location(\n        os.path.basename(filename).split(\".\")[0], filename\n    )\n    user_plugin_module = importlib.util.module_from_spec(spec)\n    spec.loader.exec_module(user_plugin_module)\n    return user_plugin_module\n\n\ndef _importFilePy3OldWay(filename):\n    \"\"\"Import a file for Python versions before 3.5.\"\"\"\n    from importlib.machinery import (  # pylint: disable=I0021,import-error,no-name-in-module\n        SourceFileLoader,\n    )\n\n    # pylint: disable=I0021,deprecated-method\n    return SourceFileLoader(filename, filename).load_module(filename)\n\n\ndef importFilePy2(filename):\n    \"\"\"Import a file for Python version 2.\"\"\"\n    import imp\n\n    basename = os.path.splitext(os.path.basename(filename))[0]\n    return imp.load_source(basename, filename)\n\n\ndef importFileAsModule(filename):\n    \"\"\"Import Python module given as a file name.\n\n    Notes:\n        Provides a Python version independent way to import any script files.\n\n    Args:\n        filename: complete path of a Python script\n\n    Returns:\n        Imported Python module with code from the filename.\n    \"\"\"\n    if python_version < 0x300:\n        return importFilePy2(filename)\n    elif python_version < 0x350:\n        return _importFilePy3OldWay(filename)\n    else:\n        return _importFilePy3NewWay(filename)\n\n\n_shared_library_suffixes = None\n\n\ndef getSharedLibrarySuffixes():\n    # Using global here, as this is for caching only\n    # pylint: disable=global-statement\n    global _shared_library_suffixes\n\n    if _shared_library_suffixes is None:\n        if python_version < 0x300:\n            import imp\n\n            _shared_library_suffixes = []\n\n            for suffix, _mode, module_type in imp.get_suffixes():\n                if module_type == imp.C_EXTENSION:\n                    _shared_library_suffixes.append(suffix)\n        else:\n            import importlib.machinery  # pylint: disable=I0021,import-error,no-name-in-module\n\n            _shared_library_suffixes = list(importlib.machinery.EXTENSION_SUFFIXES)\n\n        # Nuitka-Python on Windows has that\n        if \"\" in _shared_library_suffixes:\n            _shared_library_suffixes.remove(\"\")\n\n        _shared_library_suffixes = tuple(_shared_library_suffixes)\n\n    return _shared_library_suffixes\n\n\ndef getSharedLibrarySuffix(preferred):\n    if preferred and python_version >= 0x300:\n        return getSharedLibrarySuffixes()[0]\n\n    result = None\n\n    for suffix in getSharedLibrarySuffixes():\n        if result is None or len(suffix) < len(result):\n            result = suffix\n\n    return result\n\n\ndef _importFromFolder(logger, module_name, path, must_exist, message):\n    \"\"\"Import a module from a folder by adding it temporarily to sys.path\"\"\"\n\n    # Cyclic dependency here\n    from .FileOperations import isFilenameBelowPath\n\n    if module_name in sys.modules:\n        # May already be loaded, but the wrong one from a \".pth\" file of\n        # clcache that we then don't want to use.\n        if module_name != \"clcache\" or isFilenameBelowPath(\n            path=path, filename=sys.modules[module_name].__file__\n        ):\n            return sys.modules[module_name]\n        else:\n            del sys.modules[module_name]\n\n    # Temporarily add the inline path of the module to the import path.\n    sys.path.insert(0, path)\n\n    # Handle case without inline copy too.\n    try:\n        return __import__(module_name, level=0)\n    except (ImportError, SyntaxError, RuntimeError) as e:\n        if not must_exist:\n            return None\n\n        exit_message = (\n            \"Error, expected inline copy of '%s' to be in '%s', error was: %r.\"\n            % (module_name, path, e)\n        )\n\n        if message is not None:\n            exit_message += \"\\n\" + message\n\n        logger.sysexit(exit_message)\n    finally:\n        # Do not forget to remove it from sys.path again.\n        del sys.path[0]\n\n\n_deleted_modules = {}\n\n\ndef importFromInlineCopy(module_name, must_exist, delete_module=False):\n    \"\"\"Import a module from the inline copy stage.\"\"\"\n\n    folder_name = os.path.normpath(\n        os.path.join(\n            os.path.dirname(__file__), \"..\", \"build\", \"inline_copy\", module_name\n        )\n    )\n\n    candidate_27 = folder_name + \"_27\"\n    candidate_35 = folder_name + \"_35\"\n\n    # Use specific versions if needed.\n    if python_version < 0x300 and os.path.exists(candidate_27):\n        folder_name = candidate_27\n    elif python_version < 0x360 and os.path.exists(candidate_35):\n        folder_name = candidate_35\n\n    module = _importFromFolder(\n        module_name=module_name,\n        path=folder_name,\n        must_exist=must_exist,\n        message=None,\n        logger=general,\n    )\n\n    if delete_module and module_name in sys.modules:\n        delete_module_names = set([module_name])\n\n        for m in sys.modules:\n            if m.startswith(module_name + \".\"):\n                delete_module_names.add(m)\n\n        for delete_module_name in delete_module_names:\n            _deleted_modules[delete_module_name] = sys.modules[delete_module_name]\n            del sys.modules[delete_module_name]\n\n    return module\n\n\n_compile_time_modules = {}\n\n\ndef importFromCompileTime(module_name, must_exist):\n    \"\"\"Import a module from the compiled time stage.\n\n    This is not for using the inline copy, but the one from the actual\n    installation of the user. It suppresses warnings and caches the value\n    avoid making more __import__ calls that necessary.\n    \"\"\"\n\n    if module_name not in _compile_time_modules:\n        with withNoDeprecationWarning():\n            try:\n                __import__(module_name)\n            except (ImportError, RuntimeError):\n                # Preventing a retry, converted to None for return\n                _compile_time_modules[module_name] = False\n            else:\n                _compile_time_modules[module_name] = sys.modules[module_name]\n\n    # Some code should only use this, after knowing it will be found. Complain if\n    # that is not the case.\n    assert _compile_time_modules[module_name] or not must_exist\n\n    return _compile_time_modules[module_name] or None\n\n\ndef isBuiltinModuleName(module_name):\n    if python_version < 0x300:\n        import imp as _imp\n    else:\n        import _imp\n\n    result = _imp.is_builtin(module_name) or _imp.is_frozen(module_name)\n\n    # Some frozen modules are not actually in that list, e.g.\n    # \"importlib._bootstrap_external\" on Python3.10 doesn't report to\n    # \"_imp.is_frozen()\" above, so we check if it's already loaded and from the\n    # \"FrozenImporter\" by name.\n    if result is False and module_name in sys.modules:\n        module = sys.modules[module_name]\n\n        if hasattr(module, \"__loader__\"):\n            loader = module.__loader__\n\n            try:\n                result = loader.__name__ == \"FrozenImporter\"\n            except AttributeError:\n                pass\n\n    return result\n\n\n# Have a set for quicker lookups, and we cannot have \"__main__\" in there.\nbuiltin_module_names = set(\n    module_name for module_name in sys.builtin_module_names if module_name != \"__main__\"\n)\n\n\ndef getModuleFilenameSuffixes():\n    if python_version < 0x3C0:\n        import imp\n\n        for suffix, _mode, module_type in imp.get_suffixes():\n            if module_type == imp.C_EXTENSION:\n                module_type = \"C_EXTENSION\"\n            elif module_type == imp.PY_SOURCE:\n                module_type = \"PY_SOURCE\"\n            elif module_type == imp.PY_COMPILED:\n                module_type = \"PY_COMPILED\"\n            else:\n                assert False, module_type\n\n            yield suffix, module_type\n    else:\n        import importlib.machinery\n\n        for suffix in importlib.machinery.EXTENSION_SUFFIXES:\n            yield suffix, \"C_EXTENSION\"\n        for suffix in importlib.machinery.SOURCE_SUFFIXES:\n            yield suffix, \"PY_SOURCE\"\n        for suffix in importlib.machinery.BYTECODE_SUFFIXES:\n            yield suffix, \"PY_COMPILED\"\n\n\ndef getModuleNameAndKindFromFilenameSuffix(module_filename):\n    \"\"\"Given a filename, decide the module name and kind.\n\n    Args:\n        module_name - file path of the module\n    Returns:\n        Tuple with the name of the module basename, and the kind of the\n        module derived from the file suffix. Can be None, None if is is not a\n        known file suffix.\n    Notes:\n        This doesn't handle packages at all.\n    \"\"\"\n    if module_filename.endswith(\".py\"):\n        return ModuleName(os.path.basename(module_filename)[:-3]), \"py\"\n\n    if module_filename.endswith(\".pyc\"):\n        return ModuleName(os.path.basename(module_filename)[:-4]), \"pyc\"\n\n    for suffix in getSharedLibrarySuffixes():\n        if module_filename.endswith(suffix):\n            return (\n                ModuleName(os.path.basename(module_filename)[: -len(suffix)]),\n                \"extension\",\n            )\n\n    return None, None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/InstalledPythons.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Provide installed Pythons with module availability checks. \"\"\"\n\nimport os\nimport sys\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonFlavors import isAnacondaPython, isMSYS2MingwPython\nfrom nuitka.PythonVersions import (\n    getInstalledPythonRegistryPaths,\n    python_version_str,\n)\n\nfrom .Execution import (\n    NuitkaCalledProcessError,\n    check_output,\n    getExecutablePath,\n)\nfrom .FileOperations import getDirectoryRealPath\nfrom .Utils import isWin32Windows\n\n\nclass InstalledPython(object):\n    def __init__(self, python_exe, python_version):\n        self.python_exe = python_exe\n        self.python_version = python_version\n\n    def __repr__(self):\n        return \"<InstalledPython '%s' version '%s'>\" % (\n            self.python_exe,\n            self.python_version,\n        )\n\n    def getPythonExe(self):\n        return self.python_exe\n\n    def getPythonVersion(self):\n        return self.python_version\n\n    def getHexVersion(self):\n        major, minor = self.python_version.split(\".\")\n        return int(major) * 256 + int(minor) * 16\n\n    def isAnacondaPython(self):\n        if self.python_exe == sys.executable:\n            return isAnacondaPython()\n\n        # TODO: May not yet work really.\n        return os.path.exists(\n            os.path.join(os.path.dirname(self.python_exe), \"..\", \"conda-meta\")\n        )\n\n    def isMSYS2MingwPython(self):\n        if self.python_exe == sys.executable:\n            return isMSYS2MingwPython()\n\n        # TODO: May not yet work really.\n        return (\n            os.path.exists(\n                os.path.join(os.path.dirname(self.python_exe), \"..\", \"..\", \"msys2.ini\")\n            )\n            and os.path.basename(os.path.dirname(self.python_exe)) == \"mingw64\"\n        )\n\n    def getPreferredPackageType(self):\n        if self.isAnacondaPython():\n            return \"conda\"\n        elif self.isMSYS2MingwPython():\n            return \"pacman\"\n        else:\n            return \"pip\"\n\n    # Necessary for Python 2.7, otherwise SyntaxError is given on exec.\n    @staticmethod\n    def _exec(code, context):\n        # We can trust our own code there, pylint: disable=exec-used\n        exec(code.replace(\"print\", \"catch_print\"), context)\n\n    def checkUsability(self, module_name, module_version):\n        # very many cases and return driven\n        # pylint: disable=too-many-branches,too-many-return-statements\n\n        if module_name is None:\n            return True\n\n        test_code = \"import %s\" % module_name\n\n        if module_version is not None:\n            test_code += \";print(%s.__version__)\" % module_name\n\n        test_code += \";print('OK')\"\n\n        if self.python_exe != sys.executable:\n            try:\n                output = check_output([self.python_exe, \"-c\", test_code])\n            except NuitkaCalledProcessError:\n                return False\n            except OSError:\n                return False\n\n            output = output.splitlines()\n        else:\n            output = []\n\n            def catch_print(value):\n                output.append(value)\n\n            try:\n                self._exec(code=test_code, context={\"catch_print\": catch_print})\n            except ImportError:\n                return False\n\n            if str is not bytes:\n                output = [line.encode(\"utf8\") for line in output]\n\n        if output[-1] != b\"OK\":\n            return False\n\n        if module_version is not None:\n            detected_version = output[-2].split(b\".\")\n\n            if str is not bytes:\n                module_version = module_version.encode(\"utf8\")\n\n            for detected_part, wanted_part in zip(\n                detected_version, module_version.split(b\".\")\n            ):\n                if int(detected_part) < int(wanted_part):\n                    return False\n\n        return True\n\n\n_installed_pythons = {}\n\n\ndef _getPythonInstallPathsWindows(python_version):\n    \"\"\"Find Python installation on Windows.\n\n    Find a Python installation, first try a few\n    guesses for their paths, then look into registry for user or system wide\n    installations.\n    \"\"\"\n    seen = set()\n\n    # Shortcuts for the default installation directories, to avoid going to\n    # registry at all unless necessary. Any Python2 will do for Scons, so it\n    # might be avoided entirely.\n\n    candidate = r\"c:\\python%s\\python.exe\" % python_version.replace(\".\", \"\")\n\n    if os.path.isfile(candidate):\n        candidate = os.path.join(\n            getDirectoryRealPath(os.path.dirname(candidate)),\n            os.path.basename(candidate),\n        )\n\n        yield candidate\n\n        seen.add(candidate)\n\n    for candidate in getInstalledPythonRegistryPaths(python_version):\n        if candidate not in seen:\n            seen.add(candidate)\n            yield candidate\n\n\ndef findPythons(python_version, module_name=None, module_version=None):\n    \"\"\"Find all Python installations for a specific version.\"\"\"\n\n    if python_version not in _installed_pythons:\n        result = OrderedSet()\n\n        if python_version == python_version_str:\n            result.add(\n                InstalledPython(\n                    python_exe=sys.executable, python_version=python_version\n                )\n            )\n\n        if isWin32Windows():\n            result.update(\n                InstalledPython(python_exe=python_exe, python_version=python_version)\n                for python_exe in _getPythonInstallPathsWindows(python_version)\n            )\n\n        candidate = getExecutablePath(\"python\" + python_version)\n        if candidate is not None:\n            result.add(\n                InstalledPython(python_exe=candidate, python_version=python_version)\n            )\n\n        _installed_pythons[python_version] = result\n\n    return tuple(\n        candidate\n        for candidate in _installed_pythons[python_version]\n        if candidate.checkUsability(\n            module_name=module_name, module_version=module_version\n        )\n    )\n\n\ndef findInstalledPython(python_versions, module_name, module_version):\n    python_versions = list(python_versions)\n    python_versions.sort(\n        key=lambda python_version: python_version != python_version_str\n    )\n\n    # Make sure the current Python version is scanned for if acceptable.\n    if python_version_str in python_versions:\n        findPythons(python_version_str)\n\n    # Attempt to prefer scanned versions.\n    for python_version in python_versions:\n        for candidate in _installed_pythons.get(python_version, ()):\n            if module_name is None or candidate.checkUsability(\n                module_name=module_name, module_version=module_version\n            ):\n                return candidate\n\n    # Attempt to find so far not scanned versions.\n    for python_version in python_versions:\n        if python_version not in _installed_pythons:\n            for candidate in findPythons(python_version):\n                if module_name is None or candidate.checkUsability(\n                    module_name=module_name, module_version=module_version\n                ):\n                    return candidate\n\n    return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/InstanceCounters.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Instance counter primitives\n\nWe don't use a meta class as it's unnecessary complex, and portable meta classes\nhave their difficulties, and want to count classes, who already have a meta\nclass.\n\nThis is going to expanded with time.\n\n\"\"\"\n\nfrom nuitka.Options import isShowMemory\nfrom nuitka.Tracing import printIndented, printLine\n\ncounted_inits = {}\ncounted_dels = {}\n\n\ndef isCountingInstances():\n    return isShowMemory()\n\n\ndef counted_init(init):\n    if isShowMemory():\n\n        def wrapped_init(self, *args, **kw):\n            name = self.__class__.__name__\n            assert type(name) is str\n\n            if name not in counted_inits:\n                counted_inits[name] = 0\n\n            counted_inits[name] += 1\n\n            init(self, *args, **kw)\n\n        return wrapped_init\n    else:\n        return init\n\n\ndef _wrapped_del(self):\n    # This cannot be necessary, because in program finalization, the\n    # global variables were assign to None.\n    if counted_dels is None:\n        return\n\n    name = self.__class__.__name__\n    assert type(name) is str\n\n    if name not in counted_dels:\n        counted_dels[name] = 0\n\n    counted_dels[name] += 1\n\n\ndef counted_del():\n    assert isShowMemory()\n\n    return _wrapped_del\n\n\ndef printStats():\n    printLine(\"Init/del/alive calls:\")\n\n    for name, count in sorted(counted_inits.items()):\n        dels = counted_dels.get(name, 0)\n        printIndented(1, name, count, dels, count - dels)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Jinja2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Jinja folklore wrappers and handling of inline copy usage.\n\n\"\"\"\n\nimport sys\n\nfrom nuitka.__past__ import unicode\n\nfrom .Importing import importFromInlineCopy\n\nenvironments = {}\n\n\ndef unlikely_if(value):\n    if value:\n        return \"unlikely\"\n    else:\n        return \"\"\n\n\ndef unlikely_or_likely_from(value):\n    if value:\n        return \"unlikely\"\n    else:\n        return \"likely\"\n\n\n_jinja2 = None\n_markupsafe = None\n\n# For pkg resources, we need to keep a reference, after we delete it from\n# \"sys.modules\" again.\n\n_loaded_pkg_resources = None\n\n\ndef getJinja2Package():\n    global _jinja2, _markupsafe, _loaded_pkg_resources  # singleton package using a cache, pylint: disable=global-statement\n\n    # Import dependencies, sadly we get to manage this ourselves.\n    if _markupsafe is None:\n        _markupsafe = importFromInlineCopy(\"markupsafe\", must_exist=True)\n\n    # Newer Jinja2 may not use it, but we load it and remove it, so it\n    # does not interfere with anything else.\n    if \"pkg_resources\" not in sys.modules:\n        if _loaded_pkg_resources is None:\n            _loaded_pkg_resources = importFromInlineCopy(\n                \"pkg_resources\", must_exist=False\n            )\n\n    if _jinja2 is None:\n        _jinja2 = importFromInlineCopy(\"jinja2\", must_exist=True)\n\n    # Unload if it was us loading it, as the inline copy is incomplete.\n    if _loaded_pkg_resources is not None and \"pkg_resources\" in sys.modules:\n        del sys.modules[\"pkg_resources\"]\n\n    return _jinja2\n\n\ndef getEnvironment(package_name, template_subdir, extensions):\n    key = package_name, template_subdir, extensions\n\n    if key not in environments:\n        jinja2 = getJinja2Package()\n\n        if package_name is not None:\n            loader = jinja2.PackageLoader(package_name, template_subdir)\n        elif template_subdir is not None:\n            loader = jinja2.FileSystemLoader(template_subdir)\n        else:\n            loader = jinja2.BaseLoader()\n\n        env = jinja2.Environment(\n            loader=loader,\n            extensions=extensions,\n            trim_blocks=True,\n            lstrip_blocks=True,\n        )\n\n        # For shared global functions.\n        env.globals.update(\n            {\n                \"unlikely_if\": unlikely_if,\n                \"unlikely_or_likely_from\": unlikely_or_likely_from,\n            }\n        )\n\n        env.undefined = jinja2.StrictUndefined\n\n        environments[key] = env\n\n    return environments[key]\n\n\ndef getTemplate(\n    package_name, template_name, template_subdir=\"templates\", extensions=()\n):\n    return getEnvironment(\n        package_name=package_name,\n        template_subdir=template_subdir,\n        extensions=extensions,\n    ).get_template(template_name)\n\n\ndef getTemplateC(\n    package_name, template_name, template_subdir=\"templates_c\", extensions=()\n):\n    return getEnvironment(\n        package_name=package_name,\n        template_subdir=template_subdir,\n        extensions=extensions,\n    ).get_template(template_name)\n\n\ndef getTemplateFromString(template_str):\n    return getEnvironment(\n        package_name=None, template_subdir=None, extensions=()\n    ).from_string(template_str.strip())\n\n\n_template_cache = {}\n\n\ndef renderTemplateFromString(template_str, **kwargs):\n    # Avoid recreating templates, hoping to save some time.\n    if template_str not in _template_cache:\n        _template_cache[template_str] = getTemplateFromString(template_str)\n\n    result = _template_cache[template_str].render(**kwargs)\n\n    # Jinja produces unicode value, but our emission wants str, or else\n    # it messes up. TODO: We might switch to unicode one day or bytes\n    # for Python3 one day, but that seems to much work.\n    if str is not unicode:\n        return result.encode(\"utf8\")\n    else:\n        return result\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Json.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Utils module to provide helper for our common json operations.\n\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport json\n\nfrom .FileOperations import getFileContents, openTextFile\n\n\ndef loadJsonFromFilename(filename):\n    try:\n        return json.loads(getFileContents(filename))\n    except ValueError:\n        return None\n\n\ndef writeJsonToFilename(filename, contents):\n    with openTextFile(filename, \"w\") as output:\n        json.dump(contents, output)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/MacOSApp.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" For macOS application bundle creation\n\n\"\"\"\n\nimport os\n\nfrom nuitka import Options, OutputDirectories\nfrom nuitka.containers.OrderedDicts import OrderedDict\n\nfrom .FileOperations import copyFile, makePath, openTextFile\nfrom .Images import convertImageToIconFormat\n\n\ndef createPlistInfoFile(logger, onefile):\n    # Many details, pylint: disable=too-many-locals\n\n    import plistlib\n\n    if Options.isStandaloneMode():\n        bundle_dir = os.path.dirname(OutputDirectories.getStandaloneDirectoryPath())\n    else:\n        bundle_dir = os.path.dirname(\n            OutputDirectories.getResultRunFilename(onefile=onefile)\n        )\n\n    result_filename = OutputDirectories.getResultFullpath(onefile=onefile)\n    app_name = Options.getMacOSAppName() or os.path.basename(result_filename)\n\n    executable_name = os.path.basename(\n        OutputDirectories.getResultFullpath(onefile=Options.isOnefileMode())\n    )\n\n    signed_app_name = Options.getMacOSSignedAppName() or app_name\n    app_version = Options.getMacOSAppVersion() or \"1.0\"\n\n    # TODO: We want an OrderedDict probably for stability.\n    infos = OrderedDict(\n        [\n            (\"CFBundleDisplayName\", app_name),\n            (\"CFBundleName\", app_name),\n            (\"CFBundleIdentifier\", signed_app_name),\n            (\"CFBundleExecutable\", executable_name),\n            (\"CFBundleInfoDictionaryVersion\", \"6.0\"),\n            (\"CFBundlePackageType\", \"APPL\"),\n            (\"CFBundleShortVersionString\", app_version),\n        ]\n    )\n\n    icon_paths = Options.getMacOSIconPaths()\n\n    if icon_paths:\n        assert len(icon_paths) == 1\n        icon_path = icon_paths[0]\n\n        # Convert to single macOS .icns file if necessary\n        if not icon_path.endswith(\".icns\"):\n            logger.info(\n                \"File '%s' is not in macOS icon format, converting to it.\" % icon_path\n            )\n\n            icon_build_path = os.path.join(\n                OutputDirectories.getSourceDirectoryPath(onefile=onefile),\n                \"icons\",\n            )\n            makePath(icon_build_path)\n            converted_icon_path = os.path.join(\n                icon_build_path,\n                \"Icons.icns\",\n            )\n\n            convertImageToIconFormat(\n                logger=logger,\n                image_filename=icon_path,\n                converted_icon_filename=converted_icon_path,\n            )\n            icon_path = converted_icon_path\n\n        icon_name = os.path.basename(icon_path)\n        resources_dir = os.path.join(bundle_dir, \"Resources\")\n        makePath(resources_dir)\n\n        copyFile(icon_path, os.path.join(resources_dir, icon_name))\n\n        infos[\"CFBundleIconFile\"] = icon_name\n\n    # Console mode, which is why we have to use bundle in the first place typically.\n    if Options.isMacOSBackgroundApp():\n        infos[\"LSBackgroundOnly\"] = True\n    elif Options.isMacOSUiElementApp():\n        infos[\"LSUIElement\"] = True\n    else:\n        infos[\"NSHighResolutionCapable\"] = True\n\n    legal_text = Options.getLegalInformation()\n\n    if legal_text is not None:\n        infos[\"NSHumanReadableCopyright\"] = legal_text\n\n    for resource_name, resource_desc in Options.getMacOSAppProtectedResourcesAccesses():\n        if resource_name in infos:\n            logger.sysexit(\"Duplicate value for '%s' is not allowed.\" % resource_name)\n\n        infos[resource_name] = resource_desc\n\n    filename = os.path.join(bundle_dir, \"Info.plist\")\n\n    if str is bytes:\n        plist_contents = plistlib.writePlistToString(infos)\n    else:\n        plist_contents = plistlib.dumps(infos)\n\n    with openTextFile(filename=filename, mode=\"wb\") as plist_file:\n        plist_file.write(plist_contents)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/MemoryUsage.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tools for tracing memory usage at compiled time.\n\n\"\"\"\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Tracing import memory_logger, printLine\n\nfrom .Utils import isMacOS, isWin32Windows\n\n\ndef getOwnProcessMemoryUsage():\n    \"\"\"Memory usage of own process in bytes.\"\"\"\n\n    if isWin32Windows():\n        # adapted from http://code.activestate.com/recipes/578513\n        import ctypes.wintypes\n\n        # Lets allow this to match Windows API it reflects,\n        # pylint: disable=invalid-name\n        class PROCESS_MEMORY_COUNTERS_EX(ctypes.Structure):\n            _fields_ = [\n                (\"cb\", ctypes.wintypes.DWORD),\n                (\"PageFaultCount\", ctypes.wintypes.DWORD),\n                (\"PeakWorkingSetSize\", ctypes.c_size_t),\n                (\"WorkingSetSize\", ctypes.c_size_t),\n                (\"QuotaPeakPagedPoolUsage\", ctypes.c_size_t),\n                (\"QuotaPagedPoolUsage\", ctypes.c_size_t),\n                (\"QuotaPeakNonPagedPoolUsage\", ctypes.c_size_t),\n                (\"QuotaNonPagedPoolUsage\", ctypes.c_size_t),\n                (\"PagefileUsage\", ctypes.c_size_t),\n                (\"PeakPagefileUsage\", ctypes.c_size_t),\n                (\"PrivateUsage\", ctypes.c_size_t),\n            ]\n\n        GetProcessMemoryInfo = ctypes.windll.psapi.GetProcessMemoryInfo\n        GetProcessMemoryInfo.argtypes = (\n            ctypes.wintypes.HANDLE,\n            ctypes.POINTER(PROCESS_MEMORY_COUNTERS_EX),\n            ctypes.wintypes.DWORD,\n        )\n        GetProcessMemoryInfo.restype = ctypes.wintypes.BOOL\n\n        counters = PROCESS_MEMORY_COUNTERS_EX()\n        rv = GetProcessMemoryInfo(\n            ctypes.windll.kernel32.GetCurrentProcess(),\n            ctypes.byref(counters),\n            ctypes.sizeof(counters),\n        )\n\n        if not rv:\n            raise ctypes.WinError()\n\n        return counters.PrivateUsage\n    else:\n        import resource  # Posix only code, pylint: disable=I0021,import-error\n\n        # The value is from \"getrusage\", which has OS dependent scaling, at least\n        # macOS and Linux are different. Others maybe too.\n        if isMacOS():\n            factor = 1\n        else:\n            factor = 1024\n\n        return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * factor\n\n\ndef getHumanReadableProcessMemoryUsage():\n    return formatMemoryUsageValue(getOwnProcessMemoryUsage())\n\n\nclass MemoryWatch(object):\n    def __init__(self):\n        self.start = getOwnProcessMemoryUsage()\n        self.stop = None\n\n    def finish(self, message):\n        self.stop = getOwnProcessMemoryUsage()\n\n        _logMemoryInfo(message, self.value())\n\n    def asStr(self):\n        return formatMemoryUsageValue(self.value())\n\n    def value(self):\n        return self.stop - self.start\n\n\n_memory_infos = OrderedDict()\n\n\ndef getMemoryInfos():\n    return _memory_infos\n\n\ndef collectMemoryUsageValue(memory_usage_name):\n    assert memory_usage_name not in _memory_infos, memory_usage_name\n    _memory_infos[memory_usage_name] = getOwnProcessMemoryUsage()\n\n    return _memory_infos[memory_usage_name]\n\n\ndef formatMemoryUsageValue(value):\n    if abs(value) < 1024 * 1014:\n        return \"%.2f KB (%d bytes)\" % (value / 1024.0, value)\n    elif abs(value) < 1024 * 1014 * 1024:\n        return \"%.2f MB (%d bytes)\" % (value / (1024 * 1024.0), value)\n    elif abs(value) < 1024 * 1014 * 1024 * 1024:\n        return \"%.2f GB (%d bytes)\" % (value / (1024 * 1024 * 1024.0), value)\n    else:\n        return \"%d bytes\" % value\n\n\ndef _logMemoryInfo(message, memory_usage):\n    if message:\n        memory_logger.info(\"%s: %s\" % (message, formatMemoryUsageValue(memory_usage)))\n\n\ndef reportMemoryUsage(identifier, message):\n    memory_usage = collectMemoryUsageValue(identifier)\n\n    _logMemoryInfo(message, memory_usage)\n\n\ndef startMemoryTracing():\n    try:\n        import tracemalloc\n    except ImportError:\n        pass\n    else:\n        tracemalloc.start()\n\n\ndef showMemoryTrace():\n    try:\n        import tracemalloc\n    except ImportError:\n        pass\n    else:\n        snapshot = tracemalloc.take_snapshot()\n        stats = snapshot.statistics(\"lineno\")\n\n        printLine(\"Top 50 memory allocations:\")\n        for count, stat in enumerate(stats):\n            if count == 50:\n                break\n            printLine(stat)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/ModuleNames.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module names are common string type, which deserves special operations.\n\nThese are used in Nuitka for module and package names in most places, and\nallow to easily make checks on them.\n\n\"\"\"\n\nimport fnmatch\nimport os\n\n\ndef checkModuleName(value):\n    return \"..\" not in str(value) and not (\n        str(value).endswith(\".\") or str(value) == \".\"\n    )\n\n\n# Trigger names for shared use.\npost_module_load_trigger_name = \"-postLoad\"\npre_module_load_trigger_name = \"-preLoad\"\n\ntrigger_names = (pre_module_load_trigger_name, post_module_load_trigger_name)\n\n\ndef makeTriggerModuleName(module_name, trigger_name):\n    assert trigger_name in trigger_names\n\n    return ModuleName(module_name + trigger_name)\n\n\n# Multidist prefix\n_multi_dist_prefix = \"multidist-\"\n\n\ndef makeMultidistModuleName(count, suffix):\n    return ModuleName(\"%s%d-%s\" % (_multi_dist_prefix, count, suffix))\n\n\nclass ModuleName(str):\n    def __init__(self, value):\n        assert checkModuleName(value), value\n\n        # TODO: Disallow some conversion, e.g. from module, function, etc.\n        # objects, and white list what types we accept.\n\n        str.__init__(value)\n\n    @staticmethod\n    def makeModuleNameInPackage(module_name, package_name):\n        \"\"\"Create a module name in a package.\n\n        Args:\n            - module_name (str or ModuleName) module name to put below the package\n            - package_name (str or ModuleName or None) package to put below\n\n        Returns:\n            Module name \"package_name.module_name\" or if \"package_name\" is None\n            then simply \"module_name\".\n\n        Notes:\n            Prefer this factory function over manually duplicating the pattern\n            behind it.\n\n        \"\"\"\n\n        if package_name is not None:\n            return ModuleName(package_name + \".\" + module_name)\n        else:\n            return ModuleName(module_name)\n\n    def __repr__(self):\n        return \"<ModuleName '%s'>\" % str(self)\n\n    def asString(self):\n        \"\"\"Get a simply str value.\n\n        Notes:\n            This should only be used to create constant values for code\n            generation, there is no other reason to lower the type of\n            these values otherwise.\n        \"\"\"\n\n        return str(self)\n\n    def asPath(self):\n        return str(self).replace(\".\", os.path.sep)\n\n    def getPackageName(self):\n        \"\"\"Get the package name if any.\n\n        Returns:\n            ModuleName of the containing package or None if already\n            top level.\n        \"\"\"\n\n        return self.splitModuleBasename()[0]\n\n    def getParentPackageNames(self):\n        \"\"\"Yield parent packages in descending order.\"\"\"\n        parent_packages = []\n\n        parent_package = self.getPackageName()\n        while parent_package is not None:\n            parent_packages.append(parent_package)\n\n            parent_package = parent_package.getPackageName()\n\n        for parent_package in reversed(parent_packages):\n            yield parent_package\n\n    def getRelativePackageName(self, level):\n        result = \".\".join(self.asString().split(\".\")[: -level + 1])\n\n        if result == \"\":\n            return None\n        else:\n            return ModuleName(result)\n\n    def getTopLevelPackageName(self):\n        \"\"\"Get the top level package name.\n\n        Returns:\n            ModuleName of the top level name.\n        \"\"\"\n        package_name = self.getPackageName()\n\n        if package_name is None:\n            return self\n        else:\n            return package_name.getTopLevelPackageName()\n\n    def getBasename(self):\n        \"\"\"Get leaf name of the module without package part.\n\n        Returns:\n            ModuleName without package.\n        \"\"\"\n        return self.splitModuleBasename()[1]\n\n    def splitModuleBasename(self):\n        \"\"\"Split a module into package name and module name.\"\"\"\n\n        if \".\" in self:\n            package_part = ModuleName(self[: self.rfind(\".\")])\n            module_name = ModuleName(self[self.rfind(\".\") + 1 :])\n        else:\n            package_part = None\n            module_name = self\n\n        return package_part, module_name\n\n    def splitPackageName(self):\n        \"\"\"Split a module into the top level package name and remaining module name.\"\"\"\n\n        if \".\" in self:\n            package_part = ModuleName(self[: self.find(\".\")])\n            module_name = ModuleName(self[self.find(\".\") + 1 :])\n        else:\n            package_part = None\n            module_name = self\n\n        return package_part, module_name\n\n    def hasNamespace(self, package_name):\n        return self == package_name or self.isBelowNamespace(package_name)\n\n    def hasOneOfNamespaces(self, *package_names):\n        \"\"\"Check if a module name is below one of many namespaces.\n\n        Args:\n            - package_names: Star argument that allows also lists and tuples\n\n        Returns:\n            bool - module name is below one of the packages.\n        \"\"\"\n\n        for package_name in package_names:\n            if type(package_name) in (tuple, list, set):\n                if self.hasOneOfNamespaces(*package_name):\n                    return True\n            elif self.hasNamespace(package_name):\n                return True\n\n        return False\n\n    def isBelowNamespace(self, package_name):\n        assert type(package_name) in (str, ModuleName), package_name\n\n        # Avoid startswith on these.\n        return str(self).startswith(package_name + \".\")\n\n    def getChildNamed(self, *args):\n        \"\"\"Get a child package with these names added.\"\"\"\n        return ModuleName(\".\".join([self] + list(args)))\n\n    def getSiblingNamed(self, *args):\n        \"\"\"Get a sub-package relative to this child package.\"\"\"\n        return self.getPackageName().getChildNamed(*args)\n\n    def relocateModuleNamespace(self, parent_old, parent_new):\n        \"\"\"Get a module name, where the top level part is translated from old to new.\"\"\"\n        assert self.hasNamespace(parent_old)\n\n        submodule_name_str = str(self)[len(str(parent_old)) + 1 :]\n\n        if submodule_name_str:\n            return ModuleName(parent_new).getChildNamed(submodule_name_str)\n        else:\n            return ModuleName(parent_new)\n\n    def getChildNameFromPackage(self, package_name):\n        \"\"\"Get child a module name part for a name in the package.\"\"\"\n        assert self.hasNamespace(package_name)\n\n        submodule_name_str = str(self)[len(str(package_name)) + 1 :]\n        return ModuleName(submodule_name_str)\n\n    def matchesToShellPattern(self, pattern):\n        \"\"\"Match a module name to a patterns\n\n        Args:\n            pattern:\n                Complies with fnmatch.fnmatch description\n                or also is below the package. So \"*.tests\" will matches to also\n                \"something.tests.MyTest\", thereby allowing to match whole\n                packages with one pattern only.\n        Returns:\n            Tuple of two values, where the first value is the result, second value\n            explains why the pattern matched and how.\n        \"\"\"\n\n        if self == pattern:\n            return True, \"is exact match of '%s'\" % pattern\n        elif self.isBelowNamespace(pattern):\n            return True, \"is package content of '%s'\" % pattern\n        elif fnmatch.fnmatch(self.asString(), pattern):\n            return True, \"matches pattern '%s'\" % pattern\n        elif fnmatch.fnmatch(self.asString(), pattern + \".*\"):\n            return True, \"is package content of match to pattern '%s'\" % pattern\n        else:\n            return False, None\n\n    def matchesToShellPatterns(self, patterns):\n        \"\"\"Match a module name to a list of patterns\n\n        Args:\n            patterns:\n                List of patterns that comply with fnmatch.fnmatch description\n                or also is below the package. So \"*.tests\" will matches to also\n                \"something.tests.MyTest\", thereby allowing to match whole\n                packages with one pattern only.\n        Returns:\n            Tuple of two values, where the first value is the result, second value\n            explains which pattern matched and how.\n        \"\"\"\n\n        for pattern in patterns:\n            match, reason = self.matchesToShellPattern(pattern)\n\n            if match:\n                return match, reason\n\n        # No match result\n        return False, None\n\n    def isFakeModuleName(self):\n        return str(self).endswith(trigger_names)\n\n    def isMultidistModuleName(self):\n        return str(self).startswith(_multi_dist_prefix)\n\n    # Reject APIs being used. TODO: Maybe make this a decorator for reuse.\n    # TODO: Add rsplit and subscript operations too.\n    for _func_name in (\"split\", \"startswith\", \"endswith\", \"__mod__\"):\n        code = \"\"\"\\\ndef %(func_name)s(*args, **kwargs):\n    from nuitka.Errors import NuitkaCodeDeficit\n    raise NuitkaCodeDeficit('''\nDo not use %(func_name)s on ModuleName objects, use e.g.\n.hasNamespace(),\n.getBasename(),\n.getTopLevelPackageName()\n.hasOneOfNamespaces()\n\nCheck API documentation of nuitka.utils.ModuleNames.ModuleName for more\nvariations.\n''')\n\"\"\" % {\n            \"func_name\": _func_name\n        }\n\n        exec(code)  # Avoid code duplication, pylint: disable=exec-used\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/ReExecute.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Ability to restart Nuitka, needed for removing site module effects and using Python PGO after compile.\n\nNote: This avoids imports at all costs, such that initial startup doesn't do more\nthan necessary.\n\nspell-checker: ignore execl, Popen\n\"\"\"\n\nimport os\nimport sys\n\n\ndef callExecProcess(args):\n    \"\"\"Do exec in a portable way preserving exit code.\n\n    On Windows, unfortunately there is no real exec, so we have to spawn\n    a new process instead.\n    \"\"\"\n\n    # We better flush these, \"os.execl\" won't do it anymore.\n    sys.stdout.flush()\n    sys.stderr.flush()\n\n    # On Windows \"os.execl\" does not work properly\n    if os.name == \"nt\":\n        import subprocess\n\n        args = list(args)\n        del args[1]\n\n        try:\n            # Context manager is not available on all Python versions, pylint: disable=consider-using-with\n            process = subprocess.Popen(args=args)\n            process.communicate()\n            # No point in cleaning up, just exit the hard way.\n            try:\n                os._exit(process.returncode)\n            except OverflowError:\n                # Seems negative values go wrong otherwise,\n                # see https://bugs.python.org/issue28474\n                os._exit(process.returncode - 2**32)\n        except KeyboardInterrupt:\n            # There was a more relevant stack trace already, so abort this\n            # right here.\n            os._exit(2)\n    else:\n        # The star arguments is the API of execl\n        os.execl(*args)\n\n\ndef reExecuteNuitka(pgo_filename):\n    # Execute with full path as the process name, so it can find itself and its\n    # libraries.\n    args = [sys.executable, sys.executable]\n\n    if sys.version_info >= (3, 7) and sys.flags.utf8_mode:\n        args += [\"-X\", \"utf8\"]\n\n    if sys.version_info >= (3, 11):\n        args += [\"-X\", \"frozen_modules=off\"]\n\n    if \"nuitka.__main__\" in sys.modules:\n        our_filename = sys.modules[\"nuitka.__main__\"].__file__\n    else:\n        our_filename = sys.modules[\"__main__\"].__file__\n\n    args += [\"-S\", our_filename]\n\n    os.environ[\"NUITKA_BINARY_NAME\"] = sys.modules[\"__main__\"].__file__\n    os.environ[\"NUITKA_PACKAGE_HOME\"] = os.path.dirname(\n        os.path.abspath(sys.modules[\"nuitka\"].__path__[0])\n    )\n\n    if pgo_filename is not None:\n        args.append(\"--pgo-python-input=%s\" % pgo_filename)\n    else:\n        os.environ[\"NUITKA_SYS_PREFIX\"] = sys.prefix\n\n    # Same arguments as before.\n    args += sys.argv[1:]\n\n    from nuitka.importing.PreloadedPackages import (\n        detectPreLoadedPackagePaths,\n        detectPthImportedPackages,\n    )\n\n    os.environ[\"NUITKA_NAMESPACES\"] = repr(detectPreLoadedPackagePaths())\n\n    if \"site\" in sys.modules:\n        site_filename = sys.modules[\"site\"].__file__\n        if site_filename.endswith(\".pyc\"):\n            site_filename = site_filename[:-4] + \".py\"\n\n        os.environ[\"NUITKA_SITE_FILENAME\"] = site_filename\n\n        # Note: As side effect, this might modify the \"sys.path\" too.\n        os.environ[\"NUITKA_PTH_IMPORTED\"] = repr(detectPthImportedPackages())\n\n        user_site = getattr(sys.modules[\"site\"], \"USER_SITE\", None)\n        if user_site is not None:\n            os.environ[\"NUITKA_USER_SITE\"] = repr(user_site)\n\n    os.environ[\"NUITKA_PYTHONPATH\"] = repr(sys.path)\n\n    # In some environments, initial \"sys.path\" does not contain enough to load\n    # \"ast\" module, which however we use to decode \"NUITKA_PYTHONPATH\", this\n    # helps solve the chicken and egg problem.\n    import ast\n\n    os.environ[\"NUITKA_PYTHONPATH_AST\"] = os.path.dirname(ast.__file__)\n\n    if sys.flags.no_site:\n        os.environ[\"NUITKA_NOSITE_FLAG\"] = \"1\"\n\n    os.environ[\"PYTHONHASHSEED\"] = \"0\"\n\n    os.environ[\"NUITKA_REEXECUTION\"] = \"1\"\n\n    # Does not return:\n    callExecProcess(args)\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Rest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Work with ReST documentations.\n\nThis e.g. creates PDF documentations during release and tables from data\nfor the web site, e.g. downloads.\n\n\"\"\"\n\nimport functools\n\n\ndef makeTable(grid):\n    \"\"\"Create a REST table.\"\"\"\n\n    def makeSeparator(num_cols, col_width, header_flag):\n        if header_flag == 1:\n            return num_cols * (\"+\" + (col_width) * \"=\") + \"+\\n\"\n        else:\n            return num_cols * (\"+\" + (col_width) * \"-\") + \"+\\n\"\n\n    def normalizeCell(string, length):\n        return string + ((length - len(string)) * \" \")\n\n    cell_width = 2 + max(\n        functools.reduce(\n            lambda x, y: x + y, [[len(item) for item in row] for row in grid], []\n        )\n    )\n    num_cols = len(grid[0])\n    rst = makeSeparator(num_cols, cell_width, 0)\n    header_flag = 1\n    for row in grid:\n        rst = (\n            rst\n            + \"| \"\n            + \"| \".join([normalizeCell(x, cell_width - 1) for x in row])\n            + \"|\\n\"\n        )\n        rst = rst + makeSeparator(num_cols, cell_width, header_flag)\n        header_flag = 0\n\n    return rst\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/SharedLibraries.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module deals with finding and information about shared libraries.\n\n\"\"\"\n\nimport os\nimport re\nimport sys\n\nfrom nuitka.__past__ import WindowsError  # pylint: disable=I0021,redefined-builtin\nfrom nuitka.__past__ import unicode\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.Options import getMacOSTargetArch, isShowInclusion, isUnstripped\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.Tracing import inclusion_logger, postprocessing_logger\n\nfrom .Execution import (\n    executeToolChecked,\n    withEnvironmentPathAdded,\n    withEnvironmentVarOverridden,\n)\nfrom .FileOperations import (\n    addFileExecutablePermission,\n    changeFilenameExtension,\n    copyFile,\n    getFileList,\n    makeContainingPath,\n    withMadeWritableFileMode,\n)\nfrom .Utils import (\n    isAlpineLinux,\n    isLinux,\n    isMacOS,\n    isWin32Windows,\n    raiseWindowsError,\n)\nfrom .WindowsResources import (\n    RT_MANIFEST,\n    VsFixedFileInfoStructure,\n    deleteWindowsResources,\n    getResourcesFromDLL,\n)\n\n\ndef locateDLLFromFilesystem(name, paths):\n    for path in paths:\n        for root, _dirs, files in os.walk(path):\n            if name in files:\n                return os.path.join(root, name)\n\n\n_ldconfig_usage = \"The 'ldconfig' is used to analyze dependencies on ELF using systems and required to be found.\"\n\n\ndef locateDLL(dll_name):\n    # This function is a case driven by returns, pylint: disable=too-many-return-statements\n    import ctypes.util\n\n    dll_name = ctypes.util.find_library(dll_name)\n\n    if dll_name is None:\n        return None\n\n    # This happens on macOS.\n    if isMacOS() and not os.path.exists(dll_name):\n        return None\n\n    if isWin32Windows() or isMacOS():\n        return os.path.abspath(dll_name)\n\n    if os.path.sep in dll_name:\n        # Use this from ctypes instead of rolling our own.\n        # pylint: disable=protected-access\n\n        so_name = ctypes.util._get_soname(dll_name)\n\n        if so_name is not None:\n            return os.path.join(os.path.dirname(dll_name), so_name)\n        else:\n            return dll_name\n\n    if isAlpineLinux():\n        return locateDLLFromFilesystem(\n            name=dll_name, paths=[\"/lib\", \"/usr/lib\", \"/usr/local/lib\"]\n        )\n\n    with withEnvironmentVarOverridden(\"LANG\", \"C\"):\n        # TODO: Could and probably should cache \"ldconfig -p\" output to avoid forks\n        output = executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"/sbin/ldconfig\", \"-p\"),\n            absence_message=_ldconfig_usage,\n        )\n\n    dll_map = {}\n\n    for line in output.splitlines()[1:]:\n        if line.startswith(b\"Cache generated by:\"):\n            continue\n\n        assert line.count(b\"=>\") == 1, line\n        left, right = line.strip().split(b\" => \")\n        assert b\" (\" in left, line\n        left = left[: left.rfind(b\" (\")]\n\n        if python_version >= 0x300:\n            # spell-checker: ignore getfilesystemencoding\n\n            left = left.decode(sys.getfilesystemencoding())\n            right = right.decode(sys.getfilesystemencoding())\n\n        if left not in dll_map:\n            dll_map[left] = right\n\n    return dll_map[dll_name]\n\n\ndef getSxsFromDLL(filename, with_data=False):\n    \"\"\"List the SxS manifests of a Windows DLL.\n\n    Args:\n        filename: Filename of DLL to investigate\n\n    Returns:\n        List of resource names that are manifests.\n\n    \"\"\"\n\n    return getResourcesFromDLL(\n        filename=filename, resource_kinds=(RT_MANIFEST,), with_data=with_data\n    )\n\n\ndef _removeSxsFromDLL(filename):\n    \"\"\"Remove the Windows DLL SxS manifest.\n\n    Args:\n        filename: Filename to remove SxS manifests from\n    \"\"\"\n    # There may be more files that need this treatment, these are from scans\n    # with the \"find_sxs_modules\" tool. spell-checker: ignore winxpgui\n    if os.path.normcase(os.path.basename(filename)) not in (\n        \"sip.pyd\",\n        \"win32ui.pyd\",\n        \"winxpgui.pyd\",\n    ):\n        return\n\n    res_names = getSxsFromDLL(filename)\n\n    if res_names:\n        deleteWindowsResources(filename, RT_MANIFEST, res_names)\n\n\ndef _getDLLVersionWindows(filename):\n    \"\"\"Return DLL version information from a file.\n\n    If not present, it will be (0, 0, 0, 0), otherwise it will be\n    a tuple of 4 numbers.\n    \"\"\"\n    # Get size needed for buffer (0 if no info)\n    import ctypes.wintypes\n\n    if type(filename) is unicode:\n        GetFileVersionInfoSizeW = ctypes.windll.version.GetFileVersionInfoSizeW\n        GetFileVersionInfoSizeW.argtypes = (\n            ctypes.wintypes.LPCWSTR,\n            ctypes.wintypes.LPDWORD,\n        )\n        GetFileVersionInfoSizeW.restype = ctypes.wintypes.HANDLE\n        size = GetFileVersionInfoSizeW(filename, None)\n    else:\n        size = ctypes.windll.version.GetFileVersionInfoSizeA(filename, None)\n\n    if not size:\n        return (0, 0, 0, 0)\n\n    # Create buffer\n    res = ctypes.create_string_buffer(size)\n    # Load file information into buffer res\n\n    if type(filename) is unicode:\n        # Python3 needs our help here.\n        GetFileVersionInfo = ctypes.windll.version.GetFileVersionInfoW\n        GetFileVersionInfo.argtypes = (\n            ctypes.wintypes.LPCWSTR,\n            ctypes.wintypes.DWORD,\n            ctypes.wintypes.DWORD,\n            ctypes.wintypes.LPVOID,\n        )\n        GetFileVersionInfo.restype = ctypes.wintypes.BOOL\n\n    else:\n        # Python2 just works.\n        GetFileVersionInfo = ctypes.windll.version.GetFileVersionInfoA\n\n    success = GetFileVersionInfo(filename, 0, size, res)\n    # This cannot really fail anymore.\n    assert success\n\n    # Look for code pages\n    VerQueryValueA = ctypes.windll.version.VerQueryValueA\n    VerQueryValueA.argtypes = (\n        ctypes.wintypes.LPCVOID,\n        ctypes.wintypes.LPCSTR,\n        ctypes.wintypes.LPVOID,\n        ctypes.POINTER(ctypes.c_uint32),\n    )\n    VerQueryValueA.restype = ctypes.wintypes.BOOL\n\n    file_info = ctypes.POINTER(VsFixedFileInfoStructure)()\n    uLen = ctypes.c_uint32(ctypes.sizeof(file_info))\n\n    b = VerQueryValueA(res, b\"\\\\\\\\\", ctypes.byref(file_info), ctypes.byref(uLen))\n    if not b:\n        return (0, 0, 0, 0)\n\n    if file_info.contents.dwSignature != 0xFEEF04BD:\n        return (0, 0, 0, 0)\n\n    ms = file_info.contents.dwFileVersionMS\n    ls = file_info.contents.dwFileVersionLS\n\n    return (ms >> 16) & 0xFFFF, ms & 0xFFFF, (ls >> 16) & 0xFFFF, ls & 0xFFFF\n\n\n# spell-checker: ignore readelf\n_readelf_usage = \"The 'readelf' is used to analyse dependencies on ELF using systems and required to be found.\"\n\n\ndef _getSharedLibraryRPATHElf(filename):\n    output = executeToolChecked(\n        logger=postprocessing_logger,\n        command=(\"readelf\", \"-d\", filename),\n        absence_message=_readelf_usage,\n    )\n\n    for line in output.split(b\"\\n\"):\n        # spell-checker: ignore RUNPATH\n        if b\"RPATH\" in line or b\"RUNPATH\" in line:\n            result = line[line.find(b\"[\") + 1 : line.rfind(b\"]\")]\n\n            if str is not bytes:\n                result = result.decode(\"utf8\")\n\n            return result\n\n    return None\n\n\n_otool_output_cache = {}\n\n\ndef _getMacOSArchOption():\n    macos_target_arch = getMacOSTargetArch()\n\n    if macos_target_arch != \"universal\":\n        return (\"-arch\", macos_target_arch)\n    else:\n        return ()\n\n\ndef _getOToolCommandOutput(otool_option, filename):\n    filename = os.path.abspath(filename)\n\n    command = (\"otool\",) + _getMacOSArchOption() + (otool_option, filename)\n\n    if otool_option == \"-L\":\n        cache_key = command, os.getenv(\"DYLD_LIBRARY_PATH\")\n    else:\n        cache_key = command\n\n    if cache_key not in _otool_output_cache:\n        _otool_output_cache[cache_key] = executeToolChecked(\n            logger=postprocessing_logger,\n            command=command,\n            absence_message=\"The 'otool' is used to analyze dependencies on macOS and required to be found.\",\n        )\n\n    return _otool_output_cache[cache_key]\n\n\ndef getOtoolListing(filename):\n    return _getOToolCommandOutput(\"-l\", filename)\n\n\ndef getOtoolDependencyOutput(filename, package_specific_dirs):\n    with withEnvironmentPathAdded(\"DYLD_LIBRARY_PATH\", *package_specific_dirs):\n        return _getOToolCommandOutput(\"-L\", filename)\n\n\ndef _getDLLVersionMacOS(filename):\n    output = _getOToolCommandOutput(\"-D\", filename).splitlines()\n\n    if len(output) < 2:\n        return None\n\n    dll_id = output[1].strip()\n\n    if str is not bytes:\n        dll_id = dll_id.decode(\"utf8\")\n\n    output = _getOToolCommandOutput(\"-L\", filename).splitlines()\n    for line in output:\n        if str is not bytes:\n            line = line.decode(\"utf8\")\n\n        if dll_id in line and \"version\" in line:\n            version_string = re.search(r\"current version (.*)\\)\", line).group(1)\n            return tuple(int(x) for x in version_string.split(\".\"))\n\n    return None\n\n\ndef _getSharedLibraryRPATHDarwin(filename):\n    output = getOtoolListing(filename)\n\n    cmd = b\"\"\n    last_was_load_command = False\n\n    for line in output.split(b\"\\n\"):\n        line = line.strip()\n\n        if cmd == b\"LC_RPATH\":\n            if line.startswith(b\"path \"):\n                result = line[5 : line.rfind(b\"(\") - 1]\n\n                if str is not bytes:\n                    result = result.decode(\"utf8\")\n\n                return result\n\n        if last_was_load_command and line.startswith(b\"cmd \"):\n            cmd = line.split()[1]\n\n        last_was_load_command = line.startswith(b\"Load command\")\n\n    return None\n\n\ndef getSharedLibraryRPATH(filename):\n    if isMacOS():\n        return _getSharedLibraryRPATHDarwin(filename)\n    else:\n        return _getSharedLibraryRPATHElf(filename)\n\n\ndef _filterPatchelfErrorOutput(stderr):\n    stderr = b\"\\n\".join(\n        line\n        for line in stderr.splitlines()\n        if line\n        if b\"warning: working around\" not in line\n    )\n\n    return None, stderr\n\n\n_patchelf_usage = \"\"\"\\\nError, needs 'patchelf' on your system, to modify 'RPATH' settings that \\\nneed to be updated.\"\"\"\n\n\ndef _setSharedLibraryRPATHElf(filename, rpath):\n    # patchelf --set-rpath \"$ORIGIN/path/to/library\" <executable>\n    with withEnvironmentVarOverridden(\"LANG\", \"C\"):\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"patchelf\", \"--set-rpath\", rpath, filename),\n            stderr_filter=_filterPatchelfErrorOutput,\n            absence_message=_patchelf_usage,\n        )\n\n\ndef _filterInstallNameToolErrorOutput(stderr):\n    stderr = b\"\\n\".join(\n        line\n        for line in stderr.splitlines()\n        if line\n        if b\"invalidate the code signature\" not in line\n        if b\"generating fake signature\" not in line\n    )\n\n    return None, stderr\n\n\n_install_name_tool_usage = \"The 'install_name_tool' is used to make binaries portable on macOS and required to be found.\"\n\n\ndef _removeSharedLibraryRPATHDarwin(filename, rpath):\n    executeToolChecked(\n        logger=postprocessing_logger,\n        command=(\"install_name_tool\", \"-delete_rpath\", rpath, filename),\n        absence_message=_install_name_tool_usage,\n        stderr_filter=_filterInstallNameToolErrorOutput,\n    )\n\n\ndef _setSharedLibraryRPATHDarwin(filename, rpath):\n    old_rpath = getSharedLibraryRPATH(filename)\n\n    with withMadeWritableFileMode(filename):\n        if old_rpath is not None:\n            _removeSharedLibraryRPATHDarwin(filename=filename, rpath=old_rpath)\n\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"install_name_tool\", \"-add_rpath\", rpath, filename),\n            absence_message=_install_name_tool_usage,\n            stderr_filter=_filterInstallNameToolErrorOutput,\n        )\n\n\ndef setSharedLibraryRPATH(filename, rpath):\n    if isShowInclusion():\n        inclusion_logger.info(\n            \"Setting 'RPATH' value '%s' for '%s'.\" % (rpath, filename)\n        )\n\n    with withMadeWritableFileMode(filename):\n        if isMacOS():\n            _setSharedLibraryRPATHDarwin(filename, rpath)\n        else:\n            _setSharedLibraryRPATHElf(filename, rpath)\n\n\ndef callInstallNameTool(filename, mapping, id_path, rpath):\n    \"\"\"Update the macOS shared library information for a binary or shared library.\n\n    Adds the rpath path name `rpath` in the specified `filename` Mach-O\n    binary or shared library. If the Mach-O binary already contains the new\n    `rpath` path name, it is an error.\n\n    Args:\n        filename - The file to be modified.\n        mapping  - old_path, new_path pairs of values that should be changed\n        id_path  - Use this value for library id\n        rpath    - Set this as an rpath if not None, delete if False\n\n    Returns:\n        None\n\n    Notes:\n        This is obviously macOS specific.\n    \"\"\"\n    command = [\"install_name_tool\"]\n    for old_path, new_path in mapping:\n        command += (\"-change\", old_path, new_path)\n\n    if rpath is not None:\n        command += (\"-add_rpath\", os.path.join(rpath, \".\"))\n\n    if id_path is not None:\n        command += (\"-id\", id_path)\n\n    command.append(filename)\n\n    with withMadeWritableFileMode(filename):\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=command,\n            absence_message=_install_name_tool_usage,\n            stderr_filter=_filterInstallNameToolErrorOutput,\n        )\n\n\ndef getPyWin32Dir():\n    \"\"\"Find the pywin32 DLL directory\n\n    Args:\n        None\n\n    Returns:\n        path to the pywin32 DLL directory or None\n\n    Notes:\n        This is needed for standalone mode only.\n    \"\"\"\n    # spell-checker: ignore pywin32\n\n    for path_element in sys.path:\n        if not path_element:\n            continue\n\n        candidate = os.path.join(path_element, \"pywin32_system32\")\n\n        if os.path.isdir(candidate):\n            return candidate\n\n\ndef detectBinaryMinMacOS(binary_filename):\n    \"\"\"Detect the minimum required macOS version of a binary.\n\n    Args:\n        binary_filename - path of the binary to check\n\n    Returns:\n        str - minimum OS version that the binary will run on\n\n    \"\"\"\n\n    minos_version = None\n\n    # This is cached, so we don't have to care about that.\n    stdout = getOtoolListing(binary_filename)\n\n    lines = stdout.split(b\"\\n\")\n\n    for i, line in enumerate(lines):\n        # Form one, used by CPython builds.\n        if line.endswith(b\"cmd LC_VERSION_MIN_MACOSX\"):\n            line = lines[i + 2]\n            if str is not bytes:\n                line = line.decode(\"utf8\")\n\n            minos_version = line.split(\"version \", 1)[1]\n            break\n\n        # Form two, used by Apple Python builds.\n        if line.strip().startswith(b\"minos\"):\n            if str is not bytes:\n                line = line.decode(\"utf8\")\n\n            minos_version = line.split(\"minos \", 1)[1]\n            break\n\n    return minos_version\n\n\n_re_dll_filename = re.compile(r\"^.*(\\.(?:dll|so(?:\\..*)|dylib))$\", re.IGNORECASE)\n\n\ndef locateDLLsInDirectory(directory):\n    \"\"\"Locate all DLLs in a folder\n\n    Returns:\n        list of (filename, filename_relative, dll_extension)\n    \"\"\"\n\n    # This needs to be done a bit more manually, because DLLs on Linux can have no\n    # defined suffix, cannot use e.g. only_suffixes for this.\n    result = []\n\n    for filename in getFileList(path=directory):\n        filename_relative = os.path.relpath(filename, start=directory)\n\n        # TODO: Might want to be OS specific on what to match.\n        match = _re_dll_filename.match(filename_relative)\n\n        if match:\n            result.append((filename, filename_relative, match.group(1)))\n\n    return result\n\n\n_file_usage = \"The 'file' tool is used to detect macOS file architectures.\"\n\n_file_output_cache = {}\n\n\ndef _getFileCommandOutput(filename):\n    \"\"\"Cached file output.\"\"\"\n\n    if filename not in _file_output_cache:\n        file_output = executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"file\", filename),\n            absence_message=_file_usage,\n        )\n\n        if str is not bytes:\n            file_output = file_output.decode(\"utf8\")\n\n        assert file_output.startswith(filename + \":\")\n        file_output = file_output[len(filename) + 1 :].splitlines()[0].strip()\n\n        _file_output_cache[filename] = file_output\n\n    return _file_output_cache[filename]\n\n\ndef hasUniversalOrMatchingMacOSArchitecture(filename):\n    assert isMacOS()\n\n    file_output = _getFileCommandOutput(filename)\n\n    return \"universal\" in file_output or getMacOSTargetArch() in file_output\n\n\n# spell-checker: ignore lipo\n\n_lipo_usage = (\n    \"The 'lipo' tool from XCode is used to manage universal binaries on macOS platform.\"\n)\n\n\ndef makeMacOSThinBinary(dest_path, original_path):\n    file_output = _getFileCommandOutput(dest_path)\n\n    macos_target_arch = getMacOSTargetArch()\n\n    if \"universal\" in file_output:\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\n                \"lipo\",\n                \"-thin\",\n                macos_target_arch,\n                dest_path,\n                \"-o\",\n                dest_path + \".tmp\",\n            ),\n            absence_message=_lipo_usage,\n        )\n\n        with withMadeWritableFileMode(dest_path):\n            os.unlink(dest_path)\n            os.rename(dest_path + \".tmp\", dest_path)\n    elif macos_target_arch not in file_output:\n        postprocessing_logger.sysexit(\n            \"Error, cannot use file '%s' (%s) to build arch '%s' result\"\n            % (original_path, file_output, macos_target_arch)\n        )\n\n\ndef copyDllFile(source_path, dist_dir, dest_path, executable):\n    \"\"\"Copy an extension/DLL file making some adjustments on the way.\"\"\"\n\n    target_filename = os.path.join(dist_dir, dest_path)\n    makeContainingPath(target_filename)\n\n    copyFile(source_path=source_path, dest_path=target_filename)\n\n    if isWin32Windows() and python_version < 0x300:\n        _removeSxsFromDLL(target_filename)\n\n    if isMacOS() and getMacOSTargetArch() != \"universal\":\n        makeMacOSThinBinary(dest_path=target_filename, original_path=source_path)\n\n    if isLinux():\n        # Path must be normalized for this to be correct, but entry points enforced that.\n        count = dest_path.count(os.path.sep)\n\n        rpath = os.path.join(\"$ORIGIN\", *([\"..\"] * count))\n        setSharedLibraryRPATH(target_filename, rpath)\n\n    if isWin32Windows() and isUnstripped():\n        pdb_filename = changeFilenameExtension(path=source_path, extension=\".pdb\")\n\n        if os.path.exists(pdb_filename):\n            copyFile(\n                source_path=pdb_filename,\n                dest_path=changeFilenameExtension(\n                    path=target_filename, extension=\".pdb\"\n                ),\n            )\n\n    if isMacOS():\n        # spell-checker: ignore xattr\n\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"xattr\", \"-c\", target_filename),\n            absence_message=\"needs 'xattr' to remove extended attributes\",\n        )\n\n    if executable:\n        addFileExecutablePermission(target_filename)\n\n\ndef getDLLVersion(filename):\n    \"\"\"Determine version of the DLL filename.\"\"\"\n    if isMacOS():\n        return _getDLLVersionMacOS(filename)\n    elif isWin32Windows():\n        return _getDLLVersionWindows(filename)\n\n\ndef getWindowsRunningProcessModuleFilename(handle):\n    \"\"\"Run time lookup of filename of a module in the current Python process.\"\"\"\n\n    import ctypes.wintypes\n\n    MAX_PATH = 4096\n    buf = ctypes.create_unicode_buffer(MAX_PATH)\n\n    GetModuleFileName = ctypes.windll.kernel32.GetModuleFileNameW\n    GetModuleFileName.argtypes = (\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.LPWSTR,\n        ctypes.wintypes.DWORD,\n    )\n    GetModuleFileName.restype = ctypes.wintypes.DWORD\n\n    res = GetModuleFileName(handle, buf, MAX_PATH)\n    if res == 0:\n        raiseWindowsError(\"getWindowsRunningProcessModuleFilename\")\n\n    return os.path.normcase(buf.value)\n\n\ndef _getWindowsRunningProcessModuleHandles():\n    \"\"\"Return list of process module handles for running process.\"\"\"\n    import ctypes.wintypes\n\n    try:\n        EnumProcessModulesProc = ctypes.windll.psapi.EnumProcessModules\n    except AttributeError:\n        EnumProcessModulesProc = ctypes.windll.kernel32.EnumProcessModules\n\n    EnumProcessModulesProc.restype = ctypes.wintypes.BOOL\n    EnumProcessModulesProc.argtypes = (\n        ctypes.wintypes.HANDLE,\n        ctypes.POINTER(ctypes.wintypes.HANDLE),\n        ctypes.wintypes.LONG,\n        ctypes.POINTER(ctypes.wintypes.ULONG),\n    )\n\n    # Very unlikely that this is not sufficient for CPython.\n    handles = (ctypes.wintypes.HANDLE * 1024)()\n    needed = ctypes.wintypes.ULONG()\n\n    res = EnumProcessModulesProc(\n        ctypes.windll.kernel32.GetCurrentProcess(),\n        handles,\n        ctypes.sizeof(handles),\n        ctypes.byref(needed),\n    )\n\n    if not res:\n        raiseWindowsError(\"getWindowsRunningProcessModuleHandles\")\n\n    return tuple(handle for handle in handles if handle is not None)\n\n\ndef getWindowsRunningProcessDLLPaths():\n    result = OrderedDict()\n\n    for handle in _getWindowsRunningProcessModuleHandles():\n        try:\n            filename = getWindowsRunningProcessModuleFilename(handle)\n        except WindowsError:\n            continue\n\n        result[os.path.basename(filename)] = filename\n\n    return result\n\n\n# spell-checker: ignore termux DT_RUNPATH\n_termux_elf_cleaner_usage = (\n    \"Needs 'termux-elf-cleaner' to clean up created files. Install it for best results.\"\n)\n\n\ndef cleanupHeaderForAndroid(filename):\n    \"\"\"Change a DT_RPATH to DT_RUNPATH\n\n    On Android this seems required, because the linker doesn't support the one\n    created by default.\n    \"\"\"\n\n    with withEnvironmentVarOverridden(\"LANG\", \"C\"):\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"patchelf\", \"--shrink-rpath\", filename),\n            stderr_filter=_filterPatchelfErrorOutput,\n            absence_message=_patchelf_usage,\n        )\n\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=(\"termux-elf-cleaner\", \"--quiet\", filename),\n            absence_message=_termux_elf_cleaner_usage,\n            optional=True,\n        )\n\n\n_nm_usage = \"\"\"\\\nError, needs 'nm' on your system, to detect exported DLL symbols.\"\"\"\n\n\ndef getDllExportedSymbols(logger, filename):\n    if isLinux or isMacOS():\n        if isLinux():\n            command = (\"nm\", \"-D\", filename)\n        elif isMacOS():\n            command = (\"nm\", \"-gU\", filename) + _getMacOSArchOption()\n        else:\n            # Need to add e.g. FreeBSD here.\n            assert False\n\n        output = executeToolChecked(\n            logger=logger,\n            command=command,\n            absence_message=_nm_usage,\n        )\n\n        result = OrderedSet()\n        for line in output.splitlines():\n            try:\n                _addr, marker, symbol_name = line.split()\n            except ValueError:\n                continue\n\n            if marker == b\"T\":\n                result.add(symbol_name.decode(\"utf8\"))\n\n        return result\n    else:\n        return None\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Shebang.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Utils to work with shebang lines.\n\n\"\"\"\n\nimport os\nimport re\n\n\ndef getShebangFromSource(source_code):\n    \"\"\"Given source code, extract the shebang (#!) part.\n\n    Notes:\n        This function is less relevant on Windows, because it will not use\n        this method of determining the execution. Still scripts aimed at\n        multiple platforms will contain it and it can be used to e.g. guess\n        the Python version expected, if it is a Python script at all.\n\n        There are variants of the function that will work on filenames instead.\n    Args:\n        source_code: The source code as a unicode string\n    Returns:\n        The binary and arguments that the kernel will use (Linux and compatible).\n    \"\"\"\n\n    if source_code.startswith(\"#!\"):\n        shebang = re.match(r\"^#!\\s*(.*?)\\n\", source_code)\n\n        if shebang is not None:\n            shebang = shebang.group(0).rstrip(\"\\n\")\n    else:\n        shebang = None\n\n    return shebang\n\n\ndef getShebangFromFile(filename):\n    \"\"\"Given a filename, extract the shebang (#!) part from it.\n\n    Notes:\n        This function is less relevant on Windows, because it will not use\n        this method of determining the execution. Still scripts aimed at\n        multiple platforms will contain it and it can be used to e.g. guess\n        the Python version expected, if it is a Python script at all.\n\n        There are variants of the function that will work on file content\n        instead.\n    Args:\n        filename: The filename to get the shebang of\n    Returns:\n        The binary that the kernel will use (Linux and compatible).\n    \"\"\"\n\n    with open(filename, \"rb\") as f:\n        source_code = f.readline()\n\n        if str is not bytes:\n            try:\n                source_code = source_code.decode(\"utf8\")\n            except UnicodeDecodeError:\n                source_code = \"\"\n\n        return getShebangFromSource(source_code)\n\n\ndef parseShebang(shebang):\n    \"\"\"Given a concrete shebang value, it will extract the binary used.\n\n    Notes:\n        This function is less relevant on Windows, because it will not use\n        this method of determining the execution.\n\n        This handles that many times people use `env` binary to search the\n        PATH for an actual binary, e.g. `/usr/bin/env python3.7` where we\n        would care most about the `python3.7` part and want to see through\n        the `env` usage.\n    Args:\n        shebang: The shebang extracted with one of the methods to do so.\n    Returns:\n        The binary the kernel will use (Linux and compatible).\n    \"\"\"\n\n    parts = shebang.split()\n\n    if os.path.basename(parts[0]) == \"env\":\n        # This attempts to handle env with arguments and options.\n        del parts[0]\n\n        while parts[0].startswith(\"-\"):\n            del parts[0]\n\n        while \"=\" in parts[0]:\n            del parts[0]\n\n    return parts[0][2:].lstrip(), parts[1:]\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Signing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Signing of executables.\n\n\"\"\"\n\nfrom nuitka.Options import (\n    getMacOSSigningIdentity,\n    shallUseSigningForNotarization,\n)\nfrom nuitka.Tracing import postprocessing_logger\n\nfrom .Execution import executeToolChecked\nfrom .FileOperations import withMadeWritableFileMode\n\n_macos_codesign_usage = (\n    \"The 'codesign' is used to make signatures on macOS and required to be found.\"\n)\n\n\ndef _filterCodesignErrorOutput(stderr):\n    stderr = b\"\\n\".join(\n        line\n        for line in stderr.splitlines()\n        if line\n        if b\"replacing existing signature\" not in line\n    )\n\n    if b\"errSecInternalComponent\" in stderr:\n        postprocessing_logger.sysexit(\n            \"\"\"\\\nAccess to the specified codesign certificate was not allowed. Please \\\n'allow all items' or when compiling with GUI available, enable prompting \\\nfor the certificate in KeyChain Access application for this certificate.\"\"\"\n        )\n\n    return None, stderr\n\n\ndef detectMacIdentity():\n    output = executeToolChecked(\n        logger=postprocessing_logger,\n        command=[\"security\", \"find-identity\"],\n        absence_message=\"The 'security' program is used to scan for signing identities\",\n    )\n\n    if str is not bytes:\n        output = output.decode(\"utf8\")\n\n    result = None\n\n    for line in output.splitlines():\n        line = line.strip()\n\n        if line.startswith(\"2)\"):\n            postprocessing_logger.sysexit(\n                \"More than one signing identity, auto mode cannot be used.\"\n            )\n\n        if line.startswith(\"1)\"):\n            parts = line.split(\" \", 2)\n\n            result = parts[1]\n            signing_name = parts[2]\n\n    if result is None:\n        postprocessing_logger.sysexit(\n            \"Failed to detect any signing identity, auto mode cannot be used.\"\n        )\n    else:\n        postprocessing_logger.info(\n            \"Using signing identity %s automatically.\" % signing_name\n        )\n\n    return result\n\n\ndef addMacOSCodeSignature(filenames):\n    \"\"\"Add the code signature to filenames.\n\n    Args:\n        filenames - The filenames to be signed.\n\n    Returns:\n        None\n\n    Notes:\n        This is macOS specific.\n    \"\"\"\n\n    # Weak signing.\n    identity = getMacOSSigningIdentity()\n\n    if identity == \"auto\":\n        identity = detectMacIdentity()\n\n    command = [\n        \"codesign\",\n        \"-s\",\n        identity,\n        \"--force\",\n        \"--deep\",\n        \"--preserve-metadata=entitlements\",\n        # ,\n    ]\n\n    if shallUseSigningForNotarization():\n        command.append(\"--options=runtime\")\n\n    assert type(filenames) is not str\n    command.extend(filenames)\n\n    with withMadeWritableFileMode(filenames):\n        executeToolChecked(\n            logger=postprocessing_logger,\n            command=command,\n            absence_message=_macos_codesign_usage,\n            stderr_filter=_filterCodesignErrorOutput,\n        )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/SlotMetaClasses.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Helper for portable metaclasses that do checks. \"\"\"\n\nfrom abc import ABCMeta\n\nfrom nuitka.Errors import NuitkaNodeDesignError\n\n\ndef getMetaClassBase(meta_class_prefix, require_slots):\n    \"\"\"For Python2/3 compatible source, we create a base class that has the metaclass\n    used and doesn't require making a syntax choice.\n\n    Also this allows to enforce the proper usage of \"__slots__\" for all classes using\n    it optionally.\n    \"\"\"\n\n    class MetaClass(ABCMeta):\n        def __new__(\n            mcs, name, bases, dictionary\n        ):  # pylint: disable=I0021,arguments-differ\n            if require_slots:\n                for base in bases:\n                    if base is not object and \"__slots__\" not in base.__dict__:\n                        raise NuitkaNodeDesignError(\n                            name, \"All bases must set __slots__.\", base\n                        )\n\n                if \"__slots__\" not in dictionary:\n                    raise NuitkaNodeDesignError(name, \"Class must set __slots__.\", name)\n\n            return ABCMeta.__new__(mcs, name, bases, dictionary)\n\n    MetaClassBase = MetaClass(\n        \"%sMetaClassBase\" % meta_class_prefix,\n        (object,),\n        {\"__slots__\": ()} if require_slots else {},\n    )\n\n    return MetaClassBase\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/StaticLibraries.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This module deals with finding and information about static libraries.\n\n\"\"\"\n\nimport os\n\nfrom nuitka.containers.OrderedSets import OrderedSet\nfrom nuitka.PythonFlavors import (\n    isAnacondaPython,\n    isDebianPackagePython,\n    isNuitkaPython,\n)\nfrom nuitka.PythonVersions import (\n    getPythonABI,\n    getSystemPrefixPath,\n    python_version,\n    python_version_str,\n)\nfrom nuitka.Tracing import general\n\nfrom .FileOperations import getFileContentByLine, getFileList\nfrom .Utils import getLinuxDistribution, isDebianBasedLinux, isWin32Windows\n\n_ldconf_paths = None\n\n_static_lib_cache = {}\n\n\ndef locateStaticLinkLibrary(dll_name):\n    if dll_name not in _static_lib_cache:\n        _static_lib_cache[dll_name] = _locateStaticLinkLibrary(dll_name)\n\n    return _static_lib_cache[dll_name]\n\n\ndef _locateStaticLinkLibrary(dll_name):\n    # singleton, pylint: disable=global-statement\n    #\n    global _ldconf_paths\n\n    if _ldconf_paths is None:\n        _ldconf_paths = OrderedSet()\n\n        for conf_filemame in getFileList(\"/etc/ld.so.conf.d\", only_suffixes=\".conf\"):\n            for conf_line in getFileContentByLine(conf_filemame):\n                conf_line = conf_line.split(\"#\", 1)[0]\n                conf_line = conf_line.strip()\n\n                if os.path.exists(conf_line):\n                    _ldconf_paths.add(conf_line)\n\n    for ld_config_path in _ldconf_paths:\n        candidate = os.path.join(ld_config_path, \"lib%s.a\" % dll_name)\n\n        if os.path.exists(candidate):\n            return candidate\n\n    return None\n\n\n_static_lib_python_path = False\n\n\ndef isDebianSuitableForStaticLinking():\n    dist_name, _base, dist_version = getLinuxDistribution()\n\n    if dist_name == \"Debian\":\n        if dist_version is None:\n            return True\n\n        try:\n            dist_version = tuple(int(x) for x in dist_version.split(\".\"))\n        except ValueError:\n            # dist_version contains a non-numeric string such as \"sid\".\n            return True\n\n        return dist_version >= (10,)\n    else:\n        # TODO: Needs implementing potentially, Mint etc. are based\n        # on something that should be considered.\n        return True\n\n\ndef _getSysConfigVarLIBPL():\n    # Return the LIBPL config variable, or None if it's not set or retrievable\n    try:\n        import sysconfig\n\n        return sysconfig.get_config_var(\"LIBPL\")\n\n    except ImportError:\n        # Cannot detect this properly for Python 2.6, but we don't care much\n        # about that anyway.\n        return None\n\n\ndef _getSystemStaticLibPythonPath():\n    # Return driven function with many cases, pylint: disable=too-many-branches,too-many-return-statements\n\n    sys_prefix = getSystemPrefixPath()\n    python_abi_version = python_version_str + getPythonABI()\n\n    if isNuitkaPython():\n        # Nuitka Python has this.\n        if isWin32Windows():\n            return os.path.join(\n                sys_prefix,\n                \"libs\",\n                \"python\" + python_abi_version.replace(\".\", \"\") + \".lib\",\n            )\n        else:\n            return os.path.join(\n                sys_prefix,\n                \"lib\",\n                \"libpython\" + python_abi_version + \".a\",\n            )\n\n    if isWin32Windows():\n        # The gcc used on Windows for Anaconda is far too old for winlibs gcc\n        # to use its library.\n        if isAnacondaPython():\n            return None\n\n        candidates = [\n            # Anaconda has this.\n            os.path.join(\n                sys_prefix,\n                \"libs\",\n                \"libpython\" + python_abi_version.replace(\".\", \"\") + \".dll.a\",\n            ),\n            # MSYS2 mingw64 Python has this.\n            os.path.join(\n                sys_prefix,\n                \"lib\",\n                \"libpython\" + python_abi_version + \".dll.a\",\n            ),\n        ]\n\n        for candidate in candidates:\n            if os.path.exists(candidate):\n                return candidate\n    else:\n        candidate = os.path.join(\n            sys_prefix, \"lib\", \"libpython\" + python_abi_version + \".a\"\n        )\n\n        if os.path.exists(candidate):\n            return candidate\n\n        # For Python2 this works. TODO: Figure out Debian and Python3.\n        if (\n            python_version < 0x300\n            and isDebianPackagePython()\n            and isDebianSuitableForStaticLinking()\n        ):\n            candidate = locateStaticLinkLibrary(\"python\" + python_abi_version)\n        else:\n            candidate = None\n\n        if candidate is not None and os.path.exists(candidate):\n            # Also check libz, can be missing\n            if not locateStaticLinkLibrary(\"z\"):\n                general.warning(\n                    \"Error, missing 'libz-dev' installation needed for static lib-python.\"\n                )\n\n            return candidate\n\n        # This is not necessarily only for Python3 on Debian, but maybe others as well,\n        # but that's what's been tested.\n        if python_version >= 0x300 and isDebianPackagePython() and isDebianBasedLinux():\n            candidate = os.path.join(\n                _getSysConfigVarLIBPL(),\n                \"libpython\" + python_abi_version + \"-pic.a\",\n            )\n\n            if os.path.exists(candidate):\n                return candidate\n\n        libpl = _getSysConfigVarLIBPL()\n        if libpl is not None:\n            candidate = os.path.join(\n                libpl,\n                \"libpython\" + python_abi_version + \".a\",\n            )\n\n            if os.path.exists(candidate):\n                return candidate\n\n    return None\n\n\ndef getSystemStaticLibPythonPath():\n    global _static_lib_python_path  # singleton, pylint: disable=global-statement\n\n    if _static_lib_python_path is False:\n        _static_lib_python_path = _getSystemStaticLibPythonPath()\n\n    return _static_lib_python_path\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/ThreadedExecutor.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Threaded pool execution.\n\nThis can use Python3 native, or even Python2.7 backport, or has a Python2.6\nstub that does not thread at all.\n\"\"\"\n\nfrom threading import RLock, current_thread\n\n# Set this to false, to enable actual use of threads. This was found no longer\n# useful with dependency walker, but might be true in other cases.\n_use_threaded_executor = False\n\n\nclass NonThreadedPoolExecutor(object):\n    def __init__(self, max_workers=None):\n        # This stub ignores max_workers, pylint: disable=unused-argument\n\n        self.results = []\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_value, exc_traceback):\n        return False\n\n    def submit(self, function, *args):\n        # Submitted jobs are simply done immediately.\n        self.results.append(function(*args))\n\n        return self\n\n\ndef waitWorkers(workers):\n    if workers:\n        return iter(workers[0].results)\n\n\nThreadPoolExecutor = NonThreadedPoolExecutor\n\n\nif _use_threaded_executor:\n    try:\n        from concurrent.futures import (  # pylint: disable=I0021,import-error,no-name-in-module,unused-import\n            FIRST_EXCEPTION,\n            ThreadPoolExecutor,\n            as_completed,\n            wait,\n        )\n\n        # We overwrite this if wanted, pylint: disable=function-redefined\n        def waitWorkers(workers):\n            wait(workers, return_when=FIRST_EXCEPTION)\n\n            for future in as_completed(workers):\n                yield future.result()\n\n    except ImportError:\n        # No backport installed, use stub for at least Python 2.6, and potentially\n        # also Python 2.7, we might want to tell the user about it though, that\n        # we think it should be installed.\n        pass\n\n\ndef getThreadIdent():\n    return current_thread()\n\n\nassert RLock\nassert ThreadPoolExecutor\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Timing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Time taking.\n\nMostly for measurements of Nuitka of itself, e.g. how long did it take to\ncall an external tool.\n\"\"\"\n\nfrom timeit import default_timer as timer\n\nfrom nuitka.Tracing import general\n\n\nclass StopWatch(object):\n    __slots__ = (\"start_time\", \"end_time\")\n\n    def __init__(self):\n        self.start_time = None\n        self.end_time = None\n\n    def start(self):\n        self.start_time = timer()\n\n    def restart(self):\n        self.start()\n\n    def end(self):\n        self.end_time = timer()\n\n    stop = end\n\n    def getDelta(self):\n        if self.end_time is not None:\n            return self.end_time - self.start_time\n        else:\n            return timer() - self.start_time\n\n\nclass TimerReport(object):\n    \"\"\"Timer that reports how long things took.\n\n    Mostly intended as a wrapper for external process calls.\n    \"\"\"\n\n    __slots__ = (\"message\", \"decider\", \"logger\", \"timer\", \"min_report_time\")\n\n    def __init__(self, message, logger=None, decider=True, min_report_time=None):\n        self.message = message\n\n        # Shortcuts.\n        if decider is True:\n            decider = lambda: 1\n        elif decider is False:\n            decider = lambda: 0\n\n        if logger is None:\n            logger = general\n\n        self.logger = logger\n        self.decider = decider\n        self.min_report_time = min_report_time\n\n        self.timer = None\n\n    def getTimer(self):\n        return self.timer\n\n    def __enter__(self):\n        self.timer = StopWatch()\n        self.timer.start()\n\n        return self.timer\n\n    def __exit__(self, exception_type, exception_value, exception_tb):\n        self.timer.end()\n\n        delta_time = self.timer.getDelta()\n\n        # Check if its above the provided limit.\n        above_threshold = (\n            self.min_report_time is None or delta_time >= self.min_report_time\n        )\n\n        if exception_type is None and above_threshold and self.decider():\n            self.logger.info(self.message % self.timer.getDelta())\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Utils.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Utility module.\n\nHere the small things that fit nowhere else and don't deserve their own module.\n\n\"\"\"\n\nimport ctypes\nimport functools\nimport os\nimport sys\nimport time\nfrom contextlib import contextmanager\n\nfrom nuitka.__past__ import WindowsError  # pylint: disable=I0021,redefined-builtin\n\n\ndef getOS():\n    if os.name == \"nt\":\n        return \"Windows\"\n    elif os.name == \"posix\":\n        result = os.uname()[0]\n\n        # Handle msys2 posix nature still meaning it's Windows.\n        if result.startswith((\"MSYS_NT-\", \"MINGW64_NT-\")):\n            result = \"Windows\"\n\n        return result\n    else:\n        assert False, os.name\n\n\n_linux_distribution_info = None\n\n\ndef _parseOsReleaseFileContents(filename):\n    result = None\n    base = None\n    version = None\n\n    from .FileOperations import getFileContentByLine\n\n    for line in getFileContentByLine(filename):\n        if line.startswith(\"PRETTY_NAME=\") and \"/sid\" in line:\n            version = \"sid\"\n\n        if line.startswith(\"ID=\"):\n            result = line[3:].strip('\"')\n\n        if line.startswith(\"ID_LIKE=\"):\n            base = line[8:].strip('\"').lower()\n\n            if \"ubuntu\" in base:\n                base = \"Ubuntu\"\n            elif \"debian\" in base:\n                base = \"Debian\"\n            elif \"fedora\" in base:\n                base = \"Fedora\"\n\n        if line.startswith(\"VERSION=\"):\n            version = line[8:].strip('\"')\n\n        if \"SUSE Linux Enterprise Server\" in line:\n            result = \"SLES\"  # spell-checker: ignore SLES\n\n    return result, base, version\n\n\ndef getLinuxDistribution():\n    \"\"\"Name of the Linux distribution.\n\n    We should usually avoid this, and rather test for the feature,\n    but in some cases it's hard to manage that.\n    \"\"\"\n    if getOS() != \"Linux\":\n        return None, None, None\n\n    # singleton, pylint: disable=global-statement\n    global _linux_distribution_info\n\n    if _linux_distribution_info is None:\n        result = None\n        base = None\n        version = None\n\n        if os.path.exists(\"/etc/os-release\"):\n            result, base, version = _parseOsReleaseFileContents(\"/etc/os-release\")\n        elif os.path.exists(\"/usr/lib/os-release\"):\n            result, base, version = _parseOsReleaseFileContents(\"/usr/lib/os-release\")\n        elif os.path.exists(\"/etc/SuSE-release\"):\n            result, base, version = _parseOsReleaseFileContents(\"/etc/SuSE-release\")\n        elif os.path.exists(\"/etc/issue\"):\n            result, base, version = _parseOsReleaseFileContents(\"/etc/issue\")\n        elif isAndroidBasedLinux():\n            result = \"Android\"\n\n        if result is None:\n            from .Execution import check_output\n\n            try:\n                result = check_output([\"lsb_release\", \"-i\", \"-s\"], shell=False)\n\n                if str is not bytes:\n                    result = result.decode(\"utf8\")\n            except OSError:\n                pass\n\n        if result is None:\n            from nuitka.Tracing import general\n\n            general.warning(\n                \"Cannot detect Linux distribution, this may prevent optimization.\"\n            )\n            result = \"Unknown\"\n\n        # Change e.g. \"11 (Bullseye)\" to \"11\".\n        if version is not None and version.strip():\n            version = version.strip().split()[0]\n\n        _linux_distribution_info = result.title(), base, version\n\n    return _linux_distribution_info\n\n\ndef getWindowsRelease():\n    if not isWin32OrPosixWindows():\n        return None\n\n    import platform\n\n    return platform.release()\n\n\ndef getMacOSRelease():\n    if not isMacOS():\n        return None\n\n    import platform\n\n    return platform.mac_ver()[0]\n\n\ndef isDebianBasedLinux():\n    dist_name, base, _dist_version = getLinuxDistribution()\n\n    return (base or dist_name) in (\"Debian\", \"Ubuntu\")\n\n\ndef isFedoraBasedLinux():\n    dist_name, base, _dist_version = getLinuxDistribution()\n\n    return (base or dist_name) == \"Fedora\"\n\n\ndef isArchBasedLinux():\n    dist_name, base, _dist_version = getLinuxDistribution()\n\n    return (base or dist_name) == \"Arch\"\n\n\ndef isAndroidBasedLinux():\n    # spell-checker: ignore googlesource\n    if not isLinux():\n        return False\n\n    return \"ANDROID_ROOT\" in os.environ or \"android.googlesource.com\" in sys.version\n\n\ndef isWin32Windows():\n    \"\"\"The Win32 variants of Python does have win32 only, not posix.\"\"\"\n    return os.name == \"nt\"\n\n\ndef isPosixWindows():\n    \"\"\"The MSYS2 variant of Python does have posix only, not Win32.\"\"\"\n    return os.name == \"posix\" and getOS() == \"Windows\"\n\n\ndef isWin32OrPosixWindows():\n    return isWin32Windows() or isPosixWindows()\n\n\ndef isLinux():\n    \"\"\"The Linux OS.\"\"\"\n    return getOS() == \"Linux\"\n\n\ndef isMacOS():\n    \"\"\"The macOS platform.\"\"\"\n    return getOS() == \"Darwin\"\n\n\ndef hasMacOSIntelSupport():\n    \"\"\"macOS with either Intel hardware or Rosetta being installed.\"\"\"\n    return isMacOS() and (\n        getArchitecture() == \"x86_64\"\n        or os.path.exists(\"/Library/Apple/usr/lib/libRosettaAot.dylib\")\n    )\n\n\ndef isNetBSD():\n    \"\"\"The NetBSD OS.\"\"\"\n    return getOS() == \"NetBSD\"\n\n\ndef isFreeBSD():\n    \"\"\"The FreeBSD OS.\"\"\"\n    return getOS() == \"FreeBSD\"\n\n\ndef isOpenBSD():\n    \"\"\"The FreeBSD OS.\"\"\"\n    return getOS() == \"OpenBSD\"\n\n\ndef isBSD():\n    return \"BSD\" in getOS()\n\n\n_is_alpine = None\n\n\ndef isAlpineLinux():\n    if os.name == \"posix\":\n        # Avoid repeated file system lookup, pylint: disable=global-statement\n        global _is_alpine\n        if _is_alpine is None:\n            _is_alpine = os.path.isfile(\"/etc/alpine-release\")\n\n        return _is_alpine\n    else:\n        return False\n\n\ndef getArchitecture():\n    if getOS() == \"Windows\":\n        if \"AMD64\" in sys.version:\n            return \"x86_64\"\n        elif \"ARM64\" in sys.version:\n            return \"arm64\"\n        else:\n            return \"x86\"\n    else:\n        return os.uname()[4]\n\n\ndef getCPUCoreCount():\n    cpu_count = 0\n\n    if getOS() != \"Windows\":\n        # Try to sum up the CPU cores, if the kernel shows them, getting the number\n        # of logical processors\n        try:\n            # Encoding is not needed, pylint: disable=unspecified-encoding\n            with open(\"/proc/cpuinfo\") as cpuinfo_file:\n                cpu_count = cpuinfo_file.read().count(\"processor\\t:\")\n        except IOError:\n            pass\n\n    # Multiprocessing knows the way.\n    if not cpu_count:\n        import multiprocessing\n\n        cpu_count = multiprocessing.cpu_count()\n\n    return cpu_count\n\n\ndef encodeNonAscii(var_name):\n    \"\"\"Encode variable name that is potentially not ASCII to ASCII only.\n\n    For Python3, unicode identifiers can be used, but these are not\n    possible in C, so we need to replace them.\n    \"\"\"\n    if str is bytes:\n        return var_name\n    else:\n        # Using a escaping here, because that makes it safe in terms of not\n        # to occur in the encoding escape sequence for unicode use.\n        var_name = var_name.replace(\"$$\", \"$_$\")\n\n        var_name = var_name.encode(\"ascii\", \"xmlcharrefreplace\")\n        var_name = var_name.decode(\"ascii\")\n\n        return var_name.replace(\"&#\", \"$$\").replace(\";\", \"\")\n\n\ndef hasOnefileSupportedOS():\n    return getOS() in (\"Linux\", \"Windows\", \"Darwin\", \"FreeBSD\")\n\n\ndef hasStandaloneSupportedOS():\n    return getOS() in (\"Linux\", \"Windows\", \"Darwin\", \"FreeBSD\", \"OpenBSD\")\n\n\ndef getUserName():\n    \"\"\"Return the user name.\"\"\"\n    # spell-checker: ignore getpwuid,getuid,getlogin\n    if isWin32Windows():\n        return os.getlogin()\n    else:\n        import pwd  # pylint: disable=I0021,import-error\n\n        return pwd.getpwuid(os.getuid())[0]\n\n\n@contextmanager\ndef withWarningRemoved(category):\n    import warnings\n\n    with warnings.catch_warnings():\n        warnings.filterwarnings(\"ignore\", category=category)\n\n        # These do not inherit from DeprecationWarning by some decision we\n        # are not to care about.\n        if \"pkg_resources\" in sys.modules and category is DeprecationWarning:\n            try:\n                from pkg_resources import PkgResourcesDeprecationWarning\n            except ImportError:\n                pass\n            else:\n                warnings.filterwarnings(\n                    \"ignore\", category=PkgResourcesDeprecationWarning\n                )\n\n        yield\n\n\n@contextmanager\ndef withNoDeprecationWarning():\n    with withWarningRemoved(DeprecationWarning):\n        yield\n\n\n@contextmanager\ndef withNoSyntaxWarning():\n    with withWarningRemoved(SyntaxWarning):\n        yield\n\n\n@contextmanager\ndef withNoWarning():\n    with withWarningRemoved(Warning):\n        yield\n\n\ndef decoratorRetries(\n    logger, purpose, consequence, attempts=5, sleep_time=1, exception_type=OSError\n):\n    \"\"\"Make retries for errors on Windows.\n\n    This executes a decorated function multiple times, and imposes a delay and\n    a virus checker warning.\n    \"\"\"\n\n    def inner(func):\n        if os.name != \"nt\":\n            return func\n\n        @functools.wraps(func)\n        def retryingFunction(*args, **kwargs):\n            for attempt in range(1, attempts + 1):\n                try:\n                    result = func(*args, **kwargs)\n                except exception_type as e:\n                    if not isinstance(e, OSError):\n                        logger.warning(\n                            \"\"\"\\\nFailed to %s in attempt %d due to %s.\nDisable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay.\"\"\"\n                            % (purpose, attempt, str(e))\n                        )\n\n                    else:\n                        if isinstance(e, OSError) and e.errno in (110, 13):\n                            logger.warning(\n                                \"\"\"\\\nFailed to %s in attempt %d.\nDisable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay.\"\"\"\n                                % (purpose, attempt)\n                            )\n                        else:\n                            logger.warning(\n                                \"\"\"\\\nFailed to %s in attempt %d with error code %d.\nDisable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay.\"\"\"\n                                % (purpose, attempt, e.errno)\n                            )\n\n                    time.sleep(sleep_time)\n                    continue\n\n                else:\n                    if attempt != 1:\n                        logger.warning(\n                            \"Succeeded with %s in attempt %d.\" % (purpose, attempt)\n                        )\n\n                    return result\n\n            logger.sysexit(\"Failed to %s, %s.\" % (purpose, consequence))\n\n        return retryingFunction\n\n    return inner\n\n\ndef raiseWindowsError(message):\n    raise WindowsError(\n        ctypes.GetLastError(),\n        \"%s (%s)\" % (message, ctypes.FormatError(ctypes.GetLastError())),\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/WindowsFileUsage.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This is work in progress and hangs unfortunately on some file handles.\n\n\"\"\"\n\nimport ctypes.wintypes\nimport os\n\nfrom nuitka.Tracing import my_print\n\nSTATUS_INFO_LENGTH_MISMATCH = 0xC0000004\nSTATUS_BUFFER_OVERFLOW = 0x80000005\nSTATUS_INVALID_HANDLE = 0xC0000008\nSTATUS_BUFFER_TOO_SMALL = 0xC0000023\n\n\ndef getWindowsAllProcessandles():\n    \"\"\"Return all process system handles.\"\"\"\n\n    i = 2048\n\n    # Lets allow this to match Windows API it reflects,\n    # pylint: disable=invalid-name\n    class SYSTEM_HANDLE(ctypes.Structure):\n        _fields_ = [\n            (\"dwProcessId\", ctypes.wintypes.DWORD),\n            (\"bObjectType\", ctypes.wintypes.BYTE),\n            (\"bFlags\", ctypes.wintypes.BYTE),\n            (\"wValue\", ctypes.wintypes.WORD),\n            (\"pAddress\", ctypes.wintypes.LPVOID),\n            (\"GrantedAccess\", ctypes.wintypes.DWORD),\n        ]\n\n    ctypes.windll.ntdll.ZwQuerySystemInformation.argtypes = (\n        ctypes.c_ulong,\n        ctypes.wintypes.LPVOID,\n        ctypes.c_ulong,\n        ctypes.POINTER(ctypes.c_ulong),\n    )\n    ctypes.windll.ntdll.ZwQuerySystemInformation.restype = ctypes.c_ulong\n\n    return_length = ctypes.c_ulong()\n\n    while True:\n        # Unknown ahead of time, we escalate size structure in order to work on older\n        # Windows versions, that do not return a needed size indication.\n        class SYSTEM_HANDLE_INFORMATION(ctypes.Structure):\n            _fields_ = [(\"HandleCount\", ctypes.c_ulong), (\"Handles\", SYSTEM_HANDLE * i)]\n\n        buf = SYSTEM_HANDLE_INFORMATION()\n\n        rc = ctypes.windll.ntdll.ZwQuerySystemInformation(\n            16,  # SYSTEM_PROCESS_INFORMATION\n            ctypes.byref(buf),\n            ctypes.sizeof(buf),\n            ctypes.byref(return_length),\n        )\n\n        # Retry until it's large enough.\n        if rc == STATUS_INFO_LENGTH_MISMATCH:\n            i *= 2\n\n            continue\n\n        if rc == 0:\n            handles = {}\n\n            for handle in buf.Handles[: buf.HandleCount]:\n                if handle.dwProcessId in handles:\n                    handles[handle.dwProcessId].append(handle.wValue)\n                else:\n                    handles[handle.dwProcessId] = [handle.wValue]\n\n            return handles\n\n        else:\n            raise ctypes.WinError()\n\n\ndef getWindowsFileHandleFilename(handle):\n    # Lets allow this to match Windows API it reflects,\n    # pylint: disable=invalid-name\n\n    class FILE_NAME_INFORMATION(ctypes.Structure):\n        _fields_ = [\n            (\"FileNameLength\", ctypes.wintypes.ULONG),\n            (\"FileName\", ctypes.wintypes.WCHAR * 2048),\n        ]\n\n    class IO_STATUS_BLOCK(ctypes.Structure):\n        class _STATUS(ctypes.Union):\n            _fields_ = (\n                (\"Status\", ctypes.wintypes.DWORD),\n                (\"Pointer\", ctypes.wintypes.LPVOID),\n            )\n\n        _anonymous_ = (\"_Status\",)\n        _fields_ = ((\"_Status\", _STATUS), (\"Information\", ctypes.wintypes.WPARAM))\n\n    PIO_STATUS_BLOCK = ctypes.POINTER(IO_STATUS_BLOCK)\n\n    ctypes.windll.ntdll.NtQueryInformationFile.argtypes = (\n        ctypes.wintypes.HANDLE,\n        PIO_STATUS_BLOCK,\n        ctypes.wintypes.LPVOID,\n        ctypes.wintypes.ULONG,\n        ctypes.wintypes.ULONG,\n    )\n    ctypes.windll.ntdll.NtQueryInformationFile.restype = ctypes.wintypes.DWORD\n\n    file_name_information = FILE_NAME_INFORMATION()\n\n    iosb = IO_STATUS_BLOCK()\n\n    rv = ctypes.windll.ntdll.NtQueryInformationFile(\n        handle,\n        ctypes.byref(iosb),\n        ctypes.byref(file_name_information),\n        2048,\n        9,  # FileNameInformation\n    )\n\n    if rv == 0:\n        return file_name_information.FileName\n    else:\n        return None\n\n\ndef getWindowsAllProcessFileHandles():\n    # Incredibly complicated details, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    # Lets allow this to match Windows API it reflects,\n    # pylint: disable=invalid-name\n\n    class LSA_UNICODE_STRING(ctypes.Structure):\n        _fields_ = [\n            (\"Length\", ctypes.wintypes.USHORT),\n            (\"MaximumLength\", ctypes.wintypes.USHORT),\n            (\"Buffer\", ctypes.wintypes.LPWSTR),\n        ]\n\n    class PUBLIC_OBJECT_TYPE_INFORMATION(ctypes.Structure):\n        _fields_ = [\n            (\"Name\", LSA_UNICODE_STRING),\n            (\"Reserved\", ctypes.wintypes.ULONG * 100),\n        ]\n\n    ctypes.windll.ntdll.NtQueryObject.argtypes = (\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.DWORD,\n        ctypes.POINTER(PUBLIC_OBJECT_TYPE_INFORMATION),\n        ctypes.wintypes.ULONG,\n        ctypes.POINTER(ctypes.wintypes.ULONG),\n    )\n    ctypes.windll.ntdll.NtQueryObject.restype = ctypes.wintypes.DWORD\n\n    ctypes.windll.kernel32.OpenProcess.argtypes = (\n        ctypes.wintypes.DWORD,\n        ctypes.wintypes.BOOL,\n        ctypes.wintypes.DWORD,\n    )\n    ctypes.windll.kernel32.OpenProcess.restype = ctypes.wintypes.HANDLE\n    ctypes.windll.kernel32.GetCurrentProcess.restype = ctypes.wintypes.HANDLE\n\n    ctypes.windll.kernel32.GetFileType.restype = ctypes.wintypes.DWORD\n\n    ctypes.windll.kernel32.DuplicateHandle.argtypes = (\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.LPHANDLE,\n        ctypes.wintypes.DWORD,\n        ctypes.wintypes.BOOL,\n        ctypes.wintypes.DWORD,\n    )\n\n    ctypes.windll.kernel32.DuplicateHandle.restype = ctypes.wintypes.BOOL\n\n    DUPLICATE_SAME_ACCESS = 0x2\n    PROCESS_DUP_HANDLE = 0x0040\n    PROCESS_QUERY_LIMITED_INFORMATION = 0x1000\n\n    ObjectTypeInformation = 2\n\n    psapi = ctypes.WinDLL(\"Psapi.dll\")\n    psapi.GetProcessImageFileNameW.restype = ctypes.wintypes.DWORD\n\n    this_process = ctypes.windll.kernel32.GetCurrentProcess()\n    this_process_id = ctypes.windll.kernel32.GetCurrentProcessId()\n\n    for process, handles in getWindowsAllProcessandles().items():\n        # Ignore ourselves, we do not matter normally.\n\n        if this_process_id == process:\n            continue\n\n        # Need to open processes first\n        process_handle = ctypes.windll.kernel32.OpenProcess(\n            PROCESS_DUP_HANDLE | PROCESS_QUERY_LIMITED_INFORMATION, True, process\n        )\n\n        # Might fail it that ceased to exist.\n        if not process_handle:\n            continue\n\n        ImageFileName = (ctypes.c_wchar * 2048)()\n        rv = psapi.GetProcessImageFileNameW(process_handle, ImageFileName, 2048)\n\n        if rv == 0:\n            # Note: Could also just ignore those.\n            raise ctypes.WinError()\n        process_name = os.path.basename(ImageFileName.value)\n\n        # Ignore programs that will be irrelevant, e.g.g Epic launcher, Firefox as they\n        # don't have interesting stuff. This will only improve performance.\n        if process_name in (\n            \"Code.exe\",\n            \"CodeHelper.exe\",\n            \"RadeonSoftware.exe\",\n            \"vsls-agent.exe\",\n            \"firefox.exe\",\n            \"EpicGamesLauncher.exe\",\n            \"Amazon Music Helper.exe\",\n            \"EpicWebHelper.exe\",\n            \"RuntimeBroker.exe\",\n            \"ShellExperienceHost.exe\",\n            \"StartMenuExperienceHost.exe\",\n            \"devenv.exe\",\n            \"ApplicationFrameHost.exe\",\n            \"cpptools-srv.exe\",\n            \"CompPkgSrv.exe\",\n            \"SettingSyncHost.exe\",\n            \"SecurityHealthSystray.exe\",\n            \"vcpkgsrv.exe\",\n            \"UserOOBEBroker.exe\",\n            \"TextInputHost.exe\",\n            \"sihost.exe\",\n            \"taskhostw.exe\",\n            \"RAVCpl64.exe\",\n            \"PerfWatson2.exe\",\n            \"conhost.exe\",\n            \"bash.exe\",\n            \"cpptools.exe\",\n            \"SystemSettings.exe\",\n            \"LockApp.exe\",\n            \"SearchApp.exe\",\n            \"dllhost.exe\",\n            \"vctip.exe\",\n        ):\n            continue\n        if process_name.startswith(\"ServiceHub.\"):\n            continue\n\n        my_print(\"Process: %s (%d files)\" % (process_name, len(handles)))\n\n        for h in handles:\n            # Create local handles for remote handles first.\n            handle = ctypes.wintypes.HANDLE()\n\n            rv = ctypes.windll.kernel32.DuplicateHandle(\n                process_handle,\n                h,\n                this_process,\n                ctypes.byref(handle),\n                0,\n                0,\n                DUPLICATE_SAME_ACCESS,\n            )\n\n            if rv == 0:\n                # Process or handle might long be invalid, which is OK for us.\n                continue\n\n            if not handle:\n                continue\n\n            public_object_type_information = PUBLIC_OBJECT_TYPE_INFORMATION()\n            size = ctypes.wintypes.DWORD(ctypes.sizeof(public_object_type_information))\n\n            file_type = ctypes.windll.kernel32.GetFileType(handle)\n\n            if file_type != 1:\n                continue\n\n            # my_print(handle)\n            rv = ctypes.windll.ntdll.NtQueryObject(\n                handle,\n                ObjectTypeInformation,\n                ctypes.byref(public_object_type_information),\n                size,\n                None,\n            )\n\n            if rv == 0:\n                kind = public_object_type_information.Name.Buffer\n\n                if kind != \"File\":\n                    continue\n            elif rv == STATUS_INVALID_HANDLE:\n                continue\n            else:\n                assert rv != STATUS_BUFFER_TOO_SMALL\n                assert rv != STATUS_BUFFER_OVERFLOW\n                assert rv != STATUS_INFO_LENGTH_MISMATCH\n\n                assert False, hex(rv)\n\n            r = getWindowsFileHandleFilename(handle)\n\n            ctypes.windll.kernel32.CloseHandle(handle)\n\n            if r:\n                my_print(r)\n\n        ctypes.windll.kernel32.CloseHandle(process_handle)\n\n\nif __name__ == \"__main__\":\n    getWindowsAllProcessFileHandles()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/WindowsResources.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module for handling Windows resources.\n\nNuitka needs to do a couple of things with Windows resources, e.g. adding\nand removing manifests amd copying icon image resources into the created\nbinary. For this purpose, we need to list, remove, add resources and extract\ntheir data.\n\nPreviously we used the Windows SDK tools for this purpose, but for some tasks,\ne.g. deleting unwanted manifest resources for include into the distribution,\nwe needed to do it manually. Also setting icon resources with images for\nmultiple resources proved to be not possible.\n\n\"\"\"\n\nimport ctypes\nimport os\nimport struct\n\nfrom nuitka import TreeXML\n\nfrom .Utils import decoratorRetries\n\n# SxS manifest files resource kind\nRT_MANIFEST = 24\n# Version info\nRT_VERSION = 16\n# Data resource kind\nRT_RCDATA = 10\n# Icon group resource kind\nRT_GROUP_ICON = 14\n# Icon resource kind\nRT_ICON = 3\n\n\ndef getResourcesFromDLL(filename, resource_kinds, with_data=False):\n    \"\"\"Get the resources of a specific kind from a Windows DLL.\n\n    Args:\n        filename - filename where the resources are taken from\n        resource_kinds - tuple of numeric values indicating types of resources\n        with_data - Return value includes data or only the name, lang pairs\n\n    Returns:\n        List of resources in the DLL, see with_data which controls scope.\n\n    \"\"\"\n    # Quite complex stuff, pylint: disable=too-many-locals\n\n    import ctypes.wintypes  # Not really redefined, but extended, pylint: disable=redefined-outer-name\n\n    if type(filename) is str and str is not bytes:\n        LoadLibraryEx = ctypes.windll.kernel32.LoadLibraryExW\n    else:\n        LoadLibraryEx = ctypes.windll.kernel32.LoadLibraryExA\n\n    EnumResourceLanguages = ctypes.windll.kernel32.EnumResourceLanguagesA\n    FreeLibrary = ctypes.windll.kernel32.FreeLibrary\n\n    EnumResourceNameCallback = ctypes.WINFUNCTYPE(\n        ctypes.wintypes.BOOL,\n        ctypes.wintypes.HMODULE,\n        ctypes.wintypes.LONG,\n        ctypes.wintypes.LONG,\n        ctypes.wintypes.LONG,\n    )\n\n    EnumResourceNames = ctypes.windll.kernel32.EnumResourceNamesA\n    EnumResourceNames.argtypes = (\n        ctypes.wintypes.HMODULE,\n        ctypes.wintypes.LPVOID,\n        EnumResourceNameCallback,\n        ctypes.wintypes.LPARAM,\n    )\n\n    DONT_RESOLVE_DLL_REFERENCES = 0x1\n    LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x40\n    LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x20\n\n    hmodule = LoadLibraryEx(\n        filename,\n        0,\n        DONT_RESOLVE_DLL_REFERENCES\n        | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE\n        | LOAD_LIBRARY_AS_IMAGE_RESOURCE,\n    )\n\n    if hmodule == 0:\n        raise ctypes.WinError()\n\n    EnumResourceLanguagesCallback = ctypes.WINFUNCTYPE(\n        ctypes.wintypes.BOOL,\n        ctypes.wintypes.HMODULE,\n        ctypes.wintypes.LONG,\n        ctypes.wintypes.LONG,\n        ctypes.wintypes.WORD,\n        ctypes.wintypes.LONG,\n    )\n\n    result = []\n\n    def callback(hModule, lpType, lpName, _lParam):\n        langs = []\n\n        def callback2(hModule2, lpType2, lpName2, wLang, _lParam):\n            assert hModule2 == hModule\n            assert lpType2 == lpType\n            assert lpName2 == lpName\n\n            langs.append(wLang)\n\n            return True\n\n        EnumResourceLanguages(\n            hModule, lpType, lpName, EnumResourceLanguagesCallback(callback2), 0\n        )\n        # Always pick first one, we should get away with that. On very old Python,\n        # we do not find any, and pick 0.\n        try:\n            lang_id = langs[0]\n        except IndexError:\n            lang_id = 0\n\n        if with_data:\n            hResource = ctypes.windll.kernel32.FindResourceA(hModule, lpName, lpType)\n            size = ctypes.windll.kernel32.SizeofResource(hModule, hResource)\n            hData = ctypes.windll.kernel32.LoadResource(hModule, hResource)\n\n            try:\n                ptr = ctypes.windll.kernel32.LockResource(hData)\n                result.append((lpType, lpName, lang_id, ctypes.string_at(ptr, size)))\n            finally:\n                ctypes.windll.kernel32.FreeResource(hData)\n        else:\n            result.append((lpName, lang_id))\n\n        return True\n\n    for resource_kind in resource_kinds:\n        EnumResourceNames(hmodule, resource_kind, EnumResourceNameCallback(callback), 0)\n\n    FreeLibrary(hmodule)\n    return result\n\n\ndef _openFileWindowsResources(filename):\n    fullpath = os.path.abspath(filename)\n    if type(filename) is str and str is bytes:\n        BeginUpdateResource = ctypes.windll.kernel32.BeginUpdateResourceA\n        BeginUpdateResource.argtypes = (ctypes.wintypes.LPCSTR, ctypes.wintypes.BOOL)\n    else:\n        BeginUpdateResource = ctypes.windll.kernel32.BeginUpdateResourceW\n        BeginUpdateResource.argtypes = (ctypes.wintypes.LPCWSTR, ctypes.wintypes.BOOL)\n\n    BeginUpdateResource.restype = ctypes.wintypes.HANDLE\n\n    update_handle = BeginUpdateResource(fullpath, False)\n\n    if not update_handle:\n        raise ctypes.WinError()\n\n    return update_handle\n\n\ndef _closeFileWindowsResources(update_handle):\n    EndUpdateResource = ctypes.windll.kernel32.EndUpdateResourceA\n    EndUpdateResource.argtypes = (ctypes.wintypes.HANDLE, ctypes.wintypes.BOOL)\n    EndUpdateResource.restype = ctypes.wintypes.BOOL\n\n    ret = EndUpdateResource(update_handle, False)\n\n    if not ret:\n        raise ctypes.WinError()\n\n\ndef _updateWindowsResource(update_handle, resource_kind, res_name, lang_id, data):\n    if data is None:\n        size = 0\n    else:\n        size = len(data)\n\n        assert type(data) is bytes\n\n    UpdateResourceA = ctypes.windll.kernel32.UpdateResourceA\n\n    UpdateResourceA.argtypes = (\n        ctypes.wintypes.HANDLE,\n        ctypes.wintypes.LPVOID,\n        ctypes.wintypes.LPVOID,\n        ctypes.wintypes.WORD,\n        ctypes.wintypes.LPVOID,\n        ctypes.wintypes.DWORD,\n    )\n\n    ret = UpdateResourceA(update_handle, resource_kind, res_name, lang_id, data, size)\n\n    if not ret:\n        raise ctypes.WinError()\n\n\ndef deleteWindowsResources(filename, resource_kind, res_names):\n    update_handle = _openFileWindowsResources(filename)\n\n    for res_name, lang_id in res_names:\n        _updateWindowsResource(update_handle, resource_kind, res_name, lang_id, None)\n\n    _closeFileWindowsResources(update_handle)\n\n\ndef copyResourcesFromFileToFile(source_filename, target_filename, resource_kinds):\n    \"\"\"Copy resources from one file to another.\n\n    Args:\n        source_filename - filename where the resources are taken from\n        target_filename - filename where the resources are added to\n        resource_kinds - tuple of numeric values indicating types of resources\n\n    Returns:\n        int - amount of resources copied, in case you want report\n\n    Notes:\n        Only windows resources are handled. Will not touch target filename\n        unless there are resources in the source.\n\n    \"\"\"\n\n    res_data = getResourcesFromDLL(\n        filename=source_filename, resource_kinds=resource_kinds, with_data=True\n    )\n\n    if res_data:\n        update_handle = _openFileWindowsResources(target_filename)\n\n        for resource_kind, res_name, lang_id, data in res_data:\n            assert resource_kind in resource_kinds\n\n            # Not seeing the point at this time really, but seems to cause troubles otherwise.\n            lang_id = 0\n\n            _updateWindowsResource(\n                update_handle, resource_kind, res_name, lang_id, data\n            )\n\n        _closeFileWindowsResources(update_handle)\n\n    return len(res_data)\n\n\ndef addResourceToFile(target_filename, data, resource_kind, lang_id, res_name, logger):\n    assert os.path.exists(target_filename), target_filename\n\n    @decoratorRetries(\n        logger=logger,\n        purpose=\"add resources to file '%s'\" % target_filename,\n        consequence=\"the result is unusable\",\n    )\n    def _addResourceToFile():\n        update_handle = _openFileWindowsResources(target_filename)\n        _updateWindowsResource(update_handle, resource_kind, res_name, lang_id, data)\n        _closeFileWindowsResources(update_handle)\n\n    _addResourceToFile()\n\n\nclass WindowsExecutableManifest(object):\n    def __init__(self, template):\n        self.tree = TreeXML.fromString(template)\n\n    def addResourceToFile(self, filename, logger):\n        manifest_data = TreeXML.toBytes(self.tree, indent=False)\n\n        addResourceToFile(\n            target_filename=filename,\n            data=manifest_data,\n            resource_kind=RT_MANIFEST,\n            res_name=1,\n            lang_id=0,\n            logger=logger,\n        )\n\n    def addUacAdmin(self):\n        \"\"\"Add indication, the binary should request admin rights.\"\"\"\n        self._getRequestedExecutionLevelNode().attrib[\"level\"] = \"requireAdministrator\"\n\n    def addUacUiAccess(self):\n        \"\"\"Add indication, the binary be allowed for remote desktop.\"\"\"\n        self._getRequestedExecutionLevelNode().attrib[\"uiAccess\"] = \"true\"\n\n    def _getTrustInfoNode(self):\n        # To lazy to figure out proper usage of namespaces, this is good enough for now.\n        for child in self.tree:\n            if child.tag == \"{urn:schemas-microsoft-com:asm.v3}trustInfo\":\n                return child\n\n    def _getTrustInfoSecurityNode(self):\n        return self._getTrustInfoNode()[0]\n\n    def _getRequestedPrivilegesNode(self):\n        # To lazy to figure out proper usage of namespaces, this is good enough for now.\n        for child in self._getTrustInfoSecurityNode():\n            if child.tag == \"{urn:schemas-microsoft-com:asm.v3}requestedPrivileges\":\n                return child\n\n    def _getRequestedExecutionLevelNode(self):\n        # To lazy to figure out proper usage of namespaces, this is good enough for now.\n        for child in self._getRequestedPrivilegesNode():\n            if child.tag == \"{urn:schemas-microsoft-com:asm.v3}requestedExecutionLevel\":\n                return child\n\n\ndef getWindowsExecutableManifest(filename):\n    manifests_data = getResourcesFromDLL(\n        filename=filename, resource_kinds=(RT_MANIFEST,), with_data=True\n    )\n\n    if manifests_data:\n        return WindowsExecutableManifest(manifests_data[0][-1])\n    else:\n        return None\n\n\ndef _getDefaultWindowsExecutableTrustInfo():\n    return \"\"\"\\\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <security>\n      <requestedPrivileges>\n        <requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\"/>\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\"\"\"\n\n\ndef getDefaultWindowsExecutableManifest():\n    # Note: Supported OS are lied about by CPython.\n    template = (\n        \"\"\"\\\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\" xmlns:asmv3=\"urn:schemas-microsoft-com:asm.v3\">\n  <assemblyIdentity type=\"win32\" name=\"Mini\" version=\"1.0.0.0\"/>\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"/>\n      <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"/>\n      <supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n    </application>\n  </compatibility>\n  <asmv3:application>\n    <asmv3:windowsSettings xmlns:ws2=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">\n      <ws2:longPathAware>true</ws2:longPathAware>\n    </asmv3:windowsSettings>\n  </asmv3:application>\n  %s\n</assembly>\n\"\"\"\n        % _getDefaultWindowsExecutableTrustInfo()\n    )\n\n    return WindowsExecutableManifest(template)\n\n\nclass VsFixedFileInfoStructure(ctypes.Structure):\n    _fields_ = [\n        (\"dwSignature\", ctypes.c_uint32),  # 0xFEEF04BD\n        (\"dwStructVersion\", ctypes.c_uint32),\n        (\"dwFileVersionMS\", ctypes.c_uint32),\n        (\"dwFileVersionLS\", ctypes.c_uint32),\n        (\"dwProductVersionMS\", ctypes.c_uint32),\n        (\"dwProductVersionLS\", ctypes.c_uint32),\n        (\"dwFileFlagsMask\", ctypes.c_uint32),\n        (\"dwFileFlags\", ctypes.c_uint32),\n        (\"dwFileOS\", ctypes.c_uint32),\n        (\"dwFileType\", ctypes.c_uint32),\n        (\"dwFileSubtype\", ctypes.c_uint32),\n        (\"dwFileDateMS\", ctypes.c_uint32),\n        (\"dwFileDateLS\", ctypes.c_uint32),\n    ]\n\n\ndef convertStructureToBytes(c_value):\n    \"\"\"Convert ctypes structure to bytes for output.\"\"\"\n\n    result = (ctypes.c_char * ctypes.sizeof(c_value)).from_buffer_copy(c_value)\n    r = b\"\".join(result)\n    assert len(result) == ctypes.sizeof(c_value)\n    return r\n\n\ndef _makeVersionInfoStructure(product_version, file_version, file_date, is_exe):\n    return VsFixedFileInfoStructure(\n        dwSignature=0xFEEF04BD,\n        dwFileVersionMS=file_version[0] << 16 | (file_version[1] & 0xFFFF),\n        dwFileVersionLS=file_version[2] << 16 | (file_version[3] & 0xFFFF),\n        dwProductVersionMS=product_version[0] << 16 | (product_version[1] & 0xFFFF),\n        dwProductVersionLS=product_version[2] << 16 | (product_version[3] & 0xFFFF),\n        dwFileFlagsMask=0x3F,\n        dwFileFlags=0,  # TODO: Could be interesting VS_FF_DEBUG and VS_FF_PRERELEASE.\n        dwFileOS=4,  # NT or higher, hasn't been changed in a long time.\n        dwFileType=1 if is_exe else 2,  #\n        dwFileSubtype=0,  # Not applicable for DLL or EXE, only drivers use this.\n        dwFileDateMS=file_date[0],\n        dwFileDateLS=file_date[1],\n    )\n\n\ndef _getVersionString(value):\n    \"\"\"Encodes string for version information string tables.\n\n    Arguments:\n        value - string to encode\n\n    Returns:\n        bytes - value encoded as utf-16le\n    \"\"\"\n    return value.encode(\"utf-16le\")\n\n\nclass VersionResourceHeader(ctypes.Structure):\n    _fields_ = [\n        (\"full_length\", ctypes.c_short),\n        (\"item_size\", ctypes.c_short),\n        (\"type\", ctypes.c_short),\n    ]\n\n\ndef _makeVersionStringEntry(key, value):\n    key_data = _getVersionString(key)\n    value_data = _getVersionString(value)\n\n    value_size = len(value_data) + 2\n    key_size = 6 + len(key_data) + 2\n\n    pad = b\"\\0\\0\" if key_size % 4 else b\"\"\n    full_size = key_size + len(pad) + value_size\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=full_size,\n            item_size=value_size,\n            type=1,\n        )\n    )\n\n    return header_data + key_data + b\"\\0\\0\" + pad + value_data + b\"\\0\\0\"\n\n\ndef _makeVersionStringTable(values):\n    block_name = _getVersionString(\"000004b0\")\n    size = 6 + len(block_name) + 2\n    pad = b\"\\0\\0\" if size % 4 else b\"\"\n\n    parts = []\n    for key, value in values.items():\n        chunk = _makeVersionStringEntry(key, value)\n\n        if len(chunk) % 4:\n            chunk += b\"\\0\\0\"\n\n        parts.append(chunk)\n\n    block_data = b\"\".join(parts)\n    size += len(block_data)\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=size,\n            item_size=0,\n            type=1,\n        )\n    )\n\n    return header_data + block_name + b\"\\0\\0\" + pad + block_data\n\n\ndef _makeVersionStringBlock(values):\n    block_name = _getVersionString(\"StringFileInfo\")\n    size = 6 + len(block_name) + 2\n    pad = b\"\\0\\0\" if size % 4 else b\"\"\n\n    block_data = _makeVersionStringTable(values)\n\n    size = size + len(pad) + len(block_data)\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=size,\n            item_size=0,\n            type=1,\n        )\n    )\n\n    return header_data + block_name + b\"\\0\\0\" + pad + block_data\n\n\ndef _makeVarFileInfoStruct():\n    block_name = _getVersionString(\"Translation\")\n    size = 6 + len(block_name) + 2\n    pad = b\"\\0\\0\" if size % 4 else b\"\"\n\n    values = [0, 1200]  # Language and code page\n    block_data = struct.pack(\"hh\", *values)\n\n    block_size = len(block_data)\n    size += len(pad) + block_size\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=size,\n            item_size=block_size,\n            type=0,\n        )\n    )\n\n    return header_data + block_name + b\"\\0\\0\" + pad + block_data\n\n\ndef _makeVarFileInfoBlock():\n    block_name = _getVersionString(\"VarFileInfo\")\n    size = 6 + len(block_name) + 2\n    pad = b\"\\0\\0\" if size % 4 else b\"\"\n    block_data = _makeVarFileInfoStruct()\n    size += len(pad) + len(block_data)\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=size,\n            item_size=0,\n            type=1,\n        )\n    )\n\n    return header_data + block_name + b\"\\0\\0\" + pad + block_data\n\n\ndef makeVersionInfoResource(\n    string_values, product_version, file_version, file_date, is_exe\n):\n    # Every item has name and gets padded.\n    block_name = _getVersionString(\"VS_VERSION_INFO\")\n    size = 6 + len(block_name) + 2\n    pad1 = b\"\\0\\0\" if size % 4 else b\"\"\n\n    # First create the static C structure data\n    version_info = _makeVersionInfoStructure(\n        product_version=product_version,\n        file_version=file_version,\n        file_date=file_date,\n        is_exe=is_exe,\n    )\n\n    version_data = convertStructureToBytes(version_info)\n    version_size = len(version_data)\n\n    size += len(pad1) + version_size\n    pad2 = b\"\\0\\0\" if size % 4 else b\"\"\n\n    block_data = _makeVersionStringBlock(string_values) + _makeVarFileInfoBlock()\n\n    size += len(pad2) + len(block_data)\n\n    header_data = convertStructureToBytes(\n        VersionResourceHeader(\n            full_length=size,\n            item_size=version_size,\n            type=0,\n        )\n    )\n\n    return header_data + block_name + b\"\\0\\0\" + pad1 + version_data + pad2 + block_data\n\n\ndef addVersionInfoResource(\n    string_values,\n    product_version,\n    file_version,\n    file_date,\n    is_exe,\n    result_filename,\n    logger,\n):\n    if product_version is None:\n        product_version = file_version\n    if file_version is None:\n        file_version = product_version\n\n    assert product_version\n    assert file_version\n\n    if \"ProductVersion\" not in string_values:\n        string_values[\"ProductVersion\"] = \".\".join(str(d) for d in product_version)\n\n    if \"FileVersion\" not in string_values:\n        string_values[\"FileVersion\"] = \".\".join(str(d) for d in file_version)\n\n    if \"OriginalFilename\" not in string_values:\n        string_values[\"OriginalFilename\"] = os.path.basename(result_filename)\n\n    if \"InternalName\" not in string_values:\n        string_values[\"InternalName\"] = string_values[\"OriginalFilename\"].rsplit(\n            \".\", 1\n        )[0]\n\n    if \"ProductName\" not in string_values:\n        string_values[\"ProductName\"] = string_values[\"InternalName\"]\n\n    if \"FileDescription\" not in string_values:\n        string_values[\"FileDescription\"] = string_values[\"OriginalFilename\"]\n\n    ver_info = makeVersionInfoResource(\n        string_values=string_values,\n        product_version=product_version,\n        file_version=file_version,\n        file_date=file_date,\n        is_exe=is_exe,\n    )\n\n    addResourceToFile(\n        target_filename=result_filename,\n        data=ver_info,\n        resource_kind=RT_VERSION,\n        res_name=1,\n        lang_id=0,\n        logger=logger,\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/Yaml.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Nuitka yaml utility functions.\n\nBecause we want to work with Python2.6 or higher, we play a few tricks with\nwhat library to use for what Python. We have an 2 inline copy of PyYAML, one\nthat still does 2.6 and one for newer Pythons.\n\nAlso we put loading for specific packages in here and a few helpers to work\nwith these config files.\n\"\"\"\n\n# Otherwise \"Yaml\" and \"yaml\" collide on case insensitive setups\nfrom __future__ import absolute_import\n\nimport os\nimport pkgutil\n\nfrom nuitka.containers.OrderedDicts import OrderedDict\nfrom nuitka.Options import getUserProvidedYamlFiles\nfrom nuitka.Tracing import general\n\nfrom .FileOperations import getFileContents\nfrom .Hashing import HashCRC32\nfrom .Importing import importFromInlineCopy\nfrom .ModuleNames import checkModuleName\n\n\nclass PackageConfigYaml(object):\n    __slots__ = (\n        \"name\",\n        \"data\",\n    )\n\n    def __init__(self, name, file_data):\n        self.name = name\n\n        assert type(file_data) is bytes\n        data = parseYaml(file_data)\n        assert type(data) is list\n\n        self.data = OrderedDict()\n\n        for item in data:\n            module_name = item.pop(\"module-name\")\n\n            if not module_name:\n                general.sysexit(\n                    \"Error, invalid config in '%s' looks like an empty module name was given.\"\n                    % (self.name)\n                )\n\n            if \"/\" in module_name:\n                general.sysexit(\n                    \"Error, invalid module name in '%s' looks like a file path '%s'.\"\n                    % (self.name, module_name)\n                )\n\n            if not checkModuleName(module_name):\n                general.sysexit(\n                    \"Error, invalid module name in '%s' not valid '%s'.\"\n                    % (self.name, module_name)\n                )\n\n            if module_name in self.data:\n                general.sysexit(\"Duplicate module-name '%s' encountered.\" % module_name)\n\n            self.data[module_name] = item\n\n    def __repr__(self):\n        return \"<PackageConfigYaml %s>\" % self.name\n\n    def get(self, name, section):\n        \"\"\"Return a configs for that section.\"\"\"\n        result = self.data.get(name)\n\n        if result is not None:\n            result = result.get(section, ())\n        else:\n            result = ()\n\n        # TODO: Ought to become a list universally, but data-files currently\n        # are not, and options-nanny too.\n        if type(result) in (dict, OrderedDict):\n            result = (result,)\n\n        return result\n\n    def keys(self):\n        return self.data.keys()\n\n    def items(self):\n        return self.data.items()\n\n    def update(self, other):\n        # TODO: Full blown merging, including respecting an overload flag, where a config\n        # replaces another one entirely, for now we expect to not overlap.\n        for key, value in other.items():\n            assert key not in self.data, key\n\n            self.data[key] = value\n\n\ndef getYamlPackage():\n    if not hasattr(getYamlPackage, \"yaml\"):\n        try:\n            import yaml\n\n            getYamlPackage.yaml = yaml\n        except ImportError:\n            getYamlPackage.yaml = importFromInlineCopy(\n                \"yaml\", must_exist=True, delete_module=True\n            )\n\n    return getYamlPackage.yaml\n\n\ndef parseYaml(data):\n    yaml = getYamlPackage()\n\n    # Make sure dictionaries are ordered even before 3.6 in the result. We use\n    # them for hashing in caching keys.\n    class OrderedLoader(yaml.SafeLoader):\n        pass\n\n    def construct_mapping(loader, node):\n        loader.flatten_mapping(node)\n\n        return OrderedDict(loader.construct_pairs(node))\n\n    OrderedLoader.add_constructor(\n        yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, construct_mapping\n    )\n\n    return yaml.load(data, OrderedLoader)\n\n\n_yaml_cache = {}\n\n\ndef getYamlDataHash(data):\n    result = HashCRC32()\n    result.updateFromValues(data)\n\n    return result.asHexDigest()\n\n\ndef parsePackageYaml(package_name, filename):\n    key = package_name, filename\n\n    if key not in _yaml_cache:\n        if package_name is None:\n            file_data = getFileContents(filename, mode=\"rb\")\n        else:\n            file_data = pkgutil.get_data(package_name, filename)\n\n        if file_data is None:\n            raise IOError(\"Cannot find %s.%s\" % (package_name, filename))\n\n        _yaml_cache[key] = PackageConfigYaml(name=filename, file_data=file_data)\n\n    return _yaml_cache[key]\n\n\n_package_config = None\n\n\ndef getYamlPackageConfiguration():\n    \"\"\"Get Nuitka package configuration. Merged from multiple sources.\"\"\"\n    # Singleton, pylint: disable=global-statement\n    global _package_config\n\n    if _package_config is None:\n        _package_config = parsePackageYaml(\n            \"nuitka.plugins.standard\",\n            \"standard.nuitka-package.config.yml\",\n        )\n        _package_config.update(\n            parsePackageYaml(\n                \"nuitka.plugins.standard\",\n                \"stdlib2.nuitka-package.config.yml\",\n            )\n        )\n        _package_config.update(\n            parsePackageYaml(\n                \"nuitka.plugins.standard\",\n                \"stdlib3.nuitka-package.config.yml\",\n            )\n        )\n\n        try:\n            _package_config.update(\n                parsePackageYaml(\n                    \"nuitka.plugins.commercial\", \"commercial.nuitka-package.config.yml\"\n                )\n            )\n        except IOError:\n            # No commercial configuration found.\n            pass\n\n        # User or plugin provided filenames, but we want PRs though, and will nag\n        # about it somewhat.\n        for user_yaml_filename in getUserProvidedYamlFiles():\n            _package_config.update(\n                PackageConfigYaml(\n                    name=user_yaml_filename,\n                    file_data=getFileContents(user_yaml_filename, mode=\"rb\"),\n                )\n            )\n\n    return _package_config\n\n\ndef getYamlPackageConfigurationSchemaFilename():\n    \"\"\"Get the filename of the schema for Nuitka package configuration.\"\"\"\n    return os.path.join(\n        os.path.dirname(__file__),\n        \"..\",\n        \"..\",\n        \"misc\",\n        \"nuitka-package-config-schema.json\",\n    )\n\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "nuitka/utils/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Dummy file to make this directory a package. \"\"\"\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "pyproject.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[build-system]\nrequires = [\"setuptools>=42\", \"wheel\"]\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "requirements-devel.txt",
    "content": "# Speed up Nuitka by having this available. On Windows, installing on 2.7 is not\n# working easily, so lets exclude that.\nordered-set == 4.1.0; python_version >= '3.7'\norderedset == 2.0.3 ; os.name != 'nt' and sys.platform != 'darwin' and python_version < '3.7'\norderedset == 2.0.3 ; os.name == 'nt' and python_version >= '3.6' and python_version < '3.7'\norderedset == 2.0.3 ; sys.platform == 'darwin' and python_version < '3.7'\n\n# Make testing more reliable on Python2 with timeout features added.\nsubprocess32 == 3.5.4 ; python_version == '2.7'\n\n# PyLint wouldn't be installable on 2.6 and not work with too old Python3\npylint == 3.0.3 ; python_version >= '3.8'\nastroid == 3.0.2 ; python_version >= '3.8'\n\n# linting rest code snippets\nrestructuredtext-lint==1.4.0 ; python_version >= '3.8'\nPygments == 2.15.1 ; python_version >= '3.8'\nrstcheck == 6.2.0 ; python_version >= '3.8'\n\n# Auto-format needs\nblack == 24.2.0 ; python_version >= '3.8'\ntoml >= 0.10.1 ; python_version >= '3.8'\nisort == 5.13.2 ; python_version >= '3.8'\nyamllint == 1.28.0 ; python_version >= '3.8'\nrstfmt == 0.0.14 ; python_version >= '3.8'\njsonschema == 4.6.0 ; python_version >= '3.8'\nruamel.yaml == 0.17.21 ; python_version >= '3.8'\ndeepdiff == 5.8.1 ; python_version >= '3.8'\nmdformat == 0.7.16 ; python_version >= '3.8'\nmdformat-gfm == 0.3.5 ; python_version >= '3.8'\nmdformat-frontmatter == 2.0.1 ; python_version >= '3.8'\nmdformat-footnote == 0.1.1 ; python_version >= '3.8'\n\n# Codespell can be used as well, no need to fix version\ncodespell ; python_version >= '3.8'\n\n# API doc, doxygen helper for Python\ndoxypypy == 0.8.8.6 ; python_version >= '2.7'\n\n# Run time code generation needs Jinja2 now\nJinja2 == 2.11.3 ; python_version == '2.7'\nJinja2 == 3.1.3 ; python_version >= '3.7'\n\n# For the progress bar to look nicely.\ntqdm == 4.64.1 ; python_version == '2.7' or python_version >= '3.4'\n\n# Distutils test, packaging test for PyPI, fixed for Python2 breakage\n# of newer virtualenv.\nvirtualenv == 16.7.10; python_version == '2.7'\nvirtualenv ; python_version >= '3.5'\n\n# Tests of PyPI packages need that usually.\npytest; python_version == '2.7' or python_version >= '3.4'\n\n# Onefile compression\nzstandard >= 0.15; python_version >= '3.5'\n\n# Plugins need that\npyyaml == 6.0; python_version >= '3.6'\n# Python3.5 was dropped sooner than Python2.\npyyaml == 5.3.1; python_version == '3.5'\npyyaml == 5.4.1; python_version == '2.7'\n\n# Packaging\nwheel\n\npip < 21.0 ; python_version == '2.7'\n"
  },
  {
    "path": "requirements.txt",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n# Folders to use for cache files.\nappdirs\n\n# For the progress bar to look nicely.\ntqdm; python_version == '2.7' or python_version >= '3.4'\n\n# Speed up Nuitka by having this available. On Windows, installing on 2.7 is not\n# working easily, so lets exclude that.\nordered-set == 4.1.0; python_version >= '3.7'\norderedset == 2.0.3 ; os.name != 'nt' and sys.platform != 'darwin' and python_version < '3.7'\norderedset == 2.0.3 ; os.name == 'nt' and python_version >= '3.4' and python_version < '3.7'\norderedset == 2.0.3 ; sys.platform == 'darwin' and python_version < '3.7'\n\n# More capable subprocess.\nsubprocess32; python_version == '2.7'\n\n# Onefile compression\nzstandard >= 0.15; python_version >= '3.5'\n\n# Plugins need that, but there is an inline copy for old versions too.\npyyaml; python_version == '2.7' or python_version >= '3.6'\n\nJinja2 >= 2.10.2\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "rpm/check-osc-status.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for OSC status checker tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.osc_check.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "rpm/make-osc-upload.py",
    "content": "#!/usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Launcher for OSC uploads tool.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), \"..\")))\n\n# isort:start\n\nfrom nuitka.tools.release.osc_upload.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "rpm/nuitka-rpmlintrc",
    "content": "addFilter(\"nuitka.*: devel-file-in-non-devel-package\")\naddFilter(\"nuitka.*: devel-dependency\")\n\naddFilter(\"nuitka.*: files-duplicate /usr/bin/nuitka\")\naddFilter(\"nuitka.*: files-duplicate .*__init__.py\")\naddFilter(\"nuitka.*: files-duplicate .*/man1/\")\n"
  },
  {
    "path": "rpm/nuitka.spec",
    "content": "%if 0%{?rhel} < 8\n# detect python site-packages path, use get_python_lib(0) as nuitka using\n%if 0%{?fedora} < 31\n%global python_sitearch %(%{__python} -c \"import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0))\")\n%endif\n%global python3_sitearch %(%{__python3} -c \"import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0))\")\n%endif\n\n%global _python_bytecompile_errors_terminate_build 0\n\nName:           nuitka\nVersion:        VERSION\nRelease:        5%{?dist}\nSummary:        Python compiler with full language support and CPython compatibility\nGroup:          Development/Languages/Python\nLicense:        Apache-2.0\nURL:            https://nuitka.net/\nSource0:        https://nuitka.net/releases/Nuitka-%{version}.tar.gz\nSource1:        nuitka-rpmlintrc\nBuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)\n%if 0%{?fedora} < 28 && 0%{?rhel} < 8\nBuildRequires:  python\nBuildRequires:  python-devel\nBuildRequires:  python-setuptools\n%endif\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\nBuildRequires:  python-markupsafe\n%endif\n%if 0%{?fedora} >= 24\nBuildRequires:  python-libs\nBuildRequires:  python-debug\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\nBuildRequires:  python3\nBuildRequires:  python3-devel\n%endif\n%if 0%{?rhel} == 8\nBuildRequires:  python36\nBuildRequires:  python36-devel\n%endif\n%if 0%{?fedora} >= 24 || 0%{?rhel} == 8\nBuildRequires:  python3-markupsafe\n%endif\n%if 0%{?suse_version} >= 1500\nBuildRequires:  python3-MarkupSafe\n%if 0%{?sle_version} == 0\nBuildRequires:  openSUSE-release\n%else\nBuildRequires:  dummy-release\n%endif\n%endif\n%if 0%{?fedora} >= 27\nBuildRequires:  python3-tools\n%endif\n%if 0%{?fedora} >= 35 || 0%{?suse_version} >= 1500\nBuildRequires:  python3-setuptools\n%endif\nBuildRequires:  gcc-c++\nBuildRequires:  strace\nBuildRequires:  patchelf\nBuildRequires:  ccache\nBuildRequires:  gdb\n\n%if 0%{?fedora} < 28 && 0%{?rhel} < 8\nRequires:       python-devel\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\nRequires:       python3-devel\n%endif\n%if 0%{?rhel} == 8\nRequires:       python36-devel\n%endif\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\nRequires:       python-markupsafe\n%endif\n%if 0%{?fedora} >= 24 || 0%{?rhel} == 8\nRequires:       python3-markupsafe\n%endif\n%if 0%{?suse_version} >= 1500\nRequires:       python3-MarkupSafe\n%if 0%{?sle_version} == 0\nRequires:       openSUSE-release\n%else\nRequires:       dummy-release\n%endif\n%endif\nRequires:       gcc-c++\nRequires:       strace\nRequires:       patchelf\nRequires:       ccache\n\nBuildArchitectures: noarch\n\n%description\nPython compiler with full language support and CPython compatibility\n\nThis Python compiler achieves full language compatibility and compiles Python\ncode into compiled objects that are not second class at all. Instead they can\nbe used in the same way as pure Python objects.\n\n%prep\n%setup -q -n Nuitka-%{version}\n\n%build\n\npython2=`which python2 2>/dev/null || true`\nif [ \"$python2\" != \"\" ]\nthen\n    python2_version=`$python2 -c \"import sys; print '.'.join(str(s) for s in sys.version_info[0:2])\"`\nfi\npython3=`which python3 2>/dev/null || true`\n\n# Only used on Windows:\nrm -rf nuitka/build/inline_copy/lib/scons-4*\n\nif [ \"$python2_version\" != \"2.6\" ]\nthen\n    # Remove files needed only for Python 2.6, they only cause errors during\n    # compilation with Python3.\n    rm -rf nuitka/build/inline_copy/lib/scons-2.3.2\nelse\n    # Remove files mot needed for Python 2.6, they only cause errors during\n    # compilation with Python 2.6.\n    rm -rf nuitka/build/inline_copy/lib/scons-3.1.2\n    rm -rf nuitka/build/inline_copy/tqdm\nfi\n\n# These are all Windows only or used only there.\nrm -rf nuitka/build/inline_copy/clcache\nrm -rf nuitka/build/inline_copy/atomicwrites\nrm -rf nuitka/build/inline_copy/colorama\n\nif [ \"$python2\" != \"\" ]\nthen\n    python2_version=`$python2 -c \"import sys; print '.'.join(str(s) for s in sys.version_info[0:2])\"`\n    $python2 setup.py build\nfi\n\nif [ \"$python3\" != \"\" ]\nthen\n    $python3 setup.py build\nfi\n\n%check\n\necho \"Environment variables during build:\"\nenv\n\necho \"OS information during build:\"\nif [ -f /etc/os-release ]\nthen\n    echo \"Contents of /etc/os-release :\"\n    cat /etc/os-release\nelse\n    echo \"No /etc/os-release file found\"\nfi\n\nif [ -f /etc/SuSE-release ]\nthen\n    echo \"Contents of /etc/SuSE-release :\"\n    cat /etc/SuSE-release\nelse\n    echo \"No /etc/SuSE-release file found\"\nfi\n\nif [ -f /etc/issue ]\nthen\n    echo \"Contents of /etc/issue :\"\n    cat /etc/issue\nelse\n    echo \"No /etc/issue file found\"\nfi\n\n\nif [ -x \"$(command -v lsb_release)\" ]\nthen\n    lsb_release -a\nelse\n    echo \"No lsb_release binary found\"\nfi\n\n\npython2=`which python2 || true`\n\nif [ \"$python2\" != \"\" ]\nthen\n    echo \"Nuitka Version information\"\n    $python2 -m nuitka.__main__ --version\n    echo \"Basic compilation test of empty module:\"\n    $python2 -m nuitka.__main__ --module --show-scons --run --report=out.xml --experimental=debug-report-traceback tests/basics/EmptyModuleTest.py\n    echo \"Basic compilation test of empty program:\"\n    $python2 -m nuitka.__main__ --show-scons --run --report=compilation-report-exe.xml --experimental=debug-report-traceback tests/basics/EmptyModuleTest.py\n\n    $python2 ./tests/run-tests --skip-reflection-test\nelse\n    echo \"Nuitka Version information\"\n    python3 -m nuitka --version\n    echo \"Basic compilation test of empty module:\"\n    python3 -m nuitka --module --show-scons --run tests/basics/EmptyModuleTest.py\n    echo \"Basic compilation test of empty program:\"\n    python3 -m nuitka --show-scons --run tests/basics/EmptyModuleTest.py\n\n    python3 ./tests/run-tests --skip-reflection-test\nfi\n\n%install\nrm -rf %{buildroot}\n\npython2=`which python2 || true`\npython3=`which python3 || true`\n\nif [ \"$python2\" != \"\" ]\nthen\n    $python2 setup.py install --skip-build --prefix %{_prefix} --root=%{buildroot}\nfi\n\nif [ \"$python3\" != \"\" ]\nthen\n    $python3 setup.py install --skip-build --prefix %{_prefix} --root=%{buildroot}\nfi\n\n%clean\nrm -rf %{buildroot}\n\n%files\n%defattr(-,root,root,-)\n%doc README.rst Changelog.rst\n%if 0%{?fedora} < 31 && 0%{?rhel} < 8\n%{_bindir}/nuitka2\n%{_bindir}/nuitka2-run\n%{python_sitearch}/*\n%endif\n%if 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500\n%{python3_sitearch}/*\n%{_bindir}/nuitka3\n%{_bindir}/nuitka3-run\n%endif\n%if 0%{?rhel} == 8\n/usr/lib/python3.6/site-packages/\n%{_bindir}/nuitka3\n%{_bindir}/nuitka3-run\n%endif\n%changelog\n* Sat Dec 28 2019 Kay Hayen <kay.hayen@gmail.com> - 0.6.7\n- adapted for Fedora31 and CentOS 8, Python3 enhancements\n- added Python3 for openSUSE 15 or higher too.\n\n* Fri Jun 07 2019 Kay Hayen <kay.hayen@gmail.com> - 0.6.4\n- adapted for Fedora30\n\n* Mon Mar 26 2018 Kay Hayen <kay.hayen@gmail.com> - 0.5.29\n- added Python3 packaging\n\n* Sun Sep 08 2013 Kay Hayen <kay.hayen@gmail.com> - 0.4.6\n- changed description to match what we use for Debian\n\n* Fri Mar 15 2013 Kay Hayen <kay.hayen@gmail.com> - 0.4.2\n- addressed complaints from opensuse buildservice\n- moved to group \"/Development/Languages/Python\"\n- no trailing dot for description,\n- man pages also for Python3 related binaries\n\n* Sun Mar 10 2013 ownssh <ownssh@gmail.com> - 0.4.1-3\n- use shortcut files to support python3 (remove python3 base package)\n- change requires python to python-devel\n\n* Thu Mar 07 2013 ownssh <ownssh@gmail.com> - 0.4.1-2\n- Add python3 support\n\n* Thu Mar 07 2013 ownssh <ownssh@gmail.com> - 0.4.1-1\n- Initial packaging of Nuitka as RPM.\n"
  },
  {
    "path": "setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Setup file for Nuitka.\n\nThis applies a few tricks. First, the Nuitka version is read from\nthe source code. Second, the packages are scanned from the filesystem,\nand third, the byte code compilation is avoided for inline copies of\nscons with mismatching Python major versions. Also a binary distribution\nis enforced, to avoid being cached with wrong inline copies for the\nPython version.\n\nspellchecker: ignore chdir,pythonw,tqdm,distutil,atomicwrites,markupsafe\nspellchecker: ignore wininst,distclass,Containerfile,orderedset\n\"\"\"\n\nimport os\nimport sys\n\nos.chdir(os.path.dirname(__file__) or \".\")\nsys.path.insert(0, os.path.abspath(os.getcwd()))\n\n# Disable setuptools warnings before importing it.\nimport warnings\n\nwarnings.filterwarnings(\"ignore\", \"\")\n\n# Don't allow importing this, and make recognizable that\n# the above imports are not to follow. Sometimes code imports\n# setup and then Nuitka ends up including itself.\nif __name__ != \"__main__\":\n    sys.exit(\"Cannot import 'setup' module of Nuitka\")\n\n# isort:start\n\nimport fnmatch\nimport re\n\nfrom setuptools import Distribution, setup\nfrom setuptools.command import easy_install\n\nfrom nuitka.PythonFlavors import isMSYS2MingwPython\nfrom nuitka.utils.FileOperations import getFileList\nfrom nuitka.Version import getNuitkaVersion\n\nversion = getNuitkaVersion()\n\n\ndef findNuitkaPackages():\n    result = []\n\n    for root, dirnames, filenames in os.walk(\"nuitka\"):\n        # Packages must contain \"__init__.py\" or they are merely directories\n        # in Nuitka as we are Python2 compatible.\n        if \"__init__.py\" not in filenames:\n            continue\n\n        # The \"release\" namespace is code used to release, but not itself for\n        # release, same goes for \"quality\".\n        if \"release\" in dirnames:\n            dirnames.remove(\"release\")\n        if \"quality\" in dirnames:\n            dirnames.remove(\"quality\")\n\n        # Handled separately.\n        if \"inline_copy\" in dirnames:\n            dirnames.remove(\"inline_copy\")\n\n        result.append(root.replace(os.path.sep, \".\"))\n\n    return result\n\n\ninline_copy_files = []\nno_byte_compile = []\n\n\ndef addDataFiles(data_files, base_path, do_byte_compile=True):\n    patterns = (\n        \"%s/*.py\" % base_path,\n        \"%s/*/*.py\" % base_path,\n        \"%s/*/*/*.py\" % base_path,\n        \"%s/*/*/*/*.py\" % base_path,\n        \"%s/*/*/*/*/*.py\" % base_path,\n        \"%s/config*\" % base_path,\n        \"%s/LICENSE*\" % base_path,\n        \"%s/*/LICENSE*\" % base_path,\n        \"%s/READ*\" % base_path,\n    )\n\n    data_files.extend(patterns)\n\n    if not do_byte_compile:\n        no_byte_compile.extend(patterns)\n\n\ndef addInlineCopy(name, do_byte_compile=True):\n    if os.getenv(\"NUITKA_NO_INLINE_COPY\", \"0\") == \"1\":\n        return\n\n    addDataFiles(\n        inline_copy_files, \"inline_copy/%s\" % name, do_byte_compile=do_byte_compile\n    )\n\n\naddInlineCopy(\"appdirs\")\naddInlineCopy(\"glob2\")\naddInlineCopy(\"markupsafe\")\naddInlineCopy(\"tqdm\")\n\nsdist_mode = \"sdist\" in sys.argv\ninstall_mode = \"install\" in sys.argv\n\nif os.name == \"nt\" or sdist_mode:\n    addInlineCopy(\"atomicwrites\")\n    addInlineCopy(\"clcache\")\n    addInlineCopy(\"colorama\")\n\nif sys.version_info < (3,) or sdist_mode:\n    addInlineCopy(\"yaml_27\")\nif (3,) < sys.version_info < (3, 6) or sdist_mode:\n    addInlineCopy(\"yaml_35\")\nif sys.version_info >= (3, 6) or sdist_mode:\n    addInlineCopy(\"yaml\")\n\nif sys.version_info < (3, 6) or sdist_mode:\n    addInlineCopy(\"jinja2_35\")\nif sys.version_info >= (3, 6) or sdist_mode:\n    addInlineCopy(\"jinja2\")\n\naddInlineCopy(\"pkg_resources\")\n\n# Scons really only, with historic naming and positioning. Needs to match the\n# \"scons.py\" in bin with respect to versions selection.\naddInlineCopy(\"bin\")\n\nif os.name == \"nt\" or sdist_mode:\n    addInlineCopy(\"lib/scons-4.3.0\", do_byte_compile=sys.version_info >= (3,))\nif (os.name != \"nt\" and sys.version_info < (2, 7)) or sdist_mode:\n    addInlineCopy(\"lib/scons-2.3.2\")\nif (os.name != \"nt\" and sys.version_info >= (2, 7)) or sdist_mode:\n    addInlineCopy(\"lib/scons-3.1.2\")\n\nnuitka_packages = findNuitkaPackages()\n\n# Include extra files\npackage_data = {\n    \"\": [\"*.txt\", \"*.rst\", \"*.c\", \"*.h\", \"*.yml\"],\n    \"nuitka.build\": [\n        \"*.scons\",\n        \"static_src/*.c\",\n        \"static_src/*.cpp\",\n        \"static_src/*/*.c\",\n        \"static_src/*/*.h\",\n        \"inline_copy/zstd/LICENSE.txt\",\n        \"inline_copy/zstd/*.h\",\n        \"inline_copy/zstd/*/*.h\",\n        \"inline_copy/zstd/*/*.c\",\n        \"inline_copy/zlib/LICENSE\",\n        \"inline_copy/zlib/*.h\",\n        \"inline_copy/zlib/*.c\",\n        \"static_src/*/*.asm\",\n        \"static_src/*/*.S\",\n        \"include/*.h\",\n        \"include/*/*.h\",\n        \"include/*/*/*.h\",\n    ]\n    + inline_copy_files,\n    \"nuitka.code_generation\": [\"templates_c/*.j2\"],\n    \"nuitka.reports\": [\"*.j2\"],\n    \"nuitka.plugins.standard\": [\"*/*.c\", \"*/*.py\"],\n}\n\n\nif \"nuitka.plugins.commercial\" in nuitka_packages:\n    commercial_data_files = []\n\n    commercial_plugins_dir = os.path.join(\"nuitka\", \"plugins\", \"commercial\")\n\n    for filename in getFileList(commercial_plugins_dir):\n        filename_relative = os.path.relpath(filename, commercial_plugins_dir)\n\n        if (\n            filename_relative.endswith(\".py\")\n            and os.path.basename(filename_relative) == filename_relative\n        ):\n            continue\n\n        if filename.endswith((\".py\", \".yml\", \".c\", \".h\", \".plk\", \".tmd\")):\n            commercial_data_files.append(filename_relative)\n            continue\n\n        filename_base = os.path.basename(filename_relative)\n\n        if filename_base.startswith(\"LICENSE\"):\n            commercial_data_files.append(filename_relative)\n            continue\n\n    package_data[\"nuitka.plugins.commercial\"] = commercial_data_files\n    package_data[\"nuitka.tools.commercial.container_build\"] = [\"Containerfile\"]\n\ntry:\n    import distutils.util\nexcept ImportError:\n    # Python 3.12 might do this, we need to find out where to disable the\n    # bytecode compilation there.\n    pass\nelse:\n    orig_byte_compile = distutils.util.byte_compile\n\n    def byte_compile(py_files, *args, **kw):\n        # Disable bytecode compilation output, too annoying.\n        kw[\"verbose\"] = 0\n\n        # Avoid attempting files that won't work.\n        py_files = [\n            filename\n            for filename in py_files\n            if not any(\n                fnmatch.fnmatch(filename, \"*/*/*/\" + pattern)\n                for pattern in no_byte_compile\n            )\n        ]\n\n        orig_byte_compile(py_files, *args, **kw)\n\n\ndistutils.util.byte_compile = byte_compile\n\n\n# We monkey patch easy install script generation to not load pkg_resources,\n# which is very slow to launch. This can save one second or more per launch\n# of Nuitka.\nrunner_script_template = \"\"\"\\\n# -*- coding: utf-8 -*-\n# Launcher for Nuitka\n\nimport %(package_name)s\n%(package_name)s.%(function_name)s()\n\"\"\"\n\n\n# This is for newer setuptools:\n@classmethod\ndef get_args(cls, dist, header=None):\n    \"\"\"\n    Yield write_script() argument tuples for a distribution's\n    console_scripts and gui_scripts entry points.\n    \"\"\"\n    if header is None:\n        header = cls.get_header()\n\n    for type_ in \"console\", \"gui\":\n        group = type_ + \"_scripts\"\n\n        for name, ep in dist.get_entry_map(group).items():\n            package_name, function_name = str(ep).split(\"=\")[1].strip().split(\":\")\n\n            script_text = runner_script_template % {\n                \"package_name\": package_name,\n                \"function_name\": function_name,\n            }\n\n            args = cls._get_script_args(type_, name, header, script_text)\n            for res in args:\n                yield res\n\n\ntry:\n    easy_install.ScriptWriter.get_args = get_args\nexcept AttributeError:\n    pass\n\n\n# This is for older setuptools:\ndef get_script_args(dist, executable=os.path.normpath(sys.executable), wininst=False):\n    \"\"\"Yield write_script() argument tuples for a distribution's entrypoints\"\"\"\n    header = easy_install.get_script_header(\"\", executable, wininst)\n    for group in \"console_scripts\", \"gui_scripts\":\n        for name, _ep in dist.get_entry_map(group).items():\n            script_text = runner_script_template\n            if sys.platform == \"win32\" or wininst:\n                # On Windows/wininst, add a .py extension and an .exe launcher\n                if group == \"gui_scripts\":\n                    launcher_type = \"gui\"\n                    ext = \"-script.pyw\"\n                    old = [\".pyw\"]\n                    new_header = re.sub(\"(?i)python.exe\", \"pythonw.exe\", header)\n                else:\n                    launcher_type = \"cli\"\n                    ext = \"-script.py\"\n                    old = [\".py\", \".pyc\", \".pyo\"]\n                    new_header = re.sub(\"(?i)pythonw.exe\", \"python.exe\", header)\n                if (\n                    os.path.exists(new_header[2:-1].strip('\"'))\n                    or sys.platform != \"win32\"\n                ):\n                    hdr = new_header\n                else:\n                    hdr = header\n                yield (name + ext, hdr + script_text, \"t\", [name + x for x in old])\n                yield (\n                    name + \".exe\",\n                    easy_install.get_win_launcher(launcher_type),\n                    \"b\",  # write in binary mode\n                )\n                if not easy_install.is_64bit():\n                    # install a manifest for the launcher to prevent Windows\n                    #  from detecting it as an installer (which it will for\n                    #  launchers like easy_install.exe). Consider only\n                    #  adding a manifest for launchers detected as installers.\n                    #  See Distribute #143 for details.\n                    m_name = name + \".exe.manifest\"\n                    yield (m_name, easy_install.load_launcher_manifest(name), \"t\")\n            else:\n                # On other platforms, we assume the right thing to do is to\n                # just write the stub with no extension.\n                yield (name, header + script_text)\n\n\ntry:\n    easy_install.get_script_args\nexcept AttributeError:\n    pass\nelse:\n    easy_install.get_script_args = get_script_args\n\nbinary_suffix = \"%d\" % sys.version_info[0]\n\nif os.name == \"nt\" and not isMSYS2MingwPython():\n    console_scripts = []\nelse:\n    console_scripts = [\n        \"nuitka%s = nuitka.__main__:main\" % binary_suffix,\n        \"nuitka%s-run = nuitka.__main__:main\" % binary_suffix,\n    ]\n\n    if \"nuitka.plugins.commercial\" in nuitka_packages:\n        console_scripts.append(\n            \"nuitka-decrypt = nuitka.tools.commercial.decrypt.__main__:main\"\n        )\n\nscripts = []\n\n# For Windows, there are batch files to launch Nuitka.\nif os.name == \"nt\" and not isMSYS2MingwPython():\n    scripts += [\"misc/nuitka.bat\", \"misc/nuitka-run.bat\"]\n\n    if \"nuitka.plugins.commercial\" in nuitka_packages:\n        scripts.append(\"misc/nuitka-decrypt.bat\")\n\n\n# With this, we can enforce a binary package.\nclass BinaryDistribution(Distribution):\n    \"\"\"Distribution which always forces a binary package with platform name\"\"\"\n\n    @staticmethod\n    def has_ext_modules():\n        # For \"python setup.py install\" this triggers an attempt to lookup\n        # package dependencies, which fails to work, since it's not yet\n        # installed and might not yet be in PyPI as well.\n        return not install_mode\n\n\nwith open(\"README.rst\", \"rb\") as input_file:\n    long_description = input_file.read().decode(\"utf8\")\n\n    # Need to remove the ..contents etc from the rest, or else PyPI will not render\n    # it.\n    long_description = long_description.replace(\".. contents::\\n\", \"\")\n    long_description = long_description.replace(\n        \".. image:: doc/images/Nuitka-Logo-Symbol.png\\n\", \"\"\n    )\n\ninstall_requires = []\nif sys.version_info >= (3, 7):\n    install_requires.append(\"ordered-set >= 4.1.0\")\nif sys.version_info[:2] == (2, 7):\n    install_requires.append(\"subprocess32\")\nif sys.version_info >= (3, 7):\n    install_requires.append(\"zstandard >= 0.15\")\nif os.name != \"nt\" and sys.platform != \"darwin\" and sys.version_info < (3, 7):\n    install_requires.append(\"orderedset >= 2.0.3\")\nif sys.platform == \"darwin\" and sys.version_info < (3, 7):\n    install_requires.append(\"orderedset >= 2.0.3\")\n\nsetup(\n    name=\"Nuitka\",\n    license=\"Apache License, Version 2.0\",\n    version=version,\n    long_description=long_description,\n    long_description_content_type=\"text/x-rst\",\n    classifiers=[\n        # Nuitka is mature even\n        \"Development Status :: 5 - Production/Stable\",\n        # Indicate who Nuitka is for\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        # Nuitka is a compiler and a build tool as such.\n        \"Topic :: Software Development :: Compilers\",\n        \"Topic :: Software Development :: Build Tools\",\n        # Is has a weak subset of PyLint, but aims for more long term\n        \"Topic :: Software Development :: Quality Assurance\",\n        # Nuitka standalone mode aims at distribution\n        \"Topic :: System :: Software Distribution\",\n        # Python2 supported versions.\n        \"Programming Language :: Python :: 2.6\",\n        \"Programming Language :: Python :: 2.7\",\n        # Python3 supported versions.\n        \"Programming Language :: Python :: 3.4\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Programming Language :: Python :: 3.11\",\n        # We depend on CPython.\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        # We generate C intermediate code and implement part of the\n        # run time environment in C. Actually C11.\n        \"Programming Language :: C\",\n        # Supported OSes are many\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: POSIX :: BSD :: FreeBSD\",\n        \"Operating System :: POSIX :: BSD :: NetBSD\",\n        \"Operating System :: POSIX :: BSD :: OpenBSD\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Operating System :: MacOS\",\n        \"Operating System :: Android\",\n        # License\n        \"License :: OSI Approved :: Apache Software License\",\n    ],\n    packages=nuitka_packages,\n    package_data=package_data,\n    # metadata for upload to PyPI\n    author=\"Kay Hayen\",\n    author_email=\"Kay.Hayen@gmail.com\",\n    url=\"https://nuitka.net\",\n    description=\"\"\"\\\nPython compiler with full language support and CPython compatibility\"\"\",\n    keywords=\"compiler,python,nuitka\",\n    project_urls={\n        \"Commercial\": \"https://nuitka.net/doc/commercial.html\",\n        \"Support\": \"https://nuitka.net/pages/support.html\",\n        \"Documentation\": \"https://nuitka.net/doc/user-manual.html\",\n        \"Donations\": \"https://nuitka.net/pages/donations.html\",\n        \"Mastodon\": \"https://fosstodon.org/@kayhayen\",\n        \"Twitter\": \"https://twitter.com/KayHayen\",\n        \"Source\": \"https://github.com/Nuitka/Nuitka\",\n    },\n    zip_safe=False,\n    scripts=scripts,\n    entry_points={\n        \"distutils.commands\": [\n            \"bdist_nuitka = \\\n             nuitka.distutils.DistutilCommands:bdist_nuitka\",\n            \"build_nuitka = \\\n             nuitka.distutils.DistutilCommands:build\",\n            \"install_nuitka = \\\n             nuitka.distutils.DistutilCommands:install\",\n        ],\n        \"distutils.setup_keywords\": [\n            \"build_with_nuitka = nuitka.distutils.DistutilCommands:setupNuitkaDistutilsCommands\"\n        ],\n        \"console_scripts\": console_scripts,\n    },\n    install_requires=install_requires,\n    # As we do version specific hacks for installed inline copies, make the\n    # wheel version and platform specific.\n    distclass=BinaryDistribution,\n    verbose=0,\n)\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/PyPI-pytest/README.rst",
    "content": "################################################\n Automated Pytest Testing for Top PyPI Packages\n################################################\n\n**********\n Overview\n**********\n\nWhat it does\n============\n\nThe ``run_all.py`` script automates the comparison of pytest results of\na nuitka compiled wheel using ``python setup.py bdist_nuitka`` to the\npytest results of an uncompiled wheel built using ``python setup.py\nbdist_wheel`` for the most popular PyPI packages. Testing is done to\nensure that nuitka is building the wheel correctly. If the pytests\npass/fail in the same way, that means Nuitka built the wheel properly.\nElse if the tests differ, then something is wrong. Virtualenv is used to\ncreate a clean environment with no outside pollution. These tests are\nmeant to be run regularly and will inform if ``Nuitka`` experiences a\nregression.\n\nHow it works\n============\n\nFirst, the script loads information from ``packages.json``. For each\npackage there, it goes to a local cache folder and either updates the\npackage or clones the package into cache using ``git``. The script then\ncreates a ``virtualenv`` and sets up for ``bdist_wheel``. A normal wheel\nis built using the ``bdist_wheel`` command which is then installed.\nNormal pytest is run for the package, and the output is captured into a\nstring. The script then resets the package to its original state and\nsets up for ``bdist_nuitka``. A Nuitka-compiled wheel is then built\nusing the ``bdist_nuitka`` command which is then installed. Pytest is\nrun again for the package, and the output is captured into another\nstring. The two strings of pytest outputs are then compared to see if\nany differences exist.\n\nPackages.json\n=============\n\nThe file containing the packages to be tested and their respective\ninformation.\n\n-  Attributes\n\n   -  ``ignored_tests``: path of tests to be ignored, starting at the\n      base package folder level\n   -  ``[package_name]``: OPTIONAL, specified if a package has a\n      different import package_name\n   -  ``requirements_file``: filename containing requirements to be\n      ``pip`` installed before pytest could be run\n   -  ``url``: URL of the package to be ``git`` cloned or updated\n\n*************\n Basic Usage\n*************\n\nExecute these commands to run all tests\n\n#. ``cd`` into the current folder on terminal\n#. ``python run_all.py``\n\n******************\n Advanced Options\n******************\n\nThe ``run_all.py`` script uses ``SearchModes``, which allows the user to\nspecify different options.\n\nList of options\n===============\n\n-  ``all``\n\n   Run testing for all packages, tallying the number of errors.\n\n   -  Usage: ``python run_all.py all``\n\n-  ``only``\n\n   Run testing for only the package specified.\n\n   -  Usage: ``python run_all.py only [PACKAGE]``\n   -  Example: ``python run_all.py only click``\n\n-  ``search``\n\n   Run tests starting at the package specified, abort if an error is\n   found\n\n   -  Usage: ``python run_all.py search [PACKAGE]``\n   -  Example: ``python run_all.py search click``\n\n-  ``resume``\n\n   Run tests starting at the package where it last left off\n\n   -  Usage: ``python run_all.py resume``\n"
  },
  {
    "path": "tests/PyPI-pytest/packages.json",
    "content": "{\n    \"asn1crypto\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/wbond/asn1crypto.git\"\n    },\n    \"attrs\": {\n        \"ignored_tests\": null,\n        \"package_name\": \"attr\",\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/python-attrs/attrs.git\"\n    },\n    \"cachetools\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/tkem/cachetools.git\"\n    },\n    \"chardet\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/chardet/chardet.git\"\n    },\n    \"click\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/click.git\"\n    },\n    \"colorama\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements-dev.txt\",\n        \"url\": \"https://github.com/tartley/colorama.git\"\n    },\n    \"cryptography\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"dev-requirements.txt\",\n        \"url\": \"https://github.com/pyca/cryptography.git\"\n    },\n    \"dateutil\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements-dev.txt\",\n        \"url\": \"https://github.com/dateutil/dateutil.git\"\n    },\n    \"decorator\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/micheles/decorator.git\"\n    },\n    \"flask\": {\n        \"ignored_tests\": [\n            \"tests/test_instance_config.py\"\n        ],\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/flask.git\"\n    },\n    \"future\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/PythonCharmers/python-future.git\"\n    },\n    \"futures\": {\n        \"ignored_tests\": null,\n        \"package_name\": \"concurrent\",\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/agronholm/pythonfutures.git\"\n    },\n    \"google-auth\": {\n        \"ignored_tests\": null,\n        \"package_name\": \"google\",\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/googleapis/google-auth-library-python.git\"\n    },\n    \"idna\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/kjd/idna.git\"\n    },\n    \"ipaddress\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/phihag/ipaddress.git\"\n    },\n    \"itsdangerous\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/itsdangerous.git\"\n    },\n    \"jinja2\": {\n        \"extra_commands\": [\n            \"cp LICENSE.rst LICENSE\"\n        ],\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/jinja.git\"\n    },\n    \"jmespath\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements.txt\",\n        \"url\": \"https://github.com/jmespath/jmespath.py.git\"\n    },\n    \"markupsafe\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/markupsafe.git\"\n    },\n    \"numpy\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/numpy/numpy.git\"\n    },\n    \"pandas\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements-dev.txt\",\n        \"url\": \"https://github.com/pandas-dev/pandas.git\"\n    },\n    \"pyasn1\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements.txt\",\n        \"url\": \"https://github.com/etingof/pyasn1.git\"\n    },\n    \"pycparser\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/eliben/pycparser.git\"\n    },\n    \"pyparsing\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": \"requirements-dev.txt\",\n        \"url\": \"https://github.com/pyparsing/pyparsing.git\"\n    },\n    \"pytz\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/stub42/pytz.git\"\n    },\n    \"pyyaml\": {\n        \"ignored_tests\": null,\n        \"package_name\": \"yaml\",\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/yaml/pyyaml.git\"\n    },\n    \"requests\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/kennethreitz/requests.git\"\n    },\n    \"rsa\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/sybrenstuvel/python-rsa.git\"\n    },\n    \"simplejson\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/simplejson/simplejson.git\"\n    },\n    \"urllib3\": {\n        \"ignored_tests\": [\n            \"test/test_no_ssl.py\",\n            \"test/with_dummyserver/test_no_ssl.py\"\n        ],\n        \"requirements_file\": \"dev-requirements.txt\",\n        \"url\": \"https://github.com/urllib3/urllib3.git\"\n    },\n    \"werkzeug\": {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/pallets/werkzeug.git\"\n    },\n    \"dill\" : {\n        \"ignored_tests\": null,\n        \"requirements_file\": null,\n        \"url\": \"https://github.com/uqfoundation/dill\"\n    }\n}\n"
  },
  {
    "path": "tests/PyPI-pytest/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Tommy Li, mailto:<tommyli3318@gmail.com> find license text at end of file\n\n\n\"\"\" Runner for PyPI Pytest comparison\n\nThis script automates the comparing of pytest results of a nuitka compiled wheel\nusing `python setup.py bdist_nuitka` to the pytest results of an uncompiled wheel\nbuilt using `python setup.py bdist_wheel` for the most popular PyPI packages.\nTesting is done to ensure that nuitka is building the wheel correctly. If the\npytests pass/fail in the same way, that means Nuitka built the wheel properly.\nElse if the tests differ, then something is wrong.\nVirtualenv is used to create a clean environment with no outside pollution.\n\n\"\"\"\n\nimport json\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport nuitka\nfrom nuitka.tools.environments.Virtualenv import withVirtualenv\nfrom nuitka.tools.testing.Common import (\n    createSearchMode,\n    my_print,\n    reportSkip,\n    setup,\n)\nfrom nuitka.tools.testing.OutputComparison import compareOutput\nfrom nuitka.utils.AppDirs import getCacheDir\nfrom nuitka.utils.FileOperations import getFileContents\n\n\ndef executeCommand(command):\n    my_print(\"Executing:\", command, style=\"blue\")\n\n    return os.system(command) == 0\n\n\ndef gitClone(package, url, directory):\n    \"\"\"\n    Update package with git if already existing in directory\n    else git clone the package into directory\n    \"\"\"\n\n    os.chdir(directory)\n    if not executeCommand(\n        \"cd %s && git fetch -q && git reset -q --hard origin && git clean -q -dfx\"\n        % package\n    ):\n        assert executeCommand(\n            \"git clone %s %s --depth 1 --single-branch --no-tags\" % (url, package)\n        ), (\"Error while git cloning package %s, aborting...\" % package)\n\n\ndef main():\n    # pylint: disable=broad-except,too-many-branches,too-many-locals,too-many-statements\n\n    setup(suite=\"pypi\")\n\n    # cache_dir is where the git clones are cached\n    cache_dir = getCacheDir(\"pypi-git-clones\")\n    base_dir = os.getcwd()\n\n    if not os.path.isdir(cache_dir):\n        os.mkdir(cache_dir)\n\n    search_mode = createSearchMode()\n\n    results = []\n\n    # load json\n    packages = json.load(getFileContents(\"packages.json\"))\n\n    for package_name, details in sorted(packages.items()):\n        active = search_mode.consider(dirname=None, filename=package_name)\n\n        if not active:\n            continue\n\n        if str is not bytes:\n            # running on python3\n            if package_name in (\"futures\", \"future\"):\n                reportSkip(\"Does not run on Python3\", \".\", package_name)\n                continue\n\n        if os.name == \"nt\":\n            if package_name in (\"cryptography\",):\n                reportSkip(\"Not working on Windows\", \".\", package_name)\n                continue\n\n        if package_name == \"pyyaml\":\n            reportSkip(\"Not yet supported, see Issue #476\", \".\", package_name)\n            continue\n\n        if package_name in (\"pycparser\", \"numpy\"):\n            reportSkip(\"Not yet supported, see Issue #477\", \".\", package_name)\n            continue\n\n        if package_name in (\n            \"google-auth\",  # bdist_nuitka fails AttributeError: single_version_externally_managed\n            \"jinja2\",  # ModuleNotFoundError: No module named 'jinja2.tests'\n            \"pandas\",  # ModuleNotFoundError: No module named 'Cython'\n            \"pytz\",  # need to 'make build'\n            \"rsa\",  # Now uses Poetry (no setup.py)\n        ):\n            continue\n\n        package_dir = os.path.join(cache_dir, package_name)\n\n        try:\n            gitClone(package_name, details[\"url\"], cache_dir)\n\n            os.chdir(base_dir)\n            with withVirtualenv(\n                \"venv_%s\" % package_name, delete=False, style=\"blue\"\n            ) as venv:\n                dist_dir = os.path.join(package_dir, \"dist\")\n\n                # delete ignored tests if any\n                if details[\"ignored_tests\"]:\n                    for test in details[\"ignored_tests\"]:\n                        venv.runCommand(\"rm -rf %s\" % os.path.join(package_dir, test))\n\n                # setup for pytest\n                cmds = [\n                    \"python -m pip install pytest\",\n                    \"cd %s\" % os.path.join(os.path.dirname(nuitka.__file__), \"..\"),\n                    \"python setup.py develop\",\n                    \"cd %s\" % package_dir,\n                ]\n\n                if details[\"requirements_file\"]:\n                    cmds.append(\n                        \"python -m pip install -r %s\" % details[\"requirements_file\"]\n                    )\n\n                if details.get(\"extra_commands\"):\n                    cmds += details[\"extra_commands\"]\n\n                # build uncompiled .whl\n                cmds.append(\"python setup.py bdist_wheel\")\n\n                venv.runCommand(commands=cmds)\n\n                # install and print out if the active .whl is compiled or not\n                venv.runCommand(\n                    commands=[\n                        \"python -m pip install -U %s\"\n                        % os.path.join(dist_dir, os.listdir(dist_dir)[0]),\n                        # use triple quotes for linux\n                        \"\"\"python -c \"print(getattr(__import__('%s'),'__compiled__','__uncompiled_version__'))\" \"\"\"\n                        % details.get(\"package_name\", package_name),\n                    ]\n                )\n\n                # get uncompiled pytest results\n                uncompiled_stdout, uncompiled_stderr = venv.runCommandWithOutput(\n                    commands=[\n                        \"cd %s\" % package_dir,\n                        \"python -m pytest --disable-warnings\",\n                    ],\n                    style=\"blue\",\n                )\n\n                # clean up before building compiled .whl\n                cmds = [\"cd %s\" % package_dir, \"git clean -dfx\"]\n\n                if details.get(\"extra_commands\"):\n                    cmds += details[\"extra_commands\"]\n\n                # build nuitka compiled .whl\n                cmds.append(\"python setup.py bdist_nuitka\")\n\n                venv.runCommand(commands=cmds)\n\n                # install and print out if the active .whl is compiled or not\n                venv.runCommand(\n                    commands=[\n                        \"python -m pip install -U %s\"\n                        % os.path.join(dist_dir, os.listdir(dist_dir)[0]),\n                        # use triple quotes for linux\n                        \"\"\"python -c \"print(getattr(__import__('%s'),'__compiled__','__uncompiled_version__'))\" \"\"\"\n                        % details.get(\"package_name\", package_name),\n                    ]\n                )\n\n                # get compiled pytest results, may fail some tests.\n                (\n                    compiled_stdout,\n                    compiled_stderr,\n                    _exit_code,\n                ) = venv.runCommandWithOutput(\n                    commands=[\n                        \"cd %s\" % package_dir,\n                        \"python -m pytest --disable-warnings\",\n                    ],\n                    style=\"blue\",\n                )\n\n                venv.runCommand(commands=[\"cd %s\" % package_dir, \"git clean -q -dfx\"])\n\n        except Exception as e:\n            my_print(\n                \"Package\",\n                package_name,\n                \"ran into an exception during execution, traceback: \",\n            )\n            my_print(e)\n            results.append((package_name, \"ERROR\", \"ERROR\"))\n\n            continue\n\n        # compare outputs\n        stdout_diff = compareOutput(\n            \"stdout\",\n            uncompiled_stdout,\n            compiled_stdout,\n            ignore_warnings=True,\n            syntax_errors=True,\n        )\n\n        stderr_diff = compareOutput(\n            \"stderr\",\n            uncompiled_stderr,\n            compiled_stderr,\n            ignore_warnings=True,\n            syntax_errors=True,\n        )\n\n        results.append((package_name, stdout_diff, stderr_diff))\n\n        exit_code = stdout_diff or stderr_diff\n\n        my_print(\n            \"\\n=================================================================================\",\n            \"\\n--- %s ---\" % package_name,\n            \"exit_stdout:\",\n            stdout_diff,\n            \"exit_stderr:\",\n            stderr_diff,\n            (\n                \"\\nError, outputs differed for package %s.\" % package_name\n                if exit_code\n                else \"\\nNo differences found for package %s.\" % package_name\n            ),\n            \"\\n=================================================================================\\n\",\n            style=\"red\" if exit_code else \"green\",\n        )\n\n        if exit_code != 0 and search_mode.abortOnFinding(\n            dirname=None, filename=package_name\n        ):\n            break\n\n    search_mode.finish()\n\n    # give a summary of all packages\n    my_print(\n        \"\\n\\n=====================================SUMMARY=====================================\",\n        style=\"yellow\",\n    )\n\n    for package_name, stdout_diff, stderr_diff in results:\n        my_print(\n            package_name,\n            \"-\",\n            end=\" \",\n            style=\"red\" if (stdout_diff or stderr_diff) else \"green\",\n        )\n\n        my_print(\n            \"stdout:\", stdout_diff, end=\" \", style=\"red\" if stdout_diff else \"green\"\n        )\n\n        my_print(\n            \"stderr:\", stderr_diff, end=\"\", style=\"red\" if stderr_diff else \"green\"\n        )\n\n        my_print(\n            \"\\n---------------------------------------------------------------------------------\"\n        )\n\n    my_print(\"TOTAL NUMBER OF PACKAGES TESTED: %s\" % len(results), style=\"yellow\")\n\n    num_failed = 0\n    num_errors = 0\n\n    # tally the number of errors and failed\n    for _, y, z in results:\n        if type(y) is str:\n            # this means the package ran into an exception\n            num_errors += 1\n        elif y or z:\n            num_failed += 1\n\n    my_print(\n        \"TOTAL PASSED: %s\" % (len(results) - num_failed - num_errors), style=\"green\"\n    )\n\n    my_print(\"TOTAL FAILED (differences): %s\" % num_failed, style=\"red\")\n\n    my_print(\"TOTAL ERRORS (exceptions): %s\" % num_errors, style=\"red\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/README.txt",
    "content": "\nThis directory contains a large amount of tests. Please be sure to checkout the\ndescription in the Developer Manual. You will find it normally as file\n\"../Developer_Manual.rst\" and within it, there is a section \"Running the Tests\",\nwith sub-sections that describe each directory here and how to use it.\n"
  },
  {
    "path": "tests/basics/AssertsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Exercise assertions in their flavors.\"\"\"\n\n# nuitka-project: --nofollow-imports\n\nfrom __future__ import print_function\n\n\ndef testAssert1():\n    assert False\n\n    return 1\n\n\ndef testAssert2():\n    assert True\n\n    return 1\n\n\ndef testAssert3():\n    assert False, \"argument\"\n\n    return 1\n\n\ntry:\n    print(\"Function that will assert.\")\n    testAssert1()\n    print(\"No exception.\")\nexcept Exception as e:\n    print(\"Raised\", type(e), e)\n\ntry:\n    print(\"Function that will not assert.\")\n    testAssert2()\n    print(\"No exception.\")\nexcept Exception as e:\n    print(\"Raised\", type(e), e)\n\ntry:\n    print(\"Function that will assert with argument.\")\n    testAssert3()\n    print(\"No exception.\")\nexcept Exception as e:\n    print(\"Raised\", type(e), e)\n\ntry:\n    print(\"Assertion with tuple argument.\", end=\"\")\n    assert False, (3,)\nexcept AssertionError as e:\n    print(str(e))\n\ntry:\n    print(\"Assertion with plain argument.\", end=\"\")\n    assert False, 3\nexcept AssertionError as e:\n    print(str(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/AssignmentsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Assignment tests, cover most forms of them. \"\"\"\n\n# nuitka-project: --nofollow-imports\n\nfrom __future__ import print_function\n\nimport sys\n\n# Tests are dirty on purpose.\n#\n# pylint: disable=broad-except,global-variable-undefined,redeclared-assigned-name\n# pylint: disable=global-variable-not-assigned,invalid-name,self-assigning-variable\n\n\ndef someFunction():\n    a = 2\n    print(\"Simple assignment to variable:\", a)\n\n    b = c = 3\n    print(\"Assignment to 2 variables\", b, c)\n\n    z = [1, 2, 3]\n    z[2] = z[1] = 5\n\n    print(\"Assignment to list subscripts:\", z)\n\n    d, e = 1, 2\n    print(\"Assignment to variable tuple:\", d, e)\n\n    [f, g] = 7, 9\n    print(\"Assignment to variable list:\", f, g)\n\n    j = [h, i] = (7, 9)\n    print(\"Complex Assignment from variable list:\", j, type(j), h, i)\n\n    a, (b, c) = 1, (2, 3)\n    print(\"Assignment to nested tuples:\", a, b, c)\n\n    v = [1, 2, 3, 4]\n    v[2:3] = (8, 9)\n    print(\"Assignment to list slice\", v)\n\n\ndef varargsFunction(*args):\n    f1, f2, f3, f4 = args\n\n    print(\"Assignment from list\", f1, f2, f3, f4)\n\n\ndef otherFunction():\n    class Iterable:\n        def __iter__(self):\n            return iter(range(3))\n\n    a, b, c = Iterable()\n\n    print(\"Assignments from iterable\", a, b, c)\n\n    print(\"Assignments from too small iterable\", end=\" \")\n\n    try:\n        f, g = (1,)\n    except Exception as e:\n        print(\"gave\", type(e), repr(e))\n\n        try:\n            print(f)\n        except UnboundLocalError:\n            print(\"Variable f is untouched\")\n\n        try:\n            print(g)\n        except UnboundLocalError:\n            print(\"Variable g is untouched\")\n\n    print(\"Assignments from too large iterable\", end=\" \")\n\n    try:\n        d, j = 1, 2, 3\n    except Exception as e:\n        print(\"gave\", type(e), repr(e))\n\n        try:\n            print(d)\n        except UnboundLocalError:\n            print(\"Variable d is untouched\")\n\n        try:\n            print(j)\n        except UnboundLocalError:\n            print(\"Variable j is untouched\")\n\n    class BasicIterClass:\n        def __init__(self, n):\n            self.n = n\n            self.i = 0\n\n        def __next__(self):\n            res = self.i\n            if res >= self.n:\n                raise StopIteration\n            self.i = res + 1\n            return res\n\n        if sys.version_info[0] < 3:\n\n            def next(self):\n                return self.__next__()\n\n    class IteratingSequenceClass:\n        def __init__(self, n):\n            self.n = n\n\n        def __iter__(self):\n            return BasicIterClass(self.n)\n\n    print(\"Exception from iterating over too short class:\", end=\" \")\n    try:\n        a, b, c = IteratingSequenceClass(2)\n    except ValueError:\n        print(\"gave\", sys.exc_info())\n\n\ndef anotherFunction():\n    d = {}\n\n    print(\"Assignment to dictionary with comma subscript:\", end=\"\")\n    # d[\"f\"] = 3\n\n    d[\"a\", \"b\"] = 6\n    d[\"c\", \"b\"] = 9\n\n    print(sorted(d.items()))\n\n\ndef swapVariables():\n    print(\"Strange swap form:\")\n    a = 1\n    b = 2\n\n    a, b, a = b, a, b\n\n    print(a, b)\n\n\ndef InterruptedUnpack():\n    a = 1\n    b = 2\n\n    print(\"Assignment from a too short tuple to multiple targets:\", end=\" \")\n\n    try:\n        s = (a,)\n\n        c, d = s\n    except ValueError as e:\n        print(\"gives ValueError\", repr(e))\n\n        try:\n            print(c)\n        except UnboundLocalError as e:\n            print(\"and then nothing is assigned:\", repr(e))\n    else:\n        del d\n\n    del a, b\n\n    z = []\n\n    try:\n        a, z.unknown, b = 1, 2, 3\n    except AttributeError:\n        print(\"Interrupted unpack, leaves value assigned\", a)\n\n\ndef multiTargetInterrupt():\n    a = 1\n    b = 2\n\n    print(\"Multiple, overlapping targets\", end=\"\")\n\n    d = c, d = a, b\n    print(d, c, end=\"\")\n\n    del c\n    del d\n\n    c, d = d = a, b\n    print(d, c)\n\n    print(\"Error during multiple assignments\", end=\"\")\n\n    del c\n    del d\n    e = 9\n\n    z = []\n    try:\n        c, d = e, z.a = a, b\n    except AttributeError:\n        print(\"having attribute error\", c, d, e)\n\n    del c\n    del d\n    e = 9\n\n    print(\"Error during multiple assignments\", end=\"\")\n\n    try:\n        c, d = z.a, e = a, b\n    except AttributeError:\n        print(\"having attribute error\", c, d, e)\n\n\ndef optimizeableTargets():\n    a = [1, 2]\n\n    a[int(1)] = 3\n\n    print(\"Optimizable slice operation, results in\", a)\n\n\ndef complexDel():\n    a = b = c = d = 1\n\n    del a, b, (c, d)\n\n    try:\n        print(c)\n    except UnboundLocalError as e:\n        print(\"yes, del worked\", repr(e))\n\n\ndef sliceDel():\n    # Python3 ranges are not lists.\n    a = list(range(6))\n\n    del a[2:4]\n\n    print(\"Del slice operation, results in\", a)\n\n\ndef globalErrors():\n    global unassigned_1, unassigned_2\n\n    try:\n        unassigned_1 = unassigned_1\n    except NameError as e:\n        print(\"Accessing unassigned global gives\", repr(e))\n\n    try:\n        del unassigned_2\n    except NameError as e:\n        print(\"Del on unassigned global gives\", repr(e))\n\n\nsomeFunction()\nvarargsFunction(1, 2, 3, 4)\notherFunction()\nanotherFunction()\nswapVariables()\nInterruptedUnpack()\nmultiTargetInterrupt()\noptimizeableTargets()\ncomplexDel()\nsliceDel()\nglobalErrors()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/AssignmentsTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Basic assignment forms from various iterables:\")\na, b = 1, 2  # simple sequence assignment\nprint(a, b)\na, b = [\"green\", \"blue\"]  # list assignment\nprint(a, b)\na, b = \"XY\"  # string assignment\nprint(a, b)\na, b = range(1, 5, 2)  # any iterable will do\nprint(a, b)\n\nprint(\"Using braces on unpacking side:\")\n(a, b), c = \"XY\", \"Z\"  # a = 'X', b = 'Y', c = 'Z'\nprint(a, b, c)\n\nprint(\"Too many values:\")\ntry:\n    (a, b), c = \"XYZ\"  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n\nprint(\"Too few values:\")\ntry:\n    (a, b), c = \"XY\"  # ERROR -- need more than 1 value to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n\nprint(\"More complex right hand side, consisting of multiple values:\")\n(\n    (a, b),\n    c,\n) = [\n    1,\n    2,\n], \"this\"  # a = '1', b = '2', c = 'this'\nprint(a, b, c)\n\nprint(\"More complex right hand side, too many values:\")\ntry:\n    (a, b), (c,) = [1, 2], \"this\"  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n\nprint(\"Extended sequence * unpacking:\")\na, *b = 1, 2, 3, 4, 5  # a = 1, b = [2,3,4,5]\nprint(a, b)\n*a, b = 1, 2, 3, 4, 5  # a = [1,2,3,4], b = 5\nprint(a, b)\na, *b, c = 1, 2, 3, 4, 5  # a = 1, b = [2,3,4], c = 5\nprint(a, b)\n\na, *b = \"X\"  # a = 'X', b = []\nprint(a, b)\n*a, b = \"X\"  # a = [], b = 'X'\nprint(a, b)\na, *b, c = \"XY\"  # a = 'X', b = [], c = 'Y'\nprint(a, b)\na, *b, c = \"X...Y\"  # a = 'X', b = ['.','.','.'], c = 'Y'\nprint(a, b, c)\n\na, b, *c = 1, 2, 3  # a = 1, b = 2, c = [3]\nprint(a, b, c)\na, b, c, *d = 1, 2, 3  # a = 1, b = 2, c = 3, d = []\nprint(a, b, c, d)\n\n(a, b), c = [1, 2], \"this\"  # a = '1', b = '2', c = 'this'\nprint(a, b, c)\n(a, b), *c = [1, 2], \"this\"  # a = '1', b = '2', c = ['this']\nprint(a, b, c)\n(a, b), c, *d = [1, 2], \"this\"  # a = '1', b = '2', c = 'this', d = []\nprint(a, b, c, d)\n(a, b), *c, d = [1, 2], \"this\"  # a = '1', b = '2', c = [], d = 'this'\nprint(a, b, c, d)\n\n(a, b), (c, *d) = [1, 2], \"this\"  # a = '1', b = '2', c = 't', d = ['h', 'i', 's']\nprint(a, b, c, d)\n\n(*a,) = (1, 2)  # a = [1,2]\n\n\nprint(\"Extended sequence * unpacking with non-iterable:\")\ntry:\n    (*a,) = 1  # ERROR -- 'int' object is not iterable\nexcept Exception as e:\n    print(repr(e))\nprint(a)\n\nprint(\"Extended sequence * unpacking with list:\")\n(*a,) = [1]  # a = [1]\nprint(a)\n\nprint(\"Extended sequence * unpacking with tuple:\")\n(*a,) = (1,)  # a = [1]\nprint(a)\n\nprint(\"Extended sequence * unpacking with fixed right side:\")\n*a, b = [1]  # a = [], b = 1\nprint(a, b)\n*a, b = (1,)  # a = [], b = 1\nprint(a, b)\n\nprint(\"Unpacking too many values:\")\ntry:\n    (a, b), c = 1, 2, 3  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\nprint(\"Unpacking with star argument changes error:\")\ntry:\n    (a, b), *c = 1, 2, 3  # ERROR - 'int' object is not iterable\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n\nprint(\"Unpacking with star argument after tuple unpack:\")\n(a, b), *c = \"XY\", 2, 3  # a = 'X', b = 'Y', c = [2,3]\nprint(a, b, c)\n\nprint(\"Extended sequence unpacking, nested:\")\n\ntry:\n    (a, b), c = 1, 2, 3  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n*(a, b), c = 1, 2, 3  # a = 1, b = 2, c = 3\nprint(a, b, c)\n\n(*(a, b),) = 1, 2  # a = 1, b = 2\nprint(a, b)\n\n(*(a, b),) = \"XY\"  # a = 'X', b = 'Y'\nprint(a, b)\n\ntry:\n    (*(a, b),) = \"this\"  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b)\n\n(*(a, *b),) = \"this\"  # a = 't', b = ['h', 'i', 's']\nprint(a, b)\n\n*(a, *b), c = \"this\"  # a = 't', b = ['h', 'i'], c = 's'\nprint(a, b, c)\n\n(*(a, *b),) = 1, 2, 3, 3, 4, 5, 6, 7  # a = 1, b = [2, 3, 3, 4, 5, 6, 7]\nprint(a, b)\n\ntry:\n    *(a, *b), (*c,) = 1, 2, 3, 3, 4, 5, 6, 7  # ERROR -- 'int' object is not iterable\nexcept Exception as e:\n    print(repr(e))\nprint(\"unchanged\", a, b, c)\n\nprint(\"Unpacking with nested stars:\")\n*(a, *b), c = 1, 2, 3, 3, 4, 5, 6, 7  # a = 1, b = [2, 3, 3, 4, 5, 6], c = 7\nprint(a, b, c)\n\nprint(\"Unpacking with even more nested stars:\")\n*(a, *b), (*c,) = 1, 2, 3, 4, 5, \"XY\"  # a = 1, b = [2, 3, 4, 5], c = ['X', 'Y']\nprint(a, b, c)\n\n*(a, *b), c, d = 1, 2, 3, 3, 4, 5, 6, 7  # a = 1, b = [2, 3, 3, 4, 5], c = 6, d = 7\nprint(\"starting\", a, b, c, d)\ntry:\n    *(a, *b), (c, d) = 1, 2, 3, 3, 4, 5, 6, 7  # ERROR -- 'int' object is not iterable\nexcept Exception as e:\n    print(repr(e))\nprint(\"unchanged\", a, b, c, d)\n\ntry:\n    *(a, *b), (*c, d) = 1, 2, 3, 3, 4, 5, 6, 7  # ERROR -- 'int' object is not iterable\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c, d)\n\n\ntry:\n    *(a, b), c = \"XY\", 3  # ERROR -- need more than 1 value to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(\"unchanged\", a, b, c)\n\n*(*a, b), c = \"XY\", 3  # a = [], b = 'XY', c = 3\nprint(a, b, c)\n(a, b), c = \"XY\", 3  # a = 'X', b = 'Y', c = 3\nprint(a, b, c)\n\n*(a, b), c = \"XY\", 3, 4  # a = 'XY', b = 3, c = 4\nprint(a, b, c)\n*(*a, b), c = \"XY\", 3, 4  # a = ['XY'], b = 3, c = 4\nprint(a, b, c)\ntry:\n    (a, b), c = \"XY\", 3, 4  # ERROR -- too many values to unpack\nexcept Exception as e:\n    print(repr(e))\nprint(a, b, c)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/BranchingTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Some random branching to cover most common cases. \"\"\"\n\nfrom __future__ import print_function\n\n\ndef branchingFunction(a, b, c):\n    print(\"branchingFunction:\", a, b, c)\n\n    print(\"a or b\", a or b)\n    print(\"a and b\", a and b)\n    print(\"not a\", not a)\n    print(\"not b\", not b)\n\n    print(\"Simple branch with both branches\")\n    if a:\n        l = \"YES\"\n    else:\n        l = \"NO\"\n\n    print(a, \"->\", l)\n\n    print(\"Simple not branch with both branches\")\n    if not a:\n        l = \"YES\"\n    else:\n        l = \"NO\"\n\n    print(not a, \"->\", l)\n\n    print(\"Simple branch with a nested branch in else path:\")\n    if a:\n        m = \"yes\"\n    else:\n        if True:\n            m = \"no\"\n\n    print(a, \"->\", m)\n\n    print(\"Triple 'and' chain:\")\n\n    v = \"NO\"\n    if a and b and c:\n        v = \"YES\"\n\n    print(a, b, c, \"->\", v)\n\n    print(\"Triple or chain:\")\n\n    k = \"NO\"\n    if a or b or c:\n        k = \"YES\"\n\n    print(a, b, c, \"->\", k)\n\n    print(\"Nested 'if not' chain:\")\n    p = \"NO\"\n    if not a:\n        if not b:\n            p = \"YES\"\n\n    print(\"not a, not b\", not a, not b, \"->\", p)\n\n    print(\"or condition in braces:\")\n    q = \"NO\"\n    if a or b:\n        q = \"YES\"\n    print(\"(a or b) ->\", q)\n\n    print(\"Braced if not with two 'or'\")\n\n    if not (a or b or c):\n        q = \"YES\"\n    else:\n        q = \"NO\"\n    print(\"not (a or b or c)\", q)\n\n    print(\"Braced if not with one 'or'\")\n    q = \"NO\"\n    if not (b or b):\n        q = \"YES\"\n    print(\"not (b or b)\", q)\n\n    print(\"Expression a or b\", a or b)\n    print(\"Expression not(a or b)\", not (a or b))\n    print(\"Expression a and (b+5)\", a and (b + 5))\n\n    print(\"Expression (b if b else 2)\", (b if b else 2))\n    print(\"Expression (a and (b if b else 2))\", (a and (b if b else 2)))\n\n    print(\"Braced if not chain with 'and' and conditional expression:\")\n\n    if not (a and (b if b else 2)):\n        print(\"oki\")\n\n    print(\"Nested if chain with outer else:\")\n\n    d = 1\n\n    if a:\n        if b or c:\n            if d:\n                print(\"inside nest\")\n\n    else:\n        print(\"outer else\")\n\n    print(\"Complex conditional expression:\")\n    v = (3 if a + 1 else 0) or (b or (c * 2 if c else 6) if b - 1 else a and b and c)\n    print(v)\n\n    if True:\n        print(\"Predictable branch taken\")\n\n\nbranchingFunction(1, 0, 3)\n\nx = 3\n\n\ndef optimizationVictim():\n    if x:\n        pass\n    else:\n        pass\n\n    if x:\n        pass\n        pass\n\n\noptimizationVictim()\n\n\ndef dontOptimizeSideEffects():\n    print(\n        \"Lets see, if conditional expression in known true values are correctly handled:\"\n    )\n\n    def returnTrue():\n        print(\"function 'returnTrue' was called as expected\")\n\n        return True\n\n    def returnFalse():\n        print(\"function 'returnFalse' should not have been called\")\n        return False\n\n    if (returnTrue() or returnFalse(),):\n        print(\"Taken branch as expected.\")\n    else:\n        print(\"Bad branch taken.\")\n\n\ndontOptimizeSideEffects()\n\n\ndef dontOptimizeTruthCheck():\n    class A:\n        def __nonzero__(self):\n            raise ValueError\n\n        __bool__ = __nonzero__\n\n    a = A()\n\n    if a:\n        pass\n\n\ntry:\n    print(\"Check that branch conditions are not optimized way: \", end=\"\")\n    dontOptimizeTruthCheck()\n    print(\"FAIL.\")\nexcept ValueError:\n    print(\"OK.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/BuiltinOverload.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\ntry:\n    from __builtin__ import len as _len\nexcept ImportError:\n    from builtins import len as _len\n\n# This kind of built-in overload will have to work.\n\n\ndef len(x):\n    print(\"Private built-in called with argument\", repr(x))\n\n    return _len(x)\n\n\nprint(\"Calling built-in len\", len(range(9)))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/BuiltinSuperTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\n# nuitka-project: --nofollow-imports\n\n\n# Python2 will fallback to this variable, which Python3 will ignore.\n__class__ = \"Using module level __class__ variable, would be wrong for Python3\"\n\n\nclass ClassWithUnderClassClosure:\n    def g(self):\n        def h():\n            print(\"Variable __class__ in ClassWithUnderClassClosure is\", __class__)\n\n        h()\n\n        try:\n            print(\n                \"ClassWithUnderClassClosure: Super in ClassWithUnderClassClosure is\",\n                super(),\n            )\n        except Exception as e:\n            print(\"ClassWithUnderClassClosure: Occurred during super call\", repr(e))\n\n\nprint(\"Class with a method that has a local function accessing __class__:\")\nClassWithUnderClassClosure().g()\n\n\nclass ClassWithoutUnderClassClosure:\n    def g(self):\n        __class__ = \"Providing __class__ ourselves, then it must be used\"\n        print(__class__)\n\n        try:\n            print(\"ClassWithoutUnderClassClosure: Super\", super())\n        except Exception as e:\n            print(\"ClassWithoutUnderClassClosure: Occurred during super call\", repr(e))\n\n\nClassWithoutUnderClassClosure().g()\n\n# For Python2 only.\n__class__ = \"Global __class__\"\n\n\ndef deco(C):\n    print(\"Decorating\", repr(C))\n\n    class D(C):\n        pass\n\n    return D\n\n\n@deco\nclass X:\n    __class__ = \"some string\"\n\n    def f1(self):\n        print(\"f1\", locals())\n\n        try:\n            print(\"f1\", __class__)\n        except Exception as e:\n            print(\"Accessing __class__ in f1 gave\", repr(e))\n\n    def f2(self):\n        print(\"f2\", locals())\n\n    def f4(self):\n        print(\"f4\", self)\n        self = X()\n        print(\"f4\", self)\n\n        try:\n            print(\"f4\", super())\n            print(\"f4\", super().__self__)\n        except TypeError:\n            import sys\n\n            assert sys.version_info < (3,)\n\n    f5 = lambda x: __class__\n\n    def f6(self_by_another_name):\n        try:\n            print(\"f6\", super())\n        except TypeError:\n            import sys\n\n            assert sys.version_info < (3,)\n\n    def f7(self):\n        try:\n            yield super()\n        except TypeError:\n            import sys\n\n            assert sys.version_info < (3,)\n\n    print(\"Early pre-class calls begin\")\n    print(\"Set in class __class__\", __class__)\n    # f1(1)\n    f2(2)\n    print(\"Early pre-class calls end\")\n\n    del __class__\n\n\nx = X()\nx.f1()\nx.f2()\nx.f4()\nprint(\"f5\", x.f5())\nx.f6()\nprint(\"f7\", list(x.f7()))\n\n\ndef makeSuperCall(arg1, arg2):\n    print(\"Calling super with args\", arg1, arg2, end=\": \")\n\n    try:\n        super(arg1, arg2)\n    except Exception as e:\n        print(\"Exception\", e)\n    else:\n        print(\"Ok.\")\n\n\n# Due to inconsistent back porting to Python2.6 and Python2.7, 3.5 on various OSes,\n# this one gives varying results, ignore that\nif sys.version_info >= (3, 6):\n    makeSuperCall(None, None)\n    makeSuperCall(1, None)\n\nmakeSuperCall(type, None)\nmakeSuperCall(type, 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/BuiltinsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that should cover sporadic usages of built-ins that we implemented.\n\n\"\"\"\n\n# pylint: disable=broad-except,global-variable-not-assigned,redefined-outer-name\n# pylint: disable=comparison-with-itself,use-dict-literal,use-list-literal\n# pylint: disable=consider-using-with,invalid-bytes-returned,unspecified-encoding\n# pylint: disable=invalid-str-returned,no-self-use,unnecessary-comprehension\n\nfrom __future__ import print_function\n\n# Patch away \"__file__\" path in a hard to detect way. This will make sure,\n# repeated calls to locals really get the same dictionary.\nimport os\nfrom math import copysign\n\n\ndef someFunctionWritingLocals():\n    x = 1\n    r = locals()\n\n    # This is without effect on r. It doesn't mention y at all\n    y = 2\n\n    # This adds z to the locals, but only that.\n    r[\"z\"] = 3\n    del x\n\n    try:\n        z\n    except Exception as e:\n        print(\"Accessing z writing to locals gives Exception\", e)\n\n    return r, y\n\n\ndef someFunctionWritingLocalsContainingExec():\n    _x = 1\n    r = locals()\n\n    # This is without effect on r. It doesn't mention y at all\n    y = 2\n\n    # This adds z to the locals, but only that.\n    r[\"z\"] = 3\n\n    try:\n        z\n    except Exception as e:\n        print(\"Accessing z writing to locals in exec function gives Exception\", e)\n\n    return r, y\n\n    # Note: This exec is dead code, and still changes the behavior of\n    # CPython, because it detects exec during parse already.\n    # pylint: disable=exec-used,unreachable\n    exec(\"\")\n\n\nprint(\"Testing locals():\")\nprint(\"writing to locals():\", someFunctionWritingLocals())\nprint(\n    \"writing to locals() with exec() usage:\", someFunctionWritingLocalsContainingExec()\n)\n\n\ndef displayDict(d):\n    if \"__loader__\" in d:\n        d = dict(d)\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d = dict(d)\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__compiled__\" in d:\n        d = dict(d)\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(\"Vars on module level\", displayDict(vars()))\n\nmodule_locals = locals()\n\n\nmodule_locals[\"__file__\"] = os.path.basename(module_locals[\"__file__\"])\ndel module_locals\n\nprint(\"Use of locals on the module level\", displayDict(locals()))\n\n\ndef someFunctionUsingGlobals():\n    g = globals()\n\n    g[\"hallo\"] = \"du\"\n\n    global hallo\n    print(\"hallo\", hallo)  # false alarm, pylint: disable=undefined-variable\n\n\nprint(\"Testing globals():\")\nsomeFunctionUsingGlobals()\n\nprint(\"Testing dir():\")\n\nprint(\"Module dir\", end=\" \")\n\n\ndef someFunctionUsingDir():\n    q = someFunctionUsingGlobals()\n\n    print(\"Function dir\", dir())\n\n    return q\n\n\nsomeFunctionUsingDir()\n\nprint(\"Making a new type, with type() and 3 args:\", end=\" \")\nNewClass = type(\"Name\", (object,), {})\nprint(NewClass, NewClass())\n\nprint(\"None has type\", type(None))\n\nprint(\n    \"Constant ranges\",\n    range(2),\n    range(1, 6),\n    range(3, 0, -1),\n    range(3, 8, 2),\n    range(5, -5, -3),\n)\nprint(\"Border cases\", range(0), range(-1), range(-1, 1))\n\nprint(\"Corner case large negative value\", range(-(2**100)))\nprint(\n    \"Corner case with large start/end values in small range\",\n    range(2**100, 2**100 + 2),\n)\n\ntry:\n    print(\"Range with 0 step gives:\", end=\" \")\n    print(range(3, 8, 0))\nexcept ValueError as e:\n    print(repr(e))\n\ntry:\n    print(\"Range with float:\", end=\" \")\n    print(range(1.0))\nexcept TypeError as e:\n    print(\"Gives exception:\", repr(e))\n\ntry:\n    print(\"Empty range call\", end=\" \")\n    print(range())\nexcept TypeError as e:\n    print(\"Gives exception:\", e)\n\nprint(\"List from iterable\", list(\"abc\"), list())\ntry:\n    print(\"List from sequence\", end=\" \")\n    print(list(sequence=(0, 1, 2)))\nexcept TypeError as e:\n    print(\"Gives exception:\", e)\nprint(\"Tuple from iterable\", tuple(\"cda\"), tuple())\ntry:\n    print(\"Tuple from sequence\", end=\" \")\n    print(tuple(sequence=(0, 1, 2)))\nexcept TypeError as e:\n    print(\"Gives exception:\", e)\n\nprint(\n    \"Dictionary from iterable and keywords\", displayDict(dict((\"ab\", (1, 2)), f=1, g=1))\n)\nprint(\"More constant dictionaries\", {\"two\": 2, \"one\": 1}, {}, dict())\ng = {\"two\": 2, \"one\": 1}\nprint(\"Variable dictionary\", dict(g))\nprint(\n    \"Found during optimization\",\n    dict(dict({\"le\": 2, \"la\": 1}), fu=3),\n    dict(named=dict({\"le\": 2, \"la\": 1})),\n)\n\nprint(\"Floats from constants\", float(\"3.0\"), float())\ntry:\n    print(\"Float keyword arg\", end=\" \")\nexcept TypeError as e:\n    print(float(x=9.0))\n\nprint(\"Found during optimization\", float(float(\"3.2\")), float(float(11.0)))\n\nprint(\n    \"Complex from constants\",\n    complex(\"3.0j\"),\n    complex(real=9.0),\n    complex(imag=9.0),\n    complex(1, 2),\n    complex(),\n)\nprint(\n    \"Found during optimization\",\n    complex(float(\"3.2\")),\n    complex(real=float(11.0)),\n    complex(imag=float(11.0)),\n)\n\nprint(\"Strs from constants\", str(\"3.3\"), str(object=9.1), str())\nprint(\"Found during optimization\", str(float(\"3.3\")), str(object=float(12.0)))\n\nprint(\"Bools from constants\", bool(\"3.3\"), bool(0), bool())\nprint(\"Found during optimization\", bool(float(\"3.3\")), bool(range(0)))\n\nprint(\"Ints from constants\", int(\"3\"), int(\"f\", 16), int(\"0101\", base=2), int(0), int())\ntry:\n    print(\"Int keyword arg1\", end=\" \")\n    print(int(x=\"9\"))\n    print(int(x=\"e\", base=16))\nexcept TypeError as e:\n    print(\"Gives exception:\", e)\nprint(\"Found ints during optimization\", int(int(\"3\")), int(int(0.0)))\n\ntry:\n    print(\n        \"Longs from constants\",\n        long(\"3\"),\n        long(x=\"9\"),\n        long(\"f\", 16),\n        long(x=\"e\", base=16),\n        long(\"0101\", base=2),\n        long(0),\n        long(),\n    )\n    print(\"Found longs during optimization\", long(long(\"3\")), long(x=long(0.0)))\nexcept NameError:\n    print(\"Python3 has no long type.\")\n\n\ntry:\n    print(\"Int with only base\", int(base=2), end=\" \")\nexcept Exception as e:\n    print(\"Caused\", repr(e))\nelse:\n    print(\"Worked\")\n\ntry:\n    print(\"Int with large base\", int(2, 37), end=\" \")\nexcept Exception as e:\n    print(\"Caused\", repr(e))\nelse:\n    print(\"Worked\")\n\ntry:\n    print(\"Long with only base\", int(base=2), end=\" \")\nexcept Exception as e:\n    print(\"Caused\", repr(e))\nelse:\n    print(\"Worked\")\n\n\nprint(\"Oct from constants\", oct(467), oct(0))\nprint(\"Found during optimization\", oct(int(\"3\")))\n\nprint(\"Hex from constants\", hex(467), hex(0))\nprint(\"Found during optimization\", hex(int(\"3\")))\n\n\nprint(\"Bin from constants\", bin(467), bin(0))\nprint(\"Found during optimization\", bin(int(\"3\")))\n\ntry:\n    int(1, 2, 3)\nexcept Exception as e:\n    print(\"Too many args gave\", repr(e))\n\ntry:\n    int(y=1)\nexcept Exception as e:\n    print(\"Wrong arg\", repr(e))\n\nf = 3\nprint(\"Unoptimized call of int\", int(\"0\" * f, base=16))\n\ntry:\n    d = {\"x\": \"12\", \"base\": 8}\n    print(\"Dict star argument call of int\", end=\" \")\n    print(int(**d))\nexcept TypeError as e:\n    print(\"Gives exception:\", e)\n\nbase = 16\n\ntry:\n    value = unicode(\"20\")\nexcept NameError:\n    print(\"Python3: Has unicode by default.\")\n    value = \"20\"\n\nprint(\"Unoptimized calls of int with unicode args\", int(value, base), int(value))\n\nbase = 37\ntry:\n    print(\"Int with large base\", int(2, base), end=\" \")\nexcept Exception as e:\n    print(\"Caused\", repr(e))\nelse:\n    print(\"Worked\")\n\n\ntry:\n    print(chr())\nexcept Exception as e:\n    print(\"Disallowed without args\", repr(e))\n\ntry:\n    print(ord())\nexcept Exception as e:\n    print(\"Disallowed without args\", repr(e))\n\ntry:\n    print(ord(s=1))\nexcept Exception as e:\n    print(\"Disallowed keyword args\", repr(e))\n\ntry:\n    print(ord(1, 2))\nexcept Exception as e:\n    print(\"Too many plain args\", repr(e))\n\ntry:\n    print(ord(1, s=2))\nexcept Exception as e:\n    print(\"Too many args, some keywords\", repr(e))\n\ntry:\n    print(sum())\nexcept Exception as e:\n    print(\"Disallowed without args\", repr(e))\n\nx = range(17)\nprint(\"Sum of range(17) is\", sum(x))\nprint(\"Sum of range(17) starting with 5 is\", sum(x, 5))\n\ntry:\n    print(str(\"1\", offer=2))\nexcept Exception as e:\n    print(\"Too many args, some keywords\", repr(e))\n\n# TODO: This is calls, not really builtins.\na = 2\n\nprint(\"Can optimize the star list argness away\", int(*(a,)), end=\" \")\nprint(\"Can optimize the empty star list arg away\", int(*tuple()), end=\" \")\nprint(\"Can optimize the empty star dict arg away\", int(**dict()))\n\nprint(\"Dict building with keyword arguments\", dict(), dict(a=f))\nprint(\n    \"Dictionary entirely from constant args\",\n    displayDict(dict(q=\"Guido\", w=\"van\", e=\"Rossum\", r=\"invented\", t=\"Python\", y=\"\")),\n)\n\na = 5\nprint(\"Instance check recognises\", isinstance(a, int))\n\ntry:\n    print(\"Instance check with too many arguments\", isinstance(a, float, int))\nexcept Exception as e:\n    print(\"Too many args\", repr(e))\n\ntry:\n    print(\"Instance check with too many arguments\", isinstance(a))\nexcept Exception as e:\n    print(\"Too few args\", repr(e))\n\n\ndef usingIterToCheckIterable(a):\n    try:\n        iter(a)\n    except TypeError:\n        print(\"not iterable\")\n    else:\n        print(\"ok\")\n\n\nusingIterToCheckIterable(1)\n\nprint(\n    \"Nested constant, dict inside a list, referencing a built-in compile time constant\",\n    end=\" \",\n)\nprint([dict(type=int)])\n\nprint(\"nan and -nan sign checks:\")\n\nprint(\"nan:\", float(\"nan\"), copysign(1.0, float(\"nan\")))\nprint(\"-nan:\", float(\"-nan\"), copysign(1.0, float(\"-nan\")))\n\nprint(\"Using != to detect nan floats:\")\na = float(\"nan\")\nif a != a:\n    print(\"is nan\")\nelse:\n    print(\"isn't nan\")\n\nprint(\"inf and -inf sign checks:\")\n\nprint(\"inf:\", float(\"inf\"), copysign(1.0, float(\"inf\")))\nprint(\"-inf:\", float(\"-inf\"), copysign(1.0, float(\"-inf\")))\n\n\nclass CustomStr(str):\n    pass\n\n\nclass CustomBytes(bytes):\n    pass\n\n\nclass CustomByteArray(bytearray):\n    pass\n\n\nvalues = [\n    b\"100\",\n    b\"\",\n    bytearray(b\"100\"),\n    CustomStr(\"100\"),\n    CustomBytes(b\"100\"),\n    CustomByteArray(b\"100\"),\n]\n\nfor x in values:\n    try:\n        print(\"int\", repr(x), int(x), int(x, 2))\n    except (TypeError, ValueError) as e:\n        print(\"caught\", repr(e))\n\n    try:\n        print(\"long\", repr(x), long(x), long(x, 2))\n    except (TypeError, ValueError) as e:\n        print(\"caught\", repr(e))\n    except NameError:\n        print(\"Python3 has no long\")\n\n\nz = range(5)\ntry:\n    next(z)\nexcept TypeError as e:\n    print(\"caught\", repr(e))\n\ntry:\n    open()\nexcept TypeError as e:\n    print(\"Open without arguments gives\", repr(e))\n\nprint(\"Type of id values:\", type(id(id)))\n\n\nclass OtherBytesSubclass(bytes):\n    pass\n\n\nclass BytesOverload:\n    def __bytes__(self):\n        return OtherBytesSubclass()\n\n\nb = BytesOverload()\nv = bytes(b)\n\nif type(v) is bytes:\n    print(\"Bytes overload ineffective (expected for Python2)\")\nelif isinstance(v, bytes):\n    print(\"Bytes overload successful.\")\nelse:\n    print(\"Oops, must not happen.\")\n\n\nclass OtherFloatSubclass(float):\n    pass\n\n\nclass FloatOverload:\n    def __float__(self):\n        return OtherFloatSubclass()\n\n\nb = FloatOverload()\nv = float(b)\n\nif type(v) is float:\n    print(\"Float overload ineffective (must not happen)\")\nelif isinstance(v, float):\n    print(\"Float overload successful.\")\nelse:\n    print(\"Oops, must not happen.\")\n\n\nclass OtherStrSubclass(str):\n    pass\n\n\nclass StrOverload:\n    def __str__(self):\n        return OtherStrSubclass()\n\n\nb = StrOverload()\nv = str(b)\n\nif type(v) is str:\n    print(\"Str overload ineffective (must not happen)\")\nelif isinstance(v, str):\n    print(\"Str overload successful.\")\nelse:\n    print(\"Oops, must not happen.\")\n\nif str is bytes:\n    # makes sense with Python2 only.\n\n    class OtherUnicodeSubclass(unicode):  # pylint: disable=undefined-variable\n        pass\n\n    class UnicodeOverload:\n        def __unicode__(self):\n            return OtherUnicodeSubclass()\n\n    b = UnicodeOverload()\n\n    v = unicode(b)  # pylint: disable=undefined-variable\n\n    if type(v) is unicode:  # pylint: disable=undefined-variable\n        print(\"Unicode overload ineffective (must not happen)\")\n    elif isinstance(v, unicode):  # pylint: disable=undefined-variable\n        print(\"Unicode overload successful.\")\n    else:\n        print(\"Oops, must not happen.\")\n\n\nclass OtherIntSubclass(int):\n    pass\n\n\nclass IntOverload:\n    def __int__(self):\n        return OtherIntSubclass()\n\n\nb = IntOverload()\nv = int(b)\n\nif type(v) is int:\n    print(\"Int overload ineffective (must not happen)\")\nelif isinstance(v, int):\n    print(\"Int overload successful.\")\nelse:\n    print(\"Oops, must not happen.\")\n\n\nif str is bytes:\n    # Makes sense with Python2 only, no long for Python3.\n\n    class OtherLongSubclass(long):  # pylint: disable=undefined-variable\n        pass\n\n    class LongOverload:\n        def __long__(self):\n            return OtherLongSubclass()\n\n    b = LongOverload()\n    v = long(b)  # pylint: disable=undefined-variable\n\n    if type(v) is long:  # pylint: disable=undefined-variable\n        print(\"Long overload ineffective (must not happen)\")\n    elif isinstance(v, long):  # pylint: disable=undefined-variable\n        print(\"Long overload successful.\")\n    else:\n        print(\"Oops, must not happen.\")\n\n\nclass OtherComplexSubclass(complex):\n    pass\n\n\nclass ComplexOverload:\n    def __complex__(self):\n        return OtherComplexSubclass()\n\n\nb = ComplexOverload()\nv = complex(b)\n\nif type(v) is complex:\n    print(\"Complex overload ineffective (must happen)\")\nelif isinstance(v, complex):\n    print(\"Oops, must not happen.\")\nelse:\n    print(\"Oops, must not happen.\")\n\nprint(\"Tests for abs():\")\nprint(abs(-(1000000**10)))\nprint(abs(len([1, 2, 3])))\nprint(abs(-100))\nprint(abs(float(\"nan\")))\nprint(\"abs() with list:\")\ntry:\n    print(abs([1, 2]))\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\n\n# Making a condition >42 incrementally True\ndef S1():\n    print(\"Yielding 40\")\n    yield 40\n    print(\"Yielding 60\")\n    yield 60\n    print(\"Yielding 30\")\n    yield 30\n\n\n# Making a condition >42 incrementally False\ndef S2():\n    print(\"Yielding 60\")\n    yield 60\n    print(\"Yielding 40\")\n    yield 40\n    print(\"Yielding 30\")\n    yield 30\n\n\n# Test for \"all\" built-in\nprint(all(x > 42 for x in S1()))\nprint(all(x > 42 for x in S2()))\n\nprint(\"Disallowed all() without args:\")\ntry:\n    print(all())\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"all() with float not iterable:\")\ntry:\n    print(all(1.0))\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"all() with float type not iterable:\")\ntry:\n    print(any(float))\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"all with compile time lists:\")\nprint(all([None, None, None]))\nprint(all([None, 4, None]))\nprint(all([]))\nprint(all([0] * 20000))\nprint(all([0] * 255))\nprint(\"all with compile time ranges:\")\nprint(all(range(1, 10000)))\nprint(all(range(10000)))\nprint(all(range(2, 999, 4)))\nprint(\"all with compile time strings and bytes:\")\nprint(all(\"Nuitka rocks!\"))\nprint(all(\"string\"))\nprint(all(\"unicode\"))\nprint(all(b\"bytes\"))\nprint(all(b\"bytes\\0\"))\n\nprint(any(x > 42 for x in S1()))\nprint(any(x > 42 for x in S2()))\n\nprint(\"Disallowed any() without args:\")\ntry:\n    print(any())\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"any() with float not iterable:\")\ntry:\n    print(any(1.0))\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"any() with float type not iterable:\")\ntry:\n    print(any(float))\nexcept Exception as e:\n    print(\"caught \", repr(e))\n\nprint(\"any() with sets:\")\nprint(any(set([0, 1, 2, 3, 3])))\nprint(any({1: \"One\", 2: \"Two\"}))\n\nprint(\"any with compile time lists:\")\nprint(any([None, None, None]))\nprint(any([None, 4, None]))\nprint(any([]))\nprint(any([0] * 20000))\nprint(any([0] * 255))\nprint(\"any with compile time ranges:\")\nprint(any(range(1, 10000)))\nprint(any(range(10000)))\nprint(any(range(2, 999, 4)))\nprint(\"any with compile time strings and bytes:\")\nprint(any(\"Nuitka rocks!\"))\nprint(any(\"string\"))\nprint(any(\"unicode\"))\nprint(any(b\"bytes\"))\nprint(any(b\"bytes\\0\"))\n\nprint(\"Tests for zip():\")\nprint(zip(\"abc\", \"cdd\"))\nprint(zip([1, 2, 3], [2, 3, 4]))\nprint(zip([1, 2, 3], \"String\"))\ntry:\n    zip(1, \"String\")\nexcept TypeError as e:\n    print(\"Occurred\", repr(e))\nprint(zip())\nx = [(u, v) for (u, v) in zip(range(8), reversed(range(8)))]\nprint(x)\nfor v in zip([1, 2, 3], \"String\"):\n    print(v)\n\n# This used to crash, because of how variables are to be picked apart rather\n# that propagated as call argument.\nfunc = \"{foo}\".format\nprint(func(foo=\"Foo\"))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ClassMinimalTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Very minimal class example, to be used for debugging.\n\na = 1\n\n\nclass B:\n    b = a\n\n\nprint(B.b)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ClassesTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef displayDict(d):\n    if \"__loader__\" in d:\n        d = dict(d)\n        d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d = dict(d)\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    # Avoid recursion that we don't offer for classes.\n    if \"__locals__\" in d:\n        d = dict(d)\n        del d[\"__locals__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nclass SimpleClass:\n    \" The class documentation.\"  # Leading space on purpose.\n\n    # TODO: Doesn't work with Python3, because we don't yet make our own dict\n    # visible.  print locals()\n    print \"Class locals, while building\", displayDict(locals())\n\n    class_var = 1\n\n    def __init__(self, init_parameter):\n        self.x = init_parameter\n\n    def normal_method(self, arg1, arg2):\n        self.arg1 = arg1\n        self.arg2 = arg2\n\n        return self.arg1, self.arg2, self.x, self\n\n    @staticmethod\n    def static_method():\n        return \"something\"\n\n\nprint \"Simple class:\", SimpleClass\nprint \"Lives in\", SimpleClass.__module__\nprint \"Documentation\", SimpleClass.__doc__\nprint \"Instantiate simple class:\", SimpleClass(14)\nprint \"Call simple class normal method:\", SimpleClass(11).normal_method(1, 2)\nprint \"Call simple class static method:\", SimpleClass(11).static_method()\n\n\nclass MetaClass(type):\n    def __init__(cls, name, bases, dictionary):\n        print \"MetaClass is called.\"\n        cls.addedin = 5\n\n\nprint MetaClass\n\n\nclass ComplexClass:\n    __metaclass__ = MetaClass\n\n\nprint ComplexClass, dir(ComplexClass)\n\nprint ComplexClass, hasattr(ComplexClass, \"addedin\") and ComplexClass.addedin\n\n\ndef function():\n    x = 1\n\n    class DynamicClass:\n        y = x\n\n    x = 2\n\n    return DynamicClass\n\n\nprint function(), function().y\n\n\ndef strangeClassBehaviour():\n    class StrangeClass(object):\n        count = 0\n\n        def __new__(cls):\n            print \"__new__\"\n\n            cls.count += 1\n            return object.__new__(cls)\n\n        def __del__(self):\n            print \"__del__\"\n\n            cls = self.__class__\n            cls.count -= 1\n            assert cls.count >= 0\n\n    x = StrangeClass()\n\n    return x.count\n\n\nprint \"Strange class with __new__ and __del__ overloads\", strangeClassBehaviour()\n\n\nclass ClosureLocalizer:\n    function = function\n\n    # Using what looks like a method as a decorator.\n    def deco(f):\n        f.decorated = True\n\n        return f\n\n    @deco\n    def x(self):\n        pass\n\n\nprint \"Class with a name from module level renamed to local\", ClosureLocalizer.function\nprint \"Class method decorated\", ClosureLocalizer().x.decorated\n\nprint \"Class with decorator and meta class:\"\n\n\ndef classdecorator(cls):\n    print \"cls decorator\", cls.addedin\n\n    return cls\n\n\n@classdecorator\nclass MyClass:\n    __metaclass__ = MetaClass\n\n\nprint \"Class that updates its locals:\",\n\n\nclass DictUpdating:\n    a = 1\n\n    locals().update({\"b\": 2})\n\n    for f in range(6):\n        locals()[\"test_%s\" % f] = f\n\n\nprint \"Changed values\", DictUpdating.b, DictUpdating.test_4\n\n\ndef functionThatOffersClosureToPassThroughClass(x):\n    class Foo:\n        global x\n        x = 1\n\n        def __call__(self, y):\n            return x + y\n\n    return Foo()\n\n\nprint functionThatOffersClosureToPassThroughClass(6)(2),\nprint x\n\n\nclass NameCollisionClosure:\n    def x(self):\n        return x\n\n\nprint NameCollisionClosure, NameCollisionClosure().x()\n\n\nclass ClassesWithNestedClass:\n    class NestedClass(object):\n        def getDict(self):\n            return {\"a\": 2}\n\n\nprint \"Classes:\"\nprint ClassesWithNestedClass,\nprint ClassesWithNestedClass().NestedClass,\nprint ClassesWithNestedClass().NestedClass().getDict()\n\nsecondary = \"global closure wins\"\n\n\nclass ClassWithModuleVariableCollisionMain:\n    secondary = None\n\n    def __init__(self):\n        self.secondary = self.Child()\n        self.value = self.secondary.attr\n\n    class Child:\n        def __init__(self):\n            self.attr = secondary\n\n\nprint ClassWithModuleVariableCollisionMain, ClassWithModuleVariableCollisionMain().value\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ClassesTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Covers call order of Python3 meta classes. \"\"\"\n\n# nuitka-project: --nofollow-imports\n\n\ntry:\n    from collections.abc import OrderedDict\nexcept ImportError:\n    from collections import OrderedDict\n\nprint(\"Call order of Python3 meta classes:\")\n\n\ndef a():\n    x = 1\n\n    class A:\n        print(\"Class body a.A is evaluating closure x\", x)\n\n    print(\"Called\", a)\n\n    return A\n\n\ndef b():\n    class B:\n        pass\n\n    print(\"Called\", b)\n\n    return B\n\n\ndef displayable(dictionary):\n    return sorted(dictionary.items())\n\n\ndef m():\n    class M(type):\n        def __new__(cls, class_name, bases, attrs, **over):\n            print(\n                \"Metaclass M.__new__ cls\",\n                cls,\n                \"name\",\n                class_name,\n                \"bases\",\n                bases,\n                \"dict\",\n                displayable(attrs),\n                \"extra class defs\",\n                displayable(over),\n            )\n\n            return type.__new__(cls, class_name, bases, attrs)\n\n        def __init__(self, name, bases, attrs, **over):\n            print(\n                \"Metaclass M.__init__\",\n                name,\n                bases,\n                displayable(attrs),\n                displayable(over),\n            )\n            super().__init__(name, bases, attrs)\n\n        def __prepare__(cls, bases, **over):\n            print(\"Metaclass M.__prepare__\", cls, bases, displayable(over))\n            return OrderedDict()\n\n    print(\"Called\", m)\n\n    return M\n\n\ndef d():\n    print(\"Called\", d)\n\n    return 1\n\n\ndef e():\n    print(\"Called\", e)\n\n    return 2\n\n\nclass C1(a(), b(), other=d(), metaclass=m(), yet_other=e()):\n    import sys\n\n    # TODO: Enable this.\n    # print(\"C1 locals type is\", type(sys._getframe().f_locals))\n\n\nprint(\"OK, class created\", C1)\n\nprint(\"Attribute C1.__dict__ has type\", type(C1.__dict__))\n\n\nprint(\"Function local classes can be made global and get proper __qualname__:\")\n\n\ndef someFunctionWithLocalClassesMadeGlobal():\n    # Affects __qualname__ only in Python3.4 or higher, not in Python3.2\n    global C\n\n    class C:\n        pass\n\n        class D:\n            pass\n\n        try:\n            print(\"Nested class qualname is\", D.__qualname__)\n        except AttributeError:\n            # Python3.2\n            pass\n\n    try:\n        print(\"Local class made global qualname is\", C.__qualname__)\n    except AttributeError:\n        pass\n\n\nsomeFunctionWithLocalClassesMadeGlobal()\n\nprint(\"Function in a class with private name\")\n\n\nclass someClassWithPrivateArgumentNames:\n    def f(self, *, __kw: 1):\n        pass\n\n\nprint(someClassWithPrivateArgumentNames.f.__annotations__)\nprint(\"OK.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ClassesTest34.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Covers Python3 meta classes with __prepare__ non-dict values. \"\"\"\n\n# nuitka-project: --nofollow-imports\n\nfrom enum import Enum\n\nprint(\"Enum class with duplicate enumeration values:\")\ntry:\n\n    class Color(Enum):\n        red = 1\n        green = 2\n        blue = 3\n        red = 4\n\n        print(\"not allowed to get here\")\n\nexcept Exception as e:\n    print(\"Occurred\", e)\n\nprint(\"Class variable that conflicts with closure variable:\")\n\n\ndef testClassNamespaceOverridesClosure():\n    # See #17853.\n    x = 42\n\n    class X:\n        locals()[\"x\"] = 43\n        y = x\n\n    print(\"should be 43:\", X.y)\n\n\ntestClassNamespaceOverridesClosure()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ComparisonChainsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Comparison chains are multiple comparisons in one expression.\n\n\"\"\"\n\nfrom __future__ import print_function\n\n# pylint: disable=redefined-outer-name\n\n\ndef simple_comparisons(x, y):\n    if \"a\" <= x <= y <= \"z\":\n        print(\"One\")\n\n    if \"a\" <= x <= \"z\":\n        print(\"Two\")\n\n    if \"a\" <= x > \"z\":\n        print(\"Three\")\n\n\nprint(\"Simple comparisons:\")\n\nsimple_comparisons(\"c\", \"d\")\n\n\ndef side_effect():\n    print(\"<side_effect>\")\n\n    return 7\n\n\ndef side_effect_comparisons():\n    print(\"Should have side effect:\")\n    print(1 < side_effect() < 9)\n\n    print(\"Should not have side effect due to short circuit:\")\n    print(3 < 2 < side_effect() < 9)\n\n\nprint(\"Check for expected side effects only:\")\n\nside_effect_comparisons()\n\n\ndef function_torture_is():\n    a = (1, 2, 3)\n\n    for x in a:\n        for y in a:\n            for z in a:\n                print(x, y, z, \":\", x is y is z, x is not y is not z)\n\n\nfunction_torture_is()\n\nprint(\"Check if lambda can have expression chains:\", end=\"\")\n\n\ndef function_lambda_with_chain():\n    a = (1, 2, 3)\n\n    x = lambda x: x[0] < x[1] < x[2]\n\n    print(\"lambda result is\", x(a))\n\n\nfunction_lambda_with_chain()\n\nprint(\"Check if generators can have expression chains:\", end=\"\")\n\n\ndef generator_function_with_chain():\n    x = (1, 2, 3)\n\n    yield x[0] < x[1] < x[2]\n\n\nprint(list(generator_function_with_chain()))\n\nprint(\"Check if list contractions can have expression chains:\", end=\"\")\n\n\ndef contraction_with_chain():\n    return [x[0] < x[1] < x[2] for x in [(1, 2, 3)]]\n\n\nprint(contraction_with_chain())\n\nprint(\"Check if generator expressions can have expression chains:\", end=\"\")\n\n\ndef genexpr_with_chain():\n    return (x[0] < x[1] < x[2] for x in [(1, 2, 3)])\n\n\nprint(list(genexpr_with_chain()))\n\nprint(\"Check if class bodies can have expression chains:\", end=\"\")\n\n\nclass ClassWithComparisonChainInBody:\n    x = (1, 2, 3)\n    print(x[0] < x[1] < x[2])\n\n\nx = (1, 2, 3)\nprint(x[0] < x[1] < x[2])\n\n\nclass CustomOps(int):\n    def __lt__(self, other):\n        print(\"enter <\", self, other)\n\n        return True\n\n    def __gt__(self, other):\n        print(\"enter >\", self, other)\n\n        return False\n\n\nprint(\"Custom ops, to enforce chain eval order and short circuit:\", end=\"\")\nprint(CustomOps(7) < CustomOps(8) > CustomOps(6))\n\nprint(\"Custom ops, doing short circuit:\", end=\"\")\nprint(CustomOps(8) > CustomOps(7) < CustomOps(6))\n\n\ndef inOperatorChain():\n    print(\"In operator chains:\")\n    print(3 in [3, 4] in [[3, 4]])\n    print(3 in [3, 4] not in [[3, 4]])\n\n    if 3 in [3, 4] in [[3, 4]]:\n        print(\"Yes\")\n    else:\n        print(\"No\")\n\n    if 3 in [3, 4] not in [[3, 4]]:\n        print(\"Yes\")\n    else:\n        print(\"No\")\n\n\ninOperatorChain()\n\n# Make sure the values are called and order is correct:\n\n\nclass TracingLessThan(object):\n    def __init__(self, name, value):\n        self.name = name\n        self.value = value\n\n    def __repr__(self):\n        return \"<Value %s %d>\" % (self.name, self.value)\n\n    def __lt__(self, other):\n        print(\n            \"less than called for:\",\n            self,\n            other,\n            self.value,\n            other.value,\n            self.value < other.value,\n        )\n\n        if self.value < other.value:\n            print(\"good\")\n            return 7\n        else:\n            print(\"bad\")\n            return 0\n\n\na = TracingLessThan(\"a\", 1)\nb = TracingLessThan(\"b\", 2)\nc = TracingLessThan(\"c\", 0)\n\nprint(a < b < c)\nprint(\"*\" * 80)\n\na = TracingLessThan(\"a\", 2)\nb = TracingLessThan(\"b\", 1)\nc = TracingLessThan(\"c\", 0)\n\nprint(a < b < c)\n\n# Partial type knowledge:\nprint(\"*\" * 80)\nprint(\"Partial type knowledge in comparisons:\")\n\n\ndef compareDigitsSuccess(x):\n    return 2 < len(x) < 1000\n\n\ndef compareDigitsFirstFalse(x):\n    return 3 < len(x) < 1000\n\n\ndef compareDigitsSecondFalse(x):\n    return 2 < len(x) < 3\n\n\nv = [20] * 3\n\nprint(compareDigitsSuccess(v))\nprint(compareDigitsFirstFalse(v))\nprint(compareDigitsSecondFalse(v))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ConstantsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Playing around with constants only. \"\"\"\n\n# pylint: disable=invalid-name,redefined-outer-name\n\nfrom __future__ import print_function\n\ntry:\n    long\nexcept NameError:\n    long = int\n\n\ndef displayDict(d):\n    result = \"{\"\n    first = True\n    for key, value in sorted(d.items()):\n        if not first:\n            result += \",\"\n\n        result += \"%s: %s\" % (repr(key), repr(value))\n        first = False\n    result += \"}\"\n\n    return result\n\n\nprint(\"A bunch of constants and their representation:\")\nfor value in (0, 3, -4, 17, \"hey\", (0,), 0.0, -0.0):\n    print(value, \":\", repr(value))\n\nprint(\"Comparing constants, optimizable:\")\nprint(1 == 0)\n\nprint(\"Representation of long constants:\")\na = long(0)\nprint(repr(long(0)), repr(a) == \"0L\")\n\nprint(\"Identity of empty dictionary constants:\")\nprint({} is {})\n\na = ({}, [])\n\na[0][1] = 2\na[1].append(3)\n\nprint(\"Mutable list and dict inside an immutable tuple:\")\nprint(a)\n\nprint(\"Empty list and dict are hopefully unchanged:\")\nprint(({}, []))\n\n\ndef argChanger(a):\n    a[0][1] = 2\n    a[1].append(3)\n\n    return a\n\n\nprint(\"Mutable list and dict inside an immutable tuple as arguments:\")\nprint(argChanger(({}, [])))\n\nprint(\"Empty list and dict are hopefully still unchanged:\")\nprint(({}, []))\n\nprint(\"Set constants:\")\nprint(set([\"foo\"]))\n\n\ndef mutableConstantChanger():\n    a = ([1, 2], [3])\n\n    print(\"Start out with value:\")\n    print(a)\n\n    a[1].append(5)\n    print(\"Changed to value:\")\n    print(a)\n\n    d = {\"l\": [], \"m\": []}\n    print(\"Start out with value:\")\n    print(d)\n\n    d[\"l\"].append(7)\n    print(\"Changed to value:\")\n    print(d)\n\n    spec = dict(qual=[], storage=set(), type=[], function=set(), q=1)\n    spec[\"type\"].insert(0, 2)\n    spec[\"storage\"].add(3)\n    print(\"Dictionary created from dict built-in.\")\n    print(sorted(spec))\n\n\nmutableConstantChanger()\nprint(\"Redo constant changes, to catch corruptions:\")\nmutableConstantChanger()\n\n\ndef defaultKeepsIdentity(arg=\"str_value\"):\n    print(\"Default constant values are still shared if immutable:\", arg is \"str_value\")\n\n\ndefaultKeepsIdentity()\n\n\n# Dictionary creation from call arguments.\ndef dd(**d):\n    return d\n\n\ndef f():\n    def one():\n        print(\"one\")\n\n    def two():\n        print(\"two\")\n\n    a = dd(qual=one(), storage=two(), type=[], function=[])\n    print(\"f mutable\", displayDict(a))\n    a = dd(qual=1, storage=2, type=3, function=4)\n    print(\"f immutable\", displayDict(a))\n\n    x = {\"p\": 7}\n    a = dd(qual=[], storage=[], type=[], function=[], **x)\n    print(\"f ext mutable\", displayDict(a))\n    x = {\"p\": 8}\n    a = dd(qual=1, storage=2, type=3, function=4, **x)\n    print(\"f ext immutable\", displayDict(a))\n\n\nf()\n\n# Dictionary creation one after another\nx = {}\nx[\"function\"] = []\nx[\"type\"] = []\nx[\"storage\"] = []\nx[\"qual\"] = []\nprint(\"Manual built dictionary:\", x)\nx = {}\nx[\"function\"] = 1\nx[\"type\"] = 2\nx[\"storage\"] = 3\nx[\"qual\"] = 4\nprint(\"Manual built dictionary:\", x)\n\n# Constants in the code must be created differently.\nd = {\"qual\": [], \"storage\": [], \"type2\": [], \"function\": []}\nprint(\"Mutable values dictionary constant:\", displayDict(d))\nd = {\"qual\": 1, \"storage\": 2, \"type2\": 3, \"function\": 4}\nprint(\"Immutable values dictionary constant:\", displayDict(d))\n\n# Constants that might be difficult\nmin_signed_int = int(-(2 ** (8 * 8 - 1) - 1) - 1)\nprint(\"Small int:\", min_signed_int, type(min_signed_int))\nmin_signed_int = int(-(2 ** (8 * 4 - 1) - 1) - 1)\nprint(\"Small int\", min_signed_int, type(min_signed_int))\n\n# Constants that might be difficult\nmin_signed_long = long(-(2 ** (8 * 8 - 1) - 1) - 1)\nprint(\"Small long\", min_signed_long, type(min_signed_long))\nmin_signed_long = long(-(2 ** (8 * 4 - 1) - 1) - 1)\nprint(\"Small long\", min_signed_long, type(min_signed_long))\n\ntry:\n    type_prepare = type.__prepare__\nexcept AttributeError:\n    print(\"Python2 has no type.__prepare__\")\nelse:\n    print(\"Type prepare\", type_prepare)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ConstantsTest27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Clash in constants reveals order:\")\nx = {True, 1}\nprint(x)\n\nprint(\"Complex constant using sets with clashes at run time:\")\ny = True\nx = ({1}, {1, True}, {1, 1.0}, {1, y})\nprint(x)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/DecoratorsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef decorator1(f):\n    print(\"Executing decorator 1\")\n\n    def deco_f():\n        return f() + 2\n\n    return deco_f\n\n\ndef decorator2(f):\n    print(\"Executing decorator 2\")\n\n    def deco_f():\n        return f() * 2\n\n    return deco_f\n\n\n# Result of function now depends on correct order of applying the decorators\n@decorator1\n@decorator2\ndef function1():\n    return 3\n\n\nprint(function1())\n\n\ndef deco_returner1():\n    print(\"Executing decorator returner D1\")\n    return decorator1\n\n\ndef deco_returner2():\n    print(\"Executing decorator returner D2\")\n    return decorator2\n\n\n@deco_returner1()\n@deco_returner2()\ndef function2():\n    return 3\n\n\nprint(function2())\n\n\n# Same as function2, but without decorator syntax.\ndef function3():\n    return 3\n\n\nfunction3 = deco_returner1()(deco_returner2()(function3))\n\nprint(function3())\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/DefaultParametersTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tests to cover default parameter behaviors.\n\n\"\"\"\n\nfrom __future__ import print_function\n\n# nuitka-project: --nofollow-imports\n\n# pylint: disable=dangerous-default-value,unused-argument\n\nmodule_level = 1\n\n\ndef defaultValueTest1(no_default, some_default_constant=1):\n    return some_default_constant\n\n\ndef defaultValueTest2(no_default, some_default_computed=module_level * 2):\n    local_var = no_default\n    return local_var, some_default_computed\n\n\ndef defaultValueTest3(no_default, func_defaulted=defaultValueTest1(module_level)):\n    return [func_defaulted for _i in range(8)]\n\n\ndef defaultValueTest4(no_default, lambda_defaulted=lambda x: x**2):\n    c = 1\n    d = 1\n    return (i + c + d for i in range(8))\n\n\ndef defaultValueTest5(no_default, tuple_defaulted=(1, 2, 3)):\n    return tuple_defaulted\n\n\ndef defaultValueTest6(no_default, list_defaulted=[1, 2, 3]):\n    list_defaulted.append(5)\n\n    return list_defaulted\n\n\nprint(defaultValueTest1(\"ignored\"))\n\n# The change of the default variable doesn't influence the default\n# parameter of defaultValueTest2, that means it's also calculated\n# at the time the function is defined.\nmodule_level = 7\nprint(defaultValueTest2(\"also ignored\"))\n\nprint(defaultValueTest3(\"no-no not again\"))\n\nprint(list(defaultValueTest4(\"unused\")))\n\nprint(defaultValueTest5(\"unused\"))\n\nprint(defaultValueTest6(\"unused\"), end=\"\")\nprint(defaultValueTest6(\"unused\"))\n\nprint(defaultValueTest6.__defaults__)\n\ndefaultValueTest6.func_defaults = ([1, 2, 3],)\nprint(defaultValueTest6.__defaults__)\n\nprint(defaultValueTest6(1))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/DoubleDeletionsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# nuitka-project: --nofollow-imports\n\na = 3\n\ndel a\n\ntry:\n    del a\nexcept NameError as e:\n    print(\"Raised expected exception:\", repr(e))\n\n\ndef someFunction(b, c):\n    b = 1\n\n    del b\n\n    try:\n        del b\n    except UnboundLocalError as e:\n        print(\"Raised expected exception:\", repr(e))\n\n\nsomeFunction(3, 4)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/EmptyModuleTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --nofollow-imports\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ExceptionRaisingTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nprint(\"Raising an exception type in a function:\")\n\n\ndef raiseExceptionClass():\n    raise ValueError\n\n\ntry:\n    raiseExceptionClass()\nexcept Exception as e:\n    print(\"Caught exception type\", e, repr(e), type(e))\n    print(\"Inside handler, sys.exc_info is this\", sys.exc_info())\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Raising an exception instance in a function:\")\n\n\ndef raiseExceptionInstance():\n    raise ValueError(\"hallo\")\n\n\ntry:\n    raiseExceptionInstance()\nexcept Exception as f:\n    print(\"Caught exception instance\", f, repr(f), type(f))\n    print(\"Inside handler, sys.exc_info is this\", sys.exc_info())\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Raising an exception, then catch it to re-raise it:\")\n\n\ndef raiseExceptionAndReraise(arg):\n    try:\n        return arg / arg\n    except:\n        raise\n\n\ntry:\n    raiseExceptionAndReraise(0)\nexcept:\n    print(\"Caught reraised\", sys.exc_info())\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Access an undefined global variable in a function:\")\n\n\ndef raiseNonGlobalError():\n    return undefined_value\n\n\ntry:\n    raiseNonGlobalError()\nexcept:\n    print(\"NameError caught\", sys.exc_info())\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Raise a new style class as an exception, should be rejected:\")\n\n\ndef raiseIllegalError():\n    class X(object):\n        pass\n\n    raise X()\n\n\ntry:\n    raiseIllegalError()\nexcept TypeError as E:\n    print(\"New style class exception correctly rejected:\", E)\nexcept:\n    print(sys.exc_info())\n    assert False, \"Error, new style class exception was not rejected\"\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Raise an old-style class, version dependent outcome:\")\n\n\nclass ClassicClassException:\n    pass\n\n\ndef raiseCustomError():\n    raise ClassicClassException()\n\n\ntry:\n    try:\n        raiseCustomError()\n    except ClassicClassException:\n        print(\"Caught classic class exception\")\n    except:\n        print(\"Default catch\", sys.exc_info())\n\n        assert False, \"Error, old style class exception was not caught\"\nexcept TypeError as e:\n    print(\"Python3 hates to even try and catch classic classes\", e)\nelse:\n    print(\"Classic exception catching was considered fine.\")\n\nprint(\"After catching, sys.exc_info is this\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Check lazy exception creation:\")\n\n\ndef checkExceptionConversion():\n    try:\n        raise Exception(\"some string\")\n    except Exception as err:\n        print(\"Caught raised object\", err, type(err))\n\n    try:\n        raise Exception, \"some string\"\n    except Exception as err:\n        print(\"Caught raised type, value pair\", err, type(err))\n\n\ncheckExceptionConversion()\nprint(\"*\" * 20)\n\nprint(\"Check exc_info scope:\")\n\n\ndef checkExcInfoScope():\n    try:\n        raise ValueError\n    except:\n        assert sys.exc_info()[0] is not None\n        assert sys.exc_info()[1] is not None\n        assert sys.exc_info()[2] is not None\n\n    if sys.version_info[0] < 3:\n        print(\"Exc_info remains visible after exception handler for Python2\")\n\n        assert sys.exc_info()[0] is not None\n        assert sys.exc_info()[1] is not None\n        assert sys.exc_info()[2] is not None\n    else:\n        print(\"Exc_info is clear after exception handler for Python3\")\n\n        assert sys.exc_info()[0] is None\n        assert sys.exc_info()[1] is None\n        assert sys.exc_info()[2] is None\n\n    def subFunction():\n        print(\"Entering with exception info\", sys.exc_info())\n\n        assert sys.exc_info()[0] is not None\n        assert sys.exc_info()[1] is not None\n        assert sys.exc_info()[2] is not None\n\n        try:\n            print(\"Trying\")\n        except:\n            pass\n\n        print(\n            \"After trying something and didn't have an exception, info is\",\n            sys.exc_info(),\n        )\n\n    print(\"Call a function inside the exception handler and check there too.\")\n\n    try:\n        raise KeyError\n    except:\n        assert sys.exc_info()[0] is not None\n        assert sys.exc_info()[1] is not None\n        assert sys.exc_info()[2] is not None\n\n        subFunction()\n\n    print(\"Call it twice and see.\")\n\n    try:\n        raise \"me\"\n    except:\n        assert sys.exc_info()[0] is not None\n        assert sys.exc_info()[1] is not None\n        assert sys.exc_info()[2] is not None\n\n        subFunction()\n        subFunction()\n\n\nif sys.version_info[0] < 3:\n    sys.exc_clear()\n\ncheckExcInfoScope()\n\nprint(\"*\" * 20)\n\n# Check that the sys.exc_info is cleared again, after being set inside the\n# function checkExcInfoScope, it should now be clear again.\nassert sys.exc_info()[0] is None, sys.exc_info()[0]\nassert sys.exc_info()[1] is None\nassert sys.exc_info()[2] is None\n\nprint(\"Check catching subclasses\")\n\n\ndef checkDerivedCatch():\n    class A(BaseException):\n        pass\n\n    class B(A):\n        def __init__(self):\n            pass\n\n    a = A()\n    b = B()\n\n    try:\n        raise A, b\n    except B, v:\n        print(\"Caught B\", v)\n    except A, v:\n        print(\"Didn't catch as B, but as A, Python3 does that\", v)\n    else:\n        print(\"Not caught A class, not allowed to happen.\")\n\n    try:\n        raise B, a\n    except TypeError, e:\n        print(\"TypeError with pair form for class not taking args:\", e)\n\n\ncheckDerivedCatch()\n\nprint(\"*\" * 20)\n\n\ndef checkNonCatch1():\n    print(\"Testing if the else branch is executed in the optimizable case:\")\n\n    try:\n        0\n    except TypeError:\n        print(\"Should not catch\")\n    else:\n        print(\"Executed else branch correctly\")\n\n\ncheckNonCatch1()\nprint(\"*\" * 20)\n\n\ndef checkNonCatch2():\n    try:\n        print(\"Testing if the else branch is executed in the non-optimizable case:\")\n    except TypeError:\n        print(\"Should not catch\")\n    else:\n        print(\"Executed else branch correctly\")\n\n\ncheckNonCatch2()\nprint(\"*\" * 20)\n\nprint(\"Checking raise that with exception arguments that raise error themselves.\")\n\n\ndef checkRaisingRaise():\n    def geterror():\n        return 1 / 0\n\n    try:\n        geterror()\n    except Exception as e:\n        print(\"Had exception\", e)\n\n    try:\n        raise TypeError, geterror()\n\n    except Exception as e:\n        print(\"Had exception\", e)\n\n    try:\n        raise TypeError, 7, geterror()\n\n    except Exception as e:\n        print(\"Had exception\", e)\n\n\ncheckRaisingRaise()\nprint(\"*\" * 20)\n\nprint(\"Checking a re-raise that isn't one:\")\n\n\ndef checkMisRaise():\n    raise\n\n\ntry:\n    checkMisRaise()\nexcept Exception as e:\n    print(\"Without existing exception, re-raise gives:\", e)\n\nprint(\"*\" * 20)\n\nprint(\"Raising an exception in an exception handler gives:\")\n\n\ndef nestedExceptions(a, b):\n    try:\n        a / b\n    except ZeroDivisionError:\n        a / b\n\n\ntry:\n    nestedExceptions(1, 0)\nexcept Exception as e:\n    print(\"Nested exception gives\", e)\n\nprint(\"*\" * 20)\n\nprint(\"Checking unpacking from an exception as a sequence:\")\n\n\ndef unpackingCatcher():\n    try:\n        raise ValueError(1, 2)\n    except ValueError as (a, b):\n        print(\"Unpacking caught exception and unpacked\", a, b)\n\n\nunpackingCatcher()\nprint(\"Afterwards, exception info is\", sys.exc_info())\n\nprint(\"*\" * 20)\n\nprint(\"Testing exception that escapes __del__ and therefore cannot be raised\")\n\n\ndef divide(a, b):\n    return a / b\n\n\ndef unraisableExceptionInDel():\n    class C:\n        def __del__(self):\n            c = divide(1, 0)\n            print(c)\n\n    def f():\n        C()\n\n    f()\n\n\nunraisableExceptionInDel()\nprint(\"*\" * 20)\n\nprint(\"Testing exception changes between generator switches:\")\n\n\ndef yieldExceptionInteraction():\n    def yield_raise():\n        print(\"Yield finds at generator entry\", sys.exc_info()[0])\n        try:\n            raise KeyError(\"caught\")\n        except KeyError:\n            yield sys.exc_info()[0]\n            yield sys.exc_info()[0]\n        yield sys.exc_info()[0]\n\n    g = yield_raise()\n    print(\"Initial yield from catch in generator\", next(g))\n    print(\"Checking from outside of generator\", sys.exc_info()[0])\n    print(\"Second yield from the catch reentered\", next(g))\n    print(\"Checking from outside of generator\", sys.exc_info()[0])\n    print(\"After leaving the catch generator yielded\", next(g))\n\n\nyieldExceptionInteraction()\nprint(\"*\" * 20)\n\nprint(\n    \"Testing exception change between generator switches while handling an own exception\"\n)\n\n\ndef yieldExceptionInteraction2():\n    def yield_raise():\n        print(\"Yield finds at generator entry\", sys.exc_info()[0])\n        try:\n            raise ValueError(\"caught\")\n        except ValueError:\n            yield sys.exc_info()[0]\n            yield sys.exc_info()[0]\n        yield sys.exc_info()[0]\n\n    try:\n        undefined_global\n    except Exception:\n        print(\"Checking from outside of generator with\", sys.exc_info()[0])\n        g = yield_raise()\n        v = next(g)\n        print(\"Initial yield from catch in generator:\", v)\n        print(\"Checking from outside the generator:\", sys.exc_info()[0])\n        print(\"Second yield from the catch reentered:\", next(g))\n        print(\"Checking from outside the generation again:\", sys.exc_info()[0])\n        print(\"After leaving the catch generator yielded:\", next(g))\n\n    print(\"After exiting the trying branch:\", sys.exc_info()[0])\n\n\nyieldExceptionInteraction2()\nprint(\"After function exit, no exception\", sys.exc_info())\nprint(\"*\" * 20)\n\nprint(\"Check what happens if a function attempts to clear the exception in a handler\")\n\n\ndef clearingException():\n    def clearit():\n        try:\n            if sys.version_info[0] < 3:\n                sys.exc_clear()\n        except KeyError:\n            pass\n\n    try:\n        raise KeyError\n    except:\n        print(\"Before clearing, it's\", sys.exc_info())\n        clearit()\n\n        print(\"After clearing, it's\", sys.exc_info())\n\n\nclearingException()\nprint(\"*\" * 20)\n\nprint(\"Check that multiple exceptions can be caught in a handler through a variable:\")\n\n\ndef multiCatchViaTupleVariable():\n    some_exceptions = (KeyError, ValueError)\n\n    try:\n        raise KeyError\n    except some_exceptions:\n        print(\"Yes, indeed.\")\n\n\nmultiCatchViaTupleVariable()\n\n\ndef raiseValueWithValue():\n    try:\n        raise ValueError(1, 2, 3), (ValueError(1, 2, 3))\n    except Exception as e:\n        print(\"Gives\", e)\n\n\nprint(\"Check exception given when value is raised with value\", raiseValueWithValue())\n\n# Make sure the \"repr\" of exceptions is fine\n\na = IOError\nprint(\"IOError is represented correctly:\", repr(a))\n\n\ndef raising():\n    raise ValueError\n\n\ndef not_raising():\n    pass\n\n\ndef raiseWithFinallyNotCorruptingLineNumber():\n    try:\n        try:\n            raising()\n        finally:\n            not_raising()\n    except ValueError:\n        print(\"Traceback is in tried block line\", sys.exc_info()[2].tb_lineno)\n\n\nraiseWithFinallyNotCorruptingLineNumber()\n\n\ndef wideCatchMustPublishException():\n    print(\"At entry, no exception\", sys.exc_info())\n\n    try:\n        undefined_global\n    except:\n        print(\"Inside handler:\", sys.exc_info())\n\n        pass\n\n    print(\"Outside handler:\", sys.exc_info())\n\n\nprint(\"Check that a unqualified catch properly preserves exception\")\nwideCatchMustPublishException()\n\nprint(\"Check if a nested exception handler does overwrite re-raised\")\n\n\ndef checkReraiseAfterNestedTryExcept():\n    def reraise():\n        try:\n            raise TypeError(\"outer\")\n        except Exception:\n            try:\n                raise KeyError(\"nested\")\n            except KeyError:\n                print(\"Current exception inside nested handler\", sys.exc_info())\n\n                pass\n\n            print(\"Current exception after nested handler exited\", sys.exc_info())\n\n            # Which one does this pick\n            raise\n\n    try:\n        reraise()\n    except Exception as e:\n        print(\"Caught\", repr(e))\n\n\ncheckReraiseAfterNestedTryExcept()\n\n\ndef checkReraiseByFunction():\n    def reraise():\n        raise\n\n    try:\n        try:\n            raise TypeError(\"outer\")\n        except Exception:\n            reraise()\n    except Exception as e:\n        import traceback\n\n        print(\"Exception traceback of re-raise:\")\n        print(\"-\" * 40)\n        traceback.print_exc()\n        print(\"-\" * 40)\n        print(\"OK.\")\n\n\n# TODO: Enable this, once the actual traceback of a function\n# re-raise isn't wrong (contains itself) anymore.\nif False:\n    checkReraiseByFunction()\n\n\ndef checkNoRaiseExceptionDictBuilding(arg):\n    a = {(): arg}\n\n    b = {None: arg}\n\n    c = {Ellipsis: arg}\n\n    d = {1.0j: arg}\n\n    e = {1.0: arg}\n\n    f = {long(0): arg}\n\n    g = {0: arg}\n\n    h = {type: arg}\n\n    return a, b, c, d, e, f, g, h\n\n\ncheckNoRaiseExceptionDictBuilding(1)\n\n\ndef checkRaiseExceptionDictBuildingRange(arg):\n    try:\n        i = {range(10): arg}\n    except Exception as e:\n        print(\"Raised\", repr(e))\n    else:\n        print(\"No exception, OK for Python2\")\n\n        return i\n\n\nprint(\"Check if range as dict key raises:\")\ncheckRaiseExceptionDictBuildingRange(2)\n\n\ndef checkRaiseExceptionDictBuildingTuple(arg):\n    try:\n        i = {(2, []): arg}\n    except Exception as e:\n        print(\"Raised\", repr(e))\n    else:\n        return i\n\n\nprint(\"Check if mutable tuple as dict key raises:\")\ncheckRaiseExceptionDictBuildingTuple(3)\n\n\ndef checkRaiseExceptionDictBuildingList(arg):\n    try:\n        i = {[2, ()]: arg}\n    except Exception as e:\n        print(\"Raised\", repr(e))\n    else:\n        return i\n\n\nprint(\"Check if list as dict key raises:\")\ncheckRaiseExceptionDictBuildingList(4)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ExceptionRaisingTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef raisy():\n    raise ValueError() from None\n\n\ntry:\n    print(\"Raising exception in a function 'from None':\")\n    raisy()\nexcept (ValueError, TypeError) as e:\n    print(\"Caught as\", repr(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ExceptionRaisingTest33.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nprint(\"Testing exception changes between generator switches:\")\n\n\ndef yieldExceptionInteraction():\n    def yield_raise():\n        try:\n            raise KeyError(\"caught\")\n        except KeyError:\n            yield from sys.exc_info()\n            yield from sys.exc_info()\n        yield from sys.exc_info()\n\n    g = yield_raise()\n    print(\"Initial yield from catch in generator\", next(g))\n    print(\"Checking from outside of generator\", sys.exc_info()[0])\n    print(\"Second yield from the catch reentered\", next(g))\n    print(\"Checking from outside of generator\", sys.exc_info()[0])\n    print(\"After leaving the catch generator yielded\", next(g))\n\n\nyieldExceptionInteraction()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ExecEvalTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport os\nimport sys\nimport tempfile\n\nprint \"eval 3+3=\", eval(\"3+3\")\nprint \"eval  4+4=\", eval(\" 4+4\")\n\n\ndef functionEval1():\n    return eval(\" 5+5\")\n\n\nprint \"eval in a function with nothing provided\", functionEval1()\n\n\ndef functionEval2():\n    a = [2]\n\n    g = {}\n\n    r = eval(\"1+3\", g)\n\n    return r, g.keys(), a\n\n\nprint \"eval in a function with globals provided\", functionEval2()\n\n\ndef functionEval3():\n    result = []\n\n    for x in eval(\"(1,2)\"):\n        result.append(x)\n\n    return result\n\n\nprint \"eval in a for loop as iterator giver\", functionEval3()\n\nprint \"exec on a global level\",\nexec (\"d=2+2\")\nprint \"2+2=\", d\n\n\ndef functionExec1():\n    a = 1\n\n    code = \"a=2\"\n    exec (code)\n\n    return a\n\n\ndef functionExec2():\n    a = 1\n\n    code = \"a=2\"\n    exec code in globals(), locals()\n\n    return a\n\n\nprint \"exec in function without and with locals() provided:\", functionExec1(), functionExec2()\n\ntmp_filename = tempfile.gettempdir() + \"/execfile.py\"\n\nf = open(tmp_filename, \"w\")\nf.write(\"e=7\\nf=8\\n\")\nf.close()\n\nexecfile(tmp_filename)\n\nprint \"execfile with defaults f,g=\", e, f\n\nglobal_vars = {\"e\": \"0\", \"f\": 0}\nlocal_vars = dict(global_vars)\n\nexecfile(tmp_filename, global_vars)\n\nprint \"execfile with globals dict:\", global_vars.keys()\n\nexecfile(tmp_filename, global_vars, local_vars)\n\nprint \"execfile with globals and locals dict:\", local_vars\n\n\ndef functionExecfile():\n    e = 0\n    f = 0\n\n    global_vars = {\"e\": \"0\", \"f\": 0}\n    local_vars = dict(global_vars)\n\n    print \"execfile with globals and locals dict in a function:\",\n    x = execfile(tmp_filename, global_vars, local_vars)\n    print x,\n    print global_vars.keys(), local_vars, e, f\n\n\nfunctionExecfile()\n\n\nclass classExecfile:\n    e = 0\n    f = 0\n\n    print \"execfile in a class:\",\n    # TODO: Won't work yet, Issue#5\n    # print execfile( tmp_filename ),\n    execfile(tmp_filename)\n    print \"execfile changed local values:\", e, f\n\n\nf = 7\n\n\ndef functionExecNonesTuple():\n    f = 0\n\n    exec (\"f=1\", None, None)\n    print \"Exec with None as optimizable tuple args did update locals:\", f\n\n\ndef functionExecNonesSyntax():\n    f = 0\n    exec \"f=2\" in None, None\n    print \"Exec with None as optimizable normal args did update locals:\", f\n\n\nfunctionExecNonesTuple()\nfunctionExecNonesSyntax()\n\nprint \"Global value is untouched\", f\n\n\ndef functionEvalNones2():\n    f = 11\n\n    code = \"f\"\n    g = None\n    l = None\n\n    f1 = eval(code, l, g)\n\n    print \"Eval with None arguments from variables did access locals:\", f1\n\n\nfunctionEvalNones2()\n\n\ndef functionExecNonesTuple2():\n    f = 0\n\n    code = \"f=1\"\n    g = None\n    l = None\n\n    exec (code, l, g)\n\n    print \"Exec with None as tuple args from variable did update locals:\", f\n\n\ndef functionExecNonesSyntax2():\n    f = 0\n\n    code = \"f=2\"\n    g = None\n    l = None\n\n    exec code in l, g\n\n    print \"Exec with None as normal args did update locals:\", f\n\n\nfunctionExecNonesTuple2()\nfunctionExecNonesSyntax2()\n\nprint \"Exec with a future division definition and one without:\"\n\nexec \"\"\"\nfrom __future__ import division\nfrom __future__ import print_function\nprint( \"3/2 is with future division\", 3/2 )\n\"\"\"\n\nexec \"\"\"\nfrom __future__ import print_function\nprint( \"3/2 is without future division\", 3/2 )\n\"\"\"\n\nx = 1\ny = 1\n\n\ndef functionGlobalsExecShadow():\n    global x\n    print \"Global x outside is\", x\n\n    y = 0\n    print \"Local y is initially\", y\n\n    print \"Locals initially\", locals()\n    exec \"\"\"\nfrom __future__ import print_function\nx = 2\nprint( \"Exec local x is\", x )\n\"\"\"\n    print \"Function global x referenced as local x in exec is\", x\n\n    exec \"\"\"\nfrom __future__ import print_function\nprint( \"Re-exec local x\", x )\n\"\"\"\n    print \"Locals after exec assigning to local x\", locals()\n\n    exec \"\"\"\nfrom __future__ import print_function\nglobal x\nx = 3\nprint( \"Exec global x is inside exec\", x )\n\"\"\"\n    print \"Global x referenced as global x in exec is\", x\n\n    exec \"\"\"\nfrom __future__ import print_function\ndef change_y():\n   global y\n   y = 4\n\n   print( \"Exec function global y is\", y )\n\ny = 7\nchange_y()\n\n# TODO: The below will not work\nprint( \"Exec local y is\", y )\n\"\"\"\n    # print \"Local y is afterwards\", y\n\n    def print_global_y():\n        global y\n\n        # TODO: The below will not work\n        print \"Global y outside\", y\n\n    print_global_y()\n    print \"Outside y\", y\n\n\nfunctionGlobalsExecShadow()\n\n\ndef functionWithClosureProvidedByExec():\n\n    code = \"ValueError = TypeError\"\n\n    exec code in None, None\n\n    def func():\n        print \"Closure from exec not used\", ValueError\n\n    func()\n\n\nfunctionWithClosureProvidedByExec()\n\nx = 2\n\n\ndef functionWithExecAffectingClosure():\n    x = 4\n\n    code = \"d=3;x=5\"\n    space = locals()\n\n    exec code in space\n\n    def closureMaker():\n        return x\n\n    return d, closureMaker()\n\n\nprint \"Closure in a function with exec to not none\", functionWithExecAffectingClosure()\n\n\ndef generatorFunctionWithExec():\n    yield 1\n\n    code = \"y = 2\"\n    exec code\n\n    yield y\n\n\nprint \"Exec in a generator function\", tuple(generatorFunctionWithExec())\n\n\ndef evalInContractions():\n\n    r1 = list(eval(str(s)) for s in range(3))\n    r2 = [eval(str(s)) for s in range(4)]\n\n    return r1, r2\n\n\nprint \"Eval in a list contraction or generator expression\", evalInContractions()\n\n\ndef execDefinesFunctionToLocalsExplicitly():\n    exec \"\"\"\\\ndef makeAddPair(a, b):\n    def addPair(c, d):\n        return (a + c, b + d)\n    return addPair\n\"\"\" in locals()\n\n    if sys.version_info < (3,):\n        assert makeAddPair\n\n    return \"yes\"\n\n\nprint \"Exec adds functions declares in explicit locals() given.\", execDefinesFunctionToLocalsExplicitly()\n\nos.unlink(tmp_filename)\n\n\ndef execWithShortTuple():\n    try:\n        exec (\"print hey\",)\n    except Exception as e:\n        return \"gives exception: \" + repr(e)\n\n\nprint \"Exec with too short tuple argument:\", execWithShortTuple()\n\nif str is not bytes:\n\n    def evalMemoryView(value):\n        return eval(memoryview(value))\n\n    print \"Eval with memory view:\", evalMemoryView(b\"27\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ExtremeClosureTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" These tests contain all forms of closure absuse.\n\n\"\"\"\n\nfrom __future__ import print_function\n\na = 1\nb = 1\n\n\ndef someFunction():\n    a = a  # pylint: disable=redefined-outer-name,unused-variable\n\n\nclass SomeClass:\n    b = b\n\n\nSomeClass()\n\ntry:\n    someFunction()\nexcept UnboundLocalError as e:\n    print(\"Expected unbound local error occurred:\", repr(e))\n\ntry:\n\n    class AnotherClass:\n        b = undefined_global\n\nexcept NameError as e:\n    print(\"Expected name error occurred:\", repr(e))\n\ntry:\n\n    class YetAnotherClass:\n        b = 1\n        del b\n        print(b)\n\nexcept NameError as e:\n    print(\"Expected name error occurred:\", repr(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/FunctionObjectsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that covers attributes if function objects.\n\n\"\"\"\n\nfrom __future__ import print_function\n\n\ndef func(_arg1, _arg2, _arg3, **_star):\n    \"\"\"Some documentation.\"\"\"\n\n\nprint(\"Starting out: func, __name__:\", func, func.__name__)\n\nprint(\"Changing its name:\")\nfunc.__name__ = \"renamed\"\n\nprint(\"With new name: func, __name__:\", func, func.__name__)\n\nprint(\"Documentation initially:\", func.__doc__)\n\nprint(\"Changing its doc:\")\nfunc.__doc__ = \"changed doc\" + chr(0) + \" with 0 character\"\n\nprint(\"Documentation updated:\", repr(func.__doc__))\n\nprint(\"Setting its dict\")\nfunc.my_value = \"attached value\"\nprint(\"Reading its dict\", func.my_value)\n\nprint(\"__code__ dir\")\nprint(dir(func.__code__))\n\n\ndef func2(_arg1, arg2=\"default_arg2\", arg3=\"default_arg3\"):\n    x = arg2 + arg3\n    return x\n\n\nprint(\"func __defaults__\", func2.__defaults__)\n\nprint(\"function varnames\", func2.__code__.co_varnames)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/FunctionsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Various kinds of functions with small specialties.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport inspect\nimport sys\n\n# pylint: disable=redefined-outer-name\n\n\nvar_on_module_level = 1\n\n\ndef closureTest1(some_arg):  # pylint: disable=unused-argument\n    x = 3\n\n    def enclosed(_f=\"default_value\"):\n        return x\n\n    return enclosed\n\n\nprint(\"Call closured function returning function:\", closureTest1(some_arg=\"ignored\")())\n\n\ndef closureTest2(some_arg):  # pylint: disable=unused-argument\n    def enclosed(_f=\"default_value\"):\n        return x\n\n    x = 4\n\n    return enclosed\n\n\nprint(\"Call closured function returning function:\", closureTest2(some_arg=\"ignored\")())\n\n\ndef defaultValueTest1(_no_default, some_default_constant=1):\n    return some_default_constant\n\n\nprint(\n    \"Call function with 2 parameters, one defaulted, and check that the default value is used:\",\n    defaultValueTest1(\"ignored\"),\n)\n\n\ndef defaultValueTest1a(\n    _no_default, some_default_constant_1=1, some_default_constant_2=2\n):\n    return some_default_constant_2 - some_default_constant_1\n\n\nprint(\n    \"Call function with 3 parameters, 2 defaulted, check they are used correctly:\",\n    defaultValueTest1a(\"ignored\"),\n)\n\n\ndef defaultValueTest2(_no_default, some_default_variable=var_on_module_level * 2):\n    return some_default_variable\n\n\nprint(\n    \"Call function with 2 parameters, 1 defaulted with an expression, check its result\",\n    defaultValueTest2(\"ignored\"),\n)\n\nvar_on_module_level = 2\nprint(\n    \"Call function with 2 parameters, 1 defaulted with an expression, values have changed since, check its result\",\n    defaultValueTest2(\"ignored\"),\n)\n\n\ndef contractionTest():\n    j = 2\n\n    return [j + i for i in range(8)]\n\n\nprint(\"Call function that returns a list contraction:\", contractionTest())\n\n\ndef defaultValueTest3a(\n    _no_default, funced_defaulted=defaultValueTest2(var_on_module_level)\n):\n    return [i + funced_defaulted for i in range(8)]\n\n\nprint(\n    \"Call function that has a default value coming from a function call:\",\n    defaultValueTest3a(\"ignored\"),\n)\n\n\ndef defaultValueTest3b(\n    _no_default, funced_defaulted=defaultValueTest2(var_on_module_level)\n):\n    local_var = [funced_defaulted + i for i in range(8)]\n\n    return local_var\n\n\nprint(\n    \"Call function that returns a list contraction result via a local variable:\",\n    defaultValueTest3b(\"ignored\"),\n)\n\n\ndef defaultValueTest3c(\n    _no_default, funced_defaulted=defaultValueTest2(var_on_module_level)\n):\n    local_var = [[j + funced_defaulted + 1 for j in range(i)] for i in range(8)]\n\n    return local_var\n\n\nprint(\n    \"Call function that returns a nested list contraction with input from default parameter\",\n    defaultValueTest3c(\"ignored\"),\n)\n\n\ndef defaultValueTest4(_no_default, funced_defaulted=lambda x: x**2):\n    return funced_defaulted(4)\n\n\nprint(\n    \"Call function that returns value calculated by a lambda function as default parameter\",\n    defaultValueTest4(\"ignored\"),\n)\n\n\ndef defaultValueTest4a(_no_default, funced_defaulted=lambda x: x**2):\n    c = 1\n    d = funced_defaulted(1)\n\n    r = (i + j + c + d for i, j in zip(range(8), range(9)))\n\n    l = []\n    for x in r:\n        l.append(x)\n\n    return l\n\n\nprint(\n    \"Call function that has a lambda calculated default parameter and a generator expression\",\n    defaultValueTest4a(\"ignored\"),\n)\n\n\ndef defaultValueTest4b(_no_default, funced_defaulted=lambda x: x**3):\n    d = funced_defaulted(1)\n\n    # Nested generators\n    l = []\n\n    for x in ((d + j for j in range(4)) for i in range(8)):\n        for y in x:\n            l.append(y)\n\n    return l\n\n\nprint(\n    \"Call function that has a lambda calculated default parameter and a nested generator expression\",\n    defaultValueTest4b(\"ignored\"),\n)\n\n\ndef defaultValueTest5(_no_default, tuple_defaulted=(1, 2, 3)):\n    return tuple_defaulted\n\n\nprint(\"Call function with default value that is a tuple\", defaultValueTest5(\"ignored\"))\n\n\ndef defaultValueTest6(\n    _no_default, list_defaulted=[1, 2, 3]\n):  # pylint: disable=dangerous-default-value\n    return list_defaulted\n\n\nprint(\"Call function with default value that is a list\", defaultValueTest6(\"ignored\"))\n\n\nx = len(\"hey\")\n\n\n# TODO: Doesn't belong here.\ndef in_test(a):\n    # if 7 in a:\n    #   print \"hey\"\n\n    # pylint: disable=pointless-statement\n    8 in a  # @NoEffect\n    9 not in a  # @NoEffect\n\n\nin_test([8])\ntry:\n    in_test(9)\nexcept TypeError:\n    pass\n\n\ndef my_deco(function):\n    def new_function(c, d):\n        return function(d, c)\n\n    return new_function\n\n\n@my_deco\ndef decoriert(a, b):  # pylint: disable=unused-argument\n    def subby(a):\n        return 2 + a\n\n    return 1 + subby(b)\n\n\nprint(\"Function with decoration\", decoriert(3, 9))\n\n\ndef functionWithGlobalReturnValue():\n    global a  # pylint: disable=global-statement\n    return a\n\n\na = \"oh common\"\n\nsome_constant_tuple = (2, 5, 7)\nsome_semiconstant_tuple = (2, 5, a)\n\nf = a * 2\n\nprint(defaultValueTest1(\"ignored\"))\n\n# The change of the default variable doesn't influence the default\n# parameter of defaultValueTest2, that means it's also calculated\n# at the time the function is defined.\nmodule_level = 7\nprint(defaultValueTest2(\"also ignored\"))\n\n\ndef starArgTest(a, b, c):\n    return a, b, c\n\n\nprint(\"Function called with star arg from tuple:\")\n\nstar_list_arg = (11, 44, 77)\nprint(starArgTest(*star_list_arg))\n\nprint(\"Function called with star arg from list:\")\n\nstar_list_arg = [7, 8, 9]\nprint(starArgTest(*star_list_arg))\n\nstar_dict_arg = {\"a\": 9, \"b\": 3, \"c\": 8}\n\nprint(\"Function called with star arg from dict\")\n\nprint(starArgTest(**star_dict_arg))\n\nlambda_func = lambda a, b: a < b\nlambda_args = (8, 9)\n\nprint(\"Lambda function called with star args from tuple:\")\nprint(lambda_func(*lambda_args))\n\nprint(\"Lambda function called with star args from list:\")\nlambda_args = [8, 7]\nprint(lambda_func(*lambda_args))\n\n\nprint(\"Generator function without context:\")\n\n\ndef generator_without_context_function():\n    gen = (x for x in range(9))\n\n    return tuple(gen)\n\n\nprint(generator_without_context_function())\n\nprint(\"Generator function with 2 iterateds:\")\n\n\ndef generator_with_2_fors():\n    return tuple((x, y) for x in range(2) for y in range(3))\n\n\nprint(generator_with_2_fors())\n\n\ndef someYielder():\n    yield 1\n    yield 2\n\n\ndef someYieldFunctionUser():\n    print(\"someYielder\", someYielder())\n\n    result = []\n\n    for a in someYielder():\n        result.append(a)\n\n    return result\n\n\nprint(\"Function that uses some yielding function coroutine:\")\nprint(someYieldFunctionUser())\n\n\ndef someLoopYielder():\n    for i in (0, 1, 2):\n        yield i\n\n\ndef someLoopYieldFunctionUser():\n    result = []\n\n    for a in someLoopYielder():\n        result.append(a)\n\n    return result\n\n\nprint(\"Function that uses some yielding function coroutine that loops:\")\nprint(someLoopYieldFunctionUser())\n\n\ndef someGeneratorClosureUser():\n    def someGenerator():\n        def userOfGeneratorLocalVar():\n            return x + 1\n\n        x = 2\n\n        yield userOfGeneratorLocalVar()\n        yield 6\n\n    gen = someGenerator()\n\n    return [next(gen), next(gen)]\n\n\nprint(\n    \"Function generator that uses a local function accessing its local variables to yield:\"\n)\nprint(someGeneratorClosureUser())\n\n\ndef someClosureUsingGeneratorUser():\n    offered = 7\n\n    def someGenerator():\n        yield offered\n\n    return next(someGenerator())\n\n\nprint(\"Function generator that yield from its closure:\")\nprint(someClosureUsingGeneratorUser())\n\n\nprint(\"Function call with both star args and named args:\")\n\n\ndef someFunction(a, b, c, d):\n    print(a, b, c, d)\n\n\nsomeFunction(a=1, b=2, **{\"c\": 3, \"d\": 4})\n\nprint(\"Order of evaluation of function and args:\")\n\n\ndef getFunction():\n    print(\"getFunction\", end=\"\")\n\n    def x(y, u, a, k):\n        return y, u, k, a\n\n    return x\n\n\ndef getPlainArg1():\n    print(\"getPlainArg1\", end=\"\")\n    return 9\n\n\ndef getPlainArg2():\n    print(\"getPlainArg2\", end=\"\")\n    return 13\n\n\ndef getKeywordArg1():\n    print(\"getKeywordArg1\", end=\"\")\n    return \"a\"\n\n\ndef getKeywordArg2():\n    print(\"getKeywordArg2\", end=\"\")\n    return \"b\"\n\n\ngetFunction()(getPlainArg1(), getPlainArg2(), k=getKeywordArg1(), a=getKeywordArg2())\nprint()\n\n\ndef getListStarArg():\n    print(\"getListStarArg\", end=\"\")\n    return [1]\n\n\ndef getDictStarArg():\n    print(\"getDictStarArg\", end=\"\")\n    return {\"k\": 9}\n\n\nprint(\"Same with star args:\")\n\ngetFunction()(getPlainArg1(), a=getKeywordArg1(), *getListStarArg(), **getDictStarArg())\nprint()\n\nprint(\"Dictionary creation order:\")\n\nd = {getKeywordArg1(): getPlainArg1(), getKeywordArg2(): getPlainArg2()}\nprint()\n\nprint(\"Throwing an exception to a generator function:\")\n\n\ndef someGeneratorFunction():\n    try:\n        yield 1\n        yield 2\n    except Exception:  # pylint: disable=broad-except\n        yield 3\n\n    yield 4\n\n\ngen1 = someGeneratorFunction()\n\nprint(\"Fresh Generator Function throwing gives\", end=\"\")\n\ntry:\n    print(gen1.throw(ValueError)),\nexcept ValueError:\n    print(\"exception indeed\")\n\ngen2 = someGeneratorFunction()\n\nprint(\"Used Generator Function throwing gives\", end=\"\")\nnext(gen2)\nprint(gen2.throw(ValueError), \"indeed\")\n\ngen3 = someGeneratorFunction()\n\nprint(\"Fresh Generator Function close gives\", end=\"\")\nprint(gen3.close())\n\ngen4 = someGeneratorFunction()\n\nprint(\"Used Generator Function that mis-catches close gives\", end=\"\")\nnext(gen4)\ntry:\n    print(gen4.close(), end=\"\")\nexcept RuntimeError:\n    print(\"runtime exception indeed\")\n\n\ngen5 = someGeneratorFunction()\n\nprint(\"Used Generator Function close gives\", end=\"\")\nnext(gen5)\nnext(gen5)\nnext(gen5)\n\nprint(gen5.close(), end=\"\")\n\n\ndef receivingGenerator():\n    while True:\n        a = yield 4\n        yield a\n\n\nprint(\"Generator function that receives\", end=\"\")\n\ngen6 = receivingGenerator()\n\nprint(next(gen6), end=\"\")\nprint(gen6.send(5), end=\"\")\nprint(gen6.send(6), end=\"\")\nprint(gen6.send(7), end=\"\")\nprint(gen6.send(8))\n\nprint(\"Generator function whose generator is copied\", end=\"\")\n\n\ndef generatorFunction():\n    yield 1\n    yield 2\n\n\ngen7 = generatorFunction()\nnext(gen7)\n\ngen8 = iter(gen7)\nprint(next(gen8))\n\n\ndef doubleStarArgs(*a, **d):\n    return a, d\n\n\ntry:\n    from UserDict import UserDict\nexcept ImportError:\n    print(\"Using Python3, making own non-dict dict:\")\n\n    class UserDict(dict):\n        pass\n\n\nprint(\"Function that has keyword argument matching the list star arg name\", end=\"\")\nprint(doubleStarArgs(1, **UserDict(a=2)))\n\n\ndef generatorFunctionUnusedArg(_a):\n    yield 1\n\n\ngeneratorFunctionUnusedArg(3)\n\n\ndef closureHavingGenerator(arg):\n    def gen(_x=1):\n        yield arg\n\n    return gen()\n\n\nprint(\"Function generator that has a closure and default argument\", end=\"\")\nprint(list(closureHavingGenerator(3)))\n\n\ndef functionWithDualStarArgsAndKeywordsOnly(a1, a2, a3, a4, b):\n    return a1, a2, a3, a4, b\n\n\nl = [1, 2, 3]\nd = {\"b\": 8}\n\nprint(\n    \"Dual star args, but not positional call\",\n    functionWithDualStarArgsAndKeywordsOnly(a4=1, *l, **d),\n)\n\n\ndef posDoubleStarArgsFunction(a, b, c, *l, **d):\n    return a, b, c, l, d\n\n\nl = [2]\nd = {\"other\": 7, \"c\": 3}\n\nprint(\"Dual star args consuming function\", posDoubleStarArgsFunction(1, *l, **d))\n\n\nfor value in sorted(dir()):\n    main_value = getattr(sys.modules[\"__main__\"], value)\n\n    if inspect.isfunction(main_value):\n        print(\n            main_value,\n            main_value.__code__.co_varnames[: main_value.__code__.co_argcount],\n            inspect.getargs(main_value.__code__),\n        )  #\n\n        # TODO: Make this work as well, currently disabled, because of nested arguments not\n        # being compatible yet.\n        # print inspect.getargspec( main_value )\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/FunctionsTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef displayDict(d):\n    result = \"{\"\n    first = True\n    for key, value in sorted(d.items()):\n        if not first:\n            result += \",\"\n\n        result += \"%s: %s\" % (repr(key), repr(value))\n        first = False\n    result += \"}\"\n\n    return result\n\n\ndef kwonlysimple(*, a):\n    return a\n\n\nprint(\"Keyword only function case: \", kwonlysimple(a=3))\n\n\ndef kwonlysimpledefaulted(*, a=5):\n    return a\n\n\nprint(\"Keyword only function, using default value: \", kwonlysimpledefaulted())\n\n\ndef default1():\n    print(\"Called\", default1)\n    return 1\n\n\ndef default2():\n    print(\"Called\", default2)\n\n    return 2\n\n\ndef default3():\n    print(\"Called\", default3)\n    return 3\n\n\ndef default4():\n    print(\"Called\", default4)\n\n    return 4\n\n\ndef annotation1():\n    print(\"Called\", annotation1)\n\n    return \"a1\"\n\n\ndef annotation2():\n    print(\"Called\", annotation2)\n\n    return \"a2\"\n\n\ndef annotation3():\n    print(\"Called\", annotation3)\n\n    return \"a3\"\n\n\ndef annotation4():\n    print(\"Called\", annotation4)\n\n    return \"a4\"\n\n\ndef annotation5():\n    print(\"Called\", annotation5)\n\n    return \"a5\"\n\n\ndef annotation6():\n    print(\"Called\", annotation6)\n\n    return \"a6\"\n\n\ndef annotation7():\n    print(\"Called\", annotation7)\n\n    return \"a7\"\n\n\ndef annotation8():\n    print(\"Called\", annotation8)\n\n    return \"a8\"\n\n\ndef annotation9():\n    print(\"Called\", annotation9)\n\n    return \"a9\"\n\n\nprint(\"Defining function with annotations, and defaults as functions for everything:\")\n\n\ndef kwonlyfunc(\n    x: annotation1(),\n    y: annotation2() = default1(),\n    z: annotation3() = default2(),\n    *,\n    a: annotation4(),\n    b: annotation5() = default3(),\n    c: annotation6() = default4(),\n    d: annotation7(),\n    **kw: annotation8()\n) -> annotation9():\n    print(x, y, z, a, b, c, d)\n\n\nprint(\"__kwdefaults__\", displayDict(kwonlyfunc.__kwdefaults__))\n\nprint(\"Keyword only function called:\")\nkwonlyfunc(7, a=8, d=12)\nprint(\"OK.\")\n\nprint(\"Annotations come out as\", sorted(kwonlyfunc.__annotations__))\nkwonlyfunc.__annotations__ = {}\nprint(\"After updating to None it is\", kwonlyfunc.__annotations__)\n\nkwonlyfunc.__annotations__ = {\"k\": 9}\nprint(\"After updating to None it is\", kwonlyfunc.__annotations__)\n\n\ndef kwonlystarfunc(*, a, b, **d):\n    return a, b, d\n\n\nprint(\"kwonlystarfunc\", kwonlystarfunc(a=8, b=12, k=9, j=7))\n\n\ndef deeplyNestedNonLocalWrite():\n    x = 0\n    y = 0\n\n    def f():\n        def g():\n            nonlocal x\n\n            x = 3\n\n            return x\n\n        return g()\n\n    return f(), x\n\n\nprint(\"Deeply nested non local writing function\", deeplyNestedNonLocalWrite())\n\n\ndef deletingClosureVariable():\n    try:\n        x = 1\n\n        def g():\n            nonlocal x\n\n            del x\n\n        g()\n        g()\n    except Exception as e:\n        return repr(e)\n\n\nprint(\"Using deleted non-local variable:\", deletingClosureVariable())\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/FunctionsTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Various kinds of functions definitions with Python2 only features.\n\nEsp. nested arguments are no longer allowed in Python3 and covered here\nto make sure they are not forgotten.\n\"\"\"\n\nfrom __future__ import print_function\n\n# pylint: disable=redefined-outer-name\n\n\ndef local_function(a, z=9):\n    b = ` a * a + 1 `\n\n    c = (a, b, a**32, a + a)\n\n    d = long(\"0\")\n    e = int(\"77\")\n\n    d = long(b)\n    e = long(1 + 1)\n\n    return a, b, c, d, e, z\n\n\nprint(\n    \"Call function with many variables calculated and returned\", local_function(1, z=5)\n)\n\nprint(\"Function with nested args:\")\n\n\ndef nested_args_function((a, b), c):\n    return a, b, c\n\n\nprint(nested_args_function((1, 2), 3))\n\ntry:\n    nested_args_function((1, 2, 3), 3)\nexcept ValueError, e:\n    print(\"Calling nested with too long tuple gave:\", e)\n\ntry:\n    nested_args_function((1,), 3)\nexcept ValueError, e:\n    print(\"Calling nested with too short tuple gave:\", e)\n\n\ndef deeply_nested_function(((a,), b, c, (d, (e, f)))):\n    return a, b, c, d, e, f\n\n\nprint(\"Deeply nested function\", deeply_nested_function(((1,), 2, 3, (4, (5, 6)))))\n\nprint(\"Function with nested args that have defaults:\")\n\n\ndef default_giver():\n    class SomeClass:  # pylint: disable=old-style-class\n        def __iter__(self):\n            print(\"Giving iter\")\n            return iter(range(2))\n\n    return SomeClass()\n\n\ndef nested_args_function_with_defaults((a, b)=default_giver(), c=5):\n    return a, b, c\n\n\nprint(\"Calling it.\")\nprint(nested_args_function_with_defaults())\n\n\ndef comp_args1((a, b)):\n    return a, b\n\n\ndef comp_args2((a, b)=(3, 4)):\n    return a, b\n\n\ndef comp_args3(a, (b, c)):\n    return a, b, c\n\n\ndef comp_args4(a=2, (b, c)=(3, 4)):\n    return a, b, c\n\n\nprint(\n    \"Complex args functions\",\n    comp_args1((2, 1)),\n    comp_args2(),\n    comp_args2((7, 9)),\n    comp_args3(7, (8, 9)),\n    comp_args4(),\n)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/FutureTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import barry_as_FLUFL\n\nprint(eval(\"1 <> 2\"))\nprint(eval('\"a\"<>\"b\"'))\nprint(eval(\"range(7) <> range(7)\"))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/GeneratorExpressionsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Generator expression tests\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport inspect\n\nprint(\"Generator expression that demonstrates the timing:\")\n\n\ndef iteratorCreationTiming():\n    def getIterable(x):\n        print(\"Getting iterable\", x)\n        return Iterable(x)\n\n    class Iterable:\n        def __init__(self, x):\n            self.x = x  # pylint: disable=invalid-name\n            self.values = list(range(x))\n            self.count = 0\n\n        def __iter__(self):\n            print(\"Giving iterator now\", self.x)\n\n            return self\n\n        def __next__(self):\n            print(\"Next of\", self.x, \"is\", self.count)\n\n            if len(self.values) > self.count:\n                self.count += 1\n\n                return self.values[self.count - 1]\n            else:\n                print(\"Raising StopIteration for\", self.x)\n\n                raise StopIteration\n\n        # Python2/3 compatibility.\n        next = __next__\n\n        def __del__(self):\n            print(\"Deleting\", self.x)\n\n    gen = ((y, z) for y in getIterable(3) for z in getIterable(2))\n\n    print(\"Using generator\", gen)\n    next(gen)\n    res = tuple(gen)\n    print(res)\n\n    print(\"*\" * 20)\n\n    try:\n        next(gen)\n    except StopIteration:\n        print(\"Usage past end gave StopIteration exception as expected.\")\n\n        try:\n            print(\"Generator state then is\", inspect.getgeneratorstate(gen))\n        except AttributeError:\n            pass\n\n        print(\"Its frame is now\", gen.gi_frame)\n\n    print(\"Early aborting generator:\")\n\n    gen2 = ((y, z) for y in getIterable(3) for z in getIterable(2))\n    del gen2\n\n\niteratorCreationTiming()\n\nprint(\"Generator expressions that demonstrate the use of conditions:\")\n\nprint(tuple(x for x in range(8) if x % 2 == 1))\nprint(tuple(x for x in range(8) if x % 2 == 1 for z in range(8) if z == x))\n\nprint(tuple(x for (x, y) in zip(list(range(2)), list(range(4)))))\n\nprint(\"Directory of generator expressions:\")\nfor_dir = (x for x in [1])\n\ngen_dir = dir(for_dir)\n\nprint(sorted(g for g in gen_dir))\n\n\ndef genexprSend():\n    x = (x for x in range(9))\n\n    print(\"Sending too early:\")\n    try:\n        x.send(3)\n    except TypeError as e:\n        print(\"Gave expected TypeError with text:\", e)\n\n    try:\n        z = next(x)\n    except StopIteration as e:\n        print(\"Gave expected (3.10.0/1 only) StopIteration with text:\", repr(e))\n    else:\n        print(\"Next return value (pre 3.10)\", z)\n\n    try:\n        y = x.send(3)\n    except StopIteration as e:\n        print(\"Gave expected (3.10.0/1 only) StopIteration with text:\", repr(e))\n    else:\n        print(\"Send return value\", y)\n\n    try:\n        print(\"And then next gave\", next(x))\n    except StopIteration as e:\n        print(\"Gave expected (3.10.0/1 only) StopIteration with text:\", repr(e))\n\n    print(\"Throwing an exception to it.\")\n    try:\n        x.throw(2)\n        assert False\n    except TypeError as e:\n        print(\"Gave expected TypeError:\", e)\n\n    print(\"Throwing an exception to it.\")\n    try:\n        x.throw(ValueError(2))\n    except ValueError as e:\n        print(\"Gave expected ValueError:\", e)\n\n    try:\n        next(x)\n        print(\"Next worked even after thrown error\")\n    except StopIteration as e:\n        print(\"Gave expected stop iteration after throwing exception in it:\", e)\n\n    print(\"Throwing another exception from it.\")\n    try:\n        x.throw(ValueError(5))\n    except ValueError as e:\n        print(\"Gave expected ValueError with text:\", e)\n\n\nprint(\"Generator expressions have send too:\")\n\ngenexprSend()\n\n\ndef genexprClose():\n    x = (x for x in range(9))\n\n    print(\"Immediate close:\")\n\n    x.close()\n    print(\"Closed once\")\n\n    x.close()\n    print(\"Closed again without any trouble\")\n\n\ngenexprClose()\n\n\ndef genexprThrown():\n    def checked(z):\n        if z == 3:\n            raise ValueError\n\n        return z\n\n    x = (checked(x) for x in range(9))\n\n    try:\n        for count, value in enumerate(x):\n            print(count, value)\n    except ValueError:\n        print(count + 1, ValueError)\n\n    try:\n        next(x)\n\n        print(\n            \"Allowed to do next() after raised exception from the generator expression\"\n        )\n    except StopIteration:\n        print(\"Exception in generator, disallowed next() afterwards.\")\n\n\ngenexprThrown()\n\n\ndef nestedExpressions():\n    a = [x for x in range(10)]\n    b = (x for x in (y for y in a))\n\n    print(\"nested generator expression\", list(b))\n\n\nnestedExpressions()\n\n\ndef lambdaGenerators():\n    a = 1\n\n    x = lambda: (yield a)\n\n    print(\"Simple lambda generator\", x, x(), list(x()))\n\n    y = lambda: ((yield 1), (yield 2))\n\n    print(\"Complex lambda generator\", y, y(), list(y()))\n\n\nlambdaGenerators()\n\n\ndef functionGenerators():\n    # Like lambdaGenerators, to show how functions behave differently if at all.\n\n    a = 1\n\n    def x():\n        yield a\n\n    print(\"Simple function generator\", x, x(), list(x()))\n\n    def y():\n        yield ((yield 1), (yield 2))\n\n    print(\"Complex function generator\", y, y(), list(y()))\n\n\nfunctionGenerators()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/GeneratorExpressionsTest_37.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test case with generator expression form only allow until Python 3.7\n\n\"\"\"\n\n\ndef strangeLambdaGeneratorExpression():\n    x = ((yield) for i in (1, 2) if (yield))\n\n    print(\"Strange lambda generator expression:\")\n    print(list(x))\n\n\nstrangeLambdaGeneratorExpression()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/GlobalStatementTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nx = 2\n\n\ndef someFunction1():\n    x = 3\n\n    return x\n\n\ndef someFunction2():\n    global x\n\n    x = 4\n\n    return x\n\n\ndef someFunction3():\n    return x\n\n\ndef someNestedGlobalUser1():\n    z = 1\n\n    # Nested function that uses a global z doesn't affect the local variable z at all.\n    def setZ():\n        global z\n\n        z = 3\n\n    setZ()\n\n    return z\n\n\ndef someNestedGlobalUser2():\n    z = 1\n\n    # Nested function that uses a global z doesn't affect the local variable z at\n    # all. This doesn't change if it's done inside an exec block.\n    exec(\n        \"\"\"\ndef setZ():\n    global z\n\n    z = 3\n\nsetZ()\n\"\"\"\n    )\n\n    return z\n\n\ndef someNestedGlobalUser3a():\n    # Nested function that uses a exec variable scope z and a global z, changes z to be\n    # the global one only. We verify that by looking at locals. This means that the global\n    # statement inside the function of exec changes the effect of the z.\n\n    exec(\n        \"\"\"\nz = 1\n\ndef setZ():\n    global z\n\n    z = 3\n\nsetZ()\n\"\"\"\n    )\n\n    return z, locals().keys() == [\"setZ\"]\n\n\ndef someNestedGlobalUser3b():\n    # Nested function that uses a exec variable scope z and a global z, changes\n    # z to be the global one only. We verify that by looking at locals.\n\n    exec(\n        \"\"\"\nz = 1\n\"\"\"\n    )\n\n    if sys.version_info[0] < 3:\n        return z, locals().keys() == [\"z\"]\n    else:\n        return locals().keys() == []\n\n\ndef someNestedGlobalUser4():\n    z = 1\n\n    # This one proves that the local variable z is entirely ignored, and that the global z\n    # has the value 2 inside setZ().\n\n    exec(\n        \"\"\"\nz = 2\n\ndef setZ():\n    global z\n\n    z = 3*z\n\nsetZ()\n\"\"\"\n    )\n    return z\n\n\ndef someNestedGlobalUser5():\n    z = 1\n\n    # Without a global statement, z affects the local variable z.\n\n    exec(\n        \"\"\"\nz = 3\n\n\"\"\"\n    )\n    return z\n\n\ndef someNestedGlobalUser6():\n    # Without a global statement, a local variable z is created.\n\n    exec(\n        \"\"\"\nz = 7\n\n\"\"\"\n    )\n    return z\n\n\nprint(\"Function that shadows a global variable with a local variable\")\nprint(someFunction1())\nprint(\n    \"Function that accesses and changes a global variable declared with a global statement\"\n)\nprint(someFunction2())\nprint(\"Function that uses a global variable\")\nprint(someFunction3())\nprint(\"Functions that uses a global variable in a nested function in various ways:\")\nprint(someNestedGlobalUser1, someNestedGlobalUser1())\ndel z\nprint(someNestedGlobalUser2, someNestedGlobalUser2())\ndel z\nprint(someNestedGlobalUser3a, someNestedGlobalUser3a())\ndel z\nprint(someNestedGlobalUser3b, someNestedGlobalUser3b())\nprint(someNestedGlobalUser4, (someNestedGlobalUser4(), z))\ndel z\nprint(someNestedGlobalUser5, someNestedGlobalUser5())\nz = 9\nprint(someNestedGlobalUser6, (someNestedGlobalUser6(), z))\n\n\nx = 7\n\n\ndef f():\n    x = 1\n\n    def g():\n        global x\n\n        def i():\n            def h():\n                return x\n\n            return h()\n\n        return i()\n\n    return g()\n\n\nprint(f())\n\nglobal global_already\nglobal_already = 1\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/HelloWorldTest_2.py",
    "content": "# -*- coding: utf-8 -*-\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint \"Hello World from module main code\"\n\n\ndef printHelloWorld():\n    print \"Hello World from function main code\"\n\n\nprint printHelloWorld\n\nprintHelloWorld()\n\n\ndef printHelloWorld2(arg):\n    print arg\n\n\nprint printHelloWorld2\n\nprintHelloWorld2(\"Hello World from function positional argument\")\nprintHelloWorld2(arg=\"Hello World from function keyword argument\")\n\n\ndef printHelloWorld3(arg=\"Hello World from function default argument\"):\n    print arg\n\n\nprint printHelloWorld3\n\nprintHelloWorld3()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ImportingTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef localImporter1():\n    import os\n\n    return os\n\n\ndef localImporter1a():\n    import os as my_os_name\n\n    return my_os_name\n\n\ndef localImporter2():\n    from os import path\n\n    return path\n\n\ndef localImporter2a():\n    from os import path as renamed\n\n    return renamed\n\n\nprint(\"Direct module import\", localImporter1())\nprint(\"Direct module import using rename\", localImporter1a())\n\nprint(\"From module import\", localImporter2())\nprint(\"From module import using rename\", localImporter2a())\n\nfrom os import *  # isort:skip\n\nprint(\"Star import gave us\", path)\n\nimport os.path as myname  # isort:skip\n\nprint(\"As import gave\", myname)\n\n\ndef localImportFailure():\n    try:\n        from os import listdir, listdir2, path\n    except Exception as e:\n        print(\"gives\", type(e), repr(e))\n\n    try:\n        print(path)\n    except UnboundLocalError:\n        print(\"and path was not imported\", end=\" \")\n\n    print(\"but listdir was\", listdir)\n\n\nprint(\"From import that fails in the middle\", end=\" \")\nlocalImportFailure()\n\n\ndef nonPackageImportFailure():\n    try:\n        # Not allowed without being a package, should raise ValueError\n        from . import whatever\n    except Exception as e:\n        print(type(e), repr(e))\n\n\nprint(\"Package import fails in non-package:\", end=\" \")\nnonPackageImportFailure()\n\n\ndef importBuiltinTupleFailure():\n    try:\n        value = (\"something\",)\n        # Not allowed to not be constant string, optimization might be fooled\n        # though.\n        __import__(value)\n    except Exception as e:\n        print(type(e), repr(e))\n\n\nprint(\"The __import__ built-in optimization can handle tuples:\", end=\" \")\n\nimportBuiltinTupleFailure()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/InplaceOperationsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nx = 1\nx += 2\n\nprint(\"Plain in-place:\", x)\n\nz = [1, 2, 3]\nz[1] += 5\n\nprint(\"List in-place:\", z[1])\n\nh = {\"a\": 3}\nh[\"a\"] += 2\n\nprint(\"Dictionary in-place:\", h[\"a\"])\n\n\nclass B:\n    a = 1\n\n\nB.a += 2\n\nprint(\"Class attribute in-place:\", B.a)\n\nh = [1, 2, 3, 4]\nh[1:2] += (2, 3)\n\nprint(\"List 'sclice' in-place [x:y]\", h)\n\nh[:1] += (9, 9)\n\nprint(\"List 'sclice' in-place [:y]\", h)\n\nh[2:] += (6, 6)\n\nprint(\"List 'sclice' in-place [y:]\", h)\n\nh[:] += (5, 5, 5)\n\nprint(\"List 'sclice' in-place [:]\", h)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/InspectionTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Tests uncompiled functions and compiled functions responses to inspect and isistance.  \"\"\"\n\nfrom __future__ import print_function\n\nimport inspect\nimport pprint\nimport sys\nimport types\n\n\ndef displayDict(d, remove_keys=()):\n    if \"__loader__\" in d:\n        d = dict(d)\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d = dict(d)\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__compiled__\" in d:\n        d = dict(d)\n        del d[\"__compiled__\"]\n\n    for remove_key in remove_keys:\n        if remove_key in d:\n            d = dict(d)\n            del d[remove_key]\n\n    return pprint.pformat(d)\n\n\ndef compiledFunction(a, b):\n    pass\n\n\nprint(\"Function inspect.isfunction:\", inspect.isfunction(compiledFunction))\nprint(\n    \"Function isinstance types.FunctionType:\",\n    isinstance(compiledFunction, types.FunctionType),\n)\nprint(\n    \"Function isinstance tuple containing types.FunctionType:\",\n    isinstance(compiledFunction, (int, types.FunctionType)),\n)\n\n\n# Even this works.\nassert type(compiledFunction) == types.FunctionType\n\n\nclass CompiledClass:\n    def __init__(self):\n        pass\n\n    def compiledMethod(self):\n        pass\n\n\nassert inspect.isfunction(CompiledClass) is False\nassert isinstance(CompiledClass, types.FunctionType) is False\n\nassert inspect.ismethod(compiledFunction) is False\nassert inspect.ismethod(CompiledClass) is False\n\nassert inspect.ismethod(CompiledClass.compiledMethod) == (sys.version_info < (3,))\nassert inspect.ismethod(CompiledClass().compiledMethod) is True\n\nassert bool(type(CompiledClass.compiledMethod) == types.MethodType) == (\n    sys.version_info < (3,)\n)\n\n\ndef compiledGenerator():\n    yield 1\n\n\nassert inspect.isfunction(compiledGenerator) is True\nassert inspect.isgeneratorfunction(compiledGenerator) is True\n\nassert isinstance(compiledGenerator(), types.GeneratorType) is True\nassert type(compiledGenerator()) == types.GeneratorType\nassert isinstance(compiledGenerator, types.GeneratorType) is False\n\nassert inspect.ismethod(compiledGenerator()) is False\nassert inspect.isfunction(compiledGenerator()) is False\n\nassert inspect.isgenerator(compiledFunction) is False\nassert inspect.isgenerator(compiledGenerator) is False\nassert inspect.isgenerator(compiledGenerator()) is True\n\n\ndef someFunction(a):\n    assert inspect.isframe(sys._getframe())\n    # print(\"Running frame getframeinfo()\", inspect.getframeinfo(sys._getframe()))\n\n    # TODO: The locals of the frame are not updated.\n    # print(\"Running frame arg values\", inspect.getargvalues(sys._getframe()))\n\n\nsomeFunction(2)\n\n\nclass C:\n    print(\n        \"Class locals\",\n        displayDict(\n            sys._getframe().f_locals, remove_keys=(\"__qualname__\", \"__locals__\")\n        ),\n    )\n    print(\"Class flags\", sys._getframe().f_code.co_flags)\n\n\ndef f():\n    print(\"Func locals\", sys._getframe().f_locals)\n    print(\"Func flags\", sys._getframe().f_code.co_flags)\n\n\nf()\n\n\ndef g():\n    yield (\"Generator object locals\", sys._getframe().f_locals)\n    yield (\"Generator object flags\", sys._getframe().f_code.co_flags)\n\n\nfor line in g():\n    print(*line)\n\nprint(\"Generator function flags\", g.__code__.co_flags)\n\nprint(\"Module frame locals\", displayDict(sys._getframe().f_locals))\nprint(\"Module flags\", sys._getframe().f_code.co_flags)\nprint(\"Module code name\", sys._getframe().f_code.co_name)\n\nprint(\"Module frame dir\", dir(sys._getframe()))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/InspectionTest_35.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Tests uncompiled functions and compiled functions responses to inspect and isistance.  \"\"\"\n\nimport inspect\nimport types\n\n# nuitka-project: --python-flag=no_warnings\n\n\nasync def compiledCoroutine():\n    async with _x:\n        pass\n\n\nprint(type(compiledCoroutine()))\n\nassert inspect.isfunction(compiledCoroutine) is True\nassert inspect.isgeneratorfunction(compiledCoroutine) is False\nassert inspect.iscoroutinefunction(compiledCoroutine) is True\n\nassert isinstance(compiledCoroutine(), types.GeneratorType) is False\nassert isinstance(compiledCoroutine(), types.CoroutineType) is True\nassert type(compiledCoroutine()) == types.CoroutineType, type(compiledCoroutine())\nassert isinstance(compiledCoroutine, types.CoroutineType) is False\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/InspectionTest_36.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Tests uncompiled functions and compiled functions responses to inspect and isistance.  \"\"\"\n\nimport inspect\nimport types\n\n# nuitka-project: --python-flag=no_warnings\n\n\nasync def compiledAsyncgen():\n    yield 1\n\n\nprint(type(compiledAsyncgen()))\n\nassert inspect.isfunction(compiledAsyncgen) is True\nassert inspect.isgeneratorfunction(compiledAsyncgen) is False\nassert inspect.iscoroutinefunction(compiledAsyncgen) is False\nassert inspect.isasyncgenfunction(compiledAsyncgen) is True\n\nassert isinstance(compiledAsyncgen(), types.GeneratorType) is False\nassert isinstance(compiledAsyncgen(), types.CoroutineType) is False\nassert isinstance(compiledAsyncgen(), types.AsyncGeneratorType) is True\nassert type(compiledAsyncgen()) == types.AsyncGeneratorType, type(compiledAsyncgen())\nassert isinstance(compiledAsyncgen, types.AsyncGeneratorType) is False\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/LambdasTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef lambdaContainer(x):\n    f = lambda c: c\n    g = lambda c: c if x else c * c\n    # h = lambda c: 'a' <= c <= 'z'\n\n    y = f(x)\n    z = g(4)\n\n    print(\"Lambda with conditional expression gives\", z)\n\n    if \"a\" <= x <= y <= \"z\":\n        print(\"Four\")\n\n    if \"a\" <= x <= \"z\":\n        print(\"Yes\")\n\n    if \"a\" <= x > \"z\":\n        print(\"Yes1\")\n\n    if \"a\" <= (\"1\" if x else \"2\") > \"z\":\n        print(\"Yes2\")\n\n    if \"a\" <= (\"1\" if x else \"2\") > \"z\" > undefined_global:\n        print(\"Yes3\")\n\n    z = lambda foo=y: foo\n\n    print(\"Lambda defaulted gives\", z())\n\n\nlambdaContainer(\"b\")\n\n\ndef lambdaGenerator():\n    x = lambda: (yield 3)\n\n    gen = x()\n    print(\"Lambda generator gives\", next(gen))\n\n\nlambdaGenerator()\n\n\ndef lambdaDirectCall():\n    args = range(7)\n\n    x = (lambda *args: args)(*args)\n\n    print(\"Lambda direct call gave\", x)\n\n\nlambdaDirectCall()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/LateClosureAssignmentTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef closureTest1():\n    # Assign, but the value is not supposed to be used by the function, instead the later\n    # update is effective.\n    d = 1\n\n    def subby():\n        return d\n\n    d = 22222 * 2222\n\n    return subby()\n\n\ndef closureTest2():\n    # Using a closure variable that is not initialized at the time it is closured should\n    # work as well.\n\n    def subby():\n        return d\n\n    d = 2222 * 2222\n\n    return subby()\n\n\ndef closureTest3():\n    def subby():\n        return undefined_global\n\n    try:\n        return subby()\n    except NameError:\n        return 88\n\n\nd = 1\n\n\ndef scopeTest4():\n    try:\n        return d\n\n        d = 1\n    except UnboundLocalError as e:\n        return repr(e)\n\n\nprint(\"Test closure where value is overwritten:\", closureTest1())\nprint(\"Test closure where value is assigned only late:\", closureTest2())\n\nprint(\"Test function where closured value is never assigned:\", closureTest3())\n\nprint(\"Scope test where UnboundLocalError is expected:\", scopeTest4())\n\n\ndef function():\n    pass\n\n\nclass ClosureLocalizerClass:\n    print(\"Function before assigned in a class:\", function)\n\n    function = 1\n\n    print(\"Function after it was assigned in class:\", function)\n\n\nClosureLocalizerClass()\n\n\ndef ClosureLocalizerFunction():\n    try:\n        function = function\n\n        print(\"Function didn't give unbound local error\")\n    except UnboundLocalError as e:\n        print(\n            \"Function gave unbound local error when accessing function before assignment:\",\n            repr(e),\n        )\n\n\nClosureLocalizerFunction()\n\n\nclass X:\n    def __init__(self, x):\n        self.x = x\n\n\ndef changingClosure():\n    print(\"Changing a closure taken value after it was taken.\")\n\n    a = 1\n\n    def closureTaker():\n        return X(a)\n\n    x = closureTaker()\n    a = 2\n    print(\"Closure value first time:\", x.x)\n    x = closureTaker()\n    print(\"Closure value second time:\", x.x)\n\n\nchangingClosure()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ListContractionsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Cover list contractions and a few special things in them.\n\n\"\"\"\n\nfrom __future__ import print_function\n\n# Tests do bad things, pylint: disable=possibly-unused-variable,redefined-outer-name\n\n\ndef displayDict(d):\n    result = \"{\"\n    first = True\n    for key, value in sorted(d.items()):\n        if not first:\n            result += \",\"\n\n        result += \"%s: %s\" % (repr(key), repr(value))\n        first = False\n    result += \"}\"\n\n    return result\n\n\nprint(\"List contraction on the module level:\")\nx = [(u if u % 2 == 0 else 0) for u in range(10)]\nprint(x)\n\nprint(\"List contraction on the function level:\")\n\n\ndef someFunction():\n    x = [(u if u % 2 == 0 else 0) for u in range(10)]\n    print(x)\n\n\nsomeFunction()\n\nprint(\"List contractions with no, 1 one 2 conditions:\")\n\n\ndef otherFunction():\n    print([x for x in range(8)])\n    print([x for x in range(8) if x % 2 == 1])\n    print([x for x in range(8) if x % 2 == 1 if x > 4])\n\n\notherFunction()\n\nprint(\"Complex list contractions with more than one for:\")\n\n\ndef complexContractions():\n    print([(x, y) for x in range(3) for y in range(5)])\n\n    seq = range(3)\n    res = [(i, j, k) for i in iter(seq) for j in iter(seq) for k in iter(seq)]\n\n    print(res)\n\n\ncomplexContractions()\n\nprint(\"Contraction for 2 for statements and one final if referring to first for:\")\n\n\ndef trickyContraction():\n    class Range:\n        def __init__(self, value):\n            self.value = value\n\n        def __iter__(self):\n            print(\"Giving range iter to\", self.value)\n\n            return iter(range(self.value))\n\n    def Cond(y):\n        print(\"Checking against\", y)\n\n        return y == 1\n\n    r = [(x, z, y) for x in Range(3) for z in Range(2) for y in Range(4) if Cond(y)]\n    print(\"result is\", r)\n\n\ntrickyContraction()\n\n\ndef lambdaWithcontraction(x):\n    l = lambda x: [z for z in range(x)]\n    r = l(x)\n\n    print(\"Lambda contraction locals:\", displayDict(locals()))\n\n\nlambdaWithcontraction(3)\n\nprint(\"Contraction that gets a 'del' on the iterator variable:\", end=\" \")\n\n\ndef allowedDelOnIteratorVariable(z):\n    x = 2\n    del x\n    return [x * z for x in range(z)]\n\n\nprint(allowedDelOnIteratorVariable(3))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/LoopingTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Looping in various forms.\n\n\"\"\"\n\nfrom __future__ import print_function\n\n# pylint: disable=superfluous-parens,useless-else-on-loop,using-constant-test\n\n\ndef cond():\n    return False\n\n\ndef loopingFunction(a=1 * 2):\n    c = []\n    f = [c, a]\n\n    for a in range(6 or 8):\n        for b in range(8):\n            if a == b:\n                c.append((a, b, True))\n            elif a < b:\n                c.append((b, a, False))\n            else:\n                c.append((a, b, False))\n\n            if a != b:\n                z = 1\n            else:\n                z = 0\n\n            if z == 0:\n                continue\n\n            if z == 1 and b == 6:\n                break\n\n            if a == b:\n                z = 0\n\n    print(c)\n    print(f)\n\n    f = 1\n\n    while f < (10 or 8):\n        m = 1\n        f += 1\n\n    print(\"m=\", m)\n\n    x = [u for u in range(8)]\n    print(x)\n\n    x = [(u, v) for (u, v) in zip(range(8), reversed(range(8)))]\n    print(x)\n\n    x = [(u if u % 2 == 0 else 0) for u in range(10)]\n    print(x)\n\n    x = [(u if u % 2 == 0 else 0) for u in (a if cond() else range(9))]\n    print(x)\n\n    y = [[3 + (l if l else -1) for l in [m, m + 1]] for m in [f for f in range(2)]]\n    print(\"f=\", f)\n    print(\"y=\", y)\n\n    if x:\n        l = \"YES\"\n    else:\n        l = \"NO\"\n\n    if x:\n        l = \"yes\"\n    else:\n        if True:\n            l = \"no\"\n\n    print(\"Triple and chain\")\n\n    if m and l and f:\n        print(\"OK\")\n\n    print(\"Triple or chain\")\n    if m or l or f:\n        print(\"Okey\")\n\n    print(\"Nested if not chain\")\n    if not m:\n        if not l:\n            print(\"ok\")\n\n    print(\"Braced if not chain with 'or'\")\n    if not (m or l):\n        print(\"oki\")\n\n    print(\"Braced if not chain with 'and'\")\n    if not (m and l):\n        print(\"oki\")\n\n    d = 1\n    print(\"Nested if chain with outer else\")\n    if a:\n        if b or c:\n            if d:\n                print(\"inside nest\")\n\n    else:\n        print(\"outer else\")\n\n    print(x)\n\n    while False:\n        pass\n    else:\n        print(\"Executed else branch for False condition while loop\")\n\n    while True:\n        break\n    else:\n        print(\"Executed else branch for True condition while loop\")\n\n    for x in range(7):\n        pass\n    else:\n        print(\"Executed else branch for no break for loop\")\n\n    for x in range(7):\n        break\n    else:\n        print(\"Executed else branch despite break in for loop\")\n\n    x = iter(range(5))\n\n    while next(x):\n        pass\n    else:\n        print(\"Executed else branch of while loop without break\")\n\n\nloopingFunction()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/MainProgramsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Module name is\", __name__)\n\n\nclass SomeClass:\n    pass\n\n\nprint(\"Class inside main module names its module as\", repr(SomeClass.__module__))\n\nif __name__ == \"__main__\":\n    print(\"Executed as __main__:\")\n\n    import os\n    import sys\n\n    # The sys.argv[0] might contain \".exe\", \".py\" or no suffix at all.\n    # Remove it, so the \"diff\" output is more acceptable.\n    args = sys.argv[:]\n    args[0] = (\n        os.path.basename(args[0])\n        .replace(\".exe\", \".py\")\n        .replace(\".bin\", \".py\")\n        .replace(\".py\", \"\")\n    )\n\n    print(\"Arguments were (stripped argv[0] suffix):\", repr(args))\n\n    # Output the flags, so we can test if we are compatible with these too.\n    print(\"The sys.flags are:\", sys.flags)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ModuleAttributesTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Some module documentation.\n\nWith newline and stuff.\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nprint(\"doc:\", __doc__)\nprint(\"filename:\", os.path.basename(__file__))\nprint(\"builtins:\", __builtins__)\nprint(\"debug\", __debug__)\nprint(\"debug in builtins\", __builtins__.__debug__)\n\nprint(\"__initializing__\", end=\" \")\ntry:\n    print(__initializing__)\nexcept NameError:\n    print(\"not found\")\n\n\ndef checkFromFunction():\n    frame = sys._getframe(1)  # pylint: disable=protected-access\n\n    def displayDict(d):\n        if \"__loader__\" in d:\n            d = dict(d)\n            if str is bytes:\n                del d[\"__loader__\"]\n            else:\n                d[\"__loader__\"] = \"<__loader__ removed>\"\n\n        if \"__file__\" in d:\n            d = dict(d)\n            d[\"__file__\"] = \"<__file__ removed>\"\n\n        if \"__compiled__\" in d:\n            d = dict(d)\n            del d[\"__compiled__\"]\n\n        import pprint\n\n        return pprint.pformat(d)\n\n    print(\"Globals\", displayDict(frame.f_globals))\n    print(\"Locals\", displayDict(frame.f_locals))\n    print(\"Is identical\", frame.f_locals is frame.f_globals)\n\n\ncheckFromFunction()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/OperatorsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\na = 3\nb = 7\nc = [7, 8]\nd = 15\n\nprint(\"+\", a + b)\nprint(\"-\", a - b)\nprint(\"*\", a * b)\nprint(\"/\", a / b)\nprint(\"//\", a // b)\nprint(\"%\", b % a)\nprint(\"& (2)\", a & b)\nprint(\"| (2)\", a | b)\nprint(\"& (3)\", a & b & d)\nprint(\"| (3)\", a | b | d)\nprint(\"^ (2)\", a ^ b)\nprint(\"^ (3)\", a ^ b ^ d)\nprint(\"**\", a**b)\nprint(\"<<\", a << b)\nprint(\">>\", b >> a)\nprint(\"in\", b in c)\nprint(\"not in\", b not in c)\nprint(\"<\", a < b)\nprint(\">\", a > b)\nprint(\"==\", a == b)\nprint(\"<=\", a <= b)\nprint(\">=\", a >= b)\nprint(\"!=\", a != b)\nprint(\"is\", a is b)\nprint(\"is not\", a is not b)\n\nprint(\"~\", ~b)\nprint(\"-\", -b)\nprint(\"+\", +b)\n\nl = {(\"a\", \"c\"): \"a,c\", \"b\": 2, \"c\": 3, \"d\": 4}\nl[\"l\",] = \"6\"\n\n\nprint(\"Extended slicing:\")\nprint(\"Should be a,c:\", l[\"a\", \"c\"])\n\nprint(\"Short form of extended slicing:\")\n\nd = {}\n# d[1] = 1\nd[1,] = 2\nd[1, 2] = 3\nd[1, 2, 3] = 4\nL = list(d)\nL.sort()\nprint(L)\n\ns = \"Some information\"\nss = s[-1]\n\nprint(\"Constant subscript of string\", ss)\n\nprint(\"Slicing on a list:\")\nl = [1, 3, 5, 7, 11, 13, 17]\n\nprint(l[None:None])\n\nn = None\nprint(l[n:n])\nprint(l[3:n])\nprint(l[n:3])\n\nvalue = None\ntry:\n    x = value[1]\nexcept Exception as e:\n    print(\"Indexing None gives\", repr(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/OrderChecksTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef separator():\n    print(\"*\" * 80)\n\n\ndef dictOrderCheck():\n    def key1():\n        print(\"key1 called\")\n\n        return 1\n\n    def key2():\n        print(\"key2 called\")\n\n        return 2\n\n    def value1():\n        print(\"value1 called\")\n\n        return 11\n\n    def value2():\n        print(\"value2 called\")\n\n        return 22\n\n    print(\"Checking order of calls in dictionary creation from callables:\")\n\n    print({key1(): value1(), key2(): value2()})\n\n    try:\n        (1 / 0)[1.0j / 0] = 1.0 / 0\n    except ZeroDivisionError as e:\n        print(\"Expected exception caught:\", repr(e))\n    try:\n        (1 / 0)[1.0 / 0] = 1\n    except ZeroDivisionError as e:\n        print(\"Expected exception caught:\", repr(e))\n    try:\n        (1 / 0)[1] = 1.0 / 0\n    except ZeroDivisionError as e:\n        print(\"Expected exception caught:\", repr(e))\n\n\ndef listOrderCheck():\n    def value1():\n        print(\"value1 called\")\n\n        return 11\n\n    def value2():\n        print(\"value2 called\")\n\n        return 22\n\n    print([value1(), value2()])\n\n\ndef sliceOrderCheck():\n    print(\"Slices:\")\n    d = list(range(10))\n\n    def lvalue():\n        print(\"lvalue\", end=\" \")\n\n        return d\n\n    def rvalue():\n        print(\"rvalue\", end=\" \")\n\n        return range(2)\n\n    def rvalue4():\n        print(\"rvalue\", end=\" \")\n\n        return range(4)\n\n    def low():\n        print(\"low\", end=\" \")\n\n        return 0\n\n    def high():\n        print(\"high\", end=\" \")\n\n        return 4\n\n    def step():\n        print(\"step\", end=\" \")\n\n        return 2\n\n    print(\"Complex slice lookup:\", end=\" \")\n    print(lvalue()[low() : high() : step()])\n\n    print(\"Complex slice assignment:\", end=\" \")\n    lvalue()[low() : high() : step()] = rvalue()\n    print(d)\n\n    print(\"Complex slice del:\", end=\" \")\n    del lvalue()[low() : high() : step()]\n    print(d)\n\n    print(\"Complex inplace slice operation\", end=\" \")\n    # TODO: This gives an error in CPython, but not in Nuitka.\n    # lvalue()[ low() : high() : step() ] += rvalue()\n    print(d)\n\n    d = list(range(10))\n\n    print(\"Simple slice lookup\", end=\" \")\n    print(lvalue()[low() : high()])\n\n    print(\"Simple slice assignment\", end=\" \")\n    lvalue()[3 + low() : 3 + high()] = rvalue()\n    print(d)\n\n    print(\"Simple slice del\", end=\" \")\n    del lvalue()[3 + low() : 3 + high()]\n    print(d)\n\n    print(\"Simple inplace slice operation\", end=\" \")\n    lvalue()[low() : high()] += rvalue4()\n    print(d)\n\n\ndef subscriptOrderCheck():\n    print(\"Subscripts:\")\n    d = {}\n\n    def lvalue():\n        print(\"lvalue\", end=\" \")\n\n        return d\n\n    def rvalue():\n        print(\"rvalue\", end=\" \")\n\n        return 2\n\n    def subscript():\n        print(\"subscript\", end=\" \")\n\n        return 1\n\n    print(\"Assigning subscript:\")\n    lvalue()[subscript()] = rvalue()\n    print(d)\n\n    print(\"Lookup subscript:\")\n    print(lvalue()[subscript()])\n\n    print(\"Deleting subscript:\")\n    del lvalue()[subscript()]\n    print(d)\n\n\ndef attributeOrderCheck():\n    def lvalue():\n        print(\"lvalue\", end=\" \")\n\n        return lvalue\n\n    def rvalue():\n        print(\"rvalue\", end=\" \")\n\n        return 2\n\n    print(\"Attribute assignment order:\")\n\n    lvalue().xxx = rvalue()\n    print(\"Assigned was indeed:\", lvalue.xxx)\n\n    print(\"Checking attribute assignment to unassigned value from unassigned:\")\n    try:\n        undefined_global_zzz.xxx = undefined_global_yyy\n    except Exception as e:\n        print(\"Expected exception caught:\", repr(e))\n    else:\n        assert False\n\n    try:\n        (1 / 0).x = 1.0 / 0\n    except ZeroDivisionError as e:\n        print(\"Expected exception caught:\", repr(e))\n\n\ndef compareOrderCheck():\n    def lvalue():\n        print(\"lvalue\", end=\" \")\n\n        return 1\n\n    def rvalue():\n        print(\"rvalue\", end=\" \")\n\n        return 2\n\n    print(\"Comparisons:\")\n    print(\"==\", lvalue() == rvalue())\n    print(\"<=\", lvalue() <= rvalue())\n    print(\">=\", lvalue() >= rvalue())\n    print(\"!=\", lvalue() != rvalue())\n    print(\">\", lvalue() > rvalue())\n    print(\"<\", lvalue() < rvalue())\n\n    print(\"Comparison used in bool context:\")\n    print(\"==\", \"yes\" if lvalue() == rvalue() else \"no\")\n    print(\"<=\", \"yes\" if lvalue() <= rvalue() else \"no\")\n    print(\">=\", \"yes\" if lvalue() >= rvalue() else \"no\")\n    print(\"!=\", \"yes\" if lvalue() != rvalue() else \"no\")\n    print(\">\", \"yes\" if lvalue() > rvalue() else \"no\")\n    print(\"<\", \"yes\" if lvalue() < rvalue() else \"no\")\n\n\ndef operatorOrderCheck():\n    def left():\n        print(\"left operand\", end=\" \")\n\n        return 1\n\n    def middle():\n        print(\"middle operand\", end=\" \")\n\n        return 3\n\n    def right():\n        print(\"right operand\", end=\" \")\n\n        return 2\n\n    print(\"Operations:\")\n    print(\"+\", left() + middle() + right())\n    print(\"-\", left() - middle() - right())\n    print(\"*\", left() * middle() * right())\n    print(\"/\", left() / middle() / right())\n    print(\"%\", left() % middle() % right())\n    print(\"**\", left() ** middle() ** right())\n\n\ndef generatorOrderCheck():\n    print(\"Generators:\")\n\n    def default1():\n        print(\"default1\", end=\" \")\n\n        return 1\n\n    def default2():\n        print(\"default2\", end=\" \")\n\n        return 2\n\n    def default3():\n        print(\"default3\", end=\" \")\n\n        return 3\n\n    def value(x):\n        print(\"value\", x, end=\" \")\n        return x\n\n    def generator(a=default1(), b=default2(), c=default3()):\n        print(\"generator entry\")\n        yield value(a)\n        yield value(b)\n        yield value(c)\n        print(\"generator exit\")\n\n    result = list(generator())\n    print(\"Result\", result)\n\n\ndef classOrderCheck():\n    print(\"Checking order of class constructions:\")\n\n    class B1:\n        pass\n\n    class B2:\n        pass\n\n    def base1():\n        print(\"base1\", end=\" \")\n\n        return B1\n\n    def base2():\n        print(\"base2\", end=\" \")\n\n        return B2\n\n    def deco1(cls):\n        print(\"deco1\", end=\" \")\n\n        return cls\n\n    def deco2(cls):\n        print(\"deco2\")\n\n        return B2\n\n    @deco2\n    @deco1\n    class X(base1(), base2()):\n        print(\"class body\", end=\" \")\n\n    print\n\n\ndef inOrderCheck():\n    print(\"Checking order of in operator:\")\n\n    def container():\n        print(\"container\", end=\" \")\n\n        return [3]\n\n    def searched():\n        print(\"searched\", end=\" \")\n\n        return 3\n\n    print(\"in:\", searched() in container())\n    print(\"not in:\", searched() not in container())\n\n\ndef unpackOrderCheck():\n    class TraceRelease:\n        def __init__(self, value):\n            self.value = value\n\n        def __del__(self):\n            print(\"Deleting iteration value\", self.value)\n            pass\n\n    print(\"Unpacking values:\")\n\n    class Iterable:\n        def __init__(self):\n            self.consumed = 2\n\n        def __iter__(self):\n            return Iterable()\n\n        def __del__(self):\n            print(\"Deleted iterable with\", self.consumed)\n\n        def next(self):\n            print(\"Next with state\", self.consumed)\n\n            if self.consumed:\n                self.consumed -= 1\n            else:\n                raise StopIteration\n\n            return TraceRelease(self.consumed)\n\n        __next__ = next\n\n    iterable = Iterable()\n\n    class RejectAttributeOwnership:\n        def __setattr__(self, key, value):\n            print(\"Setting\", key, value.value)\n\n    try:\n        RejectAttributeOwnership().x, RejectAttributeOwnership().y = a, b = iterable\n    except Exception as e:\n        print(\"Caught\", repr(e))\n\n    return a, b\n\n\ndef superOrderCheck():\n    print(\"Built-in super:\")\n    try:\n        super(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught super 2\", repr(e))\n\n\ndef isinstanceOrderCheck():\n    print(\"Built-in isinstance:\")\n    try:\n        isinstance(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught isinstance 2\", repr(e))\n\n\ndef rangeOrderCheck():\n    print(\"Built-in range:\")\n    try:\n        range(zzz, yyy, xxx)\n    except Exception as e:\n        print(\"Expected exception caught range 3\", repr(e))\n\n    try:\n        range(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught range 2\", repr(e))\n\n\ndef importOrderCheck():\n    print(\"Built-in __import__:\")\n\n    def name():\n        print(\"name\", end=\" \")\n\n    def globals():\n        print(\"globals\", end=\" \")\n\n    def locals():\n        print(\"locals\", end=\" \")\n\n    def fromlist():\n        print(\"fromlist\", end=\" \")\n\n    def level():\n        print(\"level\")\n\n    try:\n        __import__(name(), globals(), locals(), fromlist(), level())\n    except Exception as e:\n        print(\"Expected exception caught __import__ 5\", repr(e))\n\n\ndef hasattrOrderCheck():\n    print(\"Built-in hasattr:\")\n    try:\n        hasattr(zzz, yyy)\n    except Exception as e:\n        print(\"Expected exception caught hasattr\", repr(e))\n\n\ndef getattrOrderCheck():\n    print(\"Built-in getattr:\")\n    try:\n        getattr(zzz, yyy)\n    except Exception as e:\n        print(\"Expected exception caught getattr 2\", repr(e))\n\n    try:\n        getattr(zzz, yyy, xxx)\n    except Exception as e:\n        print(\"Expected exception caught getattr 3\", repr(e))\n\n    def default():\n        print(\"default used\")\n\n    print(\"Default side effects:\", end=\" \")\n    print(getattr(1, \"real\", default()))\n\n\ndef typeOrderCheck():\n    print(\"Built-in type:\")\n    try:\n        type(zzz, yyy, xxx)\n    except Exception as e:\n        print(\"Expected exception caught type 3\", repr(e))\n\n\ndef iterOrderCheck():\n    print(\"Built-in iter:\")\n    try:\n        iter(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught iter 2\", repr(e))\n\n\ndef openOrderCheck():\n    print(\"Built-in open:\")\n    try:\n        open(zzz, yyy, xxx)\n    except Exception as e:\n        print(\"Expected exception caught open 3\", repr(e))\n\n\ndef unicodeOrderCheck():\n    print(\"Built-in unicode:\")\n    try:\n        unicode(zzz, yyy, xxx)\n    except Exception as e:\n        print(\"Expected exception caught unicode\", repr(e))\n\n\ndef longOrderCheck():\n    print(\"Built-in long:\")\n    try:\n        long(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught long 2\", repr(e))\n\n\ndef intOrderCheck():\n    print(\"Built-in int:\")\n    try:\n        int(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught int\", repr(e))\n\n\ndef nextOrderCheck():\n    print(\"Built-in next:\")\n    try:\n        next(zzz, xxx)\n    except Exception as e:\n        print(\"Expected exception caught next 2\", repr(e))\n\n\ndef callOrderCheck():\n    print(\"Checking nested call arguments:\")\n\n    class A:\n        def __del__(self):\n            print(\"Doing del inner object\")\n\n    def check(obj):\n        print(\"Outer function\")\n\n    def p(obj):\n        print(\"Inner function\")\n\n    check(p(A()))\n\n\ndef boolOrderCheck():\n    print(\"Checking order of or/and arguments:\")\n\n    class A(int):\n        def __init__(self, value):\n            self.value = value\n\n        def __del__(self):\n            print(\"Doing del of %s\" % self)\n\n        def __bool__(self):\n            print(\"Test of %s\" % self)\n            return self.value != 0\n\n        __nonzero__ = __bool__\n\n        def __str__(self):\n            return \"<%s %r>\" % (self.__class__.__name__, self.value)\n\n    class B(A):\n        pass\n\n    class C(A):\n        pass\n\n    print(\"Two arguments, A or B:\")\n    for a in range(2):\n        for b in range(2):\n            print(\"Case %d or %d\" % (a, b))\n            r = A(a) or B(b)\n            print(r)\n            del r\n\n    # TODO: The order of deletion does not exactly match, which we accept for\n    # now.\n    if True:\n        print(\"Three arguments, A or B or C:\")\n        for a in range(2):\n            for b in range(2):\n                for c in range(2):\n                    print(\"Case %d or %d or %d\" % (a, b, c))\n                    r = A(a) or B(b) or C(c)\n                    print(r)\n                    del r\n\n    print(\"Two arguments, A and B:\")\n    for a in range(2):\n        for b in range(2):\n            print(\"Case %d and %d\" % (a, b))\n            r = A(a) and B(b)\n            print(r)\n            del r\n\n    # See above\n    if True:\n        print(\"Three arguments, A and B and C:\")\n        for a in range(2):\n            for b in range(2):\n                for c in range(2):\n                    print(\"Case %d and %d and %d\" % (a, b, c))\n                    r = A(a) and B(b) and C(c)\n                    print(r)\n                    del r\n\n\ndef comparisonChainOrderCheck():\n    print(\"Checking order of comparison chains:\")\n\n    class A(int):\n        def __init__(self, value):\n            self.value = value\n\n        def __del__(self):\n            print(\"Doing del of %s\" % self)\n\n        def __le__(self, other):\n            print(\"Test of %s <= %s\" % (self, other))\n            return self.value <= other.value\n\n        def __str__(self):\n            return \"<%s %r>\" % (self.__class__.__name__, self.value)\n\n    class B(A):\n        pass\n\n    class C(A):\n        pass\n\n    # See above, not really doing it right.\n    if False:\n        print(\"Three arguments, A <= B <= C:\")\n        for a in range(3):\n            for b in range(3):\n                for c in range(3):\n                    print(\"Case %d <= %d <= %d\" % (a, b, c))\n                    r = A(a) <= B(b) <= C(c)\n                    print(r)\n                    del r\n\n\ndictOrderCheck()\nseparator()\nlistOrderCheck()\nseparator()\nsubscriptOrderCheck()\nseparator()\nattributeOrderCheck()\nseparator()\noperatorOrderCheck()\nseparator()\ncompareOrderCheck()\nseparator()\nsliceOrderCheck()\nseparator()\ngeneratorOrderCheck()\nseparator()\nclassOrderCheck()\nseparator()\ninOrderCheck()\nseparator()\nunpackOrderCheck()\nseparator()\nsuperOrderCheck()\nseparator()\nisinstanceOrderCheck()\nseparator()\nrangeOrderCheck()\nseparator()\nimportOrderCheck()\nseparator()\nhasattrOrderCheck()\nseparator()\ngetattrOrderCheck()\nseparator()\ntypeOrderCheck()\nseparator()\niterOrderCheck()\nseparator()\nopenOrderCheck()\nseparator()\nunicodeOrderCheck()\nseparator()\nnextOrderCheck()\nseparator()\nlongOrderCheck()\nseparator()\nintOrderCheck()\nseparator()\ncallOrderCheck()\nseparator()\nboolOrderCheck()\nseparator()\ncomparisonChainOrderCheck()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/OrderChecksTest27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef setOrderCheck():\n    print(\"Checking order of set literals:\")\n\n    def one():\n        print(\"one\")\n        return \"one\"\n\n    def two():\n        print(\"two\")\n        return \"two\"\n\n    return {one(), two()}\n\n\ndef raiseOrderCheck():\n    print(\"Checking order of raises:\")\n\n    def exception_type():\n        print(\"exception_type\", end=\"\")\n\n        return ValueError\n\n    def exception_value():\n        print(\"exception_value\", end=\"\")\n\n        return 1\n\n    def exception_tb():\n        print(\"exception_value\", end=\"\")\n\n        return None\n\n    print(\"3 args\", end=\"\")\n    try:\n        raise exception_type(), exception_value(), exception_tb()\n    except Exception as e:\n        print(\"caught\", repr(e))\n\n    print(\"2 args\", end=\"\")\n    try:\n        raise exception_type(), exception_value()\n    except Exception as e:\n        print(\"caught\", repr(e))\n\n    print(\"1 args\", end=\"\")\n    try:\n        raise exception_type()\n    except Exception as e:\n        print(\"caught\", repr(e))\n\n\nsetOrderCheck()\nraiseOrderCheck()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/OverflowFunctionsTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef starImporterFunction():\n    from sys import *\n\n    print \"Version\", version.split()[0].split(\".\")[:-1]\n\n\nstarImporterFunction()\n\n\ndef deepExec():\n    for_closure = 3\n\n    def deeper():\n        for_closure_as_well = 4\n\n        def execFunction():\n            code = \"f=2\"\n\n            # Can fool it to nest\n            exec code in None, None\n\n            print \"Locals now\", locals()\n\n            print \"Closure one level up was taken\", for_closure_as_well\n            print \"Closure two levels up was taken\", for_closure\n            print \"Globals still work\", starImporterFunction\n            print \"Added local from code\", f\n\n        execFunction()\n\n    deeper()\n\n\ndeepExec()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ParameterErrorsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef functionNoParameters():\n    pass\n\n\nprint(\"Call a function with no parameters with a plain argument:\")\n\ntry:\n    functionNoParameters(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with no parameters with a keyword argument:\")\n\ntry:\n    functionNoParameters(z=1)\nexcept TypeError as e:\n    print(repr(e))\n\n\ndef functionOneParameter(a):\n    print(a)\n\n\nprint(\"Call a function with one parameter with two plain arguments:\")\n\ntry:\n    functionOneParameter(1, 1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with one parameter too many, and duplicate arguments:\")\ntry:\n    functionOneParameter(6, a=4, *(1, 2, 3))\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with two parameters with three plain arguments:\")\n\n\ndef functionTwoParameters(a, b):\n    print(a, b)\n\n\ntry:\n    functionTwoParameters(1, 2, 3)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with two parameters with one plain argument:\")\n\ntry:\n    functionTwoParameters(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with two parameters with three plain arguments:\")\n\ntry:\n    functionTwoParameters(1, 2, 3)\nexcept TypeError as e:\n    print(repr(e))\n\n\nprint(\"Call a function with two parameters with one keyword argument:\")\n\ntry:\n    functionTwoParameters(a=1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with two parameters with three keyword arguments:\")\n\ntry:\n    functionTwoParameters(a=1, b=2, c=3)\nexcept TypeError as e:\n    print(repr(e))\n\n\nclass MethodContainer:\n    def methodNoParameters(self):\n        pass\n\n    def methodOneParameter(self, a):\n        print(a)\n\n    def methodTwoParameters(self, a, b):\n        print(a, b)\n\n\nobj = MethodContainer()\n\nprint(\"Call a method with no parameters with a plain argument:\")\n\ntry:\n    obj.methodNoParameters(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with no parameters with a keyword argument:\")\n\ntry:\n    obj.methodNoParameters(z=1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with one parameter with two plain arguments:\")\n\ntry:\n    obj.methodOneParameter(1, 1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with two parameters with three plain arguments:\")\n\ntry:\n    obj.methodTwoParameters(1, 2, 3)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with two parameters with one plain argument:\")\n\ntry:\n    obj.methodTwoParameters(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with two parameters with one keyword argument:\")\n\ntry:\n    obj.methodTwoParameters(a=1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a method with two parameters with three keyword arguments:\")\n\ntry:\n    obj.methodTwoParameters(a=1, b=2, c=3)\nexcept TypeError as e:\n    print(repr(e))\n\n\ndef functionPosBothStarArgs(a, b, c, *l, **d):\n    print(a, b, c, l, d)\n\n\nl = [2]\nd = {\"other\": 7}\n\nprint(\"Call a function with both star arguments and too little arguments:\")\n\ntry:\n    functionPosBothStarArgs(1, *l, **d)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with defaults with too little arguments:\")\n\n\ndef functionWithDefaults(a, b, c, d=3):\n    print(a, b, c, d)\n\n\ntry:\n    functionWithDefaults(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call a function with defaults with too many arguments:\")\n\ntry:\n    functionWithDefaults(1)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Complex calls with both invalid star list and star arguments:\")\n\ntry:\n    a = 1\n    b = 2.0\n\n    functionWithDefaults(1, c=3, *a, **b)\nexcept TypeError as e:\n    # Workaround Python 3.9 shortcoming\n    print(repr(e).replace(\"Value\", \"__main__.functionWithDefaults() argument\"))\n\ntry:\n    a = 1\n    b = 2.0\n\n    functionWithDefaults(1, *a, **b)\nexcept TypeError as e:\n    # Workaround Python 3.9 shortcoming\n    print(repr(e).replace(\"Value\", \"__main__.functionWithDefaults() argument\"))\n\ntry:\n    a = 1\n    b = 2.0\n\n    functionWithDefaults(c=1, *a, **b)\nexcept TypeError as e:\n    print(repr(e))\n\ntry:\n    a = 1\n    b = 2.0\n\n    functionWithDefaults(*a, **b)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Complex call with both invalid star list argument:\")\n\ntry:\n    a = 1\n\n    functionWithDefaults(*a)\nexcept TypeError as e:\n    print(repr(e))\n\n\ntry:\n    a = 1\n\n    MethodContainer(*a)\nexcept TypeError as e:\n    print(repr(e))\n\n\ntry:\n    a = 1\n\n    MethodContainer()(*a)\nexcept TypeError as e:\n    print(repr(e))\n\ntry:\n    a = 1\n\n    MethodContainer.methodTwoParameters(*a)\nexcept TypeError as e:\n    print(repr(e))\n\ntry:\n    a = 1\n\n    None(*a)\nexcept TypeError as e:\n    print(repr(e))\n\n\ntry:\n    a = 1\n\n    None(**a)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call object with name as both keyword and in star dict argument:\")\ntry:\n    a = {\"a\": 3}\n\n    None(a=2, **a)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call function with only defaulted value given as keyword argument:\")\n\n\ndef functionwithTwoArgsOneDefaulted(a, b=5):\n    pass\n\n\ntry:\n    functionwithTwoArgsOneDefaulted(b=12)\nexcept TypeError as e:\n    print(repr(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ParameterErrorsTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef kwfunc(a, *, k):\n    pass\n\n\nprint(\"Call function with mixed arguments with too wrong keyword argument.\")\n\ntry:\n    kwfunc(k=3, b=5)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call function with mixed arguments with too little positional arguments.\")\n\ntry:\n    kwfunc(k=3)\nexcept TypeError as e:\n    print(repr(e))\n\n\nprint(\"Call function with mixed arguments with too little positional arguments.\")\n\ntry:\n    kwfunc(3)\nexcept TypeError as e:\n    print(repr(e))\n\nprint(\"Call function with mixed arguments with too many positional arguments.\")\n\ntry:\n    kwfunc(1, 2, k=3)\nexcept TypeError as e:\n    print(repr(e))\n\n\ndef kwfuncdefaulted(a, b=None, *, c=None):\n    pass\n\n\nprint(\n    \"Call function with mixed arguments and defaults but too many positional arguments.\"\n)\n\ntry:\n    kwfuncdefaulted(1, 2, 3)\nexcept TypeError as e:\n    print(repr(e))\n\n\ndef kwfunc2(a, *, k, l, m):\n    pass\n\n\nprint(\n    \"Call function with mixed arguments with too little positional and keyword-only arguments.\"\n)\n\ntry:\n    kwfunc2(1, l=2)\nexcept TypeError as e:\n    print(repr(e))\n\ntry:\n    kwfunc2(1)\nexcept TypeError as e:\n    print(repr(e))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/PrintFutureTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"hallo welt\", end=\", \")\nprint(\"this is the end\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/PrintingTest_2.py",
    "content": "# -*- coding: utf-8 -*-\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# All of these should be identical with correct software behavior.\n\nprint \"Output with newline.\"\nprint \"Output\", \"with\", \"newline.\"\nprint \"Output trailing spaces \", \"with \", \"newline.\"\nprint \"Output \",\nprint \"with \",\nprint \"newline.\"\nprint \"Output\\twith tab\"\nprint \"Output\\t\",\nprint \"with tab\"\n\n# These ones gave errors with previous literal bugs:\nprint \"changed 2\"\nprint \"foo%sbar%sfred%sbob?????\"\n\na = \"partial print\"\n# b doesn't exist\n\ntry:\n    print a, undefined_global\nexcept Exception, e:\n    print \"then occurred\", repr(e)\n\nprint \"No newline at the end\",\n\nx = 1\nprint \"\"\"\nNew line is no soft space, is it\n\"\"\", x\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/README.rst",
    "content": "####################\n Basic Nuitka tests\n####################\n\nThese are a set of tests intended to give a quick response to the\nquestion if a version of Nuitka is still good. It doesn't have full\ncoverage of everything, but instead tries to do everything just a\nlittle, often covering corner cases you wouldn't think of.\n"
  },
  {
    "path": "tests/basics/RecursionTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ncount = 0\n\n\ndef recurse():\n    global count\n    count += 1\n\n    if count < 50:\n        recurse()\n\n\nrecurse()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\"\"\"\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\nfrom nuitka.tools.testing.Common import executeReferenceChecked\n\n# isort:start\n\n# Tests do all bad things:\n# pylint: disable=misplaced-bare-raise,raising-bad-type,reimported,undefined-variable\n# pylint: disable=broad-except,eval-used,redefined-outer-name,unused-argument,unused-variable\n# pylint: disable=attribute-defined-outside-init,bare-except,lost-exception,pointless-statement\n# pylint: disable=exec-used,global-statement,invalid-name,not-callable,super-init-not-called\n\nx = 17\n\n\n# Just a function return a constant. Functions don't become any smaller. Let's\n# get that right.\ndef simpleFunction1():\n    return 1\n\n\n# Do a bit of math with a local variable, assigning to its value and then doing\n# an overwrite of that, trying that math again. This should cover local access\n# a bit.\ndef simpleFunction2():\n    y = 3 * x\n    y = 3\n\n    return x * 2 * y\n\n\n# A local function is being returned. This covers creation of local functions\n# and their release. No closure variables involved yet.\ndef simpleFunction3():\n    def contained():\n        return x\n\n    return contained\n\n\n# Again, local function being return, but this time with local variable taken\n# as a closure. We use value from defaulted argument, so it cannot be replaced.\ndef simpleFunction4(a=1):\n    y = a\n\n    def contained():\n        return y\n\n    return contained\n\n\n# Default argument and building a list as local variables. Also return them,\n# so they are not optimized away.\ndef simpleFunction5(a=2):\n    c = 1\n    f = [a, a + c]\n\n    return c, f\n\n\ndef simpleFunction6():\n    for _b in range(6):\n        pass\n\n    for _c in (1, 2, 3, 4, 5, 6):\n        pass\n\n\ndef simpleFunction7(b=1):\n    for _b in range(6):\n        pass\n\n\ndef simpleFunction8():\n    c = []\n    c.append(x)\n\n\ndef simpleFunction9(a=1 * 2):\n    if a == a:\n        pass\n\n\nu = None\n\n\ndef simpleFunction10(a=1 * 2):\n    x = [u for u in range(8)]\n\n\ndef simpleFunction11():\n    f = 1\n\n    while f < 8:\n        f += 1\n\n\nv = None\n\n\ndef simpleFunction12():\n    a = [(u, v) for (u, v) in zip(range(8), range(8))]\n\n    return a\n\n\ndef cond():\n    return 1\n\n\ndef simpleFunction13(a=1 * 2):\n    pass\n\n\ndef simpleFunction14p(x):\n    try:\n        simpleFunction14p(1, 1)  # pylint: disable=too-many-function-args\n    except TypeError as _e:\n        pass\n\n    try:\n        simpleFunction14p(1, 1)  # pylint: disable=too-many-function-args\n    except TypeError:\n        pass\n\n\ndef simpleFunction14():\n    simpleFunction14p(3)\n\n\ndef simpleFunction15p(x):\n    try:\n        try:\n            x += 1\n        finally:\n            try:\n                x *= 1\n            finally:\n                _z = 1\n    except:\n        pass\n\n\ndef simpleFunction15():\n    simpleFunction15p([1])\n\n\ndef simpleFunction16():\n    class EmptyClass:\n        pass\n\n    return EmptyClass\n\n\ndef simpleFunction17():\n    class EmptyObjectClass:\n        pass\n\n    return EmptyObjectClass()\n\n\ndef simpleFunction18():\n    closured = 1\n\n    class NonEmptyClass:\n        def __init__(self, a, b):\n            self.a = a\n            self.b = b\n\n        inside = closured\n\n    return NonEmptyClass(133, 135)\n\n\ndef simpleFunction19():\n    lam = lambda l: l + 1\n\n    return lam(9), lam\n\n\ndef simpleFunction20():\n    try:\n        a = []\n        a[1]\n    except IndexError as _e:\n        pass\n\n\ndef simpleFunction21():\n    class EmptyBaseClass:\n        def base(self):\n            return 3\n\n    class EmptyObjectClass(EmptyBaseClass):\n        pass\n\n    result = EmptyObjectClass()\n\n    c = result.base()\n\n    return result, c\n\n\ndef simpleFunction22():\n    return True is False and False is not None\n\n\ndef simpleFunction23():\n    not 2\n\n\ndef simpleFunction24p(x):\n    pass\n\n\ndef simpleFunction24():\n    simpleFunction24p(x=3)\n\n\ndef simpleFunction25():\n    class X:\n        f = 1\n\n    def inplace_adder(b):\n        X.f += b\n\n    return inplace_adder(6**8)\n\n\ndef simpleFunction26():\n    class X:\n        f = [5]\n\n    def inplace_adder(b):\n        X.f += b\n\n    return inplace_adder([1, 2])\n\n\ndef simpleFunction27():\n    a = {\"g\": 8}\n\n    def inplace_adder(b):\n        a[\"g\"] += b\n\n    return inplace_adder(3)\n\n\ndef simpleFunction28():\n    a = {\"g\": [8], \"h\": 2}\n\n    def inplace_adder(b):\n        a[\"g\"] += b\n\n    return inplace_adder([3, 5])\n\n\ndef simpleFunction29():\n    return \"3\" in \"7\"\n\n\ndef simpleFunction30():\n    def generatorFunction():\n        yield 1\n        yield 2\n        yield 3\n\n\ndef simpleFunction31():\n    def generatorFunction():\n        yield 1\n        yield 2\n        yield 3\n\n    a = []\n\n    for y in generatorFunction():\n        a.append(y)\n\n    for z in generatorFunction():\n        a.append(z)\n\n\ndef simpleFunction32():\n    def generatorFunction():\n        yield 1\n\n    gen = generatorFunction()\n    next(gen)\n\n\ndef simpleFunction33():\n    def generatorFunction():\n        a = 1\n\n        yield a\n\n    a = []\n\n    for y in generatorFunction():\n        a.append(y)\n\n\ndef simpleFunction34():\n    try:\n        raise ValueError\n    except:\n        pass\n\n\ndef simpleFunction35():\n    try:\n        raise ValueError(1, 2, 3)\n    except:\n        pass\n\n\ndef simpleFunction36():\n    try:\n        raise (TypeError, (3, x, x, x))\n    except TypeError:\n        pass\n\n\ndef simpleFunction37():\n    l = [1, 2, 3]\n\n    try:\n        _a, _b = l\n    except ValueError:\n        pass\n\n\ndef simpleFunction38():\n    class Base:\n        pass\n\n    class Parent(Base):\n        pass\n\n\ndef simpleFunction39():\n    class Parent(object):\n        pass\n\n\ndef simpleFunction40():\n    def myGenerator():\n        yield 1\n\n    myGenerator()\n\n\ndef simpleFunction41():\n    a = b = 2\n\n    return a, b\n\n\ndef simpleFunction42():\n    a = b = 2 * x\n\n    return a, b\n\n\ndef simpleFunction43():\n    class D:\n        pass\n\n    a = D()\n\n    a.b = 1\n\n\ndef simpleFunction47():\n    def reraisy():\n        def raisingFunction():\n            raise ValueError(3)\n\n        def reraiser():\n            raise\n\n        try:\n            raisingFunction()\n        except:\n            reraiser()\n\n    try:\n        reraisy()\n    except:\n        pass\n\n\ndef simpleFunction48():\n    class BlockExceptions:\n        def __enter__(self):\n            pass\n\n        def __exit__(self, exc, val, tb):\n            return True\n\n    with BlockExceptions():\n        raise ValueError()\n\n\ntemplate = \"lala %s lala\"\n\n\ndef simpleFunction49():\n    c = 3\n    d = 4\n\n    a = x, y = b, e = (c, d)\n\n    return a, y, b, e\n\n\nb = range(10)\n\n\ndef simpleFunction50():\n    def getF():\n        def f():\n            for i in b:\n                yield i\n\n        return f\n\n    f = getF()\n\n    for x in range(2):\n        _r = list(f())\n\n\ndef simpleFunction51():\n    g = (x for x in range(9))\n\n    try:\n        g.throw(ValueError, 9)\n    except ValueError as _e:\n        pass\n\n\ndef simpleFunction52():\n    g = (x for x in range(9))\n\n    try:\n        g.throw(ValueError(9))\n    except ValueError as _e:\n        pass\n\n\ndef simpleFunction53():\n    g = (x for x in range(9))\n\n    try:\n        g.send(9)\n    except TypeError as _e:\n        pass\n\n\ndef simpleFunction54():\n    g = (x for x in range(9))\n    next(g)\n\n    try:\n        g.send(9)\n    except TypeError as _e:\n        pass\n\n\ndef simpleFunction55():\n    g = (x for x in range(9))\n\n    try:\n        g.close()\n    except ValueError as _e:\n        pass\n\n\ndef simpleFunction56():\n    \"\"\"Throw into finished generator.\"\"\"\n    g = (x for x in range(9))\n\n    list(g)\n\n    try:\n        g.throw(ValueError(9))\n    except ValueError as _e:\n        pass\n\n\ndef simpleFunction60():\n    x = 1\n    y = 2\n\n    def f(a=x, b=y):\n        return a, b\n\n    f()\n    f(2)\n    f(3, 4)\n\n\ndef simpleFunction61():\n    a = 3\n    b = 5\n\n    try:\n        a = a * 2\n\n        return a\n    finally:\n        a / b\n\n\ndef simpleFunction62():\n    a = 3\n    b = 5\n\n    try:\n        a = a * 2\n\n        return a\n    finally:\n        return a / b\n\n\nclass X:\n    def __del__(self):\n        # Super used to reference leak.\n        x = super()\n\n        raise ValueError(1)\n\n\ndef simpleFunction63():\n    def superUser():\n        X()\n\n    try:\n        superUser()\n    except Exception:\n        pass\n\n\ndef simpleFunction64():\n    x = 2\n    y = 3\n    z = eval(\"x * y\")\n\n    return z\n\n\ndef simpleFunction65():\n    import array\n\n    a = array.array(\"b\", b\"\")\n    assert a == eval(repr(a), {\"array\": array.array})\n\n    d = {\"x\": 2, \"y\": 3}\n\n    z = eval(repr(d), d)\n\n    return z\n\n\ndef simpleFunction66():\n    import types\n\n    return type(simpleFunction65) == types.FunctionType\n\n\ndef simpleFunction67():\n    length = 100000\n    pattern = \"1234567890\\00\\01\\02\\03\\04\\05\\06\"\n\n    q, r = divmod(length, len(pattern))\n    teststring = pattern * q + pattern[:r]\n\n    return teststring\n\n\ndef simpleFunction68():\n    from random import randrange\n\n    x = randrange(18)\n\n\ndef simpleFunction69():\n    pools = [tuple()]\n    g = ((len(pool) == 0,) for pool in pools)\n    next(g)\n\n\ndef simpleFunction70():\n    def gen():\n        try:\n            undefined_yyy\n        except Exception:\n            pass\n\n        yield sys.exc_info()\n\n    try:\n        undefined_xxx\n    except Exception:\n        return list(gen())\n\n\ndef simpleFunction71():\n    try:\n        undefined_global\n    except Exception:\n        try:\n            try:\n                raise\n            finally:\n                undefined_global\n        except Exception:\n            pass\n\n\ndef simpleFunction72():\n    try:\n        for _i in range(10):\n            try:\n                undefined_global\n            finally:\n                break\n    except Exception:\n        pass\n\n\ndef simpleFunction73():\n    for _i in range(10):\n        try:\n            undefined_global\n        finally:\n            return 7\n\n\ndef simpleFunction74():\n    import os  # @Reimport\n\n    return os\n\n\ndef simpleFunction75():\n    def raising_gen():\n        try:\n            raise TypeError\n        except TypeError:\n            yield\n\n    g = raising_gen()\n    next(g)\n\n    try:\n        g.throw(RuntimeError())\n    except RuntimeError:\n        pass\n\n\ndef simpleFunction76():\n    class MyException(Exception):\n        def __init__(self, obj):\n            self.obj = obj\n\n    class MyObj:\n        pass\n\n    def inner_raising_func():\n        raise MyException(MyObj())\n\n    try:\n        inner_raising_func()\n    except MyException:\n        try:\n            try:\n                raise\n            finally:\n                raise\n        except MyException:\n            pass\n\n\nclass weirdstr(str):\n    def __getitem__(self, index):\n        return weirdstr(str.__getitem__(self, index))\n\n\ndef simpleFunction77():\n    return filter(lambda x: x >= \"33\", weirdstr(\"1234\"))\n\n\ndef simpleFunction78():\n    a = \"x = 2\"\n    exec(a)\n\n\ndef simpleFunction79():\n    \"some doc\"\n\n    simpleFunction79.__doc__ = simpleFunction79.__doc__.replace(\"doc\", \"dok\")\n    simpleFunction79.__doc__ += \" and more\" + simpleFunction79.__name__\n\n\ndef simpleFunction80():\n    \"some doc\"\n\n    del simpleFunction80.__doc__\n\n\ndef simpleFunction81():\n    def f():\n        yield 1\n        j\n\n    j = 1\n    x = list(f())\n\n\ndef simpleFunction82():\n    def f():\n        yield 1\n        j\n\n    j = 1\n    x = f.__doc__\n\n\ndef simpleFunction83():\n    x = list(range(7))\n    x[2] = 5\n\n    j = 3\n    x += [h * 2 for h in range(j)]\n\n\ndef simpleFunction84():\n    x = tuple(range(7))\n\n    j = 3\n    x += tuple([h * 2 for h in range(j)])\n\n\ndef simpleFunction85():\n    x = list(range(7))\n    x[2] = 3\n    x *= 2\n\n\ndef simpleFunction86():\n    x = \"something\"\n    x += \"\"\n\n\ndef simpleFunction87():\n    x = 7\n    x += 2000\n\n\nclass C:\n    def f(self):\n        pass\n\n    def __iadd__(self, other):\n        return self\n\n    def method_function(*args, **kwargs):\n        # Make sure to mutate the list argument value\n        if \"x\" in kwargs:\n            x = kwargs[\"x\"]\n\n            if type(x) is list:\n                x.append(1)\n\n        for x in args:\n            if type(x) is list:\n                x.append(1)\n\n        return args, kwargs\n\n    exec(\n        \"\"\"\ndef method_uncompiled_function(*args, **kwargs):\n    # Make sure to mutate the list argument value\n    if \"x\" in kwargs:\n        x = kwargs[\"x\"]\n\n        if type(x) is list:\n            x.append(1)\n\n    for x in args:\n        if type(x) is list:\n            x.append(1)\n\n\n    return args, kwargs\n\"\"\"\n    )\n\n    def method_function_with_defaults(self, a, b, c, d=1, e=2, f=3):\n        return True\n\n\ndef simpleFunction88():\n    x = C()\n    x += C()\n\n\ndef simpleFunction89():\n    x = [1, 2]\n    x += [3, 4]\n\n\ndef anyArgs(*args, **kw):\n    return kw.keys(), kw.values()\n\n\ndef simpleFunction90():\n    some_tuple = (simpleFunction89, simpleFunction89, simpleFunction89)\n\n    anyArgs(*some_tuple)\n\n\ndef simpleFunction91():\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(**some_dict)\n\n\ndef simpleFunction92():\n    some_tuple = (simpleFunction89,)\n\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(*some_tuple, **some_dict)\n\n\ndef simpleFunction93():\n    some_tuple = (simpleFunction89,)\n\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(some_tuple, *some_tuple, **some_dict)\n\n\ndef simpleFunction94():\n    some_tuple = (simpleFunction89,)\n\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(*some_tuple, b=some_dict, **some_dict)\n\n\ndef simpleFunction95():\n    some_tuple = (simpleFunction89,)\n\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(some_tuple, *some_tuple, b=some_dict, **some_dict)\n\n\ndef simpleFunction96():\n    some_tuple = (simpleFunction89,)\n\n    anyArgs(some_tuple, *some_tuple)\n\n\n# Complex call with dictionary and key arguments only.\ndef simpleFunction97():\n    some_dict = {\"a\": simpleFunction90, \"d\": simpleFunction91}\n\n    anyArgs(b=some_dict, c=1, **some_dict)\n\n\ndef simpleFunction98():\n    some_tuple = (simpleFunction89,)\n\n    anyArgs(*some_tuple, b=some_tuple)\n\n\ndef simpleFunction99():\n    some_dict = {\"a\": simpleFunction90}\n\n    anyArgs(some_dict, **some_dict)\n\n\ndef simpleFunction100():\n    def h(f):\n        def g():\n            return f\n\n        return g\n\n    def f():\n        pass\n\n    h(f)\n\n\ndef simpleFunction101():\n    def orMaking(a, b):\n        x = \"axa\"\n        x += a or b\n\n    orMaking(\"x\", \"\")\n\n\n####################################\n\n\nclass SomeClassWithAttributeAccess(object):\n    READING = 1\n\n    def use(self):\n        return self.READING\n\n\ndef simpleFunction102():\n    SomeClassWithAttributeAccess().use()\n    SomeClassWithAttributeAccess().use()\n\n\n####################################\n\n\ndef getInt():\n    return 3\n\n\ndef simpleFunction103():\n    try:\n        raise getInt()\n    except TypeError:\n        pass\n\n\n####################################\n\n\nclass ClassWithGeneratorMethod:\n    def generator_method(self):\n        yield self\n\n\ndef simpleFunction104():\n    return list(ClassWithGeneratorMethod().generator_method())\n\n\ndef simpleFunction105():\n    \"\"\"Delete a started generator, not properly closing it before releasing.\"\"\"\n\n    def generator():\n        yield 1\n        yield 2\n\n    g = generator()\n    next(g)\n\n    del g\n\n\ndef simpleFunction106():\n    # Call a PyCFunction with a single argument.\n    return sys.getsizeof(type)\n\n\ndef simpleFunction107():\n    # Call a PyCFunction with a single argument.\n    return sum(i for i in range(x))\n\n\ndef simpleFunction108():\n    # Call a PyCFunction with a single argument.\n    return sum((i for i in range(x)), 17)\n\n\ndef simpleFunction109():\n    # Call a PyCFunction that looks like a method call.\n    sys.exc_info()\n\n\ndef simpleFunction110():\n    def my_open(*args, **kwargs):\n        return (args, kwargs)\n\n    orig_open = __builtins__.open\n    __builtins__.open = my_open\n\n    open(\"me\", buffering=True)\n    __builtins__.open = orig_open\n\n\n####################################\n\nu = \"__name__\"\n\n\ndef simpleFunction111():\n    return getattr(simpleFunction111, u)\n\n\n####################################\n\n\ndef simpleFunction112():\n    TESTFN = \"tmp.txt\"\n    import codecs\n\n    try:\n        with open(TESTFN, \"wb\") as out_file:\n            out_file.write(b\"\\xa1\")\n        f = codecs.open(TESTFN, encoding=\"cp949\")\n        f.read(2)\n    except UnicodeDecodeError:\n        pass\n    finally:\n        try:\n            f.close()\n        except Exception:\n            pass\n        try:\n            os.unlink(TESTFN)\n        except Exception:\n            pass\n\n\n####################################\n\n\ndef simpleFunction113():\n    class A(object):\n        pass\n\n    a = A()\n    a.a = a\n\n    return a\n\n\nl = []\n\n\ndef simpleFunction114():\n    global l\n    l += [\"something\"]\n\n    # Erase it to avoid reference change.\n    del l[:]\n\n\ni = 2**16 + 1\n\n\ndef simpleFunction115():\n    global i\n    i += 1\n\n\nt = tuple(range(259))\n\n\ndef simpleFunction116():\n    global t\n    t += (2, 3)\n\n    t = tuple(range(259))\n\n\ndef simpleFunction117():\n    # Operation tuple+object, error case.\n    try:\n        return tuple(t) + i\n    except TypeError:\n        pass\n\n\ndef simpleFunction118():\n    # Operation tuple+object, error case.\n    try:\n        return i + tuple(t)\n    except TypeError:\n        pass\n\n\nt2 = tuple(range(9))\n\n\ndef simpleFunction119():\n    # Operation tuple+object no error case.\n    return tuple(t) + t2\n\n\ndef simpleFunction120():\n    # Operation object+tuple no error case.\n    return t2 + tuple(t)\n\n\ndef simpleFunction121():\n    # Operation tuple+tuple\n    return tuple(t2) + tuple(t)\n\n\ndef simpleFunction122():\n    # Operation list+object, error case.\n    try:\n        return list(t) + i\n    except TypeError:\n        pass\n\n\ndef simpleFunction123():\n    # Operation list+object, error case.\n    try:\n        return i + list(t)\n    except TypeError:\n        pass\n\n\nl2 = list(range(9))\n\n\ndef simpleFunction124():\n    # Operation list+object no error case.\n    return list(t) + l2\n\n\ndef simpleFunction125():\n    # Operation object+list no error case.\n    return l2 + list(t)\n\n\ndef simpleFunction126():\n    # Operation tuple+tuple\n    return list(l2) + list(t)\n\n\nclass TupleWithSlots(tuple):\n    def __add__(self, other):\n        return 42\n\n    def __radd__(self, other):\n        return 42\n\n\ndef simpleFunction127():\n    # Operation tuple+object with add slot.\n    return tuple(t) + TupleWithSlots()\n\n\ndef simpleFunction128():\n    # Operation object+tuple with add slot.\n    return TupleWithSlots() + tuple(t)\n\n\nclass ListWithSlots(list):\n    def __add__(self, other):\n        return 42\n\n    def __radd__(self, other):\n        return 42\n\n\ndef simpleFunction129():\n    # Operation list+object with add slot.\n    return list(t) + ListWithSlots()\n\n\ndef simpleFunction130():\n    # Operation list+object with add slot.\n    return ListWithSlots() + list(t)\n\n\ndef simpleFunction131():\n    try:\n        C().f.__reduce__()\n    except Exception as e:\n        assert sys.version_info < (3, 4)\n\n\ndef simpleFunction132():\n    C().f.__reduce_ex__(5)\n\n\nx = 5\n\n\ndef local_function(*args, **kwargs):\n    # Make sure to mutate the list argument value\n    if \"x\" in kwargs:\n        x = kwargs[\"x\"]\n\n        if type(x) is list:\n            x.append(1)\n\n    for x in args:\n        if type(x) is list:\n            x.append(1)\n\n    return args, kwargs\n\n\nexec(\n    \"\"\"\ndef local_uncompiled_function(*args, **kwargs):\n    # Make sure to mutate the list argument value\n    if \"x\" in kwargs:\n        x = kwargs[\"x\"]\n\n        if type(x) is list:\n            x.append(1)\n\n    for x in args:\n        if type(x) is list:\n            x.append(1)\n\n\n    return args, kwargs\n\"\"\"\n)\n\n\ndef simpleFunction133():\n    local_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n    local_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    local_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    local_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=[])\n    local_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    local_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    local_function(1, 2, 3, 4, 5, 6, 7, [], 9, 10, 11, x=[])\n    local_function(x=1)\n    local_function(x=x)\n    local_function(x=[])\n\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=[])\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    local_uncompiled_function(1, 2, 3, 4, 5, 6, 7, [], 9, 10, 11, x=[])\n    local_uncompiled_function(x=1)\n    local_uncompiled_function(x=x)\n    local_uncompiled_function(x=[])\n\n    c = C()\n    C().method_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    C.method_function(c, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    C().method_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    C().method_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=[1])\n    C.method_function(c, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    C().method_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    C.method_function(c, 1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    C().method_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    C.method_function(c, 1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    C().method_function(1, 2, 3, 4, 5, 6, 7, [1], 9, 10, 11, x=[1])\n    C.method_function(c, 1, 2, 3, 4, 5, 6, 7, [1], 9, 10, 11, x=[1])\n    C().method_function(x=1)\n    C().method_function(x=x)\n    C().method_function(x=[1])\n\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    C.method_uncompiled_function(c, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=1)\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=[1])\n    C.method_uncompiled_function(c, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, x=x)\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    C.method_uncompiled_function(c, 1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=1)\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    C.method_uncompiled_function(c, 1, 2, 3, 4, 5, 6, 7, x, 9, 10, 11, x=x)\n    C().method_uncompiled_function(1, 2, 3, 4, 5, 6, 7, [1], 9, 10, 11, x=[1])\n    C.method_uncompiled_function(c, 1, 2, 3, 4, 5, 6, 7, [1], 9, 10, 11, x=[1])\n    C().method_uncompiled_function(x=1)\n    C().method_uncompiled_function(x=x)\n    C().method_uncompiled_function(x=[1])\n\n    C().method_function_with_defaults(1, 2, 3, d=1)\n    C().method_function_with_defaults(1, x, 3, d=x)\n    C().method_function_with_defaults(1, x, 3, d=[1])\n\n\ndef copy_func(func):\n    try:\n        return func.clone()\n    except AttributeError:\n        import types\n\n        return types.FunctionType(\n            func.__code__,\n            func.__globals__,\n            name=func.__name__,\n            argdefs=func.__defaults__,\n            closure=func.__closure__,\n        )\n        # g.__kwdefaults__ = f.__kwdefaults__\n\n\ndef simpleFunction134():\n    z = x\n\n    def to_copy(a=3):\n        \"some docstring\"\n        return 7 * a * z\n\n    return copy_func(to_copy)\n\n\n# TODO: This memory leaks closure cells and needs a fix\ndef nosimpleFunction135():\n    def someGenWithClosureGiven():\n        if x:\n            return\n\n        value_given = []\n\n        def localFuncUsingClosureValue():\n            return value_given\n\n        yield localFuncUsingClosureValue\n\n    return list(someGenWithClosureGiven())\n\n\n####################################\n\n# These need stderr to be wrapped.\ntests_stderr = (63,)\n\n# Disabled tests\ntests_skipped = {}\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests for Python2 specific features.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\"\"\"\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import executeReferenceChecked\n\nx = 17\n\n\n# Python2.7 or higher syntax things are here.\ndef simpleFunction1():\n    return {i: x for i in range(x)}\n\n\ndef simpleFunction2():\n    try:\n        return {y: i for i in range(x)}\n    except NameError:\n        pass\n\n\ndef simpleFunction3():\n    return {i for i in range(x)}\n\n\ndef simpleFunction4():\n    try:\n        return {y for i in range(x)}\n    except NameError:\n        pass\n\n\n# These need stderr to be wrapped.\ntests_stderr = ()\n\n# Disabled tests\ntests_skipped = {}\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest33.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests for features of Python3.3 or higher.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\nThese are Python3 specific constructs, that will give a SyntaxError or\nnot be relevant on Python2.\n\"\"\"\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport types\n\nfrom nuitka.tools.testing.Common import (\n    executeReferenceChecked,\n    someGenerator,\n    someGeneratorRaising,\n)\n\n\ndef simpleFunction1():\n    def abc(*, _exc=IOError):\n        pass\n\n    for _ in range(100):\n        abc()\n\n\ndef simpleFunction2():\n    def abc(*, exc=IOError):\n        raise ValueError from None\n\n    try:\n        abc()\n    except (ValueError, TypeError):\n        pass\n\n\ndef simpleFunction3():\n    try:\n\n        class ClassA(Exception):\n            pass\n\n        class ClassB(Exception):\n            pass\n\n        try:\n            raise ClassA(\"foo\")\n        except ClassA as e1:\n            raise ClassB(str(e1)) from e1\n    except Exception:  # different to Nuitka, pylint: disable=broad-except\n        pass\n\n\ndef simpleFunction4():\n    a = 1\n\n    def nonlocal_writer():\n        nonlocal a\n\n        for a in range(10):  # false alarm, pylint: disable=unused-variable\n            pass\n\n    nonlocal_writer()\n\n    assert a == 9, a\n\n\ndef simpleFunction5():\n    x = 2\n\n    def local_func(_a: int, _b: x * x):\n        pass\n\n    local_func(x, x)\n\n\ndef simpleFunction6():\n    # Make sure exception state is cleaned up as soon as the except\n    # block is left.\n\n    class MyException(Exception):\n        def __init__(self, obj):\n            # This is on purpose not called, pylint: disable=super-init-not-called\n            self.obj = obj\n\n    class MyObj:\n        pass\n\n    def inner_raising_func():\n        local_ref = obj\n        raise MyException(obj)\n\n    # \"except\" block raising another exception\n    obj = MyObj()\n\n    try:\n        try:\n            inner_raising_func()\n        except:\n            raise KeyError\n    except KeyError as e:  # on purpose, pylint: disable=unused-variable\n        pass\n\n\nrange_low = 0\nrange_high = 256\nrange_step = 13\n\n\ndef simpleFunction7():\n    # Make sure xranges work nicely\n    return range(range_low, range_high, range_step)\n\n\ndef simpleFunction8():\n    # Make sure xranges work nicely\n    return range(range_low, range_high)\n\n\ndef simpleFunction9():\n    # Make sure xranges work nicely\n    return range(range_high)\n\n\ndef simpleFunction10():\n    def f(_x: int) -> int:\n        pass\n\n    return f\n\n\ndef simpleFunction11():\n    try:\n        raise ImportError(path=\"lala\", name=\"lele\")\n    except ImportError as e:\n        assert e.name == \"lele\"\n        assert e.path == \"lala\"\n\n\ndef simpleFunction12():\n    def g():\n        for a in range(20):\n            yield a\n\n    def h():\n        yield 4\n        yield 5\n        yield 6\n\n    def f():\n        yield from g()\n        yield from h()\n\n    _x = list(f())\n\n\ndef simpleFunction13():\n    def g():\n        for a in range(20):\n            yield a\n\n    def h():\n        yield 4\n        yield 5\n        yield 6\n\n        raise TypeError\n\n    def f():\n        yield from g()\n        yield from h()\n\n    try:\n        _x = list(f())\n    except TypeError:\n        pass\n\n\n# Broken iterator class.\nclass Broken:\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        return 1\n\n    def __getattr__(self, attr):\n        1 / 0  # pylint: disable=pointless-statement\n\n\ndef simpleFunction14():\n    def g():\n        yield from Broken()\n\n    try:\n        gi = g()\n        next(gi)\n    except Exception:  # pylint: disable=broad-except\n        pass\n\n\ndef simpleFunction15():\n    def g():\n        yield from Broken()\n\n    try:\n        gi = g()\n        next(gi)\n        gi.throw(AttributeError)\n    except Exception:  # pylint: disable=broad-except\n        pass\n\n\ndef simpleFunction16():\n    def g():\n        yield from (2, 3)\n\n    return list(g())\n\n\ndef simpleFunction17():\n    def g():\n        yield from (2, 3)\n\n        return 9\n\n    return list(g())\n\n\ndef simpleFunction18():\n    def g():\n        yield from (2, 3)\n\n        return 9, 8\n\n    return list(g())\n\n\ndef simpleFunction19():\n    def g():\n        x = someGenerator()\n        assert type(x) is types.GeneratorType\n\n        yield from x\n\n    gen = g()\n    next(gen)\n\n    try:\n        gen.throw(ValueError)\n    except ValueError:\n        pass\n\n\ndef simpleFunction20():\n    def g():\n        x = someGeneratorRaising()\n        assert type(x) is types.GeneratorType\n\n        yield from x\n\n    gen = g()\n    next(gen)\n\n    try:\n        next(gen)\n    except TypeError:\n        pass\n\n\nclass ClassIteratorBrokenClose:\n    def __init__(self):\n        self.my_iter = iter(range(2))\n\n    def __iter__(self):\n        return self\n\n    def next(self):\n        return next(self.my_iter)\n\n    def close(self):\n        raise TypeError(3)\n\n    __next__ = next\n\n\ndef simpleFunction21():\n    def g():\n        x = ClassIteratorBrokenClose()\n\n        yield from x\n\n    gen = g()\n    next(gen)\n\n    try:\n        gen.throw(GeneratorExit)\n    except TypeError:\n        pass\n\n\nclass ClassIteratorBrokenThrow:\n    def __init__(self):\n        self.my_iter = iter(range(2))\n\n    def __iter__(self):\n        return self\n\n    def next(self):\n        return next(self.my_iter)\n\n    def throw(self, *args):\n        raise TypeError(3)\n\n    __next__ = next\n\n\ndef simpleFunction22():\n    def g():\n        x = ClassIteratorBrokenThrow()\n\n        yield from x\n\n    gen = g()\n    next(gen)\n\n    try:\n        gen.throw(ValueError)\n    except GeneratorExit:\n        pass\n    except TypeError:\n        pass\n\n\nclass ClassIteratorRejectingThrow:\n    def __init__(self):\n        self.my_iter = iter(range(2))\n\n    def __iter__(self):\n        return self\n\n    def next(self):\n        return next(self.my_iter)\n\n    def throw(self, *args):\n        # This should not be subject normalize exceptions.\n        assert len(args) == 1, args\n\n    __next__ = next\n\n\n# Lets have an exception that must not be instantiated.\nclass MyError(Exception):\n    def __init__(self):\n        # pylint: disable=super-init-not-called\n        assert False\n\n\ndef simpleFunction23():\n    def g():\n        x = ClassIteratorRejectingThrow()\n\n        yield from x\n\n    gen = g()\n    next(gen)\n\n    gen.throw(MyError)\n\n\noho = 1\n\n\ndef simpleFunction24():\n    def someGenerator():\n        yield from oho\n\n    try:\n        list(someGenerator())\n    except TypeError:\n        pass\n\n\n# These need stderr to be wrapped.\ntests_stderr = (14, 15)\n\n# Disabled tests\ntests_skipped = {}\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest35.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests for features of Python3.5 or higher.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\nThese are Python3.5 specific constructs, that will give a SyntaxError or\nnot be relevant on older versions.\n\"\"\"\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\n# Tests do all bad things:\n# pylint: disable=not-an-iterable\n\nimport asyncio\nimport types\n\nfrom nuitka.PythonVersions import python_version\nfrom nuitka.tools.testing.Common import executeReferenceChecked, run_async\n\n# Tests do bad stuff, pylint: disable=redefined-outer-name\n\n\ndef raisy():\n    raise TypeError\n\n\ndef simpleFunction1():\n    async def someCoroutine():\n        return\n\n    run_async(someCoroutine())\n\n\n####################################\n\n\ndef simpleFunction2():\n    async def someCoroutine():\n        return 7\n\n    run_async(someCoroutine())\n\n\n####################################\n\n\nclass AsyncIteratorWrapper:\n    def __init__(self, obj):\n        self._it = iter(obj)\n\n    def __aiter__(self):\n        return self\n\n    async def __anext__(self):\n        try:\n            value = next(self._it)\n        except StopIteration:\n            raise StopAsyncIteration\n        return value\n\n\ndef simpleFunction3():\n    async def f():\n        result = []\n\n        # Python 3.5 before 3.5.2 won't allow this.\n        try:\n            async for letter in AsyncIteratorWrapper(\"abcdefg\"):\n                result.append(letter)\n        except TypeError:\n            assert sys.version_info < (3, 5, 2)\n\n        return result\n\n    run_async(f())\n\n\n####################################\n\n\ndef simpleFunction4():\n    async def someCoroutine():\n        raise StopIteration\n\n    try:\n        run_async(someCoroutine())\n    except RuntimeError:\n        pass\n\n\n####################################\n\n\nclass ClassWithAsyncMethod:\n    async def async_method(self):\n        return self\n\n\ndef simpleFunction5():\n    run_async(ClassWithAsyncMethod().async_method())\n\n\n####################################\n\n\nclass BadAsyncIter:\n    def __init__(self):\n        self.weight = 1\n\n    async def __aiter__(self):\n        return self\n\n    def __anext__(self):\n        return ()\n\n\ndef simpleFunction7():\n    async def someCoroutine():\n        async for _i in BadAsyncIter():\n            print(\"never going to happen\")\n\n    try:\n        run_async(someCoroutine())\n    except TypeError:\n        pass\n\n\ndef simpleFunction8():\n    async def someCoroutine():\n        return (\"some\", \"thing\")\n\n    @types.coroutine\n    def someDecoratorCoroutine():\n        yield from someCoroutine()\n\n    run_async(someDecoratorCoroutine())\n\n\ndef simpleFunction9():\n    a = {\"a\": 1, \"b\": 2}\n    b = {\"c\": 3, **a}\n\n    return b\n\n\nasync def rmtree(path):\n    return await asyncio.get_event_loop().run_in_executor(None, sync_rmtree, path)\n\n\ndef sync_rmtree(path):\n    raise FileNotFoundError\n\n\nasync def execute():\n    try:\n        await rmtree(\"/tmp/test1234.txt\")\n    except FileNotFoundError:\n        pass\n\n    return 10**10\n\n\nasync def run():\n    await execute()\n\n\ndef simpleFunction10():\n    asyncio.get_event_loop().run_until_complete(run())\n\n\ndef simpleFunction11():\n    async def someCoroutine():\n        return 10\n\n    coro = someCoroutine()\n\n    def someGenerator():\n        yield from coro\n\n    try:\n        list(someGenerator())\n    except TypeError:\n        pass\n\n    coro.close()\n\n\ndef simpleFunction12():\n    def func(x):\n        x = [5, *x, 8]\n\n        return x\n\n    func([2, 3, 4])\n\n\n# These need stderr to be wrapped.\ntests_stderr = ()\n\n# Disabled tests\ntests_skipped = {}\n\nif python_version < 0x380:\n    tests_skipped[10] = \"Incompatible refcount bugs of asyncio with python prior 3.8\"\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest36.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests for Python3.6 or higher.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\nThese are Python3.6 specific constructs, that will give a SyntaxError or\nnot be relevant on older versions.\n\"\"\"\n\nimport os\nimport sys\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport asyncio\nimport types\n\nfrom nuitka.tools.testing.Common import (\n    async_iterate,\n    executeReferenceChecked,\n    run_async,\n)\n\n\nclass AwaitException(Exception):\n    pass\n\n\ndef run_until_complete(coro):\n    exc = False\n    while True:\n        try:\n            if exc:\n                exc = False\n                fut = coro.throw(AwaitException)\n            else:\n                fut = coro.send(None)\n        except StopIteration as ex:\n            return ex.args[0] if ex.args else None\n\n        if fut == (\"throw\",):\n            exc = True\n\n\ndef simpleFunction1():\n    async def gen1():\n        try:\n            yield\n        except:  # pylint: disable=bare-except\n            pass\n\n    async def run():\n        g = gen1()\n        await g.asend(None)\n        await g.asend(2772)\n\n    try:\n        run_async(run())\n    except StopAsyncIteration:\n        pass\n\n\ndef simpleFunction2():\n    async def async_gen():\n        try:\n            yield 1\n            yield 1.1\n            1 / 0  # pylint: disable=pointless-statement\n        finally:\n            yield 2\n            yield 3\n\n        yield 100\n\n    async_iterate(async_gen())\n\n\n@types.coroutine\ndef awaitable(*, throw=False):\n    if throw:\n        yield (\"throw\",)\n    else:\n        yield (\"result\",)\n\n\nasync def gen2():\n    await awaitable()\n    a = yield 123\n    assert a is None\n    await awaitable()\n    yield 456\n    await awaitable()\n    yield 789\n\n\ndef simpleFunction3():\n    def to_list(gen):\n        async def iterate():\n            res = []\n            async for i in gen:\n                res.append(i)\n            return res\n\n        return run_until_complete(iterate())\n\n    async def run2():\n        return to_list(gen2())\n\n    run_async(run2())\n\n\ndef simpleFunction4():\n    g = gen2()\n    ai = g.__aiter__()\n    an = ai.__anext__()\n    an.__next__()\n\n    try:\n        ai.__anext__().__next__()\n    except StopIteration as _ex:\n        pass\n    except RuntimeError:\n        # Python 3.8 doesn't like this anymore\n        assert sys.version_info >= (3, 8)\n\n    try:\n        ai.__anext__().__next__()\n    except RuntimeError:\n        # Python 3.8 doesn't like this anymore\n        assert sys.version_info >= (3, 8)\n\n\ndef simpleFunction5():\n    t = 2\n\n    class C:  # pylint: disable=invalid-name\n        exec(\"u=2\")  # pylint: disable=exec-used\n        x: int = 2\n        y: float = 2.0\n\n        z = x + y + t * u  # pylint: disable=undefined-variable\n\n        rawdata = b\"The quick brown fox jumps over the lazy dog.\\r\\n\"\n        # Be slow so we don't depend on other modules\n        rawdata += bytes(range(256))\n\n    return C()\n\n\nasync def funcTrace1():\n    return [await awaitable() for _i in range(50)]\n\n\ndef simpleFunction6():\n    run_async(funcTrace1())\n\n\nasync def funcTrace2():\n    result = []\n\n    for _i in range(50):\n        value = await awaitable()\n        result.append(value)\n\n    return result\n\n\ndef simpleFunction7():\n    run_async(funcTrace2())\n\n\n# This refleaks big time, but the construct is rare enough to not bother\n# as this proves hard to find.\ndef disabled_simpleFunction8():\n    loop = asyncio.new_event_loop()\n    asyncio.set_event_loop(None)\n\n    async def waiter(timeout):\n        await asyncio.sleep(timeout)\n        yield 1\n\n    async def wait():\n        async for _ in waiter(1):\n            pass\n\n    t1 = loop.create_task(wait())\n    t2 = loop.create_task(wait())\n\n    loop.run_until_complete(asyncio.sleep(0.01))\n\n    t1.cancel()\n    t2.cancel()\n\n    try:\n        loop.run_until_complete(t1)\n    except asyncio.CancelledError:\n        pass\n    try:\n        loop.run_until_complete(t2)\n    except asyncio.CancelledError:\n        pass\n\n    loop.run_until_complete(loop.shutdown_asyncgens())\n\n    loop.close()\n\n\n# These need stderr to be wrapped.\ntests_stderr = ()\n\n# Disabled tests\ntests_skipped = {}\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ReferencingTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Reference counting tests.\n\nThese contain functions that do specific things, where we have a suspect\nthat references may be lost or corrupted. Executing them repeatedly and\nchecking the reference count is how they are used.\n\nThese are for Python2 only constructs, which will give SyntaxError on\nother versions.\n\"\"\"\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import executeReferenceChecked\n\nx = 17\n\n\n# Python2 only syntax things are here.\ndef simpleFunction1():\n    try:\n        raise TypeError, (3, x, x, x)\n    except TypeError:\n        pass\n\n\ndef simpleFunction2():\n    try:\n        raise ValueError(1, 2, 3), ValueError(1, 2, 3)\n    except Exception:\n        pass\n\n\ndef simpleFunction3():\n    try:\n        raise ValueError, 2, None\n    except Exception:\n        pass\n\n\ndef simpleFunction4():\n    try:\n        raise ValueError, 2, 3\n    except Exception:\n        pass\n\n\ndef simpleFunction5():\n    def nested_args_function((a, b), c):\n        return a, b, c\n\n    nested_args_function((1, 2), 3)\n\n\ndef simpleFunction6():\n    def nested_args_function((a, b), c):\n        return a, b, c\n\n    try:\n        nested_args_function((1,), 3)\n    except ValueError:\n        pass\n\n\ndef simpleFunction7():\n    def nested_args_function((a, b), c):\n        return a, b, c\n\n    try:\n        nested_args_function((1, 2, 3), 3)\n    except ValueError:\n        pass\n\n\ndef simpleFunction8():\n    from decimal import *\n\n    d1 = Decimal(\"5\")\n    d2 = Decimal(\"2\")\n\n    (p, q) = divmod(d1, d2)\n    (p, q) = divmod(d1, 4)\n    (p, q) = divmod(7, d1)\n\n    return q, p\n\n\n# These need stderr to be wrapped.\ntests_stderr = ()\n\n# Disabled tests\ntests_skipped = {}\n\nresult = executeReferenceChecked(\n    prefix=\"simpleFunction\",\n    names=globals(),\n    tests_skipped=tests_skipped,\n    tests_stderr=tests_stderr,\n)\n\nsys.exit(0 if result else 1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/SlotsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nclass W1(object):\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass W2(object):\n    __slots__ = [\"__hidden\"]\n\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass _W1(object):\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass _W2(object):\n    __slots__ = [\"__hidden\"]\n\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass a_W1(object):\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass a_W2(object):\n    __slots__ = [\"__hidden\"]\n\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass W1_(object):\n    def __init__(self):\n        self.__hidden = 5\n\n\nclass W2_(object):\n    __slots__ = [\"__hidden\"]\n\n    def __init__(self):\n        self.__hidden = 5\n\n\nfor w in (W1, W2, _W1, _W2, a_W1, a_W2, W1_, W2_):\n    try:\n        print(w)\n        print(dir(w))\n        a = w()\n    except AttributeError:\n        print(\"bug in %s\" % w)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/ThreadedGeneratorsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# From Issue#146, this has crashed in the past.\n\nimport threading\n\n\ndef some_generator():\n    yield 1\n\n\ndef run():\n    for i in range(10000):\n        for j in some_generator():\n            pass\n\n\ndef main():\n    workers = [threading.Thread(target=run) for i in range(5)]\n    for t in workers:\n        t.start()\n    for t in workers:\n        t.join()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TrickAssignmentsTest32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef someFunctionThatReturnsDeletedValueViaAttributeLookup():\n    class C:\n        def __getattr__(self, attr_name):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c.something\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaAttributeLookup()\nexcept UnboundLocalError:\n    print(\"OK, object attribute look-up correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaAttributeSetting():\n    class C:\n        def __setattr__(self, attr_name, value):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c.something = 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaAttributeSetting()\nexcept UnboundLocalError:\n    print(\"OK, object attribute setting correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaAttributeDel():\n    class C:\n        def __delattr__(self, attr_name):\n            nonlocal a\n            del a\n\n            return True\n\n    c = C()\n\n    a = 1\n    del c.something\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaAttributeDel()\nexcept UnboundLocalError:\n    print(\"OK, object attribute del correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaItemLookup():\n    class C:\n        def __getitem__(self, attr_name):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c[2]\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaItemLookup()\nexcept UnboundLocalError:\n    print(\"OK, object subscript look-up correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaItemSetting():\n    class C:\n        def __setitem__(self, attr_name, value):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c[2] = 3\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaItemSetting()\nexcept UnboundLocalError:\n    print(\"OK, object subscript setting correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaItemDel():\n    class C:\n        def __delitem__(self, attr_name):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    del c[2]\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaItemDel()\nexcept UnboundLocalError:\n    print(\"OK, object subscript del correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaCall():\n    class C:\n        def __call__(self):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c()\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaCall()\nexcept UnboundLocalError:\n    print(\"OK, object call correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaAdd():\n    class C:\n        def __add__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c + 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaAdd()\nexcept UnboundLocalError:\n    print(\"OK, object add correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaSub():\n    class C:\n        def __sub__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c - 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaSub()\nexcept UnboundLocalError:\n    print(\"OK, object sub correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaMul():\n    class C:\n        def __mul__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c * 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaMul()\nexcept UnboundLocalError:\n    print(\"OK, object mul correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaRemainder():\n    class C:\n        def __mod__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c % 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaRemainder()\nexcept UnboundLocalError:\n    print(\"OK, object remainder correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaDivmod():\n    class C:\n        def __divmod__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    divmod(c, 1)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaDivmod()\nexcept UnboundLocalError:\n    print(\"OK, object divmod correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaPower():\n    class C:\n        def __pow__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c**1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaPower()\nexcept UnboundLocalError:\n    print(\"OK, object power correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaUnaryMinus():\n    class C:\n        def __neg__(self):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    -c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaUnaryMinus()\nexcept UnboundLocalError:\n    print(\"OK, object unary minus correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaUnaryPlus():\n    class C:\n        def __pos__(self):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    +c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaUnaryPlus()\nexcept UnboundLocalError:\n    print(\"OK, object unary plus correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaNot():\n    class C:\n        def __bool__(self):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    not c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaNot()\nexcept UnboundLocalError:\n    print(\"OK, object bool correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInvert():\n    class C:\n        def __invert__(self):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    ~c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInvert()\nexcept UnboundLocalError:\n    print(\"OK, object invert correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaLshift():\n    class C:\n        def __lshift__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c << 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaLshift()\nexcept UnboundLocalError:\n    print(\"OK, object lshift correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaRshift():\n    class C:\n        def __rshift__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c >> 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaRshift()\nexcept UnboundLocalError:\n    print(\"OK, object rshift correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaBitwiseAnd():\n    class C:\n        def __and__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c & 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaBitwiseAnd()\nexcept UnboundLocalError:\n    print(\"OK, object bitwise and correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaBitwiseOr():\n    class C:\n        def __or__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c | 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaBitwiseOr()\nexcept UnboundLocalError:\n    print(\"OK, object bitwise or correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaBitwiseXor():\n    class C:\n        def __xor__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c ^ 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaBitwiseXor()\nexcept UnboundLocalError:\n    print(\"OK, object bitwise xor correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInt():\n    class C:\n        def __int__(self):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    int(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInt()\nexcept UnboundLocalError:\n    print(\"OK, object int correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaFloat():\n    class C:\n        def __float__(self):\n            nonlocal a\n            del a\n\n            return 0.0\n\n    c = C()\n\n    a = 1\n    float(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaFloat()\nexcept UnboundLocalError:\n    print(\"OK, object float correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaComplex():\n    class C:\n        def __complex__(self):\n            nonlocal a\n            del a\n\n            return 0j\n\n    c = C()\n\n    a = 1\n    complex(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaComplex()\nexcept UnboundLocalError:\n    print(\"OK, object complex correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceAdd():\n    class C:\n        def __iadd__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c += 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceAdd()\nexcept UnboundLocalError:\n    print(\"OK, object inplace add correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceSub():\n    class C:\n        def __isub__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c -= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceSub()\nexcept UnboundLocalError:\n    print(\"OK, object inplace sub correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceMul():\n    class C:\n        def __imul__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c *= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceMul()\nexcept UnboundLocalError:\n    print(\"OK, object inplace mul correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceRemainder():\n    class C:\n        def __imod__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c %= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceRemainder()\nexcept UnboundLocalError:\n    print(\"OK, object inplace remainder correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplacePower():\n    class C:\n        def __ipow__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c **= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplacePower()\nexcept UnboundLocalError:\n    print(\"OK, object inplace power correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceAnd():\n    class C:\n        def __iand__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c &= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceAnd()\nexcept UnboundLocalError:\n    print(\"OK, object inplace and correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceFloordiv():\n    class C:\n        def __ifloordiv__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c //= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceFloordiv()\nexcept UnboundLocalError:\n    print(\"OK, object inplace floordiv correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceLshift():\n    class C:\n        def __ilshift__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c <<= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceLshift()\nexcept UnboundLocalError:\n    print(\"OK, object inplace lshift correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceRshift():\n    class C:\n        def __irshift__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c >>= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceRshift()\nexcept UnboundLocalError:\n    print(\"OK, object inplace rshift correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceOr():\n    class C:\n        def __ior__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c |= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceOr()\nexcept UnboundLocalError:\n    print(\"OK, object inplace or correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceTrueDiv():\n    class C:\n        def __itruediv__(self, other):\n            nonlocal a\n            del a\n\n            return 7\n\n    c = C()\n\n    a = 1\n    c /= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceTrueDiv()\nexcept UnboundLocalError:\n    print(\"OK, object inplace truediv correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceXor():\n    class C:\n        def __ixor__(self, other):\n            nonlocal a\n            del a\n\n            return False\n\n    c = C()\n\n    a = 1\n    c ^= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceXor()\nexcept UnboundLocalError:\n    print(\"OK, object inplace xor correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaIndex():\n    class C:\n        def __index__(self):\n            nonlocal a\n            del a\n\n            return 0\n\n    c = C()\n\n    a = 1\n    [1][c]\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaIndex()\nexcept UnboundLocalError:\n    print(\"OK, object index correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaLen():\n    class C:\n        def __len__(self):\n            nonlocal a\n            del a\n\n            return 0\n\n    c = C()\n\n    a = 1\n    len(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaLen()\nexcept UnboundLocalError:\n    print(\"OK, object len correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaRepr():\n    class C:\n        def __repr__(self):\n            nonlocal a\n            del a\n\n            return \"<some_repr>\"\n\n    c = C()\n\n    a = 1\n    repr(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaRepr()\nexcept UnboundLocalError:\n    print(\"OK, object repr correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaStr():\n    class C:\n        def __str__(self):\n            nonlocal a\n            del a\n\n            return \"<some_repr>\"\n\n    c = C()\n\n    a = 1\n    str(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaStr()\nexcept UnboundLocalError:\n    print(\"OK, object str correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaCompare():\n    class C:\n        def __lt__(self, other):\n            nonlocal a\n            del a\n\n            return \"<some_repr>\"\n\n    c = C()\n\n    a = 1\n    c < None\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaCompare()\nexcept UnboundLocalError:\n    print(\"OK, object compare correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaDel():\n    class C:\n        def __del__(self):\n            nonlocal a\n            del a\n\n            return \"<some_repr>\"\n\n    c = C()\n\n    a = 1\n    del c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaDel()\nexcept UnboundLocalError:\n    print(\"OK, object del correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaHash():\n    class C:\n        def __hash__(self):\n            nonlocal a\n            del a\n\n            return 42\n\n    c = C()\n\n    a = 1\n    {}[c] = 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaHash()\nexcept UnboundLocalError:\n    print(\"OK, object hash correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaIter():\n    class C:\n        def __iter__(self):\n            nonlocal a\n            del a\n\n            return iter(range(2))\n\n    c = C()\n\n    a = 1\n    x, y = c\n    return a, x, y\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaIter()\nexcept UnboundLocalError:\n    print(\"OK, object iter correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaBytes():\n    class C:\n        def __bytes__(self):\n            nonlocal a\n            del a\n\n            return bytes(range(2))\n\n    c = C()\n\n    a = 1\n    bytes(c)\n    return a, x, y\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaBytes()\nexcept UnboundLocalError:\n    print(\"OK, object bytes correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaEq():\n    class C:\n        def __eq__(self, other):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    c == 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaEq()\nexcept UnboundLocalError:\n    print(\"OK, object eq correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaLe():\n    class C:\n        def __le__(self, other):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    c <= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaEq()\nexcept UnboundLocalError:\n    print(\"OK, object le correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaGt():\n    class C:\n        def __gt__(self, other):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    c > 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaEq()\nexcept UnboundLocalError:\n    print(\"OK, object gt correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaGe():\n    class C:\n        def __ge__(self, other):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    c >= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaEq()\nexcept UnboundLocalError:\n    print(\"OK, object ge correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaNe():\n    class C:\n        def __ne__(self, other):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    c != 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaEq()\nexcept UnboundLocalError:\n    print(\"OK, object ne correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaContains():\n    class C:\n        def __contains__(self, item):\n            nonlocal a\n            del a\n            return False\n\n    c = C()\n\n    a = 1\n    1 in c\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaContains()\nexcept UnboundLocalError:\n    print(\"OK, object contains correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInit():\n    class C:\n        def __init__(self):\n            nonlocal a\n            del a\n\n    a = 1\n    c = C()\n\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInit()\nexcept UnboundLocalError:\n    print(\"OK, object init correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaNew():\n    class C:\n        def __new__(self):\n            nonlocal a\n            del a\n\n    a = 1\n    c = C()\n\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaNew()\nexcept UnboundLocalError:\n    print(\"OK, object new correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaDir():\n    class C:\n        def __dir__(self):\n            nonlocal a\n            del a\n            return []\n\n    c = C()\n\n    a = 1\n    dir(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaDir()\nexcept UnboundLocalError:\n    print(\"OK, object dir correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaReversed():\n    class C:\n        def __reversed__(self):\n            nonlocal a\n            del a\n            return None\n\n    a = 1\n    c = C()\n\n    reversed(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaReversed()\nexcept UnboundLocalError:\n    print(\"OK, object reversed correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaFormat():\n    class C:\n        def __format__(self, string):\n            nonlocal a\n            del a\n            return \"formatted string\"\n\n    c = C()\n\n    a = 1\n    format(c, \"some string\")\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaFormat()\nexcept UnboundLocalError:\n    print(\"OK, object format correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaAbs():\n    class C:\n        def __abs__(self):\n            nonlocal a\n            del a\n            return abs(10)\n\n    a = 1\n    c = C()\n\n    abs(c)\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaAbs()\nexcept UnboundLocalError:\n    print(\"OK, object abs correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n# TODO: There must be way more than these.\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TrickAssignmentsTest35.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef someFunctionThatReturnsDeletedValueViaMaxtrixMult():\n    class C:\n        def __matmul__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c @ 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaMaxtrixMult()\nexcept UnboundLocalError:\n    print(\"OK, object matrix mult correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaInplaceMaxtrixMult():\n    class C:\n        def __imatmul__(self, other):\n            nonlocal a\n            del a\n\n    c = C()\n\n    a = 1\n    c @= 1\n    return a\n\n\ntry:\n    someFunctionThatReturnsDeletedValueViaInplaceMaxtrixMult()\nexcept UnboundLocalError:\n    print(\"OK, object inplace matrix mult correctly deleted an item.\")\nelse:\n    print(\"Ouch.!\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TrickAssignmentsTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef someFunctionThatReturnsDeletedValueViaLong():\n    class C:\n        def __int__(self):\n            a.append(2)\n\n            return False\n\n    c = C()\n\n    a = [1]\n    long(c)\n    return a\n\n\nif someFunctionThatReturnsDeletedValueViaLong()[-1] == 2:\n    print(\"OK, object long correctly modified an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaNot():\n    class C:\n        def __nonzero__(self):\n            a.append(2)\n\n            return False\n\n    c = C()\n\n    a = [1]\n    not c\n    return a\n\n\nif someFunctionThatReturnsDeletedValueViaNot()[-1] == 2:\n    print(\"OK, object bool correctly modified an item.\")\nelse:\n    print(\"Ouch.!\")\n\n\ndef someFunctionThatReturnsDeletedValueViaCompare():\n    class C:\n        def __cmp__(self, other):\n            a.append(2)\n\n            return 0\n\n    c = C()\n\n    a = [1]\n    c < None\n    return a\n\n\nif someFunctionThatReturnsDeletedValueViaCompare()[-1] == 2:\n    print(\"OK, object compare correctly modified an item.\")\nelse:\n    print(\"Ouch.!\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryContinueFinallyTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef tryWhileContinueFinallyTest():\n    print(\"Check if finally is executed in a continue using for loop:\")\n\n    x = 0\n\n    while x < 10:\n        x += 1\n\n        try:\n            if x % 2 == 1:\n                continue\n        finally:\n            print(x, end=\" \")\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryForContinueFinallyTest():\n    print(\"Check if finally is executed in a continue using for loop:\")\n\n    for x in range(10):\n        try:\n            if x % 2 == 1:\n                continue\n        finally:\n            print(x, end=\" \")\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryWhileBreakFinallyTest():\n    print(\"Check if finally is executed in a break using while loop:\")\n\n    x = 0\n\n    while x < 10:\n        x += 1\n\n        try:\n            if x == 5:\n                break\n        finally:\n            print(x, end=\" \")\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryForBreakFinallyTest():\n    print(\"Check if finally is executed in a break using for loop:\")\n\n    for x in range(10):\n        try:\n            if x == 5:\n                break\n        finally:\n            print(x, end=\" \")\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ntryWhileContinueFinallyTest()\ntryWhileBreakFinallyTest()\n\ntryForContinueFinallyTest()\ntryForBreakFinallyTest()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryExceptContinueTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef tryWhileExceptContinueTest():\n    print(\"Check if continue is executed in a except handler using for loop:\")\n\n    global undefined\n\n    x = 0\n\n    while x < 10:\n        x += 1\n\n        try:\n            if x % 2 == 1:\n                undefined\n        except:\n            print(x, end=\" \")\n            continue\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryForExceptContinueTest():\n    print(\"Check if continue is executed in a except handler using for loop:\")\n\n    for x in range(10):\n        try:\n            if x % 2 == 1:\n                undefined\n        except:\n            print(x, end=\" \")\n            continue\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryWhileExceptBreakTest():\n    print(\"Check if break is executed in a except handler using while loop:\")\n\n    x = 0\n\n    while x < 10:\n        x += 1\n\n        try:\n            if x == 5:\n                undefined\n        except:\n            print(x, end=\" \")\n            break\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ndef tryForExceptBreakTest():\n    print(\"Check if break is executed in a except handler using for loop:\")\n\n    for x in range(10):\n        try:\n            if x == 5:\n                undefined\n        except:\n            print(x, end=\" \")\n            break\n\n        print(\"-\", end=\" \")\n\n    print()\n\n\ntryWhileExceptContinueTest()\ntryWhileExceptBreakTest()\n\ntryForExceptContinueTest()\ntryForExceptBreakTest()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryExceptFinallyTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\"Some doc\"\n\n\ndef one():\n    return 1\n\n\ndef tryScope1(x):\n    try:\n        try:\n            x += one()\n        finally:\n            print(\"Finally is executed\")\n\n            try:\n                _z = one()\n            finally:\n                print(\"Deep Nested finally is executed\")\n    except:\n        print(\"Exception occurred\")\n    else:\n        print(\"No exception occurred\")\n\n\ntryScope1(1)\nprint(\"*\" * 20)\ntryScope1([1])\n\n\ndef tryScope2(x, someExceptionClass):\n    try:\n        x += 1\n    except someExceptionClass as e:\n        print(\"Exception class from argument occurred:\", someExceptionClass, repr(e))\n    else:\n        print(\"No exception occurred\")\n\n\ndef tryScope3(x):\n    if x:\n        try:\n            x += 1\n        except TypeError:\n            print(\"TypeError occurred\")\n    else:\n        print(\"Not taken\")\n\n\nprint(\"*\" * 20)\n\ntryScope2(1, TypeError)\ntryScope2([1], TypeError)\n\nprint(\"*\" * 20)\n\ntryScope3(1)\ntryScope3([1])\ntryScope3([])\n\nprint(\"*\" * 20)\n\n\ndef tryScope4(x):\n    try:\n        x += 1\n    except:\n        print(\"exception occurred\")\n    else:\n        print(\"no exception occurred\")\n    finally:\n        print(\"finally obeyed\")\n\n\ntryScope4(1)\ntryScope4([1])\n\n\ndef tryScope5():\n    import sys\n\n    print(\"Exception info is initially\", sys.exc_info())\n    try:\n        try:\n            undefined_global += 1\n        finally:\n            print(\"Exception info in 'finally' clause is\", sys.exc_info())\n    except:\n        pass\n\n\ntryScope5()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryExceptFramesTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\n\ndef displayDict(d):\n    if \"__loader__\" in d:\n        d = dict(d)\n        d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d = dict(d)\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\ncounter = 1\n\n\nclass X:\n    def __init__(self):\n        global counter\n        self.counter = counter\n        counter += 1\n\n    def __del__(self):\n        print(\"X.__del__ occurred\", self.counter)\n\n\ndef raising(doit):\n    _x = X()\n\n    def nested():\n        if doit:\n            1 / 0\n\n    try:\n        return nested()\n    except ZeroDivisionError:\n        print(\"Changing closure variable value.\")\n        # This is just to prove that closure variables get updates in frame\n        # locals.\n        doit = 5\n        raise\n\n\n# Call it without an exception\nraising(False)\n\n\ndef catcher():\n    try:\n        raising(True)\n    except ZeroDivisionError:\n        print(\"Caught.\")\n\n        print(\"Top traceback code is '%s'.\" % sys.exc_info()[2].tb_frame.f_code.co_name)\n        print(\n            \"Second traceback code is '%s'.\"\n            % sys.exc_info()[2].tb_next.tb_frame.f_code.co_name\n        )\n        print(\n            \"Third traceback code is '%s'.\"\n            % sys.exc_info()[2].tb_next.tb_next.tb_frame.f_code.co_name\n        )\n        print(\n            \"Third traceback locals (function) are\",\n            displayDict(sys.exc_info()[2].tb_next.tb_next.tb_frame.f_locals),\n        )\n\n\ncatcher()\n\nprint(\"Good bye.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryReturnFinallyTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# In this test we show that return in try/finally executes the finally part\n# just fine.\n\nfrom __future__ import print_function\n\nimport sys\n\n\ndef eight():\n    return 8\n\n\ndef nine():\n    return 9\n\n\ndef raisy1():\n    return 1 / 0\n\n\ndef raisy2():\n    return 1()\n\n\ndef raisy3(arg):\n    raise TypeError(arg)\n\n\ndef returnInTried(for_call):\n    try:\n        print(\"returnInTried with exception info in tried block:\", sys.exc_info())\n\n        return for_call()\n    finally:\n        print(\"returnInTried with exception info in final block:\", sys.exc_info())\n\n\ndef returnInFinally(for_call):\n    try:\n        print(\"returnInFinally with exception info in tried block:\", sys.exc_info())\n    finally:\n        print(\"returnInFinally with exception info in final block:\", sys.exc_info())\n\n        return for_call()\n\n\nprint(\"Standard try finally with return in tried block:\")\nprint(\"result\", returnInTried(eight))\n\nprint(\"*\" * 80)\n\nprint(\"Standard try finally with return in final block:\")\nprint(\"result\", returnInFinally(nine))\n\nprint(\"*\" * 80)\n\nprint(\"Exception raising try finally with return in tried block:\")\ntry:\n    print(\"result\", returnInTried(raisy1))\nexcept Exception as e:\n    print(\"Gave exception\", repr(e))\n\nprint(\"*\" * 80)\n\nprint(\"Exception raising try finally with return in final block:\")\ntry:\n    print(\"result\", returnInFinally(raisy2))\nexcept Exception as e:\n    print(\"Gave exception\", repr(e))\n\nprint(\"*\" * 80)\n\ntry:\n    raisy3(\"unreal 1\")\nexcept Exception as outer_e:\n    print(\"Exception raising try finally with return in tried block:\")\n    try:\n        print(\"result\", returnInTried(raisy1))\n    except Exception as e:\n        print(\"Gave exception\", repr(e))\n\n    print(\"Handler exception remains:\", repr(outer_e))\n\nprint(\"*\" * 80)\n\ntry:\n    raisy3(\"unreal 2\")\nexcept Exception as outer_e:\n    print(\"Exception raising try finally with return in final block:\")\n    try:\n        print(\"result\", returnInFinally(raisy2))\n    except Exception as e:\n        print(\"Gave exception\", repr(e))\n\n    print(\"Handler exception remains:\", repr(outer_e))\n\nprint(\"*\" * 80)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/TryYieldFinallyTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef tryContinueFinallyTest():\n    for x in range(10):\n        try:\n            if x % 2 == 1:\n                continue\n        finally:\n            yield x\n\n        yield \"-\"\n\n\ndef tryBreakFinallyTest():\n    for x in range(10):\n        try:\n            if x == 5:\n                break\n        finally:\n            yield x\n\n        yield \"-\"\n\n\ndef tryFinallyAfterYield():\n    try:\n        yield 3\n    finally:\n        print(\"Executing finally\")\n\n\ndef tryReturnFinallyYield():\n    try:\n        return\n    finally:\n        yield 1\n\n\ndef tryReturnExceptYield():\n    try:\n        return\n    except StopIteration:\n        print(\"Caught StopIteration\")\n        yield 2\n    except:\n        yield 1\n    else:\n        print(\"No exception\")\n\n\ndef tryStopIterationExceptYield():\n    try:\n        raise StopIteration\n    except StopIteration:\n        print(\"Caught StopIteration\")\n        yield 2\n    except:\n        yield 1\n    else:\n        print(\"No exception\")\n\n\nprint(\"Check if finally is executed in a continue using for loop:\")\nprint(tuple(tryContinueFinallyTest()))\n\nprint(\"Check if finally is executed in a break using for loop:\")\nprint(tuple(tryBreakFinallyTest()))\n\nprint(\"Check what try yield finally something does:\")\nprint(tuple(tryFinallyAfterYield()))\n\nprint(\"Check if yield is executed in finally after return:\")\nprint(tuple(tryReturnFinallyYield()))\n\nprint(\"Check if yield is executed in except after return:\")\nprint(tuple(tryReturnExceptYield()))\n\nprint(\"Check if yield is executed in except after StopIteration:\")\nprint(tuple(tryReturnExceptYield()))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/UnicodeTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"gfcrk\")\nprint(repr(\"g\\xfcrk\"))\n\nprint(r\"\"\"\\x00\"\"\")\n\nprint(\"\\ttest\\n\")\n\nprint(\n    \"\"\"\nsomething\nwith\nnew\nlines\"\"\"\n)\n\nprint(\"favicon.ico (32\\xd732)\")\n\n# TODO: Python3 has a problem here, hard to find, disabled for now.\nif False:\n    encoding = \"utf-16-be\"\n    print(\"[\\uDC80]\".encode(encoding))\n    print(\"[\\\\udc80]\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/UnpackingTest35.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef tupleUnpacking():\n    return (*a, b, *c)\n\n\ndef listUnpacking():\n    return [*a, b, *c]\n\n\ndef setUnpacking():\n    return {*a, b, *c}\n\n\ndef dictUnpacking():\n    return {\"a\": 1, **d}\n\n\na = range(3)\nb = 5\nc = range(8, 10)\nd = {\"a\": 2}\n\nprint(\"Tuple unpacked\", tupleUnpacking())\nprint(\"List unpacked\", listUnpacking())\nprint(\"Set unpacked\", setUnpacking())\nprint(\"Dict unpacked\", dictUnpacking())\n\n\nnon_iterable = 2.0\n\n\ndef tupleUnpackingError():\n    try:\n        return (*a, *non_iterable, *c)\n    except Exception as e:\n        return e\n\n\ndef listUnpackingError():\n    try:\n        return [*a, *non_iterable, *c]\n    except Exception as e:\n        return e\n\n\ndef setUnpackingError():\n    try:\n        return {*a, *non_iterable, *c}\n    except Exception as e:\n        return e\n\n\ndef dictUnpackingError():\n    try:\n        return {\"a\": 1, **non_iterable}\n    except Exception as e:\n        return e\n\n\nprint(\"Tuple unpacked error:\", tupleUnpackingError())\nprint(\"List unpacked error:\", listUnpackingError())\nprint(\"Set unpacked error:\", setUnpackingError())\nprint(\"Dict unpacked error:\", dictUnpackingError())\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/VarargsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"Test functions with variable args\"\"\"\n\n\ndef plain_list_dict_args_function(plain, *arg_list, **arg_dict):\n    print(\"plain\", plain, \"arg_list\", arg_list, \"arg_dict\", arg_dict)\n\n\ndef plain_list_args_function(plain, *arg_list):\n    print(plain, arg_list)\n\n\ndef plain_dict_args_function(plain, **arg_dict):\n    print(plain, arg_dict)\n\n\nprint(\"Function with plain arg and varargs dict:\")\nplain_dict_args_function(1, a=2, b=3, c=4)\nplain_dict_args_function(1)\n\nprint(\"Function with plain arg and varargs list:\")\nplain_list_args_function(1, 2, 3, 4)\nplain_list_args_function(1)\n\nprint(\"Function with plain arg, varargs list and varargs dict:\")\nplain_list_dict_args_function(1, 2, z=3)\nplain_list_dict_args_function(1, 2, 3)\nplain_list_dict_args_function(1, a=2, b=3, c=4)\n\n\ndef list_dict_args_function(*arg_list, **arg_dict):\n    print(arg_list, arg_dict)\n\n\ndef list_args_function(*arg_list):\n    print(arg_list)\n\n\ndef dict_args_function(**arg_dict):\n    print(arg_dict)\n\n\nprint(\"Function with plain arg and varargs dict:\")\ndict_args_function(a=2, b=3, c=4)\ndict_args_function()\n\nprint(\"Function with plain arg and varargs list:\")\nlist_args_function(2, 3, 4)\nlist_args_function()\n\nprint(\"Function with plain arg, varargs list and varargs dict:\")\nlist_dict_args_function(2, z=3)\nlist_dict_args_function(2, 3)\nlist_dict_args_function(a=2, b=3, c=4)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/WithStatementsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nx = 0\n\n\n# This is used to trace the exact interaction with the context manager to\n# uncover and decide ordering and correctness of calls.\nclass MyContextManager(object):\n    def __getattribute__(self, attribute_name):\n        print(\"Asking context manager attribute\", attribute_name)\n        return object.__getattribute__(self, attribute_name)\n\n    def __enter__(self):\n        global x\n        x += 1\n\n        print(\"Entered context manager with counter value\", x)\n\n        return x\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        print(\"Context manager exit sees\", exc_type, exc_value, traceback)\n        print(\"Published to context manager exit is\", sys.exc_info())\n\n        return False\n\n\nprint(\"Use context manager and raise no exception in the body:\")\nwith MyContextManager() as x:\n    print(\"x has become\", x)\n\nprint(\"Use context manager and raise an exception in the body:\")\ntry:\n    with MyContextManager() as x:\n        print(\"x has become\", x)\n\n        raise Exception(\"Lalala\")\n        print(x)\nexcept Exception as e:\n    print(\"Caught raised exception\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\n# Python3 ranges are not lists\nl = list(range(3))\n\nprint(\"Use context manager and assign to subscription target:\")\nwith MyContextManager() as l[0]:\n    print(\"Complex assignment target works\", l[0])\n\ntry:\n    with MyContextManager():\n        sys.exit(9)\nexcept BaseException as e:\n    print(\"Caught base exception\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\nprint(\"Use context manager and fail to assign to attribute:\")\ntry:\n    with MyContextManager() as l.wontwork:\n        sys.exit(9)\nexcept BaseException as e:\n    print(\"Caught base exception\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\nprint(\"Use context manager to do nothing inside:\")\nwith MyContextManager() as x:\n    pass\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\n\n# Use context manager and fail to assign.\ndef returnFromContextBlock():\n    # Use context manager to do nothing.\n    with MyContextManager() as x:\n        return 7\n\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\nprint(\"Use context manager to return value:\")\nr = returnFromContextBlock()\nprint(\"Return value\", r)\n\n\nclass NonContextManager1:\n    def __enter__(self):\n        return self\n\n\nclass NonContextManager2:\n    def __exit__(self):\n        return self\n\n\nprint(\"Use incomplete context managers:\")\ntry:\n    with NonContextManager1() as x:\n        print(x)\nexcept Exception as e:\n    print(\"Caught for context manager without __exit__\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\ntry:\n    with NonContextManager2() as x:\n        print(x)\nexcept Exception as e:\n    print(\"Caught for context manager without __enter__\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\n\nclass NotAtAllContextManager:\n    pass\n\n\ntry:\n    with NotAtAllContextManager() as x:\n        print(x)\nexcept Exception as e:\n    print(\"Caught for context manager without any special methods\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\n\nclass MeanContextManager:\n    def __enter__(self):\n        raise ValueError(\"Nah, I won't play\")\n\n    def __exit__(self):\n        print(\"Called exit, yes\")\n\n\nprint(\"Use mean context manager:\")\n\ntry:\n    with MeanContextManager() as x:\n        print(x)\nexcept Exception as e:\n    print(\"Caught from mean manager\", repr(e))\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\n\n\nclass CatchingContextManager(object):\n    def __enter__(self):\n        pass\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        return True\n\n\nprint(\"Suppressing exception from context manager body:\")\nwith CatchingContextManager():\n    raise ZeroDivisionError\n\nif sys.version_info >= (3,):\n    assert sys.exc_info() == (None, None, None)\nprint(\"OK\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/YieldFromTest33.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef g():\n    for a in range(3):\n        yield a\n\n    return 7\n\n\ndef h():\n    yield 4\n    yield 5\n\n\ndef f():\n    print(\"Yielded from returner\", (yield g()))\n    print(\"Yielded from non-return value\", (yield h()))\n\n\nprint(\"Result\", list(f()))\n\nprint(\"Yielder with return value\", list(g()))\n\n\n# This will raise when looking up any attribute.\nclass Broken:\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        return 1\n\n    def __getattr__(self, attr):\n        1 / 0\n\n\ndef test_broken_getattr_handling():\n    def g():\n        yield from Broken()\n\n    print(\"Next with send: \", end=\"\")\n    try:\n        gi = g()\n        next(gi)\n        gi.send(1)\n    except Exception as e:\n        print(\"Caught\", repr(e))\n\n    print(\"Next with throw: \", end=\"\")\n    try:\n        gi = g()\n        next(gi)\n        gi.throw(AttributeError)\n    except Exception as e:\n        print(\"Caught\", repr(e))\n\n    print(\"Next with close: \", end=\"\")\n    try:\n        gi = g()\n        next(gi)\n        gi.close()\n\n        print(\"All good\")\n    except Exception as e:\n        print(\"Caught\", repr(e))\n\n\ntest_broken_getattr_handling()\n\n\ndef test_throw_caught_subgenerator_handling():\n    def g1():\n        try:\n            print(\"Starting g1\")\n            yield \"g1 ham\"\n            yield from g2()\n            yield \"g1 eggs\"\n        finally:\n            print(\"Finishing g1\")\n\n    def g2():\n        try:\n            print(\"Starting g2\")\n            yield \"g2 spam\"\n            yield \"g2 more spam\"\n        except LunchError:\n            print(\"Caught LunchError in g2\")\n            yield \"g2 lunch saved\"\n            yield \"g2 yet more spam\"\n\n    class LunchError(Exception):\n        pass\n\n    g = g1()\n    for i in range(2):\n        x = next(g)\n        print(\"Yielded %s\" % (x,))\n    e = LunchError(\"tomato ejected\")\n    print(\"Throw returned\", g.throw(e))\n    print(\"Sub thrown\")\n\n    for x in g:\n        print(\"Yielded %s\" % (x,))\n\n\ntest_throw_caught_subgenerator_handling()\n\n\ndef give_cpython_generator():\n    # TODO: This relies on eval not being inlined, which will become untrue.\n    return eval(\"(x for x in range(3))\")\n\n\ndef gen_compiled():\n    yield from give_cpython_generator()\n    yield ...\n    yield from range(7)\n\n\nprint(\"Mixing uncompiled and compiled yield from:\")\nprint(list(gen_compiled()))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for basic tests of Nuitka.\n\nBasic tests are those that cover our back quickly, but need not necessarily,\nbe complete.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    decideNeeds2to3,\n    getDebugPython,\n    scanDirectoryForTestCases,\n    setup,\n)\n\n\ndef main():\n    setup(suite=\"basics\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    # Now run all the tests in this directory.\n    for filename in scanDirectoryForTestCases(\".\"):\n        extra_flags = [\n            # No error exits normally, unless we break tests, and that we would\n            # like to know.\n            \"expect_success\",\n            # Keep no temporary files.\n            \"remove_output\",\n            # Do not follow imports.\n            \"--nofollow-imports\",\n            # Use the original __file__ value, at least one case warns about things\n            # with filename included.\n            \"--file-reference-choice=original\",\n            # Cache the CPython results for reuse, they will normally not change.\n            \"cpython_cache\",\n            # To understand what is slow.\n            \"timing\",\n            # We annotate some tests, use that to lower warnings.\n            \"plugin_enable:pylint-warnings\",\n        ]\n\n        # This test should be run with the debug Python, and makes outputs to\n        # standard error that might be ignored.\n        if filename.startswith(\"Referencing\") and getDebugPython() is not None:\n            extra_flags.append(\"--python-debug\")\n\n        # This tests warns about __import__() used.\n        if filename == \"OrderChecksTest.py\":\n            extra_flags.append(\"ignore_warnings\")\n\n        # This tests warns about an package relative import despite\n        # being in no package.\n        if filename == \"ImportingTest.py\":\n            extra_flags.append(\"ignore_warnings\")\n\n        # TODO: Nuitka does not give output for ignored exception in dtor, this is\n        # not fully compatible and potentially an error.\n        if filename == \"YieldFromTest33.py\":\n            extra_flags.append(\"ignore_stderr\")\n\n        # For Python2 there is a \"builtins\" package that gives warnings. TODO: We\n        # ought to NOT import that package and detect statically that __builtins__\n        # import won't raise ImportError.\n        if filename == \"BuiltinOverloadTest.py\":\n            extra_flags.append(\"ignore_warnings\")\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            compareWithCPython(\n                dirname=None,\n                filename=filename,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=decideNeeds2to3(filename),\n            )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/basics/run_xml.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport shutil\nimport subprocess\n\nfrom nuitka.tools.testing.Common import check_output\n\n# Go its own directory, to have it easy with path knowledge.\nnuitka1 = sys.argv[1]\nnuitka2 = sys.argv[2]\n\nsearch_mode = len(sys.argv) > 3 and sys.argv[3] == \"search\"\nstart_at = sys.argv[4] if len(sys.argv) > 4 else None\n\nif start_at:\n    active = False\nelse:\n    active = True\n\nmy_dir = os.path.dirname(os.path.abspath(__file__))\n\nfor filename in sorted(os.listdir(my_dir)):\n    if not filename.endswith(\".py\") or filename.startswith(\"run_\"):\n        continue\n\n    path = os.path.relpath(os.path.join(my_dir, filename))\n\n    if not active and start_at in (filename, path):\n        active = True\n\n    if active:\n        command = \"%s %s '%s' '%s' %s\" % (\n            sys.executable,\n            os.path.join(my_dir, \"..\", \"..\", \"bin\", \"compare_with_xml\"),\n            nuitka1,\n            nuitka2,\n            path,\n        )\n\n        result = subprocess.call(command, shell=True)\n\n        if result == 2:\n            sys.stderr.write(\"Interrupted, with CTRL-C\\n\")\n            sys.exit(2)\n\n        if result != 0 and search_mode:\n            print(\"Error exit!\", result)\n            sys.exit(result)\n    else:\n        print(\"Skipping\", filename)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/binary-trees.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# The Computer Language Shootout Benchmarks\n# http://shootout.alioth.debian.org/\n#\n# contributed by Antoine Pitrou\n# modified by Dominique Wahli\n\n#from sys import argv\n\ndef make_tree(item, depth):\n    if depth > 0:\n        item2 = 2 * item\n        depth -= 1\n        return (item, make_tree(item2 - 1, depth), make_tree(item2, depth))\n    else:\n        return (item, None, None)\n\ndef check_tree(tree):\n    (item, left, right) = tree\n    if left is not None:\n        return item + check_tree(left) - check_tree(right)\n    else:\n        return item\n\ndef main():\n    min_depth = 4\n    max_depth = max(min_depth + 2, 16) #int(argv[1]))\n    stretch_depth = max_depth + 1\n\n    print \"stretch tree of depth %d\\t check: %d\" % (stretch_depth, check_tree(make_tree(0, stretch_depth)))\n\n    long_lived_tree = make_tree(0, max_depth)\n\n    for depth in xrange(min_depth, stretch_depth, 2):\n        iterations = 2**(max_depth - depth + min_depth)\n\n        check = 0\n        for i in xrange(1, iterations + 1):\n            check += check_tree(make_tree(i, depth)) + check_tree(make_tree(-i, depth))\n\n        print \"%d\\t trees of depth %d\\t check: %d\" % (iterations * 2, depth, check)\n\n    print \"long lived tree of depth %d\\t check: %d\" % (max_depth, check_tree(long_lived_tree))\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/comparisons/GeneratorFunctionVsGeneratorExpression.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport time\n\nb = range(10000)\n\ndef getGeneratorFunction():\n   def f():\n      for i in b:\n         yield i\n\n   return f\n\ndef getGeneratorExpression():\n   return ( i for i in b )\n\n\n\nstart = time.time()\n\nf = getGeneratorFunction()\n\nfor x in range(1000):\n   r = list(f())\n\nend = time.time()\n\nfunc_time = end - start\n\nstart = time.time()\n\nfor x in range(1000):\n   r = list(getGeneratorExpression())\n\nend = time.time()\n\ngenexpr_time = end - start\n\nprint \"Generator Function took\", func_time\nprint \"Generator Expression took\", genexpr_time\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/BuiltinSumWithGenerator.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nempty = ()\n\n\ndef calledRepeatedly(iterable, empty):\n    # Force frame\n    itertools\n\n    # We measure making a generator iterator step or not.\n\n    # construct_begin\n    y = sum(iterable)\n    # construct_alternative\n    y = sum(empty)\n    # construct_end\n\n    return y\n\n\nfor x in itertools.repeat(None, 500):\n    calledRepeatedly((x for x in range(1000)), empty)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/BuiltinSumWithList.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nempty = ()\n\nvalue = list(range(10))\n\n\ndef calledRepeatedly(iterable, empty):\n    # Force frame\n    value\n\n    # We measure making a list iterator step or not.\n\n    # construct_begin\n    y = sum(iterable)\n    # construct_alternative\n    y = sum(empty)\n    # construct_end\n\n    return x, y\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(value, empty)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/BuiltinSumWithTuple.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nempty = ()\n\nvalue = tuple(range(10))\n\n\ndef calledRepeatedly(iterable, empty):\n    # Force frame\n    value\n\n    # We measure making a tuple iterator step or not.\n\n    # construct_begin\n    y = sum(iterable)\n    # construct_alternative\n    y = sum(empty)\n    # construct_end\n\n    return x, y\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(value, empty)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledClassCreationPosArgsConstant6.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def __init__(self, a, b, c, d, e, f):\n        self.a = a\n        self.b = b\n        self.c = c\n        self.d = d\n        self.e = e\n        self.f = f\n\n\ndef calledRepeatedly():\n    # force frame\n    C\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    C(\"some\", \"random\", \"values\", \"to\", \"check\", \"call\")\n    C(\"some\", \"other\", \"values\", \"to\", \"check\", \"call\")\n    C(\"some\", \"new\", \"values\", \"to\", \"check\", \"call\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionKwArgsConstant.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c):\n    return a, b, c\n\n\ndef calledRepeatedly():\n    compiled_f = compiled_func\n\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(a=\"some\", b=\"random\", c=\"values\")\n    compiled_f(a=\"some\", b=\"other\", c=\"values\")\n    compiled_f(a=\"some\", b=\"new\", c=\"value set\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionKwArgsVariable.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c):\n    return a, b, c\n\n\ndef getUnknownValue():\n    return 8\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n\n    compiled_f = compiled_func\n\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(a=a, b=b, c=c)\n    compiled_f(a=a, b=b, c=c)\n    compiled_f(a=a, b=b, c=c)\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionKwArgsVariableStarDict.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c, d, e, f):\n    return a, b, c, d, e, f\n\n\ndef getUnknownValue():\n    return 8\n\n\narg_dict = {\n    \"d\": 9,\n    \"e\": 9,\n    \"f\": 9,\n}\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n\n    compiled_f = compiled_func\n\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(a=a, b=b, c=c, **arg_dict)\n    compiled_f(a=a, b=b, c=c, **arg_dict)\n    compiled_f(a=a, b=b, c=c, **arg_dict)\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionPosArgsConstant.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c, d, e, f):\n    return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    compiled_f = compiled_func\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(\"some\", \"random\", \"values\", \"to\", \"check\", \"call\")\n    compiled_f(\"some\", \"other\", \"values\", \"to\", \"check\", \"call\")\n    compiled_f(\"some\", \"new\", \"values\", \"to\", \"check\", \"call\")\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionPosArgsDefaults.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a=1, b=2, c=3, d=4, e=5, f=6):\n    return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    compiled_f = compiled_func\n\n    # construct_begin\n    compiled_f()\n    compiled_f()\n    compiled_f()\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionPosArgsMutable.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(some_list):\n    return some_list\n\n\ndef calledRepeatedly():\n    compiled_f = compiled_func\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f([\"some\", \"random\", \"values\", \"to\", \"check\", \"call\"])\n    compiled_f([[\"some\", \"other\", \"values\"], [\"to\", \"check\", \"call\"]])\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionPosArgsVariable.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c, d, e, f):\n    return a, b, c, d, e, f\n\n\ndef getUnknownValue():\n    return 8\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n    d = getUnknownValue()\n    e = getUnknownValue()\n    f = getUnknownValue()\n\n    compiled_f = compiled_func\n\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(a, b, c, d, e, f)\n    compiled_f(a, c, b, d, e, f)\n    compiled_f(a, b, c, d, f, e)\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledFunctionPosKwArgsVariable.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef compiled_func(a, b, c, d, e, f):\n    return a, b, c, d, e, f\n\n\ndef getUnknownValue():\n    return 8\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n    d = getUnknownValue()\n    e = getUnknownValue()\n    f = getUnknownValue()\n\n    compiled_f = compiled_func\n\n    # This is supposed to make a call to a compiled function, which is\n    # being optimized separately.\n    # construct_begin\n    compiled_f(a, b, c, d=d, e=e, f=f)\n    compiled_f(a, c, b, d=d, e=e, f=f)\n    compiled_f(a, b, c, d=d, e=e, f=f)\n    # construct_alternative\n    pass\n    # construct_end\n\n    return compiled_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledInstanceMethodNoArgs_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C:\n    def compiled_method(self):\n        return self\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method()\n    inst.compiled_method()\n    inst.compiled_method()\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledInstanceMethodPosArgsConstant1_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C:\n    def compiled_method(self, a):\n        return a\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(\"some\")\n    inst.compiled_method(\"some\")\n    inst.compiled_method(\"some\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledInstanceMethodPosArgsConstant6_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C:\n    def compiled_method(self, a, b, c, d, e, f):\n        return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(\"some\", \"random\", \"values\", \"to\", \"check\", \"call\")\n    inst.compiled_method(\"some\", \"other\", \"values\", \"to\", \"check\", \"call\")\n    inst.compiled_method(\"some\", \"new\", \"values\", \"to\", \"check\", \"call\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledInstanceMethodPosArgsDefaults_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C:\n    def compiled_method(self, a=1, b=2, c=3, d=4, e=5, f=6):\n        return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method()\n    inst.compiled_method()\n    inst.compiled_method()\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledInstanceMethodPosArgsVariable_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C:\n    def compiled_method(self, a, b, c, d, e, f):\n        return a, b, c, d, e, f\n\n\ndef getUnknownValue():\n    return 8\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n    d = getUnknownValue()\n    e = getUnknownValue()\n    f = getUnknownValue()\n\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(a, b, c, d, e, f)\n    inst.compiled_method(a, c, b, d, e, f)\n    inst.compiled_method(a, b, c, d, f, e)\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledObjectMethodNoArgs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def compiled_method(self):\n        return self\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method()\n    inst.compiled_method()\n    inst.compiled_method()\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledObjectMethodPosArgsConstant1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def compiled_method(self, a):\n        return a\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(\"some\")\n    inst.compiled_method(\"some\")\n    inst.compiled_method(\"some\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledObjectMethodPosArgsConstant6.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def compiled_method(self, a, b, c, d, e, f):\n        return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(\"some\", \"random\", \"values\", \"to\", \"check\", \"call\")\n    inst.compiled_method(\"some\", \"other\", \"values\", \"to\", \"check\", \"call\")\n    inst.compiled_method(\"some\", \"new\", \"values\", \"to\", \"check\", \"call\")\n\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledObjectMethodPosArgsDefaults.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def compiled_method(self, a=1, b=2, c=3, d=4, e=5, f=6):\n        return a, b, c, d, e, f\n\n\ndef calledRepeatedly():\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method()\n    inst.compiled_method()\n    inst.compiled_method()\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallCompiledObjectMethodPosArgsVariable.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\nclass C(object):\n    def compiled_method(self, a, b, c, d, e, f):\n        return a, b, c, d, e, f\n\n\ndef getUnknownValue():\n    return 8\n\n\ndef calledRepeatedly():\n    a = getUnknownValue()\n    b = getUnknownValue()\n    c = getUnknownValue()\n    d = getUnknownValue()\n    e = getUnknownValue()\n    f = getUnknownValue()\n\n    inst = C()\n\n    # This is supposed to make a call to a compiled method, which is\n    # being optimized separately.\n    # construct_begin\n    inst.compiled_method(a, b, c, d, e, f)\n    inst.compiled_method(a, c, b, d, e, f)\n    inst.compiled_method(a, b, c, d, f, e)\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallLambdaExpressionDirectly.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # construct_begin\n    return (lambda x: x)(7)\n    # construct_alternative\n    return 7\n\n\n# construct_end\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallUncompiledFunctionComplexArgs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\nexec(\n    \"\"\"\ndef python_func(a,b,c,d,e,f):\n    pass\n\"\"\"\n)\n\na = (1, 2, 3, 4, 5)\n\n\ndef calledRepeatedly(python_f):\n    # This is supposed to make a call to a non-compiled function, which is\n    # being optimized separately.\n\n    # Force a frame for now.\n    args = a\n\n    # construct_begin\n    python_f(3, *args)\n    # construct_alternative\n    pass\n    # construct_end\n\n    return python_f, args\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(python_func)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/CallUncompiledFunctionPosArgs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\nexec(\n    \"\"\"\ndef python_func(a,b,c,d,e,f):\n    pass\n\"\"\"\n)\n\n\ndef calledRepeatedly():\n    # This is supposed to make a call to a non-compiled function, which is\n    # being optimized separately.\n    python_f = python_func\n\n    # construct_begin\n    python_f(\"some\", \"random\", \"values\", \"to\", \"check\", \"call\")\n    python_f(\"some\", \"other\", \"values\", \"to\", \"check\", \"call\")\n    python_f(\"some\", \"new\", \"values\", \"to\", \"check\", \"call\")\n    # construct_alternative\n    pass\n    # construct_end\n\n    return python_f\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/ClosureVariableAccess.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\nmodule_value2 = None\nmodule_value3 = None\n\n\ndef calledRepeatedly():\n    closure_value = module_value1\n\n    def f():\n        # Force frame and eliminate forward propagation (currently).\n        module_value1\n\n        # Use writing to global variable as access method.\n        global module_value2, module_value3\n\n        # construct_begin\n        module_value2 = closure_value\n        # construct_end\n\n        module_value3 = closure_value\n\n    f()\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/DictCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = module_value2 = module_value3 = module_value4 = 1000\nmodule_key1 = module_key2 = module_key3 = module_key4 = 1000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently), and use local\n    # variables to avoid impact of global variable access.\n    dict_key1 = module_value1\n    dict_key2 = module_value2\n    dict_key3 = module_value3\n    dict_key4 = module_value4\n\n    dict_val1 = module_value1\n    dict_val2 = module_value2\n    dict_val3 = module_value3\n    dict_val4 = module_value4\n\n    # construct_begin\n    l = {\n        dict_key1: dict_val1,\n        dict_key2: dict_val2,\n        dict_key3: dict_val3,\n        dict_key4: dict_val4,\n    }\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return (\n        l,\n        dict_val1,\n        dict_val2,\n        dict_val3,\n        dict_val4,\n        dict_key1,\n        dict_key2,\n        dict_key3,\n        dict_key4,\n    )\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionCreationClosure.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_var = None\n\n\ndef calledRepeatedly(x):\n    # Force a local frame for now\n    module_var\n\n    # construct_begin\n    def empty():\n        return x\n\n    # construct_alternative\n    def empty():\n        return module_var\n\n    # construct_end\n\n    return empty, x\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(x)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionCreationGeneratorClosure.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_var = None\n\n\ndef calledRepeatedly(x):\n    # Force frame usage for now\n    module_var\n\n    # construct_begin\n    def empty():\n        yield x\n\n    # construct_alternative\n    def empty():\n        yield module_var\n\n    # construct_end\n\n    return empty, x\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(x)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionCreationGeneratorLocal.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_var = None\n\n\ndef calledRepeatedly():\n    # We measure making a local function that will remain unused.\n    # construct_begin\n    def empty():\n        yield 1\n\n    # construct_alternative\n    empty = 1\n    # construct_end\n\n    return empty\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionCreationLocal.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # We measure making a local function that will remain unused.\n    # construct_begin\n    def empty():\n        pass\n\n    # construct_alternative\n    empty = 1\n    # construct_end\n\n    return empty\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionEmpty.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef empty():\n    pass\n\n\nmodule_var = None\n\n\ndef calledRepeatedly(called):\n    # Force a frame for now\n    module_var\n\n    # construct_begin\n    called()\n    # construct_end\n\n    return called\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(empty)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/FunctionRaise.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\nmodule_var = None\n\n\ndef raisy():\n    raise TypeError\n\n\ndef calledRepeatedly(raisy):\n    # Force a frame for now\n    module_var\n\n    # construct_begin\n    try:\n        raisy()\n    except TypeError:\n        pass\n    # construct_alternative\n    pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(raisy)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GeneratorExit.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # We measure making a generator iterator step or not.\n    def generator():\n        yield 1\n        yield 2\n        yield 3\n\n    gen = generator()\n\n    next(gen)\n\n    # Take attribute lookup out of it, and built-in lookup too.\n    throw = gen.throw\n    exc = GeneratorExit\n\n    try:\n        # construct_begin\n        throw(exc)\n        # construct_alternative\n        pass\n        # construct_end\n    except exc:\n        pass\n\n    return throw, exc\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GeneratorExpressionCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # We measure making a generator iterator step or not.\n    # construct_begin\n    gen = (x for x in range(3))\n    # construct_alternative\n    gen = iter((1, 2, 3))\n    # construct_end\n\n    x = next(gen)\n    next(gen)\n\n    return x\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GeneratorExpressionExit.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # We measure making a generator iterator step or not.\n    gen = (x for x in range(3))\n\n    next(gen)\n\n    # Take attribute lookup out of it, and built-in lookup too.\n    throw = gen.throw\n    exc = GeneratorExit\n\n    try:\n        # construct_begin\n        throw(exc)\n        # construct_alternative\n        pass\n        # construct_end\n    except exc:\n        pass\n\n    return throw, exc\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GeneratorExpressionUsage.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nnot_all = [1, 1, 1, 1, 1, 1, 1, 1, 0, 1]\n\n\ndef calledRepeatedly():\n    # We measure making a generator iterator step or not.\n    gen = (x for x in not_all)\n\n    # make sure it is started.\n    x = next(gen)\n\n    # This should abort.\n    # construct_begin\n    all(gen)\n    # construct_end\n\n    # make sure it is still running.\n    y = next(gen)\n\n    return x, y\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GeneratorUsage.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # We measure making a generator iterator step or not.\n    def generator():\n        yield 1\n        yield 2\n        yield 3\n\n    gen = generator()\n\n    x = next(gen)\n    # construct_begin\n    next(gen)\n    # construct_end\n\n    return x\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/GlobalVariableAccess.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\nmodule_value2 = 2000\n\n\ndef calledRepeatedly():\n    module_value1\n    # construct_begin\n    return module_value2\n    # construct_alternative\n    return None\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationFloatAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5.0\nmodule_value2 = 3.0\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable s anyway\n    s = 2.0\n\n    local_value = module_value1\n\n    s += module_value1\n    # construct_begin\n    s += 1000.0\n    s += 1000.0\n    s += 1000.0\n    s += 1000.0\n    s += 1000.0\n    # construct_end\n    s += module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationInstanceStringAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\n\n\nclass C:\n    def __init__(self):\n        self.s = \"2\" * 100000\n\n    def increment(self):\n        additiv = \"*\" * 1000\n\n        # construct_begin\n        self.s += additiv\n        self.s += additiv\n        self.s += additiv\n        self.s += additiv\n        self.s += additiv\n        # construct_end\n\n        return additiv\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = C()\n\n    local_value.increment()\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationIntegerAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\nmodule_value2 = 3\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable x anyway\n    s = 2\n\n    local_value = module_value1\n\n    s += module_value1\n    # construct_begin\n    s += 1000\n    s += 1000\n    s += 1000\n    s += 1000\n    s += 1000\n    # construct_end\n    s += module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationIntegerMul.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\nmodule_value2 = 3\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable x anyway\n    s = 2\n\n    local_value = module_value1\n\n    s *= module_value1\n    # construct_begin\n    s *= 1000\n    s *= 1000\n    s *= 1000\n    s *= 1000\n    s *= 1000\n    # construct_end\n    s *= module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationListAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = [5.0]\nmodule_value2 = [3.0]\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable s anyway\n    s = [2.0]\n\n    local_value = module_value1\n\n    s += module_value1\n    # construct_begin\n    s += [1000.0]\n    s += [1000.0]\n    s += [1000.0]\n    s += [1000.0]\n    s += [1000.0]\n    # construct_end\n    s += module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationLongAdd_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5l\nmodule_value2 = 3l\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable x anyway\n    s = 2l\n\n    local_value = module_value1\n\n    s += module_value1\n    # construct_begin\n    s += 1000l\n    s += 1000l\n    s += 1000l\n    s += 1000l\n    s += 1000l\n    # construct_end\n    s += module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationStringAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\n\nadditiv_global = \"*\" * 1000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable s anyway\n    s = \"2\"\n\n    # Add an unknown, making 's' an unknown.\n    additiv = additiv_global\n    s += additiv\n\n    # construct_begin\n    s += additiv\n    s += additiv\n    s += additiv\n    s += additiv\n    s += additiv\n    # construct_end\n\n    # Prevent optimization into direct return.\n    s += additiv\n\n    return s\n\n\nfor x in itertools.repeat(None, 10000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationTupleAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = (5.0,)\nmodule_value2 = (3.0,)\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable s anyway\n    s = (2.0,)\n\n    local_value = module_value1\n\n    s += module_value1\n    # construct_begin\n    s += (1000.0,)\n    s += (1000.0,)\n    s += (1000.0,)\n    s += (1000.0,)\n    s += (1000.0,)\n    # construct_end\n    s += module_value2\n\n    return s\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/InplaceOperationUnicodeAdd_27.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\n\nadditiv_global = u'*' * 500\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable s anyway\n    s = u'2'\n\n    additiv = additiv_global\n\n    s += additiv\n# construct_begin\n    s += u'lala'\n    s += u'lala'\n    s += u'lala'\n    s += u'lala'\n    s += u'lala'\n# construct_end\n    s += additiv\n\n    return s\n\nfor x in itertools.repeat(None, 5000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/ListContraction.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # construct_begin\n    l = [x for x in range(7)]\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return l, x\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/ListCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\n\n\ndef calledRepeatedly(list_value1):\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # construct_begin\n    l = [list_value1, list_value1, list_value1, list_value1, list_value1]\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return l, list_value1\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(module_value1)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/ListCreationConstant.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\n\ndef calledRepeatedly():\n    # construct_begin\n    l = [50, 51, 52, 53, 54, 55, 56, 57]\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return l\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/LocalVariableAccess.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\nmodule_value2 = None\nmodule_value3 = None\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    # Use writing to global variable as access method.\n    global module_value2, module_value3\n\n    # construct_begin\n    module_value2 = local_value\n    # construct_end\n\n    module_value3 = local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/LocalVariableDeletion.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\nmodule_value2 = None\nmodule_value3 = None\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    # Use writing to global variable as access method.\n    global module_value2, module_value3\n\n    module_value2 = local_value\n\n    if module_value2 is None:\n        # construct_begin\n        del local_value\n        # construct_end\n\n        another_local_value = module_value3\n\n    module_value2 = module_value1\n\n    local_value = module_value3\n    return local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/LoopSmallRange.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\nmodule_value2 = 3\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable x anyway\n    x = 2\n\n    local_value = module_value1\n\n    # construct_begin\n    for x in range(local_value, local_value + 3):\n        pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/LoopSmallXrange.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5\nmodule_value2 = 3\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # Make sure we have a local variable x anyway\n    x = 2\n\n    local_value = module_value1\n\n    # construct_begin\n    for x in xrange(local_value, local_value + 3):\n        pass\n    # construct_end\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/NumpyArrayConstruction.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport itertools\n\n# nuitka-project: --nofollow-import-to=numpy\nimport numpy\n\ng = 6\n\n\ndef calledRepeatedly():\n    # This is supposed to make a call to a numpy function, which is\n    # being optimized separately.\n    # construct_begin\n    x = numpy.array([[1, 2, 3], [4, 5, 6]], numpy.int32)\n    # construct_alternative\n    x = numpy.array, numpy.int32\n    # construct_end\n\n    return x\n\n\nfor x in itertools.repeat(None, 20000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationAttributeLookup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = list()\nmodule_value2 = 3000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    s.append\n    # construct_begin\n    s.append\n    # construct_end\n    s.append\n\n    return s, local_value\n\n\nfor x in itertools.repeat(None, 25000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationFloatAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5000.0\nmodule_value2 = 3000.0\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    t = module_value2\n    # construct_begin\n    t = s + 1.0\n    # construct_end\n\n    return s, t, local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationIntegerAdd.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5000\nmodule_value2 = 3000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    t = module_value2\n    # construct_begin\n    t = s + t\n    # construct_end\n\n    return s, t, local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationIntegerMul.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 5000\nmodule_value2 = 3000\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    t = module_value2\n    # construct_begin\n    t = s * t\n    # construct_end\n\n    return s, t, local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationIntegerPower.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = -1\nmodule_value2 = 17\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    t = module_value2\n    # construct_begin\n    t = s**t\n    # construct_end\n\n    return s, t, local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/OperationListIntegerIndexLookup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = [1, 2, 3, 4, 5]\nmodule_value2 = 3\n\n\ndef calledRepeatedly():\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    local_value = module_value1\n\n    s = module_value1\n    t = module_value2\n    # construct_begin\n    t = s[t]\n    # construct_end\n\n    return s, t, local_value\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/RichComparisonConditionStrings.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\nimport sys\n\nmodule_value1 = \"1000\"\nmodule_value2 = \"2000\"\n\nloop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])\n\nx = 0\nfor _x in itertools.repeat(None, loop_count):\n    x += 1\n    y = x % 2 == 0\n\n# construct_begin\n    if x % 2 == 0:\n# construct_alternative\n    if y:\n# construct_end\n        y = not y\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/RichComparisonStrings.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\nimport sys\n\nmodule_value1 = \"1000\"\nmodule_value2 = \"2000\"\n\nloop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])\n\n\ndef calledRepeatedly(value1, value2):\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # construct_begin\n    if value1 == value2:\n        return\n    # construct_end\n\n    return value1, value2\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(module_value1, module_value2)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/SetCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\n\n\ndef calledRepeatedly(set_value1):\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # construct_begin\n    l = {set_value1, set_value1, set_value1, set_value1, set_value1}\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return l, set_value1\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(module_value1)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/TupleCreation.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_value1 = 1000\n\n\ndef calledRepeatedly(tuple_value1):\n    # Force frame and eliminate forward propagation (currently).\n    module_value1\n\n    # construct_begin\n    l = (tuple_value1, tuple_value1, tuple_value1, tuple_value1, tuple_value1)\n    # construct_alternative\n    l = 1\n    # construct_end\n\n    return l, tuple_value1\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly(module_value1)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/constructs/UnpackIterator.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport itertools\n\nmodule_var = 1\nrange_arg = 2\n\n\ndef calledRepeatedly():\n    global module_var\n    c = module_var\n\n    iterator = iter(range(range_arg))\n\n    # construct_begin\n    a, b = iterator\n    # construct_alternative\n    a = c\n    b = c\n    # construct_end\n\n    return a, b\n\n\nfor x in itertools.repeat(None, 50000):\n    calledRepeatedly()\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/mandelbrot.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport numpy as np\n\n\ndef mandelbrot(z, maxiter):\n    c = z\n    for n in range(maxiter):\n        if abs(z) > 2:\n            return n\n        z = z * z + c\n    return maxiter\n\n\ndef mandelbrot_set(xmin, xmax, ymin, ymax, width, height, maxiter):\n    r1 = np.linspace(xmin, xmax, width)\n    r2 = np.linspace(ymin, ymax, height)\n    return [mandelbrot(complex(r, i), maxiter) for r in r1 for i in r2]\n\n\nif __name__ == \"__main__\":\n    mandelbrot_set(-2.0, 0.5, -1.25, 1.25, 1000, 1000, 80)\n    # harder_stmt = 'mandelbrot_set(-0.74877,-0.74872,0.06505,0.06510,1000,1000,2048)'\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Arithmetic.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass SimpleIntegerArithmetic(Test):\n\n    version = 2.0\n    operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)\n    rounds = 120000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            a = 2\n            b = 3\n            c = 3\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SimpleFloatArithmetic(Test):\n\n    version = 2.0\n    operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)\n    rounds = 120000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            a = 2.1\n            b = 3.3332\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2.1\n            b = 3.3332\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2.1\n            b = 3.3332\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2.1\n            b = 3.3332\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2.1\n            b = 3.3332\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SimpleIntFloatArithmetic(Test):\n\n    version = 2.0\n    operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)\n    rounds = 120000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            a = 2\n            b = 3\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2\n            b = 3\n            c = 3.14159\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass SimpleLongArithmetic(Test):\n\n    version = 2.0\n    operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)\n    rounds = 60000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            a = 2220001L\n            b = 100001L\n            c = 30005L\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2220001L\n            b = 100001L\n            c = 30005L\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2220001L\n            b = 100001L\n            c = 30005L\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2220001L\n            b = 100001L\n            c = 30005L\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2220001L\n            b = 100001L\n            c = 30005L\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SimpleComplexArithmetic(Test):\n\n    version = 2.0\n    operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)\n    rounds = 80000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            a = 2 + 3j\n            b = 2.5 + 4.5j\n            c = 1.2 + 6.2j\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2 + 3j\n            b = 2.5 + 4.5j\n            c = 1.2 + 6.2j\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2 + 3j\n            b = 2.5 + 4.5j\n            c = 1.2 + 6.2j\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2 + 3j\n            b = 2.5 + 4.5j\n            c = 1.2 + 6.2j\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            a = 2 + 3j\n            b = 2.5 + 4.5j\n            c = 1.2 + 6.2j\n\n            c = a + b\n            c = b + c\n            c = c + a\n            c = a + b\n            c = b + c\n\n            c = c - a\n            c = a - b\n            c = b - c\n            c = c - a\n            c = b - c\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n            c = a * b\n            c = b * a\n            c = c * b\n\n            c = a / b\n            c = b / a\n            c = c / b\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Calls.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass PythonFunctionCalls(Test):\n\n    version = 2.0\n    operations = 5*(1+4+4+2)\n    rounds = 60000\n\n    def test(self):\n\n        global f,f1,g,h\n\n        # define functions\n        def f():\n            pass\n\n        def f1(x):\n            pass\n\n        def g(a,b,c):\n            return a,b,c\n\n        def h(a,b,c,d=1,e=2,f=3):\n            return d,e,f\n\n        # do calls\n        for i in xrange(self.rounds):\n\n            f()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            h(i,i,3,i,i)\n            h(i,i,i,2,i,3)\n\n            f()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            h(i,i,3,i,i)\n            h(i,i,i,2,i,3)\n\n            f()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            h(i,i,3,i,i)\n            h(i,i,i,2,i,3)\n\n            f()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            h(i,i,3,i,i)\n            h(i,i,i,2,i,3)\n\n            f()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            g(i,i,i)\n            h(i,i,3,i,i)\n            h(i,i,i,2,i,3)\n\n    def calibrate(self):\n\n        global f,f1,g,h\n\n        # define functions\n        def f():\n            pass\n\n        def f1(x):\n            pass\n\n        def g(a,b,c):\n            return a,b,c\n\n        def h(a,b,c,d=1,e=2,f=3):\n            return d,e,f\n\n        # do calls\n        for i in xrange(self.rounds):\n            pass\n\n###\n\nclass ComplexPythonFunctionCalls(Test):\n\n    version = 2.0\n    operations = 4*5\n    rounds = 100000\n\n    def test(self):\n\n        # define functions\n        def f(a,b,c,d=1,e=2,f=3):\n            return f\n\n        args = 1,2\n        kwargs = dict(c=3,d=4,e=5)\n\n        # do calls\n        for i in xrange(self.rounds):\n            f(a=i,b=i,c=i)\n            f(f=i,e=i,d=i,c=2,b=i,a=3)\n            f(1,b=i,**kwargs)\n            f(*args,**kwargs)\n\n            f(a=i,b=i,c=i)\n            f(f=i,e=i,d=i,c=2,b=i,a=3)\n            f(1,b=i,**kwargs)\n            f(*args,**kwargs)\n\n            f(a=i,b=i,c=i)\n            f(f=i,e=i,d=i,c=2,b=i,a=3)\n            f(1,b=i,**kwargs)\n            f(*args,**kwargs)\n\n            f(a=i,b=i,c=i)\n            f(f=i,e=i,d=i,c=2,b=i,a=3)\n            f(1,b=i,**kwargs)\n            f(*args,**kwargs)\n\n            f(a=i,b=i,c=i)\n            f(f=i,e=i,d=i,c=2,b=i,a=3)\n            f(1,b=i,**kwargs)\n            f(*args,**kwargs)\n\n\n    def calibrate(self):\n\n        # define functions\n        def f(a,b,c,d=1,e=2,f=3):\n            return f\n\n        args = 1,2\n        kwargs = dict(c=3,d=4,e=5)\n\n        # do calls\n        for i in xrange(self.rounds):\n            pass\n\n###\n\nclass BuiltinFunctionCalls(Test):\n\n    version = 2.0\n    operations = 5*(2+5+5+5)\n    rounds = 60000\n\n    def test(self):\n\n        # localize functions\n        f0 = globals\n        f1 = hash\n        f2 = cmp\n        f3 = range\n\n        # do calls\n        for i in xrange(self.rounds):\n\n            f0()\n            f0()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n\n            f0()\n            f0()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n\n            f0()\n            f0()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n\n            f0()\n            f0()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n\n            f0()\n            f0()\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f1(i)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f2(1,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n            f3(1,3,2)\n\n    def calibrate(self):\n\n        # localize functions\n        f0 = dir\n        f1 = hash\n        f2 = range\n        f3 = range\n\n        # do calls\n        for i in xrange(self.rounds):\n            pass\n\n###\n\nclass PythonMethodCalls(Test):\n\n    version = 2.0\n    operations = 5*(6 + 5 + 4)\n    rounds = 30000\n\n    def test(self):\n\n        class c:\n\n            x = 2\n            s = 'string'\n\n            def f(self):\n\n                return self.x\n\n            def j(self,a,b):\n\n                self.y = a\n                self.t = b\n                return self.y\n\n            def k(self,a,b,c=3):\n\n                self.y = a\n                self.s = b\n                self.t = c\n\n        o = c()\n\n        for i in xrange(self.rounds):\n\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.j(i,i)\n            o.j(i,i)\n            o.j(i,2)\n            o.j(i,2)\n            o.j(2,2)\n            o.k(i,i)\n            o.k(i,2)\n            o.k(i,2,3)\n            o.k(i,i,c=4)\n\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.j(i,i)\n            o.j(i,i)\n            o.j(i,2)\n            o.j(i,2)\n            o.j(2,2)\n            o.k(i,i)\n            o.k(i,2)\n            o.k(i,2,3)\n            o.k(i,i,c=4)\n\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.j(i,i)\n            o.j(i,i)\n            o.j(i,2)\n            o.j(i,2)\n            o.j(2,2)\n            o.k(i,i)\n            o.k(i,2)\n            o.k(i,2,3)\n            o.k(i,i,c=4)\n\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.j(i,i)\n            o.j(i,i)\n            o.j(i,2)\n            o.j(i,2)\n            o.j(2,2)\n            o.k(i,i)\n            o.k(i,2)\n            o.k(i,2,3)\n            o.k(i,i,c=4)\n\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.f()\n            o.j(i,i)\n            o.j(i,i)\n            o.j(i,2)\n            o.j(i,2)\n            o.j(2,2)\n            o.k(i,i)\n            o.k(i,2)\n            o.k(i,2,3)\n            o.k(i,i,c=4)\n\n    def calibrate(self):\n\n        class c:\n\n            x = 2\n            s = 'string'\n\n            def f(self):\n\n                return self.x\n\n            def j(self,a,b):\n\n                self.y = a\n                self.t = b\n\n            def k(self,a,b,c=3):\n\n                self.y = a\n                self.s = b\n                self.t = c\n\n        o = c\n\n        for i in xrange(self.rounds):\n            pass\n\n###\n\nclass Recursion(Test):\n\n    version = 2.0\n    operations = 5\n    rounds = 100000\n\n    def test(self):\n\n        global f\n\n        def f(x):\n\n            if x > 1:\n                return f(x-1)\n            return 1\n\n        for i in xrange(self.rounds):\n            f(10)\n            f(10)\n            f(10)\n            f(10)\n            f(10)\n\n    def calibrate(self):\n\n        global f\n\n        def f(x):\n\n            if x > 0:\n                return f(x-1)\n            return 1\n\n        for i in xrange(self.rounds):\n            pass\n\n\n### Test to make Fredrik happy...\n\nif __name__ == '__main__':\n    import timeit\n    if 0:\n        timeit.TestClass = PythonFunctionCalls\n        timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',\n                     'test.test()'])\n    else:\n        setup = \"\"\"\\\nglobal f,f1,g,h\n\n# define functions\ndef f():\n    pass\n\ndef f1(x):\n    pass\n\ndef g(a,b,c):\n    return a,b,c\n\ndef h(a,b,c,d=1,e=2,f=3):\n    return d,e,f\n\ni = 1\n\"\"\"\n        test = \"\"\"\\\nf()\nf1(i)\nf1(i)\nf1(i)\nf1(i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\nh(i,i,3,i,i)\nh(i,i,i,2,i,3)\n\nf()\nf1(i)\nf1(i)\nf1(i)\nf1(i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\nh(i,i,3,i,i)\nh(i,i,i,2,i,3)\n\nf()\nf1(i)\nf1(i)\nf1(i)\nf1(i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\nh(i,i,3,i,i)\nh(i,i,i,2,i,3)\n\nf()\nf1(i)\nf1(i)\nf1(i)\nf1(i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\nh(i,i,3,i,i)\nh(i,i,i,2,i,3)\n\nf()\nf1(i)\nf1(i)\nf1(i)\nf1(i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\ng(i,i,i)\nh(i,i,3,i,i)\nh(i,i,i,2,i,3)\n\"\"\"\n\n        timeit.main(['-s', setup,\n                     test])\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/CommandLine.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" CommandLine - Get and parse command line options\n\n    NOTE: This still is very much work in progress !!!\n\n    Different version are likely to be incompatible.\n\n    TODO:\n\n    * Incorporate the changes made by (see Inbox)\n    * Add number range option using srange()\n\n\"\"\"\n\n__copyright__ = \"\"\"\\\nCopyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)\nCopyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)\nSee the documentation for further information on copyrights,\nor contact the author. All Rights Reserved.\n\"\"\"\n\n__version__ = '1.2'\n\nimport sys, getopt, string, glob, os, re, exceptions, traceback\n\n### Helpers\n\ndef _getopt_flags(options):\n\n    \"\"\" Convert the option list to a getopt flag string and long opt\n        list\n\n    \"\"\"\n    s = []\n    l = []\n    for o in options:\n        if o.prefix == '-':\n            # short option\n            s.append(o.name)\n            if o.takes_argument:\n                s.append(':')\n        else:\n            # long option\n            if o.takes_argument:\n                l.append(o.name+'=')\n            else:\n                l.append(o.name)\n    return string.join(s,''),l\n\ndef invisible_input(prompt='>>> '):\n\n    \"\"\" Get raw input from a terminal without echoing the characters to\n        the terminal, e.g. for password queries.\n\n    \"\"\"\n    import getpass\n    entry = getpass.getpass(prompt)\n    if entry is None:\n        raise KeyboardInterrupt\n    return entry\n\ndef fileopen(name, mode='wb', encoding=None):\n\n    \"\"\" Open a file using mode.\n\n        Default mode is 'wb' meaning to open the file for writing in\n        binary mode. If encoding is given, I/O to and from the file is\n        transparently encoded using the given encoding.\n\n        Files opened for writing are chmod()ed to 0600.\n\n    \"\"\"\n    if name == 'stdout':\n        return sys.stdout\n    elif name == 'stderr':\n        return sys.stderr\n    elif name == 'stdin':\n        return sys.stdin\n    else:\n        if encoding is not None:\n            import codecs\n            f = codecs.open(name, mode, encoding)\n        else:\n            f = open(name, mode)\n        if 'w' in mode:\n            os.chmod(name, 0600)\n        return f\n\ndef option_dict(options):\n\n    \"\"\" Return a dictionary mapping option names to Option instances.\n    \"\"\"\n    d = {}\n    for option in options:\n        d[option.name] = option\n    return d\n\n# Alias\ngetpasswd = invisible_input\n\n_integerRE = re.compile('\\s*(-?\\d+)\\s*$')\n_integerRangeRE = re.compile('\\s*(-?\\d+)\\s*-\\s*(-?\\d+)\\s*$')\n\ndef srange(s,\n\n           split=string.split,integer=_integerRE,\n           integerRange=_integerRangeRE):\n\n    \"\"\" Converts a textual representation of integer numbers and ranges\n        to a Python list.\n\n        Supported formats: 2,3,4,2-10,-1 - -3, 5 - -2\n\n        Values are appended to the created list in the order specified\n        in the string.\n\n    \"\"\"\n    l = []\n    append = l.append\n    for entry in split(s,','):\n        m = integer.match(entry)\n        if m:\n            append(int(m.groups()[0]))\n            continue\n        m = integerRange.match(entry)\n        if m:\n            start,end = map(int,m.groups())\n            l[len(l):] = range(start,end+1)\n    return l\n\ndef abspath(path,\n\n            expandvars=os.path.expandvars,expanduser=os.path.expanduser,\n            join=os.path.join,getcwd=os.getcwd):\n\n    \"\"\" Return the corresponding absolute path for path.\n\n        path is expanded in the usual shell ways before\n        joining it with the current working directory.\n\n    \"\"\"\n    try:\n        path = expandvars(path)\n    except AttributeError:\n        pass\n    try:\n        path = expanduser(path)\n    except AttributeError:\n        pass\n    return join(getcwd(), path)\n\n### Option classes\n\nclass Option:\n\n    \"\"\" Option base class. Takes no argument.\n\n    \"\"\"\n    default = None\n    helptext = ''\n    prefix = '-'\n    takes_argument = 0\n    has_default = 0\n    tab = 15\n\n    def __init__(self,name,help=None):\n\n        if not name[:1] == '-':\n            raise TypeError,'option names must start with \"-\"'\n        if name[1:2] == '-':\n            self.prefix = '--'\n            self.name = name[2:]\n        else:\n            self.name = name[1:]\n        if help:\n            self.help = help\n\n    def __str__(self):\n\n        o = self\n        name = o.prefix + o.name\n        if o.takes_argument:\n            name = name + ' arg'\n        if len(name) > self.tab:\n            name = name + '\\n' + ' ' * (self.tab + 1 + len(o.prefix))\n        else:\n            name = '%-*s ' % (self.tab, name)\n        description = o.help\n        if o.has_default:\n            description = description + ' (%s)' % o.default\n        return '%s %s' % (name, description)\n\nclass ArgumentOption(Option):\n\n    \"\"\" Option that takes an argument.\n\n        An optional default argument can be given.\n\n    \"\"\"\n    def __init__(self,name,help=None,default=None):\n\n        # Basemethod\n        Option.__init__(self,name,help)\n\n        if default is not None:\n            self.default = default\n            self.has_default = 1\n        self.takes_argument = 1\n\nclass SwitchOption(Option):\n\n    \"\"\" Options that can be on or off. Has an optional default value.\n\n    \"\"\"\n    def __init__(self,name,help=None,default=None):\n\n        # Basemethod\n        Option.__init__(self,name,help)\n\n        if default is not None:\n            self.default = default\n            self.has_default = 1\n\n### Application baseclass\n\nclass Application:\n\n    \"\"\" Command line application interface with builtin argument\n        parsing.\n\n    \"\"\"\n    # Options the program accepts (Option instances)\n    options = []\n\n    # Standard settings; these are appended to options in __init__\n    preset_options = [SwitchOption('-v',\n                                   'generate verbose output'),\n                      SwitchOption('-h',\n                                   'show this help text'),\n                      SwitchOption('--help',\n                                   'show this help text'),\n                      SwitchOption('--debug',\n                                   'enable debugging'),\n                      SwitchOption('--copyright',\n                                   'show copyright'),\n                      SwitchOption('--examples',\n                                   'show examples of usage')]\n\n    # The help layout looks like this:\n    # [header]   - defaults to ''\n    #\n    # [synopsis] - formatted as '<self.name> %s' % self.synopsis\n    #\n    # options:\n    # [options]  - formatted from self.options\n    #\n    # [version]  - formatted as 'Version:\\n %s' % self.version, if given\n    #\n    # [about]    - defaults to ''\n    #\n    # Note: all fields that do not behave as template are formatted\n    #       using the instances dictionary as substitution namespace,\n    #       e.g. %(name)s will be replaced by the applications name.\n    #\n\n    # Header (default to program name)\n    header = ''\n\n    # Name (defaults to program name)\n    name = ''\n\n    # Synopsis (%(name)s is replaced by the program name)\n    synopsis = '%(name)s [option] files...'\n\n    # Version (optional)\n    version = ''\n\n    # General information printed after the possible options (optional)\n    about = ''\n\n    # Examples of usage to show when the --examples option is given (optional)\n    examples = ''\n\n    # Copyright to show\n    copyright = __copyright__\n\n    # Apply file globbing ?\n    globbing = 1\n\n    # Generate debug output ?\n    debug = 0\n\n    # Generate verbose output ?\n    verbose = 0\n\n    # Internal errors to catch\n    InternalError = exceptions.Exception\n\n    # Instance variables:\n    values = None       # Dictionary of passed options (or default values)\n                        # indexed by the options name, e.g. '-h'\n    files = None        # List of passed filenames\n    optionlist = None   # List of passed options\n\n    def __init__(self,argv=None):\n\n        # Setup application specs\n        if argv is None:\n            argv = sys.argv\n        self.filename = os.path.split(argv[0])[1]\n        if not self.name:\n            self.name = os.path.split(self.filename)[1]\n        else:\n            self.name = self.name\n        if not self.header:\n            self.header = self.name\n        else:\n            self.header = self.header\n\n        # Init .arguments list\n        self.arguments = argv[1:]\n\n        # Setup Option mapping\n        self.option_map = option_dict(self.options)\n\n        # Append preset options\n        for option in self.preset_options:\n            if not self.option_map.has_key(option.name):\n                self.add_option(option)\n\n        # Init .files list\n        self.files = []\n\n        # Start Application\n        try:\n            # Process startup\n            rc = self.startup()\n            if rc is not None:\n                raise SystemExit,rc\n\n            # Parse command line\n            rc = self.parse()\n            if rc is not None:\n                raise SystemExit,rc\n\n            # Start application\n            rc = self.main()\n            if rc is None:\n                rc = 0\n\n        except SystemExit,rc:\n            pass\n\n        except KeyboardInterrupt:\n            print\n            print '* User Break'\n            print\n            rc = 1\n\n        except self.InternalError:\n            print\n            print '* Internal Error (use --debug to display the traceback)'\n            if self.debug:\n                print\n                traceback.print_exc(20, sys.stdout)\n            elif self.verbose:\n                print '  %s: %s' % sys.exc_info()[:2]\n            print\n            rc = 1\n\n        raise SystemExit,rc\n\n    def add_option(self, option):\n\n        \"\"\" Add a new Option instance to the Application dynamically.\n\n            Note that this has to be done *before* .parse() is being\n            executed.\n\n        \"\"\"\n        self.options.append(option)\n        self.option_map[option.name] = option\n\n    def startup(self):\n\n        \"\"\" Set user defined instance variables.\n\n            If this method returns anything other than None, the\n            process is terminated with the return value as exit code.\n\n        \"\"\"\n        return None\n\n    def exit(self, rc=0):\n\n        \"\"\" Exit the program.\n\n            rc is used as exit code and passed back to the calling\n            program. It defaults to 0 which usually means: OK.\n\n        \"\"\"\n        raise SystemExit, rc\n\n    def parse(self):\n\n        \"\"\" Parse the command line and fill in self.values and self.files.\n\n            After having parsed the options, the remaining command line\n            arguments are interpreted as files and passed to .handle_files()\n            for processing.\n\n            As final step the option handlers are called in the order\n            of the options given on the command line.\n\n        \"\"\"\n        # Parse arguments\n        self.values = values = {}\n        for o in self.options:\n            if o.has_default:\n                values[o.prefix+o.name] = o.default\n            else:\n                values[o.prefix+o.name] = 0\n        flags,lflags = _getopt_flags(self.options)\n        try:\n            optlist,files = getopt.getopt(self.arguments,flags,lflags)\n            if self.globbing:\n                l = []\n                for f in files:\n                    gf = glob.glob(f)\n                    if not gf:\n                        l.append(f)\n                    else:\n                        l[len(l):] = gf\n                files = l\n            self.optionlist = optlist\n            self.files = files + self.files\n        except getopt.error,why:\n            self.help(why)\n            sys.exit(1)\n\n        # Call file handler\n        rc = self.handle_files(self.files)\n        if rc is not None:\n            sys.exit(rc)\n\n        # Call option handlers\n        for optionname, value in optlist:\n\n            # Try to convert value to integer\n            try:\n                value = string.atoi(value)\n            except ValueError:\n                pass\n\n            # Find handler and call it (or count the number of option\n            # instances on the command line)\n            handlername = 'handle' + string.replace(optionname, '-', '_')\n            try:\n                handler = getattr(self, handlername)\n            except AttributeError:\n                if value == '':\n                    # count the number of occurrences\n                    if values.has_key(optionname):\n                        values[optionname] = values[optionname] + 1\n                    else:\n                        values[optionname] = 1\n                else:\n                    values[optionname] = value\n            else:\n                rc = handler(value)\n                if rc is not None:\n                    raise SystemExit, rc\n\n        # Apply final file check (for backward compatibility)\n        rc = self.check_files(self.files)\n        if rc is not None:\n            sys.exit(rc)\n\n    def check_files(self,filelist):\n\n        \"\"\" Apply some user defined checks on the files given in filelist.\n\n            This may modify filelist in place. A typical application\n            is checking that at least n files are given.\n\n            If this method returns anything other than None, the\n            process is terminated with the return value as exit code.\n\n        \"\"\"\n        return None\n\n    def help(self,note=''):\n\n        self.print_header()\n        if self.synopsis:\n            print 'Synopsis:'\n            # To remain backward compatible:\n            try:\n                synopsis = self.synopsis % self.name\n            except (NameError, KeyError, TypeError):\n                synopsis = self.synopsis % self.__dict__\n            print ' ' + synopsis\n        print\n        self.print_options()\n        if self.version:\n            print 'Version:'\n            print ' %s' % self.version\n            print\n        if self.about:\n            print string.strip(self.about % self.__dict__)\n            print\n        if note:\n            print '-'*72\n            print 'Note:',note\n            print\n\n    def notice(self,note):\n\n        print '-'*72\n        print 'Note:',note\n        print '-'*72\n        print\n\n    def print_header(self):\n\n        print '-'*72\n        print self.header % self.__dict__\n        print '-'*72\n        print\n\n    def print_options(self):\n\n        options = self.options\n        print 'Options and default settings:'\n        if not options:\n            print '  None'\n            return\n        long = filter(lambda x: x.prefix == '--', options)\n        short = filter(lambda x: x.prefix == '-', options)\n        items = short + long\n        for o in options:\n            print ' ',o\n        print\n\n    #\n    # Example handlers:\n    #\n    # If a handler returns anything other than None, processing stops\n    # and the return value is passed to sys.exit() as argument.\n    #\n\n    # File handler\n    def handle_files(self,files):\n\n        \"\"\" This may process the files list in place.\n        \"\"\"\n        return None\n\n    # Short option handler\n    def handle_h(self,arg):\n\n        self.help()\n        return 0\n\n    def handle_v(self, value):\n\n        \"\"\" Turn on verbose output.\n        \"\"\"\n        self.verbose = 1\n\n    # Handlers for long options have two underscores in their name\n    def handle__help(self,arg):\n\n        self.help()\n        return 0\n\n    def handle__debug(self,arg):\n\n        self.debug = 1\n        # We don't want to catch internal errors:\n        self.InternalError = None\n\n    def handle__copyright(self,arg):\n\n        self.print_header()\n        print string.strip(self.copyright % self.__dict__)\n        print\n        return 0\n\n    def handle__examples(self,arg):\n\n        self.print_header()\n        if self.examples:\n            print 'Examples:'\n            print\n            print string.strip(self.examples % self.__dict__)\n            print\n        else:\n            print 'No examples available.'\n            print\n        return 0\n\n    def main(self):\n\n        \"\"\" Override this method as program entry point.\n\n            The return value is passed to sys.exit() as argument.  If\n            it is None, 0 is assumed (meaning OK). Unhandled\n            exceptions are reported with exit status code 1 (see\n            __init__ for further details).\n\n        \"\"\"\n        return None\n\n# Alias\nCommandLine = Application\n\ndef _test():\n\n    class MyApplication(Application):\n        header = 'Test Application'\n        version = __version__\n        options = [Option('-v','verbose')]\n\n        def handle_v(self,arg):\n            print 'VERBOSE, Yeah !'\n\n    cmd = MyApplication()\n    if not cmd.values['-h']:\n        cmd.help()\n    print 'files:',cmd.files\n    print 'Bye...'\n\nif __name__ == '__main__':\n    _test()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Constructs.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass IfThenElse(Test):\n\n    version = 2.0\n    operations = 30*3 # hard to say...\n    rounds = 150000\n\n    def test(self):\n\n        a,b,c = 1,2,3\n        for i in xrange(self.rounds):\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n            if a == 1:\n                if b == 2:\n                    if c != 3:\n                        c = 3\n                        b = 3\n                    else:\n                        c = 2\n                elif b == 3:\n                    b = 2\n                    a = 2\n            elif a == 2:\n                a = 3\n            else:\n                a = 1\n\n    def calibrate(self):\n\n        a,b,c = 1,2,3\n        for i in xrange(self.rounds):\n            pass\n\nclass NestedForLoops(Test):\n\n    version = 2.0\n    operations = 1000*10*5\n    rounds = 300\n\n    def test(self):\n\n        l1 = range(1000)\n        l2 = range(10)\n        l3 = range(5)\n        for i in xrange(self.rounds):\n            for i in l1:\n                for j in l2:\n                    for k in l3:\n                        pass\n\n    def calibrate(self):\n\n        l1 = range(1000)\n        l2 = range(10)\n        l3 = range(5)\n        for i in xrange(self.rounds):\n            pass\n\nclass ForLoops(Test):\n\n    version = 2.0\n    operations = 5 * 5\n    rounds = 10000\n\n    def test(self):\n\n        l1 = range(100)\n        for i in xrange(self.rounds):\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n            for i in l1:\n                pass\n\n    def calibrate(self):\n\n        l1 = range(1000)\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Dict.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass DictCreation(Test):\n\n    version = 2.0\n    operations = 5*(5 + 5)\n    rounds = 80000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            d1 = {}\n            d2 = {}\n            d3 = {}\n            d4 = {}\n            d5 = {}\n\n            d1 = {1:2,3:4,5:6}\n            d2 = {2:3,4:5,6:7}\n            d3 = {3:4,5:6,7:8}\n            d4 = {4:5,6:7,8:9}\n            d5 = {6:7,8:9,10:11}\n\n            d1 = {}\n            d2 = {}\n            d3 = {}\n            d4 = {}\n            d5 = {}\n\n            d1 = {1:2,3:4,5:6}\n            d2 = {2:3,4:5,6:7}\n            d3 = {3:4,5:6,7:8}\n            d4 = {4:5,6:7,8:9}\n            d5 = {6:7,8:9,10:11}\n\n            d1 = {}\n            d2 = {}\n            d3 = {}\n            d4 = {}\n            d5 = {}\n\n            d1 = {1:2,3:4,5:6}\n            d2 = {2:3,4:5,6:7}\n            d3 = {3:4,5:6,7:8}\n            d4 = {4:5,6:7,8:9}\n            d5 = {6:7,8:9,10:11}\n\n            d1 = {}\n            d2 = {}\n            d3 = {}\n            d4 = {}\n            d5 = {}\n\n            d1 = {1:2,3:4,5:6}\n            d2 = {2:3,4:5,6:7}\n            d3 = {3:4,5:6,7:8}\n            d4 = {4:5,6:7,8:9}\n            d5 = {6:7,8:9,10:11}\n\n            d1 = {}\n            d2 = {}\n            d3 = {}\n            d4 = {}\n            d5 = {}\n\n            d1 = {1:2,3:4,5:6}\n            d2 = {2:3,4:5,6:7}\n            d3 = {3:4,5:6,7:8}\n            d4 = {4:5,6:7,8:9}\n            d5 = {6:7,8:9,10:11}\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass DictWithStringKeys(Test):\n\n    version = 2.0\n    operations = 5*(6 + 6)\n    rounds = 200000\n\n    def test(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n\n            d['abc'] = 1\n            d['def'] = 2\n            d['ghi'] = 3\n            d['jkl'] = 4\n            d['mno'] = 5\n            d['pqr'] = 6\n\n            d['abc']\n            d['def']\n            d['ghi']\n            d['jkl']\n            d['mno']\n            d['pqr']\n\n            d['abc'] = 1\n            d['def'] = 2\n            d['ghi'] = 3\n            d['jkl'] = 4\n            d['mno'] = 5\n            d['pqr'] = 6\n\n            d['abc']\n            d['def']\n            d['ghi']\n            d['jkl']\n            d['mno']\n            d['pqr']\n\n            d['abc'] = 1\n            d['def'] = 2\n            d['ghi'] = 3\n            d['jkl'] = 4\n            d['mno'] = 5\n            d['pqr'] = 6\n\n            d['abc']\n            d['def']\n            d['ghi']\n            d['jkl']\n            d['mno']\n            d['pqr']\n\n            d['abc'] = 1\n            d['def'] = 2\n            d['ghi'] = 3\n            d['jkl'] = 4\n            d['mno'] = 5\n            d['pqr'] = 6\n\n            d['abc']\n            d['def']\n            d['ghi']\n            d['jkl']\n            d['mno']\n            d['pqr']\n\n            d['abc'] = 1\n            d['def'] = 2\n            d['ghi'] = 3\n            d['jkl'] = 4\n            d['mno'] = 5\n            d['pqr'] = 6\n\n            d['abc']\n            d['def']\n            d['ghi']\n            d['jkl']\n            d['mno']\n            d['pqr']\n\n    def calibrate(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n            pass\n\nclass DictWithFloatKeys(Test):\n\n    version = 2.0\n    operations = 5*(6 + 6)\n    rounds = 150000\n\n    def test(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n\n            d[1.234] = 1\n            d[2.345] = 2\n            d[3.456] = 3\n            d[4.567] = 4\n            d[5.678] = 5\n            d[6.789] = 6\n\n            d[1.234]\n            d[2.345]\n            d[3.456]\n            d[4.567]\n            d[5.678]\n            d[6.789]\n\n            d[1.234] = 1\n            d[2.345] = 2\n            d[3.456] = 3\n            d[4.567] = 4\n            d[5.678] = 5\n            d[6.789] = 6\n\n            d[1.234]\n            d[2.345]\n            d[3.456]\n            d[4.567]\n            d[5.678]\n            d[6.789]\n\n            d[1.234] = 1\n            d[2.345] = 2\n            d[3.456] = 3\n            d[4.567] = 4\n            d[5.678] = 5\n            d[6.789] = 6\n\n            d[1.234]\n            d[2.345]\n            d[3.456]\n            d[4.567]\n            d[5.678]\n            d[6.789]\n\n            d[1.234] = 1\n            d[2.345] = 2\n            d[3.456] = 3\n            d[4.567] = 4\n            d[5.678] = 5\n            d[6.789] = 6\n\n            d[1.234]\n            d[2.345]\n            d[3.456]\n            d[4.567]\n            d[5.678]\n            d[6.789]\n\n            d[1.234] = 1\n            d[2.345] = 2\n            d[3.456] = 3\n            d[4.567] = 4\n            d[5.678] = 5\n            d[6.789] = 6\n\n            d[1.234]\n            d[2.345]\n            d[3.456]\n            d[4.567]\n            d[5.678]\n            d[6.789]\n\n    def calibrate(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n            pass\n\nclass DictWithIntegerKeys(Test):\n\n    version = 2.0\n    operations = 5*(6 + 6)\n    rounds = 200000\n\n    def test(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n\n            d[1] = 1\n            d[2] = 2\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n            d[6] = 6\n\n            d[1]\n            d[2]\n            d[3]\n            d[4]\n            d[5]\n            d[6]\n\n            d[1] = 1\n            d[2] = 2\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n            d[6] = 6\n\n            d[1]\n            d[2]\n            d[3]\n            d[4]\n            d[5]\n            d[6]\n\n            d[1] = 1\n            d[2] = 2\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n            d[6] = 6\n\n            d[1]\n            d[2]\n            d[3]\n            d[4]\n            d[5]\n            d[6]\n\n            d[1] = 1\n            d[2] = 2\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n            d[6] = 6\n\n            d[1]\n            d[2]\n            d[3]\n            d[4]\n            d[5]\n            d[6]\n\n            d[1] = 1\n            d[2] = 2\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n            d[6] = 6\n\n            d[1]\n            d[2]\n            d[3]\n            d[4]\n            d[5]\n            d[6]\n\n    def calibrate(self):\n\n        d = {}\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SimpleDictManipulation(Test):\n\n    version = 2.0\n    operations = 5*(6 + 6 + 6 + 6)\n    rounds = 100000\n\n    def test(self):\n\n        d = {}\n        has_key = d.has_key\n\n        for i in xrange(self.rounds):\n\n            d[0] = 3\n            d[1] = 4\n            d[2] = 5\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n\n            x = d[0]\n            x = d[1]\n            x = d[2]\n            x = d[3]\n            x = d[4]\n            x = d[5]\n\n            has_key(0)\n            has_key(2)\n            has_key(4)\n            has_key(6)\n            has_key(8)\n            has_key(10)\n\n            del d[0]\n            del d[1]\n            del d[2]\n            del d[3]\n            del d[4]\n            del d[5]\n\n            d[0] = 3\n            d[1] = 4\n            d[2] = 5\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n\n            x = d[0]\n            x = d[1]\n            x = d[2]\n            x = d[3]\n            x = d[4]\n            x = d[5]\n\n            has_key(0)\n            has_key(2)\n            has_key(4)\n            has_key(6)\n            has_key(8)\n            has_key(10)\n\n            del d[0]\n            del d[1]\n            del d[2]\n            del d[3]\n            del d[4]\n            del d[5]\n\n            d[0] = 3\n            d[1] = 4\n            d[2] = 5\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n\n            x = d[0]\n            x = d[1]\n            x = d[2]\n            x = d[3]\n            x = d[4]\n            x = d[5]\n\n            has_key(0)\n            has_key(2)\n            has_key(4)\n            has_key(6)\n            has_key(8)\n            has_key(10)\n\n            del d[0]\n            del d[1]\n            del d[2]\n            del d[3]\n            del d[4]\n            del d[5]\n\n            d[0] = 3\n            d[1] = 4\n            d[2] = 5\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n\n            x = d[0]\n            x = d[1]\n            x = d[2]\n            x = d[3]\n            x = d[4]\n            x = d[5]\n\n            has_key(0)\n            has_key(2)\n            has_key(4)\n            has_key(6)\n            has_key(8)\n            has_key(10)\n\n            del d[0]\n            del d[1]\n            del d[2]\n            del d[3]\n            del d[4]\n            del d[5]\n\n            d[0] = 3\n            d[1] = 4\n            d[2] = 5\n            d[3] = 3\n            d[4] = 4\n            d[5] = 5\n\n            x = d[0]\n            x = d[1]\n            x = d[2]\n            x = d[3]\n            x = d[4]\n            x = d[5]\n\n            has_key(0)\n            has_key(2)\n            has_key(4)\n            has_key(6)\n            has_key(8)\n            has_key(10)\n\n            del d[0]\n            del d[1]\n            del d[2]\n            del d[3]\n            del d[4]\n            del d[5]\n\n    def calibrate(self):\n\n        d = {}\n        has_key = d.has_key\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Exceptions.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass TryRaiseExcept(Test):\n\n    version = 2.0\n    operations = 2 + 3 + 3\n    rounds = 80000\n\n    def test(self):\n\n        error = ValueError\n\n        for i in xrange(self.rounds):\n            try:\n                raise error\n            except:\n                pass\n            try:\n                raise error\n            except:\n                pass\n            try:\n                raise error,\"something\"\n            except:\n                pass\n            try:\n                raise error,\"something\"\n            except:\n                pass\n            try:\n                raise error,\"something\"\n            except:\n                pass\n            try:\n                raise error(\"something\")\n            except:\n                pass\n            try:\n                raise error(\"something\")\n            except:\n                pass\n            try:\n                raise error(\"something\")\n            except:\n                pass\n\n    def calibrate(self):\n\n        error = ValueError\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass TryExcept(Test):\n\n    version = 2.0\n    operations = 15 * 10\n    rounds = 150000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n            try:\n                pass\n            except:\n                pass\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n### Test to make Fredrik happy...\n\nif __name__ == '__main__':\n    import timeit\n    timeit.TestClass = TryRaiseExcept\n    timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',\n                 'test.test()'])\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Imports.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\n# First imports:\nimport os\nimport package.submodule\n\nclass SecondImport(Test):\n\n    version = 2.0\n    operations = 5 * 5\n    rounds = 40000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            import os\n            import os\n            import os\n            import os\n            import os\n\n            import os\n            import os\n            import os\n            import os\n            import os\n\n            import os\n            import os\n            import os\n            import os\n            import os\n\n            import os\n            import os\n            import os\n            import os\n            import os\n\n            import os\n            import os\n            import os\n            import os\n            import os\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass SecondPackageImport(Test):\n\n    version = 2.0\n    operations = 5 * 5\n    rounds = 40000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            import package\n            import package\n            import package\n            import package\n            import package\n\n            import package\n            import package\n            import package\n            import package\n            import package\n\n            import package\n            import package\n            import package\n            import package\n            import package\n\n            import package\n            import package\n            import package\n            import package\n            import package\n\n            import package\n            import package\n            import package\n            import package\n            import package\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SecondSubmoduleImport(Test):\n\n    version = 2.0\n    operations = 5 * 5\n    rounds = 40000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n            import package.submodule\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Instances.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass CreateInstances(Test):\n\n    version = 2.0\n    operations = 3 + 7 + 4\n    rounds = 80000\n\n    def test(self):\n\n        class c:\n            pass\n\n        class d:\n            def __init__(self,a,b,c):\n                self.a = a\n                self.b = b\n                self.c = c\n\n        class e:\n            def __init__(self,a,b,c=4):\n                self.a = a\n                self.b = b\n                self.c = c\n                self.d = a\n                self.e = b\n                self.f = c\n\n        for i in xrange(self.rounds):\n            o = c()\n            o1 = c()\n            o2 = c()\n            p = d(i,i,3)\n            p1 = d(i,i,3)\n            p2 = d(i,3,3)\n            p3 = d(3,i,3)\n            p4 = d(i,i,i)\n            p5 = d(3,i,3)\n            p6 = d(i,i,i)\n            q = e(i,i,3)\n            q1 = e(i,i,3)\n            q2 = e(i,i,3)\n            q3 = e(i,i)\n\n    def calibrate(self):\n\n        class c:\n            pass\n\n        class d:\n            def __init__(self,a,b,c):\n                self.a = a\n                self.b = b\n                self.c = c\n\n        class e:\n            def __init__(self,a,b,c=4):\n                self.a = a\n                self.b = b\n                self.c = c\n                self.d = a\n                self.e = b\n                self.f = c\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/LICENSE",
    "content": "pybench License\n---------------\n\nThis copyright notice and license applies to all files in the pybench\ndirectory of the pybench distribution.\n\nCopyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)\nCopyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)\n\n                   All Rights Reserved.\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee or royalty is hereby\ngranted, provided that the above copyright notice appear in all copies\nand that both that copyright notice and this permission notice appear\nin supporting documentation or portions thereof, including\nmodifications, that you make.\n\nTHE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO\nTHIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,\nINDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING\nFROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\nNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION\nWITH THE USE OR PERFORMANCE OF THIS SOFTWARE !\n"
  },
  {
    "path": "tests/benchmarks/pybench/Lists.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass SimpleListManipulation(Test):\n\n    version = 2.0\n    operations = 5* (6 + 6 + 6)\n    rounds = 130000\n\n    def test(self):\n\n        l = []\n        append = l.append\n\n        for i in xrange(self.rounds):\n\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            x = l[0]\n            x = l[1]\n            x = l[2]\n            x = l[3]\n            x = l[4]\n            x = l[5]\n\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            x = l[0]\n            x = l[1]\n            x = l[2]\n            x = l[3]\n            x = l[4]\n            x = l[5]\n\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            x = l[0]\n            x = l[1]\n            x = l[2]\n            x = l[3]\n            x = l[4]\n            x = l[5]\n\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            x = l[0]\n            x = l[1]\n            x = l[2]\n            x = l[3]\n            x = l[4]\n            x = l[5]\n\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            x = l[0]\n            x = l[1]\n            x = l[2]\n            x = l[3]\n            x = l[4]\n            x = l[5]\n\n            if len(l) > 10000:\n                # cut down the size\n                del l[:]\n\n    def calibrate(self):\n\n        l = []\n        append = l.append\n\n        for i in xrange(self.rounds):\n            pass\n\nclass ListSlicing(Test):\n\n    version = 2.0\n    operations = 25*(3+1+2+1)\n    rounds = 800\n\n    def test(self):\n\n        n = range(100)\n        r = range(25)\n\n        for i in xrange(self.rounds):\n\n            l = n[:]\n\n            for j in r:\n\n                m = l[50:]\n                m = l[:25]\n                m = l[50:55]\n                l[:3] = n\n                m = l[:-1]\n                m = l[1:]\n                l[-1:] = n\n\n    def calibrate(self):\n\n        n = range(100)\n        r = range(25)\n\n        for i in xrange(self.rounds):\n            for j in r:\n                pass\n\nclass SmallLists(Test):\n\n    version = 2.0\n    operations = 5*(1+ 6 + 6 + 3 + 1)\n    rounds = 80000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            l = []\n\n            append = l.append\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            l[:3] = [1,2,3]\n            m = l[:-1]\n            m = l[1:]\n\n            l[-1:] = [4,5,6]\n\n            l = []\n\n            append = l.append\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            l[:3] = [1,2,3]\n            m = l[:-1]\n            m = l[1:]\n\n            l[-1:] = [4,5,6]\n\n            l = []\n\n            append = l.append\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            l[:3] = [1,2,3]\n            m = l[:-1]\n            m = l[1:]\n\n            l[-1:] = [4,5,6]\n\n            l = []\n\n            append = l.append\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            l[:3] = [1,2,3]\n            m = l[:-1]\n            m = l[1:]\n\n            l[-1:] = [4,5,6]\n\n            l = []\n\n            append = l.append\n            append(2)\n            append(3)\n            append(4)\n            append(2)\n            append(3)\n            append(4)\n\n            l[0] = 3\n            l[1] = 4\n            l[2] = 5\n            l[3] = 3\n            l[4] = 4\n            l[5] = 5\n\n            l[:3] = [1,2,3]\n            m = l[:-1]\n            m = l[1:]\n\n            l[-1:] = [4,5,6]\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SimpleListComprehensions(Test):\n\n    version = 2.0\n    operations = 6\n    rounds = 20000\n\n    def test(self):\n\n        n = range(10) * 10\n\n        for i in xrange(self.rounds):\n            l = [x for x in n]\n            l = [x for x in n if x]\n            l = [x for x in n if not x]\n\n            l = [x for x in n]\n            l = [x for x in n if x]\n            l = [x for x in n if not x]\n\n    def calibrate(self):\n\n        n = range(10) * 10\n\n        for i in xrange(self.rounds):\n            pass\n\nclass NestedListComprehensions(Test):\n\n    version = 2.0\n    operations = 6\n    rounds = 20000\n\n    def test(self):\n\n        m = range(10)\n        n = range(10)\n\n        for i in xrange(self.rounds):\n            l = [x for x in n for y in m]\n            l = [y for x in n for y in m]\n\n            l = [x for x in n for y in m if y]\n            l = [y for x in n for y in m if x]\n\n            l = [x for x in n for y in m if not y]\n            l = [y for x in n for y in m if not x]\n\n    def calibrate(self):\n\n        m = range(10)\n        n = range(10)\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Lookups.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass SpecialClassAttribute(Test):\n\n    version = 2.0\n    operations = 5*(12 + 12)\n    rounds = 100000\n\n    def test(self):\n\n        class c:\n            pass\n\n        for i in xrange(self.rounds):\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            c.__a = 2\n            c.__b = 3\n            c.__c = 4\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n            x = c.__a\n            x = c.__b\n            x = c.__c\n\n    def calibrate(self):\n\n        class c:\n            pass\n\n        for i in xrange(self.rounds):\n            pass\n\nclass NormalClassAttribute(Test):\n\n    version = 2.0\n    operations = 5*(12 + 12)\n    rounds = 100000\n\n    def test(self):\n\n        class c:\n            pass\n\n        for i in xrange(self.rounds):\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n            c.a = 2\n            c.b = 3\n            c.c = 4\n\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n            x = c.a\n            x = c.b\n            x = c.c\n\n    def calibrate(self):\n\n        class c:\n            pass\n\n        for i in xrange(self.rounds):\n            pass\n\nclass SpecialInstanceAttribute(Test):\n\n    version = 2.0\n    operations = 5*(12 + 12)\n    rounds = 100000\n\n    def test(self):\n\n        class c:\n            pass\n        o = c()\n\n        for i in xrange(self.rounds):\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n            o.__a__ = 2\n            o.__b__ = 3\n            o.__c__ = 4\n\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n            x = o.__a__\n            x = o.__b__\n            x = o.__c__\n\n    def calibrate(self):\n\n        class c:\n            pass\n        o = c()\n\n        for i in xrange(self.rounds):\n            pass\n\nclass NormalInstanceAttribute(Test):\n\n    version = 2.0\n    operations = 5*(12 + 12)\n    rounds = 100000\n\n    def test(self):\n\n        class c:\n            pass\n        o = c()\n\n        for i in xrange(self.rounds):\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n            o.a = 2\n            o.b = 3\n            o.c = 4\n\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n            x = o.a\n            x = o.b\n            x = o.c\n\n    def calibrate(self):\n\n        class c:\n            pass\n        o = c()\n\n        for i in xrange(self.rounds):\n            pass\n\nclass BuiltinMethodLookup(Test):\n\n    version = 2.0\n    operations = 5*(3*5 + 3*5)\n    rounds = 70000\n\n    def test(self):\n\n        l = []\n        d = {}\n\n        for i in xrange(self.rounds):\n\n            l.append\n            l.append\n            l.append\n            l.append\n            l.append\n\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n\n            d.items\n            d.items\n            d.items\n            d.items\n            d.items\n\n            d.get\n            d.get\n            d.get\n            d.get\n            d.get\n\n            l.append\n            l.append\n            l.append\n            l.append\n            l.append\n\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n\n            d.items\n            d.items\n            d.items\n            d.items\n            d.items\n\n            d.get\n            d.get\n            d.get\n            d.get\n            d.get\n\n            l.append\n            l.append\n            l.append\n            l.append\n            l.append\n\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n\n            d.items\n            d.items\n            d.items\n            d.items\n            d.items\n\n            d.get\n            d.get\n            d.get\n            d.get\n            d.get\n\n            l.append\n            l.append\n            l.append\n            l.append\n            l.append\n\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n\n            d.items\n            d.items\n            d.items\n            d.items\n            d.items\n\n            d.get\n            d.get\n            d.get\n            d.get\n            d.get\n\n            l.append\n            l.append\n            l.append\n            l.append\n            l.append\n\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n            l.insert\n\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n            l.sort\n\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n            d.has_key\n\n            d.items\n            d.items\n            d.items\n            d.items\n            d.items\n\n            d.get\n            d.get\n            d.get\n            d.get\n            d.get\n\n    def calibrate(self):\n\n        l = []\n        d = {}\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/NewInstances.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\n# Check for new-style class support:\ntry:\n    class c(object):\n        pass\nexcept NameError:\n    raise ImportError\n\n###\n\nclass CreateNewInstances(Test):\n\n    version = 2.0\n    operations = 3 + 7 + 4\n    rounds = 60000\n\n    def test(self):\n\n        class c(object):\n            pass\n\n        class d(object):\n            def __init__(self,a,b,c):\n                self.a = a\n                self.b = b\n                self.c = c\n\n        class e(object):\n            def __init__(self,a,b,c=4):\n                self.a = a\n                self.b = b\n                self.c = c\n                self.d = a\n                self.e = b\n                self.f = c\n\n        for i in xrange(self.rounds):\n            o = c()\n            o1 = c()\n            o2 = c()\n            p = d(i,i,3)\n            p1 = d(i,i,3)\n            p2 = d(i,3,3)\n            p3 = d(3,i,3)\n            p4 = d(i,i,i)\n            p5 = d(3,i,3)\n            p6 = d(i,i,i)\n            q = e(i,i,3)\n            q1 = e(i,i,3)\n            q2 = e(i,i,3)\n            q3 = e(i,i)\n\n    def calibrate(self):\n\n        class c(object):\n            pass\n\n        class d(object):\n            def __init__(self,a,b,c):\n                self.a = a\n                self.b = b\n                self.c = c\n\n        class e(object):\n            def __init__(self,a,b,c=4):\n                self.a = a\n                self.b = b\n                self.c = c\n                self.d = a\n                self.e = b\n                self.f = c\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Numbers.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass CompareIntegers(Test):\n\n    version = 2.0\n    operations = 30 * 5\n    rounds = 120000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n            2 < 3\n            2 > 3\n            2 == 3\n            2 > 3\n            2 < 3\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareFloats(Test):\n\n    version = 2.0\n    operations = 30 * 5\n    rounds = 80000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n            2.1 < 3.31\n            2.1 > 3.31\n            2.1 == 3.31\n            2.1 > 3.31\n            2.1 < 3.31\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareFloatsIntegers(Test):\n\n    version = 2.0\n    operations = 30 * 5\n    rounds = 60000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n            2.1 < 4\n            2.1 > 4\n            2.1 == 4\n            2.1 > 4\n            2.1 < 4\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareLongs(Test):\n\n    version = 2.0\n    operations = 30 * 5\n    rounds = 70000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n            1234567890L < 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L == 3456789012345L\n            1234567890L > 3456789012345L\n            1234567890L < 3456789012345L\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/README",
    "content": "________________________________________________________________________\n\nPYBENCH - A Python Benchmark Suite\n________________________________________________________________________\n\n     Extendable suite of of low-level benchmarks for measuring\n          the performance of the Python implementation \n                 (interpreter, compiler or VM).\n\npybench is a collection of tests that provides a standardized way to\nmeasure the performance of Python implementations. It takes a very\nclose look at different aspects of Python programs and let's you\ndecide which factors are more important to you than others, rather\nthan wrapping everything up in one number, like the other performance\ntests do (e.g. pystone which is included in the Python Standard\nLibrary).\n\npybench has been used in the past by several Python developers to\ntrack down performance bottlenecks or to demonstrate the impact of\noptimizations and new features in Python.\n\nThe command line interface for pybench is the file pybench.py. Run\nthis script with option '--help' to get a listing of the possible\noptions. Without options, pybench will simply execute the benchmark\nand then print out a report to stdout.\n\n\nMicro-Manual\n------------\n\nRun 'pybench.py -h' to see the help screen.  Run 'pybench.py' to run\nthe benchmark suite using default settings and 'pybench.py -f <file>'\nto have it store the results in a file too.\n\nIt is usually a good idea to run pybench.py multiple times to see\nwhether the environment, timers and benchmark run-times are suitable\nfor doing benchmark tests. \n\nYou can use the comparison feature of pybench.py ('pybench.py -c\n<file>') to check how well the system behaves in comparison to a\nreference run. \n\nIf the differences are well below 10% for each test, then you have a\nsystem that is good for doing benchmark testings.  Of you get random\ndifferences of more than 10% or significant differences between the\nvalues for minimum and average time, then you likely have some\nbackground processes running which cause the readings to become\ninconsistent. Examples include: web-browsers, email clients, RSS\nreaders, music players, backup programs, etc.\n\nIf you are only interested in a few tests of the whole suite, you can\nuse the filtering option, e.g. 'pybench.py -t string' will only\nrun/show the tests that have 'string' in their name.\n\nThis is the current output of pybench.py --help:\n\n\"\"\"\n------------------------------------------------------------------------\nPYBENCH - a benchmark test suite for Python interpreters/compilers.\n------------------------------------------------------------------------\n\nSynopsis:\n pybench.py [option] files...\n\nOptions and default settings:\n  -n arg           number of rounds (10)\n  -f arg           save benchmark to file arg ()\n  -c arg           compare benchmark with the one in file arg ()\n  -s arg           show benchmark in file arg, then exit ()\n  -w arg           set warp factor to arg (10)\n  -t arg           run only tests with names matching arg ()\n  -C arg           set the number of calibration runs to arg (20)\n  -d               hide noise in comparisons (0)\n  -v               verbose output (not recommended) (0)\n  --with-gc        enable garbage collection (0)\n  --with-syscheck  use default sys check interval (0)\n  --timer arg      use given timer (time.time)\n  -h               show this help text\n  --help           show this help text\n  --debug          enable debugging\n  --copyright      show copyright\n  --examples       show examples of usage\n\nVersion:\n 2.0\n\nThe normal operation is to run the suite and display the\nresults. Use -f to save them for later reuse or comparisons.\n\nAvailable timers:\n\n   time.time\n   time.clock\n   systimes.processtime\n\nExamples:\n\npython2.1 pybench.py -f p21.pybench\npython2.5 pybench.py -f p25.pybench\npython pybench.py -s p25.pybench -c p21.pybench\n\"\"\"\n\nLicense\n-------\n\nSee LICENSE file.\n\n\nSample output\n-------------\n\n\"\"\"\n-------------------------------------------------------------------------------\nPYBENCH 2.0\n-------------------------------------------------------------------------------\n* using Python 2.4.2\n* disabled garbage collection\n* system check interval set to maximum: 2147483647\n* using timer: time.time\n\nCalibrating tests. Please wait...\n\nRunning 10 round(s) of the suite at warp factor 10:\n\n* Round 1 done in 6.388 seconds.\n* Round 2 done in 6.485 seconds.\n* Round 3 done in 6.786 seconds.\n...\n* Round 10 done in 6.546 seconds.\n\n-------------------------------------------------------------------------------\nBenchmark: 2006-06-12 12:09:25\n-------------------------------------------------------------------------------\n\n    Rounds: 10\n    Warp:   10\n    Timer:  time.time\n\n    Machine Details:\n       Platform ID:  Linux-2.6.8-24.19-default-x86_64-with-SuSE-9.2-x86-64\n       Processor:    x86_64\n\n    Python:\n       Executable:   /usr/local/bin/python\n       Version:      2.4.2\n       Compiler:     GCC 3.3.4 (pre 3.3.5 20040809)\n       Bits:         64bit\n       Build:        Oct  1 2005 15:24:35 (#1)\n       Unicode:      UCS2\n\n\nTest                             minimum  average  operation  overhead\n-------------------------------------------------------------------------------\n          BuiltinFunctionCalls:    126ms    145ms    0.28us    0.274ms\n           BuiltinMethodLookup:    124ms    130ms    0.12us    0.316ms\n                 CompareFloats:    109ms    110ms    0.09us    0.361ms\n         CompareFloatsIntegers:    100ms    104ms    0.12us    0.271ms\n               CompareIntegers:    137ms    138ms    0.08us    0.542ms\n        CompareInternedStrings:    124ms    127ms    0.08us    1.367ms\n                  CompareLongs:    100ms    104ms    0.10us    0.316ms\n                CompareStrings:    111ms    115ms    0.12us    0.929ms\n                CompareUnicode:    108ms    128ms    0.17us    0.693ms\n                 ConcatStrings:    142ms    155ms    0.31us    0.562ms\n                 ConcatUnicode:    119ms    127ms    0.42us    0.384ms\n               CreateInstances:    123ms    128ms    1.14us    0.367ms\n            CreateNewInstances:    121ms    126ms    1.49us    0.335ms\n       CreateStringsWithConcat:    130ms    135ms    0.14us    0.916ms\n       CreateUnicodeWithConcat:    130ms    135ms    0.34us    0.361ms\n                  DictCreation:    108ms    109ms    0.27us    0.361ms\n             DictWithFloatKeys:    149ms    153ms    0.17us    0.678ms\n           DictWithIntegerKeys:    124ms    126ms    0.11us    0.915ms\n            DictWithStringKeys:    114ms    117ms    0.10us    0.905ms\n                      ForLoops:    110ms    111ms    4.46us    0.063ms\n                    IfThenElse:    118ms    119ms    0.09us    0.685ms\n                   ListSlicing:    116ms    120ms    8.59us    0.103ms\n                NestedForLoops:    125ms    137ms    0.09us    0.019ms\n          NormalClassAttribute:    124ms    136ms    0.11us    0.457ms\n       NormalInstanceAttribute:    110ms    117ms    0.10us    0.454ms\n           PythonFunctionCalls:    107ms    113ms    0.34us    0.271ms\n             PythonMethodCalls:    140ms    149ms    0.66us    0.141ms\n                     Recursion:    156ms    166ms    3.32us    0.452ms\n                  SecondImport:    112ms    118ms    1.18us    0.180ms\n           SecondPackageImport:    118ms    127ms    1.27us    0.180ms\n         SecondSubmoduleImport:    140ms    151ms    1.51us    0.180ms\n       SimpleComplexArithmetic:    128ms    139ms    0.16us    0.361ms\n        SimpleDictManipulation:    134ms    136ms    0.11us    0.452ms\n         SimpleFloatArithmetic:    110ms    113ms    0.09us    0.571ms\n      SimpleIntFloatArithmetic:    106ms    111ms    0.08us    0.548ms\n       SimpleIntegerArithmetic:    106ms    109ms    0.08us    0.544ms\n        SimpleListManipulation:    103ms    113ms    0.10us    0.587ms\n          SimpleLongArithmetic:    112ms    118ms    0.18us    0.271ms\n                    SmallLists:    105ms    116ms    0.17us    0.366ms\n                   SmallTuples:    108ms    128ms    0.24us    0.406ms\n         SpecialClassAttribute:    119ms    136ms    0.11us    0.453ms\n      SpecialInstanceAttribute:    143ms    155ms    0.13us    0.454ms\n                StringMappings:    115ms    121ms    0.48us    0.405ms\n              StringPredicates:    120ms    129ms    0.18us    2.064ms\n                 StringSlicing:    111ms    127ms    0.23us    0.781ms\n                     TryExcept:    125ms    126ms    0.06us    0.681ms\n                TryRaiseExcept:    133ms    137ms    2.14us    0.361ms\n                  TupleSlicing:    117ms    120ms    0.46us    0.066ms\n               UnicodeMappings:    156ms    160ms    4.44us    0.429ms\n             UnicodePredicates:    117ms    121ms    0.22us    2.487ms\n             UnicodeProperties:    115ms    153ms    0.38us    2.070ms\n                UnicodeSlicing:    126ms    129ms    0.26us    0.689ms\n-------------------------------------------------------------------------------\nTotals:                           6283ms   6673ms\n\"\"\"\n________________________________________________________________________\n\nWriting New Tests\n________________________________________________________________________\n\npybench tests are simple modules defining one or more pybench.Test\nsubclasses.\n\nWriting a test essentially boils down to providing two methods:\n.test() which runs .rounds number of .operations test operations each\nand .calibrate() which does the same except that it doesn't actually\nexecute the operations.\n\n\nHere's an example:\n------------------\n\nfrom pybench import Test\n\nclass IntegerCounting(Test):\n\n    # Version number of the test as float (x.yy); this is important\n    # for comparisons of benchmark runs - tests with unequal version\n    # number will not get compared.\n    version = 1.0\n    \n    # The number of abstract operations done in each round of the\n    # test. An operation is the basic unit of what you want to\n    # measure. The benchmark will output the amount of run-time per\n    # operation. Note that in order to raise the measured timings\n    # significantly above noise level, it is often required to repeat\n    # sets of operations more than once per test round. The measured\n    # overhead per test round should be less than 1 second.\n    operations = 20\n\n    # Number of rounds to execute per test run. This should be\n    # adjusted to a figure that results in a test run-time of between\n    # 1-2 seconds (at warp 1).\n    rounds = 100000\n\n    def test(self):\n\n\t\"\"\" Run the test.\n\n\t    The test needs to run self.rounds executing\n\t    self.operations number of operations each.\n\n        \"\"\"\n        # Init the test\n        a = 1\n\n        # Run test rounds\n\t#\n        # NOTE: Use xrange() for all test loops unless you want to face\n\t# a 20MB process !\n\t#\n        for i in xrange(self.rounds):\n\n            # Repeat the operations per round to raise the run-time\n            # per operation significantly above the noise level of the\n            # for-loop overhead. \n\n\t    # Execute 20 operations (a += 1):\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n            a += 1\n\n    def calibrate(self):\n\n\t\"\"\" Calibrate the test.\n\n\t    This method should execute everything that is needed to\n\t    setup and run the test - except for the actual operations\n\t    that you intend to measure. pybench uses this method to\n            measure the test implementation overhead.\n\n        \"\"\"\n        # Init the test\n        a = 1\n\n        # Run test rounds (without actually doing any operation)\n        for i in xrange(self.rounds):\n\n\t    # Skip the actual execution of the operations, since we\n\t    # only want to measure the test's administration overhead.\n            pass\n\nRegistering a new test module\n-----------------------------\n\nTo register a test module with pybench, the classes need to be\nimported into the pybench.Setup module. pybench will then scan all the\nsymbols defined in that module for subclasses of pybench.Test and\nautomatically add them to the benchmark suite.\n\n\nBreaking Comparability\n----------------------\n\nIf a change is made to any individual test that means it is no\nlonger strictly comparable with previous runs, the '.version' class\nvariable should be updated. Therefafter, comparisons with previous\nversions of the test will list as \"n/a\" to reflect the change.\n\n\nVersion History\n---------------\n\n  2.0: rewrote parts of pybench which resulted in more repeatable\n       timings:\n        - made timer a parameter\n        - changed the platform default timer to use high-resolution\n          timers rather than process timers (which have a much lower\n          resolution)\n        - added option to select timer\n        - added process time timer (using systimes.py)\n        - changed to use min() as timing estimator (average\n          is still taken as well to provide an idea of the difference)\n        - garbage collection is turned off per default\n        - sys check interval is set to the highest possible value\n        - calibration is now a separate step and done using\n          a different strategy that allows measuring the test\n          overhead more accurately\n        - modified the tests to each give a run-time of between\n          100-200ms using warp 10\n        - changed default warp factor to 10 (from 20)\n        - compared results with timeit.py and confirmed measurements\n        - bumped all test versions to 2.0\n        - updated platform.py to the latest version\n        - changed the output format a bit to make it look\n          nicer\n        - refactored the APIs somewhat\n  1.3+: Steve Holden added the NewInstances test and the filtering \n       option during the NeedForSpeed sprint; this also triggered a long \n       discussion on how to improve benchmark timing and finally\n       resulted in the release of 2.0\n  1.3: initial checkin into the Python SVN repository\n\n\nHave fun,\n--\nMarc-Andre Lemburg\nmal@lemburg.com\n"
  },
  {
    "path": "tests/benchmarks/pybench/Setup.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Setup file for pybench\n#\n# This file has to import all tests to be run; it is executed as\n# Python source file, so you can do all kinds of manipulations here\n# rather than having to edit the tests themselves.\n#\n# Note: Please keep this module compatible to Python 1.5.2.\n#\n# Tests may include features in later Python versions, but these\n# should then be embedded in try-except clauses in this configuration\n# module.\n\n# Defaults\nNumber_of_rounds = 10\nWarp_factor = 10\n\n# Import tests\nfrom Arithmetic import *\nfrom Calls import *\nfrom Constructs import *\nfrom Lookups import *\nfrom Instances import *\ntry:\n    from NewInstances import *\nexcept ImportError:\n    pass\nfrom Lists import *\nfrom Tuples import *\nfrom Dict import *\nfrom Exceptions import *\ntry:\n    from With import *\nexcept SyntaxError:\n    pass\nfrom Imports import *\nfrom Strings import *\nfrom Numbers import *\ntry:\n    from Unicode import *\nexcept (ImportError, SyntaxError):\n    pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Strings.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\nfrom string import join\n\nclass ConcatStrings(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 100000\n\n    def test(self):\n\n        # Make sure the strings are *not* interned\n        s = join(map(str,range(100)))\n        t = join(map(str,range(1,101)))\n\n        for i in xrange(self.rounds):\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n    def calibrate(self):\n\n        s = join(map(str,range(100)))\n        t = join(map(str,range(1,101)))\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareStrings(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 200000\n\n    def test(self):\n\n        # Make sure the strings are *not* interned\n        s = join(map(str,range(10)))\n        t = join(map(str,range(10))) + \"abc\"\n\n        for i in xrange(self.rounds):\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n    def calibrate(self):\n\n        s = join(map(str,range(10)))\n        t = join(map(str,range(10))) + \"abc\"\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareInternedStrings(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 300000\n\n    def test(self):\n\n        # Make sure the strings *are* interned\n        s = intern(join(map(str,range(10))))\n        t = s\n\n        for i in xrange(self.rounds):\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n            t == s\n            t == s\n            t >= s\n            t > s\n            t < s\n\n    def calibrate(self):\n\n        s = intern(join(map(str,range(10))))\n        t = s\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CreateStringsWithConcat(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 200000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            s = 'om'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n            s = s + 'xax'\n            s = s + 'xbx'\n            s = s + 'xcx'\n            s = s + 'xdx'\n            s = s + 'xex'\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass StringSlicing(Test):\n\n    version = 2.0\n    operations = 5 * 7\n    rounds = 160000\n\n    def test(self):\n\n        s = join(map(str,range(100)))\n\n        for i in xrange(self.rounds):\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n    def calibrate(self):\n\n        s = join(map(str,range(100)))\n\n        for i in xrange(self.rounds):\n            pass\n\n### String methods\n\nif hasattr('', 'lower'):\n\n    class StringMappings(Test):\n\n        version = 2.0\n        operations = 3 * (5 + 4 + 2 + 1)\n        rounds = 70000\n\n        def test(self):\n\n            s = join(map(chr,range(20)),'')\n            t = join(map(chr,range(50)),'')\n            u = join(map(chr,range(100)),'')\n            v = join(map(chr,range(256)),'')\n\n            for i in xrange(self.rounds):\n\n                s.lower()\n                s.lower()\n                s.lower()\n                s.lower()\n                s.lower()\n\n                s.upper()\n                s.upper()\n                s.upper()\n                s.upper()\n                s.upper()\n\n                s.title()\n                s.title()\n                s.title()\n                s.title()\n                s.title()\n\n                t.lower()\n                t.lower()\n                t.lower()\n                t.lower()\n\n                t.upper()\n                t.upper()\n                t.upper()\n                t.upper()\n\n                t.title()\n                t.title()\n                t.title()\n                t.title()\n\n                u.lower()\n                u.lower()\n\n                u.upper()\n                u.upper()\n\n                u.title()\n                u.title()\n\n                v.lower()\n\n                v.upper()\n\n                v.title()\n\n        def calibrate(self):\n\n            s = join(map(chr,range(20)),'')\n            t = join(map(chr,range(50)),'')\n            u = join(map(chr,range(100)),'')\n            v = join(map(chr,range(256)),'')\n\n            for i in xrange(self.rounds):\n                pass\n\n    class StringPredicates(Test):\n\n        version = 2.0\n        operations = 10 * 7\n        rounds = 100000\n\n        def test(self):\n\n            data = ('abc', '123', '   ', '\\xe4\\xf6\\xfc', '\\xdf'*10)\n            len_data = len(data)\n\n            for i in xrange(self.rounds):\n                s = data[i % len_data]\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n                s.isalnum()\n                s.isalpha()\n                s.isdigit()\n                s.islower()\n                s.isspace()\n                s.istitle()\n                s.isupper()\n\n        def calibrate(self):\n\n            data = ('abc', '123', '   ', '\\u1234\\u2345\\u3456', '\\uFFFF'*10)\n            data = ('abc', '123', '   ', '\\xe4\\xf6\\xfc', '\\xdf'*10)\n            len_data = len(data)\n\n            for i in xrange(self.rounds):\n                s = data[i % len_data]\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Tuples.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom pybench import Test\n\nclass TupleSlicing(Test):\n\n    version = 2.0\n    operations = 3 * 25 * 10 * 7\n    rounds = 500\n\n    def test(self):\n\n        r = range(25)\n        t = tuple(range(100))\n\n        for i in xrange(self.rounds):\n\n            for j in r:\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n                m = t[50:]\n                m = t[:25]\n                m = t[50:55]\n                m = t[:-1]\n                m = t[1:]\n                m = t[-10:]\n                m = t[:10]\n\n    def calibrate(self):\n\n        r = range(25)\n        t = tuple(range(100))\n\n        for i in xrange(self.rounds):\n            for j in r:\n                pass\n\nclass SmallTuples(Test):\n\n    version = 2.0\n    operations = 5*(1 + 3 + 6 + 2)\n    rounds = 90000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n\n            t = (1,2,3,4,5,6)\n\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n\n            l = list(t)\n            t = tuple(l)\n\n            t = (1,2,3,4,5,6)\n\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n\n            l = list(t)\n            t = tuple(l)\n\n            t = (1,2,3,4,5,6)\n\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n\n            l = list(t)\n            t = tuple(l)\n\n            t = (1,2,3,4,5,6)\n\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n\n            l = list(t)\n            t = tuple(l)\n\n            t = (1,2,3,4,5,6)\n\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n            a,b,c,d,e,f = t\n\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n            a,b,c = t[:3]\n\n            l = list(t)\n            t = tuple(l)\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/Unicode.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ntry:\n    unicode\nexcept NameError:\n    raise ImportError\n\nfrom pybench import Test\nfrom string import join\n\nclass ConcatUnicode(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 60000\n\n    def test(self):\n\n        # Make sure the strings are *not* interned\n        s = unicode(join(map(str,range(100))))\n        t = unicode(join(map(str,range(1,101))))\n\n        for i in xrange(self.rounds):\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n            t + s\n            t + s\n            t + s\n            t + s\n            t + s\n\n    def calibrate(self):\n\n        s = unicode(join(map(str,range(100))))\n        t = unicode(join(map(str,range(1,101))))\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CompareUnicode(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 150000\n\n    def test(self):\n\n        # Make sure the strings are *not* interned\n        s = unicode(join(map(str,range(10))))\n        t = unicode(join(map(str,range(10))) + \"abc\")\n\n        for i in xrange(self.rounds):\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n            t < s\n            t > s\n            t == s\n            t > s\n            t < s\n\n    def calibrate(self):\n\n        s = unicode(join(map(str,range(10))))\n        t = unicode(join(map(str,range(10))) + \"abc\")\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass CreateUnicodeWithConcat(Test):\n\n    version = 2.0\n    operations = 10 * 5\n    rounds = 80000\n\n    def test(self):\n\n        for i in xrange(self.rounds):\n            s = u'om'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n            s = s + u'xax'\n            s = s + u'xbx'\n            s = s + u'xcx'\n            s = s + u'xdx'\n            s = s + u'xex'\n\n    def calibrate(self):\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass UnicodeSlicing(Test):\n\n    version = 2.0\n    operations = 5 * 7\n    rounds = 140000\n\n    def test(self):\n\n        s = unicode(join(map(str,range(100))))\n\n        for i in xrange(self.rounds):\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n            s[50:]\n            s[:25]\n            s[50:55]\n            s[-1:]\n            s[:1]\n            s[2:]\n            s[11:-11]\n\n    def calibrate(self):\n\n        s = unicode(join(map(str,range(100))))\n\n        for i in xrange(self.rounds):\n            pass\n\n### String methods\n\nclass UnicodeMappings(Test):\n\n    version = 2.0\n    operations = 3 * (5 + 4 + 2 + 1)\n    rounds = 10000\n\n    def test(self):\n\n        s = join(map(unichr,range(20)),'')\n        t = join(map(unichr,range(100)),'')\n        u = join(map(unichr,range(500)),'')\n        v = join(map(unichr,range(1000)),'')\n\n        for i in xrange(self.rounds):\n\n            s.lower()\n            s.lower()\n            s.lower()\n            s.lower()\n            s.lower()\n\n            s.upper()\n            s.upper()\n            s.upper()\n            s.upper()\n            s.upper()\n\n            s.title()\n            s.title()\n            s.title()\n            s.title()\n            s.title()\n\n            t.lower()\n            t.lower()\n            t.lower()\n            t.lower()\n\n            t.upper()\n            t.upper()\n            t.upper()\n            t.upper()\n\n            t.title()\n            t.title()\n            t.title()\n            t.title()\n\n            u.lower()\n            u.lower()\n\n            u.upper()\n            u.upper()\n\n            u.title()\n            u.title()\n\n            v.lower()\n\n            v.upper()\n\n            v.title()\n\n    def calibrate(self):\n\n        s = join(map(unichr,range(20)),'')\n        t = join(map(unichr,range(100)),'')\n        u = join(map(unichr,range(500)),'')\n        v = join(map(unichr,range(1000)),'')\n\n        for i in xrange(self.rounds):\n            pass\n\nclass UnicodePredicates(Test):\n\n    version = 2.0\n    operations = 5 * 9\n    rounds = 120000\n\n    def test(self):\n\n        data = (u'abc', u'123', u'   ', u'\\u1234\\u2345\\u3456', u'\\uFFFF'*10)\n        len_data = len(data)\n\n        for i in xrange(self.rounds):\n            s = data[i % len_data]\n\n            s.isalnum()\n            s.isalpha()\n            s.isdecimal()\n            s.isdigit()\n            s.islower()\n            s.isnumeric()\n            s.isspace()\n            s.istitle()\n            s.isupper()\n\n            s.isalnum()\n            s.isalpha()\n            s.isdecimal()\n            s.isdigit()\n            s.islower()\n            s.isnumeric()\n            s.isspace()\n            s.istitle()\n            s.isupper()\n\n            s.isalnum()\n            s.isalpha()\n            s.isdecimal()\n            s.isdigit()\n            s.islower()\n            s.isnumeric()\n            s.isspace()\n            s.istitle()\n            s.isupper()\n\n            s.isalnum()\n            s.isalpha()\n            s.isdecimal()\n            s.isdigit()\n            s.islower()\n            s.isnumeric()\n            s.isspace()\n            s.istitle()\n            s.isupper()\n\n            s.isalnum()\n            s.isalpha()\n            s.isdecimal()\n            s.isdigit()\n            s.islower()\n            s.isnumeric()\n            s.isspace()\n            s.istitle()\n            s.isupper()\n\n    def calibrate(self):\n\n        data = (u'abc', u'123', u'   ', u'\\u1234\\u2345\\u3456', u'\\uFFFF'*10)\n        len_data = len(data)\n\n        for i in xrange(self.rounds):\n            s = data[i % len_data]\n\ntry:\n    import unicodedata\nexcept ImportError:\n    pass\nelse:\n    class UnicodeProperties(Test):\n\n        version = 2.0\n        operations = 5 * 8\n        rounds = 100000\n\n        def test(self):\n\n            data = (u'a', u'1', u' ', u'\\u1234', u'\\uFFFF')\n            len_data = len(data)\n            digit = unicodedata.digit\n            numeric = unicodedata.numeric\n            decimal = unicodedata.decimal\n            category = unicodedata.category\n            bidirectional = unicodedata.bidirectional\n            decomposition = unicodedata.decomposition\n            mirrored = unicodedata.mirrored\n            combining = unicodedata.combining\n\n            for i in xrange(self.rounds):\n\n                c = data[i % len_data]\n\n                digit(c, None)\n                numeric(c, None)\n                decimal(c, None)\n                category(c)\n                bidirectional(c)\n                decomposition(c)\n                mirrored(c)\n                combining(c)\n\n                digit(c, None)\n                numeric(c, None)\n                decimal(c, None)\n                category(c)\n                bidirectional(c)\n                decomposition(c)\n                mirrored(c)\n                combining(c)\n\n                digit(c, None)\n                numeric(c, None)\n                decimal(c, None)\n                category(c)\n                bidirectional(c)\n                decomposition(c)\n                mirrored(c)\n                combining(c)\n\n                digit(c, None)\n                numeric(c, None)\n                decimal(c, None)\n                category(c)\n                bidirectional(c)\n                decomposition(c)\n                mirrored(c)\n                combining(c)\n\n                digit(c, None)\n                numeric(c, None)\n                decimal(c, None)\n                category(c)\n                bidirectional(c)\n                decomposition(c)\n                mirrored(c)\n                combining(c)\n\n        def calibrate(self):\n\n            data = (u'a', u'1', u' ', u'\\u1234', u'\\uFFFF')\n            len_data = len(data)\n            digit = unicodedata.digit\n            numeric = unicodedata.numeric\n            decimal = unicodedata.decimal\n            category = unicodedata.category\n            bidirectional = unicodedata.bidirectional\n            decomposition = unicodedata.decomposition\n            mirrored = unicodedata.mirrored\n            combining = unicodedata.combining\n\n            for i in xrange(self.rounds):\n\n                c = data[i % len_data]\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/With.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import with_statement\nfrom pybench import Test\n\nclass WithFinally(Test):\n\n    version = 2.0\n    operations = 20\n    rounds = 80000\n\n    class ContextManager(object):\n        def __enter__(self):\n            pass\n        def __exit__(self, exc, val, tb):\n            pass\n\n    def test(self):\n\n        cm = self.ContextManager()\n\n        for i in xrange(self.rounds):\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n            with cm: pass\n\n    def calibrate(self):\n\n        cm = self.ContextManager()\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass TryFinally(Test):\n\n    version = 2.0\n    operations = 20\n    rounds = 80000\n\n    class ContextManager(object):\n        def __enter__(self):\n            pass\n        def __exit__(self):\n            # \"Context manager\" objects used just for their cleanup\n            # actions in finally blocks usually don't have parameters.\n            pass\n\n    def test(self):\n\n        cm = self.ContextManager()\n\n        for i in xrange(self.rounds):\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n            cm.__enter__()\n            try: pass\n            finally: cm.__exit__()\n\n    def calibrate(self):\n\n        cm = self.ContextManager()\n\n        for i in xrange(self.rounds):\n            pass\n\n\nclass WithRaiseExcept(Test):\n\n    version = 2.0\n    operations = 2 + 3 + 3\n    rounds = 100000\n\n    class BlockExceptions(object):\n        def __enter__(self):\n            pass\n        def __exit__(self, exc, val, tb):\n            return True\n\n    def test(self):\n\n        error = ValueError\n        be = self.BlockExceptions()\n\n        for i in xrange(self.rounds):\n            with be: raise error\n            with be: raise error\n            with be: raise error,\"something\"\n            with be: raise error,\"something\"\n            with be: raise error,\"something\"\n            with be: raise error(\"something\")\n            with be: raise error(\"something\")\n            with be: raise error(\"something\")\n\n    def calibrate(self):\n\n        error = ValueError\n        be = self.BlockExceptions()\n\n        for i in xrange(self.rounds):\n            pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/clockres.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" clockres - calculates the resolution in seconds of a given timer.\n\n    Copyright (c) 2006, Marc-Andre Lemburg (mal@egenix.com). See the\n    documentation for further information on copyrights, or contact\n    the author. All Rights Reserved.\n\n\"\"\"\nimport time\n\nTEST_TIME = 1.0\n\ndef clockres(timer):\n    d = {}\n    wallclock = time.time\n    start = wallclock()\n    stop = wallclock() + TEST_TIME\n    spin_loops = range(1000)\n    while 1:\n        now = wallclock()\n        if now >= stop:\n            break\n        for i in spin_loops:\n            d[timer()] = 1\n    values = d.keys()\n    values.sort()\n    min_diff = TEST_TIME\n    for i in range(len(values) - 1):\n        diff = values[i+1] - values[i]\n        if diff < min_diff:\n            min_diff = diff\n    return min_diff\n\nif __name__ == '__main__':\n    print 'Clock resolution of various timer implementations:'\n    print 'time.clock:           %10.3fus' % (clockres(time.clock) * 1e6)\n    print 'time.time:            %10.3fus' % (clockres(time.time) * 1e6)\n    try:\n        import systimes\n        print 'systimes.processtime: %10.3fus' % (clockres(systimes.processtime) * 1e6)\n    except ImportError:\n        pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/package/submodule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/pybench.py",
    "content": "#!/usr/bin/python -O\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" A Python Benchmark Suite\n\n\"\"\"\n#\n# Note: Please keep this module compatible to Python 1.5.2.\n#\n# Tests may include features in later Python versions, but these\n# should then be embedded in try-except clauses in the configuration\n# module Setup.py.\n#\n\n# pybench Copyright\n__copyright__ = \"\"\"\\\nCopyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)\nCopyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)\n\n                   All Rights Reserved.\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee or royalty is hereby\ngranted, provided that the above copyright notice appear in all copies\nand that both that copyright notice and this permission notice appear\nin supporting documentation or portions thereof, including\nmodifications, that you make.\n\nTHE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO\nTHIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,\nINDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING\nFROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\nNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION\nWITH THE USE OR PERFORMANCE OF THIS SOFTWARE !\n\"\"\"\n\nimport sys, time, operator, string, platform\nfrom CommandLine import *\n\ntry:\n    import cPickle\n    pickle = cPickle\nexcept ImportError:\n    import pickle\n\n# Version number; version history: see README file !\n__version__ = '2.0'\n\n### Constants\n\n# Second fractions\nMILLI_SECONDS = 1e3\nMICRO_SECONDS = 1e6\n\n# Percent unit\nPERCENT = 100\n\n# Horizontal line length\nLINE = 79\n\n# Minimum test run-time\nMIN_TEST_RUNTIME = 1e-6\n\n# Number of calibration runs to use for calibrating the tests\nCALIBRATION_RUNS = 20\n\n# Number of calibration loops to run for each calibration run\nCALIBRATION_LOOPS = 20\n\n# Allow skipping calibration ?\nALLOW_SKIPPING_CALIBRATION = 1\n\n# Timer types\nTIMER_TIME_TIME = 'time.time'\nTIMER_TIME_CLOCK = 'time.clock'\nTIMER_SYSTIMES_PROCESSTIME = 'systimes.processtime'\n\n# Choose platform default timer\nif sys.platform[:3] == 'win':\n    # On WinXP this has 2.5ms resolution\n    TIMER_PLATFORM_DEFAULT = TIMER_TIME_CLOCK\nelse:\n    # On Linux this has 1ms resolution\n    TIMER_PLATFORM_DEFAULT = TIMER_TIME_TIME\n\n# Print debug information ?\n_debug = 0\n\n### Helpers\n\ndef get_timer(timertype):\n\n    if timertype == TIMER_TIME_TIME:\n        return time.time\n    elif timertype == TIMER_TIME_CLOCK:\n        return time.clock\n    elif timertype == TIMER_SYSTIMES_PROCESSTIME:\n        import systimes\n        return systimes.processtime\n    else:\n        raise TypeError('unknown timer type: %s' % timertype)\n\ndef get_machine_details():\n\n    if _debug:\n        print 'Getting machine details...'\n    buildno, builddate = platform.python_build()\n    python = platform.python_version()\n    try:\n        unichr(100000)\n    except ValueError:\n        # UCS2 build (standard)\n        unicode = 'UCS2'\n    except NameError:\n        unicode = None\n    else:\n        # UCS4 build (most recent Linux distros)\n        unicode = 'UCS4'\n    bits, linkage = platform.architecture()\n    return {\n        'platform': platform.platform(),\n        'processor': platform.processor(),\n        'executable': sys.executable,\n        'implementation': getattr(platform, 'python_implementation',\n                                  lambda:'n/a')(),\n        'python': platform.python_version(),\n        'compiler': platform.python_compiler(),\n        'buildno': buildno,\n        'builddate': builddate,\n        'unicode': unicode,\n        'bits': bits,\n        }\n\ndef print_machine_details(d, indent=''):\n\n    l = ['Machine Details:',\n         '   Platform ID:    %s' % d.get('platform', 'n/a'),\n         '   Processor:      %s' % d.get('processor', 'n/a'),\n         '',\n         'Python:',\n         '   Implementation: %s' % d.get('implementation', 'n/a'),\n         '   Executable:     %s' % d.get('executable', 'n/a'),\n         '   Version:        %s' % d.get('python', 'n/a'),\n         '   Compiler:       %s' % d.get('compiler', 'n/a'),\n         '   Bits:           %s' % d.get('bits', 'n/a'),\n         '   Build:          %s (#%s)' % (d.get('builddate', 'n/a'),\n                                          d.get('buildno', 'n/a')),\n         '   Unicode:        %s' % d.get('unicode', 'n/a'),\n         ]\n    print indent + string.join(l, '\\n' + indent) + '\\n'\n\n### Test baseclass\n\nclass Test:\n\n    \"\"\" All test must have this class as baseclass. It provides\n        the necessary interface to the benchmark machinery.\n\n        The tests must set .rounds to a value high enough to let the\n        test run between 20-50 seconds. This is needed because\n        clock()-timing only gives rather inaccurate values (on Linux,\n        for example, it is accurate to a few hundredths of a\n        second). If you don't want to wait that long, use a warp\n        factor larger than 1.\n\n        It is also important to set the .operations variable to a\n        value representing the number of \"virtual operations\" done per\n        call of .run().\n\n        If you change a test in some way, don't forget to increase\n        its version number.\n\n    \"\"\"\n\n    ### Instance variables that each test should override\n\n    # Version number of the test as float (x.yy); this is important\n    # for comparisons of benchmark runs - tests with unequal version\n    # number will not get compared.\n    version = 2.0\n\n    # The number of abstract operations done in each round of the\n    # test. An operation is the basic unit of what you want to\n    # measure. The benchmark will output the amount of run-time per\n    # operation. Note that in order to raise the measured timings\n    # significantly above noise level, it is often required to repeat\n    # sets of operations more than once per test round. The measured\n    # overhead per test round should be less than 1 second.\n    operations = 1\n\n    # Number of rounds to execute per test run. This should be\n    # adjusted to a figure that results in a test run-time of between\n    # 1-2 seconds.\n    rounds = 100000\n\n    ### Internal variables\n\n    # Mark this class as implementing a test\n    is_a_test = 1\n\n    # Last timing: (real, run, overhead)\n    last_timing = (0.0, 0.0, 0.0)\n\n    # Warp factor to use for this test\n    warp = 1\n\n    # Number of calibration runs to use\n    calibration_runs = CALIBRATION_RUNS\n\n    # List of calibration timings\n    overhead_times = None\n\n    # List of test run timings\n    times = []\n\n    # Timer used for the benchmark\n    timer = TIMER_PLATFORM_DEFAULT\n\n    def __init__(self, warp=None, calibration_runs=None, timer=None):\n\n        # Set parameters\n        if warp is not None:\n            self.rounds = int(self.rounds / warp)\n            if self.rounds == 0:\n                raise ValueError('warp factor set too high')\n            self.warp = warp\n        if calibration_runs is not None:\n            if (not ALLOW_SKIPPING_CALIBRATION and\n                calibration_runs < 1):\n                raise ValueError('at least one calibration run is required')\n            self.calibration_runs = calibration_runs\n        if timer is not None:\n            self.timer = timer\n\n        # Init variables\n        self.times = []\n        self.overhead_times = []\n\n        # We want these to be in the instance dict, so that pickle\n        # saves them\n        self.version = self.version\n        self.operations = self.operations\n        self.rounds = self.rounds\n\n    def get_timer(self):\n\n        \"\"\" Return the timer function to use for the test.\n\n        \"\"\"\n        return get_timer(self.timer)\n\n    def compatible(self, other):\n\n        \"\"\" Return 1/0 depending on whether the test is compatible\n            with the other Test instance or not.\n\n        \"\"\"\n        if self.version != other.version:\n            return 0\n        if self.rounds != other.rounds:\n            return 0\n        return 1\n\n    def calibrate_test(self):\n\n        if self.calibration_runs == 0:\n            self.overhead_times = [0.0]\n            return\n\n        calibrate = self.calibrate\n        timer = self.get_timer()\n        calibration_loops = range(CALIBRATION_LOOPS)\n\n        # Time the calibration loop overhead\n        prep_times = []\n        for i in range(self.calibration_runs):\n            t = timer()\n            for i in calibration_loops:\n                pass\n            t = timer() - t\n            prep_times.append(t)\n        min_prep_time = min(prep_times)\n        if _debug:\n            print\n            print 'Calib. prep time     = %.6fms' % (\n                min_prep_time * MILLI_SECONDS)\n\n        # Time the calibration runs (doing CALIBRATION_LOOPS loops of\n        # .calibrate() method calls each)\n        for i in range(self.calibration_runs):\n            t = timer()\n            for i in calibration_loops:\n                calibrate()\n            t = timer() - t\n            self.overhead_times.append(t / CALIBRATION_LOOPS\n                                       - min_prep_time)\n\n        # Check the measured times\n        min_overhead = min(self.overhead_times)\n        max_overhead = max(self.overhead_times)\n        if _debug:\n            print 'Calib. overhead time = %.6fms' % (\n                min_overhead * MILLI_SECONDS)\n        if min_overhead < 0.0:\n            raise ValueError('calibration setup did not work')\n        if max_overhead - min_overhead > 0.1:\n            raise ValueError(\n                'overhead calibration timing range too inaccurate: '\n                '%r - %r' % (min_overhead, max_overhead))\n\n    def run(self):\n\n        \"\"\" Run the test in two phases: first calibrate, then\n            do the actual test. Be careful to keep the calibration\n            timing low w/r to the test timing.\n\n        \"\"\"\n        test = self.test\n        timer = self.get_timer()\n\n        # Get calibration\n        min_overhead = min(self.overhead_times)\n\n        # Test run\n        t = timer()\n        test()\n        t = timer() - t\n        if t < MIN_TEST_RUNTIME:\n            raise ValueError('warp factor too high: '\n                             'test times are < 10ms', t, MIN_TEST_RUNTIME,test)\n        eff_time = t - min_overhead\n        if eff_time < 0:\n            eff_time = 0\n            # raise ValueError('wrong calibration')\n        self.last_timing = (eff_time, t, min_overhead)\n        self.times.append(eff_time)\n\n    def calibrate(self):\n\n        \"\"\" Calibrate the test.\n\n            This method should execute everything that is needed to\n            setup and run the test - except for the actual operations\n            that you intend to measure. pybench uses this method to\n            measure the test implementation overhead.\n\n        \"\"\"\n        return\n\n    def test(self):\n\n        \"\"\" Run the test.\n\n            The test needs to run self.rounds executing\n            self.operations number of operations each.\n\n        \"\"\"\n        return\n\n    def stat(self):\n\n        \"\"\" Return test run statistics as tuple:\n\n            (minimum run time,\n             average run time,\n             total run time,\n             average time per operation,\n             minimum overhead time)\n\n        \"\"\"\n        runs = len(self.times)\n        if runs == 0:\n            return 0.0, 0.0, 0.0, 0.0\n        min_time = min(self.times)\n        total_time = reduce(operator.add, self.times, 0.0)\n        avg_time = total_time / float(runs)\n        operation_avg = total_time / float(runs\n                                           * self.rounds\n                                           * self.operations)\n        if self.overhead_times:\n            min_overhead = min(self.overhead_times)\n        else:\n            min_overhead = self.last_timing[2]\n        return min_time, avg_time, total_time, operation_avg, min_overhead\n\n### Load Setup\n\n# This has to be done after the definition of the Test class, since\n# the Setup module will import subclasses using this class.\n\nimport Setup\n\n### Benchmark base class\n\nclass Benchmark:\n\n    # Name of the benchmark\n    name = ''\n\n    # Number of benchmark rounds to run\n    rounds = 1\n\n    # Warp factor use to run the tests\n    warp = 1                    # Warp factor\n\n    # Average benchmark round time\n    roundtime = 0\n\n    # Benchmark version number as float x.yy\n    version = 2.0\n\n    # Produce verbose output ?\n    verbose = 0\n\n    # Dictionary with the machine details\n    machine_details = None\n\n    # Timer used for the benchmark\n    timer = TIMER_PLATFORM_DEFAULT\n\n    def __init__(self, name, verbose=None, timer=None, warp=None,\n                 calibration_runs=None):\n\n        if name:\n            self.name = name\n        else:\n            self.name = '%04i-%02i-%02i %02i:%02i:%02i' % \\\n                        (time.localtime(time.time())[:6])\n        if verbose is not None:\n            self.verbose = verbose\n        if timer is not None:\n            self.timer = timer\n        if warp is not None:\n            self.warp = warp\n        if calibration_runs is not None:\n            self.calibration_runs = calibration_runs\n\n        # Init vars\n        self.tests = {}\n        if _debug:\n            print 'Getting machine details...'\n        self.machine_details = get_machine_details()\n\n        # Make .version an instance attribute to have it saved in the\n        # Benchmark pickle\n        self.version = self.version\n\n    def get_timer(self):\n\n        \"\"\" Return the timer function to use for the test.\n\n        \"\"\"\n        return get_timer(self.timer)\n\n    def compatible(self, other):\n\n        \"\"\" Return 1/0 depending on whether the benchmark is\n            compatible with the other Benchmark instance or not.\n\n        \"\"\"\n        if self.version != other.version:\n            return 0\n        if (self.machine_details == other.machine_details and\n            self.timer != other.timer):\n            return 0\n        if (self.calibration_runs == 0 and\n            other.calibration_runs != 0):\n            return 0\n        if (self.calibration_runs != 0 and\n            other.calibration_runs == 0):\n            return 0\n        return 1\n\n    def load_tests(self, setupmod, limitnames=None):\n\n        # Add tests\n        if self.verbose:\n            print 'Searching for tests ...'\n            print '--------------------------------------'\n        for testclass in setupmod.__dict__.values():\n            if not hasattr(testclass, 'is_a_test'):\n                continue\n            name = testclass.__name__\n            if  name == 'Test':\n                continue\n            if (limitnames is not None and\n                limitnames.search(name) is None):\n                continue\n            self.tests[name] = testclass(\n                warp=self.warp,\n                calibration_runs=self.calibration_runs,\n                timer=self.timer)\n        l = self.tests.keys()\n        l.sort()\n        if self.verbose:\n            for name in l:\n                print '  %s' % name\n            print '--------------------------------------'\n            print '  %i tests found' % len(l)\n            print\n\n    def calibrate(self):\n\n        print 'Calibrating tests. Please wait...',\n        sys.stdout.flush()\n        if self.verbose:\n            print\n            print\n            print 'Test                              min      max'\n            print '-' * LINE\n        tests = self.tests.items()\n        tests.sort()\n        for i in range(len(tests)):\n            name, test = tests[i]\n            test.calibrate_test()\n            if self.verbose:\n                print '%30s:  %6.3fms  %6.3fms' % \\\n                      (name,\n                       min(test.overhead_times) * MILLI_SECONDS,\n                       max(test.overhead_times) * MILLI_SECONDS)\n        if self.verbose:\n            print\n            print 'Done with the calibration.'\n        else:\n            print 'done.'\n        print\n\n    def run(self):\n\n        tests = self.tests.items()\n        tests.sort()\n        timer = self.get_timer()\n        print 'Running %i round(s) of the suite at warp factor %i:' % \\\n              (self.rounds, self.warp)\n        print\n        self.roundtimes = []\n        for i in range(self.rounds):\n            if self.verbose:\n                print ' Round %-25i  effective   absolute  overhead' % (i+1)\n            total_eff_time = 0.0\n            for j in range(len(tests)):\n                name, test = tests[j]\n                if self.verbose:\n                    print '%30s:' % name,\n                test.run()\n                (eff_time, abs_time, min_overhead) = test.last_timing\n                total_eff_time = total_eff_time + eff_time\n                if self.verbose:\n                    print '    %5.0fms    %5.0fms %7.3fms' % \\\n                          (eff_time * MILLI_SECONDS,\n                           abs_time * MILLI_SECONDS,\n                           min_overhead * MILLI_SECONDS)\n            self.roundtimes.append(total_eff_time)\n            if self.verbose:\n                print ('                   '\n                       '               ------------------------------')\n                print ('                   '\n                       '     Totals:    %6.0fms' %\n                       (total_eff_time * MILLI_SECONDS))\n                print\n            else:\n                print '* Round %i done in %.3f seconds.' % (i+1,\n                                                            total_eff_time)\n        print\n\n    def stat(self):\n\n        \"\"\" Return benchmark run statistics as tuple:\n\n            (minimum round time,\n             average round time,\n             maximum round time)\n\n            XXX Currently not used, since the benchmark does test\n                statistics across all rounds.\n\n        \"\"\"\n        runs = len(self.roundtimes)\n        if runs == 0:\n            return 0.0, 0.0\n        min_time = min(self.roundtimes)\n        total_time = reduce(operator.add, self.roundtimes, 0.0)\n        avg_time = total_time / float(runs)\n        max_time = max(self.roundtimes)\n        return (min_time, avg_time, max_time)\n\n    def print_header(self, title='Benchmark'):\n\n        print '-' * LINE\n        print '%s: %s' % (title, self.name)\n        print '-' * LINE\n        print\n        print '    Rounds: %s' % self.rounds\n        print '    Warp:   %s' % self.warp\n        print '    Timer:  %s' % self.timer\n        print\n        if self.machine_details:\n            print_machine_details(self.machine_details, indent='    ')\n            print\n\n    def print_benchmark(self, hidenoise=0, limitnames=None):\n\n        print ('Test                          '\n               '   minimum  average  operation  overhead')\n        print '-' * LINE\n        tests = self.tests.items()\n        tests.sort()\n        total_min_time = 0.0\n        total_avg_time = 0.0\n        for name, test in tests:\n            if (limitnames is not None and\n                limitnames.search(name) is None):\n                continue\n            (min_time,\n             avg_time,\n             total_time,\n             op_avg,\n             min_overhead) = test.stat()\n            total_min_time = total_min_time + min_time\n            total_avg_time = total_avg_time + avg_time\n            print '%30s:  %5.01fms  %5.01fms  %6.2fus  %7.3fms' % \\\n                  (name,\n                   min_time * MILLI_SECONDS,\n                   avg_time * MILLI_SECONDS,\n                   op_avg * MICRO_SECONDS,\n                   min_overhead *MILLI_SECONDS)\n        print '-' * LINE\n        print ('Totals:                        '\n               ' %6.01fms %6.01fms' %\n               (total_min_time * MILLI_SECONDS,\n                total_avg_time * MILLI_SECONDS,\n                ))\n        print\n\n    def print_comparison(self, compare_to, hidenoise=0, limitnames=None, regression_only=False):\n        # Check benchmark versions\n        if compare_to.version != self.version:\n            print ('* Benchmark versions differ: '\n                   'cannot compare this benchmark to \"%s\" !' %\n                   compare_to.name)\n            print\n            self.print_benchmark(hidenoise=hidenoise,\n                                 limitnames=limitnames)\n            return\n\n        # Print header\n        compare_to.print_header('Comparing with')\n        print ('Test                          '\n               '   minimum run-time        average  run-time')\n        print ('                              '\n               '   this    other   diff    this    other   diff')\n        print '-' * LINE\n\n        # Print test comparisons\n        tests = self.tests.items()\n        tests.sort()\n        total_min_time = other_total_min_time = 0.0\n        total_avg_time = other_total_avg_time = 0.0\n        benchmarks_compatible = self.compatible(compare_to)\n        tests_compatible = 1\n        for name, test in tests:\n            if (limitnames is not None and\n                limitnames.search(name) is None):\n                continue\n            (min_time,\n             avg_time,\n             total_time,\n             op_avg,\n             min_overhead) = test.stat()\n            total_min_time = total_min_time + min_time\n            total_avg_time = total_avg_time + avg_time\n            try:\n                other = compare_to.tests[name]\n            except KeyError:\n                other = None\n            if other is None:\n                # Other benchmark doesn't include the given test\n                min_diff, avg_diff = 'n/a', 'n/a'\n                other_min_time = 0.0\n                other_avg_time = 0.0\n                tests_compatible = 0\n            else:\n                (other_min_time,\n                 other_avg_time,\n                 other_total_time,\n                 other_op_avg,\n                 other_min_overhead) = other.stat()\n                other_total_min_time = other_total_min_time + other_min_time\n                other_total_avg_time = other_total_avg_time + other_avg_time\n                if (benchmarks_compatible and\n                    test.compatible(other)):\n                    # Both benchmark and tests are comparible\n                    try:\n                        min_diff = ((min_time * self.warp) /\n                                    (other_min_time * other.warp) - 1.0)\n                    except ZeroDivisionError:\n                        min_diff = float(\"inf\")\n\n                    try:\n                        avg_diff = ((avg_time * self.warp) /\n                                    (other_avg_time * other.warp) - 1.0)\n                    except ZeroDivisionError:\n                        avg_diff = float(\"inf\")\n\n                    display_it = min_diff < 0.0\n\n                    if hidenoise and abs(min_diff) < 10.0:\n                        min_diff = ''\n                    else:\n                        min_diff = '%+5.1f%%' % (min_diff * PERCENT)\n                    if hidenoise and abs(avg_diff) < 10.0:\n                        avg_diff = ''\n                    else:\n                        avg_diff = '%+5.1f%%' % (avg_diff * PERCENT)\n                else:\n                    # Benchmark or tests are not comparible\n                    min_diff, avg_diff = 'n/a', 'n/a'\n                    tests_compatible = 0\n\n                    display_it = True\n\n            if display_it or not regression_only:\n                print '%30s: %5.01fms %5.01fms %7s %5.01fms %5.01fms %7s' % \\\n                      (name,\n                       min_time * MILLI_SECONDS,\n                       other_min_time * MILLI_SECONDS * compare_to.warp / self.warp,\n                       min_diff,\n                       avg_time * MILLI_SECONDS,\n                       other_avg_time * MILLI_SECONDS * compare_to.warp / self.warp,\n                       avg_diff)\n        print '-' * LINE\n\n        # Summarise test results\n        if not benchmarks_compatible or not tests_compatible:\n            min_diff, avg_diff = 'n/a', 'n/a'\n        else:\n            if other_total_min_time != 0.0:\n                min_diff = '%+5.1f%%' % (\n                    ((total_min_time * self.warp) /\n                     (other_total_min_time * compare_to.warp) - 1.0) * PERCENT)\n            else:\n                min_diff = 'n/a'\n            if other_total_avg_time != 0.0:\n                avg_diff = '%+5.1f%%' % (\n                    ((total_avg_time * self.warp) /\n                     (other_total_avg_time * compare_to.warp) - 1.0) * PERCENT)\n            else:\n                avg_diff = 'n/a'\n\n        print ('Totals:                       '\n               '  %5.01fms %5.01fms %7s %5.01fms %5.01fms %7s' %\n               (total_min_time * MILLI_SECONDS,\n                (other_total_min_time * compare_to.warp/self.warp\n                 * MILLI_SECONDS),\n                min_diff,\n                total_avg_time * MILLI_SECONDS,\n                (other_total_avg_time * compare_to.warp/self.warp\n                 * MILLI_SECONDS),\n                avg_diff\n               ))\n        print\n        print '(this=%s, other=%s)' % (self.name,\n                                       compare_to.name)\n        print\n\nclass PyBenchCmdline(Application):\n\n    header = (\"PYBENCH - a benchmark test suite for Python \"\n              \"interpreters/compilers.\")\n\n    version = __version__\n\n    debug = _debug\n\n    options = [ArgumentOption('-n',\n                              'number of rounds',\n                              Setup.Number_of_rounds),\n               ArgumentOption('-f',\n                              'save benchmark to file arg',\n                              ''),\n               ArgumentOption('-c',\n                              'compare benchmark with the one in file arg',\n                              ''),\n               ArgumentOption('-s',\n                              'show benchmark in file arg, then exit',\n                              ''),\n               SwitchOption('-r',\n                              'show regressions in comparisons only',\n                              0),\n               ArgumentOption('-w',\n                              'set warp factor to arg',\n                              Setup.Warp_factor),\n               ArgumentOption('-t',\n                              'run only tests with names matching arg',\n                              ''),\n               ArgumentOption('-C',\n                              'set the number of calibration runs to arg',\n                              CALIBRATION_RUNS),\n               SwitchOption('-d',\n                            'hide noise in comparisons',\n                            0),\n               SwitchOption('-v',\n                            'verbose output (not recommended)',\n                            0),\n               SwitchOption('--with-gc',\n                            'enable garbage collection',\n                            0),\n               SwitchOption('--with-syscheck',\n                            'use default sys check interval',\n                            0),\n               ArgumentOption('--timer',\n                            'use given timer',\n                            TIMER_PLATFORM_DEFAULT),\n               ]\n\n    about = \"\"\"\\\nThe normal operation is to run the suite and display the\nresults. Use -f to save them for later reuse or comparisons.\n\nAvailable timers:\n\n   time.time\n   time.clock\n   systimes.processtime\n\nExamples:\n\npython2.1 pybench.py -f p21.pybench\npython2.5 pybench.py -f p25.pybench\npython pybench.py -s p25.pybench -c p21.pybench\n\"\"\"\n    copyright = __copyright__\n\n    def main(self):\n\n        rounds = self.values['-n']\n        reportfile = self.values['-f']\n        show_bench = self.values['-s']\n        regression_only = self.values['-r']\n        compare_to = self.values['-c']\n        hidenoise = self.values['-d']\n        warp = int(self.values['-w'])\n        withgc = self.values['--with-gc']\n        limitnames = self.values['-t']\n        if limitnames:\n            if _debug:\n                print '* limiting test names to one with substring \"%s\"' % \\\n                      limitnames\n            limitnames = re.compile(limitnames, re.I)\n        else:\n            limitnames = None\n        verbose = self.verbose\n        withsyscheck = self.values['--with-syscheck']\n        calibration_runs = self.values['-C']\n        timer = self.values['--timer']\n\n        print '-' * LINE\n        print 'PYBENCH %s' % __version__\n        print '-' * LINE\n        print '* using %s %s' % (\n            getattr(platform, 'python_implementation', lambda:'Python')(),\n            string.join(string.split(sys.version), ' '))\n\n        # Switch off garbage collection\n        if not withgc:\n            try:\n                import gc\n            except ImportError:\n                print '* Python version doesn\\'t support garbage collection'\n            else:\n                try:\n                    gc.disable()\n                except NotImplementedError:\n                    print '* Python version doesn\\'t support gc.disable'\n                else:\n                    print '* disabled garbage collection'\n\n        # \"Disable\" sys check interval\n        if not withsyscheck:\n            # Too bad the check interval uses an int instead of a long...\n            value = 2147483647\n            try:\n                sys.setcheckinterval(value)\n            except (AttributeError, NotImplementedError):\n                print '* Python version doesn\\'t support sys.setcheckinterval'\n            else:\n                print '* system check interval set to maximum: %s' % value\n\n        if timer == TIMER_SYSTIMES_PROCESSTIME:\n            import systimes\n            print '* using timer: systimes.processtime (%s)' % \\\n                  systimes.SYSTIMES_IMPLEMENTATION\n        else:\n            print '* using timer: %s' % timer\n\n        print\n\n        if compare_to:\n            try:\n                f = open(compare_to,'rb')\n                bench = pickle.load(f)\n                bench.name = compare_to\n                f.close()\n                compare_to = bench\n            except IOError, reason:\n                print '* Error opening/reading file %s: %s' % (\n                    repr(compare_to),\n                    reason)\n                compare_to = None\n\n        if show_bench:\n            try:\n                f = open(show_bench,'rb')\n                bench = pickle.load(f)\n                bench.name = show_bench\n                f.close()\n                bench.print_header()\n                if compare_to:\n                    bench.print_comparison(compare_to,\n                                           hidenoise=hidenoise,\n                                           regression_only=regression_only,\n                                           limitnames=limitnames)\n                else:\n                    bench.print_benchmark(hidenoise=hidenoise,\n                                          limitnames=limitnames)\n            except IOError, reason:\n                print '* Error opening/reading file %s: %s' % (\n                    repr(show_bench),\n                    reason)\n                print\n            return\n\n        if reportfile:\n            print 'Creating benchmark: %s (rounds=%i, warp=%i)' % \\\n                  (reportfile, rounds, warp)\n            print\n\n        # Create benchmark object\n        bench = Benchmark(reportfile,\n                          verbose=verbose,\n                          timer=timer,\n                          warp=warp,\n                          calibration_runs=calibration_runs)\n        bench.rounds = rounds\n        bench.load_tests(Setup, limitnames=limitnames)\n        try:\n            bench.calibrate()\n            bench.run()\n        except KeyboardInterrupt:\n            print\n            print '*** KeyboardInterrupt -- Aborting'\n            print\n            return\n        bench.print_header()\n        if compare_to:\n            bench.print_comparison(compare_to,\n                                   hidenoise=hidenoise,\n                                   regression_only=regression_only,\n                                   limitnames=limitnames)\n        else:\n            bench.print_benchmark(hidenoise=hidenoise,\n                                  limitnames=limitnames)\n\n        # Ring bell\n        sys.stderr.write('\\007')\n\n        if reportfile:\n            try:\n                f = open(reportfile,'wb')\n                bench.name = reportfile\n                pickle.dump(bench,f)\n                f.close()\n            except IOError, reason:\n                print '* Error opening/writing reportfile'\n            except IOError, reason:\n                print '* Error opening/writing reportfile %s: %s' % (\n                    reportfile,\n                    reason)\n                print\n\nif __name__ == '__main__':\n    PyBenchCmdline()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pybench/systimes.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" systimes() user and system timer implementations for use by\n    pybench.\n\n    This module implements various different strategies for measuring\n    performance timings. It tries to choose the best available method\n    based on the platform and available tools.\n\n    On Windows, it is recommended to have the Mark Hammond win32\n    package installed. Alternatively, the Thomas Heller ctypes\n    packages can also be used.\n\n    On Unix systems, the standard resource module provides the highest\n    resolution timings. Unfortunately, it is not available on all Unix\n    platforms.\n\n    If no supported timing methods based on process time can be found,\n    the module reverts to the highest resolution wall-clock timer\n    instead. The system time part will then always be 0.0.\n\n    The module exports one public API:\n\n    def systimes():\n\n        Return the current timer values for measuring user and system\n        time as tuple of seconds (user_time, system_time).\n\n    Copyright (c) 2006, Marc-Andre Lemburg (mal@egenix.com). See the\n    documentation for further information on copyrights, or contact\n    the author. All Rights Reserved.\n\n\"\"\"\nimport time, sys\n\n#\n# Note: Please keep this module compatible to Python 1.5.2.\n#\n# TODOs:\n#\n# * Add ctypes wrapper for new clock_gettime() real-time POSIX APIs;\n#   these will then provide nano-second resolution where available.\n#\n# * Add a function that returns the resolution of systimes()\n#   values, ie. systimesres().\n#\n\n### Choose an implementation\n\nSYSTIMES_IMPLEMENTATION = None\nUSE_CTYPES_GETPROCESSTIMES = 'ctypes GetProcessTimes() wrapper'\nUSE_WIN32PROCESS_GETPROCESSTIMES = 'win32process.GetProcessTimes()'\nUSE_RESOURCE_GETRUSAGE = 'resource.getrusage()'\nUSE_PROCESS_TIME_CLOCK = 'time.clock() (process time)'\nUSE_WALL_TIME_CLOCK = 'time.clock() (wall-clock)'\nUSE_WALL_TIME_TIME = 'time.time() (wall-clock)'\n\nif sys.platform[:3] == 'win':\n    # Windows platform\n    try:\n        import win32process\n    except ImportError:\n        try:\n            import ctypes\n        except ImportError:\n            # Use the wall-clock implementation time.clock(), since this\n            # is the highest resolution clock available on Windows\n            SYSTIMES_IMPLEMENTATION = USE_WALL_TIME_CLOCK\n        else:\n            SYSTIMES_IMPLEMENTATION = USE_CTYPES_GETPROCESSTIMES\n    else:\n        SYSTIMES_IMPLEMENTATION = USE_WIN32PROCESS_GETPROCESSTIMES\nelse:\n    # All other platforms\n    try:\n        import resource\n    except ImportError:\n        pass\n    else:\n        SYSTIMES_IMPLEMENTATION = USE_RESOURCE_GETRUSAGE\n\n# Fall-back solution\nif SYSTIMES_IMPLEMENTATION is None:\n    # Check whether we can use time.clock() as approximation\n    # for systimes()\n    start = time.clock()\n    time.sleep(0.1)\n    stop = time.clock()\n    if stop - start < 0.001:\n        # Looks like time.clock() is usable (and measures process\n        # time)\n        SYSTIMES_IMPLEMENTATION = USE_PROCESS_TIME_CLOCK\n    else:\n        # Use wall-clock implementation time.time() since this provides\n        # the highest resolution clock on most systems\n        SYSTIMES_IMPLEMENTATION = USE_WALL_TIME_TIME\n\n### Implementations\n\ndef getrusage_systimes():\n    return resource.getrusage(resource.RUSAGE_SELF)[:2]\n\ndef process_time_clock_systimes():\n    return (time.clock(), 0.0)\n\ndef wall_clock_clock_systimes():\n    return (time.clock(), 0.0)\n\ndef wall_clock_time_systimes():\n    return (time.time(), 0.0)\n\n# Number of clock ticks per second for the values returned\n# by GetProcessTimes() on Windows.\n#\n# Note: Ticks returned by GetProcessTimes() are 100ns intervals on\n# Windows XP. However, the process times are only updated with every\n# clock tick and the frequency of these is somewhat lower: depending\n# on the OS version between 10ms and 15ms. Even worse, the process\n# time seems to be allocated to process currently running when the\n# clock interrupt arrives, ie. it is possible that the current time\n# slice gets accounted to a different process.\n\nWIN32_PROCESS_TIMES_TICKS_PER_SECOND = 1e7\n\ndef win32process_getprocesstimes_systimes():\n    d = win32process.GetProcessTimes(win32process.GetCurrentProcess())\n    return (d['UserTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,\n            d['KernelTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)\n\ndef ctypes_getprocesstimes_systimes():\n    creationtime = ctypes.c_ulonglong()\n    exittime = ctypes.c_ulonglong()\n    kerneltime = ctypes.c_ulonglong()\n    usertime = ctypes.c_ulonglong()\n    rc = ctypes.windll.kernel32.GetProcessTimes(\n        ctypes.windll.kernel32.GetCurrentProcess(),\n        ctypes.byref(creationtime),\n        ctypes.byref(exittime),\n        ctypes.byref(kerneltime),\n        ctypes.byref(usertime))\n    if not rc:\n        raise TypeError('GetProcessTimes() returned an error')\n    return (usertime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,\n            kerneltime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)\n\n# Select the default for the systimes() function\n\nif SYSTIMES_IMPLEMENTATION is USE_RESOURCE_GETRUSAGE:\n    systimes = getrusage_systimes\n\nelif SYSTIMES_IMPLEMENTATION is USE_PROCESS_TIME_CLOCK:\n    systimes = process_time_clock_systimes\n\nelif SYSTIMES_IMPLEMENTATION is USE_WALL_TIME_CLOCK:\n    systimes = wall_clock_clock_systimes\n\nelif SYSTIMES_IMPLEMENTATION is USE_WALL_TIME_TIME:\n    systimes = wall_clock_time_systimes\n\nelif SYSTIMES_IMPLEMENTATION is USE_WIN32PROCESS_GETPROCESSTIMES:\n    systimes = win32process_getprocesstimes_systimes\n\nelif SYSTIMES_IMPLEMENTATION is USE_CTYPES_GETPROCESSTIMES:\n    systimes = ctypes_getprocesstimes_systimes\n\nelse:\n    raise TypeError('no suitable systimes() implementation found')\n\ndef processtime():\n\n    \"\"\" Return the total time spent on the process.\n\n        This is the sum of user and system time as returned by\n        systimes().\n\n    \"\"\"\n    user, system = systimes()\n    return user + system\n\n### Testing\n\ndef some_workload():\n    x = 0L\n    for i in xrange(10000000L):\n        x = x + 1L\n\ndef test_workload():\n    print 'Testing systimes() under load conditions'\n    t0 = systimes()\n    some_workload()\n    t1 = systimes()\n    print 'before:', t0\n    print 'after:', t1\n    print 'differences:', (t1[0] - t0[0], t1[1] - t0[1])\n    print\n\ndef test_idle():\n    print 'Testing systimes() under idle conditions'\n    t0 = systimes()\n    time.sleep(1)\n    t1 = systimes()\n    print 'before:', t0\n    print 'after:', t1\n    print 'differences:', (t1[0] - t0[0], t1[1] - t0[1])\n    print\n\nif __name__ == '__main__':\n    print 'Using %s as timer' % SYSTIMES_IMPLEMENTATION\n    print\n    test_workload()\n    test_idle()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pystone.py",
    "content": "#! /usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\n\"PYSTONE\" Benchmark Program\n\nVersion:        Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)\n\nAuthor:         Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013.\n\n                Translated from ADA to C by Rick Richardson.\n                Every method to preserve ADA-likeness has been used,\n                at the expense of C-ness.\n\n                Translated from C to Python by Guido van Rossum.\n\nVersion History:\n\n                Version 1.1 corrects two bugs in version 1.0:\n\n                First, it leaked memory: in Proc1(), NextRecord ends\n                up having a pointer to itself.  I have corrected this\n                by zapping NextRecord.PtrComp at the end of Proc1().\n\n                Second, Proc3() used the operator != to compare a\n                record to None.  This is rather inefficient and not\n                true to the intention of the original benchmark (where\n                a pointer comparison to None is intended; the !=\n                operator attempts to find a method __cmp__ to do value\n                comparison of the record).  Version 1.1 runs 5-10\n                percent faster than version 1.0, so benchmark figures\n                of different versions can't be compared directly.\n\n\"\"\"\nfrom time import clock\n\nLOOPS = 50000\n\n\n__version__ = \"1.1\"\n\n[Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)\n\nclass Record:\n\n    def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,\n                       IntComp = 0, StringComp = 0):\n        self.PtrComp = PtrComp\n        self.Discr = Discr\n        self.EnumComp = EnumComp\n        self.IntComp = IntComp\n        self.StringComp = StringComp\n\n    def copy(self):\n        return Record(self.PtrComp, self.Discr, self.EnumComp,\n                      self.IntComp, self.StringComp)\n\nTRUE = 1\nFALSE = 0\n\ndef main(loops = LOOPS):\n    benchtime, stones = pystones(loops)\n\n    import os\n    if int(os.environ.get(\"BENCH\", \"0\")):\n        print(\"%.2f\" % stones)\n    else:\n        print \"Pystone(%s) time for %d passes = %g\" % \\\n            (__version__, loops, benchtime)\n        print \"This machine benchmarks at %g pystones/second\" % stones\n\n\ndef pystones(loops = LOOPS):\n    return Proc0(loops)\n\nIntGlob = 0\nBoolGlob = FALSE\nChar1Glob = '\\0'\nChar2Glob = '\\0'\nArray1Glob = [0]*51\nArray2Glob = map(lambda x: x[:], [Array1Glob]*51)\nPtrGlb = None\nPtrGlbNext = None\n\ndef Proc0(loops = LOOPS):\n    global IntGlob\n    global BoolGlob\n    global Char1Glob\n    global Char2Glob\n    global Array1Glob\n    global Array2Glob\n    global PtrGlb\n    global PtrGlbNext\n\n    starttime = clock()\n    for i in range(loops):\n        pass\n    nulltime = clock() - starttime\n\n    PtrGlbNext = Record()\n    PtrGlb = Record()\n    PtrGlb.PtrComp = PtrGlbNext\n    PtrGlb.Discr = Ident1\n    PtrGlb.EnumComp = Ident3\n    PtrGlb.IntComp = 40\n    PtrGlb.StringComp = \"DHRYSTONE PROGRAM, SOME STRING\"\n    String1Loc = \"DHRYSTONE PROGRAM, 1'ST STRING\"\n    Array2Glob[8][7] = 10\n\n    starttime = clock()\n\n    for i in range(loops):\n        Proc5()\n        Proc4()\n        IntLoc1 = 2\n        IntLoc2 = 3\n        String2Loc = \"DHRYSTONE PROGRAM, 2'ND STRING\"\n        EnumLoc = Ident2\n        BoolGlob = not Func2(String1Loc, String2Loc)\n        while IntLoc1 < IntLoc2:\n            IntLoc3 = 5 * IntLoc1 - IntLoc2\n            IntLoc3 = Proc7(IntLoc1, IntLoc2)\n            IntLoc1 = IntLoc1 + 1\n        Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)\n        PtrGlb = Proc1(PtrGlb)\n        CharIndex = 'A'\n        while CharIndex <= Char2Glob:\n            if EnumLoc == Func1(CharIndex, 'C'):\n                EnumLoc = Proc6(Ident1)\n            CharIndex = chr(ord(CharIndex)+1)\n        IntLoc3 = IntLoc2 * IntLoc1\n        IntLoc2 = IntLoc3 / IntLoc1\n        IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1\n        IntLoc1 = Proc2(IntLoc1)\n\n    benchtime = clock() - starttime - nulltime\n    if benchtime == 0.0:\n        loopsPerBenchtime = 0.0\n    else:\n        loopsPerBenchtime = (loops / benchtime)\n    return benchtime, loopsPerBenchtime\n\ndef Proc1(PtrParIn):\n    PtrParIn.PtrComp = NextRecord = PtrGlb.copy()\n    PtrParIn.IntComp = 5\n    NextRecord.IntComp = PtrParIn.IntComp\n    NextRecord.PtrComp = PtrParIn.PtrComp\n    NextRecord.PtrComp = Proc3(NextRecord.PtrComp)\n    if NextRecord.Discr == Ident1:\n        NextRecord.IntComp = 6\n        NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)\n        NextRecord.PtrComp = PtrGlb.PtrComp\n        NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)\n    else:\n        PtrParIn = NextRecord.copy()\n    NextRecord.PtrComp = None\n    return PtrParIn\n\ndef Proc2(IntParIO):\n    IntLoc = IntParIO + 10\n    while 1:\n        if Char1Glob == 'A':\n            IntLoc = IntLoc - 1\n            IntParIO = IntLoc - IntGlob\n            EnumLoc = Ident1\n        if EnumLoc == Ident1:\n            break\n    return IntParIO\n\ndef Proc3(PtrParOut):\n    global IntGlob\n\n    if PtrGlb is not None:\n        PtrParOut = PtrGlb.PtrComp\n    else:\n        IntGlob = 100\n    PtrGlb.IntComp = Proc7(10, IntGlob)\n    return PtrParOut\n\ndef Proc4():\n    global Char2Glob\n\n    BoolLoc = Char1Glob == 'A'\n    BoolLoc = BoolLoc or BoolGlob\n    Char2Glob = 'B'\n\ndef Proc5():\n    global Char1Glob\n    global BoolGlob\n\n    Char1Glob = 'A'\n    BoolGlob = FALSE\n\ndef Proc6(EnumParIn):\n    EnumParOut = EnumParIn\n    if not Func3(EnumParIn):\n        EnumParOut = Ident4\n    if EnumParIn == Ident1:\n        EnumParOut = Ident1\n    elif EnumParIn == Ident2:\n        if IntGlob > 100:\n            EnumParOut = Ident1\n        else:\n            EnumParOut = Ident4\n    elif EnumParIn == Ident3:\n        EnumParOut = Ident2\n    elif EnumParIn == Ident4:\n        pass\n    elif EnumParIn == Ident5:\n        EnumParOut = Ident3\n    return EnumParOut\n\ndef Proc7(IntParI1, IntParI2):\n    IntLoc = IntParI1 + 2\n    IntParOut = IntParI2 + IntLoc\n    return IntParOut\n\ndef Proc8(Array1Par, Array2Par, IntParI1, IntParI2):\n    global IntGlob\n\n    IntLoc = IntParI1 + 5\n    Array1Par[IntLoc] = IntParI2\n    Array1Par[IntLoc+1] = Array1Par[IntLoc]\n    Array1Par[IntLoc+30] = IntLoc\n    for IntIndex in range(IntLoc, IntLoc+2):\n        Array2Par[IntLoc][IntIndex] = IntLoc\n    Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1\n    Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]\n    IntGlob = 5\n\ndef Func1(CharPar1, CharPar2):\n    CharLoc1 = CharPar1\n    CharLoc2 = CharLoc1\n    if CharLoc2 != CharPar2:\n        return Ident1\n    else:\n        return Ident2\n\ndef Func2(StrParI1, StrParI2):\n    IntLoc = 1\n    while IntLoc <= 1:\n        if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:\n            CharLoc = 'A'\n            IntLoc = IntLoc + 1\n    if CharLoc >= 'W' and CharLoc <= 'Z':\n        IntLoc = 7\n    if CharLoc == 'X':\n        return TRUE\n    else:\n        if StrParI1 > StrParI2:\n            IntLoc = IntLoc + 7\n            return TRUE\n        else:\n            return FALSE\n\ndef Func3(EnumParIn):\n    EnumLoc = EnumParIn\n    if EnumLoc == Ident3: return TRUE\n    return FALSE\n\ndef pystone():\n    import sys\n    def error(msg):\n        print >>sys.stderr, msg,\n        print >>sys.stderr, \"usage: %s [number_of_loops]\" % sys.argv[0]\n        sys.exit(100)\n    nargs = len(sys.argv) - 1\n    if nargs > 1:\n        error(\"%d arguments are too many;\" % nargs)\n    elif nargs == 1:\n        try: loops = int(sys.argv[1])\n        except ValueError:\n            error(\"Invalid argument %r;\" % sys.argv[1])\n    else:\n        loops = LOOPS\n    main(loops)\n\nif __name__ == \"__main__\":\n    pystone()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/pystone3.py",
    "content": "#! /usr/bin/env python3\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\n\"PYSTONE\" Benchmark Program\n\nVersion:        Python/1.2 (corresponds to C/1.1 plus 3 Pystone fixes)\n\nAuthor:         Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013.\n\n                Translated from ADA to C by Rick Richardson.\n                Every method to preserve ADA-likeness has been used,\n                at the expense of C-ness.\n\n                Translated from C to Python by Guido van Rossum.\n\nVersion History:\n\n                Version 1.1 corrects two bugs in version 1.0:\n\n                First, it leaked memory: in Proc1(), NextRecord ends\n                up having a pointer to itself.  I have corrected this\n                by zapping NextRecord.PtrComp at the end of Proc1().\n\n                Second, Proc3() used the operator != to compare a\n                record to None.  This is rather inefficient and not\n                true to the intention of the original benchmark (where\n                a pointer comparison to None is intended; the !=\n                operator attempts to find a method __cmp__ to do value\n                comparison of the record).  Version 1.1 runs 5-10\n                percent faster than version 1.0, so benchmark figures\n                of different versions can't be compared directly.\n\n                Version 1.2 changes the division to floor division.\n\n                Under Python 3 version 1.1 would use the normal division\n                operator, resulting in some of the operations mistakenly\n                yielding floats. Version 1.2 instead uses floor division\n                making the benchmark an integer benchmark again.\n\n\"\"\"\nfrom time import time\n\nLOOPS = 50000\n\n\n__version__ = \"1.2\"\n\n[Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)\n\n\nclass Record:\n    def __init__(self, PtrComp=None, Discr=0, EnumComp=0, IntComp=0, StringComp=0):\n        self.PtrComp = PtrComp\n        self.Discr = Discr\n        self.EnumComp = EnumComp\n        self.IntComp = IntComp\n        self.StringComp = StringComp\n\n    def copy(self):\n        return Record(\n            self.PtrComp, self.Discr, self.EnumComp, self.IntComp, self.StringComp\n        )\n\n\nTRUE = 1\nFALSE = 0\n\n\ndef main(loops=LOOPS):\n    benchtime, stones = pystones(loops)\n\n    import os\n\n    if int(os.environ.get(\"BENCH\", \"0\")):\n        print(\"%g\" % stones)\n    else:\n        print(\"Pystone(%s) time for %d passes = %g\" % (__version__, loops, benchtime))\n        print(\"This machine benchmarks at %g pystones/second\" % stones)\n\n\ndef pystones(loops=LOOPS):\n    return Proc0(loops)\n\n\nIntGlob = 0\nBoolGlob = FALSE\nChar1Glob = \"\\0\"\nChar2Glob = \"\\0\"\nArray1Glob = [0] * 51\nArray2Glob = [x[:] for x in [Array1Glob] * 51]\nPtrGlb = None\nPtrGlbNext = None\n\n\ndef Proc0(loops=LOOPS):\n    global IntGlob\n    global BoolGlob\n    global Char1Glob\n    global Char2Glob\n    global Array1Glob\n    global Array2Glob\n    global PtrGlb\n    global PtrGlbNext\n\n    starttime = time()\n    for i in range(loops):\n        pass\n    nulltime = time() - starttime\n\n    PtrGlbNext = Record()\n    PtrGlb = Record()\n    PtrGlb.PtrComp = PtrGlbNext\n    PtrGlb.Discr = Ident1\n    PtrGlb.EnumComp = Ident3\n    PtrGlb.IntComp = 40\n    PtrGlb.StringComp = \"DHRYSTONE PROGRAM, SOME STRING\"\n    String1Loc = \"DHRYSTONE PROGRAM, 1'ST STRING\"\n    Array2Glob[8][7] = 10\n\n    starttime = time()\n\n    for i in range(loops):\n        Proc5()\n        Proc4()\n        IntLoc1 = 2\n        IntLoc2 = 3\n        String2Loc = \"DHRYSTONE PROGRAM, 2'ND STRING\"\n        EnumLoc = Ident2\n        BoolGlob = not Func2(String1Loc, String2Loc)\n        while IntLoc1 < IntLoc2:\n            IntLoc3 = 5 * IntLoc1 - IntLoc2\n            IntLoc3 = Proc7(IntLoc1, IntLoc2)\n            IntLoc1 = IntLoc1 + 1\n        Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)\n        PtrGlb = Proc1(PtrGlb)\n        CharIndex = \"A\"\n        while CharIndex <= Char2Glob:\n            if EnumLoc == Func1(CharIndex, \"C\"):\n                EnumLoc = Proc6(Ident1)\n            CharIndex = chr(ord(CharIndex) + 1)\n        IntLoc3 = IntLoc2 * IntLoc1\n        IntLoc2 = IntLoc3 // IntLoc1\n        IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1\n        IntLoc1 = Proc2(IntLoc1)\n\n    benchtime = time() - starttime - nulltime\n    if benchtime == 0.0:\n        loopsPerBenchtime = 0.0\n    else:\n        loopsPerBenchtime = loops / benchtime\n    return benchtime, loopsPerBenchtime\n\n\ndef Proc1(PtrParIn):\n    PtrParIn.PtrComp = NextRecord = PtrGlb.copy()\n    PtrParIn.IntComp = 5\n    NextRecord.IntComp = PtrParIn.IntComp\n    NextRecord.PtrComp = PtrParIn.PtrComp\n    NextRecord.PtrComp = Proc3(NextRecord.PtrComp)\n    if NextRecord.Discr == Ident1:\n        NextRecord.IntComp = 6\n        NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)\n        NextRecord.PtrComp = PtrGlb.PtrComp\n        NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)\n    else:\n        PtrParIn = NextRecord.copy()\n    NextRecord.PtrComp = None\n    return PtrParIn\n\n\ndef Proc2(IntParIO):\n    IntLoc = IntParIO + 10\n    while 1:\n        if Char1Glob == \"A\":\n            IntLoc = IntLoc - 1\n            IntParIO = IntLoc - IntGlob\n            EnumLoc = Ident1\n        if EnumLoc == Ident1:\n            break\n    return IntParIO\n\n\ndef Proc3(PtrParOut):\n    global IntGlob\n\n    if PtrGlb is not None:\n        PtrParOut = PtrGlb.PtrComp\n    else:\n        IntGlob = 100\n    PtrGlb.IntComp = Proc7(10, IntGlob)\n    return PtrParOut\n\n\ndef Proc4():\n    global Char2Glob\n\n    BoolLoc = Char1Glob == \"A\"\n    BoolLoc = BoolLoc or BoolGlob\n    Char2Glob = \"B\"\n\n\ndef Proc5():\n    global Char1Glob\n    global BoolGlob\n\n    Char1Glob = \"A\"\n    BoolGlob = FALSE\n\n\ndef Proc6(EnumParIn):\n    EnumParOut = EnumParIn\n    if not Func3(EnumParIn):\n        EnumParOut = Ident4\n    if EnumParIn == Ident1:\n        EnumParOut = Ident1\n    elif EnumParIn == Ident2:\n        if IntGlob > 100:\n            EnumParOut = Ident1\n        else:\n            EnumParOut = Ident4\n    elif EnumParIn == Ident3:\n        EnumParOut = Ident2\n    elif EnumParIn == Ident4:\n        pass\n    elif EnumParIn == Ident5:\n        EnumParOut = Ident3\n    return EnumParOut\n\n\ndef Proc7(IntParI1, IntParI2):\n    IntLoc = IntParI1 + 2\n    IntParOut = IntParI2 + IntLoc\n    return IntParOut\n\n\ndef Proc8(Array1Par, Array2Par, IntParI1, IntParI2):\n    global IntGlob\n\n    IntLoc = IntParI1 + 5\n    Array1Par[IntLoc] = IntParI2\n    Array1Par[IntLoc + 1] = Array1Par[IntLoc]\n    Array1Par[IntLoc + 30] = IntLoc\n    for IntIndex in range(IntLoc, IntLoc + 2):\n        Array2Par[IntLoc][IntIndex] = IntLoc\n    Array2Par[IntLoc][IntLoc - 1] = Array2Par[IntLoc][IntLoc - 1] + 1\n    Array2Par[IntLoc + 20][IntLoc] = Array1Par[IntLoc]\n    IntGlob = 5\n\n\ndef Func1(CharPar1, CharPar2):\n    CharLoc1 = CharPar1\n    CharLoc2 = CharLoc1\n    if CharLoc2 != CharPar2:\n        return Ident1\n    else:\n        return Ident2\n\n\ndef Func2(StrParI1, StrParI2):\n    IntLoc = 1\n    while IntLoc <= 1:\n        if Func1(StrParI1[IntLoc], StrParI2[IntLoc + 1]) == Ident1:\n            CharLoc = \"A\"\n            IntLoc = IntLoc + 1\n    if CharLoc >= \"W\" and CharLoc <= \"Z\":\n        IntLoc = 7\n    if CharLoc == \"X\":\n        return TRUE\n    else:\n        if StrParI1 > StrParI2:\n            IntLoc = IntLoc + 7\n            return TRUE\n        else:\n            return FALSE\n\n\ndef Func3(EnumParIn):\n    EnumLoc = EnumParIn\n    if EnumLoc == Ident3:\n        return TRUE\n    return FALSE\n\n\nif __name__ == \"__main__\":\n    import sys\n\n    def error(msg):\n        print(msg, end=\" \", file=sys.stderr)\n        print(\"usage: %s [number_of_loops]\" % sys.argv[0], file=sys.stderr)\n        sys.exit(100)\n\n    nargs = len(sys.argv) - 1\n    if nargs > 1:\n        error(\"%d arguments are too many;\" % nargs)\n    elif nargs == 1:\n        try:\n            loops = int(sys.argv[1])\n        except ValueError:\n            error(\"Invalid argument %r;\" % sys.argv[1])\n    else:\n        loops = LOOPS\n    main(loops)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/benchmarks/recipe-577834-1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Show relative speeds of local, nonlocal, global, and built-in access.\n\ntrials = [1] * 500\n\n\ndef read_local(trials=trials):\n    v_local = 1\n    for t in trials:\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n        v_local\n\n\ndef make_nonlocal_reader():\n    v_nonlocal = 1\n\n    def inner(trials=trials):\n        for t in trials:\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n            v_nonlocal\n\n    inner.__name__ = \"read_nonlocal\"\n    return inner\n\n\nread_nonlocal = make_nonlocal_reader()\n\nv_global = 1\n\n\ndef read_global(trials=trials):\n    for t in trials:\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n        v_global\n\n\ndef read_builtin(trials=trials):\n    for t in trials:\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n        oct\n\n\nclass A(object):\n    def m(self):\n        pass\n\n\ndef read_classvar(trials=trials, A=A):\n    A.x = 1\n    for t in trials:\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n        A.x\n\n\ndef read_instancevar(trials=trials, a=A()):\n    a.x = 1\n    for t in trials:\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n        a.x\n\n\ndef read_unboundmethod(trials=trials, A=A):\n    # real unbound methods are only in Py2.x\n    for t in trials:\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n        A.m\n\n\ndef read_boundmethod(trials=trials, a=A()):\n    for t in trials:\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n        a.m\n\n\ndef write_local(trials=trials):\n    v_local = 1\n    for t in trials:\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n        v_local = 1\n\n\ndef make_nonlocal_writer():\n    v_nonlocal = 1\n\n    def inner(trials=trials):\n        # nonlocal v_nonlocal            # this is invalid syntax in Py2.x\n        for t in trials:\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n            v_nonlocal = 1\n\n    inner.__name__ = \"write_nonlocal\"\n    return inner\n\n\nwrite_nonlocal = make_nonlocal_writer()\n\n\ndef write_global(trials=trials):\n    global v_global\n    for t in trials:\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n        v_global = 1\n\n\ndef write_classvar(trials=trials, A=A):\n    for t in trials:\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n        A.x = 1\n\n\ndef write_instancevar(trials=trials, a=A()):\n    for t in trials:\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n        a.x = 1\n\n\ndef loop_overhead(trials=trials):\n    for t in trials:\n        pass\n\n\nif __name__ == \"__main__\":\n    from timeit import Timer\n\n    for f in [\n        read_local,\n        read_nonlocal,\n        read_global,\n        read_builtin,\n        read_classvar,\n        read_instancevar,\n        read_unboundmethod,\n        read_boundmethod,\n        write_local,\n        write_nonlocal,\n        write_global,\n        write_classvar,\n        write_instancevar,\n        loop_overhead,\n    ]:\n        print(\"{:5.3f}\\t{}\".format(min(Timer(f).repeat(7, 1000)), f.__name__))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/codegen-analysis/README.txt",
    "content": "These are tests written to analyse the performance of certain code.\n"
  },
  {
    "path": "tests/distutils/.gitignore",
    "content": "*.egg-info\npyproject.toml\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/data_files/some_datafile.txt",
    "content": ""
  },
  {
    "path": "tests/distutils/example_1_pyproject/example1_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nPackage using package data file.\n\"\"\"\n\nimport pkgutil\n\nprint(pkgutil.get_data(__package__, \"data/package_data.txt\"))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/example1_package/data/package_data.txt",
    "content": "Data file to be installed.\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/pyproject.cpython.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n# Nothing needed really it seems.\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/pyproject.nuitka.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[build-system]\n# Note: For test purposes, Nuitka is referenced by path, should be \"nuitka\" in\n# normal projects.\nrequires = [\"setuptools>=42\", \"wheel\", \"file:../../..\", \"toml\"]\nbuild-backend = \"nuitka.distutils.Build\"\n\n[tool.nuitka]\n# Note: These are not recommended, but they make it obvious to have effect that\n# can be seen, namely have \"explain imports\" output in the compilation output.\n# This also uses both supported forms for assigning a boolean option of Nuitka,\n# where the later works, but is not recommended.\nshow-scons = true\nexplain-imports = \"\"\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/runner",
    "content": "#!/usr/bin/env python\n\n\"\"\"Runner for example project.\"\"\"\n\nprint(\"Hello pyproject world!\")\n\n# Lets do the actual work after the print.\nimport example1_package  # isort:skip\n"
  },
  {
    "path": "tests/distutils/example_1_pyproject/setup.cfg",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[metadata]\nname = nuitka-pyproject-example-1\nversion = 102\ndescription = yadda yadda.\nlong_description = \"nuitka pyproject.toml test-case compiling a data-file using package\"\n\nkeywords = one, two\nauthor = Nobody really\nauthor_email = email@someplace.com\n\n[options]\npackages = example1_package\nscripts = runner\n\n[options.package_data]\nexample1_package = data/package_data.txt\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_1_setuptools/data_files/some_datafile.txt",
    "content": ""
  },
  {
    "path": "tests/distutils/example_1_setuptools/example1_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_1_setuptools/example1_package/data/package_data.txt",
    "content": "Data file to be installed.\n"
  },
  {
    "path": "tests/distutils/example_1_setuptools/runner",
    "content": "#!/usr/bin/env python\n\nprint(\"Hello distutils world!\")\n"
  },
  {
    "path": "tests/distutils/example_1_setuptools/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Distutils example that contains a package and a data file.\n\n\"\"\"\n\nfrom setuptools import setup\n\n# This is a list of files to install, and where\n# (relative to the 'root' dir, where setup.py is)\n# You could be more specific.\nfiles = [\"data/package_data.txt\"]\ndata_files = [(\"some_datadir\", (\"data_files/some_datafile.txt\",))]\n\nsetup(\n    name=\"nuitka-example-1\",\n    version=\"101\",\n    data_files=data_files,\n    packages=[\"example1_package\"],\n    package_data={\"example1_package\": files},\n    scripts=[\"runner\"],\n    description=\"yadda yadda\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    url=\"whatever\",\n    long_description=\"\"\"Really long text here.\"\"\",\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_pyproject/pyproject.cpython.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[tool.poetry]\nversion = \"0.1.0\"\nname = \"hello-world-example\"\ndescription = \"Hello places and things\"\npackages = [\n    {include = \"src\" },\n]\nkeywords = [\n    \"Hello\",\n]\nclassifiers = [\n    \"Programming Language :: Python :: 3\",\n    \"License :: Other/Proprietary License\",\n    \"Operating System :: OS Independent\"\n]\nauthors = [\"Nobody really <email@someplace.com>\"]\nhomepage = \"https://www.nuitka.net\"\n\n[tool.poetry.dependencies]\npython = \"3.6.3\"\n\n[tool.poetry.dev-dependencies]\nnuitka = \"*\"\nbuild = \"*\"\n\n[build-system]\nrequires = [\"setuptools>=42\", \"wheel\", \"nuitka\", \"toml\"]\nbuild-backend = \"nuitka.distutils.Build\"\n\n[virtualenvs]\ncreate = true\nin-project = true\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_pyproject/pyproject.nuitka.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[tool.poetry]\nversion = \"0.1.0\"\nname = \"hello-world-example\"\ndescription = \"Hello places and things\"\npackages = [\n    {include = \"src\" },\n]\nkeywords = [\n    \"Hello\",\n]\nclassifiers = [\n    \"Programming Language :: Python :: 3\",\n    \"License :: Other/Proprietary License\",\n    \"Operating System :: OS Independent\"\n]\nauthors = [\"Nobody really <email@someplace.com>\"]\nhomepage = \"https://www.nuitka.net\"\n\n[tool.poetry.dependencies]\npython = \"3.6.3\"\n\n[tool.poetry.dev-dependencies]\nnuitka = \"*\"\nbuild = \"*\"\n\n[build-system]\nrequires = [\"setuptools>=42\", \"wheel\", \"nuitka\", \"toml\"]\nbuild-backend = \"nuitka.distutils.Build\"\n\n[virtualenvs]\ncreate = true\nin-project = true\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_pyproject/src/main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom package1.module1 import module1_f1\nfrom package1.module2 import module2_f1\nfrom package1.subpackage1.submodule11 import submodule11_f2\nfrom package1.subpackage2.submodule21 import submodule21_f1\n\n\ndef main():\n    module1_f1(\"package1.main.py\")\n    module2_f1(\"package1.main.py\")\n    submodule11_f2(\"package1.main.py\")\n    submodule21_f1(\"package1.main.py\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/module1.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef module1_f1(var1):\n    print_str = \"\" + __name__ + \" : function module1_f1: \" + var1 + \" \"\n    print(print_str, end=\"\")\n    print()\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/module2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nfrom package1.subpackage1.submodule11 import submodule11_f1\n\n\ndef module2_f1(var1):\n    print_str = \"\" + __name__ + \" : function module2_f1: \" + var1 + \" \"\n    print(print_str, end=\"\")\n    submodule11_f1(var1)\n    print()\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/subpackage1/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/subpackage1/data.txt",
    "content": "Hello I am test 2 data companion!\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/subpackage1/submodule11.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport os\n\n\ndef submodule11_f1(var1):\n    print_str = \"\" + __name__ + \" : function submodule11_f1: \" + var1\n    print(print_str, end=\"\")\n    print()\n\n\ndef submodule11_f2(var1):\n    print_str = \"\" + __name__ + \" : function submodule11_f2: \" + var1\n    print(print_str)\n    print(\"printing package data!!\")\n    with open(os.path.join(os.path.dirname(__file__), \"data.txt\")) as f:\n        print(f.read())\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/subpackage2/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/package1/subpackage2/submodule21.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nfrom package1.subpackage1.submodule11 import submodule11_f1\n\n\ndef submodule21_f1(var1):\n    print_str = \"\" + __name__ + \" : function submodule21_f1: \" + var1 + \" \"\n    print(print_str, end=\"\")\n    submodule11_f1(var1)\n    print()\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_2_setuptools/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Example setup file to test Nuitka distutils integration.\n\n\"\"\"\n\nfrom setuptools import find_packages, setup\n\n# use `python setup.py bdist_nuitka` to use nuitka or use\n# in the setup(..., build_with_nuitka=True, ...)\n# and bdist and build will always use nuitka\n\nsetup(\n    name=\"bdist_nuitka_test_2\",\n    description=\"nuitka bdist_nuitka test-case compiling interdependent\"\n    + \" python packages, and printing a data file\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    version=\"0.8.2\",\n    py_modules=[],\n    packages=find_packages(exclude=[\"*.tests\", \"*.tests.*\", \"tests.*\", \"tests\"]),\n    command_options={\n        \"nuitka\": {\n            \"--show-scons\": (\"setup.py\", True),\n            \"--show-progress\": None,\n            \"--file-reference-choice\": \"original\",\n        }\n    },\n    package_data={\"\": [\"*.txt\"]},\n    entry_points={\"console_scripts\": [\"runner = package1.main:main\"]},\n    zip_safe=False,\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_pyproject/pyproject.cpython.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[build-system]\nrequires = [\n    \"setuptools>=45\",\n    \"wheel\",\n]\n\n[project]\nname = \"some_namespace.some_package\"\nversion = \"0.0.1\"\n\n[project.scripts]\nrunner=\"some_namespace.some_package.sub_package:main\"\n\n[tool.setuptools.packages.find]\nwhere = [\"src\"]\ninclude = [\"some_namespace.some_package*\", \"runner\"]\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_pyproject/pyproject.nuitka.toml",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[build-system]\n# Note: For test purposes, Nuitka is referenced by path, should be \"nuitka\" in\n# normal projects.\nrequires = [\"setuptools>=42\", \"wheel\", \"file:../../..\", \"toml\"]\nbuild-backend = \"nuitka.distutils.Build\"\n\n[project]\nname = \"some_namespace.some_package\"\nversion = \"0.0.1\"\n\n[project.scripts]\nrunner=\"some_namespace.some_package.sub_package:main\"\n\n[tool.setuptools.packages.find]\nwhere = [\"src\"]\ninclude = [\"some_namespace.some_package*\"]\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_pyproject/src/runner",
    "content": "#!/usr/bin/env python\n\n\"\"\"Runner for example project.\"\"\"\n\nprint(\"Hello pyproject world!\")\n\n# Lets do the actual work after the print.\nimport some_namespace.some_package.sub_package  # isort:skip\n"
  },
  {
    "path": "tests/distutils/example_3_pyproject/src/some_namespace/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport re\n\nprint(re.sub(\"venv_(nuitka|cpython)\", \"venv_xxxxx\", __file__))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_pyproject/src/some_namespace/some_package/sub_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport re\n\nprint(re.sub(\"venv_(nuitka|cpython)\", \"venv_xxxxx\", __file__))\n\n\ndef main():\n    pass\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_setuptools32/outer/inner/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_setuptools32/outer/inner/main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef main():\n    print(\"Hello example 3 world!\")\n    import outer.inner\n\n    print(\"Imported\", outer.inner)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_3_setuptools32/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Example setup file to test Nuitka distutils integration.\n\n\"\"\"\n\nfrom setuptools import setup\n\n# use `python setup.py bdist_nuitka` to use nuitka or use\n# in the setup(..., build_with_nuitka=True, ...)\n# and bdist and build will always use nuitka\n\nsetup(\n    name=\"bdist_nuitka_test_3\",\n    description=\"nuitka bdist_nuitka test-case compiling a namespace package\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    version=\"0.2\",\n    packages=[\"outer.inner\"],\n    entry_points={\"console_scripts\": [\"runner = outer.inner.main:main\"]},\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/data_files/some_datafile.txt",
    "content": ""
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/example1_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/example1_package/data/package_data.txt",
    "content": "Data file to be installed.\n"
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/runner",
    "content": "#!/usr/bin/env python\n\nprint(\"Hello distutils world!\")\n"
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/setup.cfg",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[metadata]\nname = nuitka-example-1\nversion = 101\ndescription = yadda yadda.\nlong_description = Really long text here.\nkeywords = one, two\nauthor = Nobody really\nauthor_email = email@someplace.com\n# This would allow using bdist_wheel, but it won't be used\n# unless a setup.py also exist.\n# build_with_nuitka = true\n\n[options]\npackages = example1_package\nscripts = runner\n\n[options.package_data]\nexample1_package = data/package_data.txt\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_4_setuptools_cfg/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Distutils example that contains a package and a data file.\n\n\"\"\"\n\nfrom setuptools import setup\n\nsetup()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/runner",
    "content": "#!/usr/bin/env python\nimport some_package as pkg\n\nprint(\"Hello distutils world!\")\n\n\n# We are importing the newly installed package and we want to check that the\n# correct version is being set based on the file that gets changed during\n# build time.\nassert pkg.__version__ == \"0+24601\"\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/setup.cfg",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n[versioneer]\nversionfile_source = some_package/_version.py\nversionfile_build = some_package/_version.py\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Distutils example that contains only plain module.\n\n\"\"\"\n\nimport versioneer\nfrom setuptools import setup\n\n# use `python setup.py bdist_nuitka` to use nuitka or use\n# in the setup(..., build_with_nuitka=True, ...)\n# and bdist and build will always use nuitka\n\n\ncmdclass = versioneer.get_cmdclass()\n\nsetup(\n    name=\"example_versioneer\",\n    description=\"nuitka bdist_nuitka test-case compiling versioneer self modifying code\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    packages=[\"some_package\"],\n    version=versioneer.get_version(),\n    scripts=[\"runner\"],\n    cmdclass=cmdclass,\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom . import _version\n\n__version__ = _version.get_versions()[\"version\"]\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/some_package/_version.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# This file helps to compute a version number in source trees obtained from\n# git-archive tarball (such as those provided by githubs download-from-tag\n# feature). Distribution tarballs (built by setup.py sdist) and build\n# directories (produced by setup.py build) will contain a much shorter file\n# that just contains the computed version number.\n\n# This file is released into the public domain.\n# Generated by versioneer-0.28\n# https://github.com/python-versioneer/python-versioneer\n\n# N.B. this is a heavily truncated version for testing purposes.\n\n\"\"\"Git implementation of _version.py.\"\"\"\n\n\ndef get_versions():\n    # We return some arbitrary version\n    return {\n        \"version\": \"0+123123\",\n        \"full-revisionid\": None,\n        \"dirty\": None,\n        \"error\": \"unable to compute version\",\n        \"date\": None,\n    }\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_5_versioneer_setuptools32/versioneer.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Version: 0.28\n# Heavily truncated version of versioneer\n\nimport configparser\nimport json\nimport os\nimport sys\nfrom pathlib import Path\n\nhave_tomllib = True\nif sys.version_info >= (3, 11):\n    import tomllib\nelse:\n    try:\n        import tomli as tomllib\n    except ImportError:\n        have_tomllib = False\n\n\nclass VersioneerConfig:\n    \"\"\"Container for Versioneer configuration parameters.\"\"\"\n\n\ndef get_root():\n    \"\"\"Get the project root directory.\n\n    We require that all commands are run from the project root, i.e. the\n    directory that contains setup.py, setup.cfg, and versioneer.py .\n    \"\"\"\n    root = os.path.realpath(os.path.abspath(os.getcwd()))\n    setup_py = os.path.join(root, \"setup.py\")\n    versioneer_py = os.path.join(root, \"versioneer.py\")\n    if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):\n        # allow 'python path/to/setup.py COMMAND'\n        root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))\n        setup_py = os.path.join(root, \"setup.py\")\n        versioneer_py = os.path.join(root, \"versioneer.py\")\n    if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):\n        err = (\n            \"Versioneer was unable to run the project root directory. \"\n            \"Versioneer requires setup.py to be executed from \"\n            \"its immediate directory (like 'python setup.py COMMAND'), \"\n            \"or in a way that lets it use sys.argv[0] to find the root \"\n            \"(like 'python path/to/setup.py COMMAND').\"\n        )\n        raise VersioneerBadRootError(err)\n    return root\n\n\ndef get_config_from_root(root):\n    \"\"\"Read the project setup.cfg file to determine Versioneer config.\"\"\"\n    # This might raise OSError (if setup.cfg is missing)\n\n    root = Path(root)\n    pyproject_toml = root / \"pyproject.toml\"\n    setup_cfg = root / \"setup.cfg\"\n    section = None\n    if pyproject_toml.exists() and have_tomllib:\n        try:\n            with open(pyproject_toml, \"rb\") as fobj:\n                pp = tomllib.load(fobj)\n            section = pp[\"tool\"][\"versioneer\"]\n        except (tomllib.TOMLDecodeError, KeyError):\n            pass\n    if not section:\n        parser = configparser.ConfigParser()\n        with open(setup_cfg) as cfg_file:\n            parser.read_file(cfg_file)\n\n        section = parser[\"versioneer\"]\n\n    cfg = VersioneerConfig()\n    cfg.versionfile_source = section.get(\"versionfile_source\")\n    cfg.versionfile_build = section.get(\"versionfile_build\")\n\n    cfg.verbose = section.get(\"verbose\")\n    return cfg\n\n\nSHORT_VERSION_PY = \"\"\"\n# This file was generated by 'versioneer.py' (0.28) from\n# revision-control system data, or from the parent directory name of an\n# unpacked source archive. Distribution tarballs contain a pre-generated copy\n# of this file.\n\nimport json\n\nversion_json = '''\n%s\n'''  # END VERSION_JSON\n\n\ndef get_versions():\n    return json.loads(version_json)\n\"\"\"\n\n\ndef write_to_version_file(filename, versions):\n    \"\"\"Write the given version number to the given _version.py file.\"\"\"\n    os.unlink(filename)\n    contents = json.dumps(versions, sort_keys=True, indent=1, separators=(\",\", \": \"))\n    with open(filename, \"w\") as f:\n        f.write(SHORT_VERSION_PY % contents)\n\n    print(\"set %s to '%s'\" % (filename, versions[\"version\"]))\n\n\nclass VersioneerBadRootError(Exception):\n    \"\"\"The project root directory is unknown or missing key files.\"\"\"\n\n\ndef get_versions(verbose=False):\n    \"\"\"Get the project version from whatever source is available.\n\n    Returns dict with two keys: 'version' and 'full'.\n    \"\"\"\n    if \"versioneer\" in sys.modules:\n        # see the discussion in cmdclass.py:get_cmdclass()\n        del sys.modules[\"versioneer\"]\n\n    # We return a special version always for testing\n    return {\n        \"version\": \"0+24601\",\n        \"full-revisionid\": None,\n        \"dirty\": None,\n        \"error\": \"unable to compute version\",\n        \"date\": None,\n    }\n\n\ndef get_version():\n    \"\"\"Get the short version string for this project.\"\"\"\n    return get_versions()[\"version\"]\n\n\ndef get_cmdclass(cmdclass=None):\n    \"\"\"Get the custom setuptools subclasses used by Versioneer.\n\n    If the package uses a different cmdclass (e.g. one from numpy), it\n    should be provide as an argument.\n    \"\"\"\n    if \"versioneer\" in sys.modules:\n        del sys.modules[\"versioneer\"]\n        # this fixes the \"python setup.py develop\" case (also 'install' and\n        # 'easy_install .'), in which subdependencies of the main project are\n        # built (using setup.py bdist_egg) in the same python process. Assume\n        # a main project A and a dependency B, which use different versions\n        # of Versioneer. A's setup.py imports A's Versioneer, leaving it in\n        # sys.modules by the time B's setup.py is executed, causing B to run\n        # with the wrong versioneer. Setuptools wraps the sub-dep builds in a\n        # sandbox that restores sys.modules to it's pre-build state, so the\n        # parent is protected against the child's \"import versioneer\". By\n        # removing ourselves from sys.modules here, before the child build\n        # happens, we protect the child from the parent's versioneer too.\n        # Also see https://github.com/python-versioneer/python-versioneer/issues/52\n\n    cmds = {} if cmdclass is None else cmdclass.copy()\n\n    # we override \"build_py\" in setuptools\n    #\n    # most invocation pathways end up running build_py:\n    #  distutils/build -> build_py\n    #  distutils/install -> distutils/build ->..\n    #  setuptools/bdist_wheel -> distutils/install ->..\n    #  setuptools/bdist_egg -> distutils/install_lib -> build_py\n    #  setuptools/install -> bdist_egg ->..\n    #  setuptools/develop -> ?\n    #  pip install:\n    #   copies source tree to a tempdir before running egg_info/etc\n    #   if .git isn't copied too, 'git describe' will fail\n    #   then does setup.py bdist_wheel, or sometimes setup.py install\n    #  setup.py egg_info -> ?\n\n    # pip install -e . and setuptool/editable_wheel will invoke build_py\n    # but the build_py command is not expected to copy any files.\n\n    # we override different \"build_py\" commands for both environments\n    if \"build_py\" in cmds:\n        _build_py = cmds[\"build_py\"]\n    else:\n        from setuptools.command.build_py import build_py as _build_py\n\n    class cmd_build_py(_build_py):\n        def run(self):\n            root = get_root()\n            cfg = get_config_from_root(root)\n            versions = get_versions()\n            _build_py.run(self)\n            if getattr(self, \"editable_mode\", False):\n                # During editable installs `.py` and data files are\n                # not copied to build_lib\n                return\n            # now locate _version.py in the new build/ directory and replace\n            # it with an updated value\n            if cfg.versionfile_build:\n                target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build)\n                print(\"UPDATING %s\" % target_versionfile)\n                write_to_version_file(target_versionfile, versions)\n\n    cmds[\"build_py\"] = cmd_build_py\n\n    return cmds\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/main_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Hello Distutils this is\", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/other_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/other_package_a/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/runner",
    "content": "#!/usr/bin/env python\n\nimport some_package  # contains some_module isort:skip\nimport main_module  # isort:skip\nimport other_package  # isort:skip\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom setuptools import setup\n\n# This is a list of files to install, and where\n# (relative to the 'root' dir, where setup.py is)\n# You could be more specific.\nsetup(\n    name=\"multiple_packages_example\",\n    version=\"101\",\n    packages=[\n        \"some_package\",\n        \"some_package_a\",\n        \"some_package_b\",\n        \"other_package\",\n        \"other_package_a\",\n    ],\n    py_modules=[\"main_module\"],\n    scripts=[\"runner\"],\n    description=\"hello\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    url=\"whatever\",\n    long_description=\"\"\"Really long text here.\"\"\",\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/some_package_a/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_multiple_packages/some_package_b/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_nested_namespaces32/a/b/pkg/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef main():\n    print(\"Hello, this is\", __name__)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_nested_namespaces32/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom setuptools import setup\n\nsetup(\n    name=\"nested_namespaces\",\n    version=\"1.0.0\",\n    description=(\n        \"bdist_nuitka test-case that verifies that Nuitka correctly handles\"\n        \" nested implicit namespaces\"\n    ),\n    packages=[\"a.b.pkg\"],\n    entry_points={\"console_scripts\": [\"runner = a.b.pkg:main\"]},\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_package_and_module/runner",
    "content": "#!/usr/bin/env python\n\nimport some_package  # contains some_module isort:skip\nimport some_module  # isort:skip\n"
  },
  {
    "path": "tests/distutils/example_package_and_module/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom setuptools import setup\n\n# This is a list of files to install, and where\n# (relative to the 'root' dir, where setup.py is)\n# You could be more specific.\nsetup(\n    name=\"package-and-module-example\",\n    version=\"101\",\n    packages=[\"some_package\"],\n    py_modules=[\"some_module\"],\n    scripts=[\"runner\"],\n    description=\"yadda yadda\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    url=\"whatever\",\n    long_description=\"\"\"Really long text here.\"\"\",\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_package_and_module/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Hello Distutils this is\", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_package_and_module/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module to be imported and report its name as evidence of usage.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Hello, this is \", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_pymodules_only/py_modules_only.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Hello Distutils this is\", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/example_pymodules_only/runner",
    "content": "#!/usr/bin/env python\n\nprint(\"Hello distutils world!\")\n"
  },
  {
    "path": "tests/distutils/example_pymodules_only/setup.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Distutils example that contains only plain module.\n\n\"\"\"\n\nfrom setuptools import setup\n\n# use `python setup.py bdist_nuitka` to use nuitka or use\n# in the setup(..., build_with_nuitka=True, ...)\n# and bdist and build will always use nuitka\n\nsetup(\n    name=\"py_modules_only\",\n    description=\"nuitka bdist_nuitka test-case compiling py_modules only\" + \" package\",\n    author=\"Nobody really\",\n    author_email=\"email@someplace.com\",\n    py_modules=[\"py_modules_only\"],\n    version=\"0.1\",\n    scripts=[\"runner\"],\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/distutils/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for distutils integration\n\nTests for example packages demonstrating that wheel creation with Nuitka\nis compatible to standard packaging tools.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us. The replacement is for POSIX python\n# and Windows paths on command line.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(\n            os.path.dirname(os.path.abspath(__file__.replace(\"\\\\\", os.sep))), \"..\", \"..\"\n        )\n    ),\n)\n\n# isort:start\n\nimport subprocess\n\nfrom nuitka.tools.environments.Virtualenv import (\n    NuitkaCalledProcessError,\n    withVirtualenv,\n)\nfrom nuitka.tools.testing.Common import (\n    createSearchMode,\n    my_print,\n    reportSkip,\n    scanDirectoryForTestCaseFolders,\n    setup,\n    test_logger,\n)\nfrom nuitka.tools.testing.OutputComparison import compareOutput\nfrom nuitka.utils.FileOperations import (\n    deleteFile,\n    getFileContents,\n    putTextFileContents,\n    removeDirectory,\n)\n\n\ndef _adaptPyProjectFile(case_dir, source_filename):\n    pyproject_filename = os.path.join(case_dir, \"pyproject.toml\")\n\n    putTextFileContents(\n        filename=pyproject_filename,\n        contents=getFileContents(os.path.join(case_dir, source_filename)).replace(\n            \"file:../../..\",\n            \"file:%s\"\n            % (\n                os.path.abspath(os.path.join(case_dir, \"..\", \"..\", \"..\")).replace(\n                    \"\\\\\", \"/\"\n                )\n            ),\n        ),\n    )\n\n    return pyproject_filename\n\n\ndef _handleCase(python_version, nuitka_dir, filename):\n    # Complex stuff, pylint: disable=too-many-branches,too-many-locals,too-many-statements\n\n    my_print(\"Consider distutils example: '%s'\" % filename, style=\"blue\")\n\n    if filename == \"example_2_pyproject\":\n        reportSkip(\n            \"Skipped, 'poetry' based pyproject is not working for now\",\n            \".\",\n            filename,\n        )\n        return\n\n    is_pyproject = \"_pyproject\" in filename\n\n    if is_pyproject and python_version < (3,):\n        reportSkip(\n            \"Skipped, pyproject cases are not for Python2\",\n            \".\",\n            filename,\n        )\n        return\n\n    case_dir = os.path.join(os.getcwd(), filename)\n\n    removeDirectory(os.path.join(case_dir, \"build\"), ignore_errors=False)\n    removeDirectory(os.path.join(case_dir, \"dist\"), ignore_errors=False)\n\n    with withVirtualenv(\"venv_cpython\") as venv:\n        if is_pyproject:\n            venv.runCommand(\"pip install build\")\n\n            pyproject_filename = _adaptPyProjectFile(\n                case_dir=case_dir, source_filename=\"pyproject.cpython.toml\"\n            )\n\n            venv.runCommand(commands=['cd \"%s\"' % case_dir, \"python -m build\"])\n            deleteFile(pyproject_filename, must_exist=True)\n        else:\n            venv.runCommand(\n                commands=['cd \"%s\"' % case_dir, \"python setup.py bdist_wheel\"]\n            )\n\n        dist_dir = os.path.join(case_dir, \"dist\")\n\n        venv.runCommand(\n            'pip install \"%s\"' % (os.path.join(dist_dir, os.listdir(dist_dir)[0]))\n        )\n\n        runner_binary = os.path.join(\n            venv.getVirtualenvDir(),\n            \"bin\" if os.name != \"nt\" else \"scripts\",\n            \"runner\",\n        )\n\n        # TODO: Is this something to be abstracted into a function.\n        # pylint: disable=consider-using-with\n\n        if os.path.exists(runner_binary):\n            # Need to call CPython binary for Windows.\n            process = subprocess.Popen(\n                args=[\n                    os.path.join(\n                        venv.getVirtualenvDir(),\n                        \"bin\" if os.name != \"nt\" else \"scripts\",\n                        \"python\",\n                    ),\n                    os.path.join(\n                        venv.getVirtualenvDir(),\n                        \"bin\" if os.name != \"nt\" else \"scripts\",\n                        \"runner\",\n                    ),\n                ],\n                stdout=subprocess.PIPE,\n                stderr=subprocess.PIPE,\n            )\n        else:\n            assert os.path.exists(runner_binary + \".exe\")\n\n            process = subprocess.Popen(\n                args=[runner_binary + \".exe\"],\n                stdout=subprocess.PIPE,\n                stderr=subprocess.PIPE,\n            )\n\n        stdout_cpython, stderr_cpython = process.communicate()\n        exit_cpython = process.returncode\n\n        my_print(\"STDOUT CPython:\")\n        my_print(stdout_cpython)\n        my_print(\"STDERR CPython:\")\n        my_print(stderr_cpython)\n\n        assert exit_cpython == 0, exit_cpython\n        my_print(\"EXIT was OK.\")\n\n    removeDirectory(os.path.join(case_dir, \"build\"), ignore_errors=False)\n    removeDirectory(os.path.join(case_dir, \"dist\"), ignore_errors=False)\n\n    with withVirtualenv(\"venv_nuitka\") as venv:\n        # Create the wheel with Nuitka compilation.\n        if is_pyproject:\n            venv.runCommand(\"pip install build\")\n\n            pyproject_filename = _adaptPyProjectFile(\n                case_dir=case_dir, source_filename=\"pyproject.nuitka.toml\"\n            )\n\n            venv.runCommand(commands=['cd \"%s\"' % case_dir, \"python -m build -w\"])\n\n            deleteFile(pyproject_filename, must_exist=True)\n        else:\n            # Install nuitka from source so \"bdist_nuitka\" can work.\n\n            try:\n                venv.runCommand(\n                    commands=['cd \"%s\"' % nuitka_dir, \"python setup.py install\"],\n                    style=\"test-prepare\",\n                    env={\"PYTHONWARNINGS\": \"ignore\"},\n                )\n            finally:\n                # Remove that left over from the install command.\n                removeDirectory(\n                    path=os.path.join(nuitka_dir, \"Nuitka.egg-info\"),\n                    ignore_errors=False,\n                )\n\n            venv.runCommand(\n                commands=['cd \"%s\"' % case_dir, \"python setup.py bdist_nuitka\"]\n            )\n\n        dist_dir = os.path.join(case_dir, \"dist\")\n        venv.runCommand(\n            'pip install \"%s\"' % (os.path.join(dist_dir, os.listdir(dist_dir)[0]))\n        )\n\n        runner_binary = os.path.join(\n            venv.getVirtualenvDir(),\n            \"bin\" if os.name != \"nt\" else \"scripts\",\n            \"runner\",\n        )\n\n        # TODO: Is this something to be abstracted into a function.\n        # pylint: disable=consider-using-with\n\n        if os.path.exists(runner_binary):\n            process = subprocess.Popen(\n                args=[\n                    os.path.join(\n                        venv.getVirtualenvDir(),\n                        \"bin\" if os.name != \"nt\" else \"scripts\",\n                        \"python\",\n                    ),\n                    runner_binary,\n                ],\n                stdout=subprocess.PIPE,\n                stderr=subprocess.PIPE,\n            )\n        else:\n            assert os.path.exists(runner_binary + \".exe\")\n\n            process = subprocess.Popen(\n                args=[runner_binary + \".exe\"],\n                stdout=subprocess.PIPE,\n                stderr=subprocess.PIPE,\n            )\n\n        stdout_nuitka, stderr_nuitka = process.communicate()\n        exit_nuitka = process.returncode\n\n        my_print(\"STDOUT Nuitka:\")\n        my_print(stdout_nuitka)\n        my_print(\"STDERR Nuitka:\")\n        my_print(stderr_nuitka)\n\n        assert exit_nuitka == 0, exit_nuitka\n        my_print(\"EXIT was OK.\")\n\n    exit_code_stdout = compareOutput(\n        \"stdout\",\n        stdout_cpython,\n        stdout_nuitka,\n        ignore_warnings=True,\n        syntax_errors=True,\n    )\n\n    exit_code_stderr = compareOutput(\n        \"stderr\",\n        stderr_cpython,\n        stderr_nuitka,\n        ignore_warnings=True,\n        syntax_errors=True,\n    )\n\n    exit_code_return = exit_cpython != exit_nuitka\n\n    if exit_code_return:\n        my_print(\n            \"\"\"\\\nExit codes {exit_cpython:d} (CPython) != {exit_nuitka:d} (Nuitka)\"\"\".format(\n                exit_cpython=exit_cpython, exit_nuitka=exit_nuitka\n            )\n        )\n\n    exit_code = exit_code_stdout or exit_code_stderr or exit_code_return\n\n    if exit_code:\n        sys.exit(\"Error, outputs differed.\")\n\n\ndef main():\n    python_version = setup(suite=\"distutils\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    nuitka_dir = os.path.abspath(os.path.join(os.getcwd(), \"..\", \"..\"))\n\n    for filename, _filename_main in scanDirectoryForTestCaseFolders(\".\"):\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            try:\n                _handleCase(python_version, nuitka_dir, filename)\n            except NuitkaCalledProcessError:\n                test_logger.sysexit(\"Error in test case '%s'.\" % filename)\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/generated/BigConstantsTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test contains a very big constant, and this is to demonstrate we don't\n# create it at compile time.\nprint({{\"1234\" * 17000}})\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/BytesMethodsTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\nfrom nuitka.tools.testing.Common import checkReferenceCount\n\n# isort:start\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\n\n{% for bytes_method_name in bytes_method_names %}\n\n{% if bytes_method_name in (\"capitalize\", \"upper\", \"lower\", \"swapcase\", \"title\", \"isalnum\", \"isalpha\", \"isdigit\", \"islower\", \"isupper\", \"isspace\", \"istitle\") %}\n{% set method_arg_variants = [\"\"] %}\n{% elif \"partition\" in bytes_method_name or \"strip\" in bytes_method_name %}\n{% set method_arg_variants = [\"b'a'\", \"1\", \"None\"] %}\n{% elif bytes_method_name == \"splitlines\" %}\n{% set method_arg_variants = [\"\", \"True\"] %}\n{% elif \"split\" in bytes_method_name %}\n{% set method_arg_variants = [\"\", \"1\", \"b'a'\", \"None\", \"b'a', 'b'\", \"b'a', 1\", \"None, 1\"] %}\n{% elif bytes_method_name == \"join\"  %}\n{% set method_arg_variants = [\"[b'a', 1]\", \"None\", \"1\", \"[b'a', b'b']\"] %}\n{% elif bytes_method_name == \"replace\"  %}\n{% set method_arg_variants = [\"b'a', 1\", \"b'a', ''\"] %}\n{% elif bytes_method_name in (\"encode\", \"decode\") %}\n{% set method_arg_variants = [\"\", \"b'a'\", \"b'a', 'utf8'\"] %}\n{% elif \"find\" in bytes_method_name or \"index\" in bytes_method_name or \"with\" in bytes_method_name %}\n{% set method_arg_variants = [\"1\", \"b'a'\", \"b'a', b'b'\", \"b'a', b'b', b'c'\"] %}\n{% elif bytes_method_name == \"count\"  %}\n{% set method_arg_variants = [\"b'a'\", \"b'a', 1\", \"b'a', b'b'\", \"b'a', 1, 2\"] %}\n{% elif bytes_method_name == \"expandtabs\"  %}\n{% set method_arg_variants = [\"\", \"1\"] %}\n{% elif bytes_method_name == \"translate\"  %}\n{% set method_arg_variants = [\"b'12'\"] %}\n{% elif bytes_method_name in (\"zfill\", \"ljust\", \"rjust\", \"center\") %}\n{% set method_arg_variants = [\"12\"] %}\n{% else %}\n{% set method_arg_variants = [\"\", \"1\", \"b'a'\", \"b'a', b'b'\", \"b'a', b'b', b'c'\"] %}\n{% endif %}\n\n{% if method_arguments[bytes_method_name] %}\n{% do method_arg_variants.append(\"%s=1\" % method_arguments[bytes_method_name][-1]) %}\n{% endif %}\n\n{% for method_args in method_arg_variants %}\n\n{% set left_1 = \"b'some_value'\" %}\n{% set left_2 = \"b'other_value'\" %}\n\n{% set operation_id = \"check%s%s\" % (bytes_method_name.title(), (\"\"if loop.index == 0 else loop.index)) %}\n\ndef {{operation_id}}(cond=None):\n    # First value type, which we expect to be compile time computed.\n    try:\n        # We expect this to be compile time error checked still.\n        x = b\"static_value\".{{bytes_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time result:\", type(x), x)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = left.{{bytes_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime result:\", type(x), x)\n\n{{operation_id}}(1)\n{{operation_id}}(0)\n\ncheckReferenceCount({{operation_id}})\n\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/BytesMethodsTest32.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\nfrom nuitka.tools.testing.Common import checkReferenceCount\n\n# isort:start\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\n\n{% for bytes_method_name in bytes_method_names %}\n\n{% if bytes_method_name in (\"capitalize\", \"upper\", \"lower\", \"swapcase\", \"title\", \"isalnum\", \"isalpha\", \"isdigit\", \"islower\", \"isupper\", \"isspace\", \"istitle\") %}\n{% set method_arg_variants = [\"\"] %}\n{% elif \"partition\" in bytes_method_name or \"strip\" in bytes_method_name %}\n{% set method_arg_variants = [\"'a'\", \"1\", \"None\"] %}\n{% elif bytes_method_name == \"splitlines\" %}\n{% set method_arg_variants = [\"\", \"True\"] %}\n{% elif \"split\" in bytes_method_name %}\n{% set method_arg_variants = [\"\", \"1\", \"'a'\", \"None\", \"'a', 'b'\", \"'a', 1\", \"None, 1\"] %}\n{% elif bytes_method_name == \"join\"  %}\n{% set method_arg_variants = [\"['a', 1]\", \"None\", \"1\", \"['a', 'b']\"] %}\n{% elif bytes_method_name == \"replace\"  %}\n{% set method_arg_variants = [\"'a', 1\", \"'a', 'b'\"] %}\n{% elif bytes_method_name in (\"encode\", \"decode\") %}\n{% set method_arg_variants = [\"\", \"'a'\", \"'a', 'utf8'\"] %}\n{% elif \"find\" in bytes_method_name or \"index\" in bytes_method_name or \"with\" in bytes_method_name %}\n{% set method_arg_variants = [\"1\", \"'a'\", \"'a', 'b'\", \"'a', 'b', 'c'\"] %}\n{% elif bytes_method_name == \"count\"  %}\n{% set method_arg_variants = [\"'a'\", \"'a', 1\", \"'a', 'b'\", \"'a', 1, 2\"] %}\n{% elif bytes_method_name == \"expandtabs\"  %}\n{% set method_arg_variants = [\"\", \"1\"] %}\n{% elif bytes_method_name == \"translate\"  %}\n{% set method_arg_variants = [\"'12'\"] %}\n{% elif bytes_method_name in (\"zfill\", \"ljust\", \"rjust\", \"center\") %}\n{% set method_arg_variants = [\"12\"] %}\n{% else %}\n{% set method_arg_variants = [\"\", \"1\", \"'a'\", \"'a', 'b'\", \"'a', 'b', 'c'\"] %}\n{% endif %}\n\n{% if method_arguments[bytes_method_name] %}\n{% do method_arg_variants.append(\"%s=1\" % method_arguments[bytes_method_name][-1]) %}\n{% endif %}\n\n{% for method_args in method_arg_variants %}\n\n{% set left_1 = \"'some_value'\" %}\n{% set left_2 = \"'other_value'\" %}\n\n{% set operation_id = \"check%s%s\" % (bytes_method_name.title(), (\"\"if loop.index == 0 else loop.index)) %}\n\ndef {{operation_id}}(cond=None):\n    # First value type, which we expect to be compile time computed.\n    try:\n        # We expect this to be compile time error checked still.\n        x = \"static_value\".{{bytes_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time result:\", type(x), x)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = left.{{bytes_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"bytes.{{bytes_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime result:\", type(x), x)\n\n{{operation_id}}(1)\n{{operation_id}}(0)\n\ncheckReferenceCount({{operation_id}})\n\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/DictMethodsTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nfrom __future__ import print_function\n\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\nfrom nuitka.tools.testing.Common import checkReferenceCount\n\n# isort:start\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\n# To trigger hashing errors\nunhashable = []\n\n{% for dict_method_name in dict_method_names %}\n\n{% if dict_method_name == \"get\" %}\n{% set method_arg_variants = [\"1\", \"5\", \"[]\", \"unhashable\", \"1,7\", \"6,9\"] %}\n{% elif dict_method_name == \"has_key\" %}\n{% set method_arg_variants = [\"1\", \"5\", \"[]\", \"unhashable\"] %}\n{% elif dict_method_name == \"setdefault\" %}\n{% set method_arg_variants = [\"1\", \"5\", \"[]\", \"unhashable\", \"1,7\", \"unhashable,9\"] %}\n{% elif dict_method_name == \"pop\" %}\n{% set method_arg_variants = [\"1\", \"5\", \"[]\", \"unhashable\", \"1,7\", \"unhashable,9\"] %}\n{% elif dict_method_name == \"pop\" %}\n{% set method_arg_variants = [\"1\", \"5\", \"[]\", \"unhashable\", \"1,7\", \"unhashable,9\"] %}\n{% elif dict_method_name == \"update\" %}\n{% set method_arg_variants = [\"\", \"1\", \"[]\", \"{a:unhashable}, b=1, c=2\"] %}\n{% else %}\n{% set method_arg_variants = [\"\"] %}\n{% endif %}\n\n{% if dict_method_name in (\"setdefault\", \"pop\", \"popitem\", \"update\") %}\n{% set input_value = \"dict(kwargs)\" %}\n{% else %}\n{% set input_value = \"kwargs\" %}\n{% endif %}\n\n{% for method_args in method_arg_variants %}\n\n{% set left_1 = \"{1:2, 2:3}\" %}\n{% set left_2 = \"{2:3, 3:4}\" %}\n\n{% set operation_id = \"check%s%s\" % (dict_method_name.title(), (\"\"if loop.index == 0 else loop.index)) %}\n\ndef {{operation_id}}(cond = None, **kwargs):\n    # First value type, which we expect to be compile time recognized.\n\n    try:\n        x = kwargs.{{dict_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"dict.{{dict_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"dict.{{dict_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time result:\", type(x), x)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = left.{{dict_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"dict.{{dict_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"dict.{{dict_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime result:\", type(x), x)\n\n{{operation_id}}(1, a=2, b=1)\n{{operation_id}}(0, a=2, b=1)\n\ncheckReferenceCount({{operation_id}})\n\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/InplaceTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\nfrom __future__ import print_function\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\ndef displayException(e):\n    if len(e.args) == 1 and \"unsupported operand\" in e.args[0] and \"=\" not in e.args[0]:\n        e.args = (e.args[0].replace(\":\", \"=:\"),)\n\n    return e\n\n{% for op_name, ioperation in inplace_operations %}\n{% for l_type, left_1, left_2 in candidates %}\n{% for r_type, right_1, right_2 in candidates %}\n\n{% set operation_id = \"I\" + op_name + \"_\" + l_type + \"_\" + r_type %}\n\ndef {{operation_id}}(cond):\n    # First value, which we expect to be compile time computed.\n    left = {{left_1}}\n    right = {{right_1}}\n\n    try:\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} compile time occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} compile time result:\", left)\n\n    # Second value, which we expect to be compile time computed as well.\n    left = {{left_2}}\n    right = {{right_2}}\n\n    try:\n        # We expect this to be compile time computed.\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} compile time occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} compile time result:\", left)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n    right = {{right_1}} if cond else {{right_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} runtime result:\", left)\n\n\n    # Now we forget one type, forcing run time error checking.\n    left = forgetType({{left_1}})\n    right = {{right_1}}\n\n    try:\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} runtime result:\", left)\n\n    # And the other, forcing run time error checking.\n    left = {{left_1}}\n    right = forgetType({{right_1}})\n\n    try:\n        # We expect this to be run time error checked still.\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} runtime result:\", left)\n\n    # And both, forcing generic run time error checking.\n    left = forgetType({{left_1}})\n    right = forgetType({{right_1}})\n\n    try:\n        # We expect this to be compile time error checked still.\n        left {{ioperation}}= right\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", displayException(e))\n    else:\n        print(\"{{operation_id}} runtime result:\", left)\n\n{{operation_id}}(0)\n{{operation_id}}(1)\n\n{% endfor %}\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/OperationsTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\nfrom __future__ import print_function\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\n\n{% for op_name, operation in operations %}\n{% for l_type, left_1, left_2 in candidates %}\n{% for r_type, right_1, right_2 in candidates %}\n\n{% set operation_id = op_name + \"_\" + l_type + \"_\" + r_type %}\n\ndef {{operation_id}}(cond):\n    # First value, which we expect to be compile time computed.\n    left = {{left_1}}\n    right = {{right_1}}\n\n    try:\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} compile time occurred:\", e)\n    else:\n        print(\"{{operation_id}} compile time result:\", x)\n\n    # Second value, which we expect to be compile time computed as well.\n    left = {{left_2}}\n    right = {{right_2}}\n\n    try:\n        # We expect this to be compile time computed.\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} compile time occurred:\", e)\n    else:\n        print(\"{{operation_id}} compile time result:\", x)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n    right = {{right_1}} if cond else {{right_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", e)\n    else:\n        print(\"{{operation_id}} runtime result:\", x)\n\n    # Now we forget one type, forcing run time error checking.\n    left = forgetType({{left_1}})\n    right = {{right_1}}\n\n    try:\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", e)\n    else:\n        print(\"{{operation_id}} runtime result:\", x)\n\n    # And the other, forcing run time error checking.\n    left = {{left_1}}\n    right = forgetType({{right_1}})\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", e)\n    else:\n        print(\"{{operation_id}} runtime result:\", x)\n\n    # And both, forcing generic run time error checking.\n    left = forgetType({{left_1}})\n    right = forgetType({{right_1}})\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = {{makeOperatorUsage(operation, \"left\", \"right\")}}\n    except Exception as e: # pylint: disable=broad-except\n        print(\"{{operation_id}} runtime occurred:\", e)\n    else:\n        print(\"{{operation_id}} runtime result:\", x)\n\n{{operation_id}}(1)\n{{operation_id}}(0)\n\n{% endfor %}\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/StrMethodsTest.py.j2",
    "content": "{#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}\n\n# This test does check operations in optimizable and not optimizable forms\n# to check for proper errors, exceptions, etc.\n\n# While we use that for comparison code, no need to compile that.\n# nuitka-project: --nofollow-import-to=nuitka\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\nfrom nuitka.tools.testing.Common import checkReferenceCount\n\n# isort:start\n\n# Function to hide type because it is not seen through\ndef forgetType(value):\n    return value\n\n\n{% for str_method_name in str_method_names %}\n\n{% if str_method_name in (\"capitalize\", \"upper\", \"lower\", \"swapcase\", \"title\", \"isalnum\", \"isalpha\", \"isdigit\", \"islower\", \"isupper\", \"isspace\", \"istitle\") %}\n{% set method_arg_variants = [\"\"] %}\n{% elif \"partition\" in str_method_name or \"strip\" in str_method_name %}\n{% set method_arg_variants = [\"'a'\", \"1\", \"None\"] %}\n{% elif str_method_name == \"splitlines\" %}\n{% set method_arg_variants = [\"\", \"True\"] %}\n{% elif \"split\" in str_method_name %}\n{% set method_arg_variants = [\"\", \"1\", \"'a'\", \"None\", \"'a', 'b'\", \"'a', 1\", \"None, 1\"] %}\n{% elif str_method_name == \"join\"  %}\n{% set method_arg_variants = [\"['a', 1]\", \"None\", \"1\", \"['a', 'b']\"] %}\n{% elif str_method_name == \"replace\"  %}\n{% set method_arg_variants = [\"'a', 1\", \"'a', 'b'\"] %}\n{% elif str_method_name in (\"encode\", \"decode\") %}\n{% set method_arg_variants = [\"\", \"'a'\", \"'a', 'utf8'\"] %}\n{% elif \"find\" in str_method_name or \"index\" in str_method_name or \"with\" in str_method_name %}\n{% set method_arg_variants = [\"1\", \"'a'\", \"'a', 'b'\", \"'a', 'b', 'c'\"] %}\n{% elif str_method_name == \"count\"  %}\n{% set method_arg_variants = [\"'a'\", \"'a', 1\", \"'a', 'b'\", \"'a', 1, 2\"] %}\n{% elif str_method_name == \"expandtabs\"  %}\n{% set method_arg_variants = [\"\", \"1\"] %}\n{% elif str_method_name == \"translate\"  %}\n{% set method_arg_variants = [\"'12'\"] %}\n{% elif str_method_name in (\"zfill\", \"ljust\", \"rjust\", \"center\") %}\n{% set method_arg_variants = [\"12\"] %}\n{% else %}\n{% set method_arg_variants = [\"\", \"1\", \"'a'\", \"'a', 'b'\", \"'a', 'b', 'c'\"] %}\n{% endif %}\n\n{% if method_arguments[str_method_name] %}\n{% do method_arg_variants.append(\"%s=1\" % method_arguments[str_method_name][-1]) %}\n{% endif %}\n\n{% for method_args in method_arg_variants %}\n\n{% set left_1 = \"'some_value'\" %}\n{% set left_2 = \"'other_value'\" %}\n\n{% set operation_id = \"check%s%s\" % (str_method_name.title(), (\"\"if loop.index == 0 else loop.index)) %}\n\ndef {{operation_id}}(cond=None):\n    # First value type, which we expect to be compile time computed.\n    try:\n        # We expect this to be compile time error checked still.\n        x = \"static_value\".{{str_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"str.{{str_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"str.{{str_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) compile time result:\", type(x), x)\n\n    # Now the branch may make things less clear for mixed types and\n    # also require the operation to be checked at run time.\n    left = {{left_1}} if cond else {{left_2}}\n\n    try:\n        # We expect this to be compile time error checked still.\n        x = left.{{str_method_name}}({{method_args}})\n    except Exception as e: # pylint: disable=broad-except\n        if cond is not None:\n            print(\"str.{{str_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime occurred:\", repr(e))\n    else:\n        if cond is not None:\n            print(\"str.{{str_method_name}}({{method_args.count(\",\")+1 if method_args else 0}} args) runtime result:\", type(x), x)\n\n{{operation_id}}(1)\n{{operation_id}}(0)\n\ncheckReferenceCount({{operation_id}})\n\n{% endfor %}\n{% endfor %}\n\n{#     Python test originally created or extracted from other peoples work. The #}\n{#     parts from me are licensed as below. It is at least Free Software where  #}\n{#     it's copied from other people. In these cases, that will normally be     #}\n{#     indicated.                                                               #}\n{#                                                                              #}\n{#     Licensed under the Apache License, Version 2.0 (the \"License\");          #}\n{#     you may not use this file except in compliance with the License.         #}\n{#     You may obtain a copy of the License at                                  #}\n{#                                                                              #}\n{#         http://www.apache.org/licenses/LICENSE-2.0                           #}\n{#                                                                              #}\n{#     Unless required by applicable law or agreed to in writing, software      #}\n{#     distributed under the License is distributed on an \"AS IS\" BASIS,        #}\n{#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #}\n{#     See the License for the specific language governing permissions and      #}\n{#     limitations under the License.                                           #}\n"
  },
  {
    "path": "tests/generated/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for generated tests of Nuitka.\n\nThese tests are created on the fly, and some use Nuitka internals to\ndecide what to test for or how, e.g. to check that a type indeed does\nhave a certain slot.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport nuitka.specs.BuiltinStrOperationSpecs\nfrom nuitka.tools.specialize.SpecializePython import (\n    python2_dict_methods as dict_method_names,\n)\nfrom nuitka.tools.specialize.SpecializePython import (\n    python2_str_methods as str_method_names,\n)\nfrom nuitka.tools.specialize.SpecializePython import (\n    python3_bytes_methods as bytes_method_names,\n)\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    decideNeeds2to3,\n    my_print,\n    scanDirectoryForTestCases,\n    setup,\n)\n\n# For templating.\noperations = (\n    (\"Add\", \"+\"),\n    (\"Sub\", \"-\"),\n    (\"Pow\", \"**\"),\n    (\"Mult\", \"*\"),\n    (\"FloorDiv\", \"//\"),\n    (\"Div\", \"/\"),\n    (\"Mod\", \"%\"),\n    (\"Pow\", \"**\"),\n    (\"LShift\", \"<<\"),\n    (\"RShift\", \">>\"),\n    (\"BitAnd\", \"&\"),\n    (\"BitOr\", \"|\"),\n    (\"BitXor\", \"^\"),\n    (\"Divmod\", \"divmod\"),\n    (\"Subscript\", \"[\"),\n)\n\n\n# For typical constant values to use in operation tests.\ncandidates = (\n    (\"NoneType\", \"None\", \"None\"),\n    (\"bool\", \"True\", \"False\"),\n    (\"int\", \"17\", \"-9\"),\n    (\"float\", \"17.2\", \"-8\"),\n    (\"complex\", \"2j\", \"-4j\"),\n    (\"str\", \"'lala'\", \"'lol'\"),\n    (\"bytearray\", \"bytearray(b'lulu')\", \"bytearray(b'lol')\"),\n    (\"list\", \"[1,2]\", \"[3]\"),\n    (\"tuple\", \"(1,2)\", \"(3,)\"),\n    (\"set\", \"set([1,2])\", \"set([3])\"),\n    (\"frozenset\", \"frozenset([1,2])\", \"frozenset([3])\"),\n    (\"dict\", \"{1:2}\", \"{3:4}\"),\n)\n\n\n# For making an operator usage, needed because divmod is function style.\ndef makeOperatorUsage(operator, left, right):\n    if operator == \"divmod\":\n        return \"divmod(%s, %s)\" % (left, right)\n    elif operator == \"[\":\n        return \"%s[%s]\" % (left, right)\n    else:\n        return \"%s %s %s\" % (left, operator, right)\n\n\ndef main():\n    python_version = setup(suite=\"generated\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    # Singleton, pylint: disable=global-statement\n    global operations\n    global candidates\n\n    if python_version >= (3, 5):\n        operations += ((\"MatMult\", \"@\"),)\n\n    if python_version < (3,):\n        candidates += ((\"long\", \"17L\", \"-9L\"),)\n        candidates += ((\"unicode\", \"u'lala'\", \"u'lol'\"),)\n    else:\n        candidates += ((\"bytes\", \"b'lala'\", \"b'lol'\"),)\n\n    method_arguments = {}\n\n    for str_method_name in str_method_names:\n        spec = getattr(\n            nuitka.specs.BuiltinStrOperationSpecs, \"str_%s_spec\" % str_method_name, None\n        )\n\n        if spec is None:\n            my_print(\n                \"Warning, str function '%s' has no spec.\" % str_method_name,\n                style=\"yellow\",\n            )\n            continue\n\n        method_arguments[str_method_name] = spec.getArgumentNames()\n\n    for bytes_method_name in bytes_method_names:\n        spec = getattr(\n            nuitka.specs.BuiltinBytesOperationSpecs,\n            \"bytes_%s_spec\" % bytes_method_name,\n            None,\n        )\n\n        if spec is None:\n            my_print(\n                \"Warning, bytes function '%s' has no spec.\" % bytes_method_name,\n                style=\"yellow\",\n            )\n            continue\n\n        method_arguments[bytes_method_name] = spec.getArgumentNames()\n\n    for dict_method_name in dict_method_names:\n        spec = getattr(\n            nuitka.specs.BuiltinDictOperationSpecs,\n            \"dict_%s_spec\" % dict_method_name,\n            None,\n        )\n\n        if spec is None:\n            my_print(\n                \"Warning, dict function '%s' has no spec.\" % dict_method_name,\n                style=\"yellow\",\n            )\n            continue\n\n        method_arguments[dict_method_name] = spec.getArgumentNames()\n\n    template_context = {\n        \"operations\": operations,\n        \"dict_method_names\": [\n            dict_method_name\n            for dict_method_name in dict_method_names\n            if dict_method_name in method_arguments\n        ],\n        \"str_method_names\": [\n            str_method_name\n            for str_method_name in str_method_names\n            if str_method_name in method_arguments\n        ],\n        \"bytes_method_names\": [\n            bytes_method_name\n            for bytes_method_name in bytes_method_names\n            if bytes_method_name in method_arguments\n        ],\n        \"method_arguments\": method_arguments,\n        \"inplace_operations\": tuple(\n            operation\n            for operation in operations\n            if operation[0] not in (\"Divmod\", \"Subscript\")\n        ),\n        \"candidates\": candidates,\n        \"makeOperatorUsage\": makeOperatorUsage,\n        \"len\": len,\n    }\n\n    # Now run all the tests in this directory.\n    for filename in scanDirectoryForTestCases(\".\", template_context=template_context):\n        extra_flags = [\n            # No error exits normally, unless we break tests, and that we would\n            # like to know.\n            \"expect_success\",\n            # Keep no temporary files.\n            \"remove_output\",\n            # Do not follow imports.\n            \"--nofollow-imports\",\n            # Use the original __file__ value, at least one case warns about things\n            # with filename included.\n            \"--file-reference-choice=original\",\n            # Cache the CPython results for reuse, they will normally not change.\n            \"cpython_cache\",\n        ]\n\n        # This test should be run with the debug Python, and makes outputs to\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            compareWithCPython(\n                dirname=None,\n                filename=filename,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=decideNeeds2to3(filename),\n            )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/library/check_yaml_anti_bloat_modules.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test runner compiles all Python files as a module.\n\nThis is a test to achieve some coverage, it will only find assertions of\nwithin Nuitka or warnings from the C compiler. Code will not be run\nnormally.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka import Options\nfrom nuitka.__past__ import iter_modules\nfrom nuitka.importing.Importing import (\n    addMainScriptDirectory,\n    decideModuleSourceRef,\n    locateModule,\n)\nfrom nuitka.tools.testing.Common import my_print, setup, test_logger\nfrom nuitka.Tracing import plugins_logger\nfrom nuitka.tree.SourceHandling import (\n    getSourceCodeDiff,\n    readSourceCodeFromFilenameWithInformation,\n)\nfrom nuitka.utils.ModuleNames import ModuleName\n\npython_version = setup(suite=\"python_modules\", needs_io_encoding=True)\n\n\naddMainScriptDirectory(\"/doesnotexist\")\nOptions.is_full_compat = False\n\n\ndef scanModule(name_space, module_iterator):\n    # plenty details here, pylint: disable=too-many-branches,too-many-locals\n\n    from nuitka.tree.TreeHelpers import parseSourceCodeToAst\n\n    for module_desc in module_iterator:\n        if name_space is None:\n            module_name = ModuleName(module_desc.name)\n        else:\n            module_name = name_space.getChildNamed(module_desc.name)\n\n        try:\n            _module_name, module_filename, finding = locateModule(\n                module_name=module_name, parent_package=None, level=0\n            )\n        except AssertionError:\n            # TODO: Currently bytecode only modules are triggering an assertion.\n            continue\n\n        assert _module_name == module_name, module_desc\n\n        # Only source code that is found.\n        if module_filename is None:\n            continue\n\n        (\n            _main_added,\n            _is_package,\n            _is_namespace,\n            _source_ref,\n            source_filename,\n        ) = decideModuleSourceRef(\n            filename=module_filename,\n            module_name=module_name,\n            is_main=False,\n            is_fake=False,\n            logger=test_logger,\n        )\n\n        try:\n            (\n                source_code,\n                original_source_code,\n                contributing_plugins,\n            ) = readSourceCodeFromFilenameWithInformation(\n                module_name=module_name, source_filename=source_filename\n            )\n        except SyntaxError:\n            continue\n\n        try:\n            parseSourceCodeToAst(\n                source_code=source_code,\n                module_name=module_name,\n                filename=source_filename,\n                line_offset=0,\n            )\n        except (SyntaxError, IndentationError) as e:\n            try:\n                parseSourceCodeToAst(\n                    source_code=original_source_code,\n                    module_name=module_name,\n                    filename=source_filename,\n                    line_offset=0,\n                )\n            except (SyntaxError, IndentationError):\n                # Also an exception without the plugins, that is OK\n                pass\n            else:\n                source_diff = getSourceCodeDiff(original_source_code, source_code)\n\n                for line in source_diff:\n                    plugins_logger.warning(line)\n\n                if len(contributing_plugins) == 1:\n                    contributing_plugins[0].sysexit(\n                        \"Making changes to '%s' that cause SyntaxError '%s'\"\n                        % (module_name, e)\n                    )\n                else:\n                    test_logger.sysexit(\n                        \"One of the plugins '%s' is making changes to '%s' that cause SyntaxError '%s'\"\n                        % (\",\".join(contributing_plugins), module_name, e)\n                    )\n\n        my_print(module_name, \":\", finding, \"OK\")\n\n        if module_desc.ispkg:\n            scanModule(module_name, iter_modules([module_filename]))\n\n\ndef main():\n    scanModule(None, iter_modules())\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/library/compile_extension_modules.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test runner compiles all extension modules for standalone mode.\n\nThis is a test to reveal hidden dependencies on a system.\n\n\"\"\"\n\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport shutil\n\nfrom nuitka.tools.testing.Common import (\n    check_output,\n    checkLoadedFileAccesses,\n    checkSucceedsWithCPython,\n    compileLibraryTest,\n    createSearchMode,\n    displayFileContents,\n    displayFolderContents,\n    displayRuntimeTraces,\n    getTempDir,\n    my_print,\n    setup,\n    test_logger,\n)\nfrom nuitka.tools.testing.RuntimeTracing import getRuntimeTraceOfLoadedFiles\nfrom nuitka.utils.Execution import NuitkaCalledProcessError\nfrom nuitka.utils.FileOperations import getFileContents, openTextFile\nfrom nuitka.utils.ModuleNames import ModuleName\n\n\ndef displayError(dirname, filename):\n    assert dirname is None\n\n    dist_path = filename[:-3] + \".dist\"\n    displayFolderContents(\"dist folder\", dist_path)\n\n    inclusion_log_path = filename[:-3] + \".py.inclusion.log\"\n    displayFileContents(\"inclusion log\", inclusion_log_path)\n\n\ndef main():\n    setup(suite=\"extension_modules\", needs_io_encoding=True)\n    search_mode = createSearchMode()\n\n    tmp_dir = getTempDir()\n\n    done = set()\n\n    def decide(root, filename):\n        if os.path.sep + \"Cython\" + os.path.sep in root:\n            return False\n\n        if (\n            root.endswith(os.path.sep + \"matplotlib\")\n            or os.path.sep + \"matplotlib\" + os.path.sep in root\n        ):\n            return False\n\n        if filename.endswith(\"linux-gnu_d.so\"):\n            return False\n\n        if root.endswith(os.path.sep + \"msgpack\"):\n            return False\n\n        first_part = filename.split(\".\")[0]\n        if first_part in done:\n            return False\n        done.add(first_part)\n\n        return filename.endswith((\".so\", \".pyd\")) and not filename.startswith(\n            \"libpython\"\n        )\n\n    current_dir = os.path.normpath(os.getcwd())\n    current_dir = os.path.normcase(current_dir)\n\n    def action(stage_dir, root, path):\n        command = [\n            sys.executable,\n            os.path.join(\"..\", \"..\", \"bin\", \"nuitka\"),\n            \"--stand\",\n            \"--run\",\n            \"--output-dir=%s\" % stage_dir,\n            \"--remove-output\",\n            \"--no-progressbar\",\n        ]\n\n        filename = os.path.join(stage_dir, \"importer.py\")\n\n        assert path.startswith(root)\n\n        module_name = path[len(root) + 1 :]\n        module_name = module_name.split(\".\")[0]\n        module_name = module_name.replace(os.path.sep, \".\")\n\n        module_name = ModuleName(module_name)\n\n        with openTextFile(filename, \"w\") as output:\n            plugin_names = set([\"pylint-warnings\"])\n            if module_name.hasNamespace(\"PySide2\"):\n                plugin_names.add(\"pyside2\")\n            elif module_name.hasNamespace(\"PySide6\"):\n                plugin_names.add(\"pyside6\")\n            elif module_name.hasNamespace(\"PyQt5\"):\n                plugin_names.add(\"pyqt5\")\n            elif module_name.hasNamespace(\"PyQt6\"):\n                plugin_names.add(\"pyqt6\")\n            else:\n                plugin_names.add(\"no-qt\")\n\n            for plugin_name in plugin_names:\n                output.write(\"# nuitka-project: --enable-plugin=%s\\n\" % plugin_name)\n\n            # Make it an error to find unwanted bloat compiled in.\n            output.write(\"# nuitka-project: --noinclude-default-mode=error\\n\")\n\n            output.write(\"# nuitka-project: --standalone\\n\")\n\n            output.write(\"import \" + module_name.asString() + \"\\n\")\n            output.write(\"print('OK.')\")\n\n        command += os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n        command.append(filename)\n\n        if checkSucceedsWithCPython(filename):\n            try:\n                output = check_output(command).splitlines()\n            except NuitkaCalledProcessError as e:\n                my_print(\"SCRIPT:\", filename, style=\"blue\")\n                my_print(getFileContents(filename))\n\n                test_logger.sysexit(\"Error with compilation: %s\" % e)\n            # only trying to check for no exception, pylint: disable=try-except-raise\n            except Exception:\n                raise\n            else:\n                assert os.path.exists(filename[:-3] + \".dist\")\n\n                binary_filename = os.path.join(\n                    filename[:-3] + \".dist\",\n                    \"importer.exe\" if os.name == \"nt\" else \"importer\",\n                )\n                loaded_filenames = getRuntimeTraceOfLoadedFiles(\n                    logger=test_logger,\n                    command=[binary_filename],\n                )\n\n                outside_accesses = checkLoadedFileAccesses(\n                    loaded_filenames=loaded_filenames, current_dir=os.getcwd()\n                )\n\n                if outside_accesses:\n                    displayError(None, filename)\n                    displayRuntimeTraces(test_logger, binary_filename)\n\n                    test_logger.warning(\n                        \"Should not access these file(s): '%r'.\" % outside_accesses\n                    )\n\n                    search_mode.onErrorDetected(1)\n\n                if output[-1] != b\"OK.\":\n                    my_print(\" \".join(command))\n                    my_print(filename)\n                    my_print(output)\n                    test_logger.sysexit(\"FAIL.\")\n\n                my_print(\"OK.\")\n\n                assert not outside_accesses, outside_accesses\n\n                shutil.rmtree(filename[:-3] + \".dist\")\n        else:\n            my_print(\"SKIP (does not work with CPython)\")\n\n    compileLibraryTest(\n        search_mode=search_mode,\n        stage_dir=os.path.join(tmp_dir, \"compile_extensions\"),\n        decide=decide,\n        action=action,\n    )\n\n    my_print(\"FINISHED, all extension modules compiled.\")\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/library/compile_python_modules.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test runner compiles all Python files as a module.\n\nThis is a test to achieve some coverage, it will only find assertions of\nwithin Nuitka or warnings from the C compiler. Code will not be run\nnormally.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport subprocess\n\nfrom nuitka.tools.testing.Common import (\n    checkCompilesNotWithCPython,\n    compileLibraryTest,\n    createSearchMode,\n    getPythonArch,\n    getPythonVendor,\n    getTempDir,\n    my_print,\n    setup,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\n\npython_version = setup(suite=\"python_modules\", needs_io_encoding=True)\npython_vendor = getPythonVendor()\npython_arch = getPythonArch()\n\nsearch_mode = createSearchMode()\n\ntmp_dir = getTempDir()\n\n# spell-checker: ignore idnadata,tweedie\n\nignore_list = (\n    \"__phello__.foo.py\",  # Triggers error for \".\" in module name\n    \"idnadata\",  # Avoid too complex code for main program.\n    \"joined_strings.py\",\n    # Incredible amount of memory in C compiler for test code\n    \"test_spin.py\",\n    # Uses outside modules up the chain\n    \"cheshire_tomography.py\",\n)\n\nlate_syntax_errors = (\n    # No syntax error with Python2 compileall, but run time only:\n    \"_identifier.py\",\n    \"bench.py\",\n    \"_tweedie_compound_poisson.py\",\n    \"session.py\",\n)\n\n\ndef decide(_root, filename):\n    return (\n        filename.endswith(\".py\")\n        and filename not in ignore_list\n        and \"(\" not in filename\n        and filename.count(\".\") == 1\n    )\n\n\ndef action(stage_dir, _root, path):\n    command = [\n        sys.executable,\n        os.path.join(\"..\", \"..\", \"bin\", \"nuitka\"),\n        \"--module\",\n        \"--output-dir=%s\" % stage_dir,\n        \"--remove-output\",\n        \"--quiet\",\n        \"--nofollow-imports\",\n        \"--no-progressbar\",\n    ]\n\n    command += os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n    suffix = getSharedLibrarySuffix(preferred=True)\n\n    if os.path.basename(path) == \"__init__.py\":\n        source_filename = os.path.dirname(path)\n        target_filename = os.path.basename(source_filename) + suffix\n    else:\n        source_filename = path\n        target_filename = os.path.basename(source_filename)[:-3] + suffix\n\n    target_filename = target_filename.replace(\"(\", \"\").replace(\")\", \"\")\n\n    command.append(source_filename)\n\n    try:\n        subprocess.check_call(command)\n    except subprocess.CalledProcessError:\n        basename = os.path.basename(path)\n\n        if basename in late_syntax_errors:\n            my_print(\"Syntax error is known unreliable with file %s.\" % basename)\n        else:\n            my_print(\"Falling back to full comparison due to error exit.\")\n\n            checkCompilesNotWithCPython(\n                dirname=None, filename=path, search_mode=search_mode\n            )\n    else:\n        my_print(\"OK\")\n\n        os.unlink(os.path.join(stage_dir, target_filename))\n\n\ncompileLibraryTest(\n    search_mode=search_mode,\n    stage_dir=os.path.join(\n        tmp_dir,\n        \"compile_library_%s-%s-%s\"\n        % (\".\".join(str(d) for d in python_version), python_arch, python_vendor),\n    ),\n    decide=decide,\n    action=action,\n)\n\nsearch_mode.finish()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/onefile/HelloWorldTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# nuitka-project: --onefile\n\n# Sometimes we disable with --no-onefile to only do standalone.\n# nuitka-project: --standalone\n\n# Lets have some version information to coverage purposes in here too.\n\n# nuitka-project: --company-name=\"Nuitka Test Company\"\n# nuitka-project: --product-name=\"Hello World Deluxe\"\n# nuitka-project: --product-version=1\n\nprint(\"Hello Onefile World!\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/onefile/KeyboardInterruptTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" In this test, we get killed after some time has passed, and want to see the KeyboardInterrupt exit.\n\n\"\"\"\n\n# nuitka-project: --onefile\n\nimport sys\nimport time\n\nprint(\"Hello world, will you kill me?\")\nprint(\"Running\", sys.version_info)\n\ntry:\n    time.sleep(10)\nexcept KeyboardInterrupt:\n    print(\"Received KeyboardInterrupt.\")\n    sys.exit(0)\nelse:\n    print(\"Received no KeyboardInterrupt.\")\n    sys.exit(1)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/onefile/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for onefile program tests of Nuitka.\n\nThese tests aim at showing that one specific functions work in onefile\nmode, trying to find issues with that form of packaging.\n\n\"\"\"\n\n\nimport os\nimport sys\n\n# Find nuitka package relative to us. The replacement is for POSIX python\n# and Windows paths on command line.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(\n            os.path.dirname(os.path.abspath(__file__.replace(\"\\\\\", os.sep))), \"..\", \"..\"\n        )\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    checkLoadedFileAccesses,\n    checkTestRequirements,\n    compareWithCPython,\n    createSearchMode,\n    displayFileContents,\n    displayRuntimeTraces,\n    reportSkip,\n    scanDirectoryForTestCases,\n    setup,\n    test_logger,\n)\nfrom nuitka.tools.testing.RuntimeTracing import (\n    doesSupportTakingRuntimeTrace,\n    getRuntimeTraceOfLoadedFiles,\n)\nfrom nuitka.utils.Timing import TimerReport\nfrom nuitka.utils.Utils import isMacOS\n\n\ndef displayError(dirname, filename):\n    assert dirname is None\n\n    inclusion_log_path = filename[:-3] + \".py.inclusion.log\"\n    displayFileContents(\"inclusion log\", inclusion_log_path)\n\n\ndef main():\n    python_version = setup(suite=\"onefile\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    for filename in scanDirectoryForTestCases(\".\"):\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if not active:\n            continue\n\n        extra_flags = [\n            \"expect_success\",\n            \"remove_output\",\n            # Keep the binary, normally \"remove_output\" includes that.\n            \"--keep-binary\",\n            # Cache the CPython results for reuse, they will normally not change.\n            \"cpython_cache\",\n            # To understand what is slow.\n            \"timing\",\n            # The onefile can warn about zstandard not being installed.\n            \"ignore_warnings\",\n        ]\n\n        if filename == \"KeyboardInterruptTest.py\":\n            if isMacOS():\n                reportSkip(\n                    \"Exit code from KeyboardInterrupt on macOS is not yet good.\",\n                    \".\",\n                    filename,\n                )\n                continue\n\n            if python_version < (3,):\n                reportSkip(\n                    \"Python2 reports KeyboardInterrupt, but too late\",\n                    \".\",\n                    filename,\n                )\n                continue\n\n            if os.name == \"nt\":\n                reportSkip(\n                    \"Testing cannot send KeyboardInterrupt on Windows yet\",\n                    \".\",\n                    filename,\n                )\n                continue\n\n            extra_flags.append(\"--send-ctrl-c\")\n\n        # skip each test if their respective requirements are not met\n        requirements_met, error_message = checkTestRequirements(filename)\n        if not requirements_met:\n            reportSkip(error_message, \".\", filename)\n            continue\n\n        test_logger.info(\n            \"Consider output of onefile mode compiled program: %s\" % filename\n        )\n\n        # First compare so we know the program behaves identical.\n        compareWithCPython(\n            dirname=None,\n            filename=filename,\n            extra_flags=extra_flags,\n            search_mode=search_mode,\n            needs_2to3=False,\n            on_error=displayError,\n        )\n\n        binary_filename = filename[:-3] + (\".exe\" if os.name == \"nt\" else \".bin\")\n\n        try:\n            if not doesSupportTakingRuntimeTrace():\n                test_logger.info(\"Runtime traces are not possible on this machine.\")\n                continue\n            # This test case requires a kill, so kill it there.\n            if filename == \"KeyboardInterruptTest.py\":\n                test_logger.info(\n                    \"Runtime traces are not taken for case that needs killing.\"\n                )\n                continue\n\n            # Then use \"strace\" on the result.\n            with TimerReport(\n                \"Determining run time loaded files took %.2f\", logger=test_logger\n            ):\n                loaded_filenames = getRuntimeTraceOfLoadedFiles(\n                    logger=test_logger, command=[binary_filename]\n                )\n\n            illegal_accesses = checkLoadedFileAccesses(\n                loaded_filenames=loaded_filenames, current_dir=os.getcwd()\n            )\n\n            if illegal_accesses:\n                displayError(None, filename)\n                displayRuntimeTraces(test_logger, binary_filename)\n\n                test_logger.warning(\n                    \"Should not access these file(s): '%s'.\"\n                    % \",\".join(illegal_accesses)\n                )\n\n                search_mode.onErrorDetected(1)\n\n        finally:\n            os.unlink(binary_filename)\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/ArgumentTypes.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f(b, *args, **kwargs):\n    return type(args), type(kwargs)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/AttributesTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint((1).imag)\nprint(int.__name__)\nprint((1).__class__)\n\nprint(getattr(1, \"real\"))\nprint(getattr(1, \"real\", None))\nprint(hasattr(1, \"real\"))\nprint((0.0).real)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/CallsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Optimization of calls\n\n\nTODO: This is only a placeholder, currently no real calls will be optimized.\n\"\"\"\n\nprint(range(4))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/ConditionsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(1 if [1, 2] else 2)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/DecodingOperationsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(chr(7))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/FormatStringsTest36.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Format string with local compile time constants fully optimized:\ndef f():\n    a = \"1\"\n    b = \"2\"\n\n    return f\"r:{a!r} and a:{a!a} and s:{a!s}\"\n\n\nprint(f())\n\n\n# Empty f string fully optimized:\ndef f():\n    return f\"\"\n\n\nprint(f())\n\n\n# Text only f string fully optimized:\ndef f():\n    return f\"some_text\"\n\n\nprint(f())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/HardImportsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport os\nimport sys\n\n\ndef sysAttributes():\n    return (\n        sys.version_info,\n        sys.version_info[0],\n        sys.version_info.major,\n        sys.version,\n        sys.platform,\n        sys.maxsize,\n    )\n\n\ndef osAttributes():\n    return os.name\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/HardImportsTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\n\ndef sysOptionalAttribute():\n    return sys.maxint, sys.subversion\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/Iterations.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nz = next(iter((3, 4)))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/LenTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(len(range(266)))\nprint(len(range(266, 9999)))\nprint(len(range(266, 9999, 3)))\nprint(len(range(266, 9999, -3)))\nprint(len(range(22266, 9999, -3)))\nprint(len(range(22266, 9998, -3)))\nprint(len(range(22266, 9997, -3)))\nprint(len(range(22266, 9996, -3)))\nprint(len(range(0, 3, 3)))\nprint(len([3, 3.3]))\nprint(len((3, 3.3)))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/MatchingTest310.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f():\n    title = \"fred\"\n    match title:\n        case \"Weapon 1 Swap\":\n            title = \"Alt Weapon 1\"\n        case \"Weapon 2 Swap\":\n            title = \"Alt Weapon 2\"\n\n    return title\n\n\nprint(f())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/OperationsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# This test is SPECIAL. Everything in here, MUST be statically optimized,\n# and be a print of a constant, or a function that becomes a return value\n# that is constant.\n\nprint(not bool)\nprint(not {})\nprint(not 7)\nprint(bool or len)\nprint(False or dict)\nprint(type(Ellipsis))\nprint(\"a\" in \"abba\")\nprint(\"a\" not in \"abba\")\nprint(len(\"a\" * 10000))\nprint(len(10000 * \"a\"))\nprint(len((1,) * 20000))\nprint(len(20000 * (1,)))\nprint(len([1] * 30000))\nprint(len(30000 * [1]))\nprint(len(unicode(\"a\") * 40000))\nprint(len(40000 * unicode(\"a\")))\n\n\n# For operations, we use function return values of local variables that will\n# have to become constant.\ndef simpleAssignment():\n    x = 2\n    return x\n\n\ndef inplaceOperationIncrement():\n    x = 2\n    x += 1\n    return x\n\n\ndef inplaceOperationProduct():\n    x = 2\n    x *= 2\n    return x\n\n\ndef inplaceOperationPower():\n    x = 2\n    x **= 2\n    return x\n\n\ndef inplaceOperationDecrement():\n    x = 2\n    x -= 8\n    return x\n\n\n#     x //= 5\ndef inplaceOperationFloorDivision():\n    x = 2\n    x //= 5\n    return x\n\n\ndef inplaceOperationModulus():\n    x = 2\n    x %= 3\n    return x\n\n\ndef inplaceOperationAnd():\n    x = 2\n    x &= 2\n    return x\n\n\ndef inplaceOperationOr():\n    x = 2\n    x |= 5\n    return x\n\n\ndef inplaceOperationXor():\n    x = 2\n    x ^= 1\n    return x\n\n\ndef inplaceOperationDivision():\n    x = 2\n    x /= 2\n    return x\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/SubscriptsTest.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint((1, 2, 3)[1])\nprint((1, 2, 3)[1:])\nprint((1, 2, 3)[:2])\nprint((1, 2, 3)[:])\nprint((1, 2, 3)[1:2])\nprint((1, 2, 3, 4, 5, 6)[1::2])\nprint((1, 2, 3, 4, 5, 6)[4::-2])\nprint((1, 2, 3, 4, 5, 6)[-1])\nprint((1, 2, 3, 4, 5, 6)[-3:])\nprint((1, 2, 3, 4, 5, 6)[:-1])\nprint((1, 2, 3, 4, 5, 6)[::])\nprint((1, 2, 3, 4, 5, 6)[-3:-1])\nprint((1, 2, 3, 4, 5, 6)[:-1:2])\nprint((1, 2, 3, 4, 5, 6)[-1::-2])\nprint((1, 2, 3, 4, 5, 6)[slice(-1, None, -2)])\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/optimizations/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test runners test\n\nThis shows that known good existing static optimization works and produces\nconstant results. This should be used to preserve successful optimization\nat compile time against later changes breaking them undetected.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# The test runner needs \"lxml\" itself.\ntry:\n    import lxml.etree\nexcept ImportError:\n    print(\"Warning, no 'lxml' module installed, cannot do XML based tests.\")\n    sys.exit(0)\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    convertUsing2to3,\n    createSearchMode,\n    decideFilenameVersionSkip,\n    getPythonSysPath,\n    my_print,\n    setup,\n    withPythonPathChange,\n)\nfrom nuitka.TreeXML import toString\nfrom nuitka.utils.Execution import check_call\nfrom nuitka.utils.FileOperations import getFileContents\n\npython_version = setup(suite=\"optimizations\")\n\nsearch_mode = createSearchMode()\n\n\ndef getKind(node):\n    result = node.attrib[\"kind\"]\n\n    result = result.replace(\"Statements\", \"\")\n    result = result.replace(\"Statement\", \"\")\n    result = result.replace(\"Expression\", \"\")\n\n    return result\n\n\ndef getRole(node, role):\n    for child in node:\n        if child.tag == \"role\" and child.attrib[\"name\"] == role:\n            return child\n    return None\n\n\ndef getSourceRef(filename, node):\n    return \"%s:%s\" % (filename, node.attrib[\"line\"])\n\n\ndef isConstantExpression(expression):\n    kind = getKind(expression)\n\n    return kind.startswith(\"Constant\") or kind in (\n        \"ImportModuleHard\",\n        \"ImportModuleNameHardExists\",\n        \"ImportModuleNameHardMaybeExists\",\n        \"ModuleAttributeFileRef\",\n        \"ModuleLoaderRef\",\n    )\n\n\ndef checkSequence(filename, statements):\n    # Complex stuff, pylint: disable=too-many-branches\n\n    for statement in statements:\n        kind = getKind(statement)\n\n        # Printing is fine.\n        if kind == \"PrintValue\":\n            (print_arg,) = getRole(statement, \"value\")\n\n            if not isConstantExpression(print_arg):\n                search_mode.onErrorDetected(\n                    \"%s: Error, print of non-constant '%s'.\"\n                    % (getSourceRef(filename, statement), getKind(print_arg))\n                )\n\n            continue\n\n        if kind == \"PrintNewline\":\n            continue\n\n        # Printing in Python3 is a function call whose return value is ignored.\n        if kind == \"Only\":\n            only_expression = getRole(statement, \"expression\")[0]\n\n            if getKind(only_expression) == \"CallNoKeywords\":\n                called_expression = getRole(only_expression, \"called\")[0]\n\n                if getKind(called_expression) == \"BuiltinRef\":\n                    if called_expression.attrib[\"builtin_name\"] == \"print\":\n                        continue\n\n        if kind == \"FrameModule\":\n            checkSequence(filename, getRole(statement, \"statements\"))\n\n            continue\n\n        if kind == \"FrameFunction\":\n            checkSequence(filename, getRole(statement, \"statements\"))\n\n            continue\n\n        if kind.startswith(\"AssignmentVariable\"):\n            variable_name = statement.attrib[\"variable_name\"]\n\n            # Ignore \"__spec__\" assignment for Python3.4, it is not going\n            # to be static.\n            if variable_name == \"__spec__\":\n                continue\n\n            (assign_source,) = getRole(statement, \"source\")\n\n            if getKind(assign_source) in (\"FunctionCreation\", \"FunctionCreationOld\"):\n                continue\n\n            if not isConstantExpression(assign_source):\n                search_mode.onErrorDetected(\n                    \"%s: Error, assignment from non-constant '%s'.\"\n                    % (getSourceRef(filename, statement), getKind(assign_source))\n                )\n\n            continue\n\n        if kind == \"AssignmentAttribute\":\n            (assign_source,) = getRole(statement, \"expression\")\n\n            if getKind(assign_source) == \"ModuleAttributeSpecRef\":\n                continue\n\n            search_mode.onErrorDetected(\n                \"Error, attribute assignment to '%s'.\" % getKind(assign_source)\n            )\n\n        if kind in (\"ReturnNone\", \"ReturnConstant\"):\n            continue\n\n        print(toString(statement))\n        search_mode.onErrorDetected(\n            \"Error, non-print statement of unknown kind '%s'.\" % kind\n        )\n\n\ndef main():\n    # Complex stuff, pylint: disable=too-many-branches,too-many-statements\n\n    for filename in sorted(os.listdir(\".\")):\n        if not filename.endswith(\".py\") or filename.startswith(\"run_\"):\n            continue\n\n        if not decideFilenameVersionSkip(filename):\n            continue\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            # Apply 2to3 conversion if necessary.\n            if python_version >= (3,):\n                filename, changed = convertUsing2to3(filename)\n            else:\n                changed = False\n\n            my_print(\"Consider\", filename, end=\" \")\n\n            xml_filename = filename.replace(\".py\", \".xml\")\n\n            command = [\n                os.environ[\"PYTHON\"],\n                os.path.abspath(os.path.join(\"..\", \"..\", \"bin\", \"nuitka\")),\n                \"--xml=%s\" % xml_filename,\n                \"--quiet\",\n                \"--module\",\n                \"--nofollow-imports\",\n                \"--generate-c-only\",\n                \"--no-progressbar\",\n                filename,\n            ]\n\n            if search_mode.isCoverage():\n                # To avoid re-execution, which is not acceptable to coverage.\n                if \"PYTHONHASHSEED\" not in os.environ:\n                    os.environ[\"PYTHONHASHSEED\"] = \"0\"\n\n                command.insert(2, \"--must-not-re-execute\")\n\n                # spell-checker: ignore --rcfile\n                command = (\n                    command[0:1]\n                    + [\"-S\", \"-m\", \"coverage\", \"run\", \"--rcfile\", os.devnull, \"-a\"]\n                    + command[1:]\n                )\n\n                # Coverage modules hates Nuitka to re-execute, and so we must avoid\n                # that.\n                python_path = getPythonSysPath()\n            else:\n                python_path = None\n\n            with withPythonPathChange(python_path):\n                check_call(command)\n\n            # Parse the result into XML and check it\n            result = getFileContents(xml_filename, mode=\"rb\")\n            try:\n                root = lxml.etree.fromstring(result)\n            except lxml.etree.XMLSyntaxError:\n                my_print(\"Problematic XML output:\")\n                my_print(result)\n                raise\n\n            module_body = root[0]\n            module_statements_sequence = module_body[0]\n\n            assert len(module_statements_sequence) == 1\n            module_statements = next(iter(module_statements_sequence))\n\n            try:\n                checkSequence(filename, module_statements)\n\n                for function in root.xpath('role[@name=\"functions\"]/node'):\n                    (function_body,) = function.xpath('role[@name=\"body\"]')\n                    function_statements_sequence = function_body[0]\n                    assert len(function_statements_sequence) == 1\n                    function_statements = next(iter(function_statements_sequence))\n\n                    checkSequence(filename, function_statements)\n\n                if changed:\n                    os.unlink(filename)\n            except SystemExit:\n                my_print(\"Optimization result:\")\n                my_print(result, style=\"test-debug\")\n                my_print(\"FAIL.\", style=\"red\")\n\n                raise\n\n            my_print(\"OK.\")\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/package_data_files_embedding/PackageDataFilesEmbedding.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport os\nimport pkgutil\n\n# Note: Only the commercial version of Nuitka that can embed files can do this\n\n# nuitka-project: --module\n# nuitka-project: --include-data-dir={MAIN_DIRECTORY}/sub_dir=sub_dir\n# nuitka-project: --include-data-file={MAIN_DIRECTORY}/lala.txt=lala.txt\n# nuitka-project: --embed-data-files-runtime-pattern=*.txt\n\nassert os.path.exists(os.path.join(os.path.dirname(__file__), \"lala.txt\"))\nassert os.path.exists(os.path.join(os.path.dirname(__file__), \"sub_dir/lulu.txt\"))\n\n\nprint(pkgutil.get_data(__name__, \"lala.txt\"))\nprint(pkgutil.get_data(__name__, \"sub_dir/lulu.txt\"))\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/package_data_files_embedding/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Just to make it a package.\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/package_data_files_embedding/lala.txt",
    "content": "This is file 'lala.txt' contents.\n"
  },
  {
    "path": "tests/packages/package_data_files_embedding/sub_dir/lulu.txt",
    "content": "This is file 'subdir/lulu.txt' contents.\n"
  },
  {
    "path": "tests/packages/package_import_success_after_failure/PackageImportSuccessAfterFailure.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# nuitka-project: --follow-import-to=variable_package\n\nORIG = None\n\n\ndef display_difference(dct):\n    print(ORIG.symmetric_difference(dct))\n\n\n# Python2 has this in globals() so force it there for Python3\n# to have same ORIG.\nif str is bytes:\n    e = None\nORIG = set(globals())\n\nprint(\"Initial try on top level package:\")\ntry:\n    import variable_package\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\n\ndisplay_difference(globals())\n\nprint(\"Retry with submodule import:\")\n\ntry:\n    from variable_package.SomeModule import Class4\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\ndisplay_difference(globals())\n\nprint(\"Try with import from submodule:\")\ntry:\n    from variable_package import SomeModule\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\ndisplay_difference(globals())\n\nprint(\"Try with variable import from top level package assigned before raise:\")\ntry:\n    from variable_package import raisy\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\n\ndisplay_difference(globals())\n\nprint(\"Try with variable import from top level package assigned after raise:\")\ntry:\n    from variable_package import Class5\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\ndisplay_difference(globals())\n\nprint(\"Try with variable import from top level package assigned before raise:\")\ntry:\n    from variable_package import Class3\nexcept BaseException as e:\n    print(\"Occurred\", str(e))\ndisplay_difference(globals().keys())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/package_import_success_after_failure/variable_package/SomeModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nclass Class4(object):\n    VALUE = \"some_value\"\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/package_import_success_after_failure/variable_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport os\n\n\nclass Class3(object):\n    pass\n\n\ndef raisy():\n    if os.getenv(\"SHALL_FAIL\", \"1\") == \"1\":\n        print(\"RAISING!\")\n        raise Exception(\"AHOJ\")\n\n\nraisy()\n\n\nclass Class5(object):\n    PASSW = \"Secret\"\n\n    def __init__(self):\n        print(self.PASSW, 2 + 3)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for package tests of Nuitka.\n\nPackage tests are typically aiming at checking specific module constellations\nin module mode and making sure the details are being right there. These are\nsynthetic small packages, each of which try to demonstrate one or more points\nor special behavior.\n\n\"\"\"\n\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    getTempDir,\n    my_print,\n    reportSkip,\n    setup,\n)\nfrom nuitka.Version import getCommercialVersion\n\n\ndef main():\n    # Complex stuff, even more should become common code though.\n    # pylint: disable=too-many-branches\n\n    setup(suite=\"packages\")\n\n    search_mode = createSearchMode()\n\n    for filename in sorted(os.listdir(\".\")):\n        if not os.path.isdir(filename) or filename.endswith(\".build\"):\n            continue\n\n        extra_flags = [\n            \"--module\",\n            \"expect_success\",\n            \"remove_output\",\n            \"two_step_execution\",\n        ]\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            my_print(\"Consider output of compiled package:\", filename)\n\n            if \"embed\" in filename and getCommercialVersion() is None:\n                reportSkip(\n                    \"Skipped, only working with Nuitka commercial\",\n                    \".\",\n                    filename,\n                )\n                continue\n\n            filename_main = None\n\n            filename_main = os.path.join(\n                filename, \"\".join(part.title() for part in filename.split(\"_\")) + \".py\"\n            )\n            if os.path.exists(filename_main):\n                filename_main = os.path.basename(filename_main)\n            else:\n                filename_main = None\n\n            if filename_main is None:\n                for filename_main in os.listdir(filename):\n                    if filename_main == \"__pycache__\":\n                        continue\n\n                    if not os.path.isdir(os.path.join(filename, filename_main)):\n                        continue\n\n                    if filename_main not in (\"..\", \".\"):\n                        break\n                else:\n                    search_mode.onErrorDetected(\n                        \"\"\"\\\nError, no package in test directory '%s' found, incomplete test case.\"\"\"\n                        % filename\n                    )\n\n                extra_flags.append(\n                    \"--include-package=%s\" % os.path.basename(filename_main)\n                )\n\n            extra_flags.append(\"--output-dir=%s\" % getTempDir())\n\n            if filename == \"top_level_attributes\":\n                extra_flags.append(\"--module-entry-point=main\")\n\n            compareWithCPython(\n                dirname=filename,\n                filename=filename_main,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=False,\n            )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nfrom kitty.speak.hello import speak\n\nprint(\"__name__ is\", __name__)\n\nif sys.version_info[:2] != (3, 2):\n    print(\"__package__ is\", __package__)\nelse:\n    print(\"__package__ is correct:\", __package__ is None or __package__ == \"kitty\")\n\nprint(\"From sys.modules\", sys.modules[\"kitty\"])\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/bigkitty.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nsize = \"big\"\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/smallkitty.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nsize = \"small\"\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/speak/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"OK,\", __name__, \"loaded.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/speak/hello.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Test Issue#115, in recursing modules, this was misbehaving.\nimport types\n\n\ndef speak():\n    print(\"hello kitty\")\n\n\nassert type(speak) == types.FunctionType\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/speak/miau.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef speak():\n    print(\"miau\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/sub_package/kitty/speak/purr.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef speak():\n    print(\"mrrruu\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/top_level_attributes_3/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that shows that __file__ and __spec__ are compatible after import by CPython\n\nWhat CPython does when loading an extension module, like this is going to be, is\nto update the \"__file__\" value afterwards, and then to set the \"__spec__\" to itself,\nwhich disallows using the Nuitka loader for the module.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\n\n\ndef getPathEnd(filename, elements):\n    return os.path.sep.join(filename.split(os.path.sep)[-elements:])\n\n\ndef main():\n    try:\n        print(\"SPEC from name\", getPathEnd(__spec__.origin, 2))\n        print(\"SPEC from name\", getPathEnd(__spec__.submodule_search_locations[0], 1))\n    except NameError as e:\n        print(\"No __spec__ name\", str(e))\n\n    try:\n        print(\"FILE from name\", getPathEnd(__file__, 2))\n    except NameError as e:\n        print(\"No __file__ name\", str(e))\n\n    # We do not optimize through globals()\n    try:\n        print(\"SPEC from globals\", getPathEnd(globals()[\"__spec__\"].origin, 2))\n    except KeyError as e:\n        print(\"No __spec__ globals name:\", str(e))\n\n    try:\n        print(\"FILE from globals\", getPathEnd(globals()[\"__file__\"], 2))\n    except KeyError as e:\n        print(\"No __file__ globals name:\", str(e))\n\n    try:\n        from importlib.util import find_spec\n\n        print(getPathEnd(find_spec(\"some_package.some_module\").origin, 2))\n    except ImportError as e:\n        print(\"No importlib.util import find_spec:\", str(e))\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/packages/top_level_attributes_3/some_package/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"hi\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/pgo/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for Python PGO tests of Nuitka.\n\nPGO tests attempt to cover inclusion/non-inclusion of code and detection of\ntypes.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.reports.CompilationReportReader import (\n    extractModulesUsedByModule,\n    parseCompilationReport,\n)\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    scanDirectoryForTestCaseFolders,\n    setup,\n)\n\n\ndef main():\n    setup(suite=\"pgo\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    # Now run all the tests in this directory.\n    for filename, filename_main in scanDirectoryForTestCaseFolders(\".\"):\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            report_filename = \"compilation-report-%s.xml\" % filename\n\n            extra_flags = [\n                # No error exits normally, unless we break tests, and that we would\n                # like to know.\n                \"expect_success\",\n                # Keep no temporary files.\n                \"remove_output\",\n                # Include imported files, PGO will then have to deal with unused ones.\n                \"--follow-imports\",\n                # The output during compilation from PGO capture is harmful, so\n                # split compilation and execution of final result.\n                \"two_step_execution\",\n                # Inclusion report is used by the testing of expected things included\n                # or not.\n                \"--report=%s\" % report_filename,\n                # Cache the CPython results for reuse, they will normally not change.\n                \"cpython_cache\",\n            ]\n\n            compareWithCPython(\n                dirname=filename,\n                filename=filename_main,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=False,\n            )\n\n            compilation_report = parseCompilationReport(report_filename)\n\n            modules_used = extractModulesUsedByModule(\n                compilation_report=compilation_report, module_name=\"__main__\"\n            )\n            assert (\n                modules_used[\"ImportedButMaybeNotUsed\"][\"exclusion_reason\"]\n                == \"PGO based decision\"\n            ), modules_used\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/pgo/unused_module/ImportedButMaybeNotUsed.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# This is supposed to not be used in all cases.\n\nprint(\"Hello from\", __name__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/pgo/unused_module/UnusedModuleMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Basic Python PGO test. \"\"\"\n\n# nuitka-test-variations: TEST_VARIANT (\"yes\",\"no\")\n\n# nuitka-project-if: os.getenv(\"TEST_VARIANT\", \"yes\") != \"no\":\n#   nuitka-project: --pgo-python\n#   nuitka-project: --pgo-python-policy-unused-module=exclude\n\nimport os\n\nif os.getenv(\"NUITKA_TEST_USE_IT\", \"no\") == \"yes\":\n    print(\"Using ImportedButMaybeNotUsed module:\")\n    import ImportedButMaybeNotUsed\n\n    print(ImportedButMaybeNotUsed)\nelse:\n    print(\"Not using ImportedButMaybeNotUsed module:\")\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/README.rst",
    "content": "##########################\n Plugins for Nuitka tests\n##########################\n\nThese are a set of tests intended to give a quick response to the\nquestion if a version of Nuitka still works with plugins as expected.\nThis should be about the user plugins mostly.\n"
  },
  {
    "path": "tests/plugins/code_signing/CodeSigningMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# nuitka-project: --onefile\n# nuitka-project: --enable-plugin=signing\n# nuitka-project: --windows-certificate-filename={MAIN_DIRECTORY}/../../../misc/test-cert.pfx\n# nuitka-project: --windows-certificate-password=password\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/data_files/DataFilesMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport os\n\nimport data_files_package\n\n# nuitka-project: --standalone\n# nuitka-project: --user-package-configuration-file={MAIN_DIRECTORY}/test_case.nuitka-package.config.yml\n# nuitka-project-if: {Commercial} is not None:\n#   nuitka-project: --embed-data-files-runtime-pattern=lala.txt\n\nassert os.path.exists(\n    os.path.join(os.path.dirname(data_files_package.__file__), \"lala.txt\")\n)\nassert os.path.exists(\n    os.path.join(os.path.dirname(data_files_package.__file__), \"sub_dir/lulu.txt\")\n)\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/data_files/data_files_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Just to make it a package.\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/data_files/data_files_package/lala.txt",
    "content": ""
  },
  {
    "path": "tests/plugins/data_files/data_files_package/sub_dir/lulu.txt",
    "content": ""
  },
  {
    "path": "tests/plugins/data_files/test_case.nuitka-package.config.yml",
    "content": "# yamllint disable rule:line-length\n# yamllint disable rule:indentation\n# yamllint disable rule:comments-indentation\n# yamllint disable rule:comments\n# too many spelling things, spell-checker: disable\n---\n- module-name: 'data_files_package' # checksum: 672cf793\n  data-files:\n    patterns:\n      - '**/*.txt'\n"
  },
  {
    "path": "tests/plugins/parameters/ParametersMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Just something to allow the plugin to look at.\n\n\"\"\"\n\n# nuitka-project: --user-plugin={MAIN_DIRECTORY}/parameter-using-plugin.py\n# nuitka-project: --follow-imports\n\nfrom __future__ import print_function\n\nimport math\n\nprint(math.pi)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/parameters/parameter-using-plugin.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Parameter using Nuitka plugin.\n\n\"\"\"\n\nimport os\nimport sys\n\n# from nuitka import Options\nfrom nuitka.plugins.PluginBase import NuitkaPluginBase\n\n\nclass NuitkaPluginForTesting(NuitkaPluginBase):\n    plugin_name = __name__.split(\".\")[-1]\n\n    def __init__(self, trace_my_plugin):\n        # demo only: extract and display my options list\n        # check whether some specific option is set\n\n        self.check = trace_my_plugin\n        self.info(\"The 'trace' value is set to '%s'\" % self.check)\n\n        # do more init work here ...\n\n    @classmethod\n    def addPluginCommandLineOptions(cls, group):\n        group.add_option(\n            \"--trace-my-plugin\",\n            action=\"store_true\",\n            dest=\"trace_my_plugin\",\n            default=False,\n            help=\"This is show in help output.\",\n        )\n\n    def onModuleSourceCode(self, module_name, source_filename, source_code):\n        # if this is the main script and tracing should be done ...\n        if module_name == \"__main__\" and self.check:\n            self.info(\"\")\n            self.info(\" Calls to 'math' module:\")\n            for i, l in enumerate(source_code.splitlines()):\n                if \"math.\" in l:\n                    self.info(\" %i: %s\" % (i + 1, l))\n            self.info(\"\")\n        return source_code\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/plugins/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for plugins tests of Nuitka.\n\nPlugin tests are typically aiming at covering plugin interfaces and their\ncorrectness, not concrete standard plugins.\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    getMainProgramFilename,\n    my_print,\n    reportSkip,\n    setup,\n    withPythonPathChange,\n)\nfrom nuitka.utils.Utils import isWin32Windows\nfrom nuitka.Version import getCommercialVersion\n\n\ndef main():\n    # Complex stuff, even more should become common code though.\n    setup(suite=\"plugins\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    extra_options = os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\")\n\n    # TODO: Add a directory test case scanner instead of duplicating this kind of code.\n    for filename in sorted(os.listdir(\".\")):\n        if (\n            not os.path.isdir(filename)\n            or filename.endswith(\".build\")\n            or filename.endswith(\".dist\")\n        ):\n            continue\n\n        filename = os.path.relpath(filename)\n\n        extra_flags = [\"expect_success\"]\n\n        # We annotate some tests, use that to lower warnings.\n        extra_flags.append(\"remove_output\")\n\n        if filename == \"parameters\":\n            os.environ[\"NUITKA_EXTRA_OPTIONS\"] = extra_options + \" --trace-my-plugin\"\n        else:\n            os.environ[\"NUITKA_EXTRA_OPTIONS\"] = extra_options\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            my_print(\"Consider output of recursively compiled program:\", filename)\n\n            if filename in (\"code_signing\",):\n                if getCommercialVersion() is None:\n                    reportSkip(\n                        \"Plugin only available in Nuitka commercial\", \".\", filename\n                    )\n                    continue\n\n                if not isWin32Windows():\n                    reportSkip(\"Plugin only works on Windows\", \".\", filename)\n                    continue\n\n            filename_main = getMainProgramFilename(filename)\n\n            extra_python_path = [\n                os.path.abspath(os.path.join(filename, entry))\n                for entry in os.listdir(filename)\n                if entry.startswith(\"path\")\n            ]\n\n            with withPythonPathChange(extra_python_path):\n                compareWithCPython(\n                    dirname=filename,\n                    filename=filename_main,\n                    extra_flags=extra_flags,\n                    search_mode=search_mode,\n                    needs_2to3=False,\n                )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/absolute_import/AbsoluteImportMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --follow-imports\n\nimport foobar\n\nif __name__ == \"__main__\":\n    foobar.Foobar()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/absolute_import/foobar/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .foobar import Foobar\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/absolute_import/foobar/foobar.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Using absolute import, do from module imports.\n\n\"\"\"\n\nfrom __future__ import absolute_import, print_function\n\nfrom foobar import util\n\nfrom . import local  # pylint: disable=unused-import\n\n\nclass Foobar(object):\n    def __init__(self):\n        print(util.someFunction())\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/absolute_import/foobar/local.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Just trace the import.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"This is for relative import.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/absolute_import/foobar/util.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Module that provides a function for import.\n\n\"\"\"\n\n\ndef someFunction():\n    return \"hi\"\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports1/CasedImportingMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport Some_Module\nimport some_package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports1/path1/Some_Module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Module\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports1/path1/Some_Package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Package\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports1/path2/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is some_module\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports1/path2/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is some_package\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports2/CasedImportingMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport Some_Module\nimport some_package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports2/path1/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports2/path1/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports2/path2/Some_Module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Module\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports2/path2/Some_Package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Package\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports3/CasedImportingMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ntry:\n    import some_module\nexcept ImportError:\n    print(\"Cannot import wrongly cased module.\")\nelse:\n    print(\"OK, imported wrongly cased module.\")\n\ntry:\n    import some_package\nexcept ImportError:\n    print(\"Cannot import wrongly cased package.\")\nelse:\n    print(\"OK, imported wrongly cased package.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports3/path1/Some_Module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Module from path1\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports3/path1/Some_Package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Package from path1\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports3/path2/Some_Module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Module from path2\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/case_imports3/path2/Some_Package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is Some_Package from path2\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/cyclic_imports/CyclicImportsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport cyclic_importing_package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/cyclic_imports/cyclic_importing_package/Child1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Child1:\", __name__)\n\nfrom . import Child2  # isort:skip\n\nprint(\"Value of Child2\", Child2.__name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/cyclic_imports/cyclic_importing_package/Child2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Child2:\", __name__)\n\nfrom . import Child1  # isort:skip\n\nprint(\"Value of Child1\", Child1.__name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/cyclic_imports/cyclic_importing_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"package __init__:\", __name__)\n\nfrom . import Child1  # isort:skip\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dash_import/DashImportMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n__import__(\"dash-module\")\n\nb = \"dash-module\"\n__import__(b)\n\n__import__(\"plus+module\")\n\nc = \"plus+module\"\n__import__(c)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dash_import/dash-module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Module with dash imported as\", __name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dash_import/plus+module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Module with plus imported as\", __name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dash_main/Dash-Main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"This is running from\", __file__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/DeepProgramMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --follow-imports\n\nimport some_package.deep_package.DeepDeepChild\nimport some_package.DeepChild\n\nprint(\"Done.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/some_package/DeepBrother.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"This is deep brother module talking.\", __name__)\n\n\ndef someBrotherFunction():\n    pass\n\n\nprint(\"The __module__ of function here is\", someBrotherFunction.__module__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/some_package/DeepChild.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Importing child.\")\n\n\nclass A:\n    pass\n\n\nprint(\"Class defined here, has these vars\", vars(A))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/some_package/deep_package/DeepDeepChild.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nfrom .. import DeepBrother\n\nprint(\"This is DeepDeepChild talking.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/deep/some_package/deep_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nprint(\"The deep package has __package__\", __package__)\nprint(\"The deep package has __package__\", sys.modules[__name__].__package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dunderinit_imports/DunderInitImportsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport package.SubModule\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dunderinit_imports/package/SubModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .__init__ import value\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/dunderinit_imports/package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"Package as __name__\", __name__)\nvalue = 1\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/import_variants/ImportVariationsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport some_package.Child2\n\nprint(\"*** Main: Importing\")\n\n\nprint(\"*** Main: Imported\")\n\nprint(\"*** Main: Some package\", some_package)\nprint(\"*** Main: Imported package child\", some_package.Child2)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/import_variants/some_package/Child1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nfrom . import Child3 as localname\n\nprint(\"*** Child1: Begin\")\n\n\nprint(\"*** Child1: Imported Child3\", localname)\n\nprint(\"*** Child1: End\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/import_variants/some_package/Child2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"*** Child2: Begin\", __name__)\ntry:\n    import Child1\nexcept ImportError:\n    print(\"This must be Python3, doing local import then.\")\n    from . import Child1\n\nprint(\"*** Child2: Child2 is in\", __package__)\nprint(\"*** Child2: Imported nearby child\", Child1)\n\nprint(\"*** Child2: End\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/import_variants/some_package/Child3.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"*** Child3: Begin\")\n\nprint(\"*** Child3: End\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/import_variants/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nprint(\"*** some_package: Coming from '%s'\" % __file__.replace(\".pyc\", \".py\"))\nprint(\"*** some_package: Path is '%s'\" % __path__)\nprint(\"*** some_package: Package is '%s'\" % __package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/main_raises/ErrorMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Just plain exception from the module level, supposed to report the correct file and line\nimport ErrorRaising\n\nErrorRaising.raiseException()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/main_raises/ErrorRaising.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef raiseException():\n    return 1 / 0\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/main_raises2/ErrorInFunctionMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Just plain exception from the function  level, supposed to report the correct file and line\n\n\ndef generator_function():\n    import ErrorRaising\n\n    x = (lambda: ErrorRaising.raiseException() for z in range(3))\n\n    next(x)()\n\n\ndef normal_function():\n    y = generator_function()\n\n    y()\n\n\nnormal_function()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/main_raises2/ErrorRaising.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef raiseException():\n    return 1 / 0\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/ModuleAttributesMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that covers all module attributes. \"\"\"\n\nfrom __future__ import print_function\n\nimport package_level1.Nearby1\nimport package_level1.package_level2.Nearby2\nimport package_level1.package_level2.package_level3\nimport package_level1.package_level2.package_level3.Nearby3\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\n# pylint: disable=unused-import\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/Nearby1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\n\nprint(\n    \"__package__: \",\n    (\n        __package__\n        if __package__ is not None or sys.version_info[:2] != (3, 2)\n        else \".\".join(__name__.split(\".\")[:-1])\n    ),\n)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\nprint(\"__package__: \", __package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/package_level2/Nearby2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\n\nprint(\n    \"__package__: \",\n    (\n        __package__\n        if __package__ is not None or sys.version_info[:2] != (3, 2)\n        else \".\".join(__name__.split(\".\")[:-1])\n    ),\n)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/package_level2/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\nprint(\"__package__: \", __package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/package_level2/package_level3/Nearby3.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\n\nprint(\n    \"__package__: \",\n    (\n        __package__\n        if __package__ is not None or sys.version_info[:2] != (3, 2)\n        else \".\".join(__name__.split(\".\")[:-1])\n    ),\n)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_attributes/package_level1/package_level2/package_level3/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n\ndef displayDict(d):\n    d = dict(d)\n\n    del d[\"displayDict\"]\n\n    del d[\"__builtins__\"]\n\n    if \"__loader__\" in d:\n        if str is bytes:\n            del d[\"__loader__\"]\n        else:\n            d[\"__loader__\"] = \"<__loader__ removed>\"\n\n    if \"__file__\" in d:\n        d[\"__file__\"] = \"<__file__ removed>\"\n\n    if \"__cached__\" in d:\n        d[\"__cached__\"] = \"<__cached__ removed>\"\n\n    if \"__spec__\" in d:\n        d[\"__spec__\"].loader = \"loader removed\"\n        d[\"__spec__\"].origin = \"origin removed\"\n        d[\"__spec__\"].submodule_search_locations = \"submodule_search_locations removed\"\n\n    if \"__compiled__\" in d:\n        del d[\"__compiled__\"]\n\n    import pprint\n\n    return pprint.pformat(d)\n\n\nprint(displayDict(globals()))\n\nprint(\"__name__: \", __name__)\nprint(\"__package__: \", __package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_exits/ErrorExitingModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nprint(type(__builtins__))\nsys.exit(\"Module doing sys.exit\")\nprint(\"This won't happen!\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_exits/Main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(type(__builtins__))\n\nimport ErrorExitingModule  # isort:skip\n\nprint(\"Should not get here!\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_object_replacing/ModuleObjectReplacingMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --follow-import-to=SelfReplacingModule\n\nfrom __future__ import print_function\n\nimport SelfReplacingModule\n\nprint(\"Valid\", SelfReplacingModule.valid)\ntry:\n    print(\"InValid\", SelfReplacingModule.invalid)\nexcept Exception as e:\n    print(\"Occurred\", repr(e))\nelse:\n    print(\"No Exception!\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/module_object_replacing/SelfReplacingModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\nimport types\n\n\nclass OurModule(types.ModuleType):\n    attribute_dict = {\n        \"valid\": \"valid_value\",\n        # Import mechanics use these.\n        \"__package__\": __package__,\n        \"__name__\": __name__,\n    }\n\n    if \"__loader__\" in globals():\n        attribute_dict[\"__loader__\"] = __loader__\n\n    def __init__(self, name):\n        super(OurModule, self).__init__(name)\n\n    def __getattr__(self, attr):\n        try:\n            return self.attribute_dict[attr]\n        except KeyError:\n            raise AttributeError(attr)\n\n\nsys.modules[__name__] = OurModule(__name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/multiprocessing_using/MultiprocessingUsingMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that checks that accelerated mode usage of multiprocessing works too. \"\"\"\n\nfrom multiprocessing import freeze_support\n\nif __name__ == \"__main__\":\n    freeze_support()\n\n    from foo import entry\n\n    entry.main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/multiprocessing_using/foo/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/multiprocessing_using/foo/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom foo import entry\n\nif __name__ == \"__main__\":\n    entry.main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/multiprocessing_using/foo/entry.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom multiprocessing import Pipe, Process\n\n\nclass MyProcess(Process):\n    def __init__(self, connection):\n        super(MyProcess, self).__init__()\n        self.connection = connection\n        self.close_issued = False\n\n    def run(self):\n        while not self.close_issued:\n            op, arg = self.connection.recv()\n            if op == \"add\":\n                self.connection.send(arg + 1)\n            elif op == \"close\":\n                self.close_issued = True\n            elif op == \"method\":\n                self.connection.send(repr(self.run))\n\n\ndef main():\n    server_channel, client_channel = Pipe()\n    my_process = MyProcess(client_channel)\n    my_process.start()\n\n    server_channel.send((\"add\", 4))\n    print(server_channel.recv())\n\n    server_channel.send((\"add\", 12))\n    print(server_channel.recv())\n\n    server_channel.send((\"method\", None))\n    print((\"compiled\" in server_channel.recv()) == (\"compiled\" in repr(MyProcess.run)))\n\n    server_channel.send((\"close\", 0))\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/named_imports/NamedImportsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom some_package import SomeModule\n\nprint(__name__, \"imported\", SomeModule)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/named_imports/some_package/SomeModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/named_imports/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .sub_package import SomeModule\n\nprint(SomeModule)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/named_imports/some_package/sub_package/SomeModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_code/PackageInitCodeMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport some_package.SomeModule\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_code/some_package/SomeModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Thanks for importing SomeModule\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_code/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Thanks for importing\", __name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_contains_main/PackageContainsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom . import local\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_contains_main/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_contains_main/local.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Imported local package\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_import/PackageInitImportMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport some_package\n\nprint(some_package.PackageLocal)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_import/some_package/PackageLocal.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nprint(\n    \"Imported PackageLocal\",\n    __name__,\n    \"in\",\n    (\n        __package__\n        if __package__ is not None or sys.version_info[:2] != (3, 2)\n        else \".\".join(__name__.split(\".\")[:-1])\n    ),\n)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_import/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport sys\n\nprint(\n    \"This is some_package\",\n    __name__,\n    \"in\",\n    \"__package__: \",\n    (\n        __package__\n        if __package__ is not None or sys.version_info[:2] != (3, 2)\n        else \".\".join(__name__.split(\".\")[:-1])\n    ),\n)\n\ntry:\n    import PackageLocal\nexcept ImportError:\n    print(\"This must be Python3, doing local import then.\")\n    from . import PackageLocal\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_issue/PackageInitIssueMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport some_package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_issue/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .child_package import *\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_issue/some_package/child_package/SomeModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .. import child_package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_init_issue/some_package/child_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .SomeModule import *\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_missing_init/PackageMissingInitMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport some_package.some_module\nimport some_package.sub_package.some_sub_module\n\nprint(some_package.__package__)\nprint(some_package.sub_package.__package__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_missing_init/some_package/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nprint(\"This must be Python3 which no longer needs __init__.py to accept a package.\")\n\n\nprint(\"The parent path is\", sys.modules[\"some_package\"].__path__)\n\n\ndef f():\n    pass\n\n\nprint(f)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_missing_init/some_package/sub_package/some_sub_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nprint(\"This must be Python3 which no longer needs __init__.py to accept a package.\")\n\n\nprint(\"The parent path is\", sys.modules[\"some_package.sub_package\"].__path__)\n\n\ndef s():\n    pass\n\n\nprint(s)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_module_collision/PackageAndModuleNamedSameMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport Something\nimport something\n\nprint(\"This would collide on Windows generated source names:\")\nprint(Something)\nprint(something)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_module_collision/Something/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Importing Something/__init__.py\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_module_collision/something.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Importing something.py\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_overload/Main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom foo import bar, bar2, not_overloaded\n\nprint(bar, not_overloaded)\n\nprint(bar2)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_overload/foo/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nbar = 42\n\nnot_overloaded = 45\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_overload/foo/bar.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_overload/foo/bar2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_prevents_submodule/PackagePreventsSubmoduleMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport imp\nimport os\nimport sys\n\nORIG = None\nattemptImports = None\n\n# Nuitka gives warnings, that even if disabled touch this.\n__warningregistry__ = {}\n\n\ndef diff(dct):\n    print(\"globals diff\", ORIG.symmetric_difference(dct))\n    mdiff = START.symmetric_difference(sys.modules)\n\n    # Python2 does strange thing with relative imports, that we do not.\n    if str is bytes:\n        if \"some_package.os\" in mdiff:\n            mdiff.remove(\"some_package.os\")\n\n    print(\"Modules diff\", mdiff)\n\n\nSTART = set(sys.modules)\nORIG = set(globals())\n\n\ndef attemptImports(prefix):\n    print(prefix, \"GO1:\")\n    try:\n        import some_package\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", some_package.__name__)\n\n    diff(globals())\n\n    print(prefix, \"GO2:\")\n    try:\n        from some_package.some_module import Class4\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", Class4)\n    diff(globals())\n\n    print(prefix, \"GO3:\")\n    try:\n        from some_package import some_module\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", some_module.__name__)\n    diff(globals())\n\n    print(prefix, \"GO4:\")\n    try:\n        from some_package import raiseError\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", raiseError.__name__)\n    diff(globals())\n\n    print(prefix, \"GO5:\")\n    try:\n        from some_package import Class5\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", Class5)\n    diff(globals())\n\n    print(prefix, \"GO6:\")\n    try:\n        from some_package import Class3\n    except BaseException as e:\n        print(\"Exception occurred\", e)\n    else:\n        print(\"Import success.\", Class3)\n    diff(globals().keys())\n\n\nos.environ[\"TEST_SHALL_RAISE_ERROR\"] = \"1\"\nattemptImports(\"With expected errors\")\nos.environ[\"TEST_SHALL_RAISE_ERROR\"] = \"0\"\nattemptImports(\"With error resolved\")\ndel sys.modules[\"some_package\"]\nattemptImports(\"With deleted module\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_prevents_submodule/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport os\n\nprint(\n    \"This is\",\n    __name__,\n    \"code with error raise\",\n    os.environ.get(\"TEST_SHALL_RAISE_ERROR\"),\n)\n\n\nclass Class3(object):\n    pass\n\n\ndef raiseError():\n    raise Exception(\"AHOJ\")\n\n\nif os.environ.get(\"TEST_SHALL_RAISE_ERROR\") == \"1\":\n    raiseError()\n\n\nclass Class5(object):\n    pass\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_prevents_submodule/some_package/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nclass Class4(object):\n    pass\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_program/PackageAsMain/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nfor_import = \"something from __init__\"\n\nprint(\"Importing\", __name__, \"package\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/package_program/PackageAsMain/__main__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\"\nTest case, where __main__ is the main program in a directory.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport sys\n\n# There is a fake module with just \"__name__\" for package mode created by CPython.\nreal_name = __name__\n\nprint(\"Hello world!\")\nprint(\"I am thinking of myself as __name__\", repr(__name__))\nprint(\"Module object has __name__\", repr(sys.modules[real_name].__name__))\nprint(\"My package value is\", repr(__package__))\nif not __package__:\n    print(\"Module has package value\", repr(sys.modules[real_name].__package__))\n    print(\"Module repr\", sys.modules[real_name])\nprint(\"__file__\", __file__)\n\nprint(\"Try to import from module in main package:\")\nfor_import = \"something from __main__\"\n\ntry:\n    from . import for_import as value\n\n    print(\"Imported\", value)\nexcept (ImportError, SystemError, ValueError) as e:\n    print(\"Gave exception:\", e)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/PkgUtilIterModulesMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport importlib\nimport pkgutil\n\nimport some_package.sub_package1.SomeModuleC\nimport some_package.sub_package1.SomeModuleD\nimport some_package.sub_package2.SomeModuleA\nimport some_package.sub_package2.SomeModuleB\n\n# nuitka-skip-unless-imports: importlib\n\n\n# Use the original \"__file__\" value normally, at least one case warns\n# about things with filename included, but for pkgutil iteration, make\n# sure we do not see original Python dirs.\n\n# nuitka-project: --file-reference-choice=runtime\n\n# nuitka-project: --follow-imports\n\nprint(\"Checking with 'pkg_util.iter_modules' what was included:\")\npkg = __import__(\"some_package\")\nprint(\"Package is\", pkg)\n\nit = pkgutil.iter_modules(pkg.__path__)\nfor r in it:\n    print(r[1], r[2])\n\n    if r[2]:\n        sub_pkg = importlib.import_module(\"some_package.\" + r[1])\n        for r2 in pkgutil.iter_modules(sub_pkg.__path__):\n            print(\"  \", r2[1], r2[2])\n\n\nprint(\"Done\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package1/SomeModuleC.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package1/SomeModuleD.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package1/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package2/SomeModuleA.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package2/SomeModuleB.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_itermodules/some_package/sub_package2/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_usage/PkgUtilUsageMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Using pkgutil to read data from a package.\n\nThis test can use the commercial code, which includes the file inside\nthe binary, inaccessible to the user, as as well a the free code, where\nthe file must exist in the file system.\n\"\"\"\n\n# nuitka-project: --include-package=package\n# nuitka-project: --follow-imports\n# nuitka-project-if: {Commercial} is not None:\n#  nuitka-project: --embed-data-files-runtime-pattern=*\n#  nuitka-project: --include-package-data=package\n\n# test code, pylint: disable=unused-import\n\nimport package\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/pkgutil_usage/package/DATA_FILE.txt",
    "content": "DATA_CONTENT\n"
  },
  {
    "path": "tests/programs/pkgutil_usage/package/DATA_FILE2.txt",
    "content": "DATA_CONTENT2\n"
  },
  {
    "path": "tests/programs/pkgutil_usage/package/DATA_FILE3.txt",
    "content": "DATA_CONTENT3\n"
  },
  {
    "path": "tests/programs/pkgutil_usage/package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This package loads a file via pkgutil.get_data and outputs its contents in import.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport pkgutil\n\nprint(\"This is\", __name__, \"in\", __package__, \"speaking:\")\n\n# Setting version from a file, is an example use case of this, but not limited\n# to that of course.\n__version__ = pkgutil.get_data(__package__, \"DATA_FILE.txt\").decode(\"ascii\").strip()\n\nprint(\"pkgutil.get_data()\", __version__)\n\ntry:\n    import pkg_resources\nexcept ImportError:\n    pass\nelse:\n    data = pkg_resources.resource_string(__package__, \"DATA_FILE2.txt\")\n    print(\"pkg_resources.resource_string\", data)\n\n    readable = pkg_resources.resource_stream(__package__, \"DATA_FILE3.txt\")\n    data = readable.read()\n    print(\"pkg_resources.resource_readable.read()\", data)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/plugin_import/PluginImportMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nname = \"some_module\"\n\nmodule = getattr(__import__(\"some_package\", fromlist=[name]), name)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/plugin_import/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n#\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/plugin_import/some_package/data/.gitignore",
    "content": ""
  },
  {
    "path": "tests/programs/plugin_import/some_package/some_module.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"hi\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/reimport_main_dynamic/ImportItselfDynamicMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nprint(\"Here I am before import\", __name__)\n\nc = \"ImportItselfDynamicMain\"\n__import__(c)\nprint(\"Here I am after import\", __name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/reimport_main_static/ImportItselfStaticMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport sys\n\nimport ImportItselfStaticMain\n\nprint(\"Here I am before import\", __name__)\n\nprint(\"Here I am after import\", __name__)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/relative_import/RelativeImportMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import absolute_import\n\nimport dircache\n\nprint(dircache)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/relative_import/dircache.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/resource_reader37/ResourceReaderMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Tests that reads a data file via path\"\"\"\n\n# nuitka-project: --include-package=some_package\n\n# print(get_resource_reader(some_package).get_path(\"DATA_FILE.txt\"))\n\nfrom importlib.resources import path\n\n# Wrong kind of use of course.\nwith path(\"some_package\", \"DATA_FILE.txt\") as data_path:\n    with open(data_path, encoding=\"utf8\") as data_file:\n        print(\"RES\", data_file.read())\n\nprint(\"OK.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/resource_reader37/some_package/DATA_FILE.txt",
    "content": "DATA_CONTENT\n"
  },
  {
    "path": "tests/programs/resource_reader37/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for program tests of Nuitka.\n\nProgram tests are typically aiming at checking specific module constellations\nand making sure the details are being right there. These are synthetic small\nprograms, each of which try to demonstrate one or more points or special\nbehavior.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    checkTestRequirements,\n    compareWithCPython,\n    createSearchMode,\n    my_print,\n    reportSkip,\n    scanDirectoryForTestCaseFolders,\n    setup,\n    withPythonPathChange,\n)\n\n\ndef main():\n    # Complex stuff, even more should become common code though.\n    # pylint: disable=too-many-branches,too-many-statements\n\n    python_version = setup(suite=\"programs\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    extra_options = os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\")\n\n    for filename, filename_main in scanDirectoryForTestCaseFolders(\".\"):\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if not active:\n            continue\n\n        # For these, we expect that they will fail.\n        expected_errors = [\n            \"module_exits\",\n            \"main_raises\",\n            \"main_raises2\",\n            \"package_contains_main\",\n        ]\n\n        # After Python3 those have been made to work.\n        if python_version < (3, 5):\n            expected_errors.append(\"cyclic_imports\")\n\n        # Allowed with Python3, packages need no more \"__init__.py\"\n        if python_version < (3,):\n            expected_errors.append(\"package_missing_init\")\n\n        # Allowed with Python3.5 only:\n        if python_version < (3, 5):\n            expected_errors.append(\"package_init_issue\")\n\n        # Allowed with Python3, name imports can be module imports\n        if python_version < (3,):\n            expected_errors.append(\"named_imports\")\n\n        extra_variant = []\n\n        if filename not in expected_errors:\n            extra_flags = [\"expect_success\"]\n        else:\n            extra_flags = [\"expect_failure\"]\n\n        # We annotate some tests, use that to lower warnings.\n        extra_flags.append(\"plugin_enable:pylint-warnings\")\n\n        if filename in (\n            \"reimport_main_static\",\n            \"package_missing_init\",\n            \"dash_import\",\n            \"package_contains_main\",\n            \"case_imports3\",\n            \"import_variants\",\n            \"package_init_import\",\n            \"pkgutil_itermodules\",\n        ):\n            extra_flags.append(\"ignore_warnings\")\n\n        extra_flags.append(\"remove_output\")\n\n        extra_flags.append(\"--follow-imports\")\n\n        # Run it as a package and also as directory.\n        if filename == \"package_program\":\n            # Not really supported for 2.6\n            if python_version >= (2, 7):\n                extra_variant.append(\"--python-flag=-m\")\n\n        # Cannot include the files with syntax errors, these would then become\n        # ImportError, but that's not the test. In all other cases, use two\n        # step execution, which will not add the program original source to\n        # PYTHONPATH.\n        if filename != \"syntax_errors\":\n            extra_flags.append(\"two_step_execution\")\n        else:\n            extra_flags.append(\"binary_python_path\")\n\n        if filename == \"plugin_import\":\n            os.environ[\"NUITKA_EXTRA_OPTIONS\"] = (\n                extra_options + \" --include-package=some_package\"\n            )\n        elif filename == \"reimport_main_dynamic\":\n            if python_version < (3,):\n                os.environ[\"NUITKA_EXTRA_OPTIONS\"] = (\n                    extra_options\n                    + \" --include-plugin-directory=%s\" % (os.path.abspath(filename))\n                )\n            else:\n                os.environ[\"NUITKA_EXTRA_OPTIONS\"] = (\n                    extra_options\n                    + \" --include-plugin-files=%s/*.py\" % (os.path.abspath(filename))\n                )\n\n            extra_flags.append(\"ignore_warnings\")\n        elif filename == \"multiprocessing_using\":\n            # TODO: Still true?\n            if sys.platform == \"darwin\" and python_version >= (3, 8):\n                reportSkip(\"Hangs for unknown reasons\", \".\", filename)\n                continue\n        else:\n            os.environ[\"NUITKA_EXTRA_OPTIONS\"] = extra_options\n\n        requirements_met, error_message = checkTestRequirements(\n            os.path.join(filename, filename_main)\n        )\n        if not requirements_met:\n            reportSkip(error_message, \".\", filename)\n            continue\n\n        my_print(\"Consider output of recursively compiled program:\", filename)\n\n        extra_python_path = [\n            os.path.abspath(os.path.join(filename, entry))\n            for entry in os.listdir(filename)\n            if entry.startswith(\"path\")\n        ]\n\n        if extra_python_path:\n            my_print(\"Applying extra PYTHONPATH %r.\" % extra_python_path)\n\n        with withPythonPathChange(extra_python_path):\n            compareWithCPython(\n                dirname=filename,\n                filename=filename_main,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=False,\n            )\n\n            if extra_variant:\n                my_print(\"Extra variation %r.\" % extra_variant)\n                compareWithCPython(\n                    dirname=filename,\n                    filename=filename_main,\n                    extra_flags=extra_flags + extra_variant,\n                    search_mode=search_mode,\n                    needs_2to3=False,\n                )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/StdlibOverloadMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Main importing nearby package\")\n\nimport pyexpat  # isort:skip\nfrom some_package import normal_importing, star_importing  # isort:skip\n\ntry:\n    print(pyexpat.defined_in_pyexpat)\nexcept AttributeError:\n    print(\"Must be Python3, where absolute imports are default.\")\nprint(\"Main importing from package doing star import\")\nprint(\"Main importing from package doing normal import\")\n\nprint(\"Done.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/pyexpat.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndefined_in_pyexpat = \"see me\"\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/some_package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/some_package/normal_importing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport pyexpat\n\nprint(\"Imported pyexpat, should use our one.\")\n\nprint([x for x in dir(pyexpat) if x not in (\"__compiled__\", \"__loader__\")])\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/some_package/pyexpat.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndefined_in_pyexpat_subpackage = \"see me\"\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/stdlib_overload/some_package/star_importing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Make a star import, and demonstrate that it has impact on the modules dict.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nfrom .pyexpat import *  # pylint: disable=unused-wildcard-import,wildcard-import\n\nprint(\"some_package.star_importing, doing the star import\")\n\nprint(\"Before\", sorted(x for x in dir() if x not in (\"__compiled__\", \"__loader__\")))\n\n\nlala = 1\nprint(\"After\", sorted(x for x in dir() if x not in (\"__compiled__\", \"__loader__\")))\n\nprint(\"Finished\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/syntax_errors/IndentationErroring.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\ndef f():\n   x\n    y\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/syntax_errors/SyntaxErroring.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nclass x(metaclass=y):\n    pass\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/syntax_errors/SyntaxErrorsMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\ntry:\n    from SyntaxErroring import x\nexcept Exception as e:\n    print(\"Importing with syntax error gave:\", type(e), e)\n\ntry:\n    from IndentationErroring import x\nexcept Exception as e:\n    print(\"Importing with indentation error gave:\", type(e), e)\n\nprint(\"Finished.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/unicode_bom/UnicodeBomMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Program that imports a BOM using module.\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport unicode_bom  # pylint: disable=unused-import\n\nprint(\"Importing unicode BOM file:\")\n\nprint(\"OK.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/unicode_bom/unicode_bom.py",
    "content": "﻿#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# import unicodedata\n\n\nprint(\"This is from file with BOM unicode marker\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/programs/with space/Space Main.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nprint(\"Hello from main program with space in its paths\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/reflected/compile_itself.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test Nuitka compiling itself and compiling itself in compiled form again.\n\nThis should not only give no errors, but the same source for modules being\ncompiled when Nuitka is running compiled and uncompiled, so we can discover\nchanges in order of execution in this test.\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport difflib\nimport shutil\nimport subprocess\nimport time\n\nfrom nuitka.tools.Basics import addPYTHONPATH\nfrom nuitka.tools.testing.Common import (\n    getPythonSysPath,\n    getTempDir,\n    my_print,\n    setup,\n    test_logger,\n    withPythonPathChange,\n)\nfrom nuitka.utils.Execution import wrapCommandForDebuggerForSubprocess\nfrom nuitka.utils.FileOperations import (\n    copyTree,\n    deleteFile,\n    listDir,\n    removeDirectory,\n)\nfrom nuitka.utils.Importing import getSharedLibrarySuffix\nfrom nuitka.Version import getCommercialVersion\n\nnuitka_main_path = os.path.join(\"..\", \"..\", \"bin\", \"nuitka\")\n\ntmp_dir = getTempDir()\n\n# Cannot detect this more automatic, so we need to list them, avoiding\n# the ones not needed.\nPACKAGE_LIST = [\n    \"nuitka\",\n    \"nuitka/nodes\",\n    \"nuitka/specs\",\n    \"nuitka/nodes/shapes\",\n    \"nuitka/tree\",\n    \"nuitka/importing\",\n    \"nuitka/build\",\n    \"nuitka/freezer\",\n    \"nuitka/code_generation\",\n    \"nuitka/code_generation/templates\",\n    \"nuitka/code_generation/c_types\",\n    \"nuitka/optimizations\",\n    \"nuitka/finalizations\",\n    \"nuitka/plugins\",\n    \"nuitka/plugins/standard\",\n    \"nuitka/plugins/commercial\",\n    \"nuitka/reports\",\n    \"nuitka/pgo\",\n    \"nuitka/containers\",\n    \"nuitka/utils\",\n]\n\nif not getCommercialVersion():\n    PACKAGE_LIST.remove(\"nuitka/plugins/commercial\")\n\nexe_suffix = \".exe\" if os.name == \"nt\" else \".bin\"\n\n\ndef readSource(filename):\n    if str is bytes:\n        return open(filename, \"rb\").read()\n    else:\n        return open(filename, \"rb\").read().decode(\"latin1\")\n\n\ndef diffRecursive(dir1, dir2):\n    # Complex in nature, pylint: disable=too-many-branches\n\n    done = set()\n\n    result = False\n\n    for path1, filename in listDir(dir1):\n        if \"cache-\" in path1:\n            continue\n\n        path2 = os.path.join(dir2, filename)\n\n        done.add(path1)\n\n        # Skip these binary files and scons build database of course.\n        # TODO: Temporary ignore \".bin\", until we have something better than marshal which behaves\n        # differently in compiled Nuitka:\n        if filename.endswith(\n            (\n                \".o\",\n                \".os\",\n                \".obj\",\n                \".dblite\",\n                \".tmp\",\n                \".sconsign\",\n                \".txt\",\n                \".bin\",\n                \".const\",\n                \".exp\",\n            )\n        ):\n            continue\n\n        if \"scons-debug\" in filename:\n            continue\n\n        if not os.path.exists(path2):\n            test_logger.warning(\"Only in %s: %s\" % (dir1, filename))\n            result = False\n            continue\n\n        if os.path.isdir(path1):\n            r = diffRecursive(path1, path2)\n            if r:\n                result = True\n        elif os.path.isfile(path1):\n            fromdate = time.ctime(os.stat(path1).st_mtime)\n            todate = time.ctime(os.stat(path2).st_mtime)\n\n            diff = difflib.unified_diff(\n                a=readSource(path1).splitlines(),\n                b=readSource(path2).splitlines(),\n                fromfile=path1,\n                tofile=path2,\n                fromfiledate=fromdate,\n                tofiledate=todate,\n                n=3,\n            )\n\n            diff_list = list(diff)\n\n            if diff_list:\n                for line in diff_list:\n                    try:\n                        my_print(line)\n                    except UnicodeEncodeError:\n                        my_print(repr(line))\n\n                result = True\n        else:\n            assert False, path1\n\n    for path1, filename in listDir(dir2):\n        if \"cache-\" in path1:\n            continue\n\n        path2 = os.path.join(dir2, filename)\n\n        if path1 in done:\n            continue\n\n        if not os.path.exists(path1):\n            test_logger.warning(\"Only in %s: %s\" % (dir2, filename))\n            result = False\n            continue\n\n    return result\n\n\ndef _traceCompilation(path, pass_number):\n    test_logger.info(\"Compiling '%s' (PASS %d).\" % (path, pass_number))\n\n\ndef executePASS1():\n    test_logger.info(\n        \"PASS 1: Compiling to many compiled modules from compiler running from .py files.\"\n    )\n\n    base_dir = os.path.join(\"..\", \"..\")\n\n    for package in PACKAGE_LIST:\n        package = package.replace(\"/\", os.path.sep)\n\n        source_dir = os.path.join(base_dir, package)\n        target_dir = package\n\n        removeDirectory(path=target_dir, ignore_errors=False)\n\n        os.mkdir(target_dir)\n\n        for path, filename in listDir(target_dir):\n            if filename.endswith((\".so\", \".dylib\")):\n                os.unlink(path)\n\n        for path, filename in listDir(source_dir):\n            if not filename.endswith(\".py\"):\n                continue\n\n            if filename.startswith(\".#\"):\n                continue\n\n            if filename != \"__init__.py\":\n                _traceCompilation(path=path, pass_number=1)\n\n                command = [\n                    os.environ[\"PYTHON\"],\n                    nuitka_main_path,\n                    \"--module\",\n                    \"--nofollow-imports\",\n                    \"--output-dir=%s\" % target_dir,\n                    \"--no-pyi-file\",\n                    path,\n                ]\n                command += os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n                my_print(\"Command: \", \" \".join(command))\n\n                result = subprocess.call(command)\n\n                if result != 0:\n                    sys.exit(result)\n            else:\n                shutil.copyfile(path, os.path.join(target_dir, filename))\n\n    _traceCompilation(path=nuitka_main_path, pass_number=1)\n\n    shutil.copyfile(nuitka_main_path, \"nuitka-runner.py\")\n\n    command = [\n        os.environ[\"PYTHON\"],\n        nuitka_main_path,\n        \"--nofollow-imports\",\n        \"--enable-plugin=pylint-warnings\",\n        \"--output-dir=.\",\n        \"--python-flag=no_site\",\n        \"nuitka-runner.py\",\n    ]\n    command += os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n    my_print(\"Command: \", \" \".join(command))\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n    shutil.move(\"nuitka-runner\" + exe_suffix, \"nuitka\" + exe_suffix)\n\n    scons_inline_copy_path = os.path.join(base_dir, \"nuitka\", \"build\", \"inline_copy\")\n\n    if os.path.exists(scons_inline_copy_path):\n        copyTree(scons_inline_copy_path, os.path.join(\"nuitka\", \"build\", \"inline_copy\"))\n\n    # Copy required data files.\n    for filename in (\n        \"nuitka/build/Backend.scons\",\n        \"nuitka/plugins/standard/standard.nuitka-package.config.yml\",\n        \"nuitka/plugins/standard/stdlib3.nuitka-package.config.yml\",\n        \"nuitka/plugins/standard/stdlib2.nuitka-package.config.yml\",\n    ):\n        shutil.copyfile(\n            os.path.join(base_dir, filename),\n            filename,\n        )\n\n    copyTree(\n        os.path.join(base_dir, \"nuitka\", \"code_generation\", \"templates_c\"),\n        os.path.join(\"nuitka\", \"code_generation\", \"templates_c\"),\n    )\n\n    copyTree(\n        os.path.join(base_dir, \"nuitka\", \"build\", \"static_src\"),\n        os.path.join(\"nuitka\", \"build\", \"static_src\"),\n    )\n    copyTree(\n        os.path.join(base_dir, \"nuitka\", \"build\", \"include\"),\n        os.path.join(\"nuitka\", \"build\", \"include\"),\n    )\n\n    # The data composer tool, use it by source.\n    copyTree(\n        os.path.join(base_dir, \"nuitka\", \"tools\"),\n        os.path.join(\"nuitka\", \"tools\"),\n    )\n\n    test_logger.info(\"OK.\")\n\n\ndef compileAndCompareWith(nuitka, pass_number):\n    if \"PYTHONHASHSEED\" not in os.environ:\n        os.environ[\"PYTHONHASHSEED\"] = \"0\"\n    if \"PYTHON_FROZEN_MODULES\" not in os.environ:\n        os.environ[\"PYTHON_FROZEN_MODULES\"] = \"off\"\n\n    base_dir = os.path.join(\"..\", \"..\")\n\n    for package in PACKAGE_LIST:\n        package = package.replace(\"/\", os.path.sep)\n\n        source_dir = os.path.join(base_dir, package)\n\n        for path, filename in listDir(source_dir):\n            if not filename.endswith(\".py\"):\n                continue\n\n            if filename.startswith(\".#\"):\n                continue\n\n            path = os.path.join(source_dir, filename)\n\n            if filename != \"__init__.py\":\n                _traceCompilation(path=path, pass_number=pass_number)\n\n                target = filename.replace(\".py\", \".build\")\n\n                target_dir = os.path.join(tmp_dir, target)\n\n                removeDirectory(path=target_dir, ignore_errors=False)\n\n                command = [\n                    nuitka,\n                    \"--module\",\n                    \"--enable-plugin=pylint-warnings\",\n                    \"--output-dir=%s\" % tmp_dir,\n                    \"--no-pyi-file\",\n                    \"--nofollow-imports\",\n                    path,\n                ]\n                command += os.environ.get(\"NUITKA_EXTRA_OPTIONS\", \"\").split()\n\n                my_print(\"Command: \", \" \".join(command))\n                exit_nuitka = subprocess.call(command)\n\n                # In case of segfault or assertion triggered, run in debugger.\n                if exit_nuitka in (-11, -6) and sys.platform != \"nt\":\n                    command2 = wrapCommandForDebuggerForSubprocess(*command)\n                    subprocess.call(command2)\n\n                if exit_nuitka != 0:\n                    my_print(\"An error exit %s occurred, aborting.\" % exit_nuitka)\n                    sys.exit(exit_nuitka)\n\n                has_diff = diffRecursive(os.path.join(package, target), target_dir)\n\n                if has_diff:\n                    sys.exit(\"There were differences!\")\n\n                shutil.rmtree(target_dir)\n\n                for preferred in (True, False):\n                    target_filename = filename.replace(\n                        \".py\", getSharedLibrarySuffix(preferred=preferred)\n                    )\n\n                    deleteFile(\n                        path=os.path.join(tmp_dir, target_filename), must_exist=False\n                    )\n\n\ndef executePASS2():\n    test_logger.info(\n        \"PASS 2: Compiling from compiler running from entry '.exe' and many extension files.\"\n    )\n\n    with withPythonPathChange(getPythonSysPath()):\n        # Windows will load the compiled modules (pyd) only from PYTHONPATH, so we\n        # have to add it.\n        if os.name == \"nt\":\n            addPYTHONPATH(PACKAGE_LIST)\n\n        compileAndCompareWith(\n            nuitka=os.path.join(\".\", \"nuitka\" + exe_suffix), pass_number=2\n        )\n\n    test_logger.info(\"OK.\")\n\n\ndef executePASS3():\n    test_logger.info(\n        \"PASS 3: Compiling from compiler running from .py files to single .exe.\"\n    )\n\n    exe_path = os.path.join(tmp_dir, \"nuitka\" + exe_suffix)\n\n    if os.path.exists(exe_path):\n        os.unlink(exe_path)\n\n    build_path = os.path.join(tmp_dir, \"nuitka.build\")\n\n    if os.path.exists(build_path):\n        shutil.rmtree(build_path)\n\n    path = os.path.join(\"..\", \"..\", \"bin\", \"nuitka\")\n\n    _traceCompilation(path=path, pass_number=3)\n\n    command = [\n        os.environ[\"PYTHON\"],\n        nuitka_main_path,\n        path,\n        \"--output-dir=%s\" % tmp_dir,\n        \"--python-flag=-S\",\n        \"--follow-imports\",\n    ]\n\n    my_print(\"Command: \", \" \".join(command))\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n    shutil.rmtree(build_path)\n\n    test_logger.info(\"OK.\")\n\n\ndef executePASS4():\n    test_logger.info(\"PASS 4: Compiling the compiler running from single exe.\")\n\n    exe_path = os.path.join(tmp_dir, \"nuitka\" + exe_suffix)\n\n    with withPythonPathChange(getPythonSysPath()):\n        # Windows will load the compiled modules (pyd) only from PYTHONPATH, so we\n        # have to add it.\n        if os.name == \"nt\":\n            addPYTHONPATH(PACKAGE_LIST)\n\n        compileAndCompareWith(exe_path, pass_number=4)\n\n    test_logger.info(\"OK.\")\n\n\ndef executePASS5():\n    my_print(\n        \"PASS 5: Compiling the compiler 'nuitka' package to single extension module.\"\n    )\n\n    path = os.path.join(\"..\", \"..\", \"nuitka\")\n\n    command = [\n        os.environ[\"PYTHON\"],\n        nuitka_main_path,\n        \"--enable-plugin=pylint-warnings\",\n        \"--output-dir=%s\" % tmp_dir,\n        \"--include-plugin-dir=%s\" % path,\n        \"--nofollow-import-to=nuitka.build.inline_copy\",\n        \"--nofollow-import-to=nuitka.build.include\",\n        \"--nofollow-import-to=nuitka.build.static_src\",\n        \"--nofollow-import-to=nuitka.tools\",\n        \"--module\",\n        path,\n    ]\n\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n    for preferred in True, False:\n        candidate = \"nuitka\" + getSharedLibrarySuffix(preferred=preferred)\n\n        deleteFile(candidate, must_exist=False)\n\n    os.unlink(os.path.join(tmp_dir, \"nuitka.pyi\"))\n    shutil.rmtree(os.path.join(tmp_dir, \"nuitka.build\"))\n\n\ndef main():\n    setup(needs_io_encoding=True)\n\n    executePASS1()\n    executePASS2()\n    executePASS3()\n    executePASS4()\n\n    shutil.rmtree(\"nuitka\")\n\n    executePASS5()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/run-tests",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Main front-end to the tests of Nuitka.\n\nHas many options, read --help output.\n\"\"\"\n\nimport os\nimport sys\n\n# Unchanged, running from checkout, use the parent directory, the nuitka\n# package ought be there.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(\n            os.path.dirname(__file__),\n            \"..\",\n        )\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.run_nuitka_tests.__main__ import main\n\nmain()\n\n#     Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n#     integrates with CPython, but also works on its own.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/BrotliUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\nimport brotli\n\n# nuitka-skip-unless-imports: brotli\n\nprint(\"Compressed data:\", brotli.compress(b\"README.txt\"))\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/CtypesUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n\nimport ctypes\nimport os\nimport sys\n\nif os.name == \"nt\":\n    # adapted from http://code.activestate.com/recipes/578513\n    from ctypes import wintypes\n\n    # Lets allow this to match Windows API it reflects,\n    # pylint: disable=invalid-name\n    class PROCESS_MEMORY_COUNTERS_EX(ctypes.Structure):\n        _fields_ = [\n            (\"cb\", wintypes.DWORD),\n            (\"PageFaultCount\", wintypes.DWORD),\n            (\"PeakWorkingSetSize\", ctypes.c_size_t),\n            (\"WorkingSetSize\", ctypes.c_size_t),\n            (\"QuotaPeakPagedPoolUsage\", ctypes.c_size_t),\n            (\"QuotaPagedPoolUsage\", ctypes.c_size_t),\n            (\"QuotaPeakNonPagedPoolUsage\", ctypes.c_size_t),\n            (\"QuotaNonPagedPoolUsage\", ctypes.c_size_t),\n            (\"PagefileUsage\", ctypes.c_size_t),\n            (\"PeakPagefileUsage\", ctypes.c_size_t),\n            (\"PrivateUsage\", ctypes.c_size_t),\n        ]\n\n    GetProcessMemoryInfo = ctypes.windll.psapi.GetProcessMemoryInfo\n    GetProcessMemoryInfo.argtypes = (\n        wintypes.HANDLE,\n        ctypes.POINTER(PROCESS_MEMORY_COUNTERS_EX),\n        wintypes.DWORD,\n    )\n    GetProcessMemoryInfo.restype = wintypes.BOOL\n\n    counters = PROCESS_MEMORY_COUNTERS_EX()\n    rv = GetProcessMemoryInfo(\n        ctypes.windll.kernel32.GetCurrentProcess(),\n        ctypes.byref(counters),\n        ctypes.sizeof(counters),\n    )\n\n    if not rv:\n        raise ctypes.WinError()\n\n    print(\"OK.\")\nelif sys.platform == \"linux\":\n    libc = ctypes.CDLL(\"libc.so.6\")\n\n    printf = libc.printf\n    # printf.argtypes = (ctypes.c_char_p, ctypes.c_char_p)\n    printf(b\"Hello, %s\\n\", b\"World!\")\n\n    print(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/DateutilsUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-skip-unless-imports: dateutil\n\n\nfrom datetime import *\n\nfrom dateutil.parser import *\nfrom dateutil.relativedelta import *\nfrom dateutil.rrule import *\n\n# test parse\n# use static time to avoid time differences in output\nnow = parse(\"Thu Sep 25 10:00:00 2003\")\nprint(now)\n\n\n# test relativedelta\nnow += relativedelta(months=+1)\nprint(now)\n\nnow += relativedelta(months=+1, weeks=+1)\nprint(now)\n\n\n# test rrule\nprint(list(rrule(DAILY, count=10, dtstart=parse(\"19970902T090000\"))))\n\nprint(\n    list(\n        rrule(\n            YEARLY,\n            bymonth=1,\n            byweekday=range(7),\n            dtstart=parse(\"19980101T090000\"),\n            until=parse(\"20000131T090000\"),\n        )\n    )\n)\n\n\n# test rruleset\nrrset = rruleset()\nrrset.rrule(rrule(WEEKLY, count=4, dtstart=parse(\"19970902T090000\")))\nrrset.rdate(datetime(1997, 9, 7, 9, 0))\nrrset.exdate(datetime(1997, 9, 16, 9, 0))\nprint(list(rrset))\n\n\n# test rrulestr\nprint(\n    list(rrulestr(\"FREQ=DAILY;INTERVAL=10;COUNT=5\", dtstart=parse(\"19970902T090000\")))\n)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/FlaskUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom flask import Flask\n\n# nuitka-skip-unless-imports: flask\n\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef main():\n    return \"Welcome!\"\n\n\nif __name__ == \"__main__\":\n    pass\n    # TODO: Find something other meaningful to do.\n    # app.run()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/GiUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-skip-unless-imports: cairo\n\nimport cairo\nimport gi\n\ngi.require_version(\"Gtk\", \"3.0\")\ngi.require_version(\"Gdk\", \"3.0\")\n\nfrom gi.repository import Gdk, Gtk\n\n# isort:start\n\nGtk.init()\n\nimage = cairo.ImageSurface.create_from_png(\"../../doc/images/Nuitka-Logo-Symbol.png\")\nregion = Gdk.cairo_region_create_from_surface(image)\n\nprint(\"All OK\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/GlfwUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n\n# nuitka-skip-unless-imports: glfw\n\n# isort:start\n\nimport glfw\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/GtkUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" pygtk standalone basic test.\n\n\"\"\"\n\n# nuitka-skip-unless-imports: pygtk\n\n\nfrom __future__ import print_function\n\n# Disable warnings from subsequent imports\nimport warnings\n\nwarnings.filterwarnings(\"ignore\", \"\")\n\n# isort:start\n\nimport gtk\nimport pygtk\n\npygtk.require(\"2.0\")\n\nprint(\"OK\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/HexEncodingTest_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Small Python2 only test that demonstrates the hex encoding to work. \"\"\"\n\nprint(\"4B4159\".decode(\"hex\"))  # Should output \"KAY\"\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/IdnaUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n\nfrom __future__ import print_function\n\nimport sys\n\nimport idna.core\n\n# nuitka-skip-unless-imports: idna.core\n\nprint(idna.core, \"idna.idnadata\" in sys.modules)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/LxmlUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Lxml standalone basic test.\n\n\"\"\"\n\n# nuitka-project: --standalone\n\nfrom __future__ import print_function\n\nimport lxml.etree\n\n# nuitka-skip-unless-imports: lxml.etree\n\ntree = lxml.etree.fromstring(\"<root>value</root>\")\nassert tree.tag == \"root\"\nassert tree.text == \"value\"\n\nprint(\"OK\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/MatplotlibUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test using matplotlib, should actually do something with it. \"\"\"\n\nimport os\n\nfrom matplotlib import pyplot as plt\n\n# nuitka-skip-unless-imports: matplotlib\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=no-qt\n\n# Make sure, the usual bad ones are not included with anti-bloat.\n\n# nuitka-project: --noinclude-setuptools-mode=error\n# nuitka-project: --noinclude-pytest-mode=error\n# nuitka-project: --noinclude-custom-mode=numpy.distutils:error\n# nuitka-project: --noinclude-custom-mode=IPython:error\n\n\ny = [0, 1, 2, 3]\n\nplt.plot(y, color=\"red\", markersize=1, linestyle=\"-\")\n\nif os.getenv(\"NUITKA_TEST_INTERACTIVE\") == \"1\":\n    plt.show()\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/MetadataPackagesUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test uses the meta data of metadata entry points lookups that wouldn't work at runtime.\n\nBut since Nuitka resolves them at compile time, no issue should happen.\n\"\"\"\n\n# nuitka-project: --standalone\n\nimport warnings\n\nwarnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n\ntry:\n    from importlib.metadata import entry_points\nexcept ImportError:\n    pass\nelse:\n    print(\"Type of importlib.metadata.entry_points\", type(entry_points()))\n    try:\n        print(\n            \"Type of importlib.metadata.entry_points subscript\",\n            type(entry_points()[\"console_scripts\"]),\n        )\n        print(\"There are %d entry points\" % len(entry_points()[\"console_scripts\"]))\n        print(\n            \"Example entry point\",\n            sorted(entry_points()[\"console_scripts\"], key=lambda e: e.name)[0],\n        )\n    except KeyError:\n        pass\n\ntry:\n    from importlib_metadata import entry_points\nexcept ImportError:\n    pass\nelse:\n    print(\"Type of importlib_metadata.entry_points\", type(entry_points()))\n    try:\n        print(\n            \"Type of importlib_metadata.entry_points subscript\",\n            type(entry_points()[\"console_scripts\"]),\n        )\n        print(\"There are %d entry points\" % len(entry_points()[\"console_scripts\"]))\n        print(\n            \"Example entry point\",\n            sorted(entry_points()[\"console_scripts\"], key=lambda e: e.name)[0],\n        )\n    except KeyError:\n        pass\n    try:\n        print(\n            \"Example group from importlib_metadata.entry_points element\",\n            sorted(entry_points().groups)[0],\n        )\n    except (IndexError, AttributeError):\n        pass\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/NumpyUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# nuitka-skip-unless-imports: numpy\n\n# nuitka-project: --standalone\n\n# Make sure, the usual bad ones are not included with anti-bloat.\n\n# nuitka-project: --noinclude-default-mode=error\n# nuitka-project: --noinclude-custom-mode=numpy.distutils:error\n\n# nuitka-project: --noinclude-custom-mode=pydoc:error\n\n# isort:start\n\n# To trigger DLL usage on non-Linux.\nimport numpy.core.multiarray\n\na = numpy.arange(15).reshape(3, 5)\n\nprint(\"An array\", a)\n\ntry:\n    import numpy.random._bounded_integers\nexcept ImportError:\n    print(\"didn't load numpy.random._bounded_integers\")\n    pass\n\n\nimport numpy.lib.recfunctions  # isort:skip\n\na = numpy.zeros(4, dtype=[(\"a\", \"i4\"), (\"b\", \"f4,u2\"), (\"c\", \"f4\", 2)])\nprint(\"Another numpy usage\", numpy.lib.recfunctions.structured_to_unstructured(a))\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/OpenGLUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport OpenGL\n\n# nuitka-skip-unless-imports: OpenGL\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PandasUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Low coverage Pandas importing test. \"\"\"\n\n# nuitka-skip-unless-imports: pandas\n\n# nuitka-project: --standalone\n\n# Avoid Qt, not being used\n# nuitka-project: --enable-plugin=no-qt\n\n# Make sure, the usual bad ones are not included with anti-bloat.\n\n# nuitka-project: --noinclude-default-mode=error\n# nuitka-project: --noinclude-custom-mode=numpy.distutils:error\n\n# scipy.lib._docscrape insists on it, and seems not easy to get\n# rid of.\n## nuitka-project: --noinclude-custom-mode=pydoc:error\n\n# isort:start\n\nimport pandas as pd\n\nprint(pd.__version__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PasslibUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom passlib.hash import sha512_crypt as sha512\n\n# nuitka-skip-unless-imports: passlib\n\nprint(\"hello\")\nprint(len(sha512.using(rounds=1000).hash(\"password\")))\nprint(\"bye\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PendulumUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Pendulum standalone basic test.\n\nWhen this import works, locales are there.\n\"\"\"\n\n# nuitka-project: --standalone\n\n# nuitka-skip-unless-imports: pendulum\n\nfrom __future__ import print_function\n\n# isort:start\n\nimport pendulum\n\ndt = pendulum.datetime(2020, 11, 27, tz=\"NZ\")\nprint(dt)\nprint(dt.timezone.name)\n\nprint(\"OK\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PkgResourcesRequiresUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test uses the meta data of metadata lookups that wouldn't work at runtime.\n\nBut since Nuitka resolves them at compile time, no issue should happen, unless\nthe module used in the example is not installed.\n\"\"\"\n\n# nuitka-project: --standalone\n\nimport sys\n\n# nuitka-skip-unless-imports: lxml\n\ntry:\n    from pkg_resources import get_distribution, require\nexcept ImportError:\n    print(\"No pkg_resources found\")\nelse:\n    x = require(\"lxml\")\n    print(x[0].version)\n    print(x[0].parsed_version)\n    __version__ = get_distribution(\"lxml\").version\n    print(\"pkg_resources gives version\", __version__)\n    __version__ = get_distribution(\"lxml\").parsed_version\n    print(\"pkg_resources gives parsed version\", __version__)\n\n\ntry:\n    from importlib.metadata import version\nexcept ImportError:\n    print(\"Old Python\", sys.version_info)\nelse:\n    __version__ = version(\"lxml\")\n    print(\"Stdlib importlib.metadata gives version\", __version__)\n\n\ntry:\n    from importlib_metadata import version\nexcept ImportError:\n    print(\"Backport importlib_metadata is not installed.\")\nelse:\n    __version__ = version(\"lxml\")\n    print(\"Backport importlib_metadata gives version\", __version__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PmwUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-skip-unless-expression: __import__(\"Tkinter\" if sys.version_info[0] < 3 else \"tkinter\")\n# nuitka-skip-unless-imports: Pmw\n\n# isort:start\n\nimport Pmw\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PyQt5Plugins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom PyQt5 import QtGui\n\n# nuitka-skip-unless-imports: PyQt5.QtGui\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyqt5\n#\n# nuitka-project-if: {OS} == \"Darwin\":\n#   nuitka-project: --macos-create-app-bundle\n#   nuitka-project: --onefile\n\nprint(QtGui.QImageReader.supportedImageFormats())\n\n# nuitka-project: --enable-plugin=pyqt5\n\n# nuitka-skip-unless-imports: PyQt5.QtGui\n\nprint(QtGui.QImageReader.supportedImageFormats())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PyQt5SSLSupport.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-skip-unless-imports: PyQt5.QtGui\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyqt5\n\n# nuitka-project-if: {OS} == \"Darwin\":\n#   nuitka-project: --macos-create-app-bundle\n#   nuitka-project: --onefile\n\nfrom PyQt5.QtNetwork import QSslSocket\n\nprint(\"SSL support: %r\" % (QSslSocket.supportsSsl(),))\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PyQt5Using.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyqt5\n\n# nuitka-skip-unless-imports: PyQt5.QtGui\n\n# nuitka-project-if: {OS} == \"Darwin\":\n#   nuitka-project: --macos-create-app-bundle\n#   nuitka-project: --onefile\n\nfrom __future__ import print_function\n\nfrom PyQt5.QtCore import (\n    QCoreApplication,\n    QMetaObject,\n    QObject,\n    QSettings,\n    pyqtSignal,\n    pyqtSlot,\n)\n\n# This test is playing with configuration settings and checking that works.\n\napp = QCoreApplication([])\napp.setOrganizationName(\"BOGUS_NAME\")\napp.setOrganizationDomain(\"bogosity.com\")\napp.setApplicationName(\"BOGUS\")\nprint(\"OK.\")\n\n# This test is using signals and will only work if PySide properly accepts\n# compiled functions as callables.\n\n\nclass Communicate(QObject):\n    speak = pyqtSignal(int)\n\n    def __init__(self, name=\"\", parent=None):\n        QObject.__init__(self, parent)\n        self.setObjectName(name)\n\n\nclass Speaker(QObject):\n    @pyqtSlot(int)\n    def on_communicator_speak(self, stuff):\n        print(stuff)\n\n\nspeaker = Speaker()\nsomeone = Communicate(name=\"communicator\", parent=speaker)\n\nQMetaObject.connectSlotsByName(speaker)\n\nprint(\"The answer is:\", end=\"\")\n# emit  'speak' signal\nsomeone.speak.emit(42)\nprint(\"Slot should have made output by now.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PyQt6Plugins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom PyQt6 import QtGui\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyqt6\n\n# nuitka-project-if: {OS} == \"Darwin\":\n#   nuitka-project: --macos-create-app-bundle\n\n# nuitka-skip-unless-imports: PyQt6.QtGui\n\nprint(QtGui.QImageReader.supportedImageFormats())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PyQt6Using.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyqt6\n\n# nuitka-project-if: {OS} == \"Darwin\":\n#   nuitka-project: --macos-create-app-bundle\n\n# nuitka-skip-unless-imports: PyQt6.QtGui\n\nfrom __future__ import print_function\n\nfrom PyQt6.QtCore import (\n    QCoreApplication,\n    QMetaObject,\n    QObject,\n    QSettings,\n    pyqtSignal,\n    pyqtSlot,\n)\n\n# This test is playing with configuration settings and checking that works.\n\napp = QCoreApplication([])\napp.setOrganizationName(\"BOGUS_NAME\")\napp.setOrganizationDomain(\"bogosity.com\")\napp.setApplicationName(\"BOGUS\")\nprint(\"OK.\")\n\n# This test is using signals and will only work if PySide properly accepts\n# compiled functions as callables.\n\n\nclass Communicate(QObject):\n    speak = pyqtSignal(int)\n\n    def __init__(self, name=\"\", parent=None):\n        QObject.__init__(self, parent)\n        self.setObjectName(name)\n\n\nclass Speaker(QObject):\n    @pyqtSlot(int)\n    def on_communicator_speak(self, stuff):\n        print(stuff)\n\n\nspeaker = Speaker()\nsomeone = Communicate(name=\"communicator\", parent=speaker)\n\nQMetaObject.connectSlotsByName(speaker)\n\nprint(\"The answer is:\", end=\"\")\n# emit  'speak' signal\nsomeone.speak.emit(42)\nprint(\"Slot should have made output by now.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PySide2Using.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test is using signals and will only work if PySide properly accepts\ncompiled functions as callables.\n\"\"\"\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyside2\n\n# nuitka-skip-unless-imports: PySide2.QtCore\n\nfrom __future__ import print_function\n\nfrom PySide2.QtCore import QMetaObject, QObject, Signal, Slot\n\n\nclass Communicate(QObject):\n    speak = Signal(int)\n\n    def __init__(self, name=\"\", parent=None):\n        QObject.__init__(self, parent)\n        self.setObjectName(name)\n\n\nclass Speaker(QObject):\n    @Slot(int)\n    def on_communicator_speak(self, stuff):\n        print(stuff)\n\n\nspeaker = Speaker()\nsomeone = Communicate(name=\"communicator\", parent=speaker)\n\nQMetaObject.connectSlotsByName(speaker)\n\nprint(\"The answer is:\", end=\"\")\n# emit  'speak' signal\nsomeone.speak.emit(42)\nprint(\"Slot should have made output by now.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PySide6Plugins.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom PySide6 import QtGui\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyside6\n\n# nuitka-skip-unless-imports: PySide6.QtGui\n\nprint(QtGui.QImageReader.supportedImageFormats())\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/PySide6Using.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" This test is using signals and will only work if PySide properly accepts\ncompiled functions as callables.\n\"\"\"\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=pyside6\n\n# nuitka-skip-unless-imports: PySide6.QtCore\n\nfrom __future__ import print_function\n\nfrom PySide6.QtCore import QMetaObject, QObject, Signal, Slot\n\n\nclass Communicate(QObject):\n    speak = Signal(int)\n\n    def __init__(self, name=\"\", parent=None):\n        QObject.__init__(self, parent)\n        self.setObjectName(name)\n\n\nclass Speaker(QObject):\n    @Slot(int)\n    def on_communicator_speak(self, stuff):\n        print(stuff)\n\n\nspeaker = Speaker()\nsomeone = Communicate(name=\"communicator\", parent=speaker)\n\nQMetaObject.connectSlotsByName(speaker)\n\nprint(\"The answer is:\", end=\"\")\n# emit  'speak' signal\nsomeone.speak.emit(42)\nprint(\"Slot should have made output by now.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/RsaUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n\nimport rsa\n\n# nuitka-skip-unless-imports: rsa\n\n(tambe_pub, tambe_priv) = rsa.newkeys(512)\nmessage = \"beautiful people!\".encode(\"utf8\")\nencrypted_msg = rsa.encrypt(message, tambe_pub)\nmessage = rsa.decrypt(encrypted_msg, tambe_priv)\n\n\ndef encryption_decryption():\n    \"\"\"Function to test encryption and decryption\"\"\"\n    assert message.decode(\"utf8\") == \"beautiful people!\"\n\n\nencryption_decryption()\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/SetuptoolsUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n# nuitka-project: --noinclude-setuptools-mode=allow\n\nfrom __future__ import print_function\n\nimport setuptools\n\n# Demonstrate that this module, that anti-bloat fights really hard to\n# avoid, actually still works.\n\n# nuitka-skip-unless-imports: setuptools\n\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/ShlibUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-skip-unless-imports: pyexpat\n\nimport pyexpat\n\nprint(pyexpat.__doc__)\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/SocketUsing.py",
    "content": "# -*- coding: utf-8 -*-\n#     Copyright 2024, Paweł Kierzkowski, mailto:<pk.pawelo@gmail.com> find license text at end of file\n\n\n\"\"\" Test that shows that the socket module can properly be used.\n\n\"\"\"\n\n# nuitka-project: --standalone\n\nimport signal\nimport socket\nimport sys\n\n\n# Set up a timeout, seems to happen that below call stalls.\ndef onTimeout(_signum, _frame):\n    sys.exit(0)\n\n\n# Not available on Windows, but there we didn't see the problem anyway,\n# not going to make this use threading for now.\ntry:\n    signal.signal(signal.SIGALRM, onTimeout)\n    signal.alarm(1)\nexcept AttributeError:\n    pass\n\n\n# Call to socket.getfqdn with a non-local address will cause libresolv.so glibc\n# library to be loaded\nsocket.getfqdn(\"1.1.1.1\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/TkInterUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" TkInter standalone test, trying to make sure it loads.\n\n\"\"\"\n\n# nuitka-project: --standalone\n# nuitka-project: --enable-plugin=tk-inter\n\n# Make sure, the usual bad ones are not included with anti-bloat.\n\n# nuitka-project: --noinclude-default-mode=error\n\nfrom __future__ import print_function\n\nimport sys\n\n# Python3 changed module name.\nif str is bytes:\n    import Tkinter as tkinter\nelse:\n    import tkinter\n\n# nuitka-skip-unless-expression: __import__(\"Tkinter\" if sys.version_info[0] < 3 else \"tkinter\")\n\ntry:\n    root = tkinter.Tk()  # this will fail in absence of TCL\nexcept tkinter.TclError as e:\n    assert \"connect to display\" in str(e) or \"no display\" in str(e), str(e)\n    print(\"TCLError exception happened.\")\n    sys.exit(0)\nelse:\n    print(\"Imported tkinter module.\")\n\ntry:\n    import tkinter.tix\nexcept ImportError:\n    print(\"No tix found.\")\nelse:\n    print(\"Imported tkinter tix module.\")\n\ntry:\n    import tkinter.ttk\nexcept ImportError:\n    print(\"No ttk found.\")\nelse:\n    print(\"Imported tkinter ttk module.\")\n\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/Urllib3Using.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import print_function\n\n# testing JSON content\nimport json\nimport os\n\n# test ssl\nimport socket\nimport ssl\nfrom threading import Thread\n\nimport urllib3\n\n# nuitka-project: --standalone\n# nuitka-skip-unless-imports: urllib3,ssl\n\nif str is bytes:\n    # running on python2, pylint: disable=I0021,import-error\n    from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\nelse:\n    # running on python3\n    from http.server import BaseHTTPRequestHandler, HTTPServer\n\nstarted = False\n\n\ndef runHTTPServer():\n    class myServer(BaseHTTPRequestHandler):\n        def do_GET(self):\n            if self.path == \"/\":\n                self.path = \"/index.html\"\n            try:\n                file_to_open = open(self.path[1:], \"rb\").read()\n                self.send_response(200)\n                self.end_headers()\n                self.wfile.write(file_to_open)\n            except IOError:\n                self.send_response(404)\n                self.end_headers()\n\n        # No logging due to races.\n        def log_request(self, code):\n            pass\n\n    global port\n    global server\n\n    for port in range(8020, 9000):\n        server_address = (\"127.0.0.1\", port)\n\n        try:\n            server = HTTPServer(server_address, myServer)\n        except OSError:\n            continue\n        else:\n            break\n\n    global started\n    started = True\n\n    server.serve_forever()\n\n\nThread(target=runHTTPServer).start()\nwhile not started:\n    pass\nprint(\"Server started.\")\n\n# testing request\nhttp = urllib3.PoolManager()\nr = http.request(\"GET\", \"http://localhost:%d/\" % port)\n# print response\nprint(r.status, r.data)\n\n\n# make a temporary test file\nwith open(\"testjson.json\", \"w\") as f:\n    f.write('{\"origin\": \"some, value\"}')\n\nr = http.request(\"GET\", \"http://localhost:%d/testjson.json\" % port)\n\ndata = json.loads(r.data.decode(\"utf8\"))\nif \"Date\" in data:\n    del data[\"Date\"]\nprint(\"DATA:\", data)\n\nos.remove(\"testjson.json\")\n\nserver.shutdown()\nprint(\"Server shutdown\")\n\n\n# TODO: Testing via network is not allowed, but SSL on localhost\n# is not easy.\nif False:\n    hostname = \"www.google.com\"\n    context = ssl.create_default_context()\n    with socket.create_connection((hostname, 443)) as sock:\n        with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n            print(ssock.version())\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/Win32ComUsing.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test that uses win32com superficially.\n\nPlease help make it more useful, ideally by adding something\nthat would work on every machine.\n\"\"\"\n\n# nuitka-project: --standalone\n\nfrom win32com import storagecon\nfrom win32com.shell import shell, shellcon\n\n# nuitka-skip-unless-imports: win32com\n\nprint(\"OK.\")\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for standalone program tests of Nuitka.\n\nThese tests aim at showing that one specific module works in standalone\nmode, trying to find issues with that packaging.\n\n\"\"\"\n\n\nimport os\nimport sys\n\n# Find nuitka package relative to us. The replacement is for POSIX python\n# and Windows paths on command line.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(\n            os.path.dirname(os.path.abspath(__file__.replace(\"\\\\\", os.sep))), \"..\", \"..\"\n        )\n    ),\n)\n\n# isort:start\n\nfrom nuitka.reports.CompilationReportReader import (\n    getCompilationOutputBinary,\n    parseCompilationReport,\n)\nfrom nuitka.tools.testing.Common import (\n    checkLoadedFileAccesses,\n    checkTestRequirements,\n    compareWithCPython,\n    createSearchMode,\n    displayFileContents,\n    displayFolderContents,\n    displayRuntimeTraces,\n    reportSkip,\n    scanDirectoryForTestCases,\n    setup,\n    test_logger,\n)\nfrom nuitka.tools.testing.RuntimeTracing import (\n    doesSupportTakingRuntimeTrace,\n    getRuntimeTraceOfLoadedFiles,\n)\nfrom nuitka.utils.FileOperations import removeDirectory\nfrom nuitka.utils.Timing import TimerReport\nfrom nuitka.utils.Utils import isBSD, isLinux, isMacOS, isWin32Windows\n\n\ndef displayError(dirname, filename):\n    assert dirname is None\n\n    dist_path = filename[:-3] + \".dist\"\n    displayFolderContents(\"dist folder\", dist_path)\n\n    inclusion_log_path = filename[:-3] + \".py.inclusion.log\"\n    displayFileContents(\"inclusion log\", inclusion_log_path)\n\n\ndef _checkForLibcBinaries(dist_path):\n    found_glibc_libs = []\n    for dist_filename in os.listdir(os.path.join(dist_path)):\n        if os.path.basename(dist_filename).startswith(\n            (\n                \"ld-linux-x86-64.so\",\n                \"libc.so.\",\n                \"libpthread.so.\",\n                \"libm.so.\",\n                \"libdl.so.\",\n                \"libBrokenLocale.so.\",\n                \"libSegFault.so\",\n                \"libanl.so.\",\n                \"libcidn.so.\",\n                \"libcrypt.so.\",\n                \"libmemusage.so\",\n                \"libmvec.so.\",\n                \"libnsl.so.\",\n                \"libnss_compat.so.\",\n                \"libnss_db.so.\",\n                \"libnss_dns.so.\",\n                \"libnss_files.so.\",\n                \"libnss_hesiod.so.\",\n                \"libnss_nis.so.\",\n                \"libnss_nisplus.so.\",\n                \"libpcprofile.so\",\n                \"libresolv.so.\",\n                \"librt.so.\",\n                \"libthread_db-1.0.so\",\n                \"libthread_db.so.\",\n                \"libutil.so.\",\n            )\n        ):\n            found_glibc_libs.append(dist_filename)\n\n    if found_glibc_libs:\n        test_logger.sysexit(\n            \"Should not ship glibc libraries with the standalone executable (found %s)\"\n            % found_glibc_libs\n        )\n\n\ndef main():\n    # Complex stuff, even more should become common code or project options though.\n    # pylint: disable=too-many-branches,too-many-statements\n\n    python_version = setup(suite=\"standalone\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    for filename in scanDirectoryForTestCases(\".\"):\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if not active:\n            continue\n\n        report_filename = \"test-compilation-report.xml\"\n\n        extra_flags = [\n            \"expect_success\",\n            \"--standalone\",\n            \"remove_output\",\n            # Cache the CPython results for reuse, they will normally not change.\n            \"cpython_cache\",\n            # To understand what is slow.\n            \"timing\",\n            # Don't care here, this is mostly for coverage.\n            \"--nowarn-mnemonic=debian-dist-packages\",\n            \"--report=%s\" % report_filename,\n        ]\n\n        # skip each test if their respective requirements are not met\n        requirements_met, error_message = checkTestRequirements(filename)\n        if not requirements_met:\n            reportSkip(error_message, \".\", filename)\n            continue\n\n        if filename == \"Urllib3Using.py\" and os.name == \"nt\":\n            reportSkip(\n                \"Socket module early import not working on Windows currently\",\n                \".\",\n                filename,\n            )\n            continue\n\n        if \"Idna\" in filename:\n            # For the warnings of Python2.\n            if python_version < (3,):\n                extra_flags.append(\"ignore_stderr\")\n\n        if filename == \"GtkUsing.py\":\n            # Don't test on platforms not supported by current Debian testing, and\n            # which should be considered irrelevant by now.\n            if python_version < (2, 7):\n                reportSkip(\"irrelevant Python version\", \".\", filename)\n                continue\n\n            # For the warnings.\n            extra_flags.append(\"ignore_warnings\")\n\n        if filename.startswith(\"Win\"):\n            if os.name != \"nt\":\n                reportSkip(\"Windows only test\", \".\", filename)\n                continue\n\n        if filename == \"TkInterUsing.py\":\n            if isMacOS():\n                reportSkip(\"Not working macOS yet\", \".\", filename)\n                continue\n\n            if isWin32Windows() == \"Windows\":\n                reportSkip(\"Can hang on Windows CI.\", \".\", filename)\n                continue\n\n            # For the plug-in information.\n            extra_flags.append(\"plugin_enable:tk-inter\")\n\n        if filename == \"FlaskUsing.py\":\n            # For the warnings.\n            extra_flags.append(\"ignore_warnings\")\n\n        if filename == \"MetadataPackagesUsing.py\":\n            # TODO: Disabled for now.\n            reportSkip(\n                \"MetadataPackagesUsing is environment dependent somehow, not fully working yet\",\n                \".\",\n                filename,\n            )\n            continue\n\n        if filename == \"PmwUsing.py\":\n            extra_flags.append(\"plugin_enable:pmw-freezer\")\n\n        if filename == \"OpenGLUsing.py\":\n            # For the warnings.\n            extra_flags.append(\"ignore_warnings\")\n\n        if filename == \"PasslibUsing.py\":\n            # For the warnings.\n            extra_flags.append(\"ignore_warnings\")\n\n        if filename == \"Win32ComUsing.py\":\n            # For the warnings.\n            extra_flags.append(\"ignore_warnings\")\n\n        if filename.startswith((\"PySide2\", \"PySide6\", \"PyQt5\", \"PyQt6\")):\n            # Don't test on platforms not supported by current Debian testing, and\n            # which should be considered irrelevant by now.\n            if python_version < (2, 7) or ((3,) <= python_version < (3, 7)):\n                reportSkip(\"irrelevant Python version\", \".\", filename)\n                continue\n\n            if filename != \"PySide6\":\n                extra_flags.append(\"ignore_warnings\")\n\n        if filename.startswith(\"PyQt6\") and isMacOS():\n            reportSkip(\"not currently supported\", \".\", filename)\n            continue\n\n        test_logger.info(\n            \"Consider output of standalone mode compiled program: %s\" % filename\n        )\n\n        # First compare so we know the program behaves identical.\n        compareWithCPython(\n            dirname=None,\n            filename=filename,\n            extra_flags=extra_flags,\n            search_mode=search_mode,\n            needs_2to3=False,\n            on_error=displayError,\n        )\n\n        compilation_report = parseCompilationReport(report_filename)\n\n        binary_filename = getCompilationOutputBinary(\n            compilation_report=compilation_report,\n            prefixes=((\"${cwd}\", os.getcwd()),),\n        )\n        output_dist_path = os.path.dirname(binary_filename)\n\n        # Second check if libc libraries haven't been accidentally\n        # shipped with the standalone executable\n        if isLinux() or isBSD():\n            _checkForLibcBinaries(output_dist_path)\n\n        try:\n            if not doesSupportTakingRuntimeTrace():\n                test_logger.info(\"Runtime traces are not possible on this machine.\")\n                continue\n\n            # Then use \"strace\" on the result.\n            with TimerReport(\n                \"Determining run time loaded files took %.2f\", logger=test_logger\n            ):\n                loaded_filenames = getRuntimeTraceOfLoadedFiles(\n                    logger=test_logger, command=[binary_filename]\n                )\n\n            illegal_accesses = checkLoadedFileAccesses(\n                loaded_filenames=loaded_filenames, current_dir=os.getcwd()\n            )\n\n            if illegal_accesses:\n                displayError(None, filename)\n                displayRuntimeTraces(test_logger, binary_filename)\n\n                test_logger.warning(\n                    \"Should not access these file(s): '%r'.\" % illegal_accesses\n                )\n\n                search_mode.onErrorDetected(1)\n        finally:\n            removeDirectory(filename[:-3] + \".dist\", ignore_errors=True)\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/standalone/zip_importer/ZipImporterMain.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# nuitka-project: --standalone\n# nuitka-project: --include-data-file={MAIN_DIRECTORY}/for_import.zip=for_import.zip\n\n# isort:start\n\nimport os\nimport sys\n\nzip_filename = os.path.join(os.path.dirname(__file__) or \".\", \"for_import.zip\")\n\nassert os.path.exists(zip_filename)\nsys.path.insert(0, zip_filename)\n\n# Import after it can work now.\nimport zip_module  # isort:skip\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/AsyncgenReturn36.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nasync def gen():\n    yield 1\n    return 2\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/AwaitInModule36.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nr = await call()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/BreakWithoutLoop.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# marker1\ndef test_from_format(self):\n    if sys.version_info >= (3, 3):\n        break\n\n\n# marker2\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/ClassReturn.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nclass X:\n    return 3\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/ClosureDel_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef deletingClosure():\n    a = 1\n\n    def closureTaker():\n        return a\n\n    del a\n\n    try:\n        x = closureTaker()\n    except Exception as e:\n        print \"Occurred %r\" % e\n\ndeletingClosure()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/ContinueWithoutLoop.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef test_from_format(self):\n    if sys.version_info >= (3, 3):\n        continue\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/DuplicateArgument.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f(a, a):\n    pass\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/ExecWithNesting_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# In Python2, it is not allowed to take closure variables, in a function that\n# has an \"exec\". For Python3, the problem doesn't exist, as there is no exec\n# statement anymore.\n\ndef someFunctionWithUnqualifiedExecAndCallback():\n    exec \"def f(): pass\"\n\n    def callback():\n        return nested\n\nsomeFunctionWithUnqualifiedExecAndCallback()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/FutureBraces.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import braces\n\nprint(\"Look ma, braces.\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/FutureUnknown.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom __future__ import not_existing\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/GeneratorExpressions38.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test case with generator expression form only allow until Python 3.7\n\n\"\"\"\n\n\ndef strangeLambdaGeneratorExpression():\n    x = ((yield) for i in (1, 2) if (yield))\n\n    print(\"Strange lambda generator expression:\")\n    print(list(x))\n\n\nstrangeLambdaGeneratorExpression()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/GeneratorReturn_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef g():\n    for a in range(3):\n        yield a\n\n    return 7\n\n\nprint(\"Yielder with return value\", list(g()))\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/GlobalForParameter.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f(a):\n    global a\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/Importing32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef starImportFailure():\n    from doctest import *\n\n    try:\n        sys\n        print(\"but it does not\")\n    except NameError:\n        print(\"and it does\")\n\n\nprint(\"Star import needs to respect __all__\", starImportFailure())\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/IndentationError.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef someFunc():\n    a\n     b\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/LateFutureImport.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# Not allowed to do future imports that are not the first statements of the\n# module.\n\na = 1\n\nfrom __future__ import print_function  # isort:skip\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/MisplacedFutureImport.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f():\n    from __future__ import print_function\n\n    print(locals())\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/ModuleReturn.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nlalala = 3\n\nreturn\n\nlelele = 7\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/NonAsciiWithoutEncoding_2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n# No encoding declared, but non-ASCII in that string.\n\ns = \"'\\0\\\"\\n\\r\\t abcd\\x85é\\U00012fff\\uD800\\U0001D121xxx.\"\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/NonlocalForParameter32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f(a):\n    nonlocal a\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/NonlocalNotFound32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef testNonlocal():\n    x = 0\n    y = 0\n\n    def f():\n        nonlocal z\n\n    f()\n\n\ntestNonlocal()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/StarImportExtra.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ntry:\n    from sys import not_there, * # isort:skip\nexcept Exception as e:\n    print( \"Star import with extra stuff not present gave\", e )\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/SyntaxError.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\n# Test the syntax error case:\n\ndef nested():\n   claxss ProxyBase(metaclass=ProxyType):\n      pass\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/TryExceptAllNotLast.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f():\n    try:\n        raise A\n    except:\n        print(\"caught\")\n    except A:\n        print(\"hit\")\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/TryFinallyContinue_37.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f():\n    for i in range(10):\n        try:\n            undefined\n        finally:\n            continue\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/UnpackNoTuple.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n*a = 1\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/UnpackTwoStars32.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfoo, *bar, baz, *a, b = name.split(\"/\")\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/YieldFromInModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nx = yield from range(8)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/YieldInAsync35.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nasync def g():\n    yield from None\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/YieldInGenexp38.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef strangeLambdaGeneratorExpression():\n    x = ((yield) for i in (1, 2) if (yield))\n\n    print(\"Strange lambda generator expression\")\n    print(list(x))\n\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/YieldInModule.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nx = yield i\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/syntax/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Runner for syntax tests of Nuitka.\n\nIn some cases, the ast module doesn't raise the syntax errors for us, but\nwe need to check them manually and raise explicitly. This aims at showing\nwe do it in the same way.\n\"\"\"\n\n\nimport os\nimport sys\n\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nfrom nuitka.tools.testing.Common import (\n    compareWithCPython,\n    createSearchMode,\n    decideFilenameVersionSkip,\n    setup,\n)\n\n\ndef main():\n    setup(suite=\"syntax\", needs_io_encoding=True)\n\n    search_mode = createSearchMode()\n\n    for filename in sorted(os.listdir(\".\")):\n        if not filename.endswith(\".py\"):\n            continue\n\n        if not decideFilenameVersionSkip(filename):\n            continue\n\n        active = search_mode.consider(dirname=None, filename=filename)\n\n        if active:\n            extra_flags = [\n                \"expect_failure\",\n                \"remove_output\",\n                \"syntax_errors\",\n                \"--nofollow-imports\",\n            ]\n\n            compareWithCPython(\n                dirname=None,\n                filename=filename,\n                extra_flags=extra_flags,\n                search_mode=search_mode,\n                needs_2to3=False,\n            )\n\n    search_mode.finish()\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/run_all.py",
    "content": "#!/usr/bin/env python\n#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Test runners test\n\nThis shows that typical test runners like nose and py.test can be used with\ncompiled packages.\n\n\"\"\"\n\nimport os\nimport sys\n\n# Find nuitka package relative to us.\nsys.path.insert(\n    0,\n    os.path.normpath(\n        os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"..\")\n    ),\n)\n\n# isort:start\n\nimport subprocess\n\nfrom nuitka.tools.testing.Common import getTempDir, my_print, setup\nfrom nuitka.utils.FileOperations import copyTree, openTextFile\n\n\ndef main():\n    setup(suite=\"test-runners\")\n\n    os.chdir(\"subject\")\n\n    nuitka_main_path = os.path.join(\"..\", \"..\", \"..\", \"bin\", \"nuitka\")\n    tmp_dir = getTempDir()\n\n    command = [\n        os.environ[\"PYTHON\"],\n        nuitka_main_path,\n        \"--enable-plugin=pylint-warnings\",\n        \"--output-dir=%s\" % tmp_dir,\n        \"--include-package=package\",\n        \"--nofollow-import-to=*.tests\",\n        \"--debug\",\n        \"--module\",\n        \"package\",\n    ]\n\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n    os.makedirs(os.path.join(tmp_dir, \"package.ext\"))\n    copyTree(\"package\", os.path.join(tmp_dir, \"package.ext/package\"))\n\n    os.chdir(tmp_dir)\n\n    # We compile the package non-closed, so we can smuggle in tests\n    # and user code. This is going to be the example code.\n    with openTextFile(\"package.ext/package/user_provided.py\", \"w\") as output:\n        # TODO: Maybe assert that the type name of a local function and one from\n        # the package are not the same, i.e. we are running inside the compiled\n        # package.\n        output.write(\n            \"\"\"\nfrom __future__ import print_function\n\nimport package\nprint(\"__name__:\",    package.__name__)\nprint(\"__package__:\", package.__package__)\nprint(\"__path__:\",    package.__path__)\nprint(\"__file__:\",    package.__file__)\n# print(\"__loader__:\",    package.__loader__)\n\nimport package.sub_package1\nprint(\"__name__:\",    package.sub_package1.__name__)\nprint(\"__package__:\", package.sub_package1.__package__)\nprint(\"__path__:\",    package.sub_package1.__path__)\nprint(\"__file__:\",    package.sub_package1.__file__)\n# print(\"__loader__:\",    package.sub_package1.__loader__)\n\nimport package.sub_package1.tests;\nprint(\"__name__:\",    package.sub_package1.tests.__name__)\nprint(\"__package__:\", package.sub_package1.tests.__package__)\nprint(\"__path__:\",    package.sub_package1.tests.__path__)\nprint(\"__file__:\",    package.sub_package1.tests.__file__)\n# print(\"__loader__:\",    package.sub_package1.tests.__loader__)\n\"\"\"\n        )\n\n    os.makedirs(\"nose\")\n    with openTextFile(\"nose/usage.txt\", \"w\") as output:\n        pass\n\n    os.system(\"find | sort\")\n\n    # Inform about the extra path, format is NUITKA_PACKAGE_fullname where\n    # dots become \"_\" and should point to the directory where external code\n    # to be loaded will live under. Probably should be an absolute path, but\n    # we avoid it here.\n    os.environ[\"NUITKA_PACKAGE_package\"] = \"./package.ext/package\"\n\n    # Lets make sure these to not work. These will be used in the compiled\n    # form only.\n    for module_path in (\"__init__.py\", \"sub_package1__init__.py\"):\n        with openTextFile(\n            os.path.join(\"./package.ext/package\", module_path), \"w\"\n        ) as output:\n            output.write(\"assert False\")\n\n    # Check the compiled package is functional for importing.\n    my_print(\"Running package as basic test:\")\n    command = [os.environ[\"PYTHON\"], \"-c\", \"import package\"]\n\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n    my_print(\"Running nose tests:\")\n    # assert os.system(os.environ[\"PYTHON\"] + \" -m nose --first-package-wins -s package.sub_package1.tests\") == 0\n\n    my_print(\"Running py.test tests:\")\n    command = [\n        os.environ[\"PYTHON\"],\n        \"-m\",\n        \"pytest\",\n        \"-v\",\n        \"--pyargs\",\n        \"package.sub_package1.tests\",\n    ]\n\n    result = subprocess.call(command)\n\n    if result != 0:\n        sys.exit(result)\n\n\nif __name__ == \"__main__\":\n    main()\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/Something.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef calledByTest():\n    return 42\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Package to be compiled. \"\"\"\n\nfrom . import user_provided\n\n\ndef runtest():\n    import nose\n\n    nose.run(\"package\", \"package\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package1/SubSomething1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef calledByTest1():\n    return 42, 1\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package1/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package1/tests/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Package to be compiled. \"\"\"\n\n\ndef runtest():\n    import nose\n\n    nose.run(\"package\", \"package\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package1/tests/test_subsomething1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .. import SubSomething1\n\n\ndef test_subfunc1():\n    assert SubSomething1.calledByTest1() == (42, 1)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package2/SubSomething2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef calledByTest2():\n    return 42, 2\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package2/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package2/tests/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\"\"\" Package to be compiled. \"\"\"\n\n\ndef runtest():\n    import nose\n\n    nose.run(\"package\", \"package\")\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/sub_package2/tests/test_subsomething2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nfrom .. import SubSomething2\n\n\ndef test_func():\n    assert SubSomething2.calledByTest2() == (42, 2)\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/tests/__init__.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/test-runners/subject/package/tests/test_something.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\nimport package.Something\n\n\ndef test_func():\n    assert package.Something.calledByTest() == 42\n\n\n#     Python test originally created or extracted from other peoples work. The\n#     parts from me are licensed as below. It is at least Free Software where\n#     it's copied from other people. In these cases, that will normally be\n#     indicated.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#         http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/type_inference/Test1.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\ndef f():\n    a = 3\n    b = 7\n    c = b / a\n\n    return c\n\nprint f()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/type_inference/Test2.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f():\n    a = []\n\n    print a\n\n    for i in range(5):\n        print a\n\n        a.append(i)\n\n    return len(a)\n\nprint f()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/type_inference/Test3.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\ndef f(cond):\n    y = 3\n\n    if cond:\n        x = 1\n    else:\n        x = 2\n\n    return x < y\n\nprint f(0), f(1)\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  },
  {
    "path": "tests/type_inference/Test4.py",
    "content": "#     Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file\n\n\n\ndef someUnpackingFunction():\n    i1, i2, i3 = range(3)\n\n    print i1, i2, i3\n\n    return i1+i2+i3\n\n\nprint someUnpackingFunction()\n\ndef someShortUnpackingFunction():\n    a, b = 1,2\n    return a*b                  #return a,b\nprint someShortUnpackingFunction()\n\n#     Python tests originally created or extracted from other peoples work. The\n#     parts were too small to be protected.\n#\n#     Licensed under the Apache License, Version 2.0 (the \"License\");\n#     you may not use this file except in compliance with the License.\n#     You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n#     Unless required by applicable law or agreed to in writing, software\n#     distributed under the License is distributed on an \"AS IS\" BASIS,\n#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#     See the License for the specific language governing permissions and\n#     limitations under the License.\n"
  }
]